@lovrabet/rabetbase-cli 2.4.2 → 2.4.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +8 -4
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a169_0x2d3c50=a169_0x2d0c;(function(_0x1cf8cb,_0x3cccb5){const _0x4f720e=a169_0x2d0c,_0xa5d4a0=_0x1cf8cb();while(!![]){try{const _0x193ab9=parseInt(_0x4f720e(0xaa))/0x1+-parseInt(_0x4f720e(0xd9))/0x2+parseInt(_0x4f720e(0xd6))/0x3*(parseInt(_0x4f720e(0x114))/0x4)+parseInt(_0x4f720e(0xb6))/0x5+-parseInt(_0x4f720e(0xab))/0x6+parseInt(_0x4f720e(0xf2))/0x7*(parseInt(_0x4f720e(0xf0))/0x8)+-parseInt(_0x4f720e(0xa2))/0x9*(parseInt(_0x4f720e(0xe6))/0xa);if(_0x193ab9===_0x3cccb5)break;else _0xa5d4a0['push'](_0xa5d4a0['shift']());}catch(_0x261837){_0xa5d4a0['push'](_0xa5d4a0['shift']());}}}(a169_0x1ed6,0x716b2));import a169_0xda8879 from'chalk';function a169_0x1ed6(){const _0x299f92=['@lovrabet/sdk','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','step','oldArtifacts','===\x20Upgrade\x20Analysis\x20===','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','lovrabet/rabetbase\x20installed\x20globally','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','isDirectory','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','\x20\x20\x20\x20\x20\x20\x20','bold','190mkfTLm','.bak','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','red','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','not\x20found\x20or\x20already\x20at\x20latest','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','oldPath','\x20→\x20latest','1497416WdDPSv','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','28msXrjU','start','skipped\x20(no\x20legacy\x20config)','keys','no\x20legacy\x20config\x20found','yes','error','detail','Remove\x20legacy\x20artifacts','Remove\x20old\x20skill','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','succeed','Remove\x20.lovrabet/','green','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','not\x20found\x20(will\x20create)','failed','values','@lovrabet/dataset-mcp-server','lovrabet/lovrabet-skill\x20removed','FOUND','\x20\x20New\x20config\x20(.rabetbase.json):\x20','Proceed\x20with\x20upgrade?','needed','object','stringify','Clean\x20MCP\x20config','done','hasNewConfig','gray','includes','Config\x20migration','\x20→\x20','fail','39892skzYpk','Install\x20new\x20skill','files','Step\x201/7:\x20Migrating\x20config...','latest','some','removed\x20','isArray','cyan','cwd','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','utf8','mcpServers','MCP\x20config:','entries','args','oldMcpConfig','Upgrade\x20@lovrabet/sdk','yellow','\x20\x20#\x20or','407529odQSdx','configMigration','Step\x204/7:\x20MCP\x20config\x20—\x20','Step\x201/7:\x20Config\x20migration\x20—\x20','Step\x206/7:\x20Installing\x20new\x20skill...','label','exit\x20','none\x20found','909800xQJjUW','5096562AkPwyD','log','Legacy\x20artifacts:','\x20from\x20','status','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','dependencies','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','\x20removed','not\x20needed','Step\x204/7:\x20Cleaning\x20MCP\x20config...','2451105bjDGje','undefined','package.json','string','info','parse','no\x20matching\x20entry\x20found','skipped','length','.cursor/rules/lovrabet_rules.mdc','already\x20exists\x20(will\x20merge)','Config\x20file:','\x20\x20Action:\x20delete','filter','Upgrade\x20cancelled.','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','white','@lovrabet/sdk:','\x20\x20Fields\x20to\x20migrate:\x20','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','Skill\x20swap:','path','join','push','.lovrabet','\x20removed\x20(','message','Upgrade\x20completed\x20successfully!','\x20→\x20keys:\x20','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','\x20(backup:\x20','.cursor/mcp.json','9VrpvkS','sdkUpgrade','\x20\x20Current\x20version\x20in\x20','8640SZXCJP'];a169_0x1ed6=function(){return _0x299f92;};return a169_0x1ed6();}import a169_0x4d3d07 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a169_0x2d3c50(0xc3)](_0x890f1a=>_0x890f1a!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x2b74cd){const _0x20e407=a169_0x2d3c50,_0x40de9e=[];for(const _0x2db570 of Object[_0x20e407(0x103)](CORE_IDE_CONFIGS)){if(_0x2db570[_0x20e407(0x116)])for(const _0x1e8930 of _0x2db570[_0x20e407(0x116)]){_0x40de9e[_0x20e407(0xcd)](resolve(_0x2b74cd,_0x1e8930[_0x20e407(0xcb)]));}}return _0x40de9e;}function a169_0x2d0c(_0x265fb8,_0x23eab6){_0x265fb8=_0x265fb8-0x98;const _0x1ed65e=a169_0x1ed6();let _0x2d0c70=_0x1ed65e[_0x265fb8];return _0x2d0c70;}function analyse(_0x388070){const _0x3abc9f=a169_0x2d3c50;let _0x5c1bb0=null;const _0x2dafb2=resolve(_0x388070,NEW_CONFIG_NAME),_0x4515fe=existsSync(_0x2dafb2);for(const _0x346fb3 of LEGACY_CONFIG_NAMES){const _0x4accb3=resolve(_0x388070,_0x346fb3);if(existsSync(_0x4accb3)){const _0x31eb7a=readConfigFile(_0x4accb3),_0x9cf20e=Object[_0x3abc9f(0xf5)](_0x31eb7a)[_0x3abc9f(0xc3)](_0x15d3a2=>typeof _0x31eb7a[_0x15d3a2]!==_0x3abc9f(0xb7));_0x5c1bb0={'oldPath':_0x4accb3,'hasNewConfig':_0x4515fe,'fields':_0x9cf20e};break;}}const _0x2584bc=[],_0x6d9a63=resolve(_0x388070,_0x3abc9f(0xce));if(existsSync(_0x6d9a63))_0x2584bc[_0x3abc9f(0xcd)](_0x6d9a63);const _0x23a1c3=resolve(_0x388070,_0x3abc9f(0xbf));if(existsSync(_0x23a1c3))_0x2584bc['push'](_0x23a1c3);const _0x1f65d7=resolve(_0x388070,'.claude/skills/lovrabet');if(existsSync(_0x1f65d7))_0x2584bc[_0x3abc9f(0xcd)](_0x1f65d7);for(const _0xd22b3d of collectIdeSkillFiles(_0x388070)){if(existsSync(_0xd22b3d))_0x2584bc[_0x3abc9f(0xcd)](_0xd22b3d);}let _0x379b75=null;const _0x2406be=resolve(_0x388070,_0x3abc9f(0xd5));if(existsSync(_0x2406be))try{const _0x11ca41=JSON[_0x3abc9f(0xbb)](readFileSync(_0x2406be,'utf8'));if(_0x11ca41?.[_0x3abc9f(0x9a)]&&typeof _0x11ca41[_0x3abc9f(0x9a)]==='object'){const _0x174271=[];for(const [_0x45b278,_0x2b2a24]of Object[_0x3abc9f(0x9c)](_0x11ca41[_0x3abc9f(0x9a)])){const _0x19f421=_0x2b2a24;_0x19f421?.[_0x3abc9f(0x9d)]&&Array[_0x3abc9f(0x11b)](_0x19f421[_0x3abc9f(0x9d)])&&_0x19f421[_0x3abc9f(0x9d)][_0x3abc9f(0x119)](_0x3ff515=>typeof _0x3ff515===_0x3abc9f(0xb9)&&_0x3ff515[_0x3abc9f(0x110)](_0x3abc9f(0x104)))&&_0x174271[_0x3abc9f(0xcd)](_0x45b278);}_0x174271[_0x3abc9f(0xbe)]>0x0&&(_0x379b75={'path':_0x2406be,'keys':_0x174271});}}catch{}const _0x395fe2=_0x2584bc[_0x3abc9f(0xbe)]>0x0||_0x5c1bb0!==null;let _0x51a648=null;const _0x1c35c1=resolve(_0x388070,_0x3abc9f(0xb8));if(existsSync(_0x1c35c1))try{const _0x2c985d=JSON[_0x3abc9f(0xbb)](readFileSync(_0x1c35c1,'utf8'));for(const _0x16b077 of[_0x3abc9f(0xb1),'devDependencies']){const _0x5cf413=_0x2c985d?.[_0x16b077]?.[_0x3abc9f(0xda)];if(typeof _0x5cf413==='string'){_0x5cf413!==_0x3abc9f(0x118)&&(_0x51a648={'pkgPath':_0x1c35c1,'currentVersion':_0x5cf413,'field':_0x16b077});break;}}}catch{}return{'configMigration':_0x5c1bb0,'oldArtifacts':_0x2584bc,'oldMcpConfig':_0x379b75,'needsSkillSwap':_0x395fe2,'sdkUpgrade':_0x51a648};}function printReport(_0xd5f8c){const _0x1504f2=a169_0x2d3c50,{configMigration:_0x3fb8d9,oldArtifacts:_0x5f2b4a,oldMcpConfig:_0x64ea47,needsSkillSwap:_0x3a61e7}=_0xd5f8c;console[_0x1504f2(0xac)](''),console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0xe5)](_0x1504f2(0xde))),console[_0x1504f2(0xac)]('');_0x3fb8d9?(console[_0x1504f2(0xac)](a169_0xda8879['cyan']('Config\x20file:')+('\x20\x20'+a169_0xda8879[_0x1504f2(0xa0)](_0x3fb8d9['oldPath']))),console[_0x1504f2(0xac)](_0x1504f2(0x107)+(_0x3fb8d9[_0x1504f2(0x10e)]?a169_0xda8879[_0x1504f2(0xff)](_0x1504f2(0xc0)):a169_0xda8879[_0x1504f2(0x10f)](_0x1504f2(0x101)))),console[_0x1504f2(0xac)](_0x1504f2(0xc8)+_0x3fb8d9['fields'][_0x1504f2(0xcc)](',\x20')),console[_0x1504f2(0xac)](_0x1504f2(0xe1))):console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0xc1))+'\x20\x20'+a169_0xda8879[_0x1504f2(0x10f)](_0x1504f2(0xf6)));console['log']('');if(_0x5f2b4a['length']>0x0){console['log'](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0xad)));for(const _0x397465 of _0x5f2b4a){console[_0x1504f2(0xac)]('\x20\x20'+a169_0xda8879['red'](_0x1504f2(0x106))+'\x20\x20'+_0x397465);}console[_0x1504f2(0xac)](_0x1504f2(0xc2));}else console[_0x1504f2(0xac)](a169_0xda8879['cyan'](_0x1504f2(0xad))+'\x20\x20'+a169_0xda8879['gray'](_0x1504f2(0xa9)));console[_0x1504f2(0xac)]('');_0x64ea47?(console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0x9b))+('\x20\x20'+a169_0xda8879[_0x1504f2(0xa0)](_0x64ea47[_0x1504f2(0xcb)])+_0x1504f2(0xd2)+_0x64ea47[_0x1504f2(0xf5)][_0x1504f2(0xcc)](',\x20'))),console[_0x1504f2(0xac)](_0x1504f2(0xc9))):console[_0x1504f2(0xac)](a169_0xda8879['cyan'](_0x1504f2(0x9b))+'\x20\x20'+a169_0xda8879['gray']('no\x20legacy\x20entry'));console[_0x1504f2(0xac)](''),console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0xca))+('\x20\x20'+(_0x3a61e7?a169_0xda8879['yellow'](_0x1504f2(0x109)):a169_0xda8879[_0x1504f2(0xff)](_0x1504f2(0xb4)))));_0x3a61e7&&console[_0x1504f2(0xac)](_0x1504f2(0xf1)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0xd5f8c[_0x1504f2(0xd7)]){const {currentVersion:_0x55566b,field:_0x510ea5,pkgPath:_0x34b185}=_0xd5f8c[_0x1504f2(0xd7)];console[_0x1504f2(0xac)](a169_0xda8879['cyan'](_0x1504f2(0xc7))+('\x20\x20'+a169_0xda8879[_0x1504f2(0xa0)](_0x34b185))),console['log'](_0x1504f2(0xd8)+_0x510ea5+':\x20'+a169_0xda8879['yellow'](_0x55566b)+_0x1504f2(0x112)+a169_0xda8879[_0x1504f2(0xff)](_0x1504f2(0x118))),console[_0x1504f2(0xac)](_0x1504f2(0xfc));}else console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0xc7))+'\x20\x20'+a169_0xda8879[_0x1504f2(0x10f)](_0x1504f2(0xec)));console[_0x1504f2(0xac)]('');}function execConfigMigration(_0xdb7e7d,_0x5acd7a){const _0x260df6=a169_0x2d3c50,{configMigration:_0x416b76}=_0xdb7e7d;if(!_0x416b76?.[_0x260df6(0xee)])return{'step':0x1,'label':_0x260df6(0x111),'ok':!![],'detail':_0x260df6(0xf4)};const _0x207af5=readConfigFile(_0x416b76[_0x260df6(0xee)]),_0x5b0a60=resolve(_0x5acd7a,NEW_CONFIG_NAME),_0x45b054=_0x416b76[_0x260df6(0x10e)]?readConfigFile(_0x5b0a60):{};for(const [_0x20d26b,_0xd0efb6]of Object[_0x260df6(0x9c)](_0x207af5)){!(_0x20d26b in _0x45b054)&&(_0x45b054[_0x20d26b]=_0xd0efb6);}writeConfigFile(_0x5b0a60,_0x45b054);const _0x4aca99=_0x416b76[_0x260df6(0xee)]+_0x260df6(0xe7);return renameSync(_0x416b76[_0x260df6(0xee)],_0x4aca99),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x416b76[_0x260df6(0xee)]+_0x260df6(0x112)+_0x5b0a60+_0x260df6(0xd4)+_0x4aca99+')'};}function execRemoveOldArtifacts(_0x577636){const _0x291061=a169_0x2d3c50,_0x530760=[];for(const _0xc9cd3d of _0x577636){try{if(!existsSync(_0xc9cd3d))continue;const _0x1d25ae=tryStat(_0xc9cd3d);_0x1d25ae?.[_0x291061(0xe2)]()?rmSync(_0xc9cd3d,{'recursive':!![],'force':!![]}):unlinkSync(_0xc9cd3d);}catch(_0x52face){_0x530760[_0x291061(0xcd)](_0xc9cd3d+':\x20'+_0x52face[_0x291061(0xd0)]);}}return{'step':0x3,'label':_0x291061(0xfa),'ok':_0x530760[_0x291061(0xbe)]===0x0,'detail':_0x530760[_0x291061(0xbe)]>0x0?_0x577636[_0x291061(0xbe)]-_0x530760['length']+'/'+_0x577636[_0x291061(0xbe)]+_0x291061(0xcf)+_0x530760['join'](';\x20')+')':_0x577636[_0x291061(0xbe)]+_0x291061(0xb3)};}function execCleanMcp(_0x2a7ce3){const _0x33de67=a169_0x2d3c50;if(!_0x2a7ce3['oldMcpConfig'])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'skipped'};try{const _0x403374=readFileSync(_0x2a7ce3['oldMcpConfig']['path'],_0x33de67(0x99)),_0x210414=JSON[_0x33de67(0xbb)](_0x403374);if(_0x210414?.[_0x33de67(0x9a)]&&typeof _0x210414[_0x33de67(0x9a)]===_0x33de67(0x10a)){const _0x53e787=[];for(const [_0x285311,_0x53f00c]of Object[_0x33de67(0x9c)](_0x210414['mcpServers'])){_0x53f00c?.[_0x33de67(0x9d)]&&Array[_0x33de67(0x11b)](_0x53f00c[_0x33de67(0x9d)])&&_0x53f00c['args'][_0x33de67(0x119)](_0x3ad408=>typeof _0x3ad408===_0x33de67(0xb9)&&_0x3ad408[_0x33de67(0x110)](_0x33de67(0x104)))&&_0x53e787[_0x33de67(0xcd)](_0x285311);}for(const _0x2dc817 of _0x53e787){delete _0x210414[_0x33de67(0x9a)][_0x2dc817];}return _0x53e787['length']>0x0&&writeFileSync(_0x2a7ce3['oldMcpConfig'][_0x33de67(0xcb)],JSON[_0x33de67(0x10b)](_0x210414,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':_0x33de67(0x10c),'ok':!![],'detail':_0x33de67(0x11a)+_0x53e787[_0x33de67(0xcc)](',\x20')+_0x33de67(0xae)+_0x2a7ce3['oldMcpConfig'][_0x33de67(0xcb)]};}return{'step':0x4,'label':_0x33de67(0x10c),'ok':!![],'detail':_0x33de67(0xbc)};}catch(_0xa7db19){return{'step':0x4,'label':_0x33de67(0x10c),'ok':![],'detail':_0xa7db19[_0x33de67(0xd0)]};}}function execSkillsRemove(_0x596b82,_0x36a16c){const _0xed5900=a169_0x2d3c50,_0x548224=runNpxSkillsRemove(_0x596b82,{'stdio':'inherit','yes':_0x36a16c});return{'step':0x5,'label':_0xed5900(0xfb),'ok':_0x548224['ok'],'detail':_0x548224['ok']?_0xed5900(0x105):_0x548224[_0xed5900(0xf8)]??'exit\x20'+_0x548224[_0xed5900(0xaf)]};}function execSkillsAdd(_0x3f35ed,_0x33f058){const _0x255f64=a169_0x2d3c50,_0xbda368=runNpxSkillsAddGlobal(_0x3f35ed,'lovrabet/rabetbase',{'stdio':'inherit','yes':_0x33f058});return{'step':0x6,'label':_0x255f64(0x115),'ok':_0xbda368['ok'],'detail':_0xbda368['ok']?_0x255f64(0xe0):_0xbda368[_0x255f64(0xf8)]??_0x255f64(0xa8)+_0xbda368[_0x255f64(0xaf)]};}function execUpgradeSdk(_0x4a765f){const _0x515ae4=a169_0x2d3c50;if(!_0x4a765f[_0x515ae4(0xd7)])return{'step':0x7,'label':_0x515ae4(0x9f),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x4adb64,currentVersion:_0x1b47b2,field:_0x3341a7}=_0x4a765f['sdkUpgrade'];try{const _0x49bdc5=readFileSync(_0x4adb64,_0x515ae4(0x99)),_0xc884fe=JSON[_0x515ae4(0xbb)](_0x49bdc5);return _0xc884fe[_0x3341a7]['@lovrabet/sdk']=_0x515ae4(0x118),writeFileSync(_0x4adb64,JSON[_0x515ae4(0x10b)](_0xc884fe,null,0x2)+'\x0a',_0x515ae4(0x99)),{'step':0x7,'label':_0x515ae4(0x9f),'ok':!![],'detail':_0x3341a7+'[\x22@lovrabet/sdk\x22]:\x20'+_0x1b47b2+_0x515ae4(0xef)};}catch(_0x4a45f1){return{'step':0x7,'label':_0x515ae4(0x9f),'ok':![],'detail':_0x4a45f1[_0x515ae4(0xd0)]};}}function tryStat(_0x51028b){try{return statSync(_0x51028b);}catch{return undefined;}}function printSummary(_0x239a30){const _0x4bb890=a169_0x2d3c50;console[_0x4bb890(0xac)](''),console['log'](a169_0xda8879['bold']('===\x20Upgrade\x20Summary\x20===')),console[_0x4bb890(0xac)]('');for(const _0x55989f of _0x239a30){const _0x579a6f=_0x55989f['ok']?a169_0xda8879[_0x4bb890(0xff)]('OK'):a169_0xda8879[_0x4bb890(0xea)]('FAIL');console[_0x4bb890(0xac)]('\x20\x20'+_0x579a6f+'\x20\x20Step\x20'+_0x55989f[_0x4bb890(0xdc)]+':\x20'+_0x55989f[_0x4bb890(0xa7)]);if(_0x55989f[_0x4bb890(0xf9)])console['log'](_0x4bb890(0xe4)+a169_0xda8879[_0x4bb890(0x10f)](_0x55989f['detail']));}console['log']('');}export async function upgradeApp(_0x39d260,_0x57df36){const _0x583c19=a169_0x2d3c50,_0x1f3fd8=process[_0x583c19(0x11d)](),_0x12e43a=analyse(_0x1f3fd8),_0x2d60e5=!_0x12e43a[_0x583c19(0xa3)]&&_0x12e43a[_0x583c19(0xdd)][_0x583c19(0xbe)]===0x0&&!_0x12e43a[_0x583c19(0x9e)]&&!_0x12e43a['needsSkillSwap']&&!_0x12e43a[_0x583c19(0xd7)];if(_0x2d60e5){console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0xff)](_0x583c19(0xdf)));return;}printReport(_0x12e43a);const _0x3e39b9=!!(_0x57df36[_0x583c19(0xf7)]||_0x57df36['Y']||_0x39d260);if(!_0x3e39b9)try{const _0x5cf903=await askConfirm(_0x583c19(0x108));if(!_0x5cf903){console['log'](a169_0xda8879[_0x583c19(0x10f)](_0x583c19(0xc4)));return;}}catch(_0x1efbe8){if(_0x1efbe8?.['message']==='CANCEL'){console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0x10f)](_0x583c19(0xc4)));return;}throw _0x1efbe8;}const _0xa15eb2=[],_0x30ab81=a169_0x4d3d07({'text':_0x583c19(0x117),'color':_0x583c19(0x11c)})['start'](),_0x2d9ce0=execConfigMigration(_0x12e43a,_0x1f3fd8);_0xa15eb2[_0x583c19(0xcd)](_0x2d9ce0),_0x30ab81[_0x2d9ce0['ok']?_0x583c19(0xfd):'fail'](_0x583c19(0xa5)+(_0x2d9ce0[_0x583c19(0xf9)]??(_0x2d9ce0['ok']?'done':_0x583c19(0x102))));const _0x3691c6=resolve(_0x1f3fd8,'.lovrabet'),_0x486e22=a169_0x4d3d07({'text':_0x583c19(0xb0),'color':_0x583c19(0x11c)})[_0x583c19(0xf3)]();if(existsSync(_0x3691c6))try{rmSync(_0x3691c6,{'recursive':!![],'force':!![]}),_0x486e22[_0x583c19(0xfd)](_0x583c19(0xe3)),_0xa15eb2['push']({'step':0x2,'label':_0x583c19(0xfe),'ok':!![]});}catch(_0x19c430){_0x486e22[_0x583c19(0x113)](_0x583c19(0x100)+_0x19c430[_0x583c19(0xd0)]),_0xa15eb2[_0x583c19(0xcd)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x19c430['message']});}else _0x486e22[_0x583c19(0xba)](_0x583c19(0xe9)),_0xa15eb2[_0x583c19(0xcd)]({'step':0x2,'label':_0x583c19(0xfe),'ok':!![],'detail':_0x583c19(0xbd)});const _0x83059d=a169_0x4d3d07({'text':_0x583c19(0xb2),'color':_0x583c19(0x11c)})[_0x583c19(0xf3)](),_0x4f1947=execRemoveOldArtifacts(_0x12e43a[_0x583c19(0xdd)]);_0xa15eb2[_0x583c19(0xcd)](_0x4f1947),_0x83059d[_0x4f1947['ok']?'succeed':'fail'](_0x583c19(0xd3)+(_0x4f1947['detail']??(_0x4f1947['ok']?_0x583c19(0x10d):_0x583c19(0x102))));const _0x2a4661=a169_0x4d3d07({'text':_0x583c19(0xb5),'color':_0x583c19(0x11c)})['start'](),_0x1ce3bb=execCleanMcp(_0x12e43a);_0xa15eb2[_0x583c19(0xcd)](_0x1ce3bb),_0x2a4661[_0x1ce3bb['ok']?_0x583c19(0xfd):'fail'](_0x583c19(0xa4)+(_0x1ce3bb[_0x583c19(0xf9)]??(_0x1ce3bb['ok']?'done':'failed')));const _0x29e034=a169_0x4d3d07({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x583c19(0x11c)})['start'](),_0x4e8c94=execSkillsRemove(_0x1f3fd8,_0x3e39b9);_0xa15eb2[_0x583c19(0xcd)](_0x4e8c94),_0x29e034[_0x4e8c94['ok']?_0x583c19(0xfd):_0x583c19(0x113)](_0x583c19(0xc5)+(_0x4e8c94[_0x583c19(0xf9)]??(_0x4e8c94['ok']?_0x583c19(0x10d):_0x583c19(0x102))));const _0xc9dab=a169_0x4d3d07({'text':_0x583c19(0xa6),'color':_0x583c19(0x11c)})[_0x583c19(0xf3)](),_0x4f57c1=execSkillsAdd(_0x1f3fd8,_0x3e39b9);_0xa15eb2['push'](_0x4f57c1),_0xc9dab[_0x4f57c1['ok']?_0x583c19(0xfd):'fail'](_0x583c19(0x98)+(_0x4f57c1[_0x583c19(0xf9)]??(_0x4f57c1['ok']?_0x583c19(0x10d):_0x583c19(0x102))));const _0x4e97ec=a169_0x4d3d07({'text':_0x583c19(0xeb),'color':_0x583c19(0x11c)})[_0x583c19(0xf3)](),_0x3bbd93=execUpgradeSdk(_0x12e43a);_0xa15eb2[_0x583c19(0xcd)](_0x3bbd93),_0x4e97ec[_0x3bbd93['ok']?_0x583c19(0xfd):_0x583c19(0x113)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x3bbd93[_0x583c19(0xf9)]??(_0x3bbd93['ok']?_0x583c19(0x10d):_0x583c19(0x102)))),printSummary(_0xa15eb2);const _0x5d4f5c=_0xa15eb2['some'](_0x3cd3ea=>!_0x3cd3ea['ok']);_0x5d4f5c?console['log'](a169_0xda8879[_0x583c19(0xa0)](_0x583c19(0xdb))):console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0xff)](_0x583c19(0xd1))),_0x3bbd93['ok']&&_0x12e43a[_0x583c19(0xd7)]&&(console[_0x583c19(0xac)](''),console[_0x583c19(0xac)](a169_0xda8879['bold']['cyan'](_0x583c19(0xe8))),console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0x11c)](_0x583c19(0xed))),console[_0x583c19(0xac)](''),console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0xc6)]('\x20\x20npm\x20install')),console['log'](a169_0xda8879[_0x583c19(0xc6)](_0x583c19(0xa1))),console[_0x583c19(0xac)](a169_0xda8879['white']('\x20\x20bun\x20install')),console[_0x583c19(0xac)](''));}
|
|
1
|
+
const a169_0x3ffaef=a169_0x5e4c;(function(_0x136d7d,_0xce1064){const _0x105b26=a169_0x5e4c,_0x2b0b69=_0x136d7d();while(!![]){try{const _0x20a476=parseInt(_0x105b26(0xf4))/0x1*(-parseInt(_0x105b26(0xfc))/0x2)+-parseInt(_0x105b26(0xc7))/0x3*(-parseInt(_0x105b26(0xae))/0x4)+-parseInt(_0x105b26(0xca))/0x5*(parseInt(_0x105b26(0xd1))/0x6)+-parseInt(_0x105b26(0xb6))/0x7*(parseInt(_0x105b26(0xee))/0x8)+-parseInt(_0x105b26(0x100))/0x9*(parseInt(_0x105b26(0xf3))/0xa)+parseInt(_0x105b26(0xc1))/0xb*(parseInt(_0x105b26(0xb7))/0xc)+parseInt(_0x105b26(0xbe))/0xd;if(_0x20a476===_0xce1064)break;else _0x2b0b69['push'](_0x2b0b69['shift']());}catch(_0x396b7b){_0x2b0b69['push'](_0x2b0b69['shift']());}}}(a169_0x26ba,0xe5443));import a169_0x2b3bf2 from'chalk';import a169_0x131d9b from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a169_0x3ffaef(0xe9)](_0x2ead05=>_0x2ead05!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x38b78e){const _0x23504d=a169_0x3ffaef,_0x5da521=[];for(const _0x11cf96 of Object[_0x23504d(0xaa)](CORE_IDE_CONFIGS)){if(_0x11cf96[_0x23504d(0xa6)])for(const _0x41ee09 of _0x11cf96[_0x23504d(0xa6)]){_0x5da521['push'](resolve(_0x38b78e,_0x41ee09[_0x23504d(0x10a)]));}}return _0x5da521;}function analyse(_0x331986){const _0xb1ee1=a169_0x3ffaef;let _0x14f6c2=null;const _0x58c926=resolve(_0x331986,NEW_CONFIG_NAME),_0x3c13a7=existsSync(_0x58c926);for(const _0x14308c of LEGACY_CONFIG_NAMES){const _0x560de2=resolve(_0x331986,_0x14308c);if(existsSync(_0x560de2)){const _0x2a5b3b=readConfigFile(_0x560de2),_0x45fdf4=Object[_0xb1ee1(0xe7)](_0x2a5b3b)[_0xb1ee1(0xe9)](_0x2191b9=>typeof _0x2a5b3b[_0x2191b9]!=='undefined');_0x14f6c2={'oldPath':_0x560de2,'hasNewConfig':_0x3c13a7,'fields':_0x45fdf4};break;}}const _0x2fafe9=[],_0x5f099f=resolve(_0x331986,_0xb1ee1(0xb0));if(existsSync(_0x5f099f))_0x2fafe9['push'](_0x5f099f);const _0x34c847=resolve(_0x331986,_0xb1ee1(0xef));if(existsSync(_0x34c847))_0x2fafe9[_0xb1ee1(0x11a)](_0x34c847);const _0x32e5c8=resolve(_0x331986,_0xb1ee1(0xff));if(existsSync(_0x32e5c8))_0x2fafe9[_0xb1ee1(0x11a)](_0x32e5c8);for(const _0x96f930 of collectIdeSkillFiles(_0x331986)){if(existsSync(_0x96f930))_0x2fafe9[_0xb1ee1(0x11a)](_0x96f930);}let _0x1d62ad=null;const _0x2da2d0=resolve(_0x331986,_0xb1ee1(0xeb));if(existsSync(_0x2da2d0))try{const _0x12cd86=JSON['parse'](readFileSync(_0x2da2d0,_0xb1ee1(0xfa)));if(_0x12cd86?.[_0xb1ee1(0xc8)]&&typeof _0x12cd86[_0xb1ee1(0xc8)]===_0xb1ee1(0x11c)){const _0x262782=[];for(const [_0x37cdea,_0x35a2a1]of Object['entries'](_0x12cd86[_0xb1ee1(0xc8)])){const _0x1be9c7=_0x35a2a1;_0x1be9c7?.[_0xb1ee1(0xf5)]&&Array[_0xb1ee1(0xcf)](_0x1be9c7['args'])&&_0x1be9c7[_0xb1ee1(0xf5)][_0xb1ee1(0xbc)](_0xd150ff=>typeof _0xd150ff===_0xb1ee1(0x114)&&_0xd150ff[_0xb1ee1(0x104)](_0xb1ee1(0xf1)))&&_0x262782['push'](_0x37cdea);}_0x262782[_0xb1ee1(0xe4)]>0x0&&(_0x1d62ad={'path':_0x2da2d0,'keys':_0x262782});}}catch{}const _0x55ac45=_0x2fafe9[_0xb1ee1(0xe4)]>0x0||_0x14f6c2!==null;let _0x1bd0ff=null;const _0x31c466=resolve(_0x331986,_0xb1ee1(0xdd));if(existsSync(_0x31c466))try{const _0x56840e=JSON[_0xb1ee1(0x11b)](readFileSync(_0x31c466,_0xb1ee1(0xfa)));for(const _0x58c59d of[_0xb1ee1(0xd6),_0xb1ee1(0xe2)]){const _0x59eeab=_0x56840e?.[_0x58c59d]?.['@lovrabet/sdk'];if(typeof _0x59eeab===_0xb1ee1(0x114)){_0x59eeab!==_0xb1ee1(0x103)&&(_0x1bd0ff={'pkgPath':_0x31c466,'currentVersion':_0x59eeab,'field':_0x58c59d});break;}}}catch{}return{'configMigration':_0x14f6c2,'oldArtifacts':_0x2fafe9,'oldMcpConfig':_0x1d62ad,'needsSkillSwap':_0x55ac45,'sdkUpgrade':_0x1bd0ff};}function printReport(_0x677647){const _0x161686=a169_0x3ffaef,{configMigration:_0x3c620c,oldArtifacts:_0x5da21e,oldMcpConfig:_0x1d526b,needsSkillSwap:_0x57b10a}=_0x677647;console[_0x161686(0x118)](''),console[_0x161686(0x118)](a169_0x2b3bf2[_0x161686(0x11d)](_0x161686(0xec))),console[_0x161686(0x118)]('');_0x3c620c?(console[_0x161686(0x118)](a169_0x2b3bf2['cyan']('Config\x20file:')+('\x20\x20'+a169_0x2b3bf2['yellow'](_0x3c620c[_0x161686(0xab)]))),console[_0x161686(0x118)](_0x161686(0xf9)+(_0x3c620c[_0x161686(0xbf)]?a169_0x2b3bf2[_0x161686(0x122)](_0x161686(0x102)):a169_0x2b3bf2[_0x161686(0xcc)](_0x161686(0xb2)))),console[_0x161686(0x118)]('\x20\x20Fields\x20to\x20migrate:\x20'+_0x3c620c[_0x161686(0x120)][_0x161686(0x115)](',\x20')),console[_0x161686(0x118)](_0x161686(0xda))):console[_0x161686(0x118)](a169_0x2b3bf2['cyan']('Config\x20file:')+'\x20\x20'+a169_0x2b3bf2[_0x161686(0xcc)](_0x161686(0x109)));console['log']('');if(_0x5da21e[_0x161686(0xe4)]>0x0){console[_0x161686(0x118)](a169_0x2b3bf2[_0x161686(0xb8)](_0x161686(0x123)));for(const _0x5676f of _0x5da21e){console['log']('\x20\x20'+a169_0x2b3bf2[_0x161686(0x10e)]('FOUND')+'\x20\x20'+_0x5676f);}console[_0x161686(0x118)](_0x161686(0xc6));}else console[_0x161686(0x118)](a169_0x2b3bf2[_0x161686(0xb8)]('Legacy\x20artifacts:')+'\x20\x20'+a169_0x2b3bf2[_0x161686(0xcc)](_0x161686(0xdc)));console['log']('');_0x1d526b?(console['log'](a169_0x2b3bf2[_0x161686(0xb8)](_0x161686(0x11f))+('\x20\x20'+a169_0x2b3bf2['yellow'](_0x1d526b[_0x161686(0x10a)])+_0x161686(0xe3)+_0x1d526b['keys']['join'](',\x20'))),console['log']('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console['log'](a169_0x2b3bf2['cyan'](_0x161686(0x11f))+'\x20\x20'+a169_0x2b3bf2[_0x161686(0xcc)]('no\x20legacy\x20entry'));console[_0x161686(0x118)](''),console[_0x161686(0x118)](a169_0x2b3bf2[_0x161686(0xb8)](_0x161686(0x10b))+('\x20\x20'+(_0x57b10a?a169_0x2b3bf2[_0x161686(0x119)]('needed'):a169_0x2b3bf2[_0x161686(0x122)](_0x161686(0x121)))));_0x57b10a&&console['log'](_0x161686(0xa2)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x161686(0x118)]('');if(_0x677647[_0x161686(0xcb)]){const {currentVersion:_0x2d06d9,field:_0x1f2e9b,pkgPath:_0x570a6f}=_0x677647['sdkUpgrade'];console[_0x161686(0x118)](a169_0x2b3bf2[_0x161686(0xb8)](_0x161686(0xf6))+('\x20\x20'+a169_0x2b3bf2['yellow'](_0x570a6f))),console[_0x161686(0x118)]('\x20\x20Current\x20version\x20in\x20'+_0x1f2e9b+':\x20'+a169_0x2b3bf2[_0x161686(0x119)](_0x2d06d9)+_0x161686(0xd9)+a169_0x2b3bf2[_0x161686(0x122)](_0x161686(0x103))),console['log']('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console[_0x161686(0x118)](a169_0x2b3bf2[_0x161686(0xb8)](_0x161686(0xf6))+'\x20\x20'+a169_0x2b3bf2[_0x161686(0xcc)](_0x161686(0xb1)));console[_0x161686(0x118)]('');}function execConfigMigration(_0x25c6d9,_0x760b97){const _0x1173ef=a169_0x3ffaef,{configMigration:_0x260367}=_0x25c6d9;if(!_0x260367?.[_0x1173ef(0xab)])return{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x1173ef(0x101)};const _0xb11899=readConfigFile(_0x260367['oldPath']),_0x4329ba=resolve(_0x760b97,NEW_CONFIG_NAME),_0x4d88e1=_0x260367[_0x1173ef(0xbf)]?readConfigFile(_0x4329ba):{};for(const [_0x5492ed,_0x9fd231]of Object['entries'](_0xb11899)){!(_0x5492ed in _0x4d88e1)&&(_0x4d88e1[_0x5492ed]=_0x9fd231);}writeConfigFile(_0x4329ba,_0x4d88e1);const _0x147502=_0x260367[_0x1173ef(0xab)]+'.bak';return renameSync(_0x260367['oldPath'],_0x147502),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x260367['oldPath']+_0x1173ef(0xd9)+_0x4329ba+_0x1173ef(0x10c)+_0x147502+')'};}function a169_0x26ba(){const _0x2e524d=['error','start','keys','step','filter','oldArtifacts','.cursor/mcp.json','===\x20Upgrade\x20Analysis\x20===','lovrabet/lovrabet-skill\x20removed','52328pRruZM','.cursor/rules/lovrabet_rules.mdc','FAIL','@lovrabet/dataset-mcp-server','oldMcpConfig','110dsBPQx','72031YCgZSR','args','@lovrabet/sdk:','removed\x20','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','\x20\x20New\x20config\x20(.rabetbase.json):\x20','utf8','Clean\x20MCP\x20config','6VjoRWc','Remove\x20.lovrabet/','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','.claude/skills/lovrabet','817479Jkmipe','skipped\x20(no\x20legacy\x20config)','already\x20exists\x20(will\x20merge)','latest','includes','exit\x20','succeed','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','Remove\x20old\x20skill','no\x20legacy\x20config\x20found','path','Skill\x20swap:','\x20(backup:\x20','\x20\x20npm\x20install','red','Upgrade\x20completed\x20successfully!','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','lovrabet/rabetbase\x20installed\x20globally','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','\x20\x20Step\x20','string','join','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','\x20\x20\x20\x20\x20\x20\x20','log','yellow','push','parse','object','bold','entries','MCP\x20config:','fields','not\x20needed','green','Legacy\x20artifacts:','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','\x20from\x20','message','@lovrabet/sdk','files','detail','Upgrade\x20@lovrabet/sdk','Install\x20new\x20skill','values','oldPath','Step\x206/7:\x20Installing\x20new\x20skill...','no\x20matching\x20entry\x20found','90112eHKjsd','white','.lovrabet','not\x20found\x20or\x20already\x20at\x20latest','not\x20found\x20(will\x20create)','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','skipped','stringify','1925VpMTIi','23508IpQywq','cyan','\x20removed\x20(','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','some','\x20\x20#\x20or','41740114hTXoWU','hasNewConfig','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','3652MKYYnx','info','Proceed\x20with\x20upgrade?','[\x22@lovrabet/sdk\x22]:\x20','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','\x20\x20Action:\x20delete','192axoNXg','mcpServers','fail','90pJnZBg','sdkUpgrade','gray','failed','Step\x205/7:\x20Removing\x20old\x20skill...','isArray','done','449958atHcPF','needsSkillSwap','Step\x201/7:\x20Config\x20migration\x20—\x20','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','isDirectory','dependencies','cwd','status','\x20→\x20','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','lovrabet/rabetbase','none\x20found','package.json','configMigration','Step\x201/7:\x20Migrating\x20config...','\x20\x20bun\x20install','===\x20Upgrade\x20Summary\x20===','devDependencies','\x20→\x20keys:\x20','length'];a169_0x26ba=function(){return _0x2e524d;};return a169_0x26ba();}function execRemoveOldArtifacts(_0x43da46){const _0x193640=a169_0x3ffaef,_0x4bec4d=[];for(const _0x2d66df of _0x43da46){try{if(!existsSync(_0x2d66df))continue;const _0x5e62b0=tryStat(_0x2d66df);_0x5e62b0?.[_0x193640(0xd5)]()?rmSync(_0x2d66df,{'recursive':!![],'force':!![]}):unlinkSync(_0x2d66df);}catch(_0x14dfa8){_0x4bec4d['push'](_0x2d66df+':\x20'+_0x14dfa8['message']);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x4bec4d[_0x193640(0xe4)]===0x0,'detail':_0x4bec4d[_0x193640(0xe4)]>0x0?_0x43da46[_0x193640(0xe4)]-_0x4bec4d['length']+'/'+_0x43da46[_0x193640(0xe4)]+_0x193640(0xb9)+_0x4bec4d[_0x193640(0x115)](';\x20')+')':_0x43da46[_0x193640(0xe4)]+'\x20removed'};}function execCleanMcp(_0x8397c8){const _0xab1d4b=a169_0x3ffaef;if(!_0x8397c8[_0xab1d4b(0xf2)])return{'step':0x4,'label':_0xab1d4b(0xfb),'ok':!![],'detail':'skipped'};try{const _0x221540=readFileSync(_0x8397c8[_0xab1d4b(0xf2)][_0xab1d4b(0x10a)],_0xab1d4b(0xfa)),_0x14af5e=JSON['parse'](_0x221540);if(_0x14af5e?.[_0xab1d4b(0xc8)]&&typeof _0x14af5e[_0xab1d4b(0xc8)]===_0xab1d4b(0x11c)){const _0x342ae3=[];for(const [_0x5cb192,_0x167e1d]of Object[_0xab1d4b(0x11e)](_0x14af5e[_0xab1d4b(0xc8)])){_0x167e1d?.['args']&&Array[_0xab1d4b(0xcf)](_0x167e1d['args'])&&_0x167e1d[_0xab1d4b(0xf5)][_0xab1d4b(0xbc)](_0x54b31e=>typeof _0x54b31e===_0xab1d4b(0x114)&&_0x54b31e['includes']('@lovrabet/dataset-mcp-server'))&&_0x342ae3[_0xab1d4b(0x11a)](_0x5cb192);}for(const _0x5e91c5 of _0x342ae3){delete _0x14af5e[_0xab1d4b(0xc8)][_0x5e91c5];}return _0x342ae3[_0xab1d4b(0xe4)]>0x0&&writeFileSync(_0x8397c8['oldMcpConfig'][_0xab1d4b(0x10a)],JSON['stringify'](_0x14af5e,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':_0xab1d4b(0xfb),'ok':!![],'detail':_0xab1d4b(0xf7)+_0x342ae3[_0xab1d4b(0x115)](',\x20')+_0xab1d4b(0xa3)+_0x8397c8[_0xab1d4b(0xf2)]['path']};}return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0xab1d4b(0xad)};}catch(_0xa3b1e4){return{'step':0x4,'label':_0xab1d4b(0xfb),'ok':![],'detail':_0xa3b1e4[_0xab1d4b(0xa4)]};}}function execSkillsRemove(_0x5eb5e5,_0x4f9286){const _0x3f2491=a169_0x3ffaef,_0x5eab88=runNpxSkillsRemove(_0x5eb5e5,{'stdio':'inherit','yes':_0x4f9286});return{'step':0x5,'label':_0x3f2491(0x108),'ok':_0x5eab88['ok'],'detail':_0x5eab88['ok']?_0x3f2491(0xed):_0x5eab88[_0x3f2491(0xe5)]??'exit\x20'+_0x5eab88[_0x3f2491(0xd8)]};}function execSkillsAdd(_0x7f37bb,_0x4739a5){const _0x22f30c=a169_0x3ffaef,_0x387a74=runNpxSkillsAddGlobal(_0x7f37bb,_0x22f30c(0xdb),{'stdio':'inherit','yes':_0x4739a5});return{'step':0x6,'label':_0x22f30c(0xa9),'ok':_0x387a74['ok'],'detail':_0x387a74['ok']?_0x22f30c(0x111):_0x387a74[_0x22f30c(0xe5)]??_0x22f30c(0x105)+_0x387a74[_0x22f30c(0xd8)]};}function execUpgradeSdk(_0x857fdf){const _0x59b7e3=a169_0x3ffaef;if(!_0x857fdf['sdkUpgrade'])return{'step':0x7,'label':_0x59b7e3(0xa8),'ok':!![],'detail':_0x59b7e3(0xb3)};const {pkgPath:_0x277bca,currentVersion:_0x3f4720,field:_0x164535}=_0x857fdf['sdkUpgrade'];try{const _0x13afe6=readFileSync(_0x277bca,'utf8'),_0x3c941c=JSON[_0x59b7e3(0x11b)](_0x13afe6);return _0x3c941c[_0x164535][_0x59b7e3(0xa5)]=_0x59b7e3(0x103),writeFileSync(_0x277bca,JSON[_0x59b7e3(0xb5)](_0x3c941c,null,0x2)+'\x0a',_0x59b7e3(0xfa)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x164535+_0x59b7e3(0xc4)+_0x3f4720+'\x20→\x20latest'};}catch(_0x26c7d3){return{'step':0x7,'label':_0x59b7e3(0xa8),'ok':![],'detail':_0x26c7d3['message']};}}function tryStat(_0x5d7efc){try{return statSync(_0x5d7efc);}catch{return undefined;}}function printSummary(_0x159ff9){const _0x3bc95f=a169_0x3ffaef;console[_0x3bc95f(0x118)](''),console['log'](a169_0x2b3bf2[_0x3bc95f(0x11d)](_0x3bc95f(0xe1))),console[_0x3bc95f(0x118)]('');for(const _0x8099c2 of _0x159ff9){const _0x453c3c=_0x8099c2['ok']?a169_0x2b3bf2['green']('OK'):a169_0x2b3bf2[_0x3bc95f(0x10e)](_0x3bc95f(0xf0));console[_0x3bc95f(0x118)]('\x20\x20'+_0x453c3c+_0x3bc95f(0x113)+_0x8099c2[_0x3bc95f(0xe8)]+':\x20'+_0x8099c2['label']);if(_0x8099c2['detail'])console[_0x3bc95f(0x118)](_0x3bc95f(0x117)+a169_0x2b3bf2[_0x3bc95f(0xcc)](_0x8099c2[_0x3bc95f(0xa7)]));}console['log']('');}function a169_0x5e4c(_0x594488,_0x1707c9){_0x594488=_0x594488-0xa2;const _0x26ba7c=a169_0x26ba();let _0x5e4c77=_0x26ba7c[_0x594488];return _0x5e4c77;}export async function upgradeApp(_0x10813e,_0x5969ae){const _0x4e20fc=a169_0x3ffaef,_0x475149=process[_0x4e20fc(0xd7)](),_0x551ccd=analyse(_0x475149),_0x460165=!_0x551ccd[_0x4e20fc(0xde)]&&_0x551ccd[_0x4e20fc(0xea)][_0x4e20fc(0xe4)]===0x0&&!_0x551ccd['oldMcpConfig']&&!_0x551ccd[_0x4e20fc(0xd2)]&&!_0x551ccd[_0x4e20fc(0xcb)];if(_0x460165){console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0x122)](_0x4e20fc(0xbb)));return;}printReport(_0x551ccd);const _0x1c12cf=!!(_0x5969ae['yes']||_0x5969ae['Y']||_0x10813e);if(!_0x1c12cf)try{const _0x1e1e74=await askConfirm(_0x4e20fc(0xc3));if(!_0x1e1e74){console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0xcc)]('Upgrade\x20cancelled.'));return;}}catch(_0x382bfb){if(_0x382bfb?.[_0x4e20fc(0xa4)]==='CANCEL'){console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0xcc)]('Upgrade\x20cancelled.'));return;}throw _0x382bfb;}const _0x28e3ef=[],_0x55e32c=a169_0x131d9b({'text':_0x4e20fc(0xdf),'color':_0x4e20fc(0xb8)})[_0x4e20fc(0xe6)](),_0x2483b1=execConfigMigration(_0x551ccd,_0x475149);_0x28e3ef[_0x4e20fc(0x11a)](_0x2483b1),_0x55e32c[_0x2483b1['ok']?_0x4e20fc(0x106):_0x4e20fc(0xc9)](_0x4e20fc(0xd3)+(_0x2483b1[_0x4e20fc(0xa7)]??(_0x2483b1['ok']?_0x4e20fc(0xd0):_0x4e20fc(0xcd))));const _0x8d3a63=resolve(_0x475149,'.lovrabet'),_0x577da0=a169_0x131d9b({'text':_0x4e20fc(0x116),'color':'cyan'})[_0x4e20fc(0xe6)]();if(existsSync(_0x8d3a63))try{rmSync(_0x8d3a63,{'recursive':!![],'force':!![]}),_0x577da0[_0x4e20fc(0x106)](_0x4e20fc(0x112)),_0x28e3ef[_0x4e20fc(0x11a)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x153ef7){_0x577da0['fail'](_0x4e20fc(0xd4)+_0x153ef7[_0x4e20fc(0xa4)]),_0x28e3ef[_0x4e20fc(0x11a)]({'step':0x2,'label':_0x4e20fc(0xfd),'ok':![],'detail':_0x153ef7[_0x4e20fc(0xa4)]});}else _0x577da0[_0x4e20fc(0xc2)](_0x4e20fc(0x110)),_0x28e3ef[_0x4e20fc(0x11a)]({'step':0x2,'label':_0x4e20fc(0xfd),'ok':!![],'detail':_0x4e20fc(0xb4)});const _0x49e50b=a169_0x131d9b({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x4e20fc(0xb8)})[_0x4e20fc(0xe6)](),_0x2c2e41=execRemoveOldArtifacts(_0x551ccd[_0x4e20fc(0xea)]);_0x28e3ef['push'](_0x2c2e41),_0x49e50b[_0x2c2e41['ok']?'succeed':_0x4e20fc(0xc9)]('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x2c2e41[_0x4e20fc(0xa7)]??(_0x2c2e41['ok']?_0x4e20fc(0xd0):'failed')));const _0x5f4ecb=a169_0x131d9b({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':_0x4e20fc(0xb8)})[_0x4e20fc(0xe6)](),_0x216b9c=execCleanMcp(_0x551ccd);_0x28e3ef[_0x4e20fc(0x11a)](_0x216b9c),_0x5f4ecb[_0x216b9c['ok']?_0x4e20fc(0x106):_0x4e20fc(0xc9)]('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x216b9c[_0x4e20fc(0xa7)]??(_0x216b9c['ok']?_0x4e20fc(0xd0):_0x4e20fc(0xcd))));const _0x563302=a169_0x131d9b({'text':_0x4e20fc(0xce),'color':'cyan'})[_0x4e20fc(0xe6)](),_0x3799c5=execSkillsRemove(_0x475149,_0x1c12cf);_0x28e3ef[_0x4e20fc(0x11a)](_0x3799c5),_0x563302[_0x3799c5['ok']?_0x4e20fc(0x106):_0x4e20fc(0xc9)]('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x3799c5[_0x4e20fc(0xa7)]??(_0x3799c5['ok']?_0x4e20fc(0xd0):'failed')));const _0x1945cd=a169_0x131d9b({'text':_0x4e20fc(0xac),'color':'cyan'})['start'](),_0x164ef6=execSkillsAdd(_0x475149,_0x1c12cf);_0x28e3ef[_0x4e20fc(0x11a)](_0x164ef6),_0x1945cd[_0x164ef6['ok']?_0x4e20fc(0x106):_0x4e20fc(0xc9)](_0x4e20fc(0xf8)+(_0x164ef6[_0x4e20fc(0xa7)]??(_0x164ef6['ok']?_0x4e20fc(0xd0):_0x4e20fc(0xcd))));const _0xfea5c2=a169_0x131d9b({'text':_0x4e20fc(0xba),'color':'cyan'})[_0x4e20fc(0xe6)](),_0x2bc2ee=execUpgradeSdk(_0x551ccd);_0x28e3ef[_0x4e20fc(0x11a)](_0x2bc2ee),_0xfea5c2[_0x2bc2ee['ok']?_0x4e20fc(0x106):_0x4e20fc(0xc9)](_0x4e20fc(0xc0)+(_0x2bc2ee[_0x4e20fc(0xa7)]??(_0x2bc2ee['ok']?'done':_0x4e20fc(0xcd)))),printSummary(_0x28e3ef);const _0x3c1a73=_0x28e3ef[_0x4e20fc(0xbc)](_0x359358=>!_0x359358['ok']);_0x3c1a73?console['log'](a169_0x2b3bf2[_0x4e20fc(0x119)](_0x4e20fc(0xfe))):console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0x122)](_0x4e20fc(0x10f))),_0x2bc2ee['ok']&&_0x551ccd[_0x4e20fc(0xcb)]&&(console['log'](''),console['log'](a169_0x2b3bf2[_0x4e20fc(0x11d)][_0x4e20fc(0xb8)](_0x4e20fc(0xc5))),console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0xb8)](_0x4e20fc(0x107))),console[_0x4e20fc(0x118)](''),console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0xaf)](_0x4e20fc(0x10d))),console[_0x4e20fc(0x118)](a169_0x2b3bf2['white'](_0x4e20fc(0xbd))),console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0xaf)](_0x4e20fc(0xe0))),console['log'](''));}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a170_0x280a94=a170_0x21b3;(function(_0x28e4fe,_0x587901){const _0x1f0a9b=a170_0x21b3,_0x13497a=_0x28e4fe();while(!![]){try{const _0x570ec4=parseInt(_0x1f0a9b(0xdb))/0x1+-parseInt(_0x1f0a9b(0xb3))/0x2+parseInt(_0x1f0a9b(0xa0))/0x3+parseInt(_0x1f0a9b(0xaf))/0x4+-parseInt(_0x1f0a9b(0xba))/0x5+parseInt(_0x1f0a9b(0xa3))/0x6+parseInt(_0x1f0a9b(0xb1))/0x7*(-parseInt(_0x1f0a9b(0xc6))/0x8);if(_0x570ec4===_0x587901)break;else _0x13497a['push'](_0x13497a['shift']());}catch(_0x106e16){_0x13497a['push'](_0x13497a['shift']());}}}(a170_0x14c2,0x68669));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';function a170_0x14c2(){const _0x5d7151=['Project','rabetbase\x20sql\x20create','build','rabetbase\x20workspace\x20remove\x20<name>','sql:new','24CzdnEW','Code\x20Generation','Tenant\x20Members','Use\x20`','install','Schema','Platform\x20Issue','Quick\x20Start','Instant\x20API','has','rabetbase\x20auth\x20logout','Async\x20Tasks','wildcardDef','Roles','Permissions','User\x20Accounts','rabetbase\x20kb\x20update','rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml','BFF\x20Scripts','rabetbase\x20kb\x20delete','knowledge-base:detail','72276ayuarg','knowledge-base:list','\x20\x20[high-risk-write]','rabetbase\x20workspace\x20use\x20--app\x20<name>','show','push','write','app:remote','Company\x20Knowledge\x20Base','CLI\x20Built-in\x20Skill','commands','rabetbase\x20app\x20list\x20--remote','skills:','isSingleCommand','defaultCommand','filter','Dataset\x20&\x20Operations','App\x20Management','project:init','rabetbase\x20cli-skill\x20install','Smart\x20List\x20Pages\x20&\x20React\x20Custom\x20Pages','API\x20Development','get','app:use','\x20\x20[','length','rabetbase\x20run\x20start','skill:install','rabetbase\x20kb\x20detail','Run\x20any\x20package.json\x20script','login','1881372rkbBti','risk','app:add','3331134QkDZcV','rabetbase\x20project\x20create\x20<project-name>','knowledge-base:create','Configuration','service','rabetbase\x20kb\x20create','values','read','rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>','app:remove','Logs','Menu','126204diEisE','OCR','529403Fvsljc','from','994846zaPHex','rabetbase\x20menu\x20asset-update','Self\x20Update','bff:new','set','logout','Notification\x20Configuration','671025QimUmS','Runtime\x20App\x20Config\x20Management','start','command','create','`\x20instead.','knowledge-base:update'];a170_0x14c2=function(){return _0x5d7151;};return a170_0x14c2();}import{menuDefinitions}from'../commands/menu/index.js';import{taskDefinitions}from'../commands/task/index.js';import{tenantDefinitions}from'../commands/tenant/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';function a170_0x21b3(_0x184d13,_0x47b94b){_0x184d13=_0x184d13-0x98;const _0x14c22b=a170_0x14c2();let _0x21b332=_0x14c22b[_0x184d13];return _0x21b332;}import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{userAccountDefinitions}from'../commands/user-account/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x138904){const _0x97fe08=a170_0x21b3;for(const _0x2551bb of _0x138904){definitions[_0x97fe08(0xb7)](_0x2551bb[_0x97fe08(0xa7)]+':'+_0x2551bb[_0x97fe08(0xbd)],_0x2551bb);let _0x573f2a=serviceGroups[_0x97fe08(0xf1)](_0x2551bb['service']);!_0x573f2a&&(_0x573f2a=[],serviceGroups[_0x97fe08(0xb7)](_0x2551bb[_0x97fe08(0xa7)],_0x573f2a)),_0x573f2a[_0x97fe08(0xe0)](_0x2551bb);}}function registerDeclarativeService(_0x10a235,_0x2dd5e3,_0x1a4480){const _0x6d1320=a170_0x21b3;registerDefinitions(_0x2dd5e3);_0x1a4480?.[_0x6d1320(0xd2)]&®isterDefinitions([_0x1a4480[_0x6d1320(0xd2)]]);const _0x120a11=_0x3b8238=>_0x3b8238===_0x6d1320(0xaa)?'':_0x3b8238===_0x6d1320(0xe1)?'\x20\x20[write]':_0x6d1320(0xdd),_0x44f94e={'service':_0x2dd5e3[0x0][_0x6d1320(0xa7)],'label':_0x10a235,'commands':_0x2dd5e3[_0x6d1320(0xea)](_0x344717=>!_0x344717['hidden'])['map'](_0xa4a0f2=>({'command':_0xa4a0f2[_0x6d1320(0xbd)],'description':_0xa4a0f2['description'],'tag':_0x120a11(_0xa4a0f2[_0x6d1320(0xa1)])})),'declarative':!![],'defaultCommand':_0x1a4480?.[_0x6d1320(0xe9)]??(_0x1a4480?.[_0x6d1320(0xe8)]?_0x2dd5e3[0x0][_0x6d1320(0xbd)]:undefined),'wildcardDef':_0x1a4480?.[_0x6d1320(0xd2)],'isSingleCommand':_0x1a4480?.['isSingleCommand']};serviceRegistry[_0x6d1320(0xe0)](_0x44f94e),serviceByName[_0x6d1320(0xb7)](_0x44f94e[_0x6d1320(0xa7)],_0x44f94e);}registerDeclarativeService(a170_0x280a94(0xcd),initDefinitions,{'defaultCommand':'run','isSingleCommand':!![]}),registerDeclarativeService(a170_0x280a94(0xc1),projectDefinitions),registerDeclarativeService('Workspace',workspaceDefinitions),registerDeclarativeService(a170_0x280a94(0xec),appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a170_0x280a94(0x9f)}),registerDeclarativeService(a170_0x280a94(0xc8),tenantDefinitions),registerDeclarativeService(a170_0x280a94(0xd5),userAccountDefinitions),registerDeclarativeService(a170_0x280a94(0xeb),datasetDefinitions),registerDeclarativeService(a170_0x280a94(0xef),pageDefinitions),registerDeclarativeService(a170_0x280a94(0xf0),apiDefinitions),registerDeclarativeService(a170_0x280a94(0xce),dataDefinitions),registerDeclarativeService(a170_0x280a94(0xd8),bffDefinitions),registerDeclarativeService(a170_0x280a94(0xb9),notificationDefinitions),registerDeclarativeService('SQL\x20Queries',sqlDefinitions),registerDeclarativeService('Database\x20Connections',dbDefinitions),registerDeclarativeService(a170_0x280a94(0xae),menuDefinitions),registerDeclarativeService(a170_0x280a94(0xd1),taskDefinitions),registerDeclarativeService(a170_0x280a94(0xd3),roleDefinitions),registerDeclarativeService(a170_0x280a94(0xd4),permitDefinitions),registerDeclarativeService(a170_0x280a94(0xbb),appConfigDefinitions),registerDeclarativeService(a170_0x280a94(0xe3),kbDefinitions),registerDeclarativeService(a170_0x280a94(0xcc),issueDefinitions),registerDeclarativeService('File',fileDefinitions),registerDeclarativeService(a170_0x280a94(0xb0),ocrDefinitions),registerDeclarativeService(a170_0x280a94(0xc7),codegenDefinitions),registerDeclarativeService(a170_0x280a94(0xa6),configDefinitions),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0x280a94(0xcb),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0x280a94(0xb5),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0x280a94(0xe4),cliSkillDefinitions,{'defaultCommand':a170_0x280a94(0xca)}),registerDeclarativeService(a170_0x280a94(0xad),logsDefinitions,{'defaultCommand':a170_0x280a94(0xdf)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a170_0x280a94(0x9a)]-0x1];last[a170_0x280a94(0xe5)]=[{'command':'<script>','description':a170_0x280a94(0x9e),'tag':a170_0x280a94(0x99)+runDefinition['risk']+']'}];}const REMOVED_COMMAND_REPLACEMENTS=new Map([['sql:save',a170_0x280a94(0xd7)],[a170_0x280a94(0xb6),'rabetbase\x20bff\x20create'],[a170_0x280a94(0xc5),a170_0x280a94(0xc2)],['menu:update',a170_0x280a94(0xb4)],[a170_0x280a94(0xed),'rabetbase\x20workspace\x20init\x20--appcode\x20<code>'],['skill:',a170_0x280a94(0xee)],[a170_0x280a94(0x9c),a170_0x280a94(0xee)],[a170_0x280a94(0xe7),a170_0x280a94(0xee)],['skills:install',a170_0x280a94(0xee)],[a170_0x280a94(0xe2),a170_0x280a94(0xe6)],[a170_0x280a94(0x98),a170_0x280a94(0xde)],[a170_0x280a94(0xa2),a170_0x280a94(0xab)],[a170_0x280a94(0xac),a170_0x280a94(0xc4)],[a170_0x280a94(0xdc),'rabetbase\x20kb\x20list'],[a170_0x280a94(0xda),a170_0x280a94(0x9d)],[a170_0x280a94(0xa5),a170_0x280a94(0xa8)],[a170_0x280a94(0xc0),a170_0x280a94(0xd6)],['knowledge-base:delete',a170_0x280a94(0xd9)]]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([[a170_0x280a94(0xbe),a170_0x280a94(0xa4)],[a170_0x280a94(0xbc),a170_0x280a94(0x9b)],[a170_0x280a94(0xc3),'rabetbase\x20run\x20build'],['preview','rabetbase\x20run\x20preview'],[a170_0x280a94(0xb8),a170_0x280a94(0xd0)]]);export function resolveRemovedCommand(_0x49c26b,_0x4b1b9c){const _0x3b79ef=a170_0x280a94;if(!_0x49c26b)return undefined;const _0x175709=REMOVED_COMMAND_REPLACEMENTS[_0x3b79ef(0xf1)](_0x49c26b+':'+(_0x4b1b9c??'')),_0x540db0=REMOVED_FLAT_COMMAND_REPLACEMENTS[_0x3b79ef(0xf1)](_0x49c26b),_0x46863e=_0x175709??_0x540db0;if(!_0x46863e)return undefined;const _0x2b9a2f=_0x540db0?_0x49c26b:_0x4b1b9c?_0x49c26b+'\x20'+_0x4b1b9c:_0x49c26b;return{'command':_0x2b9a2f,'message':'`rabetbase\x20'+_0x2b9a2f+'`\x20has\x20been\x20removed.','hint':_0x3b79ef(0xc9)+_0x46863e+_0x3b79ef(0xbf)};}export function findDefinition(_0x30ae22,_0x374b87){return definitions['get'](_0x30ae22+':'+_0x374b87);}export function isKnownService(_0xf8da1c){const _0x40d79d=a170_0x280a94;return serviceByName[_0x40d79d(0xcf)](_0xf8da1c);}export function isDeclarativeService(_0x4e00c6){const _0x4d231d=a170_0x280a94;return serviceGroups[_0x4d231d(0xcf)](_0x4e00c6)||serviceByName[_0x4d231d(0xf1)](_0x4e00c6)?.[_0x4d231d(0xd2)]!==undefined;}export function getServiceEntry(_0x11fdb6){const _0x43a51e=a170_0x280a94;return serviceByName[_0x43a51e(0xf1)](_0x11fdb6);}export function getLegacyHandler(_0x1eb7bc,_0xbe9510){return undefined;}export function getAllDefinitions(){const _0x4a21ed=a170_0x280a94;return Array[_0x4a21ed(0xb2)](definitions[_0x4a21ed(0xa9)]());}
|
|
1
|
+
const a170_0xf2d6f1=a170_0xa71e;(function(_0x84f389,_0x117a05){const _0x4d88c3=a170_0xa71e,_0x56ec43=_0x84f389();while(!![]){try{const _0x3cdc5b=-parseInt(_0x4d88c3(0x222))/0x1*(parseInt(_0x4d88c3(0x238))/0x2)+-parseInt(_0x4d88c3(0x202))/0x3+-parseInt(_0x4d88c3(0x21f))/0x4+-parseInt(_0x4d88c3(0x249))/0x5+-parseInt(_0x4d88c3(0x240))/0x6*(-parseInt(_0x4d88c3(0x23c))/0x7)+-parseInt(_0x4d88c3(0x21e))/0x8*(-parseInt(_0x4d88c3(0x216))/0x9)+-parseInt(_0x4d88c3(0x245))/0xa*(-parseInt(_0x4d88c3(0x1f5))/0xb);if(_0x3cdc5b===_0x117a05)break;else _0x56ec43['push'](_0x56ec43['shift']());}catch(_0x178e1f){_0x56ec43['push'](_0x56ec43['shift']());}}}(a170_0x1861,0x287a3));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';function a170_0xa71e(_0x296db9,_0x1e4d88){_0x296db9=_0x296db9-0x1ed;const _0x1861ec=a170_0x1861();let _0xa71ec9=_0x1861ec[_0x296db9];return _0xa71ec9;}import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{taskDefinitions}from'../commands/task/index.js';import{tenantDefinitions}from'../commands/tenant/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{userAccountDefinitions}from'../commands/user-account/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';function a170_0x1861(){const _0x20e984=['Async\x20Tasks','skill:install','command','Platform\x20Issue','knowledge-base:update','show','File','app:remove','menu:update','rabetbase\x20workspace\x20use\x20--app\x20<name>','map','bff:new','app:remote','rabetbase\x20workspace\x20remove\x20<name>','knowledge-base:detail','skills:','Self\x20Update','27ENOUdX','rabetbase\x20cli-skill\x20install','Instant\x20API','knowledge-base:delete','Smart\x20List\x20Pages\x20&\x20React\x20Custom\x20Pages','User\x20Accounts','OCR','Roles','678488QyJauY','487304gpQrPq','from','length','228082VgdTzR','App\x20Management','\x20\x20[high-risk-write]','\x20\x20[write]','`rabetbase\x20','wildcardDef','run','skills:install','rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>','rabetbase\x20kb\x20detail','read','description','Project','Notification\x20Configuration','API\x20Development','Runtime\x20App\x20Config\x20Management','CLI\x20Built-in\x20Skill','has','Run\x20Scripts','logout','project:init','rabetbase\x20menu\x20asset-update','2BYqiFI','install','rabetbase\x20kb\x20delete','app:use','98vvudfn','rabetbase\x20run\x20start','app:add','Workspace','22146ssnPyM','build','Run\x20any\x20package.json\x20script','rabetbase\x20auth\x20logout','rabetbase\x20project\x20create\x20<project-name>','10GiIbPF','service','rabetbase\x20run\x20build','knowledge-base:create','854715mStgKs','Configuration','Schema','write','set','rabetbase\x20kb\x20create','risk','Dataset\x20&\x20Operations','isSingleCommand','4954114USiavA','hidden','rabetbase\x20bff\x20create','get','Menu','rabetbase\x20app\x20list\x20--remote','values','Quick\x20Start','Company\x20Knowledge\x20Base','\x20\x20[','defaultCommand','`\x20has\x20been\x20removed.','login','209505iGzgAI','Database\x20Connections','create'];a170_0x1861=function(){return _0x20e984;};return a170_0x1861();}export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x491406){const _0x1be160=a170_0xa71e;for(const _0x160524 of _0x491406){definitions[_0x1be160(0x1f0)](_0x160524[_0x1be160(0x246)]+':'+_0x160524[_0x1be160(0x207)],_0x160524);let _0x290d60=serviceGroups[_0x1be160(0x1f8)](_0x160524[_0x1be160(0x246)]);!_0x290d60&&(_0x290d60=[],serviceGroups[_0x1be160(0x1f0)](_0x160524['service'],_0x290d60)),_0x290d60['push'](_0x160524);}}function registerDeclarativeService(_0x187e25,_0xe77c72,_0x310031){const _0x34a425=a170_0xa71e;registerDefinitions(_0xe77c72);_0x310031?.['wildcardDef']&®isterDefinitions([_0x310031[_0x34a425(0x227)]]);const _0x42423a=_0x450d82=>_0x450d82===_0x34a425(0x22c)?'':_0x450d82===_0x34a425(0x1ef)?_0x34a425(0x225):_0x34a425(0x224),_0x3aae92={'service':_0xe77c72[0x0][_0x34a425(0x246)],'label':_0x187e25,'commands':_0xe77c72['filter'](_0x48e882=>!_0x48e882[_0x34a425(0x1f6)])[_0x34a425(0x20f)](_0x4fc751=>({'command':_0x4fc751['command'],'description':_0x4fc751[_0x34a425(0x22d)],'tag':_0x42423a(_0x4fc751[_0x34a425(0x1f2)])})),'declarative':!![],'defaultCommand':_0x310031?.[_0x34a425(0x1ff)]??(_0x310031?.[_0x34a425(0x1f4)]?_0xe77c72[0x0][_0x34a425(0x207)]:undefined),'wildcardDef':_0x310031?.[_0x34a425(0x227)],'isSingleCommand':_0x310031?.['isSingleCommand']};serviceRegistry['push'](_0x3aae92),serviceByName[_0x34a425(0x1f0)](_0x3aae92[_0x34a425(0x246)],_0x3aae92);}registerDeclarativeService(a170_0xf2d6f1(0x1fc),initDefinitions,{'defaultCommand':a170_0xf2d6f1(0x228),'isSingleCommand':!![]}),registerDeclarativeService(a170_0xf2d6f1(0x22e),projectDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x23f),workspaceDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x223),appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a170_0xf2d6f1(0x201)}),registerDeclarativeService('Tenant\x20Members',tenantDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x21b),userAccountDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x1f3),datasetDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x21a),pageDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x230),apiDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x218),dataDefinitions),registerDeclarativeService('BFF\x20Scripts',bffDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x22f),notificationDefinitions),registerDeclarativeService('SQL\x20Queries',sqlDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x203),dbDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x1f9),menuDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x205),taskDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x21d),roleDefinitions),registerDeclarativeService('Permissions',permitDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x231),appConfigDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x1fd),kbDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x208),issueDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x20b),fileDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x21c),ocrDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService(a170_0xf2d6f1(0x1ed),configDefinitions),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0xf2d6f1(0x1ee),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0xf2d6f1(0x215),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0xf2d6f1(0x232),cliSkillDefinitions,{'defaultCommand':a170_0xf2d6f1(0x239)}),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':a170_0xf2d6f1(0x20a)}),registerDeclarativeService(a170_0xf2d6f1(0x234),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a170_0xf2d6f1(0x221)]-0x1];last['commands']=[{'command':'<script>','description':a170_0xf2d6f1(0x242),'tag':a170_0xf2d6f1(0x1fe)+runDefinition[a170_0xf2d6f1(0x1f2)]+']'}];}const REMOVED_COMMAND_REPLACEMENTS=new Map([['sql:save','rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml'],[a170_0xf2d6f1(0x210),a170_0xf2d6f1(0x1f7)],['sql:new','rabetbase\x20sql\x20create'],[a170_0xf2d6f1(0x20d),a170_0xf2d6f1(0x237)],[a170_0xf2d6f1(0x236),'rabetbase\x20workspace\x20init\x20--appcode\x20<code>'],['skill:',a170_0xf2d6f1(0x217)],[a170_0xf2d6f1(0x206),a170_0xf2d6f1(0x217)],[a170_0xf2d6f1(0x214),'rabetbase\x20cli-skill\x20install'],[a170_0xf2d6f1(0x229),a170_0xf2d6f1(0x217)],[a170_0xf2d6f1(0x211),a170_0xf2d6f1(0x1fa)],[a170_0xf2d6f1(0x23b),a170_0xf2d6f1(0x20e)],[a170_0xf2d6f1(0x23e),a170_0xf2d6f1(0x22a)],[a170_0xf2d6f1(0x20c),a170_0xf2d6f1(0x212)],['knowledge-base:list','rabetbase\x20kb\x20list'],[a170_0xf2d6f1(0x213),a170_0xf2d6f1(0x22b)],[a170_0xf2d6f1(0x248),a170_0xf2d6f1(0x1f1)],[a170_0xf2d6f1(0x209),'rabetbase\x20kb\x20update'],[a170_0xf2d6f1(0x219),a170_0xf2d6f1(0x23a)]]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([[a170_0xf2d6f1(0x204),a170_0xf2d6f1(0x244)],['start',a170_0xf2d6f1(0x23d)],[a170_0xf2d6f1(0x241),a170_0xf2d6f1(0x247)],['preview','rabetbase\x20run\x20preview'],[a170_0xf2d6f1(0x235),a170_0xf2d6f1(0x243)]]);export function resolveRemovedCommand(_0x4a9c65,_0x42403a){const _0x4ffb09=a170_0xf2d6f1;if(!_0x4a9c65)return undefined;const _0x4816c7=REMOVED_COMMAND_REPLACEMENTS['get'](_0x4a9c65+':'+(_0x42403a??'')),_0x4c1bcf=REMOVED_FLAT_COMMAND_REPLACEMENTS['get'](_0x4a9c65),_0x38560e=_0x4816c7??_0x4c1bcf;if(!_0x38560e)return undefined;const _0x287341=_0x4c1bcf?_0x4a9c65:_0x42403a?_0x4a9c65+'\x20'+_0x42403a:_0x4a9c65;return{'command':_0x287341,'message':_0x4ffb09(0x226)+_0x287341+_0x4ffb09(0x200),'hint':'Use\x20`'+_0x38560e+'`\x20instead.'};}export function findDefinition(_0x156811,_0x193975){return definitions['get'](_0x156811+':'+_0x193975);}export function isKnownService(_0x3c1f6a){const _0x344b29=a170_0xf2d6f1;return serviceByName[_0x344b29(0x233)](_0x3c1f6a);}export function isDeclarativeService(_0x1ff3e1){const _0x50a552=a170_0xf2d6f1;return serviceGroups[_0x50a552(0x233)](_0x1ff3e1)||serviceByName[_0x50a552(0x1f8)](_0x1ff3e1)?.['wildcardDef']!==undefined;}export function getServiceEntry(_0x47b79d){const _0x17193a=a170_0xf2d6f1;return serviceByName[_0x17193a(0x1f8)](_0x47b79d);}export function getLegacyHandler(_0x3dc00d,_0x4c3d25){return undefined;}export function getAllDefinitions(){const _0x11e2e3=a170_0xf2d6f1;return Array[_0x11e2e3(0x220)](definitions[_0x11e2e3(0x1fb)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a171_0x15855a=a171_0x3213;(function(_0x3d0310,_0x2f5249){const _0x3e43a3=a171_0x3213,_0x357d23=_0x3d0310();while(!![]){try{const _0x48f4f7=-parseInt(_0x3e43a3(0x1bd))/0x1*(parseInt(_0x3e43a3(0x1b9))/0x2)+-parseInt(_0x3e43a3(0x1be))/0x3*(-parseInt(_0x3e43a3(0x1c8))/0x4)+parseInt(_0x3e43a3(0x1c5))/0x5+-parseInt(_0x3e43a3(0x1b7))/0x6*(parseInt(_0x3e43a3(0x1c7))/0x7)+parseInt(_0x3e43a3(0x1ba))/0x8+-parseInt(_0x3e43a3(0x1b8))/0x9+parseInt(_0x3e43a3(0x1cb))/0xa*(parseInt(_0x3e43a3(0x1b6))/0xb);if(_0x48f4f7===_0x2f5249)break;else _0x357d23['push'](_0x357d23['shift']());}catch(_0x213420){_0x357d23['push'](_0x357d23['shift']());}}}(a171_0x4d27,0x587f7));function a171_0x3213(_0x25feeb,_0x575aa4){_0x25feeb=_0x25feeb-0x1b5;const _0x4d272f=a171_0x4d27();let _0x32133d=_0x4d272f[_0x25feeb];return _0x32133d;}function a171_0x4d27(){const _0x9ab40d=['1570383seABQi','1042lvQwHf','168464wBltpC','str','remark','34RQbzVy','9JfXBXe','CUSTOM','name','role','create','flagMissing','trim','1990815rMdgWU','POST','576254mJGjgJ','91388PyQGGx','Created\x20role\x20','\x20(id=','20YBjTfL','/smartapi/permit/role/create','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','length','write','820864LqFOTT','6XizXUz'];a171_0x4d27=function(){return _0x9ab40d;};return a171_0x4d27();}import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH=a171_0x15855a(0x1cc);function readName(_0x14de24){const _0x10f1a0=a171_0x15855a,_0x4335f5=_0x14de24[_0x10f1a0(0x1bb)](_0x10f1a0(0x1c0))[_0x10f1a0(0x1c4)]();if(!_0x4335f5)throw CliErrors[_0x10f1a0(0x1c3)](_0x10f1a0(0x1c0),'Pass\x20--name\x20<roleName>.');if(_0x4335f5[_0x10f1a0(0x1ce)]>0x40)throw CliErrors['validation'](_0x10f1a0(0x1cd));return _0x4335f5;}export const roleCreate={'service':a171_0x15855a(0x1c1),'command':a171_0x15855a(0x1c2),'description':'Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','risk':a171_0x15855a(0x1b5),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x222145){readName(_0x222145);},async 'dryRun'(_0x5a10ab){const _0x260b1a=a171_0x15855a,_0x47c693=readName(_0x5a10ab),_0x18f714=_0x5a10ab[_0x260b1a(0x1bb)](_0x260b1a(0x1bc))[_0x260b1a(0x1c4)]()||undefined;return asDryRunResult({'operation':_0x260b1a(0x1c2),'selector':{'appCode':_0x5a10ab['appCode'],'roleName':_0x47c693},'before':null,'after':{'roleName':_0x47c693,'roleType':_0x260b1a(0x1bf),'remark':_0x18f714},'dryRun':!![],'backend':{'method':_0x260b1a(0x1c6),'path':CREATE_PATH},'warnings':[]},{'method':_0x260b1a(0x1c6),'url':CREATE_PATH});},async 'execute'(_0x3b5125){const _0x3f91de=a171_0x15855a,_0xabc87e=readName(_0x3b5125),_0x5e6d15=_0x3b5125[_0x3f91de(0x1bb)]('remark')[_0x3f91de(0x1c4)]()||undefined,_0x32bd57=await createAppRole({'appCode':_0x3b5125['appCode'],'roleName':_0xabc87e,..._0x5e6d15?{'remark':_0x5e6d15}:{}});return{'ok':!![],'data':{'operation':_0x3f91de(0x1c2),'selector':{'appCode':_0x3b5125['appCode'],'roleId':_0x32bd57['id'],'roleName':_0xabc87e},'before':null,'after':projectRole(_0x32bd57),'dryRun':![],'backend':{'method':_0x3f91de(0x1c6),'path':CREATE_PATH},'warnings':[]},'message':_0x3f91de(0x1c9)+_0x32bd57['roleName']+_0x3f91de(0x1ca)+_0x32bd57['id']+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a172_0x1855f8=a172_0x9dc7;(function(_0x5b81a0,_0x5770c1){const _0x13f425=a172_0x9dc7,_0x354c7a=_0x5b81a0();while(!![]){try{const _0x803f81=-parseInt(_0x13f425(0x10d))/0x1+-parseInt(_0x13f425(0x10e))/0x2+-parseInt(_0x13f425(0x106))/0x3*(parseInt(_0x13f425(0x111))/0x4)+-parseInt(_0x13f425(0x108))/0x5+-parseInt(_0x13f425(0x113))/0x6*(parseInt(_0x13f425(0x114))/0x7)+-parseInt(_0x13f425(0x101))/0x8+parseInt(_0x13f425(0x10a))/0x9;if(_0x803f81===_0x5770c1)break;else _0x354c7a['push'](_0x354c7a['shift']());}catch(_0x150374){_0x354c7a['push'](_0x354c7a['shift']());}}}(a172_0x2c78,0x1a32b));import{deleteAppRole}from'../../core/api-client.js';function a172_0x9dc7(_0x41eb51,_0x38df3b){_0x41eb51=_0x41eb51-0x100;const _0x2c78e8=a172_0x2c78();let _0x9dc7ae=_0x2c78e8[_0x41eb51];return _0x9dc7ae;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a172_0x2c78(){const _0x3e31c5=['6470757DClfog','roleName','high-risk-write','47596HGgHCG','353144cqPgMy','appCode','POST','4UKWgxS','\x20(id=','87168jsStnT','77JqJurI','num','370648wXNPVm','role','delete','userCount','/smartapi/permit/role/delete','103839Llbbbr','Role\x20still\x20has\x20','733730mruhlT','Deleted\x20role\x20'];a172_0x2c78=function(){return _0x3e31c5;};return a172_0x2c78();}const DELETE_PATH=a172_0x1855f8(0x105);export const roleDelete={'service':a172_0x1855f8(0x102),'command':a172_0x1855f8(0x103),'description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':a172_0x1855f8(0x10c),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4f84c3){const _0x3250b8=a172_0x1855f8,_0x5128d5=_0x4f84c3[_0x3250b8(0x100)]('id'),_0x4f51c6=await getRoleById(_0x4f84c3['appCode'],_0x5128d5);return assertCustomRole(_0x4f51c6,_0x3250b8(0x103)),asDryRunResult({'operation':_0x3250b8(0x103),'selector':{'appCode':_0x4f84c3[_0x3250b8(0x10f)],'roleId':_0x5128d5,'roleName':_0x4f51c6[_0x3250b8(0x10b)]},'before':projectRole(_0x4f51c6),'after':null,'dryRun':!![],'backend':{'method':_0x3250b8(0x110),'path':DELETE_PATH},'warnings':_0x4f51c6[_0x3250b8(0x104)]>0x0?[_0x3250b8(0x107)+_0x4f51c6[_0x3250b8(0x104)]+'\x20member(s);\x20they\x20will\x20lose\x20this\x20group.']:[]},{'method':_0x3250b8(0x110),'url':DELETE_PATH});},async 'execute'(_0x82426d){const _0x4c4d87=a172_0x1855f8,_0x2dac5e=_0x82426d[_0x4c4d87(0x100)]('id'),_0xe0a8ef=await getRoleById(_0x82426d['appCode'],_0x2dac5e);return assertCustomRole(_0xe0a8ef,_0x4c4d87(0x103)),await deleteAppRole(_0x2dac5e),{'ok':!![],'data':{'operation':_0x4c4d87(0x103),'selector':{'appCode':_0x82426d[_0x4c4d87(0x10f)],'roleId':_0x2dac5e,'roleName':_0xe0a8ef[_0x4c4d87(0x10b)]},'before':projectRole(_0xe0a8ef),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x4c4d87(0x109)+_0xe0a8ef['roleName']+_0x4c4d87(0x112)+_0x2dac5e+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a173_0x155907=a173_0x5ebe;function a173_0x2143(){const _0x1ac0e6=['1645HfnkGy','3075loKhUv','Role\x20','roleType','3178080nwuGvu','7812850eQkIYQ','47997NnFlPZ','appCode','num','detail','5656140BCegHE','9cjegbb','24864wjvIiZ','119320mkGxwn','read','436arvNMR'];a173_0x2143=function(){return _0x1ac0e6;};return a173_0x2143();}(function(_0x557fd7,_0x5798d6){const _0x13bd7d=a173_0x5ebe,_0x5390a7=_0x557fd7();while(!![]){try{const _0x3cda96=parseInt(_0x13bd7d(0x1a5))/0x1*(-parseInt(_0x13bd7d(0x1a7))/0x2)+-parseInt(_0x13bd7d(0x1a0))/0x3+-parseInt(_0x13bd7d(0x199))/0x4*(parseInt(_0x13bd7d(0x19b))/0x5)+parseInt(_0x13bd7d(0x19e))/0x6+parseInt(_0x13bd7d(0x19a))/0x7*(parseInt(_0x13bd7d(0x1a6))/0x8)+parseInt(_0x13bd7d(0x1a4))/0x9+-parseInt(_0x13bd7d(0x19f))/0xa;if(_0x3cda96===_0x5798d6)break;else _0x5390a7['push'](_0x5390a7['shift']());}catch(_0x18e516){_0x5390a7['push'](_0x5390a7['shift']());}}}(a173_0x2143,0x76f5d));function a173_0x5ebe(_0x12ee64,_0x1cfc06){_0x12ee64=_0x12ee64-0x199;const _0x21439e=a173_0x2143();let _0x5ebee9=_0x21439e[_0x12ee64];return _0x5ebee9;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':'role','command':a173_0x155907(0x1a3),'description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':a173_0x155907(0x1a8),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0xdc7f3b){const _0xde3f2a=a173_0x155907,_0x2fdc2d=_0xdc7f3b[_0xde3f2a(0x1a2)]('id'),_0x30650c=await getRoleById(_0xdc7f3b[_0xde3f2a(0x1a1)],_0x2fdc2d);return{'ok':!![],'data':{'role':projectRole(_0x30650c)},'message':_0xde3f2a(0x19c)+_0x30650c['roleName']+'\x20('+_0x30650c[_0xde3f2a(0x19d)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3c1de3,_0x4d3398){const _0x5c1287=a174_0x44e6,_0x387eca=_0x3c1de3();while(!![]){try{const _0xd3b8=parseInt(_0x5c1287(0xeb))/0x1*(parseInt(_0x5c1287(0xea))/0x2)+parseInt(_0x5c1287(0xef))/0x3*(parseInt(_0x5c1287(0xee))/0x4)+-parseInt(_0x5c1287(0xe8))/0x5*(parseInt(_0x5c1287(0xed))/0x6)+parseInt(_0x5c1287(0xe5))/0x7*(-parseInt(_0x5c1287(0xe9))/0x8)+-parseInt(_0x5c1287(0xe6))/0x9*(-parseInt(_0x5c1287(0xe4))/0xa)+parseInt(_0x5c1287(0xec))/0xb*(parseInt(_0x5c1287(0xe7))/0xc)+parseInt(_0x5c1287(0xe3))/0xd;if(_0xd3b8===_0x4d3398)break;else _0x387eca['push'](_0x387eca['shift']());}catch(_0x376259){_0x387eca['push'](_0x387eca['shift']());}}}(a174_0x54e5,0xa26a4));function a174_0x54e5(){const _0x1e03f7=['10zExYYl','48DdOuQu','749174NfKDFz','1bWpuaD','550uOdTmR','3575298lXZuWJ','1599604zoqGIM','6kkATlP','16875664aZLINp','782090LLtHUX','1226722vAGLxJ','27rMaBwu','48324SzsFUE'];a174_0x54e5=function(){return _0x1e03f7;};return a174_0x54e5();}import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';function a174_0x44e6(_0x2b07a1,_0x4b3c85){_0x2b07a1=_0x2b07a1-0xe3;const _0x54e5f5=a174_0x54e5();let _0x44e6fc=_0x54e5f5[_0x2b07a1];return _0x44e6fc;}import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a175_0x15ea57=a175_0x7fa9;(function(_0x4f3fc0,_0x20ec77){const _0x3a483f=a175_0x7fa9,_0x868ec1=_0x4f3fc0();while(!![]){try{const _0x28f1ab=parseInt(_0x3a483f(0xb0))/0x1+-parseInt(_0x3a483f(0xb1))/0x2*(-parseInt(_0x3a483f(0xc4))/0x3)+parseInt(_0x3a483f(0xb6))/0x4*(-parseInt(_0x3a483f(0xa5))/0x5)+-parseInt(_0x3a483f(0xc6))/0x6+parseInt(_0x3a483f(0xc5))/0x7+parseInt(_0x3a483f(0xa9))/0x8*(parseInt(_0x3a483f(0xae))/0x9)+parseInt(_0x3a483f(0xa8))/0xa*(-parseInt(_0x3a483f(0xc1))/0xb);if(_0x28f1ab===_0x20ec77)break;else _0x868ec1['push'](_0x868ec1['shift']());}catch(_0x1449af){_0x868ec1['push'](_0x868ec1['shift']());}}}(a175_0x4521,0x3a778));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a175_0x4521(){const _0x291f92=['Use\x20one\x20of:\x20','USER','Filter\x20by\x20role\x20type','711xEVbHe','Invalid\x20--type\x20\x22','388386HxYUTP','4PSKwDo','num','validation','toUpperCase','str','844OKskab','map','read','DEV','string','number','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','Page\x20size\x20(1-100)','list','type','role','1287WuyPqm','includes','page','311805NvsshX','2507498scnIgR','2572434EPDoYw','CUSTOM','trim','filter','6535bGXzCD','pagesize','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','31030EdoIjf','35704XOaDzZ','Page\x20index\x20(1-based)'];a175_0x4521=function(){return _0x291f92;};return a175_0x4521();}import{projectRole}from'../../commands/role/shared.js';function a175_0x7fa9(_0x133e83,_0x1d54f9){_0x133e83=_0x133e83-0xa4;const _0x452146=a175_0x4521();let _0x7fa9d7=_0x452146[_0x133e83];return _0x7fa9d7;}const ROLE_TYPES=['ADMIN',a175_0x15ea57(0xb9),a175_0x15ea57(0xac),a175_0x15ea57(0xc7)];export const roleList={'service':a175_0x15ea57(0xc0),'command':a175_0x15ea57(0xbe),'description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a175_0x15ea57(0xb8),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a175_0x15ea57(0xbf),'type':a175_0x15ea57(0xba),'required':![],'description':a175_0x15ea57(0xad),'enum':ROLE_TYPES},{'name':a175_0x15ea57(0xc3),'type':a175_0x15ea57(0xbb),'description':a175_0x15ea57(0xaa),'default':0x1},{'name':a175_0x15ea57(0xa6),'type':a175_0x15ea57(0xbb),'description':a175_0x15ea57(0xbd),'default':0x64}],async 'validate'(_0x48fa09){const _0x479325=a175_0x15ea57,_0x5771a5=_0x48fa09[_0x479325(0xb5)]('type')[_0x479325(0xc8)]();if(_0x5771a5&&!ROLE_TYPES[_0x479325(0xc2)](_0x5771a5[_0x479325(0xb4)]()))throw CliErrors['validation'](_0x479325(0xaf)+_0x5771a5+'\x22.',_0x479325(0xab)+ROLE_TYPES['join'](',\x20')+'.');const _0x3f2d85=_0x48fa09[_0x479325(0xb2)]('page',0x1),_0x21352c=_0x48fa09[_0x479325(0xb2)](_0x479325(0xa6),0x64);if(_0x3f2d85<0x1)throw CliErrors[_0x479325(0xb3)](_0x479325(0xa7));if(_0x21352c<0x1||_0x21352c>0x64)throw CliErrors[_0x479325(0xb3)](_0x479325(0xbc));},async 'execute'(_0xd352d7){const _0x3a0abc=a175_0x15ea57,_0x5641a2=_0xd352d7[_0x3a0abc(0xb2)](_0x3a0abc(0xc3),0x1)||0x1,_0x5370b1=_0xd352d7[_0x3a0abc(0xb2)](_0x3a0abc(0xa6),0x64)||0x64,_0x5705cf=_0xd352d7['str']('type')[_0x3a0abc(0xc8)]()[_0x3a0abc(0xb4)](),{items:_0x991ee2,paging:_0x2d548e}=await listAppRoles(_0xd352d7['appCode'],{'currentPage':_0x5641a2,'pageSize':_0x5370b1}),_0x513690=_0x5705cf?_0x991ee2[_0x3a0abc(0xa4)](_0x3ed1bf=>_0x3ed1bf['roleType']===_0x5705cf):_0x991ee2,_0x46cfb0=_0x513690[_0x3a0abc(0xb7)](projectRole);return{'ok':!![],'data':{'roles':_0x46cfb0,'paging':_0x2d548e},'message':'Found\x20'+_0x46cfb0['length']+'\x20role(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a176_0xd06d85=a176_0x44ba;(function(_0x2796b1,_0x5d2563){const _0x475047=a176_0x44ba,_0x4bea09=_0x2796b1();while(!![]){try{const _0x579068=parseInt(_0x475047(0x187))/0x1*(parseInt(_0x475047(0x1bb))/0x2)+parseInt(_0x475047(0x17a))/0x3+-parseInt(_0x475047(0x1a6))/0x4+-parseInt(_0x475047(0x19f))/0x5+-parseInt(_0x475047(0x17c))/0x6*(parseInt(_0x475047(0x196))/0x7)+parseInt(_0x475047(0x18f))/0x8+-parseInt(_0x475047(0x1af))/0x9;if(_0x579068===_0x5d2563)break;else _0x4bea09['push'](_0x4bea09['shift']());}catch(_0x4171b0){_0x4bea09['push'](_0x4bea09['shift']());}}}(a176_0x2ae7,0xe53a9));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a176_0xd06d85(0x190),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a176_0xd06d85(0x17e),'type':a176_0xd06d85(0x198),'required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};export const USER_REF_FLAG={'name':a176_0xd06d85(0x1b2),'type':'string','required':!![],'description':a176_0xd06d85(0x1a1)};export const NAME_FLAG={'name':a176_0xd06d85(0x179),'type':'string','required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':a176_0xd06d85(0x179),'type':a176_0xd06d85(0x198),'required':!![],'description':a176_0xd06d85(0x195)};export const REMARK_FLAG={'name':a176_0xd06d85(0x1a0),'type':a176_0xd06d85(0x198),'required':![],'description':a176_0xd06d85(0x1b5)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':'number','required':![],'description':a176_0xd06d85(0x1ac)};export const BUILTIN_ROLE_TYPES=[a176_0xd06d85(0x19c),a176_0xd06d85(0x1a8),a176_0xd06d85(0x181)];export function isBuiltinRole(_0x47081b){return BUILTIN_ROLE_TYPES['includes'](_0x47081b);}export function assertCustomRole(_0xed8ca7,_0x4a3f75){const _0x2f9261=a176_0xd06d85;if(_0xed8ca7['roleType']!=='CUSTOM')throw CliErrors[_0x2f9261(0x17b)](_0x2f9261(0x199)+_0x4a3f75+'\x20built-in\x20role\x20'+_0xed8ca7[_0x2f9261(0x1ad)]+'\x20('+_0xed8ca7[_0x2f9261(0x194)]+').',_0x2f9261(0x1a3));}export function assertPermConfigurable(_0x1fdf28){const _0x48d673=a176_0xd06d85;if(_0x1fdf28[_0x48d673(0x194)]===_0x48d673(0x1a8)||_0x1fdf28[_0x48d673(0x194)]===_0x48d673(0x19c))throw CliErrors['validation'](_0x48d673(0x1a7)+_0x1fdf28[_0x48d673(0x1ad)]+'\x20('+_0x1fdf28[_0x48d673(0x194)]+').',_0x48d673(0x191));}export function projectRole(_0x3743dc){const _0x1ddb0a=a176_0xd06d85;return{'id':_0x3743dc['id'],'roleName':_0x3743dc[_0x1ddb0a(0x1ad)],'roleType':_0x3743dc[_0x1ddb0a(0x194)],'remark':_0x3743dc[_0x1ddb0a(0x1a0)],'userCount':_0x3743dc[_0x1ddb0a(0x1c3)],'permitCount':_0x3743dc[_0x1ddb0a(0x1b3)],'builtin':isBuiltinRole(_0x3743dc[_0x1ddb0a(0x194)])};}export async function resolveRoleRef(_0x299460,_0x5df18e){const _0x5eeba3=a176_0xd06d85,_0x555587=_0x5df18e[_0x5eeba3(0x18b)]();if(!_0x555587)throw CliErrors[_0x5eeba3(0x17b)](_0x5eeba3(0x1c4),_0x5eeba3(0x1b9));if(/^\d+$/['test'](_0x555587))return getRoleById(_0x299460,Number(_0x555587));const _0x14b2e1=await listAllAppRoles(_0x299460),_0x271c05=_0x14b2e1[_0x5eeba3(0x1b8)](_0x330e7f=>_0x330e7f['roleName']===_0x555587);if(_0x271c05[_0x5eeba3(0x19a)]===0x0)throw CliErrors[_0x5eeba3(0x17b)]('Role\x20name\x20\x22'+_0x555587+_0x5eeba3(0x19b)+_0x299460+'.',_0x5eeba3(0x1bc));if(_0x271c05['length']>0x1){const _0x5b9771=_0x271c05[_0x5eeba3(0x189)](_0x26a55d=>_0x26a55d['id'])[_0x5eeba3(0x17d)](',\x20');throw CliErrors[_0x5eeba3(0x17b)](_0x5eeba3(0x1a9)+_0x555587+_0x5eeba3(0x18c)+_0x5b9771+').',_0x5eeba3(0x18e));}return _0x271c05[0x0];}export async function getRoleById(_0x123d18,_0x9e784e){const _0x1bf4fe=a176_0xd06d85,_0x295a9a=await getAppRole(_0x9e784e);if(!_0x295a9a)throw CliErrors[_0x1bf4fe(0x17b)](_0x1bf4fe(0x1a5)+_0x9e784e+_0x1bf4fe(0x18d)+_0x123d18+'.',_0x1bf4fe(0x1b7));return _0x295a9a;}async function listAllAppRoles(_0x4fbdd1){const _0x45e93e=a176_0xd06d85,_0x24a70b=0x64,_0x52b4f9=[];for(let _0x49be4a=0x1;;_0x49be4a+=0x1){const {items:_0x2d0e08,paging:_0x5c9a9f}=await listAppRoles(_0x4fbdd1,{'currentPage':_0x49be4a,'pageSize':_0x24a70b});_0x52b4f9['push'](..._0x2d0e08);if(_0x2d0e08[_0x45e93e(0x19a)]<_0x24a70b||_0x5c9a9f&&_0x52b4f9[_0x45e93e(0x19a)]>=_0x5c9a9f['totalCount'])return _0x52b4f9;}}export async function resolveTenantCode(){const _0xc90858=a176_0xd06d85,_0xd57336=await getSessionUserInfo(),_0x417174=_0xd57336?.[_0xc90858(0x1b2)]?.['tenant']?.['tenant_code'];if(!_0x417174)throw CliErrors[_0xc90858(0x186)](_0xc90858(0x19e));return _0x417174;}function matchMember(_0x37f41e,_0x18d6f5){const _0x495739=a176_0xd06d85,_0x36f5d5=_0x18d6f5['trim']()[_0x495739(0x1c0)]();return(_0x37f41e['nickname']??'')['toLowerCase']()===_0x36f5d5||(_0x37f41e['username']??'')['toLowerCase']()===_0x36f5d5;}function a176_0x2ae7(){const _0x2b4fb2=['ADMIN','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','289585BWMOIm','remark','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','expectUserCount','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','appCode','Role\x20id\x20','2062628tsbtBZ','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','DEV','Role\x20name\x20\x22','\x20not\x20found\x20in\x20the\x20user-role\x20list.','splice','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','roleName','userId','12107178XqQMRF',';\x20no\x20change.','POST','user','permitCount','Multiple\x20tenant\x20members\x20match\x20\x22','Optional\x20role\x20remark/description','username','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','filter','Pass\x20--role\x20<id|name>.','\x22:\x20','3406712djxTql','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','findIndex','find','push','toLowerCase','flagMissing','includes','userCount','Missing\x20role\x20reference.','expect-user-count','flag','nickname','name','5229378hnYohS','validation','1959618kMURhL','join','role','\x20is\x20already\x20a\x20member\x20of\x20role\x20','No\x20tenant\x20member\x20matches\x20\x22','USER','\x20is\x20not\x20a\x20member\x20of\x20role\x20','Anti-drift\x20check\x20failed:\x20expected\x20','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','User\x20','authRequired','1RXoedA','\x20member(s)\x20but\x20role\x20has\x20','map','userList','trim','\x22\x20is\x20ambiguous\x20(ids:\x20','\x20not\x20found\x20in\x20app\x20','Disambiguate\x20with\x20--role\x20<id>.','3128512FLITxc','number','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','test','Disambiguate\x20with\x20--user\x20<id>.','roleType','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','21zPSkGe','Missing\x20user\x20reference.','string','Cannot\x20','length','\x22\x20not\x20found\x20in\x20app\x20'];a176_0x2ae7=function(){return _0x2b4fb2;};return a176_0x2ae7();}export async function resolveUserRef(_0x50344c){const _0x3e3533=a176_0xd06d85,_0x4bb0f6=_0x50344c[_0x3e3533(0x18b)]();if(!_0x4bb0f6)throw CliErrors[_0x3e3533(0x17b)](_0x3e3533(0x197),'Pass\x20--user\x20<id|name>.');const _0x444ad0=await resolveTenantCode(),_0x20bed3=await getTenantMembers(_0x444ad0);if(/^\d+$/[_0x3e3533(0x192)](_0x4bb0f6)){const _0x564b2d=Number(_0x4bb0f6),_0x4550f3=_0x20bed3[_0x3e3533(0x1be)](_0x55f634=>_0x55f634['userId']===_0x564b2d);return{'userId':_0x564b2d,'username':_0x4550f3?.[_0x3e3533(0x1b6)]??String(_0x564b2d),'nickname':_0x4550f3?.[_0x3e3533(0x178)],'matchedBy':'id'};}const _0x18c304=_0x20bed3[_0x3e3533(0x1b8)](_0x41f392=>matchMember(_0x41f392,_0x4bb0f6));if(_0x18c304[_0x3e3533(0x19a)]===0x0)throw CliErrors[_0x3e3533(0x17b)](_0x3e3533(0x180)+_0x4bb0f6+'\x22.',_0x3e3533(0x19d));if(_0x18c304['length']>0x1){const _0x452687=_0x18c304['map'](_0x364a8b=>(_0x364a8b[_0x3e3533(0x178)]??_0x364a8b[_0x3e3533(0x1b6)]??'?')+'('+_0x364a8b['userId']+')')[_0x3e3533(0x17d)](',\x20');throw CliErrors[_0x3e3533(0x17b)](_0x3e3533(0x1b4)+_0x4bb0f6+_0x3e3533(0x1ba)+_0x452687+'.',_0x3e3533(0x193));}const _0x5a1b8a=_0x18c304[0x0];return{'userId':_0x5a1b8a[_0x3e3533(0x1ae)],'username':_0x5a1b8a[_0x3e3533(0x1b6)]??String(_0x5a1b8a['userId']),'nickname':_0x5a1b8a[_0x3e3533(0x178)],'matchedBy':_0x3e3533(0x179)};}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x34352a){const _0x37e282=a176_0xd06d85;return(_0x34352a?.[_0x37e282(0x18a)]??[])['map'](_0x13e09d=>_0x13e09d[_0x37e282(0x1ae)]);}export function computeRoleUserMutation(_0x410991){const _0x40af3d=a176_0xd06d85,{operation:_0x53810b,appCode:_0x1d304,roleUsers:_0x34cf2c,targetRoleId:_0x239672,user:_0x2e7bb7}=_0x410991,_0xab6343=_0x34cf2c['find'](_0x18d5b7=>_0x18d5b7['id']===_0x239672);if(!_0xab6343)throw CliErrors['validation'](_0x40af3d(0x1a5)+_0x239672+_0x40af3d(0x1aa),'Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');const _0x372bb4=userIdsOf(_0xab6343),_0x4a8f37=[];if(_0x410991[_0x40af3d(0x1a2)]!==undefined&&_0x410991[_0x40af3d(0x1a2)]!==_0x372bb4[_0x40af3d(0x19a)])throw CliErrors[_0x40af3d(0x17b)](_0x40af3d(0x183)+_0x410991[_0x40af3d(0x1a2)]+_0x40af3d(0x188)+_0x372bb4[_0x40af3d(0x19a)]+'.',_0x40af3d(0x184));const _0x3ba54b=_0x372bb4[_0x40af3d(0x1c2)](_0x2e7bb7[_0x40af3d(0x1ae)]);let _0x51e7ea=![];const _0x308d80=[..._0xab6343['userList']];if(_0x53810b==='user-add')_0x3ba54b?_0x4a8f37['push'](_0x40af3d(0x185)+_0x2e7bb7[_0x40af3d(0x1ae)]+_0x40af3d(0x17f)+_0xab6343[_0x40af3d(0x1ad)]+_0x40af3d(0x1b0)):(_0x308d80[_0x40af3d(0x1bf)]({'userId':_0x2e7bb7[_0x40af3d(0x1ae)],'username':_0x2e7bb7[_0x40af3d(0x1b6)],..._0x2e7bb7['nickname']?{'nickname':_0x2e7bb7[_0x40af3d(0x178)]}:{}}),_0x51e7ea=!![]);else{if(!_0x3ba54b)_0x4a8f37['push'](_0x40af3d(0x185)+_0x2e7bb7[_0x40af3d(0x1ae)]+_0x40af3d(0x182)+_0xab6343[_0x40af3d(0x1ad)]+';\x20no\x20change.');else{const _0x573dd3=_0x308d80[_0x40af3d(0x1bd)](_0x4f91eb=>_0x4f91eb[_0x40af3d(0x1ae)]===_0x2e7bb7[_0x40af3d(0x1ae)]);if(_0x573dd3>=0x0)_0x308d80[_0x40af3d(0x1ab)](_0x573dd3,0x1);_0x51e7ea=!![];}}const _0x523077=_0x34cf2c[_0x40af3d(0x189)](_0x4c15e3=>_0x4c15e3['id']===_0x239672?{..._0x4c15e3,'userList':_0x308d80}:_0x4c15e3),_0x48123a=_0x308d80[_0x40af3d(0x189)](_0x38df6c=>_0x38df6c[_0x40af3d(0x1ae)]),_0x3b56b3={'operation':_0x53810b,'selector':{'appCode':_0x1d304,'roleId':_0x239672,'roleName':_0xab6343['roleName'],'userId':_0x2e7bb7['userId']},'before':{'userIds':_0x372bb4},'after':{'userIds':_0x48123a},'dryRun':_0x410991['dryRun'],'backend':{'method':_0x40af3d(0x1b1),'path':UPDATE_USER_LIST_PATH},'warnings':_0x4a8f37};return{'roleList':_0x523077,'mutation':_0x3b56b3,'changed':_0x51e7ea};}function a176_0x44ba(_0x152da0,_0x5bcf54){_0x152da0=_0x152da0-0x178;const _0x2ae7d8=a176_0x2ae7();let _0x44ba7b=_0x2ae7d8[_0x152da0];return _0x44ba7b;}export async function loadRoleUsers(_0x557198){return listRoleUsers(_0x557198);}export function readRoleRef(_0x285275){const _0x535d91=a176_0xd06d85,_0x575fa6=_0x285275['str'](_0x535d91(0x17e))[_0x535d91(0x18b)]();if(!_0x575fa6)throw CliErrors[_0x535d91(0x1c1)](_0x535d91(0x17e),_0x535d91(0x1b9));return _0x575fa6;}export async function prepareUserMutation(_0x597743,_0x7c5f43,_0xfc88d2){const _0x265208=a176_0xd06d85,_0x240e3e=readRoleRef(_0x597743),_0x1f57cf=_0x597743['str'](_0x265208(0x1b2))[_0x265208(0x18b)]();if(!_0x1f57cf)throw CliErrors['flagMissing']('user','Pass\x20--user\x20<id|name>.');const _0x238100=_0x597743[_0x265208(0x1c6)](_0x265208(0x1c5)),_0x40eb54=_0x238100===undefined||_0x238100===null?undefined:Number(_0x238100),_0x3fc59d=await resolveRoleRef(_0x597743['appCode'],_0x240e3e),_0x2480c6=await resolveUserRef(_0x1f57cf),_0x6bcebc=await loadRoleUsers(_0x597743['appCode']);return computeRoleUserMutation({'operation':_0x7c5f43,'appCode':_0x597743[_0x265208(0x1a4)],'roleUsers':_0x6bcebc,'targetRoleId':_0x3fc59d['id'],'user':{'userId':_0x2480c6['userId'],'username':_0x2480c6[_0x265208(0x1b6)],'nickname':_0x2480c6[_0x265208(0x178)]},'dryRun':_0xfc88d2,..._0x40eb54!==undefined?{'expectUserCount':_0x40eb54}:{}});}
|
|
1
|
+
const a176_0x4d4394=a176_0x4098;(function(_0x52ef5f,_0x3ef86d){const _0x1e829a=a176_0x4098,_0x11e841=_0x52ef5f();while(!![]){try{const _0x53902b=parseInt(_0x1e829a(0x1c7))/0x1+-parseInt(_0x1e829a(0x1b9))/0x2*(-parseInt(_0x1e829a(0x1b7))/0x3)+-parseInt(_0x1e829a(0x1a9))/0x4+parseInt(_0x1e829a(0x1bb))/0x5*(parseInt(_0x1e829a(0x199))/0x6)+-parseInt(_0x1e829a(0x1d1))/0x7*(-parseInt(_0x1e829a(0x1b0))/0x8)+-parseInt(_0x1e829a(0x1b2))/0x9*(-parseInt(_0x1e829a(0x1d9))/0xa)+-parseInt(_0x1e829a(0x19f))/0xb;if(_0x53902b===_0x3ef86d)break;else _0x11e841['push'](_0x11e841['shift']());}catch(_0x146c74){_0x11e841['push'](_0x11e841['shift']());}}}(a176_0x3159,0x2f1f2));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a176_0x4d4394(0x1ca),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};function a176_0x3159(){const _0x105b23=['authRequired','find','Disambiguate\x20with\x20--role\x20<id>.','tenant_code','Role\x20name','No\x20tenant\x20member\x20matches\x20\x22','nickname','\x20not\x20found\x20in\x20app\x20','118805TluyXH','user-add','string','number','str','Missing\x20role\x20reference.','Missing\x20user\x20reference.','join','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','user','2515261ZyjxbY','roleName','\x22\x20is\x20ambiguous\x20(ids:\x20','splice','Cannot\x20','Role\x20name\x20\x22','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','50WxKSCv','Optional\x20role\x20remark/description','dryRun','findIndex','role','remark','Role\x20id\x20','POST','\x22\x20not\x20found\x20in\x20app\x20','\x20built-in\x20role\x20','toLowerCase','expectUserCount','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Pass\x20--role\x20<id|name>.','/smartapi/permit/user-role/update-user-list','CUSTOM','tenant','push','DEV','36780BhCFXI','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','expect-user-count','Multiple\x20tenant\x20members\x20match\x20\x22','appCode','Pass\x20--user\x20<id|name>.','8416518qaFnzc','filter','permitCount','flagMissing','userCount','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','ADMIN','length','trim','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','3476rCJfwb','username','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','\x20is\x20not\x20a\x20member\x20of\x20role\x20','map','roleType','8xxcEJo','validation','544878msxkft','\x20member(s)\x20but\x20role\x20has\x20','Disambiguate\x20with\x20--user\x20<id>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','name','516147ZWjJGM',';\x20no\x20change.','2lytZfN','userId','5SNxFwe','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','User\x20','USER'];a176_0x3159=function(){return _0x105b23;};return a176_0x3159();}export const ROLE_REF_FLAG={'name':'role','type':a176_0x4d4394(0x1c9),'required':!![],'description':a176_0x4d4394(0x1d8)};export const USER_REF_FLAG={'name':a176_0x4d4394(0x1d0),'type':a176_0x4d4394(0x1c9),'required':!![],'description':a176_0x4d4394(0x1a4)};export const NAME_FLAG={'name':a176_0x4d4394(0x1b6),'type':a176_0x4d4394(0x1c9),'required':!![],'description':a176_0x4d4394(0x1c3)};export const USER_NAME_FLAG={'name':'name','type':a176_0x4d4394(0x1c9),'required':!![],'description':a176_0x4d4394(0x1d7)};export const REMARK_FLAG={'name':a176_0x4d4394(0x1de),'type':a176_0x4d4394(0x1c9),'required':![],'description':a176_0x4d4394(0x1da)};export const EXPECT_USER_COUNT_FLAG={'name':a176_0x4d4394(0x19b),'type':a176_0x4d4394(0x1ca),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=['ADMIN',a176_0x4d4394(0x198),a176_0x4d4394(0x1be)];export function isBuiltinRole(_0x346d87){return BUILTIN_ROLE_TYPES['includes'](_0x346d87);}export function assertCustomRole(_0x49ea1e,_0x4622c7){const _0x4879be=a176_0x4d4394;if(_0x49ea1e[_0x4879be(0x1af)]!==_0x4879be(0x195))throw CliErrors[_0x4879be(0x1b1)](_0x4879be(0x1d5)+_0x4622c7+_0x4879be(0x1e2)+_0x49ea1e[_0x4879be(0x1d2)]+'\x20('+_0x49ea1e[_0x4879be(0x1af)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function assertPermConfigurable(_0x17f08b){const _0x30077a=a176_0x4d4394;if(_0x17f08b[_0x30077a(0x1af)]===_0x30077a(0x198)||_0x17f08b[_0x30077a(0x1af)]===_0x30077a(0x1a5))throw CliErrors[_0x30077a(0x1b1)](_0x30077a(0x1ac)+_0x17f08b['roleName']+'\x20('+_0x17f08b[_0x30077a(0x1af)]+').',_0x30077a(0x1bc));}export function projectRole(_0x1ec8d1){const _0x3839f9=a176_0x4d4394;return{'id':_0x1ec8d1['id'],'roleName':_0x1ec8d1[_0x3839f9(0x1d2)],'roleType':_0x1ec8d1[_0x3839f9(0x1af)],'remark':_0x1ec8d1['remark'],'userCount':_0x1ec8d1[_0x3839f9(0x1a3)],'permitCount':_0x1ec8d1[_0x3839f9(0x1a1)],'builtin':isBuiltinRole(_0x1ec8d1[_0x3839f9(0x1af)])};}function a176_0x4098(_0x4f2860,_0x1a78c9){_0x4f2860=_0x4f2860-0x195;const _0x315978=a176_0x3159();let _0x4098a9=_0x315978[_0x4f2860];return _0x4098a9;}export async function resolveRoleRef(_0x12eb12,_0x42860c){const _0x44d50c=a176_0x4d4394,_0x36ffaa=_0x42860c[_0x44d50c(0x1a7)]();if(!_0x36ffaa)throw CliErrors['validation'](_0x44d50c(0x1cc),_0x44d50c(0x1e6));if(/^\d+$/['test'](_0x36ffaa))return getRoleById(_0x12eb12,Number(_0x36ffaa));const _0x33a573=await listAllAppRoles(_0x12eb12),_0x2ee2d0=_0x33a573[_0x44d50c(0x1a0)](_0x4deef4=>_0x4deef4[_0x44d50c(0x1d2)]===_0x36ffaa);if(_0x2ee2d0['length']===0x0)throw CliErrors['validation'](_0x44d50c(0x1d6)+_0x36ffaa+_0x44d50c(0x1e1)+_0x12eb12+'.',_0x44d50c(0x19a));if(_0x2ee2d0[_0x44d50c(0x1a6)]>0x1){const _0x5707ac=_0x2ee2d0[_0x44d50c(0x1ae)](_0xfa8898=>_0xfa8898['id'])[_0x44d50c(0x1ce)](',\x20');throw CliErrors[_0x44d50c(0x1b1)](_0x44d50c(0x1d6)+_0x36ffaa+_0x44d50c(0x1d3)+_0x5707ac+').',_0x44d50c(0x1c1));}return _0x2ee2d0[0x0];}export async function getRoleById(_0x48782a,_0x424cb1){const _0x3b0cd9=a176_0x4d4394,_0x5e6f8a=await getAppRole(_0x424cb1);if(!_0x5e6f8a)throw CliErrors[_0x3b0cd9(0x1b1)]('Role\x20id\x20'+_0x424cb1+_0x3b0cd9(0x1c6)+_0x48782a+'.',_0x3b0cd9(0x1b5));return _0x5e6f8a;}async function listAllAppRoles(_0x1d595b){const _0x5f0e9a=a176_0x4d4394,_0x364a52=0x64,_0x60a4d4=[];for(let _0x11e89a=0x1;;_0x11e89a+=0x1){const {items:_0x3e4269,paging:_0x21ba22}=await listAppRoles(_0x1d595b,{'currentPage':_0x11e89a,'pageSize':_0x364a52});_0x60a4d4[_0x5f0e9a(0x197)](..._0x3e4269);if(_0x3e4269[_0x5f0e9a(0x1a6)]<_0x364a52||_0x21ba22&&_0x60a4d4[_0x5f0e9a(0x1a6)]>=_0x21ba22['totalCount'])return _0x60a4d4;}}export async function resolveTenantCode(){const _0x1fd0e2=a176_0x4d4394,_0x20583e=await getSessionUserInfo(),_0x5217bb=_0x20583e?.[_0x1fd0e2(0x1d0)]?.[_0x1fd0e2(0x196)]?.[_0x1fd0e2(0x1c2)];if(!_0x5217bb)throw CliErrors[_0x1fd0e2(0x1bf)](_0x1fd0e2(0x1cf));return _0x5217bb;}function matchMember(_0x30ccd4,_0x4268b){const _0x34e9c4=a176_0x4d4394,_0x331466=_0x4268b[_0x34e9c4(0x1a7)]()['toLowerCase']();return(_0x30ccd4[_0x34e9c4(0x1c5)]??'')[_0x34e9c4(0x1e3)]()===_0x331466||(_0x30ccd4[_0x34e9c4(0x1aa)]??'')[_0x34e9c4(0x1e3)]()===_0x331466;}export async function resolveUserRef(_0x2b0933){const _0x173757=a176_0x4d4394,_0x5e21d6=_0x2b0933[_0x173757(0x1a7)]();if(!_0x5e21d6)throw CliErrors[_0x173757(0x1b1)](_0x173757(0x1cd),_0x173757(0x19e));const _0x45e2ca=await resolveTenantCode(),_0x191bbd=await getTenantMembers(_0x45e2ca);if(/^\d+$/['test'](_0x5e21d6)){const _0x4e418d=Number(_0x5e21d6),_0x5892ab=_0x191bbd[_0x173757(0x1c0)](_0x3d6401=>_0x3d6401[_0x173757(0x1ba)]===_0x4e418d);return{'userId':_0x4e418d,'username':_0x5892ab?.['username']??String(_0x4e418d),'nickname':_0x5892ab?.[_0x173757(0x1c5)],'matchedBy':'id'};}const _0x2063c6=_0x191bbd[_0x173757(0x1a0)](_0x5805b0=>matchMember(_0x5805b0,_0x5e21d6));if(_0x2063c6[_0x173757(0x1a6)]===0x0)throw CliErrors[_0x173757(0x1b1)](_0x173757(0x1c4)+_0x5e21d6+'\x22.',_0x173757(0x1a8));if(_0x2063c6[_0x173757(0x1a6)]>0x1){const _0x49b71c=_0x2063c6[_0x173757(0x1ae)](_0x15bc71=>(_0x15bc71['nickname']??_0x15bc71[_0x173757(0x1aa)]??'?')+'('+_0x15bc71[_0x173757(0x1ba)]+')')[_0x173757(0x1ce)](',\x20');throw CliErrors[_0x173757(0x1b1)](_0x173757(0x19c)+_0x5e21d6+'\x22:\x20'+_0x49b71c+'.',_0x173757(0x1b4));}const _0x503e26=_0x2063c6[0x0];return{'userId':_0x503e26[_0x173757(0x1ba)],'username':_0x503e26[_0x173757(0x1aa)]??String(_0x503e26[_0x173757(0x1ba)]),'nickname':_0x503e26[_0x173757(0x1c5)],'matchedBy':_0x173757(0x1b6)};}export const UPDATE_USER_LIST_PATH=a176_0x4d4394(0x1e7);function userIdsOf(_0x4e7a2b){const _0x3434d0=a176_0x4d4394;return(_0x4e7a2b?.['userList']??[])[_0x3434d0(0x1ae)](_0x287e17=>_0x287e17[_0x3434d0(0x1ba)]);}export function computeRoleUserMutation(_0x266292){const _0x4eb2fb=a176_0x4d4394,{operation:_0x7aade9,appCode:_0x272b35,roleUsers:_0x21a481,targetRoleId:_0x4d5ab3,user:_0xde7e41}=_0x266292,_0x80eb82=_0x21a481[_0x4eb2fb(0x1c0)](_0x3f2b5c=>_0x3f2b5c['id']===_0x4d5ab3);if(!_0x80eb82)throw CliErrors[_0x4eb2fb(0x1b1)](_0x4eb2fb(0x1df)+_0x4d5ab3+_0x4eb2fb(0x1e5),_0x4eb2fb(0x1b5));const _0x13d5a9=userIdsOf(_0x80eb82),_0x314313=[];if(_0x266292[_0x4eb2fb(0x1e4)]!==undefined&&_0x266292[_0x4eb2fb(0x1e4)]!==_0x13d5a9[_0x4eb2fb(0x1a6)])throw CliErrors['validation']('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x266292['expectUserCount']+_0x4eb2fb(0x1b3)+_0x13d5a9[_0x4eb2fb(0x1a6)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x37370f=_0x13d5a9['includes'](_0xde7e41[_0x4eb2fb(0x1ba)]);let _0x3d49aa=![];const _0x1f459f=[..._0x80eb82['userList']];if(_0x7aade9===_0x4eb2fb(0x1c8))_0x37370f?_0x314313[_0x4eb2fb(0x197)](_0x4eb2fb(0x1bd)+_0xde7e41[_0x4eb2fb(0x1ba)]+_0x4eb2fb(0x1ab)+_0x80eb82[_0x4eb2fb(0x1d2)]+_0x4eb2fb(0x1b8)):(_0x1f459f[_0x4eb2fb(0x197)]({'userId':_0xde7e41[_0x4eb2fb(0x1ba)],'username':_0xde7e41[_0x4eb2fb(0x1aa)],..._0xde7e41[_0x4eb2fb(0x1c5)]?{'nickname':_0xde7e41['nickname']}:{}}),_0x3d49aa=!![]);else{if(!_0x37370f)_0x314313[_0x4eb2fb(0x197)]('User\x20'+_0xde7e41['userId']+_0x4eb2fb(0x1ad)+_0x80eb82[_0x4eb2fb(0x1d2)]+_0x4eb2fb(0x1b8));else{const _0x44f9fd=_0x1f459f[_0x4eb2fb(0x1dc)](_0x1920d3=>_0x1920d3['userId']===_0xde7e41[_0x4eb2fb(0x1ba)]);if(_0x44f9fd>=0x0)_0x1f459f[_0x4eb2fb(0x1d4)](_0x44f9fd,0x1);_0x3d49aa=!![];}}const _0xdd7a94=_0x21a481[_0x4eb2fb(0x1ae)](_0x445a0a=>_0x445a0a['id']===_0x4d5ab3?{..._0x445a0a,'userList':_0x1f459f}:_0x445a0a),_0x155d62=_0x1f459f[_0x4eb2fb(0x1ae)](_0x4fca0f=>_0x4fca0f[_0x4eb2fb(0x1ba)]),_0x480ba1={'operation':_0x7aade9,'selector':{'appCode':_0x272b35,'roleId':_0x4d5ab3,'roleName':_0x80eb82[_0x4eb2fb(0x1d2)],'userId':_0xde7e41[_0x4eb2fb(0x1ba)]},'before':{'userIds':_0x13d5a9},'after':{'userIds':_0x155d62},'dryRun':_0x266292[_0x4eb2fb(0x1db)],'backend':{'method':_0x4eb2fb(0x1e0),'path':UPDATE_USER_LIST_PATH},'warnings':_0x314313};return{'roleList':_0xdd7a94,'mutation':_0x480ba1,'changed':_0x3d49aa};}export async function loadRoleUsers(_0x461e9f){return listRoleUsers(_0x461e9f);}export function readRoleRef(_0x3a0c33){const _0x1d186f=a176_0x4d4394,_0x4e7631=_0x3a0c33[_0x1d186f(0x1cb)](_0x1d186f(0x1dd))[_0x1d186f(0x1a7)]();if(!_0x4e7631)throw CliErrors[_0x1d186f(0x1a2)](_0x1d186f(0x1dd),_0x1d186f(0x1e6));return _0x4e7631;}export async function prepareUserMutation(_0x2e6e63,_0x23a66b,_0x207b62){const _0x4c1950=a176_0x4d4394,_0x5f4c37=readRoleRef(_0x2e6e63),_0x156d97=_0x2e6e63[_0x4c1950(0x1cb)](_0x4c1950(0x1d0))[_0x4c1950(0x1a7)]();if(!_0x156d97)throw CliErrors[_0x4c1950(0x1a2)]('user',_0x4c1950(0x19e));const _0x4adacb=_0x2e6e63['flag']('expect-user-count'),_0x38879e=_0x4adacb===undefined||_0x4adacb===null?undefined:Number(_0x4adacb),_0x8f1877=await resolveRoleRef(_0x2e6e63[_0x4c1950(0x19d)],_0x5f4c37),_0xe23c48=await resolveUserRef(_0x156d97),_0x40655a=await loadRoleUsers(_0x2e6e63[_0x4c1950(0x19d)]);return computeRoleUserMutation({'operation':_0x23a66b,'appCode':_0x2e6e63[_0x4c1950(0x19d)],'roleUsers':_0x40655a,'targetRoleId':_0x8f1877['id'],'user':{'userId':_0xe23c48[_0x4c1950(0x1ba)],'username':_0xe23c48['username'],'nickname':_0xe23c48[_0x4c1950(0x1c5)]},'dryRun':_0x207b62,..._0x38879e!==undefined?{'expectUserCount':_0x38879e}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a177_0x3270fc=a177_0x35aa;function a177_0x8a44(){const _0x1d9fcb=['--name\x20cannot\x20be\x20empty.','appCode','2216995VdhvAW','120yaEbGk','3239384kErFsO','1EOUBlh','Nothing\x20to\x20update.','2993730coWyoX','\x20(id=','84172lrCsvR','287756diHpQd','validation','string','9hULaDt','POST','flag','remark','update','num','length','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','roleName','219GXYvKR','1096172jOLnwS','write','913132PJMBFk','name'];a177_0x8a44=function(){return _0x1d9fcb;};return a177_0x8a44();}(function(_0x4afe9b,_0xffcee9){const _0x3f7a0c=a177_0x35aa,_0x2f4c7b=_0x4afe9b();while(!![]){try{const _0x5a072a=parseInt(_0x3f7a0c(0x115))/0x1*(-parseInt(_0x3f7a0c(0xff))/0x2)+-parseInt(_0x3f7a0c(0x10b))/0x3*(-parseInt(_0x3f7a0c(0x119))/0x4)+parseInt(_0x3f7a0c(0x112))/0x5+-parseInt(_0x3f7a0c(0x117))/0x6+parseInt(_0x3f7a0c(0x10c))/0x7+-parseInt(_0x3f7a0c(0x114))/0x8*(-parseInt(_0x3f7a0c(0x102))/0x9)+-parseInt(_0x3f7a0c(0x113))/0xa*(parseInt(_0x3f7a0c(0x10e))/0xb);if(_0x5a072a===_0xffcee9)break;else _0x2f4c7b['push'](_0x2f4c7b['shift']());}catch(_0x1d6d00){_0x2f4c7b['push'](_0x2f4c7b['shift']());}}}(a177_0x8a44,0xdc3c0));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a177_0x35aa(_0x5d7ac5,_0x37cfad){_0x5d7ac5=_0x5d7ac5-0xff;const _0x8a443e=a177_0x8a44();let _0x35aa96=_0x8a443e[_0x5d7ac5];return _0x35aa96;}import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x1be33f){const _0xeff0c0=a177_0x35aa,_0x11e073=_0x1be33f[_0xeff0c0(0x104)](_0xeff0c0(0x10f)),_0xac00a7=_0x1be33f[_0xeff0c0(0x104)](_0xeff0c0(0x105)),_0x5a7876={};if(_0x11e073!==undefined&&_0x11e073!==null){const _0x42f765=String(_0x11e073)['trim']();if(!_0x42f765)throw CliErrors[_0xeff0c0(0x100)](_0xeff0c0(0x110));if(_0x42f765[_0xeff0c0(0x108)]>0x40)throw CliErrors[_0xeff0c0(0x100)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x5a7876[_0xeff0c0(0x10a)]=_0x42f765;}_0xac00a7!==undefined&&_0xac00a7!==null&&(_0x5a7876[_0xeff0c0(0x105)]=String(_0xac00a7));if(_0x5a7876[_0xeff0c0(0x10a)]===undefined&&_0x5a7876['remark']===undefined)throw CliErrors['validation'](_0xeff0c0(0x116),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x5a7876;}export const roleUpdate={'service':'role','command':a177_0x3270fc(0x106),'description':a177_0x3270fc(0x109),'risk':a177_0x3270fc(0x10d),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a177_0x3270fc(0x101),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x55664f){readPatch(_0x55664f);},async 'dryRun'(_0x10ab80){const _0x4e370d=a177_0x3270fc,_0x419f65=_0x10ab80[_0x4e370d(0x107)]('id'),_0x5817f4=readPatch(_0x10ab80),_0x4e3655=await getRoleById(_0x10ab80[_0x4e370d(0x111)],_0x419f65);return assertCustomRole(_0x4e3655,_0x4e370d(0x106)),asDryRunResult({'operation':_0x4e370d(0x106),'selector':{'appCode':_0x10ab80[_0x4e370d(0x111)],'roleId':_0x419f65,'roleName':_0x4e3655[_0x4e370d(0x10a)]},'before':projectRole(_0x4e3655),'after':projectRole({..._0x4e3655,..._0x5817f4[_0x4e370d(0x10a)]!==undefined?{'roleName':_0x5817f4[_0x4e370d(0x10a)]}:{},..._0x5817f4[_0x4e370d(0x105)]!==undefined?{'remark':_0x5817f4['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x4e370d(0x103),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x15caa7){const _0x3dc8e2=a177_0x3270fc,_0x2d61fd=_0x15caa7[_0x3dc8e2(0x107)]('id'),_0x5a8aa2=readPatch(_0x15caa7),_0x903a00=await getRoleById(_0x15caa7[_0x3dc8e2(0x111)],_0x2d61fd);assertCustomRole(_0x903a00,'update'),await updateAppRole({'id':_0x2d61fd,'appCode':_0x15caa7[_0x3dc8e2(0x111)],..._0x5a8aa2[_0x3dc8e2(0x10a)]!==undefined?{'roleName':_0x5a8aa2[_0x3dc8e2(0x10a)]}:{},..._0x5a8aa2[_0x3dc8e2(0x105)]!==undefined?{'remark':_0x5a8aa2[_0x3dc8e2(0x105)]}:{}});const _0x5028f0=await getRoleById(_0x15caa7[_0x3dc8e2(0x111)],_0x2d61fd);return{'ok':!![],'data':{'operation':_0x3dc8e2(0x106),'selector':{'appCode':_0x15caa7[_0x3dc8e2(0x111)],'roleId':_0x2d61fd,'roleName':_0x5028f0[_0x3dc8e2(0x10a)]},'before':projectRole(_0x903a00),'after':projectRole(_0x5028f0),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':'Updated\x20role\x20'+_0x5028f0[_0x3dc8e2(0x10a)]+_0x3dc8e2(0x118)+_0x2d61fd+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a178_0x2ca72f=a178_0x2ae8;(function(_0x340e73,_0x4e9f47){const _0x291f2b=a178_0x2ae8,_0x10faeb=_0x340e73();while(!![]){try{const _0x28da5c=-parseInt(_0x291f2b(0x1e9))/0x1*(parseInt(_0x291f2b(0x1f0))/0x2)+-parseInt(_0x291f2b(0x1f1))/0x3*(-parseInt(_0x291f2b(0x1ed))/0x4)+-parseInt(_0x291f2b(0x1f5))/0x5+-parseInt(_0x291f2b(0x1f3))/0x6+parseInt(_0x291f2b(0x1e1))/0x7*(parseInt(_0x291f2b(0x1e4))/0x8)+-parseInt(_0x291f2b(0x1e2))/0x9*(-parseInt(_0x291f2b(0x1ec))/0xa)+parseInt(_0x291f2b(0x1e6))/0xb;if(_0x28da5c===_0x4e9f47)break;else _0x10faeb['push'](_0x10faeb['shift']());}catch(_0x3d6204){_0x10faeb['push'](_0x10faeb['shift']());}}}(a178_0x291f,0x4771f));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a178_0x291f(){const _0x1bcea8=['POST','2404098kbuWvk','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','2800625DBBVwt','1330QHeCfi','9iXqKCV','selector','2008OLzjKV','high-risk-write','14461095TZHTcY','\x20to\x20role\x20','role','15983xpXcJm','roleName','user-add','1199230jvEogQ','810920kuKKfb','appCode','\x20already\x20in\x20role\x20','54suLYHf','3AXSKQh'];a178_0x291f=function(){return _0x1bcea8;};return a178_0x291f();}import{asDryRunResult}from'../../commands/common/dry-run.js';function a178_0x2ae8(_0x534b89,_0xbeadb5){_0x534b89=_0x534b89-0x1e1;const _0x291f1f=a178_0x291f();let _0x2ae86f=_0x291f1f[_0x534b89];return _0x2ae86f;}import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a178_0x2ca72f(0x1e8),'command':'user-add','description':a178_0x2ca72f(0x1f4),'risk':a178_0x2ca72f(0x1e5),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xee6fa0){const _0x29654c=a178_0x2ca72f,{mutation:_0x1c4773}=await prepareUserMutation(_0xee6fa0,_0x29654c(0x1eb),!![]);return asDryRunResult(_0x1c4773,{'method':_0x29654c(0x1f2),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x17d922){const _0x41978f=a178_0x2ca72f,{roleList:_0x1cbef1,mutation:_0x59f998,changed:_0x3a36fc}=await prepareUserMutation(_0x17d922,_0x41978f(0x1eb),![]);return _0x3a36fc&&await updateRoleUsers(_0x17d922[_0x41978f(0x1ee)],_0x1cbef1),{'ok':!![],'data':_0x59f998,'message':_0x3a36fc?'Added\x20user\x20'+_0x59f998[_0x41978f(0x1e3)]['userId']+_0x41978f(0x1e7)+_0x59f998[_0x41978f(0x1e3)]['roleName']:'No\x20change:\x20user\x20'+_0x59f998[_0x41978f(0x1e3)]['userId']+_0x41978f(0x1ef)+_0x59f998[_0x41978f(0x1e3)][_0x41978f(0x1ea)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a179_0x4b82d0=a179_0x3835;(function(_0x13b659,_0x286a20){const _0x2cbd46=a179_0x3835,_0x288624=_0x13b659();while(!![]){try{const _0xf2027a=parseInt(_0x2cbd46(0x1c1))/0x1*(parseInt(_0x2cbd46(0x1bf))/0x2)+parseInt(_0x2cbd46(0x1b1))/0x3+parseInt(_0x2cbd46(0x1b0))/0x4+-parseInt(_0x2cbd46(0x1b5))/0x5+-parseInt(_0x2cbd46(0x1ba))/0x6+-parseInt(_0x2cbd46(0x1b6))/0x7*(-parseInt(_0x2cbd46(0x1b9))/0x8)+-parseInt(_0x2cbd46(0x1bc))/0x9;if(_0xf2027a===_0x286a20)break;else _0x288624['push'](_0x288624['shift']());}catch(_0x2a307e){_0x288624['push'](_0x288624['shift']());}}}(a179_0x30e7,0x7a8fc));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a179_0x3835(_0x32cd6e,_0x1d4bae){_0x32cd6e=_0x32cd6e-0x1af;const _0x30e7d8=a179_0x30e7();let _0x3835d9=_0x30e7d8[_0x32cd6e];return _0x3835d9;}function a179_0x30e7(){const _0x30e0c4=['15549948liwayq','POST','roleName','2cfrYzG','role','557477LTNdxe','No\x20change:\x20user\x20','appCode','high-risk-write','3471164VCuNRB','2207373lLCabx','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','selector','\x20from\x20role\x20','1338050bJYWyj','168fdhbfy','Removed\x20user\x20','userId','166456Vknrsi','978198RhCxiq','user-remove'];a179_0x30e7=function(){return _0x30e0c4;};return a179_0x30e7();}import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a179_0x4b82d0(0x1c0),'command':a179_0x4b82d0(0x1bb),'description':a179_0x4b82d0(0x1b2),'risk':a179_0x4b82d0(0x1af),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x495e85){const _0x535414=a179_0x4b82d0,{mutation:_0x44ab9c}=await prepareUserMutation(_0x495e85,_0x535414(0x1bb),!![]);return asDryRunResult(_0x44ab9c,{'method':_0x535414(0x1bd),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x2a7a9c){const _0x5ceb8e=a179_0x4b82d0,{roleList:_0x342155,mutation:_0x3844ad,changed:_0x2de083}=await prepareUserMutation(_0x2a7a9c,'user-remove',![]);return _0x2de083&&await updateRoleUsers(_0x2a7a9c[_0x5ceb8e(0x1c3)],_0x342155),{'ok':!![],'data':_0x3844ad,'message':_0x2de083?_0x5ceb8e(0x1b7)+_0x3844ad[_0x5ceb8e(0x1b3)][_0x5ceb8e(0x1b8)]+_0x5ceb8e(0x1b4)+_0x3844ad[_0x5ceb8e(0x1b3)][_0x5ceb8e(0x1be)]:_0x5ceb8e(0x1c2)+_0x3844ad[_0x5ceb8e(0x1b3)][_0x5ceb8e(0x1b8)]+'\x20not\x20in\x20role\x20'+_0x3844ad[_0x5ceb8e(0x1b3)][_0x5ceb8e(0x1be)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a180_0x470140=a180_0xafab;(function(_0xad8f8,_0x430113){const _0x5c24eb=a180_0xafab,_0x348b28=_0xad8f8();while(!![]){try{const _0x36bc86=-parseInt(_0x5c24eb(0x192))/0x1*(-parseInt(_0x5c24eb(0x194))/0x2)+parseInt(_0x5c24eb(0x19b))/0x3+parseInt(_0x5c24eb(0x196))/0x4*(-parseInt(_0x5c24eb(0x189))/0x5)+parseInt(_0x5c24eb(0x18d))/0x6*(-parseInt(_0x5c24eb(0x19a))/0x7)+parseInt(_0x5c24eb(0x191))/0x8*(-parseInt(_0x5c24eb(0x188))/0x9)+-parseInt(_0x5c24eb(0x197))/0xa+parseInt(_0x5c24eb(0x19f))/0xb;if(_0x36bc86===_0x430113)break;else _0x348b28['push'](_0x348b28['shift']());}catch(_0x42478d){_0x348b28['push'](_0x348b28['shift']());}}}(a180_0x3cb1,0x93e68));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a180_0xafab(_0x299117,_0x2dfa10){_0x299117=_0x299117-0x188;const _0x3cb135=a180_0x3cb1();let _0xafab3=_0x3cb135[_0x299117];return _0xafab3;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a180_0x470140(0x19d),'description':a180_0x470140(0x18b),'risk':a180_0x470140(0x18e),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x53c23d){const _0x54a8c7=a180_0x470140;if(!_0x53c23d[_0x54a8c7(0x18f)](_0x54a8c7(0x193))[_0x54a8c7(0x195)]())throw CliErrors[_0x54a8c7(0x18c)](_0x54a8c7(0x193),_0x54a8c7(0x199));},async 'execute'(_0x4254ae){const _0x53627a=a180_0x470140,_0x6b4757=_0x4254ae[_0x53627a(0x18f)]('name')[_0x53627a(0x195)](),_0x45bbfc=await resolveUserRef(_0x6b4757);return{'ok':!![],'data':{'user':{'userId':_0x45bbfc[_0x53627a(0x19e)],'username':_0x45bbfc[_0x53627a(0x198)],'nickname':_0x45bbfc[_0x53627a(0x19c)],'matchedBy':_0x45bbfc[_0x53627a(0x18a)]}},'message':_0x53627a(0x190)+_0x6b4757+'\x22\x20→\x20userId\x20'+_0x45bbfc['userId']};}};function a180_0x3cb1(){const _0xe1e100=['flagMissing','4110222wBnprf','read','str','Resolved\x20\x22','136QAMhxE','10615sJozzg','name','2VIWZUR','trim','8508OFXnis','10495990EPcInG','username','Pass\x20--name\x20<nickname|username>.','7YLddtH','1550703kaZwuF','nickname','user-resolve','userId','27759248YKTtiy','157770AIOZGq','970uPzOWg','matchedBy','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)'];a180_0x3cb1=function(){return _0xe1e100;};return a180_0x3cb1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a181_0x3ebf9b=a181_0x2aa4;(function(_0x3d4ec5,_0x2464b2){const _0x119d50=a181_0x2aa4,_0x19f32b=_0x3d4ec5();while(!![]){try{const _0x5a179c=parseInt(_0x119d50(0x141))/0x1*(-parseInt(_0x119d50(0x178))/0x2)+-parseInt(_0x119d50(0x16b))/0x3+-parseInt(_0x119d50(0x13d))/0x4*(parseInt(_0x119d50(0x171))/0x5)+-parseInt(_0x119d50(0x16e))/0x6+-parseInt(_0x119d50(0x15c))/0x7*(-parseInt(_0x119d50(0x13a))/0x8)+parseInt(_0x119d50(0x147))/0x9*(-parseInt(_0x119d50(0x15a))/0xa)+-parseInt(_0x119d50(0x164))/0xb*(-parseInt(_0x119d50(0x157))/0xc);if(_0x5a179c===_0x2464b2)break;else _0x19f32b['push'](_0x19f32b['shift']());}catch(_0x3fe8b0){_0x19f32b['push'](_0x19f32b['shift']());}}}(a181_0x4bc8,0xa91e2));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';function a181_0x4bc8(){const _0x56db61=['args','45573AspHvq','\x20run\x20preview\x20--watch','Available:\x20','belowMinimum','\x20run\x20start','vite','boolean','3294654NdBLHb','pnpm-lock.yaml','all','5834550CpeCxT','run','Enable\x20watch\x20mode\x20for\x20preview','105hDDeCO','join','parse','package.json','\x20run\x20build','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20run\x20preview','2276698WNWOKr','--watch','320408jReOYt','watch','\x0a\x20\x20Available\x20scripts:\x0a','261024OiIAkx','\x20run\x20<script>\x0a','error','\x0a\x20\x20Usage:\x20','1wZoHfa','start','close','high-risk-write','preview','build','267147fErfUW','inherit','\x22\x20not\x20found\x20in\x20package.json.','bun','node_modules','log','keys','validation','dev','\x20\x20\x20\x20','pnpm','npm','Script\x20name\x20defined\x20in\x20package.json','\x20exited\x20with\x20code\x20','.bin','(none)','14304eJwEZe','script','utf-8','90uYimpj','bool','105hBGlAV','scripts','No\x20package.json\x20found\x20in\x20current\x20directory.','needsUpgrade','\x20run\x20','push','has'];a181_0x4bc8=function(){return _0x56db61;};return a181_0x4bc8();}import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';function a181_0x2aa4(_0x3458cf,_0x521966){_0x3458cf=_0x3458cf-0x139;const _0x4bc86b=a181_0x4bc8();let _0x2aa4ef=_0x4bc86b[_0x3458cf];return _0x2aa4ef;}import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a181_0x3ebf9b(0x142),a181_0x3ebf9b(0x14f)]);function readPackageScripts(_0x47f415){const _0x4bb84a=a181_0x3ebf9b,_0x381266=resolve(_0x47f415,_0x4bb84a(0x174));if(!existsSync(_0x381266))return null;try{const _0x4d6ca7=JSON[_0x4bb84a(0x173)](readFileSync(_0x381266,_0x4bb84a(0x159)));return _0x4d6ca7[_0x4bb84a(0x15d)]??{};}catch{return null;}}function detectPackageManager(_0x152870){const _0x32db3c=a181_0x3ebf9b;if(existsSync(resolve(_0x152870,'bun.lockb'))||existsSync(resolve(_0x152870,'bun.lock')))return _0x32db3c(0x14a);if(existsSync(resolve(_0x152870,_0x32db3c(0x16c))))return _0x32db3c(0x151);if(existsSync(resolve(_0x152870,'yarn.lock')))return'yarn';return _0x32db3c(0x152);}async function versionCheck(_0xf6b0){const _0x5cfc4d=a181_0x3ebf9b,_0x1e3e48=await checkCliVersion();(_0x1e3e48[_0x5cfc4d(0x15f)]||_0x1e3e48[_0x5cfc4d(0x167)])&&(printCliUpgradeWarning(_0x1e3e48),assertCliVersionSupported(_0x1e3e48));const _0xba305b=await checkSdkVersion(_0xf6b0);if(_0xba305b[_0x5cfc4d(0x15f)])printSdkUpgradeWarning(_0xba305b);}function spawnScript(_0x137e81,_0x20efc1,_0x23e39a,_0x3cb56c){return new Promise((_0x12648f,_0x5d2b9c)=>{const _0x12177b=a181_0x2aa4,_0x3bc8a1=[_0x12177b(0x16f),_0x20efc1,..._0x23e39a],_0x4a1264=spawn(_0x137e81,_0x3bc8a1,{'cwd':_0x3cb56c,'stdio':_0x12177b(0x148),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3cb56c,_0x12177b(0x14b),_0x12177b(0x155))+delimiter+process.env.PATH}});_0x4a1264['on']('close',_0x103df8=>{const _0x3e95eb=_0x12177b;if(_0x103df8===0x0||_0x103df8===null)_0x12648f();else _0x5d2b9c(new Error(_0x137e81+_0x3e95eb(0x160)+_0x20efc1+_0x3e95eb(0x154)+_0x103df8));}),_0x4a1264['on'](_0x12177b(0x13f),_0x5d2b9c);});}function spawnViteBuildWatch(_0xd709f5){return new Promise((_0x5e08ab,_0x3af811)=>{const _0x505a10=a181_0x2aa4,_0x178e1d=spawn(_0x505a10(0x169),[_0x505a10(0x146),_0x505a10(0x139)],{'cwd':_0xd709f5,'stdio':_0x505a10(0x148),'shell':!![],'env':{...process.env,'PATH':''+join(_0xd709f5,_0x505a10(0x14b),'.bin')+delimiter+process.env.PATH}});_0x178e1d['on'](_0x505a10(0x143),_0x54bd5d=>{const _0x19cba9=_0x505a10;if(_0x54bd5d===0x0||_0x54bd5d===null)_0x5e08ab();else _0x3af811(new Error(_0x19cba9(0x176)+_0x54bd5d));}),_0x178e1d['on'](_0x505a10(0x13f),_0x3af811);});}function spawnVitePreview(_0x1c55f5){return new Promise((_0x9e5ae8,_0x54b982)=>{const _0x57aba2=a181_0x2aa4,_0x1c13b9=spawn(_0x57aba2(0x169),[_0x57aba2(0x145)],{'cwd':_0x1c55f5,'stdio':_0x57aba2(0x148),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1c55f5,'node_modules',_0x57aba2(0x155))+delimiter+process.env.PATH}});_0x1c13b9['on'](_0x57aba2(0x143),_0x53e12d=>{if(_0x53e12d===0x0||_0x53e12d===null)_0x9e5ae8();else _0x54b982(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x53e12d));}),_0x1c13b9['on'](_0x57aba2(0x13f),_0x54b982);});}const runFlags=[{'name':a181_0x3ebf9b(0x13b),'type':a181_0x3ebf9b(0x16a),'description':a181_0x3ebf9b(0x170),'default':![]}];export const runDefinition={'service':a181_0x3ebf9b(0x16f),'command':a181_0x3ebf9b(0x16f),'description':'Run\x20a\x20package.json\x20script','risk':a181_0x3ebf9b(0x144),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a181_0x3ebf9b(0x158),'description':a181_0x3ebf9b(0x153),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x13c50d=a181_0x3ebf9b,_0x286431=[];return _0x286431[_0x13c50d(0x161)]('\x20\x20EXAMPLES'),_0x286431['push'](_0x13c50d(0x150)+CLI_BIN_NAME+_0x13c50d(0x168)),_0x286431[_0x13c50d(0x161)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x13c50d(0x175)),_0x286431[_0x13c50d(0x161)](_0x13c50d(0x150)+CLI_BIN_NAME+_0x13c50d(0x177)),_0x286431[_0x13c50d(0x161)](_0x13c50d(0x150)+CLI_BIN_NAME+_0x13c50d(0x165)),_0x286431[_0x13c50d(0x172)]('\x0a');},async 'execute'(_0x5e09fd){const _0x92c5bb=a181_0x3ebf9b,_0x22cec0=process['cwd'](),_0x21c9be=_0x5e09fd[_0x92c5bb(0x163)][0x0],_0x216f90=_0x5e09fd[_0x92c5bb(0x163)]['slice'](0x1),_0xc9935b=readPackageScripts(_0x22cec0);if(!_0xc9935b)throw CliErrors[_0x92c5bb(0x14e)](_0x92c5bb(0x15e));if(!_0x21c9be){const _0x13ad64=Object[_0x92c5bb(0x14d)](_0xc9935b);if(_0x13ad64['length']===0x0)console[_0x92c5bb(0x14c)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console['log'](_0x92c5bb(0x13c));for(const _0x82e96a of _0x13ad64){console[_0x92c5bb(0x14c)](_0x92c5bb(0x150)+_0x82e96a);}console[_0x92c5bb(0x14c)](_0x92c5bb(0x140)+CLI_BIN_NAME+_0x92c5bb(0x13e));}return{'ok':!![]};}if(!_0xc9935b[_0x21c9be])throw CliErrors[_0x92c5bb(0x14e)]('Script\x20\x22'+_0x21c9be+_0x92c5bb(0x149),_0x92c5bb(0x166)+(Object[_0x92c5bb(0x14d)](_0xc9935b)[_0x92c5bb(0x172)](',\x20')||_0x92c5bb(0x156)));const _0x2725a2=detectPackageManager(_0x22cec0);VERSION_CHECK_SCRIPTS[_0x92c5bb(0x162)](_0x21c9be)&&await versionCheck(_0x22cec0);if(_0x21c9be==='preview'&&_0x5e09fd[_0x92c5bb(0x15b)]('watch'))return await Promise[_0x92c5bb(0x16d)]([spawnViteBuildWatch(_0x22cec0),spawnVitePreview(_0x22cec0)]),{'ok':!![]};return await spawnScript(_0x2725a2,_0x21c9be,_0x216f90,_0x22cec0),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a182_0x3d4308=a182_0x2161;(function(_0x24ba7a,_0x667bdc){const _0x1ad8fc=a182_0x2161,_0x484bf8=_0x24ba7a();while(!![]){try{const _0x203013=parseInt(_0x1ad8fc(0x1e3))/0x1*(parseInt(_0x1ad8fc(0x1d7))/0x2)+parseInt(_0x1ad8fc(0x1de))/0x3*(-parseInt(_0x1ad8fc(0x1e2))/0x4)+parseInt(_0x1ad8fc(0x1d6))/0x5+parseInt(_0x1ad8fc(0x1d8))/0x6+parseInt(_0x1ad8fc(0x1dc))/0x7+parseInt(_0x1ad8fc(0x1e4))/0x8*(-parseInt(_0x1ad8fc(0x1dd))/0x9)+parseInt(_0x1ad8fc(0x1db))/0xa*(-parseInt(_0x1ad8fc(0x1da))/0xb);if(_0x203013===_0x667bdc)break;else _0x484bf8['push'](_0x484bf8['shift']());}catch(_0x8a3cfe){_0x484bf8['push'](_0x484bf8['shift']());}}}(a182_0x1599,0x89366));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x360333){const _0x4534ad=await buildSchemaPayload();return{'ok':!![],'data':_0x4534ad};}function a182_0x2161(_0x5a54e0,_0x5b5baa){_0x5a54e0=_0x5a54e0-0x1d5;const _0x1599d4=a182_0x1599();let _0x216187=_0x1599d4[_0x5a54e0];return _0x216187;}export const schemaDefinition={'service':a182_0x3d4308(0x1e0),'command':a182_0x3d4308(0x1d5),'description':a182_0x3d4308(0x1e1),'risk':a182_0x3d4308(0x1df),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a182_0x3d4308(0x1d9),'flags':[],'execute':execute};function a182_0x1599(){const _0x13ce09=['487614vLsrLq','read','schema','Export\x20machine-readable\x20command\x20schema\x20(JSON)','12azgOVa','6397Pwfbrj','40GHLgdL','export','3785340nFcADg','82mSLTjj','3266184vqtzQd','json','9180886khFGXv','10UuXdlg','6039131dClTwx','975924DWukau'];a182_0x1599=function(){return _0x13ce09;};return a182_0x1599();}
|