@lovrabet/rabetbase-cli 2.3.15-beta.2 → 2.3.16-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.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/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -0
- package/lib/commands/kb/delete.js +1 -0
- package/lib/commands/kb/detail.js +1 -0
- package/lib/commands/kb/index.js +1 -0
- package/lib/commands/kb/list.js +1 -0
- package/lib/commands/kb/shared.js +1 -0
- package/lib/commands/kb/update.js +1 -0
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.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/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.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/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.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/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.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/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -0
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.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/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a198_0x551a16=a198_0x5ba3;(function(_0x45b7b1,_0x24853c){const _0x1224f=a198_0x5ba3,_0x3707c6=_0x45b7b1();while(!![]){try{const _0x5568cd=-parseInt(_0x1224f(0xb6))/0x1*(-parseInt(_0x1224f(0xb1))/0x2)+parseInt(_0x1224f(0xd1))/0x3*(-parseInt(_0x1224f(0xdd))/0x4)+-parseInt(_0x1224f(0xb5))/0x5*(parseInt(_0x1224f(0xc5))/0x6)+parseInt(_0x1224f(0xdc))/0x7*(parseInt(_0x1224f(0xd4))/0x8)+parseInt(_0x1224f(0xd9))/0x9+-parseInt(_0x1224f(0xd3))/0xa+-parseInt(_0x1224f(0xbd))/0xb*(-parseInt(_0x1224f(0xb3))/0xc);if(_0x5568cd===_0x24853c)break;else _0x3707c6['push'](_0x3707c6['shift']());}catch(_0x1cdbef){_0x3707c6['push'](_0x3707c6['shift']());}}}(a198_0x2af3,0x7476c));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{dirname,parse,resolve}from'node:path';function a198_0x5ba3(_0x2868de,_0x2bfb38){_0x2868de=_0x2868de-0xb0;const _0x2af397=a198_0x2af3();let _0x5ba358=_0x2af397[_0x2868de];return _0x5ba358;}function a198_0x2af3(){const _0x2c1e3b=['stringify','1018884yyRSDg','data','migrated','warn','riskLevel','appcode','string','parse','accessKey','apiDir','env','trim','33AJQNNl','object','3963310uLedPR','1502008qWNZLN','format','status','cwd','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','6505263GXZdnP','project','cookie','7URgVzj','244960BYAgWC','missing','locale','pageSize','2LSjIrO','app','5052JVPnvJ','empty','10wTKnHT','5251DEYTRc','utf8','defaultApp','.rabetbase.json','length','message','\x0a\x20\x20','25366IlHKaH','Global','keys','set','apps','error','config'];a198_0x2af3=function(){return _0x2c1e3b;};return a198_0x2af3();}import{homedir}from'node:os';import{CLI_BIN_NAME}from'../constant/cli.js';export const NEW_CONFIG_NAME=a198_0x551a16(0xb9);export const CONFIG_NAMES=[a198_0x551a16(0xb9),'.lovrabet.json','.lovrabetrc'];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x1b733b=>_0x1b733b!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x18994c){for(const _0x112a06 of CONFIG_NAMES){const _0x3babbd=resolve(_0x18994c,_0x112a06);if(existsSync(_0x3babbd))return _0x3babbd;}return undefined;}export function findProjectRootDirectory(_0x35efd7=process[a198_0x551a16(0xd7)]()){let _0xec9c4d=resolve(_0x35efd7);const {root:_0x1c51f7}=parse(_0xec9c4d),_0x928d86=homedir();while(!![]){if(resolveConfigPath(_0xec9c4d)){if(_0xec9c4d===_0x928d86)break;return _0xec9c4d;}if(_0xec9c4d===_0x1c51f7||_0xec9c4d===_0x928d86)break;const _0x19a3e7=dirname(_0xec9c4d);if(_0x19a3e7===_0xec9c4d)break;_0xec9c4d=_0x19a3e7;}return resolve(_0x35efd7);}export function getProjectConfigPath(){const _0x3daf18=a198_0x551a16;return resolveConfigPath(process[_0x3daf18(0xd7)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x28e7a7){const _0x345762=a198_0x551a16;if(!existsSync(_0x28e7a7))return{'status':_0x345762(0xde)};try{const _0x407817=readFileSync(_0x28e7a7,{'encoding':_0x345762(0xb7)});if(!_0x407817?.['trim']())return{'status':_0x345762(0xb4)};const _0x3f51f9=JSON[_0x345762(0xcc)](_0x407817);return{'status':'ok','data':_0x3f51f9};}catch(_0xafa438){return{'status':_0x345762(0xc2),'message':_0xafa438 instanceof Error?_0xafa438[_0x345762(0xbb)]:String(_0xafa438)};}}function parseCliConfigJsonFile(_0x3596e1,_0x40f7d1,_0x3c9adf){const _0x2d434a=a198_0x551a16,_0x342358=inspectCliConfigJsonFile(_0x3596e1);if(_0x342358[_0x2d434a(0xd6)]===_0x2d434a(0xde)||_0x342358['status']===_0x2d434a(0xb4))return{};if(_0x342358['status']==='ok')return _0x342358[_0x2d434a(0xc6)];return _0x40f7d1===_0x2d434a(0xc8)&&_0x3c9adf&&console[_0x2d434a(0xc2)](CLI_BIN_NAME+':\x20'+_0x3c9adf+_0x2d434a(0xd8)+_0x3596e1+_0x2d434a(0xbc)+_0x342358[_0x2d434a(0xbb)]),{};}function normalizeLegacyConfigShape(_0x932c6d){const _0x4e516e=a198_0x551a16;if(!_0x932c6d||typeof _0x932c6d!==_0x4e516e(0xd2))return{'config':{},'migrated':![]};const _0x10baf7={..._0x932c6d},_0x3b4a2a=_0x10baf7[_0x4e516e(0xc1)]&&typeof _0x10baf7[_0x4e516e(0xc1)]==='object'?{..._0x10baf7[_0x4e516e(0xc1)]}:{},_0x495b79=Object[_0x4e516e(0xbf)](_0x3b4a2a)[_0x4e516e(0xba)],_0x4c96ec=_0x10baf7[_0x4e516e(0xca)]||_0x10baf7[_0x4e516e(0xb2)];let _0x42236e=![];if(_0x4c96ec&&_0x495b79===0x0){const _0x196904=typeof _0x10baf7[_0x4e516e(0xb8)]===_0x4e516e(0xcb)&&_0x10baf7[_0x4e516e(0xb8)][_0x4e516e(0xd0)]()?_0x10baf7['defaultApp']:String(_0x4c96ec)['trim']();_0x3b4a2a[_0x196904]={'appcode':String(_0x4c96ec)[_0x4e516e(0xd0)](),..._0x10baf7[_0x4e516e(0xcf)]!=null?{'env':_0x10baf7[_0x4e516e(0xcf)]}:{},..._0x10baf7[_0x4e516e(0xce)]!=null?{'apiDir':_0x10baf7[_0x4e516e(0xce)]}:{},..._0x10baf7[_0x4e516e(0xdb)]!=null?{'cookie':_0x10baf7[_0x4e516e(0xdb)]}:{},..._0x10baf7[_0x4e516e(0xcd)]!=null?{'accessKey':_0x10baf7['accessKey']}:{},..._0x10baf7['format']!=null?{'format':_0x10baf7[_0x4e516e(0xd5)]}:{},..._0x10baf7[_0x4e516e(0xb0)]!=null?{'pageSize':_0x10baf7[_0x4e516e(0xb0)]}:{},..._0x10baf7[_0x4e516e(0xc9)]!=null?{'riskLevel':_0x10baf7[_0x4e516e(0xc9)]}:{},..._0x10baf7[_0x4e516e(0xdf)]!=null?{'locale':_0x10baf7[_0x4e516e(0xdf)]}:{}},_0x10baf7[_0x4e516e(0xc1)]=_0x3b4a2a;if(!_0x10baf7[_0x4e516e(0xb8)])_0x10baf7['defaultApp']=_0x196904;_0x42236e=!![];}return('appcode'in _0x10baf7||_0x4e516e(0xb2)in _0x10baf7)&&(delete _0x10baf7['appcode'],delete _0x10baf7[_0x4e516e(0xb2)],_0x42236e=!![]),{'config':_0x10baf7,'migrated':_0x42236e};}function writeNormalizedConfigIfNeeded(_0x2216a4,_0x16fcac){const _0x36c852=a198_0x551a16,_0x4e5318=JSON[_0x36c852(0xc4)](_0x16fcac,null,0x2)+'\x0a';if(normalizedWriteCache['get'](_0x2216a4)===_0x4e5318)return;writeConfigFile(_0x2216a4,_0x16fcac),normalizedWriteCache[_0x36c852(0xc0)](_0x2216a4,_0x4e5318);}function parseAndNormalizeConfig(_0x3c860c,_0x52f5a8,_0x148261){const _0x5e0555=a198_0x551a16,_0x2ecac8=parseCliConfigJsonFile(_0x3c860c,_0x52f5a8,_0x148261),_0x3fab61=normalizeLegacyConfigShape(_0x2ecac8);if(_0x3fab61[_0x5e0555(0xc7)])try{writeNormalizedConfigIfNeeded(_0x3c860c,_0x3fab61[_0x5e0555(0xc3)]);}catch{}return _0x3fab61[_0x5e0555(0xc3)];}export function loadRawConfigLayers(_0xbe359c){const _0x73a6f2=a198_0x551a16;let _0x42d9f6={},_0x4a046d={};const _0x4fd8bb=resolveConfigPath(homedir());_0x4fd8bb&&(_0x42d9f6=parseAndNormalizeConfig(_0x4fd8bb,'warn',_0x73a6f2(0xbe)));const _0x35fa4b=_0xbe359c??findProjectRootDirectory(),_0x10fa69=resolveConfigPath(_0x35fa4b);return _0x10fa69&&(_0x4a046d=parseAndNormalizeConfig(_0x10fa69,_0x73a6f2(0xc8),'Project')),{'globalPath':_0x4fd8bb,'projectPath':_0x10fa69,'globalConfig':_0x42d9f6,'projectConfig':_0x4a046d};}const INHERIT_WHITELIST=[a198_0x551a16(0xdb),a198_0x551a16(0xcd),a198_0x551a16(0xdf),a198_0x551a16(0xd5),a198_0x551a16(0xc9),a198_0x551a16(0xb0)];export function mergeRawConfigLayers(_0x47d555){const _0x1027be=a198_0x551a16,{globalConfig:_0x596e51,projectConfig:_0x1668ec}=_0x47d555,_0x39f8e2=Object[_0x1027be(0xbf)](_0x1668ec)[_0x1027be(0xba)]>0x0;if(!_0x39f8e2)return mergeGlobalOnly(_0x596e51);if(_0x1668ec['inherit']===!![])return mergeFullInherit(_0x596e51,_0x1668ec);if(_0x1668ec['inherit']===![])return mergeIsolated(_0x1668ec);return mergeProjectFirst(_0x596e51,_0x1668ec);}function mergeGlobalOnly(_0x136c85){const _0x268252=a198_0x551a16,_0x1c8dbc={..._0x136c85},_0x30391f=_0x136c85[_0x268252(0xc1)]&&typeof _0x136c85['apps']===_0x268252(0xd2)?_0x136c85['apps']:{};if(Object['keys'](_0x30391f)[_0x268252(0xba)]>0x0)_0x1c8dbc[_0x268252(0xc1)]=_0x30391f;if(_0x136c85['defaultApp'])_0x1c8dbc[_0x268252(0xb8)]=_0x136c85['defaultApp'];else{const _0x5bfef5=Object[_0x268252(0xbf)](_0x30391f);if(_0x5bfef5[_0x268252(0xba)]>0x0)_0x1c8dbc[_0x268252(0xb8)]=_0x5bfef5[0x0];}return _0x1c8dbc;}function mergeIsolated(_0x2ed985){const _0x11e267=a198_0x551a16,_0x45b4a0={..._0x2ed985};delete _0x45b4a0['inherit'];const _0x49d209=_0x2ed985[_0x11e267(0xc1)]&&typeof _0x2ed985[_0x11e267(0xc1)]===_0x11e267(0xd2)?_0x2ed985[_0x11e267(0xc1)]:{};Object[_0x11e267(0xbf)](_0x49d209)[_0x11e267(0xba)]>0x0?_0x45b4a0[_0x11e267(0xc1)]=_0x49d209:delete _0x45b4a0['apps'];if(_0x11e267(0xb8)in _0x2ed985)_0x45b4a0[_0x11e267(0xb8)]=_0x2ed985[_0x11e267(0xb8)];else Object[_0x11e267(0xbf)](_0x49d209)[_0x11e267(0xba)]>0x0?_0x45b4a0[_0x11e267(0xb8)]=Object[_0x11e267(0xbf)](_0x49d209)[0x0]:delete _0x45b4a0[_0x11e267(0xb8)];return _0x45b4a0;}function mergeProjectFirst(_0x184dd5,_0x3b5b61){const _0x428042=a198_0x551a16,_0xb335ba={..._0x3b5b61};delete _0xb335ba['inherit'];for(const _0x1b607d of INHERIT_WHITELIST){!(_0x1b607d in _0xb335ba)&&_0x1b607d in _0x184dd5&&(_0xb335ba[_0x1b607d]=_0x184dd5[_0x1b607d]);}const _0x5526dd=_0x3b5b61[_0x428042(0xc1)]&&typeof _0x3b5b61[_0x428042(0xc1)]===_0x428042(0xd2)?_0x3b5b61['apps']:{};Object['keys'](_0x5526dd)[_0x428042(0xba)]>0x0?_0xb335ba[_0x428042(0xc1)]=_0x5526dd:delete _0xb335ba[_0x428042(0xc1)];if(_0x428042(0xb8)in _0x3b5b61)_0xb335ba[_0x428042(0xb8)]=_0x3b5b61['defaultApp'];else Object[_0x428042(0xbf)](_0x5526dd)[_0x428042(0xba)]>0x0?_0xb335ba[_0x428042(0xb8)]=Object['keys'](_0x5526dd)[0x0]:delete _0xb335ba[_0x428042(0xb8)];return _0xb335ba;}function mergeFullInherit(_0x2d76d8,_0xd0c20a){const _0x2b500f=a198_0x551a16,_0x25ed7e=_0x2d76d8[_0x2b500f(0xc1)]&&typeof _0x2d76d8['apps']===_0x2b500f(0xd2)?_0x2d76d8[_0x2b500f(0xc1)]:{},_0x29891d=_0xd0c20a['apps']&&typeof _0xd0c20a[_0x2b500f(0xc1)]==='object'?_0xd0c20a[_0x2b500f(0xc1)]:{},_0x422300={..._0x25ed7e,..._0x29891d},_0xa8603={..._0x2d76d8,..._0xd0c20a};delete _0xa8603['inherit'];if(Object['keys'](_0x422300)[_0x2b500f(0xba)]>0x0)_0xa8603[_0x2b500f(0xc1)]=_0x422300;if(_0x2b500f(0xb8)in _0xd0c20a)_0xa8603['defaultApp']=_0xd0c20a[_0x2b500f(0xb8)];else{if(Object[_0x2b500f(0xbf)](_0x29891d)[_0x2b500f(0xba)]>0x0)_0xa8603[_0x2b500f(0xb8)]=Object[_0x2b500f(0xbf)](_0x29891d)[0x0];else{if(_0x2d76d8[_0x2b500f(0xb8)])_0xa8603['defaultApp']=_0x2d76d8[_0x2b500f(0xb8)];else{const _0x2ccc82=Object[_0x2b500f(0xbf)](_0x25ed7e);if(_0x2ccc82[_0x2b500f(0xba)]>0x0)_0xa8603[_0x2b500f(0xb8)]=_0x2ccc82[0x0];}}}return _0xa8603;}export function readRawConfigWithLayers(_0x3edd96){const _0x5369f1=loadRawConfigLayers(_0x3edd96);return{'config':mergeRawConfigLayers(_0x5369f1),'layers':_0x5369f1};}export function readRawConfig(_0x30bf37){return mergeRawConfigLayers(loadRawConfigLayers(_0x30bf37));}export function readConfigFile(_0x240215){return parseAndNormalizeConfig(_0x240215,'silent');}export function writeConfigFile(_0x486db7,_0xe4f1cc){const _0x24fff6=a198_0x551a16,_0x3a2a90=dirname(_0x486db7);!existsSync(_0x3a2a90)&&mkdirSync(_0x3a2a90,{'recursive':!![]});const _0x2b6a83=_0x486db7+'.tmp';try{writeFileSync(_0x2b6a83,JSON['stringify'](_0xe4f1cc,null,0x2)+'\x0a',{'encoding':_0x24fff6(0xb7),'mode':0x180}),renameSync(_0x2b6a83,_0x486db7);}catch(_0x4f3cf1){try{unlinkSync(_0x2b6a83);}catch{}throw _0x4f3cf1;}}export function resolveWriteConfigPath(_0x6f7fce){const _0x4784d5=a198_0x551a16,_0x41fea6=_0x6f7fce===_0x4784d5(0xda)?process[_0x4784d5(0xd7)]():homedir(),_0xbf8f55=resolveConfigPath(_0x41fea6);return _0xbf8f55??resolve(_0x41fea6,NEW_CONFIG_NAME);}
|
|
1
|
+
const a205_0x217270=a205_0x592b;(function(_0x573e27,_0x427b8c){const _0x462749=a205_0x592b,_0x4b0f36=_0x573e27();while(!![]){try{const _0x3cfb67=-parseInt(_0x462749(0x155))/0x1+-parseInt(_0x462749(0x157))/0x2*(parseInt(_0x462749(0x168))/0x3)+-parseInt(_0x462749(0x162))/0x4*(-parseInt(_0x462749(0x16f))/0x5)+-parseInt(_0x462749(0x151))/0x6+-parseInt(_0x462749(0x170))/0x7+-parseInt(_0x462749(0x16b))/0x8*(-parseInt(_0x462749(0x164))/0x9)+parseInt(_0x462749(0x14c))/0xa;if(_0x3cfb67===_0x427b8c)break;else _0x4b0f36['push'](_0x4b0f36['shift']());}catch(_0x117263){_0x4b0f36['push'](_0x4b0f36['shift']());}}}(a205_0x46d7,0xa24e1));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{dirname,parse,resolve}from'node:path';import{homedir}from'node:os';function a205_0x592b(_0x4b81fa,_0x5d65a2){_0x4b81fa=_0x4b81fa-0x146;const _0x46d798=a205_0x46d7();let _0x592b19=_0x46d798[_0x4b81fa];return _0x592b19;}import{CLI_BIN_NAME}from'../constant/cli.js';export const NEW_CONFIG_NAME=a205_0x217270(0x169);export const CONFIG_NAMES=['.rabetbase.json',a205_0x217270(0x14a),a205_0x217270(0x172)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a205_0x217270(0x16c)](_0x5191d7=>_0x5191d7!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x1bbf5c){for(const _0x3f818c of CONFIG_NAMES){const _0x27b9ec=resolve(_0x1bbf5c,_0x3f818c);if(existsSync(_0x27b9ec))return _0x27b9ec;}return undefined;}export function findProjectRootDirectory(_0x5ba754=process['cwd']()){let _0x21c462=resolve(_0x5ba754);const {root:_0x5323c9}=parse(_0x21c462),_0xda0890=homedir();while(!![]){if(resolveConfigPath(_0x21c462)){if(_0x21c462===_0xda0890)break;return _0x21c462;}if(_0x21c462===_0x5323c9||_0x21c462===_0xda0890)break;const _0x34f182=dirname(_0x21c462);if(_0x34f182===_0x21c462)break;_0x21c462=_0x34f182;}return resolve(_0x5ba754);}function a205_0x46d7(){const _0x335b0f=['16265nuktrI','8837563cXxuXS','parse','.lovrabetrc','warn','app','env','accessKey','missing','set','.lovrabet.json','length','20817260EOFFAl','message','.tmp','locale','inherit','2510424ZBMugB','trim','config','defaultApp','1221503GIbmeI','format','4KcrFJo','appcode','empty','cookie','pageSize','utf8','Project','data','keys','status','riskLevel','708rSwxep','error','443214hCIUgT','object','apps','project','38946VxYREs','.rabetbase.json','silent','152LrMdKF','filter','stringify','cwd'];a205_0x46d7=function(){return _0x335b0f;};return a205_0x46d7();}export function getProjectConfigPath(){const _0x250556=a205_0x217270;return resolveConfigPath(process[_0x250556(0x16e)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x74253){const _0x5049f0=a205_0x217270;if(!existsSync(_0x74253))return{'status':'missing'};try{const _0x372b0f=readFileSync(_0x74253,{'encoding':_0x5049f0(0x15c)});if(!_0x372b0f?.[_0x5049f0(0x152)]())return{'status':_0x5049f0(0x159)};const _0x131dc2=JSON[_0x5049f0(0x171)](_0x372b0f);return{'status':'ok','data':_0x131dc2};}catch(_0x2352de){return{'status':_0x5049f0(0x163),'message':_0x2352de instanceof Error?_0x2352de[_0x5049f0(0x14d)]:String(_0x2352de)};}}function parseCliConfigJsonFile(_0x1f5184,_0x2e9367,_0x18b1b7){const _0x4cf84c=a205_0x217270,_0x4fe6d7=inspectCliConfigJsonFile(_0x1f5184);if(_0x4fe6d7[_0x4cf84c(0x160)]===_0x4cf84c(0x148)||_0x4fe6d7['status']==='empty')return{};if(_0x4fe6d7['status']==='ok')return _0x4fe6d7[_0x4cf84c(0x15e)];return _0x2e9367===_0x4cf84c(0x173)&&_0x18b1b7&&console['error'](CLI_BIN_NAME+':\x20'+_0x18b1b7+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0x1f5184+'\x0a\x20\x20'+_0x4fe6d7[_0x4cf84c(0x14d)]),{};}function normalizeLegacyConfigShape(_0x3623f3){const _0x28b9fc=a205_0x217270;if(!_0x3623f3||typeof _0x3623f3!==_0x28b9fc(0x165))return{'config':{},'migrated':![]};const _0x57c525={..._0x3623f3},_0x5c69ae=_0x57c525[_0x28b9fc(0x166)]&&typeof _0x57c525[_0x28b9fc(0x166)]===_0x28b9fc(0x165)?{..._0x57c525[_0x28b9fc(0x166)]}:{},_0xaf4c84=Object[_0x28b9fc(0x15f)](_0x5c69ae)['length'],_0x19cd31=_0x57c525['appcode']||_0x57c525['app'];let _0x2d094f=![];if(_0x19cd31&&_0xaf4c84===0x0){const _0x57fdcf=typeof _0x57c525['defaultApp']==='string'&&_0x57c525[_0x28b9fc(0x154)]['trim']()?_0x57c525[_0x28b9fc(0x154)]:String(_0x19cd31)[_0x28b9fc(0x152)]();_0x5c69ae[_0x57fdcf]={'appcode':String(_0x19cd31)['trim'](),..._0x57c525[_0x28b9fc(0x146)]!=null?{'env':_0x57c525[_0x28b9fc(0x146)]}:{},..._0x57c525['apiDir']!=null?{'apiDir':_0x57c525['apiDir']}:{},..._0x57c525[_0x28b9fc(0x15a)]!=null?{'cookie':_0x57c525[_0x28b9fc(0x15a)]}:{},..._0x57c525[_0x28b9fc(0x147)]!=null?{'accessKey':_0x57c525[_0x28b9fc(0x147)]}:{},..._0x57c525['format']!=null?{'format':_0x57c525[_0x28b9fc(0x156)]}:{},..._0x57c525['pageSize']!=null?{'pageSize':_0x57c525[_0x28b9fc(0x15b)]}:{},..._0x57c525[_0x28b9fc(0x161)]!=null?{'riskLevel':_0x57c525[_0x28b9fc(0x161)]}:{},..._0x57c525['locale']!=null?{'locale':_0x57c525[_0x28b9fc(0x14f)]}:{}},_0x57c525[_0x28b9fc(0x166)]=_0x5c69ae;if(!_0x57c525[_0x28b9fc(0x154)])_0x57c525[_0x28b9fc(0x154)]=_0x57fdcf;_0x2d094f=!![];}return(_0x28b9fc(0x158)in _0x57c525||_0x28b9fc(0x174)in _0x57c525)&&(delete _0x57c525[_0x28b9fc(0x158)],delete _0x57c525[_0x28b9fc(0x174)],_0x2d094f=!![]),{'config':_0x57c525,'migrated':_0x2d094f};}function writeNormalizedConfigIfNeeded(_0x2df50d,_0x3b11ab){const _0x2e64c8=a205_0x217270,_0x463401=JSON[_0x2e64c8(0x16d)](_0x3b11ab,null,0x2)+'\x0a';if(normalizedWriteCache['get'](_0x2df50d)===_0x463401)return;writeConfigFile(_0x2df50d,_0x3b11ab),normalizedWriteCache[_0x2e64c8(0x149)](_0x2df50d,_0x463401);}function parseAndNormalizeConfig(_0x5a3e78,_0xaf0e76,_0x184e1f){const _0x134c9d=a205_0x217270,_0x3507c1=parseCliConfigJsonFile(_0x5a3e78,_0xaf0e76,_0x184e1f),_0x3fe59b=normalizeLegacyConfigShape(_0x3507c1);if(_0x3fe59b['migrated'])try{writeNormalizedConfigIfNeeded(_0x5a3e78,_0x3fe59b[_0x134c9d(0x153)]);}catch{}return _0x3fe59b[_0x134c9d(0x153)];}export function loadRawConfigLayers(_0x301f7d){const _0x262801=a205_0x217270;let _0x4b7b17={},_0x4b2b52={};const _0x5ead46=resolveConfigPath(homedir());_0x5ead46&&(_0x4b7b17=parseAndNormalizeConfig(_0x5ead46,'warn','Global'));const _0x2913b3=_0x301f7d??findProjectRootDirectory(),_0x50e52d=resolveConfigPath(_0x2913b3);return _0x50e52d&&(_0x4b2b52=parseAndNormalizeConfig(_0x50e52d,'warn',_0x262801(0x15d))),{'globalPath':_0x5ead46,'projectPath':_0x50e52d,'globalConfig':_0x4b7b17,'projectConfig':_0x4b2b52};}const INHERIT_WHITELIST=[a205_0x217270(0x15a),'accessKey',a205_0x217270(0x14f),a205_0x217270(0x156),'riskLevel',a205_0x217270(0x15b)];export function mergeRawConfigLayers(_0x390a62){const _0xef336f=a205_0x217270,{globalConfig:_0x6a1fc3,projectConfig:_0x276e28}=_0x390a62,_0x378780=Object[_0xef336f(0x15f)](_0x276e28)['length']>0x0;if(!_0x378780)return mergeGlobalOnly(_0x6a1fc3);if(_0x276e28[_0xef336f(0x150)]===!![])return mergeFullInherit(_0x6a1fc3,_0x276e28);if(_0x276e28[_0xef336f(0x150)]===![])return mergeIsolated(_0x276e28);return mergeProjectFirst(_0x6a1fc3,_0x276e28);}function mergeGlobalOnly(_0x5e5b0d){const _0x2424e5=a205_0x217270,_0x2f28da={..._0x5e5b0d},_0x283bc1=_0x5e5b0d['apps']&&typeof _0x5e5b0d[_0x2424e5(0x166)]===_0x2424e5(0x165)?_0x5e5b0d['apps']:{};if(Object['keys'](_0x283bc1)[_0x2424e5(0x14b)]>0x0)_0x2f28da['apps']=_0x283bc1;if(_0x5e5b0d[_0x2424e5(0x154)])_0x2f28da[_0x2424e5(0x154)]=_0x5e5b0d[_0x2424e5(0x154)];else{const _0x53a098=Object[_0x2424e5(0x15f)](_0x283bc1);if(_0x53a098[_0x2424e5(0x14b)]>0x0)_0x2f28da['defaultApp']=_0x53a098[0x0];}return _0x2f28da;}function mergeIsolated(_0x1f0231){const _0x431f66=a205_0x217270,_0x1de170={..._0x1f0231};delete _0x1de170[_0x431f66(0x150)];const _0x458f18=_0x1f0231[_0x431f66(0x166)]&&typeof _0x1f0231[_0x431f66(0x166)]===_0x431f66(0x165)?_0x1f0231[_0x431f66(0x166)]:{};Object[_0x431f66(0x15f)](_0x458f18)[_0x431f66(0x14b)]>0x0?_0x1de170[_0x431f66(0x166)]=_0x458f18:delete _0x1de170[_0x431f66(0x166)];if(_0x431f66(0x154)in _0x1f0231)_0x1de170['defaultApp']=_0x1f0231[_0x431f66(0x154)];else Object[_0x431f66(0x15f)](_0x458f18)[_0x431f66(0x14b)]>0x0?_0x1de170[_0x431f66(0x154)]=Object['keys'](_0x458f18)[0x0]:delete _0x1de170[_0x431f66(0x154)];return _0x1de170;}function mergeProjectFirst(_0x2accfe,_0x5a91b3){const _0x58eb27=a205_0x217270,_0x3b910b={..._0x5a91b3};delete _0x3b910b['inherit'];for(const _0x1410fe of INHERIT_WHITELIST){!(_0x1410fe in _0x3b910b)&&_0x1410fe in _0x2accfe&&(_0x3b910b[_0x1410fe]=_0x2accfe[_0x1410fe]);}const _0x5ebfb4=_0x5a91b3[_0x58eb27(0x166)]&&typeof _0x5a91b3[_0x58eb27(0x166)]===_0x58eb27(0x165)?_0x5a91b3[_0x58eb27(0x166)]:{};Object[_0x58eb27(0x15f)](_0x5ebfb4)[_0x58eb27(0x14b)]>0x0?_0x3b910b[_0x58eb27(0x166)]=_0x5ebfb4:delete _0x3b910b[_0x58eb27(0x166)];if('defaultApp'in _0x5a91b3)_0x3b910b[_0x58eb27(0x154)]=_0x5a91b3[_0x58eb27(0x154)];else Object['keys'](_0x5ebfb4)['length']>0x0?_0x3b910b[_0x58eb27(0x154)]=Object['keys'](_0x5ebfb4)[0x0]:delete _0x3b910b[_0x58eb27(0x154)];return _0x3b910b;}function mergeFullInherit(_0x139550,_0x3b5189){const _0x7e56cd=a205_0x217270,_0x3130b0=_0x139550[_0x7e56cd(0x166)]&&typeof _0x139550[_0x7e56cd(0x166)]===_0x7e56cd(0x165)?_0x139550[_0x7e56cd(0x166)]:{},_0x1238ee=_0x3b5189[_0x7e56cd(0x166)]&&typeof _0x3b5189[_0x7e56cd(0x166)]===_0x7e56cd(0x165)?_0x3b5189['apps']:{},_0x3c5b68={..._0x3130b0,..._0x1238ee},_0x5be7e7={..._0x139550,..._0x3b5189};delete _0x5be7e7[_0x7e56cd(0x150)];if(Object[_0x7e56cd(0x15f)](_0x3c5b68)[_0x7e56cd(0x14b)]>0x0)_0x5be7e7[_0x7e56cd(0x166)]=_0x3c5b68;if(_0x7e56cd(0x154)in _0x3b5189)_0x5be7e7[_0x7e56cd(0x154)]=_0x3b5189[_0x7e56cd(0x154)];else{if(Object[_0x7e56cd(0x15f)](_0x1238ee)['length']>0x0)_0x5be7e7[_0x7e56cd(0x154)]=Object[_0x7e56cd(0x15f)](_0x1238ee)[0x0];else{if(_0x139550[_0x7e56cd(0x154)])_0x5be7e7[_0x7e56cd(0x154)]=_0x139550['defaultApp'];else{const _0x24971e=Object[_0x7e56cd(0x15f)](_0x3130b0);if(_0x24971e[_0x7e56cd(0x14b)]>0x0)_0x5be7e7['defaultApp']=_0x24971e[0x0];}}}return _0x5be7e7;}export function readRawConfigWithLayers(_0x2b0a3a){const _0x4be1a1=loadRawConfigLayers(_0x2b0a3a);return{'config':mergeRawConfigLayers(_0x4be1a1),'layers':_0x4be1a1};}export function readRawConfig(_0x5d4547){return mergeRawConfigLayers(loadRawConfigLayers(_0x5d4547));}export function readConfigFile(_0x588282){const _0x5ddaab=a205_0x217270;return parseAndNormalizeConfig(_0x588282,_0x5ddaab(0x16a));}export function writeConfigFile(_0x2115a4,_0x4c65f8){const _0x4b4d35=a205_0x217270,_0x14c98f=dirname(_0x2115a4);!existsSync(_0x14c98f)&&mkdirSync(_0x14c98f,{'recursive':!![]});const _0x11ac83=_0x2115a4+_0x4b4d35(0x14e);try{writeFileSync(_0x11ac83,JSON[_0x4b4d35(0x16d)](_0x4c65f8,null,0x2)+'\x0a',{'encoding':_0x4b4d35(0x15c),'mode':0x180}),renameSync(_0x11ac83,_0x2115a4);}catch(_0x3f3b49){try{unlinkSync(_0x11ac83);}catch{}throw _0x3f3b49;}}export function resolveWriteConfigPath(_0x164eb8){const _0x33b36f=a205_0x217270,_0x1b9c7f=_0x164eb8===_0x33b36f(0x167)?process['cwd']():homedir(),_0x378fdf=resolveConfigPath(_0x1b9c7f);return _0x378fdf??resolve(_0x1b9c7f,NEW_CONFIG_NAME);}
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a206_0x5554ce=a206_0x52e6;(function(_0x24b7af,_0x3cc99c){const _0x2205c1=a206_0x52e6,_0x535e7b=_0x24b7af();while(!![]){try{const _0x21ce0c=-parseInt(_0x2205c1(0xc6))/0x1+-parseInt(_0x2205c1(0xc4))/0x2*(-parseInt(_0x2205c1(0xd5))/0x3)+-parseInt(_0x2205c1(0xb8))/0x4*(-parseInt(_0x2205c1(0xcc))/0x5)+-parseInt(_0x2205c1(0xc2))/0x6*(-parseInt(_0x2205c1(0xc9))/0x7)+-parseInt(_0x2205c1(0xce))/0x8+parseInt(_0x2205c1(0xc8))/0x9*(-parseInt(_0x2205c1(0xc1))/0xa)+parseInt(_0x2205c1(0xbe))/0xb;if(_0x21ce0c===_0x3cc99c)break;else _0x535e7b['push'](_0x535e7b['shift']());}catch(_0x4bf7a8){_0x535e7b['push'](_0x535e7b['shift']());}}}(a206_0x5885,0xea815));import{resolve}from'node:path';import{CLI_BIN_NAME}from'./constant/cli.js';import{buildAuth}from'./context/auth-resolver.js';import{resolveAppConfig}from'./context/app-resolver.js';import{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile}from'./context/config-loader.js';import{logger}from'./utils/logger.js';export{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile};function env(_0x1215de){return process.env[`RABETBASE_${_0x1215de}`]||process.env[`LOVRABET_${_0x1215de}`]||undefined;}export async function createContext(_0x5be51a){const _0x6b93f4=a206_0x52e6,{config:_0x46738f,layers:_0x26b4fa}=readRawConfigWithLayers(),_0x2602d4=buildConfig(_0x46738f,_0x5be51a,_0x26b4fa),{initEnv:_0x5b70aa}=await import('./constant/env.js');if(_0x2602d4[_0x6b93f4(0xd2)])_0x5b70aa(_0x2602d4[_0x6b93f4(0xd2)]);else _0x5be51a[_0x6b93f4(0xd2)]&&typeof _0x5be51a[_0x6b93f4(0xd2)]===_0x6b93f4(0xd9)&&_0x5b70aa(_0x5be51a[_0x6b93f4(0xd2)]);const {initDomains:_0x36cbbf,getUserDomain:_0x188f51,getApiDomain:_0xdb8503}=await import(_0x6b93f4(0xb9));_0x36cbbf({'apiDomain':_0x46738f[_0x6b93f4(0xbc)]||undefined,'userDomain':_0x46738f[_0x6b93f4(0xb2)]||undefined,'runtimeDomain':_0x46738f['runtimeDomain']||undefined});const _0x1ddc4b={'apiDomain':_0xdb8503(),'userDomain':_0x188f51()},_0x27712a=await buildAuth(_0x2602d4);logger[_0x6b93f4(0xd8)](process[_0x6b93f4(0xd1)]());const _0x3d8ebd=(CLI_BIN_NAME+'\x20'+process[_0x6b93f4(0xb6)][_0x6b93f4(0xca)](0x2)['join']('\x20'))[_0x6b93f4(0xc5)]();logger[_0x6b93f4(0xcb)](_0x3d8ebd);const {isNonInteractive:_0x3084cf}=await import('./utils/is-non-interactive.js'),_0x3fef51=_0x3084cf(_0x5be51a);return{'config':_0x2602d4,'auth':_0x27712a,'logger':logger,'env':_0x1ddc4b,'nonInteractive':_0x3fef51};}export function buildConfigFromFlags(_0x265b98){const {config:_0x25adc2,layers:_0x1e3c95}=readRawConfigWithLayers();return buildConfig(_0x25adc2,_0x265b98,_0x1e3c95);}export function getConfigAppCode(_0x4a853b){const _0x18d741=a206_0x52e6,_0x3a90d0=readRawConfig(_0x4a853b);if(_0x3a90d0['apps']&&typeof _0x3a90d0[_0x18d741(0xd3)]===_0x18d741(0xba)){const _0x4c7738=_0x3a90d0[_0x18d741(0xb4)];if(_0x4c7738&&_0x3a90d0[_0x18d741(0xd3)][_0x4c7738]?.[_0x18d741(0xd4)])return String(_0x3a90d0[_0x18d741(0xd3)][_0x4c7738][_0x18d741(0xd4)])[_0x18d741(0xc5)]();const _0x1ec514=Object[_0x18d741(0xd0)](_0x3a90d0['apps'])[0x0];if(_0x1ec514?.[_0x18d741(0xd4)])return String(_0x1ec514[_0x18d741(0xd4)])[_0x18d741(0xc5)]();}const _0x45868b=_0x3a90d0[_0x18d741(0xd4)]||_0x3a90d0[_0x18d741(0xb7)];if(typeof _0x45868b!==_0x18d741(0xd9)||_0x45868b[_0x18d741(0xc5)]()==='')return undefined;return _0x45868b[_0x18d741(0xc5)]();}export function getMultiAppConfigs(_0x520606=a206_0x5554ce(0xc0),_0x3d89f5){const _0x408652=a206_0x5554ce,_0x3255ef=loadRawConfigLayers(_0x3d89f5);let _0x170f99,_0x597783;if(_0x520606===_0x408652(0xb5)){const _0x827001=_0x3255ef[_0x408652(0xcd)][_0x408652(0xd3)]&&typeof _0x3255ef['globalConfig']['apps']===_0x408652(0xba)?_0x3255ef['globalConfig']['apps']:{},_0x2f2405=_0x3255ef[_0x408652(0xc3)][_0x408652(0xd3)]&&typeof _0x3255ef[_0x408652(0xc3)][_0x408652(0xd3)]===_0x408652(0xba)?_0x3255ef[_0x408652(0xc3)][_0x408652(0xd3)]:{};_0x170f99={..._0x827001,..._0x2f2405};const _0x32cd56=readRawConfig(_0x3d89f5);_0x597783=_0x32cd56[_0x408652(0xb4)];}else _0x170f99=_0x3255ef[_0x408652(0xc3)][_0x408652(0xd3)],_0x597783=_0x3255ef[_0x408652(0xc3)]['defaultApp'];if(!_0x170f99||typeof _0x170f99!=='object'||Object['keys'](_0x170f99)[_0x408652(0xbf)]===0x0)return null;return Object['entries'](_0x170f99)[_0x408652(0xbb)](([_0x5e50bf,_0x160bd4])=>({'name':_0x5e50bf,'appcode':_0x160bd4?.[_0x408652(0xd4)]||'','isDefault':_0x5e50bf===_0x597783,'env':_0x160bd4?.[_0x408652(0xd2)],'apiDir':_0x160bd4?.[_0x408652(0xc7)],'cookie':_0x160bd4?.[_0x408652(0xb3)]||undefined}))['filter'](_0x5b425c=>_0x5b425c[_0x408652(0xd4)]);}function a206_0x5885(){const _0x491d79=['defaultApp','merged','argv','app','136IajPYm','./constant/domain.js','object','map','apiDomain','api.ts','18927502gpFILf','length','project','109060ZkpJKV','6pjDHPX','projectConfig','1354QzLasc','trim','1025598nSYAdW','apiDir','1278tvsMgK','2793658uUCWHb','slice','setRawCommand','209735EwcwoP','globalConfig','5424288BiRCeR','template_base_url','values','cwd','env','apps','appcode','2955bzuMOK','entries','find','setLogPath','string','userDomain','cookie'];a206_0x5885=function(){return _0x491d79;};return a206_0x5885();}export function getTemplateBaseUrl(_0x562ba7){const _0x3bdaa8=a206_0x5554ce,_0x34827b=readRawConfig(_0x562ba7);if(_0x34827b[_0x3bdaa8(0xcf)]&&typeof _0x34827b['template_base_url']===_0x3bdaa8(0xd9))return _0x34827b['template_base_url']['replace'](/\/$/,'');return'https://g.lovrabet.com/dist/lovrabet-skill';}function a206_0x52e6(_0x55eef0,_0x50ae58){_0x55eef0=_0x55eef0-0xb2;const _0x588531=a206_0x5885();let _0x52e6e2=_0x588531[_0x55eef0];return _0x52e6e2;}function buildConfig(_0x1329a8,_0x1aff0e,_0x283c62){return{...resolveAppConfig({'raw':_0x1329a8,'flags':_0x1aff0e,'layers':_0x283c62,'readEnv':env}),'raw':_0x1329a8};}export function resolveApiFilePath(_0xef4a90,_0x34ecab){const _0x2d0ce8=a206_0x5554ce,_0xeb7aa3=resolve(process[_0x2d0ce8(0xd1)](),_0xef4a90),_0x24424b=resolve(_0xeb7aa3,_0x2d0ce8(0xbd));if(!_0x34ecab)return _0x24424b;const _0x1152c5=readRawConfig(),_0x2bc195=_0x1152c5[_0x2d0ce8(0xd3)]&&typeof _0x1152c5[_0x2d0ce8(0xd3)]===_0x2d0ce8(0xba)?_0x1152c5['apps']:{},_0x20d254=Object[_0x2d0ce8(0xd6)](_0x2bc195)[_0x2d0ce8(0xd7)](([,_0x350b08])=>_0x350b08?.[_0x2d0ce8(0xd4)]===_0x34ecab);if(!_0x20d254)return _0x24424b;const [_0x3cfe39,_0x203b27]=_0x20d254,_0xc32da4=typeof _0x1152c5[_0x2d0ce8(0xb4)]==='string'?_0x1152c5[_0x2d0ce8(0xb4)]:undefined;if(_0x203b27?.[_0x2d0ce8(0xc7)])return _0x24424b;if(_0xc32da4&&_0x3cfe39!==_0xc32da4)return resolve(_0xeb7aa3,_0x3cfe39+'-api.ts');return _0x24424b;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5525ed,_0x4f63e2){const _0x3124a8=a207_0x4f1c,_0xd732b9=_0x5525ed();while(!![]){try{const _0x1e9ed0=parseInt(_0x3124a8(0x114))/0x1+-parseInt(_0x3124a8(0x113))/0x2*(parseInt(_0x3124a8(0x110))/0x3)+-parseInt(_0x3124a8(0x120))/0x4*(-parseInt(_0x3124a8(0x119))/0x5)+-parseInt(_0x3124a8(0x11f))/0x6+-parseInt(_0x3124a8(0x11b))/0x7*(-parseInt(_0x3124a8(0x122))/0x8)+parseInt(_0x3124a8(0x123))/0x9+parseInt(_0x3124a8(0x117))/0xa*(-parseInt(_0x3124a8(0x11a))/0xb);if(_0x1e9ed0===_0x4f63e2)break;else _0xd732b9['push'](_0xd732b9['shift']());}catch(_0x3c7834){_0xd732b9['push'](_0xd732b9['shift']());}}}(a207_0x4d15,0xe0186));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a207_0x4d15(){const _0x1c54d9=['120durDst','cwd','84355jhVrbN','1268245rSavji','521983gRdQXP','get','push','alias','3639036DMrumY','156WULpnp','set','88MdFBVc','9946251kLOSmn','2227818qNUPdD','find','api.ts','2JqtfVu','1067179YUNySC','datasetCode','exec'];a207_0x4d15=function(){return _0x1c54d9;};return a207_0x4d15();}const cache=new Map();function parseApiFile(_0x1da6c6){const _0x1d2ecf=a207_0x4f1c,_0x5851c0=[],_0x4ea657=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x223947;while((_0x223947=_0x4ea657[_0x1d2ecf(0x116)](_0x1da6c6))!==null){_0x5851c0[_0x1d2ecf(0x11d)]({'datasetCode':_0x223947[0x1],'tableName':_0x223947[0x2],'name':_0x223947[0x3],'alias':_0x223947[0x4]});}return _0x5851c0;}function a207_0x4f1c(_0x233116,_0x2b8c2c){_0x233116=_0x233116-0x110;const _0x4d1589=a207_0x4d15();let _0x4f1c0c=_0x4d1589[_0x233116];return _0x4f1c0c;}export function loadAliasMap(_0x4b75f6,_0x314592,_0x38f2e8){const _0x2e48a5=a207_0x4f1c,_0x504272=_0x38f2e8??resolve(process[_0x2e48a5(0x118)](),_0x4b75f6,_0x2e48a5(0x112));if(cache['has'](_0x504272))return cache[_0x2e48a5(0x11c)](_0x504272);if(!existsSync(_0x504272))return cache[_0x2e48a5(0x121)](_0x504272,[]),[];try{const _0x177575=readFileSync(_0x504272,'utf-8'),_0x17a22a=parseApiFile(_0x177575);return cache['set'](_0x504272,_0x17a22a),_0x17a22a;}catch{return cache['set'](_0x504272,[]),[];}}export function resolveAlias(_0x3080cf,_0x2ac01c,_0x5e2ccd,_0x130244){const _0x335020=a207_0x4f1c;if(!_0x2ac01c)return undefined;const _0x1cbc8b=loadAliasMap(_0x3080cf,_0x5e2ccd,_0x130244),_0x5b2edb=_0x1cbc8b[_0x335020(0x111)](_0x354dd6=>_0x354dd6[_0x335020(0x11e)]===_0x2ac01c);return _0x5b2edb?.[_0x335020(0x115)];}export function listAliases(_0x2b0423,_0x22315c,_0x80c6ab){return loadAliasMap(_0x2b0423,_0x22315c,_0x80c6ab);}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2ae1fb,_0x3a9d91){const _0x574c1f=a201_0x3587,_0x38c059=_0x2ae1fb();while(!![]){try{const _0x181f65=parseInt(_0x574c1f(0x233))/0x1*(-parseInt(_0x574c1f(0x218))/0x2)+parseInt(_0x574c1f(0x243))/0x3+parseInt(_0x574c1f(0x22a))/0x4*(parseInt(_0x574c1f(0x1d0))/0x5)+-parseInt(_0x574c1f(0x1b6))/0x6*(parseInt(_0x574c1f(0x1f8))/0x7)+-parseInt(_0x574c1f(0x229))/0x8+-parseInt(_0x574c1f(0x24e))/0x9+parseInt(_0x574c1f(0x272))/0xa;if(_0x181f65===_0x3a9d91)break;else _0x38c059['push'](_0x38c059['shift']());}catch(_0x509dc7){_0x38c059['push'](_0x38c059['shift']());}}}(a201_0x34b2,0x83b8a));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x560bc9){_activeCookie=_0x560bc9||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x57e40;function createFetchFailureError(_0xade678,_0x1ce908){const _0x55f8a9=a201_0x3587,_0x86603e=_0x1ce908 instanceof Error?_0x1ce908[_0x55f8a9(0x24f)]:String(_0x1ce908);return CliErrors[_0x55f8a9(0x236)]('Request\x20failed:\x20'+_0xade678+(_0x86603e?'\x20('+_0x86603e+')':''),_0x55f8a9(0x20a));}async function apiRequest(_0x597049,_0x5e83b1={}){const _0x28850e=a201_0x3587,{method:method='GET',body:_0x43291f,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x5e83b1,_0x415d3f=useRuntime?getRuntimeDomain():getApiDomain(),_0x4cbb24=_activeCookie||getCookie(),_0x544574=''+_0x415d3f+_0x597049,_0x5df2a7=new AbortController(),_0x205013=setTimeout(()=>_0x5df2a7[_0x28850e(0x1ec)](),timeout);try{const _0x30467c=await fetch(_0x544574,{'method':method,'headers':{'Content-Type':_0x28850e(0x250),'Cookie':_0x4cbb24,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x43291f?JSON['stringify'](_0x43291f):undefined,'signal':_0x5df2a7[_0x28850e(0x25e)]});let _0x3dc1f2;try{_0x3dc1f2=await _0x30467c[_0x28850e(0x1e2)]();}catch(_0x595f55){if(_0x595f55 instanceof Error&&_0x595f55[_0x28850e(0x1f6)]===_0x28850e(0x21d))throw CliErrors['apiError'](_0x28850e(0x20b)+_0x544574);if(_0x30467c['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x28850e(0x236)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x30467c[_0x28850e(0x22f)]+')',_0x30467c[_0x28850e(0x22f)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x30467c['ok']||_0x3dc1f2[_0x28850e(0x195)]===![])throw CliErrors[_0x28850e(0x236)](_0x3dc1f2[_0x28850e(0x18e)]||_0x3dc1f2[_0x28850e(0x24f)]||_0x28850e(0x240)+_0x30467c[_0x28850e(0x22f)],_0x3dc1f2[_0x28850e(0x26a)]?_0x28850e(0x1ea)+_0x3dc1f2[_0x28850e(0x26a)]:undefined);return _0x3dc1f2;}catch(_0xdee02){if(_0xdee02 instanceof CliError)throw _0xdee02;if(_0xdee02 instanceof Error&&_0xdee02[_0x28850e(0x1f6)]===_0x28850e(0x21d))throw CliErrors[_0x28850e(0x236)](_0x28850e(0x20b)+_0x544574);throw createFetchFailureError(_0x544574,_0xdee02);}finally{clearTimeout(_0x205013);}}async function apiFormRequest(_0x3b391a,_0x33e116,_0x10a1c1={}){const _0x5a4eb2=a201_0x3587,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x10a1c1,_0x39d4da=_activeCookie||getCookie(),_0x12c3fb=''+getApiDomain()+_0x3b391a,_0x5446e7=new AbortController(),_0x26a680=setTimeout(()=>_0x5446e7[_0x5a4eb2(0x1ec)](),timeout);try{const _0x187c1e=await fetch(_0x12c3fb,{'method':_0x5a4eb2(0x1a2),'headers':{'Cookie':_0x39d4da,'X-Invoke-Source':_0x5a4eb2(0x204)},'body':_0x33e116,'signal':_0x5446e7['signal']});let _0x2aff69;try{_0x2aff69=await _0x187c1e[_0x5a4eb2(0x1e2)]();}catch(_0x222c4e){if(_0x222c4e instanceof Error&&_0x222c4e[_0x5a4eb2(0x1f6)]===_0x5a4eb2(0x21d))throw CliErrors[_0x5a4eb2(0x236)](_0x5a4eb2(0x20b)+_0x12c3fb);throw CliErrors['apiError'](_0x5a4eb2(0x194)+_0x187c1e[_0x5a4eb2(0x22f)]+')',_0x187c1e[_0x5a4eb2(0x22f)]>=0x190?_0x5a4eb2(0x21e):undefined);}if(!_0x187c1e['ok']||_0x2aff69[_0x5a4eb2(0x195)]===![])throw CliErrors['apiError'](_0x2aff69[_0x5a4eb2(0x18e)]||_0x2aff69[_0x5a4eb2(0x24f)]||_0x5a4eb2(0x240)+_0x187c1e[_0x5a4eb2(0x22f)],_0x2aff69[_0x5a4eb2(0x26a)]?_0x5a4eb2(0x1ea)+_0x2aff69[_0x5a4eb2(0x26a)]:undefined);return _0x2aff69;}catch(_0x5d54cd){if(_0x5d54cd instanceof CliError)throw _0x5d54cd;if(_0x5d54cd instanceof Error&&_0x5d54cd[_0x5a4eb2(0x1f6)]==='AbortError')throw CliErrors['apiError'](_0x5a4eb2(0x20b)+_0x12c3fb);throw createFetchFailureError(_0x12c3fb,_0x5d54cd);}finally{clearTimeout(_0x26a680);}}export async function uploadDevelopmentFile(_0x40dda5,_0x495acd){const _0x177ed9=a201_0x3587,_0x49e230=await readFile(_0x495acd),_0x248387=new FormData();_0x248387['append'](_0x177ed9(0x26b),_0x40dda5),_0x248387[_0x177ed9(0x1ac)]('file',new Blob([new Uint8Array(_0x49e230)]),basename(_0x495acd));const _0x1b3400=await apiFormRequest(_0x177ed9(0x20e),_0x248387);return _0x1b3400[_0x177ed9(0x20c)];}export async function queryDevelopmentFileUrl(_0x448517,_0x39aecc={}){const _0x4a0b8d=a201_0x3587,_0x21e0e0=await apiRequest('/smartapi/common/queryFileUrl',{'method':_0x4a0b8d(0x1a2),'body':{'filePath':_0x448517,'downloadFlag':_0x39aecc[_0x4a0b8d(0x23d)]??![],..._0x39aecc[_0x4a0b8d(0x262)]?{'longTerm':!![]}:{}}});return _0x21e0e0[_0x4a0b8d(0x20c)];}export async function recognizeDevelopmentOcr(_0x16ee3a,_0x13698c){const _0x451f67=a201_0x3587,_0x28e695=new URLSearchParams({'url':_0x13698c[_0x451f67(0x188)],'type':_0x13698c[_0x451f67(0x1f4)],'appCode':_0x16ee3a}),_0x4036fe=await apiRequest(_0x451f67(0x222)+_0x28e695[_0x451f67(0x19f)](),{'method':_0x451f67(0x202)});return _0x4036fe[_0x451f67(0x20c)];}function isAuthFailure(_0x50e8c1){const _0x2f700e=a201_0x3587,_0x4db979=_0x50e8c1['errorMsg']||_0x50e8c1[_0x2f700e(0x24f)]||_0x50e8c1[_0x2f700e(0x20c)]?.[_0x2f700e(0x24f)]||_0x50e8c1[_0x2f700e(0x1fa)]||_0x50e8c1[_0x2f700e(0x277)]||'';return _0x50e8c1['errorCode']===_0x2f700e(0x275)||_0x50e8c1['code']===0x191||_0x50e8c1[_0x2f700e(0x1a5)]===_0x2f700e(0x20f)||_0x4db979[_0x2f700e(0x1b3)](_0x2f700e(0x20f))||_0x4db979['includes'](_0x2f700e(0x1a8))||_0x4db979['includes']('登录')||_0x4db979[_0x2f700e(0x1b3)]('认证');}export async function platformFetch(_0x1e92b7,_0x41b236){const _0x5b2de4=a201_0x3587;let _0x24b90a;try{_0x24b90a=await fetch(_0x1e92b7,{'method':_0x41b236[_0x5b2de4(0x27a)]??_0x5b2de4(0x202),'headers':{'Content-Type':_0x5b2de4(0x250),'Cookie':_0x41b236['cookie'],'X-Invoke-Source':'cli:rabetbase'},..._0x41b236[_0x5b2de4(0x1ba)]&&{'body':JSON[_0x5b2de4(0x25f)](_0x41b236['body'])}});}catch(_0x208401){throw createFetchFailureError(_0x1e92b7,_0x208401);}if(!_0x24b90a['ok']){if(_0x24b90a[_0x5b2de4(0x22f)]===0x191)throw CliErrors[_0x5b2de4(0x1df)]();throw CliErrors[_0x5b2de4(0x236)](_0x41b236['label']+_0x5b2de4(0x189)+_0x24b90a['status']);}const _0x4ffbba=await _0x24b90a[_0x5b2de4(0x1e2)]();if(_0x4ffbba[_0x5b2de4(0x195)]===![]){if(isAuthFailure(_0x4ffbba))throw CliErrors[_0x5b2de4(0x1df)]();throw CliErrors[_0x5b2de4(0x236)](_0x4ffbba['errorMsg']||_0x4ffbba['message']||_0x41b236[_0x5b2de4(0x1b2)]+_0x5b2de4(0x239));}return _0x4ffbba[_0x5b2de4(0x20c)];}export async function platformRequest(_0x38318c,_0x58c7f1){const _0x16ff3c=a201_0x3587;if(/^https?:\/\//i[_0x16ff3c(0x1f9)](_0x38318c))throw CliErrors['validation'](_0x16ff3c(0x22b)+_0x38318c,_0x16ff3c(0x1cc));const _0x16558a=_0x38318c[_0x16ff3c(0x1d6)]('/')?_0x38318c:'/'+_0x38318c;return platformFetch(''+getApiDomain()+_0x16558a,_0x58c7f1);}function cleanNewlines(_0x4ee8a2){const _0x34708c=a201_0x3587;return _0x4ee8a2[_0x34708c(0x208)](/[\r\n]+/g,'\x20')['trim']();}function cleanDatasetName(_0x49eefd){const _0x5c53dc=a201_0x3587;if(!_0x49eefd['name'])return _0x49eefd;return{..._0x49eefd,'name':cleanNewlines(_0x49eefd[_0x5c53dc(0x1f6)])};}export async function fetchModelList(_0x3f1a92,_0x3a7f3a){const _0x4ff767=a201_0x3587,_0x205f5b=getEnv(),_0x8c919b=new URLSearchParams({'appcode':_0x3f1a92,'otype':_0x4ff767(0x19e)}),_0x3738c7=_0x4ff767(0x23b)+_0x8c919b[_0x4ff767(0x19f)]();logger[_0x4ff767(0x26e)](_0x4ff767(0x197),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x205f5b+')',{'apiPath':_0x3738c7});const _0x5ee589=await platformRequest(_0x3738c7,{'cookie':_0x3a7f3a,'label':_0x4ff767(0x26f)}),_0x2984ff=(_0x5ee589[_0x4ff767(0x1d7)]??[])[_0x4ff767(0x19d)](cleanDatasetName);return{'configArray':_0x2984ff,'count':_0x2984ff[_0x4ff767(0x265)]};}export async function fetchDatasetDoc(_0x295adb){const _0x25cd32=a201_0x3587,{appCode:_0x2778b3,cookie:_0x68a571,datasetCode:_0x15fe1e,datasetId:_0x45fa93,extraParams:_0x1faeea}=_0x295adb,_0x1b6f35=await platformRequest(_0x25cd32(0x1d5),{'method':_0x25cd32(0x1a2),'body':{'appCode':_0x2778b3,'datasetCode':_0x15fe1e,'datasetId':_0x45fa93,..._0x1faeea||{}},'cookie':_0x68a571,'label':_0x25cd32(0x19a)+_0x15fe1e+')'});if(!_0x1b6f35||typeof _0x1b6f35[_0x25cd32(0x258)]!==_0x25cd32(0x269))throw new Error(_0x25cd32(0x1db)+_0x15fe1e+_0x25cd32(0x1d4));return _0x1b6f35[_0x25cd32(0x258)];}export async function getMenuTree(_0x1e98bd,_0x510b3b){const _0x22137c=a201_0x3587,_0x2d8097=new URLSearchParams({'appCode':_0x1e98bd});return platformRequest(_0x22137c(0x256)+_0x2d8097[_0x22137c(0x19f)](),{'cookie':_0x510b3b,'label':'Fetch\x20menu\x20list'});}export async function createMenuRecord(_0x3575f5,_0x290752,_0x3b948f){const _0x36be94=a201_0x3587;return platformRequest(_0x36be94(0x259),{'method':_0x36be94(0x1a2),'body':_0x3575f5,'cookie':_0x290752,'label':_0x3b948f});}export async function updateMenuRecord(_0x2c4004,_0x5860a5,_0x3458ee){const _0x1d3a39=a201_0x3587;return platformRequest(_0x1d3a39(0x217),{'method':'POST','body':_0x2c4004,'cookie':_0x5860a5,'label':_0x3458ee});}export async function deleteMenuRecord(_0x2b0d5a,_0x2af33f,_0x147dd3){const _0x45e09d=a201_0x3587;return platformRequest(_0x45e09d(0x18c),{'method':'POST','body':{'id':_0x2b0d5a},'cookie':_0x2af33f,'label':_0x147dd3});}export async function batchDeleteMenuRecords(_0x322ee6,_0x4a9224,_0x1538a3){const _0x723068=a201_0x3587;return platformRequest(_0x723068(0x223),{'method':_0x723068(0x1a2),'body':{'idList':_0x322ee6},'cookie':_0x4a9224,'label':_0x1538a3});}export async function startMenuRegroup(_0x8c74b7,_0xae01ef,_0x4a782f){const _0x245970=a201_0x3587;return platformRequest(_0x245970(0x1af),{'method':'POST','body':_0x8c74b7,'cookie':_0xae01ef,'label':_0x4a782f});}export async function getAsyncTaskStatus(_0x20e13a,_0x47db4e,_0x455323){const _0x537c7a=a201_0x3587,_0x3044a4=new URLSearchParams({'appCode':_0x47db4e});return platformRequest('/smartapi/tasks/'+encodeURIComponent(_0x20e13a)+'?'+_0x3044a4['toString'](),{'cookie':_0x455323,'label':_0x537c7a(0x253)+_0x20e13a});}export async function listBffScripts(_0x23a96b,_0x50efde,_0x2fadb4){const _0x183db1=a201_0x3587;let _0x4bf6e5=_0x183db1(0x1e4)+_0x23a96b;if(_0x50efde)_0x4bf6e5+=_0x183db1(0x199)+_0x50efde;const _0x4b2e35=await apiRequest(_0x4bf6e5);let _0x1a46d4=extractList(_0x4b2e35[_0x183db1(0x20c)]);if(_0x2fadb4?.[_0x183db1(0x1a7)]){const _0x313559=_0x2fadb4[_0x183db1(0x1a7)][_0x183db1(0x1cd)]();_0x1a46d4=_0x1a46d4[_0x183db1(0x1ed)](_0x11bd41=>_0x11bd41['functionName']?.['toLowerCase']()[_0x183db1(0x1b3)](_0x313559)||_0x11bd41['description']?.[_0x183db1(0x1cd)]()[_0x183db1(0x1b3)](_0x313559));}return _0x1a46d4;}export async function getBffScriptInfo(_0x4aa1a0){const _0x441df9=a201_0x3587,_0x1d2ecf=await apiRequest(_0x441df9(0x266)+_0x4aa1a0);if(!_0x1d2ecf[_0x441df9(0x20c)])throw CliErrors['validation'](_0x441df9(0x23f)+_0x4aa1a0);return _0x1d2ecf[_0x441df9(0x20c)];}export async function saveBffScript(_0x5dc704){const _0xfa9acf=a201_0x3587,_0xc8f965=await apiRequest(_0xfa9acf(0x244),{'method':_0xfa9acf(0x1a2),'body':_0x5dc704}),{id:_0x4dfd05,entity:_0x21d6ea}=normalizeEntityWithIdResponse(_0xc8f965[_0xfa9acf(0x20c)]);if(_0x4dfd05!==undefined){const _0x3f5648=typeof _0x21d6ea[_0xfa9acf(0x198)]===_0xfa9acf(0x269)||typeof _0x21d6ea[_0xfa9acf(0x21c)]==='string'?_0x21d6ea:undefined;return{'id':_0x4dfd05,'script':_0x3f5648};}throw CliErrors[_0xfa9acf(0x236)](_0xfa9acf(0x1c3));}export async function deleteBffScript(_0x147a8e){const _0x273daf=a201_0x3587;await apiRequest(_0x273daf(0x18f),{'method':_0x273daf(0x1a2),'body':{'id':_0x147a8e}});}export async function getBffScriptStatistics(_0xdd25b1){const _0x4214d3=a201_0x3587,_0x55c1f8=await apiRequest(_0x4214d3(0x1eb)+_0xdd25b1);return extractList(_0x55c1f8[_0x4214d3(0x20c)]);}export async function clearBffScriptCache(){const _0x4019b4=a201_0x3587,_0x5a2606=await apiRequest(_0x4019b4(0x247),{'method':_0x4019b4(0x1a2),'useRuntime':!![]});return typeof _0x5a2606[_0x4019b4(0x20c)]==='string'?_0x5a2606['data']:'';}export async function listBffDatasetOperations(_0x44be46,_0x251780){const _0x5e1031=a201_0x3587,_0x303a2d=await apiRequest(_0x5e1031(0x1dc),{'method':_0x5e1031(0x1a2),'body':{'appCode':_0x44be46,'datasetId':_0x251780}});return _0x303a2d[_0x5e1031(0x20c)];}export async function listSqlQueries(_0x14b5f8,_0x3e8e0d){const _0x53dba8=a201_0x3587,_0x2d3a31=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0x53dba8(0x1a2),'body':{'appCode':_0x14b5f8,'currentPage':_0x3e8e0d?.[_0x53dba8(0x26d)]??0x1,'pageSize':_0x3e8e0d?.[_0x53dba8(0x1b0)]??0x32,'sqlCode':_0x3e8e0d?.[_0x53dba8(0x1a4)],'sqlName':_0x3e8e0d?.['sqlName']}});return _0x2d3a31[_0x53dba8(0x20c)];}export async function getSqlQueryInfo(_0x154693,_0x3ab293){const _0x4c3320=a201_0x3587,_0x448abd=await listSqlQueries(_0x154693,{'sqlCode':_0x3ab293}),_0x5db937=_0x448abd['tableData']?.[0x0];if(!_0x5db937)throw CliErrors[_0x4c3320(0x230)](_0x4c3320(0x207)+_0x3ab293);return _0x5db937;}export async function getSqlQueryDetail(_0x14cb12){const _0x202c49=a201_0x3587,_0x1672aa=await apiRequest(_0x202c49(0x1fe)+('?sqlCode='+encodeURIComponent(_0x14cb12)));if(!_0x1672aa['data'])throw CliErrors[_0x202c49(0x230)](_0x202c49(0x207)+_0x14cb12);return _0x1672aa['data'];}export async function getSqlQueryDetailById(_0x47ca64){const _0x220b68=a201_0x3587,_0x1310dd=await apiRequest(_0x220b68(0x191)+_0x47ca64);if(!_0x1310dd[_0x220b68(0x20c)])throw CliErrors[_0x220b68(0x230)](_0x220b68(0x1fd)+_0x47ca64);return _0x1310dd[_0x220b68(0x20c)];}export async function createSqlQuery(_0x50467e){const _0xeeb862=a201_0x3587,_0x489da5=await apiRequest(_0xeeb862(0x1b4),{'method':_0xeeb862(0x1a2),'body':_0x50467e}),{id:_0x16f7b3,entity:_0x308561}=normalizeEntityWithIdResponse(_0x489da5[_0xeeb862(0x20c)]);if(!('sqlCode'in _0x308561)&&_0x16f7b3)return getSqlQueryDetailById(_0x16f7b3);return normalizeSqlQueryEntity(_0x308561);}export async function updateSqlQuery(_0x121701){const _0x15b4fe=a201_0x3587,_0x410b74=await apiRequest(_0x15b4fe(0x1ef),{'method':_0x15b4fe(0x1a2),'body':_0x121701}),{id:_0x25d24e,entity:_0x3f2f8f}=normalizeEntityWithIdResponse(_0x410b74[_0x15b4fe(0x20c)]);if(!('sqlCode'in _0x3f2f8f)){if(_0x121701['sqlCode'])return getSqlQueryDetail(_0x121701[_0x15b4fe(0x1a4)]);if(_0x25d24e)return getSqlQueryDetailById(_0x25d24e);}return normalizeSqlQueryEntity(_0x3f2f8f);}export async function deleteSqlQuery(_0x9e311e){const _0x496c34=a201_0x3587;await apiRequest(_0x496c34(0x1bd),{'method':_0x496c34(0x1a2),'body':_0x9e311e});}export async function saveSqlQuery(_0x18cb26){const _0x499cdd=a201_0x3587,_0x283de7=await apiRequest(_0x499cdd(0x200),{'method':_0x499cdd(0x1a2),'body':_0x18cb26});return _0x283de7[_0x499cdd(0x20c)];}function a201_0x34b2(){const _0x4e2584=['sqlCode','code','/smartapi/permit/user-role/update-user-list','scriptName','Unauthorized','tableData','enabled','version','append','/smartapi/dblink/delete','/smartapi/permit/role/delete','/smartapi/menu/regroup','pageSize','DATA_NOT_EXIST','label','includes','/smartapi/custom/saveUserCustomSql','Operation\x20\x22','114GomgLY','.getOne(id);','datasetTableCount','key','body','/smartapi/dataset/get-dataset-list','needPublic','/smartapi/custom/deleteUserCustomSql','/smartapi/dataset/delete-dataset','entries','min','warn','/generate-standard-pages/status?','BFF\x20save\x20returned\x20no\x20valid\x20id','mobile','needSelf','operationName','includeImports','update','/smartapi/dblink/getList','dbId','/smartapi/permit/role/create','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','toLowerCase','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','Dataset\x20not\x20found:\x20','475RRBWPD','/smartapi/webcode/page/restore','//\x20','isArray','):\x20missing\x20data.markdown\x20field','/api/node-toolbox/api-doc-generator','startsWith','configArray','/smartapi/question/er-config/cli/delete-single','totalCount','dbtableConfig','Invalid\x20response\x20format\x20(','/smartapi/dataset/get-dataset-operation','Page\x20not\x20found:\x20','userId','authRequired','has','/smartapi/db-analysis/jobs/cancel','json','avatar','/api/management/library/scripts/list?appCode=','/smartapi/permit/role/get-permit-list','deleted','});','/smartapi/dataset/update-driven-data','tableList','API\x20error\x20code:\x20','/api/management/library/scripts/statistics?appCode=','abort','filter','/smartapi/dblink/getTableDiffV2ByPage','/smartapi/custom/updateUserCustomSql','/smartapi/permit/resource/get-api-list','operations','clientOperationId','find','type','.remove(id);','name','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','209853EtsaMX','test','errorMessage','permits','/smartapi/db-analysis/status/','SQL\x20query\x20not\x20found:\x20id=','/smartapi/custom/getUserCustomSql','/sync-to-pages','/api/node-toolbox/sql/save','/smartapi/app/getList','GET','/smartapi/lovrabet/dataset/','cli:rabetbase','/smartapi/app-config/create','/smartapi/db-analysis/start','SQL\x20query\x20not\x20found:\x20','replace','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','Check\x20network\x20connectivity\x20and\x20try\x20again.','Request\x20timeout:\x20','data','/smartapi/dblink/create','/smartapi/common/uploadFile','401','getOne','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','API\x20error\x20code:\x20306','displayName','value','sdk','/smartapi/menu/update','852IZWcHU','\x22\x20not\x20found\x20in\x20dataset\x20','add','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','scriptType','AbortError','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','/smartapi/dblink/getAllTableList','\x20\x20pageSize:\x2020,','/smartapi/dblink/testConnect','/smartapi/ocr/recognize-text?','/smartapi/menu/batchDelete','Warning:\x20showing\x20first\x20','set','/smartapi/page/restore','requestFields','api_error','7333728KyESds','32884rsFnKj','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','sqlName','/smartapi/permit/role/get-one','/smartapi/dblink/update','status','validation','hint','modelCode','2218ZSQpqt','remark','/smartapi/app-config/update','apiError','\x20\x20currentPage:\x201,','summary','\x20failed','/generate-standard-pages/start','/api/node-toolbox/dataset/model-list?','const\x20result\x20=\x20await\x20client.models.','download','create','BFF\x20script\x20not\x20found:\x20id=','API\x20error:\x20','\x20of\x20','remove','3214413oUSVph','/api/management/library/scripts/save','list','.filter({','/api/management/script/cache/clear','roleType','ER\x20relation\x20does\x20not\x20exist','operationId','/api/','/filter','datasetName','1263906hNWkey','message','application/json','.create({\x20/*\x20fields\x20*/\x20});','/userTenant/getByTenantCode','Fetch\x20async\x20task\x20','\x20\x20sqlCode:\x20\x27','table','/smartapi/menu/find?','/smartapi/dataset/text-generate/preview','markdown','/smartapi/menu/create','isFinite','\x20apps.\x20','/smartapi/permit/resource/get-menu-list','username','signal','stringify','\x20\x20return\x20rows;','/smartapi/dblink/getOne','longTerm','description','ENABLE','length','/api/management/library/scripts/info?id=','physicalTableCount','tableName','string','errorCode','appCode','pageIndex','currentPage','info','Fetch\x20datasets','roleName','/notification/channel-config/list','12586830gwMwqy','/smartapi/permit/user-role/get-user-list','/standard-page-status?appCode=','UNAUTHORIZED','join','error','const\x20results\x20=\x20data.execResult\x20||\x20[];','object','method','url','\x20failed,\x20HTTP\x20','nickname','relation','/smartapi/menu/delete','max','errorMsg','/api/management/library/scripts/delete','target','/smartapi/custom/getUserCustomSql?id=','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','success','/smartapi/question/er-config','fetch-model-list','functionName','&type=','Fetch\x20doc\x20(','push','/smartapi/app-config/delete','map','array','toString','tags','/smartapi/dataset/get-driven-data?','POST','/smartapi/lovrabet/update-page'];a201_0x34b2=function(){return _0x4e2584;};return a201_0x34b2();}function normalizeSqlQueryEntity(_0x40655b){const _0x3b66fb=a201_0x3587;return{..._0x40655b,'id':Number(_0x40655b['id']),'dbId':_0x40655b['dbId']==null?undefined:Number(_0x40655b[_0x3b66fb(0x1ca)]),'version':_0x40655b['version']==null?undefined:Number(_0x40655b[_0x3b66fb(0x1ab)])};}export async function executeSql(_0x3088b4,_0x9c2b37,_0x589180){const _0x4c8074=a201_0x3587,_0x2e6497=await apiRequest('/api/custom/executeSql',{'method':_0x4c8074(0x1a2),'body':{'appCode':_0x3088b4,'sqlCode':_0x9c2b37,..._0x589180&&{'params':_0x589180}},'useRuntime':!![]});return _0x2e6497[_0x4c8074(0x20c)];}export async function executeDatasetDataOperation(_0x5b2fa7,_0x42c683,_0x2a114a,_0x123b37={}){const _0x506b4c=a201_0x3587;try{const _0x44905d=await apiRequest(_0x506b4c(0x24b)+_0x5b2fa7+'/'+_0x42c683+'/'+_0x2a114a,{'method':_0x506b4c(0x1a2),'body':_0x123b37,'useRuntime':!![]});return _0x44905d[_0x506b4c(0x20c)];}catch(_0x21b101){if(_0x2a114a===_0x506b4c(0x210)&&_0x21b101 instanceof CliError&&_0x21b101['code']==='api_error'&&_0x123b37['id']!==undefined&&_0x123b37['id']!==null&&_0x123b37['id']!==''){const _0x233018=await apiRequest(_0x506b4c(0x24b)+_0x5b2fa7+'/'+_0x42c683+_0x506b4c(0x24c),{'method':_0x506b4c(0x1a2),'body':{'where':{'id':{'$eq':_0x123b37['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x84bf0=Array[_0x506b4c(0x1d3)](_0x233018[_0x506b4c(0x20c)]?.[_0x506b4c(0x1a9)])?_0x233018[_0x506b4c(0x20c)]['tableData']:[];return _0x84bf0[0x0]??null;}throw _0x21b101;}}export async function listDatasets(_0x17fce0,_0x2a9851){const _0x5e90b2=a201_0x3587,_0x5861ed={'appCode':_0x17fce0,'deleted':_0x2a9851?.[_0x5e90b2(0x1e6)]??![]};if(_0x2a9851?.[_0x5e90b2(0x1a5)])_0x5861ed[_0x5e90b2(0x1a5)]=_0x2a9851[_0x5e90b2(0x1a5)];if(_0x2a9851?.[_0x5e90b2(0x1f6)])_0x5861ed['name']=_0x2a9851[_0x5e90b2(0x1f6)];const _0x527430=await apiRequest(_0x5e90b2(0x1bb),{'method':_0x5e90b2(0x1a2),'body':_0x5861ed});return extractList(_0x527430[_0x5e90b2(0x20c)]);}export async function deleteDataset(_0x449334,_0x5602fc){const _0x45d730=a201_0x3587;await apiRequest(_0x45d730(0x1be),{'method':_0x45d730(0x1a2),'body':{'appCode':_0x449334,'datasetId':_0x5602fc}});}export async function restoreDataset(_0x2a9e33,_0x3bb7fa){const _0x51bc48=a201_0x3587;await apiRequest('/smartapi/dataset/restore-dataset',{'method':_0x51bc48(0x1a2),'body':{'appCode':_0x2a9e33,'datasetId':_0x3bb7fa}});}export async function previewTextGeneratedDataset(_0xa34a33,_0x9ada16){const _0x53d532=a201_0x3587,_0x132041=await apiRequest(_0x53d532(0x257),{'method':_0x53d532(0x1a2),'body':{'appCode':_0xa34a33,'datasetName':_0x9ada16[_0x53d532(0x24d)],'requirementDescription':_0x9ada16['requirementDescription']},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x132041[_0x53d532(0x20c)];}export async function startTextGeneratedDataset(_0x2c99e8,_0x358ee3,_0x1bfaeb){const _0x1d3753=a201_0x3587,_0x32f604=await apiRequest('/smartapi/dataset/text-generate/start',{'method':_0x1d3753(0x1a2),'body':{'appCode':_0x2c99e8,..._0x1bfaeb?.[_0x1d3753(0x1f2)]?{'clientOperationId':_0x1bfaeb['clientOperationId']}:{},'design':_0x358ee3},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x32f604[_0x1d3753(0x20c)];}export async function getTextGeneratedDatasetStatus(_0x19d960,_0x43540d){const _0x3f6bcc=a201_0x3587,_0x509b92=new URLSearchParams({'appCode':_0x19d960});_0x43540d[_0x3f6bcc(0x24a)]&&_0x509b92[_0x3f6bcc(0x225)]('operationId',_0x43540d[_0x3f6bcc(0x24a)]);_0x43540d[_0x3f6bcc(0x1f2)]&&_0x509b92[_0x3f6bcc(0x225)](_0x3f6bcc(0x1f2),_0x43540d[_0x3f6bcc(0x1f2)]);const _0x56897b=await apiRequest('/smartapi/dataset/text-generate/status?'+_0x509b92[_0x3f6bcc(0x19f)]());return _0x56897b[_0x3f6bcc(0x20c)];}export async function searchDatasets(_0xa57a7d,_0x4e474a){const _0x16aef8=a201_0x3587,_0x357653=await listDatasets(_0xa57a7d,{'name':_0x4e474a}),_0x2dc3e8=_0x4e474a[_0x16aef8(0x1cd)](),_0x1a9176=new Set(_0x357653[_0x16aef8(0x19d)](_0x45f46a=>_0x45f46a['id'])),_0x1af7a7=_0x357653[_0x16aef8(0x1ed)](_0x5a4abe=>_0x5a4abe[_0x16aef8(0x1da)]?.['tableName']?.[_0x16aef8(0x1cd)]()[_0x16aef8(0x1b3)](_0x2dc3e8)||_0x5a4abe[_0x16aef8(0x263)]?.[_0x16aef8(0x1cd)]()[_0x16aef8(0x1b3)](_0x2dc3e8)),_0x5c9f02=await listDatasets(_0xa57a7d,{'code':_0x4e474a});for(const _0x27a261 of _0x5c9f02){!_0x1a9176[_0x16aef8(0x1e0)](_0x27a261['id'])&&(_0x357653[_0x16aef8(0x19b)](_0x27a261),_0x1a9176[_0x16aef8(0x21a)](_0x27a261['id']));}return _0x357653;}export function normalizeDatasetOperations(_0xe04caf){const _0x497694=a201_0x3587;if(Array[_0x497694(0x1d3)](_0xe04caf))return _0xe04caf['filter'](_0x5d1355=>_0x5d1355!=null&&typeof _0x5d1355===_0x497694(0x279));if(_0xe04caf&&typeof _0xe04caf==='object')return Object[_0x497694(0x1bf)](_0xe04caf)[_0x497694(0x1ed)](([,_0x3b051c])=>_0x3b051c!=null&&typeof _0x3b051c===_0x497694(0x279))[_0x497694(0x19d)](([_0x34bc58,_0xa3c883])=>({..._0xa3c883,'name':_0xa3c883[_0x497694(0x1f6)]??_0xa3c883[_0x497694(0x1c6)]??_0x34bc58}));return[];}export async function getDatasetDetail(_0x5bb4dc){const _0x5ad50f=a201_0x3587,_0x1c9a74=/^\d+$/[_0x5ad50f(0x1f9)](_0x5bb4dc)?'id':_0x5ad50f(0x1a5),_0x39dd61=await apiRequest(_0x5ad50f(0x1a1)+_0x1c9a74+'='+_0x5bb4dc);return _0x39dd61[_0x5ad50f(0x20c)];}export async function updateDrivenData(_0x1170f3){const _0x3d3b2c=a201_0x3587,_0x46457f=await apiRequest(_0x3d3b2c(0x1e8),{'method':'POST','body':_0x1170f3});return _0x46457f[_0x3d3b2c(0x20c)];}export async function getDatasetOperations(_0x4ef31f){const _0x15a6c5=a201_0x3587,_0x146de2=await getDatasetDetail(_0x4ef31f),_0x56b2a9=normalizeDatasetOperations(_0x146de2[_0x15a6c5(0x1f1)])[_0x15a6c5(0x19d)](_0x1aba46=>({'name':_0x1aba46[_0x15a6c5(0x1f6)]||_0x1aba46[_0x15a6c5(0x1c6)],'displayName':_0x1aba46[_0x15a6c5(0x214)]||_0x1aba46[_0x15a6c5(0x1f6)],'type':_0x1aba46[_0x15a6c5(0x1f4)],'method':_0x1aba46[_0x15a6c5(0x27a)],'path':_0x1aba46['path'],'enabled':_0x1aba46[_0x15a6c5(0x1aa)]??!![],'requestFields':_0x1aba46[_0x15a6c5(0x227)],'responseFields':_0x1aba46['responseFields']}));return{'dataset':{'id':_0x146de2['id']??_0x146de2['modelId'],'name':_0x146de2['name'],'code':_0x146de2[_0x15a6c5(0x1a5)]||_0x146de2[_0x15a6c5(0x232)],'tableName':_0x146de2[_0x15a6c5(0x268)]||_0x146de2['dbtableConfig']?.['tableName']},'operations':_0x56b2a9};}export async function getOperationDetail(_0x205e85,_0x3a4885,_0x2326d6){const _0x340d41=a201_0x3587;let _0x48aa21=_0x3a4885;if(!/^\d+$/[_0x340d41(0x1f9)](_0x3a4885)){const _0x37be7e=await listDatasets(_0x205e85,{'code':_0x3a4885}),_0x29d133=_0x37be7e['find'](_0x1d602d=>_0x1d602d[_0x340d41(0x1a5)]===_0x3a4885||String(_0x1d602d['id'])===_0x3a4885);if(!_0x29d133)throw CliErrors[_0x340d41(0x230)](_0x340d41(0x1cf)+_0x3a4885);_0x48aa21=String(_0x29d133['id']);}const _0x35a5da=await getDatasetDetail(_0x48aa21),_0xb76fe3=normalizeDatasetOperations(_0x35a5da[_0x340d41(0x1f1)])[_0x340d41(0x1f3)](_0x21e4d9=>(_0x21e4d9['name']||_0x21e4d9[_0x340d41(0x1c6)])===_0x2326d6);if(!_0xb76fe3)throw CliErrors['validation'](_0x340d41(0x1b5)+_0x2326d6+_0x340d41(0x219)+_0x3a4885);return{'dataset':{'id':_0x35a5da['id']??_0x35a5da['modelId'],'name':_0x35a5da[_0x340d41(0x1f6)],'code':_0x35a5da[_0x340d41(0x1a5)]||_0x35a5da['modelCode'],'tableName':_0x35a5da['tableName']||_0x35a5da[_0x340d41(0x1da)]?.[_0x340d41(0x268)]},'operation':_0xb76fe3};}export async function startGenerateStandardPages(_0x37e81a,_0x1d5eae,_0x22a1bc){const _0x2fafe7=a201_0x3587,_0x2b6fcf=await apiRequest(_0x2fafe7(0x203)+_0x1d5eae+_0x2fafe7(0x23a),{'method':_0x2fafe7(0x1a2),'body':{'appCode':_0x37e81a,..._0x22a1bc?.[_0x2fafe7(0x1f2)]?{'clientOperationId':_0x22a1bc[_0x2fafe7(0x1f2)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x2b6fcf[_0x2fafe7(0x20c)];}export async function getGenerateStandardPagesStatus(_0x94e943,_0x354dc6,_0x5ab1ab){const _0x27b392=a201_0x3587,_0x70da10=new URLSearchParams({'appCode':_0x94e943});_0x5ab1ab[_0x27b392(0x24a)]&&_0x70da10[_0x27b392(0x225)]('operationId',_0x5ab1ab['operationId']);_0x5ab1ab[_0x27b392(0x1f2)]&&_0x70da10['set'](_0x27b392(0x1f2),_0x5ab1ab[_0x27b392(0x1f2)]);const _0x50a6be=await apiRequest(_0x27b392(0x203)+_0x354dc6+_0x27b392(0x1c2)+_0x70da10[_0x27b392(0x19f)]());return _0x50a6be[_0x27b392(0x20c)];}export async function getStandardPageStatus(_0x46ffc2,_0x494970){const _0x30c997=a201_0x3587,_0x59a6ed=await apiRequest(_0x30c997(0x203)+_0x494970+_0x30c997(0x274)+encodeURIComponent(_0x46ffc2));return _0x59a6ed['data'];}export async function tryGetStandardPageStatus(_0x2f4b62,_0x40cb1e){const _0x2c7f5f=a201_0x3587;try{return await getStandardPageStatus(_0x2f4b62,_0x40cb1e);}catch(_0x5373b9){if(_0x5373b9 instanceof CliError&&_0x5373b9[_0x2c7f5f(0x1a5)]===_0x2c7f5f(0x228)&&/404|not found|non-json response/i[_0x2c7f5f(0x1f9)](_0x5373b9[_0x2c7f5f(0x24f)]))return null;throw _0x5373b9;}}export async function syncStandardPages(_0x30c266,_0x569bde){const _0x40991b=a201_0x3587,_0x2a5532=await apiRequest(_0x40991b(0x203)+_0x569bde+_0x40991b(0x1ff),{'method':'POST','body':{'appCode':_0x30c266}});return _0x2a5532['data'];}export async function getPageDetail(_0x32b80d){const _0x2444d8=a201_0x3587,_0x1b9be4=await apiRequest('/smartapi/lovrabet/detail?pageId='+_0x32b80d);if(!_0x1b9be4[_0x2444d8(0x20c)])throw CliErrors[_0x2444d8(0x230)](_0x2444d8(0x1dd)+_0x32b80d);return _0x1b9be4[_0x2444d8(0x20c)];}export async function listDeletedPages(_0x4473ba,_0x2ff4a8,_0x8c6db0){const _0x58b70d=a201_0x3587,_0x2af367=new URLSearchParams({'appCode':_0x4473ba,'type':_0x2ff4a8,'currentPage':String(_0x8c6db0[_0x58b70d(0x26d)]),'pageSize':String(_0x8c6db0[_0x58b70d(0x1b0)])}),_0x2e23ca=await apiRequest('/smartapi/page/getDeletedPageList?'+_0x2af367[_0x58b70d(0x19f)]());return _0x2e23ca['data'];}export async function restoreStandardPage(_0xb95312){const _0x210e60=a201_0x3587;await apiRequest(_0x210e60(0x226),{'method':_0x210e60(0x1a2),'body':{'id':_0xb95312}});}export async function restoreJsxPage(_0x9f7042,_0x330d3e){const _0x18c7e6=a201_0x3587,_0x30b27c=await apiRequest(_0x18c7e6(0x1d1),{'method':_0x18c7e6(0x1a2),'body':{'appCode':_0x9f7042,'id':_0x330d3e}});return _0x30b27c[_0x18c7e6(0x20c)];}export async function updatePage(_0x83e697,_0x510d59,_0x41fa2c,_0x236786){const _0x2e7271=a201_0x3587,_0x57a7b3=await apiRequest(_0x2e7271(0x1a3),{'method':_0x2e7271(0x1a2),'body':{'appCode':_0x83e697,'pageId':_0x510d59,'code':_0x41fa2c,'datasetIds':_0x236786}});return _0x57a7b3[_0x2e7271(0x20c)];}export function generateSdkCode(_0x183cdb,_0x34b7e2,_0x2dcdca){const _0x4590d4=a201_0x3587,_0x3d8898=_0x2dcdca?.[_0x4590d4(0x1c7)]??!![],_0x450a97='dataset_'+_0x183cdb[_0x4590d4(0x1a5)]?.['replace'](/-/g,'_'),_0x17d773=_0x34b7e2[_0x4590d4(0x1f6)]||_0x34b7e2[_0x4590d4(0x1c6)]||_0x4590d4(0x1ed),_0x3da19c=[];_0x3d8898&&_0x3da19c[_0x4590d4(0x19b)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x4590d4(0x192),'');_0x3da19c[_0x4590d4(0x19b)](_0x4590d4(0x1d2)+_0x183cdb[_0x4590d4(0x1f6)]+'\x20('+(_0x183cdb[_0x4590d4(0x268)]||_0x4590d4(0x255))+')');if(_0x17d773==='filter')_0x3da19c['push'](_0x4590d4(0x23c)+_0x450a97+_0x4590d4(0x246),'\x20\x20where:\x20{},',_0x4590d4(0x220),_0x4590d4(0x237),_0x4590d4(0x1e7));else{if(_0x17d773===_0x4590d4(0x210))_0x3da19c[_0x4590d4(0x19b)](_0x4590d4(0x23c)+_0x450a97+_0x4590d4(0x1b7));else{if(_0x17d773===_0x4590d4(0x23e))_0x3da19c['push'](_0x4590d4(0x23c)+_0x450a97+_0x4590d4(0x251));else{if(_0x17d773===_0x4590d4(0x1c8))_0x3da19c['push'](_0x4590d4(0x23c)+_0x450a97+_0x4590d4(0x209));else _0x17d773==='delete'||_0x17d773===_0x4590d4(0x242)?_0x3da19c[_0x4590d4(0x19b)](_0x4590d4(0x23c)+_0x450a97+_0x4590d4(0x1f5)):_0x3da19c[_0x4590d4(0x19b)](_0x4590d4(0x23c)+_0x450a97+'.'+_0x17d773+'(/*\x20params\x20*/);');}}}return _0x3da19c[_0x4590d4(0x276)]('\x0a');}export function generateSqlCodeTemplate(_0x58f03c,_0x12f4c5){const _0x4feaaf=a201_0x3587,_0x443a72=_0x12f4c5?.[_0x4feaaf(0x190)]??'sdk',_0x1e6d15=_0x12f4c5?.['includeImports']??!![],_0x11123a=[];return _0x11123a[_0x4feaaf(0x19b)]('//\x20SQL:\x20'+_0x58f03c[_0x4feaaf(0x22c)]+'\x20('+_0x58f03c[_0x4feaaf(0x1a4)]+')'),_0x443a72===_0x4feaaf(0x216)?(_0x1e6d15&&_0x11123a[_0x4feaaf(0x19b)](_0x4feaaf(0x21b),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x11123a['push']('const\x20data\x20=\x20await\x20client.sql.execute({',_0x4feaaf(0x254)+_0x58f03c['sqlCode']+'\x27,',_0x4feaaf(0x1ce),_0x4feaaf(0x1e7),_0x4feaaf(0x212),_0x4feaaf(0x278))):_0x11123a[_0x4feaaf(0x19b)]('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly',_0x4feaaf(0x1f7),_0x4feaaf(0x193),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x58f03c[_0x4feaaf(0x1a4)]+'\x27,',_0x4feaaf(0x211),'\x20\x20});',_0x4feaaf(0x260),'}'),_0x11123a[_0x4feaaf(0x276)]('\x0a');}export async function getErConfig(_0x32a7b,_0x420a46){const _0x3841cf=a201_0x3587,_0x4ed404=await apiRequest(_0x3841cf(0x196),{'method':'POST','body':{'appCode':_0x32a7b,'dblinkId':_0x420a46},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x4ed404[_0x3841cf(0x20c)];}export async function getErRelationDetail(_0x83fcc7,_0x541286){const _0x22d458=a201_0x3587,_0x4272b3=new URLSearchParams({'appCode':_0x83fcc7,'relationId':String(_0x541286)});try{const _0x4ee351=await apiRequest('/smartapi/question/er-config/cli/detail?'+_0x4272b3[_0x22d458(0x19f)]());return _0x4ee351[_0x22d458(0x20c)]?.[_0x22d458(0x18b)]??null;}catch(_0x2739d5){if(_0x2739d5 instanceof CliError&&_0x2739d5[_0x22d458(0x1a5)]===_0x22d458(0x228)&&(_0x2739d5[_0x22d458(0x231)]?.[_0x22d458(0x1b3)](_0x22d458(0x1b1))||_0x2739d5[_0x22d458(0x231)]===_0x22d458(0x213)&&_0x2739d5[_0x22d458(0x24f)]===_0x22d458(0x249)))return null;throw _0x2739d5;}}export async function createErRelation(_0x571d0f){const _0x296c70=a201_0x3587,_0x5da1cf=await apiRequest('/smartapi/question/er-config/cli/erCreate',{'method':_0x296c70(0x1a2),'body':_0x571d0f,'allowNonJsonSuccess':!![]});return _0x5da1cf['data'];}export async function updateErRelation(_0x1dd9d3){const _0x1b548c=a201_0x3587,_0x3a17e4=await apiRequest('/smartapi/question/er-config/cli/update-single',{'method':_0x1b548c(0x1a2),'body':_0x1dd9d3,'allowNonJsonSuccess':!![]});return _0x3a17e4[_0x1b548c(0x20c)];}export async function deleteErRelation(_0x349e70){const _0x346251=a201_0x3587,_0x4eda00=await apiRequest(_0x346251(0x1d8),{'method':_0x346251(0x1a2),'body':_0x349e70,'allowNonJsonSuccess':!![]});return _0x4eda00[_0x346251(0x20c)];}export async function updateErBusinessGroup(_0x5f4d0d){const _0x1b0746=a201_0x3587,_0x1b545b=await apiRequest('/smartapi/question/er-config/business-group/edit',{'method':'POST','body':_0x5f4d0d,'allowNonJsonSuccess':!![]});return _0x1b545b[_0x1b0746(0x20c)];}function buildQuery(_0x7826d1){const _0x2abf26=a201_0x3587,_0x300f87=new URLSearchParams();for(const [_0x191af2,_0x121cb5]of Object[_0x2abf26(0x1bf)](_0x7826d1)){if(_0x121cb5===undefined||_0x121cb5==='')continue;_0x300f87[_0x2abf26(0x225)](_0x191af2,String(_0x121cb5));}const _0x58b34e=_0x300f87['toString']();return _0x58b34e?'?'+_0x58b34e:'';}export async function listNotificationChannelConfigs(_0x5b16db,_0xcaceb2){const _0x17412f=a201_0x3587,_0x516bfb=await apiRequest(_0x17412f(0x271)+buildQuery({'appCode':_0x5b16db,'channelType':_0xcaceb2}));return Array[_0x17412f(0x1d3)](_0x516bfb[_0x17412f(0x20c)])?_0x516bfb[_0x17412f(0x20c)]:[];}export async function listAppConfigs(_0x252a85,_0x2cb380){const _0x28e8bc=a201_0x3587,_0x2d3085=await apiRequest('/smartapi/app-config/list',{'method':_0x28e8bc(0x1a2),'body':{'appCode':_0x252a85,..._0x2cb380?.[_0x28e8bc(0x1b9)]?{'key':_0x2cb380['key']}:{},..._0x2cb380?.[_0x28e8bc(0x1a0)]?{'tags':_0x2cb380[_0x28e8bc(0x1a0)]}:{}}});return extractAppConfigList(_0x2d3085['data']);}export async function getAppConfigByKey(_0x18bbfa,_0x3cba8e){const _0xdf556e=await apiRequest('/smartapi/app-config/getByKey'+buildQuery({'appCode':_0x18bbfa,'key':_0x3cba8e}));return _0xdf556e['data']??null;}export async function createAppConfig(_0x464923){const _0x16a218=a201_0x3587,_0x3e49de=await apiRequest(_0x16a218(0x205),{'method':_0x16a218(0x1a2),'body':{'appCode':_0x464923[_0x16a218(0x26b)],'key':_0x464923[_0x16a218(0x1b9)],'value':_0x464923['value'],..._0x464923[_0x16a218(0x1a0)]?{'tags':_0x464923[_0x16a218(0x1a0)]}:{}}});return _0x3e49de[_0x16a218(0x20c)];}export async function updateAppConfig(_0x457ae9){const _0x125c44=a201_0x3587;await apiRequest(_0x125c44(0x235),{'method':_0x125c44(0x1a2),'body':{'id':_0x457ae9['id'],'appCode':_0x457ae9[_0x125c44(0x26b)],'key':_0x457ae9[_0x125c44(0x1b9)],'value':_0x457ae9[_0x125c44(0x215)],..._0x457ae9['tags']?{'tags':_0x457ae9[_0x125c44(0x1a0)]}:{}}});}export async function deleteAppConfig(_0x114989){const _0x424c72=a201_0x3587;await apiRequest(_0x424c72(0x19c),{'method':_0x424c72(0x1a2),'body':_0x114989});}function extractAppConfigList(_0x40b90f){const _0x77f5c1=a201_0x3587;if(Array[_0x77f5c1(0x1d3)](_0x40b90f))return _0x40b90f;if(_0x40b90f&&typeof _0x40b90f===_0x77f5c1(0x279)&&Array[_0x77f5c1(0x1d3)](_0x40b90f['list']))return _0x40b90f[_0x77f5c1(0x245)];return extractList(_0x40b90f);}export async function listDbLinks(_0x989e1b,_0xffeae0){const _0x3f5e73=a201_0x3587,_0x201212=await apiRequest(_0x3f5e73(0x1c9),{'method':_0x3f5e73(0x1a2),'body':{'appCode':_0x989e1b,'currentPage':_0xffeae0?.[_0x3f5e73(0x26d)]??0x1,'pageSize':_0xffeae0?.[_0x3f5e73(0x1b0)]??0x64}});return{'items':extractList(_0x201212['data']),'paging':extractPaging(_0x201212[_0x3f5e73(0x20c)])};}export async function getDbLinkInfo(_0x90c1a1){const _0x35c5b2=a201_0x3587,_0x4b702e=await apiRequest(_0x35c5b2(0x261)+buildQuery({'id':_0x90c1a1}));return _0x4b702e[_0x35c5b2(0x20c)];}export async function createDbLink(_0x5d7a4f){const _0x11e613=a201_0x3587,_0x49bfad=await apiRequest(_0x11e613(0x20d),{'method':'POST','body':_0x5d7a4f});return _0x49bfad['data'];}export async function updateDbLink(_0x1287b4){const _0x32e028=a201_0x3587,_0x1a3930=await apiRequest(_0x32e028(0x22e),{'method':_0x32e028(0x1a2),'body':_0x1287b4});return _0x1a3930[_0x32e028(0x20c)];}export async function deleteDbLink(_0x55c6d8){const _0x176682=a201_0x3587;await apiRequest(_0x176682(0x1ad),{'method':'POST','body':{'id':_0x55c6d8}});}export async function testDbLinkConnect(_0x2c9b70){const _0x10a13b=a201_0x3587,_0x2fd41c=await apiRequest(_0x10a13b(0x221)+buildQuery({'id':_0x2c9b70}));return _0x2fd41c[_0x10a13b(0x20c)];}export async function startDbAnalysis(_0x488fcc,_0x57fc30){const _0x1f2af2=a201_0x3587,_0x30bccc=await apiRequest(_0x1f2af2(0x206),{'method':'POST','body':{'dbLinkId':_0x488fcc,..._0x57fc30&&_0x57fc30[_0x1f2af2(0x265)]>0x0?{'tableNames':_0x57fc30}:{}}});return _0x30bccc['data'];}export async function cancelDbAnalysis(_0xc66de8){const _0x330e6b=a201_0x3587;await apiRequest(_0x330e6b(0x1e1)+buildQuery({'planId':_0xc66de8}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x26cc6b){const _0x1bae63=a201_0x3587,_0x2ab46d=await apiRequest(_0x1bae63(0x1fc)+encodeURIComponent(_0x26cc6b));return _0x2ab46d[_0x1bae63(0x20c)];}export async function getDbAllTableList(_0x5c64c,_0x536945){const _0x614ba3=a201_0x3587,_0x4d0763=await apiRequest(_0x614ba3(0x21f)+buildQuery({'appCode':_0x5c64c,'dbLinkId':_0x536945})),_0xb1db41=_0x4d0763[_0x614ba3(0x20c)];if(Array[_0x614ba3(0x1d3)](_0xb1db41))return _0xb1db41;return extractList(_0xb1db41);}export async function getDbTableDiff(_0x4fed09,_0x33a0a7,_0xf94192){const _0x48fca4=a201_0x3587,_0x5c1332=await apiRequest(_0x48fca4(0x1ee)+buildQuery({'appCode':_0x4fed09,'dbLinkId':_0x33a0a7,'pageIndex':_0xf94192?.[_0x48fca4(0x26c)]??0x1,'pageSize':_0xf94192?.[_0x48fca4(0x1b0)]??0x14,'tableName':_0xf94192?.[_0x48fca4(0x268)]})),_0x3566e8=_0x5c1332['data'];return{'totalCount':_0x3566e8?.['totalCount']??0x0,'physicalTableCount':_0x3566e8?.[_0x48fca4(0x267)]??0x0,'datasetTableCount':_0x3566e8?.[_0x48fca4(0x1b8)]??0x0,..._0x3566e8?.[_0x48fca4(0x238)]?{'summary':_0x3566e8[_0x48fca4(0x238)]}:{},'tableList':Array[_0x48fca4(0x1d3)](_0x3566e8?.[_0x48fca4(0x1e9)])?_0x3566e8[_0x48fca4(0x1e9)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x514ca5=a201_0x3587,_0x4f9eda=await apiRequest(_0x514ca5(0x201),{'method':_0x514ca5(0x1a2),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x3b933f=extractList(_0x4f9eda[_0x514ca5(0x20c)]),_0x1587ba=extractPaging(_0x4f9eda[_0x514ca5(0x20c)]);return _0x1587ba&&_0x1587ba[_0x514ca5(0x1d9)]>REMOTE_APP_PAGE_SIZE&&console[_0x514ca5(0x1c1)](_0x514ca5(0x224)+REMOTE_APP_PAGE_SIZE+_0x514ca5(0x241)+_0x1587ba[_0x514ca5(0x1d9)]+_0x514ca5(0x25b)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x3b933f;}const APP_ROLE_PAGE_SIZE_MAX=0x64;function a201_0x3587(_0x1762ec,_0x502bef){_0x1762ec=_0x1762ec-0x188;const _0x34b2a6=a201_0x34b2();let _0x3587e6=_0x34b2a6[_0x1762ec];return _0x3587e6;}export async function listAppRoles(_0x33fa93,_0x42d3ae){const _0x2a9689=a201_0x3587,_0x53b934=Math[_0x2a9689(0x1c0)](Math[_0x2a9689(0x18d)](_0x42d3ae?.['pageSize']??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x125319=await apiRequest('/smartapi/permit/role/get-list',{'method':_0x2a9689(0x1a2),'body':{'appCode':_0x33fa93,'currentPage':_0x42d3ae?.[_0x2a9689(0x26d)]??0x1,'pageSize':_0x53b934}});return{'items':extractList(_0x125319[_0x2a9689(0x20c)]),'paging':extractPaging(_0x125319[_0x2a9689(0x20c)])};}export async function getAppRole(_0x2d9845){const _0x5ecde6=a201_0x3587,_0x3d52a2=await apiRequest(_0x5ecde6(0x22d)+buildQuery({'id':_0x2d9845}));return _0x3d52a2[_0x5ecde6(0x20c)];}export async function createAppRole(_0x19daae){const _0xccdff6=a201_0x3587,_0x30f430=await apiRequest(_0xccdff6(0x1cb),{'method':_0xccdff6(0x1a2),'body':{'appCode':_0x19daae[_0xccdff6(0x26b)],'roleName':_0x19daae[_0xccdff6(0x270)],'roleType':'CUSTOM',..._0x19daae[_0xccdff6(0x234)]?{'remark':_0x19daae[_0xccdff6(0x234)]}:{}}});return _0x30f430[_0xccdff6(0x20c)];}export async function updateAppRole(_0x2c8658){const _0x57e3ed=a201_0x3587,_0xedca35=await apiRequest('/smartapi/permit/role/update',{'method':_0x57e3ed(0x1a2),'body':{'id':_0x2c8658['id'],'appCode':_0x2c8658[_0x57e3ed(0x26b)],..._0x2c8658[_0x57e3ed(0x248)]?{'roleType':_0x2c8658['roleType']}:{},..._0x2c8658[_0x57e3ed(0x270)]!==undefined?{'roleName':_0x2c8658[_0x57e3ed(0x270)]}:{},..._0x2c8658['remark']!==undefined?{'remark':_0x2c8658['remark']}:{},..._0x2c8658['permits']?{'permits':_0x2c8658[_0x57e3ed(0x1fb)]}:{}}});return _0xedca35[_0x57e3ed(0x20c)];}export async function deleteAppRole(_0x4881d8){const _0x13136c=a201_0x3587;await apiRequest(_0x13136c(0x1ae),{'method':_0x13136c(0x1a2),'body':{'id':_0x4881d8}});}export async function listPermitRoles(_0x3fc7e7,_0xede0d4){const _0x2d12fd=a201_0x3587,_0x1a7a18=await apiRequest(_0x2d12fd(0x1e5),{'method':_0x2d12fd(0x1a2),'body':{'appCode':_0x3fc7e7,..._0xede0d4?.[_0x2d12fd(0x1c5)]!==undefined?{'needSelf':_0xede0d4[_0x2d12fd(0x1c5)]}:{},..._0xede0d4?.[_0x2d12fd(0x1bc)]!==undefined?{'needPublic':_0xede0d4[_0x2d12fd(0x1bc)]}:{}}});return extractList(_0x1a7a18[_0x2d12fd(0x20c)]);}export async function getRoleMenuResources(_0x2560b5,_0xb051c7){const _0x277c4e=a201_0x3587,_0x4a7a25=await apiRequest(_0x277c4e(0x25c),{'method':'POST','body':{'appCode':_0x2560b5,'roleId':_0xb051c7}});return extractList(_0x4a7a25[_0x277c4e(0x20c)]);}export async function getRoleApiResources(_0xdf78d8,_0x3e84a0){const _0x55dc63=a201_0x3587,_0x461671=await apiRequest(_0x55dc63(0x1f0),{'method':_0x55dc63(0x1a2),'body':{'appCode':_0xdf78d8,'roleId':_0x3e84a0}});return extractList(_0x461671['data']);}export async function listRoleUsers(_0x2d4e72){const _0x3483a1=a201_0x3587,_0x55dac1=await apiRequest(_0x3483a1(0x273),{'method':_0x3483a1(0x1a2),'body':{'appCode':_0x2d4e72}});return extractList(_0x55dac1['data']);}export async function updateRoleUsers(_0x281c78,_0x215c46){const _0x55c78b=a201_0x3587;await apiRequest(_0x55c78b(0x1a6),{'method':_0x55c78b(0x1a2),'body':{'appCode':_0x281c78,'roleList':_0x215c46}});}export async function getPagePermit(_0x1b40c5){const _0x294060=await apiRequest('/smartapi/permit/page/get-one'+buildQuery({'menuId':_0x1b40c5}));return _0x294060['data'];}export async function savePagePermit(_0x54fe9b){const _0x4ad877=a201_0x3587,_0x3035e8=await apiRequest('/smartapi/permit/page/save',{'method':_0x4ad877(0x1a2),'body':_0x54fe9b});return _0x3035e8[_0x4ad877(0x20c)];}export async function getTenantMembers(_0x10e588){const _0x12036b=a201_0x3587,_0x2b8815=await apiRequest(_0x12036b(0x252)+buildQuery({'code':_0x10e588})),_0x4c4d7e=_0x2b8815[_0x12036b(0x20c)]??{},_0x111f6b=Array[_0x12036b(0x1d3)](_0x4c4d7e?.['userTenantRelationList'])?_0x4c4d7e['userTenantRelationList']:[];return _0x111f6b[_0x12036b(0x1ed)](_0x561876=>_0x561876?.[_0x12036b(0x22f)]===_0x12036b(0x264)||_0x561876?.[_0x12036b(0x22f)]===undefined)[_0x12036b(0x19d)](_0x338a1e=>({'userId':Number(_0x338a1e['userId']??_0x338a1e['id']),'username':_0x338a1e[_0x12036b(0x25d)],'nickname':_0x338a1e[_0x12036b(0x18a)],'status':_0x338a1e['status'],'email':_0x338a1e['email'],'mobile':_0x338a1e[_0x12036b(0x1c4)],'avatar':_0x338a1e[_0x12036b(0x1e3)]}))[_0x12036b(0x1ed)](_0xdec9af=>Number[_0x12036b(0x25a)](_0xdec9af[_0x12036b(0x1de)])&&_0xdec9af[_0x12036b(0x1de)]>0x0);}
|
|
1
|
+
const a208_0x18bfa3=a208_0x4a62;(function(_0x274313,_0x544f15){const _0x16a2b5=a208_0x4a62,_0xcf2d39=_0x274313();while(!![]){try{const _0x24cbd1=-parseInt(_0x16a2b5(0x15d))/0x1+-parseInt(_0x16a2b5(0x125))/0x2+-parseInt(_0x16a2b5(0x198))/0x3+parseInt(_0x16a2b5(0x12c))/0x4*(parseInt(_0x16a2b5(0x1b1))/0x5)+-parseInt(_0x16a2b5(0x10e))/0x6+parseInt(_0x16a2b5(0x1a9))/0x7*(parseInt(_0x16a2b5(0xf3))/0x8)+parseInt(_0x16a2b5(0x199))/0x9*(parseInt(_0x16a2b5(0xd4))/0xa);if(_0x24cbd1===_0x544f15)break;else _0xcf2d39['push'](_0xcf2d39['shift']());}catch(_0xac5965){_0xcf2d39['push'](_0xcf2d39['shift']());}}}(a208_0x4f67,0x8958a));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x269872){_activeCookie=_0x269872||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}function a208_0x4a62(_0x33c8ba,_0x34490a){_0x33c8ba=_0x33c8ba-0xba;const _0x4f67fc=a208_0x4f67();let _0x4a62cd=_0x4f67fc[_0x33c8ba];return _0x4a62cd;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x57e40,PLATFORM_TRANSPORT_FAILURE=Symbol(a208_0x18bfa3(0xbc)),PLATFORM_ERROR_CODE=Symbol(a208_0x18bfa3(0xd7));export function isPlatformTransportFailure(_0xa42644){const _0x2a9abc=a208_0x18bfa3;return Boolean(_0xa42644&&typeof _0xa42644===_0x2a9abc(0x128)&&_0xa42644[PLATFORM_TRANSPORT_FAILURE]===!![]);}export function getPlatformErrorCode(_0x16f5ef){const _0x1d2635=a208_0x18bfa3;if(!_0x16f5ef||typeof _0x16f5ef!==_0x1d2635(0x128))return undefined;const _0x520c6b=_0x16f5ef[PLATFORM_ERROR_CODE];return typeof _0x520c6b===_0x1d2635(0x193)&&_0x520c6b?_0x520c6b:undefined;}function createPlatformApiError(_0x389c2c,_0x322b8b){const _0x6456f=a208_0x18bfa3,_0x4cbd26=typeof _0x322b8b===_0x6456f(0x193)?_0x322b8b[_0x6456f(0x1c6)]():typeof _0x322b8b===_0x6456f(0x151)?String(_0x322b8b):'',_0xe8d310=CliErrors[_0x6456f(0x1bd)](_0x389c2c,_0x4cbd26?_0x6456f(0x14b)+_0x4cbd26:undefined);return _0x4cbd26&&(Object[_0x6456f(0x127)](_0xe8d310,PLATFORM_ERROR_CODE,{'value':_0x4cbd26}),Object[_0x6456f(0x127)](_0xe8d310,_0x6456f(0x114),{'value':{'remoteErrorCode':_0x4cbd26},'enumerable':![]})),_0xe8d310;}function createFetchFailureError(_0x5b8579,_0x260739){const _0x58741c=a208_0x18bfa3,_0x240680=_0x260739 instanceof Error?_0x260739['message']:String(_0x260739),_0x36ee1f=CliErrors['apiError'](_0x58741c(0x120)+_0x5b8579+(_0x240680?'\x20('+_0x240680+')':''),_0x58741c(0x1b2));return Object[_0x58741c(0x127)](_0x36ee1f,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x36ee1f;}function createIndeterminateResponseError(_0x1cc546){const _0x5a1678=CliErrors['apiError'](_0x1cc546+'\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20after\x20HTTP\x20success.','The\x20server\x20outcome\x20is\x20indeterminate.\x20Verify\x20current\x20state\x20before\x20retrying\x20any\x20mutation.');return Object['defineProperty'](_0x5a1678,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x5a1678;}async function apiRequest(_0x3a55d9,_0x4da1b4={}){const _0x544dd5=a208_0x18bfa3,{method:method=_0x544dd5(0x103),body:_0x10fa31,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x4da1b4,_0x14d157=useRuntime?getRuntimeDomain():getApiDomain(),_0x5d018a=_activeCookie||getCookie(),_0x4d6991=''+_0x14d157+_0x3a55d9,_0x2d48ac=new AbortController(),_0x4ecddd=setTimeout(()=>_0x2d48ac[_0x544dd5(0xfa)](),timeout);try{const _0x46a96d=await fetch(_0x4d6991,{'method':method,'headers':{'Content-Type':_0x544dd5(0xbe),'Cookie':_0x5d018a,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x10fa31?JSON[_0x544dd5(0x15b)](_0x10fa31):undefined,'signal':_0x2d48ac['signal']});let _0x5311b1;try{_0x5311b1=await _0x46a96d['json']();}catch(_0x4585ca){if(_0x4585ca instanceof Error&&_0x4585ca[_0x544dd5(0xdc)]===_0x544dd5(0xc2))throw CliErrors[_0x544dd5(0x1bd)]('Request\x20timeout:\x20'+_0x4d6991);if(_0x46a96d['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x544dd5(0x1bd)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x46a96d['status']+')',_0x46a96d[_0x544dd5(0x15c)]>=0x190?_0x544dd5(0x1a8):undefined);}if(!_0x46a96d['ok']||_0x5311b1[_0x544dd5(0xe9)]===![])throw CliErrors[_0x544dd5(0x1bd)](_0x5311b1['errorMsg']||_0x5311b1['message']||_0x544dd5(0xe8)+_0x46a96d['status'],_0x5311b1[_0x544dd5(0xe2)]?_0x544dd5(0x14b)+_0x5311b1[_0x544dd5(0xe2)]:undefined);return _0x5311b1;}catch(_0x37b41e){if(_0x37b41e instanceof CliError)throw _0x37b41e;if(_0x37b41e instanceof Error&&_0x37b41e['name']==='AbortError')throw CliErrors[_0x544dd5(0x1bd)](_0x544dd5(0x1a3)+_0x4d6991);throw createFetchFailureError(_0x4d6991,_0x37b41e);}finally{clearTimeout(_0x4ecddd);}}async function apiFormRequest(_0x2fe707,_0x41b4f5,_0x248272={}){const _0x4bf264=a208_0x18bfa3,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x248272,_0x468498=_activeCookie||getCookie(),_0x31310d=''+getApiDomain()+_0x2fe707,_0x11e2f5=new AbortController(),_0x2781b5=setTimeout(()=>_0x11e2f5[_0x4bf264(0xfa)](),timeout);try{const _0x3be942=await fetch(_0x31310d,{'method':_0x4bf264(0xff),'headers':{'Cookie':_0x468498,'X-Invoke-Source':_0x4bf264(0x11f)},'body':_0x41b4f5,'signal':_0x11e2f5[_0x4bf264(0x15e)]});let _0x120080;try{_0x120080=await _0x3be942[_0x4bf264(0xd8)]();}catch(_0x4ea455){if(_0x4ea455 instanceof Error&&_0x4ea455[_0x4bf264(0xdc)]===_0x4bf264(0xc2))throw CliErrors[_0x4bf264(0x1bd)](_0x4bf264(0x1a3)+_0x31310d);throw CliErrors[_0x4bf264(0x1bd)](_0x4bf264(0x171)+_0x3be942[_0x4bf264(0x15c)]+')',_0x3be942[_0x4bf264(0x15c)]>=0x190?_0x4bf264(0x1a8):undefined);}if(!_0x3be942['ok']||_0x120080[_0x4bf264(0xe9)]===![])throw CliErrors[_0x4bf264(0x1bd)](_0x120080[_0x4bf264(0x12e)]||_0x120080[_0x4bf264(0x133)]||_0x4bf264(0xe8)+_0x3be942[_0x4bf264(0x15c)],_0x120080[_0x4bf264(0xe2)]?'API\x20error\x20code:\x20'+_0x120080[_0x4bf264(0xe2)]:undefined);return _0x120080;}catch(_0x5d9ef2){if(_0x5d9ef2 instanceof CliError)throw _0x5d9ef2;if(_0x5d9ef2 instanceof Error&&_0x5d9ef2[_0x4bf264(0xdc)]==='AbortError')throw CliErrors[_0x4bf264(0x1bd)](_0x4bf264(0x1a3)+_0x31310d);throw createFetchFailureError(_0x31310d,_0x5d9ef2);}finally{clearTimeout(_0x2781b5);}}export async function uploadDevelopmentFile(_0x1a9940,_0x33c41b){const _0x4df8dd=a208_0x18bfa3,_0x1e37e0=await readFile(_0x33c41b),_0x556ad9=new FormData();_0x556ad9[_0x4df8dd(0x1b4)](_0x4df8dd(0xf5),_0x1a9940),_0x556ad9[_0x4df8dd(0x1b4)](_0x4df8dd(0xdf),new Blob([new Uint8Array(_0x1e37e0)]),basename(_0x33c41b));const _0x324e53=await apiFormRequest('/smartapi/common/uploadFile',_0x556ad9);return _0x324e53[_0x4df8dd(0x114)];}export async function queryDevelopmentFileUrl(_0x22b66f,_0x5ae8ce={}){const _0xb29c5f=a208_0x18bfa3,_0x581932=await apiRequest(_0xb29c5f(0x10b),{'method':_0xb29c5f(0xff),'body':{'filePath':_0x22b66f,'downloadFlag':_0x5ae8ce[_0xb29c5f(0x12d)]??![],..._0x5ae8ce[_0xb29c5f(0xcb)]?{'longTerm':!![]}:{}}});return _0x581932[_0xb29c5f(0x114)];}export async function recognizeDevelopmentOcr(_0x28dee7,_0x4ad562){const _0xc77819=a208_0x18bfa3,_0x1ec521=new URLSearchParams({'url':_0x4ad562[_0xc77819(0x132)],'type':_0x4ad562[_0xc77819(0xdb)],'appCode':_0x28dee7}),_0x2b71de=await apiRequest(_0xc77819(0x1b5)+_0x1ec521['toString'](),{'method':'GET'});return _0x2b71de[_0xc77819(0x114)];}function isAuthFailure(_0x3c39b4){const _0x289848=a208_0x18bfa3,_0x42ab49=_0x3c39b4[_0x289848(0x12e)]||_0x3c39b4[_0x289848(0x133)]||_0x3c39b4['data']?.[_0x289848(0x133)]||_0x3c39b4[_0x289848(0x124)]||_0x3c39b4[_0x289848(0x1ad)]||'';return _0x3c39b4[_0x289848(0xe2)]==='UNAUTHORIZED'||_0x3c39b4[_0x289848(0x1c4)]===0x191||_0x3c39b4['code']==='401'||_0x42ab49[_0x289848(0xd9)](_0x289848(0x1bf))||_0x42ab49[_0x289848(0xd9)]('Unauthorized')||_0x42ab49[_0x289848(0xd9)]('登录')||_0x42ab49[_0x289848(0xd9)]('认证');}export async function platformFetch(_0xe2f864,_0x3c30f4){const _0x426c48=a208_0x18bfa3;let _0xd868a9;try{_0xd868a9=await fetch(_0xe2f864,{'method':_0x3c30f4[_0x426c48(0xd6)]??_0x426c48(0x103),'headers':{'Content-Type':_0x426c48(0xbe),'Cookie':_0x3c30f4['cookie'],'X-Invoke-Source':_0x426c48(0x11f)},..._0x3c30f4[_0x426c48(0x179)]&&{'body':JSON[_0x426c48(0x15b)](_0x3c30f4['body'])}});}catch(_0x166b15){throw createFetchFailureError(_0xe2f864,_0x166b15);}let _0x5da4e7;try{_0x5da4e7=await _0xd868a9[_0x426c48(0xd8)]();}catch(_0x4ae000){if(!_0xd868a9['ok']){if(_0xd868a9[_0x426c48(0x15c)]===0x191)throw CliErrors[_0x426c48(0xd0)]();throw CliErrors['apiError'](_0x3c30f4[_0x426c48(0x159)]+_0x426c48(0x149)+_0xd868a9['status']);}throw createFetchFailureError(_0xe2f864,_0x4ae000);}if(_0x5da4e7===null||typeof _0x5da4e7!==_0x426c48(0x128)||Array['isArray'](_0x5da4e7)){if(_0xd868a9[_0x426c48(0x15c)]===0x191)throw CliErrors[_0x426c48(0xd0)]();if(_0xd868a9['ok'])throw createIndeterminateResponseError(_0x3c30f4['label']);throw CliErrors[_0x426c48(0x1bd)](_0x3c30f4[_0x426c48(0x159)]+'\x20failed'+(!_0xd868a9['ok']?_0x426c48(0x14e)+_0xd868a9['status']:'')+_0x426c48(0x10a));}const _0x4e1a4c=typeof _0x5da4e7[_0x426c48(0xe2)]===_0x426c48(0x193)||typeof _0x5da4e7[_0x426c48(0xe2)]===_0x426c48(0x151),_0x53605d=_0x4e1a4c?String(_0x5da4e7[_0x426c48(0xe2)])[_0x426c48(0x1c6)]():'',_0x2522c8=_0x5da4e7[_0x426c48(0xe9)]===![]||_0x4e1a4c&&_0x53605d!==_0x426c48(0x101);if(!_0xd868a9['ok']||_0x2522c8){if(_0xd868a9[_0x426c48(0x15c)]===0x191||isAuthFailure(_0x5da4e7))throw CliErrors[_0x426c48(0xd0)]();throw createPlatformApiError(_0x5da4e7[_0x426c48(0x12e)]||_0x5da4e7[_0x426c48(0x133)]||_0x3c30f4[_0x426c48(0x159)]+_0x426c48(0x148)+(!_0xd868a9['ok']?_0x426c48(0x14e)+_0xd868a9['status']:''),_0x5da4e7['errorCode']??_0x5da4e7[_0x426c48(0x1c4)]);}if(_0x5da4e7[_0x426c48(0xe9)]!==!![]||_0x5da4e7[_0x426c48(0xe2)]!==_0x426c48(0x101))throw createIndeterminateResponseError(_0x3c30f4['label']);return _0x5da4e7[_0x426c48(0x114)];}export async function platformRequest(_0x57e03d,_0x490716){const _0x2dc26d=a208_0x18bfa3;if(/^https?:\/\//i[_0x2dc26d(0x134)](_0x57e03d))throw CliErrors[_0x2dc26d(0x10c)]('platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20'+_0x57e03d,_0x2dc26d(0x19c));const _0x112ac9=_0x57e03d[_0x2dc26d(0x1ab)]('/')?_0x57e03d:'/'+_0x57e03d;return platformFetch(''+getApiDomain()+_0x112ac9,_0x490716);}const MAX_KNOWLEDGE_BASE_PAGE_SIZE=0x64;function parseKnowledgeBaseInteger(_0x5be535,_0x31c655){const _0x12d8db=a208_0x18bfa3,_0x5402cf=typeof _0x5be535===_0x12d8db(0x151)?_0x5be535:typeof _0x5be535===_0x12d8db(0x193)&&/^(0|[1-9]\d*)$/['test'](_0x5be535)?Number(_0x5be535):Number[_0x12d8db(0x172)],_0x473077=Number[_0x12d8db(0x157)](_0x5402cf)&&(_0x31c655==='id'?_0x5402cf>0x0:_0x5402cf>=0x0);if(!_0x473077)throw CliErrors['apiError'](_0x12d8db(0x10d)+_0x31c655+'.');return _0x5402cf;}function parseKnowledgeBaseText(_0x415bea,_0xf8341b){const _0xdc1d4a=a208_0x18bfa3;if(typeof _0x415bea===_0xdc1d4a(0x193)&&(_0xf8341b===_0xdc1d4a(0xba)||_0x415bea[_0xdc1d4a(0x1c6)]()))return _0x415bea;throw CliErrors[_0xdc1d4a(0x1bd)](_0xdc1d4a(0x1bb)+_0xf8341b+'.');}function parseKnowledgeBaseRecord(_0x33acab){const _0x30c89f=a208_0x18bfa3;if(!_0x33acab||typeof _0x33acab!==_0x30c89f(0x128)||Array[_0x30c89f(0xe7)](_0x33acab))throw CliErrors[_0x30c89f(0x1bd)](_0x30c89f(0x14a));const _0x4f9f9b=_0x33acab;if(_0x4f9f9b[_0x30c89f(0x152)]!==_0x30c89f(0x147)&&_0x4f9f9b[_0x30c89f(0x152)]!==_0x30c89f(0xbd))throw CliErrors[_0x30c89f(0x1bd)]('Knowledge-base\x20response\x20contains\x20an\x20invalid\x20scope.');const _0x1dc197={'id':parseKnowledgeBaseInteger(_0x4f9f9b['id'],'id'),'scope':_0x4f9f9b['scope'],'appCode':parseKnowledgeBaseText(_0x4f9f9b[_0x30c89f(0xf5)],_0x30c89f(0xf5)),'title':parseKnowledgeBaseText(_0x4f9f9b['title'],_0x30c89f(0x14c)),'version':parseKnowledgeBaseInteger(_0x4f9f9b[_0x30c89f(0x13f)],_0x30c89f(0x13f)),'content':parseKnowledgeBaseText(_0x4f9f9b[_0x30c89f(0xba)],_0x30c89f(0xba))};return(_0x4f9f9b['createTime']===null||typeof _0x4f9f9b['createTime']===_0x30c89f(0x193)||typeof _0x4f9f9b[_0x30c89f(0x1a4)]===_0x30c89f(0x151))&&(_0x1dc197[_0x30c89f(0x1a4)]=_0x4f9f9b[_0x30c89f(0x1a4)]),(_0x4f9f9b[_0x30c89f(0x13a)]===null||typeof _0x4f9f9b['updateTime']==='string'||typeof _0x4f9f9b[_0x30c89f(0x13a)]==='number')&&(_0x1dc197['updateTime']=_0x4f9f9b['updateTime']),_0x1dc197;}export async function listEnterpriseKnowledgeBases(_0x41ff65,_0xc2745f={}){const _0x53f243=a208_0x18bfa3,_0x22e21f=_0xc2745f['pageSize']??0x32;if(!Number[_0x53f243(0x157)](_0x22e21f)||_0x22e21f<0x1||_0x22e21f>MAX_KNOWLEDGE_BASE_PAGE_SIZE)throw CliErrors[_0x53f243(0x10c)](_0x53f243(0x116)+MAX_KNOWLEDGE_BASE_PAGE_SIZE+'.');const _0x2a2ed5=await platformRequest('/admin/knowledge-base/get-list',{'method':_0x53f243(0xff),'cookie':_0x41ff65,'label':_0x53f243(0x19b),'body':{'currentPage':_0xc2745f[_0x53f243(0x111)]??0x1,'pageSize':_0x22e21f,'scope':'company',..._0xc2745f['appCode']?{'appCode':_0xc2745f[_0x53f243(0xf5)]}:{},..._0xc2745f[_0x53f243(0x14c)]?{'title':_0xc2745f[_0x53f243(0x14c)]}:{}}});if(!_0x2a2ed5||typeof _0x2a2ed5!==_0x53f243(0x128)||Array[_0x53f243(0xe7)](_0x2a2ed5)||!Array[_0x53f243(0xe7)](_0x2a2ed5[_0x53f243(0x1bc)]))throw CliErrors[_0x53f243(0x1bd)](_0x53f243(0x194));const _0x1fa4ad=extractPaging(_0x2a2ed5);if(!_0x1fa4ad||!Number[_0x53f243(0x173)](_0x1fa4ad['currentPage'])||!Number[_0x53f243(0x173)](_0x1fa4ad[_0x53f243(0x195)])||!Number[_0x53f243(0x173)](_0x1fa4ad[_0x53f243(0x142)])||_0x1fa4ad['currentPage']<0x1||_0x1fa4ad[_0x53f243(0x195)]<0x1||_0x1fa4ad[_0x53f243(0x195)]>MAX_KNOWLEDGE_BASE_PAGE_SIZE||_0x1fa4ad[_0x53f243(0x142)]<0x0)throw CliErrors['apiError'](_0x53f243(0x1ba));return{'items':extractList(_0x2a2ed5)['map'](parseKnowledgeBaseRecord),'paging':_0x1fa4ad};}export async function getEnterpriseKnowledgeBase(_0x4c938f,_0x1599e3){const _0xe431ad=a208_0x18bfa3,_0x585375=await platformRequest('/admin/knowledge-base/get-one'+buildQuery({'id':_0x1599e3}),{'cookie':_0x4c938f,'label':_0xe431ad(0x189)});return parseKnowledgeBaseRecord(_0x585375);}export async function createEnterpriseKnowledgeBase(_0x2ca5dc,_0xd143e2){const _0x3394c2=a208_0x18bfa3,_0x206fe1=await platformRequest(_0x3394c2(0x100),{'method':'POST','cookie':_0x2ca5dc,'label':_0x3394c2(0xc0),'body':{'scope':_0x3394c2(0x147),..._0xd143e2}});return parseKnowledgeBaseRecord(_0x206fe1);}export async function updateEnterpriseKnowledgeBase(_0x59bb0e,_0x2c3bc1){const _0x5225cc=a208_0x18bfa3;if(_0x2c3bc1[_0x5225cc(0x14c)]===undefined&&_0x2c3bc1['content']===undefined)throw CliErrors['validation']('Knowledge-base\x20update\x20requires\x20title\x20or\x20content.');const _0x338f15=await platformRequest('/admin/knowledge-base/update',{'method':'POST','cookie':_0x59bb0e,'label':_0x5225cc(0x175),'body':{'id':_0x2c3bc1['id'],..._0x2c3bc1['title']!==undefined?{'title':_0x2c3bc1['title']}:{},..._0x2c3bc1[_0x5225cc(0xba)]!==undefined?{'content':_0x2c3bc1[_0x5225cc(0xba)]}:{}}});return parseKnowledgeBaseRecord(_0x338f15);}export async function deleteEnterpriseKnowledgeBase(_0x4a06b4,_0x33de8b){const _0x11eb02=a208_0x18bfa3;await platformRequest(_0x11eb02(0x1c3),{'method':_0x11eb02(0xff),'cookie':_0x4a06b4,'label':_0x11eb02(0x16c),'body':{'id':_0x33de8b}});}function cleanNewlines(_0x57bf11){const _0x1dafc9=a208_0x18bfa3;return _0x57bf11[_0x1dafc9(0x141)](/[\r\n]+/g,'\x20')[_0x1dafc9(0x1c6)]();}function cleanDatasetName(_0x11d98c){const _0x1e0f3b=a208_0x18bfa3;if(!_0x11d98c[_0x1e0f3b(0xdc)])return _0x11d98c;return{..._0x11d98c,'name':cleanNewlines(_0x11d98c['name'])};}export async function fetchModelList(_0x404149,_0x5ca131){const _0x5ed3eb=a208_0x18bfa3,_0x247e07=getEnv(),_0x1c7fdc=new URLSearchParams({'appcode':_0x404149,'otype':_0x5ed3eb(0xc1)}),_0x21c1b=_0x5ed3eb(0x122)+_0x1c7fdc[_0x5ed3eb(0x17b)]();logger['info'](_0x5ed3eb(0xcf),_0x5ed3eb(0x18b)+_0x247e07+')',{'apiPath':_0x21c1b});const _0x410239=await platformRequest(_0x21c1b,{'cookie':_0x5ca131,'label':_0x5ed3eb(0x1be)}),_0x22c3f3=(_0x410239[_0x5ed3eb(0x139)]??[])[_0x5ed3eb(0x187)](cleanDatasetName);return{'configArray':_0x22c3f3,'count':_0x22c3f3[_0x5ed3eb(0xbf)]};}export async function fetchDatasetDoc(_0x305bcc){const _0x31e169=a208_0x18bfa3,{appCode:_0x54dcf3,cookie:_0x5dbbd7,datasetCode:_0x3191eb,datasetId:_0x5c69b0,extraParams:_0x1c1a83}=_0x305bcc,_0xec334c=await platformRequest('/api/node-toolbox/api-doc-generator',{'method':_0x31e169(0xff),'body':{'appCode':_0x54dcf3,'datasetCode':_0x3191eb,'datasetId':_0x5c69b0,..._0x1c1a83||{}},'cookie':_0x5dbbd7,'label':_0x31e169(0x11c)+_0x3191eb+')'});if(!_0xec334c||typeof _0xec334c['markdown']!==_0x31e169(0x193))throw new Error(_0x31e169(0x138)+_0x3191eb+'):\x20missing\x20data.markdown\x20field');return _0xec334c[_0x31e169(0x162)];}export async function getMenuTree(_0x1312e2,_0x2aee99){const _0x471e4c=a208_0x18bfa3,_0x5c04d4=new URLSearchParams({'appCode':_0x1312e2});return platformRequest(_0x471e4c(0x143)+_0x5c04d4[_0x471e4c(0x17b)](),{'cookie':_0x2aee99,'label':_0x471e4c(0xed)});}export async function createMenuRecord(_0x1d7c1f,_0x5009cb,_0x28c1a6){const _0x581f57=a208_0x18bfa3;return platformRequest(_0x581f57(0x12b),{'method':_0x581f57(0xff),'body':_0x1d7c1f,'cookie':_0x5009cb,'label':_0x28c1a6});}export async function updateMenuRecord(_0x41332b,_0x320cf7,_0x16e7a6){const _0x975a71=a208_0x18bfa3;return platformRequest(_0x975a71(0xc9),{'method':_0x975a71(0xff),'body':_0x41332b,'cookie':_0x320cf7,'label':_0x16e7a6});}export async function deleteMenuRecord(_0x3006d2,_0x48dc2a,_0x5a0a39){const _0x18561e=a208_0x18bfa3;return platformRequest(_0x18561e(0x1a5),{'method':_0x18561e(0xff),'body':{'id':_0x3006d2},'cookie':_0x48dc2a,'label':_0x5a0a39});}export async function batchDeleteMenuRecords(_0x3d2a6a,_0x38bab0,_0x5eaeef){const _0x52dfa7=a208_0x18bfa3;return platformRequest(_0x52dfa7(0xe3),{'method':'POST','body':{'idList':_0x3d2a6a},'cookie':_0x38bab0,'label':_0x5eaeef});}export async function startMenuRegroup(_0x2957d5,_0x5ac46a,_0x3715e3){const _0xcf487c=a208_0x18bfa3;return platformRequest(_0xcf487c(0x137),{'method':_0xcf487c(0xff),'body':_0x2957d5,'cookie':_0x5ac46a,'label':_0x3715e3});}export async function getAsyncTaskStatus(_0x4c8a88,_0xf36074,_0x559bb2){const _0x42a759=a208_0x18bfa3,_0x57dff4=new URLSearchParams({'appCode':_0xf36074});return platformRequest('/smartapi/tasks/'+encodeURIComponent(_0x4c8a88)+'?'+_0x57dff4[_0x42a759(0x17b)](),{'cookie':_0x559bb2,'label':_0x42a759(0x1a6)+_0x4c8a88});}export async function listBffScripts(_0x222b6b,_0x2d4426,_0x39850b){const _0x41b981=a208_0x18bfa3;let _0x21ad82=_0x41b981(0x1c0)+_0x222b6b;if(_0x2d4426)_0x21ad82+='&type='+_0x2d4426;const _0x11264f=await apiRequest(_0x21ad82);let _0x4c639e=extractList(_0x11264f[_0x41b981(0x114)]);if(_0x39850b?.[_0x41b981(0xfe)]){const _0x35c3ed=_0x39850b[_0x41b981(0xfe)][_0x41b981(0x191)]();_0x4c639e=_0x4c639e[_0x41b981(0x19f)](_0x28e8d2=>_0x28e8d2[_0x41b981(0xc3)]?.[_0x41b981(0x191)]()[_0x41b981(0xd9)](_0x35c3ed)||_0x28e8d2[_0x41b981(0xea)]?.['toLowerCase']()[_0x41b981(0xd9)](_0x35c3ed));}return _0x4c639e;}export async function getBffScriptInfo(_0x1ba082){const _0x33e6e0=a208_0x18bfa3,_0x560c12=await apiRequest(_0x33e6e0(0x126)+_0x1ba082);if(!_0x560c12['data'])throw CliErrors[_0x33e6e0(0x10c)]('BFF\x20script\x20not\x20found:\x20id='+_0x1ba082);return _0x560c12[_0x33e6e0(0x114)];}export async function saveBffScript(_0x5e800b){const _0x2805e2=a208_0x18bfa3,_0x27f8f3=await apiRequest('/api/management/library/scripts/save',{'method':_0x2805e2(0xff),'body':_0x5e800b}),{id:_0x4275ef,entity:_0x5ae833}=normalizeEntityWithIdResponse(_0x27f8f3['data']);if(_0x4275ef!==undefined){const _0x491bdd=typeof _0x5ae833[_0x2805e2(0xc3)]===_0x2805e2(0x193)||typeof _0x5ae833[_0x2805e2(0x17d)]===_0x2805e2(0x193)?_0x5ae833:undefined;return{'id':_0x4275ef,'script':_0x491bdd};}throw CliErrors[_0x2805e2(0x1bd)]('BFF\x20save\x20returned\x20no\x20valid\x20id');}export async function deleteBffScript(_0x58da9f){const _0x27001e=a208_0x18bfa3;await apiRequest(_0x27001e(0x170),{'method':'POST','body':{'id':_0x58da9f}});}export async function getBffScriptStatistics(_0x2c9953){const _0x1e5f2f=a208_0x18bfa3,_0x306820=await apiRequest(_0x1e5f2f(0xca)+_0x2c9953);return extractList(_0x306820[_0x1e5f2f(0x114)]);}export async function clearBffScriptCache(){const _0x2c0e67=a208_0x18bfa3,_0x3e3175=await apiRequest('/api/management/script/cache/clear',{'method':'POST','useRuntime':!![]});return typeof _0x3e3175[_0x2c0e67(0x114)]===_0x2c0e67(0x193)?_0x3e3175[_0x2c0e67(0x114)]:'';}export async function listBffDatasetOperations(_0x5e66a0,_0x2ef153){const _0x5433d7=a208_0x18bfa3,_0x189b1b=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x5433d7(0xff),'body':{'appCode':_0x5e66a0,'datasetId':_0x2ef153}});return _0x189b1b[_0x5433d7(0x114)];}export async function listSqlQueries(_0x111585,_0x79e3a1){const _0x3d79aa=a208_0x18bfa3,_0x5a74f9=await apiRequest(_0x3d79aa(0x108),{'method':_0x3d79aa(0xff),'body':{'appCode':_0x111585,'currentPage':_0x79e3a1?.[_0x3d79aa(0x111)]??0x1,'pageSize':_0x79e3a1?.['pageSize']??0x32,'sqlCode':_0x79e3a1?.['sqlCode'],'sqlName':_0x79e3a1?.[_0x3d79aa(0x1b7)]}});return _0x5a74f9[_0x3d79aa(0x114)];}export async function getSqlQueryInfo(_0x4d169b,_0x2e371c){const _0x2ad64e=a208_0x18bfa3,_0xc916bf=await listSqlQueries(_0x4d169b,{'sqlCode':_0x2e371c}),_0x3d6621=_0xc916bf['tableData']?.[0x0];if(!_0x3d6621)throw CliErrors['validation'](_0x2ad64e(0x160)+_0x2e371c);return _0x3d6621;}export async function getSqlQueryDetail(_0x4dbf90){const _0x362d96=a208_0x18bfa3,_0x192d8e=await apiRequest(_0x362d96(0x196)+(_0x362d96(0xcc)+encodeURIComponent(_0x4dbf90)));if(!_0x192d8e[_0x362d96(0x114)])throw CliErrors[_0x362d96(0x10c)](_0x362d96(0x160)+_0x4dbf90);return _0x192d8e['data'];}export async function getSqlQueryDetailById(_0x5306d9){const _0x5958b5=a208_0x18bfa3,_0x1cb1ba=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x5306d9);if(!_0x1cb1ba['data'])throw CliErrors[_0x5958b5(0x10c)]('SQL\x20query\x20not\x20found:\x20id='+_0x5306d9);return _0x1cb1ba['data'];}export async function createSqlQuery(_0x33f60d){const _0x1f6f9a=a208_0x18bfa3,_0x8743b5=await apiRequest(_0x1f6f9a(0x1b3),{'method':_0x1f6f9a(0xff),'body':_0x33f60d}),{id:_0x2fb72,entity:_0x562840}=normalizeEntityWithIdResponse(_0x8743b5['data']);if(!(_0x1f6f9a(0x13e)in _0x562840)&&_0x2fb72)return getSqlQueryDetailById(_0x2fb72);return normalizeSqlQueryEntity(_0x562840);}export async function updateSqlQuery(_0xdd8b4d){const _0x4dc232=a208_0x18bfa3,_0xa18ca7=await apiRequest(_0x4dc232(0x16e),{'method':'POST','body':_0xdd8b4d}),{id:_0xf0bcc1,entity:_0x2b3859}=normalizeEntityWithIdResponse(_0xa18ca7[_0x4dc232(0x114)]);if(!('sqlCode'in _0x2b3859)){if(_0xdd8b4d[_0x4dc232(0x13e)])return getSqlQueryDetail(_0xdd8b4d[_0x4dc232(0x13e)]);if(_0xf0bcc1)return getSqlQueryDetailById(_0xf0bcc1);}return normalizeSqlQueryEntity(_0x2b3859);}export async function deleteSqlQuery(_0x38d7df){const _0x48f6c1=a208_0x18bfa3;await apiRequest(_0x48f6c1(0x130),{'method':_0x48f6c1(0xff),'body':_0x38d7df});}export async function saveSqlQuery(_0x4da8fb){const _0x4006c2=a208_0x18bfa3,_0x1d3a82=await apiRequest(_0x4006c2(0x167),{'method':_0x4006c2(0xff),'body':_0x4da8fb});return _0x1d3a82[_0x4006c2(0x114)];}function normalizeSqlQueryEntity(_0x3b8b10){const _0x17e70e=a208_0x18bfa3;return{..._0x3b8b10,'id':Number(_0x3b8b10['id']),'dbId':_0x3b8b10['dbId']==null?undefined:Number(_0x3b8b10[_0x17e70e(0x154)]),'version':_0x3b8b10[_0x17e70e(0x13f)]==null?undefined:Number(_0x3b8b10[_0x17e70e(0x13f)])};}export async function executeSql(_0x55f336,_0x90afcd,_0x27c671){const _0x606edf=a208_0x18bfa3,_0x57e5ac=await apiRequest(_0x606edf(0x102),{'method':'POST','body':{'appCode':_0x55f336,'sqlCode':_0x90afcd,..._0x27c671&&{'params':_0x27c671}},'useRuntime':!![]});return _0x57e5ac[_0x606edf(0x114)];}export async function executeDatasetDataOperation(_0x140613,_0x4f5a3a,_0xb12524,_0x2d8859={}){const _0x572f87=a208_0x18bfa3;try{const _0x367ad0=await apiRequest(_0x572f87(0x1af)+_0x140613+'/'+_0x4f5a3a+'/'+_0xb12524,{'method':_0x572f87(0xff),'body':_0x2d8859,'useRuntime':!![]});return _0x367ad0[_0x572f87(0x114)];}catch(_0x5e8d34){if(_0xb12524===_0x572f87(0x1ae)&&_0x5e8d34 instanceof CliError&&_0x5e8d34[_0x572f87(0x1c4)]===_0x572f87(0x17e)&&_0x2d8859['id']!==undefined&&_0x2d8859['id']!==null&&_0x2d8859['id']!==''){const _0x1b3266=await apiRequest(_0x572f87(0x1af)+_0x140613+'/'+_0x4f5a3a+'/filter',{'method':'POST','body':{'where':{'id':{'$eq':_0x2d8859['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x51195b=Array[_0x572f87(0xe7)](_0x1b3266['data']?.[_0x572f87(0x1bc)])?_0x1b3266['data']['tableData']:[];return _0x51195b[0x0]??null;}throw _0x5e8d34;}}export async function listDatasets(_0x5a23a4,_0x351368){const _0x230897=a208_0x18bfa3,_0x3184a9={'appCode':_0x5a23a4,'deleted':_0x351368?.['deleted']??![]};if(_0x351368?.['code'])_0x3184a9['code']=_0x351368[_0x230897(0x1c4)];if(_0x351368?.[_0x230897(0xdc)])_0x3184a9[_0x230897(0xdc)]=_0x351368[_0x230897(0xdc)];const _0x4deecd=await apiRequest('/smartapi/dataset/get-dataset-list',{'method':_0x230897(0xff),'body':_0x3184a9});return extractList(_0x4deecd[_0x230897(0x114)]);}export async function deleteDataset(_0x21756e,_0x3d8ba7){const _0x4991b4=a208_0x18bfa3;await apiRequest(_0x4991b4(0x136),{'method':_0x4991b4(0xff),'body':{'appCode':_0x21756e,'datasetId':_0x3d8ba7}});}export async function restoreDataset(_0x11155d,_0xff06ee){await apiRequest('/smartapi/dataset/restore-dataset',{'method':'POST','body':{'appCode':_0x11155d,'datasetId':_0xff06ee}});}export async function previewTextGeneratedDataset(_0x170ced,_0x239c1d){const _0x50ea5c=a208_0x18bfa3,_0x1063d7=await apiRequest(_0x50ea5c(0x17c),{'method':'POST','body':{'appCode':_0x170ced,'datasetName':_0x239c1d[_0x50ea5c(0x197)],'requirementDescription':_0x239c1d[_0x50ea5c(0xd2)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x1063d7['data'];}export async function startTextGeneratedDataset(_0x1ada14,_0x10941a,_0x58a821){const _0x149621=a208_0x18bfa3,_0x7bd20a=await apiRequest(_0x149621(0xfb),{'method':_0x149621(0xff),'body':{'appCode':_0x1ada14,..._0x58a821?.[_0x149621(0x106)]?{'clientOperationId':_0x58a821[_0x149621(0x106)]}:{},'design':_0x10941a},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x7bd20a[_0x149621(0x114)];}export async function getTextGeneratedDatasetStatus(_0x409c02,_0x48e476){const _0x311fa0=a208_0x18bfa3,_0x5265d5=new URLSearchParams({'appCode':_0x409c02});_0x48e476['operationId']&&_0x5265d5[_0x311fa0(0xf1)](_0x311fa0(0x110),_0x48e476[_0x311fa0(0x110)]);_0x48e476[_0x311fa0(0x106)]&&_0x5265d5['set'](_0x311fa0(0x106),_0x48e476[_0x311fa0(0x106)]);const _0xd09377=await apiRequest(_0x311fa0(0x15f)+_0x5265d5[_0x311fa0(0x17b)]());return _0xd09377[_0x311fa0(0x114)];}export async function searchDatasets(_0x58f061,_0x4069f0){const _0x309fbe=a208_0x18bfa3,_0x443efb=await listDatasets(_0x58f061,{'name':_0x4069f0}),_0x1fd316=_0x4069f0['toLowerCase'](),_0x469fff=new Set(_0x443efb[_0x309fbe(0x187)](_0x8756ff=>_0x8756ff['id'])),_0xf4f7ec=_0x443efb[_0x309fbe(0x19f)](_0x1e97dd=>_0x1e97dd[_0x309fbe(0x12a)]?.[_0x309fbe(0x115)]?.['toLowerCase']()[_0x309fbe(0xd9)](_0x1fd316)||_0x1e97dd[_0x309fbe(0xea)]?.['toLowerCase']()['includes'](_0x1fd316)),_0x1d3022=await listDatasets(_0x58f061,{'code':_0x4069f0});for(const _0x2b7c44 of _0x1d3022){!_0x469fff[_0x309fbe(0x192)](_0x2b7c44['id'])&&(_0x443efb[_0x309fbe(0x18d)](_0x2b7c44),_0x469fff[_0x309fbe(0x178)](_0x2b7c44['id']));}return _0x443efb;}export function normalizeDatasetOperations(_0x40e1a0){const _0x522be7=a208_0x18bfa3;if(Array[_0x522be7(0xe7)](_0x40e1a0))return _0x40e1a0[_0x522be7(0x19f)](_0x2d839c=>_0x2d839c!=null&&typeof _0x2d839c==='object');if(_0x40e1a0&&typeof _0x40e1a0===_0x522be7(0x128))return Object[_0x522be7(0x13c)](_0x40e1a0)[_0x522be7(0x19f)](([,_0xe107cc])=>_0xe107cc!=null&&typeof _0xe107cc===_0x522be7(0x128))['map'](([_0x4d8d5b,_0x4d1cdd])=>({..._0x4d1cdd,'name':_0x4d1cdd[_0x522be7(0xdc)]??_0x4d1cdd[_0x522be7(0xe1)]??_0x4d8d5b}));return[];}export async function getDatasetDetail(_0x3259ff){const _0x173579=a208_0x18bfa3,_0x2ec6b5=/^\d+$/[_0x173579(0x134)](_0x3259ff)?'id':'code',_0x3e22b1=await apiRequest(_0x173579(0x129)+_0x2ec6b5+'='+_0x3259ff);return _0x3e22b1[_0x173579(0x114)];}export async function updateDrivenData(_0x52dd4d){const _0x173efe=a208_0x18bfa3,_0x1cb530=await apiRequest(_0x173efe(0x14d),{'method':_0x173efe(0xff),'body':_0x52dd4d});return _0x1cb530[_0x173efe(0x114)];}export async function getDatasetOperations(_0x19b44f){const _0x4f1304=a208_0x18bfa3,_0x10ce1b=await getDatasetDetail(_0x19b44f),_0x145cbb=normalizeDatasetOperations(_0x10ce1b[_0x4f1304(0x182)])[_0x4f1304(0x187)](_0x5565d8=>({'name':_0x5565d8[_0x4f1304(0xdc)]||_0x5565d8['operationName'],'displayName':_0x5565d8[_0x4f1304(0x12f)]||_0x5565d8[_0x4f1304(0xdc)],'type':_0x5565d8['type'],'method':_0x5565d8[_0x4f1304(0xd6)],'path':_0x5565d8[_0x4f1304(0x18f)],'enabled':_0x5565d8[_0x4f1304(0xd3)]??!![],'requestFields':_0x5565d8['requestFields'],'responseFields':_0x5565d8[_0x4f1304(0x107)]}));return{'dataset':{'id':_0x10ce1b['id']??_0x10ce1b['modelId'],'name':_0x10ce1b[_0x4f1304(0xdc)],'code':_0x10ce1b[_0x4f1304(0x1c4)]||_0x10ce1b[_0x4f1304(0x117)],'tableName':_0x10ce1b[_0x4f1304(0x115)]||_0x10ce1b[_0x4f1304(0x12a)]?.[_0x4f1304(0x115)]},'operations':_0x145cbb};}export async function getOperationDetail(_0x168388,_0x1df16f,_0x1cccea){const _0x18b990=a208_0x18bfa3;let _0x505a85=_0x1df16f;if(!/^\d+$/[_0x18b990(0x134)](_0x1df16f)){const _0x167e5f=await listDatasets(_0x168388,{'code':_0x1df16f}),_0x5c7352=_0x167e5f[_0x18b990(0x18c)](_0x3715f0=>_0x3715f0[_0x18b990(0x1c4)]===_0x1df16f||String(_0x3715f0['id'])===_0x1df16f);if(!_0x5c7352)throw CliErrors[_0x18b990(0x10c)](_0x18b990(0x18e)+_0x1df16f);_0x505a85=String(_0x5c7352['id']);}const _0x2c4da6=await getDatasetDetail(_0x505a85),_0x550b67=normalizeDatasetOperations(_0x2c4da6[_0x18b990(0x182)])[_0x18b990(0x18c)](_0x127fe4=>(_0x127fe4[_0x18b990(0xdc)]||_0x127fe4[_0x18b990(0xe1)])===_0x1cccea);if(!_0x550b67)throw CliErrors['validation'](_0x18b990(0xd5)+_0x1cccea+_0x18b990(0x1a2)+_0x1df16f);return{'dataset':{'id':_0x2c4da6['id']??_0x2c4da6[_0x18b990(0x15a)],'name':_0x2c4da6[_0x18b990(0xdc)],'code':_0x2c4da6[_0x18b990(0x1c4)]||_0x2c4da6[_0x18b990(0x117)],'tableName':_0x2c4da6[_0x18b990(0x115)]||_0x2c4da6[_0x18b990(0x12a)]?.[_0x18b990(0x115)]},'operation':_0x550b67};}export async function startGenerateStandardPages(_0x4bf675,_0x2f727e,_0x665520){const _0x460ecb=a208_0x18bfa3,_0x5d4ab7=await apiRequest(_0x460ecb(0x168)+_0x2f727e+_0x460ecb(0x183),{'method':_0x460ecb(0xff),'body':{'appCode':_0x4bf675,..._0x665520?.[_0x460ecb(0x106)]?{'clientOperationId':_0x665520[_0x460ecb(0x106)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5d4ab7[_0x460ecb(0x114)];}export async function getGenerateStandardPagesStatus(_0xaea27d,_0x3266ba,_0x5347fd){const _0x29528a=a208_0x18bfa3,_0x27fb2b=new URLSearchParams({'appCode':_0xaea27d});_0x5347fd[_0x29528a(0x110)]&&_0x27fb2b['set'](_0x29528a(0x110),_0x5347fd['operationId']);_0x5347fd['clientOperationId']&&_0x27fb2b[_0x29528a(0xf1)](_0x29528a(0x106),_0x5347fd['clientOperationId']);const _0x1e2086=await apiRequest(_0x29528a(0x168)+_0x3266ba+'/generate-standard-pages/status?'+_0x27fb2b['toString']());return _0x1e2086[_0x29528a(0x114)];}export async function getStandardPageStatus(_0x37f296,_0x406108){const _0x598190=a208_0x18bfa3,_0x2301d4=await apiRequest(_0x598190(0x168)+_0x406108+_0x598190(0xc7)+encodeURIComponent(_0x37f296));return _0x2301d4['data'];}export async function tryGetStandardPageStatus(_0x565f24,_0x36a319){const _0xaa737=a208_0x18bfa3;try{return await getStandardPageStatus(_0x565f24,_0x36a319);}catch(_0x58245f){if(_0x58245f instanceof CliError&&_0x58245f[_0xaa737(0x1c4)]===_0xaa737(0x17e)&&/404|not found|non-json response/i[_0xaa737(0x134)](_0x58245f[_0xaa737(0x133)]))return null;throw _0x58245f;}}export async function syncStandardPages(_0x210c19,_0x1cedb8){const _0x4ab45a=a208_0x18bfa3,_0x59d8e1=await apiRequest(_0x4ab45a(0x168)+_0x1cedb8+_0x4ab45a(0x105),{'method':_0x4ab45a(0xff),'body':{'appCode':_0x210c19}});return _0x59d8e1[_0x4ab45a(0x114)];}export async function getPageDetail(_0x20d280){const _0x40310b=a208_0x18bfa3,_0x4ea726=await apiRequest('/smartapi/lovrabet/detail?pageId='+_0x20d280);if(!_0x4ea726['data'])throw CliErrors[_0x40310b(0x10c)]('Page\x20not\x20found:\x20'+_0x20d280);return _0x4ea726[_0x40310b(0x114)];}export async function listDeletedPages(_0x4e950b,_0x3e2eb3,_0x3469d9){const _0x27e8f3=a208_0x18bfa3,_0x3d0d87=new URLSearchParams({'appCode':_0x4e950b,'type':_0x3e2eb3,'currentPage':String(_0x3469d9[_0x27e8f3(0x111)]),'pageSize':String(_0x3469d9['pageSize'])}),_0x2ee60f=await apiRequest(_0x27e8f3(0x121)+_0x3d0d87[_0x27e8f3(0x17b)]());return _0x2ee60f[_0x27e8f3(0x114)];}export async function restoreStandardPage(_0x58df06){const _0x19a226=a208_0x18bfa3;await apiRequest(_0x19a226(0x11d),{'method':_0x19a226(0xff),'body':{'id':_0x58df06}});}export async function restoreJsxPage(_0x5f383a,_0x596304){const _0x4da7cc=a208_0x18bfa3,_0x293c73=await apiRequest('/smartapi/webcode/page/restore',{'method':_0x4da7cc(0xff),'body':{'appCode':_0x5f383a,'id':_0x596304}});return _0x293c73[_0x4da7cc(0x114)];}export async function updatePage(_0x54e5b2,_0x15592f,_0x5e4ef9,_0x39f099){const _0x4d569d=a208_0x18bfa3,_0x4d68e1=await apiRequest(_0x4d569d(0x10f),{'method':_0x4d569d(0xff),'body':{'appCode':_0x54e5b2,'pageId':_0x15592f,'code':_0x5e4ef9,'datasetIds':_0x39f099}});return _0x4d68e1['data'];}export function generateSdkCode(_0x3376c2,_0x5023b6,_0xe301a4){const _0x1554f3=a208_0x18bfa3,_0x1aeee3=_0xe301a4?.[_0x1554f3(0x185)]??!![],_0x5584b0=_0x1554f3(0x1a1)+_0x3376c2['code']?.[_0x1554f3(0x141)](/-/g,'_'),_0x1d732a=_0x5023b6['name']||_0x5023b6['operationName']||'filter',_0x46f88f=[];_0x1aeee3&&_0x46f88f[_0x1554f3(0x18d)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x1554f3(0xc8),'');_0x46f88f[_0x1554f3(0x18d)](_0x1554f3(0x123)+_0x3376c2['name']+'\x20('+(_0x3376c2[_0x1554f3(0x115)]||_0x1554f3(0xcd))+')');if(_0x1d732a===_0x1554f3(0x19f))_0x46f88f[_0x1554f3(0x18d)](_0x1554f3(0xec)+_0x5584b0+_0x1554f3(0x1b9),_0x1554f3(0x1c7),_0x1554f3(0x140),'\x20\x20currentPage:\x201,',_0x1554f3(0xd1));else{if(_0x1d732a===_0x1554f3(0x1ae))_0x46f88f[_0x1554f3(0x18d)](_0x1554f3(0xec)+_0x5584b0+_0x1554f3(0x1aa));else{if(_0x1d732a==='create')_0x46f88f[_0x1554f3(0x18d)](_0x1554f3(0xec)+_0x5584b0+_0x1554f3(0x161));else{if(_0x1d732a===_0x1554f3(0x1c5))_0x46f88f[_0x1554f3(0x18d)]('const\x20result\x20=\x20await\x20client.models.'+_0x5584b0+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x1d732a===_0x1554f3(0xdd)||_0x1d732a==='remove'?_0x46f88f[_0x1554f3(0x18d)](_0x1554f3(0xec)+_0x5584b0+'.remove(id);'):_0x46f88f[_0x1554f3(0x18d)](_0x1554f3(0xec)+_0x5584b0+'.'+_0x1d732a+_0x1554f3(0x1ac));}}}return _0x46f88f[_0x1554f3(0x11b)]('\x0a');}export function generateSqlCodeTemplate(_0x246cf2,_0x5e1efd){const _0x4c18f2=a208_0x18bfa3,_0xa0f468=_0x5e1efd?.[_0x4c18f2(0xce)]??_0x4c18f2(0xf4),_0x3e8837=_0x5e1efd?.[_0x4c18f2(0x185)]??!![],_0x4b9050=[];return _0x4b9050[_0x4c18f2(0x18d)]('//\x20SQL:\x20'+_0x246cf2[_0x4c18f2(0x1b7)]+'\x20('+_0x246cf2['sqlCode']+')'),_0xa0f468===_0x4c18f2(0xf4)?(_0x3e8837&&_0x4b9050[_0x4c18f2(0x18d)](_0x4c18f2(0xf9),'',_0x4c18f2(0xc8),''),_0x4b9050[_0x4c18f2(0x18d)](_0x4c18f2(0xf6),_0x4c18f2(0x1a7)+_0x246cf2[_0x4c18f2(0x13e)]+'\x27,',_0x4c18f2(0x16f),_0x4c18f2(0xd1),_0x4c18f2(0x18a),_0x4c18f2(0x1a0))):_0x4b9050['push'](_0x4c18f2(0x163),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x4c18f2(0xe0),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x246cf2[_0x4c18f2(0x13e)]+'\x27,',_0x4c18f2(0x186),_0x4c18f2(0x16d),_0x4c18f2(0x176),'}'),_0x4b9050[_0x4c18f2(0x11b)]('\x0a');}export async function getErConfig(_0x427631,_0x16ba8f){const _0x3a39f0=a208_0x18bfa3,_0x2bb604=await apiRequest(_0x3a39f0(0x135),{'method':_0x3a39f0(0xff),'body':{'appCode':_0x427631,'dblinkId':_0x16ba8f},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x2bb604[_0x3a39f0(0x114)];}export async function getErRelationDetail(_0x2321fc,_0x1d7ff7){const _0x1a7b9b=a208_0x18bfa3,_0x4e20bd=new URLSearchParams({'appCode':_0x2321fc,'relationId':String(_0x1d7ff7)});try{const _0x516ab3=await apiRequest(_0x1a7b9b(0x1c1)+_0x4e20bd[_0x1a7b9b(0x17b)]());return _0x516ab3[_0x1a7b9b(0x114)]?.[_0x1a7b9b(0x104)]??null;}catch(_0x53437a){if(_0x53437a instanceof CliError&&_0x53437a[_0x1a7b9b(0x1c4)]===_0x1a7b9b(0x17e)&&(_0x53437a[_0x1a7b9b(0x188)]?.[_0x1a7b9b(0xd9)](_0x1a7b9b(0x131))||_0x53437a['hint']===_0x1a7b9b(0xfd)&&_0x53437a[_0x1a7b9b(0x133)]===_0x1a7b9b(0x13d)))return null;throw _0x53437a;}}export async function createErRelation(_0x2192fd){const _0x3c5f87=a208_0x18bfa3,_0x2fa1df=await apiRequest(_0x3c5f87(0x166),{'method':_0x3c5f87(0xff),'body':_0x2192fd,'allowNonJsonSuccess':!![]});return _0x2fa1df[_0x3c5f87(0x114)];}export async function updateErRelation(_0xe4246a){const _0x4e5201=a208_0x18bfa3,_0x4d1843=await apiRequest('/smartapi/question/er-config/cli/update-single',{'method':_0x4e5201(0xff),'body':_0xe4246a,'allowNonJsonSuccess':!![]});return _0x4d1843[_0x4e5201(0x114)];}export async function deleteErRelation(_0x1d2acc){const _0x2befc2=a208_0x18bfa3,_0x40fa66=await apiRequest('/smartapi/question/er-config/cli/delete-single',{'method':_0x2befc2(0xff),'body':_0x1d2acc,'allowNonJsonSuccess':!![]});return _0x40fa66[_0x2befc2(0x114)];}export async function updateErBusinessGroup(_0x4e75a0){const _0x2b72eb=a208_0x18bfa3,_0x55555e=await apiRequest(_0x2b72eb(0xf2),{'method':'POST','body':_0x4e75a0,'allowNonJsonSuccess':!![]});return _0x55555e['data'];}function buildQuery(_0x6484c2){const _0xe7704b=a208_0x18bfa3,_0xd24f60=new URLSearchParams();for(const [_0x1b1456,_0x2fcc4e]of Object[_0xe7704b(0x13c)](_0x6484c2)){if(_0x2fcc4e===undefined||_0x2fcc4e==='')continue;_0xd24f60[_0xe7704b(0xf1)](_0x1b1456,String(_0x2fcc4e));}const _0x9185a4=_0xd24f60['toString']();return _0x9185a4?'?'+_0x9185a4:'';}function a208_0x4f67(){const _0x32c3e8=[':\x20invalid\x20JSON\x20response\x20envelope','/smartapi/common/queryFileUrl','validation','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20','737580ELPrPA','/smartapi/lovrabet/update-page','operationId','currentPage','/smartapi/permit/user-role/get-user-list','key','data','tableName','Knowledge-base\x20pageSize\x20must\x20be\x20an\x20integer\x20between\x201\x20and\x20','modelCode','needPublic','username','max','join','Fetch\x20doc\x20(','/smartapi/page/restore','physicalTableCount','cli:rabetbase','Request\x20failed:\x20','/smartapi/page/getDeletedPageList?','/api/node-toolbox/dataset/model-list?','//\x20','errorMessage','911532ArZkEi','/api/management/library/scripts/info?id=','defineProperty','object','/smartapi/dataset/get-driven-data?','dbtableConfig','/smartapi/menu/create','4HVGGDe','download','errorMsg','displayName','/smartapi/custom/deleteUserCustomSql','DATA_NOT_EXIST','url','message','test','/smartapi/question/er-config','/smartapi/dataset/delete-dataset','/smartapi/menu/regroup','Invalid\x20response\x20format\x20(','configArray','updateTime','roleType','entries','ER\x20relation\x20does\x20not\x20exist','sqlCode','version','\x20\x20pageSize:\x2020,','replace','totalCount','/smartapi/menu/find?','roleName','tags','/smartapi/permit/page/save','company','\x20failed','\x20failed,\x20HTTP\x20','Knowledge-base\x20API\x20returned\x20an\x20invalid\x20record\x20contract.','API\x20error\x20code:\x20','title','/smartapi/dataset/update-driven-data',',\x20HTTP\x20','/smartapi/permit/page/get-one','/smartapi/permit/role/delete','number','scope','avatar','dbId','/smartapi/db-analysis/status/','/smartapi/app-config/getByKey','isSafeInteger','\x20apps.\x20','label','modelId','stringify','status','607888eYhico','signal','/smartapi/dataset/text-generate/status?','SQL\x20query\x20not\x20found:\x20','.create({\x20/*\x20fields\x20*/\x20});','markdown','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','/smartapi/app-config/delete','tableList','/smartapi/question/er-config/cli/erCreate','/api/node-toolbox/sql/save','/smartapi/lovrabet/dataset/','needSelf','/userTenant/getByTenantCode','pageIndex','Delete\x20enterprise\x20knowledge\x20base','\x20\x20});','/smartapi/custom/updateUserCustomSql','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/api/management/library/scripts/delete','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','NaN','isInteger','ENABLE','Update\x20enterprise\x20knowledge\x20base','\x20\x20return\x20rows;','/smartapi/dblink/delete','add','body','permits','toString','/smartapi/dataset/text-generate/preview','scriptType','api_error','remark','warn','summary','operations','/generate-standard-pages/start','/smartapi/permit/role/create','includeImports','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','map','hint','Get\x20enterprise\x20knowledge\x20base','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','正在从服务器拉取模型列表...\x20(环境:\x20','find','push','Dataset\x20not\x20found:\x20','path','/smartapi/app-config/list','toLowerCase','has','string','List\x20enterprise\x20knowledge\x20bases\x20returned\x20an\x20invalid\x20response\x20contract.','pageSize','/smartapi/custom/getUserCustomSql','datasetName','663318npobbJ','47691ouIgwr','/smartapi/app-config/create','List\x20enterprise\x20knowledge\x20bases','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','/smartapi/dblink/getAllTableList','/smartapi/permit/role/update','filter','const\x20results\x20=\x20data.execResult\x20||\x20[];','dataset_','\x22\x20not\x20found\x20in\x20dataset\x20','Request\x20timeout:\x20','createTime','/smartapi/menu/delete','Fetch\x20async\x20task\x20','\x20\x20sqlCode:\x20\x27','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','98YZYHBm','.getOne(id);','startsWith','(/*\x20params\x20*/);','error','getOne','/api/','isFinite','3598060OACEkI','Check\x20network\x20connectivity\x20and\x20try\x20again.','/smartapi/custom/saveUserCustomSql','append','/smartapi/ocr/recognize-text?','/smartapi/app-config/update','sqlName','/smartapi/dblink/update','.filter({','List\x20enterprise\x20knowledge\x20bases\x20returned\x20invalid\x20paging\x20metadata.','Knowledge-base\x20response\x20is\x20missing\x20a\x20valid\x20','tableData','apiError','Fetch\x20datasets','401','/api/management/library/scripts/list?appCode=','/smartapi/question/er-config/cli/detail?','/smartapi/permit/role/get-permit-list','/admin/knowledge-base/delete','code','update','trim','\x20\x20where:\x20{},','content','/smartapi/db-analysis/start','platform-transport-failure','personal','application/json','length','Create\x20enterprise\x20knowledge\x20base','array','AbortError','functionName','min','email','/smartapi/dblink/getOne','/standard-page-status?appCode=','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','/smartapi/menu/update','/api/management/library/scripts/statistics?appCode=','longTerm','?sqlCode=','table','target','fetch-model-list','authRequired','});','requirementDescription','enabled','460rboqSC','Operation\x20\x22','method','platform-error-code','json','includes','list','type','name','delete','/smartapi/permit/role/get-list','file','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','operationName','errorCode','/smartapi/menu/batchDelete','/smartapi/dblink/create','/smartapi/permit/resource/get-menu-list','CUSTOM','isArray','API\x20error:\x20','success','description','value','const\x20result\x20=\x20await\x20client.models.','Fetch\x20menu\x20list','\x20of\x20','mobile','/notification/channel-config/list','set','/smartapi/question/er-config/business-group/edit','575368zWBVqN','sdk','appCode','const\x20data\x20=\x20await\x20client.sql.execute({','/smartapi/dblink/testConnect','/smartapi/permit/role/get-one','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','abort','/smartapi/dataset/text-generate/start','userId','API\x20error\x20code:\x20306','scriptName','POST','/admin/knowledge-base/create','0000','/api/custom/executeSql','GET','relation','/sync-to-pages','clientOperationId','responseFields','/smartapi/custom/queryUserCustomSqlList','/smartapi/permit/resource/get-api-list'];a208_0x4f67=function(){return _0x32c3e8;};return a208_0x4f67();}export async function listNotificationChannelConfigs(_0x55a82e,_0xddbcd1){const _0x1502eb=a208_0x18bfa3,_0x3cc48d=await apiRequest(_0x1502eb(0xf0)+buildQuery({'appCode':_0x55a82e,'channelType':_0xddbcd1}));return Array[_0x1502eb(0xe7)](_0x3cc48d['data'])?_0x3cc48d[_0x1502eb(0x114)]:[];}export async function listAppConfigs(_0x3f49e8,_0x4bcb94){const _0x10ec75=a208_0x18bfa3,_0x2749c0=await apiRequest(_0x10ec75(0x190),{'method':'POST','body':{'appCode':_0x3f49e8,..._0x4bcb94?.['key']?{'key':_0x4bcb94[_0x10ec75(0x113)]}:{},..._0x4bcb94?.['tags']?{'tags':_0x4bcb94['tags']}:{}}});return extractAppConfigList(_0x2749c0[_0x10ec75(0x114)]);}export async function getAppConfigByKey(_0xa32dbc,_0x20a6a2){const _0x40352b=a208_0x18bfa3,_0x22b496=await apiRequest(_0x40352b(0x156)+buildQuery({'appCode':_0xa32dbc,'key':_0x20a6a2}));return _0x22b496[_0x40352b(0x114)]??null;}export async function createAppConfig(_0x38c5c6){const _0x49dd5c=a208_0x18bfa3,_0x15512d=await apiRequest(_0x49dd5c(0x19a),{'method':_0x49dd5c(0xff),'body':{'appCode':_0x38c5c6[_0x49dd5c(0xf5)],'key':_0x38c5c6['key'],'value':_0x38c5c6[_0x49dd5c(0xeb)],..._0x38c5c6['tags']?{'tags':_0x38c5c6[_0x49dd5c(0x145)]}:{}}});return _0x15512d[_0x49dd5c(0x114)];}export async function updateAppConfig(_0x3925e5){const _0x1ece5c=a208_0x18bfa3;await apiRequest(_0x1ece5c(0x1b6),{'method':_0x1ece5c(0xff),'body':{'id':_0x3925e5['id'],'appCode':_0x3925e5[_0x1ece5c(0xf5)],'key':_0x3925e5[_0x1ece5c(0x113)],'value':_0x3925e5[_0x1ece5c(0xeb)],..._0x3925e5['tags']?{'tags':_0x3925e5[_0x1ece5c(0x145)]}:{}}});}export async function deleteAppConfig(_0x5aed0b){const _0x561bef=a208_0x18bfa3;await apiRequest(_0x561bef(0x164),{'method':_0x561bef(0xff),'body':_0x5aed0b});}function extractAppConfigList(_0x4737d2){const _0x4db548=a208_0x18bfa3;if(Array[_0x4db548(0xe7)](_0x4737d2))return _0x4737d2;if(_0x4737d2&&typeof _0x4737d2===_0x4db548(0x128)&&Array[_0x4db548(0xe7)](_0x4737d2[_0x4db548(0xda)]))return _0x4737d2[_0x4db548(0xda)];return extractList(_0x4737d2);}export async function listDbLinks(_0x4bfa55,_0x48da5f){const _0x1ee542=a208_0x18bfa3,_0x37e365=await apiRequest('/smartapi/dblink/getList',{'method':_0x1ee542(0xff),'body':{'appCode':_0x4bfa55,'currentPage':_0x48da5f?.['currentPage']??0x1,'pageSize':_0x48da5f?.['pageSize']??0x64}});return{'items':extractList(_0x37e365[_0x1ee542(0x114)]),'paging':extractPaging(_0x37e365['data'])};}export async function getDbLinkInfo(_0x522340){const _0x4c9c36=a208_0x18bfa3,_0x1969fa=await apiRequest(_0x4c9c36(0xc6)+buildQuery({'id':_0x522340}));return _0x1969fa[_0x4c9c36(0x114)];}export async function createDbLink(_0x2dadf7){const _0x49648c=a208_0x18bfa3,_0x104b7b=await apiRequest(_0x49648c(0xe4),{'method':_0x49648c(0xff),'body':_0x2dadf7});return _0x104b7b[_0x49648c(0x114)];}export async function updateDbLink(_0x4dd126){const _0x1f4016=a208_0x18bfa3,_0x4e45b8=await apiRequest(_0x1f4016(0x1b8),{'method':_0x1f4016(0xff),'body':_0x4dd126});return _0x4e45b8[_0x1f4016(0x114)];}export async function deleteDbLink(_0x194521){const _0x2fd51c=a208_0x18bfa3;await apiRequest(_0x2fd51c(0x177),{'method':_0x2fd51c(0xff),'body':{'id':_0x194521}});}export async function testDbLinkConnect(_0x3dad40){const _0x12f74f=a208_0x18bfa3,_0x24dc38=await apiRequest(_0x12f74f(0xf7)+buildQuery({'id':_0x3dad40}));return _0x24dc38[_0x12f74f(0x114)];}export async function startDbAnalysis(_0x892ba3,_0xc4a180){const _0x32cd4b=a208_0x18bfa3,_0x4e95e6=await apiRequest(_0x32cd4b(0xbb),{'method':'POST','body':{'dbLinkId':_0x892ba3,..._0xc4a180&&_0xc4a180[_0x32cd4b(0xbf)]>0x0?{'tableNames':_0xc4a180}:{}}});return _0x4e95e6['data'];}export async function cancelDbAnalysis(_0x2e32f7){const _0x1fc49e=a208_0x18bfa3;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x2e32f7}),{'method':_0x1fc49e(0xff)});}export async function getDbAnalysisStatus(_0x3a3840){const _0x18b377=a208_0x18bfa3,_0x4f49ed=await apiRequest(_0x18b377(0x155)+encodeURIComponent(_0x3a3840));return _0x4f49ed['data'];}export async function getDbAllTableList(_0x50e048,_0x1d8424){const _0x2cf3c4=a208_0x18bfa3,_0xddb428=await apiRequest(_0x2cf3c4(0x19d)+buildQuery({'appCode':_0x50e048,'dbLinkId':_0x1d8424})),_0x196fd2=_0xddb428[_0x2cf3c4(0x114)];if(Array['isArray'](_0x196fd2))return _0x196fd2;return extractList(_0x196fd2);}export async function getDbTableDiff(_0xa0b68a,_0x32b8f2,_0x59fc57){const _0x339751=a208_0x18bfa3,_0x5ea1ac=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0xa0b68a,'dbLinkId':_0x32b8f2,'pageIndex':_0x59fc57?.[_0x339751(0x16b)]??0x1,'pageSize':_0x59fc57?.[_0x339751(0x195)]??0x14,'tableName':_0x59fc57?.[_0x339751(0x115)]})),_0x1bad0d=_0x5ea1ac['data'];return{'totalCount':_0x1bad0d?.['totalCount']??0x0,'physicalTableCount':_0x1bad0d?.[_0x339751(0x11e)]??0x0,'datasetTableCount':_0x1bad0d?.['datasetTableCount']??0x0,..._0x1bad0d?.[_0x339751(0x181)]?{'summary':_0x1bad0d[_0x339751(0x181)]}:{},'tableList':Array[_0x339751(0xe7)](_0x1bad0d?.['tableList'])?_0x1bad0d[_0x339751(0x165)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x46762b=a208_0x18bfa3,_0x1386dd=await apiRequest('/smartapi/app/getList',{'method':_0x46762b(0xff),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x81a55f=extractList(_0x1386dd[_0x46762b(0x114)]),_0x1c6d0a=extractPaging(_0x1386dd[_0x46762b(0x114)]);return _0x1c6d0a&&_0x1c6d0a['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x46762b(0x180)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+_0x46762b(0xee)+_0x1c6d0a[_0x46762b(0x142)]+_0x46762b(0x158)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x81a55f;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x34625d,_0x5c23b2){const _0x5a2b9c=a208_0x18bfa3,_0x38afae=Math[_0x5a2b9c(0xc4)](Math[_0x5a2b9c(0x11a)](_0x5c23b2?.[_0x5a2b9c(0x195)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x364be2=await apiRequest(_0x5a2b9c(0xde),{'method':_0x5a2b9c(0xff),'body':{'appCode':_0x34625d,'currentPage':_0x5c23b2?.[_0x5a2b9c(0x111)]??0x1,'pageSize':_0x38afae}});return{'items':extractList(_0x364be2[_0x5a2b9c(0x114)]),'paging':extractPaging(_0x364be2[_0x5a2b9c(0x114)])};}export async function getAppRole(_0x131811){const _0x42db83=a208_0x18bfa3,_0x47db5f=await apiRequest(_0x42db83(0xf8)+buildQuery({'id':_0x131811}));return _0x47db5f[_0x42db83(0x114)];}export async function createAppRole(_0x41874c){const _0x2d0f9b=a208_0x18bfa3,_0x12dabf=await apiRequest(_0x2d0f9b(0x184),{'method':_0x2d0f9b(0xff),'body':{'appCode':_0x41874c['appCode'],'roleName':_0x41874c[_0x2d0f9b(0x144)],'roleType':_0x2d0f9b(0xe6),..._0x41874c[_0x2d0f9b(0x17f)]?{'remark':_0x41874c[_0x2d0f9b(0x17f)]}:{}}});return _0x12dabf[_0x2d0f9b(0x114)];}export async function updateAppRole(_0x3d990e){const _0x328c6e=a208_0x18bfa3,_0x55e73d=await apiRequest(_0x328c6e(0x19e),{'method':_0x328c6e(0xff),'body':{'id':_0x3d990e['id'],'appCode':_0x3d990e[_0x328c6e(0xf5)],..._0x3d990e[_0x328c6e(0x13b)]?{'roleType':_0x3d990e[_0x328c6e(0x13b)]}:{},..._0x3d990e[_0x328c6e(0x144)]!==undefined?{'roleName':_0x3d990e[_0x328c6e(0x144)]}:{},..._0x3d990e[_0x328c6e(0x17f)]!==undefined?{'remark':_0x3d990e['remark']}:{},..._0x3d990e[_0x328c6e(0x17a)]?{'permits':_0x3d990e[_0x328c6e(0x17a)]}:{}}});return _0x55e73d[_0x328c6e(0x114)];}export async function deleteAppRole(_0x3c5e14){const _0x4fbbff=a208_0x18bfa3;await apiRequest(_0x4fbbff(0x150),{'method':_0x4fbbff(0xff),'body':{'id':_0x3c5e14}});}export async function listPermitRoles(_0x214e41,_0x4be50b){const _0x43945f=a208_0x18bfa3,_0x1782d8=await apiRequest(_0x43945f(0x1c2),{'method':_0x43945f(0xff),'body':{'appCode':_0x214e41,..._0x4be50b?.['needSelf']!==undefined?{'needSelf':_0x4be50b[_0x43945f(0x169)]}:{},..._0x4be50b?.[_0x43945f(0x118)]!==undefined?{'needPublic':_0x4be50b[_0x43945f(0x118)]}:{}}});return extractList(_0x1782d8[_0x43945f(0x114)]);}export async function getRoleMenuResources(_0x129043,_0x5c244f){const _0x3a76f0=a208_0x18bfa3,_0x462e27=await apiRequest(_0x3a76f0(0xe5),{'method':_0x3a76f0(0xff),'body':{'appCode':_0x129043,'roleId':_0x5c244f}});return extractList(_0x462e27[_0x3a76f0(0x114)]);}export async function getRoleApiResources(_0x426251,_0x573471){const _0x489743=a208_0x18bfa3,_0x258371=await apiRequest(_0x489743(0x109),{'method':_0x489743(0xff),'body':{'appCode':_0x426251,'roleId':_0x573471}});return extractList(_0x258371[_0x489743(0x114)]);}export async function listRoleUsers(_0x3da2cc){const _0x513bcb=a208_0x18bfa3,_0x2b7ad5=await apiRequest(_0x513bcb(0x112),{'method':_0x513bcb(0xff),'body':{'appCode':_0x3da2cc}});return extractList(_0x2b7ad5[_0x513bcb(0x114)]);}export async function updateRoleUsers(_0x34316b,_0x2e2125){const _0x5b1665=a208_0x18bfa3;await apiRequest('/smartapi/permit/user-role/update-user-list',{'method':_0x5b1665(0xff),'body':{'appCode':_0x34316b,'roleList':_0x2e2125}});}export async function getPagePermit(_0x4d9ff2){const _0x453667=a208_0x18bfa3,_0x345abf=await apiRequest(_0x453667(0x14f)+buildQuery({'menuId':_0x4d9ff2}));return _0x345abf[_0x453667(0x114)];}export async function savePagePermit(_0xd3983e){const _0x3f7e45=a208_0x18bfa3,_0x30f0f3=await apiRequest(_0x3f7e45(0x146),{'method':'POST','body':_0xd3983e});return _0x30f0f3[_0x3f7e45(0x114)];}export async function getTenantMembers(_0x477994){const _0x6b50e8=a208_0x18bfa3,_0x3b4041=await apiRequest(_0x6b50e8(0x16a)+buildQuery({'code':_0x477994})),_0x4dfc68=_0x3b4041[_0x6b50e8(0x114)]??{},_0x2aa540=Array[_0x6b50e8(0xe7)](_0x4dfc68?.['userTenantRelationList'])?_0x4dfc68['userTenantRelationList']:[];return _0x2aa540['filter'](_0x52861c=>_0x52861c?.[_0x6b50e8(0x15c)]===_0x6b50e8(0x174)||_0x52861c?.['status']===undefined)[_0x6b50e8(0x187)](_0x3b0391=>({'userId':Number(_0x3b0391[_0x6b50e8(0xfc)]??_0x3b0391['id']),'username':_0x3b0391[_0x6b50e8(0x119)],'nickname':_0x3b0391['nickname'],'status':_0x3b0391[_0x6b50e8(0x15c)],'email':_0x3b0391[_0x6b50e8(0xc5)],'mobile':_0x3b0391[_0x6b50e8(0xef)],'avatar':_0x3b0391[_0x6b50e8(0x153)]}))[_0x6b50e8(0x19f)](_0x28c0ca=>Number[_0x6b50e8(0x1b0)](_0x28c0ca[_0x6b50e8(0xfc)])&&_0x28c0ca['userId']>0x0);}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a209_0x44ce01=a209_0x1b3b;function a209_0x1b3b(_0x3faf44,_0x7de797){_0x3faf44=_0x3faf44-0xd5;const _0x3abcab=a209_0x3abc();let _0x1b3ba3=_0x3abcab[_0x3faf44];return _0x1b3ba3;}(function(_0x1dbb5b,_0x237e01){const _0x1e0fc6=a209_0x1b3b,_0x2feef4=_0x1dbb5b();while(!![]){try{const _0x15f5f9=-parseInt(_0x1e0fc6(0xd8))/0x1+-parseInt(_0x1e0fc6(0xe0))/0x2+-parseInt(_0x1e0fc6(0xdd))/0x3*(-parseInt(_0x1e0fc6(0xe2))/0x4)+parseInt(_0x1e0fc6(0xdf))/0x5*(parseInt(_0x1e0fc6(0xde))/0x6)+parseInt(_0x1e0fc6(0xd6))/0x7*(parseInt(_0x1e0fc6(0xda))/0x8)+-parseInt(_0x1e0fc6(0xe3))/0x9*(-parseInt(_0x1e0fc6(0xe1))/0xa)+-parseInt(_0x1e0fc6(0xd9))/0xb*(-parseInt(_0x1e0fc6(0xdc))/0xc);if(_0x15f5f9===_0x237e01)break;else _0x2feef4['push'](_0x2feef4['shift']());}catch(_0xd44ad7){_0x2feef4['push'](_0x2feef4['shift']());}}}(a209_0x3abc,0x36466));import{resolve}from'node:path';function a209_0x3abc(){const _0x48f1e5=['4aOikwK','165339HbQAUR','/bff','612752YJKsrH','bff','430938oxQWrU','143wVeeDk','40iborgS','bff.lock.json','5196ADottY','577101PghJWe','1190118eTJbuy','5TbTWnQ','398304cJQRWP','10kVneGT'];a209_0x3abc=function(){return _0x48f1e5;};return a209_0x3abc();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a209_0x44ce01(0xdb),TRASH_DIR_NAME='bff-trash';export function loadBffProjectConfig(_0x304994,_0x4983b8){const _0x4466b9=a209_0x44ce01,_0x59951e=resolve(_0x4983b8??findProjectRootDirectory()),_0x3b5ab1=DOT_DIR+_0x4466b9(0xd5),_0x2a2234=_0x3b5ab1+'/'+_0x304994;return{'projectRoot':_0x59951e,'appCode':_0x304994,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x3b5ab1,'scriptsRoot':_0x2a2234,'scriptsRootDir':resolve(_0x59951e,DOT_DIR,_0x4466b9(0xd7),_0x304994),'lockFilePath':resolve(_0x59951e,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x59951e,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a210_0x5b324d=a210_0x28a0;(function(_0x4a637d,_0x5c2bae){const _0x10f21c=a210_0x28a0,_0x55fabc=_0x4a637d();while(!![]){try{const _0x3b1f45=parseInt(_0x10f21c(0x1a6))/0x1+parseInt(_0x10f21c(0x1be))/0x2*(-parseInt(_0x10f21c(0x1b1))/0x3)+-parseInt(_0x10f21c(0x1b7))/0x4*(parseInt(_0x10f21c(0x1ad))/0x5)+parseInt(_0x10f21c(0x1a5))/0x6+-parseInt(_0x10f21c(0x1b8))/0x7*(-parseInt(_0x10f21c(0x1c0))/0x8)+parseInt(_0x10f21c(0x1b0))/0x9+parseInt(_0x10f21c(0x1aa))/0xa;if(_0x3b1f45===_0x5c2bae)break;else _0x55fabc['push'](_0x55fabc['shift']());}catch(_0x3050d1){_0x55fabc['push'](_0x55fabc['shift']());}}}(a210_0x1af5,0x7b092));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a210_0x5b324d(0x1b9),a210_0x5b324d(0x1ab),a210_0x5b324d(0x1c3)];export function normalizeBffType(_0x5e7aa4){const _0x5e139f=a210_0x5b324d;if(!_0x5e7aa4)return undefined;const _0x108b3a=_0x5e7aa4['trim']()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x5e139f(0x1c8)](_0x108b3a)?_0x108b3a:undefined;}async function scanJsFilesRecursively(_0x5ebc9f,_0x3a92ff){const _0x1690b0=a210_0x5b324d,_0x39aba2=[];try{const _0x34f911=await readdir(_0x5ebc9f,{'withFileTypes':!![]});for(const _0x1ec9dc of _0x34f911){const _0x55b0f7=join(_0x5ebc9f,_0x1ec9dc[_0x1690b0(0x1ba)]);if(_0x1ec9dc[_0x1690b0(0x1b5)]())_0x39aba2[_0x1690b0(0x1a8)](...await scanJsFilesRecursively(_0x55b0f7,_0x3a92ff+'/'+_0x1ec9dc[_0x1690b0(0x1ba)]));else _0x1ec9dc['isFile']()&&_0x1ec9dc[_0x1690b0(0x1ba)][_0x1690b0(0x1a7)](_0x1690b0(0x1c1))&&_0x39aba2['push']({'lockKey':_0x3a92ff+'/'+_0x1ec9dc[_0x1690b0(0x1ba)][_0x1690b0(0x1ae)](/\.js$/,''),'filePath':_0x55b0f7});}}catch(_0x32e7d2){if(_0x32e7d2[_0x1690b0(0x1bd)]!=='ENOENT')throw _0x32e7d2;}return _0x39aba2;}async function scanFlatFunctions(_0x5172c6,_0x32a58e){const _0x49c705=a210_0x5b324d,_0xf02e60=join(_0x5172c6[_0x49c705(0x1c6)],_0x32a58e),_0x674dcb=await scanJsFilesRecursively(_0xf02e60,_0x32a58e);return _0x674dcb[_0x49c705(0x1bb)](({lockKey:_0x196dcb,filePath:_0x4b050b})=>({'type':_0x32a58e,'name':_0x196dcb[_0x49c705(0x1b4)]('/')['at'](-0x1)??'','filePath':_0x4b050b,'lockKey':_0x196dcb}));}async function scanHookFunctions(_0x4137f3){const _0x26e4d4=a210_0x5b324d,_0x5aca15=join(_0x4137f3[_0x26e4d4(0x1c6)],_0x26e4d4(0x1c3)),_0x77ca59=[];try{const _0x1f520e=await readdir(_0x5aca15,{'withFileTypes':!![]});for(const _0xde3b71 of _0x1f520e){if(!_0xde3b71[_0x26e4d4(0x1b5)]())continue;const _0x41dc6d=_0xde3b71['name'],_0xf6c5fd=join(_0x5aca15,_0x41dc6d),_0x8a7c1=await readdir(_0xf6c5fd,{'withFileTypes':!![]});for(const _0x8950d5 of _0x8a7c1){if(!_0x8950d5[_0x26e4d4(0x1b5)]())continue;const _0x405aa3=_0x8950d5[_0x26e4d4(0x1ba)],_0x242d1b=join(_0xf6c5fd,_0x405aa3),_0x31b7b3=await readdir(_0x242d1b,{'withFileTypes':!![]});for(const _0x41a543 of _0x31b7b3){if(!_0x41a543[_0x26e4d4(0x1b5)]())continue;const _0x45a451=_0x41a543['name'],_0x4b4e24=join(_0x242d1b,_0x45a451),_0xe4c9d7=await readdir(_0x4b4e24,{'withFileTypes':!![]});for(const _0xe6e4e6 of _0xe4c9d7){if(!_0xe6e4e6[_0x26e4d4(0x1b2)]()||!_0xe6e4e6[_0x26e4d4(0x1ba)][_0x26e4d4(0x1a7)](_0x26e4d4(0x1c1)))continue;const _0x2ea552=_0xe6e4e6[_0x26e4d4(0x1ba)][_0x26e4d4(0x1ae)](/\.js$/,'');_0x77ca59['push']({'type':_0x26e4d4(0x1c3),'name':_0x2ea552,'filePath':join(_0x4b4e24,_0xe6e4e6[_0x26e4d4(0x1ba)]),'lockKey':'HOOK/'+_0x41dc6d+'/'+_0x405aa3+'/'+_0x45a451+'/'+_0x2ea552,'alias':_0x41dc6d,'operationType':_0x405aa3,'functionNode':_0x45a451});}}}}}catch(_0x4b2fae){if(_0x4b2fae[_0x26e4d4(0x1bd)]!==_0x26e4d4(0x1bf))throw _0x4b2fae;}return _0x77ca59;}function a210_0x1af5(){const _0x491914=['isFile','before','split','isDirectory','beforeScriptId','40952ltwygv','1519XAYIIf','COMMON','name','map','functionNode','code','224QOdfBo','ENOENT','16984WKEalQ','.js','scriptType','HOOK','set','datasetCode','scriptsRootDir','HOOK/','includes','functionName','1965432MPZIFO','112860XkdQrm','endsWith','push','operationType','642710AZkLyW','ENDPOINT','after','55wWsLdF','replace','afterScriptId','5390298ODXnIH','25386wNdbfn'];a210_0x1af5=function(){return _0x491914;};return a210_0x1af5();}export async function scanLocalBffFunctions(_0x4b655d,_0x270afe){const _0x53b241=a210_0x5b324d;if(_0x270afe===_0x53b241(0x1b9)||_0x270afe==='ENDPOINT')return scanFlatFunctions(_0x4b655d,_0x270afe);if(_0x270afe===_0x53b241(0x1c3))return scanHookFunctions(_0x4b655d);const [_0x599c7f,_0x4e23c4,_0x6e71ab]=await Promise['all']([scanFlatFunctions(_0x4b655d,_0x53b241(0x1b9)),scanFlatFunctions(_0x4b655d,'ENDPOINT'),scanHookFunctions(_0x4b655d)]);return[..._0x599c7f,..._0x4e23c4,..._0x6e71ab];}export function resolveLocalFilePathFromLockKey(_0x5558f2,_0xb67523){const _0x209d54=a210_0x5b324d;return join(_0x5558f2['scriptsRootDir'],..._0xb67523[_0x209d54(0x1b4)]('/'))+_0x209d54(0x1c1);}export function createHookLocationMap(_0x356847){const _0x304d5b=a210_0x5b324d,_0x25dc03=new Map();for(const _0x54c3d1 of _0x356847){_0x54c3d1['beforeScriptId']&&_0x25dc03[_0x304d5b(0x1c4)](_0x54c3d1[_0x304d5b(0x1b6)],{'datasetCode':_0x54c3d1['datasetCode'],'operationType':snakeToCamel(_0x54c3d1[_0x304d5b(0x1a9)]),'functionNode':_0x304d5b(0x1b3)}),_0x54c3d1['afterScriptId']&&_0x25dc03['set'](_0x54c3d1[_0x304d5b(0x1af)],{'datasetCode':_0x54c3d1['datasetCode'],'operationType':snakeToCamel(_0x54c3d1[_0x304d5b(0x1a9)]),'functionNode':_0x304d5b(0x1ac)});}return _0x25dc03;}export function resolveRemoteScriptTarget(_0x2d4e49,_0x4db379,_0xc9e528,_0x1844b7,_0xda5c90){const _0x1f8bb6=a210_0x5b324d,_0x24ed20=normalizeBffType(_0x4db379[_0x1f8bb6(0x1c2)]);if(!_0x24ed20||!_0x4db379[_0x1f8bb6(0x1a4)])return null;if(_0x24ed20===_0x1f8bb6(0x1c3)){const _0xa76cbb=(_0x4db379['id']?_0xc9e528['get'](_0x4db379['id']):undefined)??findHookLocationByRemoteId(_0x1844b7,_0x4db379['id']);if(!_0xa76cbb)return null;const _0x4732dd=_0xa76cbb['alias']||_0xda5c90['get'](_0xa76cbb['datasetCode']),_0x47add6=_0x4732dd??_0xa76cbb[_0x1f8bb6(0x1c5)],_0xd88c4c={..._0xa76cbb,'alias':_0x4732dd},_0x1a4ea1=_0x1f8bb6(0x1c7)+_0x47add6+'/'+_0xd88c4c[_0x1f8bb6(0x1a9)]+'/'+_0xd88c4c[_0x1f8bb6(0x1bc)]+'/'+_0x4db379[_0x1f8bb6(0x1a4)];return{'lockKey':_0x1a4ea1,'filePath':resolveLocalFilePathFromLockKey(_0x2d4e49,_0x1a4ea1),'type':_0x1f8bb6(0x1c3),'hookLocation':_0xd88c4c};}const _0x4e978a=_0x24ed20+'/'+_0x4db379['functionName'];return{'lockKey':_0x4e978a,'filePath':resolveLocalFilePathFromLockKey(_0x2d4e49,_0x4e978a),'type':_0x24ed20};}function a210_0x28a0(_0x2acc21,_0x6643c5){_0x2acc21=_0x2acc21-0x1a4;const _0x1af5ef=a210_0x1af5();let _0x28a025=_0x1af5ef[_0x2acc21];return _0x28a025;}export async function ensureParentDirectory(_0x4e0233){await mkdir(dirname(_0x4e0233),{'recursive':!![]});}export async function fileExists(_0x17c8af){try{return await access(_0x17c8af,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x293e4a){const _0x13b6b1=a210_0x5b324d;try{const _0x4b4151=await stat(_0x293e4a);return _0x4b4151[_0x13b6b1(0x1b5)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x163b15,_0x12cf55){const _0x4a887b=a211_0x1dc8,_0x59bc8a=_0x163b15();while(!![]){try{const _0x36d1e0=-parseInt(_0x4a887b(0x12b))/0x1*(-parseInt(_0x4a887b(0x128))/0x2)+-parseInt(_0x4a887b(0x12c))/0x3*(parseInt(_0x4a887b(0x123))/0x4)+-parseInt(_0x4a887b(0x12e))/0x5+parseInt(_0x4a887b(0x124))/0x6*(parseInt(_0x4a887b(0x12a))/0x7)+-parseInt(_0x4a887b(0x129))/0x8+-parseInt(_0x4a887b(0x131))/0x9+-parseInt(_0x4a887b(0x122))/0xa*(-parseInt(_0x4a887b(0x126))/0xb);if(_0x36d1e0===_0x12cf55)break;else _0x59bc8a['push'](_0x59bc8a['shift']());}catch(_0x4874c3){_0x59bc8a['push'](_0x59bc8a['shift']());}}}(a211_0x1b97,0x7af63));function a211_0x1dc8(_0x3ed7ec,_0x4ff71f){_0x3ed7ec=_0x3ed7ec-0x122;const _0x1b97c1=a211_0x1b97();let _0x1dc8c0=_0x1b97c1[_0x3ed7ec];return _0x1dc8c0;}import{readFile}from'node:fs/promises';function a211_0x1b97(){const _0x4dd643=['2178500wXODlS','18jqufyq','hex','11lIKdFY','utf8','2PYfAcC','2975120WkRVUi','451836JSnuWr','218332aBgaFd','3MucxLb','update','3814850kczriJ','createHash','md5','8991693xePQhg','27702370HzwQgo'];a211_0x1b97=function(){return _0x4dd643;};return a211_0x1b97();}import a211_0x4883a7 from'node:crypto';export function computeContentHash(_0x39d8be){const _0x5d202e=a211_0x1dc8;return a211_0x4883a7[_0x5d202e(0x12f)](_0x5d202e(0x130))[_0x5d202e(0x12d)](_0x39d8be)['digest'](_0x5d202e(0x125));}export async function computeFileHash(_0x4bd363){const _0x4e5b6e=a211_0x1dc8,_0x3b4943=await readFile(_0x4bd363,_0x4e5b6e(0x127));return computeContentHash(_0x3b4943);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a212_0x4172(){const _0x2ac953=['current\x20\x22','27670xZattD','1775zAxKcv','code','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','1514rMdjzQ','functions','2610650gecNyJ','393252lgaZsd','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','object','\x22.\x20','3285ktqVej','stringify','1507776pvfhJq','apps','lastSync','1240ATCWpI','parse','1412280jphOSw','scriptsRoot','1194YuiXvu','utf8','\x22\x20vs\x20lock\x20\x22'];a212_0x4172=function(){return _0x2ac953;};return a212_0x4172();}(function(_0x31d80a,_0x567171){const _0x4e36ca=a212_0x5ce4,_0x5bbb8d=_0x31d80a();while(!![]){try{const _0x2e7d0a=-parseInt(_0x4e36ca(0x1e9))/0x1+-parseInt(_0x4e36ca(0x1e6))/0x2*(-parseInt(_0x4e36ca(0x1de))/0x3)+parseInt(_0x4e36ca(0x1da))/0x4*(parseInt(_0x4e36ca(0x1e3))/0x5)+-parseInt(_0x4e36ca(0x1dc))/0x6+-parseInt(_0x4e36ca(0x1e8))/0x7+-parseInt(_0x4e36ca(0x1d7))/0x8+-parseInt(_0x4e36ca(0x1d5))/0x9*(-parseInt(_0x4e36ca(0x1e2))/0xa);if(_0x2e7d0a===_0x567171)break;else _0x5bbb8d['push'](_0x5bbb8d['shift']());}catch(_0x24686d){_0x5bbb8d['push'](_0x5bbb8d['shift']());}}}(a212_0x4172,0x38745));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x41b52c,_0x5922bb,_0x386ec6,_0x2e6a3c){const _0x58928a=a212_0x5ce4,_0x1426d7={'apps':_0x41b52c[_0x58928a(0x1d8)]&&typeof _0x41b52c['apps']===_0x58928a(0x1d3)?_0x41b52c[_0x58928a(0x1d8)]:{}};let _0x2459a0=_0x1426d7['apps'][_0x5922bb];if(!_0x2459a0)return _0x2459a0={'scriptsRoot':_0x386ec6,'lastSync':'','functions':{}},_0x1426d7[_0x58928a(0x1d8)][_0x5922bb]=_0x2459a0,{'lockData':_0x1426d7,'appLock':_0x2459a0};if(!_0x2459a0[_0x58928a(0x1dd)])_0x2459a0[_0x58928a(0x1dd)]=_0x386ec6;else{if(_0x2459a0[_0x58928a(0x1dd)]!==_0x386ec6)throw new Error(_0x2e6a3c+':\x20scriptsRoot\x20mismatch\x20—\x20'+(_0x58928a(0x1e1)+_0x386ec6+_0x58928a(0x1e0)+_0x2459a0[_0x58928a(0x1dd)]+_0x58928a(0x1d4))+_0x58928a(0x1d2));}return!_0x2459a0['functions']&&(_0x2459a0[_0x58928a(0x1e7)]={}),!_0x2459a0[_0x58928a(0x1d9)]&&(_0x2459a0[_0x58928a(0x1d9)]=''),{'lockData':_0x1426d7,'appLock':_0x2459a0};}export async function readBffLockFile(_0x3de2cc){const _0x352f7b=a212_0x5ce4;try{const _0x11ab39=await readFile(_0x3de2cc,_0x352f7b(0x1df)),_0x1f3f2a=JSON[_0x352f7b(0x1db)](_0x11ab39);return{'apps':_0x1f3f2a[_0x352f7b(0x1d8)]&&typeof _0x1f3f2a['apps']===_0x352f7b(0x1d3)?_0x1f3f2a[_0x352f7b(0x1d8)]:{}};}catch(_0x13e595){if(_0x13e595[_0x352f7b(0x1e4)]==='ENOENT')return null;throw new Error(_0x352f7b(0x1e5)+String(_0x13e595));}}function a212_0x5ce4(_0x527033,_0x4c5d54){_0x527033=_0x527033-0x1d2;const _0x4172bb=a212_0x4172();let _0x5ce42b=_0x4172bb[_0x527033];return _0x5ce42b;}export async function writeBffLockFile(_0x779a34,_0x1132f6){const _0xcdb50f=a212_0x5ce4;await mkdir(dirname(_0x779a34),{'recursive':!![]}),await writeFile(_0x779a34,JSON[_0xcdb50f(0x1d6)](_0x1132f6,null,0x2),'utf8');}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1480b1,_0x53f904){const _0x218782=a214_0x1bb4,_0xd75867=_0x1480b1();while(!![]){try{const _0x341807=-parseInt(_0x218782(0x150))/0x1+parseInt(_0x218782(0x141))/0x2+parseInt(_0x218782(0x147))/0x3+parseInt(_0x218782(0x151))/0x4+parseInt(_0x218782(0x14d))/0x5*(-parseInt(_0x218782(0x143))/0x6)+-parseInt(_0x218782(0x154))/0x7*(parseInt(_0x218782(0x149))/0x8)+parseInt(_0x218782(0x14e))/0x9;if(_0x341807===_0x53f904)break;else _0xd75867['push'](_0xd75867['shift']());}catch(_0xef7863){_0xd75867['push'](_0xd75867['shift']());}}}(a214_0x2817,0x52da5));export function snakeToCamel(_0x1c78ef){const _0x1591d7=a214_0x1bb4;return _0x1c78ef[_0x1591d7(0x146)]()[_0x1591d7(0x14a)](/_([a-z])/g,(_0x15a832,_0x40c725)=>_0x40c725[_0x1591d7(0x153)]());}function a214_0x2817(){const _0x1734e2=['toUpperCase','7fSPIoQ','match','314978nqpJOx','datasetCode','6bAbsKv','after','test','toLowerCase','330663ZXxTZI','functionNode','2448568dBRbJn','replace','operationType','values','1731985rtkyaX','3277935XiunZf','before','271693EQirLp','2526404axzZRd','trim'];a214_0x2817=function(){return _0x1734e2;};return a214_0x2817();}export function findHookLocationByRemoteId(_0x36ab8f,_0x1a4010){const _0x1069b9=a214_0x1bb4;if(!_0x1a4010)return undefined;for(const _0x5a2e71 of Object[_0x1069b9(0x14c)](_0x36ab8f)){if(_0x5a2e71['remoteId']===_0x1a4010&&_0x5a2e71[_0x1069b9(0x142)]&&_0x5a2e71[_0x1069b9(0x14b)]&&_0x5a2e71[_0x1069b9(0x148)])return{'datasetCode':_0x5a2e71['datasetCode'],'operationType':_0x5a2e71[_0x1069b9(0x14b)],'functionNode':_0x5a2e71[_0x1069b9(0x148)]};}return undefined;}export function extractScriptDescription(_0x18706a){const _0x5eb88b=a214_0x1bb4,_0x43cf4a=_0x18706a[_0x5eb88b(0x140)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x43cf4a?.[0x1]?.[_0x5eb88b(0x152)]()||undefined;}export function isValidBffFunctionName(_0x44ceed){const _0x14cbcb=a214_0x1bb4;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x14cbcb(0x145)](_0x44ceed);}function a214_0x1bb4(_0x22316e,_0x346827){_0x22316e=_0x22316e-0x140;const _0x28175d=a214_0x2817();let _0x1bb406=_0x28175d[_0x22316e];return _0x1bb406;}export function normalizeHookFunctionNode(_0x1594cf){const _0x34fe0c=a214_0x1bb4;if(!_0x1594cf)return undefined;const _0x2996c5=_0x1594cf[_0x34fe0c(0x152)]()[_0x34fe0c(0x146)]();if(_0x2996c5===_0x34fe0c(0x14f)||_0x2996c5===_0x34fe0c(0x144))return _0x2996c5;return undefined;}
|