@lovrabet/rabetbase-cli 2.3.7-beta.4 → 2.3.8-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/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/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/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(_0x22ae6f,_0x48cdfe){const _0x3f3060=a185_0x51f4,_0x5552b7=_0x22ae6f();while(!![]){try{const _0x14ace0=parseInt(_0x3f3060(0x109))/0x1+parseInt(_0x3f3060(0x141))/0x2+parseInt(_0x3f3060(0x159))/0x3*(-parseInt(_0x3f3060(0xc8))/0x4)+-parseInt(_0x3f3060(0x11e))/0x5*(parseInt(_0x3f3060(0x12b))/0x6)+parseInt(_0x3f3060(0xca))/0x7*(parseInt(_0x3f3060(0xce))/0x8)+parseInt(_0x3f3060(0x11d))/0x9*(parseInt(_0x3f3060(0xf2))/0xa)+-parseInt(_0x3f3060(0x132))/0xb*(parseInt(_0x3f3060(0x105))/0xc);if(_0x14ace0===_0x48cdfe)break;else _0x5552b7['push'](_0x5552b7['shift']());}catch(_0x32c815){_0x5552b7['push'](_0x5552b7['shift']());}}}(a185_0x516b,0x6bfe6));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(_0x37f063){_activeCookie=_0x37f063||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(_0x47a8eb,_0x5a1286){const _0xaddfdc=a185_0x51f4,_0x10eb5e=_0x5a1286 instanceof Error?_0x5a1286[_0xaddfdc(0x18a)]:String(_0x5a1286);return CliErrors[_0xaddfdc(0x130)](_0xaddfdc(0x162)+_0x47a8eb+(_0x10eb5e?'\x20('+_0x10eb5e+')':''),_0xaddfdc(0x154));}async function apiRequest(_0x445ef,_0x1212ee={}){const _0x5c74c7=a185_0x51f4,{method:method=_0x5c74c7(0x12a),body:_0x508dcc,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x1212ee,_0x45e888=useRuntime?getRuntimeDomain():getApiDomain(),_0x70e019=_activeCookie||getCookie(),_0x436697=''+_0x45e888+_0x445ef,_0x498ec1=new AbortController(),_0x4ee018=setTimeout(()=>_0x498ec1['abort'](),timeout);try{const _0x7c5e8e=await fetch(_0x436697,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x70e019,'X-Invoke-Source':_0x5c74c7(0x158),...headers},'body':_0x508dcc?JSON[_0x5c74c7(0x160)](_0x508dcc):undefined,'signal':_0x498ec1[_0x5c74c7(0x137)]});let _0x5cb753;try{_0x5cb753=await _0x7c5e8e[_0x5c74c7(0x164)]();}catch(_0x179b99){if(_0x179b99 instanceof Error&&_0x179b99[_0x5c74c7(0x17b)]===_0x5c74c7(0xd3))throw CliErrors['apiError'](_0x5c74c7(0xfe)+_0x436697);if(_0x7c5e8e['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x5c74c7(0x130)](_0x5c74c7(0xdb)+_0x7c5e8e['status']+')',_0x7c5e8e[_0x5c74c7(0xd0)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x7c5e8e['ok']||_0x5cb753[_0x5c74c7(0x163)]===![])throw CliErrors[_0x5c74c7(0x130)](_0x5cb753[_0x5c74c7(0x156)]||_0x5cb753[_0x5c74c7(0x18a)]||_0x5c74c7(0x15f)+_0x7c5e8e[_0x5c74c7(0xd0)],_0x5cb753['errorCode']?'API\x20error\x20code:\x20'+_0x5cb753['errorCode']:undefined);return _0x5cb753;}catch(_0x11d86d){if(_0x11d86d instanceof CliError)throw _0x11d86d;if(_0x11d86d instanceof Error&&_0x11d86d[_0x5c74c7(0x17b)]===_0x5c74c7(0xd3))throw CliErrors[_0x5c74c7(0x130)]('Request\x20timeout:\x20'+_0x436697);throw createFetchFailureError(_0x436697,_0x11d86d);}finally{clearTimeout(_0x4ee018);}}async function apiFormRequest(_0x3899b7,_0x4f7662,_0x887273={}){const _0x1d0c32=a185_0x51f4,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x887273,_0xba6077=_activeCookie||getCookie(),_0x51bb83=''+getApiDomain()+_0x3899b7,_0x3945c1=new AbortController(),_0x236589=setTimeout(()=>_0x3945c1[_0x1d0c32(0x16f)](),timeout);try{const _0x2579b5=await fetch(_0x51bb83,{'method':_0x1d0c32(0x111),'headers':{'Cookie':_0xba6077,'X-Invoke-Source':_0x1d0c32(0x158)},'body':_0x4f7662,'signal':_0x3945c1[_0x1d0c32(0x137)]});let _0x315d03;try{_0x315d03=await _0x2579b5[_0x1d0c32(0x164)]();}catch(_0x90a38){if(_0x90a38 instanceof Error&&_0x90a38['name']===_0x1d0c32(0xd3))throw CliErrors[_0x1d0c32(0x130)]('Request\x20timeout:\x20'+_0x51bb83);throw CliErrors[_0x1d0c32(0x130)](_0x1d0c32(0xdb)+_0x2579b5[_0x1d0c32(0xd0)]+')',_0x2579b5[_0x1d0c32(0xd0)]>=0x190?_0x1d0c32(0xcc):undefined);}if(!_0x2579b5['ok']||_0x315d03[_0x1d0c32(0x163)]===![])throw CliErrors[_0x1d0c32(0x130)](_0x315d03[_0x1d0c32(0x156)]||_0x315d03[_0x1d0c32(0x18a)]||_0x1d0c32(0x15f)+_0x2579b5[_0x1d0c32(0xd0)],_0x315d03['errorCode']?'API\x20error\x20code:\x20'+_0x315d03[_0x1d0c32(0x11c)]:undefined);return _0x315d03;}catch(_0x3c3fb9){if(_0x3c3fb9 instanceof CliError)throw _0x3c3fb9;if(_0x3c3fb9 instanceof Error&&_0x3c3fb9[_0x1d0c32(0x17b)]===_0x1d0c32(0xd3))throw CliErrors[_0x1d0c32(0x130)](_0x1d0c32(0xfe)+_0x51bb83);throw createFetchFailureError(_0x51bb83,_0x3c3fb9);}finally{clearTimeout(_0x236589);}}export async function uploadDevelopmentFile(_0x47d5cc,_0x3e30e6){const _0x41239f=a185_0x51f4,_0x5c4b61=await readFile(_0x3e30e6),_0x3feddb=new FormData();_0x3feddb[_0x41239f(0x14d)](_0x41239f(0x14c),_0x47d5cc),_0x3feddb[_0x41239f(0x14d)]('file',new Blob([new Uint8Array(_0x5c4b61)]),basename(_0x3e30e6));const _0x5512b7=await apiFormRequest(_0x41239f(0xbd),_0x3feddb);return _0x5512b7[_0x41239f(0xc6)];}function a185_0x51f4(_0x4fdc08,_0x5c1a93){_0x4fdc08=_0x4fdc08-0xaa;const _0x516bc3=a185_0x516b();let _0x51f44c=_0x516bc3[_0x4fdc08];return _0x51f44c;}export async function queryDevelopmentFileUrl(_0x2bde0e,_0x323169={}){const _0x58b3a5=a185_0x51f4,_0x648571=await apiRequest(_0x58b3a5(0xec),{'method':_0x58b3a5(0x111),'body':{'filePath':_0x2bde0e,'downloadFlag':_0x323169[_0x58b3a5(0xf5)]??![],..._0x323169[_0x58b3a5(0x184)]?{'longTerm':!![]}:{}}});return _0x648571['data'];}function isAuthFailure(_0xfa2e5e){const _0x5c4695=a185_0x51f4,_0x5b116a=_0xfa2e5e[_0x5c4695(0x156)]||_0xfa2e5e[_0x5c4695(0x18a)]||_0xfa2e5e[_0x5c4695(0xc6)]?.[_0x5c4695(0x18a)]||_0xfa2e5e['errorMessage']||_0xfa2e5e[_0x5c4695(0x15c)]||'';return _0xfa2e5e[_0x5c4695(0x11c)]==='UNAUTHORIZED'||_0xfa2e5e[_0x5c4695(0x147)]===0x191||_0xfa2e5e['code']===_0x5c4695(0xba)||_0x5b116a[_0x5c4695(0x153)](_0x5c4695(0xba))||_0x5b116a[_0x5c4695(0x153)](_0x5c4695(0xd5))||_0x5b116a[_0x5c4695(0x153)]('登录')||_0x5b116a[_0x5c4695(0x153)]('认证');}export async function platformFetch(_0x14d77e,_0x938706){const _0x20280b=a185_0x51f4;let _0x2e3a1d;try{_0x2e3a1d=await fetch(_0x14d77e,{'method':_0x938706[_0x20280b(0xd7)]??_0x20280b(0x12a),'headers':{'Content-Type':_0x20280b(0xd9),'Cookie':_0x938706[_0x20280b(0x121)],'X-Invoke-Source':_0x20280b(0x158)},..._0x938706[_0x20280b(0x161)]&&{'body':JSON['stringify'](_0x938706['body'])}});}catch(_0x5da79a){throw createFetchFailureError(_0x14d77e,_0x5da79a);}if(!_0x2e3a1d['ok']){if(_0x2e3a1d[_0x20280b(0xd0)]===0x191)throw CliErrors[_0x20280b(0x185)]();throw CliErrors['apiError'](_0x938706[_0x20280b(0x131)]+_0x20280b(0xcf)+_0x2e3a1d[_0x20280b(0xd0)]);}const _0xc8dd94=await _0x2e3a1d[_0x20280b(0x164)]();if(_0xc8dd94[_0x20280b(0x163)]===![]){if(isAuthFailure(_0xc8dd94))throw CliErrors[_0x20280b(0x185)]();throw CliErrors[_0x20280b(0x130)](_0xc8dd94[_0x20280b(0x156)]||_0xc8dd94[_0x20280b(0x18a)]||_0x938706[_0x20280b(0x131)]+'\x20failed');}return _0xc8dd94[_0x20280b(0xc6)];}export async function platformRequest(_0x11090a,_0x5c50d8){const _0x2514f1=a185_0x51f4;if(/^https?:\/\//i[_0x2514f1(0x17c)](_0x11090a))throw CliErrors[_0x2514f1(0xf1)](_0x2514f1(0xde)+_0x11090a,'Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.');const _0x59e487=_0x11090a[_0x2514f1(0x14b)]('/')?_0x11090a:'/'+_0x11090a;return platformFetch(''+getApiDomain()+_0x59e487,_0x5c50d8);}function cleanNewlines(_0x5427c3){const _0x14f4fc=a185_0x51f4;return _0x5427c3[_0x14f4fc(0x13d)](/[\r\n]+/g,'\x20')[_0x14f4fc(0x113)]();}function cleanDatasetName(_0xfc492e){const _0x22980c=a185_0x51f4;if(!_0xfc492e['name'])return _0xfc492e;return{..._0xfc492e,'name':cleanNewlines(_0xfc492e[_0x22980c(0x17b)])};}export async function fetchModelList(_0xf6031e,_0x50ca79){const _0xb26c22=a185_0x51f4,_0x2d0d53=getEnv(),_0x4ccec9=new URLSearchParams({'appcode':_0xf6031e,'otype':'array'}),_0x37dd93='/api/node-toolbox/dataset/model-list?'+_0x4ccec9[_0xb26c22(0x127)]();logger[_0xb26c22(0x12d)]('fetch-model-list',_0xb26c22(0x110)+_0x2d0d53+')',{'apiPath':_0x37dd93});const _0x427696=await platformRequest(_0x37dd93,{'cookie':_0x50ca79,'label':_0xb26c22(0x167)}),_0x54c24c=(_0x427696['configArray']??[])[_0xb26c22(0xd4)](cleanDatasetName);return{'configArray':_0x54c24c,'count':_0x54c24c['length']};}export async function fetchDatasetDoc(_0x15396e){const _0x355f4d=a185_0x51f4,{appCode:_0x50d909,cookie:_0x56077b,datasetCode:_0xf3fc2d,datasetId:_0x117ceb,extraParams:_0x4f1646}=_0x15396e,_0x34f876=await platformRequest(_0x355f4d(0x165),{'method':_0x355f4d(0x111),'body':{'appCode':_0x50d909,'datasetCode':_0xf3fc2d,'datasetId':_0x117ceb,..._0x4f1646||{}},'cookie':_0x56077b,'label':'Fetch\x20doc\x20('+_0xf3fc2d+')'});if(!_0x34f876||typeof _0x34f876['markdown']!=='string')throw new Error(_0x355f4d(0xe1)+_0xf3fc2d+'):\x20missing\x20data.markdown\x20field');return _0x34f876['markdown'];}export async function getMenuTree(_0x23c46e,_0x517e38){const _0xed164=a185_0x51f4,_0x450640=new URLSearchParams({'appCode':_0x23c46e});return platformRequest(_0xed164(0xb5)+_0x450640[_0xed164(0x127)](),{'cookie':_0x517e38,'label':_0xed164(0x171)});}export async function createMenuRecord(_0x1f740a,_0x2ec0f9,_0x4b2a08){const _0x226b99=a185_0x51f4;return platformRequest(_0x226b99(0xfc),{'method':_0x226b99(0x111),'body':_0x1f740a,'cookie':_0x2ec0f9,'label':_0x4b2a08});}export async function updateMenuRecord(_0xed2926,_0x57c0f3,_0x56d44a){const _0x14fc92=a185_0x51f4;return platformRequest('/smartapi/menu/update',{'method':_0x14fc92(0x111),'body':_0xed2926,'cookie':_0x57c0f3,'label':_0x56d44a});}export async function listBffScripts(_0x2b3a90,_0x1f2574,_0x110d68){const _0x5f3906=a185_0x51f4;let _0x5dad62='/api/management/library/scripts/list?appCode='+_0x2b3a90;if(_0x1f2574)_0x5dad62+=_0x5f3906(0x181)+_0x1f2574;const _0x4c4e30=await apiRequest(_0x5dad62);let _0x48f6cc=extractList(_0x4c4e30[_0x5f3906(0xc6)]);if(_0x110d68?.[_0x5f3906(0x183)]){const _0x91357e=_0x110d68[_0x5f3906(0x183)][_0x5f3906(0xf9)]();_0x48f6cc=_0x48f6cc[_0x5f3906(0x182)](_0x523315=>_0x523315[_0x5f3906(0x15e)]?.['toLowerCase']()[_0x5f3906(0x153)](_0x91357e)||_0x523315[_0x5f3906(0x12c)]?.['toLowerCase']()['includes'](_0x91357e));}return _0x48f6cc;}export async function getBffScriptInfo(_0x9be249){const _0x34652d=a185_0x51f4,_0x22fa1f=await apiRequest(_0x34652d(0x188)+_0x9be249);if(!_0x22fa1f['data'])throw CliErrors['validation'](_0x34652d(0xb6)+_0x9be249);return _0x22fa1f[_0x34652d(0xc6)];}export async function saveBffScript(_0x55edba){const _0x597d7c=a185_0x51f4,_0x5c9050=await apiRequest(_0x597d7c(0x18d),{'method':'POST','body':_0x55edba}),{id:_0x30252c,entity:_0xfdc486}=normalizeEntityWithIdResponse(_0x5c9050[_0x597d7c(0xc6)]);if(_0x30252c!==undefined){const _0x3cdf96=typeof _0xfdc486[_0x597d7c(0x15e)]===_0x597d7c(0x17d)||typeof _0xfdc486[_0x597d7c(0x11b)]===_0x597d7c(0x17d)?_0xfdc486:undefined;return{'id':_0x30252c,'script':_0x3cdf96};}throw CliErrors[_0x597d7c(0x130)](_0x597d7c(0xbf));}export async function deleteBffScript(_0x1082ae){const _0x487d1f=a185_0x51f4;await apiRequest(_0x487d1f(0x148),{'method':_0x487d1f(0x111),'body':{'id':_0x1082ae}});}export async function getBffScriptStatistics(_0x17063d){const _0x196b88=a185_0x51f4,_0x35f78c=await apiRequest(_0x196b88(0xed)+_0x17063d);return extractList(_0x35f78c[_0x196b88(0xc6)]);}export async function clearBffScriptCache(){const _0xbf7b3e=a185_0x51f4,_0x2211ac=await apiRequest(_0xbf7b3e(0xe2),{'method':_0xbf7b3e(0x111),'useRuntime':!![]});return typeof _0x2211ac[_0xbf7b3e(0xc6)]===_0xbf7b3e(0x17d)?_0x2211ac[_0xbf7b3e(0xc6)]:'';}export async function listBffDatasetOperations(_0x379e06,_0x2779ef){const _0x54dc98=a185_0x51f4,_0x30fa2a=await apiRequest(_0x54dc98(0xf0),{'method':_0x54dc98(0x111),'body':{'appCode':_0x379e06,'datasetId':_0x2779ef}});return _0x30fa2a[_0x54dc98(0xc6)];}export async function listSqlQueries(_0x3be41f,_0x170c51){const _0x1cc936=a185_0x51f4,_0x3ea9ad=await apiRequest(_0x1cc936(0xb4),{'method':_0x1cc936(0x111),'body':{'appCode':_0x3be41f,'currentPage':_0x170c51?.[_0x1cc936(0xb1)]??0x1,'pageSize':_0x170c51?.['pageSize']??0x32,'sqlCode':_0x170c51?.['sqlCode'],'sqlName':_0x170c51?.[_0x1cc936(0xf4)]}});return _0x3ea9ad[_0x1cc936(0xc6)];}export async function getSqlQueryInfo(_0x4729d6,_0x2b8103){const _0xcd15ac=a185_0x51f4,_0x15d29e=await listSqlQueries(_0x4729d6,{'sqlCode':_0x2b8103}),_0x292c8a=_0x15d29e[_0xcd15ac(0xee)]?.[0x0];if(!_0x292c8a)throw CliErrors[_0xcd15ac(0xf1)](_0xcd15ac(0x172)+_0x2b8103);return _0x292c8a;}export async function getSqlQueryDetail(_0x52ed5d){const _0x18a414=a185_0x51f4,_0x597883=await apiRequest('/smartapi/custom/getUserCustomSql'+(_0x18a414(0xbb)+encodeURIComponent(_0x52ed5d)));if(!_0x597883[_0x18a414(0xc6)])throw CliErrors[_0x18a414(0xf1)]('SQL\x20query\x20not\x20found:\x20'+_0x52ed5d);return _0x597883[_0x18a414(0xc6)];}export async function getSqlQueryDetailById(_0x4853f3){const _0x29b195=a185_0x51f4,_0xba8aae=await apiRequest(_0x29b195(0x151)+_0x4853f3);if(!_0xba8aae['data'])throw CliErrors[_0x29b195(0xf1)]('SQL\x20query\x20not\x20found:\x20id='+_0x4853f3);return _0xba8aae[_0x29b195(0xc6)];}export async function createSqlQuery(_0x23a110){const _0x551c7b=a185_0x51f4,_0x384678=await apiRequest(_0x551c7b(0x146),{'method':_0x551c7b(0x111),'body':_0x23a110}),{id:_0x4fe11d,entity:_0x1db7eb}=normalizeEntityWithIdResponse(_0x384678[_0x551c7b(0xc6)]);if(!(_0x551c7b(0xad)in _0x1db7eb)&&_0x4fe11d)return getSqlQueryDetailById(_0x4fe11d);return normalizeSqlQueryEntity(_0x1db7eb);}export async function updateSqlQuery(_0x31211f){const _0x42341f=a185_0x51f4,_0xca0195=await apiRequest(_0x42341f(0xf7),{'method':_0x42341f(0x111),'body':_0x31211f}),{id:_0xc3d813,entity:_0x53fbe0}=normalizeEntityWithIdResponse(_0xca0195['data']);if(!(_0x42341f(0xad)in _0x53fbe0)){if(_0x31211f[_0x42341f(0xad)])return getSqlQueryDetail(_0x31211f[_0x42341f(0xad)]);if(_0xc3d813)return getSqlQueryDetailById(_0xc3d813);}return normalizeSqlQueryEntity(_0x53fbe0);}export async function deleteSqlQuery(_0x4c490b){const _0x2b03a7=a185_0x51f4;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x2b03a7(0x111),'body':_0x4c490b});}export async function saveSqlQuery(_0x517d1e){const _0x1ed820=a185_0x51f4,_0x2f5cb3=await apiRequest('/api/node-toolbox/sql/save',{'method':'POST','body':_0x517d1e});return _0x2f5cb3[_0x1ed820(0xc6)];}function normalizeSqlQueryEntity(_0x314d97){const _0x17e213=a185_0x51f4;return{..._0x314d97,'id':Number(_0x314d97['id']),'dbId':_0x314d97[_0x17e213(0xab)]==null?undefined:Number(_0x314d97[_0x17e213(0xab)]),'version':_0x314d97[_0x17e213(0x103)]==null?undefined:Number(_0x314d97[_0x17e213(0x103)])};}export async function executeSql(_0x4552d3,_0x3538c8,_0x19d705){const _0x2d4507=a185_0x51f4,_0x4ac195=await apiRequest(_0x2d4507(0x155),{'method':'POST','body':{'appCode':_0x4552d3,'sqlCode':_0x3538c8,..._0x19d705&&{'params':_0x19d705}},'useRuntime':!![]});return _0x4ac195[_0x2d4507(0xc6)];}export async function executeDatasetDataOperation(_0x10ca7c,_0x52ce38,_0x18396d,_0x33be4a={}){const _0x381eee=a185_0x51f4;try{const _0x595e44=await apiRequest(_0x381eee(0x107)+_0x10ca7c+'/'+_0x52ce38+'/'+_0x18396d,{'method':_0x381eee(0x111),'body':_0x33be4a,'useRuntime':!![]});return _0x595e44[_0x381eee(0xc6)];}catch(_0xe083dc){if(_0x18396d===_0x381eee(0x174)&&_0xe083dc instanceof CliError&&_0xe083dc[_0x381eee(0x147)]===_0x381eee(0x15d)&&_0x33be4a['id']!==undefined&&_0x33be4a['id']!==null&&_0x33be4a['id']!==''){const _0x4c4072=await apiRequest(_0x381eee(0x107)+_0x10ca7c+'/'+_0x52ce38+'/filter',{'method':_0x381eee(0x111),'body':{'where':{'id':{'$eq':_0x33be4a['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x2ce0ab=Array[_0x381eee(0x106)](_0x4c4072['data']?.['tableData'])?_0x4c4072[_0x381eee(0xc6)]['tableData']:[];return _0x2ce0ab[0x0]??null;}throw _0xe083dc;}}export async function listDatasets(_0xd0cf15,_0x10ab3b){const _0x4ccf1f=a185_0x51f4,_0x31507c={'appCode':_0xd0cf15,'deleted':_0x10ab3b?.[_0x4ccf1f(0x157)]??![]};if(_0x10ab3b?.['code'])_0x31507c['code']=_0x10ab3b['code'];if(_0x10ab3b?.[_0x4ccf1f(0x17b)])_0x31507c[_0x4ccf1f(0x17b)]=_0x10ab3b[_0x4ccf1f(0x17b)];const _0x163aa2=await apiRequest(_0x4ccf1f(0x143),{'method':_0x4ccf1f(0x111),'body':_0x31507c});return extractList(_0x163aa2[_0x4ccf1f(0xc6)]);}export async function deleteDataset(_0x284e9f,_0x1d1036){const _0x2c0505=a185_0x51f4;await apiRequest(_0x2c0505(0xbc),{'method':_0x2c0505(0x111),'body':{'appCode':_0x284e9f,'datasetId':_0x1d1036}});}export async function restoreDataset(_0x32bf31,_0x108b97){const _0x4d208f=a185_0x51f4;await apiRequest(_0x4d208f(0xe4),{'method':_0x4d208f(0x111),'body':{'appCode':_0x32bf31,'datasetId':_0x108b97}});}export async function previewTextGeneratedDataset(_0x279b06,_0x50d941){const _0x4db45c=a185_0x51f4,_0x288054=await apiRequest(_0x4db45c(0x13f),{'method':'POST','body':{'appCode':_0x279b06,'datasetName':_0x50d941[_0x4db45c(0x116)],'requirementDescription':_0x50d941[_0x4db45c(0xd2)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x288054[_0x4db45c(0xc6)];}export async function startTextGeneratedDataset(_0x5a2f20,_0x39f0ea,_0x179f4f){const _0x5d4721=a185_0x51f4,_0x4a2781=await apiRequest(_0x5d4721(0x150),{'method':_0x5d4721(0x111),'body':{'appCode':_0x5a2f20,..._0x179f4f?.['clientOperationId']?{'clientOperationId':_0x179f4f[_0x5d4721(0xe5)]}:{},'design':_0x39f0ea},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x4a2781[_0x5d4721(0xc6)];}export async function getTextGeneratedDatasetStatus(_0x45dffc,_0x199096){const _0x4ae26d=a185_0x51f4,_0x73d13c=new URLSearchParams({'appCode':_0x45dffc});_0x199096[_0x4ae26d(0x139)]&&_0x73d13c[_0x4ae26d(0xb3)]('operationId',_0x199096[_0x4ae26d(0x139)]);_0x199096[_0x4ae26d(0xe5)]&&_0x73d13c[_0x4ae26d(0xb3)](_0x4ae26d(0xe5),_0x199096[_0x4ae26d(0xe5)]);const _0x461fcc=await apiRequest(_0x4ae26d(0xdd)+_0x73d13c[_0x4ae26d(0x127)]());return _0x461fcc[_0x4ae26d(0xc6)];}export async function searchDatasets(_0x4bc97c,_0x4a5906){const _0x5e4004=a185_0x51f4,_0x3e94e5=await listDatasets(_0x4bc97c,{'name':_0x4a5906}),_0x47e3a9=_0x4a5906[_0x5e4004(0xf9)](),_0x119c4f=new Set(_0x3e94e5[_0x5e4004(0xd4)](_0x132380=>_0x132380['id'])),_0x104852=_0x3e94e5[_0x5e4004(0x182)](_0x17a9ed=>_0x17a9ed[_0x5e4004(0x186)]?.[_0x5e4004(0xf6)]?.['toLowerCase']()[_0x5e4004(0x153)](_0x47e3a9)||_0x17a9ed[_0x5e4004(0x12c)]?.[_0x5e4004(0xf9)]()[_0x5e4004(0x153)](_0x47e3a9)),_0x4f829d=await listDatasets(_0x4bc97c,{'code':_0x4a5906});for(const _0x17037c of _0x4f829d){!_0x119c4f[_0x5e4004(0x16e)](_0x17037c['id'])&&(_0x3e94e5[_0x5e4004(0x124)](_0x17037c),_0x119c4f['add'](_0x17037c['id']));}return _0x3e94e5;}export function normalizeDatasetOperations(_0x163dbe){const _0x34f96c=a185_0x51f4;if(Array['isArray'](_0x163dbe))return _0x163dbe['filter'](_0x3d4d32=>_0x3d4d32!=null&&typeof _0x3d4d32==='object');if(_0x163dbe&&typeof _0x163dbe===_0x34f96c(0xd6))return Object[_0x34f96c(0x12f)](_0x163dbe)[_0x34f96c(0x182)](([,_0x137b2a])=>_0x137b2a!=null&&typeof _0x137b2a===_0x34f96c(0xd6))[_0x34f96c(0xd4)](([_0x25d208,_0x25f0f6])=>({..._0x25f0f6,'name':_0x25f0f6[_0x34f96c(0x17b)]??_0x25f0f6['operationName']??_0x25d208}));return[];}export async function getDatasetDetail(_0x314985){const _0x1c4233=a185_0x51f4,_0x35e541=/^\d+$/[_0x1c4233(0x17c)](_0x314985)?'id':_0x1c4233(0x147),_0x206058=await apiRequest(_0x1c4233(0xd8)+_0x35e541+'='+_0x314985);return _0x206058[_0x1c4233(0xc6)];}export async function updateDrivenData(_0x442145){const _0x1e3cc2=a185_0x51f4,_0x1bcea4=await apiRequest(_0x1e3cc2(0x10e),{'method':_0x1e3cc2(0x111),'body':_0x442145});return _0x1bcea4['data'];}export async function getDatasetOperations(_0x4e37f3){const _0x3fe31b=a185_0x51f4,_0x1781b2=await getDatasetDetail(_0x4e37f3),_0x450a26=normalizeDatasetOperations(_0x1781b2[_0x3fe31b(0x10f)])[_0x3fe31b(0xd4)](_0xcb207d=>({'name':_0xcb207d['name']||_0xcb207d[_0x3fe31b(0xe8)],'displayName':_0xcb207d['displayName']||_0xcb207d[_0x3fe31b(0x17b)],'type':_0xcb207d[_0x3fe31b(0x112)],'method':_0xcb207d[_0x3fe31b(0xd7)],'path':_0xcb207d[_0x3fe31b(0x189)],'enabled':_0xcb207d['enabled']??!![],'requestFields':_0xcb207d[_0x3fe31b(0x13c)],'responseFields':_0xcb207d['responseFields']}));return{'dataset':{'id':_0x1781b2['id']??_0x1781b2[_0x3fe31b(0xc4)],'name':_0x1781b2['name'],'code':_0x1781b2['code']||_0x1781b2[_0x3fe31b(0xc0)],'tableName':_0x1781b2['tableName']||_0x1781b2['dbtableConfig']?.[_0x3fe31b(0xf6)]},'operations':_0x450a26};}export async function getOperationDetail(_0x3f8dde,_0x9ca4cd,_0x2de373){const _0x8cb9fb=a185_0x51f4;let _0x292ccb=_0x9ca4cd;if(!/^\d+$/[_0x8cb9fb(0x17c)](_0x9ca4cd)){const _0x1b3262=await listDatasets(_0x3f8dde,{'code':_0x9ca4cd}),_0x590b2b=_0x1b3262[_0x8cb9fb(0xf8)](_0x3d9f49=>_0x3d9f49[_0x8cb9fb(0x147)]===_0x9ca4cd||String(_0x3d9f49['id'])===_0x9ca4cd);if(!_0x590b2b)throw CliErrors['validation'](_0x8cb9fb(0xfd)+_0x9ca4cd);_0x292ccb=String(_0x590b2b['id']);}const _0x17fad2=await getDatasetDetail(_0x292ccb),_0x187f85=normalizeDatasetOperations(_0x17fad2[_0x8cb9fb(0x10f)])[_0x8cb9fb(0xf8)](_0x28ced5=>(_0x28ced5['name']||_0x28ced5['operationName'])===_0x2de373);if(!_0x187f85)throw CliErrors[_0x8cb9fb(0xf1)]('Operation\x20\x22'+_0x2de373+_0x8cb9fb(0xb0)+_0x9ca4cd);return{'dataset':{'id':_0x17fad2['id']??_0x17fad2[_0x8cb9fb(0xc4)],'name':_0x17fad2[_0x8cb9fb(0x17b)],'code':_0x17fad2[_0x8cb9fb(0x147)]||_0x17fad2[_0x8cb9fb(0xc0)],'tableName':_0x17fad2['tableName']||_0x17fad2['dbtableConfig']?.[_0x8cb9fb(0xf6)]},'operation':_0x187f85};}export async function startGenerateStandardPages(_0x448e1f,_0x19864a,_0x260a51){const _0x566d67=a185_0x51f4,_0x8bc61c=await apiRequest(_0x566d67(0x16a)+_0x19864a+_0x566d67(0x168),{'method':_0x566d67(0x111),'body':{'appCode':_0x448e1f,..._0x260a51?.[_0x566d67(0xe5)]?{'clientOperationId':_0x260a51[_0x566d67(0xe5)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x8bc61c['data'];}export async function getGenerateStandardPagesStatus(_0x179c31,_0x16cd32,_0x2105af){const _0x1dc20d=a185_0x51f4,_0x534773=new URLSearchParams({'appCode':_0x179c31});_0x2105af[_0x1dc20d(0x139)]&&_0x534773[_0x1dc20d(0xb3)](_0x1dc20d(0x139),_0x2105af[_0x1dc20d(0x139)]);_0x2105af[_0x1dc20d(0xe5)]&&_0x534773[_0x1dc20d(0xb3)](_0x1dc20d(0xe5),_0x2105af[_0x1dc20d(0xe5)]);const _0x54761e=await apiRequest('/smartapi/lovrabet/dataset/'+_0x16cd32+_0x1dc20d(0x18c)+_0x534773[_0x1dc20d(0x127)]());return _0x54761e[_0x1dc20d(0xc6)];}function a185_0x516b(){const _0x911c1=['platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','min','needPublic','Invalid\x20response\x20format\x20(','/api/management/script/cache/clear','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','/smartapi/dataset/restore-dataset','clientOperationId','/smartapi/permit/resource/get-menu-list','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','operationName','/smartapi/question/er-config/cli/erCreate','\x20of\x20','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','/smartapi/common/queryFileUrl','/api/management/library/scripts/statistics?appCode=','tableData','.create({\x20/*\x20fields\x20*/\x20});','/smartapi/dataset/get-dataset-operation','validation','2270fUlqLA','max','sqlName','download','tableName','/smartapi/custom/updateUserCustomSql','find','toLowerCase','\x20\x20sqlCode:\x20\x27','roleName','/smartapi/menu/create','Dataset\x20not\x20found:\x20','Request\x20timeout:\x20','/smartapi/question/er-config','Page\x20not\x20found:\x20','//\x20SQL:\x20','/smartapi/app-config/delete','version','/smartapi/app/getList','948NljrFG','isArray','/api/','const\x20results\x20=\x20data.execResult\x20||\x20[];','607288DcrwfU','sdk','tags','const\x20data\x20=\x20await\x20client.sql.execute({','pageSize','/smartapi/dataset/update-driven-data','operations','正在从服务器拉取模型列表...\x20(环境:\x20','POST','type','trim','pageIndex','key','datasetName','/smartapi/question/er-config/cli/update-single','includeImports','/smartapi/lovrabet/update-page','});','scriptType','errorCode','29691drSCgA','537785rObJtv','/smartapi/db-analysis/jobs/cancel','/smartapi/permit/role/update','cookie','/smartapi/dblink/create','.remove(id);','push','\x20apps.\x20','username','toString','needSelf','\x20\x20\x20\x20sqlCode:\x20\x27','GET','12vagrzg','description','info','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','entries','apiError','label','146641IuUWLb','relation','/smartapi/lovrabet/detail?pageId=','const\x20result\x20=\x20await\x20client.models.','list','signal','/smartapi/dblink/getOne','operationId','/smartapi/permit/resource/get-api-list','/notification/channel-config/list','requestFields','replace','/smartapi/permit/page/get-one','/smartapi/dataset/text-generate/preview','create','258840ZPqHYh','/smartapi/db-analysis/start','/smartapi/dataset/get-dataset-list','datasetTableCount','ENABLE','/smartapi/custom/saveUserCustomSql','code','/api/management/library/scripts/delete','userId','/userTenant/getByTenantCode','startsWith','appCode','append','hint','totalCount','/smartapi/dataset/text-generate/start','/smartapi/custom/getUserCustomSql?id=','value','includes','Check\x20network\x20connectivity\x20and\x20try\x20again.','/api/custom/executeSql','errorMsg','deleted','cli:rabetbase','302607TvaoPh','/smartapi/permit/user-role/update-user-list','email','error','api_error','functionName','API\x20error:\x20','stringify','body','Request\x20failed:\x20','success','json','/api/node-toolbox/api-doc-generator','/smartapi/question/er-config/cli/delete-single','Fetch\x20datasets','/generate-standard-pages/start','delete','/smartapi/lovrabet/dataset/','/smartapi/permit/role/delete','/smartapi/dblink/update','DATA_NOT_EXIST','has','abort','/smartapi/app-config/update','Fetch\x20menu\x20list','SQL\x20query\x20not\x20found:\x20','\x20\x20currentPage:\x201,','getOne','\x20\x20pageSize:\x2020,','isFinite','/smartapi/permit/role/get-list','/smartapi/permit/user-role/get-user-list','mobile','roleType','name','test','string','nickname','remark','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','&type=','filter','scriptName','longTerm','authRequired','dbtableConfig','table','/api/management/library/scripts/info?id=','path','message','planId','/generate-standard-pages/status?','/api/management/library/scripts/save','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','summary','dbId','/smartapi/app-config/create','sqlCode','\x20\x20return\x20rows;','/sync-to-pages','\x22\x20not\x20found\x20in\x20dataset\x20','currentPage','permits','set','/smartapi/custom/queryUserCustomSqlList','/smartapi/menu/find?','BFF\x20script\x20not\x20found:\x20id=','update','target','/smartapi/dblink/delete','401','?sqlCode=','/smartapi/dataset/delete-dataset','/smartapi/common/uploadFile','//\x20','BFF\x20save\x20returned\x20no\x20valid\x20id','modelCode','/smartapi/dblink/testConnect','avatar','API\x20error\x20code:\x20306','modelId','tableList','data','.filter({','4BjKwOR','/smartapi/dblink/getTableDiffV2ByPage','7ZZbbeo','/smartapi/app-config/list','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','/smartapi/question/er-config/business-group/edit','2607144ACpbMb','\x20failed,\x20HTTP\x20','status','join','requirementDescription','AbortError','map','Unauthorized','object','method','/smartapi/dataset/get-driven-data?','application/json','/smartapi/db-analysis/status/','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/smartapi/permit/page/save','/smartapi/dataset/text-generate/status?'];a185_0x516b=function(){return _0x911c1;};return a185_0x516b();}export async function getStandardPageStatus(_0x22392e,_0x5ea691){const _0x24a606=a185_0x51f4,_0x260ea1=await apiRequest(_0x24a606(0x16a)+_0x5ea691+'/standard-page-status?appCode='+encodeURIComponent(_0x22392e));return _0x260ea1[_0x24a606(0xc6)];}export async function tryGetStandardPageStatus(_0x32f856,_0xa4ab2){const _0x5d6e3c=a185_0x51f4;try{return await getStandardPageStatus(_0x32f856,_0xa4ab2);}catch(_0x244678){if(_0x244678 instanceof CliError&&_0x244678[_0x5d6e3c(0x147)]==='api_error'&&/404|not found|non-json response/i[_0x5d6e3c(0x17c)](_0x244678[_0x5d6e3c(0x18a)]))return null;throw _0x244678;}}export async function syncStandardPages(_0x5cba8d,_0x469257){const _0x3520ba=a185_0x51f4,_0x5387fa=await apiRequest(_0x3520ba(0x16a)+_0x469257+_0x3520ba(0xaf),{'method':_0x3520ba(0x111),'body':{'appCode':_0x5cba8d}});return _0x5387fa[_0x3520ba(0xc6)];}export async function getPageDetail(_0x1152e3){const _0x2a8eab=a185_0x51f4,_0x32f9a6=await apiRequest(_0x2a8eab(0x134)+_0x1152e3);if(!_0x32f9a6['data'])throw CliErrors[_0x2a8eab(0xf1)](_0x2a8eab(0x100)+_0x1152e3);return _0x32f9a6[_0x2a8eab(0xc6)];}export async function updatePage(_0x45fdba,_0x432b2c,_0x5b68ce,_0x5d6c28){const _0x285339=a185_0x51f4,_0x287700=await apiRequest(_0x285339(0x119),{'method':_0x285339(0x111),'body':{'appCode':_0x45fdba,'pageId':_0x432b2c,'code':_0x5b68ce,'datasetIds':_0x5d6c28}});return _0x287700[_0x285339(0xc6)];}export function generateSdkCode(_0x578112,_0x5e43f5,_0x1f5414){const _0x1cf8d1=a185_0x51f4,_0x57fbc0=_0x1f5414?.[_0x1cf8d1(0x118)]??!![],_0x278c37='dataset_'+_0x578112['code']?.[_0x1cf8d1(0x13d)](/-/g,'_'),_0x7e162=_0x5e43f5[_0x1cf8d1(0x17b)]||_0x5e43f5[_0x1cf8d1(0xe8)]||_0x1cf8d1(0x182),_0x1492c6=[];_0x57fbc0&&_0x1492c6[_0x1cf8d1(0x124)](_0x1cf8d1(0x180),'',_0x1cf8d1(0x12e),'');_0x1492c6[_0x1cf8d1(0x124)](_0x1cf8d1(0xbe)+_0x578112[_0x1cf8d1(0x17b)]+'\x20('+(_0x578112['tableName']||_0x1cf8d1(0x187))+')');if(_0x7e162===_0x1cf8d1(0x182))_0x1492c6[_0x1cf8d1(0x124)](_0x1cf8d1(0x135)+_0x278c37+_0x1cf8d1(0xc7),'\x20\x20where:\x20{},',_0x1cf8d1(0x175),_0x1cf8d1(0x173),_0x1cf8d1(0x11a));else{if(_0x7e162===_0x1cf8d1(0x174))_0x1492c6[_0x1cf8d1(0x124)](_0x1cf8d1(0x135)+_0x278c37+'.getOne(id);');else{if(_0x7e162===_0x1cf8d1(0x140))_0x1492c6[_0x1cf8d1(0x124)]('const\x20result\x20=\x20await\x20client.models.'+_0x278c37+_0x1cf8d1(0xef));else{if(_0x7e162===_0x1cf8d1(0xb7))_0x1492c6[_0x1cf8d1(0x124)](_0x1cf8d1(0x135)+_0x278c37+_0x1cf8d1(0xe7));else _0x7e162===_0x1cf8d1(0x169)||_0x7e162==='remove'?_0x1492c6[_0x1cf8d1(0x124)](_0x1cf8d1(0x135)+_0x278c37+_0x1cf8d1(0x123)):_0x1492c6[_0x1cf8d1(0x124)](_0x1cf8d1(0x135)+_0x278c37+'.'+_0x7e162+'(/*\x20params\x20*/);');}}}return _0x1492c6['join']('\x0a');}export function generateSqlCodeTemplate(_0x760f37,_0x544f51){const _0x3de8ad=a185_0x51f4,_0x5229c3=_0x544f51?.[_0x3de8ad(0xb8)]??_0x3de8ad(0x10a),_0x2541df=_0x544f51?.[_0x3de8ad(0x118)]??!![],_0x34554f=[];return _0x34554f[_0x3de8ad(0x124)](_0x3de8ad(0x101)+_0x760f37[_0x3de8ad(0xf4)]+'\x20('+_0x760f37[_0x3de8ad(0xad)]+')'),_0x5229c3==='sdk'?(_0x2541df&&_0x34554f[_0x3de8ad(0x124)](_0x3de8ad(0x180),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x34554f[_0x3de8ad(0x124)](_0x3de8ad(0x10c),_0x3de8ad(0xfa)+_0x760f37[_0x3de8ad(0xad)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','});','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x3de8ad(0x108))):_0x34554f['push'](_0x3de8ad(0xe3),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x3de8ad(0x18e),_0x3de8ad(0x129)+_0x760f37[_0x3de8ad(0xad)]+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','\x20\x20});',_0x3de8ad(0xae),'}'),_0x34554f[_0x3de8ad(0xd1)]('\x0a');}export async function getErConfig(_0x2c1fdf,_0x4968f9){const _0x293e2f=a185_0x51f4,_0x56f6f4=await apiRequest(_0x293e2f(0xff),{'method':_0x293e2f(0x111),'body':{'appCode':_0x2c1fdf,'dblinkId':_0x4968f9},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x56f6f4[_0x293e2f(0xc6)];}export async function getErRelationDetail(_0x163ed4,_0x2ffe93){const _0x15bb13=a185_0x51f4,_0x132095=new URLSearchParams({'appCode':_0x163ed4,'relationId':String(_0x2ffe93)});try{const _0x3b7bd9=await apiRequest('/smartapi/question/er-config/cli/detail?'+_0x132095[_0x15bb13(0x127)]());return _0x3b7bd9[_0x15bb13(0xc6)]?.[_0x15bb13(0x133)]??null;}catch(_0x8afaba){if(_0x8afaba instanceof CliError&&_0x8afaba[_0x15bb13(0x147)]===_0x15bb13(0x15d)&&(_0x8afaba[_0x15bb13(0x14e)]?.['includes'](_0x15bb13(0x16d))||_0x8afaba['hint']===_0x15bb13(0xc3)&&_0x8afaba[_0x15bb13(0x18a)]==='ER\x20relation\x20does\x20not\x20exist'))return null;throw _0x8afaba;}}export async function createErRelation(_0x129160){const _0x5ad4ea=a185_0x51f4,_0x44df57=await apiRequest(_0x5ad4ea(0xe9),{'method':_0x5ad4ea(0x111),'body':_0x129160,'allowNonJsonSuccess':!![]});return _0x44df57['data'];}export async function updateErRelation(_0x5a6e3d){const _0xfb15c6=a185_0x51f4,_0x34b61b=await apiRequest(_0xfb15c6(0x117),{'method':_0xfb15c6(0x111),'body':_0x5a6e3d,'allowNonJsonSuccess':!![]});return _0x34b61b[_0xfb15c6(0xc6)];}export async function deleteErRelation(_0x435e70){const _0x37ddb6=a185_0x51f4,_0x50afed=await apiRequest(_0x37ddb6(0x166),{'method':_0x37ddb6(0x111),'body':_0x435e70,'allowNonJsonSuccess':!![]});return _0x50afed['data'];}export async function updateErBusinessGroup(_0x53860c){const _0x114454=a185_0x51f4,_0x58148c=await apiRequest(_0x114454(0xcd),{'method':'POST','body':_0x53860c,'allowNonJsonSuccess':!![]});return _0x58148c[_0x114454(0xc6)];}function buildQuery(_0x107ec2){const _0xcb05e2=a185_0x51f4,_0x331400=new URLSearchParams();for(const [_0x46d370,_0x49c7f1]of Object['entries'](_0x107ec2)){if(_0x49c7f1===undefined||_0x49c7f1==='')continue;_0x331400['set'](_0x46d370,String(_0x49c7f1));}const _0x1cd35e=_0x331400[_0xcb05e2(0x127)]();return _0x1cd35e?'?'+_0x1cd35e:'';}export async function listNotificationChannelConfigs(_0x670519,_0x2c221b){const _0x4ed9e2=a185_0x51f4,_0xdd22be=await apiRequest(_0x4ed9e2(0x13b)+buildQuery({'appCode':_0x670519,'channelType':_0x2c221b}));return Array[_0x4ed9e2(0x106)](_0xdd22be[_0x4ed9e2(0xc6)])?_0xdd22be[_0x4ed9e2(0xc6)]:[];}export async function listAppConfigs(_0x1f7efe,_0x9bf3f1){const _0x27e688=a185_0x51f4,_0x4585fc=await apiRequest(_0x27e688(0xcb),{'method':_0x27e688(0x111),'body':{'appCode':_0x1f7efe,..._0x9bf3f1?.[_0x27e688(0x115)]?{'key':_0x9bf3f1[_0x27e688(0x115)]}:{},..._0x9bf3f1?.[_0x27e688(0x10b)]?{'tags':_0x9bf3f1[_0x27e688(0x10b)]}:{}}});return extractAppConfigList(_0x4585fc[_0x27e688(0xc6)]);}export async function getAppConfigByKey(_0x5f0aa6,_0x2bdf88){const _0x591caa=a185_0x51f4,_0xe5f5ba=await apiRequest('/smartapi/app-config/getByKey'+buildQuery({'appCode':_0x5f0aa6,'key':_0x2bdf88}));return _0xe5f5ba[_0x591caa(0xc6)]??null;}export async function createAppConfig(_0x28af89){const _0x1be204=a185_0x51f4,_0x4607b2=await apiRequest(_0x1be204(0xac),{'method':_0x1be204(0x111),'body':{'appCode':_0x28af89[_0x1be204(0x14c)],'key':_0x28af89[_0x1be204(0x115)],'value':_0x28af89[_0x1be204(0x152)],..._0x28af89['tags']?{'tags':_0x28af89[_0x1be204(0x10b)]}:{}}});return _0x4607b2[_0x1be204(0xc6)];}export async function updateAppConfig(_0x5af139){const _0x1a30b0=a185_0x51f4;await apiRequest(_0x1a30b0(0x170),{'method':_0x1a30b0(0x111),'body':{'id':_0x5af139['id'],'appCode':_0x5af139[_0x1a30b0(0x14c)],'key':_0x5af139[_0x1a30b0(0x115)],'value':_0x5af139['value'],..._0x5af139[_0x1a30b0(0x10b)]?{'tags':_0x5af139['tags']}:{}}});}export async function deleteAppConfig(_0x5b83fb){const _0x338bb5=a185_0x51f4;await apiRequest(_0x338bb5(0x102),{'method':_0x338bb5(0x111),'body':_0x5b83fb});}function extractAppConfigList(_0x223ad4){const _0x5c786f=a185_0x51f4;if(Array[_0x5c786f(0x106)](_0x223ad4))return _0x223ad4;if(_0x223ad4&&typeof _0x223ad4==='object'&&Array['isArray'](_0x223ad4[_0x5c786f(0x136)]))return _0x223ad4[_0x5c786f(0x136)];return extractList(_0x223ad4);}export async function listDbLinks(_0x57cb00,_0x257fd6){const _0x56df0d=a185_0x51f4,_0x463610=await apiRequest('/smartapi/dblink/getList',{'method':_0x56df0d(0x111),'body':{'appCode':_0x57cb00,'currentPage':_0x257fd6?.[_0x56df0d(0xb1)]??0x1,'pageSize':_0x257fd6?.['pageSize']??0x64}});return{'items':extractList(_0x463610[_0x56df0d(0xc6)]),'paging':extractPaging(_0x463610[_0x56df0d(0xc6)])};}export async function getDbLinkInfo(_0x48596e){const _0x5ca7ee=a185_0x51f4,_0x482e7f=await apiRequest(_0x5ca7ee(0x138)+buildQuery({'id':_0x48596e}));return _0x482e7f[_0x5ca7ee(0xc6)];}export async function createDbLink(_0x478f42){const _0x4feddb=a185_0x51f4,_0x2eb809=await apiRequest(_0x4feddb(0x122),{'method':_0x4feddb(0x111),'body':_0x478f42});return _0x2eb809[_0x4feddb(0xc6)];}export async function updateDbLink(_0xae5d4e){const _0x6ebdb9=a185_0x51f4,_0x1a55a2=await apiRequest(_0x6ebdb9(0x16c),{'method':_0x6ebdb9(0x111),'body':_0xae5d4e});return _0x1a55a2[_0x6ebdb9(0xc6)];}export async function deleteDbLink(_0x31723b){const _0x3af9f8=a185_0x51f4;await apiRequest(_0x3af9f8(0xb9),{'method':'POST','body':{'id':_0x31723b}});}export async function testDbLinkConnect(_0x37457c){const _0x4d50ee=a185_0x51f4,_0xada629=await apiRequest(_0x4d50ee(0xc1)+buildQuery({'id':_0x37457c}));return _0xada629[_0x4d50ee(0xc6)];}export async function startDbAnalysis(_0xd593ca,_0x3219db){const _0x782532=a185_0x51f4,_0x28c768=await apiRequest(_0x782532(0x142),{'method':_0x782532(0x111),'body':{'dbLinkId':_0xd593ca,..._0x3219db&&_0x3219db['length']>0x0?{'tableNames':_0x3219db}:{}}}),_0x53c902=_0x28c768[_0x782532(0xc6)];if(typeof _0x53c902==='string')return _0x53c902;if(_0x53c902&&typeof _0x53c902===_0x782532(0xd6)&&typeof _0x53c902[_0x782532(0x18b)]===_0x782532(0x17d))return _0x53c902['planId'];return _0x53c902!=null?String(_0x53c902):'';}export async function cancelDbAnalysis(_0x5a75cb){const _0x415959=a185_0x51f4;await apiRequest(_0x415959(0x11f)+buildQuery({'planId':_0x5a75cb}),{'method':_0x415959(0x111)});}export async function getDbAnalysisStatus(_0x48a8c6){const _0x3f67e9=a185_0x51f4,_0x437c20=await apiRequest(_0x3f67e9(0xda)+encodeURIComponent(_0x48a8c6));return _0x437c20[_0x3f67e9(0xc6)];}export async function getDbAllTableList(_0x2339fb,_0x253394){const _0x575938=a185_0x51f4,_0x16ef08=await apiRequest('/smartapi/dblink/getAllTableList'+buildQuery({'appCode':_0x2339fb,'dbLinkId':_0x253394})),_0x372a49=_0x16ef08[_0x575938(0xc6)];if(Array[_0x575938(0x106)](_0x372a49))return _0x372a49;return extractList(_0x372a49);}export async function getDbTableDiff(_0x7b01c2,_0x11d285,_0x32f868){const _0x850911=a185_0x51f4,_0x23b578=await apiRequest(_0x850911(0xc9)+buildQuery({'appCode':_0x7b01c2,'dbLinkId':_0x11d285,'pageIndex':_0x32f868?.[_0x850911(0x114)]??0x1,'pageSize':_0x32f868?.['pageSize']??0x14,'tableName':_0x32f868?.[_0x850911(0xf6)]})),_0x54e49e=_0x23b578[_0x850911(0xc6)];return{'totalCount':_0x54e49e?.[_0x850911(0x14f)]??0x0,'physicalTableCount':_0x54e49e?.['physicalTableCount']??0x0,'datasetTableCount':_0x54e49e?.[_0x850911(0x144)]??0x0,..._0x54e49e?.['summary']?{'summary':_0x54e49e[_0x850911(0xaa)]}:{},'tableList':Array[_0x850911(0x106)](_0x54e49e?.[_0x850911(0xc5)])?_0x54e49e[_0x850911(0xc5)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x139fd9=a185_0x51f4,_0x306ac6=await apiRequest(_0x139fd9(0x104),{'method':_0x139fd9(0x111),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x31c981=extractList(_0x306ac6[_0x139fd9(0xc6)]),_0x3edaa1=extractPaging(_0x306ac6['data']);return _0x3edaa1&&_0x3edaa1[_0x139fd9(0x14f)]>REMOTE_APP_PAGE_SIZE&&console['warn']('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+_0x139fd9(0xea)+_0x3edaa1['totalCount']+_0x139fd9(0x125)+_0x139fd9(0xeb)),_0x31c981;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x55ab7,_0x4980ff){const _0x333968=a185_0x51f4,_0x47928b=Math[_0x333968(0xdf)](Math[_0x333968(0xf3)](_0x4980ff?.[_0x333968(0x10d)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x14454a=await apiRequest(_0x333968(0x177),{'method':_0x333968(0x111),'body':{'appCode':_0x55ab7,'currentPage':_0x4980ff?.[_0x333968(0xb1)]??0x1,'pageSize':_0x47928b}});return{'items':extractList(_0x14454a[_0x333968(0xc6)]),'paging':extractPaging(_0x14454a[_0x333968(0xc6)])};}export async function getAppRole(_0x22cf8f){const _0x5813ea=a185_0x51f4,_0x1645fc=await apiRequest('/smartapi/permit/role/get-one'+buildQuery({'id':_0x22cf8f}));return _0x1645fc[_0x5813ea(0xc6)];}export async function createAppRole(_0x2dd5cc){const _0x69fe97=a185_0x51f4,_0xe4fef8=await apiRequest('/smartapi/permit/role/create',{'method':_0x69fe97(0x111),'body':{'appCode':_0x2dd5cc[_0x69fe97(0x14c)],'roleName':_0x2dd5cc[_0x69fe97(0xfb)],'roleType':'CUSTOM',..._0x2dd5cc[_0x69fe97(0x17f)]?{'remark':_0x2dd5cc[_0x69fe97(0x17f)]}:{}}});return _0xe4fef8[_0x69fe97(0xc6)];}export async function updateAppRole(_0x52e530){const _0x1b562d=a185_0x51f4,_0xece86b=await apiRequest(_0x1b562d(0x120),{'method':_0x1b562d(0x111),'body':{'id':_0x52e530['id'],'appCode':_0x52e530[_0x1b562d(0x14c)],..._0x52e530[_0x1b562d(0x17a)]?{'roleType':_0x52e530[_0x1b562d(0x17a)]}:{},..._0x52e530[_0x1b562d(0xfb)]!==undefined?{'roleName':_0x52e530['roleName']}:{},..._0x52e530[_0x1b562d(0x17f)]!==undefined?{'remark':_0x52e530[_0x1b562d(0x17f)]}:{},..._0x52e530[_0x1b562d(0xb2)]?{'permits':_0x52e530[_0x1b562d(0xb2)]}:{}}});return _0xece86b[_0x1b562d(0xc6)];}export async function deleteAppRole(_0x35ee12){const _0x1b91d7=a185_0x51f4;await apiRequest(_0x1b91d7(0x16b),{'method':_0x1b91d7(0x111),'body':{'id':_0x35ee12}});}export async function listPermitRoles(_0xeeca0f,_0x1dcfe9){const _0x5b61ec=a185_0x51f4,_0x10998a=await apiRequest('/smartapi/permit/role/get-permit-list',{'method':_0x5b61ec(0x111),'body':{'appCode':_0xeeca0f,..._0x1dcfe9?.[_0x5b61ec(0x128)]!==undefined?{'needSelf':_0x1dcfe9['needSelf']}:{},..._0x1dcfe9?.[_0x5b61ec(0xe0)]!==undefined?{'needPublic':_0x1dcfe9[_0x5b61ec(0xe0)]}:{}}});return extractList(_0x10998a['data']);}export async function getRoleMenuResources(_0x2850c9,_0x3640bc){const _0x2df92f=a185_0x51f4,_0x71b59f=await apiRequest(_0x2df92f(0xe6),{'method':_0x2df92f(0x111),'body':{'appCode':_0x2850c9,'roleId':_0x3640bc}});return extractList(_0x71b59f[_0x2df92f(0xc6)]);}export async function getRoleApiResources(_0x5cfd81,_0x1f0b5e){const _0x45e461=a185_0x51f4,_0xf01a86=await apiRequest(_0x45e461(0x13a),{'method':'POST','body':{'appCode':_0x5cfd81,'roleId':_0x1f0b5e}});return extractList(_0xf01a86[_0x45e461(0xc6)]);}export async function listRoleUsers(_0xf952a0){const _0x43526a=a185_0x51f4,_0x175b6a=await apiRequest(_0x43526a(0x178),{'method':'POST','body':{'appCode':_0xf952a0}});return extractList(_0x175b6a[_0x43526a(0xc6)]);}export async function updateRoleUsers(_0x124973,_0x8bb24a){const _0x13fdac=a185_0x51f4;await apiRequest(_0x13fdac(0x15a),{'method':_0x13fdac(0x111),'body':{'appCode':_0x124973,'roleList':_0x8bb24a}});}export async function getPagePermit(_0x4562ee){const _0x419102=a185_0x51f4,_0x45580d=await apiRequest(_0x419102(0x13e)+buildQuery({'menuId':_0x4562ee}));return _0x45580d['data'];}export async function savePagePermit(_0x49b0d1){const _0x2ed0e7=a185_0x51f4,_0xe9aa42=await apiRequest(_0x2ed0e7(0xdc),{'method':_0x2ed0e7(0x111),'body':_0x49b0d1});return _0xe9aa42[_0x2ed0e7(0xc6)];}export async function getTenantMembers(_0x3a3b3a){const _0x19a408=a185_0x51f4,_0x50f18e=await apiRequest(_0x19a408(0x14a)+buildQuery({'code':_0x3a3b3a})),_0x5dec8b=_0x50f18e[_0x19a408(0xc6)]??{},_0x19b7f2=Array[_0x19a408(0x106)](_0x5dec8b?.['userTenantRelationList'])?_0x5dec8b['userTenantRelationList']:[];return _0x19b7f2[_0x19a408(0x182)](_0x368d2c=>_0x368d2c?.['status']===_0x19a408(0x145)||_0x368d2c?.[_0x19a408(0xd0)]===undefined)[_0x19a408(0xd4)](_0x3020f7=>({'userId':Number(_0x3020f7[_0x19a408(0x149)]??_0x3020f7['id']),'username':_0x3020f7[_0x19a408(0x126)],'nickname':_0x3020f7[_0x19a408(0x17e)],'status':_0x3020f7[_0x19a408(0xd0)],'email':_0x3020f7[_0x19a408(0x15b)],'mobile':_0x3020f7[_0x19a408(0x179)],'avatar':_0x3020f7[_0x19a408(0xc2)]}))[_0x19a408(0x182)](_0xde486b=>Number[_0x19a408(0x176)](_0xde486b['userId'])&&_0xde486b[_0x19a408(0x149)]>0x0);}
|
|
1
|
+
(function(_0xd0f9cc,_0x353b5c){const _0x10fc48=a185_0x163b,_0x195b67=_0xd0f9cc();while(!![]){try{const _0x462697=-parseInt(_0x10fc48(0x1c5))/0x1*(-parseInt(_0x10fc48(0x1f3))/0x2)+-parseInt(_0x10fc48(0x206))/0x3*(-parseInt(_0x10fc48(0x1ce))/0x4)+parseInt(_0x10fc48(0x176))/0x5*(parseInt(_0x10fc48(0x138))/0x6)+parseInt(_0x10fc48(0x173))/0x7*(-parseInt(_0x10fc48(0x204))/0x8)+parseInt(_0x10fc48(0x1ad))/0x9*(parseInt(_0x10fc48(0x1e8))/0xa)+parseInt(_0x10fc48(0x15e))/0xb+-parseInt(_0x10fc48(0x1af))/0xc;if(_0x462697===_0x353b5c)break;else _0x195b67['push'](_0x195b67['shift']());}catch(_0x1c87b2){_0x195b67['push'](_0x195b67['shift']());}}}(a185_0x1e9e,0x687de));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(_0x1ebe75){_activeCookie=_0x1ebe75||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(_0x3e76e9,_0x4db773){const _0xd766ce=a185_0x163b,_0xf78be4=_0x4db773 instanceof Error?_0x4db773[_0xd766ce(0x1db)]:String(_0x4db773);return CliErrors[_0xd766ce(0x171)](_0xd766ce(0x1e1)+_0x3e76e9+(_0xf78be4?'\x20('+_0xf78be4+')':''),_0xd766ce(0x13d));}async function apiRequest(_0x305518,_0x50479c={}){const _0x45b1aa=a185_0x163b,{method:method=_0x45b1aa(0x18d),body:_0x17113b,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x50479c,_0x1c6ca3=useRuntime?getRuntimeDomain():getApiDomain(),_0x262c35=_activeCookie||getCookie(),_0x4e5ce1=''+_0x1c6ca3+_0x305518,_0x48326e=new AbortController(),_0x23a715=setTimeout(()=>_0x48326e[_0x45b1aa(0x1e0)](),timeout);try{const _0x33beb8=await fetch(_0x4e5ce1,{'method':method,'headers':{'Content-Type':_0x45b1aa(0x196),'Cookie':_0x262c35,'X-Invoke-Source':_0x45b1aa(0x1eb),...headers},'body':_0x17113b?JSON[_0x45b1aa(0x187)](_0x17113b):undefined,'signal':_0x48326e[_0x45b1aa(0x168)]});let _0x4505ed;try{_0x4505ed=await _0x33beb8[_0x45b1aa(0x14f)]();}catch(_0x3b4a23){if(_0x3b4a23 instanceof Error&&_0x3b4a23[_0x45b1aa(0x1b5)]===_0x45b1aa(0x1a2))throw CliErrors[_0x45b1aa(0x171)](_0x45b1aa(0x169)+_0x4e5ce1);if(_0x33beb8['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError'](_0x45b1aa(0x1bd)+_0x33beb8[_0x45b1aa(0x167)]+')',_0x33beb8['status']>=0x190?_0x45b1aa(0x137):undefined);}if(!_0x33beb8['ok']||_0x4505ed[_0x45b1aa(0x1d8)]===![])throw CliErrors['apiError'](_0x4505ed[_0x45b1aa(0x17f)]||_0x4505ed[_0x45b1aa(0x1db)]||_0x45b1aa(0x172)+_0x33beb8[_0x45b1aa(0x167)],_0x4505ed[_0x45b1aa(0x179)]?_0x45b1aa(0x141)+_0x4505ed[_0x45b1aa(0x179)]:undefined);return _0x4505ed;}catch(_0x31ebda){if(_0x31ebda instanceof CliError)throw _0x31ebda;if(_0x31ebda instanceof Error&&_0x31ebda[_0x45b1aa(0x1b5)]===_0x45b1aa(0x1a2))throw CliErrors['apiError'](_0x45b1aa(0x169)+_0x4e5ce1);throw createFetchFailureError(_0x4e5ce1,_0x31ebda);}finally{clearTimeout(_0x23a715);}}async function apiFormRequest(_0x4038b5,_0x483183,_0x123ee4={}){const _0x4c71d9=a185_0x163b,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x123ee4,_0x3af7da=_activeCookie||getCookie(),_0x3d98b4=''+getApiDomain()+_0x4038b5,_0x32b3a3=new AbortController(),_0x1a22e6=setTimeout(()=>_0x32b3a3['abort'](),timeout);try{const _0x5f3b7e=await fetch(_0x3d98b4,{'method':_0x4c71d9(0x158),'headers':{'Cookie':_0x3af7da,'X-Invoke-Source':_0x4c71d9(0x1eb)},'body':_0x483183,'signal':_0x32b3a3[_0x4c71d9(0x168)]});let _0x510294;try{_0x510294=await _0x5f3b7e[_0x4c71d9(0x14f)]();}catch(_0x4bb727){if(_0x4bb727 instanceof Error&&_0x4bb727[_0x4c71d9(0x1b5)]===_0x4c71d9(0x1a2))throw CliErrors['apiError']('Request\x20timeout:\x20'+_0x3d98b4);throw CliErrors['apiError'](_0x4c71d9(0x1bd)+_0x5f3b7e[_0x4c71d9(0x167)]+')',_0x5f3b7e[_0x4c71d9(0x167)]>=0x190?_0x4c71d9(0x137):undefined);}if(!_0x5f3b7e['ok']||_0x510294['success']===![])throw CliErrors['apiError'](_0x510294[_0x4c71d9(0x17f)]||_0x510294[_0x4c71d9(0x1db)]||_0x4c71d9(0x172)+_0x5f3b7e[_0x4c71d9(0x167)],_0x510294['errorCode']?_0x4c71d9(0x141)+_0x510294[_0x4c71d9(0x179)]:undefined);return _0x510294;}catch(_0x13cdf5){if(_0x13cdf5 instanceof CliError)throw _0x13cdf5;if(_0x13cdf5 instanceof Error&&_0x13cdf5[_0x4c71d9(0x1b5)]===_0x4c71d9(0x1a2))throw CliErrors[_0x4c71d9(0x171)](_0x4c71d9(0x169)+_0x3d98b4);throw createFetchFailureError(_0x3d98b4,_0x13cdf5);}finally{clearTimeout(_0x1a22e6);}}export async function uploadDevelopmentFile(_0x16e318,_0x3d1dd9){const _0x170f7b=a185_0x163b,_0x8d0573=await readFile(_0x3d1dd9),_0xe2b822=new FormData();_0xe2b822['append'](_0x170f7b(0x133),_0x16e318),_0xe2b822['append'](_0x170f7b(0x1e2),new Blob([new Uint8Array(_0x8d0573)]),basename(_0x3d1dd9));const _0x382206=await apiFormRequest('/smartapi/common/uploadFile',_0xe2b822);return _0x382206[_0x170f7b(0x208)];}export async function queryDevelopmentFileUrl(_0x42a17f,_0x2b3ca2={}){const _0x51573a=a185_0x163b,_0x476268=await apiRequest(_0x51573a(0x134),{'method':_0x51573a(0x158),'body':{'filePath':_0x42a17f,'downloadFlag':_0x2b3ca2['download']??![],..._0x2b3ca2[_0x51573a(0x18e)]?{'longTerm':!![]}:{}}});return _0x476268['data'];}function isAuthFailure(_0x345950){const _0x157e49=a185_0x163b,_0x587559=_0x345950['errorMsg']||_0x345950[_0x157e49(0x1db)]||_0x345950['data']?.[_0x157e49(0x1db)]||_0x345950[_0x157e49(0x14c)]||_0x345950[_0x157e49(0x1d9)]||'';return _0x345950['errorCode']===_0x157e49(0x1cf)||_0x345950[_0x157e49(0x193)]===0x191||_0x345950[_0x157e49(0x193)]===_0x157e49(0x1f9)||_0x587559['includes'](_0x157e49(0x1f9))||_0x587559['includes']('Unauthorized')||_0x587559['includes']('登录')||_0x587559[_0x157e49(0x16d)]('认证');}export async function platformFetch(_0x94d6f6,_0x584a1e){const _0xca14ca=a185_0x163b;let _0x123575;try{_0x123575=await fetch(_0x94d6f6,{'method':_0x584a1e[_0xca14ca(0x188)]??_0xca14ca(0x18d),'headers':{'Content-Type':_0xca14ca(0x196),'Cookie':_0x584a1e[_0xca14ca(0x153)],'X-Invoke-Source':'cli:rabetbase'},..._0x584a1e[_0xca14ca(0x1b1)]&&{'body':JSON[_0xca14ca(0x187)](_0x584a1e['body'])}});}catch(_0xce7993){throw createFetchFailureError(_0x94d6f6,_0xce7993);}if(!_0x123575['ok']){if(_0x123575[_0xca14ca(0x167)]===0x191)throw CliErrors[_0xca14ca(0x17c)]();throw CliErrors[_0xca14ca(0x171)](_0x584a1e[_0xca14ca(0x16f)]+_0xca14ca(0x156)+_0x123575[_0xca14ca(0x167)]);}const _0x276a11=await _0x123575[_0xca14ca(0x14f)]();if(_0x276a11['success']===![]){if(isAuthFailure(_0x276a11))throw CliErrors[_0xca14ca(0x17c)]();throw CliErrors[_0xca14ca(0x171)](_0x276a11[_0xca14ca(0x17f)]||_0x276a11[_0xca14ca(0x1db)]||_0x584a1e[_0xca14ca(0x16f)]+_0xca14ca(0x128));}return _0x276a11['data'];}export async function platformRequest(_0x56138e,_0x5e4235){const _0x518f2a=a185_0x163b;if(/^https?:\/\//i[_0x518f2a(0x13a)](_0x56138e))throw CliErrors[_0x518f2a(0x1aa)](_0x518f2a(0x150)+_0x56138e,_0x518f2a(0x1f6));const _0x5d8c76=_0x56138e[_0x518f2a(0x1be)]('/')?_0x56138e:'/'+_0x56138e;return platformFetch(''+getApiDomain()+_0x5d8c76,_0x5e4235);}function cleanNewlines(_0x15bb60){const _0x574efd=a185_0x163b;return _0x15bb60[_0x574efd(0x1c2)](/[\r\n]+/g,'\x20')[_0x574efd(0x1ac)]();}function cleanDatasetName(_0x44e195){const _0x1ec60b=a185_0x163b;if(!_0x44e195['name'])return _0x44e195;return{..._0x44e195,'name':cleanNewlines(_0x44e195[_0x1ec60b(0x1b5)])};}export async function fetchModelList(_0x249ceb,_0x22988e){const _0x49c354=a185_0x163b,_0x5e1119=getEnv(),_0x1af3aa=new URLSearchParams({'appcode':_0x249ceb,'otype':'array'}),_0x1f9da7='/api/node-toolbox/dataset/model-list?'+_0x1af3aa[_0x49c354(0x1e5)]();logger[_0x49c354(0x1f0)](_0x49c354(0x175),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x5e1119+')',{'apiPath':_0x1f9da7});const _0x3dc0f8=await platformRequest(_0x1f9da7,{'cookie':_0x22988e,'label':_0x49c354(0x1a7)}),_0x5b02f5=(_0x3dc0f8[_0x49c354(0x1f5)]??[])[_0x49c354(0x1d0)](cleanDatasetName);return{'configArray':_0x5b02f5,'count':_0x5b02f5[_0x49c354(0x1d5)]};}export async function fetchDatasetDoc(_0x168ec1){const _0x305b69=a185_0x163b,{appCode:_0xc345b9,cookie:_0x3218b8,datasetCode:_0x4f2478,datasetId:_0x42cf64,extraParams:_0x25fc3b}=_0x168ec1,_0x2e5511=await platformRequest(_0x305b69(0x194),{'method':_0x305b69(0x158),'body':{'appCode':_0xc345b9,'datasetCode':_0x4f2478,'datasetId':_0x42cf64,..._0x25fc3b||{}},'cookie':_0x3218b8,'label':_0x305b69(0x164)+_0x4f2478+')'});if(!_0x2e5511||typeof _0x2e5511[_0x305b69(0x1ae)]!==_0x305b69(0x1b0))throw new Error(_0x305b69(0x12d)+_0x4f2478+_0x305b69(0x13e));return _0x2e5511['markdown'];}export async function getMenuTree(_0x2c0706,_0x24e2b8){const _0x512312=a185_0x163b,_0x198ff5=new URLSearchParams({'appCode':_0x2c0706});return platformRequest(_0x512312(0x186)+_0x198ff5[_0x512312(0x1e5)](),{'cookie':_0x24e2b8,'label':_0x512312(0x1c8)});}export async function createMenuRecord(_0x369898,_0x1d89be,_0x66a067){const _0x54b8e6=a185_0x163b;return platformRequest(_0x54b8e6(0x1dd),{'method':_0x54b8e6(0x158),'body':_0x369898,'cookie':_0x1d89be,'label':_0x66a067});}export async function updateMenuRecord(_0x50a422,_0x162aa9,_0x5266ca){return platformRequest('/smartapi/menu/update',{'method':'POST','body':_0x50a422,'cookie':_0x162aa9,'label':_0x5266ca});}export async function listBffScripts(_0x36214a,_0x1e9ff5,_0x37520a){const _0x98fbe5=a185_0x163b;let _0x240dc8=_0x98fbe5(0x19f)+_0x36214a;if(_0x1e9ff5)_0x240dc8+='&type='+_0x1e9ff5;const _0x2cdbf0=await apiRequest(_0x240dc8);let _0x144291=extractList(_0x2cdbf0[_0x98fbe5(0x208)]);if(_0x37520a?.['scriptName']){const _0x2da6d8=_0x37520a[_0x98fbe5(0x203)]['toLowerCase']();_0x144291=_0x144291[_0x98fbe5(0x190)](_0x39696d=>_0x39696d[_0x98fbe5(0x16e)]?.[_0x98fbe5(0x1a8)]()[_0x98fbe5(0x16d)](_0x2da6d8)||_0x39696d['description']?.[_0x98fbe5(0x1a8)]()['includes'](_0x2da6d8));}return _0x144291;}export async function getBffScriptInfo(_0x1e919b){const _0x2a3930=a185_0x163b,_0x5a43de=await apiRequest('/api/management/library/scripts/info?id='+_0x1e919b);if(!_0x5a43de[_0x2a3930(0x208)])throw CliErrors[_0x2a3930(0x1aa)]('BFF\x20script\x20not\x20found:\x20id='+_0x1e919b);return _0x5a43de[_0x2a3930(0x208)];}export async function saveBffScript(_0x2787ad){const _0x41b304=a185_0x163b,_0x58cce4=await apiRequest(_0x41b304(0x12f),{'method':'POST','body':_0x2787ad}),{id:_0x4d80d8,entity:_0x3ad8cd}=normalizeEntityWithIdResponse(_0x58cce4[_0x41b304(0x208)]);if(_0x4d80d8!==undefined){const _0x2806ae=typeof _0x3ad8cd['functionName']===_0x41b304(0x1b0)||typeof _0x3ad8cd[_0x41b304(0x161)]===_0x41b304(0x1b0)?_0x3ad8cd:undefined;return{'id':_0x4d80d8,'script':_0x2806ae};}throw CliErrors['apiError'](_0x41b304(0x148));}export async function deleteBffScript(_0x3e0e32){await apiRequest('/api/management/library/scripts/delete',{'method':'POST','body':{'id':_0x3e0e32}});}export async function getBffScriptStatistics(_0x225170){const _0x54e38d=a185_0x163b,_0x4bf7bf=await apiRequest(_0x54e38d(0x18b)+_0x225170);return extractList(_0x4bf7bf['data']);}export async function clearBffScriptCache(){const _0x402ca7=a185_0x163b,_0x37b275=await apiRequest(_0x402ca7(0x19e),{'method':'POST','useRuntime':!![]});return typeof _0x37b275[_0x402ca7(0x208)]===_0x402ca7(0x1b0)?_0x37b275[_0x402ca7(0x208)]:'';}export async function listBffDatasetOperations(_0x1054f1,_0x8a232b){const _0x3d9496=a185_0x163b,_0xb3e3a3=await apiRequest(_0x3d9496(0x12b),{'method':_0x3d9496(0x158),'body':{'appCode':_0x1054f1,'datasetId':_0x8a232b}});return _0xb3e3a3[_0x3d9496(0x208)];}export async function listSqlQueries(_0x317e5f,_0x30d65f){const _0x3b9f3c=a185_0x163b,_0x4281fc=await apiRequest(_0x3b9f3c(0x192),{'method':_0x3b9f3c(0x158),'body':{'appCode':_0x317e5f,'currentPage':_0x30d65f?.[_0x3b9f3c(0x1e3)]??0x1,'pageSize':_0x30d65f?.['pageSize']??0x32,'sqlCode':_0x30d65f?.[_0x3b9f3c(0x1a4)],'sqlName':_0x30d65f?.[_0x3b9f3c(0x1e9)]}});return _0x4281fc['data'];}export async function getSqlQueryInfo(_0x1b9382,_0x1d5fdf){const _0x51e43d=a185_0x163b,_0x11fcb5=await listSqlQueries(_0x1b9382,{'sqlCode':_0x1d5fdf}),_0x2619cb=_0x11fcb5[_0x51e43d(0x146)]?.[0x0];if(!_0x2619cb)throw CliErrors[_0x51e43d(0x1aa)](_0x51e43d(0x147)+_0x1d5fdf);return _0x2619cb;}export async function getSqlQueryDetail(_0x18912a){const _0x2e86d7=a185_0x163b,_0x578db5=await apiRequest(_0x2e86d7(0x183)+(_0x2e86d7(0x1d4)+encodeURIComponent(_0x18912a)));if(!_0x578db5[_0x2e86d7(0x208)])throw CliErrors['validation'](_0x2e86d7(0x147)+_0x18912a);return _0x578db5[_0x2e86d7(0x208)];}export async function getSqlQueryDetailById(_0x261e7c){const _0x29feb5=a185_0x163b,_0x2d224a=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x261e7c);if(!_0x2d224a['data'])throw CliErrors[_0x29feb5(0x1aa)]('SQL\x20query\x20not\x20found:\x20id='+_0x261e7c);return _0x2d224a['data'];}export async function createSqlQuery(_0x521290){const _0x3a31f6=a185_0x163b,_0x358fbe=await apiRequest(_0x3a31f6(0x15f),{'method':'POST','body':_0x521290}),{id:_0x366f73,entity:_0x1c5921}=normalizeEntityWithIdResponse(_0x358fbe['data']);if(!(_0x3a31f6(0x1a4)in _0x1c5921)&&_0x366f73)return getSqlQueryDetailById(_0x366f73);return normalizeSqlQueryEntity(_0x1c5921);}export async function updateSqlQuery(_0x5cd4e7){const _0x43e222=a185_0x163b,_0x2ac89e=await apiRequest(_0x43e222(0x144),{'method':_0x43e222(0x158),'body':_0x5cd4e7}),{id:_0x11bce8,entity:_0x4aee80}=normalizeEntityWithIdResponse(_0x2ac89e[_0x43e222(0x208)]);if(!(_0x43e222(0x1a4)in _0x4aee80)){if(_0x5cd4e7[_0x43e222(0x1a4)])return getSqlQueryDetail(_0x5cd4e7['sqlCode']);if(_0x11bce8)return getSqlQueryDetailById(_0x11bce8);}return normalizeSqlQueryEntity(_0x4aee80);}export async function deleteSqlQuery(_0x124283){const _0x657ebb=a185_0x163b;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x657ebb(0x158),'body':_0x124283});}function a185_0x163b(_0x40b67a,_0xdd4c5f){_0x40b67a=_0x40b67a-0x126;const _0x1e9e38=a185_0x1e9e();let _0x163ba4=_0x1e9e38[_0x40b67a];return _0x163ba4;}export async function saveSqlQuery(_0x1e246b){const _0x44cc88=a185_0x163b,_0xd4140b=await apiRequest(_0x44cc88(0x1a5),{'method':_0x44cc88(0x158),'body':_0x1e246b});return _0xd4140b[_0x44cc88(0x208)];}function normalizeSqlQueryEntity(_0x1178b2){const _0x249f92=a185_0x163b;return{..._0x1178b2,'id':Number(_0x1178b2['id']),'dbId':_0x1178b2[_0x249f92(0x15d)]==null?undefined:Number(_0x1178b2[_0x249f92(0x15d)]),'version':_0x1178b2[_0x249f92(0x19a)]==null?undefined:Number(_0x1178b2[_0x249f92(0x19a)])};}export async function executeSql(_0x6cadd6,_0x548030,_0x26b14a){const _0x15388f=a185_0x163b,_0x3e98e8=await apiRequest(_0x15388f(0x1d6),{'method':_0x15388f(0x158),'body':{'appCode':_0x6cadd6,'sqlCode':_0x548030,..._0x26b14a&&{'params':_0x26b14a}},'useRuntime':!![]});return _0x3e98e8['data'];}export async function executeDatasetDataOperation(_0x2e0e9a,_0x286587,_0x31a140,_0x1cc752={}){const _0x11f47d=a185_0x163b;try{const _0x1329c0=await apiRequest(_0x11f47d(0x149)+_0x2e0e9a+'/'+_0x286587+'/'+_0x31a140,{'method':_0x11f47d(0x158),'body':_0x1cc752,'useRuntime':!![]});return _0x1329c0['data'];}catch(_0x481d4d){if(_0x31a140===_0x11f47d(0x1da)&&_0x481d4d instanceof CliError&&_0x481d4d[_0x11f47d(0x193)]==='api_error'&&_0x1cc752['id']!==undefined&&_0x1cc752['id']!==null&&_0x1cc752['id']!==''){const _0x2c7b6a=await apiRequest(_0x11f47d(0x149)+_0x2e0e9a+'/'+_0x286587+_0x11f47d(0x1c9),{'method':_0x11f47d(0x158),'body':{'where':{'id':{'$eq':_0x1cc752['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x54a9b7=Array['isArray'](_0x2c7b6a['data']?.['tableData'])?_0x2c7b6a[_0x11f47d(0x208)][_0x11f47d(0x146)]:[];return _0x54a9b7[0x0]??null;}throw _0x481d4d;}}export async function listDatasets(_0x5dff09,_0x48abf5){const _0x585f56=a185_0x163b,_0x5a463a={'appCode':_0x5dff09,'deleted':_0x48abf5?.[_0x585f56(0x16c)]??![]};if(_0x48abf5?.[_0x585f56(0x193)])_0x5a463a['code']=_0x48abf5[_0x585f56(0x193)];if(_0x48abf5?.['name'])_0x5a463a[_0x585f56(0x1b5)]=_0x48abf5[_0x585f56(0x1b5)];const _0x364123=await apiRequest(_0x585f56(0x1f8),{'method':_0x585f56(0x158),'body':_0x5a463a});return extractList(_0x364123[_0x585f56(0x208)]);}export async function deleteDataset(_0x35b8e3,_0x3f2a51){const _0x4cc886=a185_0x163b;await apiRequest(_0x4cc886(0x1c6),{'method':'POST','body':{'appCode':_0x35b8e3,'datasetId':_0x3f2a51}});}export async function restoreDataset(_0x4a56ab,_0x2fece4){const _0x4278d2=a185_0x163b;await apiRequest(_0x4278d2(0x1e4),{'method':_0x4278d2(0x158),'body':{'appCode':_0x4a56ab,'datasetId':_0x2fece4}});}export async function previewTextGeneratedDataset(_0x1a0b81,_0x353206){const _0x4d8db1=a185_0x163b,_0x4dc941=await apiRequest(_0x4d8db1(0x16a),{'method':_0x4d8db1(0x158),'body':{'appCode':_0x1a0b81,'datasetName':_0x353206[_0x4d8db1(0x1f2)],'requirementDescription':_0x353206['requirementDescription']},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x4dc941['data'];}export async function startTextGeneratedDataset(_0x152006,_0x60a48d,_0x614d0c){const _0x105054=a185_0x163b,_0x572d10=await apiRequest(_0x105054(0x1ed),{'method':_0x105054(0x158),'body':{'appCode':_0x152006,..._0x614d0c?.[_0x105054(0x1b4)]?{'clientOperationId':_0x614d0c['clientOperationId']}:{},'design':_0x60a48d},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x572d10[_0x105054(0x208)];}export async function getTextGeneratedDatasetStatus(_0x13a508,_0x140776){const _0xc58936=a185_0x163b,_0xcacd56=new URLSearchParams({'appCode':_0x13a508});_0x140776[_0xc58936(0x1fb)]&&_0xcacd56[_0xc58936(0x197)]('operationId',_0x140776[_0xc58936(0x1fb)]);_0x140776[_0xc58936(0x1b4)]&&_0xcacd56[_0xc58936(0x197)](_0xc58936(0x1b4),_0x140776[_0xc58936(0x1b4)]);const _0xe343ec=await apiRequest(_0xc58936(0x20a)+_0xcacd56[_0xc58936(0x1e5)]());return _0xe343ec[_0xc58936(0x208)];}export async function searchDatasets(_0x521985,_0x4d8e00){const _0x5e6c15=a185_0x163b,_0x65a2e0=await listDatasets(_0x521985,{'name':_0x4d8e00}),_0x50688b=_0x4d8e00['toLowerCase'](),_0x56bfed=new Set(_0x65a2e0[_0x5e6c15(0x1d0)](_0x23b15e=>_0x23b15e['id'])),_0x40b18b=_0x65a2e0['filter'](_0x5c9483=>_0x5c9483['dbtableConfig']?.[_0x5e6c15(0x165)]?.['toLowerCase']()['includes'](_0x50688b)||_0x5c9483[_0x5e6c15(0x1a6)]?.[_0x5e6c15(0x1a8)]()[_0x5e6c15(0x16d)](_0x50688b)),_0x39329e=await listDatasets(_0x521985,{'code':_0x4d8e00});for(const _0x522faa of _0x39329e){!_0x56bfed['has'](_0x522faa['id'])&&(_0x65a2e0[_0x5e6c15(0x17d)](_0x522faa),_0x56bfed[_0x5e6c15(0x181)](_0x522faa['id']));}return _0x65a2e0;}export function normalizeDatasetOperations(_0x3e97d4){const _0x2f4660=a185_0x163b;if(Array[_0x2f4660(0x189)](_0x3e97d4))return _0x3e97d4['filter'](_0x172a78=>_0x172a78!=null&&typeof _0x172a78===_0x2f4660(0x182));if(_0x3e97d4&&typeof _0x3e97d4===_0x2f4660(0x182))return Object[_0x2f4660(0x12e)](_0x3e97d4)[_0x2f4660(0x190)](([,_0x58e0db])=>_0x58e0db!=null&&typeof _0x58e0db===_0x2f4660(0x182))['map'](([_0x5aec1f,_0x4a9c9])=>({..._0x4a9c9,'name':_0x4a9c9[_0x2f4660(0x1b5)]??_0x4a9c9[_0x2f4660(0x180)]??_0x5aec1f}));return[];}export async function getDatasetDetail(_0x434e7b){const _0x1ae7ae=a185_0x163b,_0x4ea690=/^\d+$/[_0x1ae7ae(0x13a)](_0x434e7b)?'id':_0x1ae7ae(0x193),_0x241cdb=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x4ea690+'='+_0x434e7b);return _0x241cdb['data'];}function a185_0x1e9e(){const _0x26b779=['label','/smartapi/question/er-config/business-group/edit','apiError','API\x20error:\x20','15148HBmWAq','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','fetch-model-list','10lyQekw','create','ER\x20relation\x20does\x20not\x20exist','errorCode','/smartapi/db-analysis/jobs/cancel','.getOne(id);','authRequired','push','Operation\x20\x22','errorMsg','operationName','add','object','/smartapi/custom/getUserCustomSql','/smartapi/question/er-config/cli/update-single','/smartapi/question/er-config/cli/delete-single','/smartapi/menu/find?','stringify','method','isArray','/smartapi/dblink/testConnect','/api/management/library/scripts/statistics?appCode=','/smartapi/permit/resource/get-menu-list','GET','longTerm','avatar','filter','modelCode','/smartapi/custom/queryUserCustomSqlList','code','/api/node-toolbox/api-doc-generator','ENABLE','application/json','set','userTenantRelationList','const\x20results\x20=\x20data.execResult\x20||\x20[];','version','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','email','warn','/api/management/script/cache/clear','/api/management/library/scripts/list?appCode=','enabled','CUSTOM','AbortError','min','sqlCode','/api/node-toolbox/sql/save','description','Fetch\x20datasets','toLowerCase','remark','validation','/smartapi/lovrabet/detail?pageId=','trim','5904CQBieP','markdown','19016436rPBRmp','string','body','update','table','clientOperationId','name','tags','pageSize','join','.create({\x20/*\x20fields\x20*/\x20});','value','/userTenant/getByTenantCode','/smartapi/permit/user-role/get-user-list','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','startsWith','/smartapi/permit/role/delete','/smartapi/app-config/getByKey','/smartapi/lovrabet/dataset/','replace','list','/smartapi/app-config/update','830353OlFxYs','/smartapi/dataset/delete-dataset','remove','Fetch\x20menu\x20list','/filter','isFinite','\x20\x20currentPage:\x201,','/smartapi/dataset/update-driven-data','/smartapi/app-config/delete','95540jvxdoW','UNAUTHORIZED','map','//\x20SQL:\x20','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','hint','?sqlCode=','length','/api/custom/executeSql','totalCount','success','error','getOne','message','summary','/smartapi/menu/create','/notification/channel-config/list','/smartapi/permit/role/get-permit-list','abort','Request\x20failed:\x20','file','currentPage','/smartapi/dataset/restore-dataset','toString','type','nickname','7150IBpdfG','sqlName','dataset_','cli:rabetbase','\x20\x20where:\x20{},','/smartapi/dataset/text-generate/start','/smartapi/db-analysis/status/','/smartapi/question/er-config/cli/detail?','info','modelId','datasetName','2ONWsEb','needPublic','configArray','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','\x20of\x20','/smartapi/dataset/get-dataset-list','401','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','operationId','//\x20','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/dblink/update','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','includeImports','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','username','scriptName','856QNIquV','/smartapi/dblink/getList','57LNLusU','requestFields','data','tableList','/smartapi/dataset/text-generate/status?','/smartapi/permit/role/update','key','\x20failed','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','dbtableConfig','/smartapi/dataset/get-dataset-operation','physicalTableCount','Invalid\x20response\x20format\x20(','entries','/api/management/library/scripts/save','/smartapi/app-config/create','sdk','.remove(id);','appCode','/smartapi/common/queryFileUrl','Dataset\x20not\x20found:\x20','DATA_NOT_EXIST','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','363174fqxflj','const\x20result\x20=\x20await\x20client.models.','test','needSelf','datasetTableCount','Check\x20network\x20connectivity\x20and\x20try\x20again.','):\x20missing\x20data.markdown\x20field','relation','\x20\x20sqlCode:\x20\x27','API\x20error\x20code:\x20','\x20apps.\x20','roleType','/smartapi/custom/updateUserCustomSql','.filter({','tableData','SQL\x20query\x20not\x20found:\x20','BFF\x20save\x20returned\x20no\x20valid\x20id','/api/','/smartapi/question/er-config','/smartapi/permit/resource/get-api-list','errorMessage','/standard-page-status?appCode=','operations','json','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','permits','Page\x20not\x20found:\x20','cookie','\x20\x20});','\x20\x20return\x20rows;','\x20failed,\x20HTTP\x20','roleName','POST','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','userId','/smartapi/app/getList','/smartapi/dblink/delete','dbId','4069813WeMLVP','/smartapi/custom/saveUserCustomSql','(/*\x20params\x20*/);','scriptType','/generate-standard-pages/start','mobile','Fetch\x20doc\x20(','tableName','\x20\x20\x20\x20sqlCode:\x20\x27','status','signal','Request\x20timeout:\x20','/smartapi/dataset/text-generate/preview','/smartapi/lovrabet/update-page','deleted','includes','functionName'];a185_0x1e9e=function(){return _0x26b779;};return a185_0x1e9e();}export async function updateDrivenData(_0x18a21a){const _0x1cc4b7=a185_0x163b,_0x1ef8c6=await apiRequest(_0x1cc4b7(0x1cc),{'method':_0x1cc4b7(0x158),'body':_0x18a21a});return _0x1ef8c6['data'];}export async function getDatasetOperations(_0x3cf590){const _0x1133ed=a185_0x163b,_0x614f9a=await getDatasetDetail(_0x3cf590),_0x1524ce=normalizeDatasetOperations(_0x614f9a[_0x1133ed(0x14e)])[_0x1133ed(0x1d0)](_0xa105c6=>({'name':_0xa105c6['name']||_0xa105c6['operationName'],'displayName':_0xa105c6['displayName']||_0xa105c6[_0x1133ed(0x1b5)],'type':_0xa105c6[_0x1133ed(0x1e6)],'method':_0xa105c6[_0x1133ed(0x188)],'path':_0xa105c6['path'],'enabled':_0xa105c6[_0x1133ed(0x1a0)]??!![],'requestFields':_0xa105c6[_0x1133ed(0x207)],'responseFields':_0xa105c6['responseFields']}));return{'dataset':{'id':_0x614f9a['id']??_0x614f9a[_0x1133ed(0x1f1)],'name':_0x614f9a['name'],'code':_0x614f9a[_0x1133ed(0x193)]||_0x614f9a[_0x1133ed(0x191)],'tableName':_0x614f9a[_0x1133ed(0x165)]||_0x614f9a[_0x1133ed(0x12a)]?.[_0x1133ed(0x165)]},'operations':_0x1524ce};}export async function getOperationDetail(_0x549cc1,_0x3b2305,_0x1a80ab){const _0x495265=a185_0x163b;let _0x404ca0=_0x3b2305;if(!/^\d+$/['test'](_0x3b2305)){const _0x118d9d=await listDatasets(_0x549cc1,{'code':_0x3b2305}),_0x115ebd=_0x118d9d['find'](_0x1b2c1c=>_0x1b2c1c[_0x495265(0x193)]===_0x3b2305||String(_0x1b2c1c['id'])===_0x3b2305);if(!_0x115ebd)throw CliErrors[_0x495265(0x1aa)](_0x495265(0x135)+_0x3b2305);_0x404ca0=String(_0x115ebd['id']);}const _0x47b61d=await getDatasetDetail(_0x404ca0),_0x4e2a42=normalizeDatasetOperations(_0x47b61d[_0x495265(0x14e)])['find'](_0x16bd4e=>(_0x16bd4e[_0x495265(0x1b5)]||_0x16bd4e[_0x495265(0x180)])===_0x1a80ab);if(!_0x4e2a42)throw CliErrors[_0x495265(0x1aa)](_0x495265(0x17e)+_0x1a80ab+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x3b2305);return{'dataset':{'id':_0x47b61d['id']??_0x47b61d['modelId'],'name':_0x47b61d[_0x495265(0x1b5)],'code':_0x47b61d[_0x495265(0x193)]||_0x47b61d[_0x495265(0x191)],'tableName':_0x47b61d['tableName']||_0x47b61d['dbtableConfig']?.['tableName']},'operation':_0x4e2a42};}export async function startGenerateStandardPages(_0x691121,_0x57af6d,_0x521357){const _0x454e05=a185_0x163b,_0x940f62=await apiRequest(_0x454e05(0x1c1)+_0x57af6d+_0x454e05(0x162),{'method':_0x454e05(0x158),'body':{'appCode':_0x691121,..._0x521357?.['clientOperationId']?{'clientOperationId':_0x521357['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x940f62[_0x454e05(0x208)];}export async function getGenerateStandardPagesStatus(_0x4d172e,_0x5d41d8,_0x52e891){const _0x18c02d=a185_0x163b,_0x1423f1=new URLSearchParams({'appCode':_0x4d172e});_0x52e891[_0x18c02d(0x1fb)]&&_0x1423f1[_0x18c02d(0x197)]('operationId',_0x52e891['operationId']);_0x52e891['clientOperationId']&&_0x1423f1[_0x18c02d(0x197)]('clientOperationId',_0x52e891[_0x18c02d(0x1b4)]);const _0x2e2c5f=await apiRequest(_0x18c02d(0x1c1)+_0x5d41d8+'/generate-standard-pages/status?'+_0x1423f1[_0x18c02d(0x1e5)]());return _0x2e2c5f['data'];}export async function getStandardPageStatus(_0x23b7c0,_0xd4ff26){const _0x1bef78=a185_0x163b,_0x2af3d0=await apiRequest('/smartapi/lovrabet/dataset/'+_0xd4ff26+_0x1bef78(0x14d)+encodeURIComponent(_0x23b7c0));return _0x2af3d0[_0x1bef78(0x208)];}export async function tryGetStandardPageStatus(_0x383167,_0x154c7c){const _0x26e2cb=a185_0x163b;try{return await getStandardPageStatus(_0x383167,_0x154c7c);}catch(_0x286ad7){if(_0x286ad7 instanceof CliError&&_0x286ad7[_0x26e2cb(0x193)]==='api_error'&&/404|not found|non-json response/i[_0x26e2cb(0x13a)](_0x286ad7[_0x26e2cb(0x1db)]))return null;throw _0x286ad7;}}export async function syncStandardPages(_0x3aad2b,_0x15bba6){const _0x1f4a87=a185_0x163b,_0x9bc83d=await apiRequest('/smartapi/lovrabet/dataset/'+_0x15bba6+'/sync-to-pages',{'method':'POST','body':{'appCode':_0x3aad2b}});return _0x9bc83d[_0x1f4a87(0x208)];}export async function getPageDetail(_0x1428f1){const _0x42f686=a185_0x163b,_0x20a647=await apiRequest(_0x42f686(0x1ab)+_0x1428f1);if(!_0x20a647[_0x42f686(0x208)])throw CliErrors[_0x42f686(0x1aa)](_0x42f686(0x152)+_0x1428f1);return _0x20a647['data'];}export async function updatePage(_0x14f7e3,_0x553edf,_0x4de5b3,_0x40c803){const _0x11d9e5=a185_0x163b,_0x3cf66f=await apiRequest(_0x11d9e5(0x16b),{'method':'POST','body':{'appCode':_0x14f7e3,'pageId':_0x553edf,'code':_0x4de5b3,'datasetIds':_0x40c803}});return _0x3cf66f['data'];}export function generateSdkCode(_0x3fe3ae,_0x37d290,_0x44a1a4){const _0x191757=a185_0x163b,_0x186060=_0x44a1a4?.['includeImports']??!![],_0x2a28bd=_0x191757(0x1ea)+_0x3fe3ae[_0x191757(0x193)]?.[_0x191757(0x1c2)](/-/g,'_'),_0x134057=_0x37d290['name']||_0x37d290[_0x191757(0x180)]||_0x191757(0x190),_0x31a521=[];_0x186060&&_0x31a521[_0x191757(0x17d)](_0x191757(0x1d2),'',_0x191757(0x1ff),'');_0x31a521[_0x191757(0x17d)](_0x191757(0x1fc)+_0x3fe3ae[_0x191757(0x1b5)]+'\x20('+(_0x3fe3ae['tableName']||_0x191757(0x1b3))+')');if(_0x134057===_0x191757(0x190))_0x31a521['push'](_0x191757(0x139)+_0x2a28bd+_0x191757(0x145),_0x191757(0x1ec),'\x20\x20pageSize:\x2020,',_0x191757(0x1cb),'});');else{if(_0x134057==='getOne')_0x31a521['push'](_0x191757(0x139)+_0x2a28bd+_0x191757(0x17b));else{if(_0x134057===_0x191757(0x177))_0x31a521[_0x191757(0x17d)]('const\x20result\x20=\x20await\x20client.models.'+_0x2a28bd+_0x191757(0x1b9));else{if(_0x134057===_0x191757(0x1b2))_0x31a521[_0x191757(0x17d)]('const\x20result\x20=\x20await\x20client.models.'+_0x2a28bd+_0x191757(0x201));else _0x134057==='delete'||_0x134057===_0x191757(0x1c7)?_0x31a521['push'](_0x191757(0x139)+_0x2a28bd+_0x191757(0x132)):_0x31a521[_0x191757(0x17d)](_0x191757(0x139)+_0x2a28bd+'.'+_0x134057+_0x191757(0x160));}}}return _0x31a521[_0x191757(0x1b8)]('\x0a');}export function generateSqlCodeTemplate(_0x1da46d,_0x5a9849){const _0x219715=a185_0x163b,_0x264e22=_0x5a9849?.['target']??_0x219715(0x131),_0x4c24ab=_0x5a9849?.[_0x219715(0x200)]??!![],_0x3d7c19=[];return _0x3d7c19[_0x219715(0x17d)](_0x219715(0x1d1)+_0x1da46d[_0x219715(0x1e9)]+'\x20('+_0x1da46d[_0x219715(0x1a4)]+')'),_0x264e22===_0x219715(0x131)?(_0x4c24ab&&_0x3d7c19[_0x219715(0x17d)](_0x219715(0x1d2),'',_0x219715(0x1ff),''),_0x3d7c19[_0x219715(0x17d)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x219715(0x140)+_0x1da46d['sqlCode']+'\x27,',_0x219715(0x129),'});',_0x219715(0x159),_0x219715(0x199))):_0x3d7c19[_0x219715(0x17d)](_0x219715(0x174),_0x219715(0x19b),_0x219715(0x1fa),_0x219715(0x166)+_0x1da46d[_0x219715(0x1a4)]+'\x27,',_0x219715(0x1fd),_0x219715(0x154),_0x219715(0x155),'}'),_0x3d7c19[_0x219715(0x1b8)]('\x0a');}export async function getErConfig(_0x1b16dc,_0xbbf09e){const _0x2244af=a185_0x163b,_0x298fae=await apiRequest(_0x2244af(0x14a),{'method':_0x2244af(0x158),'body':{'appCode':_0x1b16dc,'dblinkId':_0xbbf09e},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x298fae[_0x2244af(0x208)];}export async function getErRelationDetail(_0x308428,_0x12e9d4){const _0x2b8958=a185_0x163b,_0x2e04c1=new URLSearchParams({'appCode':_0x308428,'relationId':String(_0x12e9d4)});try{const _0xea7fbb=await apiRequest(_0x2b8958(0x1ef)+_0x2e04c1[_0x2b8958(0x1e5)]());return _0xea7fbb[_0x2b8958(0x208)]?.[_0x2b8958(0x13f)]??null;}catch(_0xbb912){if(_0xbb912 instanceof CliError&&_0xbb912[_0x2b8958(0x193)]==='api_error'&&(_0xbb912[_0x2b8958(0x1d3)]?.['includes'](_0x2b8958(0x136))||_0xbb912[_0x2b8958(0x1d3)]==='API\x20error\x20code:\x20306'&&_0xbb912[_0x2b8958(0x1db)]===_0x2b8958(0x178)))return null;throw _0xbb912;}}export async function createErRelation(_0x462772){const _0x3d3354=await apiRequest('/smartapi/question/er-config/cli/erCreate',{'method':'POST','body':_0x462772,'allowNonJsonSuccess':!![]});return _0x3d3354['data'];}export async function updateErRelation(_0x3025ca){const _0xd3c203=a185_0x163b,_0x3abd3f=await apiRequest(_0xd3c203(0x184),{'method':_0xd3c203(0x158),'body':_0x3025ca,'allowNonJsonSuccess':!![]});return _0x3abd3f[_0xd3c203(0x208)];}export async function deleteErRelation(_0x29a8e9){const _0xb85b54=a185_0x163b,_0x3abbe1=await apiRequest(_0xb85b54(0x185),{'method':_0xb85b54(0x158),'body':_0x29a8e9,'allowNonJsonSuccess':!![]});return _0x3abbe1[_0xb85b54(0x208)];}export async function updateErBusinessGroup(_0x13fe38){const _0xc2a04=a185_0x163b,_0x13ac86=await apiRequest(_0xc2a04(0x170),{'method':'POST','body':_0x13fe38,'allowNonJsonSuccess':!![]});return _0x13ac86[_0xc2a04(0x208)];}function buildQuery(_0x4af873){const _0x510377=a185_0x163b,_0x2846f4=new URLSearchParams();for(const [_0x2b9ff0,_0x486b88]of Object[_0x510377(0x12e)](_0x4af873)){if(_0x486b88===undefined||_0x486b88==='')continue;_0x2846f4['set'](_0x2b9ff0,String(_0x486b88));}const _0x3ee393=_0x2846f4[_0x510377(0x1e5)]();return _0x3ee393?'?'+_0x3ee393:'';}export async function listNotificationChannelConfigs(_0x2ff84c,_0x5f3522){const _0x1933d2=a185_0x163b,_0x53bb53=await apiRequest(_0x1933d2(0x1de)+buildQuery({'appCode':_0x2ff84c,'channelType':_0x5f3522}));return Array[_0x1933d2(0x189)](_0x53bb53[_0x1933d2(0x208)])?_0x53bb53['data']:[];}export async function listAppConfigs(_0xf4cec6,_0x1ecdfb){const _0x18ea54=a185_0x163b,_0xf76945=await apiRequest('/smartapi/app-config/list',{'method':_0x18ea54(0x158),'body':{'appCode':_0xf4cec6,..._0x1ecdfb?.[_0x18ea54(0x127)]?{'key':_0x1ecdfb[_0x18ea54(0x127)]}:{},..._0x1ecdfb?.[_0x18ea54(0x1b6)]?{'tags':_0x1ecdfb[_0x18ea54(0x1b6)]}:{}}});return extractAppConfigList(_0xf76945[_0x18ea54(0x208)]);}export async function getAppConfigByKey(_0xe675bd,_0x228010){const _0x162180=a185_0x163b,_0x147e5b=await apiRequest(_0x162180(0x1c0)+buildQuery({'appCode':_0xe675bd,'key':_0x228010}));return _0x147e5b[_0x162180(0x208)]??null;}export async function createAppConfig(_0x204dc3){const _0x3efd60=a185_0x163b,_0x54fa7a=await apiRequest(_0x3efd60(0x130),{'method':'POST','body':{'appCode':_0x204dc3[_0x3efd60(0x133)],'key':_0x204dc3[_0x3efd60(0x127)],'value':_0x204dc3['value'],..._0x204dc3[_0x3efd60(0x1b6)]?{'tags':_0x204dc3[_0x3efd60(0x1b6)]}:{}}});return _0x54fa7a[_0x3efd60(0x208)];}export async function updateAppConfig(_0x17b8d1){const _0x196ac0=a185_0x163b;await apiRequest(_0x196ac0(0x1c4),{'method':_0x196ac0(0x158),'body':{'id':_0x17b8d1['id'],'appCode':_0x17b8d1[_0x196ac0(0x133)],'key':_0x17b8d1[_0x196ac0(0x127)],'value':_0x17b8d1[_0x196ac0(0x1ba)],..._0x17b8d1[_0x196ac0(0x1b6)]?{'tags':_0x17b8d1[_0x196ac0(0x1b6)]}:{}}});}export async function deleteAppConfig(_0x2c0099){const _0x5e5bd9=a185_0x163b;await apiRequest(_0x5e5bd9(0x1cd),{'method':_0x5e5bd9(0x158),'body':_0x2c0099});}function extractAppConfigList(_0x2a08f6){const _0x45c16b=a185_0x163b;if(Array[_0x45c16b(0x189)](_0x2a08f6))return _0x2a08f6;if(_0x2a08f6&&typeof _0x2a08f6===_0x45c16b(0x182)&&Array['isArray'](_0x2a08f6[_0x45c16b(0x1c3)]))return _0x2a08f6[_0x45c16b(0x1c3)];return extractList(_0x2a08f6);}export async function listDbLinks(_0x51bed4,_0x53bbc9){const _0x30cdc=a185_0x163b,_0x1bc4d4=await apiRequest(_0x30cdc(0x205),{'method':'POST','body':{'appCode':_0x51bed4,'currentPage':_0x53bbc9?.[_0x30cdc(0x1e3)]??0x1,'pageSize':_0x53bbc9?.[_0x30cdc(0x1b7)]??0x64}});return{'items':extractList(_0x1bc4d4[_0x30cdc(0x208)]),'paging':extractPaging(_0x1bc4d4[_0x30cdc(0x208)])};}export async function getDbLinkInfo(_0x1d07c3){const _0x431820=a185_0x163b,_0x2383bd=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x1d07c3}));return _0x2383bd[_0x431820(0x208)];}export async function createDbLink(_0x5480d5){const _0x9d53d3=a185_0x163b,_0x3fede7=await apiRequest('/smartapi/dblink/create',{'method':_0x9d53d3(0x158),'body':_0x5480d5});return _0x3fede7[_0x9d53d3(0x208)];}export async function updateDbLink(_0x36c4a1){const _0x261f66=a185_0x163b,_0x162261=await apiRequest(_0x261f66(0x1fe),{'method':'POST','body':_0x36c4a1});return _0x162261[_0x261f66(0x208)];}export async function deleteDbLink(_0x4d01f5){const _0x421c6b=a185_0x163b;await apiRequest(_0x421c6b(0x15c),{'method':_0x421c6b(0x158),'body':{'id':_0x4d01f5}});}export async function testDbLinkConnect(_0x557958){const _0x1956f8=a185_0x163b,_0x2ef4dd=await apiRequest(_0x1956f8(0x18a)+buildQuery({'id':_0x557958}));return _0x2ef4dd[_0x1956f8(0x208)];}export async function startDbAnalysis(_0x4dbd5e,_0x313ece){const _0x5385fa=a185_0x163b,_0x1add33=await apiRequest('/smartapi/db-analysis/start',{'method':_0x5385fa(0x158),'body':{'dbLinkId':_0x4dbd5e,..._0x313ece&&_0x313ece[_0x5385fa(0x1d5)]>0x0?{'tableNames':_0x313ece}:{}}});return _0x1add33[_0x5385fa(0x208)];}export async function cancelDbAnalysis(_0x41bf77){const _0x492ff7=a185_0x163b;await apiRequest(_0x492ff7(0x17a)+buildQuery({'planId':_0x41bf77}),{'method':_0x492ff7(0x158)});}export async function getDbAnalysisStatus(_0x9d3d1d){const _0xd3cad7=a185_0x163b,_0x198ab7=await apiRequest(_0xd3cad7(0x1ee)+encodeURIComponent(_0x9d3d1d));return _0x198ab7[_0xd3cad7(0x208)];}export async function getDbAllTableList(_0x2ceec8,_0x18eae0){const _0x2f8d45=await apiRequest('/smartapi/dblink/getAllTableList'+buildQuery({'appCode':_0x2ceec8,'dbLinkId':_0x18eae0})),_0x3ab394=_0x2f8d45['data'];if(Array['isArray'](_0x3ab394))return _0x3ab394;return extractList(_0x3ab394);}export async function getDbTableDiff(_0x2976dc,_0x3fd853,_0x5bed7c){const _0x3be7fe=a185_0x163b,_0x11389c=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x2976dc,'dbLinkId':_0x3fd853,'pageIndex':_0x5bed7c?.['pageIndex']??0x1,'pageSize':_0x5bed7c?.[_0x3be7fe(0x1b7)]??0x14,'tableName':_0x5bed7c?.['tableName']})),_0x4792e6=_0x11389c[_0x3be7fe(0x208)];return{'totalCount':_0x4792e6?.[_0x3be7fe(0x1d7)]??0x0,'physicalTableCount':_0x4792e6?.[_0x3be7fe(0x12c)]??0x0,'datasetTableCount':_0x4792e6?.[_0x3be7fe(0x13c)]??0x0,..._0x4792e6?.[_0x3be7fe(0x1dc)]?{'summary':_0x4792e6[_0x3be7fe(0x1dc)]}:{},'tableList':Array[_0x3be7fe(0x189)](_0x4792e6?.[_0x3be7fe(0x209)])?_0x4792e6['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x595f11=a185_0x163b,_0x229f8c=await apiRequest(_0x595f11(0x15b),{'method':_0x595f11(0x158),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x56b1b6=extractList(_0x229f8c[_0x595f11(0x208)]),_0x4e6a19=extractPaging(_0x229f8c[_0x595f11(0x208)]);return _0x4e6a19&&_0x4e6a19['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x595f11(0x19d)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+_0x595f11(0x1f7)+_0x4e6a19[_0x595f11(0x1d7)]+_0x595f11(0x142)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x56b1b6;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x120e58,_0x100dcd){const _0x330aad=a185_0x163b,_0x1d4dfd=Math[_0x330aad(0x1a3)](Math['max'](_0x100dcd?.['pageSize']??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x27fb2e=await apiRequest('/smartapi/permit/role/get-list',{'method':_0x330aad(0x158),'body':{'appCode':_0x120e58,'currentPage':_0x100dcd?.[_0x330aad(0x1e3)]??0x1,'pageSize':_0x1d4dfd}});return{'items':extractList(_0x27fb2e[_0x330aad(0x208)]),'paging':extractPaging(_0x27fb2e[_0x330aad(0x208)])};}export async function getAppRole(_0x67770){const _0x1a6ec4=a185_0x163b,_0x4edada=await apiRequest('/smartapi/permit/role/get-one'+buildQuery({'id':_0x67770}));return _0x4edada[_0x1a6ec4(0x208)];}export async function createAppRole(_0x1bc6d1){const _0x56c1a9=a185_0x163b,_0x4333f0=await apiRequest('/smartapi/permit/role/create',{'method':_0x56c1a9(0x158),'body':{'appCode':_0x1bc6d1[_0x56c1a9(0x133)],'roleName':_0x1bc6d1[_0x56c1a9(0x157)],'roleType':_0x56c1a9(0x1a1),..._0x1bc6d1[_0x56c1a9(0x1a9)]?{'remark':_0x1bc6d1[_0x56c1a9(0x1a9)]}:{}}});return _0x4333f0['data'];}export async function updateAppRole(_0x39e6bc){const _0x33f61d=a185_0x163b,_0x2faf37=await apiRequest(_0x33f61d(0x126),{'method':_0x33f61d(0x158),'body':{'id':_0x39e6bc['id'],'appCode':_0x39e6bc[_0x33f61d(0x133)],..._0x39e6bc[_0x33f61d(0x143)]?{'roleType':_0x39e6bc['roleType']}:{},..._0x39e6bc[_0x33f61d(0x157)]!==undefined?{'roleName':_0x39e6bc['roleName']}:{},..._0x39e6bc['remark']!==undefined?{'remark':_0x39e6bc[_0x33f61d(0x1a9)]}:{},..._0x39e6bc[_0x33f61d(0x151)]?{'permits':_0x39e6bc['permits']}:{}}});return _0x2faf37[_0x33f61d(0x208)];}export async function deleteAppRole(_0x5edf84){const _0x20a15b=a185_0x163b;await apiRequest(_0x20a15b(0x1bf),{'method':'POST','body':{'id':_0x5edf84}});}export async function listPermitRoles(_0x198462,_0x129ddb){const _0x51ec6c=a185_0x163b,_0x162348=await apiRequest(_0x51ec6c(0x1df),{'method':_0x51ec6c(0x158),'body':{'appCode':_0x198462,..._0x129ddb?.[_0x51ec6c(0x13b)]!==undefined?{'needSelf':_0x129ddb[_0x51ec6c(0x13b)]}:{},..._0x129ddb?.[_0x51ec6c(0x1f4)]!==undefined?{'needPublic':_0x129ddb[_0x51ec6c(0x1f4)]}:{}}});return extractList(_0x162348[_0x51ec6c(0x208)]);}export async function getRoleMenuResources(_0xe5738b,_0x1d7923){const _0x144e5d=a185_0x163b,_0xde9890=await apiRequest(_0x144e5d(0x18c),{'method':_0x144e5d(0x158),'body':{'appCode':_0xe5738b,'roleId':_0x1d7923}});return extractList(_0xde9890[_0x144e5d(0x208)]);}export async function getRoleApiResources(_0x3808e9,_0x2ecda9){const _0x309b4f=a185_0x163b,_0x231f31=await apiRequest(_0x309b4f(0x14b),{'method':'POST','body':{'appCode':_0x3808e9,'roleId':_0x2ecda9}});return extractList(_0x231f31['data']);}export async function listRoleUsers(_0x2ec5e5){const _0x562d93=a185_0x163b,_0xf257b5=await apiRequest(_0x562d93(0x1bc),{'method':_0x562d93(0x158),'body':{'appCode':_0x2ec5e5}});return extractList(_0xf257b5[_0x562d93(0x208)]);}export async function updateRoleUsers(_0x5c1a11,_0x1e4ce5){const _0x5dfc00=a185_0x163b;await apiRequest('/smartapi/permit/user-role/update-user-list',{'method':_0x5dfc00(0x158),'body':{'appCode':_0x5c1a11,'roleList':_0x1e4ce5}});}export async function getPagePermit(_0x4af800){const _0x42e471=a185_0x163b,_0x4111d9=await apiRequest('/smartapi/permit/page/get-one'+buildQuery({'menuId':_0x4af800}));return _0x4111d9[_0x42e471(0x208)];}export async function savePagePermit(_0xb6af92){const _0x4f776b=a185_0x163b,_0xf768af=await apiRequest('/smartapi/permit/page/save',{'method':_0x4f776b(0x158),'body':_0xb6af92});return _0xf768af[_0x4f776b(0x208)];}export async function getTenantMembers(_0x284437){const _0x12b119=a185_0x163b,_0x3bda99=await apiRequest(_0x12b119(0x1bb)+buildQuery({'code':_0x284437})),_0x18e550=_0x3bda99['data']??{},_0x4fb3b9=Array[_0x12b119(0x189)](_0x18e550?.[_0x12b119(0x198)])?_0x18e550[_0x12b119(0x198)]:[];return _0x4fb3b9[_0x12b119(0x190)](_0x3745ed=>_0x3745ed?.[_0x12b119(0x167)]===_0x12b119(0x195)||_0x3745ed?.[_0x12b119(0x167)]===undefined)['map'](_0x172de9=>({'userId':Number(_0x172de9[_0x12b119(0x15a)]??_0x172de9['id']),'username':_0x172de9[_0x12b119(0x202)],'nickname':_0x172de9[_0x12b119(0x1e7)],'status':_0x172de9[_0x12b119(0x167)],'email':_0x172de9[_0x12b119(0x19c)],'mobile':_0x172de9[_0x12b119(0x163)],'avatar':_0x172de9[_0x12b119(0x18f)]}))[_0x12b119(0x190)](_0x26bb7d=>Number[_0x12b119(0x1ca)](_0x26bb7d['userId'])&&_0x26bb7d[_0x12b119(0x15a)]>0x0);}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a186_0x58f6e6=a186_0x37ec;function a186_0x37ec(_0x58bd16,_0x1d402e){_0x58bd16=_0x58bd16-0xa1;const _0x121fe3=a186_0x121f();let _0x37ec88=_0x121fe3[_0x58bd16];return _0x37ec88;}(function(_0x55e236,_0x2397b5){const _0x9ac464=a186_0x37ec,_0x1a3f09=_0x55e236();while(!![]){try{const _0x1e99dc=parseInt(_0x9ac464(0xa7))/0x1*(parseInt(_0x9ac464(0xab))/0x2)+-parseInt(_0x9ac464(0xac))/0x3*(parseInt(_0x9ac464(0xa5))/0x4)+parseInt(_0x9ac464(0xa9))/0x5+parseInt(_0x9ac464(0xa2))/0x6*(-parseInt(_0x9ac464(0xaa))/0x7)+parseInt(_0x9ac464(0xa6))/0x8*(parseInt(_0x9ac464(0xaf))/0x9)+parseInt(_0x9ac464(0xa4))/0xa+-parseInt(_0x9ac464(0xb0))/0xb*(parseInt(_0x9ac464(0xad))/0xc);if(_0x1e99dc===_0x2397b5)break;else _0x1a3f09['push'](_0x1a3f09['shift']());}catch(_0x55ada3){_0x1a3f09['push'](_0x1a3f09['shift']());}}}(a186_0x121f,0x71854));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a186_0x121f(){const _0x113bba=['2209976NbmJmE','36071YdUWmc','bff.lock.json','3492595zQCavw','2422YZkkIY','30rsflOR','1155849fzTzwn','24idlqdA','.rabetbase','9ZFcAdf','4706746jGcwOh','bff','10626RjWrdt','bff-trash','8029700WTOvkp','4OVrcbx'];a186_0x121f=function(){return _0x113bba;};return a186_0x121f();}const DOT_DIR=a186_0x58f6e6(0xae),LOCK_FILE_NAME=a186_0x58f6e6(0xa8),TRASH_DIR_NAME=a186_0x58f6e6(0xa3);export function loadBffProjectConfig(_0x9e1442,_0x158114){const _0x2fa4e6=a186_0x58f6e6,_0x30de13=resolve(_0x158114??findProjectRootDirectory()),_0x38087e=DOT_DIR+'/bff',_0x4c91cb=_0x38087e+'/'+_0x9e1442;return{'projectRoot':_0x30de13,'appCode':_0x9e1442,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x38087e,'scriptsRoot':_0x4c91cb,'scriptsRootDir':resolve(_0x30de13,DOT_DIR,_0x2fa4e6(0xa1),_0x9e1442),'lockFilePath':resolve(_0x30de13,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x30de13,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a187_0x1f997c=a187_0xef5f;(function(_0x423d6a,_0x267dd8){const _0x39cfe5=a187_0xef5f,_0x1ea220=_0x423d6a();while(!![]){try{const _0x438a65=parseInt(_0x39cfe5(0x7a))/0x1+-parseInt(_0x39cfe5(0x90))/0x2*(-parseInt(_0x39cfe5(0x95))/0x3)+-parseInt(_0x39cfe5(0x99))/0x4+parseInt(_0x39cfe5(0x7c))/0x5+parseInt(_0x39cfe5(0x94))/0x6*(-parseInt(_0x39cfe5(0x9b))/0x7)+parseInt(_0x39cfe5(0x92))/0x8*(parseInt(_0x39cfe5(0x7d))/0x9)+-parseInt(_0x39cfe5(0x78))/0xa*(parseInt(_0x39cfe5(0x91))/0xb);if(_0x438a65===_0x267dd8)break;else _0x1ea220['push'](_0x1ea220['shift']());}catch(_0x1813b8){_0x1ea220['push'](_0x1ea220['shift']());}}}(a187_0x4cf5,0x59ca9));function a187_0x4cf5(){const _0x58f83f=['319FKzbgD','16oFhokb','COMMON','27138jcuSrO','63hjhnLw','ENDPOINT','ENOENT','push','2860168QdWMyp','includes','14SAPYiq','scriptType','code','after','split','map','138290RpTkPS','trim','229837GLBGqi','isDirectory','3413420eVRquk','137853vbAKRH','HOOK','alias','all','beforeScriptId','toUpperCase','functionName','.js','endsWith','get','HOOK/','replace','set','operationType','afterScriptId','isFile','name','scriptsRootDir','datasetCode','52358vYmCDl'];a187_0x4cf5=function(){return _0x58f83f;};return a187_0x4cf5();}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';function a187_0xef5f(_0x4635ec,_0xcd6af4){_0x4635ec=_0x4635ec-0x78;const _0x4cf508=a187_0x4cf5();let _0xef5f18=_0x4cf508[_0x4635ec];return _0xef5f18;}export const SUPPORTED_BFF_TYPES=[a187_0x1f997c(0x93),a187_0x1f997c(0x96),a187_0x1f997c(0x7e)];export function normalizeBffType(_0x4f710a){const _0x18f5f9=a187_0x1f997c;if(!_0x4f710a)return undefined;const _0x73c223=_0x4f710a[_0x18f5f9(0x79)]()[_0x18f5f9(0x82)]();return SUPPORTED_BFF_TYPES[_0x18f5f9(0x9a)](_0x73c223)?_0x73c223:undefined;}async function scanJsFilesRecursively(_0x33a18b,_0x29551b){const _0x52c009=a187_0x1f997c,_0x21a365=[];try{const _0x52d557=await readdir(_0x33a18b,{'withFileTypes':!![]});for(const _0x32d1a4 of _0x52d557){const _0x1da90c=join(_0x33a18b,_0x32d1a4[_0x52c009(0x8d)]);if(_0x32d1a4[_0x52c009(0x7b)]())_0x21a365[_0x52c009(0x98)](...await scanJsFilesRecursively(_0x1da90c,_0x29551b+'/'+_0x32d1a4[_0x52c009(0x8d)]));else _0x32d1a4['isFile']()&&_0x32d1a4[_0x52c009(0x8d)][_0x52c009(0x85)](_0x52c009(0x84))&&_0x21a365[_0x52c009(0x98)]({'lockKey':_0x29551b+'/'+_0x32d1a4[_0x52c009(0x8d)][_0x52c009(0x88)](/\.js$/,''),'filePath':_0x1da90c});}}catch(_0x4e64a6){if(_0x4e64a6[_0x52c009(0x9d)]!==_0x52c009(0x97))throw _0x4e64a6;}return _0x21a365;}async function scanFlatFunctions(_0x3195f3,_0x1eb66f){const _0x42c88e=a187_0x1f997c,_0xa13f09=join(_0x3195f3[_0x42c88e(0x8e)],_0x1eb66f),_0x13795b=await scanJsFilesRecursively(_0xa13f09,_0x1eb66f);return _0x13795b[_0x42c88e(0xa0)](({lockKey:_0x1291cc,filePath:_0x54a39d})=>({'type':_0x1eb66f,'name':_0x1291cc['split']('/')['at'](-0x1)??'','filePath':_0x54a39d,'lockKey':_0x1291cc}));}async function scanHookFunctions(_0x741bed){const _0x1bed4f=a187_0x1f997c,_0xf90343=join(_0x741bed['scriptsRootDir'],_0x1bed4f(0x7e)),_0x4f327e=[];try{const _0x4cc463=await readdir(_0xf90343,{'withFileTypes':!![]});for(const _0x53cdb7 of _0x4cc463){if(!_0x53cdb7['isDirectory']())continue;const _0x24ae9e=_0x53cdb7[_0x1bed4f(0x8d)],_0x561299=join(_0xf90343,_0x24ae9e),_0x2112af=await readdir(_0x561299,{'withFileTypes':!![]});for(const _0x3510d7 of _0x2112af){if(!_0x3510d7[_0x1bed4f(0x7b)]())continue;const _0x43f660=_0x3510d7['name'],_0x40f6bb=join(_0x561299,_0x43f660),_0x5fd6f7=await readdir(_0x40f6bb,{'withFileTypes':!![]});for(const _0x233752 of _0x5fd6f7){if(!_0x233752[_0x1bed4f(0x7b)]())continue;const _0x241c8b=_0x233752[_0x1bed4f(0x8d)],_0x4b2fa0=join(_0x40f6bb,_0x241c8b),_0x544c8b=await readdir(_0x4b2fa0,{'withFileTypes':!![]});for(const _0x5d5f9f of _0x544c8b){if(!_0x5d5f9f[_0x1bed4f(0x8c)]()||!_0x5d5f9f[_0x1bed4f(0x8d)]['endsWith']('.js'))continue;const _0x30cec0=_0x5d5f9f[_0x1bed4f(0x8d)][_0x1bed4f(0x88)](/\.js$/,'');_0x4f327e[_0x1bed4f(0x98)]({'type':_0x1bed4f(0x7e),'name':_0x30cec0,'filePath':join(_0x4b2fa0,_0x5d5f9f['name']),'lockKey':'HOOK/'+_0x24ae9e+'/'+_0x43f660+'/'+_0x241c8b+'/'+_0x30cec0,'alias':_0x24ae9e,'operationType':_0x43f660,'functionNode':_0x241c8b});}}}}}catch(_0x9f3a64){if(_0x9f3a64[_0x1bed4f(0x9d)]!=='ENOENT')throw _0x9f3a64;}return _0x4f327e;}export async function scanLocalBffFunctions(_0x38f4bb,_0x4d454b){const _0x4d233f=a187_0x1f997c;if(_0x4d454b===_0x4d233f(0x93)||_0x4d454b===_0x4d233f(0x96))return scanFlatFunctions(_0x38f4bb,_0x4d454b);if(_0x4d454b===_0x4d233f(0x7e))return scanHookFunctions(_0x38f4bb);const [_0x467051,_0x5296e5,_0x42ecee]=await Promise[_0x4d233f(0x80)]([scanFlatFunctions(_0x38f4bb,_0x4d233f(0x93)),scanFlatFunctions(_0x38f4bb,_0x4d233f(0x96)),scanHookFunctions(_0x38f4bb)]);return[..._0x467051,..._0x5296e5,..._0x42ecee];}export function resolveLocalFilePathFromLockKey(_0x7f2fb6,_0x548657){const _0x3ae176=a187_0x1f997c;return join(_0x7f2fb6[_0x3ae176(0x8e)],..._0x548657[_0x3ae176(0x9f)]('/'))+'.js';}export function createHookLocationMap(_0x59540c){const _0x21bb34=a187_0x1f997c,_0x1f00b2=new Map();for(const _0x4ecc40 of _0x59540c){_0x4ecc40[_0x21bb34(0x81)]&&_0x1f00b2[_0x21bb34(0x89)](_0x4ecc40['beforeScriptId'],{'datasetCode':_0x4ecc40[_0x21bb34(0x8f)],'operationType':snakeToCamel(_0x4ecc40[_0x21bb34(0x8a)]),'functionNode':'before'}),_0x4ecc40[_0x21bb34(0x8b)]&&_0x1f00b2[_0x21bb34(0x89)](_0x4ecc40[_0x21bb34(0x8b)],{'datasetCode':_0x4ecc40[_0x21bb34(0x8f)],'operationType':snakeToCamel(_0x4ecc40['operationType']),'functionNode':_0x21bb34(0x9e)});}return _0x1f00b2;}export function resolveRemoteScriptTarget(_0x5dd399,_0xe82ee6,_0x424c94,_0x38c167,_0xb43ba0){const _0x52ab08=a187_0x1f997c,_0x361a9e=normalizeBffType(_0xe82ee6[_0x52ab08(0x9c)]);if(!_0x361a9e||!_0xe82ee6['functionName'])return null;if(_0x361a9e===_0x52ab08(0x7e)){const _0x4bd72e=(_0xe82ee6['id']?_0x424c94[_0x52ab08(0x86)](_0xe82ee6['id']):undefined)??findHookLocationByRemoteId(_0x38c167,_0xe82ee6['id']);if(!_0x4bd72e)return null;const _0x23b1d3=_0x4bd72e[_0x52ab08(0x7f)]||_0xb43ba0[_0x52ab08(0x86)](_0x4bd72e[_0x52ab08(0x8f)]),_0xec217b=_0x23b1d3??_0x4bd72e['datasetCode'],_0xe1d413={..._0x4bd72e,'alias':_0x23b1d3},_0x3779dd=_0x52ab08(0x87)+_0xec217b+'/'+_0xe1d413[_0x52ab08(0x8a)]+'/'+_0xe1d413['functionNode']+'/'+_0xe82ee6[_0x52ab08(0x83)];return{'lockKey':_0x3779dd,'filePath':resolveLocalFilePathFromLockKey(_0x5dd399,_0x3779dd),'type':_0x52ab08(0x7e),'hookLocation':_0xe1d413};}const _0x5d9ed8=_0x361a9e+'/'+_0xe82ee6[_0x52ab08(0x83)];return{'lockKey':_0x5d9ed8,'filePath':resolveLocalFilePathFromLockKey(_0x5dd399,_0x5d9ed8),'type':_0x361a9e};}export async function ensureParentDirectory(_0x1644ec){await mkdir(dirname(_0x1644ec),{'recursive':!![]});}export async function fileExists(_0x357a51){try{return await access(_0x357a51,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x23a83c){try{const _0x85dcdb=await stat(_0x23a83c);return _0x85dcdb['isDirectory']();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2179a9,_0x28d9bc){const _0x2d7b88=a188_0x2868,_0x476c25=_0x2179a9();while(!![]){try{const _0x5a2849=parseInt(_0x2d7b88(0xef))/0x1*(-parseInt(_0x2d7b88(0xee))/0x2)+parseInt(_0x2d7b88(0xf0))/0x3*(-parseInt(_0x2d7b88(0xf8))/0x4)+parseInt(_0x2d7b88(0xf4))/0x5+-parseInt(_0x2d7b88(0xfc))/0x6*(parseInt(_0x2d7b88(0xf5))/0x7)+parseInt(_0x2d7b88(0xf3))/0x8+parseInt(_0x2d7b88(0xf7))/0x9+-parseInt(_0x2d7b88(0xf2))/0xa*(-parseInt(_0x2d7b88(0xfd))/0xb);if(_0x5a2849===_0x28d9bc)break;else _0x476c25['push'](_0x476c25['shift']());}catch(_0x1c88e1){_0x476c25['push'](_0x476c25['shift']());}}}(a188_0x211b,0x5ee50));function a188_0x2868(_0xc77b2e,_0x13b93a){_0xc77b2e=_0xc77b2e-0xee;const _0x211b2a=a188_0x211b();let _0x2868cc=_0x211b2a[_0xc77b2e];return _0x2868cc;}import{readFile}from'node:fs/promises';function a188_0x211b(){const _0x310741=['1812340EofUsG','4579864NDIYFy','3828280EdOBHk','763kycteb','digest','2484171RLPcdd','1309972SQTVrX','hex','createHash','update','14874WcShdT','11HxAwOw','74078yTBvPf','13TJWrdv','6wSVaiu','md5'];a188_0x211b=function(){return _0x310741;};return a188_0x211b();}import a188_0x2b2288 from'node:crypto';export function computeContentHash(_0x4a0a89){const _0x3493d2=a188_0x2868;return a188_0x2b2288[_0x3493d2(0xfa)](_0x3493d2(0xf1))[_0x3493d2(0xfb)](_0x4a0a89)[_0x3493d2(0xf6)](_0x3493d2(0xf9));}export async function computeFileHash(_0x5e95ea){const _0x1a5d98=await readFile(_0x5e95ea,'utf8');return computeContentHash(_0x1a5d98);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x48168f,_0x2a7c7c){const _0x432232=a189_0x5901,_0x426cd1=_0x48168f();while(!![]){try{const _0x4ab67d=-parseInt(_0x432232(0x99))/0x1+parseInt(_0x432232(0x93))/0x2*(-parseInt(_0x432232(0x8a))/0x3)+-parseInt(_0x432232(0x94))/0x4*(-parseInt(_0x432232(0x8e))/0x5)+parseInt(_0x432232(0x91))/0x6*(-parseInt(_0x432232(0x9a))/0x7)+parseInt(_0x432232(0x9b))/0x8+parseInt(_0x432232(0x9c))/0x9+parseInt(_0x432232(0x86))/0xa;if(_0x4ab67d===_0x2a7c7c)break;else _0x426cd1['push'](_0x426cd1['shift']());}catch(_0xbaa5e6){_0x426cd1['push'](_0x426cd1['shift']());}}}(a189_0x41a7,0xb665e));import{mkdir,readFile,writeFile}from'node:fs/promises';function a189_0x41a7(){const _0x1eed24=['utf8','code','scriptsRoot','940085pFmQtR','240562GCxkeB','10099904sfWDiM','2453175YmoRwn','current\x20\x22','6490480kdyOYR',':\x20scriptsRoot\x20mismatch\x20—\x20','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','\x22.\x20','6cJlgIV','apps','object','lastSync','20JNRmpi','ENOENT','functions','186XoPkGT','parse','870518Dctktj','1438940MPCDMP','stringify'];a189_0x41a7=function(){return _0x1eed24;};return a189_0x41a7();}import{dirname}from'node:path';function a189_0x5901(_0x5f3a67,_0x739e3d){_0x5f3a67=_0x5f3a67-0x86;const _0x41a7d3=a189_0x41a7();let _0x5901a2=_0x41a7d3[_0x5f3a67];return _0x5901a2;}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x51313e,_0x21ca8d,_0x2b20c7,_0x3d22e2){const _0x34f57c=a189_0x5901,_0x35b987={'apps':_0x51313e[_0x34f57c(0x8b)]&&typeof _0x51313e['apps']===_0x34f57c(0x8c)?_0x51313e[_0x34f57c(0x8b)]:{}};let _0x67081c=_0x35b987[_0x34f57c(0x8b)][_0x21ca8d];if(!_0x67081c)return _0x67081c={'scriptsRoot':_0x2b20c7,'lastSync':'','functions':{}},_0x35b987[_0x34f57c(0x8b)][_0x21ca8d]=_0x67081c,{'lockData':_0x35b987,'appLock':_0x67081c};if(!_0x67081c[_0x34f57c(0x98)])_0x67081c[_0x34f57c(0x98)]=_0x2b20c7;else{if(_0x67081c[_0x34f57c(0x98)]!==_0x2b20c7)throw new Error(_0x3d22e2+_0x34f57c(0x87)+(_0x34f57c(0x9d)+_0x2b20c7+'\x22\x20vs\x20lock\x20\x22'+_0x67081c[_0x34f57c(0x98)]+_0x34f57c(0x89))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x67081c['functions']&&(_0x67081c[_0x34f57c(0x90)]={}),!_0x67081c[_0x34f57c(0x8d)]&&(_0x67081c[_0x34f57c(0x8d)]=''),{'lockData':_0x35b987,'appLock':_0x67081c};}export async function readBffLockFile(_0x58e064){const _0x17ca76=a189_0x5901;try{const _0x226a97=await readFile(_0x58e064,_0x17ca76(0x96)),_0x5e5f9a=JSON[_0x17ca76(0x92)](_0x226a97);return{'apps':_0x5e5f9a[_0x17ca76(0x8b)]&&typeof _0x5e5f9a[_0x17ca76(0x8b)]===_0x17ca76(0x8c)?_0x5e5f9a['apps']:{}};}catch(_0x267b67){if(_0x267b67[_0x17ca76(0x97)]===_0x17ca76(0x8f))return null;throw new Error(_0x17ca76(0x88)+String(_0x267b67));}}export async function writeBffLockFile(_0x1cf1ba,_0x4cac96){const _0x214b8d=a189_0x5901;await mkdir(dirname(_0x1cf1ba),{'recursive':!![]}),await writeFile(_0x1cf1ba,JSON[_0x214b8d(0x95)](_0x4cac96,null,0x2),_0x214b8d(0x96));}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x36bdbe,_0xcec665){const _0x11206e=a191_0x230a,_0x33892e=_0x36bdbe();while(!![]){try{const _0x243770=-parseInt(_0x11206e(0x161))/0x1*(parseInt(_0x11206e(0x15f))/0x2)+parseInt(_0x11206e(0x160))/0x3+-parseInt(_0x11206e(0x15b))/0x4*(parseInt(_0x11206e(0x158))/0x5)+parseInt(_0x11206e(0x16c))/0x6+parseInt(_0x11206e(0x16e))/0x7*(parseInt(_0x11206e(0x168))/0x8)+parseInt(_0x11206e(0x166))/0x9*(parseInt(_0x11206e(0x15d))/0xa)+-parseInt(_0x11206e(0x159))/0xb*(parseInt(_0x11206e(0x15e))/0xc);if(_0x243770===_0xcec665)break;else _0x33892e['push'](_0x33892e['shift']());}catch(_0x4d2686){_0x33892e['push'](_0x33892e['shift']());}}}(a191_0x23ea,0x97ac2));export function snakeToCamel(_0x40e152){const _0x222f38=a191_0x230a;return _0x40e152[_0x222f38(0x167)]()[_0x222f38(0x15a)](/_([a-z])/g,(_0x3245a3,_0x874d7e)=>_0x874d7e[_0x222f38(0x165)]());}function a191_0x230a(_0x243242,_0x8bf18e){_0x243242=_0x243242-0x157;const _0x23ea82=a191_0x23ea();let _0x230aa0=_0x23ea82[_0x243242];return _0x230aa0;}export function findHookLocationByRemoteId(_0x530d33,_0x162a45){const _0x32d6d7=a191_0x230a;if(!_0x162a45)return undefined;for(const _0x4fbb8b of Object[_0x32d6d7(0x15c)](_0x530d33)){if(_0x4fbb8b[_0x32d6d7(0x16d)]===_0x162a45&&_0x4fbb8b['datasetCode']&&_0x4fbb8b[_0x32d6d7(0x157)]&&_0x4fbb8b[_0x32d6d7(0x169)])return{'datasetCode':_0x4fbb8b[_0x32d6d7(0x16a)],'operationType':_0x4fbb8b[_0x32d6d7(0x157)],'functionNode':_0x4fbb8b[_0x32d6d7(0x169)]};}return undefined;}export function extractScriptDescription(_0x4debd1){const _0x2c2684=a191_0x230a,_0x4ca502=_0x4debd1['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x4ca502?.[0x1]?.[_0x2c2684(0x163)]()||undefined;}export function isValidBffFunctionName(_0x4820bd){const _0x541da7=a191_0x230a;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x541da7(0x162)](_0x4820bd);}function a191_0x23ea(){const _0x471ad7=['remoteId','50099NtqUHw','operationType','1044275bjXEKz','33eOuVuE','replace','20ZVHDtI','values','66160pIBLNz','2067732mEnPHH','4szQlvW','3670011AUSvxO','380131AFsIjz','test','trim','before','toUpperCase','1080PXuEAm','toLowerCase','376GyxjYh','functionNode','datasetCode','after','3534504tbixEf'];a191_0x23ea=function(){return _0x471ad7;};return a191_0x23ea();}export function normalizeHookFunctionNode(_0x5c1b6){const _0x3a7ff4=a191_0x230a;if(!_0x5c1b6)return undefined;const _0x2e2973=_0x5c1b6[_0x3a7ff4(0x163)]()[_0x3a7ff4(0x167)]();if(_0x2e2973===_0x3a7ff4(0x164)||_0x2e2973===_0x3a7ff4(0x16b))return _0x2e2973;return undefined;}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a192_0x71b6(_0x3d805a,_0x1ebf13){_0x3d805a=_0x3d805a-0x1cd;const _0x15e54d=a192_0x15e5();let _0x71b650=_0x15e54d[_0x3d805a];return _0x71b650;}(function(_0x47c5e5,_0x415483){const _0x186afc=a192_0x71b6,_0x2c70d2=_0x47c5e5();while(!![]){try{const _0x6af745=parseInt(_0x186afc(0x1e3))/0x1*(parseInt(_0x186afc(0x1de))/0x2)+parseInt(_0x186afc(0x1db))/0x3+parseInt(_0x186afc(0x1d7))/0x4*(parseInt(_0x186afc(0x1d1))/0x5)+-parseInt(_0x186afc(0x1dc))/0x6*(-parseInt(_0x186afc(0x1ea))/0x7)+parseInt(_0x186afc(0x1da))/0x8+-parseInt(_0x186afc(0x1e9))/0x9+-parseInt(_0x186afc(0x1cf))/0xa;if(_0x6af745===_0x415483)break;else _0x2c70d2['push'](_0x2c70d2['shift']());}catch(_0x42d38d){_0x2c70d2['push'](_0x2c70d2['shift']());}}}(a192_0x15e5,0x70ac9));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x5c9ff2){const _0x2fb49e=a192_0x71b6;if(cache[_0x2fb49e(0x1d2)](_0x5c9ff2))return cache[_0x2fb49e(0x1e6)](_0x5c9ff2);const _0x4dae3b=await listDatasets(_0x5c9ff2),_0x13b7c8=new Map();for(const _0x56966d of _0x4dae3b){const _0x1a54f3=_0x56966d[_0x2fb49e(0x1e8)];_0x1a54f3?.['dbId']!=null&&_0x13b7c8[_0x2fb49e(0x1e4)](_0x1a54f3[_0x2fb49e(0x1dd)],_0x1a54f3[_0x2fb49e(0x1e2)]??'db-'+_0x1a54f3[_0x2fb49e(0x1dd)]);}const _0x2a106a=[..._0x13b7c8['entries']()][_0x2fb49e(0x1ce)](([_0x5e7399,_0x19813f])=>({'dbId':_0x5e7399,'dbName':_0x19813f}));return cache[_0x2fb49e(0x1e4)](_0x5c9ff2,_0x2a106a),_0x2a106a;}export async function resolveDb(_0x17ec62,_0x55a265){const _0x53c4de=a192_0x71b6,_0x49726d=await listDatabases(_0x17ec62);if(_0x49726d[_0x53c4de(0x1d8)]===0x0)return{'resolved':[],'error':_0x53c4de(0x1cd)+_0x17ec62+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x55a265)return{'resolved':_0x49726d};const _0x4f402f=Number(_0x55a265);if(!Number['isNaN'](_0x4f402f)){const _0x3b3e42=_0x49726d['find'](_0x5a6b3a=>_0x5a6b3a['dbId']===_0x4f402f);if(_0x3b3e42)return{'resolved':[_0x3b3e42]};}const _0xc46c29=_0x55a265[_0x53c4de(0x1e5)](),_0xf4fb99=_0x49726d[_0x53c4de(0x1d3)](_0x561b75=>_0x561b75['dbName']['toLowerCase']()[_0x53c4de(0x1d4)](_0xc46c29));if(_0xf4fb99['length']>0x0)return{'resolved':_0xf4fb99};const _0x1bbb76=_0x49726d['map'](_0x13d90=>_0x13d90[_0x53c4de(0x1e2)]+'\x20('+_0x13d90[_0x53c4de(0x1dd)]+')')[_0x53c4de(0x1d5)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x55a265+_0x53c4de(0x1d9)+_0x17ec62+_0x53c4de(0x1e7)+_0x1bbb76+_0x53c4de(0x1d0)};}export async function resolveOneDb(_0x3933e2,_0x3d3cde){const _0x4c2ed6=a192_0x71b6,{resolved:_0x5d613b,error:_0x5075b4}=await resolveDb(_0x3933e2,_0x3d3cde);if(_0x5075b4)return{'db':null,'error':_0x5075b4};if(_0x5d613b['length']===0x1)return{'db':_0x5d613b[0x0]};if(!_0x3d3cde){const _0xa940ed=_0x5d613b[_0x4c2ed6(0x1ce)](_0x1c46b9=>_0x1c46b9[_0x4c2ed6(0x1e2)]+'\x20('+_0x1c46b9[_0x4c2ed6(0x1dd)]+')')[_0x4c2ed6(0x1d5)](',\x20');return{'db':null,'error':_0x4c2ed6(0x1e1)+_0xa940ed};}const _0x7c42f7=_0x5d613b[_0x4c2ed6(0x1ce)](_0x405d89=>_0x405d89['dbName']+'\x20('+_0x405d89[_0x4c2ed6(0x1dd)]+')')[_0x4c2ed6(0x1d5)](',\x20');return{'db':null,'error':'\x22'+_0x3d3cde+_0x4c2ed6(0x1e0)+_0x7c42f7+_0x4c2ed6(0x1d6)};}export async function getDbName(_0x3db250,_0x1332ff){const _0x59bb26=a192_0x71b6,_0x222b11=await listDatabases(_0x3db250);return _0x222b11[_0x59bb26(0x1df)](_0x559052=>_0x559052[_0x59bb26(0x1dd)]===_0x1332ff)?.[_0x59bb26(0x1e2)];}function a192_0x15e5(){const _0x2878c2=['2747025TeeloL','421734OxIuTu','dbId','122914msgiAU','find','\x22\x20matches\x20multiple\x20databases:\x20','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','dbName','15VUrLnW','set','toLowerCase','get','\x22.\x20Available:\x20','dbtableConfig','6395760hnKPmt','21eKVQNN','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','map','17098930bjyvzp','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','145085BgcUJA','has','filter','includes','join','.\x20Be\x20more\x20specific.','20GMkbbV','length','\x22\x20under\x20app\x20\x22','5508512ffqIHP'];a192_0x15e5=function(){return _0x2878c2;};return a192_0x15e5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a193_0x47c4db=a193_0x2eb7;(function(_0x2bcaa2,_0x20a65e){const _0x46588b=a193_0x2eb7,_0xa62038=_0x2bcaa2();while(!![]){try{const _0x21f547=-parseInt(_0x46588b(0xc8))/0x1*(parseInt(_0x46588b(0xc9))/0x2)+-parseInt(_0x46588b(0xc1))/0x3+-parseInt(_0x46588b(0xc7))/0x4*(-parseInt(_0x46588b(0xbe))/0x5)+-parseInt(_0x46588b(0xc3))/0x6*(-parseInt(_0x46588b(0xc0))/0x7)+-parseInt(_0x46588b(0xcb))/0x8*(parseInt(_0x46588b(0xc6))/0x9)+parseInt(_0x46588b(0xca))/0xa+parseInt(_0x46588b(0xbf))/0xb*(parseInt(_0x46588b(0xc2))/0xc);if(_0x21f547===_0x20a65e)break;else _0xa62038['push'](_0xa62038['shift']());}catch(_0x23d472){_0xa62038['push'](_0xa62038['shift']());}}}(a193_0x4df1,0xb88d8));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';function a193_0x4df1(){const _0x18d3ad=['11UarmBy','1522801tjmInv','1618668aebAXJ','17092392lpyCwS','6uicVOF','page','.json','2492181HLMoCC','141608xsPqgA','188553siVLDt','8KtGuFX','2535650FyJvDq','16mxjKqM','appPagesDir','cwd','F_OK','100yrHZPE'];a193_0x4df1=function(){return _0x18d3ad;};return a193_0x4df1();}export function loadPageProjectConfig(_0x260ad1,_0x5b247d=process[a193_0x47c4db(0xbc)]()){const _0x2b0371=a193_0x47c4db,_0x2f2a1b=resolve(_0x5b247d),_0xaabf14=join(_0x2f2a1b,'.rabetbase',_0x2b0371(0xc4));return{'projectRoot':_0x2f2a1b,'pagesBaseDir':_0xaabf14,'appPagesDir':join(_0xaabf14,_0x260ad1),'lockFilePath':join(_0x2f2a1b,'.rabetbase','page.lock.json')};}export function buildPageFileName(_0x306cc5,_0x67da04){const _0x163737=a193_0x47c4db;return _0x306cc5+'-'+String(_0x67da04)['toUpperCase']()+_0x163737(0xc5);}export function resolvePageFilePath(_0x5cd263,_0x3ce340,_0x498e87){const _0x4f2cd5=a193_0x47c4db;return join(_0x5cd263[_0x4f2cd5(0xcc)],buildPageFileName(_0x3ce340,_0x498e87));}export async function ensureParentDirectory(_0x412a8a){await mkdir(dirname(_0x412a8a),{'recursive':!![]});}function a193_0x2eb7(_0x5941aa,_0x576ecd){_0x5941aa=_0x5941aa-0xbc;const _0x4df189=a193_0x4df1();let _0x2eb754=_0x4df189[_0x5941aa];return _0x2eb754;}export async function fileExists(_0x1da274){const _0x48eebe=a193_0x47c4db;try{return await access(_0x1da274,constants[_0x48eebe(0xbd)]),!![];}catch{return![];}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x13b63a,_0x49cdc6){const _0x4eaa7c=a194_0x590b,_0xc410e=_0x13b63a();while(!![]){try{const _0x783483=-parseInt(_0x4eaa7c(0x9d))/0x1*(parseInt(_0x4eaa7c(0xa8))/0x2)+parseInt(_0x4eaa7c(0xa0))/0x3*(-parseInt(_0x4eaa7c(0xa4))/0x4)+-parseInt(_0x4eaa7c(0xa1))/0x5*(-parseInt(_0x4eaa7c(0xac))/0x6)+-parseInt(_0x4eaa7c(0xaa))/0x7+parseInt(_0x4eaa7c(0x9f))/0x8*(parseInt(_0x4eaa7c(0x9e))/0x9)+parseInt(_0x4eaa7c(0xa3))/0xa+parseInt(_0x4eaa7c(0xa7))/0xb*(parseInt(_0x4eaa7c(0xa9))/0xc);if(_0x783483===_0x49cdc6)break;else _0xc410e['push'](_0xc410e['shift']());}catch(_0x1b5f33){_0xc410e['push'](_0xc410e['shift']());}}}(a194_0xbc69,0x22e48));import a194_0x1bb3a0 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x38740b){return JSON['stringify'](JSON['parse'](_0x38740b),null,0x2)+'\x0a';}export function computePageContentHash(_0xc85902){const _0x1d5b33=a194_0x590b;return a194_0x1bb3a0[_0x1d5b33(0xa6)](_0x1d5b33(0xad))[_0x1d5b33(0xab)](_0xc85902)['digest'](_0x1d5b33(0xa2));}export function computeSerializedSchemaHash(_0x3681eb){return computePageContentHash(serializePageSchemaForFile(_0x3681eb));}function a194_0x590b(_0x2bd10d,_0x45cd73){_0x2bd10d=_0x2bd10d-0x9d;const _0xbc6945=a194_0xbc69();let _0x590bce=_0xbc6945[_0x2bd10d];return _0x590bce;}function a194_0xbc69(){const _0x2df9b1=['1610714aknmfB','update','822DOBiBA','md5','3pJsmnT','9NpZojs','1110344fkBjJm','32979JioyLC','4135kKSdfv','hex','170010biToRy','52GrZxla','utf8','createHash','11SFozsi','75702MuSyOc','4324692mkXKLN'];a194_0xbc69=function(){return _0x2df9b1;};return a194_0xbc69();}export async function computePageFileHash(_0x3d69c9){const _0x44327c=a194_0x590b,_0x1adde3=await readFile(_0x3d69c9,_0x44327c(0xa5));return computePageContentHash(_0x1adde3);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x136588,_0x335f7a){const _0x4a3b1b=a195_0x4554,_0x52f9e7=_0x136588();while(!![]){try{const _0x510efc=parseInt(_0x4a3b1b(0x176))/0x1*(parseInt(_0x4a3b1b(0x17b))/0x2)+parseInt(_0x4a3b1b(0x185))/0x3*(-parseInt(_0x4a3b1b(0x174))/0x4)+parseInt(_0x4a3b1b(0x182))/0x5+-parseInt(_0x4a3b1b(0x17e))/0x6+parseInt(_0x4a3b1b(0x178))/0x7+parseInt(_0x4a3b1b(0x184))/0x8+-parseInt(_0x4a3b1b(0x179))/0x9*(-parseInt(_0x4a3b1b(0x17d))/0xa);if(_0x510efc===_0x335f7a)break;else _0x52f9e7['push'](_0x52f9e7['shift']());}catch(_0x2fc595){_0x52f9e7['push'](_0x52f9e7['shift']());}}}(a195_0x1905,0xea01d));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x793d4d,_0x438eda){const _0xc325dd=a195_0x4554,_0x321f4c={'apps':_0x793d4d[_0xc325dd(0x181)]&&typeof _0x793d4d[_0xc325dd(0x181)]==='object'?_0x793d4d['apps']:{}};let _0x467b5d=_0x321f4c['apps'][_0x438eda];if(!_0x467b5d)return _0x467b5d={'lastSync':'','pages':{}},_0x321f4c[_0xc325dd(0x181)][_0x438eda]=_0x467b5d,{'lockData':_0x321f4c,'appLock':_0x467b5d};return!_0x467b5d['lastSync']&&(_0x467b5d[_0xc325dd(0x180)]=''),(!_0x467b5d['pages']||typeof _0x467b5d[_0xc325dd(0x183)]!==_0xc325dd(0x175))&&(_0x467b5d[_0xc325dd(0x183)]={}),{'lockData':_0x321f4c,'appLock':_0x467b5d};}function a195_0x4554(_0x4233b9,_0x44fd9d){_0x4233b9=_0x4233b9-0x174;const _0x190592=a195_0x1905();let _0x4554c0=_0x190592[_0x4233b9];return _0x4554c0;}export async function readPageLockFile(_0x276b41){const _0x414346=a195_0x4554;try{const _0x446348=await readFile(_0x276b41,'utf8'),_0x109079=JSON[_0x414346(0x17f)](_0x446348);return{'apps':_0x109079[_0x414346(0x181)]&&typeof _0x109079[_0x414346(0x181)]===_0x414346(0x175)?_0x109079['apps']:{}};}catch(_0x3be0cd){if(_0x3be0cd['code']===_0x414346(0x177))return null;throw new Error(_0x414346(0x17c)+String(_0x3be0cd));}}function a195_0x1905(){const _0x18cff7=['Failed\x20to\x20read\x20page\x20lock\x20file:\x20','60090PEobBG','5339400zeXdrA','parse','lastSync','apps','943045DzDDnX','pages','5839632uffZHn','4647nwwYcw','3868atFElY','object','2485ERjDjX','ENOENT','8790523RuyOph','99BMMlvh','utf8','890JQRWXr'];a195_0x1905=function(){return _0x18cff7;};return a195_0x1905();}export async function writePageLockFile(_0x58b7da,_0x4b6307){const _0x2f0fb3=a195_0x4554;await mkdir(dirname(_0x58b7da),{'recursive':!![]}),await writeFile(_0x58b7da,JSON['stringify'](_0x4b6307,null,0x2),_0x2f0fb3(0x17a));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a197_0x25ef(){const _0x2ca42c=['1925RohdXC','28092jIZXTv','243336LCXZUR','1966NEZrKN','140VUIlOv','.rabetbase','44628royNZQ','675510mJpnEg','70JlDmJn','657nohPEx','29505vrdveu','sql','63GoLWtF','173518gimtUj','sql.lock.json'];a197_0x25ef=function(){return _0x2ca42c;};return a197_0x25ef();}const a197_0x147be9=a197_0x2092;(function(_0x5e629a,_0x4702bb){const _0x2e1ba3=a197_0x2092,_0x2670f3=_0x5e629a();while(!![]){try{const _0xf3a328=-parseInt(_0x2e1ba3(0x8a))/0x1+-parseInt(_0x2e1ba3(0x8f))/0x2*(parseInt(_0x2e1ba3(0x86))/0x3)+parseInt(_0x2e1ba3(0x90))/0x4*(-parseInt(_0x2e1ba3(0x87))/0x5)+parseInt(_0x2e1ba3(0x8d))/0x6*(-parseInt(_0x2e1ba3(0x85))/0x7)+-parseInt(_0x2e1ba3(0x8e))/0x8*(-parseInt(_0x2e1ba3(0x89))/0x9)+-parseInt(_0x2e1ba3(0x84))/0xa+-parseInt(_0x2e1ba3(0x8c))/0xb*(-parseInt(_0x2e1ba3(0x92))/0xc);if(_0xf3a328===_0x4702bb)break;else _0x2670f3['push'](_0x2670f3['shift']());}catch(_0x3cfff4){_0x2670f3['push'](_0x2670f3['shift']());}}}(a197_0x25ef,0x259bb));import{resolve}from'node:path';function a197_0x2092(_0x3d9641,_0x31541d){_0x3d9641=_0x3d9641-0x84;const _0x25efd1=a197_0x25ef();let _0x209289=_0x25efd1[_0x3d9641];return _0x209289;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a197_0x147be9(0x91),LOCK_FILE_NAME=a197_0x147be9(0x8b),TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x349643,_0x340bff){const _0x12b277=a197_0x147be9,_0x49fbe1=resolve(_0x340bff??findProjectRootDirectory()),_0xb3126f=DOT_DIR+'/sql',_0x453dd1=_0xb3126f+'/'+_0x349643;return{'projectRoot':_0x49fbe1,'appCode':_0x349643,'sqlWorkspaceRoot':_0xb3126f,'sqlRoot':_0x453dd1,'sqlRootDir':resolve(_0x49fbe1,DOT_DIR,_0x12b277(0x88),_0x349643),'lockFilePath':resolve(_0x49fbe1,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x49fbe1,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x228894,_0x427c10){const _0x54b007=a198_0x31a9,_0x1f6363=_0x228894();while(!![]){try{const _0x55d8c7=-parseInt(_0x54b007(0x11e))/0x1+parseInt(_0x54b007(0x123))/0x2+-parseInt(_0x54b007(0x119))/0x3*(parseInt(_0x54b007(0x111))/0x4)+parseInt(_0x54b007(0x11d))/0x5*(-parseInt(_0x54b007(0x117))/0x6)+-parseInt(_0x54b007(0x11c))/0x7*(parseInt(_0x54b007(0x110))/0x8)+-parseInt(_0x54b007(0x10f))/0x9*(parseInt(_0x54b007(0x115))/0xa)+parseInt(_0x54b007(0x108))/0xb*(parseInt(_0x54b007(0x109))/0xc);if(_0x55d8c7===_0x427c10)break;else _0x1f6363['push'](_0x1f6363['shift']());}catch(_0x104367){_0x1f6363['push'](_0x1f6363['shift']());}}}(a198_0x49b1,0xf3665));import{readdir,stat}from'node:fs/promises';function a198_0x31a9(_0x5696e0,_0x6bb7df){_0x5696e0=_0x5696e0-0x105;const _0x49b122=a198_0x49b1();let _0x31a965=_0x49b122[_0x5696e0];return _0x31a965;}import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x2fc128){const _0x205053=a198_0x31a9;if(_0x2fc128==='.sql')return _0x205053(0x10e);if(_0x2fc128==='.xml')return _0x205053(0x105);return undefined;}async function scanSqlFilesRecursively(_0x43c196,_0x967f8e){const _0x1f3bf3=a198_0x31a9,_0x524dd4=[];try{const _0x5356ef=await readdir(_0x43c196,{'withFileTypes':!![]});for(const _0x1f43fe of _0x5356ef){const _0x3f715d=join(_0x43c196,_0x1f43fe[_0x1f3bf3(0x10b)]);if(_0x1f43fe[_0x1f3bf3(0x122)]()){_0x524dd4['push'](...await scanSqlFilesRecursively(_0x3f715d,_0x967f8e));continue;}if(!_0x1f43fe['isFile']())continue;const _0x1fba2c=extname(_0x1f43fe[_0x1f3bf3(0x10b)])[_0x1f3bf3(0x10a)](),_0x4f6deb=extensionToMode(_0x1fba2c);if(!_0x4f6deb)continue;const _0x5e9d18=relative(_0x967f8e,_0x3f715d)[_0x1f3bf3(0x106)](/\\/g,'/'),_0x212e5=_0x5e9d18[_0x1f3bf3(0x107)]('/')[_0x1f3bf3(0x10c)](Boolean),_0x395ebf=parseSqlPath(_0x212e5,_0x1f43fe[_0x1f3bf3(0x10b)],_0x1fba2c);if(!_0x395ebf)continue;_0x524dd4[_0x1f3bf3(0x10d)]({'sqlCode':_0x395ebf['sqlCode'],'sqlName':_0x395ebf['sqlName'],'dbDirectory':_0x212e5[0x0],'filePath':_0x3f715d,'relativePath':_0x5e9d18,'lockKey':_0x395ebf['sqlCode'],'mode':_0x4f6deb});}}catch(_0x4301a8){if(_0x4301a8[_0x1f3bf3(0x113)]!==_0x1f3bf3(0x112))throw _0x4301a8;}return _0x524dd4;}export async function scanLocalSqlQueries(_0x263cf9){const _0x43c669=a198_0x31a9;return scanSqlFilesRecursively(_0x263cf9[_0x43c669(0x11a)],_0x263cf9['sqlRootDir']);}function a198_0x49b1(){const _0x498057=['8068dRMxmk','ENOENT','code','sqlName','10vwnLxY','mode','60FCjIFT','dbName','2856frcTfc','sqlRootDir','test','7zuDzLH','70765TGITwy','1752506tslESG','slice','length','indexOf','isDirectory','799778hJJenZ','mybatisXml','replace','split','110VQIRzc','7447152rdvdqB','toLowerCase','name','filter','push','sql','4276287lwyKzw','10556168JfmSnv'];a198_0x49b1=function(){return _0x498057;};return a198_0x49b1();}export function resolveLocalSqlFilePath(_0x2ccc20,_0x2e1867,_0x2b2ed8){const _0x1ceb7e=a198_0x31a9,_0x451ba8=_0x2b2ed8?.['path']||(_0x2b2ed8?.[_0x1ceb7e(0x114)]||_0x2b2ed8?.[_0x1ceb7e(0x118)]?buildSqlRelativePath(_0x2e1867,_0x2b2ed8?.[_0x1ceb7e(0x114)],_0x2b2ed8?.[_0x1ceb7e(0x118)],_0x2b2ed8?.[_0x1ceb7e(0x116)]||_0x1ceb7e(0x10e),_0x2b2ed8?.['dbId']):buildDefaultSqlFileName(_0x2e1867,_0x2b2ed8?.[_0x1ceb7e(0x116)]||_0x1ceb7e(0x10e)));return join(_0x2ccc20[_0x1ceb7e(0x11a)],_0x451ba8);}export async function directoryExists(_0x1a746b){const _0x36b187=a198_0x31a9;try{const _0x29a0bc=await stat(_0x1a746b);return _0x29a0bc[_0x36b187(0x122)]();}catch{return![];}}function parseSqlPath(_0x131059,_0x133520,_0x1c70d7){const _0x471da2=a198_0x31a9,_0x41c39f=_0x133520[_0x471da2(0x11f)](0x0,-_0x1c70d7[_0x471da2(0x120)]);if(_0x131059[_0x471da2(0x120)]<0x2)return null;const _0x21b646=_0x41c39f[_0x471da2(0x121)]('_');if(_0x21b646<=0x0||_0x21b646>=_0x41c39f[_0x471da2(0x120)]-0x1)return null;const _0x32682b=_0x41c39f[_0x471da2(0x11f)](0x0,_0x21b646);if(!isLikelySqlCode(_0x32682b))return null;return{'sqlCode':_0x32682b,'sqlName':_0x41c39f[_0x471da2(0x11f)](_0x21b646+0x1)};}function isLikelySqlCode(_0x3e1e39){const _0xb19564=a198_0x31a9;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0xb19564(0x11b)](_0x3e1e39);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x31d1d6,_0x5b268c){const _0x421ba5=a199_0x5a8d,_0x5a5581=_0x31d1d6();while(!![]){try{const _0x518d6c=-parseInt(_0x421ba5(0x127))/0x1+parseInt(_0x421ba5(0x128))/0x2+parseInt(_0x421ba5(0x124))/0x3*(parseInt(_0x421ba5(0x129))/0x4)+-parseInt(_0x421ba5(0x12c))/0x5*(parseInt(_0x421ba5(0x11f))/0x6)+parseInt(_0x421ba5(0x126))/0x7+parseInt(_0x421ba5(0x11d))/0x8+parseInt(_0x421ba5(0x122))/0x9*(-parseInt(_0x421ba5(0x121))/0xa);if(_0x518d6c===_0x5b268c)break;else _0x5a5581['push'](_0x5a5581['shift']());}catch(_0x544e3a){_0x5a5581['push'](_0x5a5581['shift']());}}}(a199_0x4e89,0xd008f));import{readFile}from'node:fs/promises';function a199_0x5a8d(_0x2715d7,_0x2711d8){_0x2715d7=_0x2715d7-0x11d;const _0x4e89b7=a199_0x4e89();let _0x5a8d95=_0x4e89b7[_0x2715d7];return _0x5a8d95;}import a199_0x338806 from'node:crypto';export function computeSqlContentHash(_0x1272a0){const _0x90c585=a199_0x5a8d;return a199_0x338806[_0x90c585(0x125)](_0x90c585(0x120))[_0x90c585(0x12a)](_0x1272a0)[_0x90c585(0x12b)](_0x90c585(0x11e));}function a199_0x4e89(){const _0x3de24d=['32KcZBMr','update','digest','6605kyfjJB','12555976RlHFjT','hex','3414MkxhKn','md5','10ShPBeN','7527951tjuwMt','utf8','1242zykPRS','createHash','6023822psoFmx','122656AmuUBA','259000cZiwcg'];a199_0x4e89=function(){return _0x3de24d;};return a199_0x4e89();}export async function computeSqlFileHash(_0x3dc21c){const _0x486352=a199_0x5a8d,_0x224892=await readFile(_0x3dc21c,_0x486352(0x123));return computeSqlContentHash(_0x224892);}
|