@lovrabet/rabetbase-cli 2.2.5-beta.1 → 2.2.5-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 +1 -1
- 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/use.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-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/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-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 -0
- 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/skill/index.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 +1 -1
- package/templates/README.md +15 -25
- package/templates/generate-api/api.ts.tpl +2 -2
- package/templates/generate-api/client.ts.tpl +2 -2
- package/templates/projects/sub-app-react-demo/CHANGELOG.md +15 -1
- package/templates/projects/sub-app-react-demo/README.md +159 -231
- package/templates/projects/sub-app-react-demo/docs/quick-start.md +145 -426
- package/templates/projects/sub-app-react-demo/src/api/api.ts +8 -65
- package/templates/projects/sub-app-react-demo/src/api/client.ts +10 -42
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +28 -0
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +55 -0
- package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +6 -9
- package/templates/projects/sub-app-react-demo/src/main.tsx +10 -6
- package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +3 -5
- package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +153 -148
- package/templates/projects/sub-app-react-demo/src/pages/index.module.css +500 -0
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +517 -343
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +325 -242
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +8 -6
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +174 -87
- package/templates/projects/sub-app-react-demo/src/style.css +19 -3
- package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +1 -1
- package/templates/projects/sub-app-react-demo/docs/API_RULE_CHANGE.md +0 -212
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x259117,_0x517754){const _0x259f2e=a156_0x4262,_0x2370c9=_0x259117();while(!![]){try{const _0x595eb3=-parseInt(_0x259f2e(0xa3))/0x1*(parseInt(_0x259f2e(0x83))/0x2)+-parseInt(_0x259f2e(0xc7))/0x3+parseInt(_0x259f2e(0x67))/0x4*(-parseInt(_0x259f2e(0xbd))/0x5)+-parseInt(_0x259f2e(0x82))/0x6*(-parseInt(_0x259f2e(0xf6))/0x7)+-parseInt(_0x259f2e(0xa2))/0x8+parseInt(_0x259f2e(0x10a))/0x9+parseInt(_0x259f2e(0xa8))/0xa;if(_0x595eb3===_0x517754)break;else _0x2370c9['push'](_0x2370c9['shift']());}catch(_0x15cb33){_0x2370c9['push'](_0x2370c9['shift']());}}}(a156_0x27d4,0x3efb5));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(_0x3cbb32){_activeCookie=_0x3cbb32||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0;function createFetchFailureError(_0x49b655,_0x522cbe){const _0x19cc2a=a156_0x4262,_0x38c30f=_0x522cbe instanceof Error?_0x522cbe[_0x19cc2a(0x86)]:String(_0x522cbe);return CliErrors[_0x19cc2a(0x87)](_0x19cc2a(0x89)+_0x49b655+(_0x38c30f?'\x20('+_0x38c30f+')':''),_0x19cc2a(0xf7));}async function apiRequest(_0x304685,_0x25ab6f={}){const _0x1ed5d4=a156_0x4262,{method:method=_0x1ed5d4(0xee),body:_0x19599c,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x25ab6f,_0x508048=useRuntime?getRuntimeDomain():getApiDomain(),_0x272447=_activeCookie||getCookie(),_0x2e75b4=''+_0x508048+_0x304685,_0x174928=new AbortController(),_0x2a7e16=setTimeout(()=>_0x174928['abort'](),timeout);try{const _0x11f2a9=await fetch(_0x2e75b4,{'method':method,'headers':{'Content-Type':_0x1ed5d4(0x109),'Cookie':_0x272447,'X-Invoke-Source':_0x1ed5d4(0xc8),...headers},'body':_0x19599c?JSON[_0x1ed5d4(0xa6)](_0x19599c):undefined,'signal':_0x174928['signal']});let _0x45dd3f;try{_0x45dd3f=await _0x11f2a9[_0x1ed5d4(0xd0)]();}catch(_0x267e87){if(_0x267e87 instanceof Error&&_0x267e87['name']===_0x1ed5d4(0x110))throw CliErrors['apiError'](_0x1ed5d4(0xfc)+_0x2e75b4);if(_0x11f2a9['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x1ed5d4(0x87)](_0x1ed5d4(0x8a)+_0x11f2a9['status']+')',_0x11f2a9['status']>=0x190?_0x1ed5d4(0xe9):undefined);}if(!_0x11f2a9['ok']||_0x45dd3f[_0x1ed5d4(0xe0)]===![])throw CliErrors[_0x1ed5d4(0x87)](_0x45dd3f[_0x1ed5d4(0xc4)]||_0x45dd3f[_0x1ed5d4(0x86)]||'API\x20error:\x20'+_0x11f2a9['status'],_0x45dd3f['errorCode']?_0x1ed5d4(0x72)+_0x45dd3f[_0x1ed5d4(0x6e)]:undefined);return _0x45dd3f;}catch(_0x28442a){if(_0x28442a instanceof CliError)throw _0x28442a;if(_0x28442a instanceof Error&&_0x28442a['name']===_0x1ed5d4(0x110))throw CliErrors[_0x1ed5d4(0x87)]('Request\x20timeout:\x20'+_0x2e75b4);throw createFetchFailureError(_0x2e75b4,_0x28442a);}finally{clearTimeout(_0x2a7e16);}}function isAuthFailure(_0x2bbbdf){const _0x462ae7=a156_0x4262,_0x14d274=_0x2bbbdf[_0x462ae7(0xc4)]||_0x2bbbdf[_0x462ae7(0x86)]||_0x2bbbdf['data']?.['message']||_0x2bbbdf[_0x462ae7(0x66)]||_0x2bbbdf[_0x462ae7(0xae)]||'';return _0x2bbbdf['errorCode']===_0x462ae7(0x88)||_0x2bbbdf[_0x462ae7(0xc0)]===0x191||_0x2bbbdf[_0x462ae7(0xc0)]===_0x462ae7(0xfb)||_0x14d274[_0x462ae7(0xb9)](_0x462ae7(0xfb))||_0x14d274[_0x462ae7(0xb9)]('Unauthorized')||_0x14d274[_0x462ae7(0xb9)]('登录')||_0x14d274[_0x462ae7(0xb9)]('认证');}export async function platformFetch(_0x5269d0,_0x454e57){const _0x542117=a156_0x4262;let _0x3c83ad;try{_0x3c83ad=await fetch(_0x5269d0,{'method':_0x454e57[_0x542117(0xb3)]??_0x542117(0xee),'headers':{'Content-Type':_0x542117(0x109),'Cookie':_0x454e57[_0x542117(0x79)],'X-Invoke-Source':'cli:rabetbase'},..._0x454e57['body']&&{'body':JSON['stringify'](_0x454e57[_0x542117(0xe4)])}});}catch(_0x495e28){throw createFetchFailureError(_0x5269d0,_0x495e28);}if(!_0x3c83ad['ok']){if(_0x3c83ad[_0x542117(0xaf)]===0x191)throw CliErrors[_0x542117(0xcc)]();throw CliErrors[_0x542117(0x87)](_0x454e57[_0x542117(0xa5)]+_0x542117(0xd3)+_0x3c83ad[_0x542117(0xaf)]);}const _0x2273df=await _0x3c83ad['json']();if(_0x2273df[_0x542117(0xe0)]===![]){if(isAuthFailure(_0x2273df))throw CliErrors[_0x542117(0xcc)]();throw CliErrors['apiError'](_0x2273df[_0x542117(0xc4)]||_0x2273df[_0x542117(0x86)]||_0x454e57[_0x542117(0xa5)]+_0x542117(0x80));}return _0x2273df[_0x542117(0xd9)];}export async function listBffScripts(_0x59fc05,_0x5d83ac,_0x2b520c){const _0x3bbd54=a156_0x4262;let _0x4d073d=_0x3bbd54(0xf2)+_0x59fc05;if(_0x5d83ac)_0x4d073d+=_0x3bbd54(0x81)+_0x5d83ac;const _0x44ba3d=await apiRequest(_0x4d073d);let _0x1087d8=extractList(_0x44ba3d[_0x3bbd54(0xd9)]);if(_0x2b520c?.[_0x3bbd54(0xeb)]){const _0x9b5d91=_0x2b520c[_0x3bbd54(0xeb)]['toLowerCase']();_0x1087d8=_0x1087d8[_0x3bbd54(0x8c)](_0x271bc6=>_0x271bc6[_0x3bbd54(0x97)]?.['toLowerCase']()[_0x3bbd54(0xb9)](_0x9b5d91)||_0x271bc6[_0x3bbd54(0x108)]?.[_0x3bbd54(0xa1)]()['includes'](_0x9b5d91));}return _0x1087d8;}export async function getBffScriptInfo(_0x2e295a){const _0x25ee96=a156_0x4262,_0x260fe5=await apiRequest(_0x25ee96(0xf8)+_0x2e295a);if(!_0x260fe5[_0x25ee96(0xd9)])throw CliErrors[_0x25ee96(0x7c)](_0x25ee96(0x76)+_0x2e295a);return _0x260fe5[_0x25ee96(0xd9)];}export async function saveBffScript(_0x1cd035){const _0x5bcca2=a156_0x4262,_0x98568f=await apiRequest(_0x5bcca2(0xbe),{'method':'POST','body':_0x1cd035}),{id:_0xcf5b42,entity:_0x3b5aba}=normalizeEntityWithIdResponse(_0x98568f['data']);if(_0xcf5b42!==undefined){const _0x27d9ca=typeof _0x3b5aba[_0x5bcca2(0x97)]===_0x5bcca2(0xa4)||typeof _0x3b5aba['scriptType']===_0x5bcca2(0xa4)?_0x3b5aba:undefined;return{'id':_0xcf5b42,'script':_0x27d9ca};}throw CliErrors[_0x5bcca2(0x87)](_0x5bcca2(0xbc));}export async function deleteBffScript(_0x2d712c){const _0x295835=a156_0x4262;await apiRequest(_0x295835(0xed),{'method':'POST','body':{'id':_0x2d712c}});}export async function getBffScriptStatistics(_0x54447d){const _0x16fb11=a156_0x4262,_0x37b018=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x54447d);return extractList(_0x37b018[_0x16fb11(0xd9)]);}export async function clearBffScriptCache(){const _0x3b07b8=a156_0x4262,_0x3a9db6=await apiRequest(_0x3b07b8(0xc6),{'method':_0x3b07b8(0xc9),'useRuntime':!![]});return typeof _0x3a9db6[_0x3b07b8(0xd9)]===_0x3b07b8(0xa4)?_0x3a9db6[_0x3b07b8(0xd9)]:'';}export async function listBffDatasetOperations(_0x3f87b5,_0x189144){const _0xb93c1e=a156_0x4262,_0x10efb7=await apiRequest(_0xb93c1e(0xd4),{'method':'POST','body':{'appCode':_0x3f87b5,'datasetId':_0x189144}});return _0x10efb7['data'];}export async function listSqlQueries(_0xe8bc31,_0x42e679){const _0x2c4445=a156_0x4262,_0x63f06c=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0x2c4445(0xc9),'body':{'appCode':_0xe8bc31,'currentPage':_0x42e679?.[_0x2c4445(0xe2)]??0x1,'pageSize':_0x42e679?.[_0x2c4445(0xf5)]??0x32,'sqlCode':_0x42e679?.[_0x2c4445(0xf0)],'sqlName':_0x42e679?.[_0x2c4445(0xb0)]}});return _0x63f06c[_0x2c4445(0xd9)];}export async function getSqlQueryInfo(_0x28ee6b,_0xb17f3b){const _0x4bda5b=a156_0x4262,_0x3e4045=await listSqlQueries(_0x28ee6b,{'sqlCode':_0xb17f3b}),_0x5336d2=_0x3e4045[_0x4bda5b(0x90)]?.[0x0];if(!_0x5336d2)throw CliErrors[_0x4bda5b(0x7c)](_0x4bda5b(0xd2)+_0xb17f3b);return _0x5336d2;}export async function getSqlQueryDetail(_0x200ee7){const _0x17cd24=a156_0x4262,_0x943aca=await apiRequest(_0x17cd24(0x9a)+(_0x17cd24(0x78)+encodeURIComponent(_0x200ee7)));if(!_0x943aca['data'])throw CliErrors['validation'](_0x17cd24(0xd2)+_0x200ee7);return _0x943aca['data'];}export async function getSqlQueryDetailById(_0x443d1e){const _0x23a9b8=a156_0x4262,_0x3e5c2a=await apiRequest(_0x23a9b8(0x7d)+_0x443d1e);if(!_0x3e5c2a['data'])throw CliErrors[_0x23a9b8(0x7c)]('SQL\x20query\x20not\x20found:\x20id='+_0x443d1e);return _0x3e5c2a[_0x23a9b8(0xd9)];}export async function createSqlQuery(_0x557946){const _0x85cf4f=a156_0x4262,_0x49c674=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':_0x85cf4f(0xc9),'body':_0x557946}),{id:_0x36a55a,entity:_0x20d10a}=normalizeEntityWithIdResponse(_0x49c674[_0x85cf4f(0xd9)]);if(!(_0x85cf4f(0xf0)in _0x20d10a)&&_0x36a55a)return getSqlQueryDetailById(_0x36a55a);return normalizeSqlQueryEntity(_0x20d10a);}export async function updateSqlQuery(_0x2eabe1){const _0x1fd0eb=a156_0x4262,_0x15b966=await apiRequest(_0x1fd0eb(0xff),{'method':_0x1fd0eb(0xc9),'body':_0x2eabe1}),{id:_0x3b881e,entity:_0xe15b5c}=normalizeEntityWithIdResponse(_0x15b966[_0x1fd0eb(0xd9)]);if(!(_0x1fd0eb(0xf0)in _0xe15b5c)){if(_0x2eabe1[_0x1fd0eb(0xf0)])return getSqlQueryDetail(_0x2eabe1[_0x1fd0eb(0xf0)]);if(_0x3b881e)return getSqlQueryDetailById(_0x3b881e);}return normalizeSqlQueryEntity(_0xe15b5c);}export async function deleteSqlQuery(_0x4984eb){const _0x1323c0=a156_0x4262;await apiRequest(_0x1323c0(0xb7),{'method':'POST','body':_0x4984eb});}export async function saveSqlQuery(_0x5a7a96){const _0x8b492a=a156_0x4262,_0x3a2f67=await apiRequest(_0x8b492a(0xa0),{'method':_0x8b492a(0xc9),'body':_0x5a7a96});return _0x3a2f67[_0x8b492a(0xd9)];}function normalizeSqlQueryEntity(_0x4ab678){const _0x3f88fc=a156_0x4262;return{..._0x4ab678,'id':Number(_0x4ab678['id']),'dbId':_0x4ab678[_0x3f88fc(0xf9)]==null?undefined:Number(_0x4ab678[_0x3f88fc(0xf9)]),'version':_0x4ab678['version']==null?undefined:Number(_0x4ab678['version'])};}export async function executeSql(_0x57f758,_0x45e5b8,_0x100b7d){const _0x1d8d2f=a156_0x4262,_0xa54cfd=await apiRequest('/api/custom/executeSql',{'method':'POST','body':{'appCode':_0x57f758,'sqlCode':_0x45e5b8,..._0x100b7d&&{'params':_0x100b7d}},'useRuntime':!![]});return _0xa54cfd[_0x1d8d2f(0xd9)];}export async function executeDatasetDataOperation(_0x202eae,_0x1c8133,_0x4d4922,_0x4dc7b6={}){const _0x394cd3=a156_0x4262;try{const _0xeb9770=await apiRequest('/api/'+_0x202eae+'/'+_0x1c8133+'/'+_0x4d4922,{'method':'POST','body':_0x4dc7b6,'useRuntime':!![]});return _0xeb9770[_0x394cd3(0xd9)];}catch(_0x43926f){if(_0x4d4922==='getOne'&&_0x43926f instanceof CliError&&_0x43926f[_0x394cd3(0xc0)]===_0x394cd3(0x8e)&&_0x4dc7b6['id']!==undefined&&_0x4dc7b6['id']!==null&&_0x4dc7b6['id']!==''){const _0x1a6aa6=await apiRequest(_0x394cd3(0x106)+_0x202eae+'/'+_0x1c8133+_0x394cd3(0x98),{'method':_0x394cd3(0xc9),'body':{'where':{'id':{'$eq':_0x4dc7b6['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x53858e=Array[_0x394cd3(0xc1)](_0x1a6aa6[_0x394cd3(0xd9)]?.[_0x394cd3(0x90)])?_0x1a6aa6[_0x394cd3(0xd9)][_0x394cd3(0x90)]:[];return _0x53858e[0x0]??null;}throw _0x43926f;}}export async function listDatasets(_0x472e8d,_0x2f3d18){const _0x5e2742=a156_0x4262,_0x3ceb06={'appCode':_0x472e8d,'deleted':![]};if(_0x2f3d18?.[_0x5e2742(0xc0)])_0x3ceb06[_0x5e2742(0xc0)]=_0x2f3d18[_0x5e2742(0xc0)];if(_0x2f3d18?.[_0x5e2742(0xb6)])_0x3ceb06[_0x5e2742(0xb6)]=_0x2f3d18[_0x5e2742(0xb6)];const _0x49c86e=await apiRequest(_0x5e2742(0x100),{'method':'POST','body':_0x3ceb06});return extractList(_0x49c86e['data']);}export async function deleteDataset(_0x56bd33,_0x2bb1b1){const _0x2d1316=a156_0x4262;await apiRequest('/smartapi/dataset/delete-dataset',{'method':_0x2d1316(0xc9),'body':{'appCode':_0x56bd33,'datasetId':_0x2bb1b1}});}function a156_0x27d4(){const _0x4facfc=['entries','clientOperationId','/smartapi/app/getList','json','});','SQL\x20query\x20not\x20found:\x20','\x20failed,\x20HTTP\x20','/smartapi/dataset/get-dataset-operation','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','target','planId','enabled','data','/smartapi/dblink/getTableDiffV2ByPage','\x20\x20sqlCode:\x20\x27','set','(/*\x20params\x20*/);','replace','tableName','success','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','currentPage','/smartapi/question/er-config/erDelete','body','/smartapi/dblink/testConnect','dbtableConfig','/smartapi/app-config/update','\x20\x20\x20\x20sqlCode:\x20\x27','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','//\x20SQL:\x20','scriptName','update','/api/management/library/scripts/delete','GET','//\x20','sqlCode','/smartapi/lovrabet/detail?pageId=','/api/management/library/scripts/list?appCode=','\x20\x20pageSize:\x2020,','/smartapi/db-analysis/start','pageSize','21auaNvs','Check\x20network\x20connectivity\x20and\x20try\x20again.','/api/management/library/scripts/info?id=','dbId','push','401','Request\x20timeout:\x20','.filter({','/smartapi/dblink/create','/smartapi/custom/updateUserCustomSql','/smartapi/dataset/get-dataset-list','/smartapi/dataset/get-driven-data?','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/generate-standard-pages/status?','has','toString','/api/','object','description','application/json','3601629ckGYPx','table','\x20\x20where:\x20{},','/smartapi/question/er-config/update-single','find','/smartapi/dblink/getOne','AbortError','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','tags','errorMessage','40tfQSdi','/smartapi/lovrabet/update-page','/smartapi/db-analysis/status/','value','responseFields','/smartapi/dblink/delete','pageIndex','errorCode','includeImports','join','Warning:\x20showing\x20first\x20','API\x20error\x20code:\x20','tableList','path','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','BFF\x20script\x20not\x20found:\x20id=','\x20\x20});','?sqlCode=','cookie','const\x20results\x20=\x20data.execResult\x20||\x20[];','/smartapi/app-config/getByKey','validation','/smartapi/custom/getUserCustomSql?id=','create','key','\x20failed','&type=','291978bLsLKV','24DozkLM','map','type','message','apiError','UNAUTHORIZED','Request\x20failed:\x20','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/smartapi/dblink/getList','filter','const\x20result\x20=\x20await\x20client.models.','api_error','/smartapi/question/er-config/erCreate','tableData','test','sdk','.create({\x20/*\x20fields\x20*/\x20});','/smartapi/question/er-config/business-group/edit','delete','/generate-standard-pages/start','functionName','/filter','operations','/smartapi/custom/getUserCustomSql','/smartapi/db-analysis/jobs/cancel','modelCode','/smartapi/app-config/delete','remove','\x20\x20currentPage:\x201,','/api/node-toolbox/sql/save','toLowerCase','3240072NHNddp','11433XDBRKF','string','label','stringify','list','6058190BCrCPr','/sync-to-pages','/smartapi/lovrabet/dataset/','displayName','\x20apps.\x20','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','error','status','sqlName','appCode','/smartapi/app-config/list','method','/standard-page-status?appCode=','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','name','/smartapi/custom/deleteUserCustomSql','/smartapi/dblink/getAllTableList','includes','totalCount','length','BFF\x20save\x20returned\x20no\x20valid\x20id','38035SYIINp','/api/management/library/scripts/save','.remove(id);','code','isArray','\x20of\x20','operationName','errorMsg','operationId','/api/management/script/cache/clear','827223QqJkfb','cli:rabetbase','POST','/smartapi/dblink/update','Operation\x20\x22','authRequired'];a156_0x27d4=function(){return _0x4facfc;};return a156_0x27d4();}export async function searchDatasets(_0x41ef43,_0x42eac2){const _0x188593=a156_0x4262,_0x123269=await listDatasets(_0x41ef43,{'name':_0x42eac2}),_0x28fafc=_0x42eac2['toLowerCase'](),_0x128e83=new Set(_0x123269[_0x188593(0x84)](_0x2158ae=>_0x2158ae['id'])),_0x25fb31=_0x123269['filter'](_0x1f6198=>_0x1f6198[_0x188593(0xe6)]?.[_0x188593(0xdf)]?.[_0x188593(0xa1)]()[_0x188593(0xb9)](_0x28fafc)||_0x1f6198[_0x188593(0x108)]?.[_0x188593(0xa1)]()['includes'](_0x28fafc)),_0x390ff0=await listDatasets(_0x41ef43,{'code':_0x42eac2});for(const _0x1c1fb of _0x390ff0){!_0x128e83[_0x188593(0x104)](_0x1c1fb['id'])&&(_0x123269['push'](_0x1c1fb),_0x128e83['add'](_0x1c1fb['id']));}return _0x123269;}export function normalizeDatasetOperations(_0x41d930){const _0x13e075=a156_0x4262;if(Array[_0x13e075(0xc1)](_0x41d930))return _0x41d930[_0x13e075(0x8c)](_0x14e135=>_0x14e135!=null&&typeof _0x14e135===_0x13e075(0x107));if(_0x41d930&&typeof _0x41d930===_0x13e075(0x107))return Object[_0x13e075(0xcd)](_0x41d930)[_0x13e075(0x8c)](([,_0x54fad5])=>_0x54fad5!=null&&typeof _0x54fad5==='object')[_0x13e075(0x84)](([_0x2b9254,_0x4151bb])=>({..._0x4151bb,'name':_0x4151bb[_0x13e075(0xb6)]??_0x4151bb['operationName']??_0x2b9254}));return[];}function a156_0x4262(_0x161053,_0x5f08ef){_0x161053=_0x161053-0x66;const _0x27d457=a156_0x27d4();let _0x426279=_0x27d457[_0x161053];return _0x426279;}export async function getDatasetDetail(_0x598c94){const _0x3e067d=a156_0x4262,_0x13bda4=/^\d+$/['test'](_0x598c94)?'id':_0x3e067d(0xc0),_0xf52d5a=await apiRequest(_0x3e067d(0x101)+_0x13bda4+'='+_0x598c94);return _0xf52d5a[_0x3e067d(0xd9)];}export async function updateDrivenData(_0x310c18){const _0x542d97=a156_0x4262,_0x4b9d4f=await apiRequest('/smartapi/dataset/update-driven-data',{'method':_0x542d97(0xc9),'body':_0x310c18});return _0x4b9d4f[_0x542d97(0xd9)];}export async function getDatasetOperations(_0xc55125){const _0x82e503=a156_0x4262,_0x1a337f=await getDatasetDetail(_0xc55125),_0x37da91=normalizeDatasetOperations(_0x1a337f['operations'])['map'](_0x2d1d3a=>({'name':_0x2d1d3a[_0x82e503(0xb6)]||_0x2d1d3a['operationName'],'displayName':_0x2d1d3a[_0x82e503(0xab)]||_0x2d1d3a[_0x82e503(0xb6)],'type':_0x2d1d3a[_0x82e503(0x85)],'method':_0x2d1d3a[_0x82e503(0xb3)],'path':_0x2d1d3a[_0x82e503(0x74)],'enabled':_0x2d1d3a[_0x82e503(0xd8)]??!![],'requestFields':_0x2d1d3a['requestFields'],'responseFields':_0x2d1d3a[_0x82e503(0x6b)]}));return{'dataset':{'id':_0x1a337f['id']??_0x1a337f['modelId'],'name':_0x1a337f[_0x82e503(0xb6)],'code':_0x1a337f[_0x82e503(0xc0)]||_0x1a337f[_0x82e503(0x9c)],'tableName':_0x1a337f[_0x82e503(0xdf)]||_0x1a337f[_0x82e503(0xe6)]?.[_0x82e503(0xdf)]},'operations':_0x37da91};}export async function getOperationDetail(_0x1e3bfc,_0xbee393,_0x53727d){const _0x5d3cec=a156_0x4262;let _0x2958a8=_0xbee393;if(!/^\d+$/['test'](_0xbee393)){const _0x18ef8e=await listDatasets(_0x1e3bfc,{'code':_0xbee393}),_0x50e462=_0x18ef8e['find'](_0x3f0645=>_0x3f0645[_0x5d3cec(0xc0)]===_0xbee393||String(_0x3f0645['id'])===_0xbee393);if(!_0x50e462)throw CliErrors['validation']('Dataset\x20not\x20found:\x20'+_0xbee393);_0x2958a8=String(_0x50e462['id']);}const _0x507d81=await getDatasetDetail(_0x2958a8),_0x4763d3=normalizeDatasetOperations(_0x507d81[_0x5d3cec(0x99)])[_0x5d3cec(0x10e)](_0x12f489=>(_0x12f489[_0x5d3cec(0xb6)]||_0x12f489[_0x5d3cec(0xc3)])===_0x53727d);if(!_0x4763d3)throw CliErrors[_0x5d3cec(0x7c)](_0x5d3cec(0xcb)+_0x53727d+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0xbee393);return{'dataset':{'id':_0x507d81['id']??_0x507d81['modelId'],'name':_0x507d81[_0x5d3cec(0xb6)],'code':_0x507d81[_0x5d3cec(0xc0)]||_0x507d81[_0x5d3cec(0x9c)],'tableName':_0x507d81['tableName']||_0x507d81[_0x5d3cec(0xe6)]?.['tableName']},'operation':_0x4763d3};}export async function startGenerateStandardPages(_0x1883aa,_0x2bf92c,_0x45220e){const _0x4a5de4=a156_0x4262,_0x1565cb=await apiRequest(_0x4a5de4(0xaa)+_0x2bf92c+_0x4a5de4(0x96),{'method':_0x4a5de4(0xc9),'body':{'appCode':_0x1883aa,..._0x45220e?.[_0x4a5de4(0xce)]?{'clientOperationId':_0x45220e[_0x4a5de4(0xce)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x1565cb[_0x4a5de4(0xd9)];}export async function getGenerateStandardPagesStatus(_0x4bfea1,_0x160d1c,_0x1a1de2){const _0x51f3c0=a156_0x4262,_0x33e5cb=new URLSearchParams({'appCode':_0x4bfea1});_0x1a1de2[_0x51f3c0(0xc5)]&&_0x33e5cb['set'](_0x51f3c0(0xc5),_0x1a1de2[_0x51f3c0(0xc5)]);_0x1a1de2[_0x51f3c0(0xce)]&&_0x33e5cb[_0x51f3c0(0xdc)]('clientOperationId',_0x1a1de2[_0x51f3c0(0xce)]);const _0x2e97b4=await apiRequest('/smartapi/lovrabet/dataset/'+_0x160d1c+_0x51f3c0(0x103)+_0x33e5cb[_0x51f3c0(0x105)]());return _0x2e97b4['data'];}export async function getStandardPageStatus(_0x5ef5ff,_0x5bbe2a){const _0x4ece91=a156_0x4262,_0x2ddda5=await apiRequest(_0x4ece91(0xaa)+_0x5bbe2a+_0x4ece91(0xb4)+encodeURIComponent(_0x5ef5ff));return _0x2ddda5[_0x4ece91(0xd9)];}export async function tryGetStandardPageStatus(_0x2a3232,_0xc76c8e){const _0x26ccbe=a156_0x4262;try{return await getStandardPageStatus(_0x2a3232,_0xc76c8e);}catch(_0x510d33){if(_0x510d33 instanceof CliError&&_0x510d33[_0x26ccbe(0xc0)]===_0x26ccbe(0x8e)&&/404|not found|non-json response/i[_0x26ccbe(0x91)](_0x510d33[_0x26ccbe(0x86)]))return null;throw _0x510d33;}}export async function syncStandardPages(_0x5ab7cb,_0x5bd502){const _0x5e9cb0=a156_0x4262,_0x56df83=await apiRequest(_0x5e9cb0(0xaa)+_0x5bd502+_0x5e9cb0(0xa9),{'method':_0x5e9cb0(0xc9),'body':{'appCode':_0x5ab7cb}});return _0x56df83[_0x5e9cb0(0xd9)];}export async function getPageDetail(_0x17f6d9){const _0x314e36=a156_0x4262,_0x11c194=await apiRequest(_0x314e36(0xf1)+_0x17f6d9);if(!_0x11c194[_0x314e36(0xd9)])throw CliErrors[_0x314e36(0x7c)]('Page\x20not\x20found:\x20'+_0x17f6d9);return _0x11c194[_0x314e36(0xd9)];}export async function updatePage(_0x1a0ae6,_0x1658fa,_0x209bf5,_0x1a95b1){const _0x5e5fde=a156_0x4262,_0x2a1eca=await apiRequest(_0x5e5fde(0x68),{'method':_0x5e5fde(0xc9),'body':{'appCode':_0x1a0ae6,'pageId':_0x1658fa,'code':_0x209bf5,'datasetIds':_0x1a95b1}});return _0x2a1eca[_0x5e5fde(0xd9)];}export function generateSdkCode(_0x2ebc83,_0x369692,_0x3c9b70){const _0x447c00=a156_0x4262,_0x25ae26=_0x3c9b70?.[_0x447c00(0x6f)]??!![],_0x39b670='dataset_'+_0x2ebc83[_0x447c00(0xc0)]?.[_0x447c00(0xde)](/-/g,'_'),_0x1d7577=_0x369692[_0x447c00(0xb6)]||_0x369692['operationName']||_0x447c00(0x8c),_0x5a7397=[];_0x25ae26&&_0x5a7397[_0x447c00(0xfa)](_0x447c00(0xe1),'',_0x447c00(0xd5),'');_0x5a7397['push'](_0x447c00(0xef)+_0x2ebc83[_0x447c00(0xb6)]+'\x20('+(_0x2ebc83['tableName']||_0x447c00(0x10b))+')');if(_0x1d7577==='filter')_0x5a7397['push'](_0x447c00(0x8d)+_0x39b670+_0x447c00(0xfd),_0x447c00(0x10c),_0x447c00(0xf3),_0x447c00(0x9f),_0x447c00(0xd1));else{if(_0x1d7577==='getOne')_0x5a7397[_0x447c00(0xfa)]('const\x20result\x20=\x20await\x20client.models.'+_0x39b670+'.getOne(id);');else{if(_0x1d7577===_0x447c00(0x7e))_0x5a7397[_0x447c00(0xfa)](_0x447c00(0x8d)+_0x39b670+_0x447c00(0x93));else{if(_0x1d7577===_0x447c00(0xec))_0x5a7397[_0x447c00(0xfa)]('const\x20result\x20=\x20await\x20client.models.'+_0x39b670+_0x447c00(0x75));else _0x1d7577===_0x447c00(0x95)||_0x1d7577===_0x447c00(0x9e)?_0x5a7397[_0x447c00(0xfa)](_0x447c00(0x8d)+_0x39b670+_0x447c00(0xbf)):_0x5a7397[_0x447c00(0xfa)](_0x447c00(0x8d)+_0x39b670+'.'+_0x1d7577+_0x447c00(0xdd));}}}return _0x5a7397[_0x447c00(0x70)]('\x0a');}export function generateSqlCodeTemplate(_0x1a7bf0,_0x14fae7){const _0x12f629=a156_0x4262,_0x4844f4=_0x14fae7?.[_0x12f629(0xd6)]??_0x12f629(0x92),_0x121eb8=_0x14fae7?.[_0x12f629(0x6f)]??!![],_0x421135=[];return _0x421135[_0x12f629(0xfa)](_0x12f629(0xea)+_0x1a7bf0[_0x12f629(0xb0)]+'\x20('+_0x1a7bf0['sqlCode']+')'),_0x4844f4===_0x12f629(0x92)?(_0x121eb8&&_0x421135[_0x12f629(0xfa)](_0x12f629(0xe1),'',_0x12f629(0xd5),''),_0x421135[_0x12f629(0xfa)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x12f629(0xdb)+_0x1a7bf0[_0x12f629(0xf0)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x12f629(0xd1),_0x12f629(0x111),_0x12f629(0x7a))):_0x421135['push']('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly',_0x12f629(0xad),_0x12f629(0xb5),_0x12f629(0xe8)+_0x1a7bf0[_0x12f629(0xf0)]+'\x27,',_0x12f629(0x102),_0x12f629(0x77),'\x20\x20return\x20rows;','}'),_0x421135['join']('\x0a');}export async function getErConfig(_0x4c0ab2,_0x36c645){const _0x3e558b=a156_0x4262,_0x205a17=await apiRequest('/smartapi/question/er-config',{'method':_0x3e558b(0xc9),'body':{'appCode':_0x4c0ab2,'dblinkId':_0x36c645},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x205a17[_0x3e558b(0xd9)];}export async function createErRelation(_0x326bd6){const _0x4b1597=a156_0x4262,_0x46745f=await apiRequest(_0x4b1597(0x8f),{'method':'POST','body':_0x326bd6,'allowNonJsonSuccess':!![]});return _0x46745f[_0x4b1597(0xd9)];}export async function updateErRelation(_0x3424da){const _0x4f0cc6=a156_0x4262,_0x4a7292=await apiRequest(_0x4f0cc6(0x10d),{'method':'POST','body':_0x3424da,'allowNonJsonSuccess':!![]});return _0x4a7292[_0x4f0cc6(0xd9)];}export async function deleteErRelation(_0x87135d){const _0x535563=a156_0x4262,_0x200f39=await apiRequest(_0x535563(0xe3),{'method':_0x535563(0xc9),'body':_0x87135d,'allowNonJsonSuccess':!![]});return _0x200f39[_0x535563(0xd9)];}export async function updateErBusinessGroup(_0x14a625){const _0xd716ef=a156_0x4262,_0x3c3855=await apiRequest(_0xd716ef(0x94),{'method':'POST','body':_0x14a625,'allowNonJsonSuccess':!![]});return _0x3c3855[_0xd716ef(0xd9)];}function buildQuery(_0x3bae08){const _0x3653fd=a156_0x4262,_0x245d79=new URLSearchParams();for(const [_0x53c662,_0x258a32]of Object[_0x3653fd(0xcd)](_0x3bae08)){if(_0x258a32===undefined||_0x258a32==='')continue;_0x245d79['set'](_0x53c662,String(_0x258a32));}const _0x387724=_0x245d79['toString']();return _0x387724?'?'+_0x387724:'';}export async function listAppConfigs(_0x45bf32,_0x468a1b){const _0x59122d=a156_0x4262,_0x584fe1=await apiRequest(_0x59122d(0xb2),{'method':'POST','body':{'appCode':_0x45bf32,..._0x468a1b?.[_0x59122d(0x7f)]?{'key':_0x468a1b[_0x59122d(0x7f)]}:{},..._0x468a1b?.[_0x59122d(0x112)]?{'tags':_0x468a1b[_0x59122d(0x112)]}:{}}});return extractAppConfigList(_0x584fe1[_0x59122d(0xd9)]);}export async function getAppConfigByKey(_0x428e6c,_0x5d6c2f){const _0xf639d2=a156_0x4262,_0x353796=await apiRequest(_0xf639d2(0x7b)+buildQuery({'appCode':_0x428e6c,'key':_0x5d6c2f}));return _0x353796[_0xf639d2(0xd9)]??null;}export async function createAppConfig(_0x23152a){const _0x5e5db2=a156_0x4262,_0x224869=await apiRequest('/smartapi/app-config/create',{'method':_0x5e5db2(0xc9),'body':{'appCode':_0x23152a['appCode'],'key':_0x23152a['key'],'value':_0x23152a['value'],..._0x23152a[_0x5e5db2(0x112)]?{'tags':_0x23152a['tags']}:{}}});return _0x224869['data'];}export async function updateAppConfig(_0x20d527){const _0x1de40c=a156_0x4262;await apiRequest(_0x1de40c(0xe7),{'method':_0x1de40c(0xc9),'body':{'id':_0x20d527['id'],'appCode':_0x20d527[_0x1de40c(0xb1)],'key':_0x20d527[_0x1de40c(0x7f)],'value':_0x20d527[_0x1de40c(0x6a)],..._0x20d527['tags']?{'tags':_0x20d527[_0x1de40c(0x112)]}:{}}});}export async function deleteAppConfig(_0x5451f0){const _0x58b2b3=a156_0x4262;await apiRequest(_0x58b2b3(0x9d),{'method':_0x58b2b3(0xc9),'body':_0x5451f0});}function extractAppConfigList(_0x54a17c){const _0x4993c4=a156_0x4262;if(Array[_0x4993c4(0xc1)](_0x54a17c))return _0x54a17c;if(_0x54a17c&&typeof _0x54a17c==='object'&&Array[_0x4993c4(0xc1)](_0x54a17c[_0x4993c4(0xa7)]))return _0x54a17c[_0x4993c4(0xa7)];return extractList(_0x54a17c);}export async function listDbLinks(_0x310192,_0x4764ee){const _0x583e04=a156_0x4262,_0x395328=await apiRequest(_0x583e04(0x8b),{'method':_0x583e04(0xc9),'body':{'appCode':_0x310192,'currentPage':_0x4764ee?.[_0x583e04(0xe2)]??0x1,'pageSize':_0x4764ee?.[_0x583e04(0xf5)]??0x64}});return{'items':extractList(_0x395328[_0x583e04(0xd9)]),'paging':extractPaging(_0x395328[_0x583e04(0xd9)])};}export async function getDbLinkInfo(_0x2832e8){const _0xf23ee6=a156_0x4262,_0x13c234=await apiRequest(_0xf23ee6(0x10f)+buildQuery({'id':_0x2832e8}));return _0x13c234[_0xf23ee6(0xd9)];}export async function createDbLink(_0x4ff2b3){const _0x43a9d1=a156_0x4262,_0x16aa53=await apiRequest(_0x43a9d1(0xfe),{'method':_0x43a9d1(0xc9),'body':_0x4ff2b3});return _0x16aa53['data'];}export async function updateDbLink(_0x4869d3){const _0x9a66b2=a156_0x4262,_0x1b4f3a=await apiRequest(_0x9a66b2(0xca),{'method':'POST','body':_0x4869d3});return _0x1b4f3a[_0x9a66b2(0xd9)];}export async function deleteDbLink(_0x20c8da){const _0x9226f5=a156_0x4262;await apiRequest(_0x9226f5(0x6c),{'method':'POST','body':{'id':_0x20c8da}});}export async function testDbLinkConnect(_0x395814){const _0x4f1b46=a156_0x4262,_0x5d3b08=await apiRequest(_0x4f1b46(0xe5)+buildQuery({'id':_0x395814}));return _0x5d3b08[_0x4f1b46(0xd9)];}export async function startDbAnalysis(_0x1c2d43,_0x501839){const _0x12c280=a156_0x4262,_0x6bf0e=await apiRequest(_0x12c280(0xf4),{'method':_0x12c280(0xc9),'body':{'dbLinkId':_0x1c2d43,..._0x501839&&_0x501839[_0x12c280(0xbb)]>0x0?{'tableNames':_0x501839}:{}}}),_0x2c9be9=_0x6bf0e[_0x12c280(0xd9)];if(typeof _0x2c9be9===_0x12c280(0xa4))return _0x2c9be9;if(_0x2c9be9&&typeof _0x2c9be9===_0x12c280(0x107)&&typeof _0x2c9be9[_0x12c280(0xd7)]===_0x12c280(0xa4))return _0x2c9be9[_0x12c280(0xd7)];return _0x2c9be9!=null?String(_0x2c9be9):'';}export async function cancelDbAnalysis(_0x4606b1){const _0x57e5b5=a156_0x4262;await apiRequest(_0x57e5b5(0x9b)+buildQuery({'planId':_0x4606b1}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x4a030a){const _0x505052=a156_0x4262,_0x374d97=await apiRequest(_0x505052(0x69)+encodeURIComponent(_0x4a030a));return _0x374d97[_0x505052(0xd9)];}export async function getDbAllTableList(_0x560298,_0x300bfc){const _0xa87fea=a156_0x4262,_0xc0082e=await apiRequest(_0xa87fea(0xb8)+buildQuery({'appCode':_0x560298,'dbLinkId':_0x300bfc})),_0x20af80=_0xc0082e[_0xa87fea(0xd9)];if(Array[_0xa87fea(0xc1)](_0x20af80))return _0x20af80;return extractList(_0x20af80);}export async function getDbTableDiff(_0x138fb7,_0x4fe3e1,_0x2e0140){const _0x38ec4d=a156_0x4262,_0x13e671=await apiRequest(_0x38ec4d(0xda)+buildQuery({'appCode':_0x138fb7,'dbLinkId':_0x4fe3e1,'pageIndex':_0x2e0140?.[_0x38ec4d(0x6d)]??0x1,'pageSize':_0x2e0140?.['pageSize']??0x14,'tableName':_0x2e0140?.[_0x38ec4d(0xdf)]})),_0x5548fb=_0x13e671[_0x38ec4d(0xd9)];return{'totalCount':_0x5548fb?.['totalCount']??0x0,'tableList':Array[_0x38ec4d(0xc1)](_0x5548fb?.['tableList'])?_0x5548fb[_0x38ec4d(0x73)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x554bd=a156_0x4262,_0x59c36e=await apiRequest(_0x554bd(0xcf),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x48d1fe=extractList(_0x59c36e[_0x554bd(0xd9)]),_0x262229=extractPaging(_0x59c36e[_0x554bd(0xd9)]);return _0x262229&&_0x262229[_0x554bd(0xba)]>REMOTE_APP_PAGE_SIZE&&console['warn'](_0x554bd(0x71)+REMOTE_APP_PAGE_SIZE+_0x554bd(0xc2)+_0x262229[_0x554bd(0xba)]+_0x554bd(0xac)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x48d1fe;}
|
|
1
|
+
(function(_0x57ee8f,_0x520f2a){const _0x1e900d=a157_0x5e9e,_0x29d4d2=_0x57ee8f();while(!![]){try{const _0x33ce45=parseInt(_0x1e900d(0x16e))/0x1+-parseInt(_0x1e900d(0x18e))/0x2*(parseInt(_0x1e900d(0x1c8))/0x3)+-parseInt(_0x1e900d(0x1ce))/0x4*(parseInt(_0x1e900d(0x1b6))/0x5)+parseInt(_0x1e900d(0x1ab))/0x6+-parseInt(_0x1e900d(0x1f0))/0x7*(parseInt(_0x1e900d(0x16c))/0x8)+parseInt(_0x1e900d(0x18b))/0x9+-parseInt(_0x1e900d(0x1c0))/0xa*(-parseInt(_0x1e900d(0x169))/0xb);if(_0x33ce45===_0x520f2a)break;else _0x29d4d2['push'](_0x29d4d2['shift']());}catch(_0x1f9ec2){_0x29d4d2['push'](_0x29d4d2['shift']());}}}(a157_0x1603,0x490df));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(_0x2d8084){_activeCookie=_0x2d8084||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0;function createFetchFailureError(_0x6a6bf7,_0x1191f8){const _0x1b7c61=a157_0x5e9e,_0x37d4c8=_0x1191f8 instanceof Error?_0x1191f8[_0x1b7c61(0x1e9)]:String(_0x1191f8);return CliErrors[_0x1b7c61(0x1d3)]('Request\x20failed:\x20'+_0x6a6bf7+(_0x37d4c8?'\x20('+_0x37d4c8+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x1b1932,_0x38e92e={}){const _0x3146df=a157_0x5e9e,{method:method=_0x3146df(0x17f),body:_0x4088f5,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x38e92e,_0x2f81ae=useRuntime?getRuntimeDomain():getApiDomain(),_0x319c04=_activeCookie||getCookie(),_0x13d9bc=''+_0x2f81ae+_0x1b1932,_0x3b4184=new AbortController(),_0x42e10a=setTimeout(()=>_0x3b4184[_0x3146df(0x1f7)](),timeout);try{const _0x1f2574=await fetch(_0x13d9bc,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x319c04,'X-Invoke-Source':_0x3146df(0x1d6),...headers},'body':_0x4088f5?JSON['stringify'](_0x4088f5):undefined,'signal':_0x3b4184[_0x3146df(0x1d0)]});let _0x155a0a;try{_0x155a0a=await _0x1f2574[_0x3146df(0x188)]();}catch(_0x4fa2e9){if(_0x4fa2e9 instanceof Error&&_0x4fa2e9['name']==='AbortError')throw CliErrors[_0x3146df(0x1d3)]('Request\x20timeout:\x20'+_0x13d9bc);if(_0x1f2574['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x3146df(0x1d3)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x1f2574[_0x3146df(0x167)]+')',_0x1f2574['status']>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x1f2574['ok']||_0x155a0a['success']===![])throw CliErrors[_0x3146df(0x1d3)](_0x155a0a[_0x3146df(0x174)]||_0x155a0a[_0x3146df(0x1e9)]||_0x3146df(0x179)+_0x1f2574['status'],_0x155a0a[_0x3146df(0x1fc)]?_0x3146df(0x189)+_0x155a0a[_0x3146df(0x1fc)]:undefined);return _0x155a0a;}catch(_0x10d2f5){if(_0x10d2f5 instanceof CliError)throw _0x10d2f5;if(_0x10d2f5 instanceof Error&&_0x10d2f5['name']===_0x3146df(0x19c))throw CliErrors[_0x3146df(0x1d3)](_0x3146df(0x1b3)+_0x13d9bc);throw createFetchFailureError(_0x13d9bc,_0x10d2f5);}finally{clearTimeout(_0x42e10a);}}function isAuthFailure(_0x4a5b80){const _0x1725f4=a157_0x5e9e,_0x425ace=_0x4a5b80[_0x1725f4(0x174)]||_0x4a5b80[_0x1725f4(0x1e9)]||_0x4a5b80[_0x1725f4(0x1be)]?.[_0x1725f4(0x1e9)]||_0x4a5b80[_0x1725f4(0x1a5)]||_0x4a5b80[_0x1725f4(0x1df)]||'';return _0x4a5b80[_0x1725f4(0x1fc)]==='UNAUTHORIZED'||_0x4a5b80[_0x1725f4(0x17d)]===0x191||_0x4a5b80[_0x1725f4(0x17d)]===_0x1725f4(0x185)||_0x425ace[_0x1725f4(0x1d1)](_0x1725f4(0x185))||_0x425ace['includes'](_0x1725f4(0x1e7))||_0x425ace[_0x1725f4(0x1d1)]('登录')||_0x425ace['includes']('认证');}export async function platformFetch(_0xd9ab7a,_0x258b62){const _0x2718dc=a157_0x5e9e;let _0x504f8d;try{_0x504f8d=await fetch(_0xd9ab7a,{'method':_0x258b62['method']??'GET','headers':{'Content-Type':'application/json','Cookie':_0x258b62[_0x2718dc(0x1ed)],'X-Invoke-Source':'cli:rabetbase'},..._0x258b62[_0x2718dc(0x1bd)]&&{'body':JSON[_0x2718dc(0x18a)](_0x258b62[_0x2718dc(0x1bd)])}});}catch(_0x4163c8){throw createFetchFailureError(_0xd9ab7a,_0x4163c8);}if(!_0x504f8d['ok']){if(_0x504f8d[_0x2718dc(0x167)]===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x2718dc(0x1d3)](_0x258b62[_0x2718dc(0x1a9)]+'\x20failed,\x20HTTP\x20'+_0x504f8d[_0x2718dc(0x167)]);}const _0x4abaf6=await _0x504f8d[_0x2718dc(0x188)]();if(_0x4abaf6['success']===![]){if(isAuthFailure(_0x4abaf6))throw CliErrors['authRequired']();throw CliErrors[_0x2718dc(0x1d3)](_0x4abaf6[_0x2718dc(0x174)]||_0x4abaf6[_0x2718dc(0x1e9)]||_0x258b62[_0x2718dc(0x1a9)]+_0x2718dc(0x1c6));}return _0x4abaf6[_0x2718dc(0x1be)];}function a157_0x5e9e(_0x4926f4,_0x32a9d4){_0x4926f4=_0x4926f4-0x163;const _0x1603b5=a157_0x1603();let _0x5e9e25=_0x1603b5[_0x4926f4];return _0x5e9e25;}export async function listBffScripts(_0x166396,_0x27436e,_0x477e04){const _0x18bebf=a157_0x5e9e;let _0x19bedd='/api/management/library/scripts/list?appCode='+_0x166396;if(_0x27436e)_0x19bedd+='&type='+_0x27436e;const _0x16e6c4=await apiRequest(_0x19bedd);let _0x55f62e=extractList(_0x16e6c4['data']);if(_0x477e04?.[_0x18bebf(0x200)]){const _0x5db88a=_0x477e04[_0x18bebf(0x200)][_0x18bebf(0x1b4)]();_0x55f62e=_0x55f62e[_0x18bebf(0x165)](_0x86721d=>_0x86721d[_0x18bebf(0x1ee)]?.[_0x18bebf(0x1b4)]()['includes'](_0x5db88a)||_0x86721d['description']?.[_0x18bebf(0x1b4)]()['includes'](_0x5db88a));}return _0x55f62e;}export async function getBffScriptInfo(_0x132bc6){const _0x18e209=a157_0x5e9e,_0x2680b1=await apiRequest(_0x18e209(0x1c3)+_0x132bc6);if(!_0x2680b1['data'])throw CliErrors['validation'](_0x18e209(0x1dc)+_0x132bc6);return _0x2680b1[_0x18e209(0x1be)];}export async function saveBffScript(_0x3246d5){const _0x3957c1=a157_0x5e9e,_0x4f6c4a=await apiRequest(_0x3957c1(0x1d2),{'method':_0x3957c1(0x163),'body':_0x3246d5}),{id:_0xd15f8e,entity:_0x4c9759}=normalizeEntityWithIdResponse(_0x4f6c4a[_0x3957c1(0x1be)]);if(_0xd15f8e!==undefined){const _0x513cc4=typeof _0x4c9759[_0x3957c1(0x1ee)]===_0x3957c1(0x1fd)||typeof _0x4c9759['scriptType']===_0x3957c1(0x1fd)?_0x4c9759:undefined;return{'id':_0xd15f8e,'script':_0x513cc4};}throw CliErrors['apiError']('BFF\x20save\x20returned\x20no\x20valid\x20id');}export async function deleteBffScript(_0x4e9b11){const _0x57b37a=a157_0x5e9e;await apiRequest(_0x57b37a(0x1a6),{'method':_0x57b37a(0x163),'body':{'id':_0x4e9b11}});}export async function getBffScriptStatistics(_0x150e6a){const _0x18660a=a157_0x5e9e,_0x2fd3ee=await apiRequest(_0x18660a(0x176)+_0x150e6a);return extractList(_0x2fd3ee['data']);}export async function clearBffScriptCache(){const _0x9b14f3=a157_0x5e9e,_0x1a10be=await apiRequest('/api/management/script/cache/clear',{'method':'POST','useRuntime':!![]});return typeof _0x1a10be['data']===_0x9b14f3(0x1fd)?_0x1a10be[_0x9b14f3(0x1be)]:'';}export async function listBffDatasetOperations(_0x440a1a,_0x198f38){const _0x598bfd=a157_0x5e9e,_0x35f545=await apiRequest(_0x598bfd(0x1fe),{'method':_0x598bfd(0x163),'body':{'appCode':_0x440a1a,'datasetId':_0x198f38}});return _0x35f545[_0x598bfd(0x1be)];}export async function listSqlQueries(_0x416d8e,_0x8d9701){const _0x8d9c5f=a157_0x5e9e,_0x295a58=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0x8d9c5f(0x163),'body':{'appCode':_0x416d8e,'currentPage':_0x8d9701?.['currentPage']??0x1,'pageSize':_0x8d9701?.['pageSize']??0x32,'sqlCode':_0x8d9701?.[_0x8d9c5f(0x1b9)],'sqlName':_0x8d9701?.[_0x8d9c5f(0x1fa)]}});return _0x295a58['data'];}export async function getSqlQueryInfo(_0x3b4820,_0x10c80e){const _0x2b6653=a157_0x5e9e,_0x9978bb=await listSqlQueries(_0x3b4820,{'sqlCode':_0x10c80e}),_0x132838=_0x9978bb[_0x2b6653(0x1ec)]?.[0x0];if(!_0x132838)throw CliErrors[_0x2b6653(0x1a2)](_0x2b6653(0x1aa)+_0x10c80e);return _0x132838;}export async function getSqlQueryDetail(_0x97c6d5){const _0x11f74c=a157_0x5e9e,_0x309dda=await apiRequest(_0x11f74c(0x1db)+(_0x11f74c(0x182)+encodeURIComponent(_0x97c6d5)));if(!_0x309dda['data'])throw CliErrors[_0x11f74c(0x1a2)](_0x11f74c(0x1aa)+_0x97c6d5);return _0x309dda[_0x11f74c(0x1be)];}export async function getSqlQueryDetailById(_0x3b094e){const _0x40a495=a157_0x5e9e,_0x446036=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x3b094e);if(!_0x446036['data'])throw CliErrors[_0x40a495(0x1a2)](_0x40a495(0x1b0)+_0x3b094e);return _0x446036['data'];}export async function createSqlQuery(_0x1107c5){const _0x583710=a157_0x5e9e,_0x4ba475=await apiRequest(_0x583710(0x1d7),{'method':_0x583710(0x163),'body':_0x1107c5}),{id:_0x2da337,entity:_0x407d7d}=normalizeEntityWithIdResponse(_0x4ba475['data']);if(!(_0x583710(0x1b9)in _0x407d7d)&&_0x2da337)return getSqlQueryDetailById(_0x2da337);return normalizeSqlQueryEntity(_0x407d7d);}export async function updateSqlQuery(_0x53e029){const _0x5e9d90=a157_0x5e9e,_0x43cf3c=await apiRequest(_0x5e9d90(0x1e3),{'method':_0x5e9d90(0x163),'body':_0x53e029}),{id:_0x2c4be5,entity:_0x167363}=normalizeEntityWithIdResponse(_0x43cf3c[_0x5e9d90(0x1be)]);if(!('sqlCode'in _0x167363)){if(_0x53e029['sqlCode'])return getSqlQueryDetail(_0x53e029['sqlCode']);if(_0x2c4be5)return getSqlQueryDetailById(_0x2c4be5);}return normalizeSqlQueryEntity(_0x167363);}export async function deleteSqlQuery(_0x65653e){const _0x4b601f=a157_0x5e9e;await apiRequest(_0x4b601f(0x173),{'method':'POST','body':_0x65653e});}export async function saveSqlQuery(_0x1d3494){const _0x36422e=a157_0x5e9e,_0x4f5fd7=await apiRequest(_0x36422e(0x1bc),{'method':'POST','body':_0x1d3494});return _0x4f5fd7[_0x36422e(0x1be)];}function normalizeSqlQueryEntity(_0x5b8a15){const _0x464448=a157_0x5e9e;return{..._0x5b8a15,'id':Number(_0x5b8a15['id']),'dbId':_0x5b8a15[_0x464448(0x1e0)]==null?undefined:Number(_0x5b8a15[_0x464448(0x1e0)]),'version':_0x5b8a15['version']==null?undefined:Number(_0x5b8a15[_0x464448(0x1c1)])};}export async function executeSql(_0x456056,_0xe6ca63,_0x4df88b){const _0xa3798a=a157_0x5e9e,_0x3de64d=await apiRequest(_0xa3798a(0x18c),{'method':_0xa3798a(0x163),'body':{'appCode':_0x456056,'sqlCode':_0xe6ca63,..._0x4df88b&&{'params':_0x4df88b}},'useRuntime':!![]});return _0x3de64d[_0xa3798a(0x1be)];}export async function executeDatasetDataOperation(_0x247855,_0x522be0,_0x23cdc5,_0x3d0a21={}){const _0x14d274=a157_0x5e9e;try{const _0x4d72b6=await apiRequest(_0x14d274(0x1f1)+_0x247855+'/'+_0x522be0+'/'+_0x23cdc5,{'method':_0x14d274(0x163),'body':_0x3d0a21,'useRuntime':!![]});return _0x4d72b6[_0x14d274(0x1be)];}catch(_0xda5523){if(_0x23cdc5===_0x14d274(0x1ac)&&_0xda5523 instanceof CliError&&_0xda5523[_0x14d274(0x17d)]===_0x14d274(0x17b)&&_0x3d0a21['id']!==undefined&&_0x3d0a21['id']!==null&&_0x3d0a21['id']!==''){const _0x13e8a8=await apiRequest(_0x14d274(0x1f1)+_0x247855+'/'+_0x522be0+_0x14d274(0x1cb),{'method':_0x14d274(0x163),'body':{'where':{'id':{'$eq':_0x3d0a21['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x40a79d=Array['isArray'](_0x13e8a8['data']?.[_0x14d274(0x1ec)])?_0x13e8a8['data']['tableData']:[];return _0x40a79d[0x0]??null;}throw _0xda5523;}}export async function listDatasets(_0x4b59cf,_0x151809){const _0x2f2334=a157_0x5e9e,_0x12e111={'appCode':_0x4b59cf,'deleted':_0x151809?.['deleted']??![]};if(_0x151809?.[_0x2f2334(0x17d)])_0x12e111['code']=_0x151809[_0x2f2334(0x17d)];if(_0x151809?.[_0x2f2334(0x164)])_0x12e111[_0x2f2334(0x164)]=_0x151809[_0x2f2334(0x164)];const _0x8d5321=await apiRequest('/smartapi/dataset/get-dataset-list',{'method':'POST','body':_0x12e111});return extractList(_0x8d5321[_0x2f2334(0x1be)]);}export async function deleteDataset(_0x404531,_0x41394c){const _0x4b7019=a157_0x5e9e;await apiRequest('/smartapi/dataset/delete-dataset',{'method':_0x4b7019(0x163),'body':{'appCode':_0x404531,'datasetId':_0x41394c}});}export async function restoreDataset(_0x2d916b,_0xf3afd0){const _0x4bc4c9=a157_0x5e9e;await apiRequest(_0x4bc4c9(0x1bb),{'method':_0x4bc4c9(0x163),'body':{'appCode':_0x2d916b,'datasetId':_0xf3afd0}});}export async function searchDatasets(_0x5dc3fb,_0x54f9d8){const _0x20fc32=a157_0x5e9e,_0x64033b=await listDatasets(_0x5dc3fb,{'name':_0x54f9d8}),_0x624698=_0x54f9d8[_0x20fc32(0x1b4)](),_0x231a8d=new Set(_0x64033b[_0x20fc32(0x1e4)](_0x2738d4=>_0x2738d4['id'])),_0x21a7f9=_0x64033b[_0x20fc32(0x165)](_0x54e3bc=>_0x54e3bc[_0x20fc32(0x171)]?.[_0x20fc32(0x1e2)]?.[_0x20fc32(0x1b4)]()[_0x20fc32(0x1d1)](_0x624698)||_0x54e3bc[_0x20fc32(0x1f5)]?.[_0x20fc32(0x1b4)]()[_0x20fc32(0x1d1)](_0x624698)),_0x1588e2=await listDatasets(_0x5dc3fb,{'code':_0x54f9d8});for(const _0x3bd427 of _0x1588e2){!_0x231a8d['has'](_0x3bd427['id'])&&(_0x64033b[_0x20fc32(0x1c7)](_0x3bd427),_0x231a8d['add'](_0x3bd427['id']));}return _0x64033b;}export function normalizeDatasetOperations(_0x475cdd){const _0x19327d=a157_0x5e9e;if(Array[_0x19327d(0x208)](_0x475cdd))return _0x475cdd[_0x19327d(0x165)](_0x177736=>_0x177736!=null&&typeof _0x177736==='object');if(_0x475cdd&&typeof _0x475cdd===_0x19327d(0x1a8))return Object[_0x19327d(0x204)](_0x475cdd)[_0x19327d(0x165)](([,_0x3d7c62])=>_0x3d7c62!=null&&typeof _0x3d7c62===_0x19327d(0x1a8))['map'](([_0x6218,_0x253483])=>({..._0x253483,'name':_0x253483[_0x19327d(0x164)]??_0x253483[_0x19327d(0x207)]??_0x6218}));return[];}export async function getDatasetDetail(_0x505f9d){const _0x319071=a157_0x5e9e,_0x242259=/^\d+$/[_0x319071(0x1c5)](_0x505f9d)?'id':_0x319071(0x17d),_0x21208c=await apiRequest(_0x319071(0x202)+_0x242259+'='+_0x505f9d);return _0x21208c[_0x319071(0x1be)];}export async function updateDrivenData(_0x4bcd9b){const _0x3587d5=a157_0x5e9e,_0x1ef01f=await apiRequest(_0x3587d5(0x183),{'method':_0x3587d5(0x163),'body':_0x4bcd9b});return _0x1ef01f['data'];}export async function getDatasetOperations(_0x5e59eb){const _0x182b24=a157_0x5e9e,_0x414055=await getDatasetDetail(_0x5e59eb),_0x1274f7=normalizeDatasetOperations(_0x414055['operations'])[_0x182b24(0x1e4)](_0xf85ff=>({'name':_0xf85ff['name']||_0xf85ff['operationName'],'displayName':_0xf85ff[_0x182b24(0x1f3)]||_0xf85ff[_0x182b24(0x164)],'type':_0xf85ff[_0x182b24(0x201)],'method':_0xf85ff['method'],'path':_0xf85ff['path'],'enabled':_0xf85ff[_0x182b24(0x1de)]??!![],'requestFields':_0xf85ff[_0x182b24(0x203)],'responseFields':_0xf85ff['responseFields']}));return{'dataset':{'id':_0x414055['id']??_0x414055[_0x182b24(0x19e)],'name':_0x414055[_0x182b24(0x164)],'code':_0x414055[_0x182b24(0x17d)]||_0x414055[_0x182b24(0x1f4)],'tableName':_0x414055[_0x182b24(0x1e2)]||_0x414055[_0x182b24(0x171)]?.[_0x182b24(0x1e2)]},'operations':_0x1274f7};}export async function getOperationDetail(_0x43b028,_0x5b4de6,_0x28a197){const _0x893276=a157_0x5e9e;let _0x26eec4=_0x5b4de6;if(!/^\d+$/[_0x893276(0x1c5)](_0x5b4de6)){const _0x468550=await listDatasets(_0x43b028,{'code':_0x5b4de6}),_0x20e7ca=_0x468550['find'](_0x1ceaf3=>_0x1ceaf3[_0x893276(0x17d)]===_0x5b4de6||String(_0x1ceaf3['id'])===_0x5b4de6);if(!_0x20e7ca)throw CliErrors[_0x893276(0x1a2)](_0x893276(0x1a4)+_0x5b4de6);_0x26eec4=String(_0x20e7ca['id']);}const _0x2ddbf5=await getDatasetDetail(_0x26eec4),_0x1bc168=normalizeDatasetOperations(_0x2ddbf5[_0x893276(0x206)])[_0x893276(0x17e)](_0x5084a9=>(_0x5084a9[_0x893276(0x164)]||_0x5084a9['operationName'])===_0x28a197);if(!_0x1bc168)throw CliErrors[_0x893276(0x1a2)]('Operation\x20\x22'+_0x28a197+_0x893276(0x16d)+_0x5b4de6);return{'dataset':{'id':_0x2ddbf5['id']??_0x2ddbf5['modelId'],'name':_0x2ddbf5[_0x893276(0x164)],'code':_0x2ddbf5[_0x893276(0x17d)]||_0x2ddbf5[_0x893276(0x1f4)],'tableName':_0x2ddbf5['tableName']||_0x2ddbf5[_0x893276(0x171)]?.[_0x893276(0x1e2)]},'operation':_0x1bc168};}export async function startGenerateStandardPages(_0x17e7f3,_0x4d7157,_0x45804a){const _0x26f678=a157_0x5e9e,_0x2110ce=await apiRequest(_0x26f678(0x1e6)+_0x4d7157+_0x26f678(0x16a),{'method':_0x26f678(0x163),'body':{'appCode':_0x17e7f3,..._0x45804a?.[_0x26f678(0x17c)]?{'clientOperationId':_0x45804a[_0x26f678(0x17c)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x2110ce[_0x26f678(0x1be)];}export async function getGenerateStandardPagesStatus(_0xfb71e4,_0x506457,_0x34a7e0){const _0x213df7=a157_0x5e9e,_0x5dcf0b=new URLSearchParams({'appCode':_0xfb71e4});_0x34a7e0[_0x213df7(0x181)]&&_0x5dcf0b[_0x213df7(0x192)]('operationId',_0x34a7e0[_0x213df7(0x181)]);_0x34a7e0['clientOperationId']&&_0x5dcf0b[_0x213df7(0x192)]('clientOperationId',_0x34a7e0[_0x213df7(0x17c)]);const _0x34e97e=await apiRequest(_0x213df7(0x1e6)+_0x506457+_0x213df7(0x1af)+_0x5dcf0b[_0x213df7(0x178)]());return _0x34e97e[_0x213df7(0x1be)];}export async function getStandardPageStatus(_0x49e335,_0xf4b2df){const _0x54f001=a157_0x5e9e,_0x50a530=await apiRequest(_0x54f001(0x1e6)+_0xf4b2df+'/standard-page-status?appCode='+encodeURIComponent(_0x49e335));return _0x50a530[_0x54f001(0x1be)];}export async function tryGetStandardPageStatus(_0x57c189,_0x175dc9){const _0x39a8ac=a157_0x5e9e;try{return await getStandardPageStatus(_0x57c189,_0x175dc9);}catch(_0x31c6dd){if(_0x31c6dd instanceof CliError&&_0x31c6dd[_0x39a8ac(0x17d)]===_0x39a8ac(0x17b)&&/404|not found|non-json response/i['test'](_0x31c6dd[_0x39a8ac(0x1e9)]))return null;throw _0x31c6dd;}}export async function syncStandardPages(_0x372f80,_0x27fa56){const _0x1601c2=a157_0x5e9e,_0x54c48e=await apiRequest(_0x1601c2(0x1e6)+_0x27fa56+_0x1601c2(0x1eb),{'method':_0x1601c2(0x163),'body':{'appCode':_0x372f80}});return _0x54c48e[_0x1601c2(0x1be)];}export async function getPageDetail(_0x5bcc25){const _0x15c8f4=a157_0x5e9e,_0x35fbb1=await apiRequest(_0x15c8f4(0x191)+_0x5bcc25);if(!_0x35fbb1[_0x15c8f4(0x1be)])throw CliErrors[_0x15c8f4(0x1a2)](_0x15c8f4(0x1f6)+_0x5bcc25);return _0x35fbb1[_0x15c8f4(0x1be)];}export async function updatePage(_0x5e3834,_0x1b7b8b,_0xc6db6c,_0x5301e9){const _0x2e796c=a157_0x5e9e,_0x187c11=await apiRequest(_0x2e796c(0x1da),{'method':_0x2e796c(0x163),'body':{'appCode':_0x5e3834,'pageId':_0x1b7b8b,'code':_0xc6db6c,'datasetIds':_0x5301e9}});return _0x187c11[_0x2e796c(0x1be)];}export function generateSdkCode(_0x2e778e,_0x1bd0a0,_0x3bf017){const _0x23e7ad=a157_0x5e9e,_0x4c43ba=_0x3bf017?.[_0x23e7ad(0x166)]??!![],_0x867345=_0x23e7ad(0x1ef)+_0x2e778e[_0x23e7ad(0x17d)]?.[_0x23e7ad(0x1b5)](/-/g,'_'),_0x58583b=_0x1bd0a0['name']||_0x1bd0a0['operationName']||_0x23e7ad(0x165),_0x5ac539=[];_0x4c43ba&&_0x5ac539['push'](_0x23e7ad(0x190),'',_0x23e7ad(0x194),'');_0x5ac539[_0x23e7ad(0x1c7)](_0x23e7ad(0x1c2)+_0x2e778e['name']+'\x20('+(_0x2e778e['tableName']||_0x23e7ad(0x1cd))+')');if(_0x58583b===_0x23e7ad(0x165))_0x5ac539[_0x23e7ad(0x1c7)](_0x23e7ad(0x198)+_0x867345+'.filter({','\x20\x20where:\x20{},',_0x23e7ad(0x1d5),_0x23e7ad(0x172),_0x23e7ad(0x184));else{if(_0x58583b===_0x23e7ad(0x1ac))_0x5ac539[_0x23e7ad(0x1c7)](_0x23e7ad(0x198)+_0x867345+_0x23e7ad(0x1f8));else{if(_0x58583b===_0x23e7ad(0x1ff))_0x5ac539[_0x23e7ad(0x1c7)](_0x23e7ad(0x198)+_0x867345+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x58583b===_0x23e7ad(0x1cc))_0x5ac539[_0x23e7ad(0x1c7)](_0x23e7ad(0x198)+_0x867345+_0x23e7ad(0x19f));else _0x58583b===_0x23e7ad(0x1ca)||_0x58583b===_0x23e7ad(0x170)?_0x5ac539[_0x23e7ad(0x1c7)](_0x23e7ad(0x198)+_0x867345+_0x23e7ad(0x168)):_0x5ac539[_0x23e7ad(0x1c7)]('const\x20result\x20=\x20await\x20client.models.'+_0x867345+'.'+_0x58583b+_0x23e7ad(0x18d));}}}return _0x5ac539[_0x23e7ad(0x205)]('\x0a');}export function generateSqlCodeTemplate(_0x405320,_0x221346){const _0x303d1a=a157_0x5e9e,_0xed4ccd=_0x221346?.[_0x303d1a(0x1e8)]??_0x303d1a(0x1dd),_0x465641=_0x221346?.[_0x303d1a(0x166)]??!![],_0x3a679d=[];return _0x3a679d[_0x303d1a(0x1c7)](_0x303d1a(0x175)+_0x405320[_0x303d1a(0x1fa)]+'\x20('+_0x405320[_0x303d1a(0x1b9)]+')'),_0xed4ccd===_0x303d1a(0x1dd)?(_0x465641&&_0x3a679d[_0x303d1a(0x1c7)](_0x303d1a(0x190),'',_0x303d1a(0x194),''),_0x3a679d['push']('const\x20data\x20=\x20await\x20client.sql.execute({',_0x303d1a(0x187)+_0x405320[_0x303d1a(0x1b9)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x303d1a(0x184),_0x303d1a(0x1c9),_0x303d1a(0x1d8))):_0x3a679d[_0x303d1a(0x1c7)](_0x303d1a(0x19b),_0x303d1a(0x1ba),'\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x303d1a(0x1ae)+_0x405320[_0x303d1a(0x1b9)]+'\x27,',_0x303d1a(0x1b8),_0x303d1a(0x1a7),_0x303d1a(0x1a3),'}'),_0x3a679d[_0x303d1a(0x205)]('\x0a');}export async function getErConfig(_0x22c312,_0x16487f){const _0x577048=a157_0x5e9e,_0x494bca=await apiRequest(_0x577048(0x1c4),{'method':_0x577048(0x163),'body':{'appCode':_0x22c312,'dblinkId':_0x16487f},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x494bca[_0x577048(0x1be)];}export async function createErRelation(_0x5b92d8){const _0x5393b7=a157_0x5e9e,_0xcb5f30=await apiRequest(_0x5393b7(0x16b),{'method':_0x5393b7(0x163),'body':_0x5b92d8,'allowNonJsonSuccess':!![]});return _0xcb5f30[_0x5393b7(0x1be)];}export async function updateErRelation(_0x524f2e){const _0x1372b4=a157_0x5e9e,_0x1d746e=await apiRequest(_0x1372b4(0x186),{'method':_0x1372b4(0x163),'body':_0x524f2e,'allowNonJsonSuccess':!![]});return _0x1d746e[_0x1372b4(0x1be)];}export async function deleteErRelation(_0x4b4df9){const _0x43e309=await apiRequest('/smartapi/question/er-config/erDelete',{'method':'POST','body':_0x4b4df9,'allowNonJsonSuccess':!![]});return _0x43e309['data'];}export async function updateErBusinessGroup(_0x3268e8){const _0x2d3958=a157_0x5e9e,_0x5107ca=await apiRequest('/smartapi/question/er-config/business-group/edit',{'method':_0x2d3958(0x163),'body':_0x3268e8,'allowNonJsonSuccess':!![]});return _0x5107ca[_0x2d3958(0x1be)];}function buildQuery(_0x39ac35){const _0x2fa087=a157_0x5e9e,_0x2a23f4=new URLSearchParams();for(const [_0x534dff,_0x1dce91]of Object[_0x2fa087(0x204)](_0x39ac35)){if(_0x1dce91===undefined||_0x1dce91==='')continue;_0x2a23f4[_0x2fa087(0x192)](_0x534dff,String(_0x1dce91));}const _0x27a37=_0x2a23f4['toString']();return _0x27a37?'?'+_0x27a37:'';}export async function listAppConfigs(_0x48760a,_0x3d5a19){const _0x23fb23=a157_0x5e9e,_0x2c3220=await apiRequest(_0x23fb23(0x1ad),{'method':_0x23fb23(0x163),'body':{'appCode':_0x48760a,..._0x3d5a19?.[_0x23fb23(0x1b1)]?{'key':_0x3d5a19['key']}:{},..._0x3d5a19?.[_0x23fb23(0x1d4)]?{'tags':_0x3d5a19[_0x23fb23(0x1d4)]}:{}}});return extractAppConfigList(_0x2c3220[_0x23fb23(0x1be)]);}export async function getAppConfigByKey(_0x6c69f5,_0x27cf1a){const _0x3cf1dc=a157_0x5e9e,_0x182da3=await apiRequest(_0x3cf1dc(0x1f9)+buildQuery({'appCode':_0x6c69f5,'key':_0x27cf1a}));return _0x182da3['data']??null;}export async function createAppConfig(_0x3cadf1){const _0x164e83=a157_0x5e9e,_0x461fd3=await apiRequest(_0x164e83(0x1b2),{'method':_0x164e83(0x163),'body':{'appCode':_0x3cadf1[_0x164e83(0x1e1)],'key':_0x3cadf1[_0x164e83(0x1b1)],'value':_0x3cadf1[_0x164e83(0x1a1)],..._0x3cadf1['tags']?{'tags':_0x3cadf1[_0x164e83(0x1d4)]}:{}}});return _0x461fd3['data'];}export async function updateAppConfig(_0x5053ca){const _0x52e29f=a157_0x5e9e;await apiRequest(_0x52e29f(0x196),{'method':_0x52e29f(0x163),'body':{'id':_0x5053ca['id'],'appCode':_0x5053ca[_0x52e29f(0x1e1)],'key':_0x5053ca[_0x52e29f(0x1b1)],'value':_0x5053ca[_0x52e29f(0x1a1)],..._0x5053ca[_0x52e29f(0x1d4)]?{'tags':_0x5053ca['tags']}:{}}});}export async function deleteAppConfig(_0x4b0987){const _0x5d8b99=a157_0x5e9e;await apiRequest(_0x5d8b99(0x1b7),{'method':_0x5d8b99(0x163),'body':_0x4b0987});}function extractAppConfigList(_0x53026a){const _0x4b14d7=a157_0x5e9e;if(Array[_0x4b14d7(0x208)](_0x53026a))return _0x53026a;if(_0x53026a&&typeof _0x53026a==='object'&&Array['isArray'](_0x53026a['list']))return _0x53026a[_0x4b14d7(0x16f)];return extractList(_0x53026a);}function a157_0x1603(){const _0x54969c=['validation','\x20\x20return\x20rows;','Dataset\x20not\x20found:\x20','errorMessage','/api/management/library/scripts/delete','\x20\x20});','object','label','SQL\x20query\x20not\x20found:\x20','2254566XjYnhj','getOne','/smartapi/app-config/list','\x20\x20\x20\x20sqlCode:\x20\x27','/generate-standard-pages/status?','SQL\x20query\x20not\x20found:\x20id=','key','/smartapi/app-config/create','Request\x20timeout:\x20','toLowerCase','replace','558725aADzau','/smartapi/app-config/delete','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','sqlCode','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','/smartapi/dataset/restore-dataset','/api/node-toolbox/sql/save','body','data','/smartapi/db-analysis/status/','215230yIYadG','version','//\x20','/api/management/library/scripts/info?id=','/smartapi/question/er-config','test','\x20failed','push','3Zzndad','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','delete','/filter','update','table','8yBkXwd','currentPage','signal','includes','/api/management/library/scripts/save','apiError','tags','\x20\x20pageSize:\x2020,','cli:rabetbase','/smartapi/custom/saveUserCustomSql','const\x20results\x20=\x20data.execResult\x20||\x20[];','/smartapi/dblink/update','/smartapi/lovrabet/update-page','/smartapi/custom/getUserCustomSql','BFF\x20script\x20not\x20found:\x20id=','sdk','enabled','error','dbId','appCode','tableName','/smartapi/custom/updateUserCustomSql','map','pageSize','/smartapi/lovrabet/dataset/','Unauthorized','target','message','/smartapi/db-analysis/start','/sync-to-pages','tableData','cookie','functionName','dataset_','105WGMxdJ','/api/','\x20of\x20','displayName','modelCode','description','Page\x20not\x20found:\x20','abort','.getOne(id);','/smartapi/app-config/getByKey','sqlName','length','errorCode','string','/smartapi/dataset/get-dataset-operation','create','scriptName','type','/smartapi/dataset/get-driven-data?','requestFields','entries','join','operations','operationName','isArray','POST','name','filter','includeImports','status','.remove(id);','253PxDjkT','/generate-standard-pages/start','/smartapi/question/er-config/erCreate','296456gTOPRL','\x22\x20not\x20found\x20in\x20dataset\x20','23877JyzqaQ','list','remove','dbtableConfig','\x20\x20currentPage:\x201,','/smartapi/custom/deleteUserCustomSql','errorMsg','//\x20SQL:\x20','/api/management/library/scripts/statistics?appCode=','/smartapi/dblink/delete','toString','API\x20error:\x20','/smartapi/dblink/getTableDiffV2ByPage','api_error','clientOperationId','code','find','GET','totalCount','operationId','?sqlCode=','/smartapi/dataset/update-driven-data','});','401','/smartapi/question/er-config/update-single','\x20\x20sqlCode:\x20\x27','json','API\x20error\x20code:\x20','stringify','2119914tXMqAB','/api/custom/executeSql','(/*\x20params\x20*/);','103274oHmIny','/smartapi/dblink/create','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','/smartapi/lovrabet/detail?pageId=','set','/smartapi/db-analysis/jobs/cancel','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','Warning:\x20showing\x20first\x20','/smartapi/app-config/update','/smartapi/app/getList','const\x20result\x20=\x20await\x20client.models.','tableList','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','AbortError','planId','modelId','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','/smartapi/dblink/testConnect','value'];a157_0x1603=function(){return _0x54969c;};return a157_0x1603();}export async function listDbLinks(_0x2f9105,_0x48b81d){const _0x4016ff=a157_0x5e9e,_0x476f26=await apiRequest('/smartapi/dblink/getList',{'method':'POST','body':{'appCode':_0x2f9105,'currentPage':_0x48b81d?.[_0x4016ff(0x1cf)]??0x1,'pageSize':_0x48b81d?.[_0x4016ff(0x1e5)]??0x64}});return{'items':extractList(_0x476f26[_0x4016ff(0x1be)]),'paging':extractPaging(_0x476f26[_0x4016ff(0x1be)])};}export async function getDbLinkInfo(_0x42b956){const _0x2cafca=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x42b956}));return _0x2cafca['data'];}export async function createDbLink(_0x44afd9){const _0x2f56b2=a157_0x5e9e,_0xd2ab72=await apiRequest(_0x2f56b2(0x18f),{'method':_0x2f56b2(0x163),'body':_0x44afd9});return _0xd2ab72[_0x2f56b2(0x1be)];}export async function updateDbLink(_0x6a0882){const _0x160a4a=a157_0x5e9e,_0x403de5=await apiRequest(_0x160a4a(0x1d9),{'method':_0x160a4a(0x163),'body':_0x6a0882});return _0x403de5[_0x160a4a(0x1be)];}export async function deleteDbLink(_0x3bf3a4){const _0x122cd4=a157_0x5e9e;await apiRequest(_0x122cd4(0x177),{'method':'POST','body':{'id':_0x3bf3a4}});}export async function testDbLinkConnect(_0x5ab451){const _0x419b1f=a157_0x5e9e,_0x2e08fb=await apiRequest(_0x419b1f(0x1a0)+buildQuery({'id':_0x5ab451}));return _0x2e08fb['data'];}export async function startDbAnalysis(_0x5cd9e7,_0x17d1d4){const _0x8b1c21=a157_0x5e9e,_0x5b3234=await apiRequest(_0x8b1c21(0x1ea),{'method':_0x8b1c21(0x163),'body':{'dbLinkId':_0x5cd9e7,..._0x17d1d4&&_0x17d1d4[_0x8b1c21(0x1fb)]>0x0?{'tableNames':_0x17d1d4}:{}}}),_0xb414ae=_0x5b3234['data'];if(typeof _0xb414ae===_0x8b1c21(0x1fd))return _0xb414ae;if(_0xb414ae&&typeof _0xb414ae===_0x8b1c21(0x1a8)&&typeof _0xb414ae[_0x8b1c21(0x19d)]===_0x8b1c21(0x1fd))return _0xb414ae[_0x8b1c21(0x19d)];return _0xb414ae!=null?String(_0xb414ae):'';}export async function cancelDbAnalysis(_0x13261d){const _0x581eaa=a157_0x5e9e;await apiRequest(_0x581eaa(0x193)+buildQuery({'planId':_0x13261d}),{'method':_0x581eaa(0x163)});}export async function getDbAnalysisStatus(_0x10b39e){const _0xd04a68=a157_0x5e9e,_0x4da2c9=await apiRequest(_0xd04a68(0x1bf)+encodeURIComponent(_0x10b39e));return _0x4da2c9['data'];}export async function getDbAllTableList(_0x3ed18e,_0x36a9c5){const _0x152d64=a157_0x5e9e,_0x515cbc=await apiRequest('/smartapi/dblink/getAllTableList'+buildQuery({'appCode':_0x3ed18e,'dbLinkId':_0x36a9c5})),_0x5ca81a=_0x515cbc[_0x152d64(0x1be)];if(Array[_0x152d64(0x208)](_0x5ca81a))return _0x5ca81a;return extractList(_0x5ca81a);}export async function getDbTableDiff(_0x24ea8f,_0x242904,_0x51dc3c){const _0x51450f=a157_0x5e9e,_0x39e31d=await apiRequest(_0x51450f(0x17a)+buildQuery({'appCode':_0x24ea8f,'dbLinkId':_0x242904,'pageIndex':_0x51dc3c?.['pageIndex']??0x1,'pageSize':_0x51dc3c?.[_0x51450f(0x1e5)]??0x14,'tableName':_0x51dc3c?.[_0x51450f(0x1e2)]})),_0x3949cc=_0x39e31d[_0x51450f(0x1be)];return{'totalCount':_0x3949cc?.['totalCount']??0x0,'tableList':Array['isArray'](_0x3949cc?.[_0x51450f(0x199)])?_0x3949cc[_0x51450f(0x199)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x530bba=a157_0x5e9e,_0x424dae=await apiRequest(_0x530bba(0x197),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x3cbd70=extractList(_0x424dae[_0x530bba(0x1be)]),_0x56735d=extractPaging(_0x424dae[_0x530bba(0x1be)]);return _0x56735d&&_0x56735d['totalCount']>REMOTE_APP_PAGE_SIZE&&console['warn'](_0x530bba(0x195)+REMOTE_APP_PAGE_SIZE+_0x530bba(0x1f2)+_0x56735d[_0x530bba(0x180)]+'\x20apps.\x20'+_0x530bba(0x19a)),_0x3cbd70;}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a158_0x370b1c=a158_0x119e;function a158_0x240f(){const _0x358686=['129WWeEtW','2296lKjATr','bff.lock.json','20TIsFQM','9906CmUsGK','1002639uqwJEA','2762145HAKBLX','bff','10801056CdgZJc','bff-trash','43172JTXnWC','2731715QoAgIP','/bff','47224lxLhmA','.rabetbase'];a158_0x240f=function(){return _0x358686;};return a158_0x240f();}(function(_0x26a92b,_0x2bedbd){const _0x2ebcd9=a158_0x119e,_0x3fba30=_0x26a92b();while(!![]){try{const _0x3dd2c7=parseInt(_0x2ebcd9(0xb1))/0x1+parseInt(_0x2ebcd9(0xaa))/0x2+parseInt(_0x2ebcd9(0xac))/0x3*(parseInt(_0x2ebcd9(0xb6))/0x4)+parseInt(_0x2ebcd9(0xa8))/0x5+-parseInt(_0x2ebcd9(0xb0))/0x6*(parseInt(_0x2ebcd9(0xad))/0x7)+-parseInt(_0x2ebcd9(0xb4))/0x8+-parseInt(_0x2ebcd9(0xb2))/0x9*(-parseInt(_0x2ebcd9(0xaf))/0xa);if(_0x3dd2c7===_0x2bedbd)break;else _0x3fba30['push'](_0x3fba30['shift']());}catch(_0x42cb98){_0x3fba30['push'](_0x3fba30['shift']());}}}(a158_0x240f,0xb943b));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a158_0x119e(_0x37bf76,_0x33e7aa){_0x37bf76=_0x37bf76-0xa8;const _0x240f22=a158_0x240f();let _0x119e48=_0x240f22[_0x37bf76];return _0x119e48;}const DOT_DIR=a158_0x370b1c(0xab),LOCK_FILE_NAME=a158_0x370b1c(0xae),TRASH_DIR_NAME=a158_0x370b1c(0xb5);export function loadBffProjectConfig(_0x2bb5e2,_0x770057){const _0x214bd4=a158_0x370b1c,_0x2211e5=resolve(_0x770057??findProjectRootDirectory()),_0x4755ec=DOT_DIR+_0x214bd4(0xa9),_0x44a9cf=_0x4755ec+'/'+_0x2bb5e2;return{'projectRoot':_0x2211e5,'appCode':_0x2bb5e2,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x4755ec,'scriptsRoot':_0x44a9cf,'scriptsRootDir':resolve(_0x2211e5,DOT_DIR,_0x214bd4(0xb3),_0x2bb5e2),'lockFilePath':resolve(_0x2211e5,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2211e5,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a159_0x345e7b=a159_0x1fd0;(function(_0x20ddca,_0x2eb935){const _0x1e45d0=a159_0x1fd0,_0x52f407=_0x20ddca();while(!![]){try{const _0x59e836=parseInt(_0x1e45d0(0x1d1))/0x1+parseInt(_0x1e45d0(0x1d7))/0x2*(-parseInt(_0x1e45d0(0x1ce))/0x3)+parseInt(_0x1e45d0(0x1e1))/0x4*(parseInt(_0x1e45d0(0x1f2))/0x5)+parseInt(_0x1e45d0(0x1e2))/0x6+parseInt(_0x1e45d0(0x1e0))/0x7+parseInt(_0x1e45d0(0x1e6))/0x8+-parseInt(_0x1e45d0(0x1eb))/0x9;if(_0x59e836===_0x2eb935)break;else _0x52f407['push'](_0x52f407['shift']());}catch(_0x85f730){_0x52f407['push'](_0x52f407['shift']());}}}(a159_0x1d8b,0xae734));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=[a159_0x345e7b(0x1db),'ENDPOINT','HOOK'];export function normalizeBffType(_0x2851db){const _0x574372=a159_0x345e7b;if(!_0x2851db)return undefined;const _0x319452=_0x2851db[_0x574372(0x1ec)]()[_0x574372(0x1d6)]();return SUPPORTED_BFF_TYPES[_0x574372(0x1d8)](_0x319452)?_0x319452:undefined;}async function scanJsFilesRecursively(_0x34020b,_0x3cf3c8){const _0x15a6e4=a159_0x345e7b,_0x271466=[];try{const _0x1d3e29=await readdir(_0x34020b,{'withFileTypes':!![]});for(const _0x2d58e4 of _0x1d3e29){const _0x6109f8=join(_0x34020b,_0x2d58e4[_0x15a6e4(0x1cf)]);if(_0x2d58e4[_0x15a6e4(0x1f4)]())_0x271466[_0x15a6e4(0x1df)](...await scanJsFilesRecursively(_0x6109f8,_0x3cf3c8+'/'+_0x2d58e4[_0x15a6e4(0x1cf)]));else _0x2d58e4[_0x15a6e4(0x1ef)]()&&_0x2d58e4['name'][_0x15a6e4(0x1d9)](_0x15a6e4(0x1cc))&&_0x271466['push']({'lockKey':_0x3cf3c8+'/'+_0x2d58e4[_0x15a6e4(0x1cf)][_0x15a6e4(0x1f0)](/\.js$/,''),'filePath':_0x6109f8});}}catch(_0x456d29){if(_0x456d29[_0x15a6e4(0x1d5)]!==_0x15a6e4(0x1dc))throw _0x456d29;}return _0x271466;}async function scanFlatFunctions(_0x333409,_0x454e20){const _0x4d2e2e=a159_0x345e7b,_0x102505=join(_0x333409[_0x4d2e2e(0x1ea)],_0x454e20),_0x47c1b6=await scanJsFilesRecursively(_0x102505,_0x454e20);return _0x47c1b6[_0x4d2e2e(0x1e4)](({lockKey:_0x4806bb,filePath:_0x10720a})=>({'type':_0x454e20,'name':_0x4806bb[_0x4d2e2e(0x1d3)]('/')['at'](-0x1)??'','filePath':_0x10720a,'lockKey':_0x4806bb}));}async function scanHookFunctions(_0x2b2952){const _0x2d7540=a159_0x345e7b,_0x200ab6=join(_0x2b2952[_0x2d7540(0x1ea)],_0x2d7540(0x1e5)),_0x345aba=[];try{const _0x4860e2=await readdir(_0x200ab6,{'withFileTypes':!![]});for(const _0x159b4d of _0x4860e2){if(!_0x159b4d[_0x2d7540(0x1f4)]())continue;const _0x349e2c=_0x159b4d['name'],_0x3bbe93=join(_0x200ab6,_0x349e2c),_0x4a1ac3=await readdir(_0x3bbe93,{'withFileTypes':!![]});for(const _0x447f18 of _0x4a1ac3){if(!_0x447f18[_0x2d7540(0x1f4)]())continue;const _0x2b84bd=_0x447f18[_0x2d7540(0x1cf)],_0x3cf099=join(_0x3bbe93,_0x2b84bd),_0x3a47e9=await readdir(_0x3cf099,{'withFileTypes':!![]});for(const _0x5c293f of _0x3a47e9){if(!_0x5c293f[_0x2d7540(0x1f4)]())continue;const _0x1e3f3f=_0x5c293f[_0x2d7540(0x1cf)],_0x3f5301=join(_0x3cf099,_0x1e3f3f),_0x5538ae=await readdir(_0x3f5301,{'withFileTypes':!![]});for(const _0xa18fc1 of _0x5538ae){if(!_0xa18fc1[_0x2d7540(0x1ef)]()||!_0xa18fc1['name'][_0x2d7540(0x1d9)](_0x2d7540(0x1cc)))continue;const _0x34c62a=_0xa18fc1['name'][_0x2d7540(0x1f0)](/\.js$/,'');_0x345aba[_0x2d7540(0x1df)]({'type':_0x2d7540(0x1e5),'name':_0x34c62a,'filePath':join(_0x3f5301,_0xa18fc1[_0x2d7540(0x1cf)]),'lockKey':_0x2d7540(0x1f3)+_0x349e2c+'/'+_0x2b84bd+'/'+_0x1e3f3f+'/'+_0x34c62a,'alias':_0x349e2c,'operationType':_0x2b84bd,'functionNode':_0x1e3f3f});}}}}}catch(_0x3661ca){if(_0x3661ca[_0x2d7540(0x1d5)]!==_0x2d7540(0x1dc))throw _0x3661ca;}return _0x345aba;}export async function scanLocalBffFunctions(_0x510234,_0x425140){const _0x451a69=a159_0x345e7b;if(_0x425140===_0x451a69(0x1db)||_0x425140==='ENDPOINT')return scanFlatFunctions(_0x510234,_0x425140);if(_0x425140==='HOOK')return scanHookFunctions(_0x510234);const [_0x4a3447,_0x354872,_0x5db91e]=await Promise[_0x451a69(0x1de)]([scanFlatFunctions(_0x510234,_0x451a69(0x1db)),scanFlatFunctions(_0x510234,_0x451a69(0x1dd)),scanHookFunctions(_0x510234)]);return[..._0x4a3447,..._0x354872,..._0x5db91e];}export function resolveLocalFilePathFromLockKey(_0x2df807,_0x33bde7){const _0x88e46=a159_0x345e7b;return join(_0x2df807[_0x88e46(0x1ea)],..._0x33bde7[_0x88e46(0x1d3)]('/'))+_0x88e46(0x1cc);}function a159_0x1fd0(_0x5ea71c,_0xb0a440){_0x5ea71c=_0x5ea71c-0x1cc;const _0x1d8b82=a159_0x1d8b();let _0x1fd097=_0x1d8b82[_0x5ea71c];return _0x1fd097;}export function createHookLocationMap(_0x5cebfa){const _0x43a62f=a159_0x345e7b,_0x4dcc6d=new Map();for(const _0x4be860 of _0x5cebfa){_0x4be860[_0x43a62f(0x1ee)]&&_0x4dcc6d[_0x43a62f(0x1e9)](_0x4be860[_0x43a62f(0x1ee)],{'datasetCode':_0x4be860[_0x43a62f(0x1d0)],'operationType':snakeToCamel(_0x4be860[_0x43a62f(0x1e8)]),'functionNode':_0x43a62f(0x1d4)}),_0x4be860[_0x43a62f(0x1f1)]&&_0x4dcc6d[_0x43a62f(0x1e9)](_0x4be860[_0x43a62f(0x1f1)],{'datasetCode':_0x4be860['datasetCode'],'operationType':snakeToCamel(_0x4be860[_0x43a62f(0x1e8)]),'functionNode':_0x43a62f(0x1da)});}return _0x4dcc6d;}export function resolveRemoteScriptTarget(_0x4e6613,_0x3010c2,_0x46b8bf,_0x4dd326,_0x530a59){const _0x2a3167=a159_0x345e7b,_0x3bb3f3=normalizeBffType(_0x3010c2[_0x2a3167(0x1e3)]);if(!_0x3bb3f3||!_0x3010c2[_0x2a3167(0x1e7)])return null;if(_0x3bb3f3===_0x2a3167(0x1e5)){const _0x3e8014=(_0x3010c2['id']?_0x46b8bf[_0x2a3167(0x1d2)](_0x3010c2['id']):undefined)??findHookLocationByRemoteId(_0x4dd326,_0x3010c2['id']);if(!_0x3e8014)return null;const _0x3b501f=_0x3e8014[_0x2a3167(0x1ed)]||_0x530a59[_0x2a3167(0x1d2)](_0x3e8014['datasetCode']),_0x3484c4=_0x3b501f??_0x3e8014[_0x2a3167(0x1d0)],_0x1c34df={..._0x3e8014,'alias':_0x3b501f},_0x4e0714='HOOK/'+_0x3484c4+'/'+_0x1c34df[_0x2a3167(0x1e8)]+'/'+_0x1c34df['functionNode']+'/'+_0x3010c2['functionName'];return{'lockKey':_0x4e0714,'filePath':resolveLocalFilePathFromLockKey(_0x4e6613,_0x4e0714),'type':_0x2a3167(0x1e5),'hookLocation':_0x1c34df};}const _0x17e8c7=_0x3bb3f3+'/'+_0x3010c2[_0x2a3167(0x1e7)];return{'lockKey':_0x17e8c7,'filePath':resolveLocalFilePathFromLockKey(_0x4e6613,_0x17e8c7),'type':_0x3bb3f3};}function a159_0x1d8b(){const _0xfdb862=['33065emmEuY','HOOK/','isDirectory','.js','F_OK','207KMfvdw','name','datasetCode','783142SoaMJI','get','split','before','code','toUpperCase','37326AMdtaq','includes','endsWith','after','COMMON','ENOENT','ENDPOINT','all','push','5381404HUrzsI','372mtQbnh','3556698LgTSvL','scriptType','map','HOOK','2452184ehXrmP','functionName','operationType','set','scriptsRootDir','9575406jNwGlW','trim','alias','beforeScriptId','isFile','replace','afterScriptId'];a159_0x1d8b=function(){return _0xfdb862;};return a159_0x1d8b();}export async function ensureParentDirectory(_0x418ba7){await mkdir(dirname(_0x418ba7),{'recursive':!![]});}export async function fileExists(_0xc855ab){const _0x1e88b4=a159_0x345e7b;try{return await access(_0xc855ab,constants[_0x1e88b4(0x1cd)]),!![];}catch{return![];}}export async function directoryExists(_0x4ccd45){const _0x426fdd=a159_0x345e7b;try{const _0x134cc8=await stat(_0x4ccd45);return _0x134cc8[_0x426fdd(0x1f4)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x59f007,_0x33b584){const _0x213b16=a160_0x52e7,_0x157daa=_0x59f007();while(!![]){try{const _0x242127=-parseInt(_0x213b16(0x1f4))/0x1*(parseInt(_0x213b16(0x1ee))/0x2)+parseInt(_0x213b16(0x1eb))/0x3*(-parseInt(_0x213b16(0x1f5))/0x4)+parseInt(_0x213b16(0x1f3))/0x5+parseInt(_0x213b16(0x1f1))/0x6*(parseInt(_0x213b16(0x1f2))/0x7)+parseInt(_0x213b16(0x1f7))/0x8+parseInt(_0x213b16(0x1f9))/0x9+-parseInt(_0x213b16(0x1ef))/0xa*(parseInt(_0x213b16(0x1ed))/0xb);if(_0x242127===_0x33b584)break;else _0x157daa['push'](_0x157daa['shift']());}catch(_0x1694db){_0x157daa['push'](_0x157daa['shift']());}}}(a160_0x6557,0xc6097));function a160_0x6557(){const _0x40eff3=['8952336fTsALW','digest','13507821feKaxO','hex','6141seBSfm','createHash','3335981FDloZS','1597846oHtUZt','50vPEuwd','utf8','879762IpWGoF','14kOVZBf','1670225DsaFhL','1EYERqo','236TyPgyf','md5'];a160_0x6557=function(){return _0x40eff3;};return a160_0x6557();}import{readFile}from'node:fs/promises';import a160_0x23d8d3 from'node:crypto';function a160_0x52e7(_0x1009ac,_0x499d92){_0x1009ac=_0x1009ac-0x1ea;const _0x655772=a160_0x6557();let _0x52e7dd=_0x655772[_0x1009ac];return _0x52e7dd;}export function computeContentHash(_0x4ee3ee){const _0x4b68d1=a160_0x52e7;return a160_0x23d8d3[_0x4b68d1(0x1ec)](_0x4b68d1(0x1f6))['update'](_0x4ee3ee)[_0x4b68d1(0x1f8)](_0x4b68d1(0x1ea));}export async function computeFileHash(_0x4bcd3f){const _0x19e2ad=a160_0x52e7,_0x3b6f36=await readFile(_0x4bcd3f,_0x19e2ad(0x1f0));return computeContentHash(_0x3b6f36);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x46d114,_0x29dba9){const _0x3ea2c5=a161_0x464e,_0x6968b5=_0x46d114();while(!![]){try{const _0x5745bf=-parseInt(_0x3ea2c5(0x1fc))/0x1*(-parseInt(_0x3ea2c5(0x1fe))/0x2)+parseInt(_0x3ea2c5(0x1f8))/0x3*(-parseInt(_0x3ea2c5(0x1f4))/0x4)+-parseInt(_0x3ea2c5(0x1f1))/0x5+-parseInt(_0x3ea2c5(0x200))/0x6*(-parseInt(_0x3ea2c5(0x1ec))/0x7)+parseInt(_0x3ea2c5(0x1f7))/0x8+-parseInt(_0x3ea2c5(0x1ed))/0x9*(parseInt(_0x3ea2c5(0x1e9))/0xa)+-parseInt(_0x3ea2c5(0x1f9))/0xb*(-parseInt(_0x3ea2c5(0x1ea))/0xc);if(_0x5745bf===_0x29dba9)break;else _0x6968b5['push'](_0x6968b5['shift']());}catch(_0x1de237){_0x6968b5['push'](_0x6968b5['shift']());}}}(a161_0x19f6,0x4e763));import{mkdir,readFile,writeFile}from'node:fs/promises';function a161_0x19f6(){const _0x145468=['ENOENT','92310sHidIn','12UIpBTr','object','7ZqvkXN','9lIGDzR','scriptsRoot','stringify','\x22\x20vs\x20lock\x20\x22','2206250lLDbyo','code','apps','218624brieUp','lastSync','parse','249496VJmJJi','3taaxhL','1275846IsLJGb','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','utf8','83oZbyuL','functions','7510hvqpTK','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','2206068pypvfX'];a161_0x19f6=function(){return _0x145468;};return a161_0x19f6();}function a161_0x464e(_0x174276,_0x26ecb8){_0x174276=_0x174276-0x1e8;const _0x19f688=a161_0x19f6();let _0x464e41=_0x19f688[_0x174276];return _0x464e41;}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x3d1b94,_0x398d31,_0x43dff9,_0x42de6c){const _0x754881=a161_0x464e,_0x35ce6c={'apps':_0x3d1b94['apps']&&typeof _0x3d1b94[_0x754881(0x1f3)]===_0x754881(0x1eb)?_0x3d1b94[_0x754881(0x1f3)]:{}};let _0x9c588d=_0x35ce6c['apps'][_0x398d31];if(!_0x9c588d)return _0x9c588d={'scriptsRoot':_0x43dff9,'lastSync':'','functions':{}},_0x35ce6c[_0x754881(0x1f3)][_0x398d31]=_0x9c588d,{'lockData':_0x35ce6c,'appLock':_0x9c588d};if(!_0x9c588d[_0x754881(0x1ee)])_0x9c588d['scriptsRoot']=_0x43dff9;else{if(_0x9c588d['scriptsRoot']!==_0x43dff9)throw new Error(_0x42de6c+':\x20scriptsRoot\x20mismatch\x20—\x20'+('current\x20\x22'+_0x43dff9+_0x754881(0x1f0)+_0x9c588d['scriptsRoot']+'\x22.\x20')+_0x754881(0x1ff));}return!_0x9c588d[_0x754881(0x1fd)]&&(_0x9c588d['functions']={}),!_0x9c588d[_0x754881(0x1f5)]&&(_0x9c588d[_0x754881(0x1f5)]=''),{'lockData':_0x35ce6c,'appLock':_0x9c588d};}export async function readBffLockFile(_0x376cdf){const _0x13ec0f=a161_0x464e;try{const _0xc8e321=await readFile(_0x376cdf,_0x13ec0f(0x1fb)),_0x502b52=JSON[_0x13ec0f(0x1f6)](_0xc8e321);return{'apps':_0x502b52[_0x13ec0f(0x1f3)]&&typeof _0x502b52[_0x13ec0f(0x1f3)]===_0x13ec0f(0x1eb)?_0x502b52[_0x13ec0f(0x1f3)]:{}};}catch(_0x42901c){if(_0x42901c[_0x13ec0f(0x1f2)]===_0x13ec0f(0x1e8))return null;throw new Error(_0x13ec0f(0x1fa)+String(_0x42901c));}}export async function writeBffLockFile(_0x3b2f03,_0x11ce5c){const _0x3291d5=a161_0x464e;await mkdir(dirname(_0x3b2f03),{'recursive':!![]}),await writeFile(_0x3b2f03,JSON[_0x3291d5(0x1ef)](_0x11ce5c,null,0x2),_0x3291d5(0x1fb));}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2ee75b,_0x16afec){const _0x113486=a163_0x1423,_0xf401ed=_0x2ee75b();while(!![]){try{const _0x5358b2=parseInt(_0x113486(0x87))/0x1+-parseInt(_0x113486(0x7e))/0x2*(-parseInt(_0x113486(0x88))/0x3)+-parseInt(_0x113486(0x8e))/0x4*(parseInt(_0x113486(0x86))/0x5)+parseInt(_0x113486(0x81))/0x6+-parseInt(_0x113486(0x8b))/0x7+-parseInt(_0x113486(0x80))/0x8*(-parseInt(_0x113486(0x8d))/0x9)+-parseInt(_0x113486(0x7d))/0xa;if(_0x5358b2===_0x16afec)break;else _0xf401ed['push'](_0xf401ed['shift']());}catch(_0xd78882){_0xf401ed['push'](_0xf401ed['shift']());}}}(a163_0x3818,0x98c90));export function snakeToCamel(_0x2fbbfe){const _0x1e88e2=a163_0x1423;return _0x2fbbfe['toLowerCase']()[_0x1e88e2(0x84)](/_([a-z])/g,(_0x4e3df1,_0x59e911)=>_0x59e911['toUpperCase']());}export function findHookLocationByRemoteId(_0xe1189,_0x4df6a8){const _0x16cabd=a163_0x1423;if(!_0x4df6a8)return undefined;for(const _0x37b039 of Object[_0x16cabd(0x82)](_0xe1189)){if(_0x37b039['remoteId']===_0x4df6a8&&_0x37b039['datasetCode']&&_0x37b039['operationType']&&_0x37b039[_0x16cabd(0x7f)])return{'datasetCode':_0x37b039[_0x16cabd(0x83)],'operationType':_0x37b039[_0x16cabd(0x8a)],'functionNode':_0x37b039['functionNode']};}return undefined;}function a163_0x1423(_0x5eb2f1,_0x5d0cc6){_0x5eb2f1=_0x5eb2f1-0x7c;const _0x3818ef=a163_0x3818();let _0x142385=_0x3818ef[_0x5eb2f1];return _0x142385;}export function extractScriptDescription(_0x1364b6){const _0x40c4b9=a163_0x1423,_0x310cfa=_0x1364b6[_0x40c4b9(0x7c)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x310cfa?.[0x1]?.['trim']()||undefined;}function a163_0x3818(){const _0x5c7258=['values','datasetCode','replace','test','277005VowZqu','594387TjjkVL','2772687LDJiXZ','before','operationType','6001317vqpOwO','after','125532aEnloj','8kHXxjD','match','8262830mFSdPw','2bUNvWO','functionNode','472uTHktg','472056iPClET'];a163_0x3818=function(){return _0x5c7258;};return a163_0x3818();}export function isValidBffFunctionName(_0x271f95){const _0x4a5aa6=a163_0x1423;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x4a5aa6(0x85)](_0x271f95);}export function normalizeHookFunctionNode(_0x205ff9){const _0xddb744=a163_0x1423;if(!_0x205ff9)return undefined;const _0x4535dc=_0x205ff9['trim']()['toLowerCase']();if(_0x4535dc===_0xddb744(0x89)||_0x4535dc===_0xddb744(0x8c))return _0x4535dc;return undefined;}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4dcc31,_0x54eb6f){const _0x5a3015=a164_0x5231,_0x5e5b93=_0x4dcc31();while(!![]){try{const _0xc8ba59=-parseInt(_0x5a3015(0xd6))/0x1*(parseInt(_0x5a3015(0xbf))/0x2)+-parseInt(_0x5a3015(0xc0))/0x3*(parseInt(_0x5a3015(0xd2))/0x4)+-parseInt(_0x5a3015(0xb7))/0x5+-parseInt(_0x5a3015(0xb9))/0x6+-parseInt(_0x5a3015(0xd1))/0x7*(-parseInt(_0x5a3015(0xcf))/0x8)+-parseInt(_0x5a3015(0xc8))/0x9*(parseInt(_0x5a3015(0xb8))/0xa)+parseInt(_0x5a3015(0xc3))/0xb;if(_0xc8ba59===_0x54eb6f)break;else _0x5e5b93['push'](_0x5e5b93['shift']());}catch(_0x4f7161){_0x5e5b93['push'](_0x5e5b93['shift']());}}}(a164_0x67b0,0x8915f));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x2084f1){const _0x27133b=a164_0x5231;if(cache[_0x27133b(0xc7)](_0x2084f1))return cache[_0x27133b(0xcd)](_0x2084f1);const _0x279976=await listDatasets(_0x2084f1),_0x1a892c=new Map();for(const _0x3428eb of _0x279976){const _0xdb1191=_0x3428eb[_0x27133b(0xd5)];_0xdb1191?.['dbId']!=null&&_0x1a892c[_0x27133b(0xd7)](_0xdb1191['dbId'],_0xdb1191[_0x27133b(0xc2)]??_0x27133b(0xbe)+_0xdb1191[_0x27133b(0xbc)]);}const _0x5c5613=[..._0x1a892c[_0x27133b(0xcb)]()]['map'](([_0x146abd,_0xa6e92b])=>({'dbId':_0x146abd,'dbName':_0xa6e92b}));return cache[_0x27133b(0xd7)](_0x2084f1,_0x5c5613),_0x5c5613;}export async function resolveDb(_0x200f89,_0x3fc26e){const _0x51dd0d=a164_0x5231,_0x32d087=await listDatabases(_0x200f89);if(_0x32d087[_0x51dd0d(0xc1)]===0x0)return{'resolved':[],'error':_0x51dd0d(0xca)+_0x200f89+_0x51dd0d(0xce)};if(!_0x3fc26e)return{'resolved':_0x32d087};const _0x5e5761=Number(_0x3fc26e);if(!Number[_0x51dd0d(0xba)](_0x5e5761)){const _0x13f5b0=_0x32d087[_0x51dd0d(0xcc)](_0x384200=>_0x384200[_0x51dd0d(0xbc)]===_0x5e5761);if(_0x13f5b0)return{'resolved':[_0x13f5b0]};}const _0x405b8f=_0x3fc26e['toLowerCase'](),_0x542c72=_0x32d087[_0x51dd0d(0xc5)](_0x382295=>_0x382295['dbName']['toLowerCase']()['includes'](_0x405b8f));if(_0x542c72['length']>0x0)return{'resolved':_0x542c72};const _0x23184d=_0x32d087[_0x51dd0d(0xc6)](_0x4e8e7e=>_0x4e8e7e[_0x51dd0d(0xc2)]+'\x20('+_0x4e8e7e[_0x51dd0d(0xbc)]+')')[_0x51dd0d(0xd4)](',\x20');return{'resolved':[],'error':_0x51dd0d(0xd0)+_0x3fc26e+_0x51dd0d(0xc4)+_0x200f89+_0x51dd0d(0xbb)+_0x23184d+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x568f9d,_0x48ec5a){const _0x396581=a164_0x5231,{resolved:_0x3c19fc,error:_0x397d94}=await resolveDb(_0x568f9d,_0x48ec5a);if(_0x397d94)return{'db':null,'error':_0x397d94};if(_0x3c19fc[_0x396581(0xc1)]===0x1)return{'db':_0x3c19fc[0x0]};if(!_0x48ec5a){const _0x3c8f5b=_0x3c19fc[_0x396581(0xc6)](_0x2cd9ae=>_0x2cd9ae[_0x396581(0xc2)]+'\x20('+_0x2cd9ae['dbId']+')')[_0x396581(0xd4)](',\x20');return{'db':null,'error':_0x396581(0xc9)+_0x3c8f5b};}const _0xf45473=_0x3c19fc[_0x396581(0xc6)](_0x5d485e=>_0x5d485e['dbName']+'\x20('+_0x5d485e['dbId']+')')[_0x396581(0xd4)](',\x20');return{'db':null,'error':'\x22'+_0x48ec5a+_0x396581(0xbd)+_0xf45473+_0x396581(0xd3)};}export async function getDbName(_0x4261a2,_0x1bff86){const _0x30a39f=a164_0x5231,_0x406c95=await listDatabases(_0x4261a2);return _0x406c95[_0x30a39f(0xcc)](_0x34b722=>_0x34b722[_0x30a39f(0xbc)]===_0x1bff86)?.[_0x30a39f(0xc2)];}function a164_0x5231(_0x9160e0,_0x6b8e92){_0x9160e0=_0x9160e0-0xb7;const _0x67b00e=a164_0x67b0();let _0x523110=_0x67b00e[_0x9160e0];return _0x523110;}function a164_0x67b0(){const _0x1e8f73=['dbtableConfig','1DABaoF','set','3681750iBnPHo','40nTzkeY','2844606bTDcNP','isNaN','\x22.\x20Available:\x20','dbId','\x22\x20matches\x20multiple\x20databases:\x20','db-','1121044eSyzXd','3NzhREb','length','dbName','41275410FCdJcd','\x22\x20under\x20app\x20\x22','filter','map','has','1960416AsStGz','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','entries','find','get','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','32744DhgJLa','No\x20database\x20matching\x20\x22','35AGmegH','2276012xVUTwN','.\x20Be\x20more\x20specific.','join'];a164_0x67b0=function(){return _0x1e8f73;};return a164_0x67b0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a165_0x411a(){const _0x576120=['6kXKQFx','F_OK','3922855Lfurci','258600xxslbG','5917150myFfIK','toUpperCase','329688utbwjm','.rabetbase','8HPKNxi','117RUFbsh','appPagesDir','8279789zSuABr','252TQZpcX','page','page.lock.json','800211gwraEB','1144oqCasf','.json','19262wEdvZh'];a165_0x411a=function(){return _0x576120;};return a165_0x411a();}(function(_0x3104a9,_0x36e826){const _0x23f59a=a165_0x4cb8,_0x4098fe=_0x3104a9();while(!![]){try{const _0x30b376=-parseInt(_0x23f59a(0x1b5))/0x1+-parseInt(_0x23f59a(0x1b8))/0x2*(-parseInt(_0x23f59a(0x1af))/0x3)+parseInt(_0x23f59a(0x1ae))/0x4*(-parseInt(_0x23f59a(0x1bb))/0x5)+-parseInt(_0x23f59a(0x1b9))/0x6*(parseInt(_0x23f59a(0x1b1))/0x7)+-parseInt(_0x23f59a(0x1ac))/0x8*(-parseInt(_0x23f59a(0x1b2))/0x9)+parseInt(_0x23f59a(0x1bd))/0xa+parseInt(_0x23f59a(0x1b6))/0xb*(parseInt(_0x23f59a(0x1bc))/0xc);if(_0x30b376===_0x36e826)break;else _0x4098fe['push'](_0x4098fe['shift']());}catch(_0x13cb1f){_0x4098fe['push'](_0x4098fe['shift']());}}}(a165_0x411a,0xc5d0c));function a165_0x4cb8(_0x2cc7c1,_0x29b3ed){_0x2cc7c1=_0x2cc7c1-0x1ac;const _0x411a2c=a165_0x411a();let _0x4cb882=_0x411a2c[_0x2cc7c1];return _0x4cb882;}import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x88fa38,_0x366df2=process['cwd']()){const _0x14b717=a165_0x4cb8,_0x38fbab=resolve(_0x366df2),_0x101dfc=join(_0x38fbab,_0x14b717(0x1ad),_0x14b717(0x1b3));return{'projectRoot':_0x38fbab,'pagesBaseDir':_0x101dfc,'appPagesDir':join(_0x101dfc,_0x88fa38),'lockFilePath':join(_0x38fbab,_0x14b717(0x1ad),_0x14b717(0x1b4))};}export function buildPageFileName(_0x366b5f,_0x418d27){const _0x19a7df=a165_0x4cb8;return _0x366b5f+'-'+String(_0x418d27)[_0x19a7df(0x1be)]()+_0x19a7df(0x1b7);}export function resolvePageFilePath(_0x56325d,_0x2d1ea6,_0x1139ba){const _0x325554=a165_0x4cb8;return join(_0x56325d[_0x325554(0x1b0)],buildPageFileName(_0x2d1ea6,_0x1139ba));}export async function ensureParentDirectory(_0x1ea0a){await mkdir(dirname(_0x1ea0a),{'recursive':!![]});}export async function fileExists(_0x34f51f){const _0x42cd91=a165_0x4cb8;try{return await access(_0x34f51f,constants[_0x42cd91(0x1ba)]),!![];}catch{return![];}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3f8ade,_0x250141){const _0x4a3506=a166_0x44ae,_0x2cd6c7=_0x3f8ade();while(!![]){try{const _0x2ef755=-parseInt(_0x4a3506(0xfe))/0x1*(-parseInt(_0x4a3506(0xff))/0x2)+-parseInt(_0x4a3506(0xf2))/0x3*(-parseInt(_0x4a3506(0xef))/0x4)+parseInt(_0x4a3506(0xf3))/0x5*(parseInt(_0x4a3506(0xf1))/0x6)+parseInt(_0x4a3506(0xf0))/0x7*(-parseInt(_0x4a3506(0xf5))/0x8)+parseInt(_0x4a3506(0xf6))/0x9*(-parseInt(_0x4a3506(0xfb))/0xa)+parseInt(_0x4a3506(0xfc))/0xb+parseInt(_0x4a3506(0xf4))/0xc*(-parseInt(_0x4a3506(0xfd))/0xd);if(_0x2ef755===_0x250141)break;else _0x2cd6c7['push'](_0x2cd6c7['shift']());}catch(_0xecc6b8){_0x2cd6c7['push'](_0x2cd6c7['shift']());}}}(a166_0x531e,0xd792b));function a166_0x44ae(_0x156478,_0x2330f8){_0x156478=_0x156478-0xee;const _0x531e35=a166_0x531e();let _0x44aee5=_0x531e35[_0x156478];return _0x44aee5;}import a166_0x40cb33 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x548ec4){const _0x426b3f=a166_0x44ae;return JSON[_0x426b3f(0xf9)](JSON[_0x426b3f(0xee)](_0x548ec4),null,0x2)+'\x0a';}export function computePageContentHash(_0x215dcb){const _0x2e34ca=a166_0x44ae;return a166_0x40cb33[_0x2e34ca(0xf8)](_0x2e34ca(0xfa))['update'](_0x215dcb)['digest'](_0x2e34ca(0x100));}export function computeSerializedSchemaHash(_0x3d1c49){return computePageContentHash(serializePageSchemaForFile(_0x3d1c49));}function a166_0x531e(){const _0x1d27a0=['1034603rNCTBm','2DDcTXi','hex','parse','8hUQDIh','7kmIdzf','60iZwMUh','1563741IOAqMY','836065wGTTOv','4980ShmTaE','3031384idiknh','2488203ABwDGY','utf8','createHash','stringify','md5','20IYrPwa','18624452UNtVDu','113633gRSVtP'];a166_0x531e=function(){return _0x1d27a0;};return a166_0x531e();}export async function computePageFileHash(_0x3c286d){const _0x553244=a166_0x44ae,_0x1759a7=await readFile(_0x3c286d,_0x553244(0xf7));return computePageContentHash(_0x1759a7);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x51e96b,_0x562bd1){const _0x97ca3e=a167_0x3f35,_0x4beec9=_0x51e96b();while(!![]){try{const _0x451129=parseInt(_0x97ca3e(0x14c))/0x1*(parseInt(_0x97ca3e(0x145))/0x2)+-parseInt(_0x97ca3e(0x14d))/0x3*(parseInt(_0x97ca3e(0x142))/0x4)+-parseInt(_0x97ca3e(0x14b))/0x5+-parseInt(_0x97ca3e(0x141))/0x6+parseInt(_0x97ca3e(0x14f))/0x7*(parseInt(_0x97ca3e(0x149))/0x8)+-parseInt(_0x97ca3e(0x151))/0x9+parseInt(_0x97ca3e(0x152))/0xa;if(_0x451129===_0x562bd1)break;else _0x4beec9['push'](_0x4beec9['shift']());}catch(_0x44c89d){_0x4beec9['push'](_0x4beec9['shift']());}}}(a167_0x9cda,0x1b423));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x45236a,_0x27a797){const _0x402f59=a167_0x3f35,_0x33a394={'apps':_0x45236a[_0x402f59(0x150)]&&typeof _0x45236a['apps']===_0x402f59(0x14e)?_0x45236a[_0x402f59(0x150)]:{}};let _0x24498b=_0x33a394[_0x402f59(0x150)][_0x27a797];if(!_0x24498b)return _0x24498b={'lastSync':'','pages':{}},_0x33a394[_0x402f59(0x150)][_0x27a797]=_0x24498b,{'lockData':_0x33a394,'appLock':_0x24498b};return!_0x24498b[_0x402f59(0x146)]&&(_0x24498b[_0x402f59(0x146)]=''),(!_0x24498b['pages']||typeof _0x24498b[_0x402f59(0x148)]!==_0x402f59(0x14e))&&(_0x24498b['pages']={}),{'lockData':_0x33a394,'appLock':_0x24498b};}export async function readPageLockFile(_0x1ab5ea){const _0x4ec7b5=a167_0x3f35;try{const _0x35ddb5=await readFile(_0x1ab5ea,_0x4ec7b5(0x140)),_0x210dd2=JSON[_0x4ec7b5(0x147)](_0x35ddb5);return{'apps':_0x210dd2[_0x4ec7b5(0x150)]&&typeof _0x210dd2[_0x4ec7b5(0x150)]===_0x4ec7b5(0x14e)?_0x210dd2['apps']:{}};}catch(_0x232363){if(_0x232363['code']===_0x4ec7b5(0x143))return null;throw new Error(_0x4ec7b5(0x14a)+String(_0x232363));}}export async function writePageLockFile(_0xb440d2,_0x451e45){const _0x58f78c=a167_0x3f35;await mkdir(dirname(_0xb440d2),{'recursive':!![]}),await writeFile(_0xb440d2,JSON[_0x58f78c(0x144)](_0x451e45,null,0x2),_0x58f78c(0x140));}function a167_0x3f35(_0x324467,_0x561830){_0x324467=_0x324467-0x140;const _0x9cda4d=a167_0x9cda();let _0x3f35e6=_0x9cda4d[_0x324467];return _0x3f35e6;}function a167_0x9cda(){const _0x4170c7=['stringify','2zrALvd','lastSync','parse','pages','531736XHjDwY','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','745270oyYuOd','197356wsWzDu','6QzyoHW','object','7tslGYO','apps','1073259hLtTcG','2786430zGosbp','utf8','401424qctXcp','191212SAYEBv','ENOENT'];a167_0x9cda=function(){return _0x4170c7;};return a167_0x9cda();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a169_0x2aa862=a169_0x188e;function a169_0x188e(_0x151482,_0x48eb72){_0x151482=_0x151482-0x6f;const _0x2e9521=a169_0x2e95();let _0x188ee3=_0x2e9521[_0x151482];return _0x188ee3;}(function(_0x1755a0,_0x433da9){const _0x3f68ff=a169_0x188e,_0x1a0fcb=_0x1755a0();while(!![]){try{const _0x31e6ab=parseInt(_0x3f68ff(0x7d))/0x1+-parseInt(_0x3f68ff(0x72))/0x2+parseInt(_0x3f68ff(0x7a))/0x3*(parseInt(_0x3f68ff(0x7e))/0x4)+parseInt(_0x3f68ff(0x73))/0x5*(parseInt(_0x3f68ff(0x71))/0x6)+parseInt(_0x3f68ff(0x74))/0x7*(-parseInt(_0x3f68ff(0x70))/0x8)+-parseInt(_0x3f68ff(0x78))/0x9*(parseInt(_0x3f68ff(0x77))/0xa)+parseInt(_0x3f68ff(0x75))/0xb;if(_0x31e6ab===_0x433da9)break;else _0x1a0fcb['push'](_0x1a0fcb['shift']());}catch(_0x14a164){_0x1a0fcb['push'](_0x1a0fcb['shift']());}}}(a169_0x2e95,0xdb380));function a169_0x2e95(){const _0x454304=['sql.lock.json','282536NFqkYi','6OFwJJd','1381110iKvcQj','990655qFFonG','301oGuoKg','25241205uElQii','sql','776950ZTYpRV','207BzGpkv','sql-trash','1875306ThnMxV','/sql','.rabetbase','1776203yoiqCo','4UYPoYZ'];a169_0x2e95=function(){return _0x454304;};return a169_0x2e95();}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a169_0x2aa862(0x7c),LOCK_FILE_NAME=a169_0x2aa862(0x6f),TRASH_DIR_NAME=a169_0x2aa862(0x79);export function loadSqlProjectConfig(_0x1f08f4,_0x247ac5){const _0x47f1af=a169_0x2aa862,_0x4c44e4=resolve(_0x247ac5??findProjectRootDirectory()),_0x7a1cb0=DOT_DIR+_0x47f1af(0x7b),_0x365714=_0x7a1cb0+'/'+_0x1f08f4;return{'projectRoot':_0x4c44e4,'appCode':_0x1f08f4,'sqlWorkspaceRoot':_0x7a1cb0,'sqlRoot':_0x365714,'sqlRootDir':resolve(_0x4c44e4,DOT_DIR,_0x47f1af(0x76),_0x1f08f4),'lockFilePath':resolve(_0x4c44e4,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4c44e4,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27cbbf,_0x211ed1){const _0x328c98=a170_0x597b,_0x54219f=_0x27cbbf();while(!![]){try{const _0x575801=parseInt(_0x328c98(0x11b))/0x1*(-parseInt(_0x328c98(0x11d))/0x2)+parseInt(_0x328c98(0x122))/0x3+parseInt(_0x328c98(0x11c))/0x4*(parseInt(_0x328c98(0x10f))/0x5)+parseInt(_0x328c98(0x11a))/0x6+-parseInt(_0x328c98(0x110))/0x7+-parseInt(_0x328c98(0x10d))/0x8+parseInt(_0x328c98(0x107))/0x9;if(_0x575801===_0x211ed1)break;else _0x54219f['push'](_0x54219f['shift']());}catch(_0xad038a){_0x54219f['push'](_0x54219f['shift']());}}}(a170_0x33ea,0xbc6c4));import{readdir,stat}from'node:fs/promises';function a170_0x33ea(){const _0x5f302e=['split','toLowerCase','indexOf','3962344YLSQHD','name','822165OETJxV','1690549gMUhpO','isDirectory','isFile','.xml','slice','sqlCode','path','sqlRootDir','sql','test','955398RGZCwV','7724tYtFEU','8wNtaUq','304kPitIi','push','mybatisXml','.sql','sqlName','4362747yhCNeu','mode','dbId','6662520YqeXvk','length','dbName'];a170_0x33ea=function(){return _0x5f302e;};return a170_0x33ea();}import{extname,join,relative}from'node:path';function a170_0x597b(_0x48b7f2,_0x319777){_0x48b7f2=_0x48b7f2-0x107;const _0x33eac1=a170_0x33ea();let _0x597b5c=_0x33eac1[_0x48b7f2];return _0x597b5c;}import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x43a36e){const _0x61c886=a170_0x597b;if(_0x43a36e===_0x61c886(0x120))return _0x61c886(0x118);if(_0x43a36e===_0x61c886(0x113))return _0x61c886(0x11f);return undefined;}async function scanSqlFilesRecursively(_0x49ea0e,_0x221092){const _0x4ae5e8=a170_0x597b,_0x24d811=[];try{const _0xc53248=await readdir(_0x49ea0e,{'withFileTypes':!![]});for(const _0x581180 of _0xc53248){const _0x357bae=join(_0x49ea0e,_0x581180[_0x4ae5e8(0x10e)]);if(_0x581180[_0x4ae5e8(0x111)]()){_0x24d811[_0x4ae5e8(0x11e)](...await scanSqlFilesRecursively(_0x357bae,_0x221092));continue;}if(!_0x581180[_0x4ae5e8(0x112)]())continue;const _0x7d0e45=extname(_0x581180['name'])[_0x4ae5e8(0x10b)](),_0x354818=extensionToMode(_0x7d0e45);if(!_0x354818)continue;const _0x3a9532=relative(_0x221092,_0x357bae)['replace'](/\\/g,'/'),_0xf10fe6=_0x3a9532[_0x4ae5e8(0x10a)]('/')['filter'](Boolean),_0x396588=parseSqlPath(_0xf10fe6,_0x581180['name'],_0x7d0e45);if(!_0x396588)continue;_0x24d811[_0x4ae5e8(0x11e)]({'sqlCode':_0x396588['sqlCode'],'sqlName':_0x396588[_0x4ae5e8(0x121)],'dbDirectory':_0xf10fe6[0x0],'filePath':_0x357bae,'relativePath':_0x3a9532,'lockKey':_0x396588[_0x4ae5e8(0x115)],'mode':_0x354818});}}catch(_0x35aedd){if(_0x35aedd['code']!=='ENOENT')throw _0x35aedd;}return _0x24d811;}export async function scanLocalSqlQueries(_0x19ddd7){return scanSqlFilesRecursively(_0x19ddd7['sqlRootDir'],_0x19ddd7['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x4f5e7b,_0x585c62,_0x333762){const _0x2f2cfb=a170_0x597b,_0x5883f6=_0x333762?.[_0x2f2cfb(0x116)]||(_0x333762?.[_0x2f2cfb(0x121)]||_0x333762?.[_0x2f2cfb(0x109)]?buildSqlRelativePath(_0x585c62,_0x333762?.[_0x2f2cfb(0x121)],_0x333762?.['dbName'],_0x333762?.[_0x2f2cfb(0x123)]||_0x2f2cfb(0x118),_0x333762?.[_0x2f2cfb(0x124)]):buildDefaultSqlFileName(_0x585c62,_0x333762?.[_0x2f2cfb(0x123)]||'sql'));return join(_0x4f5e7b[_0x2f2cfb(0x117)],_0x5883f6);}export async function directoryExists(_0x553267){const _0x3714dd=a170_0x597b;try{const _0x1d8dba=await stat(_0x553267);return _0x1d8dba[_0x3714dd(0x111)]();}catch{return![];}}function parseSqlPath(_0xb1098c,_0x144bcf,_0x2c36a3){const _0x1061f1=a170_0x597b,_0x319774=_0x144bcf['slice'](0x0,-_0x2c36a3[_0x1061f1(0x108)]);if(_0xb1098c[_0x1061f1(0x108)]<0x2)return null;const _0x28f1c2=_0x319774[_0x1061f1(0x10c)]('_');if(_0x28f1c2<=0x0||_0x28f1c2>=_0x319774['length']-0x1)return null;const _0x417eac=_0x319774[_0x1061f1(0x114)](0x0,_0x28f1c2);if(!isLikelySqlCode(_0x417eac))return null;return{'sqlCode':_0x417eac,'sqlName':_0x319774[_0x1061f1(0x114)](_0x28f1c2+0x1)};}function isLikelySqlCode(_0x16e47a){const _0x36b023=a170_0x597b;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x36b023(0x119)](_0x16e47a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x250797,_0x4de41f){const _0x44895d=a171_0xe307,_0x4e34e5=_0x250797();while(!![]){try{const _0x6349e9=-parseInt(_0x44895d(0x1bd))/0x1*(parseInt(_0x44895d(0x1bb))/0x2)+parseInt(_0x44895d(0x1b3))/0x3+-parseInt(_0x44895d(0x1b9))/0x4*(parseInt(_0x44895d(0x1b5))/0x5)+parseInt(_0x44895d(0x1b6))/0x6+parseInt(_0x44895d(0x1be))/0x7*(-parseInt(_0x44895d(0x1b1))/0x8)+-parseInt(_0x44895d(0x1b4))/0x9+parseInt(_0x44895d(0x1b2))/0xa;if(_0x6349e9===_0x4de41f)break;else _0x4e34e5['push'](_0x4e34e5['shift']());}catch(_0x2b0b53){_0x4e34e5['push'](_0x4e34e5['shift']());}}}(a171_0x25f2,0x81b4b));import{readFile}from'node:fs/promises';function a171_0x25f2(){const _0xab1fba=['4130976xWeVCO','digest','createHash','26980OsnZAm','hex','681946XMZuTz','update','2LDAhPH','1652Wmxulv','34928TEhUNN','16966490SnIEmd','2985909PUXiYA','1915074OKCnPf','685GNGiiT'];a171_0x25f2=function(){return _0xab1fba;};return a171_0x25f2();}import a171_0x220cdf from'node:crypto';function a171_0xe307(_0x5f186d,_0x303bc7){_0x5f186d=_0x5f186d-0x1b1;const _0x25f2ea=a171_0x25f2();let _0xe30743=_0x25f2ea[_0x5f186d];return _0xe30743;}export function computeSqlContentHash(_0x38b797){const _0x59be3c=a171_0xe307;return a171_0x220cdf[_0x59be3c(0x1b8)]('md5')[_0x59be3c(0x1bc)](_0x38b797)[_0x59be3c(0x1b7)](_0x59be3c(0x1ba));}export async function computeSqlFileHash(_0x26bb61){const _0x415c7f=await readFile(_0x26bb61,'utf8');return computeSqlContentHash(_0x415c7f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f2138,_0x2ccd07){const _0x3fa1d0=a172_0x4ada,_0x4adcf9=_0x4f2138();while(!![]){try{const _0x13e785=parseInt(_0x3fa1d0(0xe1))/0x1*(-parseInt(_0x3fa1d0(0xe2))/0x2)+parseInt(_0x3fa1d0(0xf2))/0x3+-parseInt(_0x3fa1d0(0xf0))/0x4+parseInt(_0x3fa1d0(0xe4))/0x5+parseInt(_0x3fa1d0(0xe9))/0x6+-parseInt(_0x3fa1d0(0xf1))/0x7*(-parseInt(_0x3fa1d0(0xf4))/0x8)+parseInt(_0x3fa1d0(0xe5))/0x9*(parseInt(_0x3fa1d0(0xe8))/0xa);if(_0x13e785===_0x2ccd07)break;else _0x4adcf9['push'](_0x4adcf9['shift']());}catch(_0xcd5206){_0x4adcf9['push'](_0x4adcf9['shift']());}}}(a172_0x2171,0xe72b5));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}function a172_0x4ada(_0x387496,_0x19f3fc){_0x387496=_0x387496-0xe0;const _0x21711b=a172_0x2171();let _0x4ada9d=_0x21711b[_0x387496];return _0x4ada9d;}export function ensureSqlLockScope(_0x4b36cc,_0x57254c,_0x49a1aa,_0x3906b8){const _0x3f1a34=a172_0x4ada,_0x562e6c=_0x4b36cc??createEmptySqlLock();let _0x54e8bc=_0x562e6c['apps'][_0x57254c];if(!_0x54e8bc)return _0x54e8bc={'sqlRoot':_0x49a1aa,'lastSync':'','sqls':{}},_0x562e6c[_0x3f1a34(0xea)][_0x57254c]=_0x54e8bc,{'lockData':_0x562e6c,'appLock':_0x54e8bc};if(!_0x54e8bc[_0x3f1a34(0xe7)])_0x54e8bc['sqlRoot']=_0x49a1aa;else{if(_0x54e8bc[_0x3f1a34(0xe7)]!==_0x49a1aa)throw new Error(_0x3906b8+':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'+_0x49a1aa+_0x3f1a34(0xed)+_0x54e8bc[_0x3f1a34(0xe7)]+_0x3f1a34(0xf3)+_0x3f1a34(0xf5));}return!_0x54e8bc[_0x3f1a34(0xec)]&&(_0x54e8bc['sqls']={}),!_0x54e8bc[_0x3f1a34(0xee)]&&(_0x54e8bc[_0x3f1a34(0xee)]=''),{'lockData':_0x562e6c,'appLock':_0x54e8bc};}function a172_0x2171(){const _0x6c4ae2=['Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','utf8','65oUYDgX','39690SRYqVu','code','3529135oFveJp','7281ZhMsZA','stringify','sqlRoot','7930jVYCnc','4866912tFGVIR','apps','ENOENT','sqls','\x22\x20vs\x20lock\x20\x22','lastSync','parse','5730724yopxOu','122423JhokuU','1279923VbSfSq','\x22.\x20','496QcvRhR'];a172_0x2171=function(){return _0x6c4ae2;};return a172_0x2171();}export async function readSqlLockFile(_0x30f9e0){const _0x5e4274=a172_0x4ada;try{const _0x51a034=await readFile(_0x30f9e0,_0x5e4274(0xe0));return JSON[_0x5e4274(0xef)](_0x51a034);}catch(_0x382725){if(_0x382725[_0x5e4274(0xe3)]===_0x5e4274(0xeb))return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x382725));}}export async function writeSqlLockFile(_0x2bb503,_0x2fd4e9){const _0x369c01=a172_0x4ada;await mkdir(dirname(_0x2bb503),{'recursive':!![]}),await writeFile(_0x2bb503,JSON[_0x369c01(0xe6)](_0x2fd4e9,null,0x2),_0x369c01(0xe0));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x37a045,_0x45891c){const _0x48bd19=a174_0x12a3,_0x5841e1=_0x37a045();while(!![]){try{const _0x24cdce=-parseInt(_0x48bd19(0x7d))/0x1*(-parseInt(_0x48bd19(0x79))/0x2)+parseInt(_0x48bd19(0x7a))/0x3*(-parseInt(_0x48bd19(0x82))/0x4)+-parseInt(_0x48bd19(0x84))/0x5*(-parseInt(_0x48bd19(0x80))/0x6)+-parseInt(_0x48bd19(0x7f))/0x7+parseInt(_0x48bd19(0x86))/0x8*(parseInt(_0x48bd19(0x76))/0x9)+parseInt(_0x48bd19(0x81))/0xa*(parseInt(_0x48bd19(0x78))/0xb)+-parseInt(_0x48bd19(0x7c))/0xc;if(_0x24cdce===_0x45891c)break;else _0x5841e1['push'](_0x5841e1['shift']());}catch(_0x5e28d1){_0x5841e1['push'](_0x5841e1['shift']());}}}(a174_0x1e9d,0x22867));function a174_0x12a3(_0xdf912b,_0x247b80){_0xdf912b=_0xdf912b-0x75;const _0x1e9d7e=a174_0x1e9d();let _0x12a376=_0x1e9d7e[_0xdf912b];return _0x12a376;}export function detectSqlMode(_0x2edc13){const _0x42fe7f=a174_0x12a3,_0x16b04d=_0x2edc13['trimStart']();if(/^<(select|insert|update|delete)\b/i['test'](_0x16b04d))return _0x42fe7f(0x7b);return'sql';}function a174_0x1e9d(){const _0x3f2099=['unknown-db','951258WvTNwx','416850XaKpyw','10kEZLwm','175772qBzvCX','db-','5swzGSZ','.xml','56EhSobg','unknown-sql','311607bVORHa','replace','1523566lcUxJF','135568LdgrYb','3ZrsqIP','mybatisXml','3175896qaSgfX','2npJUog'];a174_0x1e9d=function(){return _0x3f2099;};return a174_0x1e9d();}export function getSqlFileExtension(_0x3ff197){const _0x1f53a7=a174_0x12a3;return _0x3ff197===_0x1f53a7(0x7b)?_0x1f53a7(0x85):'.sql';}export function buildDefaultSqlFileName(_0x41252f,_0x2ec3c1){return''+_0x41252f+getSqlFileExtension(_0x2ec3c1);}export function sanitizeSqlPathSegment(_0x14e7db,_0x4fc02c){const _0x18789e=a174_0x12a3,_0x5c0ad7=String(_0x14e7db??'')['trim'](),_0x428282=_0x5c0ad7[_0x18789e(0x77)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')['replace'](/\s+/g,'-')[_0x18789e(0x77)](/-+/g,'-')[_0x18789e(0x77)](/^\.+/,'')['replace'](/\.+$/,'')[_0x18789e(0x77)](/^-+/,'')[_0x18789e(0x77)](/-+$/,'');return _0x428282||_0x4fc02c;}export function buildDbDirectoryName(_0x3ba733,_0x23748c){const _0x58e909=a174_0x12a3;return sanitizeSqlPathSegment(_0x3ba733,_0x23748c!=null?_0x58e909(0x83)+_0x23748c:_0x58e909(0x7e));}export function buildSqlRelativePath(_0x39641f,_0x4b212c,_0x2860d0,_0x24ed01,_0x17153c){const _0x3650a8=a174_0x12a3,_0x2b1f1e=buildDbDirectoryName(_0x2860d0,_0x17153c),_0x5da061=sanitizeSqlPathSegment(_0x39641f,_0x3650a8(0x75)),_0x4630a1=sanitizeSqlPathSegment(_0x4b212c,_0x5da061);return _0x2b1f1e+'/'+_0x5da061+'_'+_0x4630a1+getSqlFileExtension(_0x24ed01);}
|