@lovrabet/rabetbase-cli 2.3.12 → 2.3.13-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1659ec,_0x17a988){const _0x1ded0e=a197_0x54ab,_0x113366=_0x1659ec();while(!![]){try{const _0x5cafc=parseInt(_0x1ded0e(0x249))/0x1+-parseInt(_0x1ded0e(0x227))/0x2+parseInt(_0x1ded0e(0x1f9))/0x3+-parseInt(_0x1ded0e(0x242))/0x4*(-parseInt(_0x1ded0e(0x215))/0x5)+parseInt(_0x1ded0e(0x217))/0x6*(parseInt(_0x1ded0e(0x281))/0x7)+parseInt(_0x1ded0e(0x23b))/0x8+-parseInt(_0x1ded0e(0x228))/0x9;if(_0x5cafc===_0x17a988)break;else _0x113366['push'](_0x113366['shift']());}catch(_0xf88007){_0x113366['push'](_0x113366['shift']());}}}(a197_0x1bb2,0x22010));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x6a081){_activeCookie=_0x6a081||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x2be529,_0x22bb2a){const _0x17b62d=a197_0x54ab,_0x30460c=_0x22bb2a instanceof Error?_0x22bb2a['message']:String(_0x22bb2a);return CliErrors['apiError'](_0x17b62d(0x26e)+_0x2be529+(_0x30460c?'\x20('+_0x30460c+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x320d3e,_0x3022f2={}){const _0x3e69bb=a197_0x54ab,{method:method=_0x3e69bb(0x2a8),body:_0x52778d,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x3022f2,_0x1b6ae7=useRuntime?getRuntimeDomain():getApiDomain(),_0x505553=_activeCookie||getCookie(),_0x58a40e=''+_0x1b6ae7+_0x320d3e,_0x29484f=new AbortController(),_0x76145=setTimeout(()=>_0x29484f[_0x3e69bb(0x1d9)](),timeout);try{const _0x5e80e5=await fetch(_0x58a40e,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x505553,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x52778d?JSON['stringify'](_0x52778d):undefined,'signal':_0x29484f['signal']});let _0xf9343a;try{_0xf9343a=await _0x5e80e5[_0x3e69bb(0x216)]();}catch(_0x57853d){if(_0x57853d instanceof Error&&_0x57853d[_0x3e69bb(0x265)]===_0x3e69bb(0x2ab))throw CliErrors[_0x3e69bb(0x1ec)](_0x3e69bb(0x24c)+_0x58a40e);if(_0x5e80e5['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError'](_0x3e69bb(0x282)+_0x5e80e5['status']+')',_0x5e80e5['status']>=0x190?_0x3e69bb(0x23d):undefined);}if(!_0x5e80e5['ok']||_0xf9343a[_0x3e69bb(0x237)]===![])throw CliErrors['apiError'](_0xf9343a[_0x3e69bb(0x258)]||_0xf9343a[_0x3e69bb(0x247)]||'API\x20error:\x20'+_0x5e80e5[_0x3e69bb(0x26b)],_0xf9343a[_0x3e69bb(0x1c9)]?_0x3e69bb(0x22b)+_0xf9343a[_0x3e69bb(0x1c9)]:undefined);return _0xf9343a;}catch(_0x4717ef){if(_0x4717ef instanceof CliError)throw _0x4717ef;if(_0x4717ef instanceof Error&&_0x4717ef[_0x3e69bb(0x265)]===_0x3e69bb(0x2ab))throw CliErrors[_0x3e69bb(0x1ec)]('Request\x20timeout:\x20'+_0x58a40e);throw createFetchFailureError(_0x58a40e,_0x4717ef);}finally{clearTimeout(_0x76145);}}async function apiFormRequest(_0x26bc4f,_0x593d18,_0x1e0359={}){const _0x110ba7=a197_0x54ab,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x1e0359,_0x433a35=_activeCookie||getCookie(),_0x4c8388=''+getApiDomain()+_0x26bc4f,_0x59b978=new AbortController(),_0x6d2ee=setTimeout(()=>_0x59b978[_0x110ba7(0x1d9)](),timeout);try{const _0x52b08b=await fetch(_0x4c8388,{'method':_0x110ba7(0x223),'headers':{'Cookie':_0x433a35,'X-Invoke-Source':_0x110ba7(0x1ef)},'body':_0x593d18,'signal':_0x59b978[_0x110ba7(0x296)]});let _0x535487;try{_0x535487=await _0x52b08b[_0x110ba7(0x216)]();}catch(_0xbaee){if(_0xbaee instanceof Error&&_0xbaee[_0x110ba7(0x265)]===_0x110ba7(0x2ab))throw CliErrors[_0x110ba7(0x1ec)](_0x110ba7(0x24c)+_0x4c8388);throw CliErrors['apiError'](_0x110ba7(0x282)+_0x52b08b['status']+')',_0x52b08b[_0x110ba7(0x26b)]>=0x190?_0x110ba7(0x23d):undefined);}if(!_0x52b08b['ok']||_0x535487['success']===![])throw CliErrors[_0x110ba7(0x1ec)](_0x535487[_0x110ba7(0x258)]||_0x535487['message']||_0x110ba7(0x230)+_0x52b08b[_0x110ba7(0x26b)],_0x535487[_0x110ba7(0x1c9)]?'API\x20error\x20code:\x20'+_0x535487[_0x110ba7(0x1c9)]:undefined);return _0x535487;}catch(_0x4887a0){if(_0x4887a0 instanceof CliError)throw _0x4887a0;if(_0x4887a0 instanceof Error&&_0x4887a0[_0x110ba7(0x265)]===_0x110ba7(0x2ab))throw CliErrors[_0x110ba7(0x1ec)](_0x110ba7(0x24c)+_0x4c8388);throw createFetchFailureError(_0x4c8388,_0x4887a0);}finally{clearTimeout(_0x6d2ee);}}export async function uploadDevelopmentFile(_0xe2e38a,_0x43eda5){const _0xe10987=a197_0x54ab,_0x2fffcb=await readFile(_0x43eda5),_0x9a3354=new FormData();_0x9a3354[_0xe10987(0x268)](_0xe10987(0x24f),_0xe2e38a),_0x9a3354['append'](_0xe10987(0x1ff),new Blob([new Uint8Array(_0x2fffcb)]),basename(_0x43eda5));const _0x92e9ed=await apiFormRequest(_0xe10987(0x288),_0x9a3354);return _0x92e9ed[_0xe10987(0x1cd)];}export async function queryDevelopmentFileUrl(_0x113f4a,_0x219193={}){const _0x10e405=a197_0x54ab,_0x1c84e2=await apiRequest('/smartapi/common/queryFileUrl',{'method':_0x10e405(0x223),'body':{'filePath':_0x113f4a,'downloadFlag':_0x219193[_0x10e405(0x27e)]??![],..._0x219193[_0x10e405(0x1f8)]?{'longTerm':!![]}:{}}});return _0x1c84e2['data'];}function isAuthFailure(_0x509d60){const _0x4aec7e=a197_0x54ab,_0x5592d1=_0x509d60[_0x4aec7e(0x258)]||_0x509d60[_0x4aec7e(0x247)]||_0x509d60[_0x4aec7e(0x1cd)]?.[_0x4aec7e(0x247)]||_0x509d60[_0x4aec7e(0x1ba)]||_0x509d60[_0x4aec7e(0x1fe)]||'';return _0x509d60[_0x4aec7e(0x1c9)]===_0x4aec7e(0x1ce)||_0x509d60['code']===0x191||_0x509d60[_0x4aec7e(0x27f)]===_0x4aec7e(0x271)||_0x5592d1['includes'](_0x4aec7e(0x271))||_0x5592d1['includes']('Unauthorized')||_0x5592d1[_0x4aec7e(0x20d)]('登录')||_0x5592d1[_0x4aec7e(0x20d)]('认证');}export async function platformFetch(_0x5df2d4,_0x2ebbcb){const _0x244fbe=a197_0x54ab;let _0x5a0157;try{_0x5a0157=await fetch(_0x5df2d4,{'method':_0x2ebbcb[_0x244fbe(0x28d)]??_0x244fbe(0x2a8),'headers':{'Content-Type':_0x244fbe(0x1d4),'Cookie':_0x2ebbcb[_0x244fbe(0x287)],'X-Invoke-Source':_0x244fbe(0x1ef)},..._0x2ebbcb[_0x244fbe(0x20e)]&&{'body':JSON[_0x244fbe(0x202)](_0x2ebbcb[_0x244fbe(0x20e)])}});}catch(_0x5eee3e){throw createFetchFailureError(_0x5df2d4,_0x5eee3e);}if(!_0x5a0157['ok']){if(_0x5a0157['status']===0x191)throw CliErrors[_0x244fbe(0x241)]();throw CliErrors[_0x244fbe(0x1ec)](_0x2ebbcb[_0x244fbe(0x1d1)]+'\x20failed,\x20HTTP\x20'+_0x5a0157[_0x244fbe(0x26b)]);}const _0x164594=await _0x5a0157[_0x244fbe(0x216)]();if(_0x164594['success']===![]){if(isAuthFailure(_0x164594))throw CliErrors[_0x244fbe(0x241)]();throw CliErrors['apiError'](_0x164594[_0x244fbe(0x258)]||_0x164594['message']||_0x2ebbcb['label']+_0x244fbe(0x2ac));}return _0x164594['data'];}export async function platformRequest(_0x409022,_0x29af4c){const _0x1e2e60=a197_0x54ab;if(/^https?:\/\//i['test'](_0x409022))throw CliErrors[_0x1e2e60(0x1c5)](_0x1e2e60(0x2a9)+_0x409022,_0x1e2e60(0x297));const _0x1eb62d=_0x409022[_0x1e2e60(0x1c2)]('/')?_0x409022:'/'+_0x409022;return platformFetch(''+getApiDomain()+_0x1eb62d,_0x29af4c);}function cleanNewlines(_0x52e448){const _0x36feb2=a197_0x54ab;return _0x52e448[_0x36feb2(0x25c)](/[\r\n]+/g,'\x20')[_0x36feb2(0x1d8)]();}function cleanDatasetName(_0x586bb1){if(!_0x586bb1['name'])return _0x586bb1;return{..._0x586bb1,'name':cleanNewlines(_0x586bb1['name'])};}export async function fetchModelList(_0x91bc64,_0x255f10){const _0x1a7105=a197_0x54ab,_0x1f8f5a=getEnv(),_0x210c48=new URLSearchParams({'appcode':_0x91bc64,'otype':_0x1a7105(0x1d0)}),_0x2be334='/api/node-toolbox/dataset/model-list?'+_0x210c48[_0x1a7105(0x1fd)]();logger['info']('fetch-model-list',_0x1a7105(0x1f6)+_0x1f8f5a+')',{'apiPath':_0x2be334});const _0x3dc5fc=await platformRequest(_0x2be334,{'cookie':_0x255f10,'label':_0x1a7105(0x29e)}),_0x2ba27e=(_0x3dc5fc['configArray']??[])[_0x1a7105(0x1bc)](cleanDatasetName);return{'configArray':_0x2ba27e,'count':_0x2ba27e[_0x1a7105(0x289)]};}export async function fetchDatasetDoc(_0x1a6f78){const _0x52f50f=a197_0x54ab,{appCode:_0x45ff7e,cookie:_0x4bb979,datasetCode:_0x175445,datasetId:_0x1b8437,extraParams:_0x38531c}=_0x1a6f78,_0x1679ff=await platformRequest(_0x52f50f(0x1f0),{'method':_0x52f50f(0x223),'body':{'appCode':_0x45ff7e,'datasetCode':_0x175445,'datasetId':_0x1b8437,..._0x38531c||{}},'cookie':_0x4bb979,'label':_0x52f50f(0x270)+_0x175445+')'});if(!_0x1679ff||typeof _0x1679ff[_0x52f50f(0x23c)]!==_0x52f50f(0x245))throw new Error(_0x52f50f(0x1f1)+_0x175445+'):\x20missing\x20data.markdown\x20field');return _0x1679ff['markdown'];}export async function getMenuTree(_0x996606,_0x549b2d){const _0x470592=a197_0x54ab,_0x46259b=new URLSearchParams({'appCode':_0x996606});return platformRequest(_0x470592(0x2ae)+_0x46259b[_0x470592(0x1fd)](),{'cookie':_0x549b2d,'label':_0x470592(0x201)});}export async function createMenuRecord(_0x2554a2,_0x127f82,_0x3f2afa){const _0x4ac8b3=a197_0x54ab;return platformRequest(_0x4ac8b3(0x1cb),{'method':_0x4ac8b3(0x223),'body':_0x2554a2,'cookie':_0x127f82,'label':_0x3f2afa});}export async function updateMenuRecord(_0xa05347,_0x2088d3,_0x264202){const _0x36c0a9=a197_0x54ab;return platformRequest(_0x36c0a9(0x22c),{'method':_0x36c0a9(0x223),'body':_0xa05347,'cookie':_0x2088d3,'label':_0x264202});}export async function deleteMenuRecord(_0x1b7615,_0x2346a2,_0x183ae2){const _0x4b80ac=a197_0x54ab;return platformRequest(_0x4b80ac(0x26a),{'method':_0x4b80ac(0x223),'body':{'id':_0x1b7615},'cookie':_0x2346a2,'label':_0x183ae2});}export async function batchDeleteMenuRecords(_0x323410,_0x2b8d34,_0x3dcafc){const _0x5ef320=a197_0x54ab;return platformRequest(_0x5ef320(0x213),{'method':'POST','body':{'idList':_0x323410},'cookie':_0x2b8d34,'label':_0x3dcafc});}export async function startMenuRegroup(_0x44aeac,_0x4bfccb,_0x44e0dd){const _0x1e7800=a197_0x54ab;return platformRequest('/smartapi/menu/regroup',{'method':_0x1e7800(0x223),'body':_0x44aeac,'cookie':_0x4bfccb,'label':_0x44e0dd});}export async function getAsyncTaskStatus(_0x5e6a11,_0x48cd56,_0x154982){const _0x59fd0a=a197_0x54ab,_0x4d94b0=new URLSearchParams({'appCode':_0x48cd56});return platformRequest(_0x59fd0a(0x24a)+encodeURIComponent(_0x5e6a11)+'?'+_0x4d94b0[_0x59fd0a(0x1fd)](),{'cookie':_0x154982,'label':_0x59fd0a(0x250)+_0x5e6a11});}function a197_0x54ab(_0x2ddf65,_0x31231c){_0x2ddf65=_0x2ddf65-0x1ba;const _0x1bb2ba=a197_0x1bb2();let _0x54ab69=_0x1bb2ba[_0x2ddf65];return _0x54ab69;}export async function listBffScripts(_0x30cc20,_0x4290be,_0x2ba072){const _0xf46578=a197_0x54ab;let _0x4f9fe3=_0xf46578(0x1c6)+_0x30cc20;if(_0x4290be)_0x4f9fe3+=_0xf46578(0x260)+_0x4290be;const _0x3443a2=await apiRequest(_0x4f9fe3);let _0x23a109=extractList(_0x3443a2['data']);if(_0x2ba072?.[_0xf46578(0x1fb)]){const _0x47802c=_0x2ba072[_0xf46578(0x1fb)]['toLowerCase']();_0x23a109=_0x23a109['filter'](_0x42890b=>_0x42890b['functionName']?.['toLowerCase']()[_0xf46578(0x20d)](_0x47802c)||_0x42890b[_0xf46578(0x239)]?.[_0xf46578(0x21b)]()[_0xf46578(0x20d)](_0x47802c));}return _0x23a109;}export async function getBffScriptInfo(_0x96c4cb){const _0x5a0d4=a197_0x54ab,_0xd8f073=await apiRequest(_0x5a0d4(0x23e)+_0x96c4cb);if(!_0xd8f073[_0x5a0d4(0x1cd)])throw CliErrors['validation'](_0x5a0d4(0x276)+_0x96c4cb);return _0xd8f073[_0x5a0d4(0x1cd)];}export async function saveBffScript(_0x63eea){const _0x147f6a=a197_0x54ab,_0x21c1eb=await apiRequest('/api/management/library/scripts/save',{'method':_0x147f6a(0x223),'body':_0x63eea}),{id:_0x26e010,entity:_0x27ead0}=normalizeEntityWithIdResponse(_0x21c1eb[_0x147f6a(0x1cd)]);if(_0x26e010!==undefined){const _0x299485=typeof _0x27ead0[_0x147f6a(0x1bd)]===_0x147f6a(0x245)||typeof _0x27ead0[_0x147f6a(0x25b)]===_0x147f6a(0x245)?_0x27ead0:undefined;return{'id':_0x26e010,'script':_0x299485};}throw CliErrors[_0x147f6a(0x1ec)]('BFF\x20save\x20returned\x20no\x20valid\x20id');}export async function deleteBffScript(_0x1f0cec){const _0x5042f4=a197_0x54ab;await apiRequest(_0x5042f4(0x236),{'method':_0x5042f4(0x223),'body':{'id':_0x1f0cec}});}export async function getBffScriptStatistics(_0x591104){const _0x296cc1=a197_0x54ab,_0x2d77ce=await apiRequest(_0x296cc1(0x235)+_0x591104);return extractList(_0x2d77ce[_0x296cc1(0x1cd)]);}export async function clearBffScriptCache(){const _0x490285=a197_0x54ab,_0x1e4550=await apiRequest(_0x490285(0x20c),{'method':_0x490285(0x223),'useRuntime':!![]});return typeof _0x1e4550[_0x490285(0x1cd)]===_0x490285(0x245)?_0x1e4550['data']:'';}export async function listBffDatasetOperations(_0x1c19c0,_0x256f6f){const _0x44cd90=a197_0x54ab,_0x479f8c=await apiRequest(_0x44cd90(0x2a2),{'method':'POST','body':{'appCode':_0x1c19c0,'datasetId':_0x256f6f}});return _0x479f8c[_0x44cd90(0x1cd)];}export async function listSqlQueries(_0x4c19f1,_0x36a20d){const _0x59c3a2=a197_0x54ab,_0x148fe6=await apiRequest(_0x59c3a2(0x29d),{'method':_0x59c3a2(0x223),'body':{'appCode':_0x4c19f1,'currentPage':_0x36a20d?.[_0x59c3a2(0x1ca)]??0x1,'pageSize':_0x36a20d?.[_0x59c3a2(0x224)]??0x32,'sqlCode':_0x36a20d?.[_0x59c3a2(0x1c3)],'sqlName':_0x36a20d?.[_0x59c3a2(0x1df)]}});return _0x148fe6['data'];}export async function getSqlQueryInfo(_0x50b8d6,_0x550fc4){const _0x95aa34=a197_0x54ab,_0x1b7aca=await listSqlQueries(_0x50b8d6,{'sqlCode':_0x550fc4}),_0x1e2566=_0x1b7aca[_0x95aa34(0x203)]?.[0x0];if(!_0x1e2566)throw CliErrors[_0x95aa34(0x1c5)](_0x95aa34(0x27b)+_0x550fc4);return _0x1e2566;}export async function getSqlQueryDetail(_0x437ed4){const _0x969821=a197_0x54ab,_0x53d588=await apiRequest(_0x969821(0x29f)+(_0x969821(0x29b)+encodeURIComponent(_0x437ed4)));if(!_0x53d588[_0x969821(0x1cd)])throw CliErrors[_0x969821(0x1c5)](_0x969821(0x27b)+_0x437ed4);return _0x53d588[_0x969821(0x1cd)];}export async function getSqlQueryDetailById(_0x2df2e3){const _0x55aa42=a197_0x54ab,_0x18b827=await apiRequest(_0x55aa42(0x21c)+_0x2df2e3);if(!_0x18b827[_0x55aa42(0x1cd)])throw CliErrors[_0x55aa42(0x1c5)](_0x55aa42(0x1e3)+_0x2df2e3);return _0x18b827[_0x55aa42(0x1cd)];}export async function createSqlQuery(_0x23e1d4){const _0x5e3892=a197_0x54ab,_0x329de1=await apiRequest(_0x5e3892(0x20f),{'method':_0x5e3892(0x223),'body':_0x23e1d4}),{id:_0x3e8262,entity:_0x3473f8}=normalizeEntityWithIdResponse(_0x329de1[_0x5e3892(0x1cd)]);if(!(_0x5e3892(0x1c3)in _0x3473f8)&&_0x3e8262)return getSqlQueryDetailById(_0x3e8262);return normalizeSqlQueryEntity(_0x3473f8);}export async function updateSqlQuery(_0x44eee8){const _0x27eb7c=a197_0x54ab,_0x116e6a=await apiRequest(_0x27eb7c(0x24e),{'method':_0x27eb7c(0x223),'body':_0x44eee8}),{id:_0x134753,entity:_0x25c2a0}=normalizeEntityWithIdResponse(_0x116e6a[_0x27eb7c(0x1cd)]);if(!(_0x27eb7c(0x1c3)in _0x25c2a0)){if(_0x44eee8[_0x27eb7c(0x1c3)])return getSqlQueryDetail(_0x44eee8[_0x27eb7c(0x1c3)]);if(_0x134753)return getSqlQueryDetailById(_0x134753);}return normalizeSqlQueryEntity(_0x25c2a0);}export async function deleteSqlQuery(_0x24deea){const _0x5bb6cf=a197_0x54ab;await apiRequest(_0x5bb6cf(0x1de),{'method':'POST','body':_0x24deea});}export async function saveSqlQuery(_0x48d29d){const _0x5cc92a=a197_0x54ab,_0x2ffa50=await apiRequest('/api/node-toolbox/sql/save',{'method':_0x5cc92a(0x223),'body':_0x48d29d});return _0x2ffa50[_0x5cc92a(0x1cd)];}function normalizeSqlQueryEntity(_0x1cb149){const _0x203b6f=a197_0x54ab;return{..._0x1cb149,'id':Number(_0x1cb149['id']),'dbId':_0x1cb149[_0x203b6f(0x210)]==null?undefined:Number(_0x1cb149['dbId']),'version':_0x1cb149[_0x203b6f(0x1ea)]==null?undefined:Number(_0x1cb149[_0x203b6f(0x1ea)])};}export async function executeSql(_0x315095,_0x36fa0c,_0x42f445){const _0x3c3c63=a197_0x54ab,_0x5e4c3a=await apiRequest(_0x3c3c63(0x211),{'method':'POST','body':{'appCode':_0x315095,'sqlCode':_0x36fa0c,..._0x42f445&&{'params':_0x42f445}},'useRuntime':!![]});return _0x5e4c3a[_0x3c3c63(0x1cd)];}export async function executeDatasetDataOperation(_0x4787bd,_0x1da42f,_0x4b8b98,_0x199454={}){const _0xb07c25=a197_0x54ab;try{const _0x4559d8=await apiRequest(_0xb07c25(0x251)+_0x4787bd+'/'+_0x1da42f+'/'+_0x4b8b98,{'method':'POST','body':_0x199454,'useRuntime':!![]});return _0x4559d8[_0xb07c25(0x1cd)];}catch(_0x5364b0){if(_0x4b8b98===_0xb07c25(0x277)&&_0x5364b0 instanceof CliError&&_0x5364b0[_0xb07c25(0x27f)]===_0xb07c25(0x2ad)&&_0x199454['id']!==undefined&&_0x199454['id']!==null&&_0x199454['id']!==''){const _0x2b0e11=await apiRequest(_0xb07c25(0x251)+_0x4787bd+'/'+_0x1da42f+_0xb07c25(0x21d),{'method':_0xb07c25(0x223),'body':{'where':{'id':{'$eq':_0x199454['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x147d8f=Array[_0xb07c25(0x1ed)](_0x2b0e11[_0xb07c25(0x1cd)]?.['tableData'])?_0x2b0e11[_0xb07c25(0x1cd)][_0xb07c25(0x203)]:[];return _0x147d8f[0x0]??null;}throw _0x5364b0;}}export async function listDatasets(_0x4c8951,_0x4d5c5a){const _0x74647a=a197_0x54ab,_0x501579={'appCode':_0x4c8951,'deleted':_0x4d5c5a?.[_0x74647a(0x1d5)]??![]};if(_0x4d5c5a?.[_0x74647a(0x27f)])_0x501579[_0x74647a(0x27f)]=_0x4d5c5a[_0x74647a(0x27f)];if(_0x4d5c5a?.[_0x74647a(0x265)])_0x501579['name']=_0x4d5c5a[_0x74647a(0x265)];const _0x5194dd=await apiRequest(_0x74647a(0x23a),{'method':'POST','body':_0x501579});return extractList(_0x5194dd[_0x74647a(0x1cd)]);}export async function deleteDataset(_0x42e6e3,_0x2215e3){const _0x31ac9a=a197_0x54ab;await apiRequest(_0x31ac9a(0x252),{'method':_0x31ac9a(0x223),'body':{'appCode':_0x42e6e3,'datasetId':_0x2215e3}});}export async function restoreDataset(_0x33cded,_0x119866){const _0x49074f=a197_0x54ab;await apiRequest(_0x49074f(0x221),{'method':'POST','body':{'appCode':_0x33cded,'datasetId':_0x119866}});}export async function previewTextGeneratedDataset(_0x189b18,_0x388a4d){const _0x44ae38=a197_0x54ab,_0x2c2fc4=await apiRequest('/smartapi/dataset/text-generate/preview',{'method':_0x44ae38(0x223),'body':{'appCode':_0x189b18,'datasetName':_0x388a4d[_0x44ae38(0x1e7)],'requirementDescription':_0x388a4d['requirementDescription']},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x2c2fc4[_0x44ae38(0x1cd)];}export async function startTextGeneratedDataset(_0x3eff6d,_0x45979,_0x43bc5b){const _0xe8a85a=a197_0x54ab,_0x345412=await apiRequest(_0xe8a85a(0x283),{'method':'POST','body':{'appCode':_0x3eff6d,..._0x43bc5b?.[_0xe8a85a(0x274)]?{'clientOperationId':_0x43bc5b[_0xe8a85a(0x274)]}:{},'design':_0x45979},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x345412[_0xe8a85a(0x1cd)];}export async function getTextGeneratedDatasetStatus(_0xa0f994,_0x1a4354){const _0x5373e2=a197_0x54ab,_0x2a46cc=new URLSearchParams({'appCode':_0xa0f994});_0x1a4354[_0x5373e2(0x26d)]&&_0x2a46cc[_0x5373e2(0x24b)](_0x5373e2(0x26d),_0x1a4354['operationId']);_0x1a4354['clientOperationId']&&_0x2a46cc[_0x5373e2(0x24b)](_0x5373e2(0x274),_0x1a4354[_0x5373e2(0x274)]);const _0xb8aa3=await apiRequest('/smartapi/dataset/text-generate/status?'+_0x2a46cc[_0x5373e2(0x1fd)]());return _0xb8aa3[_0x5373e2(0x1cd)];}export async function searchDatasets(_0x4e4626,_0x21caad){const _0x10195c=a197_0x54ab,_0x449a77=await listDatasets(_0x4e4626,{'name':_0x21caad}),_0x126072=_0x21caad[_0x10195c(0x21b)](),_0x5a0c00=new Set(_0x449a77['map'](_0x203f8b=>_0x203f8b['id'])),_0x2dccb1=_0x449a77[_0x10195c(0x25a)](_0x9737da=>_0x9737da[_0x10195c(0x269)]?.[_0x10195c(0x27c)]?.[_0x10195c(0x21b)]()[_0x10195c(0x20d)](_0x126072)||_0x9737da['description']?.[_0x10195c(0x21b)]()['includes'](_0x126072)),_0x481793=await listDatasets(_0x4e4626,{'code':_0x21caad});for(const _0x3fcf1b of _0x481793){!_0x5a0c00[_0x10195c(0x219)](_0x3fcf1b['id'])&&(_0x449a77['push'](_0x3fcf1b),_0x5a0c00[_0x10195c(0x218)](_0x3fcf1b['id']));}return _0x449a77;}export function normalizeDatasetOperations(_0x53b9fb){const _0x25bc92=a197_0x54ab;if(Array[_0x25bc92(0x1ed)](_0x53b9fb))return _0x53b9fb[_0x25bc92(0x25a)](_0x49fe96=>_0x49fe96!=null&&typeof _0x49fe96==='object');if(_0x53b9fb&&typeof _0x53b9fb==='object')return Object[_0x25bc92(0x25d)](_0x53b9fb)[_0x25bc92(0x25a)](([,_0x21a07e])=>_0x21a07e!=null&&typeof _0x21a07e==='object')['map'](([_0x28390c,_0x402a7d])=>({..._0x402a7d,'name':_0x402a7d[_0x25bc92(0x265)]??_0x402a7d[_0x25bc92(0x279)]??_0x28390c}));return[];}export async function getDatasetDetail(_0x484370){const _0x417530=a197_0x54ab,_0x168187=/^\d+$/[_0x417530(0x259)](_0x484370)?'id':_0x417530(0x27f),_0xcdc5a2=await apiRequest(_0x417530(0x20a)+_0x168187+'='+_0x484370);return _0xcdc5a2[_0x417530(0x1cd)];}export async function updateDrivenData(_0x5a3750){const _0x265c8d=a197_0x54ab,_0x4d79ee=await apiRequest(_0x265c8d(0x298),{'method':_0x265c8d(0x223),'body':_0x5a3750});return _0x4d79ee[_0x265c8d(0x1cd)];}export async function getDatasetOperations(_0x1d7800){const _0x53758f=a197_0x54ab,_0x330839=await getDatasetDetail(_0x1d7800),_0x51c6de=normalizeDatasetOperations(_0x330839[_0x53758f(0x232)])[_0x53758f(0x1bc)](_0x270dfc=>({'name':_0x270dfc['name']||_0x270dfc[_0x53758f(0x279)],'displayName':_0x270dfc[_0x53758f(0x1dd)]||_0x270dfc[_0x53758f(0x265)],'type':_0x270dfc[_0x53758f(0x1f3)],'method':_0x270dfc['method'],'path':_0x270dfc[_0x53758f(0x257)],'enabled':_0x270dfc[_0x53758f(0x27a)]??!![],'requestFields':_0x270dfc[_0x53758f(0x1bf)],'responseFields':_0x270dfc[_0x53758f(0x254)]}));return{'dataset':{'id':_0x330839['id']??_0x330839[_0x53758f(0x244)],'name':_0x330839['name'],'code':_0x330839[_0x53758f(0x27f)]||_0x330839[_0x53758f(0x26c)],'tableName':_0x330839[_0x53758f(0x27c)]||_0x330839['dbtableConfig']?.[_0x53758f(0x27c)]},'operations':_0x51c6de};}export async function getOperationDetail(_0xe97fb8,_0x23dd83,_0x5ca03d){const _0x5d3314=a197_0x54ab;let _0x27a6a7=_0x23dd83;if(!/^\d+$/[_0x5d3314(0x259)](_0x23dd83)){const _0x51e162=await listDatasets(_0xe97fb8,{'code':_0x23dd83}),_0x1ae150=_0x51e162['find'](_0x44a077=>_0x44a077[_0x5d3314(0x27f)]===_0x23dd83||String(_0x44a077['id'])===_0x23dd83);if(!_0x1ae150)throw CliErrors['validation'](_0x5d3314(0x204)+_0x23dd83);_0x27a6a7=String(_0x1ae150['id']);}const _0x42a57e=await getDatasetDetail(_0x27a6a7),_0x17ee43=normalizeDatasetOperations(_0x42a57e[_0x5d3314(0x232)])[_0x5d3314(0x208)](_0x39aa90=>(_0x39aa90[_0x5d3314(0x265)]||_0x39aa90[_0x5d3314(0x279)])===_0x5ca03d);if(!_0x17ee43)throw CliErrors['validation']('Operation\x20\x22'+_0x5ca03d+_0x5d3314(0x1fa)+_0x23dd83);return{'dataset':{'id':_0x42a57e['id']??_0x42a57e[_0x5d3314(0x244)],'name':_0x42a57e[_0x5d3314(0x265)],'code':_0x42a57e['code']||_0x42a57e[_0x5d3314(0x26c)],'tableName':_0x42a57e[_0x5d3314(0x27c)]||_0x42a57e[_0x5d3314(0x269)]?.['tableName']},'operation':_0x17ee43};}export async function startGenerateStandardPages(_0x4e95cc,_0x3e2b73,_0x5ab780){const _0x24afa4=a197_0x54ab,_0x3ac1c1=await apiRequest(_0x24afa4(0x1d6)+_0x3e2b73+_0x24afa4(0x234),{'method':'POST','body':{'appCode':_0x4e95cc,..._0x5ab780?.[_0x24afa4(0x274)]?{'clientOperationId':_0x5ab780[_0x24afa4(0x274)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x3ac1c1[_0x24afa4(0x1cd)];}export async function getGenerateStandardPagesStatus(_0x3f5d97,_0x56606a,_0x433e7b){const _0x388ca2=a197_0x54ab,_0x307daa=new URLSearchParams({'appCode':_0x3f5d97});_0x433e7b[_0x388ca2(0x26d)]&&_0x307daa[_0x388ca2(0x24b)](_0x388ca2(0x26d),_0x433e7b[_0x388ca2(0x26d)]);_0x433e7b[_0x388ca2(0x274)]&&_0x307daa[_0x388ca2(0x24b)]('clientOperationId',_0x433e7b[_0x388ca2(0x274)]);const _0x4a5166=await apiRequest(_0x388ca2(0x1d6)+_0x56606a+_0x388ca2(0x212)+_0x307daa[_0x388ca2(0x1fd)]());return _0x4a5166[_0x388ca2(0x1cd)];}export async function getStandardPageStatus(_0x10f69c,_0x24c80e){const _0x28594d=a197_0x54ab,_0x118584=await apiRequest(_0x28594d(0x1d6)+_0x24c80e+_0x28594d(0x1e5)+encodeURIComponent(_0x10f69c));return _0x118584[_0x28594d(0x1cd)];}export async function tryGetStandardPageStatus(_0x317fa2,_0x5db870){const _0x42fb65=a197_0x54ab;try{return await getStandardPageStatus(_0x317fa2,_0x5db870);}catch(_0x2b17ed){if(_0x2b17ed instanceof CliError&&_0x2b17ed['code']===_0x42fb65(0x2ad)&&/404|not found|non-json response/i[_0x42fb65(0x259)](_0x2b17ed[_0x42fb65(0x247)]))return null;throw _0x2b17ed;}}export async function syncStandardPages(_0x3c69e6,_0x2d44a9){const _0x367a88=a197_0x54ab,_0x587773=await apiRequest('/smartapi/lovrabet/dataset/'+_0x2d44a9+_0x367a88(0x2a3),{'method':_0x367a88(0x223),'body':{'appCode':_0x3c69e6}});return _0x587773[_0x367a88(0x1cd)];}export async function getPageDetail(_0x302d13){const _0x1f8987=a197_0x54ab,_0x102192=await apiRequest(_0x1f8987(0x28f)+_0x302d13);if(!_0x102192[_0x1f8987(0x1cd)])throw CliErrors['validation'](_0x1f8987(0x256)+_0x302d13);return _0x102192['data'];}export async function updatePage(_0x1c1451,_0x3ab754,_0x275135,_0x178bbb){const _0x312b37=a197_0x54ab,_0x22e46a=await apiRequest(_0x312b37(0x1fc),{'method':_0x312b37(0x223),'body':{'appCode':_0x1c1451,'pageId':_0x3ab754,'code':_0x275135,'datasetIds':_0x178bbb}});return _0x22e46a[_0x312b37(0x1cd)];}export function generateSdkCode(_0x378b73,_0x42d617,_0x5daf73){const _0x5f2a40=a197_0x54ab,_0x2c8a1b=_0x5daf73?.[_0x5f2a40(0x273)]??!![],_0x24da6f=_0x5f2a40(0x1e8)+_0x378b73[_0x5f2a40(0x27f)]?.['replace'](/-/g,'_'),_0x50879d=_0x42d617['name']||_0x42d617[_0x5f2a40(0x279)]||_0x5f2a40(0x25a),_0x5228cd=[];_0x2c8a1b&&_0x5228cd[_0x5f2a40(0x253)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x5f2a40(0x280),'');_0x5228cd[_0x5f2a40(0x253)](_0x5f2a40(0x261)+_0x378b73[_0x5f2a40(0x265)]+'\x20('+(_0x378b73[_0x5f2a40(0x27c)]||_0x5f2a40(0x1c0))+')');if(_0x50879d==='filter')_0x5228cd['push'](_0x5f2a40(0x2a4)+_0x24da6f+_0x5f2a40(0x1be),_0x5f2a40(0x1e2),_0x5f2a40(0x1e1),_0x5f2a40(0x1f7),_0x5f2a40(0x29c));else{if(_0x50879d===_0x5f2a40(0x277))_0x5228cd[_0x5f2a40(0x253)](_0x5f2a40(0x2a4)+_0x24da6f+_0x5f2a40(0x1bb));else{if(_0x50879d===_0x5f2a40(0x278))_0x5228cd[_0x5f2a40(0x253)](_0x5f2a40(0x2a4)+_0x24da6f+_0x5f2a40(0x1dc));else{if(_0x50879d===_0x5f2a40(0x1db))_0x5228cd['push'](_0x5f2a40(0x2a4)+_0x24da6f+_0x5f2a40(0x1c4));else _0x50879d===_0x5f2a40(0x294)||_0x50879d==='remove'?_0x5228cd[_0x5f2a40(0x253)](_0x5f2a40(0x2a4)+_0x24da6f+_0x5f2a40(0x275)):_0x5228cd[_0x5f2a40(0x253)](_0x5f2a40(0x2a4)+_0x24da6f+'.'+_0x50879d+_0x5f2a40(0x1da));}}}return _0x5228cd[_0x5f2a40(0x28e)]('\x0a');}function a197_0x1bb2(){const _0x5d62fb=['/smartapi/app-config/list','/smartapi/custom/updateUserCustomSql','appCode','Fetch\x20async\x20task\x20','/api/','/smartapi/dataset/delete-dataset','push','responseFields','/smartapi/question/er-config/cli/delete-single','Page\x20not\x20found:\x20','path','errorMsg','test','filter','scriptType','replace','entries','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','\x20\x20});','&type=','//\x20','/smartapi/db-analysis/jobs/cancel','/smartapi/db-analysis/start','\x20\x20sqlCode:\x20\x27','name','/smartapi/app-config/update','/smartapi/dblink/getAllTableList','append','dbtableConfig','/smartapi/menu/delete','status','modelCode','operationId','Request\x20failed:\x20','/smartapi/permit/role/get-one','Fetch\x20doc\x20(','401','Warning:\x20showing\x20first\x20','includeImports','clientOperationId','.remove(id);','BFF\x20script\x20not\x20found:\x20id=','getOne','create','operationName','enabled','SQL\x20query\x20not\x20found:\x20','tableName','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','download','code','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','1121624PtEQLT','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/smartapi/dataset/text-generate/start','target','/smartapi/permit/role/get-permit-list','totalCount','cookie','/smartapi/common/uploadFile','length','datasetTableCount','permits','summary','method','join','/smartapi/lovrabet/detail?pageId=','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','ENABLE','/smartapi/permit/user-role/get-user-list','avatar','delete','hint','signal','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','/smartapi/dataset/update-driven-data','roleType','userId','?sqlCode=','});','/smartapi/custom/queryUserCustomSqlList','Fetch\x20datasets','/smartapi/custom/getUserCustomSql','pageIndex','\x20\x20return\x20rows;','/smartapi/dataset/get-dataset-operation','/sync-to-pages','const\x20result\x20=\x20await\x20client.models.','DATA_NOT_EXIST','/smartapi/question/er-config/cli/erCreate','/smartapi/permit/role/delete','GET','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','needPublic','AbortError','\x20failed','api_error','/smartapi/menu/find?','/smartapi/question/er-config/cli/detail?','value','errorMessage','.getOne(id);','map','functionName','.filter({','requestFields','table','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','startsWith','sqlCode','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','validation','/api/management/library/scripts/list?appCode=','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','\x20\x20\x20\x20sqlCode:\x20\x27','errorCode','currentPage','/smartapi/menu/create','/smartapi/permit/role/get-list','data','UNAUTHORIZED','/smartapi/permit/resource/get-api-list','array','label','remark','physicalTableCount','application/json','deleted','/smartapi/lovrabet/dataset/','tableList','trim','abort','(/*\x20params\x20*/);','update','.create({\x20/*\x20fields\x20*/\x20});','displayName','/smartapi/custom/deleteUserCustomSql','sqlName','/smartapi/db-analysis/status/','\x20\x20pageSize:\x2020,','\x20\x20where:\x20{},','SQL\x20query\x20not\x20found:\x20id=','/smartapi/dblink/create','/standard-page-status?appCode=','list','datasetName','dataset_','\x20apps.\x20','version','/smartapi/permit/page/get-one','apiError','isArray','/notification/channel-config/list','cli:rabetbase','/api/node-toolbox/api-doc-generator','Invalid\x20response\x20format\x20(','needSelf','type','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','roleName','正在从服务器拉取模型列表...\x20(环境:\x20','\x20\x20currentPage:\x201,','longTerm','503853RhEFyE','\x22\x20not\x20found\x20in\x20dataset\x20','scriptName','/smartapi/lovrabet/update-page','toString','error','file','/smartapi/permit/role/create','Fetch\x20menu\x20list','stringify','tableData','Dataset\x20not\x20found:\x20','userTenantRelationList','email','/smartapi/dblink/getOne','find','/smartapi/dblink/testConnect','/smartapi/dataset/get-driven-data?','username','/api/management/script/cache/clear','includes','body','/smartapi/custom/saveUserCustomSql','dbId','/api/custom/executeSql','/generate-standard-pages/status?','/smartapi/menu/batchDelete','/smartapi/permit/resource/get-menu-list','55ArEigu','json','6noTCVC','add','has','/smartapi/permit/role/update','toLowerCase','/smartapi/custom/getUserCustomSql?id=','/filter','warn','/smartapi/app-config/create','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/dataset/restore-dataset','/smartapi/dblink/getList','POST','pageSize','sdk','mobile','319250qrpqZs','4839291xDCbkG','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','relation','API\x20error\x20code:\x20','/smartapi/menu/update','/smartapi/question/er-config','const\x20results\x20=\x20data.execResult\x20||\x20[];','/smartapi/dblink/delete','API\x20error:\x20','/smartapi/dblink/update','operations','key','/generate-standard-pages/start','/api/management/library/scripts/statistics?appCode=','/api/management/library/scripts/delete','success','tags','description','/smartapi/dataset/get-dataset-list','1417080LmVUbW','markdown','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','/api/management/library/scripts/info?id=','max','/smartapi/permit/user-role/update-user-list','authRequired','52552NCOLDw','/smartapi/question/er-config/cli/update-single','modelId','string','/smartapi/question/er-config/business-group/edit','message','ER\x20relation\x20does\x20not\x20exist','186768aOMiNG','/smartapi/tasks/','set','Request\x20timeout:\x20'];a197_0x1bb2=function(){return _0x5d62fb;};return a197_0x1bb2();}export function generateSqlCodeTemplate(_0xfc8cdf,_0x120e4a){const _0x4e08ac=a197_0x54ab,_0x585b72=_0x120e4a?.[_0x4e08ac(0x284)]??'sdk',_0x10ee35=_0x120e4a?.[_0x4e08ac(0x273)]??!![],_0x4ead40=[];return _0x4ead40[_0x4e08ac(0x253)]('//\x20SQL:\x20'+_0xfc8cdf['sqlName']+'\x20('+_0xfc8cdf[_0x4e08ac(0x1c3)]+')'),_0x585b72===_0x4e08ac(0x225)?(_0x10ee35&&_0x4ead40[_0x4e08ac(0x253)](_0x4e08ac(0x25e),'',_0x4e08ac(0x280),''),_0x4ead40[_0x4e08ac(0x253)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x4e08ac(0x264)+_0xfc8cdf[_0x4e08ac(0x1c3)]+'\x27,',_0x4e08ac(0x1c1),_0x4e08ac(0x29c),_0x4e08ac(0x290),_0x4e08ac(0x22e))):_0x4ead40['push'](_0x4e08ac(0x1c7),_0x4e08ac(0x27d),_0x4e08ac(0x229),_0x4e08ac(0x1c8)+_0xfc8cdf['sqlCode']+'\x27,',_0x4e08ac(0x220),_0x4e08ac(0x25f),_0x4e08ac(0x2a1),'}'),_0x4ead40['join']('\x0a');}export async function getErConfig(_0x3aa8b4,_0x50a0ce){const _0x5f41f5=a197_0x54ab,_0x339a34=await apiRequest(_0x5f41f5(0x22d),{'method':_0x5f41f5(0x223),'body':{'appCode':_0x3aa8b4,'dblinkId':_0x50a0ce},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x339a34[_0x5f41f5(0x1cd)];}export async function getErRelationDetail(_0x758198,_0xaad4d){const _0x59b9b7=a197_0x54ab,_0x1c30c9=new URLSearchParams({'appCode':_0x758198,'relationId':String(_0xaad4d)});try{const _0x3159e6=await apiRequest(_0x59b9b7(0x2af)+_0x1c30c9['toString']());return _0x3159e6[_0x59b9b7(0x1cd)]?.[_0x59b9b7(0x22a)]??null;}catch(_0x4e5f86){if(_0x4e5f86 instanceof CliError&&_0x4e5f86['code']===_0x59b9b7(0x2ad)&&(_0x4e5f86[_0x59b9b7(0x295)]?.[_0x59b9b7(0x20d)](_0x59b9b7(0x2a5))||_0x4e5f86['hint']==='API\x20error\x20code:\x20306'&&_0x4e5f86['message']===_0x59b9b7(0x248)))return null;throw _0x4e5f86;}}export async function createErRelation(_0x2a1e69){const _0x5453ef=a197_0x54ab,_0x5df008=await apiRequest(_0x5453ef(0x2a6),{'method':'POST','body':_0x2a1e69,'allowNonJsonSuccess':!![]});return _0x5df008[_0x5453ef(0x1cd)];}export async function updateErRelation(_0x23b89b){const _0x444420=a197_0x54ab,_0x475b06=await apiRequest(_0x444420(0x243),{'method':_0x444420(0x223),'body':_0x23b89b,'allowNonJsonSuccess':!![]});return _0x475b06['data'];}export async function deleteErRelation(_0x1bb19a){const _0x350b87=a197_0x54ab,_0x1d32f7=await apiRequest(_0x350b87(0x255),{'method':_0x350b87(0x223),'body':_0x1bb19a,'allowNonJsonSuccess':!![]});return _0x1d32f7['data'];}export async function updateErBusinessGroup(_0x53fd4e){const _0x455260=a197_0x54ab,_0x9c18da=await apiRequest(_0x455260(0x246),{'method':_0x455260(0x223),'body':_0x53fd4e,'allowNonJsonSuccess':!![]});return _0x9c18da['data'];}function buildQuery(_0x10de60){const _0x1d067f=a197_0x54ab,_0x5aac80=new URLSearchParams();for(const [_0x1cc98f,_0x268fe6]of Object[_0x1d067f(0x25d)](_0x10de60)){if(_0x268fe6===undefined||_0x268fe6==='')continue;_0x5aac80[_0x1d067f(0x24b)](_0x1cc98f,String(_0x268fe6));}const _0x3b867a=_0x5aac80['toString']();return _0x3b867a?'?'+_0x3b867a:'';}export async function listNotificationChannelConfigs(_0x3ba7fe,_0xe8d304){const _0x3b8a22=a197_0x54ab,_0x5efe54=await apiRequest(_0x3b8a22(0x1ee)+buildQuery({'appCode':_0x3ba7fe,'channelType':_0xe8d304}));return Array['isArray'](_0x5efe54[_0x3b8a22(0x1cd)])?_0x5efe54['data']:[];}export async function listAppConfigs(_0x1f5e37,_0xf2d1ed){const _0x102b3f=a197_0x54ab,_0x25d309=await apiRequest(_0x102b3f(0x24d),{'method':_0x102b3f(0x223),'body':{'appCode':_0x1f5e37,..._0xf2d1ed?.[_0x102b3f(0x233)]?{'key':_0xf2d1ed[_0x102b3f(0x233)]}:{},..._0xf2d1ed?.[_0x102b3f(0x238)]?{'tags':_0xf2d1ed['tags']}:{}}});return extractAppConfigList(_0x25d309['data']);}export async function getAppConfigByKey(_0x42d14e,_0x4e7ec5){const _0x1248d8=a197_0x54ab,_0x3ddaba=await apiRequest('/smartapi/app-config/getByKey'+buildQuery({'appCode':_0x42d14e,'key':_0x4e7ec5}));return _0x3ddaba[_0x1248d8(0x1cd)]??null;}export async function createAppConfig(_0x1f3a4f){const _0x536969=a197_0x54ab,_0x55b436=await apiRequest(_0x536969(0x21f),{'method':'POST','body':{'appCode':_0x1f3a4f['appCode'],'key':_0x1f3a4f[_0x536969(0x233)],'value':_0x1f3a4f[_0x536969(0x2b0)],..._0x1f3a4f[_0x536969(0x238)]?{'tags':_0x1f3a4f[_0x536969(0x238)]}:{}}});return _0x55b436[_0x536969(0x1cd)];}export async function updateAppConfig(_0x94f37c){const _0x14ae44=a197_0x54ab;await apiRequest(_0x14ae44(0x266),{'method':'POST','body':{'id':_0x94f37c['id'],'appCode':_0x94f37c[_0x14ae44(0x24f)],'key':_0x94f37c[_0x14ae44(0x233)],'value':_0x94f37c[_0x14ae44(0x2b0)],..._0x94f37c[_0x14ae44(0x238)]?{'tags':_0x94f37c['tags']}:{}}});}export async function deleteAppConfig(_0x204dbc){const _0x2aabe2=a197_0x54ab;await apiRequest('/smartapi/app-config/delete',{'method':_0x2aabe2(0x223),'body':_0x204dbc});}function extractAppConfigList(_0x33cccb){const _0x1b5463=a197_0x54ab;if(Array[_0x1b5463(0x1ed)](_0x33cccb))return _0x33cccb;if(_0x33cccb&&typeof _0x33cccb==='object'&&Array[_0x1b5463(0x1ed)](_0x33cccb[_0x1b5463(0x1e6)]))return _0x33cccb[_0x1b5463(0x1e6)];return extractList(_0x33cccb);}export async function listDbLinks(_0x80f148,_0x10de66){const _0x199c9f=a197_0x54ab,_0x51e31b=await apiRequest(_0x199c9f(0x222),{'method':_0x199c9f(0x223),'body':{'appCode':_0x80f148,'currentPage':_0x10de66?.['currentPage']??0x1,'pageSize':_0x10de66?.['pageSize']??0x64}});return{'items':extractList(_0x51e31b[_0x199c9f(0x1cd)]),'paging':extractPaging(_0x51e31b['data'])};}export async function getDbLinkInfo(_0x3ef3a1){const _0x4f319b=a197_0x54ab,_0x19e228=await apiRequest(_0x4f319b(0x207)+buildQuery({'id':_0x3ef3a1}));return _0x19e228['data'];}export async function createDbLink(_0xd0d38){const _0x1d10f1=a197_0x54ab,_0x17e310=await apiRequest(_0x1d10f1(0x1e4),{'method':'POST','body':_0xd0d38});return _0x17e310[_0x1d10f1(0x1cd)];}export async function updateDbLink(_0x3ff359){const _0x23afa7=a197_0x54ab,_0x583400=await apiRequest(_0x23afa7(0x231),{'method':'POST','body':_0x3ff359});return _0x583400[_0x23afa7(0x1cd)];}export async function deleteDbLink(_0xebd4a1){const _0x5992ff=a197_0x54ab;await apiRequest(_0x5992ff(0x22f),{'method':_0x5992ff(0x223),'body':{'id':_0xebd4a1}});}export async function testDbLinkConnect(_0x51c810){const _0x2b562d=a197_0x54ab,_0xb2d37c=await apiRequest(_0x2b562d(0x209)+buildQuery({'id':_0x51c810}));return _0xb2d37c[_0x2b562d(0x1cd)];}export async function startDbAnalysis(_0x4ef46c,_0x32317b){const _0x53a345=a197_0x54ab,_0x1fbf74=await apiRequest(_0x53a345(0x263),{'method':_0x53a345(0x223),'body':{'dbLinkId':_0x4ef46c,..._0x32317b&&_0x32317b[_0x53a345(0x289)]>0x0?{'tableNames':_0x32317b}:{}}});return _0x1fbf74[_0x53a345(0x1cd)];}export async function cancelDbAnalysis(_0x53a0bf){const _0x4f8fba=a197_0x54ab;await apiRequest(_0x4f8fba(0x262)+buildQuery({'planId':_0x53a0bf}),{'method':_0x4f8fba(0x223)});}export async function getDbAnalysisStatus(_0x472b62){const _0x53d4b4=a197_0x54ab,_0x3d3774=await apiRequest(_0x53d4b4(0x1e0)+encodeURIComponent(_0x472b62));return _0x3d3774[_0x53d4b4(0x1cd)];}export async function getDbAllTableList(_0x23e27e,_0x4ec931){const _0x1d052d=a197_0x54ab,_0x3472f0=await apiRequest(_0x1d052d(0x267)+buildQuery({'appCode':_0x23e27e,'dbLinkId':_0x4ec931})),_0x3194b7=_0x3472f0[_0x1d052d(0x1cd)];if(Array[_0x1d052d(0x1ed)](_0x3194b7))return _0x3194b7;return extractList(_0x3194b7);}export async function getDbTableDiff(_0x4ccb2d,_0x36237d,_0x42c48c){const _0x3d18ee=a197_0x54ab,_0x4e06c6=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x4ccb2d,'dbLinkId':_0x36237d,'pageIndex':_0x42c48c?.[_0x3d18ee(0x2a0)]??0x1,'pageSize':_0x42c48c?.[_0x3d18ee(0x224)]??0x14,'tableName':_0x42c48c?.[_0x3d18ee(0x27c)]})),_0x3592b3=_0x4e06c6[_0x3d18ee(0x1cd)];return{'totalCount':_0x3592b3?.[_0x3d18ee(0x286)]??0x0,'physicalTableCount':_0x3592b3?.[_0x3d18ee(0x1d3)]??0x0,'datasetTableCount':_0x3592b3?.[_0x3d18ee(0x28a)]??0x0,..._0x3592b3?.[_0x3d18ee(0x28c)]?{'summary':_0x3592b3[_0x3d18ee(0x28c)]}:{},'tableList':Array[_0x3d18ee(0x1ed)](_0x3592b3?.[_0x3d18ee(0x1d7)])?_0x3592b3[_0x3d18ee(0x1d7)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x1bbcfe=a197_0x54ab,_0x3d929e=await apiRequest('/smartapi/app/getList',{'method':_0x1bbcfe(0x223),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x475595=extractList(_0x3d929e[_0x1bbcfe(0x1cd)]),_0x1e493a=extractPaging(_0x3d929e[_0x1bbcfe(0x1cd)]);return _0x1e493a&&_0x1e493a[_0x1bbcfe(0x286)]>REMOTE_APP_PAGE_SIZE&&console[_0x1bbcfe(0x21e)](_0x1bbcfe(0x272)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x1e493a[_0x1bbcfe(0x286)]+_0x1bbcfe(0x1e9)+_0x1bbcfe(0x1f4)),_0x475595;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x3be27b,_0x3e9d95){const _0x33d06a=a197_0x54ab,_0x2d3720=Math['min'](Math[_0x33d06a(0x23f)](_0x3e9d95?.[_0x33d06a(0x224)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x23808c=await apiRequest(_0x33d06a(0x1cc),{'method':'POST','body':{'appCode':_0x3be27b,'currentPage':_0x3e9d95?.[_0x33d06a(0x1ca)]??0x1,'pageSize':_0x2d3720}});return{'items':extractList(_0x23808c[_0x33d06a(0x1cd)]),'paging':extractPaging(_0x23808c[_0x33d06a(0x1cd)])};}export async function getAppRole(_0x5132f1){const _0x1e6a3a=a197_0x54ab,_0x51c133=await apiRequest(_0x1e6a3a(0x26f)+buildQuery({'id':_0x5132f1}));return _0x51c133[_0x1e6a3a(0x1cd)];}export async function createAppRole(_0x92a216){const _0x14b670=a197_0x54ab,_0x4e0efb=await apiRequest(_0x14b670(0x200),{'method':_0x14b670(0x223),'body':{'appCode':_0x92a216[_0x14b670(0x24f)],'roleName':_0x92a216[_0x14b670(0x1f5)],'roleType':'CUSTOM',..._0x92a216[_0x14b670(0x1d2)]?{'remark':_0x92a216[_0x14b670(0x1d2)]}:{}}});return _0x4e0efb[_0x14b670(0x1cd)];}export async function updateAppRole(_0x7029d3){const _0x1de004=a197_0x54ab,_0x5b9f87=await apiRequest(_0x1de004(0x21a),{'method':_0x1de004(0x223),'body':{'id':_0x7029d3['id'],'appCode':_0x7029d3['appCode'],..._0x7029d3[_0x1de004(0x299)]?{'roleType':_0x7029d3['roleType']}:{},..._0x7029d3[_0x1de004(0x1f5)]!==undefined?{'roleName':_0x7029d3[_0x1de004(0x1f5)]}:{},..._0x7029d3[_0x1de004(0x1d2)]!==undefined?{'remark':_0x7029d3[_0x1de004(0x1d2)]}:{},..._0x7029d3[_0x1de004(0x28b)]?{'permits':_0x7029d3['permits']}:{}}});return _0x5b9f87[_0x1de004(0x1cd)];}export async function deleteAppRole(_0x363946){const _0x4f78cf=a197_0x54ab;await apiRequest(_0x4f78cf(0x2a7),{'method':'POST','body':{'id':_0x363946}});}export async function listPermitRoles(_0x5ddfc0,_0x4d661a){const _0x4fa863=a197_0x54ab,_0x313bfa=await apiRequest(_0x4fa863(0x285),{'method':_0x4fa863(0x223),'body':{'appCode':_0x5ddfc0,..._0x4d661a?.[_0x4fa863(0x1f2)]!==undefined?{'needSelf':_0x4d661a['needSelf']}:{},..._0x4d661a?.[_0x4fa863(0x2aa)]!==undefined?{'needPublic':_0x4d661a['needPublic']}:{}}});return extractList(_0x313bfa['data']);}export async function getRoleMenuResources(_0x2f5081,_0x39ed79){const _0x51c1f2=a197_0x54ab,_0x27eaa1=await apiRequest(_0x51c1f2(0x214),{'method':_0x51c1f2(0x223),'body':{'appCode':_0x2f5081,'roleId':_0x39ed79}});return extractList(_0x27eaa1[_0x51c1f2(0x1cd)]);}export async function getRoleApiResources(_0x27e166,_0x299542){const _0x431e39=a197_0x54ab,_0x5e9416=await apiRequest(_0x431e39(0x1cf),{'method':'POST','body':{'appCode':_0x27e166,'roleId':_0x299542}});return extractList(_0x5e9416[_0x431e39(0x1cd)]);}export async function listRoleUsers(_0x51235f){const _0x8ad76=a197_0x54ab,_0x141360=await apiRequest(_0x8ad76(0x292),{'method':_0x8ad76(0x223),'body':{'appCode':_0x51235f}});return extractList(_0x141360[_0x8ad76(0x1cd)]);}export async function updateRoleUsers(_0x402315,_0x49a4e1){const _0x4dc9c0=a197_0x54ab;await apiRequest(_0x4dc9c0(0x240),{'method':_0x4dc9c0(0x223),'body':{'appCode':_0x402315,'roleList':_0x49a4e1}});}export async function getPagePermit(_0x5b6a26){const _0xee1d96=a197_0x54ab,_0x3262ea=await apiRequest(_0xee1d96(0x1eb)+buildQuery({'menuId':_0x5b6a26}));return _0x3262ea[_0xee1d96(0x1cd)];}export async function savePagePermit(_0x75f004){const _0x25cced=a197_0x54ab,_0x444887=await apiRequest('/smartapi/permit/page/save',{'method':_0x25cced(0x223),'body':_0x75f004});return _0x444887['data'];}export async function getTenantMembers(_0xbac88d){const _0x4e7a49=a197_0x54ab,_0xf64746=await apiRequest('/userTenant/getByTenantCode'+buildQuery({'code':_0xbac88d})),_0x2cbe77=_0xf64746[_0x4e7a49(0x1cd)]??{},_0x19ace2=Array['isArray'](_0x2cbe77?.[_0x4e7a49(0x205)])?_0x2cbe77['userTenantRelationList']:[];return _0x19ace2['filter'](_0x2500ed=>_0x2500ed?.[_0x4e7a49(0x26b)]===_0x4e7a49(0x291)||_0x2500ed?.[_0x4e7a49(0x26b)]===undefined)[_0x4e7a49(0x1bc)](_0x3eae67=>({'userId':Number(_0x3eae67['userId']??_0x3eae67['id']),'username':_0x3eae67[_0x4e7a49(0x20b)],'nickname':_0x3eae67['nickname'],'status':_0x3eae67['status'],'email':_0x3eae67[_0x4e7a49(0x206)],'mobile':_0x3eae67[_0x4e7a49(0x226)],'avatar':_0x3eae67[_0x4e7a49(0x293)]}))[_0x4e7a49(0x25a)](_0x4a17f2=>Number['isFinite'](_0x4a17f2[_0x4e7a49(0x29a)])&&_0x4a17f2['userId']>0x0);}
|
|
1
|
+
(function(_0x5807cf,_0x2d554c){const _0x40ece1=a197_0x3ede,_0x8a5de3=_0x5807cf();while(!![]){try{const _0x4020a2=parseInt(_0x40ece1(0x295))/0x1+-parseInt(_0x40ece1(0x1e4))/0x2*(-parseInt(_0x40ece1(0x228))/0x3)+parseInt(_0x40ece1(0x29a))/0x4*(parseInt(_0x40ece1(0x1f6))/0x5)+-parseInt(_0x40ece1(0x26a))/0x6+-parseInt(_0x40ece1(0x297))/0x7+parseInt(_0x40ece1(0x2a0))/0x8+parseInt(_0x40ece1(0x1ec))/0x9*(-parseInt(_0x40ece1(0x2bd))/0xa);if(_0x4020a2===_0x2d554c)break;else _0x8a5de3['push'](_0x8a5de3['shift']());}catch(_0xf81d6c){_0x8a5de3['push'](_0x8a5de3['shift']());}}}(a197_0x8c48,0x47779));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x3b597d){_activeCookie=_0x3b597d||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x385fdf,_0x3fcba5){const _0x239211=a197_0x3ede,_0xf73238=_0x3fcba5 instanceof Error?_0x3fcba5[_0x239211(0x279)]:String(_0x3fcba5);return CliErrors[_0x239211(0x29e)]('Request\x20failed:\x20'+_0x385fdf+(_0xf73238?'\x20('+_0xf73238+')':''),_0x239211(0x1f4));}async function apiRequest(_0x4ae6cf,_0xc3df2a={}){const _0x5f29ec=a197_0x3ede,{method:method=_0x5f29ec(0x283),body:_0x2927bb,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0xc3df2a,_0x3c9123=useRuntime?getRuntimeDomain():getApiDomain(),_0x1021b7=_activeCookie||getCookie(),_0x25cc9a=''+_0x3c9123+_0x4ae6cf,_0x2ed1ef=new AbortController(),_0x4f831e=setTimeout(()=>_0x2ed1ef[_0x5f29ec(0x2a9)](),timeout);try{const _0x39e615=await fetch(_0x25cc9a,{'method':method,'headers':{'Content-Type':_0x5f29ec(0x267),'Cookie':_0x1021b7,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x2927bb?JSON[_0x5f29ec(0x21c)](_0x2927bb):undefined,'signal':_0x2ed1ef['signal']});let _0x18fcfc;try{_0x18fcfc=await _0x39e615[_0x5f29ec(0x1e6)]();}catch(_0x5e4fb8){if(_0x5e4fb8 instanceof Error&&_0x5e4fb8[_0x5f29ec(0x20e)]===_0x5f29ec(0x2b2))throw CliErrors[_0x5f29ec(0x29e)](_0x5f29ec(0x285)+_0x25cc9a);if(_0x39e615['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x5f29ec(0x29e)](_0x5f29ec(0x1e9)+_0x39e615[_0x5f29ec(0x2ab)]+')',_0x39e615[_0x5f29ec(0x2ab)]>=0x190?_0x5f29ec(0x1de):undefined);}if(!_0x39e615['ok']||_0x18fcfc[_0x5f29ec(0x218)]===![])throw CliErrors['apiError'](_0x18fcfc[_0x5f29ec(0x208)]||_0x18fcfc[_0x5f29ec(0x279)]||_0x5f29ec(0x207)+_0x39e615['status'],_0x18fcfc[_0x5f29ec(0x200)]?_0x5f29ec(0x27c)+_0x18fcfc[_0x5f29ec(0x200)]:undefined);return _0x18fcfc;}catch(_0x1db566){if(_0x1db566 instanceof CliError)throw _0x1db566;if(_0x1db566 instanceof Error&&_0x1db566[_0x5f29ec(0x20e)]===_0x5f29ec(0x2b2))throw CliErrors['apiError'](_0x5f29ec(0x285)+_0x25cc9a);throw createFetchFailureError(_0x25cc9a,_0x1db566);}finally{clearTimeout(_0x4f831e);}}async function apiFormRequest(_0x2449c8,_0x4d07fa,_0x5c64b9={}){const _0x1fc664=a197_0x3ede,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x5c64b9,_0x3688c6=_activeCookie||getCookie(),_0x3e458f=''+getApiDomain()+_0x2449c8,_0x15ee97=new AbortController(),_0x5bd4e4=setTimeout(()=>_0x15ee97[_0x1fc664(0x2a9)](),timeout);try{const _0x5787ea=await fetch(_0x3e458f,{'method':_0x1fc664(0x25e),'headers':{'Cookie':_0x3688c6,'X-Invoke-Source':_0x1fc664(0x1f5)},'body':_0x4d07fa,'signal':_0x15ee97[_0x1fc664(0x250)]});let _0x3ef3ab;try{_0x3ef3ab=await _0x5787ea[_0x1fc664(0x1e6)]();}catch(_0x56ac73){if(_0x56ac73 instanceof Error&&_0x56ac73[_0x1fc664(0x20e)]===_0x1fc664(0x2b2))throw CliErrors[_0x1fc664(0x29e)]('Request\x20timeout:\x20'+_0x3e458f);throw CliErrors[_0x1fc664(0x29e)](_0x1fc664(0x1e9)+_0x5787ea[_0x1fc664(0x2ab)]+')',_0x5787ea[_0x1fc664(0x2ab)]>=0x190?_0x1fc664(0x1de):undefined);}if(!_0x5787ea['ok']||_0x3ef3ab[_0x1fc664(0x218)]===![])throw CliErrors[_0x1fc664(0x29e)](_0x3ef3ab[_0x1fc664(0x208)]||_0x3ef3ab['message']||_0x1fc664(0x207)+_0x5787ea[_0x1fc664(0x2ab)],_0x3ef3ab['errorCode']?'API\x20error\x20code:\x20'+_0x3ef3ab['errorCode']:undefined);return _0x3ef3ab;}catch(_0x22b6be){if(_0x22b6be instanceof CliError)throw _0x22b6be;if(_0x22b6be instanceof Error&&_0x22b6be['name']===_0x1fc664(0x2b2))throw CliErrors[_0x1fc664(0x29e)](_0x1fc664(0x285)+_0x3e458f);throw createFetchFailureError(_0x3e458f,_0x22b6be);}finally{clearTimeout(_0x5bd4e4);}}export async function uploadDevelopmentFile(_0x124472,_0x53665e){const _0x1cece1=a197_0x3ede,_0x178190=await readFile(_0x53665e),_0x128149=new FormData();_0x128149['append'](_0x1cece1(0x286),_0x124472),_0x128149[_0x1cece1(0x298)](_0x1cece1(0x26c),new Blob([new Uint8Array(_0x178190)]),basename(_0x53665e));const _0x574a8a=await apiFormRequest(_0x1cece1(0x25b),_0x128149);return _0x574a8a[_0x1cece1(0x213)];}export async function queryDevelopmentFileUrl(_0x2402f3,_0x22cc78={}){const _0xed6cd0=a197_0x3ede,_0x4b6a6f=await apiRequest(_0xed6cd0(0x23b),{'method':_0xed6cd0(0x25e),'body':{'filePath':_0x2402f3,'downloadFlag':_0x22cc78[_0xed6cd0(0x272)]??![],..._0x22cc78['longTerm']?{'longTerm':!![]}:{}}});return _0x4b6a6f[_0xed6cd0(0x213)];}function isAuthFailure(_0x4f420f){const _0x43a43a=a197_0x3ede,_0x202db3=_0x4f420f[_0x43a43a(0x208)]||_0x4f420f[_0x43a43a(0x279)]||_0x4f420f['data']?.[_0x43a43a(0x279)]||_0x4f420f['errorMessage']||_0x4f420f[_0x43a43a(0x276)]||'';return _0x4f420f[_0x43a43a(0x200)]===_0x43a43a(0x227)||_0x4f420f['code']===0x191||_0x4f420f[_0x43a43a(0x258)]==='401'||_0x202db3['includes'](_0x43a43a(0x1f3))||_0x202db3[_0x43a43a(0x27b)](_0x43a43a(0x247))||_0x202db3['includes']('登录')||_0x202db3[_0x43a43a(0x27b)]('认证');}export async function platformFetch(_0x18ab0d,_0x3f83eb){const _0x4765a1=a197_0x3ede;let _0x2a6ee6;try{_0x2a6ee6=await fetch(_0x18ab0d,{'method':_0x3f83eb['method']??_0x4765a1(0x283),'headers':{'Content-Type':'application/json','Cookie':_0x3f83eb[_0x4765a1(0x1dc)],'X-Invoke-Source':_0x4765a1(0x1f5)},..._0x3f83eb[_0x4765a1(0x2a4)]&&{'body':JSON[_0x4765a1(0x21c)](_0x3f83eb[_0x4765a1(0x2a4)])}});}catch(_0x3397ef){throw createFetchFailureError(_0x18ab0d,_0x3397ef);}if(!_0x2a6ee6['ok']){if(_0x2a6ee6[_0x4765a1(0x2ab)]===0x191)throw CliErrors[_0x4765a1(0x2bc)]();throw CliErrors[_0x4765a1(0x29e)](_0x3f83eb[_0x4765a1(0x287)]+_0x4765a1(0x299)+_0x2a6ee6[_0x4765a1(0x2ab)]);}const _0x12b783=await _0x2a6ee6[_0x4765a1(0x1e6)]();if(_0x12b783[_0x4765a1(0x218)]===![]){if(isAuthFailure(_0x12b783))throw CliErrors[_0x4765a1(0x2bc)]();throw CliErrors[_0x4765a1(0x29e)](_0x12b783[_0x4765a1(0x208)]||_0x12b783[_0x4765a1(0x279)]||_0x3f83eb[_0x4765a1(0x287)]+_0x4765a1(0x22f));}return _0x12b783[_0x4765a1(0x213)];}export async function platformRequest(_0x651812,_0x19b746){const _0x3953b9=a197_0x3ede;if(/^https?:\/\//i['test'](_0x651812))throw CliErrors['validation'](_0x3953b9(0x1f1)+_0x651812,_0x3953b9(0x233));const _0x83147b=_0x651812[_0x3953b9(0x1ed)]('/')?_0x651812:'/'+_0x651812;return platformFetch(''+getApiDomain()+_0x83147b,_0x19b746);}function cleanNewlines(_0x55351d){const _0x4bc75c=a197_0x3ede;return _0x55351d['replace'](/[\r\n]+/g,'\x20')[_0x4bc75c(0x2ba)]();}function cleanDatasetName(_0x568bfc){const _0x5b37c2=a197_0x3ede;if(!_0x568bfc[_0x5b37c2(0x20e)])return _0x568bfc;return{..._0x568bfc,'name':cleanNewlines(_0x568bfc[_0x5b37c2(0x20e)])};}export async function fetchModelList(_0x2fb308,_0x5bd101){const _0x4ce043=a197_0x3ede,_0x55e2ea=getEnv(),_0x4107dd=new URLSearchParams({'appcode':_0x2fb308,'otype':_0x4ce043(0x265)}),_0x28dd3f=_0x4ce043(0x2b8)+_0x4107dd['toString']();logger[_0x4ce043(0x264)](_0x4ce043(0x2a7),_0x4ce043(0x261)+_0x55e2ea+')',{'apiPath':_0x28dd3f});const _0x30a314=await platformRequest(_0x28dd3f,{'cookie':_0x5bd101,'label':_0x4ce043(0x29f)}),_0x16918c=(_0x30a314[_0x4ce043(0x239)]??[])[_0x4ce043(0x281)](cleanDatasetName);return{'configArray':_0x16918c,'count':_0x16918c[_0x4ce043(0x221)]};}export async function fetchDatasetDoc(_0x559f97){const _0x1a0e0e=a197_0x3ede,{appCode:_0x3c279d,cookie:_0x327b0c,datasetCode:_0x1ac978,datasetId:_0x10ed49,extraParams:_0x1b5968}=_0x559f97,_0x59d8ca=await platformRequest(_0x1a0e0e(0x24a),{'method':_0x1a0e0e(0x25e),'body':{'appCode':_0x3c279d,'datasetCode':_0x1ac978,'datasetId':_0x10ed49,..._0x1b5968||{}},'cookie':_0x327b0c,'label':_0x1a0e0e(0x21b)+_0x1ac978+')'});if(!_0x59d8ca||typeof _0x59d8ca[_0x1a0e0e(0x20c)]!==_0x1a0e0e(0x24c))throw new Error(_0x1a0e0e(0x2ad)+_0x1ac978+_0x1a0e0e(0x1fe));return _0x59d8ca[_0x1a0e0e(0x20c)];}export async function getMenuTree(_0x5bebf6,_0x14c06c){const _0x539639=a197_0x3ede,_0x24ddae=new URLSearchParams({'appCode':_0x5bebf6});return platformRequest(_0x539639(0x266)+_0x24ddae[_0x539639(0x1ef)](),{'cookie':_0x14c06c,'label':'Fetch\x20menu\x20list'});}export async function createMenuRecord(_0x4e5b6a,_0x114c44,_0x593daa){const _0xf66ac5=a197_0x3ede;return platformRequest('/smartapi/menu/create',{'method':_0xf66ac5(0x25e),'body':_0x4e5b6a,'cookie':_0x114c44,'label':_0x593daa});}export async function updateMenuRecord(_0x529ef2,_0x1389a7,_0x3c6e65){const _0x4aa620=a197_0x3ede;return platformRequest(_0x4aa620(0x1f9),{'method':_0x4aa620(0x25e),'body':_0x529ef2,'cookie':_0x1389a7,'label':_0x3c6e65});}export async function deleteMenuRecord(_0x408495,_0x309100,_0x2fed93){return platformRequest('/smartapi/menu/delete',{'method':'POST','body':{'id':_0x408495},'cookie':_0x309100,'label':_0x2fed93});}export async function batchDeleteMenuRecords(_0x4f543b,_0x26dd70,_0x35eafa){return platformRequest('/smartapi/menu/batchDelete',{'method':'POST','body':{'idList':_0x4f543b},'cookie':_0x26dd70,'label':_0x35eafa});}export async function startMenuRegroup(_0x430c6b,_0x3af5e6,_0x199415){const _0x4ccbd3=a197_0x3ede;return platformRequest('/smartapi/menu/regroup',{'method':_0x4ccbd3(0x25e),'body':_0x430c6b,'cookie':_0x3af5e6,'label':_0x199415});}export async function getAsyncTaskStatus(_0x42e229,_0x16c6c8,_0x2dd639){const _0x55fed6=a197_0x3ede,_0x3452f=new URLSearchParams({'appCode':_0x16c6c8});return platformRequest(_0x55fed6(0x1ee)+encodeURIComponent(_0x42e229)+'?'+_0x3452f[_0x55fed6(0x1ef)](),{'cookie':_0x2dd639,'label':'Fetch\x20async\x20task\x20'+_0x42e229});}export async function listBffScripts(_0x52b89c,_0x237727,_0x401658){const _0xd9e11f=a197_0x3ede;let _0x587525=_0xd9e11f(0x214)+_0x52b89c;if(_0x237727)_0x587525+=_0xd9e11f(0x1fb)+_0x237727;const _0x1eb011=await apiRequest(_0x587525);let _0x3f0341=extractList(_0x1eb011[_0xd9e11f(0x213)]);if(_0x401658?.['scriptName']){const _0x5c4a83=_0x401658[_0xd9e11f(0x220)][_0xd9e11f(0x24d)]();_0x3f0341=_0x3f0341[_0xd9e11f(0x1e1)](_0x3d6dc9=>_0x3d6dc9['functionName']?.[_0xd9e11f(0x24d)]()[_0xd9e11f(0x27b)](_0x5c4a83)||_0x3d6dc9[_0xd9e11f(0x270)]?.[_0xd9e11f(0x24d)]()['includes'](_0x5c4a83));}return _0x3f0341;}export async function getBffScriptInfo(_0x53bc80){const _0x464202=a197_0x3ede,_0x3cadbe=await apiRequest('/api/management/library/scripts/info?id='+_0x53bc80);if(!_0x3cadbe[_0x464202(0x213)])throw CliErrors[_0x464202(0x202)]('BFF\x20script\x20not\x20found:\x20id='+_0x53bc80);return _0x3cadbe['data'];}export async function saveBffScript(_0x35b373){const _0x12f24e=a197_0x3ede,_0x314dc8=await apiRequest(_0x12f24e(0x21e),{'method':_0x12f24e(0x25e),'body':_0x35b373}),{id:_0x5a9415,entity:_0x172b91}=normalizeEntityWithIdResponse(_0x314dc8[_0x12f24e(0x213)]);if(_0x5a9415!==undefined){const _0x38007a=typeof _0x172b91[_0x12f24e(0x280)]===_0x12f24e(0x24c)||typeof _0x172b91[_0x12f24e(0x25c)]==='string'?_0x172b91:undefined;return{'id':_0x5a9415,'script':_0x38007a};}throw CliErrors[_0x12f24e(0x29e)](_0x12f24e(0x2b3));}export async function deleteBffScript(_0x531e57){const _0x14c395=a197_0x3ede;await apiRequest(_0x14c395(0x2b5),{'method':_0x14c395(0x25e),'body':{'id':_0x531e57}});}export async function getBffScriptStatistics(_0x3d12bf){const _0x57041c=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x3d12bf);return extractList(_0x57041c['data']);}export async function clearBffScriptCache(){const _0x5098d7=a197_0x3ede,_0x9cddaa=await apiRequest('/api/management/script/cache/clear',{'method':_0x5098d7(0x25e),'useRuntime':!![]});return typeof _0x9cddaa[_0x5098d7(0x213)]===_0x5098d7(0x24c)?_0x9cddaa[_0x5098d7(0x213)]:'';}export async function listBffDatasetOperations(_0x2d63b1,_0x125de5){const _0x386ccc=a197_0x3ede,_0xee4325=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':'POST','body':{'appCode':_0x2d63b1,'datasetId':_0x125de5}});return _0xee4325[_0x386ccc(0x213)];}export async function listSqlQueries(_0x118d6b,_0x2822df){const _0x3cffde=a197_0x3ede,_0x28f2b1=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':'POST','body':{'appCode':_0x118d6b,'currentPage':_0x2822df?.[_0x3cffde(0x24b)]??0x1,'pageSize':_0x2822df?.[_0x3cffde(0x224)]??0x32,'sqlCode':_0x2822df?.[_0x3cffde(0x254)],'sqlName':_0x2822df?.[_0x3cffde(0x1fd)]}});return _0x28f2b1['data'];}export async function getSqlQueryInfo(_0x237132,_0xf7e4b6){const _0x28e41d=a197_0x3ede,_0x1701f5=await listSqlQueries(_0x237132,{'sqlCode':_0xf7e4b6}),_0x78b810=_0x1701f5[_0x28e41d(0x27a)]?.[0x0];if(!_0x78b810)throw CliErrors[_0x28e41d(0x202)](_0x28e41d(0x2a3)+_0xf7e4b6);return _0x78b810;}export async function getSqlQueryDetail(_0xa211e){const _0x110221=a197_0x3ede,_0x5755f1=await apiRequest('/smartapi/custom/getUserCustomSql'+(_0x110221(0x22b)+encodeURIComponent(_0xa211e)));if(!_0x5755f1[_0x110221(0x213)])throw CliErrors[_0x110221(0x202)](_0x110221(0x2a3)+_0xa211e);return _0x5755f1['data'];}export async function getSqlQueryDetailById(_0x2aff25){const _0x29631f=a197_0x3ede,_0x2e8928=await apiRequest(_0x29631f(0x235)+_0x2aff25);if(!_0x2e8928[_0x29631f(0x213)])throw CliErrors[_0x29631f(0x202)]('SQL\x20query\x20not\x20found:\x20id='+_0x2aff25);return _0x2e8928[_0x29631f(0x213)];}export async function createSqlQuery(_0x34b635){const _0x33e371=a197_0x3ede,_0x16be18=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':_0x33e371(0x25e),'body':_0x34b635}),{id:_0x906512,entity:_0x13cfd4}=normalizeEntityWithIdResponse(_0x16be18[_0x33e371(0x213)]);if(!('sqlCode'in _0x13cfd4)&&_0x906512)return getSqlQueryDetailById(_0x906512);return normalizeSqlQueryEntity(_0x13cfd4);}export async function updateSqlQuery(_0x140a91){const _0x1778bf=a197_0x3ede,_0x15f43a=await apiRequest(_0x1778bf(0x1f7),{'method':_0x1778bf(0x25e),'body':_0x140a91}),{id:_0x3557a6,entity:_0x287eaf}=normalizeEntityWithIdResponse(_0x15f43a[_0x1778bf(0x213)]);if(!(_0x1778bf(0x254)in _0x287eaf)){if(_0x140a91[_0x1778bf(0x254)])return getSqlQueryDetail(_0x140a91[_0x1778bf(0x254)]);if(_0x3557a6)return getSqlQueryDetailById(_0x3557a6);}return normalizeSqlQueryEntity(_0x287eaf);}export async function deleteSqlQuery(_0x233bdf){const _0x470604=a197_0x3ede;await apiRequest(_0x470604(0x236),{'method':_0x470604(0x25e),'body':_0x233bdf});}export async function saveSqlQuery(_0x3a2505){const _0x108924=a197_0x3ede,_0x1ae6f6=await apiRequest(_0x108924(0x274),{'method':'POST','body':_0x3a2505});return _0x1ae6f6[_0x108924(0x213)];}function normalizeSqlQueryEntity(_0xb4bcd1){const _0x48a6b8=a197_0x3ede;return{..._0xb4bcd1,'id':Number(_0xb4bcd1['id']),'dbId':_0xb4bcd1['dbId']==null?undefined:Number(_0xb4bcd1[_0x48a6b8(0x269)]),'version':_0xb4bcd1[_0x48a6b8(0x24f)]==null?undefined:Number(_0xb4bcd1[_0x48a6b8(0x24f)])};}export async function executeSql(_0x58b793,_0x860c85,_0x44889b){const _0x5aa504=a197_0x3ede,_0x590682=await apiRequest('/api/custom/executeSql',{'method':_0x5aa504(0x25e),'body':{'appCode':_0x58b793,'sqlCode':_0x860c85,..._0x44889b&&{'params':_0x44889b}},'useRuntime':!![]});return _0x590682[_0x5aa504(0x213)];}export async function executeDatasetDataOperation(_0x5ad55e,_0x47076d,_0x23c859,_0x39b6ab={}){const _0x5bc04e=a197_0x3ede;try{const _0x5d180e=await apiRequest('/api/'+_0x5ad55e+'/'+_0x47076d+'/'+_0x23c859,{'method':_0x5bc04e(0x25e),'body':_0x39b6ab,'useRuntime':!![]});return _0x5d180e[_0x5bc04e(0x213)];}catch(_0x14f2cf){if(_0x23c859===_0x5bc04e(0x1e7)&&_0x14f2cf instanceof CliError&&_0x14f2cf[_0x5bc04e(0x258)]===_0x5bc04e(0x234)&&_0x39b6ab['id']!==undefined&&_0x39b6ab['id']!==null&&_0x39b6ab['id']!==''){const _0x5c053f=await apiRequest(_0x5bc04e(0x2a5)+_0x5ad55e+'/'+_0x47076d+_0x5bc04e(0x21d),{'method':_0x5bc04e(0x25e),'body':{'where':{'id':{'$eq':_0x39b6ab['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x15e0e1=Array['isArray'](_0x5c053f[_0x5bc04e(0x213)]?.[_0x5bc04e(0x27a)])?_0x5c053f['data'][_0x5bc04e(0x27a)]:[];return _0x15e0e1[0x0]??null;}throw _0x14f2cf;}}export async function listDatasets(_0x1e4fa6,_0x5ebb98){const _0x38518d=a197_0x3ede,_0x3c0f0d={'appCode':_0x1e4fa6,'deleted':_0x5ebb98?.[_0x38518d(0x248)]??![]};if(_0x5ebb98?.[_0x38518d(0x258)])_0x3c0f0d['code']=_0x5ebb98['code'];if(_0x5ebb98?.[_0x38518d(0x20e)])_0x3c0f0d[_0x38518d(0x20e)]=_0x5ebb98['name'];const _0x3a750f=await apiRequest(_0x38518d(0x28a),{'method':_0x38518d(0x25e),'body':_0x3c0f0d});return extractList(_0x3a750f['data']);}export async function deleteDataset(_0x2c46d2,_0x10afa2){const _0x343a46=a197_0x3ede;await apiRequest('/smartapi/dataset/delete-dataset',{'method':_0x343a46(0x25e),'body':{'appCode':_0x2c46d2,'datasetId':_0x10afa2}});}export async function restoreDataset(_0x3da36f,_0xe093d8){const _0x85a24a=a197_0x3ede;await apiRequest(_0x85a24a(0x241),{'method':_0x85a24a(0x25e),'body':{'appCode':_0x3da36f,'datasetId':_0xe093d8}});}export async function previewTextGeneratedDataset(_0x1fc10b,_0x4b3a59){const _0x1442c0=a197_0x3ede,_0x4ec164=await apiRequest('/smartapi/dataset/text-generate/preview',{'method':_0x1442c0(0x25e),'body':{'appCode':_0x1fc10b,'datasetName':_0x4b3a59[_0x1442c0(0x296)],'requirementDescription':_0x4b3a59[_0x1442c0(0x1eb)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x4ec164['data'];}export async function startTextGeneratedDataset(_0x32b16c,_0x21dee0,_0x257211){const _0x3dcf2f=a197_0x3ede,_0xe80ed5=await apiRequest(_0x3dcf2f(0x28e),{'method':_0x3dcf2f(0x25e),'body':{'appCode':_0x32b16c,..._0x257211?.[_0x3dcf2f(0x222)]?{'clientOperationId':_0x257211[_0x3dcf2f(0x222)]}:{},'design':_0x21dee0},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0xe80ed5['data'];}export async function getTextGeneratedDatasetStatus(_0x3ecd09,_0x7abcc9){const _0x17ae14=a197_0x3ede,_0x40bd78=new URLSearchParams({'appCode':_0x3ecd09});_0x7abcc9[_0x17ae14(0x210)]&&_0x40bd78[_0x17ae14(0x20d)](_0x17ae14(0x210),_0x7abcc9[_0x17ae14(0x210)]);_0x7abcc9['clientOperationId']&&_0x40bd78[_0x17ae14(0x20d)](_0x17ae14(0x222),_0x7abcc9['clientOperationId']);const _0x9254f9=await apiRequest(_0x17ae14(0x1fa)+_0x40bd78[_0x17ae14(0x1ef)]());return _0x9254f9['data'];}export async function searchDatasets(_0x73604e,_0x36c6cc){const _0x141975=a197_0x3ede,_0x355afd=await listDatasets(_0x73604e,{'name':_0x36c6cc}),_0x26067b=_0x36c6cc[_0x141975(0x24d)](),_0x218ff6=new Set(_0x355afd[_0x141975(0x281)](_0x218502=>_0x218502['id'])),_0x4e4c4a=_0x355afd[_0x141975(0x1e1)](_0x4df7c8=>_0x4df7c8[_0x141975(0x22d)]?.[_0x141975(0x252)]?.['toLowerCase']()['includes'](_0x26067b)||_0x4df7c8[_0x141975(0x270)]?.['toLowerCase']()['includes'](_0x26067b)),_0x5a79ee=await listDatasets(_0x73604e,{'code':_0x36c6cc});for(const _0xcb2839 of _0x5a79ee){!_0x218ff6[_0x141975(0x2ae)](_0xcb2839['id'])&&(_0x355afd[_0x141975(0x2af)](_0xcb2839),_0x218ff6[_0x141975(0x21a)](_0xcb2839['id']));}return _0x355afd;}export function normalizeDatasetOperations(_0xe20e6){const _0x128d67=a197_0x3ede;if(Array[_0x128d67(0x2b9)](_0xe20e6))return _0xe20e6[_0x128d67(0x1e1)](_0x24401b=>_0x24401b!=null&&typeof _0x24401b===_0x128d67(0x225));if(_0xe20e6&&typeof _0xe20e6===_0x128d67(0x225))return Object[_0x128d67(0x2b1)](_0xe20e6)[_0x128d67(0x1e1)](([,_0x295264])=>_0x295264!=null&&typeof _0x295264===_0x128d67(0x225))[_0x128d67(0x281)](([_0x53dd01,_0x117429])=>({..._0x117429,'name':_0x117429[_0x128d67(0x20e)]??_0x117429[_0x128d67(0x240)]??_0x53dd01}));return[];}export async function getDatasetDetail(_0x552141){const _0x336e01=a197_0x3ede,_0x148506=/^\d+$/['test'](_0x552141)?'id':_0x336e01(0x258),_0x425aaa=await apiRequest(_0x336e01(0x2b4)+_0x148506+'='+_0x552141);return _0x425aaa[_0x336e01(0x213)];}export async function updateDrivenData(_0x54bba1){const _0x1d8590=a197_0x3ede,_0x26c0b0=await apiRequest(_0x1d8590(0x203),{'method':_0x1d8590(0x25e),'body':_0x54bba1});return _0x26c0b0[_0x1d8590(0x213)];}export async function getDatasetOperations(_0x16055b){const _0x2f6ef0=a197_0x3ede,_0x19d522=await getDatasetDetail(_0x16055b),_0x2b3773=normalizeDatasetOperations(_0x19d522['operations'])[_0x2f6ef0(0x281)](_0x59fdae=>({'name':_0x59fdae[_0x2f6ef0(0x20e)]||_0x59fdae['operationName'],'displayName':_0x59fdae[_0x2f6ef0(0x28f)]||_0x59fdae[_0x2f6ef0(0x20e)],'type':_0x59fdae[_0x2f6ef0(0x1f2)],'method':_0x59fdae[_0x2f6ef0(0x23e)],'path':_0x59fdae['path'],'enabled':_0x59fdae[_0x2f6ef0(0x256)]??!![],'requestFields':_0x59fdae['requestFields'],'responseFields':_0x59fdae['responseFields']}));return{'dataset':{'id':_0x19d522['id']??_0x19d522[_0x2f6ef0(0x2b7)],'name':_0x19d522[_0x2f6ef0(0x20e)],'code':_0x19d522[_0x2f6ef0(0x258)]||_0x19d522[_0x2f6ef0(0x27e)],'tableName':_0x19d522[_0x2f6ef0(0x252)]||_0x19d522[_0x2f6ef0(0x22d)]?.[_0x2f6ef0(0x252)]},'operations':_0x2b3773};}export async function getOperationDetail(_0x4be3b8,_0x287432,_0x1cfe54){const _0x1fa0ee=a197_0x3ede;let _0x4fb1ef=_0x287432;if(!/^\d+$/['test'](_0x287432)){const _0xf507bd=await listDatasets(_0x4be3b8,{'code':_0x287432}),_0x3893bc=_0xf507bd[_0x1fa0ee(0x28b)](_0x325bce=>_0x325bce[_0x1fa0ee(0x258)]===_0x287432||String(_0x325bce['id'])===_0x287432);if(!_0x3893bc)throw CliErrors['validation'](_0x1fa0ee(0x293)+_0x287432);_0x4fb1ef=String(_0x3893bc['id']);}const _0x10c0dc=await getDatasetDetail(_0x4fb1ef),_0x2a38fd=normalizeDatasetOperations(_0x10c0dc['operations'])['find'](_0x5d4d00=>(_0x5d4d00[_0x1fa0ee(0x20e)]||_0x5d4d00[_0x1fa0ee(0x240)])===_0x1cfe54);if(!_0x2a38fd)throw CliErrors['validation'](_0x1fa0ee(0x1e8)+_0x1cfe54+_0x1fa0ee(0x28c)+_0x287432);return{'dataset':{'id':_0x10c0dc['id']??_0x10c0dc['modelId'],'name':_0x10c0dc[_0x1fa0ee(0x20e)],'code':_0x10c0dc['code']||_0x10c0dc[_0x1fa0ee(0x27e)],'tableName':_0x10c0dc[_0x1fa0ee(0x252)]||_0x10c0dc[_0x1fa0ee(0x22d)]?.[_0x1fa0ee(0x252)]},'operation':_0x2a38fd};}export async function startGenerateStandardPages(_0x29e9b4,_0x4a8ae9,_0x474f04){const _0x18659a=a197_0x3ede,_0x15ea13=await apiRequest(_0x18659a(0x294)+_0x4a8ae9+_0x18659a(0x23a),{'method':'POST','body':{'appCode':_0x29e9b4,..._0x474f04?.[_0x18659a(0x222)]?{'clientOperationId':_0x474f04[_0x18659a(0x222)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x15ea13[_0x18659a(0x213)];}export async function getGenerateStandardPagesStatus(_0x5dde45,_0x1cc6c2,_0x515229){const _0x461766=a197_0x3ede,_0x3a9953=new URLSearchParams({'appCode':_0x5dde45});_0x515229[_0x461766(0x210)]&&_0x3a9953[_0x461766(0x20d)](_0x461766(0x210),_0x515229[_0x461766(0x210)]);_0x515229[_0x461766(0x222)]&&_0x3a9953[_0x461766(0x20d)](_0x461766(0x222),_0x515229['clientOperationId']);const _0x2dec5d=await apiRequest(_0x461766(0x294)+_0x1cc6c2+'/generate-standard-pages/status?'+_0x3a9953['toString']());return _0x2dec5d['data'];}export async function getStandardPageStatus(_0x519b5d,_0x41e6ab){const _0x5c9e2d=a197_0x3ede,_0x122a26=await apiRequest(_0x5c9e2d(0x294)+_0x41e6ab+_0x5c9e2d(0x237)+encodeURIComponent(_0x519b5d));return _0x122a26[_0x5c9e2d(0x213)];}export async function tryGetStandardPageStatus(_0x5aa9db,_0x21ad75){const _0x56b1d2=a197_0x3ede;try{return await getStandardPageStatus(_0x5aa9db,_0x21ad75);}catch(_0x43e91d){if(_0x43e91d instanceof CliError&&_0x43e91d[_0x56b1d2(0x258)]===_0x56b1d2(0x234)&&/404|not found|non-json response/i['test'](_0x43e91d[_0x56b1d2(0x279)]))return null;throw _0x43e91d;}}export async function syncStandardPages(_0xd6f95d,_0x127269){const _0x134f30=a197_0x3ede,_0x73571b=await apiRequest(_0x134f30(0x294)+_0x127269+_0x134f30(0x292),{'method':_0x134f30(0x25e),'body':{'appCode':_0xd6f95d}});return _0x73571b['data'];}export async function getPageDetail(_0x408363){const _0x351e11=a197_0x3ede,_0x21981a=await apiRequest(_0x351e11(0x29c)+_0x408363);if(!_0x21981a[_0x351e11(0x213)])throw CliErrors[_0x351e11(0x202)](_0x351e11(0x27d)+_0x408363);return _0x21981a['data'];}function a197_0x8c48(){const _0x5198da=['/smartapi/question/er-config/cli/detail?','apiError','Fetch\x20datasets','3260424lvdyFD','/smartapi/permit/role/get-one','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','SQL\x20query\x20not\x20found:\x20','body','/api/','min','fetch-model-list','/smartapi/app-config/create','abort','/smartapi/app-config/list','status','/smartapi/permit/page/save','Invalid\x20response\x20format\x20(','has','push','.remove(id);','entries','AbortError','BFF\x20save\x20returned\x20no\x20valid\x20id','/smartapi/dataset/get-driven-data?','/api/management/library/scripts/delete','\x20apps.\x20','modelId','/api/node-toolbox/dataset/model-list?','isArray','trim','mobile','authRequired','47590jyvOAD','(/*\x20params\x20*/);','/smartapi/permit/role/update','/smartapi/permit/resource/get-menu-list','cookie','/smartapi/permit/page/get-one','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','const\x20results\x20=\x20data.execResult\x20||\x20[];','.create({\x20/*\x20fields\x20*/\x20});','filter','remove','userId','2wMGqYA','permits','json','getOne','Operation\x20\x22','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','requirementDescription','549jztxzL','startsWith','/smartapi/tasks/','toString','//\x20SQL:\x20','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','type','401','Check\x20network\x20connectivity\x20and\x20try\x20again.','cli:rabetbase','2353730dDNCdV','/smartapi/custom/updateUserCustomSql','remark','/smartapi/menu/update','/smartapi/dataset/text-generate/status?','&type=','roleType','sqlName','):\x20missing\x20data.markdown\x20field','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','errorCode','tags','validation','/smartapi/dataset/update-driven-data','/smartapi/permit/role/get-permit-list','/smartapi/permit/role/get-list','const\x20result\x20=\x20await\x20client.models.','API\x20error:\x20','errorMsg','/smartapi/question/er-config/cli/delete-single','/smartapi/question/er-config/business-group/edit','/smartapi/question/er-config/cli/update-single','markdown','set','name','create','operationId','table','/smartapi/dblink/update','data','/api/management/library/scripts/list?appCode=','isFinite','DATA_NOT_EXIST','/smartapi/question/er-config/cli/erCreate','success','Warning:\x20showing\x20first\x20','add','Fetch\x20doc\x20(','stringify','/filter','/api/management/library/scripts/save','\x20\x20currentPage:\x201,','scriptName','length','clientOperationId','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','pageSize','object','value','UNAUTHORIZED','102801XkZQIF','/smartapi/app-config/getByKey','needPublic','?sqlCode=','datasetTableCount','dbtableConfig','summary','\x20failed','ENABLE','/smartapi/permit/role/delete','key','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','api_error','/smartapi/custom/getUserCustomSql?id=','/smartapi/custom/deleteUserCustomSql','/standard-page-status?appCode=','includeImports','configArray','/generate-standard-pages/start','/smartapi/common/queryFileUrl','/userTenant/getByTenantCode','\x20\x20sqlCode:\x20\x27','method','target','operationName','/smartapi/dataset/restore-dataset','avatar','userTenantRelationList','const\x20data\x20=\x20await\x20client.sql.execute({','replace','/smartapi/lovrabet/update-page','Unauthorized','deleted','ER\x20relation\x20does\x20not\x20exist','/api/node-toolbox/api-doc-generator','currentPage','string','toLowerCase','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','version','signal','});','tableName','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','sqlCode','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','enabled','API\x20error\x20code:\x20306','code','/smartapi/db-analysis/jobs/cancel','tableList','/smartapi/common/uploadFile','scriptType','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','POST','update','list','正在从服务器拉取模型列表...\x20(环境:\x20','join','roleName','info','array','/smartapi/menu/find?','application/json','\x20\x20return\x20rows;','dbId','3178236UXdwTm','sdk','file','\x20\x20pageSize:\x2020,','/smartapi/dblink/delete','needSelf','description','totalCount','download','/smartapi/dblink/getList','/api/node-toolbox/sql/save','warn','error','email','/smartapi/dblink/getTableDiffV2ByPage','message','tableData','includes','API\x20error\x20code:\x20','Page\x20not\x20found:\x20','modelCode','\x20\x20where:\x20{},','functionName','map','/smartapi/dblink/getOne','GET','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','Request\x20timeout:\x20','appCode','label','.filter({','/smartapi/dblink/getAllTableList','/smartapi/dataset/get-dataset-list','find','\x22\x20not\x20found\x20in\x20dataset\x20','delete','/smartapi/dataset/text-generate/start','displayName','pageIndex','\x20\x20});','/sync-to-pages','Dataset\x20not\x20found:\x20','/smartapi/lovrabet/dataset/','265568XqiyUM','datasetName','457800oCudIg','append','\x20failed,\x20HTTP\x20','4ZKDsMa','hint','/smartapi/lovrabet/detail?pageId='];a197_0x8c48=function(){return _0x5198da;};return a197_0x8c48();}export async function updatePage(_0x4d93df,_0xd8a4bd,_0x52acf2,_0x34aed3){const _0x1e9d86=a197_0x3ede,_0x122f03=await apiRequest(_0x1e9d86(0x246),{'method':_0x1e9d86(0x25e),'body':{'appCode':_0x4d93df,'pageId':_0xd8a4bd,'code':_0x52acf2,'datasetIds':_0x34aed3}});return _0x122f03[_0x1e9d86(0x213)];}export function generateSdkCode(_0x42b219,_0x4765d3,_0x242271){const _0x2591d3=a197_0x3ede,_0x11ad59=_0x242271?.[_0x2591d3(0x238)]??!![],_0x55dfeb='dataset_'+_0x42b219[_0x2591d3(0x258)]?.[_0x2591d3(0x245)](/-/g,'_'),_0x39aed4=_0x4765d3[_0x2591d3(0x20e)]||_0x4765d3[_0x2591d3(0x240)]||_0x2591d3(0x1e1),_0x182b08=[];_0x11ad59&&_0x182b08[_0x2591d3(0x2af)](_0x2591d3(0x284),'',_0x2591d3(0x1ea),'');_0x182b08[_0x2591d3(0x2af)]('//\x20'+_0x42b219[_0x2591d3(0x20e)]+'\x20('+(_0x42b219[_0x2591d3(0x252)]||_0x2591d3(0x211))+')');if(_0x39aed4===_0x2591d3(0x1e1))_0x182b08[_0x2591d3(0x2af)](_0x2591d3(0x206)+_0x55dfeb+_0x2591d3(0x288),_0x2591d3(0x27f),_0x2591d3(0x26d),_0x2591d3(0x21f),_0x2591d3(0x251));else{if(_0x39aed4===_0x2591d3(0x1e7))_0x182b08['push']('const\x20result\x20=\x20await\x20client.models.'+_0x55dfeb+'.getOne(id);');else{if(_0x39aed4===_0x2591d3(0x20f))_0x182b08[_0x2591d3(0x2af)]('const\x20result\x20=\x20await\x20client.models.'+_0x55dfeb+_0x2591d3(0x1e0));else{if(_0x39aed4===_0x2591d3(0x25f))_0x182b08[_0x2591d3(0x2af)](_0x2591d3(0x206)+_0x55dfeb+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x39aed4===_0x2591d3(0x28d)||_0x39aed4===_0x2591d3(0x1e2)?_0x182b08['push']('const\x20result\x20=\x20await\x20client.models.'+_0x55dfeb+_0x2591d3(0x2b0)):_0x182b08[_0x2591d3(0x2af)]('const\x20result\x20=\x20await\x20client.models.'+_0x55dfeb+'.'+_0x39aed4+_0x2591d3(0x2be));}}}return _0x182b08[_0x2591d3(0x262)]('\x0a');}export function generateSqlCodeTemplate(_0x1914b2,_0x202e91){const _0x50564b=a197_0x3ede,_0x2eaed2=_0x202e91?.[_0x50564b(0x23f)]??_0x50564b(0x26b),_0xfb213c=_0x202e91?.[_0x50564b(0x238)]??!![],_0x2a087e=[];return _0x2a087e['push'](_0x50564b(0x1f0)+_0x1914b2['sqlName']+'\x20('+_0x1914b2[_0x50564b(0x254)]+')'),_0x2eaed2===_0x50564b(0x26b)?(_0xfb213c&&_0x2a087e[_0x50564b(0x2af)](_0x50564b(0x284),'',_0x50564b(0x1ea),''),_0x2a087e['push'](_0x50564b(0x244),_0x50564b(0x23d)+_0x1914b2[_0x50564b(0x254)]+'\x27,',_0x50564b(0x24e),_0x50564b(0x251),_0x50564b(0x223),_0x50564b(0x1df))):_0x2a087e[_0x50564b(0x2af)](_0x50564b(0x2a2),_0x50564b(0x255),_0x50564b(0x253),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x1914b2['sqlCode']+'\x27,',_0x50564b(0x1ff),_0x50564b(0x291),_0x50564b(0x268),'}'),_0x2a087e[_0x50564b(0x262)]('\x0a');}export async function getErConfig(_0x24a928,_0x53a83b){const _0x4c5e8f=a197_0x3ede,_0x863211=await apiRequest('/smartapi/question/er-config',{'method':_0x4c5e8f(0x25e),'body':{'appCode':_0x24a928,'dblinkId':_0x53a83b},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x863211[_0x4c5e8f(0x213)];}export async function getErRelationDetail(_0x3f3eac,_0x41ba98){const _0x102953=a197_0x3ede,_0x2da7d6=new URLSearchParams({'appCode':_0x3f3eac,'relationId':String(_0x41ba98)});try{const _0xd6fd94=await apiRequest(_0x102953(0x29d)+_0x2da7d6[_0x102953(0x1ef)]());return _0xd6fd94[_0x102953(0x213)]?.['relation']??null;}catch(_0x53608d){if(_0x53608d instanceof CliError&&_0x53608d[_0x102953(0x258)]===_0x102953(0x234)&&(_0x53608d[_0x102953(0x29b)]?.['includes'](_0x102953(0x216))||_0x53608d[_0x102953(0x29b)]===_0x102953(0x257)&&_0x53608d[_0x102953(0x279)]===_0x102953(0x249)))return null;throw _0x53608d;}}export async function createErRelation(_0x2c6519){const _0x15b42f=a197_0x3ede,_0xef3d7e=await apiRequest(_0x15b42f(0x217),{'method':_0x15b42f(0x25e),'body':_0x2c6519,'allowNonJsonSuccess':!![]});return _0xef3d7e[_0x15b42f(0x213)];}export async function updateErRelation(_0x1982b8){const _0x509865=a197_0x3ede,_0x4df73a=await apiRequest(_0x509865(0x20b),{'method':'POST','body':_0x1982b8,'allowNonJsonSuccess':!![]});return _0x4df73a['data'];}export async function deleteErRelation(_0x297eb8){const _0x3e3ca7=a197_0x3ede,_0x38b0d3=await apiRequest(_0x3e3ca7(0x209),{'method':_0x3e3ca7(0x25e),'body':_0x297eb8,'allowNonJsonSuccess':!![]});return _0x38b0d3['data'];}export async function updateErBusinessGroup(_0x9765c1){const _0x59fa34=a197_0x3ede,_0x3b5d69=await apiRequest(_0x59fa34(0x20a),{'method':_0x59fa34(0x25e),'body':_0x9765c1,'allowNonJsonSuccess':!![]});return _0x3b5d69[_0x59fa34(0x213)];}function buildQuery(_0x2e4f04){const _0x3da9a6=a197_0x3ede,_0x3184db=new URLSearchParams();for(const [_0x40de9d,_0x43b2ae]of Object[_0x3da9a6(0x2b1)](_0x2e4f04)){if(_0x43b2ae===undefined||_0x43b2ae==='')continue;_0x3184db[_0x3da9a6(0x20d)](_0x40de9d,String(_0x43b2ae));}const _0x278d86=_0x3184db[_0x3da9a6(0x1ef)]();return _0x278d86?'?'+_0x278d86:'';}export async function listNotificationChannelConfigs(_0x3b323e,_0x3817e){const _0x14595a=a197_0x3ede,_0x159ca8=await apiRequest('/notification/channel-config/list'+buildQuery({'appCode':_0x3b323e,'channelType':_0x3817e}));return Array[_0x14595a(0x2b9)](_0x159ca8[_0x14595a(0x213)])?_0x159ca8['data']:[];}export async function listAppConfigs(_0x5709f3,_0x3fd97d){const _0x6591ea=a197_0x3ede,_0x143f91=await apiRequest(_0x6591ea(0x2aa),{'method':'POST','body':{'appCode':_0x5709f3,..._0x3fd97d?.['key']?{'key':_0x3fd97d['key']}:{},..._0x3fd97d?.[_0x6591ea(0x201)]?{'tags':_0x3fd97d[_0x6591ea(0x201)]}:{}}});return extractAppConfigList(_0x143f91[_0x6591ea(0x213)]);}export async function getAppConfigByKey(_0x236b2a,_0xfbbcc9){const _0x46907e=a197_0x3ede,_0x648ca1=await apiRequest(_0x46907e(0x229)+buildQuery({'appCode':_0x236b2a,'key':_0xfbbcc9}));return _0x648ca1[_0x46907e(0x213)]??null;}export async function createAppConfig(_0x1b4fed){const _0x5dc950=a197_0x3ede,_0x440ec2=await apiRequest(_0x5dc950(0x2a8),{'method':_0x5dc950(0x25e),'body':{'appCode':_0x1b4fed[_0x5dc950(0x286)],'key':_0x1b4fed[_0x5dc950(0x232)],'value':_0x1b4fed[_0x5dc950(0x226)],..._0x1b4fed[_0x5dc950(0x201)]?{'tags':_0x1b4fed[_0x5dc950(0x201)]}:{}}});return _0x440ec2[_0x5dc950(0x213)];}export async function updateAppConfig(_0x4b6930){const _0x7c9042=a197_0x3ede;await apiRequest('/smartapi/app-config/update',{'method':_0x7c9042(0x25e),'body':{'id':_0x4b6930['id'],'appCode':_0x4b6930[_0x7c9042(0x286)],'key':_0x4b6930[_0x7c9042(0x232)],'value':_0x4b6930['value'],..._0x4b6930[_0x7c9042(0x201)]?{'tags':_0x4b6930[_0x7c9042(0x201)]}:{}}});}export async function deleteAppConfig(_0x2bb5c2){await apiRequest('/smartapi/app-config/delete',{'method':'POST','body':_0x2bb5c2});}function extractAppConfigList(_0x118608){const _0x21a94f=a197_0x3ede;if(Array['isArray'](_0x118608))return _0x118608;if(_0x118608&&typeof _0x118608===_0x21a94f(0x225)&&Array[_0x21a94f(0x2b9)](_0x118608[_0x21a94f(0x260)]))return _0x118608[_0x21a94f(0x260)];return extractList(_0x118608);}export async function listDbLinks(_0x4042e1,_0x26b0c6){const _0x2b2ca0=a197_0x3ede,_0x127f22=await apiRequest(_0x2b2ca0(0x273),{'method':_0x2b2ca0(0x25e),'body':{'appCode':_0x4042e1,'currentPage':_0x26b0c6?.[_0x2b2ca0(0x24b)]??0x1,'pageSize':_0x26b0c6?.['pageSize']??0x64}});return{'items':extractList(_0x127f22[_0x2b2ca0(0x213)]),'paging':extractPaging(_0x127f22[_0x2b2ca0(0x213)])};}export async function getDbLinkInfo(_0xf4a5f7){const _0x456be0=a197_0x3ede,_0xb59a9e=await apiRequest(_0x456be0(0x282)+buildQuery({'id':_0xf4a5f7}));return _0xb59a9e[_0x456be0(0x213)];}export async function createDbLink(_0x44bd38){const _0x565e33=a197_0x3ede,_0x5d2543=await apiRequest('/smartapi/dblink/create',{'method':_0x565e33(0x25e),'body':_0x44bd38});return _0x5d2543[_0x565e33(0x213)];}export async function updateDbLink(_0x43ac0d){const _0x58f181=a197_0x3ede,_0x4f4a08=await apiRequest(_0x58f181(0x212),{'method':_0x58f181(0x25e),'body':_0x43ac0d});return _0x4f4a08[_0x58f181(0x213)];}export async function deleteDbLink(_0x55bdbb){const _0x379626=a197_0x3ede;await apiRequest(_0x379626(0x26e),{'method':'POST','body':{'id':_0x55bdbb}});}export async function testDbLinkConnect(_0x38e06c){const _0x392320=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x38e06c}));return _0x392320['data'];}export async function startDbAnalysis(_0x375e0c,_0x524fae){const _0x160951=a197_0x3ede,_0x47eea=await apiRequest('/smartapi/db-analysis/start',{'method':'POST','body':{'dbLinkId':_0x375e0c,..._0x524fae&&_0x524fae[_0x160951(0x221)]>0x0?{'tableNames':_0x524fae}:{}}});return _0x47eea[_0x160951(0x213)];}export async function cancelDbAnalysis(_0x23aa18){const _0x366010=a197_0x3ede;await apiRequest(_0x366010(0x259)+buildQuery({'planId':_0x23aa18}),{'method':_0x366010(0x25e)});}export async function getDbAnalysisStatus(_0x2c0202){const _0x4bd9f6=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x2c0202));return _0x4bd9f6['data'];}export async function getDbAllTableList(_0x482294,_0x2bf1c9){const _0x1767fb=a197_0x3ede,_0x1f9594=await apiRequest(_0x1767fb(0x289)+buildQuery({'appCode':_0x482294,'dbLinkId':_0x2bf1c9})),_0x4e830b=_0x1f9594['data'];if(Array[_0x1767fb(0x2b9)](_0x4e830b))return _0x4e830b;return extractList(_0x4e830b);}export async function getDbTableDiff(_0x245186,_0x84061,_0x46971a){const _0x5e1d11=a197_0x3ede,_0x55d711=await apiRequest(_0x5e1d11(0x278)+buildQuery({'appCode':_0x245186,'dbLinkId':_0x84061,'pageIndex':_0x46971a?.[_0x5e1d11(0x290)]??0x1,'pageSize':_0x46971a?.[_0x5e1d11(0x224)]??0x14,'tableName':_0x46971a?.[_0x5e1d11(0x252)]})),_0x7f065e=_0x55d711['data'];return{'totalCount':_0x7f065e?.[_0x5e1d11(0x271)]??0x0,'physicalTableCount':_0x7f065e?.['physicalTableCount']??0x0,'datasetTableCount':_0x7f065e?.[_0x5e1d11(0x22c)]??0x0,..._0x7f065e?.[_0x5e1d11(0x22e)]?{'summary':_0x7f065e[_0x5e1d11(0x22e)]}:{},'tableList':Array[_0x5e1d11(0x2b9)](_0x7f065e?.['tableList'])?_0x7f065e[_0x5e1d11(0x25a)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x32461a=a197_0x3ede,_0x248666=await apiRequest('/smartapi/app/getList',{'method':_0x32461a(0x25e),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x31c586=extractList(_0x248666['data']),_0x4e19eb=extractPaging(_0x248666[_0x32461a(0x213)]);return _0x4e19eb&&_0x4e19eb[_0x32461a(0x271)]>REMOTE_APP_PAGE_SIZE&&console[_0x32461a(0x275)](_0x32461a(0x219)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x4e19eb[_0x32461a(0x271)]+_0x32461a(0x2b6)+_0x32461a(0x25d)),_0x31c586;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x1674bd,_0x3223e7){const _0x4012bd=a197_0x3ede,_0x31c4fc=Math[_0x4012bd(0x2a6)](Math['max'](_0x3223e7?.['pageSize']??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x3beff3=await apiRequest(_0x4012bd(0x205),{'method':_0x4012bd(0x25e),'body':{'appCode':_0x1674bd,'currentPage':_0x3223e7?.[_0x4012bd(0x24b)]??0x1,'pageSize':_0x31c4fc}});return{'items':extractList(_0x3beff3[_0x4012bd(0x213)]),'paging':extractPaging(_0x3beff3['data'])};}export async function getAppRole(_0x3fc3a9){const _0x9826c2=a197_0x3ede,_0x18fdd2=await apiRequest(_0x9826c2(0x2a1)+buildQuery({'id':_0x3fc3a9}));return _0x18fdd2[_0x9826c2(0x213)];}export async function createAppRole(_0x521c6e){const _0xe06a8e=a197_0x3ede,_0x564197=await apiRequest('/smartapi/permit/role/create',{'method':_0xe06a8e(0x25e),'body':{'appCode':_0x521c6e[_0xe06a8e(0x286)],'roleName':_0x521c6e['roleName'],'roleType':'CUSTOM',..._0x521c6e[_0xe06a8e(0x1f8)]?{'remark':_0x521c6e[_0xe06a8e(0x1f8)]}:{}}});return _0x564197['data'];}export async function updateAppRole(_0x40a70e){const _0x437115=a197_0x3ede,_0x25dbf1=await apiRequest(_0x437115(0x1da),{'method':_0x437115(0x25e),'body':{'id':_0x40a70e['id'],'appCode':_0x40a70e[_0x437115(0x286)],..._0x40a70e[_0x437115(0x1fc)]?{'roleType':_0x40a70e[_0x437115(0x1fc)]}:{},..._0x40a70e[_0x437115(0x263)]!==undefined?{'roleName':_0x40a70e[_0x437115(0x263)]}:{},..._0x40a70e['remark']!==undefined?{'remark':_0x40a70e[_0x437115(0x1f8)]}:{},..._0x40a70e['permits']?{'permits':_0x40a70e[_0x437115(0x1e5)]}:{}}});return _0x25dbf1['data'];}export async function deleteAppRole(_0x15ea92){const _0x222815=a197_0x3ede;await apiRequest(_0x222815(0x231),{'method':_0x222815(0x25e),'body':{'id':_0x15ea92}});}export async function listPermitRoles(_0xbb1f09,_0x6d74b3){const _0x3b0320=a197_0x3ede,_0x56ddac=await apiRequest(_0x3b0320(0x204),{'method':'POST','body':{'appCode':_0xbb1f09,..._0x6d74b3?.[_0x3b0320(0x26f)]!==undefined?{'needSelf':_0x6d74b3[_0x3b0320(0x26f)]}:{},..._0x6d74b3?.['needPublic']!==undefined?{'needPublic':_0x6d74b3[_0x3b0320(0x22a)]}:{}}});return extractList(_0x56ddac[_0x3b0320(0x213)]);}export async function getRoleMenuResources(_0x2de035,_0x2044fd){const _0x246c99=a197_0x3ede,_0xa2da92=await apiRequest(_0x246c99(0x1db),{'method':'POST','body':{'appCode':_0x2de035,'roleId':_0x2044fd}});return extractList(_0xa2da92[_0x246c99(0x213)]);}export async function getRoleApiResources(_0x33dcea,_0x48fc7d){const _0x22e16d=a197_0x3ede,_0x4d0e27=await apiRequest('/smartapi/permit/resource/get-api-list',{'method':_0x22e16d(0x25e),'body':{'appCode':_0x33dcea,'roleId':_0x48fc7d}});return extractList(_0x4d0e27[_0x22e16d(0x213)]);}function a197_0x3ede(_0x23b676,_0x4edfc9){_0x23b676=_0x23b676-0x1da;const _0x8c4898=a197_0x8c48();let _0x3ede9c=_0x8c4898[_0x23b676];return _0x3ede9c;}export async function listRoleUsers(_0x2d29f1){const _0x351b18=a197_0x3ede,_0x591497=await apiRequest('/smartapi/permit/user-role/get-user-list',{'method':_0x351b18(0x25e),'body':{'appCode':_0x2d29f1}});return extractList(_0x591497[_0x351b18(0x213)]);}export async function updateRoleUsers(_0xd88b2e,_0xd0bd1d){const _0x4f2bd8=a197_0x3ede;await apiRequest('/smartapi/permit/user-role/update-user-list',{'method':_0x4f2bd8(0x25e),'body':{'appCode':_0xd88b2e,'roleList':_0xd0bd1d}});}export async function getPagePermit(_0x1a0507){const _0x384df6=a197_0x3ede,_0x335ee3=await apiRequest(_0x384df6(0x1dd)+buildQuery({'menuId':_0x1a0507}));return _0x335ee3[_0x384df6(0x213)];}export async function savePagePermit(_0x28c579){const _0x24f8a3=a197_0x3ede,_0x5b5182=await apiRequest(_0x24f8a3(0x2ac),{'method':_0x24f8a3(0x25e),'body':_0x28c579});return _0x5b5182[_0x24f8a3(0x213)];}export async function getTenantMembers(_0x3bfa76){const _0x4e2e7a=a197_0x3ede,_0x53af19=await apiRequest(_0x4e2e7a(0x23c)+buildQuery({'code':_0x3bfa76})),_0x582529=_0x53af19[_0x4e2e7a(0x213)]??{},_0x27ee75=Array[_0x4e2e7a(0x2b9)](_0x582529?.[_0x4e2e7a(0x243)])?_0x582529[_0x4e2e7a(0x243)]:[];return _0x27ee75['filter'](_0x1530c0=>_0x1530c0?.['status']===_0x4e2e7a(0x230)||_0x1530c0?.[_0x4e2e7a(0x2ab)]===undefined)[_0x4e2e7a(0x281)](_0x464698=>({'userId':Number(_0x464698[_0x4e2e7a(0x1e3)]??_0x464698['id']),'username':_0x464698['username'],'nickname':_0x464698['nickname'],'status':_0x464698[_0x4e2e7a(0x2ab)],'email':_0x464698[_0x4e2e7a(0x277)],'mobile':_0x464698[_0x4e2e7a(0x2bb)],'avatar':_0x464698[_0x4e2e7a(0x242)]}))[_0x4e2e7a(0x1e1)](_0x231b63=>Number[_0x4e2e7a(0x215)](_0x231b63[_0x4e2e7a(0x1e3)])&&_0x231b63[_0x4e2e7a(0x1e3)]>0x0);}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a198_0x5e2761=a198_0x3db2;(function(_0x26dc69,_0x2a5cac){const _0x2415b7=a198_0x3db2,_0xa68508=_0x26dc69();while(!![]){try{const _0x581870=-parseInt(_0x2415b7(0x7f))/0x1+-parseInt(_0x2415b7(0x8b))/0x2*(parseInt(_0x2415b7(0x85))/0x3)+parseInt(_0x2415b7(0x83))/0x4+parseInt(_0x2415b7(0x82))/0x5*(-parseInt(_0x2415b7(0x8a))/0x6)+parseInt(_0x2415b7(0x84))/0x7*(parseInt(_0x2415b7(0x86))/0x8)+-parseInt(_0x2415b7(0x89))/0x9+parseInt(_0x2415b7(0x80))/0xa;if(_0x581870===_0x2a5cac)break;else _0xa68508['push'](_0xa68508['shift']());}catch(_0xf74375){_0xa68508['push'](_0xa68508['shift']());}}}(a198_0x1df0,0x3056a));function a198_0x3db2(_0xe19808,_0x259d11){_0xe19808=_0xe19808-0x7f;const _0x1df09f=a198_0x1df0();let _0x3db21f=_0x1df09f[_0xe19808];return _0x3db21f;}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a198_0x5e2761(0x88),TRASH_DIR_NAME=a198_0x5e2761(0x81);function a198_0x1df0(){const _0x14e7fc=['297640vmjOVH','bff-trash','10NoKCBM','1317504Tglqix','245QFoklA','9pMsdXE','76520AFDKDh','bff','bff.lock.json','1425357fhynRK','105384zXXYPO','201046XuonTB','851myVQyY'];a198_0x1df0=function(){return _0x14e7fc;};return a198_0x1df0();}export function loadBffProjectConfig(_0x39373a,_0x2c6bf3){const _0x1a0574=a198_0x5e2761,_0x37b3a5=resolve(_0x2c6bf3??findProjectRootDirectory()),_0x3b6314=DOT_DIR+'/bff',_0x59f73f=_0x3b6314+'/'+_0x39373a;return{'projectRoot':_0x37b3a5,'appCode':_0x39373a,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x3b6314,'scriptsRoot':_0x59f73f,'scriptsRootDir':resolve(_0x37b3a5,DOT_DIR,_0x1a0574(0x87),_0x39373a),'lockFilePath':resolve(_0x37b3a5,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x37b3a5,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a199_0x2b6856=a199_0x4de6;(function(_0x15e692,_0x1d7898){const _0x2d2a3f=a199_0x4de6,_0x230825=_0x15e692();while(!![]){try{const _0x12b615=parseInt(_0x2d2a3f(0xfb))/0x1+-parseInt(_0x2d2a3f(0x106))/0x2+parseInt(_0x2d2a3f(0xfe))/0x3+-parseInt(_0x2d2a3f(0xf9))/0x4+parseInt(_0x2d2a3f(0x105))/0x5*(-parseInt(_0x2d2a3f(0x100))/0x6)+-parseInt(_0x2d2a3f(0x117))/0x7*(parseInt(_0x2d2a3f(0x109))/0x8)+parseInt(_0x2d2a3f(0x116))/0x9;if(_0x12b615===_0x1d7898)break;else _0x230825['push'](_0x230825['shift']());}catch(_0xb740f7){_0x230825['push'](_0x230825['shift']());}}}(a199_0x4b0b,0x46adf));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a199_0x2b6856(0x110),a199_0x2b6856(0x104),a199_0x2b6856(0x112)];export function normalizeBffType(_0x2b9105){const _0x552ee7=a199_0x2b6856;if(!_0x2b9105)return undefined;const _0x16f46f=_0x2b9105['trim']()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x552ee7(0x119)](_0x16f46f)?_0x16f46f:undefined;}function a199_0x4de6(_0x5cb177,_0x452ad8){_0x5cb177=_0x5cb177-0xf6;const _0x4b0b06=a199_0x4b0b();let _0x4de614=_0x4b0b06[_0x5cb177];return _0x4de614;}async function scanJsFilesRecursively(_0x580880,_0x1b01bd){const _0x4bed82=a199_0x2b6856,_0x262779=[];try{const _0x4dd31b=await readdir(_0x580880,{'withFileTypes':!![]});for(const _0x18c568 of _0x4dd31b){const _0x4fdf6e=join(_0x580880,_0x18c568[_0x4bed82(0x10d)]);if(_0x18c568[_0x4bed82(0x102)]())_0x262779[_0x4bed82(0x118)](...await scanJsFilesRecursively(_0x4fdf6e,_0x1b01bd+'/'+_0x18c568['name']));else _0x18c568[_0x4bed82(0x111)]()&&_0x18c568[_0x4bed82(0x10d)][_0x4bed82(0x113)]('.js')&&_0x262779['push']({'lockKey':_0x1b01bd+'/'+_0x18c568[_0x4bed82(0x10d)][_0x4bed82(0xf7)](/\.js$/,''),'filePath':_0x4fdf6e});}}catch(_0x185b86){if(_0x185b86[_0x4bed82(0x11a)]!=='ENOENT')throw _0x185b86;}return _0x262779;}async function scanFlatFunctions(_0xd2fe15,_0x44c6fb){const _0xf53a84=a199_0x2b6856,_0x1451ee=join(_0xd2fe15[_0xf53a84(0x107)],_0x44c6fb),_0x2af0ec=await scanJsFilesRecursively(_0x1451ee,_0x44c6fb);return _0x2af0ec[_0xf53a84(0xfa)](({lockKey:_0x5e7229,filePath:_0x3fd440})=>({'type':_0x44c6fb,'name':_0x5e7229[_0xf53a84(0x101)]('/')['at'](-0x1)??'','filePath':_0x3fd440,'lockKey':_0x5e7229}));}async function scanHookFunctions(_0x91c9be){const _0x5d8c51=a199_0x2b6856,_0x27a646=join(_0x91c9be['scriptsRootDir'],_0x5d8c51(0x112)),_0x2f7e20=[];try{const _0x52b8d8=await readdir(_0x27a646,{'withFileTypes':!![]});for(const _0x2edd3c of _0x52b8d8){if(!_0x2edd3c[_0x5d8c51(0x102)]())continue;const _0x148fa3=_0x2edd3c['name'],_0x4186d0=join(_0x27a646,_0x148fa3),_0x331d98=await readdir(_0x4186d0,{'withFileTypes':!![]});for(const _0x7bb7e3 of _0x331d98){if(!_0x7bb7e3[_0x5d8c51(0x102)]())continue;const _0x407a4a=_0x7bb7e3[_0x5d8c51(0x10d)],_0x47b04f=join(_0x4186d0,_0x407a4a),_0x1298de=await readdir(_0x47b04f,{'withFileTypes':!![]});for(const _0x3c5b2a of _0x1298de){if(!_0x3c5b2a[_0x5d8c51(0x102)]())continue;const _0x34ff4c=_0x3c5b2a[_0x5d8c51(0x10d)],_0x4fc2ce=join(_0x47b04f,_0x34ff4c),_0x5c021d=await readdir(_0x4fc2ce,{'withFileTypes':!![]});for(const _0x20a1cd of _0x5c021d){if(!_0x20a1cd[_0x5d8c51(0x111)]()||!_0x20a1cd[_0x5d8c51(0x10d)][_0x5d8c51(0x113)](_0x5d8c51(0x11b)))continue;const _0x132cd4=_0x20a1cd[_0x5d8c51(0x10d)][_0x5d8c51(0xf7)](/\.js$/,'');_0x2f7e20['push']({'type':_0x5d8c51(0x112),'name':_0x132cd4,'filePath':join(_0x4fc2ce,_0x20a1cd[_0x5d8c51(0x10d)]),'lockKey':_0x5d8c51(0x10e)+_0x148fa3+'/'+_0x407a4a+'/'+_0x34ff4c+'/'+_0x132cd4,'alias':_0x148fa3,'operationType':_0x407a4a,'functionNode':_0x34ff4c});}}}}}catch(_0x5e0906){if(_0x5e0906[_0x5d8c51(0x11a)]!==_0x5d8c51(0x115))throw _0x5e0906;}return _0x2f7e20;}export async function scanLocalBffFunctions(_0x491ceb,_0x406889){const _0x19656c=a199_0x2b6856;if(_0x406889===_0x19656c(0x110)||_0x406889===_0x19656c(0x104))return scanFlatFunctions(_0x491ceb,_0x406889);if(_0x406889===_0x19656c(0x112))return scanHookFunctions(_0x491ceb);const [_0x4aee47,_0x2725da,_0x15bdd7]=await Promise[_0x19656c(0xff)]([scanFlatFunctions(_0x491ceb,'COMMON'),scanFlatFunctions(_0x491ceb,'ENDPOINT'),scanHookFunctions(_0x491ceb)]);return[..._0x4aee47,..._0x2725da,..._0x15bdd7];}export function resolveLocalFilePathFromLockKey(_0x136166,_0x180bda){const _0x4136f2=a199_0x2b6856;return join(_0x136166[_0x4136f2(0x107)],..._0x180bda[_0x4136f2(0x101)]('/'))+'.js';}export function createHookLocationMap(_0x4980f0){const _0x57036b=a199_0x2b6856,_0x427004=new Map();for(const _0x4a94ed of _0x4980f0){_0x4a94ed[_0x57036b(0x103)]&&_0x427004['set'](_0x4a94ed[_0x57036b(0x103)],{'datasetCode':_0x4a94ed[_0x57036b(0xfc)],'operationType':snakeToCamel(_0x4a94ed[_0x57036b(0xf6)]),'functionNode':_0x57036b(0xf8)}),_0x4a94ed['afterScriptId']&&_0x427004['set'](_0x4a94ed['afterScriptId'],{'datasetCode':_0x4a94ed[_0x57036b(0xfc)],'operationType':snakeToCamel(_0x4a94ed[_0x57036b(0xf6)]),'functionNode':_0x57036b(0x10c)});}return _0x427004;}export function resolveRemoteScriptTarget(_0x41a077,_0x58d99b,_0x6e2c6d,_0x496313,_0x55de26){const _0x332baf=a199_0x2b6856,_0x1f7344=normalizeBffType(_0x58d99b[_0x332baf(0xfd)]);if(!_0x1f7344||!_0x58d99b[_0x332baf(0x10f)])return null;if(_0x1f7344===_0x332baf(0x112)){const _0x5a6482=(_0x58d99b['id']?_0x6e2c6d['get'](_0x58d99b['id']):undefined)??findHookLocationByRemoteId(_0x496313,_0x58d99b['id']);if(!_0x5a6482)return null;const _0x396d99=_0x5a6482[_0x332baf(0x10b)]||_0x55de26[_0x332baf(0x108)](_0x5a6482[_0x332baf(0xfc)]),_0x2c89bd=_0x396d99??_0x5a6482[_0x332baf(0xfc)],_0x493ace={..._0x5a6482,'alias':_0x396d99},_0x58c76e=_0x332baf(0x10e)+_0x2c89bd+'/'+_0x493ace[_0x332baf(0xf6)]+'/'+_0x493ace[_0x332baf(0x114)]+'/'+_0x58d99b[_0x332baf(0x10f)];return{'lockKey':_0x58c76e,'filePath':resolveLocalFilePathFromLockKey(_0x41a077,_0x58c76e),'type':'HOOK','hookLocation':_0x493ace};}const _0x52a8a0=_0x1f7344+'/'+_0x58d99b[_0x332baf(0x10f)];return{'lockKey':_0x52a8a0,'filePath':resolveLocalFilePathFromLockKey(_0x41a077,_0x52a8a0),'type':_0x1f7344};}export async function ensureParentDirectory(_0x22d62e){await mkdir(dirname(_0x22d62e),{'recursive':!![]});}function a199_0x4b0b(){const _0x52fffe=['get','241672vvMSCj','F_OK','alias','after','name','HOOK/','functionName','COMMON','isFile','HOOK','endsWith','functionNode','ENOENT','3368871opXyuw','28UAhwGX','push','includes','code','.js','operationType','replace','before','297376GKtvqc','map','362296BXTpOh','datasetCode','scriptType','1436196POgXNv','all','54ZeFJxe','split','isDirectory','beforeScriptId','ENDPOINT','102775eMHMKZ','1091338dMiEPY','scriptsRootDir'];a199_0x4b0b=function(){return _0x52fffe;};return a199_0x4b0b();}export async function fileExists(_0x283b77){const _0x5e7dc0=a199_0x2b6856;try{return await access(_0x283b77,constants[_0x5e7dc0(0x10a)]),!![];}catch{return![];}}export async function directoryExists(_0x28cabf){const _0x59b4af=a199_0x2b6856;try{const _0x4b87c5=await stat(_0x28cabf);return _0x4b87c5[_0x59b4af(0x102)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x53c59f,_0xe82e38){const _0x2ef716=a200_0x31c4,_0x251e1c=_0x53c59f();while(!![]){try{const _0x3cd047=parseInt(_0x2ef716(0x1d2))/0x1*(-parseInt(_0x2ef716(0x1ca))/0x2)+-parseInt(_0x2ef716(0x1c8))/0x3+-parseInt(_0x2ef716(0x1cc))/0x4*(-parseInt(_0x2ef716(0x1cf))/0x5)+-parseInt(_0x2ef716(0x1c9))/0x6+parseInt(_0x2ef716(0x1ce))/0x7*(-parseInt(_0x2ef716(0x1cb))/0x8)+parseInt(_0x2ef716(0x1c7))/0x9+-parseInt(_0x2ef716(0x1d1))/0xa*(-parseInt(_0x2ef716(0x1c5))/0xb);if(_0x3cd047===_0xe82e38)break;else _0x251e1c['push'](_0x251e1c['shift']());}catch(_0x140674){_0x251e1c['push'](_0x251e1c['shift']());}}}(a200_0x47ef,0x55fe6));import{readFile}from'node:fs/promises';function a200_0x47ef(){const _0xa4b70=['407036PCBhjM','hex','9737ZOnLdH','10HvsfzV','digest','40qYojav','298sMEUAv','md5','1915804HRWQjJ','utf8','2578932bzLHFd','1465677dbNLsn','1030740CSLyUy','842PkRIFV','280YwczIH'];a200_0x47ef=function(){return _0xa4b70;};return a200_0x47ef();}import a200_0x1b75a0 from'node:crypto';function a200_0x31c4(_0x3163df,_0x37555f){_0x3163df=_0x3163df-0x1c4;const _0x47efb9=a200_0x47ef();let _0x31c452=_0x47efb9[_0x3163df];return _0x31c452;}export function computeContentHash(_0x1944a8){const _0x4e6de3=a200_0x31c4;return a200_0x1b75a0['createHash'](_0x4e6de3(0x1c4))['update'](_0x1944a8)[_0x4e6de3(0x1d0)](_0x4e6de3(0x1cd));}export async function computeFileHash(_0x1c3e6e){const _0x342717=a200_0x31c4,_0x32ff38=await readFile(_0x1c3e6e,_0x342717(0x1c6));return computeContentHash(_0x32ff38);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a201_0x5388(_0x39b257,_0x15d917){_0x39b257=_0x39b257-0x15f;const _0x1b1789=a201_0x1b17();let _0x53881e=_0x1b1789[_0x39b257];return _0x53881e;}(function(_0x485605,_0x56092d){const _0x87b49=a201_0x5388,_0x2ed238=_0x485605();while(!![]){try{const _0x3711cc=parseInt(_0x87b49(0x172))/0x1*(parseInt(_0x87b49(0x16d))/0x2)+parseInt(_0x87b49(0x163))/0x3+parseInt(_0x87b49(0x168))/0x4+parseInt(_0x87b49(0x164))/0x5*(-parseInt(_0x87b49(0x171))/0x6)+parseInt(_0x87b49(0x167))/0x7+-parseInt(_0x87b49(0x16e))/0x8+parseInt(_0x87b49(0x16f))/0x9;if(_0x3711cc===_0x56092d)break;else _0x2ed238['push'](_0x2ed238['shift']());}catch(_0x56036a){_0x2ed238['push'](_0x2ed238['shift']());}}}(a201_0x1b17,0xa8032));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x26c73e,_0x470f8e,_0x3a30c8,_0x4274aa){const _0x4035a6=a201_0x5388,_0x1301e0={'apps':_0x26c73e[_0x4035a6(0x170)]&&typeof _0x26c73e[_0x4035a6(0x170)]===_0x4035a6(0x173)?_0x26c73e[_0x4035a6(0x170)]:{}};let _0x1e6e6e=_0x1301e0['apps'][_0x470f8e];if(!_0x1e6e6e)return _0x1e6e6e={'scriptsRoot':_0x3a30c8,'lastSync':'','functions':{}},_0x1301e0['apps'][_0x470f8e]=_0x1e6e6e,{'lockData':_0x1301e0,'appLock':_0x1e6e6e};if(!_0x1e6e6e[_0x4035a6(0x16b)])_0x1e6e6e[_0x4035a6(0x16b)]=_0x3a30c8;else{if(_0x1e6e6e[_0x4035a6(0x16b)]!==_0x3a30c8)throw new Error(_0x4274aa+_0x4035a6(0x169)+(_0x4035a6(0x16c)+_0x3a30c8+_0x4035a6(0x161)+_0x1e6e6e[_0x4035a6(0x16b)]+_0x4035a6(0x15f))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x1e6e6e['functions']&&(_0x1e6e6e['functions']={}),!_0x1e6e6e[_0x4035a6(0x162)]&&(_0x1e6e6e[_0x4035a6(0x162)]=''),{'lockData':_0x1301e0,'appLock':_0x1e6e6e};}function a201_0x1b17(){const _0x3c62bc=['utf8','\x22.\x20','parse','\x22\x20vs\x20lock\x20\x22','lastSync','1336296GRNZtW','4700OqmnHg','ENOENT','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','2662996GglcVE','3360276DGVfVk',':\x20scriptsRoot\x20mismatch\x20—\x20','code','scriptsRoot','current\x20\x22','2oEtKlL','10533256RvoHMi','9359487WcWwcu','apps','8520coyXFD','633763cMrVTe','object'];a201_0x1b17=function(){return _0x3c62bc;};return a201_0x1b17();}export async function readBffLockFile(_0x1b97b9){const _0x1b6d1a=a201_0x5388;try{const _0x3f4b41=await readFile(_0x1b97b9,_0x1b6d1a(0x174)),_0xcf1e3f=JSON[_0x1b6d1a(0x160)](_0x3f4b41);return{'apps':_0xcf1e3f['apps']&&typeof _0xcf1e3f[_0x1b6d1a(0x170)]===_0x1b6d1a(0x173)?_0xcf1e3f['apps']:{}};}catch(_0x4cebd7){if(_0x4cebd7[_0x1b6d1a(0x16a)]===_0x1b6d1a(0x165))return null;throw new Error(_0x1b6d1a(0x166)+String(_0x4cebd7));}}export async function writeBffLockFile(_0x5720be,_0x2e0104){await mkdir(dirname(_0x5720be),{'recursive':!![]}),await writeFile(_0x5720be,JSON['stringify'](_0x2e0104,null,0x2),'utf8');}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2a913f,_0x5b14fe){const _0x371cdb=a203_0xbddb,_0x20c8b9=_0x2a913f();while(!![]){try{const _0x194f50=-parseInt(_0x371cdb(0x79))/0x1+-parseInt(_0x371cdb(0x7d))/0x2+-parseInt(_0x371cdb(0x7a))/0x3*(parseInt(_0x371cdb(0x84))/0x4)+-parseInt(_0x371cdb(0x85))/0x5*(parseInt(_0x371cdb(0x89))/0x6)+parseInt(_0x371cdb(0x8a))/0x7*(parseInt(_0x371cdb(0x81))/0x8)+parseInt(_0x371cdb(0x7e))/0x9+-parseInt(_0x371cdb(0x78))/0xa*(-parseInt(_0x371cdb(0x8b))/0xb);if(_0x194f50===_0x5b14fe)break;else _0x20c8b9['push'](_0x20c8b9['shift']());}catch(_0x9ce50a){_0x20c8b9['push'](_0x20c8b9['shift']());}}}(a203_0x20dd,0xe1d61));export function snakeToCamel(_0x489aaf){const _0x318554=a203_0xbddb;return _0x489aaf[_0x318554(0x82)]()['replace'](/_([a-z])/g,(_0x403f6e,_0x169666)=>_0x169666['toUpperCase']());}export function findHookLocationByRemoteId(_0x2eb4b2,_0x38718c){const _0x47a205=a203_0xbddb;if(!_0x38718c)return undefined;for(const _0x146ae9 of Object['values'](_0x2eb4b2)){if(_0x146ae9[_0x47a205(0x88)]===_0x38718c&&_0x146ae9['datasetCode']&&_0x146ae9[_0x47a205(0x7b)]&&_0x146ae9[_0x47a205(0x7c)])return{'datasetCode':_0x146ae9[_0x47a205(0x7f)],'operationType':_0x146ae9[_0x47a205(0x7b)],'functionNode':_0x146ae9[_0x47a205(0x7c)]};}return undefined;}export function extractScriptDescription(_0x40ce84){const _0x2ae51f=a203_0xbddb,_0x5a683e=_0x40ce84[_0x2ae51f(0x80)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x5a683e?.[0x1]?.[_0x2ae51f(0x83)]()||undefined;}export function isValidBffFunctionName(_0x1fd34e){const _0x605f39=a203_0xbddb;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x605f39(0x87)](_0x1fd34e);}function a203_0xbddb(_0x48cc90,_0xdc3c4){_0x48cc90=_0x48cc90-0x78;const _0x20dda9=a203_0x20dd();let _0xbddb22=_0x20dda9[_0x48cc90];return _0xbddb22;}export function normalizeHookFunctionNode(_0x5f59c1){const _0x3d7d1d=a203_0xbddb;if(!_0x5f59c1)return undefined;const _0x50c193=_0x5f59c1[_0x3d7d1d(0x83)]()['toLowerCase']();if(_0x50c193===_0x3d7d1d(0x86)||_0x50c193===_0x3d7d1d(0x8c))return _0x50c193;return undefined;}function a203_0x20dd(){const _0x2e580e=['operationType','functionNode','3028744jYSnjf','9980748yyCKYW','datasetCode','match','1380192XBNgNu','toLowerCase','trim','519148YdZkTs','8232680KXnzBU','before','test','remoteId','6IuJSSJ','7MXuROw','231MuLiwd','after','2510600lHXjsm','780592orANGe','39Lrojns'];a203_0x20dd=function(){return _0x2e580e;};return a203_0x20dd();}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x628cb,_0x4d3458){const _0x4551e3=a204_0x5035,_0x50b567=_0x628cb();while(!![]){try{const _0x1141ee=-parseInt(_0x4551e3(0x178))/0x1+parseInt(_0x4551e3(0x187))/0x2*(-parseInt(_0x4551e3(0x192))/0x3)+parseInt(_0x4551e3(0x189))/0x4+-parseInt(_0x4551e3(0x18b))/0x5*(-parseInt(_0x4551e3(0x17b))/0x6)+-parseInt(_0x4551e3(0x193))/0x7+parseInt(_0x4551e3(0x186))/0x8*(parseInt(_0x4551e3(0x181))/0x9)+parseInt(_0x4551e3(0x17f))/0xa;if(_0x1141ee===_0x4d3458)break;else _0x50b567['push'](_0x50b567['shift']());}catch(_0x399e99){_0x50b567['push'](_0x50b567['shift']());}}}(a204_0x32bc,0x9d3bf));import{listDatasets}from'../core/api-client.js';function a204_0x5035(_0x1f9e71,_0x4af691){_0x1f9e71=_0x1f9e71-0x177;const _0x32bcdd=a204_0x32bc();let _0x5035a4=_0x32bcdd[_0x1f9e71];return _0x5035a4;}const cache=new Map();function a204_0x32bc(){const _0x1e694=['30mkoUBS','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','\x22.\x20Available:\x20','toLowerCase','find','set','length','2143047rboYQF','3272710etNVeD','dbtableConfig','dbId','941693gSVPyq','entries','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','1089378TeAHLe','filter','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','join','2351750fLQuLG','db-','109575VjJodU','\x22\x20matches\x20multiple\x20databases:\x20','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','map','isNaN','568MggYGg','2ppeQAJ','dbName','2314500tFhfUZ','has'];a204_0x32bc=function(){return _0x1e694;};return a204_0x32bc();}export async function listDatabases(_0x26f719){const _0x45fdc8=a204_0x5035;if(cache[_0x45fdc8(0x18a)](_0x26f719))return cache['get'](_0x26f719);const _0x5a686d=await listDatasets(_0x26f719),_0x3c6f99=new Map();for(const _0x263398 of _0x5a686d){const _0x1525d3=_0x263398[_0x45fdc8(0x194)];_0x1525d3?.[_0x45fdc8(0x177)]!=null&&_0x3c6f99[_0x45fdc8(0x190)](_0x1525d3['dbId'],_0x1525d3[_0x45fdc8(0x188)]??_0x45fdc8(0x180)+_0x1525d3[_0x45fdc8(0x177)]);}const _0x3719c0=[..._0x3c6f99[_0x45fdc8(0x179)]()][_0x45fdc8(0x184)](([_0x171d42,_0x32e1ab])=>({'dbId':_0x171d42,'dbName':_0x32e1ab}));return cache[_0x45fdc8(0x190)](_0x26f719,_0x3719c0),_0x3719c0;}export async function resolveDb(_0x556d4a,_0x4940d3){const _0x59ae46=a204_0x5035,_0x133c08=await listDatabases(_0x556d4a);if(_0x133c08[_0x59ae46(0x191)]===0x0)return{'resolved':[],'error':_0x59ae46(0x183)+_0x556d4a+_0x59ae46(0x17d)};if(!_0x4940d3)return{'resolved':_0x133c08};const _0x12ab06=Number(_0x4940d3);if(!Number[_0x59ae46(0x185)](_0x12ab06)){const _0x5648e3=_0x133c08[_0x59ae46(0x18f)](_0x92dc3b=>_0x92dc3b[_0x59ae46(0x177)]===_0x12ab06);if(_0x5648e3)return{'resolved':[_0x5648e3]};}const _0xffa70=_0x4940d3['toLowerCase'](),_0x1f5592=_0x133c08[_0x59ae46(0x17c)](_0xabc86c=>_0xabc86c['dbName'][_0x59ae46(0x18e)]()['includes'](_0xffa70));if(_0x1f5592[_0x59ae46(0x191)]>0x0)return{'resolved':_0x1f5592};const _0xb7493e=_0x133c08[_0x59ae46(0x184)](_0xebbc42=>_0xebbc42['dbName']+'\x20('+_0xebbc42['dbId']+')')[_0x59ae46(0x17e)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x4940d3+'\x22\x20under\x20app\x20\x22'+_0x556d4a+_0x59ae46(0x18d)+_0xb7493e+_0x59ae46(0x18c)};}export async function resolveOneDb(_0x5778fa,_0x4e2a72){const _0xcdc347=a204_0x5035,{resolved:_0xbde90c,error:_0x344680}=await resolveDb(_0x5778fa,_0x4e2a72);if(_0x344680)return{'db':null,'error':_0x344680};if(_0xbde90c[_0xcdc347(0x191)]===0x1)return{'db':_0xbde90c[0x0]};if(!_0x4e2a72){const _0x1914b7=_0xbde90c[_0xcdc347(0x184)](_0x5d3684=>_0x5d3684[_0xcdc347(0x188)]+'\x20('+_0x5d3684[_0xcdc347(0x177)]+')')[_0xcdc347(0x17e)](',\x20');return{'db':null,'error':_0xcdc347(0x17a)+_0x1914b7};}const _0x4d1e33=_0xbde90c[_0xcdc347(0x184)](_0x1d6051=>_0x1d6051[_0xcdc347(0x188)]+'\x20('+_0x1d6051['dbId']+')')[_0xcdc347(0x17e)](',\x20');return{'db':null,'error':'\x22'+_0x4e2a72+_0xcdc347(0x182)+_0x4d1e33+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0xb837a9,_0x3e7045){const _0x3831c3=a204_0x5035,_0x5f40bd=await listDatabases(_0xb837a9);return _0x5f40bd[_0x3831c3(0x18f)](_0x2ebca3=>_0x2ebca3[_0x3831c3(0x177)]===_0x3e7045)?.['dbName'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a205_0x32faee=a205_0x5be6;(function(_0x5582f1,_0x11d949){const _0xd0d361=a205_0x5be6,_0xdb3fff=_0x5582f1();while(!![]){try{const _0x11e121=parseInt(_0xd0d361(0xb3))/0x1*(parseInt(_0xd0d361(0xb5))/0x2)+parseInt(_0xd0d361(0xb4))/0x3*(-parseInt(_0xd0d361(0xaa))/0x4)+-parseInt(_0xd0d361(0xb0))/0x5+-parseInt(_0xd0d361(0xb7))/0x6*(-parseInt(_0xd0d361(0xab))/0x7)+-parseInt(_0xd0d361(0xba))/0x8*(parseInt(_0xd0d361(0xb9))/0x9)+parseInt(_0xd0d361(0xb1))/0xa*(-parseInt(_0xd0d361(0xb8))/0xb)+parseInt(_0xd0d361(0xaf))/0xc;if(_0x11e121===_0x11d949)break;else _0xdb3fff['push'](_0xdb3fff['shift']());}catch(_0x5af5ab){_0xdb3fff['push'](_0xdb3fff['shift']());}}}(a205_0x4fd5,0x535d9));function a205_0x5be6(_0x397cc9,_0x4afc59){_0x397cc9=_0x397cc9-0xaa;const _0x4fd54b=a205_0x4fd5();let _0x5be6f7=_0x4fd54b[_0x397cc9];return _0x5be6f7;}import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x1322ac,_0x2f8c23=process[a205_0x32faee(0xad)]()){const _0xd8766b=a205_0x32faee,_0x71d6b0=resolve(_0x2f8c23),_0x48787e=join(_0x71d6b0,_0xd8766b(0xb2),'page');return{'projectRoot':_0x71d6b0,'pagesBaseDir':_0x48787e,'appPagesDir':join(_0x48787e,_0x1322ac),'lockFilePath':join(_0x71d6b0,_0xd8766b(0xb2),_0xd8766b(0xb6))};}function a205_0x4fd5(){const _0x5576c4=['57580LMTVpf','956844qvMYaI','.json','cwd','appPagesDir','13580184lRsnYZ','1894020MBrtdz','10VqvGGO','.rabetbase','1ONRfuT','21UKiKdi','1284084KcMXOb','page.lock.json','12SjefPY','6509668mlDbCq','68778bIDymm','664NkOkxd'];a205_0x4fd5=function(){return _0x5576c4;};return a205_0x4fd5();}export function buildPageFileName(_0x317e82,_0xd75b6f){const _0x32c0db=a205_0x32faee;return _0x317e82+'-'+String(_0xd75b6f)['toUpperCase']()+_0x32c0db(0xac);}export function resolvePageFilePath(_0x4add22,_0x185fa2,_0x511116){const _0xfb6d6e=a205_0x32faee;return join(_0x4add22[_0xfb6d6e(0xae)],buildPageFileName(_0x185fa2,_0x511116));}export async function ensureParentDirectory(_0x5defe5){await mkdir(dirname(_0x5defe5),{'recursive':!![]});}export async function fileExists(_0xed1fd6){try{return await access(_0xed1fd6,constants['F_OK']),!![];}catch{return![];}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x404f5f,_0x312ce1){const _0x28b800=a206_0x4ef7,_0x2ae28f=_0x404f5f();while(!![]){try{const _0x2bc7eb=-parseInt(_0x28b800(0x125))/0x1*(parseInt(_0x28b800(0x11c))/0x2)+-parseInt(_0x28b800(0x127))/0x3+-parseInt(_0x28b800(0x11d))/0x4*(-parseInt(_0x28b800(0x124))/0x5)+-parseInt(_0x28b800(0x126))/0x6*(parseInt(_0x28b800(0x12a))/0x7)+-parseInt(_0x28b800(0x129))/0x8+parseInt(_0x28b800(0x11f))/0x9+parseInt(_0x28b800(0x122))/0xa;if(_0x2bc7eb===_0x312ce1)break;else _0x2ae28f['push'](_0x2ae28f['shift']());}catch(_0x2b05e7){_0x2ae28f['push'](_0x2ae28f['shift']());}}}(a206_0x375b,0xe0887));function a206_0x375b(){const _0x41ae42=['md5','2sCVynr','983308VCFSVd','createHash','2761011TSGeJa','stringify','hex','37824850WSvMgr','digest','10ocKUVc','838139qJYMub','3090OkzdNG','2604735oogdnE','parse','10220976VqlROh','9205LCgiXR','update'];a206_0x375b=function(){return _0x41ae42;};return a206_0x375b();}import a206_0x116291 from'node:crypto';import{readFile}from'node:fs/promises';function a206_0x4ef7(_0x442ba7,_0x2c34ab){_0x442ba7=_0x442ba7-0x11b;const _0x375bfd=a206_0x375b();let _0x4ef79d=_0x375bfd[_0x442ba7];return _0x4ef79d;}export function serializePageSchemaForFile(_0x18225f){const _0x1035b1=a206_0x4ef7;return JSON[_0x1035b1(0x120)](JSON[_0x1035b1(0x128)](_0x18225f),null,0x2)+'\x0a';}export function computePageContentHash(_0x450979){const _0xd7e975=a206_0x4ef7;return a206_0x116291[_0xd7e975(0x11e)](_0xd7e975(0x11b))[_0xd7e975(0x12b)](_0x450979)[_0xd7e975(0x123)](_0xd7e975(0x121));}export function computeSerializedSchemaHash(_0x5b37ac){return computePageContentHash(serializePageSchemaForFile(_0x5b37ac));}export async function computePageFileHash(_0x245736){const _0x4fcb0a=await readFile(_0x245736,'utf8');return computePageContentHash(_0x4fcb0a);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x463400,_0x495f5d){const _0x9f51a7=a207_0x4742,_0x556ab9=_0x463400();while(!![]){try{const _0x521517=parseInt(_0x9f51a7(0xb6))/0x1+parseInt(_0x9f51a7(0xa9))/0x2*(parseInt(_0x9f51a7(0xad))/0x3)+parseInt(_0x9f51a7(0xaf))/0x4*(-parseInt(_0x9f51a7(0xb3))/0x5)+-parseInt(_0x9f51a7(0xa4))/0x6*(parseInt(_0x9f51a7(0xb5))/0x7)+parseInt(_0x9f51a7(0xa5))/0x8+parseInt(_0x9f51a7(0xab))/0x9+parseInt(_0x9f51a7(0xb1))/0xa*(-parseInt(_0x9f51a7(0xae))/0xb);if(_0x521517===_0x495f5d)break;else _0x556ab9['push'](_0x556ab9['shift']());}catch(_0x4e6ba6){_0x556ab9['push'](_0x556ab9['shift']());}}}(a207_0x3be7,0xe9d52));import{mkdir,readFile,writeFile}from'node:fs/promises';function a207_0x3be7(){const _0x3358c6=['Failed\x20to\x20read\x20page\x20lock\x20file:\x20','stringify','84smBRCy','9830264qJvgVO','parse','ENOENT','object','859314jjMffs','utf8','7455627eZtoqP','code','9hKtyFy','7371782fRMtbH','8OGgjsI','pages','40veaSsq','lastSync','720355icfrxc','apps','50638PgoOwU','681687iqBEPk'];a207_0x3be7=function(){return _0x3358c6;};return a207_0x3be7();}import{dirname}from'node:path';function a207_0x4742(_0x5eb313,_0x59251e){_0x5eb313=_0x5eb313-0xa2;const _0x3be7e3=a207_0x3be7();let _0x474279=_0x3be7e3[_0x5eb313];return _0x474279;}export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x15ff38,_0xc467b4){const _0x3a474d=a207_0x4742,_0x2352c5={'apps':_0x15ff38[_0x3a474d(0xb4)]&&typeof _0x15ff38[_0x3a474d(0xb4)]===_0x3a474d(0xa8)?_0x15ff38[_0x3a474d(0xb4)]:{}};let _0x3a8ae4=_0x2352c5[_0x3a474d(0xb4)][_0xc467b4];if(!_0x3a8ae4)return _0x3a8ae4={'lastSync':'','pages':{}},_0x2352c5[_0x3a474d(0xb4)][_0xc467b4]=_0x3a8ae4,{'lockData':_0x2352c5,'appLock':_0x3a8ae4};return!_0x3a8ae4['lastSync']&&(_0x3a8ae4[_0x3a474d(0xb2)]=''),(!_0x3a8ae4[_0x3a474d(0xb0)]||typeof _0x3a8ae4[_0x3a474d(0xb0)]!==_0x3a474d(0xa8))&&(_0x3a8ae4[_0x3a474d(0xb0)]={}),{'lockData':_0x2352c5,'appLock':_0x3a8ae4};}export async function readPageLockFile(_0x3abc99){const _0x221010=a207_0x4742;try{const _0xe72be8=await readFile(_0x3abc99,'utf8'),_0x4d55e2=JSON[_0x221010(0xa6)](_0xe72be8);return{'apps':_0x4d55e2[_0x221010(0xb4)]&&typeof _0x4d55e2[_0x221010(0xb4)]===_0x221010(0xa8)?_0x4d55e2[_0x221010(0xb4)]:{}};}catch(_0x466a2e){if(_0x466a2e[_0x221010(0xac)]===_0x221010(0xa7))return null;throw new Error(_0x221010(0xa2)+String(_0x466a2e));}}export async function writePageLockFile(_0x2e0a03,_0x110e56){const _0x40460d=a207_0x4742;await mkdir(dirname(_0x2e0a03),{'recursive':!![]}),await writeFile(_0x2e0a03,JSON[_0x40460d(0xa3)](_0x110e56,null,0x2),_0x40460d(0xaa));}
|