@lovrabet/rabetbase-cli 2.4.3-beta.1 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/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/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.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/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/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.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/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase/guides/react-custom-page-workflow.md +9 -3
- package/skills/rabetbase/knowledge/react-page/generation-standards.md +13 -2
- package/skills/rabetbase.manifest.json +3 -3
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x203fde,_0x103c2d){const _0x52909e=a216_0x3124,_0x25c4bd=_0x203fde();while(!![]){try{const _0x25f770=parseInt(_0x52909e(0xf9))/0x1*(-parseInt(_0x52909e(0x10a))/0x2)+-parseInt(_0x52909e(0xfd))/0x3+-parseInt(_0x52909e(0x108))/0x4*(parseInt(_0x52909e(0xf2))/0x5)+parseInt(_0x52909e(0xfe))/0x6+-parseInt(_0x52909e(0x103))/0x7+parseInt(_0x52909e(0xe7))/0x8*(parseInt(_0x52909e(0x101))/0x9)+-parseInt(_0x52909e(0xf8))/0xa*(-parseInt(_0x52909e(0xf4))/0xb);if(_0x25f770===_0x103c2d)break;else _0x25c4bd['push'](_0x25c4bd['shift']());}catch(_0x330b19){_0x25c4bd['push'](_0x25c4bd['shift']());}}}(a216_0x2287,0xf290b));import{resolve}from'node:path';import{CLI_BIN_NAME}from'./constant/cli.js';import{buildAuth}from'./context/auth-resolver.js';import{resolveAppConfig}from'./context/app-resolver.js';function a216_0x2287(){const _0x265636=['projectConfig','argv','./utils/is-non-interactive.js','3536216fxPYIm','-api.ts','./constant/domain.js','./constant/env.js','appcode','app','env','raw','entries','setRawCommand','string','250uXfwUB','cookie','44NaHbtU','cwd','userDomain','values','7156840DqOnEA','409031nUlWaN','join','trim','replace','1940205YGXBRk','8900454WSFfUN','apiDomain','slice','9ypmfUD','apps','10980263bPLBwf','https://g.lovrabet.com/dist/lovrabet-skill','runtimeDomain','globalConfig','object','93620PlXRxk','length','2XzoAhQ','apiDir','map','filter','template_base_url','merged','defaultApp'];a216_0x2287=function(){return _0x265636;};return a216_0x2287();}import{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile}from'./context/config-loader.js';import{logger}from'./utils/logger.js';export{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile};function env(_0x56183f){return process.env[`RABETBASE_${_0x56183f}`]||process.env[`LOVRABET_${_0x56183f}`]||undefined;}function optionalString(_0x2f7d22){const _0x5a6dc0=a216_0x3124;return typeof _0x2f7d22===_0x5a6dc0(0xf1)&&_0x2f7d22[_0x5a6dc0(0xfb)]()?_0x2f7d22[_0x5a6dc0(0xfb)]():undefined;}export async function createContext(_0x101687){const _0x187bba=a216_0x3124,{config:_0x2a480f,layers:_0x5db037}=readRawConfigWithLayers(),_0x29b892=buildConfig(_0x2a480f,_0x101687,_0x5db037);await initGlobalEnvironment(_0x29b892);const {getUserDomain:_0x5cb767,getApiDomain:_0x1db70e}=await import(_0x187bba(0xe9)),_0x31c3ff={'apiDomain':_0x1db70e(),'userDomain':_0x5cb767()},_0x1a84fa=await buildAuth(_0x29b892);logger['setLogPath'](process[_0x187bba(0xf5)]());const _0x3f69e4=(CLI_BIN_NAME+'\x20'+process[_0x187bba(0xe5)][_0x187bba(0x100)](0x2)[_0x187bba(0xfa)]('\x20'))[_0x187bba(0xfb)]();logger[_0x187bba(0xf0)](_0x3f69e4);const {isNonInteractive:_0x392d84}=await import(_0x187bba(0xe6)),_0x24fe5c=_0x392d84(_0x101687);return{'config':_0x29b892,'auth':_0x1a84fa,'logger':logger,'env':_0x31c3ff,'nonInteractive':_0x24fe5c};}export function buildConfigFromFlags(_0x1e5217){const {config:_0x31b41f,layers:_0x5db92a}=readRawConfigWithLayers();return buildConfig(_0x31b41f,_0x1e5217,_0x5db92a);}export async function initGlobalEnvironment(_0x4319ae){const _0x47c2b9=a216_0x3124,{initEnv:_0x3bb4aa}=await import(_0x47c2b9(0xea));_0x3bb4aa(_0x4319ae[_0x47c2b9(0xed)]);const {initDomains:_0x27330b}=await import(_0x47c2b9(0xe9));_0x27330b({'apiDomain':optionalString(_0x4319ae[_0x47c2b9(0xee)]?.[_0x47c2b9(0xff)]),'userDomain':optionalString(_0x4319ae[_0x47c2b9(0xee)]?.[_0x47c2b9(0xf6)]),'runtimeDomain':optionalString(_0x4319ae['raw']?.[_0x47c2b9(0x105)])});}function a216_0x3124(_0x1e6b36,_0x1a014c){_0x1e6b36=_0x1e6b36-0xe4;const _0x228769=a216_0x2287();let _0x312455=_0x228769[_0x1e6b36];return _0x312455;}export function getConfigAppCode(_0x306784){const _0x23a36e=a216_0x3124,_0x4afce3=readRawConfig(_0x306784);if(_0x4afce3[_0x23a36e(0x102)]&&typeof _0x4afce3['apps']===_0x23a36e(0x107)){const _0x5bf330=_0x4afce3[_0x23a36e(0x110)];if(_0x5bf330&&_0x4afce3[_0x23a36e(0x102)][_0x5bf330]?.[_0x23a36e(0xeb)])return String(_0x4afce3[_0x23a36e(0x102)][_0x5bf330][_0x23a36e(0xeb)])[_0x23a36e(0xfb)]();const _0xa339da=Object[_0x23a36e(0xf7)](_0x4afce3[_0x23a36e(0x102)])[0x0];if(_0xa339da?.['appcode'])return String(_0xa339da['appcode'])[_0x23a36e(0xfb)]();}const _0x456d38=_0x4afce3[_0x23a36e(0xeb)]||_0x4afce3[_0x23a36e(0xec)];if(typeof _0x456d38!=='string'||_0x456d38[_0x23a36e(0xfb)]()==='')return undefined;return _0x456d38[_0x23a36e(0xfb)]();}export function getMultiAppConfigs(_0x1f125a='project',_0x369b54){const _0x2ffc17=a216_0x3124,_0x256765=loadRawConfigLayers(_0x369b54);let _0x45fe29,_0x341734;if(_0x1f125a===_0x2ffc17(0x10f)){const _0x55a6a8=_0x256765['globalConfig'][_0x2ffc17(0x102)]&&typeof _0x256765['globalConfig'][_0x2ffc17(0x102)]===_0x2ffc17(0x107)?_0x256765[_0x2ffc17(0x106)][_0x2ffc17(0x102)]:{},_0x5ad8de=_0x256765[_0x2ffc17(0xe4)][_0x2ffc17(0x102)]&&typeof _0x256765['projectConfig'][_0x2ffc17(0x102)]===_0x2ffc17(0x107)?_0x256765[_0x2ffc17(0xe4)][_0x2ffc17(0x102)]:{};_0x45fe29={..._0x55a6a8,..._0x5ad8de};const _0x31c232=readRawConfig(_0x369b54);_0x341734=_0x31c232[_0x2ffc17(0x110)];}else _0x45fe29=_0x256765[_0x2ffc17(0xe4)][_0x2ffc17(0x102)],_0x341734=_0x256765[_0x2ffc17(0xe4)][_0x2ffc17(0x110)];if(!_0x45fe29||typeof _0x45fe29!==_0x2ffc17(0x107)||Object['keys'](_0x45fe29)[_0x2ffc17(0x109)]===0x0)return null;return Object[_0x2ffc17(0xef)](_0x45fe29)[_0x2ffc17(0x10c)](([_0x3f38b3,_0x368ef8])=>({'name':_0x3f38b3,'appcode':_0x368ef8?.[_0x2ffc17(0xeb)]||'','isDefault':_0x3f38b3===_0x341734,'env':_0x368ef8?.[_0x2ffc17(0xed)],'apiDir':_0x368ef8?.[_0x2ffc17(0x10b)],'cookie':_0x368ef8?.[_0x2ffc17(0xf3)]||undefined}))[_0x2ffc17(0x10d)](_0x8502ab=>_0x8502ab[_0x2ffc17(0xeb)]);}export function getTemplateBaseUrl(_0x535b64){const _0x3472db=a216_0x3124,_0x2f5098=readRawConfig(_0x535b64);if(_0x2f5098['template_base_url']&&typeof _0x2f5098[_0x3472db(0x10e)]===_0x3472db(0xf1))return _0x2f5098[_0x3472db(0x10e)][_0x3472db(0xfc)](/\/$/,'');return _0x3472db(0x104);}function buildConfig(_0x366952,_0x178159,_0x6ae8d7){return{...resolveAppConfig({'raw':_0x366952,'flags':_0x178159,'layers':_0x6ae8d7,'readEnv':env}),'raw':_0x366952};}export function resolveApiFilePath(_0x3d9950,_0x42ec3a){const _0x505ce7=a216_0x3124,_0x14f454=resolve(process[_0x505ce7(0xf5)](),_0x3d9950),_0x49bf75=resolve(_0x14f454,'api.ts');if(!_0x42ec3a)return _0x49bf75;const _0x1ff3bf=readRawConfig(),_0x554756=_0x1ff3bf[_0x505ce7(0x102)]&&typeof _0x1ff3bf[_0x505ce7(0x102)]===_0x505ce7(0x107)?_0x1ff3bf[_0x505ce7(0x102)]:{},_0x2dc810=Object[_0x505ce7(0xef)](_0x554756)['find'](([,_0x619759])=>_0x619759?.[_0x505ce7(0xeb)]===_0x42ec3a);if(!_0x2dc810)return _0x49bf75;const [_0x404520,_0x1a405f]=_0x2dc810,_0x5b73c8=typeof _0x1ff3bf[_0x505ce7(0x110)]===_0x505ce7(0xf1)?_0x1ff3bf[_0x505ce7(0x110)]:undefined;if(_0x1a405f?.[_0x505ce7(0x10b)])return _0x49bf75;if(_0x5b73c8&&_0x404520!==_0x5b73c8)return resolve(_0x14f454,_0x404520+_0x505ce7(0xe8));return _0x49bf75;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x287ec9,_0x54c08a){const _0x511070=a217_0x337e,_0x3f418=_0x287ec9();while(!![]){try{const _0x9e39ba=-parseInt(_0x511070(0xd0))/0x1*(parseInt(_0x511070(0xd5))/0x2)+parseInt(_0x511070(0xc4))/0x3*(-parseInt(_0x511070(0xc8))/0x4)+parseInt(_0x511070(0xce))/0x5*(-parseInt(_0x511070(0xc9))/0x6)+-parseInt(_0x511070(0xcd))/0x7+-parseInt(_0x511070(0xcc))/0x8+parseInt(_0x511070(0xca))/0x9*(-parseInt(_0x511070(0xcb))/0xa)+parseInt(_0x511070(0xcf))/0xb;if(_0x9e39ba===_0x54c08a)break;else _0x3f418['push'](_0x3f418['shift']());}catch(_0x388e74){_0x3f418['push'](_0x3f418['shift']());}}}(a217_0x4149,0x57452));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function a217_0x337e(_0x44e4d8,_0x397121){_0x44e4d8=_0x44e4d8-0xc3;const _0x414939=a217_0x4149();let _0x337e94=_0x414939[_0x44e4d8];return _0x337e94;}function parseApiFile(_0x4c6bf4){const _0x5aaf85=a217_0x337e,_0x556b7e=[],_0xa93816=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x55597e;while((_0x55597e=_0xa93816['exec'](_0x4c6bf4))!==null){_0x556b7e[_0x5aaf85(0xc5)]({'datasetCode':_0x55597e[0x1],'tableName':_0x55597e[0x2],'name':_0x55597e[0x3],'alias':_0x55597e[0x4]});}return _0x556b7e;}export function loadAliasMap(_0xd8b5e,_0x2a0ae2,_0x3fde9c){const _0x448db5=a217_0x337e,_0x4e3d44=_0x3fde9c??resolve(process[_0x448db5(0xd3)](),_0xd8b5e,'api.ts');if(cache[_0x448db5(0xc3)](_0x4e3d44))return cache[_0x448db5(0xc7)](_0x4e3d44);if(!existsSync(_0x4e3d44))return cache['set'](_0x4e3d44,[]),[];try{const _0x44539b=readFileSync(_0x4e3d44,_0x448db5(0xd1)),_0x24581c=parseApiFile(_0x44539b);return cache[_0x448db5(0xd4)](_0x4e3d44,_0x24581c),_0x24581c;}catch{return cache[_0x448db5(0xd4)](_0x4e3d44,[]),[];}}export function resolveAlias(_0x4645b4,_0x944c54,_0x4a4e88,_0x2d5720){const _0x454dd9=a217_0x337e;if(!_0x944c54)return undefined;const _0x5dab6a=loadAliasMap(_0x4645b4,_0x4a4e88,_0x2d5720),_0x3ec605=_0x5dab6a[_0x454dd9(0xc6)](_0xfdc073=>_0xfdc073[_0x454dd9(0xd2)]===_0x944c54);return _0x3ec605?.[_0x454dd9(0xd6)];}function a217_0x4149(){const _0x46afe4=['set','10smuvCe','datasetCode','has','51zMaBFt','push','find','get','11796WILhzN','42kVjiGo','3456YWKsbS','14870aHZzWW','236448BWFrAZ','4144385WuFoNC','436675CeyrRW','31313810qEeCSD','127031oyLWNt','utf-8','alias','cwd'];a217_0x4149=function(){return _0x46afe4;};return a217_0x4149();}export function listAliases(_0x26db96,_0x476f6c,_0x26191e){return loadAliasMap(_0x26db96,_0x476f6c,_0x26191e);}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a218_0x5ab87d=a218_0x2314;(function(_0x293693,_0x3c12fb){const _0x263a4f=a218_0x2314,_0x534166=_0x293693();while(!![]){try{const _0x4b0b14=-parseInt(_0x263a4f(0x19f))/0x1*(parseInt(_0x263a4f(0x168))/0x2)+parseInt(_0x263a4f(0x190))/0x3*(parseInt(_0x263a4f(0x13a))/0x4)+-parseInt(_0x263a4f(0x1b1))/0x5*(-parseInt(_0x263a4f(0x1d0))/0x6)+parseInt(_0x263a4f(0x199))/0x7+-parseInt(_0x263a4f(0x12a))/0x8*(-parseInt(_0x263a4f(0x118))/0x9)+-parseInt(_0x263a4f(0x19c))/0xa+parseInt(_0x263a4f(0x1e7))/0xb*(-parseInt(_0x263a4f(0x183))/0xc);if(_0x4b0b14===_0x3c12fb)break;else _0x534166['push'](_0x534166['shift']());}catch(_0x13d166){_0x534166['push'](_0x534166['shift']());}}}(a218_0x3854,0x96f12));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';function a218_0x3854(){const _0x2055eb=['code','roleName','/smartapi/dblink/getTableDiffV2ByPage','modelId','List\x20enterprise\x20knowledge\x20bases\x20returned\x20invalid\x20paging\x20metadata.','info','/smartapi/app/getOne','\x20failed','/api/management/library/scripts/save','const\x20result\x20=\x20await\x20client.models.','sqlCode','responseFields','26904aiNyFI','cli:rabetbase','errorCode','errorMessage','API\x20error\x20code:\x20','value','longTerm','append','isInteger','relation','markdown','company','list','createTime','table','/smartapi/dataset/get-driven-data?','753952MKgPgZ','title','authRequired','has','ER\x20relation\x20does\x20not\x20exist','BFF\x20script\x20not\x20found:\x20id=','test','data','draftVersion','success','tableList','Unauthorized',':\x20invalid\x20JSON\x20response\x20envelope','hint','/admin/knowledge-base/create','/api/','sqlName','Knowledge-base\x20response\x20is\x20missing\x20a\x20valid\x20','/api/management/library/scripts/info?id=','/api/management/library/scripts/list?appCode=','summary','SQL\x20query\x20not\x20found:\x20','/smartapi/db-analysis/status/','(/*\x20params\x20*/);','/smartapi/tasks/','warn','stringify','update','/smartapi/user-accounts/cli/dingding-sandbox/bind','/smartapi/app/getList','status','/smartapi/dataset/delete-dataset','apiError','/smartapi/common/uploadFile','/smartapi/dblink/testConnect','/smartapi/custom/getUserCustomSql?id=','key','POST','permits','tableName','remove','type','BFF\x20save\x20returned\x20no\x20valid\x20id','pageContent','updateTime','/smartapi/app-config/update','2bQJDOj','.getOne(id);','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','Page\x20not\x20found:\x20','platform-transport-failure','pageSize','filter','):\x20missing\x20data.markdown\x20field','file','min','/smartapi/permit/role/update','/smartapi/menu/update','operations','pageName','toString','pageId','});','Request\x20failed:\x20','\x20of\x20','number','parentMenuId','/sync-to-pages','Request\x20timeout:\x20','version','target','API\x20error\x20code:\x20306','/smartapi/permit/user-role/update-user-list','27325668aDHjdN','appCode','map','List\x20enterprise\x20knowledge\x20bases\x20returned\x20an\x20invalid\x20response\x20contract.','/smartapi/dataset/text-generate/status?','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','\x20\x20sqlCode:\x20\x27','//\x20SQL:\x20','/api/management/library/scripts/statistics?appCode=','/smartapi/permit/role/get-permit-list','/smartapi/ocr/recognize-text?','/smartapi/db-analysis/jobs/cancel','/smartapi/permit/role/get-list','3RoGyoQ','json','i18nInfo','files','401','functionName','name','modelCode','dbId','5884655NTCjzp','method','includeImports','250980XcgZPp','userTenantRelationList','abort','415141kiNRsR','platform-error-code','cookie','/smartapi/custom/getUserCustomSql','/smartapi/db-analysis/start','/smartapi/dblink/delete','max','/smartapi/question/er-config/cli/update-single','AbortError','toLowerCase','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','path','validation','menu','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','pageIndex','/smartapi/permit/resource/get-menu-list','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','716405croUcT','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/smartapi/dblink/create','/smartapi/permit/user-role/get-user-list','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','label','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20','totalCount','//\x20','/api/node-toolbox/sql/save','message','.create({\x20/*\x20fields\x20*/\x20});','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','userId','currentPage','roleType','needSelf','isFinite','configArray','requestFields',',\x20HTTP\x20','tags','set','/api/node-toolbox/api-doc-generator','/smartapi/page/getDeletedPageList?','needPublic','/smartapi/lovrabet/dataset/','/smartapi/common/queryFileUrl','/smartapi/menu/create','body','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','48mJIZBu','isArray','/smartapi/permit/role/create','includes','Dataset\x20not\x20found:\x20','remark','\x20\x20currentPage:\x201,','Fetch\x20doc\x20(','/notification/channel-config/list','displayName','/admin/knowledge-base/delete','username','/smartapi/menu/batchDelete','React\x20custom\x20page\x20not\x20found:\x20','SQL\x20query\x20not\x20found:\x20id=','/smartapi/permit/page/get-one','clientOperationId','/smartapi/dataset/get-dataset-operation','Knowledge-base\x20update\x20requires\x20title\x20or\x20content.','signal','push','Fetch\x20async\x20task\x20','tableData','11DOhiQB','scriptName','\x20\x20\x20\x20sqlCode:\x20\x27','requirementDescription','url','\x22\x20not\x20found\x20in\x20dataset\x20','/smartapi/lovrabet/detail?pageId=','/smartapi/app-config/getByKey','/admin/knowledge-base/get-list','\x20\x20where:\x20{},','trim','/smartapi/permit/resource/get-api-list','/smartapi/question/er-config/business-group/edit','email','operationName','/smartapi/dataset/text-generate/preview','/smartapi/app-config/create','taskId','length','content','const\x20results\x20=\x20data.execResult\x20||\x20[];','materialName','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','/generate-standard-pages/start','replace','\x20failed,\x20HTTP\x20','GET','.remove(id);','/smartapi/dblink/getOne','errorMsg','operationId','entries','create','/smartapi/dataset/get-dataset-list','/api/management/script/cache/clear','/smartapi/app-config/list','Delete\x20enterprise\x20knowledge\x20base','CUSTOM','/api/custom/executeSql','/userTenant/queryBelongsTenants','dataset_','/filter','API\x20error:\x20','getOne','/smartapi/question/er-config','/smartapi/question/er-config/cli/detail?','/smartapi/webcode/page/create','/smartapi/dblink/getAllTableList','dbtableConfig','nickname','The\x20server\x20outcome\x20is\x20indeterminate.\x20Verify\x20current\x20state\x20before\x20retrying\x20any\x20mutation.','defineProperty','enabled','0000','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','description','find','Warning:\x20showing\x20first\x20','fetch-model-list','Invalid\x20response\x20format\x20(','/smartapi/lovrabet/update-page','/smartapi/app-config/delete','\x20\x20});','/api/management/library/scripts/delete','NaN','sdk','\x20\x20return\x20rows;','datasetTableCount','/smartapi/permit/role/get-one','List\x20enterprise\x20knowledge\x20bases','ENABLE','object','scriptType','isSafeInteger','string','/smartapi/menu/regroup','3105dndTfo','/smartapi/menu/find?','/smartapi/question/er-config/cli/erCreate','scope','Knowledge-base\x20API\x20returned\x20an\x20invalid\x20record\x20contract.','Operation\x20\x22'];a218_0x3854=function(){return _0x2055eb;};return a218_0x3854();}import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x3bbeba){_activeCookie=_0x3bbeba||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x57e40,PLATFORM_TRANSPORT_FAILURE=Symbol(a218_0x5ab87d(0x16c)),PLATFORM_ERROR_CODE=Symbol(a218_0x5ab87d(0x1a0));export function isPlatformTransportFailure(_0x3401aa){const _0x6247e4=a218_0x5ab87d;return Boolean(_0x3401aa&&typeof _0x3401aa===_0x6247e4(0x113)&&_0x3401aa[PLATFORM_TRANSPORT_FAILURE]===!![]);}export function getPlatformErrorCode(_0x2858c3){const _0x8f5ba4=a218_0x5ab87d;if(!_0x2858c3||typeof _0x2858c3!=='object')return undefined;const _0x365cd2=_0x2858c3[PLATFORM_ERROR_CODE];return typeof _0x365cd2===_0x8f5ba4(0x116)&&_0x365cd2?_0x365cd2:undefined;}function createPlatformApiError(_0x18e9ed,_0x390382){const _0x2739e4=a218_0x5ab87d,_0x332608=typeof _0x390382===_0x2739e4(0x116)?_0x390382[_0x2739e4(0x1f1)]():typeof _0x390382===_0x2739e4(0x17b)?String(_0x390382):'',_0x3b8f10=CliErrors['apiError'](_0x18e9ed,_0x332608?_0x2739e4(0x12e)+_0x332608:undefined);return _0x332608&&(Object[_0x2739e4(0x21a)](_0x3b8f10,PLATFORM_ERROR_CODE,{'value':_0x332608}),Object['defineProperty'](_0x3b8f10,_0x2739e4(0x141),{'value':{'remoteErrorCode':_0x332608},'enumerable':![]})),_0x3b8f10;}function createFetchFailureError(_0x1dc868,_0xd2a802){const _0xed079f=a218_0x5ab87d,_0x3058ea=_0xd2a802 instanceof Error?_0xd2a802[_0xed079f(0x1bb)]:String(_0xd2a802),_0x1c61a8=CliErrors[_0xed079f(0x15a)](_0xed079f(0x179)+_0x1dc868+(_0x3058ea?'\x20('+_0x3058ea+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');return Object[_0xed079f(0x21a)](_0x1c61a8,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x1c61a8;}function createIndeterminateResponseError(_0x38b84c){const _0x145a72=a218_0x5ab87d,_0xbc0672=CliErrors['apiError'](_0x38b84c+'\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20after\x20HTTP\x20success.',_0x145a72(0x219));return Object['defineProperty'](_0xbc0672,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0xbc0672;}async function apiRequest(_0x28e8b1,_0x4c8498={}){const _0x3f9fe6=a218_0x5ab87d,{method:method=_0x3f9fe6(0x201),body:_0x259d84,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x4c8498,_0x451c12=useRuntime?getRuntimeDomain():getApiDomain(),_0x56ea4f=_activeCookie||getCookie(),_0x3ce5bb=''+_0x451c12+_0x28e8b1,_0x312dae=new AbortController(),_0x44c1ee=setTimeout(()=>_0x312dae[_0x3f9fe6(0x19e)](),timeout);try{const _0x90be41=await fetch(_0x3ce5bb,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x56ea4f,'X-Invoke-Source':_0x3f9fe6(0x12b),...headers},'body':_0x259d84?JSON[_0x3f9fe6(0x154)](_0x259d84):undefined,'signal':_0x312dae[_0x3f9fe6(0x1e3)]});let _0x327ad7;try{_0x327ad7=await _0x90be41['json']();}catch(_0x35fb8f){if(_0x35fb8f instanceof Error&&_0x35fb8f[_0x3f9fe6(0x196)]==='AbortError')throw CliErrors[_0x3f9fe6(0x15a)]('Request\x20timeout:\x20'+_0x3ce5bb);if(_0x90be41['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x3f9fe6(0x15a)](_0x3f9fe6(0x1b2)+_0x90be41[_0x3f9fe6(0x158)]+')',_0x90be41[_0x3f9fe6(0x158)]>=0x190?_0x3f9fe6(0x102):undefined);}if(!_0x90be41['ok']||_0x327ad7[_0x3f9fe6(0x143)]===![])throw CliErrors[_0x3f9fe6(0x15a)](_0x327ad7[_0x3f9fe6(0x204)]||_0x327ad7[_0x3f9fe6(0x1bb)]||_0x3f9fe6(0x211)+_0x90be41['status'],_0x327ad7[_0x3f9fe6(0x12c)]?_0x3f9fe6(0x12e)+_0x327ad7['errorCode']:undefined);return _0x327ad7;}catch(_0x14d00b){if(_0x14d00b instanceof CliError)throw _0x14d00b;if(_0x14d00b instanceof Error&&_0x14d00b[_0x3f9fe6(0x196)]===_0x3f9fe6(0x1a7))throw CliErrors[_0x3f9fe6(0x15a)]('Request\x20timeout:\x20'+_0x3ce5bb);throw createFetchFailureError(_0x3ce5bb,_0x14d00b);}finally{clearTimeout(_0x44c1ee);}}async function apiFormRequest(_0x250896,_0x284652,_0x3739a8={}){const _0x1fb39e=a218_0x5ab87d,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x3739a8,_0x8e4080=_activeCookie||getCookie(),_0x49adad=''+getApiDomain()+_0x250896,_0x8123fc=new AbortController(),_0x501828=setTimeout(()=>_0x8123fc[_0x1fb39e(0x19e)](),timeout);try{const _0x5a3335=await fetch(_0x49adad,{'method':_0x1fb39e(0x15f),'headers':{'Cookie':_0x8e4080,'X-Invoke-Source':_0x1fb39e(0x12b)},'body':_0x284652,'signal':_0x8123fc[_0x1fb39e(0x1e3)]});let _0x448d66;try{_0x448d66=await _0x5a3335['json']();}catch(_0x58845f){if(_0x58845f instanceof Error&&_0x58845f[_0x1fb39e(0x196)]===_0x1fb39e(0x1a7))throw CliErrors['apiError'](_0x1fb39e(0x17e)+_0x49adad);throw CliErrors[_0x1fb39e(0x15a)](_0x1fb39e(0x1b2)+_0x5a3335[_0x1fb39e(0x158)]+')',_0x5a3335['status']>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x5a3335['ok']||_0x448d66[_0x1fb39e(0x143)]===![])throw CliErrors['apiError'](_0x448d66['errorMsg']||_0x448d66[_0x1fb39e(0x1bb)]||_0x1fb39e(0x211)+_0x5a3335[_0x1fb39e(0x158)],_0x448d66[_0x1fb39e(0x12c)]?_0x1fb39e(0x12e)+_0x448d66[_0x1fb39e(0x12c)]:undefined);return _0x448d66;}catch(_0x3b7734){if(_0x3b7734 instanceof CliError)throw _0x3b7734;if(_0x3b7734 instanceof Error&&_0x3b7734[_0x1fb39e(0x196)]==='AbortError')throw CliErrors[_0x1fb39e(0x15a)](_0x1fb39e(0x17e)+_0x49adad);throw createFetchFailureError(_0x49adad,_0x3b7734);}finally{clearTimeout(_0x501828);}}export async function uploadDevelopmentFile(_0xbd0f54,_0x1e5ab2){const _0x369ba0=a218_0x5ab87d,_0x1f957a=await readFile(_0x1e5ab2),_0x2351e7=new FormData();_0x2351e7['append']('appCode',_0xbd0f54),_0x2351e7[_0x369ba0(0x131)](_0x369ba0(0x170),new Blob([new Uint8Array(_0x1f957a)]),basename(_0x1e5ab2));const _0x39d639=await apiFormRequest(_0x369ba0(0x15b),_0x2351e7);return _0x39d639[_0x369ba0(0x141)];}export async function queryDevelopmentFileUrl(_0x4f70cd,_0xdcab22={}){const _0x46ffcf=a218_0x5ab87d,_0x3acefd=await apiRequest(_0x46ffcf(0x1cc),{'method':_0x46ffcf(0x15f),'body':{'filePath':_0x4f70cd,'downloadFlag':_0xdcab22['download']??![],..._0xdcab22[_0x46ffcf(0x130)]?{'longTerm':!![]}:{}}});return _0x3acefd[_0x46ffcf(0x141)];}export async function recognizeDevelopmentOcr(_0x49f09f,_0x1e2b56){const _0x17f77c=a218_0x5ab87d,_0xea6430=new URLSearchParams({'url':_0x1e2b56[_0x17f77c(0x1eb)],'type':_0x1e2b56[_0x17f77c(0x163)],'appCode':_0x49f09f}),_0x4b7b75=await apiRequest(_0x17f77c(0x18d)+_0xea6430[_0x17f77c(0x176)](),{'method':_0x17f77c(0x201)});return _0x4b7b75[_0x17f77c(0x141)];}export const DING_TALK_SANDBOX_BIND_PATH=a218_0x5ab87d(0x156);export async function bindDingTalkSandboxAccount(_0x1388c2){const _0x48f6b2=a218_0x5ab87d,_0x3abf9a=await apiRequest(DING_TALK_SANDBOX_BIND_PATH,{'method':_0x48f6b2(0x15f),'body':{'dingTalkUserId':_0x1388c2}});return _0x3abf9a[_0x48f6b2(0x141)];}function isAuthFailure(_0xf9be9b){const _0x4ef63f=a218_0x5ab87d,_0x5e3ba9=_0xf9be9b[_0x4ef63f(0x204)]||_0xf9be9b['message']||_0xf9be9b[_0x4ef63f(0x141)]?.['message']||_0xf9be9b[_0x4ef63f(0x12d)]||_0xf9be9b['error']||'';return _0xf9be9b[_0x4ef63f(0x12c)]==='UNAUTHORIZED'||_0xf9be9b[_0x4ef63f(0x11e)]===0x191||_0xf9be9b['code']===_0x4ef63f(0x194)||_0x5e3ba9['includes'](_0x4ef63f(0x194))||_0x5e3ba9['includes'](_0x4ef63f(0x145))||_0x5e3ba9[_0x4ef63f(0x1d3)]('登录')||_0x5e3ba9['includes']('认证');}export async function platformFetch(_0x4752f3,_0x28dcee){const _0x43e267=a218_0x5ab87d;let _0x5aaf94;try{_0x5aaf94=await fetch(_0x4752f3,{'method':_0x28dcee[_0x43e267(0x19a)]??'GET','headers':{'Content-Type':'application/json','Cookie':_0x28dcee[_0x43e267(0x1a1)],'X-Invoke-Source':_0x43e267(0x12b)},..._0x28dcee[_0x43e267(0x1ce)]&&{'body':JSON[_0x43e267(0x154)](_0x28dcee[_0x43e267(0x1ce)])}});}catch(_0x408efb){throw createFetchFailureError(_0x4752f3,_0x408efb);}let _0x4a0521;try{_0x4a0521=await _0x5aaf94[_0x43e267(0x191)]();}catch(_0xf80169){if(!_0x5aaf94['ok']){if(_0x5aaf94[_0x43e267(0x158)]===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x43e267(0x15a)](_0x28dcee[_0x43e267(0x1b6)]+_0x43e267(0x200)+_0x5aaf94['status']);}throw createFetchFailureError(_0x4752f3,_0xf80169);}if(_0x4a0521===null||typeof _0x4a0521!==_0x43e267(0x113)||Array[_0x43e267(0x1d1)](_0x4a0521)){if(_0x5aaf94['status']===0x191)throw CliErrors[_0x43e267(0x13c)]();if(_0x5aaf94['ok'])throw createIndeterminateResponseError(_0x28dcee[_0x43e267(0x1b6)]);throw CliErrors[_0x43e267(0x15a)](_0x28dcee['label']+_0x43e267(0x125)+(!_0x5aaf94['ok']?',\x20HTTP\x20'+_0x5aaf94[_0x43e267(0x158)]:'')+_0x43e267(0x146));}const _0x3f3b69=typeof _0x4a0521[_0x43e267(0x12c)]===_0x43e267(0x116)||typeof _0x4a0521[_0x43e267(0x12c)]===_0x43e267(0x17b),_0x191259=_0x3f3b69?String(_0x4a0521[_0x43e267(0x12c)])[_0x43e267(0x1f1)]():'',_0x259c0c=_0x4a0521['success']===![]||_0x3f3b69&&_0x191259!==_0x43e267(0x101);if(!_0x5aaf94['ok']||_0x259c0c){if(_0x5aaf94[_0x43e267(0x158)]===0x191||isAuthFailure(_0x4a0521))throw CliErrors[_0x43e267(0x13c)]();throw createPlatformApiError(_0x4a0521['errorMsg']||_0x4a0521['message']||_0x28dcee['label']+'\x20failed'+(!_0x5aaf94['ok']?_0x43e267(0x1c5)+_0x5aaf94[_0x43e267(0x158)]:''),_0x4a0521[_0x43e267(0x12c)]??_0x4a0521[_0x43e267(0x11e)]);}if(_0x4a0521[_0x43e267(0x143)]!==!![]||_0x4a0521[_0x43e267(0x12c)]!=='0000')throw createIndeterminateResponseError(_0x28dcee['label']);return _0x4a0521['data'];}export async function platformRequest(_0xc614ba,_0x1dd5bc){const _0x692701=a218_0x5ab87d;if(/^https?:\/\//i[_0x692701(0x140)](_0xc614ba))throw CliErrors[_0x692701(0x1ab)](_0x692701(0x1cf)+_0xc614ba,_0x692701(0x1a9));const _0x3296eb=_0xc614ba['startsWith']('/')?_0xc614ba:'/'+_0xc614ba;return platformFetch(''+getApiDomain()+_0x3296eb,_0x1dd5bc);}const MAX_KNOWLEDGE_BASE_PAGE_SIZE=0x64;function parseKnowledgeBaseInteger(_0x25d5fc,_0x4d3d6c){const _0x280e51=a218_0x5ab87d,_0x57ede7=typeof _0x25d5fc===_0x280e51(0x17b)?_0x25d5fc:typeof _0x25d5fc===_0x280e51(0x116)&&/^(0|[1-9]\d*)$/['test'](_0x25d5fc)?Number(_0x25d5fc):Number[_0x280e51(0x10c)],_0x55b0f0=Number[_0x280e51(0x115)](_0x57ede7)&&(_0x4d3d6c==='id'?_0x57ede7>0x0:_0x57ede7>=0x0);if(!_0x55b0f0)throw CliErrors['apiError'](_0x280e51(0x1b7)+_0x4d3d6c+'.');return _0x57ede7;}function parseKnowledgeBaseText(_0x66ed18,_0x4569e2){const _0x5d1013=a218_0x5ab87d;if(typeof _0x66ed18===_0x5d1013(0x116)&&(_0x4569e2===_0x5d1013(0x1fa)||_0x66ed18[_0x5d1013(0x1f1)]()))return _0x66ed18;throw CliErrors[_0x5d1013(0x15a)](_0x5d1013(0x14b)+_0x4569e2+'.');}function parseKnowledgeBaseRecord(_0x128b40){const _0x43145f=a218_0x5ab87d;if(!_0x128b40||typeof _0x128b40!=='object'||Array[_0x43145f(0x1d1)](_0x128b40))throw CliErrors[_0x43145f(0x15a)](_0x43145f(0x11c));const _0x9c46ea=_0x128b40;if(_0x9c46ea[_0x43145f(0x11b)]!==_0x43145f(0x135)&&_0x9c46ea[_0x43145f(0x11b)]!=='personal')throw CliErrors[_0x43145f(0x15a)]('Knowledge-base\x20response\x20contains\x20an\x20invalid\x20scope.');const _0x659a0e={'id':parseKnowledgeBaseInteger(_0x9c46ea['id'],'id'),'scope':_0x9c46ea['scope'],'appCode':parseKnowledgeBaseText(_0x9c46ea[_0x43145f(0x184)],_0x43145f(0x184)),'title':parseKnowledgeBaseText(_0x9c46ea[_0x43145f(0x13b)],_0x43145f(0x13b)),'version':parseKnowledgeBaseInteger(_0x9c46ea[_0x43145f(0x17f)],_0x43145f(0x17f)),'content':parseKnowledgeBaseText(_0x9c46ea[_0x43145f(0x1fa)],_0x43145f(0x1fa))};return(_0x9c46ea[_0x43145f(0x137)]===null||typeof _0x9c46ea['createTime']===_0x43145f(0x116)||typeof _0x9c46ea[_0x43145f(0x137)]==='number')&&(_0x659a0e[_0x43145f(0x137)]=_0x9c46ea[_0x43145f(0x137)]),(_0x9c46ea[_0x43145f(0x166)]===null||typeof _0x9c46ea['updateTime']==='string'||typeof _0x9c46ea['updateTime']===_0x43145f(0x17b))&&(_0x659a0e[_0x43145f(0x166)]=_0x9c46ea[_0x43145f(0x166)]),_0x659a0e;}export async function listEnterpriseKnowledgeBases(_0xb510e9,_0x526b4e={}){const _0x51cc8c=a218_0x5ab87d,_0x45cce7=_0x526b4e[_0x51cc8c(0x16d)]??0x32;if(!Number[_0x51cc8c(0x115)](_0x45cce7)||_0x45cce7<0x1||_0x45cce7>MAX_KNOWLEDGE_BASE_PAGE_SIZE)throw CliErrors['validation']('Knowledge-base\x20pageSize\x20must\x20be\x20an\x20integer\x20between\x201\x20and\x20'+MAX_KNOWLEDGE_BASE_PAGE_SIZE+'.');const _0x545f82=await platformRequest(_0x51cc8c(0x1ef),{'method':_0x51cc8c(0x15f),'cookie':_0xb510e9,'label':_0x51cc8c(0x111),'body':{'currentPage':_0x526b4e[_0x51cc8c(0x1bf)]??0x1,'pageSize':_0x45cce7,'scope':_0x51cc8c(0x135),..._0x526b4e['appCode']?{'appCode':_0x526b4e[_0x51cc8c(0x184)]}:{},..._0x526b4e['title']?{'title':_0x526b4e['title']}:{}}});if(!_0x545f82||typeof _0x545f82!==_0x51cc8c(0x113)||Array['isArray'](_0x545f82)||!Array[_0x51cc8c(0x1d1)](_0x545f82['tableData']))throw CliErrors['apiError'](_0x51cc8c(0x186));const _0x3dfddb=extractPaging(_0x545f82);if(!_0x3dfddb||!Number['isInteger'](_0x3dfddb[_0x51cc8c(0x1bf)])||!Number[_0x51cc8c(0x132)](_0x3dfddb[_0x51cc8c(0x16d)])||!Number['isInteger'](_0x3dfddb[_0x51cc8c(0x1b8)])||_0x3dfddb[_0x51cc8c(0x1bf)]<0x1||_0x3dfddb['pageSize']<0x1||_0x3dfddb[_0x51cc8c(0x16d)]>MAX_KNOWLEDGE_BASE_PAGE_SIZE||_0x3dfddb[_0x51cc8c(0x1b8)]<0x0)throw CliErrors[_0x51cc8c(0x15a)](_0x51cc8c(0x122));return{'items':extractList(_0x545f82)[_0x51cc8c(0x185)](parseKnowledgeBaseRecord),'paging':_0x3dfddb};}export async function getEnterpriseKnowledgeBase(_0x1ec5a0,_0x4913fb){const _0x43c9f1=await platformRequest('/admin/knowledge-base/get-one'+buildQuery({'id':_0x4913fb}),{'cookie':_0x1ec5a0,'label':'Get\x20enterprise\x20knowledge\x20base'});return parseKnowledgeBaseRecord(_0x43c9f1);}export async function createEnterpriseKnowledgeBase(_0x54077e,_0x25b71b){const _0x35d25a=a218_0x5ab87d,_0x4dd8e4=await platformRequest(_0x35d25a(0x148),{'method':'POST','cookie':_0x54077e,'label':'Create\x20enterprise\x20knowledge\x20base','body':{'scope':_0x35d25a(0x135),..._0x25b71b}});return parseKnowledgeBaseRecord(_0x4dd8e4);}export async function updateEnterpriseKnowledgeBase(_0x431f32,_0x163e73){const _0x1186e5=a218_0x5ab87d;if(_0x163e73['title']===undefined&&_0x163e73[_0x1186e5(0x1fa)]===undefined)throw CliErrors[_0x1186e5(0x1ab)](_0x1186e5(0x1e2));const _0x3b32eb=await platformRequest('/admin/knowledge-base/update',{'method':_0x1186e5(0x15f),'cookie':_0x431f32,'label':'Update\x20enterprise\x20knowledge\x20base','body':{'id':_0x163e73['id'],..._0x163e73[_0x1186e5(0x13b)]!==undefined?{'title':_0x163e73[_0x1186e5(0x13b)]}:{},..._0x163e73[_0x1186e5(0x1fa)]!==undefined?{'content':_0x163e73['content']}:{}}});return parseKnowledgeBaseRecord(_0x3b32eb);}export async function deleteEnterpriseKnowledgeBase(_0x313b05,_0xc0a89e){const _0xda8ced=a218_0x5ab87d;await platformRequest(_0xda8ced(0x1da),{'method':'POST','cookie':_0x313b05,'label':_0xda8ced(0x20b),'body':{'id':_0xc0a89e}});}function cleanNewlines(_0x429ace){const _0x584beb=a218_0x5ab87d;return _0x429ace[_0x584beb(0x1ff)](/[\r\n]+/g,'\x20')[_0x584beb(0x1f1)]();}function cleanDatasetName(_0x254748){const _0x56a1e2=a218_0x5ab87d;if(!_0x254748[_0x56a1e2(0x196)])return _0x254748;return{..._0x254748,'name':cleanNewlines(_0x254748[_0x56a1e2(0x196)])};}export async function fetchModelList(_0x1c9a41,_0x1c31f9){const _0xd81f43=a218_0x5ab87d,_0x15aba2=getEnv(),_0x468f4d=new URLSearchParams({'appcode':_0x1c9a41,'otype':'array'}),_0x18943f='/api/node-toolbox/dataset/model-list?'+_0x468f4d[_0xd81f43(0x176)]();logger[_0xd81f43(0x123)](_0xd81f43(0x106),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x15aba2+')',{'apiPath':_0x18943f});const _0x2203bd=await platformRequest(_0x18943f,{'cookie':_0x1c31f9,'label':'Fetch\x20datasets'}),_0x2ce969=(_0x2203bd[_0xd81f43(0x1c3)]??[])[_0xd81f43(0x185)](cleanDatasetName);return{'configArray':_0x2ce969,'count':_0x2ce969[_0xd81f43(0x1f9)]};}export async function fetchDatasetDoc(_0x13b397){const _0xb605fb=a218_0x5ab87d,{appCode:_0x17fd5a,cookie:_0x3f9c79,datasetCode:_0x33878a,datasetId:_0x444e3e,extraParams:_0x4814cc}=_0x13b397,_0xbeb935=await platformRequest(_0xb605fb(0x1c8),{'method':'POST','body':{'appCode':_0x17fd5a,'datasetCode':_0x33878a,'datasetId':_0x444e3e,..._0x4814cc||{}},'cookie':_0x3f9c79,'label':_0xb605fb(0x1d7)+_0x33878a+')'});if(!_0xbeb935||typeof _0xbeb935[_0xb605fb(0x134)]!==_0xb605fb(0x116))throw new Error(_0xb605fb(0x107)+_0x33878a+_0xb605fb(0x16f));return _0xbeb935[_0xb605fb(0x134)];}export async function getMenuTree(_0x3ca9ee,_0x19cc54){const _0x37f8fc=a218_0x5ab87d,_0x4d80f8=new URLSearchParams({'appCode':_0x3ca9ee});return platformRequest(_0x37f8fc(0x119)+_0x4d80f8[_0x37f8fc(0x176)](),{'cookie':_0x19cc54,'label':'Fetch\x20menu\x20list'});}export async function createMenuRecord(_0x15c760,_0x5059d4,_0x20a539){const _0xf81dad=a218_0x5ab87d;return platformRequest(_0xf81dad(0x1cd),{'method':_0xf81dad(0x15f),'body':_0x15c760,'cookie':_0x5059d4,'label':_0x20a539});}export async function updateMenuRecord(_0xa919c,_0x206ea8,_0x148dfe){const _0x251f99=a218_0x5ab87d;return platformRequest(_0x251f99(0x173),{'method':'POST','body':_0xa919c,'cookie':_0x206ea8,'label':_0x148dfe});}export async function deleteMenuRecord(_0x1caf25,_0x358911,_0x40b1e4){return platformRequest('/smartapi/menu/delete',{'method':'POST','body':{'id':_0x1caf25},'cookie':_0x358911,'label':_0x40b1e4});}export async function batchDeleteMenuRecords(_0x21df0c,_0x5e1995,_0x15076b){const _0x4d4937=a218_0x5ab87d;return platformRequest(_0x4d4937(0x1dc),{'method':_0x4d4937(0x15f),'body':{'idList':_0x21df0c},'cookie':_0x5e1995,'label':_0x15076b});}export async function startMenuRegroup(_0x389e3e,_0x57f5cc,_0x44f25a){const _0x34c44f=a218_0x5ab87d;return platformRequest(_0x34c44f(0x117),{'method':_0x34c44f(0x15f),'body':_0x389e3e,'cookie':_0x57f5cc,'label':_0x44f25a});}export async function getAsyncTaskStatus(_0x2cd775,_0x4ffcea,_0x15ce0b){const _0x3cdc92=a218_0x5ab87d,_0x1724ea=new URLSearchParams({'appCode':_0x4ffcea});return platformRequest(_0x3cdc92(0x152)+encodeURIComponent(_0x2cd775)+'?'+_0x1724ea['toString'](),{'cookie':_0x15ce0b,'label':_0x3cdc92(0x1e5)+_0x2cd775});}export async function listBffScripts(_0x42d712,_0x254dd7,_0x1df317){const _0x435f58=a218_0x5ab87d;let _0x334180=_0x435f58(0x14d)+_0x42d712;if(_0x254dd7)_0x334180+='&type='+_0x254dd7;const _0x49c14a=await apiRequest(_0x334180);let _0x2dfaf9=extractList(_0x49c14a['data']);if(_0x1df317?.['scriptName']){const _0x19f432=_0x1df317[_0x435f58(0x1e8)][_0x435f58(0x1a8)]();_0x2dfaf9=_0x2dfaf9[_0x435f58(0x16e)](_0x3ee84f=>_0x3ee84f[_0x435f58(0x195)]?.['toLowerCase']()[_0x435f58(0x1d3)](_0x19f432)||_0x3ee84f[_0x435f58(0x103)]?.['toLowerCase']()[_0x435f58(0x1d3)](_0x19f432));}return _0x2dfaf9;}export async function getBffScriptInfo(_0x4117c5){const _0x5140ee=a218_0x5ab87d,_0x554d00=await apiRequest(_0x5140ee(0x14c)+_0x4117c5);if(!_0x554d00[_0x5140ee(0x141)])throw CliErrors[_0x5140ee(0x1ab)](_0x5140ee(0x13f)+_0x4117c5);return _0x554d00[_0x5140ee(0x141)];}export async function saveBffScript(_0x2797eb){const _0x32206a=a218_0x5ab87d,_0x5f5838=await apiRequest(_0x32206a(0x126),{'method':_0x32206a(0x15f),'body':_0x2797eb}),{id:_0x45d99c,entity:_0x353337}=normalizeEntityWithIdResponse(_0x5f5838[_0x32206a(0x141)]);if(_0x45d99c!==undefined){const _0x3b8186=typeof _0x353337[_0x32206a(0x195)]===_0x32206a(0x116)||typeof _0x353337[_0x32206a(0x114)]===_0x32206a(0x116)?_0x353337:undefined;return{'id':_0x45d99c,'script':_0x3b8186};}throw CliErrors[_0x32206a(0x15a)](_0x32206a(0x164));}export async function deleteBffScript(_0x198c24){const _0x335208=a218_0x5ab87d;await apiRequest(_0x335208(0x10b),{'method':_0x335208(0x15f),'body':{'id':_0x198c24}});}export async function getBffScriptStatistics(_0x5aca59){const _0x17dbee=a218_0x5ab87d,_0xa981db=await apiRequest(_0x17dbee(0x18b)+_0x5aca59);return extractList(_0xa981db['data']);}export async function clearBffScriptCache(){const _0x1d5001=a218_0x5ab87d,_0x4c2b23=await apiRequest(_0x1d5001(0x209),{'method':_0x1d5001(0x15f),'useRuntime':!![]});return typeof _0x4c2b23[_0x1d5001(0x141)]===_0x1d5001(0x116)?_0x4c2b23[_0x1d5001(0x141)]:'';}export async function listBffDatasetOperations(_0x32512b,_0x302362){const _0x2dbdaf=a218_0x5ab87d,_0x4cf48f=await apiRequest(_0x2dbdaf(0x1e1),{'method':'POST','body':{'appCode':_0x32512b,'datasetId':_0x302362}});return _0x4cf48f[_0x2dbdaf(0x141)];}export async function listSqlQueries(_0x290b6c,_0x2c328e){const _0x22af99=a218_0x5ab87d,_0x3c6228=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':'POST','body':{'appCode':_0x290b6c,'currentPage':_0x2c328e?.[_0x22af99(0x1bf)]??0x1,'pageSize':_0x2c328e?.['pageSize']??0x32,'sqlCode':_0x2c328e?.[_0x22af99(0x128)],'sqlName':_0x2c328e?.[_0x22af99(0x14a)]}});return _0x3c6228[_0x22af99(0x141)];}export async function getSqlQueryInfo(_0x443f2f,_0x1d794d){const _0x30743c=a218_0x5ab87d,_0x34f512=await listSqlQueries(_0x443f2f,{'sqlCode':_0x1d794d}),_0xfff127=_0x34f512[_0x30743c(0x1e6)]?.[0x0];if(!_0xfff127)throw CliErrors[_0x30743c(0x1ab)](_0x30743c(0x14f)+_0x1d794d);return _0xfff127;}export async function getSqlQueryDetail(_0x5f51f8){const _0x54ad0e=a218_0x5ab87d,_0x1ea393=await apiRequest(_0x54ad0e(0x1a2)+('?sqlCode='+encodeURIComponent(_0x5f51f8)));if(!_0x1ea393[_0x54ad0e(0x141)])throw CliErrors[_0x54ad0e(0x1ab)](_0x54ad0e(0x14f)+_0x5f51f8);return _0x1ea393[_0x54ad0e(0x141)];}export async function getSqlQueryDetailById(_0x406404){const _0x5a9766=a218_0x5ab87d,_0x5ed776=await apiRequest(_0x5a9766(0x15d)+_0x406404);if(!_0x5ed776[_0x5a9766(0x141)])throw CliErrors[_0x5a9766(0x1ab)](_0x5a9766(0x1de)+_0x406404);return _0x5ed776[_0x5a9766(0x141)];}export async function createSqlQuery(_0x574f71){const _0x36ba9f=a218_0x5ab87d,_0x46b83e=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':'POST','body':_0x574f71}),{id:_0x4f5824,entity:_0x234494}=normalizeEntityWithIdResponse(_0x46b83e[_0x36ba9f(0x141)]);if(!(_0x36ba9f(0x128)in _0x234494)&&_0x4f5824)return getSqlQueryDetailById(_0x4f5824);return normalizeSqlQueryEntity(_0x234494);}export async function updateSqlQuery(_0x55253c){const _0xb13262=a218_0x5ab87d,_0x50adf4=await apiRequest('/smartapi/custom/updateUserCustomSql',{'method':_0xb13262(0x15f),'body':_0x55253c}),{id:_0x22763e,entity:_0x21dd07}=normalizeEntityWithIdResponse(_0x50adf4['data']);if(!(_0xb13262(0x128)in _0x21dd07)){if(_0x55253c[_0xb13262(0x128)])return getSqlQueryDetail(_0x55253c[_0xb13262(0x128)]);if(_0x22763e)return getSqlQueryDetailById(_0x22763e);}return normalizeSqlQueryEntity(_0x21dd07);}export async function deleteSqlQuery(_0x5976e3){const _0x1afdfc=a218_0x5ab87d;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x1afdfc(0x15f),'body':_0x5976e3});}export async function saveSqlQuery(_0x21a866){const _0x127e47=a218_0x5ab87d,_0x5c9ea9=await apiRequest(_0x127e47(0x1ba),{'method':_0x127e47(0x15f),'body':_0x21a866});return _0x5c9ea9[_0x127e47(0x141)];}function normalizeSqlQueryEntity(_0x2bef7a){const _0x52fc74=a218_0x5ab87d;return{..._0x2bef7a,'id':Number(_0x2bef7a['id']),'dbId':_0x2bef7a[_0x52fc74(0x198)]==null?undefined:Number(_0x2bef7a[_0x52fc74(0x198)]),'version':_0x2bef7a[_0x52fc74(0x17f)]==null?undefined:Number(_0x2bef7a['version'])};}export async function executeSql(_0x12d704,_0x38cd19,_0x1e2305){const _0x1ac71d=a218_0x5ab87d,_0x33dd32=await apiRequest(_0x1ac71d(0x20d),{'method':_0x1ac71d(0x15f),'body':{'appCode':_0x12d704,'sqlCode':_0x38cd19,..._0x1e2305&&{'params':_0x1e2305}},'useRuntime':!![]});return _0x33dd32[_0x1ac71d(0x141)];}export async function executeDatasetDataOperation(_0x3f8277,_0x480588,_0x250ca8,_0xc865a9={}){const _0x4be136=a218_0x5ab87d;try{const _0xd58280=await apiRequest(_0x4be136(0x149)+_0x3f8277+'/'+_0x480588+'/'+_0x250ca8,{'method':_0x4be136(0x15f),'body':_0xc865a9,'useRuntime':!![]});return _0xd58280[_0x4be136(0x141)];}catch(_0x583d97){if(_0x250ca8===_0x4be136(0x212)&&_0x583d97 instanceof CliError&&_0x583d97[_0x4be136(0x11e)]==='api_error'&&_0xc865a9['id']!==undefined&&_0xc865a9['id']!==null&&_0xc865a9['id']!==''){const _0x2ff749=await apiRequest(_0x4be136(0x149)+_0x3f8277+'/'+_0x480588+_0x4be136(0x210),{'method':_0x4be136(0x15f),'body':{'where':{'id':{'$eq':_0xc865a9['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x3109d4=Array['isArray'](_0x2ff749['data']?.[_0x4be136(0x1e6)])?_0x2ff749[_0x4be136(0x141)][_0x4be136(0x1e6)]:[];return _0x3109d4[0x0]??null;}throw _0x583d97;}}export async function listDatasets(_0x555feb,_0x2b4098){const _0x457a8b=a218_0x5ab87d,_0x89bdf7={'appCode':_0x555feb,'deleted':_0x2b4098?.['deleted']??![]};if(_0x2b4098?.[_0x457a8b(0x11e)])_0x89bdf7[_0x457a8b(0x11e)]=_0x2b4098[_0x457a8b(0x11e)];if(_0x2b4098?.[_0x457a8b(0x196)])_0x89bdf7[_0x457a8b(0x196)]=_0x2b4098[_0x457a8b(0x196)];const _0x14df74=await apiRequest(_0x457a8b(0x208),{'method':'POST','body':_0x89bdf7});return extractList(_0x14df74[_0x457a8b(0x141)]);}export async function deleteDataset(_0x3d1516,_0x564241){const _0x5432f9=a218_0x5ab87d;await apiRequest(_0x5432f9(0x159),{'method':_0x5432f9(0x15f),'body':{'appCode':_0x3d1516,'datasetId':_0x564241}});}export async function restoreDataset(_0x52494b,_0x4f4bf7){await apiRequest('/smartapi/dataset/restore-dataset',{'method':'POST','body':{'appCode':_0x52494b,'datasetId':_0x4f4bf7}});}export async function previewTextGeneratedDataset(_0x450cbb,_0x596da4){const _0x2ec9be=a218_0x5ab87d,_0x5c6ed8=await apiRequest(_0x2ec9be(0x1f6),{'method':_0x2ec9be(0x15f),'body':{'appCode':_0x450cbb,'datasetName':_0x596da4['datasetName'],'requirementDescription':_0x596da4[_0x2ec9be(0x1ea)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x5c6ed8[_0x2ec9be(0x141)];}export async function startTextGeneratedDataset(_0x2ecdd4,_0x5dadaa,_0x126667){const _0x107baf=a218_0x5ab87d,_0x1b7fe4=await apiRequest('/smartapi/dataset/text-generate/start',{'method':'POST','body':{'appCode':_0x2ecdd4,..._0x126667?.[_0x107baf(0x1e0)]?{'clientOperationId':_0x126667[_0x107baf(0x1e0)]}:{},'design':_0x5dadaa},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x1b7fe4[_0x107baf(0x141)];}export async function getTextGeneratedDatasetStatus(_0x200c7c,_0x1b7793){const _0x5b53dd=a218_0x5ab87d,_0x18ac34=new URLSearchParams({'appCode':_0x200c7c});if(_0x1b7793[_0x5b53dd(0x1f8)])_0x18ac34[_0x5b53dd(0x1c7)](_0x5b53dd(0x205),_0x1b7793[_0x5b53dd(0x1f8)]);else{if(_0x1b7793['operationId'])_0x18ac34[_0x5b53dd(0x1c7)](_0x5b53dd(0x205),_0x1b7793['operationId']);else _0x1b7793[_0x5b53dd(0x1e0)]&&_0x18ac34[_0x5b53dd(0x1c7)](_0x5b53dd(0x1e0),_0x1b7793[_0x5b53dd(0x1e0)]);}const _0x147437=await apiRequest(_0x5b53dd(0x187)+_0x18ac34['toString']());return _0x147437[_0x5b53dd(0x141)];}export async function searchDatasets(_0x2088ce,_0x1c6a4b){const _0x46b7aa=a218_0x5ab87d,_0x306b5f=await listDatasets(_0x2088ce,{'name':_0x1c6a4b}),_0xea36fb=_0x1c6a4b[_0x46b7aa(0x1a8)](),_0x7ba3e1=new Set(_0x306b5f[_0x46b7aa(0x185)](_0x4e8f1e=>_0x4e8f1e['id'])),_0x53e250=_0x306b5f[_0x46b7aa(0x16e)](_0x12679d=>_0x12679d[_0x46b7aa(0x217)]?.[_0x46b7aa(0x161)]?.['toLowerCase']()[_0x46b7aa(0x1d3)](_0xea36fb)||_0x12679d['description']?.[_0x46b7aa(0x1a8)]()[_0x46b7aa(0x1d3)](_0xea36fb)),_0x43586a=await listDatasets(_0x2088ce,{'code':_0x1c6a4b});for(const _0x134d58 of _0x43586a){!_0x7ba3e1[_0x46b7aa(0x13d)](_0x134d58['id'])&&(_0x306b5f[_0x46b7aa(0x1e4)](_0x134d58),_0x7ba3e1['add'](_0x134d58['id']));}return _0x306b5f;}export function normalizeDatasetOperations(_0x4009a7){const _0x45f66c=a218_0x5ab87d;if(Array['isArray'](_0x4009a7))return _0x4009a7[_0x45f66c(0x16e)](_0x3b5b02=>_0x3b5b02!=null&&typeof _0x3b5b02===_0x45f66c(0x113));if(_0x4009a7&&typeof _0x4009a7===_0x45f66c(0x113))return Object['entries'](_0x4009a7)[_0x45f66c(0x16e)](([,_0x2eff5c])=>_0x2eff5c!=null&&typeof _0x2eff5c===_0x45f66c(0x113))[_0x45f66c(0x185)](([_0x359d85,_0x3282b5])=>({..._0x3282b5,'name':_0x3282b5[_0x45f66c(0x196)]??_0x3282b5[_0x45f66c(0x1f5)]??_0x359d85}));return[];}export async function getDatasetDetail(_0x53b485){const _0x4804fa=a218_0x5ab87d,_0x12b14e=/^\d+$/[_0x4804fa(0x140)](_0x53b485)?'id':_0x4804fa(0x11e),_0x1369fa=await apiRequest(_0x4804fa(0x139)+_0x12b14e+'='+_0x53b485);return _0x1369fa['data'];}export async function updateDrivenData(_0xcc9f19){const _0x3c6700=a218_0x5ab87d,_0x44ee13=await apiRequest('/smartapi/dataset/update-driven-data',{'method':_0x3c6700(0x15f),'body':_0xcc9f19});return _0x44ee13['data'];}export async function getDatasetOperations(_0x43abb3){const _0x10b541=a218_0x5ab87d,_0x177f6a=await getDatasetDetail(_0x43abb3),_0x33502c=normalizeDatasetOperations(_0x177f6a[_0x10b541(0x174)])['map'](_0x5eeda1=>({'name':_0x5eeda1['name']||_0x5eeda1[_0x10b541(0x1f5)],'displayName':_0x5eeda1[_0x10b541(0x1d9)]||_0x5eeda1['name'],'type':_0x5eeda1[_0x10b541(0x163)],'method':_0x5eeda1[_0x10b541(0x19a)],'path':_0x5eeda1[_0x10b541(0x1aa)],'enabled':_0x5eeda1[_0x10b541(0x100)]??!![],'requestFields':_0x5eeda1[_0x10b541(0x1c4)],'responseFields':_0x5eeda1[_0x10b541(0x129)]}));return{'dataset':{'id':_0x177f6a['id']??_0x177f6a['modelId'],'name':_0x177f6a[_0x10b541(0x196)],'code':_0x177f6a[_0x10b541(0x11e)]||_0x177f6a[_0x10b541(0x197)],'tableName':_0x177f6a['tableName']||_0x177f6a['dbtableConfig']?.['tableName']},'operations':_0x33502c};}export async function getOperationDetail(_0x3583ed,_0x262970,_0x3abe28){const _0x5b9d2e=a218_0x5ab87d;let _0x5d807c=_0x262970;if(!/^\d+$/[_0x5b9d2e(0x140)](_0x262970)){const _0xca521c=await listDatasets(_0x3583ed,{'code':_0x262970}),_0x2122ab=_0xca521c['find'](_0x262f6b=>_0x262f6b[_0x5b9d2e(0x11e)]===_0x262970||String(_0x262f6b['id'])===_0x262970);if(!_0x2122ab)throw CliErrors[_0x5b9d2e(0x1ab)](_0x5b9d2e(0x1d4)+_0x262970);_0x5d807c=String(_0x2122ab['id']);}const _0x530457=await getDatasetDetail(_0x5d807c),_0x32b300=normalizeDatasetOperations(_0x530457['operations'])[_0x5b9d2e(0x104)](_0x27a4b0=>(_0x27a4b0['name']||_0x27a4b0[_0x5b9d2e(0x1f5)])===_0x3abe28);if(!_0x32b300)throw CliErrors['validation'](_0x5b9d2e(0x11d)+_0x3abe28+_0x5b9d2e(0x1ec)+_0x262970);return{'dataset':{'id':_0x530457['id']??_0x530457[_0x5b9d2e(0x121)],'name':_0x530457[_0x5b9d2e(0x196)],'code':_0x530457[_0x5b9d2e(0x11e)]||_0x530457['modelCode'],'tableName':_0x530457['tableName']||_0x530457[_0x5b9d2e(0x217)]?.['tableName']},'operation':_0x32b300};}export async function getAppInfo(_0x4d4137){const _0x3e1469=a218_0x5ab87d,_0x1d0ff3=await apiRequest(_0x3e1469(0x124)+buildQuery({'appCode':_0x4d4137}));return _0x1d0ff3[_0x3e1469(0x141)];}export async function getI18nInfo(_0x4f2268){const _0x626f55=a218_0x5ab87d,_0x31aa7f=await getAppInfo(_0x4f2268);return{'enableI18n':_0x31aa7f['enableI18n'],..._0x31aa7f[_0x626f55(0x192)]};}export async function createReactPage(_0x5159d7){const _0x23739e=a218_0x5ab87d,_0x4570a3=await apiRequest(_0x23739e(0x215),{'method':'POST','body':{'appCode':_0x5159d7[_0x23739e(0x184)],'pageName':_0x5159d7['pageName'],..._0x5159d7[_0x23739e(0x17c)]!=null?{'parentMenuId':_0x5159d7[_0x23739e(0x17c)]}:{},'createMenu':_0x5159d7['createMenu'],'codeContent':_0x5159d7[_0x23739e(0x193)]}});return{'pageId':_0x4570a3[_0x23739e(0x141)][_0x23739e(0x177)],'pageName':_0x4570a3[_0x23739e(0x141)][_0x23739e(0x1fc)]??_0x5159d7[_0x23739e(0x175)],'appCode':_0x5159d7[_0x23739e(0x184)],'version':_0x4570a3['data'][_0x23739e(0x142)]??0x0,'menuId':_0x4570a3['data'][_0x23739e(0x1ac)]?.['id']??null,'menuPath':_0x4570a3[_0x23739e(0x141)][_0x23739e(0x1ac)]?.[_0x23739e(0x1aa)]??null,'files':_0x4570a3[_0x23739e(0x141)]['files']};}export async function updateReactPageContent(_0x5dd461){const _0x32f74c=a218_0x5ab87d,_0x15dd12=await apiRequest('/smartapi/webcode/page/update/content',{'method':_0x32f74c(0x15f),'body':{'id':_0x5dd461[_0x32f74c(0x177)],'codeContent':_0x5dd461[_0x32f74c(0x165)]}});return{'pageId':_0x5dd461[_0x32f74c(0x177)],'newVersion':_0x15dd12[_0x32f74c(0x141)]};}export async function publishReactPage(_0x374b64){const _0x2c90be=a218_0x5ab87d,_0x33c29e=await apiRequest('/smartapi/webcode/file/publish',{'method':'POST','body':{'id':_0x374b64[_0x2c90be(0x177)],..._0x374b64[_0x2c90be(0x1d5)]?{'remark':_0x374b64[_0x2c90be(0x1d5)]}:{}}});return _0x33c29e[_0x2c90be(0x141)];}export async function getReactPageSource(_0x498633){const _0x20d445=a218_0x5ab87d,_0x4fdc42=await apiRequest('/smartapi/webcode/page/detail'+buildQuery({'id':_0x498633}));if(!_0x4fdc42[_0x20d445(0x141)])throw CliErrors[_0x20d445(0x1ab)](_0x20d445(0x1dd)+_0x498633);return _0x4fdc42[_0x20d445(0x141)];}export async function startGenerateStandardPages(_0x18df2c,_0x283211,_0x2e3ea9){const _0xd24137=a218_0x5ab87d,_0x469442=await apiRequest(_0xd24137(0x1cb)+_0x283211+_0xd24137(0x1fe),{'method':_0xd24137(0x15f),'body':{'appCode':_0x18df2c,..._0x2e3ea9?.['clientOperationId']?{'clientOperationId':_0x2e3ea9[_0xd24137(0x1e0)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x469442[_0xd24137(0x141)];}export async function getGenerateStandardPagesStatus(_0xe026c3,_0x2c9a9b,_0x1d7083){const _0x14f8eb=a218_0x5ab87d,_0x5e5496=new URLSearchParams({'appCode':_0xe026c3});_0x1d7083[_0x14f8eb(0x1f8)]&&_0x5e5496[_0x14f8eb(0x1c7)]('taskId',_0x1d7083[_0x14f8eb(0x1f8)]);_0x1d7083[_0x14f8eb(0x205)]&&_0x5e5496[_0x14f8eb(0x1c7)](_0x14f8eb(0x205),_0x1d7083[_0x14f8eb(0x205)]);_0x1d7083['clientOperationId']&&_0x5e5496[_0x14f8eb(0x1c7)]('clientOperationId',_0x1d7083[_0x14f8eb(0x1e0)]);const _0x2ffef3=await apiRequest(_0x14f8eb(0x1cb)+_0x2c9a9b+'/generate-standard-pages/status?'+_0x5e5496['toString']());return _0x2ffef3[_0x14f8eb(0x141)];}export async function getStandardPageStatus(_0x53be34,_0x248bd2){const _0x2feb66=a218_0x5ab87d,_0x148ab5=await apiRequest(_0x2feb66(0x1cb)+_0x248bd2+'/standard-page-status?appCode='+encodeURIComponent(_0x53be34));return _0x148ab5[_0x2feb66(0x141)];}export async function tryGetStandardPageStatus(_0xef2c23,_0x55ef06){const _0x5ac891=a218_0x5ab87d;try{return await getStandardPageStatus(_0xef2c23,_0x55ef06);}catch(_0x913a10){if(_0x913a10 instanceof CliError&&_0x913a10[_0x5ac891(0x11e)]==='api_error'&&/404|not found|non-json response/i[_0x5ac891(0x140)](_0x913a10[_0x5ac891(0x1bb)]))return null;throw _0x913a10;}}export async function syncStandardPages(_0x3b051a,_0x3f40a5){const _0x4af134=a218_0x5ab87d,_0x2845f4=await apiRequest('/smartapi/lovrabet/dataset/'+_0x3f40a5+_0x4af134(0x17d),{'method':_0x4af134(0x15f),'body':{'appCode':_0x3b051a}});return _0x2845f4[_0x4af134(0x141)];}export async function getPageDetail(_0x4629b9){const _0x2e1ebc=a218_0x5ab87d,_0x50e5dd=await apiRequest(_0x2e1ebc(0x1ed)+_0x4629b9);if(!_0x50e5dd[_0x2e1ebc(0x141)])throw CliErrors['validation'](_0x2e1ebc(0x16b)+_0x4629b9);return _0x50e5dd['data'];}export async function listDeletedPages(_0x23daac,_0x150aff,_0x4fabc0){const _0x2daa5f=a218_0x5ab87d,_0x214de3=new URLSearchParams({'appCode':_0x23daac,'type':_0x150aff,'currentPage':String(_0x4fabc0[_0x2daa5f(0x1bf)]),'pageSize':String(_0x4fabc0[_0x2daa5f(0x16d)])}),_0xa03826=await apiRequest(_0x2daa5f(0x1c9)+_0x214de3[_0x2daa5f(0x176)]());return _0xa03826['data'];}export async function restoreStandardPage(_0x167fea){const _0x588ba1=a218_0x5ab87d;await apiRequest('/smartapi/page/restore',{'method':_0x588ba1(0x15f),'body':{'id':_0x167fea}});}export async function restoreJsxPage(_0x5e587b,_0x50e42e){const _0xdebc58=a218_0x5ab87d,_0x51b1f2=await apiRequest('/smartapi/webcode/page/restore',{'method':_0xdebc58(0x15f),'body':{'appCode':_0x5e587b,'id':_0x50e42e}});return _0x51b1f2[_0xdebc58(0x141)];}export async function updatePage(_0xc3a5d3,_0x4abf53,_0xcf9049,_0x8d0bec){const _0x10235e=a218_0x5ab87d,_0x2820c1=await apiRequest(_0x10235e(0x108),{'method':_0x10235e(0x15f),'body':{'appCode':_0xc3a5d3,'pageId':_0x4abf53,'code':_0xcf9049,'datasetIds':_0x8d0bec}});return _0x2820c1['data'];}export function generateSdkCode(_0x1e3a13,_0x139580,_0x351509){const _0x2020ff=a218_0x5ab87d,_0x395edc=_0x351509?.[_0x2020ff(0x19b)]??!![],_0x2c669c=_0x2020ff(0x20f)+_0x1e3a13[_0x2020ff(0x11e)]?.['replace'](/-/g,'_'),_0xe04632=_0x139580['name']||_0x139580['operationName']||'filter',_0x51c810=[];_0x395edc&&_0x51c810['push'](_0x2020ff(0x1ad),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0x51c810[_0x2020ff(0x1e4)](_0x2020ff(0x1b9)+_0x1e3a13[_0x2020ff(0x196)]+'\x20('+(_0x1e3a13[_0x2020ff(0x161)]||_0x2020ff(0x138))+')');if(_0xe04632===_0x2020ff(0x16e))_0x51c810['push'](_0x2020ff(0x127)+_0x2c669c+'.filter({',_0x2020ff(0x1f0),'\x20\x20pageSize:\x2020,',_0x2020ff(0x1d6),_0x2020ff(0x178));else{if(_0xe04632==='getOne')_0x51c810[_0x2020ff(0x1e4)]('const\x20result\x20=\x20await\x20client.models.'+_0x2c669c+_0x2020ff(0x169));else{if(_0xe04632===_0x2020ff(0x207))_0x51c810['push'](_0x2020ff(0x127)+_0x2c669c+_0x2020ff(0x1bc));else{if(_0xe04632===_0x2020ff(0x155))_0x51c810['push'](_0x2020ff(0x127)+_0x2c669c+_0x2020ff(0x1b0));else _0xe04632==='delete'||_0xe04632===_0x2020ff(0x162)?_0x51c810[_0x2020ff(0x1e4)](_0x2020ff(0x127)+_0x2c669c+_0x2020ff(0x202)):_0x51c810[_0x2020ff(0x1e4)](_0x2020ff(0x127)+_0x2c669c+'.'+_0xe04632+_0x2020ff(0x151));}}}return _0x51c810['join']('\x0a');}export function generateSqlCodeTemplate(_0x5573d4,_0x22ab12){const _0x2e5b70=a218_0x5ab87d,_0x170a7f=_0x22ab12?.[_0x2e5b70(0x180)]??_0x2e5b70(0x10d),_0x2d8620=_0x22ab12?.[_0x2e5b70(0x19b)]??!![],_0x1258e2=[];return _0x1258e2[_0x2e5b70(0x1e4)](_0x2e5b70(0x18a)+_0x5573d4[_0x2e5b70(0x14a)]+'\x20('+_0x5573d4[_0x2e5b70(0x128)]+')'),_0x170a7f===_0x2e5b70(0x10d)?(_0x2d8620&&_0x1258e2[_0x2e5b70(0x1e4)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x1258e2[_0x2e5b70(0x1e4)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x2e5b70(0x189)+_0x5573d4['sqlCode']+'\x27,',_0x2e5b70(0x1bd),_0x2e5b70(0x178),_0x2e5b70(0x188),_0x2e5b70(0x1fb))):_0x1258e2['push'](_0x2e5b70(0x1fd),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x2e5b70(0x1b5),_0x2e5b70(0x1e9)+_0x5573d4[_0x2e5b70(0x128)]+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x2e5b70(0x10a),_0x2e5b70(0x10e),'}'),_0x1258e2['join']('\x0a');}export async function getErConfig(_0x30c5f5,_0x39b9b0){const _0x28cada=a218_0x5ab87d,_0xb9d657=await apiRequest(_0x28cada(0x213),{'method':_0x28cada(0x15f),'body':{'appCode':_0x30c5f5,'dblinkId':_0x39b9b0},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0xb9d657[_0x28cada(0x141)];}export async function getErRelationDetail(_0x3642e7,_0x36f3ed){const _0x4710df=a218_0x5ab87d,_0x5f2c19=new URLSearchParams({'appCode':_0x3642e7,'relationId':String(_0x36f3ed)});try{const _0x4d6771=await apiRequest(_0x4710df(0x214)+_0x5f2c19['toString']());return _0x4d6771[_0x4710df(0x141)]?.[_0x4710df(0x133)]??null;}catch(_0x5b43d6){if(_0x5b43d6 instanceof CliError&&_0x5b43d6['code']==='api_error'&&(_0x5b43d6[_0x4710df(0x147)]?.[_0x4710df(0x1d3)]('DATA_NOT_EXIST')||_0x5b43d6[_0x4710df(0x147)]===_0x4710df(0x181)&&_0x5b43d6[_0x4710df(0x1bb)]===_0x4710df(0x13e)))return null;throw _0x5b43d6;}}export async function createErRelation(_0x394c98){const _0x428253=a218_0x5ab87d,_0x19bc69=await apiRequest(_0x428253(0x11a),{'method':_0x428253(0x15f),'body':_0x394c98,'allowNonJsonSuccess':!![]});return _0x19bc69[_0x428253(0x141)];}export async function updateErRelation(_0x4787d4){const _0x5662da=a218_0x5ab87d,_0xebcdfe=await apiRequest(_0x5662da(0x1a6),{'method':_0x5662da(0x15f),'body':_0x4787d4,'allowNonJsonSuccess':!![]});return _0xebcdfe[_0x5662da(0x141)];}export async function deleteErRelation(_0x35c5bf){const _0x501d27=a218_0x5ab87d,_0xa47e3b=await apiRequest('/smartapi/question/er-config/cli/delete-single',{'method':_0x501d27(0x15f),'body':_0x35c5bf,'allowNonJsonSuccess':!![]});return _0xa47e3b['data'];}export async function updateErBusinessGroup(_0x1e94c3){const _0x3f248b=a218_0x5ab87d,_0x11bce7=await apiRequest(_0x3f248b(0x1f3),{'method':_0x3f248b(0x15f),'body':_0x1e94c3,'allowNonJsonSuccess':!![]});return _0x11bce7['data'];}function buildQuery(_0x438f5a){const _0x3ce8c6=a218_0x5ab87d,_0x45b53d=new URLSearchParams();for(const [_0x4c8729,_0x3e229e]of Object[_0x3ce8c6(0x206)](_0x438f5a)){if(_0x3e229e===undefined||_0x3e229e==='')continue;_0x45b53d[_0x3ce8c6(0x1c7)](_0x4c8729,String(_0x3e229e));}const _0x4e4922=_0x45b53d[_0x3ce8c6(0x176)]();return _0x4e4922?'?'+_0x4e4922:'';}export async function listNotificationChannelConfigs(_0x3c7dfe,_0x5cabce){const _0x3d3ca6=a218_0x5ab87d,_0x4cbea0=await apiRequest(_0x3d3ca6(0x1d8)+buildQuery({'appCode':_0x3c7dfe,'channelType':_0x5cabce}));return Array[_0x3d3ca6(0x1d1)](_0x4cbea0[_0x3d3ca6(0x141)])?_0x4cbea0[_0x3d3ca6(0x141)]:[];}export async function listAppConfigs(_0x1cbef0,_0x1de366){const _0x2c90f2=a218_0x5ab87d,_0x3368be=await apiRequest(_0x2c90f2(0x20a),{'method':'POST','body':{'appCode':_0x1cbef0,..._0x1de366?.[_0x2c90f2(0x15e)]?{'key':_0x1de366[_0x2c90f2(0x15e)]}:{},..._0x1de366?.[_0x2c90f2(0x1c6)]?{'tags':_0x1de366[_0x2c90f2(0x1c6)]}:{}}});return extractAppConfigList(_0x3368be[_0x2c90f2(0x141)]);}export async function getAppConfigByKey(_0x471c66,_0xd263d0){const _0x116546=a218_0x5ab87d,_0x4fb3cd=await apiRequest(_0x116546(0x1ee)+buildQuery({'appCode':_0x471c66,'key':_0xd263d0}));return _0x4fb3cd[_0x116546(0x141)]??null;}export async function createAppConfig(_0x360256){const _0x24a906=a218_0x5ab87d,_0x3fbe14=await apiRequest(_0x24a906(0x1f7),{'method':_0x24a906(0x15f),'body':{'appCode':_0x360256['appCode'],'key':_0x360256['key'],'value':_0x360256[_0x24a906(0x12f)],..._0x360256[_0x24a906(0x1c6)]?{'tags':_0x360256['tags']}:{}}});return _0x3fbe14[_0x24a906(0x141)];}export async function updateAppConfig(_0xe3278c){const _0x4240d5=a218_0x5ab87d;await apiRequest(_0x4240d5(0x167),{'method':_0x4240d5(0x15f),'body':{'id':_0xe3278c['id'],'appCode':_0xe3278c['appCode'],'key':_0xe3278c['key'],'value':_0xe3278c['value'],..._0xe3278c['tags']?{'tags':_0xe3278c[_0x4240d5(0x1c6)]}:{}}});}export async function deleteAppConfig(_0x3e7533){const _0x334466=a218_0x5ab87d;await apiRequest(_0x334466(0x109),{'method':_0x334466(0x15f),'body':_0x3e7533});}function extractAppConfigList(_0x2abf4d){const _0x124c55=a218_0x5ab87d;if(Array['isArray'](_0x2abf4d))return _0x2abf4d;if(_0x2abf4d&&typeof _0x2abf4d===_0x124c55(0x113)&&Array['isArray'](_0x2abf4d[_0x124c55(0x136)]))return _0x2abf4d[_0x124c55(0x136)];return extractList(_0x2abf4d);}export async function listDbLinks(_0x341466,_0x2ffc3a){const _0x2eab42=a218_0x5ab87d,_0x2fd55a=await apiRequest('/smartapi/dblink/getList',{'method':'POST','body':{'appCode':_0x341466,'currentPage':_0x2ffc3a?.[_0x2eab42(0x1bf)]??0x1,'pageSize':_0x2ffc3a?.[_0x2eab42(0x16d)]??0x64}});return{'items':extractList(_0x2fd55a['data']),'paging':extractPaging(_0x2fd55a['data'])};}export async function getDbLinkInfo(_0x15ce7c){const _0x331fdb=a218_0x5ab87d,_0x434bf8=await apiRequest(_0x331fdb(0x203)+buildQuery({'id':_0x15ce7c}));return _0x434bf8[_0x331fdb(0x141)];}export async function createDbLink(_0x3982be){const _0x280330=a218_0x5ab87d,_0x5f5b42=await apiRequest(_0x280330(0x1b3),{'method':_0x280330(0x15f),'body':_0x3982be});return _0x5f5b42[_0x280330(0x141)];}export async function updateDbLink(_0x126231){const _0xd257e8=a218_0x5ab87d,_0x28d6dd=await apiRequest('/smartapi/dblink/update',{'method':_0xd257e8(0x15f),'body':_0x126231});return _0x28d6dd['data'];}export async function deleteDbLink(_0x2192b9){const _0x1271bc=a218_0x5ab87d;await apiRequest(_0x1271bc(0x1a4),{'method':_0x1271bc(0x15f),'body':{'id':_0x2192b9}});}export async function testDbLinkConnect(_0x5e5e56){const _0x2167d=a218_0x5ab87d,_0x38a903=await apiRequest(_0x2167d(0x15c)+buildQuery({'id':_0x5e5e56}));return _0x38a903[_0x2167d(0x141)];}export async function startDbAnalysis(_0x1a06bc,_0x4c7d9b){const _0x577d0d=a218_0x5ab87d,_0x574c7c=await apiRequest(_0x577d0d(0x1a3),{'method':'POST','body':{'dbLinkId':_0x1a06bc,..._0x4c7d9b&&_0x4c7d9b[_0x577d0d(0x1f9)]>0x0?{'tableNames':_0x4c7d9b}:{}}});return _0x574c7c[_0x577d0d(0x141)];}export async function cancelDbAnalysis(_0x927a1a){const _0x414999=a218_0x5ab87d;await apiRequest(_0x414999(0x18e)+buildQuery({'planId':_0x927a1a}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x443404){const _0xf3cc5e=a218_0x5ab87d,_0x44e290=await apiRequest(_0xf3cc5e(0x150)+encodeURIComponent(_0x443404));return _0x44e290['data'];}export async function getDbAllTableList(_0x8ffcfa,_0x323b22){const _0x214d20=a218_0x5ab87d,_0x398583=await apiRequest(_0x214d20(0x216)+buildQuery({'appCode':_0x8ffcfa,'dbLinkId':_0x323b22})),_0x54162b=_0x398583[_0x214d20(0x141)];if(Array['isArray'](_0x54162b))return _0x54162b;return extractList(_0x54162b);}export async function getDbTableDiff(_0x33f9ef,_0x303422,_0xd8e9d6){const _0x865714=a218_0x5ab87d,_0x204b51=await apiRequest(_0x865714(0x120)+buildQuery({'appCode':_0x33f9ef,'dbLinkId':_0x303422,'pageIndex':_0xd8e9d6?.[_0x865714(0x1ae)]??0x1,'pageSize':_0xd8e9d6?.[_0x865714(0x16d)]??0x14,'tableName':_0xd8e9d6?.[_0x865714(0x161)]})),_0x5ba103=_0x204b51[_0x865714(0x141)];return{'totalCount':_0x5ba103?.[_0x865714(0x1b8)]??0x0,'physicalTableCount':_0x5ba103?.['physicalTableCount']??0x0,'datasetTableCount':_0x5ba103?.[_0x865714(0x10f)]??0x0,..._0x5ba103?.['summary']?{'summary':_0x5ba103[_0x865714(0x14e)]}:{},'tableList':Array['isArray'](_0x5ba103?.[_0x865714(0x144)])?_0x5ba103[_0x865714(0x144)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x2c49b2=a218_0x5ab87d,_0x544fcf=await apiRequest(_0x2c49b2(0x157),{'method':_0x2c49b2(0x15f),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x1f509d=extractList(_0x544fcf[_0x2c49b2(0x141)]),_0x39aa2e=extractPaging(_0x544fcf[_0x2c49b2(0x141)]);return _0x39aa2e&&_0x39aa2e['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x2c49b2(0x153)](_0x2c49b2(0x105)+REMOTE_APP_PAGE_SIZE+_0x2c49b2(0x17a)+_0x39aa2e[_0x2c49b2(0x1b8)]+'\x20apps.\x20'+_0x2c49b2(0x16a)),_0x1f509d;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0xa0ab0f,_0x9543ff){const _0x40861c=a218_0x5ab87d,_0x3d9daf=Math[_0x40861c(0x171)](Math[_0x40861c(0x1a5)](_0x9543ff?.[_0x40861c(0x16d)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x1e614b=await apiRequest(_0x40861c(0x18f),{'method':_0x40861c(0x15f),'body':{'appCode':_0xa0ab0f,'currentPage':_0x9543ff?.[_0x40861c(0x1bf)]??0x1,'pageSize':_0x3d9daf}});return{'items':extractList(_0x1e614b['data']),'paging':extractPaging(_0x1e614b[_0x40861c(0x141)])};}function a218_0x2314(_0xfa5ce3,_0x3665b0){_0xfa5ce3=_0xfa5ce3-0x100;const _0x385499=a218_0x3854();let _0x2314ab=_0x385499[_0xfa5ce3];return _0x2314ab;}export async function getAppRole(_0x3dc34f){const _0x1acc5e=a218_0x5ab87d,_0x515636=await apiRequest(_0x1acc5e(0x110)+buildQuery({'id':_0x3dc34f}));return _0x515636[_0x1acc5e(0x141)];}export async function createAppRole(_0x435fd8){const _0x52239c=a218_0x5ab87d,_0x5c1bd6=await apiRequest(_0x52239c(0x1d2),{'method':'POST','body':{'appCode':_0x435fd8[_0x52239c(0x184)],'roleName':_0x435fd8[_0x52239c(0x11f)],'roleType':_0x52239c(0x20c),..._0x435fd8[_0x52239c(0x1d5)]?{'remark':_0x435fd8[_0x52239c(0x1d5)]}:{}}});return _0x5c1bd6[_0x52239c(0x141)];}export async function updateAppRole(_0x554963){const _0x476f1e=a218_0x5ab87d,_0x33e058=await apiRequest(_0x476f1e(0x172),{'method':_0x476f1e(0x15f),'body':{'id':_0x554963['id'],'appCode':_0x554963['appCode'],..._0x554963[_0x476f1e(0x1c0)]?{'roleType':_0x554963[_0x476f1e(0x1c0)]}:{},..._0x554963[_0x476f1e(0x11f)]!==undefined?{'roleName':_0x554963[_0x476f1e(0x11f)]}:{},..._0x554963[_0x476f1e(0x1d5)]!==undefined?{'remark':_0x554963['remark']}:{},..._0x554963[_0x476f1e(0x160)]?{'permits':_0x554963[_0x476f1e(0x160)]}:{}}});return _0x33e058['data'];}export async function deleteAppRole(_0x21cb42){const _0x4546c1=a218_0x5ab87d;await apiRequest('/smartapi/permit/role/delete',{'method':_0x4546c1(0x15f),'body':{'id':_0x21cb42}});}export async function listPermitRoles(_0x270500,_0x5baae3){const _0x18439e=a218_0x5ab87d,_0x13c39d=await apiRequest(_0x18439e(0x18c),{'method':_0x18439e(0x15f),'body':{'appCode':_0x270500,..._0x5baae3?.[_0x18439e(0x1c1)]!==undefined?{'needSelf':_0x5baae3[_0x18439e(0x1c1)]}:{},..._0x5baae3?.[_0x18439e(0x1ca)]!==undefined?{'needPublic':_0x5baae3[_0x18439e(0x1ca)]}:{}}});return extractList(_0x13c39d['data']);}export async function getRoleMenuResources(_0x2e1148,_0x54d18e){const _0x493459=a218_0x5ab87d,_0x123ae7=await apiRequest(_0x493459(0x1af),{'method':_0x493459(0x15f),'body':{'appCode':_0x2e1148,'roleId':_0x54d18e}});return extractList(_0x123ae7[_0x493459(0x141)]);}export async function getRoleApiResources(_0x215b5f,_0x4ba6e1){const _0x24a593=a218_0x5ab87d,_0x1d0b0e=await apiRequest(_0x24a593(0x1f2),{'method':'POST','body':{'appCode':_0x215b5f,'roleId':_0x4ba6e1}});return extractList(_0x1d0b0e[_0x24a593(0x141)]);}export async function listRoleUsers(_0x4e0ab0){const _0x59cb62=a218_0x5ab87d,_0x53e9dc=await apiRequest(_0x59cb62(0x1b4),{'method':_0x59cb62(0x15f),'body':{'appCode':_0x4e0ab0}});return extractList(_0x53e9dc[_0x59cb62(0x141)])['map'](({id:_0x5158da,userList:_0xaac3f1,applyUserList:_0x1f92f4,..._0x1d5aad})=>({..._0x1d5aad,'id':Number(_0x5158da),'userList':_0xaac3f1[_0x59cb62(0x185)](_0x507f72=>({..._0x507f72,'userId':Number(_0x507f72[_0x59cb62(0x1be)])})),..._0x1f92f4?{'applyUserList':_0x1f92f4[_0x59cb62(0x185)](_0x3df6ec=>({..._0x3df6ec,'userId':Number(_0x3df6ec[_0x59cb62(0x1be)])}))}:{}}));}export async function updateRoleUsers(_0x261daf,_0x22ef36){const _0x17964e=a218_0x5ab87d;await apiRequest(_0x17964e(0x182),{'method':_0x17964e(0x15f),'body':{'appCode':_0x261daf,'roleList':_0x22ef36}});}export async function getPagePermit(_0x326372){const _0x33a7d3=a218_0x5ab87d,_0x4a6e65=await apiRequest(_0x33a7d3(0x1df)+buildQuery({'menuId':_0x326372}));return _0x4a6e65[_0x33a7d3(0x141)];}export async function savePagePermit(_0x1d1e24){const _0x597394=a218_0x5ab87d,_0x4aa8d0=await apiRequest('/smartapi/permit/page/save',{'method':_0x597394(0x15f),'body':_0x1d1e24});return _0x4aa8d0['data'];}export async function listCurrentUserTenantMemberships(){const _0x6303b7=a218_0x5ab87d,_0x4f5440=await apiRequest(_0x6303b7(0x20e));return extractList(_0x4f5440[_0x6303b7(0x141)]);}export async function listTenantDirectoryMembers(_0x489e3d){const _0x47a5f9=a218_0x5ab87d,_0x1e1024=await apiRequest('/userTenant/getByTenantCode'+buildQuery({'code':_0x489e3d})),_0x444155=_0x1e1024[_0x47a5f9(0x141)]?.[_0x47a5f9(0x19d)];return Array[_0x47a5f9(0x1d1)](_0x444155)?_0x444155:[];}export async function getTenantMembers(_0x46e86d){const _0x4bc014=a218_0x5ab87d,_0x9acef0=await listTenantDirectoryMembers(_0x46e86d);return _0x9acef0[_0x4bc014(0x16e)](_0x348a0d=>_0x348a0d[_0x4bc014(0x158)]===_0x4bc014(0x112)||_0x348a0d[_0x4bc014(0x158)]===undefined)[_0x4bc014(0x185)](_0x49d4c9=>({'userId':Number(_0x49d4c9[_0x4bc014(0x1be)]??_0x49d4c9['id']),'username':_0x49d4c9[_0x4bc014(0x1db)],'nickname':_0x49d4c9[_0x4bc014(0x218)],'status':_0x49d4c9[_0x4bc014(0x158)],'email':_0x49d4c9[_0x4bc014(0x1f4)],'mobile':_0x49d4c9['mobile'],'avatar':_0x49d4c9['avatar']}))[_0x4bc014(0x16e)](_0x2f025c=>Number[_0x4bc014(0x1c2)](_0x2f025c[_0x4bc014(0x1be)])&&_0x2f025c[_0x4bc014(0x1be)]>0x0);}
|
|
1
|
+
const a218_0x53e292=a218_0x412f;(function(_0x29e8d8,_0xf3cede){const _0x2ad201=a218_0x412f,_0x30a015=_0x29e8d8();while(!![]){try{const _0x4cd81b=parseInt(_0x2ad201(0xad))/0x1+-parseInt(_0x2ad201(0x15e))/0x2+-parseInt(_0x2ad201(0x165))/0x3+-parseInt(_0x2ad201(0xf3))/0x4+-parseInt(_0x2ad201(0x11b))/0x5*(-parseInt(_0x2ad201(0xa6))/0x6)+-parseInt(_0x2ad201(0xc3))/0x7+parseInt(_0x2ad201(0xc1))/0x8;if(_0x4cd81b===_0xf3cede)break;else _0x30a015['push'](_0x30a015['shift']());}catch(_0x4499f0){_0x30a015['push'](_0x30a015['shift']());}}}(a218_0x58dd,0x3ece9));import{readFile}from'node:fs/promises';import{basename}from'node:path';function a218_0x412f(_0x18f47d,_0x1e11cc){_0x18f47d=_0x18f47d-0x7d;const _0x58dd36=a218_0x58dd();let _0x412f27=_0x58dd36[_0x18f47d];return _0x412f27;}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(_0x15a230){_activeCookie=_0x15a230||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x57e40,PLATFORM_TRANSPORT_FAILURE=Symbol(a218_0x53e292(0xf4)),PLATFORM_ERROR_CODE=Symbol(a218_0x53e292(0x81));export function isPlatformTransportFailure(_0x419905){const _0x142238=a218_0x53e292;return Boolean(_0x419905&&typeof _0x419905===_0x142238(0x14a)&&_0x419905[PLATFORM_TRANSPORT_FAILURE]===!![]);}export function getPlatformErrorCode(_0x3045f3){const _0x34abc9=a218_0x53e292;if(!_0x3045f3||typeof _0x3045f3!==_0x34abc9(0x14a))return undefined;const _0x4da797=_0x3045f3[PLATFORM_ERROR_CODE];return typeof _0x4da797===_0x34abc9(0x114)&&_0x4da797?_0x4da797:undefined;}function createPlatformApiError(_0x318331,_0x30863b){const _0x2e812a=a218_0x53e292,_0x5f164a=typeof _0x30863b===_0x2e812a(0x114)?_0x30863b['trim']():typeof _0x30863b==='number'?String(_0x30863b):'',_0x52623b=CliErrors[_0x2e812a(0xed)](_0x318331,_0x5f164a?_0x2e812a(0x118)+_0x5f164a:undefined);return _0x5f164a&&(Object[_0x2e812a(0x96)](_0x52623b,PLATFORM_ERROR_CODE,{'value':_0x5f164a}),Object[_0x2e812a(0x96)](_0x52623b,'data',{'value':{'remoteErrorCode':_0x5f164a},'enumerable':![]})),_0x52623b;}function createFetchFailureError(_0x4ba241,_0x416114){const _0x34a272=a218_0x53e292,_0x386ef5=_0x416114 instanceof Error?_0x416114['message']:String(_0x416114),_0x28db2c=CliErrors[_0x34a272(0xed)]('Request\x20failed:\x20'+_0x4ba241+(_0x386ef5?'\x20('+_0x386ef5+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');return Object['defineProperty'](_0x28db2c,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x28db2c;}function createIndeterminateResponseError(_0x456ea8){const _0x5e42dc=a218_0x53e292,_0x2d6084=CliErrors['apiError'](_0x456ea8+_0x5e42dc(0x160),_0x5e42dc(0x89));return Object[_0x5e42dc(0x96)](_0x2d6084,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x2d6084;}async function apiRequest(_0x3c00eb,_0x16adc3={}){const _0x2eb264=a218_0x53e292,{method:method='GET',body:_0x1bd3bd,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x16adc3,_0x3086d4=useRuntime?getRuntimeDomain():getApiDomain(),_0x575a62=_activeCookie||getCookie(),_0x5c83a8=''+_0x3086d4+_0x3c00eb,_0x2f6002=new AbortController(),_0x1e4af0=setTimeout(()=>_0x2f6002[_0x2eb264(0xc6)](),timeout);try{const _0x49ec69=await fetch(_0x5c83a8,{'method':method,'headers':{'Content-Type':_0x2eb264(0xd9),'Cookie':_0x575a62,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x1bd3bd?JSON[_0x2eb264(0x9d)](_0x1bd3bd):undefined,'signal':_0x2f6002[_0x2eb264(0x123)]});let _0x2c3cb4;try{_0x2c3cb4=await _0x49ec69[_0x2eb264(0xf5)]();}catch(_0xf1a148){if(_0xf1a148 instanceof Error&&_0xf1a148['name']===_0x2eb264(0xfe))throw CliErrors[_0x2eb264(0xed)]('Request\x20timeout:\x20'+_0x5c83a8);if(_0x49ec69['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x2eb264(0xed)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x49ec69[_0x2eb264(0xda)]+')',_0x49ec69[_0x2eb264(0xda)]>=0x190?_0x2eb264(0x15b):undefined);}if(!_0x49ec69['ok']||_0x2c3cb4[_0x2eb264(0xe2)]===![])throw CliErrors[_0x2eb264(0xed)](_0x2c3cb4[_0x2eb264(0x87)]||_0x2c3cb4['message']||'API\x20error:\x20'+_0x49ec69['status'],_0x2c3cb4[_0x2eb264(0x146)]?_0x2eb264(0x118)+_0x2c3cb4[_0x2eb264(0x146)]:undefined);return _0x2c3cb4;}catch(_0xeedf3a){if(_0xeedf3a instanceof CliError)throw _0xeedf3a;if(_0xeedf3a instanceof Error&&_0xeedf3a[_0x2eb264(0xd8)]===_0x2eb264(0xfe))throw CliErrors['apiError'](_0x2eb264(0x107)+_0x5c83a8);throw createFetchFailureError(_0x5c83a8,_0xeedf3a);}finally{clearTimeout(_0x1e4af0);}}async function apiFormRequest(_0x43497f,_0x32c44a,_0x732262={}){const _0x374888=a218_0x53e292,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x732262,_0x35c00a=_activeCookie||getCookie(),_0x100aeb=''+getApiDomain()+_0x43497f,_0x1e093d=new AbortController(),_0x5dc997=setTimeout(()=>_0x1e093d[_0x374888(0xc6)](),timeout);try{const _0x53e942=await fetch(_0x100aeb,{'method':_0x374888(0xb6),'headers':{'Cookie':_0x35c00a,'X-Invoke-Source':_0x374888(0xea)},'body':_0x32c44a,'signal':_0x1e093d['signal']});let _0x1a00b1;try{_0x1a00b1=await _0x53e942[_0x374888(0xf5)]();}catch(_0x535e3d){if(_0x535e3d instanceof Error&&_0x535e3d[_0x374888(0xd8)]===_0x374888(0xfe))throw CliErrors[_0x374888(0xed)]('Request\x20timeout:\x20'+_0x100aeb);throw CliErrors[_0x374888(0xed)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x53e942[_0x374888(0xda)]+')',_0x53e942[_0x374888(0xda)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x53e942['ok']||_0x1a00b1['success']===![])throw CliErrors['apiError'](_0x1a00b1[_0x374888(0x87)]||_0x1a00b1[_0x374888(0x86)]||_0x374888(0xa7)+_0x53e942[_0x374888(0xda)],_0x1a00b1[_0x374888(0x146)]?_0x374888(0x118)+_0x1a00b1[_0x374888(0x146)]:undefined);return _0x1a00b1;}catch(_0x42fb4b){if(_0x42fb4b instanceof CliError)throw _0x42fb4b;if(_0x42fb4b instanceof Error&&_0x42fb4b['name']===_0x374888(0xfe))throw CliErrors[_0x374888(0xed)](_0x374888(0x107)+_0x100aeb);throw createFetchFailureError(_0x100aeb,_0x42fb4b);}finally{clearTimeout(_0x5dc997);}}export async function uploadDevelopmentFile(_0x1cce91,_0x121615){const _0xc57a27=a218_0x53e292,_0x51b4c7=await readFile(_0x121615),_0x1fb01a=new FormData();_0x1fb01a[_0xc57a27(0xab)](_0xc57a27(0x16d),_0x1cce91),_0x1fb01a[_0xc57a27(0xab)](_0xc57a27(0xec),new Blob([new Uint8Array(_0x51b4c7)]),basename(_0x121615));const _0x2aa3a4=await apiFormRequest(_0xc57a27(0xb9),_0x1fb01a);return _0x2aa3a4[_0xc57a27(0xb3)];}export async function queryDevelopmentFileUrl(_0x272075,_0x15d7de={}){const _0x50622d=a218_0x53e292,_0x14709d=await apiRequest(_0x50622d(0x115),{'method':_0x50622d(0xb6),'body':{'filePath':_0x272075,'downloadFlag':_0x15d7de[_0x50622d(0x91)]??![],..._0x15d7de[_0x50622d(0x154)]?{'longTerm':!![]}:{}}});return _0x14709d[_0x50622d(0xb3)];}export async function recognizeDevelopmentOcr(_0x24c5b3,_0x263d98){const _0x275c8e=a218_0x53e292,_0x16132d=new URLSearchParams({'url':_0x263d98[_0x275c8e(0x10e)],'type':_0x263d98[_0x275c8e(0xd6)],'appCode':_0x24c5b3}),_0x4ff69a=await apiRequest(_0x275c8e(0x17c)+_0x16132d[_0x275c8e(0x8a)](),{'method':_0x275c8e(0xd7)});return _0x4ff69a[_0x275c8e(0xb3)];}export const DING_TALK_SANDBOX_BIND_PATH=a218_0x53e292(0x179);export async function bindDingTalkSandboxAccount(_0x3ddf92){const _0x36703f=a218_0x53e292,_0x3a1873=await apiRequest(DING_TALK_SANDBOX_BIND_PATH,{'method':_0x36703f(0xb6),'body':{'dingTalkUserId':_0x3ddf92}});return _0x3a1873[_0x36703f(0xb3)];}function isAuthFailure(_0x2a5388){const _0x28d669=a218_0x53e292,_0xa85bff=_0x2a5388[_0x28d669(0x87)]||_0x2a5388[_0x28d669(0x86)]||_0x2a5388['data']?.[_0x28d669(0x86)]||_0x2a5388[_0x28d669(0x10f)]||_0x2a5388[_0x28d669(0x161)]||'';return _0x2a5388[_0x28d669(0x146)]==='UNAUTHORIZED'||_0x2a5388[_0x28d669(0x8e)]===0x191||_0x2a5388[_0x28d669(0x8e)]===_0x28d669(0xe9)||_0xa85bff[_0x28d669(0xc4)](_0x28d669(0xe9))||_0xa85bff['includes'](_0x28d669(0x166))||_0xa85bff[_0x28d669(0xc4)]('登录')||_0xa85bff[_0x28d669(0xc4)]('认证');}export async function platformFetch(_0x4af237,_0x37396b){const _0x4d6aaa=a218_0x53e292;let _0x3ab0cb;try{_0x3ab0cb=await fetch(_0x4af237,{'method':_0x37396b[_0x4d6aaa(0xac)]??_0x4d6aaa(0xd7),'headers':{'Content-Type':_0x4d6aaa(0xd9),'Cookie':_0x37396b['cookie'],'X-Invoke-Source':_0x4d6aaa(0xea)},..._0x37396b['body']&&{'body':JSON[_0x4d6aaa(0x9d)](_0x37396b['body'])}});}catch(_0x25fec2){throw createFetchFailureError(_0x4af237,_0x25fec2);}let _0xa4f001;try{_0xa4f001=await _0x3ab0cb[_0x4d6aaa(0xf5)]();}catch(_0x25d068){if(!_0x3ab0cb['ok']){if(_0x3ab0cb[_0x4d6aaa(0xda)]===0x191)throw CliErrors[_0x4d6aaa(0x148)]();throw CliErrors[_0x4d6aaa(0xed)](_0x37396b[_0x4d6aaa(0x158)]+_0x4d6aaa(0x11c)+_0x3ab0cb[_0x4d6aaa(0xda)]);}throw createFetchFailureError(_0x4af237,_0x25d068);}if(_0xa4f001===null||typeof _0xa4f001!==_0x4d6aaa(0x14a)||Array['isArray'](_0xa4f001)){if(_0x3ab0cb[_0x4d6aaa(0xda)]===0x191)throw CliErrors[_0x4d6aaa(0x148)]();if(_0x3ab0cb['ok'])throw createIndeterminateResponseError(_0x37396b[_0x4d6aaa(0x158)]);throw CliErrors[_0x4d6aaa(0xed)](_0x37396b[_0x4d6aaa(0x158)]+_0x4d6aaa(0x189)+(!_0x3ab0cb['ok']?_0x4d6aaa(0xe0)+_0x3ab0cb[_0x4d6aaa(0xda)]:'')+_0x4d6aaa(0x82));}const _0xec27e6=typeof _0xa4f001[_0x4d6aaa(0x146)]===_0x4d6aaa(0x114)||typeof _0xa4f001[_0x4d6aaa(0x146)]===_0x4d6aaa(0xc9),_0x2b5319=_0xec27e6?String(_0xa4f001[_0x4d6aaa(0x146)])[_0x4d6aaa(0x155)]():'',_0x39e7d4=_0xa4f001[_0x4d6aaa(0xe2)]===![]||_0xec27e6&&_0x2b5319!==_0x4d6aaa(0x7d);if(!_0x3ab0cb['ok']||_0x39e7d4){if(_0x3ab0cb[_0x4d6aaa(0xda)]===0x191||isAuthFailure(_0xa4f001))throw CliErrors[_0x4d6aaa(0x148)]();throw createPlatformApiError(_0xa4f001[_0x4d6aaa(0x87)]||_0xa4f001[_0x4d6aaa(0x86)]||_0x37396b[_0x4d6aaa(0x158)]+_0x4d6aaa(0x189)+(!_0x3ab0cb['ok']?_0x4d6aaa(0xe0)+_0x3ab0cb[_0x4d6aaa(0xda)]:''),_0xa4f001[_0x4d6aaa(0x146)]??_0xa4f001[_0x4d6aaa(0x8e)]);}if(_0xa4f001[_0x4d6aaa(0xe2)]!==!![]||_0xa4f001[_0x4d6aaa(0x146)]!==_0x4d6aaa(0x7d))throw createIndeterminateResponseError(_0x37396b['label']);return _0xa4f001[_0x4d6aaa(0xb3)];}export async function platformRequest(_0x1bc545,_0x33ac9a){const _0x125faf=a218_0x53e292;if(/^https?:\/\//i[_0x125faf(0x13d)](_0x1bc545))throw CliErrors['validation'](_0x125faf(0x134)+_0x1bc545,'Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.');const _0x268e4=_0x1bc545[_0x125faf(0x18f)]('/')?_0x1bc545:'/'+_0x1bc545;return platformFetch(''+getApiDomain()+_0x268e4,_0x33ac9a);}const MAX_KNOWLEDGE_BASE_PAGE_SIZE=0x64;function parseKnowledgeBaseInteger(_0x15266f,_0x41f9b6){const _0xdccef=a218_0x53e292,_0x489403=typeof _0x15266f===_0xdccef(0xc9)?_0x15266f:typeof _0x15266f===_0xdccef(0x114)&&/^(0|[1-9]\d*)$/[_0xdccef(0x13d)](_0x15266f)?Number(_0x15266f):Number['NaN'],_0x1a80ed=Number[_0xdccef(0x10d)](_0x489403)&&(_0x41f9b6==='id'?_0x489403>0x0:_0x489403>=0x0);if(!_0x1a80ed)throw CliErrors['apiError']('Knowledge-base\x20response\x20contains\x20an\x20invalid\x20'+_0x41f9b6+'.');return _0x489403;}function parseKnowledgeBaseText(_0x3416a7,_0x5aad24){const _0xdc1592=a218_0x53e292;if(typeof _0x3416a7==='string'&&(_0x5aad24===_0xdc1592(0x88)||_0x3416a7['trim']()))return _0x3416a7;throw CliErrors[_0xdc1592(0xed)](_0xdc1592(0x18d)+_0x5aad24+'.');}function parseKnowledgeBaseRecord(_0x335b71){const _0x6680d8=a218_0x53e292;if(!_0x335b71||typeof _0x335b71!==_0x6680d8(0x14a)||Array['isArray'](_0x335b71))throw CliErrors['apiError'](_0x6680d8(0x147));const _0x1a612f=_0x335b71;if(_0x1a612f[_0x6680d8(0x137)]!==_0x6680d8(0x100)&&_0x1a612f[_0x6680d8(0x137)]!=='personal')throw CliErrors[_0x6680d8(0xed)](_0x6680d8(0x13b));const _0x59aa72={'id':parseKnowledgeBaseInteger(_0x1a612f['id'],'id'),'scope':_0x1a612f[_0x6680d8(0x137)],'appCode':parseKnowledgeBaseText(_0x1a612f[_0x6680d8(0x16d)],'appCode'),'title':parseKnowledgeBaseText(_0x1a612f[_0x6680d8(0xcc)],_0x6680d8(0xcc)),'version':parseKnowledgeBaseInteger(_0x1a612f[_0x6680d8(0x172)],_0x6680d8(0x172)),'content':parseKnowledgeBaseText(_0x1a612f[_0x6680d8(0x88)],_0x6680d8(0x88))};return(_0x1a612f[_0x6680d8(0x11a)]===null||typeof _0x1a612f['createTime']==='string'||typeof _0x1a612f[_0x6680d8(0x11a)]===_0x6680d8(0xc9))&&(_0x59aa72[_0x6680d8(0x11a)]=_0x1a612f['createTime']),(_0x1a612f[_0x6680d8(0x102)]===null||typeof _0x1a612f['updateTime']===_0x6680d8(0x114)||typeof _0x1a612f[_0x6680d8(0x102)]===_0x6680d8(0xc9))&&(_0x59aa72[_0x6680d8(0x102)]=_0x1a612f[_0x6680d8(0x102)]),_0x59aa72;}export async function listEnterpriseKnowledgeBases(_0x2f5a74,_0x25908c={}){const _0x5d9bf4=a218_0x53e292,_0x314742=_0x25908c['pageSize']??0x32;if(!Number[_0x5d9bf4(0x10d)](_0x314742)||_0x314742<0x1||_0x314742>MAX_KNOWLEDGE_BASE_PAGE_SIZE)throw CliErrors[_0x5d9bf4(0x117)](_0x5d9bf4(0x16b)+MAX_KNOWLEDGE_BASE_PAGE_SIZE+'.');const _0x50ea70=await platformRequest(_0x5d9bf4(0xbc),{'method':_0x5d9bf4(0xb6),'cookie':_0x2f5a74,'label':_0x5d9bf4(0x144),'body':{'currentPage':_0x25908c['currentPage']??0x1,'pageSize':_0x314742,'scope':_0x5d9bf4(0x100),..._0x25908c[_0x5d9bf4(0x16d)]?{'appCode':_0x25908c[_0x5d9bf4(0x16d)]}:{},..._0x25908c['title']?{'title':_0x25908c[_0x5d9bf4(0xcc)]}:{}}});if(!_0x50ea70||typeof _0x50ea70!==_0x5d9bf4(0x14a)||Array['isArray'](_0x50ea70)||!Array[_0x5d9bf4(0x8f)](_0x50ea70['tableData']))throw CliErrors[_0x5d9bf4(0xed)](_0x5d9bf4(0x8c));const _0x17bcf1=extractPaging(_0x50ea70);if(!_0x17bcf1||!Number['isInteger'](_0x17bcf1[_0x5d9bf4(0xe4)])||!Number[_0x5d9bf4(0xe7)](_0x17bcf1['pageSize'])||!Number['isInteger'](_0x17bcf1[_0x5d9bf4(0xdd)])||_0x17bcf1[_0x5d9bf4(0xe4)]<0x1||_0x17bcf1['pageSize']<0x1||_0x17bcf1[_0x5d9bf4(0x15f)]>MAX_KNOWLEDGE_BASE_PAGE_SIZE||_0x17bcf1['totalCount']<0x0)throw CliErrors[_0x5d9bf4(0xed)](_0x5d9bf4(0x16f));return{'items':extractList(_0x50ea70)[_0x5d9bf4(0x12e)](parseKnowledgeBaseRecord),'paging':_0x17bcf1};}export async function getEnterpriseKnowledgeBase(_0x359bde,_0x557919){const _0x5e174=a218_0x53e292,_0x38378d=await platformRequest(_0x5e174(0x170)+buildQuery({'id':_0x557919}),{'cookie':_0x359bde,'label':_0x5e174(0x12a)});return parseKnowledgeBaseRecord(_0x38378d);}export async function createEnterpriseKnowledgeBase(_0x190389,_0x59cd50){const _0x3e6922=a218_0x53e292,_0x246079=await platformRequest(_0x3e6922(0x169),{'method':_0x3e6922(0xb6),'cookie':_0x190389,'label':_0x3e6922(0xef),'body':{'scope':'company',..._0x59cd50}});return parseKnowledgeBaseRecord(_0x246079);}export async function updateEnterpriseKnowledgeBase(_0x21a855,_0x8df554){const _0x7868d5=a218_0x53e292;if(_0x8df554['title']===undefined&&_0x8df554[_0x7868d5(0x88)]===undefined)throw CliErrors[_0x7868d5(0x117)](_0x7868d5(0x110));const _0x2a915c=await platformRequest(_0x7868d5(0x9b),{'method':'POST','cookie':_0x21a855,'label':'Update\x20enterprise\x20knowledge\x20base','body':{'id':_0x8df554['id'],..._0x8df554[_0x7868d5(0xcc)]!==undefined?{'title':_0x8df554[_0x7868d5(0xcc)]}:{},..._0x8df554[_0x7868d5(0x88)]!==undefined?{'content':_0x8df554[_0x7868d5(0x88)]}:{}}});return parseKnowledgeBaseRecord(_0x2a915c);}export async function deleteEnterpriseKnowledgeBase(_0x435e25,_0x4f538c){const _0x59657b=a218_0x53e292;await platformRequest(_0x59657b(0xbf),{'method':_0x59657b(0xb6),'cookie':_0x435e25,'label':_0x59657b(0xb4),'body':{'id':_0x4f538c}});}function cleanNewlines(_0xa1cf24){const _0x3b4e5a=a218_0x53e292;return _0xa1cf24[_0x3b4e5a(0x17e)](/[\r\n]+/g,'\x20')[_0x3b4e5a(0x155)]();}function cleanDatasetName(_0x240064){const _0x11e2eb=a218_0x53e292;if(!_0x240064[_0x11e2eb(0xd8)])return _0x240064;return{..._0x240064,'name':cleanNewlines(_0x240064[_0x11e2eb(0xd8)])};}export async function fetchModelList(_0x1bb17,_0x38f1c9){const _0xef1a49=a218_0x53e292,_0x5478ac=getEnv(),_0x4a1f52=new URLSearchParams({'appcode':_0x1bb17,'otype':_0xef1a49(0xd3)}),_0x432b29=_0xef1a49(0x13a)+_0x4a1f52[_0xef1a49(0x8a)]();logger[_0xef1a49(0xaf)](_0xef1a49(0x92),_0xef1a49(0x14d)+_0x5478ac+')',{'apiPath':_0x432b29});const _0x5551eb=await platformRequest(_0x432b29,{'cookie':_0x38f1c9,'label':_0xef1a49(0x85)}),_0x45342e=(_0x5551eb[_0xef1a49(0x8b)]??[])['map'](cleanDatasetName);return{'configArray':_0x45342e,'count':_0x45342e[_0xef1a49(0x128)]};}export async function fetchDatasetDoc(_0x2180fa){const _0x21c34c=a218_0x53e292,{appCode:_0x51ba79,cookie:_0x148341,datasetCode:_0x9bcb7f,datasetId:_0x3132d8,extraParams:_0x3ed328}=_0x2180fa,_0x22a6dd=await platformRequest(_0x21c34c(0x174),{'method':_0x21c34c(0xb6),'body':{'appCode':_0x51ba79,'datasetCode':_0x9bcb7f,'datasetId':_0x3132d8,..._0x3ed328||{}},'cookie':_0x148341,'label':_0x21c34c(0x90)+_0x9bcb7f+')'});if(!_0x22a6dd||typeof _0x22a6dd[_0x21c34c(0x12f)]!==_0x21c34c(0x114))throw new Error(_0x21c34c(0x139)+_0x9bcb7f+'):\x20missing\x20data.markdown\x20field');return _0x22a6dd[_0x21c34c(0x12f)];}export async function getMenuTree(_0x334989,_0x5665de){const _0x13abce=a218_0x53e292,_0x3d96d5=new URLSearchParams({'appCode':_0x334989});return platformRequest(_0x13abce(0x7f)+_0x3d96d5['toString'](),{'cookie':_0x5665de,'label':'Fetch\x20menu\x20list'});}export async function createMenuRecord(_0x2f994e,_0x53df84,_0x164b88){const _0x4989ce=a218_0x53e292;return platformRequest('/smartapi/menu/create',{'method':_0x4989ce(0xb6),'body':_0x2f994e,'cookie':_0x53df84,'label':_0x164b88});}export async function updateMenuRecord(_0x4254b9,_0x36311c,_0x21b835){const _0x1739ef=a218_0x53e292;return platformRequest(_0x1739ef(0x178),{'method':_0x1739ef(0xb6),'body':_0x4254b9,'cookie':_0x36311c,'label':_0x21b835});}export async function deleteMenuRecord(_0x1f74d6,_0x480675,_0x183636){const _0x46d1c2=a218_0x53e292;return platformRequest(_0x46d1c2(0xe8),{'method':_0x46d1c2(0xb6),'body':{'id':_0x1f74d6},'cookie':_0x480675,'label':_0x183636});}export async function batchDeleteMenuRecords(_0x5ce3f5,_0x2b1e4c,_0x4e5e21){const _0x8781da=a218_0x53e292;return platformRequest(_0x8781da(0x101),{'method':_0x8781da(0xb6),'body':{'idList':_0x5ce3f5},'cookie':_0x2b1e4c,'label':_0x4e5e21});}export async function startMenuRegroup(_0x7f5968,_0x47fce3,_0x4fc01f){const _0x53240c=a218_0x53e292;return platformRequest(_0x53240c(0xe1),{'method':'POST','body':_0x7f5968,'cookie':_0x47fce3,'label':_0x4fc01f});}export async function getAsyncTaskStatus(_0xb125f1,_0x1a72cf,_0x158c56){const _0x5c1659=a218_0x53e292,_0x1965fa=new URLSearchParams({'appCode':_0x1a72cf});return platformRequest(_0x5c1659(0x18e)+encodeURIComponent(_0xb125f1)+'?'+_0x1965fa[_0x5c1659(0x8a)](),{'cookie':_0x158c56,'label':'Fetch\x20async\x20task\x20'+_0xb125f1});}export async function listBffScripts(_0x15078a,_0x3d24bc,_0x274519){const _0x5877e0=a218_0x53e292;let _0x1a3bfd='/api/management/library/scripts/list?appCode='+_0x15078a;if(_0x3d24bc)_0x1a3bfd+='&type='+_0x3d24bc;const _0x3faeb0=await apiRequest(_0x1a3bfd);let _0x4492c7=extractList(_0x3faeb0[_0x5877e0(0xb3)]);if(_0x274519?.[_0x5877e0(0xbd)]){const _0x473555=_0x274519[_0x5877e0(0xbd)][_0x5877e0(0xa5)]();_0x4492c7=_0x4492c7[_0x5877e0(0xf9)](_0x2b207f=>_0x2b207f[_0x5877e0(0x10c)]?.[_0x5877e0(0xa5)]()[_0x5877e0(0xc4)](_0x473555)||_0x2b207f['description']?.['toLowerCase']()[_0x5877e0(0xc4)](_0x473555));}return _0x4492c7;}export async function getBffScriptInfo(_0x518e22){const _0x3a3b48=a218_0x53e292,_0x2b16df=await apiRequest('/api/management/library/scripts/info?id='+_0x518e22);if(!_0x2b16df[_0x3a3b48(0xb3)])throw CliErrors['validation'](_0x3a3b48(0xfa)+_0x518e22);return _0x2b16df[_0x3a3b48(0xb3)];}export async function saveBffScript(_0x109c0b){const _0xfdc3b1=a218_0x53e292,_0x1d86f1=await apiRequest(_0xfdc3b1(0x11d),{'method':_0xfdc3b1(0xb6),'body':_0x109c0b}),{id:_0x498cc7,entity:_0x526e97}=normalizeEntityWithIdResponse(_0x1d86f1[_0xfdc3b1(0xb3)]);if(_0x498cc7!==undefined){const _0x306d45=typeof _0x526e97[_0xfdc3b1(0x10c)]===_0xfdc3b1(0x114)||typeof _0x526e97[_0xfdc3b1(0x136)]===_0xfdc3b1(0x114)?_0x526e97:undefined;return{'id':_0x498cc7,'script':_0x306d45};}throw CliErrors[_0xfdc3b1(0xed)](_0xfdc3b1(0x152));}export async function deleteBffScript(_0x5ad6bc){await apiRequest('/api/management/library/scripts/delete',{'method':'POST','body':{'id':_0x5ad6bc}});}export async function getBffScriptStatistics(_0x2b4ff2){const _0x382b85=a218_0x53e292,_0x319614=await apiRequest(_0x382b85(0x83)+_0x2b4ff2);return extractList(_0x319614[_0x382b85(0xb3)]);}export async function clearBffScriptCache(){const _0x17d1f7=a218_0x53e292,_0x167c62=await apiRequest(_0x17d1f7(0x15a),{'method':'POST','useRuntime':!![]});return typeof _0x167c62[_0x17d1f7(0xb3)]===_0x17d1f7(0x114)?_0x167c62['data']:'';}export async function listBffDatasetOperations(_0x39b261,_0x1051b7){const _0x3ced8f=a218_0x53e292,_0x54b9d1=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x3ced8f(0xb6),'body':{'appCode':_0x39b261,'datasetId':_0x1051b7}});return _0x54b9d1[_0x3ced8f(0xb3)];}export async function listSqlQueries(_0xfd9c2b,_0x446384){const _0x1c2f81=a218_0x53e292,_0x4a4fce=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0x1c2f81(0xb6),'body':{'appCode':_0xfd9c2b,'currentPage':_0x446384?.['currentPage']??0x1,'pageSize':_0x446384?.[_0x1c2f81(0x15f)]??0x32,'sqlCode':_0x446384?.[_0x1c2f81(0xb2)],'sqlName':_0x446384?.[_0x1c2f81(0x151)]}});return _0x4a4fce[_0x1c2f81(0xb3)];}export async function getSqlQueryInfo(_0x3184e8,_0x449a13){const _0x59f55c=a218_0x53e292,_0x1728b6=await listSqlQueries(_0x3184e8,{'sqlCode':_0x449a13}),_0xbc0050=_0x1728b6[_0x59f55c(0x171)]?.[0x0];if(!_0xbc0050)throw CliErrors['validation'](_0x59f55c(0x108)+_0x449a13);return _0xbc0050;}export async function getSqlQueryDetail(_0x481ef4){const _0xcb6343=a218_0x53e292,_0x1f01d9=await apiRequest(_0xcb6343(0x121)+(_0xcb6343(0x18a)+encodeURIComponent(_0x481ef4)));if(!_0x1f01d9[_0xcb6343(0xb3)])throw CliErrors['validation']('SQL\x20query\x20not\x20found:\x20'+_0x481ef4);return _0x1f01d9['data'];}export async function getSqlQueryDetailById(_0x282b0c){const _0x5a4a1f=a218_0x53e292,_0xbdb754=await apiRequest(_0x5a4a1f(0x180)+_0x282b0c);if(!_0xbdb754[_0x5a4a1f(0xb3)])throw CliErrors[_0x5a4a1f(0x117)](_0x5a4a1f(0x7e)+_0x282b0c);return _0xbdb754[_0x5a4a1f(0xb3)];}export async function createSqlQuery(_0x5a9035){const _0x43bb65=a218_0x53e292,_0x2d46bb=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':'POST','body':_0x5a9035}),{id:_0xbdc602,entity:_0x5f055c}=normalizeEntityWithIdResponse(_0x2d46bb['data']);if(!(_0x43bb65(0xb2)in _0x5f055c)&&_0xbdc602)return getSqlQueryDetailById(_0xbdc602);return normalizeSqlQueryEntity(_0x5f055c);}export async function updateSqlQuery(_0x2ff0ec){const _0x255394=a218_0x53e292,_0x58c6b7=await apiRequest(_0x255394(0x13c),{'method':_0x255394(0xb6),'body':_0x2ff0ec}),{id:_0x310949,entity:_0x1fb923}=normalizeEntityWithIdResponse(_0x58c6b7['data']);if(!(_0x255394(0xb2)in _0x1fb923)){if(_0x2ff0ec['sqlCode'])return getSqlQueryDetail(_0x2ff0ec[_0x255394(0xb2)]);if(_0x310949)return getSqlQueryDetailById(_0x310949);}return normalizeSqlQueryEntity(_0x1fb923);}export async function deleteSqlQuery(_0x2ea998){const _0x458db9=a218_0x53e292;await apiRequest(_0x458db9(0x14e),{'method':'POST','body':_0x2ea998});}export async function saveSqlQuery(_0x5b0bb1){const _0x3e2e1d=a218_0x53e292,_0x131cc2=await apiRequest(_0x3e2e1d(0x131),{'method':_0x3e2e1d(0xb6),'body':_0x5b0bb1});return _0x131cc2[_0x3e2e1d(0xb3)];}function normalizeSqlQueryEntity(_0x16dd55){const _0x537bb9=a218_0x53e292;return{..._0x16dd55,'id':Number(_0x16dd55['id']),'dbId':_0x16dd55[_0x537bb9(0x18b)]==null?undefined:Number(_0x16dd55['dbId']),'version':_0x16dd55[_0x537bb9(0x172)]==null?undefined:Number(_0x16dd55[_0x537bb9(0x172)])};}export async function executeSql(_0x23f4ad,_0x27067f,_0x77f010){const _0x56ef64=a218_0x53e292,_0x2f8a5d=await apiRequest('/api/custom/executeSql',{'method':_0x56ef64(0xb6),'body':{'appCode':_0x23f4ad,'sqlCode':_0x27067f,..._0x77f010&&{'params':_0x77f010}},'useRuntime':!![]});return _0x2f8a5d[_0x56ef64(0xb3)];}export async function executeDatasetDataOperation(_0x4ead75,_0x1fecfe,_0x342097,_0x255537={}){const _0x44ed1a=a218_0x53e292;try{const _0x46bade=await apiRequest(_0x44ed1a(0x113)+_0x4ead75+'/'+_0x1fecfe+'/'+_0x342097,{'method':_0x44ed1a(0xb6),'body':_0x255537,'useRuntime':!![]});return _0x46bade[_0x44ed1a(0xb3)];}catch(_0x3b09c4){if(_0x342097===_0x44ed1a(0x167)&&_0x3b09c4 instanceof CliError&&_0x3b09c4[_0x44ed1a(0x8e)]===_0x44ed1a(0xa2)&&_0x255537['id']!==undefined&&_0x255537['id']!==null&&_0x255537['id']!==''){const _0x5a1007=await apiRequest('/api/'+_0x4ead75+'/'+_0x1fecfe+_0x44ed1a(0xa8),{'method':_0x44ed1a(0xb6),'body':{'where':{'id':{'$eq':_0x255537['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x3e98e1=Array[_0x44ed1a(0x8f)](_0x5a1007['data']?.[_0x44ed1a(0x171)])?_0x5a1007[_0x44ed1a(0xb3)][_0x44ed1a(0x171)]:[];return _0x3e98e1[0x0]??null;}throw _0x3b09c4;}}export async function listDatasets(_0x529372,_0x1b140b){const _0x3643ea=a218_0x53e292,_0x38be84={'appCode':_0x529372,'deleted':_0x1b140b?.[_0x3643ea(0xe5)]??![]};if(_0x1b140b?.[_0x3643ea(0x8e)])_0x38be84[_0x3643ea(0x8e)]=_0x1b140b['code'];if(_0x1b140b?.[_0x3643ea(0xd8)])_0x38be84[_0x3643ea(0xd8)]=_0x1b140b[_0x3643ea(0xd8)];const _0x209c6d=await apiRequest(_0x3643ea(0x14c),{'method':_0x3643ea(0xb6),'body':_0x38be84});return extractList(_0x209c6d[_0x3643ea(0xb3)]);}export async function deleteDataset(_0x3c9d58,_0x35aadb){const _0x18eb66=a218_0x53e292;await apiRequest(_0x18eb66(0xaa),{'method':'POST','body':{'appCode':_0x3c9d58,'datasetId':_0x35aadb}});}export async function restoreDataset(_0x4a2265,_0x47e255){await apiRequest('/smartapi/dataset/restore-dataset',{'method':'POST','body':{'appCode':_0x4a2265,'datasetId':_0x47e255}});}export async function previewTextGeneratedDataset(_0x2acc70,_0xdf6568){const _0x31b2bf=a218_0x53e292,_0x16cf7f=await apiRequest(_0x31b2bf(0xba),{'method':'POST','body':{'appCode':_0x2acc70,'datasetName':_0xdf6568['datasetName'],'requirementDescription':_0xdf6568[_0x31b2bf(0xde)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x16cf7f['data'];}export async function startTextGeneratedDataset(_0xcbb7a8,_0x35d217,_0x1bc942){const _0x23c353=a218_0x53e292,_0xd5d697=await apiRequest(_0x23c353(0xc8),{'method':_0x23c353(0xb6),'body':{'appCode':_0xcbb7a8,..._0x1bc942?.[_0x23c353(0x120)]?{'clientOperationId':_0x1bc942[_0x23c353(0x120)]}:{},'design':_0x35d217},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0xd5d697[_0x23c353(0xb3)];}export async function getTextGeneratedDatasetStatus(_0x376661,_0x3a0954){const _0x2e2bf6=a218_0x53e292,_0x43bbd8=new URLSearchParams({'appCode':_0x376661});if(_0x3a0954[_0x2e2bf6(0x14f)])_0x43bbd8['set'](_0x2e2bf6(0x185),_0x3a0954['taskId']);else{if(_0x3a0954[_0x2e2bf6(0x185)])_0x43bbd8[_0x2e2bf6(0x106)](_0x2e2bf6(0x185),_0x3a0954[_0x2e2bf6(0x185)]);else _0x3a0954[_0x2e2bf6(0x120)]&&_0x43bbd8[_0x2e2bf6(0x106)](_0x2e2bf6(0x120),_0x3a0954[_0x2e2bf6(0x120)]);}const _0x26c9f2=await apiRequest(_0x2e2bf6(0xf7)+_0x43bbd8[_0x2e2bf6(0x8a)]());return _0x26c9f2['data'];}export async function searchDatasets(_0xd5af1c,_0x531d3e){const _0x33bb42=a218_0x53e292,_0x36d3dc=await listDatasets(_0xd5af1c,{'name':_0x531d3e}),_0x171ba0=_0x531d3e[_0x33bb42(0xa5)](),_0x3e123a=new Set(_0x36d3dc[_0x33bb42(0x12e)](_0x4e1d48=>_0x4e1d48['id'])),_0x5a41c0=_0x36d3dc[_0x33bb42(0xf9)](_0x3ec854=>_0x3ec854[_0x33bb42(0xdb)]?.[_0x33bb42(0x95)]?.[_0x33bb42(0xa5)]()[_0x33bb42(0xc4)](_0x171ba0)||_0x3ec854['description']?.[_0x33bb42(0xa5)]()[_0x33bb42(0xc4)](_0x171ba0)),_0x262bf0=await listDatasets(_0xd5af1c,{'code':_0x531d3e});for(const _0x263436 of _0x262bf0){!_0x3e123a[_0x33bb42(0x163)](_0x263436['id'])&&(_0x36d3dc['push'](_0x263436),_0x3e123a[_0x33bb42(0xd0)](_0x263436['id']));}return _0x36d3dc;}export function normalizeDatasetOperations(_0x33eab3){const _0x3c600e=a218_0x53e292;if(Array[_0x3c600e(0x8f)](_0x33eab3))return _0x33eab3[_0x3c600e(0xf9)](_0x30615d=>_0x30615d!=null&&typeof _0x30615d===_0x3c600e(0x14a));if(_0x33eab3&&typeof _0x33eab3==='object')return Object[_0x3c600e(0x16a)](_0x33eab3)[_0x3c600e(0xf9)](([,_0x196b6b])=>_0x196b6b!=null&&typeof _0x196b6b===_0x3c600e(0x14a))[_0x3c600e(0x12e)](([_0x3d5465,_0x34cbcd])=>({..._0x34cbcd,'name':_0x34cbcd[_0x3c600e(0xd8)]??_0x34cbcd['operationName']??_0x3d5465}));return[];}export async function getDatasetDetail(_0x5467e4){const _0x31eb85=a218_0x53e292,_0x16c782=/^\d+$/[_0x31eb85(0x13d)](_0x5467e4)?'id':_0x31eb85(0x8e),_0x5d0490=await apiRequest(_0x31eb85(0x11e)+_0x16c782+'='+_0x5467e4);return _0x5d0490[_0x31eb85(0xb3)];}export async function updateDrivenData(_0xd5be81){const _0x1862e0=a218_0x53e292,_0x2cd1c6=await apiRequest('/smartapi/dataset/update-driven-data',{'method':_0x1862e0(0xb6),'body':_0xd5be81});return _0x2cd1c6[_0x1862e0(0xb3)];}export async function getDatasetOperations(_0x2b86d4){const _0x2e2a1f=a218_0x53e292,_0x2db303=await getDatasetDetail(_0x2b86d4),_0x1fd45e=normalizeDatasetOperations(_0x2db303[_0x2e2a1f(0x17f)])[_0x2e2a1f(0x12e)](_0x54acb0=>({'name':_0x54acb0['name']||_0x54acb0[_0x2e2a1f(0x97)],'displayName':_0x54acb0[_0x2e2a1f(0x159)]||_0x54acb0['name'],'type':_0x54acb0[_0x2e2a1f(0xd6)],'method':_0x54acb0['method'],'path':_0x54acb0['path'],'enabled':_0x54acb0['enabled']??!![],'requestFields':_0x54acb0[_0x2e2a1f(0xdc)],'responseFields':_0x54acb0[_0x2e2a1f(0xee)]}));return{'dataset':{'id':_0x2db303['id']??_0x2db303[_0x2e2a1f(0x186)],'name':_0x2db303[_0x2e2a1f(0xd8)],'code':_0x2db303[_0x2e2a1f(0x8e)]||_0x2db303['modelCode'],'tableName':_0x2db303['tableName']||_0x2db303[_0x2e2a1f(0xdb)]?.[_0x2e2a1f(0x95)]},'operations':_0x1fd45e};}export async function getOperationDetail(_0x12c0fa,_0x5038b0,_0x282cd3){const _0x29b1f7=a218_0x53e292;let _0x2ff4f6=_0x5038b0;if(!/^\d+$/[_0x29b1f7(0x13d)](_0x5038b0)){const _0xe27ece=await listDatasets(_0x12c0fa,{'code':_0x5038b0}),_0x2c6177=_0xe27ece[_0x29b1f7(0xcf)](_0x62e4be=>_0x62e4be[_0x29b1f7(0x8e)]===_0x5038b0||String(_0x62e4be['id'])===_0x5038b0);if(!_0x2c6177)throw CliErrors[_0x29b1f7(0x117)](_0x29b1f7(0x130)+_0x5038b0);_0x2ff4f6=String(_0x2c6177['id']);}const _0x59470f=await getDatasetDetail(_0x2ff4f6),_0x7698fb=normalizeDatasetOperations(_0x59470f[_0x29b1f7(0x17f)])[_0x29b1f7(0xcf)](_0x1c17b2=>(_0x1c17b2['name']||_0x1c17b2[_0x29b1f7(0x97)])===_0x282cd3);if(!_0x7698fb)throw CliErrors[_0x29b1f7(0x117)](_0x29b1f7(0x119)+_0x282cd3+_0x29b1f7(0x105)+_0x5038b0);return{'dataset':{'id':_0x59470f['id']??_0x59470f['modelId'],'name':_0x59470f[_0x29b1f7(0xd8)],'code':_0x59470f[_0x29b1f7(0x8e)]||_0x59470f[_0x29b1f7(0x190)],'tableName':_0x59470f[_0x29b1f7(0x95)]||_0x59470f[_0x29b1f7(0xdb)]?.['tableName']},'operation':_0x7698fb};}export async function getAppInfo(_0x1c35b2){const _0x3e5fd7=a218_0x53e292,_0x583e81=await apiRequest(_0x3e5fd7(0x12d)+buildQuery({'appCode':_0x1c35b2}));return _0x583e81['data'];}export async function getI18nInfo(_0x317dbf){const _0x1fe1f7=a218_0x53e292,_0x5e12a4=await getAppInfo(_0x317dbf);return{'enableI18n':_0x5e12a4[_0x1fe1f7(0x173)],..._0x5e12a4[_0x1fe1f7(0xb8)]};}export async function createReactPage(_0x585a21){const _0x4d8ee0=a218_0x53e292,_0x32fd55=await apiRequest(_0x4d8ee0(0x9f),{'method':_0x4d8ee0(0xb6),'body':{'appCode':_0x585a21[_0x4d8ee0(0x16d)],'pageName':_0x585a21[_0x4d8ee0(0xa9)],..._0x585a21[_0x4d8ee0(0xa4)]!=null?{'parentMenuId':_0x585a21[_0x4d8ee0(0xa4)]}:{},'createMenu':_0x585a21['createMenu'],'codeContent':_0x585a21[_0x4d8ee0(0xf8)]}});return{'pageId':_0x32fd55['data'][_0x4d8ee0(0xe3)],'pageName':_0x32fd55['data'][_0x4d8ee0(0x132)]??_0x585a21[_0x4d8ee0(0xa9)],'appCode':_0x585a21[_0x4d8ee0(0x16d)],'version':_0x32fd55[_0x4d8ee0(0xb3)]['draftVersion']??0x0,'menuId':_0x32fd55[_0x4d8ee0(0xb3)][_0x4d8ee0(0x168)]?.['id']??null,'menuPath':_0x32fd55[_0x4d8ee0(0xb3)][_0x4d8ee0(0x168)]?.[_0x4d8ee0(0x157)]??null,'files':_0x32fd55[_0x4d8ee0(0xb3)][_0x4d8ee0(0xf8)]};}export async function updateReactPageContent(_0x1e6db7){const _0x721866=a218_0x53e292,_0x32b9ad=await apiRequest('/smartapi/webcode/page/update/content',{'method':_0x721866(0xb6),'body':{'id':_0x1e6db7[_0x721866(0xe3)],'codeContent':_0x1e6db7[_0x721866(0xeb)]}});return{'pageId':_0x1e6db7['pageId'],'newVersion':_0x32b9ad[_0x721866(0xb3)]};}export async function publishReactPage(_0x5fed1f){const _0x27e58a=a218_0x53e292,_0x5e85d9=await apiRequest('/smartapi/webcode/file/publish',{'method':_0x27e58a(0xb6),'body':{'id':_0x5fed1f[_0x27e58a(0xe3)],..._0x5fed1f['remark']?{'remark':_0x5fed1f[_0x27e58a(0x80)]}:{}}});return _0x5e85d9[_0x27e58a(0xb3)];}export async function getReactPageSource(_0xaa7c07){const _0x4848c0=a218_0x53e292,_0x372d8f=await apiRequest(_0x4848c0(0x149)+buildQuery({'id':_0xaa7c07}));if(!_0x372d8f['data'])throw CliErrors[_0x4848c0(0x117)](_0x4848c0(0x12b)+_0xaa7c07);return _0x372d8f[_0x4848c0(0xb3)];}export async function startGenerateStandardPages(_0x5096ec,_0x1d2c5a,_0x572d51){const _0x352a62=a218_0x53e292,_0x5953ab=await apiRequest('/smartapi/lovrabet/dataset/'+_0x1d2c5a+_0x352a62(0xb1),{'method':_0x352a62(0xb6),'body':{'appCode':_0x5096ec,..._0x572d51?.[_0x352a62(0x120)]?{'clientOperationId':_0x572d51['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5953ab[_0x352a62(0xb3)];}export async function getGenerateStandardPagesStatus(_0x4001d7,_0x4053a8,_0x38b6b4){const _0x28e8f6=a218_0x53e292,_0x411c72=new URLSearchParams({'appCode':_0x4001d7});_0x38b6b4['taskId']&&_0x411c72[_0x28e8f6(0x106)](_0x28e8f6(0x14f),_0x38b6b4[_0x28e8f6(0x14f)]);_0x38b6b4[_0x28e8f6(0x185)]&&_0x411c72[_0x28e8f6(0x106)](_0x28e8f6(0x185),_0x38b6b4[_0x28e8f6(0x185)]);_0x38b6b4[_0x28e8f6(0x120)]&&_0x411c72[_0x28e8f6(0x106)]('clientOperationId',_0x38b6b4[_0x28e8f6(0x120)]);const _0x440173=await apiRequest(_0x28e8f6(0x15c)+_0x4053a8+_0x28e8f6(0xcd)+_0x411c72[_0x28e8f6(0x8a)]());return _0x440173[_0x28e8f6(0xb3)];}export async function getStandardPageStatus(_0x50b3f8,_0x21ed8d){const _0x1f6d65=a218_0x53e292,_0x44d2ba=await apiRequest(_0x1f6d65(0x15c)+_0x21ed8d+'/standard-page-status?appCode='+encodeURIComponent(_0x50b3f8));return _0x44d2ba[_0x1f6d65(0xb3)];}export async function tryGetStandardPageStatus(_0x4d3a3d,_0x128ecf){const _0x59aa38=a218_0x53e292;try{return await getStandardPageStatus(_0x4d3a3d,_0x128ecf);}catch(_0x4aced2){if(_0x4aced2 instanceof CliError&&_0x4aced2[_0x59aa38(0x8e)]===_0x59aa38(0xa2)&&/404|not found|non-json response/i[_0x59aa38(0x13d)](_0x4aced2[_0x59aa38(0x86)]))return null;throw _0x4aced2;}}export async function syncStandardPages(_0x348cb4,_0x368d65){const _0x1dccb1=a218_0x53e292,_0x77a9b1=await apiRequest(_0x1dccb1(0x15c)+_0x368d65+_0x1dccb1(0xfd),{'method':_0x1dccb1(0xb6),'body':{'appCode':_0x348cb4}});return _0x77a9b1[_0x1dccb1(0xb3)];}export async function getPageDetail(_0xe50a06){const _0x222839=a218_0x53e292,_0x5be785=await apiRequest('/smartapi/lovrabet/detail?pageId='+_0xe50a06);if(!_0x5be785[_0x222839(0xb3)])throw CliErrors[_0x222839(0x117)](_0x222839(0x140)+_0xe50a06);return _0x5be785[_0x222839(0xb3)];}export async function listDeletedPages(_0x5d183c,_0x28a0ae,_0x441334){const _0x5df9e1=a218_0x53e292,_0x465844=new URLSearchParams({'appCode':_0x5d183c,'type':_0x28a0ae,'currentPage':String(_0x441334['currentPage']),'pageSize':String(_0x441334[_0x5df9e1(0x15f)])}),_0x5af243=await apiRequest(_0x5df9e1(0x104)+_0x465844['toString']());return _0x5af243[_0x5df9e1(0xb3)];}export async function restoreStandardPage(_0x23174d){const _0x2f83eb=a218_0x53e292;await apiRequest(_0x2f83eb(0x84),{'method':_0x2f83eb(0xb6),'body':{'id':_0x23174d}});}export async function restoreJsxPage(_0x3cd11,_0x49eaeb){const _0x465033=a218_0x53e292,_0x3582f7=await apiRequest('/smartapi/webcode/page/restore',{'method':_0x465033(0xb6),'body':{'appCode':_0x3cd11,'id':_0x49eaeb}});return _0x3582f7[_0x465033(0xb3)];}export async function updatePage(_0x26da67,_0x33a5a8,_0x3a2b76,_0x35065d){const _0x232b9c=a218_0x53e292,_0x1aa774=await apiRequest('/smartapi/lovrabet/update-page',{'method':_0x232b9c(0xb6),'body':{'appCode':_0x26da67,'pageId':_0x33a5a8,'code':_0x3a2b76,'datasetIds':_0x35065d}});return _0x1aa774[_0x232b9c(0xb3)];}export function generateSdkCode(_0x266a6d,_0x4b03ce,_0x131da3){const _0x4792c3=a218_0x53e292,_0x2c3669=_0x131da3?.[_0x4792c3(0x9a)]??!![],_0x314499=_0x4792c3(0x94)+_0x266a6d[_0x4792c3(0x8e)]?.['replace'](/-/g,'_'),_0x553403=_0x4b03ce[_0x4792c3(0xd8)]||_0x4b03ce[_0x4792c3(0x97)]||'filter',_0x406ec1=[];_0x2c3669&&_0x406ec1['push']('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0x406ec1[_0x4792c3(0xbb)](_0x4792c3(0x17b)+_0x266a6d['name']+'\x20('+(_0x266a6d[_0x4792c3(0x95)]||_0x4792c3(0xcb))+')');if(_0x553403===_0x4792c3(0xf9))_0x406ec1[_0x4792c3(0xbb)](_0x4792c3(0x133)+_0x314499+_0x4792c3(0x8d),_0x4792c3(0x145),_0x4792c3(0x125),_0x4792c3(0x109),_0x4792c3(0x153));else{if(_0x553403===_0x4792c3(0x167))_0x406ec1['push']('const\x20result\x20=\x20await\x20client.models.'+_0x314499+_0x4792c3(0x182));else{if(_0x553403===_0x4792c3(0xc0))_0x406ec1[_0x4792c3(0xbb)](_0x4792c3(0x133)+_0x314499+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x553403==='update')_0x406ec1[_0x4792c3(0xbb)](_0x4792c3(0x133)+_0x314499+_0x4792c3(0x13f));else _0x553403===_0x4792c3(0x111)||_0x553403===_0x4792c3(0xff)?_0x406ec1[_0x4792c3(0xbb)](_0x4792c3(0x133)+_0x314499+'.remove(id);'):_0x406ec1[_0x4792c3(0xbb)](_0x4792c3(0x133)+_0x314499+'.'+_0x553403+_0x4792c3(0xb5));}}}return _0x406ec1[_0x4792c3(0xf6)]('\x0a');}export function generateSqlCodeTemplate(_0x37741e,_0x1316a8){const _0x58406e=a218_0x53e292,_0x1e85ca=_0x1316a8?.[_0x58406e(0x18c)]??'sdk',_0x4d6e07=_0x1316a8?.[_0x58406e(0x9a)]??!![],_0x1e951e=[];return _0x1e951e[_0x58406e(0xbb)]('//\x20SQL:\x20'+_0x37741e[_0x58406e(0x151)]+'\x20('+_0x37741e[_0x58406e(0xb2)]+')'),_0x1e85ca===_0x58406e(0x143)?(_0x4d6e07&&_0x1e951e['push'](_0x58406e(0x11f),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x1e951e[_0x58406e(0xbb)]('const\x20data\x20=\x20await\x20client.sql.execute({','\x20\x20sqlCode:\x20\x27'+_0x37741e['sqlCode']+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x58406e(0x153),_0x58406e(0x116),_0x58406e(0x17d))):_0x1e951e['push'](_0x58406e(0x16c),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x58406e(0xd5),_0x58406e(0x9e)+_0x37741e['sqlCode']+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x58406e(0x135),_0x58406e(0xc5),'}'),_0x1e951e[_0x58406e(0xf6)]('\x0a');}export async function getErConfig(_0x295086,_0x171db6){const _0x27bda3=a218_0x53e292,_0xe802c5=await apiRequest(_0x27bda3(0x98),{'method':_0x27bda3(0xb6),'body':{'appCode':_0x295086,'dblinkId':_0x171db6},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0xe802c5[_0x27bda3(0xb3)];}export async function getErRelationDetail(_0x1157ef,_0x4dea3a){const _0x31d1dc=a218_0x53e292,_0x877491=new URLSearchParams({'appCode':_0x1157ef,'relationId':String(_0x4dea3a)});try{const _0x3400bc=await apiRequest(_0x31d1dc(0x156)+_0x877491[_0x31d1dc(0x8a)]());return _0x3400bc[_0x31d1dc(0xb3)]?.[_0x31d1dc(0x164)]??null;}catch(_0x595029){if(_0x595029 instanceof CliError&&_0x595029[_0x31d1dc(0x8e)]===_0x31d1dc(0xa2)&&(_0x595029[_0x31d1dc(0x129)]?.[_0x31d1dc(0xc4)](_0x31d1dc(0xe6))||_0x595029['hint']==='API\x20error\x20code:\x20306'&&_0x595029[_0x31d1dc(0x86)]==='ER\x20relation\x20does\x20not\x20exist'))return null;throw _0x595029;}}export async function createErRelation(_0x105704){const _0x3d2a55=a218_0x53e292,_0x59b79d=await apiRequest('/smartapi/question/er-config/cli/erCreate',{'method':_0x3d2a55(0xb6),'body':_0x105704,'allowNonJsonSuccess':!![]});return _0x59b79d[_0x3d2a55(0xb3)];}export async function updateErRelation(_0x51d235){const _0x224749=a218_0x53e292,_0x130f0f=await apiRequest(_0x224749(0x162),{'method':'POST','body':_0x51d235,'allowNonJsonSuccess':!![]});return _0x130f0f[_0x224749(0xb3)];}export async function deleteErRelation(_0x4142f8){const _0x56907d=a218_0x53e292,_0xb59b37=await apiRequest('/smartapi/question/er-config/cli/delete-single',{'method':_0x56907d(0xb6),'body':_0x4142f8,'allowNonJsonSuccess':!![]});return _0xb59b37[_0x56907d(0xb3)];}export async function updateErBusinessGroup(_0x4bded6){const _0x5c3d93=a218_0x53e292,_0x165f49=await apiRequest(_0x5c3d93(0x17a),{'method':_0x5c3d93(0xb6),'body':_0x4bded6,'allowNonJsonSuccess':!![]});return _0x165f49[_0x5c3d93(0xb3)];}function buildQuery(_0x2ff1e4){const _0xa7018d=a218_0x53e292,_0x26a038=new URLSearchParams();for(const [_0x438541,_0x3f9010]of Object['entries'](_0x2ff1e4)){if(_0x3f9010===undefined||_0x3f9010==='')continue;_0x26a038['set'](_0x438541,String(_0x3f9010));}const _0x551b3b=_0x26a038[_0xa7018d(0x8a)]();return _0x551b3b?'?'+_0x551b3b:'';}export async function listNotificationChannelConfigs(_0x51d027,_0x25a33d){const _0x37780c=a218_0x53e292,_0x478e73=await apiRequest(_0x37780c(0x126)+buildQuery({'appCode':_0x51d027,'channelType':_0x25a33d}));return Array['isArray'](_0x478e73[_0x37780c(0xb3)])?_0x478e73['data']:[];}export async function listAppConfigs(_0x35149d,_0x39ec86){const _0x34b4a8=a218_0x53e292,_0x2a00fa=await apiRequest(_0x34b4a8(0x124),{'method':_0x34b4a8(0xb6),'body':{'appCode':_0x35149d,..._0x39ec86?.[_0x34b4a8(0xa1)]?{'key':_0x39ec86[_0x34b4a8(0xa1)]}:{},..._0x39ec86?.[_0x34b4a8(0x14b)]?{'tags':_0x39ec86[_0x34b4a8(0x14b)]}:{}}});return extractAppConfigList(_0x2a00fa['data']);}export async function getAppConfigByKey(_0x51c963,_0x628775){const _0x4c3ca3=a218_0x53e292,_0x439de9=await apiRequest(_0x4c3ca3(0x181)+buildQuery({'appCode':_0x51c963,'key':_0x628775}));return _0x439de9[_0x4c3ca3(0xb3)]??null;}export async function createAppConfig(_0x44f3c8){const _0x26598b=a218_0x53e292,_0x4824a2=await apiRequest('/smartapi/app-config/create',{'method':'POST','body':{'appCode':_0x44f3c8[_0x26598b(0x16d)],'key':_0x44f3c8['key'],'value':_0x44f3c8['value'],..._0x44f3c8['tags']?{'tags':_0x44f3c8['tags']}:{}}});return _0x4824a2[_0x26598b(0xb3)];}export async function updateAppConfig(_0x38057a){const _0x24cd25=a218_0x53e292;await apiRequest(_0x24cd25(0x10a),{'method':_0x24cd25(0xb6),'body':{'id':_0x38057a['id'],'appCode':_0x38057a[_0x24cd25(0x16d)],'key':_0x38057a[_0x24cd25(0xa1)],'value':_0x38057a[_0x24cd25(0x12c)],..._0x38057a['tags']?{'tags':_0x38057a[_0x24cd25(0x14b)]}:{}}});}export async function deleteAppConfig(_0xf647f6){const _0x25c815=a218_0x53e292;await apiRequest('/smartapi/app-config/delete',{'method':_0x25c815(0xb6),'body':_0xf647f6});}function extractAppConfigList(_0x583aea){const _0x4734c3=a218_0x53e292;if(Array[_0x4734c3(0x8f)](_0x583aea))return _0x583aea;if(_0x583aea&&typeof _0x583aea==='object'&&Array['isArray'](_0x583aea[_0x4734c3(0x175)]))return _0x583aea['list'];return extractList(_0x583aea);}export async function listDbLinks(_0x557fa6,_0x3de153){const _0x23e514=a218_0x53e292,_0x31ae11=await apiRequest(_0x23e514(0xf2),{'method':_0x23e514(0xb6),'body':{'appCode':_0x557fa6,'currentPage':_0x3de153?.['currentPage']??0x1,'pageSize':_0x3de153?.['pageSize']??0x64}});return{'items':extractList(_0x31ae11[_0x23e514(0xb3)]),'paging':extractPaging(_0x31ae11['data'])};}export async function getDbLinkInfo(_0x28b019){const _0x54a2a3=a218_0x53e292,_0x14bbdb=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x28b019}));return _0x14bbdb[_0x54a2a3(0xb3)];}export async function createDbLink(_0x4fe7d2){const _0x1b9e33=a218_0x53e292,_0x74a7ab=await apiRequest(_0x1b9e33(0x9c),{'method':'POST','body':_0x4fe7d2});return _0x74a7ab['data'];}export async function updateDbLink(_0x4cc7ec){const _0x59632d=a218_0x53e292,_0x5bbb1a=await apiRequest(_0x59632d(0xb0),{'method':_0x59632d(0xb6),'body':_0x4cc7ec});return _0x5bbb1a['data'];}export async function deleteDbLink(_0x59cd07){const _0x34b616=a218_0x53e292;await apiRequest('/smartapi/dblink/delete',{'method':_0x34b616(0xb6),'body':{'id':_0x59cd07}});}export async function testDbLinkConnect(_0x199f71){const _0x3907fb=a218_0x53e292,_0x278ec7=await apiRequest(_0x3907fb(0x183)+buildQuery({'id':_0x199f71}));return _0x278ec7[_0x3907fb(0xb3)];}export async function startDbAnalysis(_0x492d8e,_0x4fb5af){const _0x336bea=a218_0x53e292,_0x240357=await apiRequest('/smartapi/db-analysis/start',{'method':_0x336bea(0xb6),'body':{'dbLinkId':_0x492d8e,..._0x4fb5af&&_0x4fb5af['length']>0x0?{'tableNames':_0x4fb5af}:{}}});return _0x240357['data'];}export async function cancelDbAnalysis(_0x5b4149){const _0x3b774c=a218_0x53e292;await apiRequest(_0x3b774c(0x13e)+buildQuery({'planId':_0x5b4149}),{'method':'POST'});}export async function getDbAnalysisStatus(_0x3b7fe9){const _0x332ae4=a218_0x53e292,_0x556d1d=await apiRequest(_0x332ae4(0x188)+encodeURIComponent(_0x3b7fe9));return _0x556d1d[_0x332ae4(0xb3)];}export async function getDbAllTableList(_0x93dd6,_0x38f37f){const _0x5b4275=a218_0x53e292,_0x3d90e5=await apiRequest(_0x5b4275(0x112)+buildQuery({'appCode':_0x93dd6,'dbLinkId':_0x38f37f})),_0x5db88e=_0x3d90e5[_0x5b4275(0xb3)];if(Array['isArray'](_0x5db88e))return _0x5db88e;return extractList(_0x5db88e);}export async function getDbTableDiff(_0x43d810,_0x4c4f6b,_0x2e4d07){const _0xbd56ce=a218_0x53e292,_0x2dbd89=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x43d810,'dbLinkId':_0x4c4f6b,'pageIndex':_0x2e4d07?.[_0xbd56ce(0xd2)]??0x1,'pageSize':_0x2e4d07?.['pageSize']??0x14,'tableName':_0x2e4d07?.['tableName']})),_0x2c5e53=_0x2dbd89[_0xbd56ce(0xb3)];return{'totalCount':_0x2c5e53?.[_0xbd56ce(0xdd)]??0x0,'physicalTableCount':_0x2c5e53?.[_0xbd56ce(0xd4)]??0x0,'datasetTableCount':_0x2c5e53?.[_0xbd56ce(0xb7)]??0x0,..._0x2c5e53?.[_0xbd56ce(0x10b)]?{'summary':_0x2c5e53[_0xbd56ce(0x10b)]}:{},'tableList':Array[_0xbd56ce(0x8f)](_0x2c5e53?.['tableList'])?_0x2c5e53[_0xbd56ce(0x142)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x1e11ef=a218_0x53e292,_0x709181=await apiRequest(_0x1e11ef(0x93),{'method':_0x1e11ef(0xb6),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x4a6dbc=extractList(_0x709181[_0x1e11ef(0xb3)]),_0x4d7df2=extractPaging(_0x709181[_0x1e11ef(0xb3)]);return _0x4d7df2&&_0x4d7df2[_0x1e11ef(0xdd)]>REMOTE_APP_PAGE_SIZE&&console[_0x1e11ef(0x16e)](_0x1e11ef(0xca)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x4d7df2[_0x1e11ef(0xdd)]+_0x1e11ef(0x150)+_0x1e11ef(0xf0)),_0x4a6dbc;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x489a98,_0x2ea711){const _0x2b6f84=a218_0x53e292,_0xb07c79=Math['min'](Math['max'](_0x2ea711?.[_0x2b6f84(0x15f)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x4dd3f2=await apiRequest(_0x2b6f84(0x141),{'method':_0x2b6f84(0xb6),'body':{'appCode':_0x489a98,'currentPage':_0x2ea711?.[_0x2b6f84(0xe4)]??0x1,'pageSize':_0xb07c79}});return{'items':extractList(_0x4dd3f2[_0x2b6f84(0xb3)]),'paging':extractPaging(_0x4dd3f2['data'])};}export async function getAppRole(_0x1b63b3){const _0x1562c1=a218_0x53e292,_0x5ee023=await apiRequest(_0x1562c1(0x99)+buildQuery({'id':_0x1b63b3}));return _0x5ee023[_0x1562c1(0xb3)];}export async function createAppRole(_0x1a7834){const _0x1e32ec=a218_0x53e292,_0x101f59=await apiRequest('/smartapi/permit/role/create',{'method':'POST','body':{'appCode':_0x1a7834[_0x1e32ec(0x16d)],'roleName':_0x1a7834[_0x1e32ec(0xfc)],'roleType':_0x1e32ec(0xa3),..._0x1a7834['remark']?{'remark':_0x1a7834[_0x1e32ec(0x80)]}:{}}});return _0x101f59['data'];}function a218_0x58dd(){const _0x4a1be1=['authRequired','/smartapi/webcode/page/detail','object','tags','/smartapi/dataset/get-dataset-list','正在从服务器拉取模型列表...\x20(环境:\x20','/smartapi/custom/deleteUserCustomSql','taskId','\x20apps.\x20','sqlName','BFF\x20save\x20returned\x20no\x20valid\x20id','});','longTerm','trim','/smartapi/question/er-config/cli/detail?','path','label','displayName','/api/management/script/cache/clear','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','/smartapi/lovrabet/dataset/','ENABLE','404862wMeygN','pageSize','\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20after\x20HTTP\x20success.','error','/smartapi/question/er-config/cli/update-single','has','relation','68436WvacNz','Unauthorized','getOne','menu','/admin/knowledge-base/create','entries','Knowledge-base\x20pageSize\x20must\x20be\x20an\x20integer\x20between\x201\x20and\x20','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','appCode','warn','List\x20enterprise\x20knowledge\x20bases\x20returned\x20invalid\x20paging\x20metadata.','/admin/knowledge-base/get-one','tableData','version','enableI18n','/api/node-toolbox/api-doc-generator','list','needPublic','permits','/smartapi/menu/update','/smartapi/user-accounts/cli/dingding-sandbox/bind','/smartapi/question/er-config/business-group/edit','//\x20','/smartapi/ocr/recognize-text?','const\x20results\x20=\x20data.execResult\x20||\x20[];','replace','operations','/smartapi/custom/getUserCustomSql?id=','/smartapi/app-config/getByKey','.getOne(id);','/smartapi/dblink/testConnect','/smartapi/permit/role/update','operationId','modelId','userTenantRelationList','/smartapi/db-analysis/status/','\x20failed','?sqlCode=','dbId','target','Knowledge-base\x20response\x20is\x20missing\x20a\x20valid\x20','/smartapi/tasks/','startsWith','modelCode','0000','SQL\x20query\x20not\x20found:\x20id=','/smartapi/menu/find?','remark','platform-error-code',':\x20invalid\x20JSON\x20response\x20envelope','/api/management/library/scripts/statistics?appCode=','/smartapi/page/restore','Fetch\x20datasets','message','errorMsg','content','The\x20server\x20outcome\x20is\x20indeterminate.\x20Verify\x20current\x20state\x20before\x20retrying\x20any\x20mutation.','toString','configArray','List\x20enterprise\x20knowledge\x20bases\x20returned\x20an\x20invalid\x20response\x20contract.','.filter({','code','isArray','Fetch\x20doc\x20(','download','fetch-model-list','/smartapi/app/getList','dataset_','tableName','defineProperty','operationName','/smartapi/question/er-config','/smartapi/permit/role/get-one','includeImports','/admin/knowledge-base/update','/smartapi/dblink/create','stringify','\x20\x20\x20\x20sqlCode:\x20\x27','/smartapi/webcode/page/create','/smartapi/permit/page/get-one','key','api_error','CUSTOM','parentMenuId','toLowerCase','1086HGnOpf','API\x20error:\x20','/filter','pageName','/smartapi/dataset/delete-dataset','append','method','134436yiSHIo','username','info','/smartapi/dblink/update','/generate-standard-pages/start','sqlCode','data','Delete\x20enterprise\x20knowledge\x20base','(/*\x20params\x20*/);','POST','datasetTableCount','i18nInfo','/smartapi/common/uploadFile','/smartapi/dataset/text-generate/preview','push','/admin/knowledge-base/get-list','scriptName','avatar','/admin/knowledge-base/delete','create','8888056IEcRcn','/userTenant/getByTenantCode','3277785tPtmYf','includes','\x20\x20return\x20rows;','abort','/smartapi/permit/user-role/get-user-list','/smartapi/dataset/text-generate/start','number','Warning:\x20showing\x20first\x20','table','title','/generate-standard-pages/status?','mobile','find','add','/smartapi/permit/resource/get-menu-list','pageIndex','array','physicalTableCount','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','type','GET','name','application/json','status','dbtableConfig','requestFields','totalCount','requirementDescription','needSelf',',\x20HTTP\x20','/smartapi/menu/regroup','success','pageId','currentPage','deleted','DATA_NOT_EXIST','isInteger','/smartapi/menu/delete','401','cli:rabetbase','pageContent','file','apiError','responseFields','Create\x20enterprise\x20knowledge\x20base','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','userId','/smartapi/dblink/getList','1560300Tcogbp','platform-transport-failure','json','join','/smartapi/dataset/text-generate/status?','files','filter','BFF\x20script\x20not\x20found:\x20id=','isFinite','roleName','/sync-to-pages','AbortError','remove','company','/smartapi/menu/batchDelete','updateTime','roleType','/smartapi/page/getDeletedPageList?','\x22\x20not\x20found\x20in\x20dataset\x20','set','Request\x20timeout:\x20','SQL\x20query\x20not\x20found:\x20','\x20\x20currentPage:\x201,','/smartapi/app-config/update','summary','functionName','isSafeInteger','url','errorMessage','Knowledge-base\x20update\x20requires\x20title\x20or\x20content.','delete','/smartapi/dblink/getAllTableList','/api/','string','/smartapi/common/queryFileUrl','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','validation','API\x20error\x20code:\x20','Operation\x20\x22','createTime','2635NnGsLf','\x20failed,\x20HTTP\x20','/api/management/library/scripts/save','/smartapi/dataset/get-driven-data?','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','clientOperationId','/smartapi/custom/getUserCustomSql','/smartapi/permit/user-role/update-user-list','signal','/smartapi/app-config/list','\x20\x20pageSize:\x2020,','/notification/channel-config/list','/smartapi/permit/role/get-permit-list','length','hint','Get\x20enterprise\x20knowledge\x20base','React\x20custom\x20page\x20not\x20found:\x20','value','/smartapi/app/getOne','map','markdown','Dataset\x20not\x20found:\x20','/api/node-toolbox/sql/save','materialName','const\x20result\x20=\x20await\x20client.models.','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','\x20\x20});','scriptType','scope','nickname','Invalid\x20response\x20format\x20(','/api/node-toolbox/dataset/model-list?','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20scope.','/smartapi/custom/updateUserCustomSql','test','/smartapi/db-analysis/jobs/cancel','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','Page\x20not\x20found:\x20','/smartapi/permit/role/get-list','tableList','sdk','List\x20enterprise\x20knowledge\x20bases','\x20\x20where:\x20{},','errorCode','Knowledge-base\x20API\x20returned\x20an\x20invalid\x20record\x20contract.'];a218_0x58dd=function(){return _0x4a1be1;};return a218_0x58dd();}export async function updateAppRole(_0x357c2d){const _0x55d3b9=a218_0x53e292,_0x8564c3=await apiRequest(_0x55d3b9(0x184),{'method':_0x55d3b9(0xb6),'body':{'id':_0x357c2d['id'],'appCode':_0x357c2d['appCode'],..._0x357c2d[_0x55d3b9(0x103)]?{'roleType':_0x357c2d[_0x55d3b9(0x103)]}:{},..._0x357c2d[_0x55d3b9(0xfc)]!==undefined?{'roleName':_0x357c2d[_0x55d3b9(0xfc)]}:{},..._0x357c2d['remark']!==undefined?{'remark':_0x357c2d[_0x55d3b9(0x80)]}:{},..._0x357c2d[_0x55d3b9(0x177)]?{'permits':_0x357c2d[_0x55d3b9(0x177)]}:{}}});return _0x8564c3[_0x55d3b9(0xb3)];}export async function deleteAppRole(_0x5da65f){const _0x2de86a=a218_0x53e292;await apiRequest('/smartapi/permit/role/delete',{'method':_0x2de86a(0xb6),'body':{'id':_0x5da65f}});}export async function listPermitRoles(_0x5364f5,_0x284d7a){const _0x25059d=a218_0x53e292,_0x1d6ce6=await apiRequest(_0x25059d(0x127),{'method':'POST','body':{'appCode':_0x5364f5,..._0x284d7a?.[_0x25059d(0xdf)]!==undefined?{'needSelf':_0x284d7a[_0x25059d(0xdf)]}:{},..._0x284d7a?.[_0x25059d(0x176)]!==undefined?{'needPublic':_0x284d7a[_0x25059d(0x176)]}:{}}});return extractList(_0x1d6ce6[_0x25059d(0xb3)]);}export async function getRoleMenuResources(_0x16b6cd,_0x4f2187){const _0x40734a=a218_0x53e292,_0x5b315e=await apiRequest(_0x40734a(0xd1),{'method':_0x40734a(0xb6),'body':{'appCode':_0x16b6cd,'roleId':_0x4f2187}});return extractList(_0x5b315e[_0x40734a(0xb3)]);}export async function getRoleApiResources(_0x2319ae,_0x66d617){const _0x3fbef3=a218_0x53e292,_0x3109fc=await apiRequest('/smartapi/permit/resource/get-api-list',{'method':_0x3fbef3(0xb6),'body':{'appCode':_0x2319ae,'roleId':_0x66d617}});return extractList(_0x3109fc[_0x3fbef3(0xb3)]);}export async function listRoleUsers(_0x56f74c){const _0x11ab63=a218_0x53e292,_0x37c899=await apiRequest(_0x11ab63(0xc7),{'method':_0x11ab63(0xb6),'body':{'appCode':_0x56f74c}});return extractList(_0x37c899[_0x11ab63(0xb3)])[_0x11ab63(0x12e)](({id:_0x5ae9dd,userList:_0x4ef09c,applyUserList:_0x117129,..._0x5d8be7})=>({..._0x5d8be7,'id':Number(_0x5ae9dd),'userList':_0x4ef09c[_0x11ab63(0x12e)](_0x224aa5=>({..._0x224aa5,'userId':Number(_0x224aa5[_0x11ab63(0xf1)])})),..._0x117129?{'applyUserList':_0x117129[_0x11ab63(0x12e)](_0xcf3946=>({..._0xcf3946,'userId':Number(_0xcf3946[_0x11ab63(0xf1)])}))}:{}}));}export async function updateRoleUsers(_0x3fa5b8,_0x1b88ff){const _0x1deb90=a218_0x53e292;await apiRequest(_0x1deb90(0x122),{'method':_0x1deb90(0xb6),'body':{'appCode':_0x3fa5b8,'roleList':_0x1b88ff}});}export async function getPagePermit(_0x218593){const _0x6fe0e0=a218_0x53e292,_0x41b6cc=await apiRequest(_0x6fe0e0(0xa0)+buildQuery({'menuId':_0x218593}));return _0x41b6cc[_0x6fe0e0(0xb3)];}export async function savePagePermit(_0x74c48b){const _0x4c1411=a218_0x53e292,_0x30f77d=await apiRequest('/smartapi/permit/page/save',{'method':_0x4c1411(0xb6),'body':_0x74c48b});return _0x30f77d[_0x4c1411(0xb3)];}export async function listCurrentUserTenantMemberships(){const _0x667bcd=a218_0x53e292,_0x4719b1=await apiRequest('/userTenant/queryBelongsTenants');return extractList(_0x4719b1[_0x667bcd(0xb3)]);}export async function listTenantDirectoryMembers(_0x4813c9){const _0x2ea6d1=a218_0x53e292,_0x465bb3=await apiRequest(_0x2ea6d1(0xc2)+buildQuery({'code':_0x4813c9})),_0x292e14=_0x465bb3[_0x2ea6d1(0xb3)]?.[_0x2ea6d1(0x187)];return Array['isArray'](_0x292e14)?_0x292e14:[];}export async function getTenantMembers(_0x56d4c2){const _0x5c2dec=a218_0x53e292,_0x585859=await listTenantDirectoryMembers(_0x56d4c2);return _0x585859[_0x5c2dec(0xf9)](_0x4629cc=>_0x4629cc[_0x5c2dec(0xda)]===_0x5c2dec(0x15d)||_0x4629cc['status']===undefined)['map'](_0x1cf840=>({'userId':Number(_0x1cf840['userId']??_0x1cf840['id']),'username':_0x1cf840[_0x5c2dec(0xae)],'nickname':_0x1cf840[_0x5c2dec(0x138)],'status':_0x1cf840[_0x5c2dec(0xda)],'email':_0x1cf840['email'],'mobile':_0x1cf840[_0x5c2dec(0xce)],'avatar':_0x1cf840[_0x5c2dec(0xbe)]}))[_0x5c2dec(0xf9)](_0x22e2ab=>Number[_0x5c2dec(0xfb)](_0x22e2ab[_0x5c2dec(0xf1)])&&_0x22e2ab[_0x5c2dec(0xf1)]>0x0);}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a219_0xe2a2e5=a219_0x47d0;function a219_0x3095(){const _0x13a321=['9507440zGWzLk','1317146iNooQP','4218328taaETJ','/bff','2qXLbNe','5653575cXPGIt','8744658rRJWsb','.rabetbase','3169481xbfZUp','bff','4111179gQqpnp','bff-trash'];a219_0x3095=function(){return _0x13a321;};return a219_0x3095();}(function(_0x2d2d41,_0x3690f2){const _0x4d8c06=a219_0x47d0,_0x1dddc9=_0x2d2d41();while(!![]){try{const _0x3494b3=-parseInt(_0x4d8c06(0x11b))/0x1*(-parseInt(_0x4d8c06(0x118))/0x2)+-parseInt(_0x4d8c06(0x115))/0x3+-parseInt(_0x4d8c06(0x119))/0x4+parseInt(_0x4d8c06(0x11c))/0x5+parseInt(_0x4d8c06(0x11d))/0x6+parseInt(_0x4d8c06(0x113))/0x7+-parseInt(_0x4d8c06(0x117))/0x8;if(_0x3494b3===_0x3690f2)break;else _0x1dddc9['push'](_0x1dddc9['shift']());}catch(_0x28b678){_0x1dddc9['push'](_0x1dddc9['shift']());}}}(a219_0x3095,0xb5cea));function a219_0x47d0(_0x12dc4d,_0x4a9d80){_0x12dc4d=_0x12dc4d-0x113;const _0x30957c=a219_0x3095();let _0x47d091=_0x30957c[_0x12dc4d];return _0x47d091;}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a219_0xe2a2e5(0x11e),LOCK_FILE_NAME='bff.lock.json',TRASH_DIR_NAME=a219_0xe2a2e5(0x116);export function loadBffProjectConfig(_0x292197,_0x5b1a12){const _0x1cc4be=a219_0xe2a2e5,_0x4c8f22=resolve(_0x5b1a12??findProjectRootDirectory()),_0x2a5e99=DOT_DIR+_0x1cc4be(0x11a),_0x1e997e=_0x2a5e99+'/'+_0x292197;return{'projectRoot':_0x4c8f22,'appCode':_0x292197,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x2a5e99,'scriptsRoot':_0x1e997e,'scriptsRootDir':resolve(_0x4c8f22,DOT_DIR,_0x1cc4be(0x114),_0x292197),'lockFilePath':resolve(_0x4c8f22,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4c8f22,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a220_0x50c6(_0x476a61,_0x22bdd1){_0x476a61=_0x476a61-0x1b3;const _0x53d8a1=a220_0x53d8();let _0x50c6af=_0x53d8a1[_0x476a61];return _0x50c6af;}const a220_0x568311=a220_0x50c6;(function(_0x4bd178,_0x54cf63){const _0x10669d=a220_0x50c6,_0x1629fc=_0x4bd178();while(!![]){try{const _0x4e6e5a=-parseInt(_0x10669d(0x1d4))/0x1+parseInt(_0x10669d(0x1c0))/0x2*(parseInt(_0x10669d(0x1c3))/0x3)+-parseInt(_0x10669d(0x1d2))/0x4+-parseInt(_0x10669d(0x1d7))/0x5*(-parseInt(_0x10669d(0x1d1))/0x6)+parseInt(_0x10669d(0x1c1))/0x7*(-parseInt(_0x10669d(0x1c5))/0x8)+parseInt(_0x10669d(0x1b6))/0x9*(parseInt(_0x10669d(0x1c6))/0xa)+-parseInt(_0x10669d(0x1c7))/0xb*(-parseInt(_0x10669d(0x1c4))/0xc);if(_0x4e6e5a===_0x54cf63)break;else _0x1629fc['push'](_0x1629fc['shift']());}catch(_0x4d78fa){_0x1629fc['push'](_0x1629fc['shift']());}}}(a220_0x53d8,0xb640d));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=['COMMON',a220_0x568311(0x1b7),'HOOK'];export function normalizeBffType(_0x3105b0){const _0x45313e=a220_0x568311;if(!_0x3105b0)return undefined;const _0x59e2f3=_0x3105b0['trim']()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x45313e(0x1b5)](_0x59e2f3)?_0x59e2f3:undefined;}async function scanJsFilesRecursively(_0x1defe3,_0x1d07f0){const _0x368a36=a220_0x568311,_0x2b2329=[];try{const _0x141010=await readdir(_0x1defe3,{'withFileTypes':!![]});for(const _0x9f87bc of _0x141010){const _0x91e8b6=join(_0x1defe3,_0x9f87bc[_0x368a36(0x1d0)]);if(_0x9f87bc[_0x368a36(0x1bb)]())_0x2b2329[_0x368a36(0x1cc)](...await scanJsFilesRecursively(_0x91e8b6,_0x1d07f0+'/'+_0x9f87bc['name']));else _0x9f87bc[_0x368a36(0x1ce)]()&&_0x9f87bc[_0x368a36(0x1d0)][_0x368a36(0x1b8)](_0x368a36(0x1ca))&&_0x2b2329[_0x368a36(0x1cc)]({'lockKey':_0x1d07f0+'/'+_0x9f87bc[_0x368a36(0x1d0)][_0x368a36(0x1c9)](/\.js$/,''),'filePath':_0x91e8b6});}}catch(_0x155da4){if(_0x155da4['code']!==_0x368a36(0x1d3))throw _0x155da4;}return _0x2b2329;}async function scanFlatFunctions(_0x497168,_0x2bf7a5){const _0x112c10=a220_0x568311,_0x145642=join(_0x497168['scriptsRootDir'],_0x2bf7a5),_0x295b1b=await scanJsFilesRecursively(_0x145642,_0x2bf7a5);return _0x295b1b[_0x112c10(0x1bc)](({lockKey:_0x5cd13c,filePath:_0x1bbb97})=>({'type':_0x2bf7a5,'name':_0x5cd13c['split']('/')['at'](-0x1)??'','filePath':_0x1bbb97,'lockKey':_0x5cd13c}));}async function scanHookFunctions(_0x16eb9a){const _0x440934=a220_0x568311,_0x44057b=join(_0x16eb9a['scriptsRootDir'],_0x440934(0x1d6)),_0x1511b5=[];try{const _0x381ef8=await readdir(_0x44057b,{'withFileTypes':!![]});for(const _0x2c6240 of _0x381ef8){if(!_0x2c6240['isDirectory']())continue;const _0x455a5c=_0x2c6240[_0x440934(0x1d0)],_0x3c58c5=join(_0x44057b,_0x455a5c),_0x53ecfb=await readdir(_0x3c58c5,{'withFileTypes':!![]});for(const _0x11008d of _0x53ecfb){if(!_0x11008d[_0x440934(0x1bb)]())continue;const _0x15fea5=_0x11008d[_0x440934(0x1d0)],_0x3c2e7e=join(_0x3c58c5,_0x15fea5),_0x16f858=await readdir(_0x3c2e7e,{'withFileTypes':!![]});for(const _0x26fb83 of _0x16f858){if(!_0x26fb83[_0x440934(0x1bb)]())continue;const _0x4ded89=_0x26fb83[_0x440934(0x1d0)],_0x569d6e=join(_0x3c2e7e,_0x4ded89),_0x2a97df=await readdir(_0x569d6e,{'withFileTypes':!![]});for(const _0x1fcb7f of _0x2a97df){if(!_0x1fcb7f[_0x440934(0x1ce)]()||!_0x1fcb7f['name'][_0x440934(0x1b8)](_0x440934(0x1ca)))continue;const _0x1b618f=_0x1fcb7f[_0x440934(0x1d0)][_0x440934(0x1c9)](/\.js$/,'');_0x1511b5[_0x440934(0x1cc)]({'type':_0x440934(0x1d6),'name':_0x1b618f,'filePath':join(_0x569d6e,_0x1fcb7f[_0x440934(0x1d0)]),'lockKey':'HOOK/'+_0x455a5c+'/'+_0x15fea5+'/'+_0x4ded89+'/'+_0x1b618f,'alias':_0x455a5c,'operationType':_0x15fea5,'functionNode':_0x4ded89});}}}}}catch(_0x4b5af8){if(_0x4b5af8['code']!==_0x440934(0x1d3))throw _0x4b5af8;}return _0x1511b5;}export async function scanLocalBffFunctions(_0x53a6c0,_0x36d26c){const _0x2a4591=a220_0x568311;if(_0x36d26c===_0x2a4591(0x1d8)||_0x36d26c==='ENDPOINT')return scanFlatFunctions(_0x53a6c0,_0x36d26c);if(_0x36d26c===_0x2a4591(0x1d6))return scanHookFunctions(_0x53a6c0);const [_0x59280f,_0x5d3f21,_0x2cbd77]=await Promise['all']([scanFlatFunctions(_0x53a6c0,_0x2a4591(0x1d8)),scanFlatFunctions(_0x53a6c0,_0x2a4591(0x1b7)),scanHookFunctions(_0x53a6c0)]);return[..._0x59280f,..._0x5d3f21,..._0x2cbd77];}export function resolveLocalFilePathFromLockKey(_0x24bc5e,_0x47cd5d){const _0x5e631d=a220_0x568311;return join(_0x24bc5e[_0x5e631d(0x1cb)],..._0x47cd5d[_0x5e631d(0x1c2)]('/'))+_0x5e631d(0x1ca);}function a220_0x53d8(){const _0x36172d=['6151870OfrQjR','11mBIcXB','datasetCode','replace','.js','scriptsRootDir','push','set','isFile','HOOK/','name','1679082HUhMHa','4621992OFWdfn','ENOENT','605408ijHPEM','beforeScriptId','HOOK','5dwBrjU','COMMON','functionName','operationType','get','includes','18ocftFJ','ENDPOINT','endsWith','before','afterScriptId','isDirectory','map','scriptType','alias','after','224174klfMxs','5726BssIZk','split','36Lqyvjr','11246736fRMoNb','12568mEGGUR'];a220_0x53d8=function(){return _0x36172d;};return a220_0x53d8();}export function createHookLocationMap(_0x5a7d3f){const _0x39c5fa=a220_0x568311,_0x352327=new Map();for(const _0xc1aa67 of _0x5a7d3f){_0xc1aa67[_0x39c5fa(0x1d5)]&&_0x352327[_0x39c5fa(0x1cd)](_0xc1aa67[_0x39c5fa(0x1d5)],{'datasetCode':_0xc1aa67[_0x39c5fa(0x1c8)],'operationType':snakeToCamel(_0xc1aa67[_0x39c5fa(0x1b3)]),'functionNode':_0x39c5fa(0x1b9)}),_0xc1aa67[_0x39c5fa(0x1ba)]&&_0x352327['set'](_0xc1aa67['afterScriptId'],{'datasetCode':_0xc1aa67[_0x39c5fa(0x1c8)],'operationType':snakeToCamel(_0xc1aa67['operationType']),'functionNode':_0x39c5fa(0x1bf)});}return _0x352327;}export function resolveRemoteScriptTarget(_0x9ea03c,_0x4c44c7,_0x1fc0ef,_0x46ebac,_0x2857c2){const _0x320dc6=a220_0x568311,_0x5de8d6=normalizeBffType(_0x4c44c7[_0x320dc6(0x1bd)]);if(!_0x5de8d6||!_0x4c44c7['functionName'])return null;if(_0x5de8d6===_0x320dc6(0x1d6)){const _0x2309a8=(_0x4c44c7['id']?_0x1fc0ef[_0x320dc6(0x1b4)](_0x4c44c7['id']):undefined)??findHookLocationByRemoteId(_0x46ebac,_0x4c44c7['id']);if(!_0x2309a8)return null;const _0xf60a8c=_0x2309a8[_0x320dc6(0x1be)]||_0x2857c2[_0x320dc6(0x1b4)](_0x2309a8[_0x320dc6(0x1c8)]),_0x10934a=_0xf60a8c??_0x2309a8[_0x320dc6(0x1c8)],_0x35fb56={..._0x2309a8,'alias':_0xf60a8c},_0x31cf5e=_0x320dc6(0x1cf)+_0x10934a+'/'+_0x35fb56[_0x320dc6(0x1b3)]+'/'+_0x35fb56['functionNode']+'/'+_0x4c44c7[_0x320dc6(0x1d9)];return{'lockKey':_0x31cf5e,'filePath':resolveLocalFilePathFromLockKey(_0x9ea03c,_0x31cf5e),'type':_0x320dc6(0x1d6),'hookLocation':_0x35fb56};}const _0x362423=_0x5de8d6+'/'+_0x4c44c7[_0x320dc6(0x1d9)];return{'lockKey':_0x362423,'filePath':resolveLocalFilePathFromLockKey(_0x9ea03c,_0x362423),'type':_0x5de8d6};}export async function ensureParentDirectory(_0x2123e6){await mkdir(dirname(_0x2123e6),{'recursive':!![]});}export async function fileExists(_0x78273f){try{return await access(_0x78273f,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x2a9a06){const _0x3146b1=a220_0x568311;try{const _0x23adee=await stat(_0x2a9a06);return _0x23adee[_0x3146b1(0x1bb)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a221_0x5317(){const _0x5dd2f7=['md5','39708sfgrpe','hex','3070GdJmeg','35781bDGnRP','83578hevYXK','update','57pMSAzx','68696mTprNW','4511350OADcWM','459bsBqKv','166264oygpJf','42924DtDvDl','1246IlGrro','digest','utf8','createHash'];a221_0x5317=function(){return _0x5dd2f7;};return a221_0x5317();}(function(_0x42e190,_0xbdbfc3){const _0x12478c=a221_0x3589,_0x43ae22=_0x42e190();while(!![]){try{const _0x331d9d=-parseInt(_0x12478c(0x1b7))/0x1+parseInt(_0x12478c(0x1b4))/0x2+parseInt(_0x12478c(0x1ba))/0x3*(-parseInt(_0x12478c(0x1bb))/0x4)+-parseInt(_0x12478c(0x1bc))/0x5+-parseInt(_0x12478c(0x1bf))/0x6*(parseInt(_0x12478c(0x1c0))/0x7)+parseInt(_0x12478c(0x1be))/0x8*(parseInt(_0x12478c(0x1bd))/0x9)+parseInt(_0x12478c(0x1b6))/0xa*(parseInt(_0x12478c(0x1b8))/0xb);if(_0x331d9d===_0xbdbfc3)break;else _0x43ae22['push'](_0x43ae22['shift']());}catch(_0xbfb765){_0x43ae22['push'](_0x43ae22['shift']());}}}(a221_0x5317,0xd586c));import{readFile}from'node:fs/promises';function a221_0x3589(_0x5ca624,_0x4890c2){_0x5ca624=_0x5ca624-0x1b2;const _0x53176c=a221_0x5317();let _0x3589fc=_0x53176c[_0x5ca624];return _0x3589fc;}import a221_0x1ee7f3 from'node:crypto';export function computeContentHash(_0x2e87be){const _0x4ff4cf=a221_0x3589;return a221_0x1ee7f3[_0x4ff4cf(0x1b2)](_0x4ff4cf(0x1b3))[_0x4ff4cf(0x1b9)](_0x2e87be)[_0x4ff4cf(0x1c1)](_0x4ff4cf(0x1b5));}export async function computeFileHash(_0x236dc9){const _0x46bc2a=a221_0x3589,_0x5a3a81=await readFile(_0x236dc9,_0x46bc2a(0x1c2));return computeContentHash(_0x5a3a81);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x46aaae,_0x908cf7){const _0x1da1e3=a222_0x3c9c,_0x4d3f6b=_0x46aaae();while(!![]){try{const _0x333273=-parseInt(_0x1da1e3(0x153))/0x1+-parseInt(_0x1da1e3(0x15b))/0x2+-parseInt(_0x1da1e3(0x152))/0x3+-parseInt(_0x1da1e3(0x15c))/0x4+parseInt(_0x1da1e3(0x159))/0x5*(parseInt(_0x1da1e3(0x14d))/0x6)+parseInt(_0x1da1e3(0x14c))/0x7+-parseInt(_0x1da1e3(0x15a))/0x8;if(_0x333273===_0x908cf7)break;else _0x4d3f6b['push'](_0x4d3f6b['shift']());}catch(_0x19d433){_0x4d3f6b['push'](_0x4d3f6b['shift']());}}}(a222_0x3b67,0xea741));function a222_0x3c9c(_0x1b5bbb,_0xf1894b){_0x1b5bbb=_0x1b5bbb-0x148;const _0x3b67eb=a222_0x3b67();let _0x3c9ce2=_0x3b67eb[_0x1b5bbb];return _0x3c9ce2;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x5d002f,_0x4fc97f,_0x462a46,_0x4a0241){const _0x5d94c9=a222_0x3c9c,_0x980fa1={'apps':_0x5d002f[_0x5d94c9(0x154)]&&typeof _0x5d002f[_0x5d94c9(0x154)]===_0x5d94c9(0x157)?_0x5d002f[_0x5d94c9(0x154)]:{}};let _0x53f165=_0x980fa1['apps'][_0x4fc97f];if(!_0x53f165)return _0x53f165={'scriptsRoot':_0x462a46,'lastSync':'','functions':{}},_0x980fa1['apps'][_0x4fc97f]=_0x53f165,{'lockData':_0x980fa1,'appLock':_0x53f165};if(!_0x53f165[_0x5d94c9(0x151)])_0x53f165[_0x5d94c9(0x151)]=_0x462a46;else{if(_0x53f165[_0x5d94c9(0x151)]!==_0x462a46)throw new Error(_0x4a0241+_0x5d94c9(0x149)+(_0x5d94c9(0x14a)+_0x462a46+_0x5d94c9(0x158)+_0x53f165['scriptsRoot']+_0x5d94c9(0x14f))+_0x5d94c9(0x155));}return!_0x53f165[_0x5d94c9(0x14b)]&&(_0x53f165[_0x5d94c9(0x14b)]={}),!_0x53f165['lastSync']&&(_0x53f165['lastSync']=''),{'lockData':_0x980fa1,'appLock':_0x53f165};}export async function readBffLockFile(_0x714c4e){const _0x13a20a=a222_0x3c9c;try{const _0x5e84e5=await readFile(_0x714c4e,_0x13a20a(0x150)),_0x51e0a9=JSON['parse'](_0x5e84e5);return{'apps':_0x51e0a9[_0x13a20a(0x154)]&&typeof _0x51e0a9[_0x13a20a(0x154)]===_0x13a20a(0x157)?_0x51e0a9[_0x13a20a(0x154)]:{}};}catch(_0x367fdb){if(_0x367fdb[_0x13a20a(0x156)]===_0x13a20a(0x148))return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x367fdb));}}export async function writeBffLockFile(_0x21881a,_0x199321){const _0x2b40a8=a222_0x3c9c;await mkdir(dirname(_0x21881a),{'recursive':!![]}),await writeFile(_0x21881a,JSON[_0x2b40a8(0x14e)](_0x199321,null,0x2),_0x2b40a8(0x150));}function a222_0x3b67(){const _0x9a0cf=['\x22.\x20','utf8','scriptsRoot','3022680JknUJk','64846IEvBay','apps','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','code','object','\x22\x20vs\x20lock\x20\x22','2005iqCIkZ','4953904EDLpyv','327302DSnrTT','2296392tYleWZ','ENOENT',':\x20scriptsRoot\x20mismatch\x20—\x20','current\x20\x22','functions','12267017vYYQOZ','24498pcFSUB','stringify'];a222_0x3b67=function(){return _0x9a0cf;};return a222_0x3b67();}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a224_0x4387(){const _0xa23845=['74EWgFoa','7330IPlpyN','toUpperCase','12365667cKcBDr','before','2480UeyFDI','values','15619380VZKTAq','remoteId','test','toLowerCase','trim','operationType','2228XsEKDh','replace','8jDaLpV','27eqhhGd','82434eqdxTE','385574vdXLae','448VxHKMi','functionNode','after','15994CoWraT'];a224_0x4387=function(){return _0xa23845;};return a224_0x4387();}(function(_0x1f6d63,_0x2cb2f4){const _0x1aaff1=a224_0x264b,_0x4e4d6c=_0x1f6d63();while(!![]){try{const _0x32e400=parseInt(_0x1aaff1(0x160))/0x1+-parseInt(_0x1aaff1(0x165))/0x2*(-parseInt(_0x1aaff1(0x15e))/0x3)+-parseInt(_0x1aaff1(0x15b))/0x4*(-parseInt(_0x1aaff1(0x166))/0x5)+-parseInt(_0x1aaff1(0x15f))/0x6*(parseInt(_0x1aaff1(0x161))/0x7)+parseInt(_0x1aaff1(0x15d))/0x8*(parseInt(_0x1aaff1(0x168))/0x9)+-parseInt(_0x1aaff1(0x16a))/0xa*(-parseInt(_0x1aaff1(0x164))/0xb)+-parseInt(_0x1aaff1(0x16c))/0xc;if(_0x32e400===_0x2cb2f4)break;else _0x4e4d6c['push'](_0x4e4d6c['shift']());}catch(_0x89495d){_0x4e4d6c['push'](_0x4e4d6c['shift']());}}}(a224_0x4387,0xb8991));function a224_0x264b(_0x2948a9,_0x454d8f){_0x2948a9=_0x2948a9-0x15b;const _0x4387bd=a224_0x4387();let _0x264b71=_0x4387bd[_0x2948a9];return _0x264b71;}export function snakeToCamel(_0x3c658a){const _0x1db74b=a224_0x264b;return _0x3c658a[_0x1db74b(0x16f)]()[_0x1db74b(0x15c)](/_([a-z])/g,(_0x2a3878,_0x1f2ec5)=>_0x1f2ec5[_0x1db74b(0x167)]());}export function findHookLocationByRemoteId(_0x312175,_0x287fe4){const _0x37ed1f=a224_0x264b;if(!_0x287fe4)return undefined;for(const _0x2b86aa of Object[_0x37ed1f(0x16b)](_0x312175)){if(_0x2b86aa[_0x37ed1f(0x16d)]===_0x287fe4&&_0x2b86aa['datasetCode']&&_0x2b86aa[_0x37ed1f(0x171)]&&_0x2b86aa[_0x37ed1f(0x162)])return{'datasetCode':_0x2b86aa['datasetCode'],'operationType':_0x2b86aa[_0x37ed1f(0x171)],'functionNode':_0x2b86aa[_0x37ed1f(0x162)]};}return undefined;}export function extractScriptDescription(_0x3d55af){const _0x30e810=_0x3d55af['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x30e810?.[0x1]?.['trim']()||undefined;}export function isValidBffFunctionName(_0x4a3729){const _0x5185cd=a224_0x264b;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x5185cd(0x16e)](_0x4a3729);}export function normalizeHookFunctionNode(_0x42ff7d){const _0x1ebc2e=a224_0x264b;if(!_0x42ff7d)return undefined;const _0x48ee09=_0x42ff7d[_0x1ebc2e(0x170)]()[_0x1ebc2e(0x16f)]();if(_0x48ee09===_0x1ebc2e(0x169)||_0x48ee09===_0x1ebc2e(0x163))return _0x48ee09;return undefined;}
|