@lovrabet/rabetbase-cli 2.5.0-beta.6 → 2.5.0
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/api/generate-sdk-config-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/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.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/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.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-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.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/table-diff-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/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/search.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/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.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/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/domain-config.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/region.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/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/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.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2dfa45,_0x1e17ca){const _0x7f3cf5=a221_0x4436,_0x5e491b=_0x2dfa45();while(!![]){try{const _0x553f7=parseInt(_0x7f3cf5(0xf6))/0x1*(-parseInt(_0x7f3cf5(0xf2))/0x2)+parseInt(_0x7f3cf5(0xee))/0x3+parseInt(_0x7f3cf5(0xf7))/0x4+-parseInt(_0x7f3cf5(0xef))/0x5+parseInt(_0x7f3cf5(0xf4))/0x6*(-parseInt(_0x7f3cf5(0xf8))/0x7)+-parseInt(_0x7f3cf5(0xf0))/0x8+-parseInt(_0x7f3cf5(0xf1))/0x9*(-parseInt(_0x7f3cf5(0xf9))/0xa);if(_0x553f7===_0x1e17ca)break;else _0x5e491b['push'](_0x5e491b['shift']());}catch(_0x5e7760){_0x5e491b['push'](_0x5e491b['shift']());}}}(a221_0xb055,0x66058));function a221_0xb055(){const _0x4fca68=['exec','push','set','974049oEkRep','4163950BOGlGe','3422632jkitiw','423AMnIgp','152534MqAAfL','cwd','1250958pxNBib','api.ts','7SHIavN','960604qzuxuv','28UNTMIB','527980wifcoS','find','utf-8','get'];a221_0xb055=function(){return _0x4fca68;};return a221_0xb055();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x58b5de){const _0x1431a3=a221_0x4436,_0x53bace=[],_0x2e79e4=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x311b2b;while((_0x311b2b=_0x2e79e4[_0x1431a3(0xfd)](_0x58b5de))!==null){_0x53bace[_0x1431a3(0xec)]({'datasetCode':_0x311b2b[0x1],'tableName':_0x311b2b[0x2],'name':_0x311b2b[0x3],'alias':_0x311b2b[0x4]});}return _0x53bace;}export function loadAliasMap(_0x260ba7,_0x393934,_0x588034){const _0x26f744=a221_0x4436,_0x120045=_0x588034??resolve(process[_0x26f744(0xf3)](),_0x260ba7,_0x26f744(0xf5));if(cache['has'](_0x120045))return cache[_0x26f744(0xfc)](_0x120045);if(!existsSync(_0x120045))return cache['set'](_0x120045,[]),[];try{const _0x1dcdd8=readFileSync(_0x120045,_0x26f744(0xfb)),_0x1cf25a=parseApiFile(_0x1dcdd8);return cache[_0x26f744(0xed)](_0x120045,_0x1cf25a),_0x1cf25a;}catch{return cache[_0x26f744(0xed)](_0x120045,[]),[];}}export function resolveAlias(_0x7fac70,_0x467e31,_0x5e6b81,_0x521932){const _0x134ab5=a221_0x4436;if(!_0x467e31)return undefined;const _0x46bc2c=loadAliasMap(_0x7fac70,_0x5e6b81,_0x521932),_0x46dc14=_0x46bc2c[_0x134ab5(0xfa)](_0x520f6a=>_0x520f6a['alias']===_0x467e31);return _0x46dc14?.['datasetCode'];}function a221_0x4436(_0x1b0a06,_0x4f8cc7){_0x1b0a06=_0x1b0a06-0xec;const _0xb055=a221_0xb055();let _0x443691=_0xb055[_0x1b0a06];return _0x443691;}export function listAliases(_0x21c562,_0x12882c,_0x13d3b2){return loadAliasMap(_0x21c562,_0x12882c,_0x13d3b2);}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a222_0x4d58e2=a222_0xe40e;(function(_0x214d4c,_0x488dd2){const _0x273d84=a222_0xe40e,_0x176676=_0x214d4c();while(!![]){try{const _0x451f3d=-parseInt(_0x273d84(0x2bc))/0x1*(parseInt(_0x273d84(0x2d3))/0x2)+parseInt(_0x273d84(0x237))/0x3*(-parseInt(_0x273d84(0x247))/0x4)+parseInt(_0x273d84(0x2ad))/0x5+-parseInt(_0x273d84(0x2a9))/0x6+-parseInt(_0x273d84(0x2c5))/0x7*(parseInt(_0x273d84(0x1fe))/0x8)+-parseInt(_0x273d84(0x297))/0x9*(parseInt(_0x273d84(0x2ee))/0xa)+parseInt(_0x273d84(0x280))/0xb*(parseInt(_0x273d84(0x1b9))/0xc);if(_0x451f3d===_0x488dd2)break;else _0x176676['push'](_0x176676['shift']());}catch(_0x3e95db){_0x176676['push'](_0x176676['shift']());}}}(a222_0x125d,0x3cb2c));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getKbDomain,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(_0x18bec0){_activeCookie=_0x18bec0||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(a222_0x4d58e2(0x1de)),PLATFORM_ERROR_CODE=Symbol('platform-error-code');export function isPlatformTransportFailure(_0x3df08a){const _0x31d095=a222_0x4d58e2;return Boolean(_0x3df08a&&typeof _0x3df08a===_0x31d095(0x298)&&_0x3df08a[PLATFORM_TRANSPORT_FAILURE]===!![]);}export function getPlatformErrorCode(_0x5f70a){const _0x2b77eb=a222_0x4d58e2;if(!_0x5f70a||typeof _0x5f70a!=='object')return undefined;const _0x308960=_0x5f70a[PLATFORM_ERROR_CODE];return typeof _0x308960===_0x2b77eb(0x2c7)&&_0x308960?_0x308960:undefined;}function createPlatformApiError(_0xde90d0,_0x164e32){const _0x5b95fb=a222_0x4d58e2,_0x47c763=typeof _0x164e32===_0x5b95fb(0x2c7)?_0x164e32[_0x5b95fb(0x1e6)]():typeof _0x164e32==='number'?String(_0x164e32):'',_0x5cf2a1=CliErrors[_0x5b95fb(0x2b9)](_0xde90d0,_0x47c763?_0x5b95fb(0x2d8)+_0x47c763:undefined);return _0x47c763&&(Object[_0x5b95fb(0x2d9)](_0x5cf2a1,PLATFORM_ERROR_CODE,{'value':_0x47c763}),Object[_0x5b95fb(0x2d9)](_0x5cf2a1,'data',{'value':{'remoteErrorCode':_0x47c763},'enumerable':![]})),_0x5cf2a1;}function createFetchFailureError(_0x1249c6,_0x34512f){const _0x597aa1=a222_0x4d58e2,_0x5eccf7=_0x34512f instanceof Error?_0x34512f['message']:String(_0x34512f),_0x48f6a3=CliErrors[_0x597aa1(0x2b9)](_0x597aa1(0x212)+_0x1249c6+(_0x5eccf7?'\x20('+_0x5eccf7+')':''),_0x597aa1(0x25b));return Object['defineProperty'](_0x48f6a3,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x48f6a3;}function createRequestTimeoutError(_0x57a886,_0x3aa78a){const _0x17da9e=a222_0x4d58e2,_0x2a2db1=CliErrors[_0x17da9e(0x2b9)]('Request\x20timeout:\x20'+_0x57a886);return _0x3aa78a&&Object[_0x17da9e(0x2d9)](_0x2a2db1,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x2a2db1;}function createIndeterminateResponseError(_0x4dd277){const _0x3a2f36=a222_0x4d58e2,_0x4b61dc=CliErrors[_0x3a2f36(0x2b9)](_0x4dd277+_0x3a2f36(0x21b),_0x3a2f36(0x1d8));return Object[_0x3a2f36(0x2d9)](_0x4b61dc,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x4b61dc;}async function apiRequest(_0x4cf4d2,_0x2880b8={}){const _0x124fe3=a222_0x4d58e2,{method:method=_0x124fe3(0x2bb),body:_0x14c38e,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![],indeterminateMutation:indeterminateMutation=![]}=_0x2880b8,_0x2785b8=useRuntime?getRuntimeDomain():getApiDomain(),_0x451625=_activeCookie||getCookie(),_0x45d496=''+_0x2785b8+_0x4cf4d2,_0x3e9213=new AbortController(),_0x7792f=setTimeout(()=>_0x3e9213[_0x124fe3(0x1f5)](),timeout);try{const _0x2deed5=await fetch(_0x45d496,{'method':method,'headers':{'Content-Type':_0x124fe3(0x200),'Cookie':_0x451625,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x14c38e?JSON[_0x124fe3(0x296)](_0x14c38e):undefined,'signal':_0x3e9213[_0x124fe3(0x1d9)]});let _0x1c02eb;try{_0x1c02eb=await _0x2deed5[_0x124fe3(0x2de)]();}catch(_0x4886be){if(_0x2deed5['ok']&&_0x4886be instanceof Error&&_0x4886be['name']===_0x124fe3(0x1d4))throw createRequestTimeoutError(_0x45d496,indeterminateMutation);if(_0x2deed5['ok']&&indeterminateMutation)throw createIndeterminateResponseError(_0x4cf4d2);if(_0x2deed5['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x124fe3(0x2b9)](_0x124fe3(0x28a)+_0x2deed5[_0x124fe3(0x29f)]+')',_0x2deed5[_0x124fe3(0x29f)]>=0x190?_0x124fe3(0x1d0):undefined);}const _0xdfb2f3=_0x1c02eb!==null&&typeof _0x1c02eb===_0x124fe3(0x298)&&!Array[_0x124fe3(0x285)](_0x1c02eb);if(!_0x2deed5['ok']){const _0x174182=_0xdfb2f3?_0x1c02eb:undefined;throw CliErrors[_0x124fe3(0x2b9)](_0x174182?.[_0x124fe3(0x221)]||_0x174182?.[_0x124fe3(0x229)]||_0x124fe3(0x293)+_0x2deed5[_0x124fe3(0x29f)],_0x174182?.[_0x124fe3(0x1ce)]?'API\x20error\x20code:\x20'+_0x174182[_0x124fe3(0x1ce)]:undefined);}if(indeterminateMutation){if(!_0xdfb2f3)throw createIndeterminateResponseError(_0x4cf4d2);if(_0x1c02eb['success']===![])throw CliErrors['apiError'](_0x1c02eb[_0x124fe3(0x221)]||_0x1c02eb['message']||'API\x20error:\x20'+_0x2deed5[_0x124fe3(0x29f)],_0x1c02eb['errorCode']?_0x124fe3(0x2d8)+_0x1c02eb['errorCode']:undefined);if(_0x1c02eb['success']!==!![])throw createIndeterminateResponseError(_0x4cf4d2);return _0x1c02eb;}if(_0x1c02eb===null||_0x1c02eb===undefined)throw CliErrors[_0x124fe3(0x2b9)]('API\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20(HTTP\x20'+_0x2deed5[_0x124fe3(0x29f)]+')');if(_0x1c02eb[_0x124fe3(0x20e)]===![])throw CliErrors[_0x124fe3(0x2b9)](_0x1c02eb[_0x124fe3(0x221)]||_0x1c02eb[_0x124fe3(0x229)]||_0x124fe3(0x293)+_0x2deed5['status'],_0x1c02eb[_0x124fe3(0x1ce)]?_0x124fe3(0x2d8)+_0x1c02eb[_0x124fe3(0x1ce)]:undefined);return _0x1c02eb;}catch(_0x1ea8f9){if(_0x1ea8f9 instanceof CliError)throw _0x1ea8f9;if(_0x1ea8f9 instanceof Error&&_0x1ea8f9[_0x124fe3(0x1f1)]===_0x124fe3(0x1d4))throw createRequestTimeoutError(_0x45d496,indeterminateMutation);throw createFetchFailureError(_0x45d496,_0x1ea8f9);}finally{clearTimeout(_0x7792f);}}async function apiFormRequest(_0x2b509a,_0x2f3b3c,_0x3e8b34={}){const _0x40e0b3=a222_0x4d58e2,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x3e8b34,_0x318dd7=_activeCookie||getCookie(),_0x5cc5ad=''+getApiDomain()+_0x2b509a,_0x4d4cac=new AbortController(),_0x3872af=setTimeout(()=>_0x4d4cac[_0x40e0b3(0x1f5)](),timeout);try{const _0x29c239=await fetch(_0x5cc5ad,{'method':_0x40e0b3(0x2da),'headers':{'Cookie':_0x318dd7,'X-Invoke-Source':_0x40e0b3(0x290)},'body':_0x2f3b3c,'signal':_0x4d4cac['signal']});let _0x177b2c;try{_0x177b2c=await _0x29c239[_0x40e0b3(0x2de)]();}catch(_0x2d928f){if(_0x2d928f instanceof Error&&_0x2d928f[_0x40e0b3(0x1f1)]===_0x40e0b3(0x1d4))throw CliErrors['apiError'](_0x40e0b3(0x21a)+_0x5cc5ad);throw CliErrors[_0x40e0b3(0x2b9)](_0x40e0b3(0x28a)+_0x29c239['status']+')',_0x29c239[_0x40e0b3(0x29f)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x29c239['ok']||_0x177b2c[_0x40e0b3(0x20e)]===![])throw CliErrors[_0x40e0b3(0x2b9)](_0x177b2c[_0x40e0b3(0x221)]||_0x177b2c['message']||_0x40e0b3(0x293)+_0x29c239[_0x40e0b3(0x29f)],_0x177b2c['errorCode']?'API\x20error\x20code:\x20'+_0x177b2c[_0x40e0b3(0x1ce)]:undefined);return _0x177b2c;}catch(_0x1f9c44){if(_0x1f9c44 instanceof CliError)throw _0x1f9c44;if(_0x1f9c44 instanceof Error&&_0x1f9c44[_0x40e0b3(0x1f1)]===_0x40e0b3(0x1d4))throw CliErrors['apiError'](_0x40e0b3(0x21a)+_0x5cc5ad);throw createFetchFailureError(_0x5cc5ad,_0x1f9c44);}finally{clearTimeout(_0x3872af);}}export async function uploadDevelopmentFile(_0x249d8a,_0x45ec13){const _0x5a1c02=a222_0x4d58e2,_0x4cf79d=await readFile(_0x45ec13),_0x4b9ce2=new FormData();_0x4b9ce2['append']('appCode',_0x249d8a),_0x4b9ce2[_0x5a1c02(0x2b2)](_0x5a1c02(0x202),new Blob([new Uint8Array(_0x4cf79d)]),basename(_0x45ec13));const _0x162b23=await apiFormRequest('/smartapi/common/uploadFile',_0x4b9ce2);return _0x162b23[_0x5a1c02(0x2e4)];}export async function queryDevelopmentFileUrl(_0x1ea11b,_0x58eb1c={}){const _0x8f14ad=a222_0x4d58e2,_0x29d4b6=await apiRequest(_0x8f14ad(0x25e),{'method':_0x8f14ad(0x2da),'body':{'filePath':_0x1ea11b,'downloadFlag':_0x58eb1c[_0x8f14ad(0x20f)]??![],..._0x58eb1c[_0x8f14ad(0x219)]?{'longTerm':!![]}:{}}});return _0x29d4b6['data'];}export async function recognizeDevelopmentOcr(_0x2977b4,_0x4e0926){const _0x224bfb=a222_0x4d58e2,_0x33e3f5=new URLSearchParams({'url':_0x4e0926['url'],'type':_0x4e0926['type'],'appCode':_0x2977b4}),_0x427a20=await apiRequest(_0x224bfb(0x2c1)+_0x33e3f5[_0x224bfb(0x22b)](),{'method':_0x224bfb(0x2bb)});return _0x427a20[_0x224bfb(0x2e4)];}export const DING_TALK_SANDBOX_BIND_PATH='/smartapi/user-accounts/cli/dingding-sandbox/bind';export async function bindDingTalkSandboxAccount(_0x2afb83){const _0x50871b=a222_0x4d58e2,_0x545b5f=await apiRequest(DING_TALK_SANDBOX_BIND_PATH,{'method':_0x50871b(0x2da),'body':{'dingTalkUserId':_0x2afb83}});return _0x545b5f[_0x50871b(0x2e4)];}function isAuthFailure(_0x28d192){const _0xe99f37=a222_0x4d58e2,_0x568f11=_0x28d192['errorMsg']||_0x28d192[_0xe99f37(0x229)]||_0x28d192[_0xe99f37(0x2e4)]?.[_0xe99f37(0x229)]||_0x28d192[_0xe99f37(0x231)]||_0x28d192[_0xe99f37(0x29d)]||'';return _0x28d192[_0xe99f37(0x1ce)]===_0xe99f37(0x1c0)||_0x28d192[_0xe99f37(0x265)]===0x191||_0x28d192[_0xe99f37(0x265)]===_0xe99f37(0x24b)||_0x568f11[_0xe99f37(0x22c)](_0xe99f37(0x24b))||_0x568f11[_0xe99f37(0x22c)](_0xe99f37(0x2a6))||_0x568f11[_0xe99f37(0x22c)]('登录')||_0x568f11[_0xe99f37(0x22c)]('认证');}export async function platformFetch(_0x1b0fd2,_0x41efdb){const _0x47eb4c=a222_0x4d58e2;let _0x5c3ef9;try{_0x5c3ef9=await fetch(_0x1b0fd2,{'method':_0x41efdb['method']??'GET','headers':{'Content-Type':_0x47eb4c(0x200),'Cookie':_0x41efdb[_0x47eb4c(0x1dd)],'X-Invoke-Source':_0x47eb4c(0x290)},..._0x41efdb[_0x47eb4c(0x207)]&&{'body':JSON[_0x47eb4c(0x296)](_0x41efdb['body'])}});}catch(_0xbe65c4){throw createFetchFailureError(_0x1b0fd2,_0xbe65c4);}let _0x337cd3;try{_0x337cd3=await _0x5c3ef9['json']();}catch(_0x190863){if(!_0x5c3ef9['ok']){if(_0x5c3ef9[_0x47eb4c(0x29f)]===0x191)throw CliErrors['authRequired']();throw CliErrors['apiError'](_0x41efdb[_0x47eb4c(0x213)]+_0x47eb4c(0x2b3)+_0x5c3ef9[_0x47eb4c(0x29f)]);}throw createFetchFailureError(_0x1b0fd2,_0x190863);}if(_0x337cd3===null||typeof _0x337cd3!==_0x47eb4c(0x298)||Array['isArray'](_0x337cd3)){if(_0x5c3ef9[_0x47eb4c(0x29f)]===0x191)throw CliErrors['authRequired']();if(_0x5c3ef9['ok'])throw createIndeterminateResponseError(_0x41efdb['label']);throw CliErrors[_0x47eb4c(0x2b9)](_0x41efdb[_0x47eb4c(0x213)]+_0x47eb4c(0x29a)+(!_0x5c3ef9['ok']?',\x20HTTP\x20'+_0x5c3ef9[_0x47eb4c(0x29f)]:'')+':\x20invalid\x20JSON\x20response\x20envelope');}const _0xa5b656=typeof _0x337cd3[_0x47eb4c(0x1ce)]===_0x47eb4c(0x2c7)||typeof _0x337cd3[_0x47eb4c(0x1ce)]===_0x47eb4c(0x21e),_0x41ad6e=_0xa5b656?String(_0x337cd3['errorCode'])[_0x47eb4c(0x1e6)]():'',_0x128128=_0x337cd3[_0x47eb4c(0x20e)]===![]||_0xa5b656&&_0x41ad6e!==_0x47eb4c(0x1b5);if(!_0x5c3ef9['ok']||_0x128128){if(_0x5c3ef9[_0x47eb4c(0x29f)]===0x191||isAuthFailure(_0x337cd3))throw CliErrors[_0x47eb4c(0x292)]();throw createPlatformApiError(_0x337cd3['errorMsg']||_0x337cd3['message']||_0x41efdb['label']+'\x20failed'+(!_0x5c3ef9['ok']?_0x47eb4c(0x250)+_0x5c3ef9[_0x47eb4c(0x29f)]:''),_0x337cd3[_0x47eb4c(0x1ce)]??_0x337cd3[_0x47eb4c(0x265)]);}if(_0x337cd3['success']!==!![]||_0xa5b656&&_0x41ad6e!==_0x47eb4c(0x1b5))throw createIndeterminateResponseError(_0x41efdb[_0x47eb4c(0x213)]);return _0x337cd3[_0x47eb4c(0x2e4)];}export async function platformRequest(_0x17887c,_0xb32566){const _0x3bb7bb=a222_0x4d58e2;if(/^https?:\/\//i['test'](_0x17887c))throw CliErrors[_0x3bb7bb(0x1f8)]('platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20'+_0x17887c,_0x3bb7bb(0x282));const _0x536fb0=_0x17887c[_0x3bb7bb(0x2ce)]('/')?_0x17887c:'/'+_0x17887c;return platformFetch(''+getApiDomain()+_0x536fb0,_0xb32566);}export async function kbRequest(_0x1d8370,_0x50a078){const _0x11331c=a222_0x4d58e2;if(/^https?:\/\//i[_0x11331c(0x1ff)](_0x1d8370))throw CliErrors[_0x11331c(0x1f8)](_0x11331c(0x1fa)+_0x1d8370,'Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.');const _0x4f8bf5=_0x1d8370[_0x11331c(0x2ce)]('/')?_0x1d8370:'/'+_0x1d8370;return platformFetch(''+getKbDomain()+_0x4f8bf5,_0x50a078);}const MAX_KNOWLEDGE_BASE_PAGE_SIZE=0x64;function parseKnowledgeBaseInteger(_0x30bcb6,_0x4fb1e1){const _0x3030ee=a222_0x4d58e2,_0x592efc=typeof _0x30bcb6===_0x3030ee(0x21e)?_0x30bcb6:typeof _0x30bcb6===_0x3030ee(0x2c7)&&/^(0|[1-9]\d*)$/['test'](_0x30bcb6)?Number(_0x30bcb6):Number[_0x3030ee(0x23f)],_0x246ddf=Number[_0x3030ee(0x27a)](_0x592efc)&&(_0x4fb1e1==='id'?_0x592efc>0x0:_0x592efc>=0x0);if(!_0x246ddf)throw CliErrors[_0x3030ee(0x2b9)](_0x3030ee(0x1c2)+_0x4fb1e1+'.');return _0x592efc;}function parseKnowledgeBaseText(_0x1cb6a1,_0x1474dc){const _0x28fa7b=a222_0x4d58e2;if(typeof _0x1cb6a1===_0x28fa7b(0x2c7)&&(_0x1474dc===_0x28fa7b(0x21d)||_0x1cb6a1['trim']()))return _0x1cb6a1;throw CliErrors[_0x28fa7b(0x2b9)](_0x28fa7b(0x273)+_0x1474dc+'.');}function parseKnowledgeBaseRecord(_0x587d29){const _0x36fc7c=a222_0x4d58e2;if(!_0x587d29||typeof _0x587d29!=='object'||Array[_0x36fc7c(0x285)](_0x587d29))throw CliErrors[_0x36fc7c(0x2b9)](_0x36fc7c(0x251));const _0x5ce20b=_0x587d29;if(_0x5ce20b[_0x36fc7c(0x226)]!=='company'&&_0x5ce20b[_0x36fc7c(0x226)]!==_0x36fc7c(0x1d5))throw CliErrors[_0x36fc7c(0x2b9)]('Knowledge-base\x20response\x20contains\x20an\x20invalid\x20scope.');const _0x5f2a8d={'id':parseKnowledgeBaseInteger(_0x5ce20b['id'],'id'),'scope':_0x5ce20b[_0x36fc7c(0x226)],'appCode':parseKnowledgeBaseText(_0x5ce20b[_0x36fc7c(0x2dc)],_0x36fc7c(0x2dc)),'title':parseKnowledgeBaseText(_0x5ce20b[_0x36fc7c(0x27b)],_0x36fc7c(0x27b)),'version':parseKnowledgeBaseInteger(_0x5ce20b[_0x36fc7c(0x2a2)],'version'),'content':parseKnowledgeBaseText(_0x5ce20b[_0x36fc7c(0x21d)],'content')};return(_0x5ce20b['createTime']===null||typeof _0x5ce20b[_0x36fc7c(0x1c6)]===_0x36fc7c(0x2c7)||typeof _0x5ce20b[_0x36fc7c(0x1c6)]==='number')&&(_0x5f2a8d[_0x36fc7c(0x1c6)]=_0x5ce20b[_0x36fc7c(0x1c6)]),(_0x5ce20b[_0x36fc7c(0x24d)]===null||typeof _0x5ce20b[_0x36fc7c(0x24d)]===_0x36fc7c(0x2c7)||typeof _0x5ce20b[_0x36fc7c(0x24d)]==='number')&&(_0x5f2a8d[_0x36fc7c(0x24d)]=_0x5ce20b[_0x36fc7c(0x24d)]),_0x5f2a8d;}export async function listEnterpriseKnowledgeBases(_0x1b239d,_0x19aeed={}){const _0x20b75d=a222_0x4d58e2,_0x44962e=_0x19aeed[_0x20b75d(0x243)]??0x32;if(!Number[_0x20b75d(0x27a)](_0x44962e)||_0x44962e<0x1||_0x44962e>MAX_KNOWLEDGE_BASE_PAGE_SIZE)throw CliErrors['validation'](_0x20b75d(0x281)+MAX_KNOWLEDGE_BASE_PAGE_SIZE+'.');const _0x26720e=await kbRequest(_0x20b75d(0x225),{'method':_0x20b75d(0x2da),'cookie':_0x1b239d,'label':_0x20b75d(0x1f3),'body':{'currentPage':_0x19aeed[_0x20b75d(0x1ca)]??0x1,'pageSize':_0x44962e,'scope':'company',..._0x19aeed['appCode']?{'appCode':_0x19aeed[_0x20b75d(0x2dc)]}:{},..._0x19aeed['title']?{'title':_0x19aeed[_0x20b75d(0x27b)]}:{}}});if(!_0x26720e||typeof _0x26720e!==_0x20b75d(0x298)||Array[_0x20b75d(0x285)](_0x26720e)||!Array[_0x20b75d(0x285)](_0x26720e['tableData']))throw CliErrors[_0x20b75d(0x2b9)]('List\x20enterprise\x20knowledge\x20bases\x20returned\x20an\x20invalid\x20response\x20contract.');const _0x18141f=extractPaging(_0x26720e);if(!_0x18141f||!Number['isInteger'](_0x18141f[_0x20b75d(0x1ca)])||!Number[_0x20b75d(0x2d4)](_0x18141f[_0x20b75d(0x243)])||!Number[_0x20b75d(0x2d4)](_0x18141f['totalCount'])||_0x18141f[_0x20b75d(0x1ca)]<0x1||_0x18141f[_0x20b75d(0x243)]<0x1||_0x18141f[_0x20b75d(0x243)]>MAX_KNOWLEDGE_BASE_PAGE_SIZE||_0x18141f['totalCount']<0x0)throw CliErrors[_0x20b75d(0x2b9)](_0x20b75d(0x210));return{'items':extractList(_0x26720e)['map'](parseKnowledgeBaseRecord),'paging':_0x18141f};}export async function getEnterpriseKnowledgeBase(_0x296c5e,_0x5cf152){const _0x45d0e3=a222_0x4d58e2,_0x35fa4a=await kbRequest(_0x45d0e3(0x22a)+buildQuery({'id':_0x5cf152}),{'cookie':_0x296c5e,'label':_0x45d0e3(0x2e8)});return parseKnowledgeBaseRecord(_0x35fa4a);}export async function createEnterpriseKnowledgeBase(_0x358206,_0x1709e2){const _0x23cd3a=a222_0x4d58e2,_0x3c9e97=await kbRequest(_0x23cd3a(0x1b4),{'method':'POST','cookie':_0x358206,'label':_0x23cd3a(0x260),'body':{'scope':_0x23cd3a(0x2c6),..._0x1709e2}});return parseKnowledgeBaseRecord(_0x3c9e97);}export async function updateEnterpriseKnowledgeBase(_0x154520,_0x5d2abc){const _0x268b08=a222_0x4d58e2;if(_0x5d2abc[_0x268b08(0x27b)]===undefined&&_0x5d2abc[_0x268b08(0x21d)]===undefined)throw CliErrors[_0x268b08(0x1f8)]('Knowledge-base\x20update\x20requires\x20title\x20or\x20content.');const _0x3fde66=await kbRequest('/admin/knowledge-base/update',{'method':_0x268b08(0x2da),'cookie':_0x154520,'label':_0x268b08(0x2cd),'body':{'id':_0x5d2abc['id'],..._0x5d2abc[_0x268b08(0x27b)]!==undefined?{'title':_0x5d2abc[_0x268b08(0x27b)]}:{},..._0x5d2abc[_0x268b08(0x21d)]!==undefined?{'content':_0x5d2abc[_0x268b08(0x21d)]}:{}}});return parseKnowledgeBaseRecord(_0x3fde66);}export async function deleteEnterpriseKnowledgeBase(_0xc48565,_0x415661){const _0x9b2998=a222_0x4d58e2;await kbRequest(_0x9b2998(0x271),{'method':_0x9b2998(0x2da),'cookie':_0xc48565,'label':_0x9b2998(0x274),'body':{'id':_0x415661}});}function parseNullableKnowledgeSearchText(_0x464e56,_0x2e843b){const _0x284402=a222_0x4d58e2;if(_0x464e56===null||_0x464e56===undefined)return null;if(typeof _0x464e56===_0x284402(0x2c7))return _0x464e56;throw CliErrors[_0x284402(0x2b9)]('Knowledge\x20search\x20response\x20contains\x20an\x20invalid\x20'+_0x2e843b+'.');}function parseKnowledgeSearchScore(_0x4a989,_0x19f49a){const _0x4c5e65=a222_0x4d58e2;if(typeof _0x4a989===_0x4c5e65(0x21e)&&Number[_0x4c5e65(0x2b8)](_0x4a989))return _0x4a989;throw CliErrors[_0x4c5e65(0x2b9)](_0x4c5e65(0x2a4)+_0x19f49a+'.');}function parseCompanyPublicKnowledgeSearchHit(_0x20d3b9){const _0x322e72=a222_0x4d58e2;if(!_0x20d3b9||typeof _0x20d3b9!==_0x322e72(0x298)||Array[_0x322e72(0x285)](_0x20d3b9))throw CliErrors[_0x322e72(0x2b9)](_0x322e72(0x209));const _0x4d4ebd=_0x20d3b9;if(_0x4d4ebd[_0x322e72(0x226)]!==_0x322e72(0x23b)&&_0x4d4ebd[_0x322e72(0x226)]!==_0x322e72(0x2ea))throw CliErrors[_0x322e72(0x2b9)]('Knowledge\x20search\x20response\x20contains\x20an\x20invalid\x20scope.');return{'scope':_0x4d4ebd[_0x322e72(0x226)],'title':parseNullableKnowledgeSearchText(_0x4d4ebd[_0x322e72(0x27b)],_0x322e72(0x27b)),'docId':parseNullableKnowledgeSearchText(_0x4d4ebd[_0x322e72(0x267)],_0x322e72(0x267)),'score':parseKnowledgeSearchScore(_0x4d4ebd[_0x322e72(0x20d)],_0x322e72(0x20d)),'weightedScore':parseKnowledgeSearchScore(_0x4d4ebd[_0x322e72(0x206)],_0x322e72(0x206)),'content':parseNullableKnowledgeSearchText(_0x4d4ebd[_0x322e72(0x21d)],'content'),'jsonPath':parseNullableKnowledgeSearchText(_0x4d4ebd['jsonPath'],_0x322e72(0x203)),'jsonData':parseNullableKnowledgeSearchText(_0x4d4ebd[_0x322e72(0x2bd)],'jsonData')};}export async function searchCompanyPublicKnowledge(_0x257d80,_0x4711c3){const _0x1ed627=a222_0x4d58e2;if(!_0x4711c3[_0x1ed627(0x27f)][_0x1ed627(0x1e6)]())throw CliErrors[_0x1ed627(0x1f8)](_0x1ed627(0x283));if(!_0x4711c3[_0x1ed627(0x2dc)][_0x1ed627(0x1e6)]())throw CliErrors['validation'](_0x1ed627(0x241));if(_0x4711c3[_0x1ed627(0x1e3)]!==undefined&&(!Number['isSafeInteger'](_0x4711c3['topK'])||_0x4711c3['topK']<=0x0))throw CliErrors[_0x1ed627(0x1f8)](_0x1ed627(0x1d2));const _0x44aaf3=await kbRequest(_0x1ed627(0x1ed),{'method':_0x1ed627(0x2da),'cookie':_0x257d80,'label':'Search\x20company\x20and\x20public\x20knowledge','body':{'query':_0x4711c3[_0x1ed627(0x27f)],'appCode':_0x4711c3[_0x1ed627(0x2dc)],..._0x4711c3[_0x1ed627(0x1e3)]!==undefined?{'topK':_0x4711c3['topK']}:{}}});if(!_0x44aaf3||typeof _0x44aaf3!==_0x1ed627(0x298)||Array[_0x1ed627(0x285)](_0x44aaf3)||!Array[_0x1ed627(0x285)](_0x44aaf3['hits']))throw CliErrors['apiError']('Search\x20company\x20and\x20public\x20knowledge\x20returned\x20an\x20invalid\x20response\x20contract.');const _0x1fb3ff=_0x44aaf3[_0x1ed627(0x2b1)][_0x1ed627(0x2d5)](parseCompanyPublicKnowledgeSearchHit);if(_0x4711c3[_0x1ed627(0x1e3)]!==undefined&&_0x1fb3ff['length']>_0x4711c3['topK'])throw CliErrors[_0x1ed627(0x2b9)](_0x1ed627(0x1f2)+_0x1fb3ff['length']+_0x1ed627(0x1bc)+_0x4711c3[_0x1ed627(0x1e3)]+'.');return _0x1fb3ff;}function cleanNewlines(_0x29e836){const _0x487215=a222_0x4d58e2;return _0x29e836['replace'](/[\r\n]+/g,'\x20')[_0x487215(0x1e6)]();}function cleanDatasetName(_0x116868){const _0x1c353e=a222_0x4d58e2;if(!_0x116868['name'])return _0x116868;return{..._0x116868,'name':cleanNewlines(_0x116868[_0x1c353e(0x1f1)])};}export async function fetchModelList(_0x969fb,_0x5eac08){const _0x926f8d=a222_0x4d58e2,_0x464feb=getEnv(),_0x25a356=new URLSearchParams({'appcode':_0x969fb,'otype':_0x926f8d(0x25f)}),_0x4227f1='/api/node-toolbox/dataset/model-list?'+_0x25a356[_0x926f8d(0x22b)]();logger[_0x926f8d(0x214)](_0x926f8d(0x234),'Fetching\x20model\x20list\x20from\x20server...\x20(env:\x20'+_0x464feb+')',{'apiPath':_0x4227f1});const _0x522bf1=await platformRequest(_0x4227f1,{'cookie':_0x5eac08,'label':_0x926f8d(0x2b5)}),_0x55ec52=(_0x522bf1['configArray']??[])[_0x926f8d(0x2d5)](cleanDatasetName);return{'configArray':_0x55ec52,'count':_0x55ec52[_0x926f8d(0x268)]};}export async function fetchDatasetDoc(_0x428640){const _0x1f5576=a222_0x4d58e2,{appCode:_0x44bb60,cookie:_0x9705af,datasetCode:_0x1d1c0f,datasetId:_0x364814,extraParams:_0x45d091}=_0x428640,_0x165a8d=await platformRequest(_0x1f5576(0x279),{'method':_0x1f5576(0x2da),'body':{'appCode':_0x44bb60,'datasetCode':_0x1d1c0f,'datasetId':_0x364814,..._0x45d091||{}},'cookie':_0x9705af,'label':_0x1f5576(0x1bd)+_0x1d1c0f+')'});if(!_0x165a8d||typeof _0x165a8d[_0x1f5576(0x27e)]!==_0x1f5576(0x2c7))throw new Error(_0x1f5576(0x28e)+_0x1d1c0f+_0x1f5576(0x201));return _0x165a8d[_0x1f5576(0x27e)];}export async function getMenuTree(_0xb23a83,_0x21f0d5){const _0x153114=a222_0x4d58e2,_0x1e3236=new URLSearchParams({'appCode':_0xb23a83});return platformRequest(_0x153114(0x26d)+_0x1e3236[_0x153114(0x22b)](),{'cookie':_0x21f0d5,'label':_0x153114(0x2b4)});}export async function createMenuRecord(_0x37aea8,_0x4fbe53,_0x54e597){const _0x1c3a2d=a222_0x4d58e2;return platformRequest(_0x1c3a2d(0x1cc),{'method':_0x1c3a2d(0x2da),'body':_0x37aea8,'cookie':_0x4fbe53,'label':_0x54e597});}export async function updateMenuRecord(_0x40371b,_0x538248,_0x4ab700){const _0x521af2=a222_0x4d58e2;return platformRequest('/smartapi/menu/update',{'method':_0x521af2(0x2da),'body':_0x40371b,'cookie':_0x538248,'label':_0x4ab700});}export async function deleteMenuRecord(_0x58c11d,_0x3d2203,_0x1dfffa){return platformRequest('/smartapi/menu/delete',{'method':'POST','body':{'id':_0x58c11d},'cookie':_0x3d2203,'label':_0x1dfffa});}export async function batchDeleteMenuRecords(_0xecce7,_0x2aa2c7,_0x44675b){const _0x24917a=a222_0x4d58e2;return platformRequest(_0x24917a(0x244),{'method':_0x24917a(0x2da),'body':{'idList':_0xecce7},'cookie':_0x2aa2c7,'label':_0x44675b});}export async function startMenuRegroup(_0x324f5a,_0x41dcdd,_0x791483){const _0x23bf4b=a222_0x4d58e2;return platformRequest('/smartapi/menu/regroup',{'method':_0x23bf4b(0x2da),'body':_0x324f5a,'cookie':_0x41dcdd,'label':_0x791483});}export async function getAsyncTaskStatus(_0x66305b,_0xf2762,_0x4883f6){const _0x5ca664=a222_0x4d58e2,_0x25af3e=new URLSearchParams({'appCode':_0xf2762});return platformRequest(_0x5ca664(0x2ed)+encodeURIComponent(_0x66305b)+'?'+_0x25af3e['toString'](),{'cookie':_0x4883f6,'label':_0x5ca664(0x2be)+_0x66305b});}export async function listBffScripts(_0xb6bc6,_0x2f1624,_0x282d5f){const _0x16f414=a222_0x4d58e2;let _0x460904=_0x16f414(0x2e5)+_0xb6bc6;if(_0x2f1624)_0x460904+=_0x16f414(0x2bf)+_0x2f1624;const _0x4b0cf7=await apiRequest(_0x460904);let _0x35a7c4=extractList(_0x4b0cf7[_0x16f414(0x2e4)]);if(_0x282d5f?.[_0x16f414(0x2b6)]){const _0x4f244d=_0x282d5f[_0x16f414(0x2b6)][_0x16f414(0x2ac)]();_0x35a7c4=_0x35a7c4['filter'](_0x417e34=>_0x417e34[_0x16f414(0x218)]?.[_0x16f414(0x2ac)]()[_0x16f414(0x22c)](_0x4f244d)||_0x417e34[_0x16f414(0x2ca)]?.['toLowerCase']()['includes'](_0x4f244d));}return _0x35a7c4;}export async function getBffScriptInfo(_0x44cd98){const _0x26e796=a222_0x4d58e2,_0x3d69e6=await apiRequest(_0x26e796(0x2b0)+_0x44cd98);if(!_0x3d69e6[_0x26e796(0x2e4)])throw CliErrors['validation'](_0x26e796(0x233)+_0x44cd98);return _0x3d69e6[_0x26e796(0x2e4)];}export async function saveBffScript(_0x3b752f){const _0x18be2a=a222_0x4d58e2,_0x11d93d=await apiRequest(_0x18be2a(0x289),{'method':_0x18be2a(0x2da),'body':_0x3b752f}),{id:_0x55b525,entity:_0x23a5ae}=normalizeEntityWithIdResponse(_0x11d93d[_0x18be2a(0x2e4)]);if(_0x55b525!==undefined){const _0x472f08=typeof _0x23a5ae['functionName']===_0x18be2a(0x2c7)||typeof _0x23a5ae[_0x18be2a(0x1e1)]===_0x18be2a(0x2c7)?_0x23a5ae:undefined;return{'id':_0x55b525,'script':_0x472f08};}throw CliErrors[_0x18be2a(0x2b9)](_0x18be2a(0x272));}export async function deleteBffScript(_0x42af53){const _0x46935b=a222_0x4d58e2;await apiRequest(_0x46935b(0x2c4),{'method':_0x46935b(0x2da),'body':{'id':_0x42af53}});}export async function getBffScriptStatistics(_0x203cfc){const _0x51f9d8=a222_0x4d58e2,_0x38a9be=await apiRequest(_0x51f9d8(0x258)+_0x203cfc);return extractList(_0x38a9be[_0x51f9d8(0x2e4)]);}export async function clearBffScriptCache(){const _0x43d28b=a222_0x4d58e2,_0x471bd1=await apiRequest(_0x43d28b(0x2ec),{'method':_0x43d28b(0x2da),'useRuntime':!![]});return typeof _0x471bd1[_0x43d28b(0x2e4)]===_0x43d28b(0x2c7)?_0x471bd1[_0x43d28b(0x2e4)]:'';}export async function listBffDatasetOperations(_0x5993fc,_0x262896){const _0x4e808a=a222_0x4d58e2,_0x11851c=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x4e808a(0x2da),'body':{'appCode':_0x5993fc,'datasetId':_0x262896}});return _0x11851c['data'];}export async function listSqlQueries(_0x3ea5f2,_0x43e5a7){const _0x46358c=a222_0x4d58e2,_0x1bda5f=await apiRequest(_0x46358c(0x2af),{'method':_0x46358c(0x2da),'body':{'appCode':_0x3ea5f2,'currentPage':_0x43e5a7?.['currentPage']??0x1,'pageSize':_0x43e5a7?.[_0x46358c(0x243)]??0x32,'sqlCode':_0x43e5a7?.['sqlCode'],'sqlName':_0x43e5a7?.[_0x46358c(0x217)]}});return _0x1bda5f[_0x46358c(0x2e4)];}export async function getSqlQueryInfo(_0x494d7e,_0x430528){const _0x56a88c=a222_0x4d58e2,_0x540e67=await listSqlQueries(_0x494d7e,{'sqlCode':_0x430528}),_0x268cbc=_0x540e67[_0x56a88c(0x1c7)]?.[0x0];if(!_0x268cbc)throw CliErrors[_0x56a88c(0x1f8)](_0x56a88c(0x222)+_0x430528);return _0x268cbc;}export async function getSqlQueryDetail(_0x364d23){const _0x496db0=a222_0x4d58e2,_0x5ba2b7=await apiRequest(_0x496db0(0x232)+(_0x496db0(0x1ec)+encodeURIComponent(_0x364d23)));if(!_0x5ba2b7[_0x496db0(0x2e4)])throw CliErrors[_0x496db0(0x1f8)](_0x496db0(0x222)+_0x364d23);return _0x5ba2b7['data'];}export async function getSqlQueryDetailById(_0x472338){const _0x171335=a222_0x4d58e2,_0x527dfc=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x472338);if(!_0x527dfc[_0x171335(0x2e4)])throw CliErrors[_0x171335(0x1f8)](_0x171335(0x1f0)+_0x472338);return _0x527dfc[_0x171335(0x2e4)];}export async function createSqlQuery(_0x1d6f35){const _0x507e58=a222_0x4d58e2,_0x3136ec=await apiRequest(_0x507e58(0x2aa),{'method':'POST','body':_0x1d6f35}),{id:_0x1dc8cb,entity:_0x58fe9f}=normalizeEntityWithIdResponse(_0x3136ec[_0x507e58(0x2e4)]);if(!(_0x507e58(0x1ba)in _0x58fe9f)&&_0x1dc8cb)return getSqlQueryDetailById(_0x1dc8cb);return normalizeSqlQueryEntity(_0x58fe9f);}export async function updateSqlQuery(_0x5a3a0e){const _0x29f127=a222_0x4d58e2,_0x29986f=await apiRequest(_0x29f127(0x1da),{'method':_0x29f127(0x2da),'body':_0x5a3a0e}),{id:_0x36df55,entity:_0x2fbe29}=normalizeEntityWithIdResponse(_0x29986f[_0x29f127(0x2e4)]);if(!(_0x29f127(0x1ba)in _0x2fbe29)){if(_0x5a3a0e[_0x29f127(0x1ba)])return getSqlQueryDetail(_0x5a3a0e['sqlCode']);if(_0x36df55)return getSqlQueryDetailById(_0x36df55);}return normalizeSqlQueryEntity(_0x2fbe29);}export async function deleteSqlQuery(_0x27dc90){const _0x2f260b=a222_0x4d58e2;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x2f260b(0x2da),'body':_0x27dc90});}export async function saveSqlQuery(_0x50220e){const _0x1842ff=a222_0x4d58e2,_0x2c84da=await apiRequest(_0x1842ff(0x1ea),{'method':_0x1842ff(0x2da),'body':_0x50220e});return _0x2c84da[_0x1842ff(0x2e4)];}function normalizeSqlQueryEntity(_0x3e6c38){const _0x549711=a222_0x4d58e2;return{..._0x3e6c38,'id':Number(_0x3e6c38['id']),'dbId':_0x3e6c38[_0x549711(0x205)]==null?undefined:Number(_0x3e6c38[_0x549711(0x205)]),'version':_0x3e6c38[_0x549711(0x2a2)]==null?undefined:Number(_0x3e6c38['version'])};}export async function executeSql(_0x56080d,_0x30c0c4,_0x4d5319){const _0x48da2d=a222_0x4d58e2,_0x553edc=await apiRequest(_0x48da2d(0x1e8),{'method':_0x48da2d(0x2da),'body':{'appCode':_0x56080d,'sqlCode':_0x30c0c4,..._0x4d5319&&{'params':_0x4d5319}},'useRuntime':!![]});return _0x553edc[_0x48da2d(0x2e4)];}export async function executeDatasetDataOperation(_0x46d830,_0x43f7cb,_0xa5ffc7,_0x3d0dc0={}){const _0x2707f4=a222_0x4d58e2;try{const _0x47d6fb=await apiRequest(_0x2707f4(0x25c)+_0x46d830+'/'+_0x43f7cb+'/'+_0xa5ffc7,{'method':_0x2707f4(0x2da),'body':_0x3d0dc0,'useRuntime':!![]});return _0x47d6fb[_0x2707f4(0x2e4)];}catch(_0x33dbca){if(_0xa5ffc7==='getOne'&&_0x33dbca instanceof CliError&&_0x33dbca[_0x2707f4(0x265)]==='api_error'&&_0x3d0dc0['id']!==undefined&&_0x3d0dc0['id']!==null&&_0x3d0dc0['id']!==''){const _0x2a133e=await apiRequest(_0x2707f4(0x25c)+_0x46d830+'/'+_0x43f7cb+_0x2707f4(0x294),{'method':_0x2707f4(0x2da),'body':{'where':{'id':{'$eq':_0x3d0dc0['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0xa4b565=Array[_0x2707f4(0x285)](_0x2a133e[_0x2707f4(0x2e4)]?.[_0x2707f4(0x1c7)])?_0x2a133e[_0x2707f4(0x2e4)][_0x2707f4(0x1c7)]:[];return _0xa4b565[0x0]??null;}throw _0x33dbca;}}export async function listDatasets(_0x7cd508,_0xe84709){const _0x537b78=a222_0x4d58e2,_0x57c904={'appCode':_0x7cd508,'deleted':_0xe84709?.[_0x537b78(0x20b)]??![]};if(_0xe84709?.['code'])_0x57c904[_0x537b78(0x265)]=_0xe84709[_0x537b78(0x265)];if(_0xe84709?.['name'])_0x57c904['name']=_0xe84709['name'];if(_0xe84709?.[_0x537b78(0x1c1)])_0x57c904[_0x537b78(0x1c1)]=_0xe84709[_0x537b78(0x1c1)];const _0x557d0d=await apiRequest(_0x537b78(0x1b2),{'method':_0x537b78(0x2da),'body':_0x57c904});return extractList(_0x557d0d[_0x537b78(0x2e4)]);}export async function deleteDataset(_0x1e9dc6,_0xcf7631){const _0x565094=a222_0x4d58e2;await apiRequest(_0x565094(0x1cd)+(_0xcf7631?_0x565094(0x1b3):_0x565094(0x2d0)),{'method':'POST','body':{'id':_0x1e9dc6}});}export async function restoreDataset(_0x2e80e7,_0x3636fc){const _0xaf2864=a222_0x4d58e2;await apiRequest(_0xaf2864(0x1b1),{'method':_0xaf2864(0x2da),'body':{'appCode':_0x2e80e7,'datasetId':_0x3636fc}});}export async function listRecycleBinResources(_0x2bbc4a,_0x3fa411,_0x2fe9e7){const _0xb07336=a222_0x4d58e2,_0x1dfb3e=new URLSearchParams({'appCode':_0x2bbc4a,'resourceType':_0x3fa411,'currentPage':String(_0x2fe9e7[_0xb07336(0x1ca)]),'pageSize':String(_0x2fe9e7[_0xb07336(0x243)])});if(_0x2fe9e7[_0xb07336(0x216)])_0x1dfb3e[_0xb07336(0x2a1)]('resourceName',_0x2fe9e7['resourceName']);const _0x57032f=await apiRequest(_0xb07336(0x1eb)+_0x1dfb3e[_0xb07336(0x22b)]());return{'items':extractList(_0x57032f['data']),'paging':extractPaging(_0x57032f['data'])};}export async function restoreRecycleBinResource(_0x4b9761){const _0x53d74c=a222_0x4d58e2;await apiRequest(_0x53d74c(0x1e9),{'method':_0x53d74c(0x2da),'body':{'id':_0x4b9761}});}export async function previewTextGeneratedDataset(_0x3e1edc,_0xb5506d){const _0x44fa7a=a222_0x4d58e2,_0x3f5375=await apiRequest(_0x44fa7a(0x20a),{'method':_0x44fa7a(0x2da),'body':{'appCode':_0x3e1edc,'datasetName':_0xb5506d[_0x44fa7a(0x1ef)],'requirementDescription':_0xb5506d[_0x44fa7a(0x27d)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x3f5375[_0x44fa7a(0x2e4)];}export async function startTextGeneratedDataset(_0x1674a4,_0x5e7e96,_0x25ef04){const _0x111915=a222_0x4d58e2,_0x5abf9f=await apiRequest(_0x111915(0x259),{'method':_0x111915(0x2da),'body':{'appCode':_0x1674a4,..._0x25ef04?.[_0x111915(0x242)]?{'clientOperationId':_0x25ef04[_0x111915(0x242)]}:{},'design':_0x5e7e96},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5abf9f[_0x111915(0x2e4)];}export async function getTextGeneratedDatasetStatus(_0x454688,_0x346dfe){const _0x339de6=a222_0x4d58e2,_0x19fb16=new URLSearchParams({'appCode':_0x454688});if(_0x346dfe['taskId'])_0x19fb16['set']('operationId',_0x346dfe['taskId']);else{if(_0x346dfe[_0x339de6(0x1d7)])_0x19fb16[_0x339de6(0x2a1)](_0x339de6(0x1d7),_0x346dfe[_0x339de6(0x1d7)]);else _0x346dfe[_0x339de6(0x242)]&&_0x19fb16[_0x339de6(0x2a1)](_0x339de6(0x242),_0x346dfe[_0x339de6(0x242)]);}const _0x51df03=await apiRequest(_0x339de6(0x215)+_0x19fb16['toString']());return _0x51df03[_0x339de6(0x2e4)];}export async function searchDatasets(_0x2d983b,_0x1a190c){const _0x18bbcd=a222_0x4d58e2,_0x27e02b=await listDatasets(_0x2d983b,{'name':_0x1a190c}),_0x24b4cc=_0x1a190c['toLowerCase'](),_0x2364a9=new Set(_0x27e02b[_0x18bbcd(0x2d5)](_0x38132f=>_0x38132f['id'])),_0x211407=_0x27e02b[_0x18bbcd(0x2eb)](_0x5b645c=>_0x5b645c[_0x18bbcd(0x220)]?.[_0x18bbcd(0x2e0)]?.[_0x18bbcd(0x2ac)]()[_0x18bbcd(0x22c)](_0x24b4cc)||_0x5b645c[_0x18bbcd(0x2ca)]?.[_0x18bbcd(0x2ac)]()[_0x18bbcd(0x22c)](_0x24b4cc)),_0x2ba191=await listDatasets(_0x2d983b,{'code':_0x1a190c});for(const _0x5dbfb0 of _0x2ba191){!_0x2364a9[_0x18bbcd(0x2c8)](_0x5dbfb0['id'])&&(_0x27e02b[_0x18bbcd(0x26f)](_0x5dbfb0),_0x2364a9[_0x18bbcd(0x1bb)](_0x5dbfb0['id']));}return _0x27e02b;}export function normalizeDatasetOperations(_0x38f5ec){const _0x3f0ca4=a222_0x4d58e2;if(Array['isArray'](_0x38f5ec))return _0x38f5ec[_0x3f0ca4(0x2eb)](_0x475590=>_0x475590!=null&&typeof _0x475590==='object');if(_0x38f5ec&&typeof _0x38f5ec==='object')return Object[_0x3f0ca4(0x239)](_0x38f5ec)[_0x3f0ca4(0x2eb)](([,_0x141bec])=>_0x141bec!=null&&typeof _0x141bec===_0x3f0ca4(0x298))[_0x3f0ca4(0x2d5)](([_0x200f49,_0x1b6cb1])=>({..._0x1b6cb1,'name':_0x1b6cb1[_0x3f0ca4(0x1f1)]??_0x1b6cb1[_0x3f0ca4(0x278)]??_0x200f49}));return[];}export async function getDatasetDetail(_0x1a8d9b){const _0x4215e7=a222_0x4d58e2,_0x32f0a4=/^\d+$/['test'](_0x1a8d9b)?'id':_0x4215e7(0x265),_0x1e8821=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x32f0a4+'='+_0x1a8d9b);return _0x1e8821[_0x4215e7(0x2e4)];}export async function updateDrivenData(_0x3f0512){const _0x22a48a=a222_0x4d58e2,_0x11c5e1=await apiRequest(_0x22a48a(0x1e7),{'method':'POST','body':_0x3f0512});return _0x11c5e1[_0x22a48a(0x2e4)];}export async function getDatasetOperations(_0x25eebe){const _0x1512b1=a222_0x4d58e2,_0x5c674d=await getDatasetDetail(_0x25eebe),_0x199ce8=normalizeDatasetOperations(_0x5c674d[_0x1512b1(0x26c)])[_0x1512b1(0x2d5)](_0x38b3a4=>({'name':_0x38b3a4[_0x1512b1(0x1f1)]||_0x38b3a4[_0x1512b1(0x278)],'displayName':_0x38b3a4['displayName']||_0x38b3a4['name'],'type':_0x38b3a4[_0x1512b1(0x2d6)],'method':_0x38b3a4[_0x1512b1(0x2e6)],'path':_0x38b3a4[_0x1512b1(0x2e9)],'enabled':_0x38b3a4[_0x1512b1(0x2b7)]??!![],'requestFields':_0x38b3a4['requestFields'],'responseFields':_0x38b3a4['responseFields']}));return{'dataset':{'id':_0x5c674d['id']??_0x5c674d[_0x1512b1(0x1be)],'name':_0x5c674d['name'],'code':_0x5c674d[_0x1512b1(0x265)]||_0x5c674d[_0x1512b1(0x2cb)],'tableName':_0x5c674d[_0x1512b1(0x2e0)]||_0x5c674d['dbtableConfig']?.['tableName']},'operations':_0x199ce8};}export async function getOperationDetail(_0x3c65ef,_0x4a0b2e,_0x13f5f2){const _0x4f31a9=a222_0x4d58e2;let _0x20b275=_0x4a0b2e;if(!/^\d+$/['test'](_0x4a0b2e)){const _0x363aa1=await listDatasets(_0x3c65ef,{'code':_0x4a0b2e}),_0x3128c9=_0x363aa1[_0x4f31a9(0x2a8)](_0x42efc9=>_0x42efc9[_0x4f31a9(0x265)]===_0x4a0b2e||String(_0x42efc9['id'])===_0x4a0b2e);if(!_0x3128c9)throw CliErrors[_0x4f31a9(0x1f8)]('Dataset\x20not\x20found:\x20'+_0x4a0b2e);_0x20b275=String(_0x3128c9['id']);}const _0x134906=await getDatasetDetail(_0x20b275),_0x1542aa=normalizeDatasetOperations(_0x134906[_0x4f31a9(0x26c)])['find'](_0x3d0b58=>(_0x3d0b58[_0x4f31a9(0x1f1)]||_0x3d0b58[_0x4f31a9(0x278)])===_0x13f5f2);if(!_0x1542aa)throw CliErrors[_0x4f31a9(0x1f8)](_0x4f31a9(0x2c3)+_0x13f5f2+_0x4f31a9(0x1dc)+_0x4a0b2e);return{'dataset':{'id':_0x134906['id']??_0x134906[_0x4f31a9(0x1be)],'name':_0x134906[_0x4f31a9(0x1f1)],'code':_0x134906[_0x4f31a9(0x265)]||_0x134906[_0x4f31a9(0x2cb)],'tableName':_0x134906[_0x4f31a9(0x2e0)]||_0x134906['dbtableConfig']?.[_0x4f31a9(0x2e0)]},'operation':_0x1542aa};}export async function getAppInfo(_0x4aadaf){const _0x6668c2=a222_0x4d58e2,_0x335b77=await apiRequest(_0x6668c2(0x23a)+buildQuery({'appCode':_0x4aadaf}));return _0x335b77[_0x6668c2(0x2e4)];}export async function getI18nInfo(_0x58218d){const _0x5b3a9e=a222_0x4d58e2,_0x3aa199=await getAppInfo(_0x58218d);return{'enableI18n':_0x3aa199[_0x5b3a9e(0x276)],..._0x3aa199[_0x5b3a9e(0x256)]};}export async function createCustomPage(_0x7991ec){const _0x19b3a7=a222_0x4d58e2,_0x1cc248=await apiRequest('/smartapi/webcode/page/create',{'method':_0x19b3a7(0x2da),'body':{'appCode':_0x7991ec[_0x19b3a7(0x2dc)],'pageName':_0x7991ec[_0x19b3a7(0x29c)],..._0x7991ec[_0x19b3a7(0x264)]!=null?{'parentMenuId':_0x7991ec[_0x19b3a7(0x264)]}:{},'createMenu':_0x7991ec[_0x19b3a7(0x240)],'codeContent':_0x7991ec[_0x19b3a7(0x2a5)]}});return{'pageId':_0x1cc248[_0x19b3a7(0x2e4)][_0x19b3a7(0x1c8)],'pageName':_0x1cc248['data'][_0x19b3a7(0x23d)]??_0x7991ec[_0x19b3a7(0x29c)],'appCode':_0x7991ec[_0x19b3a7(0x2dc)],'version':_0x1cc248[_0x19b3a7(0x2e4)][_0x19b3a7(0x2dd)]??0x0,'menuId':_0x1cc248[_0x19b3a7(0x2e4)]['menu']?.['id']??null,'menuPath':_0x1cc248['data'][_0x19b3a7(0x2e7)]?.[_0x19b3a7(0x2e9)]??null,'files':_0x1cc248[_0x19b3a7(0x2e4)][_0x19b3a7(0x2a5)]};}export async function updateCustomPageContent(_0x23a823){const _0x44b740=a222_0x4d58e2,_0xd63263=await apiRequest('/smartapi/webcode/page/update/content',{'method':_0x44b740(0x2da),'body':{'id':_0x23a823['pageId'],'codeContent':_0x23a823['pageContent']}});return{'pageId':_0x23a823[_0x44b740(0x1c8)],'newVersion':_0xd63263[_0x44b740(0x2e4)]};}export async function publishCustomPage(_0x5ab880){const _0x3443fd=a222_0x4d58e2,_0x3ead9a=await apiRequest('/smartapi/webcode/file/publish',{'method':_0x3443fd(0x2da),'body':{'id':_0x5ab880[_0x3443fd(0x1c8)],..._0x5ab880[_0x3443fd(0x246)]?{'remark':_0x5ab880[_0x3443fd(0x246)]}:{}}});return _0x3ead9a[_0x3443fd(0x2e4)];}export async function getCustomPageSource(_0x572f53){const _0xf31609=a222_0x4d58e2,_0x54b117=await apiRequest('/smartapi/webcode/page/detail'+buildQuery({'id':_0x572f53}));if(!_0x54b117[_0xf31609(0x2e4)])throw CliErrors[_0xf31609(0x1f8)](_0xf31609(0x2cf)+_0x572f53);return _0x54b117[_0xf31609(0x2e4)];}export async function startGenerateDataListPages(_0x45bd67,_0x35684a,_0x4c1e22){const _0x4170fa=a222_0x4d58e2,_0x4c2695=await apiRequest(_0x4170fa(0x1db)+_0x35684a+_0x4170fa(0x1cb),{'method':_0x4170fa(0x2da),'body':{'appCode':_0x45bd67,..._0x4c1e22?.[_0x4170fa(0x242)]?{'clientOperationId':_0x4c1e22[_0x4170fa(0x242)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x4c2695[_0x4170fa(0x2e4)];}export async function getGenerateDataListPagesStatus(_0x1ebc3b,_0xbafd9a,_0x4f1b19){const _0x32872f=a222_0x4d58e2,_0x290b97=_0x4f1b19['taskId']?.[_0x32872f(0x1e6)](),_0x57b888=_0x4f1b19[_0x32872f(0x1d7)]?.[_0x32872f(0x1e6)](),_0x18614b=_0x4f1b19[_0x32872f(0x242)]?.[_0x32872f(0x1e6)](),_0x2f5f05=[_0x290b97,_0x57b888,_0x18614b][_0x32872f(0x2eb)](Boolean)[_0x32872f(0x268)];if(_0x2f5f05!==0x1)throw CliErrors[_0x32872f(0x1f8)](_0x32872f(0x29e));const _0x1c0725=new URLSearchParams({'appCode':_0x1ebc3b});_0x290b97&&_0x1c0725['set']('taskId',_0x290b97);_0x57b888&&_0x1c0725[_0x32872f(0x2a1)](_0x32872f(0x1d7),_0x57b888);_0x18614b&&_0x1c0725[_0x32872f(0x2a1)](_0x32872f(0x242),_0x18614b);const _0x11df2f=await apiRequest(_0x32872f(0x1db)+_0xbafd9a+_0x32872f(0x23e)+_0x1c0725[_0x32872f(0x22b)]());return _0x11df2f[_0x32872f(0x2e4)];}export async function getDataListPageStatus(_0x1506ba,_0x249705){const _0x3976c9=a222_0x4d58e2,_0x2bdfd0=await apiRequest(_0x3976c9(0x1db)+_0x249705+_0x3976c9(0x284)+encodeURIComponent(_0x1506ba));return _0x2bdfd0[_0x3976c9(0x2e4)];}export async function tryGetDataListPageStatus(_0xb9c300,_0x1a5192){const _0x496b1e=a222_0x4d58e2;try{return await getDataListPageStatus(_0xb9c300,_0x1a5192);}catch(_0xf2ffd9){if(_0xf2ffd9 instanceof CliError&&_0xf2ffd9[_0x496b1e(0x265)]===_0x496b1e(0x20c)&&/404|not found|non-json response/i[_0x496b1e(0x1ff)](_0xf2ffd9[_0x496b1e(0x229)]))return null;throw _0xf2ffd9;}}export async function syncDataListPages(_0x49b76b,_0x4054f3){const _0x5a4545=a222_0x4d58e2,_0x3fcc80=await apiRequest(_0x5a4545(0x1db)+_0x4054f3+_0x5a4545(0x2db),{'method':_0x5a4545(0x2da),'body':{'appCode':_0x49b76b}});return _0x3fcc80['data'];}export async function getPageDetail(_0x41c5b4){const _0x8eb106=a222_0x4d58e2,_0x148149=await apiRequest(_0x8eb106(0x2a3)+_0x41c5b4);if(!_0x148149[_0x8eb106(0x2e4)])throw CliErrors[_0x8eb106(0x1f8)](_0x8eb106(0x1ee)+_0x41c5b4);return _0x148149[_0x8eb106(0x2e4)];}export async function listDeletedPages(_0x34b3f1,_0x45ed68,_0x5c4aa9){const _0x1511e4=a222_0x4d58e2,_0x409a0e=toBackendDeletedPageType(_0x45ed68),_0x267bf7=new URLSearchParams({'appCode':_0x34b3f1,'type':_0x409a0e,'currentPage':String(_0x5c4aa9[_0x1511e4(0x1ca)]),'pageSize':String(_0x5c4aa9[_0x1511e4(0x243)])}),_0x53bb5a=await apiRequest(_0x1511e4(0x1c4)+_0x267bf7[_0x1511e4(0x22b)]());return{..._0x53bb5a['data'],'tableData':(_0x53bb5a[_0x1511e4(0x2e4)][_0x1511e4(0x1c7)]??[])[_0x1511e4(0x2d5)](_0x3ac364=>{const _0x3286eb=_0x1511e4;if(_0x3ac364[_0x3286eb(0x2ab)]!==undefined&&_0x3ac364[_0x3286eb(0x2ab)]!==_0x409a0e)throw CliErrors[_0x3286eb(0x2b9)](_0x3286eb(0x223)+_0x45ed68+'.');return{..._0x3ac364,'pageType':_0x45ed68};})};}export async function restoreDataListPage(_0x234c1b){const _0x188442=a222_0x4d58e2;await apiRequest(_0x188442(0x26a),{'method':_0x188442(0x2da),'body':{'id':_0x234c1b}});}export async function restoreCustomPage(_0xe75f9a,_0x11a24b){const _0x143dc3=await apiRequest('/smartapi/webcode/page/restore',{'method':'POST','body':{'appCode':_0xe75f9a,'id':_0x11a24b}});return _0x143dc3['data'];}function toBackendDeletedPageType(_0x3bd6dd){const _0x53315f=a222_0x4d58e2;return _0x3bd6dd===_0x53315f(0x2ef)?_0x53315f(0x236):_0x53315f(0x21c);}export async function updatePage(_0xeb175f,_0xf78549,_0x44f4f5,_0x3a93c8){const _0x41c5cc=a222_0x4d58e2,_0x28448a=await apiRequest('/smartapi/lovrabet/update-page',{'method':_0x41c5cc(0x2da),'body':{'appCode':_0xeb175f,'pageId':_0xf78549,'code':_0x44f4f5,'datasetIds':_0x3a93c8}});return _0x28448a['data'];}export function generateSdkCode(_0x1c0dbe,_0x54a116,_0x1951b2){const _0x217d69=a222_0x4d58e2,_0x1bca47=_0x1951b2?.[_0x217d69(0x2e1)]??!![],_0x5ba425=_0x217d69(0x248)+_0x1c0dbe['code']?.[_0x217d69(0x1d6)](/-/g,'_'),_0x5d85db=_0x54a116[_0x217d69(0x1f1)]||_0x54a116[_0x217d69(0x278)]||_0x217d69(0x2eb),_0x334ea0=[];_0x1bca47&&_0x334ea0['push'](_0x217d69(0x2e2),'',_0x217d69(0x1fc),'');_0x334ea0[_0x217d69(0x26f)](_0x217d69(0x1c5)+_0x1c0dbe[_0x217d69(0x1f1)]+'\x20('+(_0x1c0dbe['tableName']||_0x217d69(0x25a))+')');if(_0x5d85db===_0x217d69(0x2eb))_0x334ea0[_0x217d69(0x26f)](_0x217d69(0x28d)+_0x5ba425+'.filter({',_0x217d69(0x261),_0x217d69(0x21f),_0x217d69(0x1cf),_0x217d69(0x28c));else{if(_0x5d85db===_0x217d69(0x25d))_0x334ea0[_0x217d69(0x26f)]('const\x20result\x20=\x20await\x20client.models.'+_0x5ba425+_0x217d69(0x26b));else{if(_0x5d85db===_0x217d69(0x253))_0x334ea0[_0x217d69(0x26f)]('const\x20result\x20=\x20await\x20client.models.'+_0x5ba425+_0x217d69(0x2a7));else{if(_0x5d85db==='update')_0x334ea0['push']('const\x20result\x20=\x20await\x20client.models.'+_0x5ba425+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x5d85db==='delete'||_0x5d85db===_0x217d69(0x211)?_0x334ea0[_0x217d69(0x26f)](_0x217d69(0x28d)+_0x5ba425+_0x217d69(0x245)):_0x334ea0[_0x217d69(0x26f)](_0x217d69(0x28d)+_0x5ba425+'.'+_0x5d85db+_0x217d69(0x1f6));}}}return _0x334ea0[_0x217d69(0x286)]('\x0a');}export function generateSqlCodeTemplate(_0x422f3c,_0x4e06b6){const _0xd0dea6=a222_0x4d58e2,_0x1ecd7c=_0x4e06b6?.[_0xd0dea6(0x1f9)]??'sdk',_0x56abc6=_0x4e06b6?.[_0xd0dea6(0x2e1)]??!![],_0x458768=[];return _0x458768['push'](_0x1ecd7c===_0xd0dea6(0x275)?_0xd0dea6(0x262)+_0x422f3c['sqlName']:_0xd0dea6(0x262)+_0x422f3c[_0xd0dea6(0x217)]+'\x20('+_0x422f3c['sqlCode']+')'),_0x1ecd7c==='sdk'?(_0x56abc6&&_0x458768[_0xd0dea6(0x26f)](_0xd0dea6(0x2e2),'',_0xd0dea6(0x1fc),''),_0x458768[_0xd0dea6(0x26f)](_0xd0dea6(0x22e),_0xd0dea6(0x252)+_0x422f3c[_0xd0dea6(0x1ba)]+'\x27,',_0xd0dea6(0x1f4),_0xd0dea6(0x28c),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0xd0dea6(0x26e))):_0x458768['push']('//\x20Backend\x20Function\x20context:\x20resolve\x20Custom\x20SQL\x20by\x20its\x20stable\x20semantic\x20name;\x20rows\x20are\x20returned\x20directly',_0xd0dea6(0x277),_0xd0dea6(0x238)+JSON[_0xd0dea6(0x296)](_0x422f3c['sqlName'])+_0xd0dea6(0x269),'\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0xd0dea6(0x235),_0xd0dea6(0x224),'}'),_0x458768[_0xd0dea6(0x286)]('\x0a');}export async function getErConfig(_0x2349ed,_0x4355ef){const _0x2929c1=a222_0x4d58e2,_0x500662=await apiRequest(_0x2929c1(0x288),{'method':'POST','body':{'appCode':_0x2349ed,'dblinkId':_0x4355ef},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x500662['data'];}export async function getErRelationDetail(_0x5df297,_0x6a329c){const _0x1d1888=a222_0x4d58e2,_0x4e2014=new URLSearchParams({'appCode':_0x5df297,'relationId':String(_0x6a329c)});try{const _0x35400e=await apiRequest(_0x1d1888(0x1e0)+_0x4e2014[_0x1d1888(0x22b)]());return _0x35400e[_0x1d1888(0x2e4)]?.['relation']??null;}catch(_0x39cfe9){if(_0x39cfe9 instanceof CliError&&_0x39cfe9['code']==='api_error'&&(_0x39cfe9[_0x1d1888(0x1bf)]?.[_0x1d1888(0x22c)](_0x1d1888(0x2ba))||_0x39cfe9[_0x1d1888(0x1bf)]===_0x1d1888(0x1d1)&&_0x39cfe9['message']==='ER\x20relation\x20does\x20not\x20exist'))return null;throw _0x39cfe9;}}export async function createErRelation(_0x5b32b7){const _0x5dbe14=a222_0x4d58e2,_0x414e59=await apiRequest('/smartapi/question/er-config/cli/erCreate',{'method':_0x5dbe14(0x2da),'body':_0x5b32b7,'allowNonJsonSuccess':!![]});return _0x414e59[_0x5dbe14(0x2e4)];}export async function updateErRelation(_0x32e30f){const _0x34feb8=a222_0x4d58e2,_0x1dcc7c=await apiRequest(_0x34feb8(0x2d7),{'method':'POST','body':_0x32e30f,'allowNonJsonSuccess':!![]});return _0x1dcc7c[_0x34feb8(0x2e4)];}export async function deleteErRelation(_0x14147c){const _0x2949bb=a222_0x4d58e2,_0x385e82=await apiRequest(_0x2949bb(0x29b),{'method':_0x2949bb(0x2da),'body':_0x14147c,'allowNonJsonSuccess':!![]});return _0x385e82['data'];}export async function updateErBusinessGroup(_0x5f19af){const _0x275984=a222_0x4d58e2,_0xb1aea4=await apiRequest(_0x275984(0x204),{'method':'POST','body':_0x5f19af,'allowNonJsonSuccess':!![]});return _0xb1aea4[_0x275984(0x2e4)];}export async function getErBusinessGroupSummary(_0x380108,_0xc143b7){const _0x2644ea=a222_0x4d58e2,_0x134e20=await apiRequest(_0x2644ea(0x28b),{'method':_0x2644ea(0x2da),'body':{'appCode':_0x380108,'dblinkId':_0xc143b7}});return _0x134e20[_0x2644ea(0x2e4)];}function buildQuery(_0xcc3a21){const _0x3810e5=a222_0x4d58e2,_0x16f292=new URLSearchParams();for(const [_0x100e68,_0x803ff8]of Object[_0x3810e5(0x239)](_0xcc3a21)){if(_0x803ff8===undefined||_0x803ff8==='')continue;_0x16f292[_0x3810e5(0x2a1)](_0x100e68,String(_0x803ff8));}const _0xe04a91=_0x16f292[_0x3810e5(0x22b)]();return _0xe04a91?'?'+_0xe04a91:'';}export async function listNotificationChannelConfigs(_0x1553d3,_0x1eee3b){const _0x316b27=a222_0x4d58e2,_0x356adc=await apiRequest(_0x316b27(0x24f)+buildQuery({'appCode':_0x1553d3,'channelType':_0x1eee3b}));if(!Array[_0x316b27(0x285)](_0x356adc['data']))throw CliErrors[_0x316b27(0x2b9)](_0x316b27(0x249),_0x316b27(0x2e3));return _0x356adc[_0x316b27(0x2e4)];}export async function getNotificationChannelConfig(_0x3e3654,_0x2f54b4){const _0x511bed=a222_0x4d58e2,_0x4ed235=await apiRequest(_0x511bed(0x22d)+_0x3e3654+buildQuery({'appCode':_0x2f54b4}));return _0x4ed235['data'];}export async function createNotificationChannelConfig(_0x3ad1c3){const _0x1f498f=a222_0x4d58e2,_0x43d5b2=await apiRequest(_0x1f498f(0x2c9),{'method':_0x1f498f(0x2da),'body':_0x3ad1c3,'indeterminateMutation':!![]});return _0x43d5b2[_0x1f498f(0x2e4)];}export async function updateNotificationChannelConfig(_0x5df4a3){const _0x1f5531=a222_0x4d58e2;await apiRequest(_0x1f5531(0x2d2),{'method':_0x1f5531(0x2da),'body':_0x5df4a3,'indeterminateMutation':!![]});}export async function deleteNotificationChannelConfig(_0x22a01e,_0x3c1ffe){const _0x5a1a6e=a222_0x4d58e2;await apiRequest(_0x5a1a6e(0x1e2),{'method':'POST','body':{'id':_0x22a01e,'appCode':_0x3c1ffe},'indeterminateMutation':!![]});}export async function listAppConfigs(_0x43a8b9,_0x5be438){const _0xf4a9d7=a222_0x4d58e2,_0x2c7ead=await apiRequest(_0xf4a9d7(0x208),{'method':_0xf4a9d7(0x2da),'body':{'appCode':_0x43a8b9,..._0x5be438?.['key']?{'key':_0x5be438[_0xf4a9d7(0x1e5)]}:{},..._0x5be438?.['tags']?{'tags':_0x5be438[_0xf4a9d7(0x1b8)]}:{}}});return extractAppConfigList(_0x2c7ead[_0xf4a9d7(0x2e4)]);}export async function getAppConfigByKey(_0x47ba87,_0x4f3eb7){const _0x39b561=a222_0x4d58e2,_0x9656cc=await apiRequest(_0x39b561(0x1fd)+buildQuery({'appCode':_0x47ba87,'key':_0x4f3eb7}));return _0x9656cc['data']??null;}export async function createAppConfig(_0x43e44a){const _0x2d4b05=a222_0x4d58e2,_0x4b96b0=await apiRequest('/smartapi/app-config/create',{'method':_0x2d4b05(0x2da),'body':{'appCode':_0x43e44a[_0x2d4b05(0x2dc)],'key':_0x43e44a[_0x2d4b05(0x1e5)],'value':_0x43e44a['value'],..._0x43e44a[_0x2d4b05(0x1b8)]?{'tags':_0x43e44a['tags']}:{}}});return _0x4b96b0[_0x2d4b05(0x2e4)];}export async function updateAppConfig(_0x321cc8){const _0x574521=a222_0x4d58e2;await apiRequest(_0x574521(0x28f),{'method':'POST','body':{'id':_0x321cc8['id'],'appCode':_0x321cc8[_0x574521(0x2dc)],'key':_0x321cc8[_0x574521(0x1e5)],'value':_0x321cc8['value'],..._0x321cc8[_0x574521(0x1b8)]?{'tags':_0x321cc8[_0x574521(0x1b8)]}:{}}});}export async function deleteAppConfig(_0x891512){const _0x2880b1=a222_0x4d58e2;await apiRequest('/smartapi/app-config/delete',{'method':_0x2880b1(0x2da),'body':_0x891512});}function extractAppConfigList(_0x295651){const _0x54dda2=a222_0x4d58e2;if(Array[_0x54dda2(0x285)](_0x295651))return _0x295651;if(_0x295651&&typeof _0x295651===_0x54dda2(0x298)&&Array[_0x54dda2(0x285)](_0x295651[_0x54dda2(0x2df)]))return _0x295651['list'];return extractList(_0x295651);}export async function listDbLinks(_0x5ba961,_0x2ffbf7){const _0x4e2f97=a222_0x4d58e2,_0x5150d1=await apiRequest(_0x4e2f97(0x266),{'method':_0x4e2f97(0x2da),'body':{'appCode':_0x5ba961,'currentPage':_0x2ffbf7?.[_0x4e2f97(0x1ca)]??0x1,'pageSize':_0x2ffbf7?.[_0x4e2f97(0x243)]??0x64}});return{'items':extractList(_0x5150d1[_0x4e2f97(0x2e4)]),'paging':extractPaging(_0x5150d1['data'])};}export async function getDbLinkInfo(_0x169419){const _0x38793b=a222_0x4d58e2,_0x1aec99=await apiRequest(_0x38793b(0x291)+buildQuery({'id':_0x169419}));return _0x1aec99[_0x38793b(0x2e4)];}export async function createDbLink(_0x48d146){const _0x3b610c=a222_0x4d58e2,_0x250039=await apiRequest(_0x3b610c(0x295),{'method':_0x3b610c(0x2da),'body':_0x48d146});return _0x250039[_0x3b610c(0x2e4)];}export async function updateDbLink(_0x481257){const _0x49532e=a222_0x4d58e2,_0x10c9bd=await apiRequest('/smartapi/dblink/update',{'method':_0x49532e(0x2da),'body':_0x481257});return _0x10c9bd[_0x49532e(0x2e4)];}export async function deleteDbLink(_0x3d6595){const _0x2bced8=a222_0x4d58e2;await apiRequest(_0x2bced8(0x1b6),{'method':_0x2bced8(0x2da),'body':{'id':_0x3d6595}});}export async function testDbLinkConnect(_0x527b80){const _0x4b0c29=a222_0x4d58e2,_0x449110=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x527b80}));return _0x449110[_0x4b0c29(0x2e4)];}export async function testDbLinkConfigConnect(_0x4ca0d8){const _0x4805be=a222_0x4d58e2,_0x1d30ae=await apiRequest(_0x4805be(0x1e4),{'method':_0x4805be(0x2da),'body':_0x4ca0d8});return _0x1d30ae['data'];}export async function startDbAnalysis(_0x54eca1,_0x13f75a){const _0x1f4c80=a222_0x4d58e2,_0x29d6a8=await apiRequest(_0x1f4c80(0x24c),{'method':_0x1f4c80(0x2da),'body':{'dbLinkId':_0x54eca1,..._0x13f75a&&_0x13f75a[_0x1f4c80(0x268)]>0x0?{'tableNames':_0x13f75a}:{}}});return _0x29d6a8[_0x1f4c80(0x2e4)];}export async function cancelDbAnalysis(_0xc9eb43){const _0x310d06=a222_0x4d58e2;await apiRequest(_0x310d06(0x270)+buildQuery({'planId':_0xc9eb43}),{'method':_0x310d06(0x2da)});}export async function getDbAnalysisStatus(_0x45a691){const _0x453a21=a222_0x4d58e2,_0x2364ef=await apiRequest(_0x453a21(0x263)+encodeURIComponent(_0x45a691));return _0x2364ef['data'];}export async function getDbTableDiff(_0x334270,_0x4ff011,_0x331d26){const _0x12fd62=a222_0x4d58e2,_0xf21eb7=await apiRequest('/smartapi/dblink/getDiffTableByPage'+buildQuery({'appCode':_0x334270,'dbLinkId':_0x4ff011,'pageIndex':_0x331d26?.[_0x12fd62(0x2d1)]??0x1,'pageSize':_0x331d26?.[_0x12fd62(0x243)]??0x14,'tableName':_0x331d26?.['tableName']})),_0x101303=_0xf21eb7[_0x12fd62(0x2e4)];return{'totalCount':_0x101303?.['totalCount']??0x0,...typeof _0x101303?.['physicalTableCount']===_0x12fd62(0x21e)?{'physicalTableCount':_0x101303['physicalTableCount']}:{},...typeof _0x101303?.[_0x12fd62(0x27c)]===_0x12fd62(0x21e)?{'datasetTableCount':_0x101303['datasetTableCount']}:{},..._0x101303?.[_0x12fd62(0x24a)]?{'summary':_0x101303[_0x12fd62(0x24a)]}:{},'tableList':Array[_0x12fd62(0x285)](_0x101303?.[_0x12fd62(0x230)])?_0x101303[_0x12fd62(0x230)]:[]};}export async function getDbTableComparisonPage(_0x1267bd,_0xff5471,_0x1fe0e8){const _0x17ad2e=a222_0x4d58e2,_0x1f8f33=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x1267bd,'dbLinkId':_0xff5471,'pageIndex':_0x1fe0e8?.['pageIndex']??0x1,'pageSize':_0x1fe0e8?.[_0x17ad2e(0x243)]??0x14,'tableName':_0x1fe0e8?.['tableName']})),_0x264567=_0x1f8f33[_0x17ad2e(0x2e4)];return{'totalCount':_0x264567?.[_0x17ad2e(0x257)]??0x0,...typeof _0x264567?.[_0x17ad2e(0x299)]===_0x17ad2e(0x21e)?{'physicalTableCount':_0x264567[_0x17ad2e(0x299)]}:{},...typeof _0x264567?.[_0x17ad2e(0x27c)]===_0x17ad2e(0x21e)?{'datasetTableCount':_0x264567[_0x17ad2e(0x27c)]}:{},..._0x264567?.[_0x17ad2e(0x24a)]?{'summary':_0x264567['summary']}:{},'tableList':Array[_0x17ad2e(0x285)](_0x264567?.['tableList'])?_0x264567[_0x17ad2e(0x230)]:[]};}export async function startDbTableDiffRefresh(_0x4fada0,_0x1fe52f){const _0x1a536e=a222_0x4d58e2,_0x21c8cf=await apiRequest('/smartapi/dblink/table-diff/analyze/start'+buildQuery({'appCode':_0x4fada0,'dbLinkId':_0x1fe52f}),{'method':_0x1a536e(0x2da)});return _0x21c8cf[_0x1a536e(0x2e4)];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x162298=a222_0x4d58e2,_0x115fb0=await apiRequest(_0x162298(0x1c9),{'method':_0x162298(0x2da),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x3f27a7=extractList(_0x115fb0['data']),_0x4b26b7=extractPaging(_0x115fb0[_0x162298(0x2e4)]);return _0x4b26b7&&_0x4b26b7[_0x162298(0x257)]>REMOTE_APP_PAGE_SIZE&&console['warn'](_0x162298(0x1d3)+REMOTE_APP_PAGE_SIZE+_0x162298(0x255)+_0x4b26b7[_0x162298(0x257)]+'\x20apps.\x20'+_0x162298(0x1f7)),_0x3f27a7;}function a222_0x125d(){const _0x3e2924=['createMenu','Knowledge\x20search\x20appCode\x20is\x20required.','clientOperationId','pageSize','/smartapi/menu/batchDelete','.remove(id);','remark','28ylfsbk','dataset_','Invalid\x20notification\x20config\x20list\x20response.','summary','401','/smartapi/db-analysis/start','updateTime','ENABLE','/notification/channel-config/list',',\x20HTTP\x20','Knowledge-base\x20API\x20returned\x20an\x20invalid\x20record\x20contract.','\x20\x20sqlCode:\x20\x27','create','avatar','\x20of\x20','i18nInfo','totalCount','/api/management/library/scripts/statistics?appCode=','/smartapi/dataset/text-generate/start','table','Check\x20network\x20connectivity\x20and\x20try\x20again.','/api/','getOne','/smartapi/common/queryFileUrl','array','Create\x20enterprise\x20knowledge\x20base','\x20\x20where:\x20{},','//\x20SQL:\x20','/smartapi/db-analysis/status/','parentMenuId','code','/smartapi/dblink/getList','docId','length',').execute({','/smartapi/page/restore','.getOne(id);','operations','/smartapi/menu/find?','const\x20results\x20=\x20data.execResult\x20||\x20[];','push','/smartapi/db-analysis/jobs/cancel','/admin/knowledge-base/delete','Backend\x20Function\x20save\x20returned\x20no\x20valid\x20id','Knowledge-base\x20response\x20is\x20missing\x20a\x20valid\x20','Delete\x20enterprise\x20knowledge\x20base','bff','enableI18n','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','operationName','/api/node-toolbox/api-doc-generator','isSafeInteger','title','datasetTableCount','requirementDescription','markdown','query','12826176OdxmMx','Knowledge-base\x20pageSize\x20must\x20be\x20an\x20integer\x20between\x201\x20and\x20','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','Knowledge\x20search\x20query\x20is\x20required.','/standard-page-status?appCode=','isArray','join','/smartapi/permit/user-role/create','/smartapi/question/er-config','/api/management/library/scripts/save','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/smartapi/question/er-config/business-groups','});','const\x20result\x20=\x20await\x20client.models.','Invalid\x20response\x20format\x20(','/smartapi/app-config/update','cli:rabetbase','/smartapi/dblink/getOne','authRequired','API\x20error:\x20','/filter','/smartapi/dblink/create','stringify','261NpxgDa','object','physicalTableCount','\x20failed','/smartapi/question/er-config/cli/delete-single','pageName','error','Exactly\x20one\x20of\x20taskId,\x20operationId,\x20or\x20clientOperationId\x20is\x20required.','status','email','set','version','/smartapi/lovrabet/detail?pageId=','Knowledge\x20search\x20response\x20contains\x20an\x20invalid\x20','files','Unauthorized','.create({\x20/*\x20fields\x20*/\x20});','find','2200800UyaOaB','/smartapi/custom/saveUserCustomSql','pageType','toLowerCase','1185335nrctyP','roleId','/smartapi/custom/queryUserCustomSqlList','/api/management/library/scripts/info?id=','hits','append','\x20failed,\x20HTTP\x20','Fetch\x20menu\x20list','Fetch\x20datasets','scriptName','enabled','isFinite','apiError','DATA_NOT_EXIST','GET','1ZCTzoz','jsonData','Fetch\x20async\x20task\x20','&type=','/userTenant/getByTenantCode','/smartapi/ocr/recognize-text?','min','Operation\x20\x22','/api/management/library/scripts/delete','108157xAxJyx','company','string','has','/notification/channel-config/create','description','modelCode','/userTenant/queryBelongsTenants','Update\x20enterprise\x20knowledge\x20base','startsWith','Custom\x20Page\x20not\x20found:\x20','false','pageIndex','/notification/channel-config/update','875066BtSNyE','isInteger','map','type','/smartapi/question/er-config/cli/update-single','API\x20error\x20code:\x20','defineProperty','POST','/sync-to-pages','appCode','draftVersion','json','list','tableName','includeImports','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','Expected\x20the\x20server\x20data\x20field\x20to\x20be\x20an\x20array.','data','/api/management/library/scripts/list?appCode=','method','menu','Get\x20enterprise\x20knowledge\x20base','path','PUBLIC','filter','/api/management/script/cache/clear','/smartapi/tasks/','38040peyORF','DATA_LIST','/smartapi/dataset/restore-dataset','/smartapi/dataset/get-dataset-list','true','/admin/knowledge-base/create','0000','/smartapi/dblink/delete','roleName','tags','12gDhZMm','sqlCode','add','\x20hits,\x20exceeding\x20topK\x20','Fetch\x20doc\x20(','modelId','hint','UNAUTHORIZED','source','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20','userTenantRelationList','/smartapi/page/getDeletedPageList?','//\x20','createTime','tableData','pageId','/smartapi/app/getList','currentPage','/generate-standard-pages/start','/smartapi/menu/create','/smartapi/dataset/delete?cascade=','errorCode','\x20\x20currentPage:\x201,','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','API\x20error\x20code:\x20306','Knowledge\x20search\x20topK\x20must\x20be\x20a\x20positive\x20integer.','Warning:\x20showing\x20first\x20','AbortError','personal','replace','operationId','The\x20server\x20outcome\x20is\x20indeterminate.\x20Verify\x20current\x20state\x20before\x20retrying\x20any\x20mutation.','signal','/smartapi/custom/updateUserCustomSql','/smartapi/lovrabet/dataset/','\x22\x20not\x20found\x20in\x20dataset\x20','cookie','platform-transport-failure','/smartapi/permit/role/delete','/smartapi/question/er-config/cli/detail?','scriptType','/notification/channel-config/delete','topK','/smartapi/dblink/connect','key','trim','/smartapi/dataset/update-driven-data','/api/custom/executeSql','/smartapi/recycleBin/resource/restore','/api/node-toolbox/sql/save','/smartapi/recycleBin/resource/list?','?sqlCode=','/smartapi/knowledge/company-public/search','Page\x20not\x20found:\x20','datasetName','SQL\x20query\x20not\x20found:\x20id=','name','Knowledge\x20search\x20returned\x20','List\x20enterprise\x20knowledge\x20bases','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','abort','(/*\x20params\x20*/);','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','validation','target','kbRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','max','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','/smartapi/app-config/getByKey','88EUVRes','test','application/json','):\x20missing\x20data.markdown\x20field','file','jsonPath','/smartapi/question/er-config/business-group/edit','dbId','weightedScore','body','/smartapi/app-config/list','Knowledge\x20search\x20API\x20returned\x20an\x20invalid\x20hit\x20contract.','/smartapi/dataset/text-generate/preview','deleted','api_error','score','success','download','List\x20enterprise\x20knowledge\x20bases\x20returned\x20invalid\x20paging\x20metadata.','remove','Request\x20failed:\x20','label','info','/smartapi/dataset/text-generate/status?','resourceName','sqlName','functionName','longTerm','Request\x20timeout:\x20','\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20after\x20HTTP\x20success.','JSX','content','number','\x20\x20pageSize:\x2020,','dbtableConfig','errorMsg','SQL\x20query\x20not\x20found:\x20','Deleted\x20page\x20list\x20response\x20type\x20does\x20not\x20match\x20requested\x20','\x20\x20return\x20rows;','/admin/knowledge-base/get-list','scope','username','/smartapi/permit/role/update','message','/admin/knowledge-base/get-one','toString','includes','/notification/channel-config/','const\x20data\x20=\x20await\x20client.sql.execute({','roleType','tableList','errorMessage','/smartapi/custom/getUserCustomSql','Backend\x20Function\x20script\x20not\x20found:\x20id=','fetch-model-list','\x20\x20});','STANDARD','29937DQgowE','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.byName(','entries','/smartapi/app/getOne','COMPANY','userId','materialName','/generate-standard-pages/status?','NaN'];a222_0x125d=function(){return _0x3e2924;};return a222_0x125d();}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x109aff,_0x36539c){const _0x22e9a4=a222_0x4d58e2,_0xdbc1b4=Math[_0x22e9a4(0x2c2)](Math[_0x22e9a4(0x1fb)](_0x36539c?.[_0x22e9a4(0x243)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x4e11fc=await apiRequest('/smartapi/permit/role/get-list',{'method':_0x22e9a4(0x2da),'body':{'appCode':_0x109aff,'currentPage':_0x36539c?.[_0x22e9a4(0x1ca)]??0x1,'pageSize':_0xdbc1b4}});return{'items':extractList(_0x4e11fc[_0x22e9a4(0x2e4)]),'paging':extractPaging(_0x4e11fc[_0x22e9a4(0x2e4)])};}export async function updateAppRole(_0x443053){const _0x49c247=a222_0x4d58e2,_0x5046ac=await apiRequest(_0x49c247(0x228),{'method':'POST','body':{'id':_0x443053['id'],'appCode':_0x443053[_0x49c247(0x2dc)],..._0x443053[_0x49c247(0x1b7)]!==undefined?{'roleName':_0x443053[_0x49c247(0x1b7)]}:{},..._0x443053[_0x49c247(0x246)]!==undefined?{'remark':_0x443053[_0x49c247(0x246)]}:{}}});return _0x5046ac['data'];}export async function deleteAppRole(_0x4c3a53){const _0x430d44=a222_0x4d58e2;await apiRequest(_0x430d44(0x1df),{'method':'POST','body':{'id':_0x4c3a53}});}export async function listRoleUsers(_0x17f081){const _0x1e3ee2=a222_0x4d58e2,_0x1f94a8=await apiRequest('/smartapi/permit/user-role/get-user-list',{'method':_0x1e3ee2(0x2da),'body':{'appCode':_0x17f081}});return extractList(_0x1f94a8[_0x1e3ee2(0x2e4)])[_0x1e3ee2(0x2d5)](({id:_0x41cd94,userList:_0x410fa6,applyUserList:_0x41296a,..._0x2547d3})=>({..._0x2547d3,'id':Number(_0x41cd94),'userList':_0x410fa6['map'](_0x1e56f8=>({..._0x1e56f8,'userId':Number(_0x1e56f8[_0x1e3ee2(0x23c)])})),..._0x41296a?{'applyUserList':_0x41296a[_0x1e3ee2(0x2d5)](_0x4e1ca9=>({..._0x4e1ca9,'userId':Number(_0x4e1ca9[_0x1e3ee2(0x23c)])}))}:{}}));}export async function listDevUserRoleRelations(_0xece619,_0xdde612){const _0x5a4b88=a222_0x4d58e2,_0x5dd951=Math[_0x5a4b88(0x2c2)](Math[_0x5a4b88(0x1fb)](_0xdde612?.[_0x5a4b88(0x243)]??0x64,0x1),0x64),_0x2545b9=await apiRequest('/smartapi/permit/user-role/get-list',{'method':'POST','body':{'appCode':_0xece619,..._0xdde612?.[_0x5a4b88(0x23c)]!==undefined?{'userId':_0xdde612[_0x5a4b88(0x23c)]}:{},..._0xdde612?.[_0x5a4b88(0x2ae)]!==undefined?{'roleId':_0xdde612[_0x5a4b88(0x2ae)]}:{},..._0xdde612?.[_0x5a4b88(0x22f)]!==undefined?{'roleType':_0xdde612['roleType']}:{},'currentPage':_0xdde612?.['currentPage']??0x1,'pageSize':_0x5dd951}}),_0x48d1f4=extractList(_0x2545b9['data'])[_0x5a4b88(0x2d5)](_0x394046=>({..._0x394046,'id':Number(_0x394046['id']),'userId':Number(_0x394046[_0x5a4b88(0x23c)]),'roleId':Number(_0x394046[_0x5a4b88(0x2ae)])}));return{'items':_0x48d1f4,'paging':extractPaging(_0x2545b9[_0x5a4b88(0x2e4)])};}export async function createDevUserRole(_0x5b0aa3){const _0x343586=a222_0x4d58e2,_0x33d800=await apiRequest(_0x343586(0x287),{'method':_0x343586(0x2da),'body':_0x5b0aa3});return{..._0x33d800[_0x343586(0x2e4)],'id':Number(_0x33d800[_0x343586(0x2e4)]['id']),'userId':Number(_0x33d800[_0x343586(0x2e4)][_0x343586(0x23c)]),'roleId':Number(_0x33d800[_0x343586(0x2e4)]['roleId'])};}function a222_0xe40e(_0x3adff1,_0x5bb123){_0x3adff1=_0x3adff1-0x1b1;const _0x125d03=a222_0x125d();let _0xe40e08=_0x125d03[_0x3adff1];return _0xe40e08;}export async function deleteDevUserRole(_0x23913f){const _0x2cea0c=a222_0x4d58e2,_0x2a6f4d=await apiRequest('/smartapi/permit/user-role/delete',{'method':_0x2cea0c(0x2da),'body':{'id':_0x23913f}});return _0x2a6f4d[_0x2cea0c(0x2e4)];}export async function listCurrentUserTenantMemberships(){const _0x1fece3=a222_0x4d58e2,_0x5a420e=await apiRequest(_0x1fece3(0x2cc));return extractList(_0x5a420e[_0x1fece3(0x2e4)]);}export async function listTenantDirectoryMembers(_0x35549d){const _0x2db8fc=a222_0x4d58e2,_0x3f67f6=await apiRequest(_0x2db8fc(0x2c0)+buildQuery({'code':_0x35549d})),_0x22b55c=_0x3f67f6[_0x2db8fc(0x2e4)]?.[_0x2db8fc(0x1c3)];return Array[_0x2db8fc(0x285)](_0x22b55c)?_0x22b55c:[];}export async function getTenantMembers(_0x247f42){const _0x259da8=a222_0x4d58e2,_0x2c6da6=await listTenantDirectoryMembers(_0x247f42);return _0x2c6da6[_0x259da8(0x2eb)](_0x1cc814=>_0x1cc814[_0x259da8(0x29f)]===_0x259da8(0x24e)||_0x1cc814[_0x259da8(0x29f)]===undefined)[_0x259da8(0x2d5)](_0x42d7b0=>({'userId':Number(_0x42d7b0[_0x259da8(0x23c)]??_0x42d7b0['id']),'username':_0x42d7b0[_0x259da8(0x227)],'nickname':_0x42d7b0['nickname'],'status':_0x42d7b0[_0x259da8(0x29f)],'email':_0x42d7b0[_0x259da8(0x2a0)],'mobile':_0x42d7b0['mobile'],'avatar':_0x42d7b0[_0x259da8(0x254)]}))[_0x259da8(0x2eb)](_0x2b96b5=>Number[_0x259da8(0x2b8)](_0x2b96b5[_0x259da8(0x23c)])&&_0x2b96b5[_0x259da8(0x23c)]>0x0);}
|
|
1
|
+
const a222_0x11798a=a222_0x3de7;(function(_0x2890bd,_0x5b1462){const _0x1a13f9=a222_0x3de7,_0x5c04bd=_0x2890bd();while(!![]){try{const _0xa480e=-parseInt(_0x1a13f9(0x13e))/0x1*(-parseInt(_0x1a13f9(0x13c))/0x2)+parseInt(_0x1a13f9(0x245))/0x3+-parseInt(_0x1a13f9(0x182))/0x4+parseInt(_0x1a13f9(0x185))/0x5+-parseInt(_0x1a13f9(0x1f4))/0x6*(parseInt(_0x1a13f9(0x1eb))/0x7)+-parseInt(_0x1a13f9(0x147))/0x8*(-parseInt(_0x1a13f9(0x15a))/0x9)+parseInt(_0x1a13f9(0x16a))/0xa*(parseInt(_0x1a13f9(0x1fb))/0xb);if(_0xa480e===_0x5b1462)break;else _0x5c04bd['push'](_0x5c04bd['shift']());}catch(_0x157927){_0x5c04bd['push'](_0x5c04bd['shift']());}}}(a222_0x401c,0x6fa94));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getKbDomain,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(_0xb763ab){_activeCookie=_0xb763ab||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('platform-transport-failure'),PLATFORM_ERROR_CODE=Symbol(a222_0x11798a(0x15f));export function isPlatformTransportFailure(_0x26ddd){return Boolean(_0x26ddd&&typeof _0x26ddd==='object'&&_0x26ddd[PLATFORM_TRANSPORT_FAILURE]===!![]);}export function getPlatformErrorCode(_0xa06bef){const _0x4b52f4=a222_0x11798a;if(!_0xa06bef||typeof _0xa06bef!==_0x4b52f4(0x13d))return undefined;const _0x101814=_0xa06bef[PLATFORM_ERROR_CODE];return typeof _0x101814===_0x4b52f4(0x25a)&&_0x101814?_0x101814:undefined;}function createPlatformApiError(_0x3c6c01,_0x18d402){const _0x474d51=a222_0x11798a,_0x429c99=typeof _0x18d402==='string'?_0x18d402[_0x474d51(0x163)]():typeof _0x18d402==='number'?String(_0x18d402):'',_0x3fa4ce=CliErrors[_0x474d51(0x209)](_0x3c6c01,_0x429c99?_0x474d51(0x18d)+_0x429c99:undefined);return _0x429c99&&(Object['defineProperty'](_0x3fa4ce,PLATFORM_ERROR_CODE,{'value':_0x429c99}),Object[_0x474d51(0x174)](_0x3fa4ce,_0x474d51(0x12b),{'value':{'remoteErrorCode':_0x429c99},'enumerable':![]})),_0x3fa4ce;}function createFetchFailureError(_0xc018bf,_0x421b68){const _0x4875fb=a222_0x11798a,_0x57649e=_0x421b68 instanceof Error?_0x421b68['message']:String(_0x421b68),_0x43e069=CliErrors[_0x4875fb(0x209)]('Request\x20failed:\x20'+_0xc018bf+(_0x57649e?'\x20('+_0x57649e+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');return Object[_0x4875fb(0x174)](_0x43e069,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x43e069;}function createRequestTimeoutError(_0x3659f6,_0x20263c){const _0x2e17a6=a222_0x11798a,_0x372820=CliErrors['apiError']('Request\x20timeout:\x20'+_0x3659f6);return _0x20263c&&Object[_0x2e17a6(0x174)](_0x372820,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x372820;}function createIndeterminateResponseError(_0x383061){const _0x1aee59=a222_0x11798a,_0x2b55ac=CliErrors[_0x1aee59(0x209)](_0x383061+_0x1aee59(0x1a9),'The\x20server\x20outcome\x20is\x20indeterminate.\x20Verify\x20current\x20state\x20before\x20retrying\x20any\x20mutation.');return Object['defineProperty'](_0x2b55ac,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x2b55ac;}async function apiRequest(_0x2e3c7f,_0x31304f={}){const _0x183056=a222_0x11798a,{method:method=_0x183056(0x257),body:_0x213ac1,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![],indeterminateMutation:indeterminateMutation=![]}=_0x31304f,_0x32b522=useRuntime?getRuntimeDomain():getApiDomain(),_0xe75777=_activeCookie||getCookie(),_0x19c2b3=''+_0x32b522+_0x2e3c7f,_0x463b47=new AbortController(),_0x57789c=setTimeout(()=>_0x463b47[_0x183056(0x17e)](),timeout);try{const _0x20f07a=await fetch(_0x19c2b3,{'method':method,'headers':{'Content-Type':_0x183056(0x1a1),'Cookie':_0xe75777,'X-Invoke-Source':_0x183056(0x208),...headers},'body':_0x213ac1?JSON['stringify'](_0x213ac1):undefined,'signal':_0x463b47['signal']});let _0x12d0b1;try{_0x12d0b1=await _0x20f07a[_0x183056(0x19b)]();}catch(_0x5e583c){if(_0x20f07a['ok']&&_0x5e583c instanceof Error&&_0x5e583c[_0x183056(0x1b3)]===_0x183056(0x1a8))throw createRequestTimeoutError(_0x19c2b3,indeterminateMutation);if(_0x20f07a['ok']&&indeterminateMutation)throw createIndeterminateResponseError(_0x2e3c7f);if(_0x20f07a['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x183056(0x209)](_0x183056(0x13a)+_0x20f07a[_0x183056(0x172)]+')',_0x20f07a[_0x183056(0x172)]>=0x190?_0x183056(0x1b6):undefined);}const _0x3ff56f=_0x12d0b1!==null&&typeof _0x12d0b1==='object'&&!Array[_0x183056(0x18e)](_0x12d0b1);if(!_0x20f07a['ok']){const _0x19975e=_0x3ff56f?_0x12d0b1:undefined;throw CliErrors[_0x183056(0x209)](_0x19975e?.[_0x183056(0x1ec)]||_0x19975e?.['message']||_0x183056(0x17a)+_0x20f07a['status'],_0x19975e?.[_0x183056(0x1a2)]?_0x183056(0x18d)+_0x19975e[_0x183056(0x1a2)]:undefined);}if(indeterminateMutation){if(!_0x3ff56f)throw createIndeterminateResponseError(_0x2e3c7f);if(_0x12d0b1['success']===![])throw CliErrors[_0x183056(0x209)](_0x12d0b1[_0x183056(0x1ec)]||_0x12d0b1[_0x183056(0x22c)]||_0x183056(0x17a)+_0x20f07a['status'],_0x12d0b1[_0x183056(0x1a2)]?_0x183056(0x18d)+_0x12d0b1[_0x183056(0x1a2)]:undefined);if(_0x12d0b1[_0x183056(0x170)]!==!![])throw createIndeterminateResponseError(_0x2e3c7f);return _0x12d0b1;}if(_0x12d0b1===null||_0x12d0b1===undefined)throw CliErrors[_0x183056(0x209)]('API\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20(HTTP\x20'+_0x20f07a['status']+')');if(_0x12d0b1[_0x183056(0x170)]===![])throw CliErrors[_0x183056(0x209)](_0x12d0b1[_0x183056(0x1ec)]||_0x12d0b1[_0x183056(0x22c)]||_0x183056(0x17a)+_0x20f07a[_0x183056(0x172)],_0x12d0b1[_0x183056(0x1a2)]?_0x183056(0x18d)+_0x12d0b1[_0x183056(0x1a2)]:undefined);return _0x12d0b1;}catch(_0x429d7e){if(_0x429d7e instanceof CliError)throw _0x429d7e;if(_0x429d7e instanceof Error&&_0x429d7e[_0x183056(0x1b3)]===_0x183056(0x1a8))throw createRequestTimeoutError(_0x19c2b3,indeterminateMutation);throw createFetchFailureError(_0x19c2b3,_0x429d7e);}finally{clearTimeout(_0x57789c);}}async function apiFormRequest(_0x58868d,_0x2f8c50,_0x18bdac={}){const _0xba3682=a222_0x11798a,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x18bdac,_0x484e65=_activeCookie||getCookie(),_0x398a35=''+getApiDomain()+_0x58868d,_0x4fca58=new AbortController(),_0x46b323=setTimeout(()=>_0x4fca58[_0xba3682(0x17e)](),timeout);try{const _0x461275=await fetch(_0x398a35,{'method':_0xba3682(0x259),'headers':{'Cookie':_0x484e65,'X-Invoke-Source':'cli:rabetbase'},'body':_0x2f8c50,'signal':_0x4fca58['signal']});let _0x3a2f51;try{_0x3a2f51=await _0x461275['json']();}catch(_0x1602d1){if(_0x1602d1 instanceof Error&&_0x1602d1[_0xba3682(0x1b3)]==='AbortError')throw CliErrors[_0xba3682(0x209)](_0xba3682(0x22d)+_0x398a35);throw CliErrors['apiError'](_0xba3682(0x13a)+_0x461275[_0xba3682(0x172)]+')',_0x461275[_0xba3682(0x172)]>=0x190?_0xba3682(0x1b6):undefined);}if(!_0x461275['ok']||_0x3a2f51['success']===![])throw CliErrors['apiError'](_0x3a2f51[_0xba3682(0x1ec)]||_0x3a2f51[_0xba3682(0x22c)]||'API\x20error:\x20'+_0x461275[_0xba3682(0x172)],_0x3a2f51['errorCode']?_0xba3682(0x18d)+_0x3a2f51['errorCode']:undefined);return _0x3a2f51;}catch(_0x57a12d){if(_0x57a12d instanceof CliError)throw _0x57a12d;if(_0x57a12d instanceof Error&&_0x57a12d[_0xba3682(0x1b3)]===_0xba3682(0x1a8))throw CliErrors[_0xba3682(0x209)]('Request\x20timeout:\x20'+_0x398a35);throw createFetchFailureError(_0x398a35,_0x57a12d);}finally{clearTimeout(_0x46b323);}}export async function uploadDevelopmentFile(_0x450420,_0x5bc2ff){const _0x311017=a222_0x11798a,_0x19dafe=await readFile(_0x5bc2ff),_0x38c6fb=new FormData();_0x38c6fb[_0x311017(0x1fc)](_0x311017(0x1ee),_0x450420),_0x38c6fb[_0x311017(0x1fc)](_0x311017(0x1ca),new Blob([new Uint8Array(_0x19dafe)]),basename(_0x5bc2ff));const _0xe124bf=await apiFormRequest(_0x311017(0x154),_0x38c6fb);return _0xe124bf[_0x311017(0x12b)];}export async function queryDevelopmentFileUrl(_0x41bd55,_0x13050c={}){const _0x4e983c=a222_0x11798a,_0x22546d=await apiRequest(_0x4e983c(0x1c4),{'method':_0x4e983c(0x259),'body':{'filePath':_0x41bd55,'downloadFlag':_0x13050c[_0x4e983c(0x1c8)]??![],..._0x13050c['longTerm']?{'longTerm':!![]}:{}}});return _0x22546d['data'];}export async function recognizeDevelopmentOcr(_0x4cb93c,_0x69a514){const _0x5948f8=a222_0x11798a,_0x4a7632=new URLSearchParams({'url':_0x69a514[_0x5948f8(0x239)],'type':_0x69a514[_0x5948f8(0x1c7)],'appCode':_0x4cb93c}),_0x5be3cd=await apiRequest(_0x5948f8(0x14e)+_0x4a7632['toString'](),{'method':_0x5948f8(0x257)});return _0x5be3cd[_0x5948f8(0x12b)];}export const DING_TALK_SANDBOX_BIND_PATH=a222_0x11798a(0x16f);export async function bindDingTalkSandboxAccount(_0x432d18){const _0x35f6ba=a222_0x11798a,_0x43cd96=await apiRequest(DING_TALK_SANDBOX_BIND_PATH,{'method':_0x35f6ba(0x259),'body':{'dingTalkUserId':_0x432d18}});return _0x43cd96[_0x35f6ba(0x12b)];}function isAuthFailure(_0x4297ed){const _0x24d3f2=a222_0x11798a,_0x4c274d=_0x4297ed['errorMsg']||_0x4297ed['message']||_0x4297ed['data']?.[_0x24d3f2(0x22c)]||_0x4297ed['errorMessage']||_0x4297ed[_0x24d3f2(0x24c)]||'';return _0x4297ed[_0x24d3f2(0x1a2)]===_0x24d3f2(0x177)||_0x4297ed[_0x24d3f2(0x15b)]===0x191||_0x4297ed[_0x24d3f2(0x15b)]===_0x24d3f2(0x1c1)||_0x4c274d['includes'](_0x24d3f2(0x1c1))||_0x4c274d['includes']('Unauthorized')||_0x4c274d[_0x24d3f2(0x1d2)]('登录')||_0x4c274d[_0x24d3f2(0x1d2)]('认证');}export async function platformFetch(_0x182f15,_0x2c6a1c){const _0x4e5012=a222_0x11798a;let _0x262bb1;try{_0x262bb1=await fetch(_0x182f15,{'method':_0x2c6a1c[_0x4e5012(0x153)]??'GET','headers':{'Content-Type':'application/json','Cookie':_0x2c6a1c[_0x4e5012(0x18c)],'X-Invoke-Source':_0x4e5012(0x208)},..._0x2c6a1c['body']&&{'body':JSON[_0x4e5012(0x1d3)](_0x2c6a1c[_0x4e5012(0x1f2)])}});}catch(_0x3115da){throw createFetchFailureError(_0x182f15,_0x3115da);}let _0x14b0f2;try{_0x14b0f2=await _0x262bb1['json']();}catch(_0xae7cde){if(!_0x262bb1['ok']){if(_0x262bb1['status']===0x191)throw CliErrors[_0x4e5012(0x1f5)]();throw CliErrors[_0x4e5012(0x209)](_0x2c6a1c[_0x4e5012(0x235)]+_0x4e5012(0x1b9)+_0x262bb1[_0x4e5012(0x172)]);}throw createFetchFailureError(_0x182f15,_0xae7cde);}if(_0x14b0f2===null||typeof _0x14b0f2!==_0x4e5012(0x13d)||Array[_0x4e5012(0x18e)](_0x14b0f2)){if(_0x262bb1['status']===0x191)throw CliErrors[_0x4e5012(0x1f5)]();if(_0x262bb1['ok'])throw createIndeterminateResponseError(_0x2c6a1c[_0x4e5012(0x235)]);throw CliErrors[_0x4e5012(0x209)](_0x2c6a1c[_0x4e5012(0x235)]+_0x4e5012(0x190)+(!_0x262bb1['ok']?',\x20HTTP\x20'+_0x262bb1[_0x4e5012(0x172)]:'')+':\x20invalid\x20JSON\x20response\x20envelope');}const _0x414aa4=typeof _0x14b0f2[_0x4e5012(0x1a2)]===_0x4e5012(0x25a)||typeof _0x14b0f2[_0x4e5012(0x1a2)]===_0x4e5012(0x1c3),_0x5ee039=_0x414aa4?String(_0x14b0f2[_0x4e5012(0x1a2)])[_0x4e5012(0x163)]():'',_0x23c1c2=_0x14b0f2[_0x4e5012(0x170)]===![]||_0x414aa4&&_0x5ee039!==_0x4e5012(0x160);if(!_0x262bb1['ok']||_0x23c1c2){if(_0x262bb1[_0x4e5012(0x172)]===0x191||isAuthFailure(_0x14b0f2))throw CliErrors[_0x4e5012(0x1f5)]();throw createPlatformApiError(_0x14b0f2[_0x4e5012(0x1ec)]||_0x14b0f2[_0x4e5012(0x22c)]||_0x2c6a1c['label']+_0x4e5012(0x190)+(!_0x262bb1['ok']?_0x4e5012(0x20c)+_0x262bb1['status']:''),_0x14b0f2[_0x4e5012(0x1a2)]??_0x14b0f2[_0x4e5012(0x15b)]);}if(_0x14b0f2['success']!==!![]||_0x414aa4&&_0x5ee039!==_0x4e5012(0x160))throw createIndeterminateResponseError(_0x2c6a1c['label']);return _0x14b0f2[_0x4e5012(0x12b)];}export async function platformRequest(_0x38084d,_0x5b6e54){const _0x1a243c=a222_0x11798a;if(/^https?:\/\//i[_0x1a243c(0x23c)](_0x38084d))throw CliErrors[_0x1a243c(0x11e)](_0x1a243c(0x241)+_0x38084d,_0x1a243c(0x128));const _0x5f2248=_0x38084d['startsWith']('/')?_0x38084d:'/'+_0x38084d;return platformFetch(''+getApiDomain()+_0x5f2248,_0x5b6e54);}export async function kbRequest(_0x52c43e,_0x41112d){const _0x158433=a222_0x11798a;if(/^https?:\/\//i[_0x158433(0x23c)](_0x52c43e))throw CliErrors[_0x158433(0x11e)](_0x158433(0x144)+_0x52c43e,_0x158433(0x128));const _0x5b44ab=_0x52c43e[_0x158433(0x236)]('/')?_0x52c43e:'/'+_0x52c43e;return platformFetch(''+getKbDomain()+_0x5b44ab,_0x41112d);}const MAX_KNOWLEDGE_BASE_PAGE_SIZE=0x64;function parseKnowledgeBaseInteger(_0x587988,_0x39c991){const _0x31cb96=a222_0x11798a,_0x54a22f=typeof _0x587988==='number'?_0x587988:typeof _0x587988===_0x31cb96(0x25a)&&/^(0|[1-9]\d*)$/[_0x31cb96(0x23c)](_0x587988)?Number(_0x587988):Number[_0x31cb96(0x1c6)],_0x44eee5=Number[_0x31cb96(0x21b)](_0x54a22f)&&(_0x39c991==='id'?_0x54a22f>0x0:_0x54a22f>=0x0);if(!_0x44eee5)throw CliErrors[_0x31cb96(0x209)]('Knowledge-base\x20response\x20contains\x20an\x20invalid\x20'+_0x39c991+'.');return _0x54a22f;}function parseKnowledgeBaseText(_0x226131,_0x469b81){const _0x577d2f=a222_0x11798a;if(typeof _0x226131===_0x577d2f(0x25a)&&(_0x469b81===_0x577d2f(0x215)||_0x226131[_0x577d2f(0x163)]()))return _0x226131;throw CliErrors[_0x577d2f(0x209)]('Knowledge-base\x20response\x20is\x20missing\x20a\x20valid\x20'+_0x469b81+'.');}function parseKnowledgeBaseRecord(_0x3f0baf){const _0x1bc6ed=a222_0x11798a;if(!_0x3f0baf||typeof _0x3f0baf!==_0x1bc6ed(0x13d)||Array[_0x1bc6ed(0x18e)](_0x3f0baf))throw CliErrors[_0x1bc6ed(0x209)](_0x1bc6ed(0x143));const _0x3ef14f=_0x3f0baf;if(_0x3ef14f[_0x1bc6ed(0x137)]!==_0x1bc6ed(0x1e8)&&_0x3ef14f['scope']!==_0x1bc6ed(0x16d))throw CliErrors[_0x1bc6ed(0x209)]('Knowledge-base\x20response\x20contains\x20an\x20invalid\x20scope.');const _0x3bf13a={'id':parseKnowledgeBaseInteger(_0x3ef14f['id'],'id'),'scope':_0x3ef14f[_0x1bc6ed(0x137)],'appCode':parseKnowledgeBaseText(_0x3ef14f[_0x1bc6ed(0x1ee)],_0x1bc6ed(0x1ee)),'title':parseKnowledgeBaseText(_0x3ef14f['title'],_0x1bc6ed(0x1e5)),'version':parseKnowledgeBaseInteger(_0x3ef14f['version'],_0x1bc6ed(0x23a)),'content':parseKnowledgeBaseText(_0x3ef14f['content'],_0x1bc6ed(0x215))};return(_0x3ef14f[_0x1bc6ed(0x1e7)]===null||typeof _0x3ef14f[_0x1bc6ed(0x1e7)]===_0x1bc6ed(0x25a)||typeof _0x3ef14f[_0x1bc6ed(0x1e7)]===_0x1bc6ed(0x1c3))&&(_0x3bf13a[_0x1bc6ed(0x1e7)]=_0x3ef14f['createTime']),(_0x3ef14f[_0x1bc6ed(0x11b)]===null||typeof _0x3ef14f['updateTime']==='string'||typeof _0x3ef14f[_0x1bc6ed(0x11b)]===_0x1bc6ed(0x1c3))&&(_0x3bf13a[_0x1bc6ed(0x11b)]=_0x3ef14f['updateTime']),_0x3bf13a;}export async function listEnterpriseKnowledgeBases(_0xb8cb,_0x1e6b6a={}){const _0x11b65e=a222_0x11798a,_0x988c6d=_0x1e6b6a[_0x11b65e(0x1bf)]??0x32;if(!Number[_0x11b65e(0x21b)](_0x988c6d)||_0x988c6d<0x1||_0x988c6d>MAX_KNOWLEDGE_BASE_PAGE_SIZE)throw CliErrors['validation'](_0x11b65e(0x213)+MAX_KNOWLEDGE_BASE_PAGE_SIZE+'.');const _0x3a94dc=await kbRequest('/admin/knowledge-base/get-list',{'method':_0x11b65e(0x259),'cookie':_0xb8cb,'label':_0x11b65e(0x224),'body':{'currentPage':_0x1e6b6a[_0x11b65e(0x131)]??0x1,'pageSize':_0x988c6d,'scope':_0x11b65e(0x1e8),..._0x1e6b6a['appCode']?{'appCode':_0x1e6b6a[_0x11b65e(0x1ee)]}:{},..._0x1e6b6a[_0x11b65e(0x1e5)]?{'title':_0x1e6b6a[_0x11b65e(0x1e5)]}:{}}});if(!_0x3a94dc||typeof _0x3a94dc!=='object'||Array['isArray'](_0x3a94dc)||!Array[_0x11b65e(0x18e)](_0x3a94dc[_0x11b65e(0x249)]))throw CliErrors[_0x11b65e(0x209)](_0x11b65e(0x24d));const _0x332217=extractPaging(_0x3a94dc);if(!_0x332217||!Number[_0x11b65e(0x1af)](_0x332217[_0x11b65e(0x131)])||!Number['isInteger'](_0x332217['pageSize'])||!Number[_0x11b65e(0x1af)](_0x332217[_0x11b65e(0x212)])||_0x332217[_0x11b65e(0x131)]<0x1||_0x332217['pageSize']<0x1||_0x332217[_0x11b65e(0x1bf)]>MAX_KNOWLEDGE_BASE_PAGE_SIZE||_0x332217[_0x11b65e(0x212)]<0x0)throw CliErrors[_0x11b65e(0x209)](_0x11b65e(0x1e2));return{'items':extractList(_0x3a94dc)[_0x11b65e(0x156)](parseKnowledgeBaseRecord),'paging':_0x332217};}export async function getEnterpriseKnowledgeBase(_0x1ade55,_0x263dfe){const _0x18402f=a222_0x11798a,_0x470ced=await kbRequest('/admin/knowledge-base/get-one'+buildQuery({'id':_0x263dfe}),{'cookie':_0x1ade55,'label':_0x18402f(0x1fd)});return parseKnowledgeBaseRecord(_0x470ced);}export async function createEnterpriseKnowledgeBase(_0x517ee3,_0x4026de){const _0x48dbd6=a222_0x11798a,_0x458bfb=await kbRequest(_0x48dbd6(0x1bb),{'method':_0x48dbd6(0x259),'cookie':_0x517ee3,'label':_0x48dbd6(0x1bd),'body':{'scope':_0x48dbd6(0x1e8),..._0x4026de}});return parseKnowledgeBaseRecord(_0x458bfb);}export async function updateEnterpriseKnowledgeBase(_0x52c64f,_0x310445){const _0x3f2ab2=a222_0x11798a;if(_0x310445['title']===undefined&&_0x310445[_0x3f2ab2(0x215)]===undefined)throw CliErrors[_0x3f2ab2(0x11e)](_0x3f2ab2(0x15d));const _0x3ad0e7=await kbRequest(_0x3f2ab2(0x240),{'method':'POST','cookie':_0x52c64f,'label':_0x3f2ab2(0x231),'body':{'id':_0x310445['id'],..._0x310445['title']!==undefined?{'title':_0x310445[_0x3f2ab2(0x1e5)]}:{},..._0x310445[_0x3f2ab2(0x215)]!==undefined?{'content':_0x310445[_0x3f2ab2(0x215)]}:{}}});return parseKnowledgeBaseRecord(_0x3ad0e7);}export async function deleteEnterpriseKnowledgeBase(_0x3145ba,_0x31444d){const _0x563198=a222_0x11798a;await kbRequest(_0x563198(0x256),{'method':'POST','cookie':_0x3145ba,'label':'Delete\x20enterprise\x20knowledge\x20base','body':{'id':_0x31444d}});}function parseNullableKnowledgeSearchText(_0x41135f,_0x52da1f){const _0x4434da=a222_0x11798a;if(_0x41135f===null||_0x41135f===undefined)return null;if(typeof _0x41135f===_0x4434da(0x25a))return _0x41135f;throw CliErrors[_0x4434da(0x209)](_0x4434da(0x1f0)+_0x52da1f+'.');}function parseKnowledgeSearchScore(_0x58edc6,_0x79cc20){const _0x21e2ae=a222_0x11798a;if(typeof _0x58edc6===_0x21e2ae(0x1c3)&&Number[_0x21e2ae(0x1ab)](_0x58edc6))return _0x58edc6;throw CliErrors[_0x21e2ae(0x209)](_0x21e2ae(0x1f0)+_0x79cc20+'.');}function parseCompanyPublicKnowledgeSearchHit(_0x3b97f3){const _0x3e7e8b=a222_0x11798a;if(!_0x3b97f3||typeof _0x3b97f3!==_0x3e7e8b(0x13d)||Array['isArray'](_0x3b97f3))throw CliErrors[_0x3e7e8b(0x209)]('Knowledge\x20search\x20API\x20returned\x20an\x20invalid\x20hit\x20contract.');const _0x3e75ff=_0x3b97f3;if(_0x3e75ff[_0x3e7e8b(0x137)]!=='COMPANY'&&_0x3e75ff[_0x3e7e8b(0x137)]!==_0x3e7e8b(0x14d))throw CliErrors[_0x3e7e8b(0x209)](_0x3e7e8b(0x1a3));return{'scope':_0x3e75ff[_0x3e7e8b(0x137)],'title':parseNullableKnowledgeSearchText(_0x3e75ff[_0x3e7e8b(0x1e5)],_0x3e7e8b(0x1e5)),'docId':parseNullableKnowledgeSearchText(_0x3e75ff[_0x3e7e8b(0x1a6)],_0x3e7e8b(0x1a6)),'score':parseKnowledgeSearchScore(_0x3e75ff[_0x3e7e8b(0x1e0)],_0x3e7e8b(0x1e0)),'weightedScore':parseKnowledgeSearchScore(_0x3e75ff[_0x3e7e8b(0x233)],_0x3e7e8b(0x233)),'content':parseNullableKnowledgeSearchText(_0x3e75ff['content'],_0x3e7e8b(0x215)),'jsonPath':parseNullableKnowledgeSearchText(_0x3e75ff[_0x3e7e8b(0x180)],'jsonPath'),'jsonData':parseNullableKnowledgeSearchText(_0x3e75ff[_0x3e7e8b(0x1bc)],'jsonData')};}export async function searchCompanyPublicKnowledge(_0x185df0,_0x82cdc4){const _0x51af31=a222_0x11798a;if(!_0x82cdc4[_0x51af31(0x250)][_0x51af31(0x163)]())throw CliErrors[_0x51af31(0x11e)]('Knowledge\x20search\x20query\x20is\x20required.');if(!_0x82cdc4['appCode']['trim']())throw CliErrors['validation'](_0x51af31(0x219));if(_0x82cdc4[_0x51af31(0x25c)]!==undefined&&(!Number['isSafeInteger'](_0x82cdc4['topK'])||_0x82cdc4[_0x51af31(0x25c)]<=0x0))throw CliErrors['validation'](_0x51af31(0x199));const _0x549909=await kbRequest(_0x51af31(0x1ef),{'method':_0x51af31(0x259),'cookie':_0x185df0,'label':_0x51af31(0x207),'body':{'query':_0x82cdc4[_0x51af31(0x250)],'appCode':_0x82cdc4[_0x51af31(0x1ee)],..._0x82cdc4['topK']!==undefined?{'topK':_0x82cdc4[_0x51af31(0x25c)]}:{}}});if(!_0x549909||typeof _0x549909!==_0x51af31(0x13d)||Array['isArray'](_0x549909)||!Array[_0x51af31(0x18e)](_0x549909[_0x51af31(0x1e1)]))throw CliErrors[_0x51af31(0x209)]('Search\x20company\x20and\x20public\x20knowledge\x20returned\x20an\x20invalid\x20response\x20contract.');const _0x5b945b=_0x549909[_0x51af31(0x1e1)][_0x51af31(0x156)](parseCompanyPublicKnowledgeSearchHit);if(_0x82cdc4[_0x51af31(0x25c)]!==undefined&&_0x5b945b['length']>_0x82cdc4[_0x51af31(0x25c)])throw CliErrors['apiError']('Knowledge\x20search\x20returned\x20'+_0x5b945b[_0x51af31(0x1cf)]+_0x51af31(0x1f3)+_0x82cdc4[_0x51af31(0x25c)]+'.');return _0x5b945b;}function cleanNewlines(_0x57bcf3){const _0x3f81ea=a222_0x11798a;return _0x57bcf3['replace'](/[\r\n]+/g,'\x20')[_0x3f81ea(0x163)]();}function cleanDatasetName(_0x2572ba){const _0x490320=a222_0x11798a;if(!_0x2572ba[_0x490320(0x1b3)])return _0x2572ba;return{..._0x2572ba,'name':cleanNewlines(_0x2572ba[_0x490320(0x1b3)])};}export async function fetchModelList(_0x59de76,_0x55b618){const _0xcebb6e=a222_0x11798a,_0x18f05a=getEnv(),_0x4e655a=new URLSearchParams({'appcode':_0x59de76,'otype':_0xcebb6e(0x158)}),_0x2191a6=_0xcebb6e(0x12e)+_0x4e655a[_0xcebb6e(0x21a)]();logger[_0xcebb6e(0x220)](_0xcebb6e(0x149),_0xcebb6e(0x188)+_0x18f05a+')',{'apiPath':_0x2191a6});const _0x37e63e=await platformRequest(_0x2191a6,{'cookie':_0x55b618,'label':'Fetch\x20datasets'}),_0x2be59d=(_0x37e63e[_0xcebb6e(0x210)]??[])['map'](cleanDatasetName);return{'configArray':_0x2be59d,'count':_0x2be59d[_0xcebb6e(0x1cf)]};}export async function fetchDatasetDoc(_0x49ae69){const _0x4e5774=a222_0x11798a,{appCode:_0x2a0668,cookie:_0x50a155,datasetCode:_0x1ccca7,datasetId:_0x2bcfaa,extraParams:_0x284b8b}=_0x49ae69,_0x486604=await platformRequest(_0x4e5774(0x186),{'method':_0x4e5774(0x259),'body':{'appCode':_0x2a0668,'datasetCode':_0x1ccca7,'datasetId':_0x2bcfaa,..._0x284b8b||{}},'cookie':_0x50a155,'label':_0x4e5774(0x1f8)+_0x1ccca7+')'});if(!_0x486604||typeof _0x486604[_0x4e5774(0x1b7)]!==_0x4e5774(0x25a))throw new Error(_0x4e5774(0x146)+_0x1ccca7+_0x4e5774(0x1d1));return _0x486604[_0x4e5774(0x1b7)];}export async function getMenuTree(_0x168b08,_0x44d2d4){const _0x1e0b08=a222_0x11798a,_0x1a6524=new URLSearchParams({'appCode':_0x168b08});return platformRequest('/smartapi/menu/find?'+_0x1a6524['toString'](),{'cookie':_0x44d2d4,'label':_0x1e0b08(0x16e)});}export async function createMenuRecord(_0x277db0,_0x3ab1c6,_0x1e0125){const _0x5e5187=a222_0x11798a;return platformRequest(_0x5e5187(0x14c),{'method':_0x5e5187(0x259),'body':_0x277db0,'cookie':_0x3ab1c6,'label':_0x1e0125});}export async function updateMenuRecord(_0x23e1cd,_0x5a5877,_0x2b546f){const _0xe09bc1=a222_0x11798a;return platformRequest(_0xe09bc1(0x125),{'method':_0xe09bc1(0x259),'body':_0x23e1cd,'cookie':_0x5a5877,'label':_0x2b546f});}export async function deleteMenuRecord(_0x2abf99,_0x4882d5,_0x1b5ad8){const _0x1da80f=a222_0x11798a;return platformRequest(_0x1da80f(0x129),{'method':'POST','body':{'id':_0x2abf99},'cookie':_0x4882d5,'label':_0x1b5ad8});}export async function batchDeleteMenuRecords(_0x6f3964,_0x24a3d4,_0x571b8c){const _0x6bffab=a222_0x11798a;return platformRequest(_0x6bffab(0x194),{'method':_0x6bffab(0x259),'body':{'idList':_0x6f3964},'cookie':_0x24a3d4,'label':_0x571b8c});}export async function startMenuRegroup(_0x1b0b55,_0x44f0b5,_0x17600b){const _0xb1a095=a222_0x11798a;return platformRequest(_0xb1a095(0x217),{'method':_0xb1a095(0x259),'body':_0x1b0b55,'cookie':_0x44f0b5,'label':_0x17600b});}export async function getAsyncTaskStatus(_0x524425,_0x26265e,_0x1135b3){const _0xf896b7=a222_0x11798a,_0x4de181=new URLSearchParams({'appCode':_0x26265e});return platformRequest(_0xf896b7(0x244)+encodeURIComponent(_0x524425)+'?'+_0x4de181['toString'](),{'cookie':_0x1135b3,'label':_0xf896b7(0x20f)+_0x524425});}export async function listBffScripts(_0x36983e,_0x564dd3,_0x2afb4f){const _0x4bd5e0=a222_0x11798a;let _0x38a016=_0x4bd5e0(0x189)+_0x36983e;if(_0x564dd3)_0x38a016+=_0x4bd5e0(0x25d)+_0x564dd3;const _0x537270=await apiRequest(_0x38a016);let _0x4f2238=extractList(_0x537270[_0x4bd5e0(0x12b)]);if(_0x2afb4f?.['scriptName']){const _0x250f5f=_0x2afb4f[_0x4bd5e0(0x19f)][_0x4bd5e0(0x20d)]();_0x4f2238=_0x4f2238['filter'](_0xe3a4ed=>_0xe3a4ed[_0x4bd5e0(0x18f)]?.[_0x4bd5e0(0x20d)]()[_0x4bd5e0(0x1d2)](_0x250f5f)||_0xe3a4ed['description']?.[_0x4bd5e0(0x20d)]()[_0x4bd5e0(0x1d2)](_0x250f5f));}return _0x4f2238;}export async function getBffScriptInfo(_0x1f4fcb){const _0x4c19f7=a222_0x11798a,_0x98586f=await apiRequest(_0x4c19f7(0x1cd)+_0x1f4fcb);if(!_0x98586f['data'])throw CliErrors['validation'](_0x4c19f7(0x1cc)+_0x1f4fcb);return _0x98586f[_0x4c19f7(0x12b)];}export async function saveBffScript(_0x3479f2){const _0x489660=a222_0x11798a,_0x42f7ea=await apiRequest(_0x489660(0x1dc),{'method':_0x489660(0x259),'body':_0x3479f2}),{id:_0x188c30,entity:_0x5f1cf7}=normalizeEntityWithIdResponse(_0x42f7ea[_0x489660(0x12b)]);if(_0x188c30!==undefined){const _0x5d2b7d=typeof _0x5f1cf7[_0x489660(0x18f)]===_0x489660(0x25a)||typeof _0x5f1cf7[_0x489660(0x134)]===_0x489660(0x25a)?_0x5f1cf7:undefined;return{'id':_0x188c30,'script':_0x5d2b7d};}throw CliErrors[_0x489660(0x209)](_0x489660(0x14a));}export async function deleteBffScript(_0x470aa9){const _0x554822=a222_0x11798a;await apiRequest(_0x554822(0x159),{'method':_0x554822(0x259),'body':{'id':_0x470aa9}});}export async function getBffScriptStatistics(_0x2d58e8){const _0x4d2233=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x2d58e8);return extractList(_0x4d2233['data']);}export async function clearBffScriptCache(){const _0x4c4218=a222_0x11798a,_0x2dc479=await apiRequest('/api/management/script/cache/clear',{'method':_0x4c4218(0x259),'useRuntime':!![]});return typeof _0x2dc479[_0x4c4218(0x12b)]===_0x4c4218(0x25a)?_0x2dc479[_0x4c4218(0x12b)]:'';}export async function listBffDatasetOperations(_0x519872,_0x5ae0f0){const _0x5c01f2=a222_0x11798a,_0x927d60=await apiRequest(_0x5c01f2(0x1f7),{'method':_0x5c01f2(0x259),'body':{'appCode':_0x519872,'datasetId':_0x5ae0f0}});return _0x927d60[_0x5c01f2(0x12b)];}export async function listSqlQueries(_0x40cb7d,_0x216069){const _0x37f689=a222_0x11798a,_0x4509de=await apiRequest(_0x37f689(0x1da),{'method':'POST','body':{'appCode':_0x40cb7d,'currentPage':_0x216069?.[_0x37f689(0x131)]??0x1,'pageSize':_0x216069?.[_0x37f689(0x1bf)]??0x32,'sqlCode':_0x216069?.[_0x37f689(0x19d)],'sqlName':_0x216069?.[_0x37f689(0x16b)]}});return _0x4509de[_0x37f689(0x12b)];}export async function getSqlQueryInfo(_0x5c14ab,_0x5b3451){const _0x2154d8=a222_0x11798a,_0x613483=await listSqlQueries(_0x5c14ab,{'sqlCode':_0x5b3451}),_0x2ac9d0=_0x613483[_0x2154d8(0x249)]?.[0x0];if(!_0x2ac9d0)throw CliErrors[_0x2154d8(0x11e)]('SQL\x20query\x20not\x20found:\x20'+_0x5b3451);return _0x2ac9d0;}export async function getSqlQueryDetail(_0x2b6de6){const _0x46707b=a222_0x11798a,_0x775420=await apiRequest(_0x46707b(0x13f)+(_0x46707b(0x126)+encodeURIComponent(_0x2b6de6)));if(!_0x775420[_0x46707b(0x12b)])throw CliErrors['validation'](_0x46707b(0x227)+_0x2b6de6);return _0x775420[_0x46707b(0x12b)];}export async function getSqlQueryDetailById(_0x25c6ba){const _0x3f4732=a222_0x11798a,_0x214997=await apiRequest(_0x3f4732(0x1c5)+_0x25c6ba);if(!_0x214997[_0x3f4732(0x12b)])throw CliErrors[_0x3f4732(0x11e)](_0x3f4732(0x132)+_0x25c6ba);return _0x214997['data'];}export async function createSqlQuery(_0x51bafc){const _0x5eac71=a222_0x11798a,_0x332fb1=await apiRequest(_0x5eac71(0x1b1),{'method':_0x5eac71(0x259),'body':_0x51bafc}),{id:_0xa21768,entity:_0x565fbd}=normalizeEntityWithIdResponse(_0x332fb1[_0x5eac71(0x12b)]);if(!('sqlCode'in _0x565fbd)&&_0xa21768)return getSqlQueryDetailById(_0xa21768);return normalizeSqlQueryEntity(_0x565fbd);}export async function updateSqlQuery(_0x39a782){const _0x13ed90=a222_0x11798a,_0x10f9a0=await apiRequest('/smartapi/custom/updateUserCustomSql',{'method':_0x13ed90(0x259),'body':_0x39a782}),{id:_0x1a2009,entity:_0x2a4465}=normalizeEntityWithIdResponse(_0x10f9a0[_0x13ed90(0x12b)]);if(!(_0x13ed90(0x19d)in _0x2a4465)){if(_0x39a782[_0x13ed90(0x19d)])return getSqlQueryDetail(_0x39a782[_0x13ed90(0x19d)]);if(_0x1a2009)return getSqlQueryDetailById(_0x1a2009);}return normalizeSqlQueryEntity(_0x2a4465);}export async function deleteSqlQuery(_0x12adbb){const _0x1d4e89=a222_0x11798a;await apiRequest(_0x1d4e89(0x1f9),{'method':_0x1d4e89(0x259),'body':_0x12adbb});}export async function saveSqlQuery(_0x37496f){const _0x3791d6=a222_0x11798a,_0x1f475c=await apiRequest('/api/node-toolbox/sql/save',{'method':'POST','body':_0x37496f});return _0x1f475c[_0x3791d6(0x12b)];}function normalizeSqlQueryEntity(_0x495ed1){const _0x23c6d6=a222_0x11798a;return{..._0x495ed1,'id':Number(_0x495ed1['id']),'dbId':_0x495ed1[_0x23c6d6(0x1ed)]==null?undefined:Number(_0x495ed1[_0x23c6d6(0x1ed)]),'version':_0x495ed1[_0x23c6d6(0x23a)]==null?undefined:Number(_0x495ed1[_0x23c6d6(0x23a)])};}export async function executeSql(_0x30a579,_0x1e263a,_0x4eed17){const _0x4eb596=a222_0x11798a,_0x2cc497=await apiRequest(_0x4eb596(0x1e6),{'method':_0x4eb596(0x259),'body':{'appCode':_0x30a579,'sqlCode':_0x1e263a,..._0x4eed17&&{'params':_0x4eed17}},'useRuntime':!![]});return _0x2cc497[_0x4eb596(0x12b)];}export async function executeDatasetDataOperation(_0xf23325,_0x5db8fd,_0x9b70af,_0x4d1ea1={}){const _0x5423a9=a222_0x11798a;try{const _0x2648f1=await apiRequest(_0x5423a9(0x237)+_0xf23325+'/'+_0x5db8fd+'/'+_0x9b70af,{'method':_0x5423a9(0x259),'body':_0x4d1ea1,'useRuntime':!![]});return _0x2648f1['data'];}catch(_0xa638f){if(_0x9b70af===_0x5423a9(0x201)&&_0xa638f instanceof CliError&&_0xa638f[_0x5423a9(0x15b)]===_0x5423a9(0x1e3)&&_0x4d1ea1['id']!==undefined&&_0x4d1ea1['id']!==null&&_0x4d1ea1['id']!==''){const _0x2f5d37=await apiRequest('/api/'+_0xf23325+'/'+_0x5db8fd+_0x5423a9(0x242),{'method':_0x5423a9(0x259),'body':{'where':{'id':{'$eq':_0x4d1ea1['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x31540c=Array[_0x5423a9(0x18e)](_0x2f5d37['data']?.[_0x5423a9(0x249)])?_0x2f5d37[_0x5423a9(0x12b)][_0x5423a9(0x249)]:[];return _0x31540c[0x0]??null;}throw _0xa638f;}}export async function listDatasets(_0x476344,_0x2f3d18){const _0x2ce5f7=a222_0x11798a,_0x43b690={'appCode':_0x476344,'deleted':_0x2f3d18?.[_0x2ce5f7(0x19c)]??![]};if(_0x2f3d18?.[_0x2ce5f7(0x15b)])_0x43b690[_0x2ce5f7(0x15b)]=_0x2f3d18['code'];if(_0x2f3d18?.[_0x2ce5f7(0x1b3)])_0x43b690['name']=_0x2f3d18[_0x2ce5f7(0x1b3)];if(_0x2f3d18?.[_0x2ce5f7(0x1d9)])_0x43b690['source']=_0x2f3d18[_0x2ce5f7(0x1d9)];const _0x34edf1=await apiRequest(_0x2ce5f7(0x1a7),{'method':_0x2ce5f7(0x259),'body':_0x43b690});return extractList(_0x34edf1[_0x2ce5f7(0x12b)]);}export async function deleteDataset(_0x503c6b,_0x46851e){const _0x3c6bc1=a222_0x11798a;await apiRequest(_0x3c6bc1(0x193)+(_0x46851e?_0x3c6bc1(0x20e):'false'),{'method':_0x3c6bc1(0x259),'body':{'id':_0x503c6b}});}export async function restoreDataset(_0x1301ec,_0x409788){await apiRequest('/smartapi/dataset/restore-dataset',{'method':'POST','body':{'appCode':_0x1301ec,'datasetId':_0x409788}});}export async function listRecycleBinResources(_0x4da55a,_0x1ac087,_0x119be1){const _0x31188b=a222_0x11798a,_0x340d15=new URLSearchParams({'appCode':_0x4da55a,'resourceType':_0x1ac087,'currentPage':String(_0x119be1[_0x31188b(0x131)]),'pageSize':String(_0x119be1['pageSize'])});if(_0x119be1['resourceName'])_0x340d15[_0x31188b(0x141)](_0x31188b(0x25e),_0x119be1[_0x31188b(0x25e)]);const _0xf8f83d=await apiRequest(_0x31188b(0x251)+_0x340d15[_0x31188b(0x21a)]());return{'items':extractList(_0xf8f83d['data']),'paging':extractPaging(_0xf8f83d[_0x31188b(0x12b)])};}export async function restoreRecycleBinResource(_0x309330){const _0x1af7a2=a222_0x11798a;await apiRequest(_0x1af7a2(0x12d),{'method':_0x1af7a2(0x259),'body':{'id':_0x309330}});}export async function previewTextGeneratedDataset(_0x2b75d3,_0x12a1a8){const _0x450581=a222_0x11798a,_0x46db13=await apiRequest(_0x450581(0x1b5),{'method':_0x450581(0x259),'body':{'appCode':_0x2b75d3,'datasetName':_0x12a1a8[_0x450581(0x1e4)],'requirementDescription':_0x12a1a8[_0x450581(0x140)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x46db13[_0x450581(0x12b)];}export async function startTextGeneratedDataset(_0x413f1f,_0x4ccd60,_0x1827c5){const _0x4c3a2d=a222_0x11798a,_0x4e9eda=await apiRequest(_0x4c3a2d(0x25b),{'method':'POST','body':{'appCode':_0x413f1f,..._0x1827c5?.[_0x4c3a2d(0x120)]?{'clientOperationId':_0x1827c5[_0x4c3a2d(0x120)]}:{},'design':_0x4ccd60},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x4e9eda[_0x4c3a2d(0x12b)];}export async function getTextGeneratedDatasetStatus(_0x5d7c38,_0x9e424d){const _0x511869=a222_0x11798a,_0x3a49b6=new URLSearchParams({'appCode':_0x5d7c38});if(_0x9e424d[_0x511869(0x176)])_0x3a49b6[_0x511869(0x141)]('operationId',_0x9e424d['taskId']);else{if(_0x9e424d[_0x511869(0x15c)])_0x3a49b6[_0x511869(0x141)](_0x511869(0x15c),_0x9e424d[_0x511869(0x15c)]);else _0x9e424d[_0x511869(0x120)]&&_0x3a49b6[_0x511869(0x141)](_0x511869(0x120),_0x9e424d[_0x511869(0x120)]);}const _0x52aecf=await apiRequest(_0x511869(0x127)+_0x3a49b6[_0x511869(0x21a)]());return _0x52aecf[_0x511869(0x12b)];}export async function searchDatasets(_0xec891,_0x401775){const _0x4143de=a222_0x11798a,_0x4443af=await listDatasets(_0xec891,{'name':_0x401775}),_0x2c1243=_0x401775['toLowerCase'](),_0x326164=new Set(_0x4443af[_0x4143de(0x156)](_0x51642a=>_0x51642a['id'])),_0x1b2e6a=_0x4443af[_0x4143de(0x1fa)](_0x430d34=>_0x430d34[_0x4143de(0x238)]?.[_0x4143de(0x211)]?.['toLowerCase']()[_0x4143de(0x1d2)](_0x2c1243)||_0x430d34[_0x4143de(0x202)]?.[_0x4143de(0x20d)]()[_0x4143de(0x1d2)](_0x2c1243)),_0x72fb91=await listDatasets(_0xec891,{'code':_0x401775});for(const _0x5144ec of _0x72fb91){!_0x326164[_0x4143de(0x22f)](_0x5144ec['id'])&&(_0x4443af[_0x4143de(0x13b)](_0x5144ec),_0x326164[_0x4143de(0x133)](_0x5144ec['id']));}return _0x4443af;}export function normalizeDatasetOperations(_0x1b662b){const _0x5869dd=a222_0x11798a;if(Array[_0x5869dd(0x18e)](_0x1b662b))return _0x1b662b[_0x5869dd(0x1fa)](_0xf52b08=>_0xf52b08!=null&&typeof _0xf52b08===_0x5869dd(0x13d));if(_0x1b662b&&typeof _0x1b662b===_0x5869dd(0x13d))return Object[_0x5869dd(0x258)](_0x1b662b)['filter'](([,_0x425258])=>_0x425258!=null&&typeof _0x425258===_0x5869dd(0x13d))['map'](([_0x6bc102,_0x1ca453])=>({..._0x1ca453,'name':_0x1ca453[_0x5869dd(0x1b3)]??_0x1ca453['operationName']??_0x6bc102}));return[];}export async function getDatasetDetail(_0x3a1222){const _0x2348e8=a222_0x11798a,_0x456fc5=/^\d+$/[_0x2348e8(0x23c)](_0x3a1222)?'id':_0x2348e8(0x15b),_0x2f8596=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x456fc5+'='+_0x3a1222);return _0x2f8596[_0x2348e8(0x12b)];}export async function updateDrivenData(_0x5e1072){const _0x1dff3e=a222_0x11798a,_0x18a007=await apiRequest(_0x1dff3e(0x24f),{'method':_0x1dff3e(0x259),'body':_0x5e1072});return _0x18a007[_0x1dff3e(0x12b)];}export async function getDatasetOperations(_0x397655){const _0x4f5db9=a222_0x11798a,_0x42bd7e=await getDatasetDetail(_0x397655),_0x2dedb9=normalizeDatasetOperations(_0x42bd7e[_0x4f5db9(0x178)])[_0x4f5db9(0x156)](_0x169e01=>({'name':_0x169e01['name']||_0x169e01[_0x4f5db9(0x142)],'displayName':_0x169e01['displayName']||_0x169e01[_0x4f5db9(0x1b3)],'type':_0x169e01[_0x4f5db9(0x1c7)],'method':_0x169e01[_0x4f5db9(0x153)],'path':_0x169e01[_0x4f5db9(0x1fe)],'enabled':_0x169e01[_0x4f5db9(0x223)]??!![],'requestFields':_0x169e01[_0x4f5db9(0x192)],'responseFields':_0x169e01[_0x4f5db9(0x1d5)]}));return{'dataset':{'id':_0x42bd7e['id']??_0x42bd7e[_0x4f5db9(0x1cb)],'name':_0x42bd7e[_0x4f5db9(0x1b3)],'code':_0x42bd7e['code']||_0x42bd7e['modelCode'],'tableName':_0x42bd7e[_0x4f5db9(0x211)]||_0x42bd7e[_0x4f5db9(0x238)]?.[_0x4f5db9(0x211)]},'operations':_0x2dedb9};}export async function getOperationDetail(_0x50d952,_0x43fef6,_0x47f701){const _0x4954e=a222_0x11798a;let _0x33e808=_0x43fef6;if(!/^\d+$/[_0x4954e(0x23c)](_0x43fef6)){const _0x5ca014=await listDatasets(_0x50d952,{'code':_0x43fef6}),_0x106a13=_0x5ca014[_0x4954e(0x229)](_0x19b061=>_0x19b061[_0x4954e(0x15b)]===_0x43fef6||String(_0x19b061['id'])===_0x43fef6);if(!_0x106a13)throw CliErrors[_0x4954e(0x11e)](_0x4954e(0x22b)+_0x43fef6);_0x33e808=String(_0x106a13['id']);}const _0x3bccc5=await getDatasetDetail(_0x33e808),_0x21946d=normalizeDatasetOperations(_0x3bccc5['operations'])[_0x4954e(0x229)](_0x5d9a03=>(_0x5d9a03['name']||_0x5d9a03[_0x4954e(0x142)])===_0x47f701);if(!_0x21946d)throw CliErrors['validation'](_0x4954e(0x24e)+_0x47f701+_0x4954e(0x155)+_0x43fef6);return{'dataset':{'id':_0x3bccc5['id']??_0x3bccc5[_0x4954e(0x1cb)],'name':_0x3bccc5['name'],'code':_0x3bccc5[_0x4954e(0x15b)]||_0x3bccc5[_0x4954e(0x11f)],'tableName':_0x3bccc5['tableName']||_0x3bccc5[_0x4954e(0x238)]?.['tableName']},'operation':_0x21946d};}export async function getAppInfo(_0x4269b1){const _0x139524=a222_0x11798a,_0x2fdea5=await apiRequest(_0x139524(0x11c)+buildQuery({'appCode':_0x4269b1}));return _0x2fdea5[_0x139524(0x12b)];}export async function getI18nInfo(_0x3d0eb4){const _0x52e328=a222_0x11798a,_0x140bba=await getAppInfo(_0x3d0eb4);return{'enableI18n':_0x140bba[_0x52e328(0x150)],..._0x140bba['i18nInfo']};}export async function createCustomPage(_0x258e4f){const _0x1311e7=a222_0x11798a,_0x58cb0b=await apiRequest('/smartapi/webcode/page/create',{'method':_0x1311e7(0x259),'body':{'appCode':_0x258e4f[_0x1311e7(0x1ee)],'pageName':_0x258e4f[_0x1311e7(0x166)],..._0x258e4f['parentMenuId']!=null?{'parentMenuId':_0x258e4f[_0x1311e7(0x123)]}:{},'createMenu':_0x258e4f['createMenu'],'codeContent':_0x258e4f[_0x1311e7(0x121)]}});return{'pageId':_0x58cb0b[_0x1311e7(0x12b)][_0x1311e7(0x1d4)],'pageName':_0x58cb0b[_0x1311e7(0x12b)][_0x1311e7(0x124)]??_0x258e4f[_0x1311e7(0x166)],'appCode':_0x258e4f[_0x1311e7(0x1ee)],'version':_0x58cb0b[_0x1311e7(0x12b)]['draftVersion']??0x0,'menuId':_0x58cb0b[_0x1311e7(0x12b)][_0x1311e7(0x248)]?.['id']??null,'menuPath':_0x58cb0b[_0x1311e7(0x12b)][_0x1311e7(0x248)]?.['path']??null,'files':_0x58cb0b[_0x1311e7(0x12b)][_0x1311e7(0x121)]};}export async function updateCustomPageContent(_0x3889c6){const _0xb49c89=a222_0x11798a,_0x4e2e81=await apiRequest(_0xb49c89(0x253),{'method':_0xb49c89(0x259),'body':{'id':_0x3889c6[_0xb49c89(0x1d4)],'codeContent':_0x3889c6[_0xb49c89(0x243)]}});return{'pageId':_0x3889c6['pageId'],'newVersion':_0x4e2e81[_0xb49c89(0x12b)]};}function a222_0x3de7(_0x158d9e,_0x253885){_0x158d9e=_0x158d9e-0x119;const _0x401c9d=a222_0x401c();let _0x3de7bb=_0x401c9d[_0x158d9e];return _0x3de7bb;}export async function publishCustomPage(_0x3b6ef4){const _0x419aa4=a222_0x11798a,_0x49e573=await apiRequest(_0x419aa4(0x1ba),{'method':_0x419aa4(0x259),'body':{'id':_0x3b6ef4[_0x419aa4(0x1d4)],..._0x3b6ef4[_0x419aa4(0x196)]?{'remark':_0x3b6ef4[_0x419aa4(0x196)]}:{}}});return _0x49e573[_0x419aa4(0x12b)];}export async function getCustomPageSource(_0x5c53ae){const _0x8d2fd9=a222_0x11798a,_0x5121e0=await apiRequest(_0x8d2fd9(0x1a0)+buildQuery({'id':_0x5c53ae}));if(!_0x5121e0[_0x8d2fd9(0x12b)])throw CliErrors[_0x8d2fd9(0x11e)](_0x8d2fd9(0x1be)+_0x5c53ae);return _0x5121e0[_0x8d2fd9(0x12b)];}export async function startGenerateDataListPages(_0x1b0a7a,_0x3d65e5,_0x3bf104){const _0x2b0b04=a222_0x11798a,_0x25e5fb=await apiRequest(_0x2b0b04(0x1dd)+_0x3d65e5+_0x2b0b04(0x22e),{'method':_0x2b0b04(0x259),'body':{'appCode':_0x1b0a7a,..._0x3bf104?.[_0x2b0b04(0x120)]?{'clientOperationId':_0x3bf104['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x25e5fb['data'];}export async function getGenerateDataListPagesStatus(_0x21d00e,_0x1f741b,_0x4fa8de){const _0x19afbc=a222_0x11798a,_0x16f6dc=_0x4fa8de[_0x19afbc(0x176)]?.[_0x19afbc(0x163)](),_0x1e416b=_0x4fa8de[_0x19afbc(0x15c)]?.[_0x19afbc(0x163)](),_0x4bd9f0=_0x4fa8de[_0x19afbc(0x120)]?.[_0x19afbc(0x163)](),_0x3f700c=[_0x16f6dc,_0x1e416b,_0x4bd9f0][_0x19afbc(0x1fa)](Boolean)['length'];if(_0x3f700c!==0x1)throw CliErrors[_0x19afbc(0x11e)](_0x19afbc(0x12a));const _0x35b430=new URLSearchParams({'appCode':_0x21d00e});_0x16f6dc&&_0x35b430[_0x19afbc(0x141)]('taskId',_0x16f6dc);_0x1e416b&&_0x35b430[_0x19afbc(0x141)](_0x19afbc(0x15c),_0x1e416b);_0x4bd9f0&&_0x35b430[_0x19afbc(0x141)](_0x19afbc(0x120),_0x4bd9f0);const _0x293efe=await apiRequest(_0x19afbc(0x1dd)+_0x1f741b+_0x19afbc(0x234)+_0x35b430['toString']());return _0x293efe['data'];}export async function getDataListPageStatus(_0x44b239,_0xd76742){const _0x50f012=a222_0x11798a,_0x4bd50c=await apiRequest(_0x50f012(0x1dd)+_0xd76742+_0x50f012(0x222)+encodeURIComponent(_0x44b239));return _0x4bd50c['data'];}export async function tryGetDataListPageStatus(_0x4b6a86,_0x599f20){const _0x481912=a222_0x11798a;try{return await getDataListPageStatus(_0x4b6a86,_0x599f20);}catch(_0x22e917){if(_0x22e917 instanceof CliError&&_0x22e917['code']===_0x481912(0x1e3)&&/404|not found|non-json response/i[_0x481912(0x23c)](_0x22e917[_0x481912(0x22c)]))return null;throw _0x22e917;}}export async function syncDataListPages(_0x282de0,_0x5cc3a9){const _0xa7aa8d=a222_0x11798a,_0xb6b1cc=await apiRequest(_0xa7aa8d(0x1dd)+_0x5cc3a9+_0xa7aa8d(0x232),{'method':_0xa7aa8d(0x259),'body':{'appCode':_0x282de0}});return _0xb6b1cc['data'];}export async function getPageDetail(_0x273e18){const _0x4e4f68=a222_0x11798a,_0x589083=await apiRequest(_0x4e4f68(0x1d6)+_0x273e18);if(!_0x589083[_0x4e4f68(0x12b)])throw CliErrors['validation'](_0x4e4f68(0x148)+_0x273e18);return _0x589083[_0x4e4f68(0x12b)];}export async function listDeletedPages(_0x3f99ab,_0x3e3b53,_0x578360){const _0x4b1788=a222_0x11798a,_0x16f2f6=toBackendDeletedPageType(_0x3e3b53),_0x4e4e4a=new URLSearchParams({'appCode':_0x3f99ab,'type':_0x16f2f6,'currentPage':String(_0x578360[_0x4b1788(0x131)]),'pageSize':String(_0x578360['pageSize'])}),_0x2408d3=await apiRequest(_0x4b1788(0x151)+_0x4e4e4a[_0x4b1788(0x21a)]());return{..._0x2408d3[_0x4b1788(0x12b)],'tableData':(_0x2408d3[_0x4b1788(0x12b)][_0x4b1788(0x249)]??[])[_0x4b1788(0x156)](_0x6d4521=>{const _0x59938d=_0x4b1788;if(_0x6d4521[_0x59938d(0x252)]!==undefined&&_0x6d4521['pageType']!==_0x16f2f6)throw CliErrors['apiError'](_0x59938d(0x228)+_0x3e3b53+'.');return{..._0x6d4521,'pageType':_0x3e3b53};})};}export async function restoreDataListPage(_0x2353e8){const _0x1012b6=a222_0x11798a;await apiRequest(_0x1012b6(0x14b),{'method':_0x1012b6(0x259),'body':{'id':_0x2353e8}});}export async function restoreCustomPage(_0x402d65,_0xea55a1){const _0x337bc2=a222_0x11798a,_0x269a97=await apiRequest(_0x337bc2(0x21e),{'method':_0x337bc2(0x259),'body':{'appCode':_0x402d65,'id':_0xea55a1}});return _0x269a97['data'];}function toBackendDeletedPageType(_0x580cbf){const _0x1feb73=a222_0x11798a;return _0x580cbf===_0x1feb73(0x18a)?_0x1feb73(0x255):'JSX';}export async function updatePage(_0x124cd3,_0x345dd3,_0x411431,_0x51ac16){const _0x484209=a222_0x11798a,_0x116eb3=await apiRequest(_0x484209(0x175),{'method':_0x484209(0x259),'body':{'appCode':_0x124cd3,'pageId':_0x345dd3,'code':_0x411431,'datasetIds':_0x51ac16}});return _0x116eb3[_0x484209(0x12b)];}export function generateSdkCode(_0x34f410,_0x56a347,_0x4f5d8f){const _0x4cfd73=a222_0x11798a,_0x1feeba=_0x4f5d8f?.[_0x4cfd73(0x197)]??!![],_0x406f1a=_0x4cfd73(0x206)+_0x34f410[_0x4cfd73(0x15b)]?.[_0x4cfd73(0x21c)](/-/g,'_'),_0x657e48=_0x56a347[_0x4cfd73(0x1b3)]||_0x56a347[_0x4cfd73(0x142)]||_0x4cfd73(0x1fa),_0x37c273=[];_0x1feeba&&_0x37c273[_0x4cfd73(0x13b)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x4cfd73(0x247),'');_0x37c273['push'](_0x4cfd73(0x191)+_0x34f410[_0x4cfd73(0x1b3)]+'\x20('+(_0x34f410['tableName']||_0x4cfd73(0x1b4))+')');if(_0x657e48===_0x4cfd73(0x1fa))_0x37c273[_0x4cfd73(0x13b)](_0x4cfd73(0x246)+_0x406f1a+_0x4cfd73(0x1a4),'\x20\x20where:\x20{},','\x20\x20pageSize:\x2020,',_0x4cfd73(0x24a),'});');else{if(_0x657e48==='getOne')_0x37c273[_0x4cfd73(0x13b)](_0x4cfd73(0x246)+_0x406f1a+_0x4cfd73(0x173));else{if(_0x657e48==='create')_0x37c273[_0x4cfd73(0x13b)]('const\x20result\x20=\x20await\x20client.models.'+_0x406f1a+_0x4cfd73(0x1ff));else{if(_0x657e48===_0x4cfd73(0x21d))_0x37c273[_0x4cfd73(0x13b)](_0x4cfd73(0x246)+_0x406f1a+_0x4cfd73(0x19a));else _0x657e48==='delete'||_0x657e48===_0x4cfd73(0x130)?_0x37c273[_0x4cfd73(0x13b)](_0x4cfd73(0x246)+_0x406f1a+_0x4cfd73(0x187)):_0x37c273[_0x4cfd73(0x13b)](_0x4cfd73(0x246)+_0x406f1a+'.'+_0x657e48+_0x4cfd73(0x169));}}}return _0x37c273[_0x4cfd73(0x171)]('\x0a');}export function generateSqlCodeTemplate(_0x1fbae8,_0x2cd7b6){const _0x828bee=a222_0x11798a,_0x19a0cb=_0x2cd7b6?.[_0x828bee(0x200)]??_0x828bee(0x20b),_0x1ad44=_0x2cd7b6?.[_0x828bee(0x197)]??!![],_0x22a154=[];return _0x22a154['push'](_0x19a0cb===_0x828bee(0x16c)?_0x828bee(0x17b)+_0x1fbae8[_0x828bee(0x16b)]:_0x828bee(0x17b)+_0x1fbae8['sqlName']+'\x20('+_0x1fbae8[_0x828bee(0x19d)]+')'),_0x19a0cb===_0x828bee(0x20b)?(_0x1ad44&&_0x22a154[_0x828bee(0x13b)](_0x828bee(0x195),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x22a154['push'](_0x828bee(0x17f),_0x828bee(0x19e)+_0x1fbae8['sqlCode']+'\x27,',_0x828bee(0x1f1),_0x828bee(0x164),_0x828bee(0x167),_0x828bee(0x152))):_0x22a154[_0x828bee(0x13b)]('//\x20Backend\x20Function\x20context:\x20resolve\x20Custom\x20SQL\x20by\x20its\x20stable\x20semantic\x20name;\x20rows\x20are\x20returned\x20directly',_0x828bee(0x1ad),_0x828bee(0x23f)+JSON[_0x828bee(0x1d3)](_0x1fbae8[_0x828bee(0x16b)])+').execute({',_0x828bee(0x1df),_0x828bee(0x1aa),_0x828bee(0x157),'}'),_0x22a154[_0x828bee(0x171)]('\x0a');}export async function getErConfig(_0x42f4f1,_0x3dd86e){const _0x2c1a58=a222_0x11798a,_0x1ce843=await apiRequest(_0x2c1a58(0x15e),{'method':'POST','body':{'appCode':_0x42f4f1,'dblinkId':_0x3dd86e},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x1ce843['data'];}export async function getErRelationDetail(_0x2153f5,_0x31926a){const _0x58b654=a222_0x11798a,_0x300a33=new URLSearchParams({'appCode':_0x2153f5,'relationId':String(_0x31926a)});try{const _0x15d045=await apiRequest(_0x58b654(0x21f)+_0x300a33['toString']());return _0x15d045[_0x58b654(0x12b)]?.['relation']??null;}catch(_0xadc90a){if(_0xadc90a instanceof CliError&&_0xadc90a[_0x58b654(0x15b)]===_0x58b654(0x1e3)&&(_0xadc90a[_0x58b654(0x162)]?.[_0x58b654(0x1d2)](_0x58b654(0x1de))||_0xadc90a[_0x58b654(0x162)]===_0x58b654(0x17d)&&_0xadc90a[_0x58b654(0x22c)]===_0x58b654(0x198)))return null;throw _0xadc90a;}}export async function createErRelation(_0xd659b8){const _0xf9e081=a222_0x11798a,_0x2f99f3=await apiRequest(_0xf9e081(0x183),{'method':_0xf9e081(0x259),'body':_0xd659b8,'allowNonJsonSuccess':!![]});return _0x2f99f3[_0xf9e081(0x12b)];}export async function updateErRelation(_0x134e86){const _0x3a5783=a222_0x11798a,_0x10304c=await apiRequest(_0x3a5783(0x1c2),{'method':_0x3a5783(0x259),'body':_0x134e86,'allowNonJsonSuccess':!![]});return _0x10304c['data'];}export async function deleteErRelation(_0x28cbfb){const _0x2631d2=a222_0x11798a,_0xf20271=await apiRequest('/smartapi/question/er-config/cli/delete-single',{'method':_0x2631d2(0x259),'body':_0x28cbfb,'allowNonJsonSuccess':!![]});return _0xf20271['data'];}function a222_0x401c(){const _0x2c0791=['/api/custom/executeSql','createTime','company','/notification/channel-config/delete','value','2339449wDpSIJ','errorMsg','dbId','appCode','/smartapi/knowledge/company-public/search','Knowledge\x20search\x20response\x20contains\x20an\x20invalid\x20','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','body','\x20hits,\x20exceeding\x20topK\x20','12IOTulw','authRequired','roleName','/smartapi/dataset/get-dataset-operation','Fetch\x20doc\x20(','/smartapi/custom/deleteUserCustomSql','filter','517GDiLEe','append','Get\x20enterprise\x20knowledge\x20base','path','.create({\x20/*\x20fields\x20*/\x20});','target','getOne','description','/userTenant/queryBelongsTenants','/smartapi/dblink/connect','/notification/channel-config/','dataset_','Search\x20company\x20and\x20public\x20knowledge','cli:rabetbase','apiError','/smartapi/dblink/delete','sdk',',\x20HTTP\x20','toLowerCase','true','Fetch\x20async\x20task\x20','configArray','tableName','totalCount','Knowledge-base\x20pageSize\x20must\x20be\x20an\x20integer\x20between\x201\x20and\x20','/userTenant/getByTenantCode','content','/smartapi/dblink/getList','/smartapi/menu/regroup','list','Knowledge\x20search\x20appCode\x20is\x20required.','toString','isSafeInteger','replace','update','/smartapi/webcode/page/restore','/smartapi/question/er-config/cli/detail?','info','/smartapi/app-config/update','/standard-page-status?appCode=','enabled','List\x20enterprise\x20knowledge\x20bases','/smartapi/permit/user-role/get-user-list','/smartapi/db-analysis/status/','SQL\x20query\x20not\x20found:\x20','Deleted\x20page\x20list\x20response\x20type\x20does\x20not\x20match\x20requested\x20','find','/smartapi/dblink/table-diff/analyze/start','Dataset\x20not\x20found:\x20','message','Request\x20timeout:\x20','/generate-standard-pages/start','has','/smartapi/question/er-config/business-group/edit','Update\x20enterprise\x20knowledge\x20base','/sync-to-pages','weightedScore','/generate-standard-pages/status?','label','startsWith','/api/','dbtableConfig','url','version','/smartapi/app-config/list','test','/smartapi/permit/role/delete','mobile','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.byName(','/admin/knowledge-base/update','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','/filter','pageContent','/smartapi/tasks/','1184997YZtjgb','const\x20result\x20=\x20await\x20client.models.','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','menu','tableData','\x20\x20currentPage:\x201,','/smartapi/permit/user-role/delete','error','List\x20enterprise\x20knowledge\x20bases\x20returned\x20an\x20invalid\x20response\x20contract.','Operation\x20\x22','/smartapi/dataset/update-driven-data','query','/smartapi/recycleBin/resource/list?','pageType','/smartapi/webcode/page/update/content','/smartapi/app/getList','STANDARD','/admin/knowledge-base/delete','GET','entries','POST','string','/smartapi/dataset/text-generate/start','topK','&type=','resourceName','/smartapi/app-config/getByKey','/smartapi/app-config/delete','updateTime','/smartapi/app/getOne','datasetTableCount','validation','modelCode','clientOperationId','files','\x20of\x20','parentMenuId','materialName','/smartapi/menu/update','?sqlCode=','/smartapi/dataset/text-generate/status?','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','/smartapi/menu/delete','Exactly\x20one\x20of\x20taskId,\x20operationId,\x20or\x20clientOperationId\x20is\x20required.','data','roleId','/smartapi/recycleBin/resource/restore','/api/node-toolbox/dataset/model-list?','summary','remove','currentPage','SQL\x20query\x20not\x20found:\x20id=','add','scriptType','/smartapi/permit/role/update','/smartapi/dblink/getTableDiffV2ByPage','scope','/notification/channel-config/update','/smartapi/question/er-config/business-groups','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','push','15506lybOsB','object','3tJSSGt','/smartapi/custom/getUserCustomSql','requirementDescription','set','operationName','Knowledge-base\x20API\x20returned\x20an\x20invalid\x20record\x20contract.','kbRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','userTenantRelationList','Invalid\x20response\x20format\x20(','8BsNglE','Page\x20not\x20found:\x20','fetch-model-list','Backend\x20Function\x20save\x20returned\x20no\x20valid\x20id','/smartapi/page/restore','/smartapi/menu/create','PUBLIC','/smartapi/ocr/recognize-text?','Warning:\x20showing\x20first\x20','enableI18n','/smartapi/page/getDeletedPageList?','const\x20results\x20=\x20data.execResult\x20||\x20[];','method','/smartapi/common/uploadFile','\x22\x20not\x20found\x20in\x20dataset\x20','map','\x20\x20return\x20rows;','array','/api/management/library/scripts/delete','3105171pdrlvs','code','operationId','Knowledge-base\x20update\x20requires\x20title\x20or\x20content.','/smartapi/question/er-config','platform-error-code','0000','warn','hint','trim','});','/smartapi/db-analysis/start','pageName','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','key','(/*\x20params\x20*/);','72530LSQsbz','sqlName','bff','personal','Fetch\x20menu\x20list','/smartapi/user-accounts/cli/dingding-sandbox/bind','success','join','status','.getOne(id);','defineProperty','/smartapi/lovrabet/update-page','taskId','UNAUTHORIZED','operations','/smartapi/dblink/getOne','API\x20error:\x20','//\x20SQL:\x20','userId','API\x20error\x20code:\x20306','abort','const\x20data\x20=\x20await\x20client.sql.execute({','jsonPath','min','301636ClSNly','/smartapi/question/er-config/cli/erCreate','tags','485095qEyKIk','/api/node-toolbox/api-doc-generator','.remove(id);','Fetching\x20model\x20list\x20from\x20server...\x20(env:\x20','/api/management/library/scripts/list?appCode=','DATA_LIST','username','cookie','API\x20error\x20code:\x20','isArray','functionName','\x20failed','//\x20','requestFields','/smartapi/dataset/delete?cascade=','/smartapi/menu/batchDelete','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','remark','includeImports','ER\x20relation\x20does\x20not\x20exist','Knowledge\x20search\x20topK\x20must\x20be\x20a\x20positive\x20integer.','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','json','deleted','sqlCode','\x20\x20sqlCode:\x20\x27','scriptName','/smartapi/webcode/page/detail','application/json','errorCode','Knowledge\x20search\x20response\x20contains\x20an\x20invalid\x20scope.','.filter({','roleType','docId','/smartapi/dataset/get-dataset-list','AbortError','\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20after\x20HTTP\x20success.','\x20\x20});','isFinite','/smartapi/dblink/create','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','email','isInteger','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','/smartapi/custom/saveUserCustomSql','tableList','name','table','/smartapi/dataset/text-generate/preview','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','markdown','\x20apps.\x20','\x20failed,\x20HTTP\x20','/smartapi/webcode/file/publish','/admin/knowledge-base/create','jsonData','Create\x20enterprise\x20knowledge\x20base','Custom\x20Page\x20not\x20found:\x20','pageSize','physicalTableCount','401','/smartapi/question/er-config/cli/update-single','number','/smartapi/common/queryFileUrl','/smartapi/custom/getUserCustomSql?id=','NaN','type','download','/notification/channel-config/create','file','modelId','Backend\x20Function\x20script\x20not\x20found:\x20id=','/api/management/library/scripts/info?id=','/smartapi/app-config/create','length','/smartapi/permit/user-role/create','):\x20missing\x20data.markdown\x20field','includes','stringify','pageId','responseFields','/smartapi/lovrabet/detail?pageId=','Expected\x20the\x20server\x20data\x20field\x20to\x20be\x20an\x20array.','pageIndex','source','/smartapi/custom/queryUserCustomSqlList','max','/api/management/library/scripts/save','/smartapi/lovrabet/dataset/','DATA_NOT_EXIST','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','score','hits','List\x20enterprise\x20knowledge\x20bases\x20returned\x20invalid\x20paging\x20metadata.','api_error','datasetName','title'];a222_0x401c=function(){return _0x2c0791;};return a222_0x401c();}export async function updateErBusinessGroup(_0x53fed0){const _0x244bde=a222_0x11798a,_0xaa4958=await apiRequest(_0x244bde(0x230),{'method':_0x244bde(0x259),'body':_0x53fed0,'allowNonJsonSuccess':!![]});return _0xaa4958[_0x244bde(0x12b)];}export async function getErBusinessGroupSummary(_0x580b51,_0x426c1b){const _0x4f0c63=a222_0x11798a,_0x5cd644=await apiRequest(_0x4f0c63(0x139),{'method':_0x4f0c63(0x259),'body':{'appCode':_0x580b51,'dblinkId':_0x426c1b}});return _0x5cd644[_0x4f0c63(0x12b)];}function buildQuery(_0x4bd785){const _0x24d690=a222_0x11798a,_0xace0db=new URLSearchParams();for(const [_0xf09b96,_0x3f4eae]of Object[_0x24d690(0x258)](_0x4bd785)){if(_0x3f4eae===undefined||_0x3f4eae==='')continue;_0xace0db[_0x24d690(0x141)](_0xf09b96,String(_0x3f4eae));}const _0x5a2d85=_0xace0db[_0x24d690(0x21a)]();return _0x5a2d85?'?'+_0x5a2d85:'';}export async function listNotificationChannelConfigs(_0x470073,_0xdcb273){const _0x2f9e05=a222_0x11798a,_0x46b33f=await apiRequest('/notification/channel-config/list'+buildQuery({'appCode':_0x470073,'channelType':_0xdcb273}));if(!Array[_0x2f9e05(0x18e)](_0x46b33f[_0x2f9e05(0x12b)]))throw CliErrors[_0x2f9e05(0x209)]('Invalid\x20notification\x20config\x20list\x20response.',_0x2f9e05(0x1d7));return _0x46b33f[_0x2f9e05(0x12b)];}export async function getNotificationChannelConfig(_0x538bab,_0x4709dd){const _0x5ad9c8=a222_0x11798a,_0x2b762a=await apiRequest(_0x5ad9c8(0x205)+_0x538bab+buildQuery({'appCode':_0x4709dd}));return _0x2b762a['data'];}export async function createNotificationChannelConfig(_0xab4a5e){const _0x17ed69=a222_0x11798a,_0x11b1e1=await apiRequest(_0x17ed69(0x1c9),{'method':'POST','body':_0xab4a5e,'indeterminateMutation':!![]});return _0x11b1e1[_0x17ed69(0x12b)];}export async function updateNotificationChannelConfig(_0x3c92f5){const _0x1a19e1=a222_0x11798a;await apiRequest(_0x1a19e1(0x138),{'method':'POST','body':_0x3c92f5,'indeterminateMutation':!![]});}export async function deleteNotificationChannelConfig(_0x159033,_0x1309bd){const _0x10e59f=a222_0x11798a;await apiRequest(_0x10e59f(0x1e9),{'method':_0x10e59f(0x259),'body':{'id':_0x159033,'appCode':_0x1309bd},'indeterminateMutation':!![]});}export async function listAppConfigs(_0x539f93,_0x2a4164){const _0xa26cbe=a222_0x11798a,_0x2dd547=await apiRequest(_0xa26cbe(0x23b),{'method':_0xa26cbe(0x259),'body':{'appCode':_0x539f93,..._0x2a4164?.[_0xa26cbe(0x168)]?{'key':_0x2a4164[_0xa26cbe(0x168)]}:{},..._0x2a4164?.[_0xa26cbe(0x184)]?{'tags':_0x2a4164[_0xa26cbe(0x184)]}:{}}});return extractAppConfigList(_0x2dd547[_0xa26cbe(0x12b)]);}export async function getAppConfigByKey(_0x3c1c99,_0x581ed7){const _0x1a3603=a222_0x11798a,_0x1ca502=await apiRequest(_0x1a3603(0x119)+buildQuery({'appCode':_0x3c1c99,'key':_0x581ed7}));return _0x1ca502[_0x1a3603(0x12b)]??null;}export async function createAppConfig(_0x3d884a){const _0x5104a1=a222_0x11798a,_0x33c65d=await apiRequest(_0x5104a1(0x1ce),{'method':_0x5104a1(0x259),'body':{'appCode':_0x3d884a[_0x5104a1(0x1ee)],'key':_0x3d884a[_0x5104a1(0x168)],'value':_0x3d884a[_0x5104a1(0x1ea)],..._0x3d884a['tags']?{'tags':_0x3d884a['tags']}:{}}});return _0x33c65d['data'];}export async function updateAppConfig(_0x12c848){const _0x5356b5=a222_0x11798a;await apiRequest(_0x5356b5(0x221),{'method':_0x5356b5(0x259),'body':{'id':_0x12c848['id'],'appCode':_0x12c848[_0x5356b5(0x1ee)],'key':_0x12c848[_0x5356b5(0x168)],'value':_0x12c848[_0x5356b5(0x1ea)],..._0x12c848[_0x5356b5(0x184)]?{'tags':_0x12c848[_0x5356b5(0x184)]}:{}}});}export async function deleteAppConfig(_0x4679f2){const _0x1f44c6=a222_0x11798a;await apiRequest(_0x1f44c6(0x11a),{'method':_0x1f44c6(0x259),'body':_0x4679f2});}function extractAppConfigList(_0x5a7a6f){const _0x4abfbf=a222_0x11798a;if(Array[_0x4abfbf(0x18e)](_0x5a7a6f))return _0x5a7a6f;if(_0x5a7a6f&&typeof _0x5a7a6f===_0x4abfbf(0x13d)&&Array[_0x4abfbf(0x18e)](_0x5a7a6f[_0x4abfbf(0x218)]))return _0x5a7a6f[_0x4abfbf(0x218)];return extractList(_0x5a7a6f);}export async function listDbLinks(_0x115c3f,_0xabb76e){const _0x5e3490=a222_0x11798a,_0x36051e=await apiRequest(_0x5e3490(0x216),{'method':'POST','body':{'appCode':_0x115c3f,'currentPage':_0xabb76e?.['currentPage']??0x1,'pageSize':_0xabb76e?.['pageSize']??0x64}});return{'items':extractList(_0x36051e[_0x5e3490(0x12b)]),'paging':extractPaging(_0x36051e[_0x5e3490(0x12b)])};}export async function getDbLinkInfo(_0x202f73){const _0x1eb855=a222_0x11798a,_0x16f290=await apiRequest(_0x1eb855(0x179)+buildQuery({'id':_0x202f73}));return _0x16f290[_0x1eb855(0x12b)];}export async function createDbLink(_0x39a287){const _0x17f746=a222_0x11798a,_0x40b3f6=await apiRequest(_0x17f746(0x1ac),{'method':_0x17f746(0x259),'body':_0x39a287});return _0x40b3f6[_0x17f746(0x12b)];}export async function updateDbLink(_0xc3fdd2){const _0x5d09d2=a222_0x11798a,_0x58dbe6=await apiRequest('/smartapi/dblink/update',{'method':_0x5d09d2(0x259),'body':_0xc3fdd2});return _0x58dbe6['data'];}export async function deleteDbLink(_0x2d98e4){const _0x91e44b=a222_0x11798a;await apiRequest(_0x91e44b(0x20a),{'method':'POST','body':{'id':_0x2d98e4}});}export async function testDbLinkConnect(_0x52888d){const _0x5b8f2b=a222_0x11798a,_0x2c5784=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x52888d}));return _0x2c5784[_0x5b8f2b(0x12b)];}export async function testDbLinkConfigConnect(_0x162de4){const _0xffcc10=a222_0x11798a,_0x3638d5=await apiRequest(_0xffcc10(0x204),{'method':'POST','body':_0x162de4});return _0x3638d5[_0xffcc10(0x12b)];}export async function startDbAnalysis(_0x52f65b,_0x3a7388){const _0x4b72bd=a222_0x11798a,_0x18241c=await apiRequest(_0x4b72bd(0x165),{'method':'POST','body':{'dbLinkId':_0x52f65b,..._0x3a7388&&_0x3a7388['length']>0x0?{'tableNames':_0x3a7388}:{}}});return _0x18241c[_0x4b72bd(0x12b)];}export async function cancelDbAnalysis(_0x54cc7a){const _0x280eba=a222_0x11798a;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x54cc7a}),{'method':_0x280eba(0x259)});}export async function getDbAnalysisStatus(_0x1ed7b9){const _0x5178ec=a222_0x11798a,_0x3a5288=await apiRequest(_0x5178ec(0x226)+encodeURIComponent(_0x1ed7b9));return _0x3a5288[_0x5178ec(0x12b)];}export async function getDbTableDiff(_0x293109,_0x270cc0,_0x1fd808){const _0x519866=a222_0x11798a,_0x35563d=await apiRequest('/smartapi/dblink/getDiffTableByPage'+buildQuery({'appCode':_0x293109,'dbLinkId':_0x270cc0,'pageIndex':_0x1fd808?.[_0x519866(0x1d8)]??0x1,'pageSize':_0x1fd808?.[_0x519866(0x1bf)]??0x14,'tableName':_0x1fd808?.[_0x519866(0x211)]})),_0x54e59b=_0x35563d[_0x519866(0x12b)];return{'totalCount':_0x54e59b?.['totalCount']??0x0,...typeof _0x54e59b?.[_0x519866(0x1c0)]==='number'?{'physicalTableCount':_0x54e59b[_0x519866(0x1c0)]}:{},...typeof _0x54e59b?.[_0x519866(0x11d)]===_0x519866(0x1c3)?{'datasetTableCount':_0x54e59b[_0x519866(0x11d)]}:{},..._0x54e59b?.[_0x519866(0x12f)]?{'summary':_0x54e59b[_0x519866(0x12f)]}:{},'tableList':Array[_0x519866(0x18e)](_0x54e59b?.[_0x519866(0x1b2)])?_0x54e59b[_0x519866(0x1b2)]:[]};}export async function getDbTableComparisonPage(_0x1de5d9,_0x442e1f,_0x2c7f74){const _0x5d9263=a222_0x11798a,_0x3c51fc=await apiRequest(_0x5d9263(0x136)+buildQuery({'appCode':_0x1de5d9,'dbLinkId':_0x442e1f,'pageIndex':_0x2c7f74?.[_0x5d9263(0x1d8)]??0x1,'pageSize':_0x2c7f74?.[_0x5d9263(0x1bf)]??0x14,'tableName':_0x2c7f74?.[_0x5d9263(0x211)]})),_0xb25bfd=_0x3c51fc['data'];return{'totalCount':_0xb25bfd?.['totalCount']??0x0,...typeof _0xb25bfd?.[_0x5d9263(0x1c0)]===_0x5d9263(0x1c3)?{'physicalTableCount':_0xb25bfd[_0x5d9263(0x1c0)]}:{},...typeof _0xb25bfd?.[_0x5d9263(0x11d)]===_0x5d9263(0x1c3)?{'datasetTableCount':_0xb25bfd[_0x5d9263(0x11d)]}:{},..._0xb25bfd?.[_0x5d9263(0x12f)]?{'summary':_0xb25bfd[_0x5d9263(0x12f)]}:{},'tableList':Array[_0x5d9263(0x18e)](_0xb25bfd?.[_0x5d9263(0x1b2)])?_0xb25bfd[_0x5d9263(0x1b2)]:[]};}export async function startDbTableDiffRefresh(_0x3194e6,_0x6c2f35){const _0x5ad5c2=a222_0x11798a,_0x322bf7=await apiRequest(_0x5ad5c2(0x22a)+buildQuery({'appCode':_0x3194e6,'dbLinkId':_0x6c2f35}),{'method':_0x5ad5c2(0x259)});return _0x322bf7[_0x5ad5c2(0x12b)];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x44570f=a222_0x11798a,_0x3c06d1=await apiRequest(_0x44570f(0x254),{'method':_0x44570f(0x259),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x35c418=extractList(_0x3c06d1[_0x44570f(0x12b)]),_0x3d0f1c=extractPaging(_0x3c06d1[_0x44570f(0x12b)]);return _0x3d0f1c&&_0x3d0f1c[_0x44570f(0x212)]>REMOTE_APP_PAGE_SIZE&&console[_0x44570f(0x161)](_0x44570f(0x14f)+REMOTE_APP_PAGE_SIZE+_0x44570f(0x122)+_0x3d0f1c[_0x44570f(0x212)]+_0x44570f(0x1b8)+_0x44570f(0x1b0)),_0x35c418;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x2d08ef,_0x9f8495){const _0x260e3b=a222_0x11798a,_0x61944c=Math[_0x260e3b(0x181)](Math['max'](_0x9f8495?.['pageSize']??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x560a88=await apiRequest('/smartapi/permit/role/get-list',{'method':_0x260e3b(0x259),'body':{'appCode':_0x2d08ef,'currentPage':_0x9f8495?.[_0x260e3b(0x131)]??0x1,'pageSize':_0x61944c}});return{'items':extractList(_0x560a88[_0x260e3b(0x12b)]),'paging':extractPaging(_0x560a88[_0x260e3b(0x12b)])};}export async function updateAppRole(_0x322673){const _0x10e490=a222_0x11798a,_0x3bbd88=await apiRequest(_0x10e490(0x135),{'method':'POST','body':{'id':_0x322673['id'],'appCode':_0x322673[_0x10e490(0x1ee)],..._0x322673[_0x10e490(0x1f6)]!==undefined?{'roleName':_0x322673['roleName']}:{},..._0x322673['remark']!==undefined?{'remark':_0x322673[_0x10e490(0x196)]}:{}}});return _0x3bbd88[_0x10e490(0x12b)];}export async function deleteAppRole(_0x563456){const _0x53b826=a222_0x11798a;await apiRequest(_0x53b826(0x23d),{'method':_0x53b826(0x259),'body':{'id':_0x563456}});}export async function listRoleUsers(_0x59379f){const _0x2a5588=a222_0x11798a,_0x265d68=await apiRequest(_0x2a5588(0x225),{'method':_0x2a5588(0x259),'body':{'appCode':_0x59379f}});return extractList(_0x265d68[_0x2a5588(0x12b)])[_0x2a5588(0x156)](({id:_0x4bb6b6,userList:_0x4e9ef4,applyUserList:_0x19758d,..._0xe59823})=>({..._0xe59823,'id':Number(_0x4bb6b6),'userList':_0x4e9ef4['map'](_0x123c34=>({..._0x123c34,'userId':Number(_0x123c34['userId'])})),..._0x19758d?{'applyUserList':_0x19758d[_0x2a5588(0x156)](_0x20f054=>({..._0x20f054,'userId':Number(_0x20f054['userId'])}))}:{}}));}export async function listDevUserRoleRelations(_0x29f1f5,_0x5ab300){const _0x95ed14=a222_0x11798a,_0x40b416=Math[_0x95ed14(0x181)](Math[_0x95ed14(0x1db)](_0x5ab300?.['pageSize']??0x64,0x1),0x64),_0x48bed4=await apiRequest('/smartapi/permit/user-role/get-list',{'method':_0x95ed14(0x259),'body':{'appCode':_0x29f1f5,..._0x5ab300?.[_0x95ed14(0x17c)]!==undefined?{'userId':_0x5ab300[_0x95ed14(0x17c)]}:{},..._0x5ab300?.[_0x95ed14(0x12c)]!==undefined?{'roleId':_0x5ab300[_0x95ed14(0x12c)]}:{},..._0x5ab300?.[_0x95ed14(0x1a5)]!==undefined?{'roleType':_0x5ab300[_0x95ed14(0x1a5)]}:{},'currentPage':_0x5ab300?.[_0x95ed14(0x131)]??0x1,'pageSize':_0x40b416}}),_0x1be45d=extractList(_0x48bed4['data'])[_0x95ed14(0x156)](_0x4803e9=>({..._0x4803e9,'id':Number(_0x4803e9['id']),'userId':Number(_0x4803e9['userId']),'roleId':Number(_0x4803e9[_0x95ed14(0x12c)])}));return{'items':_0x1be45d,'paging':extractPaging(_0x48bed4[_0x95ed14(0x12b)])};}export async function createDevUserRole(_0x519252){const _0x258bab=a222_0x11798a,_0x518115=await apiRequest(_0x258bab(0x1d0),{'method':_0x258bab(0x259),'body':_0x519252});return{..._0x518115[_0x258bab(0x12b)],'id':Number(_0x518115[_0x258bab(0x12b)]['id']),'userId':Number(_0x518115[_0x258bab(0x12b)][_0x258bab(0x17c)]),'roleId':Number(_0x518115[_0x258bab(0x12b)][_0x258bab(0x12c)])};}export async function deleteDevUserRole(_0x5d4f9c){const _0x580720=a222_0x11798a,_0x79a9be=await apiRequest(_0x580720(0x24b),{'method':_0x580720(0x259),'body':{'id':_0x5d4f9c}});return _0x79a9be[_0x580720(0x12b)];}export async function listCurrentUserTenantMemberships(){const _0x38622d=a222_0x11798a,_0x51d9f4=await apiRequest(_0x38622d(0x203));return extractList(_0x51d9f4['data']);}export async function listTenantDirectoryMembers(_0x1e4475){const _0x21787d=a222_0x11798a,_0x394dcd=await apiRequest(_0x21787d(0x214)+buildQuery({'code':_0x1e4475})),_0x3b9428=_0x394dcd['data']?.[_0x21787d(0x145)];return Array['isArray'](_0x3b9428)?_0x3b9428:[];}export async function getTenantMembers(_0x39851c){const _0x2a31cd=a222_0x11798a,_0x24573c=await listTenantDirectoryMembers(_0x39851c);return _0x24573c[_0x2a31cd(0x1fa)](_0x32385c=>_0x32385c['status']==='ENABLE'||_0x32385c[_0x2a31cd(0x172)]===undefined)[_0x2a31cd(0x156)](_0x30cea0=>({'userId':Number(_0x30cea0[_0x2a31cd(0x17c)]??_0x30cea0['id']),'username':_0x30cea0[_0x2a31cd(0x18b)],'nickname':_0x30cea0['nickname'],'status':_0x30cea0[_0x2a31cd(0x172)],'email':_0x30cea0[_0x2a31cd(0x1ae)],'mobile':_0x30cea0[_0x2a31cd(0x23e)],'avatar':_0x30cea0['avatar']}))['filter'](_0x2974a7=>Number[_0x2a31cd(0x1ab)](_0x2974a7[_0x2a31cd(0x17c)])&&_0x2974a7[_0x2a31cd(0x17c)]>0x0);}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a223_0x2fe75e=a223_0x2d67;function a223_0x18fa(){const _0x163d31=['42nlPAsi','1003NiapNV','492mDfLHT','79256cSJQmy','2734298iBxmPx','45MRflSD','97542epGVah','/bff','382ZLskzm','39FynNAl','50wrFsGY','25028DiMJOh','6810FdkUBU','18Pfnbeg','bff-trash','.rabetbase','bff.lock.json','28391DsuuGe'];a223_0x18fa=function(){return _0x163d31;};return a223_0x18fa();}function a223_0x2d67(_0x1b01d5,_0x1cbbae){_0x1b01d5=_0x1b01d5-0x1bf;const _0x18fa08=a223_0x18fa();let _0x2d67de=_0x18fa08[_0x1b01d5];return _0x2d67de;}(function(_0x10402d,_0x381bd9){const _0x4970cc=a223_0x2d67,_0x1040bd=_0x10402d();while(!![]){try{const _0xcbd4e2=-parseInt(_0x4970cc(0x1ce))/0x1*(parseInt(_0x4970cc(0x1c3))/0x2)+parseInt(_0x4970cc(0x1c8))/0x3*(parseInt(_0x4970cc(0x1c6))/0x4)+parseInt(_0x4970cc(0x1c5))/0x5*(-parseInt(_0x4970cc(0x1c1))/0x6)+-parseInt(_0x4970cc(0x1cd))/0x7*(parseInt(_0x4970cc(0x1d0))/0x8)+parseInt(_0x4970cc(0x1c0))/0x9*(-parseInt(_0x4970cc(0x1c7))/0xa)+-parseInt(_0x4970cc(0x1cc))/0xb*(parseInt(_0x4970cc(0x1cf))/0xc)+-parseInt(_0x4970cc(0x1c4))/0xd*(-parseInt(_0x4970cc(0x1bf))/0xe);if(_0xcbd4e2===_0x381bd9)break;else _0x1040bd['push'](_0x1040bd['shift']());}catch(_0x15a8ae){_0x1040bd['push'](_0x1040bd['shift']());}}}(a223_0x18fa,0x1892c));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a223_0x2fe75e(0x1ca),LOCK_FILE_NAME=a223_0x2fe75e(0x1cb),TRASH_DIR_NAME=a223_0x2fe75e(0x1c9);export function loadBffProjectConfig(_0x50f46d,_0x3318f7){const _0x20c337=a223_0x2fe75e,_0x4ec19b=resolve(_0x3318f7??findProjectRootDirectory()),_0x42fc41=DOT_DIR+_0x20c337(0x1c2),_0xa72be0=_0x42fc41+'/'+_0x50f46d;return{'projectRoot':_0x4ec19b,'appCode':_0x50f46d,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x42fc41,'scriptsRoot':_0xa72be0,'scriptsRootDir':resolve(_0x4ec19b,DOT_DIR,'bff',_0x50f46d),'lockFilePath':resolve(_0x4ec19b,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4ec19b,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a224_0x3dc051=a224_0x4c31;(function(_0x112d35,_0x75bfb0){const _0x3464bc=a224_0x4c31,_0x17b081=_0x112d35();while(!![]){try{const _0x47eb2a=parseInt(_0x3464bc(0x1c2))/0x1*(parseInt(_0x3464bc(0x1c0))/0x2)+parseInt(_0x3464bc(0x1d0))/0x3+parseInt(_0x3464bc(0x1cd))/0x4+-parseInt(_0x3464bc(0x1c7))/0x5*(-parseInt(_0x3464bc(0x1b1))/0x6)+-parseInt(_0x3464bc(0x1ba))/0x7+-parseInt(_0x3464bc(0x1b7))/0x8*(parseInt(_0x3464bc(0x1b5))/0x9)+parseInt(_0x3464bc(0x1d7))/0xa;if(_0x47eb2a===_0x75bfb0)break;else _0x17b081['push'](_0x17b081['shift']());}catch(_0x19c6a4){_0x17b081['push'](_0x17b081['shift']());}}}(a224_0x4859,0x5b1ab));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join,resolve,sep}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=['COMMON',a224_0x3dc051(0x1c1),a224_0x3dc051(0x1af)];export function normalizeBffType(_0x29a288){const _0x25087c=a224_0x3dc051;if(!_0x29a288)return undefined;const _0x57f582=_0x29a288[_0x25087c(0x1ae)]()[_0x25087c(0x1cb)]();return SUPPORTED_BFF_TYPES[_0x25087c(0x1ca)](_0x57f582)?_0x57f582:undefined;}async function scanJsFilesRecursively(_0x50cdb3,_0x2ba29c){const _0x1459bd=a224_0x3dc051,_0x495099=[];try{const _0x5bcb96=await readdir(_0x50cdb3,{'withFileTypes':!![]});for(const _0x48fc2f of _0x5bcb96){const _0x5da0c6=join(_0x50cdb3,_0x48fc2f[_0x1459bd(0x1d1)]);if(_0x48fc2f[_0x1459bd(0x1d2)]())_0x495099['push'](...await scanJsFilesRecursively(_0x5da0c6,_0x2ba29c+'/'+_0x48fc2f[_0x1459bd(0x1d1)]));else _0x48fc2f['isFile']()&&_0x48fc2f[_0x1459bd(0x1d1)]['endsWith'](_0x1459bd(0x1bb))&&_0x495099[_0x1459bd(0x1be)]({'lockKey':_0x2ba29c+'/'+_0x48fc2f[_0x1459bd(0x1d1)][_0x1459bd(0x1bc)](/\.js$/,''),'filePath':_0x5da0c6});}}catch(_0x261334){if(_0x261334[_0x1459bd(0x1cc)]!==_0x1459bd(0x1c3))throw _0x261334;}return _0x495099;}async function scanFlatFunctions(_0x23f985,_0x297043){const _0x452f2d=a224_0x3dc051,_0x4017ab=join(_0x23f985[_0x452f2d(0x1c5)],_0x297043),_0x40e583=await scanJsFilesRecursively(_0x4017ab,_0x297043);return _0x40e583[_0x452f2d(0x1d3)](({lockKey:_0x6211a4,filePath:_0x4b5280})=>({'type':_0x297043,'name':_0x6211a4['split']('/')['at'](-0x1)??'','filePath':_0x4b5280,'lockKey':_0x6211a4}));}async function scanHookFunctions(_0x35b5b5){const _0x25f3f9=a224_0x3dc051,_0x6a2831=join(_0x35b5b5[_0x25f3f9(0x1c5)],_0x25f3f9(0x1af)),_0x270317=[];try{const _0x491851=await readdir(_0x6a2831,{'withFileTypes':!![]});for(const _0x283052 of _0x491851){if(!_0x283052['isDirectory']())continue;const _0x158b5a=_0x283052[_0x25f3f9(0x1d1)],_0x584fbe=join(_0x6a2831,_0x158b5a),_0x4cfa04=await readdir(_0x584fbe,{'withFileTypes':!![]});for(const _0x464f90 of _0x4cfa04){if(!_0x464f90[_0x25f3f9(0x1d2)]())continue;const _0x1ea953=_0x464f90[_0x25f3f9(0x1d1)],_0xcede05=join(_0x584fbe,_0x1ea953),_0x25c45f=await readdir(_0xcede05,{'withFileTypes':!![]});for(const _0x241ca6 of _0x25c45f){if(!_0x241ca6[_0x25f3f9(0x1d2)]())continue;const _0x373b28=_0x241ca6[_0x25f3f9(0x1d1)],_0x3df326=join(_0xcede05,_0x373b28),_0x3591e3=await readdir(_0x3df326,{'withFileTypes':!![]});for(const _0x5f3180 of _0x3591e3){if(!_0x5f3180[_0x25f3f9(0x1d8)]()||!_0x5f3180[_0x25f3f9(0x1d1)][_0x25f3f9(0x1ce)](_0x25f3f9(0x1bb)))continue;const _0x5c538f=_0x5f3180[_0x25f3f9(0x1d1)][_0x25f3f9(0x1bc)](/\.js$/,'');_0x270317[_0x25f3f9(0x1be)]({'type':_0x25f3f9(0x1af),'name':_0x5c538f,'filePath':join(_0x3df326,_0x5f3180[_0x25f3f9(0x1d1)]),'lockKey':'HOOK/'+_0x158b5a+'/'+_0x1ea953+'/'+_0x373b28+'/'+_0x5c538f,'alias':_0x158b5a,'operationType':_0x1ea953,'functionNode':_0x373b28});}}}}}catch(_0x5b7c77){if(_0x5b7c77[_0x25f3f9(0x1cc)]!==_0x25f3f9(0x1c3))throw _0x5b7c77;}return _0x270317;}export async function scanLocalBffFunctions(_0x1282e1,_0x545176){const _0x10201c=a224_0x3dc051;if(_0x545176===_0x10201c(0x1c8)||_0x545176===_0x10201c(0x1c1))return scanFlatFunctions(_0x1282e1,_0x545176);if(_0x545176===_0x10201c(0x1af))return scanHookFunctions(_0x1282e1);const [_0xd5fe8,_0x436605,_0x1416b6]=await Promise['all']([scanFlatFunctions(_0x1282e1,_0x10201c(0x1c8)),scanFlatFunctions(_0x1282e1,_0x10201c(0x1c1)),scanHookFunctions(_0x1282e1)]);return[..._0xd5fe8,..._0x436605,..._0x1416b6];}const SAFE_LOCK_KEY_SEGMENT=/^[A-Za-z0-9_$.-]+$/;export function isSafeLockKeySegment(_0x304a78){const _0xfc3af4=a224_0x3dc051;return SAFE_LOCK_KEY_SEGMENT[_0xfc3af4(0x1b4)](_0x304a78)&&_0x304a78!=='.'&&_0x304a78!=='..';}export function resolveLocalFilePathFromLockKey(_0x124bc0,_0x122bac){const _0x134565=a224_0x3dc051,_0x2a3e0c=_0x122bac[_0x134565(0x1b9)]('/');if(!_0x2a3e0c[_0x134565(0x1c6)](isSafeLockKeySegment))throw new Error('Unsafe\x20Backend\x20Function\x20lock\x20key\x20(traversal\x20or\x20invalid\x20segment):\x20'+_0x122bac);const _0xda8b3a=resolve(join(_0x124bc0['scriptsRootDir'],..._0x2a3e0c)+_0x134565(0x1bb)),_0x35fe17=resolve(_0x124bc0['scriptsRootDir']);if(_0xda8b3a!==_0x35fe17&&!_0xda8b3a[_0x134565(0x1d5)](_0x35fe17+sep))throw new Error('Resolved\x20Backend\x20Function\x20script\x20path\x20escapes\x20scripts\x20root:\x20'+_0xda8b3a);return _0xda8b3a;}export function createHookLocationMap(_0x11e941){const _0x58ae4b=a224_0x3dc051,_0x41cc5b=new Map();for(const _0x50c156 of _0x11e941){_0x50c156[_0x58ae4b(0x1b8)]&&_0x41cc5b['set'](_0x50c156[_0x58ae4b(0x1b8)],{'datasetCode':_0x50c156['datasetCode'],'operationType':snakeToCamel(_0x50c156[_0x58ae4b(0x1d6)]),'functionNode':_0x58ae4b(0x1b3)}),_0x50c156[_0x58ae4b(0x1d4)]&&_0x41cc5b[_0x58ae4b(0x1b0)](_0x50c156[_0x58ae4b(0x1d4)],{'datasetCode':_0x50c156[_0x58ae4b(0x1bf)],'operationType':snakeToCamel(_0x50c156[_0x58ae4b(0x1d6)]),'functionNode':_0x58ae4b(0x1c9)});}return _0x41cc5b;}export function resolveRemoteScriptTarget(_0x1d0240,_0x3eab1e,_0x5893c9,_0x30a6b9,_0x22b1ef){const _0x502111=a224_0x3dc051,_0x459506=normalizeBffType(_0x3eab1e[_0x502111(0x1b6)]);if(!_0x459506||!_0x3eab1e['functionName'])return null;if(_0x459506===_0x502111(0x1af)){const _0x4b09bf=(_0x3eab1e['id']?_0x5893c9[_0x502111(0x1c4)](_0x3eab1e['id']):undefined)??findHookLocationByRemoteId(_0x30a6b9,_0x3eab1e['id']);if(!_0x4b09bf)return null;const _0x16dbec=_0x4b09bf[_0x502111(0x1b2)]||_0x22b1ef[_0x502111(0x1c4)](_0x4b09bf[_0x502111(0x1bf)]),_0x456c43=_0x16dbec??_0x4b09bf['datasetCode'],_0x25f540={..._0x4b09bf,'alias':_0x16dbec},_0x180f38='HOOK/'+_0x456c43+'/'+_0x25f540[_0x502111(0x1d6)]+'/'+_0x25f540['functionNode']+'/'+_0x3eab1e[_0x502111(0x1bd)];if(!_0x180f38[_0x502111(0x1b9)]('/')[_0x502111(0x1c6)](isSafeLockKeySegment))return null;return{'lockKey':_0x180f38,'filePath':resolveLocalFilePathFromLockKey(_0x1d0240,_0x180f38),'type':_0x502111(0x1af),'hookLocation':_0x25f540};}const _0x5c67df=_0x459506+'/'+_0x3eab1e[_0x502111(0x1bd)];if(!_0x5c67df['split']('/')['every'](isSafeLockKeySegment))return null;return{'lockKey':_0x5c67df,'filePath':resolveLocalFilePathFromLockKey(_0x1d0240,_0x5c67df),'type':_0x459506};}export async function ensureParentDirectory(_0x402d19){await mkdir(dirname(_0x402d19),{'recursive':!![]});}function a224_0x4c31(_0x2a76ab,_0x31188d){_0x2a76ab=_0x2a76ab-0x1ae;const _0x48599b=a224_0x4859();let _0x4c31da=_0x48599b[_0x2a76ab];return _0x4c31da;}function a224_0x4859(){const _0x59cd1f=['map','afterScriptId','startsWith','operationType','5232380vTOPDa','isFile','trim','HOOK','set','6nHZyAG','alias','before','test','396RGTcKN','scriptType','75256oJHinj','beforeScriptId','split','2930319WsLdBG','.js','replace','functionName','push','datasetCode','1866BXVZDb','ENDPOINT','301VApKeG','ENOENT','get','scriptsRootDir','every','177485JQHjNJ','COMMON','after','includes','toUpperCase','code','248420kBfnfk','endsWith','F_OK','912045ImfnCL','name','isDirectory'];a224_0x4859=function(){return _0x59cd1f;};return a224_0x4859();}export async function fileExists(_0x29864d){const _0x159725=a224_0x3dc051;try{return await access(_0x29864d,constants[_0x159725(0x1cf)]),!![];}catch{return![];}}export async function directoryExists(_0x410e76){const _0x3af9f1=a224_0x3dc051;try{const _0x10b8aa=await stat(_0x410e76);return _0x10b8aa[_0x3af9f1(0x1d2)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3bf77e,_0x43c3c2){const _0xda287=a225_0x5a1e,_0xedbd6a=_0x3bf77e();while(!![]){try{const _0x46f776=-parseInt(_0xda287(0xe4))/0x1*(parseInt(_0xda287(0xe6))/0x2)+parseInt(_0xda287(0xda))/0x3+parseInt(_0xda287(0xd9))/0x4*(-parseInt(_0xda287(0xdc))/0x5)+-parseInt(_0xda287(0xdd))/0x6+parseInt(_0xda287(0xe2))/0x7+parseInt(_0xda287(0xe5))/0x8+parseInt(_0xda287(0xdb))/0x9*(parseInt(_0xda287(0xe3))/0xa);if(_0x46f776===_0x43c3c2)break;else _0xedbd6a['push'](_0xedbd6a['shift']());}catch(_0x331338){_0xedbd6a['push'](_0xedbd6a['shift']());}}}(a225_0x1e64,0xb7bfe));import{readFile}from'node:fs/promises';function a225_0x1e64(){const _0x2b3c88=['8206270MklMkv','1242378dUOhFS','1702144IjWJjV','2bFRwWL','81908LtWWmi','2317188FsrBUS','27yutYnH','200TmwoPs','7753524GYktOc','createHash','md5','update','hex','4615135rXqHUq'];a225_0x1e64=function(){return _0x2b3c88;};return a225_0x1e64();}import a225_0xd4e2a from'node:crypto';export function computeContentHash(_0x440208){const _0x409109=a225_0x5a1e;return a225_0xd4e2a[_0x409109(0xde)](_0x409109(0xdf))[_0x409109(0xe0)](_0x440208)['digest'](_0x409109(0xe1));}function a225_0x5a1e(_0x31c27b,_0x1547a4){_0x31c27b=_0x31c27b-0xd9;const _0x1e64f4=a225_0x1e64();let _0x5a1e64=_0x1e64f4[_0x31c27b];return _0x5a1e64;}export async function computeFileHash(_0x32a2df){const _0x34e48b=await readFile(_0x32a2df,'utf8');return computeContentHash(_0x34e48b);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a226_0x4266(_0x5d3c91,_0x2da38d){_0x5d3c91=_0x5d3c91-0xfd;const _0x4a2c9a=a226_0x4a2c();let _0x42662e=_0x4a2c9a[_0x5d3c91];return _0x42662e;}(function(_0x266ae7,_0x8c6266){const _0x1cbb2f=a226_0x4266,_0x33ff2b=_0x266ae7();while(!![]){try{const _0x26bf11=parseInt(_0x1cbb2f(0x10c))/0x1+-parseInt(_0x1cbb2f(0x10e))/0x2*(parseInt(_0x1cbb2f(0x10b))/0x3)+-parseInt(_0x1cbb2f(0x112))/0x4+-parseInt(_0x1cbb2f(0x110))/0x5*(parseInt(_0x1cbb2f(0x10f))/0x6)+parseInt(_0x1cbb2f(0x10d))/0x7*(parseInt(_0x1cbb2f(0x108))/0x8)+-parseInt(_0x1cbb2f(0x111))/0x9+parseInt(_0x1cbb2f(0x103))/0xa;if(_0x26bf11===_0x8c6266)break;else _0x33ff2b['push'](_0x33ff2b['shift']());}catch(_0x2a5f21){_0x33ff2b['push'](_0x33ff2b['shift']());}}}(a226_0x4a2c,0x77e32));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x165db9,_0x2f6d99,_0x401e38,_0x9b710){const _0x470a66=a226_0x4266,_0x325caf={'apps':_0x165db9['apps']&&typeof _0x165db9[_0x470a66(0x107)]==='object'?_0x165db9[_0x470a66(0x107)]:{}};let _0x2d37f7=_0x325caf[_0x470a66(0x107)][_0x2f6d99];if(!_0x2d37f7)return _0x2d37f7={'scriptsRoot':_0x401e38,'lastSync':'','functions':{}},_0x325caf[_0x470a66(0x107)][_0x2f6d99]=_0x2d37f7,{'lockData':_0x325caf,'appLock':_0x2d37f7};if(!_0x2d37f7['scriptsRoot'])_0x2d37f7[_0x470a66(0x100)]=_0x401e38;else{if(_0x2d37f7[_0x470a66(0x100)]!==_0x401e38)throw new Error(_0x9b710+':\x20scriptsRoot\x20mismatch\x20—\x20'+(_0x470a66(0x104)+_0x401e38+_0x470a66(0xfd)+_0x2d37f7[_0x470a66(0x100)]+_0x470a66(0x105))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x2d37f7[_0x470a66(0xff)]&&(_0x2d37f7[_0x470a66(0xff)]={}),!_0x2d37f7[_0x470a66(0x106)]&&(_0x2d37f7['lastSync']=''),{'lockData':_0x325caf,'appLock':_0x2d37f7};}function a226_0x4a2c(){const _0x1553ca=['25750490aNIfuK','current\x20\x22','\x22.\x20','lastSync','apps','5062856sLlDTC','Failed\x20to\x20read\x20Backend\x20Function\x20lock\x20file:\x20','parse','786OPJTeH','105505QqdTWW','7dpEHZN','4384pENtXW','36978LKSWWU','745AHaIki','5387391ZWvTzL','2924652CoInAO','\x22\x20vs\x20lock\x20\x22','utf8','functions','scriptsRoot','ENOENT','stringify'];a226_0x4a2c=function(){return _0x1553ca;};return a226_0x4a2c();}export async function readBffLockFile(_0x35da2f){const _0x45f9dd=a226_0x4266;try{const _0x534d48=await readFile(_0x35da2f,_0x45f9dd(0xfe)),_0x20668e=JSON[_0x45f9dd(0x10a)](_0x534d48);return{'apps':_0x20668e[_0x45f9dd(0x107)]&&typeof _0x20668e[_0x45f9dd(0x107)]==='object'?_0x20668e[_0x45f9dd(0x107)]:{}};}catch(_0x4377c3){if(_0x4377c3['code']===_0x45f9dd(0x101))return null;throw new Error(_0x45f9dd(0x109)+String(_0x4377c3));}}export async function writeBffLockFile(_0x11a76b,_0x27b991){const _0x4826a4=a226_0x4266;await mkdir(dirname(_0x11a76b),{'recursive':!![]}),await writeFile(_0x11a76b,JSON[_0x4826a4(0x102)](_0x27b991,null,0x2),_0x4826a4(0xfe));}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a228_0x32914f=a228_0x6b19;function a228_0x6b19(_0x114945,_0x633773){_0x114945=_0x114945-0xa4;const _0x5b3ac1=a228_0x5b3a();let _0x6b19dc=_0x5b3ac1[_0x114945];return _0x6b19dc;}(function(_0x5d7369,_0x4a3a96){const _0x68c7dd=a228_0x6b19,_0x40f831=_0x5d7369();while(!![]){try{const _0x500427=-parseInt(_0x68c7dd(0xac))/0x1+parseInt(_0x68c7dd(0xb1))/0x2+parseInt(_0x68c7dd(0xa7))/0x3*(-parseInt(_0x68c7dd(0xb4))/0x4)+parseInt(_0x68c7dd(0xa5))/0x5+parseInt(_0x68c7dd(0xb3))/0x6*(parseInt(_0x68c7dd(0xb9))/0x7)+-parseInt(_0x68c7dd(0xa6))/0x8+parseInt(_0x68c7dd(0xb5))/0x9;if(_0x500427===_0x4a3a96)break;else _0x40f831['push'](_0x40f831['shift']());}catch(_0x2fae56){_0x40f831['push'](_0x40f831['shift']());}}}(a228_0x5b3a,0xc5a36));export const DEFAULT_BFF_SCRIPT_DESCRIPTION=a228_0x32914f(0xb7);const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION='TODO:\x20add\x20script\x20description';export function snakeToCamel(_0x282600){const _0x5826c4=a228_0x32914f;return _0x282600[_0x5826c4(0xad)]()['replace'](/_([a-z])/g,(_0x9f2525,_0x1fb4aa)=>_0x1fb4aa[_0x5826c4(0xa4)]());}export function findHookLocationByRemoteId(_0x37678f,_0x570ced){const _0x4e5021=a228_0x32914f;if(!_0x570ced)return undefined;for(const _0x9120c8 of Object[_0x4e5021(0xb2)](_0x37678f)){if(_0x9120c8['remoteId']===_0x570ced&&_0x9120c8['datasetCode']&&_0x9120c8['operationType']&&_0x9120c8[_0x4e5021(0xa8)])return{'datasetCode':_0x9120c8['datasetCode'],'operationType':_0x9120c8['operationType'],'functionNode':_0x9120c8['functionNode']};}return undefined;}export function extractScriptDescription(_0x4f7091){const _0x2dd283=a228_0x32914f,_0x46d1e8=_0x4f7091['match'](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x46d1e8?.[0x1])return undefined;const _0x5b048c=_0x46d1e8[0x1],_0x3dd9e3=_0x266b06=>{const _0x576211=a228_0x6b19,_0x19ccbd=_0x266b06?.[_0x576211(0xae)]();if(!_0x19ccbd||_0x19ccbd===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x19ccbd===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x19ccbd;},_0x887cdf=_0x5b048c['match'](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x887cdf)return _0x3dd9e3(_0x887cdf[0x1]);const _0x1a9450=_0x5b048c[_0x2dd283(0xb6)](/\r?\n/)[_0x2dd283(0xb0)](_0xab941=>_0xab941[_0x2dd283(0xaf)](/^\s*\*\s?/,'')[_0x2dd283(0xae)]()),_0x59deb3=_0x1a9450['some'](_0x57f10e=>/^\[\s*脚本类型\s*]\s*\S+/[_0x2dd283(0xb8)](_0x57f10e))&&_0x1a9450['some'](_0x139a40=>/^\[\s*脚本名称\s*]\s*\S+/[_0x2dd283(0xb8)](_0x139a40));if(!_0x59deb3)return undefined;for(const _0x5e8861 of _0x1a9450){if(!_0x5e8861||_0x5e8861[_0x2dd283(0xaa)]('@')||/^\[[^\]]+]\s*/[_0x2dd283(0xb8)](_0x5e8861))continue;return _0x3dd9e3(_0x5e8861);}return undefined;}export function isValidBffFunctionName(_0x3f7645){const _0x4aac77=a228_0x32914f;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x4aac77(0xb8)](_0x3f7645);}export function normalizeHookFunctionNode(_0x3a1498){const _0x29e055=a228_0x32914f;if(!_0x3a1498)return undefined;const _0x304e7a=_0x3a1498[_0x29e055(0xae)]()[_0x29e055(0xad)]();if(_0x304e7a===_0x29e055(0xab)||_0x304e7a===_0x29e055(0xa9))return _0x304e7a;return undefined;}function a228_0x5b3a(){const _0x34b269=['toLowerCase','trim','replace','map','702304JjuAqu','values','216078fAJClg','4JnYUIf','17023752GjfZmG','split','TODO:\x20补充脚本功能描述','test','133DBysfk','toUpperCase','122935sBwbqO','10862216DpdzJK','1336413mwOdaB','functionNode','after','startsWith','before','338740cqmilD'];a228_0x5b3a=function(){return _0x34b269;};return a228_0x5b3a();}
|