@lovrabet/rabetbase-cli 2.3.16-beta.5 → 2.3.16-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/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.d.ts +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x596afc,_0x2a3288){const _0x4b9400=a203_0x8f4b,_0x510f91=_0x596afc();while(!![]){try{const _0x18fdcd=-parseInt(_0x4b9400(0xca))/0x1*(-parseInt(_0x4b9400(0xda))/0x2)+parseInt(_0x4b9400(0xd8))/0x3+parseInt(_0x4b9400(0xd3))/0x4+-parseInt(_0x4b9400(0xbe))/0x5*(-parseInt(_0x4b9400(0xc9))/0x6)+-parseInt(_0x4b9400(0xdb))/0x7*(parseInt(_0x4b9400(0xe5))/0x8)+-parseInt(_0x4b9400(0xd6))/0x9+-parseInt(_0x4b9400(0xc5))/0xa;if(_0x18fdcd===_0x2a3288)break;else _0x510f91['push'](_0x510f91['shift']());}catch(_0x2ae483){_0x510f91['push'](_0x510f91['shift']());}}}(a203_0x4a98,0xa0fbc));function a203_0x8f4b(_0x75bbb2,_0x50271b){_0x75bbb2=_0x75bbb2-0xb9;const _0x4a98bb=a203_0x4a98();let _0x8f4b10=_0x4a98bb[_0x75bbb2];return _0x8f4b10;}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{isDaily,normalizeEnv}from'../constant/env.js';function a203_0x4a98(){const _0x1e7eff=['5756115KSRqww','maxRisk','app','object','PAGE_SIZE','apps','cookie','9111120tMHkiH','APP','true','ACCESS_KEY','6qfaBXn','894442BBmvGf','defaultApp','production','daily','inherit','MAX_RISK','env','entries','keys','2715624aDjhsz','projectConfig','trim','6057666mbbYES','apiDir','1273917RHrGsQ','accessKey','2oHyLOx','6339452MAijFO','high-risk-write','length','format','string','riskLevel','globalConfig','COOKIE','pageSize','read','8sJIuIk','find','prototype','call','appcode','hasOwnProperty','locale'];a203_0x4a98=function(){return _0x1e7eff;};return a203_0x4a98();}import{normalizeLegacyOutputFormat,riskLevelOrder}from'../framework/types.js';function stringConfigValue(_0x544384){const _0x2de5af=a203_0x8f4b;return typeof _0x544384===_0x2de5af(0xdf)&&_0x544384[_0x2de5af(0xd5)]()?_0x544384['trim']():undefined;}function appProfiles(_0x1f31d9){const _0x2145a0=a203_0x8f4b;return _0x1f31d9['apps']&&typeof _0x1f31d9[_0x2145a0(0xc3)]==='object'?_0x1f31d9['apps']:{};}function resolveDefaultAppName(_0x38a7be){const _0x2420af=a203_0x8f4b,_0x50d5e0=stringConfigValue(_0x38a7be['defaultApp']);if(_0x50d5e0)return _0x50d5e0;return Object[_0x2420af(0xd2)](appProfiles(_0x38a7be))[0x0];}function resolveTopLevelAppCode(_0x6db06b){const _0x2452c8=a203_0x8f4b;return stringConfigValue(_0x6db06b[_0x2452c8(0xbb)])||stringConfigValue(_0x6db06b[_0x2452c8(0xc0)]);}function normalizeRiskCeiling(_0x37680b){const _0x56a8c8=a203_0x8f4b;if(_0x37680b===undefined||_0x37680b===null)return undefined;if(_0x37680b===_0x56a8c8(0xe4)||_0x37680b==='write'||_0x37680b===_0x56a8c8(0xdc))return _0x37680b;return'read';}function resolveRiskCeiling(_0x711b23,..._0x3410c9){const _0x5ecf3b=a203_0x8f4b;let _0x10c654;for(const _0x96256d of _0x711b23){const _0x598860=normalizeRiskCeiling(_0x96256d);_0x598860&&(!_0x10c654||riskLevelOrder(_0x598860)<riskLevelOrder(_0x10c654))&&(_0x10c654=_0x598860);}let _0x44dc40=_0x10c654??DEFAULT_CONFIG_VALUES[_0x5ecf3b(0xe0)];for(const _0xb3f213 of _0x3410c9){const _0x46c4ec=normalizeRiskCeiling(_0xb3f213);_0x46c4ec&&riskLevelOrder(_0x46c4ec)<riskLevelOrder(_0x44dc40)&&(_0x44dc40=_0x46c4ec);}return _0x44dc40;}function configuredRiskCeilings(_0x23f3b0){const _0x4561b8=a203_0x8f4b;return[...Object['prototype'][_0x4561b8(0xbc)][_0x4561b8(0xba)](_0x23f3b0,_0x4561b8(0xbf))?[_0x23f3b0['maxRisk']]:[],...Object[_0x4561b8(0xb9)][_0x4561b8(0xbc)][_0x4561b8(0xba)](_0x23f3b0,_0x4561b8(0xe0))?[_0x23f3b0[_0x4561b8(0xe0)]]:[]];}export function resolveAppConfig({raw:_0x55b3ee,flags:_0x4a31be,layers:_0x2d041c,readEnv:_0x2d9aab}){const _0x49071b=a203_0x8f4b,_0xb7d0c3=_0x2d041c?.['projectConfig']??{},_0x53e4a1=_0x2d041c?.['globalConfig']??{},_0x517489=Object['keys'](_0xb7d0c3)[_0x49071b(0xdd)]>0x0,_0xe2394b=!_0x517489||_0xb7d0c3[_0x49071b(0xce)]===!![],_0xc2e3a7=_0x517489?resolveDefaultAppName(_0xb7d0c3):undefined,_0x2448a5=_0xe2394b?resolveDefaultAppName(_0x53e4a1):undefined,_0x59e76c=stringConfigValue(_0x4a31be['app']),_0x4d10a0=_0x2d9aab(_0x49071b(0xc6)),_0x3b45e7={};if(_0x55b3ee[_0x49071b(0xc3)]&&typeof _0x55b3ee[_0x49071b(0xc3)]===_0x49071b(0xc1))for(const [_0x4e1a35,_0x36edf5]of Object[_0x49071b(0xd1)](_0x55b3ee['apps'])){_0x36edf5&&typeof _0x36edf5===_0x49071b(0xc1)&&_0x36edf5[_0x49071b(0xbb)]&&(_0x3b45e7[_0x4e1a35]=_0x36edf5);}const _0x5b5d9b=_0x55b3ee[_0x49071b(0xcb)]||undefined,_0x56210f=Object[_0x49071b(0xd2)](_0x3b45e7)[_0x49071b(0xdd)]>0x0,_0x1f85f8=_0x59e76c||_0xc2e3a7||_0x4d10a0||_0x2448a5||_0x5b5d9b||undefined,_0x2c73a8=stringConfigValue(_0x4a31be[_0x49071b(0xbb)]),_0x222276=_0x2c73a8?Object[_0x49071b(0xd1)](_0x3b45e7)[_0x49071b(0xe6)](([,_0xba3696])=>_0xba3696?.['appcode']===_0x2c73a8):undefined,_0x19376f=_0x222276?.[0x0],_0x5e33b5=_0x222276?.[0x1],_0x409b29=_0x2c73a8?_0x19376f:_0x1f85f8;let _0xdb8def=_0x409b29&&_0x3b45e7[_0x409b29]?_0x3b45e7[_0x409b29]:undefined;_0x2c73a8&&_0x5e33b5&&(_0xdb8def=_0x5e33b5);const _0x5afaa4=_0x2c73a8?_0x5e33b5??_0xdb8def:_0xdb8def,_0x5f0d41=!_0x59e76c&&!_0xc2e3a7&&_0x4d10a0&&_0x409b29===_0x4d10a0,_0x25888f=_0x59e76c||(_0x5f0d41?_0x4d10a0:undefined)||(_0x2c73a8?_0x19376f:undefined),_0x4ac5b0=_0x5afaa4?.['appcode'],_0x28427c=_0x517489?resolveTopLevelAppCode(_0xb7d0c3):undefined,_0xd199a3=_0xe2394b?resolveTopLevelAppCode(_0x53e4a1):undefined,_0x132b90=_0x59e76c||_0xc2e3a7?_0x4ac5b0:undefined,_0x5c3d9c=!_0x59e76c&&!_0xc2e3a7?_0x4ac5b0:undefined,_0x21eb78=_0x2c73a8||_0x132b90||_0x28427c||_0x5c3d9c||_0xd199a3||undefined,_0x17d30f=_0x517489?stringConfigValue(_0xb7d0c3[_0x49071b(0xd0)]):undefined,_0x933f4c=_0xe2394b?stringConfigValue(_0x53e4a1['env']):undefined,_0xd4fd3a=_0x4a31be[_0x49071b(0xd0)]||_0x5afaa4?.[_0x49071b(0xd0)]||_0x17d30f||_0x2d9aab('ENV')||_0x933f4c||_0x55b3ee[_0x49071b(0xd0)]||DEFAULT_CONFIG_VALUES['env'],_0xc21c15=_0x5afaa4?.['locale']||_0x55b3ee['locale']||DEFAULT_CONFIG_VALUES[_0x49071b(0xbd)],_0x207543=_0x2d9aab(_0x49071b(0xe2))||_0x5afaa4?.[_0x49071b(0xc4)]||_0x55b3ee[_0x49071b(0xc4)]||undefined,_0x527a5e=_0x2d9aab(_0x49071b(0xc8))||_0x5afaa4?.[_0x49071b(0xd9)]||_0x55b3ee['accessKey']||undefined,_0x5882b5=_0x4a31be[_0x49071b(0xde)]||_0x2d9aab('FORMAT')||_0x5afaa4?.[_0x49071b(0xde)]||_0x55b3ee[_0x49071b(0xde)],_0x393257=normalizeLegacyOutputFormat(_0x5882b5),_0x377baf=_0x2d9aab(_0x49071b(0xc2))||_0x5afaa4?.[_0x49071b(0xe3)]||_0x55b3ee['pageSize'],_0x567174=_0x377baf?Number(_0x377baf)||undefined:undefined,_0x42bb53=_0x2d041c?[...configuredRiskCeilings(_0x2d041c[_0x49071b(0xe1)]),...configuredRiskCeilings(_0x2d041c[_0x49071b(0xd4)])]:configuredRiskCeilings(_0x55b3ee),_0x192273=resolveRiskCeiling(_0x42bb53,_0x5afaa4?.[_0x49071b(0xe0)],_0x2d9aab('RISK_LEVEL'),_0x2d9aab(_0x49071b(0xcf))),_0x544759=_0x2d9aab('VERBOSE'),_0x4bf2ec=_0x544759==='1'||_0x544759===_0x49071b(0xc7),_0x1351d9=_0x5afaa4?.[_0x49071b(0xd7)]||_0x55b3ee[_0x49071b(0xd7)]||DEFAULT_CONFIG_VALUES['apiDir'],_0x2f780a=isDaily(normalizeEnv(String(_0xd4fd3a)))?_0x49071b(0xcd):_0x49071b(0xcc);return{'appCode':typeof _0x21eb78==='string'&&_0x21eb78['trim']()?_0x21eb78[_0x49071b(0xd5)]():undefined,'env':_0x2f780a,'locale':_0xc21c15,'cookie':_0x207543,'accessKey':_0x527a5e,'format':_0x393257,'pageSize':_0x567174,'riskLevel':_0x192273,'verbose':_0x4bf2ec,'apiDir':_0x1351d9,'apps':_0x3b45e7,'defaultApp':_0x5b5d9b,'currentApp':_0x56210f?_0x409b29:undefined,'explicitAppName':_0x25888f};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a204_0x5d4d(){const _0x335915=['430gdVrFH','1782210YpufxP','723239NiviPM','1026xVwhAw','797168FvpLkh','14AYuQpH','15sxNosL','176612IjrEQX','48696KvqjoW','cookie','431610jQwnyE','5247875hKVcvB','authRequired'];a204_0x5d4d=function(){return _0x335915;};return a204_0x5d4d();}(function(_0x9ed410,_0x4effca){const _0x40345b=a204_0x5384,_0x285cef=_0x9ed410();while(!![]){try{const _0x58efbb=parseInt(_0x40345b(0x1f1))/0x1+-parseInt(_0x40345b(0x1eb))/0x2+parseInt(_0x40345b(0x1f0))/0x3*(-parseInt(_0x40345b(0x1ee))/0x4)+-parseInt(_0x40345b(0x1f5))/0x5+-parseInt(_0x40345b(0x1f4))/0x6*(parseInt(_0x40345b(0x1ef))/0x7)+parseInt(_0x40345b(0x1f2))/0x8*(parseInt(_0x40345b(0x1ed))/0x9)+-parseInt(_0x40345b(0x1ea))/0xa*(-parseInt(_0x40345b(0x1ec))/0xb);if(_0x58efbb===_0x4effca)break;else _0x285cef['push'](_0x285cef['shift']());}catch(_0x1983f0){_0x285cef['push'](_0x285cef['shift']());}}}(a204_0x5d4d,0x96917));import{getIsSessionValid}from'../auth/is-session-valid.js';import{CliErrors}from'../errors.js';function a204_0x5384(_0x47d56a,_0xdbe826){_0x47d56a=_0x47d56a-0x1e9;const _0x5d4d7c=a204_0x5d4d();let _0x5384f3=_0x5d4d7c[_0x47d56a];return _0x5384f3;}export async function buildAuth(_0x420712){const _0x4905e5=a204_0x5384,{getCookie:_0x155d3d}=await import('../auth/get-cookie.js'),_0x1529e8=_0x420712[_0x4905e5(0x1f3)]||_0x155d3d(),_0x516452=_0x1529e8?await getIsSessionValid():![];return{'cookie':_0x1529e8,'isLoggedIn':_0x516452,async 'getOrLogin'(){const _0xd41101=_0x4905e5;if(_0x1529e8&&_0x516452)return _0x1529e8;throw CliErrors[_0xd41101(0x1e9)]();}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a205_0x49ef(_0xc0c8c6,_0x4c0376){_0xc0c8c6=_0xc0c8c6-0xf0;const _0x5d788b=a205_0x5d78();let _0x49ef6e=_0x5d788b[_0xc0c8c6];return _0x49ef6e;}const a205_0x2055cb=a205_0x49ef;(function(_0x33a48d,_0xb5e9cd){const _0x439b38=a205_0x49ef,_0x5cb0c6=_0x33a48d();while(!![]){try{const _0x23b936=-parseInt(_0x439b38(0x11f))/0x1+parseInt(_0x439b38(0x11a))/0x2*(-parseInt(_0x439b38(0xf3))/0x3)+parseInt(_0x439b38(0xf5))/0x4*(-parseInt(_0x439b38(0x11c))/0x5)+parseInt(_0x439b38(0x124))/0x6*(-parseInt(_0x439b38(0x107))/0x7)+-parseInt(_0x439b38(0xf2))/0x8*(parseInt(_0x439b38(0x10d))/0x9)+parseInt(_0x439b38(0xfd))/0xa+parseInt(_0x439b38(0x10c))/0xb*(parseInt(_0x439b38(0x10a))/0xc);if(_0x23b936===_0xb5e9cd)break;else _0x5cb0c6['push'](_0x5cb0c6['shift']());}catch(_0x4a8851){_0x5cb0c6['push'](_0x5cb0c6['shift']());}}}(a205_0x5d78,0x7ff71));function a205_0x5d78(){const _0x2754f5=['env','empty','288QXVlBd','102ZZWgaS','defaultApp','63268iDrKKY','config','appcode','apps','object','accessKey','error','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','1449660OnCEMd','locale','utf8','keys','cwd','app','.lovrabet.json','pageSize','\x0a\x20\x20','warn','14GiXvuz','parse','cookie','2088yUhJvk','stringify','124839TAumrJ','67176pwGZdx','migrated','filter','string','trim','Global','.lovrabetrc','silent','status','message','missing','apiDir','.rabetbase.json','1014uNdiAC','inherit','155vPUCjX','get','set','379530JKNWij','length','Project','.tmp','riskLevel','1319244UEmeim','format'];a205_0x5d78=function(){return _0x2754f5;};return a205_0x5d78();}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=a205_0x2055cb(0x119);export const CONFIG_NAMES=[a205_0x2055cb(0x119),a205_0x2055cb(0x103),a205_0x2055cb(0x113)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a205_0x2055cb(0x10f)](_0x2a29f9=>_0x2a29f9!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x51997d){for(const _0x3a2496 of CONFIG_NAMES){const _0x339dce=resolve(_0x51997d,_0x3a2496);if(existsSync(_0x339dce))return _0x339dce;}return undefined;}export function findProjectRootDirectory(_0x873e93=process['cwd']()){let _0xcff974=resolve(_0x873e93);const {root:_0x18eff2}=parse(_0xcff974),_0x1577f0=homedir();while(!![]){if(resolveConfigPath(_0xcff974)){if(_0xcff974===_0x1577f0)break;return _0xcff974;}if(_0xcff974===_0x18eff2||_0xcff974===_0x1577f0)break;const _0x4adf3b=dirname(_0xcff974);if(_0x4adf3b===_0xcff974)break;_0xcff974=_0x4adf3b;}return resolve(_0x873e93);}export function getProjectConfigPath(){const _0x26395f=a205_0x2055cb;return resolveConfigPath(process[_0x26395f(0x101)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x574725){const _0x28e596=a205_0x2055cb;if(!existsSync(_0x574725))return{'status':_0x28e596(0x117)};try{const _0x1c5b61=readFileSync(_0x574725,{'encoding':_0x28e596(0xff)});if(!_0x1c5b61?.['trim']())return{'status':'empty'};const _0x1dca1c=JSON[_0x28e596(0x108)](_0x1c5b61);return{'status':'ok','data':_0x1dca1c};}catch(_0x57a5a5){return{'status':'error','message':_0x57a5a5 instanceof Error?_0x57a5a5['message']:String(_0x57a5a5)};}}function parseCliConfigJsonFile(_0x1a35cc,_0x59e2ba,_0x1d1ff3){const _0x5cb08a=a205_0x2055cb,_0x59b99b=inspectCliConfigJsonFile(_0x1a35cc);if(_0x59b99b['status']==='missing'||_0x59b99b[_0x5cb08a(0x115)]===_0x5cb08a(0xf1))return{};if(_0x59b99b[_0x5cb08a(0x115)]==='ok')return _0x59b99b['data'];return _0x59e2ba===_0x5cb08a(0x106)&&_0x1d1ff3&&console[_0x5cb08a(0xfb)](CLI_BIN_NAME+':\x20'+_0x1d1ff3+_0x5cb08a(0xfc)+_0x1a35cc+_0x5cb08a(0x105)+_0x59b99b[_0x5cb08a(0x116)]),{};}function normalizeLegacyConfigShape(_0x1f8de5){const _0x589293=a205_0x2055cb;if(!_0x1f8de5||typeof _0x1f8de5!=='object')return{'config':{},'migrated':![]};const _0x1fde8c={..._0x1f8de5},_0x2da462=_0x1fde8c[_0x589293(0xf8)]&&typeof _0x1fde8c[_0x589293(0xf8)]===_0x589293(0xf9)?{..._0x1fde8c[_0x589293(0xf8)]}:{},_0x3e3988=Object[_0x589293(0x100)](_0x2da462)[_0x589293(0x120)],_0x545099=_0x1fde8c[_0x589293(0xf7)]||_0x1fde8c[_0x589293(0x102)];let _0x24d8fe=![];if(_0x545099&&_0x3e3988===0x0){const _0x4439c3=typeof _0x1fde8c[_0x589293(0xf4)]===_0x589293(0x110)&&_0x1fde8c[_0x589293(0xf4)][_0x589293(0x111)]()?_0x1fde8c[_0x589293(0xf4)]:String(_0x545099)[_0x589293(0x111)]();_0x2da462[_0x4439c3]={'appcode':String(_0x545099)[_0x589293(0x111)](),..._0x1fde8c[_0x589293(0xf0)]!=null?{'env':_0x1fde8c[_0x589293(0xf0)]}:{},..._0x1fde8c[_0x589293(0x118)]!=null?{'apiDir':_0x1fde8c['apiDir']}:{},..._0x1fde8c['cookie']!=null?{'cookie':_0x1fde8c[_0x589293(0x109)]}:{},..._0x1fde8c['accessKey']!=null?{'accessKey':_0x1fde8c[_0x589293(0xfa)]}:{},..._0x1fde8c[_0x589293(0x125)]!=null?{'format':_0x1fde8c[_0x589293(0x125)]}:{},..._0x1fde8c['pageSize']!=null?{'pageSize':_0x1fde8c[_0x589293(0x104)]}:{},..._0x1fde8c[_0x589293(0x123)]!=null?{'riskLevel':_0x1fde8c[_0x589293(0x123)]}:{},..._0x1fde8c[_0x589293(0xfe)]!=null?{'locale':_0x1fde8c[_0x589293(0xfe)]}:{}},_0x1fde8c[_0x589293(0xf8)]=_0x2da462;if(!_0x1fde8c[_0x589293(0xf4)])_0x1fde8c[_0x589293(0xf4)]=_0x4439c3;_0x24d8fe=!![];}return(_0x589293(0xf7)in _0x1fde8c||'app'in _0x1fde8c)&&(delete _0x1fde8c[_0x589293(0xf7)],delete _0x1fde8c['app'],_0x24d8fe=!![]),{'config':_0x1fde8c,'migrated':_0x24d8fe};}function writeNormalizedConfigIfNeeded(_0xdf6dfd,_0x2e6b3a){const _0x4797af=a205_0x2055cb,_0xfde3ab=JSON['stringify'](_0x2e6b3a,null,0x2)+'\x0a';if(normalizedWriteCache[_0x4797af(0x11d)](_0xdf6dfd)===_0xfde3ab)return;writeConfigFile(_0xdf6dfd,_0x2e6b3a),normalizedWriteCache[_0x4797af(0x11e)](_0xdf6dfd,_0xfde3ab);}function parseAndNormalizeConfig(_0x24d3c6,_0x26f723,_0x570992){const _0x1a19d6=a205_0x2055cb,_0x44b95e=parseCliConfigJsonFile(_0x24d3c6,_0x26f723,_0x570992),_0x20f187=normalizeLegacyConfigShape(_0x44b95e);if(_0x20f187[_0x1a19d6(0x10e)])try{writeNormalizedConfigIfNeeded(_0x24d3c6,_0x20f187[_0x1a19d6(0xf6)]);}catch{}return _0x20f187[_0x1a19d6(0xf6)];}export function loadRawConfigLayers(_0x137122){const _0x780df3=a205_0x2055cb;let _0x26973c={},_0xebc94a={};const _0x5e647e=resolveConfigPath(homedir());_0x5e647e&&(_0x26973c=parseAndNormalizeConfig(_0x5e647e,'warn',_0x780df3(0x112)));const _0x87c5e7=_0x137122??findProjectRootDirectory(),_0x55c6c6=resolveConfigPath(_0x87c5e7);return _0x55c6c6&&(_0xebc94a=parseAndNormalizeConfig(_0x55c6c6,_0x780df3(0x106),_0x780df3(0x121))),{'globalPath':_0x5e647e,'projectPath':_0x55c6c6,'globalConfig':_0x26973c,'projectConfig':_0xebc94a};}const INHERIT_WHITELIST=[a205_0x2055cb(0x109),'accessKey',a205_0x2055cb(0xfe),'format',a205_0x2055cb(0x123),a205_0x2055cb(0x104)];export function mergeRawConfigLayers(_0x32da1e){const _0x3204e0=a205_0x2055cb,{globalConfig:_0x85dbbd,projectConfig:_0x581dcd}=_0x32da1e,_0x936a8f=Object[_0x3204e0(0x100)](_0x581dcd)[_0x3204e0(0x120)]>0x0;if(!_0x936a8f)return mergeGlobalOnly(_0x85dbbd);if(_0x581dcd['inherit']===!![])return mergeFullInherit(_0x85dbbd,_0x581dcd);if(_0x581dcd[_0x3204e0(0x11b)]===![])return mergeIsolated(_0x581dcd);return mergeProjectFirst(_0x85dbbd,_0x581dcd);}function mergeGlobalOnly(_0x3cf53b){const _0x5c2d54=a205_0x2055cb,_0x17fd07={..._0x3cf53b},_0x5e515a=_0x3cf53b['apps']&&typeof _0x3cf53b[_0x5c2d54(0xf8)]===_0x5c2d54(0xf9)?_0x3cf53b['apps']:{};if(Object['keys'](_0x5e515a)[_0x5c2d54(0x120)]>0x0)_0x17fd07['apps']=_0x5e515a;if(_0x3cf53b[_0x5c2d54(0xf4)])_0x17fd07[_0x5c2d54(0xf4)]=_0x3cf53b[_0x5c2d54(0xf4)];else{const _0x295673=Object[_0x5c2d54(0x100)](_0x5e515a);if(_0x295673[_0x5c2d54(0x120)]>0x0)_0x17fd07[_0x5c2d54(0xf4)]=_0x295673[0x0];}return _0x17fd07;}function mergeIsolated(_0xb78d86){const _0x7dd932=a205_0x2055cb,_0x567f5b={..._0xb78d86};delete _0x567f5b[_0x7dd932(0x11b)];const _0x5770df=_0xb78d86[_0x7dd932(0xf8)]&&typeof _0xb78d86['apps']==='object'?_0xb78d86[_0x7dd932(0xf8)]:{};Object[_0x7dd932(0x100)](_0x5770df)[_0x7dd932(0x120)]>0x0?_0x567f5b['apps']=_0x5770df:delete _0x567f5b[_0x7dd932(0xf8)];if(_0x7dd932(0xf4)in _0xb78d86)_0x567f5b['defaultApp']=_0xb78d86['defaultApp'];else Object[_0x7dd932(0x100)](_0x5770df)['length']>0x0?_0x567f5b[_0x7dd932(0xf4)]=Object['keys'](_0x5770df)[0x0]:delete _0x567f5b[_0x7dd932(0xf4)];return _0x567f5b;}function mergeProjectFirst(_0x511b4b,_0x4328ac){const _0x599cd3=a205_0x2055cb,_0x48529d={..._0x4328ac};delete _0x48529d[_0x599cd3(0x11b)];for(const _0xc9ae73 of INHERIT_WHITELIST){!(_0xc9ae73 in _0x48529d)&&_0xc9ae73 in _0x511b4b&&(_0x48529d[_0xc9ae73]=_0x511b4b[_0xc9ae73]);}const _0x1f2050=_0x4328ac[_0x599cd3(0xf8)]&&typeof _0x4328ac[_0x599cd3(0xf8)]==='object'?_0x4328ac[_0x599cd3(0xf8)]:{};Object[_0x599cd3(0x100)](_0x1f2050)[_0x599cd3(0x120)]>0x0?_0x48529d[_0x599cd3(0xf8)]=_0x1f2050:delete _0x48529d[_0x599cd3(0xf8)];if(_0x599cd3(0xf4)in _0x4328ac)_0x48529d[_0x599cd3(0xf4)]=_0x4328ac[_0x599cd3(0xf4)];else Object[_0x599cd3(0x100)](_0x1f2050)['length']>0x0?_0x48529d['defaultApp']=Object['keys'](_0x1f2050)[0x0]:delete _0x48529d[_0x599cd3(0xf4)];return _0x48529d;}function mergeFullInherit(_0x4e5900,_0x924e6e){const _0x155048=a205_0x2055cb,_0x51f8d8=_0x4e5900[_0x155048(0xf8)]&&typeof _0x4e5900[_0x155048(0xf8)]===_0x155048(0xf9)?_0x4e5900[_0x155048(0xf8)]:{},_0x32737a=_0x924e6e[_0x155048(0xf8)]&&typeof _0x924e6e[_0x155048(0xf8)]===_0x155048(0xf9)?_0x924e6e[_0x155048(0xf8)]:{},_0x1d247b={..._0x51f8d8,..._0x32737a},_0xfd540e={..._0x4e5900,..._0x924e6e};delete _0xfd540e[_0x155048(0x11b)];if(Object[_0x155048(0x100)](_0x1d247b)[_0x155048(0x120)]>0x0)_0xfd540e[_0x155048(0xf8)]=_0x1d247b;if('defaultApp'in _0x924e6e)_0xfd540e['defaultApp']=_0x924e6e[_0x155048(0xf4)];else{if(Object[_0x155048(0x100)](_0x32737a)[_0x155048(0x120)]>0x0)_0xfd540e['defaultApp']=Object[_0x155048(0x100)](_0x32737a)[0x0];else{if(_0x4e5900[_0x155048(0xf4)])_0xfd540e[_0x155048(0xf4)]=_0x4e5900['defaultApp'];else{const _0x5f30a5=Object['keys'](_0x51f8d8);if(_0x5f30a5['length']>0x0)_0xfd540e[_0x155048(0xf4)]=_0x5f30a5[0x0];}}}return _0xfd540e;}export function readRawConfigWithLayers(_0x46ae17){const _0x30280c=loadRawConfigLayers(_0x46ae17);return{'config':mergeRawConfigLayers(_0x30280c),'layers':_0x30280c};}export function readRawConfig(_0x8146){return mergeRawConfigLayers(loadRawConfigLayers(_0x8146));}export function readConfigFile(_0x1e3178){const _0xf26b95=a205_0x2055cb;return parseAndNormalizeConfig(_0x1e3178,_0xf26b95(0x114));}export function writeConfigFile(_0x26c456,_0x2e4310){const _0x47924f=a205_0x2055cb,_0x1f164e=dirname(_0x26c456);!existsSync(_0x1f164e)&&mkdirSync(_0x1f164e,{'recursive':!![]});const _0x3734c2=_0x26c456+_0x47924f(0x122);try{writeFileSync(_0x3734c2,JSON[_0x47924f(0x10b)](_0x2e4310,null,0x2)+'\x0a',{'encoding':_0x47924f(0xff),'mode':0x180}),renameSync(_0x3734c2,_0x26c456);}catch(_0x429090){try{unlinkSync(_0x3734c2);}catch{}throw _0x429090;}}export function resolveWriteConfigPath(_0x9c7c72){const _0x2fe62d=_0x9c7c72==='project'?process['cwd']():homedir(),_0x101c55=resolveConfigPath(_0x2fe62d);return _0x101c55??resolve(_0x2fe62d,NEW_CONFIG_NAME);}
|
|
1
|
+
const a205_0x5173eb=a205_0xd2c8;(function(_0x4bc055,_0x2efa9b){const _0x1f1fc7=a205_0xd2c8,_0x1fa078=_0x4bc055();while(!![]){try{const _0x173022=-parseInt(_0x1f1fc7(0x133))/0x1*(parseInt(_0x1f1fc7(0x124))/0x2)+parseInt(_0x1f1fc7(0x10f))/0x3*(-parseInt(_0x1f1fc7(0x116))/0x4)+-parseInt(_0x1f1fc7(0x106))/0x5*(parseInt(_0x1f1fc7(0x112))/0x6)+-parseInt(_0x1f1fc7(0x128))/0x7*(parseInt(_0x1f1fc7(0x12f))/0x8)+parseInt(_0x1f1fc7(0x108))/0x9+-parseInt(_0x1f1fc7(0x12c))/0xa*(-parseInt(_0x1f1fc7(0x125))/0xb)+parseInt(_0x1f1fc7(0x111))/0xc;if(_0x173022===_0x2efa9b)break;else _0x1fa078['push'](_0x1fa078['shift']());}catch(_0x36e69e){_0x1fa078['push'](_0x1fa078['shift']());}}}(a205_0x5e9f,0xe4789));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=a205_0x5173eb(0x123);export const CONFIG_NAMES=['.rabetbase.json',a205_0x5173eb(0x12a),a205_0x5173eb(0x119)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a205_0x5173eb(0x113)](_0x4c8cac=>_0x4c8cac!==NEW_CONFIG_NAME);const normalizedWriteCache=new Map();export function resolveConfigPath(_0x5ac72f){for(const _0x1c1f16 of CONFIG_NAMES){const _0x44c660=resolve(_0x5ac72f,_0x1c1f16);if(existsSync(_0x44c660))return _0x44c660;}return undefined;}export function findProjectRootDirectory(_0x21c24b=process[a205_0x5173eb(0x115)]()){let _0x3372f7=resolve(_0x21c24b);const {root:_0x1771f2}=parse(_0x3372f7),_0x2ec49f=homedir();while(!![]){if(resolveConfigPath(_0x3372f7)){if(_0x3372f7===_0x2ec49f)break;return _0x3372f7;}if(_0x3372f7===_0x1771f2||_0x3372f7===_0x2ec49f)break;const _0x107665=dirname(_0x3372f7);if(_0x107665===_0x3372f7)break;_0x3372f7=_0x107665;}return resolve(_0x21c24b);}function a205_0xd2c8(_0x43cf31,_0x496e56){_0x43cf31=_0x43cf31-0x100;const _0x5e9fdc=a205_0x5e9f();let _0xd2c895=_0x5e9fdc[_0x43cf31];return _0xd2c895;}export function getProjectConfigPath(){const _0xec550d=a205_0x5173eb;return resolveConfigPath(process[_0xec550d(0x115)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x9021fa){const _0x3fc05b=a205_0x5173eb;if(!existsSync(_0x9021fa))return{'status':_0x3fc05b(0x11a)};try{const _0x5e024b=readFileSync(_0x9021fa,{'encoding':'utf8'});if(!_0x5e024b?.[_0x3fc05b(0x130)]())return{'status':_0x3fc05b(0x134)};const _0x25d64c=JSON[_0x3fc05b(0x129)](_0x5e024b);return{'status':'ok','data':_0x25d64c};}catch(_0x49aa10){return{'status':_0x3fc05b(0x11f),'message':_0x49aa10 instanceof Error?_0x49aa10[_0x3fc05b(0x132)]:String(_0x49aa10)};}}function parseCliConfigJsonFile(_0x176c0e,_0x54742c,_0x31de28){const _0x698a04=a205_0x5173eb,_0x1cd79b=inspectCliConfigJsonFile(_0x176c0e);if(_0x1cd79b[_0x698a04(0x11b)]===_0x698a04(0x11a)||_0x1cd79b[_0x698a04(0x11b)]===_0x698a04(0x134))return{};if(_0x1cd79b[_0x698a04(0x11b)]==='ok')return _0x1cd79b['data'];return _0x54742c===_0x698a04(0x12e)&&_0x31de28&&console[_0x698a04(0x11f)](CLI_BIN_NAME+':\x20'+_0x31de28+_0x698a04(0x107)+_0x176c0e+_0x698a04(0x10d)+_0x1cd79b[_0x698a04(0x132)]),{};}function normalizeLegacyConfigShape(_0x79c830){const _0x3faea4=a205_0x5173eb;if(!_0x79c830||typeof _0x79c830!==_0x3faea4(0x126))return{'config':{},'migrated':![]};const _0x26d228={..._0x79c830},_0x513e38=_0x26d228[_0x3faea4(0x105)]&&typeof _0x26d228[_0x3faea4(0x105)]==='object'?{..._0x26d228[_0x3faea4(0x105)]}:{},_0x5162e4=Object[_0x3faea4(0x118)](_0x513e38)[_0x3faea4(0x11d)],_0x2ce5b5=_0x26d228[_0x3faea4(0x120)]||_0x26d228[_0x3faea4(0x109)];let _0x55bab3=![];if(_0x2ce5b5&&_0x5162e4===0x0){const _0x2d1feb=typeof _0x26d228['defaultApp']===_0x3faea4(0x103)&&_0x26d228[_0x3faea4(0x10e)][_0x3faea4(0x130)]()?_0x26d228['defaultApp']:String(_0x2ce5b5)[_0x3faea4(0x130)]();_0x513e38[_0x2d1feb]={'appcode':String(_0x2ce5b5)[_0x3faea4(0x130)](),..._0x26d228[_0x3faea4(0x10c)]!=null?{'env':_0x26d228[_0x3faea4(0x10c)]}:{},..._0x26d228[_0x3faea4(0x127)]!=null?{'apiDir':_0x26d228['apiDir']}:{},..._0x26d228[_0x3faea4(0x102)]!=null?{'cookie':_0x26d228[_0x3faea4(0x102)]}:{},..._0x26d228['accessKey']!=null?{'accessKey':_0x26d228['accessKey']}:{},..._0x26d228['format']!=null?{'format':_0x26d228[_0x3faea4(0x12b)]}:{},..._0x26d228[_0x3faea4(0x131)]!=null?{'pageSize':_0x26d228[_0x3faea4(0x131)]}:{},..._0x26d228[_0x3faea4(0x11c)]!=null?{'riskLevel':_0x26d228[_0x3faea4(0x11c)]}:{},..._0x26d228[_0x3faea4(0x121)]!=null?{'locale':_0x26d228[_0x3faea4(0x121)]}:{}},_0x26d228['apps']=_0x513e38;if(!_0x26d228[_0x3faea4(0x10e)])_0x26d228['defaultApp']=_0x2d1feb;_0x55bab3=!![];}return(_0x3faea4(0x120)in _0x26d228||_0x3faea4(0x109)in _0x26d228)&&(delete _0x26d228[_0x3faea4(0x120)],delete _0x26d228[_0x3faea4(0x109)],_0x55bab3=!![]),{'config':_0x26d228,'migrated':_0x55bab3};}function writeNormalizedConfigIfNeeded(_0x37d4b9,_0x277c96){const _0x37bbda=a205_0x5173eb,_0x6f6b38=JSON[_0x37bbda(0x10b)](_0x277c96,null,0x2)+'\x0a';if(normalizedWriteCache[_0x37bbda(0x11e)](_0x37d4b9)===_0x6f6b38)return;writeConfigFile(_0x37d4b9,_0x277c96),normalizedWriteCache[_0x37bbda(0x110)](_0x37d4b9,_0x6f6b38);}function parseAndNormalizeConfig(_0x5c0187,_0x4001ed,_0x29e3ee){const _0x1b5ab2=a205_0x5173eb,_0x14efd9=parseCliConfigJsonFile(_0x5c0187,_0x4001ed,_0x29e3ee),_0x4b8020=normalizeLegacyConfigShape(_0x14efd9);if(_0x4b8020[_0x1b5ab2(0x114)])try{writeNormalizedConfigIfNeeded(_0x5c0187,_0x4b8020['config']);}catch{}return _0x4b8020['config'];}export function loadRawConfigLayers(_0x5c3bfd){const _0x2653b0=a205_0x5173eb;let _0x551e95={},_0x2137b7={};const _0x33e57d=resolveConfigPath(homedir());_0x33e57d&&(_0x551e95=parseAndNormalizeConfig(_0x33e57d,'warn',_0x2653b0(0x104)));const _0x4d1d69=_0x5c3bfd??findProjectRootDirectory(),_0x5bb4e6=resolveConfigPath(_0x4d1d69);return _0x5bb4e6&&(_0x2137b7=parseAndNormalizeConfig(_0x5bb4e6,_0x2653b0(0x12e),_0x2653b0(0x122))),{'globalPath':_0x33e57d,'projectPath':_0x5bb4e6,'globalConfig':_0x551e95,'projectConfig':_0x2137b7};}const INHERIT_WHITELIST=['cookie',a205_0x5173eb(0x117),a205_0x5173eb(0x121),a205_0x5173eb(0x12b),a205_0x5173eb(0x11c),a205_0x5173eb(0x131)];export function mergeRawConfigLayers(_0x280e09){const _0x371621=a205_0x5173eb,{globalConfig:_0x59fea5,projectConfig:_0x31713e}=_0x280e09,_0x40038d=Object[_0x371621(0x118)](_0x31713e)[_0x371621(0x11d)]>0x0;if(!_0x40038d)return mergeGlobalOnly(_0x59fea5);if(_0x31713e[_0x371621(0x12d)]===!![])return mergeFullInherit(_0x59fea5,_0x31713e);if(_0x31713e['inherit']===![])return mergeIsolated(_0x31713e);return mergeProjectFirst(_0x59fea5,_0x31713e);}function mergeGlobalOnly(_0x177cda){const _0x39581f=a205_0x5173eb,_0x3c5aa8={..._0x177cda},_0x197cbd=_0x177cda[_0x39581f(0x105)]&&typeof _0x177cda['apps']===_0x39581f(0x126)?_0x177cda[_0x39581f(0x105)]:{};if(Object[_0x39581f(0x118)](_0x197cbd)[_0x39581f(0x11d)]>0x0)_0x3c5aa8[_0x39581f(0x105)]=_0x197cbd;if(_0x177cda[_0x39581f(0x10e)])_0x3c5aa8['defaultApp']=_0x177cda[_0x39581f(0x10e)];else{const _0x1051e5=Object[_0x39581f(0x118)](_0x197cbd);if(_0x1051e5[_0x39581f(0x11d)]>0x0)_0x3c5aa8['defaultApp']=_0x1051e5[0x0];}return _0x3c5aa8;}function mergeIsolated(_0x283629){const _0x33dc18=a205_0x5173eb,_0x29a1ab={..._0x283629};delete _0x29a1ab[_0x33dc18(0x12d)];const _0x4cc473=_0x283629[_0x33dc18(0x105)]&&typeof _0x283629[_0x33dc18(0x105)]===_0x33dc18(0x126)?_0x283629[_0x33dc18(0x105)]:{};Object['keys'](_0x4cc473)['length']>0x0?_0x29a1ab[_0x33dc18(0x105)]=_0x4cc473:delete _0x29a1ab[_0x33dc18(0x105)];if('defaultApp'in _0x283629)_0x29a1ab[_0x33dc18(0x10e)]=_0x283629[_0x33dc18(0x10e)];else Object['keys'](_0x4cc473)[_0x33dc18(0x11d)]>0x0?_0x29a1ab[_0x33dc18(0x10e)]=Object[_0x33dc18(0x118)](_0x4cc473)[0x0]:delete _0x29a1ab['defaultApp'];return _0x29a1ab;}function mergeProjectFirst(_0x51e000,_0x47b8c5){const _0x4bd387=a205_0x5173eb,_0x47721a={..._0x47b8c5};delete _0x47721a[_0x4bd387(0x12d)];for(const _0x2ff370 of INHERIT_WHITELIST){!(_0x2ff370 in _0x47721a)&&_0x2ff370 in _0x51e000&&(_0x47721a[_0x2ff370]=_0x51e000[_0x2ff370]);}const _0x2ea598=_0x47b8c5[_0x4bd387(0x105)]&&typeof _0x47b8c5['apps']===_0x4bd387(0x126)?_0x47b8c5[_0x4bd387(0x105)]:{};Object[_0x4bd387(0x118)](_0x2ea598)['length']>0x0?_0x47721a[_0x4bd387(0x105)]=_0x2ea598:delete _0x47721a['apps'];if(_0x4bd387(0x10e)in _0x47b8c5)_0x47721a[_0x4bd387(0x10e)]=_0x47b8c5['defaultApp'];else Object[_0x4bd387(0x118)](_0x2ea598)[_0x4bd387(0x11d)]>0x0?_0x47721a[_0x4bd387(0x10e)]=Object[_0x4bd387(0x118)](_0x2ea598)[0x0]:delete _0x47721a[_0x4bd387(0x10e)];return _0x47721a;}function mergeFullInherit(_0x2dc5ae,_0x12547d){const _0x1b47b9=a205_0x5173eb,_0x3c39db=_0x2dc5ae[_0x1b47b9(0x105)]&&typeof _0x2dc5ae[_0x1b47b9(0x105)]===_0x1b47b9(0x126)?_0x2dc5ae['apps']:{},_0x391899=_0x12547d['apps']&&typeof _0x12547d[_0x1b47b9(0x105)]==='object'?_0x12547d[_0x1b47b9(0x105)]:{},_0x184f2a={..._0x3c39db,..._0x391899},_0x50de07={..._0x2dc5ae,..._0x12547d};delete _0x50de07[_0x1b47b9(0x12d)];if(Object['keys'](_0x184f2a)[_0x1b47b9(0x11d)]>0x0)_0x50de07['apps']=_0x184f2a;if('defaultApp'in _0x12547d)_0x50de07[_0x1b47b9(0x10e)]=_0x12547d['defaultApp'];else{if(Object[_0x1b47b9(0x118)](_0x391899)['length']>0x0)_0x50de07['defaultApp']=Object[_0x1b47b9(0x118)](_0x391899)[0x0];else{if(_0x2dc5ae[_0x1b47b9(0x10e)])_0x50de07[_0x1b47b9(0x10e)]=_0x2dc5ae[_0x1b47b9(0x10e)];else{const _0x37dabe=Object['keys'](_0x3c39db);if(_0x37dabe[_0x1b47b9(0x11d)]>0x0)_0x50de07['defaultApp']=_0x37dabe[0x0];}}}return _0x50de07;}export function readRawConfigWithLayers(_0x442025){const _0x4b4a50=loadRawConfigLayers(_0x442025);return{'config':mergeRawConfigLayers(_0x4b4a50),'layers':_0x4b4a50};}export function readRawConfig(_0x80449b){return mergeRawConfigLayers(loadRawConfigLayers(_0x80449b));}function a205_0x5e9f(){const _0x2f27ca=['apiDir','35HgSvnO','parse','.lovrabet.json','format','290hwyLqi','inherit','warn','1414024nNSKON','trim','pageSize','message','3AcelaZ','empty','utf8','silent','cookie','string','Global','apps','5axyvmk','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','405216WBajLa','app','.tmp','stringify','env','\x0a\x20\x20','defaultApp','984189ydfzxD','set','36552216hdNXWE','2560734WguisN','filter','migrated','cwd','12iykVCB','accessKey','keys','.lovrabetrc','missing','status','riskLevel','length','get','error','appcode','locale','Project','.rabetbase.json','498530tUFmEy','336567WvZGIK','object'];a205_0x5e9f=function(){return _0x2f27ca;};return a205_0x5e9f();}export function readConfigFile(_0x23e28f){const _0x35de5b=a205_0x5173eb;return parseAndNormalizeConfig(_0x23e28f,_0x35de5b(0x101));}export function writeConfigFile(_0x55ca60,_0x332843){const _0x196049=a205_0x5173eb,_0x247ac1=dirname(_0x55ca60);!existsSync(_0x247ac1)&&mkdirSync(_0x247ac1,{'recursive':!![]});const _0x337111=_0x55ca60+_0x196049(0x10a);try{writeFileSync(_0x337111,JSON[_0x196049(0x10b)](_0x332843,null,0x2)+'\x0a',{'encoding':_0x196049(0x100),'mode':0x180}),renameSync(_0x337111,_0x55ca60);}catch(_0x40448f){try{unlinkSync(_0x337111);}catch{}throw _0x40448f;}}export function resolveWriteConfigPath(_0x381efc){const _0x1a5f18=a205_0x5173eb,_0x24bfa9=_0x381efc==='project'?process[_0x1a5f18(0x115)]():homedir(),_0x488e0b=resolveConfigPath(_0x24bfa9);return _0x488e0b??resolve(_0x24bfa9,NEW_CONFIG_NAME);}
|
package/lib/context.d.ts
CHANGED
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xf42588,_0x21fce7){const _0x22fc22=a206_0x5036,_0x39e6ee=_0xf42588();while(!![]){try{const _0x4c3fb5=parseInt(_0x22fc22(0xdb))/0x1*(-parseInt(_0x22fc22(0xba))/0x2)+parseInt(_0x22fc22(0xc7))/0x3+-parseInt(_0x22fc22(0xbb))/0x4*(-parseInt(_0x22fc22(0xc3))/0x5)+parseInt(_0x22fc22(0xdc))/0x6+-parseInt(_0x22fc22(0xbf))/0x7*(parseInt(_0x22fc22(0xc8))/0x8)+-parseInt(_0x22fc22(0xdf))/0x9+parseInt(_0x22fc22(0xd0))/0xa*(-parseInt(_0x22fc22(0xd6))/0xb);if(_0x4c3fb5===_0x21fce7)break;else _0x39e6ee['push'](_0x39e6ee['shift']());}catch(_0x40399d){_0x39e6ee['push'](_0x39e6ee['shift']());}}}(a206_0x5d2f,0x80a19));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(_0x575eea){return process.env[`RABETBASE_${_0x575eea}`]||process.env[`LOVRABET_${_0x575eea}`]||undefined;}function optionalString(_0x3fab71){const _0x35111a=a206_0x5036;return typeof _0x3fab71===_0x35111a(0xc6)&&_0x3fab71[_0x35111a(0xc0)]()?_0x3fab71['trim']():undefined;}export async function createContext(_0x100b83){const _0x4cc707=a206_0x5036,{config:_0x25dfbc,layers:_0x34ef9b}=readRawConfigWithLayers(),_0x4aef48=buildConfig(_0x25dfbc,_0x100b83,_0x34ef9b);await initGlobalEnvironment(_0x4aef48);const {getUserDomain:_0xdaf11a,getApiDomain:_0x56c673}=await import('./constant/domain.js'),_0x96df08={'apiDomain':_0x56c673(),'userDomain':_0xdaf11a()},_0x3270c7=await buildAuth(_0x4aef48);logger[_0x4cc707(0xbe)](process['cwd']());const _0x34601e=(CLI_BIN_NAME+'\x20'+process[_0x4cc707(0xc1)][_0x4cc707(0xbc)](0x2)['join']('\x20'))[_0x4cc707(0xc0)]();logger[_0x4cc707(0xc4)](_0x34601e);const {isNonInteractive:_0x2917e3}=await import(_0x4cc707(0xe2)),_0x210390=_0x2917e3(_0x100b83);return{'config':_0x4aef48,'auth':_0x3270c7,'logger':logger,'env':_0x96df08,'nonInteractive':_0x210390};}export function buildConfigFromFlags(_0x29e6ca){const {config:_0x4e2038,layers:_0x1a6b5c}=readRawConfigWithLayers();return buildConfig(_0x4e2038,_0x29e6ca,_0x1a6b5c);}export async function initGlobalEnvironment(_0x41c741){const _0x15ceaf=a206_0x5036,{initEnv:_0x23ba6e}=await import(_0x15ceaf(0xcd));_0x23ba6e(_0x41c741['env']);const {initDomains:_0x3e6840}=await import('./constant/domain.js');_0x3e6840({'apiDomain':optionalString(_0x41c741[_0x15ceaf(0xda)]?.['apiDomain']),'userDomain':optionalString(_0x41c741[_0x15ceaf(0xda)]?.[_0x15ceaf(0xe3)]),'runtimeDomain':optionalString(_0x41c741['raw']?.['runtimeDomain'])});}export function getConfigAppCode(_0x52822f){const _0x23ee24=a206_0x5036,_0xf10936=readRawConfig(_0x52822f);if(_0xf10936['apps']&&typeof _0xf10936[_0x23ee24(0xe0)]==='object'){const _0x5d5d63=_0xf10936[_0x23ee24(0xe1)];if(_0x5d5d63&&_0xf10936[_0x23ee24(0xe0)][_0x5d5d63]?.[_0x23ee24(0xdd)])return String(_0xf10936['apps'][_0x5d5d63][_0x23ee24(0xdd)])['trim']();const _0x458b86=Object[_0x23ee24(0xd9)](_0xf10936[_0x23ee24(0xe0)])[0x0];if(_0x458b86?.[_0x23ee24(0xdd)])return String(_0x458b86[_0x23ee24(0xdd)])[_0x23ee24(0xc0)]();}const _0x593bc1=_0xf10936['appcode']||_0xf10936[_0x23ee24(0xc9)];if(typeof _0x593bc1!==_0x23ee24(0xc6)||_0x593bc1[_0x23ee24(0xc0)]()==='')return undefined;return _0x593bc1[_0x23ee24(0xc0)]();}export function getMultiAppConfigs(_0x284fec='project',_0x11ea0f){const _0x40d854=a206_0x5036,_0x26b72f=loadRawConfigLayers(_0x11ea0f);let _0x3e50d8,_0x548d51;if(_0x284fec===_0x40d854(0xc5)){const _0x538821=_0x26b72f[_0x40d854(0xd8)][_0x40d854(0xe0)]&&typeof _0x26b72f[_0x40d854(0xd8)][_0x40d854(0xe0)]===_0x40d854(0xd3)?_0x26b72f[_0x40d854(0xd8)]['apps']:{},_0x2ecd5f=_0x26b72f[_0x40d854(0xca)][_0x40d854(0xe0)]&&typeof _0x26b72f[_0x40d854(0xca)][_0x40d854(0xe0)]===_0x40d854(0xd3)?_0x26b72f[_0x40d854(0xca)]['apps']:{};_0x3e50d8={..._0x538821,..._0x2ecd5f};const _0x1ec6fb=readRawConfig(_0x11ea0f);_0x548d51=_0x1ec6fb[_0x40d854(0xe1)];}else _0x3e50d8=_0x26b72f[_0x40d854(0xca)]['apps'],_0x548d51=_0x26b72f[_0x40d854(0xca)][_0x40d854(0xe1)];if(!_0x3e50d8||typeof _0x3e50d8!==_0x40d854(0xd3)||Object[_0x40d854(0xcb)](_0x3e50d8)[_0x40d854(0xd1)]===0x0)return null;return Object[_0x40d854(0xd4)](_0x3e50d8)[_0x40d854(0xd2)](([_0x375476,_0x370975])=>({'name':_0x375476,'appcode':_0x370975?.[_0x40d854(0xdd)]||'','isDefault':_0x375476===_0x548d51,'env':_0x370975?.[_0x40d854(0xc2)],'apiDir':_0x370975?.['apiDir'],'cookie':_0x370975?.[_0x40d854(0xce)]||undefined}))['filter'](_0x42bb96=>_0x42bb96['appcode']);}function a206_0x5d2f(){const _0x178a9b=['raw','73WKCrMR','5446464sKhShB','appcode','template_base_url','6587919BQRzwF','apps','defaultApp','./utils/is-non-interactive.js','userDomain','19786SfUuBa','4AmYAuM','slice','cwd','setLogPath','7SOTSRU','trim','argv','env','4894780vyhutW','setRawCommand','merged','string','1789512zJvNxt','2372728SFxsTE','app','projectConfig','keys','-api.ts','./constant/env.js','cookie','https://g.lovrabet.com/dist/lovrabet-skill','900YTcWOY','length','map','object','entries','replace','25124dVNzQP','apiDir','globalConfig','values'];a206_0x5d2f=function(){return _0x178a9b;};return a206_0x5d2f();}export function getTemplateBaseUrl(_0x372f9b){const _0x2f93c4=a206_0x5036,_0x5e1d9b=readRawConfig(_0x372f9b);if(_0x5e1d9b[_0x2f93c4(0xde)]&&typeof _0x5e1d9b[_0x2f93c4(0xde)]===_0x2f93c4(0xc6))return _0x5e1d9b[_0x2f93c4(0xde)][_0x2f93c4(0xd5)](/\/$/,'');return _0x2f93c4(0xcf);}function buildConfig(_0x4ee4e7,_0x31ff5c,_0x2db239){return{...resolveAppConfig({'raw':_0x4ee4e7,'flags':_0x31ff5c,'layers':_0x2db239,'readEnv':env}),'raw':_0x4ee4e7};}function a206_0x5036(_0x38698a,_0x3f67c2){_0x38698a=_0x38698a-0xba;const _0x5d2f3f=a206_0x5d2f();let _0x503683=_0x5d2f3f[_0x38698a];return _0x503683;}export function resolveApiFilePath(_0x3b8606,_0x310130){const _0x411077=a206_0x5036,_0x13546e=resolve(process[_0x411077(0xbd)](),_0x3b8606),_0x51e071=resolve(_0x13546e,'api.ts');if(!_0x310130)return _0x51e071;const _0x370668=readRawConfig(),_0x2bda53=_0x370668['apps']&&typeof _0x370668[_0x411077(0xe0)]===_0x411077(0xd3)?_0x370668[_0x411077(0xe0)]:{},_0x5a2ea7=Object[_0x411077(0xd4)](_0x2bda53)['find'](([,_0x54d9db])=>_0x54d9db?.[_0x411077(0xdd)]===_0x310130);if(!_0x5a2ea7)return _0x51e071;const [_0x5bf382,_0x4544f5]=_0x5a2ea7,_0x172d32=typeof _0x370668[_0x411077(0xe1)]===_0x411077(0xc6)?_0x370668[_0x411077(0xe1)]:undefined;if(_0x4544f5?.[_0x411077(0xd7)])return _0x51e071;if(_0x172d32&&_0x5bf382!==_0x172d32)return resolve(_0x13546e,_0x5bf382+_0x411077(0xcc));return _0x51e071;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x24bf44,_0x59a197){const _0x3aedfd=a207_0x3ec7,_0x20b48e=_0x24bf44();while(!![]){try{const _0x276bf2=-parseInt(_0x3aedfd(0xa5))/0x1+-parseInt(_0x3aedfd(0xaf))/0x2*(-parseInt(_0x3aedfd(0xac))/0x3)+-parseInt(_0x3aedfd(0xb3))/0x4+-parseInt(_0x3aedfd(0xad))/0x5+-parseInt(_0x3aedfd(0xa9))/0x6+-parseInt(_0x3aedfd(0xb0))/0x7*(-parseInt(_0x3aedfd(0xa7))/0x8)+parseInt(_0x3aedfd(0xa4))/0x9;if(_0x276bf2===_0x59a197)break;else _0x20b48e['push'](_0x20b48e['shift']());}catch(_0x83e7d4){_0x20b48e['push'](_0x20b48e['shift']());}}}(a207_0x5093,0x2a75c));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x26e700){const _0x44a672=a207_0x3ec7,_0x499d28=[],_0x23d8f5=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x6c373e;while((_0x6c373e=_0x23d8f5['exec'](_0x26e700))!==null){_0x499d28[_0x44a672(0xab)]({'datasetCode':_0x6c373e[0x1],'tableName':_0x6c373e[0x2],'name':_0x6c373e[0x3],'alias':_0x6c373e[0x4]});}return _0x499d28;}function a207_0x3ec7(_0x1ec3ba,_0xbc36d8){_0x1ec3ba=_0x1ec3ba-0xa3;const _0x509343=a207_0x5093();let _0x3ec701=_0x509343[_0x1ec3ba];return _0x3ec701;}export function loadAliasMap(_0x429308,_0x557c9f,_0x2dac39){const _0x481c13=a207_0x3ec7,_0x5a20af=_0x2dac39??resolve(process['cwd'](),_0x429308,_0x481c13(0xb2));if(cache[_0x481c13(0xaa)](_0x5a20af))return cache[_0x481c13(0xa6)](_0x5a20af);if(!existsSync(_0x5a20af))return cache[_0x481c13(0xa3)](_0x5a20af,[]),[];try{const _0x120306=readFileSync(_0x5a20af,_0x481c13(0xb1)),_0xee9760=parseApiFile(_0x120306);return cache[_0x481c13(0xa3)](_0x5a20af,_0xee9760),_0xee9760;}catch{return cache[_0x481c13(0xa3)](_0x5a20af,[]),[];}}export function resolveAlias(_0x20958a,_0x4097c6,_0x248202,_0x7f5ae7){const _0x291406=a207_0x3ec7;if(!_0x4097c6)return undefined;const _0x8bcead=loadAliasMap(_0x20958a,_0x248202,_0x7f5ae7),_0x5bba0a=_0x8bcead[_0x291406(0xae)](_0x5d2d4a=>_0x5d2d4a['alias']===_0x4097c6);return _0x5bba0a?.[_0x291406(0xa8)];}function a207_0x5093(){const _0x1d0e2f=['8RmaztP','5803XJvRwm','utf-8','api.ts','1107280wDWuCT','set','5054697pxvMwF','347792yaIxDR','get','872Kjvgok','datasetCode','85776lVupzF','has','push','134598shPapt','93170njqMWZ','find'];a207_0x5093=function(){return _0x1d0e2f;};return a207_0x5093();}export function listAliases(_0xd68588,_0x2578e5,_0x3a5013){return loadAliasMap(_0xd68588,_0x2578e5,_0x3a5013);}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a208_0x958b7=a208_0x1894;(function(_0x419833,_0xbadf4b){const _0x1ba3e1=a208_0x1894,_0x16aae2=_0x419833();while(!![]){try{const _0x257a56=parseInt(_0x1ba3e1(0x125))/0x1*(-parseInt(_0x1ba3e1(0x130))/0x2)+parseInt(_0x1ba3e1(0x188))/0x3+parseInt(_0x1ba3e1(0x1b4))/0x4*(parseInt(_0x1ba3e1(0x204))/0x5)+-parseInt(_0x1ba3e1(0x16b))/0x6+parseInt(_0x1ba3e1(0x1fc))/0x7*(-parseInt(_0x1ba3e1(0x1d2))/0x8)+parseInt(_0x1ba3e1(0x11b))/0x9*(parseInt(_0x1ba3e1(0x15b))/0xa)+parseInt(_0x1ba3e1(0x193))/0xb;if(_0x257a56===_0xbadf4b)break;else _0x16aae2['push'](_0x16aae2['shift']());}catch(_0x30754b){_0x16aae2['push'](_0x16aae2['shift']());}}}(a208_0x25a2,0x85f31));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(_0x20cd16){_activeCookie=_0x20cd16||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x57e40,PLATFORM_TRANSPORT_FAILURE=Symbol(a208_0x958b7(0x14f)),PLATFORM_ERROR_CODE=Symbol(a208_0x958b7(0x21e));export function isPlatformTransportFailure(_0x2a597f){const _0x450ac1=a208_0x958b7;return Boolean(_0x2a597f&&typeof _0x2a597f===_0x450ac1(0x1bb)&&_0x2a597f[PLATFORM_TRANSPORT_FAILURE]===!![]);}export function getPlatformErrorCode(_0x154312){const _0x5e4bad=a208_0x958b7;if(!_0x154312||typeof _0x154312!=='object')return undefined;const _0x89c68c=_0x154312[PLATFORM_ERROR_CODE];return typeof _0x89c68c===_0x5e4bad(0x14a)&&_0x89c68c?_0x89c68c:undefined;}function a208_0x1894(_0x4b47b4,_0x20fdfa){_0x4b47b4=_0x4b47b4-0x11a;const _0x25a220=a208_0x25a2();let _0x189404=_0x25a220[_0x4b47b4];return _0x189404;}function createPlatformApiError(_0x14c825,_0x3a859f){const _0x85baa5=a208_0x958b7,_0x45b00c=typeof _0x3a859f===_0x85baa5(0x14a)?_0x3a859f[_0x85baa5(0x1dc)]():typeof _0x3a859f==='number'?String(_0x3a859f):'',_0x321892=CliErrors[_0x85baa5(0x22b)](_0x14c825,_0x45b00c?_0x85baa5(0x200)+_0x45b00c:undefined);return _0x45b00c&&(Object[_0x85baa5(0x11a)](_0x321892,PLATFORM_ERROR_CODE,{'value':_0x45b00c}),Object['defineProperty'](_0x321892,'data',{'value':{'remoteErrorCode':_0x45b00c},'enumerable':![]})),_0x321892;}function createFetchFailureError(_0x168e79,_0x223fc5){const _0x24c39e=a208_0x958b7,_0x39638b=_0x223fc5 instanceof Error?_0x223fc5[_0x24c39e(0x181)]:String(_0x223fc5),_0x6977aa=CliErrors['apiError']('Request\x20failed:\x20'+_0x168e79+(_0x39638b?'\x20('+_0x39638b+')':''),_0x24c39e(0x173));return Object[_0x24c39e(0x11a)](_0x6977aa,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x6977aa;}function createIndeterminateResponseError(_0xb6e5d7){const _0x2f64a4=a208_0x958b7,_0x1b9dc4=CliErrors[_0x2f64a4(0x22b)](_0xb6e5d7+_0x2f64a4(0x171),_0x2f64a4(0x134));return Object[_0x2f64a4(0x11a)](_0x1b9dc4,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x1b9dc4;}async function apiRequest(_0x78aae7,_0x51f1d9={}){const _0x54e547=a208_0x958b7,{method:method=_0x54e547(0x224),body:_0x4d969f,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x51f1d9,_0x34352e=useRuntime?getRuntimeDomain():getApiDomain(),_0x44ae18=_activeCookie||getCookie(),_0x4c054d=''+_0x34352e+_0x78aae7,_0x420219=new AbortController(),_0x2ce625=setTimeout(()=>_0x420219['abort'](),timeout);try{const _0x145411=await fetch(_0x4c054d,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x44ae18,'X-Invoke-Source':_0x54e547(0x1c4),...headers},'body':_0x4d969f?JSON[_0x54e547(0x11d)](_0x4d969f):undefined,'signal':_0x420219[_0x54e547(0x1d0)]});let _0x5b8139;try{_0x5b8139=await _0x145411['json']();}catch(_0x2bbc6e){if(_0x2bbc6e instanceof Error&&_0x2bbc6e[_0x54e547(0x1c8)]==='AbortError')throw CliErrors[_0x54e547(0x22b)](_0x54e547(0x21d)+_0x4c054d);if(_0x145411['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError']('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x145411[_0x54e547(0x1bd)]+')',_0x145411[_0x54e547(0x1bd)]>=0x190?_0x54e547(0x1e7):undefined);}if(!_0x145411['ok']||_0x5b8139[_0x54e547(0x210)]===![])throw CliErrors[_0x54e547(0x22b)](_0x5b8139[_0x54e547(0x218)]||_0x5b8139['message']||_0x54e547(0x1cb)+_0x145411[_0x54e547(0x1bd)],_0x5b8139[_0x54e547(0x192)]?_0x54e547(0x200)+_0x5b8139[_0x54e547(0x192)]:undefined);return _0x5b8139;}catch(_0xee09dd){if(_0xee09dd instanceof CliError)throw _0xee09dd;if(_0xee09dd instanceof Error&&_0xee09dd['name']===_0x54e547(0x14e))throw CliErrors[_0x54e547(0x22b)](_0x54e547(0x21d)+_0x4c054d);throw createFetchFailureError(_0x4c054d,_0xee09dd);}finally{clearTimeout(_0x2ce625);}}async function apiFormRequest(_0x5ed08e,_0x161cb4,_0x123a13={}){const _0x3b7478=a208_0x958b7,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x123a13,_0x43efd9=_activeCookie||getCookie(),_0x2d86a0=''+getApiDomain()+_0x5ed08e,_0x57f39b=new AbortController(),_0xe51231=setTimeout(()=>_0x57f39b[_0x3b7478(0x126)](),timeout);try{const _0x1c638d=await fetch(_0x2d86a0,{'method':'POST','headers':{'Cookie':_0x43efd9,'X-Invoke-Source':_0x3b7478(0x1c4)},'body':_0x161cb4,'signal':_0x57f39b[_0x3b7478(0x1d0)]});let _0x18ae03;try{_0x18ae03=await _0x1c638d[_0x3b7478(0x150)]();}catch(_0x49dc1c){if(_0x49dc1c instanceof Error&&_0x49dc1c[_0x3b7478(0x1c8)]===_0x3b7478(0x14e))throw CliErrors[_0x3b7478(0x22b)](_0x3b7478(0x21d)+_0x2d86a0);throw CliErrors['apiError']('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x1c638d['status']+')',_0x1c638d[_0x3b7478(0x1bd)]>=0x190?_0x3b7478(0x1e7):undefined);}if(!_0x1c638d['ok']||_0x18ae03[_0x3b7478(0x210)]===![])throw CliErrors[_0x3b7478(0x22b)](_0x18ae03['errorMsg']||_0x18ae03[_0x3b7478(0x181)]||_0x3b7478(0x1cb)+_0x1c638d[_0x3b7478(0x1bd)],_0x18ae03['errorCode']?_0x3b7478(0x200)+_0x18ae03[_0x3b7478(0x192)]:undefined);return _0x18ae03;}catch(_0x13cb4b){if(_0x13cb4b instanceof CliError)throw _0x13cb4b;if(_0x13cb4b instanceof Error&&_0x13cb4b[_0x3b7478(0x1c8)]===_0x3b7478(0x14e))throw CliErrors[_0x3b7478(0x22b)](_0x3b7478(0x21d)+_0x2d86a0);throw createFetchFailureError(_0x2d86a0,_0x13cb4b);}finally{clearTimeout(_0xe51231);}}export async function uploadDevelopmentFile(_0x38dd4b,_0x214024){const _0x41766d=a208_0x958b7,_0x3990aa=await readFile(_0x214024),_0x5746ba=new FormData();_0x5746ba[_0x41766d(0x168)](_0x41766d(0x1cc),_0x38dd4b),_0x5746ba[_0x41766d(0x168)]('file',new Blob([new Uint8Array(_0x3990aa)]),basename(_0x214024));const _0x42c4d3=await apiFormRequest(_0x41766d(0x139),_0x5746ba);return _0x42c4d3[_0x41766d(0x178)];}export async function queryDevelopmentFileUrl(_0x470591,_0x3fc366={}){const _0xe7b667=a208_0x958b7,_0xe9521c=await apiRequest('/smartapi/common/queryFileUrl',{'method':'POST','body':{'filePath':_0x470591,'downloadFlag':_0x3fc366[_0xe7b667(0x179)]??![],..._0x3fc366[_0xe7b667(0x1f2)]?{'longTerm':!![]}:{}}});return _0xe9521c[_0xe7b667(0x178)];}export async function recognizeDevelopmentOcr(_0xaa2024,_0x26ebbe){const _0x32afa9=a208_0x958b7,_0x4e5d10=new URLSearchParams({'url':_0x26ebbe[_0x32afa9(0x16a)],'type':_0x26ebbe[_0x32afa9(0x15f)],'appCode':_0xaa2024}),_0x2c9cb4=await apiRequest(_0x32afa9(0x1ea)+_0x4e5d10[_0x32afa9(0x1b7)](),{'method':_0x32afa9(0x224)});return _0x2c9cb4[_0x32afa9(0x178)];}function isAuthFailure(_0x1182f2){const _0x3349ff=a208_0x958b7,_0x77c8ca=_0x1182f2[_0x3349ff(0x218)]||_0x1182f2[_0x3349ff(0x181)]||_0x1182f2[_0x3349ff(0x178)]?.[_0x3349ff(0x181)]||_0x1182f2[_0x3349ff(0x1af)]||_0x1182f2[_0x3349ff(0x15a)]||'';return _0x1182f2[_0x3349ff(0x192)]==='UNAUTHORIZED'||_0x1182f2['code']===0x191||_0x1182f2[_0x3349ff(0x18e)]===_0x3349ff(0x225)||_0x77c8ca['includes']('401')||_0x77c8ca[_0x3349ff(0x1ed)]('Unauthorized')||_0x77c8ca[_0x3349ff(0x1ed)]('登录')||_0x77c8ca[_0x3349ff(0x1ed)]('认证');}export async function platformFetch(_0x7ceffd,_0x4a9789){const _0x4717eb=a208_0x958b7;let _0xaac0c;try{_0xaac0c=await fetch(_0x7ceffd,{'method':_0x4a9789[_0x4717eb(0x1f8)]??_0x4717eb(0x224),'headers':{'Content-Type':'application/json','Cookie':_0x4a9789[_0x4717eb(0x1bf)],'X-Invoke-Source':_0x4717eb(0x1c4)},..._0x4a9789['body']&&{'body':JSON[_0x4717eb(0x11d)](_0x4a9789[_0x4717eb(0x1f1)])}});}catch(_0x48043a){throw createFetchFailureError(_0x7ceffd,_0x48043a);}let _0x42fdfb;try{_0x42fdfb=await _0xaac0c[_0x4717eb(0x150)]();}catch(_0x5520c0){if(!_0xaac0c['ok']){if(_0xaac0c['status']===0x191)throw CliErrors[_0x4717eb(0x1a0)]();throw CliErrors['apiError'](_0x4a9789[_0x4717eb(0x18f)]+_0x4717eb(0x145)+_0xaac0c[_0x4717eb(0x1bd)]);}throw createFetchFailureError(_0x7ceffd,_0x5520c0);}if(_0x42fdfb===null||typeof _0x42fdfb!==_0x4717eb(0x1bb)||Array['isArray'](_0x42fdfb)){if(_0xaac0c[_0x4717eb(0x1bd)]===0x191)throw CliErrors[_0x4717eb(0x1a0)]();if(_0xaac0c['ok'])throw createIndeterminateResponseError(_0x4a9789[_0x4717eb(0x18f)]);throw CliErrors['apiError'](_0x4a9789[_0x4717eb(0x18f)]+_0x4717eb(0x18b)+(!_0xaac0c['ok']?_0x4717eb(0x1ec)+_0xaac0c[_0x4717eb(0x1bd)]:'')+_0x4717eb(0x1e3));}const _0x4289c2=typeof _0x42fdfb['errorCode']==='string'||typeof _0x42fdfb['errorCode']==='number',_0x1377a9=_0x4289c2?String(_0x42fdfb[_0x4717eb(0x192)])[_0x4717eb(0x1dc)]():'',_0x1a16e7=_0x42fdfb['success']===![]||_0x4289c2&&_0x1377a9!==_0x4717eb(0x1c9);if(!_0xaac0c['ok']||_0x1a16e7){if(_0xaac0c[_0x4717eb(0x1bd)]===0x191||isAuthFailure(_0x42fdfb))throw CliErrors[_0x4717eb(0x1a0)]();throw createPlatformApiError(_0x42fdfb[_0x4717eb(0x218)]||_0x42fdfb[_0x4717eb(0x181)]||_0x4a9789[_0x4717eb(0x18f)]+_0x4717eb(0x18b)+(!_0xaac0c['ok']?',\x20HTTP\x20'+_0xaac0c[_0x4717eb(0x1bd)]:''),_0x42fdfb['errorCode']??_0x42fdfb[_0x4717eb(0x18e)]);}if(_0x42fdfb[_0x4717eb(0x210)]!==!![]||_0x42fdfb[_0x4717eb(0x192)]!=='0000')throw createIndeterminateResponseError(_0x4a9789['label']);return _0x42fdfb[_0x4717eb(0x178)];}export async function platformRequest(_0x54c374,_0x84a272){const _0x85c8b8=a208_0x958b7;if(/^https?:\/\//i[_0x85c8b8(0x1f3)](_0x54c374))throw CliErrors['validation']('platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20'+_0x54c374,_0x85c8b8(0x1ac));const _0xa664ef=_0x54c374[_0x85c8b8(0x184)]('/')?_0x54c374:'/'+_0x54c374;return platformFetch(''+getApiDomain()+_0xa664ef,_0x84a272);}const MAX_KNOWLEDGE_BASE_PAGE_SIZE=0x64;function parseKnowledgeBaseInteger(_0x4c954b,_0x59943e){const _0x2b7217=a208_0x958b7,_0x44b918=typeof _0x4c954b==='number'?_0x4c954b:typeof _0x4c954b===_0x2b7217(0x14a)&&/^(0|[1-9]\d*)$/[_0x2b7217(0x1f3)](_0x4c954b)?Number(_0x4c954b):Number[_0x2b7217(0x12c)],_0x445538=Number[_0x2b7217(0x12a)](_0x44b918)&&(_0x59943e==='id'?_0x44b918>0x0:_0x44b918>=0x0);if(!_0x445538)throw CliErrors[_0x2b7217(0x22b)](_0x2b7217(0x216)+_0x59943e+'.');return _0x44b918;}function parseKnowledgeBaseText(_0x3688be,_0x594968){const _0x2d15b2=a208_0x958b7;if(typeof _0x3688be==='string'&&(_0x594968===_0x2d15b2(0x229)||_0x3688be['trim']()))return _0x3688be;throw CliErrors[_0x2d15b2(0x22b)](_0x2d15b2(0x203)+_0x594968+'.');}function parseKnowledgeBaseRecord(_0x269e33){const _0x3d9cd0=a208_0x958b7;if(!_0x269e33||typeof _0x269e33!=='object'||Array[_0x3d9cd0(0x127)](_0x269e33))throw CliErrors[_0x3d9cd0(0x22b)]('Knowledge-base\x20API\x20returned\x20an\x20invalid\x20record\x20contract.');const _0x26bf6e=_0x269e33;if(_0x26bf6e['scope']!==_0x3d9cd0(0x19f)&&_0x26bf6e['scope']!==_0x3d9cd0(0x1f7))throw CliErrors['apiError'](_0x3d9cd0(0x11c));const _0x4c384c={'id':parseKnowledgeBaseInteger(_0x26bf6e['id'],'id'),'scope':_0x26bf6e[_0x3d9cd0(0x1a1)],'appCode':parseKnowledgeBaseText(_0x26bf6e[_0x3d9cd0(0x1cc)],'appCode'),'title':parseKnowledgeBaseText(_0x26bf6e[_0x3d9cd0(0x164)],_0x3d9cd0(0x164)),'version':parseKnowledgeBaseInteger(_0x26bf6e[_0x3d9cd0(0x13c)],_0x3d9cd0(0x13c)),'content':parseKnowledgeBaseText(_0x26bf6e[_0x3d9cd0(0x229)],'content')};return(_0x26bf6e['createTime']===null||typeof _0x26bf6e[_0x3d9cd0(0x172)]===_0x3d9cd0(0x14a)||typeof _0x26bf6e['createTime']===_0x3d9cd0(0x1d7))&&(_0x4c384c[_0x3d9cd0(0x172)]=_0x26bf6e[_0x3d9cd0(0x172)]),(_0x26bf6e[_0x3d9cd0(0x149)]===null||typeof _0x26bf6e[_0x3d9cd0(0x149)]===_0x3d9cd0(0x14a)||typeof _0x26bf6e[_0x3d9cd0(0x149)]===_0x3d9cd0(0x1d7))&&(_0x4c384c[_0x3d9cd0(0x149)]=_0x26bf6e['updateTime']),_0x4c384c;}export async function listEnterpriseKnowledgeBases(_0x34f1ed,_0x48a6e2={}){const _0x451870=a208_0x958b7,_0x2166c8=_0x48a6e2['pageSize']??0x32;if(!Number[_0x451870(0x12a)](_0x2166c8)||_0x2166c8<0x1||_0x2166c8>MAX_KNOWLEDGE_BASE_PAGE_SIZE)throw CliErrors[_0x451870(0x11e)](_0x451870(0x22a)+MAX_KNOWLEDGE_BASE_PAGE_SIZE+'.');const _0x5937c1=await platformRequest(_0x451870(0x133),{'method':'POST','cookie':_0x34f1ed,'label':'List\x20enterprise\x20knowledge\x20bases','body':{'currentPage':_0x48a6e2['currentPage']??0x1,'pageSize':_0x2166c8,'scope':'company',..._0x48a6e2[_0x451870(0x1cc)]?{'appCode':_0x48a6e2[_0x451870(0x1cc)]}:{},..._0x48a6e2['title']?{'title':_0x48a6e2[_0x451870(0x164)]}:{}}});if(!_0x5937c1||typeof _0x5937c1!==_0x451870(0x1bb)||Array[_0x451870(0x127)](_0x5937c1)||!Array[_0x451870(0x127)](_0x5937c1[_0x451870(0x180)]))throw CliErrors[_0x451870(0x22b)](_0x451870(0x142));const _0x50f91b=extractPaging(_0x5937c1);if(!_0x50f91b||!Number['isInteger'](_0x50f91b[_0x451870(0x19a)])||!Number['isInteger'](_0x50f91b[_0x451870(0x137)])||!Number[_0x451870(0x158)](_0x50f91b[_0x451870(0x227)])||_0x50f91b[_0x451870(0x19a)]<0x1||_0x50f91b[_0x451870(0x137)]<0x1||_0x50f91b[_0x451870(0x137)]>MAX_KNOWLEDGE_BASE_PAGE_SIZE||_0x50f91b[_0x451870(0x227)]<0x0)throw CliErrors['apiError'](_0x451870(0x13e));return{'items':extractList(_0x5937c1)['map'](parseKnowledgeBaseRecord),'paging':_0x50f91b};}export async function getEnterpriseKnowledgeBase(_0x26c557,_0x152a65){const _0x32cc61=await platformRequest('/admin/knowledge-base/get-one'+buildQuery({'id':_0x152a65}),{'cookie':_0x26c557,'label':'Get\x20enterprise\x20knowledge\x20base'});return parseKnowledgeBaseRecord(_0x32cc61);}export async function createEnterpriseKnowledgeBase(_0x4ac139,_0x3a2ea7){const _0x18fdf4=a208_0x958b7,_0x40916a=await platformRequest('/admin/knowledge-base/create',{'method':'POST','cookie':_0x4ac139,'label':_0x18fdf4(0x21a),'body':{'scope':_0x18fdf4(0x19f),..._0x3a2ea7}});return parseKnowledgeBaseRecord(_0x40916a);}export async function updateEnterpriseKnowledgeBase(_0xdb2098,_0x5aab21){const _0x2c026b=a208_0x958b7;if(_0x5aab21[_0x2c026b(0x164)]===undefined&&_0x5aab21[_0x2c026b(0x229)]===undefined)throw CliErrors[_0x2c026b(0x11e)](_0x2c026b(0x1a7));const _0x39f300=await platformRequest(_0x2c026b(0x120),{'method':_0x2c026b(0x1fb),'cookie':_0xdb2098,'label':'Update\x20enterprise\x20knowledge\x20base','body':{'id':_0x5aab21['id'],..._0x5aab21['title']!==undefined?{'title':_0x5aab21[_0x2c026b(0x164)]}:{},..._0x5aab21[_0x2c026b(0x229)]!==undefined?{'content':_0x5aab21['content']}:{}}});return parseKnowledgeBaseRecord(_0x39f300);}export async function deleteEnterpriseKnowledgeBase(_0x54ee59,_0x2687b8){const _0x5e2c86=a208_0x958b7;await platformRequest(_0x5e2c86(0x1c5),{'method':_0x5e2c86(0x1fb),'cookie':_0x54ee59,'label':'Delete\x20enterprise\x20knowledge\x20base','body':{'id':_0x2687b8}});}function cleanNewlines(_0x31dc57){const _0x40cb50=a208_0x958b7;return _0x31dc57['replace'](/[\r\n]+/g,'\x20')[_0x40cb50(0x1dc)]();}function cleanDatasetName(_0x864550){if(!_0x864550['name'])return _0x864550;return{..._0x864550,'name':cleanNewlines(_0x864550['name'])};}export async function fetchModelList(_0x433c8a,_0x53637a){const _0x1e6218=a208_0x958b7,_0x2663bc=getEnv(),_0x415868=new URLSearchParams({'appcode':_0x433c8a,'otype':_0x1e6218(0x18a)}),_0x203403=_0x1e6218(0x136)+_0x415868['toString']();logger[_0x1e6218(0x185)]('fetch-model-list',_0x1e6218(0x1fa)+_0x2663bc+')',{'apiPath':_0x203403});const _0x53b616=await platformRequest(_0x203403,{'cookie':_0x53637a,'label':_0x1e6218(0x228)}),_0x550a69=(_0x53b616[_0x1e6218(0x17e)]??[])[_0x1e6218(0x221)](cleanDatasetName);return{'configArray':_0x550a69,'count':_0x550a69['length']};}export async function fetchDatasetDoc(_0x986621){const _0x19e111=a208_0x958b7,{appCode:_0x314341,cookie:_0xba43fa,datasetCode:_0x38c304,datasetId:_0x3736be,extraParams:_0x3ed8f5}=_0x986621,_0x3146ea=await platformRequest('/api/node-toolbox/api-doc-generator',{'method':'POST','body':{'appCode':_0x314341,'datasetCode':_0x38c304,'datasetId':_0x3736be,..._0x3ed8f5||{}},'cookie':_0xba43fa,'label':_0x19e111(0x1b6)+_0x38c304+')'});if(!_0x3146ea||typeof _0x3146ea[_0x19e111(0x143)]!==_0x19e111(0x14a))throw new Error(_0x19e111(0x190)+_0x38c304+_0x19e111(0x1d1));return _0x3146ea['markdown'];}export async function getMenuTree(_0x479059,_0x4a3ddc){const _0x1005ae=a208_0x958b7,_0x3667ce=new URLSearchParams({'appCode':_0x479059});return platformRequest('/smartapi/menu/find?'+_0x3667ce[_0x1005ae(0x1b7)](),{'cookie':_0x4a3ddc,'label':_0x1005ae(0x19c)});}export async function createMenuRecord(_0x3f8dcd,_0x49ea66,_0x51bd3d){const _0x4a7337=a208_0x958b7;return platformRequest(_0x4a7337(0x1f9),{'method':_0x4a7337(0x1fb),'body':_0x3f8dcd,'cookie':_0x49ea66,'label':_0x51bd3d});}export async function updateMenuRecord(_0x3e2941,_0x587aee,_0x3374d6){const _0x42a871=a208_0x958b7;return platformRequest(_0x42a871(0x226),{'method':_0x42a871(0x1fb),'body':_0x3e2941,'cookie':_0x587aee,'label':_0x3374d6});}export async function deleteMenuRecord(_0x5ce648,_0x1627f4,_0x1c025f){const _0x3fc5e5=a208_0x958b7;return platformRequest(_0x3fc5e5(0x197),{'method':_0x3fc5e5(0x1fb),'body':{'id':_0x5ce648},'cookie':_0x1627f4,'label':_0x1c025f});}export async function batchDeleteMenuRecords(_0x4660c0,_0x9e6757,_0x26752e){const _0x59d0cc=a208_0x958b7;return platformRequest(_0x59d0cc(0x1ff),{'method':_0x59d0cc(0x1fb),'body':{'idList':_0x4660c0},'cookie':_0x9e6757,'label':_0x26752e});}export async function startMenuRegroup(_0x2c2410,_0x6ed307,_0x276578){const _0x220d11=a208_0x958b7;return platformRequest(_0x220d11(0x1b9),{'method':_0x220d11(0x1fb),'body':_0x2c2410,'cookie':_0x6ed307,'label':_0x276578});}export async function getAsyncTaskStatus(_0x4c1175,_0x357709,_0x426e81){const _0x2d0fa4=a208_0x958b7,_0x26f383=new URLSearchParams({'appCode':_0x357709});return platformRequest(_0x2d0fa4(0x135)+encodeURIComponent(_0x4c1175)+'?'+_0x26f383['toString'](),{'cookie':_0x426e81,'label':'Fetch\x20async\x20task\x20'+_0x4c1175});}export async function listBffScripts(_0x2e948a,_0x2ecc4b,_0x54a33c){const _0x21d54e=a208_0x958b7;let _0x4e9467=_0x21d54e(0x217)+_0x2e948a;if(_0x2ecc4b)_0x4e9467+='&type='+_0x2ecc4b;const _0x52e393=await apiRequest(_0x4e9467);let _0x58ce01=extractList(_0x52e393[_0x21d54e(0x178)]);if(_0x54a33c?.[_0x21d54e(0x176)]){const _0x4f75b7=_0x54a33c[_0x21d54e(0x176)]['toLowerCase']();_0x58ce01=_0x58ce01[_0x21d54e(0x1dd)](_0x3a9a9f=>_0x3a9a9f[_0x21d54e(0x14c)]?.['toLowerCase']()[_0x21d54e(0x1ed)](_0x4f75b7)||_0x3a9a9f[_0x21d54e(0x121)]?.[_0x21d54e(0x1bc)]()[_0x21d54e(0x1ed)](_0x4f75b7));}return _0x58ce01;}export async function getBffScriptInfo(_0x12d022){const _0xc73585=a208_0x958b7,_0x271bb6=await apiRequest(_0xc73585(0x17c)+_0x12d022);if(!_0x271bb6[_0xc73585(0x178)])throw CliErrors[_0xc73585(0x11e)](_0xc73585(0x17d)+_0x12d022);return _0x271bb6[_0xc73585(0x178)];}export async function saveBffScript(_0x46f8b9){const _0x307c80=a208_0x958b7,_0x583549=await apiRequest(_0x307c80(0x1df),{'method':_0x307c80(0x1fb),'body':_0x46f8b9}),{id:_0x39e212,entity:_0xcb2a7e}=normalizeEntityWithIdResponse(_0x583549['data']);if(_0x39e212!==undefined){const _0x1e7760=typeof _0xcb2a7e[_0x307c80(0x14c)]==='string'||typeof _0xcb2a7e[_0x307c80(0x1b3)]===_0x307c80(0x14a)?_0xcb2a7e:undefined;return{'id':_0x39e212,'script':_0x1e7760};}throw CliErrors[_0x307c80(0x22b)]('BFF\x20save\x20returned\x20no\x20valid\x20id');}export async function deleteBffScript(_0x49570c){const _0x56aee9=a208_0x958b7;await apiRequest(_0x56aee9(0x1ca),{'method':_0x56aee9(0x1fb),'body':{'id':_0x49570c}});}export async function getBffScriptStatistics(_0x5ca78e){const _0x109d6e=a208_0x958b7,_0xc4078e=await apiRequest(_0x109d6e(0x214)+_0x5ca78e);return extractList(_0xc4078e[_0x109d6e(0x178)]);}export async function clearBffScriptCache(){const _0x3d303f=a208_0x958b7,_0x460003=await apiRequest('/api/management/script/cache/clear',{'method':_0x3d303f(0x1fb),'useRuntime':!![]});return typeof _0x460003[_0x3d303f(0x178)]==='string'?_0x460003['data']:'';}export async function listBffDatasetOperations(_0x217502,_0xceeae2){const _0x27d15a=a208_0x958b7,_0x2f7986=await apiRequest(_0x27d15a(0x165),{'method':_0x27d15a(0x1fb),'body':{'appCode':_0x217502,'datasetId':_0xceeae2}});return _0x2f7986[_0x27d15a(0x178)];}export async function listSqlQueries(_0x365a6e,_0x39a5cf){const _0xae618d=a208_0x958b7,_0x2ab844=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0xae618d(0x1fb),'body':{'appCode':_0x365a6e,'currentPage':_0x39a5cf?.['currentPage']??0x1,'pageSize':_0x39a5cf?.['pageSize']??0x32,'sqlCode':_0x39a5cf?.[_0xae618d(0x1d5)],'sqlName':_0x39a5cf?.[_0xae618d(0x1da)]}});return _0x2ab844[_0xae618d(0x178)];}export async function getSqlQueryInfo(_0x39cf2e,_0xbb3d85){const _0xb2d3ca=a208_0x958b7,_0x108e02=await listSqlQueries(_0x39cf2e,{'sqlCode':_0xbb3d85}),_0x5a6dec=_0x108e02['tableData']?.[0x0];if(!_0x5a6dec)throw CliErrors[_0xb2d3ca(0x11e)]('SQL\x20query\x20not\x20found:\x20'+_0xbb3d85);return _0x5a6dec;}export async function getSqlQueryDetail(_0x40f274){const _0x15b94d=a208_0x958b7,_0x24bd8f=await apiRequest(_0x15b94d(0x1e5)+(_0x15b94d(0x195)+encodeURIComponent(_0x40f274)));if(!_0x24bd8f[_0x15b94d(0x178)])throw CliErrors[_0x15b94d(0x11e)](_0x15b94d(0x1e4)+_0x40f274);return _0x24bd8f[_0x15b94d(0x178)];}export async function getSqlQueryDetailById(_0x2394f8){const _0x131017=a208_0x958b7,_0x38956b=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x2394f8);if(!_0x38956b[_0x131017(0x178)])throw CliErrors['validation'](_0x131017(0x206)+_0x2394f8);return _0x38956b[_0x131017(0x178)];}export async function createSqlQuery(_0x1b5bb9){const _0x41e7dc=a208_0x958b7,_0x14f14d=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':'POST','body':_0x1b5bb9}),{id:_0x3fc4c9,entity:_0xebedb6}=normalizeEntityWithIdResponse(_0x14f14d[_0x41e7dc(0x178)]);if(!(_0x41e7dc(0x1d5)in _0xebedb6)&&_0x3fc4c9)return getSqlQueryDetailById(_0x3fc4c9);return normalizeSqlQueryEntity(_0xebedb6);}export async function updateSqlQuery(_0x3d9a39){const _0x6752d6=a208_0x958b7,_0x545564=await apiRequest(_0x6752d6(0x1ab),{'method':_0x6752d6(0x1fb),'body':_0x3d9a39}),{id:_0x93b4f6,entity:_0x9ad335}=normalizeEntityWithIdResponse(_0x545564[_0x6752d6(0x178)]);if(!('sqlCode'in _0x9ad335)){if(_0x3d9a39[_0x6752d6(0x1d5)])return getSqlQueryDetail(_0x3d9a39[_0x6752d6(0x1d5)]);if(_0x93b4f6)return getSqlQueryDetailById(_0x93b4f6);}return normalizeSqlQueryEntity(_0x9ad335);}export async function deleteSqlQuery(_0x54d161){const _0x20371b=a208_0x958b7;await apiRequest(_0x20371b(0x1ce),{'method':'POST','body':_0x54d161});}export async function saveSqlQuery(_0x5f451b){const _0x4abd1e=a208_0x958b7,_0x14ff19=await apiRequest(_0x4abd1e(0x170),{'method':_0x4abd1e(0x1fb),'body':_0x5f451b});return _0x14ff19[_0x4abd1e(0x178)];}function normalizeSqlQueryEntity(_0x43881c){const _0x1988fd=a208_0x958b7;return{..._0x43881c,'id':Number(_0x43881c['id']),'dbId':_0x43881c[_0x1988fd(0x1b0)]==null?undefined:Number(_0x43881c['dbId']),'version':_0x43881c[_0x1988fd(0x13c)]==null?undefined:Number(_0x43881c[_0x1988fd(0x13c)])};}export async function executeSql(_0x1072c3,_0x228acd,_0x5c84dc){const _0x34c11f=a208_0x958b7,_0x25f6c2=await apiRequest(_0x34c11f(0x1fe),{'method':'POST','body':{'appCode':_0x1072c3,'sqlCode':_0x228acd,..._0x5c84dc&&{'params':_0x5c84dc}},'useRuntime':!![]});return _0x25f6c2[_0x34c11f(0x178)];}export async function executeDatasetDataOperation(_0x2c6bf0,_0x2a5c0c,_0x4fc83c,_0x2d086a={}){const _0x394858=a208_0x958b7;try{const _0x7d06d2=await apiRequest(_0x394858(0x196)+_0x2c6bf0+'/'+_0x2a5c0c+'/'+_0x4fc83c,{'method':_0x394858(0x1fb),'body':_0x2d086a,'useRuntime':!![]});return _0x7d06d2[_0x394858(0x178)];}catch(_0x4fffbc){if(_0x4fc83c===_0x394858(0x129)&&_0x4fffbc instanceof CliError&&_0x4fffbc[_0x394858(0x18e)]===_0x394858(0x159)&&_0x2d086a['id']!==undefined&&_0x2d086a['id']!==null&&_0x2d086a['id']!==''){const _0xc9e6bb=await apiRequest('/api/'+_0x2c6bf0+'/'+_0x2a5c0c+_0x394858(0x1c6),{'method':_0x394858(0x1fb),'body':{'where':{'id':{'$eq':_0x2d086a['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x9ee418=Array[_0x394858(0x127)](_0xc9e6bb[_0x394858(0x178)]?.[_0x394858(0x180)])?_0xc9e6bb['data'][_0x394858(0x180)]:[];return _0x9ee418[0x0]??null;}throw _0x4fffbc;}}export async function listDatasets(_0x509a27,_0x425fd6){const _0x3bba9e=a208_0x958b7,_0x4c4765={'appCode':_0x509a27,'deleted':_0x425fd6?.[_0x3bba9e(0x1f4)]??![]};if(_0x425fd6?.[_0x3bba9e(0x18e)])_0x4c4765[_0x3bba9e(0x18e)]=_0x425fd6['code'];if(_0x425fd6?.[_0x3bba9e(0x1c8)])_0x4c4765[_0x3bba9e(0x1c8)]=_0x425fd6[_0x3bba9e(0x1c8)];const _0x3b353e=await apiRequest(_0x3bba9e(0x22c),{'method':_0x3bba9e(0x1fb),'body':_0x4c4765});return extractList(_0x3b353e['data']);}export async function deleteDataset(_0x42115b,_0x2ca7d){const _0x2a0244=a208_0x958b7;await apiRequest(_0x2a0244(0x1cd),{'method':_0x2a0244(0x1fb),'body':{'appCode':_0x42115b,'datasetId':_0x2ca7d}});}export async function restoreDataset(_0x157086,_0x38d02b){const _0x2fa1c9=a208_0x958b7;await apiRequest(_0x2fa1c9(0x14d),{'method':_0x2fa1c9(0x1fb),'body':{'appCode':_0x157086,'datasetId':_0x38d02b}});}export async function previewTextGeneratedDataset(_0x5e4e2e,_0x334bd6){const _0x35be64=a208_0x958b7,_0x1926a3=await apiRequest('/smartapi/dataset/text-generate/preview',{'method':_0x35be64(0x1fb),'body':{'appCode':_0x5e4e2e,'datasetName':_0x334bd6[_0x35be64(0x163)],'requirementDescription':_0x334bd6[_0x35be64(0x222)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x1926a3['data'];}export async function startTextGeneratedDataset(_0x259982,_0x4feced,_0xf3377a){const _0x233554=a208_0x958b7,_0x353855=await apiRequest(_0x233554(0x198),{'method':_0x233554(0x1fb),'body':{'appCode':_0x259982,..._0xf3377a?.[_0x233554(0x13b)]?{'clientOperationId':_0xf3377a[_0x233554(0x13b)]}:{},'design':_0x4feced},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x353855[_0x233554(0x178)];}export async function getTextGeneratedDatasetStatus(_0x3b4938,_0x5a5359){const _0x1add8c=a208_0x958b7,_0x10ff62=new URLSearchParams({'appCode':_0x3b4938});_0x5a5359[_0x1add8c(0x157)]&&_0x10ff62[_0x1add8c(0x1e0)]('operationId',_0x5a5359[_0x1add8c(0x157)]);_0x5a5359['clientOperationId']&&_0x10ff62[_0x1add8c(0x1e0)]('clientOperationId',_0x5a5359[_0x1add8c(0x13b)]);const _0x313695=await apiRequest('/smartapi/dataset/text-generate/status?'+_0x10ff62[_0x1add8c(0x1b7)]());return _0x313695[_0x1add8c(0x178)];}export async function searchDatasets(_0x309f71,_0x33fd48){const _0x5501ce=a208_0x958b7,_0x4018d0=await listDatasets(_0x309f71,{'name':_0x33fd48}),_0x559bed=_0x33fd48[_0x5501ce(0x1bc)](),_0x2c57f8=new Set(_0x4018d0[_0x5501ce(0x221)](_0x38f638=>_0x38f638['id'])),_0x53cc7d=_0x4018d0[_0x5501ce(0x1dd)](_0x476a9f=>_0x476a9f['dbtableConfig']?.[_0x5501ce(0x12b)]?.['toLowerCase']()['includes'](_0x559bed)||_0x476a9f[_0x5501ce(0x121)]?.[_0x5501ce(0x1bc)]()['includes'](_0x559bed)),_0x5b9621=await listDatasets(_0x309f71,{'code':_0x33fd48});for(const _0x4d53ef of _0x5b9621){!_0x2c57f8[_0x5501ce(0x205)](_0x4d53ef['id'])&&(_0x4018d0['push'](_0x4d53ef),_0x2c57f8[_0x5501ce(0x141)](_0x4d53ef['id']));}return _0x4018d0;}export function normalizeDatasetOperations(_0x1fafad){const _0x2906de=a208_0x958b7;if(Array[_0x2906de(0x127)](_0x1fafad))return _0x1fafad[_0x2906de(0x1dd)](_0x1e4381=>_0x1e4381!=null&&typeof _0x1e4381===_0x2906de(0x1bb));if(_0x1fafad&&typeof _0x1fafad==='object')return Object[_0x2906de(0x223)](_0x1fafad)[_0x2906de(0x1dd)](([,_0x290634])=>_0x290634!=null&&typeof _0x290634===_0x2906de(0x1bb))[_0x2906de(0x221)](([_0x65cbd7,_0x1dcdbb])=>({..._0x1dcdbb,'name':_0x1dcdbb[_0x2906de(0x1c8)]??_0x1dcdbb[_0x2906de(0x183)]??_0x65cbd7}));return[];}export async function getDatasetDetail(_0x8b8047){const _0x34669e=a208_0x958b7,_0x4eb70f=/^\d+$/['test'](_0x8b8047)?'id':'code',_0x1a66dd=await apiRequest(_0x34669e(0x140)+_0x4eb70f+'='+_0x8b8047);return _0x1a66dd['data'];}export async function updateDrivenData(_0x54d573){const _0x1fcaa4=a208_0x958b7,_0x19b487=await apiRequest(_0x1fcaa4(0x21b),{'method':'POST','body':_0x54d573});return _0x19b487[_0x1fcaa4(0x178)];}export async function getDatasetOperations(_0x5af1aa){const _0x34abc8=a208_0x958b7,_0x5540f2=await getDatasetDetail(_0x5af1aa),_0x4b8318=normalizeDatasetOperations(_0x5540f2['operations'])[_0x34abc8(0x221)](_0x46aab1=>({'name':_0x46aab1['name']||_0x46aab1['operationName'],'displayName':_0x46aab1[_0x34abc8(0x1a8)]||_0x46aab1[_0x34abc8(0x1c8)],'type':_0x46aab1[_0x34abc8(0x15f)],'method':_0x46aab1['method'],'path':_0x46aab1[_0x34abc8(0x1de)],'enabled':_0x46aab1[_0x34abc8(0x16e)]??!![],'requestFields':_0x46aab1['requestFields'],'responseFields':_0x46aab1[_0x34abc8(0x211)]}));return{'dataset':{'id':_0x5540f2['id']??_0x5540f2[_0x34abc8(0x1a9)],'name':_0x5540f2['name'],'code':_0x5540f2[_0x34abc8(0x18e)]||_0x5540f2[_0x34abc8(0x17f)],'tableName':_0x5540f2['tableName']||_0x5540f2['dbtableConfig']?.[_0x34abc8(0x12b)]},'operations':_0x4b8318};}export async function getOperationDetail(_0x8e93e1,_0xd99fbc,_0x2e20b5){const _0x311b48=a208_0x958b7;let _0x2864b2=_0xd99fbc;if(!/^\d+$/[_0x311b48(0x1f3)](_0xd99fbc)){const _0x293460=await listDatasets(_0x8e93e1,{'code':_0xd99fbc}),_0x22d9ca=_0x293460[_0x311b48(0x20f)](_0x3120ae=>_0x3120ae['code']===_0xd99fbc||String(_0x3120ae['id'])===_0xd99fbc);if(!_0x22d9ca)throw CliErrors[_0x311b48(0x11e)]('Dataset\x20not\x20found:\x20'+_0xd99fbc);_0x2864b2=String(_0x22d9ca['id']);}const _0x2ee852=await getDatasetDetail(_0x2864b2),_0x2c551d=normalizeDatasetOperations(_0x2ee852['operations'])['find'](_0x3cadbe=>(_0x3cadbe[_0x311b48(0x1c8)]||_0x3cadbe[_0x311b48(0x183)])===_0x2e20b5);if(!_0x2c551d)throw CliErrors[_0x311b48(0x11e)](_0x311b48(0x1aa)+_0x2e20b5+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0xd99fbc);return{'dataset':{'id':_0x2ee852['id']??_0x2ee852[_0x311b48(0x1a9)],'name':_0x2ee852['name'],'code':_0x2ee852['code']||_0x2ee852[_0x311b48(0x17f)],'tableName':_0x2ee852[_0x311b48(0x12b)]||_0x2ee852[_0x311b48(0x1b1)]?.[_0x311b48(0x12b)]},'operation':_0x2c551d};}export async function startGenerateStandardPages(_0x10968e,_0x499b2c,_0x3f66b3){const _0x39fe5e=a208_0x958b7,_0x520093=await apiRequest('/smartapi/lovrabet/dataset/'+_0x499b2c+_0x39fe5e(0x199),{'method':_0x39fe5e(0x1fb),'body':{'appCode':_0x10968e,..._0x3f66b3?.[_0x39fe5e(0x13b)]?{'clientOperationId':_0x3f66b3['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x520093[_0x39fe5e(0x178)];}export async function getGenerateStandardPagesStatus(_0x2c18be,_0x2e0f81,_0x260786){const _0x3d29ae=a208_0x958b7,_0x5ee61a=new URLSearchParams({'appCode':_0x2c18be});_0x260786[_0x3d29ae(0x157)]&&_0x5ee61a[_0x3d29ae(0x1e0)](_0x3d29ae(0x157),_0x260786[_0x3d29ae(0x157)]);_0x260786[_0x3d29ae(0x13b)]&&_0x5ee61a['set'](_0x3d29ae(0x13b),_0x260786[_0x3d29ae(0x13b)]);const _0x1e5fee=await apiRequest('/smartapi/lovrabet/dataset/'+_0x2e0f81+_0x3d29ae(0x1c0)+_0x5ee61a[_0x3d29ae(0x1b7)]());return _0x1e5fee[_0x3d29ae(0x178)];}export async function getStandardPageStatus(_0x26e10b,_0x16b340){const _0x49d8a1=a208_0x958b7,_0xa7b3a6=await apiRequest(_0x49d8a1(0x156)+_0x16b340+_0x49d8a1(0x20c)+encodeURIComponent(_0x26e10b));return _0xa7b3a6['data'];}export async function tryGetStandardPageStatus(_0x2b86ae,_0x5af417){const _0x43e999=a208_0x958b7;try{return await getStandardPageStatus(_0x2b86ae,_0x5af417);}catch(_0x1eec83){if(_0x1eec83 instanceof CliError&&_0x1eec83[_0x43e999(0x18e)]==='api_error'&&/404|not found|non-json response/i[_0x43e999(0x1f3)](_0x1eec83[_0x43e999(0x181)]))return null;throw _0x1eec83;}}export async function syncStandardPages(_0x3be5c0,_0x26cc91){const _0x1bb24d=a208_0x958b7,_0x227ae7=await apiRequest(_0x1bb24d(0x156)+_0x26cc91+_0x1bb24d(0x1c2),{'method':_0x1bb24d(0x1fb),'body':{'appCode':_0x3be5c0}});return _0x227ae7[_0x1bb24d(0x178)];}export async function getPageDetail(_0x5b92f1){const _0x7e11dc=a208_0x958b7,_0x3dce92=await apiRequest(_0x7e11dc(0x186)+_0x5b92f1);if(!_0x3dce92[_0x7e11dc(0x178)])throw CliErrors[_0x7e11dc(0x11e)](_0x7e11dc(0x169)+_0x5b92f1);return _0x3dce92['data'];}export async function listDeletedPages(_0x9b540d,_0x4386ed,_0x41ef97){const _0xc976f1=a208_0x958b7,_0x50f770=new URLSearchParams({'appCode':_0x9b540d,'type':_0x4386ed,'currentPage':String(_0x41ef97[_0xc976f1(0x19a)]),'pageSize':String(_0x41ef97[_0xc976f1(0x137)])}),_0x3e9570=await apiRequest(_0xc976f1(0x1ad)+_0x50f770[_0xc976f1(0x1b7)]());return _0x3e9570['data'];}export async function restoreStandardPage(_0x207ff7){const _0x40f97a=a208_0x958b7;await apiRequest(_0x40f97a(0x1e9),{'method':_0x40f97a(0x1fb),'body':{'id':_0x207ff7}});}export async function restoreJsxPage(_0x4023d6,_0x412f67){const _0x3d0125=a208_0x958b7,_0x431e06=await apiRequest(_0x3d0125(0x1f0),{'method':_0x3d0125(0x1fb),'body':{'appCode':_0x4023d6,'id':_0x412f67}});return _0x431e06[_0x3d0125(0x178)];}export async function updatePage(_0x2c4dce,_0x1632cd,_0x4e2c35,_0x4fdc08){const _0x212fa5=a208_0x958b7,_0x3e6645=await apiRequest(_0x212fa5(0x177),{'method':_0x212fa5(0x1fb),'body':{'appCode':_0x2c4dce,'pageId':_0x1632cd,'code':_0x4e2c35,'datasetIds':_0x4fdc08}});return _0x3e6645[_0x212fa5(0x178)];}export function generateSdkCode(_0x30b755,_0x4d0053,_0x21f6f1){const _0x26af7b=a208_0x958b7,_0x3cfe9d=_0x21f6f1?.[_0x26af7b(0x1eb)]??!![],_0x22742f=_0x26af7b(0x209)+_0x30b755[_0x26af7b(0x18e)]?.['replace'](/-/g,'_'),_0x26f539=_0x4d0053[_0x26af7b(0x1c8)]||_0x4d0053[_0x26af7b(0x183)]||_0x26af7b(0x1dd),_0x4f5d59=[];_0x3cfe9d&&_0x4f5d59[_0x26af7b(0x1a4)](_0x26af7b(0x14b),'',_0x26af7b(0x13a),'');_0x4f5d59[_0x26af7b(0x1a4)]('//\x20'+_0x30b755[_0x26af7b(0x1c8)]+'\x20('+(_0x30b755[_0x26af7b(0x12b)]||_0x26af7b(0x155))+')');if(_0x26f539===_0x26af7b(0x1dd))_0x4f5d59[_0x26af7b(0x1a4)](_0x26af7b(0x182)+_0x22742f+_0x26af7b(0x208),_0x26af7b(0x138),_0x26af7b(0x1b5),_0x26af7b(0x1d8),_0x26af7b(0x152));else{if(_0x26f539===_0x26af7b(0x129))_0x4f5d59[_0x26af7b(0x1a4)]('const\x20result\x20=\x20await\x20client.models.'+_0x22742f+_0x26af7b(0x202));else{if(_0x26f539===_0x26af7b(0x1a2))_0x4f5d59['push'](_0x26af7b(0x182)+_0x22742f+_0x26af7b(0x15e));else{if(_0x26f539==='update')_0x4f5d59[_0x26af7b(0x1a4)](_0x26af7b(0x182)+_0x22742f+_0x26af7b(0x13d));else _0x26f539===_0x26af7b(0x207)||_0x26f539===_0x26af7b(0x175)?_0x4f5d59['push'](_0x26af7b(0x182)+_0x22742f+_0x26af7b(0x16d)):_0x4f5d59[_0x26af7b(0x1a4)](_0x26af7b(0x182)+_0x22742f+'.'+_0x26f539+'(/*\x20params\x20*/);');}}}return _0x4f5d59[_0x26af7b(0x20e)]('\x0a');}export function generateSqlCodeTemplate(_0x4d8748,_0x345003){const _0x2ae20d=a208_0x958b7,_0x1d27a8=_0x345003?.[_0x2ae20d(0x1e6)]??'sdk',_0x2e1807=_0x345003?.[_0x2ae20d(0x1eb)]??!![],_0x53a73a=[];return _0x53a73a[_0x2ae20d(0x1a4)](_0x2ae20d(0x215)+_0x4d8748[_0x2ae20d(0x1da)]+'\x20('+_0x4d8748[_0x2ae20d(0x1d5)]+')'),_0x1d27a8==='sdk'?(_0x2e1807&&_0x53a73a[_0x2ae20d(0x1a4)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x53a73a[_0x2ae20d(0x1a4)](_0x2ae20d(0x194),_0x2ae20d(0x11f)+_0x4d8748[_0x2ae20d(0x1d5)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x2ae20d(0x152),_0x2ae20d(0x1a3),_0x2ae20d(0x187))):_0x53a73a[_0x2ae20d(0x1a4)]('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly',_0x2ae20d(0x19b),_0x2ae20d(0x189),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x4d8748[_0x2ae20d(0x1d5)]+'\x27,',_0x2ae20d(0x12e),_0x2ae20d(0x151),_0x2ae20d(0x20d),'}'),_0x53a73a['join']('\x0a');}export async function getErConfig(_0x30b94b,_0xcd34d7){const _0x2142aa=a208_0x958b7,_0x50df28=await apiRequest('/smartapi/question/er-config',{'method':_0x2142aa(0x1fb),'body':{'appCode':_0x30b94b,'dblinkId':_0xcd34d7},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x50df28[_0x2142aa(0x178)];}export async function getErRelationDetail(_0x5cfbed,_0x23acce){const _0x256f85=a208_0x958b7,_0x4eaa3f=new URLSearchParams({'appCode':_0x5cfbed,'relationId':String(_0x23acce)});try{const _0x405680=await apiRequest(_0x256f85(0x1a5)+_0x4eaa3f[_0x256f85(0x1b7)]());return _0x405680['data']?.[_0x256f85(0x1d4)]??null;}catch(_0x424653){if(_0x424653 instanceof CliError&&_0x424653[_0x256f85(0x18e)]===_0x256f85(0x159)&&(_0x424653['hint']?.[_0x256f85(0x1ed)]('DATA_NOT_EXIST')||_0x424653[_0x256f85(0x154)]===_0x256f85(0x1f5)&&_0x424653['message']===_0x256f85(0x1fd)))return null;throw _0x424653;}}export async function createErRelation(_0x5bb581){const _0x4c2092=a208_0x958b7,_0x56029a=await apiRequest(_0x4c2092(0x1f6),{'method':_0x4c2092(0x1fb),'body':_0x5bb581,'allowNonJsonSuccess':!![]});return _0x56029a[_0x4c2092(0x178)];}export async function updateErRelation(_0x4c20fe){const _0x5a82f2=a208_0x958b7,_0x515ec2=await apiRequest(_0x5a82f2(0x15d),{'method':_0x5a82f2(0x1fb),'body':_0x4c20fe,'allowNonJsonSuccess':!![]});return _0x515ec2['data'];}export async function deleteErRelation(_0x1fd7cf){const _0x1a65f5=a208_0x958b7,_0x2ed35b=await apiRequest(_0x1a65f5(0x147),{'method':_0x1a65f5(0x1fb),'body':_0x1fd7cf,'allowNonJsonSuccess':!![]});return _0x2ed35b['data'];}export async function updateErBusinessGroup(_0x48c891){const _0x16830e=a208_0x958b7,_0x52e5da=await apiRequest(_0x16830e(0x1ba),{'method':_0x16830e(0x1fb),'body':_0x48c891,'allowNonJsonSuccess':!![]});return _0x52e5da[_0x16830e(0x178)];}function buildQuery(_0x588cd1){const _0x458842=a208_0x958b7,_0x42a85b=new URLSearchParams();for(const [_0x2d4c7d,_0x42db6c]of Object['entries'](_0x588cd1)){if(_0x42db6c===undefined||_0x42db6c==='')continue;_0x42a85b[_0x458842(0x1e0)](_0x2d4c7d,String(_0x42db6c));}const _0x4e586b=_0x42a85b[_0x458842(0x1b7)]();return _0x4e586b?'?'+_0x4e586b:'';}export async function listNotificationChannelConfigs(_0x393848,_0x5b92f7){const _0x50a4f4=a208_0x958b7,_0x4b5e4f=await apiRequest('/notification/channel-config/list'+buildQuery({'appCode':_0x393848,'channelType':_0x5b92f7}));return Array['isArray'](_0x4b5e4f[_0x50a4f4(0x178)])?_0x4b5e4f[_0x50a4f4(0x178)]:[];}export async function listAppConfigs(_0x5ce1c3,_0x2c72b6){const _0x13a67c=a208_0x958b7,_0x381f0f=await apiRequest('/smartapi/app-config/list',{'method':_0x13a67c(0x1fb),'body':{'appCode':_0x5ce1c3,..._0x2c72b6?.['key']?{'key':_0x2c72b6[_0x13a67c(0x1b8)]}:{},..._0x2c72b6?.[_0x13a67c(0x144)]?{'tags':_0x2c72b6['tags']}:{}}});return extractAppConfigList(_0x381f0f[_0x13a67c(0x178)]);}export async function getAppConfigByKey(_0x11d845,_0x411383){const _0xa67780=a208_0x958b7,_0x1e4078=await apiRequest(_0xa67780(0x219)+buildQuery({'appCode':_0x11d845,'key':_0x411383}));return _0x1e4078[_0xa67780(0x178)]??null;}export async function createAppConfig(_0x4c631f){const _0x647cf7=a208_0x958b7,_0x3ee80a=await apiRequest(_0x647cf7(0x12d),{'method':_0x647cf7(0x1fb),'body':{'appCode':_0x4c631f['appCode'],'key':_0x4c631f[_0x647cf7(0x1b8)],'value':_0x4c631f[_0x647cf7(0x160)],..._0x4c631f[_0x647cf7(0x144)]?{'tags':_0x4c631f[_0x647cf7(0x144)]}:{}}});return _0x3ee80a[_0x647cf7(0x178)];}export async function updateAppConfig(_0x248f8f){const _0x4ab2f7=a208_0x958b7;await apiRequest(_0x4ab2f7(0x161),{'method':_0x4ab2f7(0x1fb),'body':{'id':_0x248f8f['id'],'appCode':_0x248f8f[_0x4ab2f7(0x1cc)],'key':_0x248f8f[_0x4ab2f7(0x1b8)],'value':_0x248f8f[_0x4ab2f7(0x160)],..._0x248f8f[_0x4ab2f7(0x144)]?{'tags':_0x248f8f[_0x4ab2f7(0x144)]}:{}}});}export async function deleteAppConfig(_0x16108c){const _0x3910ff=a208_0x958b7;await apiRequest(_0x3910ff(0x1db),{'method':_0x3910ff(0x1fb),'body':_0x16108c});}function extractAppConfigList(_0xd1f90c){const _0x236f59=a208_0x958b7;if(Array[_0x236f59(0x127)](_0xd1f90c))return _0xd1f90c;if(_0xd1f90c&&typeof _0xd1f90c===_0x236f59(0x1bb)&&Array[_0x236f59(0x127)](_0xd1f90c[_0x236f59(0x1a6)]))return _0xd1f90c[_0x236f59(0x1a6)];return extractList(_0xd1f90c);}export async function listDbLinks(_0x376230,_0x5221e6){const _0x3a6c07=a208_0x958b7,_0x5286e6=await apiRequest('/smartapi/dblink/getList',{'method':'POST','body':{'appCode':_0x376230,'currentPage':_0x5221e6?.[_0x3a6c07(0x19a)]??0x1,'pageSize':_0x5221e6?.[_0x3a6c07(0x137)]??0x64}});return{'items':extractList(_0x5286e6[_0x3a6c07(0x178)]),'paging':extractPaging(_0x5286e6['data'])};}export async function getDbLinkInfo(_0x181566){const _0x4448d4=a208_0x958b7,_0x58923d=await apiRequest(_0x4448d4(0x166)+buildQuery({'id':_0x181566}));return _0x58923d[_0x4448d4(0x178)];}export async function createDbLink(_0x5b5a7c){const _0x1ac06c=a208_0x958b7,_0x253a92=await apiRequest(_0x1ac06c(0x1c3),{'method':'POST','body':_0x5b5a7c});return _0x253a92[_0x1ac06c(0x178)];}export async function updateDbLink(_0xf10b9d){const _0x2b24fe=a208_0x958b7,_0x1e1425=await apiRequest(_0x2b24fe(0x146),{'method':_0x2b24fe(0x1fb),'body':_0xf10b9d});return _0x1e1425[_0x2b24fe(0x178)];}export async function deleteDbLink(_0x37d25f){const _0x1eb533=a208_0x958b7;await apiRequest(_0x1eb533(0x1d3),{'method':_0x1eb533(0x1fb),'body':{'id':_0x37d25f}});}function a208_0x25a2(){const _0x3e2e47=['/api/management/library/scripts/info?id=','BFF\x20script\x20not\x20found:\x20id=','configArray','modelCode','tableData','message','const\x20result\x20=\x20await\x20client.models.','operationName','startsWith','info','/smartapi/lovrabet/detail?pageId=','const\x20results\x20=\x20data.execResult\x20||\x20[];','772044LQtKel','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','array','\x20failed','/smartapi/permit/role/get-list','/smartapi/dblink/testConnect','code','label','Invalid\x20response\x20format\x20(','/smartapi/db-analysis/status/','errorCode','21791275PyqOPk','const\x20data\x20=\x20await\x20client.sql.execute({','?sqlCode=','/api/','/smartapi/menu/delete','/smartapi/dataset/text-generate/start','/generate-standard-pages/start','currentPage','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','Fetch\x20menu\x20list','warn','length','company','authRequired','scope','create','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','push','/smartapi/question/er-config/cli/detail?','list','Knowledge-base\x20update\x20requires\x20title\x20or\x20content.','displayName','modelId','Operation\x20\x22','/smartapi/custom/updateUserCustomSql','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','/smartapi/page/getDeletedPageList?','/smartapi/permit/user-role/update-user-list','errorMessage','dbId','dbtableConfig','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','scriptType','248cYQkXP','\x20\x20pageSize:\x2020,','Fetch\x20doc\x20(','toString','key','/smartapi/menu/regroup','/smartapi/question/er-config/business-group/edit','object','toLowerCase','status','/smartapi/app/getList','cookie','/generate-standard-pages/status?','/smartapi/permit/role/get-one','/sync-to-pages','/smartapi/dblink/create','cli:rabetbase','/admin/knowledge-base/delete','/filter','tableList','name','0000','/api/management/library/scripts/delete','API\x20error:\x20','appCode','/smartapi/dataset/delete-dataset','/smartapi/custom/deleteUserCustomSql','/smartapi/dblink/getAllTableList','signal','):\x20missing\x20data.markdown\x20field','8nOEKHN','/smartapi/dblink/delete','relation','sqlCode','\x20of\x20','number','\x20\x20currentPage:\x201,','userId','sqlName','/smartapi/app-config/delete','trim','filter','path','/api/management/library/scripts/save','set','/smartapi/permit/role/create','/smartapi/permit/role/update',':\x20invalid\x20JSON\x20response\x20envelope','SQL\x20query\x20not\x20found:\x20','/smartapi/custom/getUserCustomSql','target','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','email','/smartapi/page/restore','/smartapi/ocr/recognize-text?','includeImports',',\x20HTTP\x20','includes','summary','nickname','/smartapi/webcode/page/restore','body','longTerm','test','deleted','API\x20error\x20code:\x20306','/smartapi/question/er-config/cli/erCreate','personal','method','/smartapi/menu/create','正在从服务器拉取模型列表...\x20(环境:\x20','POST','5400647aPTvSQ','ER\x20relation\x20does\x20not\x20exist','/api/custom/executeSql','/smartapi/menu/batchDelete','API\x20error\x20code:\x20','mobile','.getOne(id);','Knowledge-base\x20response\x20is\x20missing\x20a\x20valid\x20','70epFhpk','has','SQL\x20query\x20not\x20found:\x20id=','delete','.filter({','dataset_','/smartapi/permit/page/get-one','/smartapi/permit/resource/get-menu-list','/standard-page-status?appCode=','\x20\x20return\x20rows;','join','find','success','responseFields','/smartapi/permit/user-role/get-user-list','avatar','/api/management/library/scripts/statistics?appCode=','//\x20SQL:\x20','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20','/api/management/library/scripts/list?appCode=','errorMsg','/smartapi/app-config/getByKey','Create\x20enterprise\x20knowledge\x20base','/smartapi/dataset/update-driven-data','roleType','Request\x20timeout:\x20','platform-error-code','min','needPublic','map','requirementDescription','entries','GET','401','/smartapi/menu/update','totalCount','Fetch\x20datasets','content','Knowledge-base\x20pageSize\x20must\x20be\x20an\x20integer\x20between\x201\x20and\x20','apiError','/smartapi/dataset/get-dataset-list','defineProperty','2259KKyZcf','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20scope.','stringify','validation','\x20\x20sqlCode:\x20\x27','/admin/knowledge-base/update','description','\x20apps.\x20','pageIndex','/smartapi/permit/role/get-permit-list','11000PRMIgK','abort','isArray','/smartapi/db-analysis/start','getOne','isSafeInteger','tableName','NaN','/smartapi/app-config/create','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','username','188LMEIxC','physicalTableCount','datasetTableCount','/admin/knowledge-base/get-list','The\x20server\x20outcome\x20is\x20indeterminate.\x20Verify\x20current\x20state\x20before\x20retrying\x20any\x20mutation.','/smartapi/tasks/','/api/node-toolbox/dataset/model-list?','pageSize','\x20\x20where:\x20{},','/smartapi/common/uploadFile','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','clientOperationId','version','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','List\x20enterprise\x20knowledge\x20bases\x20returned\x20invalid\x20paging\x20metadata.','/userTenant/queryBelongsTenants','/smartapi/dataset/get-driven-data?','add','List\x20enterprise\x20knowledge\x20bases\x20returned\x20an\x20invalid\x20response\x20contract.','markdown','tags','\x20failed,\x20HTTP\x20','/smartapi/dblink/update','/smartapi/question/er-config/cli/delete-single','CUSTOM','updateTime','string','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','functionName','/smartapi/dataset/restore-dataset','AbortError','platform-transport-failure','json','\x20\x20});','});','/smartapi/permit/role/delete','hint','table','/smartapi/lovrabet/dataset/','operationId','isInteger','api_error','error','24740KOrxVv','userTenantRelationList','/smartapi/question/er-config/cli/update-single','.create({\x20/*\x20fields\x20*/\x20});','type','value','/smartapi/app-config/update','remark','datasetName','title','/smartapi/dataset/get-dataset-operation','/smartapi/dblink/getOne','permits','append','Page\x20not\x20found:\x20','url','3036222EvGJou','/userTenant/getByTenantCode','.remove(id);','enabled','ENABLE','/api/node-toolbox/sql/save','\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20after\x20HTTP\x20success.','createTime','Check\x20network\x20connectivity\x20and\x20try\x20again.','/smartapi/permit/resource/get-api-list','remove','scriptName','/smartapi/lovrabet/update-page','data','download','/smartapi/permit/page/save','roleName'];a208_0x25a2=function(){return _0x3e2e47;};return a208_0x25a2();}export async function testDbLinkConnect(_0x3d6a33){const _0x835ffb=a208_0x958b7,_0x3fb3a3=await apiRequest(_0x835ffb(0x18d)+buildQuery({'id':_0x3d6a33}));return _0x3fb3a3[_0x835ffb(0x178)];}export async function startDbAnalysis(_0x5cc47d,_0x35841c){const _0x125510=a208_0x958b7,_0x121911=await apiRequest(_0x125510(0x128),{'method':_0x125510(0x1fb),'body':{'dbLinkId':_0x5cc47d,..._0x35841c&&_0x35841c[_0x125510(0x19e)]>0x0?{'tableNames':_0x35841c}:{}}});return _0x121911[_0x125510(0x178)];}export async function cancelDbAnalysis(_0x351aa3){const _0x1dcaa3=a208_0x958b7;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x351aa3}),{'method':_0x1dcaa3(0x1fb)});}export async function getDbAnalysisStatus(_0x221188){const _0x107c46=a208_0x958b7,_0x333ee7=await apiRequest(_0x107c46(0x191)+encodeURIComponent(_0x221188));return _0x333ee7[_0x107c46(0x178)];}export async function getDbAllTableList(_0xc5bd1b,_0x11c6d1){const _0x251570=a208_0x958b7,_0x176e6f=await apiRequest(_0x251570(0x1cf)+buildQuery({'appCode':_0xc5bd1b,'dbLinkId':_0x11c6d1})),_0x4aee03=_0x176e6f[_0x251570(0x178)];if(Array[_0x251570(0x127)](_0x4aee03))return _0x4aee03;return extractList(_0x4aee03);}export async function getDbTableDiff(_0x504071,_0x202f3c,_0x50d27a){const _0x6cf133=a208_0x958b7,_0x1c80ff=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x504071,'dbLinkId':_0x202f3c,'pageIndex':_0x50d27a?.[_0x6cf133(0x123)]??0x1,'pageSize':_0x50d27a?.['pageSize']??0x14,'tableName':_0x50d27a?.[_0x6cf133(0x12b)]})),_0x5abde4=_0x1c80ff[_0x6cf133(0x178)];return{'totalCount':_0x5abde4?.[_0x6cf133(0x227)]??0x0,'physicalTableCount':_0x5abde4?.[_0x6cf133(0x131)]??0x0,'datasetTableCount':_0x5abde4?.[_0x6cf133(0x132)]??0x0,..._0x5abde4?.[_0x6cf133(0x1ee)]?{'summary':_0x5abde4[_0x6cf133(0x1ee)]}:{},'tableList':Array[_0x6cf133(0x127)](_0x5abde4?.['tableList'])?_0x5abde4[_0x6cf133(0x1c7)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x403772=a208_0x958b7,_0x420935=await apiRequest(_0x403772(0x1be),{'method':_0x403772(0x1fb),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x3604ba=extractList(_0x420935[_0x403772(0x178)]),_0x1fabec=extractPaging(_0x420935[_0x403772(0x178)]);return _0x1fabec&&_0x1fabec[_0x403772(0x227)]>REMOTE_APP_PAGE_SIZE&&console[_0x403772(0x19d)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+_0x403772(0x1d6)+_0x1fabec[_0x403772(0x227)]+_0x403772(0x122)+_0x403772(0x1b2)),_0x3604ba;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0xf58914,_0x589508){const _0x6b202b=a208_0x958b7,_0x13231e=Math[_0x6b202b(0x21f)](Math['max'](_0x589508?.[_0x6b202b(0x137)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x3b5317=await apiRequest(_0x6b202b(0x18c),{'method':_0x6b202b(0x1fb),'body':{'appCode':_0xf58914,'currentPage':_0x589508?.['currentPage']??0x1,'pageSize':_0x13231e}});return{'items':extractList(_0x3b5317[_0x6b202b(0x178)]),'paging':extractPaging(_0x3b5317['data'])};}export async function getAppRole(_0x282a05){const _0x37eb75=a208_0x958b7,_0x471f74=await apiRequest(_0x37eb75(0x1c1)+buildQuery({'id':_0x282a05}));return _0x471f74[_0x37eb75(0x178)];}export async function createAppRole(_0x48ff80){const _0x8a459c=a208_0x958b7,_0x83329=await apiRequest(_0x8a459c(0x1e1),{'method':_0x8a459c(0x1fb),'body':{'appCode':_0x48ff80['appCode'],'roleName':_0x48ff80[_0x8a459c(0x17b)],'roleType':_0x8a459c(0x148),..._0x48ff80[_0x8a459c(0x162)]?{'remark':_0x48ff80[_0x8a459c(0x162)]}:{}}});return _0x83329[_0x8a459c(0x178)];}export async function updateAppRole(_0x86b530){const _0x588c2c=a208_0x958b7,_0x37e603=await apiRequest(_0x588c2c(0x1e2),{'method':'POST','body':{'id':_0x86b530['id'],'appCode':_0x86b530[_0x588c2c(0x1cc)],..._0x86b530[_0x588c2c(0x21c)]?{'roleType':_0x86b530[_0x588c2c(0x21c)]}:{},..._0x86b530[_0x588c2c(0x17b)]!==undefined?{'roleName':_0x86b530[_0x588c2c(0x17b)]}:{},..._0x86b530[_0x588c2c(0x162)]!==undefined?{'remark':_0x86b530['remark']}:{},..._0x86b530[_0x588c2c(0x167)]?{'permits':_0x86b530[_0x588c2c(0x167)]}:{}}});return _0x37e603[_0x588c2c(0x178)];}export async function deleteAppRole(_0x12dd0f){const _0x14c38d=a208_0x958b7;await apiRequest(_0x14c38d(0x153),{'method':_0x14c38d(0x1fb),'body':{'id':_0x12dd0f}});}export async function listPermitRoles(_0x54e7c1,_0x1dd79c){const _0x3f3ab4=a208_0x958b7,_0x485322=await apiRequest(_0x3f3ab4(0x124),{'method':_0x3f3ab4(0x1fb),'body':{'appCode':_0x54e7c1,..._0x1dd79c?.['needSelf']!==undefined?{'needSelf':_0x1dd79c['needSelf']}:{},..._0x1dd79c?.[_0x3f3ab4(0x220)]!==undefined?{'needPublic':_0x1dd79c['needPublic']}:{}}});return extractList(_0x485322['data']);}export async function getRoleMenuResources(_0x332a40,_0x31d4ea){const _0x590941=a208_0x958b7,_0x539da8=await apiRequest(_0x590941(0x20b),{'method':_0x590941(0x1fb),'body':{'appCode':_0x332a40,'roleId':_0x31d4ea}});return extractList(_0x539da8[_0x590941(0x178)]);}export async function getRoleApiResources(_0x4be0bb,_0x57df84){const _0x52a7c5=a208_0x958b7,_0x518964=await apiRequest(_0x52a7c5(0x174),{'method':_0x52a7c5(0x1fb),'body':{'appCode':_0x4be0bb,'roleId':_0x57df84}});return extractList(_0x518964[_0x52a7c5(0x178)]);}export async function listRoleUsers(_0x5ca4e8){const _0x48f039=a208_0x958b7,_0x37ec7a=await apiRequest(_0x48f039(0x212),{'method':_0x48f039(0x1fb),'body':{'appCode':_0x5ca4e8}});return extractList(_0x37ec7a[_0x48f039(0x178)])[_0x48f039(0x221)](({id:_0x5e7721,userList:_0x454954,applyUserList:_0x4b69b4,..._0x329fa0})=>({..._0x329fa0,'id':Number(_0x5e7721),'userList':_0x454954['map'](_0x5abcc3=>({..._0x5abcc3,'userId':Number(_0x5abcc3['userId'])})),..._0x4b69b4?{'applyUserList':_0x4b69b4[_0x48f039(0x221)](_0x47bc10=>({..._0x47bc10,'userId':Number(_0x47bc10['userId'])}))}:{}}));}export async function updateRoleUsers(_0x30b18b,_0x5248b1){const _0x5defb3=a208_0x958b7;await apiRequest(_0x5defb3(0x1ae),{'method':_0x5defb3(0x1fb),'body':{'appCode':_0x30b18b,'roleList':_0x5248b1}});}export async function getPagePermit(_0x3c81ae){const _0x375d6d=a208_0x958b7,_0x552ec6=await apiRequest(_0x375d6d(0x20a)+buildQuery({'menuId':_0x3c81ae}));return _0x552ec6[_0x375d6d(0x178)];}export async function savePagePermit(_0x5d5e5b){const _0x360a1b=a208_0x958b7,_0x1419c3=await apiRequest(_0x360a1b(0x17a),{'method':_0x360a1b(0x1fb),'body':_0x5d5e5b});return _0x1419c3[_0x360a1b(0x178)];}export async function listCurrentUserTenantMemberships(){const _0x25c8a3=a208_0x958b7,_0x571c68=await apiRequest(_0x25c8a3(0x13f));return extractList(_0x571c68[_0x25c8a3(0x178)]);}export async function listTenantDirectoryMembers(_0x45be65){const _0x53c6a7=a208_0x958b7,_0x1fe0d6=await apiRequest(_0x53c6a7(0x16c)+buildQuery({'code':_0x45be65})),_0x9d9581=_0x1fe0d6[_0x53c6a7(0x178)]?.[_0x53c6a7(0x15c)];return Array[_0x53c6a7(0x127)](_0x9d9581)?_0x9d9581:[];}export async function getTenantMembers(_0x114aa3){const _0x5481ca=a208_0x958b7,_0x2961c2=await listTenantDirectoryMembers(_0x114aa3);return _0x2961c2[_0x5481ca(0x1dd)](_0x217f43=>_0x217f43[_0x5481ca(0x1bd)]===_0x5481ca(0x16f)||_0x217f43[_0x5481ca(0x1bd)]===undefined)[_0x5481ca(0x221)](_0x1db587=>({'userId':Number(_0x1db587[_0x5481ca(0x1d9)]??_0x1db587['id']),'username':_0x1db587[_0x5481ca(0x12f)],'nickname':_0x1db587[_0x5481ca(0x1ef)],'status':_0x1db587[_0x5481ca(0x1bd)],'email':_0x1db587[_0x5481ca(0x1e8)],'mobile':_0x1db587[_0x5481ca(0x201)],'avatar':_0x1db587[_0x5481ca(0x213)]}))['filter'](_0x5552cb=>Number['isFinite'](_0x5552cb[_0x5481ca(0x1d9)])&&_0x5552cb[_0x5481ca(0x1d9)]>0x0);}
|
|
1
|
+
const a208_0x532215=a208_0x7059;(function(_0x4af32c,_0x5f57ec){const _0x4872a=a208_0x7059,_0x4abb13=_0x4af32c();while(!![]){try{const _0x344906=parseInt(_0x4872a(0x247))/0x1*(parseInt(_0x4872a(0x207))/0x2)+parseInt(_0x4872a(0x1c5))/0x3*(-parseInt(_0x4872a(0x212))/0x4)+parseInt(_0x4872a(0x20d))/0x5*(parseInt(_0x4872a(0x18a))/0x6)+parseInt(_0x4872a(0x230))/0x7*(-parseInt(_0x4872a(0x223))/0x8)+-parseInt(_0x4872a(0x157))/0x9+parseInt(_0x4872a(0x211))/0xa*(parseInt(_0x4872a(0x206))/0xb)+parseInt(_0x4872a(0x13d))/0xc;if(_0x344906===_0x5f57ec)break;else _0x4abb13['push'](_0x4abb13['shift']());}catch(_0x12653b){_0x4abb13['push'](_0x4abb13['shift']());}}}(a208_0x2347,0x58cf1));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(_0x27e7ef){_activeCookie=_0x27e7ef||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x57e40,PLATFORM_TRANSPORT_FAILURE=Symbol(a208_0x532215(0x1cb)),PLATFORM_ERROR_CODE=Symbol(a208_0x532215(0x1b2));export function isPlatformTransportFailure(_0x398709){return Boolean(_0x398709&&typeof _0x398709==='object'&&_0x398709[PLATFORM_TRANSPORT_FAILURE]===!![]);}export function getPlatformErrorCode(_0x1491f5){const _0x2e7b19=a208_0x532215;if(!_0x1491f5||typeof _0x1491f5!==_0x2e7b19(0x21d))return undefined;const _0x27446c=_0x1491f5[PLATFORM_ERROR_CODE];return typeof _0x27446c===_0x2e7b19(0x178)&&_0x27446c?_0x27446c:undefined;}function createPlatformApiError(_0x3baaa1,_0x1ac132){const _0x31a1e9=a208_0x532215,_0x477b9b=typeof _0x1ac132==='string'?_0x1ac132[_0x31a1e9(0x197)]():typeof _0x1ac132===_0x31a1e9(0x208)?String(_0x1ac132):'',_0x131ad5=CliErrors[_0x31a1e9(0x228)](_0x3baaa1,_0x477b9b?'API\x20error\x20code:\x20'+_0x477b9b:undefined);return _0x477b9b&&(Object[_0x31a1e9(0x176)](_0x131ad5,PLATFORM_ERROR_CODE,{'value':_0x477b9b}),Object['defineProperty'](_0x131ad5,_0x31a1e9(0x17a),{'value':{'remoteErrorCode':_0x477b9b},'enumerable':![]})),_0x131ad5;}function createFetchFailureError(_0x18dca1,_0x569404){const _0x31b1f9=a208_0x532215,_0x116215=_0x569404 instanceof Error?_0x569404[_0x31b1f9(0x1ac)]:String(_0x569404),_0x404c85=CliErrors[_0x31b1f9(0x228)](_0x31b1f9(0x21b)+_0x18dca1+(_0x116215?'\x20('+_0x116215+')':''),_0x31b1f9(0x147));return Object[_0x31b1f9(0x176)](_0x404c85,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x404c85;}function createIndeterminateResponseError(_0x1cb325){const _0x2225da=a208_0x532215,_0x5efa98=CliErrors[_0x2225da(0x228)](_0x1cb325+_0x2225da(0x169),_0x2225da(0x166));return Object[_0x2225da(0x176)](_0x5efa98,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x5efa98;}async function apiRequest(_0x32d29e,_0x47e9ba={}){const _0x5c6e98=a208_0x532215,{method:method=_0x5c6e98(0x1c2),body:_0xa6006c,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x47e9ba,_0x24a7e4=useRuntime?getRuntimeDomain():getApiDomain(),_0x5165b8=_activeCookie||getCookie(),_0x436e4c=''+_0x24a7e4+_0x32d29e,_0x5e1e2a=new AbortController(),_0x1d520f=setTimeout(()=>_0x5e1e2a[_0x5c6e98(0x180)](),timeout);try{const _0x967307=await fetch(_0x436e4c,{'method':method,'headers':{'Content-Type':_0x5c6e98(0x22d),'Cookie':_0x5165b8,'X-Invoke-Source':_0x5c6e98(0x1a1),...headers},'body':_0xa6006c?JSON[_0x5c6e98(0x214)](_0xa6006c):undefined,'signal':_0x5e1e2a[_0x5c6e98(0x1fb)]});let _0x470670;try{_0x470670=await _0x967307[_0x5c6e98(0x227)]();}catch(_0x54974b){if(_0x54974b instanceof Error&&_0x54974b['name']===_0x5c6e98(0x200))throw CliErrors[_0x5c6e98(0x228)](_0x5c6e98(0x14b)+_0x436e4c);if(_0x967307['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x5c6e98(0x228)](_0x5c6e98(0x232)+_0x967307[_0x5c6e98(0x17f)]+')',_0x967307[_0x5c6e98(0x17f)]>=0x190?_0x5c6e98(0x23c):undefined);}if(!_0x967307['ok']||_0x470670[_0x5c6e98(0x14a)]===![])throw CliErrors[_0x5c6e98(0x228)](_0x470670[_0x5c6e98(0x1bf)]||_0x470670[_0x5c6e98(0x1ac)]||_0x5c6e98(0x1d9)+_0x967307['status'],_0x470670[_0x5c6e98(0x235)]?_0x5c6e98(0x19c)+_0x470670[_0x5c6e98(0x235)]:undefined);return _0x470670;}catch(_0x3d596a){if(_0x3d596a instanceof CliError)throw _0x3d596a;if(_0x3d596a instanceof Error&&_0x3d596a['name']==='AbortError')throw CliErrors[_0x5c6e98(0x228)](_0x5c6e98(0x14b)+_0x436e4c);throw createFetchFailureError(_0x436e4c,_0x3d596a);}finally{clearTimeout(_0x1d520f);}}function a208_0x7059(_0xf4c161,_0x19030f){_0xf4c161=_0xf4c161-0x131;const _0x2347e2=a208_0x2347();let _0x7059d8=_0x2347e2[_0xf4c161];return _0x7059d8;}async function apiFormRequest(_0x2dffda,_0x5e48bc,_0x3c2f42={}){const _0x43f3fd=a208_0x532215,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x3c2f42,_0x582b34=_activeCookie||getCookie(),_0x3189be=''+getApiDomain()+_0x2dffda,_0x1e9a84=new AbortController(),_0x4b9c46=setTimeout(()=>_0x1e9a84[_0x43f3fd(0x180)](),timeout);try{const _0x320931=await fetch(_0x3189be,{'method':_0x43f3fd(0x136),'headers':{'Cookie':_0x582b34,'X-Invoke-Source':_0x43f3fd(0x1a1)},'body':_0x5e48bc,'signal':_0x1e9a84[_0x43f3fd(0x1fb)]});let _0x2ef060;try{_0x2ef060=await _0x320931['json']();}catch(_0xdf0ccf){if(_0xdf0ccf instanceof Error&&_0xdf0ccf[_0x43f3fd(0x21a)]===_0x43f3fd(0x200))throw CliErrors['apiError'](_0x43f3fd(0x14b)+_0x3189be);throw CliErrors[_0x43f3fd(0x228)](_0x43f3fd(0x232)+_0x320931[_0x43f3fd(0x17f)]+')',_0x320931[_0x43f3fd(0x17f)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x320931['ok']||_0x2ef060[_0x43f3fd(0x14a)]===![])throw CliErrors[_0x43f3fd(0x228)](_0x2ef060[_0x43f3fd(0x1bf)]||_0x2ef060[_0x43f3fd(0x1ac)]||_0x43f3fd(0x1d9)+_0x320931[_0x43f3fd(0x17f)],_0x2ef060[_0x43f3fd(0x235)]?_0x43f3fd(0x19c)+_0x2ef060[_0x43f3fd(0x235)]:undefined);return _0x2ef060;}catch(_0x247824){if(_0x247824 instanceof CliError)throw _0x247824;if(_0x247824 instanceof Error&&_0x247824[_0x43f3fd(0x21a)]===_0x43f3fd(0x200))throw CliErrors[_0x43f3fd(0x228)]('Request\x20timeout:\x20'+_0x3189be);throw createFetchFailureError(_0x3189be,_0x247824);}finally{clearTimeout(_0x4b9c46);}}export async function uploadDevelopmentFile(_0x5f21ca,_0x540ff8){const _0x470105=a208_0x532215,_0x27ee05=await readFile(_0x540ff8),_0x5dee8d=new FormData();_0x5dee8d['append'](_0x470105(0x1ef),_0x5f21ca),_0x5dee8d[_0x470105(0x220)](_0x470105(0x233),new Blob([new Uint8Array(_0x27ee05)]),basename(_0x540ff8));const _0x47d019=await apiFormRequest(_0x470105(0x199),_0x5dee8d);return _0x47d019[_0x470105(0x17a)];}export async function queryDevelopmentFileUrl(_0x1b0d8f,_0x14b715={}){const _0x453f02=a208_0x532215,_0x5495e1=await apiRequest(_0x453f02(0x1c4),{'method':_0x453f02(0x136),'body':{'filePath':_0x1b0d8f,'downloadFlag':_0x14b715['download']??![],..._0x14b715['longTerm']?{'longTerm':!![]}:{}}});return _0x5495e1[_0x453f02(0x17a)];}export async function recognizeDevelopmentOcr(_0x356934,_0x1f2d26){const _0x29ceb3=a208_0x532215,_0x3ab59e=new URLSearchParams({'url':_0x1f2d26[_0x29ceb3(0x13e)],'type':_0x1f2d26[_0x29ceb3(0x167)],'appCode':_0x356934}),_0x3cc108=await apiRequest(_0x29ceb3(0x23f)+_0x3ab59e[_0x29ceb3(0x174)](),{'method':_0x29ceb3(0x1c2)});return _0x3cc108[_0x29ceb3(0x17a)];}function isAuthFailure(_0x1343a0){const _0x36edf5=a208_0x532215,_0x3a637d=_0x1343a0[_0x36edf5(0x1bf)]||_0x1343a0[_0x36edf5(0x1ac)]||_0x1343a0['data']?.[_0x36edf5(0x1ac)]||_0x1343a0[_0x36edf5(0x1be)]||_0x1343a0['error']||'';return _0x1343a0['errorCode']===_0x36edf5(0x172)||_0x1343a0['code']===0x191||_0x1343a0[_0x36edf5(0x20b)]==='401'||_0x3a637d[_0x36edf5(0x175)](_0x36edf5(0x142))||_0x3a637d['includes'](_0x36edf5(0x22e))||_0x3a637d[_0x36edf5(0x175)]('登录')||_0x3a637d[_0x36edf5(0x175)]('认证');}export async function platformFetch(_0x1638ac,_0x5f4f5b){const _0x276205=a208_0x532215;let _0x592b9f;try{_0x592b9f=await fetch(_0x1638ac,{'method':_0x5f4f5b[_0x276205(0x226)]??_0x276205(0x1c2),'headers':{'Content-Type':_0x276205(0x22d),'Cookie':_0x5f4f5b['cookie'],'X-Invoke-Source':'cli:rabetbase'},..._0x5f4f5b['body']&&{'body':JSON[_0x276205(0x214)](_0x5f4f5b[_0x276205(0x22f)])}});}catch(_0x4e0b7c){throw createFetchFailureError(_0x1638ac,_0x4e0b7c);}let _0x4eac50;try{_0x4eac50=await _0x592b9f[_0x276205(0x227)]();}catch(_0x39cc66){if(!_0x592b9f['ok']){if(_0x592b9f[_0x276205(0x17f)]===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x276205(0x228)](_0x5f4f5b[_0x276205(0x1f2)]+_0x276205(0x20f)+_0x592b9f['status']);}throw createFetchFailureError(_0x1638ac,_0x39cc66);}if(_0x4eac50===null||typeof _0x4eac50!=='object'||Array[_0x276205(0x184)](_0x4eac50)){if(_0x592b9f[_0x276205(0x17f)]===0x191)throw CliErrors['authRequired']();if(_0x592b9f['ok'])throw createIndeterminateResponseError(_0x5f4f5b[_0x276205(0x1f2)]);throw CliErrors[_0x276205(0x228)](_0x5f4f5b[_0x276205(0x1f2)]+_0x276205(0x139)+(!_0x592b9f['ok']?_0x276205(0x1fc)+_0x592b9f['status']:'')+_0x276205(0x1cd));}const _0x24cfa6=typeof _0x4eac50['errorCode']===_0x276205(0x178)||typeof _0x4eac50[_0x276205(0x235)]===_0x276205(0x208),_0x39740f=_0x24cfa6?String(_0x4eac50[_0x276205(0x235)])[_0x276205(0x197)]():'',_0x141426=_0x4eac50[_0x276205(0x14a)]===![]||_0x24cfa6&&_0x39740f!==_0x276205(0x1af);if(!_0x592b9f['ok']||_0x141426){if(_0x592b9f['status']===0x191||isAuthFailure(_0x4eac50))throw CliErrors[_0x276205(0x133)]();throw createPlatformApiError(_0x4eac50[_0x276205(0x1bf)]||_0x4eac50[_0x276205(0x1ac)]||_0x5f4f5b['label']+_0x276205(0x139)+(!_0x592b9f['ok']?',\x20HTTP\x20'+_0x592b9f[_0x276205(0x17f)]:''),_0x4eac50['errorCode']??_0x4eac50[_0x276205(0x20b)]);}if(_0x4eac50['success']!==!![]||_0x4eac50['errorCode']!==_0x276205(0x1af))throw createIndeterminateResponseError(_0x5f4f5b[_0x276205(0x1f2)]);return _0x4eac50[_0x276205(0x17a)];}export async function platformRequest(_0x38300e,_0x4e25e8){const _0x373840=a208_0x532215;if(/^https?:\/\//i[_0x373840(0x1fa)](_0x38300e))throw CliErrors[_0x373840(0x156)](_0x373840(0x194)+_0x38300e,'Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.');const _0x25f041=_0x38300e[_0x373840(0x18c)]('/')?_0x38300e:'/'+_0x38300e;return platformFetch(''+getApiDomain()+_0x25f041,_0x4e25e8);}const MAX_KNOWLEDGE_BASE_PAGE_SIZE=0x64;function parseKnowledgeBaseInteger(_0x122063,_0x597a70){const _0x531f9e=a208_0x532215,_0x6e6716=typeof _0x122063==='number'?_0x122063:typeof _0x122063===_0x531f9e(0x178)&&/^(0|[1-9]\d*)$/['test'](_0x122063)?Number(_0x122063):Number[_0x531f9e(0x1c6)],_0x4b478d=Number['isSafeInteger'](_0x6e6716)&&(_0x597a70==='id'?_0x6e6716>0x0:_0x6e6716>=0x0);if(!_0x4b478d)throw CliErrors[_0x531f9e(0x228)](_0x531f9e(0x15a)+_0x597a70+'.');return _0x6e6716;}function parseKnowledgeBaseText(_0x433387,_0x2b3369){const _0xa50991=a208_0x532215;if(typeof _0x433387===_0xa50991(0x178)&&(_0x2b3369===_0xa50991(0x1ea)||_0x433387['trim']()))return _0x433387;throw CliErrors[_0xa50991(0x228)](_0xa50991(0x1fe)+_0x2b3369+'.');}function parseKnowledgeBaseRecord(_0x5d1ad4){const _0x2b8aaa=a208_0x532215;if(!_0x5d1ad4||typeof _0x5d1ad4!==_0x2b8aaa(0x21d)||Array[_0x2b8aaa(0x184)](_0x5d1ad4))throw CliErrors[_0x2b8aaa(0x228)](_0x2b8aaa(0x16c));const _0x1fac99=_0x5d1ad4;if(_0x1fac99[_0x2b8aaa(0x1b7)]!=='company'&&_0x1fac99[_0x2b8aaa(0x1b7)]!=='personal')throw CliErrors[_0x2b8aaa(0x228)]('Knowledge-base\x20response\x20contains\x20an\x20invalid\x20scope.');const _0x5f1643={'id':parseKnowledgeBaseInteger(_0x1fac99['id'],'id'),'scope':_0x1fac99[_0x2b8aaa(0x1b7)],'appCode':parseKnowledgeBaseText(_0x1fac99[_0x2b8aaa(0x1ef)],_0x2b8aaa(0x1ef)),'title':parseKnowledgeBaseText(_0x1fac99[_0x2b8aaa(0x222)],_0x2b8aaa(0x222)),'version':parseKnowledgeBaseInteger(_0x1fac99[_0x2b8aaa(0x234)],_0x2b8aaa(0x234)),'content':parseKnowledgeBaseText(_0x1fac99[_0x2b8aaa(0x1ea)],_0x2b8aaa(0x1ea))};return(_0x1fac99['createTime']===null||typeof _0x1fac99[_0x2b8aaa(0x23b)]===_0x2b8aaa(0x178)||typeof _0x1fac99['createTime']===_0x2b8aaa(0x208))&&(_0x5f1643[_0x2b8aaa(0x23b)]=_0x1fac99[_0x2b8aaa(0x23b)]),(_0x1fac99[_0x2b8aaa(0x132)]===null||typeof _0x1fac99[_0x2b8aaa(0x132)]===_0x2b8aaa(0x178)||typeof _0x1fac99['updateTime']===_0x2b8aaa(0x208))&&(_0x5f1643[_0x2b8aaa(0x132)]=_0x1fac99[_0x2b8aaa(0x132)]),_0x5f1643;}export async function listEnterpriseKnowledgeBases(_0x3e340d,_0x32476b={}){const _0x3e38cb=a208_0x532215,_0x4d05ec=_0x32476b['pageSize']??0x32;if(!Number[_0x3e38cb(0x187)](_0x4d05ec)||_0x4d05ec<0x1||_0x4d05ec>MAX_KNOWLEDGE_BASE_PAGE_SIZE)throw CliErrors[_0x3e38cb(0x156)](_0x3e38cb(0x177)+MAX_KNOWLEDGE_BASE_PAGE_SIZE+'.');const _0x1085ff=await platformRequest('/admin/knowledge-base/get-list',{'method':'POST','cookie':_0x3e340d,'label':_0x3e38cb(0x1b4),'body':{'currentPage':_0x32476b[_0x3e38cb(0x1a5)]??0x1,'pageSize':_0x4d05ec,'scope':_0x3e38cb(0x1ce),..._0x32476b[_0x3e38cb(0x1ef)]?{'appCode':_0x32476b[_0x3e38cb(0x1ef)]}:{},..._0x32476b['title']?{'title':_0x32476b['title']}:{}}});if(!_0x1085ff||typeof _0x1085ff!==_0x3e38cb(0x21d)||Array[_0x3e38cb(0x184)](_0x1085ff)||!Array[_0x3e38cb(0x184)](_0x1085ff['tableData']))throw CliErrors[_0x3e38cb(0x228)](_0x3e38cb(0x168));const _0x57f985=extractPaging(_0x1085ff);if(!_0x57f985||!Number[_0x3e38cb(0x1b6)](_0x57f985[_0x3e38cb(0x1a5)])||!Number[_0x3e38cb(0x1b6)](_0x57f985['pageSize'])||!Number['isInteger'](_0x57f985[_0x3e38cb(0x218)])||_0x57f985[_0x3e38cb(0x1a5)]<0x1||_0x57f985[_0x3e38cb(0x165)]<0x1||_0x57f985[_0x3e38cb(0x165)]>MAX_KNOWLEDGE_BASE_PAGE_SIZE||_0x57f985['totalCount']<0x0)throw CliErrors[_0x3e38cb(0x228)](_0x3e38cb(0x170));return{'items':extractList(_0x1085ff)['map'](parseKnowledgeBaseRecord),'paging':_0x57f985};}export async function getEnterpriseKnowledgeBase(_0x470688,_0x38ba1d){const _0x7f85fe=a208_0x532215,_0x30845b=await platformRequest(_0x7f85fe(0x1e1)+buildQuery({'id':_0x38ba1d}),{'cookie':_0x470688,'label':_0x7f85fe(0x1ff)});return parseKnowledgeBaseRecord(_0x30845b);}export async function createEnterpriseKnowledgeBase(_0x2a4fbc,_0x72b6c4){const _0x16397c=a208_0x532215,_0x2a3da1=await platformRequest(_0x16397c(0x146),{'method':_0x16397c(0x136),'cookie':_0x2a4fbc,'label':'Create\x20enterprise\x20knowledge\x20base','body':{'scope':'company',..._0x72b6c4}});return parseKnowledgeBaseRecord(_0x2a3da1);}export async function updateEnterpriseKnowledgeBase(_0x952ef7,_0x3f8d26){const _0x5500e0=a208_0x532215;if(_0x3f8d26[_0x5500e0(0x222)]===undefined&&_0x3f8d26[_0x5500e0(0x1ea)]===undefined)throw CliErrors['validation']('Knowledge-base\x20update\x20requires\x20title\x20or\x20content.');const _0x44d51c=await platformRequest(_0x5500e0(0x14e),{'method':_0x5500e0(0x136),'cookie':_0x952ef7,'label':_0x5500e0(0x1e7),'body':{'id':_0x3f8d26['id'],..._0x3f8d26[_0x5500e0(0x222)]!==undefined?{'title':_0x3f8d26['title']}:{},..._0x3f8d26[_0x5500e0(0x1ea)]!==undefined?{'content':_0x3f8d26['content']}:{}}});return parseKnowledgeBaseRecord(_0x44d51c);}export async function deleteEnterpriseKnowledgeBase(_0x83b761,_0x45519f){const _0x256c83=a208_0x532215;await platformRequest('/admin/knowledge-base/delete',{'method':_0x256c83(0x136),'cookie':_0x83b761,'label':'Delete\x20enterprise\x20knowledge\x20base','body':{'id':_0x45519f}});}function cleanNewlines(_0x238902){const _0x43700a=a208_0x532215;return _0x238902[_0x43700a(0x162)](/[\r\n]+/g,'\x20')['trim']();}function cleanDatasetName(_0x1eb289){const _0x432dfa=a208_0x532215;if(!_0x1eb289[_0x432dfa(0x21a)])return _0x1eb289;return{..._0x1eb289,'name':cleanNewlines(_0x1eb289[_0x432dfa(0x21a)])};}export async function fetchModelList(_0xe2b1d6,_0x579133){const _0x5bb208=a208_0x532215,_0x313448=getEnv(),_0x54aa38=new URLSearchParams({'appcode':_0xe2b1d6,'otype':'array'}),_0x1c3beb='/api/node-toolbox/dataset/model-list?'+_0x54aa38[_0x5bb208(0x174)]();logger[_0x5bb208(0x225)](_0x5bb208(0x18f),_0x5bb208(0x210)+_0x313448+')',{'apiPath':_0x1c3beb});const _0x3650c7=await platformRequest(_0x1c3beb,{'cookie':_0x579133,'label':'Fetch\x20datasets'}),_0x2b71d2=(_0x3650c7['configArray']??[])[_0x5bb208(0x1bb)](cleanDatasetName);return{'configArray':_0x2b71d2,'count':_0x2b71d2[_0x5bb208(0x1cc)]};}export async function fetchDatasetDoc(_0x2b07e4){const _0x446207=a208_0x532215,{appCode:_0x5f55e3,cookie:_0x57a478,datasetCode:_0x2332fe,datasetId:_0x19d586,extraParams:_0x39b061}=_0x2b07e4,_0x37cba5=await platformRequest(_0x446207(0x181),{'method':'POST','body':{'appCode':_0x5f55e3,'datasetCode':_0x2332fe,'datasetId':_0x19d586,..._0x39b061||{}},'cookie':_0x57a478,'label':_0x446207(0x209)+_0x2332fe+')'});if(!_0x37cba5||typeof _0x37cba5['markdown']!=='string')throw new Error(_0x446207(0x1a6)+_0x2332fe+_0x446207(0x13a));return _0x37cba5[_0x446207(0x182)];}export async function getMenuTree(_0x49fb5b,_0x2ec910){const _0x31e3f8=a208_0x532215,_0x4f7854=new URLSearchParams({'appCode':_0x49fb5b});return platformRequest(_0x31e3f8(0x1e0)+_0x4f7854['toString'](),{'cookie':_0x2ec910,'label':_0x31e3f8(0x149)});}export async function createMenuRecord(_0x34cb3f,_0x3fb171,_0x561f9a){const _0x4afdf6=a208_0x532215;return platformRequest(_0x4afdf6(0x18b),{'method':_0x4afdf6(0x136),'body':_0x34cb3f,'cookie':_0x3fb171,'label':_0x561f9a});}export async function updateMenuRecord(_0x48d5d3,_0xc77899,_0x35e031){const _0xc0c1f3=a208_0x532215;return platformRequest(_0xc0c1f3(0x1d7),{'method':_0xc0c1f3(0x136),'body':_0x48d5d3,'cookie':_0xc77899,'label':_0x35e031});}export async function deleteMenuRecord(_0x4e1f75,_0x5dd14d,_0xa5a03d){const _0x73b2e4=a208_0x532215;return platformRequest(_0x73b2e4(0x205),{'method':'POST','body':{'id':_0x4e1f75},'cookie':_0x5dd14d,'label':_0xa5a03d});}export async function batchDeleteMenuRecords(_0x203fa7,_0x139b84,_0x248711){const _0x231115=a208_0x532215;return platformRequest(_0x231115(0x1d5),{'method':_0x231115(0x136),'body':{'idList':_0x203fa7},'cookie':_0x139b84,'label':_0x248711});}export async function startMenuRegroup(_0x4bbfb5,_0x42bb26,_0x30a893){const _0xc4692a=a208_0x532215;return platformRequest(_0xc4692a(0x1de),{'method':_0xc4692a(0x136),'body':_0x4bbfb5,'cookie':_0x42bb26,'label':_0x30a893});}export async function getAsyncTaskStatus(_0x2e4d29,_0x2697b0,_0x219b52){const _0x3e4e90=a208_0x532215,_0x31ddc6=new URLSearchParams({'appCode':_0x2697b0});return platformRequest(_0x3e4e90(0x202)+encodeURIComponent(_0x2e4d29)+'?'+_0x31ddc6['toString'](),{'cookie':_0x219b52,'label':_0x3e4e90(0x192)+_0x2e4d29});}export async function listBffScripts(_0x4e7c65,_0x18321b,_0x22b3c2){const _0x151974=a208_0x532215;let _0x483efd=_0x151974(0x242)+_0x4e7c65;if(_0x18321b)_0x483efd+=_0x151974(0x1f3)+_0x18321b;const _0x5f3670=await apiRequest(_0x483efd);let _0x4457d1=extractList(_0x5f3670[_0x151974(0x17a)]);if(_0x22b3c2?.[_0x151974(0x191)]){const _0x28fbe8=_0x22b3c2['scriptName'][_0x151974(0x19d)]();_0x4457d1=_0x4457d1[_0x151974(0x1d3)](_0x11571c=>_0x11571c[_0x151974(0x188)]?.[_0x151974(0x19d)]()[_0x151974(0x175)](_0x28fbe8)||_0x11571c['description']?.[_0x151974(0x19d)]()[_0x151974(0x175)](_0x28fbe8));}return _0x4457d1;}export async function getBffScriptInfo(_0x14d95d){const _0x10584c=a208_0x532215,_0x4b7696=await apiRequest(_0x10584c(0x1b9)+_0x14d95d);if(!_0x4b7696['data'])throw CliErrors[_0x10584c(0x156)](_0x10584c(0x1ab)+_0x14d95d);return _0x4b7696['data'];}export async function saveBffScript(_0x36c8f6){const _0x22a359=a208_0x532215,_0x3681af=await apiRequest('/api/management/library/scripts/save',{'method':_0x22a359(0x136),'body':_0x36c8f6}),{id:_0x376ee1,entity:_0x5e51ef}=normalizeEntityWithIdResponse(_0x3681af[_0x22a359(0x17a)]);if(_0x376ee1!==undefined){const _0x3fc9c2=typeof _0x5e51ef[_0x22a359(0x188)]===_0x22a359(0x178)||typeof _0x5e51ef[_0x22a359(0x1c3)]==='string'?_0x5e51ef:undefined;return{'id':_0x376ee1,'script':_0x3fc9c2};}throw CliErrors[_0x22a359(0x228)](_0x22a359(0x17b));}export async function deleteBffScript(_0x3615b3){const _0x1752a8=a208_0x532215;await apiRequest(_0x1752a8(0x1fd),{'method':_0x1752a8(0x136),'body':{'id':_0x3615b3}});}export async function getBffScriptStatistics(_0x3c6e44){const _0x5f5017=a208_0x532215,_0x14fe8a=await apiRequest(_0x5f5017(0x22b)+_0x3c6e44);return extractList(_0x14fe8a[_0x5f5017(0x17a)]);}export async function clearBffScriptCache(){const _0x2b876d=a208_0x532215,_0x560c30=await apiRequest(_0x2b876d(0x245),{'method':_0x2b876d(0x136),'useRuntime':!![]});return typeof _0x560c30['data']===_0x2b876d(0x178)?_0x560c30[_0x2b876d(0x17a)]:'';}export async function listBffDatasetOperations(_0x480789,_0x5c16c9){const _0x2bd7dd=a208_0x532215,_0x72688a=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x2bd7dd(0x136),'body':{'appCode':_0x480789,'datasetId':_0x5c16c9}});return _0x72688a[_0x2bd7dd(0x17a)];}export async function listSqlQueries(_0x1ac8cf,_0x5c2ca1){const _0x34e481=a208_0x532215,_0x2ebacb=await apiRequest(_0x34e481(0x204),{'method':'POST','body':{'appCode':_0x1ac8cf,'currentPage':_0x5c2ca1?.[_0x34e481(0x1a5)]??0x1,'pageSize':_0x5c2ca1?.[_0x34e481(0x165)]??0x32,'sqlCode':_0x5c2ca1?.[_0x34e481(0x193)],'sqlName':_0x5c2ca1?.[_0x34e481(0x1e2)]}});return _0x2ebacb['data'];}export async function getSqlQueryInfo(_0x35dc10,_0x4b373c){const _0x5b638a=a208_0x532215,_0x48bcd7=await listSqlQueries(_0x35dc10,{'sqlCode':_0x4b373c}),_0x44a053=_0x48bcd7['tableData']?.[0x0];if(!_0x44a053)throw CliErrors[_0x5b638a(0x156)](_0x5b638a(0x240)+_0x4b373c);return _0x44a053;}export async function getSqlQueryDetail(_0x5cf862){const _0x506e34=a208_0x532215,_0x2c4a01=await apiRequest('/smartapi/custom/getUserCustomSql'+(_0x506e34(0x236)+encodeURIComponent(_0x5cf862)));if(!_0x2c4a01['data'])throw CliErrors[_0x506e34(0x156)](_0x506e34(0x240)+_0x5cf862);return _0x2c4a01[_0x506e34(0x17a)];}export async function getSqlQueryDetailById(_0x1e65f3){const _0x560bef=a208_0x532215,_0xe6ea21=await apiRequest(_0x560bef(0x16e)+_0x1e65f3);if(!_0xe6ea21[_0x560bef(0x17a)])throw CliErrors['validation'](_0x560bef(0x1a3)+_0x1e65f3);return _0xe6ea21[_0x560bef(0x17a)];}export async function createSqlQuery(_0x414f6b){const _0xc2abc8=a208_0x532215,_0x48f8d0=await apiRequest(_0xc2abc8(0x13b),{'method':_0xc2abc8(0x136),'body':_0x414f6b}),{id:_0x3117f2,entity:_0x1d5414}=normalizeEntityWithIdResponse(_0x48f8d0['data']);if(!(_0xc2abc8(0x193)in _0x1d5414)&&_0x3117f2)return getSqlQueryDetailById(_0x3117f2);return normalizeSqlQueryEntity(_0x1d5414);}export async function updateSqlQuery(_0x2ef988){const _0x5452a2=a208_0x532215,_0x1fc7ac=await apiRequest(_0x5452a2(0x14f),{'method':_0x5452a2(0x136),'body':_0x2ef988}),{id:_0x40a80a,entity:_0x146369}=normalizeEntityWithIdResponse(_0x1fc7ac[_0x5452a2(0x17a)]);if(!('sqlCode'in _0x146369)){if(_0x2ef988[_0x5452a2(0x193)])return getSqlQueryDetail(_0x2ef988['sqlCode']);if(_0x40a80a)return getSqlQueryDetailById(_0x40a80a);}return normalizeSqlQueryEntity(_0x146369);}export async function deleteSqlQuery(_0x543d74){const _0x52b909=a208_0x532215;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x52b909(0x136),'body':_0x543d74});}export async function saveSqlQuery(_0x431e71){const _0x1815c3=a208_0x532215,_0x22afe6=await apiRequest(_0x1815c3(0x137),{'method':_0x1815c3(0x136),'body':_0x431e71});return _0x22afe6[_0x1815c3(0x17a)];}function normalizeSqlQueryEntity(_0x35a9c1){const _0x1dedbb=a208_0x532215;return{..._0x35a9c1,'id':Number(_0x35a9c1['id']),'dbId':_0x35a9c1[_0x1dedbb(0x161)]==null?undefined:Number(_0x35a9c1[_0x1dedbb(0x161)]),'version':_0x35a9c1[_0x1dedbb(0x234)]==null?undefined:Number(_0x35a9c1['version'])};}export async function executeSql(_0x21cbdc,_0x158ae4,_0x299255){const _0x521f21=a208_0x532215,_0x5c0f21=await apiRequest(_0x521f21(0x140),{'method':_0x521f21(0x136),'body':{'appCode':_0x21cbdc,'sqlCode':_0x158ae4,..._0x299255&&{'params':_0x299255}},'useRuntime':!![]});return _0x5c0f21['data'];}export async function executeDatasetDataOperation(_0x37b19a,_0x2ba953,_0x5607ca,_0x34f14d={}){const _0x20421f=a208_0x532215;try{const _0x12c7e9=await apiRequest('/api/'+_0x37b19a+'/'+_0x2ba953+'/'+_0x5607ca,{'method':_0x20421f(0x136),'body':_0x34f14d,'useRuntime':!![]});return _0x12c7e9[_0x20421f(0x17a)];}catch(_0x5e649f){if(_0x5607ca===_0x20421f(0x21c)&&_0x5e649f instanceof CliError&&_0x5e649f['code']===_0x20421f(0x186)&&_0x34f14d['id']!==undefined&&_0x34f14d['id']!==null&&_0x34f14d['id']!==''){const _0x134904=await apiRequest('/api/'+_0x37b19a+'/'+_0x2ba953+_0x20421f(0x1a0),{'method':'POST','body':{'where':{'id':{'$eq':_0x34f14d['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x5d767f=Array[_0x20421f(0x184)](_0x134904[_0x20421f(0x17a)]?.[_0x20421f(0x189)])?_0x134904['data'][_0x20421f(0x189)]:[];return _0x5d767f[0x0]??null;}throw _0x5e649f;}}export async function listDatasets(_0x1a0959,_0x2c1fed){const _0x591340=a208_0x532215,_0x1ebfd7={'appCode':_0x1a0959,'deleted':_0x2c1fed?.[_0x591340(0x1c8)]??![]};if(_0x2c1fed?.[_0x591340(0x20b)])_0x1ebfd7[_0x591340(0x20b)]=_0x2c1fed['code'];if(_0x2c1fed?.[_0x591340(0x21a)])_0x1ebfd7[_0x591340(0x21a)]=_0x2c1fed[_0x591340(0x21a)];const _0x920a30=await apiRequest(_0x591340(0x229),{'method':_0x591340(0x136),'body':_0x1ebfd7});return extractList(_0x920a30[_0x591340(0x17a)]);}export async function deleteDataset(_0x578e99,_0x1d00e4){const _0x484fcb=a208_0x532215;await apiRequest(_0x484fcb(0x19f),{'method':_0x484fcb(0x136),'body':{'appCode':_0x578e99,'datasetId':_0x1d00e4}});}export async function restoreDataset(_0x98a10f,_0x499113){const _0x1fd5c8=a208_0x532215;await apiRequest(_0x1fd5c8(0x15f),{'method':_0x1fd5c8(0x136),'body':{'appCode':_0x98a10f,'datasetId':_0x499113}});}export async function previewTextGeneratedDataset(_0x265215,_0xedbf9){const _0x2eb23d=a208_0x532215,_0x15b404=await apiRequest(_0x2eb23d(0x1a9),{'method':_0x2eb23d(0x136),'body':{'appCode':_0x265215,'datasetName':_0xedbf9['datasetName'],'requirementDescription':_0xedbf9['requirementDescription']},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x15b404[_0x2eb23d(0x17a)];}export async function startTextGeneratedDataset(_0x23f6c4,_0x1f7e94,_0x31bbee){const _0x593af3=a208_0x532215,_0x2e103b=await apiRequest(_0x593af3(0x217),{'method':_0x593af3(0x136),'body':{'appCode':_0x23f6c4,..._0x31bbee?.[_0x593af3(0x159)]?{'clientOperationId':_0x31bbee['clientOperationId']}:{},'design':_0x1f7e94},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x2e103b[_0x593af3(0x17a)];}export async function getTextGeneratedDatasetStatus(_0x286dff,_0x4d574f){const _0x3ee4ad=a208_0x532215,_0x37f5c8=new URLSearchParams({'appCode':_0x286dff});_0x4d574f[_0x3ee4ad(0x16b)]&&_0x37f5c8[_0x3ee4ad(0x1ed)](_0x3ee4ad(0x16b),_0x4d574f[_0x3ee4ad(0x16b)]);_0x4d574f[_0x3ee4ad(0x159)]&&_0x37f5c8['set']('clientOperationId',_0x4d574f['clientOperationId']);const _0x5a5c7c=await apiRequest(_0x3ee4ad(0x173)+_0x37f5c8[_0x3ee4ad(0x174)]());return _0x5a5c7c[_0x3ee4ad(0x17a)];}export async function searchDatasets(_0x15d350,_0x53bce9){const _0x39fcd7=a208_0x532215,_0xabe041=await listDatasets(_0x15d350,{'name':_0x53bce9}),_0x157d92=_0x53bce9[_0x39fcd7(0x19d)](),_0x2b4b47=new Set(_0xabe041['map'](_0x43f5f0=>_0x43f5f0['id'])),_0x3e50d9=_0xabe041[_0x39fcd7(0x1d3)](_0x9b93f3=>_0x9b93f3[_0x39fcd7(0x1e4)]?.['tableName']?.[_0x39fcd7(0x19d)]()[_0x39fcd7(0x175)](_0x157d92)||_0x9b93f3[_0x39fcd7(0x1ad)]?.['toLowerCase']()[_0x39fcd7(0x175)](_0x157d92)),_0xd0fe33=await listDatasets(_0x15d350,{'code':_0x53bce9});for(const _0x481690 of _0xd0fe33){!_0x2b4b47[_0x39fcd7(0x1d2)](_0x481690['id'])&&(_0xabe041[_0x39fcd7(0x15c)](_0x481690),_0x2b4b47[_0x39fcd7(0x1b8)](_0x481690['id']));}return _0xabe041;}export function normalizeDatasetOperations(_0x330bad){const _0x2bdb00=a208_0x532215;if(Array[_0x2bdb00(0x184)](_0x330bad))return _0x330bad[_0x2bdb00(0x1d3)](_0x593b61=>_0x593b61!=null&&typeof _0x593b61===_0x2bdb00(0x21d));if(_0x330bad&&typeof _0x330bad===_0x2bdb00(0x21d))return Object[_0x2bdb00(0x1c0)](_0x330bad)['filter'](([,_0x337e30])=>_0x337e30!=null&&typeof _0x337e30===_0x2bdb00(0x21d))[_0x2bdb00(0x1bb)](([_0x5922a8,_0x162f5b])=>({..._0x162f5b,'name':_0x162f5b[_0x2bdb00(0x21a)]??_0x162f5b[_0x2bdb00(0x241)]??_0x5922a8}));return[];}export async function getDatasetDetail(_0x578d25){const _0xf2adb8=/^\d+$/['test'](_0x578d25)?'id':'code',_0x237ef1=await apiRequest('/smartapi/dataset/get-driven-data?'+_0xf2adb8+'='+_0x578d25);return _0x237ef1['data'];}export async function updateDrivenData(_0x15c983){const _0xc0b17f=a208_0x532215,_0x1fac90=await apiRequest(_0xc0b17f(0x196),{'method':_0xc0b17f(0x136),'body':_0x15c983});return _0x1fac90[_0xc0b17f(0x17a)];}export async function getDatasetOperations(_0x2348e6){const _0x330fde=a208_0x532215,_0x37b4ca=await getDatasetDetail(_0x2348e6),_0x2b3272=normalizeDatasetOperations(_0x37b4ca[_0x330fde(0x1f5)])[_0x330fde(0x1bb)](_0x5d8407=>({'name':_0x5d8407[_0x330fde(0x21a)]||_0x5d8407[_0x330fde(0x241)],'displayName':_0x5d8407[_0x330fde(0x20a)]||_0x5d8407[_0x330fde(0x21a)],'type':_0x5d8407['type'],'method':_0x5d8407['method'],'path':_0x5d8407[_0x330fde(0x238)],'enabled':_0x5d8407[_0x330fde(0x1eb)]??!![],'requestFields':_0x5d8407[_0x330fde(0x15b)],'responseFields':_0x5d8407[_0x330fde(0x163)]}));return{'dataset':{'id':_0x37b4ca['id']??_0x37b4ca[_0x330fde(0x19a)],'name':_0x37b4ca['name'],'code':_0x37b4ca[_0x330fde(0x20b)]||_0x37b4ca[_0x330fde(0x16a)],'tableName':_0x37b4ca['tableName']||_0x37b4ca[_0x330fde(0x1e4)]?.[_0x330fde(0x18e)]},'operations':_0x2b3272};}export async function getOperationDetail(_0x154f45,_0x36d041,_0x3bd6ca){const _0x2b2637=a208_0x532215;let _0xf394f9=_0x36d041;if(!/^\d+$/[_0x2b2637(0x1fa)](_0x36d041)){const _0x1ae75c=await listDatasets(_0x154f45,{'code':_0x36d041}),_0x18dac1=_0x1ae75c[_0x2b2637(0x1c1)](_0x4eae9f=>_0x4eae9f[_0x2b2637(0x20b)]===_0x36d041||String(_0x4eae9f['id'])===_0x36d041);if(!_0x18dac1)throw CliErrors[_0x2b2637(0x156)](_0x2b2637(0x1a2)+_0x36d041);_0xf394f9=String(_0x18dac1['id']);}const _0x30df6c=await getDatasetDetail(_0xf394f9),_0x2965d1=normalizeDatasetOperations(_0x30df6c[_0x2b2637(0x1f5)])[_0x2b2637(0x1c1)](_0x5b5760=>(_0x5b5760[_0x2b2637(0x21a)]||_0x5b5760[_0x2b2637(0x241)])===_0x3bd6ca);if(!_0x2965d1)throw CliErrors[_0x2b2637(0x156)](_0x2b2637(0x1df)+_0x3bd6ca+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x36d041);return{'dataset':{'id':_0x30df6c['id']??_0x30df6c[_0x2b2637(0x19a)],'name':_0x30df6c[_0x2b2637(0x21a)],'code':_0x30df6c[_0x2b2637(0x20b)]||_0x30df6c['modelCode'],'tableName':_0x30df6c['tableName']||_0x30df6c[_0x2b2637(0x1e4)]?.[_0x2b2637(0x18e)]},'operation':_0x2965d1};}export async function startGenerateStandardPages(_0x226679,_0x284a71,_0x4194e2){const _0x57dafd=a208_0x532215,_0x501144=await apiRequest(_0x57dafd(0x18d)+_0x284a71+_0x57dafd(0x195),{'method':_0x57dafd(0x136),'body':{'appCode':_0x226679,..._0x4194e2?.[_0x57dafd(0x159)]?{'clientOperationId':_0x4194e2[_0x57dafd(0x159)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x501144['data'];}export async function getGenerateStandardPagesStatus(_0x15733f,_0x35045e,_0x46d8e3){const _0x2241bd=a208_0x532215,_0x368897=new URLSearchParams({'appCode':_0x15733f});_0x46d8e3['operationId']&&_0x368897['set'](_0x2241bd(0x16b),_0x46d8e3['operationId']);_0x46d8e3[_0x2241bd(0x159)]&&_0x368897[_0x2241bd(0x1ed)](_0x2241bd(0x159),_0x46d8e3[_0x2241bd(0x159)]);const _0x3fbd64=await apiRequest(_0x2241bd(0x18d)+_0x35045e+_0x2241bd(0x1f8)+_0x368897[_0x2241bd(0x174)]());return _0x3fbd64[_0x2241bd(0x17a)];}export async function getStandardPageStatus(_0x4d7b9d,_0x2905b4){const _0x49300d=a208_0x532215,_0x2b0001=await apiRequest(_0x49300d(0x18d)+_0x2905b4+'/standard-page-status?appCode='+encodeURIComponent(_0x4d7b9d));return _0x2b0001[_0x49300d(0x17a)];}export async function tryGetStandardPageStatus(_0x5a1d93,_0x49864a){const _0x752057=a208_0x532215;try{return await getStandardPageStatus(_0x5a1d93,_0x49864a);}catch(_0x3133c9){if(_0x3133c9 instanceof CliError&&_0x3133c9[_0x752057(0x20b)]===_0x752057(0x186)&&/404|not found|non-json response/i[_0x752057(0x1fa)](_0x3133c9[_0x752057(0x1ac)]))return null;throw _0x3133c9;}}export async function syncStandardPages(_0x48d277,_0x2f6fdd){const _0x251203=a208_0x532215,_0x243f31=await apiRequest('/smartapi/lovrabet/dataset/'+_0x2f6fdd+'/sync-to-pages',{'method':'POST','body':{'appCode':_0x48d277}});return _0x243f31[_0x251203(0x17a)];}export async function getPageDetail(_0x5a8666){const _0x488980=a208_0x532215,_0x5eb8a8=await apiRequest(_0x488980(0x1f9)+_0x5a8666);if(!_0x5eb8a8[_0x488980(0x17a)])throw CliErrors[_0x488980(0x156)](_0x488980(0x1f6)+_0x5a8666);return _0x5eb8a8[_0x488980(0x17a)];}export async function listDeletedPages(_0x40d58a,_0x57d686,_0x2c4b75){const _0x171109=a208_0x532215,_0x57e2b9=new URLSearchParams({'appCode':_0x40d58a,'type':_0x57d686,'currentPage':String(_0x2c4b75[_0x171109(0x1a5)]),'pageSize':String(_0x2c4b75['pageSize'])}),_0x931b9f=await apiRequest(_0x171109(0x219)+_0x57e2b9[_0x171109(0x174)]());return _0x931b9f[_0x171109(0x17a)];}export async function restoreStandardPage(_0x23a904){const _0x3590ef=a208_0x532215;await apiRequest(_0x3590ef(0x23d),{'method':'POST','body':{'id':_0x23a904}});}export async function restoreJsxPage(_0x47f7a6,_0x3b55c7){const _0x298936=await apiRequest('/smartapi/webcode/page/restore',{'method':'POST','body':{'appCode':_0x47f7a6,'id':_0x3b55c7}});return _0x298936['data'];}export async function updatePage(_0x52b346,_0x26e51c,_0x3aef27,_0x19263b){const _0x468988=a208_0x532215,_0x458dd8=await apiRequest(_0x468988(0x198),{'method':_0x468988(0x136),'body':{'appCode':_0x52b346,'pageId':_0x26e51c,'code':_0x3aef27,'datasetIds':_0x19263b}});return _0x458dd8[_0x468988(0x17a)];}export function generateSdkCode(_0x10a92c,_0x12651e,_0x185421){const _0x3067e4=a208_0x532215,_0x26c320=_0x185421?.[_0x3067e4(0x135)]??!![],_0x1d6c9c=_0x3067e4(0x1b3)+_0x10a92c[_0x3067e4(0x20b)]?.[_0x3067e4(0x162)](/-/g,'_'),_0x482f4e=_0x12651e['name']||_0x12651e[_0x3067e4(0x241)]||'filter',_0x5224e0=[];_0x26c320&&_0x5224e0[_0x3067e4(0x15c)](_0x3067e4(0x17e),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0x5224e0[_0x3067e4(0x15c)](_0x3067e4(0x1b5)+_0x10a92c['name']+'\x20('+(_0x10a92c[_0x3067e4(0x18e)]||_0x3067e4(0x150))+')');if(_0x482f4e===_0x3067e4(0x1d3))_0x5224e0['push'](_0x3067e4(0x23e)+_0x1d6c9c+_0x3067e4(0x158),_0x3067e4(0x155),_0x3067e4(0x17d),_0x3067e4(0x1da),_0x3067e4(0x1a4));else{if(_0x482f4e===_0x3067e4(0x21c))_0x5224e0['push'](_0x3067e4(0x23e)+_0x1d6c9c+_0x3067e4(0x1b1));else{if(_0x482f4e==='create')_0x5224e0[_0x3067e4(0x15c)]('const\x20result\x20=\x20await\x20client.models.'+_0x1d6c9c+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x482f4e===_0x3067e4(0x143))_0x5224e0[_0x3067e4(0x15c)](_0x3067e4(0x23e)+_0x1d6c9c+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x482f4e==='delete'||_0x482f4e===_0x3067e4(0x1bd)?_0x5224e0['push'](_0x3067e4(0x23e)+_0x1d6c9c+_0x3067e4(0x213)):_0x5224e0['push'](_0x3067e4(0x23e)+_0x1d6c9c+'.'+_0x482f4e+_0x3067e4(0x134));}}}return _0x5224e0[_0x3067e4(0x1f1)]('\x0a');}export function generateSqlCodeTemplate(_0x2cd598,_0x192f73){const _0x2ccc48=a208_0x532215,_0x3f6eda=_0x192f73?.[_0x2ccc48(0x20e)]??_0x2ccc48(0x22c),_0xe92390=_0x192f73?.[_0x2ccc48(0x135)]??!![],_0x6892f1=[];return _0x6892f1[_0x2ccc48(0x15c)](_0x2ccc48(0x201)+_0x2cd598[_0x2ccc48(0x1e2)]+'\x20('+_0x2cd598[_0x2ccc48(0x193)]+')'),_0x3f6eda==='sdk'?(_0xe92390&&_0x6892f1[_0x2ccc48(0x15c)](_0x2ccc48(0x17e),'',_0x2ccc48(0x131),''),_0x6892f1[_0x2ccc48(0x15c)]('const\x20data\x20=\x20await\x20client.sql.execute({','\x20\x20sqlCode:\x20\x27'+_0x2cd598[_0x2ccc48(0x193)]+'\x27,',_0x2ccc48(0x1ec),_0x2ccc48(0x1a4),_0x2ccc48(0x160),_0x2ccc48(0x190))):_0x6892f1[_0x2ccc48(0x15c)](_0x2ccc48(0x20c),_0x2ccc48(0x1d4),_0x2ccc48(0x171),_0x2ccc48(0x239)+_0x2cd598['sqlCode']+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x2ccc48(0x1d1),_0x2ccc48(0x231),'}'),_0x6892f1[_0x2ccc48(0x1f1)]('\x0a');}export async function getErConfig(_0x3fe9bb,_0x3bc763){const _0x580465=await apiRequest('/smartapi/question/er-config',{'method':'POST','body':{'appCode':_0x3fe9bb,'dblinkId':_0x3bc763},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x580465['data'];}export async function getErRelationDetail(_0x5d8d45,_0x53e44a){const _0x208c76=a208_0x532215,_0x148570=new URLSearchParams({'appCode':_0x5d8d45,'relationId':String(_0x53e44a)});try{const _0x35a440=await apiRequest(_0x208c76(0x1e5)+_0x148570[_0x208c76(0x174)]());return _0x35a440[_0x208c76(0x17a)]?.['relation']??null;}catch(_0x418d2a){if(_0x418d2a instanceof CliError&&_0x418d2a[_0x208c76(0x20b)]===_0x208c76(0x186)&&(_0x418d2a[_0x208c76(0x1d8)]?.[_0x208c76(0x175)]('DATA_NOT_EXIST')||_0x418d2a[_0x208c76(0x1d8)]===_0x208c76(0x1aa)&&_0x418d2a[_0x208c76(0x1ac)]===_0x208c76(0x1e3)))return null;throw _0x418d2a;}}export async function createErRelation(_0x2eb79d){const _0x54780d=a208_0x532215,_0x4d1582=await apiRequest(_0x54780d(0x23a),{'method':'POST','body':_0x2eb79d,'allowNonJsonSuccess':!![]});return _0x4d1582['data'];}export async function updateErRelation(_0x142bb0){const _0x570e8c=a208_0x532215,_0x4d5849=await apiRequest(_0x570e8c(0x224),{'method':_0x570e8c(0x136),'body':_0x142bb0,'allowNonJsonSuccess':!![]});return _0x4d5849[_0x570e8c(0x17a)];}export async function deleteErRelation(_0x4c2611){const _0x41ce8d=a208_0x532215,_0x2a05ef=await apiRequest(_0x41ce8d(0x216),{'method':_0x41ce8d(0x136),'body':_0x4c2611,'allowNonJsonSuccess':!![]});return _0x2a05ef[_0x41ce8d(0x17a)];}export async function updateErBusinessGroup(_0x30525f){const _0x5b31e0=a208_0x532215,_0x2d2a02=await apiRequest(_0x5b31e0(0x145),{'method':_0x5b31e0(0x136),'body':_0x30525f,'allowNonJsonSuccess':!![]});return _0x2d2a02[_0x5b31e0(0x17a)];}function buildQuery(_0x1ebe1d){const _0x232ff3=a208_0x532215,_0x1e6912=new URLSearchParams();for(const [_0x5ce8cc,_0x403d33]of Object[_0x232ff3(0x1c0)](_0x1ebe1d)){if(_0x403d33===undefined||_0x403d33==='')continue;_0x1e6912[_0x232ff3(0x1ed)](_0x5ce8cc,String(_0x403d33));}const _0x28d576=_0x1e6912[_0x232ff3(0x174)]();return _0x28d576?'?'+_0x28d576:'';}export async function listNotificationChannelConfigs(_0x4df70b,_0x21fa96){const _0x309829=a208_0x532215,_0x4ee716=await apiRequest(_0x309829(0x21e)+buildQuery({'appCode':_0x4df70b,'channelType':_0x21fa96}));return Array[_0x309829(0x184)](_0x4ee716['data'])?_0x4ee716[_0x309829(0x17a)]:[];}export async function listAppConfigs(_0x3f83a6,_0x5ece9e){const _0x8207b0=a208_0x532215,_0x6a0c2c=await apiRequest(_0x8207b0(0x15e),{'method':_0x8207b0(0x136),'body':{'appCode':_0x3f83a6,..._0x5ece9e?.[_0x8207b0(0x246)]?{'key':_0x5ece9e[_0x8207b0(0x246)]}:{},..._0x5ece9e?.[_0x8207b0(0x1e8)]?{'tags':_0x5ece9e['tags']}:{}}});return extractAppConfigList(_0x6a0c2c['data']);}function a208_0x2347(){const _0x908abc=['requestFields','push','/smartapi/permit/user-role/get-user-list','/smartapi/app-config/list','/smartapi/dataset/restore-dataset','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','dbId','replace','responseFields','/smartapi/dblink/getList','pageSize','The\x20server\x20outcome\x20is\x20indeterminate.\x20Verify\x20current\x20state\x20before\x20retrying\x20any\x20mutation.','type','List\x20enterprise\x20knowledge\x20bases\x20returned\x20an\x20invalid\x20response\x20contract.','\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20after\x20HTTP\x20success.','modelCode','operationId','Knowledge-base\x20API\x20returned\x20an\x20invalid\x20record\x20contract.','remark','/smartapi/custom/getUserCustomSql?id=','/smartapi/dblink/testConnect','List\x20enterprise\x20knowledge\x20bases\x20returned\x20invalid\x20paging\x20metadata.','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','UNAUTHORIZED','/smartapi/dataset/text-generate/status?','toString','includes','defineProperty','Knowledge-base\x20pageSize\x20must\x20be\x20an\x20integer\x20between\x201\x20and\x20','string','/smartapi/db-analysis/status/','data','BFF\x20save\x20returned\x20no\x20valid\x20id','/smartapi/permit/role/create','\x20\x20pageSize:\x2020,','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','status','abort','/api/node-toolbox/api-doc-generator','markdown','/smartapi/app-config/delete','isArray','datasetTableCount','api_error','isSafeInteger','functionName','tableData','120VjTrKR','/smartapi/menu/create','startsWith','/smartapi/lovrabet/dataset/','tableName','fetch-model-list','const\x20results\x20=\x20data.execResult\x20||\x20[];','scriptName','Fetch\x20async\x20task\x20','sqlCode','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','/generate-standard-pages/start','/smartapi/dataset/update-driven-data','trim','/smartapi/lovrabet/update-page','/smartapi/common/uploadFile','modelId','userId','API\x20error\x20code:\x20','toLowerCase','/smartapi/dblink/getAllTableList','/smartapi/dataset/delete-dataset','/filter','cli:rabetbase','Dataset\x20not\x20found:\x20','SQL\x20query\x20not\x20found:\x20id=','});','currentPage','Invalid\x20response\x20format\x20(','permits','tableList','/smartapi/dataset/text-generate/preview','API\x20error\x20code:\x20306','BFF\x20script\x20not\x20found:\x20id=','message','description','\x20of\x20','0000','needPublic','.getOne(id);','platform-error-code','dataset_','List\x20enterprise\x20knowledge\x20bases','//\x20','isInteger','scope','add','/api/management/library/scripts/info?id=','summary','map','min','remove','errorMessage','errorMsg','entries','find','GET','scriptType','/smartapi/common/queryFileUrl','78oQIzkA','NaN','CUSTOM','deleted','needSelf','userTenantRelationList','platform-transport-failure','length',':\x20invalid\x20JSON\x20response\x20envelope','company','/smartapi/dblink/getTableDiffV2ByPage','list','\x20\x20});','has','filter','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','/smartapi/menu/batchDelete','roleName','/smartapi/menu/update','hint','API\x20error:\x20','\x20\x20currentPage:\x201,','Warning:\x20showing\x20first\x20','/smartapi/permit/user-role/update-user-list','pageIndex','/smartapi/menu/regroup','Operation\x20\x22','/smartapi/menu/find?','/admin/knowledge-base/get-one','sqlName','ER\x20relation\x20does\x20not\x20exist','dbtableConfig','/smartapi/question/er-config/cli/detail?','/smartapi/dblink/getOne','Update\x20enterprise\x20knowledge\x20base','tags','/smartapi/dblink/update','content','enabled','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','set','/smartapi/permit/role/get-permit-list','appCode','\x20apps.\x20','join','label','&type=','isFinite','operations','Page\x20not\x20found:\x20','username','/generate-standard-pages/status?','/smartapi/lovrabet/detail?pageId=','test','signal',',\x20HTTP\x20','/api/management/library/scripts/delete','Knowledge-base\x20response\x20is\x20missing\x20a\x20valid\x20','Get\x20enterprise\x20knowledge\x20base','AbortError','//\x20SQL:\x20','/smartapi/tasks/','/smartapi/permit/role/get-one','/smartapi/custom/queryUserCustomSqlList','/smartapi/menu/delete','121ZyiQen','2yNMyGZ','number','Fetch\x20doc\x20(','displayName','code','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','19275VuzZzW','target','\x20failed,\x20HTTP\x20','正在从服务器拉取模型列表...\x20(环境:\x20','234480oZunso','40716DBtJDU','.remove(id);','stringify','/smartapi/permit/role/get-list','/smartapi/question/er-config/cli/delete-single','/smartapi/dataset/text-generate/start','totalCount','/smartapi/page/getDeletedPageList?','name','Request\x20failed:\x20','getOne','object','/notification/channel-config/list','/smartapi/dblink/delete','append','/smartapi/db-analysis/start','title','332824WPQato','/smartapi/question/er-config/cli/update-single','info','method','json','apiError','/smartapi/dataset/get-dataset-list','max','/api/management/library/scripts/statistics?appCode=','sdk','application/json','Unauthorized','body','7YGtamz','\x20\x20return\x20rows;','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','file','version','errorCode','?sqlCode=','warn','path','\x20\x20\x20\x20sqlCode:\x20\x27','/smartapi/question/er-config/cli/erCreate','createTime','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','/smartapi/page/restore','const\x20result\x20=\x20await\x20client.models.','/smartapi/ocr/recognize-text?','SQL\x20query\x20not\x20found:\x20','operationName','/api/management/library/scripts/list?appCode=','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','value','/api/management/script/cache/clear','key','304091gzOKEi','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','updateTime','authRequired','(/*\x20params\x20*/);','includeImports','POST','/api/node-toolbox/sql/save','/smartapi/permit/page/save','\x20failed','):\x20missing\x20data.markdown\x20field','/smartapi/custom/saveUserCustomSql','/smartapi/permit/resource/get-menu-list','1696464tcecKi','url','/smartapi/app-config/create','/api/custom/executeSql','ENABLE','401','update','/smartapi/permit/role/update','/smartapi/question/er-config/business-group/edit','/admin/knowledge-base/create','Check\x20network\x20connectivity\x20and\x20try\x20again.','/smartapi/permit/role/delete','Fetch\x20menu\x20list','success','Request\x20timeout:\x20','physicalTableCount','/smartapi/app/getList','/admin/knowledge-base/update','/smartapi/custom/updateUserCustomSql','table','/smartapi/permit/page/get-one','/smartapi/app-config/getByKey','nickname','/smartapi/permit/resource/get-api-list','\x20\x20where:\x20{},','validation','994257ZRnlny','.filter({','clientOperationId','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20'];a208_0x2347=function(){return _0x908abc;};return a208_0x2347();}export async function getAppConfigByKey(_0x5a6ec9,_0x41b902){const _0x58961a=a208_0x532215,_0x4f193d=await apiRequest(_0x58961a(0x152)+buildQuery({'appCode':_0x5a6ec9,'key':_0x41b902}));return _0x4f193d[_0x58961a(0x17a)]??null;}export async function createAppConfig(_0x6a2c3){const _0x5173bc=a208_0x532215,_0x1c4325=await apiRequest(_0x5173bc(0x13f),{'method':_0x5173bc(0x136),'body':{'appCode':_0x6a2c3[_0x5173bc(0x1ef)],'key':_0x6a2c3['key'],'value':_0x6a2c3[_0x5173bc(0x244)],..._0x6a2c3[_0x5173bc(0x1e8)]?{'tags':_0x6a2c3[_0x5173bc(0x1e8)]}:{}}});return _0x1c4325['data'];}export async function updateAppConfig(_0x59f5c1){const _0x7d344c=a208_0x532215;await apiRequest('/smartapi/app-config/update',{'method':_0x7d344c(0x136),'body':{'id':_0x59f5c1['id'],'appCode':_0x59f5c1['appCode'],'key':_0x59f5c1['key'],'value':_0x59f5c1[_0x7d344c(0x244)],..._0x59f5c1['tags']?{'tags':_0x59f5c1[_0x7d344c(0x1e8)]}:{}}});}export async function deleteAppConfig(_0x50b8bf){const _0x5e8e81=a208_0x532215;await apiRequest(_0x5e8e81(0x183),{'method':_0x5e8e81(0x136),'body':_0x50b8bf});}function extractAppConfigList(_0x16f63f){const _0x146af5=a208_0x532215;if(Array[_0x146af5(0x184)](_0x16f63f))return _0x16f63f;if(_0x16f63f&&typeof _0x16f63f==='object'&&Array[_0x146af5(0x184)](_0x16f63f[_0x146af5(0x1d0)]))return _0x16f63f['list'];return extractList(_0x16f63f);}export async function listDbLinks(_0x5abede,_0x48cdb4){const _0x5a8d35=a208_0x532215,_0x223de6=await apiRequest(_0x5a8d35(0x164),{'method':'POST','body':{'appCode':_0x5abede,'currentPage':_0x48cdb4?.[_0x5a8d35(0x1a5)]??0x1,'pageSize':_0x48cdb4?.[_0x5a8d35(0x165)]??0x64}});return{'items':extractList(_0x223de6['data']),'paging':extractPaging(_0x223de6['data'])};}export async function getDbLinkInfo(_0x52bf2b){const _0x34bc1f=a208_0x532215,_0x3a2fc9=await apiRequest(_0x34bc1f(0x1e6)+buildQuery({'id':_0x52bf2b}));return _0x3a2fc9[_0x34bc1f(0x17a)];}export async function createDbLink(_0x1f99ae){const _0x26426c=a208_0x532215,_0xe22962=await apiRequest('/smartapi/dblink/create',{'method':_0x26426c(0x136),'body':_0x1f99ae});return _0xe22962[_0x26426c(0x17a)];}export async function updateDbLink(_0x2c7cd6){const _0x4799df=a208_0x532215,_0x132178=await apiRequest(_0x4799df(0x1e9),{'method':'POST','body':_0x2c7cd6});return _0x132178[_0x4799df(0x17a)];}export async function deleteDbLink(_0x4bc182){const _0x4ae334=a208_0x532215;await apiRequest(_0x4ae334(0x21f),{'method':_0x4ae334(0x136),'body':{'id':_0x4bc182}});}export async function testDbLinkConnect(_0x5bcc4c){const _0x37f3f9=a208_0x532215,_0x2e9bbf=await apiRequest(_0x37f3f9(0x16f)+buildQuery({'id':_0x5bcc4c}));return _0x2e9bbf[_0x37f3f9(0x17a)];}export async function startDbAnalysis(_0x228459,_0x43dae1){const _0x61ba4c=a208_0x532215,_0x5ec8f4=await apiRequest(_0x61ba4c(0x221),{'method':_0x61ba4c(0x136),'body':{'dbLinkId':_0x228459,..._0x43dae1&&_0x43dae1[_0x61ba4c(0x1cc)]>0x0?{'tableNames':_0x43dae1}:{}}});return _0x5ec8f4[_0x61ba4c(0x17a)];}export async function cancelDbAnalysis(_0x4a4ca4){const _0x43cd32=a208_0x532215;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x4a4ca4}),{'method':_0x43cd32(0x136)});}export async function getDbAnalysisStatus(_0x35d7b1){const _0x887af7=a208_0x532215,_0x340d1c=await apiRequest(_0x887af7(0x179)+encodeURIComponent(_0x35d7b1));return _0x340d1c['data'];}export async function getDbAllTableList(_0x55cd71,_0x200670){const _0x1e0bfb=a208_0x532215,_0x4a0ae4=await apiRequest(_0x1e0bfb(0x19e)+buildQuery({'appCode':_0x55cd71,'dbLinkId':_0x200670})),_0x54db35=_0x4a0ae4[_0x1e0bfb(0x17a)];if(Array[_0x1e0bfb(0x184)](_0x54db35))return _0x54db35;return extractList(_0x54db35);}export async function getDbTableDiff(_0x4effb9,_0x1abd2d,_0x4fc72d){const _0x3c3c60=a208_0x532215,_0x2738a1=await apiRequest(_0x3c3c60(0x1cf)+buildQuery({'appCode':_0x4effb9,'dbLinkId':_0x1abd2d,'pageIndex':_0x4fc72d?.[_0x3c3c60(0x1dd)]??0x1,'pageSize':_0x4fc72d?.[_0x3c3c60(0x165)]??0x14,'tableName':_0x4fc72d?.[_0x3c3c60(0x18e)]})),_0x4af442=_0x2738a1[_0x3c3c60(0x17a)];return{'totalCount':_0x4af442?.[_0x3c3c60(0x218)]??0x0,'physicalTableCount':_0x4af442?.[_0x3c3c60(0x14c)]??0x0,'datasetTableCount':_0x4af442?.[_0x3c3c60(0x185)]??0x0,..._0x4af442?.[_0x3c3c60(0x1ba)]?{'summary':_0x4af442['summary']}:{},'tableList':Array[_0x3c3c60(0x184)](_0x4af442?.['tableList'])?_0x4af442[_0x3c3c60(0x1a8)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x410dcb=a208_0x532215,_0x4e5599=await apiRequest(_0x410dcb(0x14d),{'method':_0x410dcb(0x136),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x37a113=extractList(_0x4e5599['data']),_0x4bd19c=extractPaging(_0x4e5599[_0x410dcb(0x17a)]);return _0x4bd19c&&_0x4bd19c['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x410dcb(0x237)](_0x410dcb(0x1db)+REMOTE_APP_PAGE_SIZE+_0x410dcb(0x1ae)+_0x4bd19c['totalCount']+_0x410dcb(0x1f0)+_0x410dcb(0x243)),_0x37a113;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x27ab43,_0x268a32){const _0x4ae705=a208_0x532215,_0x2af171=Math[_0x4ae705(0x1bc)](Math[_0x4ae705(0x22a)](_0x268a32?.['pageSize']??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x157c1a=await apiRequest(_0x4ae705(0x215),{'method':'POST','body':{'appCode':_0x27ab43,'currentPage':_0x268a32?.['currentPage']??0x1,'pageSize':_0x2af171}});return{'items':extractList(_0x157c1a['data']),'paging':extractPaging(_0x157c1a['data'])};}export async function getAppRole(_0x1b3989){const _0x3296a9=a208_0x532215,_0x101237=await apiRequest(_0x3296a9(0x203)+buildQuery({'id':_0x1b3989}));return _0x101237[_0x3296a9(0x17a)];}export async function createAppRole(_0x2ace80){const _0x5053e7=a208_0x532215,_0xb541ff=await apiRequest(_0x5053e7(0x17c),{'method':_0x5053e7(0x136),'body':{'appCode':_0x2ace80['appCode'],'roleName':_0x2ace80[_0x5053e7(0x1d6)],'roleType':_0x5053e7(0x1c7),..._0x2ace80[_0x5053e7(0x16d)]?{'remark':_0x2ace80[_0x5053e7(0x16d)]}:{}}});return _0xb541ff[_0x5053e7(0x17a)];}export async function updateAppRole(_0x5cee0c){const _0xf33286=a208_0x532215,_0x17a6e4=await apiRequest(_0xf33286(0x144),{'method':_0xf33286(0x136),'body':{'id':_0x5cee0c['id'],'appCode':_0x5cee0c[_0xf33286(0x1ef)],..._0x5cee0c['roleType']?{'roleType':_0x5cee0c['roleType']}:{},..._0x5cee0c[_0xf33286(0x1d6)]!==undefined?{'roleName':_0x5cee0c[_0xf33286(0x1d6)]}:{},..._0x5cee0c[_0xf33286(0x16d)]!==undefined?{'remark':_0x5cee0c[_0xf33286(0x16d)]}:{},..._0x5cee0c[_0xf33286(0x1a7)]?{'permits':_0x5cee0c[_0xf33286(0x1a7)]}:{}}});return _0x17a6e4[_0xf33286(0x17a)];}export async function deleteAppRole(_0x3bb560){const _0x5b24b9=a208_0x532215;await apiRequest(_0x5b24b9(0x148),{'method':_0x5b24b9(0x136),'body':{'id':_0x3bb560}});}export async function listPermitRoles(_0x213cbf,_0x23ac8f){const _0x136325=a208_0x532215,_0x57218b=await apiRequest(_0x136325(0x1ee),{'method':_0x136325(0x136),'body':{'appCode':_0x213cbf,..._0x23ac8f?.[_0x136325(0x1c9)]!==undefined?{'needSelf':_0x23ac8f[_0x136325(0x1c9)]}:{},..._0x23ac8f?.['needPublic']!==undefined?{'needPublic':_0x23ac8f[_0x136325(0x1b0)]}:{}}});return extractList(_0x57218b['data']);}export async function getRoleMenuResources(_0x34616a,_0x593ca4){const _0xc139a6=a208_0x532215,_0x5286e5=await apiRequest(_0xc139a6(0x13c),{'method':_0xc139a6(0x136),'body':{'appCode':_0x34616a,'roleId':_0x593ca4}});return extractList(_0x5286e5[_0xc139a6(0x17a)]);}export async function getRoleApiResources(_0x4f7b23,_0x14542c){const _0x2a9c72=a208_0x532215,_0xed2fc0=await apiRequest(_0x2a9c72(0x154),{'method':_0x2a9c72(0x136),'body':{'appCode':_0x4f7b23,'roleId':_0x14542c}});return extractList(_0xed2fc0[_0x2a9c72(0x17a)]);}export async function listRoleUsers(_0x15188c){const _0x5d1553=a208_0x532215,_0x34e4b9=await apiRequest(_0x5d1553(0x15d),{'method':_0x5d1553(0x136),'body':{'appCode':_0x15188c}});return extractList(_0x34e4b9[_0x5d1553(0x17a)])[_0x5d1553(0x1bb)](({id:_0xb364c,userList:_0x41548c,applyUserList:_0x1e8f11,..._0x11aabb})=>({..._0x11aabb,'id':Number(_0xb364c),'userList':_0x41548c[_0x5d1553(0x1bb)](_0x2de261=>({..._0x2de261,'userId':Number(_0x2de261[_0x5d1553(0x19b)])})),..._0x1e8f11?{'applyUserList':_0x1e8f11['map'](_0x428d3a=>({..._0x428d3a,'userId':Number(_0x428d3a['userId'])}))}:{}}));}export async function updateRoleUsers(_0x4f23e9,_0x1596b8){const _0x27b37e=a208_0x532215;await apiRequest(_0x27b37e(0x1dc),{'method':'POST','body':{'appCode':_0x4f23e9,'roleList':_0x1596b8}});}export async function getPagePermit(_0x709acf){const _0x4db025=a208_0x532215,_0x34dacc=await apiRequest(_0x4db025(0x151)+buildQuery({'menuId':_0x709acf}));return _0x34dacc[_0x4db025(0x17a)];}export async function savePagePermit(_0x4f58d9){const _0x30402d=a208_0x532215,_0x1bea33=await apiRequest(_0x30402d(0x138),{'method':_0x30402d(0x136),'body':_0x4f58d9});return _0x1bea33[_0x30402d(0x17a)];}export async function listCurrentUserTenantMemberships(){const _0x31d2f0=a208_0x532215,_0x5b2115=await apiRequest('/userTenant/queryBelongsTenants');return extractList(_0x5b2115[_0x31d2f0(0x17a)]);}export async function listTenantDirectoryMembers(_0x36e69f){const _0x16016c=a208_0x532215,_0x2be86a=await apiRequest('/userTenant/getByTenantCode'+buildQuery({'code':_0x36e69f})),_0x13b37f=_0x2be86a[_0x16016c(0x17a)]?.[_0x16016c(0x1ca)];return Array[_0x16016c(0x184)](_0x13b37f)?_0x13b37f:[];}export async function getTenantMembers(_0x2d7e5a){const _0x157b02=a208_0x532215,_0x405f65=await listTenantDirectoryMembers(_0x2d7e5a);return _0x405f65[_0x157b02(0x1d3)](_0x2b0cf0=>_0x2b0cf0[_0x157b02(0x17f)]===_0x157b02(0x141)||_0x2b0cf0['status']===undefined)[_0x157b02(0x1bb)](_0xe1231d=>({'userId':Number(_0xe1231d[_0x157b02(0x19b)]??_0xe1231d['id']),'username':_0xe1231d[_0x157b02(0x1f7)],'nickname':_0xe1231d[_0x157b02(0x153)],'status':_0xe1231d[_0x157b02(0x17f)],'email':_0xe1231d['email'],'mobile':_0xe1231d['mobile'],'avatar':_0xe1231d['avatar']}))['filter'](_0x3d6d6f=>Number[_0x157b02(0x1f4)](_0x3d6d6f['userId'])&&_0x3d6d6f[_0x157b02(0x19b)]>0x0);}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a209_0x30293b=a209_0x34e7;(function(_0x8c9da2,_0xadfb30){const _0x192427=a209_0x34e7,_0x4cbe5b=_0x8c9da2();while(!![]){try{const _0x277dee=-parseInt(_0x192427(0x16a))/0x1+parseInt(_0x192427(0x16d))/0x2*(-parseInt(_0x192427(0x16f))/0x3)+parseInt(_0x192427(0x170))/0x4+-parseInt(_0x192427(0x164))/0x5*(-parseInt(_0x192427(0x16b))/0x6)+parseInt(_0x192427(0x171))/0x7*(-parseInt(_0x192427(0x166))/0x8)+parseInt(_0x192427(0x172))/0x9*(parseInt(_0x192427(0x165))/0xa)+-parseInt(_0x192427(0x16c))/0xb;if(_0x277dee===_0xadfb30)break;else _0x4cbe5b['push'](_0x4cbe5b['shift']());}catch(_0x2d9536){_0x4cbe5b['push'](_0x4cbe5b['shift']());}}}(a209_0x5611,0x3f95e));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a209_0x30293b(0x16e),LOCK_FILE_NAME=a209_0x30293b(0x169),TRASH_DIR_NAME=a209_0x30293b(0x168);function a209_0x34e7(_0x5e22c8,_0x410e59){_0x5e22c8=_0x5e22c8-0x163;const _0x5611ba=a209_0x5611();let _0x34e78f=_0x5611ba[_0x5e22c8];return _0x34e78f;}function a209_0x5611(){const _0x510c8a=['116655BrCWgO','2655xlWLof','bff','490AsMAIR','16900wOWiKO','136gHnQHy','/bff','bff-trash','bff.lock.json','143113FOZgVP','6198rZZeQg','3215113wDIRsQ','2MCIQXH','.rabetbase','213090OJSSWU','1801572gtNOXF'];a209_0x5611=function(){return _0x510c8a;};return a209_0x5611();}export function loadBffProjectConfig(_0x5a1b03,_0x25fda4){const _0x25441c=a209_0x30293b,_0x2be265=resolve(_0x25fda4??findProjectRootDirectory()),_0x7c6650=DOT_DIR+_0x25441c(0x167),_0x2fe2f9=_0x7c6650+'/'+_0x5a1b03;return{'projectRoot':_0x2be265,'appCode':_0x5a1b03,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x7c6650,'scriptsRoot':_0x2fe2f9,'scriptsRootDir':resolve(_0x2be265,DOT_DIR,_0x25441c(0x163),_0x5a1b03),'lockFilePath':resolve(_0x2be265,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2be265,DOT_DIR,TRASH_DIR_NAME)};}
|