@lovrabet/rabetbase-cli 2.5.12-beta.1 → 2.5.13-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase/guides/custom-page-workflow.md +32 -2
- package/skills/rabetbase/knowledge/custom-page/generation-standards.md +106 -6
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
- package/templates/custom-pages/blank.json +1 -1
- package/templates/custom-pages/dashboard.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a232_0x4f8159=a232_0x5894;(function(_0x1d55a0,_0x420278){const _0x14e5df=a232_0x5894,_0x136315=_0x1d55a0();while(!![]){try{const _0xd4a58c=parseInt(_0x14e5df(0x157))/0x1+-parseInt(_0x14e5df(0x156))/0x2+-parseInt(_0x14e5df(0x14f))/0x3+parseInt(_0x14e5df(0x152))/0x4+-parseInt(_0x14e5df(0x154))/0x5*(parseInt(_0x14e5df(0x14b))/0x6)+parseInt(_0x14e5df(0x14c))/0x7+parseInt(_0x14e5df(0x14e))/0x8;if(_0xd4a58c===_0x420278)break;else _0x136315['push'](_0x136315['shift']());}catch(_0x5a59fc){_0x136315['push'](_0x136315['shift']());}}}(a232_0x25f5,0xe910e));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a232_0x5894(_0x57ac08,_0x3af0e9){_0x57ac08=_0x57ac08-0x14b;const _0x25f58d=a232_0x25f5();let _0x5894bc=_0x25f58d[_0x57ac08];return _0x5894bc;}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a232_0x25f5(){const _0x57c5aa=['num','detail','2270100JyPQAA','8528520LpnqPe','dev','12243040DTevZx','5128896oEMcbi','role','Role\x20','5090820Jgoizj','read','20vdUPUi','roleName','1870924gktWxL','1091687SWxZIw','roleType'];a232_0x25f5=function(){return _0x57c5aa;};return a232_0x25f5();}export const roleDetail={'service':a232_0x4f8159(0x150),'command':a232_0x4f8159(0x15a),'description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':a232_0x4f8159(0x153),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x51df83){const _0x19e308=a232_0x4f8159,_0xe00ba5=_0x51df83[_0x19e308(0x159)]('id'),_0x366dd5=await getRoleById(_0x51df83['appCode'],_0xe00ba5);return{'ok':!![],'data':{'scope':_0x19e308(0x14d),'role':projectRole(_0x366dd5)},'message':_0x19e308(0x151)+_0x366dd5[_0x19e308(0x155)]+'\x20('+_0x366dd5[_0x19e308(0x158)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4ad6d4,_0x1937f5){const _0xe62e2b=a233_0x3f28,_0x485cf8=_0x4ad6d4();while(!![]){try{const _0x477760=parseInt(_0xe62e2b(0x75))/0x1*(parseInt(_0xe62e2b(0x7a))/0x2)+parseInt(_0xe62e2b(0x79))/0x3+parseInt(_0xe62e2b(0x74))/0x4*(parseInt(_0xe62e2b(0x7c))/0x5)+parseInt(_0xe62e2b(0x73))/0x6+-parseInt(_0xe62e2b(0x77))/0x7+parseInt(_0xe62e2b(0x7d))/0x8*(-parseInt(_0xe62e2b(0x78))/0x9)+parseInt(_0xe62e2b(0x76))/0xa*(-parseInt(_0xe62e2b(0x7b))/0xb);if(_0x477760===_0x1937f5)break;else _0x485cf8['push'](_0x485cf8['shift']());}catch(_0x47bd90){_0x485cf8['push'](_0x485cf8['shift']());}}}(a233_0x4ff3,0x6f803));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a233_0x4ff3(){const _0x5e5f6c=['9mzQJrc','1047459SdJUjc','158yNHyZG','83677doTuIR','1900895CVvWKd','75408RZqHfz','1084548nfXeqD','4yMYRZz','4931ZEHREd','760ZsXUGb','1787618KwUMVw'];a233_0x4ff3=function(){return _0x5e5f6c;};return a233_0x4ff3();}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';function a233_0x3f28(_0x579a6a,_0x176623){_0x579a6a=_0x579a6a-0x73;const _0x4ff3fc=a233_0x4ff3();let _0x3f2875=_0x4ff3fc[_0x579a6a];return _0x3f2875;}import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a234_0x5debc8=a234_0x589e;(function(_0x4d876d,_0x1dbe2b){const _0x154212=a234_0x589e,_0x1ded55=_0x4d876d();while(!![]){try{const _0x2312f2=-parseInt(_0x154212(0xd7))/0x1*(parseInt(_0x154212(0xeb))/0x2)+parseInt(_0x154212(0xcb))/0x3*(parseInt(_0x154212(0xd3))/0x4)+-parseInt(_0x154212(0xe8))/0x5+parseInt(_0x154212(0xd1))/0x6*(-parseInt(_0x154212(0xe7))/0x7)+parseInt(_0x154212(0xcf))/0x8+parseInt(_0x154212(0xdb))/0x9*(-parseInt(_0x154212(0xea))/0xa)+parseInt(_0x154212(0xce))/0xb*(parseInt(_0x154212(0xdc))/0xc);if(_0x2312f2===_0x1dbe2b)break;else _0x1ded55['push'](_0x1ded55['shift']());}catch(_0x4d5c6f){_0x1ded55['push'](_0x1ded55['shift']());}}}(a234_0x42ef,0x79d37));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a234_0x589e(_0x58bda8,_0x58f61c){_0x58bda8=_0x58bda8-0xc5;const _0x42ef4c=a234_0x42ef();let _0x589ebc=_0x42ef4c[_0x58bda8];return _0x589ebc;}function a234_0x42ef(){const _0x278513=['807506wbJBJf','1149710stNmeJ','num','342760rsHHEe','23842FcAZqa','Use\x20one\x20of:\x20','read','length','roleType','\x20role(s)','page','number','join','dev','appCode','69IuxrnE','filter','Page\x20size\x20(1-100)','2600873uRyiYb','6020808NxMsyS','list','48zYSmvB','Filter\x20by\x20role\x20type','126500HCNjWe','pagesize','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','map','10PQUMzx','Invalid\x20--type\x20\x22','CUSTOM','role','234poZKmV','60ATOutS','string','toUpperCase','includes','Found\x20','validation','trim','str','OWNER','type','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.'];a234_0x42ef=function(){return _0x278513;};return a234_0x42ef();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=['ADMIN','DEV',a234_0x5debc8(0xe4),a234_0x5debc8(0xd9)];export const roleList={'service':a234_0x5debc8(0xda),'command':a234_0x5debc8(0xd0),'description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a234_0x5debc8(0xed),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0x5debc8(0xe5),'type':a234_0x5debc8(0xdd),'required':![],'description':a234_0x5debc8(0xd2),'enum':ROLE_TYPES},{'name':'page','type':'number','description':'Page\x20index\x20(1-based)','default':0x1},{'name':a234_0x5debc8(0xd4),'type':a234_0x5debc8(0xc7),'description':a234_0x5debc8(0xcd),'default':0x64}],async 'validate'(_0x4c82e8){const _0x506a53=a234_0x5debc8,_0x530465=_0x4c82e8[_0x506a53(0xe3)]('type')[_0x506a53(0xe2)]();if(_0x530465&&!ROLE_TYPES[_0x506a53(0xdf)](_0x530465['toUpperCase']()))throw CliErrors['validation'](_0x506a53(0xd8)+_0x530465+'\x22.',_0x506a53(0xec)+ROLE_TYPES[_0x506a53(0xc8)](',\x20')+'.');const _0x4698e5=_0x4c82e8['num'](_0x506a53(0xc6),0x1),_0x1b44f4=_0x4c82e8['num'](_0x506a53(0xd4),0x64);if(_0x4698e5<0x1)throw CliErrors[_0x506a53(0xe1)](_0x506a53(0xe6));if(_0x1b44f4<0x1||_0x1b44f4>0x64)throw CliErrors[_0x506a53(0xe1)](_0x506a53(0xd5));},async 'execute'(_0x292809){const _0x1262fb=a234_0x5debc8,_0x5052c2=_0x292809[_0x1262fb(0xe9)](_0x1262fb(0xc6),0x1)||0x1,_0x2bad67=_0x292809[_0x1262fb(0xe9)]('pagesize',0x64)||0x64,_0xfb5736=_0x292809[_0x1262fb(0xe3)](_0x1262fb(0xe5))[_0x1262fb(0xe2)]()[_0x1262fb(0xde)](),{items:_0x17d641,paging:_0x33e0f5}=await listAppRoles(_0x292809[_0x1262fb(0xca)],{'currentPage':_0x5052c2,'pageSize':_0x2bad67}),_0x120821=_0xfb5736?_0x17d641[_0x1262fb(0xcc)](_0x18589d=>_0x18589d[_0x1262fb(0xef)]===_0xfb5736):_0x17d641,_0x46b1ae=_0x120821[_0x1262fb(0xd6)](projectRole);return{'ok':!![],'data':{'scope':_0x1262fb(0xc9),'roles':_0x46b1ae,'paging':_0x33e0f5},'message':_0x1262fb(0xe0)+_0x46b1ae[_0x1262fb(0xee)]+_0x1262fb(0xc5)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a235_0x3d0f3d=a235_0x383c;(function(_0x3b20b8,_0x1c1b1b){const _0x51f90b=a235_0x383c,_0x2f981c=_0x3b20b8();while(!![]){try{const _0x54e051=-parseInt(_0x51f90b(0x192))/0x1*(-parseInt(_0x51f90b(0x1d4))/0x2)+-parseInt(_0x51f90b(0x1a4))/0x3+parseInt(_0x51f90b(0x1b1))/0x4+parseInt(_0x51f90b(0x1c9))/0x5+-parseInt(_0x51f90b(0x1a2))/0x6*(parseInt(_0x51f90b(0x1cf))/0x7)+parseInt(_0x51f90b(0x194))/0x8+-parseInt(_0x51f90b(0x1d0))/0x9;if(_0x54e051===_0x1c1b1b)break;else _0x2f981c['push'](_0x2f981c['shift']());}catch(_0x5045b8){_0x2f981c['push'](_0x2f981c['shift']());}}}(a235_0x55ce,0x85c62));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}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':a235_0x3d0f3d(0x18f),'required':!![],'description':a235_0x3d0f3d(0x18b)};export const ROLE_REF_FLAG={'name':'role','type':a235_0x3d0f3d(0x196),'required':!![],'description':a235_0x3d0f3d(0x1cd)};export const USER_REF_FLAG={'name':a235_0x3d0f3d(0x19f),'type':a235_0x3d0f3d(0x196),'required':!![],'description':a235_0x3d0f3d(0x1ce)};export const NAME_FLAG={'name':a235_0x3d0f3d(0x1c7),'type':a235_0x3d0f3d(0x196),'required':!![],'description':a235_0x3d0f3d(0x19a)};export const USER_NAME_FLAG={'name':a235_0x3d0f3d(0x1c7),'type':'string','required':!![],'description':a235_0x3d0f3d(0x1b7)};export const REMARK_FLAG={'name':a235_0x3d0f3d(0x1cc),'type':a235_0x3d0f3d(0x196),'required':![],'description':a235_0x3d0f3d(0x1bf)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x3d0f3d(0x1b3),'type':a235_0x3d0f3d(0x18f),'required':![],'description':a235_0x3d0f3d(0x193)};export const BUILTIN_ROLE_TYPES=[a235_0x3d0f3d(0x1bd),a235_0x3d0f3d(0x1d3),a235_0x3d0f3d(0x19e)];export function isBuiltinRole(_0x24ee38){return BUILTIN_ROLE_TYPES['includes'](_0x24ee38);}export function assertCustomRole(_0x2ab541,_0x5bcb46){const _0x41d79b=a235_0x3d0f3d;if(_0x2ab541[_0x41d79b(0x1c0)]!==_0x41d79b(0x1a6))throw CliErrors[_0x41d79b(0x1ac)](_0x41d79b(0x19b)+_0x5bcb46+'\x20built-in\x20role\x20'+_0x2ab541['roleName']+'\x20('+_0x2ab541[_0x41d79b(0x1c0)]+').',_0x41d79b(0x1be));}export function projectRole(_0x1e4985){const _0xd49cb3=a235_0x3d0f3d;return{'id':_0x1e4985['id'],'roleName':_0x1e4985[_0xd49cb3(0x1ae)],'roleType':_0x1e4985[_0xd49cb3(0x1c0)],'remark':_0x1e4985['remark'],'userCount':_0x1e4985[_0xd49cb3(0x1af)],'permitCount':_0x1e4985[_0xd49cb3(0x1ad)],'builtin':isBuiltinRole(_0x1e4985[_0xd49cb3(0x1c0)])};}function a235_0x383c(_0xff0592,_0x41a0c2){_0xff0592=_0xff0592-0x18a;const _0x55ceaa=a235_0x55ce();let _0x383c15=_0x55ceaa[_0xff0592];return _0x383c15;}export async function resolveRoleRef(_0x52bcdc,_0x509594){const _0x53f0e2=a235_0x3d0f3d,_0x1c0c68=_0x509594[_0x53f0e2(0x1b2)]();if(!_0x1c0c68)throw CliErrors[_0x53f0e2(0x1ac)]('Missing\x20role\x20reference.',_0x53f0e2(0x199));if(/^\d+$/[_0x53f0e2(0x1ba)](_0x1c0c68))return getRoleById(_0x52bcdc,Number(_0x1c0c68));const _0x3612dd=await listAllAppRoles(_0x52bcdc),_0x2b3e40=_0x3612dd[_0x53f0e2(0x1a9)](_0x28dd26=>_0x28dd26[_0x53f0e2(0x1ae)]===_0x1c0c68);if(_0x2b3e40[_0x53f0e2(0x1c5)]===0x0)throw CliErrors[_0x53f0e2(0x1ac)](_0x53f0e2(0x1d2)+_0x1c0c68+'\x22\x20not\x20found\x20in\x20app\x20'+_0x52bcdc+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x2b3e40[_0x53f0e2(0x1c5)]>0x1){const _0x24e342=_0x2b3e40[_0x53f0e2(0x18d)](_0x1bd5f4=>_0x1bd5f4['id'])[_0x53f0e2(0x19d)](',\x20');throw CliErrors['validation'](_0x53f0e2(0x1d2)+_0x1c0c68+_0x53f0e2(0x1a5)+_0x24e342+').',_0x53f0e2(0x1a7));}return _0x2b3e40[0x0];}export async function getRoleById(_0x2dd099,_0x2aeafc){const _0x9bb621=a235_0x3d0f3d,_0x1627fa=await listAllAppRoles(_0x2dd099),_0x109b4f=_0x1627fa['filter'](_0x39e276=>_0x39e276['id']===_0x2aeafc&&(!_0x39e276['appCode']||_0x39e276[_0x9bb621(0x18a)]===_0x2dd099));if(_0x109b4f[_0x9bb621(0x1c5)]!==0x1)throw CliErrors[_0x9bb621(0x1ac)]('Role\x20id\x20'+_0x2aeafc+_0x9bb621(0x18e)+_0x2dd099+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x109b4f[0x0];}async function listAllAppRoles(_0x3f0b42){const _0x2c0ea6=a235_0x3d0f3d,_0x25cb48=0x64,_0xa4b535=[];for(let _0x4fa2a3=0x1;;_0x4fa2a3+=0x1){const {items:_0x1509bd,paging:_0x22d588}=await listAppRoles(_0x3f0b42,{'currentPage':_0x4fa2a3,'pageSize':_0x25cb48});_0xa4b535[_0x2c0ea6(0x1b4)](..._0x1509bd);if(_0x1509bd[_0x2c0ea6(0x1c5)]<_0x25cb48||_0x22d588&&_0xa4b535[_0x2c0ea6(0x1c5)]>=_0x22d588['totalCount'])return _0xa4b535;}}export async function resolveTenantCode(){const _0x48a861=a235_0x3d0f3d,_0x27258f=await getSessionUserInfo(),_0x3755c9=_0x27258f?.[_0x48a861(0x19f)]?.[_0x48a861(0x1b0)]?.[_0x48a861(0x1c3)];if(!_0x3755c9)throw CliErrors['authRequired']('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x3755c9;}function matchMember(_0x5a3326,_0x276758){const _0x5739c1=a235_0x3d0f3d,_0x18d0bf=_0x276758[_0x5739c1(0x1b2)]()['toLowerCase']();return(_0x5a3326[_0x5739c1(0x195)]??'')[_0x5739c1(0x1b8)]()===_0x18d0bf||(_0x5a3326['username']??'')[_0x5739c1(0x1b8)]()===_0x18d0bf;}export async function resolveUserRef(_0x4394d9,_0x1b5bcf=a235_0x3d0f3d(0x1c2)){const _0x44769c=a235_0x3d0f3d,_0x455ae2=_0x4394d9['trim']();if(!_0x455ae2)throw CliErrors[_0x44769c(0x1ac)]('Missing\x20user\x20reference.',_0x44769c(0x190));const _0x2518a3=await resolveTenantCode(),_0x519314=await getTenantMembers(_0x2518a3);if(/^\d+$/[_0x44769c(0x1ba)](_0x455ae2)){const _0x4d227e=Number(_0x455ae2),_0x2c933e=_0x519314['find'](_0x46b728=>_0x46b728[_0x44769c(0x1d1)]===_0x4d227e);return{'userId':_0x4d227e,'username':_0x2c933e?.[_0x44769c(0x1c1)]??String(_0x4d227e),'nickname':_0x2c933e?.[_0x44769c(0x195)],'matchedBy':'id'};}const _0x320e47=_0x519314[_0x44769c(0x1a9)](_0x89c467=>matchMember(_0x89c467,_0x455ae2));if(_0x320e47[_0x44769c(0x1c5)]===0x0)throw CliErrors[_0x44769c(0x1ac)](_0x44769c(0x1bc)+_0x455ae2+'\x22.',_0x44769c(0x1b9)+_0x1b5bcf);if(_0x320e47[_0x44769c(0x1c5)]>0x1){const _0xf1ae6c=_0x320e47[_0x44769c(0x18d)](_0x13b601=>(_0x13b601[_0x44769c(0x195)]??_0x13b601[_0x44769c(0x1c1)]??'?')+'('+_0x13b601[_0x44769c(0x1d1)]+')')['join'](',\x20');throw CliErrors[_0x44769c(0x1ac)](_0x44769c(0x18c)+_0x455ae2+'\x22:\x20'+_0xf1ae6c+'.',_0x1b5bcf);}const _0x48b97a=_0x320e47[0x0];return{'userId':_0x48b97a[_0x44769c(0x1d1)],'username':_0x48b97a[_0x44769c(0x1c1)]??String(_0x48b97a[_0x44769c(0x1d1)]),'nickname':_0x48b97a[_0x44769c(0x195)],'matchedBy':_0x44769c(0x1c7)};}export const CREATE_USER_ROLE_PATH=a235_0x3d0f3d(0x1b6);export const DELETE_USER_ROLE_PATH=a235_0x3d0f3d(0x1a1);export function computeRoleUserMutation(_0x3caf87){const _0x349bb0=a235_0x3d0f3d,{operation:_0x4d09b8,appCode:_0x3d964d,role:_0x40cd41,relations:_0x410d6d,user:_0x12f58d}=_0x3caf87,_0x403c6d=[...new Set(_0x410d6d[_0x349bb0(0x18d)](_0x2d7fb4=>_0x2d7fb4[_0x349bb0(0x1d1)]))],_0x4ae56e=[];if(_0x3caf87[_0x349bb0(0x19c)]!==undefined&&_0x3caf87[_0x349bb0(0x19c)]!==_0x403c6d[_0x349bb0(0x1c5)])throw CliErrors[_0x349bb0(0x1ac)](_0x349bb0(0x1a8)+_0x3caf87[_0x349bb0(0x19c)]+_0x349bb0(0x1b5)+_0x403c6d[_0x349bb0(0x1c5)]+'.',_0x349bb0(0x1bb));const _0x1670fd=_0x403c6d['includes'](_0x12f58d[_0x349bb0(0x1d1)]),_0x35e918=_0x410d6d[_0x349bb0(0x1a9)](_0x1e7494=>_0x1e7494[_0x349bb0(0x1d1)]===_0x12f58d['userId'])[_0x349bb0(0x18d)](_0xcc34b7=>_0xcc34b7['id']),_0x506151=_0x4d09b8==='user-add'?!_0x1670fd:_0x1670fd;let _0x53eea7=_0x403c6d;_0x4d09b8===_0x349bb0(0x1c8)?_0x1670fd?_0x4ae56e[_0x349bb0(0x1b4)](_0x349bb0(0x198)+_0x12f58d[_0x349bb0(0x1d1)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x40cd41[_0x349bb0(0x1ae)]+_0x349bb0(0x1aa)):_0x53eea7=[..._0x403c6d,_0x12f58d[_0x349bb0(0x1d1)]]:!_0x1670fd?_0x4ae56e[_0x349bb0(0x1b4)](_0x349bb0(0x198)+_0x12f58d[_0x349bb0(0x1d1)]+_0x349bb0(0x1ca)+_0x40cd41[_0x349bb0(0x1ae)]+_0x349bb0(0x1aa)):(_0x53eea7=_0x403c6d[_0x349bb0(0x1a9)](_0x328f67=>_0x328f67!==_0x12f58d['userId']),_0x35e918[_0x349bb0(0x1c5)]>0x1&&_0x4ae56e[_0x349bb0(0x1b4)](_0x349bb0(0x1ab)+_0x35e918[_0x349bb0(0x1c5)]+_0x349bb0(0x191)+_0x12f58d['userId']+'.'));const _0x478cbc={'scope':'dev','operation':_0x4d09b8,'selector':{'appCode':_0x3d964d,'roleId':_0x40cd41['id'],'roleName':_0x40cd41['roleName'],'userId':_0x12f58d[_0x349bb0(0x1d1)]},'before':{'userIds':_0x403c6d},'after':{'userIds':_0x53eea7},'dryRun':_0x3caf87[_0x349bb0(0x1cb)],'backend':{'method':_0x349bb0(0x1a3),'path':_0x4d09b8==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x4ae56e};return{'mutation':_0x478cbc,'changed':_0x506151,'matchingRelationIds':_0x35e918};}export async function loadDevRoleRelations(_0x2df7c0,_0x4380b7){const _0x35031c=a235_0x3d0f3d,_0x131464=0x64,_0x51f893=[];for(let _0x263bbe=0x1;;_0x263bbe+=0x1){const {items:_0x4655bd,paging:_0x31c13f}=await listDevUserRoleRelations(_0x2df7c0,{'roleId':_0x4380b7,'currentPage':_0x263bbe,'pageSize':_0x131464});_0x51f893[_0x35031c(0x1b4)](..._0x4655bd);if(_0x4655bd['length']<_0x131464||_0x31c13f&&_0x51f893[_0x35031c(0x1c5)]>=_0x31c13f[_0x35031c(0x1a0)])return _0x51f893;}}export function readRoleRef(_0x7617bb){const _0x1f0689=a235_0x3d0f3d,_0x5e716d=_0x7617bb[_0x1f0689(0x197)]('role')['trim']();if(!_0x5e716d)throw CliErrors['flagMissing'](_0x1f0689(0x1c6),_0x1f0689(0x199));return _0x5e716d;}export async function prepareUserMutation(_0x2bf8d7,_0x152ad6,_0x2ba4ad){const _0x1ef078=a235_0x3d0f3d,_0x97bc=readRoleRef(_0x2bf8d7),_0x3078c3=_0x2bf8d7[_0x1ef078(0x197)](_0x1ef078(0x19f))[_0x1ef078(0x1b2)]();if(!_0x3078c3)throw CliErrors['flagMissing'](_0x1ef078(0x19f),_0x1ef078(0x190));const _0x4568bb=_0x2bf8d7[_0x1ef078(0x1c4)](_0x1ef078(0x1b3)),_0x3aa838=_0x4568bb===undefined||_0x4568bb===null?undefined:Number(_0x4568bb),_0x36d7cd=await resolveRoleRef(_0x2bf8d7[_0x1ef078(0x18a)],_0x97bc);if(_0x36d7cd['roleType']==='OWNER')throw CliErrors['validation'](_0x1ef078(0x19b)+_0x152ad6+'\x20members\x20of\x20the\x20OWNER\x20role.','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.');const _0x223333=await resolveUserRef(_0x3078c3),_0x43e2c6=await loadDevRoleRelations(_0x2bf8d7[_0x1ef078(0x18a)],_0x36d7cd['id']);return{...computeRoleUserMutation({'operation':_0x152ad6,'appCode':_0x2bf8d7[_0x1ef078(0x18a)],'role':_0x36d7cd,'relations':_0x43e2c6,'user':{'userId':_0x223333[_0x1ef078(0x1d1)],'username':_0x223333[_0x1ef078(0x1c1)],'nickname':_0x223333[_0x1ef078(0x195)]},'dryRun':_0x2ba4ad,..._0x3aa838!==undefined?{'expectUserCount':_0x3aa838}:{}}),'role':_0x36d7cd,'user':_0x223333};}function a235_0x55ce(){const _0x3a4a31=['remark','Role\x20id\x20or\x20exact\x20role\x20name','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','2373560jivZaz','5311449YGsZEr','userId','Role\x20name\x20\x22','DEV','22GRcCpt','appCode','Role\x20id\x20(from\x20`role\x20list`)','Multiple\x20tenant\x20members\x20match\x20\x22','map','\x20not\x20found\x20in\x20app\x20','number','Pass\x20--user\x20<id|name>.','\x20duplicate\x20memberships\x20for\x20user\x20','32447bOSojn','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','3332088kWVNdd','nickname','string','str','User\x20','Pass\x20--role\x20<id|name>.','Role\x20name','Cannot\x20','expectUserCount','join','OWNER','user','totalCount','/smartapi/permit/user-role/delete','6LgZije','POST','1307400aysNLR','\x22\x20is\x20ambiguous\x20(ids:\x20','CUSTOM','Disambiguate\x20with\x20--role\x20<id>.','Anti-drift\x20check\x20failed:\x20expected\x20','filter',';\x20no\x20change.','Removed\x20','validation','permitCount','roleName','userCount','tenant','2592252qyjwnL','trim','expect-user-count','push','\x20member(s)\x20but\x20role\x20has\x20','/smartapi/permit/user-role/create','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','toLowerCase','Check\x20the\x20nickname/username.\x20','test','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','No\x20tenant\x20member\x20matches\x20\x22','ADMIN','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Optional\x20role\x20remark/description','roleType','username','Pass\x20--user\x20<id>.','tenant_code','flag','length','role','name','user-add','2457440EusKZh','\x20is\x20not\x20a\x20member\x20of\x20role\x20','dryRun'];a235_0x55ce=function(){return _0x3a4a31;};return a235_0x55ce();}
|
|
1
|
+
const a235_0x40e920=a235_0x2bfd;(function(_0x15edcc,_0x126296){const _0x11b934=a235_0x2bfd,_0x7b6748=_0x15edcc();while(!![]){try{const _0x35bdf4=-parseInt(_0x11b934(0x1c9))/0x1*(-parseInt(_0x11b934(0x1b2))/0x2)+parseInt(_0x11b934(0x1b6))/0x3*(-parseInt(_0x11b934(0x1b4))/0x4)+parseInt(_0x11b934(0x1bd))/0x5+parseInt(_0x11b934(0x1c1))/0x6*(parseInt(_0x11b934(0x1d5))/0x7)+parseInt(_0x11b934(0x1c8))/0x8+parseInt(_0x11b934(0x1fb))/0x9+-parseInt(_0x11b934(0x1ef))/0xa;if(_0x35bdf4===_0x126296)break;else _0x7b6748['push'](_0x7b6748['shift']());}catch(_0x4e4eec){_0x7b6748['push'](_0x7b6748['shift']());}}}(a235_0x71bf,0xf40d3));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';function a235_0x2bfd(_0x39396a,_0x10bd88){_0x39396a=_0x39396a-0x1b0;const _0x71bf3c=a235_0x71bf();let _0x2bfdc6=_0x71bf3c[_0x39396a];return _0x2bfdc6;}export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':a235_0x40e920(0x1cc)};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};export const USER_REF_FLAG={'name':a235_0x40e920(0x1e4),'type':a235_0x40e920(0x1ce),'required':!![],'description':a235_0x40e920(0x1df)};export const NAME_FLAG={'name':a235_0x40e920(0x1d2),'type':a235_0x40e920(0x1ce),'required':!![],'description':a235_0x40e920(0x1fc)};export const USER_NAME_FLAG={'name':a235_0x40e920(0x1d2),'type':a235_0x40e920(0x1ce),'required':!![],'description':a235_0x40e920(0x1c7)};export const REMARK_FLAG={'name':'remark','type':a235_0x40e920(0x1ce),'required':![],'description':a235_0x40e920(0x1f6)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x40e920(0x1f7),'type':a235_0x40e920(0x1b1),'required':![],'description':a235_0x40e920(0x1c3)};export const BUILTIN_ROLE_TYPES=[a235_0x40e920(0x1f0),a235_0x40e920(0x1eb),'OWNER'];export function isBuiltinRole(_0x4a10fb){return BUILTIN_ROLE_TYPES['includes'](_0x4a10fb);}export function assertCustomRole(_0x2b5daa,_0x1e6f22){const _0x1452aa=a235_0x40e920;if(_0x2b5daa[_0x1452aa(0x1e6)]!==_0x1452aa(0x1b9))throw CliErrors['validation']('Cannot\x20'+_0x1e6f22+_0x1452aa(0x1f9)+_0x2b5daa['roleName']+'\x20('+_0x2b5daa['roleType']+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0x4bade3){const _0x27e670=a235_0x40e920;return{'id':_0x4bade3['id'],'roleName':_0x4bade3[_0x27e670(0x1c6)],'roleType':_0x4bade3['roleType'],'remark':_0x4bade3[_0x27e670(0x1c4)],'userCount':_0x4bade3[_0x27e670(0x1be)],'permitCount':_0x4bade3['permitCount'],'builtin':isBuiltinRole(_0x4bade3[_0x27e670(0x1e6)])};}export async function resolveRoleRef(_0x4a3fbd,_0x2db4fa){const _0x3a3431=a235_0x40e920,_0x1538f5=_0x2db4fa[_0x3a3431(0x1ea)]();if(!_0x1538f5)throw CliErrors[_0x3a3431(0x1c5)](_0x3a3431(0x1fe),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x3a3431(0x1bf)](_0x1538f5))return getRoleById(_0x4a3fbd,Number(_0x1538f5));const _0x34bcf0=await listAllAppRoles(_0x4a3fbd),_0x4862a6=_0x34bcf0['filter'](_0x45feca=>_0x45feca[_0x3a3431(0x1c6)]===_0x1538f5);if(_0x4862a6[_0x3a3431(0x1cf)]===0x0)throw CliErrors['validation'](_0x3a3431(0x1d6)+_0x1538f5+_0x3a3431(0x1d8)+_0x4a3fbd+'.',_0x3a3431(0x1b0));if(_0x4862a6['length']>0x1){const _0x569716=_0x4862a6[_0x3a3431(0x1ee)](_0x4fb189=>_0x4fb189['id'])['join'](',\x20');throw CliErrors[_0x3a3431(0x1c5)](_0x3a3431(0x1d6)+_0x1538f5+_0x3a3431(0x1d4)+_0x569716+').',_0x3a3431(0x1c0));}return _0x4862a6[0x0];}export async function getRoleById(_0x43f92f,_0x82c723){const _0x22e23b=a235_0x40e920,_0x5c6fae=await listAllAppRoles(_0x43f92f),_0x43e398=_0x5c6fae[_0x22e23b(0x1e7)](_0x2735c1=>_0x2735c1['id']===_0x82c723&&(!_0x2735c1[_0x22e23b(0x1d0)]||_0x2735c1[_0x22e23b(0x1d0)]===_0x43f92f));if(_0x43e398[_0x22e23b(0x1cf)]!==0x1)throw CliErrors[_0x22e23b(0x1c5)](_0x22e23b(0x1b3)+_0x82c723+_0x22e23b(0x1e2)+_0x43f92f+'.',_0x22e23b(0x1db));return _0x43e398[0x0];}async function listAllAppRoles(_0x49dcdc){const _0xaefc07=a235_0x40e920,_0x1916b7=0x64,_0x5de646=[];for(let _0x4b73fb=0x1;;_0x4b73fb+=0x1){const {items:_0x5bdd52,paging:_0x38d45d}=await listAppRoles(_0x49dcdc,{'currentPage':_0x4b73fb,'pageSize':_0x1916b7});_0x5de646[_0xaefc07(0x1de)](..._0x5bdd52);if(_0x5bdd52['length']<_0x1916b7||_0x38d45d&&_0x5de646['length']>=_0x38d45d[_0xaefc07(0x1f4)])return _0x5de646;}}export async function resolveTenantCode(){const _0x4c57d0=a235_0x40e920,_0xc9590=await getSessionUserInfo(),_0x42ca8b=_0xc9590?.['user']?.['tenant']?.[_0x4c57d0(0x1f3)];if(!_0x42ca8b)throw CliErrors['authRequired'](_0x4c57d0(0x1e5));return _0x42ca8b;}function matchMember(_0x28e6ac,_0x97ffc7){const _0x1a6591=a235_0x40e920,_0x5875c6=_0x97ffc7[_0x1a6591(0x1ea)]()[_0x1a6591(0x1b7)]();return(_0x28e6ac[_0x1a6591(0x1d1)]??'')[_0x1a6591(0x1b7)]()===_0x5875c6||(_0x28e6ac[_0x1a6591(0x1ca)]??'')[_0x1a6591(0x1b7)]()===_0x5875c6;}export async function resolveUserRef(_0x53048f,_0x547d4e='Pass\x20--user\x20<id>.'){const _0xa26f7=a235_0x40e920,_0x4d88a0=_0x53048f[_0xa26f7(0x1ea)]();if(!_0x4d88a0)throw CliErrors['validation'](_0xa26f7(0x1f1),_0xa26f7(0x1cd));const _0x327547=await resolveTenantCode(),_0x5255be=await getTenantMembers(_0x327547);if(/^\d+$/[_0xa26f7(0x1bf)](_0x4d88a0)){const _0x377df2=Number(_0x4d88a0),_0x3ef366=_0x5255be['find'](_0x2e9729=>_0x2e9729[_0xa26f7(0x1da)]===_0x377df2);return{'userId':_0x377df2,'username':_0x3ef366?.[_0xa26f7(0x1ca)]??String(_0x377df2),'nickname':_0x3ef366?.[_0xa26f7(0x1d1)],'matchedBy':'id'};}const _0x32ebdf=_0x5255be[_0xa26f7(0x1e7)](_0x3f2fbc=>matchMember(_0x3f2fbc,_0x4d88a0));if(_0x32ebdf[_0xa26f7(0x1cf)]===0x0)throw CliErrors['validation'](_0xa26f7(0x1ed)+_0x4d88a0+'\x22.',_0xa26f7(0x1ff)+_0x547d4e);if(_0x32ebdf[_0xa26f7(0x1cf)]>0x1){const _0x10275d=_0x32ebdf[_0xa26f7(0x1ee)](_0x5f265c=>(_0x5f265c[_0xa26f7(0x1d1)]??_0x5f265c['username']??'?')+'('+_0x5f265c[_0xa26f7(0x1da)]+')')['join'](',\x20');throw CliErrors[_0xa26f7(0x1c5)](_0xa26f7(0x200)+_0x4d88a0+_0xa26f7(0x1e1)+_0x10275d+'.',_0x547d4e);}const _0xc8900a=_0x32ebdf[0x0];return{'userId':_0xc8900a['userId'],'username':_0xc8900a['username']??String(_0xc8900a[_0xa26f7(0x1da)]),'nickname':_0xc8900a[_0xa26f7(0x1d1)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a235_0x40e920(0x1e0);export const DELETE_USER_ROLE_PATH=a235_0x40e920(0x1cb);export function computeRoleUserMutation(_0x3fa3c7){const _0x267530=a235_0x40e920,{operation:_0xcd3515,appCode:_0x3314f0,role:_0x37350e,relations:_0x13e58b,user:_0x477731}=_0x3fa3c7,_0x2947cb=[...new Set(_0x13e58b[_0x267530(0x1ee)](_0x5d8896=>_0x5d8896[_0x267530(0x1da)]))],_0x9ca31b=[];if(_0x3fa3c7[_0x267530(0x1d9)]!==undefined&&_0x3fa3c7['expectUserCount']!==_0x2947cb['length'])throw CliErrors['validation'](_0x267530(0x1e3)+_0x3fa3c7['expectUserCount']+_0x267530(0x1b8)+_0x2947cb[_0x267530(0x1cf)]+'.',_0x267530(0x1d3));const _0x409bf6=_0x2947cb[_0x267530(0x1fa)](_0x477731[_0x267530(0x1da)]),_0x22dad7=_0x13e58b[_0x267530(0x1e7)](_0x3473c9=>_0x3473c9[_0x267530(0x1da)]===_0x477731[_0x267530(0x1da)])[_0x267530(0x1ee)](_0x3d886a=>_0x3d886a['id']),_0x5784e0=_0xcd3515===_0x267530(0x1d7)?!_0x409bf6:_0x409bf6;let _0xb0db93=_0x2947cb;_0xcd3515===_0x267530(0x1d7)?_0x409bf6?_0x9ca31b['push'](_0x267530(0x1f5)+_0x477731['userId']+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x37350e[_0x267530(0x1c6)]+_0x267530(0x1dc)):_0xb0db93=[..._0x2947cb,_0x477731[_0x267530(0x1da)]]:!_0x409bf6?_0x9ca31b['push'](_0x267530(0x1f5)+_0x477731[_0x267530(0x1da)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x37350e[_0x267530(0x1c6)]+_0x267530(0x1dc)):(_0xb0db93=_0x2947cb['filter'](_0x484921=>_0x484921!==_0x477731[_0x267530(0x1da)]),_0x22dad7['length']>0x1&&_0x9ca31b['push'](_0x267530(0x1bb)+_0x22dad7[_0x267530(0x1cf)]+_0x267530(0x1e9)+_0x477731[_0x267530(0x1da)]+'.'));const _0x41c2f2={'scope':_0x267530(0x1e8),'operation':_0xcd3515,'selector':{'appCode':_0x3314f0,'roleId':_0x37350e['id'],'roleName':_0x37350e[_0x267530(0x1c6)],'userId':_0x477731[_0x267530(0x1da)]},'before':{'userIds':_0x2947cb},'after':{'userIds':_0xb0db93},'dryRun':_0x3fa3c7[_0x267530(0x1c2)],'backend':{'method':'POST','path':_0xcd3515===_0x267530(0x1d7)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x9ca31b};return{'mutation':_0x41c2f2,'changed':_0x5784e0,'matchingRelationIds':_0x22dad7};}export async function loadDevRoleRelations(_0x45eb3b,_0x4cac4d){const _0x2b8da4=a235_0x40e920,_0x1fb858=0x64,_0x297fbc=[];for(let _0x1b75db=0x1;;_0x1b75db+=0x1){const {items:_0x4f1c46,paging:_0x228382}=await listDevUserRoleRelations(_0x45eb3b,{'roleId':_0x4cac4d,'currentPage':_0x1b75db,'pageSize':_0x1fb858});_0x297fbc['push'](..._0x4f1c46);if(_0x4f1c46[_0x2b8da4(0x1cf)]<_0x1fb858||_0x228382&&_0x297fbc[_0x2b8da4(0x1cf)]>=_0x228382[_0x2b8da4(0x1f4)])return _0x297fbc;}}export function readRoleRef(_0x14adb2){const _0x1bcea9=a235_0x40e920,_0x387dc0=_0x14adb2[_0x1bcea9(0x1dd)](_0x1bcea9(0x1f8))[_0x1bcea9(0x1ea)]();if(!_0x387dc0)throw CliErrors[_0x1bcea9(0x1fd)](_0x1bcea9(0x1f8),_0x1bcea9(0x1b5));return _0x387dc0;}function a235_0x71bf(){const _0x4d39d9=['Pass\x20--user\x20<id|name>.','string','length','appCode','nickname','name','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x22\x20is\x20ambiguous\x20(ids:\x20','385kjzZKe','Role\x20name\x20\x22','user-add','\x22\x20not\x20found\x20in\x20app\x20','expectUserCount','userId','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.',';\x20no\x20change.','str','push','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','/smartapi/permit/user-role/create','\x22:\x20','\x20not\x20found\x20in\x20app\x20','Anti-drift\x20check\x20failed:\x20expected\x20','user','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','roleType','filter','dev','\x20duplicate\x20memberships\x20for\x20user\x20','trim','DEV','flag','No\x20tenant\x20member\x20matches\x20\x22','map','13976340myTRFs','ADMIN','Missing\x20user\x20reference.','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','tenant_code','totalCount','User\x20','Optional\x20role\x20remark/description','expect-user-count','role','\x20built-in\x20role\x20','includes','1339704NIbgjz','Role\x20name','flagMissing','Missing\x20role\x20reference.','Check\x20the\x20nickname/username.\x20','Multiple\x20tenant\x20members\x20match\x20\x22','OWNER','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','number','507418MiaPVe','Role\x20id\x20','344Hozrrz','Pass\x20--role\x20<id|name>.','36222drrdAo','toLowerCase','\x20member(s)\x20but\x20role\x20has\x20','CUSTOM','\x20members\x20of\x20the\x20OWNER\x20role.','Removed\x20','Cannot\x20','8372320dTRZYY','userCount','test','Disambiguate\x20with\x20--role\x20<id>.','33666rKiHmV','dryRun','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','remark','validation','roleName','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','281304ZfDmDx','5kfamDT','username','/smartapi/permit/user-role/delete','Role\x20id\x20(from\x20`role\x20list`)'];a235_0x71bf=function(){return _0x4d39d9;};return a235_0x71bf();}export async function prepareUserMutation(_0xa72084,_0xd58d67,_0x266747){const _0x38e508=a235_0x40e920,_0x2218b9=readRoleRef(_0xa72084),_0x1d8263=_0xa72084[_0x38e508(0x1dd)](_0x38e508(0x1e4))[_0x38e508(0x1ea)]();if(!_0x1d8263)throw CliErrors['flagMissing'](_0x38e508(0x1e4),_0x38e508(0x1cd));const _0x55335d=_0xa72084[_0x38e508(0x1ec)](_0x38e508(0x1f7)),_0x13c6a6=_0x55335d===undefined||_0x55335d===null?undefined:Number(_0x55335d),_0x25a1ca=await resolveRoleRef(_0xa72084[_0x38e508(0x1d0)],_0x2218b9);if(_0x25a1ca[_0x38e508(0x1e6)]===_0x38e508(0x201))throw CliErrors[_0x38e508(0x1c5)](_0x38e508(0x1bc)+_0xd58d67+_0x38e508(0x1ba),_0x38e508(0x1f2));const _0x4810ca=await resolveUserRef(_0x1d8263),_0x39d3c7=await loadDevRoleRelations(_0xa72084[_0x38e508(0x1d0)],_0x25a1ca['id']);return{...computeRoleUserMutation({'operation':_0xd58d67,'appCode':_0xa72084[_0x38e508(0x1d0)],'role':_0x25a1ca,'relations':_0x39d3c7,'user':{'userId':_0x4810ca[_0x38e508(0x1da)],'username':_0x4810ca[_0x38e508(0x1ca)],'nickname':_0x4810ca[_0x38e508(0x1d1)]},'dryRun':_0x266747,..._0x13c6a6!==undefined?{'expectUserCount':_0x13c6a6}:{}}),'role':_0x25a1ca,'user':_0x4810ca};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a236_0x3aa99c=a236_0x3e05;(function(_0x566bdb,_0xca677f){const _0x2049ef=a236_0x3e05,_0x58e845=_0x566bdb();while(!![]){try{const _0xe3cef1=-parseInt(_0x2049ef(0xc4))/0x1*(-parseInt(_0x2049ef(0xca))/0x2)+parseInt(_0x2049ef(0xc8))/0x3+-parseInt(_0x2049ef(0xce))/0x4+parseInt(_0x2049ef(0xd0))/0x5+parseInt(_0x2049ef(0xb5))/0x6+-parseInt(_0x2049ef(0xc6))/0x7*(parseInt(_0x2049ef(0xb6))/0x8)+-parseInt(_0x2049ef(0xbd))/0x9*(-parseInt(_0x2049ef(0xbe))/0xa);if(_0xe3cef1===_0xca677f)break;else _0x58e845['push'](_0x58e845['shift']());}catch(_0x885529){_0x58e845['push'](_0x58e845['shift']());}}}(a236_0x3b3b,0x6b200));function a236_0x3e05(_0x225fc3,_0x4d9621){_0x225fc3=_0x225fc3-0xb1;const _0x3b3b72=a236_0x3b3b();let _0x3e0528=_0x3b3b72[_0x225fc3];return _0x3e0528;}import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a236_0x3aa99c(0xbf);function readPatch(_0x1e5f92){const _0x14a4f8=a236_0x3aa99c,_0x16f24e=_0x1e5f92['flag'](_0x14a4f8(0xc9)),_0x494ac=_0x1e5f92[_0x14a4f8(0xc1)]('remark'),_0x3267ff={};if(_0x16f24e!==undefined&&_0x16f24e!==null){const _0x5c4226=String(_0x16f24e)['trim']();if(!_0x5c4226)throw CliErrors[_0x14a4f8(0xb7)](_0x14a4f8(0xc7));if(_0x5c4226[_0x14a4f8(0xc0)]>0x40)throw CliErrors[_0x14a4f8(0xb7)](_0x14a4f8(0xb1));_0x3267ff[_0x14a4f8(0xb9)]=_0x5c4226;}_0x494ac!==undefined&&_0x494ac!==null&&(_0x3267ff['remark']=String(_0x494ac));if(_0x3267ff[_0x14a4f8(0xb9)]===undefined&&_0x3267ff[_0x14a4f8(0xba)]===undefined)throw CliErrors[_0x14a4f8(0xb7)](_0x14a4f8(0xcc),_0x14a4f8(0xbb));return _0x3267ff;}function a236_0x3b3b(){const _0x112582=['28160QmOuOt','/smartapi/permit/role/update','length','flag','POST','update','6iDuQrE','string','4570741VZVYNl','--name\x20cannot\x20be\x20empty.','379611yGXvVo','name','179596iOYdMo','num','Nothing\x20to\x20update.','role','2371116aqukiD','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','1085690PoASOM','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','dev','write','\x20(id=','3004506XKxjMN','8HXxFnB','validation','appCode','roleName','remark','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','Updated\x20role\x20','963FNwHer'];a236_0x3b3b=function(){return _0x112582;};return a236_0x3b3b();}export const roleUpdate={'service':a236_0x3aa99c(0xcd),'command':'update','description':a236_0x3aa99c(0xcf),'risk':a236_0x3aa99c(0xb3),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0x3aa99c(0xc9),'type':a236_0x3aa99c(0xc5),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2660d7){readPatch(_0x2660d7);},async 'dryRun'(_0x32ad82){const _0x45fc05=a236_0x3aa99c,_0x14b9b6=_0x32ad82[_0x45fc05(0xcb)]('id'),_0x4c396d=readPatch(_0x32ad82),_0x2ba1f6=await getRoleById(_0x32ad82[_0x45fc05(0xb8)],_0x14b9b6);return assertCustomRole(_0x2ba1f6,_0x45fc05(0xc3)),asDryRunResult({'scope':_0x45fc05(0xb2),'operation':_0x45fc05(0xc3),'selector':{'appCode':_0x32ad82[_0x45fc05(0xb8)],'roleId':_0x14b9b6,'roleName':_0x2ba1f6[_0x45fc05(0xb9)]},'before':projectRole(_0x2ba1f6),'after':projectRole({..._0x2ba1f6,..._0x4c396d[_0x45fc05(0xb9)]!==undefined?{'roleName':_0x4c396d[_0x45fc05(0xb9)]}:{},..._0x4c396d[_0x45fc05(0xba)]!==undefined?{'remark':_0x4c396d[_0x45fc05(0xba)]}:{}}),'dryRun':!![],'backend':{'method':_0x45fc05(0xc2),'path':UPDATE_PATH},'warnings':[]},{'method':_0x45fc05(0xc2),'url':UPDATE_PATH});},async 'execute'(_0xf11a43){const _0x508af3=a236_0x3aa99c,_0x139abd=_0xf11a43[_0x508af3(0xcb)]('id'),_0x4c1541=readPatch(_0xf11a43),_0x4ed0d8=await getRoleById(_0xf11a43[_0x508af3(0xb8)],_0x139abd);assertCustomRole(_0x4ed0d8,_0x508af3(0xc3)),await updateAppRole({'id':_0x139abd,'appCode':_0xf11a43['appCode'],..._0x4c1541['roleName']!==undefined?{'roleName':_0x4c1541['roleName']}:{},..._0x4c1541['remark']!==undefined?{'remark':_0x4c1541[_0x508af3(0xba)]}:{}});const _0x20c831=await getRoleById(_0xf11a43['appCode'],_0x139abd);return{'ok':!![],'data':{'scope':'dev','operation':_0x508af3(0xc3),'selector':{'appCode':_0xf11a43[_0x508af3(0xb8)],'roleId':_0x139abd,'roleName':_0x20c831[_0x508af3(0xb9)]},'before':projectRole(_0x4ed0d8),'after':projectRole(_0x20c831),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x508af3(0xbc)+_0x20c831[_0x508af3(0xb9)]+_0x508af3(0xb4)+_0x139abd+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a237_0x4f8677=a237_0x56e0;(function(_0x1b1ba6,_0x4ebfb2){const _0x59d568=a237_0x56e0,_0x25b192=_0x1b1ba6();while(!![]){try{const _0x3121c3=-parseInt(_0x59d568(0x7d))/0x1+parseInt(_0x59d568(0x86))/0x2+parseInt(_0x59d568(0x80))/0x3*(parseInt(_0x59d568(0x88))/0x4)+-parseInt(_0x59d568(0x85))/0x5+parseInt(_0x59d568(0x77))/0x6+parseInt(_0x59d568(0x89))/0x7+parseInt(_0x59d568(0x74))/0x8*(-parseInt(_0x59d568(0x84))/0x9);if(_0x3121c3===_0x4ebfb2)break;else _0x25b192['push'](_0x25b192['shift']());}catch(_0x432324){_0x25b192['push'](_0x25b192['shift']());}}}(a237_0x5ab1,0xc527f));function a237_0x5ab1(){const _0x291dc3=['1606626qDJmzS','6383155utQJWg','338488ahZGYs','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','876vjVyTr','8790089eficgE','16zqeiiz','roleId','Added\x20user\x20','3648666ubQScD','selector','appCode','\x20already\x20in\x20role\x20','user-add','role','527221twwveM','userId','roleType','12813DaZzfZ','\x20to\x20role\x20','roleName','No\x20change:\x20user\x20'];a237_0x5ab1=function(){return _0x291dc3;};return a237_0x5ab1();}import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a237_0x56e0(_0x2da159,_0x32ced9){_0x2da159=_0x2da159-0x74;const _0x5ab13f=a237_0x5ab1();let _0x56e0dd=_0x5ab13f[_0x2da159];return _0x56e0dd;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a237_0x4f8677(0x7c),'command':a237_0x4f8677(0x7b),'description':a237_0x4f8677(0x87),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4f50e4){const {mutation:_0x25dabf}=await prepareUserMutation(_0x4f50e4,'user-add',!![]);return asDryRunResult(_0x25dabf,{'method':'POST','url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x65c12c){const _0x25a44a=a237_0x4f8677,{mutation:_0x4a54bd,changed:_0xe3d688,role:_0x3985c8,user:_0x5a9654}=await prepareUserMutation(_0x65c12c,_0x25a44a(0x7b),![]);return _0xe3d688&&await createDevUserRole({'appCode':_0x65c12c[_0x25a44a(0x79)],'userId':_0x5a9654['userId'],'username':_0x5a9654['username'],'roleType':_0x3985c8[_0x25a44a(0x7f)],'roleId':_0x4a54bd[_0x25a44a(0x78)][_0x25a44a(0x75)]}),{'ok':!![],'data':_0x4a54bd,'message':_0xe3d688?_0x25a44a(0x76)+_0x4a54bd[_0x25a44a(0x78)][_0x25a44a(0x7e)]+_0x25a44a(0x81)+_0x4a54bd['selector'][_0x25a44a(0x82)]:_0x25a44a(0x83)+_0x4a54bd[_0x25a44a(0x78)][_0x25a44a(0x7e)]+_0x25a44a(0x7a)+_0x4a54bd[_0x25a44a(0x78)][_0x25a44a(0x82)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a238_0x1e23ec=a238_0x4678;(function(_0x1a7eba,_0x48d223){const _0x2a7e56=a238_0x4678,_0x238770=_0x1a7eba();while(!![]){try{const _0x188d74=-parseInt(_0x2a7e56(0xb1))/0x1*(-parseInt(_0x2a7e56(0xbc))/0x2)+-parseInt(_0x2a7e56(0xc0))/0x3*(parseInt(_0x2a7e56(0xb6))/0x4)+-parseInt(_0x2a7e56(0xb3))/0x5+-parseInt(_0x2a7e56(0xbb))/0x6*(parseInt(_0x2a7e56(0xaf))/0x7)+parseInt(_0x2a7e56(0xb4))/0x8+parseInt(_0x2a7e56(0xbf))/0x9+-parseInt(_0x2a7e56(0xbe))/0xa*(-parseInt(_0x2a7e56(0xab))/0xb);if(_0x188d74===_0x48d223)break;else _0x238770['push'](_0x238770['shift']());}catch(_0x2cf4e7){_0x238770['push'](_0x238770['shift']());}}}(a238_0x54e0,0xa3234));import{deleteDevUserRole}from'../../core/api-client.js';function a238_0x4678(_0x5f4fe7,_0x362e7f){_0x5f4fe7=_0x5f4fe7-0xab;const _0x54e046=a238_0x54e0();let _0x467807=_0x54e046[_0x5f4fe7];return _0x467807;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a238_0x54e0(){const _0x24921c=['1594jpllLA','\x20from\x20role\x20','310LOnftf','11409372OwpEZy','2360415VKqRaO','50259ivaktS','userId','POST','high-risk-write','77fNKSOM','user-remove','514ZXpjyF','selector','6653590JwVUno','8481400Llawax','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','4UgRGUW','No\x20change:\x20user\x20','roleName','role','\x20not\x20in\x20role\x20','50970KbZcNk'];a238_0x54e0=function(){return _0x24921c;};return a238_0x54e0();}export const roleUserRemove={'service':a238_0x1e23ec(0xb9),'command':a238_0x1e23ec(0xb0),'description':a238_0x1e23ec(0xb5),'risk':a238_0x1e23ec(0xae),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2cf594){const _0x3d15c4=a238_0x1e23ec,{mutation:_0xc904d4}=await prepareUserMutation(_0x2cf594,_0x3d15c4(0xb0),!![]);return asDryRunResult(_0xc904d4,{'method':_0x3d15c4(0xad),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x49be4e){const _0x58ee30=a238_0x1e23ec,{matchingRelationIds:_0x2e21f8,mutation:_0x358a82,changed:_0x23abfe}=await prepareUserMutation(_0x49be4e,_0x58ee30(0xb0),![]);if(_0x23abfe)for(const _0x14a558 of _0x2e21f8){await deleteDevUserRole(_0x14a558);}return{'ok':!![],'data':_0x358a82,'message':_0x23abfe?'Removed\x20user\x20'+_0x358a82['selector'][_0x58ee30(0xac)]+_0x58ee30(0xbd)+_0x358a82[_0x58ee30(0xb2)][_0x58ee30(0xb8)]:_0x58ee30(0xb7)+_0x358a82['selector'][_0x58ee30(0xac)]+_0x58ee30(0xba)+_0x358a82['selector']['roleName']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a239_0x354c(_0x29e82e,_0x50a2ad){_0x29e82e=_0x29e82e-0x102;const _0x92222=a239_0x9222();let _0x354cc1=_0x92222[_0x29e82e];return _0x354cc1;}const a239_0x20ebf6=a239_0x354c;(function(_0x26d720,_0x4f3d5e){const _0x106744=a239_0x354c,_0xe47545=_0x26d720();while(!![]){try{const _0x32599b=-parseInt(_0x106744(0x10d))/0x1+-parseInt(_0x106744(0x102))/0x2*(parseInt(_0x106744(0x111))/0x3)+-parseInt(_0x106744(0x105))/0x4*(parseInt(_0x106744(0x108))/0x5)+-parseInt(_0x106744(0x112))/0x6*(-parseInt(_0x106744(0x106))/0x7)+-parseInt(_0x106744(0x113))/0x8*(-parseInt(_0x106744(0x107))/0x9)+parseInt(_0x106744(0x114))/0xa+-parseInt(_0x106744(0x117))/0xb*(-parseInt(_0x106744(0x10b))/0xc);if(_0x32599b===_0x4f3d5e)break;else _0xe47545['push'](_0xe47545['shift']());}catch(_0x41c8b3){_0xe47545['push'](_0xe47545['shift']());}}}(a239_0x9222,0x81a60));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a239_0x9222(){const _0x5d70e8=['181228iqalvq','182WtAcdP','499869eklCMf','95hauSyp','Pass\x20--name\x20<nickname|username>.','role','920844JkNUrA','str','460466VjZlMD','matchedBy','username','read','1198443mgKzmR','167142iNBbej','104rewlpN','3450830unGdos','flagMissing','userId','66awYyNu','nickname','name','2UzyssZ','trim','user-resolve'];a239_0x9222=function(){return _0x5d70e8;};return a239_0x9222();}export const roleUserResolve={'service':a239_0x20ebf6(0x10a),'command':a239_0x20ebf6(0x104),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a239_0x20ebf6(0x110),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xc01f99){const _0x3f93f5=a239_0x20ebf6;if(!_0xc01f99['str'](_0x3f93f5(0x119))[_0x3f93f5(0x103)]())throw CliErrors[_0x3f93f5(0x115)]('name',_0x3f93f5(0x109));},async 'execute'(_0x3c3cc7){const _0x58bed0=a239_0x20ebf6,_0x16b338=_0x3c3cc7[_0x58bed0(0x10c)]('name')[_0x58bed0(0x103)](),_0x2fc15e=await resolveUserRef(_0x16b338,'Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.');return{'ok':!![],'data':{'user':{'userId':_0x2fc15e[_0x58bed0(0x116)],'username':_0x2fc15e[_0x58bed0(0x10f)],'nickname':_0x2fc15e[_0x58bed0(0x118)],'matchedBy':_0x2fc15e[_0x58bed0(0x10e)]}},'message':'Resolved\x20\x22'+_0x16b338+'\x22\x20→\x20userId\x20'+_0x2fc15e[_0x58bed0(0x116)]};}};
|
package/lib/commands/rule/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a240_0x521877=a240_0x459e;(function(_0x59e7ea,_0x5e9b85){const _0x529e0d=a240_0x459e,_0x1c63a3=_0x59e7ea();while(!![]){try{const _0x1c0cac=parseInt(_0x529e0d(0x12a))/0x1*(parseInt(_0x529e0d(0x137))/0x2)+parseInt(_0x529e0d(0x134))/0x3+-parseInt(_0x529e0d(0x12c))/0x4*(parseInt(_0x529e0d(0x12e))/0x5)+-parseInt(_0x529e0d(0x139))/0x6+parseInt(_0x529e0d(0x12b))/0x7*(parseInt(_0x529e0d(0x130))/0x8)+parseInt(_0x529e0d(0x12f))/0x9+-parseInt(_0x529e0d(0x131))/0xa;if(_0x1c0cac===_0x5e9b85)break;else _0x1c63a3['push'](_0x1c63a3['shift']());}catch(_0x493f72){_0x1c63a3['push'](_0x1c63a3['shift']());}}}(a240_0x30cd,0x80391));import{getAppRule}from'../../core/api-client.js';function a240_0x459e(_0x418d86,_0xd28315){_0x418d86=_0x418d86-0x129;const _0x30cdba=a240_0x30cd();let _0x459e94=_0x30cdba[_0x418d86];return _0x459e94;}import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a240_0x521877(0x138),'command':a240_0x521877(0x132),'description':'Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','risk':'read','requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x5659ef){readAppRuleType(_0x5659ef);},async 'execute'(_0x3cf43a){const _0x56658b=a240_0x521877,_0x5efd80=readAppRuleType(_0x3cf43a),_0xbfd9d5=await getAppRule(_0x3cf43a[_0x56658b(0x135)],{'appCode':_0x3cf43a['appCode'],'type':_0x5efd80});if(!_0xbfd9d5)throw appRuleError('app_rule_not_found',appRuleFileName(_0x5efd80)+'\x20is\x20not\x20configured\x20for\x20app\x20'+_0x3cf43a['appCode']+'.','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20'+_0x5efd80+'\x20--file\x20<path>\x20--dry-run`.');return{'ok':!![],'data':{'rule':{...projectAppRule(_0x5efd80,_0xbfd9d5),'content':_0xbfd9d5[_0x56658b(0x133)]}},'message':_0x56658b(0x129)+appRuleFileName(_0x5efd80)+_0x56658b(0x12d)+_0x3cf43a[_0x56658b(0x136)]};}};function a240_0x30cd(){const _0x27d86a=['2889735fCWQyf','cookie','appCode','30Njskok','rule','1510776ijHPOq','Loaded\x20','59211clCqvB','2850414xCpLBU','4376eupvXg','\x20for\x20','3730HnHybn','5997537GKDBNW','16iJiQtF','17390860gqFGpW','get','content'];a240_0x30cd=function(){return _0x27d86a;};return a240_0x30cd();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a241_0x1389d3=a241_0x1e19;(function(_0x456b71,_0x3b1db5){const _0x119ac5=a241_0x1e19,_0x4ed06d=_0x456b71();while(!![]){try{const _0x560742=parseInt(_0x119ac5(0x1f4))/0x1*(parseInt(_0x119ac5(0x1fe))/0x2)+-parseInt(_0x119ac5(0x1f3))/0x3+-parseInt(_0x119ac5(0x1fa))/0x4+-parseInt(_0x119ac5(0x1fc))/0x5*(parseInt(_0x119ac5(0x1f0))/0x6)+-parseInt(_0x119ac5(0x1f9))/0x7*(parseInt(_0x119ac5(0x1f5))/0x8)+parseInt(_0x119ac5(0x1f8))/0x9*(-parseInt(_0x119ac5(0x1fd))/0xa)+-parseInt(_0x119ac5(0x1f2))/0xb*(-parseInt(_0x119ac5(0x1ef))/0xc);if(_0x560742===_0x3b1db5)break;else _0x4ed06d['push'](_0x4ed06d['shift']());}catch(_0x27d5c3){_0x4ed06d['push'](_0x4ed06d['shift']());}}}(a241_0x37c8,0x5522c));import{withKbManagementSession}from'../../core/kb-management-client.js';import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet][a241_0x1389d3(0x1f6)](_0x47fb92=>({..._0x47fb92,'execute':_0x2f01a8=>withKbManagementSession(_0x2f01a8[a241_0x1389d3(0x1f7)],()=>_0x47fb92[a241_0x1389d3(0x1fb)](_0x2f01a8)),..._0x47fb92[a241_0x1389d3(0x1f1)]?{'dryRun':_0x581add=>withKbManagementSession(_0x581add[a241_0x1389d3(0x1f7)],()=>_0x47fb92[a241_0x1389d3(0x1f1)](_0x581add))}:{}}));function a241_0x1e19(_0x50eb3a,_0x40cfa7){_0x50eb3a=_0x50eb3a-0x1ef;const _0x37c8f1=a241_0x37c8();let _0x1e19d2=_0x37c8f1[_0x50eb3a];return _0x1e19d2;}function a241_0x37c8(){const _0x535697=['39830puVvco','17770zGcQaX','45194BfRPFZ','264756fELwzh','222CFprjF','dryRun','814uFdjir','1238007mgJKPF','15BbwTQP','565392lRgvng','map','signal','1152QvNDby','7fmbqfq','2469440scXjFb','execute'];a241_0x37c8=function(){return _0x535697;};return a241_0x37c8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a242_0x7a28(_0x139efa,_0x2c5e66){_0x139efa=_0x139efa-0x1dd;const _0x8d914d=a242_0x8d91();let _0x7a285b=_0x8d914d[_0x139efa];return _0x7a285b;}const a242_0x35432d=a242_0x7a28;(function(_0xc6e7de,_0x5db3ee){const _0xb60b0f=a242_0x7a28,_0x2ec723=_0xc6e7de();while(!![]){try{const _0x46f6fc=parseInt(_0xb60b0f(0x1eb))/0x1+parseInt(_0xb60b0f(0x1ea))/0x2*(parseInt(_0xb60b0f(0x1e7))/0x3)+parseInt(_0xb60b0f(0x1e3))/0x4*(parseInt(_0xb60b0f(0x1ee))/0x5)+-parseInt(_0xb60b0f(0x1dd))/0x6*(-parseInt(_0xb60b0f(0x1e8))/0x7)+-parseInt(_0xb60b0f(0x1e5))/0x8+-parseInt(_0xb60b0f(0x1e2))/0x9+-parseInt(_0xb60b0f(0x1e0))/0xa;if(_0x46f6fc===_0x5db3ee)break;else _0x2ec723['push'](_0x2ec723['shift']());}catch(_0x458b87){_0x2ec723['push'](_0x2ec723['shift']());}}}(a242_0x8d91,0x2e44f));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':'rule','command':a242_0x35432d(0x1e1),'description':a242_0x35432d(0x1e6),'risk':a242_0x35432d(0x1df),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x5e3ac2){const _0x302eb5=a242_0x35432d,_0x1145a7=await Promise[_0x302eb5(0x1ef)](APP_RULE_TYPES['map'](_0x1d948e=>getAppRule(_0x5e3ac2[_0x302eb5(0x1e9)],{'appCode':_0x5e3ac2[_0x302eb5(0x1ec)],'type':_0x1d948e}))),_0x1c8ef0=APP_RULE_TYPES[_0x302eb5(0x1de)]((_0x4ae0c6,_0x286b24)=>projectAppRule(_0x4ae0c6,_0x1145a7[_0x286b24]??null));return{'ok':!![],'data':{'total':_0x1c8ef0[_0x302eb5(0x1ed)],'rules':_0x1c8ef0},'message':_0x302eb5(0x1e4)+_0x5e3ac2[_0x302eb5(0x1ec)]};}};function a242_0x8d91(){const _0x20a6ce=['list','1049490zQtXxL','191292TyixFx','Loaded\x20app\x20rule\x20configuration\x20for\x20','254616LiaeZo','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','3NTXrrN','3836oGUxmh','cookie','523518bAhbDa','24526CjHlNi','appCode','length','25YMlmax','all','1146EScDtF','map','read','2921120fYyHyw'];a242_0x8d91=function(){return _0x20a6ce;};return a242_0x8d91();}
|
package/lib/commands/rule/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a243_0x4ac20f=a243_0x548b;(function(_0x1a555d,_0x5c5b08){const _0x5588dc=a243_0x548b,_0x2f1b53=_0x1a555d();while(!![]){try{const _0x5e4927=-parseInt(_0x5588dc(0xe4))/0x1+parseInt(_0x5588dc(0xf7))/0x2*(-parseInt(_0x5588dc(0xf6))/0x3)+-parseInt(_0x5588dc(0xf2))/0x4*(parseInt(_0x5588dc(0xe6))/0x5)+-parseInt(_0x5588dc(0xff))/0x6*(-parseInt(_0x5588dc(0xd1))/0x7)+-parseInt(_0x5588dc(0xc7))/0x8+-parseInt(_0x5588dc(0xfd))/0x9+parseInt(_0x5588dc(0xdf))/0xa;if(_0x5e4927===_0x5c5b08)break;else _0x2f1b53['push'](_0x2f1b53['shift']());}catch(_0x3ab033){_0x2f1b53['push'](_0x2f1b53['shift']());}}}(a243_0xddf7,0x9503a));import{knowledgeDocumentsPath}from'../../core/api-client.js';function a243_0xddf7(){const _0x54dcc6=['UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','before','1375290QoKrDW','input','6378vJlRMi','\x20--format\x20compress','type','app_rule_verification_unavailable',';\x20current\x20version\x20is\x20','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','Set\x20','app_rule_content_too_large','Pass\x20a\x20UTF-8\x20Markdown\x20file.','DATABASE','--file\x20is\x20required.','isSafeInteger','3751520gRjdNm','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','\x20version\x20changed\x20before\x20write.','POST','expected-version','beforeRecord','contentHash','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','push','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','3332CRaskC','app_rule_expected_version_invalid','set','rules','app_rule_file_required','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','length','\x20could\x20not\x20be\x20verified.','appCode','RULES','version','replacement','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','verified','28999380FfDVxi','app_rule_verification_failed','planned','byteSize','update','690926teZAgF','The\x20set\x20request\x20was\x20sent,\x20but\x20','997820xaiVlK','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','file','rule','expectedVersion','cookie','number','rabetbase\x20rule\x20get\x20--type\x20','Expected\x20','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','app_rule_set_outcome_unknown','12eFkZyf','unconfigured','defineProperty','content','1326294nBjqXd','4eyfvkx','\x20for\x20','create'];a243_0xddf7=function(){return _0x54dcc6;};return a243_0xddf7();}import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';function readSetInput(_0xcced8d){const _0x22d38c=a243_0x548b,_0x518158=readAppRuleType(_0xcced8d),_0x50ffe5=_0xcced8d['str'](_0x22d38c(0xe8))['trim']();if(!_0x50ffe5)throw appRuleError(_0x22d38c(0xd5),_0x22d38c(0xc5),_0x22d38c(0xc3));const _0x554dd7=_0xcced8d['flag']('expected-version');let _0x48691e;if(_0x554dd7!==undefined){_0x48691e=Number(_0x554dd7);if(!Number[_0x22d38c(0xc6)](_0x48691e)||_0x48691e<0x0)throw appRuleError(_0x22d38c(0xd2),_0x22d38c(0xf0));}return{'type':_0x518158,'file':_0x50ffe5,'expectedVersion':_0x48691e};}async function prepareSet(_0x5ac66f){const _0x41f5ae=a243_0x548b,_0x115c72=readSetInput(_0x5ac66f),_0xdb99dc=await readAppRuleFile(_0x115c72[_0x41f5ae(0xe8)]);if(_0x115c72[_0x41f5ae(0x101)]===_0x41f5ae(0xd4)&&_0xdb99dc[_0x41f5ae(0xf5)][_0x41f5ae(0xd7)]>0x7d0)throw appRuleError(_0x41f5ae(0xc2),_0x41f5ae(0xd0));const _0x491f23=await getAppRule(_0x5ac66f[_0x41f5ae(0xeb)],{'appCode':_0x5ac66f[_0x41f5ae(0xd9)],'type':_0x115c72[_0x41f5ae(0x101)]});if(_0x115c72[_0x41f5ae(0xea)]!==undefined&&(_0x491f23?.[_0x41f5ae(0xdb)]??0x0)!==_0x115c72[_0x41f5ae(0xea)])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x115c72[_0x41f5ae(0x101)])+_0x41f5ae(0xc9),_0x41f5ae(0xee)+_0x115c72[_0x41f5ae(0xea)]+_0x41f5ae(0x103)+(_0x491f23?.['version']??_0x41f5ae(0xf3))+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x115c72,'replacement':_0xdb99dc,'beforeRecord':_0x491f23,'before':projectAppRule(_0x115c72[_0x41f5ae(0x101)],_0x491f23),'planned':{'type':_0x115c72[_0x41f5ae(0x101)],'fileName':appRuleFileName(_0x115c72[_0x41f5ae(0x101)]),'contextScope':appRuleContextScope(_0x115c72[_0x41f5ae(0x101)]),'enabled':!![],'appCode':_0x5ac66f[_0x41f5ae(0xd9)],'scope':_0x41f5ae(0xd4),'contentByteSize':_0xdb99dc['byteSize'],'contentHash':_0xdb99dc[_0x41f5ae(0xcd)]}};}function a243_0x548b(_0x2e5233,_0x42d8d8){_0x2e5233=_0x2e5233-0xc1;const _0xddf73d=a243_0xddf7();let _0x548bf6=_0xddf73d[_0x2e5233];return _0x548bf6;}function warningsFor(_0x469341){return[];}export const ruleSet={'service':a243_0x4ac20f(0xe9),'command':a243_0x4ac20f(0xd3),'description':a243_0x4ac20f(0xc8),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':'file','type':'string','required':!![],'description':a243_0x4ac20f(0xfa)},{'name':a243_0x4ac20f(0xcb),'type':a243_0x4ac20f(0xec),'required':![],'description':a243_0x4ac20f(0xef)}],async 'validate'(_0x2a1233){readSetInput(_0x2a1233);},async 'dryRun'(_0x340b3e){const _0x2f011e=a243_0x4ac20f,_0xe11d6b=await prepareSet(_0x340b3e);return asDryRunResult({'operation':_0x2f011e(0xd3),'selector':{'appCode':_0x340b3e[_0x2f011e(0xd9)],'scope':_0x2f011e(0xd4),'type':_0xe11d6b['input'][_0x2f011e(0x101)]},'before':_0xe11d6b[_0x2f011e(0xfc)],'after':_0xe11d6b[_0x2f011e(0xe1)],'dryRun':!![],'backend':{'method':_0x2f011e(0xca),'path':knowledgeDocumentsPath('rules',_0xe11d6b[_0x2f011e(0xcc)]?_0x2f011e(0xe3):_0x2f011e(0xf9)),'body':{'appCode':_0x340b3e[_0x2f011e(0xd9)],..._0xe11d6b[_0x2f011e(0xcc)]?{'id':_0xe11d6b[_0x2f011e(0xcc)]['id']}:{},'title':_0xe11d6b[_0x2f011e(0xfe)][_0x2f011e(0x101)]===_0x2f011e(0xd4)?_0x2f011e(0xda):_0x2f011e(0xc4),'contentHash':_0xe11d6b[_0x2f011e(0xdc)][_0x2f011e(0xcd)],'contentByteSize':_0xe11d6b[_0x2f011e(0xdc)][_0x2f011e(0xe2)],..._0xe11d6b[_0x2f011e(0xcc)]?{'expectedVersion':_0xe11d6b[_0x2f011e(0xcc)][_0x2f011e(0xdb)]}:{}}},'warnings':warningsFor(_0xe11d6b['input'][_0x2f011e(0xea)]),'verification':{'expectedVersion':_0xe11d6b[_0x2f011e(0xcc)]?.[_0x2f011e(0xdb)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x2f011e(0xed)+_0xe11d6b[_0x2f011e(0xfe)]['type']+'\x20--format\x20compress'}},{'method':'POST','url':knowledgeDocumentsPath(_0x2f011e(0xd4),_0xe11d6b[_0x2f011e(0xcc)]?_0x2f011e(0xe3):_0x2f011e(0xf9))});},async 'execute'(_0x3481d0){const _0x4f4901=a243_0x4ac20f,_0x3cad77=await prepareSet(_0x3481d0),_0x25acbd=_0x3cad77['beforeRecord']===null?0x1:_0x3cad77[_0x4f4901(0xcc)][_0x4f4901(0xdb)]+(_0x3cad77[_0x4f4901(0xcc)][_0x4f4901(0xf5)]===_0x3cad77[_0x4f4901(0xdc)][_0x4f4901(0xf5)]?0x0:0x1);let _0x27caa9,_0x4d8524=![];try{_0x27caa9=await saveAppRule(_0x3481d0[_0x4f4901(0xeb)],{'appCode':_0x3481d0[_0x4f4901(0xd9)],'type':_0x3cad77[_0x4f4901(0xfe)]['type'],'content':_0x3cad77[_0x4f4901(0xdc)][_0x4f4901(0xf5)],'expectedVersion':_0x3cad77[_0x4f4901(0xcc)]?.[_0x4f4901(0xdb)]??0x0,..._0x3cad77[_0x4f4901(0xcc)]?{'id':_0x3cad77[_0x4f4901(0xcc)]['id']}:{}});if(_0x27caa9[_0x4f4901(0xdb)]!==_0x25acbd||_0x27caa9[_0x4f4901(0xf5)]!==_0x3cad77['replacement']['content']||_0x3cad77[_0x4f4901(0xcc)]!==null&&_0x27caa9['id']!==_0x3cad77[_0x4f4901(0xcc)]['id'])throw appRuleError(_0x4f4901(0xe0),_0x4f4901(0xfb),_0x4f4901(0xe7));}catch(_0x160df4){if(!isPlatformTransportFailure(_0x160df4))throw _0x160df4;_0x4d8524=!![];}let _0x30aa1b;try{_0x30aa1b=await getAppRule(_0x3481d0[_0x4f4901(0xeb)],{'appCode':_0x3481d0[_0x4f4901(0xd9)],'type':_0x3cad77['input'][_0x4f4901(0x101)]});}catch(_0x5a5d31){const _0x276ec2=appRuleError(_0x4d8524?_0x4f4901(0xf1):_0x4f4901(0x102),_0x4f4901(0xe5)+appRuleFileName(_0x3cad77['input']['type'])+_0x4f4901(0xd8),_0x4f4901(0xdd));Object[_0x4f4901(0xf4)](_0x276ec2,'cause',{'value':_0x5a5d31,'enumerable':![]});throw _0x276ec2;}const _0x23236d=_0x30aa1b&&inspectAppRuleContent(_0x30aa1b[_0x4f4901(0xf5)])[_0x4f4901(0xcd)]===_0x3cad77[_0x4f4901(0xdc)][_0x4f4901(0xcd)],_0x16066a=_0x30aa1b&&_0x30aa1b[_0x4f4901(0xdb)]===_0x25acbd&&(!_0x27caa9||_0x30aa1b['id']===_0x27caa9['id']&&_0x30aa1b[_0x4f4901(0xdb)]===_0x27caa9['version']);if(!_0x30aa1b||!_0x23236d||!_0x16066a||_0x3cad77['beforeRecord']!==null&&_0x30aa1b['id']!==_0x3cad77[_0x4f4901(0xcc)]['id'])throw appRuleError(_0x4d8524?_0x4f4901(0xf1):_0x4f4901(0xe0),appRuleFileName(_0x3cad77[_0x4f4901(0xfe)]['type'])+_0x4f4901(0x105),_0x4f4901(0xd6)+_0x3cad77[_0x4f4901(0xfe)][_0x4f4901(0x101)]+_0x4f4901(0x104));const _0x11656d=warningsFor(_0x3cad77[_0x4f4901(0xfe)][_0x4f4901(0xea)]);_0x4d8524&&_0x11656d[_0x4f4901(0xcf)](_0x4f4901(0xce));const _0xbb08a0=projectAppRule(_0x3cad77[_0x4f4901(0xfe)]['type'],_0x30aa1b);return{'ok':!![],'data':{'operation':'set','selector':{'appCode':_0x3481d0['appCode'],'scope':_0x4f4901(0xd4),'type':_0x3cad77[_0x4f4901(0xfe)][_0x4f4901(0x101)]},'before':_0x3cad77[_0x4f4901(0xfc)],'after':_0xbb08a0,'dryRun':![],'backend':{'method':_0x4f4901(0xca),'path':knowledgeDocumentsPath(_0x4f4901(0xd4),_0x3cad77[_0x4f4901(0xcc)]?'update':_0x4f4901(0xf9))},'warnings':_0x11656d,'verification':{'status':_0x4f4901(0xde),'recoveredAfterUnknownResponse':_0x4d8524,'expectedVersion':_0x3cad77['beforeRecord']?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x4f4901(0xed)+_0x3cad77[_0x4f4901(0xfe)][_0x4f4901(0x101)]+_0x4f4901(0x100)}},'message':_0x4f4901(0xc1)+appRuleFileName(_0x3cad77[_0x4f4901(0xfe)][_0x4f4901(0x101)])+_0x4f4901(0xf8)+_0x3481d0[_0x4f4901(0xd9)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a244_0x4e76fb=a244_0x2ad0;(function(_0x387cd1,_0xf52bfc){const _0x25dc97=a244_0x2ad0,_0x48959d=_0x387cd1();while(!![]){try{const _0x168a94=parseInt(_0x25dc97(0x13a))/0x1+-parseInt(_0x25dc97(0x12d))/0x2*(parseInt(_0x25dc97(0x121))/0x3)+parseInt(_0x25dc97(0x12b))/0x4+parseInt(_0x25dc97(0x143))/0x5*(-parseInt(_0x25dc97(0x13d))/0x6)+-parseInt(_0x25dc97(0x133))/0x7*(-parseInt(_0x25dc97(0x136))/0x8)+parseInt(_0x25dc97(0x115))/0x9+-parseInt(_0x25dc97(0x139))/0xa;if(_0x168a94===_0xf52bfc)break;else _0x48959d['push'](_0x48959d['shift']());}catch(_0x755ffa){_0x48959d['push'](_0x48959d['shift']());}}}(a244_0x2319,0x55480));import{createHash}from'node:crypto';function a244_0x2ad0(_0x2d05a9,_0x59417c){_0x2d05a9=_0x2d05a9-0x111;const _0x231952=a244_0x2319();let _0x2ad0cd=_0x231952[_0x2d05a9];return _0x2ad0cd;}import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';function a244_0x2319(){const _0x3ca139=['toLowerCase','app_rule_type_invalid','985712Mrnvgv','app_rule_content_too_large','139942HiDXym','page-api-development','byteLength','isFile','scope','Cannot\x20read\x20app\x20rule\x20file:\x20','4581815GvWqbi','type','message','8VOFeaJ','database-analysis','App\x20rule\x20file\x20is\x20blank:\x20','4269390tTtksJ','61942WPXInt','contentHash','utf8','348uHaShK','from','trim','database','rules','DATABASE.md','19770mSIIQM','version','RULES.md','string','indexStatus','app_rule_file_invalid','app_rule_file_unreadable','4792185WEmkZj','size','appCode','Pass\x20a\x20UTF-8\x20Markdown\x20file.','content','createTime','digest','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','updateTime','app_rule_file_required','decode','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','21RDHgWu','app_rule_content_invalid','--file\x20is\x20required.','update','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','sha256:','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'];a244_0x2319=function(){return _0x3ca139;};return a244_0x2319();}import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a244_0x4e76fb(0x141),a244_0x4e76fb(0x140)];export const MAX_APP_RULE_UNITS=0x5*0x400*0x400;export const MAX_APP_RULE_BYTES=MAX_APP_RULE_UNITS*0x4;const APP_RULE_FILES={'rules':a244_0x4e76fb(0x145),'database':a244_0x4e76fb(0x142)},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x4e76fb(0x12e),'database':a244_0x4e76fb(0x137)};export function appRuleError(_0x1f39d1,_0x8ebf6c,_0x103c30){return new CliError(_0x1f39d1,0x1,_0x8ebf6c,_0x103c30);}export function readAppRuleType(_0x565144){const _0x44710a=a244_0x4e76fb,_0x1f2b97=_0x565144['str'](_0x44710a(0x134))['trim']()[_0x44710a(0x129)]();if(_0x1f2b97!==_0x44710a(0x141)&&_0x1f2b97!==_0x44710a(0x140))throw appRuleError(_0x44710a(0x12a),'--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0x1f2b97;}export function appRuleFileName(_0x362585){return APP_RULE_FILES[_0x362585];}export function appRuleContextScope(_0x1a77c3){return APP_RULE_CONTEXT_SCOPES[_0x1a77c3];}export function inspectAppRuleContent(_0x271b03){const _0x9653b9=a244_0x4e76fb,_0x311d42=Buffer[_0x9653b9(0x13e)](_0x271b03,_0x9653b9(0x13c));return{'content':_0x271b03,'byteSize':_0x311d42[_0x9653b9(0x12f)],'contentHash':_0x9653b9(0x126)+createHash('sha256')[_0x9653b9(0x124)](_0x311d42)[_0x9653b9(0x11b)]('hex')};}export async function readAppRuleFile(_0x45c76c){const _0x510ea0=a244_0x4e76fb,_0x2f4b23=_0x45c76c[_0x510ea0(0x13f)]();if(!_0x2f4b23)throw appRuleError(_0x510ea0(0x11e),_0x510ea0(0x123),_0x510ea0(0x118));const _0x28e30a=resolve(_0x2f4b23);let _0x1acb23;try{_0x1acb23=await stat(_0x28e30a);}catch(_0x13c3e0){throw appRuleError(_0x510ea0(0x114),'Cannot\x20access\x20app\x20rule\x20file:\x20'+_0x2f4b23,_0x13c3e0 instanceof Error?_0x13c3e0[_0x510ea0(0x135)]:String(_0x13c3e0));}if(!_0x1acb23[_0x510ea0(0x130)]())throw appRuleError(_0x510ea0(0x113),_0x510ea0(0x11c)+_0x2f4b23);if(_0x1acb23[_0x510ea0(0x116)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x510ea0(0x127));let _0x23aaeb;try{_0x23aaeb=await readFile(_0x28e30a);}catch(_0x155188){throw appRuleError(_0x510ea0(0x114),_0x510ea0(0x132)+_0x2f4b23,_0x155188 instanceof Error?_0x155188[_0x510ea0(0x135)]:String(_0x155188));}if(_0x23aaeb[_0x510ea0(0x12f)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x510ea0(0x12c),_0x510ea0(0x127));let _0x1168ea;try{_0x1168ea=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x510ea0(0x11f)](_0x23aaeb);}catch{throw appRuleError('app_rule_content_invalid',_0x510ea0(0x128)+_0x2f4b23);}if(_0x1168ea['length']>MAX_APP_RULE_UNITS)throw appRuleError(_0x510ea0(0x12c),_0x510ea0(0x120));if(!_0x1168ea[_0x510ea0(0x13f)]())throw appRuleError(_0x510ea0(0x122),_0x510ea0(0x138)+_0x2f4b23);return inspectAppRuleContent(_0x1168ea);}export function projectAppRule(_0x172253,_0x1cc15a){const _0x3f5b2c=a244_0x4e76fb;if(!_0x1cc15a)return{'type':_0x172253,'fileName':appRuleFileName(_0x172253),'contextScope':appRuleContextScope(_0x172253),'enabled':![]};const _0x11df00=inspectAppRuleContent(_0x1cc15a[_0x3f5b2c(0x119)]);return{'type':_0x172253,'fileName':appRuleFileName(_0x172253),'contextScope':appRuleContextScope(_0x172253),'enabled':!![],'id':_0x1cc15a['id'],'scope':_0x1cc15a[_0x3f5b2c(0x131)],'appCode':_0x1cc15a[_0x3f5b2c(0x117)],'version':_0x1cc15a[_0x3f5b2c(0x144)],..._0x1cc15a[_0x3f5b2c(0x112)]!==undefined?{'indexStatus':_0x1cc15a[_0x3f5b2c(0x112)]}:{},'contentByteSize':_0x11df00['byteSize'],'contentHash':_0x11df00[_0x3f5b2c(0x13b)],..._0x1cc15a[_0x3f5b2c(0x11a)]!==undefined&&_0x1cc15a[_0x3f5b2c(0x11a)]!==null?{'createTime':_0x1cc15a[_0x3f5b2c(0x11a)]}:{},..._0x1cc15a[_0x3f5b2c(0x11d)]!==undefined&&_0x1cc15a[_0x3f5b2c(0x11d)]!==null?{'updateTime':_0x1cc15a['updateTime']}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x4e76fb(0x134),'type':a244_0x4e76fb(0x111),'required':!![],'description':a244_0x4e76fb(0x125),'enum':[...APP_RULE_TYPES]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a245_0x27d346=a245_0x3e28;(function(_0x393c9b,_0x5576e4){const _0x28bbc4=a245_0x3e28,_0x45eac7=_0x393c9b();while(!![]){try{const _0x4d9a54=parseInt(_0x28bbc4(0xb4))/0x1+-parseInt(_0x28bbc4(0xa7))/0x2+parseInt(_0x28bbc4(0x9b))/0x3*(parseInt(_0x28bbc4(0xb0))/0x4)+parseInt(_0x28bbc4(0x8f))/0x5*(-parseInt(_0x28bbc4(0xaf))/0x6)+-parseInt(_0x28bbc4(0xc1))/0x7*(-parseInt(_0x28bbc4(0xae))/0x8)+-parseInt(_0x28bbc4(0x8c))/0x9+parseInt(_0x28bbc4(0xb7))/0xa;if(_0x4d9a54===_0x5576e4)break;else _0x45eac7['push'](_0x45eac7['shift']());}catch(_0x1d88d1){_0x45eac7['push'](_0x45eac7['shift']());}}}(a245_0x22e8,0xefa65));function a245_0x3e28(_0x5465f8,_0x2d1c1d){_0x5465f8=_0x5465f8-0x89;const _0x22e8d7=a245_0x22e8();let _0x3e286f=_0x22e8d7[_0x5465f8];return _0x3e286f;}import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';function a245_0x22e8(){const _0x706edc=['run','yarn.lock','inherit','\x20\x20\x20\x20','Script\x20name\x20defined\x20in\x20package.json','\x22\x20not\x20found\x20in\x20package.json.','parse','watch','3145624ZVevHL','preview','validation','boolean','\x20\x20EXAMPLES','No\x20scripts\x20defined\x20in\x20package.json.','write','11935368cZMLCR','950574TJuswR','188tmrIxJ','vite','\x0a\x20\x20Available\x20scripts:\x0a','Domain\x20routing\x20synchronized:\x20','863576UAuYPc','start','log','9208810UseYdX','Run\x20a\x20package.json\x20script','close','length','push','bool','package.json','args','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','yarn','7tfqQJj','bun.lockb','Script\x20\x22','vite\x20preview\x20exited\x20with\x20code\x20','(none)','keys','\x20run\x20','\x20run\x20<script>\x0a','needsUpgrade','scripts','9334647NAzSie','changed','build','25QmDjGI','cwd','script','error','node_modules','bun','Available:\x20','pnpm','has','join','.bin','npm','70683kgPIGz','--watch','\x0a\x20\x20Usage:\x20','bun.lock'];a245_0x22e8=function(){return _0x706edc;};return a245_0x22e8();}import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a245_0x27d346(0xb5),'dev']),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x27d346(0xb5),'dev','build',a245_0x27d346(0xa8)]);export function syncProjectDomainRoutingBeforeScript(_0xdd1772,_0x21e777){const _0x52232a=a245_0x27d346;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x52232a(0x97)](_0x21e777))return null;const _0x5e87ab=findProjectRootDirectory(_0xdd1772);if(!resolveConfigPath(_0x5e87ab))return null;const _0x11b25f=writeProjectDomainRoutingManifest(_0x5e87ab);return{'path':_0x11b25f['path'],'changed':_0x11b25f[_0x52232a(0x8d)]};}function readPackageScripts(_0xbc66fa){const _0x59c362=a245_0x27d346,_0x5a6b27=resolve(_0xbc66fa,_0x59c362(0xbd));if(!existsSync(_0x5a6b27))return null;try{const _0x3c6dfe=JSON[_0x59c362(0xa5)](readFileSync(_0x5a6b27,'utf-8'));return _0x3c6dfe[_0x59c362(0x8b)]??{};}catch{return null;}}function detectPackageManager(_0x5446eb){const _0x431211=a245_0x27d346;if(existsSync(resolve(_0x5446eb,_0x431211(0xc2)))||existsSync(resolve(_0x5446eb,_0x431211(0x9e))))return _0x431211(0x94);if(existsSync(resolve(_0x5446eb,'pnpm-lock.yaml')))return _0x431211(0x96);if(existsSync(resolve(_0x5446eb,_0x431211(0xa0))))return _0x431211(0xc0);return _0x431211(0x9a);}async function versionCheck(_0x159e86){const _0x5a6968=a245_0x27d346,_0xb36029=await checkCliVersion();(_0xb36029['needsUpgrade']||_0xb36029['belowMinimum'])&&(printCliUpgradeWarning(_0xb36029),assertCliVersionSupported(_0xb36029));const _0x5c13a6=await checkSdkVersion(_0x159e86);if(_0x5c13a6[_0x5a6968(0x8a)])printSdkUpgradeWarning(_0x5c13a6);}function spawnScript(_0x5ea2b9,_0x406544,_0x787df2,_0x4d87a8){return new Promise((_0x50134f,_0x25a60e)=>{const _0x3c24b3=a245_0x3e28,_0x58c564=[_0x3c24b3(0x9f),_0x406544,..._0x787df2],_0x2ff1ba=spawn(_0x5ea2b9,_0x58c564,{'cwd':_0x4d87a8,'stdio':_0x3c24b3(0xa1),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4d87a8,_0x3c24b3(0x93),'.bin')+delimiter+process.env.PATH}});_0x2ff1ba['on'](_0x3c24b3(0xb9),_0x25d010=>{const _0x532375=_0x3c24b3;if(_0x25d010===0x0||_0x25d010===null)_0x50134f();else _0x25a60e(new Error(_0x5ea2b9+_0x532375(0xc7)+_0x406544+'\x20exited\x20with\x20code\x20'+_0x25d010));}),_0x2ff1ba['on'](_0x3c24b3(0x92),_0x25a60e);});}function spawnViteBuildWatch(_0x28639c){return new Promise((_0x222eb3,_0x196f1f)=>{const _0x3b3528=a245_0x3e28,_0x3017bf=spawn(_0x3b3528(0xb1),[_0x3b3528(0x8e),_0x3b3528(0x9c)],{'cwd':_0x28639c,'stdio':_0x3b3528(0xa1),'shell':!![],'env':{...process.env,'PATH':''+join(_0x28639c,'node_modules',_0x3b3528(0x99))+delimiter+process.env.PATH}});_0x3017bf['on']('close',_0x4a4ae0=>{const _0x23a676=_0x3b3528;if(_0x4a4ae0===0x0||_0x4a4ae0===null)_0x222eb3();else _0x196f1f(new Error(_0x23a676(0xbf)+_0x4a4ae0));}),_0x3017bf['on'](_0x3b3528(0x92),_0x196f1f);});}function spawnVitePreview(_0x32b6eb){return new Promise((_0x4e216b,_0x2fc40c)=>{const _0x9ae6c6=a245_0x3e28,_0x2f5f21=spawn(_0x9ae6c6(0xb1),[_0x9ae6c6(0xa8)],{'cwd':_0x32b6eb,'stdio':_0x9ae6c6(0xa1),'shell':!![],'env':{...process.env,'PATH':''+join(_0x32b6eb,_0x9ae6c6(0x93),_0x9ae6c6(0x99))+delimiter+process.env.PATH}});_0x2f5f21['on']('close',_0x3e283c=>{const _0x5de747=_0x9ae6c6;if(_0x3e283c===0x0||_0x3e283c===null)_0x4e216b();else _0x2fc40c(new Error(_0x5de747(0xc4)+_0x3e283c));}),_0x2f5f21['on'](_0x9ae6c6(0x92),_0x2fc40c);});}const runFlags=[{'name':a245_0x27d346(0xa6),'type':a245_0x27d346(0xaa),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a245_0x27d346(0x9f),'command':a245_0x27d346(0x9f),'description':a245_0x27d346(0xb8),'risk':a245_0x27d346(0xad),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a245_0x27d346(0x91),'description':a245_0x27d346(0xa3),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x388de2=a245_0x27d346,_0x2f40b8=[];return _0x2f40b8[_0x388de2(0xbb)](_0x388de2(0xab)),_0x2f40b8[_0x388de2(0xbb)](_0x388de2(0xa2)+CLI_BIN_NAME+'\x20run\x20start'),_0x2f40b8['push'](_0x388de2(0xa2)+CLI_BIN_NAME+'\x20run\x20build'),_0x2f40b8[_0x388de2(0xbb)](_0x388de2(0xa2)+CLI_BIN_NAME+'\x20run\x20preview'),_0x2f40b8[_0x388de2(0xbb)](_0x388de2(0xa2)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x2f40b8[_0x388de2(0x98)]('\x0a');},async 'execute'(_0x5e6cbe){const _0x366400=a245_0x27d346,_0x2717a4=process[_0x366400(0x90)](),_0x30c2d2=_0x5e6cbe[_0x366400(0xbe)][0x0],_0x100891=_0x5e6cbe[_0x366400(0xbe)]['slice'](0x1),_0x1a686b=readPackageScripts(_0x2717a4);if(!_0x1a686b)throw CliErrors[_0x366400(0xa9)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x30c2d2){const _0x27b1a4=Object[_0x366400(0xc6)](_0x1a686b);if(_0x27b1a4[_0x366400(0xba)]===0x0)console['log'](_0x366400(0xac));else{console[_0x366400(0xb6)](_0x366400(0xb2));for(const _0xfc58c9 of _0x27b1a4){console[_0x366400(0xb6)](_0x366400(0xa2)+_0xfc58c9);}console[_0x366400(0xb6)](_0x366400(0x9d)+CLI_BIN_NAME+_0x366400(0x89));}return{'ok':!![]};}if(!_0x1a686b[_0x30c2d2])throw CliErrors['validation'](_0x366400(0xc3)+_0x30c2d2+_0x366400(0xa4),_0x366400(0x95)+(Object[_0x366400(0xc6)](_0x1a686b)['join'](',\x20')||_0x366400(0xc5)));const _0x50e557=detectPackageManager(_0x2717a4),_0x366d8a=syncProjectDomainRoutingBeforeScript(_0x2717a4,_0x30c2d2);_0x366d8a?.[_0x366400(0x8d)]&&console[_0x366400(0x92)](_0x366400(0xb3)+_0x366d8a['path']);VERSION_CHECK_SCRIPTS[_0x366400(0x97)](_0x30c2d2)&&await versionCheck(_0x2717a4);if(_0x30c2d2===_0x366400(0xa8)&&_0x5e6cbe[_0x366400(0xbc)](_0x366400(0xa6)))return await Promise['all']([spawnViteBuildWatch(_0x2717a4),spawnVitePreview(_0x2717a4)]),{'ok':!![]};return await spawnScript(_0x50e557,_0x30c2d2,_0x100891,_0x2717a4),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a246_0x5cf384=a246_0x26d8;function a246_0x26d8(_0x4a0eca,_0x454b88){_0x4a0eca=_0x4a0eca-0x169;const _0x9e84bf=a246_0x9e84();let _0x26d8dd=_0x9e84bf[_0x4a0eca];return _0x26d8dd;}(function(_0x16aa6a,_0x1adee7){const _0x19a17e=a246_0x26d8,_0x30945c=_0x16aa6a();while(!![]){try{const _0x2eeded=parseInt(_0x19a17e(0x16b))/0x1+parseInt(_0x19a17e(0x16d))/0x2+parseInt(_0x19a17e(0x174))/0x3*(parseInt(_0x19a17e(0x16f))/0x4)+parseInt(_0x19a17e(0x16a))/0x5+-parseInt(_0x19a17e(0x176))/0x6+parseInt(_0x19a17e(0x170))/0x7*(parseInt(_0x19a17e(0x175))/0x8)+-parseInt(_0x19a17e(0x169))/0x9;if(_0x2eeded===_0x1adee7)break;else _0x30945c['push'](_0x30945c['shift']());}catch(_0x177880){_0x30945c['push'](_0x30945c['shift']());}}}(a246_0x9e84,0xa44af));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5d14c0){const _0x392144=await buildSchemaPayload();return{'ok':!![],'data':_0x392144};}export const schemaDefinition={'service':a246_0x5cf384(0x16e),'command':a246_0x5cf384(0x172),'description':a246_0x5cf384(0x173),'risk':a246_0x5cf384(0x171),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x5cf384(0x16c),'flags':[],'execute':execute};function a246_0x9e84(){const _0x14f79d=['167784XratHT','5752932hJgpgU','16934517nIdABY','4501840KdGAtg','280638dAIvGh','json','2334310tidhfp','schema','358972yVJKDE','329XdwlWH','read','export','Export\x20machine-readable\x20command\x20schema\x20(JSON)','6MVFkwM'];a246_0x9e84=function(){return _0x14f79d;};return a246_0x9e84();}
|