@lovrabet/rabetbase-cli 2.3.7-beta.1 → 2.3.7-beta.3
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/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 -0
- package/lib/commands/db/analyze-batch-plan.js +1 -0
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/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/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/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/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-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x15648d,_0x5d5691){const _0x49d416=a181_0x162b,_0x2c2c97=_0x15648d();while(!![]){try{const _0x2fcf60=parseInt(_0x49d416(0x1a0))/0x1+-parseInt(_0x49d416(0x1b7))/0x2+parseInt(_0x49d416(0x1c4))/0x3+-parseInt(_0x49d416(0x238))/0x4*(parseInt(_0x49d416(0x1d7))/0x5)+-parseInt(_0x49d416(0x1f9))/0x6*(parseInt(_0x49d416(0x1d2))/0x7)+parseInt(_0x49d416(0x270))/0x8*(-parseInt(_0x49d416(0x263))/0x9)+parseInt(_0x49d416(0x251))/0xa;if(_0x2fcf60===_0x5d5691)break;else _0x2c2c97['push'](_0x2c2c97['shift']());}catch(_0x743037){_0x2c2c97['push'](_0x2c2c97['shift']());}}}(a181_0x3261,0x56b00));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(_0x1d49a3){_activeCookie=_0x1d49a3||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(_0x544842,_0x3a03e0){const _0x33ca5d=a181_0x162b,_0x248581=_0x3a03e0 instanceof Error?_0x3a03e0[_0x33ca5d(0x1a4)]:String(_0x3a03e0);return CliErrors['apiError']('Request\x20failed:\x20'+_0x544842+(_0x248581?'\x20('+_0x248581+')':''),_0x33ca5d(0x1fc));}async function apiRequest(_0x7efdf0,_0x5c0b13={}){const _0x3bcdc3=a181_0x162b,{method:method=_0x3bcdc3(0x268),body:_0x34e85d,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x5c0b13,_0x408718=useRuntime?getRuntimeDomain():getApiDomain(),_0x44814c=_activeCookie||getCookie(),_0x3103f3=''+_0x408718+_0x7efdf0,_0x45ac14=new AbortController(),_0x546a8c=setTimeout(()=>_0x45ac14[_0x3bcdc3(0x214)](),timeout);try{const _0x10483b=await fetch(_0x3103f3,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x44814c,'X-Invoke-Source':_0x3bcdc3(0x24e),...headers},'body':_0x34e85d?JSON['stringify'](_0x34e85d):undefined,'signal':_0x45ac14['signal']});let _0x15ca1f;try{_0x15ca1f=await _0x10483b[_0x3bcdc3(0x219)]();}catch(_0x50900f){if(_0x50900f instanceof Error&&_0x50900f[_0x3bcdc3(0x202)]==='AbortError')throw CliErrors['apiError'](_0x3bcdc3(0x196)+_0x3103f3);if(_0x10483b['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x3bcdc3(0x20b)](_0x3bcdc3(0x249)+_0x10483b[_0x3bcdc3(0x24b)]+')',_0x10483b[_0x3bcdc3(0x24b)]>=0x190?_0x3bcdc3(0x248):undefined);}if(!_0x10483b['ok']||_0x15ca1f[_0x3bcdc3(0x1d9)]===![])throw CliErrors[_0x3bcdc3(0x20b)](_0x15ca1f['errorMsg']||_0x15ca1f[_0x3bcdc3(0x1a4)]||_0x3bcdc3(0x275)+_0x10483b[_0x3bcdc3(0x24b)],_0x15ca1f[_0x3bcdc3(0x1c0)]?_0x3bcdc3(0x1d8)+_0x15ca1f[_0x3bcdc3(0x1c0)]:undefined);return _0x15ca1f;}catch(_0x22248e){if(_0x22248e instanceof CliError)throw _0x22248e;if(_0x22248e instanceof Error&&_0x22248e[_0x3bcdc3(0x202)]===_0x3bcdc3(0x26e))throw CliErrors[_0x3bcdc3(0x20b)](_0x3bcdc3(0x196)+_0x3103f3);throw createFetchFailureError(_0x3103f3,_0x22248e);}finally{clearTimeout(_0x546a8c);}}async function apiFormRequest(_0x53ab95,_0xad9088,_0x53b8d7={}){const _0x68f4e4=a181_0x162b,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x53b8d7,_0x2ce5d5=_activeCookie||getCookie(),_0x24ca03=''+getApiDomain()+_0x53ab95,_0x250280=new AbortController(),_0x24ff16=setTimeout(()=>_0x250280[_0x68f4e4(0x214)](),timeout);try{const _0x457511=await fetch(_0x24ca03,{'method':'POST','headers':{'Cookie':_0x2ce5d5,'X-Invoke-Source':'cli:rabetbase'},'body':_0xad9088,'signal':_0x250280[_0x68f4e4(0x1f1)]});let _0x4ec888;try{_0x4ec888=await _0x457511['json']();}catch(_0x44b70d){if(_0x44b70d instanceof Error&&_0x44b70d[_0x68f4e4(0x202)]==='AbortError')throw CliErrors['apiError'](_0x68f4e4(0x196)+_0x24ca03);throw CliErrors[_0x68f4e4(0x20b)](_0x68f4e4(0x249)+_0x457511['status']+')',_0x457511[_0x68f4e4(0x24b)]>=0x190?_0x68f4e4(0x248):undefined);}if(!_0x457511['ok']||_0x4ec888[_0x68f4e4(0x1d9)]===![])throw CliErrors['apiError'](_0x4ec888[_0x68f4e4(0x241)]||_0x4ec888['message']||_0x68f4e4(0x275)+_0x457511['status'],_0x4ec888[_0x68f4e4(0x1c0)]?'API\x20error\x20code:\x20'+_0x4ec888['errorCode']:undefined);return _0x4ec888;}catch(_0x47219c){if(_0x47219c instanceof CliError)throw _0x47219c;if(_0x47219c instanceof Error&&_0x47219c[_0x68f4e4(0x202)]===_0x68f4e4(0x26e))throw CliErrors[_0x68f4e4(0x20b)](_0x68f4e4(0x196)+_0x24ca03);throw createFetchFailureError(_0x24ca03,_0x47219c);}finally{clearTimeout(_0x24ff16);}}export async function uploadDevelopmentFile(_0x1171b2,_0x5e7c61){const _0x5c9816=a181_0x162b,_0x4f256c=await readFile(_0x5e7c61),_0x56fcc5=new FormData();_0x56fcc5[_0x5c9816(0x1f5)](_0x5c9816(0x1bf),_0x1171b2),_0x56fcc5[_0x5c9816(0x1f5)]('file',new Blob([new Uint8Array(_0x4f256c)]),basename(_0x5e7c61));const _0x366070=await apiFormRequest(_0x5c9816(0x228),_0x56fcc5);return _0x366070[_0x5c9816(0x19a)];}export async function queryDevelopmentFileUrl(_0x57f474,_0xf0b18f={}){const _0x112cd4=a181_0x162b,_0x5eaf4c=await apiRequest('/smartapi/common/queryFileUrl',{'method':_0x112cd4(0x1ba),'body':{'filePath':_0x57f474,'downloadFlag':_0xf0b18f[_0x112cd4(0x1ee)]??![],..._0xf0b18f[_0x112cd4(0x1c3)]?{'longTerm':!![]}:{}}});return _0x5eaf4c[_0x112cd4(0x19a)];}function isAuthFailure(_0x5e3a37){const _0xa8dd12=a181_0x162b,_0x753a61=_0x5e3a37[_0xa8dd12(0x241)]||_0x5e3a37[_0xa8dd12(0x1a4)]||_0x5e3a37[_0xa8dd12(0x19a)]?.[_0xa8dd12(0x1a4)]||_0x5e3a37[_0xa8dd12(0x198)]||_0x5e3a37[_0xa8dd12(0x1b2)]||'';return _0x5e3a37[_0xa8dd12(0x1c0)]===_0xa8dd12(0x26d)||_0x5e3a37[_0xa8dd12(0x21a)]===0x191||_0x5e3a37[_0xa8dd12(0x21a)]===_0xa8dd12(0x23a)||_0x753a61[_0xa8dd12(0x24d)](_0xa8dd12(0x23a))||_0x753a61['includes'](_0xa8dd12(0x1ed))||_0x753a61[_0xa8dd12(0x24d)]('登录')||_0x753a61[_0xa8dd12(0x24d)]('认证');}export async function platformFetch(_0x31c3bc,_0x1430ef){const _0x2b0135=a181_0x162b;let _0x5e7fc7;try{_0x5e7fc7=await fetch(_0x31c3bc,{'method':_0x1430ef[_0x2b0135(0x1a8)]??_0x2b0135(0x268),'headers':{'Content-Type':'application/json','Cookie':_0x1430ef['cookie'],'X-Invoke-Source':'cli:rabetbase'},..._0x1430ef['body']&&{'body':JSON[_0x2b0135(0x246)](_0x1430ef[_0x2b0135(0x266)])}});}catch(_0x40beba){throw createFetchFailureError(_0x31c3bc,_0x40beba);}if(!_0x5e7fc7['ok']){if(_0x5e7fc7[_0x2b0135(0x24b)]===0x191)throw CliErrors[_0x2b0135(0x1b1)]();throw CliErrors[_0x2b0135(0x20b)](_0x1430ef['label']+_0x2b0135(0x276)+_0x5e7fc7[_0x2b0135(0x24b)]);}const _0x34ab24=await _0x5e7fc7[_0x2b0135(0x219)]();if(_0x34ab24['success']===![]){if(isAuthFailure(_0x34ab24))throw CliErrors[_0x2b0135(0x1b1)]();throw CliErrors[_0x2b0135(0x20b)](_0x34ab24[_0x2b0135(0x241)]||_0x34ab24['message']||_0x1430ef[_0x2b0135(0x258)]+_0x2b0135(0x1c5));}return _0x34ab24[_0x2b0135(0x19a)];}export async function platformRequest(_0x4abf6f,_0x52fad1){const _0x5055b3=a181_0x162b;if(/^https?:\/\//i['test'](_0x4abf6f))throw CliErrors['validation'](_0x5055b3(0x213)+_0x4abf6f,_0x5055b3(0x1e2));const _0x56e838=_0x4abf6f['startsWith']('/')?_0x4abf6f:'/'+_0x4abf6f;return platformFetch(''+getApiDomain()+_0x56e838,_0x52fad1);}function cleanNewlines(_0x4e69eb){const _0x4399e6=a181_0x162b;return _0x4e69eb[_0x4399e6(0x233)](/[\r\n]+/g,'\x20')[_0x4399e6(0x1ce)]();}function cleanDatasetName(_0x1f53f5){const _0x5e252f=a181_0x162b;if(!_0x1f53f5[_0x5e252f(0x202)])return _0x1f53f5;return{..._0x1f53f5,'name':cleanNewlines(_0x1f53f5[_0x5e252f(0x202)])};}export async function fetchModelList(_0x44a9ef,_0x2d594a){const _0x1255ae=a181_0x162b,_0x1021d5=getEnv(),_0x278286=new URLSearchParams({'appcode':_0x44a9ef,'otype':_0x1255ae(0x224)}),_0x5955ac='/api/node-toolbox/dataset/model-list?'+_0x278286[_0x1255ae(0x260)]();logger[_0x1255ae(0x209)](_0x1255ae(0x20e),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x1021d5+')',{'apiPath':_0x5955ac});const _0x50ffbb=await platformRequest(_0x5955ac,{'cookie':_0x2d594a,'label':_0x1255ae(0x22b)}),_0x3107f7=(_0x50ffbb['configArray']??[])['map'](cleanDatasetName);return{'configArray':_0x3107f7,'count':_0x3107f7[_0x1255ae(0x1a3)]};}export async function fetchDatasetDoc(_0x2c5f9a){const _0xd475ba=a181_0x162b,{appCode:_0x4b8b63,cookie:_0x5698fd,datasetCode:_0x909dfe,datasetId:_0x5002c5,extraParams:_0x509894}=_0x2c5f9a,_0x305901=await platformRequest('/api/node-toolbox/api-doc-generator',{'method':'POST','body':{'appCode':_0x4b8b63,'datasetCode':_0x909dfe,'datasetId':_0x5002c5,..._0x509894||{}},'cookie':_0x5698fd,'label':'Fetch\x20doc\x20('+_0x909dfe+')'});if(!_0x305901||typeof _0x305901[_0xd475ba(0x1ab)]!==_0xd475ba(0x1c7))throw new Error(_0xd475ba(0x25b)+_0x909dfe+_0xd475ba(0x20c));return _0x305901['markdown'];}export async function getMenuTree(_0x365794,_0x36a799){const _0x4d8ef1=a181_0x162b,_0x3e3cf7=new URLSearchParams({'appCode':_0x365794});return platformRequest('/smartapi/menu/find?'+_0x3e3cf7[_0x4d8ef1(0x260)](),{'cookie':_0x36a799,'label':_0x4d8ef1(0x1e0)});}export async function createMenuRecord(_0x70d4a0,_0x21ccda,_0x5d498e){const _0x2b3526=a181_0x162b;return platformRequest(_0x2b3526(0x274),{'method':_0x2b3526(0x1ba),'body':_0x70d4a0,'cookie':_0x21ccda,'label':_0x5d498e});}export async function updateMenuRecord(_0x115459,_0x72bf83,_0x17e1bc){const _0x7bb629=a181_0x162b;return platformRequest(_0x7bb629(0x255),{'method':_0x7bb629(0x1ba),'body':_0x115459,'cookie':_0x72bf83,'label':_0x17e1bc});}export async function listBffScripts(_0x5cce42,_0xfdaace,_0x164fa8){const _0x9e5a49=a181_0x162b;let _0x1a3f6a=_0x9e5a49(0x1d5)+_0x5cce42;if(_0xfdaace)_0x1a3f6a+=_0x9e5a49(0x216)+_0xfdaace;const _0x208a8e=await apiRequest(_0x1a3f6a);let _0xc06670=extractList(_0x208a8e[_0x9e5a49(0x19a)]);if(_0x164fa8?.[_0x9e5a49(0x25e)]){const _0xfd5e3f=_0x164fa8[_0x9e5a49(0x25e)][_0x9e5a49(0x21b)]();_0xc06670=_0xc06670[_0x9e5a49(0x243)](_0x1fe907=>_0x1fe907[_0x9e5a49(0x1d3)]?.[_0x9e5a49(0x21b)]()[_0x9e5a49(0x24d)](_0xfd5e3f)||_0x1fe907[_0x9e5a49(0x261)]?.['toLowerCase']()[_0x9e5a49(0x24d)](_0xfd5e3f));}return _0xc06670;}export async function getBffScriptInfo(_0x1edbce){const _0x5ef58c=a181_0x162b,_0x9ac5a=await apiRequest('/api/management/library/scripts/info?id='+_0x1edbce);if(!_0x9ac5a[_0x5ef58c(0x19a)])throw CliErrors[_0x5ef58c(0x215)](_0x5ef58c(0x1a7)+_0x1edbce);return _0x9ac5a[_0x5ef58c(0x19a)];}export async function saveBffScript(_0x478260){const _0x2dde1d=a181_0x162b,_0xfe084e=await apiRequest(_0x2dde1d(0x1df),{'method':_0x2dde1d(0x1ba),'body':_0x478260}),{id:_0x18f557,entity:_0x441b47}=normalizeEntityWithIdResponse(_0xfe084e[_0x2dde1d(0x19a)]);if(_0x18f557!==undefined){const _0x53ea86=typeof _0x441b47['functionName']===_0x2dde1d(0x1c7)||typeof _0x441b47[_0x2dde1d(0x1cd)]==='string'?_0x441b47:undefined;return{'id':_0x18f557,'script':_0x53ea86};}throw CliErrors[_0x2dde1d(0x20b)](_0x2dde1d(0x1d6));}export async function deleteBffScript(_0x21510f){const _0x3f9741=a181_0x162b;await apiRequest(_0x3f9741(0x1a6),{'method':_0x3f9741(0x1ba),'body':{'id':_0x21510f}});}export async function getBffScriptStatistics(_0x7d95ad){const _0xfac06d=a181_0x162b,_0x47b12f=await apiRequest(_0xfac06d(0x1b4)+_0x7d95ad);return extractList(_0x47b12f['data']);}export async function clearBffScriptCache(){const _0x471ef7=a181_0x162b,_0x5b01ab=await apiRequest(_0x471ef7(0x1b5),{'method':_0x471ef7(0x1ba),'useRuntime':!![]});return typeof _0x5b01ab[_0x471ef7(0x19a)]===_0x471ef7(0x1c7)?_0x5b01ab[_0x471ef7(0x19a)]:'';}export async function listBffDatasetOperations(_0x41126a,_0x41f813){const _0x5a0097=a181_0x162b,_0x58a6b8=await apiRequest(_0x5a0097(0x1f4),{'method':_0x5a0097(0x1ba),'body':{'appCode':_0x41126a,'datasetId':_0x41f813}});return _0x58a6b8['data'];}export async function listSqlQueries(_0x271315,_0x1e41fd){const _0x6fd6ed=a181_0x162b,_0x350ff0=await apiRequest(_0x6fd6ed(0x26c),{'method':_0x6fd6ed(0x1ba),'body':{'appCode':_0x271315,'currentPage':_0x1e41fd?.[_0x6fd6ed(0x207)]??0x1,'pageSize':_0x1e41fd?.['pageSize']??0x32,'sqlCode':_0x1e41fd?.[_0x6fd6ed(0x211)],'sqlName':_0x1e41fd?.['sqlName']}});return _0x350ff0[_0x6fd6ed(0x19a)];}export async function getSqlQueryInfo(_0x1d9ccf,_0x16b425){const _0x33a488=a181_0x162b,_0x5471b4=await listSqlQueries(_0x1d9ccf,{'sqlCode':_0x16b425}),_0x2c0259=_0x5471b4['tableData']?.[0x0];if(!_0x2c0259)throw CliErrors[_0x33a488(0x215)]('SQL\x20query\x20not\x20found:\x20'+_0x16b425);return _0x2c0259;}export async function getSqlQueryDetail(_0x224ab1){const _0x21d666=a181_0x162b,_0x5b29a8=await apiRequest('/smartapi/custom/getUserCustomSql'+(_0x21d666(0x24f)+encodeURIComponent(_0x224ab1)));if(!_0x5b29a8[_0x21d666(0x19a)])throw CliErrors[_0x21d666(0x215)](_0x21d666(0x1db)+_0x224ab1);return _0x5b29a8[_0x21d666(0x19a)];}export async function getSqlQueryDetailById(_0x2f3673){const _0x3d6315=a181_0x162b,_0x422ecc=await apiRequest(_0x3d6315(0x1ff)+_0x2f3673);if(!_0x422ecc[_0x3d6315(0x19a)])throw CliErrors[_0x3d6315(0x215)](_0x3d6315(0x1e3)+_0x2f3673);return _0x422ecc['data'];}export async function createSqlQuery(_0x35bb47){const _0x5e8fd4=a181_0x162b,_0x59f19b=await apiRequest(_0x5e8fd4(0x1d1),{'method':'POST','body':_0x35bb47}),{id:_0x23ef36,entity:_0x4d6c24}=normalizeEntityWithIdResponse(_0x59f19b[_0x5e8fd4(0x19a)]);if(!(_0x5e8fd4(0x211)in _0x4d6c24)&&_0x23ef36)return getSqlQueryDetailById(_0x23ef36);return normalizeSqlQueryEntity(_0x4d6c24);}export async function updateSqlQuery(_0x14c428){const _0x48a794=a181_0x162b,_0x188fb9=await apiRequest('/smartapi/custom/updateUserCustomSql',{'method':'POST','body':_0x14c428}),{id:_0x488ec5,entity:_0xf6d5b6}=normalizeEntityWithIdResponse(_0x188fb9[_0x48a794(0x19a)]);if(!(_0x48a794(0x211)in _0xf6d5b6)){if(_0x14c428[_0x48a794(0x211)])return getSqlQueryDetail(_0x14c428[_0x48a794(0x211)]);if(_0x488ec5)return getSqlQueryDetailById(_0x488ec5);}return normalizeSqlQueryEntity(_0xf6d5b6);}export async function deleteSqlQuery(_0x176bd7){await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':'POST','body':_0x176bd7});}export async function saveSqlQuery(_0x902c5){const _0x528d6a=a181_0x162b,_0x3adb84=await apiRequest(_0x528d6a(0x22f),{'method':_0x528d6a(0x1ba),'body':_0x902c5});return _0x3adb84['data'];}function normalizeSqlQueryEntity(_0x2d80d9){const _0x5ac2f0=a181_0x162b;return{..._0x2d80d9,'id':Number(_0x2d80d9['id']),'dbId':_0x2d80d9[_0x5ac2f0(0x1a5)]==null?undefined:Number(_0x2d80d9[_0x5ac2f0(0x1a5)]),'version':_0x2d80d9[_0x5ac2f0(0x1bd)]==null?undefined:Number(_0x2d80d9[_0x5ac2f0(0x1bd)])};}export async function executeSql(_0x5a8f43,_0x1c9fdc,_0x43dcd0){const _0x12f135=a181_0x162b,_0x261e2a=await apiRequest('/api/custom/executeSql',{'method':_0x12f135(0x1ba),'body':{'appCode':_0x5a8f43,'sqlCode':_0x1c9fdc,..._0x43dcd0&&{'params':_0x43dcd0}},'useRuntime':!![]});return _0x261e2a[_0x12f135(0x19a)];}export async function executeDatasetDataOperation(_0x350908,_0x546e7c,_0x575d8e,_0x12e8e0={}){const _0x3e120d=a181_0x162b;try{const _0x2599fe=await apiRequest('/api/'+_0x350908+'/'+_0x546e7c+'/'+_0x575d8e,{'method':_0x3e120d(0x1ba),'body':_0x12e8e0,'useRuntime':!![]});return _0x2599fe[_0x3e120d(0x19a)];}catch(_0x3e0125){if(_0x575d8e==='getOne'&&_0x3e0125 instanceof CliError&&_0x3e0125[_0x3e120d(0x21a)]===_0x3e120d(0x204)&&_0x12e8e0['id']!==undefined&&_0x12e8e0['id']!==null&&_0x12e8e0['id']!==''){const _0x202d1c=await apiRequest(_0x3e120d(0x269)+_0x350908+'/'+_0x546e7c+_0x3e120d(0x1c6),{'method':_0x3e120d(0x1ba),'body':{'where':{'id':{'$eq':_0x12e8e0['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x49192c=Array['isArray'](_0x202d1c[_0x3e120d(0x19a)]?.['tableData'])?_0x202d1c['data'][_0x3e120d(0x1a9)]:[];return _0x49192c[0x0]??null;}throw _0x3e0125;}}export async function listDatasets(_0x1b5f8b,_0x1658ef){const _0x1fe529=a181_0x162b,_0x2bf08f={'appCode':_0x1b5f8b,'deleted':_0x1658ef?.[_0x1fe529(0x218)]??![]};if(_0x1658ef?.[_0x1fe529(0x21a)])_0x2bf08f[_0x1fe529(0x21a)]=_0x1658ef['code'];if(_0x1658ef?.['name'])_0x2bf08f[_0x1fe529(0x202)]=_0x1658ef[_0x1fe529(0x202)];const _0x36fb10=await apiRequest(_0x1fe529(0x1bc),{'method':'POST','body':_0x2bf08f});return extractList(_0x36fb10[_0x1fe529(0x19a)]);}export async function deleteDataset(_0xb73b41,_0x3886cc){const _0x4d3cb6=a181_0x162b;await apiRequest(_0x4d3cb6(0x1c1),{'method':_0x4d3cb6(0x1ba),'body':{'appCode':_0xb73b41,'datasetId':_0x3886cc}});}export async function restoreDataset(_0x18ede6,_0x23cde4){const _0x5c4bdf=a181_0x162b;await apiRequest(_0x5c4bdf(0x245),{'method':_0x5c4bdf(0x1ba),'body':{'appCode':_0x18ede6,'datasetId':_0x23cde4}});}export async function previewTextGeneratedDataset(_0x275a6d,_0x533269){const _0x432a39=a181_0x162b,_0xfbc6f7=await apiRequest(_0x432a39(0x1af),{'method':_0x432a39(0x1ba),'body':{'appCode':_0x275a6d,'datasetName':_0x533269['datasetName'],'requirementDescription':_0x533269['requirementDescription']},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0xfbc6f7['data'];}export async function startTextGeneratedDataset(_0x1293e2,_0x5a63e1,_0x3dcef9){const _0x43dae5=a181_0x162b,_0x51df83=await apiRequest(_0x43dae5(0x1fd),{'method':_0x43dae5(0x1ba),'body':{'appCode':_0x1293e2,..._0x3dcef9?.[_0x43dae5(0x236)]?{'clientOperationId':_0x3dcef9['clientOperationId']}:{},'design':_0x5a63e1},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x51df83['data'];}export async function getTextGeneratedDatasetStatus(_0x54a7cf,_0x1647fd){const _0x9c06b1=a181_0x162b,_0x37d63d=new URLSearchParams({'appCode':_0x54a7cf});_0x1647fd['operationId']&&_0x37d63d['set'](_0x9c06b1(0x1bb),_0x1647fd['operationId']);_0x1647fd[_0x9c06b1(0x236)]&&_0x37d63d[_0x9c06b1(0x225)]('clientOperationId',_0x1647fd[_0x9c06b1(0x236)]);const _0x545e37=await apiRequest(_0x9c06b1(0x247)+_0x37d63d[_0x9c06b1(0x260)]());return _0x545e37[_0x9c06b1(0x19a)];}export async function searchDatasets(_0x30c2b3,_0x5ca88c){const _0x1ffa34=a181_0x162b,_0x3a798c=await listDatasets(_0x30c2b3,{'name':_0x5ca88c}),_0x292fb8=_0x5ca88c[_0x1ffa34(0x21b)](),_0x295bc8=new Set(_0x3a798c[_0x1ffa34(0x264)](_0x2c8d54=>_0x2c8d54['id'])),_0xda47e7=_0x3a798c[_0x1ffa34(0x243)](_0x143e0d=>_0x143e0d[_0x1ffa34(0x26a)]?.[_0x1ffa34(0x234)]?.['toLowerCase']()[_0x1ffa34(0x24d)](_0x292fb8)||_0x143e0d['description']?.[_0x1ffa34(0x21b)]()[_0x1ffa34(0x24d)](_0x292fb8)),_0x58a505=await listDatasets(_0x30c2b3,{'code':_0x5ca88c});for(const _0x2d7b02 of _0x58a505){!_0x295bc8[_0x1ffa34(0x252)](_0x2d7b02['id'])&&(_0x3a798c[_0x1ffa34(0x1d4)](_0x2d7b02),_0x295bc8['add'](_0x2d7b02['id']));}return _0x3a798c;}export function normalizeDatasetOperations(_0x28b2fb){const _0x110616=a181_0x162b;if(Array[_0x110616(0x1b0)](_0x28b2fb))return _0x28b2fb[_0x110616(0x243)](_0x1b1b8a=>_0x1b1b8a!=null&&typeof _0x1b1b8a===_0x110616(0x237));if(_0x28b2fb&&typeof _0x28b2fb===_0x110616(0x237))return Object[_0x110616(0x1ae)](_0x28b2fb)[_0x110616(0x243)](([,_0x29f7af])=>_0x29f7af!=null&&typeof _0x29f7af==='object')['map'](([_0x49e990,_0xb67a4c])=>({..._0xb67a4c,'name':_0xb67a4c[_0x110616(0x202)]??_0xb67a4c[_0x110616(0x1a1)]??_0x49e990}));return[];}export async function getDatasetDetail(_0xda25a0){const _0x4d2a85=a181_0x162b,_0x3502f9=/^\d+$/[_0x4d2a85(0x1be)](_0xda25a0)?'id':_0x4d2a85(0x21a),_0x51f149=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x3502f9+'='+_0xda25a0);return _0x51f149[_0x4d2a85(0x19a)];}export async function updateDrivenData(_0x4da45d){const _0x4b5d62=a181_0x162b,_0x199adf=await apiRequest(_0x4b5d62(0x1ec),{'method':_0x4b5d62(0x1ba),'body':_0x4da45d});return _0x199adf[_0x4b5d62(0x19a)];}export async function getDatasetOperations(_0x13aa83){const _0x2917de=a181_0x162b,_0x433893=await getDatasetDetail(_0x13aa83),_0x3cd53f=normalizeDatasetOperations(_0x433893[_0x2917de(0x271)])['map'](_0xd78e31=>({'name':_0xd78e31[_0x2917de(0x202)]||_0xd78e31['operationName'],'displayName':_0xd78e31[_0x2917de(0x220)]||_0xd78e31[_0x2917de(0x202)],'type':_0xd78e31[_0x2917de(0x26b)],'method':_0xd78e31[_0x2917de(0x1a8)],'path':_0xd78e31[_0x2917de(0x24a)],'enabled':_0xd78e31['enabled']??!![],'requestFields':_0xd78e31['requestFields'],'responseFields':_0xd78e31[_0x2917de(0x1ef)]}));return{'dataset':{'id':_0x433893['id']??_0x433893[_0x2917de(0x1e4)],'name':_0x433893['name'],'code':_0x433893[_0x2917de(0x21a)]||_0x433893['modelCode'],'tableName':_0x433893[_0x2917de(0x234)]||_0x433893[_0x2917de(0x26a)]?.[_0x2917de(0x234)]},'operations':_0x3cd53f};}export async function getOperationDetail(_0x20ba40,_0x3b6305,_0x53e8a5){const _0x2c30b7=a181_0x162b;let _0x59f94b=_0x3b6305;if(!/^\d+$/[_0x2c30b7(0x1be)](_0x3b6305)){const _0x34fb0e=await listDatasets(_0x20ba40,{'code':_0x3b6305}),_0x1540ed=_0x34fb0e['find'](_0x4d2e7f=>_0x4d2e7f['code']===_0x3b6305||String(_0x4d2e7f['id'])===_0x3b6305);if(!_0x1540ed)throw CliErrors['validation'](_0x2c30b7(0x25a)+_0x3b6305);_0x59f94b=String(_0x1540ed['id']);}const _0x1b7c26=await getDatasetDetail(_0x59f94b),_0x40ac4f=normalizeDatasetOperations(_0x1b7c26[_0x2c30b7(0x271)])[_0x2c30b7(0x20a)](_0x527529=>(_0x527529[_0x2c30b7(0x202)]||_0x527529[_0x2c30b7(0x1a1)])===_0x53e8a5);if(!_0x40ac4f)throw CliErrors[_0x2c30b7(0x215)](_0x2c30b7(0x23e)+_0x53e8a5+_0x2c30b7(0x197)+_0x3b6305);return{'dataset':{'id':_0x1b7c26['id']??_0x1b7c26['modelId'],'name':_0x1b7c26['name'],'code':_0x1b7c26['code']||_0x1b7c26[_0x2c30b7(0x22a)],'tableName':_0x1b7c26[_0x2c30b7(0x234)]||_0x1b7c26[_0x2c30b7(0x26a)]?.[_0x2c30b7(0x234)]},'operation':_0x40ac4f};}export async function startGenerateStandardPages(_0x197b18,_0x46bbd9,_0x47d0ee){const _0x5aef42=a181_0x162b,_0x308775=await apiRequest(_0x5aef42(0x272)+_0x46bbd9+_0x5aef42(0x1f6),{'method':_0x5aef42(0x1ba),'body':{'appCode':_0x197b18,..._0x47d0ee?.['clientOperationId']?{'clientOperationId':_0x47d0ee['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x308775[_0x5aef42(0x19a)];}export async function getGenerateStandardPagesStatus(_0x192d3a,_0x5d4bf7,_0xf623a5){const _0x3d483a=a181_0x162b,_0x5f2166=new URLSearchParams({'appCode':_0x192d3a});_0xf623a5['operationId']&&_0x5f2166[_0x3d483a(0x225)](_0x3d483a(0x1bb),_0xf623a5['operationId']);_0xf623a5[_0x3d483a(0x236)]&&_0x5f2166['set'](_0x3d483a(0x236),_0xf623a5['clientOperationId']);const _0x3a6d87=await apiRequest('/smartapi/lovrabet/dataset/'+_0x5d4bf7+_0x3d483a(0x1a2)+_0x5f2166['toString']());return _0x3a6d87[_0x3d483a(0x19a)];}export async function getStandardPageStatus(_0x5932e0,_0x402fe0){const _0x3686d1=a181_0x162b,_0x4c6a0e=await apiRequest(_0x3686d1(0x272)+_0x402fe0+_0x3686d1(0x1cf)+encodeURIComponent(_0x5932e0));return _0x4c6a0e[_0x3686d1(0x19a)];}export async function tryGetStandardPageStatus(_0x5d9610,_0x5e8bff){const _0x580fdc=a181_0x162b;try{return await getStandardPageStatus(_0x5d9610,_0x5e8bff);}catch(_0x2c1fbd){if(_0x2c1fbd instanceof CliError&&_0x2c1fbd[_0x580fdc(0x21a)]===_0x580fdc(0x204)&&/404|not found|non-json response/i[_0x580fdc(0x1be)](_0x2c1fbd[_0x580fdc(0x1a4)]))return null;throw _0x2c1fbd;}}export async function syncStandardPages(_0x1492d7,_0x510bd2){const _0x2b4012=a181_0x162b,_0x465851=await apiRequest('/smartapi/lovrabet/dataset/'+_0x510bd2+'/sync-to-pages',{'method':'POST','body':{'appCode':_0x1492d7}});return _0x465851[_0x2b4012(0x19a)];}export async function getPageDetail(_0x56baf2){const _0x4b2053=a181_0x162b,_0x369613=await apiRequest(_0x4b2053(0x1eb)+_0x56baf2);if(!_0x369613['data'])throw CliErrors['validation'](_0x4b2053(0x21f)+_0x56baf2);return _0x369613[_0x4b2053(0x19a)];}export async function updatePage(_0x17ff75,_0x13cbf6,_0x3e88d4,_0x14c191){const _0x4abaca=a181_0x162b,_0x4e5288=await apiRequest(_0x4abaca(0x250),{'method':_0x4abaca(0x1ba),'body':{'appCode':_0x17ff75,'pageId':_0x13cbf6,'code':_0x3e88d4,'datasetIds':_0x14c191}});return _0x4e5288[_0x4abaca(0x19a)];}function a181_0x162b(_0x2a2512,_0x35c8a5){_0x2a2512=_0x2a2512-0x193;const _0x32618e=a181_0x3261();let _0x162bda=_0x32618e[_0x2a2512];return _0x162bda;}export function generateSdkCode(_0x38ec65,_0x100568,_0x391298){const _0x431c62=a181_0x162b,_0x1eba4f=_0x391298?.[_0x431c62(0x23d)]??!![],_0x37af23='dataset_'+_0x38ec65[_0x431c62(0x21a)]?.[_0x431c62(0x233)](/-/g,'_'),_0x1a0b8d=_0x100568['name']||_0x100568[_0x431c62(0x1a1)]||_0x431c62(0x243),_0x419003=[];_0x1eba4f&&_0x419003[_0x431c62(0x1d4)](_0x431c62(0x259),'',_0x431c62(0x24c),'');_0x419003[_0x431c62(0x1d4)](_0x431c62(0x1c8)+_0x38ec65[_0x431c62(0x202)]+'\x20('+(_0x38ec65[_0x431c62(0x234)]||'table')+')');if(_0x1a0b8d===_0x431c62(0x243))_0x419003['push'](_0x431c62(0x26f)+_0x37af23+_0x431c62(0x1de),_0x431c62(0x267),'\x20\x20pageSize:\x2020,',_0x431c62(0x1ac),'});');else{if(_0x1a0b8d===_0x431c62(0x230))_0x419003['push'](_0x431c62(0x26f)+_0x37af23+'.getOne(id);');else{if(_0x1a0b8d===_0x431c62(0x273))_0x419003[_0x431c62(0x1d4)](_0x431c62(0x26f)+_0x37af23+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x1a0b8d===_0x431c62(0x19c))_0x419003[_0x431c62(0x1d4)]('const\x20result\x20=\x20await\x20client.models.'+_0x37af23+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x1a0b8d===_0x431c62(0x195)||_0x1a0b8d===_0x431c62(0x244)?_0x419003[_0x431c62(0x1d4)](_0x431c62(0x26f)+_0x37af23+'.remove(id);'):_0x419003[_0x431c62(0x1d4)]('const\x20result\x20=\x20await\x20client.models.'+_0x37af23+'.'+_0x1a0b8d+_0x431c62(0x239));}}}return _0x419003['join']('\x0a');}export function generateSqlCodeTemplate(_0x2991fb,_0x14a6d5){const _0xb66ee=a181_0x162b,_0xf82367=_0x14a6d5?.[_0xb66ee(0x1e6)]??'sdk',_0x23670e=_0x14a6d5?.['includeImports']??!![],_0x1cb2fe=[];return _0x1cb2fe['push'](_0xb66ee(0x235)+_0x2991fb[_0xb66ee(0x199)]+'\x20('+_0x2991fb[_0xb66ee(0x211)]+')'),_0xf82367===_0xb66ee(0x1dc)?(_0x23670e&&_0x1cb2fe[_0xb66ee(0x1d4)](_0xb66ee(0x259),'',_0xb66ee(0x24c),''),_0x1cb2fe[_0xb66ee(0x1d4)]('const\x20data\x20=\x20await\x20client.sql.execute({','\x20\x20sqlCode:\x20\x27'+_0x2991fb[_0xb66ee(0x211)]+'\x27,',_0xb66ee(0x226),_0xb66ee(0x1f2),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0xb66ee(0x1e7))):_0x1cb2fe[_0xb66ee(0x1d4)](_0xb66ee(0x242),_0xb66ee(0x194),_0xb66ee(0x1b3),_0xb66ee(0x21c)+_0x2991fb[_0xb66ee(0x211)]+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0xb66ee(0x203),_0xb66ee(0x200),'}'),_0x1cb2fe[_0xb66ee(0x25f)]('\x0a');}export async function getErConfig(_0x552b9a,_0x2e0a13){const _0x1964eb=a181_0x162b,_0x298ebd=await apiRequest(_0x1964eb(0x1ea),{'method':_0x1964eb(0x1ba),'body':{'appCode':_0x552b9a,'dblinkId':_0x2e0a13},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x298ebd[_0x1964eb(0x19a)];}export async function getErRelationDetail(_0x2bf378,_0x1ff534){const _0x50feef=a181_0x162b,_0x364020=new URLSearchParams({'appCode':_0x2bf378,'relationId':String(_0x1ff534)});try{const _0x513022=await apiRequest(_0x50feef(0x221)+_0x364020[_0x50feef(0x260)]());return _0x513022[_0x50feef(0x19a)]?.[_0x50feef(0x253)]??null;}catch(_0xc3783f){if(_0xc3783f instanceof CliError&&_0xc3783f[_0x50feef(0x21a)]===_0x50feef(0x204)&&(_0xc3783f[_0x50feef(0x229)]?.[_0x50feef(0x24d)](_0x50feef(0x1dd))||_0xc3783f[_0x50feef(0x229)]===_0x50feef(0x1fa)&&_0xc3783f[_0x50feef(0x1a4)]===_0x50feef(0x25d)))return null;throw _0xc3783f;}}export async function createErRelation(_0x3a3b56){const _0x455d44=a181_0x162b,_0x2a8288=await apiRequest(_0x455d44(0x206),{'method':_0x455d44(0x1ba),'body':_0x3a3b56,'allowNonJsonSuccess':!![]});return _0x2a8288['data'];}export async function updateErRelation(_0x4a6640){const _0x4475e7=a181_0x162b,_0x5b6ec4=await apiRequest(_0x4475e7(0x201),{'method':'POST','body':_0x4a6640,'allowNonJsonSuccess':!![]});return _0x5b6ec4[_0x4475e7(0x19a)];}export async function deleteErRelation(_0xf041f2){const _0x3a8d1d=a181_0x162b,_0x3025bb=await apiRequest(_0x3a8d1d(0x1fb),{'method':'POST','body':_0xf041f2,'allowNonJsonSuccess':!![]});return _0x3025bb[_0x3a8d1d(0x19a)];}export async function updateErBusinessGroup(_0x493f4d){const _0x4cceb0=a181_0x162b,_0x558d6a=await apiRequest(_0x4cceb0(0x256),{'method':_0x4cceb0(0x1ba),'body':_0x493f4d,'allowNonJsonSuccess':!![]});return _0x558d6a[_0x4cceb0(0x19a)];}function buildQuery(_0x1c69e7){const _0xc6fca5=a181_0x162b,_0x56a5cf=new URLSearchParams();for(const [_0x5a618e,_0xf65f66]of Object[_0xc6fca5(0x1ae)](_0x1c69e7)){if(_0xf65f66===undefined||_0xf65f66==='')continue;_0x56a5cf[_0xc6fca5(0x225)](_0x5a618e,String(_0xf65f66));}const _0x565c6d=_0x56a5cf['toString']();return _0x565c6d?'?'+_0x565c6d:'';}export async function listAppConfigs(_0x567760,_0xa1249e){const _0x238796=a181_0x162b,_0x20674d=await apiRequest('/smartapi/app-config/list',{'method':'POST','body':{'appCode':_0x567760,..._0xa1249e?.[_0x238796(0x1e9)]?{'key':_0xa1249e[_0x238796(0x1e9)]}:{},..._0xa1249e?.[_0x238796(0x205)]?{'tags':_0xa1249e[_0x238796(0x205)]}:{}}});return extractAppConfigList(_0x20674d[_0x238796(0x19a)]);}export async function getAppConfigByKey(_0x52ba64,_0xac2550){const _0x48802c=a181_0x162b,_0x328c56=await apiRequest(_0x48802c(0x1cc)+buildQuery({'appCode':_0x52ba64,'key':_0xac2550}));return _0x328c56[_0x48802c(0x19a)]??null;}export async function createAppConfig(_0x4650c0){const _0x25d094=a181_0x162b,_0x4ba09c=await apiRequest(_0x25d094(0x210),{'method':_0x25d094(0x1ba),'body':{'appCode':_0x4650c0[_0x25d094(0x1bf)],'key':_0x4650c0[_0x25d094(0x1e9)],'value':_0x4650c0[_0x25d094(0x232)],..._0x4650c0[_0x25d094(0x205)]?{'tags':_0x4650c0[_0x25d094(0x205)]}:{}}});return _0x4ba09c['data'];}export async function updateAppConfig(_0xda9b33){const _0x1ef289=a181_0x162b;await apiRequest(_0x1ef289(0x217),{'method':_0x1ef289(0x1ba),'body':{'id':_0xda9b33['id'],'appCode':_0xda9b33[_0x1ef289(0x1bf)],'key':_0xda9b33[_0x1ef289(0x1e9)],'value':_0xda9b33[_0x1ef289(0x232)],..._0xda9b33[_0x1ef289(0x205)]?{'tags':_0xda9b33[_0x1ef289(0x205)]}:{}}});}export async function deleteAppConfig(_0x42559e){const _0x66d3e8=a181_0x162b;await apiRequest(_0x66d3e8(0x1da),{'method':'POST','body':_0x42559e});}function extractAppConfigList(_0x872291){const _0x32e6e7=a181_0x162b;if(Array[_0x32e6e7(0x1b0)](_0x872291))return _0x872291;if(_0x872291&&typeof _0x872291===_0x32e6e7(0x237)&&Array[_0x32e6e7(0x1b0)](_0x872291[_0x32e6e7(0x21e)]))return _0x872291['list'];return extractList(_0x872291);}function a181_0x3261(){const _0x25980f=['/smartapi/dataset/delete-dataset','min','longTerm','147183oXhixe','\x20failed','/filter','string','//\x20','userTenantRelationList','/smartapi/dblink/delete','username','/smartapi/app-config/getByKey','scriptType','trim','/standard-page-status?appCode=','/smartapi/dblink/testConnect','/smartapi/custom/saveUserCustomSql','4843986mYRpql','functionName','push','/api/management/library/scripts/list?appCode=','BFF\x20save\x20returned\x20no\x20valid\x20id','292015GopIUY','API\x20error\x20code:\x20','success','/smartapi/app-config/delete','SQL\x20query\x20not\x20found:\x20','sdk','DATA_NOT_EXIST','.filter({','/api/management/library/scripts/save','Fetch\x20menu\x20list','remark','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','SQL\x20query\x20not\x20found:\x20id=','modelId','\x20of\x20','target','const\x20results\x20=\x20data.execResult\x20||\x20[];','roleName','key','/smartapi/question/er-config','/smartapi/lovrabet/detail?pageId=','/smartapi/dataset/update-driven-data','Unauthorized','download','responseFields','physicalTableCount','signal','});','/smartapi/permit/resource/get-menu-list','/smartapi/dataset/get-dataset-operation','append','/generate-standard-pages/start','/smartapi/app/getList','needPublic','6vhrXYm','API\x20error\x20code:\x20306','/smartapi/question/er-config/cli/delete-single','Check\x20network\x20connectivity\x20and\x20try\x20again.','/smartapi/dataset/text-generate/start','warn','/smartapi/custom/getUserCustomSql?id=','\x20\x20return\x20rows;','/smartapi/question/er-config/cli/update-single','name','\x20\x20});','api_error','tags','/smartapi/question/er-config/cli/erCreate','currentPage','planId','info','find','apiError','):\x20missing\x20data.markdown\x20field','needSelf','fetch-model-list','mobile','/smartapi/app-config/create','sqlCode','nickname','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','abort','validation','&type=','/smartapi/app-config/update','deleted','json','code','toLowerCase','\x20\x20\x20\x20sqlCode:\x20\x27','email','list','Page\x20not\x20found:\x20','displayName','/smartapi/question/er-config/cli/detail?','CUSTOM','isFinite','array','set','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','/smartapi/common/uploadFile','hint','modelCode','Fetch\x20datasets','/smartapi/permit/role/create','\x20apps.\x20','/smartapi/dblink/getTableDiffV2ByPage','/api/node-toolbox/sql/save','getOne','pageSize','value','replace','tableName','//\x20SQL:\x20','clientOperationId','object','16SZXcCY','(/*\x20params\x20*/);','401','/smartapi/permit/page/get-one','/smartapi/permit/page/save','includeImports','Operation\x20\x22','/smartapi/dblink/getOne','pageIndex','errorMsg','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','filter','remove','/smartapi/dataset/restore-dataset','stringify','/smartapi/dataset/text-generate/status?','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','path','status','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','includes','cli:rabetbase','?sqlCode=','/smartapi/lovrabet/update-page','12619930FfhbGj','has','relation','/smartapi/permit/resource/get-api-list','/smartapi/menu/update','/smartapi/question/er-config/business-group/edit','/smartapi/dblink/create','label','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','Dataset\x20not\x20found:\x20','Invalid\x20response\x20format\x20(','/smartapi/permit/role/update','ER\x20relation\x20does\x20not\x20exist','scriptName','join','toString','description','/smartapi/db-analysis/status/','2607597wTTANH','map','/smartapi/permit/user-role/update-user-list','body','\x20\x20where:\x20{},','GET','/api/','dbtableConfig','type','/smartapi/custom/queryUserCustomSqlList','UNAUTHORIZED','AbortError','const\x20result\x20=\x20await\x20client.models.','8eBzLen','operations','/smartapi/lovrabet/dataset/','create','/smartapi/menu/create','API\x20error:\x20','\x20failed,\x20HTTP\x20','summary','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','delete','Request\x20timeout:\x20','\x22\x20not\x20found\x20in\x20dataset\x20','errorMessage','sqlName','data','Warning:\x20showing\x20first\x20','update','roleType','datasetTableCount','/smartapi/dblink/getAllTableList','660868cSjnGM','operationName','/generate-standard-pages/status?','length','message','dbId','/api/management/library/scripts/delete','BFF\x20script\x20not\x20found:\x20id=','method','tableData','permits','markdown','\x20\x20currentPage:\x201,','/smartapi/dblink/update','entries','/smartapi/dataset/text-generate/preview','isArray','authRequired','error','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','/api/management/library/scripts/statistics?appCode=','/api/management/script/cache/clear','/smartapi/db-analysis/start','803014pCXgxJ','userId','/smartapi/permit/role/get-one','POST','operationId','/smartapi/dataset/get-dataset-list','version','test','appCode','errorCode'];a181_0x3261=function(){return _0x25980f;};return a181_0x3261();}export async function listDbLinks(_0x303767,_0x4c9d49){const _0xf15dc1=a181_0x162b,_0x3b7449=await apiRequest('/smartapi/dblink/getList',{'method':_0xf15dc1(0x1ba),'body':{'appCode':_0x303767,'currentPage':_0x4c9d49?.[_0xf15dc1(0x207)]??0x1,'pageSize':_0x4c9d49?.[_0xf15dc1(0x231)]??0x64}});return{'items':extractList(_0x3b7449[_0xf15dc1(0x19a)]),'paging':extractPaging(_0x3b7449['data'])};}export async function getDbLinkInfo(_0x4c3351){const _0x59bbcb=a181_0x162b,_0x3c0077=await apiRequest(_0x59bbcb(0x23f)+buildQuery({'id':_0x4c3351}));return _0x3c0077[_0x59bbcb(0x19a)];}export async function createDbLink(_0x12ca36){const _0xa8a21f=a181_0x162b,_0x5d2cb9=await apiRequest(_0xa8a21f(0x257),{'method':_0xa8a21f(0x1ba),'body':_0x12ca36});return _0x5d2cb9[_0xa8a21f(0x19a)];}export async function updateDbLink(_0x4588cc){const _0x3feb2e=a181_0x162b,_0x51f040=await apiRequest(_0x3feb2e(0x1ad),{'method':_0x3feb2e(0x1ba),'body':_0x4588cc});return _0x51f040[_0x3feb2e(0x19a)];}export async function deleteDbLink(_0x4a735a){const _0x51b909=a181_0x162b;await apiRequest(_0x51b909(0x1ca),{'method':_0x51b909(0x1ba),'body':{'id':_0x4a735a}});}export async function testDbLinkConnect(_0x18fd2a){const _0x490406=a181_0x162b,_0x2a1dee=await apiRequest(_0x490406(0x1d0)+buildQuery({'id':_0x18fd2a}));return _0x2a1dee[_0x490406(0x19a)];}export async function startDbAnalysis(_0x26f8bb,_0x1a7433){const _0x22a6de=a181_0x162b,_0x49ba15=await apiRequest(_0x22a6de(0x1b6),{'method':'POST','body':{'dbLinkId':_0x26f8bb,..._0x1a7433&&_0x1a7433[_0x22a6de(0x1a3)]>0x0?{'tableNames':_0x1a7433}:{}}}),_0x195aed=_0x49ba15['data'];if(typeof _0x195aed===_0x22a6de(0x1c7))return _0x195aed;if(_0x195aed&&typeof _0x195aed===_0x22a6de(0x237)&&typeof _0x195aed[_0x22a6de(0x208)]===_0x22a6de(0x1c7))return _0x195aed[_0x22a6de(0x208)];return _0x195aed!=null?String(_0x195aed):'';}export async function cancelDbAnalysis(_0x21fcd8){const _0x56fb3a=a181_0x162b;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x21fcd8}),{'method':_0x56fb3a(0x1ba)});}export async function getDbAnalysisStatus(_0x2d7ae6){const _0x3da219=a181_0x162b,_0x23ca48=await apiRequest(_0x3da219(0x262)+encodeURIComponent(_0x2d7ae6));return _0x23ca48[_0x3da219(0x19a)];}export async function getDbAllTableList(_0x3b4c3d,_0x6a3645){const _0x3a1e8f=a181_0x162b,_0x3da39a=await apiRequest(_0x3a1e8f(0x19f)+buildQuery({'appCode':_0x3b4c3d,'dbLinkId':_0x6a3645})),_0x497097=_0x3da39a[_0x3a1e8f(0x19a)];if(Array[_0x3a1e8f(0x1b0)](_0x497097))return _0x497097;return extractList(_0x497097);}export async function getDbTableDiff(_0x686902,_0x5541d5,_0x52fc14){const _0x46e708=a181_0x162b,_0x423ab4=await apiRequest(_0x46e708(0x22e)+buildQuery({'appCode':_0x686902,'dbLinkId':_0x5541d5,'pageIndex':_0x52fc14?.[_0x46e708(0x240)]??0x1,'pageSize':_0x52fc14?.[_0x46e708(0x231)]??0x14,'tableName':_0x52fc14?.[_0x46e708(0x234)]})),_0x1665e9=_0x423ab4[_0x46e708(0x19a)];return{'totalCount':_0x1665e9?.['totalCount']??0x0,'physicalTableCount':_0x1665e9?.[_0x46e708(0x1f0)]??0x0,'datasetTableCount':_0x1665e9?.[_0x46e708(0x19e)]??0x0,..._0x1665e9?.[_0x46e708(0x193)]?{'summary':_0x1665e9[_0x46e708(0x193)]}:{},'tableList':Array[_0x46e708(0x1b0)](_0x1665e9?.['tableList'])?_0x1665e9['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x44b3ed=a181_0x162b,_0x3f4e4d=await apiRequest(_0x44b3ed(0x1f7),{'method':_0x44b3ed(0x1ba),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x5b5ae3=extractList(_0x3f4e4d[_0x44b3ed(0x19a)]),_0x2de8b4=extractPaging(_0x3f4e4d[_0x44b3ed(0x19a)]);return _0x2de8b4&&_0x2de8b4['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x44b3ed(0x1fe)](_0x44b3ed(0x19b)+REMOTE_APP_PAGE_SIZE+_0x44b3ed(0x1e5)+_0x2de8b4['totalCount']+_0x44b3ed(0x22d)+_0x44b3ed(0x227)),_0x5b5ae3;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x3847f8,_0x98da18){const _0x3961ba=a181_0x162b,_0x27f913=Math[_0x3961ba(0x1c2)](Math['max'](_0x98da18?.[_0x3961ba(0x231)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x17b163=await apiRequest('/smartapi/permit/role/get-list',{'method':_0x3961ba(0x1ba),'body':{'appCode':_0x3847f8,'currentPage':_0x98da18?.['currentPage']??0x1,'pageSize':_0x27f913}});return{'items':extractList(_0x17b163[_0x3961ba(0x19a)]),'paging':extractPaging(_0x17b163[_0x3961ba(0x19a)])};}export async function getAppRole(_0x5ea138){const _0x17f70d=a181_0x162b,_0x200c52=await apiRequest(_0x17f70d(0x1b9)+buildQuery({'id':_0x5ea138}));return _0x200c52[_0x17f70d(0x19a)];}export async function createAppRole(_0x48cd64){const _0x521001=a181_0x162b,_0x2abd8a=await apiRequest(_0x521001(0x22c),{'method':'POST','body':{'appCode':_0x48cd64[_0x521001(0x1bf)],'roleName':_0x48cd64[_0x521001(0x1e8)],'roleType':_0x521001(0x222),..._0x48cd64[_0x521001(0x1e1)]?{'remark':_0x48cd64[_0x521001(0x1e1)]}:{}}});return _0x2abd8a['data'];}export async function updateAppRole(_0x4f9338){const _0x3f879f=a181_0x162b,_0x47ee4b=await apiRequest(_0x3f879f(0x25c),{'method':_0x3f879f(0x1ba),'body':{'id':_0x4f9338['id'],'appCode':_0x4f9338['appCode'],..._0x4f9338[_0x3f879f(0x19d)]?{'roleType':_0x4f9338[_0x3f879f(0x19d)]}:{},..._0x4f9338[_0x3f879f(0x1e8)]!==undefined?{'roleName':_0x4f9338['roleName']}:{},..._0x4f9338[_0x3f879f(0x1e1)]!==undefined?{'remark':_0x4f9338[_0x3f879f(0x1e1)]}:{},..._0x4f9338[_0x3f879f(0x1aa)]?{'permits':_0x4f9338[_0x3f879f(0x1aa)]}:{}}});return _0x47ee4b[_0x3f879f(0x19a)];}export async function deleteAppRole(_0x2a797a){const _0x2b9208=a181_0x162b;await apiRequest('/smartapi/permit/role/delete',{'method':_0x2b9208(0x1ba),'body':{'id':_0x2a797a}});}export async function listPermitRoles(_0x16d43b,_0xdcc943){const _0x38668f=a181_0x162b,_0xed7a=await apiRequest('/smartapi/permit/role/get-permit-list',{'method':_0x38668f(0x1ba),'body':{'appCode':_0x16d43b,..._0xdcc943?.[_0x38668f(0x20d)]!==undefined?{'needSelf':_0xdcc943['needSelf']}:{},..._0xdcc943?.['needPublic']!==undefined?{'needPublic':_0xdcc943[_0x38668f(0x1f8)]}:{}}});return extractList(_0xed7a['data']);}export async function getRoleMenuResources(_0x10833e,_0x4f73b0){const _0x2c847d=a181_0x162b,_0x5a002d=await apiRequest(_0x2c847d(0x1f3),{'method':'POST','body':{'appCode':_0x10833e,'roleId':_0x4f73b0}});return extractList(_0x5a002d[_0x2c847d(0x19a)]);}export async function getRoleApiResources(_0x17be73,_0x4f316a){const _0x3893b4=a181_0x162b,_0x420cbe=await apiRequest(_0x3893b4(0x254),{'method':_0x3893b4(0x1ba),'body':{'appCode':_0x17be73,'roleId':_0x4f316a}});return extractList(_0x420cbe[_0x3893b4(0x19a)]);}export async function listRoleUsers(_0x551cc7){const _0x158dd2=a181_0x162b,_0x2014f7=await apiRequest('/smartapi/permit/user-role/get-user-list',{'method':'POST','body':{'appCode':_0x551cc7}});return extractList(_0x2014f7[_0x158dd2(0x19a)]);}export async function updateRoleUsers(_0x541f6b,_0x2d02a3){const _0x22f041=a181_0x162b;await apiRequest(_0x22f041(0x265),{'method':_0x22f041(0x1ba),'body':{'appCode':_0x541f6b,'roleList':_0x2d02a3}});}export async function getPagePermit(_0xf08043){const _0x5319d0=a181_0x162b,_0x1a521d=await apiRequest(_0x5319d0(0x23b)+buildQuery({'menuId':_0xf08043}));return _0x1a521d[_0x5319d0(0x19a)];}export async function savePagePermit(_0x4a62e5){const _0x369993=a181_0x162b,_0x5d91b6=await apiRequest(_0x369993(0x23c),{'method':_0x369993(0x1ba),'body':_0x4a62e5});return _0x5d91b6[_0x369993(0x19a)];}export async function getTenantMembers(_0x335119){const _0x48de1e=a181_0x162b,_0x5d10e4=await apiRequest('/userTenant/getByTenantCode'+buildQuery({'code':_0x335119})),_0x643a84=_0x5d10e4[_0x48de1e(0x19a)]??{},_0x332f49=Array['isArray'](_0x643a84?.[_0x48de1e(0x1c9)])?_0x643a84[_0x48de1e(0x1c9)]:[];return _0x332f49[_0x48de1e(0x243)](_0x5f00e9=>_0x5f00e9?.[_0x48de1e(0x24b)]==='ENABLE'||_0x5f00e9?.[_0x48de1e(0x24b)]===undefined)[_0x48de1e(0x264)](_0xa3739e=>({'userId':Number(_0xa3739e[_0x48de1e(0x1b8)]??_0xa3739e['id']),'username':_0xa3739e[_0x48de1e(0x1cb)],'nickname':_0xa3739e[_0x48de1e(0x212)],'status':_0xa3739e[_0x48de1e(0x24b)],'email':_0xa3739e[_0x48de1e(0x21d)],'mobile':_0xa3739e[_0x48de1e(0x20f)],'avatar':_0xa3739e['avatar']}))[_0x48de1e(0x243)](_0x56ca97=>Number[_0x48de1e(0x223)](_0x56ca97[_0x48de1e(0x1b8)])&&_0x56ca97[_0x48de1e(0x1b8)]>0x0);}
|
|
1
|
+
(function(_0x31c12d,_0x2337ab){const _0x52f05d=a183_0x4443,_0x15ed6c=_0x31c12d();while(!![]){try{const _0x407f68=parseInt(_0x52f05d(0x1a0))/0x1*(-parseInt(_0x52f05d(0x193))/0x2)+parseInt(_0x52f05d(0x190))/0x3+-parseInt(_0x52f05d(0x156))/0x4*(-parseInt(_0x52f05d(0x199))/0x5)+parseInt(_0x52f05d(0x116))/0x6*(-parseInt(_0x52f05d(0x10b))/0x7)+parseInt(_0x52f05d(0x153))/0x8+parseInt(_0x52f05d(0xfa))/0x9+parseInt(_0x52f05d(0x17c))/0xa*(-parseInt(_0x52f05d(0x1ac))/0xb);if(_0x407f68===_0x2337ab)break;else _0x15ed6c['push'](_0x15ed6c['shift']());}catch(_0x2ac002){_0x15ed6c['push'](_0x15ed6c['shift']());}}}(a183_0x13f4,0x72763));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(_0x25d6ce){_activeCookie=_0x25d6ce||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(_0x1f4e20,_0x20aea1){const _0x9e8933=a183_0x4443,_0x2d874e=_0x20aea1 instanceof Error?_0x20aea1[_0x9e8933(0x163)]:String(_0x20aea1);return CliErrors[_0x9e8933(0xe5)](_0x9e8933(0x150)+_0x1f4e20+(_0x2d874e?'\x20('+_0x2d874e+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x1666a8,_0x40769b={}){const _0x211569=a183_0x4443,{method:method=_0x211569(0x181),body:_0x36848d,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x40769b,_0x3235e5=useRuntime?getRuntimeDomain():getApiDomain(),_0x28f5ca=_activeCookie||getCookie(),_0x235252=''+_0x3235e5+_0x1666a8,_0x14e94d=new AbortController(),_0x28898b=setTimeout(()=>_0x14e94d[_0x211569(0xda)](),timeout);try{const _0x5cdff8=await fetch(_0x235252,{'method':method,'headers':{'Content-Type':_0x211569(0x104),'Cookie':_0x28f5ca,'X-Invoke-Source':_0x211569(0x12f),...headers},'body':_0x36848d?JSON[_0x211569(0xd2)](_0x36848d):undefined,'signal':_0x14e94d['signal']});let _0x1ea8e0;try{_0x1ea8e0=await _0x5cdff8[_0x211569(0x145)]();}catch(_0x33c543){if(_0x33c543 instanceof Error&&_0x33c543['name']===_0x211569(0xfb))throw CliErrors[_0x211569(0xe5)](_0x211569(0x102)+_0x235252);if(_0x5cdff8['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError'](_0x211569(0x168)+_0x5cdff8[_0x211569(0x182)]+')',_0x5cdff8[_0x211569(0x182)]>=0x190?_0x211569(0xf8):undefined);}if(!_0x5cdff8['ok']||_0x1ea8e0[_0x211569(0x10e)]===![])throw CliErrors['apiError'](_0x1ea8e0[_0x211569(0x11b)]||_0x1ea8e0[_0x211569(0x163)]||_0x211569(0x128)+_0x5cdff8['status'],_0x1ea8e0[_0x211569(0x112)]?'API\x20error\x20code:\x20'+_0x1ea8e0['errorCode']:undefined);return _0x1ea8e0;}catch(_0x6f313){if(_0x6f313 instanceof CliError)throw _0x6f313;if(_0x6f313 instanceof Error&&_0x6f313[_0x211569(0x19d)]===_0x211569(0xfb))throw CliErrors[_0x211569(0xe5)](_0x211569(0x102)+_0x235252);throw createFetchFailureError(_0x235252,_0x6f313);}finally{clearTimeout(_0x28898b);}}async function apiFormRequest(_0x4b16db,_0x2301ca,_0x4ce911={}){const _0x44b27a=a183_0x4443,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x4ce911,_0x4d0787=_activeCookie||getCookie(),_0x1ccc6e=''+getApiDomain()+_0x4b16db,_0x392a6c=new AbortController(),_0x3d187a=setTimeout(()=>_0x392a6c[_0x44b27a(0xda)](),timeout);try{const _0x1b9577=await fetch(_0x1ccc6e,{'method':_0x44b27a(0xe9),'headers':{'Cookie':_0x4d0787,'X-Invoke-Source':_0x44b27a(0x12f)},'body':_0x2301ca,'signal':_0x392a6c['signal']});let _0x5591c9;try{_0x5591c9=await _0x1b9577[_0x44b27a(0x145)]();}catch(_0x548365){if(_0x548365 instanceof Error&&_0x548365[_0x44b27a(0x19d)]===_0x44b27a(0xfb))throw CliErrors[_0x44b27a(0xe5)](_0x44b27a(0x102)+_0x1ccc6e);throw CliErrors[_0x44b27a(0xe5)](_0x44b27a(0x168)+_0x1b9577['status']+')',_0x1b9577[_0x44b27a(0x182)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x1b9577['ok']||_0x5591c9['success']===![])throw CliErrors[_0x44b27a(0xe5)](_0x5591c9[_0x44b27a(0x11b)]||_0x5591c9[_0x44b27a(0x163)]||'API\x20error:\x20'+_0x1b9577[_0x44b27a(0x182)],_0x5591c9[_0x44b27a(0x112)]?_0x44b27a(0xe6)+_0x5591c9[_0x44b27a(0x112)]:undefined);return _0x5591c9;}catch(_0x1e2c8f){if(_0x1e2c8f instanceof CliError)throw _0x1e2c8f;if(_0x1e2c8f instanceof Error&&_0x1e2c8f[_0x44b27a(0x19d)]===_0x44b27a(0xfb))throw CliErrors[_0x44b27a(0xe5)](_0x44b27a(0x102)+_0x1ccc6e);throw createFetchFailureError(_0x1ccc6e,_0x1e2c8f);}finally{clearTimeout(_0x3d187a);}}export async function uploadDevelopmentFile(_0x503bdf,_0x5786a3){const _0x3fd886=a183_0x4443,_0x21d3a2=await readFile(_0x5786a3),_0x3f94c1=new FormData();_0x3f94c1['append'](_0x3fd886(0x148),_0x503bdf),_0x3f94c1[_0x3fd886(0x100)](_0x3fd886(0x13a),new Blob([new Uint8Array(_0x21d3a2)]),basename(_0x5786a3));const _0x40ba03=await apiFormRequest(_0x3fd886(0xdc),_0x3f94c1);return _0x40ba03[_0x3fd886(0x162)];}export async function queryDevelopmentFileUrl(_0xafa90d,_0x257499={}){const _0x356013=a183_0x4443,_0x5303d3=await apiRequest(_0x356013(0xdf),{'method':'POST','body':{'filePath':_0xafa90d,'downloadFlag':_0x257499['download']??![],..._0x257499['longTerm']?{'longTerm':!![]}:{}}});return _0x5303d3['data'];}function isAuthFailure(_0x389348){const _0x204530=a183_0x4443,_0x22b878=_0x389348[_0x204530(0x11b)]||_0x389348[_0x204530(0x163)]||_0x389348[_0x204530(0x162)]?.[_0x204530(0x163)]||_0x389348['errorMessage']||_0x389348[_0x204530(0xd5)]||'';return _0x389348[_0x204530(0x112)]===_0x204530(0x14e)||_0x389348[_0x204530(0x105)]===0x191||_0x389348['code']===_0x204530(0xe8)||_0x22b878[_0x204530(0x175)](_0x204530(0xe8))||_0x22b878['includes'](_0x204530(0x197))||_0x22b878[_0x204530(0x175)]('登录')||_0x22b878[_0x204530(0x175)]('认证');}export async function platformFetch(_0x1e00a6,_0x24d493){const _0x1e86cf=a183_0x4443;let _0x10a84a;try{_0x10a84a=await fetch(_0x1e00a6,{'method':_0x24d493['method']??_0x1e86cf(0x181),'headers':{'Content-Type':'application/json','Cookie':_0x24d493['cookie'],'X-Invoke-Source':_0x1e86cf(0x12f)},..._0x24d493[_0x1e86cf(0x15e)]&&{'body':JSON[_0x1e86cf(0xd2)](_0x24d493[_0x1e86cf(0x15e)])}});}catch(_0x52fb0c){throw createFetchFailureError(_0x1e00a6,_0x52fb0c);}if(!_0x10a84a['ok']){if(_0x10a84a[_0x1e86cf(0x182)]===0x191)throw CliErrors[_0x1e86cf(0x110)]();throw CliErrors[_0x1e86cf(0xe5)](_0x24d493['label']+_0x1e86cf(0x13c)+_0x10a84a['status']);}const _0x33a3d5=await _0x10a84a[_0x1e86cf(0x145)]();if(_0x33a3d5[_0x1e86cf(0x10e)]===![]){if(isAuthFailure(_0x33a3d5))throw CliErrors['authRequired']();throw CliErrors[_0x1e86cf(0xe5)](_0x33a3d5[_0x1e86cf(0x11b)]||_0x33a3d5[_0x1e86cf(0x163)]||_0x24d493[_0x1e86cf(0xd4)]+_0x1e86cf(0x161));}return _0x33a3d5['data'];}function a183_0x13f4(){const _0x496e38=['markdown','cli:rabetbase','value','filter','update','includeImports','\x20\x20pageSize:\x2020,','method','/smartapi/dblink/testConnect','/smartapi/custom/saveUserCustomSql','object','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','file','\x20apps.\x20','\x20failed,\x20HTTP\x20','clientOperationId','modelId','Dataset\x20not\x20found:\x20','operations','roleType','CUSTOM','requestFields','datasetTableCount','json','/api/management/library/scripts/list?appCode=','tags','appCode','test','userId','/smartapi/permit/resource/get-menu-list','/generate-standard-pages/start','avatar','UNAUTHORIZED','/smartapi/permit/role/get-permit-list','Request\x20failed:\x20','validation','tableList','4659768RIomJC','/smartapi/db-analysis/start','entries','1674252qWbZiJ','trim','//\x20','map','length','/smartapi/dataset/update-driven-data','BFF\x20save\x20returned\x20no\x20valid\x20id','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','body','/smartapi/dataset/text-generate/start','relation','\x20failed','data','message','hint','/api/management/library/scripts/save','join','/api/','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/smartapi/app-config/delete','table','dbId','sqlCode','/smartapi/custom/getUserCustomSql?id=','/smartapi/dblink/getOne','toString','SQL\x20query\x20not\x20found:\x20id=','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','info','create','\x22\x20not\x20found\x20in\x20dataset\x20','includes','/smartapi/dblink/delete','modelCode','/api/node-toolbox/dataset/model-list?','(/*\x20params\x20*/);','/api/management/script/cache/clear','/smartapi/app-config/list','110uCyTYo','.create({\x20/*\x20fields\x20*/\x20});','sdk','/smartapi/dataset/text-generate/status?','email','GET','status','.filter({','configArray','displayName','/api/node-toolbox/sql/save','/smartapi/permit/role/create','scriptType','/smartapi/lovrabet/update-page','totalCount','/smartapi/dataset/restore-dataset','.getOne(id);','Operation\x20\x22','needSelf','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','2015508TrJUAX','const\x20results\x20=\x20data.execResult\x20||\x20[];','nickname','138lhuaZU','/smartapi/dataset/text-generate/preview','datasetName','/smartapi/dblink/create','Unauthorized','tableData','5HcQlic','Page\x20not\x20found:\x20','roleName','SQL\x20query\x20not\x20found:\x20','name','pageIndex','/smartapi/db-analysis/status/','11843iotZFn','replace','?sqlCode=','enabled','/sync-to-pages','path','\x20of\x20','isFinite','/generate-standard-pages/status?','/api/management/library/scripts/delete','warn','/smartapi/question/er-config','159071kBjoLq','responseFields','/standard-page-status?appCode=','Warning:\x20showing\x20first\x20','sqlName','/smartapi/permit/role/get-list','/smartapi/permit/page/save','/smartapi/app-config/getByKey','/smartapi/lovrabet/detail?pageId=','/smartapi/menu/find?','/smartapi/custom/queryUserCustomSqlList','&type=','stringify','toLowerCase','label','error','});','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','max','abort','/smartapi/custom/deleteUserCustomSql','/smartapi/common/uploadFile','/smartapi/permit/user-role/update-user-list','dbtableConfig','/smartapi/common/queryFileUrl','const\x20result\x20=\x20await\x20client.models.','has','currentPage','\x20\x20sqlCode:\x20\x27','type','apiError','API\x20error\x20code:\x20','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','401','POST','remove','list','/smartapi/question/er-config/cli/delete-single','/smartapi/db-analysis/jobs/cancel','Invalid\x20response\x20format\x20(','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','find','/smartapi/menu/update','/smartapi/question/er-config/cli/erCreate','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','isArray','/smartapi/permit/role/update','/smartapi/app-config/create','/smartapi/dataset/get-driven-data?','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','permits','2453823uVGdqn','AbortError','/userTenant/getByTenantCode','needPublic','target','version','append','planId','Request\x20timeout:\x20','pageSize','application/json','code','scriptName','key','/filter','\x20\x20\x20\x20sqlCode:\x20\x27','set','28DeEsju','push','operationId','success','string','authRequired','/smartapi/lovrabet/dataset/','errorCode','/smartapi/dataset/delete-dataset','Fetch\x20datasets','ENABLE','750666pjVlov','mobile','\x20\x20});','/api/management/library/scripts/info?id=','API\x20error\x20code:\x20306','errorMsg','/smartapi/dblink/getList','/smartapi/custom/updateUserCustomSql','/smartapi/question/er-config/cli/detail?','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','/smartapi/dataset/get-dataset-operation','operationName','api_error','remark','/api/custom/executeSql','functionName','/smartapi/app/getList','DATA_NOT_EXIST','API\x20error:\x20','/smartapi/menu/create','/smartapi/dblink/getTableDiffV2ByPage','正在从服务器拉取模型列表...\x20(环境:\x20','min','tableName'];a183_0x13f4=function(){return _0x496e38;};return a183_0x13f4();}export async function platformRequest(_0x148df6,_0x4ce0b8){const _0x3a8b0e=a183_0x4443;if(/^https?:\/\//i['test'](_0x148df6))throw CliErrors[_0x3a8b0e(0x151)](_0x3a8b0e(0x18f)+_0x148df6,_0x3a8b0e(0x171));const _0x4cb70c=_0x148df6['startsWith']('/')?_0x148df6:'/'+_0x148df6;return platformFetch(''+getApiDomain()+_0x4cb70c,_0x4ce0b8);}function cleanNewlines(_0x47237c){const _0x40ca8c=a183_0x4443;return _0x47237c[_0x40ca8c(0x1a1)](/[\r\n]+/g,'\x20')[_0x40ca8c(0x157)]();}function cleanDatasetName(_0x3d96cc){const _0x1552e2=a183_0x4443;if(!_0x3d96cc[_0x1552e2(0x19d)])return _0x3d96cc;return{..._0x3d96cc,'name':cleanNewlines(_0x3d96cc['name'])};}export async function fetchModelList(_0xed9c24,_0x143ac9){const _0x4e47c6=a183_0x4443,_0x58b242=getEnv(),_0x1f445f=new URLSearchParams({'appcode':_0xed9c24,'otype':'array'}),_0x356b2b=_0x4e47c6(0x178)+_0x1f445f['toString']();logger[_0x4e47c6(0x172)]('fetch-model-list',_0x4e47c6(0x12b)+_0x58b242+')',{'apiPath':_0x356b2b});const _0x4eafb5=await platformRequest(_0x356b2b,{'cookie':_0x143ac9,'label':_0x4e47c6(0x114)}),_0x46b78f=(_0x4eafb5[_0x4e47c6(0x184)]??[])['map'](cleanDatasetName);return{'configArray':_0x46b78f,'count':_0x46b78f[_0x4e47c6(0x15a)]};}export async function fetchDatasetDoc(_0xc98f57){const _0x15f09=a183_0x4443,{appCode:_0x5263f1,cookie:_0x48297c,datasetCode:_0x1746b2,datasetId:_0x457d00,extraParams:_0x4d6a73}=_0xc98f57,_0x156569=await platformRequest('/api/node-toolbox/api-doc-generator',{'method':_0x15f09(0xe9),'body':{'appCode':_0x5263f1,'datasetCode':_0x1746b2,'datasetId':_0x457d00,..._0x4d6a73||{}},'cookie':_0x48297c,'label':'Fetch\x20doc\x20('+_0x1746b2+')'});if(!_0x156569||typeof _0x156569[_0x15f09(0x12e)]!==_0x15f09(0x10f))throw new Error(_0x15f09(0xee)+_0x1746b2+'):\x20missing\x20data.markdown\x20field');return _0x156569['markdown'];}export async function getMenuTree(_0x135ecc,_0x321943){const _0x118028=a183_0x4443,_0x2d1291=new URLSearchParams({'appCode':_0x135ecc});return platformRequest(_0x118028(0x1b5)+_0x2d1291[_0x118028(0x16f)](),{'cookie':_0x321943,'label':'Fetch\x20menu\x20list'});}export async function createMenuRecord(_0x4f22ad,_0x4af9c6,_0x299c31){const _0x2fe21d=a183_0x4443;return platformRequest(_0x2fe21d(0x129),{'method':_0x2fe21d(0xe9),'body':_0x4f22ad,'cookie':_0x4af9c6,'label':_0x299c31});}export async function updateMenuRecord(_0x221b4b,_0x5ac382,_0x39b2e9){const _0x49f41d=a183_0x4443;return platformRequest(_0x49f41d(0xf1),{'method':_0x49f41d(0xe9),'body':_0x221b4b,'cookie':_0x5ac382,'label':_0x39b2e9});}export async function listBffScripts(_0x52ad88,_0x8d03d5,_0x4e757d){const _0x203f74=a183_0x4443;let _0x15edbd=_0x203f74(0x146)+_0x52ad88;if(_0x8d03d5)_0x15edbd+=_0x203f74(0xd1)+_0x8d03d5;const _0xa4ac85=await apiRequest(_0x15edbd);let _0x5d3859=extractList(_0xa4ac85['data']);if(_0x4e757d?.[_0x203f74(0x106)]){const _0x2fdaba=_0x4e757d[_0x203f74(0x106)][_0x203f74(0xd3)]();_0x5d3859=_0x5d3859[_0x203f74(0x131)](_0xea9f06=>_0xea9f06[_0x203f74(0x125)]?.[_0x203f74(0xd3)]()['includes'](_0x2fdaba)||_0xea9f06['description']?.['toLowerCase']()[_0x203f74(0x175)](_0x2fdaba));}return _0x5d3859;}export async function getBffScriptInfo(_0x34aaed){const _0x362263=a183_0x4443,_0x2db0b1=await apiRequest(_0x362263(0x119)+_0x34aaed);if(!_0x2db0b1['data'])throw CliErrors[_0x362263(0x151)]('BFF\x20script\x20not\x20found:\x20id='+_0x34aaed);return _0x2db0b1['data'];}export async function saveBffScript(_0x558fe8){const _0x418dc4=a183_0x4443,_0x243ca0=await apiRequest(_0x418dc4(0x165),{'method':_0x418dc4(0xe9),'body':_0x558fe8}),{id:_0x10eafb,entity:_0x47f2f5}=normalizeEntityWithIdResponse(_0x243ca0[_0x418dc4(0x162)]);if(_0x10eafb!==undefined){const _0xaef07a=typeof _0x47f2f5[_0x418dc4(0x125)]===_0x418dc4(0x10f)||typeof _0x47f2f5[_0x418dc4(0x188)]==='string'?_0x47f2f5:undefined;return{'id':_0x10eafb,'script':_0xaef07a};}throw CliErrors[_0x418dc4(0xe5)](_0x418dc4(0x15c));}export async function deleteBffScript(_0x408d59){const _0x1bd959=a183_0x4443;await apiRequest(_0x1bd959(0x1a9),{'method':_0x1bd959(0xe9),'body':{'id':_0x408d59}});}export async function getBffScriptStatistics(_0x149b62){const _0x51fa64=a183_0x4443,_0xba796c=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x149b62);return extractList(_0xba796c[_0x51fa64(0x162)]);}export async function clearBffScriptCache(){const _0x2d7542=a183_0x4443,_0x34053f=await apiRequest(_0x2d7542(0x17a),{'method':_0x2d7542(0xe9),'useRuntime':!![]});return typeof _0x34053f[_0x2d7542(0x162)]===_0x2d7542(0x10f)?_0x34053f[_0x2d7542(0x162)]:'';}export async function listBffDatasetOperations(_0x2764dc,_0x2cb54d){const _0x35178b=a183_0x4443,_0x5b75c7=await apiRequest(_0x35178b(0x120),{'method':_0x35178b(0xe9),'body':{'appCode':_0x2764dc,'datasetId':_0x2cb54d}});return _0x5b75c7[_0x35178b(0x162)];}export async function listSqlQueries(_0x4f5e0d,_0x2f4376){const _0x5f49c9=a183_0x4443,_0x5c3742=await apiRequest(_0x5f49c9(0xd0),{'method':_0x5f49c9(0xe9),'body':{'appCode':_0x4f5e0d,'currentPage':_0x2f4376?.[_0x5f49c9(0xe2)]??0x1,'pageSize':_0x2f4376?.[_0x5f49c9(0x103)]??0x32,'sqlCode':_0x2f4376?.[_0x5f49c9(0x16c)],'sqlName':_0x2f4376?.[_0x5f49c9(0x1b0)]}});return _0x5c3742[_0x5f49c9(0x162)];}export async function getSqlQueryInfo(_0x14e8f0,_0x276e35){const _0x38405c=a183_0x4443,_0x46f1a3=await listSqlQueries(_0x14e8f0,{'sqlCode':_0x276e35}),_0x5cab88=_0x46f1a3['tableData']?.[0x0];if(!_0x5cab88)throw CliErrors[_0x38405c(0x151)](_0x38405c(0x19c)+_0x276e35);return _0x5cab88;}export async function getSqlQueryDetail(_0x2f4f81){const _0x6f20eb=a183_0x4443,_0x5d4915=await apiRequest('/smartapi/custom/getUserCustomSql'+(_0x6f20eb(0x1a2)+encodeURIComponent(_0x2f4f81)));if(!_0x5d4915[_0x6f20eb(0x162)])throw CliErrors[_0x6f20eb(0x151)](_0x6f20eb(0x19c)+_0x2f4f81);return _0x5d4915[_0x6f20eb(0x162)];}function a183_0x4443(_0x930dca,_0x55e279){_0x930dca=_0x930dca-0xd0;const _0x13f4a5=a183_0x13f4();let _0x444361=_0x13f4a5[_0x930dca];return _0x444361;}export async function getSqlQueryDetailById(_0x5e82a1){const _0x397879=a183_0x4443,_0x7f3c97=await apiRequest(_0x397879(0x16d)+_0x5e82a1);if(!_0x7f3c97[_0x397879(0x162)])throw CliErrors[_0x397879(0x151)](_0x397879(0x170)+_0x5e82a1);return _0x7f3c97[_0x397879(0x162)];}export async function createSqlQuery(_0x5a7561){const _0x5e7e58=a183_0x4443,_0x2cbb9d=await apiRequest(_0x5e7e58(0x137),{'method':'POST','body':_0x5a7561}),{id:_0x4c9e0d,entity:_0x4950fb}=normalizeEntityWithIdResponse(_0x2cbb9d[_0x5e7e58(0x162)]);if(!(_0x5e7e58(0x16c)in _0x4950fb)&&_0x4c9e0d)return getSqlQueryDetailById(_0x4c9e0d);return normalizeSqlQueryEntity(_0x4950fb);}export async function updateSqlQuery(_0x538259){const _0x130680=a183_0x4443,_0x472954=await apiRequest(_0x130680(0x11d),{'method':_0x130680(0xe9),'body':_0x538259}),{id:_0x515366,entity:_0x1f2c58}=normalizeEntityWithIdResponse(_0x472954[_0x130680(0x162)]);if(!(_0x130680(0x16c)in _0x1f2c58)){if(_0x538259[_0x130680(0x16c)])return getSqlQueryDetail(_0x538259[_0x130680(0x16c)]);if(_0x515366)return getSqlQueryDetailById(_0x515366);}return normalizeSqlQueryEntity(_0x1f2c58);}export async function deleteSqlQuery(_0x33f76f){const _0xef0eb2=a183_0x4443;await apiRequest(_0xef0eb2(0xdb),{'method':_0xef0eb2(0xe9),'body':_0x33f76f});}export async function saveSqlQuery(_0x3c09b4){const _0x307802=a183_0x4443,_0x1a6cb7=await apiRequest(_0x307802(0x186),{'method':'POST','body':_0x3c09b4});return _0x1a6cb7['data'];}function normalizeSqlQueryEntity(_0x55fc70){const _0x35f6e7=a183_0x4443;return{..._0x55fc70,'id':Number(_0x55fc70['id']),'dbId':_0x55fc70[_0x35f6e7(0x16b)]==null?undefined:Number(_0x55fc70[_0x35f6e7(0x16b)]),'version':_0x55fc70[_0x35f6e7(0xff)]==null?undefined:Number(_0x55fc70[_0x35f6e7(0xff)])};}export async function executeSql(_0x5cb9fb,_0x528c54,_0x3a873f){const _0x21a910=a183_0x4443,_0x59e4d1=await apiRequest(_0x21a910(0x124),{'method':_0x21a910(0xe9),'body':{'appCode':_0x5cb9fb,'sqlCode':_0x528c54,..._0x3a873f&&{'params':_0x3a873f}},'useRuntime':!![]});return _0x59e4d1[_0x21a910(0x162)];}export async function executeDatasetDataOperation(_0x288b4b,_0x355aa5,_0x5532e3,_0x17b120={}){const _0x5a5fac=a183_0x4443;try{const _0x32eed5=await apiRequest('/api/'+_0x288b4b+'/'+_0x355aa5+'/'+_0x5532e3,{'method':'POST','body':_0x17b120,'useRuntime':!![]});return _0x32eed5[_0x5a5fac(0x162)];}catch(_0x3c1256){if(_0x5532e3==='getOne'&&_0x3c1256 instanceof CliError&&_0x3c1256['code']===_0x5a5fac(0x122)&&_0x17b120['id']!==undefined&&_0x17b120['id']!==null&&_0x17b120['id']!==''){const _0xe7d3f2=await apiRequest(_0x5a5fac(0x167)+_0x288b4b+'/'+_0x355aa5+_0x5a5fac(0x108),{'method':_0x5a5fac(0xe9),'body':{'where':{'id':{'$eq':_0x17b120['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x4075c2=Array[_0x5a5fac(0xf4)](_0xe7d3f2[_0x5a5fac(0x162)]?.[_0x5a5fac(0x198)])?_0xe7d3f2[_0x5a5fac(0x162)]['tableData']:[];return _0x4075c2[0x0]??null;}throw _0x3c1256;}}export async function listDatasets(_0x20e996,_0xc88ff5){const _0x4ce046=a183_0x4443,_0x317ed3={'appCode':_0x20e996,'deleted':_0xc88ff5?.['deleted']??![]};if(_0xc88ff5?.['code'])_0x317ed3[_0x4ce046(0x105)]=_0xc88ff5[_0x4ce046(0x105)];if(_0xc88ff5?.[_0x4ce046(0x19d)])_0x317ed3[_0x4ce046(0x19d)]=_0xc88ff5[_0x4ce046(0x19d)];const _0x217701=await apiRequest('/smartapi/dataset/get-dataset-list',{'method':_0x4ce046(0xe9),'body':_0x317ed3});return extractList(_0x217701[_0x4ce046(0x162)]);}export async function deleteDataset(_0x45ed18,_0xad4a2){const _0x3473ea=a183_0x4443;await apiRequest(_0x3473ea(0x113),{'method':_0x3473ea(0xe9),'body':{'appCode':_0x45ed18,'datasetId':_0xad4a2}});}export async function restoreDataset(_0x373146,_0x1a1f88){const _0x3467da=a183_0x4443;await apiRequest(_0x3467da(0x18b),{'method':_0x3467da(0xe9),'body':{'appCode':_0x373146,'datasetId':_0x1a1f88}});}export async function previewTextGeneratedDataset(_0x25b4b3,_0x1f43bb){const _0x559a93=a183_0x4443,_0x2230fb=await apiRequest(_0x559a93(0x194),{'method':_0x559a93(0xe9),'body':{'appCode':_0x25b4b3,'datasetName':_0x1f43bb[_0x559a93(0x195)],'requirementDescription':_0x1f43bb['requirementDescription']},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x2230fb[_0x559a93(0x162)];}export async function startTextGeneratedDataset(_0x5d1dfb,_0x2aee67,_0x50064a){const _0x23b40e=a183_0x4443,_0x24c2cd=await apiRequest(_0x23b40e(0x15f),{'method':_0x23b40e(0xe9),'body':{'appCode':_0x5d1dfb,..._0x50064a?.[_0x23b40e(0x13d)]?{'clientOperationId':_0x50064a['clientOperationId']}:{},'design':_0x2aee67},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x24c2cd['data'];}export async function getTextGeneratedDatasetStatus(_0x566186,_0x57610e){const _0xeb7f4a=a183_0x4443,_0x52b20e=new URLSearchParams({'appCode':_0x566186});_0x57610e[_0xeb7f4a(0x10d)]&&_0x52b20e[_0xeb7f4a(0x10a)]('operationId',_0x57610e[_0xeb7f4a(0x10d)]);_0x57610e['clientOperationId']&&_0x52b20e[_0xeb7f4a(0x10a)]('clientOperationId',_0x57610e[_0xeb7f4a(0x13d)]);const _0x3a0de6=await apiRequest(_0xeb7f4a(0x17f)+_0x52b20e[_0xeb7f4a(0x16f)]());return _0x3a0de6[_0xeb7f4a(0x162)];}export async function searchDatasets(_0x546152,_0x5b66af){const _0x5aaa98=a183_0x4443,_0x3d8c08=await listDatasets(_0x546152,{'name':_0x5b66af}),_0x43b481=_0x5b66af['toLowerCase'](),_0x2d03c2=new Set(_0x3d8c08['map'](_0x32e146=>_0x32e146['id'])),_0x1d63b5=_0x3d8c08[_0x5aaa98(0x131)](_0x2348f4=>_0x2348f4[_0x5aaa98(0xde)]?.[_0x5aaa98(0x12d)]?.[_0x5aaa98(0xd3)]()[_0x5aaa98(0x175)](_0x43b481)||_0x2348f4['description']?.[_0x5aaa98(0xd3)]()[_0x5aaa98(0x175)](_0x43b481)),_0x175332=await listDatasets(_0x546152,{'code':_0x5b66af});for(const _0x55b889 of _0x175332){!_0x2d03c2[_0x5aaa98(0xe1)](_0x55b889['id'])&&(_0x3d8c08[_0x5aaa98(0x10c)](_0x55b889),_0x2d03c2['add'](_0x55b889['id']));}return _0x3d8c08;}export function normalizeDatasetOperations(_0x2cbfa4){const _0x4db930=a183_0x4443;if(Array['isArray'](_0x2cbfa4))return _0x2cbfa4[_0x4db930(0x131)](_0x4132b1=>_0x4132b1!=null&&typeof _0x4132b1==='object');if(_0x2cbfa4&&typeof _0x2cbfa4===_0x4db930(0x138))return Object[_0x4db930(0x155)](_0x2cbfa4)[_0x4db930(0x131)](([,_0x2d97e0])=>_0x2d97e0!=null&&typeof _0x2d97e0===_0x4db930(0x138))[_0x4db930(0x159)](([_0x3d6fae,_0xff6fc7])=>({..._0xff6fc7,'name':_0xff6fc7[_0x4db930(0x19d)]??_0xff6fc7[_0x4db930(0x121)]??_0x3d6fae}));return[];}export async function getDatasetDetail(_0x5cca74){const _0x448662=a183_0x4443,_0x5d5064=/^\d+$/[_0x448662(0x149)](_0x5cca74)?'id':_0x448662(0x105),_0xd8b539=await apiRequest(_0x448662(0xf7)+_0x5d5064+'='+_0x5cca74);return _0xd8b539[_0x448662(0x162)];}export async function updateDrivenData(_0x409891){const _0x2925dd=a183_0x4443,_0x542053=await apiRequest(_0x2925dd(0x15b),{'method':_0x2925dd(0xe9),'body':_0x409891});return _0x542053[_0x2925dd(0x162)];}export async function getDatasetOperations(_0xff61a0){const _0x4a967a=a183_0x4443,_0x442cea=await getDatasetDetail(_0xff61a0),_0xf16dbd=normalizeDatasetOperations(_0x442cea[_0x4a967a(0x140)])[_0x4a967a(0x159)](_0x5ba932=>({'name':_0x5ba932[_0x4a967a(0x19d)]||_0x5ba932[_0x4a967a(0x121)],'displayName':_0x5ba932[_0x4a967a(0x185)]||_0x5ba932[_0x4a967a(0x19d)],'type':_0x5ba932[_0x4a967a(0xe4)],'method':_0x5ba932[_0x4a967a(0x135)],'path':_0x5ba932[_0x4a967a(0x1a5)],'enabled':_0x5ba932[_0x4a967a(0x1a3)]??!![],'requestFields':_0x5ba932[_0x4a967a(0x143)],'responseFields':_0x5ba932[_0x4a967a(0x1ad)]}));return{'dataset':{'id':_0x442cea['id']??_0x442cea[_0x4a967a(0x13e)],'name':_0x442cea[_0x4a967a(0x19d)],'code':_0x442cea[_0x4a967a(0x105)]||_0x442cea[_0x4a967a(0x177)],'tableName':_0x442cea[_0x4a967a(0x12d)]||_0x442cea[_0x4a967a(0xde)]?.[_0x4a967a(0x12d)]},'operations':_0xf16dbd};}export async function getOperationDetail(_0x190f38,_0x173f09,_0x19bc53){const _0x209735=a183_0x4443;let _0x31fc26=_0x173f09;if(!/^\d+$/[_0x209735(0x149)](_0x173f09)){const _0x54c376=await listDatasets(_0x190f38,{'code':_0x173f09}),_0x31977c=_0x54c376[_0x209735(0xf0)](_0x413e53=>_0x413e53['code']===_0x173f09||String(_0x413e53['id'])===_0x173f09);if(!_0x31977c)throw CliErrors[_0x209735(0x151)](_0x209735(0x13f)+_0x173f09);_0x31fc26=String(_0x31977c['id']);}const _0x241b38=await getDatasetDetail(_0x31fc26),_0x30226a=normalizeDatasetOperations(_0x241b38[_0x209735(0x140)])[_0x209735(0xf0)](_0x478458=>(_0x478458['name']||_0x478458['operationName'])===_0x19bc53);if(!_0x30226a)throw CliErrors['validation'](_0x209735(0x18d)+_0x19bc53+_0x209735(0x174)+_0x173f09);return{'dataset':{'id':_0x241b38['id']??_0x241b38[_0x209735(0x13e)],'name':_0x241b38[_0x209735(0x19d)],'code':_0x241b38[_0x209735(0x105)]||_0x241b38['modelCode'],'tableName':_0x241b38[_0x209735(0x12d)]||_0x241b38[_0x209735(0xde)]?.[_0x209735(0x12d)]},'operation':_0x30226a};}export async function startGenerateStandardPages(_0x164d55,_0x315558,_0xb320bd){const _0x5b00e0=a183_0x4443,_0x5d815f=await apiRequest(_0x5b00e0(0x111)+_0x315558+_0x5b00e0(0x14c),{'method':_0x5b00e0(0xe9),'body':{'appCode':_0x164d55,..._0xb320bd?.[_0x5b00e0(0x13d)]?{'clientOperationId':_0xb320bd[_0x5b00e0(0x13d)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5d815f['data'];}export async function getGenerateStandardPagesStatus(_0x55cd12,_0x2c7ef8,_0x40f5af){const _0x1780d5=a183_0x4443,_0x416d89=new URLSearchParams({'appCode':_0x55cd12});_0x40f5af[_0x1780d5(0x10d)]&&_0x416d89[_0x1780d5(0x10a)](_0x1780d5(0x10d),_0x40f5af['operationId']);_0x40f5af[_0x1780d5(0x13d)]&&_0x416d89['set'](_0x1780d5(0x13d),_0x40f5af[_0x1780d5(0x13d)]);const _0x5ca825=await apiRequest(_0x1780d5(0x111)+_0x2c7ef8+_0x1780d5(0x1a8)+_0x416d89[_0x1780d5(0x16f)]());return _0x5ca825[_0x1780d5(0x162)];}export async function getStandardPageStatus(_0x540d91,_0x180f4b){const _0x231b7e=a183_0x4443,_0x5c8f45=await apiRequest(_0x231b7e(0x111)+_0x180f4b+_0x231b7e(0x1ae)+encodeURIComponent(_0x540d91));return _0x5c8f45[_0x231b7e(0x162)];}export async function tryGetStandardPageStatus(_0x1ab930,_0x2a6d43){const _0x1e3ebf=a183_0x4443;try{return await getStandardPageStatus(_0x1ab930,_0x2a6d43);}catch(_0x251052){if(_0x251052 instanceof CliError&&_0x251052['code']==='api_error'&&/404|not found|non-json response/i[_0x1e3ebf(0x149)](_0x251052[_0x1e3ebf(0x163)]))return null;throw _0x251052;}}export async function syncStandardPages(_0x266571,_0x5da190){const _0x509762=a183_0x4443,_0x274874=await apiRequest(_0x509762(0x111)+_0x5da190+_0x509762(0x1a4),{'method':_0x509762(0xe9),'body':{'appCode':_0x266571}});return _0x274874[_0x509762(0x162)];}export async function getPageDetail(_0x5a739b){const _0x37680c=a183_0x4443,_0x523570=await apiRequest(_0x37680c(0x1b4)+_0x5a739b);if(!_0x523570[_0x37680c(0x162)])throw CliErrors[_0x37680c(0x151)](_0x37680c(0x19a)+_0x5a739b);return _0x523570[_0x37680c(0x162)];}export async function updatePage(_0x1db857,_0x747b7,_0x161b75,_0x3bc12d){const _0x1e0cb8=a183_0x4443,_0x2744af=await apiRequest(_0x1e0cb8(0x189),{'method':_0x1e0cb8(0xe9),'body':{'appCode':_0x1db857,'pageId':_0x747b7,'code':_0x161b75,'datasetIds':_0x3bc12d}});return _0x2744af[_0x1e0cb8(0x162)];}export function generateSdkCode(_0x466a33,_0xe88593,_0x1b51fa){const _0x3b8a45=a183_0x4443,_0x468848=_0x1b51fa?.[_0x3b8a45(0x133)]??!![],_0x518c3a='dataset_'+_0x466a33['code']?.[_0x3b8a45(0x1a1)](/-/g,'_'),_0xa84cb6=_0xe88593['name']||_0xe88593[_0x3b8a45(0x121)]||_0x3b8a45(0x131),_0x3ed23a=[];_0x468848&&_0x3ed23a[_0x3b8a45(0x10c)](_0x3b8a45(0x15d),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0x3ed23a[_0x3b8a45(0x10c)](_0x3b8a45(0x158)+_0x466a33[_0x3b8a45(0x19d)]+'\x20('+(_0x466a33[_0x3b8a45(0x12d)]||_0x3b8a45(0x16a))+')');if(_0xa84cb6===_0x3b8a45(0x131))_0x3ed23a[_0x3b8a45(0x10c)]('const\x20result\x20=\x20await\x20client.models.'+_0x518c3a+_0x3b8a45(0x183),'\x20\x20where:\x20{},',_0x3b8a45(0x134),'\x20\x20currentPage:\x201,',_0x3b8a45(0xd6));else{if(_0xa84cb6==='getOne')_0x3ed23a[_0x3b8a45(0x10c)](_0x3b8a45(0xe0)+_0x518c3a+_0x3b8a45(0x18c));else{if(_0xa84cb6===_0x3b8a45(0x173))_0x3ed23a['push'](_0x3b8a45(0xe0)+_0x518c3a+_0x3b8a45(0x17d));else{if(_0xa84cb6===_0x3b8a45(0x132))_0x3ed23a['push'](_0x3b8a45(0xe0)+_0x518c3a+_0x3b8a45(0xd7));else _0xa84cb6==='delete'||_0xa84cb6===_0x3b8a45(0xea)?_0x3ed23a[_0x3b8a45(0x10c)](_0x3b8a45(0xe0)+_0x518c3a+'.remove(id);'):_0x3ed23a[_0x3b8a45(0x10c)](_0x3b8a45(0xe0)+_0x518c3a+'.'+_0xa84cb6+_0x3b8a45(0x179));}}}return _0x3ed23a[_0x3b8a45(0x166)]('\x0a');}export function generateSqlCodeTemplate(_0x2cdb1a,_0xb47086){const _0x51d99d=a183_0x4443,_0xd09ecb=_0xb47086?.[_0x51d99d(0xfe)]??_0x51d99d(0x17e),_0x55e060=_0xb47086?.[_0x51d99d(0x133)]??!![],_0x3df706=[];return _0x3df706[_0x51d99d(0x10c)]('//\x20SQL:\x20'+_0x2cdb1a[_0x51d99d(0x1b0)]+'\x20('+_0x2cdb1a[_0x51d99d(0x16c)]+')'),_0xd09ecb===_0x51d99d(0x17e)?(_0x55e060&&_0x3df706[_0x51d99d(0x10c)](_0x51d99d(0x15d),'',_0x51d99d(0x139),''),_0x3df706[_0x51d99d(0x10c)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x51d99d(0xe3)+_0x2cdb1a[_0x51d99d(0x16c)]+'\x27,',_0x51d99d(0xe7),_0x51d99d(0xd6),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x51d99d(0x191))):_0x3df706[_0x51d99d(0x10c)](_0x51d99d(0xf3),_0x51d99d(0x11f),_0x51d99d(0xef),_0x51d99d(0x109)+_0x2cdb1a[_0x51d99d(0x16c)]+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x51d99d(0x118),'\x20\x20return\x20rows;','}'),_0x3df706['join']('\x0a');}export async function getErConfig(_0x1a2df2,_0x5aeb09){const _0x5b3b46=a183_0x4443,_0x3fb8d5=await apiRequest(_0x5b3b46(0x1ab),{'method':_0x5b3b46(0xe9),'body':{'appCode':_0x1a2df2,'dblinkId':_0x5aeb09},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x3fb8d5[_0x5b3b46(0x162)];}export async function getErRelationDetail(_0x37b283,_0x23cbfc){const _0x185869=a183_0x4443,_0x56b122=new URLSearchParams({'appCode':_0x37b283,'relationId':String(_0x23cbfc)});try{const _0x277921=await apiRequest(_0x185869(0x11e)+_0x56b122[_0x185869(0x16f)]());return _0x277921[_0x185869(0x162)]?.[_0x185869(0x160)]??null;}catch(_0x16e4a9){if(_0x16e4a9 instanceof CliError&&_0x16e4a9[_0x185869(0x105)]===_0x185869(0x122)&&(_0x16e4a9[_0x185869(0x164)]?.[_0x185869(0x175)](_0x185869(0x127))||_0x16e4a9[_0x185869(0x164)]===_0x185869(0x11a)&&_0x16e4a9['message']==='ER\x20relation\x20does\x20not\x20exist'))return null;throw _0x16e4a9;}}export async function createErRelation(_0x1a6792){const _0x54c277=a183_0x4443,_0x569f29=await apiRequest(_0x54c277(0xf2),{'method':'POST','body':_0x1a6792,'allowNonJsonSuccess':!![]});return _0x569f29[_0x54c277(0x162)];}export async function updateErRelation(_0x2966f1){const _0x5ad04c=a183_0x4443,_0xe18113=await apiRequest('/smartapi/question/er-config/cli/update-single',{'method':_0x5ad04c(0xe9),'body':_0x2966f1,'allowNonJsonSuccess':!![]});return _0xe18113['data'];}export async function deleteErRelation(_0x2eaf90){const _0x461c29=a183_0x4443,_0xbc81c1=await apiRequest(_0x461c29(0xec),{'method':_0x461c29(0xe9),'body':_0x2eaf90,'allowNonJsonSuccess':!![]});return _0xbc81c1['data'];}export async function updateErBusinessGroup(_0x2822ca){const _0x47c382=a183_0x4443,_0x19d913=await apiRequest('/smartapi/question/er-config/business-group/edit',{'method':_0x47c382(0xe9),'body':_0x2822ca,'allowNonJsonSuccess':!![]});return _0x19d913['data'];}function buildQuery(_0x4a0bc9){const _0x28d969=a183_0x4443,_0x2bcd11=new URLSearchParams();for(const [_0x1fbbda,_0x5ba48d]of Object['entries'](_0x4a0bc9)){if(_0x5ba48d===undefined||_0x5ba48d==='')continue;_0x2bcd11[_0x28d969(0x10a)](_0x1fbbda,String(_0x5ba48d));}const _0x3a5a8d=_0x2bcd11['toString']();return _0x3a5a8d?'?'+_0x3a5a8d:'';}export async function listAppConfigs(_0x27607d,_0x4dd868){const _0x4ac5c1=a183_0x4443,_0x47d712=await apiRequest(_0x4ac5c1(0x17b),{'method':_0x4ac5c1(0xe9),'body':{'appCode':_0x27607d,..._0x4dd868?.[_0x4ac5c1(0x107)]?{'key':_0x4dd868[_0x4ac5c1(0x107)]}:{},..._0x4dd868?.[_0x4ac5c1(0x147)]?{'tags':_0x4dd868['tags']}:{}}});return extractAppConfigList(_0x47d712[_0x4ac5c1(0x162)]);}export async function getAppConfigByKey(_0x43cbec,_0x295b1a){const _0x3afe34=a183_0x4443,_0x92a30d=await apiRequest(_0x3afe34(0x1b3)+buildQuery({'appCode':_0x43cbec,'key':_0x295b1a}));return _0x92a30d[_0x3afe34(0x162)]??null;}export async function createAppConfig(_0x4e0074){const _0x1530be=a183_0x4443,_0x1a6e80=await apiRequest(_0x1530be(0xf6),{'method':_0x1530be(0xe9),'body':{'appCode':_0x4e0074['appCode'],'key':_0x4e0074[_0x1530be(0x107)],'value':_0x4e0074[_0x1530be(0x130)],..._0x4e0074[_0x1530be(0x147)]?{'tags':_0x4e0074[_0x1530be(0x147)]}:{}}});return _0x1a6e80[_0x1530be(0x162)];}export async function updateAppConfig(_0x1fac6d){const _0x210e1b=a183_0x4443;await apiRequest('/smartapi/app-config/update',{'method':_0x210e1b(0xe9),'body':{'id':_0x1fac6d['id'],'appCode':_0x1fac6d['appCode'],'key':_0x1fac6d['key'],'value':_0x1fac6d['value'],..._0x1fac6d[_0x210e1b(0x147)]?{'tags':_0x1fac6d['tags']}:{}}});}export async function deleteAppConfig(_0x3c9b48){const _0x5230b4=a183_0x4443;await apiRequest(_0x5230b4(0x169),{'method':_0x5230b4(0xe9),'body':_0x3c9b48});}function extractAppConfigList(_0x319094){const _0x4e8054=a183_0x4443;if(Array[_0x4e8054(0xf4)](_0x319094))return _0x319094;if(_0x319094&&typeof _0x319094===_0x4e8054(0x138)&&Array['isArray'](_0x319094[_0x4e8054(0xeb)]))return _0x319094[_0x4e8054(0xeb)];return extractList(_0x319094);}export async function listDbLinks(_0x593c7a,_0x295bf2){const _0x5e8c9d=a183_0x4443,_0x10c763=await apiRequest(_0x5e8c9d(0x11c),{'method':_0x5e8c9d(0xe9),'body':{'appCode':_0x593c7a,'currentPage':_0x295bf2?.['currentPage']??0x1,'pageSize':_0x295bf2?.['pageSize']??0x64}});return{'items':extractList(_0x10c763[_0x5e8c9d(0x162)]),'paging':extractPaging(_0x10c763[_0x5e8c9d(0x162)])};}export async function getDbLinkInfo(_0x35ff54){const _0x30dfc9=a183_0x4443,_0x560f05=await apiRequest(_0x30dfc9(0x16e)+buildQuery({'id':_0x35ff54}));return _0x560f05[_0x30dfc9(0x162)];}export async function createDbLink(_0x238dbb){const _0x10320f=a183_0x4443,_0x345464=await apiRequest(_0x10320f(0x196),{'method':_0x10320f(0xe9),'body':_0x238dbb});return _0x345464[_0x10320f(0x162)];}export async function updateDbLink(_0x14fe3e){const _0x3c185a=a183_0x4443,_0x9fde6=await apiRequest('/smartapi/dblink/update',{'method':_0x3c185a(0xe9),'body':_0x14fe3e});return _0x9fde6['data'];}export async function deleteDbLink(_0x4e53b3){const _0x146667=a183_0x4443;await apiRequest(_0x146667(0x176),{'method':_0x146667(0xe9),'body':{'id':_0x4e53b3}});}export async function testDbLinkConnect(_0x7a7324){const _0x26e14c=a183_0x4443,_0x3c442d=await apiRequest(_0x26e14c(0x136)+buildQuery({'id':_0x7a7324}));return _0x3c442d[_0x26e14c(0x162)];}export async function startDbAnalysis(_0x915d1c,_0x1c5d15){const _0x549210=a183_0x4443,_0x246cc1=await apiRequest(_0x549210(0x154),{'method':_0x549210(0xe9),'body':{'dbLinkId':_0x915d1c,..._0x1c5d15&&_0x1c5d15['length']>0x0?{'tableNames':_0x1c5d15}:{}}}),_0x5028f3=_0x246cc1['data'];if(typeof _0x5028f3===_0x549210(0x10f))return _0x5028f3;if(_0x5028f3&&typeof _0x5028f3===_0x549210(0x138)&&typeof _0x5028f3['planId']===_0x549210(0x10f))return _0x5028f3[_0x549210(0x101)];return _0x5028f3!=null?String(_0x5028f3):'';}export async function cancelDbAnalysis(_0x51b909){const _0x2dae23=a183_0x4443;await apiRequest(_0x2dae23(0xed)+buildQuery({'planId':_0x51b909}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x4ee961){const _0x2cb03d=a183_0x4443,_0xc5468f=await apiRequest(_0x2cb03d(0x19f)+encodeURIComponent(_0x4ee961));return _0xc5468f[_0x2cb03d(0x162)];}export async function getDbAllTableList(_0x2a6aea,_0x19bc50){const _0x2be5f3=a183_0x4443,_0x1960ad=await apiRequest('/smartapi/dblink/getAllTableList'+buildQuery({'appCode':_0x2a6aea,'dbLinkId':_0x19bc50})),_0x45b3f6=_0x1960ad[_0x2be5f3(0x162)];if(Array[_0x2be5f3(0xf4)](_0x45b3f6))return _0x45b3f6;return extractList(_0x45b3f6);}export async function getDbTableDiff(_0x61873e,_0x35ec91,_0x16064f){const _0x144c91=a183_0x4443,_0x59060e=await apiRequest(_0x144c91(0x12a)+buildQuery({'appCode':_0x61873e,'dbLinkId':_0x35ec91,'pageIndex':_0x16064f?.[_0x144c91(0x19e)]??0x1,'pageSize':_0x16064f?.[_0x144c91(0x103)]??0x14,'tableName':_0x16064f?.[_0x144c91(0x12d)]})),_0x216a7d=_0x59060e[_0x144c91(0x162)];return{'totalCount':_0x216a7d?.[_0x144c91(0x18a)]??0x0,'physicalTableCount':_0x216a7d?.['physicalTableCount']??0x0,'datasetTableCount':_0x216a7d?.[_0x144c91(0x144)]??0x0,..._0x216a7d?.['summary']?{'summary':_0x216a7d['summary']}:{},'tableList':Array['isArray'](_0x216a7d?.[_0x144c91(0x152)])?_0x216a7d[_0x144c91(0x152)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x350c41=a183_0x4443,_0x1f0ada=await apiRequest(_0x350c41(0x126),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x100107=extractList(_0x1f0ada['data']),_0x370e81=extractPaging(_0x1f0ada['data']);return _0x370e81&&_0x370e81[_0x350c41(0x18a)]>REMOTE_APP_PAGE_SIZE&&console[_0x350c41(0x1aa)](_0x350c41(0x1af)+REMOTE_APP_PAGE_SIZE+_0x350c41(0x1a6)+_0x370e81[_0x350c41(0x18a)]+_0x350c41(0x13b)+_0x350c41(0xd8)),_0x100107;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x534bc0,_0x404aa7){const _0x43a937=a183_0x4443,_0xc41a61=Math[_0x43a937(0x12c)](Math[_0x43a937(0xd9)](_0x404aa7?.[_0x43a937(0x103)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0xe1c8fe=await apiRequest(_0x43a937(0x1b1),{'method':_0x43a937(0xe9),'body':{'appCode':_0x534bc0,'currentPage':_0x404aa7?.[_0x43a937(0xe2)]??0x1,'pageSize':_0xc41a61}});return{'items':extractList(_0xe1c8fe[_0x43a937(0x162)]),'paging':extractPaging(_0xe1c8fe[_0x43a937(0x162)])};}export async function getAppRole(_0x52a471){const _0x207dd4=a183_0x4443,_0x2c8c62=await apiRequest('/smartapi/permit/role/get-one'+buildQuery({'id':_0x52a471}));return _0x2c8c62[_0x207dd4(0x162)];}export async function createAppRole(_0x59173f){const _0x5c23bb=a183_0x4443,_0x35c704=await apiRequest(_0x5c23bb(0x187),{'method':_0x5c23bb(0xe9),'body':{'appCode':_0x59173f['appCode'],'roleName':_0x59173f[_0x5c23bb(0x19b)],'roleType':_0x5c23bb(0x142),..._0x59173f[_0x5c23bb(0x123)]?{'remark':_0x59173f[_0x5c23bb(0x123)]}:{}}});return _0x35c704['data'];}export async function updateAppRole(_0x4b5be9){const _0x22f080=a183_0x4443,_0x3681aa=await apiRequest(_0x22f080(0xf5),{'method':_0x22f080(0xe9),'body':{'id':_0x4b5be9['id'],'appCode':_0x4b5be9[_0x22f080(0x148)],..._0x4b5be9[_0x22f080(0x141)]?{'roleType':_0x4b5be9[_0x22f080(0x141)]}:{},..._0x4b5be9[_0x22f080(0x19b)]!==undefined?{'roleName':_0x4b5be9[_0x22f080(0x19b)]}:{},..._0x4b5be9[_0x22f080(0x123)]!==undefined?{'remark':_0x4b5be9[_0x22f080(0x123)]}:{},..._0x4b5be9[_0x22f080(0xf9)]?{'permits':_0x4b5be9[_0x22f080(0xf9)]}:{}}});return _0x3681aa[_0x22f080(0x162)];}export async function deleteAppRole(_0x1c4cdb){const _0x51038f=a183_0x4443;await apiRequest('/smartapi/permit/role/delete',{'method':_0x51038f(0xe9),'body':{'id':_0x1c4cdb}});}export async function listPermitRoles(_0x36bdd4,_0x47389f){const _0xfd9411=a183_0x4443,_0x4d0429=await apiRequest(_0xfd9411(0x14f),{'method':_0xfd9411(0xe9),'body':{'appCode':_0x36bdd4,..._0x47389f?.[_0xfd9411(0x18e)]!==undefined?{'needSelf':_0x47389f[_0xfd9411(0x18e)]}:{},..._0x47389f?.[_0xfd9411(0xfd)]!==undefined?{'needPublic':_0x47389f[_0xfd9411(0xfd)]}:{}}});return extractList(_0x4d0429[_0xfd9411(0x162)]);}export async function getRoleMenuResources(_0x526b65,_0x252eb0){const _0x2bcc37=a183_0x4443,_0x3beb03=await apiRequest(_0x2bcc37(0x14b),{'method':'POST','body':{'appCode':_0x526b65,'roleId':_0x252eb0}});return extractList(_0x3beb03[_0x2bcc37(0x162)]);}export async function getRoleApiResources(_0x14b212,_0x2b5fe0){const _0x14e1e6=await apiRequest('/smartapi/permit/resource/get-api-list',{'method':'POST','body':{'appCode':_0x14b212,'roleId':_0x2b5fe0}});return extractList(_0x14e1e6['data']);}export async function listRoleUsers(_0x4d74cd){const _0x6248da=a183_0x4443,_0x57186b=await apiRequest('/smartapi/permit/user-role/get-user-list',{'method':_0x6248da(0xe9),'body':{'appCode':_0x4d74cd}});return extractList(_0x57186b[_0x6248da(0x162)]);}export async function updateRoleUsers(_0x13969b,_0x35cd85){const _0x329e8a=a183_0x4443;await apiRequest(_0x329e8a(0xdd),{'method':_0x329e8a(0xe9),'body':{'appCode':_0x13969b,'roleList':_0x35cd85}});}export async function getPagePermit(_0x5a83db){const _0x4f0ea6=a183_0x4443,_0x3751bd=await apiRequest('/smartapi/permit/page/get-one'+buildQuery({'menuId':_0x5a83db}));return _0x3751bd[_0x4f0ea6(0x162)];}export async function savePagePermit(_0x246e04){const _0x1fa66d=a183_0x4443,_0x3c37ff=await apiRequest(_0x1fa66d(0x1b2),{'method':'POST','body':_0x246e04});return _0x3c37ff[_0x1fa66d(0x162)];}export async function getTenantMembers(_0x5e959b){const _0xc590d8=a183_0x4443,_0x4239ab=await apiRequest(_0xc590d8(0xfc)+buildQuery({'code':_0x5e959b})),_0x2ccf51=_0x4239ab[_0xc590d8(0x162)]??{},_0x1824af=Array[_0xc590d8(0xf4)](_0x2ccf51?.['userTenantRelationList'])?_0x2ccf51['userTenantRelationList']:[];return _0x1824af[_0xc590d8(0x131)](_0x25d1f6=>_0x25d1f6?.[_0xc590d8(0x182)]===_0xc590d8(0x115)||_0x25d1f6?.[_0xc590d8(0x182)]===undefined)[_0xc590d8(0x159)](_0x1cec23=>({'userId':Number(_0x1cec23['userId']??_0x1cec23['id']),'username':_0x1cec23['username'],'nickname':_0x1cec23[_0xc590d8(0x192)],'status':_0x1cec23[_0xc590d8(0x182)],'email':_0x1cec23[_0xc590d8(0x180)],'mobile':_0x1cec23[_0xc590d8(0x117)],'avatar':_0x1cec23[_0xc590d8(0x14d)]}))['filter'](_0x1a9df6=>Number[_0xc590d8(0x1a7)](_0x1a9df6[_0xc590d8(0x14a)])&&_0x1a9df6[_0xc590d8(0x14a)]>0x0);}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a184_0x3b66f3=a184_0x4387;(function(_0x1c8a0a,_0x48e94a){const _0x5c82e7=a184_0x4387,_0x2fb069=_0x1c8a0a();while(!![]){try{const _0x53dc41=-parseInt(_0x5c82e7(0x79))/0x1+parseInt(_0x5c82e7(0x75))/0x2+parseInt(_0x5c82e7(0x7c))/0x3+-parseInt(_0x5c82e7(0x80))/0x4+-parseInt(_0x5c82e7(0x7f))/0x5+parseInt(_0x5c82e7(0x7e))/0x6*(-parseInt(_0x5c82e7(0x7d))/0x7)+parseInt(_0x5c82e7(0x76))/0x8*(parseInt(_0x5c82e7(0x77))/0x9);if(_0x53dc41===_0x48e94a)break;else _0x2fb069['push'](_0x2fb069['shift']());}catch(_0x301eca){_0x2fb069['push'](_0x2fb069['shift']());}}}(a184_0x482b,0xcbcbb));import{resolve}from'node:path';function a184_0x4387(_0x496224,_0x4796bb){_0x496224=_0x496224-0x75;const _0x482b1e=a184_0x482b();let _0x43872b=_0x482b1e[_0x496224];return _0x43872b;}function a184_0x482b(){const _0x1e03e8=['15444424WLQUAE','9OdCAae','/bff','1514535BNKBzp','.rabetbase','bff.lock.json','4794876gmRRmW','583114POZKZq','12PiDYKd','1693495yoBbHX','4449148ABbOhC','876054yIdkQb'];a184_0x482b=function(){return _0x1e03e8;};return a184_0x482b();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a184_0x3b66f3(0x7a),LOCK_FILE_NAME=a184_0x3b66f3(0x7b),TRASH_DIR_NAME='bff-trash';export function loadBffProjectConfig(_0x575151,_0x6adeae){const _0x29900a=a184_0x3b66f3,_0x2d1961=resolve(_0x6adeae??findProjectRootDirectory()),_0x2731a1=DOT_DIR+_0x29900a(0x78),_0x32a8d4=_0x2731a1+'/'+_0x575151;return{'projectRoot':_0x2d1961,'appCode':_0x575151,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x2731a1,'scriptsRoot':_0x32a8d4,'scriptsRootDir':resolve(_0x2d1961,DOT_DIR,'bff',_0x575151),'lockFilePath':resolve(_0x2d1961,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2d1961,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a185_0x264b(_0x5d292e,_0x3c3c4a){_0x5d292e=_0x5d292e-0x155;const _0x3c5fb1=a185_0x3c5f();let _0x264b78=_0x3c5fb1[_0x5d292e];return _0x264b78;}const a185_0x2c1ac1=a185_0x264b;(function(_0x5089bb,_0x398843){const _0x50ad92=a185_0x264b,_0x520370=_0x5089bb();while(!![]){try{const _0x10e010=parseInt(_0x50ad92(0x163))/0x1*(parseInt(_0x50ad92(0x178))/0x2)+parseInt(_0x50ad92(0x170))/0x3*(parseInt(_0x50ad92(0x16f))/0x4)+-parseInt(_0x50ad92(0x159))/0x5*(parseInt(_0x50ad92(0x16b))/0x6)+parseInt(_0x50ad92(0x16d))/0x7*(-parseInt(_0x50ad92(0x155))/0x8)+-parseInt(_0x50ad92(0x17d))/0x9*(parseInt(_0x50ad92(0x174))/0xa)+parseInt(_0x50ad92(0x179))/0xb+parseInt(_0x50ad92(0x15f))/0xc*(-parseInt(_0x50ad92(0x16e))/0xd);if(_0x10e010===_0x398843)break;else _0x520370['push'](_0x520370['shift']());}catch(_0x113683){_0x520370['push'](_0x520370['shift']());}}}(a185_0x3c5f,0x8aa19));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=[a185_0x2c1ac1(0x168),a185_0x2c1ac1(0x16a),a185_0x2c1ac1(0x172)];function a185_0x3c5f(){const _0x38d2f4=['HOOK/','140JImJUr','5579453bITlVa','push','isDirectory','functionNode','144BRSVRF','get','776qGvVpb','map','endsWith','name','220LOmWXp','.js','after','all','isFile','includes','668784DiEHNd','set','trim','before','11983NbiOMH','functionName','ENOENT','alias','replace','COMMON','datasetCode','ENDPOINT','65244qHltLy','scriptsRootDir','9219siDLyS','65GVgKuJ','28xhXwoB','69117iAamrR','afterScriptId','HOOK','code','34130FWwapP','operationType','split'];a185_0x3c5f=function(){return _0x38d2f4;};return a185_0x3c5f();}export function normalizeBffType(_0x48a981){const _0x28bb7a=a185_0x2c1ac1;if(!_0x48a981)return undefined;const _0x37c401=_0x48a981[_0x28bb7a(0x161)]()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x28bb7a(0x15e)](_0x37c401)?_0x37c401:undefined;}async function scanJsFilesRecursively(_0x734f38,_0x554356){const _0x391863=a185_0x2c1ac1,_0x2f6744=[];try{const _0x19e264=await readdir(_0x734f38,{'withFileTypes':!![]});for(const _0x1cce30 of _0x19e264){const _0x217315=join(_0x734f38,_0x1cce30['name']);if(_0x1cce30[_0x391863(0x17b)]())_0x2f6744[_0x391863(0x17a)](...await scanJsFilesRecursively(_0x217315,_0x554356+'/'+_0x1cce30[_0x391863(0x158)]));else _0x1cce30['isFile']()&&_0x1cce30[_0x391863(0x158)][_0x391863(0x157)](_0x391863(0x15a))&&_0x2f6744[_0x391863(0x17a)]({'lockKey':_0x554356+'/'+_0x1cce30['name'][_0x391863(0x167)](/\.js$/,''),'filePath':_0x217315});}}catch(_0x253eec){if(_0x253eec[_0x391863(0x173)]!==_0x391863(0x165))throw _0x253eec;}return _0x2f6744;}async function scanFlatFunctions(_0x34eb26,_0x37c736){const _0x230f1d=a185_0x2c1ac1,_0x750ddc=join(_0x34eb26[_0x230f1d(0x16c)],_0x37c736),_0x4a0bf4=await scanJsFilesRecursively(_0x750ddc,_0x37c736);return _0x4a0bf4[_0x230f1d(0x156)](({lockKey:_0x477cd1,filePath:_0x57e105})=>({'type':_0x37c736,'name':_0x477cd1[_0x230f1d(0x176)]('/')['at'](-0x1)??'','filePath':_0x57e105,'lockKey':_0x477cd1}));}async function scanHookFunctions(_0x402aad){const _0x46e366=a185_0x2c1ac1,_0x370557=join(_0x402aad['scriptsRootDir'],_0x46e366(0x172)),_0x3bf3ee=[];try{const _0x3fffaf=await readdir(_0x370557,{'withFileTypes':!![]});for(const _0x294ddc of _0x3fffaf){if(!_0x294ddc['isDirectory']())continue;const _0x22883c=_0x294ddc[_0x46e366(0x158)],_0x7c2182=join(_0x370557,_0x22883c),_0x5bfdcc=await readdir(_0x7c2182,{'withFileTypes':!![]});for(const _0x35d6e1 of _0x5bfdcc){if(!_0x35d6e1['isDirectory']())continue;const _0x83d617=_0x35d6e1[_0x46e366(0x158)],_0x97f0f8=join(_0x7c2182,_0x83d617),_0x45097e=await readdir(_0x97f0f8,{'withFileTypes':!![]});for(const _0x4cbce4 of _0x45097e){if(!_0x4cbce4[_0x46e366(0x17b)]())continue;const _0x9a2552=_0x4cbce4[_0x46e366(0x158)],_0x55e786=join(_0x97f0f8,_0x9a2552),_0x5c5cb7=await readdir(_0x55e786,{'withFileTypes':!![]});for(const _0x257b50 of _0x5c5cb7){if(!_0x257b50[_0x46e366(0x15d)]()||!_0x257b50['name']['endsWith']('.js'))continue;const _0x17afd2=_0x257b50[_0x46e366(0x158)][_0x46e366(0x167)](/\.js$/,'');_0x3bf3ee['push']({'type':_0x46e366(0x172),'name':_0x17afd2,'filePath':join(_0x55e786,_0x257b50[_0x46e366(0x158)]),'lockKey':_0x46e366(0x177)+_0x22883c+'/'+_0x83d617+'/'+_0x9a2552+'/'+_0x17afd2,'alias':_0x22883c,'operationType':_0x83d617,'functionNode':_0x9a2552});}}}}}catch(_0x213d6a){if(_0x213d6a[_0x46e366(0x173)]!==_0x46e366(0x165))throw _0x213d6a;}return _0x3bf3ee;}export async function scanLocalBffFunctions(_0x23e357,_0x3c2d9f){const _0x3917bc=a185_0x2c1ac1;if(_0x3c2d9f==='COMMON'||_0x3c2d9f===_0x3917bc(0x16a))return scanFlatFunctions(_0x23e357,_0x3c2d9f);if(_0x3c2d9f==='HOOK')return scanHookFunctions(_0x23e357);const [_0x510fc6,_0x2a7f08,_0x1ba547]=await Promise[_0x3917bc(0x15c)]([scanFlatFunctions(_0x23e357,_0x3917bc(0x168)),scanFlatFunctions(_0x23e357,_0x3917bc(0x16a)),scanHookFunctions(_0x23e357)]);return[..._0x510fc6,..._0x2a7f08,..._0x1ba547];}export function resolveLocalFilePathFromLockKey(_0xadbe01,_0x1510f3){const _0x1066dd=a185_0x2c1ac1;return join(_0xadbe01[_0x1066dd(0x16c)],..._0x1510f3[_0x1066dd(0x176)]('/'))+_0x1066dd(0x15a);}export function createHookLocationMap(_0x58d41c){const _0x3a56ac=a185_0x2c1ac1,_0x4dcfdb=new Map();for(const _0x129e1d of _0x58d41c){_0x129e1d['beforeScriptId']&&_0x4dcfdb[_0x3a56ac(0x160)](_0x129e1d['beforeScriptId'],{'datasetCode':_0x129e1d['datasetCode'],'operationType':snakeToCamel(_0x129e1d[_0x3a56ac(0x175)]),'functionNode':_0x3a56ac(0x162)}),_0x129e1d['afterScriptId']&&_0x4dcfdb[_0x3a56ac(0x160)](_0x129e1d[_0x3a56ac(0x171)],{'datasetCode':_0x129e1d['datasetCode'],'operationType':snakeToCamel(_0x129e1d['operationType']),'functionNode':_0x3a56ac(0x15b)});}return _0x4dcfdb;}export function resolveRemoteScriptTarget(_0x2b02fb,_0x2daa4d,_0x328a3f,_0x4e30ec,_0x41d66b){const _0x583e9b=a185_0x2c1ac1,_0x567d9f=normalizeBffType(_0x2daa4d['scriptType']);if(!_0x567d9f||!_0x2daa4d[_0x583e9b(0x164)])return null;if(_0x567d9f===_0x583e9b(0x172)){const _0x4251c6=(_0x2daa4d['id']?_0x328a3f[_0x583e9b(0x17e)](_0x2daa4d['id']):undefined)??findHookLocationByRemoteId(_0x4e30ec,_0x2daa4d['id']);if(!_0x4251c6)return null;const _0x1351aa=_0x4251c6[_0x583e9b(0x166)]||_0x41d66b['get'](_0x4251c6[_0x583e9b(0x169)]),_0x407069=_0x1351aa??_0x4251c6[_0x583e9b(0x169)],_0x5ba169={..._0x4251c6,'alias':_0x1351aa},_0x32983c=_0x583e9b(0x177)+_0x407069+'/'+_0x5ba169[_0x583e9b(0x175)]+'/'+_0x5ba169[_0x583e9b(0x17c)]+'/'+_0x2daa4d[_0x583e9b(0x164)];return{'lockKey':_0x32983c,'filePath':resolveLocalFilePathFromLockKey(_0x2b02fb,_0x32983c),'type':_0x583e9b(0x172),'hookLocation':_0x5ba169};}const _0x1c1468=_0x567d9f+'/'+_0x2daa4d[_0x583e9b(0x164)];return{'lockKey':_0x1c1468,'filePath':resolveLocalFilePathFromLockKey(_0x2b02fb,_0x1c1468),'type':_0x567d9f};}export async function ensureParentDirectory(_0x1190a8){await mkdir(dirname(_0x1190a8),{'recursive':!![]});}export async function fileExists(_0x1f6ed8){try{return await access(_0x1f6ed8,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x541bb1){const _0x20b235=a185_0x2c1ac1;try{const _0x3b0e7c=await stat(_0x541bb1);return _0x3b0e7c[_0x20b235(0x17b)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x413eb2,_0x3acb95){const _0x2d9d85=a186_0x172d,_0x2bbc6b=_0x413eb2();while(!![]){try{const _0x1c5f9d=-parseInt(_0x2d9d85(0x1f2))/0x1+-parseInt(_0x2d9d85(0x1ef))/0x2+-parseInt(_0x2d9d85(0x1fa))/0x3+parseInt(_0x2d9d85(0x1eb))/0x4+parseInt(_0x2d9d85(0x1f3))/0x5*(parseInt(_0x2d9d85(0x1f8))/0x6)+-parseInt(_0x2d9d85(0x1ee))/0x7*(parseInt(_0x2d9d85(0x1f5))/0x8)+parseInt(_0x2d9d85(0x1ec))/0x9*(parseInt(_0x2d9d85(0x1ed))/0xa);if(_0x1c5f9d===_0x3acb95)break;else _0x2bbc6b['push'](_0x2bbc6b['shift']());}catch(_0x132b10){_0x2bbc6b['push'](_0x2bbc6b['shift']());}}}(a186_0x5e2f,0x6b0cd));function a186_0x172d(_0x188b9a,_0x1b5257){_0x188b9a=_0x188b9a-0x1eb;const _0x5e2fa2=a186_0x5e2f();let _0x172dff=_0x5e2fa2[_0x188b9a];return _0x172dff;}import{readFile}from'node:fs/promises';import a186_0x26e3d3 from'node:crypto';export function computeContentHash(_0x594249){const _0x2a8aa3=a186_0x172d;return a186_0x26e3d3[_0x2a8aa3(0x1f6)](_0x2a8aa3(0x1f1))[_0x2a8aa3(0x1f9)](_0x594249)[_0x2a8aa3(0x1f0)](_0x2a8aa3(0x1f7));}function a186_0x5e2f(){const _0x5e1585=['2320766uJArDL','843046LGljnV','digest','md5','619590UcxVSs','998840yLwtbs','utf8','8gThflD','createHash','hex','18IbuLld','update','1359024XoZWIL','2561232AXzrYN','108pDGUQu','853770vzSFEO'];a186_0x5e2f=function(){return _0x5e1585;};return a186_0x5e2f();}export async function computeFileHash(_0x4cb1a9){const _0x34ef46=a186_0x172d,_0x37da5e=await readFile(_0x4cb1a9,_0x34ef46(0x1f4));return computeContentHash(_0x37da5e);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a187_0x191e(_0x3d0d53,_0x5b5420){_0x3d0d53=_0x3d0d53-0x116;const _0xc9805e=a187_0xc980();let _0x191eea=_0xc9805e[_0x3d0d53];return _0x191eea;}function a187_0xc980(){const _0x148e29=['2564532QyTNXc','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','object','11053AGmASv','8327576erbmoe','12CvfZTq','lastSync','functions','43975DjhJAE','\x22.\x20','2079515nFyrcm','scriptsRoot','code','251517yiZMJJ','stringify','parse','3132kwSrmd','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','apps','utf8','26110611yfcNlO'];a187_0xc980=function(){return _0x148e29;};return a187_0xc980();}(function(_0x2b096c,_0x40ad3f){const _0xd68f63=a187_0x191e,_0x117614=_0x2b096c();while(!![]){try{const _0x2c86f7=parseInt(_0xd68f63(0x129))/0x1+-parseInt(_0xd68f63(0x121))/0x2+parseInt(_0xd68f63(0x119))/0x3+-parseInt(_0xd68f63(0x126))/0x4*(parseInt(_0xd68f63(0x116))/0x5)+parseInt(_0xd68f63(0x11c))/0x6*(-parseInt(_0xd68f63(0x124))/0x7)+parseInt(_0xd68f63(0x125))/0x8+parseInt(_0xd68f63(0x120))/0x9;if(_0x2c86f7===_0x40ad3f)break;else _0x117614['push'](_0x117614['shift']());}catch(_0x578bb8){_0x117614['push'](_0x117614['shift']());}}}(a187_0xc980,0xaebcf));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x22e4f1,_0x1a53ce,_0x173e10,_0x2aaa5b){const _0x2e26f2=a187_0x191e,_0x371ab2={'apps':_0x22e4f1['apps']&&typeof _0x22e4f1[_0x2e26f2(0x11e)]===_0x2e26f2(0x123)?_0x22e4f1[_0x2e26f2(0x11e)]:{}};let _0x92c2ea=_0x371ab2[_0x2e26f2(0x11e)][_0x1a53ce];if(!_0x92c2ea)return _0x92c2ea={'scriptsRoot':_0x173e10,'lastSync':'','functions':{}},_0x371ab2[_0x2e26f2(0x11e)][_0x1a53ce]=_0x92c2ea,{'lockData':_0x371ab2,'appLock':_0x92c2ea};if(!_0x92c2ea[_0x2e26f2(0x117)])_0x92c2ea['scriptsRoot']=_0x173e10;else{if(_0x92c2ea['scriptsRoot']!==_0x173e10)throw new Error(_0x2aaa5b+':\x20scriptsRoot\x20mismatch\x20—\x20'+('current\x20\x22'+_0x173e10+'\x22\x20vs\x20lock\x20\x22'+_0x92c2ea['scriptsRoot']+_0x2e26f2(0x12a))+_0x2e26f2(0x122));}return!_0x92c2ea[_0x2e26f2(0x128)]&&(_0x92c2ea[_0x2e26f2(0x128)]={}),!_0x92c2ea[_0x2e26f2(0x127)]&&(_0x92c2ea[_0x2e26f2(0x127)]=''),{'lockData':_0x371ab2,'appLock':_0x92c2ea};}export async function readBffLockFile(_0x4c061d){const _0x541ae9=a187_0x191e;try{const _0x961db2=await readFile(_0x4c061d,_0x541ae9(0x11f)),_0x6a111e=JSON[_0x541ae9(0x11b)](_0x961db2);return{'apps':_0x6a111e['apps']&&typeof _0x6a111e[_0x541ae9(0x11e)]===_0x541ae9(0x123)?_0x6a111e[_0x541ae9(0x11e)]:{}};}catch(_0xfbd5cc){if(_0xfbd5cc[_0x541ae9(0x118)]==='ENOENT')return null;throw new Error(_0x541ae9(0x11d)+String(_0xfbd5cc));}}export async function writeBffLockFile(_0x2f250c,_0x48a7b4){const _0x100503=a187_0x191e;await mkdir(dirname(_0x2f250c),{'recursive':!![]}),await writeFile(_0x2f250c,JSON[_0x100503(0x11a)](_0x48a7b4,null,0x2),_0x100503(0x11f));}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x511a25,_0x2f8a4f){const _0x32615b=a189_0x2d17,_0x58a246=_0x511a25();while(!![]){try{const _0x23fde8=parseInt(_0x32615b(0xa0))/0x1*(parseInt(_0x32615b(0x94))/0x2)+parseInt(_0x32615b(0x8d))/0x3*(-parseInt(_0x32615b(0x9f))/0x4)+-parseInt(_0x32615b(0xa1))/0x5*(-parseInt(_0x32615b(0xa2))/0x6)+-parseInt(_0x32615b(0x93))/0x7*(-parseInt(_0x32615b(0x8f))/0x8)+-parseInt(_0x32615b(0x9a))/0x9*(parseInt(_0x32615b(0x99))/0xa)+-parseInt(_0x32615b(0x90))/0xb*(-parseInt(_0x32615b(0x9c))/0xc)+-parseInt(_0x32615b(0x91))/0xd;if(_0x23fde8===_0x2f8a4f)break;else _0x58a246['push'](_0x58a246['shift']());}catch(_0xd62541){_0x58a246['push'](_0x58a246['shift']());}}}(a189_0x2cc2,0xd6004));export function snakeToCamel(_0x4db224){const _0x5cb75f=a189_0x2d17;return _0x4db224[_0x5cb75f(0x97)]()[_0x5cb75f(0x96)](/_([a-z])/g,(_0x419e65,_0x29dba4)=>_0x29dba4['toUpperCase']());}export function findHookLocationByRemoteId(_0x19b164,_0x40f994){const _0x815d56=a189_0x2d17;if(!_0x40f994)return undefined;for(const _0x5c8fd8 of Object[_0x815d56(0x8e)](_0x19b164)){if(_0x5c8fd8['remoteId']===_0x40f994&&_0x5c8fd8[_0x815d56(0x9d)]&&_0x5c8fd8[_0x815d56(0x98)]&&_0x5c8fd8[_0x815d56(0x9b)])return{'datasetCode':_0x5c8fd8[_0x815d56(0x9d)],'operationType':_0x5c8fd8[_0x815d56(0x98)],'functionNode':_0x5c8fd8['functionNode']};}return undefined;}function a189_0x2d17(_0x3f3e1f,_0x2a444a){_0x3f3e1f=_0x3f3e1f-0x8d;const _0x2cc279=a189_0x2cc2();let _0x2d171a=_0x2cc279[_0x3f3e1f];return _0x2d171a;}export function extractScriptDescription(_0x2dd396){const _0x42aa03=a189_0x2d17,_0x5281b4=_0x2dd396['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x5281b4?.[0x1]?.[_0x42aa03(0x95)]()||undefined;}function a189_0x2cc2(){const _0x2d85c8=['functionNode','588wLywKc','datasetCode','test','136772neOVdB','579499tKHZUG','2410peEdFY','18714DhqJqy','141HkDDej','values','120HNGyVR','179542mAxFkj','18807347KUMqsg','before','290885FMgnoq','6ColUDA','trim','replace','toLowerCase','operationType','1150aNMSFl','57492SZQyXL'];a189_0x2cc2=function(){return _0x2d85c8;};return a189_0x2cc2();}export function isValidBffFunctionName(_0x45f3d7){const _0x3d9cfb=a189_0x2d17;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x3d9cfb(0x9e)](_0x45f3d7);}export function normalizeHookFunctionNode(_0x114bc5){const _0x266ca5=a189_0x2d17;if(!_0x114bc5)return undefined;const _0x541e8f=_0x114bc5['trim']()[_0x266ca5(0x97)]();if(_0x541e8f===_0x266ca5(0x92)||_0x541e8f==='after')return _0x541e8f;return undefined;}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a190_0x5b3c(){const _0x201cb2=['\x22\x20under\x20app\x20\x22','toLowerCase','dbName','length','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','\x22\x20matches\x20multiple\x20databases:\x20','entries','join','14JSJMiF','3787014zWfOkm','2315346WhfZEb','2615576nCSKyi','706777zsCtiD','filter','set','No\x20database\x20matching\x20\x22','get','map','dbId','131542qekKJm','find','4MVLNNz','includes','14153337rpuZrt','db-','32755AmBPlY','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','isNaN'];a190_0x5b3c=function(){return _0x201cb2;};return a190_0x5b3c();}(function(_0x22b482,_0x235bc3){const _0x34b491=a190_0x2974,_0x22295a=_0x22b482();while(!![]){try{const _0x1787f0=-parseInt(_0x34b491(0x18f))/0x1+parseInt(_0x34b491(0x196))/0x2+parseInt(_0x34b491(0x18d))/0x3+-parseInt(_0x34b491(0x198))/0x4*(parseInt(_0x34b491(0x19c))/0x5)+-parseInt(_0x34b491(0x18c))/0x6+parseInt(_0x34b491(0x18b))/0x7*(-parseInt(_0x34b491(0x18e))/0x8)+parseInt(_0x34b491(0x19a))/0x9;if(_0x1787f0===_0x235bc3)break;else _0x22295a['push'](_0x22295a['shift']());}catch(_0xe021a8){_0x22295a['push'](_0x22295a['shift']());}}}(a190_0x5b3c,0x6486b));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x1ad841){const _0x55e3be=a190_0x2974;if(cache['has'](_0x1ad841))return cache[_0x55e3be(0x193)](_0x1ad841);const _0xe6fff9=await listDatasets(_0x1ad841),_0x21688a=new Map();for(const _0x216940 of _0xe6fff9){const _0x38db5b=_0x216940['dbtableConfig'];_0x38db5b?.[_0x55e3be(0x195)]!=null&&_0x21688a[_0x55e3be(0x191)](_0x38db5b[_0x55e3be(0x195)],_0x38db5b[_0x55e3be(0x1a1)]??_0x55e3be(0x19b)+_0x38db5b['dbId']);}const _0x2b334d=[..._0x21688a[_0x55e3be(0x189)]()][_0x55e3be(0x194)](([_0x5a2135,_0x251847])=>({'dbId':_0x5a2135,'dbName':_0x251847}));return cache[_0x55e3be(0x191)](_0x1ad841,_0x2b334d),_0x2b334d;}export async function resolveDb(_0x4e368c,_0xf6ad05){const _0x5afa0a=a190_0x2974,_0x2c626d=await listDatabases(_0x4e368c);if(_0x2c626d[_0x5afa0a(0x1a2)]===0x0)return{'resolved':[],'error':_0x5afa0a(0x1a3)+_0x4e368c+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0xf6ad05)return{'resolved':_0x2c626d};const _0x2db587=Number(_0xf6ad05);if(!Number[_0x5afa0a(0x19e)](_0x2db587)){const _0x35ec1f=_0x2c626d[_0x5afa0a(0x197)](_0x11acdd=>_0x11acdd[_0x5afa0a(0x195)]===_0x2db587);if(_0x35ec1f)return{'resolved':[_0x35ec1f]};}const _0x1a679d=_0xf6ad05[_0x5afa0a(0x1a0)](),_0x2e7e11=_0x2c626d[_0x5afa0a(0x190)](_0x3223e1=>_0x3223e1['dbName'][_0x5afa0a(0x1a0)]()[_0x5afa0a(0x199)](_0x1a679d));if(_0x2e7e11[_0x5afa0a(0x1a2)]>0x0)return{'resolved':_0x2e7e11};const _0x28066a=_0x2c626d[_0x5afa0a(0x194)](_0x54dfcd=>_0x54dfcd[_0x5afa0a(0x1a1)]+'\x20('+_0x54dfcd[_0x5afa0a(0x195)]+')')[_0x5afa0a(0x18a)](',\x20');return{'resolved':[],'error':_0x5afa0a(0x192)+_0xf6ad05+_0x5afa0a(0x19f)+_0x4e368c+'\x22.\x20Available:\x20'+_0x28066a+_0x5afa0a(0x19d)};}function a190_0x2974(_0x4ca20e,_0x2724e4){_0x4ca20e=_0x4ca20e-0x189;const _0x5b3cd5=a190_0x5b3c();let _0x2974b6=_0x5b3cd5[_0x4ca20e];return _0x2974b6;}export async function resolveOneDb(_0x416dd3,_0x550628){const _0x36d777=a190_0x2974,{resolved:_0xb738e,error:_0x2973a1}=await resolveDb(_0x416dd3,_0x550628);if(_0x2973a1)return{'db':null,'error':_0x2973a1};if(_0xb738e['length']===0x1)return{'db':_0xb738e[0x0]};if(!_0x550628){const _0x2ad4be=_0xb738e['map'](_0x192ab1=>_0x192ab1[_0x36d777(0x1a1)]+'\x20('+_0x192ab1[_0x36d777(0x195)]+')')['join'](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x2ad4be};}const _0x3b12d8=_0xb738e[_0x36d777(0x194)](_0x3786ad=>_0x3786ad[_0x36d777(0x1a1)]+'\x20('+_0x3786ad[_0x36d777(0x195)]+')')[_0x36d777(0x18a)](',\x20');return{'db':null,'error':'\x22'+_0x550628+_0x36d777(0x1a4)+_0x3b12d8+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0x223b74,_0x2a22a0){const _0x42b31b=a190_0x2974,_0xfc3348=await listDatabases(_0x223b74);return _0xfc3348[_0x42b31b(0x197)](_0x541c75=>_0x541c75[_0x42b31b(0x195)]===_0x2a22a0)?.[_0x42b31b(0x1a1)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a191_0xa8b82a=a191_0x145b;function a191_0x3465(){const _0x10c823=['28wGcyBp','.json','17669079YYcIVx','201513sRRaxg','1376070yoJPhs','.rabetbase','418544dZvAhC','page','F_OK','1101460ixYlfP','cwd','2082566NTucvS','4724288kFBruC','28lAjeqG'];a191_0x3465=function(){return _0x10c823;};return a191_0x3465();}(function(_0xf0b201,_0x4c86ca){const _0x1c458f=a191_0x145b,_0x22d673=_0xf0b201();while(!![]){try{const _0x488a90=parseInt(_0x1c458f(0x153))/0x1+-parseInt(_0x1c458f(0x158))/0x2+parseInt(_0x1c458f(0x150))/0x3*(parseInt(_0x1c458f(0x15a))/0x4)+parseInt(_0x1c458f(0x156))/0x5+parseInt(_0x1c458f(0x151))/0x6*(-parseInt(_0x1c458f(0x15b))/0x7)+-parseInt(_0x1c458f(0x159))/0x8+parseInt(_0x1c458f(0x15d))/0x9;if(_0x488a90===_0x4c86ca)break;else _0x22d673['push'](_0x22d673['shift']());}catch(_0x573cf1){_0x22d673['push'](_0x22d673['shift']());}}}(a191_0x3465,0x7fb39));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x12c1f2,_0x1df0ed=process[a191_0xa8b82a(0x157)]()){const _0x383699=a191_0xa8b82a,_0x298fbd=resolve(_0x1df0ed),_0x489f98=join(_0x298fbd,_0x383699(0x152),_0x383699(0x154));return{'projectRoot':_0x298fbd,'pagesBaseDir':_0x489f98,'appPagesDir':join(_0x489f98,_0x12c1f2),'lockFilePath':join(_0x298fbd,'.rabetbase','page.lock.json')};}export function buildPageFileName(_0x1f7a6c,_0x5e7fc4){const _0x26e1f1=a191_0xa8b82a;return _0x1f7a6c+'-'+String(_0x5e7fc4)['toUpperCase']()+_0x26e1f1(0x15c);}export function resolvePageFilePath(_0x29e1d8,_0x4e7cc1,_0x1e2297){return join(_0x29e1d8['appPagesDir'],buildPageFileName(_0x4e7cc1,_0x1e2297));}export async function ensureParentDirectory(_0x3bb97e){await mkdir(dirname(_0x3bb97e),{'recursive':!![]});}function a191_0x145b(_0x571d8f,_0x259b11){_0x571d8f=_0x571d8f-0x150;const _0x3465ab=a191_0x3465();let _0x145bfc=_0x3465ab[_0x571d8f];return _0x145bfc;}export async function fileExists(_0x1e0eae){const _0x37beb8=a191_0xa8b82a;try{return await access(_0x1e0eae,constants[_0x37beb8(0x155)]),!![];}catch{return![];}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xe27b59,_0x2a4498){const _0x4047c8=a192_0x5aae,_0x1cb3c8=_0xe27b59();while(!![]){try{const _0x519711=parseInt(_0x4047c8(0x93))/0x1+-parseInt(_0x4047c8(0x9c))/0x2+parseInt(_0x4047c8(0x94))/0x3*(parseInt(_0x4047c8(0x9d))/0x4)+parseInt(_0x4047c8(0x97))/0x5*(parseInt(_0x4047c8(0xa4))/0x6)+parseInt(_0x4047c8(0x9f))/0x7*(-parseInt(_0x4047c8(0x99))/0x8)+-parseInt(_0x4047c8(0x98))/0x9+parseInt(_0x4047c8(0xa3))/0xa*(parseInt(_0x4047c8(0x9a))/0xb);if(_0x519711===_0x2a4498)break;else _0x1cb3c8['push'](_0x1cb3c8['shift']());}catch(_0x10aa65){_0x1cb3c8['push'](_0x1cb3c8['shift']());}}}(a192_0x1a15,0x9e066));import a192_0x2f89e5 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x21a52b){const _0x39c0b7=a192_0x5aae;return JSON[_0x39c0b7(0x9b)](JSON[_0x39c0b7(0x96)](_0x21a52b),null,0x2)+'\x0a';}export function computePageContentHash(_0x56d2a0){const _0x4bce97=a192_0x5aae;return a192_0x2f89e5[_0x4bce97(0x95)]('md5')[_0x4bce97(0xa2)](_0x56d2a0)[_0x4bce97(0xa1)](_0x4bce97(0x9e));}export function computeSerializedSchemaHash(_0x463372){return computePageContentHash(serializePageSchemaForFile(_0x463372));}function a192_0x1a15(){const _0x4eae52=['parse','2235185dmuFLF','8960292yFiTAe','3189584UqCvkU','209kgpjcw','stringify','2541018WeFaRl','1348zYuCTD','hex','7LwkEbd','utf8','digest','update','463510kmTKXT','6GlRjjj','1219369BwdbOQ','6810qmkTqm','createHash'];a192_0x1a15=function(){return _0x4eae52;};return a192_0x1a15();}function a192_0x5aae(_0x450517,_0x5abbe5){_0x450517=_0x450517-0x93;const _0x1a15e8=a192_0x1a15();let _0x5aae6e=_0x1a15e8[_0x450517];return _0x5aae6e;}export async function computePageFileHash(_0x29ff73){const _0x81af6b=a192_0x5aae,_0x5e34fe=await readFile(_0x29ff73,_0x81af6b(0xa0));return computePageContentHash(_0x5e34fe);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5db0d6,_0x489c01){const _0x2ff5ce=a193_0x226f,_0x250dd3=_0x5db0d6();while(!![]){try{const _0x11ff0b=parseInt(_0x2ff5ce(0x1b8))/0x1*(-parseInt(_0x2ff5ce(0x1b1))/0x2)+parseInt(_0x2ff5ce(0x1af))/0x3*(parseInt(_0x2ff5ce(0x1ae))/0x4)+-parseInt(_0x2ff5ce(0x1b7))/0x5*(parseInt(_0x2ff5ce(0x1ad))/0x6)+parseInt(_0x2ff5ce(0x1a8))/0x7+-parseInt(_0x2ff5ce(0x1b5))/0x8*(parseInt(_0x2ff5ce(0x1ba))/0x9)+parseInt(_0x2ff5ce(0x1aa))/0xa*(-parseInt(_0x2ff5ce(0x1b3))/0xb)+parseInt(_0x2ff5ce(0x1b9))/0xc*(parseInt(_0x2ff5ce(0x1bc))/0xd);if(_0x11ff0b===_0x489c01)break;else _0x250dd3['push'](_0x250dd3['shift']());}catch(_0x1ba8b3){_0x250dd3['push'](_0x250dd3['shift']());}}}(a193_0x2f4e,0x856a3));import{mkdir,readFile,writeFile}from'node:fs/promises';function a193_0x2f4e(){const _0x1aff74=['pages','84450ijqliJ','lastSync','utf8','75612xEFiJV','4DOkFOx','2433741bxWSXB','object','55820tVvhYJ','parse','462vGiAzJ','apps','136iwxvZZ','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','280CapAgC','20ZCcgKV','6156qXizjZ','3195GwCQRs','ENOENT','12558BflpaH','6050093mmaTCs'];a193_0x2f4e=function(){return _0x1aff74;};return a193_0x2f4e();}function a193_0x226f(_0x3481b8,_0x5cea9e){_0x3481b8=_0x3481b8-0x1a8;const _0x2f4ec4=a193_0x2f4e();let _0x226f0d=_0x2f4ec4[_0x3481b8];return _0x226f0d;}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x249db8,_0x2097b7){const _0x1eb265=a193_0x226f,_0x4645bd={'apps':_0x249db8[_0x1eb265(0x1b4)]&&typeof _0x249db8[_0x1eb265(0x1b4)]===_0x1eb265(0x1b0)?_0x249db8[_0x1eb265(0x1b4)]:{}};let _0x22e3a4=_0x4645bd[_0x1eb265(0x1b4)][_0x2097b7];if(!_0x22e3a4)return _0x22e3a4={'lastSync':'','pages':{}},_0x4645bd[_0x1eb265(0x1b4)][_0x2097b7]=_0x22e3a4,{'lockData':_0x4645bd,'appLock':_0x22e3a4};return!_0x22e3a4[_0x1eb265(0x1ab)]&&(_0x22e3a4[_0x1eb265(0x1ab)]=''),(!_0x22e3a4[_0x1eb265(0x1a9)]||typeof _0x22e3a4['pages']!==_0x1eb265(0x1b0))&&(_0x22e3a4[_0x1eb265(0x1a9)]={}),{'lockData':_0x4645bd,'appLock':_0x22e3a4};}export async function readPageLockFile(_0x5e3461){const _0x3a98a9=a193_0x226f;try{const _0x4931d4=await readFile(_0x5e3461,_0x3a98a9(0x1ac)),_0x39acf1=JSON[_0x3a98a9(0x1b2)](_0x4931d4);return{'apps':_0x39acf1[_0x3a98a9(0x1b4)]&&typeof _0x39acf1[_0x3a98a9(0x1b4)]===_0x3a98a9(0x1b0)?_0x39acf1[_0x3a98a9(0x1b4)]:{}};}catch(_0xaf96dd){if(_0xaf96dd['code']===_0x3a98a9(0x1bb))return null;throw new Error(_0x3a98a9(0x1b6)+String(_0xaf96dd));}}export async function writePageLockFile(_0xbc657f,_0x3608ab){const _0x29a1ec=a193_0x226f;await mkdir(dirname(_0xbc657f),{'recursive':!![]}),await writeFile(_0xbc657f,JSON['stringify'](_0x3608ab,null,0x2),_0x29a1ec(0x1ac));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a195_0x42fc83=a195_0x3fab;(function(_0x30f2d5,_0x4de394){const _0x33a5d9=a195_0x3fab,_0x4b9a15=_0x30f2d5();while(!![]){try{const _0x42ca93=parseInt(_0x33a5d9(0xfb))/0x1*(-parseInt(_0x33a5d9(0xf6))/0x2)+parseInt(_0x33a5d9(0x104))/0x3*(-parseInt(_0x33a5d9(0xf8))/0x4)+-parseInt(_0x33a5d9(0xf9))/0x5*(-parseInt(_0x33a5d9(0xf3))/0x6)+-parseInt(_0x33a5d9(0x100))/0x7*(parseInt(_0x33a5d9(0xf7))/0x8)+parseInt(_0x33a5d9(0xff))/0x9*(-parseInt(_0x33a5d9(0x103))/0xa)+-parseInt(_0x33a5d9(0xf5))/0xb*(-parseInt(_0x33a5d9(0xf4))/0xc)+-parseInt(_0x33a5d9(0x101))/0xd*(-parseInt(_0x33a5d9(0xfd))/0xe);if(_0x42ca93===_0x4de394)break;else _0x4b9a15['push'](_0x4b9a15['shift']());}catch(_0x283271){_0x4b9a15['push'](_0x4b9a15['shift']());}}}(a195_0x3e9f,0xcddc4));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a195_0x3e9f(){const _0x1b0f3b=['852UnmCsk','74151MhLtow','179606sMegyc','24RrMwbf','4VnHoBo','26735JaxgMO','sql-trash','17HPxoKT','/sql','14bhIFwb','sql','1359oaXvMZ','422737RlyKvR','41006225kXBbLS','sql.lock.json','8790voHfkh','3842079DtfGVm','372hkOVXf'];a195_0x3e9f=function(){return _0x1b0f3b;};return a195_0x3e9f();}function a195_0x3fab(_0x21adbe,_0x34a39c){_0x21adbe=_0x21adbe-0xf3;const _0x3e9f69=a195_0x3e9f();let _0x3fabd6=_0x3e9f69[_0x21adbe];return _0x3fabd6;}const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a195_0x42fc83(0x102),TRASH_DIR_NAME=a195_0x42fc83(0xfa);export function loadSqlProjectConfig(_0x492072,_0x4c1544){const _0x287843=a195_0x42fc83,_0x11aa8c=resolve(_0x4c1544??findProjectRootDirectory()),_0x59cec4=DOT_DIR+_0x287843(0xfc),_0x3062ce=_0x59cec4+'/'+_0x492072;return{'projectRoot':_0x11aa8c,'appCode':_0x492072,'sqlWorkspaceRoot':_0x59cec4,'sqlRoot':_0x3062ce,'sqlRootDir':resolve(_0x11aa8c,DOT_DIR,_0x287843(0xfe),_0x492072),'lockFilePath':resolve(_0x11aa8c,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x11aa8c,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1dfd5c,_0x2a992c){const _0x498b5d=a196_0x293a,_0x167e64=_0x1dfd5c();while(!![]){try{const _0x25d595=-parseInt(_0x498b5d(0x19a))/0x1+-parseInt(_0x498b5d(0x196))/0x2+-parseInt(_0x498b5d(0x191))/0x3*(parseInt(_0x498b5d(0x19b))/0x4)+-parseInt(_0x498b5d(0x1ab))/0x5+parseInt(_0x498b5d(0x19e))/0x6+-parseInt(_0x498b5d(0x1af))/0x7*(-parseInt(_0x498b5d(0x1a7))/0x8)+parseInt(_0x498b5d(0x199))/0x9;if(_0x25d595===_0x2a992c)break;else _0x167e64['push'](_0x167e64['shift']());}catch(_0x48b668){_0x167e64['push'](_0x167e64['shift']());}}}(a196_0x413c,0xae4f1));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x5ddf6f){const _0x7459d9=a196_0x293a;if(_0x5ddf6f===_0x7459d9(0x1a2))return _0x7459d9(0x1a9);if(_0x5ddf6f==='.xml')return _0x7459d9(0x1a6);return undefined;}async function scanSqlFilesRecursively(_0xea7974,_0x37b46c){const _0x58be15=a196_0x293a,_0x12515d=[];try{const _0x331fad=await readdir(_0xea7974,{'withFileTypes':!![]});for(const _0x2a92b1 of _0x331fad){const _0x1f3651=join(_0xea7974,_0x2a92b1[_0x58be15(0x1aa)]);if(_0x2a92b1[_0x58be15(0x1a5)]()){_0x12515d[_0x58be15(0x1ac)](...await scanSqlFilesRecursively(_0x1f3651,_0x37b46c));continue;}if(!_0x2a92b1[_0x58be15(0x1ad)]())continue;const _0x309c1a=extname(_0x2a92b1['name'])[_0x58be15(0x194)](),_0x3865af=extensionToMode(_0x309c1a);if(!_0x3865af)continue;const _0x317ca4=relative(_0x37b46c,_0x1f3651)[_0x58be15(0x1a4)](/\\/g,'/'),_0x213d7a=_0x317ca4[_0x58be15(0x1a0)]('/')['filter'](Boolean),_0x2eac6a=parseSqlPath(_0x213d7a,_0x2a92b1[_0x58be15(0x1aa)],_0x309c1a);if(!_0x2eac6a)continue;_0x12515d[_0x58be15(0x1ac)]({'sqlCode':_0x2eac6a[_0x58be15(0x198)],'sqlName':_0x2eac6a['sqlName'],'dbDirectory':_0x213d7a[0x0],'filePath':_0x1f3651,'relativePath':_0x317ca4,'lockKey':_0x2eac6a[_0x58be15(0x198)],'mode':_0x3865af});}}catch(_0x12c22f){if(_0x12c22f[_0x58be15(0x19f)]!==_0x58be15(0x1ae))throw _0x12c22f;}return _0x12515d;}function a196_0x293a(_0x362f8f,_0x4016f4){_0x362f8f=_0x362f8f-0x191;const _0x413c04=a196_0x413c();let _0x293a6b=_0x413c04[_0x362f8f];return _0x293a6b;}export async function scanLocalSqlQueries(_0x3d45b4){const _0x5eac3f=a196_0x293a;return scanSqlFilesRecursively(_0x3d45b4[_0x5eac3f(0x1a3)],_0x3d45b4[_0x5eac3f(0x1a3)]);}export function resolveLocalSqlFilePath(_0x5e4b60,_0x5a0592,_0x1374e8){const _0x1d6496=a196_0x293a,_0x542d1b=_0x1374e8?.[_0x1d6496(0x197)]||(_0x1374e8?.[_0x1d6496(0x192)]||_0x1374e8?.[_0x1d6496(0x193)]?buildSqlRelativePath(_0x5a0592,_0x1374e8?.[_0x1d6496(0x192)],_0x1374e8?.[_0x1d6496(0x193)],_0x1374e8?.[_0x1d6496(0x19c)]||_0x1d6496(0x1a9),_0x1374e8?.[_0x1d6496(0x195)]):buildDefaultSqlFileName(_0x5a0592,_0x1374e8?.[_0x1d6496(0x19c)]||_0x1d6496(0x1a9)));return join(_0x5e4b60[_0x1d6496(0x1a3)],_0x542d1b);}export async function directoryExists(_0x519e27){const _0xa1f6db=a196_0x293a;try{const _0x594aa7=await stat(_0x519e27);return _0x594aa7[_0xa1f6db(0x1a5)]();}catch{return![];}}function parseSqlPath(_0x56a953,_0x3dd431,_0x1a6203){const _0x3bd46a=a196_0x293a,_0x1b9367=_0x3dd431[_0x3bd46a(0x19d)](0x0,-_0x1a6203[_0x3bd46a(0x1a1)]);if(_0x56a953[_0x3bd46a(0x1a1)]<0x2)return null;const _0x3192a8=_0x1b9367[_0x3bd46a(0x1a8)]('_');if(_0x3192a8<=0x0||_0x3192a8>=_0x1b9367[_0x3bd46a(0x1a1)]-0x1)return null;const _0x21b975=_0x1b9367[_0x3bd46a(0x19d)](0x0,_0x3192a8);if(!isLikelySqlCode(_0x21b975))return null;return{'sqlCode':_0x21b975,'sqlName':_0x1b9367[_0x3bd46a(0x19d)](_0x3192a8+0x1)};}function a196_0x413c(){const _0x288705=['1272236tLEzpQ','4fGcMHJ','mode','slice','8039946hIbnVy','code','split','length','.sql','sqlRootDir','replace','isDirectory','mybatisXml','8QssgwD','indexOf','sql','name','3010805MwvTMk','push','isFile','ENOENT','9407377WhcDCc','1020747TnSKcV','sqlName','dbName','toLowerCase','dbId','944396plUmkL','path','sqlCode','6452199HKHpHf'];a196_0x413c=function(){return _0x288705;};return a196_0x413c();}function isLikelySqlCode(_0xb6e3cd){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0xb6e3cd);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a56a1,_0x54ee95){const _0x2c6631=a197_0x47e7,_0x7f9f2a=_0x2a56a1();while(!![]){try{const _0x333b4a=parseInt(_0x2c6631(0x9f))/0x1+-parseInt(_0x2c6631(0x99))/0x2*(parseInt(_0x2c6631(0x90))/0x3)+-parseInt(_0x2c6631(0x9b))/0x4+parseInt(_0x2c6631(0x91))/0x5*(parseInt(_0x2c6631(0x94))/0x6)+-parseInt(_0x2c6631(0xa0))/0x7+-parseInt(_0x2c6631(0x9d))/0x8*(-parseInt(_0x2c6631(0x96))/0x9)+parseInt(_0x2c6631(0x9a))/0xa*(parseInt(_0x2c6631(0x97))/0xb);if(_0x333b4a===_0x54ee95)break;else _0x7f9f2a['push'](_0x7f9f2a['shift']());}catch(_0x2b9228){_0x7f9f2a['push'](_0x7f9f2a['shift']());}}}(a197_0x9b7b,0x25641));import{readFile}from'node:fs/promises';import a197_0xb1f286 from'node:crypto';function a197_0x9b7b(){const _0x398616=['md5','9OZWthB','57101ASailJ','utf8','186nezlSA','470MKMSbj','560740NNxMNC','update','1219272JPRkTw','hex','81708YdVTJa','770441lQjkcl','3867YEzFwP','160srhObD','createHash','digest','8472xylntV'];a197_0x9b7b=function(){return _0x398616;};return a197_0x9b7b();}export function computeSqlContentHash(_0xf71626){const _0x341af6=a197_0x47e7;return a197_0xb1f286[_0x341af6(0x92)](_0x341af6(0x95))[_0x341af6(0x9c)](_0xf71626)[_0x341af6(0x93)](_0x341af6(0x9e));}function a197_0x47e7(_0x2c1fa9,_0x41457b){_0x2c1fa9=_0x2c1fa9-0x90;const _0x9b7bca=a197_0x9b7b();let _0x47e722=_0x9b7bca[_0x2c1fa9];return _0x47e722;}export async function computeSqlFileHash(_0x163435){const _0x465120=a197_0x47e7,_0xa08718=await readFile(_0x163435,_0x465120(0x98));return computeSqlContentHash(_0xa08718);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a198_0x2d84(_0x192bb1,_0x5ac884){_0x192bb1=_0x192bb1-0x8f;const _0x3d1d58=a198_0x3d1d();let _0x2d8432=_0x3d1d58[_0x192bb1];return _0x2d8432;}(function(_0x40b2d3,_0x5545be){const _0x280328=a198_0x2d84,_0x57e1e6=_0x40b2d3();while(!![]){try{const _0x4f4efe=-parseInt(_0x280328(0x9b))/0x1+-parseInt(_0x280328(0x96))/0x2*(-parseInt(_0x280328(0xa2))/0x3)+parseInt(_0x280328(0x93))/0x4*(-parseInt(_0x280328(0x8f))/0x5)+parseInt(_0x280328(0x91))/0x6+parseInt(_0x280328(0x95))/0x7*(parseInt(_0x280328(0x99))/0x8)+-parseInt(_0x280328(0xa3))/0x9+-parseInt(_0x280328(0x90))/0xa*(-parseInt(_0x280328(0x9f))/0xb);if(_0x4f4efe===_0x5545be)break;else _0x57e1e6['push'](_0x57e1e6['shift']());}catch(_0x526153){_0x57e1e6['push'](_0x57e1e6['shift']());}}}(a198_0x3d1d,0x1a35f));function a198_0x3d1d(){const _0x349ccb=['2mHOeje','code','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','16CwLrQO','sqls','74778xVbkUu','lastSync','sqlRoot','utf8','11AMhyLa','apps','\x22\x20vs\x20lock\x20\x22','346713ZKqJIe','875646HLErEj','25KGgZzi','1413550OKXqgN','836034gSqmOO','\x22.\x20','120464KKJiHY',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','118111yDNSPS'];a198_0x3d1d=function(){return _0x349ccb;};return a198_0x3d1d();}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x159b8d,_0x25aca5,_0x40f4ea,_0x323268){const _0x5e7563=a198_0x2d84,_0x33db70=_0x159b8d??createEmptySqlLock();let _0x55d716=_0x33db70['apps'][_0x25aca5];if(!_0x55d716)return _0x55d716={'sqlRoot':_0x40f4ea,'lastSync':'','sqls':{}},_0x33db70[_0x5e7563(0xa0)][_0x25aca5]=_0x55d716,{'lockData':_0x33db70,'appLock':_0x55d716};if(!_0x55d716[_0x5e7563(0x9d)])_0x55d716['sqlRoot']=_0x40f4ea;else{if(_0x55d716[_0x5e7563(0x9d)]!==_0x40f4ea)throw new Error(_0x323268+_0x5e7563(0x94)+_0x40f4ea+_0x5e7563(0xa1)+_0x55d716['sqlRoot']+_0x5e7563(0x92)+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x55d716[_0x5e7563(0x9a)]&&(_0x55d716[_0x5e7563(0x9a)]={}),!_0x55d716[_0x5e7563(0x9c)]&&(_0x55d716[_0x5e7563(0x9c)]=''),{'lockData':_0x33db70,'appLock':_0x55d716};}export async function readSqlLockFile(_0x26fcdc){const _0x83adb5=a198_0x2d84;try{const _0x1c1c28=await readFile(_0x26fcdc,'utf8');return JSON['parse'](_0x1c1c28);}catch(_0x312e35){if(_0x312e35[_0x83adb5(0x97)]==='ENOENT')return null;throw new Error(_0x83adb5(0x98)+String(_0x312e35));}}export async function writeSqlLockFile(_0x3158a8,_0x2c594e){const _0xbfd2a0=a198_0x2d84;await mkdir(dirname(_0x3158a8),{'recursive':!![]}),await writeFile(_0x3158a8,JSON['stringify'](_0x2c594e,null,0x2),_0xbfd2a0(0x9e));}
|