@lovrabet/rabetbase-cli 2.3.16-beta.4 → 2.3.16-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.d.ts +9 -0
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.d.ts +2 -0
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +8 -0
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.d.ts +13 -0
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.d.ts +25 -0
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.d.ts +2 -0
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.d.ts +1 -0
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.d.ts +51 -0
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.d.ts +1 -0
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.d.ts +5 -0
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.d.ts +1 -0
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.d.ts +12 -0
- package/lib/cli-flags.js +1 -1
- package/lib/cli.d.ts +2 -0
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.d.ts +2 -0
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.d.ts +2 -0
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.d.ts +2 -0
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.d.ts +2 -0
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.d.ts +18 -0
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.d.ts +5 -0
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.d.ts +10 -0
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.d.ts +2 -0
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.d.ts +11 -0
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.d.ts +46 -0
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.d.ts +2 -0
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.d.ts +2 -0
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.d.ts +2 -0
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.d.ts +2 -0
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.d.ts +2 -0
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.d.ts +105 -0
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.d.ts +2 -0
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.d.ts +4 -0
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.d.ts +2 -0
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.d.ts +2 -0
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.d.ts +5 -0
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.d.ts +2 -0
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.d.ts +2 -0
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.d.ts +2 -0
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.d.ts +2 -0
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.d.ts +8 -0
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.d.ts +2 -0
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.d.ts +2 -0
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.d.ts +2 -0
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.d.ts +2 -0
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.d.ts +17 -0
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.d.ts +17 -0
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.d.ts +11 -0
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.d.ts +12 -0
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.d.ts +26 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.d.ts +6 -0
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.d.ts +13 -0
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.d.ts +5 -0
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.d.ts +5 -0
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.d.ts +5 -0
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.d.ts +5 -0
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.d.ts +16 -0
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.d.ts +7 -0
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.d.ts +7 -0
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.d.ts +8 -0
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.d.ts +33 -0
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.d.ts +18 -0
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.d.ts +11 -0
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.d.ts +2 -0
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.d.ts +2 -0
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.d.ts +26 -0
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.d.ts +27 -0
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.d.ts +3 -0
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.d.ts +2 -0
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.d.ts +2 -0
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.d.ts +2 -0
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.d.ts +2 -0
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.d.ts +2 -0
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.d.ts +2 -0
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.d.ts +128 -0
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.d.ts +2 -0
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.d.ts +53 -0
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.d.ts +17 -0
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.d.ts +2 -0
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.d.ts +30 -0
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.d.ts +2 -0
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.d.ts +2 -0
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.d.ts +2 -0
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.d.ts +2 -0
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.d.ts +2 -0
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.d.ts +2 -0
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.d.ts +2 -0
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.d.ts +2 -0
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.d.ts +5 -0
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.d.ts +2 -0
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.d.ts +15 -0
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.d.ts +2 -0
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.d.ts +2 -0
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.d.ts +2 -0
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.d.ts +2 -0
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.d.ts +2 -0
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.d.ts +11 -0
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.d.ts +2 -0
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.d.ts +23 -0
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.d.ts +2 -0
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.d.ts +32 -0
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.d.ts +2 -0
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.d.ts +2 -0
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.d.ts +2 -0
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.d.ts +2 -0
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.d.ts +2 -0
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.d.ts +33 -0
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.d.ts +2 -0
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.d.ts +5 -0
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.d.ts +2 -0
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.d.ts +2 -0
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.d.ts +3 -0
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.d.ts +2 -0
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.d.ts +2 -0
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.d.ts +2 -0
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.d.ts +17 -0
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.d.ts +2 -0
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.d.ts +2 -0
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.d.ts +2 -0
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.d.ts +2 -0
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.d.ts +27 -0
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.d.ts +51 -0
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.d.ts +12 -0
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.d.ts +12 -0
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.d.ts +10 -0
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.d.ts +12 -0
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.d.ts +28 -0
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.d.ts +69 -0
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.d.ts +17 -0
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.d.ts +7 -0
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/types.d.ts +162 -0
- package/lib/commands/menu/shared/update-core.d.ts +11 -0
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.d.ts +6 -0
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.d.ts +2 -0
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.d.ts +2 -0
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.d.ts +2 -0
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.d.ts +2 -0
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.d.ts +2 -0
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.d.ts +2 -0
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.d.ts +2 -0
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.d.ts +2 -0
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.d.ts +2 -0
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.d.ts +2 -0
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.d.ts +2 -0
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.d.ts +105 -0
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.d.ts +2 -0
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.d.ts +2 -0
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.d.ts +2 -0
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.d.ts +2 -0
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.d.ts +2 -0
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.d.ts +2 -0
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.d.ts +2 -0
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.d.ts +2 -0
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.d.ts +74 -0
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.d.ts +7 -0
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.d.ts +1 -0
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +6 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.d.ts +9 -0
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.d.ts +4 -0
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +1 -0
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.d.ts +1 -0
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.d.ts +1 -0
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.d.ts +2 -0
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.d.ts +1 -0
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.d.ts +66 -0
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.d.ts +2 -0
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.d.ts +2 -0
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.d.ts +2 -0
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.d.ts +2 -0
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.d.ts +2 -0
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.d.ts +107 -0
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.d.ts +2 -0
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.d.ts +2 -0
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.d.ts +2 -0
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.d.ts +2 -0
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.d.ts +2 -0
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.d.ts +5 -0
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.d.ts +10 -0
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.d.ts +5 -0
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.d.ts +2 -0
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.d.ts +2 -0
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.d.ts +5 -0
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.d.ts +2 -0
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.d.ts +5 -0
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.d.ts +5 -0
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.d.ts +23 -0
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.d.ts +5 -0
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.d.ts +2 -0
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.d.ts +2 -0
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.d.ts +2 -0
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.d.ts +2 -0
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.d.ts +2 -0
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.d.ts +10 -0
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/workspace/add.d.ts +6 -0
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.d.ts +11 -0
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.d.ts +6 -0
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.d.ts +50 -0
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.d.ts +1 -0
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.d.ts +34 -0
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.d.ts +10 -0
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.d.ts +14 -0
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.d.ts +11 -0
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.d.ts +1 -0
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.d.ts +5 -0
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.d.ts +1 -0
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.d.ts +36 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.d.ts +5 -0
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.d.ts +61 -0
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +102 -0
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.d.ts +31 -0
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +1018 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.d.ts +8 -0
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.d.ts +28 -0
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.d.ts +7 -0
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.d.ts +25 -0
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/types.d.ts +92 -0
- package/lib/core/bff/utils.d.ts +25 -0
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.d.ts +43 -0
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.d.ts +6 -0
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.d.ts +4 -0
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.d.ts +8 -0
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/types.d.ts +22 -0
- package/lib/core/sql-index-auditor.d.ts +33 -0
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.d.ts +7 -0
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.d.ts +7 -0
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.d.ts +5 -0
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.d.ts +14 -0
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/types.d.ts +43 -0
- package/lib/core/sql-sync/utils.d.ts +10 -0
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.d.ts +34 -0
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.d.ts +3 -0
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.d.ts +2 -0
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.d.ts +9 -0
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.d.ts +3 -0
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.d.ts +3 -0
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.d.ts +4 -0
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.d.ts +11 -0
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.d.ts +15 -0
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.d.ts +2 -0
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.d.ts +14 -0
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.d.ts +36 -0
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.d.ts +3 -0
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.d.ts +63 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -0
- package/lib/generated/build-info.js +1 -1
- package/lib/help.d.ts +1 -0
- package/lib/help.js +1 -1
- package/lib/runtime/confirmation.d.ts +4 -0
- package/lib/runtime/confirmation.js +1 -0
- package/lib/runtime/event.d.ts +5 -0
- package/lib/runtime/event.js +1 -0
- package/lib/runtime/index.d.ts +7 -0
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/queue.d.ts +5 -0
- package/lib/runtime/queue.js +1 -0
- package/lib/runtime/resolve.d.ts +8 -0
- package/lib/runtime/resolve.js +1 -0
- package/lib/runtime/types.d.ts +50 -0
- package/lib/runtime/types.js +1 -0
- package/lib/skills/main.d.ts +41 -0
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +99 -0
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.d.ts +44 -0
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.d.ts +12 -0
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.d.ts +8 -0
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.d.ts +6 -0
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.d.ts +3 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.d.ts +17 -0
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.d.ts +26 -0
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +93 -0
- package/lib/utils/ai_config.d.ts +47 -0
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.d.ts +1 -0
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.d.ts +42 -0
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.d.ts +23 -0
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.d.ts +37 -0
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.d.ts +9 -0
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.d.ts +42 -0
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.d.ts +1 -0
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.d.ts +30 -0
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.d.ts +25 -0
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.d.ts +80 -0
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.d.ts +30 -0
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.d.ts +7 -0
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.d.ts +62 -0
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.d.ts +15 -0
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.d.ts +21 -0
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.d.ts +38 -0
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.d.ts +1 -0
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.d.ts +55 -0
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.d.ts +10 -0
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.d.ts +1 -0
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.d.ts +1 -0
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.d.ts +6 -0
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a160_0x5bab(){const _0x2a0ee4=['nonInteractive','project','5628762bnSRLo','cookie','11086LOdFOa','string','str','7EnwyMo','project-name','create','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','name','validation','write','args','7125792tRmyxn','trim','appcode','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','bool','Usage:\x20','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','env','22xhWXbY','6306664riuJAr','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','../../commands/project/create/non-interactive.js','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','173427JuPkER','../../commands/project/create/main.js','7636635LuBxxC','13378491cKhBoc','yes'];a160_0x5bab=function(){return _0x2a0ee4;};return a160_0x5bab();}function a160_0x15da(_0x26ede5,_0x56702e){_0x26ede5=_0x26ede5-0x95;const _0x5babf9=a160_0x5bab();let _0x15da53=_0x5babf9[_0x26ede5];return _0x15da53;}const a160_0x46cda0=a160_0x15da;(function(_0x31889d,_0x2c7621){const _0x509adf=a160_0x15da,_0x44fe92=_0x31889d();while(!![]){try{const _0x5bbdfb=-parseInt(_0x509adf(0xa1))/0x1+parseInt(_0x509adf(0xb4))/0x2*(-parseInt(_0x509adf(0x98))/0x3)+parseInt(_0x509adf(0xac))/0x4+-parseInt(_0x509adf(0x9a))/0x5+-parseInt(_0x509adf(0x9f))/0x6*(parseInt(_0x509adf(0xa4))/0x7)+parseInt(_0x509adf(0xb5))/0x8+parseInt(_0x509adf(0x9b))/0x9;if(_0x5bbdfb===_0x2c7621)break;else _0x44fe92['push'](_0x44fe92['shift']());}catch(_0x37c9cf){_0x44fe92['push'](_0x44fe92['shift']());}}}(a160_0x5bab,0xe66e1));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{upgradeApp}from'../../commands/project/upgrade.js';const createFlags=[{'name':'name','type':a160_0x46cda0(0xa2),'description':'Project\x20name'},{'name':a160_0x46cda0(0xb3),'type':a160_0x46cda0(0xa2),'description':'Target\x20environment'},{'name':a160_0x46cda0(0xae),'type':a160_0x46cda0(0xa2),'description':a160_0x46cda0(0xb2)}],upgradeFlags=[{'name':a160_0x46cda0(0x9c),'type':'boolean','description':'Skip\x20confirmation\x20prompt','default':![]}];export const projectDefinitions=[{'service':a160_0x46cda0(0x9e),'command':a160_0x46cda0(0xa6),'description':'Create\x20a\x20new\x20project','risk':a160_0x46cda0(0xaa),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a160_0x46cda0(0xa5),'description':a160_0x46cda0(0xa7),'required':![]}],'flags':createFlags,async 'execute'(_0x3b5c4){const _0x2c3727=a160_0x46cda0,{createApp:_0x5038f6}=await import(_0x2c3727(0x99)),{createProjectNonInteractive:_0xa105c1}=await import(_0x2c3727(0x96)),_0x229da2=_0x3b5c4[_0x2c3727(0xa3)](_0x2c3727(0xa8))[_0x2c3727(0xad)]()||_0x3b5c4[_0x2c3727(0xab)][0x0]?.[_0x2c3727(0xad)](),_0x52c236=_0x3b5c4[_0x2c3727(0xa3)](_0x2c3727(0xb3))||undefined,_0x2dec75=_0x3b5c4[_0x2c3727(0xa3)]('appcode')||undefined;if(_0x3b5c4[_0x2c3727(0x9d)]){if(!_0x229da2)throw CliErrors[_0x2c3727(0xa9)](_0x2c3727(0xaf),_0x2c3727(0xb1)+CLI_BIN_NAME+_0x2c3727(0x95));await _0xa105c1(_0x229da2,_0x52c236,_0x2dec75,_0x3b5c4[_0x2c3727(0xa0)]);}else await _0x5038f6({'projectCode':_0x229da2,'appCode':_0x2dec75,'env':_0x52c236,'cookie':_0x3b5c4[_0x2c3727(0xa0)]});return{'ok':!![]};}},{'service':'project','command':'upgrade','description':a160_0x46cda0(0x97),'risk':a160_0x46cda0(0xaa),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x395c54){const _0x9eca9b=a160_0x46cda0;return await upgradeApp(_0x395c54['nonInteractive'],{'yes':_0x395c54[_0x9eca9b(0xb0)]('yes')}),{'ok':!![]};}}];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function upgradeApp(nonInteractive: boolean, flags: Record<string, any>): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x327969,_0x348e92){const _0x37ed14=a161_0x6f84,_0x4f41ba=_0x327969();while(!![]){try{const _0x3901c4=parseInt(_0x37ed14(0x1fc))/0x1*(-parseInt(_0x37ed14(0x1a2))/0x2)+parseInt(_0x37ed14(0x1ac))/0x3*(parseInt(_0x37ed14(0x1d8))/0x4)+parseInt(_0x37ed14(0x19f))/0x5+parseInt(_0x37ed14(0x1f4))/0x6+parseInt(_0x37ed14(0x213))/0x7+parseInt(_0x37ed14(0x1a1))/0x8*(parseInt(_0x37ed14(0x1f3))/0x9)+parseInt(_0x37ed14(0x1cc))/0xa*(-parseInt(_0x37ed14(0x214))/0xb);if(_0x3901c4===_0x348e92)break;else _0x4f41ba['push'](_0x4f41ba['shift']());}catch(_0x2a1d55){_0x4f41ba['push'](_0x4f41ba['shift']());}}}(a161_0x63d9,0x62ec4));import a161_0xac24f8 from'chalk';import a161_0x4414e5 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';function a161_0x63d9(){const _0x2bdac7=['Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','error','Skill\x20swap:','no\x20legacy\x20config\x20found','\x20\x20Fields\x20to\x20migrate:\x20','fail','message','[\x22@lovrabet/sdk\x22]:\x20','\x20\x20npm\x20install','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','object','\x20\x20Step\x20','oldMcpConfig','\x20→\x20latest','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','inherit','none\x20found','\x20→\x20','stringify','undefined','skipped','files','1067101EGRswu','99hdFKsD','Config\x20migration','\x20\x20\x20\x20\x20\x20\x20','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','3073180GkaKzI','succeed','904ZWjeQp','182sdYnQO','Legacy\x20artifacts:','done','FAIL','white','.bak','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','Remove\x20.lovrabet/','Step\x204/7:\x20MCP\x20config\x20—\x20','string','57927HYUSnO','latest','Step\x205/7:\x20Removing\x20old\x20skill...','sdkUpgrade','Upgrade\x20cancelled.','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','Step\x201/7:\x20Migrating\x20config...','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','oldPath','Clean\x20MCP\x20config','devDependencies','isArray','start','path','length','log','Remove\x20old\x20skill','no\x20legacy\x20entry','keys','\x20\x20#\x20or','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','failed','no\x20matching\x20entry\x20found','bold','dependencies','needed','\x20\x20New\x20config\x20(.rabetbase.json):\x20','\x20removed','Upgrade\x20@lovrabet/sdk','cwd','.cursor/mcp.json','info','432750HceoqJ','utf8','mcpServers','@lovrabet/sdk','\x20removed\x20(','MCP\x20config:','FOUND','detail','already\x20exists\x20(will\x20merge)','args','needsSkillSwap','gray','4iBTxzH','entries','fields','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','CANCEL','label','not\x20needed','cyan','Step\x206/7:\x20Installing\x20new\x20skill...','Config\x20file:','\x20→\x20keys:\x20','join','parse','oldArtifacts','\x20\x20bun\x20install','red','@lovrabet/dataset-mcp-server','.lovrabet','push','step','\x20\x20Current\x20version\x20in\x20','exit\x20','yellow','green','hasNewConfig','includes','@lovrabet/sdk:','15885GIeCkw','3510906dvUiTr','isDirectory','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','Install\x20new\x20skill','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','Upgrade\x20completed\x20successfully!','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','.claude/skills/lovrabet','8531moyqcw'];a161_0x63d9=function(){return _0x2bdac7;};return a161_0x63d9();}import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x399470=>_0x399470!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x6fd3d){const _0x11977d=a161_0x6f84,_0x3a0e7d=[];for(const _0x49d0b6 of Object['values'](CORE_IDE_CONFIGS)){if(_0x49d0b6[_0x11977d(0x212)])for(const _0x53049a of _0x49d0b6[_0x11977d(0x212)]){_0x3a0e7d['push'](resolve(_0x6fd3d,_0x53049a[_0x11977d(0x1b9)]));}}return _0x3a0e7d;}function analyse(_0x2f659b){const _0x2616f0=a161_0x6f84;let _0x14dae3=null;const _0x2b0a96=resolve(_0x2f659b,NEW_CONFIG_NAME),_0x4072ab=existsSync(_0x2b0a96);for(const _0x492f4a of LEGACY_CONFIG_NAMES){const _0x591c19=resolve(_0x2f659b,_0x492f4a);if(existsSync(_0x591c19)){const _0x566155=readConfigFile(_0x591c19),_0x53b97e=Object[_0x2616f0(0x1be)](_0x566155)['filter'](_0x4b5bb0=>typeof _0x566155[_0x4b5bb0]!==_0x2616f0(0x210));_0x14dae3={'oldPath':_0x591c19,'hasNewConfig':_0x4072ab,'fields':_0x53b97e};break;}}const _0x54b026=[],_0x2f397c=resolve(_0x2f659b,_0x2616f0(0x1e9));if(existsSync(_0x2f397c))_0x54b026[_0x2616f0(0x1ea)](_0x2f397c);const _0x4b368f=resolve(_0x2f659b,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x4b368f))_0x54b026['push'](_0x4b368f);const _0x16cdac=resolve(_0x2f659b,_0x2616f0(0x1fb));if(existsSync(_0x16cdac))_0x54b026[_0x2616f0(0x1ea)](_0x16cdac);for(const _0x434fbb of collectIdeSkillFiles(_0x2f659b)){if(existsSync(_0x434fbb))_0x54b026['push'](_0x434fbb);}let _0x29fba9=null;const _0x369cb8=resolve(_0x2f659b,_0x2616f0(0x1ca));if(existsSync(_0x369cb8))try{const _0x8cd2a5=JSON[_0x2616f0(0x1e4)](readFileSync(_0x369cb8,'utf8'));if(_0x8cd2a5?.[_0x2616f0(0x1ce)]&&typeof _0x8cd2a5[_0x2616f0(0x1ce)]===_0x2616f0(0x207)){const _0x12d27b=[];for(const [_0x5702a2,_0x20c003]of Object[_0x2616f0(0x1d9)](_0x8cd2a5[_0x2616f0(0x1ce)])){const _0x29fde1=_0x20c003;_0x29fde1?.[_0x2616f0(0x1d5)]&&Array[_0x2616f0(0x1b7)](_0x29fde1[_0x2616f0(0x1d5)])&&_0x29fde1[_0x2616f0(0x1d5)]['some'](_0x266f26=>typeof _0x266f26===_0x2616f0(0x1ab)&&_0x266f26[_0x2616f0(0x1f1)](_0x2616f0(0x1e8)))&&_0x12d27b[_0x2616f0(0x1ea)](_0x5702a2);}_0x12d27b['length']>0x0&&(_0x29fba9={'path':_0x369cb8,'keys':_0x12d27b});}}catch{}const _0x72d114=_0x54b026[_0x2616f0(0x1ba)]>0x0||_0x14dae3!==null;let _0x1373a8=null;const _0x40cbd9=resolve(_0x2f659b,'package.json');if(existsSync(_0x40cbd9))try{const _0x4c0111=JSON[_0x2616f0(0x1e4)](readFileSync(_0x40cbd9,_0x2616f0(0x1cd)));for(const _0x200c3c of[_0x2616f0(0x1c4),_0x2616f0(0x1b6)]){const _0x3940b0=_0x4c0111?.[_0x200c3c]?.[_0x2616f0(0x1cf)];if(typeof _0x3940b0===_0x2616f0(0x1ab)){_0x3940b0!==_0x2616f0(0x1ad)&&(_0x1373a8={'pkgPath':_0x40cbd9,'currentVersion':_0x3940b0,'field':_0x200c3c});break;}}}catch{}return{'configMigration':_0x14dae3,'oldArtifacts':_0x54b026,'oldMcpConfig':_0x29fba9,'needsSkillSwap':_0x72d114,'sdkUpgrade':_0x1373a8};}function printReport(_0x3a1294){const _0x268fed=a161_0x6f84,{configMigration:_0x5489ee,oldArtifacts:_0x548d0b,oldMcpConfig:_0x205023,needsSkillSwap:_0x245ed5}=_0x3a1294;console[_0x268fed(0x1bb)](''),console['log'](a161_0xac24f8[_0x268fed(0x1c3)]('===\x20Upgrade\x20Analysis\x20===')),console[_0x268fed(0x1bb)]('');_0x5489ee?(console[_0x268fed(0x1bb)](a161_0xac24f8[_0x268fed(0x1df)](_0x268fed(0x1e1))+('\x20\x20'+a161_0xac24f8[_0x268fed(0x1ee)](_0x5489ee['oldPath']))),console['log'](_0x268fed(0x1c6)+(_0x5489ee['hasNewConfig']?a161_0xac24f8[_0x268fed(0x1ef)](_0x268fed(0x1d4)):a161_0xac24f8[_0x268fed(0x1d7)]('not\x20found\x20(will\x20create)'))),console[_0x268fed(0x1bb)](_0x268fed(0x201)+_0x5489ee[_0x268fed(0x1da)][_0x268fed(0x1e3)](',\x20')),console[_0x268fed(0x1bb)](_0x268fed(0x1f8))):console['log'](a161_0xac24f8[_0x268fed(0x1df)]('Config\x20file:')+'\x20\x20'+a161_0xac24f8[_0x268fed(0x1d7)](_0x268fed(0x200)));console[_0x268fed(0x1bb)]('');if(_0x548d0b[_0x268fed(0x1ba)]>0x0){console[_0x268fed(0x1bb)](a161_0xac24f8[_0x268fed(0x1df)]('Legacy\x20artifacts:'));for(const _0x1060a7 of _0x548d0b){console['log']('\x20\x20'+a161_0xac24f8['red'](_0x268fed(0x1d2))+'\x20\x20'+_0x1060a7);}console[_0x268fed(0x1bb)]('\x20\x20Action:\x20delete');}else console['log'](a161_0xac24f8[_0x268fed(0x1df)](_0x268fed(0x1a3))+'\x20\x20'+a161_0xac24f8['gray'](_0x268fed(0x20d)));console['log']('');_0x205023?(console['log'](a161_0xac24f8[_0x268fed(0x1df)](_0x268fed(0x1d1))+('\x20\x20'+a161_0xac24f8[_0x268fed(0x1ee)](_0x205023[_0x268fed(0x1b9)])+_0x268fed(0x1e2)+_0x205023[_0x268fed(0x1be)][_0x268fed(0x1e3)](',\x20'))),console['log']('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x268fed(0x1bb)](a161_0xac24f8['cyan'](_0x268fed(0x1d1))+'\x20\x20'+a161_0xac24f8[_0x268fed(0x1d7)](_0x268fed(0x1bd)));console[_0x268fed(0x1bb)](''),console[_0x268fed(0x1bb)](a161_0xac24f8[_0x268fed(0x1df)](_0x268fed(0x1ff))+('\x20\x20'+(_0x245ed5?a161_0xac24f8['yellow'](_0x268fed(0x1c5)):a161_0xac24f8[_0x268fed(0x1ef)](_0x268fed(0x1de)))));_0x245ed5&&console['log'](_0x268fed(0x1f6)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x268fed(0x1bb)]('');if(_0x3a1294[_0x268fed(0x1af)]){const {currentVersion:_0x20fabc,field:_0x48fa5f,pkgPath:_0x166cea}=_0x3a1294[_0x268fed(0x1af)];console[_0x268fed(0x1bb)](a161_0xac24f8[_0x268fed(0x1df)](_0x268fed(0x1f2))+('\x20\x20'+a161_0xac24f8[_0x268fed(0x1ee)](_0x166cea))),console['log'](_0x268fed(0x1ec)+_0x48fa5f+':\x20'+a161_0xac24f8['yellow'](_0x20fabc)+_0x268fed(0x20e)+a161_0xac24f8[_0x268fed(0x1ef)](_0x268fed(0x1ad))),console[_0x268fed(0x1bb)](_0x268fed(0x1b1));}else console[_0x268fed(0x1bb)](a161_0xac24f8[_0x268fed(0x1df)](_0x268fed(0x1f2))+'\x20\x20'+a161_0xac24f8['gray']('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x268fed(0x1bb)]('');}function execConfigMigration(_0x57f886,_0x441c2d){const _0x5418d2=a161_0x6f84,{configMigration:_0x121b7d}=_0x57f886;if(!_0x121b7d?.[_0x5418d2(0x1b4)])return{'step':0x1,'label':_0x5418d2(0x215),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0xbdf590=readConfigFile(_0x121b7d['oldPath']),_0x19d9b9=resolve(_0x441c2d,NEW_CONFIG_NAME),_0x87be9b=_0x121b7d[_0x5418d2(0x1f0)]?readConfigFile(_0x19d9b9):{};for(const [_0x453681,_0x218fd4]of Object[_0x5418d2(0x1d9)](_0xbdf590)){!(_0x453681 in _0x87be9b)&&(_0x87be9b[_0x453681]=_0x218fd4);}writeConfigFile(_0x19d9b9,_0x87be9b);const _0x1830b7=_0x121b7d[_0x5418d2(0x1b4)]+_0x5418d2(0x1a7);return renameSync(_0x121b7d[_0x5418d2(0x1b4)],_0x1830b7),{'step':0x1,'label':_0x5418d2(0x215),'ok':!![],'detail':_0x121b7d[_0x5418d2(0x1b4)]+_0x5418d2(0x20e)+_0x19d9b9+'\x20(backup:\x20'+_0x1830b7+')'};}function execRemoveOldArtifacts(_0x3cf023){const _0x2aa4e2=a161_0x6f84,_0x4ae6ca=[];for(const _0x2e2a37 of _0x3cf023){try{if(!existsSync(_0x2e2a37))continue;const _0x341541=tryStat(_0x2e2a37);_0x341541?.[_0x2aa4e2(0x1f5)]()?rmSync(_0x2e2a37,{'recursive':!![],'force':!![]}):unlinkSync(_0x2e2a37);}catch(_0xb31ca){_0x4ae6ca[_0x2aa4e2(0x1ea)](_0x2e2a37+':\x20'+_0xb31ca[_0x2aa4e2(0x203)]);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x4ae6ca['length']===0x0,'detail':_0x4ae6ca['length']>0x0?_0x3cf023[_0x2aa4e2(0x1ba)]-_0x4ae6ca[_0x2aa4e2(0x1ba)]+'/'+_0x3cf023[_0x2aa4e2(0x1ba)]+_0x2aa4e2(0x1d0)+_0x4ae6ca[_0x2aa4e2(0x1e3)](';\x20')+')':_0x3cf023[_0x2aa4e2(0x1ba)]+_0x2aa4e2(0x1c7)};}function execCleanMcp(_0xa2bc24){const _0x5b61df=a161_0x6f84;if(!_0xa2bc24[_0x5b61df(0x209)])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x5b61df(0x211)};try{const _0x55a701=readFileSync(_0xa2bc24['oldMcpConfig'][_0x5b61df(0x1b9)],_0x5b61df(0x1cd)),_0x165786=JSON['parse'](_0x55a701);if(_0x165786?.[_0x5b61df(0x1ce)]&&typeof _0x165786['mcpServers']==='object'){const _0x10df5d=[];for(const [_0x480036,_0x4af82e]of Object[_0x5b61df(0x1d9)](_0x165786['mcpServers'])){_0x4af82e?.['args']&&Array[_0x5b61df(0x1b7)](_0x4af82e[_0x5b61df(0x1d5)])&&_0x4af82e['args']['some'](_0x55608c=>typeof _0x55608c===_0x5b61df(0x1ab)&&_0x55608c[_0x5b61df(0x1f1)](_0x5b61df(0x1e8)))&&_0x10df5d[_0x5b61df(0x1ea)](_0x480036);}for(const _0x37f5da of _0x10df5d){delete _0x165786[_0x5b61df(0x1ce)][_0x37f5da];}return _0x10df5d[_0x5b61df(0x1ba)]>0x0&&writeFileSync(_0xa2bc24[_0x5b61df(0x209)]['path'],JSON[_0x5b61df(0x20f)](_0x165786,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'removed\x20'+_0x10df5d[_0x5b61df(0x1e3)](',\x20')+'\x20from\x20'+_0xa2bc24[_0x5b61df(0x209)][_0x5b61df(0x1b9)]};}return{'step':0x4,'label':_0x5b61df(0x1b5),'ok':!![],'detail':_0x5b61df(0x1c2)};}catch(_0x3239f6){return{'step':0x4,'label':_0x5b61df(0x1b5),'ok':![],'detail':_0x3239f6['message']};}}function execSkillsRemove(_0x45698a,_0x2aff06){const _0xe0e751=a161_0x6f84,_0x4c719a=runNpxSkillsRemove(_0x45698a,{'stdio':_0xe0e751(0x20c),'yes':_0x2aff06});return{'step':0x5,'label':_0xe0e751(0x1bc),'ok':_0x4c719a['ok'],'detail':_0x4c719a['ok']?'lovrabet/lovrabet-skill\x20removed':_0x4c719a[_0xe0e751(0x1fe)]??'exit\x20'+_0x4c719a['status']};}function execSkillsAdd(_0x6ecbb0,_0xb247c9){const _0x5c6f14=a161_0x6f84,_0x15eb84=runNpxSkillsAddGlobal(_0x6ecbb0,'lovrabet/rabetbase',{'stdio':'inherit','yes':_0xb247c9});return{'step':0x6,'label':_0x5c6f14(0x1f7),'ok':_0x15eb84['ok'],'detail':_0x15eb84['ok']?'lovrabet/rabetbase\x20installed\x20globally':_0x15eb84[_0x5c6f14(0x1fe)]??_0x5c6f14(0x1ed)+_0x15eb84['status']};}function execUpgradeSdk(_0x201085){const _0x40ab95=a161_0x6f84;if(!_0x201085['sdkUpgrade'])return{'step':0x7,'label':_0x40ab95(0x1c8),'ok':!![],'detail':_0x40ab95(0x1a8)};const {pkgPath:_0x9302fd,currentVersion:_0x137124,field:_0x2c76a5}=_0x201085[_0x40ab95(0x1af)];try{const _0x5758f8=readFileSync(_0x9302fd,_0x40ab95(0x1cd)),_0x362d3b=JSON['parse'](_0x5758f8);return _0x362d3b[_0x2c76a5][_0x40ab95(0x1cf)]=_0x40ab95(0x1ad),writeFileSync(_0x9302fd,JSON[_0x40ab95(0x20f)](_0x362d3b,null,0x2)+'\x0a',_0x40ab95(0x1cd)),{'step':0x7,'label':_0x40ab95(0x1c8),'ok':!![],'detail':_0x2c76a5+_0x40ab95(0x204)+_0x137124+_0x40ab95(0x20a)};}catch(_0x462642){return{'step':0x7,'label':_0x40ab95(0x1c8),'ok':![],'detail':_0x462642[_0x40ab95(0x203)]};}}function tryStat(_0x17d977){try{return statSync(_0x17d977);}catch{return undefined;}}function printSummary(_0x383683){const _0x1ad0db=a161_0x6f84;console[_0x1ad0db(0x1bb)](''),console[_0x1ad0db(0x1bb)](a161_0xac24f8[_0x1ad0db(0x1c3)]('===\x20Upgrade\x20Summary\x20===')),console[_0x1ad0db(0x1bb)]('');for(const _0x5c0c88 of _0x383683){const _0x3aa382=_0x5c0c88['ok']?a161_0xac24f8[_0x1ad0db(0x1ef)]('OK'):a161_0xac24f8[_0x1ad0db(0x1e7)](_0x1ad0db(0x1a5));console[_0x1ad0db(0x1bb)]('\x20\x20'+_0x3aa382+_0x1ad0db(0x208)+_0x5c0c88[_0x1ad0db(0x1eb)]+':\x20'+_0x5c0c88[_0x1ad0db(0x1dd)]);if(_0x5c0c88[_0x1ad0db(0x1d3)])console[_0x1ad0db(0x1bb)](_0x1ad0db(0x216)+a161_0xac24f8[_0x1ad0db(0x1d7)](_0x5c0c88[_0x1ad0db(0x1d3)]));}console[_0x1ad0db(0x1bb)]('');}function a161_0x6f84(_0x2cc931,_0x50da2b){_0x2cc931=_0x2cc931-0x19e;const _0x63d9b3=a161_0x63d9();let _0x6f84c6=_0x63d9b3[_0x2cc931];return _0x6f84c6;}export async function upgradeApp(_0x1b5e7b,_0x429971){const _0x191de4=a161_0x6f84,_0x31d328=process[_0x191de4(0x1c9)](),_0x3d9aad=analyse(_0x31d328),_0xd6fa22=!_0x3d9aad['configMigration']&&_0x3d9aad['oldArtifacts']['length']===0x0&&!_0x3d9aad['oldMcpConfig']&&!_0x3d9aad[_0x191de4(0x1d6)]&&!_0x3d9aad[_0x191de4(0x1af)];if(_0xd6fa22){console[_0x191de4(0x1bb)](a161_0xac24f8[_0x191de4(0x1ef)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x3d9aad);const _0xde892=!!(_0x429971['yes']||_0x429971['Y']||_0x1b5e7b);if(!_0xde892)try{const _0xcf552a=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0xcf552a){console[_0x191de4(0x1bb)](a161_0xac24f8[_0x191de4(0x1d7)]('Upgrade\x20cancelled.'));return;}}catch(_0x55f1ab){if(_0x55f1ab?.['message']===_0x191de4(0x1dc)){console['log'](a161_0xac24f8[_0x191de4(0x1d7)](_0x191de4(0x1b0)));return;}throw _0x55f1ab;}const _0xdce02=[],_0x13d885=a161_0x4414e5({'text':_0x191de4(0x1b2),'color':_0x191de4(0x1df)})[_0x191de4(0x1b8)](),_0x5b4c79=execConfigMigration(_0x3d9aad,_0x31d328);_0xdce02['push'](_0x5b4c79),_0x13d885[_0x5b4c79['ok']?_0x191de4(0x1a0):_0x191de4(0x202)]('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0x5b4c79[_0x191de4(0x1d3)]??(_0x5b4c79['ok']?_0x191de4(0x1a4):_0x191de4(0x1c1))));const _0x50af96=resolve(_0x31d328,_0x191de4(0x1e9)),_0x1fd1fc=a161_0x4414e5({'text':_0x191de4(0x206),'color':_0x191de4(0x1df)})[_0x191de4(0x1b8)]();if(existsSync(_0x50af96))try{rmSync(_0x50af96,{'recursive':!![],'force':!![]}),_0x1fd1fc[_0x191de4(0x1a0)](_0x191de4(0x217)),_0xdce02[_0x191de4(0x1ea)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x2ea41b){_0x1fd1fc['fail']('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x2ea41b[_0x191de4(0x203)]),_0xdce02[_0x191de4(0x1ea)]({'step':0x2,'label':_0x191de4(0x1a9),'ok':![],'detail':_0x2ea41b[_0x191de4(0x203)]});}else _0x1fd1fc[_0x191de4(0x1cb)](_0x191de4(0x1c0)),_0xdce02[_0x191de4(0x1ea)]({'step':0x2,'label':_0x191de4(0x1a9),'ok':!![],'detail':_0x191de4(0x211)});const _0x240ef7=a161_0x4414e5({'text':_0x191de4(0x1fa),'color':'cyan'})['start'](),_0x3ed434=execRemoveOldArtifacts(_0x3d9aad[_0x191de4(0x1e5)]);_0xdce02[_0x191de4(0x1ea)](_0x3ed434),_0x240ef7[_0x3ed434['ok']?_0x191de4(0x1a0):'fail'](_0x191de4(0x1fd)+(_0x3ed434['detail']??(_0x3ed434['ok']?_0x191de4(0x1a4):'failed')));const _0x5ccefd=a161_0x4414e5({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':'cyan'})[_0x191de4(0x1b8)](),_0x416ce2=execCleanMcp(_0x3d9aad);_0xdce02[_0x191de4(0x1ea)](_0x416ce2),_0x5ccefd[_0x416ce2['ok']?_0x191de4(0x1a0):_0x191de4(0x202)](_0x191de4(0x1aa)+(_0x416ce2[_0x191de4(0x1d3)]??(_0x416ce2['ok']?'done':_0x191de4(0x1c1))));const _0x8239d=a161_0x4414e5({'text':_0x191de4(0x1ae),'color':_0x191de4(0x1df)})[_0x191de4(0x1b8)](),_0x3b7391=execSkillsRemove(_0x31d328,_0xde892);_0xdce02[_0x191de4(0x1ea)](_0x3b7391),_0x8239d[_0x3b7391['ok']?_0x191de4(0x1a0):'fail']('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x3b7391[_0x191de4(0x1d3)]??(_0x3b7391['ok']?_0x191de4(0x1a4):'failed')));const _0xcce3f9=a161_0x4414e5({'text':_0x191de4(0x1e0),'color':'cyan'})[_0x191de4(0x1b8)](),_0x4efae1=execSkillsAdd(_0x31d328,_0xde892);_0xdce02[_0x191de4(0x1ea)](_0x4efae1),_0xcce3f9[_0x4efae1['ok']?_0x191de4(0x1a0):_0x191de4(0x202)](_0x191de4(0x1b3)+(_0x4efae1[_0x191de4(0x1d3)]??(_0x4efae1['ok']?_0x191de4(0x1a4):_0x191de4(0x1c1))));const _0x10dc48=a161_0x4414e5({'text':_0x191de4(0x20b),'color':_0x191de4(0x1df)})[_0x191de4(0x1b8)](),_0x3431d6=execUpgradeSdk(_0x3d9aad);_0xdce02['push'](_0x3431d6),_0x10dc48[_0x3431d6['ok']?_0x191de4(0x1a0):_0x191de4(0x202)](_0x191de4(0x1db)+(_0x3431d6['detail']??(_0x3431d6['ok']?'done':_0x191de4(0x1c1)))),printSummary(_0xdce02);const _0x57e72d=_0xdce02['some'](_0x3736cc=>!_0x3736cc['ok']);_0x57e72d?console[_0x191de4(0x1bb)](a161_0xac24f8[_0x191de4(0x1ee)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console['log'](a161_0xac24f8[_0x191de4(0x1ef)](_0x191de4(0x1f9))),_0x3431d6['ok']&&_0x3d9aad[_0x191de4(0x1af)]&&(console[_0x191de4(0x1bb)](''),console[_0x191de4(0x1bb)](a161_0xac24f8['bold'][_0x191de4(0x1df)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x191de4(0x1bb)](a161_0xac24f8['cyan'](_0x191de4(0x19e))),console[_0x191de4(0x1bb)](''),console[_0x191de4(0x1bb)](a161_0xac24f8['white'](_0x191de4(0x205))),console['log'](a161_0xac24f8['white'](_0x191de4(0x1bf))),console['log'](a161_0xac24f8[_0x191de4(0x1a6)](_0x191de4(0x1e6))),console[_0x191de4(0x1bb)](''));}
|
|
1
|
+
(function(_0x177d03,_0x267507){const _0x3041be=a161_0x5081,_0xdecd8=_0x177d03();while(!![]){try{const _0x48df19=parseInt(_0x3041be(0xa1))/0x1*(parseInt(_0x3041be(0xe8))/0x2)+-parseInt(_0x3041be(0xc2))/0x3+parseInt(_0x3041be(0xf8))/0x4+-parseInt(_0x3041be(0x105))/0x5+parseInt(_0x3041be(0xae))/0x6*(-parseInt(_0x3041be(0x10b))/0x7)+parseInt(_0x3041be(0xcb))/0x8+parseInt(_0x3041be(0xc3))/0x9;if(_0x48df19===_0x267507)break;else _0xdecd8['push'](_0xdecd8['shift']());}catch(_0xa6201e){_0xdecd8['push'](_0xdecd8['shift']());}}}(a161_0xcd73,0xd3691));import a161_0xedf86f from'chalk';import a161_0x35b839 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';function a161_0x5081(_0x1e485b,_0x2cf2b7){_0x1e485b=_0x1e485b-0x90;const _0xcd73d3=a161_0xcd73();let _0x5081ff=_0xcd73d3[_0x1e485b];return _0x5081ff;}const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0xf82426=>_0xf82426!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x10d5d8){const _0x59b3e5=a161_0x5081,_0x2128c9=[];for(const _0x587ce3 of Object[_0x59b3e5(0xe9)](CORE_IDE_CONFIGS)){if(_0x587ce3[_0x59b3e5(0xda)])for(const _0x3caf4b of _0x587ce3[_0x59b3e5(0xda)]){_0x2128c9['push'](resolve(_0x10d5d8,_0x3caf4b['path']));}}return _0x2128c9;}function analyse(_0x1e4240){const _0x2e9289=a161_0x5081;let _0x3046d6=null;const _0x721d4a=resolve(_0x1e4240,NEW_CONFIG_NAME),_0x327175=existsSync(_0x721d4a);for(const _0x3e0323 of LEGACY_CONFIG_NAMES){const _0x39a9f2=resolve(_0x1e4240,_0x3e0323);if(existsSync(_0x39a9f2)){const _0x4bb279=readConfigFile(_0x39a9f2),_0x4d8028=Object[_0x2e9289(0x104)](_0x4bb279)[_0x2e9289(0xa2)](_0x19e264=>typeof _0x4bb279[_0x19e264]!==_0x2e9289(0x99));_0x3046d6={'oldPath':_0x39a9f2,'hasNewConfig':_0x327175,'fields':_0x4d8028};break;}}const _0x2e8be4=[],_0x2c1556=resolve(_0x1e4240,_0x2e9289(0x9f));if(existsSync(_0x2c1556))_0x2e8be4[_0x2e9289(0xe4)](_0x2c1556);const _0x53bdfe=resolve(_0x1e4240,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x53bdfe))_0x2e8be4[_0x2e9289(0xe4)](_0x53bdfe);const _0xc41ccd=resolve(_0x1e4240,_0x2e9289(0xa0));if(existsSync(_0xc41ccd))_0x2e8be4['push'](_0xc41ccd);for(const _0x195010 of collectIdeSkillFiles(_0x1e4240)){if(existsSync(_0x195010))_0x2e8be4['push'](_0x195010);}let _0x10fbb5=null;const _0x5f42df=resolve(_0x1e4240,_0x2e9289(0xd5));if(existsSync(_0x5f42df))try{const _0x11e83b=JSON['parse'](readFileSync(_0x5f42df,_0x2e9289(0xab)));if(_0x11e83b?.[_0x2e9289(0xfd)]&&typeof _0x11e83b[_0x2e9289(0xfd)]===_0x2e9289(0xc0)){const _0x5284a7=[];for(const [_0x3286b7,_0x4af255]of Object[_0x2e9289(0x10f)](_0x11e83b['mcpServers'])){const _0x3a099e=_0x4af255;_0x3a099e?.[_0x2e9289(0xd7)]&&Array[_0x2e9289(0xc9)](_0x3a099e[_0x2e9289(0xd7)])&&_0x3a099e[_0x2e9289(0xd7)]['some'](_0x39922f=>typeof _0x39922f===_0x2e9289(0xb8)&&_0x39922f[_0x2e9289(0xb3)](_0x2e9289(0x92)))&&_0x5284a7[_0x2e9289(0xe4)](_0x3286b7);}_0x5284a7[_0x2e9289(0xd2)]>0x0&&(_0x10fbb5={'path':_0x5f42df,'keys':_0x5284a7});}}catch{}const _0x1e7d10=_0x2e8be4[_0x2e9289(0xd2)]>0x0||_0x3046d6!==null;let _0x448038=null;const _0x3dd46a=resolve(_0x1e4240,_0x2e9289(0xcd));if(existsSync(_0x3dd46a))try{const _0x1707f0=JSON[_0x2e9289(0xde)](readFileSync(_0x3dd46a,_0x2e9289(0xab)));for(const _0x58b602 of[_0x2e9289(0xbd),_0x2e9289(0xeb)]){const _0x568d11=_0x1707f0?.[_0x58b602]?.[_0x2e9289(0x9d)];if(typeof _0x568d11===_0x2e9289(0xb8)){_0x568d11!==_0x2e9289(0x101)&&(_0x448038={'pkgPath':_0x3dd46a,'currentVersion':_0x568d11,'field':_0x58b602});break;}}}catch{}return{'configMigration':_0x3046d6,'oldArtifacts':_0x2e8be4,'oldMcpConfig':_0x10fbb5,'needsSkillSwap':_0x1e7d10,'sdkUpgrade':_0x448038};}function printReport(_0x3f953c){const _0x46e378=a161_0x5081,{configMigration:_0x325046,oldArtifacts:_0x479cd9,oldMcpConfig:_0x2d3cba,needsSkillSwap:_0x331eb5}=_0x3f953c;console[_0x46e378(0xf1)](''),console['log'](a161_0xedf86f[_0x46e378(0xaf)](_0x46e378(0x97))),console[_0x46e378(0xf1)]('');_0x325046?(console['log'](a161_0xedf86f[_0x46e378(0xa3)]('Config\x20file:')+('\x20\x20'+a161_0xedf86f['yellow'](_0x325046[_0x46e378(0xe2)]))),console[_0x46e378(0xf1)](_0x46e378(0x9a)+(_0x325046[_0x46e378(0x102)]?a161_0xedf86f[_0x46e378(0xad)](_0x46e378(0xdc)):a161_0xedf86f['gray'](_0x46e378(0x10d)))),console[_0x46e378(0xf1)]('\x20\x20Fields\x20to\x20migrate:\x20'+_0x325046['fields'][_0x46e378(0xd3)](',\x20')),console['log']('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console[_0x46e378(0xf1)](a161_0xedf86f[_0x46e378(0xa3)]('Config\x20file:')+'\x20\x20'+a161_0xedf86f[_0x46e378(0xa8)](_0x46e378(0xfe)));console['log']('');if(_0x479cd9['length']>0x0){console[_0x46e378(0xf1)](a161_0xedf86f['cyan'](_0x46e378(0xca)));for(const _0x2de8cf of _0x479cd9){console[_0x46e378(0xf1)]('\x20\x20'+a161_0xedf86f[_0x46e378(0x9b)]('FOUND')+'\x20\x20'+_0x2de8cf);}console[_0x46e378(0xf1)](_0x46e378(0xc8));}else console[_0x46e378(0xf1)](a161_0xedf86f['cyan'](_0x46e378(0xca))+'\x20\x20'+a161_0xedf86f[_0x46e378(0xa8)](_0x46e378(0xf6)));console[_0x46e378(0xf1)]('');_0x2d3cba?(console[_0x46e378(0xf1)](a161_0xedf86f[_0x46e378(0xa3)](_0x46e378(0xcf))+('\x20\x20'+a161_0xedf86f[_0x46e378(0x108)](_0x2d3cba[_0x46e378(0xe5)])+_0x46e378(0xac)+_0x2d3cba[_0x46e378(0x104)][_0x46e378(0xd3)](',\x20'))),console[_0x46e378(0xf1)](_0x46e378(0xa4))):console[_0x46e378(0xf1)](a161_0xedf86f[_0x46e378(0xa3)]('MCP\x20config:')+'\x20\x20'+a161_0xedf86f[_0x46e378(0xa8)]('no\x20legacy\x20entry'));console['log'](''),console[_0x46e378(0xf1)](a161_0xedf86f[_0x46e378(0xa3)](_0x46e378(0x96))+('\x20\x20'+(_0x331eb5?a161_0xedf86f['yellow'](_0x46e378(0x9e)):a161_0xedf86f[_0x46e378(0xad)](_0x46e378(0xed)))));_0x331eb5&&console[_0x46e378(0xf1)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x46e378(0xf1)]('');if(_0x3f953c[_0x46e378(0xb6)]){const {currentVersion:_0x255bba,field:_0x2da99d,pkgPath:_0x1751ce}=_0x3f953c[_0x46e378(0xb6)];console['log'](a161_0xedf86f[_0x46e378(0xa3)](_0x46e378(0xf2))+('\x20\x20'+a161_0xedf86f[_0x46e378(0x108)](_0x1751ce))),console[_0x46e378(0xf1)](_0x46e378(0xf0)+_0x2da99d+':\x20'+a161_0xedf86f[_0x46e378(0x108)](_0x255bba)+_0x46e378(0xc6)+a161_0xedf86f['green']('latest')),console['log'](_0x46e378(0xb7));}else console[_0x46e378(0xf1)](a161_0xedf86f[_0x46e378(0xa3)](_0x46e378(0xf2))+'\x20\x20'+a161_0xedf86f[_0x46e378(0xa8)](_0x46e378(0x90)));console[_0x46e378(0xf1)]('');}function execConfigMigration(_0x39c9d4,_0x5d040b){const _0xc86adc=a161_0x5081,{configMigration:_0x4aa2ad}=_0x39c9d4;if(!_0x4aa2ad?.[_0xc86adc(0xe2)])return{'step':0x1,'label':_0xc86adc(0x91),'ok':!![],'detail':_0xc86adc(0xb4)};const _0x549eb9=readConfigFile(_0x4aa2ad['oldPath']),_0x3b435d=resolve(_0x5d040b,NEW_CONFIG_NAME),_0x452aa2=_0x4aa2ad[_0xc86adc(0x102)]?readConfigFile(_0x3b435d):{};for(const [_0x17e52b,_0x361f01]of Object['entries'](_0x549eb9)){!(_0x17e52b in _0x452aa2)&&(_0x452aa2[_0x17e52b]=_0x361f01);}writeConfigFile(_0x3b435d,_0x452aa2);const _0x4aa0eb=_0x4aa2ad['oldPath']+'.bak';return renameSync(_0x4aa2ad[_0xc86adc(0xe2)],_0x4aa0eb),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x4aa2ad['oldPath']+_0xc86adc(0xc6)+_0x3b435d+_0xc86adc(0xf4)+_0x4aa0eb+')'};}function execRemoveOldArtifacts(_0x20d7ab){const _0x28c648=a161_0x5081,_0x3be4c9=[];for(const _0x85aa of _0x20d7ab){try{if(!existsSync(_0x85aa))continue;const _0x363a08=tryStat(_0x85aa);_0x363a08?.[_0x28c648(0xb5)]()?rmSync(_0x85aa,{'recursive':!![],'force':!![]}):unlinkSync(_0x85aa);}catch(_0x10dfde){_0x3be4c9[_0x28c648(0xe4)](_0x85aa+':\x20'+_0x10dfde[_0x28c648(0xf5)]);}}return{'step':0x3,'label':_0x28c648(0x95),'ok':_0x3be4c9[_0x28c648(0xd2)]===0x0,'detail':_0x3be4c9[_0x28c648(0xd2)]>0x0?_0x20d7ab['length']-_0x3be4c9['length']+'/'+_0x20d7ab['length']+_0x28c648(0xc4)+_0x3be4c9[_0x28c648(0xd3)](';\x20')+')':_0x20d7ab[_0x28c648(0xd2)]+_0x28c648(0xa9)};}function execCleanMcp(_0x40a2a4){const _0x4028b4=a161_0x5081;if(!_0x40a2a4[_0x4028b4(0x110)])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x4028b4(0x106)};try{const _0x53828b=readFileSync(_0x40a2a4[_0x4028b4(0x110)][_0x4028b4(0xe5)],_0x4028b4(0xab)),_0x769dc1=JSON[_0x4028b4(0xde)](_0x53828b);if(_0x769dc1?.[_0x4028b4(0xfd)]&&typeof _0x769dc1['mcpServers']===_0x4028b4(0xc0)){const _0x572e8f=[];for(const [_0x1a4c2c,_0xbcbaa3]of Object[_0x4028b4(0x10f)](_0x769dc1['mcpServers'])){_0xbcbaa3?.[_0x4028b4(0xd7)]&&Array[_0x4028b4(0xc9)](_0xbcbaa3[_0x4028b4(0xd7)])&&_0xbcbaa3[_0x4028b4(0xd7)][_0x4028b4(0xd4)](_0x4d6cac=>typeof _0x4d6cac===_0x4028b4(0xb8)&&_0x4d6cac[_0x4028b4(0xb3)](_0x4028b4(0x92)))&&_0x572e8f['push'](_0x1a4c2c);}for(const _0xb25e59 of _0x572e8f){delete _0x769dc1[_0x4028b4(0xfd)][_0xb25e59];}return _0x572e8f[_0x4028b4(0xd2)]>0x0&&writeFileSync(_0x40a2a4['oldMcpConfig'][_0x4028b4(0xe5)],JSON[_0x4028b4(0xe6)](_0x769dc1,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x4028b4(0xce)+_0x572e8f[_0x4028b4(0xd3)](',\x20')+_0x4028b4(0x103)+_0x40a2a4[_0x4028b4(0x110)][_0x4028b4(0xe5)]};}return{'step':0x4,'label':_0x4028b4(0x9c),'ok':!![],'detail':_0x4028b4(0xc1)};}catch(_0x4621dc){return{'step':0x4,'label':_0x4028b4(0x9c),'ok':![],'detail':_0x4621dc[_0x4028b4(0xf5)]};}}function execSkillsRemove(_0x537f7c,_0x4af115){const _0x26e289=a161_0x5081,_0x5a7f79=runNpxSkillsRemove(_0x537f7c,{'stdio':'inherit','yes':_0x4af115});return{'step':0x5,'label':'Remove\x20old\x20skill','ok':_0x5a7f79['ok'],'detail':_0x5a7f79['ok']?_0x26e289(0x10c):_0x5a7f79[_0x26e289(0xaa)]??_0x26e289(0x107)+_0x5a7f79[_0x26e289(0xfb)]};}function execSkillsAdd(_0x3d6020,_0x5ce3d8){const _0xbac686=a161_0x5081,_0x73d2df=runNpxSkillsAddGlobal(_0x3d6020,_0xbac686(0x100),{'stdio':_0xbac686(0xfa),'yes':_0x5ce3d8});return{'step':0x6,'label':'Install\x20new\x20skill','ok':_0x73d2df['ok'],'detail':_0x73d2df['ok']?_0xbac686(0x10a):_0x73d2df['error']??'exit\x20'+_0x73d2df['status']};}function execUpgradeSdk(_0x385552){const _0x2411ba=a161_0x5081;if(!_0x385552['sdkUpgrade'])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x2411ba(0xd8)};const {pkgPath:_0x17c9de,currentVersion:_0x303870,field:_0x4ba727}=_0x385552[_0x2411ba(0xb6)];try{const _0x1a1307=readFileSync(_0x17c9de,_0x2411ba(0xab)),_0x3f3935=JSON[_0x2411ba(0xde)](_0x1a1307);return _0x3f3935[_0x4ba727][_0x2411ba(0x9d)]=_0x2411ba(0x101),writeFileSync(_0x17c9de,JSON[_0x2411ba(0xe6)](_0x3f3935,null,0x2)+'\x0a',_0x2411ba(0xab)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x4ba727+_0x2411ba(0xd9)+_0x303870+'\x20→\x20latest'};}catch(_0xe05918){return{'step':0x7,'label':_0x2411ba(0xe7),'ok':![],'detail':_0xe05918[_0x2411ba(0xf5)]};}}function a161_0xcd73(){const _0x3be7c0=['start','\x20→\x20','failed','\x20\x20Action:\x20delete','isArray','Legacy\x20artifacts:','11683448SPGroD','Remove\x20.lovrabet/','package.json','removed\x20','MCP\x20config:','FAIL','succeed','length','join','some','.cursor/mcp.json','detail','args','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','[\x22@lovrabet/sdk\x22]:\x20','files','fail','already\x20exists\x20(will\x20merge)','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','parse','label','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','done','oldPath','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','push','path','stringify','Upgrade\x20@lovrabet/sdk','881218LmJLyG','values','Step\x206/7:\x20Installing\x20new\x20skill...','devDependencies','Step\x204/7:\x20MCP\x20config\x20—\x20','not\x20needed','\x20\x20npm\x20install','Step\x201/7:\x20Config\x20migration\x20—\x20','\x20\x20Current\x20version\x20in\x20','log','@lovrabet/sdk:','step','\x20(backup:\x20','message','none\x20found','Upgrade\x20cancelled.','2081444TDhNaK','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','inherit','status','Proceed\x20with\x20upgrade?','mcpServers','no\x20legacy\x20config\x20found','Step\x204/7:\x20Cleaning\x20MCP\x20config...','lovrabet/rabetbase','latest','hasNewConfig','\x20from\x20','keys','6967140ZaFCKK','skipped','exit\x20','yellow','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','lovrabet/rabetbase\x20installed\x20globally','9793119qoWjXx','lovrabet/lovrabet-skill\x20removed','not\x20found\x20(will\x20create)','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','entries','oldMcpConfig','not\x20found\x20or\x20already\x20at\x20latest','Config\x20migration','@lovrabet/dataset-mcp-server','configMigration','cwd','Remove\x20legacy\x20artifacts','Skill\x20swap:','===\x20Upgrade\x20Analysis\x20===','Step\x205/7:\x20Removing\x20old\x20skill...','undefined','\x20\x20New\x20config\x20(.rabetbase.json):\x20','red','Clean\x20MCP\x20config','@lovrabet/sdk','needed','.lovrabet','.claude/skills/lovrabet','2VcyNXM','filter','cyan','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','yes','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','gray','\x20removed','error','utf8','\x20→\x20keys:\x20','green','6xAsRSY','bold','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','\x20\x20#\x20or','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','includes','skipped\x20(no\x20legacy\x20config)','isDirectory','sdkUpgrade','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','string','white','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','info','needsSkillSwap','dependencies','===\x20Upgrade\x20Summary\x20===','Upgrade\x20completed\x20successfully!','object','no\x20matching\x20entry\x20found','4080462qUwXPR','19408734kVwGrM','\x20removed\x20('];a161_0xcd73=function(){return _0x3be7c0;};return a161_0xcd73();}function tryStat(_0x3b7a3d){try{return statSync(_0x3b7a3d);}catch{return undefined;}}function printSummary(_0x44fd60){const _0x504504=a161_0x5081;console[_0x504504(0xf1)](''),console['log'](a161_0xedf86f['bold'](_0x504504(0xbe))),console[_0x504504(0xf1)]('');for(const _0x132d6f of _0x44fd60){const _0x45fe14=_0x132d6f['ok']?a161_0xedf86f[_0x504504(0xad)]('OK'):a161_0xedf86f[_0x504504(0x9b)](_0x504504(0xd0));console[_0x504504(0xf1)]('\x20\x20'+_0x45fe14+'\x20\x20Step\x20'+_0x132d6f[_0x504504(0xf3)]+':\x20'+_0x132d6f[_0x504504(0xdf)]);if(_0x132d6f[_0x504504(0xd6)])console['log']('\x20\x20\x20\x20\x20\x20\x20'+a161_0xedf86f['gray'](_0x132d6f[_0x504504(0xd6)]));}console['log']('');}export async function upgradeApp(_0x58edeb,_0x15a6ed){const _0x4e6a4b=a161_0x5081,_0x3294fe=process[_0x4e6a4b(0x94)](),_0x16c080=analyse(_0x3294fe),_0x53ca3a=!_0x16c080[_0x4e6a4b(0x93)]&&_0x16c080['oldArtifacts']['length']===0x0&&!_0x16c080[_0x4e6a4b(0x110)]&&!_0x16c080[_0x4e6a4b(0xbc)]&&!_0x16c080[_0x4e6a4b(0xb6)];if(_0x53ca3a){console[_0x4e6a4b(0xf1)](a161_0xedf86f[_0x4e6a4b(0xad)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x16c080);const _0x1324e8=!!(_0x15a6ed[_0x4e6a4b(0xa6)]||_0x15a6ed['Y']||_0x58edeb);if(!_0x1324e8)try{const _0x59f098=await askConfirm(_0x4e6a4b(0xfc));if(!_0x59f098){console[_0x4e6a4b(0xf1)](a161_0xedf86f[_0x4e6a4b(0xa8)](_0x4e6a4b(0xf7)));return;}}catch(_0x2faeb7){if(_0x2faeb7?.['message']==='CANCEL'){console['log'](a161_0xedf86f['gray'](_0x4e6a4b(0xf7)));return;}throw _0x2faeb7;}const _0x47e9b5=[],_0x3e9774=a161_0x35b839({'text':'Step\x201/7:\x20Migrating\x20config...','color':_0x4e6a4b(0xa3)})[_0x4e6a4b(0xc5)](),_0x2b2bd1=execConfigMigration(_0x16c080,_0x3294fe);_0x47e9b5[_0x4e6a4b(0xe4)](_0x2b2bd1),_0x3e9774[_0x2b2bd1['ok']?'succeed':_0x4e6a4b(0xdb)](_0x4e6a4b(0xef)+(_0x2b2bd1['detail']??(_0x2b2bd1['ok']?_0x4e6a4b(0xe1):_0x4e6a4b(0xc7))));const _0x2fe313=resolve(_0x3294fe,'.lovrabet'),_0x5f45f6=a161_0x35b839({'text':_0x4e6a4b(0xb0),'color':_0x4e6a4b(0xa3)})[_0x4e6a4b(0xc5)]();if(existsSync(_0x2fe313))try{rmSync(_0x2fe313,{'recursive':!![],'force':!![]}),_0x5f45f6[_0x4e6a4b(0xd1)](_0x4e6a4b(0xa7)),_0x47e9b5['push']({'step':0x2,'label':_0x4e6a4b(0xcc),'ok':!![]});}catch(_0x1632f0){_0x5f45f6[_0x4e6a4b(0xdb)](_0x4e6a4b(0xb2)+_0x1632f0[_0x4e6a4b(0xf5)]),_0x47e9b5['push']({'step':0x2,'label':_0x4e6a4b(0xcc),'ok':![],'detail':_0x1632f0[_0x4e6a4b(0xf5)]});}else _0x5f45f6[_0x4e6a4b(0xbb)](_0x4e6a4b(0xdd)),_0x47e9b5[_0x4e6a4b(0xe4)]({'step':0x2,'label':_0x4e6a4b(0xcc),'ok':!![],'detail':_0x4e6a4b(0x106)});const _0x197ed7=a161_0x35b839({'text':_0x4e6a4b(0xba),'color':_0x4e6a4b(0xa3)})[_0x4e6a4b(0xc5)](),_0x3d59da=execRemoveOldArtifacts(_0x16c080['oldArtifacts']);_0x47e9b5[_0x4e6a4b(0xe4)](_0x3d59da),_0x197ed7[_0x3d59da['ok']?_0x4e6a4b(0xd1):_0x4e6a4b(0xdb)](_0x4e6a4b(0xe0)+(_0x3d59da[_0x4e6a4b(0xd6)]??(_0x3d59da['ok']?_0x4e6a4b(0xe1):_0x4e6a4b(0xc7))));const _0x42db00=a161_0x35b839({'text':_0x4e6a4b(0xff),'color':_0x4e6a4b(0xa3)})[_0x4e6a4b(0xc5)](),_0x295650=execCleanMcp(_0x16c080);_0x47e9b5[_0x4e6a4b(0xe4)](_0x295650),_0x42db00[_0x295650['ok']?_0x4e6a4b(0xd1):_0x4e6a4b(0xdb)](_0x4e6a4b(0xec)+(_0x295650[_0x4e6a4b(0xd6)]??(_0x295650['ok']?_0x4e6a4b(0xe1):_0x4e6a4b(0xc7))));const _0x5454de=a161_0x35b839({'text':_0x4e6a4b(0x98),'color':_0x4e6a4b(0xa3)})[_0x4e6a4b(0xc5)](),_0x359d6a=execSkillsRemove(_0x3294fe,_0x1324e8);_0x47e9b5[_0x4e6a4b(0xe4)](_0x359d6a),_0x5454de[_0x359d6a['ok']?_0x4e6a4b(0xd1):'fail'](_0x4e6a4b(0x109)+(_0x359d6a[_0x4e6a4b(0xd6)]??(_0x359d6a['ok']?_0x4e6a4b(0xe1):_0x4e6a4b(0xc7))));const _0x1caab0=a161_0x35b839({'text':_0x4e6a4b(0xea),'color':_0x4e6a4b(0xa3)})[_0x4e6a4b(0xc5)](),_0x1a6825=execSkillsAdd(_0x3294fe,_0x1324e8);_0x47e9b5['push'](_0x1a6825),_0x1caab0[_0x1a6825['ok']?'succeed':_0x4e6a4b(0xdb)](_0x4e6a4b(0xf9)+(_0x1a6825[_0x4e6a4b(0xd6)]??(_0x1a6825['ok']?_0x4e6a4b(0xe1):_0x4e6a4b(0xc7))));const _0x51e723=a161_0x35b839({'text':_0x4e6a4b(0xe3),'color':_0x4e6a4b(0xa3)})['start'](),_0x2a2583=execUpgradeSdk(_0x16c080);_0x47e9b5[_0x4e6a4b(0xe4)](_0x2a2583),_0x51e723[_0x2a2583['ok']?_0x4e6a4b(0xd1):_0x4e6a4b(0xdb)](_0x4e6a4b(0x10e)+(_0x2a2583['detail']??(_0x2a2583['ok']?_0x4e6a4b(0xe1):_0x4e6a4b(0xc7)))),printSummary(_0x47e9b5);const _0x52d2bd=_0x47e9b5[_0x4e6a4b(0xd4)](_0x2bbab3=>!_0x2bbab3['ok']);_0x52d2bd?console[_0x4e6a4b(0xf1)](a161_0xedf86f[_0x4e6a4b(0x108)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console[_0x4e6a4b(0xf1)](a161_0xedf86f[_0x4e6a4b(0xad)](_0x4e6a4b(0xbf))),_0x2a2583['ok']&&_0x16c080[_0x4e6a4b(0xb6)]&&(console[_0x4e6a4b(0xf1)](''),console[_0x4e6a4b(0xf1)](a161_0xedf86f['bold'][_0x4e6a4b(0xa3)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console['log'](a161_0xedf86f[_0x4e6a4b(0xa3)](_0x4e6a4b(0xa5))),console[_0x4e6a4b(0xf1)](''),console[_0x4e6a4b(0xf1)](a161_0xedf86f['white'](_0x4e6a4b(0xee))),console[_0x4e6a4b(0xf1)](a161_0xedf86f[_0x4e6a4b(0xb9)](_0x4e6a4b(0xb1))),console['log'](a161_0xedf86f['white']('\x20\x20bun\x20install')),console[_0x4e6a4b(0xf1)](''));}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 统一命令注册表
|
|
3
|
+
*
|
|
4
|
+
* 所有命令统一 service + command 两级结构:
|
|
5
|
+
* rabetbase <service> <command> [flags]
|
|
6
|
+
*
|
|
7
|
+
* 声明式命令(全部)走 framework/runner 管线(风险门控、dry-run、formatOutput 全自动)。
|
|
8
|
+
*
|
|
9
|
+
* 帮助文本由 framework/help.ts 从 serviceRegistry 自动生成。
|
|
10
|
+
* 已移除命令只通过 resolveRemovedCommand 返回非发现式错误纠正提示。
|
|
11
|
+
*/
|
|
12
|
+
import type { CommandDefinition, FlagDef } from "../framework/types.js";
|
|
13
|
+
export interface CommandModule {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
/** 可选 flag 声明:声明后框架自动执行 parseFlags + validateFlags */
|
|
17
|
+
flags?: FlagDef[];
|
|
18
|
+
/** 自定义 USAGE 行,默认为 `<bin> <service> <command> [flags]` */
|
|
19
|
+
usage?: string;
|
|
20
|
+
subCommands?: Record<string, CommandModule>;
|
|
21
|
+
run(ctx: import("../context.js").CLIContext, args: string[], flags: Record<string, any>): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export interface ServiceEntry {
|
|
24
|
+
/** service 名(dispatch 用) */
|
|
25
|
+
service: string;
|
|
26
|
+
/** 展示名(帮助文本中的分组标题) */
|
|
27
|
+
label: string;
|
|
28
|
+
/** 子命令展示信息 */
|
|
29
|
+
commands: {
|
|
30
|
+
command: string;
|
|
31
|
+
description: string;
|
|
32
|
+
tag?: string;
|
|
33
|
+
}[];
|
|
34
|
+
/** 声明式 = true(所有 service 均为声明式) */
|
|
35
|
+
declarative: true;
|
|
36
|
+
/** 默认子命令:rabetbase <service> 不带子命令时自动执行 */
|
|
37
|
+
defaultCommand?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Wildcard 定义:任何未注册的子命令都路由到此 definition,
|
|
40
|
+
* command 名会被注入到 ctx.args[0],其余位置参数依次排后。
|
|
41
|
+
*/
|
|
42
|
+
wildcardDef?: CommandDefinition;
|
|
43
|
+
/**
|
|
44
|
+
* 单命令 service 标记。
|
|
45
|
+
* true 时 help 将服务显示为直接命令(rabetbase init),
|
|
46
|
+
* 而非子命令形式(rabetbase init run)。
|
|
47
|
+
*/
|
|
48
|
+
isSingleCommand?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/** 按注册顺序排列(顺序 = 帮助展示顺序) */
|
|
51
|
+
export declare const serviceRegistry: ServiceEntry[];
|
|
52
|
+
export declare const definitions: Map<string, CommandDefinition>;
|
|
53
|
+
export declare const serviceGroups: Map<string, CommandDefinition[]>;
|
|
54
|
+
export interface RemovedCommand {
|
|
55
|
+
command: string;
|
|
56
|
+
message: string;
|
|
57
|
+
hint: string;
|
|
58
|
+
}
|
|
59
|
+
export declare function resolveRemovedCommand(service: string | undefined, command?: string | undefined): RemovedCommand | undefined;
|
|
60
|
+
export declare function findDefinition(service: string, command: string): CommandDefinition | undefined;
|
|
61
|
+
export declare function isKnownService(name: string): boolean;
|
|
62
|
+
export declare function isDeclarativeService(name: string): boolean;
|
|
63
|
+
export declare function getServiceEntry(name: string): ServiceEntry | undefined;
|
|
64
|
+
/** @deprecated Legacy 路由已删除,保留签名以防旧 import 引用 */
|
|
65
|
+
export declare function getLegacyHandler(_service: string, _command: string): undefined;
|
|
66
|
+
export declare function getAllDefinitions(): CommandDefinition[];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a162_0x375c96=a162_0x3aff;(function(_0x2a12dd,_0x4cdd43){const _0x4e2701=a162_0x3aff,_0x1b1760=_0x2a12dd();while(!![]){try{const _0x2e603c=-parseInt(_0x4e2701(0x144))/0x1+parseInt(_0x4e2701(0x182))/0x2*(parseInt(_0x4e2701(0x160))/0x3)+-parseInt(_0x4e2701(0x151))/0x4+-parseInt(_0x4e2701(0x171))/0x5*(parseInt(_0x4e2701(0x162))/0x6)+-parseInt(_0x4e2701(0x15f))/0x7+parseInt(_0x4e2701(0x149))/0x8*(parseInt(_0x4e2701(0x16a))/0x9)+parseInt(_0x4e2701(0x14e))/0xa;if(_0x2e603c===_0x4cdd43)break;else _0x1b1760['push'](_0x1b1760['shift']());}catch(_0x266afb){_0x1b1760['push'](_0x1b1760['shift']());}}}(a162_0x3583,0xb374b));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';function a162_0x3aff(_0x4af2c3,_0x236e8b){_0x4af2c3=_0x4af2c3-0x12b;const _0x358370=a162_0x3583();let _0x3aff9f=_0x358370[_0x4af2c3];return _0x3aff9f;}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{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=[];function a162_0x3583(){const _0x9bafbb=['Database\x20Connections','Run\x20any\x20package.json\x20script','app:remote','1054FFqCWa','rabetbase\x20run\x20preview','Use\x20`','menu:update','knowledge-base:update','wildcardDef','Platform\x20Issue','Runtime\x20App\x20Config\x20Management','sql:save','rabetbase\x20kb\x20detail','Smart\x20List\x20Pages','commands','Roles','knowledge-base:list','rabetbase\x20cli-skill\x20install','values','knowledge-base:create','logout','skill:install','install','length','<script>','run','File','CLI\x20Built-in\x20Skill','Diagnostics','app:add','set','command','create','Run\x20Scripts','description','rabetbase\x20run\x20start','Authentication','734221lPaBlk','login','rabetbase\x20menu\x20asset-update','build','skills:','1800LWUrvy','`\x20instead.','rabetbase\x20kb\x20create','hidden','rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>','19987000yDLWZp','rabetbase\x20auth\x20logout','Permissions','4693712olYgcu','\x20\x20[write]','\x20\x20[high-risk-write]','API\x20Development','defaultCommand','has','app:use','rabetbase\x20bff\x20create','get','project:init','app:remove','Notification\x20Configuration','Tenant\x20Members','`\x20has\x20been\x20removed.','5784408YkBlTB','4218VyfhHX','map','444558MJmLCk','rabetbase\x20kb\x20update','show','App\x20Management','Quick\x20Start','Project','bff:new','service','32139NPVbsv','Instant\x20API','rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml','Configuration','rabetbase\x20sql\x20create','rabetbase\x20workspace\x20use\x20--app\x20<name>','read','5BXNTSr','isSingleCommand','rabetbase\x20run\x20build','Workspace','knowledge-base:detail','BFF\x20Scripts','Logs','rabetbase\x20kb\x20delete','skill:','Company\x20Knowledge\x20Base','start','sql:new','Schema','push'];a162_0x3583=function(){return _0x9bafbb;};return a162_0x3583();}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x14b854){const _0x916b1a=a162_0x3aff;for(const _0x321338 of _0x14b854){definitions[_0x916b1a(0x13d)](_0x321338['service']+':'+_0x321338[_0x916b1a(0x13e)],_0x321338);let _0x7c9ab0=serviceGroups[_0x916b1a(0x159)](_0x321338[_0x916b1a(0x169)]);!_0x7c9ab0&&(_0x7c9ab0=[],serviceGroups['set'](_0x321338['service'],_0x7c9ab0)),_0x7c9ab0[_0x916b1a(0x17e)](_0x321338);}}function registerDeclarativeService(_0x3d1749,_0x3c772b,_0x119355){const _0xbc8762=a162_0x3aff;registerDefinitions(_0x3c772b);_0x119355?.['wildcardDef']&®isterDefinitions([_0x119355['wildcardDef']]);const _0x5765ba=_0x2e89f7=>_0x2e89f7===_0xbc8762(0x170)?'':_0x2e89f7==='write'?_0xbc8762(0x152):_0xbc8762(0x153),_0x15dad6={'service':_0x3c772b[0x0][_0xbc8762(0x169)],'label':_0x3d1749,'commands':_0x3c772b['filter'](_0x4c2d76=>!_0x4c2d76[_0xbc8762(0x14c)])[_0xbc8762(0x161)](_0x5a2258=>({'command':_0x5a2258[_0xbc8762(0x13e)],'description':_0x5a2258[_0xbc8762(0x141)],'tag':_0x5765ba(_0x5a2258['risk'])})),'declarative':!![],'defaultCommand':_0x119355?.[_0xbc8762(0x155)]??(_0x119355?.[_0xbc8762(0x172)]?_0x3c772b[0x0][_0xbc8762(0x13e)]:undefined),'wildcardDef':_0x119355?.[_0xbc8762(0x187)],'isSingleCommand':_0x119355?.[_0xbc8762(0x172)]};serviceRegistry[_0xbc8762(0x17e)](_0x15dad6),serviceByName['set'](_0x15dad6['service'],_0x15dad6);}registerDeclarativeService(a162_0x375c96(0x166),initDefinitions,{'defaultCommand':a162_0x375c96(0x138),'isSingleCommand':!![]}),registerDeclarativeService(a162_0x375c96(0x167),projectDefinitions),registerDeclarativeService(a162_0x375c96(0x174),workspaceDefinitions),registerDeclarativeService(a162_0x375c96(0x165),appDefinitions),registerDeclarativeService(a162_0x375c96(0x143),authDefinitions,{'defaultCommand':a162_0x375c96(0x145)}),registerDeclarativeService(a162_0x375c96(0x15d),tenantDefinitions),registerDeclarativeService('Dataset\x20&\x20Operations',datasetDefinitions),registerDeclarativeService(a162_0x375c96(0x12c),pageDefinitions),registerDeclarativeService(a162_0x375c96(0x154),apiDefinitions),registerDeclarativeService(a162_0x375c96(0x16b),dataDefinitions),registerDeclarativeService(a162_0x375c96(0x176),bffDefinitions),registerDeclarativeService(a162_0x375c96(0x15c),notificationDefinitions),registerDeclarativeService('SQL\x20Queries',sqlDefinitions),registerDeclarativeService(a162_0x375c96(0x17f),dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService('Async\x20Tasks',taskDefinitions),registerDeclarativeService(a162_0x375c96(0x12e),roleDefinitions),registerDeclarativeService(a162_0x375c96(0x150),permitDefinitions),registerDeclarativeService(a162_0x375c96(0x189),appConfigDefinitions),registerDeclarativeService(a162_0x375c96(0x17a),kbDefinitions),registerDeclarativeService(a162_0x375c96(0x188),issueDefinitions),registerDeclarativeService(a162_0x375c96(0x139),fileDefinitions),registerDeclarativeService('OCR',ocrDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService(a162_0x375c96(0x16d),configDefinitions),registerDeclarativeService(a162_0x375c96(0x13b),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a162_0x375c96(0x17d),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Self\x20Update',[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a162_0x375c96(0x13a),cliSkillDefinitions,{'defaultCommand':a162_0x375c96(0x135)}),registerDeclarativeService(a162_0x375c96(0x177),logsDefinitions,{'defaultCommand':a162_0x375c96(0x164)}),registerDeclarativeService(a162_0x375c96(0x140),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a162_0x375c96(0x136)]-0x1];last[a162_0x375c96(0x12d)]=[{'command':a162_0x375c96(0x137),'description':a162_0x375c96(0x180),'tag':''}];}const REMOVED_COMMAND_REPLACEMENTS=new Map([[a162_0x375c96(0x18a),a162_0x375c96(0x16c)],[a162_0x375c96(0x168),a162_0x375c96(0x158)],[a162_0x375c96(0x17c),a162_0x375c96(0x16e)],[a162_0x375c96(0x185),a162_0x375c96(0x146)],[a162_0x375c96(0x15a),'rabetbase\x20workspace\x20init\x20--appcode\x20<code>'],[a162_0x375c96(0x179),a162_0x375c96(0x130)],[a162_0x375c96(0x134),a162_0x375c96(0x130)],[a162_0x375c96(0x148),'rabetbase\x20cli-skill\x20install'],['skills:install',a162_0x375c96(0x130)],[a162_0x375c96(0x181),'rabetbase\x20app\x20list\x20--remote'],[a162_0x375c96(0x157),a162_0x375c96(0x16f)],[a162_0x375c96(0x13c),a162_0x375c96(0x14d)],[a162_0x375c96(0x15b),'rabetbase\x20workspace\x20remove\x20<name>'],[a162_0x375c96(0x12f),'rabetbase\x20kb\x20list'],[a162_0x375c96(0x175),a162_0x375c96(0x12b)],[a162_0x375c96(0x132),a162_0x375c96(0x14b)],[a162_0x375c96(0x186),a162_0x375c96(0x163)],['knowledge-base:delete',a162_0x375c96(0x178)]]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([[a162_0x375c96(0x13f),'rabetbase\x20project\x20create\x20<project-name>'],[a162_0x375c96(0x17b),a162_0x375c96(0x142)],[a162_0x375c96(0x147),a162_0x375c96(0x173)],['preview',a162_0x375c96(0x183)],[a162_0x375c96(0x133),a162_0x375c96(0x14f)]]);export function resolveRemovedCommand(_0x34d28f,_0x3c39ab){const _0x103667=a162_0x375c96;if(!_0x34d28f)return undefined;const _0x13d75d=REMOVED_COMMAND_REPLACEMENTS[_0x103667(0x159)](_0x34d28f+':'+(_0x3c39ab??'')),_0x4b5df5=REMOVED_FLAT_COMMAND_REPLACEMENTS[_0x103667(0x159)](_0x34d28f),_0x1d36d5=_0x13d75d??_0x4b5df5;if(!_0x1d36d5)return undefined;const _0x25b46c=_0x4b5df5?_0x34d28f:_0x3c39ab?_0x34d28f+'\x20'+_0x3c39ab:_0x34d28f;return{'command':_0x25b46c,'message':'`rabetbase\x20'+_0x25b46c+_0x103667(0x15e),'hint':_0x103667(0x184)+_0x1d36d5+_0x103667(0x14a)};}export function findDefinition(_0x5b85dc,_0x55ae5d){const _0x27bdcb=a162_0x375c96;return definitions[_0x27bdcb(0x159)](_0x5b85dc+':'+_0x55ae5d);}export function isKnownService(_0x505391){return serviceByName['has'](_0x505391);}export function isDeclarativeService(_0x54b6b5){const _0x21509e=a162_0x375c96;return serviceGroups[_0x21509e(0x156)](_0x54b6b5)||serviceByName[_0x21509e(0x159)](_0x54b6b5)?.[_0x21509e(0x187)]!==undefined;}export function getServiceEntry(_0x1628ce){const _0x1134c8=a162_0x375c96;return serviceByName[_0x1134c8(0x159)](_0x1628ce);}export function getLegacyHandler(_0x1cca8a,_0x238da4){return undefined;}export function getAllDefinitions(){const _0x2388ae=a162_0x375c96;return Array['from'](definitions[_0x2388ae(0x131)]());}
|
|
1
|
+
const a162_0x488395=a162_0x2dac;(function(_0x3e1b5a,_0x4bb0af){const _0x543fe9=a162_0x2dac,_0x3b4ad8=_0x3e1b5a();while(!![]){try{const _0x2e5d16=-parseInt(_0x543fe9(0xc7))/0x1+parseInt(_0x543fe9(0x84))/0x2*(parseInt(_0x543fe9(0x86))/0x3)+parseInt(_0x543fe9(0x99))/0x4+parseInt(_0x543fe9(0xd4))/0x5+-parseInt(_0x543fe9(0xb7))/0x6*(parseInt(_0x543fe9(0x91))/0x7)+-parseInt(_0x543fe9(0xac))/0x8*(-parseInt(_0x543fe9(0xb6))/0x9)+parseInt(_0x543fe9(0xd1))/0xa*(-parseInt(_0x543fe9(0xab))/0xb);if(_0x2e5d16===_0x4bb0af)break;else _0x3b4ad8['push'](_0x3b4ad8['shift']());}catch(_0x373365){_0x3b4ad8['push'](_0x3b4ad8['shift']());}}}(a162_0x48e3,0x8ce7b));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';function a162_0x48e3(){const _0x3e92bf=['build','2191185mmknEW','rabetbase\x20cli-skill\x20install','Database\x20Connections','Code\x20Generation','rabetbase\x20sql\x20create','bff:new','from','<script>','command','OCR','rabetbase\x20app\x20list\x20--remote','sql:new','skills:install','CLI\x20Built-in\x20Skill','rabetbase\x20project\x20create\x20<project-name>','Run\x20any\x20package.json\x20script','678086BEQDHe','isSingleCommand','3pKFfFd','Self\x20Update','create','API\x20Development','Smart\x20List\x20Pages','Run\x20Scripts','map','risk','rabetbase\x20kb\x20update','rabetbase\x20auth\x20logout','run','42gltirv','rabetbase\x20kb\x20create','knowledge-base:create','Use\x20`','Schema','Platform\x20Issue','Dataset\x20&\x20Operations','rabetbase\x20workspace\x20use\x20--app\x20<name>','2852396ithiJB','rabetbase\x20workspace\x20remove\x20<name>','rabetbase\x20kb\x20list','rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>','skill:','wildcardDef','SQL\x20Queries','project:init','set','get','BFF\x20Scripts','\x20\x20[','app:use','`rabetbase\x20','commands','Logs','knowledge-base:update','rabetbase\x20run\x20build','319uEqFHb','2639192jPpCkc','knowledge-base:delete','\x20\x20[high-risk-write]','defaultCommand','app:remote','hidden','read','`\x20instead.','File','Async\x20Tasks','9AkooFR','43242LZQgRq','menu:update','Notification\x20Configuration','rabetbase\x20workspace\x20init\x20--appcode\x20<code>','skill:install','show','Instant\x20API','preview','logout','rabetbase\x20kb\x20detail','rabetbase\x20bff\x20create','rabetbase\x20run\x20preview','skills:','login','Quick\x20Start','Permissions','19705YoMYes','Menu','Authentication','`\x20has\x20been\x20removed.','sql:save','Project','knowledge-base:detail','service','write','values','406960FqPhEc','Diagnostics'];a162_0x48e3=function(){return _0x3e92bf;};return a162_0x48e3();}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';function a162_0x2dac(_0x2b5bef,_0x209c0b){_0x2b5bef=_0x2b5bef-0x79;const _0x48e32f=a162_0x48e3();let _0x2dac24=_0x48e32f[_0x2b5bef];return _0x2dac24;}import{cliSkillDefinitions}from'../commands/cli-skill/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(_0x4adeb8){const _0x16523b=a162_0x2dac;for(const _0x13e74f of _0x4adeb8){definitions[_0x16523b(0xa1)](_0x13e74f[_0x16523b(0xce)]+':'+_0x13e74f['command'],_0x13e74f);let _0x28d1b6=serviceGroups[_0x16523b(0xa2)](_0x13e74f[_0x16523b(0xce)]);!_0x28d1b6&&(_0x28d1b6=[],serviceGroups[_0x16523b(0xa1)](_0x13e74f[_0x16523b(0xce)],_0x28d1b6)),_0x28d1b6['push'](_0x13e74f);}}function registerDeclarativeService(_0x64781b,_0x47736d,_0xa9aaa3){const _0x15bb90=a162_0x2dac;registerDefinitions(_0x47736d);_0xa9aaa3?.[_0x15bb90(0x9e)]&®isterDefinitions([_0xa9aaa3['wildcardDef']]);const _0x19e181=_0x53eb99=>_0x53eb99===_0x15bb90(0xb2)?'':_0x53eb99===_0x15bb90(0xcf)?'\x20\x20[write]':_0x15bb90(0xae),_0x3fde63={'service':_0x47736d[0x0]['service'],'label':_0x64781b,'commands':_0x47736d['filter'](_0x4c0107=>!_0x4c0107[_0x15bb90(0xb1)])[_0x15bb90(0x8c)](_0x1b6f78=>({'command':_0x1b6f78[_0x15bb90(0x7c)],'description':_0x1b6f78['description'],'tag':_0x19e181(_0x1b6f78[_0x15bb90(0x8d)])})),'declarative':!![],'defaultCommand':_0xa9aaa3?.[_0x15bb90(0xaf)]??(_0xa9aaa3?.[_0x15bb90(0x85)]?_0x47736d[0x0]['command']:undefined),'wildcardDef':_0xa9aaa3?.[_0x15bb90(0x9e)],'isSingleCommand':_0xa9aaa3?.[_0x15bb90(0x85)]};serviceRegistry['push'](_0x3fde63),serviceByName[_0x15bb90(0xa1)](_0x3fde63[_0x15bb90(0xce)],_0x3fde63);}registerDeclarativeService(a162_0x488395(0xc5),initDefinitions,{'defaultCommand':a162_0x488395(0x90),'isSingleCommand':!![]}),registerDeclarativeService(a162_0x488395(0xcc),projectDefinitions),registerDeclarativeService('Workspace',workspaceDefinitions),registerDeclarativeService('App\x20Management',appDefinitions),registerDeclarativeService(a162_0x488395(0xc9),authDefinitions,{'defaultCommand':a162_0x488395(0xc4)}),registerDeclarativeService('Tenant\x20Members',tenantDefinitions),registerDeclarativeService(a162_0x488395(0x97),datasetDefinitions),registerDeclarativeService(a162_0x488395(0x8a),pageDefinitions),registerDeclarativeService(a162_0x488395(0x89),apiDefinitions),registerDeclarativeService(a162_0x488395(0xbd),dataDefinitions),registerDeclarativeService(a162_0x488395(0xa3),bffDefinitions),registerDeclarativeService(a162_0x488395(0xb9),notificationDefinitions),registerDeclarativeService(a162_0x488395(0x9f),sqlDefinitions),registerDeclarativeService(a162_0x488395(0xd6),dbDefinitions),registerDeclarativeService(a162_0x488395(0xc8),menuDefinitions),registerDeclarativeService(a162_0x488395(0xb5),taskDefinitions),registerDeclarativeService('Roles',roleDefinitions),registerDeclarativeService(a162_0x488395(0xc6),permitDefinitions),registerDeclarativeService('Runtime\x20App\x20Config\x20Management',appConfigDefinitions),registerDeclarativeService('Company\x20Knowledge\x20Base',kbDefinitions),registerDeclarativeService(a162_0x488395(0x96),issueDefinitions),registerDeclarativeService(a162_0x488395(0xb4),fileDefinitions),registerDeclarativeService(a162_0x488395(0x7d),ocrDefinitions),registerDeclarativeService(a162_0x488395(0xd7),codegenDefinitions),registerDeclarativeService('Configuration',configDefinitions),registerDeclarativeService(a162_0x488395(0xd2),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a162_0x488395(0x95),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a162_0x488395(0x87),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a162_0x488395(0x81),cliSkillDefinitions,{'defaultCommand':'install'}),registerDeclarativeService(a162_0x488395(0xa8),logsDefinitions,{'defaultCommand':a162_0x488395(0xbc)}),registerDeclarativeService(a162_0x488395(0x8b),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry['length']-0x1];last[a162_0x488395(0xa7)]=[{'command':a162_0x488395(0x7b),'description':a162_0x488395(0x83),'tag':a162_0x488395(0xa4)+runDefinition[a162_0x488395(0x8d)]+']'}];}const REMOVED_COMMAND_REPLACEMENTS=new Map([[a162_0x488395(0xcb),'rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml'],[a162_0x488395(0x79),a162_0x488395(0xc1)],[a162_0x488395(0x7f),a162_0x488395(0xd8)],[a162_0x488395(0xb8),'rabetbase\x20menu\x20asset-update'],[a162_0x488395(0xa0),a162_0x488395(0xba)],[a162_0x488395(0x9d),a162_0x488395(0xd5)],[a162_0x488395(0xbb),a162_0x488395(0xd5)],[a162_0x488395(0xc3),a162_0x488395(0xd5)],[a162_0x488395(0x80),a162_0x488395(0xd5)],[a162_0x488395(0xb0),a162_0x488395(0x7e)],[a162_0x488395(0xa5),a162_0x488395(0x98)],['app:add',a162_0x488395(0x9c)],['app:remove',a162_0x488395(0x9a)],['knowledge-base:list',a162_0x488395(0x9b)],[a162_0x488395(0xcd),a162_0x488395(0xc0)],[a162_0x488395(0x93),a162_0x488395(0x92)],[a162_0x488395(0xa9),a162_0x488395(0x8e)],[a162_0x488395(0xad),'rabetbase\x20kb\x20delete']]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([[a162_0x488395(0x88),a162_0x488395(0x82)],['start','rabetbase\x20run\x20start'],[a162_0x488395(0xd3),a162_0x488395(0xaa)],[a162_0x488395(0xbe),a162_0x488395(0xc2)],[a162_0x488395(0xbf),a162_0x488395(0x8f)]]);export function resolveRemovedCommand(_0x55fc0e,_0x10b63b){const _0x1fac9e=a162_0x488395;if(!_0x55fc0e)return undefined;const _0x2a25f7=REMOVED_COMMAND_REPLACEMENTS[_0x1fac9e(0xa2)](_0x55fc0e+':'+(_0x10b63b??'')),_0x3397c1=REMOVED_FLAT_COMMAND_REPLACEMENTS[_0x1fac9e(0xa2)](_0x55fc0e),_0xaba252=_0x2a25f7??_0x3397c1;if(!_0xaba252)return undefined;const _0x336b0e=_0x3397c1?_0x55fc0e:_0x10b63b?_0x55fc0e+'\x20'+_0x10b63b:_0x55fc0e;return{'command':_0x336b0e,'message':_0x1fac9e(0xa6)+_0x336b0e+_0x1fac9e(0xca),'hint':_0x1fac9e(0x94)+_0xaba252+_0x1fac9e(0xb3)};}export function findDefinition(_0x5b7771,_0x179be8){const _0x54a9ff=a162_0x488395;return definitions[_0x54a9ff(0xa2)](_0x5b7771+':'+_0x179be8);}export function isKnownService(_0x141a17){return serviceByName['has'](_0x141a17);}export function isDeclarativeService(_0x2f9d53){const _0x3daaf7=a162_0x488395;return serviceGroups['has'](_0x2f9d53)||serviceByName[_0x3daaf7(0xa2)](_0x2f9d53)?.[_0x3daaf7(0x9e)]!==undefined;}export function getServiceEntry(_0x10e63a){const _0x3657d9=a162_0x488395;return serviceByName[_0x3657d9(0xa2)](_0x10e63a);}export function getLegacyHandler(_0x3456d6,_0x43c754){return undefined;}export function getAllDefinitions(){const _0x3557c8=a162_0x488395;return Array[_0x3557c8(0x7a)](definitions[_0x3557c8(0xd0)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a163_0x7bdea0=a163_0x40e0;(function(_0xb176b9,_0x5e686e){const _0x4ff845=a163_0x40e0,_0x2370e6=_0xb176b9();while(!![]){try{const _0x21e9af=-parseInt(_0x4ff845(0x106))/0x1+-parseInt(_0x4ff845(0x117))/0x2*(parseInt(_0x4ff845(0x107))/0x3)+parseInt(_0x4ff845(0x116))/0x4*(parseInt(_0x4ff845(0xff))/0x5)+-parseInt(_0x4ff845(0x108))/0x6+parseInt(_0x4ff845(0x109))/0x7*(parseInt(_0x4ff845(0x105))/0x8)+parseInt(_0x4ff845(0x111))/0x9+parseInt(_0x4ff845(0x10c))/0xa;if(_0x21e9af===_0x5e686e)break;else _0x2370e6['push'](_0x2370e6['shift']());}catch(_0x5285bd){_0x2370e6['push'](_0x2370e6['shift']());}}}(a163_0xf64f,0xa10c3));import{createAppRole}from'../../core/api-client.js';function a163_0x40e0(_0x2e859d,_0x667be2){_0x2e859d=_0x2e859d-0xfe;const _0xf64fec=a163_0xf64f();let _0x40e0bc=_0xf64fec[_0x2e859d];return _0x40e0bc;}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=a163_0x7bdea0(0x101);function a163_0xf64f(){const _0x1d9503=['role','Created\x20role\x20','8465Nrytob','flagMissing','/smartapi/permit/role/create','create','str','remark','21416wgHQDc','452419wAoRaN','435PQBDjR','6474930gVBhqs','1127YpIuYa','validation','appCode','14214070mkcNXP','length','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','\x20(id=','trim','554931fdzbrK','write','name','Pass\x20--name\x20<roleName>.','CUSTOM','1796GMftjG','6662DJXIZC','POST'];a163_0xf64f=function(){return _0x1d9503;};return a163_0xf64f();}function readName(_0x47da2e){const _0x9078d0=a163_0x7bdea0,_0x54077a=_0x47da2e[_0x9078d0(0x103)](_0x9078d0(0x113))['trim']();if(!_0x54077a)throw CliErrors[_0x9078d0(0x100)](_0x9078d0(0x113),_0x9078d0(0x114));if(_0x54077a[_0x9078d0(0x10d)]>0x40)throw CliErrors[_0x9078d0(0x10a)](_0x9078d0(0x10e));return _0x54077a;}export const roleCreate={'service':a163_0x7bdea0(0x119),'command':'create','description':'Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','risk':a163_0x7bdea0(0x112),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1c1f7a){readName(_0x1c1f7a);},async 'dryRun'(_0x17629d){const _0x4ad3b8=a163_0x7bdea0,_0x57bfdb=readName(_0x17629d),_0x190258=_0x17629d[_0x4ad3b8(0x103)]('remark')[_0x4ad3b8(0x110)]()||undefined;return asDryRunResult({'operation':'create','selector':{'appCode':_0x17629d[_0x4ad3b8(0x10b)],'roleName':_0x57bfdb},'before':null,'after':{'roleName':_0x57bfdb,'roleType':_0x4ad3b8(0x115),'remark':_0x190258},'dryRun':!![],'backend':{'method':_0x4ad3b8(0x118),'path':CREATE_PATH},'warnings':[]},{'method':_0x4ad3b8(0x118),'url':CREATE_PATH});},async 'execute'(_0x3f55b5){const _0x5a1933=a163_0x7bdea0,_0x3c86df=readName(_0x3f55b5),_0x5b0c6a=_0x3f55b5['str'](_0x5a1933(0x104))['trim']()||undefined,_0x196cb8=await createAppRole({'appCode':_0x3f55b5['appCode'],'roleName':_0x3c86df,..._0x5b0c6a?{'remark':_0x5b0c6a}:{}});return{'ok':!![],'data':{'operation':_0x5a1933(0x102),'selector':{'appCode':_0x3f55b5['appCode'],'roleId':_0x196cb8['id'],'roleName':_0x3c86df},'before':null,'after':projectRole(_0x196cb8),'dryRun':![],'backend':{'method':_0x5a1933(0x118),'path':CREATE_PATH},'warnings':[]},'message':_0x5a1933(0xfe)+_0x196cb8['roleName']+_0x5a1933(0x10f)+_0x196cb8['id']+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a164_0x393b92=a164_0x2577;function a164_0x2577(_0x453ff9,_0x5c4db0){_0x453ff9=_0x453ff9-0x1e2;const _0x214547=a164_0x2145();let _0x25779b=_0x214547[_0x453ff9];return _0x25779b;}(function(_0x30ff5a,_0x48c83f){const _0x248476=a164_0x2577,_0x1b3306=_0x30ff5a();while(!![]){try{const _0x3f695e=parseInt(_0x248476(0x1e9))/0x1*(-parseInt(_0x248476(0x1ea))/0x2)+-parseInt(_0x248476(0x1f2))/0x3*(parseInt(_0x248476(0x1f7))/0x4)+parseInt(_0x248476(0x1e4))/0x5+-parseInt(_0x248476(0x1f6))/0x6+-parseInt(_0x248476(0x1ed))/0x7+parseInt(_0x248476(0x1e2))/0x8*(-parseInt(_0x248476(0x1e5))/0x9)+parseInt(_0x248476(0x1ef))/0xa*(parseInt(_0x248476(0x1ec))/0xb);if(_0x3f695e===_0x48c83f)break;else _0x1b3306['push'](_0x1b3306['shift']());}catch(_0xf558f4){_0x1b3306['push'](_0x1b3306['shift']());}}}(a164_0x2145,0xb8f8a));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=a164_0x393b92(0x1ee);export const roleDelete={'service':a164_0x393b92(0x1f1),'command':a164_0x393b92(0x1e3),'description':a164_0x393b92(0x1e6),'risk':a164_0x393b92(0x1f4),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3ac3d1){const _0x1366ee=a164_0x393b92,_0x530fc8=_0x3ac3d1[_0x1366ee(0x1f3)]('id'),_0x3f7ebc=await getRoleById(_0x3ac3d1['appCode'],_0x530fc8);return assertCustomRole(_0x3f7ebc,_0x1366ee(0x1e3)),asDryRunResult({'operation':_0x1366ee(0x1e3),'selector':{'appCode':_0x3ac3d1['appCode'],'roleId':_0x530fc8,'roleName':_0x3f7ebc['roleName']},'before':projectRole(_0x3f7ebc),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x3f7ebc['userCount']>0x0?[_0x1366ee(0x1f8)+_0x3f7ebc[_0x1366ee(0x1f0)]+_0x1366ee(0x1e7)]:[]},{'method':_0x1366ee(0x1eb),'url':DELETE_PATH});},async 'execute'(_0x3e3803){const _0x3218cf=a164_0x393b92,_0x45c2c7=_0x3e3803['num']('id'),_0x3904c0=await getRoleById(_0x3e3803[_0x3218cf(0x1e8)],_0x45c2c7);return assertCustomRole(_0x3904c0,'delete'),await deleteAppRole(_0x45c2c7),{'ok':!![],'data':{'operation':_0x3218cf(0x1e3),'selector':{'appCode':_0x3e3803[_0x3218cf(0x1e8)],'roleId':_0x45c2c7,'roleName':_0x3904c0[_0x3218cf(0x1f5)]},'before':projectRole(_0x3904c0),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':'Deleted\x20role\x20'+_0x3904c0['roleName']+'\x20(id='+_0x45c2c7+')'};}};function a164_0x2145(){const _0x335b58=['Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','appCode','4358UkzeKo','214AktZVq','POST','11DGBsqs','953974ljOAJG','/smartapi/permit/role/delete','11523450cOprfP','userCount','role','99GcrgOL','num','high-risk-write','roleName','1177464ihiZEm','39992WpcRzg','Role\x20still\x20has\x20','4474344wdjSaX','delete','6466780kFyBaw','9XgCmJG'];a164_0x2145=function(){return _0x335b58;};return a164_0x2145();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a165_0x14af5f=a165_0x4bc4;function a165_0xeb48(){const _0x51d5ab=['1174868NPLmsF','num','appCode','detail','roleType','roleName','1576595jqeeYn','12164080fqKKKP','role','3631398HbtkQJ','15900YZgkbT','416971VYIbwa','2329880pDeHuc','Role\x20','62sGhwla','Show\x20a\x20single\x20role\x27s\x20detail'];a165_0xeb48=function(){return _0x51d5ab;};return a165_0xeb48();}(function(_0x3fae6b,_0x31301a){const _0x632cf5=a165_0x4bc4,_0xcf749e=_0x3fae6b();while(!![]){try{const _0x33ca64=-parseInt(_0x632cf5(0x1bb))/0x1+-parseInt(_0x632cf5(0x1be))/0x2*(-parseInt(_0x632cf5(0x1ba))/0x3)+-parseInt(_0x632cf5(0x1c0))/0x4+parseInt(_0x632cf5(0x1c6))/0x5+-parseInt(_0x632cf5(0x1c9))/0x6+-parseInt(_0x632cf5(0x1bc))/0x7+parseInt(_0x632cf5(0x1c7))/0x8;if(_0x33ca64===_0x31301a)break;else _0xcf749e['push'](_0xcf749e['shift']());}catch(_0x50afce){_0xcf749e['push'](_0xcf749e['shift']());}}}(a165_0xeb48,0x55c88));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a165_0x4bc4(_0x4907bd,_0x323458){_0x4907bd=_0x4907bd-0x1ba;const _0xeb48a2=a165_0xeb48();let _0x4bc451=_0xeb48a2[_0x4907bd];return _0x4bc451;}export const roleDetail={'service':a165_0x14af5f(0x1c8),'command':a165_0x14af5f(0x1c3),'description':a165_0x14af5f(0x1bf),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x2c677c){const _0x3b0a75=a165_0x14af5f,_0x25966f=_0x2c677c[_0x3b0a75(0x1c1)]('id'),_0x3eb01b=await getRoleById(_0x2c677c[_0x3b0a75(0x1c2)],_0x25966f);return{'ok':!![],'data':{'role':projectRole(_0x3eb01b)},'message':_0x3b0a75(0x1bd)+_0x3eb01b[_0x3b0a75(0x1c5)]+'\x20('+_0x3eb01b[_0x3b0a75(0x1c4)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1fe42b,_0x1ff2e1){const _0x49f303=a166_0x28cf,_0x4f4783=_0x1fe42b();while(!![]){try{const _0x470f78=-parseInt(_0x49f303(0x8e))/0x1+-parseInt(_0x49f303(0x89))/0x2*(-parseInt(_0x49f303(0x8a))/0x3)+parseInt(_0x49f303(0x90))/0x4+parseInt(_0x49f303(0x88))/0x5*(-parseInt(_0x49f303(0x8c))/0x6)+parseInt(_0x49f303(0x8b))/0x7+-parseInt(_0x49f303(0x8f))/0x8*(-parseInt(_0x49f303(0x8d))/0x9)+-parseInt(_0x49f303(0x91))/0xa*(parseInt(_0x49f303(0x92))/0xb);if(_0x470f78===_0x1ff2e1)break;else _0x4f4783['push'](_0x4f4783['shift']());}catch(_0xed772d){_0x4f4783['push'](_0x4f4783['shift']());}}}(a166_0x26ef,0xeee1e));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a166_0x26ef(){const _0x2dda18=['48MAIJJX','128989oEtdZk','5245518HvZfHd','9TDZQsK','1723360QBamjY','13567672pcIWtR','7809640hLoups','3198830HotUJU','33XipjEK','5mnJXBq','108616XuKVGv'];a166_0x26ef=function(){return _0x2dda18;};return a166_0x26ef();}import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';function a166_0x28cf(_0x59abd8,_0x23ce2d){_0x59abd8=_0x59abd8-0x88;const _0x26ef18=a166_0x26ef();let _0x28cf87=_0x26ef18[_0x59abd8];return _0x28cf87;}import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';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 a167_0x407a8f=a167_0x1e57;(function(_0x57a6ae,_0x39a649){const _0x15fd89=a167_0x1e57,_0x41f2b1=_0x57a6ae();while(!![]){try{const _0x4b668b=-parseInt(_0x15fd89(0xf7))/0x1*(-parseInt(_0x15fd89(0x106))/0x2)+-parseInt(_0x15fd89(0x118))/0x3*(-parseInt(_0x15fd89(0x10e))/0x4)+-parseInt(_0x15fd89(0x10b))/0x5*(-parseInt(_0x15fd89(0xfe))/0x6)+-parseInt(_0x15fd89(0x101))/0x7*(parseInt(_0x15fd89(0x10c))/0x8)+-parseInt(_0x15fd89(0x11c))/0x9*(-parseInt(_0x15fd89(0x105))/0xa)+parseInt(_0x15fd89(0x107))/0xb*(-parseInt(_0x15fd89(0xfa))/0xc)+-parseInt(_0x15fd89(0x100))/0xd;if(_0x4b668b===_0x39a649)break;else _0x41f2b1['push'](_0x41f2b1['shift']());}catch(_0x10ef2d){_0x41f2b1['push'](_0x41f2b1['shift']());}}}(a167_0x258f,0xf170b));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a167_0x1e57(_0x3fe0d0,_0x3c5af9){_0x3fe0d0=_0x3fe0d0-0xf5;const _0x258fd5=a167_0x258f();let _0x1e571e=_0x258fd5[_0x3fe0d0];return _0x1e571e;}function a167_0x258f(){const _0x5ea75c=['12UTaMUS','Page\x20index\x20(1-based)','16684096MHgAtc','672SblSCI','map','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','2309420ELsPsu','4qlPOYX','6588362yoTtXX','length','USER','join','1876115DWfMyM','80072vDHLtq','number','5036OORtna','num','string','read','trim','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','validation','page','Found\x20','ADMIN','21bBAcqz','\x20role(s)','pagesize','str','54JfWGdP','type','CUSTOM','appCode','includes','843613oYhmTw','toUpperCase','DEV','12BwhMJJ','Use\x20one\x20of:\x20','Invalid\x20--type\x20\x22','filter'];a167_0x258f=function(){return _0x5ea75c;};return a167_0x258f();}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a167_0x407a8f(0x117),a167_0x407a8f(0xf9),a167_0x407a8f(0x109),a167_0x407a8f(0x11e)];export const roleList={'service':'role','command':'list','description':a167_0x407a8f(0x103),'risk':a167_0x407a8f(0x111),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a167_0x407a8f(0x11d),'type':a167_0x407a8f(0x110),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':a167_0x407a8f(0x115),'type':a167_0x407a8f(0x10d),'description':a167_0x407a8f(0xff),'default':0x1},{'name':'pagesize','type':a167_0x407a8f(0x10d),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x354c61){const _0x458800=a167_0x407a8f,_0x5ba450=_0x354c61['str'](_0x458800(0x11d))[_0x458800(0x112)]();if(_0x5ba450&&!ROLE_TYPES[_0x458800(0xf6)](_0x5ba450[_0x458800(0xf8)]()))throw CliErrors[_0x458800(0x114)](_0x458800(0xfc)+_0x5ba450+'\x22.',_0x458800(0xfb)+ROLE_TYPES[_0x458800(0x10a)](',\x20')+'.');const _0x1c0e78=_0x354c61[_0x458800(0x10f)]('page',0x1),_0xd922c0=_0x354c61['num'](_0x458800(0x11a),0x64);if(_0x1c0e78<0x1)throw CliErrors['validation'](_0x458800(0x113));if(_0xd922c0<0x1||_0xd922c0>0x64)throw CliErrors[_0x458800(0x114)](_0x458800(0x104));},async 'execute'(_0x8bd5e6){const _0x49cc38=a167_0x407a8f,_0x50a85f=_0x8bd5e6[_0x49cc38(0x10f)](_0x49cc38(0x115),0x1)||0x1,_0x2f90f7=_0x8bd5e6[_0x49cc38(0x10f)](_0x49cc38(0x11a),0x64)||0x64,_0x552708=_0x8bd5e6[_0x49cc38(0x11b)](_0x49cc38(0x11d))[_0x49cc38(0x112)]()[_0x49cc38(0xf8)](),{items:_0x38beed,paging:_0x5118f6}=await listAppRoles(_0x8bd5e6[_0x49cc38(0xf5)],{'currentPage':_0x50a85f,'pageSize':_0x2f90f7}),_0xbfccd0=_0x552708?_0x38beed[_0x49cc38(0xfd)](_0x5134b8=>_0x5134b8['roleType']===_0x552708):_0x38beed,_0x437ff5=_0xbfccd0[_0x49cc38(0x102)](projectRole);return{'ok':!![],'data':{'roles':_0x437ff5,'paging':_0x5118f6},'message':_0x49cc38(0x116)+_0x437ff5[_0x49cc38(0x108)]+_0x49cc38(0x119)};}};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* role service 共享逻辑(SSOT)
|
|
3
|
+
*
|
|
4
|
+
* 集中:内置角色守卫、角色引用解析(id 单查 / name 全分页)、
|
|
5
|
+
* 查人(tenant 成员目录)、user-list 全量 merge、投影与写命令输出信封。
|
|
6
|
+
* 命令文件只引用这里,不重复合并/守卫规则(见 AGENTS.md 声明式方法论 SSOT)。
|
|
7
|
+
*/
|
|
8
|
+
import { type AppRole, type RoleUsers } from "../../core/api-client.js";
|
|
9
|
+
import type { FlagDef, RuntimeContext } from "../../framework/types.js";
|
|
10
|
+
export declare const ROLE_ID_FLAG: FlagDef;
|
|
11
|
+
export declare const ROLE_REF_FLAG: FlagDef;
|
|
12
|
+
export declare const USER_REF_FLAG: FlagDef;
|
|
13
|
+
export declare const NAME_FLAG: FlagDef;
|
|
14
|
+
export declare const USER_NAME_FLAG: FlagDef;
|
|
15
|
+
export declare const REMARK_FLAG: FlagDef;
|
|
16
|
+
export declare const EXPECT_USER_COUNT_FLAG: FlagDef;
|
|
17
|
+
/** 内置角色类型(不可作为普通 CUSTOM 处理) */
|
|
18
|
+
export declare const BUILTIN_ROLE_TYPES: AppRole["roleType"][];
|
|
19
|
+
export declare function isBuiltinRole(roleType: string): boolean;
|
|
20
|
+
/** update / delete:仅允许 CUSTOM 角色 */
|
|
21
|
+
export declare function assertCustomRole(role: AppRole, action: string): void;
|
|
22
|
+
/** role-menus-set / role-apis-set:拒绝改 DEV / ADMIN 的权限矩阵 */
|
|
23
|
+
export declare function assertPermConfigurable(role: AppRole): void;
|
|
24
|
+
export interface RoleProjection {
|
|
25
|
+
id: number;
|
|
26
|
+
roleName: string;
|
|
27
|
+
roleType: AppRole["roleType"];
|
|
28
|
+
remark?: string;
|
|
29
|
+
userCount: number;
|
|
30
|
+
permitCount: number;
|
|
31
|
+
builtin: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare function projectRole(role: AppRole): RoleProjection;
|
|
34
|
+
/**
|
|
35
|
+
* 解析角色引用:纯数字按 id 匹配,否则按 roleName 精确匹配。
|
|
36
|
+
* 命中 0 个报 not found;命中多个报歧义要求用 --id 明确。
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveRoleRef(appCode: string, ref: string): Promise<AppRole>;
|
|
39
|
+
/** 按 id 取角色(用于 detail / update / delete 的前置读取) */
|
|
40
|
+
export declare function getRoleById(appCode: string, id: number): Promise<AppRole>;
|
|
41
|
+
/** 从当前会话解析 tenantCode(getByTenantCode 查人所需) */
|
|
42
|
+
export declare function resolveTenantCode(): Promise<string>;
|
|
43
|
+
export interface UserResolution {
|
|
44
|
+
userId: number;
|
|
45
|
+
username: string;
|
|
46
|
+
nickname?: string;
|
|
47
|
+
matchedBy: "id" | "name";
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 解析用户引用(--user / --name):
|
|
51
|
+
* - 纯数字:按 userId 命中租户成员补全信息;成员目录查不到时回退最小 { userId }。
|
|
52
|
+
* - 昵称/用户名:租户成员目录精确匹配;0 个 not found,多个报歧义。
|
|
53
|
+
*/
|
|
54
|
+
export declare function resolveUserRef(ref: string): Promise<UserResolution>;
|
|
55
|
+
export interface RoleUserMutationData {
|
|
56
|
+
operation: "user-add" | "user-remove";
|
|
57
|
+
selector: {
|
|
58
|
+
appCode: string;
|
|
59
|
+
roleId: number;
|
|
60
|
+
roleName: string;
|
|
61
|
+
userId: number;
|
|
62
|
+
};
|
|
63
|
+
before: {
|
|
64
|
+
userIds: number[];
|
|
65
|
+
};
|
|
66
|
+
after: {
|
|
67
|
+
userIds: number[];
|
|
68
|
+
};
|
|
69
|
+
dryRun: boolean;
|
|
70
|
+
backend: {
|
|
71
|
+
method: "POST";
|
|
72
|
+
path: string;
|
|
73
|
+
};
|
|
74
|
+
warnings: string[];
|
|
75
|
+
}
|
|
76
|
+
export declare const UPDATE_USER_LIST_PATH = "/smartapi/permit/user-role/update-user-list";
|
|
77
|
+
/**
|
|
78
|
+
* 计算 user-add / user-remove 的全量回写结果与 before/after。
|
|
79
|
+
* 只改目标 role 的 userList,其余 role 原样带回。
|
|
80
|
+
* 返回 { roleList, mutation, changed };changed=false 表示无需写(幂等)。
|
|
81
|
+
*/
|
|
82
|
+
export declare function computeRoleUserMutation(params: {
|
|
83
|
+
operation: "user-add" | "user-remove";
|
|
84
|
+
appCode: string;
|
|
85
|
+
roleUsers: RoleUsers[];
|
|
86
|
+
targetRoleId: number;
|
|
87
|
+
user: {
|
|
88
|
+
userId: number;
|
|
89
|
+
username: string;
|
|
90
|
+
nickname?: string;
|
|
91
|
+
};
|
|
92
|
+
dryRun: boolean;
|
|
93
|
+
expectUserCount?: number;
|
|
94
|
+
}): {
|
|
95
|
+
roleList: RoleUsers[];
|
|
96
|
+
mutation: RoleUserMutationData;
|
|
97
|
+
changed: boolean;
|
|
98
|
+
};
|
|
99
|
+
/** 读取目标 role 的全量成员列表(供 add/remove 前置) */
|
|
100
|
+
export declare function loadRoleUsers(appCode: string): Promise<RoleUsers[]>;
|
|
101
|
+
/** 供命令 ctx 读取角色引用 flag 的小工具 */
|
|
102
|
+
export declare function readRoleRef(ctx: RuntimeContext): string;
|
|
103
|
+
/**
|
|
104
|
+
* user-add / user-remove 的完整前置编排(供两个命令的 dryRun / execute 共用):
|
|
105
|
+
* 解析角色引用 → 解析用户 → 读全量成员 → 计算全量回写与 before/after。
|
|
106
|
+
*/
|
|
107
|
+
export declare function prepareUserMutation(ctx: RuntimeContext, operation: "user-add" | "user-remove", dryRun: boolean): Promise<ReturnType<typeof computeRoleUserMutation>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a168_0x46bcac=a168_0x3664;(function(_0x8fb62,_0x169fcf){const _0x148715=a168_0x3664,_0x32745b=_0x8fb62();while(!![]){try{const _0x3be6ba=-parseInt(_0x148715(0x131))/0x1*(parseInt(_0x148715(0x13c))/0x2)+-parseInt(_0x148715(0x139))/0x3+parseInt(_0x148715(0x119))/0x4*(parseInt(_0x148715(0x109))/0x5)+parseInt(_0x148715(0x12e))/0x6+-parseInt(_0x148715(0x125))/0x7+-parseInt(_0x148715(0x12d))/0x8+parseInt(_0x148715(0x102))/0x9;if(_0x3be6ba===_0x169fcf)break;else _0x32745b['push'](_0x32745b['shift']());}catch(_0x57a356){_0x32745b['push'](_0x32745b['shift']());}}}(a168_0x2ea0,0x8de57));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a168_0x46bcac(0xf3),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a168_0x46bcac(0x136),'type':a168_0x46bcac(0x12c),'required':!![],'description':a168_0x46bcac(0x11d)};export const USER_REF_FLAG={'name':a168_0x46bcac(0x10e),'type':a168_0x46bcac(0x12c),'required':!![],'description':a168_0x46bcac(0x13b)};export const NAME_FLAG={'name':'name','type':a168_0x46bcac(0x12c),'required':!![],'description':a168_0x46bcac(0x135)};export const USER_NAME_FLAG={'name':a168_0x46bcac(0x105),'type':a168_0x46bcac(0x12c),'required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a168_0x46bcac(0x12a),'type':a168_0x46bcac(0x12c),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a168_0x46bcac(0xf4),'type':'number','required':![],'description':a168_0x46bcac(0x13a)};export const BUILTIN_ROLE_TYPES=['ADMIN',a168_0x46bcac(0x124),a168_0x46bcac(0xf2)];export function isBuiltinRole(_0x476e10){const _0x598a96=a168_0x46bcac;return BUILTIN_ROLE_TYPES[_0x598a96(0x128)](_0x476e10);}export function assertCustomRole(_0x3a07c2,_0x3f1f1d){const _0x11b1e0=a168_0x46bcac;if(_0x3a07c2[_0x11b1e0(0xf5)]!==_0x11b1e0(0x11b))throw CliErrors[_0x11b1e0(0x12b)](_0x11b1e0(0xff)+_0x3f1f1d+_0x11b1e0(0xef)+_0x3a07c2[_0x11b1e0(0x104)]+'\x20('+_0x3a07c2[_0x11b1e0(0xf5)]+').',_0x11b1e0(0x115));}function a168_0x3664(_0x4b5e0a,_0x5a3c61){_0x4b5e0a=_0x4b5e0a-0xef;const _0x2ea075=a168_0x2ea0();let _0x366442=_0x2ea075[_0x4b5e0a];return _0x366442;}export function assertPermConfigurable(_0x12541f){const _0x22a4dd=a168_0x46bcac;if(_0x12541f['roleType']===_0x22a4dd(0x124)||_0x12541f[_0x22a4dd(0xf5)]===_0x22a4dd(0xfe))throw CliErrors['validation']('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x12541f['roleName']+'\x20('+_0x12541f[_0x22a4dd(0xf5)]+').',_0x22a4dd(0x10b));}export function projectRole(_0x5ca300){const _0x5df4b5=a168_0x46bcac;return{'id':_0x5ca300['id'],'roleName':_0x5ca300['roleName'],'roleType':_0x5ca300['roleType'],'remark':_0x5ca300[_0x5df4b5(0x12a)],'userCount':_0x5ca300[_0x5df4b5(0x113)],'permitCount':_0x5ca300['permitCount'],'builtin':isBuiltinRole(_0x5ca300[_0x5df4b5(0xf5)])};}export async function resolveRoleRef(_0xa09a3d,_0x42e09d){const _0x1529c2=a168_0x46bcac,_0x277c17=_0x42e09d[_0x1529c2(0x107)]();if(!_0x277c17)throw CliErrors[_0x1529c2(0x12b)]('Missing\x20role\x20reference.',_0x1529c2(0x11c));if(/^\d+$/[_0x1529c2(0x101)](_0x277c17))return getRoleById(_0xa09a3d,Number(_0x277c17));const _0x12e114=await listAllAppRoles(_0xa09a3d),_0x3e3b2d=_0x12e114['filter'](_0x115f79=>_0x115f79[_0x1529c2(0x104)]===_0x277c17);if(_0x3e3b2d[_0x1529c2(0x10c)]===0x0)throw CliErrors[_0x1529c2(0x12b)]('Role\x20name\x20\x22'+_0x277c17+_0x1529c2(0x10a)+_0xa09a3d+'.',_0x1529c2(0xf9));if(_0x3e3b2d[_0x1529c2(0x10c)]>0x1){const _0x1d53d8=_0x3e3b2d['map'](_0x14ce4c=>_0x14ce4c['id'])[_0x1529c2(0xf6)](',\x20');throw CliErrors[_0x1529c2(0x12b)](_0x1529c2(0xf8)+_0x277c17+_0x1529c2(0xfa)+_0x1d53d8+').',_0x1529c2(0xf0));}return _0x3e3b2d[0x0];}export async function getRoleById(_0x3a820f,_0x7b92f9){const _0x5300ba=a168_0x46bcac,_0x5ae609=await getAppRole(_0x7b92f9);if(!_0x5ae609)throw CliErrors[_0x5300ba(0x12b)]('Role\x20id\x20'+_0x7b92f9+_0x5300ba(0x138)+_0x3a820f+'.',_0x5300ba(0xf1));return _0x5ae609;}async function listAllAppRoles(_0xbbd1c2){const _0x27bf60=a168_0x46bcac,_0x2ebe43=0x64,_0x5bedbd=[];for(let _0x3c3315=0x1;;_0x3c3315+=0x1){const {items:_0x4a4925,paging:_0x5b7b36}=await listAppRoles(_0xbbd1c2,{'currentPage':_0x3c3315,'pageSize':_0x2ebe43});_0x5bedbd[_0x27bf60(0x108)](..._0x4a4925);if(_0x4a4925[_0x27bf60(0x10c)]<_0x2ebe43||_0x5b7b36&&_0x5bedbd[_0x27bf60(0x10c)]>=_0x5b7b36[_0x27bf60(0x112)])return _0x5bedbd;}}export async function resolveTenantCode(){const _0x3bc5f0=a168_0x46bcac,_0x4f97d3=await getSessionUserInfo(),_0x135391=_0x4f97d3?.[_0x3bc5f0(0x10e)]?.[_0x3bc5f0(0xfd)]?.['tenant_code'];if(!_0x135391)throw CliErrors['authRequired'](_0x3bc5f0(0x120));return _0x135391;}function matchMember(_0x21e501,_0x1efe1d){const _0x1929a2=a168_0x46bcac,_0x24ae06=_0x1efe1d['trim']()[_0x1929a2(0x10d)]();return(_0x21e501[_0x1929a2(0x114)]??'')['toLowerCase']()===_0x24ae06||(_0x21e501['username']??'')[_0x1929a2(0x10d)]()===_0x24ae06;}export async function resolveUserRef(_0x18a764){const _0x4dfdb0=a168_0x46bcac,_0x2d3d33=_0x18a764[_0x4dfdb0(0x107)]();if(!_0x2d3d33)throw CliErrors['validation'](_0x4dfdb0(0x11a),_0x4dfdb0(0x11f));const _0x2d7b92=await resolveTenantCode(),_0x394511=await getTenantMembers(_0x2d7b92);if(/^\d+$/['test'](_0x2d3d33)){const _0x5dc85e=Number(_0x2d3d33),_0x5a24bc=_0x394511[_0x4dfdb0(0x126)](_0x29376e=>_0x29376e[_0x4dfdb0(0x130)]===_0x5dc85e);return{'userId':_0x5dc85e,'username':_0x5a24bc?.['username']??String(_0x5dc85e),'nickname':_0x5a24bc?.[_0x4dfdb0(0x114)],'matchedBy':'id'};}const _0x21c9b9=_0x394511[_0x4dfdb0(0x134)](_0x35b6b7=>matchMember(_0x35b6b7,_0x2d3d33));if(_0x21c9b9[_0x4dfdb0(0x10c)]===0x0)throw CliErrors[_0x4dfdb0(0x12b)](_0x4dfdb0(0x127)+_0x2d3d33+'\x22.',_0x4dfdb0(0xfc));if(_0x21c9b9['length']>0x1){const _0x4b2339=_0x21c9b9[_0x4dfdb0(0x106)](_0xb2bd33=>(_0xb2bd33[_0x4dfdb0(0x114)]??_0xb2bd33[_0x4dfdb0(0x121)]??'?')+'('+_0xb2bd33[_0x4dfdb0(0x130)]+')')['join'](',\x20');throw CliErrors[_0x4dfdb0(0x12b)](_0x4dfdb0(0x122)+_0x2d3d33+_0x4dfdb0(0xfb)+_0x4b2339+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x5579cb=_0x21c9b9[0x0];return{'userId':_0x5579cb[_0x4dfdb0(0x130)],'username':_0x5579cb['username']??String(_0x5579cb['userId']),'nickname':_0x5579cb[_0x4dfdb0(0x114)],'matchedBy':_0x4dfdb0(0x105)};}function a168_0x2ea0(){const _0x1d007d=['Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','tenant','ADMIN','Cannot\x20','User\x20','test','10698417oWuLzk',';\x20no\x20change.','roleName','name','map','trim','push','505hAqpNU','\x22\x20not\x20found\x20in\x20app\x20','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','length','toLowerCase','user','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','str','findIndex','totalCount','userCount','nickname','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','flagMissing','Role\x20id\x20','\x20is\x20not\x20a\x20member\x20of\x20role\x20','23704honbgg','Missing\x20user\x20reference.','CUSTOM','Pass\x20--role\x20<id|name>.','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Pass\x20--user\x20<id|name>.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','username','Multiple\x20tenant\x20members\x20match\x20\x22','splice','DEV','355355MNfjpA','find','No\x20tenant\x20member\x20matches\x20\x22','includes','expectUserCount','remark','validation','string','998528tQeGod','3005130poMnSC','\x20not\x20found\x20in\x20the\x20user-role\x20list.','userId','1RFPaWx','dryRun','appCode','filter','Role\x20name','role','userList','\x20not\x20found\x20in\x20app\x20','2549205vXGJSe','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','1363142rQBBtV','\x20built-in\x20role\x20','Disambiguate\x20with\x20--role\x20<id>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','USER','number','expect-user-count','roleType','join','POST','Role\x20name\x20\x22','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','\x22\x20is\x20ambiguous\x20(ids:\x20','\x22:\x20'];a168_0x2ea0=function(){return _0x1d007d;};return a168_0x2ea0();}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x34f72b){const _0x2a1c44=a168_0x46bcac;return(_0x34f72b?.[_0x2a1c44(0x137)]??[])[_0x2a1c44(0x106)](_0x22cc5c=>_0x22cc5c[_0x2a1c44(0x130)]);}export function computeRoleUserMutation(_0xe7d0cc){const _0x57fb39=a168_0x46bcac,{operation:_0x14817b,appCode:_0x5af3d7,roleUsers:_0x361742,targetRoleId:_0x246b75,user:_0x5e5467}=_0xe7d0cc,_0x5f7f82=_0x361742[_0x57fb39(0x126)](_0x59d9f6=>_0x59d9f6['id']===_0x246b75);if(!_0x5f7f82)throw CliErrors[_0x57fb39(0x12b)](_0x57fb39(0x117)+_0x246b75+_0x57fb39(0x12f),_0x57fb39(0xf1));const _0x19c299=userIdsOf(_0x5f7f82),_0x3bf8ea=[];if(_0xe7d0cc[_0x57fb39(0x129)]!==undefined&&_0xe7d0cc[_0x57fb39(0x129)]!==_0x19c299[_0x57fb39(0x10c)])throw CliErrors[_0x57fb39(0x12b)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0xe7d0cc[_0x57fb39(0x129)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x19c299['length']+'.',_0x57fb39(0x10f));const _0x5c3517=_0x19c299[_0x57fb39(0x128)](_0x5e5467[_0x57fb39(0x130)]);let _0x55d9cb=![];const _0x47d65d=[..._0x5f7f82['userList']];if(_0x14817b==='user-add')_0x5c3517?_0x3bf8ea[_0x57fb39(0x108)]('User\x20'+_0x5e5467[_0x57fb39(0x130)]+_0x57fb39(0x11e)+_0x5f7f82[_0x57fb39(0x104)]+_0x57fb39(0x103)):(_0x47d65d[_0x57fb39(0x108)]({'userId':_0x5e5467[_0x57fb39(0x130)],'username':_0x5e5467[_0x57fb39(0x121)],..._0x5e5467['nickname']?{'nickname':_0x5e5467['nickname']}:{}}),_0x55d9cb=!![]);else{if(!_0x5c3517)_0x3bf8ea[_0x57fb39(0x108)](_0x57fb39(0x100)+_0x5e5467['userId']+_0x57fb39(0x118)+_0x5f7f82[_0x57fb39(0x104)]+_0x57fb39(0x103));else{const _0x3d8eb7=_0x47d65d[_0x57fb39(0x111)](_0x9e1988=>_0x9e1988[_0x57fb39(0x130)]===_0x5e5467['userId']);if(_0x3d8eb7>=0x0)_0x47d65d[_0x57fb39(0x123)](_0x3d8eb7,0x1);_0x55d9cb=!![];}}const _0x2264b2=_0x361742[_0x57fb39(0x106)](_0x4ae3d1=>_0x4ae3d1['id']===_0x246b75?{..._0x4ae3d1,'userList':_0x47d65d}:_0x4ae3d1),_0x3405a8=_0x47d65d[_0x57fb39(0x106)](_0xf2f527=>_0xf2f527['userId']),_0xa8381={'operation':_0x14817b,'selector':{'appCode':_0x5af3d7,'roleId':_0x246b75,'roleName':_0x5f7f82[_0x57fb39(0x104)],'userId':_0x5e5467['userId']},'before':{'userIds':_0x19c299},'after':{'userIds':_0x3405a8},'dryRun':_0xe7d0cc[_0x57fb39(0x132)],'backend':{'method':_0x57fb39(0xf7),'path':UPDATE_USER_LIST_PATH},'warnings':_0x3bf8ea};return{'roleList':_0x2264b2,'mutation':_0xa8381,'changed':_0x55d9cb};}export async function loadRoleUsers(_0x3d3168){return listRoleUsers(_0x3d3168);}export function readRoleRef(_0x40be03){const _0x17f119=a168_0x46bcac,_0x3238eb=_0x40be03[_0x17f119(0x110)]('role')['trim']();if(!_0x3238eb)throw CliErrors['flagMissing'](_0x17f119(0x136),_0x17f119(0x11c));return _0x3238eb;}export async function prepareUserMutation(_0x4d8dda,_0x52a468,_0x4ac1ae){const _0x468248=a168_0x46bcac,_0x1a2bf4=readRoleRef(_0x4d8dda),_0x225215=_0x4d8dda[_0x468248(0x110)]('user')[_0x468248(0x107)]();if(!_0x225215)throw CliErrors[_0x468248(0x116)](_0x468248(0x10e),_0x468248(0x11f));const _0x3fab0e=_0x4d8dda['flag'](_0x468248(0xf4)),_0x3aee2b=_0x3fab0e===undefined||_0x3fab0e===null?undefined:Number(_0x3fab0e),_0xfcc64e=await resolveRoleRef(_0x4d8dda[_0x468248(0x133)],_0x1a2bf4),_0x3b3b01=await resolveUserRef(_0x225215),_0x641cc6=await loadRoleUsers(_0x4d8dda[_0x468248(0x133)]);return computeRoleUserMutation({'operation':_0x52a468,'appCode':_0x4d8dda[_0x468248(0x133)],'roleUsers':_0x641cc6,'targetRoleId':_0xfcc64e['id'],'user':{'userId':_0x3b3b01[_0x468248(0x130)],'username':_0x3b3b01[_0x468248(0x121)],'nickname':_0x3b3b01[_0x468248(0x114)]},'dryRun':_0x4ac1ae,..._0x3aee2b!==undefined?{'expectUserCount':_0x3aee2b}:{}});}
|
|
1
|
+
const a168_0x174918=a168_0x326d;(function(_0xcb8909,_0x41290c){const _0x4cca78=a168_0x326d,_0x3c242a=_0xcb8909();while(!![]){try{const _0x1496f5=parseInt(_0x4cca78(0xba))/0x1+parseInt(_0x4cca78(0xab))/0x2*(-parseInt(_0x4cca78(0x97))/0x3)+-parseInt(_0x4cca78(0x8d))/0x4+-parseInt(_0x4cca78(0xb1))/0x5+-parseInt(_0x4cca78(0x7f))/0x6+parseInt(_0x4cca78(0x9d))/0x7+parseInt(_0x4cca78(0xbd))/0x8;if(_0x1496f5===_0x41290c)break;else _0x3c242a['push'](_0x3c242a['shift']());}catch(_0x421a70){_0x3c242a['push'](_0x3c242a['shift']());}}}(a168_0x3de6,0x1fc4b));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':a168_0x174918(0xb3)};export const ROLE_REF_FLAG={'name':a168_0x174918(0x9b),'type':a168_0x174918(0xb4),'required':!![],'description':a168_0x174918(0x89)};export const USER_REF_FLAG={'name':'user','type':a168_0x174918(0xb4),'required':!![],'description':a168_0x174918(0x86)};export const NAME_FLAG={'name':'name','type':a168_0x174918(0xb4),'required':!![],'description':a168_0x174918(0x94)};export const USER_NAME_FLAG={'name':'name','type':'string','required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':'remark','type':a168_0x174918(0xb4),'required':![],'description':a168_0x174918(0xaa)};export const EXPECT_USER_COUNT_FLAG={'name':a168_0x174918(0x9f),'type':a168_0x174918(0x8e),'required':![],'description':a168_0x174918(0xa4)};export const BUILTIN_ROLE_TYPES=[a168_0x174918(0xbe),'DEV',a168_0x174918(0xc1)];export function isBuiltinRole(_0x3e09f6){const _0x28480e=a168_0x174918;return BUILTIN_ROLE_TYPES[_0x28480e(0xa6)](_0x3e09f6);}export function assertCustomRole(_0x377141,_0x3596ef){const _0x300d72=a168_0x174918;if(_0x377141['roleType']!==_0x300d72(0xb0))throw CliErrors['validation'](_0x300d72(0x7c)+_0x3596ef+_0x300d72(0xc0)+_0x377141[_0x300d72(0x80)]+'\x20('+_0x377141['roleType']+').',_0x300d72(0x87));}export function assertPermConfigurable(_0x54a9f4){const _0x46f6bb=a168_0x174918;if(_0x54a9f4[_0x46f6bb(0xa8)]==='DEV'||_0x54a9f4[_0x46f6bb(0xa8)]===_0x46f6bb(0xbe))throw CliErrors[_0x46f6bb(0x8f)](_0x46f6bb(0x83)+_0x54a9f4['roleName']+'\x20('+_0x54a9f4['roleType']+').',_0x46f6bb(0x88));}export function projectRole(_0x47e596){const _0x1b6445=a168_0x174918;return{'id':_0x47e596['id'],'roleName':_0x47e596[_0x1b6445(0x80)],'roleType':_0x47e596[_0x1b6445(0xa8)],'remark':_0x47e596['remark'],'userCount':_0x47e596[_0x1b6445(0xb8)],'permitCount':_0x47e596['permitCount'],'builtin':isBuiltinRole(_0x47e596[_0x1b6445(0xa8)])};}function a168_0x326d(_0x3706ff,_0x143fe3){_0x3706ff=_0x3706ff-0x7c;const _0x3de6fc=a168_0x3de6();let _0x326da6=_0x3de6fc[_0x3706ff];return _0x326da6;}export async function resolveRoleRef(_0x17dfa8,_0x49f055){const _0x13910c=a168_0x174918,_0x3bef42=_0x49f055['trim']();if(!_0x3bef42)throw CliErrors[_0x13910c(0x8f)](_0x13910c(0xac),'Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x3bef42))return getRoleById(_0x17dfa8,Number(_0x3bef42));const _0x8c3099=await listAllAppRoles(_0x17dfa8),_0x41c2d5=_0x8c3099['filter'](_0x308e9e=>_0x308e9e[_0x13910c(0x80)]===_0x3bef42);if(_0x41c2d5['length']===0x0)throw CliErrors[_0x13910c(0x8f)]('Role\x20name\x20\x22'+_0x3bef42+_0x13910c(0x98)+_0x17dfa8+'.',_0x13910c(0xb7));if(_0x41c2d5['length']>0x1){const _0x967e13=_0x41c2d5[_0x13910c(0x9c)](_0xe936a6=>_0xe936a6['id'])[_0x13910c(0xa2)](',\x20');throw CliErrors['validation'](_0x13910c(0xc9)+_0x3bef42+_0x13910c(0x95)+_0x967e13+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x41c2d5[0x0];}export async function getRoleById(_0x2f19ce,_0x5ec16b){const _0x1a8b1c=a168_0x174918,_0x26839a=await getAppRole(_0x5ec16b);if(!_0x26839a)throw CliErrors['validation']('Role\x20id\x20'+_0x5ec16b+'\x20not\x20found\x20in\x20app\x20'+_0x2f19ce+'.',_0x1a8b1c(0x7e));return _0x26839a;}async function listAllAppRoles(_0x5d461e){const _0x526e40=a168_0x174918,_0x3159cc=0x64,_0x16897d=[];for(let _0x56ada0=0x1;;_0x56ada0+=0x1){const {items:_0x41d77d,paging:_0x2f295b}=await listAppRoles(_0x5d461e,{'currentPage':_0x56ada0,'pageSize':_0x3159cc});_0x16897d['push'](..._0x41d77d);if(_0x41d77d['length']<_0x3159cc||_0x2f295b&&_0x16897d['length']>=_0x2f295b[_0x526e40(0x90)])return _0x16897d;}}export async function resolveTenantCode(){const _0x3f298c=a168_0x174918,_0x2052b9=await getSessionUserInfo(),_0x2423b4=_0x2052b9?.[_0x3f298c(0xbf)]?.[_0x3f298c(0xc8)]?.[_0x3f298c(0xaf)];if(!_0x2423b4)throw CliErrors[_0x3f298c(0x8a)]('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x2423b4;}function matchMember(_0x13e998,_0x3399e1){const _0x10ffdc=a168_0x174918,_0x48afed=_0x3399e1[_0x10ffdc(0xbb)]()[_0x10ffdc(0xae)]();return(_0x13e998['nickname']??'')['toLowerCase']()===_0x48afed||(_0x13e998[_0x10ffdc(0x84)]??'')[_0x10ffdc(0xae)]()===_0x48afed;}export async function resolveUserRef(_0x2f7d11){const _0x1a8412=a168_0x174918,_0x477066=_0x2f7d11[_0x1a8412(0xbb)]();if(!_0x477066)throw CliErrors['validation'](_0x1a8412(0xbc),_0x1a8412(0xb2));const _0x153ac6=await resolveTenantCode(),_0x58fb6e=await getTenantMembers(_0x153ac6);if(/^\d+$/[_0x1a8412(0xa9)](_0x477066)){const _0x27da5d=Number(_0x477066),_0x4c1323=_0x58fb6e[_0x1a8412(0xc6)](_0x36444d=>_0x36444d[_0x1a8412(0xb9)]===_0x27da5d);return{'userId':_0x27da5d,'username':_0x4c1323?.[_0x1a8412(0x84)]??String(_0x27da5d),'nickname':_0x4c1323?.[_0x1a8412(0xc7)],'matchedBy':'id'};}const _0x5493ca=_0x58fb6e[_0x1a8412(0x93)](_0x59a9ef=>matchMember(_0x59a9ef,_0x477066));if(_0x5493ca[_0x1a8412(0xa1)]===0x0)throw CliErrors['validation'](_0x1a8412(0x92)+_0x477066+'\x22.',_0x1a8412(0x9a));if(_0x5493ca[_0x1a8412(0xa1)]>0x1){const _0x18e243=_0x5493ca[_0x1a8412(0x9c)](_0x970869=>(_0x970869[_0x1a8412(0xc7)]??_0x970869['username']??'?')+'('+_0x970869[_0x1a8412(0xb9)]+')')[_0x1a8412(0xa2)](',\x20');throw CliErrors[_0x1a8412(0x8f)](_0x1a8412(0xa3)+_0x477066+_0x1a8412(0x81)+_0x18e243+'.',_0x1a8412(0xa0));}const _0x2ab5af=_0x5493ca[0x0];return{'userId':_0x2ab5af[_0x1a8412(0xb9)],'username':_0x2ab5af[_0x1a8412(0x84)]??String(_0x2ab5af[_0x1a8412(0xb9)]),'nickname':_0x2ab5af[_0x1a8412(0xc7)],'matchedBy':'name'};}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x25f63c){const _0xb217d9=a168_0x174918;return(_0x25f63c?.[_0xb217d9(0x82)]??[])[_0xb217d9(0x9c)](_0x117f5b=>_0x117f5b[_0xb217d9(0xb9)]);}export function computeRoleUserMutation(_0x228e7a){const _0xc4448=a168_0x174918,{operation:_0x11a668,appCode:_0x402f3f,roleUsers:_0x532d80,targetRoleId:_0x1a8a66,user:_0x440339}=_0x228e7a,_0xc13d4f=_0x532d80[_0xc4448(0xc6)](_0x27c144=>_0x27c144['id']===_0x1a8a66);if(!_0xc13d4f)throw CliErrors[_0xc4448(0x8f)](_0xc4448(0x96)+_0x1a8a66+_0xc4448(0x85),_0xc4448(0x7e));const _0x484695=userIdsOf(_0xc13d4f),_0x10b2bc=[];if(_0x228e7a[_0xc4448(0xc3)]!==undefined&&_0x228e7a[_0xc4448(0xc3)]!==_0x484695['length'])throw CliErrors[_0xc4448(0x8f)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x228e7a[_0xc4448(0xc3)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x484695[_0xc4448(0xa1)]+'.',_0xc4448(0x99));const _0x3833c8=_0x484695[_0xc4448(0xa6)](_0x440339[_0xc4448(0xb9)]);let _0x251118=![];const _0x3fb839=[..._0xc13d4f[_0xc4448(0x82)]];if(_0x11a668===_0xc4448(0xa7))_0x3833c8?_0x10b2bc[_0xc4448(0xad)](_0xc4448(0xc2)+_0x440339[_0xc4448(0xb9)]+_0xc4448(0xb6)+_0xc13d4f[_0xc4448(0x80)]+';\x20no\x20change.'):(_0x3fb839['push']({'userId':_0x440339[_0xc4448(0xb9)],'username':_0x440339[_0xc4448(0x84)],..._0x440339[_0xc4448(0xc7)]?{'nickname':_0x440339[_0xc4448(0xc7)]}:{}}),_0x251118=!![]);else{if(!_0x3833c8)_0x10b2bc[_0xc4448(0xad)](_0xc4448(0xc2)+_0x440339[_0xc4448(0xb9)]+_0xc4448(0x9e)+_0xc13d4f[_0xc4448(0x80)]+';\x20no\x20change.');else{const _0x494e03=_0x3fb839['findIndex'](_0x22750b=>_0x22750b[_0xc4448(0xb9)]===_0x440339['userId']);if(_0x494e03>=0x0)_0x3fb839[_0xc4448(0xa5)](_0x494e03,0x1);_0x251118=!![];}}const _0x26fff2=_0x532d80['map'](_0x445a95=>_0x445a95['id']===_0x1a8a66?{..._0x445a95,'userList':_0x3fb839}:_0x445a95),_0x7717c8=_0x3fb839[_0xc4448(0x9c)](_0x32f3b3=>_0x32f3b3['userId']),_0x2a1a3d={'operation':_0x11a668,'selector':{'appCode':_0x402f3f,'roleId':_0x1a8a66,'roleName':_0xc13d4f[_0xc4448(0x80)],'userId':_0x440339[_0xc4448(0xb9)]},'before':{'userIds':_0x484695},'after':{'userIds':_0x7717c8},'dryRun':_0x228e7a[_0xc4448(0x91)],'backend':{'method':_0xc4448(0x8b),'path':UPDATE_USER_LIST_PATH},'warnings':_0x10b2bc};return{'roleList':_0x26fff2,'mutation':_0x2a1a3d,'changed':_0x251118};}export async function loadRoleUsers(_0xef465f){return listRoleUsers(_0xef465f);}export function readRoleRef(_0x466e4f){const _0x4a0f39=a168_0x174918,_0x3d501f=_0x466e4f[_0x4a0f39(0x7d)](_0x4a0f39(0x9b))[_0x4a0f39(0xbb)]();if(!_0x3d501f)throw CliErrors[_0x4a0f39(0x8c)](_0x4a0f39(0x9b),_0x4a0f39(0xc4));return _0x3d501f;}export async function prepareUserMutation(_0x2e74f0,_0x2874cc,_0x5a8fd9){const _0x277104=a168_0x174918,_0x805879=readRoleRef(_0x2e74f0),_0x277a69=_0x2e74f0['str'](_0x277104(0xbf))[_0x277104(0xbb)]();if(!_0x277a69)throw CliErrors['flagMissing']('user','Pass\x20--user\x20<id|name>.');const _0x283c6f=_0x2e74f0[_0x277104(0xb5)]('expect-user-count'),_0x1eee7f=_0x283c6f===undefined||_0x283c6f===null?undefined:Number(_0x283c6f),_0x5cb1fc=await resolveRoleRef(_0x2e74f0[_0x277104(0xc5)],_0x805879),_0x3b9f05=await resolveUserRef(_0x277a69),_0x2984f0=await loadRoleUsers(_0x2e74f0['appCode']);return computeRoleUserMutation({'operation':_0x2874cc,'appCode':_0x2e74f0[_0x277104(0xc5)],'roleUsers':_0x2984f0,'targetRoleId':_0x5cb1fc['id'],'user':{'userId':_0x3b9f05['userId'],'username':_0x3b9f05[_0x277104(0x84)],'nickname':_0x3b9f05[_0x277104(0xc7)]},'dryRun':_0x5a8fd9,..._0x1eee7f!==undefined?{'expectUserCount':_0x1eee7f}:{}});}function a168_0x3de6(){const _0xda5af3=['length','join','Multiple\x20tenant\x20members\x20match\x20\x22','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','splice','includes','user-add','roleType','test','Optional\x20role\x20remark/description','2846yZAQkH','Missing\x20role\x20reference.','push','toLowerCase','tenant_code','CUSTOM','760525xRiEYa','Pass\x20--user\x20<id|name>.','Role\x20id\x20(from\x20`role\x20list`)','string','flag','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','userCount','userId','216524xxwXom','trim','Missing\x20user\x20reference.','2939648Daoltw','ADMIN','user','\x20built-in\x20role\x20','USER','User\x20','expectUserCount','Pass\x20--role\x20<id|name>.','appCode','find','nickname','tenant','Role\x20name\x20\x22','Cannot\x20','str','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','269202aSgige','roleName','\x22:\x20','userList','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','username','\x20not\x20found\x20in\x20the\x20user-role\x20list.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','authRequired','POST','flagMissing','982460Vdfkdh','number','validation','totalCount','dryRun','No\x20tenant\x20member\x20matches\x20\x22','filter','Role\x20name','\x22\x20is\x20ambiguous\x20(ids:\x20','Role\x20id\x20','345oMrimA','\x22\x20not\x20found\x20in\x20app\x20','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','role','map','1066625wduUci','\x20is\x20not\x20a\x20member\x20of\x20role\x20','expect-user-count','Disambiguate\x20with\x20--user\x20<id>.'];a168_0x3de6=function(){return _0xda5af3;};return a168_0x3de6();}
|