@lovrabet/rabetbase-cli 2.3.13-beta.1 → 2.3.13-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -0
- 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 -0
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/lib/commands/menu/update.js +0 -1
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a188_0x5d9e4c=a188_0x1119;(function(_0xd6f0c1,_0x2bc356){const _0x186709=a188_0x1119,_0x168f29=_0xd6f0c1();while(!![]){try{const _0x5ce88a=parseInt(_0x186709(0xc4))/0x1+-parseInt(_0x186709(0xcb))/0x2+parseInt(_0x186709(0xcc))/0x3*(parseInt(_0x186709(0xc2))/0x4)+-parseInt(_0x186709(0xc7))/0x5+-parseInt(_0x186709(0xd0))/0x6*(-parseInt(_0x186709(0xd4))/0x7)+parseInt(_0x186709(0xd2))/0x8*(-parseInt(_0x186709(0xc0))/0x9)+parseInt(_0x186709(0xd1))/0xa*(parseInt(_0x186709(0xca))/0xb);if(_0x5ce88a===_0x2bc356)break;else _0x168f29['push'](_0x168f29['shift']());}catch(_0x1d6b50){_0x168f29['push'](_0x168f29['shift']());}}}(a188_0x207e,0x8cd11));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a188_0x1119(_0x4c8761,_0xdd35dc){_0x4c8761=_0x4c8761-0xc0;const _0x207e2d=a188_0x207e();let _0x111968=_0x207e2d[_0x4c8761];return _0x111968;}function a188_0x207e(){const _0x17d9c5=['66492rlKAjl','https://user-daily.lovrabet.com','44ESqYtn','https://daily-api.lovrabet.com','242643RnhWGW','apiDomain','runtimeDomain','4284035cgjnkT','/app/','trim','107558MCQNNd','1809506jwAdon','218181VKXNWf','https://daily-runtime.lovrabet.com','/web-app/app/','userDomain','727626ggNwor','1730kuPIeL','560djGqoN','https://app.lovrabet.com','7BDHkBN'];a188_0x207e=function(){return _0x17d9c5;};return a188_0x207e();}export function initDomains(_0x10cdc2){const _0x307024=a188_0x1119;customApiDomain=_0x10cdc2?.[_0x307024(0xc5)],customUserDomain=_0x10cdc2?.[_0x307024(0xcf)],customRuntimeDomain=_0x10cdc2?.[_0x307024(0xc6)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a188_0x5d9e4c(0xc1));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':a188_0x5d9e4c(0xc3));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?'https://runtime.lovrabet.com':a188_0x5d9e4c(0xcd));export const getAppDomain=()=>isProduction(getEnv())?a188_0x5d9e4c(0xd3):'https://daily.lovrabet.com';export const getAppBaseUrl=_0x5b9db2=>{const _0x3f8ab1=a188_0x5d9e4c,_0x3af3c8=encodeURIComponent(_0x5b9db2[_0x3f8ab1(0xc9)]());return isProduction(getEnv())?getAppDomain()+_0x3f8ab1(0xc8)+_0x3af3c8:getAppDomain()+_0x3f8ab1(0xce)+_0x3af3c8;};
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a189_0x4651(){const _0x5143e9=['1042310OqwAdX','63IkTKiO','123963WwExWR','2091236RTjLax','232HPaRQS','3NhJMyr','867392umXuxZ','development','21481428Nzyrba','6CJLCux','dev','daily','11rPvQtw','5761475Iwcczj','online','production','2832628Eevhqy'];a189_0x4651=function(){return _0x5143e9;};return a189_0x4651();}const a189_0x3499f2=a189_0x4856;(function(_0x5bf06c,_0x15fff1){const _0x25198d=a189_0x4856,_0xae7d17=_0x5bf06c();while(!![]){try{const _0x56dd84=parseInt(_0x25198d(0xcd))/0x1+-parseInt(_0x25198d(0xca))/0x2*(-parseInt(_0x25198d(0xcc))/0x3)+-parseInt(_0x25198d(0xc6))/0x4+parseInt(_0x25198d(0xd4))/0x5*(parseInt(_0x25198d(0xd0))/0x6)+-parseInt(_0x25198d(0xc9))/0x7*(parseInt(_0x25198d(0xcb))/0x8)+-parseInt(_0x25198d(0xc8))/0x9*(-parseInt(_0x25198d(0xc7))/0xa)+-parseInt(_0x25198d(0xd3))/0xb*(parseInt(_0x25198d(0xcf))/0xc);if(_0x56dd84===_0x15fff1)break;else _0xae7d17['push'](_0xae7d17['shift']());}catch(_0x48d8ce){_0xae7d17['push'](_0xae7d17['shift']());}}}(a189_0x4651,0xbf2ed));export const RABETBASE_ENV_VALUES=['production',a189_0x3499f2(0xd2)];export function normalizeEnv(_0xd24dee){const _0x4a8d81=a189_0x3499f2;return _0xd24dee===_0x4a8d81(0xc4)?_0x4a8d81(0xc5):_0xd24dee;}export function isProduction(_0x563357){const _0x10df5b=a189_0x3499f2;return normalizeEnv(_0x563357)===_0x10df5b(0xc5);}export function isDaily(_0x4874c4){const _0x98c37c=a189_0x3499f2;return normalizeEnv(_0x4874c4)===_0x98c37c(0xd2);}export function isDev(_0xfab55e){const _0x5b0512=a189_0x3499f2,_0x447f55=normalizeEnv(_0xfab55e);return _0x447f55===_0x5b0512(0xce)||_0x447f55===_0x5b0512(0xd1);}function a189_0x4856(_0x5568b9,_0x277f40){_0x5568b9=_0x5568b9-0xc4;const _0x46518f=a189_0x4651();let _0x485654=_0x46518f[_0x5568b9];return _0x485654;}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a189_0x3499f2(0xc5));export function getEnv(){return env;}export function initEnv(_0x4d9fba){env=normalizeEnv(_0x4d9fba);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a190_0x2ed03a=a190_0xe618;(function(_0x225090,_0x45a282){const _0x3da2be=a190_0xe618,_0x519b61=_0x225090();while(!![]){try{const _0x2eebf3=-parseInt(_0x3da2be(0x8e))/0x1+-parseInt(_0x3da2be(0x93))/0x2+parseInt(_0x3da2be(0x94))/0x3*(-parseInt(_0x3da2be(0x97))/0x4)+parseInt(_0x3da2be(0x91))/0x5*(-parseInt(_0x3da2be(0x90))/0x6)+parseInt(_0x3da2be(0x98))/0x7+-parseInt(_0x3da2be(0x92))/0x8+parseInt(_0x3da2be(0x99))/0x9*(parseInt(_0x3da2be(0x96))/0xa);if(_0x2eebf3===_0x45a282)break;else _0x519b61['push'](_0x519b61['shift']());}catch(_0x312262){_0x519b61['push'](_0x519b61['shift']());}}}(a190_0x4a27,0xa113d));function a190_0x4a27(){const _0x13ac3c=['14214UpgYdL','515lrbeGE','6121056zhZMnn','703250kFPcat','123AJIGcH','compress','10UFDNXf','35444RNWvhr','5415956ZkrAzI','20239803MoPVVj','638737yucqUW','pretty'];a190_0x4a27=function(){return _0x13ac3c;};return a190_0x4a27();}function a190_0xe618(_0x8ef3eb,_0x43f0b3){_0x8ef3eb=_0x8ef3eb-0x8e;const _0x4a2776=a190_0x4a27();let _0xe618a3=_0x4a2776[_0x8ef3eb];return _0xe618a3;}export const RABETBASE_OUTPUT_FORMAT_VALUES=['json',a190_0x2ed03a(0x8f),a190_0x2ed03a(0x95)];
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a191_0x386c(){const _0x27a65f=['204253zgqwsH','1148585qyFCfm','9VEyidM','3162676CzYnME','259054hyowUY','18iJaTyT','353641NwioHV','1505400iNzgzD','./src/api','10082728VtYjPV'];a191_0x386c=function(){return _0x27a65f;};return a191_0x386c();}const a191_0x1e20b4=a191_0x39df;function a191_0x39df(_0x50f39a,_0x480b67){_0x50f39a=_0x50f39a-0x185;const _0x386c6c=a191_0x386c();let _0x39dfbe=_0x386c6c[_0x50f39a];return _0x39dfbe;}(function(_0x16211c,_0x6fed8c){const _0x3e0950=a191_0x39df,_0x31ea77=_0x16211c();while(!![]){try{const _0x2a3711=-parseInt(_0x3e0950(0x18b))/0x1+parseInt(_0x3e0950(0x189))/0x2*(-parseInt(_0x3e0950(0x187))/0x3)+-parseInt(_0x3e0950(0x188))/0x4+-parseInt(_0x3e0950(0x186))/0x5+-parseInt(_0x3e0950(0x18c))/0x6+-parseInt(_0x3e0950(0x185))/0x7+parseInt(_0x3e0950(0x18e))/0x8*(parseInt(_0x3e0950(0x18a))/0x9);if(_0x2a3711===_0x6fed8c)break;else _0x31ea77['push'](_0x31ea77['shift']());}catch(_0x347bbc){_0x31ea77['push'](_0x31ea77['shift']());}}}(a191_0x386c,0x74b2b));export const DEFAULT_API_DIR=a191_0x1e20b4(0x18d);
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a192_0x2a44f5=a192_0x2b67;function a192_0x2b67(_0x80e60,_0x133cf4){_0x80e60=_0x80e60-0x64;const _0x34c943=a192_0x34c9();let _0x2b67aa=_0x34c943[_0x80e60];return _0x2b67aa;}(function(_0x983875,_0x2cc0b5){const _0x513aa6=a192_0x2b67,_0x6a3771=_0x983875();while(!![]){try{const _0x3811bf=-parseInt(_0x513aa6(0x6a))/0x1+parseInt(_0x513aa6(0x66))/0x2*(parseInt(_0x513aa6(0x6d))/0x3)+-parseInt(_0x513aa6(0x68))/0x4+parseInt(_0x513aa6(0x65))/0x5+parseInt(_0x513aa6(0x6f))/0x6*(-parseInt(_0x513aa6(0x69))/0x7)+parseInt(_0x513aa6(0x6b))/0x8+-parseInt(_0x513aa6(0x67))/0x9*(-parseInt(_0x513aa6(0x64))/0xa);if(_0x3811bf===_0x2cc0b5)break;else _0x6a3771['push'](_0x6a3771['shift']());}catch(_0x22c940){_0x6a3771['push'](_0x6a3771['shift']());}}}(a192_0x34c9,0xac675));function a192_0x34c9(){const _0x145732=['2403rMrSEZ','write','1632VnnGIQ','high-risk-write','13190Kactes','4851315RVxHsW','1810NWvNht','1161KYjLer','379212NjijTO','35609UDYFhf','84855wZNsJE','3233344iBxvuv','read'];a192_0x34c9=function(){return _0x145732;};return a192_0x34c9();}export const RISK_LEVEL_VALUES=[a192_0x2a44f5(0x6c),a192_0x2a44f5(0x6e),a192_0x2a44f5(0x70)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x43d098,_0x20356f){const _0x3b219f=a193_0x4a9c,_0x1adb54=_0x43d098();while(!![]){try{const _0x3a6351=parseInt(_0x3b219f(0xb6))/0x1+-parseInt(_0x3b219f(0xc1))/0x2+-parseInt(_0x3b219f(0xc8))/0x3+-parseInt(_0x3b219f(0xd4))/0x4+-parseInt(_0x3b219f(0xca))/0x5*(parseInt(_0x3b219f(0xd9))/0x6)+-parseInt(_0x3b219f(0xcf))/0x7*(parseInt(_0x3b219f(0xd6))/0x8)+parseInt(_0x3b219f(0xdb))/0x9;if(_0x3a6351===_0x20356f)break;else _0x1adb54['push'](_0x1adb54['shift']());}catch(_0x5c1da1){_0x1adb54['push'](_0x1adb54['shift']());}}}(a193_0x267e,0xedb5a));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{isDaily,normalizeEnv}from'../constant/env.js';function a193_0x267e(){const _0x243683=['entries','globalConfig','10905276ffBMlP','riskLevel','58210236TfPQIt','length','APP','FORMAT','appcode','1035680gbbHSo','VERBOSE','RISK_LEVEL','pageSize','env','daily','apps','production','locale','read','format','2705116blxSuX','cookie','inherit','projectConfig','trim','maxRisk','COOKIE','1695258tzuLHp','defaultApp','5LKENPB','keys','true','app','find','938BzXpTO','ACCESS_KEY','string','write','apiDir','3438168ykEmre','object','115528TbGiFf'];a193_0x267e=function(){return _0x243683;};return a193_0x267e();}import{normalizeLegacyOutputFormat}from'../framework/types.js';function stringConfigValue(_0x39e161){const _0xaabc62=a193_0x4a9c;return typeof _0x39e161===_0xaabc62(0xd1)&&_0x39e161[_0xaabc62(0xc5)]()?_0x39e161[_0xaabc62(0xc5)]():undefined;}function appProfiles(_0x5bd12e){const _0x3e0b56=a193_0x4a9c;return _0x5bd12e['apps']&&typeof _0x5bd12e[_0x3e0b56(0xbc)]==='object'?_0x5bd12e['apps']:{};}function a193_0x4a9c(_0x2d4a41,_0x46d7e4){_0x2d4a41=_0x2d4a41-0xb2;const _0x267e1d=a193_0x267e();let _0x4a9cfe=_0x267e1d[_0x2d4a41];return _0x4a9cfe;}function resolveDefaultAppName(_0x14b148){const _0x148e8a=a193_0x4a9c,_0x6eb4ad=stringConfigValue(_0x14b148[_0x148e8a(0xc9)]);if(_0x6eb4ad)return _0x6eb4ad;return Object[_0x148e8a(0xcb)](appProfiles(_0x14b148))[0x0];}function resolveTopLevelAppCode(_0x3e77cc){const _0x1f5b2b=a193_0x4a9c;return stringConfigValue(_0x3e77cc[_0x1f5b2b(0xb5)])||stringConfigValue(_0x3e77cc[_0x1f5b2b(0xcd)]);}export function resolveAppConfig({raw:_0x104864,flags:_0x354c96,layers:_0x30ebba,readEnv:_0x413559}){const _0x2e1194=a193_0x4a9c,_0x553d6a=_0x30ebba?.[_0x2e1194(0xc4)]??{},_0x1cf27f=_0x30ebba?.[_0x2e1194(0xd8)]??{},_0x408f19=Object['keys'](_0x553d6a)['length']>0x0,_0xf5f3f2=!_0x408f19||_0x553d6a[_0x2e1194(0xc3)]===!![],_0x35d23a=_0x408f19?resolveDefaultAppName(_0x553d6a):undefined,_0x4375a0=_0xf5f3f2?resolveDefaultAppName(_0x1cf27f):undefined,_0x3def79=stringConfigValue(_0x354c96[_0x2e1194(0xcd)]),_0x51cd1e=_0x413559(_0x2e1194(0xb3)),_0x4165d1={};if(_0x104864[_0x2e1194(0xbc)]&&typeof _0x104864[_0x2e1194(0xbc)]===_0x2e1194(0xd5))for(const [_0x1f1a52,_0x536a3f]of Object['entries'](_0x104864[_0x2e1194(0xbc)])){_0x536a3f&&typeof _0x536a3f===_0x2e1194(0xd5)&&_0x536a3f[_0x2e1194(0xb5)]&&(_0x4165d1[_0x1f1a52]=_0x536a3f);}const _0x41a1fa=_0x104864['defaultApp']||undefined,_0x434ad6=Object[_0x2e1194(0xcb)](_0x4165d1)[_0x2e1194(0xb2)]>0x0,_0x567b1f=_0x3def79||_0x35d23a||_0x51cd1e||_0x4375a0||_0x41a1fa||undefined,_0x5971d5=stringConfigValue(_0x354c96[_0x2e1194(0xb5)]),_0x3803bd=_0x5971d5?Object[_0x2e1194(0xd7)](_0x4165d1)[_0x2e1194(0xce)](([,_0x5a9ec0])=>_0x5a9ec0?.['appcode']===_0x5971d5):undefined,_0x4a0e8a=_0x3803bd?.[0x0],_0x472ca2=_0x3803bd?.[0x1],_0x42d095=_0x5971d5?_0x4a0e8a:_0x567b1f;let _0x1a653f=_0x42d095&&_0x4165d1[_0x42d095]?_0x4165d1[_0x42d095]:undefined;_0x5971d5&&_0x472ca2&&(_0x1a653f=_0x472ca2);const _0x3bbea9=_0x5971d5?_0x472ca2??_0x1a653f:_0x1a653f,_0xc6cda2=!_0x3def79&&!_0x35d23a&&_0x51cd1e&&_0x42d095===_0x51cd1e,_0x580244=_0x3def79||(_0xc6cda2?_0x51cd1e:undefined)||(_0x5971d5?_0x4a0e8a:undefined),_0x22a518=_0x3bbea9?.['appcode'],_0x1dc1cc=_0x408f19?resolveTopLevelAppCode(_0x553d6a):undefined,_0x519dd3=_0xf5f3f2?resolveTopLevelAppCode(_0x1cf27f):undefined,_0x5ab3f7=_0x3def79||_0x35d23a?_0x22a518:undefined,_0x543c33=!_0x3def79&&!_0x35d23a?_0x22a518:undefined,_0x222416=_0x5971d5||_0x5ab3f7||_0x1dc1cc||_0x543c33||_0x519dd3||undefined,_0x2204e3=_0x408f19?stringConfigValue(_0x553d6a[_0x2e1194(0xba)]):undefined,_0x1a7a2b=_0xf5f3f2?stringConfigValue(_0x1cf27f[_0x2e1194(0xba)]):undefined,_0x39163b=_0x354c96[_0x2e1194(0xba)]||_0x3bbea9?.['env']||_0x2204e3||_0x413559('ENV')||_0x1a7a2b||_0x104864[_0x2e1194(0xba)]||DEFAULT_CONFIG_VALUES[_0x2e1194(0xba)],_0x1c9381=_0x3bbea9?.[_0x2e1194(0xbe)]||_0x104864[_0x2e1194(0xbe)]||DEFAULT_CONFIG_VALUES['locale'],_0x8dbbf0=_0x413559(_0x2e1194(0xc7))||_0x3bbea9?.[_0x2e1194(0xc2)]||_0x104864[_0x2e1194(0xc2)]||undefined,_0x475cd7=_0x413559(_0x2e1194(0xd0))||_0x3bbea9?.['accessKey']||_0x104864['accessKey']||undefined,_0x3d9017=_0x354c96[_0x2e1194(0xc0)]||_0x413559(_0x2e1194(0xb4))||_0x3bbea9?.[_0x2e1194(0xc0)]||_0x104864[_0x2e1194(0xc0)],_0x28b641=normalizeLegacyOutputFormat(_0x3d9017),_0x497c48=_0x413559('PAGE_SIZE')||_0x3bbea9?.[_0x2e1194(0xb9)]||_0x104864['pageSize'],_0x16b367=_0x497c48?Number(_0x497c48)||undefined:undefined,_0x25722b=_0x413559(_0x2e1194(0xb8))||_0x413559('MAX_RISK')||_0x3bbea9?.[_0x2e1194(0xda)]||_0x104864['riskLevel']||_0x104864[_0x2e1194(0xc6)],_0x55a194=_0x25722b===_0x2e1194(0xbf)||_0x25722b===_0x2e1194(0xd2)?_0x25722b:DEFAULT_CONFIG_VALUES['riskLevel'],_0x4381af=_0x413559(_0x2e1194(0xb7)),_0x49a9d4=_0x4381af==='1'||_0x4381af===_0x2e1194(0xcc),_0x287aba=_0x3bbea9?.['apiDir']||_0x104864[_0x2e1194(0xd3)]||DEFAULT_CONFIG_VALUES[_0x2e1194(0xd3)],_0x50c4dc=isDaily(normalizeEnv(String(_0x39163b)))?_0x2e1194(0xbb):_0x2e1194(0xbd);return{'appCode':typeof _0x222416===_0x2e1194(0xd1)&&_0x222416['trim']()?_0x222416[_0x2e1194(0xc5)]():undefined,'env':_0x50c4dc,'locale':_0x1c9381,'cookie':_0x8dbbf0,'accessKey':_0x475cd7,'format':_0x28b641,'pageSize':_0x16b367,'riskLevel':_0x55a194,'verbose':_0x49a9d4,'apiDir':_0x287aba,'apps':_0x4165d1,'defaultApp':_0x41a1fa,'currentApp':_0x434ad6?_0x42d095:undefined,'explicitAppName':_0x580244};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x300b97,_0x5c825b){const _0x1af4df=a194_0x3a31,_0x19ef31=_0x300b97();while(!![]){try{const _0x5179d6=-parseInt(_0x1af4df(0x139))/0x1+parseInt(_0x1af4df(0x140))/0x2+-parseInt(_0x1af4df(0x13e))/0x3*(-parseInt(_0x1af4df(0x135))/0x4)+-parseInt(_0x1af4df(0x13d))/0x5*(-parseInt(_0x1af4df(0x13f))/0x6)+-parseInt(_0x1af4df(0x13a))/0x7*(-parseInt(_0x1af4df(0x138))/0x8)+parseInt(_0x1af4df(0x137))/0x9*(parseInt(_0x1af4df(0x136))/0xa)+parseInt(_0x1af4df(0x13b))/0xb*(-parseInt(_0x1af4df(0x13c))/0xc);if(_0x5179d6===_0x5c825b)break;else _0x19ef31['push'](_0x19ef31['shift']());}catch(_0x3220e6){_0x19ef31['push'](_0x19ef31['shift']());}}}(a194_0x5f0e,0x99253));import{getIsSessionValid}from'../auth/is-session-valid.js';function a194_0x5f0e(){const _0x58a685=['1083132PgdcFs','3074744sDDkoo','986711ptZwdl','21fLxYgj','4337553dwbhgO','48hhjrTw','9905UtUBzC','3RhoxJs','606RHTSiu','1680978cffLEo','authRequired','2546572ecRZMq','30xZCHMn'];a194_0x5f0e=function(){return _0x58a685;};return a194_0x5f0e();}import{CliErrors}from'../errors.js';function a194_0x3a31(_0x3dba5e,_0x4f41b7){_0x3dba5e=_0x3dba5e-0x135;const _0x5f0e7f=a194_0x5f0e();let _0x3a3185=_0x5f0e7f[_0x3dba5e];return _0x3a3185;}export async function buildAuth(_0x36e20d){const {getCookie:_0x2c057f}=await import('../auth/get-cookie.js'),_0xf63d47=_0x36e20d['cookie']||_0x2c057f(),_0x33b2ff=_0xf63d47?await getIsSessionValid():![];return{'cookie':_0xf63d47,'isLoggedIn':_0x33b2ff,async 'getOrLogin'(){const _0x509a3a=a194_0x3a31;if(_0xf63d47&&_0x33b2ff)return _0xf63d47;throw CliErrors[_0x509a3a(0x141)]();}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a194_0x34b897=a194_0x2e7b;(function(_0x5504a3,_0x4655fd){const _0x301249=a194_0x2e7b,_0x54d433=_0x5504a3();while(!![]){try{const _0x2fb628=parseInt(_0x301249(0x1f1))/0x1+parseInt(_0x301249(0x1e4))/0x2*(parseInt(_0x301249(0x1cf))/0x3)+parseInt(_0x301249(0x1c8))/0x4+-parseInt(_0x301249(0x1e2))/0x5*(-parseInt(_0x301249(0x1d6))/0x6)+parseInt(_0x301249(0x1f3))/0x7*(parseInt(_0x301249(0x1c5))/0x8)+-parseInt(_0x301249(0x1f2))/0x9*(-parseInt(_0x301249(0x1e8))/0xa)+-parseInt(_0x301249(0x1e7))/0xb;if(_0x2fb628===_0x4655fd)break;else _0x54d433['push'](_0x54d433['shift']());}catch(_0x30bc35){_0x54d433['push'](_0x54d433['shift']());}}}(a194_0x2fff,0x57fc6));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{dirname,parse,resolve}from'node:path';import{homedir}from'node:os';import{CLI_BIN_NAME}from'../constant/cli.js';export const NEW_CONFIG_NAME=a194_0x34b897(0x1c4);export const CONFIG_NAMES=[a194_0x34b897(0x1c4),a194_0x34b897(0x1e0),a194_0x34b897(0x1ea)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a194_0x34b897(0x1da)](_0x23ffc8=>_0x23ffc8!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();function a194_0x2fff(){const _0x5a80f5=['set','filter','\x0a\x20\x20','length','.tmp','defaultApp','silent','.lovrabet.json','stringify','845885LJgkhw','utf8','2AxXZfc','Project','cookie','19243070alcNPT','7910XXbJwF','cwd','.lovrabetrc','object','warn','apiDir','appcode','missing','migrated','358788tsbhrc','6246jxAxle','21826NjZXyx','error','locale','inherit','.rabetbase.json','144BybzBD','parse','status','2418080WZxvqh','config','pageSize','format','apps','riskLevel','trim','1116591kZnyCR','data','app','message','env','Global','keys','6agXJuF','empty','accessKey'];a194_0x2fff=function(){return _0x5a80f5;};return a194_0x2fff();}export function resolveConfigPath(_0x6f6c16){for(const _0xd75d20 of CONFIG_NAMES){const _0x299579=resolve(_0x6f6c16,_0xd75d20);if(existsSync(_0x299579))return _0x299579;}return undefined;}export function findProjectRootDirectory(_0x5cfd80=process['cwd']()){let _0x366f46=resolve(_0x5cfd80);const {root:_0x31d3f6}=parse(_0x366f46),_0x2e6d71=homedir();while(!![]){if(resolveConfigPath(_0x366f46)){if(_0x366f46===_0x2e6d71)break;return _0x366f46;}if(_0x366f46===_0x31d3f6||_0x366f46===_0x2e6d71)break;const _0x97f985=dirname(_0x366f46);if(_0x97f985===_0x366f46)break;_0x366f46=_0x97f985;}return resolve(_0x5cfd80);}export function getProjectConfigPath(){const _0x2cbfc3=a194_0x34b897;return resolveConfigPath(process[_0x2cbfc3(0x1e9)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x4e18f1){const _0x4048e9=a194_0x34b897;if(!existsSync(_0x4e18f1))return{'status':_0x4048e9(0x1ef)};try{const _0x3e5410=readFileSync(_0x4e18f1,{'encoding':_0x4048e9(0x1e3)});if(!_0x3e5410?.['trim']())return{'status':_0x4048e9(0x1d7)};const _0x216d31=JSON[_0x4048e9(0x1c6)](_0x3e5410);return{'status':'ok','data':_0x216d31};}catch(_0xcd755e){return{'status':_0x4048e9(0x1f4),'message':_0xcd755e instanceof Error?_0xcd755e[_0x4048e9(0x1d2)]:String(_0xcd755e)};}}function parseCliConfigJsonFile(_0x43e685,_0x28a2bc,_0x5f563f){const _0x1e3455=a194_0x34b897,_0x2b0981=inspectCliConfigJsonFile(_0x43e685);if(_0x2b0981[_0x1e3455(0x1c7)]===_0x1e3455(0x1ef)||_0x2b0981[_0x1e3455(0x1c7)]===_0x1e3455(0x1d7))return{};if(_0x2b0981['status']==='ok')return _0x2b0981[_0x1e3455(0x1d0)];return _0x28a2bc===_0x1e3455(0x1ec)&&_0x5f563f&&console[_0x1e3455(0x1f4)](CLI_BIN_NAME+':\x20'+_0x5f563f+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0x43e685+_0x1e3455(0x1db)+_0x2b0981[_0x1e3455(0x1d2)]),{};}function normalizeLegacyConfigShape(_0x46b786){const _0x2b46aa=a194_0x34b897;if(!_0x46b786||typeof _0x46b786!==_0x2b46aa(0x1eb))return{'config':{},'migrated':![]};const _0x45201e={..._0x46b786},_0x3ae284=_0x45201e[_0x2b46aa(0x1cc)]&&typeof _0x45201e[_0x2b46aa(0x1cc)]===_0x2b46aa(0x1eb)?{..._0x45201e[_0x2b46aa(0x1cc)]}:{},_0x3e53aa=Object[_0x2b46aa(0x1d5)](_0x3ae284)[_0x2b46aa(0x1dc)],_0xaadc0d=_0x45201e[_0x2b46aa(0x1ee)]||_0x45201e['app'];let _0x3268be=![];if(_0xaadc0d&&_0x3e53aa===0x0){const _0xf56999=typeof _0x45201e[_0x2b46aa(0x1de)]==='string'&&_0x45201e[_0x2b46aa(0x1de)][_0x2b46aa(0x1ce)]()?_0x45201e[_0x2b46aa(0x1de)]:String(_0xaadc0d)[_0x2b46aa(0x1ce)]();_0x3ae284[_0xf56999]={'appcode':String(_0xaadc0d)[_0x2b46aa(0x1ce)](),..._0x45201e['env']!=null?{'env':_0x45201e[_0x2b46aa(0x1d3)]}:{},..._0x45201e[_0x2b46aa(0x1ed)]!=null?{'apiDir':_0x45201e[_0x2b46aa(0x1ed)]}:{},..._0x45201e[_0x2b46aa(0x1e6)]!=null?{'cookie':_0x45201e[_0x2b46aa(0x1e6)]}:{},..._0x45201e[_0x2b46aa(0x1d8)]!=null?{'accessKey':_0x45201e[_0x2b46aa(0x1d8)]}:{},..._0x45201e[_0x2b46aa(0x1cb)]!=null?{'format':_0x45201e[_0x2b46aa(0x1cb)]}:{},..._0x45201e['pageSize']!=null?{'pageSize':_0x45201e[_0x2b46aa(0x1ca)]}:{},..._0x45201e['riskLevel']!=null?{'riskLevel':_0x45201e[_0x2b46aa(0x1cd)]}:{},..._0x45201e['locale']!=null?{'locale':_0x45201e[_0x2b46aa(0x1c2)]}:{}},_0x45201e[_0x2b46aa(0x1cc)]=_0x3ae284;if(!_0x45201e[_0x2b46aa(0x1de)])_0x45201e[_0x2b46aa(0x1de)]=_0xf56999;_0x3268be=!![];}return(_0x2b46aa(0x1ee)in _0x45201e||_0x2b46aa(0x1d1)in _0x45201e)&&(delete _0x45201e['appcode'],delete _0x45201e[_0x2b46aa(0x1d1)],_0x3268be=!![]),{'config':_0x45201e,'migrated':_0x3268be};}function writeNormalizedConfigIfNeeded(_0x2803cf,_0x2c0bcd){const _0x3dfeb5=a194_0x34b897,_0x456c4e=JSON['stringify'](_0x2c0bcd,null,0x2)+'\x0a';if(normalizedWriteCache['get'](_0x2803cf)===_0x456c4e)return;writeConfigFile(_0x2803cf,_0x2c0bcd),normalizedWriteCache[_0x3dfeb5(0x1d9)](_0x2803cf,_0x456c4e);}function parseAndNormalizeConfig(_0x5722f0,_0x280507,_0x404a38){const _0x509f9c=a194_0x34b897,_0x550ae6=parseCliConfigJsonFile(_0x5722f0,_0x280507,_0x404a38),_0x9967d5=normalizeLegacyConfigShape(_0x550ae6);if(_0x9967d5[_0x509f9c(0x1f0)])try{writeNormalizedConfigIfNeeded(_0x5722f0,_0x9967d5[_0x509f9c(0x1c9)]);}catch{}return _0x9967d5[_0x509f9c(0x1c9)];}export function loadRawConfigLayers(_0x1d9642){const _0x335f57=a194_0x34b897;let _0x32ee76={},_0x525955={};const _0x25fa71=resolveConfigPath(homedir());_0x25fa71&&(_0x32ee76=parseAndNormalizeConfig(_0x25fa71,'warn',_0x335f57(0x1d4)));const _0x5353fa=_0x1d9642??findProjectRootDirectory(),_0x51a820=resolveConfigPath(_0x5353fa);return _0x51a820&&(_0x525955=parseAndNormalizeConfig(_0x51a820,_0x335f57(0x1ec),_0x335f57(0x1e5))),{'globalPath':_0x25fa71,'projectPath':_0x51a820,'globalConfig':_0x32ee76,'projectConfig':_0x525955};}const INHERIT_WHITELIST=[a194_0x34b897(0x1e6),a194_0x34b897(0x1d8),'locale',a194_0x34b897(0x1cb),a194_0x34b897(0x1cd),a194_0x34b897(0x1ca)];export function mergeRawConfigLayers(_0x4a6b4c){const _0x16b63a=a194_0x34b897,{globalConfig:_0x2b233a,projectConfig:_0x45502c}=_0x4a6b4c,_0x5e2628=Object['keys'](_0x45502c)['length']>0x0;if(!_0x5e2628)return mergeGlobalOnly(_0x2b233a);if(_0x45502c[_0x16b63a(0x1c3)]===!![])return mergeFullInherit(_0x2b233a,_0x45502c);if(_0x45502c['inherit']===![])return mergeIsolated(_0x45502c);return mergeProjectFirst(_0x2b233a,_0x45502c);}function mergeGlobalOnly(_0x2e1fed){const _0x97128b=a194_0x34b897,_0x45849c={..._0x2e1fed},_0x39e6e0=_0x2e1fed[_0x97128b(0x1cc)]&&typeof _0x2e1fed[_0x97128b(0x1cc)]===_0x97128b(0x1eb)?_0x2e1fed[_0x97128b(0x1cc)]:{};if(Object[_0x97128b(0x1d5)](_0x39e6e0)['length']>0x0)_0x45849c[_0x97128b(0x1cc)]=_0x39e6e0;if(_0x2e1fed[_0x97128b(0x1de)])_0x45849c[_0x97128b(0x1de)]=_0x2e1fed[_0x97128b(0x1de)];else{const _0x56135a=Object[_0x97128b(0x1d5)](_0x39e6e0);if(_0x56135a[_0x97128b(0x1dc)]>0x0)_0x45849c['defaultApp']=_0x56135a[0x0];}return _0x45849c;}function mergeIsolated(_0xebe0a4){const _0x1da007=a194_0x34b897,_0x5713a4={..._0xebe0a4};delete _0x5713a4[_0x1da007(0x1c3)];const _0x4dbc92=_0xebe0a4[_0x1da007(0x1cc)]&&typeof _0xebe0a4['apps']===_0x1da007(0x1eb)?_0xebe0a4[_0x1da007(0x1cc)]:{};Object[_0x1da007(0x1d5)](_0x4dbc92)[_0x1da007(0x1dc)]>0x0?_0x5713a4['apps']=_0x4dbc92:delete _0x5713a4[_0x1da007(0x1cc)];if(_0x1da007(0x1de)in _0xebe0a4)_0x5713a4[_0x1da007(0x1de)]=_0xebe0a4[_0x1da007(0x1de)];else Object[_0x1da007(0x1d5)](_0x4dbc92)['length']>0x0?_0x5713a4['defaultApp']=Object[_0x1da007(0x1d5)](_0x4dbc92)[0x0]:delete _0x5713a4[_0x1da007(0x1de)];return _0x5713a4;}function mergeProjectFirst(_0xf418ca,_0x1a11c7){const _0x2bf83a=a194_0x34b897,_0x3df180={..._0x1a11c7};delete _0x3df180[_0x2bf83a(0x1c3)];for(const _0x401dc1 of INHERIT_WHITELIST){!(_0x401dc1 in _0x3df180)&&_0x401dc1 in _0xf418ca&&(_0x3df180[_0x401dc1]=_0xf418ca[_0x401dc1]);}const _0x422163=_0x1a11c7[_0x2bf83a(0x1cc)]&&typeof _0x1a11c7[_0x2bf83a(0x1cc)]===_0x2bf83a(0x1eb)?_0x1a11c7[_0x2bf83a(0x1cc)]:{};Object[_0x2bf83a(0x1d5)](_0x422163)['length']>0x0?_0x3df180[_0x2bf83a(0x1cc)]=_0x422163:delete _0x3df180[_0x2bf83a(0x1cc)];if(_0x2bf83a(0x1de)in _0x1a11c7)_0x3df180[_0x2bf83a(0x1de)]=_0x1a11c7['defaultApp'];else Object[_0x2bf83a(0x1d5)](_0x422163)[_0x2bf83a(0x1dc)]>0x0?_0x3df180[_0x2bf83a(0x1de)]=Object[_0x2bf83a(0x1d5)](_0x422163)[0x0]:delete _0x3df180[_0x2bf83a(0x1de)];return _0x3df180;}function mergeFullInherit(_0x11fa47,_0xeb7aaf){const _0x41d3be=a194_0x34b897,_0x1a95b7=_0x11fa47['apps']&&typeof _0x11fa47['apps']===_0x41d3be(0x1eb)?_0x11fa47[_0x41d3be(0x1cc)]:{},_0x2a17ae=_0xeb7aaf[_0x41d3be(0x1cc)]&&typeof _0xeb7aaf[_0x41d3be(0x1cc)]===_0x41d3be(0x1eb)?_0xeb7aaf[_0x41d3be(0x1cc)]:{},_0x2942a3={..._0x1a95b7,..._0x2a17ae},_0x57c17e={..._0x11fa47,..._0xeb7aaf};delete _0x57c17e[_0x41d3be(0x1c3)];if(Object[_0x41d3be(0x1d5)](_0x2942a3)[_0x41d3be(0x1dc)]>0x0)_0x57c17e[_0x41d3be(0x1cc)]=_0x2942a3;if(_0x41d3be(0x1de)in _0xeb7aaf)_0x57c17e[_0x41d3be(0x1de)]=_0xeb7aaf[_0x41d3be(0x1de)];else{if(Object[_0x41d3be(0x1d5)](_0x2a17ae)[_0x41d3be(0x1dc)]>0x0)_0x57c17e['defaultApp']=Object[_0x41d3be(0x1d5)](_0x2a17ae)[0x0];else{if(_0x11fa47[_0x41d3be(0x1de)])_0x57c17e['defaultApp']=_0x11fa47['defaultApp'];else{const _0x3181c2=Object[_0x41d3be(0x1d5)](_0x1a95b7);if(_0x3181c2[_0x41d3be(0x1dc)]>0x0)_0x57c17e[_0x41d3be(0x1de)]=_0x3181c2[0x0];}}}return _0x57c17e;}function a194_0x2e7b(_0x33bb41,_0x18def0){_0x33bb41=_0x33bb41-0x1c2;const _0x2fff5c=a194_0x2fff();let _0x2e7b21=_0x2fff5c[_0x33bb41];return _0x2e7b21;}export function readRawConfigWithLayers(_0x233313){const _0x46d5d3=loadRawConfigLayers(_0x233313);return{'config':mergeRawConfigLayers(_0x46d5d3),'layers':_0x46d5d3};}export function readRawConfig(_0x10515b){return mergeRawConfigLayers(loadRawConfigLayers(_0x10515b));}export function readConfigFile(_0x182db3){const _0x16c8f3=a194_0x34b897;return parseAndNormalizeConfig(_0x182db3,_0x16c8f3(0x1df));}export function writeConfigFile(_0x461fd6,_0x3930e7){const _0x3e8f9b=a194_0x34b897,_0x180931=dirname(_0x461fd6);!existsSync(_0x180931)&&mkdirSync(_0x180931,{'recursive':!![]});const _0x3b6156=_0x461fd6+_0x3e8f9b(0x1dd);try{writeFileSync(_0x3b6156,JSON[_0x3e8f9b(0x1e1)](_0x3930e7,null,0x2)+'\x0a',{'encoding':_0x3e8f9b(0x1e3),'mode':0x180}),renameSync(_0x3b6156,_0x461fd6);}catch(_0x2ab5a9){try{unlinkSync(_0x3b6156);}catch{}throw _0x2ab5a9;}}export function resolveWriteConfigPath(_0x1d5f8a){const _0x766d9a=a194_0x34b897,_0x2998c6=_0x1d5f8a==='project'?process[_0x766d9a(0x1e9)]():homedir(),_0x34e766=resolveConfigPath(_0x2998c6);return _0x34e766??resolve(_0x2998c6,NEW_CONFIG_NAME);}
|
|
1
|
+
const a195_0x414066=a195_0x386b;(function(_0x1a6ea9,_0x4d237f){const _0xae1d8d=a195_0x386b,_0x3711b1=_0x1a6ea9();while(!![]){try{const _0x4e2296=-parseInt(_0xae1d8d(0x195))/0x1+parseInt(_0xae1d8d(0x1bd))/0x2*(parseInt(_0xae1d8d(0x1c2))/0x3)+parseInt(_0xae1d8d(0x1ae))/0x4+parseInt(_0xae1d8d(0x191))/0x5*(-parseInt(_0xae1d8d(0x19b))/0x6)+-parseInt(_0xae1d8d(0x1b4))/0x7*(-parseInt(_0xae1d8d(0x19f))/0x8)+-parseInt(_0xae1d8d(0x1b1))/0x9+parseInt(_0xae1d8d(0x1a2))/0xa;if(_0x4e2296===_0x4d237f)break;else _0x3711b1['push'](_0x3711b1['shift']());}catch(_0x57a599){_0x3711b1['push'](_0x3711b1['shift']());}}}(a195_0x2a28,0x19947));import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{dirname,parse,resolve}from'node:path';import{homedir}from'node:os';import{CLI_BIN_NAME}from'../constant/cli.js';export const NEW_CONFIG_NAME=a195_0x414066(0x192);export const CONFIG_NAMES=[a195_0x414066(0x192),'.lovrabet.json',a195_0x414066(0x1ac)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a195_0x414066(0x1af)](_0x31fad0=>_0x31fad0!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x4f747b){for(const _0x11038b of CONFIG_NAMES){const _0x3c2b2b=resolve(_0x4f747b,_0x11038b);if(existsSync(_0x3c2b2b))return _0x3c2b2b;}return undefined;}export function findProjectRootDirectory(_0x3d00c8=process['cwd']()){let _0x3def66=resolve(_0x3d00c8);const {root:_0x65a692}=parse(_0x3def66),_0x9b83ac=homedir();while(!![]){if(resolveConfigPath(_0x3def66)){if(_0x3def66===_0x9b83ac)break;return _0x3def66;}if(_0x3def66===_0x65a692||_0x3def66===_0x9b83ac)break;const _0x3f7682=dirname(_0x3def66);if(_0x3f7682===_0x3def66)break;_0x3def66=_0x3f7682;}return resolve(_0x3d00c8);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x39d0cf){const _0x3cf54d=a195_0x414066;if(!existsSync(_0x39d0cf))return{'status':_0x3cf54d(0x1a1)};try{const _0x56c803=readFileSync(_0x39d0cf,{'encoding':'utf8'});if(!_0x56c803?.[_0x3cf54d(0x1b6)]())return{'status':'empty'};const _0x3d38cb=JSON[_0x3cf54d(0x1a0)](_0x56c803);return{'status':'ok','data':_0x3d38cb};}catch(_0x1f2327){return{'status':_0x3cf54d(0x1bf),'message':_0x1f2327 instanceof Error?_0x1f2327[_0x3cf54d(0x1a8)]:String(_0x1f2327)};}}function parseCliConfigJsonFile(_0x4a9f38,_0x1a4849,_0x3420af){const _0x26fd58=a195_0x414066,_0x3a87ff=inspectCliConfigJsonFile(_0x4a9f38);if(_0x3a87ff[_0x26fd58(0x1a9)]==='missing'||_0x3a87ff['status']===_0x26fd58(0x19d))return{};if(_0x3a87ff[_0x26fd58(0x1a9)]==='ok')return _0x3a87ff[_0x26fd58(0x1b8)];return _0x1a4849===_0x26fd58(0x1be)&&_0x3420af&&console['error'](CLI_BIN_NAME+':\x20'+_0x3420af+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0x4a9f38+_0x26fd58(0x1c1)+_0x3a87ff[_0x26fd58(0x1a8)]),{};}function normalizeLegacyConfigShape(_0x2f418){const _0x414698=a195_0x414066;if(!_0x2f418||typeof _0x2f418!==_0x414698(0x1ab))return{'config':{},'migrated':![]};const _0x550fac={..._0x2f418},_0x4609fd=_0x550fac[_0x414698(0x19a)]&&typeof _0x550fac[_0x414698(0x19a)]===_0x414698(0x1ab)?{..._0x550fac[_0x414698(0x19a)]}:{},_0x1a9292=Object[_0x414698(0x193)](_0x4609fd)[_0x414698(0x1c0)],_0x3c7273=_0x550fac[_0x414698(0x1ad)]||_0x550fac[_0x414698(0x1a4)];let _0xe296f=![];if(_0x3c7273&&_0x1a9292===0x0){const _0x5ddab6=typeof _0x550fac[_0x414698(0x1b0)]===_0x414698(0x1b9)&&_0x550fac['defaultApp']['trim']()?_0x550fac[_0x414698(0x1b0)]:String(_0x3c7273)[_0x414698(0x1b6)]();_0x4609fd[_0x5ddab6]={'appcode':String(_0x3c7273)['trim'](),..._0x550fac[_0x414698(0x1b3)]!=null?{'env':_0x550fac[_0x414698(0x1b3)]}:{},..._0x550fac[_0x414698(0x190)]!=null?{'apiDir':_0x550fac[_0x414698(0x190)]}:{},..._0x550fac[_0x414698(0x194)]!=null?{'cookie':_0x550fac['cookie']}:{},..._0x550fac[_0x414698(0x1a3)]!=null?{'accessKey':_0x550fac['accessKey']}:{},..._0x550fac[_0x414698(0x1a6)]!=null?{'format':_0x550fac['format']}:{},..._0x550fac[_0x414698(0x19c)]!=null?{'pageSize':_0x550fac[_0x414698(0x19c)]}:{},..._0x550fac[_0x414698(0x1a7)]!=null?{'riskLevel':_0x550fac[_0x414698(0x1a7)]}:{},..._0x550fac['locale']!=null?{'locale':_0x550fac[_0x414698(0x1ba)]}:{}},_0x550fac[_0x414698(0x19a)]=_0x4609fd;if(!_0x550fac['defaultApp'])_0x550fac[_0x414698(0x1b0)]=_0x5ddab6;_0xe296f=!![];}return(_0x414698(0x1ad)in _0x550fac||_0x414698(0x1a4)in _0x550fac)&&(delete _0x550fac[_0x414698(0x1ad)],delete _0x550fac[_0x414698(0x1a4)],_0xe296f=!![]),{'config':_0x550fac,'migrated':_0xe296f};}function a195_0x386b(_0x300af0,_0xd9c684){_0x300af0=_0x300af0-0x190;const _0x2a283b=a195_0x2a28();let _0x386b36=_0x2a283b[_0x300af0];return _0x386b36;}function writeNormalizedConfigIfNeeded(_0x4b664a,_0xfd02be){const _0x2ec6e0=a195_0x414066,_0x2a3320=JSON[_0x2ec6e0(0x1bc)](_0xfd02be,null,0x2)+'\x0a';if(normalizedWriteCache[_0x2ec6e0(0x1a5)](_0x4b664a)===_0x2a3320)return;writeConfigFile(_0x4b664a,_0xfd02be),normalizedWriteCache[_0x2ec6e0(0x1b7)](_0x4b664a,_0x2a3320);}function parseAndNormalizeConfig(_0xcf03f0,_0x3b4671,_0x18994f){const _0x4cb566=a195_0x414066,_0x416b18=parseCliConfigJsonFile(_0xcf03f0,_0x3b4671,_0x18994f),_0x7de00d=normalizeLegacyConfigShape(_0x416b18);if(_0x7de00d[_0x4cb566(0x1bb)])try{writeNormalizedConfigIfNeeded(_0xcf03f0,_0x7de00d[_0x4cb566(0x196)]);}catch{}return _0x7de00d['config'];}export function loadRawConfigLayers(_0x175825){const _0x1b1cf2=a195_0x414066;let _0x2571c7={},_0x32a59a={};const _0x5dd87f=resolveConfigPath(homedir());_0x5dd87f&&(_0x2571c7=parseAndNormalizeConfig(_0x5dd87f,_0x1b1cf2(0x1be),_0x1b1cf2(0x1b2)));const _0x254cf6=_0x175825??findProjectRootDirectory(),_0x14d158=resolveConfigPath(_0x254cf6);return _0x14d158&&(_0x32a59a=parseAndNormalizeConfig(_0x14d158,'warn',_0x1b1cf2(0x1aa))),{'globalPath':_0x5dd87f,'projectPath':_0x14d158,'globalConfig':_0x2571c7,'projectConfig':_0x32a59a};}const INHERIT_WHITELIST=['cookie','accessKey',a195_0x414066(0x1ba),a195_0x414066(0x1a6),a195_0x414066(0x1a7),a195_0x414066(0x19c)];export function mergeRawConfigLayers(_0x28ba8d){const _0x2b97e6=a195_0x414066,{globalConfig:_0x4a44ec,projectConfig:_0x5a19e6}=_0x28ba8d,_0x55aa24=Object[_0x2b97e6(0x193)](_0x5a19e6)[_0x2b97e6(0x1c0)]>0x0;if(!_0x55aa24)return mergeGlobalOnly(_0x4a44ec);if(_0x5a19e6[_0x2b97e6(0x1b5)]===!![])return mergeFullInherit(_0x4a44ec,_0x5a19e6);if(_0x5a19e6['inherit']===![])return mergeIsolated(_0x5a19e6);return mergeProjectFirst(_0x4a44ec,_0x5a19e6);}function mergeGlobalOnly(_0x581423){const _0x2cb1eb=a195_0x414066,_0x92c11a={..._0x581423},_0xc07a18=_0x581423[_0x2cb1eb(0x19a)]&&typeof _0x581423[_0x2cb1eb(0x19a)]===_0x2cb1eb(0x1ab)?_0x581423[_0x2cb1eb(0x19a)]:{};if(Object['keys'](_0xc07a18)[_0x2cb1eb(0x1c0)]>0x0)_0x92c11a[_0x2cb1eb(0x19a)]=_0xc07a18;if(_0x581423['defaultApp'])_0x92c11a[_0x2cb1eb(0x1b0)]=_0x581423[_0x2cb1eb(0x1b0)];else{const _0x22600d=Object[_0x2cb1eb(0x193)](_0xc07a18);if(_0x22600d[_0x2cb1eb(0x1c0)]>0x0)_0x92c11a[_0x2cb1eb(0x1b0)]=_0x22600d[0x0];}return _0x92c11a;}function mergeIsolated(_0x484765){const _0x2c766c=a195_0x414066,_0x3e1657={..._0x484765};delete _0x3e1657['inherit'];const _0x2f2c7c=_0x484765[_0x2c766c(0x19a)]&&typeof _0x484765[_0x2c766c(0x19a)]===_0x2c766c(0x1ab)?_0x484765[_0x2c766c(0x19a)]:{};Object[_0x2c766c(0x193)](_0x2f2c7c)[_0x2c766c(0x1c0)]>0x0?_0x3e1657[_0x2c766c(0x19a)]=_0x2f2c7c:delete _0x3e1657[_0x2c766c(0x19a)];if('defaultApp'in _0x484765)_0x3e1657['defaultApp']=_0x484765['defaultApp'];else Object[_0x2c766c(0x193)](_0x2f2c7c)['length']>0x0?_0x3e1657[_0x2c766c(0x1b0)]=Object['keys'](_0x2f2c7c)[0x0]:delete _0x3e1657[_0x2c766c(0x1b0)];return _0x3e1657;}function mergeProjectFirst(_0x4599da,_0x36c6c7){const _0x331d4e=a195_0x414066,_0x24bc44={..._0x36c6c7};delete _0x24bc44[_0x331d4e(0x1b5)];for(const _0x9bd8e7 of INHERIT_WHITELIST){!(_0x9bd8e7 in _0x24bc44)&&_0x9bd8e7 in _0x4599da&&(_0x24bc44[_0x9bd8e7]=_0x4599da[_0x9bd8e7]);}const _0x277350=_0x36c6c7[_0x331d4e(0x19a)]&&typeof _0x36c6c7['apps']===_0x331d4e(0x1ab)?_0x36c6c7[_0x331d4e(0x19a)]:{};Object[_0x331d4e(0x193)](_0x277350)[_0x331d4e(0x1c0)]>0x0?_0x24bc44[_0x331d4e(0x19a)]=_0x277350:delete _0x24bc44[_0x331d4e(0x19a)];if(_0x331d4e(0x1b0)in _0x36c6c7)_0x24bc44['defaultApp']=_0x36c6c7[_0x331d4e(0x1b0)];else Object[_0x331d4e(0x193)](_0x277350)['length']>0x0?_0x24bc44[_0x331d4e(0x1b0)]=Object[_0x331d4e(0x193)](_0x277350)[0x0]:delete _0x24bc44[_0x331d4e(0x1b0)];return _0x24bc44;}function mergeFullInherit(_0x295607,_0x146ecd){const _0x133cb9=a195_0x414066,_0x38507a=_0x295607['apps']&&typeof _0x295607[_0x133cb9(0x19a)]===_0x133cb9(0x1ab)?_0x295607['apps']:{},_0x2a58d5=_0x146ecd[_0x133cb9(0x19a)]&&typeof _0x146ecd[_0x133cb9(0x19a)]===_0x133cb9(0x1ab)?_0x146ecd['apps']:{},_0x1c95cc={..._0x38507a,..._0x2a58d5},_0x3b483b={..._0x295607,..._0x146ecd};delete _0x3b483b[_0x133cb9(0x1b5)];if(Object[_0x133cb9(0x193)](_0x1c95cc)[_0x133cb9(0x1c0)]>0x0)_0x3b483b[_0x133cb9(0x19a)]=_0x1c95cc;if(_0x133cb9(0x1b0)in _0x146ecd)_0x3b483b[_0x133cb9(0x1b0)]=_0x146ecd['defaultApp'];else{if(Object[_0x133cb9(0x193)](_0x2a58d5)[_0x133cb9(0x1c0)]>0x0)_0x3b483b[_0x133cb9(0x1b0)]=Object[_0x133cb9(0x193)](_0x2a58d5)[0x0];else{if(_0x295607[_0x133cb9(0x1b0)])_0x3b483b[_0x133cb9(0x1b0)]=_0x295607[_0x133cb9(0x1b0)];else{const _0x12b4d6=Object[_0x133cb9(0x193)](_0x38507a);if(_0x12b4d6[_0x133cb9(0x1c0)]>0x0)_0x3b483b['defaultApp']=_0x12b4d6[0x0];}}}return _0x3b483b;}export function readRawConfigWithLayers(_0x2de5a1){const _0x24130d=loadRawConfigLayers(_0x2de5a1);return{'config':mergeRawConfigLayers(_0x24130d),'layers':_0x24130d};}export function readRawConfig(_0x1189c1){return mergeRawConfigLayers(loadRawConfigLayers(_0x1189c1));}function a195_0x2a28(){const _0x40ccd1=['data','string','locale','migrated','stringify','4nBQlTE','warn','error','length','\x0a\x20\x20','35079qBwwZS','apiDir','5tFmAQx','.rabetbase.json','keys','cookie','19996tfkzxQ','config','cwd','utf8','.tmp','apps','503364ZwHSzF','pageSize','empty','project','20504MVDFQt','parse','missing','365040MEWIdY','accessKey','app','get','format','riskLevel','message','status','Project','object','.lovrabetrc','appcode','543048PoXomS','filter','defaultApp','644094DNhBSw','Global','env','231LbBnyy','inherit','trim','set'];a195_0x2a28=function(){return _0x40ccd1;};return a195_0x2a28();}export function readConfigFile(_0x216b15){return parseAndNormalizeConfig(_0x216b15,'silent');}export function writeConfigFile(_0x3720b4,_0x3ee3a6){const _0x175524=a195_0x414066,_0x5d5799=dirname(_0x3720b4);!existsSync(_0x5d5799)&&mkdirSync(_0x5d5799,{'recursive':!![]});const _0x44dee4=_0x3720b4+_0x175524(0x199);try{writeFileSync(_0x44dee4,JSON['stringify'](_0x3ee3a6,null,0x2)+'\x0a',{'encoding':_0x175524(0x198),'mode':0x180}),renameSync(_0x44dee4,_0x3720b4);}catch(_0x8c50f2){try{unlinkSync(_0x44dee4);}catch{}throw _0x8c50f2;}}export function resolveWriteConfigPath(_0x2774bc){const _0x38f16f=a195_0x414066,_0x297d67=_0x2774bc===_0x38f16f(0x19e)?process[_0x38f16f(0x197)]():homedir(),_0x2afb90=resolveConfigPath(_0x297d67);return _0x2afb90??resolve(_0x297d67,NEW_CONFIG_NAME);}
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a196_0x5941(){const _0x4623ee=['cookie','2784172svRyYd','cwd','3496036pBkmvw','https://g.lovrabet.com/dist/lovrabet-skill','projectConfig','5126270azIYwc','apiDir','join','1317363OystdM','defaultApp','project','appcode','18968VGjrEX','3148878LuHOcG','4542405gbeyRr','apiDomain','runtimeDomain','slice','replace','keys','./constant/domain.js','./utils/is-non-interactive.js','env','8267UKDegk','template_base_url','trim','values','string','userDomain','map','globalConfig','setLogPath','apps','object','-api.ts','app'];a196_0x5941=function(){return _0x4623ee;};return a196_0x5941();}const a196_0x3b7e82=a196_0x1580;function a196_0x1580(_0x66c447,_0xc58b5d){_0x66c447=_0x66c447-0x1d6;const _0x59415c=a196_0x5941();let _0x158029=_0x59415c[_0x66c447];return _0x158029;}(function(_0x11fe49,_0x141bb9){const _0xf51cfb=a196_0x1580,_0x4c3c25=_0x11fe49();while(!![]){try{const _0x516c45=-parseInt(_0xf51cfb(0x1d8))/0x1+parseInt(_0xf51cfb(0x1f5))/0x2+-parseInt(_0xf51cfb(0x1de))/0x3+-parseInt(_0xf51cfb(0x1f7))/0x4+parseInt(_0xf51cfb(0x1fa))/0x5+-parseInt(_0xf51cfb(0x1dd))/0x6+-parseInt(_0xf51cfb(0x1e7))/0x7*(-parseInt(_0xf51cfb(0x1dc))/0x8);if(_0x516c45===_0x141bb9)break;else _0x4c3c25['push'](_0x4c3c25['shift']());}catch(_0x5297e6){_0x4c3c25['push'](_0x4c3c25['shift']());}}}(a196_0x5941,0xf1023));import{resolve}from'node:path';import{CLI_BIN_NAME}from'./constant/cli.js';import{buildAuth}from'./context/auth-resolver.js';import{resolveAppConfig}from'./context/app-resolver.js';import{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile}from'./context/config-loader.js';import{logger}from'./utils/logger.js';export{CONFIG_NAMES,LEGACY_CONFIG_NAMES,NEW_CONFIG_NAME,findProjectRootDirectory,getGlobalConfigPath,getProjectConfigPath,inspectCliConfigJsonFile,isInProject,loadRawConfigLayers,mergeRawConfigLayers,readConfigFile,readRawConfig,readRawConfigWithLayers,resolveConfigPath,resolveWriteConfigPath,writeConfigFile};function env(_0x2823d5){return process.env[`RABETBASE_${_0x2823d5}`]||process.env[`LOVRABET_${_0x2823d5}`]||undefined;}export async function createContext(_0x3f00d7){const _0x2f164f=a196_0x1580,{config:_0x185ab3,layers:_0x35ab7d}=readRawConfigWithLayers(),_0x28dda8=buildConfig(_0x185ab3,_0x3f00d7,_0x35ab7d),{initEnv:_0x2a3c53}=await import('./constant/env.js');if(_0x28dda8[_0x2f164f(0x1e6)])_0x2a3c53(_0x28dda8[_0x2f164f(0x1e6)]);else _0x3f00d7[_0x2f164f(0x1e6)]&&typeof _0x3f00d7[_0x2f164f(0x1e6)]===_0x2f164f(0x1eb)&&_0x2a3c53(_0x3f00d7['env']);const {initDomains:_0x4b4778,getUserDomain:_0x111bd8,getApiDomain:_0x3e4afb}=await import(_0x2f164f(0x1e4));_0x4b4778({'apiDomain':_0x185ab3[_0x2f164f(0x1df)]||undefined,'userDomain':_0x185ab3[_0x2f164f(0x1ec)]||undefined,'runtimeDomain':_0x185ab3[_0x2f164f(0x1e0)]||undefined});const _0x41b111={'apiDomain':_0x3e4afb(),'userDomain':_0x111bd8()},_0x24d191=await buildAuth(_0x28dda8);logger[_0x2f164f(0x1ef)](process['cwd']());const _0x1af463=(CLI_BIN_NAME+'\x20'+process['argv'][_0x2f164f(0x1e1)](0x2)[_0x2f164f(0x1d7)]('\x20'))[_0x2f164f(0x1e9)]();logger['setRawCommand'](_0x1af463);const {isNonInteractive:_0x353a65}=await import(_0x2f164f(0x1e5)),_0x3b66f0=_0x353a65(_0x3f00d7);return{'config':_0x28dda8,'auth':_0x24d191,'logger':logger,'env':_0x41b111,'nonInteractive':_0x3b66f0};}export function buildConfigFromFlags(_0x7205f3){const {config:_0x1f06e4,layers:_0x26ac57}=readRawConfigWithLayers();return buildConfig(_0x1f06e4,_0x7205f3,_0x26ac57);}export function getConfigAppCode(_0x7b1a2c){const _0x44ddaf=a196_0x1580,_0x53dced=readRawConfig(_0x7b1a2c);if(_0x53dced[_0x44ddaf(0x1f0)]&&typeof _0x53dced[_0x44ddaf(0x1f0)]===_0x44ddaf(0x1f1)){const _0x399427=_0x53dced[_0x44ddaf(0x1d9)];if(_0x399427&&_0x53dced['apps'][_0x399427]?.['appcode'])return String(_0x53dced[_0x44ddaf(0x1f0)][_0x399427][_0x44ddaf(0x1db)])[_0x44ddaf(0x1e9)]();const _0x41d9cf=Object[_0x44ddaf(0x1ea)](_0x53dced[_0x44ddaf(0x1f0)])[0x0];if(_0x41d9cf?.[_0x44ddaf(0x1db)])return String(_0x41d9cf['appcode'])['trim']();}const _0xa8c76f=_0x53dced[_0x44ddaf(0x1db)]||_0x53dced[_0x44ddaf(0x1f3)];if(typeof _0xa8c76f!==_0x44ddaf(0x1eb)||_0xa8c76f['trim']()==='')return undefined;return _0xa8c76f[_0x44ddaf(0x1e9)]();}export function getMultiAppConfigs(_0x30012c=a196_0x3b7e82(0x1da),_0x33c67e){const _0x59274e=a196_0x3b7e82,_0x43202f=loadRawConfigLayers(_0x33c67e);let _0x3b42cb,_0x3df210;if(_0x30012c==='merged'){const _0x339e0a=_0x43202f[_0x59274e(0x1ee)][_0x59274e(0x1f0)]&&typeof _0x43202f[_0x59274e(0x1ee)][_0x59274e(0x1f0)]==='object'?_0x43202f[_0x59274e(0x1ee)][_0x59274e(0x1f0)]:{},_0xa926fe=_0x43202f[_0x59274e(0x1f9)]['apps']&&typeof _0x43202f['projectConfig']['apps']===_0x59274e(0x1f1)?_0x43202f[_0x59274e(0x1f9)][_0x59274e(0x1f0)]:{};_0x3b42cb={..._0x339e0a,..._0xa926fe};const _0xa147c1=readRawConfig(_0x33c67e);_0x3df210=_0xa147c1[_0x59274e(0x1d9)];}else _0x3b42cb=_0x43202f['projectConfig'][_0x59274e(0x1f0)],_0x3df210=_0x43202f[_0x59274e(0x1f9)][_0x59274e(0x1d9)];if(!_0x3b42cb||typeof _0x3b42cb!==_0x59274e(0x1f1)||Object[_0x59274e(0x1e3)](_0x3b42cb)['length']===0x0)return null;return Object['entries'](_0x3b42cb)[_0x59274e(0x1ed)](([_0x3886e9,_0x38f97f])=>({'name':_0x3886e9,'appcode':_0x38f97f?.[_0x59274e(0x1db)]||'','isDefault':_0x3886e9===_0x3df210,'env':_0x38f97f?.[_0x59274e(0x1e6)],'apiDir':_0x38f97f?.[_0x59274e(0x1d6)],'cookie':_0x38f97f?.[_0x59274e(0x1f4)]||undefined}))['filter'](_0x2b06f6=>_0x2b06f6['appcode']);}export function getTemplateBaseUrl(_0x59a91a){const _0x709a26=a196_0x3b7e82,_0x63de2f=readRawConfig(_0x59a91a);if(_0x63de2f[_0x709a26(0x1e8)]&&typeof _0x63de2f['template_base_url']==='string')return _0x63de2f[_0x709a26(0x1e8)][_0x709a26(0x1e2)](/\/$/,'');return _0x709a26(0x1f8);}function buildConfig(_0x25557e,_0x9becda,_0x1c92a2){return{...resolveAppConfig({'raw':_0x25557e,'flags':_0x9becda,'layers':_0x1c92a2,'readEnv':env}),'raw':_0x25557e};}export function resolveApiFilePath(_0x3bc12e,_0x3a9a22){const _0x5b8717=a196_0x3b7e82,_0x39433b=resolve(process[_0x5b8717(0x1f6)](),_0x3bc12e),_0x315a0f=resolve(_0x39433b,'api.ts');if(!_0x3a9a22)return _0x315a0f;const _0x361f81=readRawConfig(),_0x481dd3=_0x361f81[_0x5b8717(0x1f0)]&&typeof _0x361f81[_0x5b8717(0x1f0)]===_0x5b8717(0x1f1)?_0x361f81[_0x5b8717(0x1f0)]:{},_0x2cdae7=Object['entries'](_0x481dd3)['find'](([,_0x4cfaae])=>_0x4cfaae?.[_0x5b8717(0x1db)]===_0x3a9a22);if(!_0x2cdae7)return _0x315a0f;const [_0xb23f17,_0x1b8d93]=_0x2cdae7,_0xba6cf1=typeof _0x361f81[_0x5b8717(0x1d9)]==='string'?_0x361f81[_0x5b8717(0x1d9)]:undefined;if(_0x1b8d93?.[_0x5b8717(0x1d6)])return _0x315a0f;if(_0xba6cf1&&_0xb23f17!==_0xba6cf1)return resolve(_0x39433b,_0xb23f17+_0x5b8717(0x1f2));return _0x315a0f;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5d9293,_0x3f3e0b){const _0x10c521=a197_0x5104,_0xcbd68f=_0x5d9293();while(!![]){try{const _0x17e33f=-parseInt(_0x10c521(0x1b1))/0x1+-parseInt(_0x10c521(0x1b4))/0x2*(-parseInt(_0x10c521(0x1af))/0x3)+parseInt(_0x10c521(0x1b5))/0x4+-parseInt(_0x10c521(0x1b8))/0x5+parseInt(_0x10c521(0x1ad))/0x6*(parseInt(_0x10c521(0x1b9))/0x7)+parseInt(_0x10c521(0x1ba))/0x8*(parseInt(_0x10c521(0x1b2))/0x9)+-parseInt(_0x10c521(0x1bb))/0xa;if(_0x17e33f===_0x3f3e0b)break;else _0xcbd68f['push'](_0xcbd68f['shift']());}catch(_0x3ea4e8){_0xcbd68f['push'](_0xcbd68f['shift']());}}}(a197_0x5746,0x7e319));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a197_0x5746(){const _0x53ef2e=['has','alias','api.ts','datasetCode','utf-8','16584SfNkqq','cwd','1023caHtib','exec','405156tAVIPr','117FtXEdy','push','34WsLSGf','3681416vbgQdF','find','set','2743410jNCKEK','1470EQVUbB','535336hGQgST','9057850zNTIoU'];a197_0x5746=function(){return _0x53ef2e;};return a197_0x5746();}const cache=new Map();function parseApiFile(_0x2b1202){const _0x21e980=a197_0x5104,_0x4b4ce6=[],_0x5966e2=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x5e39a0;while((_0x5e39a0=_0x5966e2[_0x21e980(0x1b0)](_0x2b1202))!==null){_0x4b4ce6[_0x21e980(0x1b3)]({'datasetCode':_0x5e39a0[0x1],'tableName':_0x5e39a0[0x2],'name':_0x5e39a0[0x3],'alias':_0x5e39a0[0x4]});}return _0x4b4ce6;}export function loadAliasMap(_0x22c0c3,_0x46d582,_0xde90f0){const _0x75ef2e=a197_0x5104,_0x338de9=_0xde90f0??resolve(process[_0x75ef2e(0x1ae)](),_0x22c0c3,_0x75ef2e(0x1be));if(cache[_0x75ef2e(0x1bc)](_0x338de9))return cache['get'](_0x338de9);if(!existsSync(_0x338de9))return cache[_0x75ef2e(0x1b7)](_0x338de9,[]),[];try{const _0x3caf98=readFileSync(_0x338de9,_0x75ef2e(0x1c0)),_0x169b1c=parseApiFile(_0x3caf98);return cache[_0x75ef2e(0x1b7)](_0x338de9,_0x169b1c),_0x169b1c;}catch{return cache[_0x75ef2e(0x1b7)](_0x338de9,[]),[];}}export function resolveAlias(_0x131e0c,_0x2ac02c,_0x1a840e,_0x2fed6f){const _0x43a840=a197_0x5104;if(!_0x2ac02c)return undefined;const _0x432c44=loadAliasMap(_0x131e0c,_0x1a840e,_0x2fed6f),_0x1c2ae4=_0x432c44[_0x43a840(0x1b6)](_0x341988=>_0x341988[_0x43a840(0x1bd)]===_0x2ac02c);return _0x1c2ae4?.[_0x43a840(0x1bf)];}function a197_0x5104(_0x2710ee,_0x2d6655){_0x2710ee=_0x2710ee-0x1ad;const _0x5746af=a197_0x5746();let _0x5104c8=_0x5746af[_0x2710ee];return _0x5104c8;}export function listAliases(_0x1c0482,_0x16a0e5,_0x3c3609){return loadAliasMap(_0x1c0482,_0x16a0e5,_0x3c3609);}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5807cf,_0x2d554c){const _0x40ece1=a197_0x3ede,_0x8a5de3=_0x5807cf();while(!![]){try{const _0x4020a2=parseInt(_0x40ece1(0x295))/0x1+-parseInt(_0x40ece1(0x1e4))/0x2*(-parseInt(_0x40ece1(0x228))/0x3)+parseInt(_0x40ece1(0x29a))/0x4*(parseInt(_0x40ece1(0x1f6))/0x5)+-parseInt(_0x40ece1(0x26a))/0x6+-parseInt(_0x40ece1(0x297))/0x7+parseInt(_0x40ece1(0x2a0))/0x8+parseInt(_0x40ece1(0x1ec))/0x9*(-parseInt(_0x40ece1(0x2bd))/0xa);if(_0x4020a2===_0x2d554c)break;else _0x8a5de3['push'](_0x8a5de3['shift']());}catch(_0xf81d6c){_0x8a5de3['push'](_0x8a5de3['shift']());}}}(a197_0x8c48,0x47779));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x3b597d){_activeCookie=_0x3b597d||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x385fdf,_0x3fcba5){const _0x239211=a197_0x3ede,_0xf73238=_0x3fcba5 instanceof Error?_0x3fcba5[_0x239211(0x279)]:String(_0x3fcba5);return CliErrors[_0x239211(0x29e)]('Request\x20failed:\x20'+_0x385fdf+(_0xf73238?'\x20('+_0xf73238+')':''),_0x239211(0x1f4));}async function apiRequest(_0x4ae6cf,_0xc3df2a={}){const _0x5f29ec=a197_0x3ede,{method:method=_0x5f29ec(0x283),body:_0x2927bb,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0xc3df2a,_0x3c9123=useRuntime?getRuntimeDomain():getApiDomain(),_0x1021b7=_activeCookie||getCookie(),_0x25cc9a=''+_0x3c9123+_0x4ae6cf,_0x2ed1ef=new AbortController(),_0x4f831e=setTimeout(()=>_0x2ed1ef[_0x5f29ec(0x2a9)](),timeout);try{const _0x39e615=await fetch(_0x25cc9a,{'method':method,'headers':{'Content-Type':_0x5f29ec(0x267),'Cookie':_0x1021b7,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x2927bb?JSON[_0x5f29ec(0x21c)](_0x2927bb):undefined,'signal':_0x2ed1ef['signal']});let _0x18fcfc;try{_0x18fcfc=await _0x39e615[_0x5f29ec(0x1e6)]();}catch(_0x5e4fb8){if(_0x5e4fb8 instanceof Error&&_0x5e4fb8[_0x5f29ec(0x20e)]===_0x5f29ec(0x2b2))throw CliErrors[_0x5f29ec(0x29e)](_0x5f29ec(0x285)+_0x25cc9a);if(_0x39e615['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x5f29ec(0x29e)](_0x5f29ec(0x1e9)+_0x39e615[_0x5f29ec(0x2ab)]+')',_0x39e615[_0x5f29ec(0x2ab)]>=0x190?_0x5f29ec(0x1de):undefined);}if(!_0x39e615['ok']||_0x18fcfc[_0x5f29ec(0x218)]===![])throw CliErrors['apiError'](_0x18fcfc[_0x5f29ec(0x208)]||_0x18fcfc[_0x5f29ec(0x279)]||_0x5f29ec(0x207)+_0x39e615['status'],_0x18fcfc[_0x5f29ec(0x200)]?_0x5f29ec(0x27c)+_0x18fcfc[_0x5f29ec(0x200)]:undefined);return _0x18fcfc;}catch(_0x1db566){if(_0x1db566 instanceof CliError)throw _0x1db566;if(_0x1db566 instanceof Error&&_0x1db566[_0x5f29ec(0x20e)]===_0x5f29ec(0x2b2))throw CliErrors['apiError'](_0x5f29ec(0x285)+_0x25cc9a);throw createFetchFailureError(_0x25cc9a,_0x1db566);}finally{clearTimeout(_0x4f831e);}}async function apiFormRequest(_0x2449c8,_0x4d07fa,_0x5c64b9={}){const _0x1fc664=a197_0x3ede,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x5c64b9,_0x3688c6=_activeCookie||getCookie(),_0x3e458f=''+getApiDomain()+_0x2449c8,_0x15ee97=new AbortController(),_0x5bd4e4=setTimeout(()=>_0x15ee97[_0x1fc664(0x2a9)](),timeout);try{const _0x5787ea=await fetch(_0x3e458f,{'method':_0x1fc664(0x25e),'headers':{'Cookie':_0x3688c6,'X-Invoke-Source':_0x1fc664(0x1f5)},'body':_0x4d07fa,'signal':_0x15ee97[_0x1fc664(0x250)]});let _0x3ef3ab;try{_0x3ef3ab=await _0x5787ea[_0x1fc664(0x1e6)]();}catch(_0x56ac73){if(_0x56ac73 instanceof Error&&_0x56ac73[_0x1fc664(0x20e)]===_0x1fc664(0x2b2))throw CliErrors[_0x1fc664(0x29e)]('Request\x20timeout:\x20'+_0x3e458f);throw CliErrors[_0x1fc664(0x29e)](_0x1fc664(0x1e9)+_0x5787ea[_0x1fc664(0x2ab)]+')',_0x5787ea[_0x1fc664(0x2ab)]>=0x190?_0x1fc664(0x1de):undefined);}if(!_0x5787ea['ok']||_0x3ef3ab[_0x1fc664(0x218)]===![])throw CliErrors[_0x1fc664(0x29e)](_0x3ef3ab[_0x1fc664(0x208)]||_0x3ef3ab['message']||_0x1fc664(0x207)+_0x5787ea[_0x1fc664(0x2ab)],_0x3ef3ab['errorCode']?'API\x20error\x20code:\x20'+_0x3ef3ab['errorCode']:undefined);return _0x3ef3ab;}catch(_0x22b6be){if(_0x22b6be instanceof CliError)throw _0x22b6be;if(_0x22b6be instanceof Error&&_0x22b6be['name']===_0x1fc664(0x2b2))throw CliErrors[_0x1fc664(0x29e)](_0x1fc664(0x285)+_0x3e458f);throw createFetchFailureError(_0x3e458f,_0x22b6be);}finally{clearTimeout(_0x5bd4e4);}}export async function uploadDevelopmentFile(_0x124472,_0x53665e){const _0x1cece1=a197_0x3ede,_0x178190=await readFile(_0x53665e),_0x128149=new FormData();_0x128149['append'](_0x1cece1(0x286),_0x124472),_0x128149[_0x1cece1(0x298)](_0x1cece1(0x26c),new Blob([new Uint8Array(_0x178190)]),basename(_0x53665e));const _0x574a8a=await apiFormRequest(_0x1cece1(0x25b),_0x128149);return _0x574a8a[_0x1cece1(0x213)];}export async function queryDevelopmentFileUrl(_0x2402f3,_0x22cc78={}){const _0xed6cd0=a197_0x3ede,_0x4b6a6f=await apiRequest(_0xed6cd0(0x23b),{'method':_0xed6cd0(0x25e),'body':{'filePath':_0x2402f3,'downloadFlag':_0x22cc78[_0xed6cd0(0x272)]??![],..._0x22cc78['longTerm']?{'longTerm':!![]}:{}}});return _0x4b6a6f[_0xed6cd0(0x213)];}function isAuthFailure(_0x4f420f){const _0x43a43a=a197_0x3ede,_0x202db3=_0x4f420f[_0x43a43a(0x208)]||_0x4f420f[_0x43a43a(0x279)]||_0x4f420f['data']?.[_0x43a43a(0x279)]||_0x4f420f['errorMessage']||_0x4f420f[_0x43a43a(0x276)]||'';return _0x4f420f[_0x43a43a(0x200)]===_0x43a43a(0x227)||_0x4f420f['code']===0x191||_0x4f420f[_0x43a43a(0x258)]==='401'||_0x202db3['includes'](_0x43a43a(0x1f3))||_0x202db3[_0x43a43a(0x27b)](_0x43a43a(0x247))||_0x202db3['includes']('登录')||_0x202db3[_0x43a43a(0x27b)]('认证');}export async function platformFetch(_0x18ab0d,_0x3f83eb){const _0x4765a1=a197_0x3ede;let _0x2a6ee6;try{_0x2a6ee6=await fetch(_0x18ab0d,{'method':_0x3f83eb['method']??_0x4765a1(0x283),'headers':{'Content-Type':'application/json','Cookie':_0x3f83eb[_0x4765a1(0x1dc)],'X-Invoke-Source':_0x4765a1(0x1f5)},..._0x3f83eb[_0x4765a1(0x2a4)]&&{'body':JSON[_0x4765a1(0x21c)](_0x3f83eb[_0x4765a1(0x2a4)])}});}catch(_0x3397ef){throw createFetchFailureError(_0x18ab0d,_0x3397ef);}if(!_0x2a6ee6['ok']){if(_0x2a6ee6[_0x4765a1(0x2ab)]===0x191)throw CliErrors[_0x4765a1(0x2bc)]();throw CliErrors[_0x4765a1(0x29e)](_0x3f83eb[_0x4765a1(0x287)]+_0x4765a1(0x299)+_0x2a6ee6[_0x4765a1(0x2ab)]);}const _0x12b783=await _0x2a6ee6[_0x4765a1(0x1e6)]();if(_0x12b783[_0x4765a1(0x218)]===![]){if(isAuthFailure(_0x12b783))throw CliErrors[_0x4765a1(0x2bc)]();throw CliErrors[_0x4765a1(0x29e)](_0x12b783[_0x4765a1(0x208)]||_0x12b783[_0x4765a1(0x279)]||_0x3f83eb[_0x4765a1(0x287)]+_0x4765a1(0x22f));}return _0x12b783[_0x4765a1(0x213)];}export async function platformRequest(_0x651812,_0x19b746){const _0x3953b9=a197_0x3ede;if(/^https?:\/\//i['test'](_0x651812))throw CliErrors['validation'](_0x3953b9(0x1f1)+_0x651812,_0x3953b9(0x233));const _0x83147b=_0x651812[_0x3953b9(0x1ed)]('/')?_0x651812:'/'+_0x651812;return platformFetch(''+getApiDomain()+_0x83147b,_0x19b746);}function cleanNewlines(_0x55351d){const _0x4bc75c=a197_0x3ede;return _0x55351d['replace'](/[\r\n]+/g,'\x20')[_0x4bc75c(0x2ba)]();}function cleanDatasetName(_0x568bfc){const _0x5b37c2=a197_0x3ede;if(!_0x568bfc[_0x5b37c2(0x20e)])return _0x568bfc;return{..._0x568bfc,'name':cleanNewlines(_0x568bfc[_0x5b37c2(0x20e)])};}export async function fetchModelList(_0x2fb308,_0x5bd101){const _0x4ce043=a197_0x3ede,_0x55e2ea=getEnv(),_0x4107dd=new URLSearchParams({'appcode':_0x2fb308,'otype':_0x4ce043(0x265)}),_0x28dd3f=_0x4ce043(0x2b8)+_0x4107dd['toString']();logger[_0x4ce043(0x264)](_0x4ce043(0x2a7),_0x4ce043(0x261)+_0x55e2ea+')',{'apiPath':_0x28dd3f});const _0x30a314=await platformRequest(_0x28dd3f,{'cookie':_0x5bd101,'label':_0x4ce043(0x29f)}),_0x16918c=(_0x30a314[_0x4ce043(0x239)]??[])[_0x4ce043(0x281)](cleanDatasetName);return{'configArray':_0x16918c,'count':_0x16918c[_0x4ce043(0x221)]};}export async function fetchDatasetDoc(_0x559f97){const _0x1a0e0e=a197_0x3ede,{appCode:_0x3c279d,cookie:_0x327b0c,datasetCode:_0x1ac978,datasetId:_0x10ed49,extraParams:_0x1b5968}=_0x559f97,_0x59d8ca=await platformRequest(_0x1a0e0e(0x24a),{'method':_0x1a0e0e(0x25e),'body':{'appCode':_0x3c279d,'datasetCode':_0x1ac978,'datasetId':_0x10ed49,..._0x1b5968||{}},'cookie':_0x327b0c,'label':_0x1a0e0e(0x21b)+_0x1ac978+')'});if(!_0x59d8ca||typeof _0x59d8ca[_0x1a0e0e(0x20c)]!==_0x1a0e0e(0x24c))throw new Error(_0x1a0e0e(0x2ad)+_0x1ac978+_0x1a0e0e(0x1fe));return _0x59d8ca[_0x1a0e0e(0x20c)];}export async function getMenuTree(_0x5bebf6,_0x14c06c){const _0x539639=a197_0x3ede,_0x24ddae=new URLSearchParams({'appCode':_0x5bebf6});return platformRequest(_0x539639(0x266)+_0x24ddae[_0x539639(0x1ef)](),{'cookie':_0x14c06c,'label':'Fetch\x20menu\x20list'});}export async function createMenuRecord(_0x4e5b6a,_0x114c44,_0x593daa){const _0xf66ac5=a197_0x3ede;return platformRequest('/smartapi/menu/create',{'method':_0xf66ac5(0x25e),'body':_0x4e5b6a,'cookie':_0x114c44,'label':_0x593daa});}export async function updateMenuRecord(_0x529ef2,_0x1389a7,_0x3c6e65){const _0x4aa620=a197_0x3ede;return platformRequest(_0x4aa620(0x1f9),{'method':_0x4aa620(0x25e),'body':_0x529ef2,'cookie':_0x1389a7,'label':_0x3c6e65});}export async function deleteMenuRecord(_0x408495,_0x309100,_0x2fed93){return platformRequest('/smartapi/menu/delete',{'method':'POST','body':{'id':_0x408495},'cookie':_0x309100,'label':_0x2fed93});}export async function batchDeleteMenuRecords(_0x4f543b,_0x26dd70,_0x35eafa){return platformRequest('/smartapi/menu/batchDelete',{'method':'POST','body':{'idList':_0x4f543b},'cookie':_0x26dd70,'label':_0x35eafa});}export async function startMenuRegroup(_0x430c6b,_0x3af5e6,_0x199415){const _0x4ccbd3=a197_0x3ede;return platformRequest('/smartapi/menu/regroup',{'method':_0x4ccbd3(0x25e),'body':_0x430c6b,'cookie':_0x3af5e6,'label':_0x199415});}export async function getAsyncTaskStatus(_0x42e229,_0x16c6c8,_0x2dd639){const _0x55fed6=a197_0x3ede,_0x3452f=new URLSearchParams({'appCode':_0x16c6c8});return platformRequest(_0x55fed6(0x1ee)+encodeURIComponent(_0x42e229)+'?'+_0x3452f[_0x55fed6(0x1ef)](),{'cookie':_0x2dd639,'label':'Fetch\x20async\x20task\x20'+_0x42e229});}export async function listBffScripts(_0x52b89c,_0x237727,_0x401658){const _0xd9e11f=a197_0x3ede;let _0x587525=_0xd9e11f(0x214)+_0x52b89c;if(_0x237727)_0x587525+=_0xd9e11f(0x1fb)+_0x237727;const _0x1eb011=await apiRequest(_0x587525);let _0x3f0341=extractList(_0x1eb011[_0xd9e11f(0x213)]);if(_0x401658?.['scriptName']){const _0x5c4a83=_0x401658[_0xd9e11f(0x220)][_0xd9e11f(0x24d)]();_0x3f0341=_0x3f0341[_0xd9e11f(0x1e1)](_0x3d6dc9=>_0x3d6dc9['functionName']?.[_0xd9e11f(0x24d)]()[_0xd9e11f(0x27b)](_0x5c4a83)||_0x3d6dc9[_0xd9e11f(0x270)]?.[_0xd9e11f(0x24d)]()['includes'](_0x5c4a83));}return _0x3f0341;}export async function getBffScriptInfo(_0x53bc80){const _0x464202=a197_0x3ede,_0x3cadbe=await apiRequest('/api/management/library/scripts/info?id='+_0x53bc80);if(!_0x3cadbe[_0x464202(0x213)])throw CliErrors[_0x464202(0x202)]('BFF\x20script\x20not\x20found:\x20id='+_0x53bc80);return _0x3cadbe['data'];}export async function saveBffScript(_0x35b373){const _0x12f24e=a197_0x3ede,_0x314dc8=await apiRequest(_0x12f24e(0x21e),{'method':_0x12f24e(0x25e),'body':_0x35b373}),{id:_0x5a9415,entity:_0x172b91}=normalizeEntityWithIdResponse(_0x314dc8[_0x12f24e(0x213)]);if(_0x5a9415!==undefined){const _0x38007a=typeof _0x172b91[_0x12f24e(0x280)]===_0x12f24e(0x24c)||typeof _0x172b91[_0x12f24e(0x25c)]==='string'?_0x172b91:undefined;return{'id':_0x5a9415,'script':_0x38007a};}throw CliErrors[_0x12f24e(0x29e)](_0x12f24e(0x2b3));}export async function deleteBffScript(_0x531e57){const _0x14c395=a197_0x3ede;await apiRequest(_0x14c395(0x2b5),{'method':_0x14c395(0x25e),'body':{'id':_0x531e57}});}export async function getBffScriptStatistics(_0x3d12bf){const _0x57041c=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x3d12bf);return extractList(_0x57041c['data']);}export async function clearBffScriptCache(){const _0x5098d7=a197_0x3ede,_0x9cddaa=await apiRequest('/api/management/script/cache/clear',{'method':_0x5098d7(0x25e),'useRuntime':!![]});return typeof _0x9cddaa[_0x5098d7(0x213)]===_0x5098d7(0x24c)?_0x9cddaa[_0x5098d7(0x213)]:'';}export async function listBffDatasetOperations(_0x2d63b1,_0x125de5){const _0x386ccc=a197_0x3ede,_0xee4325=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':'POST','body':{'appCode':_0x2d63b1,'datasetId':_0x125de5}});return _0xee4325[_0x386ccc(0x213)];}export async function listSqlQueries(_0x118d6b,_0x2822df){const _0x3cffde=a197_0x3ede,_0x28f2b1=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':'POST','body':{'appCode':_0x118d6b,'currentPage':_0x2822df?.[_0x3cffde(0x24b)]??0x1,'pageSize':_0x2822df?.[_0x3cffde(0x224)]??0x32,'sqlCode':_0x2822df?.[_0x3cffde(0x254)],'sqlName':_0x2822df?.[_0x3cffde(0x1fd)]}});return _0x28f2b1['data'];}export async function getSqlQueryInfo(_0x237132,_0xf7e4b6){const _0x28e41d=a197_0x3ede,_0x1701f5=await listSqlQueries(_0x237132,{'sqlCode':_0xf7e4b6}),_0x78b810=_0x1701f5[_0x28e41d(0x27a)]?.[0x0];if(!_0x78b810)throw CliErrors[_0x28e41d(0x202)](_0x28e41d(0x2a3)+_0xf7e4b6);return _0x78b810;}export async function getSqlQueryDetail(_0xa211e){const _0x110221=a197_0x3ede,_0x5755f1=await apiRequest('/smartapi/custom/getUserCustomSql'+(_0x110221(0x22b)+encodeURIComponent(_0xa211e)));if(!_0x5755f1[_0x110221(0x213)])throw CliErrors[_0x110221(0x202)](_0x110221(0x2a3)+_0xa211e);return _0x5755f1['data'];}export async function getSqlQueryDetailById(_0x2aff25){const _0x29631f=a197_0x3ede,_0x2e8928=await apiRequest(_0x29631f(0x235)+_0x2aff25);if(!_0x2e8928[_0x29631f(0x213)])throw CliErrors[_0x29631f(0x202)]('SQL\x20query\x20not\x20found:\x20id='+_0x2aff25);return _0x2e8928[_0x29631f(0x213)];}export async function createSqlQuery(_0x34b635){const _0x33e371=a197_0x3ede,_0x16be18=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':_0x33e371(0x25e),'body':_0x34b635}),{id:_0x906512,entity:_0x13cfd4}=normalizeEntityWithIdResponse(_0x16be18[_0x33e371(0x213)]);if(!('sqlCode'in _0x13cfd4)&&_0x906512)return getSqlQueryDetailById(_0x906512);return normalizeSqlQueryEntity(_0x13cfd4);}export async function updateSqlQuery(_0x140a91){const _0x1778bf=a197_0x3ede,_0x15f43a=await apiRequest(_0x1778bf(0x1f7),{'method':_0x1778bf(0x25e),'body':_0x140a91}),{id:_0x3557a6,entity:_0x287eaf}=normalizeEntityWithIdResponse(_0x15f43a[_0x1778bf(0x213)]);if(!(_0x1778bf(0x254)in _0x287eaf)){if(_0x140a91[_0x1778bf(0x254)])return getSqlQueryDetail(_0x140a91[_0x1778bf(0x254)]);if(_0x3557a6)return getSqlQueryDetailById(_0x3557a6);}return normalizeSqlQueryEntity(_0x287eaf);}export async function deleteSqlQuery(_0x233bdf){const _0x470604=a197_0x3ede;await apiRequest(_0x470604(0x236),{'method':_0x470604(0x25e),'body':_0x233bdf});}export async function saveSqlQuery(_0x3a2505){const _0x108924=a197_0x3ede,_0x1ae6f6=await apiRequest(_0x108924(0x274),{'method':'POST','body':_0x3a2505});return _0x1ae6f6[_0x108924(0x213)];}function normalizeSqlQueryEntity(_0xb4bcd1){const _0x48a6b8=a197_0x3ede;return{..._0xb4bcd1,'id':Number(_0xb4bcd1['id']),'dbId':_0xb4bcd1['dbId']==null?undefined:Number(_0xb4bcd1[_0x48a6b8(0x269)]),'version':_0xb4bcd1[_0x48a6b8(0x24f)]==null?undefined:Number(_0xb4bcd1[_0x48a6b8(0x24f)])};}export async function executeSql(_0x58b793,_0x860c85,_0x44889b){const _0x5aa504=a197_0x3ede,_0x590682=await apiRequest('/api/custom/executeSql',{'method':_0x5aa504(0x25e),'body':{'appCode':_0x58b793,'sqlCode':_0x860c85,..._0x44889b&&{'params':_0x44889b}},'useRuntime':!![]});return _0x590682[_0x5aa504(0x213)];}export async function executeDatasetDataOperation(_0x5ad55e,_0x47076d,_0x23c859,_0x39b6ab={}){const _0x5bc04e=a197_0x3ede;try{const _0x5d180e=await apiRequest('/api/'+_0x5ad55e+'/'+_0x47076d+'/'+_0x23c859,{'method':_0x5bc04e(0x25e),'body':_0x39b6ab,'useRuntime':!![]});return _0x5d180e[_0x5bc04e(0x213)];}catch(_0x14f2cf){if(_0x23c859===_0x5bc04e(0x1e7)&&_0x14f2cf instanceof CliError&&_0x14f2cf[_0x5bc04e(0x258)]===_0x5bc04e(0x234)&&_0x39b6ab['id']!==undefined&&_0x39b6ab['id']!==null&&_0x39b6ab['id']!==''){const _0x5c053f=await apiRequest(_0x5bc04e(0x2a5)+_0x5ad55e+'/'+_0x47076d+_0x5bc04e(0x21d),{'method':_0x5bc04e(0x25e),'body':{'where':{'id':{'$eq':_0x39b6ab['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x15e0e1=Array['isArray'](_0x5c053f[_0x5bc04e(0x213)]?.[_0x5bc04e(0x27a)])?_0x5c053f['data'][_0x5bc04e(0x27a)]:[];return _0x15e0e1[0x0]??null;}throw _0x14f2cf;}}export async function listDatasets(_0x1e4fa6,_0x5ebb98){const _0x38518d=a197_0x3ede,_0x3c0f0d={'appCode':_0x1e4fa6,'deleted':_0x5ebb98?.[_0x38518d(0x248)]??![]};if(_0x5ebb98?.[_0x38518d(0x258)])_0x3c0f0d['code']=_0x5ebb98['code'];if(_0x5ebb98?.[_0x38518d(0x20e)])_0x3c0f0d[_0x38518d(0x20e)]=_0x5ebb98['name'];const _0x3a750f=await apiRequest(_0x38518d(0x28a),{'method':_0x38518d(0x25e),'body':_0x3c0f0d});return extractList(_0x3a750f['data']);}export async function deleteDataset(_0x2c46d2,_0x10afa2){const _0x343a46=a197_0x3ede;await apiRequest('/smartapi/dataset/delete-dataset',{'method':_0x343a46(0x25e),'body':{'appCode':_0x2c46d2,'datasetId':_0x10afa2}});}export async function restoreDataset(_0x3da36f,_0xe093d8){const _0x85a24a=a197_0x3ede;await apiRequest(_0x85a24a(0x241),{'method':_0x85a24a(0x25e),'body':{'appCode':_0x3da36f,'datasetId':_0xe093d8}});}export async function previewTextGeneratedDataset(_0x1fc10b,_0x4b3a59){const _0x1442c0=a197_0x3ede,_0x4ec164=await apiRequest('/smartapi/dataset/text-generate/preview',{'method':_0x1442c0(0x25e),'body':{'appCode':_0x1fc10b,'datasetName':_0x4b3a59[_0x1442c0(0x296)],'requirementDescription':_0x4b3a59[_0x1442c0(0x1eb)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x4ec164['data'];}export async function startTextGeneratedDataset(_0x32b16c,_0x21dee0,_0x257211){const _0x3dcf2f=a197_0x3ede,_0xe80ed5=await apiRequest(_0x3dcf2f(0x28e),{'method':_0x3dcf2f(0x25e),'body':{'appCode':_0x32b16c,..._0x257211?.[_0x3dcf2f(0x222)]?{'clientOperationId':_0x257211[_0x3dcf2f(0x222)]}:{},'design':_0x21dee0},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0xe80ed5['data'];}export async function getTextGeneratedDatasetStatus(_0x3ecd09,_0x7abcc9){const _0x17ae14=a197_0x3ede,_0x40bd78=new URLSearchParams({'appCode':_0x3ecd09});_0x7abcc9[_0x17ae14(0x210)]&&_0x40bd78[_0x17ae14(0x20d)](_0x17ae14(0x210),_0x7abcc9[_0x17ae14(0x210)]);_0x7abcc9['clientOperationId']&&_0x40bd78[_0x17ae14(0x20d)](_0x17ae14(0x222),_0x7abcc9['clientOperationId']);const _0x9254f9=await apiRequest(_0x17ae14(0x1fa)+_0x40bd78[_0x17ae14(0x1ef)]());return _0x9254f9['data'];}export async function searchDatasets(_0x73604e,_0x36c6cc){const _0x141975=a197_0x3ede,_0x355afd=await listDatasets(_0x73604e,{'name':_0x36c6cc}),_0x26067b=_0x36c6cc[_0x141975(0x24d)](),_0x218ff6=new Set(_0x355afd[_0x141975(0x281)](_0x218502=>_0x218502['id'])),_0x4e4c4a=_0x355afd[_0x141975(0x1e1)](_0x4df7c8=>_0x4df7c8[_0x141975(0x22d)]?.[_0x141975(0x252)]?.['toLowerCase']()['includes'](_0x26067b)||_0x4df7c8[_0x141975(0x270)]?.['toLowerCase']()['includes'](_0x26067b)),_0x5a79ee=await listDatasets(_0x73604e,{'code':_0x36c6cc});for(const _0xcb2839 of _0x5a79ee){!_0x218ff6[_0x141975(0x2ae)](_0xcb2839['id'])&&(_0x355afd[_0x141975(0x2af)](_0xcb2839),_0x218ff6[_0x141975(0x21a)](_0xcb2839['id']));}return _0x355afd;}export function normalizeDatasetOperations(_0xe20e6){const _0x128d67=a197_0x3ede;if(Array[_0x128d67(0x2b9)](_0xe20e6))return _0xe20e6[_0x128d67(0x1e1)](_0x24401b=>_0x24401b!=null&&typeof _0x24401b===_0x128d67(0x225));if(_0xe20e6&&typeof _0xe20e6===_0x128d67(0x225))return Object[_0x128d67(0x2b1)](_0xe20e6)[_0x128d67(0x1e1)](([,_0x295264])=>_0x295264!=null&&typeof _0x295264===_0x128d67(0x225))[_0x128d67(0x281)](([_0x53dd01,_0x117429])=>({..._0x117429,'name':_0x117429[_0x128d67(0x20e)]??_0x117429[_0x128d67(0x240)]??_0x53dd01}));return[];}export async function getDatasetDetail(_0x552141){const _0x336e01=a197_0x3ede,_0x148506=/^\d+$/['test'](_0x552141)?'id':_0x336e01(0x258),_0x425aaa=await apiRequest(_0x336e01(0x2b4)+_0x148506+'='+_0x552141);return _0x425aaa[_0x336e01(0x213)];}export async function updateDrivenData(_0x54bba1){const _0x1d8590=a197_0x3ede,_0x26c0b0=await apiRequest(_0x1d8590(0x203),{'method':_0x1d8590(0x25e),'body':_0x54bba1});return _0x26c0b0[_0x1d8590(0x213)];}export async function getDatasetOperations(_0x16055b){const _0x2f6ef0=a197_0x3ede,_0x19d522=await getDatasetDetail(_0x16055b),_0x2b3773=normalizeDatasetOperations(_0x19d522['operations'])[_0x2f6ef0(0x281)](_0x59fdae=>({'name':_0x59fdae[_0x2f6ef0(0x20e)]||_0x59fdae['operationName'],'displayName':_0x59fdae[_0x2f6ef0(0x28f)]||_0x59fdae[_0x2f6ef0(0x20e)],'type':_0x59fdae[_0x2f6ef0(0x1f2)],'method':_0x59fdae[_0x2f6ef0(0x23e)],'path':_0x59fdae['path'],'enabled':_0x59fdae[_0x2f6ef0(0x256)]??!![],'requestFields':_0x59fdae['requestFields'],'responseFields':_0x59fdae['responseFields']}));return{'dataset':{'id':_0x19d522['id']??_0x19d522[_0x2f6ef0(0x2b7)],'name':_0x19d522[_0x2f6ef0(0x20e)],'code':_0x19d522[_0x2f6ef0(0x258)]||_0x19d522[_0x2f6ef0(0x27e)],'tableName':_0x19d522[_0x2f6ef0(0x252)]||_0x19d522[_0x2f6ef0(0x22d)]?.[_0x2f6ef0(0x252)]},'operations':_0x2b3773};}export async function getOperationDetail(_0x4be3b8,_0x287432,_0x1cfe54){const _0x1fa0ee=a197_0x3ede;let _0x4fb1ef=_0x287432;if(!/^\d+$/['test'](_0x287432)){const _0xf507bd=await listDatasets(_0x4be3b8,{'code':_0x287432}),_0x3893bc=_0xf507bd[_0x1fa0ee(0x28b)](_0x325bce=>_0x325bce[_0x1fa0ee(0x258)]===_0x287432||String(_0x325bce['id'])===_0x287432);if(!_0x3893bc)throw CliErrors['validation'](_0x1fa0ee(0x293)+_0x287432);_0x4fb1ef=String(_0x3893bc['id']);}const _0x10c0dc=await getDatasetDetail(_0x4fb1ef),_0x2a38fd=normalizeDatasetOperations(_0x10c0dc['operations'])['find'](_0x5d4d00=>(_0x5d4d00[_0x1fa0ee(0x20e)]||_0x5d4d00[_0x1fa0ee(0x240)])===_0x1cfe54);if(!_0x2a38fd)throw CliErrors['validation'](_0x1fa0ee(0x1e8)+_0x1cfe54+_0x1fa0ee(0x28c)+_0x287432);return{'dataset':{'id':_0x10c0dc['id']??_0x10c0dc['modelId'],'name':_0x10c0dc[_0x1fa0ee(0x20e)],'code':_0x10c0dc['code']||_0x10c0dc[_0x1fa0ee(0x27e)],'tableName':_0x10c0dc[_0x1fa0ee(0x252)]||_0x10c0dc[_0x1fa0ee(0x22d)]?.[_0x1fa0ee(0x252)]},'operation':_0x2a38fd};}export async function startGenerateStandardPages(_0x29e9b4,_0x4a8ae9,_0x474f04){const _0x18659a=a197_0x3ede,_0x15ea13=await apiRequest(_0x18659a(0x294)+_0x4a8ae9+_0x18659a(0x23a),{'method':'POST','body':{'appCode':_0x29e9b4,..._0x474f04?.[_0x18659a(0x222)]?{'clientOperationId':_0x474f04[_0x18659a(0x222)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x15ea13[_0x18659a(0x213)];}export async function getGenerateStandardPagesStatus(_0x5dde45,_0x1cc6c2,_0x515229){const _0x461766=a197_0x3ede,_0x3a9953=new URLSearchParams({'appCode':_0x5dde45});_0x515229[_0x461766(0x210)]&&_0x3a9953[_0x461766(0x20d)](_0x461766(0x210),_0x515229[_0x461766(0x210)]);_0x515229[_0x461766(0x222)]&&_0x3a9953[_0x461766(0x20d)](_0x461766(0x222),_0x515229['clientOperationId']);const _0x2dec5d=await apiRequest(_0x461766(0x294)+_0x1cc6c2+'/generate-standard-pages/status?'+_0x3a9953['toString']());return _0x2dec5d['data'];}export async function getStandardPageStatus(_0x519b5d,_0x41e6ab){const _0x5c9e2d=a197_0x3ede,_0x122a26=await apiRequest(_0x5c9e2d(0x294)+_0x41e6ab+_0x5c9e2d(0x237)+encodeURIComponent(_0x519b5d));return _0x122a26[_0x5c9e2d(0x213)];}export async function tryGetStandardPageStatus(_0x5aa9db,_0x21ad75){const _0x56b1d2=a197_0x3ede;try{return await getStandardPageStatus(_0x5aa9db,_0x21ad75);}catch(_0x43e91d){if(_0x43e91d instanceof CliError&&_0x43e91d[_0x56b1d2(0x258)]===_0x56b1d2(0x234)&&/404|not found|non-json response/i['test'](_0x43e91d[_0x56b1d2(0x279)]))return null;throw _0x43e91d;}}export async function syncStandardPages(_0xd6f95d,_0x127269){const _0x134f30=a197_0x3ede,_0x73571b=await apiRequest(_0x134f30(0x294)+_0x127269+_0x134f30(0x292),{'method':_0x134f30(0x25e),'body':{'appCode':_0xd6f95d}});return _0x73571b['data'];}export async function getPageDetail(_0x408363){const _0x351e11=a197_0x3ede,_0x21981a=await apiRequest(_0x351e11(0x29c)+_0x408363);if(!_0x21981a[_0x351e11(0x213)])throw CliErrors[_0x351e11(0x202)](_0x351e11(0x27d)+_0x408363);return _0x21981a['data'];}function a197_0x8c48(){const _0x5198da=['/smartapi/question/er-config/cli/detail?','apiError','Fetch\x20datasets','3260424lvdyFD','/smartapi/permit/role/get-one','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','SQL\x20query\x20not\x20found:\x20','body','/api/','min','fetch-model-list','/smartapi/app-config/create','abort','/smartapi/app-config/list','status','/smartapi/permit/page/save','Invalid\x20response\x20format\x20(','has','push','.remove(id);','entries','AbortError','BFF\x20save\x20returned\x20no\x20valid\x20id','/smartapi/dataset/get-driven-data?','/api/management/library/scripts/delete','\x20apps.\x20','modelId','/api/node-toolbox/dataset/model-list?','isArray','trim','mobile','authRequired','47590jyvOAD','(/*\x20params\x20*/);','/smartapi/permit/role/update','/smartapi/permit/resource/get-menu-list','cookie','/smartapi/permit/page/get-one','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','const\x20results\x20=\x20data.execResult\x20||\x20[];','.create({\x20/*\x20fields\x20*/\x20});','filter','remove','userId','2wMGqYA','permits','json','getOne','Operation\x20\x22','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','requirementDescription','549jztxzL','startsWith','/smartapi/tasks/','toString','//\x20SQL:\x20','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','type','401','Check\x20network\x20connectivity\x20and\x20try\x20again.','cli:rabetbase','2353730dDNCdV','/smartapi/custom/updateUserCustomSql','remark','/smartapi/menu/update','/smartapi/dataset/text-generate/status?','&type=','roleType','sqlName','):\x20missing\x20data.markdown\x20field','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','errorCode','tags','validation','/smartapi/dataset/update-driven-data','/smartapi/permit/role/get-permit-list','/smartapi/permit/role/get-list','const\x20result\x20=\x20await\x20client.models.','API\x20error:\x20','errorMsg','/smartapi/question/er-config/cli/delete-single','/smartapi/question/er-config/business-group/edit','/smartapi/question/er-config/cli/update-single','markdown','set','name','create','operationId','table','/smartapi/dblink/update','data','/api/management/library/scripts/list?appCode=','isFinite','DATA_NOT_EXIST','/smartapi/question/er-config/cli/erCreate','success','Warning:\x20showing\x20first\x20','add','Fetch\x20doc\x20(','stringify','/filter','/api/management/library/scripts/save','\x20\x20currentPage:\x201,','scriptName','length','clientOperationId','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','pageSize','object','value','UNAUTHORIZED','102801XkZQIF','/smartapi/app-config/getByKey','needPublic','?sqlCode=','datasetTableCount','dbtableConfig','summary','\x20failed','ENABLE','/smartapi/permit/role/delete','key','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','api_error','/smartapi/custom/getUserCustomSql?id=','/smartapi/custom/deleteUserCustomSql','/standard-page-status?appCode=','includeImports','configArray','/generate-standard-pages/start','/smartapi/common/queryFileUrl','/userTenant/getByTenantCode','\x20\x20sqlCode:\x20\x27','method','target','operationName','/smartapi/dataset/restore-dataset','avatar','userTenantRelationList','const\x20data\x20=\x20await\x20client.sql.execute({','replace','/smartapi/lovrabet/update-page','Unauthorized','deleted','ER\x20relation\x20does\x20not\x20exist','/api/node-toolbox/api-doc-generator','currentPage','string','toLowerCase','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','version','signal','});','tableName','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','sqlCode','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','enabled','API\x20error\x20code:\x20306','code','/smartapi/db-analysis/jobs/cancel','tableList','/smartapi/common/uploadFile','scriptType','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','POST','update','list','正在从服务器拉取模型列表...\x20(环境:\x20','join','roleName','info','array','/smartapi/menu/find?','application/json','\x20\x20return\x20rows;','dbId','3178236UXdwTm','sdk','file','\x20\x20pageSize:\x2020,','/smartapi/dblink/delete','needSelf','description','totalCount','download','/smartapi/dblink/getList','/api/node-toolbox/sql/save','warn','error','email','/smartapi/dblink/getTableDiffV2ByPage','message','tableData','includes','API\x20error\x20code:\x20','Page\x20not\x20found:\x20','modelCode','\x20\x20where:\x20{},','functionName','map','/smartapi/dblink/getOne','GET','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','Request\x20timeout:\x20','appCode','label','.filter({','/smartapi/dblink/getAllTableList','/smartapi/dataset/get-dataset-list','find','\x22\x20not\x20found\x20in\x20dataset\x20','delete','/smartapi/dataset/text-generate/start','displayName','pageIndex','\x20\x20});','/sync-to-pages','Dataset\x20not\x20found:\x20','/smartapi/lovrabet/dataset/','265568XqiyUM','datasetName','457800oCudIg','append','\x20failed,\x20HTTP\x20','4ZKDsMa','hint','/smartapi/lovrabet/detail?pageId='];a197_0x8c48=function(){return _0x5198da;};return a197_0x8c48();}export async function updatePage(_0x4d93df,_0xd8a4bd,_0x52acf2,_0x34aed3){const _0x1e9d86=a197_0x3ede,_0x122f03=await apiRequest(_0x1e9d86(0x246),{'method':_0x1e9d86(0x25e),'body':{'appCode':_0x4d93df,'pageId':_0xd8a4bd,'code':_0x52acf2,'datasetIds':_0x34aed3}});return _0x122f03[_0x1e9d86(0x213)];}export function generateSdkCode(_0x42b219,_0x4765d3,_0x242271){const _0x2591d3=a197_0x3ede,_0x11ad59=_0x242271?.[_0x2591d3(0x238)]??!![],_0x55dfeb='dataset_'+_0x42b219[_0x2591d3(0x258)]?.[_0x2591d3(0x245)](/-/g,'_'),_0x39aed4=_0x4765d3[_0x2591d3(0x20e)]||_0x4765d3[_0x2591d3(0x240)]||_0x2591d3(0x1e1),_0x182b08=[];_0x11ad59&&_0x182b08[_0x2591d3(0x2af)](_0x2591d3(0x284),'',_0x2591d3(0x1ea),'');_0x182b08[_0x2591d3(0x2af)]('//\x20'+_0x42b219[_0x2591d3(0x20e)]+'\x20('+(_0x42b219[_0x2591d3(0x252)]||_0x2591d3(0x211))+')');if(_0x39aed4===_0x2591d3(0x1e1))_0x182b08[_0x2591d3(0x2af)](_0x2591d3(0x206)+_0x55dfeb+_0x2591d3(0x288),_0x2591d3(0x27f),_0x2591d3(0x26d),_0x2591d3(0x21f),_0x2591d3(0x251));else{if(_0x39aed4===_0x2591d3(0x1e7))_0x182b08['push']('const\x20result\x20=\x20await\x20client.models.'+_0x55dfeb+'.getOne(id);');else{if(_0x39aed4===_0x2591d3(0x20f))_0x182b08[_0x2591d3(0x2af)]('const\x20result\x20=\x20await\x20client.models.'+_0x55dfeb+_0x2591d3(0x1e0));else{if(_0x39aed4===_0x2591d3(0x25f))_0x182b08[_0x2591d3(0x2af)](_0x2591d3(0x206)+_0x55dfeb+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x39aed4===_0x2591d3(0x28d)||_0x39aed4===_0x2591d3(0x1e2)?_0x182b08['push']('const\x20result\x20=\x20await\x20client.models.'+_0x55dfeb+_0x2591d3(0x2b0)):_0x182b08[_0x2591d3(0x2af)]('const\x20result\x20=\x20await\x20client.models.'+_0x55dfeb+'.'+_0x39aed4+_0x2591d3(0x2be));}}}return _0x182b08[_0x2591d3(0x262)]('\x0a');}export function generateSqlCodeTemplate(_0x1914b2,_0x202e91){const _0x50564b=a197_0x3ede,_0x2eaed2=_0x202e91?.[_0x50564b(0x23f)]??_0x50564b(0x26b),_0xfb213c=_0x202e91?.[_0x50564b(0x238)]??!![],_0x2a087e=[];return _0x2a087e['push'](_0x50564b(0x1f0)+_0x1914b2['sqlName']+'\x20('+_0x1914b2[_0x50564b(0x254)]+')'),_0x2eaed2===_0x50564b(0x26b)?(_0xfb213c&&_0x2a087e[_0x50564b(0x2af)](_0x50564b(0x284),'',_0x50564b(0x1ea),''),_0x2a087e['push'](_0x50564b(0x244),_0x50564b(0x23d)+_0x1914b2[_0x50564b(0x254)]+'\x27,',_0x50564b(0x24e),_0x50564b(0x251),_0x50564b(0x223),_0x50564b(0x1df))):_0x2a087e[_0x50564b(0x2af)](_0x50564b(0x2a2),_0x50564b(0x255),_0x50564b(0x253),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x1914b2['sqlCode']+'\x27,',_0x50564b(0x1ff),_0x50564b(0x291),_0x50564b(0x268),'}'),_0x2a087e[_0x50564b(0x262)]('\x0a');}export async function getErConfig(_0x24a928,_0x53a83b){const _0x4c5e8f=a197_0x3ede,_0x863211=await apiRequest('/smartapi/question/er-config',{'method':_0x4c5e8f(0x25e),'body':{'appCode':_0x24a928,'dblinkId':_0x53a83b},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x863211[_0x4c5e8f(0x213)];}export async function getErRelationDetail(_0x3f3eac,_0x41ba98){const _0x102953=a197_0x3ede,_0x2da7d6=new URLSearchParams({'appCode':_0x3f3eac,'relationId':String(_0x41ba98)});try{const _0xd6fd94=await apiRequest(_0x102953(0x29d)+_0x2da7d6[_0x102953(0x1ef)]());return _0xd6fd94[_0x102953(0x213)]?.['relation']??null;}catch(_0x53608d){if(_0x53608d instanceof CliError&&_0x53608d[_0x102953(0x258)]===_0x102953(0x234)&&(_0x53608d[_0x102953(0x29b)]?.['includes'](_0x102953(0x216))||_0x53608d[_0x102953(0x29b)]===_0x102953(0x257)&&_0x53608d[_0x102953(0x279)]===_0x102953(0x249)))return null;throw _0x53608d;}}export async function createErRelation(_0x2c6519){const _0x15b42f=a197_0x3ede,_0xef3d7e=await apiRequest(_0x15b42f(0x217),{'method':_0x15b42f(0x25e),'body':_0x2c6519,'allowNonJsonSuccess':!![]});return _0xef3d7e[_0x15b42f(0x213)];}export async function updateErRelation(_0x1982b8){const _0x509865=a197_0x3ede,_0x4df73a=await apiRequest(_0x509865(0x20b),{'method':'POST','body':_0x1982b8,'allowNonJsonSuccess':!![]});return _0x4df73a['data'];}export async function deleteErRelation(_0x297eb8){const _0x3e3ca7=a197_0x3ede,_0x38b0d3=await apiRequest(_0x3e3ca7(0x209),{'method':_0x3e3ca7(0x25e),'body':_0x297eb8,'allowNonJsonSuccess':!![]});return _0x38b0d3['data'];}export async function updateErBusinessGroup(_0x9765c1){const _0x59fa34=a197_0x3ede,_0x3b5d69=await apiRequest(_0x59fa34(0x20a),{'method':_0x59fa34(0x25e),'body':_0x9765c1,'allowNonJsonSuccess':!![]});return _0x3b5d69[_0x59fa34(0x213)];}function buildQuery(_0x2e4f04){const _0x3da9a6=a197_0x3ede,_0x3184db=new URLSearchParams();for(const [_0x40de9d,_0x43b2ae]of Object[_0x3da9a6(0x2b1)](_0x2e4f04)){if(_0x43b2ae===undefined||_0x43b2ae==='')continue;_0x3184db[_0x3da9a6(0x20d)](_0x40de9d,String(_0x43b2ae));}const _0x278d86=_0x3184db[_0x3da9a6(0x1ef)]();return _0x278d86?'?'+_0x278d86:'';}export async function listNotificationChannelConfigs(_0x3b323e,_0x3817e){const _0x14595a=a197_0x3ede,_0x159ca8=await apiRequest('/notification/channel-config/list'+buildQuery({'appCode':_0x3b323e,'channelType':_0x3817e}));return Array[_0x14595a(0x2b9)](_0x159ca8[_0x14595a(0x213)])?_0x159ca8['data']:[];}export async function listAppConfigs(_0x5709f3,_0x3fd97d){const _0x6591ea=a197_0x3ede,_0x143f91=await apiRequest(_0x6591ea(0x2aa),{'method':'POST','body':{'appCode':_0x5709f3,..._0x3fd97d?.['key']?{'key':_0x3fd97d['key']}:{},..._0x3fd97d?.[_0x6591ea(0x201)]?{'tags':_0x3fd97d[_0x6591ea(0x201)]}:{}}});return extractAppConfigList(_0x143f91[_0x6591ea(0x213)]);}export async function getAppConfigByKey(_0x236b2a,_0xfbbcc9){const _0x46907e=a197_0x3ede,_0x648ca1=await apiRequest(_0x46907e(0x229)+buildQuery({'appCode':_0x236b2a,'key':_0xfbbcc9}));return _0x648ca1[_0x46907e(0x213)]??null;}export async function createAppConfig(_0x1b4fed){const _0x5dc950=a197_0x3ede,_0x440ec2=await apiRequest(_0x5dc950(0x2a8),{'method':_0x5dc950(0x25e),'body':{'appCode':_0x1b4fed[_0x5dc950(0x286)],'key':_0x1b4fed[_0x5dc950(0x232)],'value':_0x1b4fed[_0x5dc950(0x226)],..._0x1b4fed[_0x5dc950(0x201)]?{'tags':_0x1b4fed[_0x5dc950(0x201)]}:{}}});return _0x440ec2[_0x5dc950(0x213)];}export async function updateAppConfig(_0x4b6930){const _0x7c9042=a197_0x3ede;await apiRequest('/smartapi/app-config/update',{'method':_0x7c9042(0x25e),'body':{'id':_0x4b6930['id'],'appCode':_0x4b6930[_0x7c9042(0x286)],'key':_0x4b6930[_0x7c9042(0x232)],'value':_0x4b6930['value'],..._0x4b6930[_0x7c9042(0x201)]?{'tags':_0x4b6930[_0x7c9042(0x201)]}:{}}});}export async function deleteAppConfig(_0x2bb5c2){await apiRequest('/smartapi/app-config/delete',{'method':'POST','body':_0x2bb5c2});}function extractAppConfigList(_0x118608){const _0x21a94f=a197_0x3ede;if(Array['isArray'](_0x118608))return _0x118608;if(_0x118608&&typeof _0x118608===_0x21a94f(0x225)&&Array[_0x21a94f(0x2b9)](_0x118608[_0x21a94f(0x260)]))return _0x118608[_0x21a94f(0x260)];return extractList(_0x118608);}export async function listDbLinks(_0x4042e1,_0x26b0c6){const _0x2b2ca0=a197_0x3ede,_0x127f22=await apiRequest(_0x2b2ca0(0x273),{'method':_0x2b2ca0(0x25e),'body':{'appCode':_0x4042e1,'currentPage':_0x26b0c6?.[_0x2b2ca0(0x24b)]??0x1,'pageSize':_0x26b0c6?.['pageSize']??0x64}});return{'items':extractList(_0x127f22[_0x2b2ca0(0x213)]),'paging':extractPaging(_0x127f22[_0x2b2ca0(0x213)])};}export async function getDbLinkInfo(_0xf4a5f7){const _0x456be0=a197_0x3ede,_0xb59a9e=await apiRequest(_0x456be0(0x282)+buildQuery({'id':_0xf4a5f7}));return _0xb59a9e[_0x456be0(0x213)];}export async function createDbLink(_0x44bd38){const _0x565e33=a197_0x3ede,_0x5d2543=await apiRequest('/smartapi/dblink/create',{'method':_0x565e33(0x25e),'body':_0x44bd38});return _0x5d2543[_0x565e33(0x213)];}export async function updateDbLink(_0x43ac0d){const _0x58f181=a197_0x3ede,_0x4f4a08=await apiRequest(_0x58f181(0x212),{'method':_0x58f181(0x25e),'body':_0x43ac0d});return _0x4f4a08[_0x58f181(0x213)];}export async function deleteDbLink(_0x55bdbb){const _0x379626=a197_0x3ede;await apiRequest(_0x379626(0x26e),{'method':'POST','body':{'id':_0x55bdbb}});}export async function testDbLinkConnect(_0x38e06c){const _0x392320=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x38e06c}));return _0x392320['data'];}export async function startDbAnalysis(_0x375e0c,_0x524fae){const _0x160951=a197_0x3ede,_0x47eea=await apiRequest('/smartapi/db-analysis/start',{'method':'POST','body':{'dbLinkId':_0x375e0c,..._0x524fae&&_0x524fae[_0x160951(0x221)]>0x0?{'tableNames':_0x524fae}:{}}});return _0x47eea[_0x160951(0x213)];}export async function cancelDbAnalysis(_0x23aa18){const _0x366010=a197_0x3ede;await apiRequest(_0x366010(0x259)+buildQuery({'planId':_0x23aa18}),{'method':_0x366010(0x25e)});}export async function getDbAnalysisStatus(_0x2c0202){const _0x4bd9f6=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x2c0202));return _0x4bd9f6['data'];}export async function getDbAllTableList(_0x482294,_0x2bf1c9){const _0x1767fb=a197_0x3ede,_0x1f9594=await apiRequest(_0x1767fb(0x289)+buildQuery({'appCode':_0x482294,'dbLinkId':_0x2bf1c9})),_0x4e830b=_0x1f9594['data'];if(Array[_0x1767fb(0x2b9)](_0x4e830b))return _0x4e830b;return extractList(_0x4e830b);}export async function getDbTableDiff(_0x245186,_0x84061,_0x46971a){const _0x5e1d11=a197_0x3ede,_0x55d711=await apiRequest(_0x5e1d11(0x278)+buildQuery({'appCode':_0x245186,'dbLinkId':_0x84061,'pageIndex':_0x46971a?.[_0x5e1d11(0x290)]??0x1,'pageSize':_0x46971a?.[_0x5e1d11(0x224)]??0x14,'tableName':_0x46971a?.[_0x5e1d11(0x252)]})),_0x7f065e=_0x55d711['data'];return{'totalCount':_0x7f065e?.[_0x5e1d11(0x271)]??0x0,'physicalTableCount':_0x7f065e?.['physicalTableCount']??0x0,'datasetTableCount':_0x7f065e?.[_0x5e1d11(0x22c)]??0x0,..._0x7f065e?.[_0x5e1d11(0x22e)]?{'summary':_0x7f065e[_0x5e1d11(0x22e)]}:{},'tableList':Array[_0x5e1d11(0x2b9)](_0x7f065e?.['tableList'])?_0x7f065e[_0x5e1d11(0x25a)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x32461a=a197_0x3ede,_0x248666=await apiRequest('/smartapi/app/getList',{'method':_0x32461a(0x25e),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x31c586=extractList(_0x248666['data']),_0x4e19eb=extractPaging(_0x248666[_0x32461a(0x213)]);return _0x4e19eb&&_0x4e19eb[_0x32461a(0x271)]>REMOTE_APP_PAGE_SIZE&&console[_0x32461a(0x275)](_0x32461a(0x219)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x4e19eb[_0x32461a(0x271)]+_0x32461a(0x2b6)+_0x32461a(0x25d)),_0x31c586;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x1674bd,_0x3223e7){const _0x4012bd=a197_0x3ede,_0x31c4fc=Math[_0x4012bd(0x2a6)](Math['max'](_0x3223e7?.['pageSize']??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x3beff3=await apiRequest(_0x4012bd(0x205),{'method':_0x4012bd(0x25e),'body':{'appCode':_0x1674bd,'currentPage':_0x3223e7?.[_0x4012bd(0x24b)]??0x1,'pageSize':_0x31c4fc}});return{'items':extractList(_0x3beff3[_0x4012bd(0x213)]),'paging':extractPaging(_0x3beff3['data'])};}export async function getAppRole(_0x3fc3a9){const _0x9826c2=a197_0x3ede,_0x18fdd2=await apiRequest(_0x9826c2(0x2a1)+buildQuery({'id':_0x3fc3a9}));return _0x18fdd2[_0x9826c2(0x213)];}export async function createAppRole(_0x521c6e){const _0xe06a8e=a197_0x3ede,_0x564197=await apiRequest('/smartapi/permit/role/create',{'method':_0xe06a8e(0x25e),'body':{'appCode':_0x521c6e[_0xe06a8e(0x286)],'roleName':_0x521c6e['roleName'],'roleType':'CUSTOM',..._0x521c6e[_0xe06a8e(0x1f8)]?{'remark':_0x521c6e[_0xe06a8e(0x1f8)]}:{}}});return _0x564197['data'];}export async function updateAppRole(_0x40a70e){const _0x437115=a197_0x3ede,_0x25dbf1=await apiRequest(_0x437115(0x1da),{'method':_0x437115(0x25e),'body':{'id':_0x40a70e['id'],'appCode':_0x40a70e[_0x437115(0x286)],..._0x40a70e[_0x437115(0x1fc)]?{'roleType':_0x40a70e[_0x437115(0x1fc)]}:{},..._0x40a70e[_0x437115(0x263)]!==undefined?{'roleName':_0x40a70e[_0x437115(0x263)]}:{},..._0x40a70e['remark']!==undefined?{'remark':_0x40a70e[_0x437115(0x1f8)]}:{},..._0x40a70e['permits']?{'permits':_0x40a70e[_0x437115(0x1e5)]}:{}}});return _0x25dbf1['data'];}export async function deleteAppRole(_0x15ea92){const _0x222815=a197_0x3ede;await apiRequest(_0x222815(0x231),{'method':_0x222815(0x25e),'body':{'id':_0x15ea92}});}export async function listPermitRoles(_0xbb1f09,_0x6d74b3){const _0x3b0320=a197_0x3ede,_0x56ddac=await apiRequest(_0x3b0320(0x204),{'method':'POST','body':{'appCode':_0xbb1f09,..._0x6d74b3?.[_0x3b0320(0x26f)]!==undefined?{'needSelf':_0x6d74b3[_0x3b0320(0x26f)]}:{},..._0x6d74b3?.['needPublic']!==undefined?{'needPublic':_0x6d74b3[_0x3b0320(0x22a)]}:{}}});return extractList(_0x56ddac[_0x3b0320(0x213)]);}export async function getRoleMenuResources(_0x2de035,_0x2044fd){const _0x246c99=a197_0x3ede,_0xa2da92=await apiRequest(_0x246c99(0x1db),{'method':'POST','body':{'appCode':_0x2de035,'roleId':_0x2044fd}});return extractList(_0xa2da92[_0x246c99(0x213)]);}export async function getRoleApiResources(_0x33dcea,_0x48fc7d){const _0x22e16d=a197_0x3ede,_0x4d0e27=await apiRequest('/smartapi/permit/resource/get-api-list',{'method':_0x22e16d(0x25e),'body':{'appCode':_0x33dcea,'roleId':_0x48fc7d}});return extractList(_0x4d0e27[_0x22e16d(0x213)]);}function a197_0x3ede(_0x23b676,_0x4edfc9){_0x23b676=_0x23b676-0x1da;const _0x8c4898=a197_0x8c48();let _0x3ede9c=_0x8c4898[_0x23b676];return _0x3ede9c;}export async function listRoleUsers(_0x2d29f1){const _0x351b18=a197_0x3ede,_0x591497=await apiRequest('/smartapi/permit/user-role/get-user-list',{'method':_0x351b18(0x25e),'body':{'appCode':_0x2d29f1}});return extractList(_0x591497[_0x351b18(0x213)]);}export async function updateRoleUsers(_0xd88b2e,_0xd0bd1d){const _0x4f2bd8=a197_0x3ede;await apiRequest('/smartapi/permit/user-role/update-user-list',{'method':_0x4f2bd8(0x25e),'body':{'appCode':_0xd88b2e,'roleList':_0xd0bd1d}});}export async function getPagePermit(_0x1a0507){const _0x384df6=a197_0x3ede,_0x335ee3=await apiRequest(_0x384df6(0x1dd)+buildQuery({'menuId':_0x1a0507}));return _0x335ee3[_0x384df6(0x213)];}export async function savePagePermit(_0x28c579){const _0x24f8a3=a197_0x3ede,_0x5b5182=await apiRequest(_0x24f8a3(0x2ac),{'method':_0x24f8a3(0x25e),'body':_0x28c579});return _0x5b5182[_0x24f8a3(0x213)];}export async function getTenantMembers(_0x3bfa76){const _0x4e2e7a=a197_0x3ede,_0x53af19=await apiRequest(_0x4e2e7a(0x23c)+buildQuery({'code':_0x3bfa76})),_0x582529=_0x53af19[_0x4e2e7a(0x213)]??{},_0x27ee75=Array[_0x4e2e7a(0x2b9)](_0x582529?.[_0x4e2e7a(0x243)])?_0x582529[_0x4e2e7a(0x243)]:[];return _0x27ee75['filter'](_0x1530c0=>_0x1530c0?.['status']===_0x4e2e7a(0x230)||_0x1530c0?.[_0x4e2e7a(0x2ab)]===undefined)[_0x4e2e7a(0x281)](_0x464698=>({'userId':Number(_0x464698[_0x4e2e7a(0x1e3)]??_0x464698['id']),'username':_0x464698['username'],'nickname':_0x464698['nickname'],'status':_0x464698[_0x4e2e7a(0x2ab)],'email':_0x464698[_0x4e2e7a(0x277)],'mobile':_0x464698[_0x4e2e7a(0x2bb)],'avatar':_0x464698[_0x4e2e7a(0x242)]}))[_0x4e2e7a(0x1e1)](_0x231b63=>Number[_0x4e2e7a(0x215)](_0x231b63[_0x4e2e7a(0x1e3)])&&_0x231b63[_0x4e2e7a(0x1e3)]>0x0);}
|
|
1
|
+
(function(_0x244e45,_0x153b77){const _0x5e4727=a198_0x42d3,_0x37864a=_0x244e45();while(!![]){try{const _0x5f17fa=-parseInt(_0x5e4727(0x1a1))/0x1+parseInt(_0x5e4727(0x1d0))/0x2*(parseInt(_0x5e4727(0x13b))/0x3)+parseInt(_0x5e4727(0x135))/0x4+-parseInt(_0x5e4727(0x179))/0x5*(-parseInt(_0x5e4727(0x188))/0x6)+-parseInt(_0x5e4727(0xfc))/0x7*(-parseInt(_0x5e4727(0x173))/0x8)+-parseInt(_0x5e4727(0x183))/0x9+-parseInt(_0x5e4727(0x169))/0xa;if(_0x5f17fa===_0x153b77)break;else _0x37864a['push'](_0x37864a['shift']());}catch(_0xda691b){_0x37864a['push'](_0x37864a['shift']());}}}(a198_0x3464,0xbb42d));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x26fd76){_activeCookie=_0x26fd76||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x4ebe30,_0x30f9fa){const _0x2e141d=a198_0x42d3,_0x49f355=_0x30f9fa instanceof Error?_0x30f9fa[_0x2e141d(0x137)]:String(_0x30f9fa);return CliErrors[_0x2e141d(0x1b8)]('Request\x20failed:\x20'+_0x4ebe30+(_0x49f355?'\x20('+_0x49f355+')':''),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}async function apiRequest(_0x520a80,_0x489785={}){const _0xdf65c9=a198_0x42d3,{method:method=_0xdf65c9(0x1a8),body:_0x32890e,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x489785,_0x21eb3b=useRuntime?getRuntimeDomain():getApiDomain(),_0x1b22fd=_activeCookie||getCookie(),_0x48dd58=''+_0x21eb3b+_0x520a80,_0x52e0da=new AbortController(),_0x80ceb8=setTimeout(()=>_0x52e0da[_0xdf65c9(0x10d)](),timeout);try{const _0x44d526=await fetch(_0x48dd58,{'method':method,'headers':{'Content-Type':_0xdf65c9(0x17c),'Cookie':_0x1b22fd,'X-Invoke-Source':_0xdf65c9(0x1d8),...headers},'body':_0x32890e?JSON[_0xdf65c9(0x187)](_0x32890e):undefined,'signal':_0x52e0da['signal']});let _0xc2c830;try{_0xc2c830=await _0x44d526[_0xdf65c9(0x100)]();}catch(_0x2a37ae){if(_0x2a37ae instanceof Error&&_0x2a37ae[_0xdf65c9(0x146)]===_0xdf65c9(0x161))throw CliErrors[_0xdf65c9(0x1b8)](_0xdf65c9(0x114)+_0x48dd58);if(_0x44d526['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0xdf65c9(0x1b8)](_0xdf65c9(0x123)+_0x44d526['status']+')',_0x44d526[_0xdf65c9(0x162)]>=0x190?_0xdf65c9(0x1cf):undefined);}if(!_0x44d526['ok']||_0xc2c830[_0xdf65c9(0x125)]===![])throw CliErrors[_0xdf65c9(0x1b8)](_0xc2c830[_0xdf65c9(0x11c)]||_0xc2c830['message']||_0xdf65c9(0x133)+_0x44d526[_0xdf65c9(0x162)],_0xc2c830[_0xdf65c9(0x1c2)]?_0xdf65c9(0x16b)+_0xc2c830[_0xdf65c9(0x1c2)]:undefined);return _0xc2c830;}catch(_0x338a75){if(_0x338a75 instanceof CliError)throw _0x338a75;if(_0x338a75 instanceof Error&&_0x338a75[_0xdf65c9(0x146)]===_0xdf65c9(0x161))throw CliErrors[_0xdf65c9(0x1b8)]('Request\x20timeout:\x20'+_0x48dd58);throw createFetchFailureError(_0x48dd58,_0x338a75);}finally{clearTimeout(_0x80ceb8);}}async function apiFormRequest(_0x14aa17,_0x354aa8,_0x4a3d52={}){const _0x51f700=a198_0x42d3,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x4a3d52,_0x29b903=_activeCookie||getCookie(),_0x2575d7=''+getApiDomain()+_0x14aa17,_0x4c3403=new AbortController(),_0x1eaf87=setTimeout(()=>_0x4c3403[_0x51f700(0x10d)](),timeout);try{const _0x107ebb=await fetch(_0x2575d7,{'method':_0x51f700(0x165),'headers':{'Cookie':_0x29b903,'X-Invoke-Source':'cli:rabetbase'},'body':_0x354aa8,'signal':_0x4c3403[_0x51f700(0x19a)]});let _0x12e1d6;try{_0x12e1d6=await _0x107ebb[_0x51f700(0x100)]();}catch(_0x4434f7){if(_0x4434f7 instanceof Error&&_0x4434f7[_0x51f700(0x146)]==='AbortError')throw CliErrors[_0x51f700(0x1b8)](_0x51f700(0x114)+_0x2575d7);throw CliErrors[_0x51f700(0x1b8)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x107ebb['status']+')',_0x107ebb[_0x51f700(0x162)]>=0x190?_0x51f700(0x1cf):undefined);}if(!_0x107ebb['ok']||_0x12e1d6[_0x51f700(0x125)]===![])throw CliErrors['apiError'](_0x12e1d6[_0x51f700(0x11c)]||_0x12e1d6[_0x51f700(0x137)]||_0x51f700(0x133)+_0x107ebb[_0x51f700(0x162)],_0x12e1d6[_0x51f700(0x1c2)]?_0x51f700(0x16b)+_0x12e1d6[_0x51f700(0x1c2)]:undefined);return _0x12e1d6;}catch(_0x1fa22f){if(_0x1fa22f instanceof CliError)throw _0x1fa22f;if(_0x1fa22f instanceof Error&&_0x1fa22f[_0x51f700(0x146)]===_0x51f700(0x161))throw CliErrors[_0x51f700(0x1b8)](_0x51f700(0x114)+_0x2575d7);throw createFetchFailureError(_0x2575d7,_0x1fa22f);}finally{clearTimeout(_0x1eaf87);}}export async function uploadDevelopmentFile(_0x406c93,_0x5c6b38){const _0xaa8f93=a198_0x42d3,_0x5caea1=await readFile(_0x5c6b38),_0x386c13=new FormData();_0x386c13[_0xaa8f93(0x17f)]('appCode',_0x406c93),_0x386c13['append'](_0xaa8f93(0x10c),new Blob([new Uint8Array(_0x5caea1)]),basename(_0x5c6b38));const _0x2191f8=await apiFormRequest('/smartapi/common/uploadFile',_0x386c13);return _0x2191f8[_0xaa8f93(0xf9)];}export async function queryDevelopmentFileUrl(_0x5463e3,_0x281e2e={}){const _0x9643aa=a198_0x42d3,_0x3bfd05=await apiRequest(_0x9643aa(0x12e),{'method':'POST','body':{'filePath':_0x5463e3,'downloadFlag':_0x281e2e[_0x9643aa(0x110)]??![],..._0x281e2e[_0x9643aa(0x122)]?{'longTerm':!![]}:{}}});return _0x3bfd05[_0x9643aa(0xf9)];}function isAuthFailure(_0x496a78){const _0x560d03=a198_0x42d3,_0x1b281f=_0x496a78['errorMsg']||_0x496a78[_0x560d03(0x137)]||_0x496a78['data']?.[_0x560d03(0x137)]||_0x496a78[_0x560d03(0x1a2)]||_0x496a78['error']||'';return _0x496a78[_0x560d03(0x1c2)]===_0x560d03(0x1d7)||_0x496a78[_0x560d03(0x118)]===0x191||_0x496a78[_0x560d03(0x118)]===_0x560d03(0x120)||_0x1b281f[_0x560d03(0x16d)](_0x560d03(0x120))||_0x1b281f[_0x560d03(0x16d)](_0x560d03(0xfe))||_0x1b281f['includes']('登录')||_0x1b281f[_0x560d03(0x16d)]('认证');}export async function platformFetch(_0x3b8e67,_0x3fcb49){const _0x57e16c=a198_0x42d3;let _0x56d641;try{_0x56d641=await fetch(_0x3b8e67,{'method':_0x3fcb49[_0x57e16c(0x1c4)]??_0x57e16c(0x1a8),'headers':{'Content-Type':_0x57e16c(0x17c),'Cookie':_0x3fcb49[_0x57e16c(0x18c)],'X-Invoke-Source':'cli:rabetbase'},..._0x3fcb49[_0x57e16c(0x18a)]&&{'body':JSON[_0x57e16c(0x187)](_0x3fcb49[_0x57e16c(0x18a)])}});}catch(_0x507297){throw createFetchFailureError(_0x3b8e67,_0x507297);}if(!_0x56d641['ok']){if(_0x56d641['status']===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x57e16c(0x1b8)](_0x3fcb49[_0x57e16c(0x11e)]+_0x57e16c(0x105)+_0x56d641['status']);}const _0x56ae95=await _0x56d641[_0x57e16c(0x100)]();if(_0x56ae95['success']===![]){if(isAuthFailure(_0x56ae95))throw CliErrors[_0x57e16c(0x144)]();throw CliErrors[_0x57e16c(0x1b8)](_0x56ae95[_0x57e16c(0x11c)]||_0x56ae95[_0x57e16c(0x137)]||_0x3fcb49[_0x57e16c(0x11e)]+_0x57e16c(0x18b));}return _0x56ae95[_0x57e16c(0xf9)];}export async function platformRequest(_0x1bd513,_0x210996){const _0x29f5d3=a198_0x42d3;if(/^https?:\/\//i['test'](_0x1bd513))throw CliErrors[_0x29f5d3(0x107)]('platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20'+_0x1bd513,_0x29f5d3(0x1d1));const _0x4cf639=_0x1bd513['startsWith']('/')?_0x1bd513:'/'+_0x1bd513;return platformFetch(''+getApiDomain()+_0x4cf639,_0x210996);}function cleanNewlines(_0x24ca18){const _0x440bbd=a198_0x42d3;return _0x24ca18[_0x440bbd(0x15c)](/[\r\n]+/g,'\x20')['trim']();}function cleanDatasetName(_0x1db50a){const _0x52db55=a198_0x42d3;if(!_0x1db50a[_0x52db55(0x146)])return _0x1db50a;return{..._0x1db50a,'name':cleanNewlines(_0x1db50a[_0x52db55(0x146)])};}export async function fetchModelList(_0x9ceadd,_0x5c4a55){const _0x438cbc=a198_0x42d3,_0x3fbd88=getEnv(),_0x258eb8=new URLSearchParams({'appcode':_0x9ceadd,'otype':_0x438cbc(0x138)}),_0x1c326e='/api/node-toolbox/dataset/model-list?'+_0x258eb8[_0x438cbc(0x14d)]();logger[_0x438cbc(0x174)]('fetch-model-list',_0x438cbc(0x1c1)+_0x3fbd88+')',{'apiPath':_0x1c326e});const _0x3e7bf2=await platformRequest(_0x1c326e,{'cookie':_0x5c4a55,'label':_0x438cbc(0x12c)}),_0x4c0adf=(_0x3e7bf2['configArray']??[])['map'](cleanDatasetName);return{'configArray':_0x4c0adf,'count':_0x4c0adf[_0x438cbc(0x1c7)]};}export async function fetchDatasetDoc(_0x1efd1c){const _0x5102c8=a198_0x42d3,{appCode:_0xe55ed5,cookie:_0x3ea436,datasetCode:_0x486f5f,datasetId:_0x106f3b,extraParams:_0x62b2fe}=_0x1efd1c,_0x4515e4=await platformRequest(_0x5102c8(0x1ba),{'method':'POST','body':{'appCode':_0xe55ed5,'datasetCode':_0x486f5f,'datasetId':_0x106f3b,..._0x62b2fe||{}},'cookie':_0x3ea436,'label':_0x5102c8(0x119)+_0x486f5f+')'});if(!_0x4515e4||typeof _0x4515e4['markdown']!==_0x5102c8(0x140))throw new Error(_0x5102c8(0x1c6)+_0x486f5f+_0x5102c8(0xf6));return _0x4515e4[_0x5102c8(0x184)];}export async function getMenuTree(_0x5e6ef5,_0x459729){const _0x25dc9a=a198_0x42d3,_0xa9c7e6=new URLSearchParams({'appCode':_0x5e6ef5});return platformRequest('/smartapi/menu/find?'+_0xa9c7e6['toString'](),{'cookie':_0x459729,'label':_0x25dc9a(0x1ca)});}export async function createMenuRecord(_0x2c8b2e,_0x536e4d,_0x1ed6a0){const _0x2d76d2=a198_0x42d3;return platformRequest(_0x2d76d2(0x1a4),{'method':_0x2d76d2(0x165),'body':_0x2c8b2e,'cookie':_0x536e4d,'label':_0x1ed6a0});}export async function updateMenuRecord(_0x5bf32f,_0x4ed34c,_0x24da46){const _0x230058=a198_0x42d3;return platformRequest(_0x230058(0x1bb),{'method':_0x230058(0x165),'body':_0x5bf32f,'cookie':_0x4ed34c,'label':_0x24da46});}function a198_0x42d3(_0x1be1a6,_0x33dd9e){_0x1be1a6=_0x1be1a6-0xf4;const _0x3464e3=a198_0x3464();let _0x42d3aa=_0x3464e3[_0x1be1a6];return _0x42d3aa;}export async function deleteMenuRecord(_0xb655fc,_0x3ffc4f,_0x137157){const _0x3956ae=a198_0x42d3;return platformRequest('/smartapi/menu/delete',{'method':_0x3956ae(0x165),'body':{'id':_0xb655fc},'cookie':_0x3ffc4f,'label':_0x137157});}export async function batchDeleteMenuRecords(_0x509eaf,_0x11e43d,_0x105f6d){const _0x3ce1e0=a198_0x42d3;return platformRequest(_0x3ce1e0(0x14e),{'method':_0x3ce1e0(0x165),'body':{'idList':_0x509eaf},'cookie':_0x11e43d,'label':_0x105f6d});}export async function startMenuRegroup(_0x4768fe,_0x5aaf6d,_0xba98d5){return platformRequest('/smartapi/menu/regroup',{'method':'POST','body':_0x4768fe,'cookie':_0x5aaf6d,'label':_0xba98d5});}export async function getAsyncTaskStatus(_0x4635b9,_0x1aa994,_0x42c442){const _0x4bc909=a198_0x42d3,_0x3b2d8e=new URLSearchParams({'appCode':_0x1aa994});return platformRequest(_0x4bc909(0x152)+encodeURIComponent(_0x4635b9)+'?'+_0x3b2d8e['toString'](),{'cookie':_0x42c442,'label':'Fetch\x20async\x20task\x20'+_0x4635b9});}export async function listBffScripts(_0x3853ec,_0xc78ac,_0x2eee5b){const _0x33a1a5=a198_0x42d3;let _0x21dd1d=_0x33a1a5(0x197)+_0x3853ec;if(_0xc78ac)_0x21dd1d+=_0x33a1a5(0xfd)+_0xc78ac;const _0x272b0d=await apiRequest(_0x21dd1d);let _0x10cd2b=extractList(_0x272b0d['data']);if(_0x2eee5b?.['scriptName']){const _0x125090=_0x2eee5b[_0x33a1a5(0x167)][_0x33a1a5(0x1aa)]();_0x10cd2b=_0x10cd2b[_0x33a1a5(0x10a)](_0x14b25c=>_0x14b25c[_0x33a1a5(0x10e)]?.[_0x33a1a5(0x1aa)]()['includes'](_0x125090)||_0x14b25c['description']?.['toLowerCase']()[_0x33a1a5(0x16d)](_0x125090));}return _0x10cd2b;}export async function getBffScriptInfo(_0x395519){const _0x2421ad=a198_0x42d3,_0x2a9318=await apiRequest(_0x2421ad(0x1c8)+_0x395519);if(!_0x2a9318[_0x2421ad(0xf9)])throw CliErrors[_0x2421ad(0x107)]('BFF\x20script\x20not\x20found:\x20id='+_0x395519);return _0x2a9318[_0x2421ad(0xf9)];}export async function saveBffScript(_0x41f2a1){const _0x4d2e40=a198_0x42d3,_0x1668e5=await apiRequest(_0x4d2e40(0x18f),{'method':_0x4d2e40(0x165),'body':_0x41f2a1}),{id:_0x3e293f,entity:_0x5c71d3}=normalizeEntityWithIdResponse(_0x1668e5['data']);if(_0x3e293f!==undefined){const _0x54953a=typeof _0x5c71d3[_0x4d2e40(0x10e)]===_0x4d2e40(0x140)||typeof _0x5c71d3[_0x4d2e40(0x12a)]===_0x4d2e40(0x140)?_0x5c71d3:undefined;return{'id':_0x3e293f,'script':_0x54953a};}throw CliErrors[_0x4d2e40(0x1b8)]('BFF\x20save\x20returned\x20no\x20valid\x20id');}function a198_0x3464(){const _0x24abc1=['/smartapi/dataset/text-generate/start','type','/smartapi/dataset/get-dataset-list','datasetTableCount','AbortError','status','avatar','/smartapi/question/er-config/cli/update-single','POST','.filter({','scriptName','const\x20result\x20=\x20await\x20client.models.','16632020sAsqEK','object','API\x20error\x20code:\x20','?sqlCode=','includes','/smartapi/permit/role/get-permit-list','version','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','ENABLE','/smartapi/custom/updateUserCustomSql','112Nvahml','info','join','permits','/smartapi/db-analysis/start','getOne','572765UdyDhK','/smartapi/dataset/text-generate/preview','/notification/channel-config/list','application/json','/smartapi/permit/role/delete','/smartapi/permit/resource/get-menu-list','append','sqlCode','dbId','remark','5318433rtwofR','markdown','pageSize','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','stringify','12vCnlmN','modelCode','body','\x20failed','cookie','\x20\x20currentPage:\x201,','tableName','/api/management/library/scripts/save','description','});','/smartapi/permit/user-role/get-user-list','/smartapi/dataset/delete-dataset','/smartapi/db-analysis/status/','/smartapi/lovrabet/update-page','CUSTOM','/api/management/library/scripts/list?appCode=','requestFields','(/*\x20params\x20*/);','signal','enabled','\x20\x20sqlCode:\x20\x27','/smartapi/dblink/getOne','needSelf','tableList','userTenantRelationList','654396fIwpEy','errorMessage','pageIndex','/smartapi/menu/create','summary','\x20\x20where:\x20{},','responseFields','GET','modelId','toLowerCase','remove','/smartapi/app/getList','list','username','/smartapi/app-config/getByKey','set','has','/smartapi/dataset/update-driven-data','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','userId','isFinite','Page\x20not\x20found:\x20','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','apiError','dbtableConfig','/api/node-toolbox/api-doc-generator','/smartapi/menu/update','/smartapi/question/er-config/business-group/edit','/filter','.create({\x20/*\x20fields\x20*/\x20});','delete','totalCount','正在从服务器拉取模型列表...\x20(环境:\x20','errorCode','/smartapi/app-config/create','method','SQL\x20query\x20not\x20found:\x20id=','Invalid\x20response\x20format\x20(','length','/api/management/library/scripts/info?id=','/smartapi/custom/saveUserCustomSql','Fetch\x20menu\x20list','/smartapi/permit/role/get-list','relation','/smartapi/custom/queryUserCustomSqlList','SQL\x20query\x20not\x20found:\x20','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','577502KxHLlq','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','/smartapi/question/er-config/cli/detail?','mobile','/standard-page-status?appCode=','path','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','UNAUTHORIZED','cli:rabetbase','\x20\x20});','clientOperationId','):\x20missing\x20data.markdown\x20field','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','/smartapi/app-config/list','data','datasetName','/smartapi/custom/getUserCustomSql?id=','328622SUsXSc','&type=','Unauthorized','/api/custom/executeSql','json','email','/api/management/library/scripts/delete','/sync-to-pages','.getOne(id);','\x20failed,\x20HTTP\x20','displayName','validation','/smartapi/permit/page/get-one','/generate-standard-pages/start','filter','api_error','file','abort','functionName','find','download','\x20of\x20','/smartapi/custom/getUserCustomSql','tableData','Request\x20timeout:\x20','add','needPublic','roleType','code','Fetch\x20doc\x20(','DATA_NOT_EXIST','\x20\x20pageSize:\x2020,','errorMsg','\x22\x20not\x20found\x20in\x20dataset\x20','label','/smartapi/db-analysis/jobs/cancel','401','//\x20SQL:\x20','longTerm','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','ER\x20relation\x20does\x20not\x20exist','success','sqlName','operations','/smartapi/question/er-config/cli/erCreate','max','scriptType','Dataset\x20not\x20found:\x20','Fetch\x20datasets','map','/smartapi/common/queryFileUrl','/smartapi/lovrabet/dataset/','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','tags','/smartapi/question/er-config/cli/delete-single','API\x20error:\x20','/smartapi/custom/deleteUserCustomSql','5381804eWnmVp','operationId','message','array','roleName','isArray','15zVKEwL','/smartapi/permit/role/create','hint','min','deleted','string','sdk','test','appCode','authRequired','requirementDescription','name','value','\x20\x20return\x20rows;','table','key','/generate-standard-pages/status?','dataset_','toString','/smartapi/menu/batchDelete','/api/','/smartapi/permit/role/update','entries','/smartapi/tasks/','Warning:\x20showing\x20first\x20','/smartapi/dblink/delete','/smartapi/dblink/getAllTableList','/smartapi/dblink/getTableDiffV2ByPage','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','//\x20','operationName','push','/api/management/script/cache/clear','replace'];a198_0x3464=function(){return _0x24abc1;};return a198_0x3464();}export async function deleteBffScript(_0x29562c){const _0x378df3=a198_0x42d3;await apiRequest(_0x378df3(0x102),{'method':_0x378df3(0x165),'body':{'id':_0x29562c}});}export async function getBffScriptStatistics(_0xf71835){const _0x56670d=a198_0x42d3,_0x5a6540=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0xf71835);return extractList(_0x5a6540[_0x56670d(0xf9)]);}export async function clearBffScriptCache(){const _0x247673=a198_0x42d3,_0x3e4845=await apiRequest(_0x247673(0x15b),{'method':_0x247673(0x165),'useRuntime':!![]});return typeof _0x3e4845['data']==='string'?_0x3e4845[_0x247673(0xf9)]:'';}export async function listBffDatasetOperations(_0x4a587d,_0x1ce8be){const _0xdb33a3=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':'POST','body':{'appCode':_0x4a587d,'datasetId':_0x1ce8be}});return _0xdb33a3['data'];}export async function listSqlQueries(_0x2ed29e,_0x5a9e04){const _0x1647d9=a198_0x42d3,_0x204a73=await apiRequest(_0x1647d9(0x1cd),{'method':_0x1647d9(0x165),'body':{'appCode':_0x2ed29e,'currentPage':_0x5a9e04?.['currentPage']??0x1,'pageSize':_0x5a9e04?.[_0x1647d9(0x185)]??0x32,'sqlCode':_0x5a9e04?.[_0x1647d9(0x180)],'sqlName':_0x5a9e04?.[_0x1647d9(0x126)]}});return _0x204a73[_0x1647d9(0xf9)];}export async function getSqlQueryInfo(_0x3bf6f9,_0x811297){const _0x348e6e=a198_0x42d3,_0xbedfcc=await listSqlQueries(_0x3bf6f9,{'sqlCode':_0x811297}),_0x1f17f0=_0xbedfcc[_0x348e6e(0x113)]?.[0x0];if(!_0x1f17f0)throw CliErrors[_0x348e6e(0x107)](_0x348e6e(0x1ce)+_0x811297);return _0x1f17f0;}export async function getSqlQueryDetail(_0x4b2c3c){const _0xd31da8=a198_0x42d3,_0x5d3907=await apiRequest(_0xd31da8(0x112)+(_0xd31da8(0x16c)+encodeURIComponent(_0x4b2c3c)));if(!_0x5d3907[_0xd31da8(0xf9)])throw CliErrors[_0xd31da8(0x107)]('SQL\x20query\x20not\x20found:\x20'+_0x4b2c3c);return _0x5d3907[_0xd31da8(0xf9)];}export async function getSqlQueryDetailById(_0x36b073){const _0x4055fc=a198_0x42d3,_0xcd84e5=await apiRequest(_0x4055fc(0xfb)+_0x36b073);if(!_0xcd84e5[_0x4055fc(0xf9)])throw CliErrors[_0x4055fc(0x107)](_0x4055fc(0x1c5)+_0x36b073);return _0xcd84e5[_0x4055fc(0xf9)];}export async function createSqlQuery(_0x241a24){const _0x980fa9=a198_0x42d3,_0x41aff6=await apiRequest(_0x980fa9(0x1c9),{'method':'POST','body':_0x241a24}),{id:_0x2e5085,entity:_0x1afd45}=normalizeEntityWithIdResponse(_0x41aff6[_0x980fa9(0xf9)]);if(!(_0x980fa9(0x180)in _0x1afd45)&&_0x2e5085)return getSqlQueryDetailById(_0x2e5085);return normalizeSqlQueryEntity(_0x1afd45);}export async function updateSqlQuery(_0x2c829e){const _0x31f138=a198_0x42d3,_0x47467a=await apiRequest(_0x31f138(0x172),{'method':_0x31f138(0x165),'body':_0x2c829e}),{id:_0x48b9cc,entity:_0x3394a1}=normalizeEntityWithIdResponse(_0x47467a[_0x31f138(0xf9)]);if(!(_0x31f138(0x180)in _0x3394a1)){if(_0x2c829e[_0x31f138(0x180)])return getSqlQueryDetail(_0x2c829e[_0x31f138(0x180)]);if(_0x48b9cc)return getSqlQueryDetailById(_0x48b9cc);}return normalizeSqlQueryEntity(_0x3394a1);}export async function deleteSqlQuery(_0x83749a){const _0x3b52b0=a198_0x42d3;await apiRequest(_0x3b52b0(0x134),{'method':_0x3b52b0(0x165),'body':_0x83749a});}export async function saveSqlQuery(_0x3a1f7e){const _0x46c445=a198_0x42d3,_0xc0047a=await apiRequest('/api/node-toolbox/sql/save',{'method':_0x46c445(0x165),'body':_0x3a1f7e});return _0xc0047a[_0x46c445(0xf9)];}function normalizeSqlQueryEntity(_0x2b488d){const _0x5bbcd7=a198_0x42d3;return{..._0x2b488d,'id':Number(_0x2b488d['id']),'dbId':_0x2b488d[_0x5bbcd7(0x181)]==null?undefined:Number(_0x2b488d[_0x5bbcd7(0x181)]),'version':_0x2b488d[_0x5bbcd7(0x16f)]==null?undefined:Number(_0x2b488d[_0x5bbcd7(0x16f)])};}export async function executeSql(_0x112045,_0x5144ca,_0x21c386){const _0x41a483=a198_0x42d3,_0x4b3fce=await apiRequest(_0x41a483(0xff),{'method':_0x41a483(0x165),'body':{'appCode':_0x112045,'sqlCode':_0x5144ca,..._0x21c386&&{'params':_0x21c386}},'useRuntime':!![]});return _0x4b3fce[_0x41a483(0xf9)];}export async function executeDatasetDataOperation(_0x1441e6,_0x3b4210,_0x339a7b,_0x3af4bb={}){const _0x3045b3=a198_0x42d3;try{const _0x4004b0=await apiRequest(_0x3045b3(0x14f)+_0x1441e6+'/'+_0x3b4210+'/'+_0x339a7b,{'method':_0x3045b3(0x165),'body':_0x3af4bb,'useRuntime':!![]});return _0x4004b0[_0x3045b3(0xf9)];}catch(_0x158e25){if(_0x339a7b===_0x3045b3(0x178)&&_0x158e25 instanceof CliError&&_0x158e25[_0x3045b3(0x118)]===_0x3045b3(0x10b)&&_0x3af4bb['id']!==undefined&&_0x3af4bb['id']!==null&&_0x3af4bb['id']!==''){const _0x3e2668=await apiRequest(_0x3045b3(0x14f)+_0x1441e6+'/'+_0x3b4210+_0x3045b3(0x1bd),{'method':_0x3045b3(0x165),'body':{'where':{'id':{'$eq':_0x3af4bb['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x131467=Array[_0x3045b3(0x13a)](_0x3e2668[_0x3045b3(0xf9)]?.[_0x3045b3(0x113)])?_0x3e2668[_0x3045b3(0xf9)][_0x3045b3(0x113)]:[];return _0x131467[0x0]??null;}throw _0x158e25;}}export async function listDatasets(_0x20454e,_0x330597){const _0x4de41d=a198_0x42d3,_0x18cfee={'appCode':_0x20454e,'deleted':_0x330597?.[_0x4de41d(0x13f)]??![]};if(_0x330597?.[_0x4de41d(0x118)])_0x18cfee[_0x4de41d(0x118)]=_0x330597[_0x4de41d(0x118)];if(_0x330597?.[_0x4de41d(0x146)])_0x18cfee[_0x4de41d(0x146)]=_0x330597[_0x4de41d(0x146)];const _0x2d52fd=await apiRequest(_0x4de41d(0x15f),{'method':_0x4de41d(0x165),'body':_0x18cfee});return extractList(_0x2d52fd['data']);}export async function deleteDataset(_0x2b24ef,_0x1a1699){const _0xf5b0cd=a198_0x42d3;await apiRequest(_0xf5b0cd(0x193),{'method':_0xf5b0cd(0x165),'body':{'appCode':_0x2b24ef,'datasetId':_0x1a1699}});}export async function restoreDataset(_0x3c9392,_0x14f6df){const _0x27472d=a198_0x42d3;await apiRequest('/smartapi/dataset/restore-dataset',{'method':_0x27472d(0x165),'body':{'appCode':_0x3c9392,'datasetId':_0x14f6df}});}export async function previewTextGeneratedDataset(_0x423f26,_0x2779d5){const _0x333c77=a198_0x42d3,_0x260aa2=await apiRequest(_0x333c77(0x17a),{'method':_0x333c77(0x165),'body':{'appCode':_0x423f26,'datasetName':_0x2779d5[_0x333c77(0xfa)],'requirementDescription':_0x2779d5[_0x333c77(0x145)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x260aa2[_0x333c77(0xf9)];}export async function startTextGeneratedDataset(_0x115130,_0x54f942,_0x329d4a){const _0x3c9b31=a198_0x42d3,_0x470f78=await apiRequest(_0x3c9b31(0x15d),{'method':'POST','body':{'appCode':_0x115130,..._0x329d4a?.[_0x3c9b31(0xf5)]?{'clientOperationId':_0x329d4a[_0x3c9b31(0xf5)]}:{},'design':_0x54f942},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x470f78[_0x3c9b31(0xf9)];}export async function getTextGeneratedDatasetStatus(_0x1921db,_0x179162){const _0x36ff22=a198_0x42d3,_0x494ec6=new URLSearchParams({'appCode':_0x1921db});_0x179162['operationId']&&_0x494ec6['set'](_0x36ff22(0x136),_0x179162[_0x36ff22(0x136)]);_0x179162[_0x36ff22(0xf5)]&&_0x494ec6[_0x36ff22(0x1b0)](_0x36ff22(0xf5),_0x179162[_0x36ff22(0xf5)]);const _0x1be9b3=await apiRequest('/smartapi/dataset/text-generate/status?'+_0x494ec6['toString']());return _0x1be9b3[_0x36ff22(0xf9)];}export async function searchDatasets(_0x3efa17,_0x83a674){const _0x2d589b=a198_0x42d3,_0x580098=await listDatasets(_0x3efa17,{'name':_0x83a674}),_0x10efb8=_0x83a674[_0x2d589b(0x1aa)](),_0x3812b4=new Set(_0x580098[_0x2d589b(0x12d)](_0x4f0184=>_0x4f0184['id'])),_0x5a225b=_0x580098['filter'](_0x1277a6=>_0x1277a6[_0x2d589b(0x1b9)]?.[_0x2d589b(0x18e)]?.['toLowerCase']()[_0x2d589b(0x16d)](_0x10efb8)||_0x1277a6[_0x2d589b(0x190)]?.[_0x2d589b(0x1aa)]()[_0x2d589b(0x16d)](_0x10efb8)),_0x1d14e6=await listDatasets(_0x3efa17,{'code':_0x83a674});for(const _0x323116 of _0x1d14e6){!_0x3812b4[_0x2d589b(0x1b1)](_0x323116['id'])&&(_0x580098[_0x2d589b(0x15a)](_0x323116),_0x3812b4[_0x2d589b(0x115)](_0x323116['id']));}return _0x580098;}export function normalizeDatasetOperations(_0x129ed6){const _0x20d613=a198_0x42d3;if(Array['isArray'](_0x129ed6))return _0x129ed6[_0x20d613(0x10a)](_0x3655ac=>_0x3655ac!=null&&typeof _0x3655ac===_0x20d613(0x16a));if(_0x129ed6&&typeof _0x129ed6===_0x20d613(0x16a))return Object['entries'](_0x129ed6)[_0x20d613(0x10a)](([,_0x51ee5a])=>_0x51ee5a!=null&&typeof _0x51ee5a===_0x20d613(0x16a))[_0x20d613(0x12d)](([_0x60c9ee,_0x5f395b])=>({..._0x5f395b,'name':_0x5f395b[_0x20d613(0x146)]??_0x5f395b[_0x20d613(0x159)]??_0x60c9ee}));return[];}export async function getDatasetDetail(_0x51c753){const _0x535592=a198_0x42d3,_0x3ee21e=/^\d+$/[_0x535592(0x142)](_0x51c753)?'id':_0x535592(0x118),_0x2c28c5=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x3ee21e+'='+_0x51c753);return _0x2c28c5['data'];}export async function updateDrivenData(_0x379f16){const _0x577d34=a198_0x42d3,_0xc3acd7=await apiRequest(_0x577d34(0x1b2),{'method':_0x577d34(0x165),'body':_0x379f16});return _0xc3acd7[_0x577d34(0xf9)];}export async function getDatasetOperations(_0x74b32c){const _0x4efd4e=a198_0x42d3,_0x42bc87=await getDatasetDetail(_0x74b32c),_0xc7fca7=normalizeDatasetOperations(_0x42bc87[_0x4efd4e(0x127)])[_0x4efd4e(0x12d)](_0x2e6ef3=>({'name':_0x2e6ef3[_0x4efd4e(0x146)]||_0x2e6ef3[_0x4efd4e(0x159)],'displayName':_0x2e6ef3[_0x4efd4e(0x106)]||_0x2e6ef3['name'],'type':_0x2e6ef3[_0x4efd4e(0x15e)],'method':_0x2e6ef3[_0x4efd4e(0x1c4)],'path':_0x2e6ef3[_0x4efd4e(0x1d5)],'enabled':_0x2e6ef3[_0x4efd4e(0x19b)]??!![],'requestFields':_0x2e6ef3[_0x4efd4e(0x198)],'responseFields':_0x2e6ef3[_0x4efd4e(0x1a7)]}));return{'dataset':{'id':_0x42bc87['id']??_0x42bc87[_0x4efd4e(0x1a9)],'name':_0x42bc87[_0x4efd4e(0x146)],'code':_0x42bc87[_0x4efd4e(0x118)]||_0x42bc87[_0x4efd4e(0x189)],'tableName':_0x42bc87[_0x4efd4e(0x18e)]||_0x42bc87['dbtableConfig']?.[_0x4efd4e(0x18e)]},'operations':_0xc7fca7};}export async function getOperationDetail(_0x17aabc,_0x360f67,_0x26b1e5){const _0x43f727=a198_0x42d3;let _0x56378e=_0x360f67;if(!/^\d+$/[_0x43f727(0x142)](_0x360f67)){const _0x20fd3a=await listDatasets(_0x17aabc,{'code':_0x360f67}),_0x58c932=_0x20fd3a[_0x43f727(0x10f)](_0x40e7a8=>_0x40e7a8[_0x43f727(0x118)]===_0x360f67||String(_0x40e7a8['id'])===_0x360f67);if(!_0x58c932)throw CliErrors[_0x43f727(0x107)](_0x43f727(0x12b)+_0x360f67);_0x56378e=String(_0x58c932['id']);}const _0x5263ee=await getDatasetDetail(_0x56378e),_0x4b13fa=normalizeDatasetOperations(_0x5263ee[_0x43f727(0x127)])[_0x43f727(0x10f)](_0x28c0ee=>(_0x28c0ee[_0x43f727(0x146)]||_0x28c0ee[_0x43f727(0x159)])===_0x26b1e5);if(!_0x4b13fa)throw CliErrors[_0x43f727(0x107)]('Operation\x20\x22'+_0x26b1e5+_0x43f727(0x11d)+_0x360f67);return{'dataset':{'id':_0x5263ee['id']??_0x5263ee[_0x43f727(0x1a9)],'name':_0x5263ee[_0x43f727(0x146)],'code':_0x5263ee[_0x43f727(0x118)]||_0x5263ee['modelCode'],'tableName':_0x5263ee[_0x43f727(0x18e)]||_0x5263ee[_0x43f727(0x1b9)]?.[_0x43f727(0x18e)]},'operation':_0x4b13fa};}export async function startGenerateStandardPages(_0x207812,_0x4fb898,_0x442862){const _0x295c9e=a198_0x42d3,_0x2b1566=await apiRequest(_0x295c9e(0x12f)+_0x4fb898+_0x295c9e(0x109),{'method':_0x295c9e(0x165),'body':{'appCode':_0x207812,..._0x442862?.[_0x295c9e(0xf5)]?{'clientOperationId':_0x442862[_0x295c9e(0xf5)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x2b1566['data'];}export async function getGenerateStandardPagesStatus(_0x311dd3,_0x37deca,_0x5d84f3){const _0x143eec=a198_0x42d3,_0x310ae3=new URLSearchParams({'appCode':_0x311dd3});_0x5d84f3[_0x143eec(0x136)]&&_0x310ae3[_0x143eec(0x1b0)](_0x143eec(0x136),_0x5d84f3['operationId']);_0x5d84f3[_0x143eec(0xf5)]&&_0x310ae3[_0x143eec(0x1b0)](_0x143eec(0xf5),_0x5d84f3[_0x143eec(0xf5)]);const _0x362078=await apiRequest(_0x143eec(0x12f)+_0x37deca+_0x143eec(0x14b)+_0x310ae3['toString']());return _0x362078['data'];}export async function getStandardPageStatus(_0x2d73e9,_0x3d268b){const _0x3027a1=a198_0x42d3,_0x38013c=await apiRequest(_0x3027a1(0x12f)+_0x3d268b+_0x3027a1(0x1d4)+encodeURIComponent(_0x2d73e9));return _0x38013c[_0x3027a1(0xf9)];}export async function tryGetStandardPageStatus(_0x184170,_0xff4e81){const _0x51011e=a198_0x42d3;try{return await getStandardPageStatus(_0x184170,_0xff4e81);}catch(_0x3ca30e){if(_0x3ca30e instanceof CliError&&_0x3ca30e[_0x51011e(0x118)]===_0x51011e(0x10b)&&/404|not found|non-json response/i[_0x51011e(0x142)](_0x3ca30e[_0x51011e(0x137)]))return null;throw _0x3ca30e;}}export async function syncStandardPages(_0x967d6d,_0x304113){const _0x56d586=a198_0x42d3,_0x238f45=await apiRequest(_0x56d586(0x12f)+_0x304113+_0x56d586(0x103),{'method':_0x56d586(0x165),'body':{'appCode':_0x967d6d}});return _0x238f45[_0x56d586(0xf9)];}export async function getPageDetail(_0x135aff){const _0x3e38f2=a198_0x42d3,_0x51a545=await apiRequest('/smartapi/lovrabet/detail?pageId='+_0x135aff);if(!_0x51a545['data'])throw CliErrors[_0x3e38f2(0x107)](_0x3e38f2(0x1b6)+_0x135aff);return _0x51a545[_0x3e38f2(0xf9)];}export async function updatePage(_0x52352c,_0x4044ac,_0x17ba89,_0x5a3636){const _0x1fd21e=a198_0x42d3,_0x51744b=await apiRequest(_0x1fd21e(0x195),{'method':_0x1fd21e(0x165),'body':{'appCode':_0x52352c,'pageId':_0x4044ac,'code':_0x17ba89,'datasetIds':_0x5a3636}});return _0x51744b[_0x1fd21e(0xf9)];}export function generateSdkCode(_0x1d2792,_0x4691be,_0xb216d9){const _0x507f83=a198_0x42d3,_0x56a547=_0xb216d9?.['includeImports']??!![],_0x4cc5dc=_0x507f83(0x14c)+_0x1d2792[_0x507f83(0x118)]?.['replace'](/-/g,'_'),_0x3f0139=_0x4691be[_0x507f83(0x146)]||_0x4691be['operationName']||_0x507f83(0x10a),_0x5e3146=[];_0x56a547&&_0x5e3146['push'](_0x507f83(0xf7),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0x5e3146[_0x507f83(0x15a)](_0x507f83(0x158)+_0x1d2792[_0x507f83(0x146)]+'\x20('+(_0x1d2792[_0x507f83(0x18e)]||_0x507f83(0x149))+')');if(_0x3f0139===_0x507f83(0x10a))_0x5e3146['push'](_0x507f83(0x168)+_0x4cc5dc+_0x507f83(0x166),_0x507f83(0x1a6),_0x507f83(0x11b),_0x507f83(0x18d),'});');else{if(_0x3f0139===_0x507f83(0x178))_0x5e3146[_0x507f83(0x15a)](_0x507f83(0x168)+_0x4cc5dc+_0x507f83(0x104));else{if(_0x3f0139==='create')_0x5e3146['push']('const\x20result\x20=\x20await\x20client.models.'+_0x4cc5dc+_0x507f83(0x1be));else{if(_0x3f0139==='update')_0x5e3146[_0x507f83(0x15a)](_0x507f83(0x168)+_0x4cc5dc+_0x507f83(0x1b7));else _0x3f0139===_0x507f83(0x1bf)||_0x3f0139===_0x507f83(0x1ab)?_0x5e3146[_0x507f83(0x15a)]('const\x20result\x20=\x20await\x20client.models.'+_0x4cc5dc+'.remove(id);'):_0x5e3146[_0x507f83(0x15a)](_0x507f83(0x168)+_0x4cc5dc+'.'+_0x3f0139+_0x507f83(0x199));}}}return _0x5e3146['join']('\x0a');}export function generateSqlCodeTemplate(_0xbca9d6,_0x28a169){const _0x5804f1=a198_0x42d3,_0x13b73d=_0x28a169?.['target']??'sdk',_0x67c275=_0x28a169?.['includeImports']??!![],_0xa32d96=[];return _0xa32d96['push'](_0x5804f1(0x121)+_0xbca9d6['sqlName']+'\x20('+_0xbca9d6[_0x5804f1(0x180)]+')'),_0x13b73d===_0x5804f1(0x141)?(_0x67c275&&_0xa32d96[_0x5804f1(0x15a)](_0x5804f1(0xf7),'',_0x5804f1(0x170),''),_0xa32d96[_0x5804f1(0x15a)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x5804f1(0x19c)+_0xbca9d6[_0x5804f1(0x180)]+'\x27,',_0x5804f1(0x186),_0x5804f1(0x191),_0x5804f1(0x1d6),'const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0xa32d96[_0x5804f1(0x15a)]('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x5804f1(0x130),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0xbca9d6[_0x5804f1(0x180)]+'\x27,',_0x5804f1(0x1b3),_0x5804f1(0xf4),_0x5804f1(0x148),'}'),_0xa32d96[_0x5804f1(0x175)]('\x0a');}export async function getErConfig(_0x1c613c,_0x1f53b0){const _0x1f2a52=a198_0x42d3,_0x1b2ea9=await apiRequest('/smartapi/question/er-config',{'method':'POST','body':{'appCode':_0x1c613c,'dblinkId':_0x1f53b0},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x1b2ea9[_0x1f2a52(0xf9)];}export async function getErRelationDetail(_0x2a8f7e,_0x5e473f){const _0x553ba8=a198_0x42d3,_0x31bfd6=new URLSearchParams({'appCode':_0x2a8f7e,'relationId':String(_0x5e473f)});try{const _0x133e3b=await apiRequest(_0x553ba8(0x1d2)+_0x31bfd6[_0x553ba8(0x14d)]());return _0x133e3b[_0x553ba8(0xf9)]?.[_0x553ba8(0x1cc)]??null;}catch(_0x459008){if(_0x459008 instanceof CliError&&_0x459008[_0x553ba8(0x118)]===_0x553ba8(0x10b)&&(_0x459008['hint']?.[_0x553ba8(0x16d)](_0x553ba8(0x11a))||_0x459008[_0x553ba8(0x13d)]==='API\x20error\x20code:\x20306'&&_0x459008[_0x553ba8(0x137)]===_0x553ba8(0x124)))return null;throw _0x459008;}}export async function createErRelation(_0x44bd69){const _0x18e0d7=a198_0x42d3,_0xef1b9=await apiRequest(_0x18e0d7(0x128),{'method':_0x18e0d7(0x165),'body':_0x44bd69,'allowNonJsonSuccess':!![]});return _0xef1b9[_0x18e0d7(0xf9)];}export async function updateErRelation(_0x40eb2b){const _0x51cb1b=a198_0x42d3,_0x11c1ef=await apiRequest(_0x51cb1b(0x164),{'method':_0x51cb1b(0x165),'body':_0x40eb2b,'allowNonJsonSuccess':!![]});return _0x11c1ef[_0x51cb1b(0xf9)];}export async function deleteErRelation(_0x49bfcf){const _0x206426=a198_0x42d3,_0x257e3f=await apiRequest(_0x206426(0x132),{'method':_0x206426(0x165),'body':_0x49bfcf,'allowNonJsonSuccess':!![]});return _0x257e3f[_0x206426(0xf9)];}export async function updateErBusinessGroup(_0x1a05f0){const _0x3965b5=a198_0x42d3,_0x38d42b=await apiRequest(_0x3965b5(0x1bc),{'method':_0x3965b5(0x165),'body':_0x1a05f0,'allowNonJsonSuccess':!![]});return _0x38d42b[_0x3965b5(0xf9)];}function buildQuery(_0x156e87){const _0x2e572b=a198_0x42d3,_0x1ba649=new URLSearchParams();for(const [_0x7142f0,_0x3e098a]of Object[_0x2e572b(0x151)](_0x156e87)){if(_0x3e098a===undefined||_0x3e098a==='')continue;_0x1ba649[_0x2e572b(0x1b0)](_0x7142f0,String(_0x3e098a));}const _0x2c460d=_0x1ba649[_0x2e572b(0x14d)]();return _0x2c460d?'?'+_0x2c460d:'';}export async function listNotificationChannelConfigs(_0x4d79c2,_0x189216){const _0x47e4c0=a198_0x42d3,_0x2cf777=await apiRequest(_0x47e4c0(0x17b)+buildQuery({'appCode':_0x4d79c2,'channelType':_0x189216}));return Array[_0x47e4c0(0x13a)](_0x2cf777[_0x47e4c0(0xf9)])?_0x2cf777[_0x47e4c0(0xf9)]:[];}export async function listAppConfigs(_0x53b159,_0x528b65){const _0x4fe7bc=a198_0x42d3,_0x13219b=await apiRequest(_0x4fe7bc(0xf8),{'method':_0x4fe7bc(0x165),'body':{'appCode':_0x53b159,..._0x528b65?.[_0x4fe7bc(0x14a)]?{'key':_0x528b65[_0x4fe7bc(0x14a)]}:{},..._0x528b65?.[_0x4fe7bc(0x131)]?{'tags':_0x528b65['tags']}:{}}});return extractAppConfigList(_0x13219b[_0x4fe7bc(0xf9)]);}export async function getAppConfigByKey(_0x2094eb,_0x4b8724){const _0x35d463=a198_0x42d3,_0xd85556=await apiRequest(_0x35d463(0x1af)+buildQuery({'appCode':_0x2094eb,'key':_0x4b8724}));return _0xd85556[_0x35d463(0xf9)]??null;}export async function createAppConfig(_0x392f28){const _0x87c5bc=a198_0x42d3,_0x16421c=await apiRequest(_0x87c5bc(0x1c3),{'method':_0x87c5bc(0x165),'body':{'appCode':_0x392f28[_0x87c5bc(0x143)],'key':_0x392f28[_0x87c5bc(0x14a)],'value':_0x392f28[_0x87c5bc(0x147)],..._0x392f28[_0x87c5bc(0x131)]?{'tags':_0x392f28[_0x87c5bc(0x131)]}:{}}});return _0x16421c[_0x87c5bc(0xf9)];}export async function updateAppConfig(_0xb7a66b){const _0x2299e6=a198_0x42d3;await apiRequest('/smartapi/app-config/update',{'method':_0x2299e6(0x165),'body':{'id':_0xb7a66b['id'],'appCode':_0xb7a66b[_0x2299e6(0x143)],'key':_0xb7a66b[_0x2299e6(0x14a)],'value':_0xb7a66b[_0x2299e6(0x147)],..._0xb7a66b[_0x2299e6(0x131)]?{'tags':_0xb7a66b[_0x2299e6(0x131)]}:{}}});}export async function deleteAppConfig(_0xd3eac0){const _0x7865f3=a198_0x42d3;await apiRequest('/smartapi/app-config/delete',{'method':_0x7865f3(0x165),'body':_0xd3eac0});}function extractAppConfigList(_0x43f287){const _0x48bb80=a198_0x42d3;if(Array['isArray'](_0x43f287))return _0x43f287;if(_0x43f287&&typeof _0x43f287===_0x48bb80(0x16a)&&Array[_0x48bb80(0x13a)](_0x43f287['list']))return _0x43f287[_0x48bb80(0x1ad)];return extractList(_0x43f287);}export async function listDbLinks(_0xeb572c,_0x3251af){const _0x1e754f=a198_0x42d3,_0x165bed=await apiRequest('/smartapi/dblink/getList',{'method':_0x1e754f(0x165),'body':{'appCode':_0xeb572c,'currentPage':_0x3251af?.['currentPage']??0x1,'pageSize':_0x3251af?.['pageSize']??0x64}});return{'items':extractList(_0x165bed[_0x1e754f(0xf9)]),'paging':extractPaging(_0x165bed[_0x1e754f(0xf9)])};}export async function getDbLinkInfo(_0x176f94){const _0x379c21=a198_0x42d3,_0x3db815=await apiRequest(_0x379c21(0x19d)+buildQuery({'id':_0x176f94}));return _0x3db815[_0x379c21(0xf9)];}export async function createDbLink(_0x11b87e){const _0x165498=a198_0x42d3,_0x287338=await apiRequest('/smartapi/dblink/create',{'method':_0x165498(0x165),'body':_0x11b87e});return _0x287338[_0x165498(0xf9)];}export async function updateDbLink(_0x2b0846){const _0x12f03e=a198_0x42d3,_0x3962cf=await apiRequest('/smartapi/dblink/update',{'method':_0x12f03e(0x165),'body':_0x2b0846});return _0x3962cf[_0x12f03e(0xf9)];}export async function deleteDbLink(_0x1b7669){const _0x2054dc=a198_0x42d3;await apiRequest(_0x2054dc(0x154),{'method':'POST','body':{'id':_0x1b7669}});}export async function testDbLinkConnect(_0x454596){const _0x55bf61=a198_0x42d3,_0x3df695=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x454596}));return _0x3df695[_0x55bf61(0xf9)];}export async function startDbAnalysis(_0x337309,_0x587731){const _0x4e7a91=a198_0x42d3,_0x3d2290=await apiRequest(_0x4e7a91(0x177),{'method':_0x4e7a91(0x165),'body':{'dbLinkId':_0x337309,..._0x587731&&_0x587731[_0x4e7a91(0x1c7)]>0x0?{'tableNames':_0x587731}:{}}});return _0x3d2290[_0x4e7a91(0xf9)];}export async function cancelDbAnalysis(_0x37ec83){const _0x252499=a198_0x42d3;await apiRequest(_0x252499(0x11f)+buildQuery({'planId':_0x37ec83}),{'method':_0x252499(0x165)});}export async function getDbAnalysisStatus(_0x3346f2){const _0x268063=a198_0x42d3,_0x26831c=await apiRequest(_0x268063(0x194)+encodeURIComponent(_0x3346f2));return _0x26831c[_0x268063(0xf9)];}export async function getDbAllTableList(_0x42a111,_0x592b91){const _0x3fd83c=a198_0x42d3,_0x5edfc3=await apiRequest(_0x3fd83c(0x155)+buildQuery({'appCode':_0x42a111,'dbLinkId':_0x592b91})),_0x327a32=_0x5edfc3[_0x3fd83c(0xf9)];if(Array[_0x3fd83c(0x13a)](_0x327a32))return _0x327a32;return extractList(_0x327a32);}export async function getDbTableDiff(_0x12c386,_0x252730,_0x3baaff){const _0x3460ca=a198_0x42d3,_0x328d41=await apiRequest(_0x3460ca(0x156)+buildQuery({'appCode':_0x12c386,'dbLinkId':_0x252730,'pageIndex':_0x3baaff?.[_0x3460ca(0x1a3)]??0x1,'pageSize':_0x3baaff?.[_0x3460ca(0x185)]??0x14,'tableName':_0x3baaff?.['tableName']})),_0x2ad220=_0x328d41[_0x3460ca(0xf9)];return{'totalCount':_0x2ad220?.[_0x3460ca(0x1c0)]??0x0,'physicalTableCount':_0x2ad220?.['physicalTableCount']??0x0,'datasetTableCount':_0x2ad220?.[_0x3460ca(0x160)]??0x0,..._0x2ad220?.[_0x3460ca(0x1a5)]?{'summary':_0x2ad220[_0x3460ca(0x1a5)]}:{},'tableList':Array[_0x3460ca(0x13a)](_0x2ad220?.['tableList'])?_0x2ad220[_0x3460ca(0x19f)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x33b469=a198_0x42d3,_0x3089a0=await apiRequest(_0x33b469(0x1ac),{'method':_0x33b469(0x165),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0xb9da1c=extractList(_0x3089a0[_0x33b469(0xf9)]),_0x5972dc=extractPaging(_0x3089a0['data']);return _0x5972dc&&_0x5972dc['totalCount']>REMOTE_APP_PAGE_SIZE&&console['warn'](_0x33b469(0x153)+REMOTE_APP_PAGE_SIZE+_0x33b469(0x111)+_0x5972dc[_0x33b469(0x1c0)]+'\x20apps.\x20'+_0x33b469(0x157)),_0xb9da1c;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x327703,_0x4ee246){const _0x515a55=a198_0x42d3,_0x4dcf8a=Math[_0x515a55(0x13e)](Math[_0x515a55(0x129)](_0x4ee246?.[_0x515a55(0x185)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0xaf7077=await apiRequest(_0x515a55(0x1cb),{'method':'POST','body':{'appCode':_0x327703,'currentPage':_0x4ee246?.['currentPage']??0x1,'pageSize':_0x4dcf8a}});return{'items':extractList(_0xaf7077['data']),'paging':extractPaging(_0xaf7077[_0x515a55(0xf9)])};}export async function getAppRole(_0x3ee6a9){const _0x243119=a198_0x42d3,_0xcdf7f9=await apiRequest('/smartapi/permit/role/get-one'+buildQuery({'id':_0x3ee6a9}));return _0xcdf7f9[_0x243119(0xf9)];}export async function createAppRole(_0x2542d7){const _0x4188db=a198_0x42d3,_0x399eb1=await apiRequest(_0x4188db(0x13c),{'method':_0x4188db(0x165),'body':{'appCode':_0x2542d7[_0x4188db(0x143)],'roleName':_0x2542d7['roleName'],'roleType':_0x4188db(0x196),..._0x2542d7[_0x4188db(0x182)]?{'remark':_0x2542d7[_0x4188db(0x182)]}:{}}});return _0x399eb1[_0x4188db(0xf9)];}export async function updateAppRole(_0xceb8ae){const _0x371e53=a198_0x42d3,_0x23961a=await apiRequest(_0x371e53(0x150),{'method':_0x371e53(0x165),'body':{'id':_0xceb8ae['id'],'appCode':_0xceb8ae[_0x371e53(0x143)],..._0xceb8ae['roleType']?{'roleType':_0xceb8ae[_0x371e53(0x117)]}:{},..._0xceb8ae[_0x371e53(0x139)]!==undefined?{'roleName':_0xceb8ae[_0x371e53(0x139)]}:{},..._0xceb8ae[_0x371e53(0x182)]!==undefined?{'remark':_0xceb8ae['remark']}:{},..._0xceb8ae[_0x371e53(0x176)]?{'permits':_0xceb8ae[_0x371e53(0x176)]}:{}}});return _0x23961a['data'];}export async function deleteAppRole(_0x48207f){const _0x173de1=a198_0x42d3;await apiRequest(_0x173de1(0x17d),{'method':_0x173de1(0x165),'body':{'id':_0x48207f}});}export async function listPermitRoles(_0x1d71a0,_0x115262){const _0x3d7e24=a198_0x42d3,_0x381b79=await apiRequest(_0x3d7e24(0x16e),{'method':_0x3d7e24(0x165),'body':{'appCode':_0x1d71a0,..._0x115262?.[_0x3d7e24(0x19e)]!==undefined?{'needSelf':_0x115262['needSelf']}:{},..._0x115262?.[_0x3d7e24(0x116)]!==undefined?{'needPublic':_0x115262['needPublic']}:{}}});return extractList(_0x381b79[_0x3d7e24(0xf9)]);}export async function getRoleMenuResources(_0x51c16b,_0x5093b1){const _0x49983f=a198_0x42d3,_0x1868be=await apiRequest(_0x49983f(0x17e),{'method':_0x49983f(0x165),'body':{'appCode':_0x51c16b,'roleId':_0x5093b1}});return extractList(_0x1868be[_0x49983f(0xf9)]);}export async function getRoleApiResources(_0x47b455,_0x30d939){const _0x27718b=a198_0x42d3,_0xe6c05f=await apiRequest('/smartapi/permit/resource/get-api-list',{'method':_0x27718b(0x165),'body':{'appCode':_0x47b455,'roleId':_0x30d939}});return extractList(_0xe6c05f[_0x27718b(0xf9)]);}export async function listRoleUsers(_0x4e07e6){const _0x1e2f3e=a198_0x42d3,_0x518363=await apiRequest(_0x1e2f3e(0x192),{'method':'POST','body':{'appCode':_0x4e07e6}});return extractList(_0x518363[_0x1e2f3e(0xf9)]);}export async function updateRoleUsers(_0x3a6a3d,_0xc242d9){await apiRequest('/smartapi/permit/user-role/update-user-list',{'method':'POST','body':{'appCode':_0x3a6a3d,'roleList':_0xc242d9}});}export async function getPagePermit(_0x25ccca){const _0x1a0c4a=a198_0x42d3,_0x520213=await apiRequest(_0x1a0c4a(0x108)+buildQuery({'menuId':_0x25ccca}));return _0x520213[_0x1a0c4a(0xf9)];}export async function savePagePermit(_0x486998){const _0x45a869=a198_0x42d3,_0x380dac=await apiRequest('/smartapi/permit/page/save',{'method':'POST','body':_0x486998});return _0x380dac[_0x45a869(0xf9)];}export async function getTenantMembers(_0x283196){const _0x34de96=a198_0x42d3,_0x17da68=await apiRequest('/userTenant/getByTenantCode'+buildQuery({'code':_0x283196})),_0x3e3bd0=_0x17da68[_0x34de96(0xf9)]??{},_0xbc42b1=Array[_0x34de96(0x13a)](_0x3e3bd0?.[_0x34de96(0x1a0)])?_0x3e3bd0[_0x34de96(0x1a0)]:[];return _0xbc42b1[_0x34de96(0x10a)](_0x1b3327=>_0x1b3327?.[_0x34de96(0x162)]===_0x34de96(0x171)||_0x1b3327?.[_0x34de96(0x162)]===undefined)[_0x34de96(0x12d)](_0x36f45b=>({'userId':Number(_0x36f45b[_0x34de96(0x1b4)]??_0x36f45b['id']),'username':_0x36f45b[_0x34de96(0x1ae)],'nickname':_0x36f45b['nickname'],'status':_0x36f45b[_0x34de96(0x162)],'email':_0x36f45b[_0x34de96(0x101)],'mobile':_0x36f45b[_0x34de96(0x1d3)],'avatar':_0x36f45b[_0x34de96(0x163)]}))['filter'](_0x691c89=>Number[_0x34de96(0x1b5)](_0x691c89['userId'])&&_0x691c89[_0x34de96(0x1b4)]>0x0);}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a199_0x16ce8a=a199_0x26fa;(function(_0x43127c,_0x1c47fb){const _0x1a3ea4=a199_0x26fa,_0x5b7f0e=_0x43127c();while(!![]){try{const _0x489094=-parseInt(_0x1a3ea4(0x1d7))/0x1+-parseInt(_0x1a3ea4(0x1d6))/0x2+parseInt(_0x1a3ea4(0x1e1))/0x3*(parseInt(_0x1a3ea4(0x1dc))/0x4)+-parseInt(_0x1a3ea4(0x1d9))/0x5+parseInt(_0x1a3ea4(0x1d5))/0x6+parseInt(_0x1a3ea4(0x1da))/0x7+parseInt(_0x1a3ea4(0x1df))/0x8;if(_0x489094===_0x1c47fb)break;else _0x5b7f0e['push'](_0x5b7f0e['shift']());}catch(_0x2770fe){_0x5b7f0e['push'](_0x5b7f0e['shift']());}}}(a199_0x57d9,0xc33b0));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a199_0x57d9(){const _0x94253=['bff-trash','bff.lock.json','8725568YlJmSl','bff','21759rSIBXd','795000Kojosa','1166936EdubUJ','24910ewOoyS','.rabetbase','5967550bGSftL','3911369avlJfJ','/bff','452EFqneb'];a199_0x57d9=function(){return _0x94253;};return a199_0x57d9();}function a199_0x26fa(_0x166e37,_0x5eeb2a){_0x166e37=_0x166e37-0x1d5;const _0x57d9b4=a199_0x57d9();let _0x26fa3c=_0x57d9b4[_0x166e37];return _0x26fa3c;}const DOT_DIR=a199_0x16ce8a(0x1d8),LOCK_FILE_NAME=a199_0x16ce8a(0x1de),TRASH_DIR_NAME=a199_0x16ce8a(0x1dd);export function loadBffProjectConfig(_0x47ebdc,_0x1af52f){const _0x565bef=a199_0x16ce8a,_0x2485c6=resolve(_0x1af52f??findProjectRootDirectory()),_0x5b4cad=DOT_DIR+_0x565bef(0x1db),_0xd9cd25=_0x5b4cad+'/'+_0x47ebdc;return{'projectRoot':_0x2485c6,'appCode':_0x47ebdc,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x5b4cad,'scriptsRoot':_0xd9cd25,'scriptsRootDir':resolve(_0x2485c6,DOT_DIR,_0x565bef(0x1e0),_0x47ebdc),'lockFilePath':resolve(_0x2485c6,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2485c6,DOT_DIR,TRASH_DIR_NAME)};}
|