@lovrabet/rabetbase-cli 2.4.3 → 2.4.4-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-refresh-start.d.ts +2 -0
- package/lib/commands/db/diff-refresh-start.js +1 -0
- package/lib/commands/db/diff-refresh-status.d.ts +2 -0
- package/lib/commands/db/diff-refresh-status.js +1 -0
- 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-create.d.ts +2 -0
- package/lib/commands/notification/config-create.js +1 -0
- package/lib/commands/notification/config-delete.d.ts +2 -0
- package/lib/commands/notification/config-delete.js +1 -0
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.d.ts +2 -0
- package/lib/commands/notification/config-update.js +1 -0
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.d.ts +97 -0
- package/lib/commands/notification/shared.js +1 -0
- 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.d.ts +1 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.d.ts +11 -0
- package/lib/commands/project/create/materialize-project-template.js +1 -0
- package/lib/commands/project/create/project-name.d.ts +2 -0
- package/lib/commands/project/create/project-name.js +1 -0
- package/lib/commands/project/create/project-template-archive.d.ts +6 -0
- package/lib/commands/project/create/project-template-archive.js +1 -0
- package/lib/commands/project/create/project-template-path.d.ts +1 -3
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +2 -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.d.ts +2 -0
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +29 -2
- 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.d.ts +13 -0
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/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 +9 -4
- package/skills/rabetbase/SKILL.md +33 -22
- package/skills/rabetbase/guides/backend-function.md +5 -3
- package/skills/rabetbase/guides/bff-creation-workflow.md +2 -2
- package/skills/rabetbase/guides/conflict-detection.md +2 -2
- package/skills/rabetbase/guides/database-connection-workflow.md +39 -5
- package/skills/rabetbase/guides/react-custom-page-workflow.md +16 -4
- package/skills/rabetbase/guides/sql-creation-workflow.md +4 -2
- package/skills/rabetbase/guides/sql-mybatis.md +2 -2
- package/skills/rabetbase/knowledge/page-schema/YtPage.md +3 -37
- package/skills/rabetbase/knowledge/react-page/generation-standards.md +14 -3
- package/skills/rabetbase/references/rabetbase-app-config.md +2 -2
- package/skills/rabetbase/references/rabetbase-bff-push.md +4 -5
- package/skills/rabetbase/references/rabetbase-bff-save.md +3 -3
- package/skills/rabetbase/references/rabetbase-config.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-detail.md +3 -0
- package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +53 -0
- package/skills/rabetbase/references/rabetbase-db-diff.md +40 -21
- package/skills/rabetbase/references/rabetbase-db-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-kb.md +5 -3
- package/skills/rabetbase/references/rabetbase-menu-asset-update.md +9 -10
- package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +1 -3
- package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +2 -3
- package/skills/rabetbase/references/rabetbase-notification-config-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-notification-config-mutations.md +56 -0
- package/skills/rabetbase/references/rabetbase-page-react-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-react-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-react-publish.md +2 -2
- package/skills/rabetbase/references/rabetbase-project-create.md +3 -0
- package/skills/rabetbase/references/rabetbase-run.md +1 -1
- package/skills/rabetbase/references/rabetbase-sql-create.md +1 -1
- package/skills/rabetbase/references/rabetbase-sql-push.md +3 -4
- package/skills/rabetbase/references/rabetbase-user-account.md +0 -1
- package/skills/rabetbase.manifest.json +5 -5
- package/templates/README.md +14 -2
- package/lib/commands/project/create/non-interactive.d.ts +0 -9
- package/lib/commands/project/create/non-interactive.js +0 -1
- package/lib/utils/copy-directory.d.ts +0 -1
- package/lib/utils/copy-directory.js +0 -1
- package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +0 -291
- package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +0 -223
- package/templates/projects/sub-app-react-demo/.prettierrc +0 -1
- package/templates/projects/sub-app-react-demo/CHANGELOG.md +0 -67
- package/templates/projects/sub-app-react-demo/README.md +0 -246
- package/templates/projects/sub-app-react-demo/docs/quick-start.md +0 -245
- package/templates/projects/sub-app-react-demo/index.html +0 -27
- package/templates/projects/sub-app-react-demo/package.json +0 -34
- package/templates/projects/sub-app-react-demo/public/logo.svg +0 -1
- package/templates/projects/sub-app-react-demo/public/vite.svg +0 -1
- package/templates/projects/sub-app-react-demo/src/api/api.ts +0 -26
- package/templates/projects/sub-app-react-demo/src/api/client.ts +0 -32
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +0 -28
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +0 -55
- package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +0 -308
- package/templates/projects/sub-app-react-demo/src/main.tsx +0 -52
- package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +0 -570
- package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +0 -531
- package/templates/projects/sub-app-react-demo/src/pages/index.module.css +0 -500
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +0 -641
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +0 -536
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +0 -295
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +0 -242
- package/templates/projects/sub-app-react-demo/src/router/index.tsx +0 -30
- package/templates/projects/sub-app-react-demo/src/style.css +0 -108
- package/templates/projects/sub-app-react-demo/src/utils/api.ts +0 -12
- package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +0 -2
- package/templates/projects/sub-app-react-demo/tsconfig.json +0 -26
- package/templates/projects/sub-app-react-demo/vite.config.ts +0 -111
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a173_0x4cb0(_0x23c0ea,_0x20d20b){_0x23c0ea=_0x23c0ea-0xd1;const _0x3e66f8=a173_0x3e66();let _0x4cb0a9=_0x3e66f8[_0x23c0ea];return _0x4cb0a9;}(function(_0x33c1d9,_0x41b7a3){const _0x170a5b=a173_0x4cb0,_0x4bb90e=_0x33c1d9();while(!![]){try{const _0xddd58b=parseInt(_0x170a5b(0xd7))/0x1+-parseInt(_0x170a5b(0xdc))/0x2+-parseInt(_0x170a5b(0xd1))/0x3*(-parseInt(_0x170a5b(0xe4))/0x4)+-parseInt(_0x170a5b(0xe0))/0x5+parseInt(_0x170a5b(0xdb))/0x6*(parseInt(_0x170a5b(0xd9))/0x7)+parseInt(_0x170a5b(0xe5))/0x8*(parseInt(_0x170a5b(0xe3))/0x9)+parseInt(_0x170a5b(0xde))/0xa*(-parseInt(_0x170a5b(0xd3))/0xb);if(_0xddd58b===_0x41b7a3)break;else _0x4bb90e['push'](_0x4bb90e['shift']());}catch(_0x5b62b6){_0x4bb90e['push'](_0x4bb90e['shift']());}}}(a173_0x3e66,0x5bbf2));import a173_0x24b9db from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';export async function copyProjectTemplate(_0x13e27d,_0x2d25c9){const _0x510628=a173_0x4cb0,_0x1addcd=Date['now'](),_0x4dd55a=a173_0x24b9db[_0x510628(0xd4)](process[_0x510628(0xda)](),_0x13e27d);try{logger[_0x510628(0xdf)](_0x510628(0xdd),_0x510628(0xd8),{'projectCode':_0x13e27d});const _0x1b84a5=await materializeProjectTemplate(_0x4dd55a,_0x2d25c9),_0x9e0a0d=Date[_0x510628(0xe2)]()-_0x1addcd;logger['success'](_0x510628(0xdd),_0x510628(0xd2),_0x9e0a0d,{'projectCode':_0x13e27d,'templateSource':_0x1b84a5[_0x510628(0xe1)],'templateVersion':_0x1b84a5['version']});}catch(_0x1ae717){const _0x1c2f30=Date[_0x510628(0xe2)]()-_0x1addcd;logger[_0x510628(0xe6)](_0x510628(0xdd),_0x510628(0xd6),{'projectCode':_0x13e27d,'error':_0x1ae717 instanceof Error?_0x1ae717[_0x510628(0xd5)]:String(_0x1ae717),'duration':_0x1c2f30});throw _0x1ae717;}return formatElapsed(_0x1addcd);}function a173_0x3e66(){const _0x344310=['info','253610PfwNdd','source','now','18LbqXAE','28jGqpnZ','2177736xidVou','error','89637RZowRm','项目模板创建完成','66eJaoum','resolve','message','项目模板复制失败','221747PeijjC','开始创建项目模板','7qqfMVN','cwd','4084968MXEEuF','1465596sioXHA','copy','828080PRxeWl'];a173_0x3e66=function(){return _0x344310;};return a173_0x3e66();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a174_0x9c48(_0x3a8fef,_0x4772f6){_0x3a8fef=_0x3a8fef-0x120;const _0x538a4c=a174_0x538a();let _0x9c48e0=_0x538a4c[_0x3a8fef];return _0x9c48e0;}(function(_0x104077,_0x142077){const _0x4a9699=a174_0x9c48,_0x1d8b5c=_0x104077();while(!![]){try{const _0x2afd44=-parseInt(_0x4a9699(0x132))/0x1+-parseInt(_0x4a9699(0x134))/0x2*(-parseInt(_0x4a9699(0x12d))/0x3)+parseInt(_0x4a9699(0x133))/0x4*(-parseInt(_0x4a9699(0x12f))/0x5)+-parseInt(_0x4a9699(0x129))/0x6+-parseInt(_0x4a9699(0x124))/0x7+-parseInt(_0x4a9699(0x126))/0x8+parseInt(_0x4a9699(0x131))/0x9*(parseInt(_0x4a9699(0x120))/0xa);if(_0x2afd44===_0x142077)break;else _0x1d8b5c['push'](_0x1d8b5c['shift']());}catch(_0x50cf65){_0x1d8b5c['push'](_0x1d8b5c['shift']());}}}(a174_0x538a,0xb6976));import a174_0x2938e1 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a174_0x538a(){const _0x344079=['3630855zpLDGk','resolve','63cfvPbW','722245fqKhkv','4oWLwIs','2cksAcV','4416700tCzVjm','info','开始格式化代码','error','4241167SbJgUt','format','5473584zzrkef','success','message','1034820rmULMm','prettier','代码格式化完成','now','1701507dvZmIt','cwd'];a174_0x538a=function(){return _0x344079;};return a174_0x538a();}export async function formatProjectCode(_0x56c0c5){const _0x26e271=a174_0x9c48,_0x41ac12=Date[_0x26e271(0x12c)](),_0x221a22=a174_0x2938e1[_0x26e271(0x130)](process[_0x26e271(0x12e)](),_0x56c0c5);try{logger[_0x26e271(0x121)]('format',_0x26e271(0x122),{'projectCode':_0x56c0c5}),await execa(resolveNpmBin('npx'),[_0x26e271(0x12a),'--write','.'],{'cwd':_0x221a22});const _0x24ec37=Date[_0x26e271(0x12c)]()-_0x41ac12;logger[_0x26e271(0x127)](_0x26e271(0x125),_0x26e271(0x12b),_0x24ec37,{'projectCode':_0x56c0c5});}catch(_0x51aee9){const _0x482804=Date['now']()-_0x41ac12;logger[_0x26e271(0x123)](_0x26e271(0x125),'代码格式化失败',{'projectCode':_0x56c0c5,'error':_0x51aee9 instanceof Error?_0x51aee9[_0x26e271(0x128)]:String(_0x51aee9),'duration':_0x482804});throw _0x51aee9;}return formatElapsed(_0x41ac12);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x15987c,_0x1efa44){const _0x3bd133=a175_0x400b,_0x24fb53=_0x15987c();while(!![]){try{const _0x1c2c8e=parseInt(_0x3bd133(0x1fe))/0x1*(-parseInt(_0x3bd133(0x200))/0x2)+-parseInt(_0x3bd133(0x1f6))/0x3+parseInt(_0x3bd133(0x1f4))/0x4*(-parseInt(_0x3bd133(0x1f3))/0x5)+-parseInt(_0x3bd133(0x1fa))/0x6+parseInt(_0x3bd133(0x1ff))/0x7*(-parseInt(_0x3bd133(0x1fd))/0x8)+-parseInt(_0x3bd133(0x1fb))/0x9+parseInt(_0x3bd133(0x1f5))/0xa;if(_0x1c2c8e===_0x1efa44)break;else _0x24fb53['push'](_0x24fb53['shift']());}catch(_0x1c9594){_0x24fb53['push'](_0x24fb53['shift']());}}}(a175_0x3b72,0x8ddbe));function a175_0x400b(_0x33d14b,_0x169968){_0x33d14b=_0x33d14b-0x1f1;const _0x3b72e1=a175_0x3b72();let _0x400bd7=_0x3b72e1[_0x33d14b];return _0x400bd7;}import a175_0x314578 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x4b7639){const _0x4199d5=a175_0x400b,_0x18ada5=Date[_0x4199d5(0x1f1)](),_0x140f52=a175_0x314578['resolve'](process[_0x4199d5(0x205)](),_0x4b7639);try{logger[_0x4199d5(0x204)](_0x4199d5(0x1f7),_0x4199d5(0x1f8),{'projectCode':_0x4b7639,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin(_0x4199d5(0x201)),[_0x4199d5(0x1f7),_0x4199d5(0x206),_0x4199d5(0x1fc)],{'cwd':_0x140f52});const _0x490d8b=Date[_0x4199d5(0x1f1)]()-_0x18ada5;logger[_0x4199d5(0x1f2)](_0x4199d5(0x1f7),_0x4199d5(0x1f9),_0x490d8b,{'projectCode':_0x4b7639});}catch(_0x3dd70d){const _0x2dbdcb=Date[_0x4199d5(0x1f1)]()-_0x18ada5;logger['error']('install',_0x4199d5(0x202),{'projectCode':_0x4b7639,'error':_0x3dd70d instanceof Error?_0x3dd70d[_0x4199d5(0x203)]:String(_0x3dd70d),'duration':_0x2dbdcb});throw _0x3dd70d;}return formatElapsed(_0x18ada5);}function a175_0x3b72(){const _0x2ca2b8=['4069816EFkcih','304438ZJrHwx','14Gkybii','6zYFCHJ','npm','依赖安装失败','message','info','cwd','--registry','now','success','865HEWsSk','18644FMgajf','53673290fvkwKM','3400317ggkmzv','install','开始安装依赖','依赖安装完成','3605058sDunqr','2833848xiPTUS','https://registry.npmmirror.com'];a175_0x3b72=function(){return _0x2ca2b8;};return a175_0x3b72();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a176_0x53b8(){const _0x1614d5=['113598gpQBLw','2200cwNBrr','name','nonInteractive','../../commands/project/create/main.js','3014328jUeyWG','string','Create\x20a\x20new\x20project','boolean','project-name','yes','9496cXBfEB','project','4165819YPNbnk','92275jSZlLV','args','22dGWZni','2270034hkkKaW','create','2193801VYHPEI','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','upgrade','trim','cookie','430QlbMRo','str','write','appcode','Target\x20environment','validation'];a176_0x53b8=function(){return _0x1614d5;};return a176_0x53b8();}const a176_0x45b091=a176_0x503c;(function(_0x2a023f,_0x4c1a19){const _0x595ea7=a176_0x503c,_0x4406c2=_0x2a023f();while(!![]){try{const _0x735aff=parseInt(_0x595ea7(0x112))/0x1*(-parseInt(_0x595ea7(0x114))/0x2)+parseInt(_0x595ea7(0xf9))/0x3+-parseInt(_0x595ea7(0x10f))/0x4*(-parseInt(_0x595ea7(0x105))/0x5)+parseInt(_0x595ea7(0x115))/0x6+-parseInt(_0x595ea7(0x111))/0x7+-parseInt(_0x595ea7(0x109))/0x8+-parseInt(_0x595ea7(0x104))/0x9*(-parseInt(_0x595ea7(0xfe))/0xa);if(_0x735aff===_0x4c1a19)break;else _0x4406c2['push'](_0x4406c2['shift']());}catch(_0x4228f0){_0x4406c2['push'](_0x4406c2['shift']());}}}(a176_0x53b8,0xad55b));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a176_0x503c(_0x58ba4c,_0x30d294){_0x58ba4c=_0x58ba4c-0xf9;const _0x53b845=a176_0x53b8();let _0x503cb0=_0x53b845[_0x58ba4c];return _0x503cb0;}import{upgradeApp}from'../../commands/project/upgrade.js';const createFlags=[{'name':'name','type':a176_0x45b091(0x10a),'description':'Project\x20name'},{'name':'env','type':'string','description':a176_0x45b091(0x102)},{'name':a176_0x45b091(0x101),'type':a176_0x45b091(0x10a),'description':'App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)'}],upgradeFlags=[{'name':a176_0x45b091(0x10e),'type':a176_0x45b091(0x10c),'description':'Skip\x20confirmation\x20prompt','default':![]}];export const projectDefinitions=[{'service':a176_0x45b091(0x110),'command':a176_0x45b091(0x116),'description':a176_0x45b091(0x10b),'risk':a176_0x45b091(0x100),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a176_0x45b091(0x10d),'description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0x5cc702){const _0x59060f=a176_0x45b091,{createApp:_0x2fcb3b}=await import(_0x59060f(0x108)),_0x412bf0=_0x5cc702[_0x59060f(0xff)](_0x59060f(0x106))[_0x59060f(0xfc)]()||_0x5cc702[_0x59060f(0x113)][0x0]?.[_0x59060f(0xfc)](),_0x2b72a2=_0x5cc702['str']('env')||undefined,_0x4e46ad=_0x5cc702['str'](_0x59060f(0x101))||undefined;if(_0x5cc702[_0x59060f(0x107)]){if(!_0x412bf0)throw CliErrors[_0x59060f(0x103)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','Usage:\x20'+CLI_BIN_NAME+_0x59060f(0xfa));await _0x2fcb3b({'projectCode':_0x412bf0,'appCode':_0x4e46ad,'env':_0x2b72a2,'cookie':_0x5cc702['cookie'],'nonInteractive':!![]});}else await _0x2fcb3b({'projectCode':_0x412bf0,'appCode':_0x4e46ad,'env':_0x2b72a2,'cookie':_0x5cc702[_0x59060f(0xfd)]});return{'ok':!![]};}},{'service':'project','command':a176_0x45b091(0xfb),'description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x31aaef){const _0x5dbcf3=a176_0x45b091;return await upgradeApp(_0x31aaef['nonInteractive'],{'yes':_0x31aaef['bool'](_0x5dbcf3(0x10e))}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x205dc2,_0x165be3){const _0xe6091c=a169_0x54b0,_0x219b26=_0x205dc2();while(!![]){try{const _0x2f3a5b=-parseInt(_0xe6091c(0x1df))/0x1*(-parseInt(_0xe6091c(0x1e7))/0x2)+-parseInt(_0xe6091c(0x1de))/0x3*(parseInt(_0xe6091c(0x18c))/0x4)+parseInt(_0xe6091c(0x1be))/0x5+parseInt(_0xe6091c(0x1da))/0x6+-parseInt(_0xe6091c(0x183))/0x7*(parseInt(_0xe6091c(0x1ed))/0x8)+parseInt(_0xe6091c(0x1bb))/0x9+-parseInt(_0xe6091c(0x1b1))/0xa;if(_0x2f3a5b===_0x165be3)break;else _0x219b26['push'](_0x219b26['shift']());}catch(_0x32d77e){_0x219b26['push'](_0x219b26['shift']());}}}(a169_0x344b,0xe092a));import a169_0x3dabeb from'chalk';import a169_0x990c21 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';function a169_0x344b(){const _0x442150=['skipped\x20(no\x20legacy\x20config)','succeed','error','10575999PxbeCl','no\x20legacy\x20config\x20found','Upgrade\x20completed\x20successfully!','7659870qiQOoD','entries','removed\x20','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','.cursor/rules/lovrabet_rules.mdc','done','red','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','args','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','hasNewConfig','\x20→\x20latest','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','Upgrade\x20cancelled.','.cursor/mcp.json','files','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','.lovrabet','object','\x20removed','lovrabet/rabetbase\x20installed\x20globally','isDirectory','oldArtifacts','values','package.json','keys','not\x20found\x20(will\x20create)','exit\x20','10691262HnfADS','MCP\x20config:','yes','Step\x204/7:\x20MCP\x20config\x20—\x20','621LfaVMO','182807knVhJC','bold','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','fields','\x20\x20Current\x20version\x20in\x20','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','log','some','14xTPUTM','dependencies','info','\x20(backup:\x20','mcpServers','yellow','1136zRmiWK','\x20→\x20','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','path','skipped','length','lovrabet/lovrabet-skill\x20removed','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','\x20from\x20','no\x20legacy\x20entry','Proceed\x20with\x20upgrade?','\x20\x20npm\x20install','\x20\x20\x20\x20\x20\x20\x20','message','utf8','Clean\x20MCP\x20config','Remove\x20.lovrabet/','\x20\x20Action:\x20delete','Config\x20migration','inherit','fail','string','Install\x20new\x20skill','Upgrade\x20@lovrabet/sdk','oldMcpConfig','9366kwMBFA','[\x22@lovrabet/sdk\x22]:\x20','cyan','@lovrabet/sdk','join','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','lovrabet/rabetbase','none\x20found','not\x20found\x20or\x20already\x20at\x20latest','20092syGETf','devDependencies','Config\x20file:','\x20\x20Step\x20','.claude/skills/lovrabet','green','isArray','cwd','status','Step\x201/7:\x20Config\x20migration\x20—\x20','start','configMigration','stringify','===\x20Upgrade\x20Summary\x20===','Remove\x20old\x20skill','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','filter','needsSkillSwap','Remove\x20legacy\x20artifacts','Step\x205/7:\x20Removing\x20old\x20skill...','step','@lovrabet/dataset-mcp-server','parse','includes','===\x20Upgrade\x20Analysis\x20===','sdkUpgrade','@lovrabet/sdk:','latest','needed','.bak','\x20\x20#\x20or','gray','\x20\x20Fields\x20to\x20migrate:\x20','white','detail','push','failed','36190040kXUaDg','oldPath','\x20\x20New\x20config\x20(.rabetbase.json):\x20','no\x20matching\x20entry\x20found','not\x20needed','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','Step\x201/7:\x20Migrating\x20config...'];a169_0x344b=function(){return _0x442150;};return a169_0x344b();}import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';function a169_0x54b0(_0x2c7558,_0x4b817f){_0x2c7558=_0x2c7558-0x183;const _0x344bc1=a169_0x344b();let _0x54b0f5=_0x344bc1[_0x2c7558];return _0x54b0f5;}import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x17a117=>_0x17a117!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x186224){const _0x8d05d3=a169_0x54b0,_0x15e013=[];for(const _0x3847a9 of Object[_0x8d05d3(0x1d5)](CORE_IDE_CONFIGS)){if(_0x3847a9[_0x8d05d3(0x1cd)])for(const _0x3311e6 of _0x3847a9[_0x8d05d3(0x1cd)]){_0x15e013[_0x8d05d3(0x1af)](resolve(_0x186224,_0x3311e6[_0x8d05d3(0x1f0)]));}}return _0x15e013;}function analyse(_0x32ee33){const _0x2828da=a169_0x54b0;let _0x6a179a=null;const _0x2cca27=resolve(_0x32ee33,NEW_CONFIG_NAME),_0x51db73=existsSync(_0x2cca27);for(const _0x4606cf of LEGACY_CONFIG_NAMES){const _0x2f4220=resolve(_0x32ee33,_0x4606cf);if(existsSync(_0x2f4220)){const _0xcdbe9e=readConfigFile(_0x2f4220),_0x1ce061=Object[_0x2828da(0x1d7)](_0xcdbe9e)[_0x2828da(0x19c)](_0x25f086=>typeof _0xcdbe9e[_0x25f086]!=='undefined');_0x6a179a={'oldPath':_0x2f4220,'hasNewConfig':_0x51db73,'fields':_0x1ce061};break;}}const _0x4fb2da=[],_0xaa656a=resolve(_0x32ee33,_0x2828da(0x1cf));if(existsSync(_0xaa656a))_0x4fb2da[_0x2828da(0x1af)](_0xaa656a);const _0x599ebc=resolve(_0x32ee33,_0x2828da(0x1c2));if(existsSync(_0x599ebc))_0x4fb2da[_0x2828da(0x1af)](_0x599ebc);const _0x2518ce=resolve(_0x32ee33,_0x2828da(0x190));if(existsSync(_0x2518ce))_0x4fb2da[_0x2828da(0x1af)](_0x2518ce);for(const _0x160338 of collectIdeSkillFiles(_0x32ee33)){if(existsSync(_0x160338))_0x4fb2da['push'](_0x160338);}let _0x12806c=null;const _0x16adcc=resolve(_0x32ee33,_0x2828da(0x1cc));if(existsSync(_0x16adcc))try{const _0x3aecbf=JSON[_0x2828da(0x1a2)](readFileSync(_0x16adcc,_0x2828da(0x1fb)));if(_0x3aecbf?.[_0x2828da(0x1eb)]&&typeof _0x3aecbf['mcpServers']===_0x2828da(0x1d0)){const _0x548ff6=[];for(const [_0x47b8d8,_0x54812f]of Object[_0x2828da(0x1bf)](_0x3aecbf[_0x2828da(0x1eb)])){const _0x329cab=_0x54812f;_0x329cab?.['args']&&Array[_0x2828da(0x192)](_0x329cab[_0x2828da(0x1c6)])&&_0x329cab[_0x2828da(0x1c6)][_0x2828da(0x1e6)](_0x35311a=>typeof _0x35311a==='string'&&_0x35311a[_0x2828da(0x1a3)](_0x2828da(0x1a1)))&&_0x548ff6[_0x2828da(0x1af)](_0x47b8d8);}_0x548ff6[_0x2828da(0x1f2)]>0x0&&(_0x12806c={'path':_0x16adcc,'keys':_0x548ff6});}}catch{}const _0x59eb8f=_0x4fb2da[_0x2828da(0x1f2)]>0x0||_0x6a179a!==null;let _0x210e04=null;const _0x19343f=resolve(_0x32ee33,_0x2828da(0x1d6));if(existsSync(_0x19343f))try{const _0x4651b1=JSON[_0x2828da(0x1a2)](readFileSync(_0x19343f,_0x2828da(0x1fb)));for(const _0x9ad761 of[_0x2828da(0x1e8),_0x2828da(0x18d)]){const _0x2dd3d5=_0x4651b1?.[_0x9ad761]?.[_0x2828da(0x186)];if(typeof _0x2dd3d5==='string'){_0x2dd3d5!==_0x2828da(0x1a7)&&(_0x210e04={'pkgPath':_0x19343f,'currentVersion':_0x2dd3d5,'field':_0x9ad761});break;}}}catch{}return{'configMigration':_0x6a179a,'oldArtifacts':_0x4fb2da,'oldMcpConfig':_0x12806c,'needsSkillSwap':_0x59eb8f,'sdkUpgrade':_0x210e04};}function printReport(_0x42e4cd){const _0x47ceae=a169_0x54b0,{configMigration:_0x52b35d,oldArtifacts:_0x449246,oldMcpConfig:_0x3a287f,needsSkillSwap:_0x3a07a7}=_0x42e4cd;console['log'](''),console[_0x47ceae(0x1e5)](a169_0x3dabeb[_0x47ceae(0x1e0)](_0x47ceae(0x1a4))),console[_0x47ceae(0x1e5)]('');_0x52b35d?(console['log'](a169_0x3dabeb[_0x47ceae(0x185)](_0x47ceae(0x18e))+('\x20\x20'+a169_0x3dabeb[_0x47ceae(0x1ec)](_0x52b35d[_0x47ceae(0x1b2)]))),console['log'](_0x47ceae(0x1b3)+(_0x52b35d[_0x47ceae(0x1c8)]?a169_0x3dabeb[_0x47ceae(0x191)]('already\x20exists\x20(will\x20merge)'):a169_0x3dabeb[_0x47ceae(0x1ab)](_0x47ceae(0x1d8)))),console[_0x47ceae(0x1e5)](_0x47ceae(0x1ac)+_0x52b35d[_0x47ceae(0x1e2)]['join'](',\x20')),console['log']('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console[_0x47ceae(0x1e5)](a169_0x3dabeb['cyan'](_0x47ceae(0x18e))+'\x20\x20'+a169_0x3dabeb[_0x47ceae(0x1ab)](_0x47ceae(0x1bc)));console[_0x47ceae(0x1e5)]('');if(_0x449246['length']>0x0){console['log'](a169_0x3dabeb[_0x47ceae(0x185)]('Legacy\x20artifacts:'));for(const _0x3e7699 of _0x449246){console[_0x47ceae(0x1e5)]('\x20\x20'+a169_0x3dabeb[_0x47ceae(0x1c4)]('FOUND')+'\x20\x20'+_0x3e7699);}console[_0x47ceae(0x1e5)](_0x47ceae(0x1fe));}else console['log'](a169_0x3dabeb[_0x47ceae(0x185)]('Legacy\x20artifacts:')+'\x20\x20'+a169_0x3dabeb[_0x47ceae(0x1ab)](_0x47ceae(0x18a)));console['log']('');_0x3a287f?(console[_0x47ceae(0x1e5)](a169_0x3dabeb['cyan'](_0x47ceae(0x1db))+('\x20\x20'+a169_0x3dabeb['yellow'](_0x3a287f['path'])+'\x20→\x20keys:\x20'+_0x3a287f[_0x47ceae(0x1d7)][_0x47ceae(0x187)](',\x20'))),console[_0x47ceae(0x1e5)](_0x47ceae(0x1c1))):console[_0x47ceae(0x1e5)](a169_0x3dabeb[_0x47ceae(0x185)](_0x47ceae(0x1db))+'\x20\x20'+a169_0x3dabeb['gray'](_0x47ceae(0x1f6)));console[_0x47ceae(0x1e5)](''),console[_0x47ceae(0x1e5)](a169_0x3dabeb[_0x47ceae(0x185)]('Skill\x20swap:')+('\x20\x20'+(_0x3a07a7?a169_0x3dabeb['yellow'](_0x47ceae(0x1a8)):a169_0x3dabeb[_0x47ceae(0x191)](_0x47ceae(0x1b5)))));_0x3a07a7&&console[_0x47ceae(0x1e5)](_0x47ceae(0x1b6)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x47ceae(0x1e5)]('');if(_0x42e4cd[_0x47ceae(0x1a5)]){const {currentVersion:_0x3a6e40,field:_0x4f86a5,pkgPath:_0x175b5b}=_0x42e4cd[_0x47ceae(0x1a5)];console[_0x47ceae(0x1e5)](a169_0x3dabeb['cyan'](_0x47ceae(0x1a6))+('\x20\x20'+a169_0x3dabeb[_0x47ceae(0x1ec)](_0x175b5b))),console['log'](_0x47ceae(0x1e3)+_0x4f86a5+':\x20'+a169_0x3dabeb[_0x47ceae(0x1ec)](_0x3a6e40)+_0x47ceae(0x1ee)+a169_0x3dabeb[_0x47ceae(0x191)](_0x47ceae(0x1a7))),console[_0x47ceae(0x1e5)](_0x47ceae(0x1ce));}else console[_0x47ceae(0x1e5)](a169_0x3dabeb[_0x47ceae(0x185)]('@lovrabet/sdk:')+'\x20\x20'+a169_0x3dabeb['gray'](_0x47ceae(0x18b)));console[_0x47ceae(0x1e5)]('');}function execConfigMigration(_0x43a56f,_0x46f990){const _0x578dff=a169_0x54b0,{configMigration:_0x1507f5}=_0x43a56f;if(!_0x1507f5?.[_0x578dff(0x1b2)])return{'step':0x1,'label':_0x578dff(0x1ff),'ok':!![],'detail':_0x578dff(0x1b8)};const _0x562923=readConfigFile(_0x1507f5[_0x578dff(0x1b2)]),_0x567b69=resolve(_0x46f990,NEW_CONFIG_NAME),_0x119cd7=_0x1507f5['hasNewConfig']?readConfigFile(_0x567b69):{};for(const [_0x3d86eb,_0x2bb01d]of Object['entries'](_0x562923)){!(_0x3d86eb in _0x119cd7)&&(_0x119cd7[_0x3d86eb]=_0x2bb01d);}writeConfigFile(_0x567b69,_0x119cd7);const _0x742dcd=_0x1507f5['oldPath']+_0x578dff(0x1a9);return renameSync(_0x1507f5[_0x578dff(0x1b2)],_0x742dcd),{'step':0x1,'label':_0x578dff(0x1ff),'ok':!![],'detail':_0x1507f5[_0x578dff(0x1b2)]+_0x578dff(0x1ee)+_0x567b69+_0x578dff(0x1ea)+_0x742dcd+')'};}function execRemoveOldArtifacts(_0x43c15a){const _0x171498=a169_0x54b0,_0x4b3d00=[];for(const _0x1af541 of _0x43c15a){try{if(!existsSync(_0x1af541))continue;const _0xe778c6=tryStat(_0x1af541);_0xe778c6?.[_0x171498(0x1d3)]()?rmSync(_0x1af541,{'recursive':!![],'force':!![]}):unlinkSync(_0x1af541);}catch(_0x2888c2){_0x4b3d00[_0x171498(0x1af)](_0x1af541+':\x20'+_0x2888c2[_0x171498(0x1fa)]);}}return{'step':0x3,'label':_0x171498(0x19e),'ok':_0x4b3d00[_0x171498(0x1f2)]===0x0,'detail':_0x4b3d00['length']>0x0?_0x43c15a[_0x171498(0x1f2)]-_0x4b3d00['length']+'/'+_0x43c15a['length']+'\x20removed\x20('+_0x4b3d00[_0x171498(0x187)](';\x20')+')':_0x43c15a[_0x171498(0x1f2)]+_0x171498(0x1d1)};}function execCleanMcp(_0x4edbd6){const _0x322e07=a169_0x54b0;if(!_0x4edbd6[_0x322e07(0x205)])return{'step':0x4,'label':_0x322e07(0x1fc),'ok':!![],'detail':_0x322e07(0x1f1)};try{const _0x75be9c=readFileSync(_0x4edbd6['oldMcpConfig'][_0x322e07(0x1f0)],_0x322e07(0x1fb)),_0x4142bf=JSON[_0x322e07(0x1a2)](_0x75be9c);if(_0x4142bf?.['mcpServers']&&typeof _0x4142bf['mcpServers']===_0x322e07(0x1d0)){const _0x10b83d=[];for(const [_0x5b9cb5,_0x5bd873]of Object[_0x322e07(0x1bf)](_0x4142bf[_0x322e07(0x1eb)])){_0x5bd873?.[_0x322e07(0x1c6)]&&Array[_0x322e07(0x192)](_0x5bd873[_0x322e07(0x1c6)])&&_0x5bd873['args']['some'](_0x345514=>typeof _0x345514===_0x322e07(0x202)&&_0x345514[_0x322e07(0x1a3)](_0x322e07(0x1a1)))&&_0x10b83d['push'](_0x5b9cb5);}for(const _0x34c934 of _0x10b83d){delete _0x4142bf['mcpServers'][_0x34c934];}return _0x10b83d[_0x322e07(0x1f2)]>0x0&&writeFileSync(_0x4edbd6[_0x322e07(0x205)][_0x322e07(0x1f0)],JSON[_0x322e07(0x198)](_0x4142bf,null,0x2)+'\x0a',_0x322e07(0x1fb)),{'step':0x4,'label':_0x322e07(0x1fc),'ok':!![],'detail':_0x322e07(0x1c0)+_0x10b83d[_0x322e07(0x187)](',\x20')+_0x322e07(0x1f5)+_0x4edbd6[_0x322e07(0x205)][_0x322e07(0x1f0)]};}return{'step':0x4,'label':_0x322e07(0x1fc),'ok':!![],'detail':_0x322e07(0x1b4)};}catch(_0x2f9dd5){return{'step':0x4,'label':_0x322e07(0x1fc),'ok':![],'detail':_0x2f9dd5['message']};}}function execSkillsRemove(_0x150652,_0x92cf97){const _0x433ad6=a169_0x54b0,_0xf4f16f=runNpxSkillsRemove(_0x150652,{'stdio':_0x433ad6(0x200),'yes':_0x92cf97});return{'step':0x5,'label':_0x433ad6(0x19a),'ok':_0xf4f16f['ok'],'detail':_0xf4f16f['ok']?_0x433ad6(0x1f3):_0xf4f16f[_0x433ad6(0x1ba)]??_0x433ad6(0x1d9)+_0xf4f16f['status']};}function execSkillsAdd(_0x24ba60,_0x5851d6){const _0x1675d4=a169_0x54b0,_0x2a8ea3=runNpxSkillsAddGlobal(_0x24ba60,_0x1675d4(0x189),{'stdio':_0x1675d4(0x200),'yes':_0x5851d6});return{'step':0x6,'label':_0x1675d4(0x203),'ok':_0x2a8ea3['ok'],'detail':_0x2a8ea3['ok']?_0x1675d4(0x1d2):_0x2a8ea3['error']??_0x1675d4(0x1d9)+_0x2a8ea3[_0x1675d4(0x194)]};}function execUpgradeSdk(_0x1960b3){const _0x24a3cd=a169_0x54b0;if(!_0x1960b3['sdkUpgrade'])return{'step':0x7,'label':_0x24a3cd(0x204),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x1196a7,currentVersion:_0x186b54,field:_0xe7d167}=_0x1960b3[_0x24a3cd(0x1a5)];try{const _0x1674cd=readFileSync(_0x1196a7,_0x24a3cd(0x1fb)),_0xb0e79=JSON[_0x24a3cd(0x1a2)](_0x1674cd);return _0xb0e79[_0xe7d167][_0x24a3cd(0x186)]=_0x24a3cd(0x1a7),writeFileSync(_0x1196a7,JSON[_0x24a3cd(0x198)](_0xb0e79,null,0x2)+'\x0a',_0x24a3cd(0x1fb)),{'step':0x7,'label':_0x24a3cd(0x204),'ok':!![],'detail':_0xe7d167+_0x24a3cd(0x184)+_0x186b54+_0x24a3cd(0x1c9)};}catch(_0x542fb0){return{'step':0x7,'label':_0x24a3cd(0x204),'ok':![],'detail':_0x542fb0[_0x24a3cd(0x1fa)]};}}function tryStat(_0x17fb12){try{return statSync(_0x17fb12);}catch{return undefined;}}function printSummary(_0x29da23){const _0x48d44d=a169_0x54b0;console['log'](''),console[_0x48d44d(0x1e5)](a169_0x3dabeb[_0x48d44d(0x1e0)](_0x48d44d(0x199))),console[_0x48d44d(0x1e5)]('');for(const _0x5f1bf6 of _0x29da23){const _0x303f3c=_0x5f1bf6['ok']?a169_0x3dabeb[_0x48d44d(0x191)]('OK'):a169_0x3dabeb[_0x48d44d(0x1c4)]('FAIL');console['log']('\x20\x20'+_0x303f3c+_0x48d44d(0x18f)+_0x5f1bf6[_0x48d44d(0x1a0)]+':\x20'+_0x5f1bf6['label']);if(_0x5f1bf6[_0x48d44d(0x1ae)])console['log'](_0x48d44d(0x1f9)+a169_0x3dabeb[_0x48d44d(0x1ab)](_0x5f1bf6[_0x48d44d(0x1ae)]));}console[_0x48d44d(0x1e5)]('');}export async function upgradeApp(_0x69edea,_0x549d76){const _0xf5966b=a169_0x54b0,_0x542c0e=process[_0xf5966b(0x193)](),_0x201319=analyse(_0x542c0e),_0x249b54=!_0x201319[_0xf5966b(0x197)]&&_0x201319[_0xf5966b(0x1d4)][_0xf5966b(0x1f2)]===0x0&&!_0x201319[_0xf5966b(0x205)]&&!_0x201319[_0xf5966b(0x19d)]&&!_0x201319['sdkUpgrade'];if(_0x249b54){console[_0xf5966b(0x1e5)](a169_0x3dabeb[_0xf5966b(0x191)](_0xf5966b(0x19b)));return;}printReport(_0x201319);const _0x7c53ef=!!(_0x549d76[_0xf5966b(0x1dc)]||_0x549d76['Y']||_0x69edea);if(!_0x7c53ef)try{const _0x1f876e=await askConfirm(_0xf5966b(0x1f7));if(!_0x1f876e){console['log'](a169_0x3dabeb[_0xf5966b(0x1ab)]('Upgrade\x20cancelled.'));return;}}catch(_0x42fea9){if(_0x42fea9?.[_0xf5966b(0x1fa)]==='CANCEL'){console[_0xf5966b(0x1e5)](a169_0x3dabeb[_0xf5966b(0x1ab)](_0xf5966b(0x1cb)));return;}throw _0x42fea9;}const _0x2e65ae=[],_0x3189fc=a169_0x990c21({'text':_0xf5966b(0x1b7),'color':_0xf5966b(0x185)})[_0xf5966b(0x196)](),_0x23117f=execConfigMigration(_0x201319,_0x542c0e);_0x2e65ae[_0xf5966b(0x1af)](_0x23117f),_0x3189fc[_0x23117f['ok']?_0xf5966b(0x1b9):_0xf5966b(0x201)](_0xf5966b(0x195)+(_0x23117f[_0xf5966b(0x1ae)]??(_0x23117f['ok']?_0xf5966b(0x1c3):_0xf5966b(0x1b0))));const _0x233de0=resolve(_0x542c0e,_0xf5966b(0x1cf)),_0x1680ca=a169_0x990c21({'text':_0xf5966b(0x1e1),'color':_0xf5966b(0x185)})['start']();if(existsSync(_0x233de0))try{rmSync(_0x233de0,{'recursive':!![],'force':!![]}),_0x1680ca[_0xf5966b(0x1b9)]('Step\x202/7:\x20.lovrabet/\x20directory\x20removed'),_0x2e65ae['push']({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0xe5625c){_0x1680ca[_0xf5966b(0x201)](_0xf5966b(0x1ef)+_0xe5625c[_0xf5966b(0x1fa)]),_0x2e65ae['push']({'step':0x2,'label':_0xf5966b(0x1fd),'ok':![],'detail':_0xe5625c[_0xf5966b(0x1fa)]});}else _0x1680ca[_0xf5966b(0x1e9)](_0xf5966b(0x1f4)),_0x2e65ae[_0xf5966b(0x1af)]({'step':0x2,'label':_0xf5966b(0x1fd),'ok':!![],'detail':_0xf5966b(0x1f1)});const _0x5ba385=a169_0x990c21({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0xf5966b(0x185)})['start'](),_0xdb94aa=execRemoveOldArtifacts(_0x201319['oldArtifacts']);_0x2e65ae['push'](_0xdb94aa),_0x5ba385[_0xdb94aa['ok']?_0xf5966b(0x1b9):_0xf5966b(0x201)]('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0xdb94aa[_0xf5966b(0x1ae)]??(_0xdb94aa['ok']?_0xf5966b(0x1c3):_0xf5966b(0x1b0))));const _0x6e8cb2=a169_0x990c21({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':'cyan'})[_0xf5966b(0x196)](),_0x133806=execCleanMcp(_0x201319);_0x2e65ae[_0xf5966b(0x1af)](_0x133806),_0x6e8cb2[_0x133806['ok']?'succeed':_0xf5966b(0x201)](_0xf5966b(0x1dd)+(_0x133806[_0xf5966b(0x1ae)]??(_0x133806['ok']?'done':_0xf5966b(0x1b0))));const _0x117249=a169_0x990c21({'text':_0xf5966b(0x19f),'color':_0xf5966b(0x185)})[_0xf5966b(0x196)](),_0x5ca2a2=execSkillsRemove(_0x542c0e,_0x7c53ef);_0x2e65ae[_0xf5966b(0x1af)](_0x5ca2a2),_0x117249[_0x5ca2a2['ok']?_0xf5966b(0x1b9):_0xf5966b(0x201)]('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x5ca2a2[_0xf5966b(0x1ae)]??(_0x5ca2a2['ok']?_0xf5966b(0x1c3):'failed')));const _0x415860=a169_0x990c21({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':_0xf5966b(0x185)})[_0xf5966b(0x196)](),_0x55c52f=execSkillsAdd(_0x542c0e,_0x7c53ef);_0x2e65ae[_0xf5966b(0x1af)](_0x55c52f),_0x415860[_0x55c52f['ok']?_0xf5966b(0x1b9):_0xf5966b(0x201)](_0xf5966b(0x1e4)+(_0x55c52f[_0xf5966b(0x1ae)]??(_0x55c52f['ok']?_0xf5966b(0x1c3):_0xf5966b(0x1b0))));const _0x521bd8=a169_0x990c21({'text':_0xf5966b(0x188),'color':'cyan'})['start'](),_0xdf110a=execUpgradeSdk(_0x201319);_0x2e65ae[_0xf5966b(0x1af)](_0xdf110a),_0x521bd8[_0xdf110a['ok']?_0xf5966b(0x1b9):_0xf5966b(0x201)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0xdf110a[_0xf5966b(0x1ae)]??(_0xdf110a['ok']?_0xf5966b(0x1c3):'failed'))),printSummary(_0x2e65ae);const _0x22c365=_0x2e65ae['some'](_0x330674=>!_0x330674['ok']);_0x22c365?console[_0xf5966b(0x1e5)](a169_0x3dabeb[_0xf5966b(0x1ec)](_0xf5966b(0x1c7))):console[_0xf5966b(0x1e5)](a169_0x3dabeb['green'](_0xf5966b(0x1bd))),_0xdf110a['ok']&&_0x201319['sdkUpgrade']&&(console['log'](''),console[_0xf5966b(0x1e5)](a169_0x3dabeb[_0xf5966b(0x1e0)][_0xf5966b(0x185)](_0xf5966b(0x1c5))),console[_0xf5966b(0x1e5)](a169_0x3dabeb[_0xf5966b(0x185)](_0xf5966b(0x1ca))),console['log'](''),console[_0xf5966b(0x1e5)](a169_0x3dabeb[_0xf5966b(0x1ad)](_0xf5966b(0x1f8))),console[_0xf5966b(0x1e5)](a169_0x3dabeb[_0xf5966b(0x1ad)](_0xf5966b(0x1aa))),console[_0xf5966b(0x1e5)](a169_0x3dabeb[_0xf5966b(0x1ad)]('\x20\x20bun\x20install')),console[_0xf5966b(0x1e5)](''));}
|
|
1
|
+
const a177_0x3857b3=a177_0x577b;(function(_0xe15af8,_0x4cee51){const _0x354aa4=a177_0x577b,_0x1f36f4=_0xe15af8();while(!![]){try{const _0x321157=parseInt(_0x354aa4(0xbd))/0x1*(parseInt(_0x354aa4(0x117))/0x2)+parseInt(_0x354aa4(0x101))/0x3*(-parseInt(_0x354aa4(0xba))/0x4)+parseInt(_0x354aa4(0x10f))/0x5+parseInt(_0x354aa4(0xbf))/0x6+-parseInt(_0x354aa4(0xb4))/0x7+parseInt(_0x354aa4(0xe1))/0x8*(-parseInt(_0x354aa4(0xee))/0x9)+parseInt(_0x354aa4(0xfb))/0xa*(parseInt(_0x354aa4(0xbc))/0xb);if(_0x321157===_0x4cee51)break;else _0x1f36f4['push'](_0x1f36f4['shift']());}catch(_0x392b70){_0x1f36f4['push'](_0x1f36f4['shift']());}}}(a177_0x593d,0x3f395));import a177_0x3b781c from'chalk';import a177_0x8b40ee 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[a177_0x3857b3(0xe3)](_0x148587=>_0x148587!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x363975){const _0x33d927=a177_0x3857b3,_0x224e51=[];for(const _0x2dbbca of Object[_0x33d927(0xf9)](CORE_IDE_CONFIGS)){if(_0x2dbbca[_0x33d927(0x11b)])for(const _0x52f072 of _0x2dbbca[_0x33d927(0x11b)]){_0x224e51[_0x33d927(0x128)](resolve(_0x363975,_0x52f072[_0x33d927(0xd3)]));}}return _0x224e51;}function analyse(_0x3c713e){const _0x220699=a177_0x3857b3;let _0x41b4e7=null;const _0x1cdb61=resolve(_0x3c713e,NEW_CONFIG_NAME),_0x1d2aae=existsSync(_0x1cdb61);for(const _0x5385fd of LEGACY_CONFIG_NAMES){const _0x1057a5=resolve(_0x3c713e,_0x5385fd);if(existsSync(_0x1057a5)){const _0x3c46ee=readConfigFile(_0x1057a5),_0x2ba635=Object[_0x220699(0xb3)](_0x3c46ee)['filter'](_0x4c92fa=>typeof _0x3c46ee[_0x4c92fa]!==_0x220699(0x129));_0x41b4e7={'oldPath':_0x1057a5,'hasNewConfig':_0x1d2aae,'fields':_0x2ba635};break;}}const _0x45362d=[],_0xd4be00=resolve(_0x3c713e,'.lovrabet');if(existsSync(_0xd4be00))_0x45362d[_0x220699(0x128)](_0xd4be00);const _0x169436=resolve(_0x3c713e,_0x220699(0x120));if(existsSync(_0x169436))_0x45362d[_0x220699(0x128)](_0x169436);const _0x558acf=resolve(_0x3c713e,_0x220699(0xdc));if(existsSync(_0x558acf))_0x45362d[_0x220699(0x128)](_0x558acf);for(const _0x5c852d of collectIdeSkillFiles(_0x3c713e)){if(existsSync(_0x5c852d))_0x45362d[_0x220699(0x128)](_0x5c852d);}let _0x17c0d0=null;const _0x5bb362=resolve(_0x3c713e,_0x220699(0xd9));if(existsSync(_0x5bb362))try{const _0x8b0f74=JSON[_0x220699(0xc0)](readFileSync(_0x5bb362,_0x220699(0xfe)));if(_0x8b0f74?.[_0x220699(0xd1)]&&typeof _0x8b0f74['mcpServers']===_0x220699(0xd6)){const _0x29797e=[];for(const [_0x22ed54,_0x346574]of Object[_0x220699(0x105)](_0x8b0f74[_0x220699(0xd1)])){const _0x104943=_0x346574;_0x104943?.['args']&&Array['isArray'](_0x104943[_0x220699(0xfd)])&&_0x104943[_0x220699(0xfd)][_0x220699(0x112)](_0x24b6d7=>typeof _0x24b6d7===_0x220699(0xe5)&&_0x24b6d7[_0x220699(0x11c)]('@lovrabet/dataset-mcp-server'))&&_0x29797e[_0x220699(0x128)](_0x22ed54);}_0x29797e[_0x220699(0xf8)]>0x0&&(_0x17c0d0={'path':_0x5bb362,'keys':_0x29797e});}}catch{}const _0x21945b=_0x45362d[_0x220699(0xf8)]>0x0||_0x41b4e7!==null;let _0x27d0fd=null;const _0x3a818d=resolve(_0x3c713e,_0x220699(0xeb));if(existsSync(_0x3a818d))try{const _0x1b4bb0=JSON[_0x220699(0xc0)](readFileSync(_0x3a818d,_0x220699(0xfe)));for(const _0x1b0b6b of[_0x220699(0xb2),_0x220699(0xf1)]){const _0x5b6fe4=_0x1b4bb0?.[_0x1b0b6b]?.[_0x220699(0x104)];if(typeof _0x5b6fe4===_0x220699(0xe5)){_0x5b6fe4!==_0x220699(0xde)&&(_0x27d0fd={'pkgPath':_0x3a818d,'currentVersion':_0x5b6fe4,'field':_0x1b0b6b});break;}}}catch{}return{'configMigration':_0x41b4e7,'oldArtifacts':_0x45362d,'oldMcpConfig':_0x17c0d0,'needsSkillSwap':_0x21945b,'sdkUpgrade':_0x27d0fd};}function printReport(_0x38d24a){const _0x28864c=a177_0x3857b3,{configMigration:_0x446384,oldArtifacts:_0x46ef1c,oldMcpConfig:_0x5802ae,needsSkillSwap:_0x20e9fc}=_0x38d24a;console[_0x28864c(0x12f)](''),console[_0x28864c(0x12f)](a177_0x3b781c[_0x28864c(0xf6)]('===\x20Upgrade\x20Analysis\x20===')),console['log']('');_0x446384?(console[_0x28864c(0x12f)](a177_0x3b781c[_0x28864c(0x12d)](_0x28864c(0x11d))+('\x20\x20'+a177_0x3b781c[_0x28864c(0x118)](_0x446384[_0x28864c(0x115)]))),console[_0x28864c(0x12f)]('\x20\x20New\x20config\x20(.rabetbase.json):\x20'+(_0x446384[_0x28864c(0x106)]?a177_0x3b781c['green'](_0x28864c(0xcd)):a177_0x3b781c['gray'](_0x28864c(0xd7)))),console[_0x28864c(0x12f)](_0x28864c(0x10b)+_0x446384['fields'][_0x28864c(0xbb)](',\x20')),console['log']('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console[_0x28864c(0x12f)](a177_0x3b781c[_0x28864c(0x12d)](_0x28864c(0x11d))+'\x20\x20'+a177_0x3b781c[_0x28864c(0xb6)](_0x28864c(0xc6)));console['log']('');if(_0x46ef1c[_0x28864c(0xf8)]>0x0){console['log'](a177_0x3b781c[_0x28864c(0x12d)](_0x28864c(0x110)));for(const _0x5c6118 of _0x46ef1c){console['log']('\x20\x20'+a177_0x3b781c[_0x28864c(0xe6)](_0x28864c(0x119))+'\x20\x20'+_0x5c6118);}console[_0x28864c(0x12f)]('\x20\x20Action:\x20delete');}else console['log'](a177_0x3b781c[_0x28864c(0x12d)](_0x28864c(0x110))+'\x20\x20'+a177_0x3b781c[_0x28864c(0xb6)]('none\x20found'));console[_0x28864c(0x12f)]('');_0x5802ae?(console[_0x28864c(0x12f)](a177_0x3b781c[_0x28864c(0x12d)](_0x28864c(0x123))+('\x20\x20'+a177_0x3b781c[_0x28864c(0x118)](_0x5802ae[_0x28864c(0xd3)])+_0x28864c(0xed)+_0x5802ae[_0x28864c(0xb3)][_0x28864c(0xbb)](',\x20'))),console[_0x28864c(0x12f)](_0x28864c(0x10c))):console['log'](a177_0x3b781c[_0x28864c(0x12d)](_0x28864c(0x123))+'\x20\x20'+a177_0x3b781c[_0x28864c(0xb6)](_0x28864c(0xcf)));console[_0x28864c(0x12f)](''),console[_0x28864c(0x12f)](a177_0x3b781c[_0x28864c(0x12d)]('Skill\x20swap:')+('\x20\x20'+(_0x20e9fc?a177_0x3b781c[_0x28864c(0x118)]('needed'):a177_0x3b781c['green'](_0x28864c(0x107)))));_0x20e9fc&&console[_0x28864c(0x12f)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x28864c(0x12f)]('');if(_0x38d24a['sdkUpgrade']){const {currentVersion:_0x5c1529,field:_0x436eab,pkgPath:_0x298b0c}=_0x38d24a[_0x28864c(0xe7)];console['log'](a177_0x3b781c['cyan'](_0x28864c(0xe8))+('\x20\x20'+a177_0x3b781c[_0x28864c(0x118)](_0x298b0c))),console['log']('\x20\x20Current\x20version\x20in\x20'+_0x436eab+':\x20'+a177_0x3b781c[_0x28864c(0x118)](_0x5c1529)+_0x28864c(0x127)+a177_0x3b781c['green']('latest')),console['log'](_0x28864c(0x11e));}else console[_0x28864c(0x12f)](a177_0x3b781c['cyan'](_0x28864c(0xe8))+'\x20\x20'+a177_0x3b781c[_0x28864c(0xb6)](_0x28864c(0x10e)));console[_0x28864c(0x12f)]('');}function execConfigMigration(_0x3948b3,_0x382dbd){const _0x58a226=a177_0x3857b3,{configMigration:_0x3bed5c}=_0x3948b3;if(!_0x3bed5c?.[_0x58a226(0x115)])return{'step':0x1,'label':_0x58a226(0xd2),'ok':!![],'detail':_0x58a226(0xbe)};const _0xfacf26=readConfigFile(_0x3bed5c[_0x58a226(0x115)]),_0x23418f=resolve(_0x382dbd,NEW_CONFIG_NAME),_0x2dedca=_0x3bed5c[_0x58a226(0x106)]?readConfigFile(_0x23418f):{};for(const [_0x2f290a,_0x2be655]of Object[_0x58a226(0x105)](_0xfacf26)){!(_0x2f290a in _0x2dedca)&&(_0x2dedca[_0x2f290a]=_0x2be655);}writeConfigFile(_0x23418f,_0x2dedca);const _0x477282=_0x3bed5c['oldPath']+_0x58a226(0xd5);return renameSync(_0x3bed5c[_0x58a226(0x115)],_0x477282),{'step':0x1,'label':_0x58a226(0xd2),'ok':!![],'detail':_0x3bed5c['oldPath']+_0x58a226(0x127)+_0x23418f+_0x58a226(0x116)+_0x477282+')'};}function a177_0x593d(){const _0x32ae4a=['.lovrabet','.cursor/mcp.json','\x20removed\x20(','\x20\x20#\x20or','.claude/skills/lovrabet','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','latest','lovrabet/rabetbase\x20installed\x20globally','exit\x20','1982520JijBay','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','filter','oldMcpConfig','string','red','sdkUpgrade','@lovrabet/sdk:','oldArtifacts','message','package.json','step','\x20→\x20keys:\x20','9UcIOzr','white','failed','devDependencies','green','info','Clean\x20MCP\x20config','\x20from\x20','bold','Remove\x20old\x20skill','length','values','FAIL','9590nCQOft','\x20→\x20latest','args','utf8','stringify','lovrabet/lovrabet-skill\x20removed','9Qeuwgz','\x20\x20bun\x20install','Remove\x20.lovrabet/','@lovrabet/sdk','entries','hasNewConfig','not\x20needed','\x20\x20Step\x20','Remove\x20legacy\x20artifacts','isDirectory','\x20\x20Fields\x20to\x20migrate:\x20','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','not\x20found\x20or\x20already\x20at\x20latest','257580vlYoLh','Legacy\x20artifacts:','status','some','fail','start','oldPath','\x20(backup:\x20','13970AmUGgK','yellow','FOUND','Step\x201/7:\x20Config\x20migration\x20—\x20','files','includes','Config\x20file:','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','.cursor/rules/lovrabet_rules.mdc','succeed','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','MCP\x20config:','Step\x204/7:\x20MCP\x20config\x20—\x20','label','Upgrade\x20@lovrabet/sdk','\x20→\x20','push','undefined','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','Proceed\x20with\x20upgrade?','no\x20matching\x20entry\x20found','cyan','done','log','dependencies','keys','944643uhbwrn','Install\x20new\x20skill','gray','needsSkillSwap','skipped','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','663416tVIFuG','join','9053XuGxae','5JITevB','skipped\x20(no\x20legacy\x20config)','1581558JUYwsZ','parse','Step\x201/7:\x20Migrating\x20config...','configMigration','Upgrade\x20cancelled.','\x20removed','detail','no\x20legacy\x20config\x20found','Upgrade\x20completed\x20successfully!','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','\x20\x20npm\x20install','yes','error','inherit','already\x20exists\x20(will\x20merge)','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','no\x20legacy\x20entry','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','mcpServers','Config\x20migration','path','removed\x20','.bak','object','not\x20found\x20(will\x20create)'];a177_0x593d=function(){return _0x32ae4a;};return a177_0x593d();}function execRemoveOldArtifacts(_0x266666){const _0x1d5c42=a177_0x3857b3,_0x2b87ef=[];for(const _0x586765 of _0x266666){try{if(!existsSync(_0x586765))continue;const _0x558b7c=tryStat(_0x586765);_0x558b7c?.[_0x1d5c42(0x10a)]()?rmSync(_0x586765,{'recursive':!![],'force':!![]}):unlinkSync(_0x586765);}catch(_0x3908f9){_0x2b87ef['push'](_0x586765+':\x20'+_0x3908f9[_0x1d5c42(0xea)]);}}return{'step':0x3,'label':_0x1d5c42(0x109),'ok':_0x2b87ef[_0x1d5c42(0xf8)]===0x0,'detail':_0x2b87ef[_0x1d5c42(0xf8)]>0x0?_0x266666[_0x1d5c42(0xf8)]-_0x2b87ef['length']+'/'+_0x266666[_0x1d5c42(0xf8)]+_0x1d5c42(0xda)+_0x2b87ef['join'](';\x20')+')':_0x266666['length']+_0x1d5c42(0xc4)};}function execCleanMcp(_0x16ab23){const _0x1b88eb=a177_0x3857b3;if(!_0x16ab23[_0x1b88eb(0xe4)])return{'step':0x4,'label':_0x1b88eb(0xf4),'ok':!![],'detail':_0x1b88eb(0xb8)};try{const _0x793771=readFileSync(_0x16ab23['oldMcpConfig'][_0x1b88eb(0xd3)],_0x1b88eb(0xfe)),_0x2d9cbb=JSON[_0x1b88eb(0xc0)](_0x793771);if(_0x2d9cbb?.[_0x1b88eb(0xd1)]&&typeof _0x2d9cbb['mcpServers']===_0x1b88eb(0xd6)){const _0x3bcb92=[];for(const [_0x3791d6,_0x4eb583]of Object[_0x1b88eb(0x105)](_0x2d9cbb['mcpServers'])){_0x4eb583?.[_0x1b88eb(0xfd)]&&Array['isArray'](_0x4eb583['args'])&&_0x4eb583[_0x1b88eb(0xfd)][_0x1b88eb(0x112)](_0x2f13e8=>typeof _0x2f13e8==='string'&&_0x2f13e8[_0x1b88eb(0x11c)]('@lovrabet/dataset-mcp-server'))&&_0x3bcb92['push'](_0x3791d6);}for(const _0x14abe1 of _0x3bcb92){delete _0x2d9cbb['mcpServers'][_0x14abe1];}return _0x3bcb92['length']>0x0&&writeFileSync(_0x16ab23[_0x1b88eb(0xe4)][_0x1b88eb(0xd3)],JSON[_0x1b88eb(0xff)](_0x2d9cbb,null,0x2)+'\x0a',_0x1b88eb(0xfe)),{'step':0x4,'label':_0x1b88eb(0xf4),'ok':!![],'detail':_0x1b88eb(0xd4)+_0x3bcb92['join'](',\x20')+_0x1b88eb(0xf5)+_0x16ab23[_0x1b88eb(0xe4)][_0x1b88eb(0xd3)]};}return{'step':0x4,'label':_0x1b88eb(0xf4),'ok':!![],'detail':_0x1b88eb(0x12c)};}catch(_0x4a5b3d){return{'step':0x4,'label':_0x1b88eb(0xf4),'ok':![],'detail':_0x4a5b3d[_0x1b88eb(0xea)]};}}function execSkillsRemove(_0x4f637a,_0x3eee60){const _0x544e2e=a177_0x3857b3,_0x320ab7=runNpxSkillsRemove(_0x4f637a,{'stdio':_0x544e2e(0xcc),'yes':_0x3eee60});return{'step':0x5,'label':_0x544e2e(0xf7),'ok':_0x320ab7['ok'],'detail':_0x320ab7['ok']?_0x544e2e(0x100):_0x320ab7['error']??_0x544e2e(0xe0)+_0x320ab7[_0x544e2e(0x111)]};}function execSkillsAdd(_0x1a48bc,_0x72254e){const _0x463587=a177_0x3857b3,_0x3bbeb1=runNpxSkillsAddGlobal(_0x1a48bc,'lovrabet/rabetbase',{'stdio':_0x463587(0xcc),'yes':_0x72254e});return{'step':0x6,'label':_0x463587(0xb5),'ok':_0x3bbeb1['ok'],'detail':_0x3bbeb1['ok']?_0x463587(0xdf):_0x3bbeb1[_0x463587(0xcb)]??_0x463587(0xe0)+_0x3bbeb1[_0x463587(0x111)]};}function a177_0x577b(_0x326308,_0x3eeb53){_0x326308=_0x326308-0xb2;const _0x593d1c=a177_0x593d();let _0x577b9e=_0x593d1c[_0x326308];return _0x577b9e;}function execUpgradeSdk(_0x548f03){const _0x5551d4=a177_0x3857b3;if(!_0x548f03[_0x5551d4(0xe7)])return{'step':0x7,'label':_0x5551d4(0x126),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x2b0f92,currentVersion:_0x3954c7,field:_0x105be6}=_0x548f03[_0x5551d4(0xe7)];try{const _0x9aec99=readFileSync(_0x2b0f92,_0x5551d4(0xfe)),_0x3b9baf=JSON[_0x5551d4(0xc0)](_0x9aec99);return _0x3b9baf[_0x105be6][_0x5551d4(0x104)]='latest',writeFileSync(_0x2b0f92,JSON[_0x5551d4(0xff)](_0x3b9baf,null,0x2)+'\x0a',_0x5551d4(0xfe)),{'step':0x7,'label':_0x5551d4(0x126),'ok':!![],'detail':_0x105be6+'[\x22@lovrabet/sdk\x22]:\x20'+_0x3954c7+_0x5551d4(0xfc)};}catch(_0x5acc5a){return{'step':0x7,'label':_0x5551d4(0x126),'ok':![],'detail':_0x5acc5a[_0x5551d4(0xea)]};}}function tryStat(_0x188519){try{return statSync(_0x188519);}catch{return undefined;}}function printSummary(_0x3d3365){const _0x4458e9=a177_0x3857b3;console['log'](''),console[_0x4458e9(0x12f)](a177_0x3b781c[_0x4458e9(0xf6)]('===\x20Upgrade\x20Summary\x20===')),console[_0x4458e9(0x12f)]('');for(const _0x3be17f of _0x3d3365){const _0x180bae=_0x3be17f['ok']?a177_0x3b781c['green']('OK'):a177_0x3b781c[_0x4458e9(0xe6)](_0x4458e9(0xfa));console[_0x4458e9(0x12f)]('\x20\x20'+_0x180bae+_0x4458e9(0x108)+_0x3be17f[_0x4458e9(0xec)]+':\x20'+_0x3be17f[_0x4458e9(0x125)]);if(_0x3be17f['detail'])console['log']('\x20\x20\x20\x20\x20\x20\x20'+a177_0x3b781c[_0x4458e9(0xb6)](_0x3be17f[_0x4458e9(0xc5)]));}console[_0x4458e9(0x12f)]('');}export async function upgradeApp(_0x1ea223,_0x35d8bc){const _0x2e0cf0=a177_0x3857b3,_0x4ace46=process['cwd'](),_0x1c91e6=analyse(_0x4ace46),_0xbf31d9=!_0x1c91e6[_0x2e0cf0(0xc2)]&&_0x1c91e6['oldArtifacts']['length']===0x0&&!_0x1c91e6[_0x2e0cf0(0xe4)]&&!_0x1c91e6[_0x2e0cf0(0xb7)]&&!_0x1c91e6['sdkUpgrade'];if(_0xbf31d9){console[_0x2e0cf0(0x12f)](a177_0x3b781c[_0x2e0cf0(0xf2)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x1c91e6);const _0x4981b1=!!(_0x35d8bc[_0x2e0cf0(0xca)]||_0x35d8bc['Y']||_0x1ea223);if(!_0x4981b1)try{const _0x4aec0d=await askConfirm(_0x2e0cf0(0x12b));if(!_0x4aec0d){console[_0x2e0cf0(0x12f)](a177_0x3b781c[_0x2e0cf0(0xb6)](_0x2e0cf0(0xc3)));return;}}catch(_0x560480){if(_0x560480?.[_0x2e0cf0(0xea)]==='CANCEL'){console[_0x2e0cf0(0x12f)](a177_0x3b781c[_0x2e0cf0(0xb6)](_0x2e0cf0(0xc3)));return;}throw _0x560480;}const _0x23e2f3=[],_0x23ff54=a177_0x8b40ee({'text':_0x2e0cf0(0xc1),'color':_0x2e0cf0(0x12d)})['start'](),_0x269ce9=execConfigMigration(_0x1c91e6,_0x4ace46);_0x23e2f3['push'](_0x269ce9),_0x23ff54[_0x269ce9['ok']?_0x2e0cf0(0x121):'fail'](_0x2e0cf0(0x11a)+(_0x269ce9['detail']??(_0x269ce9['ok']?'done':_0x2e0cf0(0xf0))));const _0x38bc60=resolve(_0x4ace46,_0x2e0cf0(0xd8)),_0x2739b0=a177_0x8b40ee({'text':_0x2e0cf0(0xce),'color':_0x2e0cf0(0x12d)})[_0x2e0cf0(0x114)]();if(existsSync(_0x38bc60))try{rmSync(_0x38bc60,{'recursive':!![],'force':!![]}),_0x2739b0[_0x2e0cf0(0x121)](_0x2e0cf0(0x122)),_0x23e2f3['push']({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x3b944f){_0x2739b0[_0x2e0cf0(0x113)](_0x2e0cf0(0xd0)+_0x3b944f[_0x2e0cf0(0xea)]),_0x23e2f3[_0x2e0cf0(0x128)]({'step':0x2,'label':_0x2e0cf0(0x103),'ok':![],'detail':_0x3b944f[_0x2e0cf0(0xea)]});}else _0x2739b0[_0x2e0cf0(0xf3)](_0x2e0cf0(0x10d)),_0x23e2f3['push']({'step':0x2,'label':_0x2e0cf0(0x103),'ok':!![],'detail':_0x2e0cf0(0xb8)});const _0x264685=a177_0x8b40ee({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x2e0cf0(0x12d)})['start'](),_0x265293=execRemoveOldArtifacts(_0x1c91e6[_0x2e0cf0(0xe9)]);_0x23e2f3['push'](_0x265293),_0x264685[_0x265293['ok']?_0x2e0cf0(0x121):_0x2e0cf0(0x113)](_0x2e0cf0(0x12a)+(_0x265293[_0x2e0cf0(0xc5)]??(_0x265293['ok']?'done':_0x2e0cf0(0xf0))));const _0x54ccae=a177_0x8b40ee({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':_0x2e0cf0(0x12d)})[_0x2e0cf0(0x114)](),_0xf2c3b2=execCleanMcp(_0x1c91e6);_0x23e2f3[_0x2e0cf0(0x128)](_0xf2c3b2),_0x54ccae[_0xf2c3b2['ok']?'succeed':'fail'](_0x2e0cf0(0x124)+(_0xf2c3b2['detail']??(_0xf2c3b2['ok']?_0x2e0cf0(0x12e):'failed')));const _0x5e5991=a177_0x8b40ee({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x2e0cf0(0x12d)})['start'](),_0x42f11e=execSkillsRemove(_0x4ace46,_0x4981b1);_0x23e2f3[_0x2e0cf0(0x128)](_0x42f11e),_0x5e5991[_0x42f11e['ok']?'succeed':_0x2e0cf0(0x113)](_0x2e0cf0(0xe2)+(_0x42f11e['detail']??(_0x42f11e['ok']?'done':'failed')));const _0x1de140=a177_0x8b40ee({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':_0x2e0cf0(0x12d)})[_0x2e0cf0(0x114)](),_0x43e4c2=execSkillsAdd(_0x4ace46,_0x4981b1);_0x23e2f3[_0x2e0cf0(0x128)](_0x43e4c2),_0x1de140[_0x43e4c2['ok']?_0x2e0cf0(0x121):_0x2e0cf0(0x113)](_0x2e0cf0(0xb9)+(_0x43e4c2[_0x2e0cf0(0xc5)]??(_0x43e4c2['ok']?_0x2e0cf0(0x12e):_0x2e0cf0(0xf0))));const _0x902b0b=a177_0x8b40ee({'text':'Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','color':'cyan'})['start'](),_0x9a8cbb=execUpgradeSdk(_0x1c91e6);_0x23e2f3['push'](_0x9a8cbb),_0x902b0b[_0x9a8cbb['ok']?_0x2e0cf0(0x121):'fail'](_0x2e0cf0(0xc8)+(_0x9a8cbb[_0x2e0cf0(0xc5)]??(_0x9a8cbb['ok']?_0x2e0cf0(0x12e):_0x2e0cf0(0xf0)))),printSummary(_0x23e2f3);const _0x25fbbb=_0x23e2f3[_0x2e0cf0(0x112)](_0x22ae95=>!_0x22ae95['ok']);_0x25fbbb?console[_0x2e0cf0(0x12f)](a177_0x3b781c[_0x2e0cf0(0x118)](_0x2e0cf0(0x11f))):console['log'](a177_0x3b781c[_0x2e0cf0(0xf2)](_0x2e0cf0(0xc7))),_0x9a8cbb['ok']&&_0x1c91e6[_0x2e0cf0(0xe7)]&&(console[_0x2e0cf0(0x12f)](''),console[_0x2e0cf0(0x12f)](a177_0x3b781c['bold']['cyan'](_0x2e0cf0(0xdd))),console[_0x2e0cf0(0x12f)](a177_0x3b781c[_0x2e0cf0(0x12d)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console[_0x2e0cf0(0x12f)](''),console[_0x2e0cf0(0x12f)](a177_0x3b781c['white'](_0x2e0cf0(0xc9))),console[_0x2e0cf0(0x12f)](a177_0x3b781c[_0x2e0cf0(0xef)](_0x2e0cf0(0xdb))),console['log'](a177_0x3b781c[_0x2e0cf0(0xef)](_0x2e0cf0(0x102))),console[_0x2e0cf0(0x12f)](''));}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a170_0x5bbc69=a170_0x407a;(function(_0x54cfc7,_0x31ed9a){const _0x414004=a170_0x407a,_0x534e80=_0x54cfc7();while(!![]){try{const _0x5991cc=-parseInt(_0x414004(0x8b))/0x1+parseInt(_0x414004(0xaa))/0x2+-parseInt(_0x414004(0x8e))/0x3*(parseInt(_0x414004(0xbd))/0x4)+-parseInt(_0x414004(0x68))/0x5*(-parseInt(_0x414004(0x7b))/0x6)+parseInt(_0x414004(0x85))/0x7+parseInt(_0x414004(0x99))/0x8*(-parseInt(_0x414004(0x8d))/0x9)+-parseInt(_0x414004(0x6d))/0xa;if(_0x5991cc===_0x31ed9a)break;else _0x534e80['push'](_0x534e80['shift']());}catch(_0x29739d){_0x534e80['push'](_0x534e80['shift']());}}}(a170_0x4d4f,0x2ac29));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';function a170_0x4d4f(){const _0x42cb8e=['`\x20instead.','rabetbase\x20kb\x20delete','app:add','Workspace','skill:install','rabetbase\x20run\x20build','map','272034ftDUzH','wildcardDef','rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml','Dataset\x20&\x20Operations','rabetbase\x20project\x20create\x20<project-name>','risk','skills:install','rabetbase\x20sql\x20create','filter','bff:new','logout','login','app:remote','rabetbase\x20auth\x20logout','build','Database\x20Connections','Roles','rabetbase\x20bff\x20create','read','32zXvohy','rabetbase\x20kb\x20create','Tenant\x20Members','hidden','Use\x20`','Run\x20any\x20package.json\x20script','\x20\x20[','Runtime\x20App\x20Config\x20Management','rabetbase\x20run\x20preview','\x20\x20[write]','1021315VoSQCt','Async\x20Tasks','write','Platform\x20Issue','sql:save','41770GCDZEa','project:init','rabetbase\x20app\x20list\x20--remote','sql:new','Quick\x20Start','Schema','command','Notification\x20Configuration','Permissions','isSingleCommand','set','create','app:use','BFF\x20Scripts','6VRCxJS','rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>','Configuration','SQL\x20Queries','values','Diagnostics','rabetbase\x20kb\x20detail','knowledge-base:create','knowledge-base:detail','start','1605170EZmpMj','run','`rabetbase\x20','push','knowledge-base:update','skill:','74137EtShkb','preview','8217ghscNa','38091pHqvxu','knowledge-base:delete','rabetbase\x20cli-skill\x20install','Instant\x20API','has','File','rabetbase\x20workspace\x20init\x20--appcode\x20<code>','Menu','get','app:remove','install','1880tIFXXy','Run\x20Scripts','OCR','commands','Self\x20Update','User\x20Accounts','service','rabetbase\x20workspace\x20remove\x20<name>','Company\x20Knowledge\x20Base','defaultCommand'];a170_0x4d4f=function(){return _0x42cb8e;};return a170_0x4d4f();}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';function a170_0x407a(_0x7ef521,_0x27e35c){_0x7ef521=_0x7ef521-0x66;const _0x4d4ff1=a170_0x4d4f();let _0x407a9f=_0x4d4ff1[_0x7ef521];return _0x407a9f;}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(_0x177cc7){const _0x27b10e=a170_0x407a;for(const _0x5c910a of _0x177cc7){definitions[_0x27b10e(0x77)](_0x5c910a['service']+':'+_0x5c910a[_0x27b10e(0x73)],_0x5c910a);let _0x1b4bc2=serviceGroups[_0x27b10e(0x96)](_0x5c910a[_0x27b10e(0x9f)]);!_0x1b4bc2&&(_0x1b4bc2=[],serviceGroups[_0x27b10e(0x77)](_0x5c910a[_0x27b10e(0x9f)],_0x1b4bc2)),_0x1b4bc2[_0x27b10e(0x88)](_0x5c910a);}}function registerDeclarativeService(_0x398a14,_0x41167f,_0x29f1d7){const _0x408dd9=a170_0x407a;registerDefinitions(_0x41167f);_0x29f1d7?.[_0x408dd9(0xab)]&®isterDefinitions([_0x29f1d7[_0x408dd9(0xab)]]);const _0x52203f=_0x523ce5=>_0x523ce5===_0x408dd9(0xbc)?'':_0x523ce5===_0x408dd9(0x6a)?_0x408dd9(0x67):'\x20\x20[high-risk-write]',_0x45dfcb={'service':_0x41167f[0x0][_0x408dd9(0x9f)],'label':_0x398a14,'commands':_0x41167f[_0x408dd9(0xb2)](_0x3b7fe4=>!_0x3b7fe4[_0x408dd9(0xc0)])[_0x408dd9(0xa9)](_0x49a022=>({'command':_0x49a022[_0x408dd9(0x73)],'description':_0x49a022['description'],'tag':_0x52203f(_0x49a022[_0x408dd9(0xaf)])})),'declarative':!![],'defaultCommand':_0x29f1d7?.[_0x408dd9(0xa2)]??(_0x29f1d7?.[_0x408dd9(0x76)]?_0x41167f[0x0][_0x408dd9(0x73)]:undefined),'wildcardDef':_0x29f1d7?.[_0x408dd9(0xab)],'isSingleCommand':_0x29f1d7?.[_0x408dd9(0x76)]};serviceRegistry[_0x408dd9(0x88)](_0x45dfcb),serviceByName[_0x408dd9(0x77)](_0x45dfcb['service'],_0x45dfcb);}registerDeclarativeService(a170_0x5bbc69(0x71),initDefinitions,{'defaultCommand':a170_0x5bbc69(0x86),'isSingleCommand':!![]}),registerDeclarativeService('Project',projectDefinitions),registerDeclarativeService(a170_0x5bbc69(0xa6),workspaceDefinitions),registerDeclarativeService('App\x20Management',appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a170_0x5bbc69(0xb5)}),registerDeclarativeService(a170_0x5bbc69(0xbf),tenantDefinitions),registerDeclarativeService(a170_0x5bbc69(0x9e),userAccountDefinitions),registerDeclarativeService(a170_0x5bbc69(0xad),datasetDefinitions),registerDeclarativeService('Smart\x20List\x20Pages\x20&\x20React\x20Custom\x20Pages',pageDefinitions),registerDeclarativeService('API\x20Development',apiDefinitions),registerDeclarativeService(a170_0x5bbc69(0x91),dataDefinitions),registerDeclarativeService(a170_0x5bbc69(0x7a),bffDefinitions),registerDeclarativeService(a170_0x5bbc69(0x74),notificationDefinitions),registerDeclarativeService(a170_0x5bbc69(0x7e),sqlDefinitions),registerDeclarativeService(a170_0x5bbc69(0xb9),dbDefinitions),registerDeclarativeService(a170_0x5bbc69(0x95),menuDefinitions),registerDeclarativeService(a170_0x5bbc69(0x69),taskDefinitions),registerDeclarativeService(a170_0x5bbc69(0xba),roleDefinitions),registerDeclarativeService(a170_0x5bbc69(0x75),permitDefinitions),registerDeclarativeService(a170_0x5bbc69(0xc4),appConfigDefinitions),registerDeclarativeService(a170_0x5bbc69(0xa1),kbDefinitions),registerDeclarativeService(a170_0x5bbc69(0x6b),issueDefinitions),registerDeclarativeService(a170_0x5bbc69(0x93),fileDefinitions),registerDeclarativeService(a170_0x5bbc69(0x9b),ocrDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService(a170_0x5bbc69(0x7d),configDefinitions),registerDeclarativeService(a170_0x5bbc69(0x80),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0x5bbc69(0x72),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0x5bbc69(0x9d),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a170_0x5bbc69(0x98)}),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':'show'}),registerDeclarativeService(a170_0x5bbc69(0x9a),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry['length']-0x1];last[a170_0x5bbc69(0x9c)]=[{'command':'<script>','description':a170_0x5bbc69(0xc2),'tag':a170_0x5bbc69(0xc3)+runDefinition[a170_0x5bbc69(0xaf)]+']'}];}const REMOVED_COMMAND_REPLACEMENTS=new Map([[a170_0x5bbc69(0x6c),a170_0x5bbc69(0xac)],[a170_0x5bbc69(0xb3),a170_0x5bbc69(0xbb)],[a170_0x5bbc69(0x70),a170_0x5bbc69(0xb1)],['menu:update','rabetbase\x20menu\x20asset-update'],[a170_0x5bbc69(0x6e),a170_0x5bbc69(0x94)],[a170_0x5bbc69(0x8a),'rabetbase\x20cli-skill\x20install'],[a170_0x5bbc69(0xa7),a170_0x5bbc69(0x90)],['skills:',a170_0x5bbc69(0x90)],[a170_0x5bbc69(0xb0),a170_0x5bbc69(0x90)],[a170_0x5bbc69(0xb6),a170_0x5bbc69(0x6f)],[a170_0x5bbc69(0x79),'rabetbase\x20workspace\x20use\x20--app\x20<name>'],[a170_0x5bbc69(0xa5),a170_0x5bbc69(0x7c)],[a170_0x5bbc69(0x97),a170_0x5bbc69(0xa0)],['knowledge-base:list','rabetbase\x20kb\x20list'],[a170_0x5bbc69(0x83),a170_0x5bbc69(0x81)],[a170_0x5bbc69(0x82),a170_0x5bbc69(0xbe)],[a170_0x5bbc69(0x89),'rabetbase\x20kb\x20update'],[a170_0x5bbc69(0x8f),a170_0x5bbc69(0xa4)]]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([[a170_0x5bbc69(0x78),a170_0x5bbc69(0xae)],[a170_0x5bbc69(0x84),'rabetbase\x20run\x20start'],[a170_0x5bbc69(0xb8),a170_0x5bbc69(0xa8)],[a170_0x5bbc69(0x8c),a170_0x5bbc69(0x66)],[a170_0x5bbc69(0xb4),a170_0x5bbc69(0xb7)]]);export function resolveRemovedCommand(_0x5d1961,_0x44663d){const _0x124d80=a170_0x5bbc69;if(!_0x5d1961)return undefined;const _0x3d5122=REMOVED_COMMAND_REPLACEMENTS[_0x124d80(0x96)](_0x5d1961+':'+(_0x44663d??'')),_0xa58386=REMOVED_FLAT_COMMAND_REPLACEMENTS['get'](_0x5d1961),_0x137d43=_0x3d5122??_0xa58386;if(!_0x137d43)return undefined;const _0x361d8b=_0xa58386?_0x5d1961:_0x44663d?_0x5d1961+'\x20'+_0x44663d:_0x5d1961;return{'command':_0x361d8b,'message':_0x124d80(0x87)+_0x361d8b+'`\x20has\x20been\x20removed.','hint':_0x124d80(0xc1)+_0x137d43+_0x124d80(0xa3)};}export function findDefinition(_0x2e7281,_0x3d2ebe){const _0x2d0c52=a170_0x5bbc69;return definitions[_0x2d0c52(0x96)](_0x2e7281+':'+_0x3d2ebe);}export function isKnownService(_0x577291){const _0x286679=a170_0x5bbc69;return serviceByName[_0x286679(0x92)](_0x577291);}export function isDeclarativeService(_0x5ce6e7){const _0xcf66d5=a170_0x5bbc69;return serviceGroups[_0xcf66d5(0x92)](_0x5ce6e7)||serviceByName['get'](_0x5ce6e7)?.[_0xcf66d5(0xab)]!==undefined;}export function getServiceEntry(_0x4e5bbc){return serviceByName['get'](_0x4e5bbc);}export function getLegacyHandler(_0x50b838,_0x1b981b){return undefined;}export function getAllDefinitions(){const _0x250fb9=a170_0x5bbc69;return Array['from'](definitions[_0x250fb9(0x7f)]());}
|
|
1
|
+
const a178_0x58ebe4=a178_0xfa01;(function(_0x317d99,_0x6895a7){const _0x5151d1=a178_0xfa01,_0x28d514=_0x317d99();while(!![]){try{const _0xb99ac5=parseInt(_0x5151d1(0xba))/0x1+parseInt(_0x5151d1(0xbd))/0x2*(parseInt(_0x5151d1(0xb2))/0x3)+-parseInt(_0x5151d1(0xe3))/0x4*(parseInt(_0x5151d1(0x10a))/0x5)+parseInt(_0x5151d1(0xd1))/0x6+-parseInt(_0x5151d1(0xc7))/0x7*(-parseInt(_0x5151d1(0xdf))/0x8)+parseInt(_0x5151d1(0xe4))/0x9*(parseInt(_0x5151d1(0xd5))/0xa)+-parseInt(_0x5151d1(0xd8))/0xb*(parseInt(_0x5151d1(0x102))/0xc);if(_0xb99ac5===_0x6895a7)break;else _0x28d514['push'](_0x28d514['shift']());}catch(_0x167fbe){_0x28d514['push'](_0x28d514['shift']());}}}(a178_0x6514,0xcd8fc));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';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';export const serviceRegistry=[];const serviceByName=new Map();function a178_0x6514(){const _0x143525=['rabetbase\x20sql\x20create','project:init','Configuration','7xTrrWh','Permissions','read','Run\x20any\x20package.json\x20script','has','menu:update','skills:install','rabetbase\x20menu\x20asset-update','File','rabetbase\x20app\x20list\x20--remote','3538404eOrmDn','API\x20Development','Logs','Use\x20`','114020rQpVeZ','run','\x20\x20[','14817jeMOff','push','rabetbase\x20auth\x20logout','rabetbase\x20kb\x20detail','rabetbase\x20kb\x20update','bff:new','hidden','1368184iHTZZu','Authentication','defaultCommand','BFF\x20Scripts','16oiLWfc','747AadRSU','OCR','Quick\x20Start','rabetbase\x20workspace\x20use\x20--app\x20<name>','Tenant\x20Members','set','knowledge-base:delete','commands','rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>','values','Smart\x20List\x20Pages\x20&\x20React\x20Custom\x20Pages','Database\x20Connections','rabetbase\x20kb\x20list','Notification\x20Configuration','create','write','Code\x20Generation','rabetbase\x20run\x20preview','wildcardDef','Roles','skills:','description','Schema','Project','rabetbase\x20workspace\x20remove\x20<name>','map','show','rabetbase\x20kb\x20delete','filter','app:add','30288NtxzJu','rabetbase\x20run\x20build','Menu','rabetbase\x20kb\x20create','skill:install','`\x20instead.','app:remove','rabetbase\x20project\x20create\x20<project-name>','694615AXwXNl','\x20\x20[write]','knowledge-base:create','rabetbase\x20cli-skill\x20install','App\x20Management','isSingleCommand','skill:','sql:new','from','366mtuoZa','SQL\x20Queries','Runtime\x20App\x20Config\x20Management','service','start','command','rabetbase\x20bff\x20create','Workspace','1478269rxNFtj','\x20\x20[high-risk-write]','logout','26428kGnmnD','rabetbase\x20run\x20start','install','get','app:use','length','knowledge-base:list'];a178_0x6514=function(){return _0x143525;};return a178_0x6514();}export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x3ad901){const _0x33ed8a=a178_0xfa01;for(const _0x164f44 of _0x3ad901){definitions[_0x33ed8a(0xe9)](_0x164f44[_0x33ed8a(0xb5)]+':'+_0x164f44[_0x33ed8a(0xb7)],_0x164f44);let _0x49f74e=serviceGroups[_0x33ed8a(0xc0)](_0x164f44[_0x33ed8a(0xb5)]);!_0x49f74e&&(_0x49f74e=[],serviceGroups[_0x33ed8a(0xe9)](_0x164f44[_0x33ed8a(0xb5)],_0x49f74e)),_0x49f74e[_0x33ed8a(0xd9)](_0x164f44);}}function registerDeclarativeService(_0x2afaf1,_0x5511bd,_0x6c5979){const _0x468b2c=a178_0xfa01;registerDefinitions(_0x5511bd);_0x6c5979?.[_0x468b2c(0xf6)]&®isterDefinitions([_0x6c5979['wildcardDef']]);const _0x326087=_0x47e2bd=>_0x47e2bd===_0x468b2c(0xc9)?'':_0x47e2bd===_0x468b2c(0xf3)?_0x468b2c(0x10b):_0x468b2c(0xbb),_0x368c5={'service':_0x5511bd[0x0]['service'],'label':_0x2afaf1,'commands':_0x5511bd[_0x468b2c(0x100)](_0x13142c=>!_0x13142c[_0x468b2c(0xde)])[_0x468b2c(0xfd)](_0x3a202f=>({'command':_0x3a202f[_0x468b2c(0xb7)],'description':_0x3a202f[_0x468b2c(0xf9)],'tag':_0x326087(_0x3a202f['risk'])})),'declarative':!![],'defaultCommand':_0x6c5979?.[_0x468b2c(0xe1)]??(_0x6c5979?.[_0x468b2c(0x10f)]?_0x5511bd[0x0]['command']:undefined),'wildcardDef':_0x6c5979?.[_0x468b2c(0xf6)],'isSingleCommand':_0x6c5979?.[_0x468b2c(0x10f)]};serviceRegistry[_0x468b2c(0xd9)](_0x368c5),serviceByName[_0x468b2c(0xe9)](_0x368c5[_0x468b2c(0xb5)],_0x368c5);}registerDeclarativeService(a178_0x58ebe4(0xe6),initDefinitions,{'defaultCommand':a178_0x58ebe4(0xd6),'isSingleCommand':!![]}),registerDeclarativeService(a178_0x58ebe4(0xfb),projectDefinitions),registerDeclarativeService(a178_0x58ebe4(0xb9),workspaceDefinitions),registerDeclarativeService(a178_0x58ebe4(0x10e),appDefinitions),registerDeclarativeService(a178_0x58ebe4(0xe0),authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService(a178_0x58ebe4(0xe8),tenantDefinitions),registerDeclarativeService('User\x20Accounts',userAccountDefinitions),registerDeclarativeService('Dataset\x20&\x20Operations',datasetDefinitions),registerDeclarativeService(a178_0x58ebe4(0xee),pageDefinitions),registerDeclarativeService(a178_0x58ebe4(0xd2),apiDefinitions),registerDeclarativeService('Instant\x20API',dataDefinitions),registerDeclarativeService(a178_0x58ebe4(0xe2),bffDefinitions),registerDeclarativeService(a178_0x58ebe4(0xf1),notificationDefinitions),registerDeclarativeService(a178_0x58ebe4(0xb3),sqlDefinitions),registerDeclarativeService(a178_0x58ebe4(0xef),dbDefinitions),registerDeclarativeService(a178_0x58ebe4(0x104),menuDefinitions),registerDeclarativeService('Async\x20Tasks',taskDefinitions),registerDeclarativeService(a178_0x58ebe4(0xf7),roleDefinitions),registerDeclarativeService(a178_0x58ebe4(0xc8),permitDefinitions),registerDeclarativeService(a178_0x58ebe4(0xb4),appConfigDefinitions),registerDeclarativeService('Company\x20Knowledge\x20Base',kbDefinitions),registerDeclarativeService('Platform\x20Issue',issueDefinitions),registerDeclarativeService(a178_0x58ebe4(0xcf),fileDefinitions),registerDeclarativeService(a178_0x58ebe4(0xe5),ocrDefinitions),registerDeclarativeService(a178_0x58ebe4(0xf4),codegenDefinitions),registerDeclarativeService(a178_0x58ebe4(0xc6),configDefinitions),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a178_0x58ebe4(0xfa),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Self\x20Update',[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a178_0x58ebe4(0xbf)}),registerDeclarativeService(a178_0x58ebe4(0xd3),logsDefinitions,{'defaultCommand':a178_0x58ebe4(0xfe)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a178_0x58ebe4(0xc2)]-0x1];last[a178_0x58ebe4(0xeb)]=[{'command':'<script>','description':a178_0x58ebe4(0xca),'tag':a178_0x58ebe4(0xd7)+runDefinition['risk']+']'}];}function a178_0xfa01(_0x533571,_0x25bbd1){_0x533571=_0x533571-0xb2;const _0x6514d=a178_0x6514();let _0xfa01d6=_0x6514d[_0x533571];return _0xfa01d6;}const REMOVED_COMMAND_REPLACEMENTS=new Map([['sql:save','rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml'],[a178_0x58ebe4(0xdd),a178_0x58ebe4(0xb8)],[a178_0x58ebe4(0x111),a178_0x58ebe4(0xc4)],[a178_0x58ebe4(0xcc),a178_0x58ebe4(0xce)],[a178_0x58ebe4(0xc5),'rabetbase\x20workspace\x20init\x20--appcode\x20<code>'],[a178_0x58ebe4(0x110),a178_0x58ebe4(0x10d)],[a178_0x58ebe4(0x106),a178_0x58ebe4(0x10d)],[a178_0x58ebe4(0xf8),a178_0x58ebe4(0x10d)],[a178_0x58ebe4(0xcd),a178_0x58ebe4(0x10d)],['app:remote',a178_0x58ebe4(0xd0)],[a178_0x58ebe4(0xc1),a178_0x58ebe4(0xe7)],[a178_0x58ebe4(0x101),a178_0x58ebe4(0xec)],[a178_0x58ebe4(0x108),a178_0x58ebe4(0xfc)],[a178_0x58ebe4(0xc3),a178_0x58ebe4(0xf0)],['knowledge-base:detail',a178_0x58ebe4(0xdb)],[a178_0x58ebe4(0x10c),a178_0x58ebe4(0x105)],['knowledge-base:update',a178_0x58ebe4(0xdc)],[a178_0x58ebe4(0xea),a178_0x58ebe4(0xff)]]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([[a178_0x58ebe4(0xf2),a178_0x58ebe4(0x109)],[a178_0x58ebe4(0xb6),a178_0x58ebe4(0xbe)],['build',a178_0x58ebe4(0x103)],['preview',a178_0x58ebe4(0xf5)],[a178_0x58ebe4(0xbc),a178_0x58ebe4(0xda)]]);export function resolveRemovedCommand(_0x18c12a,_0x455c34){const _0x47e995=a178_0x58ebe4;if(!_0x18c12a)return undefined;const _0x315ff9=REMOVED_COMMAND_REPLACEMENTS['get'](_0x18c12a+':'+(_0x455c34??'')),_0x568296=REMOVED_FLAT_COMMAND_REPLACEMENTS[_0x47e995(0xc0)](_0x18c12a),_0x1aff07=_0x315ff9??_0x568296;if(!_0x1aff07)return undefined;const _0x65317f=_0x568296?_0x18c12a:_0x455c34?_0x18c12a+'\x20'+_0x455c34:_0x18c12a;return{'command':_0x65317f,'message':'`rabetbase\x20'+_0x65317f+'`\x20has\x20been\x20removed.','hint':_0x47e995(0xd4)+_0x1aff07+_0x47e995(0x107)};}export function findDefinition(_0x35f5ed,_0x2d60d1){const _0x559f8d=a178_0x58ebe4;return definitions[_0x559f8d(0xc0)](_0x35f5ed+':'+_0x2d60d1);}export function isKnownService(_0x334c61){const _0x53a810=a178_0x58ebe4;return serviceByName[_0x53a810(0xcb)](_0x334c61);}export function isDeclarativeService(_0x53d97f){const _0x3346fc=a178_0x58ebe4;return serviceGroups[_0x3346fc(0xcb)](_0x53d97f)||serviceByName['get'](_0x53d97f)?.[_0x3346fc(0xf6)]!==undefined;}export function getServiceEntry(_0x28bd49){return serviceByName['get'](_0x28bd49);}export function getLegacyHandler(_0x35655b,_0x1b9719){return undefined;}export function getAllDefinitions(){const _0x443329=a178_0x58ebe4;return Array[_0x443329(0x112)](definitions[_0x443329(0xed)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a179_0x1b99db=a179_0x6d58;function a179_0x6d58(_0xa4ac82,_0x58a902){_0xa4ac82=_0xa4ac82-0x115;const _0xea56e9=a179_0xea56();let _0x6d5888=_0xea56e9[_0xa4ac82];return _0x6d5888;}(function(_0x108128,_0x23dee7){const _0x138577=a179_0x6d58,_0x878f79=_0x108128();while(!![]){try{const _0x2384e2=parseInt(_0x138577(0x12a))/0x1+-parseInt(_0x138577(0x12d))/0x2+-parseInt(_0x138577(0x129))/0x3*(parseInt(_0x138577(0x11a))/0x4)+parseInt(_0x138577(0x116))/0x5*(parseInt(_0x138577(0x119))/0x6)+parseInt(_0x138577(0x122))/0x7+-parseInt(_0x138577(0x11b))/0x8+parseInt(_0x138577(0x128))/0x9*(parseInt(_0x138577(0x124))/0xa);if(_0x2384e2===_0x23dee7)break;else _0x878f79['push'](_0x878f79['shift']());}catch(_0x5af5a4){_0x878f79['push'](_0x878f79['shift']());}}}(a179_0xea56,0x7e39e));function a179_0xea56(){const _0x18a631=['name','trim','894005TgHzXS','str','77810QTlqyc','remark','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','Pass\x20--name\x20<roleName>.','1494RKSmjW','679911hxZpox','318720dsyoBx','flagMissing','write','1770346ZMSeox','validation','roleName','POST','CUSTOM','5cQLpQL','\x20(id=','role','2728002bNKoYF','12FyUrMy','885136capamr','length','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','appCode','create'];a179_0xea56=function(){return _0x18a631;};return a179_0xea56();}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='/smartapi/permit/role/create';function readName(_0x31851f){const _0xc4e514=a179_0x6d58,_0x557b14=_0x31851f[_0xc4e514(0x123)](_0xc4e514(0x120))[_0xc4e514(0x121)]();if(!_0x557b14)throw CliErrors[_0xc4e514(0x12b)](_0xc4e514(0x120),_0xc4e514(0x127));if(_0x557b14[_0xc4e514(0x11c)]>0x40)throw CliErrors[_0xc4e514(0x12e)](_0xc4e514(0x126));return _0x557b14;}export const roleCreate={'service':a179_0x1b99db(0x118),'command':a179_0x1b99db(0x11f),'description':a179_0x1b99db(0x11d),'risk':a179_0x1b99db(0x12c),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x575ee4){readName(_0x575ee4);},async 'dryRun'(_0x1086a3){const _0x383079=a179_0x1b99db,_0xfe6be3=readName(_0x1086a3),_0x3a1218=_0x1086a3[_0x383079(0x123)]('remark')[_0x383079(0x121)]()||undefined;return asDryRunResult({'operation':_0x383079(0x11f),'selector':{'appCode':_0x1086a3[_0x383079(0x11e)],'roleName':_0xfe6be3},'before':null,'after':{'roleName':_0xfe6be3,'roleType':_0x383079(0x115),'remark':_0x3a1218},'dryRun':!![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},{'method':'POST','url':CREATE_PATH});},async 'execute'(_0x52e1f0){const _0x51aaaa=a179_0x1b99db,_0x154105=readName(_0x52e1f0),_0x1bafef=_0x52e1f0['str'](_0x51aaaa(0x125))[_0x51aaaa(0x121)]()||undefined,_0x3adcaa=await createAppRole({'appCode':_0x52e1f0[_0x51aaaa(0x11e)],'roleName':_0x154105,..._0x1bafef?{'remark':_0x1bafef}:{}});return{'ok':!![],'data':{'operation':_0x51aaaa(0x11f),'selector':{'appCode':_0x52e1f0[_0x51aaaa(0x11e)],'roleId':_0x3adcaa['id'],'roleName':_0x154105},'before':null,'after':projectRole(_0x3adcaa),'dryRun':![],'backend':{'method':_0x51aaaa(0x130),'path':CREATE_PATH},'warnings':[]},'message':'Created\x20role\x20'+_0x3adcaa[_0x51aaaa(0x12f)]+_0x51aaaa(0x117)+_0x3adcaa['id']+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a180_0x3a0bb8=a180_0x51e8;(function(_0x552da6,_0x466edb){const _0x2213ee=a180_0x51e8,_0x485c42=_0x552da6();while(!![]){try{const _0x50a94e=parseInt(_0x2213ee(0x1e5))/0x1*(-parseInt(_0x2213ee(0x1d8))/0x2)+parseInt(_0x2213ee(0x1d2))/0x3+parseInt(_0x2213ee(0x1df))/0x4+-parseInt(_0x2213ee(0x1d9))/0x5*(-parseInt(_0x2213ee(0x1e1))/0x6)+parseInt(_0x2213ee(0x1d6))/0x7*(-parseInt(_0x2213ee(0x1da))/0x8)+-parseInt(_0x2213ee(0x1e3))/0x9+parseInt(_0x2213ee(0x1e7))/0xa;if(_0x50a94e===_0x466edb)break;else _0x485c42['push'](_0x485c42['shift']());}catch(_0x52509f){_0x485c42['push'](_0x485c42['shift']());}}}(a180_0x3d64,0x4f4a4));function a180_0x51e8(_0x917a29,_0x2cf9d6){_0x917a29=_0x917a29-0x1d0;const _0x3d64af=a180_0x3d64();let _0x51e84f=_0x3d64af[_0x917a29];return _0x51e84f;}import{deleteAppRole}from'../../core/api-client.js';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';const DELETE_PATH=a180_0x3a0bb8(0x1dd);function a180_0x3d64(){const _0x453a1e=['787805puaSOV','8qaSqTK','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','/smartapi/permit/role/delete','Deleted\x20role\x20','597680qsvuVb','high-risk-write','6hHVqVW','POST','734337ickvtb','num','4561PNwpAE','role','4942780gTPeXg','delete','Role\x20still\x20has\x20','1167165oIOCpu','appCode','userCount','roleName','3699731NUNeDx','\x20(id=','112qKdBdC'];a180_0x3d64=function(){return _0x453a1e;};return a180_0x3d64();}export const roleDelete={'service':a180_0x3a0bb8(0x1e6),'command':a180_0x3a0bb8(0x1d0),'description':a180_0x3a0bb8(0x1dc),'risk':a180_0x3a0bb8(0x1e0),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4a984f){const _0x8e6faf=a180_0x3a0bb8,_0x86f2b9=_0x4a984f[_0x8e6faf(0x1e4)]('id'),_0x2cb8ab=await getRoleById(_0x4a984f[_0x8e6faf(0x1d3)],_0x86f2b9);return assertCustomRole(_0x2cb8ab,'delete'),asDryRunResult({'operation':_0x8e6faf(0x1d0),'selector':{'appCode':_0x4a984f[_0x8e6faf(0x1d3)],'roleId':_0x86f2b9,'roleName':_0x2cb8ab[_0x8e6faf(0x1d5)]},'before':projectRole(_0x2cb8ab),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x2cb8ab[_0x8e6faf(0x1d4)]>0x0?[_0x8e6faf(0x1d1)+_0x2cb8ab[_0x8e6faf(0x1d4)]+_0x8e6faf(0x1db)]:[]},{'method':_0x8e6faf(0x1e2),'url':DELETE_PATH});},async 'execute'(_0x1707e0){const _0x4d9f94=a180_0x3a0bb8,_0x39b2ab=_0x1707e0[_0x4d9f94(0x1e4)]('id'),_0x1fa569=await getRoleById(_0x1707e0['appCode'],_0x39b2ab);return assertCustomRole(_0x1fa569,_0x4d9f94(0x1d0)),await deleteAppRole(_0x39b2ab),{'ok':!![],'data':{'operation':_0x4d9f94(0x1d0),'selector':{'appCode':_0x1707e0['appCode'],'roleId':_0x39b2ab,'roleName':_0x1fa569[_0x4d9f94(0x1d5)]},'before':projectRole(_0x1fa569),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x4d9f94(0x1de)+_0x1fa569[_0x4d9f94(0x1d5)]+_0x4d9f94(0x1d7)+_0x39b2ab+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a181_0x2750(_0x4523fd,_0x537332){_0x4523fd=_0x4523fd-0xa2;const _0xad9d6a=a181_0xad9d();let _0x27500=_0xad9d6a[_0x4523fd];return _0x27500;}const a181_0xecf88d=a181_0x2750;function a181_0xad9d(){const _0x2f5285=['roleName','6CdwplK','744566JgnxMP','roleType','3852425rcBCFL','Role\x20','138245cUmdMs','5205116JpnqPc','Show\x20a\x20single\x20role\x27s\x20detail','3VGtcAN','role','appCode','4770381ObBIqP','num','3441064ddYzxK','16820667CKPLHY','detail'];a181_0xad9d=function(){return _0x2f5285;};return a181_0xad9d();}(function(_0xe55e1f,_0x2f05db){const _0x3f2dc1=a181_0x2750,_0x5e776a=_0xe55e1f();while(!![]){try{const _0x2560f5=-parseInt(_0x3f2dc1(0xa6))/0x1+parseInt(_0x3f2dc1(0xa2))/0x2+parseInt(_0x3f2dc1(0xa9))/0x3*(parseInt(_0x3f2dc1(0xa7))/0x4)+-parseInt(_0x3f2dc1(0xa4))/0x5*(-parseInt(_0x3f2dc1(0xb2))/0x6)+parseInt(_0x3f2dc1(0xac))/0x7+-parseInt(_0x3f2dc1(0xae))/0x8+-parseInt(_0x3f2dc1(0xaf))/0x9;if(_0x2560f5===_0x2f05db)break;else _0x5e776a['push'](_0x5e776a['shift']());}catch(_0x958334){_0x5e776a['push'](_0x5e776a['shift']());}}}(a181_0xad9d,0xa803d));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a181_0xecf88d(0xaa),'command':a181_0xecf88d(0xb0),'description':a181_0xecf88d(0xa8),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x332b66){const _0x43702e=a181_0xecf88d,_0x580241=_0x332b66[_0x43702e(0xad)]('id'),_0x3fa935=await getRoleById(_0x332b66[_0x43702e(0xab)],_0x580241);return{'ok':!![],'data':{'role':projectRole(_0x3fa935)},'message':_0x43702e(0xa5)+_0x3fa935[_0x43702e(0xb1)]+'\x20('+_0x3fa935[_0x43702e(0xa3)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a182_0x45a4(_0x4d3fb4,_0x1d9c74){_0x4d3fb4=_0x4d3fb4-0xb3;const _0x6e5e1c=a182_0x6e5e();let _0x45a44d=_0x6e5e1c[_0x4d3fb4];return _0x45a44d;}(function(_0x4562ec,_0x1658f7){const _0x3aff4a=a182_0x45a4,_0x2dd54a=_0x4562ec();while(!![]){try{const _0x382efc=-parseInt(_0x3aff4a(0xb4))/0x1*(-parseInt(_0x3aff4a(0xb9))/0x2)+-parseInt(_0x3aff4a(0xb3))/0x3+parseInt(_0x3aff4a(0xbd))/0x4*(parseInt(_0x3aff4a(0xb8))/0x5)+parseInt(_0x3aff4a(0xb6))/0x6+-parseInt(_0x3aff4a(0xb5))/0x7*(-parseInt(_0x3aff4a(0xba))/0x8)+-parseInt(_0x3aff4a(0xbc))/0x9*(-parseInt(_0x3aff4a(0xbb))/0xa)+-parseInt(_0x3aff4a(0xb7))/0xb;if(_0x382efc===_0x1658f7)break;else _0x2dd54a['push'](_0x2dd54a['shift']());}catch(_0x32c22d){_0x2dd54a['push'](_0x2dd54a['shift']());}}}(a182_0x6e5e,0xb17a8));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 a182_0x6e5e(){const _0x2f93e4=['18ZpuoAD','220676vzjqKr','1444155XIumco','285742GYsLgD','134631jHlqkF','2788110CfZGhw','32130428UPLSSx','130idhfVo','10ylHaPF','288BZkQqb','545540YmCXcj'];a182_0x6e5e=function(){return _0x2f93e4;};return a182_0x6e5e();}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 a183_0x1eb610=a183_0x3b2a;function a183_0x3d0e(){const _0x1d865a=['1131114ZzYdbP','21790980lcLRbo','str','list','Invalid\x20--type\x20\x22','ADMIN','USER','page','Use\x20one\x20of:\x20','number','num','83499eXDNyN','join','24AGEmQs','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','8738112DPeSAm','Page\x20size\x20(1-100)','type','validation','toUpperCase','appCode','DEV','string','role','map','Page\x20index\x20(1-based)','pagesize','5pyqKHp','trim','1271996DDjjNG','927573QshHEE','roleType','includes','2997442fcacNz','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','\x20role(s)','Filter\x20by\x20role\x20type'];a183_0x3d0e=function(){return _0x1d865a;};return a183_0x3d0e();}(function(_0x2cc5fc,_0x9e29c2){const _0x2e939f=a183_0x3b2a,_0x4dec91=_0x2cc5fc();while(!![]){try{const _0x5b6220=-parseInt(_0x2e939f(0x11a))/0x1+-parseInt(_0x2e939f(0x119))/0x2+parseInt(_0x2e939f(0x107))/0x3*(parseInt(_0x2e939f(0x109))/0x4)+parseInt(_0x2e939f(0x117))/0x5*(parseInt(_0x2e939f(0x121))/0x6)+parseInt(_0x2e939f(0x11d))/0x7+-parseInt(_0x2e939f(0x10b))/0x8+parseInt(_0x2e939f(0x122))/0x9;if(_0x5b6220===_0x9e29c2)break;else _0x4dec91['push'](_0x4dec91['shift']());}catch(_0x249431){_0x4dec91['push'](_0x4dec91['shift']());}}}(a183_0x3d0e,0x860f4));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a183_0x3b2a(_0xf5aa7a,_0x2d876a){_0xf5aa7a=_0xf5aa7a-0x107;const _0x3d0e5a=a183_0x3d0e();let _0x3b2ac8=_0x3d0e5a[_0xf5aa7a];return _0x3b2ac8;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a183_0x1eb610(0x126),a183_0x1eb610(0x111),a183_0x1eb610(0x127),'CUSTOM'];export const roleList={'service':a183_0x1eb610(0x113),'command':a183_0x1eb610(0x124),'description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':a183_0x1eb610(0x112),'required':![],'description':a183_0x1eb610(0x120),'enum':ROLE_TYPES},{'name':'page','type':a183_0x1eb610(0x12a),'description':a183_0x1eb610(0x115),'default':0x1},{'name':a183_0x1eb610(0x116),'type':a183_0x1eb610(0x12a),'description':a183_0x1eb610(0x10c),'default':0x64}],async 'validate'(_0x5ea7ba){const _0x4dbecd=a183_0x1eb610,_0x44a3f8=_0x5ea7ba['str'](_0x4dbecd(0x10d))[_0x4dbecd(0x118)]();if(_0x44a3f8&&!ROLE_TYPES[_0x4dbecd(0x11c)](_0x44a3f8[_0x4dbecd(0x10f)]()))throw CliErrors[_0x4dbecd(0x10e)](_0x4dbecd(0x125)+_0x44a3f8+'\x22.',_0x4dbecd(0x129)+ROLE_TYPES[_0x4dbecd(0x108)](',\x20')+'.');const _0x55d73c=_0x5ea7ba[_0x4dbecd(0x12b)](_0x4dbecd(0x128),0x1),_0x1426fe=_0x5ea7ba[_0x4dbecd(0x12b)]('pagesize',0x64);if(_0x55d73c<0x1)throw CliErrors['validation'](_0x4dbecd(0x11e));if(_0x1426fe<0x1||_0x1426fe>0x64)throw CliErrors[_0x4dbecd(0x10e)](_0x4dbecd(0x10a));},async 'execute'(_0x5e468e){const _0x1c95fa=a183_0x1eb610,_0x441b54=_0x5e468e[_0x1c95fa(0x12b)]('page',0x1)||0x1,_0x284a68=_0x5e468e[_0x1c95fa(0x12b)](_0x1c95fa(0x116),0x64)||0x64,_0x3b4321=_0x5e468e[_0x1c95fa(0x123)]('type')[_0x1c95fa(0x118)]()[_0x1c95fa(0x10f)](),{items:_0x893c9a,paging:_0x404ce2}=await listAppRoles(_0x5e468e[_0x1c95fa(0x110)],{'currentPage':_0x441b54,'pageSize':_0x284a68}),_0x31198f=_0x3b4321?_0x893c9a['filter'](_0x3a54ba=>_0x3a54ba[_0x1c95fa(0x11b)]===_0x3b4321):_0x893c9a,_0x19ca27=_0x31198f[_0x1c95fa(0x114)](projectRole);return{'ok':!![],'data':{'roles':_0x19ca27,'paging':_0x404ce2},'message':'Found\x20'+_0x19ca27['length']+_0x1c95fa(0x11f)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a176_0x3eb014=a176_0x232b;(function(_0xb20362,_0x24e21e){const _0x1221bd=a176_0x232b,_0x874609=_0xb20362();while(!![]){try{const _0x2e6e65=parseInt(_0x1221bd(0x1dd))/0x1+-parseInt(_0x1221bd(0x1bd))/0x2+-parseInt(_0x1221bd(0x1cb))/0x3*(parseInt(_0x1221bd(0x1f3))/0x4)+parseInt(_0x1221bd(0x1c2))/0x5*(-parseInt(_0x1221bd(0x201))/0x6)+parseInt(_0x1221bd(0x1c0))/0x7*(parseInt(_0x1221bd(0x1f9))/0x8)+parseInt(_0x1221bd(0x1f2))/0x9+parseInt(_0x1221bd(0x1cc))/0xa;if(_0x2e6e65===_0x24e21e)break;else _0x874609['push'](_0x874609['shift']());}catch(_0x41fba1){_0x874609['push'](_0x874609['shift']());}}}(a176_0xa569,0x70f5d));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';function a176_0x232b(_0x2646e2,_0x4547f7){_0x2646e2=_0x2646e2-0x1b3;const _0xa56939=a176_0xa569();let _0x232b61=_0xa56939[_0x2646e2];return _0x232b61;}import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a176_0x3eb014(0x1da),'required':!![],'description':a176_0x3eb014(0x1ca)};export const ROLE_REF_FLAG={'name':a176_0x3eb014(0x1d3),'type':a176_0x3eb014(0x1e0),'required':!![],'description':a176_0x3eb014(0x1bf)};export const USER_REF_FLAG={'name':a176_0x3eb014(0x1f7),'type':'string','required':!![],'description':a176_0x3eb014(0x1b7)};export const NAME_FLAG={'name':'name','type':a176_0x3eb014(0x1e0),'required':!![],'description':a176_0x3eb014(0x1ee)};function a176_0xa569(){const _0x393dac=['Multiple\x20tenant\x20members\x20match\x20\x22','Missing\x20user\x20reference.','flag','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','\x20built-in\x20role\x20','findIndex','Role\x20name\x20\x22','Role\x20id\x20(from\x20`role\x20list`)','684411tqCFKO','416550WHCExJ','\x20not\x20found\x20in\x20the\x20user-role\x20list.','splice','roleName','validation','userList','POST','role','\x20is\x20already\x20a\x20member\x20of\x20role\x20','authRequired','join','nickname','\x20not\x20found\x20in\x20app\x20','appCode','number','\x22:\x20','tenant_code','744005xLXRGz','toLowerCase','find','string','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','map','test','expect-user-count','length','Disambiguate\x20with\x20--user\x20<id>.','trim',';\x20no\x20change.','/smartapi/permit/user-role/update-user-list','USER','includes','DEV','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','Role\x20name','dryRun','name','push','5268699XdRLtv','12heAfEn','expectUserCount','username','Role\x20id\x20','user','flagMissing','24OxqLUn','Disambiguate\x20with\x20--role\x20<id>.','userCount','userId','User\x20','permitCount','\x22\x20is\x20ambiguous\x20(ids:\x20','remark','1608xLcLbv','ADMIN','tenant','roleType','Missing\x20role\x20reference.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Pass\x20--role\x20<id|name>.','totalCount','\x20member(s)\x20but\x20role\x20has\x20','str','529266sanaSv','Pass\x20--user\x20<id|name>.','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','806498yWSoiD','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','5690LJXtdG'];a176_0xa569=function(){return _0x393dac;};return a176_0xa569();}export const USER_NAME_FLAG={'name':a176_0x3eb014(0x1f0),'type':a176_0x3eb014(0x1e0),'required':!![],'description':a176_0x3eb014(0x1c6)};export const REMARK_FLAG={'name':'remark','type':a176_0x3eb014(0x1e0),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a176_0x3eb014(0x1e4),'type':a176_0x3eb014(0x1da),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a176_0x3eb014(0x1b3),a176_0x3eb014(0x1ec),a176_0x3eb014(0x1ea)];export function isBuiltinRole(_0x38864b){return BUILTIN_ROLE_TYPES['includes'](_0x38864b);}export function assertCustomRole(_0x381a8f,_0x38409d){const _0x5d90bd=a176_0x3eb014;if(_0x381a8f[_0x5d90bd(0x1b5)]!=='CUSTOM')throw CliErrors[_0x5d90bd(0x1d0)]('Cannot\x20'+_0x38409d+_0x5d90bd(0x1c7)+_0x381a8f[_0x5d90bd(0x1cf)]+'\x20('+_0x381a8f[_0x5d90bd(0x1b5)]+').',_0x5d90bd(0x1b8));}export function assertPermConfigurable(_0x36ecff){const _0x43971e=a176_0x3eb014;if(_0x36ecff[_0x43971e(0x1b5)]==='DEV'||_0x36ecff['roleType']===_0x43971e(0x1b3))throw CliErrors['validation'](_0x43971e(0x1ed)+_0x36ecff['roleName']+'\x20('+_0x36ecff[_0x43971e(0x1b5)]+').','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.');}export function projectRole(_0x35af72){const _0x14c5cd=a176_0x3eb014;return{'id':_0x35af72['id'],'roleName':_0x35af72['roleName'],'roleType':_0x35af72[_0x14c5cd(0x1b5)],'remark':_0x35af72[_0x14c5cd(0x200)],'userCount':_0x35af72[_0x14c5cd(0x1fb)],'permitCount':_0x35af72[_0x14c5cd(0x1fe)],'builtin':isBuiltinRole(_0x35af72[_0x14c5cd(0x1b5)])};}export async function resolveRoleRef(_0x2bf2d2,_0x508213){const _0x4018c8=a176_0x3eb014,_0x20e04f=_0x508213[_0x4018c8(0x1e7)]();if(!_0x20e04f)throw CliErrors[_0x4018c8(0x1d0)](_0x4018c8(0x1b6),_0x4018c8(0x1b9));if(/^\d+$/[_0x4018c8(0x1e3)](_0x20e04f))return getRoleById(_0x2bf2d2,Number(_0x20e04f));const _0x11f688=await listAllAppRoles(_0x2bf2d2),_0x291630=_0x11f688['filter'](_0x4dac57=>_0x4dac57['roleName']===_0x20e04f);if(_0x291630[_0x4018c8(0x1e5)]===0x0)throw CliErrors[_0x4018c8(0x1d0)]('Role\x20name\x20\x22'+_0x20e04f+'\x22\x20not\x20found\x20in\x20app\x20'+_0x2bf2d2+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x291630[_0x4018c8(0x1e5)]>0x1){const _0x5d3e3f=_0x291630['map'](_0x5bad86=>_0x5bad86['id'])['join'](',\x20');throw CliErrors[_0x4018c8(0x1d0)](_0x4018c8(0x1c9)+_0x20e04f+_0x4018c8(0x1ff)+_0x5d3e3f+').',_0x4018c8(0x1fa));}return _0x291630[0x0];}export async function getRoleById(_0xea649c,_0x170b83){const _0x1e4944=a176_0x3eb014,_0x51084f=await getAppRole(_0x170b83);if(!_0x51084f)throw CliErrors[_0x1e4944(0x1d0)](_0x1e4944(0x1f6)+_0x170b83+_0x1e4944(0x1d8)+_0xea649c+'.',_0x1e4944(0x1c1));return _0x51084f;}async function listAllAppRoles(_0x53a31f){const _0x2fc50c=a176_0x3eb014,_0x3cac16=0x64,_0x3111ed=[];for(let _0x164693=0x1;;_0x164693+=0x1){const {items:_0x166c44,paging:_0x40423e}=await listAppRoles(_0x53a31f,{'currentPage':_0x164693,'pageSize':_0x3cac16});_0x3111ed['push'](..._0x166c44);if(_0x166c44['length']<_0x3cac16||_0x40423e&&_0x3111ed['length']>=_0x40423e[_0x2fc50c(0x1ba)])return _0x3111ed;}}export async function resolveTenantCode(){const _0x5f4903=a176_0x3eb014,_0x3c6172=await getSessionUserInfo(),_0x5d6155=_0x3c6172?.[_0x5f4903(0x1f7)]?.[_0x5f4903(0x1b4)]?.[_0x5f4903(0x1dc)];if(!_0x5d6155)throw CliErrors[_0x5f4903(0x1d5)]('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x5d6155;}function matchMember(_0xdc1045,_0x5e7e59){const _0x3c6641=a176_0x3eb014,_0x1a85df=_0x5e7e59[_0x3c6641(0x1e7)]()[_0x3c6641(0x1de)]();return(_0xdc1045['nickname']??'')[_0x3c6641(0x1de)]()===_0x1a85df||(_0xdc1045[_0x3c6641(0x1f5)]??'')[_0x3c6641(0x1de)]()===_0x1a85df;}export async function resolveUserRef(_0x574bf2){const _0x3d1b15=a176_0x3eb014,_0x2c86ef=_0x574bf2[_0x3d1b15(0x1e7)]();if(!_0x2c86ef)throw CliErrors[_0x3d1b15(0x1d0)](_0x3d1b15(0x1c4),_0x3d1b15(0x1be));const _0x114286=await resolveTenantCode(),_0x2c6273=await getTenantMembers(_0x114286);if(/^\d+$/[_0x3d1b15(0x1e3)](_0x2c86ef)){const _0x4cf4ef=Number(_0x2c86ef),_0x1fb380=_0x2c6273[_0x3d1b15(0x1df)](_0x36f28c=>_0x36f28c[_0x3d1b15(0x1fc)]===_0x4cf4ef);return{'userId':_0x4cf4ef,'username':_0x1fb380?.['username']??String(_0x4cf4ef),'nickname':_0x1fb380?.[_0x3d1b15(0x1d7)],'matchedBy':'id'};}const _0x21aa2b=_0x2c6273['filter'](_0x23373f=>matchMember(_0x23373f,_0x2c86ef));if(_0x21aa2b[_0x3d1b15(0x1e5)]===0x0)throw CliErrors[_0x3d1b15(0x1d0)]('No\x20tenant\x20member\x20matches\x20\x22'+_0x2c86ef+'\x22.',_0x3d1b15(0x1e1));if(_0x21aa2b[_0x3d1b15(0x1e5)]>0x1){const _0x410dfb=_0x21aa2b['map'](_0x51b1f1=>(_0x51b1f1['nickname']??_0x51b1f1[_0x3d1b15(0x1f5)]??'?')+'('+_0x51b1f1[_0x3d1b15(0x1fc)]+')')[_0x3d1b15(0x1d6)](',\x20');throw CliErrors[_0x3d1b15(0x1d0)](_0x3d1b15(0x1c3)+_0x2c86ef+_0x3d1b15(0x1db)+_0x410dfb+'.',_0x3d1b15(0x1e6));}const _0x26ed60=_0x21aa2b[0x0];return{'userId':_0x26ed60[_0x3d1b15(0x1fc)],'username':_0x26ed60[_0x3d1b15(0x1f5)]??String(_0x26ed60[_0x3d1b15(0x1fc)]),'nickname':_0x26ed60[_0x3d1b15(0x1d7)],'matchedBy':_0x3d1b15(0x1f0)};}export const UPDATE_USER_LIST_PATH=a176_0x3eb014(0x1e9);function userIdsOf(_0x53bc52){const _0x203fa3=a176_0x3eb014;return(_0x53bc52?.[_0x203fa3(0x1d1)]??[])[_0x203fa3(0x1e2)](_0x45c719=>_0x45c719[_0x203fa3(0x1fc)]);}export function computeRoleUserMutation(_0x2245f6){const _0x2f54e3=a176_0x3eb014,{operation:_0x183274,appCode:_0x1fc889,roleUsers:_0x3ab9e4,targetRoleId:_0x574fb3,user:_0x5aaa4d}=_0x2245f6,_0x3b51c3=_0x3ab9e4['find'](_0x3c421c=>_0x3c421c['id']===_0x574fb3);if(!_0x3b51c3)throw CliErrors[_0x2f54e3(0x1d0)](_0x2f54e3(0x1f6)+_0x574fb3+_0x2f54e3(0x1cd),_0x2f54e3(0x1c1));const _0x27be99=userIdsOf(_0x3b51c3),_0x29f25f=[];if(_0x2245f6[_0x2f54e3(0x1f4)]!==undefined&&_0x2245f6[_0x2f54e3(0x1f4)]!==_0x27be99[_0x2f54e3(0x1e5)])throw CliErrors[_0x2f54e3(0x1d0)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x2245f6[_0x2f54e3(0x1f4)]+_0x2f54e3(0x1bb)+_0x27be99[_0x2f54e3(0x1e5)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x2a7e14=_0x27be99[_0x2f54e3(0x1eb)](_0x5aaa4d[_0x2f54e3(0x1fc)]);let _0xbeebc6=![];const _0x53e885=[..._0x3b51c3[_0x2f54e3(0x1d1)]];if(_0x183274==='user-add')_0x2a7e14?_0x29f25f[_0x2f54e3(0x1f1)]('User\x20'+_0x5aaa4d[_0x2f54e3(0x1fc)]+_0x2f54e3(0x1d4)+_0x3b51c3['roleName']+';\x20no\x20change.'):(_0x53e885[_0x2f54e3(0x1f1)]({'userId':_0x5aaa4d[_0x2f54e3(0x1fc)],'username':_0x5aaa4d['username'],..._0x5aaa4d['nickname']?{'nickname':_0x5aaa4d[_0x2f54e3(0x1d7)]}:{}}),_0xbeebc6=!![]);else{if(!_0x2a7e14)_0x29f25f['push'](_0x2f54e3(0x1fd)+_0x5aaa4d[_0x2f54e3(0x1fc)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x3b51c3['roleName']+_0x2f54e3(0x1e8));else{const _0x26b2fd=_0x53e885[_0x2f54e3(0x1c8)](_0xff63ac=>_0xff63ac[_0x2f54e3(0x1fc)]===_0x5aaa4d[_0x2f54e3(0x1fc)]);if(_0x26b2fd>=0x0)_0x53e885[_0x2f54e3(0x1ce)](_0x26b2fd,0x1);_0xbeebc6=!![];}}const _0x34566c=_0x3ab9e4[_0x2f54e3(0x1e2)](_0x2a578d=>_0x2a578d['id']===_0x574fb3?{..._0x2a578d,'userList':_0x53e885}:_0x2a578d),_0x10eec8=_0x53e885[_0x2f54e3(0x1e2)](_0x3a7d6c=>_0x3a7d6c['userId']),_0x27f0ad={'operation':_0x183274,'selector':{'appCode':_0x1fc889,'roleId':_0x574fb3,'roleName':_0x3b51c3['roleName'],'userId':_0x5aaa4d[_0x2f54e3(0x1fc)]},'before':{'userIds':_0x27be99},'after':{'userIds':_0x10eec8},'dryRun':_0x2245f6[_0x2f54e3(0x1ef)],'backend':{'method':_0x2f54e3(0x1d2),'path':UPDATE_USER_LIST_PATH},'warnings':_0x29f25f};return{'roleList':_0x34566c,'mutation':_0x27f0ad,'changed':_0xbeebc6};}export async function loadRoleUsers(_0x286a6e){return listRoleUsers(_0x286a6e);}export function readRoleRef(_0xc5f25c){const _0x22edfe=a176_0x3eb014,_0x1c9837=_0xc5f25c[_0x22edfe(0x1bc)]('role')[_0x22edfe(0x1e7)]();if(!_0x1c9837)throw CliErrors[_0x22edfe(0x1f8)](_0x22edfe(0x1d3),_0x22edfe(0x1b9));return _0x1c9837;}export async function prepareUserMutation(_0x108b32,_0x2396ed,_0x3d80ed){const _0x2495b6=a176_0x3eb014,_0x285b85=readRoleRef(_0x108b32),_0x36b1fc=_0x108b32[_0x2495b6(0x1bc)](_0x2495b6(0x1f7))['trim']();if(!_0x36b1fc)throw CliErrors['flagMissing'](_0x2495b6(0x1f7),_0x2495b6(0x1be));const _0x27b7b7=_0x108b32[_0x2495b6(0x1c5)](_0x2495b6(0x1e4)),_0x2267c2=_0x27b7b7===undefined||_0x27b7b7===null?undefined:Number(_0x27b7b7),_0x37abbe=await resolveRoleRef(_0x108b32['appCode'],_0x285b85),_0x35aa47=await resolveUserRef(_0x36b1fc),_0x3709e1=await loadRoleUsers(_0x108b32[_0x2495b6(0x1d9)]);return computeRoleUserMutation({'operation':_0x2396ed,'appCode':_0x108b32['appCode'],'roleUsers':_0x3709e1,'targetRoleId':_0x37abbe['id'],'user':{'userId':_0x35aa47[_0x2495b6(0x1fc)],'username':_0x35aa47[_0x2495b6(0x1f5)],'nickname':_0x35aa47[_0x2495b6(0x1d7)]},'dryRun':_0x3d80ed,..._0x2267c2!==undefined?{'expectUserCount':_0x2267c2}:{}});}
|
|
1
|
+
const a184_0x3f8d3a=a184_0x2794;(function(_0x1d3080,_0x1b5fd1){const _0x5aa456=a184_0x2794,_0x14149f=_0x1d3080();while(!![]){try{const _0x18ab67=-parseInt(_0x5aa456(0x18d))/0x1*(parseInt(_0x5aa456(0x199))/0x2)+parseInt(_0x5aa456(0x18c))/0x3*(-parseInt(_0x5aa456(0x186))/0x4)+-parseInt(_0x5aa456(0x17e))/0x5+-parseInt(_0x5aa456(0x19f))/0x6+-parseInt(_0x5aa456(0x157))/0x7*(parseInt(_0x5aa456(0x1a4))/0x8)+parseInt(_0x5aa456(0x182))/0x9+parseInt(_0x5aa456(0x16d))/0xa;if(_0x18ab67===_0x1b5fd1)break;else _0x14149f['push'](_0x14149f['shift']());}catch(_0x177122){_0x14149f['push'](_0x14149f['shift']());}}}(a184_0x39a3,0x2cfa4));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';function a184_0x39a3(){const _0x32eecc=['validation','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Pass\x20--user\x20<id|name>.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','8603tfvSSw','Missing\x20role\x20reference.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','test','Role\x20name\x20\x22','permitCount','\x20not\x20found\x20in\x20app\x20','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','map',';\x20no\x20change.','Disambiguate\x20with\x20--role\x20<id>.','join','POST','Cannot\x20','string','Role\x20id\x20(from\x20`role\x20list`)','push','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Missing\x20user\x20reference.','remark','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','10288170iLOrPW','role','splice','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','expectUserCount','str','Role\x20name','name','Optional\x20role\x20remark/description','flagMissing','dryRun','Multiple\x20tenant\x20members\x20match\x20\x22','roleType','Anti-drift\x20check\x20failed:\x20expected\x20','userList','ADMIN','username','1360525pWVfqc','user','User\x20','appCode','1345059LGUASr','expect-user-count','Disambiguate\x20with\x20--user\x20<id>.','length','12476uEnPzK','find','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','CUSTOM','totalCount','DEV','57bYIQcB','4142LzvWrm','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','tenant','Pass\x20--role\x20<id|name>.','USER','/smartapi/permit/user-role/update-user-list','filter','trim','No\x20tenant\x20member\x20matches\x20\x22','\x22:\x20','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','number','6iVKaAv','\x22\x20not\x20found\x20in\x20app\x20','Role\x20id\x20','nickname','userId','toLowerCase','1903134jFoMdA','includes','authRequired','roleName','\x20is\x20not\x20a\x20member\x20of\x20role\x20','2168qdYEtg'];a184_0x39a3=function(){return _0x32eecc;};return a184_0x39a3();}import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a184_0x3f8d3a(0x198),'required':!![],'description':a184_0x3f8d3a(0x166)};export const ROLE_REF_FLAG={'name':a184_0x3f8d3a(0x16e),'type':a184_0x3f8d3a(0x165),'required':!![],'description':a184_0x3f8d3a(0x188)};export const USER_REF_FLAG={'name':a184_0x3f8d3a(0x17f),'type':a184_0x3f8d3a(0x165),'required':!![],'description':a184_0x3f8d3a(0x170)};function a184_0x2794(_0x410ae8,_0x336959){_0x410ae8=_0x410ae8-0x152;const _0x39a3fa=a184_0x39a3();let _0x27946b=_0x39a3fa[_0x410ae8];return _0x27946b;}export const NAME_FLAG={'name':'name','type':a184_0x3f8d3a(0x165),'required':!![],'description':a184_0x3f8d3a(0x173)};export const USER_NAME_FLAG={'name':a184_0x3f8d3a(0x174),'type':a184_0x3f8d3a(0x165),'required':!![],'description':a184_0x3f8d3a(0x159)};export const REMARK_FLAG={'name':a184_0x3f8d3a(0x16b),'type':a184_0x3f8d3a(0x165),'required':![],'description':a184_0x3f8d3a(0x175)};export const EXPECT_USER_COUNT_FLAG={'name':a184_0x3f8d3a(0x183),'type':'number','required':![],'description':a184_0x3f8d3a(0x154)};export const BUILTIN_ROLE_TYPES=[a184_0x3f8d3a(0x17c),a184_0x3f8d3a(0x18b),a184_0x3f8d3a(0x191)];export function isBuiltinRole(_0x90e268){const _0x4c1615=a184_0x3f8d3a;return BUILTIN_ROLE_TYPES[_0x4c1615(0x1a0)](_0x90e268);}export function assertCustomRole(_0x3984ea,_0x2e32af){const _0x3e4d9b=a184_0x3f8d3a;if(_0x3984ea[_0x3e4d9b(0x179)]!==_0x3e4d9b(0x189))throw CliErrors[_0x3e4d9b(0x152)](_0x3e4d9b(0x164)+_0x2e32af+'\x20built-in\x20role\x20'+_0x3984ea[_0x3e4d9b(0x1a2)]+'\x20('+_0x3984ea[_0x3e4d9b(0x179)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function assertPermConfigurable(_0x12079f){const _0xc0a586=a184_0x3f8d3a;if(_0x12079f[_0xc0a586(0x179)]==='DEV'||_0x12079f[_0xc0a586(0x179)]===_0xc0a586(0x17c))throw CliErrors['validation'](_0xc0a586(0x197)+_0x12079f[_0xc0a586(0x1a2)]+'\x20('+_0x12079f[_0xc0a586(0x179)]+').',_0xc0a586(0x168));}export function projectRole(_0x27fcfc){const _0x15175f=a184_0x3f8d3a;return{'id':_0x27fcfc['id'],'roleName':_0x27fcfc['roleName'],'roleType':_0x27fcfc[_0x15175f(0x179)],'remark':_0x27fcfc[_0x15175f(0x16b)],'userCount':_0x27fcfc['userCount'],'permitCount':_0x27fcfc[_0x15175f(0x15c)],'builtin':isBuiltinRole(_0x27fcfc[_0x15175f(0x179)])};}export async function resolveRoleRef(_0x361374,_0x59835a){const _0x3f9a7b=a184_0x3f8d3a,_0x5b2597=_0x59835a['trim']();if(!_0x5b2597)throw CliErrors[_0x3f9a7b(0x152)](_0x3f9a7b(0x158),_0x3f9a7b(0x190));if(/^\d+$/[_0x3f9a7b(0x15a)](_0x5b2597))return getRoleById(_0x361374,Number(_0x5b2597));const _0x23c21d=await listAllAppRoles(_0x361374),_0x2e4f1=_0x23c21d['filter'](_0x59d8c8=>_0x59d8c8[_0x3f9a7b(0x1a2)]===_0x5b2597);if(_0x2e4f1['length']===0x0)throw CliErrors[_0x3f9a7b(0x152)](_0x3f9a7b(0x15b)+_0x5b2597+_0x3f9a7b(0x19a)+_0x361374+'.',_0x3f9a7b(0x18e));if(_0x2e4f1[_0x3f9a7b(0x185)]>0x1){const _0x3b43c1=_0x2e4f1[_0x3f9a7b(0x15f)](_0x1bb4ba=>_0x1bb4ba['id'])['join'](',\x20');throw CliErrors['validation'](_0x3f9a7b(0x15b)+_0x5b2597+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x3b43c1+').',_0x3f9a7b(0x161));}return _0x2e4f1[0x0];}export async function getRoleById(_0x36e972,_0x47f800){const _0x2346a5=a184_0x3f8d3a,_0x24adcf=await getAppRole(_0x47f800);if(!_0x24adcf)throw CliErrors[_0x2346a5(0x152)](_0x2346a5(0x19b)+_0x47f800+_0x2346a5(0x15d)+_0x36e972+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x24adcf;}async function listAllAppRoles(_0x5ed08b){const _0x2133f8=a184_0x3f8d3a,_0x2f0d60=0x64,_0x45434c=[];for(let _0x24463=0x1;;_0x24463+=0x1){const {items:_0x166865,paging:_0x4c524b}=await listAppRoles(_0x5ed08b,{'currentPage':_0x24463,'pageSize':_0x2f0d60});_0x45434c[_0x2133f8(0x167)](..._0x166865);if(_0x166865[_0x2133f8(0x185)]<_0x2f0d60||_0x4c524b&&_0x45434c[_0x2133f8(0x185)]>=_0x4c524b[_0x2133f8(0x18a)])return _0x45434c;}}export async function resolveTenantCode(){const _0xb261a=a184_0x3f8d3a,_0x1af543=await getSessionUserInfo(),_0x3c4c58=_0x1af543?.[_0xb261a(0x17f)]?.[_0xb261a(0x18f)]?.['tenant_code'];if(!_0x3c4c58)throw CliErrors[_0xb261a(0x1a1)](_0xb261a(0x156));return _0x3c4c58;}function matchMember(_0x46817d,_0x2c1f14){const _0x2cba07=a184_0x3f8d3a,_0x29cdd6=_0x2c1f14['trim']()[_0x2cba07(0x19e)]();return(_0x46817d['nickname']??'')[_0x2cba07(0x19e)]()===_0x29cdd6||(_0x46817d['username']??'')[_0x2cba07(0x19e)]()===_0x29cdd6;}export async function resolveUserRef(_0x34e115){const _0x1e980f=a184_0x3f8d3a,_0x3e2a6e=_0x34e115['trim']();if(!_0x3e2a6e)throw CliErrors['validation'](_0x1e980f(0x16a),_0x1e980f(0x155));const _0x1cfb89=await resolveTenantCode(),_0x489567=await getTenantMembers(_0x1cfb89);if(/^\d+$/[_0x1e980f(0x15a)](_0x3e2a6e)){const _0x3efac3=Number(_0x3e2a6e),_0x411df9=_0x489567[_0x1e980f(0x187)](_0x35173e=>_0x35173e['userId']===_0x3efac3);return{'userId':_0x3efac3,'username':_0x411df9?.[_0x1e980f(0x17d)]??String(_0x3efac3),'nickname':_0x411df9?.[_0x1e980f(0x19c)],'matchedBy':'id'};}const _0xca4c3e=_0x489567[_0x1e980f(0x193)](_0x195630=>matchMember(_0x195630,_0x3e2a6e));if(_0xca4c3e[_0x1e980f(0x185)]===0x0)throw CliErrors[_0x1e980f(0x152)](_0x1e980f(0x195)+_0x3e2a6e+'\x22.',_0x1e980f(0x15e));if(_0xca4c3e['length']>0x1){const _0x111df1=_0xca4c3e[_0x1e980f(0x15f)](_0x3d4adc=>(_0x3d4adc['nickname']??_0x3d4adc[_0x1e980f(0x17d)]??'?')+'('+_0x3d4adc[_0x1e980f(0x19d)]+')')[_0x1e980f(0x162)](',\x20');throw CliErrors[_0x1e980f(0x152)](_0x1e980f(0x178)+_0x3e2a6e+_0x1e980f(0x196)+_0x111df1+'.',_0x1e980f(0x184));}const _0x3fa3a9=_0xca4c3e[0x0];return{'userId':_0x3fa3a9[_0x1e980f(0x19d)],'username':_0x3fa3a9[_0x1e980f(0x17d)]??String(_0x3fa3a9[_0x1e980f(0x19d)]),'nickname':_0x3fa3a9[_0x1e980f(0x19c)],'matchedBy':_0x1e980f(0x174)};}export const UPDATE_USER_LIST_PATH=a184_0x3f8d3a(0x192);function userIdsOf(_0x4d44ef){const _0x7b6f5c=a184_0x3f8d3a;return(_0x4d44ef?.[_0x7b6f5c(0x17b)]??[])[_0x7b6f5c(0x15f)](_0x3ff3e4=>_0x3ff3e4['userId']);}export function computeRoleUserMutation(_0x3db006){const _0x1ab7db=a184_0x3f8d3a,{operation:_0x566328,appCode:_0x3f7f09,roleUsers:_0x517921,targetRoleId:_0x407ab9,user:_0x46a064}=_0x3db006,_0x2055c1=_0x517921['find'](_0x3f93ef=>_0x3f93ef['id']===_0x407ab9);if(!_0x2055c1)throw CliErrors[_0x1ab7db(0x152)](_0x1ab7db(0x19b)+_0x407ab9+_0x1ab7db(0x153),_0x1ab7db(0x16c));const _0x1a2465=userIdsOf(_0x2055c1),_0x18192b=[];if(_0x3db006[_0x1ab7db(0x171)]!==undefined&&_0x3db006[_0x1ab7db(0x171)]!==_0x1a2465[_0x1ab7db(0x185)])throw CliErrors[_0x1ab7db(0x152)](_0x1ab7db(0x17a)+_0x3db006[_0x1ab7db(0x171)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x1a2465['length']+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x4c9afd=_0x1a2465[_0x1ab7db(0x1a0)](_0x46a064[_0x1ab7db(0x19d)]);let _0x7ff2b4=![];const _0x22f19b=[..._0x2055c1[_0x1ab7db(0x17b)]];if(_0x566328==='user-add')_0x4c9afd?_0x18192b[_0x1ab7db(0x167)](_0x1ab7db(0x180)+_0x46a064[_0x1ab7db(0x19d)]+_0x1ab7db(0x169)+_0x2055c1['roleName']+';\x20no\x20change.'):(_0x22f19b[_0x1ab7db(0x167)]({'userId':_0x46a064[_0x1ab7db(0x19d)],'username':_0x46a064['username'],..._0x46a064[_0x1ab7db(0x19c)]?{'nickname':_0x46a064[_0x1ab7db(0x19c)]}:{}}),_0x7ff2b4=!![]);else{if(!_0x4c9afd)_0x18192b[_0x1ab7db(0x167)](_0x1ab7db(0x180)+_0x46a064[_0x1ab7db(0x19d)]+_0x1ab7db(0x1a3)+_0x2055c1[_0x1ab7db(0x1a2)]+_0x1ab7db(0x160));else{const _0x4cbaa3=_0x22f19b['findIndex'](_0x5557d2=>_0x5557d2[_0x1ab7db(0x19d)]===_0x46a064[_0x1ab7db(0x19d)]);if(_0x4cbaa3>=0x0)_0x22f19b[_0x1ab7db(0x16f)](_0x4cbaa3,0x1);_0x7ff2b4=!![];}}const _0x178b52=_0x517921['map'](_0x503a95=>_0x503a95['id']===_0x407ab9?{..._0x503a95,'userList':_0x22f19b}:_0x503a95),_0x5e9ec5=_0x22f19b['map'](_0x59e91b=>_0x59e91b[_0x1ab7db(0x19d)]),_0x3d11d7={'operation':_0x566328,'selector':{'appCode':_0x3f7f09,'roleId':_0x407ab9,'roleName':_0x2055c1[_0x1ab7db(0x1a2)],'userId':_0x46a064['userId']},'before':{'userIds':_0x1a2465},'after':{'userIds':_0x5e9ec5},'dryRun':_0x3db006[_0x1ab7db(0x177)],'backend':{'method':_0x1ab7db(0x163),'path':UPDATE_USER_LIST_PATH},'warnings':_0x18192b};return{'roleList':_0x178b52,'mutation':_0x3d11d7,'changed':_0x7ff2b4};}export async function loadRoleUsers(_0x77522f){return listRoleUsers(_0x77522f);}export function readRoleRef(_0x3bf3bb){const _0x45d5c6=a184_0x3f8d3a,_0x235f55=_0x3bf3bb[_0x45d5c6(0x172)]('role')[_0x45d5c6(0x194)]();if(!_0x235f55)throw CliErrors[_0x45d5c6(0x176)](_0x45d5c6(0x16e),_0x45d5c6(0x190));return _0x235f55;}export async function prepareUserMutation(_0x15298e,_0x1897eb,_0x53f680){const _0x2c1173=a184_0x3f8d3a,_0x18d2d2=readRoleRef(_0x15298e),_0x1faa83=_0x15298e[_0x2c1173(0x172)](_0x2c1173(0x17f))['trim']();if(!_0x1faa83)throw CliErrors['flagMissing'](_0x2c1173(0x17f),_0x2c1173(0x155));const _0x37b18=_0x15298e['flag'](_0x2c1173(0x183)),_0xd4a469=_0x37b18===undefined||_0x37b18===null?undefined:Number(_0x37b18),_0x4e3369=await resolveRoleRef(_0x15298e[_0x2c1173(0x181)],_0x18d2d2),_0x15a5b8=await resolveUserRef(_0x1faa83),_0x4c5b37=await loadRoleUsers(_0x15298e['appCode']);return computeRoleUserMutation({'operation':_0x1897eb,'appCode':_0x15298e[_0x2c1173(0x181)],'roleUsers':_0x4c5b37,'targetRoleId':_0x4e3369['id'],'user':{'userId':_0x15a5b8[_0x2c1173(0x19d)],'username':_0x15a5b8[_0x2c1173(0x17d)],'nickname':_0x15a5b8[_0x2c1173(0x19c)]},'dryRun':_0x53f680,..._0xd4a469!==undefined?{'expectUserCount':_0xd4a469}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a185_0x50058b=a185_0x13f7;(function(_0x24d52f,_0x31b8ab){const _0x50a62a=a185_0x13f7,_0x552d5c=_0x24d52f();while(!![]){try{const _0x1105c9=-parseInt(_0x50a62a(0x144))/0x1*(parseInt(_0x50a62a(0x14f))/0x2)+parseInt(_0x50a62a(0x14d))/0x3+-parseInt(_0x50a62a(0x153))/0x4*(-parseInt(_0x50a62a(0x148))/0x5)+parseInt(_0x50a62a(0x138))/0x6+parseInt(_0x50a62a(0x142))/0x7+-parseInt(_0x50a62a(0x150))/0x8*(parseInt(_0x50a62a(0x146))/0x9)+parseInt(_0x50a62a(0x147))/0xa;if(_0x1105c9===_0x31b8ab)break;else _0x552d5c['push'](_0x552d5c['shift']());}catch(_0x40920c){_0x552d5c['push'](_0x552d5c['shift']());}}}(a185_0x37e5,0x36226));function a185_0x37e5(){const _0x1c73b8=['999460OcPgBO','POST','10228mtPJuz','num','306dJJtOM','1276860KCHjYR','64490QdqcEZ','trim','Updated\x20role\x20','string','roleName','144390uMWddM','appCode','38qPndxl','62584YHZCbd','update','/smartapi/permit/role/update','4qIghgh','remark','2103324ucCSiO','validation','Nothing\x20to\x20update.','length','write','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','--name\x20cannot\x20be\x20empty.','\x20(id=','flag'];a185_0x37e5=function(){return _0x1c73b8;};return a185_0x37e5();}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';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a185_0x50058b(0x152);function readPatch(_0x386c94){const _0x425b65=a185_0x50058b,_0x10820e=_0x386c94[_0x425b65(0x141)]('name'),_0x10ae75=_0x386c94['flag'](_0x425b65(0x137)),_0x2e43e4={};if(_0x10820e!==undefined&&_0x10820e!==null){const _0x4d7874=String(_0x10820e)[_0x425b65(0x149)]();if(!_0x4d7874)throw CliErrors['validation'](_0x425b65(0x13f));if(_0x4d7874[_0x425b65(0x13b)]>0x40)throw CliErrors[_0x425b65(0x139)](_0x425b65(0x13e));_0x2e43e4['roleName']=_0x4d7874;}_0x10ae75!==undefined&&_0x10ae75!==null&&(_0x2e43e4[_0x425b65(0x137)]=String(_0x10ae75));if(_0x2e43e4['roleName']===undefined&&_0x2e43e4['remark']===undefined)throw CliErrors[_0x425b65(0x139)](_0x425b65(0x13a),_0x425b65(0x13d));return _0x2e43e4;}function a185_0x13f7(_0x12ee40,_0x16380c){_0x12ee40=_0x12ee40-0x137;const _0x37e55e=a185_0x37e5();let _0x13f7aa=_0x37e55e[_0x12ee40];return _0x13f7aa;}export const roleUpdate={'service':'role','command':a185_0x50058b(0x151),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','risk':a185_0x50058b(0x13c),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a185_0x50058b(0x14b),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x58ab2f){readPatch(_0x58ab2f);},async 'dryRun'(_0x579760){const _0x453eb8=a185_0x50058b,_0x597ce3=_0x579760[_0x453eb8(0x145)]('id'),_0x5082e0=readPatch(_0x579760),_0x5c0d03=await getRoleById(_0x579760['appCode'],_0x597ce3);return assertCustomRole(_0x5c0d03,_0x453eb8(0x151)),asDryRunResult({'operation':_0x453eb8(0x151),'selector':{'appCode':_0x579760[_0x453eb8(0x14e)],'roleId':_0x597ce3,'roleName':_0x5c0d03[_0x453eb8(0x14c)]},'before':projectRole(_0x5c0d03),'after':projectRole({..._0x5c0d03,..._0x5082e0['roleName']!==undefined?{'roleName':_0x5082e0['roleName']}:{},..._0x5082e0[_0x453eb8(0x137)]!==undefined?{'remark':_0x5082e0['remark']}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x453eb8(0x143),'url':UPDATE_PATH});},async 'execute'(_0x355b43){const _0x244e9f=a185_0x50058b,_0x1b1bd0=_0x355b43[_0x244e9f(0x145)]('id'),_0x40c9d4=readPatch(_0x355b43),_0x58b4a5=await getRoleById(_0x355b43[_0x244e9f(0x14e)],_0x1b1bd0);assertCustomRole(_0x58b4a5,_0x244e9f(0x151)),await updateAppRole({'id':_0x1b1bd0,'appCode':_0x355b43[_0x244e9f(0x14e)],..._0x40c9d4[_0x244e9f(0x14c)]!==undefined?{'roleName':_0x40c9d4['roleName']}:{},..._0x40c9d4[_0x244e9f(0x137)]!==undefined?{'remark':_0x40c9d4[_0x244e9f(0x137)]}:{}});const _0x1c7c4b=await getRoleById(_0x355b43['appCode'],_0x1b1bd0);return{'ok':!![],'data':{'operation':_0x244e9f(0x151),'selector':{'appCode':_0x355b43[_0x244e9f(0x14e)],'roleId':_0x1b1bd0,'roleName':_0x1c7c4b[_0x244e9f(0x14c)]},'before':projectRole(_0x58b4a5),'after':projectRole(_0x1c7c4b),'dryRun':![],'backend':{'method':_0x244e9f(0x143),'path':UPDATE_PATH},'warnings':[]},'message':_0x244e9f(0x14a)+_0x1c7c4b[_0x244e9f(0x14c)]+_0x244e9f(0x140)+_0x1b1bd0+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a186_0x1edc10=a186_0x235b;(function(_0x45475a,_0x6a1ce7){const _0x3a9695=a186_0x235b,_0x2c1373=_0x45475a();while(!![]){try{const _0x1b2072=parseInt(_0x3a9695(0xc2))/0x1+-parseInt(_0x3a9695(0xc8))/0x2+parseInt(_0x3a9695(0xba))/0x3*(-parseInt(_0x3a9695(0xc3))/0x4)+-parseInt(_0x3a9695(0xc9))/0x5+-parseInt(_0x3a9695(0xb9))/0x6*(-parseInt(_0x3a9695(0xbb))/0x7)+parseInt(_0x3a9695(0xc5))/0x8+-parseInt(_0x3a9695(0xb5))/0x9*(-parseInt(_0x3a9695(0xc0))/0xa);if(_0x1b2072===_0x6a1ce7)break;else _0x2c1373['push'](_0x2c1373['shift']());}catch(_0x4aabde){_0x2c1373['push'](_0x2c1373['shift']());}}}(a186_0xc7c6,0xc4e17));import{updateRoleUsers}from'../../core/api-client.js';function a186_0xc7c6(){const _0x208861=['22370TRVuKa','high-risk-write','264994fyBHqy','4bSBmbI','userId','2072120lxKFhg','\x20to\x20role\x20','appCode','2404952szaYfa','8051485zRPTPp','Added\x20user\x20','11943UTHlZJ','user-add','role','selector','5784TjiEWw','510672RxXypA','2156aQYwRl','No\x20change:\x20user\x20','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','POST','roleName'];a186_0xc7c6=function(){return _0x208861;};return a186_0xc7c6();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';function a186_0x235b(_0x2817f2,_0x33675e){_0x2817f2=_0x2817f2-0xb5;const _0xc7c60b=a186_0xc7c6();let _0x235ba8=_0xc7c60b[_0x2817f2];return _0x235ba8;}export const roleUserAdd={'service':a186_0x1edc10(0xb7),'command':'user-add','description':a186_0x1edc10(0xbd),'risk':a186_0x1edc10(0xc1),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xe24983){const _0x10361c=a186_0x1edc10,{mutation:_0x4261a8}=await prepareUserMutation(_0xe24983,_0x10361c(0xb6),!![]);return asDryRunResult(_0x4261a8,{'method':_0x10361c(0xbe),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x6b05c6){const _0x41d19d=a186_0x1edc10,{roleList:_0x5b7428,mutation:_0x147f0a,changed:_0x5c3de7}=await prepareUserMutation(_0x6b05c6,_0x41d19d(0xb6),![]);return _0x5c3de7&&await updateRoleUsers(_0x6b05c6[_0x41d19d(0xc7)],_0x5b7428),{'ok':!![],'data':_0x147f0a,'message':_0x5c3de7?_0x41d19d(0xca)+_0x147f0a[_0x41d19d(0xb8)][_0x41d19d(0xc4)]+_0x41d19d(0xc6)+_0x147f0a[_0x41d19d(0xb8)][_0x41d19d(0xbf)]:_0x41d19d(0xbc)+_0x147f0a[_0x41d19d(0xb8)]['userId']+'\x20already\x20in\x20role\x20'+_0x147f0a[_0x41d19d(0xb8)]['roleName']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a187_0x499735=a187_0x16cd;(function(_0x390665,_0x53aa8a){const _0x225930=a187_0x16cd,_0x3c366c=_0x390665();while(!![]){try{const _0x32885d=parseInt(_0x225930(0x89))/0x1*(-parseInt(_0x225930(0x7a))/0x2)+-parseInt(_0x225930(0x79))/0x3+parseInt(_0x225930(0x8a))/0x4+-parseInt(_0x225930(0x88))/0x5*(parseInt(_0x225930(0x84))/0x6)+parseInt(_0x225930(0x86))/0x7+-parseInt(_0x225930(0x82))/0x8+parseInt(_0x225930(0x78))/0x9*(parseInt(_0x225930(0x7d))/0xa);if(_0x32885d===_0x53aa8a)break;else _0x3c366c['push'](_0x3c366c['shift']());}catch(_0x186d89){_0x3c366c['push'](_0x3c366c['shift']());}}}(a187_0x4966,0x953b3));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a187_0x16cd(_0x2a45f2,_0x114df4){_0x2a45f2=_0x2a45f2-0x78;const _0x4966b2=a187_0x4966();let _0x16cd45=_0x4966b2[_0x2a45f2];return _0x16cd45;}import{asDryRunResult}from'../../commands/common/dry-run.js';function a187_0x4966(){const _0x269dcb=['70smrGqM','Removed\x20user\x20','appCode','No\x20change:\x20user\x20','userId','5030544BrexgW','user-remove','6259326tQbwGN','POST','210378uWOIDP','roleName','5YJzPrc','1tHpquB','97436tJIIGx','selector','4183020tWuqYX','1112250ACuTlD','1307666UWpGbo','\x20from\x20role\x20','high-risk-write'];a187_0x4966=function(){return _0x269dcb;};return a187_0x4966();}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':'role','command':'user-remove','description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a187_0x499735(0x7c),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x192042){const _0x5215f8=a187_0x499735,{mutation:_0x45d2a7}=await prepareUserMutation(_0x192042,_0x5215f8(0x83),!![]);return asDryRunResult(_0x45d2a7,{'method':_0x5215f8(0x85),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0xfa2eff){const _0x40fa74=a187_0x499735,{roleList:_0x4b1f91,mutation:_0x14f12d,changed:_0x3f189}=await prepareUserMutation(_0xfa2eff,_0x40fa74(0x83),![]);return _0x3f189&&await updateRoleUsers(_0xfa2eff[_0x40fa74(0x7f)],_0x4b1f91),{'ok':!![],'data':_0x14f12d,'message':_0x3f189?_0x40fa74(0x7e)+_0x14f12d[_0x40fa74(0x8b)][_0x40fa74(0x81)]+_0x40fa74(0x7b)+_0x14f12d['selector'][_0x40fa74(0x87)]:_0x40fa74(0x80)+_0x14f12d[_0x40fa74(0x8b)][_0x40fa74(0x81)]+'\x20not\x20in\x20role\x20'+_0x14f12d[_0x40fa74(0x8b)][_0x40fa74(0x87)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a188_0x5471(_0x9e2d36,_0x10932e){_0x9e2d36=_0x9e2d36-0x14d;const _0x54694f=a188_0x5469();let _0x547131=_0x54694f[_0x9e2d36];return _0x547131;}const a188_0x28acb9=a188_0x5471;(function(_0x4b608c,_0x4649a){const _0x70db65=a188_0x5471,_0x3b95ed=_0x4b608c();while(!![]){try{const _0x2b7260=-parseInt(_0x70db65(0x162))/0x1*(parseInt(_0x70db65(0x154))/0x2)+-parseInt(_0x70db65(0x167))/0x3*(-parseInt(_0x70db65(0x150))/0x4)+parseInt(_0x70db65(0x14e))/0x5*(-parseInt(_0x70db65(0x15b))/0x6)+-parseInt(_0x70db65(0x151))/0x7+parseInt(_0x70db65(0x160))/0x8*(parseInt(_0x70db65(0x161))/0x9)+parseInt(_0x70db65(0x152))/0xa*(parseInt(_0x70db65(0x157))/0xb)+parseInt(_0x70db65(0x158))/0xc;if(_0x2b7260===_0x4649a)break;else _0x3b95ed['push'](_0x3b95ed['shift']());}catch(_0x777b36){_0x3b95ed['push'](_0x3b95ed['shift']());}}}(a188_0x5469,0x81ef9));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a188_0x5469(){const _0x5d79a4=['username','1142590uuNPJf','userId','441052yZbCnp','5198739xVrRed','60gumJxL','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','105414IiJbZX','nickname','read','978560ZdYRlq','11588604axdQIO','str','name','6iWMSWa','matchedBy','\x22\x20→\x20userId\x20','flagMissing','role','32qHDAsG','1269711uusiox','19LxKHWG','Pass\x20--name\x20<nickname|username>.','trim','Resolved\x20\x22','user-resolve','12ufUROi'];a188_0x5469=function(){return _0x5d79a4;};return a188_0x5469();}export const roleUserResolve={'service':a188_0x28acb9(0x15f),'command':a188_0x28acb9(0x166),'description':a188_0x28acb9(0x153),'risk':a188_0x28acb9(0x156),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xa42e14){const _0x48d6e3=a188_0x28acb9;if(!_0xa42e14[_0x48d6e3(0x159)](_0x48d6e3(0x15a))[_0x48d6e3(0x164)]())throw CliErrors[_0x48d6e3(0x15e)](_0x48d6e3(0x15a),_0x48d6e3(0x163));},async 'execute'(_0x48ab93){const _0x172e92=a188_0x28acb9,_0x2c4e9a=_0x48ab93[_0x172e92(0x159)]('name')['trim'](),_0x36c760=await resolveUserRef(_0x2c4e9a);return{'ok':!![],'data':{'user':{'userId':_0x36c760[_0x172e92(0x14f)],'username':_0x36c760[_0x172e92(0x14d)],'nickname':_0x36c760[_0x172e92(0x155)],'matchedBy':_0x36c760[_0x172e92(0x15c)]}},'message':_0x172e92(0x165)+_0x2c4e9a+_0x172e92(0x15d)+_0x36c760[_0x172e92(0x14f)]};}};
|