@lovrabet/rabetbase-cli 2.3.11 → 2.3.12
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
|
-
function a194_0x1887(_0xfac40d,_0x1232d4){_0xfac40d=_0xfac40d-0x1e6;const _0x333b1e=a194_0x333b();let _0x18876a=_0x333b1e[_0xfac40d];return _0x18876a;}const a194_0x44298e=a194_0x1887;(function(_0x318e15,_0xb94d53){const _0x4baa7a=a194_0x1887,_0x38ae92=_0x318e15();while(!![]){try{const _0x3eed5f=-parseInt(_0x4baa7a(0x203))/0x1*(-parseInt(_0x4baa7a(0x1ee))/0x2)+parseInt(_0x4baa7a(0x20b))/0x3*(parseInt(_0x4baa7a(0x210))/0x4)+parseInt(_0x4baa7a(0x1ef))/0x5+parseInt(_0x4baa7a(0x1f0))/0x6+parseInt(_0x4baa7a(0x1ff))/0x7+-parseInt(_0x4baa7a(0x1fa))/0x8+-parseInt(_0x4baa7a(0x20d))/0x9*(parseInt(_0x4baa7a(0x206))/0xa);if(_0x3eed5f===_0xb94d53)break;else _0x38ae92['push'](_0x38ae92['shift']());}catch(_0x39f50a){_0x38ae92['push'](_0x38ae92['shift']());}}}(a194_0x333b,0x89972));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_0x44298e(0x20c);export const CONFIG_NAMES=[a194_0x44298e(0x20c),'.lovrabet.json',a194_0x44298e(0x1f5)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x5d6072=>_0x5d6072!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x296d57){for(const _0x81de30 of CONFIG_NAMES){const _0x292eec=resolve(_0x296d57,_0x81de30);if(existsSync(_0x292eec))return _0x292eec;}return undefined;}export function findProjectRootDirectory(_0x2d29f6=process[a194_0x44298e(0x214)]()){let _0x48f8b7=resolve(_0x2d29f6);const {root:_0x300805}=parse(_0x48f8b7),_0x45d6ae=homedir();while(!![]){if(resolveConfigPath(_0x48f8b7)){if(_0x48f8b7===_0x45d6ae)break;return _0x48f8b7;}if(_0x48f8b7===_0x300805||_0x48f8b7===_0x45d6ae)break;const _0x2f9f6f=dirname(_0x48f8b7);if(_0x2f9f6f===_0x48f8b7)break;_0x48f8b7=_0x2f9f6f;}return resolve(_0x2d29f6);}function a194_0x333b(){const _0x37d609=['16234sTyJPB','data','utf8','60SuzhfR','pageSize','message','.tmp','status','1328619jrPjNa','.rabetbase.json','2697687rCCdXu','migrated','config','4okttCx','riskLevel','parse','string','cwd','appcode','locale','cookie','app','keys','accessKey','inherit','set','trim','108hdScPd','1328085yOrdvK','6161784FQJepM','length','format','silent','env','.lovrabetrc','apiDir','stringify','error','\x0a\x20\x20','3473272qAjKwC','warn','empty','apps','defaultApp','1288679QJDRrl','object','missing','project'];a194_0x333b=function(){return _0x37d609;};return a194_0x333b();}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x6fd759){const _0x3c8153=a194_0x44298e;if(!existsSync(_0x6fd759))return{'status':_0x3c8153(0x201)};try{const _0x2d8ff5=readFileSync(_0x6fd759,{'encoding':_0x3c8153(0x205)});if(!_0x2d8ff5?.[_0x3c8153(0x1ed)]())return{'status':_0x3c8153(0x1fc)};const _0x38de33=JSON[_0x3c8153(0x212)](_0x2d8ff5);return{'status':'ok','data':_0x38de33};}catch(_0x7dcdef){return{'status':_0x3c8153(0x1f8),'message':_0x7dcdef instanceof Error?_0x7dcdef[_0x3c8153(0x208)]:String(_0x7dcdef)};}}function parseCliConfigJsonFile(_0x4b7a90,_0x1f5c29,_0x3d8406){const _0x599e5e=a194_0x44298e,_0x3d54cf=inspectCliConfigJsonFile(_0x4b7a90);if(_0x3d54cf['status']===_0x599e5e(0x201)||_0x3d54cf[_0x599e5e(0x20a)]==='empty')return{};if(_0x3d54cf[_0x599e5e(0x20a)]==='ok')return _0x3d54cf[_0x599e5e(0x204)];return _0x1f5c29===_0x599e5e(0x1fb)&&_0x3d8406&&console[_0x599e5e(0x1f8)](CLI_BIN_NAME+':\x20'+_0x3d8406+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0x4b7a90+_0x599e5e(0x1f9)+_0x3d54cf['message']),{};}function normalizeLegacyConfigShape(_0x43ebda){const _0x5ed286=a194_0x44298e;if(!_0x43ebda||typeof _0x43ebda!==_0x5ed286(0x200))return{'config':{},'migrated':![]};const _0x4ccf6a={..._0x43ebda},_0x3d7ee6=_0x4ccf6a[_0x5ed286(0x1fd)]&&typeof _0x4ccf6a[_0x5ed286(0x1fd)]===_0x5ed286(0x200)?{..._0x4ccf6a[_0x5ed286(0x1fd)]}:{},_0x23c829=Object['keys'](_0x3d7ee6)['length'],_0x1bb091=_0x4ccf6a[_0x5ed286(0x215)]||_0x4ccf6a['app'];let _0x274769=![];if(_0x1bb091&&_0x23c829===0x0){const _0x5b15a8=typeof _0x4ccf6a[_0x5ed286(0x1fe)]===_0x5ed286(0x213)&&_0x4ccf6a[_0x5ed286(0x1fe)][_0x5ed286(0x1ed)]()?_0x4ccf6a[_0x5ed286(0x1fe)]:String(_0x1bb091)[_0x5ed286(0x1ed)]();_0x3d7ee6[_0x5b15a8]={'appcode':String(_0x1bb091)[_0x5ed286(0x1ed)](),..._0x4ccf6a[_0x5ed286(0x1f4)]!=null?{'env':_0x4ccf6a[_0x5ed286(0x1f4)]}:{},..._0x4ccf6a[_0x5ed286(0x1f6)]!=null?{'apiDir':_0x4ccf6a['apiDir']}:{},..._0x4ccf6a[_0x5ed286(0x1e7)]!=null?{'cookie':_0x4ccf6a[_0x5ed286(0x1e7)]}:{},..._0x4ccf6a[_0x5ed286(0x1ea)]!=null?{'accessKey':_0x4ccf6a[_0x5ed286(0x1ea)]}:{},..._0x4ccf6a['format']!=null?{'format':_0x4ccf6a[_0x5ed286(0x1f2)]}:{},..._0x4ccf6a[_0x5ed286(0x207)]!=null?{'pageSize':_0x4ccf6a[_0x5ed286(0x207)]}:{},..._0x4ccf6a['riskLevel']!=null?{'riskLevel':_0x4ccf6a[_0x5ed286(0x211)]}:{},..._0x4ccf6a['locale']!=null?{'locale':_0x4ccf6a[_0x5ed286(0x1e6)]}:{}},_0x4ccf6a[_0x5ed286(0x1fd)]=_0x3d7ee6;if(!_0x4ccf6a['defaultApp'])_0x4ccf6a[_0x5ed286(0x1fe)]=_0x5b15a8;_0x274769=!![];}return(_0x5ed286(0x215)in _0x4ccf6a||'app'in _0x4ccf6a)&&(delete _0x4ccf6a[_0x5ed286(0x215)],delete _0x4ccf6a[_0x5ed286(0x1e8)],_0x274769=!![]),{'config':_0x4ccf6a,'migrated':_0x274769};}function writeNormalizedConfigIfNeeded(_0x24d748,_0x23b54e){const _0x1be19a=a194_0x44298e,_0x30fbfd=JSON['stringify'](_0x23b54e,null,0x2)+'\x0a';if(normalizedWriteCache['get'](_0x24d748)===_0x30fbfd)return;writeConfigFile(_0x24d748,_0x23b54e),normalizedWriteCache[_0x1be19a(0x1ec)](_0x24d748,_0x30fbfd);}function parseAndNormalizeConfig(_0x2b7401,_0x5ad0f3,_0x1f1340){const _0x38fca8=a194_0x44298e,_0x569560=parseCliConfigJsonFile(_0x2b7401,_0x5ad0f3,_0x1f1340),_0x13f341=normalizeLegacyConfigShape(_0x569560);if(_0x13f341[_0x38fca8(0x20e)])try{writeNormalizedConfigIfNeeded(_0x2b7401,_0x13f341[_0x38fca8(0x20f)]);}catch{}return _0x13f341['config'];}export function loadRawConfigLayers(_0x5d35fe){const _0x284bcf=a194_0x44298e;let _0x5392fe={},_0x4ed6c7={};const _0x491581=resolveConfigPath(homedir());_0x491581&&(_0x5392fe=parseAndNormalizeConfig(_0x491581,_0x284bcf(0x1fb),'Global'));const _0x1ee6c8=_0x5d35fe??findProjectRootDirectory(),_0x2d9947=resolveConfigPath(_0x1ee6c8);return _0x2d9947&&(_0x4ed6c7=parseAndNormalizeConfig(_0x2d9947,_0x284bcf(0x1fb),'Project')),{'globalPath':_0x491581,'projectPath':_0x2d9947,'globalConfig':_0x5392fe,'projectConfig':_0x4ed6c7};}const INHERIT_WHITELIST=[a194_0x44298e(0x1e7),'accessKey',a194_0x44298e(0x1e6),a194_0x44298e(0x1f2),'riskLevel',a194_0x44298e(0x207)];export function mergeRawConfigLayers(_0x432719){const _0x2f2bd1=a194_0x44298e,{globalConfig:_0x7926ea,projectConfig:_0x4d0d85}=_0x432719,_0x340a4c=Object[_0x2f2bd1(0x1e9)](_0x4d0d85)[_0x2f2bd1(0x1f1)]>0x0;if(!_0x340a4c)return mergeGlobalOnly(_0x7926ea);if(_0x4d0d85[_0x2f2bd1(0x1eb)]===!![])return mergeFullInherit(_0x7926ea,_0x4d0d85);if(_0x4d0d85[_0x2f2bd1(0x1eb)]===![])return mergeIsolated(_0x4d0d85);return mergeProjectFirst(_0x7926ea,_0x4d0d85);}function mergeGlobalOnly(_0x1e1f51){const _0x15201a=a194_0x44298e,_0x424e90={..._0x1e1f51},_0x34ac13=_0x1e1f51[_0x15201a(0x1fd)]&&typeof _0x1e1f51[_0x15201a(0x1fd)]===_0x15201a(0x200)?_0x1e1f51['apps']:{};if(Object[_0x15201a(0x1e9)](_0x34ac13)[_0x15201a(0x1f1)]>0x0)_0x424e90['apps']=_0x34ac13;if(_0x1e1f51[_0x15201a(0x1fe)])_0x424e90[_0x15201a(0x1fe)]=_0x1e1f51[_0x15201a(0x1fe)];else{const _0x172d55=Object['keys'](_0x34ac13);if(_0x172d55[_0x15201a(0x1f1)]>0x0)_0x424e90[_0x15201a(0x1fe)]=_0x172d55[0x0];}return _0x424e90;}function mergeIsolated(_0x556269){const _0x32f3b3=a194_0x44298e,_0x7d9931={..._0x556269};delete _0x7d9931[_0x32f3b3(0x1eb)];const _0x3686f4=_0x556269[_0x32f3b3(0x1fd)]&&typeof _0x556269[_0x32f3b3(0x1fd)]===_0x32f3b3(0x200)?_0x556269[_0x32f3b3(0x1fd)]:{};Object[_0x32f3b3(0x1e9)](_0x3686f4)['length']>0x0?_0x7d9931['apps']=_0x3686f4:delete _0x7d9931[_0x32f3b3(0x1fd)];if('defaultApp'in _0x556269)_0x7d9931['defaultApp']=_0x556269['defaultApp'];else Object[_0x32f3b3(0x1e9)](_0x3686f4)[_0x32f3b3(0x1f1)]>0x0?_0x7d9931[_0x32f3b3(0x1fe)]=Object['keys'](_0x3686f4)[0x0]:delete _0x7d9931[_0x32f3b3(0x1fe)];return _0x7d9931;}function mergeProjectFirst(_0x31cd23,_0x1c0f5f){const _0x272919=a194_0x44298e,_0x1ef796={..._0x1c0f5f};delete _0x1ef796[_0x272919(0x1eb)];for(const _0x3c5836 of INHERIT_WHITELIST){!(_0x3c5836 in _0x1ef796)&&_0x3c5836 in _0x31cd23&&(_0x1ef796[_0x3c5836]=_0x31cd23[_0x3c5836]);}const _0x345df6=_0x1c0f5f[_0x272919(0x1fd)]&&typeof _0x1c0f5f['apps']===_0x272919(0x200)?_0x1c0f5f[_0x272919(0x1fd)]:{};Object['keys'](_0x345df6)[_0x272919(0x1f1)]>0x0?_0x1ef796[_0x272919(0x1fd)]=_0x345df6:delete _0x1ef796['apps'];if(_0x272919(0x1fe)in _0x1c0f5f)_0x1ef796[_0x272919(0x1fe)]=_0x1c0f5f['defaultApp'];else Object['keys'](_0x345df6)[_0x272919(0x1f1)]>0x0?_0x1ef796['defaultApp']=Object['keys'](_0x345df6)[0x0]:delete _0x1ef796[_0x272919(0x1fe)];return _0x1ef796;}function mergeFullInherit(_0x39e69c,_0x531ab7){const _0x53034d=a194_0x44298e,_0x52d08c=_0x39e69c[_0x53034d(0x1fd)]&&typeof _0x39e69c[_0x53034d(0x1fd)]===_0x53034d(0x200)?_0x39e69c[_0x53034d(0x1fd)]:{},_0x2a1cd9=_0x531ab7[_0x53034d(0x1fd)]&&typeof _0x531ab7[_0x53034d(0x1fd)]===_0x53034d(0x200)?_0x531ab7['apps']:{},_0x1d9d93={..._0x52d08c,..._0x2a1cd9},_0xd31e2b={..._0x39e69c,..._0x531ab7};delete _0xd31e2b[_0x53034d(0x1eb)];if(Object[_0x53034d(0x1e9)](_0x1d9d93)[_0x53034d(0x1f1)]>0x0)_0xd31e2b[_0x53034d(0x1fd)]=_0x1d9d93;if(_0x53034d(0x1fe)in _0x531ab7)_0xd31e2b['defaultApp']=_0x531ab7[_0x53034d(0x1fe)];else{if(Object['keys'](_0x2a1cd9)[_0x53034d(0x1f1)]>0x0)_0xd31e2b[_0x53034d(0x1fe)]=Object['keys'](_0x2a1cd9)[0x0];else{if(_0x39e69c[_0x53034d(0x1fe)])_0xd31e2b[_0x53034d(0x1fe)]=_0x39e69c[_0x53034d(0x1fe)];else{const _0x180c25=Object['keys'](_0x52d08c);if(_0x180c25[_0x53034d(0x1f1)]>0x0)_0xd31e2b[_0x53034d(0x1fe)]=_0x180c25[0x0];}}}return _0xd31e2b;}export function readRawConfigWithLayers(_0x54b4a4){const _0x1222ba=loadRawConfigLayers(_0x54b4a4);return{'config':mergeRawConfigLayers(_0x1222ba),'layers':_0x1222ba};}export function readRawConfig(_0x57d2a9){return mergeRawConfigLayers(loadRawConfigLayers(_0x57d2a9));}export function readConfigFile(_0x542273){const _0x429504=a194_0x44298e;return parseAndNormalizeConfig(_0x542273,_0x429504(0x1f3));}export function writeConfigFile(_0x471df1,_0x1873ee){const _0x15f523=a194_0x44298e,_0x44a014=dirname(_0x471df1);!existsSync(_0x44a014)&&mkdirSync(_0x44a014,{'recursive':!![]});const _0x5b9024=_0x471df1+_0x15f523(0x209);try{writeFileSync(_0x5b9024,JSON[_0x15f523(0x1f7)](_0x1873ee,null,0x2)+'\x0a',{'encoding':_0x15f523(0x205),'mode':0x180}),renameSync(_0x5b9024,_0x471df1);}catch(_0x54918e){try{unlinkSync(_0x5b9024);}catch{}throw _0x54918e;}}export function resolveWriteConfigPath(_0x943fc){const _0x1ee008=a194_0x44298e,_0x2941da=_0x943fc===_0x1ee008(0x202)?process[_0x1ee008(0x214)]():homedir(),_0x372d7e=resolveConfigPath(_0x2941da);return _0x372d7e??resolve(_0x2941da,NEW_CONFIG_NAME);}
|
|
1
|
+
const a194_0x39714e=a194_0x4629;(function(_0x2cdd04,_0x5336bb){const _0x3bd270=a194_0x4629,_0x38d778=_0x2cdd04();while(!![]){try{const _0x270b92=parseInt(_0x3bd270(0xfb))/0x1*(parseInt(_0x3bd270(0xe9))/0x2)+-parseInt(_0x3bd270(0xda))/0x3*(-parseInt(_0x3bd270(0xfc))/0x4)+parseInt(_0x3bd270(0xea))/0x5+parseInt(_0x3bd270(0xf0))/0x6+parseInt(_0x3bd270(0xe0))/0x7*(-parseInt(_0x3bd270(0xeb))/0x8)+-parseInt(_0x3bd270(0xdc))/0x9*(-parseInt(_0x3bd270(0xcc))/0xa)+parseInt(_0x3bd270(0xfa))/0xb;if(_0x270b92===_0x5336bb)break;else _0x38d778['push'](_0x38d778['shift']());}catch(_0x54d152){_0x38d778['push'](_0x38d778['shift']());}}}(a194_0x1be6,0xb95d1));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{dirname,parse,resolve}from'node:path';import{homedir}from'node:os';function a194_0x1be6(){const _0x4e28ac=['.lovrabetrc','pageSize','migrated','message','\x0a\x20\x20','inherit','length','78ZWCfwL','39615CYfxHJ','1216624DqNVmy','trim','cookie','data','apps','1671180hJnLOy','format','defaultApp','set','warn','apiDir','project','utf8','accessKey','object','4500133pImPzF','12621LUaecx','4712JfSoeY','Project','100QwXRqL','.lovrabet.json','error','get','status','stringify','.tmp','Global','cwd','filter','locale','string','keys','riskLevel','759fMlDzO','config','30447gmEwCu','appcode','app','silent','35jQwojF','.rabetbase.json'];a194_0x1be6=function(){return _0x4e28ac;};return a194_0x1be6();}import{CLI_BIN_NAME}from'../constant/cli.js';export const NEW_CONFIG_NAME=a194_0x39714e(0xe1);export const CONFIG_NAMES=[a194_0x39714e(0xe1),a194_0x39714e(0xcd),a194_0x39714e(0xe2)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a194_0x39714e(0xd5)](_0x576668=>_0x576668!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x39433e){for(const _0xaf2530 of CONFIG_NAMES){const _0x57f4b4=resolve(_0x39433e,_0xaf2530);if(existsSync(_0x57f4b4))return _0x57f4b4;}return undefined;}export function findProjectRootDirectory(_0x4e1404=process[a194_0x39714e(0xd4)]()){let _0x39c849=resolve(_0x4e1404);const {root:_0x330958}=parse(_0x39c849),_0x42371c=homedir();while(!![]){if(resolveConfigPath(_0x39c849)){if(_0x39c849===_0x42371c)break;return _0x39c849;}if(_0x39c849===_0x330958||_0x39c849===_0x42371c)break;const _0x4bd348=dirname(_0x39c849);if(_0x4bd348===_0x39c849)break;_0x39c849=_0x4bd348;}return resolve(_0x4e1404);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}function a194_0x4629(_0x501b97,_0x432e8b){_0x501b97=_0x501b97-0xcc;const _0x1be673=a194_0x1be6();let _0x46295e=_0x1be673[_0x501b97];return _0x46295e;}export function inspectCliConfigJsonFile(_0x58242f){const _0x49a5e5=a194_0x39714e;if(!existsSync(_0x58242f))return{'status':'missing'};try{const _0x191a8c=readFileSync(_0x58242f,{'encoding':'utf8'});if(!_0x191a8c?.['trim']())return{'status':'empty'};const _0x31434a=JSON['parse'](_0x191a8c);return{'status':'ok','data':_0x31434a};}catch(_0x4c1182){return{'status':_0x49a5e5(0xce),'message':_0x4c1182 instanceof Error?_0x4c1182['message']:String(_0x4c1182)};}}function parseCliConfigJsonFile(_0x391f8d,_0x18995b,_0x290a42){const _0x1a961a=a194_0x39714e,_0x35a02a=inspectCliConfigJsonFile(_0x391f8d);if(_0x35a02a['status']==='missing'||_0x35a02a[_0x1a961a(0xd0)]==='empty')return{};if(_0x35a02a[_0x1a961a(0xd0)]==='ok')return _0x35a02a[_0x1a961a(0xee)];return _0x18995b===_0x1a961a(0xf4)&&_0x290a42&&console[_0x1a961a(0xce)](CLI_BIN_NAME+':\x20'+_0x290a42+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0x391f8d+_0x1a961a(0xe6)+_0x35a02a[_0x1a961a(0xe5)]),{};}function normalizeLegacyConfigShape(_0x22d19e){const _0x58fca0=a194_0x39714e;if(!_0x22d19e||typeof _0x22d19e!==_0x58fca0(0xf9))return{'config':{},'migrated':![]};const _0x2ed674={..._0x22d19e},_0x3d7881=_0x2ed674[_0x58fca0(0xef)]&&typeof _0x2ed674['apps']===_0x58fca0(0xf9)?{..._0x2ed674[_0x58fca0(0xef)]}:{},_0x3d8bd=Object[_0x58fca0(0xd8)](_0x3d7881)[_0x58fca0(0xe8)],_0x56be0a=_0x2ed674['appcode']||_0x2ed674[_0x58fca0(0xde)];let _0x16ce1e=![];if(_0x56be0a&&_0x3d8bd===0x0){const _0x14ecb0=typeof _0x2ed674[_0x58fca0(0xf2)]===_0x58fca0(0xd7)&&_0x2ed674[_0x58fca0(0xf2)]['trim']()?_0x2ed674[_0x58fca0(0xf2)]:String(_0x56be0a)[_0x58fca0(0xec)]();_0x3d7881[_0x14ecb0]={'appcode':String(_0x56be0a)['trim'](),..._0x2ed674['env']!=null?{'env':_0x2ed674['env']}:{},..._0x2ed674['apiDir']!=null?{'apiDir':_0x2ed674[_0x58fca0(0xf5)]}:{},..._0x2ed674[_0x58fca0(0xed)]!=null?{'cookie':_0x2ed674[_0x58fca0(0xed)]}:{},..._0x2ed674[_0x58fca0(0xf8)]!=null?{'accessKey':_0x2ed674[_0x58fca0(0xf8)]}:{},..._0x2ed674[_0x58fca0(0xf1)]!=null?{'format':_0x2ed674['format']}:{},..._0x2ed674[_0x58fca0(0xe3)]!=null?{'pageSize':_0x2ed674[_0x58fca0(0xe3)]}:{},..._0x2ed674[_0x58fca0(0xd9)]!=null?{'riskLevel':_0x2ed674[_0x58fca0(0xd9)]}:{},..._0x2ed674[_0x58fca0(0xd6)]!=null?{'locale':_0x2ed674[_0x58fca0(0xd6)]}:{}},_0x2ed674['apps']=_0x3d7881;if(!_0x2ed674[_0x58fca0(0xf2)])_0x2ed674[_0x58fca0(0xf2)]=_0x14ecb0;_0x16ce1e=!![];}return('appcode'in _0x2ed674||_0x58fca0(0xde)in _0x2ed674)&&(delete _0x2ed674[_0x58fca0(0xdd)],delete _0x2ed674[_0x58fca0(0xde)],_0x16ce1e=!![]),{'config':_0x2ed674,'migrated':_0x16ce1e};}function writeNormalizedConfigIfNeeded(_0x1ea998,_0xd62483){const _0x503305=a194_0x39714e,_0x224fc9=JSON[_0x503305(0xd1)](_0xd62483,null,0x2)+'\x0a';if(normalizedWriteCache[_0x503305(0xcf)](_0x1ea998)===_0x224fc9)return;writeConfigFile(_0x1ea998,_0xd62483),normalizedWriteCache[_0x503305(0xf3)](_0x1ea998,_0x224fc9);}function parseAndNormalizeConfig(_0x3290e5,_0x3b3b19,_0x199bd7){const _0x919fd4=a194_0x39714e,_0x30b799=parseCliConfigJsonFile(_0x3290e5,_0x3b3b19,_0x199bd7),_0x459b95=normalizeLegacyConfigShape(_0x30b799);if(_0x459b95[_0x919fd4(0xe4)])try{writeNormalizedConfigIfNeeded(_0x3290e5,_0x459b95[_0x919fd4(0xdb)]);}catch{}return _0x459b95[_0x919fd4(0xdb)];}export function loadRawConfigLayers(_0x3dc48b){const _0x2b5f08=a194_0x39714e;let _0x31c7ac={},_0x7ba02={};const _0x4f013a=resolveConfigPath(homedir());_0x4f013a&&(_0x31c7ac=parseAndNormalizeConfig(_0x4f013a,'warn',_0x2b5f08(0xd3)));const _0x3e9313=_0x3dc48b??findProjectRootDirectory(),_0x3257a8=resolveConfigPath(_0x3e9313);return _0x3257a8&&(_0x7ba02=parseAndNormalizeConfig(_0x3257a8,_0x2b5f08(0xf4),_0x2b5f08(0xfd))),{'globalPath':_0x4f013a,'projectPath':_0x3257a8,'globalConfig':_0x31c7ac,'projectConfig':_0x7ba02};}const INHERIT_WHITELIST=[a194_0x39714e(0xed),a194_0x39714e(0xf8),'locale','format',a194_0x39714e(0xd9),'pageSize'];export function mergeRawConfigLayers(_0x92390f){const _0x3d1b57=a194_0x39714e,{globalConfig:_0x113a29,projectConfig:_0x317487}=_0x92390f,_0x597bce=Object['keys'](_0x317487)[_0x3d1b57(0xe8)]>0x0;if(!_0x597bce)return mergeGlobalOnly(_0x113a29);if(_0x317487[_0x3d1b57(0xe7)]===!![])return mergeFullInherit(_0x113a29,_0x317487);if(_0x317487[_0x3d1b57(0xe7)]===![])return mergeIsolated(_0x317487);return mergeProjectFirst(_0x113a29,_0x317487);}function mergeGlobalOnly(_0xbb438a){const _0x377e4c=a194_0x39714e,_0x3675fb={..._0xbb438a},_0x3fb248=_0xbb438a['apps']&&typeof _0xbb438a[_0x377e4c(0xef)]===_0x377e4c(0xf9)?_0xbb438a[_0x377e4c(0xef)]:{};if(Object['keys'](_0x3fb248)[_0x377e4c(0xe8)]>0x0)_0x3675fb[_0x377e4c(0xef)]=_0x3fb248;if(_0xbb438a[_0x377e4c(0xf2)])_0x3675fb[_0x377e4c(0xf2)]=_0xbb438a[_0x377e4c(0xf2)];else{const _0xd66dd3=Object[_0x377e4c(0xd8)](_0x3fb248);if(_0xd66dd3[_0x377e4c(0xe8)]>0x0)_0x3675fb[_0x377e4c(0xf2)]=_0xd66dd3[0x0];}return _0x3675fb;}function mergeIsolated(_0x4e868f){const _0x19043f=a194_0x39714e,_0x1862ec={..._0x4e868f};delete _0x1862ec['inherit'];const _0x552bad=_0x4e868f[_0x19043f(0xef)]&&typeof _0x4e868f[_0x19043f(0xef)]===_0x19043f(0xf9)?_0x4e868f[_0x19043f(0xef)]:{};Object['keys'](_0x552bad)[_0x19043f(0xe8)]>0x0?_0x1862ec[_0x19043f(0xef)]=_0x552bad:delete _0x1862ec[_0x19043f(0xef)];if('defaultApp'in _0x4e868f)_0x1862ec[_0x19043f(0xf2)]=_0x4e868f[_0x19043f(0xf2)];else Object[_0x19043f(0xd8)](_0x552bad)['length']>0x0?_0x1862ec['defaultApp']=Object[_0x19043f(0xd8)](_0x552bad)[0x0]:delete _0x1862ec['defaultApp'];return _0x1862ec;}function mergeProjectFirst(_0x30f449,_0x58aa23){const _0x2848e3=a194_0x39714e,_0x57ee78={..._0x58aa23};delete _0x57ee78[_0x2848e3(0xe7)];for(const _0xf0463c of INHERIT_WHITELIST){!(_0xf0463c in _0x57ee78)&&_0xf0463c in _0x30f449&&(_0x57ee78[_0xf0463c]=_0x30f449[_0xf0463c]);}const _0x410c0b=_0x58aa23['apps']&&typeof _0x58aa23[_0x2848e3(0xef)]===_0x2848e3(0xf9)?_0x58aa23[_0x2848e3(0xef)]:{};Object[_0x2848e3(0xd8)](_0x410c0b)['length']>0x0?_0x57ee78[_0x2848e3(0xef)]=_0x410c0b:delete _0x57ee78[_0x2848e3(0xef)];if(_0x2848e3(0xf2)in _0x58aa23)_0x57ee78[_0x2848e3(0xf2)]=_0x58aa23[_0x2848e3(0xf2)];else Object[_0x2848e3(0xd8)](_0x410c0b)['length']>0x0?_0x57ee78['defaultApp']=Object['keys'](_0x410c0b)[0x0]:delete _0x57ee78[_0x2848e3(0xf2)];return _0x57ee78;}function mergeFullInherit(_0x11a9e6,_0x3db4d0){const _0x338fef=a194_0x39714e,_0x322ee4=_0x11a9e6[_0x338fef(0xef)]&&typeof _0x11a9e6[_0x338fef(0xef)]==='object'?_0x11a9e6[_0x338fef(0xef)]:{},_0x409172=_0x3db4d0['apps']&&typeof _0x3db4d0[_0x338fef(0xef)]===_0x338fef(0xf9)?_0x3db4d0[_0x338fef(0xef)]:{},_0x106ad1={..._0x322ee4,..._0x409172},_0x19e804={..._0x11a9e6,..._0x3db4d0};delete _0x19e804[_0x338fef(0xe7)];if(Object[_0x338fef(0xd8)](_0x106ad1)[_0x338fef(0xe8)]>0x0)_0x19e804[_0x338fef(0xef)]=_0x106ad1;if(_0x338fef(0xf2)in _0x3db4d0)_0x19e804['defaultApp']=_0x3db4d0[_0x338fef(0xf2)];else{if(Object[_0x338fef(0xd8)](_0x409172)[_0x338fef(0xe8)]>0x0)_0x19e804[_0x338fef(0xf2)]=Object[_0x338fef(0xd8)](_0x409172)[0x0];else{if(_0x11a9e6[_0x338fef(0xf2)])_0x19e804[_0x338fef(0xf2)]=_0x11a9e6[_0x338fef(0xf2)];else{const _0x280961=Object[_0x338fef(0xd8)](_0x322ee4);if(_0x280961[_0x338fef(0xe8)]>0x0)_0x19e804[_0x338fef(0xf2)]=_0x280961[0x0];}}}return _0x19e804;}export function readRawConfigWithLayers(_0x36bf72){const _0x11c3ef=loadRawConfigLayers(_0x36bf72);return{'config':mergeRawConfigLayers(_0x11c3ef),'layers':_0x11c3ef};}export function readRawConfig(_0x2e0227){return mergeRawConfigLayers(loadRawConfigLayers(_0x2e0227));}export function readConfigFile(_0x227440){const _0x2c5be4=a194_0x39714e;return parseAndNormalizeConfig(_0x227440,_0x2c5be4(0xdf));}export function writeConfigFile(_0x4a02c1,_0x487f93){const _0x10ec5d=a194_0x39714e,_0x29287f=dirname(_0x4a02c1);!existsSync(_0x29287f)&&mkdirSync(_0x29287f,{'recursive':!![]});const _0x570178=_0x4a02c1+_0x10ec5d(0xd2);try{writeFileSync(_0x570178,JSON['stringify'](_0x487f93,null,0x2)+'\x0a',{'encoding':_0x10ec5d(0xf7),'mode':0x180}),renameSync(_0x570178,_0x4a02c1);}catch(_0x4e474e){try{unlinkSync(_0x570178);}catch{}throw _0x4e474e;}}export function resolveWriteConfigPath(_0xa8f1b){const _0x7811a7=a194_0x39714e,_0x492930=_0xa8f1b===_0x7811a7(0xf6)?process[_0x7811a7(0xd4)]():homedir(),_0x365989=resolveConfigPath(_0x492930);return _0x365989??resolve(_0x492930,NEW_CONFIG_NAME);}
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a195_0x19950c=a195_0x12b5;(function(_0x3356cc,_0x43be0d){const _0x53cf85=a195_0x12b5,_0x11e4dc=_0x3356cc();while(!![]){try{const _0x5abc9c=-parseInt(_0x53cf85(0xdb))/0x1*(parseInt(_0x53cf85(0xeb))/0x2)+parseInt(_0x53cf85(0xf5))/0x3*(parseInt(_0x53cf85(0xef))/0x4)+-parseInt(_0x53cf85(0xd5))/0x5+parseInt(_0x53cf85(0xed))/0x6*(parseInt(_0x53cf85(0xde))/0x7)+parseInt(_0x53cf85(0xec))/0x8*(parseInt(_0x53cf85(0xd6))/0x9)+-parseInt(_0x53cf85(0xd8))/0xa+-parseInt(_0x53cf85(0xe7))/0xb;if(_0x5abc9c===_0x43be0d)break;else _0x11e4dc['push'](_0x11e4dc['shift']());}catch(_0x5c5334){_0x11e4dc['push'](_0x11e4dc['shift']());}}}(a195_0x9f31,0xab867));import{resolve}from'node:path';import{CLI_BIN_NAME}from'./constant/cli.js';import{buildAuth}from'./context/auth-resolver.js';function a195_0x12b5(_0x17d829,_0x3513ea){_0x17d829=_0x17d829-0xd2;const _0x9f3131=a195_0x9f31();let _0x12b519=_0x9f3131[_0x17d829];return _0x12b519;}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(_0x2242b2){return process.env[`RABETBASE_${_0x2242b2}`]||process.env[`LOVRABET_${_0x2242b2}`]||undefined;}export async function createContext(_0x423ed9){const _0x7335cd=a195_0x12b5,{config:_0x503a30,layers:_0x52ac04}=readRawConfigWithLayers(),_0x3e5210=buildConfig(_0x503a30,_0x423ed9,_0x52ac04),{initEnv:_0x37868f}=await import(_0x7335cd(0xdd));if(_0x3e5210[_0x7335cd(0xfc)])_0x37868f(_0x3e5210[_0x7335cd(0xfc)]);else _0x423ed9[_0x7335cd(0xfc)]&&typeof _0x423ed9['env']===_0x7335cd(0xe5)&&_0x37868f(_0x423ed9[_0x7335cd(0xfc)]);const {initDomains:_0x3420bb,getUserDomain:_0x40ed9c,getApiDomain:_0x3e996a}=await import(_0x7335cd(0xee));_0x3420bb({'apiDomain':_0x503a30[_0x7335cd(0xf1)]||undefined,'userDomain':_0x503a30[_0x7335cd(0xf3)]||undefined,'runtimeDomain':_0x503a30[_0x7335cd(0xda)]||undefined});const _0x1b4d47={'apiDomain':_0x3e996a(),'userDomain':_0x40ed9c()},_0xb6b49f=await buildAuth(_0x3e5210);logger[_0x7335cd(0xf0)](process['cwd']());const _0x37a3c7=(CLI_BIN_NAME+'\x20'+process[_0x7335cd(0xea)]['slice'](0x2)[_0x7335cd(0xfb)]('\x20'))[_0x7335cd(0xe2)]();logger[_0x7335cd(0xf9)](_0x37a3c7);const {isNonInteractive:_0x89c133}=await import(_0x7335cd(0xe6)),_0x341976=_0x89c133(_0x423ed9);return{'config':_0x3e5210,'auth':_0xb6b49f,'logger':logger,'env':_0x1b4d47,'nonInteractive':_0x341976};}export function buildConfigFromFlags(_0x2b64f4){const {config:_0x3e656e,layers:_0x4860f8}=readRawConfigWithLayers();return buildConfig(_0x3e656e,_0x2b64f4,_0x4860f8);}export function getConfigAppCode(_0x54260f){const _0x1a4e93=a195_0x12b5,_0x4bb08b=readRawConfig(_0x54260f);if(_0x4bb08b['apps']&&typeof _0x4bb08b[_0x1a4e93(0xf2)]==='object'){const _0x33d4f0=_0x4bb08b[_0x1a4e93(0xd2)];if(_0x33d4f0&&_0x4bb08b['apps'][_0x33d4f0]?.[_0x1a4e93(0xf7)])return String(_0x4bb08b['apps'][_0x33d4f0][_0x1a4e93(0xf7)])[_0x1a4e93(0xe2)]();const _0x5505da=Object['values'](_0x4bb08b[_0x1a4e93(0xf2)])[0x0];if(_0x5505da?.[_0x1a4e93(0xf7)])return String(_0x5505da[_0x1a4e93(0xf7)])[_0x1a4e93(0xe2)]();}const _0x4d98c6=_0x4bb08b[_0x1a4e93(0xf7)]||_0x4bb08b[_0x1a4e93(0xe8)];if(typeof _0x4d98c6!==_0x1a4e93(0xe5)||_0x4d98c6[_0x1a4e93(0xe2)]()==='')return undefined;return _0x4d98c6[_0x1a4e93(0xe2)]();}export function getMultiAppConfigs(_0x9c5147=a195_0x19950c(0xdf),_0x3263ab){const _0x5f402e=a195_0x19950c,_0x1f5848=loadRawConfigLayers(_0x3263ab);let _0x2e8473,_0x1a8483;if(_0x9c5147===_0x5f402e(0xfa)){const _0x4d35d3=_0x1f5848[_0x5f402e(0xdc)][_0x5f402e(0xf2)]&&typeof _0x1f5848[_0x5f402e(0xdc)][_0x5f402e(0xf2)]===_0x5f402e(0xd4)?_0x1f5848['globalConfig'][_0x5f402e(0xf2)]:{},_0x1da640=_0x1f5848[_0x5f402e(0xf8)][_0x5f402e(0xf2)]&&typeof _0x1f5848[_0x5f402e(0xf8)][_0x5f402e(0xf2)]===_0x5f402e(0xd4)?_0x1f5848['projectConfig'][_0x5f402e(0xf2)]:{};_0x2e8473={..._0x4d35d3,..._0x1da640};const _0x1f3127=readRawConfig(_0x3263ab);_0x1a8483=_0x1f3127[_0x5f402e(0xd2)];}else _0x2e8473=_0x1f5848['projectConfig']['apps'],_0x1a8483=_0x1f5848[_0x5f402e(0xf8)][_0x5f402e(0xd2)];if(!_0x2e8473||typeof _0x2e8473!=='object'||Object[_0x5f402e(0xe0)](_0x2e8473)[_0x5f402e(0xd7)]===0x0)return null;return Object['entries'](_0x2e8473)[_0x5f402e(0xe4)](([_0x217891,_0x448ca5])=>({'name':_0x217891,'appcode':_0x448ca5?.[_0x5f402e(0xf7)]||'','isDefault':_0x217891===_0x1a8483,'env':_0x448ca5?.['env'],'apiDir':_0x448ca5?.['apiDir'],'cookie':_0x448ca5?.['cookie']||undefined}))[_0x5f402e(0xf6)](_0x1f233f=>_0x1f233f[_0x5f402e(0xf7)]);}function a195_0x9f31(){const _0x92aaa0=['join','env','template_base_url','defaultApp','apiDir','object','1490615JPxgwo','4328271KdHKab','length','2301990GFuqmF','api.ts','runtimeDomain','2IAoybM','globalConfig','./constant/env.js','1471330AEHQnL','project','keys','cwd','trim','find','map','string','./utils/is-non-interactive.js','1638472DoOMxi','app','replace','argv','1288136OJUHKv','16BwPPCW','18sOnHOU','./constant/domain.js','130372HrRVvF','setLogPath','apiDomain','apps','userDomain','https://g.lovrabet.com/dist/lovrabet-skill','99iibHVM','filter','appcode','projectConfig','setRawCommand','merged'];a195_0x9f31=function(){return _0x92aaa0;};return a195_0x9f31();}export function getTemplateBaseUrl(_0x20219f){const _0x36b42d=a195_0x19950c,_0x1b036b=readRawConfig(_0x20219f);if(_0x1b036b[_0x36b42d(0xfd)]&&typeof _0x1b036b[_0x36b42d(0xfd)]===_0x36b42d(0xe5))return _0x1b036b[_0x36b42d(0xfd)][_0x36b42d(0xe9)](/\/$/,'');return _0x36b42d(0xf4);}function buildConfig(_0x4abaa8,_0x1e7d1f,_0x3f2c4b){return{...resolveAppConfig({'raw':_0x4abaa8,'flags':_0x1e7d1f,'layers':_0x3f2c4b,'readEnv':env}),'raw':_0x4abaa8};}export function resolveApiFilePath(_0x3097d7,_0x1672cb){const _0x2a9244=a195_0x19950c,_0x4076c7=resolve(process[_0x2a9244(0xe1)](),_0x3097d7),_0x370672=resolve(_0x4076c7,_0x2a9244(0xd9));if(!_0x1672cb)return _0x370672;const _0x5a668b=readRawConfig(),_0xea2b3d=_0x5a668b[_0x2a9244(0xf2)]&&typeof _0x5a668b[_0x2a9244(0xf2)]===_0x2a9244(0xd4)?_0x5a668b[_0x2a9244(0xf2)]:{},_0xf2c267=Object['entries'](_0xea2b3d)[_0x2a9244(0xe3)](([,_0x490895])=>_0x490895?.[_0x2a9244(0xf7)]===_0x1672cb);if(!_0xf2c267)return _0x370672;const [_0x3ae38d,_0x6e3b42]=_0xf2c267,_0x1dabf9=typeof _0x5a668b[_0x2a9244(0xd2)]===_0x2a9244(0xe5)?_0x5a668b['defaultApp']:undefined;if(_0x6e3b42?.[_0x2a9244(0xd3)])return _0x370672;if(_0x1dabf9&&_0x3ae38d!==_0x1dabf9)return resolve(_0x4076c7,_0x3ae38d+'-api.ts');return _0x370672;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x43a5d7,_0x59b9a4){const _0x4d7ba4=a196_0x5746,_0x82d646=_0x43a5d7();while(!![]){try{const _0x2a2c69=-parseInt(_0x4d7ba4(0x1b6))/0x1+parseInt(_0x4d7ba4(0x1c0))/0x2*(parseInt(_0x4d7ba4(0x1bf))/0x3)+-parseInt(_0x4d7ba4(0x1c1))/0x4+parseInt(_0x4d7ba4(0x1b7))/0x5*(-parseInt(_0x4d7ba4(0x1be))/0x6)+parseInt(_0x4d7ba4(0x1b9))/0x7+-parseInt(_0x4d7ba4(0x1b8))/0x8*(-parseInt(_0x4d7ba4(0x1b5))/0x9)+parseInt(_0x4d7ba4(0x1b4))/0xa;if(_0x2a2c69===_0x59b9a4)break;else _0x82d646['push'](_0x82d646['shift']());}catch(_0x2e318b){_0x82d646['push'](_0x82d646['shift']());}}}(a196_0x2fe0,0x6604c));function a196_0x2fe0(){const _0x128d59=['144756SfyBoL','12GXfAna','65732rOlLdA','2437036kunidu','api.ts','7463880ZbjkZj','115515EXbmTO','524225dslIPr','10hIjQcr','16LDnmew','4872574EPayYC','cwd','push','get','utf-8'];a196_0x2fe0=function(){return _0x128d59;};return a196_0x2fe0();}function a196_0x5746(_0x210394,_0x2860eb){_0x210394=_0x210394-0x1b4;const _0x2fe038=a196_0x2fe0();let _0x574637=_0x2fe038[_0x210394];return _0x574637;}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x1af1b2){const _0x45227f=a196_0x5746,_0x118d74=[],_0x1e33b6=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0xd254c9;while((_0xd254c9=_0x1e33b6['exec'](_0x1af1b2))!==null){_0x118d74[_0x45227f(0x1bb)]({'datasetCode':_0xd254c9[0x1],'tableName':_0xd254c9[0x2],'name':_0xd254c9[0x3],'alias':_0xd254c9[0x4]});}return _0x118d74;}export function loadAliasMap(_0x3dd6d5,_0x67ca19,_0xc34f8e){const _0x9844c=a196_0x5746,_0x50f75f=_0xc34f8e??resolve(process[_0x9844c(0x1ba)](),_0x3dd6d5,_0x9844c(0x1c2));if(cache['has'](_0x50f75f))return cache[_0x9844c(0x1bc)](_0x50f75f);if(!existsSync(_0x50f75f))return cache['set'](_0x50f75f,[]),[];try{const _0x4d08be=readFileSync(_0x50f75f,_0x9844c(0x1bd)),_0x54df98=parseApiFile(_0x4d08be);return cache['set'](_0x50f75f,_0x54df98),_0x54df98;}catch{return cache['set'](_0x50f75f,[]),[];}}export function resolveAlias(_0x380463,_0x5a9e44,_0x3c818c,_0x263ea9){if(!_0x5a9e44)return undefined;const _0x3d2d7a=loadAliasMap(_0x380463,_0x3c818c,_0x263ea9),_0x302dad=_0x3d2d7a['find'](_0x49d010=>_0x49d010['alias']===_0x5a9e44);return _0x302dad?.['datasetCode'];}export function listAliases(_0x55321,_0x28143e,_0xac55d){return loadAliasMap(_0x55321,_0x28143e,_0xac55d);}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xebd3ec,_0x4e9ff9){const _0x32e50e=a197_0x2666,_0x5ca001=_0xebd3ec();while(!![]){try{const _0x3e35f1=-parseInt(_0x32e50e(0x1cf))/0x1+parseInt(_0x32e50e(0x216))/0x2+-parseInt(_0x32e50e(0x1cb))/0x3*(parseInt(_0x32e50e(0x1a6))/0x4)+parseInt(_0x32e50e(0x1a3))/0x5*(-parseInt(_0x32e50e(0x1c0))/0x6)+-parseInt(_0x32e50e(0x1e8))/0x7+-parseInt(_0x32e50e(0x25f))/0x8+-parseInt(_0x32e50e(0x21f))/0x9*(-parseInt(_0x32e50e(0x1af))/0xa);if(_0x3e35f1===_0x4e9ff9)break;else _0x5ca001['push'](_0x5ca001['shift']());}catch(_0x20ef54){_0x5ca001['push'](_0x5ca001['shift']());}}}(a197_0x3fd2,0xa1c13));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(_0x6ac674){_activeCookie=_0x6ac674||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(_0x2c13e3,_0x59291c){const _0x235b85=a197_0x2666,_0x13fe5e=_0x59291c instanceof Error?_0x59291c['message']:String(_0x59291c);return CliErrors[_0x235b85(0x225)](_0x235b85(0x20c)+_0x2c13e3+(_0x13fe5e?'\x20('+_0x13fe5e+')':''),_0x235b85(0x1d7));}async function apiRequest(_0x34898c,_0xc0c801={}){const _0x216981=a197_0x2666,{method:method=_0x216981(0x272),body:_0x13e3de,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0xc0c801,_0x2d76c0=useRuntime?getRuntimeDomain():getApiDomain(),_0xc632df=_activeCookie||getCookie(),_0x1076de=''+_0x2d76c0+_0x34898c,_0x3adfad=new AbortController(),_0x1aa1b2=setTimeout(()=>_0x3adfad['abort'](),timeout);try{const _0x5d10f7=await fetch(_0x1076de,{'method':method,'headers':{'Content-Type':_0x216981(0x22b),'Cookie':_0xc632df,'X-Invoke-Source':_0x216981(0x1b5),...headers},'body':_0x13e3de?JSON[_0x216981(0x230)](_0x13e3de):undefined,'signal':_0x3adfad['signal']});let _0x4c8bbf;try{_0x4c8bbf=await _0x5d10f7[_0x216981(0x274)]();}catch(_0x1ba3b6){if(_0x1ba3b6 instanceof Error&&_0x1ba3b6[_0x216981(0x1a5)]===_0x216981(0x266))throw CliErrors['apiError'](_0x216981(0x1f6)+_0x1076de);if(_0x5d10f7['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x216981(0x225)](_0x216981(0x1fd)+_0x5d10f7[_0x216981(0x1be)]+')',_0x5d10f7['status']>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x5d10f7['ok']||_0x4c8bbf['success']===![])throw CliErrors['apiError'](_0x4c8bbf[_0x216981(0x1bf)]||_0x4c8bbf[_0x216981(0x1da)]||'API\x20error:\x20'+_0x5d10f7[_0x216981(0x1be)],_0x4c8bbf[_0x216981(0x25a)]?_0x216981(0x25c)+_0x4c8bbf[_0x216981(0x25a)]:undefined);return _0x4c8bbf;}catch(_0x38debc){if(_0x38debc instanceof CliError)throw _0x38debc;if(_0x38debc instanceof Error&&_0x38debc['name']===_0x216981(0x266))throw CliErrors['apiError'](_0x216981(0x1f6)+_0x1076de);throw createFetchFailureError(_0x1076de,_0x38debc);}finally{clearTimeout(_0x1aa1b2);}}async function apiFormRequest(_0x2fc922,_0xa04181,_0x284cf7={}){const _0x305cce=a197_0x2666,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x284cf7,_0x155176=_activeCookie||getCookie(),_0x3598ed=''+getApiDomain()+_0x2fc922,_0xcd145b=new AbortController(),_0x1ecd9c=setTimeout(()=>_0xcd145b[_0x305cce(0x239)](),timeout);try{const _0x409dbb=await fetch(_0x3598ed,{'method':'POST','headers':{'Cookie':_0x155176,'X-Invoke-Source':_0x305cce(0x1b5)},'body':_0xa04181,'signal':_0xcd145b[_0x305cce(0x273)]});let _0x488e1f;try{_0x488e1f=await _0x409dbb['json']();}catch(_0x2b0cea){if(_0x2b0cea instanceof Error&&_0x2b0cea[_0x305cce(0x1a5)]===_0x305cce(0x266))throw CliErrors[_0x305cce(0x225)](_0x305cce(0x1f6)+_0x3598ed);throw CliErrors[_0x305cce(0x225)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x409dbb[_0x305cce(0x1be)]+')',_0x409dbb['status']>=0x190?_0x305cce(0x261):undefined);}if(!_0x409dbb['ok']||_0x488e1f['success']===![])throw CliErrors['apiError'](_0x488e1f[_0x305cce(0x1bf)]||_0x488e1f['message']||_0x305cce(0x1e4)+_0x409dbb[_0x305cce(0x1be)],_0x488e1f[_0x305cce(0x25a)]?_0x305cce(0x25c)+_0x488e1f[_0x305cce(0x25a)]:undefined);return _0x488e1f;}catch(_0xb1a963){if(_0xb1a963 instanceof CliError)throw _0xb1a963;if(_0xb1a963 instanceof Error&&_0xb1a963[_0x305cce(0x1a5)]===_0x305cce(0x266))throw CliErrors['apiError'](_0x305cce(0x1f6)+_0x3598ed);throw createFetchFailureError(_0x3598ed,_0xb1a963);}finally{clearTimeout(_0x1ecd9c);}}export async function uploadDevelopmentFile(_0x5eca33,_0x1aa938){const _0x519e09=a197_0x2666,_0x3e4f95=await readFile(_0x1aa938),_0x2a6230=new FormData();_0x2a6230[_0x519e09(0x237)](_0x519e09(0x223),_0x5eca33),_0x2a6230['append']('file',new Blob([new Uint8Array(_0x3e4f95)]),basename(_0x1aa938));const _0x44dd06=await apiFormRequest(_0x519e09(0x209),_0x2a6230);return _0x44dd06[_0x519e09(0x285)];}export async function queryDevelopmentFileUrl(_0x2c18b2,_0x2f7973={}){const _0xd222fd=a197_0x2666,_0x3cb6e5=await apiRequest('/smartapi/common/queryFileUrl',{'method':_0xd222fd(0x1b1),'body':{'filePath':_0x2c18b2,'downloadFlag':_0x2f7973[_0xd222fd(0x27f)]??![],..._0x2f7973[_0xd222fd(0x1ca)]?{'longTerm':!![]}:{}}});return _0x3cb6e5[_0xd222fd(0x285)];}function isAuthFailure(_0x35d865){const _0x2e3de3=a197_0x2666,_0x12c010=_0x35d865[_0x2e3de3(0x1bf)]||_0x35d865['message']||_0x35d865[_0x2e3de3(0x285)]?.[_0x2e3de3(0x1da)]||_0x35d865[_0x2e3de3(0x23b)]||_0x35d865[_0x2e3de3(0x1ba)]||'';return _0x35d865[_0x2e3de3(0x25a)]===_0x2e3de3(0x271)||_0x35d865[_0x2e3de3(0x1ab)]===0x191||_0x35d865['code']==='401'||_0x12c010[_0x2e3de3(0x277)](_0x2e3de3(0x1b8))||_0x12c010['includes'](_0x2e3de3(0x205))||_0x12c010[_0x2e3de3(0x277)]('登录')||_0x12c010[_0x2e3de3(0x277)]('认证');}export async function platformFetch(_0x23a1ca,_0x42b3db){const _0x340143=a197_0x2666;let _0x4b322c;try{_0x4b322c=await fetch(_0x23a1ca,{'method':_0x42b3db['method']??_0x340143(0x272),'headers':{'Content-Type':_0x340143(0x22b),'Cookie':_0x42b3db[_0x340143(0x24b)],'X-Invoke-Source':_0x340143(0x1b5)},..._0x42b3db['body']&&{'body':JSON[_0x340143(0x230)](_0x42b3db[_0x340143(0x250)])}});}catch(_0x5c4136){throw createFetchFailureError(_0x23a1ca,_0x5c4136);}if(!_0x4b322c['ok']){if(_0x4b322c[_0x340143(0x1be)]===0x191)throw CliErrors[_0x340143(0x1d5)]();throw CliErrors[_0x340143(0x225)](_0x42b3db['label']+_0x340143(0x23a)+_0x4b322c[_0x340143(0x1be)]);}const _0x58e02f=await _0x4b322c[_0x340143(0x274)]();if(_0x58e02f[_0x340143(0x213)]===![]){if(isAuthFailure(_0x58e02f))throw CliErrors[_0x340143(0x1d5)]();throw CliErrors['apiError'](_0x58e02f[_0x340143(0x1bf)]||_0x58e02f[_0x340143(0x1da)]||_0x42b3db[_0x340143(0x270)]+_0x340143(0x1e2));}return _0x58e02f[_0x340143(0x285)];}export async function platformRequest(_0x5f4d04,_0x15a78d){const _0x5f0ad4=a197_0x2666;if(/^https?:\/\//i['test'](_0x5f4d04))throw CliErrors[_0x5f0ad4(0x1f1)](_0x5f0ad4(0x281)+_0x5f4d04,_0x5f0ad4(0x20b));const _0x3a4d28=_0x5f4d04['startsWith']('/')?_0x5f4d04:'/'+_0x5f4d04;return platformFetch(''+getApiDomain()+_0x3a4d28,_0x15a78d);}function cleanNewlines(_0x7006ab){const _0x2a7a87=a197_0x2666;return _0x7006ab[_0x2a7a87(0x1d2)](/[\r\n]+/g,'\x20')[_0x2a7a87(0x24c)]();}function cleanDatasetName(_0x689d9e){const _0x1f3337=a197_0x2666;if(!_0x689d9e[_0x1f3337(0x1a5)])return _0x689d9e;return{..._0x689d9e,'name':cleanNewlines(_0x689d9e[_0x1f3337(0x1a5)])};}export async function fetchModelList(_0x5663d2,_0x29f4b0){const _0x57187f=a197_0x2666,_0x120aca=getEnv(),_0x357420=new URLSearchParams({'appcode':_0x5663d2,'otype':'array'}),_0x14ef00=_0x57187f(0x248)+_0x357420[_0x57187f(0x1aa)]();logger[_0x57187f(0x241)]('fetch-model-list',_0x57187f(0x280)+_0x120aca+')',{'apiPath':_0x14ef00});const _0x467195=await platformRequest(_0x14ef00,{'cookie':_0x29f4b0,'label':_0x57187f(0x26a)}),_0x30f29f=(_0x467195[_0x57187f(0x1c4)]??[])[_0x57187f(0x20d)](cleanDatasetName);return{'configArray':_0x30f29f,'count':_0x30f29f[_0x57187f(0x259)]};}export async function fetchDatasetDoc(_0x32c813){const _0x4e7ed1=a197_0x2666,{appCode:_0x5e1eb4,cookie:_0x2c51ec,datasetCode:_0x1547d8,datasetId:_0x185ab7,extraParams:_0x11b062}=_0x32c813,_0x1cf9c5=await platformRequest('/api/node-toolbox/api-doc-generator',{'method':'POST','body':{'appCode':_0x5e1eb4,'datasetCode':_0x1547d8,'datasetId':_0x185ab7,..._0x11b062||{}},'cookie':_0x2c51ec,'label':_0x4e7ed1(0x282)+_0x1547d8+')'});if(!_0x1cf9c5||typeof _0x1cf9c5[_0x4e7ed1(0x1b7)]!=='string')throw new Error('Invalid\x20response\x20format\x20('+_0x1547d8+_0x4e7ed1(0x1b3));return _0x1cf9c5[_0x4e7ed1(0x1b7)];}export async function getMenuTree(_0x5bcf71,_0x174d38){const _0x332464=a197_0x2666,_0x262f0f=new URLSearchParams({'appCode':_0x5bcf71});return platformRequest(_0x332464(0x263)+_0x262f0f['toString'](),{'cookie':_0x174d38,'label':_0x332464(0x1fa)});}export async function createMenuRecord(_0xa9487f,_0x4a51b3,_0x49e242){const _0x494fe3=a197_0x2666;return platformRequest('/smartapi/menu/create',{'method':_0x494fe3(0x1b1),'body':_0xa9487f,'cookie':_0x4a51b3,'label':_0x49e242});}export async function updateMenuRecord(_0x4d21e6,_0x265a35,_0x4f5349){const _0x3b0137=a197_0x2666;return platformRequest(_0x3b0137(0x1a7),{'method':_0x3b0137(0x1b1),'body':_0x4d21e6,'cookie':_0x265a35,'label':_0x4f5349});}export async function deleteMenuRecord(_0x3def14,_0x1ebfe1,_0x85b030){const _0x5c9e2b=a197_0x2666;return platformRequest(_0x5c9e2b(0x211),{'method':'POST','body':{'id':_0x3def14},'cookie':_0x1ebfe1,'label':_0x85b030});}export async function batchDeleteMenuRecords(_0x52c36f,_0x173501,_0x2d8ece){const _0x5b199e=a197_0x2666;return platformRequest(_0x5b199e(0x246),{'method':_0x5b199e(0x1b1),'body':{'idList':_0x52c36f},'cookie':_0x173501,'label':_0x2d8ece});}export async function startMenuRegroup(_0x4d000a,_0x2932cd,_0x1dd47e){const _0x9b0835=a197_0x2666;return platformRequest('/smartapi/menu/regroup',{'method':_0x9b0835(0x1b1),'body':_0x4d000a,'cookie':_0x2932cd,'label':_0x1dd47e});}export async function getAsyncTaskStatus(_0x5974d9,_0x11f024,_0x352363){const _0x46c8de=a197_0x2666,_0x2e1967=new URLSearchParams({'appCode':_0x11f024});return platformRequest(_0x46c8de(0x1c2)+encodeURIComponent(_0x5974d9)+'?'+_0x2e1967['toString'](),{'cookie':_0x352363,'label':_0x46c8de(0x1ae)+_0x5974d9});}export async function listBffScripts(_0x5d1c37,_0x26d77d,_0x46c095){const _0x18b691=a197_0x2666;let _0x2d69cb='/api/management/library/scripts/list?appCode='+_0x5d1c37;if(_0x26d77d)_0x2d69cb+=_0x18b691(0x256)+_0x26d77d;const _0xe6ba3a=await apiRequest(_0x2d69cb);let _0x2fda30=extractList(_0xe6ba3a[_0x18b691(0x285)]);if(_0x46c095?.[_0x18b691(0x20f)]){const _0x340200=_0x46c095[_0x18b691(0x20f)][_0x18b691(0x27c)]();_0x2fda30=_0x2fda30[_0x18b691(0x275)](_0x17be69=>_0x17be69[_0x18b691(0x249)]?.[_0x18b691(0x27c)]()[_0x18b691(0x277)](_0x340200)||_0x17be69[_0x18b691(0x236)]?.[_0x18b691(0x27c)]()[_0x18b691(0x277)](_0x340200));}return _0x2fda30;}export async function getBffScriptInfo(_0x2d7da3){const _0x42ad0d=a197_0x2666,_0x52d7ed=await apiRequest(_0x42ad0d(0x218)+_0x2d7da3);if(!_0x52d7ed['data'])throw CliErrors['validation'](_0x42ad0d(0x227)+_0x2d7da3);return _0x52d7ed['data'];}export async function saveBffScript(_0xb17ca9){const _0x38f818=a197_0x2666,_0x59897d=await apiRequest(_0x38f818(0x1e0),{'method':_0x38f818(0x1b1),'body':_0xb17ca9}),{id:_0x4139a0,entity:_0x2ecb33}=normalizeEntityWithIdResponse(_0x59897d[_0x38f818(0x285)]);if(_0x4139a0!==undefined){const _0x5e7a28=typeof _0x2ecb33[_0x38f818(0x249)]===_0x38f818(0x21c)||typeof _0x2ecb33[_0x38f818(0x1db)]===_0x38f818(0x21c)?_0x2ecb33:undefined;return{'id':_0x4139a0,'script':_0x5e7a28};}throw CliErrors[_0x38f818(0x225)](_0x38f818(0x1c8));}export async function deleteBffScript(_0x5b317a){const _0x1a57da=a197_0x2666;await apiRequest(_0x1a57da(0x27b),{'method':_0x1a57da(0x1b1),'body':{'id':_0x5b317a}});}export async function getBffScriptStatistics(_0x300301){const _0x520797=a197_0x2666,_0x48cffd=await apiRequest(_0x520797(0x20a)+_0x300301);return extractList(_0x48cffd[_0x520797(0x285)]);}export async function clearBffScriptCache(){const _0x6b5ff0=a197_0x2666,_0x33ce59=await apiRequest(_0x6b5ff0(0x1a9),{'method':_0x6b5ff0(0x1b1),'useRuntime':!![]});return typeof _0x33ce59['data']==='string'?_0x33ce59[_0x6b5ff0(0x285)]:'';}export async function listBffDatasetOperations(_0x4469c0,_0xbcbc44){const _0x3e719a=a197_0x2666,_0x294ffb=await apiRequest(_0x3e719a(0x24d),{'method':_0x3e719a(0x1b1),'body':{'appCode':_0x4469c0,'datasetId':_0xbcbc44}});return _0x294ffb[_0x3e719a(0x285)];}export async function listSqlQueries(_0x657326,_0x578a6b){const _0x3043c6=a197_0x2666,_0x5ad6d8=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0x3043c6(0x1b1),'body':{'appCode':_0x657326,'currentPage':_0x578a6b?.[_0x3043c6(0x284)]??0x1,'pageSize':_0x578a6b?.[_0x3043c6(0x233)]??0x32,'sqlCode':_0x578a6b?.['sqlCode'],'sqlName':_0x578a6b?.[_0x3043c6(0x1d8)]}});return _0x5ad6d8[_0x3043c6(0x285)];}export async function getSqlQueryInfo(_0x138ed3,_0x2411c2){const _0x546ebf=a197_0x2666,_0x5de0ee=await listSqlQueries(_0x138ed3,{'sqlCode':_0x2411c2}),_0x48d462=_0x5de0ee['tableData']?.[0x0];if(!_0x48d462)throw CliErrors[_0x546ebf(0x1f1)](_0x546ebf(0x232)+_0x2411c2);return _0x48d462;}export async function getSqlQueryDetail(_0x1597ce){const _0x26d1d3=a197_0x2666,_0x563eb8=await apiRequest(_0x26d1d3(0x1ea)+('?sqlCode='+encodeURIComponent(_0x1597ce)));if(!_0x563eb8[_0x26d1d3(0x285)])throw CliErrors[_0x26d1d3(0x1f1)](_0x26d1d3(0x232)+_0x1597ce);return _0x563eb8[_0x26d1d3(0x285)];}export async function getSqlQueryDetailById(_0x454590){const _0x5365fe=a197_0x2666,_0x2a84f5=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x454590);if(!_0x2a84f5[_0x5365fe(0x285)])throw CliErrors['validation'](_0x5365fe(0x283)+_0x454590);return _0x2a84f5[_0x5365fe(0x285)];}export async function createSqlQuery(_0x3d5ec0){const _0x1d799c=a197_0x2666,_0x5000ed=await apiRequest(_0x1d799c(0x23e),{'method':'POST','body':_0x3d5ec0}),{id:_0x3e07fe,entity:_0x427752}=normalizeEntityWithIdResponse(_0x5000ed[_0x1d799c(0x285)]);if(!(_0x1d799c(0x21e)in _0x427752)&&_0x3e07fe)return getSqlQueryDetailById(_0x3e07fe);return normalizeSqlQueryEntity(_0x427752);}function a197_0x3fd2(){const _0x28de06=['/smartapi/question/er-config/cli/erCreate','/smartapi/dblink/getTableDiffV2ByPage','totalCount','Fetch\x20menu\x20list','remove','userTenantRelationList','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/generate-standard-pages/start','/smartapi/question/er-config/cli/delete-single','\x22\x20not\x20found\x20in\x20dataset\x20','datasetTableCount','/api/node-toolbox/sql/save','api_error','responseFields','Unauthorized','/smartapi/dataset/text-generate/preview','\x20\x20sqlCode:\x20\x27','.remove(id);','/smartapi/common/uploadFile','/api/management/library/scripts/statistics?appCode=','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','Request\x20failed:\x20','map','/smartapi/dblink/getOne','scriptName','/filter','/smartapi/menu/delete','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','success','hint','datasetName','627232ikEArl','needPublic','/api/management/library/scripts/info?id=','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','(/*\x20params\x20*/);','tags','string','set','sqlCode','440919MLjqvd','tableData','max','/smartapi/lovrabet/detail?pageId=','appCode','find','apiError','deleted','BFF\x20script\x20not\x20found:\x20id=','modelCode','/smartapi/permit/role/get-permit-list','push','application/json','physicalTableCount','getOne','type','//\x20SQL:\x20','stringify','needSelf','SQL\x20query\x20not\x20found:\x20','pageSize','displayName','/smartapi/dblink/delete','description','append','userId','abort','\x20failed,\x20HTTP\x20','errorMessage','enabled','/smartapi/dblink/create','/smartapi/custom/saveUserCustomSql','email','/smartapi/permit/page/get-one','info','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/permit/user-role/update-user-list','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','key','/smartapi/menu/batchDelete','isFinite','/api/node-toolbox/dataset/model-list?','functionName','/userTenant/getByTenantCode','cookie','trim','/smartapi/dataset/get-dataset-operation','/smartapi/dataset/update-driven-data','Dataset\x20not\x20found:\x20','body','test','Operation\x20\x22','/smartapi/dataset/get-dataset-list','/sync-to-pages','/smartapi/permit/resource/get-menu-list','&type=','/smartapi/db-analysis/status/','value','length','errorCode','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','API\x20error\x20code:\x20','operationName','/smartapi/permit/role/get-list','1398760cbJoee','tableList','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','/smartapi/menu/find?','/smartapi/lovrabet/update-page','clientOperationId','AbortError','path','method','join','Fetch\x20datasets','operationId','/smartapi/permit/role/delete','username','relation','target','label','UNAUTHORIZED','GET','signal','json','filter','/smartapi/lovrabet/dataset/','includes','dataset_','entries','/smartapi/app-config/create','/api/management/library/scripts/delete','toLowerCase','//\x20','/smartapi/app/getList','download','正在从服务器拉取模型列表...\x20(环境:\x20','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','Fetch\x20doc\x20(','SQL\x20query\x20not\x20found:\x20id=','currentPage','data','Page\x20not\x20found:\x20','/smartapi/permit/resource/get-api-list','/smartapi/question/er-config/business-group/edit','/smartapi/dblink/getList','42545yyPRok','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','name','56DzzQSV','/smartapi/menu/update','API\x20error\x20code:\x20306','/api/management/script/cache/clear','toString','code','/smartapi/dblink/update','/smartapi/db-analysis/jobs/cancel','Fetch\x20async\x20task\x20','630nLBgMo','.create({\x20/*\x20fields\x20*/\x20});','POST','avatar','):\x20missing\x20data.markdown\x20field','remark','cli:rabetbase','/smartapi/permit/role/update','markdown','401','sdk','error','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','/smartapi/dataset/get-driven-data?','/smartapi/app-config/delete','status','errorMsg','228wRXisl','list','/smartapi/tasks/','/smartapi/app-config/getByKey','configArray','summary','ER\x20relation\x20does\x20not\x20exist','object','BFF\x20save\x20returned\x20no\x20valid\x20id','});','longTerm','229980ethiSF','isArray','roleType','/smartapi/dataset/delete-dataset','219292IfxkNe','/generate-standard-pages/status?','mobile','replace','/smartapi/dblink/getAllTableList','has','authRequired','\x20\x20currentPage:\x201,','Check\x20network\x20connectivity\x20and\x20try\x20again.','sqlName','.filter({','message','scriptType','const\x20result\x20=\x20await\x20client.models.','table','/smartapi/question/er-config/cli/update-single','includeImports','/api/management/library/scripts/save','/smartapi/dataset/text-generate/status?','\x20failed','operations','API\x20error:\x20','dbId','permits','min','6627481CajJHK','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','/smartapi/custom/getUserCustomSql','/notification/channel-config/list','/smartapi/permit/role/get-one','CUSTOM','ENABLE','Warning:\x20showing\x20first\x20','roleName','validation','dbtableConfig','/smartapi/permit/role/create','/smartapi/app-config/list','tableName','Request\x20timeout:\x20'];a197_0x3fd2=function(){return _0x28de06;};return a197_0x3fd2();}export async function updateSqlQuery(_0x5d8fee){const _0xeb6f0c=a197_0x2666,_0x1f809d=await apiRequest('/smartapi/custom/updateUserCustomSql',{'method':_0xeb6f0c(0x1b1),'body':_0x5d8fee}),{id:_0x1fde5a,entity:_0x26cecc}=normalizeEntityWithIdResponse(_0x1f809d[_0xeb6f0c(0x285)]);if(!(_0xeb6f0c(0x21e)in _0x26cecc)){if(_0x5d8fee[_0xeb6f0c(0x21e)])return getSqlQueryDetail(_0x5d8fee[_0xeb6f0c(0x21e)]);if(_0x1fde5a)return getSqlQueryDetailById(_0x1fde5a);}return normalizeSqlQueryEntity(_0x26cecc);}export async function deleteSqlQuery(_0x5e1e98){const _0x34c091=a197_0x2666;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x34c091(0x1b1),'body':_0x5e1e98});}export async function saveSqlQuery(_0x4a0c4c){const _0x19b801=a197_0x2666,_0x16299e=await apiRequest(_0x19b801(0x202),{'method':_0x19b801(0x1b1),'body':_0x4a0c4c});return _0x16299e['data'];}function normalizeSqlQueryEntity(_0x325a76){const _0x2fc185=a197_0x2666;return{..._0x325a76,'id':Number(_0x325a76['id']),'dbId':_0x325a76[_0x2fc185(0x1e5)]==null?undefined:Number(_0x325a76[_0x2fc185(0x1e5)]),'version':_0x325a76['version']==null?undefined:Number(_0x325a76['version'])};}export async function executeSql(_0x52ced7,_0x390711,_0x5ac439){const _0x5d925b=a197_0x2666,_0x41d33e=await apiRequest('/api/custom/executeSql',{'method':'POST','body':{'appCode':_0x52ced7,'sqlCode':_0x390711,..._0x5ac439&&{'params':_0x5ac439}},'useRuntime':!![]});return _0x41d33e[_0x5d925b(0x285)];}export async function executeDatasetDataOperation(_0x30ee41,_0x51f9ed,_0x301040,_0x1f93c1={}){const _0x41d295=a197_0x2666;try{const _0x5d5aea=await apiRequest('/api/'+_0x30ee41+'/'+_0x51f9ed+'/'+_0x301040,{'method':_0x41d295(0x1b1),'body':_0x1f93c1,'useRuntime':!![]});return _0x5d5aea[_0x41d295(0x285)];}catch(_0x5ae9a0){if(_0x301040===_0x41d295(0x22d)&&_0x5ae9a0 instanceof CliError&&_0x5ae9a0[_0x41d295(0x1ab)]===_0x41d295(0x203)&&_0x1f93c1['id']!==undefined&&_0x1f93c1['id']!==null&&_0x1f93c1['id']!==''){const _0x53d856=await apiRequest('/api/'+_0x30ee41+'/'+_0x51f9ed+_0x41d295(0x210),{'method':_0x41d295(0x1b1),'body':{'where':{'id':{'$eq':_0x1f93c1['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x4ad21d=Array[_0x41d295(0x1cc)](_0x53d856[_0x41d295(0x285)]?.['tableData'])?_0x53d856['data'][_0x41d295(0x220)]:[];return _0x4ad21d[0x0]??null;}throw _0x5ae9a0;}}export async function listDatasets(_0x18bd48,_0x58586c){const _0x5cdf64=a197_0x2666,_0x5431d8={'appCode':_0x18bd48,'deleted':_0x58586c?.[_0x5cdf64(0x226)]??![]};if(_0x58586c?.[_0x5cdf64(0x1ab)])_0x5431d8[_0x5cdf64(0x1ab)]=_0x58586c['code'];if(_0x58586c?.['name'])_0x5431d8[_0x5cdf64(0x1a5)]=_0x58586c[_0x5cdf64(0x1a5)];const _0x567fbf=await apiRequest(_0x5cdf64(0x253),{'method':_0x5cdf64(0x1b1),'body':_0x5431d8});return extractList(_0x567fbf[_0x5cdf64(0x285)]);}export async function deleteDataset(_0x3c61a3,_0x7a4c2f){const _0x53e142=a197_0x2666;await apiRequest(_0x53e142(0x1ce),{'method':_0x53e142(0x1b1),'body':{'appCode':_0x3c61a3,'datasetId':_0x7a4c2f}});}export async function restoreDataset(_0x5bd57f,_0x2d469f){const _0x45fb39=a197_0x2666;await apiRequest('/smartapi/dataset/restore-dataset',{'method':_0x45fb39(0x1b1),'body':{'appCode':_0x5bd57f,'datasetId':_0x2d469f}});}export async function previewTextGeneratedDataset(_0x4f8562,_0x3fcf4d){const _0x4fbd0a=a197_0x2666,_0xec2919=await apiRequest(_0x4fbd0a(0x206),{'method':_0x4fbd0a(0x1b1),'body':{'appCode':_0x4f8562,'datasetName':_0x3fcf4d[_0x4fbd0a(0x215)],'requirementDescription':_0x3fcf4d['requirementDescription']},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0xec2919['data'];}export async function startTextGeneratedDataset(_0x5f3de3,_0x1cc172,_0x3d488d){const _0x5d3edb=a197_0x2666,_0x5017fe=await apiRequest('/smartapi/dataset/text-generate/start',{'method':_0x5d3edb(0x1b1),'body':{'appCode':_0x5f3de3,..._0x3d488d?.[_0x5d3edb(0x265)]?{'clientOperationId':_0x3d488d['clientOperationId']}:{},'design':_0x1cc172},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5017fe[_0x5d3edb(0x285)];}export async function getTextGeneratedDatasetStatus(_0x4bcf4a,_0x4f681e){const _0x510ae5=a197_0x2666,_0x2f4fed=new URLSearchParams({'appCode':_0x4bcf4a});_0x4f681e[_0x510ae5(0x26b)]&&_0x2f4fed[_0x510ae5(0x21d)](_0x510ae5(0x26b),_0x4f681e['operationId']);_0x4f681e[_0x510ae5(0x265)]&&_0x2f4fed[_0x510ae5(0x21d)]('clientOperationId',_0x4f681e[_0x510ae5(0x265)]);const _0x15cf5d=await apiRequest(_0x510ae5(0x1e1)+_0x2f4fed[_0x510ae5(0x1aa)]());return _0x15cf5d['data'];}export async function searchDatasets(_0x45974a,_0x1186f5){const _0x1956f0=a197_0x2666,_0x2badd3=await listDatasets(_0x45974a,{'name':_0x1186f5}),_0x405204=_0x1186f5[_0x1956f0(0x27c)](),_0x47078a=new Set(_0x2badd3[_0x1956f0(0x20d)](_0x1ec0f1=>_0x1ec0f1['id'])),_0x18ada2=_0x2badd3[_0x1956f0(0x275)](_0x569627=>_0x569627[_0x1956f0(0x1f2)]?.[_0x1956f0(0x1f5)]?.[_0x1956f0(0x27c)]()['includes'](_0x405204)||_0x569627['description']?.[_0x1956f0(0x27c)]()['includes'](_0x405204)),_0x57a7f5=await listDatasets(_0x45974a,{'code':_0x1186f5});for(const _0x153a20 of _0x57a7f5){!_0x47078a[_0x1956f0(0x1d4)](_0x153a20['id'])&&(_0x2badd3[_0x1956f0(0x22a)](_0x153a20),_0x47078a['add'](_0x153a20['id']));}return _0x2badd3;}export function normalizeDatasetOperations(_0x26781b){const _0x4870d2=a197_0x2666;if(Array['isArray'](_0x26781b))return _0x26781b[_0x4870d2(0x275)](_0x27d376=>_0x27d376!=null&&typeof _0x27d376===_0x4870d2(0x1c7));if(_0x26781b&&typeof _0x26781b===_0x4870d2(0x1c7))return Object[_0x4870d2(0x279)](_0x26781b)[_0x4870d2(0x275)](([,_0xbe2609])=>_0xbe2609!=null&&typeof _0xbe2609===_0x4870d2(0x1c7))[_0x4870d2(0x20d)](([_0x18d24d,_0x22e5d6])=>({..._0x22e5d6,'name':_0x22e5d6[_0x4870d2(0x1a5)]??_0x22e5d6[_0x4870d2(0x25d)]??_0x18d24d}));return[];}export async function getDatasetDetail(_0x5a8181){const _0x53c07a=a197_0x2666,_0x148711=/^\d+$/[_0x53c07a(0x251)](_0x5a8181)?'id':_0x53c07a(0x1ab),_0x8408b6=await apiRequest(_0x53c07a(0x1bc)+_0x148711+'='+_0x5a8181);return _0x8408b6[_0x53c07a(0x285)];}export async function updateDrivenData(_0x2524cc){const _0x4f8e6b=a197_0x2666,_0x26e70a=await apiRequest(_0x4f8e6b(0x24e),{'method':_0x4f8e6b(0x1b1),'body':_0x2524cc});return _0x26e70a[_0x4f8e6b(0x285)];}export async function getDatasetOperations(_0x1a8928){const _0x2bdfbe=a197_0x2666,_0xd8455f=await getDatasetDetail(_0x1a8928),_0x5db0f1=normalizeDatasetOperations(_0xd8455f[_0x2bdfbe(0x1e3)])[_0x2bdfbe(0x20d)](_0x1a9aa3=>({'name':_0x1a9aa3['name']||_0x1a9aa3[_0x2bdfbe(0x25d)],'displayName':_0x1a9aa3[_0x2bdfbe(0x234)]||_0x1a9aa3[_0x2bdfbe(0x1a5)],'type':_0x1a9aa3[_0x2bdfbe(0x22e)],'method':_0x1a9aa3[_0x2bdfbe(0x268)],'path':_0x1a9aa3[_0x2bdfbe(0x267)],'enabled':_0x1a9aa3[_0x2bdfbe(0x23c)]??!![],'requestFields':_0x1a9aa3['requestFields'],'responseFields':_0x1a9aa3[_0x2bdfbe(0x204)]}));return{'dataset':{'id':_0xd8455f['id']??_0xd8455f['modelId'],'name':_0xd8455f[_0x2bdfbe(0x1a5)],'code':_0xd8455f['code']||_0xd8455f['modelCode'],'tableName':_0xd8455f[_0x2bdfbe(0x1f5)]||_0xd8455f[_0x2bdfbe(0x1f2)]?.[_0x2bdfbe(0x1f5)]},'operations':_0x5db0f1};}export async function getOperationDetail(_0x3ca0e9,_0x4aab89,_0x4408d4){const _0x4e9e10=a197_0x2666;let _0x595b13=_0x4aab89;if(!/^\d+$/['test'](_0x4aab89)){const _0x4ded96=await listDatasets(_0x3ca0e9,{'code':_0x4aab89}),_0x383ee7=_0x4ded96[_0x4e9e10(0x224)](_0x14f488=>_0x14f488[_0x4e9e10(0x1ab)]===_0x4aab89||String(_0x14f488['id'])===_0x4aab89);if(!_0x383ee7)throw CliErrors[_0x4e9e10(0x1f1)](_0x4e9e10(0x24f)+_0x4aab89);_0x595b13=String(_0x383ee7['id']);}const _0x5f1482=await getDatasetDetail(_0x595b13),_0xb840e8=normalizeDatasetOperations(_0x5f1482['operations'])[_0x4e9e10(0x224)](_0x4b609f=>(_0x4b609f['name']||_0x4b609f[_0x4e9e10(0x25d)])===_0x4408d4);if(!_0xb840e8)throw CliErrors[_0x4e9e10(0x1f1)](_0x4e9e10(0x252)+_0x4408d4+_0x4e9e10(0x200)+_0x4aab89);return{'dataset':{'id':_0x5f1482['id']??_0x5f1482['modelId'],'name':_0x5f1482['name'],'code':_0x5f1482[_0x4e9e10(0x1ab)]||_0x5f1482[_0x4e9e10(0x228)],'tableName':_0x5f1482[_0x4e9e10(0x1f5)]||_0x5f1482['dbtableConfig']?.['tableName']},'operation':_0xb840e8};}export async function startGenerateStandardPages(_0x3130ba,_0xc52f51,_0xbe4074){const _0x5dd8e9=a197_0x2666,_0x58e8ff=await apiRequest('/smartapi/lovrabet/dataset/'+_0xc52f51+_0x5dd8e9(0x1fe),{'method':'POST','body':{'appCode':_0x3130ba,..._0xbe4074?.[_0x5dd8e9(0x265)]?{'clientOperationId':_0xbe4074[_0x5dd8e9(0x265)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x58e8ff[_0x5dd8e9(0x285)];}export async function getGenerateStandardPagesStatus(_0x2eec9b,_0x3c6348,_0x4f59fa){const _0x4dc9c2=a197_0x2666,_0x4a0eb7=new URLSearchParams({'appCode':_0x2eec9b});_0x4f59fa['operationId']&&_0x4a0eb7[_0x4dc9c2(0x21d)]('operationId',_0x4f59fa[_0x4dc9c2(0x26b)]);_0x4f59fa[_0x4dc9c2(0x265)]&&_0x4a0eb7['set']('clientOperationId',_0x4f59fa['clientOperationId']);const _0x1ff56b=await apiRequest('/smartapi/lovrabet/dataset/'+_0x3c6348+_0x4dc9c2(0x1d0)+_0x4a0eb7[_0x4dc9c2(0x1aa)]());return _0x1ff56b['data'];}export async function getStandardPageStatus(_0x19033a,_0x210f25){const _0xeb1fbc=a197_0x2666,_0x2aaa28=await apiRequest(_0xeb1fbc(0x276)+_0x210f25+'/standard-page-status?appCode='+encodeURIComponent(_0x19033a));return _0x2aaa28['data'];}export async function tryGetStandardPageStatus(_0x4b7f39,_0x1af9a3){const _0x419a1e=a197_0x2666;try{return await getStandardPageStatus(_0x4b7f39,_0x1af9a3);}catch(_0x257474){if(_0x257474 instanceof CliError&&_0x257474[_0x419a1e(0x1ab)]===_0x419a1e(0x203)&&/404|not found|non-json response/i['test'](_0x257474['message']))return null;throw _0x257474;}}export async function syncStandardPages(_0xf4548,_0x823514){const _0x240863=a197_0x2666,_0x49f440=await apiRequest('/smartapi/lovrabet/dataset/'+_0x823514+_0x240863(0x254),{'method':_0x240863(0x1b1),'body':{'appCode':_0xf4548}});return _0x49f440[_0x240863(0x285)];}export async function getPageDetail(_0x2e35a0){const _0x371d08=a197_0x2666,_0x232a3b=await apiRequest(_0x371d08(0x222)+_0x2e35a0);if(!_0x232a3b['data'])throw CliErrors[_0x371d08(0x1f1)](_0x371d08(0x286)+_0x2e35a0);return _0x232a3b[_0x371d08(0x285)];}export async function updatePage(_0x44da04,_0x6406af,_0x1153a7,_0x23953d){const _0x5f8749=a197_0x2666,_0x1fb456=await apiRequest(_0x5f8749(0x264),{'method':'POST','body':{'appCode':_0x44da04,'pageId':_0x6406af,'code':_0x1153a7,'datasetIds':_0x23953d}});return _0x1fb456[_0x5f8749(0x285)];}export function generateSdkCode(_0x2a4879,_0x37e282,_0x1364d2){const _0x581402=a197_0x2666,_0x309ca1=_0x1364d2?.[_0x581402(0x1df)]??!![],_0x2fd887=_0x581402(0x278)+_0x2a4879[_0x581402(0x1ab)]?.[_0x581402(0x1d2)](/-/g,'_'),_0x55ca2d=_0x37e282[_0x581402(0x1a5)]||_0x37e282[_0x581402(0x25d)]||'filter',_0x138221=[];_0x309ca1&&_0x138221[_0x581402(0x22a)](_0x581402(0x219),'',_0x581402(0x1e9),'');_0x138221[_0x581402(0x22a)](_0x581402(0x27d)+_0x2a4879[_0x581402(0x1a5)]+'\x20('+(_0x2a4879[_0x581402(0x1f5)]||_0x581402(0x1dd))+')');if(_0x55ca2d===_0x581402(0x275))_0x138221['push'](_0x581402(0x1dc)+_0x2fd887+_0x581402(0x1d9),'\x20\x20where:\x20{},','\x20\x20pageSize:\x2020,',_0x581402(0x1d6),_0x581402(0x1c9));else{if(_0x55ca2d===_0x581402(0x22d))_0x138221['push']('const\x20result\x20=\x20await\x20client.models.'+_0x2fd887+'.getOne(id);');else{if(_0x55ca2d==='create')_0x138221[_0x581402(0x22a)](_0x581402(0x1dc)+_0x2fd887+_0x581402(0x1b0));else{if(_0x55ca2d==='update')_0x138221[_0x581402(0x22a)](_0x581402(0x1dc)+_0x2fd887+_0x581402(0x25b));else _0x55ca2d==='delete'||_0x55ca2d===_0x581402(0x1fb)?_0x138221[_0x581402(0x22a)](_0x581402(0x1dc)+_0x2fd887+_0x581402(0x208)):_0x138221['push']('const\x20result\x20=\x20await\x20client.models.'+_0x2fd887+'.'+_0x55ca2d+_0x581402(0x21a));}}}return _0x138221[_0x581402(0x269)]('\x0a');}export function generateSqlCodeTemplate(_0x25a9f9,_0x28b14b){const _0x3c5004=a197_0x2666,_0x260701=_0x28b14b?.[_0x3c5004(0x26f)]??_0x3c5004(0x1b9),_0x4282cc=_0x28b14b?.[_0x3c5004(0x1df)]??!![],_0x2eb6b4=[];return _0x2eb6b4[_0x3c5004(0x22a)](_0x3c5004(0x22f)+_0x25a9f9[_0x3c5004(0x1d8)]+'\x20('+_0x25a9f9[_0x3c5004(0x21e)]+')'),_0x260701===_0x3c5004(0x1b9)?(_0x4282cc&&_0x2eb6b4[_0x3c5004(0x22a)](_0x3c5004(0x219),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x2eb6b4[_0x3c5004(0x22a)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x3c5004(0x207)+_0x25a9f9[_0x3c5004(0x21e)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x3c5004(0x1c9),_0x3c5004(0x1bb),'const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x2eb6b4[_0x3c5004(0x22a)](_0x3c5004(0x244),_0x3c5004(0x212),_0x3c5004(0x262),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x25a9f9[_0x3c5004(0x21e)]+'\x27,',_0x3c5004(0x242),'\x20\x20});','\x20\x20return\x20rows;','}'),_0x2eb6b4['join']('\x0a');}export async function getErConfig(_0x18c788,_0x565a6a){const _0x596dc8=a197_0x2666,_0x2490de=await apiRequest('/smartapi/question/er-config',{'method':_0x596dc8(0x1b1),'body':{'appCode':_0x18c788,'dblinkId':_0x565a6a},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x2490de[_0x596dc8(0x285)];}export async function getErRelationDetail(_0x39d797,_0x3a10fa){const _0x200039=a197_0x2666,_0x151e87=new URLSearchParams({'appCode':_0x39d797,'relationId':String(_0x3a10fa)});try{const _0x15870d=await apiRequest('/smartapi/question/er-config/cli/detail?'+_0x151e87[_0x200039(0x1aa)]());return _0x15870d['data']?.[_0x200039(0x26e)]??null;}catch(_0x32542e){if(_0x32542e instanceof CliError&&_0x32542e[_0x200039(0x1ab)]==='api_error'&&(_0x32542e[_0x200039(0x214)]?.[_0x200039(0x277)]('DATA_NOT_EXIST')||_0x32542e[_0x200039(0x214)]===_0x200039(0x1a8)&&_0x32542e['message']===_0x200039(0x1c6)))return null;throw _0x32542e;}}export async function createErRelation(_0x5264c0){const _0x2aeb2e=a197_0x2666,_0xd44338=await apiRequest(_0x2aeb2e(0x1f7),{'method':_0x2aeb2e(0x1b1),'body':_0x5264c0,'allowNonJsonSuccess':!![]});return _0xd44338['data'];}export async function updateErRelation(_0x5c8f0f){const _0x326730=a197_0x2666,_0x1ddd05=await apiRequest(_0x326730(0x1de),{'method':_0x326730(0x1b1),'body':_0x5c8f0f,'allowNonJsonSuccess':!![]});return _0x1ddd05[_0x326730(0x285)];}export async function deleteErRelation(_0x198015){const _0x5d419c=a197_0x2666,_0x46bb64=await apiRequest(_0x5d419c(0x1ff),{'method':_0x5d419c(0x1b1),'body':_0x198015,'allowNonJsonSuccess':!![]});return _0x46bb64['data'];}export async function updateErBusinessGroup(_0x5a8182){const _0x4359e6=a197_0x2666,_0x26ca20=await apiRequest(_0x4359e6(0x1a1),{'method':_0x4359e6(0x1b1),'body':_0x5a8182,'allowNonJsonSuccess':!![]});return _0x26ca20[_0x4359e6(0x285)];}function buildQuery(_0x49f428){const _0x359eae=a197_0x2666,_0x3c301b=new URLSearchParams();for(const [_0x564d93,_0x2eabe4]of Object[_0x359eae(0x279)](_0x49f428)){if(_0x2eabe4===undefined||_0x2eabe4==='')continue;_0x3c301b[_0x359eae(0x21d)](_0x564d93,String(_0x2eabe4));}const _0x231e9d=_0x3c301b[_0x359eae(0x1aa)]();return _0x231e9d?'?'+_0x231e9d:'';}export async function listNotificationChannelConfigs(_0x51b674,_0x332620){const _0x3eb356=a197_0x2666,_0x542253=await apiRequest(_0x3eb356(0x1eb)+buildQuery({'appCode':_0x51b674,'channelType':_0x332620}));return Array['isArray'](_0x542253[_0x3eb356(0x285)])?_0x542253[_0x3eb356(0x285)]:[];}export async function listAppConfigs(_0x3964e1,_0x55dccc){const _0x43731a=a197_0x2666,_0x5ae096=await apiRequest(_0x43731a(0x1f4),{'method':_0x43731a(0x1b1),'body':{'appCode':_0x3964e1,..._0x55dccc?.['key']?{'key':_0x55dccc[_0x43731a(0x245)]}:{},..._0x55dccc?.[_0x43731a(0x21b)]?{'tags':_0x55dccc['tags']}:{}}});return extractAppConfigList(_0x5ae096[_0x43731a(0x285)]);}export async function getAppConfigByKey(_0x4ee9fc,_0x1b3fda){const _0x4f5a48=a197_0x2666,_0x1a9a26=await apiRequest(_0x4f5a48(0x1c3)+buildQuery({'appCode':_0x4ee9fc,'key':_0x1b3fda}));return _0x1a9a26[_0x4f5a48(0x285)]??null;}export async function createAppConfig(_0xe7001c){const _0x50db26=a197_0x2666,_0x15d367=await apiRequest(_0x50db26(0x27a),{'method':_0x50db26(0x1b1),'body':{'appCode':_0xe7001c[_0x50db26(0x223)],'key':_0xe7001c[_0x50db26(0x245)],'value':_0xe7001c[_0x50db26(0x258)],..._0xe7001c['tags']?{'tags':_0xe7001c[_0x50db26(0x21b)]}:{}}});return _0x15d367[_0x50db26(0x285)];}export async function updateAppConfig(_0x3c602e){const _0x3f6443=a197_0x2666;await apiRequest('/smartapi/app-config/update',{'method':_0x3f6443(0x1b1),'body':{'id':_0x3c602e['id'],'appCode':_0x3c602e['appCode'],'key':_0x3c602e[_0x3f6443(0x245)],'value':_0x3c602e[_0x3f6443(0x258)],..._0x3c602e[_0x3f6443(0x21b)]?{'tags':_0x3c602e[_0x3f6443(0x21b)]}:{}}});}export async function deleteAppConfig(_0x149fde){const _0x34d312=a197_0x2666;await apiRequest(_0x34d312(0x1bd),{'method':_0x34d312(0x1b1),'body':_0x149fde});}function extractAppConfigList(_0x161316){const _0x538163=a197_0x2666;if(Array[_0x538163(0x1cc)](_0x161316))return _0x161316;if(_0x161316&&typeof _0x161316===_0x538163(0x1c7)&&Array[_0x538163(0x1cc)](_0x161316[_0x538163(0x1c1)]))return _0x161316['list'];return extractList(_0x161316);}export async function listDbLinks(_0x4421a9,_0x3788dc){const _0x386c61=a197_0x2666,_0x4ec27e=await apiRequest(_0x386c61(0x1a2),{'method':_0x386c61(0x1b1),'body':{'appCode':_0x4421a9,'currentPage':_0x3788dc?.['currentPage']??0x1,'pageSize':_0x3788dc?.[_0x386c61(0x233)]??0x64}});return{'items':extractList(_0x4ec27e[_0x386c61(0x285)]),'paging':extractPaging(_0x4ec27e[_0x386c61(0x285)])};}export async function getDbLinkInfo(_0x4b4dc6){const _0x5502ae=a197_0x2666,_0x4026eb=await apiRequest(_0x5502ae(0x20e)+buildQuery({'id':_0x4b4dc6}));return _0x4026eb['data'];}export async function createDbLink(_0x173d7c){const _0x39e9fd=a197_0x2666,_0x262cf6=await apiRequest(_0x39e9fd(0x23d),{'method':_0x39e9fd(0x1b1),'body':_0x173d7c});return _0x262cf6[_0x39e9fd(0x285)];}export async function updateDbLink(_0x52203e){const _0x1e6f5c=a197_0x2666,_0x26ff43=await apiRequest(_0x1e6f5c(0x1ac),{'method':_0x1e6f5c(0x1b1),'body':_0x52203e});return _0x26ff43[_0x1e6f5c(0x285)];}export async function deleteDbLink(_0x31a008){const _0xf2b57c=a197_0x2666;await apiRequest(_0xf2b57c(0x235),{'method':_0xf2b57c(0x1b1),'body':{'id':_0x31a008}});}export async function testDbLinkConnect(_0xc7423d){const _0xfaa3a3=a197_0x2666,_0x3d9b96=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0xc7423d}));return _0x3d9b96[_0xfaa3a3(0x285)];}export async function startDbAnalysis(_0x34202b,_0x4ca065){const _0xd5ae9a=a197_0x2666,_0x30ac1f=await apiRequest('/smartapi/db-analysis/start',{'method':_0xd5ae9a(0x1b1),'body':{'dbLinkId':_0x34202b,..._0x4ca065&&_0x4ca065[_0xd5ae9a(0x259)]>0x0?{'tableNames':_0x4ca065}:{}}});return _0x30ac1f[_0xd5ae9a(0x285)];}export async function cancelDbAnalysis(_0x10a9ab){const _0x23a23d=a197_0x2666;await apiRequest(_0x23a23d(0x1ad)+buildQuery({'planId':_0x10a9ab}),{'method':_0x23a23d(0x1b1)});}function a197_0x2666(_0x182c9f,_0x3e3251){_0x182c9f=_0x182c9f-0x1a0;const _0x3fd205=a197_0x3fd2();let _0x26667a=_0x3fd205[_0x182c9f];return _0x26667a;}export async function getDbAnalysisStatus(_0x12462a){const _0x51353b=a197_0x2666,_0x22c4c8=await apiRequest(_0x51353b(0x257)+encodeURIComponent(_0x12462a));return _0x22c4c8['data'];}export async function getDbAllTableList(_0x332159,_0x1cff95){const _0x4e0f21=a197_0x2666,_0xa8ecd4=await apiRequest(_0x4e0f21(0x1d3)+buildQuery({'appCode':_0x332159,'dbLinkId':_0x1cff95})),_0x2a1c47=_0xa8ecd4['data'];if(Array['isArray'](_0x2a1c47))return _0x2a1c47;return extractList(_0x2a1c47);}export async function getDbTableDiff(_0x916104,_0x57c53f,_0x1cf2b6){const _0x138c9c=a197_0x2666,_0x17f40a=await apiRequest(_0x138c9c(0x1f8)+buildQuery({'appCode':_0x916104,'dbLinkId':_0x57c53f,'pageIndex':_0x1cf2b6?.['pageIndex']??0x1,'pageSize':_0x1cf2b6?.[_0x138c9c(0x233)]??0x14,'tableName':_0x1cf2b6?.['tableName']})),_0x4915b1=_0x17f40a[_0x138c9c(0x285)];return{'totalCount':_0x4915b1?.['totalCount']??0x0,'physicalTableCount':_0x4915b1?.[_0x138c9c(0x22c)]??0x0,'datasetTableCount':_0x4915b1?.[_0x138c9c(0x201)]??0x0,..._0x4915b1?.[_0x138c9c(0x1c5)]?{'summary':_0x4915b1['summary']}:{},'tableList':Array['isArray'](_0x4915b1?.[_0x138c9c(0x260)])?_0x4915b1[_0x138c9c(0x260)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x2daef8=a197_0x2666,_0x293faa=await apiRequest(_0x2daef8(0x27e),{'method':_0x2daef8(0x1b1),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x29a878=extractList(_0x293faa[_0x2daef8(0x285)]),_0x262608=extractPaging(_0x293faa[_0x2daef8(0x285)]);return _0x262608&&_0x262608['totalCount']>REMOTE_APP_PAGE_SIZE&&console['warn'](_0x2daef8(0x1ef)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x262608[_0x2daef8(0x1f9)]+'\x20apps.\x20'+_0x2daef8(0x1a4)),_0x29a878;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x4ede4c,_0x1251f0){const _0x1526fd=a197_0x2666,_0x23f080=Math[_0x1526fd(0x1e7)](Math[_0x1526fd(0x221)](_0x1251f0?.[_0x1526fd(0x233)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x111e3b=await apiRequest(_0x1526fd(0x25e),{'method':_0x1526fd(0x1b1),'body':{'appCode':_0x4ede4c,'currentPage':_0x1251f0?.[_0x1526fd(0x284)]??0x1,'pageSize':_0x23f080}});return{'items':extractList(_0x111e3b[_0x1526fd(0x285)]),'paging':extractPaging(_0x111e3b['data'])};}export async function getAppRole(_0x20aa03){const _0x3841b7=a197_0x2666,_0x54ac92=await apiRequest(_0x3841b7(0x1ec)+buildQuery({'id':_0x20aa03}));return _0x54ac92[_0x3841b7(0x285)];}export async function createAppRole(_0x245262){const _0x453b7=a197_0x2666,_0x5ae1d0=await apiRequest(_0x453b7(0x1f3),{'method':'POST','body':{'appCode':_0x245262['appCode'],'roleName':_0x245262[_0x453b7(0x1f0)],'roleType':_0x453b7(0x1ed),..._0x245262[_0x453b7(0x1b4)]?{'remark':_0x245262['remark']}:{}}});return _0x5ae1d0[_0x453b7(0x285)];}export async function updateAppRole(_0x552b58){const _0x2435c3=a197_0x2666,_0x585dcf=await apiRequest(_0x2435c3(0x1b6),{'method':_0x2435c3(0x1b1),'body':{'id':_0x552b58['id'],'appCode':_0x552b58[_0x2435c3(0x223)],..._0x552b58[_0x2435c3(0x1cd)]?{'roleType':_0x552b58[_0x2435c3(0x1cd)]}:{},..._0x552b58[_0x2435c3(0x1f0)]!==undefined?{'roleName':_0x552b58['roleName']}:{},..._0x552b58[_0x2435c3(0x1b4)]!==undefined?{'remark':_0x552b58[_0x2435c3(0x1b4)]}:{},..._0x552b58[_0x2435c3(0x1e6)]?{'permits':_0x552b58[_0x2435c3(0x1e6)]}:{}}});return _0x585dcf[_0x2435c3(0x285)];}export async function deleteAppRole(_0x159ceb){const _0x395ae5=a197_0x2666;await apiRequest(_0x395ae5(0x26c),{'method':_0x395ae5(0x1b1),'body':{'id':_0x159ceb}});}export async function listPermitRoles(_0x1e19ac,_0x1dba18){const _0x3b453d=a197_0x2666,_0x37f012=await apiRequest(_0x3b453d(0x229),{'method':_0x3b453d(0x1b1),'body':{'appCode':_0x1e19ac,..._0x1dba18?.[_0x3b453d(0x231)]!==undefined?{'needSelf':_0x1dba18['needSelf']}:{},..._0x1dba18?.[_0x3b453d(0x217)]!==undefined?{'needPublic':_0x1dba18[_0x3b453d(0x217)]}:{}}});return extractList(_0x37f012[_0x3b453d(0x285)]);}export async function getRoleMenuResources(_0x51f981,_0x46a154){const _0x20d750=a197_0x2666,_0x4affd9=await apiRequest(_0x20d750(0x255),{'method':_0x20d750(0x1b1),'body':{'appCode':_0x51f981,'roleId':_0x46a154}});return extractList(_0x4affd9[_0x20d750(0x285)]);}export async function getRoleApiResources(_0x18c4a7,_0x111f27){const _0x51abc3=a197_0x2666,_0x1b1557=await apiRequest(_0x51abc3(0x1a0),{'method':_0x51abc3(0x1b1),'body':{'appCode':_0x18c4a7,'roleId':_0x111f27}});return extractList(_0x1b1557[_0x51abc3(0x285)]);}export async function listRoleUsers(_0x36e0a8){const _0x58cbd3=a197_0x2666,_0x1cc911=await apiRequest('/smartapi/permit/user-role/get-user-list',{'method':_0x58cbd3(0x1b1),'body':{'appCode':_0x36e0a8}});return extractList(_0x1cc911[_0x58cbd3(0x285)]);}export async function updateRoleUsers(_0x331cc9,_0x568eff){const _0x53228e=a197_0x2666;await apiRequest(_0x53228e(0x243),{'method':'POST','body':{'appCode':_0x331cc9,'roleList':_0x568eff}});}export async function getPagePermit(_0x41705f){const _0x3c87c5=a197_0x2666,_0x146262=await apiRequest(_0x3c87c5(0x240)+buildQuery({'menuId':_0x41705f}));return _0x146262['data'];}export async function savePagePermit(_0x9c28f6){const _0x451b1e=a197_0x2666,_0x5f119f=await apiRequest('/smartapi/permit/page/save',{'method':_0x451b1e(0x1b1),'body':_0x9c28f6});return _0x5f119f[_0x451b1e(0x285)];}export async function getTenantMembers(_0x5c6282){const _0xbd2655=a197_0x2666,_0x301a37=await apiRequest(_0xbd2655(0x24a)+buildQuery({'code':_0x5c6282})),_0x296640=_0x301a37[_0xbd2655(0x285)]??{},_0xc5fe98=Array[_0xbd2655(0x1cc)](_0x296640?.[_0xbd2655(0x1fc)])?_0x296640[_0xbd2655(0x1fc)]:[];return _0xc5fe98[_0xbd2655(0x275)](_0x354810=>_0x354810?.['status']===_0xbd2655(0x1ee)||_0x354810?.['status']===undefined)[_0xbd2655(0x20d)](_0x348613=>({'userId':Number(_0x348613[_0xbd2655(0x238)]??_0x348613['id']),'username':_0x348613[_0xbd2655(0x26d)],'nickname':_0x348613['nickname'],'status':_0x348613[_0xbd2655(0x1be)],'email':_0x348613[_0xbd2655(0x23f)],'mobile':_0x348613[_0xbd2655(0x1d1)],'avatar':_0x348613[_0xbd2655(0x1b2)]}))[_0xbd2655(0x275)](_0x59c9a4=>Number[_0xbd2655(0x247)](_0x59c9a4[_0xbd2655(0x238)])&&_0x59c9a4['userId']>0x0);}
|
|
1
|
+
(function(_0x1659ec,_0x17a988){const _0x1ded0e=a197_0x54ab,_0x113366=_0x1659ec();while(!![]){try{const _0x5cafc=parseInt(_0x1ded0e(0x249))/0x1+-parseInt(_0x1ded0e(0x227))/0x2+parseInt(_0x1ded0e(0x1f9))/0x3+-parseInt(_0x1ded0e(0x242))/0x4*(-parseInt(_0x1ded0e(0x215))/0x5)+parseInt(_0x1ded0e(0x217))/0x6*(parseInt(_0x1ded0e(0x281))/0x7)+parseInt(_0x1ded0e(0x23b))/0x8+-parseInt(_0x1ded0e(0x228))/0x9;if(_0x5cafc===_0x17a988)break;else _0x113366['push'](_0x113366['shift']());}catch(_0xf88007){_0x113366['push'](_0x113366['shift']());}}}(a197_0x1bb2,0x22010));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(_0x6a081){_activeCookie=_0x6a081||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(_0x2be529,_0x22bb2a){const _0x17b62d=a197_0x54ab,_0x30460c=_0x22bb2a instanceof Error?_0x22bb2a['message']:String(_0x22bb2a);return CliErrors['apiError'](_0x17b62d(0x26e)+_0x2be529+(_0x30460c?'\x20('+_0x30460c+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x320d3e,_0x3022f2={}){const _0x3e69bb=a197_0x54ab,{method:method=_0x3e69bb(0x2a8),body:_0x52778d,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x3022f2,_0x1b6ae7=useRuntime?getRuntimeDomain():getApiDomain(),_0x505553=_activeCookie||getCookie(),_0x58a40e=''+_0x1b6ae7+_0x320d3e,_0x29484f=new AbortController(),_0x76145=setTimeout(()=>_0x29484f[_0x3e69bb(0x1d9)](),timeout);try{const _0x5e80e5=await fetch(_0x58a40e,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x505553,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x52778d?JSON['stringify'](_0x52778d):undefined,'signal':_0x29484f['signal']});let _0xf9343a;try{_0xf9343a=await _0x5e80e5[_0x3e69bb(0x216)]();}catch(_0x57853d){if(_0x57853d instanceof Error&&_0x57853d[_0x3e69bb(0x265)]===_0x3e69bb(0x2ab))throw CliErrors[_0x3e69bb(0x1ec)](_0x3e69bb(0x24c)+_0x58a40e);if(_0x5e80e5['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError'](_0x3e69bb(0x282)+_0x5e80e5['status']+')',_0x5e80e5['status']>=0x190?_0x3e69bb(0x23d):undefined);}if(!_0x5e80e5['ok']||_0xf9343a[_0x3e69bb(0x237)]===![])throw CliErrors['apiError'](_0xf9343a[_0x3e69bb(0x258)]||_0xf9343a[_0x3e69bb(0x247)]||'API\x20error:\x20'+_0x5e80e5[_0x3e69bb(0x26b)],_0xf9343a[_0x3e69bb(0x1c9)]?_0x3e69bb(0x22b)+_0xf9343a[_0x3e69bb(0x1c9)]:undefined);return _0xf9343a;}catch(_0x4717ef){if(_0x4717ef instanceof CliError)throw _0x4717ef;if(_0x4717ef instanceof Error&&_0x4717ef[_0x3e69bb(0x265)]===_0x3e69bb(0x2ab))throw CliErrors[_0x3e69bb(0x1ec)]('Request\x20timeout:\x20'+_0x58a40e);throw createFetchFailureError(_0x58a40e,_0x4717ef);}finally{clearTimeout(_0x76145);}}async function apiFormRequest(_0x26bc4f,_0x593d18,_0x1e0359={}){const _0x110ba7=a197_0x54ab,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x1e0359,_0x433a35=_activeCookie||getCookie(),_0x4c8388=''+getApiDomain()+_0x26bc4f,_0x59b978=new AbortController(),_0x6d2ee=setTimeout(()=>_0x59b978[_0x110ba7(0x1d9)](),timeout);try{const _0x52b08b=await fetch(_0x4c8388,{'method':_0x110ba7(0x223),'headers':{'Cookie':_0x433a35,'X-Invoke-Source':_0x110ba7(0x1ef)},'body':_0x593d18,'signal':_0x59b978[_0x110ba7(0x296)]});let _0x535487;try{_0x535487=await _0x52b08b[_0x110ba7(0x216)]();}catch(_0xbaee){if(_0xbaee instanceof Error&&_0xbaee[_0x110ba7(0x265)]===_0x110ba7(0x2ab))throw CliErrors[_0x110ba7(0x1ec)](_0x110ba7(0x24c)+_0x4c8388);throw CliErrors['apiError'](_0x110ba7(0x282)+_0x52b08b['status']+')',_0x52b08b[_0x110ba7(0x26b)]>=0x190?_0x110ba7(0x23d):undefined);}if(!_0x52b08b['ok']||_0x535487['success']===![])throw CliErrors[_0x110ba7(0x1ec)](_0x535487[_0x110ba7(0x258)]||_0x535487['message']||_0x110ba7(0x230)+_0x52b08b[_0x110ba7(0x26b)],_0x535487[_0x110ba7(0x1c9)]?'API\x20error\x20code:\x20'+_0x535487[_0x110ba7(0x1c9)]:undefined);return _0x535487;}catch(_0x4887a0){if(_0x4887a0 instanceof CliError)throw _0x4887a0;if(_0x4887a0 instanceof Error&&_0x4887a0[_0x110ba7(0x265)]===_0x110ba7(0x2ab))throw CliErrors[_0x110ba7(0x1ec)](_0x110ba7(0x24c)+_0x4c8388);throw createFetchFailureError(_0x4c8388,_0x4887a0);}finally{clearTimeout(_0x6d2ee);}}export async function uploadDevelopmentFile(_0xe2e38a,_0x43eda5){const _0xe10987=a197_0x54ab,_0x2fffcb=await readFile(_0x43eda5),_0x9a3354=new FormData();_0x9a3354[_0xe10987(0x268)](_0xe10987(0x24f),_0xe2e38a),_0x9a3354['append'](_0xe10987(0x1ff),new Blob([new Uint8Array(_0x2fffcb)]),basename(_0x43eda5));const _0x92e9ed=await apiFormRequest(_0xe10987(0x288),_0x9a3354);return _0x92e9ed[_0xe10987(0x1cd)];}export async function queryDevelopmentFileUrl(_0x113f4a,_0x219193={}){const _0x10e405=a197_0x54ab,_0x1c84e2=await apiRequest('/smartapi/common/queryFileUrl',{'method':_0x10e405(0x223),'body':{'filePath':_0x113f4a,'downloadFlag':_0x219193[_0x10e405(0x27e)]??![],..._0x219193[_0x10e405(0x1f8)]?{'longTerm':!![]}:{}}});return _0x1c84e2['data'];}function isAuthFailure(_0x509d60){const _0x4aec7e=a197_0x54ab,_0x5592d1=_0x509d60[_0x4aec7e(0x258)]||_0x509d60[_0x4aec7e(0x247)]||_0x509d60[_0x4aec7e(0x1cd)]?.[_0x4aec7e(0x247)]||_0x509d60[_0x4aec7e(0x1ba)]||_0x509d60[_0x4aec7e(0x1fe)]||'';return _0x509d60[_0x4aec7e(0x1c9)]===_0x4aec7e(0x1ce)||_0x509d60['code']===0x191||_0x509d60[_0x4aec7e(0x27f)]===_0x4aec7e(0x271)||_0x5592d1['includes'](_0x4aec7e(0x271))||_0x5592d1['includes']('Unauthorized')||_0x5592d1[_0x4aec7e(0x20d)]('登录')||_0x5592d1[_0x4aec7e(0x20d)]('认证');}export async function platformFetch(_0x5df2d4,_0x2ebbcb){const _0x244fbe=a197_0x54ab;let _0x5a0157;try{_0x5a0157=await fetch(_0x5df2d4,{'method':_0x2ebbcb[_0x244fbe(0x28d)]??_0x244fbe(0x2a8),'headers':{'Content-Type':_0x244fbe(0x1d4),'Cookie':_0x2ebbcb[_0x244fbe(0x287)],'X-Invoke-Source':_0x244fbe(0x1ef)},..._0x2ebbcb[_0x244fbe(0x20e)]&&{'body':JSON[_0x244fbe(0x202)](_0x2ebbcb[_0x244fbe(0x20e)])}});}catch(_0x5eee3e){throw createFetchFailureError(_0x5df2d4,_0x5eee3e);}if(!_0x5a0157['ok']){if(_0x5a0157['status']===0x191)throw CliErrors[_0x244fbe(0x241)]();throw CliErrors[_0x244fbe(0x1ec)](_0x2ebbcb[_0x244fbe(0x1d1)]+'\x20failed,\x20HTTP\x20'+_0x5a0157[_0x244fbe(0x26b)]);}const _0x164594=await _0x5a0157[_0x244fbe(0x216)]();if(_0x164594['success']===![]){if(isAuthFailure(_0x164594))throw CliErrors[_0x244fbe(0x241)]();throw CliErrors['apiError'](_0x164594[_0x244fbe(0x258)]||_0x164594['message']||_0x2ebbcb['label']+_0x244fbe(0x2ac));}return _0x164594['data'];}export async function platformRequest(_0x409022,_0x29af4c){const _0x1e2e60=a197_0x54ab;if(/^https?:\/\//i['test'](_0x409022))throw CliErrors[_0x1e2e60(0x1c5)](_0x1e2e60(0x2a9)+_0x409022,_0x1e2e60(0x297));const _0x1eb62d=_0x409022[_0x1e2e60(0x1c2)]('/')?_0x409022:'/'+_0x409022;return platformFetch(''+getApiDomain()+_0x1eb62d,_0x29af4c);}function cleanNewlines(_0x52e448){const _0x36feb2=a197_0x54ab;return _0x52e448[_0x36feb2(0x25c)](/[\r\n]+/g,'\x20')[_0x36feb2(0x1d8)]();}function cleanDatasetName(_0x586bb1){if(!_0x586bb1['name'])return _0x586bb1;return{..._0x586bb1,'name':cleanNewlines(_0x586bb1['name'])};}export async function fetchModelList(_0x91bc64,_0x255f10){const _0x1a7105=a197_0x54ab,_0x1f8f5a=getEnv(),_0x210c48=new URLSearchParams({'appcode':_0x91bc64,'otype':_0x1a7105(0x1d0)}),_0x2be334='/api/node-toolbox/dataset/model-list?'+_0x210c48[_0x1a7105(0x1fd)]();logger['info']('fetch-model-list',_0x1a7105(0x1f6)+_0x1f8f5a+')',{'apiPath':_0x2be334});const _0x3dc5fc=await platformRequest(_0x2be334,{'cookie':_0x255f10,'label':_0x1a7105(0x29e)}),_0x2ba27e=(_0x3dc5fc['configArray']??[])[_0x1a7105(0x1bc)](cleanDatasetName);return{'configArray':_0x2ba27e,'count':_0x2ba27e[_0x1a7105(0x289)]};}export async function fetchDatasetDoc(_0x1a6f78){const _0x52f50f=a197_0x54ab,{appCode:_0x45ff7e,cookie:_0x4bb979,datasetCode:_0x175445,datasetId:_0x1b8437,extraParams:_0x38531c}=_0x1a6f78,_0x1679ff=await platformRequest(_0x52f50f(0x1f0),{'method':_0x52f50f(0x223),'body':{'appCode':_0x45ff7e,'datasetCode':_0x175445,'datasetId':_0x1b8437,..._0x38531c||{}},'cookie':_0x4bb979,'label':_0x52f50f(0x270)+_0x175445+')'});if(!_0x1679ff||typeof _0x1679ff[_0x52f50f(0x23c)]!==_0x52f50f(0x245))throw new Error(_0x52f50f(0x1f1)+_0x175445+'):\x20missing\x20data.markdown\x20field');return _0x1679ff['markdown'];}export async function getMenuTree(_0x996606,_0x549b2d){const _0x470592=a197_0x54ab,_0x46259b=new URLSearchParams({'appCode':_0x996606});return platformRequest(_0x470592(0x2ae)+_0x46259b[_0x470592(0x1fd)](),{'cookie':_0x549b2d,'label':_0x470592(0x201)});}export async function createMenuRecord(_0x2554a2,_0x127f82,_0x3f2afa){const _0x4ac8b3=a197_0x54ab;return platformRequest(_0x4ac8b3(0x1cb),{'method':_0x4ac8b3(0x223),'body':_0x2554a2,'cookie':_0x127f82,'label':_0x3f2afa});}export async function updateMenuRecord(_0xa05347,_0x2088d3,_0x264202){const _0x36c0a9=a197_0x54ab;return platformRequest(_0x36c0a9(0x22c),{'method':_0x36c0a9(0x223),'body':_0xa05347,'cookie':_0x2088d3,'label':_0x264202});}export async function deleteMenuRecord(_0x1b7615,_0x2346a2,_0x183ae2){const _0x4b80ac=a197_0x54ab;return platformRequest(_0x4b80ac(0x26a),{'method':_0x4b80ac(0x223),'body':{'id':_0x1b7615},'cookie':_0x2346a2,'label':_0x183ae2});}export async function batchDeleteMenuRecords(_0x323410,_0x2b8d34,_0x3dcafc){const _0x5ef320=a197_0x54ab;return platformRequest(_0x5ef320(0x213),{'method':'POST','body':{'idList':_0x323410},'cookie':_0x2b8d34,'label':_0x3dcafc});}export async function startMenuRegroup(_0x44aeac,_0x4bfccb,_0x44e0dd){const _0x1e7800=a197_0x54ab;return platformRequest('/smartapi/menu/regroup',{'method':_0x1e7800(0x223),'body':_0x44aeac,'cookie':_0x4bfccb,'label':_0x44e0dd});}export async function getAsyncTaskStatus(_0x5e6a11,_0x48cd56,_0x154982){const _0x59fd0a=a197_0x54ab,_0x4d94b0=new URLSearchParams({'appCode':_0x48cd56});return platformRequest(_0x59fd0a(0x24a)+encodeURIComponent(_0x5e6a11)+'?'+_0x4d94b0[_0x59fd0a(0x1fd)](),{'cookie':_0x154982,'label':_0x59fd0a(0x250)+_0x5e6a11});}function a197_0x54ab(_0x2ddf65,_0x31231c){_0x2ddf65=_0x2ddf65-0x1ba;const _0x1bb2ba=a197_0x1bb2();let _0x54ab69=_0x1bb2ba[_0x2ddf65];return _0x54ab69;}export async function listBffScripts(_0x30cc20,_0x4290be,_0x2ba072){const _0xf46578=a197_0x54ab;let _0x4f9fe3=_0xf46578(0x1c6)+_0x30cc20;if(_0x4290be)_0x4f9fe3+=_0xf46578(0x260)+_0x4290be;const _0x3443a2=await apiRequest(_0x4f9fe3);let _0x23a109=extractList(_0x3443a2['data']);if(_0x2ba072?.[_0xf46578(0x1fb)]){const _0x47802c=_0x2ba072[_0xf46578(0x1fb)]['toLowerCase']();_0x23a109=_0x23a109['filter'](_0x42890b=>_0x42890b['functionName']?.['toLowerCase']()[_0xf46578(0x20d)](_0x47802c)||_0x42890b[_0xf46578(0x239)]?.[_0xf46578(0x21b)]()[_0xf46578(0x20d)](_0x47802c));}return _0x23a109;}export async function getBffScriptInfo(_0x96c4cb){const _0x5a0d4=a197_0x54ab,_0xd8f073=await apiRequest(_0x5a0d4(0x23e)+_0x96c4cb);if(!_0xd8f073[_0x5a0d4(0x1cd)])throw CliErrors['validation'](_0x5a0d4(0x276)+_0x96c4cb);return _0xd8f073[_0x5a0d4(0x1cd)];}export async function saveBffScript(_0x63eea){const _0x147f6a=a197_0x54ab,_0x21c1eb=await apiRequest('/api/management/library/scripts/save',{'method':_0x147f6a(0x223),'body':_0x63eea}),{id:_0x26e010,entity:_0x27ead0}=normalizeEntityWithIdResponse(_0x21c1eb[_0x147f6a(0x1cd)]);if(_0x26e010!==undefined){const _0x299485=typeof _0x27ead0[_0x147f6a(0x1bd)]===_0x147f6a(0x245)||typeof _0x27ead0[_0x147f6a(0x25b)]===_0x147f6a(0x245)?_0x27ead0:undefined;return{'id':_0x26e010,'script':_0x299485};}throw CliErrors[_0x147f6a(0x1ec)]('BFF\x20save\x20returned\x20no\x20valid\x20id');}export async function deleteBffScript(_0x1f0cec){const _0x5042f4=a197_0x54ab;await apiRequest(_0x5042f4(0x236),{'method':_0x5042f4(0x223),'body':{'id':_0x1f0cec}});}export async function getBffScriptStatistics(_0x591104){const _0x296cc1=a197_0x54ab,_0x2d77ce=await apiRequest(_0x296cc1(0x235)+_0x591104);return extractList(_0x2d77ce[_0x296cc1(0x1cd)]);}export async function clearBffScriptCache(){const _0x490285=a197_0x54ab,_0x1e4550=await apiRequest(_0x490285(0x20c),{'method':_0x490285(0x223),'useRuntime':!![]});return typeof _0x1e4550[_0x490285(0x1cd)]===_0x490285(0x245)?_0x1e4550['data']:'';}export async function listBffDatasetOperations(_0x1c19c0,_0x256f6f){const _0x44cd90=a197_0x54ab,_0x479f8c=await apiRequest(_0x44cd90(0x2a2),{'method':'POST','body':{'appCode':_0x1c19c0,'datasetId':_0x256f6f}});return _0x479f8c[_0x44cd90(0x1cd)];}export async function listSqlQueries(_0x4c19f1,_0x36a20d){const _0x59c3a2=a197_0x54ab,_0x148fe6=await apiRequest(_0x59c3a2(0x29d),{'method':_0x59c3a2(0x223),'body':{'appCode':_0x4c19f1,'currentPage':_0x36a20d?.[_0x59c3a2(0x1ca)]??0x1,'pageSize':_0x36a20d?.[_0x59c3a2(0x224)]??0x32,'sqlCode':_0x36a20d?.[_0x59c3a2(0x1c3)],'sqlName':_0x36a20d?.[_0x59c3a2(0x1df)]}});return _0x148fe6['data'];}export async function getSqlQueryInfo(_0x50b8d6,_0x550fc4){const _0x95aa34=a197_0x54ab,_0x1b7aca=await listSqlQueries(_0x50b8d6,{'sqlCode':_0x550fc4}),_0x1e2566=_0x1b7aca[_0x95aa34(0x203)]?.[0x0];if(!_0x1e2566)throw CliErrors[_0x95aa34(0x1c5)](_0x95aa34(0x27b)+_0x550fc4);return _0x1e2566;}export async function getSqlQueryDetail(_0x437ed4){const _0x969821=a197_0x54ab,_0x53d588=await apiRequest(_0x969821(0x29f)+(_0x969821(0x29b)+encodeURIComponent(_0x437ed4)));if(!_0x53d588[_0x969821(0x1cd)])throw CliErrors[_0x969821(0x1c5)](_0x969821(0x27b)+_0x437ed4);return _0x53d588[_0x969821(0x1cd)];}export async function getSqlQueryDetailById(_0x2df2e3){const _0x55aa42=a197_0x54ab,_0x18b827=await apiRequest(_0x55aa42(0x21c)+_0x2df2e3);if(!_0x18b827[_0x55aa42(0x1cd)])throw CliErrors[_0x55aa42(0x1c5)](_0x55aa42(0x1e3)+_0x2df2e3);return _0x18b827[_0x55aa42(0x1cd)];}export async function createSqlQuery(_0x23e1d4){const _0x5e3892=a197_0x54ab,_0x329de1=await apiRequest(_0x5e3892(0x20f),{'method':_0x5e3892(0x223),'body':_0x23e1d4}),{id:_0x3e8262,entity:_0x3473f8}=normalizeEntityWithIdResponse(_0x329de1[_0x5e3892(0x1cd)]);if(!(_0x5e3892(0x1c3)in _0x3473f8)&&_0x3e8262)return getSqlQueryDetailById(_0x3e8262);return normalizeSqlQueryEntity(_0x3473f8);}export async function updateSqlQuery(_0x44eee8){const _0x27eb7c=a197_0x54ab,_0x116e6a=await apiRequest(_0x27eb7c(0x24e),{'method':_0x27eb7c(0x223),'body':_0x44eee8}),{id:_0x134753,entity:_0x25c2a0}=normalizeEntityWithIdResponse(_0x116e6a[_0x27eb7c(0x1cd)]);if(!(_0x27eb7c(0x1c3)in _0x25c2a0)){if(_0x44eee8[_0x27eb7c(0x1c3)])return getSqlQueryDetail(_0x44eee8[_0x27eb7c(0x1c3)]);if(_0x134753)return getSqlQueryDetailById(_0x134753);}return normalizeSqlQueryEntity(_0x25c2a0);}export async function deleteSqlQuery(_0x24deea){const _0x5bb6cf=a197_0x54ab;await apiRequest(_0x5bb6cf(0x1de),{'method':'POST','body':_0x24deea});}export async function saveSqlQuery(_0x48d29d){const _0x5cc92a=a197_0x54ab,_0x2ffa50=await apiRequest('/api/node-toolbox/sql/save',{'method':_0x5cc92a(0x223),'body':_0x48d29d});return _0x2ffa50[_0x5cc92a(0x1cd)];}function normalizeSqlQueryEntity(_0x1cb149){const _0x203b6f=a197_0x54ab;return{..._0x1cb149,'id':Number(_0x1cb149['id']),'dbId':_0x1cb149[_0x203b6f(0x210)]==null?undefined:Number(_0x1cb149['dbId']),'version':_0x1cb149[_0x203b6f(0x1ea)]==null?undefined:Number(_0x1cb149[_0x203b6f(0x1ea)])};}export async function executeSql(_0x315095,_0x36fa0c,_0x42f445){const _0x3c3c63=a197_0x54ab,_0x5e4c3a=await apiRequest(_0x3c3c63(0x211),{'method':'POST','body':{'appCode':_0x315095,'sqlCode':_0x36fa0c,..._0x42f445&&{'params':_0x42f445}},'useRuntime':!![]});return _0x5e4c3a[_0x3c3c63(0x1cd)];}export async function executeDatasetDataOperation(_0x4787bd,_0x1da42f,_0x4b8b98,_0x199454={}){const _0xb07c25=a197_0x54ab;try{const _0x4559d8=await apiRequest(_0xb07c25(0x251)+_0x4787bd+'/'+_0x1da42f+'/'+_0x4b8b98,{'method':'POST','body':_0x199454,'useRuntime':!![]});return _0x4559d8[_0xb07c25(0x1cd)];}catch(_0x5364b0){if(_0x4b8b98===_0xb07c25(0x277)&&_0x5364b0 instanceof CliError&&_0x5364b0[_0xb07c25(0x27f)]===_0xb07c25(0x2ad)&&_0x199454['id']!==undefined&&_0x199454['id']!==null&&_0x199454['id']!==''){const _0x2b0e11=await apiRequest(_0xb07c25(0x251)+_0x4787bd+'/'+_0x1da42f+_0xb07c25(0x21d),{'method':_0xb07c25(0x223),'body':{'where':{'id':{'$eq':_0x199454['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x147d8f=Array[_0xb07c25(0x1ed)](_0x2b0e11[_0xb07c25(0x1cd)]?.['tableData'])?_0x2b0e11[_0xb07c25(0x1cd)][_0xb07c25(0x203)]:[];return _0x147d8f[0x0]??null;}throw _0x5364b0;}}export async function listDatasets(_0x4c8951,_0x4d5c5a){const _0x74647a=a197_0x54ab,_0x501579={'appCode':_0x4c8951,'deleted':_0x4d5c5a?.[_0x74647a(0x1d5)]??![]};if(_0x4d5c5a?.[_0x74647a(0x27f)])_0x501579[_0x74647a(0x27f)]=_0x4d5c5a[_0x74647a(0x27f)];if(_0x4d5c5a?.[_0x74647a(0x265)])_0x501579['name']=_0x4d5c5a[_0x74647a(0x265)];const _0x5194dd=await apiRequest(_0x74647a(0x23a),{'method':'POST','body':_0x501579});return extractList(_0x5194dd[_0x74647a(0x1cd)]);}export async function deleteDataset(_0x42e6e3,_0x2215e3){const _0x31ac9a=a197_0x54ab;await apiRequest(_0x31ac9a(0x252),{'method':_0x31ac9a(0x223),'body':{'appCode':_0x42e6e3,'datasetId':_0x2215e3}});}export async function restoreDataset(_0x33cded,_0x119866){const _0x49074f=a197_0x54ab;await apiRequest(_0x49074f(0x221),{'method':'POST','body':{'appCode':_0x33cded,'datasetId':_0x119866}});}export async function previewTextGeneratedDataset(_0x189b18,_0x388a4d){const _0x44ae38=a197_0x54ab,_0x2c2fc4=await apiRequest('/smartapi/dataset/text-generate/preview',{'method':_0x44ae38(0x223),'body':{'appCode':_0x189b18,'datasetName':_0x388a4d[_0x44ae38(0x1e7)],'requirementDescription':_0x388a4d['requirementDescription']},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x2c2fc4[_0x44ae38(0x1cd)];}export async function startTextGeneratedDataset(_0x3eff6d,_0x45979,_0x43bc5b){const _0xe8a85a=a197_0x54ab,_0x345412=await apiRequest(_0xe8a85a(0x283),{'method':'POST','body':{'appCode':_0x3eff6d,..._0x43bc5b?.[_0xe8a85a(0x274)]?{'clientOperationId':_0x43bc5b[_0xe8a85a(0x274)]}:{},'design':_0x45979},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x345412[_0xe8a85a(0x1cd)];}export async function getTextGeneratedDatasetStatus(_0xa0f994,_0x1a4354){const _0x5373e2=a197_0x54ab,_0x2a46cc=new URLSearchParams({'appCode':_0xa0f994});_0x1a4354[_0x5373e2(0x26d)]&&_0x2a46cc[_0x5373e2(0x24b)](_0x5373e2(0x26d),_0x1a4354['operationId']);_0x1a4354['clientOperationId']&&_0x2a46cc[_0x5373e2(0x24b)](_0x5373e2(0x274),_0x1a4354[_0x5373e2(0x274)]);const _0xb8aa3=await apiRequest('/smartapi/dataset/text-generate/status?'+_0x2a46cc[_0x5373e2(0x1fd)]());return _0xb8aa3[_0x5373e2(0x1cd)];}export async function searchDatasets(_0x4e4626,_0x21caad){const _0x10195c=a197_0x54ab,_0x449a77=await listDatasets(_0x4e4626,{'name':_0x21caad}),_0x126072=_0x21caad[_0x10195c(0x21b)](),_0x5a0c00=new Set(_0x449a77['map'](_0x203f8b=>_0x203f8b['id'])),_0x2dccb1=_0x449a77[_0x10195c(0x25a)](_0x9737da=>_0x9737da[_0x10195c(0x269)]?.[_0x10195c(0x27c)]?.[_0x10195c(0x21b)]()[_0x10195c(0x20d)](_0x126072)||_0x9737da['description']?.[_0x10195c(0x21b)]()['includes'](_0x126072)),_0x481793=await listDatasets(_0x4e4626,{'code':_0x21caad});for(const _0x3fcf1b of _0x481793){!_0x5a0c00[_0x10195c(0x219)](_0x3fcf1b['id'])&&(_0x449a77['push'](_0x3fcf1b),_0x5a0c00[_0x10195c(0x218)](_0x3fcf1b['id']));}return _0x449a77;}export function normalizeDatasetOperations(_0x53b9fb){const _0x25bc92=a197_0x54ab;if(Array[_0x25bc92(0x1ed)](_0x53b9fb))return _0x53b9fb[_0x25bc92(0x25a)](_0x49fe96=>_0x49fe96!=null&&typeof _0x49fe96==='object');if(_0x53b9fb&&typeof _0x53b9fb==='object')return Object[_0x25bc92(0x25d)](_0x53b9fb)[_0x25bc92(0x25a)](([,_0x21a07e])=>_0x21a07e!=null&&typeof _0x21a07e==='object')['map'](([_0x28390c,_0x402a7d])=>({..._0x402a7d,'name':_0x402a7d[_0x25bc92(0x265)]??_0x402a7d[_0x25bc92(0x279)]??_0x28390c}));return[];}export async function getDatasetDetail(_0x484370){const _0x417530=a197_0x54ab,_0x168187=/^\d+$/[_0x417530(0x259)](_0x484370)?'id':_0x417530(0x27f),_0xcdc5a2=await apiRequest(_0x417530(0x20a)+_0x168187+'='+_0x484370);return _0xcdc5a2[_0x417530(0x1cd)];}export async function updateDrivenData(_0x5a3750){const _0x265c8d=a197_0x54ab,_0x4d79ee=await apiRequest(_0x265c8d(0x298),{'method':_0x265c8d(0x223),'body':_0x5a3750});return _0x4d79ee[_0x265c8d(0x1cd)];}export async function getDatasetOperations(_0x1d7800){const _0x53758f=a197_0x54ab,_0x330839=await getDatasetDetail(_0x1d7800),_0x51c6de=normalizeDatasetOperations(_0x330839[_0x53758f(0x232)])[_0x53758f(0x1bc)](_0x270dfc=>({'name':_0x270dfc['name']||_0x270dfc[_0x53758f(0x279)],'displayName':_0x270dfc[_0x53758f(0x1dd)]||_0x270dfc[_0x53758f(0x265)],'type':_0x270dfc[_0x53758f(0x1f3)],'method':_0x270dfc['method'],'path':_0x270dfc[_0x53758f(0x257)],'enabled':_0x270dfc[_0x53758f(0x27a)]??!![],'requestFields':_0x270dfc[_0x53758f(0x1bf)],'responseFields':_0x270dfc[_0x53758f(0x254)]}));return{'dataset':{'id':_0x330839['id']??_0x330839[_0x53758f(0x244)],'name':_0x330839['name'],'code':_0x330839[_0x53758f(0x27f)]||_0x330839[_0x53758f(0x26c)],'tableName':_0x330839[_0x53758f(0x27c)]||_0x330839['dbtableConfig']?.[_0x53758f(0x27c)]},'operations':_0x51c6de};}export async function getOperationDetail(_0xe97fb8,_0x23dd83,_0x5ca03d){const _0x5d3314=a197_0x54ab;let _0x27a6a7=_0x23dd83;if(!/^\d+$/[_0x5d3314(0x259)](_0x23dd83)){const _0x51e162=await listDatasets(_0xe97fb8,{'code':_0x23dd83}),_0x1ae150=_0x51e162['find'](_0x44a077=>_0x44a077[_0x5d3314(0x27f)]===_0x23dd83||String(_0x44a077['id'])===_0x23dd83);if(!_0x1ae150)throw CliErrors['validation'](_0x5d3314(0x204)+_0x23dd83);_0x27a6a7=String(_0x1ae150['id']);}const _0x42a57e=await getDatasetDetail(_0x27a6a7),_0x17ee43=normalizeDatasetOperations(_0x42a57e[_0x5d3314(0x232)])[_0x5d3314(0x208)](_0x39aa90=>(_0x39aa90[_0x5d3314(0x265)]||_0x39aa90[_0x5d3314(0x279)])===_0x5ca03d);if(!_0x17ee43)throw CliErrors['validation']('Operation\x20\x22'+_0x5ca03d+_0x5d3314(0x1fa)+_0x23dd83);return{'dataset':{'id':_0x42a57e['id']??_0x42a57e[_0x5d3314(0x244)],'name':_0x42a57e[_0x5d3314(0x265)],'code':_0x42a57e['code']||_0x42a57e[_0x5d3314(0x26c)],'tableName':_0x42a57e[_0x5d3314(0x27c)]||_0x42a57e[_0x5d3314(0x269)]?.['tableName']},'operation':_0x17ee43};}export async function startGenerateStandardPages(_0x4e95cc,_0x3e2b73,_0x5ab780){const _0x24afa4=a197_0x54ab,_0x3ac1c1=await apiRequest(_0x24afa4(0x1d6)+_0x3e2b73+_0x24afa4(0x234),{'method':'POST','body':{'appCode':_0x4e95cc,..._0x5ab780?.[_0x24afa4(0x274)]?{'clientOperationId':_0x5ab780[_0x24afa4(0x274)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x3ac1c1[_0x24afa4(0x1cd)];}export async function getGenerateStandardPagesStatus(_0x3f5d97,_0x56606a,_0x433e7b){const _0x388ca2=a197_0x54ab,_0x307daa=new URLSearchParams({'appCode':_0x3f5d97});_0x433e7b[_0x388ca2(0x26d)]&&_0x307daa[_0x388ca2(0x24b)](_0x388ca2(0x26d),_0x433e7b[_0x388ca2(0x26d)]);_0x433e7b[_0x388ca2(0x274)]&&_0x307daa[_0x388ca2(0x24b)]('clientOperationId',_0x433e7b[_0x388ca2(0x274)]);const _0x4a5166=await apiRequest(_0x388ca2(0x1d6)+_0x56606a+_0x388ca2(0x212)+_0x307daa[_0x388ca2(0x1fd)]());return _0x4a5166[_0x388ca2(0x1cd)];}export async function getStandardPageStatus(_0x10f69c,_0x24c80e){const _0x28594d=a197_0x54ab,_0x118584=await apiRequest(_0x28594d(0x1d6)+_0x24c80e+_0x28594d(0x1e5)+encodeURIComponent(_0x10f69c));return _0x118584[_0x28594d(0x1cd)];}export async function tryGetStandardPageStatus(_0x317fa2,_0x5db870){const _0x42fb65=a197_0x54ab;try{return await getStandardPageStatus(_0x317fa2,_0x5db870);}catch(_0x2b17ed){if(_0x2b17ed instanceof CliError&&_0x2b17ed['code']===_0x42fb65(0x2ad)&&/404|not found|non-json response/i[_0x42fb65(0x259)](_0x2b17ed[_0x42fb65(0x247)]))return null;throw _0x2b17ed;}}export async function syncStandardPages(_0x3c69e6,_0x2d44a9){const _0x367a88=a197_0x54ab,_0x587773=await apiRequest('/smartapi/lovrabet/dataset/'+_0x2d44a9+_0x367a88(0x2a3),{'method':_0x367a88(0x223),'body':{'appCode':_0x3c69e6}});return _0x587773[_0x367a88(0x1cd)];}export async function getPageDetail(_0x302d13){const _0x1f8987=a197_0x54ab,_0x102192=await apiRequest(_0x1f8987(0x28f)+_0x302d13);if(!_0x102192[_0x1f8987(0x1cd)])throw CliErrors['validation'](_0x1f8987(0x256)+_0x302d13);return _0x102192['data'];}export async function updatePage(_0x1c1451,_0x3ab754,_0x275135,_0x178bbb){const _0x312b37=a197_0x54ab,_0x22e46a=await apiRequest(_0x312b37(0x1fc),{'method':_0x312b37(0x223),'body':{'appCode':_0x1c1451,'pageId':_0x3ab754,'code':_0x275135,'datasetIds':_0x178bbb}});return _0x22e46a[_0x312b37(0x1cd)];}export function generateSdkCode(_0x378b73,_0x42d617,_0x5daf73){const _0x5f2a40=a197_0x54ab,_0x2c8a1b=_0x5daf73?.[_0x5f2a40(0x273)]??!![],_0x24da6f=_0x5f2a40(0x1e8)+_0x378b73[_0x5f2a40(0x27f)]?.['replace'](/-/g,'_'),_0x50879d=_0x42d617['name']||_0x42d617[_0x5f2a40(0x279)]||_0x5f2a40(0x25a),_0x5228cd=[];_0x2c8a1b&&_0x5228cd[_0x5f2a40(0x253)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x5f2a40(0x280),'');_0x5228cd[_0x5f2a40(0x253)](_0x5f2a40(0x261)+_0x378b73[_0x5f2a40(0x265)]+'\x20('+(_0x378b73[_0x5f2a40(0x27c)]||_0x5f2a40(0x1c0))+')');if(_0x50879d==='filter')_0x5228cd['push'](_0x5f2a40(0x2a4)+_0x24da6f+_0x5f2a40(0x1be),_0x5f2a40(0x1e2),_0x5f2a40(0x1e1),_0x5f2a40(0x1f7),_0x5f2a40(0x29c));else{if(_0x50879d===_0x5f2a40(0x277))_0x5228cd[_0x5f2a40(0x253)](_0x5f2a40(0x2a4)+_0x24da6f+_0x5f2a40(0x1bb));else{if(_0x50879d===_0x5f2a40(0x278))_0x5228cd[_0x5f2a40(0x253)](_0x5f2a40(0x2a4)+_0x24da6f+_0x5f2a40(0x1dc));else{if(_0x50879d===_0x5f2a40(0x1db))_0x5228cd['push'](_0x5f2a40(0x2a4)+_0x24da6f+_0x5f2a40(0x1c4));else _0x50879d===_0x5f2a40(0x294)||_0x50879d==='remove'?_0x5228cd[_0x5f2a40(0x253)](_0x5f2a40(0x2a4)+_0x24da6f+_0x5f2a40(0x275)):_0x5228cd[_0x5f2a40(0x253)](_0x5f2a40(0x2a4)+_0x24da6f+'.'+_0x50879d+_0x5f2a40(0x1da));}}}return _0x5228cd[_0x5f2a40(0x28e)]('\x0a');}function a197_0x1bb2(){const _0x5d62fb=['/smartapi/app-config/list','/smartapi/custom/updateUserCustomSql','appCode','Fetch\x20async\x20task\x20','/api/','/smartapi/dataset/delete-dataset','push','responseFields','/smartapi/question/er-config/cli/delete-single','Page\x20not\x20found:\x20','path','errorMsg','test','filter','scriptType','replace','entries','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','\x20\x20});','&type=','//\x20','/smartapi/db-analysis/jobs/cancel','/smartapi/db-analysis/start','\x20\x20sqlCode:\x20\x27','name','/smartapi/app-config/update','/smartapi/dblink/getAllTableList','append','dbtableConfig','/smartapi/menu/delete','status','modelCode','operationId','Request\x20failed:\x20','/smartapi/permit/role/get-one','Fetch\x20doc\x20(','401','Warning:\x20showing\x20first\x20','includeImports','clientOperationId','.remove(id);','BFF\x20script\x20not\x20found:\x20id=','getOne','create','operationName','enabled','SQL\x20query\x20not\x20found:\x20','tableName','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','download','code','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','1121624PtEQLT','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/smartapi/dataset/text-generate/start','target','/smartapi/permit/role/get-permit-list','totalCount','cookie','/smartapi/common/uploadFile','length','datasetTableCount','permits','summary','method','join','/smartapi/lovrabet/detail?pageId=','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','ENABLE','/smartapi/permit/user-role/get-user-list','avatar','delete','hint','signal','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','/smartapi/dataset/update-driven-data','roleType','userId','?sqlCode=','});','/smartapi/custom/queryUserCustomSqlList','Fetch\x20datasets','/smartapi/custom/getUserCustomSql','pageIndex','\x20\x20return\x20rows;','/smartapi/dataset/get-dataset-operation','/sync-to-pages','const\x20result\x20=\x20await\x20client.models.','DATA_NOT_EXIST','/smartapi/question/er-config/cli/erCreate','/smartapi/permit/role/delete','GET','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','needPublic','AbortError','\x20failed','api_error','/smartapi/menu/find?','/smartapi/question/er-config/cli/detail?','value','errorMessage','.getOne(id);','map','functionName','.filter({','requestFields','table','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','startsWith','sqlCode','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','validation','/api/management/library/scripts/list?appCode=','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','\x20\x20\x20\x20sqlCode:\x20\x27','errorCode','currentPage','/smartapi/menu/create','/smartapi/permit/role/get-list','data','UNAUTHORIZED','/smartapi/permit/resource/get-api-list','array','label','remark','physicalTableCount','application/json','deleted','/smartapi/lovrabet/dataset/','tableList','trim','abort','(/*\x20params\x20*/);','update','.create({\x20/*\x20fields\x20*/\x20});','displayName','/smartapi/custom/deleteUserCustomSql','sqlName','/smartapi/db-analysis/status/','\x20\x20pageSize:\x2020,','\x20\x20where:\x20{},','SQL\x20query\x20not\x20found:\x20id=','/smartapi/dblink/create','/standard-page-status?appCode=','list','datasetName','dataset_','\x20apps.\x20','version','/smartapi/permit/page/get-one','apiError','isArray','/notification/channel-config/list','cli:rabetbase','/api/node-toolbox/api-doc-generator','Invalid\x20response\x20format\x20(','needSelf','type','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','roleName','正在从服务器拉取模型列表...\x20(环境:\x20','\x20\x20currentPage:\x201,','longTerm','503853RhEFyE','\x22\x20not\x20found\x20in\x20dataset\x20','scriptName','/smartapi/lovrabet/update-page','toString','error','file','/smartapi/permit/role/create','Fetch\x20menu\x20list','stringify','tableData','Dataset\x20not\x20found:\x20','userTenantRelationList','email','/smartapi/dblink/getOne','find','/smartapi/dblink/testConnect','/smartapi/dataset/get-driven-data?','username','/api/management/script/cache/clear','includes','body','/smartapi/custom/saveUserCustomSql','dbId','/api/custom/executeSql','/generate-standard-pages/status?','/smartapi/menu/batchDelete','/smartapi/permit/resource/get-menu-list','55ArEigu','json','6noTCVC','add','has','/smartapi/permit/role/update','toLowerCase','/smartapi/custom/getUserCustomSql?id=','/filter','warn','/smartapi/app-config/create','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/dataset/restore-dataset','/smartapi/dblink/getList','POST','pageSize','sdk','mobile','319250qrpqZs','4839291xDCbkG','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','relation','API\x20error\x20code:\x20','/smartapi/menu/update','/smartapi/question/er-config','const\x20results\x20=\x20data.execResult\x20||\x20[];','/smartapi/dblink/delete','API\x20error:\x20','/smartapi/dblink/update','operations','key','/generate-standard-pages/start','/api/management/library/scripts/statistics?appCode=','/api/management/library/scripts/delete','success','tags','description','/smartapi/dataset/get-dataset-list','1417080LmVUbW','markdown','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','/api/management/library/scripts/info?id=','max','/smartapi/permit/user-role/update-user-list','authRequired','52552NCOLDw','/smartapi/question/er-config/cli/update-single','modelId','string','/smartapi/question/er-config/business-group/edit','message','ER\x20relation\x20does\x20not\x20exist','186768aOMiNG','/smartapi/tasks/','set','Request\x20timeout:\x20'];a197_0x1bb2=function(){return _0x5d62fb;};return a197_0x1bb2();}export function generateSqlCodeTemplate(_0xfc8cdf,_0x120e4a){const _0x4e08ac=a197_0x54ab,_0x585b72=_0x120e4a?.[_0x4e08ac(0x284)]??'sdk',_0x10ee35=_0x120e4a?.[_0x4e08ac(0x273)]??!![],_0x4ead40=[];return _0x4ead40[_0x4e08ac(0x253)]('//\x20SQL:\x20'+_0xfc8cdf['sqlName']+'\x20('+_0xfc8cdf[_0x4e08ac(0x1c3)]+')'),_0x585b72===_0x4e08ac(0x225)?(_0x10ee35&&_0x4ead40[_0x4e08ac(0x253)](_0x4e08ac(0x25e),'',_0x4e08ac(0x280),''),_0x4ead40[_0x4e08ac(0x253)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x4e08ac(0x264)+_0xfc8cdf[_0x4e08ac(0x1c3)]+'\x27,',_0x4e08ac(0x1c1),_0x4e08ac(0x29c),_0x4e08ac(0x290),_0x4e08ac(0x22e))):_0x4ead40['push'](_0x4e08ac(0x1c7),_0x4e08ac(0x27d),_0x4e08ac(0x229),_0x4e08ac(0x1c8)+_0xfc8cdf['sqlCode']+'\x27,',_0x4e08ac(0x220),_0x4e08ac(0x25f),_0x4e08ac(0x2a1),'}'),_0x4ead40['join']('\x0a');}export async function getErConfig(_0x3aa8b4,_0x50a0ce){const _0x5f41f5=a197_0x54ab,_0x339a34=await apiRequest(_0x5f41f5(0x22d),{'method':_0x5f41f5(0x223),'body':{'appCode':_0x3aa8b4,'dblinkId':_0x50a0ce},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x339a34[_0x5f41f5(0x1cd)];}export async function getErRelationDetail(_0x758198,_0xaad4d){const _0x59b9b7=a197_0x54ab,_0x1c30c9=new URLSearchParams({'appCode':_0x758198,'relationId':String(_0xaad4d)});try{const _0x3159e6=await apiRequest(_0x59b9b7(0x2af)+_0x1c30c9['toString']());return _0x3159e6[_0x59b9b7(0x1cd)]?.[_0x59b9b7(0x22a)]??null;}catch(_0x4e5f86){if(_0x4e5f86 instanceof CliError&&_0x4e5f86['code']===_0x59b9b7(0x2ad)&&(_0x4e5f86[_0x59b9b7(0x295)]?.[_0x59b9b7(0x20d)](_0x59b9b7(0x2a5))||_0x4e5f86['hint']==='API\x20error\x20code:\x20306'&&_0x4e5f86['message']===_0x59b9b7(0x248)))return null;throw _0x4e5f86;}}export async function createErRelation(_0x2a1e69){const _0x5453ef=a197_0x54ab,_0x5df008=await apiRequest(_0x5453ef(0x2a6),{'method':'POST','body':_0x2a1e69,'allowNonJsonSuccess':!![]});return _0x5df008[_0x5453ef(0x1cd)];}export async function updateErRelation(_0x23b89b){const _0x444420=a197_0x54ab,_0x475b06=await apiRequest(_0x444420(0x243),{'method':_0x444420(0x223),'body':_0x23b89b,'allowNonJsonSuccess':!![]});return _0x475b06['data'];}export async function deleteErRelation(_0x1bb19a){const _0x350b87=a197_0x54ab,_0x1d32f7=await apiRequest(_0x350b87(0x255),{'method':_0x350b87(0x223),'body':_0x1bb19a,'allowNonJsonSuccess':!![]});return _0x1d32f7['data'];}export async function updateErBusinessGroup(_0x53fd4e){const _0x455260=a197_0x54ab,_0x9c18da=await apiRequest(_0x455260(0x246),{'method':_0x455260(0x223),'body':_0x53fd4e,'allowNonJsonSuccess':!![]});return _0x9c18da['data'];}function buildQuery(_0x10de60){const _0x1d067f=a197_0x54ab,_0x5aac80=new URLSearchParams();for(const [_0x1cc98f,_0x268fe6]of Object[_0x1d067f(0x25d)](_0x10de60)){if(_0x268fe6===undefined||_0x268fe6==='')continue;_0x5aac80[_0x1d067f(0x24b)](_0x1cc98f,String(_0x268fe6));}const _0x3b867a=_0x5aac80['toString']();return _0x3b867a?'?'+_0x3b867a:'';}export async function listNotificationChannelConfigs(_0x3ba7fe,_0xe8d304){const _0x3b8a22=a197_0x54ab,_0x5efe54=await apiRequest(_0x3b8a22(0x1ee)+buildQuery({'appCode':_0x3ba7fe,'channelType':_0xe8d304}));return Array['isArray'](_0x5efe54[_0x3b8a22(0x1cd)])?_0x5efe54['data']:[];}export async function listAppConfigs(_0x1f5e37,_0xf2d1ed){const _0x102b3f=a197_0x54ab,_0x25d309=await apiRequest(_0x102b3f(0x24d),{'method':_0x102b3f(0x223),'body':{'appCode':_0x1f5e37,..._0xf2d1ed?.[_0x102b3f(0x233)]?{'key':_0xf2d1ed[_0x102b3f(0x233)]}:{},..._0xf2d1ed?.[_0x102b3f(0x238)]?{'tags':_0xf2d1ed['tags']}:{}}});return extractAppConfigList(_0x25d309['data']);}export async function getAppConfigByKey(_0x42d14e,_0x4e7ec5){const _0x1248d8=a197_0x54ab,_0x3ddaba=await apiRequest('/smartapi/app-config/getByKey'+buildQuery({'appCode':_0x42d14e,'key':_0x4e7ec5}));return _0x3ddaba[_0x1248d8(0x1cd)]??null;}export async function createAppConfig(_0x1f3a4f){const _0x536969=a197_0x54ab,_0x55b436=await apiRequest(_0x536969(0x21f),{'method':'POST','body':{'appCode':_0x1f3a4f['appCode'],'key':_0x1f3a4f[_0x536969(0x233)],'value':_0x1f3a4f[_0x536969(0x2b0)],..._0x1f3a4f[_0x536969(0x238)]?{'tags':_0x1f3a4f[_0x536969(0x238)]}:{}}});return _0x55b436[_0x536969(0x1cd)];}export async function updateAppConfig(_0x94f37c){const _0x14ae44=a197_0x54ab;await apiRequest(_0x14ae44(0x266),{'method':'POST','body':{'id':_0x94f37c['id'],'appCode':_0x94f37c[_0x14ae44(0x24f)],'key':_0x94f37c[_0x14ae44(0x233)],'value':_0x94f37c[_0x14ae44(0x2b0)],..._0x94f37c[_0x14ae44(0x238)]?{'tags':_0x94f37c['tags']}:{}}});}export async function deleteAppConfig(_0x204dbc){const _0x2aabe2=a197_0x54ab;await apiRequest('/smartapi/app-config/delete',{'method':_0x2aabe2(0x223),'body':_0x204dbc});}function extractAppConfigList(_0x33cccb){const _0x1b5463=a197_0x54ab;if(Array[_0x1b5463(0x1ed)](_0x33cccb))return _0x33cccb;if(_0x33cccb&&typeof _0x33cccb==='object'&&Array[_0x1b5463(0x1ed)](_0x33cccb[_0x1b5463(0x1e6)]))return _0x33cccb[_0x1b5463(0x1e6)];return extractList(_0x33cccb);}export async function listDbLinks(_0x80f148,_0x10de66){const _0x199c9f=a197_0x54ab,_0x51e31b=await apiRequest(_0x199c9f(0x222),{'method':_0x199c9f(0x223),'body':{'appCode':_0x80f148,'currentPage':_0x10de66?.['currentPage']??0x1,'pageSize':_0x10de66?.['pageSize']??0x64}});return{'items':extractList(_0x51e31b[_0x199c9f(0x1cd)]),'paging':extractPaging(_0x51e31b['data'])};}export async function getDbLinkInfo(_0x3ef3a1){const _0x4f319b=a197_0x54ab,_0x19e228=await apiRequest(_0x4f319b(0x207)+buildQuery({'id':_0x3ef3a1}));return _0x19e228['data'];}export async function createDbLink(_0xd0d38){const _0x1d10f1=a197_0x54ab,_0x17e310=await apiRequest(_0x1d10f1(0x1e4),{'method':'POST','body':_0xd0d38});return _0x17e310[_0x1d10f1(0x1cd)];}export async function updateDbLink(_0x3ff359){const _0x23afa7=a197_0x54ab,_0x583400=await apiRequest(_0x23afa7(0x231),{'method':'POST','body':_0x3ff359});return _0x583400[_0x23afa7(0x1cd)];}export async function deleteDbLink(_0xebd4a1){const _0x5992ff=a197_0x54ab;await apiRequest(_0x5992ff(0x22f),{'method':_0x5992ff(0x223),'body':{'id':_0xebd4a1}});}export async function testDbLinkConnect(_0x51c810){const _0x2b562d=a197_0x54ab,_0xb2d37c=await apiRequest(_0x2b562d(0x209)+buildQuery({'id':_0x51c810}));return _0xb2d37c[_0x2b562d(0x1cd)];}export async function startDbAnalysis(_0x4ef46c,_0x32317b){const _0x53a345=a197_0x54ab,_0x1fbf74=await apiRequest(_0x53a345(0x263),{'method':_0x53a345(0x223),'body':{'dbLinkId':_0x4ef46c,..._0x32317b&&_0x32317b[_0x53a345(0x289)]>0x0?{'tableNames':_0x32317b}:{}}});return _0x1fbf74[_0x53a345(0x1cd)];}export async function cancelDbAnalysis(_0x53a0bf){const _0x4f8fba=a197_0x54ab;await apiRequest(_0x4f8fba(0x262)+buildQuery({'planId':_0x53a0bf}),{'method':_0x4f8fba(0x223)});}export async function getDbAnalysisStatus(_0x472b62){const _0x53d4b4=a197_0x54ab,_0x3d3774=await apiRequest(_0x53d4b4(0x1e0)+encodeURIComponent(_0x472b62));return _0x3d3774[_0x53d4b4(0x1cd)];}export async function getDbAllTableList(_0x23e27e,_0x4ec931){const _0x1d052d=a197_0x54ab,_0x3472f0=await apiRequest(_0x1d052d(0x267)+buildQuery({'appCode':_0x23e27e,'dbLinkId':_0x4ec931})),_0x3194b7=_0x3472f0[_0x1d052d(0x1cd)];if(Array[_0x1d052d(0x1ed)](_0x3194b7))return _0x3194b7;return extractList(_0x3194b7);}export async function getDbTableDiff(_0x4ccb2d,_0x36237d,_0x42c48c){const _0x3d18ee=a197_0x54ab,_0x4e06c6=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x4ccb2d,'dbLinkId':_0x36237d,'pageIndex':_0x42c48c?.[_0x3d18ee(0x2a0)]??0x1,'pageSize':_0x42c48c?.[_0x3d18ee(0x224)]??0x14,'tableName':_0x42c48c?.[_0x3d18ee(0x27c)]})),_0x3592b3=_0x4e06c6[_0x3d18ee(0x1cd)];return{'totalCount':_0x3592b3?.[_0x3d18ee(0x286)]??0x0,'physicalTableCount':_0x3592b3?.[_0x3d18ee(0x1d3)]??0x0,'datasetTableCount':_0x3592b3?.[_0x3d18ee(0x28a)]??0x0,..._0x3592b3?.[_0x3d18ee(0x28c)]?{'summary':_0x3592b3[_0x3d18ee(0x28c)]}:{},'tableList':Array[_0x3d18ee(0x1ed)](_0x3592b3?.[_0x3d18ee(0x1d7)])?_0x3592b3[_0x3d18ee(0x1d7)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x1bbcfe=a197_0x54ab,_0x3d929e=await apiRequest('/smartapi/app/getList',{'method':_0x1bbcfe(0x223),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x475595=extractList(_0x3d929e[_0x1bbcfe(0x1cd)]),_0x1e493a=extractPaging(_0x3d929e[_0x1bbcfe(0x1cd)]);return _0x1e493a&&_0x1e493a[_0x1bbcfe(0x286)]>REMOTE_APP_PAGE_SIZE&&console[_0x1bbcfe(0x21e)](_0x1bbcfe(0x272)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x1e493a[_0x1bbcfe(0x286)]+_0x1bbcfe(0x1e9)+_0x1bbcfe(0x1f4)),_0x475595;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x3be27b,_0x3e9d95){const _0x33d06a=a197_0x54ab,_0x2d3720=Math['min'](Math[_0x33d06a(0x23f)](_0x3e9d95?.[_0x33d06a(0x224)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x23808c=await apiRequest(_0x33d06a(0x1cc),{'method':'POST','body':{'appCode':_0x3be27b,'currentPage':_0x3e9d95?.[_0x33d06a(0x1ca)]??0x1,'pageSize':_0x2d3720}});return{'items':extractList(_0x23808c[_0x33d06a(0x1cd)]),'paging':extractPaging(_0x23808c[_0x33d06a(0x1cd)])};}export async function getAppRole(_0x5132f1){const _0x1e6a3a=a197_0x54ab,_0x51c133=await apiRequest(_0x1e6a3a(0x26f)+buildQuery({'id':_0x5132f1}));return _0x51c133[_0x1e6a3a(0x1cd)];}export async function createAppRole(_0x92a216){const _0x14b670=a197_0x54ab,_0x4e0efb=await apiRequest(_0x14b670(0x200),{'method':_0x14b670(0x223),'body':{'appCode':_0x92a216[_0x14b670(0x24f)],'roleName':_0x92a216[_0x14b670(0x1f5)],'roleType':'CUSTOM',..._0x92a216[_0x14b670(0x1d2)]?{'remark':_0x92a216[_0x14b670(0x1d2)]}:{}}});return _0x4e0efb[_0x14b670(0x1cd)];}export async function updateAppRole(_0x7029d3){const _0x1de004=a197_0x54ab,_0x5b9f87=await apiRequest(_0x1de004(0x21a),{'method':_0x1de004(0x223),'body':{'id':_0x7029d3['id'],'appCode':_0x7029d3['appCode'],..._0x7029d3[_0x1de004(0x299)]?{'roleType':_0x7029d3['roleType']}:{},..._0x7029d3[_0x1de004(0x1f5)]!==undefined?{'roleName':_0x7029d3[_0x1de004(0x1f5)]}:{},..._0x7029d3[_0x1de004(0x1d2)]!==undefined?{'remark':_0x7029d3[_0x1de004(0x1d2)]}:{},..._0x7029d3[_0x1de004(0x28b)]?{'permits':_0x7029d3['permits']}:{}}});return _0x5b9f87[_0x1de004(0x1cd)];}export async function deleteAppRole(_0x363946){const _0x4f78cf=a197_0x54ab;await apiRequest(_0x4f78cf(0x2a7),{'method':'POST','body':{'id':_0x363946}});}export async function listPermitRoles(_0x5ddfc0,_0x4d661a){const _0x4fa863=a197_0x54ab,_0x313bfa=await apiRequest(_0x4fa863(0x285),{'method':_0x4fa863(0x223),'body':{'appCode':_0x5ddfc0,..._0x4d661a?.[_0x4fa863(0x1f2)]!==undefined?{'needSelf':_0x4d661a['needSelf']}:{},..._0x4d661a?.[_0x4fa863(0x2aa)]!==undefined?{'needPublic':_0x4d661a['needPublic']}:{}}});return extractList(_0x313bfa['data']);}export async function getRoleMenuResources(_0x2f5081,_0x39ed79){const _0x51c1f2=a197_0x54ab,_0x27eaa1=await apiRequest(_0x51c1f2(0x214),{'method':_0x51c1f2(0x223),'body':{'appCode':_0x2f5081,'roleId':_0x39ed79}});return extractList(_0x27eaa1[_0x51c1f2(0x1cd)]);}export async function getRoleApiResources(_0x27e166,_0x299542){const _0x431e39=a197_0x54ab,_0x5e9416=await apiRequest(_0x431e39(0x1cf),{'method':'POST','body':{'appCode':_0x27e166,'roleId':_0x299542}});return extractList(_0x5e9416[_0x431e39(0x1cd)]);}export async function listRoleUsers(_0x51235f){const _0x8ad76=a197_0x54ab,_0x141360=await apiRequest(_0x8ad76(0x292),{'method':_0x8ad76(0x223),'body':{'appCode':_0x51235f}});return extractList(_0x141360[_0x8ad76(0x1cd)]);}export async function updateRoleUsers(_0x402315,_0x49a4e1){const _0x4dc9c0=a197_0x54ab;await apiRequest(_0x4dc9c0(0x240),{'method':_0x4dc9c0(0x223),'body':{'appCode':_0x402315,'roleList':_0x49a4e1}});}export async function getPagePermit(_0x5b6a26){const _0xee1d96=a197_0x54ab,_0x3262ea=await apiRequest(_0xee1d96(0x1eb)+buildQuery({'menuId':_0x5b6a26}));return _0x3262ea[_0xee1d96(0x1cd)];}export async function savePagePermit(_0x75f004){const _0x25cced=a197_0x54ab,_0x444887=await apiRequest('/smartapi/permit/page/save',{'method':_0x25cced(0x223),'body':_0x75f004});return _0x444887['data'];}export async function getTenantMembers(_0xbac88d){const _0x4e7a49=a197_0x54ab,_0xf64746=await apiRequest('/userTenant/getByTenantCode'+buildQuery({'code':_0xbac88d})),_0x2cbe77=_0xf64746[_0x4e7a49(0x1cd)]??{},_0x19ace2=Array['isArray'](_0x2cbe77?.[_0x4e7a49(0x205)])?_0x2cbe77['userTenantRelationList']:[];return _0x19ace2['filter'](_0x2500ed=>_0x2500ed?.[_0x4e7a49(0x26b)]===_0x4e7a49(0x291)||_0x2500ed?.[_0x4e7a49(0x26b)]===undefined)[_0x4e7a49(0x1bc)](_0x3eae67=>({'userId':Number(_0x3eae67['userId']??_0x3eae67['id']),'username':_0x3eae67[_0x4e7a49(0x20b)],'nickname':_0x3eae67['nickname'],'status':_0x3eae67['status'],'email':_0x3eae67[_0x4e7a49(0x206)],'mobile':_0x3eae67[_0x4e7a49(0x226)],'avatar':_0x3eae67[_0x4e7a49(0x293)]}))[_0x4e7a49(0x25a)](_0x4a17f2=>Number['isFinite'](_0x4a17f2[_0x4e7a49(0x29a)])&&_0x4a17f2['userId']>0x0);}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a198_0x11261c=a198_0x50b8;function a198_0x270c(){const _0x27686a=['423463gjwApn','/bff','bff-trash','501798XYucUJ','.rabetbase','bff','3919596CjwwLg','bff.lock.json','1442511IaBkDM','2515968QuUuAv','4QczRhl','9532629QIUuae','1086830cnXHlw','8Alajwf'];a198_0x270c=function(){return _0x27686a;};return a198_0x270c();}(function(_0x4962f9,_0x4e5860){const _0x476f5d=a198_0x50b8,_0xe250f7=_0x4962f9();while(!![]){try{const _0x356f50=-parseInt(_0x476f5d(0xfa))/0x1+-parseInt(_0x476f5d(0x104))/0x2*(parseInt(_0x476f5d(0xfd))/0x3)+-parseInt(_0x476f5d(0x103))/0x4+parseInt(_0x476f5d(0xf8))/0x5+parseInt(_0x476f5d(0x100))/0x6+-parseInt(_0x476f5d(0x102))/0x7+parseInt(_0x476f5d(0xf9))/0x8*(parseInt(_0x476f5d(0xf7))/0x9);if(_0x356f50===_0x4e5860)break;else _0xe250f7['push'](_0xe250f7['shift']());}catch(_0x130b9b){_0xe250f7['push'](_0xe250f7['shift']());}}}(a198_0x270c,0x52371));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a198_0x50b8(_0x5b487f,_0x380ddd){_0x5b487f=_0x5b487f-0xf7;const _0x270cab=a198_0x270c();let _0x50b8a5=_0x270cab[_0x5b487f];return _0x50b8a5;}const DOT_DIR=a198_0x11261c(0xfe),LOCK_FILE_NAME=a198_0x11261c(0x101),TRASH_DIR_NAME=a198_0x11261c(0xfc);export function loadBffProjectConfig(_0x3661d,_0x31df00){const _0x5776f4=a198_0x11261c,_0x53e3f5=resolve(_0x31df00??findProjectRootDirectory()),_0x34abbb=DOT_DIR+_0x5776f4(0xfb),_0x24fa26=_0x34abbb+'/'+_0x3661d;return{'projectRoot':_0x53e3f5,'appCode':_0x3661d,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x34abbb,'scriptsRoot':_0x24fa26,'scriptsRootDir':resolve(_0x53e3f5,DOT_DIR,_0x5776f4(0xff),_0x3661d),'lockFilePath':resolve(_0x53e3f5,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x53e3f5,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a199_0x662db5=a199_0x3ed2;function a199_0x5c39(){const _0x1ab725=['ENDPOINT','after','afterScriptId','datasetCode','operationType','678570mTIjzr','map','push','isFile','code','includes','ENOENT','F_OK','set','isDirectory','953169gZbsKN','scriptType','2262948DtIeWo','scriptsRootDir','1115276ukTqjN','1335027rsbzbT','COMMON','HOOK','8SWZZNr','509533jpmGoc','2421635YmUAkU','get','toUpperCase','.js','functionName','beforeScriptId','endsWith','split','trim','name','replace'];a199_0x5c39=function(){return _0x1ab725;};return a199_0x5c39();}function a199_0x3ed2(_0x3c8246,_0x1d41ff){_0x3c8246=_0x3c8246-0x8e;const _0x5c39cf=a199_0x5c39();let _0x3ed202=_0x5c39cf[_0x3c8246];return _0x3ed202;}(function(_0x56ed3c,_0x53b3c8){const _0x40f36a=a199_0x3ed2,_0x3960fa=_0x56ed3c();while(!![]){try{const _0x5c1199=-parseInt(_0x40f36a(0xa4))/0x1+-parseInt(_0x40f36a(0x91))/0x2+parseInt(_0x40f36a(0xa0))/0x3+-parseInt(_0x40f36a(0x9f))/0x4+parseInt(_0x40f36a(0xa5))/0x5+parseInt(_0x40f36a(0x9d))/0x6+-parseInt(_0x40f36a(0x9b))/0x7*(-parseInt(_0x40f36a(0xa3))/0x8);if(_0x5c1199===_0x53b3c8)break;else _0x3960fa['push'](_0x3960fa['shift']());}catch(_0x42899a){_0x3960fa['push'](_0x3960fa['shift']());}}}(a199_0x5c39,0x4ce90));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_0x662db5(0xa1),a199_0x662db5(0xb0),a199_0x662db5(0xa2)];export function normalizeBffType(_0x5a090e){const _0xef81f=a199_0x662db5;if(!_0x5a090e)return undefined;const _0x3130cf=_0x5a090e[_0xef81f(0xad)]()[_0xef81f(0xa7)]();return SUPPORTED_BFF_TYPES[_0xef81f(0x96)](_0x3130cf)?_0x3130cf:undefined;}async function scanJsFilesRecursively(_0x518d48,_0x413bce){const _0x2de31a=a199_0x662db5,_0x4a1794=[];try{const _0x2d5494=await readdir(_0x518d48,{'withFileTypes':!![]});for(const _0x264eea of _0x2d5494){const _0x1a6b26=join(_0x518d48,_0x264eea[_0x2de31a(0xae)]);if(_0x264eea[_0x2de31a(0x9a)]())_0x4a1794[_0x2de31a(0x93)](...await scanJsFilesRecursively(_0x1a6b26,_0x413bce+'/'+_0x264eea[_0x2de31a(0xae)]));else _0x264eea[_0x2de31a(0x94)]()&&_0x264eea[_0x2de31a(0xae)]['endsWith']('.js')&&_0x4a1794[_0x2de31a(0x93)]({'lockKey':_0x413bce+'/'+_0x264eea[_0x2de31a(0xae)]['replace'](/\.js$/,''),'filePath':_0x1a6b26});}}catch(_0x2ef22f){if(_0x2ef22f[_0x2de31a(0x95)]!==_0x2de31a(0x97))throw _0x2ef22f;}return _0x4a1794;}async function scanFlatFunctions(_0x4ad9df,_0x50155d){const _0xeebe53=a199_0x662db5,_0x5ed80c=join(_0x4ad9df[_0xeebe53(0x9e)],_0x50155d),_0x33c85d=await scanJsFilesRecursively(_0x5ed80c,_0x50155d);return _0x33c85d[_0xeebe53(0x92)](({lockKey:_0x3f74a0,filePath:_0x1713d7})=>({'type':_0x50155d,'name':_0x3f74a0[_0xeebe53(0xac)]('/')['at'](-0x1)??'','filePath':_0x1713d7,'lockKey':_0x3f74a0}));}async function scanHookFunctions(_0x7a9409){const _0x7f95a8=a199_0x662db5,_0x18f250=join(_0x7a9409[_0x7f95a8(0x9e)],_0x7f95a8(0xa2)),_0x10ebaa=[];try{const _0xf05ee3=await readdir(_0x18f250,{'withFileTypes':!![]});for(const _0x7373ec of _0xf05ee3){if(!_0x7373ec[_0x7f95a8(0x9a)]())continue;const _0x32ce91=_0x7373ec[_0x7f95a8(0xae)],_0x2b357d=join(_0x18f250,_0x32ce91),_0x58e2c2=await readdir(_0x2b357d,{'withFileTypes':!![]});for(const _0x10b4ba of _0x58e2c2){if(!_0x10b4ba[_0x7f95a8(0x9a)]())continue;const _0x1661dc=_0x10b4ba['name'],_0x353a48=join(_0x2b357d,_0x1661dc),_0x4c9db4=await readdir(_0x353a48,{'withFileTypes':!![]});for(const _0x18cc45 of _0x4c9db4){if(!_0x18cc45[_0x7f95a8(0x9a)]())continue;const _0x23e773=_0x18cc45[_0x7f95a8(0xae)],_0x3ba3fd=join(_0x353a48,_0x23e773),_0x3f96ac=await readdir(_0x3ba3fd,{'withFileTypes':!![]});for(const _0x30ca41 of _0x3f96ac){if(!_0x30ca41[_0x7f95a8(0x94)]()||!_0x30ca41[_0x7f95a8(0xae)][_0x7f95a8(0xab)](_0x7f95a8(0xa8)))continue;const _0xaf31c3=_0x30ca41['name'][_0x7f95a8(0xaf)](/\.js$/,'');_0x10ebaa[_0x7f95a8(0x93)]({'type':_0x7f95a8(0xa2),'name':_0xaf31c3,'filePath':join(_0x3ba3fd,_0x30ca41[_0x7f95a8(0xae)]),'lockKey':'HOOK/'+_0x32ce91+'/'+_0x1661dc+'/'+_0x23e773+'/'+_0xaf31c3,'alias':_0x32ce91,'operationType':_0x1661dc,'functionNode':_0x23e773});}}}}}catch(_0x142f7d){if(_0x142f7d[_0x7f95a8(0x95)]!==_0x7f95a8(0x97))throw _0x142f7d;}return _0x10ebaa;}export async function scanLocalBffFunctions(_0x3102f5,_0x5f494f){const _0x8ca38=a199_0x662db5;if(_0x5f494f==='COMMON'||_0x5f494f===_0x8ca38(0xb0))return scanFlatFunctions(_0x3102f5,_0x5f494f);if(_0x5f494f===_0x8ca38(0xa2))return scanHookFunctions(_0x3102f5);const [_0x542e76,_0x294690,_0x3cd59a]=await Promise['all']([scanFlatFunctions(_0x3102f5,'COMMON'),scanFlatFunctions(_0x3102f5,'ENDPOINT'),scanHookFunctions(_0x3102f5)]);return[..._0x542e76,..._0x294690,..._0x3cd59a];}export function resolveLocalFilePathFromLockKey(_0x452b81,_0xb5a21a){return join(_0x452b81['scriptsRootDir'],..._0xb5a21a['split']('/'))+'.js';}export function createHookLocationMap(_0x1fac4e){const _0x189574=a199_0x662db5,_0x397a15=new Map();for(const _0x36f17b of _0x1fac4e){_0x36f17b[_0x189574(0xaa)]&&_0x397a15[_0x189574(0x99)](_0x36f17b['beforeScriptId'],{'datasetCode':_0x36f17b[_0x189574(0x8f)],'operationType':snakeToCamel(_0x36f17b[_0x189574(0x90)]),'functionNode':'before'}),_0x36f17b[_0x189574(0x8e)]&&_0x397a15['set'](_0x36f17b[_0x189574(0x8e)],{'datasetCode':_0x36f17b[_0x189574(0x8f)],'operationType':snakeToCamel(_0x36f17b['operationType']),'functionNode':_0x189574(0xb1)});}return _0x397a15;}export function resolveRemoteScriptTarget(_0x1cfab1,_0x1b5c57,_0x381b1f,_0x8b8989,_0x1947af){const _0xe76c3b=a199_0x662db5,_0x29a0b0=normalizeBffType(_0x1b5c57[_0xe76c3b(0x9c)]);if(!_0x29a0b0||!_0x1b5c57[_0xe76c3b(0xa9)])return null;if(_0x29a0b0===_0xe76c3b(0xa2)){const _0x5cfe69=(_0x1b5c57['id']?_0x381b1f[_0xe76c3b(0xa6)](_0x1b5c57['id']):undefined)??findHookLocationByRemoteId(_0x8b8989,_0x1b5c57['id']);if(!_0x5cfe69)return null;const _0x16ae2e=_0x5cfe69['alias']||_0x1947af[_0xe76c3b(0xa6)](_0x5cfe69[_0xe76c3b(0x8f)]),_0x2daa5c=_0x16ae2e??_0x5cfe69['datasetCode'],_0x3a4555={..._0x5cfe69,'alias':_0x16ae2e},_0x5659e2='HOOK/'+_0x2daa5c+'/'+_0x3a4555[_0xe76c3b(0x90)]+'/'+_0x3a4555['functionNode']+'/'+_0x1b5c57[_0xe76c3b(0xa9)];return{'lockKey':_0x5659e2,'filePath':resolveLocalFilePathFromLockKey(_0x1cfab1,_0x5659e2),'type':_0xe76c3b(0xa2),'hookLocation':_0x3a4555};}const _0x2cccea=_0x29a0b0+'/'+_0x1b5c57['functionName'];return{'lockKey':_0x2cccea,'filePath':resolveLocalFilePathFromLockKey(_0x1cfab1,_0x2cccea),'type':_0x29a0b0};}export async function ensureParentDirectory(_0x150354){await mkdir(dirname(_0x150354),{'recursive':!![]});}export async function fileExists(_0x1edc6e){const _0x55e014=a199_0x662db5;try{return await access(_0x1edc6e,constants[_0x55e014(0x98)]),!![];}catch{return![];}}export async function directoryExists(_0x1c8e16){try{const _0x2fb2b3=await stat(_0x1c8e16);return _0x2fb2b3['isDirectory']();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a200_0x3d68(){const _0x5e814b=['222TFheEQ','createHash','207365tRCKcq','update','hex','digest','utf8','7987688WqUiqT','md5','2080124vuMTao','2742776AjeXMd','1851897icfpfw','1771915yFXAVq','363930ZdrXDi'];a200_0x3d68=function(){return _0x5e814b;};return a200_0x3d68();}(function(_0x55b454,_0x4ab2e9){const _0x4239e3=a200_0x2608,_0x14a4cb=_0x55b454();while(!![]){try{const _0x4839aa=parseInt(_0x4239e3(0x153))/0x1+parseInt(_0x4239e3(0x150))/0x2+-parseInt(_0x4239e3(0x152))/0x3+-parseInt(_0x4239e3(0x151))/0x4+parseInt(_0x4239e3(0x157))/0x5*(-parseInt(_0x4239e3(0x155))/0x6)+-parseInt(_0x4239e3(0x154))/0x7+parseInt(_0x4239e3(0x15c))/0x8;if(_0x4839aa===_0x4ab2e9)break;else _0x14a4cb['push'](_0x14a4cb['shift']());}catch(_0x4d9566){_0x14a4cb['push'](_0x14a4cb['shift']());}}}(a200_0x3d68,0xe0d7a));import{readFile}from'node:fs/promises';import a200_0x1da60d from'node:crypto';function a200_0x2608(_0x5e4245,_0x33cb4f){_0x5e4245=_0x5e4245-0x14f;const _0x3d6864=a200_0x3d68();let _0x260880=_0x3d6864[_0x5e4245];return _0x260880;}export function computeContentHash(_0x5ecc86){const _0x370195=a200_0x2608;return a200_0x1da60d[_0x370195(0x156)](_0x370195(0x14f))[_0x370195(0x158)](_0x5ecc86)[_0x370195(0x15a)](_0x370195(0x159));}export async function computeFileHash(_0x3dfa3c){const _0x532ec7=a200_0x2608,_0x33b9a8=await readFile(_0x3dfa3c,_0x532ec7(0x15b));return computeContentHash(_0x33b9a8);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x998e45,_0x16ae59){const _0x4b1143=a201_0x59a4,_0x47d028=_0x998e45();while(!![]){try{const _0x25fa47=-parseInt(_0x4b1143(0xa1))/0x1+-parseInt(_0x4b1143(0xa8))/0x2*(-parseInt(_0x4b1143(0xac))/0x3)+parseInt(_0x4b1143(0xa5))/0x4*(parseInt(_0x4b1143(0x96))/0x5)+-parseInt(_0x4b1143(0xa3))/0x6*(-parseInt(_0x4b1143(0x9a))/0x7)+parseInt(_0x4b1143(0xa4))/0x8*(parseInt(_0x4b1143(0xa0))/0x9)+-parseInt(_0x4b1143(0xaa))/0xa*(parseInt(_0x4b1143(0x9c))/0xb)+parseInt(_0x4b1143(0xa9))/0xc*(-parseInt(_0x4b1143(0x9e))/0xd);if(_0x25fa47===_0x16ae59)break;else _0x47d028['push'](_0x47d028['shift']());}catch(_0xe31485){_0x47d028['push'](_0x47d028['shift']());}}}(a201_0x2842,0xb9a88));import{mkdir,readFile,writeFile}from'node:fs/promises';function a201_0x59a4(_0x31d065,_0x439667){_0x31d065=_0x31d065-0x95;const _0x284295=a201_0x2842();let _0x59a4ca=_0x284295[_0x31d065];return _0x59a4ca;}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}function a201_0x2842(){const _0xbf1cae=['8571549ZMCCsJ',':\x20scriptsRoot\x20mismatch\x20—\x20','34089WVlbML','scriptsRoot','871hJQywf','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','157293GnEplp','1017379lSjSAT','stringify','6eFMLmK','488HPTwvD','10492NzrccW','\x22\x20vs\x20lock\x20\x22','object','36834tYxtBN','168252IbUnha','3750CytylM','lastSync','99Cmzmms','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','current\x20\x22','functions','1870mmfNzZ','apps','parse','\x22.\x20'];a201_0x2842=function(){return _0xbf1cae;};return a201_0x2842();}export function ensureLockScope(_0x23a8a1,_0x42003e,_0x294b98,_0xa994b0){const _0x5ff917=a201_0x59a4,_0x118c0c={'apps':_0x23a8a1['apps']&&typeof _0x23a8a1[_0x5ff917(0x97)]==='object'?_0x23a8a1[_0x5ff917(0x97)]:{}};let _0x4b82de=_0x118c0c[_0x5ff917(0x97)][_0x42003e];if(!_0x4b82de)return _0x4b82de={'scriptsRoot':_0x294b98,'lastSync':'','functions':{}},_0x118c0c['apps'][_0x42003e]=_0x4b82de,{'lockData':_0x118c0c,'appLock':_0x4b82de};if(!_0x4b82de[_0x5ff917(0x9d)])_0x4b82de[_0x5ff917(0x9d)]=_0x294b98;else{if(_0x4b82de['scriptsRoot']!==_0x294b98)throw new Error(_0xa994b0+_0x5ff917(0x9b)+(_0x5ff917(0xae)+_0x294b98+_0x5ff917(0xa6)+_0x4b82de[_0x5ff917(0x9d)]+_0x5ff917(0x99))+_0x5ff917(0x9f));}return!_0x4b82de[_0x5ff917(0x95)]&&(_0x4b82de[_0x5ff917(0x95)]={}),!_0x4b82de[_0x5ff917(0xab)]&&(_0x4b82de['lastSync']=''),{'lockData':_0x118c0c,'appLock':_0x4b82de};}export async function readBffLockFile(_0x7cf28d){const _0x43fe22=a201_0x59a4;try{const _0x580b42=await readFile(_0x7cf28d,'utf8'),_0x344066=JSON[_0x43fe22(0x98)](_0x580b42);return{'apps':_0x344066[_0x43fe22(0x97)]&&typeof _0x344066[_0x43fe22(0x97)]===_0x43fe22(0xa7)?_0x344066[_0x43fe22(0x97)]:{}};}catch(_0x43df28){if(_0x43df28['code']==='ENOENT')return null;throw new Error(_0x43fe22(0xad)+String(_0x43df28));}}export async function writeBffLockFile(_0x4f3dfd,_0x2e51bf){const _0x9f601=a201_0x59a4;await mkdir(dirname(_0x4f3dfd),{'recursive':!![]}),await writeFile(_0x4f3dfd,JSON[_0x9f601(0xa2)](_0x2e51bf,null,0x2),'utf8');}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a203_0x5cda(_0x4915e4,_0x33a340){_0x4915e4=_0x4915e4-0x16e;const _0x116b55=a203_0x116b();let _0x5cdac9=_0x116b55[_0x4915e4];return _0x5cdac9;}function a203_0x116b(){const _0x544302=['35360220bVHNTT','toLowerCase','8677710RzgZcS','4590171HpRjFu','test','trim','functionNode','124CnpWiE','remoteId','9754RCGPQs','after','8OIEAhk','values','222DIlpym','operationType','datasetCode','4096575SDAmcW','match','3193086RwCNhE','toUpperCase','114770YDaBOY'];a203_0x116b=function(){return _0x544302;};return a203_0x116b();}(function(_0x4c2e15,_0x4a6148){const _0x1e53d7=a203_0x5cda,_0x3cf312=_0x4c2e15();while(!![]){try{const _0x59e885=-parseInt(_0x1e53d7(0x17a))/0x1*(parseInt(_0x1e53d7(0x17e))/0x2)+-parseInt(_0x1e53d7(0x16e))/0x3+-parseInt(_0x1e53d7(0x178))/0x4*(-parseInt(_0x1e53d7(0x170))/0x5)+-parseInt(_0x1e53d7(0x173))/0x6+parseInt(_0x1e53d7(0x181))/0x7+-parseInt(_0x1e53d7(0x17c))/0x8*(parseInt(_0x1e53d7(0x174))/0x9)+parseInt(_0x1e53d7(0x171))/0xa;if(_0x59e885===_0x4a6148)break;else _0x3cf312['push'](_0x3cf312['shift']());}catch(_0xd7807b){_0x3cf312['push'](_0x3cf312['shift']());}}}(a203_0x116b,0xb2175));export function snakeToCamel(_0x423945){const _0x69edbf=a203_0x5cda;return _0x423945[_0x69edbf(0x172)]()['replace'](/_([a-z])/g,(_0x3c9fcc,_0x596986)=>_0x596986[_0x69edbf(0x16f)]());}export function findHookLocationByRemoteId(_0x561d29,_0x183418){const _0xe19a56=a203_0x5cda;if(!_0x183418)return undefined;for(const _0x4982ac of Object[_0xe19a56(0x17d)](_0x561d29)){if(_0x4982ac[_0xe19a56(0x179)]===_0x183418&&_0x4982ac[_0xe19a56(0x180)]&&_0x4982ac[_0xe19a56(0x17f)]&&_0x4982ac[_0xe19a56(0x177)])return{'datasetCode':_0x4982ac['datasetCode'],'operationType':_0x4982ac[_0xe19a56(0x17f)],'functionNode':_0x4982ac[_0xe19a56(0x177)]};}return undefined;}export function extractScriptDescription(_0x3266a9){const _0x4c975f=a203_0x5cda,_0x5e6ab1=_0x3266a9[_0x4c975f(0x182)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x5e6ab1?.[0x1]?.[_0x4c975f(0x176)]()||undefined;}export function isValidBffFunctionName(_0x37768a){const _0x6f1976=a203_0x5cda;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x6f1976(0x175)](_0x37768a);}export function normalizeHookFunctionNode(_0x3ea466){const _0x2028f7=a203_0x5cda;if(!_0x3ea466)return undefined;const _0x32d473=_0x3ea466[_0x2028f7(0x176)]()[_0x2028f7(0x172)]();if(_0x32d473==='before'||_0x32d473===_0x2028f7(0x17b))return _0x32d473;return undefined;}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x439705,_0x157356){const _0x4252e9=a204_0x27d5,_0x2fb81e=_0x439705();while(!![]){try{const _0x8934dd=parseInt(_0x4252e9(0x14a))/0x1+parseInt(_0x4252e9(0x137))/0x2+parseInt(_0x4252e9(0x142))/0x3+-parseInt(_0x4252e9(0x13e))/0x4+-parseInt(_0x4252e9(0x12e))/0x5+-parseInt(_0x4252e9(0x139))/0x6+parseInt(_0x4252e9(0x145))/0x7;if(_0x8934dd===_0x157356)break;else _0x2fb81e['push'](_0x2fb81e['shift']());}catch(_0x4963f8){_0x2fb81e['push'](_0x2fb81e['shift']());}}}(a204_0x16b0,0x9c226));import{listDatasets}from'../core/api-client.js';function a204_0x27d5(_0x521363,_0x2e1497){_0x521363=_0x521363-0x12e;const _0x16b0bb=a204_0x16b0();let _0x27d509=_0x16b0bb[_0x521363];return _0x27d509;}function a204_0x16b0(){const _0xfc5ca3=['.\x20Be\x20more\x20specific.','toLowerCase','\x22\x20matches\x20multiple\x20databases:\x20','4215952gGWdSA','No\x20database\x20matching\x20\x22','find','\x22\x20under\x20app\x20\x22','1450410fsknpO','dbtableConfig','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','8175384gLZQiI','set','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','filter','length','225019VxuMhg','687975WXDRXe','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','entries','dbId','dbName','map','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','db-','includes','2022704hMohrw','get','6339864DgQRVe','join'];a204_0x16b0=function(){return _0xfc5ca3;};return a204_0x16b0();}const cache=new Map();export async function listDatabases(_0x97af4b){const _0x2ed9f8=a204_0x27d5;if(cache['has'](_0x97af4b))return cache[_0x2ed9f8(0x138)](_0x97af4b);const _0x67195b=await listDatasets(_0x97af4b),_0x5c3c9e=new Map();for(const _0x33ee40 of _0x67195b){const _0x2933f8=_0x33ee40[_0x2ed9f8(0x143)];_0x2933f8?.[_0x2ed9f8(0x131)]!=null&&_0x5c3c9e[_0x2ed9f8(0x146)](_0x2933f8[_0x2ed9f8(0x131)],_0x2933f8['dbName']??_0x2ed9f8(0x135)+_0x2933f8[_0x2ed9f8(0x131)]);}const _0x5aaac3=[..._0x5c3c9e[_0x2ed9f8(0x130)]()]['map'](([_0x927d3f,_0x5c5fe9])=>({'dbId':_0x927d3f,'dbName':_0x5c5fe9}));return cache[_0x2ed9f8(0x146)](_0x97af4b,_0x5aaac3),_0x5aaac3;}export async function resolveDb(_0x21cfef,_0x10199b){const _0x5d20c3=a204_0x27d5,_0x20db36=await listDatabases(_0x21cfef);if(_0x20db36[_0x5d20c3(0x149)]===0x0)return{'resolved':[],'error':_0x5d20c3(0x12f)+_0x21cfef+_0x5d20c3(0x134)};if(!_0x10199b)return{'resolved':_0x20db36};const _0x32a643=Number(_0x10199b);if(!Number['isNaN'](_0x32a643)){const _0x50eec9=_0x20db36[_0x5d20c3(0x140)](_0x4c5d78=>_0x4c5d78['dbId']===_0x32a643);if(_0x50eec9)return{'resolved':[_0x50eec9]};}const _0x4c57ac=_0x10199b[_0x5d20c3(0x13c)](),_0x590b77=_0x20db36[_0x5d20c3(0x148)](_0x510ac1=>_0x510ac1[_0x5d20c3(0x132)][_0x5d20c3(0x13c)]()[_0x5d20c3(0x136)](_0x4c57ac));if(_0x590b77[_0x5d20c3(0x149)]>0x0)return{'resolved':_0x590b77};const _0x2acef4=_0x20db36[_0x5d20c3(0x133)](_0x7861b4=>_0x7861b4[_0x5d20c3(0x132)]+'\x20('+_0x7861b4[_0x5d20c3(0x131)]+')')['join'](',\x20');return{'resolved':[],'error':_0x5d20c3(0x13f)+_0x10199b+_0x5d20c3(0x141)+_0x21cfef+'\x22.\x20Available:\x20'+_0x2acef4+_0x5d20c3(0x147)};}export async function resolveOneDb(_0x15c819,_0x46a79b){const _0x16349=a204_0x27d5,{resolved:_0x165432,error:_0x456b67}=await resolveDb(_0x15c819,_0x46a79b);if(_0x456b67)return{'db':null,'error':_0x456b67};if(_0x165432[_0x16349(0x149)]===0x1)return{'db':_0x165432[0x0]};if(!_0x46a79b){const _0x8f30f=_0x165432[_0x16349(0x133)](_0x443eb4=>_0x443eb4[_0x16349(0x132)]+'\x20('+_0x443eb4[_0x16349(0x131)]+')')['join'](',\x20');return{'db':null,'error':_0x16349(0x144)+_0x8f30f};}const _0x33a40d=_0x165432[_0x16349(0x133)](_0x16b556=>_0x16b556[_0x16349(0x132)]+'\x20('+_0x16b556[_0x16349(0x131)]+')')[_0x16349(0x13a)](',\x20');return{'db':null,'error':'\x22'+_0x46a79b+_0x16349(0x13d)+_0x33a40d+_0x16349(0x13b)};}export async function getDbName(_0x2a1dc2,_0x5cc3d4){const _0x268497=a204_0x27d5,_0x5481e8=await listDatabases(_0x2a1dc2);return _0x5481e8[_0x268497(0x140)](_0x591cce=>_0x591cce['dbId']===_0x5cc3d4)?.['dbName'];}
|