@lovrabet/rabetbase-cli 2.3.4-beta.1 → 2.3.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -560
- 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/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.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-selector.js +1 -1
- package/lib/commands/common/flags.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/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/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/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.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/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/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/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/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/workspace/index.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-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/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 +18 -2
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a156_0x2a8a95=a156_0x1a99;(function(_0x2daead,_0x577c2a){const _0x92e461=a156_0x1a99,_0x3623ee=_0x2daead();while(!![]){try{const _0x5755ba=-parseInt(_0x92e461(0x1dd))/0x1+parseInt(_0x92e461(0x1e1))/0x2+parseInt(_0x92e461(0x1e5))/0x3+-parseInt(_0x92e461(0x1dc))/0x4*(-parseInt(_0x92e461(0x1d6))/0x5)+parseInt(_0x92e461(0x1da))/0x6+-parseInt(_0x92e461(0x1e7))/0x7*(-parseInt(_0x92e461(0x1d7))/0x8)+-parseInt(_0x92e461(0x1e3))/0x9*(parseInt(_0x92e461(0x1f3))/0xa);if(_0x5755ba===_0x577c2a)break;else _0x3623ee['push'](_0x3623ee['shift']());}catch(_0x33f879){_0x3623ee['push'](_0x3623ee['shift']());}}}(a156_0xd555,0x4a203));import{resolve}from'node:path';import{CLI_BIN_NAME}from'./constant/cli.js';import{buildAuth}from'./context/auth-resolver.js';import{resolveAppConfig}from'./context/app-resolver.js';import{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile}from'./context/config-loader.js';import{logger}from'./utils/logger.js';export{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile};function env(_0x3e6538){return process.env[`RABETBASE_${_0x3e6538}`]||process.env[`LOVRABET_${_0x3e6538}`]||undefined;}export async function createContext(_0x5409fa){const _0x4a9a86=a156_0x1a99,{config:_0x3b4562,layers:_0x3786bb}=readRawConfigWithLayers(),_0x32a96a=buildConfig(_0x3b4562,_0x5409fa,_0x3786bb),{initEnv:_0x293275}=await import(_0x4a9a86(0x1de));if(_0x32a96a[_0x4a9a86(0x1db)])_0x293275(_0x32a96a[_0x4a9a86(0x1db)]);else _0x5409fa[_0x4a9a86(0x1db)]&&typeof _0x5409fa[_0x4a9a86(0x1db)]==='string'&&_0x293275(_0x5409fa[_0x4a9a86(0x1db)]);const {initDomains:_0x4e67fa,getUserDomain:_0x519ccd,getApiDomain:_0x40d54d}=await import(_0x4a9a86(0x1f4));_0x4e67fa({'apiDomain':_0x3b4562[_0x4a9a86(0x1f6)]||undefined,'userDomain':_0x3b4562[_0x4a9a86(0x1d2)]||undefined,'runtimeDomain':_0x3b4562[_0x4a9a86(0x1e9)]||undefined});const _0xd8a731={'apiDomain':_0x40d54d(),'userDomain':_0x519ccd()},_0x47f4a1=await buildAuth(_0x32a96a);logger[_0x4a9a86(0x1fd)](process['cwd']());const _0x11fa8e=(CLI_BIN_NAME+'\x20'+process[_0x4a9a86(0x1f1)]['slice'](0x2)[_0x4a9a86(0x1d5)]('\x20'))[_0x4a9a86(0x1ee)]();logger[_0x4a9a86(0x1f2)](_0x11fa8e);const {isNonInteractive:_0x1f2067}=await import('./utils/is-non-interactive.js'),_0x5c71e8=_0x1f2067(_0x5409fa);return{'config':_0x32a96a,'auth':_0x47f4a1,'logger':logger,'env':_0xd8a731,'nonInteractive':_0x5c71e8};}export function buildConfigFromFlags(_0xb9f23d){const {config:_0x1c63e9,layers:_0x4b6f9d}=readRawConfigWithLayers();return buildConfig(_0x1c63e9,_0xb9f23d,_0x4b6f9d);}function a156_0xd555(){const _0x53e4b6=['entries','1097890FddmJD','apps','9rvfsmD','globalConfig','1672740VxCJmx','keys','881160WAnDLa','values','runtimeDomain','defaultApp','merged','filter','template_base_url','trim','string','object','argv','setRawCommand','13951870OOuqXB','./constant/domain.js','map','apiDomain','api.ts','cookie','project','projectConfig','find','apiDir','setLogPath','userDomain','https://g.lovrabet.com/dist/lovrabet-skill','appcode','join','2365780ZQyzBW','16DVwSSG','replace','cwd','4212CpqUgQ','env','4DpjZzf','133337vfSgeb','./constant/env.js','length'];a156_0xd555=function(){return _0x53e4b6;};return a156_0xd555();}function a156_0x1a99(_0x4ebe55,_0x1c31e7){_0x4ebe55=_0x4ebe55-0x1d2;const _0xd55530=a156_0xd555();let _0x1a99b2=_0xd55530[_0x4ebe55];return _0x1a99b2;}export function getConfigAppCode(_0x4effd9){const _0x5008c8=a156_0x1a99,_0x4345aa=readRawConfig(_0x4effd9);if(_0x4345aa[_0x5008c8(0x1e2)]&&typeof _0x4345aa[_0x5008c8(0x1e2)]===_0x5008c8(0x1f0)){const _0x4a0bdb=_0x4345aa[_0x5008c8(0x1ea)];if(_0x4a0bdb&&_0x4345aa[_0x5008c8(0x1e2)][_0x4a0bdb]?.[_0x5008c8(0x1d4)])return String(_0x4345aa[_0x5008c8(0x1e2)][_0x4a0bdb]['appcode'])[_0x5008c8(0x1ee)]();const _0x1c460c=Object[_0x5008c8(0x1e8)](_0x4345aa['apps'])[0x0];if(_0x1c460c?.[_0x5008c8(0x1d4)])return String(_0x1c460c[_0x5008c8(0x1d4)])[_0x5008c8(0x1ee)]();}const _0x2f0169=_0x4345aa['appcode']||_0x4345aa['app'];if(typeof _0x2f0169!=='string'||_0x2f0169[_0x5008c8(0x1ee)]()==='')return undefined;return _0x2f0169['trim']();}export function getMultiAppConfigs(_0x41ab10=a156_0x2a8a95(0x1f9),_0xda90f8){const _0x1ef42f=a156_0x2a8a95,_0x5d54e7=loadRawConfigLayers(_0xda90f8);let _0x4f0249,_0x277da4;if(_0x41ab10===_0x1ef42f(0x1eb)){const _0x358ee1=_0x5d54e7['globalConfig'][_0x1ef42f(0x1e2)]&&typeof _0x5d54e7[_0x1ef42f(0x1e4)][_0x1ef42f(0x1e2)]===_0x1ef42f(0x1f0)?_0x5d54e7[_0x1ef42f(0x1e4)][_0x1ef42f(0x1e2)]:{},_0x49c60c=_0x5d54e7[_0x1ef42f(0x1fa)][_0x1ef42f(0x1e2)]&&typeof _0x5d54e7[_0x1ef42f(0x1fa)][_0x1ef42f(0x1e2)]==='object'?_0x5d54e7['projectConfig'][_0x1ef42f(0x1e2)]:{};_0x4f0249={..._0x358ee1,..._0x49c60c};const _0x5299c7=readRawConfig(_0xda90f8);_0x277da4=_0x5299c7[_0x1ef42f(0x1ea)];}else _0x4f0249=_0x5d54e7['projectConfig'][_0x1ef42f(0x1e2)],_0x277da4=_0x5d54e7['projectConfig'][_0x1ef42f(0x1ea)];if(!_0x4f0249||typeof _0x4f0249!==_0x1ef42f(0x1f0)||Object[_0x1ef42f(0x1e6)](_0x4f0249)[_0x1ef42f(0x1df)]===0x0)return null;return Object[_0x1ef42f(0x1e0)](_0x4f0249)[_0x1ef42f(0x1f5)](([_0x318d6d,_0x2d2921])=>({'name':_0x318d6d,'appcode':_0x2d2921?.[_0x1ef42f(0x1d4)]||'','isDefault':_0x318d6d===_0x277da4,'env':_0x2d2921?.[_0x1ef42f(0x1db)],'apiDir':_0x2d2921?.[_0x1ef42f(0x1fc)],'cookie':_0x2d2921?.[_0x1ef42f(0x1f8)]||undefined}))[_0x1ef42f(0x1ec)](_0x545123=>_0x545123[_0x1ef42f(0x1d4)]);}export function getTemplateBaseUrl(_0x2447ee){const _0x1026cf=a156_0x2a8a95,_0x9e0ca4=readRawConfig(_0x2447ee);if(_0x9e0ca4[_0x1026cf(0x1ed)]&&typeof _0x9e0ca4[_0x1026cf(0x1ed)]===_0x1026cf(0x1ef))return _0x9e0ca4[_0x1026cf(0x1ed)][_0x1026cf(0x1d8)](/\/$/,'');return _0x1026cf(0x1d3);}function buildConfig(_0x5d7a86,_0x14065f,_0x8a93ab){return{...resolveAppConfig({'raw':_0x5d7a86,'flags':_0x14065f,'layers':_0x8a93ab,'readEnv':env}),'raw':_0x5d7a86};}export function resolveApiFilePath(_0xaf7986,_0x1cc16d){const _0x559e7b=a156_0x2a8a95,_0x5b4391=resolve(process[_0x559e7b(0x1d9)](),_0xaf7986),_0x34762b=resolve(_0x5b4391,_0x559e7b(0x1f7));if(!_0x1cc16d)return _0x34762b;const _0x1f11c1=readRawConfig(),_0x1a71a6=_0x1f11c1[_0x559e7b(0x1e2)]&&typeof _0x1f11c1['apps']==='object'?_0x1f11c1[_0x559e7b(0x1e2)]:{},_0x2c0908=Object['entries'](_0x1a71a6)[_0x559e7b(0x1fb)](([,_0x401c43])=>_0x401c43?.[_0x559e7b(0x1d4)]===_0x1cc16d);if(!_0x2c0908)return _0x34762b;const [_0x1ffcab,_0x5e7385]=_0x2c0908,_0x1ae4d4=typeof _0x1f11c1['defaultApp']===_0x559e7b(0x1ef)?_0x1f11c1[_0x559e7b(0x1ea)]:undefined;if(_0x5e7385?.[_0x559e7b(0x1fc)])return _0x34762b;if(_0x1ae4d4&&_0x1ffcab!==_0x1ae4d4)return resolve(_0x5b4391,_0x1ffcab+'-api.ts');return _0x34762b;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x16150a,_0x2ee5f7){const _0x138dc3=a157_0x5017,_0x475799=_0x16150a();while(!![]){try{const _0x28e0e2=parseInt(_0x138dc3(0xf6))/0x1+-parseInt(_0x138dc3(0xed))/0x2*(parseInt(_0x138dc3(0xf5))/0x3)+-parseInt(_0x138dc3(0xe5))/0x4*(parseInt(_0x138dc3(0xe9))/0x5)+parseInt(_0x138dc3(0xe8))/0x6*(-parseInt(_0x138dc3(0xec))/0x7)+-parseInt(_0x138dc3(0xef))/0x8*(parseInt(_0x138dc3(0xf4))/0x9)+parseInt(_0x138dc3(0xf3))/0xa*(parseInt(_0x138dc3(0xf0))/0xb)+parseInt(_0x138dc3(0xe7))/0xc*(parseInt(_0x138dc3(0xe6))/0xd);if(_0x28e0e2===_0x2ee5f7)break;else _0x475799['push'](_0x475799['shift']());}catch(_0xe02026){_0x475799['push'](_0x475799['shift']());}}}(a157_0x2823,0x1e2bc));import{readFileSync,existsSync}from'node:fs';function a157_0x5017(_0x553249,_0x554ef0){_0x553249=_0x553249-0xe4;const _0x282387=a157_0x2823();let _0x501751=_0x282387[_0x553249];return _0x501751;}import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x21d417){const _0x271e60=a157_0x5017,_0x56c60b=[],_0xd64c2=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0xdccbe5;while((_0xdccbe5=_0xd64c2[_0x271e60(0xf9)](_0x21d417))!==null){_0x56c60b[_0x271e60(0xeb)]({'datasetCode':_0xdccbe5[0x1],'tableName':_0xdccbe5[0x2],'name':_0xdccbe5[0x3],'alias':_0xdccbe5[0x4]});}return _0x56c60b;}function a157_0x2823(){const _0x2882ac=['104926VhePzH','has','datasetCode','exec','set','152956LHjLRC','6596564hDzvvq','12pPKerG','10296tDtxgd','25kBBBOq','get','push','413IcbIgU','296428KzzyCo','utf-8','28488XWzbxJ','890879rTbyKI','alias','find','20ehSIds','531RowPuk','3wSOFSZ'];a157_0x2823=function(){return _0x2882ac;};return a157_0x2823();}export function loadAliasMap(_0x377632,_0x5bbeb2,_0x55de44){const _0x3c6965=a157_0x5017,_0x378cd6=_0x55de44??resolve(process['cwd'](),_0x377632,'api.ts');if(cache[_0x3c6965(0xf7)](_0x378cd6))return cache[_0x3c6965(0xea)](_0x378cd6);if(!existsSync(_0x378cd6))return cache[_0x3c6965(0xe4)](_0x378cd6,[]),[];try{const _0x48ac02=readFileSync(_0x378cd6,_0x3c6965(0xee)),_0x37cfe9=parseApiFile(_0x48ac02);return cache[_0x3c6965(0xe4)](_0x378cd6,_0x37cfe9),_0x37cfe9;}catch{return cache[_0x3c6965(0xe4)](_0x378cd6,[]),[];}}export function resolveAlias(_0x17dab8,_0x570e5f,_0x3f47d0,_0x71da9f){const _0x5139fd=a157_0x5017;if(!_0x570e5f)return undefined;const _0x1399f7=loadAliasMap(_0x17dab8,_0x3f47d0,_0x71da9f),_0x429fff=_0x1399f7[_0x5139fd(0xf2)](_0x5e4aa3=>_0x5e4aa3[_0x5139fd(0xf1)]===_0x570e5f);return _0x429fff?.[_0x5139fd(0xf8)];}export function listAliases(_0x27c0fc,_0x348219,_0x63ea80){return loadAliasMap(_0x27c0fc,_0x348219,_0x63ea80);}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a158_0x47d1(){const _0x3292dd=['json','sqlCode','join','signal','apiError','4440232PlxKlC','status','datasetName','toLowerCase','replace','const\x20data\x20=\x20await\x20client.sql.execute({','authRequired','target','BFF\x20save\x20returned\x20no\x20valid\x20id','\x20apps.\x20','modelId','/smartapi/question/er-config/update-single','Request\x20timeout:\x20','/api/custom/executeSql','/filter','1389520rQqUCu','warn','/smartapi/custom/getUserCustomSql','\x20\x20sqlCode:\x20\x27','\x20\x20});','\x20failed,\x20HTTP\x20','/smartapi/app-config/list','/smartapi/dataset/get-dataset-list','version','/smartapi/dataset/restore-dataset','/smartapi/app-config/getByKey','tableName','/smartapi/custom/getUserCustomSql?id=','toString','\x22\x20not\x20found\x20in\x20dataset\x20','scriptType','message','/smartapi/question/er-config/business-group/edit','6SoRGqb','length','/smartapi/question/er-config','key','/smartapi/question/er-config/erCreate','name','.remove(id);','/api/management/library/scripts/statistics?appCode=','\x20\x20return\x20rows;','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','clientOperationId','/smartapi/lovrabet/detail?pageId=','906430AYoPTB','application/json','Request\x20failed:\x20','/smartapi/lovrabet/update-page','string','const\x20result\x20=\x20await\x20client.models.','Page\x20not\x20found:\x20','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','type','cli:rabetbase','401','/smartapi/db-analysis/status/','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','.create({\x20/*\x20fields\x20*/\x20});','?sqlCode=','89640ilXXCO','includes','method','scriptName','/api/management/library/scripts/save','//\x20SQL:\x20','/smartapi/app/getList','label','SQL\x20query\x20not\x20found:\x20','/smartapi/custom/updateUserCustomSql','Check\x20network\x20connectivity\x20and\x20try\x20again.','\x20\x20\x20\x20sqlCode:\x20\x27','/smartapi/app-config/create','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','deleted','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','create','requirementDescription','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','errorCode','set','getOne','/api/management/library/scripts/delete','Unauthorized','const\x20results\x20=\x20data.execResult\x20||\x20[];','filter','/api/management/library/scripts/info?id=','\x20\x20currentPage:\x201,','find','/standard-page-status?appCode=','enabled','921ZmCuKn','/smartapi/dblink/update','responseFields','/smartapi/custom/saveUserCustomSql','9bCHAte','body','includeImports','entries','dbtableConfig','errorMsg','/smartapi/dblink/create','errorMessage','sqlName','currentPage','/smartapi/db-analysis/jobs/cancel','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','});','code','/smartapi/dataset/text-generate/status?','/smartapi/custom/queryUserCustomSqlList','description','1529LAdTww','add','POST','/smartapi/app-config/update','/smartapi/question/er-config/erDelete','delete','/api/management/script/cache/clear','/generate-standard-pages/start','/smartapi/dblink/getOne','cookie','/smartapi/custom/deleteUserCustomSql','remove','list','pageSize','totalCount','/smartapi/lovrabet/dataset/','planId','/smartapi/dblink/getAllTableList','/smartapi/app-config/delete','success','/sync-to-pages','value','AbortError','5838413DDhOMM','functionName','validation','operationId','sdk','operations','2188knFefG','modelCode','data','/api/management/library/scripts/list?appCode=','appCode','tableData','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','/api/node-toolbox/sql/save','stringify','/api/','/smartapi/dataset/update-driven-data','/smartapi/dblink/testConnect','update','GET','/smartapi/dblink/delete','has','tags','push','map','isArray','object','/smartapi/dblink/getTableDiffV2ByPage','Dataset\x20not\x20found:\x20','UNAUTHORIZED','operationName','(/*\x20params\x20*/);','summary','api_error','667114YYUYhH','table','displayName','/smartapi/dataset/text-generate/preview','/smartapi/dblink/getList'];a158_0x47d1=function(){return _0x3292dd;};return a158_0x47d1();}(function(_0x117cd5,_0x2f9b76){const _0x330756=a158_0x2ac6,_0x53435a=_0x117cd5();while(!![]){try{const _0xe079a4=parseInt(_0x330756(0x190))/0x1+-parseInt(_0x330756(0x1c7))/0x2+-parseInt(_0x330756(0x1f6))/0x3*(-parseInt(_0x330756(0x174))/0x4)+parseInt(_0x330756(0x1a9))/0x5+parseInt(_0x330756(0x1bb))/0x6*(-parseInt(_0x330756(0x16e))/0x7)+parseInt(_0x330756(0x19a))/0x8*(-parseInt(_0x330756(0x1fa))/0x9)+parseInt(_0x330756(0x1d7))/0xa*(parseInt(_0x330756(0x20b))/0xb);if(_0xe079a4===_0x2f9b76)break;else _0x53435a['push'](_0x53435a['shift']());}catch(_0x5b74dd){_0x53435a['push'](_0x53435a['shift']());}}}(a158_0x47d1,0x7e220));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0x86fe01){_activeCookie=_0x86fe01||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(_0x1413bc,_0x41b3cd){const _0x2241a4=a158_0x2ac6,_0x232012=_0x41b3cd instanceof Error?_0x41b3cd[_0x2241a4(0x1b9)]:String(_0x41b3cd);return CliErrors['apiError'](_0x2241a4(0x1c9)+_0x1413bc+(_0x232012?'\x20('+_0x232012+')':''),_0x2241a4(0x1e1));}async function apiRequest(_0x3f4ad2,_0xa8bbd5={}){const _0x3e2089=a158_0x2ac6,{method:method=_0x3e2089(0x181),body:_0x3cfe58,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0xa8bbd5,_0x1f5fd9=useRuntime?getRuntimeDomain():getApiDomain(),_0xfe3427=_activeCookie||getCookie(),_0x11aee4=''+_0x1f5fd9+_0x3f4ad2,_0x169ca5=new AbortController(),_0x1b808d=setTimeout(()=>_0x169ca5['abort'](),timeout);try{const _0x6b996c=await fetch(_0x11aee4,{'method':method,'headers':{'Content-Type':_0x3e2089(0x1c8),'Cookie':_0xfe3427,'X-Invoke-Source':_0x3e2089(0x1d0),...headers},'body':_0x3cfe58?JSON[_0x3e2089(0x17c)](_0x3cfe58):undefined,'signal':_0x169ca5[_0x3e2089(0x198)]});let _0x52fbc5;try{_0x52fbc5=await _0x6b996c[_0x3e2089(0x195)]();}catch(_0x2df941){if(_0x2df941 instanceof Error&&_0x2df941[_0x3e2089(0x1c0)]===_0x3e2089(0x16d))throw CliErrors['apiError'](_0x3e2089(0x1a6)+_0x11aee4);if(_0x6b996c['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x3e2089(0x199)](_0x3e2089(0x1ce)+_0x6b996c[_0x3e2089(0x19b)]+')',_0x6b996c['status']>=0x190?_0x3e2089(0x1d3):undefined);}if(!_0x6b996c['ok']||_0x52fbc5[_0x3e2089(0x16a)]===![])throw CliErrors[_0x3e2089(0x199)](_0x52fbc5[_0x3e2089(0x1ff)]||_0x52fbc5['message']||'API\x20error:\x20'+_0x6b996c[_0x3e2089(0x19b)],_0x52fbc5[_0x3e2089(0x1ea)]?'API\x20error\x20code:\x20'+_0x52fbc5[_0x3e2089(0x1ea)]:undefined);return _0x52fbc5;}catch(_0x572dcb){if(_0x572dcb instanceof CliError)throw _0x572dcb;if(_0x572dcb instanceof Error&&_0x572dcb[_0x3e2089(0x1c0)]===_0x3e2089(0x16d))throw CliErrors['apiError'](_0x3e2089(0x1a6)+_0x11aee4);throw createFetchFailureError(_0x11aee4,_0x572dcb);}finally{clearTimeout(_0x1b808d);}}function isAuthFailure(_0x34d580){const _0x3542e6=a158_0x2ac6,_0x389640=_0x34d580[_0x3542e6(0x1ff)]||_0x34d580[_0x3542e6(0x1b9)]||_0x34d580['data']?.[_0x3542e6(0x1b9)]||_0x34d580[_0x3542e6(0x201)]||_0x34d580['error']||'';return _0x34d580['errorCode']===_0x3542e6(0x18b)||_0x34d580[_0x3542e6(0x207)]===0x191||_0x34d580[_0x3542e6(0x207)]==='401'||_0x389640[_0x3542e6(0x1d8)](_0x3542e6(0x1d1))||_0x389640[_0x3542e6(0x1d8)](_0x3542e6(0x1ee))||_0x389640['includes']('登录')||_0x389640[_0x3542e6(0x1d8)]('认证');}export async function platformFetch(_0x5eb400,_0xb53f43){const _0x190c7c=a158_0x2ac6;let _0x52a775;try{_0x52a775=await fetch(_0x5eb400,{'method':_0xb53f43[_0x190c7c(0x1d9)]??_0x190c7c(0x181),'headers':{'Content-Type':_0x190c7c(0x1c8),'Cookie':_0xb53f43[_0x190c7c(0x160)],'X-Invoke-Source':'cli:rabetbase'},..._0xb53f43[_0x190c7c(0x1fb)]&&{'body':JSON[_0x190c7c(0x17c)](_0xb53f43[_0x190c7c(0x1fb)])}});}catch(_0x182785){throw createFetchFailureError(_0x5eb400,_0x182785);}if(!_0x52a775['ok']){if(_0x52a775['status']===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x190c7c(0x199)](_0xb53f43[_0x190c7c(0x1de)]+_0x190c7c(0x1ae)+_0x52a775[_0x190c7c(0x19b)]);}const _0x384265=await _0x52a775[_0x190c7c(0x195)]();if(_0x384265[_0x190c7c(0x16a)]===![]){if(isAuthFailure(_0x384265))throw CliErrors[_0x190c7c(0x1a0)]();throw CliErrors[_0x190c7c(0x199)](_0x384265[_0x190c7c(0x1ff)]||_0x384265[_0x190c7c(0x1b9)]||_0xb53f43['label']+'\x20failed');}return _0x384265[_0x190c7c(0x176)];}export async function listBffScripts(_0x110b3d,_0x1b1e6a,_0x43607d){const _0x20b759=a158_0x2ac6;let _0x44e33b=_0x20b759(0x177)+_0x110b3d;if(_0x1b1e6a)_0x44e33b+='&type='+_0x1b1e6a;const _0x38895d=await apiRequest(_0x44e33b);let _0x100c6e=extractList(_0x38895d[_0x20b759(0x176)]);if(_0x43607d?.[_0x20b759(0x1da)]){const _0x3e84b4=_0x43607d[_0x20b759(0x1da)][_0x20b759(0x19d)]();_0x100c6e=_0x100c6e['filter'](_0xfdc501=>_0xfdc501[_0x20b759(0x16f)]?.[_0x20b759(0x19d)]()[_0x20b759(0x1d8)](_0x3e84b4)||_0xfdc501[_0x20b759(0x20a)]?.[_0x20b759(0x19d)]()[_0x20b759(0x1d8)](_0x3e84b4));}return _0x100c6e;}export async function getBffScriptInfo(_0x3bebc0){const _0x2244b4=a158_0x2ac6,_0x5f47c2=await apiRequest(_0x2244b4(0x1f1)+_0x3bebc0);if(!_0x5f47c2[_0x2244b4(0x176)])throw CliErrors[_0x2244b4(0x170)]('BFF\x20script\x20not\x20found:\x20id='+_0x3bebc0);return _0x5f47c2[_0x2244b4(0x176)];}export async function saveBffScript(_0x5f1639){const _0x3f96fc=a158_0x2ac6,_0x17b28a=await apiRequest(_0x3f96fc(0x1db),{'method':'POST','body':_0x5f1639}),{id:_0x43aa73,entity:_0x37b686}=normalizeEntityWithIdResponse(_0x17b28a['data']);if(_0x43aa73!==undefined){const _0x4e6d69=typeof _0x37b686[_0x3f96fc(0x16f)]===_0x3f96fc(0x1cb)||typeof _0x37b686[_0x3f96fc(0x1b8)]===_0x3f96fc(0x1cb)?_0x37b686:undefined;return{'id':_0x43aa73,'script':_0x4e6d69};}throw CliErrors[_0x3f96fc(0x199)](_0x3f96fc(0x1a2));}export async function deleteBffScript(_0x444aed){const _0x2200ff=a158_0x2ac6;await apiRequest(_0x2200ff(0x1ed),{'method':_0x2200ff(0x20d),'body':{'id':_0x444aed}});}export async function getBffScriptStatistics(_0x1b49d3){const _0x503886=a158_0x2ac6,_0x4e583a=await apiRequest(_0x503886(0x1c2)+_0x1b49d3);return extractList(_0x4e583a['data']);}export async function clearBffScriptCache(){const _0x43d948=a158_0x2ac6,_0x5c2f07=await apiRequest(_0x43d948(0x15d),{'method':_0x43d948(0x20d),'useRuntime':!![]});return typeof _0x5c2f07['data']===_0x43d948(0x1cb)?_0x5c2f07[_0x43d948(0x176)]:'';}export async function listBffDatasetOperations(_0x9f1544,_0xfbfb){const _0x4a4584=a158_0x2ac6,_0x5b6af3=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x4a4584(0x20d),'body':{'appCode':_0x9f1544,'datasetId':_0xfbfb}});return _0x5b6af3['data'];}export async function listSqlQueries(_0x404fb6,_0xaf02c8){const _0x5bc871=a158_0x2ac6,_0x15126e=await apiRequest(_0x5bc871(0x209),{'method':_0x5bc871(0x20d),'body':{'appCode':_0x404fb6,'currentPage':_0xaf02c8?.[_0x5bc871(0x203)]??0x1,'pageSize':_0xaf02c8?.[_0x5bc871(0x164)]??0x32,'sqlCode':_0xaf02c8?.[_0x5bc871(0x196)],'sqlName':_0xaf02c8?.['sqlName']}});return _0x15126e[_0x5bc871(0x176)];}export async function getSqlQueryInfo(_0x436588,_0x2f77e6){const _0x8a880d=await listSqlQueries(_0x436588,{'sqlCode':_0x2f77e6}),_0x5be467=_0x8a880d['tableData']?.[0x0];if(!_0x5be467)throw CliErrors['validation']('SQL\x20query\x20not\x20found:\x20'+_0x2f77e6);return _0x5be467;}export async function getSqlQueryDetail(_0x1cce45){const _0x217953=a158_0x2ac6,_0x5811ac=await apiRequest(_0x217953(0x1ab)+(_0x217953(0x1d6)+encodeURIComponent(_0x1cce45)));if(!_0x5811ac['data'])throw CliErrors['validation'](_0x217953(0x1df)+_0x1cce45);return _0x5811ac['data'];}export async function getSqlQueryDetailById(_0x32a3f3){const _0x142c21=a158_0x2ac6,_0x9444ab=await apiRequest(_0x142c21(0x1b5)+_0x32a3f3);if(!_0x9444ab['data'])throw CliErrors['validation']('SQL\x20query\x20not\x20found:\x20id='+_0x32a3f3);return _0x9444ab['data'];}export async function createSqlQuery(_0x5e2f29){const _0x402159=a158_0x2ac6,_0x17a71c=await apiRequest(_0x402159(0x1f9),{'method':_0x402159(0x20d),'body':_0x5e2f29}),{id:_0x2e2961,entity:_0x3c2b3e}=normalizeEntityWithIdResponse(_0x17a71c[_0x402159(0x176)]);if(!('sqlCode'in _0x3c2b3e)&&_0x2e2961)return getSqlQueryDetailById(_0x2e2961);return normalizeSqlQueryEntity(_0x3c2b3e);}export async function updateSqlQuery(_0x2467bd){const _0x4da778=a158_0x2ac6,_0x531ce8=await apiRequest(_0x4da778(0x1e0),{'method':'POST','body':_0x2467bd}),{id:_0x42d4a1,entity:_0xd4dc2e}=normalizeEntityWithIdResponse(_0x531ce8[_0x4da778(0x176)]);if(!(_0x4da778(0x196)in _0xd4dc2e)){if(_0x2467bd[_0x4da778(0x196)])return getSqlQueryDetail(_0x2467bd[_0x4da778(0x196)]);if(_0x42d4a1)return getSqlQueryDetailById(_0x42d4a1);}return normalizeSqlQueryEntity(_0xd4dc2e);}export async function deleteSqlQuery(_0x5206cb){const _0xb76106=a158_0x2ac6;await apiRequest(_0xb76106(0x161),{'method':_0xb76106(0x20d),'body':_0x5206cb});}export async function saveSqlQuery(_0x4bdad5){const _0x2c974b=a158_0x2ac6,_0x418ad5=await apiRequest(_0x2c974b(0x17b),{'method':'POST','body':_0x4bdad5});return _0x418ad5['data'];}function normalizeSqlQueryEntity(_0x5c9aec){const _0x3e0b27=a158_0x2ac6;return{..._0x5c9aec,'id':Number(_0x5c9aec['id']),'dbId':_0x5c9aec['dbId']==null?undefined:Number(_0x5c9aec['dbId']),'version':_0x5c9aec['version']==null?undefined:Number(_0x5c9aec[_0x3e0b27(0x1b1)])};}export async function executeSql(_0x5d5a33,_0x114d01,_0xe08f2c){const _0x410cdc=a158_0x2ac6,_0x32fb0c=await apiRequest(_0x410cdc(0x1a7),{'method':'POST','body':{'appCode':_0x5d5a33,'sqlCode':_0x114d01,..._0xe08f2c&&{'params':_0xe08f2c}},'useRuntime':!![]});return _0x32fb0c[_0x410cdc(0x176)];}export async function executeDatasetDataOperation(_0x1a0f74,_0x5ce6e6,_0x6cd2ce,_0x5264ca={}){const _0x336fd8=a158_0x2ac6;try{const _0x585639=await apiRequest(_0x336fd8(0x17d)+_0x1a0f74+'/'+_0x5ce6e6+'/'+_0x6cd2ce,{'method':_0x336fd8(0x20d),'body':_0x5264ca,'useRuntime':!![]});return _0x585639[_0x336fd8(0x176)];}catch(_0x3ba6f0){if(_0x6cd2ce===_0x336fd8(0x1ec)&&_0x3ba6f0 instanceof CliError&&_0x3ba6f0[_0x336fd8(0x207)]===_0x336fd8(0x18f)&&_0x5264ca['id']!==undefined&&_0x5264ca['id']!==null&&_0x5264ca['id']!==''){const _0x1528f2=await apiRequest(_0x336fd8(0x17d)+_0x1a0f74+'/'+_0x5ce6e6+_0x336fd8(0x1a8),{'method':'POST','body':{'where':{'id':{'$eq':_0x5264ca['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x10cd2c=Array[_0x336fd8(0x187)](_0x1528f2[_0x336fd8(0x176)]?.[_0x336fd8(0x179)])?_0x1528f2[_0x336fd8(0x176)][_0x336fd8(0x179)]:[];return _0x10cd2c[0x0]??null;}throw _0x3ba6f0;}}export async function listDatasets(_0x55cafc,_0x402bdb){const _0xa71644=a158_0x2ac6,_0x2b234c={'appCode':_0x55cafc,'deleted':_0x402bdb?.[_0xa71644(0x1e5)]??![]};if(_0x402bdb?.[_0xa71644(0x207)])_0x2b234c[_0xa71644(0x207)]=_0x402bdb[_0xa71644(0x207)];if(_0x402bdb?.[_0xa71644(0x1c0)])_0x2b234c[_0xa71644(0x1c0)]=_0x402bdb['name'];const _0x15348b=await apiRequest(_0xa71644(0x1b0),{'method':_0xa71644(0x20d),'body':_0x2b234c});return extractList(_0x15348b[_0xa71644(0x176)]);}export async function deleteDataset(_0x201375,_0x4ba44c){await apiRequest('/smartapi/dataset/delete-dataset',{'method':'POST','body':{'appCode':_0x201375,'datasetId':_0x4ba44c}});}export async function restoreDataset(_0x5e2336,_0x5e6279){const _0x8123ad=a158_0x2ac6;await apiRequest(_0x8123ad(0x1b2),{'method':_0x8123ad(0x20d),'body':{'appCode':_0x5e2336,'datasetId':_0x5e6279}});}export async function previewTextGeneratedDataset(_0x1ccbf2,_0x3b79ff){const _0x13a95e=a158_0x2ac6,_0x47f7fb=await apiRequest(_0x13a95e(0x193),{'method':_0x13a95e(0x20d),'body':{'appCode':_0x1ccbf2,'datasetName':_0x3b79ff[_0x13a95e(0x19c)],'requirementDescription':_0x3b79ff[_0x13a95e(0x1e8)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x47f7fb['data'];}export async function startTextGeneratedDataset(_0x21f3aa,_0x3afda3,_0x4621aa){const _0x1c05bb=a158_0x2ac6,_0x5e8fb2=await apiRequest('/smartapi/dataset/text-generate/start',{'method':_0x1c05bb(0x20d),'body':{'appCode':_0x21f3aa,..._0x4621aa?.['clientOperationId']?{'clientOperationId':_0x4621aa[_0x1c05bb(0x1c5)]}:{},'design':_0x3afda3},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5e8fb2[_0x1c05bb(0x176)];}export async function getTextGeneratedDatasetStatus(_0x2f9b07,_0x5942b4){const _0x43151d=a158_0x2ac6,_0x1d680e=new URLSearchParams({'appCode':_0x2f9b07});_0x5942b4[_0x43151d(0x171)]&&_0x1d680e[_0x43151d(0x1eb)](_0x43151d(0x171),_0x5942b4[_0x43151d(0x171)]);_0x5942b4[_0x43151d(0x1c5)]&&_0x1d680e[_0x43151d(0x1eb)](_0x43151d(0x1c5),_0x5942b4['clientOperationId']);const _0x32915e=await apiRequest(_0x43151d(0x208)+_0x1d680e[_0x43151d(0x1b6)]());return _0x32915e[_0x43151d(0x176)];}export async function searchDatasets(_0x4e8305,_0x399334){const _0x45a2b5=a158_0x2ac6,_0xe648c=await listDatasets(_0x4e8305,{'name':_0x399334}),_0x115b4e=_0x399334[_0x45a2b5(0x19d)](),_0x2d7990=new Set(_0xe648c[_0x45a2b5(0x186)](_0x3ce7aa=>_0x3ce7aa['id'])),_0x1c2831=_0xe648c[_0x45a2b5(0x1f0)](_0x5da7a2=>_0x5da7a2['dbtableConfig']?.['tableName']?.[_0x45a2b5(0x19d)]()[_0x45a2b5(0x1d8)](_0x115b4e)||_0x5da7a2['description']?.[_0x45a2b5(0x19d)]()[_0x45a2b5(0x1d8)](_0x115b4e)),_0x275159=await listDatasets(_0x4e8305,{'code':_0x399334});for(const _0x436b53 of _0x275159){!_0x2d7990[_0x45a2b5(0x183)](_0x436b53['id'])&&(_0xe648c[_0x45a2b5(0x185)](_0x436b53),_0x2d7990[_0x45a2b5(0x20c)](_0x436b53['id']));}return _0xe648c;}export function normalizeDatasetOperations(_0x3748e6){const _0x5c266f=a158_0x2ac6;if(Array[_0x5c266f(0x187)](_0x3748e6))return _0x3748e6[_0x5c266f(0x1f0)](_0x55bbe1=>_0x55bbe1!=null&&typeof _0x55bbe1===_0x5c266f(0x188));if(_0x3748e6&&typeof _0x3748e6===_0x5c266f(0x188))return Object[_0x5c266f(0x1fd)](_0x3748e6)['filter'](([,_0x572ab5])=>_0x572ab5!=null&&typeof _0x572ab5===_0x5c266f(0x188))[_0x5c266f(0x186)](([_0x284ab3,_0x1df8d6])=>({..._0x1df8d6,'name':_0x1df8d6[_0x5c266f(0x1c0)]??_0x1df8d6[_0x5c266f(0x18c)]??_0x284ab3}));return[];}export async function getDatasetDetail(_0xc19e4c){const _0xf1d975=/^\d+$/['test'](_0xc19e4c)?'id':'code',_0x4d5f18=await apiRequest('/smartapi/dataset/get-driven-data?'+_0xf1d975+'='+_0xc19e4c);return _0x4d5f18['data'];}export async function updateDrivenData(_0xc01d38){const _0x2a5620=a158_0x2ac6,_0xa975c1=await apiRequest(_0x2a5620(0x17e),{'method':_0x2a5620(0x20d),'body':_0xc01d38});return _0xa975c1[_0x2a5620(0x176)];}export async function getDatasetOperations(_0x43e356){const _0xf4b705=a158_0x2ac6,_0x8bd226=await getDatasetDetail(_0x43e356),_0x160aa7=normalizeDatasetOperations(_0x8bd226['operations'])[_0xf4b705(0x186)](_0x134bd6=>({'name':_0x134bd6[_0xf4b705(0x1c0)]||_0x134bd6[_0xf4b705(0x18c)],'displayName':_0x134bd6[_0xf4b705(0x192)]||_0x134bd6[_0xf4b705(0x1c0)],'type':_0x134bd6[_0xf4b705(0x1cf)],'method':_0x134bd6['method'],'path':_0x134bd6['path'],'enabled':_0x134bd6[_0xf4b705(0x1f5)]??!![],'requestFields':_0x134bd6['requestFields'],'responseFields':_0x134bd6[_0xf4b705(0x1f8)]}));return{'dataset':{'id':_0x8bd226['id']??_0x8bd226[_0xf4b705(0x1a4)],'name':_0x8bd226[_0xf4b705(0x1c0)],'code':_0x8bd226[_0xf4b705(0x207)]||_0x8bd226[_0xf4b705(0x175)],'tableName':_0x8bd226[_0xf4b705(0x1b4)]||_0x8bd226[_0xf4b705(0x1fe)]?.['tableName']},'operations':_0x160aa7};}export async function getOperationDetail(_0xcbf196,_0x58f441,_0x52f855){const _0x34512a=a158_0x2ac6;let _0x47a78f=_0x58f441;if(!/^\d+$/['test'](_0x58f441)){const _0x4ba719=await listDatasets(_0xcbf196,{'code':_0x58f441}),_0x21a3ac=_0x4ba719[_0x34512a(0x1f3)](_0x4887bd=>_0x4887bd[_0x34512a(0x207)]===_0x58f441||String(_0x4887bd['id'])===_0x58f441);if(!_0x21a3ac)throw CliErrors[_0x34512a(0x170)](_0x34512a(0x18a)+_0x58f441);_0x47a78f=String(_0x21a3ac['id']);}const _0x352fd4=await getDatasetDetail(_0x47a78f),_0x3be59a=normalizeDatasetOperations(_0x352fd4[_0x34512a(0x173)])[_0x34512a(0x1f3)](_0x420bb7=>(_0x420bb7[_0x34512a(0x1c0)]||_0x420bb7[_0x34512a(0x18c)])===_0x52f855);if(!_0x3be59a)throw CliErrors[_0x34512a(0x170)]('Operation\x20\x22'+_0x52f855+_0x34512a(0x1b7)+_0x58f441);return{'dataset':{'id':_0x352fd4['id']??_0x352fd4[_0x34512a(0x1a4)],'name':_0x352fd4[_0x34512a(0x1c0)],'code':_0x352fd4['code']||_0x352fd4[_0x34512a(0x175)],'tableName':_0x352fd4[_0x34512a(0x1b4)]||_0x352fd4['dbtableConfig']?.[_0x34512a(0x1b4)]},'operation':_0x3be59a};}export async function startGenerateStandardPages(_0x206987,_0xd38cc5,_0x5c035f){const _0x1c2e69=a158_0x2ac6,_0x4c5c3b=await apiRequest('/smartapi/lovrabet/dataset/'+_0xd38cc5+_0x1c2e69(0x15e),{'method':_0x1c2e69(0x20d),'body':{'appCode':_0x206987,..._0x5c035f?.[_0x1c2e69(0x1c5)]?{'clientOperationId':_0x5c035f[_0x1c2e69(0x1c5)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x4c5c3b[_0x1c2e69(0x176)];}export async function getGenerateStandardPagesStatus(_0x46d703,_0x3d7dcc,_0x519ccc){const _0x5b3ce0=a158_0x2ac6,_0x1fdccb=new URLSearchParams({'appCode':_0x46d703});_0x519ccc['operationId']&&_0x1fdccb[_0x5b3ce0(0x1eb)](_0x5b3ce0(0x171),_0x519ccc[_0x5b3ce0(0x171)]);_0x519ccc[_0x5b3ce0(0x1c5)]&&_0x1fdccb[_0x5b3ce0(0x1eb)](_0x5b3ce0(0x1c5),_0x519ccc[_0x5b3ce0(0x1c5)]);const _0x4af11a=await apiRequest(_0x5b3ce0(0x166)+_0x3d7dcc+'/generate-standard-pages/status?'+_0x1fdccb['toString']());return _0x4af11a[_0x5b3ce0(0x176)];}export async function getStandardPageStatus(_0x24b9c6,_0x5b31dc){const _0x15c71d=a158_0x2ac6,_0x5cbd63=await apiRequest(_0x15c71d(0x166)+_0x5b31dc+_0x15c71d(0x1f4)+encodeURIComponent(_0x24b9c6));return _0x5cbd63['data'];}export async function tryGetStandardPageStatus(_0x2f221d,_0x476d19){const _0x1777e8=a158_0x2ac6;try{return await getStandardPageStatus(_0x2f221d,_0x476d19);}catch(_0x22b948){if(_0x22b948 instanceof CliError&&_0x22b948['code']===_0x1777e8(0x18f)&&/404|not found|non-json response/i['test'](_0x22b948[_0x1777e8(0x1b9)]))return null;throw _0x22b948;}}export async function syncStandardPages(_0xa79eaa,_0x246d80){const _0x2ed160=a158_0x2ac6,_0x4fb293=await apiRequest('/smartapi/lovrabet/dataset/'+_0x246d80+_0x2ed160(0x16b),{'method':_0x2ed160(0x20d),'body':{'appCode':_0xa79eaa}});return _0x4fb293['data'];}export async function getPageDetail(_0x1c24e2){const _0x56ba70=a158_0x2ac6,_0x43dfb1=await apiRequest(_0x56ba70(0x1c6)+_0x1c24e2);if(!_0x43dfb1[_0x56ba70(0x176)])throw CliErrors[_0x56ba70(0x170)](_0x56ba70(0x1cd)+_0x1c24e2);return _0x43dfb1['data'];}export async function updatePage(_0x17e0bc,_0x162f4a,_0x19ebcd,_0x1da360){const _0xe258cd=a158_0x2ac6,_0x54524e=await apiRequest(_0xe258cd(0x1ca),{'method':_0xe258cd(0x20d),'body':{'appCode':_0x17e0bc,'pageId':_0x162f4a,'code':_0x19ebcd,'datasetIds':_0x1da360}});return _0x54524e['data'];}export function generateSdkCode(_0x30606b,_0x52bc4c,_0x1ba917){const _0x1a9ef3=a158_0x2ac6,_0x9eeb55=_0x1ba917?.[_0x1a9ef3(0x1fc)]??!![],_0x1c8d41='dataset_'+_0x30606b['code']?.[_0x1a9ef3(0x19e)](/-/g,'_'),_0x1c13b0=_0x52bc4c[_0x1a9ef3(0x1c0)]||_0x52bc4c['operationName']||_0x1a9ef3(0x1f0),_0x465e6c=[];_0x9eeb55&&_0x465e6c['push']('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x1a9ef3(0x1e4),'');_0x465e6c['push']('//\x20'+_0x30606b['name']+'\x20('+(_0x30606b[_0x1a9ef3(0x1b4)]||_0x1a9ef3(0x191))+')');if(_0x1c13b0===_0x1a9ef3(0x1f0))_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+'.filter({','\x20\x20where:\x20{},','\x20\x20pageSize:\x2020,',_0x1a9ef3(0x1f2),_0x1a9ef3(0x206));else{if(_0x1c13b0===_0x1a9ef3(0x1ec))_0x465e6c[_0x1a9ef3(0x185)]('const\x20result\x20=\x20await\x20client.models.'+_0x1c8d41+'.getOne(id);');else{if(_0x1c13b0===_0x1a9ef3(0x1e7))_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+_0x1a9ef3(0x1d5));else{if(_0x1c13b0===_0x1a9ef3(0x180))_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+_0x1a9ef3(0x17a));else _0x1c13b0===_0x1a9ef3(0x15c)||_0x1c13b0===_0x1a9ef3(0x162)?_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+_0x1a9ef3(0x1c1)):_0x465e6c[_0x1a9ef3(0x185)](_0x1a9ef3(0x1cc)+_0x1c8d41+'.'+_0x1c13b0+_0x1a9ef3(0x18d));}}}return _0x465e6c[_0x1a9ef3(0x197)]('\x0a');}export function generateSqlCodeTemplate(_0x1ab6b8,_0x58fc89){const _0x319b52=a158_0x2ac6,_0x8e224a=_0x58fc89?.[_0x319b52(0x1a1)]??_0x319b52(0x172),_0x5578f4=_0x58fc89?.[_0x319b52(0x1fc)]??!![],_0x279d67=[];return _0x279d67[_0x319b52(0x185)](_0x319b52(0x1dc)+_0x1ab6b8[_0x319b52(0x202)]+'\x20('+_0x1ab6b8[_0x319b52(0x196)]+')'),_0x8e224a===_0x319b52(0x172)?(_0x5578f4&&_0x279d67[_0x319b52(0x185)](_0x319b52(0x1d4),'',_0x319b52(0x1e4),''),_0x279d67[_0x319b52(0x185)](_0x319b52(0x19f),_0x319b52(0x1ac)+_0x1ab6b8[_0x319b52(0x196)]+'\x27,',_0x319b52(0x1e9),_0x319b52(0x206),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x319b52(0x1ef))):_0x279d67[_0x319b52(0x185)](_0x319b52(0x205),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x319b52(0x1e2)+_0x1ab6b8[_0x319b52(0x196)]+'\x27,',_0x319b52(0x1e6),_0x319b52(0x1ad),_0x319b52(0x1c3),'}'),_0x279d67[_0x319b52(0x197)]('\x0a');}export async function getErConfig(_0x2fb5f1,_0xf868d8){const _0x5571ba=a158_0x2ac6,_0x436eee=await apiRequest(_0x5571ba(0x1bd),{'method':_0x5571ba(0x20d),'body':{'appCode':_0x2fb5f1,'dblinkId':_0xf868d8},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x436eee[_0x5571ba(0x176)];}export async function createErRelation(_0x319523){const _0x794912=a158_0x2ac6,_0x15f434=await apiRequest(_0x794912(0x1bf),{'method':_0x794912(0x20d),'body':_0x319523,'allowNonJsonSuccess':!![]});return _0x15f434[_0x794912(0x176)];}function a158_0x2ac6(_0x11a3c1,_0x3aa6b4){_0x11a3c1=_0x11a3c1-0x15c;const _0x47d1b4=a158_0x47d1();let _0x2ac6dd=_0x47d1b4[_0x11a3c1];return _0x2ac6dd;}export async function updateErRelation(_0x386ccd){const _0x26adbc=a158_0x2ac6,_0x349f2f=await apiRequest(_0x26adbc(0x1a5),{'method':_0x26adbc(0x20d),'body':_0x386ccd,'allowNonJsonSuccess':!![]});return _0x349f2f[_0x26adbc(0x176)];}export async function deleteErRelation(_0x4d22d3){const _0x1b911a=a158_0x2ac6,_0x4cb744=await apiRequest(_0x1b911a(0x20f),{'method':_0x1b911a(0x20d),'body':_0x4d22d3,'allowNonJsonSuccess':!![]});return _0x4cb744[_0x1b911a(0x176)];}export async function updateErBusinessGroup(_0x269ee7){const _0x1e8fde=a158_0x2ac6,_0x5e73d0=await apiRequest(_0x1e8fde(0x1ba),{'method':_0x1e8fde(0x20d),'body':_0x269ee7,'allowNonJsonSuccess':!![]});return _0x5e73d0[_0x1e8fde(0x176)];}function buildQuery(_0x4a76d8){const _0xc6f23c=a158_0x2ac6,_0x2bb9ad=new URLSearchParams();for(const [_0x23e4b7,_0x1f4730]of Object['entries'](_0x4a76d8)){if(_0x1f4730===undefined||_0x1f4730==='')continue;_0x2bb9ad['set'](_0x23e4b7,String(_0x1f4730));}const _0x49992a=_0x2bb9ad[_0xc6f23c(0x1b6)]();return _0x49992a?'?'+_0x49992a:'';}export async function listAppConfigs(_0x44857f,_0x4708c3){const _0x18a370=a158_0x2ac6,_0x181202=await apiRequest(_0x18a370(0x1af),{'method':'POST','body':{'appCode':_0x44857f,..._0x4708c3?.[_0x18a370(0x1be)]?{'key':_0x4708c3[_0x18a370(0x1be)]}:{},..._0x4708c3?.[_0x18a370(0x184)]?{'tags':_0x4708c3[_0x18a370(0x184)]}:{}}});return extractAppConfigList(_0x181202[_0x18a370(0x176)]);}export async function getAppConfigByKey(_0x2b2c2b,_0x47f279){const _0x155501=a158_0x2ac6,_0x263d96=await apiRequest(_0x155501(0x1b3)+buildQuery({'appCode':_0x2b2c2b,'key':_0x47f279}));return _0x263d96[_0x155501(0x176)]??null;}export async function createAppConfig(_0x45261f){const _0x283ceb=a158_0x2ac6,_0x5eac3b=await apiRequest(_0x283ceb(0x1e3),{'method':'POST','body':{'appCode':_0x45261f[_0x283ceb(0x178)],'key':_0x45261f[_0x283ceb(0x1be)],'value':_0x45261f[_0x283ceb(0x16c)],..._0x45261f['tags']?{'tags':_0x45261f[_0x283ceb(0x184)]}:{}}});return _0x5eac3b['data'];}export async function updateAppConfig(_0x50ca4c){const _0x320bd0=a158_0x2ac6;await apiRequest(_0x320bd0(0x20e),{'method':_0x320bd0(0x20d),'body':{'id':_0x50ca4c['id'],'appCode':_0x50ca4c[_0x320bd0(0x178)],'key':_0x50ca4c[_0x320bd0(0x1be)],'value':_0x50ca4c[_0x320bd0(0x16c)],..._0x50ca4c[_0x320bd0(0x184)]?{'tags':_0x50ca4c[_0x320bd0(0x184)]}:{}}});}export async function deleteAppConfig(_0x229330){const _0x4ef98d=a158_0x2ac6;await apiRequest(_0x4ef98d(0x169),{'method':_0x4ef98d(0x20d),'body':_0x229330});}function extractAppConfigList(_0x45d6a1){const _0x1c466b=a158_0x2ac6;if(Array[_0x1c466b(0x187)](_0x45d6a1))return _0x45d6a1;if(_0x45d6a1&&typeof _0x45d6a1==='object'&&Array[_0x1c466b(0x187)](_0x45d6a1['list']))return _0x45d6a1[_0x1c466b(0x163)];return extractList(_0x45d6a1);}export async function listDbLinks(_0x421c0c,_0x1e24ac){const _0x243f70=a158_0x2ac6,_0x5da423=await apiRequest(_0x243f70(0x194),{'method':_0x243f70(0x20d),'body':{'appCode':_0x421c0c,'currentPage':_0x1e24ac?.[_0x243f70(0x203)]??0x1,'pageSize':_0x1e24ac?.[_0x243f70(0x164)]??0x64}});return{'items':extractList(_0x5da423[_0x243f70(0x176)]),'paging':extractPaging(_0x5da423['data'])};}export async function getDbLinkInfo(_0x2e50ee){const _0x241899=a158_0x2ac6,_0x4e892a=await apiRequest(_0x241899(0x15f)+buildQuery({'id':_0x2e50ee}));return _0x4e892a['data'];}export async function createDbLink(_0x306418){const _0x28d1e4=a158_0x2ac6,_0x2bb899=await apiRequest(_0x28d1e4(0x200),{'method':_0x28d1e4(0x20d),'body':_0x306418});return _0x2bb899[_0x28d1e4(0x176)];}export async function updateDbLink(_0x5cf36d){const _0x5b8a84=a158_0x2ac6,_0x5e70f1=await apiRequest(_0x5b8a84(0x1f7),{'method':'POST','body':_0x5cf36d});return _0x5e70f1['data'];}export async function deleteDbLink(_0x5029c7){const _0x2062c5=a158_0x2ac6;await apiRequest(_0x2062c5(0x182),{'method':_0x2062c5(0x20d),'body':{'id':_0x5029c7}});}export async function testDbLinkConnect(_0x1c7d2d){const _0x2b19f7=a158_0x2ac6,_0x1942e9=await apiRequest(_0x2b19f7(0x17f)+buildQuery({'id':_0x1c7d2d}));return _0x1942e9[_0x2b19f7(0x176)];}export async function startDbAnalysis(_0x117834,_0x1b4d8b){const _0x2003ce=a158_0x2ac6,_0x3d4d27=await apiRequest('/smartapi/db-analysis/start',{'method':_0x2003ce(0x20d),'body':{'dbLinkId':_0x117834,..._0x1b4d8b&&_0x1b4d8b[_0x2003ce(0x1bc)]>0x0?{'tableNames':_0x1b4d8b}:{}}}),_0x38a5b0=_0x3d4d27[_0x2003ce(0x176)];if(typeof _0x38a5b0===_0x2003ce(0x1cb))return _0x38a5b0;if(_0x38a5b0&&typeof _0x38a5b0===_0x2003ce(0x188)&&typeof _0x38a5b0[_0x2003ce(0x167)]===_0x2003ce(0x1cb))return _0x38a5b0[_0x2003ce(0x167)];return _0x38a5b0!=null?String(_0x38a5b0):'';}export async function cancelDbAnalysis(_0xb218d){const _0x560b22=a158_0x2ac6;await apiRequest(_0x560b22(0x204)+buildQuery({'planId':_0xb218d}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x3c5d91){const _0x3ebaf6=a158_0x2ac6,_0x29794b=await apiRequest(_0x3ebaf6(0x1d2)+encodeURIComponent(_0x3c5d91));return _0x29794b[_0x3ebaf6(0x176)];}export async function getDbAllTableList(_0xe354ae,_0x5edd3b){const _0x373b20=a158_0x2ac6,_0x4522db=await apiRequest(_0x373b20(0x168)+buildQuery({'appCode':_0xe354ae,'dbLinkId':_0x5edd3b})),_0x3a6330=_0x4522db[_0x373b20(0x176)];if(Array[_0x373b20(0x187)](_0x3a6330))return _0x3a6330;return extractList(_0x3a6330);}export async function getDbTableDiff(_0x53ab2d,_0x134bb5,_0x20ed43){const _0x4d15e=a158_0x2ac6,_0x3597f3=await apiRequest(_0x4d15e(0x189)+buildQuery({'appCode':_0x53ab2d,'dbLinkId':_0x134bb5,'pageIndex':_0x20ed43?.['pageIndex']??0x1,'pageSize':_0x20ed43?.[_0x4d15e(0x164)]??0x14,'tableName':_0x20ed43?.[_0x4d15e(0x1b4)]})),_0x541666=_0x3597f3[_0x4d15e(0x176)];return{'totalCount':_0x541666?.[_0x4d15e(0x165)]??0x0,'physicalTableCount':_0x541666?.['physicalTableCount']??0x0,'datasetTableCount':_0x541666?.['datasetTableCount']??0x0,..._0x541666?.[_0x4d15e(0x18e)]?{'summary':_0x541666['summary']}:{},'tableList':Array[_0x4d15e(0x187)](_0x541666?.['tableList'])?_0x541666['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x241c58=a158_0x2ac6,_0x5d6a86=await apiRequest(_0x241c58(0x1dd),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x196df6=extractList(_0x5d6a86[_0x241c58(0x176)]),_0x55ea50=extractPaging(_0x5d6a86[_0x241c58(0x176)]);return _0x55ea50&&_0x55ea50[_0x241c58(0x165)]>REMOTE_APP_PAGE_SIZE&&console[_0x241c58(0x1aa)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x55ea50[_0x241c58(0x165)]+_0x241c58(0x1a3)+_0x241c58(0x1c4)),_0x196df6;}
|
|
1
|
+
(function(_0x1a1e71,_0x2cf56f){const _0x4e9c9f=a158_0x2b98,_0x5ce546=_0x1a1e71();while(!![]){try{const _0x5ba673=-parseInt(_0x4e9c9f(0x1a2))/0x1*(parseInt(_0x4e9c9f(0x1d5))/0x2)+-parseInt(_0x4e9c9f(0x1a3))/0x3+-parseInt(_0x4e9c9f(0x16f))/0x4+parseInt(_0x4e9c9f(0x1da))/0x5*(-parseInt(_0x4e9c9f(0x18c))/0x6)+parseInt(_0x4e9c9f(0x1fe))/0x7*(parseInt(_0x4e9c9f(0x1cf))/0x8)+-parseInt(_0x4e9c9f(0x1ac))/0x9+parseInt(_0x4e9c9f(0x1b3))/0xa;if(_0x5ba673===_0x2cf56f)break;else _0x5ce546['push'](_0x5ce546['shift']());}catch(_0x5b3088){_0x5ce546['push'](_0x5ce546['shift']());}}}(a158_0x3fd0,0xa4b6b));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0x20621b){_activeCookie=_0x20621b||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(_0x2ff8a9,_0x3c3467){const _0x14f7f3=a158_0x2b98,_0xc9e900=_0x3c3467 instanceof Error?_0x3c3467['message']:String(_0x3c3467);return CliErrors[_0x14f7f3(0x188)](_0x14f7f3(0x197)+_0x2ff8a9+(_0xc9e900?'\x20('+_0xc9e900+')':''),_0x14f7f3(0x1db));}async function apiRequest(_0x13ea9b,_0x5f3dee={}){const _0x48d4aa=a158_0x2b98,{method:method=_0x48d4aa(0x19c),body:_0x426192,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x5f3dee,_0x5eb0ba=useRuntime?getRuntimeDomain():getApiDomain(),_0x4c7248=_activeCookie||getCookie(),_0x1a2199=''+_0x5eb0ba+_0x13ea9b,_0x366146=new AbortController(),_0x5f018f=setTimeout(()=>_0x366146[_0x48d4aa(0x187)](),timeout);try{const _0x144155=await fetch(_0x1a2199,{'method':method,'headers':{'Content-Type':_0x48d4aa(0x1f6),'Cookie':_0x4c7248,'X-Invoke-Source':_0x48d4aa(0x1d9),...headers},'body':_0x426192?JSON[_0x48d4aa(0x189)](_0x426192):undefined,'signal':_0x366146[_0x48d4aa(0x1dc)]});let _0x222c22;try{_0x222c22=await _0x144155[_0x48d4aa(0x18f)]();}catch(_0x222c7e){if(_0x222c7e instanceof Error&&_0x222c7e[_0x48d4aa(0x1fa)]===_0x48d4aa(0x198))throw CliErrors[_0x48d4aa(0x188)](_0x48d4aa(0x1b7)+_0x1a2199);if(_0x144155['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError']('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x144155[_0x48d4aa(0x1a5)]+')',_0x144155[_0x48d4aa(0x1a5)]>=0x190?_0x48d4aa(0x18e):undefined);}if(!_0x144155['ok']||_0x222c22[_0x48d4aa(0x202)]===![])throw CliErrors[_0x48d4aa(0x188)](_0x222c22['errorMsg']||_0x222c22['message']||_0x48d4aa(0x1ef)+_0x144155['status'],_0x222c22[_0x48d4aa(0x182)]?_0x48d4aa(0x17b)+_0x222c22[_0x48d4aa(0x182)]:undefined);return _0x222c22;}catch(_0x2fc043){if(_0x2fc043 instanceof CliError)throw _0x2fc043;if(_0x2fc043 instanceof Error&&_0x2fc043[_0x48d4aa(0x1fa)]===_0x48d4aa(0x198))throw CliErrors['apiError'](_0x48d4aa(0x1b7)+_0x1a2199);throw createFetchFailureError(_0x1a2199,_0x2fc043);}finally{clearTimeout(_0x5f018f);}}function isAuthFailure(_0x6c85ce){const _0xc7b8e2=a158_0x2b98,_0x494dc1=_0x6c85ce['errorMsg']||_0x6c85ce[_0xc7b8e2(0x183)]||_0x6c85ce[_0xc7b8e2(0x170)]?.[_0xc7b8e2(0x183)]||_0x6c85ce[_0xc7b8e2(0x1e7)]||_0x6c85ce['error']||'';return _0x6c85ce[_0xc7b8e2(0x182)]===_0xc7b8e2(0x1e8)||_0x6c85ce[_0xc7b8e2(0x1d1)]===0x191||_0x6c85ce[_0xc7b8e2(0x1d1)]===_0xc7b8e2(0x17f)||_0x494dc1[_0xc7b8e2(0x1a0)]('401')||_0x494dc1[_0xc7b8e2(0x1a0)]('Unauthorized')||_0x494dc1['includes']('登录')||_0x494dc1[_0xc7b8e2(0x1a0)]('认证');}export async function platformFetch(_0x1848a7,_0x302a5a){const _0x44093b=a158_0x2b98;let _0x18120d;try{_0x18120d=await fetch(_0x1848a7,{'method':_0x302a5a['method']??'GET','headers':{'Content-Type':_0x44093b(0x1f6),'Cookie':_0x302a5a[_0x44093b(0x1b6)],'X-Invoke-Source':'cli:rabetbase'},..._0x302a5a['body']&&{'body':JSON[_0x44093b(0x189)](_0x302a5a['body'])}});}catch(_0x5609fa){throw createFetchFailureError(_0x1848a7,_0x5609fa);}if(!_0x18120d['ok']){if(_0x18120d[_0x44093b(0x1a5)]===0x191)throw CliErrors[_0x44093b(0x193)]();throw CliErrors[_0x44093b(0x188)](_0x302a5a['label']+_0x44093b(0x172)+_0x18120d[_0x44093b(0x1a5)]);}const _0x357bed=await _0x18120d[_0x44093b(0x18f)]();if(_0x357bed[_0x44093b(0x202)]===![]){if(isAuthFailure(_0x357bed))throw CliErrors['authRequired']();throw CliErrors[_0x44093b(0x188)](_0x357bed[_0x44093b(0x1f9)]||_0x357bed[_0x44093b(0x183)]||_0x302a5a['label']+_0x44093b(0x171));}return _0x357bed[_0x44093b(0x170)];}export async function listBffScripts(_0x2144c0,_0x419dd2,_0x39c1f2){const _0x12ae4a=a158_0x2b98;let _0x1cfc3d='/api/management/library/scripts/list?appCode='+_0x2144c0;if(_0x419dd2)_0x1cfc3d+='&type='+_0x419dd2;const _0x52424a=await apiRequest(_0x1cfc3d);let _0x25772c=extractList(_0x52424a[_0x12ae4a(0x170)]);if(_0x39c1f2?.[_0x12ae4a(0x1a8)]){const _0x5b4ab6=_0x39c1f2[_0x12ae4a(0x1a8)][_0x12ae4a(0x1e6)]();_0x25772c=_0x25772c['filter'](_0x2d8bda=>_0x2d8bda['functionName']?.[_0x12ae4a(0x1e6)]()[_0x12ae4a(0x1a0)](_0x5b4ab6)||_0x2d8bda[_0x12ae4a(0x1ba)]?.[_0x12ae4a(0x1e6)]()['includes'](_0x5b4ab6));}return _0x25772c;}export async function getBffScriptInfo(_0x5cc63f){const _0x2a4f1a=a158_0x2b98,_0x17bbb3=await apiRequest(_0x2a4f1a(0x1bd)+_0x5cc63f);if(!_0x17bbb3[_0x2a4f1a(0x170)])throw CliErrors['validation']('BFF\x20script\x20not\x20found:\x20id='+_0x5cc63f);return _0x17bbb3['data'];}export async function saveBffScript(_0x221255){const _0xedc3d3=a158_0x2b98,_0x51b916=await apiRequest('/api/management/library/scripts/save',{'method':_0xedc3d3(0x176),'body':_0x221255}),{id:_0x38ec0c,entity:_0x40177d}=normalizeEntityWithIdResponse(_0x51b916[_0xedc3d3(0x170)]);if(_0x38ec0c!==undefined){const _0x407add=typeof _0x40177d[_0xedc3d3(0x1a7)]===_0xedc3d3(0x1fb)||typeof _0x40177d[_0xedc3d3(0x1ff)]==='string'?_0x40177d:undefined;return{'id':_0x38ec0c,'script':_0x407add};}throw CliErrors[_0xedc3d3(0x188)](_0xedc3d3(0x1c0));}export async function deleteBffScript(_0x5d144b){const _0x40632a=a158_0x2b98;await apiRequest(_0x40632a(0x1af),{'method':_0x40632a(0x176),'body':{'id':_0x5d144b}});}export async function getBffScriptStatistics(_0x4e5f52){const _0x26be0f=a158_0x2b98,_0x2a71af=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x4e5f52);return extractList(_0x2a71af[_0x26be0f(0x170)]);}export async function clearBffScriptCache(){const _0x518cfc=a158_0x2b98,_0x2cf990=await apiRequest(_0x518cfc(0x190),{'method':_0x518cfc(0x176),'useRuntime':!![]});return typeof _0x2cf990[_0x518cfc(0x170)]===_0x518cfc(0x1fb)?_0x2cf990[_0x518cfc(0x170)]:'';}export async function listBffDatasetOperations(_0x3860c7,_0x20ef7d){const _0x7cfaf1=a158_0x2b98,_0x333eda=await apiRequest(_0x7cfaf1(0x1f4),{'method':_0x7cfaf1(0x176),'body':{'appCode':_0x3860c7,'datasetId':_0x20ef7d}});return _0x333eda[_0x7cfaf1(0x170)];}export async function listSqlQueries(_0x5c6e83,_0x268a4f){const _0x2d9049=a158_0x2b98,_0x5ed998=await apiRequest(_0x2d9049(0x203),{'method':_0x2d9049(0x176),'body':{'appCode':_0x5c6e83,'currentPage':_0x268a4f?.[_0x2d9049(0x192)]??0x1,'pageSize':_0x268a4f?.[_0x2d9049(0x1f5)]??0x32,'sqlCode':_0x268a4f?.[_0x2d9049(0x1a9)],'sqlName':_0x268a4f?.[_0x2d9049(0x1a4)]}});return _0x5ed998[_0x2d9049(0x170)];}export async function getSqlQueryInfo(_0x323e44,_0x3ebe20){const _0x5bacf5=a158_0x2b98,_0x239e4f=await listSqlQueries(_0x323e44,{'sqlCode':_0x3ebe20}),_0x1cbc7a=_0x239e4f[_0x5bacf5(0x1e5)]?.[0x0];if(!_0x1cbc7a)throw CliErrors['validation']('SQL\x20query\x20not\x20found:\x20'+_0x3ebe20);return _0x1cbc7a;}export async function getSqlQueryDetail(_0x44c361){const _0x18bda3=a158_0x2b98,_0x466c25=await apiRequest(_0x18bda3(0x1bc)+(_0x18bda3(0x167)+encodeURIComponent(_0x44c361)));if(!_0x466c25[_0x18bda3(0x170)])throw CliErrors['validation'](_0x18bda3(0x1ee)+_0x44c361);return _0x466c25[_0x18bda3(0x170)];}export async function getSqlQueryDetailById(_0x5e225a){const _0x31affa=a158_0x2b98,_0x1f2bcd=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x5e225a);if(!_0x1f2bcd['data'])throw CliErrors[_0x31affa(0x1d7)](_0x31affa(0x184)+_0x5e225a);return _0x1f2bcd[_0x31affa(0x170)];}export async function createSqlQuery(_0x5b9535){const _0x2a4c81=a158_0x2b98,_0x2c6e47=await apiRequest(_0x2a4c81(0x1f3),{'method':_0x2a4c81(0x176),'body':_0x5b9535}),{id:_0x488780,entity:_0x517cc3}=normalizeEntityWithIdResponse(_0x2c6e47['data']);if(!('sqlCode'in _0x517cc3)&&_0x488780)return getSqlQueryDetailById(_0x488780);return normalizeSqlQueryEntity(_0x517cc3);}export async function updateSqlQuery(_0x5a351a){const _0x2906a8=a158_0x2b98,_0x120cc2=await apiRequest('/smartapi/custom/updateUserCustomSql',{'method':_0x2906a8(0x176),'body':_0x5a351a}),{id:_0x299c16,entity:_0x1bf4e0}=normalizeEntityWithIdResponse(_0x120cc2[_0x2906a8(0x170)]);if(!(_0x2906a8(0x1a9)in _0x1bf4e0)){if(_0x5a351a[_0x2906a8(0x1a9)])return getSqlQueryDetail(_0x5a351a[_0x2906a8(0x1a9)]);if(_0x299c16)return getSqlQueryDetailById(_0x299c16);}return normalizeSqlQueryEntity(_0x1bf4e0);}export async function deleteSqlQuery(_0xeab811){const _0x3205b7=a158_0x2b98;await apiRequest(_0x3205b7(0x17e),{'method':_0x3205b7(0x176),'body':_0xeab811});}export async function saveSqlQuery(_0x1465b2){const _0x4cd319=a158_0x2b98,_0x5e2b15=await apiRequest(_0x4cd319(0x201),{'method':_0x4cd319(0x176),'body':_0x1465b2});return _0x5e2b15[_0x4cd319(0x170)];}function normalizeSqlQueryEntity(_0x4aca02){const _0x5ea73f=a158_0x2b98;return{..._0x4aca02,'id':Number(_0x4aca02['id']),'dbId':_0x4aca02[_0x5ea73f(0x1b5)]==null?undefined:Number(_0x4aca02[_0x5ea73f(0x1b5)]),'version':_0x4aca02[_0x5ea73f(0x1b8)]==null?undefined:Number(_0x4aca02['version'])};}export async function executeSql(_0x545593,_0x49b418,_0x3bd4fb){const _0x11416b=a158_0x2b98,_0x5d1c01=await apiRequest(_0x11416b(0x1b9),{'method':_0x11416b(0x176),'body':{'appCode':_0x545593,'sqlCode':_0x49b418,..._0x3bd4fb&&{'params':_0x3bd4fb}},'useRuntime':!![]});return _0x5d1c01[_0x11416b(0x170)];}export async function executeDatasetDataOperation(_0x7f45e2,_0x12f2f5,_0x29220f,_0x27b7c3={}){const _0x3dddf2=a158_0x2b98;try{const _0x3087e8=await apiRequest(_0x3dddf2(0x1a1)+_0x7f45e2+'/'+_0x12f2f5+'/'+_0x29220f,{'method':'POST','body':_0x27b7c3,'useRuntime':!![]});return _0x3087e8[_0x3dddf2(0x170)];}catch(_0x3c2d43){if(_0x29220f===_0x3dddf2(0x205)&&_0x3c2d43 instanceof CliError&&_0x3c2d43['code']===_0x3dddf2(0x1d6)&&_0x27b7c3['id']!==undefined&&_0x27b7c3['id']!==null&&_0x27b7c3['id']!==''){const _0x1fecef=await apiRequest(_0x3dddf2(0x1a1)+_0x7f45e2+'/'+_0x12f2f5+'/filter',{'method':_0x3dddf2(0x176),'body':{'where':{'id':{'$eq':_0x27b7c3['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x37a2bc=Array[_0x3dddf2(0x1c8)](_0x1fecef[_0x3dddf2(0x170)]?.[_0x3dddf2(0x1e5)])?_0x1fecef['data'][_0x3dddf2(0x1e5)]:[];return _0x37a2bc[0x0]??null;}throw _0x3c2d43;}}export async function listDatasets(_0x1bf216,_0x180786){const _0x1b0e19=a158_0x2b98,_0x3d36b8={'appCode':_0x1bf216,'deleted':_0x180786?.[_0x1b0e19(0x1b1)]??![]};if(_0x180786?.[_0x1b0e19(0x1d1)])_0x3d36b8[_0x1b0e19(0x1d1)]=_0x180786[_0x1b0e19(0x1d1)];if(_0x180786?.['name'])_0x3d36b8['name']=_0x180786[_0x1b0e19(0x1fa)];const _0x416efb=await apiRequest(_0x1b0e19(0x17a),{'method':_0x1b0e19(0x176),'body':_0x3d36b8});return extractList(_0x416efb['data']);}export async function deleteDataset(_0x1f6b77,_0x56a4a3){const _0x43d69f=a158_0x2b98;await apiRequest(_0x43d69f(0x165),{'method':'POST','body':{'appCode':_0x1f6b77,'datasetId':_0x56a4a3}});}export async function restoreDataset(_0x57a3de,_0x425481){const _0x5c4647=a158_0x2b98;await apiRequest('/smartapi/dataset/restore-dataset',{'method':_0x5c4647(0x176),'body':{'appCode':_0x57a3de,'datasetId':_0x425481}});}export async function previewTextGeneratedDataset(_0x4395a7,_0x2fa98c){const _0x3656db=a158_0x2b98,_0x4fad7d=await apiRequest('/smartapi/dataset/text-generate/preview',{'method':_0x3656db(0x176),'body':{'appCode':_0x4395a7,'datasetName':_0x2fa98c[_0x3656db(0x1c2)],'requirementDescription':_0x2fa98c[_0x3656db(0x19b)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x4fad7d[_0x3656db(0x170)];}export async function startTextGeneratedDataset(_0x3253b7,_0x4042cf,_0x35cfed){const _0x5e61e8=a158_0x2b98,_0x2684a7=await apiRequest(_0x5e61e8(0x1eb),{'method':_0x5e61e8(0x176),'body':{'appCode':_0x3253b7,..._0x35cfed?.['clientOperationId']?{'clientOperationId':_0x35cfed[_0x5e61e8(0x1d2)]}:{},'design':_0x4042cf},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x2684a7[_0x5e61e8(0x170)];}export async function getTextGeneratedDatasetStatus(_0x3c361e,_0x3e7ed9){const _0x15e69b=a158_0x2b98,_0x2f441f=new URLSearchParams({'appCode':_0x3c361e});_0x3e7ed9[_0x15e69b(0x1cb)]&&_0x2f441f['set']('operationId',_0x3e7ed9[_0x15e69b(0x1cb)]);_0x3e7ed9['clientOperationId']&&_0x2f441f['set']('clientOperationId',_0x3e7ed9[_0x15e69b(0x1d2)]);const _0x4b0be4=await apiRequest(_0x15e69b(0x194)+_0x2f441f[_0x15e69b(0x163)]());return _0x4b0be4[_0x15e69b(0x170)];}export async function searchDatasets(_0x2d4eb4,_0x2daa1a){const _0x358fa9=a158_0x2b98,_0x11d9c2=await listDatasets(_0x2d4eb4,{'name':_0x2daa1a}),_0x59a288=_0x2daa1a[_0x358fa9(0x1e6)](),_0x270fde=new Set(_0x11d9c2[_0x358fa9(0x19f)](_0x1760bd=>_0x1760bd['id'])),_0x24bc18=_0x11d9c2[_0x358fa9(0x1c1)](_0x391ba4=>_0x391ba4['dbtableConfig']?.['tableName']?.[_0x358fa9(0x1e6)]()[_0x358fa9(0x1a0)](_0x59a288)||_0x391ba4['description']?.[_0x358fa9(0x1e6)]()[_0x358fa9(0x1a0)](_0x59a288)),_0x405828=await listDatasets(_0x2d4eb4,{'code':_0x2daa1a});for(const _0x4a971f of _0x405828){!_0x270fde[_0x358fa9(0x16a)](_0x4a971f['id'])&&(_0x11d9c2[_0x358fa9(0x1aa)](_0x4a971f),_0x270fde[_0x358fa9(0x1ca)](_0x4a971f['id']));}return _0x11d9c2;}export function normalizeDatasetOperations(_0x2052bc){const _0x42ec65=a158_0x2b98;if(Array[_0x42ec65(0x1c8)](_0x2052bc))return _0x2052bc[_0x42ec65(0x1c1)](_0xcb9572=>_0xcb9572!=null&&typeof _0xcb9572==='object');if(_0x2052bc&&typeof _0x2052bc===_0x42ec65(0x178))return Object['entries'](_0x2052bc)[_0x42ec65(0x1c1)](([,_0x4a9835])=>_0x4a9835!=null&&typeof _0x4a9835===_0x42ec65(0x178))['map'](([_0x1a5c3b,_0x18968b])=>({..._0x18968b,'name':_0x18968b[_0x42ec65(0x1fa)]??_0x18968b['operationName']??_0x1a5c3b}));return[];}export async function getDatasetDetail(_0x44ade8){const _0x33a370=a158_0x2b98,_0x50746f=/^\d+$/[_0x33a370(0x19a)](_0x44ade8)?'id':'code',_0xd93db1=await apiRequest(_0x33a370(0x1cc)+_0x50746f+'='+_0x44ade8);return _0xd93db1[_0x33a370(0x170)];}export async function updateDrivenData(_0x350a0d){const _0x1e9195=a158_0x2b98,_0x112b1a=await apiRequest('/smartapi/dataset/update-driven-data',{'method':'POST','body':_0x350a0d});return _0x112b1a[_0x1e9195(0x170)];}export async function getDatasetOperations(_0x242efa){const _0x1135ab=a158_0x2b98,_0x41b603=await getDatasetDetail(_0x242efa),_0x1f5090=normalizeDatasetOperations(_0x41b603[_0x1135ab(0x1e1)])[_0x1135ab(0x19f)](_0x18fe5e=>({'name':_0x18fe5e[_0x1135ab(0x1fa)]||_0x18fe5e[_0x1135ab(0x1ae)],'displayName':_0x18fe5e[_0x1135ab(0x1c3)]||_0x18fe5e[_0x1135ab(0x1fa)],'type':_0x18fe5e['type'],'method':_0x18fe5e['method'],'path':_0x18fe5e[_0x1135ab(0x177)],'enabled':_0x18fe5e[_0x1135ab(0x1d0)]??!![],'requestFields':_0x18fe5e[_0x1135ab(0x185)],'responseFields':_0x18fe5e[_0x1135ab(0x17d)]}));return{'dataset':{'id':_0x41b603['id']??_0x41b603[_0x1135ab(0x169)],'name':_0x41b603[_0x1135ab(0x1fa)],'code':_0x41b603[_0x1135ab(0x1d1)]||_0x41b603[_0x1135ab(0x1e3)],'tableName':_0x41b603['tableName']||_0x41b603['dbtableConfig']?.[_0x1135ab(0x204)]},'operations':_0x1f5090};}export async function getOperationDetail(_0x5303b3,_0x4e4f40,_0x239e4e){const _0x450753=a158_0x2b98;let _0x264456=_0x4e4f40;if(!/^\d+$/[_0x450753(0x19a)](_0x4e4f40)){const _0x3e7684=await listDatasets(_0x5303b3,{'code':_0x4e4f40}),_0x2b5a6e=_0x3e7684[_0x450753(0x18b)](_0x89daf5=>_0x89daf5[_0x450753(0x1d1)]===_0x4e4f40||String(_0x89daf5['id'])===_0x4e4f40);if(!_0x2b5a6e)throw CliErrors[_0x450753(0x1d7)](_0x450753(0x18d)+_0x4e4f40);_0x264456=String(_0x2b5a6e['id']);}const _0xfc2feb=await getDatasetDetail(_0x264456),_0x1f8409=normalizeDatasetOperations(_0xfc2feb[_0x450753(0x1e1)])[_0x450753(0x18b)](_0x4b3548=>(_0x4b3548['name']||_0x4b3548['operationName'])===_0x239e4e);if(!_0x1f8409)throw CliErrors[_0x450753(0x1d7)](_0x450753(0x19d)+_0x239e4e+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x4e4f40);return{'dataset':{'id':_0xfc2feb['id']??_0xfc2feb[_0x450753(0x169)],'name':_0xfc2feb[_0x450753(0x1fa)],'code':_0xfc2feb['code']||_0xfc2feb[_0x450753(0x1e3)],'tableName':_0xfc2feb['tableName']||_0xfc2feb[_0x450753(0x1c5)]?.['tableName']},'operation':_0x1f8409};}export async function startGenerateStandardPages(_0x1bcedf,_0x2cef84,_0x58ef5b){const _0x2dbfa6=a158_0x2b98,_0x411a0b=await apiRequest(_0x2dbfa6(0x16d)+_0x2cef84+'/generate-standard-pages/start',{'method':'POST','body':{'appCode':_0x1bcedf,..._0x58ef5b?.['clientOperationId']?{'clientOperationId':_0x58ef5b[_0x2dbfa6(0x1d2)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x411a0b[_0x2dbfa6(0x170)];}export async function getGenerateStandardPagesStatus(_0x35aab2,_0x250fb8,_0x79fb47){const _0x4c82eb=a158_0x2b98,_0x2ce5ab=new URLSearchParams({'appCode':_0x35aab2});_0x79fb47[_0x4c82eb(0x1cb)]&&_0x2ce5ab[_0x4c82eb(0x196)](_0x4c82eb(0x1cb),_0x79fb47[_0x4c82eb(0x1cb)]);_0x79fb47[_0x4c82eb(0x1d2)]&&_0x2ce5ab[_0x4c82eb(0x196)](_0x4c82eb(0x1d2),_0x79fb47[_0x4c82eb(0x1d2)]);const _0x38f9ff=await apiRequest('/smartapi/lovrabet/dataset/'+_0x250fb8+'/generate-standard-pages/status?'+_0x2ce5ab[_0x4c82eb(0x163)]());return _0x38f9ff['data'];}export async function getStandardPageStatus(_0x5556db,_0x3da00f){const _0x51a528=a158_0x2b98,_0x49799c=await apiRequest(_0x51a528(0x16d)+_0x3da00f+_0x51a528(0x175)+encodeURIComponent(_0x5556db));return _0x49799c['data'];}export async function tryGetStandardPageStatus(_0x4d9680,_0x2537d6){const _0x3b7419=a158_0x2b98;try{return await getStandardPageStatus(_0x4d9680,_0x2537d6);}catch(_0x4d2d51){if(_0x4d2d51 instanceof CliError&&_0x4d2d51['code']===_0x3b7419(0x1d6)&&/404|not found|non-json response/i[_0x3b7419(0x19a)](_0x4d2d51[_0x3b7419(0x183)]))return null;throw _0x4d2d51;}}export async function syncStandardPages(_0x2d42b3,_0x55d6af){const _0x268359=a158_0x2b98,_0x5487c8=await apiRequest('/smartapi/lovrabet/dataset/'+_0x55d6af+'/sync-to-pages',{'method':'POST','body':{'appCode':_0x2d42b3}});return _0x5487c8[_0x268359(0x170)];}export async function getPageDetail(_0x1b9cbf){const _0x3ebab6=a158_0x2b98,_0xa9b574=await apiRequest('/smartapi/lovrabet/detail?pageId='+_0x1b9cbf);if(!_0xa9b574[_0x3ebab6(0x170)])throw CliErrors['validation']('Page\x20not\x20found:\x20'+_0x1b9cbf);return _0xa9b574[_0x3ebab6(0x170)];}export async function updatePage(_0x3e3df6,_0x4f0af7,_0x588354,_0xc217ce){const _0x339c33=a158_0x2b98,_0x7ca095=await apiRequest(_0x339c33(0x195),{'method':_0x339c33(0x176),'body':{'appCode':_0x3e3df6,'pageId':_0x4f0af7,'code':_0x588354,'datasetIds':_0xc217ce}});return _0x7ca095[_0x339c33(0x170)];}function a158_0x3fd0(){const _0x9cf7fa=['tags','abort','apiError','stringify','totalCount','find','438zzLVSx','Dataset\x20not\x20found:\x20','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','json','/api/management/script/cache/clear','/smartapi/dblink/create','currentPage','authRequired','/smartapi/dataset/text-generate/status?','/smartapi/lovrabet/update-page','set','Request\x20failed:\x20','AbortError','delete','test','requirementDescription','GET','Operation\x20\x22','const\x20results\x20=\x20data.execResult\x20||\x20[];','map','includes','/api/','136199omuHFh','1369965HbDdGx','sqlName','status','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','functionName','scriptName','sqlCode','push','/smartapi/question/er-config/erDelete','8552898KyZbKd','replace','operationName','/api/management/library/scripts/delete','/smartapi/dblink/delete','deleted','dataset_','36029400zKklnw','const\x20result\x20=\x20await\x20client.models.','dbId','cookie','Request\x20timeout:\x20','version','/api/custom/executeSql','description','appCode','/smartapi/custom/getUserCustomSql','/api/management/library/scripts/info?id=','.create({\x20/*\x20fields\x20*/\x20});','.filter({','BFF\x20save\x20returned\x20no\x20valid\x20id','filter','datasetName','displayName','\x20\x20return\x20rows;','dbtableConfig','planId','});','isArray','\x20\x20sqlCode:\x20\x27','add','operationId','/smartapi/dataset/get-driven-data?','/smartapi/dblink/update','tableList','217208QyhqKR','enabled','code','clientOperationId','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','16cMQwgf','api_error','validation','/smartapi/dblink/getTableDiffV2ByPage','cli:rabetbase','90775hzwRXH','Check\x20network\x20connectivity\x20and\x20try\x20again.','signal','\x20\x20currentPage:\x201,','/smartapi/question/er-config/update-single','update','/smartapi/question/er-config','operations','list','modelCode','/smartapi/dblink/getAllTableList','tableData','toLowerCase','errorMessage','UNAUTHORIZED','/smartapi/app-config/delete','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','/smartapi/dataset/text-generate/start','summary','length','SQL\x20query\x20not\x20found:\x20','API\x20error:\x20','join','/smartapi/question/er-config/erCreate','entries','/smartapi/custom/saveUserCustomSql','/smartapi/dataset/get-dataset-operation','pageSize','application/json','/smartapi/app/getList','\x20apps.\x20','errorMsg','name','string','//\x20','/smartapi/app-config/update','238zFYkmV','scriptType','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/api/node-toolbox/sql/save','success','/smartapi/custom/queryUserCustomSqlList','tableName','getOne','includeImports','toString','create','/smartapi/dataset/delete-dataset','const\x20data\x20=\x20await\x20client.sql.execute({','?sqlCode=','target','modelId','has','warn','//\x20SQL:\x20','/smartapi/lovrabet/dataset/','.remove(id);','118092LhRxTe','data','\x20failed','\x20failed,\x20HTTP\x20','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','pageIndex','/standard-page-status?appCode=','POST','path','object','value','/smartapi/dataset/get-dataset-list','API\x20error\x20code:\x20','key','responseFields','/smartapi/custom/deleteUserCustomSql','401','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','sdk','errorCode','message','SQL\x20query\x20not\x20found:\x20id=','requestFields'];a158_0x3fd0=function(){return _0x9cf7fa;};return a158_0x3fd0();}export function generateSdkCode(_0x19fa26,_0x4254b8,_0x3b8e0d){const _0x33db3f=a158_0x2b98,_0x13679b=_0x3b8e0d?.[_0x33db3f(0x162)]??!![],_0xce1182=_0x33db3f(0x1b2)+_0x19fa26[_0x33db3f(0x1d1)]?.[_0x33db3f(0x1ad)](/-/g,'_'),_0x19d140=_0x4254b8['name']||_0x4254b8[_0x33db3f(0x1ae)]||_0x33db3f(0x1c1),_0x379424=[];_0x13679b&&_0x379424['push'](_0x33db3f(0x1ea),'',_0x33db3f(0x1a6),'');_0x379424[_0x33db3f(0x1aa)](_0x33db3f(0x1fc)+_0x19fa26[_0x33db3f(0x1fa)]+'\x20('+(_0x19fa26[_0x33db3f(0x204)]||'table')+')');if(_0x19d140===_0x33db3f(0x1c1))_0x379424['push'](_0x33db3f(0x1b4)+_0xce1182+_0x33db3f(0x1bf),'\x20\x20where:\x20{},','\x20\x20pageSize:\x2020,',_0x33db3f(0x1dd),_0x33db3f(0x1c7));else{if(_0x19d140===_0x33db3f(0x205))_0x379424['push']('const\x20result\x20=\x20await\x20client.models.'+_0xce1182+'.getOne(id);');else{if(_0x19d140===_0x33db3f(0x164))_0x379424[_0x33db3f(0x1aa)]('const\x20result\x20=\x20await\x20client.models.'+_0xce1182+_0x33db3f(0x1be));else{if(_0x19d140===_0x33db3f(0x1df))_0x379424['push']('const\x20result\x20=\x20await\x20client.models.'+_0xce1182+_0x33db3f(0x1d4));else _0x19d140===_0x33db3f(0x199)||_0x19d140==='remove'?_0x379424['push'](_0x33db3f(0x1b4)+_0xce1182+_0x33db3f(0x16e)):_0x379424[_0x33db3f(0x1aa)]('const\x20result\x20=\x20await\x20client.models.'+_0xce1182+'.'+_0x19d140+'(/*\x20params\x20*/);');}}}return _0x379424[_0x33db3f(0x1f0)]('\x0a');}export function generateSqlCodeTemplate(_0x3fe6a3,_0x49e232){const _0x56e4f9=a158_0x2b98,_0x5bd47a=_0x49e232?.[_0x56e4f9(0x168)]??_0x56e4f9(0x181),_0x49d2f7=_0x49e232?.[_0x56e4f9(0x162)]??!![],_0x8c2070=[];return _0x8c2070[_0x56e4f9(0x1aa)](_0x56e4f9(0x16c)+_0x3fe6a3[_0x56e4f9(0x1a4)]+'\x20('+_0x3fe6a3[_0x56e4f9(0x1a9)]+')'),_0x5bd47a===_0x56e4f9(0x181)?(_0x49d2f7&&_0x8c2070[_0x56e4f9(0x1aa)](_0x56e4f9(0x1ea),'',_0x56e4f9(0x1a6),''),_0x8c2070['push'](_0x56e4f9(0x166),_0x56e4f9(0x1c9)+_0x3fe6a3['sqlCode']+'\x27,',_0x56e4f9(0x200),_0x56e4f9(0x1c7),_0x56e4f9(0x180),_0x56e4f9(0x19e))):_0x8c2070['push'](_0x56e4f9(0x173),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','\x20\x20\x20\x20sqlCode:\x20\x27'+_0x3fe6a3['sqlCode']+'\x27,',_0x56e4f9(0x1d3),'\x20\x20});',_0x56e4f9(0x1c4),'}'),_0x8c2070[_0x56e4f9(0x1f0)]('\x0a');}export async function getErConfig(_0x5144fa,_0x3f0bd2){const _0xdffeb6=a158_0x2b98,_0x1807d2=await apiRequest(_0xdffeb6(0x1e0),{'method':_0xdffeb6(0x176),'body':{'appCode':_0x5144fa,'dblinkId':_0x3f0bd2},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x1807d2[_0xdffeb6(0x170)];}export async function createErRelation(_0xc0ee9c){const _0xe5078b=a158_0x2b98,_0xb44c69=await apiRequest(_0xe5078b(0x1f1),{'method':_0xe5078b(0x176),'body':_0xc0ee9c,'allowNonJsonSuccess':!![]});return _0xb44c69[_0xe5078b(0x170)];}export async function updateErRelation(_0x1ffe23){const _0x4aaf4e=a158_0x2b98,_0x5da7d9=await apiRequest(_0x4aaf4e(0x1de),{'method':_0x4aaf4e(0x176),'body':_0x1ffe23,'allowNonJsonSuccess':!![]});return _0x5da7d9[_0x4aaf4e(0x170)];}export async function deleteErRelation(_0x28637a){const _0x50fa96=a158_0x2b98,_0x1d9df0=await apiRequest(_0x50fa96(0x1ab),{'method':_0x50fa96(0x176),'body':_0x28637a,'allowNonJsonSuccess':!![]});return _0x1d9df0[_0x50fa96(0x170)];}export async function updateErBusinessGroup(_0x269c91){const _0x3dd0c2=a158_0x2b98,_0x58bc77=await apiRequest('/smartapi/question/er-config/business-group/edit',{'method':_0x3dd0c2(0x176),'body':_0x269c91,'allowNonJsonSuccess':!![]});return _0x58bc77[_0x3dd0c2(0x170)];}function buildQuery(_0x495087){const _0x1cf252=a158_0x2b98,_0xc5449=new URLSearchParams();for(const [_0x261fdd,_0x238510]of Object[_0x1cf252(0x1f2)](_0x495087)){if(_0x238510===undefined||_0x238510==='')continue;_0xc5449[_0x1cf252(0x196)](_0x261fdd,String(_0x238510));}const _0x54b2e5=_0xc5449[_0x1cf252(0x163)]();return _0x54b2e5?'?'+_0x54b2e5:'';}function a158_0x2b98(_0x32c18f,_0x5aff6a){_0x32c18f=_0x32c18f-0x162;const _0x3fd047=a158_0x3fd0();let _0x2b9823=_0x3fd047[_0x32c18f];return _0x2b9823;}export async function listAppConfigs(_0x6e582c,_0x28a19d){const _0x493450=a158_0x2b98,_0xe6a453=await apiRequest('/smartapi/app-config/list',{'method':_0x493450(0x176),'body':{'appCode':_0x6e582c,..._0x28a19d?.[_0x493450(0x17c)]?{'key':_0x28a19d[_0x493450(0x17c)]}:{},..._0x28a19d?.[_0x493450(0x186)]?{'tags':_0x28a19d['tags']}:{}}});return extractAppConfigList(_0xe6a453['data']);}export async function getAppConfigByKey(_0x23a005,_0x42ac39){const _0x5ad3f6=a158_0x2b98,_0x3da339=await apiRequest('/smartapi/app-config/getByKey'+buildQuery({'appCode':_0x23a005,'key':_0x42ac39}));return _0x3da339[_0x5ad3f6(0x170)]??null;}export async function createAppConfig(_0x10fd6b){const _0x8c5fc1=a158_0x2b98,_0x57fb86=await apiRequest('/smartapi/app-config/create',{'method':_0x8c5fc1(0x176),'body':{'appCode':_0x10fd6b[_0x8c5fc1(0x1bb)],'key':_0x10fd6b[_0x8c5fc1(0x17c)],'value':_0x10fd6b[_0x8c5fc1(0x179)],..._0x10fd6b[_0x8c5fc1(0x186)]?{'tags':_0x10fd6b[_0x8c5fc1(0x186)]}:{}}});return _0x57fb86[_0x8c5fc1(0x170)];}export async function updateAppConfig(_0x561d88){const _0x54c2de=a158_0x2b98;await apiRequest(_0x54c2de(0x1fd),{'method':_0x54c2de(0x176),'body':{'id':_0x561d88['id'],'appCode':_0x561d88[_0x54c2de(0x1bb)],'key':_0x561d88[_0x54c2de(0x17c)],'value':_0x561d88[_0x54c2de(0x179)],..._0x561d88[_0x54c2de(0x186)]?{'tags':_0x561d88[_0x54c2de(0x186)]}:{}}});}export async function deleteAppConfig(_0x46c124){const _0x2c91e8=a158_0x2b98;await apiRequest(_0x2c91e8(0x1e9),{'method':_0x2c91e8(0x176),'body':_0x46c124});}function extractAppConfigList(_0x3343fe){const _0x55278b=a158_0x2b98;if(Array[_0x55278b(0x1c8)](_0x3343fe))return _0x3343fe;if(_0x3343fe&&typeof _0x3343fe===_0x55278b(0x178)&&Array['isArray'](_0x3343fe[_0x55278b(0x1e2)]))return _0x3343fe[_0x55278b(0x1e2)];return extractList(_0x3343fe);}export async function listDbLinks(_0x59333b,_0x1660eb){const _0x170237=a158_0x2b98,_0x280fc6=await apiRequest('/smartapi/dblink/getList',{'method':_0x170237(0x176),'body':{'appCode':_0x59333b,'currentPage':_0x1660eb?.['currentPage']??0x1,'pageSize':_0x1660eb?.['pageSize']??0x64}});return{'items':extractList(_0x280fc6[_0x170237(0x170)]),'paging':extractPaging(_0x280fc6[_0x170237(0x170)])};}export async function getDbLinkInfo(_0x543d81){const _0x1cd325=a158_0x2b98,_0x42d73b=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x543d81}));return _0x42d73b[_0x1cd325(0x170)];}export async function createDbLink(_0x4b66ca){const _0x46bdb4=a158_0x2b98,_0x3b4804=await apiRequest(_0x46bdb4(0x191),{'method':_0x46bdb4(0x176),'body':_0x4b66ca});return _0x3b4804[_0x46bdb4(0x170)];}export async function updateDbLink(_0x2afeed){const _0x148f5c=a158_0x2b98,_0x404697=await apiRequest(_0x148f5c(0x1cd),{'method':_0x148f5c(0x176),'body':_0x2afeed});return _0x404697[_0x148f5c(0x170)];}export async function deleteDbLink(_0x5aaae5){const _0x9bce04=a158_0x2b98;await apiRequest(_0x9bce04(0x1b0),{'method':_0x9bce04(0x176),'body':{'id':_0x5aaae5}});}export async function testDbLinkConnect(_0x2af2f9){const _0x13c565=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x2af2f9}));return _0x13c565['data'];}export async function startDbAnalysis(_0xb99caa,_0x304140){const _0x2d228d=a158_0x2b98,_0x59ab8d=await apiRequest('/smartapi/db-analysis/start',{'method':_0x2d228d(0x176),'body':{'dbLinkId':_0xb99caa,..._0x304140&&_0x304140[_0x2d228d(0x1ed)]>0x0?{'tableNames':_0x304140}:{}}}),_0x38e756=_0x59ab8d[_0x2d228d(0x170)];if(typeof _0x38e756==='string')return _0x38e756;if(_0x38e756&&typeof _0x38e756===_0x2d228d(0x178)&&typeof _0x38e756[_0x2d228d(0x1c6)]==='string')return _0x38e756[_0x2d228d(0x1c6)];return _0x38e756!=null?String(_0x38e756):'';}export async function cancelDbAnalysis(_0x27a92e){const _0x3ec0fe=a158_0x2b98;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x27a92e}),{'method':_0x3ec0fe(0x176)});}export async function getDbAnalysisStatus(_0x557769){const _0x1c7ffe=a158_0x2b98,_0x576436=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x557769));return _0x576436[_0x1c7ffe(0x170)];}export async function getDbAllTableList(_0x532332,_0x37057f){const _0x4f5b1a=a158_0x2b98,_0x266111=await apiRequest(_0x4f5b1a(0x1e4)+buildQuery({'appCode':_0x532332,'dbLinkId':_0x37057f})),_0x4bddd9=_0x266111[_0x4f5b1a(0x170)];if(Array[_0x4f5b1a(0x1c8)](_0x4bddd9))return _0x4bddd9;return extractList(_0x4bddd9);}export async function getDbTableDiff(_0x490a9e,_0x570625,_0x2c032a){const _0x561806=a158_0x2b98,_0x32a0b5=await apiRequest(_0x561806(0x1d8)+buildQuery({'appCode':_0x490a9e,'dbLinkId':_0x570625,'pageIndex':_0x2c032a?.[_0x561806(0x174)]??0x1,'pageSize':_0x2c032a?.[_0x561806(0x1f5)]??0x14,'tableName':_0x2c032a?.[_0x561806(0x204)]})),_0x122719=_0x32a0b5[_0x561806(0x170)];return{'totalCount':_0x122719?.[_0x561806(0x18a)]??0x0,'physicalTableCount':_0x122719?.['physicalTableCount']??0x0,'datasetTableCount':_0x122719?.['datasetTableCount']??0x0,..._0x122719?.[_0x561806(0x1ec)]?{'summary':_0x122719[_0x561806(0x1ec)]}:{},'tableList':Array[_0x561806(0x1c8)](_0x122719?.[_0x561806(0x1ce)])?_0x122719[_0x561806(0x1ce)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x48e36d=a158_0x2b98,_0x13a92a=await apiRequest(_0x48e36d(0x1f7),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x22bc00=extractList(_0x13a92a[_0x48e36d(0x170)]),_0x2ab2f1=extractPaging(_0x13a92a['data']);return _0x2ab2f1&&_0x2ab2f1[_0x48e36d(0x18a)]>REMOTE_APP_PAGE_SIZE&&console[_0x48e36d(0x16b)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x2ab2f1['totalCount']+_0x48e36d(0x1f8)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x22bc00;}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a159_0x598435=a159_0x3a55;function a159_0xbcbf(){const _0x5bad02=['167iNroTo','2837254BSnGNd','26rrsMbs','394801NbGFAB','3393wYrJIQ','.rabetbase','bff','2027432lHAfZw','286968lxWeUJ','2770pTLTIN','10qyAiru','1462mBvmQR','516XjZWNb','9poDkxX','9756jnYmZc'];a159_0xbcbf=function(){return _0x5bad02;};return a159_0xbcbf();}(function(_0x1a2237,_0x22bd32){const _0x2388b9=a159_0x3a55,_0x4081a8=_0x1a2237();while(!![]){try{const _0x37a25e=parseInt(_0x2388b9(0x95))/0x1*(parseInt(_0x2388b9(0xa0))/0x2)+-parseInt(_0x2388b9(0x99))/0x3*(-parseInt(_0x2388b9(0xa1))/0x4)+parseInt(_0x2388b9(0x9e))/0x5*(parseInt(_0x2388b9(0xa3))/0x6)+-parseInt(_0x2388b9(0x96))/0x7+parseInt(_0x2388b9(0x9c))/0x8*(-parseInt(_0x2388b9(0xa2))/0x9)+-parseInt(_0x2388b9(0x9f))/0xa*(-parseInt(_0x2388b9(0x98))/0xb)+-parseInt(_0x2388b9(0x9d))/0xc*(parseInt(_0x2388b9(0x97))/0xd);if(_0x37a25e===_0x22bd32)break;else _0x4081a8['push'](_0x4081a8['shift']());}catch(_0x17c21a){_0x4081a8['push'](_0x4081a8['shift']());}}}(a159_0xbcbf,0x799ac));function a159_0x3a55(_0x2a5f6a,_0x1e4048){_0x2a5f6a=_0x2a5f6a-0x95;const _0xbcbf77=a159_0xbcbf();let _0x3a55af=_0xbcbf77[_0x2a5f6a];return _0x3a55af;}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a159_0x598435(0x9a),LOCK_FILE_NAME='bff.lock.json',TRASH_DIR_NAME='bff-trash';export function loadBffProjectConfig(_0x22eb42,_0xc0a22c){const _0x1d76fc=a159_0x598435,_0x3f04a6=resolve(_0xc0a22c??findProjectRootDirectory()),_0x2ebe6e=DOT_DIR+'/bff',_0x3bf051=_0x2ebe6e+'/'+_0x22eb42;return{'projectRoot':_0x3f04a6,'appCode':_0x22eb42,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x2ebe6e,'scriptsRoot':_0x3bf051,'scriptsRootDir':resolve(_0x3f04a6,DOT_DIR,_0x1d76fc(0x9b),_0x22eb42),'lockFilePath':resolve(_0x3f04a6,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x3f04a6,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a160_0x283bb8=a160_0x4b0f;(function(_0x126ad9,_0x1bedd4){const _0x566724=a160_0x4b0f,_0x47134f=_0x126ad9();while(!![]){try{const _0x11bbe8=-parseInt(_0x566724(0xac))/0x1*(-parseInt(_0x566724(0xa1))/0x2)+-parseInt(_0x566724(0x89))/0x3+parseInt(_0x566724(0x8e))/0x4*(parseInt(_0x566724(0xab))/0x5)+parseInt(_0x566724(0xa3))/0x6*(-parseInt(_0x566724(0xb0))/0x7)+-parseInt(_0x566724(0xad))/0x8*(parseInt(_0x566724(0xa5))/0x9)+-parseInt(_0x566724(0x9a))/0xa*(-parseInt(_0x566724(0x8f))/0xb)+parseInt(_0x566724(0xa6))/0xc;if(_0x11bbe8===_0x1bedd4)break;else _0x47134f['push'](_0x47134f['shift']());}catch(_0x2dbe5c){_0x47134f['push'](_0x47134f['shift']());}}}(a160_0x5169,0xe7261));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=[a160_0x283bb8(0xa2),a160_0x283bb8(0x98),a160_0x283bb8(0x8b)];export function normalizeBffType(_0x5ef641){const _0x49667a=a160_0x283bb8;if(!_0x5ef641)return undefined;const _0x1826de=_0x5ef641['trim']()[_0x49667a(0x93)]();return SUPPORTED_BFF_TYPES[_0x49667a(0x94)](_0x1826de)?_0x1826de:undefined;}async function scanJsFilesRecursively(_0x2553d0,_0x380a35){const _0x2603b4=a160_0x283bb8,_0x47a65d=[];try{const _0x193694=await readdir(_0x2553d0,{'withFileTypes':!![]});for(const _0x21665c of _0x193694){const _0x4ca501=join(_0x2553d0,_0x21665c[_0x2603b4(0xaf)]);if(_0x21665c[_0x2603b4(0x97)]())_0x47a65d[_0x2603b4(0x99)](...await scanJsFilesRecursively(_0x4ca501,_0x380a35+'/'+_0x21665c['name']));else _0x21665c[_0x2603b4(0x9e)]()&&_0x21665c[_0x2603b4(0xaf)][_0x2603b4(0xae)]('.js')&&_0x47a65d[_0x2603b4(0x99)]({'lockKey':_0x380a35+'/'+_0x21665c[_0x2603b4(0xaf)][_0x2603b4(0xa9)](/\.js$/,''),'filePath':_0x4ca501});}}catch(_0x256d2a){if(_0x256d2a[_0x2603b4(0x9d)]!==_0x2603b4(0x90))throw _0x256d2a;}return _0x47a65d;}async function scanFlatFunctions(_0x818399,_0x22bd99){const _0x1285e1=a160_0x283bb8,_0x238bbf=join(_0x818399[_0x1285e1(0x8a)],_0x22bd99),_0x481f0b=await scanJsFilesRecursively(_0x238bbf,_0x22bd99);return _0x481f0b['map'](({lockKey:_0x1074ae,filePath:_0x1f3c16})=>({'type':_0x22bd99,'name':_0x1074ae[_0x1285e1(0x91)]('/')['at'](-0x1)??'','filePath':_0x1f3c16,'lockKey':_0x1074ae}));}function a160_0x5169(){const _0x352cbf=['toUpperCase','includes','.js','afterScriptId','isDirectory','ENDPOINT','push','10MpQWCk','beforeScriptId','operationType','code','isFile','functionNode','all','614RAABTn','COMMON','293466xIBRdq','set','42741kDliZn','11759064EiTKUs','HOOK/','alias','replace','datasetCode','6144685wRKOQy','3522kSnYNj','2824hQSwqw','endsWith','name','70BzrTEO','F_OK','1260546OzcutH','scriptsRootDir','HOOK','get','scriptType','4hIhkiw','2665971rgnrvj','ENOENT','split','after'];a160_0x5169=function(){return _0x352cbf;};return a160_0x5169();}async function scanHookFunctions(_0x445599){const _0xec3114=a160_0x283bb8,_0x19ee33=join(_0x445599[_0xec3114(0x8a)],'HOOK'),_0x476f2f=[];try{const _0x40b23c=await readdir(_0x19ee33,{'withFileTypes':!![]});for(const _0x45ba5e of _0x40b23c){if(!_0x45ba5e[_0xec3114(0x97)]())continue;const _0x41ee37=_0x45ba5e[_0xec3114(0xaf)],_0x2f5571=join(_0x19ee33,_0x41ee37),_0x5f4cc7=await readdir(_0x2f5571,{'withFileTypes':!![]});for(const _0x227036 of _0x5f4cc7){if(!_0x227036[_0xec3114(0x97)]())continue;const _0x3d4fe7=_0x227036['name'],_0x13b7dd=join(_0x2f5571,_0x3d4fe7),_0x4e9823=await readdir(_0x13b7dd,{'withFileTypes':!![]});for(const _0x26659b of _0x4e9823){if(!_0x26659b[_0xec3114(0x97)]())continue;const _0x567818=_0x26659b[_0xec3114(0xaf)],_0x3ace40=join(_0x13b7dd,_0x567818),_0x15217c=await readdir(_0x3ace40,{'withFileTypes':!![]});for(const _0x52fddb of _0x15217c){if(!_0x52fddb[_0xec3114(0x9e)]()||!_0x52fddb['name'][_0xec3114(0xae)](_0xec3114(0x95)))continue;const _0x294cfe=_0x52fddb['name'][_0xec3114(0xa9)](/\.js$/,'');_0x476f2f[_0xec3114(0x99)]({'type':_0xec3114(0x8b),'name':_0x294cfe,'filePath':join(_0x3ace40,_0x52fddb[_0xec3114(0xaf)]),'lockKey':_0xec3114(0xa7)+_0x41ee37+'/'+_0x3d4fe7+'/'+_0x567818+'/'+_0x294cfe,'alias':_0x41ee37,'operationType':_0x3d4fe7,'functionNode':_0x567818});}}}}}catch(_0x106b8){if(_0x106b8[_0xec3114(0x9d)]!==_0xec3114(0x90))throw _0x106b8;}return _0x476f2f;}export async function scanLocalBffFunctions(_0x1948df,_0x2004fa){const _0x71d528=a160_0x283bb8;if(_0x2004fa===_0x71d528(0xa2)||_0x2004fa===_0x71d528(0x98))return scanFlatFunctions(_0x1948df,_0x2004fa);if(_0x2004fa===_0x71d528(0x8b))return scanHookFunctions(_0x1948df);const [_0x47be87,_0x543e53,_0x1561e6]=await Promise[_0x71d528(0xa0)]([scanFlatFunctions(_0x1948df,_0x71d528(0xa2)),scanFlatFunctions(_0x1948df,_0x71d528(0x98)),scanHookFunctions(_0x1948df)]);return[..._0x47be87,..._0x543e53,..._0x1561e6];}export function resolveLocalFilePathFromLockKey(_0xf30c61,_0x29b377){const _0x16cbf4=a160_0x283bb8;return join(_0xf30c61[_0x16cbf4(0x8a)],..._0x29b377['split']('/'))+'.js';}export function createHookLocationMap(_0x2933cc){const _0x14a6a4=a160_0x283bb8,_0x126d2d=new Map();for(const _0x4c919d of _0x2933cc){_0x4c919d[_0x14a6a4(0x9b)]&&_0x126d2d[_0x14a6a4(0xa4)](_0x4c919d[_0x14a6a4(0x9b)],{'datasetCode':_0x4c919d['datasetCode'],'operationType':snakeToCamel(_0x4c919d[_0x14a6a4(0x9c)]),'functionNode':'before'}),_0x4c919d[_0x14a6a4(0x96)]&&_0x126d2d[_0x14a6a4(0xa4)](_0x4c919d['afterScriptId'],{'datasetCode':_0x4c919d[_0x14a6a4(0xaa)],'operationType':snakeToCamel(_0x4c919d[_0x14a6a4(0x9c)]),'functionNode':_0x14a6a4(0x92)});}return _0x126d2d;}export function resolveRemoteScriptTarget(_0x4e25f2,_0x328ef5,_0x48499d,_0x513218,_0x559822){const _0x2e3f9b=a160_0x283bb8,_0x58ea2e=normalizeBffType(_0x328ef5[_0x2e3f9b(0x8d)]);if(!_0x58ea2e||!_0x328ef5['functionName'])return null;if(_0x58ea2e===_0x2e3f9b(0x8b)){const _0x3d873e=(_0x328ef5['id']?_0x48499d[_0x2e3f9b(0x8c)](_0x328ef5['id']):undefined)??findHookLocationByRemoteId(_0x513218,_0x328ef5['id']);if(!_0x3d873e)return null;const _0x360e63=_0x3d873e[_0x2e3f9b(0xa8)]||_0x559822[_0x2e3f9b(0x8c)](_0x3d873e[_0x2e3f9b(0xaa)]),_0x23ad74=_0x360e63??_0x3d873e[_0x2e3f9b(0xaa)],_0xa70c1d={..._0x3d873e,'alias':_0x360e63},_0x38a0bc=_0x2e3f9b(0xa7)+_0x23ad74+'/'+_0xa70c1d[_0x2e3f9b(0x9c)]+'/'+_0xa70c1d[_0x2e3f9b(0x9f)]+'/'+_0x328ef5['functionName'];return{'lockKey':_0x38a0bc,'filePath':resolveLocalFilePathFromLockKey(_0x4e25f2,_0x38a0bc),'type':'HOOK','hookLocation':_0xa70c1d};}const _0x1c67a0=_0x58ea2e+'/'+_0x328ef5['functionName'];return{'lockKey':_0x1c67a0,'filePath':resolveLocalFilePathFromLockKey(_0x4e25f2,_0x1c67a0),'type':_0x58ea2e};}function a160_0x4b0f(_0x4acf6c,_0xc9814f){_0x4acf6c=_0x4acf6c-0x89;const _0x5169fc=a160_0x5169();let _0x4b0f94=_0x5169fc[_0x4acf6c];return _0x4b0f94;}export async function ensureParentDirectory(_0x1ff85d){await mkdir(dirname(_0x1ff85d),{'recursive':!![]});}export async function fileExists(_0x33754b){const _0x30bea2=a160_0x283bb8;try{return await access(_0x33754b,constants[_0x30bea2(0xb1)]),!![];}catch{return![];}}export async function directoryExists(_0x155511){const _0x150145=a160_0x283bb8;try{const _0x26aebb=await stat(_0x155511);return _0x26aebb[_0x150145(0x97)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5a0bfb,_0x5cfa69){const _0x3597ec=a161_0x11d4,_0x2222a9=_0x5a0bfb();while(!![]){try{const _0x2f9f73=-parseInt(_0x3597ec(0xeb))/0x1+-parseInt(_0x3597ec(0xf5))/0x2*(-parseInt(_0x3597ec(0xf0))/0x3)+-parseInt(_0x3597ec(0xef))/0x4*(parseInt(_0x3597ec(0xea))/0x5)+parseInt(_0x3597ec(0xe8))/0x6+parseInt(_0x3597ec(0xf6))/0x7*(parseInt(_0x3597ec(0xed))/0x8)+-parseInt(_0x3597ec(0xf7))/0x9*(parseInt(_0x3597ec(0xf2))/0xa)+-parseInt(_0x3597ec(0xe9))/0xb*(-parseInt(_0x3597ec(0xf4))/0xc);if(_0x2f9f73===_0x5cfa69)break;else _0x2222a9['push'](_0x2222a9['shift']());}catch(_0x42482c){_0x2222a9['push'](_0x2222a9['shift']());}}}(a161_0x3a20,0xb038b));import{readFile}from'node:fs/promises';import a161_0x417d3b from'node:crypto';function a161_0x11d4(_0x73b063,_0x58f5b1){_0x73b063=_0x73b063-0xe7;const _0x3a20d1=a161_0x3a20();let _0x11d4d7=_0x3a20d1[_0x73b063];return _0x11d4d7;}export function computeContentHash(_0x144138){const _0x590300=a161_0x11d4;return a161_0x417d3b[_0x590300(0xe7)](_0x590300(0xee))['update'](_0x144138)[_0x590300(0xf3)](_0x590300(0xec));}function a161_0x3a20(){const _0x5d4b76=['1212706RzBAIW','hex','1044712YdiLLn','md5','76qYOnjD','516TIUGNE','utf8','200570OPDozT','digest','16044KZNbpW','3142TbnxAC','77OKpszV','270dhOPCo','createHash','20844Ygxqgj','15422PpzQuI','275900Qswwfo'];a161_0x3a20=function(){return _0x5d4b76;};return a161_0x3a20();}export async function computeFileHash(_0x413bb1){const _0x4a155f=a161_0x11d4,_0x117f9d=await readFile(_0x413bb1,_0x4a155f(0xf1));return computeContentHash(_0x117f9d);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3192b0,_0x27f5b5){const _0x44be53=a162_0x4ea8,_0x2a3673=_0x3192b0();while(!![]){try{const _0x2b05c9=parseInt(_0x44be53(0x8d))/0x1*(parseInt(_0x44be53(0x85))/0x2)+parseInt(_0x44be53(0x88))/0x3*(parseInt(_0x44be53(0x8f))/0x4)+-parseInt(_0x44be53(0x8a))/0x5+-parseInt(_0x44be53(0x8c))/0x6+-parseInt(_0x44be53(0x94))/0x7*(-parseInt(_0x44be53(0x9b))/0x8)+parseInt(_0x44be53(0x87))/0x9*(-parseInt(_0x44be53(0x96))/0xa)+parseInt(_0x44be53(0x95))/0xb*(parseInt(_0x44be53(0x90))/0xc);if(_0x2b05c9===_0x27f5b5)break;else _0x2a3673['push'](_0x2a3673['shift']());}catch(_0x225f89){_0x2a3673['push'](_0x2a3673['shift']());}}}(a162_0x49aa,0x39b54));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x2a6d5e,_0x276291,_0x5c1a96,_0x3b0bb4){const _0x5d2fb7=a162_0x4ea8,_0x4fe597={'apps':_0x2a6d5e[_0x5d2fb7(0x91)]&&typeof _0x2a6d5e[_0x5d2fb7(0x91)]===_0x5d2fb7(0x98)?_0x2a6d5e[_0x5d2fb7(0x91)]:{}};let _0x707c41=_0x4fe597[_0x5d2fb7(0x91)][_0x276291];if(!_0x707c41)return _0x707c41={'scriptsRoot':_0x5c1a96,'lastSync':'','functions':{}},_0x4fe597[_0x5d2fb7(0x91)][_0x276291]=_0x707c41,{'lockData':_0x4fe597,'appLock':_0x707c41};if(!_0x707c41[_0x5d2fb7(0x86)])_0x707c41[_0x5d2fb7(0x86)]=_0x5c1a96;else{if(_0x707c41[_0x5d2fb7(0x86)]!==_0x5c1a96)throw new Error(_0x3b0bb4+':\x20scriptsRoot\x20mismatch\x20—\x20'+('current\x20\x22'+_0x5c1a96+'\x22\x20vs\x20lock\x20\x22'+_0x707c41[_0x5d2fb7(0x86)]+'\x22.\x20')+_0x5d2fb7(0x99));}return!_0x707c41['functions']&&(_0x707c41[_0x5d2fb7(0x8e)]={}),!_0x707c41[_0x5d2fb7(0x8b)]&&(_0x707c41[_0x5d2fb7(0x8b)]=''),{'lockData':_0x4fe597,'appLock':_0x707c41};}export async function readBffLockFile(_0x18b247){const _0x585342=a162_0x4ea8;try{const _0x2bd7eb=await readFile(_0x18b247,_0x585342(0x97)),_0x3fe546=JSON[_0x585342(0x92)](_0x2bd7eb);return{'apps':_0x3fe546['apps']&&typeof _0x3fe546[_0x585342(0x91)]===_0x585342(0x98)?_0x3fe546[_0x585342(0x91)]:{}};}catch(_0x55b569){if(_0x55b569[_0x585342(0x93)]===_0x585342(0x84))return null;throw new Error(_0x585342(0x9a)+String(_0x55b569));}}function a162_0x4ea8(_0x38b298,_0x8662cf){_0x38b298=_0x38b298-0x84;const _0x49aa2f=a162_0x49aa();let _0x4ea8ed=_0x49aa2f[_0x38b298];return _0x4ea8ed;}function a162_0x49aa(){const _0x2a4fbf=['utf8','object','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','4880FddHKM','ENOENT','262rrjzNH','scriptsRoot','288zUqkAE','1404ZfjpPz','stringify','520275YYClaB','lastSync','2223888lfyDlT','1186guebcO','functions','244Lqlrrh','12lRCTBv','apps','parse','code','1057jvecFy','8528729ZqyOaU','106340wnWoii'];a162_0x49aa=function(){return _0x2a4fbf;};return a162_0x49aa();}export async function writeBffLockFile(_0x2e2a84,_0x1edf9a){const _0x32f3fc=a162_0x4ea8;await mkdir(dirname(_0x2e2a84),{'recursive':!![]}),await writeFile(_0x2e2a84,JSON[_0x32f3fc(0x89)](_0x1edf9a,null,0x2),_0x32f3fc(0x97));}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a164_0x193f(_0x1ae3d6,_0x41d634){_0x1ae3d6=_0x1ae3d6-0xf6;const _0x2b2fb7=a164_0x2b2f();let _0x193f72=_0x2b2fb7[_0x1ae3d6];return _0x193f72;}(function(_0x501091,_0x5855b0){const _0x2e56a8=a164_0x193f,_0x4ff2e5=_0x501091();while(!![]){try{const _0x2b4142=-parseInt(_0x2e56a8(0x106))/0x1+-parseInt(_0x2e56a8(0xfa))/0x2+parseInt(_0x2e56a8(0xf8))/0x3*(parseInt(_0x2e56a8(0x109))/0x4)+parseInt(_0x2e56a8(0x102))/0x5*(parseInt(_0x2e56a8(0x100))/0x6)+parseInt(_0x2e56a8(0x103))/0x7*(-parseInt(_0x2e56a8(0xfd))/0x8)+-parseInt(_0x2e56a8(0xfb))/0x9+parseInt(_0x2e56a8(0x10a))/0xa*(parseInt(_0x2e56a8(0xf6))/0xb);if(_0x2b4142===_0x5855b0)break;else _0x4ff2e5['push'](_0x4ff2e5['shift']());}catch(_0x4f7f9c){_0x4ff2e5['push'](_0x4ff2e5['shift']());}}}(a164_0x2b2f,0x7e935));export function snakeToCamel(_0x142502){const _0x5a7404=a164_0x193f;return _0x142502['toLowerCase']()['replace'](/_([a-z])/g,(_0x665385,_0x3f22ae)=>_0x3f22ae[_0x5a7404(0xfc)]());}function a164_0x2b2f(){const _0x41c204=['trim','6nNgCDD','remoteId','989125ZQGQpF','2431625HeCoHG','before','values','439296IpkziF','operationType','test','28ZKKotX','84780SoblwF','1793MbYSQw','after','132558Cvwpod','match','444226CFhEaP','129861ewCRFY','toUpperCase','16VSfKZn','functionNode'];a164_0x2b2f=function(){return _0x41c204;};return a164_0x2b2f();}export function findHookLocationByRemoteId(_0xdbfa2c,_0x262b8b){const _0x1e0c71=a164_0x193f;if(!_0x262b8b)return undefined;for(const _0x126263 of Object[_0x1e0c71(0x105)](_0xdbfa2c)){if(_0x126263[_0x1e0c71(0x101)]===_0x262b8b&&_0x126263['datasetCode']&&_0x126263[_0x1e0c71(0x107)]&&_0x126263[_0x1e0c71(0xfe)])return{'datasetCode':_0x126263['datasetCode'],'operationType':_0x126263['operationType'],'functionNode':_0x126263[_0x1e0c71(0xfe)]};}return undefined;}export function extractScriptDescription(_0x3b8d6e){const _0x15c461=a164_0x193f,_0x56b483=_0x3b8d6e[_0x15c461(0xf9)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x56b483?.[0x1]?.[_0x15c461(0xff)]()||undefined;}export function isValidBffFunctionName(_0x482fde){const _0x473799=a164_0x193f;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x473799(0x108)](_0x482fde);}export function normalizeHookFunctionNode(_0x2fcdfa){const _0x1ac200=a164_0x193f;if(!_0x2fcdfa)return undefined;const _0xac95f3=_0x2fcdfa[_0x1ac200(0xff)]()['toLowerCase']();if(_0xac95f3===_0x1ac200(0x104)||_0xac95f3===_0x1ac200(0xf7))return _0xac95f3;return undefined;}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x363369,_0x553422){const _0x3f2a4c=a165_0xfa7e,_0x28d558=_0x363369();while(!![]){try{const _0xb9b0dc=parseInt(_0x3f2a4c(0x1bb))/0x1+-parseInt(_0x3f2a4c(0x1b5))/0x2+-parseInt(_0x3f2a4c(0x1ba))/0x3*(-parseInt(_0x3f2a4c(0x1c5))/0x4)+parseInt(_0x3f2a4c(0x1b8))/0x5+parseInt(_0x3f2a4c(0x1ad))/0x6*(parseInt(_0x3f2a4c(0x1b2))/0x7)+parseInt(_0x3f2a4c(0x1b7))/0x8*(-parseInt(_0x3f2a4c(0x1ae))/0x9)+-parseInt(_0x3f2a4c(0x1b4))/0xa;if(_0xb9b0dc===_0x553422)break;else _0x28d558['push'](_0x28d558['shift']());}catch(_0x222649){_0x28d558['push'](_0x28d558['shift']());}}}(a165_0x2dd2,0x77d05));function a165_0xfa7e(_0x2d0b54,_0x3ac70f){_0x2d0b54=_0x2d0b54-0x1ad;const _0x2dd263=a165_0x2dd2();let _0xfa7e02=_0x2dd263[_0x2d0b54];return _0xfa7e02;}import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x192213){const _0x3480b7=a165_0xfa7e;if(cache[_0x3480b7(0x1bd)](_0x192213))return cache[_0x3480b7(0x1b0)](_0x192213);const _0x388c9e=await listDatasets(_0x192213),_0x2d5b7c=new Map();for(const _0x44fd67 of _0x388c9e){const _0x10f923=_0x44fd67[_0x3480b7(0x1c7)];_0x10f923?.[_0x3480b7(0x1b6)]!=null&&_0x2d5b7c[_0x3480b7(0x1c4)](_0x10f923[_0x3480b7(0x1b6)],_0x10f923[_0x3480b7(0x1c0)]??'db-'+_0x10f923[_0x3480b7(0x1b6)]);}const _0x11b2e3=[..._0x2d5b7c['entries']()][_0x3480b7(0x1c9)](([_0x5614d1,_0x28788a])=>({'dbId':_0x5614d1,'dbName':_0x28788a}));return cache[_0x3480b7(0x1c4)](_0x192213,_0x11b2e3),_0x11b2e3;}export async function resolveDb(_0x41b9d5,_0x1ef24a){const _0xd24652=a165_0xfa7e,_0x7cefaa=await listDatabases(_0x41b9d5);if(_0x7cefaa[_0xd24652(0x1be)]===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20under\x20app\x20\x22'+_0x41b9d5+_0xd24652(0x1c2)};if(!_0x1ef24a)return{'resolved':_0x7cefaa};const _0xf8801b=Number(_0x1ef24a);if(!Number[_0xd24652(0x1b9)](_0xf8801b)){const _0x607eb0=_0x7cefaa['find'](_0x306810=>_0x306810[_0xd24652(0x1b6)]===_0xf8801b);if(_0x607eb0)return{'resolved':[_0x607eb0]};}const _0x5872d3=_0x1ef24a[_0xd24652(0x1c6)](),_0x508389=_0x7cefaa[_0xd24652(0x1bf)](_0x9dce3d=>_0x9dce3d['dbName']['toLowerCase']()[_0xd24652(0x1b3)](_0x5872d3));if(_0x508389[_0xd24652(0x1be)]>0x0)return{'resolved':_0x508389};const _0x5068f9=_0x7cefaa[_0xd24652(0x1c9)](_0x3a2363=>_0x3a2363[_0xd24652(0x1c0)]+'\x20('+_0x3a2363[_0xd24652(0x1b6)]+')')[_0xd24652(0x1b1)](',\x20');return{'resolved':[],'error':_0xd24652(0x1bc)+_0x1ef24a+'\x22\x20under\x20app\x20\x22'+_0x41b9d5+'\x22.\x20Available:\x20'+_0x5068f9+_0xd24652(0x1c8)};}function a165_0x2dd2(){const _0x3584d9=['includes','165540VIgkRC','1727568MAeWlZ','dbId','6304zONXNd','412155qTmupP','isNaN','586929uObDZA','203121aCsaWd','No\x20database\x20matching\x20\x22','has','length','filter','dbName','.\x20Be\x20more\x20specific.','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','\x22\x20matches\x20multiple\x20databases:\x20','set','8OWmFwt','toLowerCase','dbtableConfig','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','map','5068590vtaFXh','1719SFYRzm','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','get','join','7iVdDVs'];a165_0x2dd2=function(){return _0x3584d9;};return a165_0x2dd2();}export async function resolveOneDb(_0xb16722,_0x3ed52d){const _0x12e35c=a165_0xfa7e,{resolved:_0x5e46a9,error:_0x3eae45}=await resolveDb(_0xb16722,_0x3ed52d);if(_0x3eae45)return{'db':null,'error':_0x3eae45};if(_0x5e46a9[_0x12e35c(0x1be)]===0x1)return{'db':_0x5e46a9[0x0]};if(!_0x3ed52d){const _0x34deaa=_0x5e46a9[_0x12e35c(0x1c9)](_0x5cbbca=>_0x5cbbca[_0x12e35c(0x1c0)]+'\x20('+_0x5cbbca[_0x12e35c(0x1b6)]+')')[_0x12e35c(0x1b1)](',\x20');return{'db':null,'error':_0x12e35c(0x1af)+_0x34deaa};}const _0x42717a=_0x5e46a9[_0x12e35c(0x1c9)](_0x1e68ee=>_0x1e68ee[_0x12e35c(0x1c0)]+'\x20('+_0x1e68ee[_0x12e35c(0x1b6)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x3ed52d+_0x12e35c(0x1c3)+_0x42717a+_0x12e35c(0x1c1)};}export async function getDbName(_0x1e1107,_0x35e833){const _0x350a7e=a165_0xfa7e,_0x90b03=await listDatabases(_0x1e1107);return _0x90b03['find'](_0x4c82c6=>_0x4c82c6[_0x350a7e(0x1b6)]===_0x35e833)?.[_0x350a7e(0x1c0)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a166_0x1003(_0x43dfd0,_0x14cf6f){_0x43dfd0=_0x43dfd0-0xce;const _0x18940a=a166_0x1894();let _0x10035b=_0x18940a[_0x43dfd0];return _0x10035b;}(function(_0x49cede,_0x2e1b12){const _0x44c6f5=a166_0x1003,_0x53c1e6=_0x49cede();while(!![]){try{const _0x25f13e=parseInt(_0x44c6f5(0xdb))/0x1*(parseInt(_0x44c6f5(0xda))/0x2)+parseInt(_0x44c6f5(0xcf))/0x3*(parseInt(_0x44c6f5(0xce))/0x4)+parseInt(_0x44c6f5(0xd7))/0x5+parseInt(_0x44c6f5(0xd9))/0x6*(parseInt(_0x44c6f5(0xd2))/0x7)+-parseInt(_0x44c6f5(0xdd))/0x8*(parseInt(_0x44c6f5(0xd3))/0x9)+-parseInt(_0x44c6f5(0xd8))/0xa*(parseInt(_0x44c6f5(0xd5))/0xb)+-parseInt(_0x44c6f5(0xd4))/0xc*(parseInt(_0x44c6f5(0xd1))/0xd);if(_0x25f13e===_0x2e1b12)break;else _0x53c1e6['push'](_0x53c1e6['shift']());}catch(_0x52934d){_0x53c1e6['push'](_0x53c1e6['shift']());}}}(a166_0x1894,0xa4318));import{constants}from'node:fs';function a166_0x1894(){const _0x243dc2=['29603QUJZut','3735Wjlqxf','23193096mIbxuQ','4625522TBhbis','appPagesDir','4127490yvRGIe','30UePNLL','1782OADvuT','2LmcsxK','924247AwYlwE','.rabetbase','1720LWnwNe','page','35524HBjkmH','321uJtOOS','F_OK','13wXdyql'];a166_0x1894=function(){return _0x243dc2;};return a166_0x1894();}import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x510dbd,_0x1271f6=process['cwd']()){const _0x4ae482=a166_0x1003,_0x2911ed=resolve(_0x1271f6),_0x3bd799=join(_0x2911ed,_0x4ae482(0xdc),_0x4ae482(0xde));return{'projectRoot':_0x2911ed,'pagesBaseDir':_0x3bd799,'appPagesDir':join(_0x3bd799,_0x510dbd),'lockFilePath':join(_0x2911ed,'.rabetbase','page.lock.json')};}export function buildPageFileName(_0x4dd123,_0x281ef0){return _0x4dd123+'-'+String(_0x281ef0)['toUpperCase']()+'.json';}export function resolvePageFilePath(_0x349886,_0x5f4889,_0x3c00df){const _0x3a110b=a166_0x1003;return join(_0x349886[_0x3a110b(0xd6)],buildPageFileName(_0x5f4889,_0x3c00df));}export async function ensureParentDirectory(_0x96abaf){await mkdir(dirname(_0x96abaf),{'recursive':!![]});}export async function fileExists(_0x466523){const _0x41e55f=a166_0x1003;try{return await access(_0x466523,constants[_0x41e55f(0xd0)]),!![];}catch{return![];}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xbeb939,_0xf66a4a){const _0x4238bc=a167_0x4d5b,_0x593a6e=_0xbeb939();while(!![]){try{const _0xdd9e30=-parseInt(_0x4238bc(0x11e))/0x1+parseInt(_0x4238bc(0x116))/0x2+parseInt(_0x4238bc(0x119))/0x3+parseInt(_0x4238bc(0x114))/0x4+parseInt(_0x4238bc(0x11c))/0x5+parseInt(_0x4238bc(0x117))/0x6*(-parseInt(_0x4238bc(0x112))/0x7)+parseInt(_0x4238bc(0x118))/0x8*(-parseInt(_0x4238bc(0x122))/0x9);if(_0xdd9e30===_0xf66a4a)break;else _0x593a6e['push'](_0x593a6e['shift']());}catch(_0x4e3dd2){_0x593a6e['push'](_0x593a6e['shift']());}}}(a167_0x2495,0x5f62d));import a167_0x5105c6 from'node:crypto';function a167_0x2495(){const _0x392250=['update','24949FEERPq','parse','createHash','stringify','1089117FNMZvT','5117EnqxYE','digest','2300444JKIZYc','utf8','1521360OwHKAp','282freoCO','128eSmbEk','1795338jzzEfo','hex','md5','2259890EPbJwN'];a167_0x2495=function(){return _0x392250;};return a167_0x2495();}import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x5e7055){const _0x1aa983=a167_0x4d5b;return JSON[_0x1aa983(0x121)](JSON[_0x1aa983(0x11f)](_0x5e7055),null,0x2)+'\x0a';}export function computePageContentHash(_0x46f134){const _0x48ef3b=a167_0x4d5b;return a167_0x5105c6[_0x48ef3b(0x120)](_0x48ef3b(0x11b))[_0x48ef3b(0x11d)](_0x46f134)[_0x48ef3b(0x113)](_0x48ef3b(0x11a));}export function computeSerializedSchemaHash(_0x1ceb55){return computePageContentHash(serializePageSchemaForFile(_0x1ceb55));}function a167_0x4d5b(_0x211edd,_0x28e310){_0x211edd=_0x211edd-0x112;const _0x2495e8=a167_0x2495();let _0x4d5b99=_0x2495e8[_0x211edd];return _0x4d5b99;}export async function computePageFileHash(_0x211fbf){const _0x22630c=a167_0x4d5b,_0x996ed=await readFile(_0x211fbf,_0x22630c(0x115));return computePageContentHash(_0x996ed);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x14e7fa,_0x5df209){const _0xf19e10=a168_0x204b,_0x3723a5=_0x14e7fa();while(!![]){try{const _0x510281=-parseInt(_0xf19e10(0x1f5))/0x1+parseInt(_0xf19e10(0x1f1))/0x2*(parseInt(_0xf19e10(0x1ea))/0x3)+-parseInt(_0xf19e10(0x1e9))/0x4+-parseInt(_0xf19e10(0x1e8))/0x5+parseInt(_0xf19e10(0x1f3))/0x6+-parseInt(_0xf19e10(0x1f2))/0x7*(parseInt(_0xf19e10(0x1f0))/0x8)+parseInt(_0xf19e10(0x1f7))/0x9*(parseInt(_0xf19e10(0x1ee))/0xa);if(_0x510281===_0x5df209)break;else _0x3723a5['push'](_0x3723a5['shift']());}catch(_0x4af716){_0x3723a5['push'](_0x3723a5['shift']());}}}(a168_0x2021,0xb733f));function a168_0x2021(){const _0x111114=['lastSync','7734843pLtNiK','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','parse','5916595EFipuO','2541476BhhYlZ','6PqXXOG','object','apps','pages','40KVOwfy','utf8','56vjBwaG','173330ALHPNj','475678beOcen','1034634izMDJS','code','738712SXJtvN'];a168_0x2021=function(){return _0x111114;};return a168_0x2021();}function a168_0x204b(_0x43ac33,_0x57f3fe){_0x43ac33=_0x43ac33-0x1e6;const _0x2021bc=a168_0x2021();let _0x204b40=_0x2021bc[_0x43ac33];return _0x204b40;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x27bae2,_0x1d2590){const _0x1d5fde=a168_0x204b,_0xea283b={'apps':_0x27bae2['apps']&&typeof _0x27bae2[_0x1d5fde(0x1ec)]===_0x1d5fde(0x1eb)?_0x27bae2[_0x1d5fde(0x1ec)]:{}};let _0x1f18b5=_0xea283b[_0x1d5fde(0x1ec)][_0x1d2590];if(!_0x1f18b5)return _0x1f18b5={'lastSync':'','pages':{}},_0xea283b[_0x1d5fde(0x1ec)][_0x1d2590]=_0x1f18b5,{'lockData':_0xea283b,'appLock':_0x1f18b5};return!_0x1f18b5[_0x1d5fde(0x1f6)]&&(_0x1f18b5[_0x1d5fde(0x1f6)]=''),(!_0x1f18b5[_0x1d5fde(0x1ed)]||typeof _0x1f18b5[_0x1d5fde(0x1ed)]!=='object')&&(_0x1f18b5['pages']={}),{'lockData':_0xea283b,'appLock':_0x1f18b5};}export async function readPageLockFile(_0x34920d){const _0x200f93=a168_0x204b;try{const _0x4f923e=await readFile(_0x34920d,'utf8'),_0x564426=JSON[_0x200f93(0x1e7)](_0x4f923e);return{'apps':_0x564426[_0x200f93(0x1ec)]&&typeof _0x564426[_0x200f93(0x1ec)]===_0x200f93(0x1eb)?_0x564426[_0x200f93(0x1ec)]:{}};}catch(_0x1e1013){if(_0x1e1013[_0x200f93(0x1f4)]==='ENOENT')return null;throw new Error(_0x200f93(0x1e6)+String(_0x1e1013));}}export async function writePageLockFile(_0x269cf6,_0x3d24d9){const _0x40e878=a168_0x204b;await mkdir(dirname(_0x269cf6),{'recursive':!![]}),await writeFile(_0x269cf6,JSON['stringify'](_0x3d24d9,null,0x2),_0x40e878(0x1ef));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a170_0x4ec577=a170_0x57bd;function a170_0x57bd(_0x4f8b2a,_0xd31d0a){_0x4f8b2a=_0x4f8b2a-0x1ea;const _0x1ea0c9=a170_0x1ea0();let _0x57bd43=_0x1ea0c9[_0x4f8b2a];return _0x57bd43;}(function(_0x471c05,_0x1fe469){const _0x5be257=a170_0x57bd,_0x329ba5=_0x471c05();while(!![]){try{const _0x22e045=-parseInt(_0x5be257(0x1ef))/0x1+parseInt(_0x5be257(0x1f1))/0x2+-parseInt(_0x5be257(0x1ea))/0x3+parseInt(_0x5be257(0x1ed))/0x4*(parseInt(_0x5be257(0x1eb))/0x5)+parseInt(_0x5be257(0x1ec))/0x6+-parseInt(_0x5be257(0x1f6))/0x7*(parseInt(_0x5be257(0x1f8))/0x8)+-parseInt(_0x5be257(0x1f5))/0x9*(-parseInt(_0x5be257(0x1ee))/0xa);if(_0x22e045===_0x1fe469)break;else _0x329ba5['push'](_0x329ba5['shift']());}catch(_0x409666){_0x329ba5['push'](_0x329ba5['shift']());}}}(a170_0x1ea0,0x70ef8));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a170_0x4ec577(0x1f4),LOCK_FILE_NAME=a170_0x4ec577(0x1f2),TRASH_DIR_NAME=a170_0x4ec577(0x1f7);function a170_0x1ea0(){const _0x3fd07f=['sql','.rabetbase','22625901pGsSvX','14BnFpaM','sql-trash','2769608mMxBMW','2050185teYpJN','125JehxZg','581832ZUUpbS','2140WymTOU','10STdoqu','907540AWEvHY','/sql','243170XxcmaL','sql.lock.json'];a170_0x1ea0=function(){return _0x3fd07f;};return a170_0x1ea0();}export function loadSqlProjectConfig(_0x13bdaf,_0x42b7df){const _0x3273ef=a170_0x4ec577,_0x511915=resolve(_0x42b7df??findProjectRootDirectory()),_0x2a2759=DOT_DIR+_0x3273ef(0x1f0),_0x1db01d=_0x2a2759+'/'+_0x13bdaf;return{'projectRoot':_0x511915,'appCode':_0x13bdaf,'sqlWorkspaceRoot':_0x2a2759,'sqlRoot':_0x1db01d,'sqlRootDir':resolve(_0x511915,DOT_DIR,_0x3273ef(0x1f3),_0x13bdaf),'lockFilePath':resolve(_0x511915,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x511915,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b1864,_0x10061e){const _0x4bff92=a171_0x2e0d,_0x213202=_0x2b1864();while(!![]){try{const _0xc315f0=-parseInt(_0x4bff92(0x11f))/0x1*(-parseInt(_0x4bff92(0x11e))/0x2)+parseInt(_0x4bff92(0x121))/0x3*(-parseInt(_0x4bff92(0x118))/0x4)+parseInt(_0x4bff92(0x11c))/0x5*(-parseInt(_0x4bff92(0x111))/0x6)+-parseInt(_0x4bff92(0x115))/0x7+parseInt(_0x4bff92(0x106))/0x8+-parseInt(_0x4bff92(0x113))/0x9+parseInt(_0x4bff92(0x109))/0xa*(parseInt(_0x4bff92(0x125))/0xb);if(_0xc315f0===_0x10061e)break;else _0x213202['push'](_0x213202['shift']());}catch(_0x441703){_0x213202['push'](_0x213202['shift']());}}}(a171_0x5885,0x32c84));import{readdir,stat}from'node:fs/promises';function a171_0x2e0d(_0x427ce3,_0x1791cc){_0x427ce3=_0x427ce3-0x106;const _0x588583=a171_0x5885();let _0x2e0da8=_0x588583[_0x427ce3];return _0x2e0da8;}import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x59e5d6){const _0xb2345e=a171_0x2e0d;if(_0x59e5d6===_0xb2345e(0x107))return _0xb2345e(0x10c);if(_0x59e5d6===_0xb2345e(0x122))return _0xb2345e(0x114);return undefined;}async function scanSqlFilesRecursively(_0xfc522,_0x4a71cb){const _0x159781=a171_0x2e0d,_0x4d6296=[];try{const _0x5fbf27=await readdir(_0xfc522,{'withFileTypes':!![]});for(const _0x5ee246 of _0x5fbf27){const _0x3e2e93=join(_0xfc522,_0x5ee246[_0x159781(0x119)]);if(_0x5ee246[_0x159781(0x10f)]()){_0x4d6296[_0x159781(0x10a)](...await scanSqlFilesRecursively(_0x3e2e93,_0x4a71cb));continue;}if(!_0x5ee246[_0x159781(0x10b)]())continue;const _0x314b1c=extname(_0x5ee246[_0x159781(0x119)])[_0x159781(0x11b)](),_0x7efe2d=extensionToMode(_0x314b1c);if(!_0x7efe2d)continue;const _0x2c3f12=relative(_0x4a71cb,_0x3e2e93)[_0x159781(0x11a)](/\\/g,'/'),_0x3a2071=_0x2c3f12['split']('/')[_0x159781(0x126)](Boolean),_0x9acd2b=parseSqlPath(_0x3a2071,_0x5ee246[_0x159781(0x119)],_0x314b1c);if(!_0x9acd2b)continue;_0x4d6296[_0x159781(0x10a)]({'sqlCode':_0x9acd2b[_0x159781(0x11d)],'sqlName':_0x9acd2b['sqlName'],'dbDirectory':_0x3a2071[0x0],'filePath':_0x3e2e93,'relativePath':_0x2c3f12,'lockKey':_0x9acd2b[_0x159781(0x11d)],'mode':_0x7efe2d});}}catch(_0x22a23a){if(_0x22a23a[_0x159781(0x123)]!=='ENOENT')throw _0x22a23a;}return _0x4d6296;}export async function scanLocalSqlQueries(_0x1fca2d){const _0x461391=a171_0x2e0d;return scanSqlFilesRecursively(_0x1fca2d[_0x461391(0x110)],_0x1fca2d[_0x461391(0x110)]);}function a171_0x5885(){const _0x37bab7=['51kYhUBO','.xml','code','test','11VUFewA','filter','1002808cmJsER','.sql','mode','8612980uwiCLC','push','isFile','sql','slice','length','isDirectory','sqlRootDir','6CfjFiX','indexOf','1300104XGXnGQ','mybatisXml','2360253puZHti','path','sqlName','92348kTQApS','name','replace','toLowerCase','697610GDzCwl','sqlCode','469982ELxqZR','1bkpQvr','dbId'];a171_0x5885=function(){return _0x37bab7;};return a171_0x5885();}export function resolveLocalSqlFilePath(_0x2eb6eb,_0xc7ae2e,_0x17517e){const _0x513c89=a171_0x2e0d,_0x33ed4d=_0x17517e?.[_0x513c89(0x116)]||(_0x17517e?.['sqlName']||_0x17517e?.['dbName']?buildSqlRelativePath(_0xc7ae2e,_0x17517e?.[_0x513c89(0x117)],_0x17517e?.['dbName'],_0x17517e?.[_0x513c89(0x108)]||_0x513c89(0x10c),_0x17517e?.[_0x513c89(0x120)]):buildDefaultSqlFileName(_0xc7ae2e,_0x17517e?.['mode']||_0x513c89(0x10c)));return join(_0x2eb6eb[_0x513c89(0x110)],_0x33ed4d);}export async function directoryExists(_0x3427b2){const _0x5b035a=a171_0x2e0d;try{const _0x44299b=await stat(_0x3427b2);return _0x44299b[_0x5b035a(0x10f)]();}catch{return![];}}function parseSqlPath(_0x2eb17d,_0x3af92f,_0x13a8cb){const _0x3c1974=a171_0x2e0d,_0x8995a1=_0x3af92f[_0x3c1974(0x10d)](0x0,-_0x13a8cb[_0x3c1974(0x10e)]);if(_0x2eb17d[_0x3c1974(0x10e)]<0x2)return null;const _0x4d3510=_0x8995a1[_0x3c1974(0x112)]('_');if(_0x4d3510<=0x0||_0x4d3510>=_0x8995a1['length']-0x1)return null;const _0x2bd8db=_0x8995a1[_0x3c1974(0x10d)](0x0,_0x4d3510);if(!isLikelySqlCode(_0x2bd8db))return null;return{'sqlCode':_0x2bd8db,'sqlName':_0x8995a1[_0x3c1974(0x10d)](_0x4d3510+0x1)};}function isLikelySqlCode(_0x3f37b6){const _0x46673d=a171_0x2e0d;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x46673d(0x124)](_0x3f37b6);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4150d7,_0x3925e5){const _0x5a64a8=a172_0x15bd,_0x1a896b=_0x4150d7();while(!![]){try{const _0x15da96=parseInt(_0x5a64a8(0x1f7))/0x1*(parseInt(_0x5a64a8(0x1fa))/0x2)+parseInt(_0x5a64a8(0x1fc))/0x3*(-parseInt(_0x5a64a8(0x1f5))/0x4)+-parseInt(_0x5a64a8(0x1f4))/0x5*(-parseInt(_0x5a64a8(0x1fe))/0x6)+parseInt(_0x5a64a8(0x1f3))/0x7+-parseInt(_0x5a64a8(0x1f2))/0x8*(parseInt(_0x5a64a8(0x1f6))/0x9)+parseInt(_0x5a64a8(0x1f8))/0xa*(-parseInt(_0x5a64a8(0x1fd))/0xb)+parseInt(_0x5a64a8(0x1fb))/0xc*(parseInt(_0x5a64a8(0x1f9))/0xd);if(_0x15da96===_0x3925e5)break;else _0x1a896b['push'](_0x1a896b['shift']());}catch(_0x27716b){_0x1a896b['push'](_0x1a896b['shift']());}}}(a172_0x6bb6,0xa3f8c));function a172_0x15bd(_0x627b0d,_0xa0a39b){_0x627b0d=_0x627b0d-0x1f2;const _0x6bb664=a172_0x6bb6();let _0x15bdfe=_0x6bb664[_0x627b0d];return _0x15bdfe;}import{readFile}from'node:fs/promises';import a172_0x5aaf7c from'node:crypto';export function computeSqlContentHash(_0x318859){return a172_0x5aaf7c['createHash']('md5')['update'](_0x318859)['digest']('hex');}export async function computeSqlFileHash(_0x3e8a56){const _0x586c4f=await readFile(_0x3e8a56,'utf8');return computeSqlContentHash(_0x586c4f);}function a172_0x6bb6(){const _0x4fe6f1=['6QPKLWZ','5552ddOsJd','4364703zIMyhW','201665AVuNwM','821732DruKag','36orGLOL','6132wdmnQf','6069520iPHMjY','581217icDZLF','108jVJekD','132SLbDbj','3jUdrpF','11XfTJWy'];a172_0x6bb6=function(){return _0x4fe6f1;};return a172_0x6bb6();}
|