@lovrabet/rabetbase-cli 2.3.13-beta.1 → 2.3.13-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/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/logs/index.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/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/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/menu/update.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/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/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/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 a194_0x34b897=a194_0x2e7b;(function(_0x5504a3,_0x4655fd){const _0x301249=a194_0x2e7b,_0x54d433=_0x5504a3();while(!![]){try{const _0x2fb628=parseInt(_0x301249(0x1f1))/0x1+parseInt(_0x301249(0x1e4))/0x2*(parseInt(_0x301249(0x1cf))/0x3)+parseInt(_0x301249(0x1c8))/0x4+-parseInt(_0x301249(0x1e2))/0x5*(-parseInt(_0x301249(0x1d6))/0x6)+parseInt(_0x301249(0x1f3))/0x7*(parseInt(_0x301249(0x1c5))/0x8)+-parseInt(_0x301249(0x1f2))/0x9*(-parseInt(_0x301249(0x1e8))/0xa)+-parseInt(_0x301249(0x1e7))/0xb;if(_0x2fb628===_0x4655fd)break;else _0x54d433['push'](_0x54d433['shift']());}catch(_0x30bc35){_0x54d433['push'](_0x54d433['shift']());}}}(a194_0x2fff,0x57fc6));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{dirname,parse,resolve}from'node:path';import{homedir}from'node:os';import{CLI_BIN_NAME}from'../constant/cli.js';export const NEW_CONFIG_NAME=a194_0x34b897(0x1c4);export const CONFIG_NAMES=[a194_0x34b897(0x1c4),a194_0x34b897(0x1e0),a194_0x34b897(0x1ea)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a194_0x34b897(0x1da)](_0x23ffc8=>_0x23ffc8!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();function a194_0x2fff(){const _0x5a80f5=['set','filter','\x0a\x20\x20','length','.tmp','defaultApp','silent','.lovrabet.json','stringify','845885LJgkhw','utf8','2AxXZfc','Project','cookie','19243070alcNPT','7910XXbJwF','cwd','.lovrabetrc','object','warn','apiDir','appcode','missing','migrated','358788tsbhrc','6246jxAxle','21826NjZXyx','error','locale','inherit','.rabetbase.json','144BybzBD','parse','status','2418080WZxvqh','config','pageSize','format','apps','riskLevel','trim','1116591kZnyCR','data','app','message','env','Global','keys','6agXJuF','empty','accessKey'];a194_0x2fff=function(){return _0x5a80f5;};return a194_0x2fff();}export function resolveConfigPath(_0x6f6c16){for(const _0xd75d20 of CONFIG_NAMES){const _0x299579=resolve(_0x6f6c16,_0xd75d20);if(existsSync(_0x299579))return _0x299579;}return undefined;}export function findProjectRootDirectory(_0x5cfd80=process['cwd']()){let _0x366f46=resolve(_0x5cfd80);const {root:_0x31d3f6}=parse(_0x366f46),_0x2e6d71=homedir();while(!![]){if(resolveConfigPath(_0x366f46)){if(_0x366f46===_0x2e6d71)break;return _0x366f46;}if(_0x366f46===_0x31d3f6||_0x366f46===_0x2e6d71)break;const _0x97f985=dirname(_0x366f46);if(_0x97f985===_0x366f46)break;_0x366f46=_0x97f985;}return resolve(_0x5cfd80);}export function getProjectConfigPath(){const _0x2cbfc3=a194_0x34b897;return resolveConfigPath(process[_0x2cbfc3(0x1e9)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x4e18f1){const _0x4048e9=a194_0x34b897;if(!existsSync(_0x4e18f1))return{'status':_0x4048e9(0x1ef)};try{const _0x3e5410=readFileSync(_0x4e18f1,{'encoding':_0x4048e9(0x1e3)});if(!_0x3e5410?.['trim']())return{'status':_0x4048e9(0x1d7)};const _0x216d31=JSON[_0x4048e9(0x1c6)](_0x3e5410);return{'status':'ok','data':_0x216d31};}catch(_0xcd755e){return{'status':_0x4048e9(0x1f4),'message':_0xcd755e instanceof Error?_0xcd755e[_0x4048e9(0x1d2)]:String(_0xcd755e)};}}function parseCliConfigJsonFile(_0x43e685,_0x28a2bc,_0x5f563f){const _0x1e3455=a194_0x34b897,_0x2b0981=inspectCliConfigJsonFile(_0x43e685);if(_0x2b0981[_0x1e3455(0x1c7)]===_0x1e3455(0x1ef)||_0x2b0981[_0x1e3455(0x1c7)]===_0x1e3455(0x1d7))return{};if(_0x2b0981['status']==='ok')return _0x2b0981[_0x1e3455(0x1d0)];return _0x28a2bc===_0x1e3455(0x1ec)&&_0x5f563f&&console[_0x1e3455(0x1f4)](CLI_BIN_NAME+':\x20'+_0x5f563f+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0x43e685+_0x1e3455(0x1db)+_0x2b0981[_0x1e3455(0x1d2)]),{};}function normalizeLegacyConfigShape(_0x46b786){const _0x2b46aa=a194_0x34b897;if(!_0x46b786||typeof _0x46b786!==_0x2b46aa(0x1eb))return{'config':{},'migrated':![]};const _0x45201e={..._0x46b786},_0x3ae284=_0x45201e[_0x2b46aa(0x1cc)]&&typeof _0x45201e[_0x2b46aa(0x1cc)]===_0x2b46aa(0x1eb)?{..._0x45201e[_0x2b46aa(0x1cc)]}:{},_0x3e53aa=Object[_0x2b46aa(0x1d5)](_0x3ae284)[_0x2b46aa(0x1dc)],_0xaadc0d=_0x45201e[_0x2b46aa(0x1ee)]||_0x45201e['app'];let _0x3268be=![];if(_0xaadc0d&&_0x3e53aa===0x0){const _0xf56999=typeof _0x45201e[_0x2b46aa(0x1de)]==='string'&&_0x45201e[_0x2b46aa(0x1de)][_0x2b46aa(0x1ce)]()?_0x45201e[_0x2b46aa(0x1de)]:String(_0xaadc0d)[_0x2b46aa(0x1ce)]();_0x3ae284[_0xf56999]={'appcode':String(_0xaadc0d)[_0x2b46aa(0x1ce)](),..._0x45201e['env']!=null?{'env':_0x45201e[_0x2b46aa(0x1d3)]}:{},..._0x45201e[_0x2b46aa(0x1ed)]!=null?{'apiDir':_0x45201e[_0x2b46aa(0x1ed)]}:{},..._0x45201e[_0x2b46aa(0x1e6)]!=null?{'cookie':_0x45201e[_0x2b46aa(0x1e6)]}:{},..._0x45201e[_0x2b46aa(0x1d8)]!=null?{'accessKey':_0x45201e[_0x2b46aa(0x1d8)]}:{},..._0x45201e[_0x2b46aa(0x1cb)]!=null?{'format':_0x45201e[_0x2b46aa(0x1cb)]}:{},..._0x45201e['pageSize']!=null?{'pageSize':_0x45201e[_0x2b46aa(0x1ca)]}:{},..._0x45201e['riskLevel']!=null?{'riskLevel':_0x45201e[_0x2b46aa(0x1cd)]}:{},..._0x45201e['locale']!=null?{'locale':_0x45201e[_0x2b46aa(0x1c2)]}:{}},_0x45201e[_0x2b46aa(0x1cc)]=_0x3ae284;if(!_0x45201e[_0x2b46aa(0x1de)])_0x45201e[_0x2b46aa(0x1de)]=_0xf56999;_0x3268be=!![];}return(_0x2b46aa(0x1ee)in _0x45201e||_0x2b46aa(0x1d1)in _0x45201e)&&(delete _0x45201e['appcode'],delete _0x45201e[_0x2b46aa(0x1d1)],_0x3268be=!![]),{'config':_0x45201e,'migrated':_0x3268be};}function writeNormalizedConfigIfNeeded(_0x2803cf,_0x2c0bcd){const _0x3dfeb5=a194_0x34b897,_0x456c4e=JSON['stringify'](_0x2c0bcd,null,0x2)+'\x0a';if(normalizedWriteCache['get'](_0x2803cf)===_0x456c4e)return;writeConfigFile(_0x2803cf,_0x2c0bcd),normalizedWriteCache[_0x3dfeb5(0x1d9)](_0x2803cf,_0x456c4e);}function parseAndNormalizeConfig(_0x5722f0,_0x280507,_0x404a38){const _0x509f9c=a194_0x34b897,_0x550ae6=parseCliConfigJsonFile(_0x5722f0,_0x280507,_0x404a38),_0x9967d5=normalizeLegacyConfigShape(_0x550ae6);if(_0x9967d5[_0x509f9c(0x1f0)])try{writeNormalizedConfigIfNeeded(_0x5722f0,_0x9967d5[_0x509f9c(0x1c9)]);}catch{}return _0x9967d5[_0x509f9c(0x1c9)];}export function loadRawConfigLayers(_0x1d9642){const _0x335f57=a194_0x34b897;let _0x32ee76={},_0x525955={};const _0x25fa71=resolveConfigPath(homedir());_0x25fa71&&(_0x32ee76=parseAndNormalizeConfig(_0x25fa71,'warn',_0x335f57(0x1d4)));const _0x5353fa=_0x1d9642??findProjectRootDirectory(),_0x51a820=resolveConfigPath(_0x5353fa);return _0x51a820&&(_0x525955=parseAndNormalizeConfig(_0x51a820,_0x335f57(0x1ec),_0x335f57(0x1e5))),{'globalPath':_0x25fa71,'projectPath':_0x51a820,'globalConfig':_0x32ee76,'projectConfig':_0x525955};}const INHERIT_WHITELIST=[a194_0x34b897(0x1e6),a194_0x34b897(0x1d8),'locale',a194_0x34b897(0x1cb),a194_0x34b897(0x1cd),a194_0x34b897(0x1ca)];export function mergeRawConfigLayers(_0x4a6b4c){const _0x16b63a=a194_0x34b897,{globalConfig:_0x2b233a,projectConfig:_0x45502c}=_0x4a6b4c,_0x5e2628=Object['keys'](_0x45502c)['length']>0x0;if(!_0x5e2628)return mergeGlobalOnly(_0x2b233a);if(_0x45502c[_0x16b63a(0x1c3)]===!![])return mergeFullInherit(_0x2b233a,_0x45502c);if(_0x45502c['inherit']===![])return mergeIsolated(_0x45502c);return mergeProjectFirst(_0x2b233a,_0x45502c);}function mergeGlobalOnly(_0x2e1fed){const _0x97128b=a194_0x34b897,_0x45849c={..._0x2e1fed},_0x39e6e0=_0x2e1fed[_0x97128b(0x1cc)]&&typeof _0x2e1fed[_0x97128b(0x1cc)]===_0x97128b(0x1eb)?_0x2e1fed[_0x97128b(0x1cc)]:{};if(Object[_0x97128b(0x1d5)](_0x39e6e0)['length']>0x0)_0x45849c[_0x97128b(0x1cc)]=_0x39e6e0;if(_0x2e1fed[_0x97128b(0x1de)])_0x45849c[_0x97128b(0x1de)]=_0x2e1fed[_0x97128b(0x1de)];else{const _0x56135a=Object[_0x97128b(0x1d5)](_0x39e6e0);if(_0x56135a[_0x97128b(0x1dc)]>0x0)_0x45849c['defaultApp']=_0x56135a[0x0];}return _0x45849c;}function mergeIsolated(_0xebe0a4){const _0x1da007=a194_0x34b897,_0x5713a4={..._0xebe0a4};delete _0x5713a4[_0x1da007(0x1c3)];const _0x4dbc92=_0xebe0a4[_0x1da007(0x1cc)]&&typeof _0xebe0a4['apps']===_0x1da007(0x1eb)?_0xebe0a4[_0x1da007(0x1cc)]:{};Object[_0x1da007(0x1d5)](_0x4dbc92)[_0x1da007(0x1dc)]>0x0?_0x5713a4['apps']=_0x4dbc92:delete _0x5713a4[_0x1da007(0x1cc)];if(_0x1da007(0x1de)in _0xebe0a4)_0x5713a4[_0x1da007(0x1de)]=_0xebe0a4[_0x1da007(0x1de)];else Object[_0x1da007(0x1d5)](_0x4dbc92)['length']>0x0?_0x5713a4['defaultApp']=Object[_0x1da007(0x1d5)](_0x4dbc92)[0x0]:delete _0x5713a4[_0x1da007(0x1de)];return _0x5713a4;}function mergeProjectFirst(_0xf418ca,_0x1a11c7){const _0x2bf83a=a194_0x34b897,_0x3df180={..._0x1a11c7};delete _0x3df180[_0x2bf83a(0x1c3)];for(const _0x401dc1 of INHERIT_WHITELIST){!(_0x401dc1 in _0x3df180)&&_0x401dc1 in _0xf418ca&&(_0x3df180[_0x401dc1]=_0xf418ca[_0x401dc1]);}const _0x422163=_0x1a11c7[_0x2bf83a(0x1cc)]&&typeof _0x1a11c7[_0x2bf83a(0x1cc)]===_0x2bf83a(0x1eb)?_0x1a11c7[_0x2bf83a(0x1cc)]:{};Object[_0x2bf83a(0x1d5)](_0x422163)['length']>0x0?_0x3df180[_0x2bf83a(0x1cc)]=_0x422163:delete _0x3df180[_0x2bf83a(0x1cc)];if(_0x2bf83a(0x1de)in _0x1a11c7)_0x3df180[_0x2bf83a(0x1de)]=_0x1a11c7['defaultApp'];else Object[_0x2bf83a(0x1d5)](_0x422163)[_0x2bf83a(0x1dc)]>0x0?_0x3df180[_0x2bf83a(0x1de)]=Object[_0x2bf83a(0x1d5)](_0x422163)[0x0]:delete _0x3df180[_0x2bf83a(0x1de)];return _0x3df180;}function mergeFullInherit(_0x11fa47,_0xeb7aaf){const _0x41d3be=a194_0x34b897,_0x1a95b7=_0x11fa47['apps']&&typeof _0x11fa47['apps']===_0x41d3be(0x1eb)?_0x11fa47[_0x41d3be(0x1cc)]:{},_0x2a17ae=_0xeb7aaf[_0x41d3be(0x1cc)]&&typeof _0xeb7aaf[_0x41d3be(0x1cc)]===_0x41d3be(0x1eb)?_0xeb7aaf[_0x41d3be(0x1cc)]:{},_0x2942a3={..._0x1a95b7,..._0x2a17ae},_0x57c17e={..._0x11fa47,..._0xeb7aaf};delete _0x57c17e[_0x41d3be(0x1c3)];if(Object[_0x41d3be(0x1d5)](_0x2942a3)[_0x41d3be(0x1dc)]>0x0)_0x57c17e[_0x41d3be(0x1cc)]=_0x2942a3;if(_0x41d3be(0x1de)in _0xeb7aaf)_0x57c17e[_0x41d3be(0x1de)]=_0xeb7aaf[_0x41d3be(0x1de)];else{if(Object[_0x41d3be(0x1d5)](_0x2a17ae)[_0x41d3be(0x1dc)]>0x0)_0x57c17e['defaultApp']=Object[_0x41d3be(0x1d5)](_0x2a17ae)[0x0];else{if(_0x11fa47[_0x41d3be(0x1de)])_0x57c17e['defaultApp']=_0x11fa47['defaultApp'];else{const _0x3181c2=Object[_0x41d3be(0x1d5)](_0x1a95b7);if(_0x3181c2[_0x41d3be(0x1dc)]>0x0)_0x57c17e[_0x41d3be(0x1de)]=_0x3181c2[0x0];}}}return _0x57c17e;}function a194_0x2e7b(_0x33bb41,_0x18def0){_0x33bb41=_0x33bb41-0x1c2;const _0x2fff5c=a194_0x2fff();let _0x2e7b21=_0x2fff5c[_0x33bb41];return _0x2e7b21;}export function readRawConfigWithLayers(_0x233313){const _0x46d5d3=loadRawConfigLayers(_0x233313);return{'config':mergeRawConfigLayers(_0x46d5d3),'layers':_0x46d5d3};}export function readRawConfig(_0x10515b){return mergeRawConfigLayers(loadRawConfigLayers(_0x10515b));}export function readConfigFile(_0x182db3){const _0x16c8f3=a194_0x34b897;return parseAndNormalizeConfig(_0x182db3,_0x16c8f3(0x1df));}export function writeConfigFile(_0x461fd6,_0x3930e7){const _0x3e8f9b=a194_0x34b897,_0x180931=dirname(_0x461fd6);!existsSync(_0x180931)&&mkdirSync(_0x180931,{'recursive':!![]});const _0x3b6156=_0x461fd6+_0x3e8f9b(0x1dd);try{writeFileSync(_0x3b6156,JSON[_0x3e8f9b(0x1e1)](_0x3930e7,null,0x2)+'\x0a',{'encoding':_0x3e8f9b(0x1e3),'mode':0x180}),renameSync(_0x3b6156,_0x461fd6);}catch(_0x2ab5a9){try{unlinkSync(_0x3b6156);}catch{}throw _0x2ab5a9;}}export function resolveWriteConfigPath(_0x1d5f8a){const _0x766d9a=a194_0x34b897,_0x2998c6=_0x1d5f8a==='project'?process[_0x766d9a(0x1e9)]():homedir(),_0x34e766=resolveConfigPath(_0x2998c6);return _0x34e766??resolve(_0x2998c6,NEW_CONFIG_NAME);}
|
|
1
|
+
const a194_0x863e2=a194_0x1ebb;(function(_0x400e44,_0xfa06e9){const _0x3cdd88=a194_0x1ebb,_0x2aa892=_0x400e44();while(!![]){try{const _0xcc2f12=-parseInt(_0x3cdd88(0x89))/0x1*(-parseInt(_0x3cdd88(0x8c))/0x2)+parseInt(_0x3cdd88(0x8f))/0x3*(parseInt(_0x3cdd88(0x85))/0x4)+parseInt(_0x3cdd88(0x94))/0x5*(parseInt(_0x3cdd88(0x84))/0x6)+parseInt(_0x3cdd88(0x7c))/0x7+parseInt(_0x3cdd88(0x83))/0x8+parseInt(_0x3cdd88(0x7e))/0x9*(parseInt(_0x3cdd88(0x9a))/0xa)+-parseInt(_0x3cdd88(0x97))/0xb;if(_0xcc2f12===_0xfa06e9)break;else _0x2aa892['push'](_0x2aa892['shift']());}catch(_0x29abe0){_0x2aa892['push'](_0x2aa892['shift']());}}}(a194_0x49d8,0xdd99c));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{dirname,parse,resolve}from'node:path';import{homedir}from'node:os';import{CLI_BIN_NAME}from'../constant/cli.js';export const NEW_CONFIG_NAME=a194_0x863e2(0x79);export const CONFIG_NAMES=[a194_0x863e2(0x79),a194_0x863e2(0xa1),'.lovrabetrc'];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a194_0x863e2(0x81)](_0x28557f=>_0x28557f!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x1e5551){for(const _0x47d8a5 of CONFIG_NAMES){const _0x48de88=resolve(_0x1e5551,_0x47d8a5);if(existsSync(_0x48de88))return _0x48de88;}return undefined;}export function findProjectRootDirectory(_0x3f008c=process[a194_0x863e2(0x87)]()){let _0x22f7df=resolve(_0x3f008c);const {root:_0x451542}=parse(_0x22f7df),_0x59bdc1=homedir();while(!![]){if(resolveConfigPath(_0x22f7df)){if(_0x22f7df===_0x59bdc1)break;return _0x22f7df;}if(_0x22f7df===_0x451542||_0x22f7df===_0x59bdc1)break;const _0x519aa2=dirname(_0x22f7df);if(_0x519aa2===_0x22f7df)break;_0x22f7df=_0x519aa2;}return resolve(_0x3f008c);}export function getProjectConfigPath(){const _0x346e83=a194_0x863e2;return resolveConfigPath(process[_0x346e83(0x87)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x3ebf21){const _0x5414a3=a194_0x863e2;if(!existsSync(_0x3ebf21))return{'status':_0x5414a3(0x9d)};try{const _0x1953c5=readFileSync(_0x3ebf21,{'encoding':_0x5414a3(0x92)});if(!_0x1953c5?.['trim']())return{'status':_0x5414a3(0x88)};const _0x2573bc=JSON[_0x5414a3(0xa0)](_0x1953c5);return{'status':'ok','data':_0x2573bc};}catch(_0x4fe2f1){return{'status':'error','message':_0x4fe2f1 instanceof Error?_0x4fe2f1[_0x5414a3(0x7f)]:String(_0x4fe2f1)};}}function parseCliConfigJsonFile(_0x1a33e7,_0x3474f9,_0x476288){const _0x490eef=a194_0x863e2,_0x4af66e=inspectCliConfigJsonFile(_0x1a33e7);if(_0x4af66e['status']===_0x490eef(0x9d)||_0x4af66e[_0x490eef(0xa4)]===_0x490eef(0x88))return{};if(_0x4af66e[_0x490eef(0xa4)]==='ok')return _0x4af66e['data'];return _0x3474f9===_0x490eef(0xa3)&&_0x476288&&console[_0x490eef(0x8d)](CLI_BIN_NAME+':\x20'+_0x476288+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0x1a33e7+_0x490eef(0x9b)+_0x4af66e[_0x490eef(0x7f)]),{};}function normalizeLegacyConfigShape(_0x98fa37){const _0x4171f3=a194_0x863e2;if(!_0x98fa37||typeof _0x98fa37!==_0x4171f3(0xa6))return{'config':{},'migrated':![]};const _0x6757c0={..._0x98fa37},_0x590ed0=_0x6757c0[_0x4171f3(0x7b)]&&typeof _0x6757c0['apps']==='object'?{..._0x6757c0[_0x4171f3(0x7b)]}:{},_0x300c3f=Object[_0x4171f3(0x82)](_0x590ed0)['length'],_0x2fe86d=_0x6757c0[_0x4171f3(0x95)]||_0x6757c0[_0x4171f3(0x98)];let _0x3c2454=![];if(_0x2fe86d&&_0x300c3f===0x0){const _0x3d5cd3=typeof _0x6757c0[_0x4171f3(0x9c)]==='string'&&_0x6757c0['defaultApp'][_0x4171f3(0x7d)]()?_0x6757c0[_0x4171f3(0x9c)]:String(_0x2fe86d)[_0x4171f3(0x7d)]();_0x590ed0[_0x3d5cd3]={'appcode':String(_0x2fe86d)[_0x4171f3(0x7d)](),..._0x6757c0[_0x4171f3(0x99)]!=null?{'env':_0x6757c0['env']}:{},..._0x6757c0[_0x4171f3(0x80)]!=null?{'apiDir':_0x6757c0[_0x4171f3(0x80)]}:{},..._0x6757c0[_0x4171f3(0x96)]!=null?{'cookie':_0x6757c0[_0x4171f3(0x96)]}:{},..._0x6757c0[_0x4171f3(0x91)]!=null?{'accessKey':_0x6757c0[_0x4171f3(0x91)]}:{},..._0x6757c0[_0x4171f3(0xa8)]!=null?{'format':_0x6757c0[_0x4171f3(0xa8)]}:{},..._0x6757c0[_0x4171f3(0xa2)]!=null?{'pageSize':_0x6757c0['pageSize']}:{},..._0x6757c0[_0x4171f3(0xaa)]!=null?{'riskLevel':_0x6757c0['riskLevel']}:{},..._0x6757c0[_0x4171f3(0x8a)]!=null?{'locale':_0x6757c0[_0x4171f3(0x8a)]}:{}},_0x6757c0['apps']=_0x590ed0;if(!_0x6757c0[_0x4171f3(0x9c)])_0x6757c0[_0x4171f3(0x9c)]=_0x3d5cd3;_0x3c2454=!![];}return(_0x4171f3(0x95)in _0x6757c0||_0x4171f3(0x98)in _0x6757c0)&&(delete _0x6757c0[_0x4171f3(0x95)],delete _0x6757c0['app'],_0x3c2454=!![]),{'config':_0x6757c0,'migrated':_0x3c2454};}function writeNormalizedConfigIfNeeded(_0x29ba21,_0x214556){const _0x59205b=a194_0x863e2,_0x4cd93f=JSON[_0x59205b(0x9e)](_0x214556,null,0x2)+'\x0a';if(normalizedWriteCache[_0x59205b(0x9f)](_0x29ba21)===_0x4cd93f)return;writeConfigFile(_0x29ba21,_0x214556),normalizedWriteCache[_0x59205b(0x8e)](_0x29ba21,_0x4cd93f);}function parseAndNormalizeConfig(_0x11b4ae,_0x52d796,_0x99c051){const _0x3641cd=a194_0x863e2,_0x195fe8=parseCliConfigJsonFile(_0x11b4ae,_0x52d796,_0x99c051),_0x316077=normalizeLegacyConfigShape(_0x195fe8);if(_0x316077[_0x3641cd(0x86)])try{writeNormalizedConfigIfNeeded(_0x11b4ae,_0x316077['config']);}catch{}return _0x316077[_0x3641cd(0x90)];}export function loadRawConfigLayers(_0x218191){const _0x58c30f=a194_0x863e2;let _0x41eeb5={},_0xc2edce={};const _0x1ba7a9=resolveConfigPath(homedir());_0x1ba7a9&&(_0x41eeb5=parseAndNormalizeConfig(_0x1ba7a9,_0x58c30f(0xa3),_0x58c30f(0x93)));const _0x5c2444=_0x218191??findProjectRootDirectory(),_0x437d41=resolveConfigPath(_0x5c2444);return _0x437d41&&(_0xc2edce=parseAndNormalizeConfig(_0x437d41,_0x58c30f(0xa3),_0x58c30f(0xa9))),{'globalPath':_0x1ba7a9,'projectPath':_0x437d41,'globalConfig':_0x41eeb5,'projectConfig':_0xc2edce};}const INHERIT_WHITELIST=[a194_0x863e2(0x96),a194_0x863e2(0x91),a194_0x863e2(0x8a),a194_0x863e2(0xa8),'riskLevel',a194_0x863e2(0xa2)];export function mergeRawConfigLayers(_0x5034c5){const _0x16a375=a194_0x863e2,{globalConfig:_0x120e4c,projectConfig:_0x25f483}=_0x5034c5,_0x34e7a3=Object[_0x16a375(0x82)](_0x25f483)[_0x16a375(0xa5)]>0x0;if(!_0x34e7a3)return mergeGlobalOnly(_0x120e4c);if(_0x25f483[_0x16a375(0x7a)]===!![])return mergeFullInherit(_0x120e4c,_0x25f483);if(_0x25f483['inherit']===![])return mergeIsolated(_0x25f483);return mergeProjectFirst(_0x120e4c,_0x25f483);}function mergeGlobalOnly(_0x29383f){const _0x4437c6=a194_0x863e2,_0x3f3697={..._0x29383f},_0x39d47b=_0x29383f['apps']&&typeof _0x29383f['apps']===_0x4437c6(0xa6)?_0x29383f['apps']:{};if(Object[_0x4437c6(0x82)](_0x39d47b)[_0x4437c6(0xa5)]>0x0)_0x3f3697[_0x4437c6(0x7b)]=_0x39d47b;if(_0x29383f['defaultApp'])_0x3f3697[_0x4437c6(0x9c)]=_0x29383f[_0x4437c6(0x9c)];else{const _0x171752=Object['keys'](_0x39d47b);if(_0x171752[_0x4437c6(0xa5)]>0x0)_0x3f3697[_0x4437c6(0x9c)]=_0x171752[0x0];}return _0x3f3697;}function mergeIsolated(_0x111e0a){const _0xa9e4ae=a194_0x863e2,_0x3514a5={..._0x111e0a};delete _0x3514a5[_0xa9e4ae(0x7a)];const _0x135a07=_0x111e0a[_0xa9e4ae(0x7b)]&&typeof _0x111e0a['apps']===_0xa9e4ae(0xa6)?_0x111e0a[_0xa9e4ae(0x7b)]:{};Object[_0xa9e4ae(0x82)](_0x135a07)[_0xa9e4ae(0xa5)]>0x0?_0x3514a5[_0xa9e4ae(0x7b)]=_0x135a07:delete _0x3514a5[_0xa9e4ae(0x7b)];if(_0xa9e4ae(0x9c)in _0x111e0a)_0x3514a5[_0xa9e4ae(0x9c)]=_0x111e0a[_0xa9e4ae(0x9c)];else Object[_0xa9e4ae(0x82)](_0x135a07)[_0xa9e4ae(0xa5)]>0x0?_0x3514a5['defaultApp']=Object[_0xa9e4ae(0x82)](_0x135a07)[0x0]:delete _0x3514a5['defaultApp'];return _0x3514a5;}function a194_0x1ebb(_0x589df8,_0x3613f9){_0x589df8=_0x589df8-0x79;const _0x49d8e2=a194_0x49d8();let _0x1ebb01=_0x49d8e2[_0x589df8];return _0x1ebb01;}function a194_0x49d8(){const _0x20937=['trim','46647gNbRtc','message','apiDir','filter','keys','7174872yFNmzw','4164ZGtJds','628fdAtzI','migrated','cwd','empty','1021569ADpZdC','locale','project','2VBNvqP','error','set','11670iqAJux','config','accessKey','utf8','Global','1485XXzIef','appcode','cookie','45384350GlnXkb','app','env','2410lniDgb','\x0a\x20\x20','defaultApp','missing','stringify','get','parse','.lovrabet.json','pageSize','warn','status','length','object','.tmp','format','Project','riskLevel','.rabetbase.json','inherit','apps','7344029fcSqRX'];a194_0x49d8=function(){return _0x20937;};return a194_0x49d8();}function mergeProjectFirst(_0x26ab78,_0x23db2a){const _0x4cf385=a194_0x863e2,_0x513c39={..._0x23db2a};delete _0x513c39[_0x4cf385(0x7a)];for(const _0x44b8c5 of INHERIT_WHITELIST){!(_0x44b8c5 in _0x513c39)&&_0x44b8c5 in _0x26ab78&&(_0x513c39[_0x44b8c5]=_0x26ab78[_0x44b8c5]);}const _0x136bdb=_0x23db2a[_0x4cf385(0x7b)]&&typeof _0x23db2a[_0x4cf385(0x7b)]===_0x4cf385(0xa6)?_0x23db2a[_0x4cf385(0x7b)]:{};Object[_0x4cf385(0x82)](_0x136bdb)[_0x4cf385(0xa5)]>0x0?_0x513c39[_0x4cf385(0x7b)]=_0x136bdb:delete _0x513c39['apps'];if(_0x4cf385(0x9c)in _0x23db2a)_0x513c39[_0x4cf385(0x9c)]=_0x23db2a['defaultApp'];else Object[_0x4cf385(0x82)](_0x136bdb)[_0x4cf385(0xa5)]>0x0?_0x513c39[_0x4cf385(0x9c)]=Object['keys'](_0x136bdb)[0x0]:delete _0x513c39[_0x4cf385(0x9c)];return _0x513c39;}function mergeFullInherit(_0x1852e3,_0x208658){const _0x52fc1e=a194_0x863e2,_0xdbebd7=_0x1852e3['apps']&&typeof _0x1852e3['apps']===_0x52fc1e(0xa6)?_0x1852e3[_0x52fc1e(0x7b)]:{},_0x3af840=_0x208658[_0x52fc1e(0x7b)]&&typeof _0x208658[_0x52fc1e(0x7b)]===_0x52fc1e(0xa6)?_0x208658['apps']:{},_0x2f0856={..._0xdbebd7,..._0x3af840},_0x3be3e2={..._0x1852e3,..._0x208658};delete _0x3be3e2[_0x52fc1e(0x7a)];if(Object[_0x52fc1e(0x82)](_0x2f0856)[_0x52fc1e(0xa5)]>0x0)_0x3be3e2[_0x52fc1e(0x7b)]=_0x2f0856;if(_0x52fc1e(0x9c)in _0x208658)_0x3be3e2[_0x52fc1e(0x9c)]=_0x208658[_0x52fc1e(0x9c)];else{if(Object['keys'](_0x3af840)[_0x52fc1e(0xa5)]>0x0)_0x3be3e2['defaultApp']=Object[_0x52fc1e(0x82)](_0x3af840)[0x0];else{if(_0x1852e3[_0x52fc1e(0x9c)])_0x3be3e2['defaultApp']=_0x1852e3[_0x52fc1e(0x9c)];else{const _0x15d48e=Object[_0x52fc1e(0x82)](_0xdbebd7);if(_0x15d48e['length']>0x0)_0x3be3e2['defaultApp']=_0x15d48e[0x0];}}}return _0x3be3e2;}export function readRawConfigWithLayers(_0x31fe1e){const _0x5b7b23=loadRawConfigLayers(_0x31fe1e);return{'config':mergeRawConfigLayers(_0x5b7b23),'layers':_0x5b7b23};}export function readRawConfig(_0x20519e){return mergeRawConfigLayers(loadRawConfigLayers(_0x20519e));}export function readConfigFile(_0x45fe8d){return parseAndNormalizeConfig(_0x45fe8d,'silent');}export function writeConfigFile(_0x402df2,_0x520813){const _0x31ee73=a194_0x863e2,_0x4752a1=dirname(_0x402df2);!existsSync(_0x4752a1)&&mkdirSync(_0x4752a1,{'recursive':!![]});const _0xb8bc55=_0x402df2+_0x31ee73(0xa7);try{writeFileSync(_0xb8bc55,JSON[_0x31ee73(0x9e)](_0x520813,null,0x2)+'\x0a',{'encoding':_0x31ee73(0x92),'mode':0x180}),renameSync(_0xb8bc55,_0x402df2);}catch(_0x571556){try{unlinkSync(_0xb8bc55);}catch{}throw _0x571556;}}export function resolveWriteConfigPath(_0x5b3ddd){const _0x22dcfa=a194_0x863e2,_0x212f3a=_0x5b3ddd===_0x22dcfa(0x8b)?process[_0x22dcfa(0x87)]():homedir(),_0x3c059d=resolveConfigPath(_0x212f3a);return _0x3c059d??resolve(_0x212f3a,NEW_CONFIG_NAME);}
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a195_0x311b41=a195_0x276b;(function(_0x5bea64,_0x46aa85){const _0x1e2bd2=a195_0x276b,_0x5e57d1=_0x5bea64();while(!![]){try{const _0x20c990=-parseInt(_0x1e2bd2(0x15b))/0x1*(-parseInt(_0x1e2bd2(0x15e))/0x2)+-parseInt(_0x1e2bd2(0x152))/0x3*(-parseInt(_0x1e2bd2(0x159))/0x4)+-parseInt(_0x1e2bd2(0x161))/0x5*(-parseInt(_0x1e2bd2(0x158))/0x6)+parseInt(_0x1e2bd2(0x165))/0x7*(-parseInt(_0x1e2bd2(0x16b))/0x8)+parseInt(_0x1e2bd2(0x168))/0x9*(parseInt(_0x1e2bd2(0x15d))/0xa)+parseInt(_0x1e2bd2(0x15a))/0xb+parseInt(_0x1e2bd2(0x14f))/0xc*(-parseInt(_0x1e2bd2(0x147))/0xd);if(_0x20c990===_0x46aa85)break;else _0x5e57d1['push'](_0x5e57d1['shift']());}catch(_0x38da2a){_0x5e57d1['push'](_0x5e57d1['shift']());}}}(a195_0x1f00,0xe5e1b));function a195_0x276b(_0x463960,_0x7cd022){_0x463960=_0x463960-0x144;const _0x1f007d=a195_0x1f00();let _0x276b24=_0x1f007d[_0x463960];return _0x276b24;}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(_0x5018a5){return process.env[`RABETBASE_${_0x5018a5}`]||process.env[`LOVRABET_${_0x5018a5}`]||undefined;}export async function createContext(_0x363ff4){const _0x571d2e=a195_0x276b,{config:_0x3c7d20,layers:_0x5f31c2}=readRawConfigWithLayers(),_0x225868=buildConfig(_0x3c7d20,_0x363ff4,_0x5f31c2),{initEnv:_0x16c3b2}=await import(_0x571d2e(0x16f));if(_0x225868[_0x571d2e(0x14b)])_0x16c3b2(_0x225868[_0x571d2e(0x14b)]);else _0x363ff4[_0x571d2e(0x14b)]&&typeof _0x363ff4[_0x571d2e(0x14b)]==='string'&&_0x16c3b2(_0x363ff4[_0x571d2e(0x14b)]);const {initDomains:_0x5f0c8a,getUserDomain:_0x210776,getApiDomain:_0x49d2fd}=await import(_0x571d2e(0x14a));_0x5f0c8a({'apiDomain':_0x3c7d20[_0x571d2e(0x153)]||undefined,'userDomain':_0x3c7d20[_0x571d2e(0x146)]||undefined,'runtimeDomain':_0x3c7d20[_0x571d2e(0x163)]||undefined});const _0x341b04={'apiDomain':_0x49d2fd(),'userDomain':_0x210776()},_0xd12030=await buildAuth(_0x225868);logger['setLogPath'](process[_0x571d2e(0x169)]());const _0x4d4483=(CLI_BIN_NAME+'\x20'+process[_0x571d2e(0x166)]['slice'](0x2)[_0x571d2e(0x148)]('\x20'))[_0x571d2e(0x157)]();logger[_0x571d2e(0x167)](_0x4d4483);const {isNonInteractive:_0x557cac}=await import(_0x571d2e(0x150)),_0x17a60d=_0x557cac(_0x363ff4);return{'config':_0x225868,'auth':_0xd12030,'logger':logger,'env':_0x341b04,'nonInteractive':_0x17a60d};}export function buildConfigFromFlags(_0x3725b7){const {config:_0xa6ad4c,layers:_0xcd27da}=readRawConfigWithLayers();return buildConfig(_0xa6ad4c,_0x3725b7,_0xcd27da);}export function getConfigAppCode(_0x2d6ecb){const _0x5cc14e=a195_0x276b,_0x448f5b=readRawConfig(_0x2d6ecb);if(_0x448f5b[_0x5cc14e(0x156)]&&typeof _0x448f5b[_0x5cc14e(0x156)]==='object'){const _0x585d88=_0x448f5b['defaultApp'];if(_0x585d88&&_0x448f5b[_0x5cc14e(0x156)][_0x585d88]?.[_0x5cc14e(0x144)])return String(_0x448f5b[_0x5cc14e(0x156)][_0x585d88]['appcode'])['trim']();const _0x56f0d2=Object['values'](_0x448f5b[_0x5cc14e(0x156)])[0x0];if(_0x56f0d2?.['appcode'])return String(_0x56f0d2[_0x5cc14e(0x144)])[_0x5cc14e(0x157)]();}const _0x5820a9=_0x448f5b[_0x5cc14e(0x144)]||_0x448f5b[_0x5cc14e(0x16a)];if(typeof _0x5820a9!=='string'||_0x5820a9['trim']()==='')return undefined;return _0x5820a9[_0x5cc14e(0x157)]();}export function getMultiAppConfigs(_0x35c0d1=a195_0x311b41(0x14d),_0x375c20){const _0x3d200f=a195_0x311b41,_0x49c3a8=loadRawConfigLayers(_0x375c20);let _0x27a291,_0x222ae6;if(_0x35c0d1===_0x3d200f(0x16c)){const _0x213089=_0x49c3a8['globalConfig'][_0x3d200f(0x156)]&&typeof _0x49c3a8['globalConfig']['apps']===_0x3d200f(0x16d)?_0x49c3a8[_0x3d200f(0x160)][_0x3d200f(0x156)]:{},_0x4afe01=_0x49c3a8['projectConfig'][_0x3d200f(0x156)]&&typeof _0x49c3a8['projectConfig'][_0x3d200f(0x156)]===_0x3d200f(0x16d)?_0x49c3a8['projectConfig'][_0x3d200f(0x156)]:{};_0x27a291={..._0x213089,..._0x4afe01};const _0x3b221d=readRawConfig(_0x375c20);_0x222ae6=_0x3b221d[_0x3d200f(0x14c)];}else _0x27a291=_0x49c3a8[_0x3d200f(0x149)][_0x3d200f(0x156)],_0x222ae6=_0x49c3a8[_0x3d200f(0x149)]['defaultApp'];if(!_0x27a291||typeof _0x27a291!==_0x3d200f(0x16d)||Object[_0x3d200f(0x151)](_0x27a291)[_0x3d200f(0x162)]===0x0)return null;return Object[_0x3d200f(0x164)](_0x27a291)[_0x3d200f(0x154)](([_0x4abcdb,_0x17014b])=>({'name':_0x4abcdb,'appcode':_0x17014b?.[_0x3d200f(0x144)]||'','isDefault':_0x4abcdb===_0x222ae6,'env':_0x17014b?.[_0x3d200f(0x14b)],'apiDir':_0x17014b?.[_0x3d200f(0x155)],'cookie':_0x17014b?.['cookie']||undefined}))[_0x3d200f(0x15c)](_0x494349=>_0x494349[_0x3d200f(0x144)]);}function a195_0x1f00(){const _0x30130a=['20gFkmON','https://g.lovrabet.com/dist/lovrabet-skill','globalConfig','18035EuKLju','length','runtimeDomain','entries','44198duhFSs','argv','setRawCommand','2103471jXRgEF','cwd','app','1160IlhxAs','merged','object','template_base_url','./constant/env.js','appcode','string','userDomain','26PUbrkl','join','projectConfig','./constant/domain.js','env','defaultApp','project','find','33196980lvZzYC','./utils/is-non-interactive.js','keys','85539CyWvDU','apiDomain','map','apiDir','apps','trim','1008svIkem','224SWXuBP','19188048pZKpWG','180685tdyYZq','filter','70wAWMHY'];a195_0x1f00=function(){return _0x30130a;};return a195_0x1f00();}export function getTemplateBaseUrl(_0x257a71){const _0x5b6f6a=a195_0x311b41,_0x4d9835=readRawConfig(_0x257a71);if(_0x4d9835['template_base_url']&&typeof _0x4d9835[_0x5b6f6a(0x16e)]===_0x5b6f6a(0x145))return _0x4d9835[_0x5b6f6a(0x16e)]['replace'](/\/$/,'');return _0x5b6f6a(0x15f);}function buildConfig(_0x3bd4db,_0x2869ee,_0x4c9563){return{...resolveAppConfig({'raw':_0x3bd4db,'flags':_0x2869ee,'layers':_0x4c9563,'readEnv':env}),'raw':_0x3bd4db};}export function resolveApiFilePath(_0x7304c7,_0x3f5161){const _0x527066=a195_0x311b41,_0xb2a46a=resolve(process[_0x527066(0x169)](),_0x7304c7),_0x155c74=resolve(_0xb2a46a,'api.ts');if(!_0x3f5161)return _0x155c74;const _0x5d9a0f=readRawConfig(),_0x4a36d8=_0x5d9a0f[_0x527066(0x156)]&&typeof _0x5d9a0f[_0x527066(0x156)]==='object'?_0x5d9a0f['apps']:{},_0x359ecf=Object[_0x527066(0x164)](_0x4a36d8)[_0x527066(0x14e)](([,_0x3fb123])=>_0x3fb123?.[_0x527066(0x144)]===_0x3f5161);if(!_0x359ecf)return _0x155c74;const [_0x4b5238,_0xecd217]=_0x359ecf,_0x5b5a38=typeof _0x5d9a0f[_0x527066(0x14c)]===_0x527066(0x145)?_0x5d9a0f[_0x527066(0x14c)]:undefined;if(_0xecd217?.[_0x527066(0x155)])return _0x155c74;if(_0x5b5a38&&_0x4b5238!==_0x5b5a38)return resolve(_0xb2a46a,_0x4b5238+'-api.ts');return _0x155c74;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3bda44,_0x23bfd6){const _0x199844=a196_0x41e5,_0x5464f2=_0x3bda44();while(!![]){try{const _0x4d074e=-parseInt(_0x199844(0xb9))/0x1*(-parseInt(_0x199844(0xa9))/0x2)+-parseInt(_0x199844(0xae))/0x3*(parseInt(_0x199844(0xa8))/0x4)+-parseInt(_0x199844(0xac))/0x5*(-parseInt(_0x199844(0xaf))/0x6)+-parseInt(_0x199844(0xb6))/0x7+-parseInt(_0x199844(0xb7))/0x8*(-parseInt(_0x199844(0xa7))/0x9)+-parseInt(_0x199844(0xb3))/0xa*(parseInt(_0x199844(0xa6))/0xb)+-parseInt(_0x199844(0xb0))/0xc*(-parseInt(_0x199844(0xb8))/0xd);if(_0x4d074e===_0x23bfd6)break;else _0x5464f2['push'](_0x5464f2['shift']());}catch(_0xcde760){_0x5464f2['push'](_0x5464f2['shift']());}}}(a196_0x1e52,0x93412));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a196_0x41e5(_0x56f670,_0x3d9344){_0x56f670=_0x56f670-0xa6;const _0x1e5284=a196_0x1e52();let _0x41e537=_0x1e5284[_0x56f670];return _0x41e537;}const cache=new Map();function parseApiFile(_0x50a8df){const _0x12ec0e=[],_0x2a202e=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x2d58e4;while((_0x2d58e4=_0x2a202e['exec'](_0x50a8df))!==null){_0x12ec0e['push']({'datasetCode':_0x2d58e4[0x1],'tableName':_0x2d58e4[0x2],'name':_0x2d58e4[0x3],'alias':_0x2d58e4[0x4]});}return _0x12ec0e;}function a196_0x1e52(){const _0x7d11ba=['cwd','768445YRQGfv','alias','76611ciDYlU','18sQmlZs','18114420nGfbrD','datasetCode','get','10qhOsHf','api.ts','find','2957059LmXnil','24EXsGyV','13yKVBQE','11HYlFLt','10614703SSVmlC','189153EaaadN','60ZqypmV','61812UKeICH','set'];a196_0x1e52=function(){return _0x7d11ba;};return a196_0x1e52();}export function loadAliasMap(_0x599e5b,_0x42a2e3,_0x75f848){const _0x20cbc2=a196_0x41e5,_0x259f4d=_0x75f848??resolve(process[_0x20cbc2(0xab)](),_0x599e5b,_0x20cbc2(0xb4));if(cache['has'](_0x259f4d))return cache[_0x20cbc2(0xb2)](_0x259f4d);if(!existsSync(_0x259f4d))return cache[_0x20cbc2(0xaa)](_0x259f4d,[]),[];try{const _0x5d9c4d=readFileSync(_0x259f4d,'utf-8'),_0x1c26c9=parseApiFile(_0x5d9c4d);return cache[_0x20cbc2(0xaa)](_0x259f4d,_0x1c26c9),_0x1c26c9;}catch{return cache['set'](_0x259f4d,[]),[];}}export function resolveAlias(_0x38ba53,_0x5b8813,_0x4be7f3,_0x5e089c){const _0x3f96f9=a196_0x41e5;if(!_0x5b8813)return undefined;const _0x9988e7=loadAliasMap(_0x38ba53,_0x4be7f3,_0x5e089c),_0x2329a4=_0x9988e7[_0x3f96f9(0xb5)](_0x69d3f1=>_0x69d3f1[_0x3f96f9(0xad)]===_0x5b8813);return _0x2329a4?.[_0x3f96f9(0xb1)];}export function listAliases(_0x21876b,_0x81759e,_0x327081){return loadAliasMap(_0x21876b,_0x81759e,_0x327081);}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5807cf,_0x2d554c){const _0x40ece1=a197_0x3ede,_0x8a5de3=_0x5807cf();while(!![]){try{const _0x4020a2=parseInt(_0x40ece1(0x295))/0x1+-parseInt(_0x40ece1(0x1e4))/0x2*(-parseInt(_0x40ece1(0x228))/0x3)+parseInt(_0x40ece1(0x29a))/0x4*(parseInt(_0x40ece1(0x1f6))/0x5)+-parseInt(_0x40ece1(0x26a))/0x6+-parseInt(_0x40ece1(0x297))/0x7+parseInt(_0x40ece1(0x2a0))/0x8+parseInt(_0x40ece1(0x1ec))/0x9*(-parseInt(_0x40ece1(0x2bd))/0xa);if(_0x4020a2===_0x2d554c)break;else _0x8a5de3['push'](_0x8a5de3['shift']());}catch(_0xf81d6c){_0x8a5de3['push'](_0x8a5de3['shift']());}}}(a197_0x8c48,0x47779));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(_0x3b597d){_activeCookie=_0x3b597d||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x385fdf,_0x3fcba5){const _0x239211=a197_0x3ede,_0xf73238=_0x3fcba5 instanceof Error?_0x3fcba5[_0x239211(0x279)]:String(_0x3fcba5);return CliErrors[_0x239211(0x29e)]('Request\x20failed:\x20'+_0x385fdf+(_0xf73238?'\x20('+_0xf73238+')':''),_0x239211(0x1f4));}async function apiRequest(_0x4ae6cf,_0xc3df2a={}){const _0x5f29ec=a197_0x3ede,{method:method=_0x5f29ec(0x283),body:_0x2927bb,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0xc3df2a,_0x3c9123=useRuntime?getRuntimeDomain():getApiDomain(),_0x1021b7=_activeCookie||getCookie(),_0x25cc9a=''+_0x3c9123+_0x4ae6cf,_0x2ed1ef=new AbortController(),_0x4f831e=setTimeout(()=>_0x2ed1ef[_0x5f29ec(0x2a9)](),timeout);try{const _0x39e615=await fetch(_0x25cc9a,{'method':method,'headers':{'Content-Type':_0x5f29ec(0x267),'Cookie':_0x1021b7,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x2927bb?JSON[_0x5f29ec(0x21c)](_0x2927bb):undefined,'signal':_0x2ed1ef['signal']});let _0x18fcfc;try{_0x18fcfc=await _0x39e615[_0x5f29ec(0x1e6)]();}catch(_0x5e4fb8){if(_0x5e4fb8 instanceof Error&&_0x5e4fb8[_0x5f29ec(0x20e)]===_0x5f29ec(0x2b2))throw CliErrors[_0x5f29ec(0x29e)](_0x5f29ec(0x285)+_0x25cc9a);if(_0x39e615['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x5f29ec(0x29e)](_0x5f29ec(0x1e9)+_0x39e615[_0x5f29ec(0x2ab)]+')',_0x39e615[_0x5f29ec(0x2ab)]>=0x190?_0x5f29ec(0x1de):undefined);}if(!_0x39e615['ok']||_0x18fcfc[_0x5f29ec(0x218)]===![])throw CliErrors['apiError'](_0x18fcfc[_0x5f29ec(0x208)]||_0x18fcfc[_0x5f29ec(0x279)]||_0x5f29ec(0x207)+_0x39e615['status'],_0x18fcfc[_0x5f29ec(0x200)]?_0x5f29ec(0x27c)+_0x18fcfc[_0x5f29ec(0x200)]:undefined);return _0x18fcfc;}catch(_0x1db566){if(_0x1db566 instanceof CliError)throw _0x1db566;if(_0x1db566 instanceof Error&&_0x1db566[_0x5f29ec(0x20e)]===_0x5f29ec(0x2b2))throw CliErrors['apiError'](_0x5f29ec(0x285)+_0x25cc9a);throw createFetchFailureError(_0x25cc9a,_0x1db566);}finally{clearTimeout(_0x4f831e);}}async function apiFormRequest(_0x2449c8,_0x4d07fa,_0x5c64b9={}){const _0x1fc664=a197_0x3ede,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x5c64b9,_0x3688c6=_activeCookie||getCookie(),_0x3e458f=''+getApiDomain()+_0x2449c8,_0x15ee97=new AbortController(),_0x5bd4e4=setTimeout(()=>_0x15ee97[_0x1fc664(0x2a9)](),timeout);try{const _0x5787ea=await fetch(_0x3e458f,{'method':_0x1fc664(0x25e),'headers':{'Cookie':_0x3688c6,'X-Invoke-Source':_0x1fc664(0x1f5)},'body':_0x4d07fa,'signal':_0x15ee97[_0x1fc664(0x250)]});let _0x3ef3ab;try{_0x3ef3ab=await _0x5787ea[_0x1fc664(0x1e6)]();}catch(_0x56ac73){if(_0x56ac73 instanceof Error&&_0x56ac73[_0x1fc664(0x20e)]===_0x1fc664(0x2b2))throw CliErrors[_0x1fc664(0x29e)]('Request\x20timeout:\x20'+_0x3e458f);throw CliErrors[_0x1fc664(0x29e)](_0x1fc664(0x1e9)+_0x5787ea[_0x1fc664(0x2ab)]+')',_0x5787ea[_0x1fc664(0x2ab)]>=0x190?_0x1fc664(0x1de):undefined);}if(!_0x5787ea['ok']||_0x3ef3ab[_0x1fc664(0x218)]===![])throw CliErrors[_0x1fc664(0x29e)](_0x3ef3ab[_0x1fc664(0x208)]||_0x3ef3ab['message']||_0x1fc664(0x207)+_0x5787ea[_0x1fc664(0x2ab)],_0x3ef3ab['errorCode']?'API\x20error\x20code:\x20'+_0x3ef3ab['errorCode']:undefined);return _0x3ef3ab;}catch(_0x22b6be){if(_0x22b6be instanceof CliError)throw _0x22b6be;if(_0x22b6be instanceof Error&&_0x22b6be['name']===_0x1fc664(0x2b2))throw CliErrors[_0x1fc664(0x29e)](_0x1fc664(0x285)+_0x3e458f);throw createFetchFailureError(_0x3e458f,_0x22b6be);}finally{clearTimeout(_0x5bd4e4);}}export async function uploadDevelopmentFile(_0x124472,_0x53665e){const _0x1cece1=a197_0x3ede,_0x178190=await readFile(_0x53665e),_0x128149=new FormData();_0x128149['append'](_0x1cece1(0x286),_0x124472),_0x128149[_0x1cece1(0x298)](_0x1cece1(0x26c),new Blob([new Uint8Array(_0x178190)]),basename(_0x53665e));const _0x574a8a=await apiFormRequest(_0x1cece1(0x25b),_0x128149);return _0x574a8a[_0x1cece1(0x213)];}export async function queryDevelopmentFileUrl(_0x2402f3,_0x22cc78={}){const _0xed6cd0=a197_0x3ede,_0x4b6a6f=await apiRequest(_0xed6cd0(0x23b),{'method':_0xed6cd0(0x25e),'body':{'filePath':_0x2402f3,'downloadFlag':_0x22cc78[_0xed6cd0(0x272)]??![],..._0x22cc78['longTerm']?{'longTerm':!![]}:{}}});return _0x4b6a6f[_0xed6cd0(0x213)];}function isAuthFailure(_0x4f420f){const _0x43a43a=a197_0x3ede,_0x202db3=_0x4f420f[_0x43a43a(0x208)]||_0x4f420f[_0x43a43a(0x279)]||_0x4f420f['data']?.[_0x43a43a(0x279)]||_0x4f420f['errorMessage']||_0x4f420f[_0x43a43a(0x276)]||'';return _0x4f420f[_0x43a43a(0x200)]===_0x43a43a(0x227)||_0x4f420f['code']===0x191||_0x4f420f[_0x43a43a(0x258)]==='401'||_0x202db3['includes'](_0x43a43a(0x1f3))||_0x202db3[_0x43a43a(0x27b)](_0x43a43a(0x247))||_0x202db3['includes']('登录')||_0x202db3[_0x43a43a(0x27b)]('认证');}export async function platformFetch(_0x18ab0d,_0x3f83eb){const _0x4765a1=a197_0x3ede;let _0x2a6ee6;try{_0x2a6ee6=await fetch(_0x18ab0d,{'method':_0x3f83eb['method']??_0x4765a1(0x283),'headers':{'Content-Type':'application/json','Cookie':_0x3f83eb[_0x4765a1(0x1dc)],'X-Invoke-Source':_0x4765a1(0x1f5)},..._0x3f83eb[_0x4765a1(0x2a4)]&&{'body':JSON[_0x4765a1(0x21c)](_0x3f83eb[_0x4765a1(0x2a4)])}});}catch(_0x3397ef){throw createFetchFailureError(_0x18ab0d,_0x3397ef);}if(!_0x2a6ee6['ok']){if(_0x2a6ee6[_0x4765a1(0x2ab)]===0x191)throw CliErrors[_0x4765a1(0x2bc)]();throw CliErrors[_0x4765a1(0x29e)](_0x3f83eb[_0x4765a1(0x287)]+_0x4765a1(0x299)+_0x2a6ee6[_0x4765a1(0x2ab)]);}const _0x12b783=await _0x2a6ee6[_0x4765a1(0x1e6)]();if(_0x12b783[_0x4765a1(0x218)]===![]){if(isAuthFailure(_0x12b783))throw CliErrors[_0x4765a1(0x2bc)]();throw CliErrors[_0x4765a1(0x29e)](_0x12b783[_0x4765a1(0x208)]||_0x12b783[_0x4765a1(0x279)]||_0x3f83eb[_0x4765a1(0x287)]+_0x4765a1(0x22f));}return _0x12b783[_0x4765a1(0x213)];}export async function platformRequest(_0x651812,_0x19b746){const _0x3953b9=a197_0x3ede;if(/^https?:\/\//i['test'](_0x651812))throw CliErrors['validation'](_0x3953b9(0x1f1)+_0x651812,_0x3953b9(0x233));const _0x83147b=_0x651812[_0x3953b9(0x1ed)]('/')?_0x651812:'/'+_0x651812;return platformFetch(''+getApiDomain()+_0x83147b,_0x19b746);}function cleanNewlines(_0x55351d){const _0x4bc75c=a197_0x3ede;return _0x55351d['replace'](/[\r\n]+/g,'\x20')[_0x4bc75c(0x2ba)]();}function cleanDatasetName(_0x568bfc){const _0x5b37c2=a197_0x3ede;if(!_0x568bfc[_0x5b37c2(0x20e)])return _0x568bfc;return{..._0x568bfc,'name':cleanNewlines(_0x568bfc[_0x5b37c2(0x20e)])};}export async function fetchModelList(_0x2fb308,_0x5bd101){const _0x4ce043=a197_0x3ede,_0x55e2ea=getEnv(),_0x4107dd=new URLSearchParams({'appcode':_0x2fb308,'otype':_0x4ce043(0x265)}),_0x28dd3f=_0x4ce043(0x2b8)+_0x4107dd['toString']();logger[_0x4ce043(0x264)](_0x4ce043(0x2a7),_0x4ce043(0x261)+_0x55e2ea+')',{'apiPath':_0x28dd3f});const _0x30a314=await platformRequest(_0x28dd3f,{'cookie':_0x5bd101,'label':_0x4ce043(0x29f)}),_0x16918c=(_0x30a314[_0x4ce043(0x239)]??[])[_0x4ce043(0x281)](cleanDatasetName);return{'configArray':_0x16918c,'count':_0x16918c[_0x4ce043(0x221)]};}export async function fetchDatasetDoc(_0x559f97){const _0x1a0e0e=a197_0x3ede,{appCode:_0x3c279d,cookie:_0x327b0c,datasetCode:_0x1ac978,datasetId:_0x10ed49,extraParams:_0x1b5968}=_0x559f97,_0x59d8ca=await platformRequest(_0x1a0e0e(0x24a),{'method':_0x1a0e0e(0x25e),'body':{'appCode':_0x3c279d,'datasetCode':_0x1ac978,'datasetId':_0x10ed49,..._0x1b5968||{}},'cookie':_0x327b0c,'label':_0x1a0e0e(0x21b)+_0x1ac978+')'});if(!_0x59d8ca||typeof _0x59d8ca[_0x1a0e0e(0x20c)]!==_0x1a0e0e(0x24c))throw new Error(_0x1a0e0e(0x2ad)+_0x1ac978+_0x1a0e0e(0x1fe));return _0x59d8ca[_0x1a0e0e(0x20c)];}export async function getMenuTree(_0x5bebf6,_0x14c06c){const _0x539639=a197_0x3ede,_0x24ddae=new URLSearchParams({'appCode':_0x5bebf6});return platformRequest(_0x539639(0x266)+_0x24ddae[_0x539639(0x1ef)](),{'cookie':_0x14c06c,'label':'Fetch\x20menu\x20list'});}export async function createMenuRecord(_0x4e5b6a,_0x114c44,_0x593daa){const _0xf66ac5=a197_0x3ede;return platformRequest('/smartapi/menu/create',{'method':_0xf66ac5(0x25e),'body':_0x4e5b6a,'cookie':_0x114c44,'label':_0x593daa});}export async function updateMenuRecord(_0x529ef2,_0x1389a7,_0x3c6e65){const _0x4aa620=a197_0x3ede;return platformRequest(_0x4aa620(0x1f9),{'method':_0x4aa620(0x25e),'body':_0x529ef2,'cookie':_0x1389a7,'label':_0x3c6e65});}export async function deleteMenuRecord(_0x408495,_0x309100,_0x2fed93){return platformRequest('/smartapi/menu/delete',{'method':'POST','body':{'id':_0x408495},'cookie':_0x309100,'label':_0x2fed93});}export async function batchDeleteMenuRecords(_0x4f543b,_0x26dd70,_0x35eafa){return platformRequest('/smartapi/menu/batchDelete',{'method':'POST','body':{'idList':_0x4f543b},'cookie':_0x26dd70,'label':_0x35eafa});}export async function startMenuRegroup(_0x430c6b,_0x3af5e6,_0x199415){const _0x4ccbd3=a197_0x3ede;return platformRequest('/smartapi/menu/regroup',{'method':_0x4ccbd3(0x25e),'body':_0x430c6b,'cookie':_0x3af5e6,'label':_0x199415});}export async function getAsyncTaskStatus(_0x42e229,_0x16c6c8,_0x2dd639){const _0x55fed6=a197_0x3ede,_0x3452f=new URLSearchParams({'appCode':_0x16c6c8});return platformRequest(_0x55fed6(0x1ee)+encodeURIComponent(_0x42e229)+'?'+_0x3452f[_0x55fed6(0x1ef)](),{'cookie':_0x2dd639,'label':'Fetch\x20async\x20task\x20'+_0x42e229});}export async function listBffScripts(_0x52b89c,_0x237727,_0x401658){const _0xd9e11f=a197_0x3ede;let _0x587525=_0xd9e11f(0x214)+_0x52b89c;if(_0x237727)_0x587525+=_0xd9e11f(0x1fb)+_0x237727;const _0x1eb011=await apiRequest(_0x587525);let _0x3f0341=extractList(_0x1eb011[_0xd9e11f(0x213)]);if(_0x401658?.['scriptName']){const _0x5c4a83=_0x401658[_0xd9e11f(0x220)][_0xd9e11f(0x24d)]();_0x3f0341=_0x3f0341[_0xd9e11f(0x1e1)](_0x3d6dc9=>_0x3d6dc9['functionName']?.[_0xd9e11f(0x24d)]()[_0xd9e11f(0x27b)](_0x5c4a83)||_0x3d6dc9[_0xd9e11f(0x270)]?.[_0xd9e11f(0x24d)]()['includes'](_0x5c4a83));}return _0x3f0341;}export async function getBffScriptInfo(_0x53bc80){const _0x464202=a197_0x3ede,_0x3cadbe=await apiRequest('/api/management/library/scripts/info?id='+_0x53bc80);if(!_0x3cadbe[_0x464202(0x213)])throw CliErrors[_0x464202(0x202)]('BFF\x20script\x20not\x20found:\x20id='+_0x53bc80);return _0x3cadbe['data'];}export async function saveBffScript(_0x35b373){const _0x12f24e=a197_0x3ede,_0x314dc8=await apiRequest(_0x12f24e(0x21e),{'method':_0x12f24e(0x25e),'body':_0x35b373}),{id:_0x5a9415,entity:_0x172b91}=normalizeEntityWithIdResponse(_0x314dc8[_0x12f24e(0x213)]);if(_0x5a9415!==undefined){const _0x38007a=typeof _0x172b91[_0x12f24e(0x280)]===_0x12f24e(0x24c)||typeof _0x172b91[_0x12f24e(0x25c)]==='string'?_0x172b91:undefined;return{'id':_0x5a9415,'script':_0x38007a};}throw CliErrors[_0x12f24e(0x29e)](_0x12f24e(0x2b3));}export async function deleteBffScript(_0x531e57){const _0x14c395=a197_0x3ede;await apiRequest(_0x14c395(0x2b5),{'method':_0x14c395(0x25e),'body':{'id':_0x531e57}});}export async function getBffScriptStatistics(_0x3d12bf){const _0x57041c=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x3d12bf);return extractList(_0x57041c['data']);}export async function clearBffScriptCache(){const _0x5098d7=a197_0x3ede,_0x9cddaa=await apiRequest('/api/management/script/cache/clear',{'method':_0x5098d7(0x25e),'useRuntime':!![]});return typeof _0x9cddaa[_0x5098d7(0x213)]===_0x5098d7(0x24c)?_0x9cddaa[_0x5098d7(0x213)]:'';}export async function listBffDatasetOperations(_0x2d63b1,_0x125de5){const _0x386ccc=a197_0x3ede,_0xee4325=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':'POST','body':{'appCode':_0x2d63b1,'datasetId':_0x125de5}});return _0xee4325[_0x386ccc(0x213)];}export async function listSqlQueries(_0x118d6b,_0x2822df){const _0x3cffde=a197_0x3ede,_0x28f2b1=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':'POST','body':{'appCode':_0x118d6b,'currentPage':_0x2822df?.[_0x3cffde(0x24b)]??0x1,'pageSize':_0x2822df?.[_0x3cffde(0x224)]??0x32,'sqlCode':_0x2822df?.[_0x3cffde(0x254)],'sqlName':_0x2822df?.[_0x3cffde(0x1fd)]}});return _0x28f2b1['data'];}export async function getSqlQueryInfo(_0x237132,_0xf7e4b6){const _0x28e41d=a197_0x3ede,_0x1701f5=await listSqlQueries(_0x237132,{'sqlCode':_0xf7e4b6}),_0x78b810=_0x1701f5[_0x28e41d(0x27a)]?.[0x0];if(!_0x78b810)throw CliErrors[_0x28e41d(0x202)](_0x28e41d(0x2a3)+_0xf7e4b6);return _0x78b810;}export async function getSqlQueryDetail(_0xa211e){const _0x110221=a197_0x3ede,_0x5755f1=await apiRequest('/smartapi/custom/getUserCustomSql'+(_0x110221(0x22b)+encodeURIComponent(_0xa211e)));if(!_0x5755f1[_0x110221(0x213)])throw CliErrors[_0x110221(0x202)](_0x110221(0x2a3)+_0xa211e);return _0x5755f1['data'];}export async function getSqlQueryDetailById(_0x2aff25){const _0x29631f=a197_0x3ede,_0x2e8928=await apiRequest(_0x29631f(0x235)+_0x2aff25);if(!_0x2e8928[_0x29631f(0x213)])throw CliErrors[_0x29631f(0x202)]('SQL\x20query\x20not\x20found:\x20id='+_0x2aff25);return _0x2e8928[_0x29631f(0x213)];}export async function createSqlQuery(_0x34b635){const _0x33e371=a197_0x3ede,_0x16be18=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':_0x33e371(0x25e),'body':_0x34b635}),{id:_0x906512,entity:_0x13cfd4}=normalizeEntityWithIdResponse(_0x16be18[_0x33e371(0x213)]);if(!('sqlCode'in _0x13cfd4)&&_0x906512)return getSqlQueryDetailById(_0x906512);return normalizeSqlQueryEntity(_0x13cfd4);}export async function updateSqlQuery(_0x140a91){const _0x1778bf=a197_0x3ede,_0x15f43a=await apiRequest(_0x1778bf(0x1f7),{'method':_0x1778bf(0x25e),'body':_0x140a91}),{id:_0x3557a6,entity:_0x287eaf}=normalizeEntityWithIdResponse(_0x15f43a[_0x1778bf(0x213)]);if(!(_0x1778bf(0x254)in _0x287eaf)){if(_0x140a91[_0x1778bf(0x254)])return getSqlQueryDetail(_0x140a91[_0x1778bf(0x254)]);if(_0x3557a6)return getSqlQueryDetailById(_0x3557a6);}return normalizeSqlQueryEntity(_0x287eaf);}export async function deleteSqlQuery(_0x233bdf){const _0x470604=a197_0x3ede;await apiRequest(_0x470604(0x236),{'method':_0x470604(0x25e),'body':_0x233bdf});}export async function saveSqlQuery(_0x3a2505){const _0x108924=a197_0x3ede,_0x1ae6f6=await apiRequest(_0x108924(0x274),{'method':'POST','body':_0x3a2505});return _0x1ae6f6[_0x108924(0x213)];}function normalizeSqlQueryEntity(_0xb4bcd1){const _0x48a6b8=a197_0x3ede;return{..._0xb4bcd1,'id':Number(_0xb4bcd1['id']),'dbId':_0xb4bcd1['dbId']==null?undefined:Number(_0xb4bcd1[_0x48a6b8(0x269)]),'version':_0xb4bcd1[_0x48a6b8(0x24f)]==null?undefined:Number(_0xb4bcd1[_0x48a6b8(0x24f)])};}export async function executeSql(_0x58b793,_0x860c85,_0x44889b){const _0x5aa504=a197_0x3ede,_0x590682=await apiRequest('/api/custom/executeSql',{'method':_0x5aa504(0x25e),'body':{'appCode':_0x58b793,'sqlCode':_0x860c85,..._0x44889b&&{'params':_0x44889b}},'useRuntime':!![]});return _0x590682[_0x5aa504(0x213)];}export async function executeDatasetDataOperation(_0x5ad55e,_0x47076d,_0x23c859,_0x39b6ab={}){const _0x5bc04e=a197_0x3ede;try{const _0x5d180e=await apiRequest('/api/'+_0x5ad55e+'/'+_0x47076d+'/'+_0x23c859,{'method':_0x5bc04e(0x25e),'body':_0x39b6ab,'useRuntime':!![]});return _0x5d180e[_0x5bc04e(0x213)];}catch(_0x14f2cf){if(_0x23c859===_0x5bc04e(0x1e7)&&_0x14f2cf instanceof CliError&&_0x14f2cf[_0x5bc04e(0x258)]===_0x5bc04e(0x234)&&_0x39b6ab['id']!==undefined&&_0x39b6ab['id']!==null&&_0x39b6ab['id']!==''){const _0x5c053f=await apiRequest(_0x5bc04e(0x2a5)+_0x5ad55e+'/'+_0x47076d+_0x5bc04e(0x21d),{'method':_0x5bc04e(0x25e),'body':{'where':{'id':{'$eq':_0x39b6ab['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x15e0e1=Array['isArray'](_0x5c053f[_0x5bc04e(0x213)]?.[_0x5bc04e(0x27a)])?_0x5c053f['data'][_0x5bc04e(0x27a)]:[];return _0x15e0e1[0x0]??null;}throw _0x14f2cf;}}export async function listDatasets(_0x1e4fa6,_0x5ebb98){const _0x38518d=a197_0x3ede,_0x3c0f0d={'appCode':_0x1e4fa6,'deleted':_0x5ebb98?.[_0x38518d(0x248)]??![]};if(_0x5ebb98?.[_0x38518d(0x258)])_0x3c0f0d['code']=_0x5ebb98['code'];if(_0x5ebb98?.[_0x38518d(0x20e)])_0x3c0f0d[_0x38518d(0x20e)]=_0x5ebb98['name'];const _0x3a750f=await apiRequest(_0x38518d(0x28a),{'method':_0x38518d(0x25e),'body':_0x3c0f0d});return extractList(_0x3a750f['data']);}export async function deleteDataset(_0x2c46d2,_0x10afa2){const _0x343a46=a197_0x3ede;await apiRequest('/smartapi/dataset/delete-dataset',{'method':_0x343a46(0x25e),'body':{'appCode':_0x2c46d2,'datasetId':_0x10afa2}});}export async function restoreDataset(_0x3da36f,_0xe093d8){const _0x85a24a=a197_0x3ede;await apiRequest(_0x85a24a(0x241),{'method':_0x85a24a(0x25e),'body':{'appCode':_0x3da36f,'datasetId':_0xe093d8}});}export async function previewTextGeneratedDataset(_0x1fc10b,_0x4b3a59){const _0x1442c0=a197_0x3ede,_0x4ec164=await apiRequest('/smartapi/dataset/text-generate/preview',{'method':_0x1442c0(0x25e),'body':{'appCode':_0x1fc10b,'datasetName':_0x4b3a59[_0x1442c0(0x296)],'requirementDescription':_0x4b3a59[_0x1442c0(0x1eb)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x4ec164['data'];}export async function startTextGeneratedDataset(_0x32b16c,_0x21dee0,_0x257211){const _0x3dcf2f=a197_0x3ede,_0xe80ed5=await apiRequest(_0x3dcf2f(0x28e),{'method':_0x3dcf2f(0x25e),'body':{'appCode':_0x32b16c,..._0x257211?.[_0x3dcf2f(0x222)]?{'clientOperationId':_0x257211[_0x3dcf2f(0x222)]}:{},'design':_0x21dee0},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0xe80ed5['data'];}export async function getTextGeneratedDatasetStatus(_0x3ecd09,_0x7abcc9){const _0x17ae14=a197_0x3ede,_0x40bd78=new URLSearchParams({'appCode':_0x3ecd09});_0x7abcc9[_0x17ae14(0x210)]&&_0x40bd78[_0x17ae14(0x20d)](_0x17ae14(0x210),_0x7abcc9[_0x17ae14(0x210)]);_0x7abcc9['clientOperationId']&&_0x40bd78[_0x17ae14(0x20d)](_0x17ae14(0x222),_0x7abcc9['clientOperationId']);const _0x9254f9=await apiRequest(_0x17ae14(0x1fa)+_0x40bd78[_0x17ae14(0x1ef)]());return _0x9254f9['data'];}export async function searchDatasets(_0x73604e,_0x36c6cc){const _0x141975=a197_0x3ede,_0x355afd=await listDatasets(_0x73604e,{'name':_0x36c6cc}),_0x26067b=_0x36c6cc[_0x141975(0x24d)](),_0x218ff6=new Set(_0x355afd[_0x141975(0x281)](_0x218502=>_0x218502['id'])),_0x4e4c4a=_0x355afd[_0x141975(0x1e1)](_0x4df7c8=>_0x4df7c8[_0x141975(0x22d)]?.[_0x141975(0x252)]?.['toLowerCase']()['includes'](_0x26067b)||_0x4df7c8[_0x141975(0x270)]?.['toLowerCase']()['includes'](_0x26067b)),_0x5a79ee=await listDatasets(_0x73604e,{'code':_0x36c6cc});for(const _0xcb2839 of _0x5a79ee){!_0x218ff6[_0x141975(0x2ae)](_0xcb2839['id'])&&(_0x355afd[_0x141975(0x2af)](_0xcb2839),_0x218ff6[_0x141975(0x21a)](_0xcb2839['id']));}return _0x355afd;}export function normalizeDatasetOperations(_0xe20e6){const _0x128d67=a197_0x3ede;if(Array[_0x128d67(0x2b9)](_0xe20e6))return _0xe20e6[_0x128d67(0x1e1)](_0x24401b=>_0x24401b!=null&&typeof _0x24401b===_0x128d67(0x225));if(_0xe20e6&&typeof _0xe20e6===_0x128d67(0x225))return Object[_0x128d67(0x2b1)](_0xe20e6)[_0x128d67(0x1e1)](([,_0x295264])=>_0x295264!=null&&typeof _0x295264===_0x128d67(0x225))[_0x128d67(0x281)](([_0x53dd01,_0x117429])=>({..._0x117429,'name':_0x117429[_0x128d67(0x20e)]??_0x117429[_0x128d67(0x240)]??_0x53dd01}));return[];}export async function getDatasetDetail(_0x552141){const _0x336e01=a197_0x3ede,_0x148506=/^\d+$/['test'](_0x552141)?'id':_0x336e01(0x258),_0x425aaa=await apiRequest(_0x336e01(0x2b4)+_0x148506+'='+_0x552141);return _0x425aaa[_0x336e01(0x213)];}export async function updateDrivenData(_0x54bba1){const _0x1d8590=a197_0x3ede,_0x26c0b0=await apiRequest(_0x1d8590(0x203),{'method':_0x1d8590(0x25e),'body':_0x54bba1});return _0x26c0b0[_0x1d8590(0x213)];}export async function getDatasetOperations(_0x16055b){const _0x2f6ef0=a197_0x3ede,_0x19d522=await getDatasetDetail(_0x16055b),_0x2b3773=normalizeDatasetOperations(_0x19d522['operations'])[_0x2f6ef0(0x281)](_0x59fdae=>({'name':_0x59fdae[_0x2f6ef0(0x20e)]||_0x59fdae['operationName'],'displayName':_0x59fdae[_0x2f6ef0(0x28f)]||_0x59fdae[_0x2f6ef0(0x20e)],'type':_0x59fdae[_0x2f6ef0(0x1f2)],'method':_0x59fdae[_0x2f6ef0(0x23e)],'path':_0x59fdae['path'],'enabled':_0x59fdae[_0x2f6ef0(0x256)]??!![],'requestFields':_0x59fdae['requestFields'],'responseFields':_0x59fdae['responseFields']}));return{'dataset':{'id':_0x19d522['id']??_0x19d522[_0x2f6ef0(0x2b7)],'name':_0x19d522[_0x2f6ef0(0x20e)],'code':_0x19d522[_0x2f6ef0(0x258)]||_0x19d522[_0x2f6ef0(0x27e)],'tableName':_0x19d522[_0x2f6ef0(0x252)]||_0x19d522[_0x2f6ef0(0x22d)]?.[_0x2f6ef0(0x252)]},'operations':_0x2b3773};}export async function getOperationDetail(_0x4be3b8,_0x287432,_0x1cfe54){const _0x1fa0ee=a197_0x3ede;let _0x4fb1ef=_0x287432;if(!/^\d+$/['test'](_0x287432)){const _0xf507bd=await listDatasets(_0x4be3b8,{'code':_0x287432}),_0x3893bc=_0xf507bd[_0x1fa0ee(0x28b)](_0x325bce=>_0x325bce[_0x1fa0ee(0x258)]===_0x287432||String(_0x325bce['id'])===_0x287432);if(!_0x3893bc)throw CliErrors['validation'](_0x1fa0ee(0x293)+_0x287432);_0x4fb1ef=String(_0x3893bc['id']);}const _0x10c0dc=await getDatasetDetail(_0x4fb1ef),_0x2a38fd=normalizeDatasetOperations(_0x10c0dc['operations'])['find'](_0x5d4d00=>(_0x5d4d00[_0x1fa0ee(0x20e)]||_0x5d4d00[_0x1fa0ee(0x240)])===_0x1cfe54);if(!_0x2a38fd)throw CliErrors['validation'](_0x1fa0ee(0x1e8)+_0x1cfe54+_0x1fa0ee(0x28c)+_0x287432);return{'dataset':{'id':_0x10c0dc['id']??_0x10c0dc['modelId'],'name':_0x10c0dc[_0x1fa0ee(0x20e)],'code':_0x10c0dc['code']||_0x10c0dc[_0x1fa0ee(0x27e)],'tableName':_0x10c0dc[_0x1fa0ee(0x252)]||_0x10c0dc[_0x1fa0ee(0x22d)]?.[_0x1fa0ee(0x252)]},'operation':_0x2a38fd};}export async function startGenerateStandardPages(_0x29e9b4,_0x4a8ae9,_0x474f04){const _0x18659a=a197_0x3ede,_0x15ea13=await apiRequest(_0x18659a(0x294)+_0x4a8ae9+_0x18659a(0x23a),{'method':'POST','body':{'appCode':_0x29e9b4,..._0x474f04?.[_0x18659a(0x222)]?{'clientOperationId':_0x474f04[_0x18659a(0x222)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x15ea13[_0x18659a(0x213)];}export async function getGenerateStandardPagesStatus(_0x5dde45,_0x1cc6c2,_0x515229){const _0x461766=a197_0x3ede,_0x3a9953=new URLSearchParams({'appCode':_0x5dde45});_0x515229[_0x461766(0x210)]&&_0x3a9953[_0x461766(0x20d)](_0x461766(0x210),_0x515229[_0x461766(0x210)]);_0x515229[_0x461766(0x222)]&&_0x3a9953[_0x461766(0x20d)](_0x461766(0x222),_0x515229['clientOperationId']);const _0x2dec5d=await apiRequest(_0x461766(0x294)+_0x1cc6c2+'/generate-standard-pages/status?'+_0x3a9953['toString']());return _0x2dec5d['data'];}export async function getStandardPageStatus(_0x519b5d,_0x41e6ab){const _0x5c9e2d=a197_0x3ede,_0x122a26=await apiRequest(_0x5c9e2d(0x294)+_0x41e6ab+_0x5c9e2d(0x237)+encodeURIComponent(_0x519b5d));return _0x122a26[_0x5c9e2d(0x213)];}export async function tryGetStandardPageStatus(_0x5aa9db,_0x21ad75){const _0x56b1d2=a197_0x3ede;try{return await getStandardPageStatus(_0x5aa9db,_0x21ad75);}catch(_0x43e91d){if(_0x43e91d instanceof CliError&&_0x43e91d[_0x56b1d2(0x258)]===_0x56b1d2(0x234)&&/404|not found|non-json response/i['test'](_0x43e91d[_0x56b1d2(0x279)]))return null;throw _0x43e91d;}}export async function syncStandardPages(_0xd6f95d,_0x127269){const _0x134f30=a197_0x3ede,_0x73571b=await apiRequest(_0x134f30(0x294)+_0x127269+_0x134f30(0x292),{'method':_0x134f30(0x25e),'body':{'appCode':_0xd6f95d}});return _0x73571b['data'];}export async function getPageDetail(_0x408363){const _0x351e11=a197_0x3ede,_0x21981a=await apiRequest(_0x351e11(0x29c)+_0x408363);if(!_0x21981a[_0x351e11(0x213)])throw CliErrors[_0x351e11(0x202)](_0x351e11(0x27d)+_0x408363);return _0x21981a['data'];}function a197_0x8c48(){const _0x5198da=['/smartapi/question/er-config/cli/detail?','apiError','Fetch\x20datasets','3260424lvdyFD','/smartapi/permit/role/get-one','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','SQL\x20query\x20not\x20found:\x20','body','/api/','min','fetch-model-list','/smartapi/app-config/create','abort','/smartapi/app-config/list','status','/smartapi/permit/page/save','Invalid\x20response\x20format\x20(','has','push','.remove(id);','entries','AbortError','BFF\x20save\x20returned\x20no\x20valid\x20id','/smartapi/dataset/get-driven-data?','/api/management/library/scripts/delete','\x20apps.\x20','modelId','/api/node-toolbox/dataset/model-list?','isArray','trim','mobile','authRequired','47590jyvOAD','(/*\x20params\x20*/);','/smartapi/permit/role/update','/smartapi/permit/resource/get-menu-list','cookie','/smartapi/permit/page/get-one','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','const\x20results\x20=\x20data.execResult\x20||\x20[];','.create({\x20/*\x20fields\x20*/\x20});','filter','remove','userId','2wMGqYA','permits','json','getOne','Operation\x20\x22','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','requirementDescription','549jztxzL','startsWith','/smartapi/tasks/','toString','//\x20SQL:\x20','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','type','401','Check\x20network\x20connectivity\x20and\x20try\x20again.','cli:rabetbase','2353730dDNCdV','/smartapi/custom/updateUserCustomSql','remark','/smartapi/menu/update','/smartapi/dataset/text-generate/status?','&type=','roleType','sqlName','):\x20missing\x20data.markdown\x20field','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','errorCode','tags','validation','/smartapi/dataset/update-driven-data','/smartapi/permit/role/get-permit-list','/smartapi/permit/role/get-list','const\x20result\x20=\x20await\x20client.models.','API\x20error:\x20','errorMsg','/smartapi/question/er-config/cli/delete-single','/smartapi/question/er-config/business-group/edit','/smartapi/question/er-config/cli/update-single','markdown','set','name','create','operationId','table','/smartapi/dblink/update','data','/api/management/library/scripts/list?appCode=','isFinite','DATA_NOT_EXIST','/smartapi/question/er-config/cli/erCreate','success','Warning:\x20showing\x20first\x20','add','Fetch\x20doc\x20(','stringify','/filter','/api/management/library/scripts/save','\x20\x20currentPage:\x201,','scriptName','length','clientOperationId','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','pageSize','object','value','UNAUTHORIZED','102801XkZQIF','/smartapi/app-config/getByKey','needPublic','?sqlCode=','datasetTableCount','dbtableConfig','summary','\x20failed','ENABLE','/smartapi/permit/role/delete','key','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','api_error','/smartapi/custom/getUserCustomSql?id=','/smartapi/custom/deleteUserCustomSql','/standard-page-status?appCode=','includeImports','configArray','/generate-standard-pages/start','/smartapi/common/queryFileUrl','/userTenant/getByTenantCode','\x20\x20sqlCode:\x20\x27','method','target','operationName','/smartapi/dataset/restore-dataset','avatar','userTenantRelationList','const\x20data\x20=\x20await\x20client.sql.execute({','replace','/smartapi/lovrabet/update-page','Unauthorized','deleted','ER\x20relation\x20does\x20not\x20exist','/api/node-toolbox/api-doc-generator','currentPage','string','toLowerCase','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','version','signal','});','tableName','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','sqlCode','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','enabled','API\x20error\x20code:\x20306','code','/smartapi/db-analysis/jobs/cancel','tableList','/smartapi/common/uploadFile','scriptType','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','POST','update','list','正在从服务器拉取模型列表...\x20(环境:\x20','join','roleName','info','array','/smartapi/menu/find?','application/json','\x20\x20return\x20rows;','dbId','3178236UXdwTm','sdk','file','\x20\x20pageSize:\x2020,','/smartapi/dblink/delete','needSelf','description','totalCount','download','/smartapi/dblink/getList','/api/node-toolbox/sql/save','warn','error','email','/smartapi/dblink/getTableDiffV2ByPage','message','tableData','includes','API\x20error\x20code:\x20','Page\x20not\x20found:\x20','modelCode','\x20\x20where:\x20{},','functionName','map','/smartapi/dblink/getOne','GET','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','Request\x20timeout:\x20','appCode','label','.filter({','/smartapi/dblink/getAllTableList','/smartapi/dataset/get-dataset-list','find','\x22\x20not\x20found\x20in\x20dataset\x20','delete','/smartapi/dataset/text-generate/start','displayName','pageIndex','\x20\x20});','/sync-to-pages','Dataset\x20not\x20found:\x20','/smartapi/lovrabet/dataset/','265568XqiyUM','datasetName','457800oCudIg','append','\x20failed,\x20HTTP\x20','4ZKDsMa','hint','/smartapi/lovrabet/detail?pageId='];a197_0x8c48=function(){return _0x5198da;};return a197_0x8c48();}export async function updatePage(_0x4d93df,_0xd8a4bd,_0x52acf2,_0x34aed3){const _0x1e9d86=a197_0x3ede,_0x122f03=await apiRequest(_0x1e9d86(0x246),{'method':_0x1e9d86(0x25e),'body':{'appCode':_0x4d93df,'pageId':_0xd8a4bd,'code':_0x52acf2,'datasetIds':_0x34aed3}});return _0x122f03[_0x1e9d86(0x213)];}export function generateSdkCode(_0x42b219,_0x4765d3,_0x242271){const _0x2591d3=a197_0x3ede,_0x11ad59=_0x242271?.[_0x2591d3(0x238)]??!![],_0x55dfeb='dataset_'+_0x42b219[_0x2591d3(0x258)]?.[_0x2591d3(0x245)](/-/g,'_'),_0x39aed4=_0x4765d3[_0x2591d3(0x20e)]||_0x4765d3[_0x2591d3(0x240)]||_0x2591d3(0x1e1),_0x182b08=[];_0x11ad59&&_0x182b08[_0x2591d3(0x2af)](_0x2591d3(0x284),'',_0x2591d3(0x1ea),'');_0x182b08[_0x2591d3(0x2af)]('//\x20'+_0x42b219[_0x2591d3(0x20e)]+'\x20('+(_0x42b219[_0x2591d3(0x252)]||_0x2591d3(0x211))+')');if(_0x39aed4===_0x2591d3(0x1e1))_0x182b08[_0x2591d3(0x2af)](_0x2591d3(0x206)+_0x55dfeb+_0x2591d3(0x288),_0x2591d3(0x27f),_0x2591d3(0x26d),_0x2591d3(0x21f),_0x2591d3(0x251));else{if(_0x39aed4===_0x2591d3(0x1e7))_0x182b08['push']('const\x20result\x20=\x20await\x20client.models.'+_0x55dfeb+'.getOne(id);');else{if(_0x39aed4===_0x2591d3(0x20f))_0x182b08[_0x2591d3(0x2af)]('const\x20result\x20=\x20await\x20client.models.'+_0x55dfeb+_0x2591d3(0x1e0));else{if(_0x39aed4===_0x2591d3(0x25f))_0x182b08[_0x2591d3(0x2af)](_0x2591d3(0x206)+_0x55dfeb+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x39aed4===_0x2591d3(0x28d)||_0x39aed4===_0x2591d3(0x1e2)?_0x182b08['push']('const\x20result\x20=\x20await\x20client.models.'+_0x55dfeb+_0x2591d3(0x2b0)):_0x182b08[_0x2591d3(0x2af)]('const\x20result\x20=\x20await\x20client.models.'+_0x55dfeb+'.'+_0x39aed4+_0x2591d3(0x2be));}}}return _0x182b08[_0x2591d3(0x262)]('\x0a');}export function generateSqlCodeTemplate(_0x1914b2,_0x202e91){const _0x50564b=a197_0x3ede,_0x2eaed2=_0x202e91?.[_0x50564b(0x23f)]??_0x50564b(0x26b),_0xfb213c=_0x202e91?.[_0x50564b(0x238)]??!![],_0x2a087e=[];return _0x2a087e['push'](_0x50564b(0x1f0)+_0x1914b2['sqlName']+'\x20('+_0x1914b2[_0x50564b(0x254)]+')'),_0x2eaed2===_0x50564b(0x26b)?(_0xfb213c&&_0x2a087e[_0x50564b(0x2af)](_0x50564b(0x284),'',_0x50564b(0x1ea),''),_0x2a087e['push'](_0x50564b(0x244),_0x50564b(0x23d)+_0x1914b2[_0x50564b(0x254)]+'\x27,',_0x50564b(0x24e),_0x50564b(0x251),_0x50564b(0x223),_0x50564b(0x1df))):_0x2a087e[_0x50564b(0x2af)](_0x50564b(0x2a2),_0x50564b(0x255),_0x50564b(0x253),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x1914b2['sqlCode']+'\x27,',_0x50564b(0x1ff),_0x50564b(0x291),_0x50564b(0x268),'}'),_0x2a087e[_0x50564b(0x262)]('\x0a');}export async function getErConfig(_0x24a928,_0x53a83b){const _0x4c5e8f=a197_0x3ede,_0x863211=await apiRequest('/smartapi/question/er-config',{'method':_0x4c5e8f(0x25e),'body':{'appCode':_0x24a928,'dblinkId':_0x53a83b},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x863211[_0x4c5e8f(0x213)];}export async function getErRelationDetail(_0x3f3eac,_0x41ba98){const _0x102953=a197_0x3ede,_0x2da7d6=new URLSearchParams({'appCode':_0x3f3eac,'relationId':String(_0x41ba98)});try{const _0xd6fd94=await apiRequest(_0x102953(0x29d)+_0x2da7d6[_0x102953(0x1ef)]());return _0xd6fd94[_0x102953(0x213)]?.['relation']??null;}catch(_0x53608d){if(_0x53608d instanceof CliError&&_0x53608d[_0x102953(0x258)]===_0x102953(0x234)&&(_0x53608d[_0x102953(0x29b)]?.['includes'](_0x102953(0x216))||_0x53608d[_0x102953(0x29b)]===_0x102953(0x257)&&_0x53608d[_0x102953(0x279)]===_0x102953(0x249)))return null;throw _0x53608d;}}export async function createErRelation(_0x2c6519){const _0x15b42f=a197_0x3ede,_0xef3d7e=await apiRequest(_0x15b42f(0x217),{'method':_0x15b42f(0x25e),'body':_0x2c6519,'allowNonJsonSuccess':!![]});return _0xef3d7e[_0x15b42f(0x213)];}export async function updateErRelation(_0x1982b8){const _0x509865=a197_0x3ede,_0x4df73a=await apiRequest(_0x509865(0x20b),{'method':'POST','body':_0x1982b8,'allowNonJsonSuccess':!![]});return _0x4df73a['data'];}export async function deleteErRelation(_0x297eb8){const _0x3e3ca7=a197_0x3ede,_0x38b0d3=await apiRequest(_0x3e3ca7(0x209),{'method':_0x3e3ca7(0x25e),'body':_0x297eb8,'allowNonJsonSuccess':!![]});return _0x38b0d3['data'];}export async function updateErBusinessGroup(_0x9765c1){const _0x59fa34=a197_0x3ede,_0x3b5d69=await apiRequest(_0x59fa34(0x20a),{'method':_0x59fa34(0x25e),'body':_0x9765c1,'allowNonJsonSuccess':!![]});return _0x3b5d69[_0x59fa34(0x213)];}function buildQuery(_0x2e4f04){const _0x3da9a6=a197_0x3ede,_0x3184db=new URLSearchParams();for(const [_0x40de9d,_0x43b2ae]of Object[_0x3da9a6(0x2b1)](_0x2e4f04)){if(_0x43b2ae===undefined||_0x43b2ae==='')continue;_0x3184db[_0x3da9a6(0x20d)](_0x40de9d,String(_0x43b2ae));}const _0x278d86=_0x3184db[_0x3da9a6(0x1ef)]();return _0x278d86?'?'+_0x278d86:'';}export async function listNotificationChannelConfigs(_0x3b323e,_0x3817e){const _0x14595a=a197_0x3ede,_0x159ca8=await apiRequest('/notification/channel-config/list'+buildQuery({'appCode':_0x3b323e,'channelType':_0x3817e}));return Array[_0x14595a(0x2b9)](_0x159ca8[_0x14595a(0x213)])?_0x159ca8['data']:[];}export async function listAppConfigs(_0x5709f3,_0x3fd97d){const _0x6591ea=a197_0x3ede,_0x143f91=await apiRequest(_0x6591ea(0x2aa),{'method':'POST','body':{'appCode':_0x5709f3,..._0x3fd97d?.['key']?{'key':_0x3fd97d['key']}:{},..._0x3fd97d?.[_0x6591ea(0x201)]?{'tags':_0x3fd97d[_0x6591ea(0x201)]}:{}}});return extractAppConfigList(_0x143f91[_0x6591ea(0x213)]);}export async function getAppConfigByKey(_0x236b2a,_0xfbbcc9){const _0x46907e=a197_0x3ede,_0x648ca1=await apiRequest(_0x46907e(0x229)+buildQuery({'appCode':_0x236b2a,'key':_0xfbbcc9}));return _0x648ca1[_0x46907e(0x213)]??null;}export async function createAppConfig(_0x1b4fed){const _0x5dc950=a197_0x3ede,_0x440ec2=await apiRequest(_0x5dc950(0x2a8),{'method':_0x5dc950(0x25e),'body':{'appCode':_0x1b4fed[_0x5dc950(0x286)],'key':_0x1b4fed[_0x5dc950(0x232)],'value':_0x1b4fed[_0x5dc950(0x226)],..._0x1b4fed[_0x5dc950(0x201)]?{'tags':_0x1b4fed[_0x5dc950(0x201)]}:{}}});return _0x440ec2[_0x5dc950(0x213)];}export async function updateAppConfig(_0x4b6930){const _0x7c9042=a197_0x3ede;await apiRequest('/smartapi/app-config/update',{'method':_0x7c9042(0x25e),'body':{'id':_0x4b6930['id'],'appCode':_0x4b6930[_0x7c9042(0x286)],'key':_0x4b6930[_0x7c9042(0x232)],'value':_0x4b6930['value'],..._0x4b6930[_0x7c9042(0x201)]?{'tags':_0x4b6930[_0x7c9042(0x201)]}:{}}});}export async function deleteAppConfig(_0x2bb5c2){await apiRequest('/smartapi/app-config/delete',{'method':'POST','body':_0x2bb5c2});}function extractAppConfigList(_0x118608){const _0x21a94f=a197_0x3ede;if(Array['isArray'](_0x118608))return _0x118608;if(_0x118608&&typeof _0x118608===_0x21a94f(0x225)&&Array[_0x21a94f(0x2b9)](_0x118608[_0x21a94f(0x260)]))return _0x118608[_0x21a94f(0x260)];return extractList(_0x118608);}export async function listDbLinks(_0x4042e1,_0x26b0c6){const _0x2b2ca0=a197_0x3ede,_0x127f22=await apiRequest(_0x2b2ca0(0x273),{'method':_0x2b2ca0(0x25e),'body':{'appCode':_0x4042e1,'currentPage':_0x26b0c6?.[_0x2b2ca0(0x24b)]??0x1,'pageSize':_0x26b0c6?.['pageSize']??0x64}});return{'items':extractList(_0x127f22[_0x2b2ca0(0x213)]),'paging':extractPaging(_0x127f22[_0x2b2ca0(0x213)])};}export async function getDbLinkInfo(_0xf4a5f7){const _0x456be0=a197_0x3ede,_0xb59a9e=await apiRequest(_0x456be0(0x282)+buildQuery({'id':_0xf4a5f7}));return _0xb59a9e[_0x456be0(0x213)];}export async function createDbLink(_0x44bd38){const _0x565e33=a197_0x3ede,_0x5d2543=await apiRequest('/smartapi/dblink/create',{'method':_0x565e33(0x25e),'body':_0x44bd38});return _0x5d2543[_0x565e33(0x213)];}export async function updateDbLink(_0x43ac0d){const _0x58f181=a197_0x3ede,_0x4f4a08=await apiRequest(_0x58f181(0x212),{'method':_0x58f181(0x25e),'body':_0x43ac0d});return _0x4f4a08[_0x58f181(0x213)];}export async function deleteDbLink(_0x55bdbb){const _0x379626=a197_0x3ede;await apiRequest(_0x379626(0x26e),{'method':'POST','body':{'id':_0x55bdbb}});}export async function testDbLinkConnect(_0x38e06c){const _0x392320=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x38e06c}));return _0x392320['data'];}export async function startDbAnalysis(_0x375e0c,_0x524fae){const _0x160951=a197_0x3ede,_0x47eea=await apiRequest('/smartapi/db-analysis/start',{'method':'POST','body':{'dbLinkId':_0x375e0c,..._0x524fae&&_0x524fae[_0x160951(0x221)]>0x0?{'tableNames':_0x524fae}:{}}});return _0x47eea[_0x160951(0x213)];}export async function cancelDbAnalysis(_0x23aa18){const _0x366010=a197_0x3ede;await apiRequest(_0x366010(0x259)+buildQuery({'planId':_0x23aa18}),{'method':_0x366010(0x25e)});}export async function getDbAnalysisStatus(_0x2c0202){const _0x4bd9f6=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x2c0202));return _0x4bd9f6['data'];}export async function getDbAllTableList(_0x482294,_0x2bf1c9){const _0x1767fb=a197_0x3ede,_0x1f9594=await apiRequest(_0x1767fb(0x289)+buildQuery({'appCode':_0x482294,'dbLinkId':_0x2bf1c9})),_0x4e830b=_0x1f9594['data'];if(Array[_0x1767fb(0x2b9)](_0x4e830b))return _0x4e830b;return extractList(_0x4e830b);}export async function getDbTableDiff(_0x245186,_0x84061,_0x46971a){const _0x5e1d11=a197_0x3ede,_0x55d711=await apiRequest(_0x5e1d11(0x278)+buildQuery({'appCode':_0x245186,'dbLinkId':_0x84061,'pageIndex':_0x46971a?.[_0x5e1d11(0x290)]??0x1,'pageSize':_0x46971a?.[_0x5e1d11(0x224)]??0x14,'tableName':_0x46971a?.[_0x5e1d11(0x252)]})),_0x7f065e=_0x55d711['data'];return{'totalCount':_0x7f065e?.[_0x5e1d11(0x271)]??0x0,'physicalTableCount':_0x7f065e?.['physicalTableCount']??0x0,'datasetTableCount':_0x7f065e?.[_0x5e1d11(0x22c)]??0x0,..._0x7f065e?.[_0x5e1d11(0x22e)]?{'summary':_0x7f065e[_0x5e1d11(0x22e)]}:{},'tableList':Array[_0x5e1d11(0x2b9)](_0x7f065e?.['tableList'])?_0x7f065e[_0x5e1d11(0x25a)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x32461a=a197_0x3ede,_0x248666=await apiRequest('/smartapi/app/getList',{'method':_0x32461a(0x25e),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x31c586=extractList(_0x248666['data']),_0x4e19eb=extractPaging(_0x248666[_0x32461a(0x213)]);return _0x4e19eb&&_0x4e19eb[_0x32461a(0x271)]>REMOTE_APP_PAGE_SIZE&&console[_0x32461a(0x275)](_0x32461a(0x219)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x4e19eb[_0x32461a(0x271)]+_0x32461a(0x2b6)+_0x32461a(0x25d)),_0x31c586;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x1674bd,_0x3223e7){const _0x4012bd=a197_0x3ede,_0x31c4fc=Math[_0x4012bd(0x2a6)](Math['max'](_0x3223e7?.['pageSize']??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x3beff3=await apiRequest(_0x4012bd(0x205),{'method':_0x4012bd(0x25e),'body':{'appCode':_0x1674bd,'currentPage':_0x3223e7?.[_0x4012bd(0x24b)]??0x1,'pageSize':_0x31c4fc}});return{'items':extractList(_0x3beff3[_0x4012bd(0x213)]),'paging':extractPaging(_0x3beff3['data'])};}export async function getAppRole(_0x3fc3a9){const _0x9826c2=a197_0x3ede,_0x18fdd2=await apiRequest(_0x9826c2(0x2a1)+buildQuery({'id':_0x3fc3a9}));return _0x18fdd2[_0x9826c2(0x213)];}export async function createAppRole(_0x521c6e){const _0xe06a8e=a197_0x3ede,_0x564197=await apiRequest('/smartapi/permit/role/create',{'method':_0xe06a8e(0x25e),'body':{'appCode':_0x521c6e[_0xe06a8e(0x286)],'roleName':_0x521c6e['roleName'],'roleType':'CUSTOM',..._0x521c6e[_0xe06a8e(0x1f8)]?{'remark':_0x521c6e[_0xe06a8e(0x1f8)]}:{}}});return _0x564197['data'];}export async function updateAppRole(_0x40a70e){const _0x437115=a197_0x3ede,_0x25dbf1=await apiRequest(_0x437115(0x1da),{'method':_0x437115(0x25e),'body':{'id':_0x40a70e['id'],'appCode':_0x40a70e[_0x437115(0x286)],..._0x40a70e[_0x437115(0x1fc)]?{'roleType':_0x40a70e[_0x437115(0x1fc)]}:{},..._0x40a70e[_0x437115(0x263)]!==undefined?{'roleName':_0x40a70e[_0x437115(0x263)]}:{},..._0x40a70e['remark']!==undefined?{'remark':_0x40a70e[_0x437115(0x1f8)]}:{},..._0x40a70e['permits']?{'permits':_0x40a70e[_0x437115(0x1e5)]}:{}}});return _0x25dbf1['data'];}export async function deleteAppRole(_0x15ea92){const _0x222815=a197_0x3ede;await apiRequest(_0x222815(0x231),{'method':_0x222815(0x25e),'body':{'id':_0x15ea92}});}export async function listPermitRoles(_0xbb1f09,_0x6d74b3){const _0x3b0320=a197_0x3ede,_0x56ddac=await apiRequest(_0x3b0320(0x204),{'method':'POST','body':{'appCode':_0xbb1f09,..._0x6d74b3?.[_0x3b0320(0x26f)]!==undefined?{'needSelf':_0x6d74b3[_0x3b0320(0x26f)]}:{},..._0x6d74b3?.['needPublic']!==undefined?{'needPublic':_0x6d74b3[_0x3b0320(0x22a)]}:{}}});return extractList(_0x56ddac[_0x3b0320(0x213)]);}export async function getRoleMenuResources(_0x2de035,_0x2044fd){const _0x246c99=a197_0x3ede,_0xa2da92=await apiRequest(_0x246c99(0x1db),{'method':'POST','body':{'appCode':_0x2de035,'roleId':_0x2044fd}});return extractList(_0xa2da92[_0x246c99(0x213)]);}export async function getRoleApiResources(_0x33dcea,_0x48fc7d){const _0x22e16d=a197_0x3ede,_0x4d0e27=await apiRequest('/smartapi/permit/resource/get-api-list',{'method':_0x22e16d(0x25e),'body':{'appCode':_0x33dcea,'roleId':_0x48fc7d}});return extractList(_0x4d0e27[_0x22e16d(0x213)]);}function a197_0x3ede(_0x23b676,_0x4edfc9){_0x23b676=_0x23b676-0x1da;const _0x8c4898=a197_0x8c48();let _0x3ede9c=_0x8c4898[_0x23b676];return _0x3ede9c;}export async function listRoleUsers(_0x2d29f1){const _0x351b18=a197_0x3ede,_0x591497=await apiRequest('/smartapi/permit/user-role/get-user-list',{'method':_0x351b18(0x25e),'body':{'appCode':_0x2d29f1}});return extractList(_0x591497[_0x351b18(0x213)]);}export async function updateRoleUsers(_0xd88b2e,_0xd0bd1d){const _0x4f2bd8=a197_0x3ede;await apiRequest('/smartapi/permit/user-role/update-user-list',{'method':_0x4f2bd8(0x25e),'body':{'appCode':_0xd88b2e,'roleList':_0xd0bd1d}});}export async function getPagePermit(_0x1a0507){const _0x384df6=a197_0x3ede,_0x335ee3=await apiRequest(_0x384df6(0x1dd)+buildQuery({'menuId':_0x1a0507}));return _0x335ee3[_0x384df6(0x213)];}export async function savePagePermit(_0x28c579){const _0x24f8a3=a197_0x3ede,_0x5b5182=await apiRequest(_0x24f8a3(0x2ac),{'method':_0x24f8a3(0x25e),'body':_0x28c579});return _0x5b5182[_0x24f8a3(0x213)];}export async function getTenantMembers(_0x3bfa76){const _0x4e2e7a=a197_0x3ede,_0x53af19=await apiRequest(_0x4e2e7a(0x23c)+buildQuery({'code':_0x3bfa76})),_0x582529=_0x53af19[_0x4e2e7a(0x213)]??{},_0x27ee75=Array[_0x4e2e7a(0x2b9)](_0x582529?.[_0x4e2e7a(0x243)])?_0x582529[_0x4e2e7a(0x243)]:[];return _0x27ee75['filter'](_0x1530c0=>_0x1530c0?.['status']===_0x4e2e7a(0x230)||_0x1530c0?.[_0x4e2e7a(0x2ab)]===undefined)[_0x4e2e7a(0x281)](_0x464698=>({'userId':Number(_0x464698[_0x4e2e7a(0x1e3)]??_0x464698['id']),'username':_0x464698['username'],'nickname':_0x464698['nickname'],'status':_0x464698[_0x4e2e7a(0x2ab)],'email':_0x464698[_0x4e2e7a(0x277)],'mobile':_0x464698[_0x4e2e7a(0x2bb)],'avatar':_0x464698[_0x4e2e7a(0x242)]}))[_0x4e2e7a(0x1e1)](_0x231b63=>Number[_0x4e2e7a(0x215)](_0x231b63[_0x4e2e7a(0x1e3)])&&_0x231b63[_0x4e2e7a(0x1e3)]>0x0);}
|
|
1
|
+
(function(_0x5ab5c4,_0x5b730f){const _0x10d01e=a197_0x5bbb,_0x4b1325=_0x5ab5c4();while(!![]){try{const _0x558448=-parseInt(_0x10d01e(0x1c1))/0x1*(-parseInt(_0x10d01e(0x23c))/0x2)+-parseInt(_0x10d01e(0x1c5))/0x3*(-parseInt(_0x10d01e(0x187))/0x4)+parseInt(_0x10d01e(0x216))/0x5+-parseInt(_0x10d01e(0x188))/0x6*(-parseInt(_0x10d01e(0x1c0))/0x7)+-parseInt(_0x10d01e(0x1ce))/0x8*(parseInt(_0x10d01e(0x24d))/0x9)+parseInt(_0x10d01e(0x1aa))/0xa+-parseInt(_0x10d01e(0x208))/0xb;if(_0x558448===_0x5b730f)break;else _0x4b1325['push'](_0x4b1325['shift']());}catch(_0x266360){_0x4b1325['push'](_0x4b1325['shift']());}}}(a197_0x47ae,0xd0d95));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(_0x450a23){_activeCookie=_0x450a23||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x536f6e,_0x6a2c60){const _0x4098f1=a197_0x5bbb,_0x3500b4=_0x6a2c60 instanceof Error?_0x6a2c60[_0x4098f1(0x169)]:String(_0x6a2c60);return CliErrors[_0x4098f1(0x18a)](_0x4098f1(0x1d6)+_0x536f6e+(_0x3500b4?'\x20('+_0x3500b4+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x350bfe,_0x39ec13={}){const _0x3d2165=a197_0x5bbb,{method:method=_0x3d2165(0x207),body:_0x4ca006,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x39ec13,_0x108192=useRuntime?getRuntimeDomain():getApiDomain(),_0x289de0=_activeCookie||getCookie(),_0x19b6c2=''+_0x108192+_0x350bfe,_0x11cb92=new AbortController(),_0x22f7fe=setTimeout(()=>_0x11cb92[_0x3d2165(0x18d)](),timeout);try{const _0x41a849=await fetch(_0x19b6c2,{'method':method,'headers':{'Content-Type':_0x3d2165(0x1e5),'Cookie':_0x289de0,'X-Invoke-Source':_0x3d2165(0x201),...headers},'body':_0x4ca006?JSON[_0x3d2165(0x172)](_0x4ca006):undefined,'signal':_0x11cb92[_0x3d2165(0x249)]});let _0x43af3a;try{_0x43af3a=await _0x41a849[_0x3d2165(0x21f)]();}catch(_0x502cd8){if(_0x502cd8 instanceof Error&&_0x502cd8[_0x3d2165(0x1ca)]===_0x3d2165(0x195))throw CliErrors[_0x3d2165(0x18a)]('Request\x20timeout:\x20'+_0x19b6c2);if(_0x41a849['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x3d2165(0x18a)](_0x3d2165(0x1f6)+_0x41a849['status']+')',_0x41a849[_0x3d2165(0x186)]>=0x190?_0x3d2165(0x170):undefined);}if(!_0x41a849['ok']||_0x43af3a[_0x3d2165(0x1cd)]===![])throw CliErrors[_0x3d2165(0x18a)](_0x43af3a[_0x3d2165(0x1bd)]||_0x43af3a[_0x3d2165(0x169)]||'API\x20error:\x20'+_0x41a849['status'],_0x43af3a[_0x3d2165(0x1ac)]?_0x3d2165(0x1a4)+_0x43af3a[_0x3d2165(0x1ac)]:undefined);return _0x43af3a;}catch(_0x2ce62c){if(_0x2ce62c instanceof CliError)throw _0x2ce62c;if(_0x2ce62c instanceof Error&&_0x2ce62c[_0x3d2165(0x1ca)]===_0x3d2165(0x195))throw CliErrors['apiError'](_0x3d2165(0x1da)+_0x19b6c2);throw createFetchFailureError(_0x19b6c2,_0x2ce62c);}finally{clearTimeout(_0x22f7fe);}}async function apiFormRequest(_0x27ec29,_0x133631,_0x576e8b={}){const _0x28a732=a197_0x5bbb,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x576e8b,_0x1546b9=_activeCookie||getCookie(),_0x674537=''+getApiDomain()+_0x27ec29,_0x5d7c52=new AbortController(),_0x483cf4=setTimeout(()=>_0x5d7c52[_0x28a732(0x18d)](),timeout);try{const _0x2e823d=await fetch(_0x674537,{'method':'POST','headers':{'Cookie':_0x1546b9,'X-Invoke-Source':_0x28a732(0x201)},'body':_0x133631,'signal':_0x5d7c52[_0x28a732(0x249)]});let _0xb8f029;try{_0xb8f029=await _0x2e823d[_0x28a732(0x21f)]();}catch(_0x12df97){if(_0x12df97 instanceof Error&&_0x12df97[_0x28a732(0x1ca)]===_0x28a732(0x195))throw CliErrors['apiError'](_0x28a732(0x1da)+_0x674537);throw CliErrors[_0x28a732(0x18a)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x2e823d[_0x28a732(0x186)]+')',_0x2e823d[_0x28a732(0x186)]>=0x190?_0x28a732(0x170):undefined);}if(!_0x2e823d['ok']||_0xb8f029[_0x28a732(0x1cd)]===![])throw CliErrors[_0x28a732(0x18a)](_0xb8f029[_0x28a732(0x1bd)]||_0xb8f029[_0x28a732(0x169)]||_0x28a732(0x1e9)+_0x2e823d[_0x28a732(0x186)],_0xb8f029[_0x28a732(0x1ac)]?_0x28a732(0x1a4)+_0xb8f029[_0x28a732(0x1ac)]:undefined);return _0xb8f029;}catch(_0x33bd68){if(_0x33bd68 instanceof CliError)throw _0x33bd68;if(_0x33bd68 instanceof Error&&_0x33bd68['name']===_0x28a732(0x195))throw CliErrors[_0x28a732(0x18a)](_0x28a732(0x1da)+_0x674537);throw createFetchFailureError(_0x674537,_0x33bd68);}finally{clearTimeout(_0x483cf4);}}export async function uploadDevelopmentFile(_0x41134a,_0x32ae36){const _0x2a7efc=a197_0x5bbb,_0x494e86=await readFile(_0x32ae36),_0x5e1f95=new FormData();_0x5e1f95[_0x2a7efc(0x1b0)](_0x2a7efc(0x1e4),_0x41134a),_0x5e1f95[_0x2a7efc(0x1b0)](_0x2a7efc(0x16a),new Blob([new Uint8Array(_0x494e86)]),basename(_0x32ae36));const _0x354fed=await apiFormRequest(_0x2a7efc(0x21e),_0x5e1f95);return _0x354fed[_0x2a7efc(0x1ef)];}export async function queryDevelopmentFileUrl(_0x2448b1,_0x1b3455={}){const _0x2a7ced=a197_0x5bbb,_0x248307=await apiRequest(_0x2a7ced(0x1de),{'method':'POST','body':{'filePath':_0x2448b1,'downloadFlag':_0x1b3455[_0x2a7ced(0x247)]??![],..._0x1b3455[_0x2a7ced(0x24e)]?{'longTerm':!![]}:{}}});return _0x248307[_0x2a7ced(0x1ef)];}function isAuthFailure(_0x37d38f){const _0x257154=a197_0x5bbb,_0x2d28d0=_0x37d38f['errorMsg']||_0x37d38f[_0x257154(0x169)]||_0x37d38f[_0x257154(0x1ef)]?.['message']||_0x37d38f['errorMessage']||_0x37d38f[_0x257154(0x241)]||'';return _0x37d38f[_0x257154(0x1ac)]===_0x257154(0x22a)||_0x37d38f[_0x257154(0x168)]===0x191||_0x37d38f[_0x257154(0x168)]===_0x257154(0x22d)||_0x2d28d0[_0x257154(0x1f3)](_0x257154(0x22d))||_0x2d28d0[_0x257154(0x1f3)](_0x257154(0x245))||_0x2d28d0[_0x257154(0x1f3)]('登录')||_0x2d28d0[_0x257154(0x1f3)]('认证');}export async function platformFetch(_0x374c65,_0xfe58dd){const _0xcd150d=a197_0x5bbb;let _0x5429f3;try{_0x5429f3=await fetch(_0x374c65,{'method':_0xfe58dd['method']??_0xcd150d(0x207),'headers':{'Content-Type':_0xcd150d(0x1e5),'Cookie':_0xfe58dd[_0xcd150d(0x22f)],'X-Invoke-Source':_0xcd150d(0x201)},..._0xfe58dd[_0xcd150d(0x21c)]&&{'body':JSON[_0xcd150d(0x172)](_0xfe58dd[_0xcd150d(0x21c)])}});}catch(_0x2e6a66){throw createFetchFailureError(_0x374c65,_0x2e6a66);}if(!_0x5429f3['ok']){if(_0x5429f3[_0xcd150d(0x186)]===0x191)throw CliErrors[_0xcd150d(0x19f)]();throw CliErrors[_0xcd150d(0x18a)](_0xfe58dd[_0xcd150d(0x1b7)]+_0xcd150d(0x1a2)+_0x5429f3[_0xcd150d(0x186)]);}const _0x56971d=await _0x5429f3[_0xcd150d(0x21f)]();if(_0x56971d[_0xcd150d(0x1cd)]===![]){if(isAuthFailure(_0x56971d))throw CliErrors[_0xcd150d(0x19f)]();throw CliErrors['apiError'](_0x56971d[_0xcd150d(0x1bd)]||_0x56971d[_0xcd150d(0x169)]||_0xfe58dd[_0xcd150d(0x1b7)]+_0xcd150d(0x243));}return _0x56971d[_0xcd150d(0x1ef)];}function a197_0x5bbb(_0xf2dc4d,_0x264234){_0xf2dc4d=_0xf2dc4d-0x165;const _0x47ae95=a197_0x47ae();let _0x5bbb58=_0x47ae95[_0xf2dc4d];return _0x5bbb58;}export async function platformRequest(_0x5b9c0a,_0x43cb65){const _0x5838c8=a197_0x5bbb;if(/^https?:\/\//i[_0x5838c8(0x16d)](_0x5b9c0a))throw CliErrors[_0x5838c8(0x203)](_0x5838c8(0x1fd)+_0x5b9c0a,_0x5838c8(0x1cf));const _0x2cb21c=_0x5b9c0a['startsWith']('/')?_0x5b9c0a:'/'+_0x5b9c0a;return platformFetch(''+getApiDomain()+_0x2cb21c,_0x43cb65);}function cleanNewlines(_0x4fd30c){const _0xb4afc1=a197_0x5bbb;return _0x4fd30c['replace'](/[\r\n]+/g,'\x20')[_0xb4afc1(0x189)]();}function cleanDatasetName(_0x40d275){const _0x3cea53=a197_0x5bbb;if(!_0x40d275['name'])return _0x40d275;return{..._0x40d275,'name':cleanNewlines(_0x40d275[_0x3cea53(0x1ca)])};}export async function fetchModelList(_0x16a1b8,_0xeda044){const _0x3fcb08=a197_0x5bbb,_0x308698=getEnv(),_0x563261=new URLSearchParams({'appcode':_0x16a1b8,'otype':'array'}),_0x44f286='/api/node-toolbox/dataset/model-list?'+_0x563261[_0x3fcb08(0x202)]();logger['info'](_0x3fcb08(0x1bb),_0x3fcb08(0x239)+_0x308698+')',{'apiPath':_0x44f286});const _0x5bc09c=await platformRequest(_0x44f286,{'cookie':_0xeda044,'label':_0x3fcb08(0x23e)}),_0x4538c4=(_0x5bc09c[_0x3fcb08(0x1c9)]??[])[_0x3fcb08(0x1fb)](cleanDatasetName);return{'configArray':_0x4538c4,'count':_0x4538c4[_0x3fcb08(0x1f2)]};}export async function fetchDatasetDoc(_0x4c45da){const _0x29e687=a197_0x5bbb,{appCode:_0x84a8fc,cookie:_0x50211e,datasetCode:_0x12596e,datasetId:_0x496381,extraParams:_0x4d934a}=_0x4c45da,_0x404bc8=await platformRequest('/api/node-toolbox/api-doc-generator',{'method':_0x29e687(0x1ec),'body':{'appCode':_0x84a8fc,'datasetCode':_0x12596e,'datasetId':_0x496381,..._0x4d934a||{}},'cookie':_0x50211e,'label':_0x29e687(0x171)+_0x12596e+')'});if(!_0x404bc8||typeof _0x404bc8['markdown']!==_0x29e687(0x223))throw new Error('Invalid\x20response\x20format\x20('+_0x12596e+_0x29e687(0x16f));return _0x404bc8[_0x29e687(0x1c3)];}export async function getMenuTree(_0x13a4e8,_0x38c003){const _0x12c19d=a197_0x5bbb,_0x44c852=new URLSearchParams({'appCode':_0x13a4e8});return platformRequest(_0x12c19d(0x23a)+_0x44c852['toString'](),{'cookie':_0x38c003,'label':'Fetch\x20menu\x20list'});}export async function createMenuRecord(_0x282cf7,_0x1f62b3,_0x3a07cd){const _0x519574=a197_0x5bbb;return platformRequest(_0x519574(0x19e),{'method':'POST','body':_0x282cf7,'cookie':_0x1f62b3,'label':_0x3a07cd});}export async function updateMenuRecord(_0x390c76,_0x184668,_0x5d402a){const _0x46b399=a197_0x5bbb;return platformRequest(_0x46b399(0x20f),{'method':_0x46b399(0x1ec),'body':_0x390c76,'cookie':_0x184668,'label':_0x5d402a});}export async function deleteMenuRecord(_0x3f2792,_0x2aaa23,_0x8875eb){const _0x279336=a197_0x5bbb;return platformRequest(_0x279336(0x20e),{'method':'POST','body':{'id':_0x3f2792},'cookie':_0x2aaa23,'label':_0x8875eb});}export async function batchDeleteMenuRecords(_0x462370,_0x2226d9,_0x3ce2df){const _0x421a3e=a197_0x5bbb;return platformRequest(_0x421a3e(0x1f1),{'method':_0x421a3e(0x1ec),'body':{'idList':_0x462370},'cookie':_0x2226d9,'label':_0x3ce2df});}export async function startMenuRegroup(_0x312f15,_0x16c3ee,_0x5d9c3a){return platformRequest('/smartapi/menu/regroup',{'method':'POST','body':_0x312f15,'cookie':_0x16c3ee,'label':_0x5d9c3a});}export async function getAsyncTaskStatus(_0x5a3dcf,_0x207d02,_0x664ac3){const _0x46e7c8=a197_0x5bbb,_0x153d1f=new URLSearchParams({'appCode':_0x207d02});return platformRequest(_0x46e7c8(0x222)+encodeURIComponent(_0x5a3dcf)+'?'+_0x153d1f[_0x46e7c8(0x202)](),{'cookie':_0x664ac3,'label':_0x46e7c8(0x246)+_0x5a3dcf});}export async function listBffScripts(_0x3c7cd7,_0x8ae362,_0xa5f264){const _0x47fb0b=a197_0x5bbb;let _0x15f479=_0x47fb0b(0x1ae)+_0x3c7cd7;if(_0x8ae362)_0x15f479+=_0x47fb0b(0x23d)+_0x8ae362;const _0x1971bc=await apiRequest(_0x15f479);let _0x235044=extractList(_0x1971bc[_0x47fb0b(0x1ef)]);if(_0xa5f264?.['scriptName']){const _0x10175b=_0xa5f264[_0x47fb0b(0x234)][_0x47fb0b(0x1cc)]();_0x235044=_0x235044[_0x47fb0b(0x237)](_0x3f13fc=>_0x3f13fc[_0x47fb0b(0x233)]?.[_0x47fb0b(0x1cc)]()['includes'](_0x10175b)||_0x3f13fc[_0x47fb0b(0x20a)]?.[_0x47fb0b(0x1cc)]()['includes'](_0x10175b));}return _0x235044;}export async function getBffScriptInfo(_0x2152c4){const _0x70bcf0=a197_0x5bbb,_0x50e412=await apiRequest(_0x70bcf0(0x1ee)+_0x2152c4);if(!_0x50e412[_0x70bcf0(0x1ef)])throw CliErrors[_0x70bcf0(0x203)]('BFF\x20script\x20not\x20found:\x20id='+_0x2152c4);return _0x50e412[_0x70bcf0(0x1ef)];}export async function saveBffScript(_0x3f5965){const _0x55e51b=a197_0x5bbb,_0x4c0fde=await apiRequest(_0x55e51b(0x173),{'method':_0x55e51b(0x1ec),'body':_0x3f5965}),{id:_0x2001fd,entity:_0x329065}=normalizeEntityWithIdResponse(_0x4c0fde[_0x55e51b(0x1ef)]);if(_0x2001fd!==undefined){const _0x32b1fe=typeof _0x329065[_0x55e51b(0x233)]===_0x55e51b(0x223)||typeof _0x329065['scriptType']===_0x55e51b(0x223)?_0x329065:undefined;return{'id':_0x2001fd,'script':_0x32b1fe};}throw CliErrors[_0x55e51b(0x18a)](_0x55e51b(0x228));}export async function deleteBffScript(_0x248145){const _0x5b9b48=a197_0x5bbb;await apiRequest(_0x5b9b48(0x1ea),{'method':_0x5b9b48(0x1ec),'body':{'id':_0x248145}});}function a197_0x47ae(){const _0x2b95e9=['roleName','needSelf','/smartapi/permit/role/update','tags','9465990uQtuNs','const\x20data\x20=\x20await\x20client.sql.execute({','errorCode','operations','/api/management/library/scripts/list?appCode=','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','append','dbId','.filter({','/smartapi/permit/role/delete','/smartapi/custom/getUserCustomSql?id=','Operation\x20\x22','key','label','/smartapi/lovrabet/dataset/','isArray','/smartapi/app-config/getByKey','fetch-model-list','ENABLE','errorMsg','const\x20results\x20=\x20data.execResult\x20||\x20[];','/smartapi/dataset/text-generate/preview','7TLyyVD','1491209bkbDSr','username','markdown','/smartapi/dataset/get-dataset-list','4843941CMbTKg','set','//\x20SQL:\x20','permits','configArray','name','/smartapi/dblink/create','toLowerCase','success','8qMRfCu','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','\x20\x20sqlCode:\x20\x27','physicalTableCount','/smartapi/permit/page/get-one','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','requirementDescription','\x20\x20currentPage:\x201,','Request\x20failed:\x20','\x20\x20return\x20rows;','/smartapi/app/getList','/smartapi/dataset/get-dataset-operation','Request\x20timeout:\x20','DATA_NOT_EXIST','/smartapi/db-analysis/start','.getOne(id);','/smartapi/common/queryFileUrl','/smartapi/app-config/create','userTenantRelationList','/smartapi/permit/page/save','join','/smartapi/db-analysis/status/','appCode','application/json','currentPage','\x20\x20});','tableList','API\x20error:\x20','/api/management/library/scripts/delete','/api/','POST','SQL\x20query\x20not\x20found:\x20','/api/management/library/scripts/info?id=','data','value','/smartapi/menu/batchDelete','length','includes','list','find','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/dblink/getOne','/smartapi/custom/saveUserCustomSql','relation','map','/smartapi/dblink/testConnect','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','\x20apps.\x20','object','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','cli:rabetbase','toString','validation','warn','max','/smartapi/custom/queryUserCustomSqlList','GET','44782881EWrZCl','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','description','/smartapi/dataset/delete-dataset','enabled','delete','/smartapi/menu/delete','/smartapi/menu/update','/smartapi/dblink/update','/smartapi/permit/user-role/get-user-list','/smartapi/dblink/delete','/smartapi/lovrabet/update-page','/smartapi/dataset/restore-dataset','version','4296000BWDgue','\x22\x20not\x20found\x20in\x20dataset\x20','/smartapi/question/er-config/cli/erCreate','tableName','isFinite','nickname','body','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','/smartapi/common/uploadFile','json','Page\x20not\x20found:\x20','remark','/smartapi/tasks/','string','needPublic','sqlCode','totalCount','/notification/channel-config/list','BFF\x20save\x20returned\x20no\x20valid\x20id','/generate-standard-pages/status?','UNAUTHORIZED','has','deleted','401','clientOperationId','cookie','.remove(id);','avatar','/smartapi/question/er-config/business-group/edit','functionName','scriptName','summary','/smartapi/custom/deleteUserCustomSql','filter','/smartapi/db-analysis/jobs/cancel','正在从服务器拉取模型列表...\x20(环境:\x20','/smartapi/menu/find?','operationId','2sxEknx','&type=','Fetch\x20datasets','dbtableConfig','/smartapi/dblink/getTableDiffV2ByPage','error','/api/management/library/scripts/statistics?appCode=','\x20failed','\x20of\x20','Unauthorized','Fetch\x20async\x20task\x20','download','responseFields','signal','/smartapi/dataset/text-generate/status?','entries','/smartapi/permit/role/get-permit-list','12688146qOVDvV','longTerm','userId','/filter','/sync-to-pages','code','message','file','requestFields','remove','test','ER\x20relation\x20does\x20not\x20exist','):\x20missing\x20data.markdown\x20field','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','Fetch\x20doc\x20(','stringify','/api/management/library/scripts/save','API\x20error\x20code:\x20306','//\x20','/smartapi/dblink/getAllTableList','\x20\x20pageSize:\x2020,','hint','target','/smartapi/question/er-config/cli/update-single','const\x20result\x20=\x20await\x20client.models.','getOne','?sqlCode=','/smartapi/question/er-config/cli/delete-single','/smartapi/app-config/delete','/smartapi/permit/resource/get-api-list','api_error','Warning:\x20showing\x20first\x20','/smartapi/dataset/update-driven-data','pageSize','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','status','4zUUlBz','8548530XLEphE','trim','apiError','});','/smartapi/permit/role/get-one','abort','tableData','includeImports','displayName','/api/custom/executeSql','create','operationName','push','AbortError','dataset_','table','min','modelId','modelCode','CUSTOM','sqlName','datasetName','/smartapi/menu/create','authRequired','datasetTableCount','replace','\x20failed,\x20HTTP\x20','(/*\x20params\x20*/);','API\x20error\x20code:\x20','Dataset\x20not\x20found:\x20'];a197_0x47ae=function(){return _0x2b95e9;};return a197_0x47ae();}export async function getBffScriptStatistics(_0x545248){const _0x430a78=a197_0x5bbb,_0x286fe4=await apiRequest(_0x430a78(0x242)+_0x545248);return extractList(_0x286fe4[_0x430a78(0x1ef)]);}export async function clearBffScriptCache(){const _0x3ed70f=a197_0x5bbb,_0x10e6d2=await apiRequest('/api/management/script/cache/clear',{'method':_0x3ed70f(0x1ec),'useRuntime':!![]});return typeof _0x10e6d2[_0x3ed70f(0x1ef)]===_0x3ed70f(0x223)?_0x10e6d2['data']:'';}export async function listBffDatasetOperations(_0x5ab5c5,_0x5eb3df){const _0x279d91=a197_0x5bbb,_0x4db196=await apiRequest(_0x279d91(0x1d9),{'method':_0x279d91(0x1ec),'body':{'appCode':_0x5ab5c5,'datasetId':_0x5eb3df}});return _0x4db196[_0x279d91(0x1ef)];}export async function listSqlQueries(_0xc53e7b,_0x508164){const _0x72eebf=a197_0x5bbb,_0x5ac5fb=await apiRequest(_0x72eebf(0x206),{'method':'POST','body':{'appCode':_0xc53e7b,'currentPage':_0x508164?.[_0x72eebf(0x1e6)]??0x1,'pageSize':_0x508164?.[_0x72eebf(0x184)]??0x32,'sqlCode':_0x508164?.[_0x72eebf(0x225)],'sqlName':_0x508164?.[_0x72eebf(0x19c)]}});return _0x5ac5fb[_0x72eebf(0x1ef)];}export async function getSqlQueryInfo(_0x43dfde,_0x532320){const _0x2969c8=a197_0x5bbb,_0xdbc388=await listSqlQueries(_0x43dfde,{'sqlCode':_0x532320}),_0x11cc96=_0xdbc388['tableData']?.[0x0];if(!_0x11cc96)throw CliErrors['validation'](_0x2969c8(0x1ed)+_0x532320);return _0x11cc96;}export async function getSqlQueryDetail(_0x5712f2){const _0x4c1582=a197_0x5bbb,_0x135c69=await apiRequest('/smartapi/custom/getUserCustomSql'+(_0x4c1582(0x17d)+encodeURIComponent(_0x5712f2)));if(!_0x135c69[_0x4c1582(0x1ef)])throw CliErrors[_0x4c1582(0x203)](_0x4c1582(0x1ed)+_0x5712f2);return _0x135c69['data'];}export async function getSqlQueryDetailById(_0x5e3357){const _0x528152=a197_0x5bbb,_0x3f7456=await apiRequest(_0x528152(0x1b4)+_0x5e3357);if(!_0x3f7456['data'])throw CliErrors[_0x528152(0x203)]('SQL\x20query\x20not\x20found:\x20id='+_0x5e3357);return _0x3f7456[_0x528152(0x1ef)];}export async function createSqlQuery(_0x39b8b4){const _0x3e0afe=a197_0x5bbb,_0x575d5b=await apiRequest(_0x3e0afe(0x1f9),{'method':_0x3e0afe(0x1ec),'body':_0x39b8b4}),{id:_0x552e9,entity:_0x4fb7bd}=normalizeEntityWithIdResponse(_0x575d5b['data']);if(!(_0x3e0afe(0x225)in _0x4fb7bd)&&_0x552e9)return getSqlQueryDetailById(_0x552e9);return normalizeSqlQueryEntity(_0x4fb7bd);}export async function updateSqlQuery(_0x42a636){const _0x381532=a197_0x5bbb,_0x273e6a=await apiRequest('/smartapi/custom/updateUserCustomSql',{'method':_0x381532(0x1ec),'body':_0x42a636}),{id:_0x10be0d,entity:_0x1229b0}=normalizeEntityWithIdResponse(_0x273e6a['data']);if(!('sqlCode'in _0x1229b0)){if(_0x42a636[_0x381532(0x225)])return getSqlQueryDetail(_0x42a636[_0x381532(0x225)]);if(_0x10be0d)return getSqlQueryDetailById(_0x10be0d);}return normalizeSqlQueryEntity(_0x1229b0);}export async function deleteSqlQuery(_0x5adeac){const _0x4096c0=a197_0x5bbb;await apiRequest(_0x4096c0(0x236),{'method':_0x4096c0(0x1ec),'body':_0x5adeac});}export async function saveSqlQuery(_0x570dcc){const _0x2d9852=a197_0x5bbb,_0x1b23ea=await apiRequest('/api/node-toolbox/sql/save',{'method':_0x2d9852(0x1ec),'body':_0x570dcc});return _0x1b23ea[_0x2d9852(0x1ef)];}function normalizeSqlQueryEntity(_0x1a5767){const _0x10380a=a197_0x5bbb;return{..._0x1a5767,'id':Number(_0x1a5767['id']),'dbId':_0x1a5767['dbId']==null?undefined:Number(_0x1a5767[_0x10380a(0x1b1)]),'version':_0x1a5767['version']==null?undefined:Number(_0x1a5767[_0x10380a(0x215)])};}export async function executeSql(_0x646e41,_0x3e78a7,_0xf8697){const _0x5f086f=a197_0x5bbb,_0x2e71d9=await apiRequest(_0x5f086f(0x191),{'method':_0x5f086f(0x1ec),'body':{'appCode':_0x646e41,'sqlCode':_0x3e78a7,..._0xf8697&&{'params':_0xf8697}},'useRuntime':!![]});return _0x2e71d9['data'];}export async function executeDatasetDataOperation(_0x9753a,_0x4039a7,_0x1c89a2,_0x3b1a67={}){const _0x6a769d=a197_0x5bbb;try{const _0x2b5123=await apiRequest('/api/'+_0x9753a+'/'+_0x4039a7+'/'+_0x1c89a2,{'method':'POST','body':_0x3b1a67,'useRuntime':!![]});return _0x2b5123['data'];}catch(_0xf4c624){if(_0x1c89a2===_0x6a769d(0x17c)&&_0xf4c624 instanceof CliError&&_0xf4c624['code']==='api_error'&&_0x3b1a67['id']!==undefined&&_0x3b1a67['id']!==null&&_0x3b1a67['id']!==''){const _0x3fc574=await apiRequest(_0x6a769d(0x1eb)+_0x9753a+'/'+_0x4039a7+_0x6a769d(0x166),{'method':'POST','body':{'where':{'id':{'$eq':_0x3b1a67['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x1d755f=Array[_0x6a769d(0x1b9)](_0x3fc574[_0x6a769d(0x1ef)]?.[_0x6a769d(0x18e)])?_0x3fc574[_0x6a769d(0x1ef)][_0x6a769d(0x18e)]:[];return _0x1d755f[0x0]??null;}throw _0xf4c624;}}export async function listDatasets(_0x4d1e00,_0x21633e){const _0x241d79=a197_0x5bbb,_0x329c54={'appCode':_0x4d1e00,'deleted':_0x21633e?.[_0x241d79(0x22c)]??![]};if(_0x21633e?.[_0x241d79(0x168)])_0x329c54[_0x241d79(0x168)]=_0x21633e['code'];if(_0x21633e?.[_0x241d79(0x1ca)])_0x329c54['name']=_0x21633e[_0x241d79(0x1ca)];const _0x1640c1=await apiRequest(_0x241d79(0x1c4),{'method':_0x241d79(0x1ec),'body':_0x329c54});return extractList(_0x1640c1[_0x241d79(0x1ef)]);}export async function deleteDataset(_0x48c678,_0xbb4d73){const _0x156504=a197_0x5bbb;await apiRequest(_0x156504(0x20b),{'method':_0x156504(0x1ec),'body':{'appCode':_0x48c678,'datasetId':_0xbb4d73}});}export async function restoreDataset(_0x5e048b,_0x1bb126){const _0x3db57d=a197_0x5bbb;await apiRequest(_0x3db57d(0x214),{'method':'POST','body':{'appCode':_0x5e048b,'datasetId':_0x1bb126}});}export async function previewTextGeneratedDataset(_0x5e2c18,_0x400be2){const _0x50ed83=a197_0x5bbb,_0x1f893f=await apiRequest(_0x50ed83(0x1bf),{'method':_0x50ed83(0x1ec),'body':{'appCode':_0x5e2c18,'datasetName':_0x400be2[_0x50ed83(0x19d)],'requirementDescription':_0x400be2[_0x50ed83(0x1d4)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x1f893f[_0x50ed83(0x1ef)];}export async function startTextGeneratedDataset(_0x56eb11,_0x4ca5fd,_0x31df0e){const _0x1cf7fa=a197_0x5bbb,_0x5db664=await apiRequest('/smartapi/dataset/text-generate/start',{'method':'POST','body':{'appCode':_0x56eb11,..._0x31df0e?.[_0x1cf7fa(0x22e)]?{'clientOperationId':_0x31df0e[_0x1cf7fa(0x22e)]}:{},'design':_0x4ca5fd},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5db664[_0x1cf7fa(0x1ef)];}export async function getTextGeneratedDatasetStatus(_0x4f02ff,_0x583990){const _0xb9c1fd=a197_0x5bbb,_0x167cec=new URLSearchParams({'appCode':_0x4f02ff});_0x583990[_0xb9c1fd(0x23b)]&&_0x167cec[_0xb9c1fd(0x1c6)](_0xb9c1fd(0x23b),_0x583990[_0xb9c1fd(0x23b)]);_0x583990[_0xb9c1fd(0x22e)]&&_0x167cec[_0xb9c1fd(0x1c6)]('clientOperationId',_0x583990['clientOperationId']);const _0x56a378=await apiRequest(_0xb9c1fd(0x24a)+_0x167cec[_0xb9c1fd(0x202)]());return _0x56a378[_0xb9c1fd(0x1ef)];}export async function searchDatasets(_0x4ee543,_0x1ccbc0){const _0x576b22=a197_0x5bbb,_0x21bc4d=await listDatasets(_0x4ee543,{'name':_0x1ccbc0}),_0x4fad04=_0x1ccbc0[_0x576b22(0x1cc)](),_0x48c0b0=new Set(_0x21bc4d[_0x576b22(0x1fb)](_0x3634b2=>_0x3634b2['id'])),_0x134793=_0x21bc4d[_0x576b22(0x237)](_0x328169=>_0x328169[_0x576b22(0x23f)]?.['tableName']?.['toLowerCase']()[_0x576b22(0x1f3)](_0x4fad04)||_0x328169[_0x576b22(0x20a)]?.[_0x576b22(0x1cc)]()['includes'](_0x4fad04)),_0x539192=await listDatasets(_0x4ee543,{'code':_0x1ccbc0});for(const _0x45c65d of _0x539192){!_0x48c0b0[_0x576b22(0x22b)](_0x45c65d['id'])&&(_0x21bc4d[_0x576b22(0x194)](_0x45c65d),_0x48c0b0['add'](_0x45c65d['id']));}return _0x21bc4d;}export function normalizeDatasetOperations(_0x497579){const _0x500974=a197_0x5bbb;if(Array[_0x500974(0x1b9)](_0x497579))return _0x497579[_0x500974(0x237)](_0x2fab00=>_0x2fab00!=null&&typeof _0x2fab00===_0x500974(0x1ff));if(_0x497579&&typeof _0x497579==='object')return Object[_0x500974(0x24b)](_0x497579)[_0x500974(0x237)](([,_0x16b4d3])=>_0x16b4d3!=null&&typeof _0x16b4d3===_0x500974(0x1ff))['map'](([_0x3b9ead,_0x2d0222])=>({..._0x2d0222,'name':_0x2d0222[_0x500974(0x1ca)]??_0x2d0222[_0x500974(0x193)]??_0x3b9ead}));return[];}export async function getDatasetDetail(_0x3a2cb5){const _0x4ff7bb=a197_0x5bbb,_0x47ce18=/^\d+$/['test'](_0x3a2cb5)?'id':_0x4ff7bb(0x168),_0x4918fd=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x47ce18+'='+_0x3a2cb5);return _0x4918fd[_0x4ff7bb(0x1ef)];}export async function updateDrivenData(_0x1b25c0){const _0x56197e=a197_0x5bbb,_0x31028e=await apiRequest(_0x56197e(0x183),{'method':_0x56197e(0x1ec),'body':_0x1b25c0});return _0x31028e[_0x56197e(0x1ef)];}export async function getDatasetOperations(_0xbb3b84){const _0x4f7f52=a197_0x5bbb,_0x252ae0=await getDatasetDetail(_0xbb3b84),_0xaa62fb=normalizeDatasetOperations(_0x252ae0[_0x4f7f52(0x1ad)])[_0x4f7f52(0x1fb)](_0x457754=>({'name':_0x457754['name']||_0x457754[_0x4f7f52(0x193)],'displayName':_0x457754[_0x4f7f52(0x190)]||_0x457754['name'],'type':_0x457754['type'],'method':_0x457754['method'],'path':_0x457754['path'],'enabled':_0x457754[_0x4f7f52(0x20c)]??!![],'requestFields':_0x457754[_0x4f7f52(0x16b)],'responseFields':_0x457754[_0x4f7f52(0x248)]}));return{'dataset':{'id':_0x252ae0['id']??_0x252ae0[_0x4f7f52(0x199)],'name':_0x252ae0[_0x4f7f52(0x1ca)],'code':_0x252ae0[_0x4f7f52(0x168)]||_0x252ae0[_0x4f7f52(0x19a)],'tableName':_0x252ae0[_0x4f7f52(0x219)]||_0x252ae0[_0x4f7f52(0x23f)]?.[_0x4f7f52(0x219)]},'operations':_0xaa62fb};}export async function getOperationDetail(_0x50fc15,_0x5c0037,_0x5200c9){const _0x13c2a5=a197_0x5bbb;let _0x4d41c5=_0x5c0037;if(!/^\d+$/[_0x13c2a5(0x16d)](_0x5c0037)){const _0x27adb3=await listDatasets(_0x50fc15,{'code':_0x5c0037}),_0x3fa2fa=_0x27adb3['find'](_0x100acc=>_0x100acc['code']===_0x5c0037||String(_0x100acc['id'])===_0x5c0037);if(!_0x3fa2fa)throw CliErrors[_0x13c2a5(0x203)](_0x13c2a5(0x1a5)+_0x5c0037);_0x4d41c5=String(_0x3fa2fa['id']);}const _0x552fcd=await getDatasetDetail(_0x4d41c5),_0x4c2292=normalizeDatasetOperations(_0x552fcd['operations'])[_0x13c2a5(0x1f5)](_0x2f3e33=>(_0x2f3e33[_0x13c2a5(0x1ca)]||_0x2f3e33['operationName'])===_0x5200c9);if(!_0x4c2292)throw CliErrors[_0x13c2a5(0x203)](_0x13c2a5(0x1b5)+_0x5200c9+_0x13c2a5(0x217)+_0x5c0037);return{'dataset':{'id':_0x552fcd['id']??_0x552fcd['modelId'],'name':_0x552fcd['name'],'code':_0x552fcd[_0x13c2a5(0x168)]||_0x552fcd['modelCode'],'tableName':_0x552fcd[_0x13c2a5(0x219)]||_0x552fcd[_0x13c2a5(0x23f)]?.[_0x13c2a5(0x219)]},'operation':_0x4c2292};}export async function startGenerateStandardPages(_0x1e56b7,_0x3dfb3a,_0xc695ce){const _0xdd79bc=a197_0x5bbb,_0x1b3d78=await apiRequest(_0xdd79bc(0x1b8)+_0x3dfb3a+'/generate-standard-pages/start',{'method':_0xdd79bc(0x1ec),'body':{'appCode':_0x1e56b7,..._0xc695ce?.['clientOperationId']?{'clientOperationId':_0xc695ce[_0xdd79bc(0x22e)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x1b3d78[_0xdd79bc(0x1ef)];}export async function getGenerateStandardPagesStatus(_0x24eca2,_0xda3d9c,_0x4b6943){const _0x5585e0=a197_0x5bbb,_0x20b135=new URLSearchParams({'appCode':_0x24eca2});_0x4b6943[_0x5585e0(0x23b)]&&_0x20b135[_0x5585e0(0x1c6)]('operationId',_0x4b6943['operationId']);_0x4b6943[_0x5585e0(0x22e)]&&_0x20b135[_0x5585e0(0x1c6)](_0x5585e0(0x22e),_0x4b6943[_0x5585e0(0x22e)]);const _0x33eb4f=await apiRequest(_0x5585e0(0x1b8)+_0xda3d9c+_0x5585e0(0x229)+_0x20b135[_0x5585e0(0x202)]());return _0x33eb4f[_0x5585e0(0x1ef)];}export async function getStandardPageStatus(_0x25ae13,_0x3ccac2){const _0x16d5ad=a197_0x5bbb,_0x4bb5e3=await apiRequest(_0x16d5ad(0x1b8)+_0x3ccac2+'/standard-page-status?appCode='+encodeURIComponent(_0x25ae13));return _0x4bb5e3[_0x16d5ad(0x1ef)];}export async function tryGetStandardPageStatus(_0x564f0d,_0x2bc3b2){const _0x109100=a197_0x5bbb;try{return await getStandardPageStatus(_0x564f0d,_0x2bc3b2);}catch(_0x2d3630){if(_0x2d3630 instanceof CliError&&_0x2d3630[_0x109100(0x168)]===_0x109100(0x181)&&/404|not found|non-json response/i['test'](_0x2d3630[_0x109100(0x169)]))return null;throw _0x2d3630;}}export async function syncStandardPages(_0x356d8f,_0x54b583){const _0x22d275=a197_0x5bbb,_0x960db0=await apiRequest(_0x22d275(0x1b8)+_0x54b583+_0x22d275(0x167),{'method':_0x22d275(0x1ec),'body':{'appCode':_0x356d8f}});return _0x960db0[_0x22d275(0x1ef)];}export async function getPageDetail(_0x3f27a2){const _0x13efd5=a197_0x5bbb,_0x508201=await apiRequest('/smartapi/lovrabet/detail?pageId='+_0x3f27a2);if(!_0x508201[_0x13efd5(0x1ef)])throw CliErrors['validation'](_0x13efd5(0x220)+_0x3f27a2);return _0x508201[_0x13efd5(0x1ef)];}export async function updatePage(_0x4931a6,_0x287c88,_0x242f4d,_0x139d39){const _0x25afe1=a197_0x5bbb,_0x15f447=await apiRequest(_0x25afe1(0x213),{'method':_0x25afe1(0x1ec),'body':{'appCode':_0x4931a6,'pageId':_0x287c88,'code':_0x242f4d,'datasetIds':_0x139d39}});return _0x15f447['data'];}export function generateSdkCode(_0x5a7626,_0x284037,_0x483d48){const _0x4fc71b=a197_0x5bbb,_0x31ff62=_0x483d48?.[_0x4fc71b(0x18f)]??!![],_0x1680ec=_0x4fc71b(0x196)+_0x5a7626[_0x4fc71b(0x168)]?.[_0x4fc71b(0x1a1)](/-/g,'_'),_0x37719c=_0x284037[_0x4fc71b(0x1ca)]||_0x284037[_0x4fc71b(0x193)]||_0x4fc71b(0x237),_0x452493=[];_0x31ff62&&_0x452493[_0x4fc71b(0x194)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x4fc71b(0x1d3),'');_0x452493[_0x4fc71b(0x194)](_0x4fc71b(0x175)+_0x5a7626[_0x4fc71b(0x1ca)]+'\x20('+(_0x5a7626[_0x4fc71b(0x219)]||_0x4fc71b(0x197))+')');if(_0x37719c===_0x4fc71b(0x237))_0x452493[_0x4fc71b(0x194)](_0x4fc71b(0x17b)+_0x1680ec+_0x4fc71b(0x1b2),'\x20\x20where:\x20{},',_0x4fc71b(0x177),_0x4fc71b(0x1d5),_0x4fc71b(0x18b));else{if(_0x37719c===_0x4fc71b(0x17c))_0x452493[_0x4fc71b(0x194)](_0x4fc71b(0x17b)+_0x1680ec+_0x4fc71b(0x1dd));else{if(_0x37719c===_0x4fc71b(0x192))_0x452493[_0x4fc71b(0x194)]('const\x20result\x20=\x20await\x20client.models.'+_0x1680ec+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x37719c==='update')_0x452493[_0x4fc71b(0x194)]('const\x20result\x20=\x20await\x20client.models.'+_0x1680ec+_0x4fc71b(0x209));else _0x37719c===_0x4fc71b(0x20d)||_0x37719c===_0x4fc71b(0x16c)?_0x452493[_0x4fc71b(0x194)](_0x4fc71b(0x17b)+_0x1680ec+_0x4fc71b(0x230)):_0x452493[_0x4fc71b(0x194)]('const\x20result\x20=\x20await\x20client.models.'+_0x1680ec+'.'+_0x37719c+_0x4fc71b(0x1a3));}}}return _0x452493[_0x4fc71b(0x1e2)]('\x0a');}export function generateSqlCodeTemplate(_0xa55b94,_0x492579){const _0x14c4d4=a197_0x5bbb,_0x4ba472=_0x492579?.[_0x14c4d4(0x179)]??'sdk',_0x7ed42c=_0x492579?.[_0x14c4d4(0x18f)]??!![],_0x4b5df8=[];return _0x4b5df8[_0x14c4d4(0x194)](_0x14c4d4(0x1c7)+_0xa55b94[_0x14c4d4(0x19c)]+'\x20('+_0xa55b94[_0x14c4d4(0x225)]+')'),_0x4ba472==='sdk'?(_0x7ed42c&&_0x4b5df8[_0x14c4d4(0x194)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x14c4d4(0x1d3),''),_0x4b5df8[_0x14c4d4(0x194)](_0x14c4d4(0x1ab),_0x14c4d4(0x1d0)+_0xa55b94[_0x14c4d4(0x225)]+'\x27,',_0x14c4d4(0x1f7),_0x14c4d4(0x18b),_0x14c4d4(0x185),_0x14c4d4(0x1be))):_0x4b5df8[_0x14c4d4(0x194)]('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly',_0x14c4d4(0x1af),_0x14c4d4(0x21d),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0xa55b94[_0x14c4d4(0x225)]+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x14c4d4(0x1e7),_0x14c4d4(0x1d7),'}'),_0x4b5df8[_0x14c4d4(0x1e2)]('\x0a');}export async function getErConfig(_0x409e29,_0x2d4756){const _0x470877=a197_0x5bbb,_0x31e32f=await apiRequest('/smartapi/question/er-config',{'method':_0x470877(0x1ec),'body':{'appCode':_0x409e29,'dblinkId':_0x2d4756},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x31e32f[_0x470877(0x1ef)];}export async function getErRelationDetail(_0x4101ec,_0x313756){const _0x2e3def=a197_0x5bbb,_0x3d0719=new URLSearchParams({'appCode':_0x4101ec,'relationId':String(_0x313756)});try{const _0x608c96=await apiRequest('/smartapi/question/er-config/cli/detail?'+_0x3d0719[_0x2e3def(0x202)]());return _0x608c96['data']?.[_0x2e3def(0x1fa)]??null;}catch(_0x4edfe2){if(_0x4edfe2 instanceof CliError&&_0x4edfe2[_0x2e3def(0x168)]===_0x2e3def(0x181)&&(_0x4edfe2['hint']?.[_0x2e3def(0x1f3)](_0x2e3def(0x1db))||_0x4edfe2[_0x2e3def(0x178)]===_0x2e3def(0x174)&&_0x4edfe2[_0x2e3def(0x169)]===_0x2e3def(0x16e)))return null;throw _0x4edfe2;}}export async function createErRelation(_0x492cf2){const _0x58ead5=a197_0x5bbb,_0x3b527a=await apiRequest(_0x58ead5(0x218),{'method':'POST','body':_0x492cf2,'allowNonJsonSuccess':!![]});return _0x3b527a['data'];}export async function updateErRelation(_0x433bbc){const _0x1d70f0=a197_0x5bbb,_0x4460fb=await apiRequest(_0x1d70f0(0x17a),{'method':'POST','body':_0x433bbc,'allowNonJsonSuccess':!![]});return _0x4460fb[_0x1d70f0(0x1ef)];}export async function deleteErRelation(_0xbdab2c){const _0x46bb23=a197_0x5bbb,_0x21f46a=await apiRequest(_0x46bb23(0x17e),{'method':'POST','body':_0xbdab2c,'allowNonJsonSuccess':!![]});return _0x21f46a[_0x46bb23(0x1ef)];}export async function updateErBusinessGroup(_0x33cced){const _0xc9bcef=a197_0x5bbb,_0x140f49=await apiRequest(_0xc9bcef(0x232),{'method':_0xc9bcef(0x1ec),'body':_0x33cced,'allowNonJsonSuccess':!![]});return _0x140f49[_0xc9bcef(0x1ef)];}function buildQuery(_0x778852){const _0x2aeb47=a197_0x5bbb,_0x325ce9=new URLSearchParams();for(const [_0x3fa6d4,_0x21cd3a]of Object[_0x2aeb47(0x24b)](_0x778852)){if(_0x21cd3a===undefined||_0x21cd3a==='')continue;_0x325ce9[_0x2aeb47(0x1c6)](_0x3fa6d4,String(_0x21cd3a));}const _0x1ee56b=_0x325ce9['toString']();return _0x1ee56b?'?'+_0x1ee56b:'';}export async function listNotificationChannelConfigs(_0x479cd1,_0x48e821){const _0x3d0421=a197_0x5bbb,_0x31d9bf=await apiRequest(_0x3d0421(0x227)+buildQuery({'appCode':_0x479cd1,'channelType':_0x48e821}));return Array['isArray'](_0x31d9bf['data'])?_0x31d9bf['data']:[];}export async function listAppConfigs(_0x2f5ed7,_0x11074f){const _0x168a0d=a197_0x5bbb,_0x3883a2=await apiRequest('/smartapi/app-config/list',{'method':_0x168a0d(0x1ec),'body':{'appCode':_0x2f5ed7,..._0x11074f?.['key']?{'key':_0x11074f[_0x168a0d(0x1b6)]}:{},..._0x11074f?.[_0x168a0d(0x1a9)]?{'tags':_0x11074f[_0x168a0d(0x1a9)]}:{}}});return extractAppConfigList(_0x3883a2[_0x168a0d(0x1ef)]);}export async function getAppConfigByKey(_0x48a214,_0x42791a){const _0x1d594e=a197_0x5bbb,_0xbc98df=await apiRequest(_0x1d594e(0x1ba)+buildQuery({'appCode':_0x48a214,'key':_0x42791a}));return _0xbc98df[_0x1d594e(0x1ef)]??null;}export async function createAppConfig(_0x49718e){const _0xcad6e3=a197_0x5bbb,_0x950022=await apiRequest(_0xcad6e3(0x1df),{'method':_0xcad6e3(0x1ec),'body':{'appCode':_0x49718e['appCode'],'key':_0x49718e[_0xcad6e3(0x1b6)],'value':_0x49718e[_0xcad6e3(0x1f0)],..._0x49718e['tags']?{'tags':_0x49718e['tags']}:{}}});return _0x950022[_0xcad6e3(0x1ef)];}export async function updateAppConfig(_0x3d4a87){const _0x2e7e7a=a197_0x5bbb;await apiRequest('/smartapi/app-config/update',{'method':_0x2e7e7a(0x1ec),'body':{'id':_0x3d4a87['id'],'appCode':_0x3d4a87[_0x2e7e7a(0x1e4)],'key':_0x3d4a87[_0x2e7e7a(0x1b6)],'value':_0x3d4a87[_0x2e7e7a(0x1f0)],..._0x3d4a87[_0x2e7e7a(0x1a9)]?{'tags':_0x3d4a87[_0x2e7e7a(0x1a9)]}:{}}});}export async function deleteAppConfig(_0x1d3054){const _0x43459e=a197_0x5bbb;await apiRequest(_0x43459e(0x17f),{'method':_0x43459e(0x1ec),'body':_0x1d3054});}function extractAppConfigList(_0xb4bf42){const _0x44801c=a197_0x5bbb;if(Array['isArray'](_0xb4bf42))return _0xb4bf42;if(_0xb4bf42&&typeof _0xb4bf42==='object'&&Array[_0x44801c(0x1b9)](_0xb4bf42[_0x44801c(0x1f4)]))return _0xb4bf42[_0x44801c(0x1f4)];return extractList(_0xb4bf42);}export async function listDbLinks(_0x57a27f,_0x62af32){const _0x5e9aa6=a197_0x5bbb,_0x16e3b2=await apiRequest('/smartapi/dblink/getList',{'method':_0x5e9aa6(0x1ec),'body':{'appCode':_0x57a27f,'currentPage':_0x62af32?.['currentPage']??0x1,'pageSize':_0x62af32?.[_0x5e9aa6(0x184)]??0x64}});return{'items':extractList(_0x16e3b2['data']),'paging':extractPaging(_0x16e3b2[_0x5e9aa6(0x1ef)])};}export async function getDbLinkInfo(_0x58b8dd){const _0x500c23=a197_0x5bbb,_0x3ce4d2=await apiRequest(_0x500c23(0x1f8)+buildQuery({'id':_0x58b8dd}));return _0x3ce4d2[_0x500c23(0x1ef)];}export async function createDbLink(_0x209b5d){const _0x1b2741=a197_0x5bbb,_0x2d6ff6=await apiRequest(_0x1b2741(0x1cb),{'method':_0x1b2741(0x1ec),'body':_0x209b5d});return _0x2d6ff6[_0x1b2741(0x1ef)];}export async function updateDbLink(_0x840f6d){const _0x108ae1=a197_0x5bbb,_0x3b0a15=await apiRequest(_0x108ae1(0x210),{'method':_0x108ae1(0x1ec),'body':_0x840f6d});return _0x3b0a15[_0x108ae1(0x1ef)];}export async function deleteDbLink(_0x4318f6){const _0x2db96e=a197_0x5bbb;await apiRequest(_0x2db96e(0x212),{'method':_0x2db96e(0x1ec),'body':{'id':_0x4318f6}});}export async function testDbLinkConnect(_0x47ce47){const _0x4ca56c=a197_0x5bbb,_0x2a5487=await apiRequest(_0x4ca56c(0x1fc)+buildQuery({'id':_0x47ce47}));return _0x2a5487[_0x4ca56c(0x1ef)];}export async function startDbAnalysis(_0x478b36,_0x5d652d){const _0x55bd30=a197_0x5bbb,_0xc8f7=await apiRequest(_0x55bd30(0x1dc),{'method':'POST','body':{'dbLinkId':_0x478b36,..._0x5d652d&&_0x5d652d[_0x55bd30(0x1f2)]>0x0?{'tableNames':_0x5d652d}:{}}});return _0xc8f7[_0x55bd30(0x1ef)];}export async function cancelDbAnalysis(_0x2f57aa){const _0x46198=a197_0x5bbb;await apiRequest(_0x46198(0x238)+buildQuery({'planId':_0x2f57aa}),{'method':_0x46198(0x1ec)});}export async function getDbAnalysisStatus(_0xe888b6){const _0x4a898e=a197_0x5bbb,_0x394fe5=await apiRequest(_0x4a898e(0x1e3)+encodeURIComponent(_0xe888b6));return _0x394fe5[_0x4a898e(0x1ef)];}export async function getDbAllTableList(_0x2d03a,_0x161483){const _0x1c49e7=a197_0x5bbb,_0x51dec2=await apiRequest(_0x1c49e7(0x176)+buildQuery({'appCode':_0x2d03a,'dbLinkId':_0x161483})),_0x3e0ad1=_0x51dec2['data'];if(Array[_0x1c49e7(0x1b9)](_0x3e0ad1))return _0x3e0ad1;return extractList(_0x3e0ad1);}export async function getDbTableDiff(_0x5c258a,_0x29e1e8,_0x4f22a4){const _0x30b7c7=a197_0x5bbb,_0x5e27c9=await apiRequest(_0x30b7c7(0x240)+buildQuery({'appCode':_0x5c258a,'dbLinkId':_0x29e1e8,'pageIndex':_0x4f22a4?.['pageIndex']??0x1,'pageSize':_0x4f22a4?.['pageSize']??0x14,'tableName':_0x4f22a4?.[_0x30b7c7(0x219)]})),_0x3ce5cd=_0x5e27c9[_0x30b7c7(0x1ef)];return{'totalCount':_0x3ce5cd?.['totalCount']??0x0,'physicalTableCount':_0x3ce5cd?.[_0x30b7c7(0x1d1)]??0x0,'datasetTableCount':_0x3ce5cd?.[_0x30b7c7(0x1a0)]??0x0,..._0x3ce5cd?.[_0x30b7c7(0x235)]?{'summary':_0x3ce5cd[_0x30b7c7(0x235)]}:{},'tableList':Array[_0x30b7c7(0x1b9)](_0x3ce5cd?.['tableList'])?_0x3ce5cd[_0x30b7c7(0x1e8)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x29233a=a197_0x5bbb,_0x1dd71f=await apiRequest(_0x29233a(0x1d8),{'method':_0x29233a(0x1ec),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x1d4171=extractList(_0x1dd71f[_0x29233a(0x1ef)]),_0x160bf1=extractPaging(_0x1dd71f[_0x29233a(0x1ef)]);return _0x160bf1&&_0x160bf1['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x29233a(0x204)](_0x29233a(0x182)+REMOTE_APP_PAGE_SIZE+_0x29233a(0x244)+_0x160bf1[_0x29233a(0x226)]+_0x29233a(0x1fe)+_0x29233a(0x200)),_0x1d4171;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x2c5efd,_0x1d8f7e){const _0x3e3969=a197_0x5bbb,_0x442eda=Math[_0x3e3969(0x198)](Math[_0x3e3969(0x205)](_0x1d8f7e?.[_0x3e3969(0x184)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x441d98=await apiRequest('/smartapi/permit/role/get-list',{'method':_0x3e3969(0x1ec),'body':{'appCode':_0x2c5efd,'currentPage':_0x1d8f7e?.[_0x3e3969(0x1e6)]??0x1,'pageSize':_0x442eda}});return{'items':extractList(_0x441d98[_0x3e3969(0x1ef)]),'paging':extractPaging(_0x441d98['data'])};}export async function getAppRole(_0x247085){const _0x2a47c9=a197_0x5bbb,_0x19dc5a=await apiRequest(_0x2a47c9(0x18c)+buildQuery({'id':_0x247085}));return _0x19dc5a[_0x2a47c9(0x1ef)];}export async function createAppRole(_0x436c6e){const _0x2b44c6=a197_0x5bbb,_0x18cfef=await apiRequest('/smartapi/permit/role/create',{'method':_0x2b44c6(0x1ec),'body':{'appCode':_0x436c6e[_0x2b44c6(0x1e4)],'roleName':_0x436c6e[_0x2b44c6(0x1a6)],'roleType':_0x2b44c6(0x19b),..._0x436c6e[_0x2b44c6(0x221)]?{'remark':_0x436c6e[_0x2b44c6(0x221)]}:{}}});return _0x18cfef[_0x2b44c6(0x1ef)];}export async function updateAppRole(_0xf8d291){const _0xdc3569=a197_0x5bbb,_0x38e89d=await apiRequest(_0xdc3569(0x1a8),{'method':'POST','body':{'id':_0xf8d291['id'],'appCode':_0xf8d291[_0xdc3569(0x1e4)],..._0xf8d291['roleType']?{'roleType':_0xf8d291['roleType']}:{},..._0xf8d291['roleName']!==undefined?{'roleName':_0xf8d291[_0xdc3569(0x1a6)]}:{},..._0xf8d291['remark']!==undefined?{'remark':_0xf8d291[_0xdc3569(0x221)]}:{},..._0xf8d291['permits']?{'permits':_0xf8d291[_0xdc3569(0x1c8)]}:{}}});return _0x38e89d['data'];}export async function deleteAppRole(_0x202f61){const _0x3e2e91=a197_0x5bbb;await apiRequest(_0x3e2e91(0x1b3),{'method':'POST','body':{'id':_0x202f61}});}export async function listPermitRoles(_0x266908,_0x3657bc){const _0xcdb959=a197_0x5bbb,_0x3e7d47=await apiRequest(_0xcdb959(0x24c),{'method':_0xcdb959(0x1ec),'body':{'appCode':_0x266908,..._0x3657bc?.[_0xcdb959(0x1a7)]!==undefined?{'needSelf':_0x3657bc[_0xcdb959(0x1a7)]}:{},..._0x3657bc?.[_0xcdb959(0x224)]!==undefined?{'needPublic':_0x3657bc[_0xcdb959(0x224)]}:{}}});return extractList(_0x3e7d47['data']);}export async function getRoleMenuResources(_0x3b8dc4,_0x43d71f){const _0x15850a=a197_0x5bbb,_0x362172=await apiRequest('/smartapi/permit/resource/get-menu-list',{'method':_0x15850a(0x1ec),'body':{'appCode':_0x3b8dc4,'roleId':_0x43d71f}});return extractList(_0x362172['data']);}export async function getRoleApiResources(_0x428ed3,_0x461bfd){const _0x5d8acb=a197_0x5bbb,_0x2f25fe=await apiRequest(_0x5d8acb(0x180),{'method':'POST','body':{'appCode':_0x428ed3,'roleId':_0x461bfd}});return extractList(_0x2f25fe['data']);}export async function listRoleUsers(_0x551e16){const _0x27e276=a197_0x5bbb,_0x58c208=await apiRequest(_0x27e276(0x211),{'method':_0x27e276(0x1ec),'body':{'appCode':_0x551e16}});return extractList(_0x58c208[_0x27e276(0x1ef)]);}export async function updateRoleUsers(_0x3af755,_0x421564){const _0x4fc4cd=a197_0x5bbb;await apiRequest('/smartapi/permit/user-role/update-user-list',{'method':_0x4fc4cd(0x1ec),'body':{'appCode':_0x3af755,'roleList':_0x421564}});}export async function getPagePermit(_0x1f280e){const _0x1459c8=a197_0x5bbb,_0x43f61e=await apiRequest(_0x1459c8(0x1d2)+buildQuery({'menuId':_0x1f280e}));return _0x43f61e['data'];}export async function savePagePermit(_0x2a8de5){const _0x2567d0=a197_0x5bbb,_0x89d873=await apiRequest(_0x2567d0(0x1e1),{'method':_0x2567d0(0x1ec),'body':_0x2a8de5});return _0x89d873[_0x2567d0(0x1ef)];}export async function getTenantMembers(_0x4a695a){const _0x2255b7=a197_0x5bbb,_0x4c7164=await apiRequest('/userTenant/getByTenantCode'+buildQuery({'code':_0x4a695a})),_0xea670e=_0x4c7164[_0x2255b7(0x1ef)]??{},_0x280b97=Array[_0x2255b7(0x1b9)](_0xea670e?.['userTenantRelationList'])?_0xea670e[_0x2255b7(0x1e0)]:[];return _0x280b97[_0x2255b7(0x237)](_0x2622a6=>_0x2622a6?.[_0x2255b7(0x186)]===_0x2255b7(0x1bc)||_0x2622a6?.['status']===undefined)[_0x2255b7(0x1fb)](_0x37c2d3=>({'userId':Number(_0x37c2d3['userId']??_0x37c2d3['id']),'username':_0x37c2d3[_0x2255b7(0x1c2)],'nickname':_0x37c2d3[_0x2255b7(0x21b)],'status':_0x37c2d3[_0x2255b7(0x186)],'email':_0x37c2d3['email'],'mobile':_0x37c2d3['mobile'],'avatar':_0x37c2d3[_0x2255b7(0x231)]}))[_0x2255b7(0x237)](_0xe444cc=>Number[_0x2255b7(0x21a)](_0xe444cc[_0x2255b7(0x165)])&&_0xe444cc['userId']>0x0);}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a198_0x51555a=a198_0x1050;(function(_0x42e475,_0x4bdd9b){const _0x3b20c3=a198_0x1050,_0x577542=_0x42e475();while(!![]){try{const _0x5efc1f=parseInt(_0x3b20c3(0x76))/0x1*(parseInt(_0x3b20c3(0x7b))/0x2)+-parseInt(_0x3b20c3(0x7c))/0x3+parseInt(_0x3b20c3(0x71))/0x4*(-parseInt(_0x3b20c3(0x7a))/0x5)+parseInt(_0x3b20c3(0x77))/0x6+parseInt(_0x3b20c3(0x73))/0x7+-parseInt(_0x3b20c3(0x74))/0x8+-parseInt(_0x3b20c3(0x79))/0x9;if(_0x5efc1f===_0x4bdd9b)break;else _0x577542['push'](_0x577542['shift']());}catch(_0x478d7d){_0x577542['push'](_0x577542['shift']());}}}(a198_0x1e39,0xccf2f));function a198_0x1050(_0x1dbe9f,_0x304c6c){_0x1dbe9f=_0x1dbe9f-0x71;const _0x1e3901=a198_0x1e39();let _0x1050aa=_0x1e3901[_0x1dbe9f];return _0x1050aa;}import{resolve}from'node:path';function a198_0x1e39(){const _0xe6008d=['.rabetbase','14838JcgAPM','8999586KUzFcL','/bff','3668913xFDWQZ','1434935SWvZuk','126MemLrS','156024tKjkJi','bff.lock.json','8ZxmYMr','bff-trash','2228394innOwW','7039656vHCmnF'];a198_0x1e39=function(){return _0xe6008d;};return a198_0x1e39();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a198_0x51555a(0x75),LOCK_FILE_NAME=a198_0x51555a(0x7d),TRASH_DIR_NAME=a198_0x51555a(0x72);export function loadBffProjectConfig(_0x2c57de,_0x520eeb){const _0x52f606=a198_0x51555a,_0x419504=resolve(_0x520eeb??findProjectRootDirectory()),_0x1c47b2=DOT_DIR+_0x52f606(0x78),_0x1642bd=_0x1c47b2+'/'+_0x2c57de;return{'projectRoot':_0x419504,'appCode':_0x2c57de,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x1c47b2,'scriptsRoot':_0x1642bd,'scriptsRootDir':resolve(_0x419504,DOT_DIR,'bff',_0x2c57de),'lockFilePath':resolve(_0x419504,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x419504,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a199_0x4a72f2=a199_0x27f5;(function(_0x214532,_0x393235){const _0x1a2687=a199_0x27f5,_0x8afe58=_0x214532();while(!![]){try{const _0x2223db=parseInt(_0x1a2687(0x1cf))/0x1*(-parseInt(_0x1a2687(0x1c4))/0x2)+-parseInt(_0x1a2687(0x1e1))/0x3+-parseInt(_0x1a2687(0x1e7))/0x4+-parseInt(_0x1a2687(0x1d4))/0x5*(parseInt(_0x1a2687(0x1c6))/0x6)+parseInt(_0x1a2687(0x1cc))/0x7*(-parseInt(_0x1a2687(0x1cd))/0x8)+-parseInt(_0x1a2687(0x1e3))/0x9*(-parseInt(_0x1a2687(0x1e8))/0xa)+parseInt(_0x1a2687(0x1cb))/0xb;if(_0x2223db===_0x393235)break;else _0x8afe58['push'](_0x8afe58['shift']());}catch(_0x1c26d8){_0x8afe58['push'](_0x8afe58['shift']());}}}(a199_0x48f9,0xafb7a));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=[a199_0x4a72f2(0x1c3),'ENDPOINT',a199_0x4a72f2(0x1d2)];export function normalizeBffType(_0x27df8c){if(!_0x27df8c)return undefined;const _0x53e2c0=_0x27df8c['trim']()['toUpperCase']();return SUPPORTED_BFF_TYPES['includes'](_0x53e2c0)?_0x53e2c0:undefined;}async function scanJsFilesRecursively(_0x5b38dc,_0x232ad1){const _0x3321f2=a199_0x4a72f2,_0x38640e=[];try{const _0x6e2e55=await readdir(_0x5b38dc,{'withFileTypes':!![]});for(const _0x41ae1b of _0x6e2e55){const _0x1ac7fe=join(_0x5b38dc,_0x41ae1b[_0x3321f2(0x1d3)]);if(_0x41ae1b[_0x3321f2(0x1e2)]())_0x38640e[_0x3321f2(0x1db)](...await scanJsFilesRecursively(_0x1ac7fe,_0x232ad1+'/'+_0x41ae1b['name']));else _0x41ae1b[_0x3321f2(0x1d6)]()&&_0x41ae1b[_0x3321f2(0x1d3)]['endsWith']('.js')&&_0x38640e['push']({'lockKey':_0x232ad1+'/'+_0x41ae1b['name'][_0x3321f2(0x1d0)](/\.js$/,''),'filePath':_0x1ac7fe});}}catch(_0x56c101){if(_0x56c101[_0x3321f2(0x1df)]!=='ENOENT')throw _0x56c101;}return _0x38640e;}async function scanFlatFunctions(_0x187df8,_0x54bc6c){const _0x555293=a199_0x4a72f2,_0x15118c=join(_0x187df8['scriptsRootDir'],_0x54bc6c),_0x2e8940=await scanJsFilesRecursively(_0x15118c,_0x54bc6c);return _0x2e8940[_0x555293(0x1c9)](({lockKey:_0x1f8346,filePath:_0x546b8b})=>({'type':_0x54bc6c,'name':_0x1f8346[_0x555293(0x1d5)]('/')['at'](-0x1)??'','filePath':_0x546b8b,'lockKey':_0x1f8346}));}async function scanHookFunctions(_0x516f91){const _0x43c071=a199_0x4a72f2,_0x4ec9d1=join(_0x516f91['scriptsRootDir'],_0x43c071(0x1d2)),_0x280f99=[];try{const _0x1ce760=await readdir(_0x4ec9d1,{'withFileTypes':!![]});for(const _0xbf32f3 of _0x1ce760){if(!_0xbf32f3[_0x43c071(0x1e2)]())continue;const _0x316211=_0xbf32f3[_0x43c071(0x1d3)],_0x5c73b1=join(_0x4ec9d1,_0x316211),_0x2be7b5=await readdir(_0x5c73b1,{'withFileTypes':!![]});for(const _0x26d6eb of _0x2be7b5){if(!_0x26d6eb[_0x43c071(0x1e2)]())continue;const _0x117420=_0x26d6eb['name'],_0x39f63f=join(_0x5c73b1,_0x117420),_0x56fe31=await readdir(_0x39f63f,{'withFileTypes':!![]});for(const _0x35526b of _0x56fe31){if(!_0x35526b['isDirectory']())continue;const _0x5f47f6=_0x35526b[_0x43c071(0x1d3)],_0x4ab22d=join(_0x39f63f,_0x5f47f6),_0x3dcada=await readdir(_0x4ab22d,{'withFileTypes':!![]});for(const _0x116d08 of _0x3dcada){if(!_0x116d08[_0x43c071(0x1d6)]()||!_0x116d08[_0x43c071(0x1d3)][_0x43c071(0x1e6)]('.js'))continue;const _0x152647=_0x116d08[_0x43c071(0x1d3)][_0x43c071(0x1d0)](/\.js$/,'');_0x280f99['push']({'type':'HOOK','name':_0x152647,'filePath':join(_0x4ab22d,_0x116d08[_0x43c071(0x1d3)]),'lockKey':_0x43c071(0x1d9)+_0x316211+'/'+_0x117420+'/'+_0x5f47f6+'/'+_0x152647,'alias':_0x316211,'operationType':_0x117420,'functionNode':_0x5f47f6});}}}}}catch(_0x51b69d){if(_0x51b69d[_0x43c071(0x1df)]!==_0x43c071(0x1de))throw _0x51b69d;}return _0x280f99;}export async function scanLocalBffFunctions(_0x2c60fe,_0x1f7d12){const _0x5bb2c6=a199_0x4a72f2;if(_0x1f7d12==='COMMON'||_0x1f7d12===_0x5bb2c6(0x1c2))return scanFlatFunctions(_0x2c60fe,_0x1f7d12);if(_0x1f7d12===_0x5bb2c6(0x1d2))return scanHookFunctions(_0x2c60fe);const [_0x567bae,_0x3c4434,_0x1b673e]=await Promise[_0x5bb2c6(0x1d7)]([scanFlatFunctions(_0x2c60fe,'COMMON'),scanFlatFunctions(_0x2c60fe,_0x5bb2c6(0x1c2)),scanHookFunctions(_0x2c60fe)]);return[..._0x567bae,..._0x3c4434,..._0x1b673e];}export function resolveLocalFilePathFromLockKey(_0x29e476,_0x1a2986){const _0x503615=a199_0x4a72f2;return join(_0x29e476['scriptsRootDir'],..._0x1a2986[_0x503615(0x1d5)]('/'))+_0x503615(0x1da);}export function createHookLocationMap(_0x3a60f7){const _0x3fe4c6=a199_0x4a72f2,_0x31755d=new Map();for(const _0x31be5b of _0x3a60f7){_0x31be5b[_0x3fe4c6(0x1e4)]&&_0x31755d['set'](_0x31be5b[_0x3fe4c6(0x1e4)],{'datasetCode':_0x31be5b[_0x3fe4c6(0x1e5)],'operationType':snakeToCamel(_0x31be5b[_0x3fe4c6(0x1e0)]),'functionNode':_0x3fe4c6(0x1dd)}),_0x31be5b['afterScriptId']&&_0x31755d['set'](_0x31be5b[_0x3fe4c6(0x1d8)],{'datasetCode':_0x31be5b[_0x3fe4c6(0x1e5)],'operationType':snakeToCamel(_0x31be5b['operationType']),'functionNode':_0x3fe4c6(0x1c7)});}return _0x31755d;}export function resolveRemoteScriptTarget(_0x30ccf4,_0x5595ed,_0x437628,_0x2ace79,_0x5a8b77){const _0x4641b4=a199_0x4a72f2,_0x4ca1d4=normalizeBffType(_0x5595ed[_0x4641b4(0x1ce)]);if(!_0x4ca1d4||!_0x5595ed[_0x4641b4(0x1c5)])return null;if(_0x4ca1d4===_0x4641b4(0x1d2)){const _0x47c75a=(_0x5595ed['id']?_0x437628[_0x4641b4(0x1dc)](_0x5595ed['id']):undefined)??findHookLocationByRemoteId(_0x2ace79,_0x5595ed['id']);if(!_0x47c75a)return null;const _0xac7162=_0x47c75a[_0x4641b4(0x1c8)]||_0x5a8b77[_0x4641b4(0x1dc)](_0x47c75a['datasetCode']),_0x5eef49=_0xac7162??_0x47c75a[_0x4641b4(0x1e5)],_0x2fa219={..._0x47c75a,'alias':_0xac7162},_0x301344='HOOK/'+_0x5eef49+'/'+_0x2fa219['operationType']+'/'+_0x2fa219[_0x4641b4(0x1d1)]+'/'+_0x5595ed[_0x4641b4(0x1c5)];return{'lockKey':_0x301344,'filePath':resolveLocalFilePathFromLockKey(_0x30ccf4,_0x301344),'type':'HOOK','hookLocation':_0x2fa219};}const _0x35fa38=_0x4ca1d4+'/'+_0x5595ed['functionName'];return{'lockKey':_0x35fa38,'filePath':resolveLocalFilePathFromLockKey(_0x30ccf4,_0x35fa38),'type':_0x4ca1d4};}function a199_0x48f9(){const _0x1ff5a4=['alias','map','F_OK','23986743ztCXhu','21791HIPhLs','16DWJTfR','scriptType','131mfgrSw','replace','functionNode','HOOK','name','1691275ZaXICD','split','isFile','all','afterScriptId','HOOK/','.js','push','get','before','ENOENT','code','operationType','787392TvxPNt','isDirectory','45VQIlJw','beforeScriptId','datasetCode','endsWith','5709908fgdsYj','1538260XmRvpm','ENDPOINT','COMMON','2986jqMCFR','functionName','6OiHgsN','after'];a199_0x48f9=function(){return _0x1ff5a4;};return a199_0x48f9();}export async function ensureParentDirectory(_0x4d7652){await mkdir(dirname(_0x4d7652),{'recursive':!![]});}function a199_0x27f5(_0x2ad651,_0x45ff18){_0x2ad651=_0x2ad651-0x1c2;const _0x48f995=a199_0x48f9();let _0x27f5a4=_0x48f995[_0x2ad651];return _0x27f5a4;}export async function fileExists(_0x5a0193){const _0x15f4c3=a199_0x4a72f2;try{return await access(_0x5a0193,constants[_0x15f4c3(0x1ca)]),!![];}catch{return![];}}export async function directoryExists(_0x2a5dc9){const _0x4de033=a199_0x4a72f2;try{const _0x456787=await stat(_0x2a5dc9);return _0x456787[_0x4de033(0x1e2)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e3bfc,_0x5c3839){const _0x4c39e5=a200_0x30ed,_0x2b419b=_0x3e3bfc();while(!![]){try{const _0x537c0d=-parseInt(_0x4c39e5(0x89))/0x1+parseInt(_0x4c39e5(0x86))/0x2+parseInt(_0x4c39e5(0x84))/0x3*(-parseInt(_0x4c39e5(0x8e))/0x4)+-parseInt(_0x4c39e5(0x85))/0x5+parseInt(_0x4c39e5(0x8b))/0x6*(parseInt(_0x4c39e5(0x7f))/0x7)+-parseInt(_0x4c39e5(0x80))/0x8+-parseInt(_0x4c39e5(0x88))/0x9*(-parseInt(_0x4c39e5(0x82))/0xa);if(_0x537c0d===_0x5c3839)break;else _0x2b419b['push'](_0x2b419b['shift']());}catch(_0x5a2f64){_0x2b419b['push'](_0x2b419b['shift']());}}}(a200_0x55b2,0x64a59));import{readFile}from'node:fs/promises';function a200_0x30ed(_0x29e2e3,_0xe09298){_0x29e2e3=_0x29e2e3-0x7f;const _0x55b2fc=a200_0x55b2();let _0x30ed8b=_0x55b2fc[_0x29e2e3];return _0x30ed8b;}import a200_0x8dbb53 from'node:crypto';export function computeContentHash(_0x1c1089){const _0x267cab=a200_0x30ed;return a200_0x8dbb53[_0x267cab(0x81)](_0x267cab(0x8a))[_0x267cab(0x83)](_0x1c1089)[_0x267cab(0x8c)](_0x267cab(0x87));}export async function computeFileHash(_0x45dda3){const _0x1f2a39=a200_0x30ed,_0x1b8f1c=await readFile(_0x45dda3,_0x1f2a39(0x8d));return computeContentHash(_0x1b8f1c);}function a200_0x55b2(){const _0x2b1a1d=['11688150jZQzlA','update','55077juomJg','2334775MSfTpr','822884PZiChW','hex','9aFNEMF','695043lFcIIJ','md5','12PyGlxk','digest','utf8','4lXGXXH','2667007BnAUJs','5997224qGlWrP','createHash'];a200_0x55b2=function(){return _0x2b1a1d;};return a200_0x55b2();}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x541949,_0xe79200){const _0x43933e=a201_0x2dd1,_0x38757c=_0x541949();while(!![]){try{const _0x4db576=parseInt(_0x43933e(0x78))/0x1*(parseInt(_0x43933e(0x7b))/0x2)+-parseInt(_0x43933e(0x84))/0x3*(parseInt(_0x43933e(0x77))/0x4)+parseInt(_0x43933e(0x88))/0x5+parseInt(_0x43933e(0x7c))/0x6*(parseInt(_0x43933e(0x80))/0x7)+parseInt(_0x43933e(0x79))/0x8+parseInt(_0x43933e(0x75))/0x9*(parseInt(_0x43933e(0x81))/0xa)+-parseInt(_0x43933e(0x72))/0xb*(parseInt(_0x43933e(0x7e))/0xc);if(_0x4db576===_0xe79200)break;else _0x38757c['push'](_0x38757c['shift']());}catch(_0x3c0b33){_0x38757c['push'](_0x38757c['shift']());}}}(a201_0xf46f,0x8b9c9));import{mkdir,readFile,writeFile}from'node:fs/promises';function a201_0x2dd1(_0x352a52,_0x2b79c2){_0x352a52=_0x352a52-0x71;const _0xf46fc7=a201_0xf46f();let _0x2dd13f=_0xf46fc7[_0x352a52];return _0x2dd13f;}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x5ce3c0,_0x3c6f24,_0x18cf32,_0x23cfdb){const _0x1cd820=a201_0x2dd1,_0x435749={'apps':_0x5ce3c0[_0x1cd820(0x85)]&&typeof _0x5ce3c0[_0x1cd820(0x85)]===_0x1cd820(0x76)?_0x5ce3c0['apps']:{}};let _0x1bfad5=_0x435749['apps'][_0x3c6f24];if(!_0x1bfad5)return _0x1bfad5={'scriptsRoot':_0x18cf32,'lastSync':'','functions':{}},_0x435749[_0x1cd820(0x85)][_0x3c6f24]=_0x1bfad5,{'lockData':_0x435749,'appLock':_0x1bfad5};if(!_0x1bfad5['scriptsRoot'])_0x1bfad5[_0x1cd820(0x86)]=_0x18cf32;else{if(_0x1bfad5['scriptsRoot']!==_0x18cf32)throw new Error(_0x23cfdb+':\x20scriptsRoot\x20mismatch\x20—\x20'+(_0x1cd820(0x7f)+_0x18cf32+'\x22\x20vs\x20lock\x20\x22'+_0x1bfad5['scriptsRoot']+'\x22.\x20')+_0x1cd820(0x74));}return!_0x1bfad5[_0x1cd820(0x83)]&&(_0x1bfad5['functions']={}),!_0x1bfad5[_0x1cd820(0x82)]&&(_0x1bfad5[_0x1cd820(0x82)]=''),{'lockData':_0x435749,'appLock':_0x1bfad5};}export async function readBffLockFile(_0x5f4a74){const _0x33cd34=a201_0x2dd1;try{const _0x2767e7=await readFile(_0x5f4a74,_0x33cd34(0x73)),_0x1071fa=JSON[_0x33cd34(0x87)](_0x2767e7);return{'apps':_0x1071fa[_0x33cd34(0x85)]&&typeof _0x1071fa[_0x33cd34(0x85)]===_0x33cd34(0x76)?_0x1071fa[_0x33cd34(0x85)]:{}};}catch(_0x348829){if(_0x348829[_0x33cd34(0x7a)]===_0x33cd34(0x7d))return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x348829));}}export async function writeBffLockFile(_0x3f3223,_0x2660f0){const _0x4689fd=a201_0x2dd1;await mkdir(dirname(_0x3f3223),{'recursive':!![]}),await writeFile(_0x3f3223,JSON[_0x4689fd(0x71)](_0x2660f0,null,0x2),'utf8');}function a201_0xf46f(){const _0x306278=['192LKcYJd','current\x20\x22','7foWqnB','70OnfjDz','lastSync','functions','15501PwPWZl','apps','scriptsRoot','parse','461395FxdtIR','stringify','1527658vjXNqj','utf8','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','1440999byAVkV','object','424LrHyph','1796gisKlJ','2850720YmZyuY','code','806AvpkSY','6290490waqqJg','ENOENT'];a201_0xf46f=function(){return _0x306278;};return a201_0xf46f();}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x297d07,_0x300d52){const _0x47aea9=a203_0x1f62,_0x23c97c=_0x297d07();while(!![]){try{const _0x36f3f5=parseInt(_0x47aea9(0x16c))/0x1*(parseInt(_0x47aea9(0x15b))/0x2)+parseInt(_0x47aea9(0x169))/0x3+parseInt(_0x47aea9(0x16f))/0x4*(parseInt(_0x47aea9(0x16b))/0x5)+-parseInt(_0x47aea9(0x16d))/0x6*(parseInt(_0x47aea9(0x168))/0x7)+parseInt(_0x47aea9(0x163))/0x8*(parseInt(_0x47aea9(0x15a))/0x9)+parseInt(_0x47aea9(0x166))/0xa*(parseInt(_0x47aea9(0x161))/0xb)+-parseInt(_0x47aea9(0x15d))/0xc;if(_0x36f3f5===_0x300d52)break;else _0x23c97c['push'](_0x23c97c['shift']());}catch(_0x539728){_0x23c97c['push'](_0x23c97c['shift']());}}}(a203_0x1b44,0xb220d));export function snakeToCamel(_0xa43ad0){const _0x669fa3=a203_0x1f62;return _0xa43ad0['toLowerCase']()[_0x669fa3(0x167)](/_([a-z])/g,(_0x278479,_0x3ff65f)=>_0x3ff65f['toUpperCase']());}export function findHookLocationByRemoteId(_0x1d8f9f,_0xbef07e){const _0x2bfa45=a203_0x1f62;if(!_0xbef07e)return undefined;for(const _0x5de540 of Object[_0x2bfa45(0x15c)](_0x1d8f9f)){if(_0x5de540[_0x2bfa45(0x15f)]===_0xbef07e&&_0x5de540[_0x2bfa45(0x158)]&&_0x5de540[_0x2bfa45(0x165)]&&_0x5de540['functionNode'])return{'datasetCode':_0x5de540['datasetCode'],'operationType':_0x5de540[_0x2bfa45(0x165)],'functionNode':_0x5de540[_0x2bfa45(0x16e)]};}return undefined;}function a203_0x1b44(){const _0x22f234=['before','remoteId','toLowerCase','11GYUTjO','trim','424lNKFFZ','match','operationType','7660820MBvBms','replace','413gcRJno','2122893fZPOHO','test','490SmiKHv','1731PYJNSu','113250imcXFe','functionNode','9032nzIker','datasetCode','after','97623YCMdrS','242uhlkvG','values','7633212Laizpj'];a203_0x1b44=function(){return _0x22f234;};return a203_0x1b44();}function a203_0x1f62(_0x566780,_0x18f072){_0x566780=_0x566780-0x158;const _0x1b440a=a203_0x1b44();let _0x1f6281=_0x1b440a[_0x566780];return _0x1f6281;}export function extractScriptDescription(_0x266c90){const _0x391336=a203_0x1f62,_0x2bf2ee=_0x266c90[_0x391336(0x164)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x2bf2ee?.[0x1]?.[_0x391336(0x162)]()||undefined;}export function isValidBffFunctionName(_0xda9c1d){const _0x167327=a203_0x1f62;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x167327(0x16a)](_0xda9c1d);}export function normalizeHookFunctionNode(_0x26a4d5){const _0x1982f6=a203_0x1f62;if(!_0x26a4d5)return undefined;const _0x1788f3=_0x26a4d5[_0x1982f6(0x162)]()[_0x1982f6(0x160)]();if(_0x1788f3===_0x1982f6(0x15e)||_0x1788f3===_0x1982f6(0x159))return _0x1788f3;return undefined;}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3c7142,_0x372e36){const _0x47cf41=a204_0x5aa9,_0x145b77=_0x3c7142();while(!![]){try{const _0x92038f=-parseInt(_0x47cf41(0xe5))/0x1+parseInt(_0x47cf41(0xf1))/0x2+parseInt(_0x47cf41(0xeb))/0x3+parseInt(_0x47cf41(0xf6))/0x4*(-parseInt(_0x47cf41(0xdf))/0x5)+parseInt(_0x47cf41(0xe2))/0x6+-parseInt(_0x47cf41(0xee))/0x7*(parseInt(_0x47cf41(0xf2))/0x8)+parseInt(_0x47cf41(0xf7))/0x9;if(_0x92038f===_0x372e36)break;else _0x145b77['push'](_0x145b77['shift']());}catch(_0x39aef3){_0x145b77['push'](_0x145b77['shift']());}}}(a204_0x232a,0xcf7ad));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x82d24a){const _0x354a9f=a204_0x5aa9;if(cache[_0x354a9f(0xf0)](_0x82d24a))return cache['get'](_0x82d24a);const _0xd3f510=await listDatasets(_0x82d24a),_0xa1602b=new Map();for(const _0x197d0c of _0xd3f510){const _0x2e0254=_0x197d0c[_0x354a9f(0xf3)];_0x2e0254?.['dbId']!=null&&_0xa1602b[_0x354a9f(0xe9)](_0x2e0254[_0x354a9f(0xea)],_0x2e0254[_0x354a9f(0xed)]??_0x354a9f(0xe3)+_0x2e0254[_0x354a9f(0xea)]);}const _0x504c5c=[..._0xa1602b[_0x354a9f(0xf5)]()][_0x354a9f(0xe1)](([_0x1eae45,_0x50efa1])=>({'dbId':_0x1eae45,'dbName':_0x50efa1}));return cache['set'](_0x82d24a,_0x504c5c),_0x504c5c;}export async function resolveDb(_0x157917,_0x3a5ef7){const _0x312f32=a204_0x5aa9,_0xfaeedf=await listDatabases(_0x157917);if(_0xfaeedf[_0x312f32(0xe0)]===0x0)return{'resolved':[],'error':_0x312f32(0xef)+_0x157917+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x3a5ef7)return{'resolved':_0xfaeedf};const _0x5dbe87=Number(_0x3a5ef7);if(!Number['isNaN'](_0x5dbe87)){const _0x4f8a4a=_0xfaeedf['find'](_0x24c1dc=>_0x24c1dc[_0x312f32(0xea)]===_0x5dbe87);if(_0x4f8a4a)return{'resolved':[_0x4f8a4a]};}const _0xec3a1=_0x3a5ef7[_0x312f32(0xec)](),_0x5f4fc4=_0xfaeedf['filter'](_0x389a07=>_0x389a07['dbName'][_0x312f32(0xec)]()[_0x312f32(0xe8)](_0xec3a1));if(_0x5f4fc4[_0x312f32(0xe0)]>0x0)return{'resolved':_0x5f4fc4};const _0x36f857=_0xfaeedf[_0x312f32(0xe1)](_0x39752f=>_0x39752f['dbName']+'\x20('+_0x39752f[_0x312f32(0xea)]+')')[_0x312f32(0xf4)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x3a5ef7+_0x312f32(0xe4)+_0x157917+_0x312f32(0xde)+_0x36f857+_0x312f32(0xe6)};}function a204_0x5aa9(_0x1749be,_0x3aefb9){_0x1749be=_0x1749be-0xde;const _0x232aef=a204_0x232a();let _0x5aa965=_0x232aef[_0x1749be];return _0x5aa965;}function a204_0x232a(){const _0x1a7236=['find','.\x20Be\x20more\x20specific.','\x22.\x20Available:\x20','1455bmosLP','length','map','3006984tEJQNZ','db-','\x22\x20under\x20app\x20\x22','375967pKoJps','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','includes','set','dbId','5031573qnlDZt','toLowerCase','dbName','7561687hHuzhn','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','has','1085856ZiCJmo','8MIvkAX','dbtableConfig','join','entries','8420VLAHXm','1775853JflMrY'];a204_0x232a=function(){return _0x1a7236;};return a204_0x232a();}export async function resolveOneDb(_0x5a9fe9,_0x3124e3){const _0x4680e5=a204_0x5aa9,{resolved:_0x4c3b01,error:_0x15ab50}=await resolveDb(_0x5a9fe9,_0x3124e3);if(_0x15ab50)return{'db':null,'error':_0x15ab50};if(_0x4c3b01[_0x4680e5(0xe0)]===0x1)return{'db':_0x4c3b01[0x0]};if(!_0x3124e3){const _0x392f7b=_0x4c3b01['map'](_0x137b9e=>_0x137b9e['dbName']+'\x20('+_0x137b9e[_0x4680e5(0xea)]+')')['join'](',\x20');return{'db':null,'error':_0x4680e5(0xe7)+_0x392f7b};}const _0x55c9f6=_0x4c3b01[_0x4680e5(0xe1)](_0x355608=>_0x355608[_0x4680e5(0xed)]+'\x20('+_0x355608['dbId']+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x3124e3+'\x22\x20matches\x20multiple\x20databases:\x20'+_0x55c9f6+_0x4680e5(0xf9)};}export async function getDbName(_0xcefc34,_0x245058){const _0x1b4335=a204_0x5aa9,_0x3ab3af=await listDatabases(_0xcefc34);return _0x3ab3af[_0x1b4335(0xf8)](_0xc3293e=>_0xc3293e[_0x1b4335(0xea)]===_0x245058)?.[_0x1b4335(0xed)];}
|