@lovrabet/rabetbase-cli 2.5.6 → 2.5.7-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.d.ts +2 -0
- package/lib/commands/flow/page-list.js +1 -0
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.d.ts +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.d.ts +6 -2
- 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/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/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.d.ts +26 -6
- 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.d.ts +12 -0
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.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/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/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 +8 -4
- package/skills/rabetbase/guides/approval-flow-development-workflow.md +52 -13
- package/skills/rabetbase/guides/backend-function.md +26 -4
- package/skills/rabetbase/guides/bff-creation-workflow.md +9 -0
- package/skills/rabetbase/guides/cross-database-bff.md +1 -0
- package/skills/rabetbase/guides/custom-page-flow-sdk.md +2 -0
- package/skills/rabetbase/guides/data-api-guidelines.md +2 -0
- package/skills/rabetbase/guides/flow-config-examples.md +75 -0
- package/skills/rabetbase/guides/form-flow-start.md +61 -0
- package/skills/rabetbase/guides/typescript-sdk.md +1 -1
- package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +18 -4
- package/skills/rabetbase/references/rabetbase-codegen-sdk.md +5 -4
- package/skills/rabetbase/references/rabetbase-flow-commands.md +21 -2
- package/skills/rabetbase/references/rabetbase-flow-resources.md +21 -3
- package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +6 -2
- package/skills/rabetbase/references/rabetbase-kb.md +4 -1
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a231_0x1de4(_0x3e1381,_0x2f6e52){_0x3e1381=_0x3e1381-0x160;const _0x4f5861=a231_0x4f58();let _0x1de4cc=_0x4f5861[_0x3e1381];return _0x1de4cc;}const a231_0x11dc2d=a231_0x1de4;(function(_0x13fa11,_0x2a5559){const _0x4a1019=a231_0x1de4,_0x5b9c89=_0x13fa11();while(!![]){try{const _0x3e4220=-parseInt(_0x4a1019(0x167))/0x1+parseInt(_0x4a1019(0x16a))/0x2*(-parseInt(_0x4a1019(0x164))/0x3)+-parseInt(_0x4a1019(0x16e))/0x4*(-parseInt(_0x4a1019(0x177))/0x5)+parseInt(_0x4a1019(0x175))/0x6*(parseInt(_0x4a1019(0x171))/0x7)+-parseInt(_0x4a1019(0x16f))/0x8+parseInt(_0x4a1019(0x178))/0x9*(parseInt(_0x4a1019(0x174))/0xa)+parseInt(_0x4a1019(0x162))/0xb;if(_0x3e4220===_0x2a5559)break;else _0x5b9c89['push'](_0x5b9c89['shift']());}catch(_0x1020af){_0x5b9c89['push'](_0x5b9c89['shift']());}}}(a231_0x4f58,0x65741));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a231_0x4f58(){const _0x13f296=['role','393GeVrWH','num','high-risk-write','136551YDdVER','delete','Role\x20still\x20has\x20','2258RFwsNd','appCode','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','/smartapi/permit/role/delete','195476GFiWjD','4528544spBOeR','POST','35ClItHH','\x20(id=','Deleted\x20role\x20','169430oZGIQY','182274MElSKH','dev','5DWtGZs','171qfRqEe','Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','userCount','roleName','8177290KolAdX'];a231_0x4f58=function(){return _0x13f296;};return a231_0x4f58();}const DELETE_PATH=a231_0x11dc2d(0x16d);export const roleDelete={'service':a231_0x11dc2d(0x163),'command':'delete','description':a231_0x11dc2d(0x179),'risk':a231_0x11dc2d(0x166),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xfd5e5e){const _0x3bc2f2=a231_0x11dc2d,_0x19b88c=_0xfd5e5e[_0x3bc2f2(0x165)]('id'),_0x412a5e=await getRoleById(_0xfd5e5e['appCode'],_0x19b88c);return assertCustomRole(_0x412a5e,_0x3bc2f2(0x168)),asDryRunResult({'scope':'dev','operation':_0x3bc2f2(0x168),'selector':{'appCode':_0xfd5e5e[_0x3bc2f2(0x16b)],'roleId':_0x19b88c,'roleName':_0x412a5e[_0x3bc2f2(0x161)]},'before':projectRole(_0x412a5e),'after':null,'dryRun':!![],'backend':{'method':_0x3bc2f2(0x170),'path':DELETE_PATH},'warnings':_0x412a5e[_0x3bc2f2(0x160)]>0x0?[_0x3bc2f2(0x169)+_0x412a5e[_0x3bc2f2(0x160)]+_0x3bc2f2(0x16c)]:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x38e900){const _0x3f6e7e=a231_0x11dc2d,_0x46bff3=_0x38e900[_0x3f6e7e(0x165)]('id'),_0x54a2ff=await getRoleById(_0x38e900[_0x3f6e7e(0x16b)],_0x46bff3);return assertCustomRole(_0x54a2ff,_0x3f6e7e(0x168)),await deleteAppRole(_0x46bff3),{'ok':!![],'data':{'scope':_0x3f6e7e(0x176),'operation':_0x3f6e7e(0x168),'selector':{'appCode':_0x38e900[_0x3f6e7e(0x16b)],'roleId':_0x46bff3,'roleName':_0x54a2ff[_0x3f6e7e(0x161)]},'before':projectRole(_0x54a2ff),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x3f6e7e(0x173)+_0x54a2ff[_0x3f6e7e(0x161)]+_0x3f6e7e(0x172)+_0x46bff3+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a232_0x4a9a40=a232_0x4363;function a232_0x25f4(){const _0x354b7c=['Show\x20a\x20single\x20role\x27s\x20detail','roleType','4880880BhScHL','role','7501912PDrHUF','12hioJYt','roleName','123590gXXvsL','24IcJGYb','800454rgCNrB','2970759AHYkIf','2601886MpEYVo','num','Role\x20','1354060aKFfgo'];a232_0x25f4=function(){return _0x354b7c;};return a232_0x25f4();}(function(_0x859500,_0x1c19dd){const _0x2b3d46=a232_0x4363,_0x5e3529=_0x859500();while(!![]){try{const _0x2c74c8=parseInt(_0x2b3d46(0xe6))/0x1+-parseInt(_0x2b3d46(0xeb))/0x2+parseInt(_0x2b3d46(0xe7))/0x3+-parseInt(_0x2b3d46(0xe5))/0x4*(-parseInt(_0x2b3d46(0xe4))/0x5)+parseInt(_0x2b3d46(0xf1))/0x6*(parseInt(_0x2b3d46(0xe8))/0x7)+-parseInt(_0x2b3d46(0xf0))/0x8+-parseInt(_0x2b3d46(0xee))/0x9;if(_0x2c74c8===_0x1c19dd)break;else _0x5e3529['push'](_0x5e3529['shift']());}catch(_0x3f87a5){_0x5e3529['push'](_0x5e3529['shift']());}}}(a232_0x25f4,0x8040a));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a232_0x4363(_0x4ae885,_0x35b69d){_0x4ae885=_0x4ae885-0xe4;const _0x25f44c=a232_0x25f4();let _0x436336=_0x25f44c[_0x4ae885];return _0x436336;}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a232_0x4a9a40(0xef),'command':'detail','description':a232_0x4a9a40(0xec),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x31c2ae){const _0x20233a=a232_0x4a9a40,_0x503c5e=_0x31c2ae[_0x20233a(0xe9)]('id'),_0x7da80b=await getRoleById(_0x31c2ae['appCode'],_0x503c5e);return{'ok':!![],'data':{'scope':'dev','role':projectRole(_0x7da80b)},'message':_0x20233a(0xea)+_0x7da80b[_0x20233a(0xf2)]+'\x20('+_0x7da80b[_0x20233a(0xed)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3dfbe4,_0x31379f){const _0x277f85=a233_0x2d5d,_0x2bdf76=_0x3dfbe4();while(!![]){try{const _0x3810d4=parseInt(_0x277f85(0x1c3))/0x1+parseInt(_0x277f85(0x1c0))/0x2+parseInt(_0x277f85(0x1bc))/0x3*(-parseInt(_0x277f85(0x1c2))/0x4)+-parseInt(_0x277f85(0x1bd))/0x5*(parseInt(_0x277f85(0x1c5))/0x6)+-parseInt(_0x277f85(0x1c4))/0x7*(-parseInt(_0x277f85(0x1bf))/0x8)+parseInt(_0x277f85(0x1be))/0x9+parseInt(_0x277f85(0x1c1))/0xa;if(_0x3810d4===_0x31379f)break;else _0x2bdf76['push'](_0x2bdf76['shift']());}catch(_0x2360f2){_0x2bdf76['push'](_0x2bdf76['shift']());}}}(a233_0x12e5,0x4c003));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a233_0x2d5d(_0x6503a0,_0xd9558a){_0x6503a0=_0x6503a0-0x1bc;const _0x12e520=a233_0x12e5();let _0x2d5d76=_0x12e520[_0x6503a0];return _0x2d5d76;}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';function a233_0x12e5(){const _0x50b618=['19911dKQktQ','652195VLmgys','3501972LtsZKD','9376JwOKBs','321896yxTlTE','674720hHTLxw','364UFciRU','285193NwvstG','854naxbbH','6krLvFQ'];a233_0x12e5=function(){return _0x50b618;};return a233_0x12e5();}import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a234_0x1b59(_0x2e0537,_0x33b5ce){_0x2e0537=_0x2e0537-0xc8;const _0x35d679=a234_0x35d6();let _0x1b59ea=_0x35d679[_0x2e0537];return _0x1b59ea;}const a234_0x3d3b7a=a234_0x1b59;(function(_0x264ce9,_0x3dcd61){const _0x43a82c=a234_0x1b59,_0x1fd1e7=_0x264ce9();while(!![]){try{const _0x1d2988=-parseInt(_0x43a82c(0xd2))/0x1+-parseInt(_0x43a82c(0xe7))/0x2+parseInt(_0x43a82c(0xdb))/0x3+parseInt(_0x43a82c(0xe4))/0x4+-parseInt(_0x43a82c(0xe8))/0x5+-parseInt(_0x43a82c(0xce))/0x6*(-parseInt(_0x43a82c(0xd8))/0x7)+-parseInt(_0x43a82c(0xcb))/0x8*(parseInt(_0x43a82c(0xef))/0x9);if(_0x1d2988===_0x3dcd61)break;else _0x1fd1e7['push'](_0x1fd1e7['shift']());}catch(_0x438a3b){_0x1fd1e7['push'](_0x1fd1e7['shift']());}}}(a234_0x35d6,0x33766));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a234_0x3d3b7a(0xc9),a234_0x3d3b7a(0xdc),a234_0x3d3b7a(0xd9),a234_0x3d3b7a(0xd3)];function a234_0x35d6(){const _0x5cdeb7=['\x20role(s)','includes','trim','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','toUpperCase','9lUHKlR','pagesize','ADMIN','Use\x20one\x20of:\x20','1894232nVEaDX','roleType','page','2498604tgmkml','number','string','map','112613JjNEHs','CUSTOM','type','validation','role','appCode','7ImbOPq','OWNER','dev','759795lWUqQY','DEV','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','Filter\x20by\x20role\x20type','Invalid\x20--type\x20\x22','join','num','str','Page\x20size\x20(1-100)','743660oKDyBu','length','list','220386lejSoq','926195GSxWTH','Page\x20index\x20(1-based)'];a234_0x35d6=function(){return _0x5cdeb7;};return a234_0x35d6();}export const roleList={'service':a234_0x3d3b7a(0xd6),'command':a234_0x3d3b7a(0xe6),'description':a234_0x3d3b7a(0xdd),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0x3d3b7a(0xd4),'type':a234_0x3d3b7a(0xd0),'required':![],'description':a234_0x3d3b7a(0xde),'enum':ROLE_TYPES},{'name':a234_0x3d3b7a(0xcd),'type':a234_0x3d3b7a(0xcf),'description':a234_0x3d3b7a(0xe9),'default':0x1},{'name':a234_0x3d3b7a(0xc8),'type':a234_0x3d3b7a(0xcf),'description':a234_0x3d3b7a(0xe3),'default':0x64}],async 'validate'(_0x5c7efa){const _0x4dbda5=a234_0x3d3b7a,_0x5b793f=_0x5c7efa[_0x4dbda5(0xe2)]('type')[_0x4dbda5(0xec)]();if(_0x5b793f&&!ROLE_TYPES[_0x4dbda5(0xeb)](_0x5b793f[_0x4dbda5(0xee)]()))throw CliErrors['validation'](_0x4dbda5(0xdf)+_0x5b793f+'\x22.',_0x4dbda5(0xca)+ROLE_TYPES[_0x4dbda5(0xe0)](',\x20')+'.');const _0x4d366b=_0x5c7efa[_0x4dbda5(0xe1)](_0x4dbda5(0xcd),0x1),_0xbd5720=_0x5c7efa[_0x4dbda5(0xe1)](_0x4dbda5(0xc8),0x64);if(_0x4d366b<0x1)throw CliErrors['validation'](_0x4dbda5(0xed));if(_0xbd5720<0x1||_0xbd5720>0x64)throw CliErrors[_0x4dbda5(0xd5)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x2e53ff){const _0x4231bd=a234_0x3d3b7a,_0x520aad=_0x2e53ff[_0x4231bd(0xe1)](_0x4231bd(0xcd),0x1)||0x1,_0x4dcdc8=_0x2e53ff[_0x4231bd(0xe1)]('pagesize',0x64)||0x64,_0x251756=_0x2e53ff['str'](_0x4231bd(0xd4))[_0x4231bd(0xec)]()['toUpperCase'](),{items:_0x212ca1,paging:_0x36681a}=await listAppRoles(_0x2e53ff[_0x4231bd(0xd7)],{'currentPage':_0x520aad,'pageSize':_0x4dcdc8}),_0x2e6413=_0x251756?_0x212ca1['filter'](_0x1e6029=>_0x1e6029[_0x4231bd(0xcc)]===_0x251756):_0x212ca1,_0x5f033f=_0x2e6413[_0x4231bd(0xd1)](projectRole);return{'ok':!![],'data':{'scope':_0x4231bd(0xda),'roles':_0x5f033f,'paging':_0x36681a},'message':'Found\x20'+_0x5f033f[_0x4231bd(0xe5)]+_0x4231bd(0xea)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a234_0x19aec3=a234_0x40e1;(function(_0x49dc2d,_0x47c580){const _0x275b43=a234_0x40e1,_0x537b98=_0x49dc2d();while(!![]){try{const _0x1c30b2=parseInt(_0x275b43(0x21e))/0x1+-parseInt(_0x275b43(0x216))/0x2+-parseInt(_0x275b43(0x1ee))/0x3+-parseInt(_0x275b43(0x1f8))/0x4+-parseInt(_0x275b43(0x20f))/0x5*(-parseInt(_0x275b43(0x1e1))/0x6)+-parseInt(_0x275b43(0x1e0))/0x7+parseInt(_0x275b43(0x213))/0x8;if(_0x1c30b2===_0x47c580)break;else _0x537b98['push'](_0x537b98['shift']());}catch(_0x287118){_0x537b98['push'](_0x537b98['shift']());}}}(a234_0x15d8,0x212bd));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':a234_0x19aec3(0x212),'required':!![],'description':a234_0x19aec3(0x1fe)};export const ROLE_REF_FLAG={'name':a234_0x19aec3(0x215),'type':a234_0x19aec3(0x203),'required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};export const USER_REF_FLAG={'name':a234_0x19aec3(0x224),'type':a234_0x19aec3(0x203),'required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':a234_0x19aec3(0x22a),'type':a234_0x19aec3(0x203),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':a234_0x19aec3(0x22a),'type':a234_0x19aec3(0x203),'required':!![],'description':a234_0x19aec3(0x20d)};export const REMARK_FLAG={'name':'remark','type':a234_0x19aec3(0x203),'required':![],'description':a234_0x19aec3(0x219)};function a234_0x40e1(_0x350914,_0x2adbb2){_0x350914=_0x350914-0x1db;const _0x15d85c=a234_0x15d8();let _0x40e115=_0x15d85c[_0x350914];return _0x40e115;}export const EXPECT_USER_COUNT_FLAG={'name':a234_0x19aec3(0x205),'type':'number','required':![],'description':a234_0x19aec3(0x221)};export const BUILTIN_ROLE_TYPES=[a234_0x19aec3(0x226),a234_0x19aec3(0x20e),a234_0x19aec3(0x21a)];export function isBuiltinRole(_0x21675a){const _0x34153d=a234_0x19aec3;return BUILTIN_ROLE_TYPES[_0x34153d(0x220)](_0x21675a);}export function assertCustomRole(_0x3a1739,_0x5c1595){const _0x52cf02=a234_0x19aec3;if(_0x3a1739[_0x52cf02(0x200)]!==_0x52cf02(0x1e4))throw CliErrors[_0x52cf02(0x1f4)](_0x52cf02(0x1fd)+_0x5c1595+_0x52cf02(0x202)+_0x3a1739[_0x52cf02(0x227)]+'\x20('+_0x3a1739['roleType']+').',_0x52cf02(0x222));}export function projectRole(_0x333f76){const _0x2e33f3=a234_0x19aec3;return{'id':_0x333f76['id'],'roleName':_0x333f76[_0x2e33f3(0x227)],'roleType':_0x333f76[_0x2e33f3(0x200)],'remark':_0x333f76[_0x2e33f3(0x1ff)],'userCount':_0x333f76[_0x2e33f3(0x1e3)],'permitCount':_0x333f76[_0x2e33f3(0x1f2)],'builtin':isBuiltinRole(_0x333f76[_0x2e33f3(0x200)])};}export async function resolveRoleRef(_0x2aa7bd,_0x3277a7){const _0x4928fb=a234_0x19aec3,_0x39c57f=_0x3277a7[_0x4928fb(0x1f3)]();if(!_0x39c57f)throw CliErrors[_0x4928fb(0x1f4)](_0x4928fb(0x1dc),'Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x39c57f))return getRoleById(_0x2aa7bd,Number(_0x39c57f));const _0x73e994=await listAllAppRoles(_0x2aa7bd),_0x38275a=_0x73e994[_0x4928fb(0x1f6)](_0x47326d=>_0x47326d['roleName']===_0x39c57f);if(_0x38275a['length']===0x0)throw CliErrors[_0x4928fb(0x1f4)]('Role\x20name\x20\x22'+_0x39c57f+_0x4928fb(0x225)+_0x2aa7bd+'.',_0x4928fb(0x1db));if(_0x38275a[_0x4928fb(0x20b)]>0x1){const _0x32e10e=_0x38275a[_0x4928fb(0x1e9)](_0x3dbe81=>_0x3dbe81['id'])[_0x4928fb(0x1f0)](',\x20');throw CliErrors[_0x4928fb(0x1f4)]('Role\x20name\x20\x22'+_0x39c57f+_0x4928fb(0x217)+_0x32e10e+').',_0x4928fb(0x209));}return _0x38275a[0x0];}export async function getRoleById(_0x5f5291,_0x1df92b){const _0x3ef223=a234_0x19aec3,_0x9ba36a=await listAllAppRoles(_0x5f5291),_0x4cb56f=_0x9ba36a['filter'](_0x24800b=>_0x24800b['id']===_0x1df92b&&(!_0x24800b[_0x3ef223(0x1f5)]||_0x24800b[_0x3ef223(0x1f5)]===_0x5f5291));if(_0x4cb56f[_0x3ef223(0x20b)]!==0x1)throw CliErrors[_0x3ef223(0x1f4)](_0x3ef223(0x1f1)+_0x1df92b+_0x3ef223(0x1f9)+_0x5f5291+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x4cb56f[0x0];}async function listAllAppRoles(_0x32cb4b){const _0x467324=a234_0x19aec3,_0x22fd7d=0x64,_0x3982f1=[];for(let _0x357fc6=0x1;;_0x357fc6+=0x1){const {items:_0x28640d,paging:_0x590fba}=await listAppRoles(_0x32cb4b,{'currentPage':_0x357fc6,'pageSize':_0x22fd7d});_0x3982f1[_0x467324(0x214)](..._0x28640d);if(_0x28640d[_0x467324(0x20b)]<_0x22fd7d||_0x590fba&&_0x3982f1['length']>=_0x590fba['totalCount'])return _0x3982f1;}}function a234_0x15d8(){const _0x24d46f=['string','Pass\x20--user\x20<id>.','expect-user-count','flag','user-add','nickname','Disambiguate\x20with\x20--role\x20<id>.','expectUserCount','length','Pass\x20--user\x20<id|name>.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','DEV','735adwrDr','Missing\x20user\x20reference.','totalCount','number','4490536tahQGc','push','role','315152ExbSJa','\x22\x20is\x20ambiguous\x20(ids:\x20','\x20members\x20of\x20the\x20OWNER\x20role.','Optional\x20role\x20remark/description','OWNER','test','str','tenant','212797oqVtwT','Multiple\x20tenant\x20members\x20match\x20\x22','includes','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','dryRun','user','\x22\x20not\x20found\x20in\x20app\x20','ADMIN','roleName','/smartapi/permit/user-role/create','Check\x20the\x20nickname/username.\x20','name','User\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Missing\x20role\x20reference.','toLowerCase','POST','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','1522808PgxwWG','3978ewBTPU','\x20member(s)\x20but\x20role\x20has\x20','userCount','CUSTOM','\x20is\x20not\x20a\x20member\x20of\x20role\x20','\x20is\x20already\x20a\x20member\x20of\x20role\x20','No\x20tenant\x20member\x20matches\x20\x22','userId','map','username','Anti-drift\x20check\x20failed:\x20expected\x20','Removed\x20',';\x20no\x20change.','678039IwXfrm','\x20duplicate\x20memberships\x20for\x20user\x20','join','Role\x20id\x20','permitCount','trim','validation','appCode','filter','Pass\x20--role\x20<id|name>.','538292SQHgwv','\x20not\x20found\x20in\x20app\x20','/smartapi/permit/user-role/delete','find','\x22:\x20','Cannot\x20','Role\x20id\x20(from\x20`role\x20list`)','remark','roleType','dev','\x20built-in\x20role\x20'];a234_0x15d8=function(){return _0x24d46f;};return a234_0x15d8();}export async function resolveTenantCode(){const _0x41466e=a234_0x19aec3,_0xc33fb9=await getSessionUserInfo(),_0x114ba9=_0xc33fb9?.[_0x41466e(0x224)]?.[_0x41466e(0x21d)]?.['tenant_code'];if(!_0x114ba9)throw CliErrors['authRequired']('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x114ba9;}function matchMember(_0x4c3b14,_0xa3b914){const _0x15dea5=a234_0x19aec3,_0x467c3c=_0xa3b914[_0x15dea5(0x1f3)]()[_0x15dea5(0x1dd)]();return(_0x4c3b14[_0x15dea5(0x208)]??'')[_0x15dea5(0x1dd)]()===_0x467c3c||(_0x4c3b14[_0x15dea5(0x1ea)]??'')[_0x15dea5(0x1dd)]()===_0x467c3c;}export async function resolveUserRef(_0x2a6928,_0x40e7ee=a234_0x19aec3(0x204)){const _0x530e32=a234_0x19aec3,_0x3de12a=_0x2a6928['trim']();if(!_0x3de12a)throw CliErrors[_0x530e32(0x1f4)](_0x530e32(0x210),_0x530e32(0x20c));const _0x1218da=await resolveTenantCode(),_0x569c9e=await getTenantMembers(_0x1218da);if(/^\d+$/[_0x530e32(0x21b)](_0x3de12a)){const _0x363617=Number(_0x3de12a),_0x3ccd70=_0x569c9e[_0x530e32(0x1fb)](_0x4b80f4=>_0x4b80f4[_0x530e32(0x1e8)]===_0x363617);return{'userId':_0x363617,'username':_0x3ccd70?.[_0x530e32(0x1ea)]??String(_0x363617),'nickname':_0x3ccd70?.[_0x530e32(0x208)],'matchedBy':'id'};}const _0xb923a=_0x569c9e['filter'](_0x4f91d5=>matchMember(_0x4f91d5,_0x3de12a));if(_0xb923a[_0x530e32(0x20b)]===0x0)throw CliErrors[_0x530e32(0x1f4)](_0x530e32(0x1e7)+_0x3de12a+'\x22.',_0x530e32(0x229)+_0x40e7ee);if(_0xb923a[_0x530e32(0x20b)]>0x1){const _0x295837=_0xb923a[_0x530e32(0x1e9)](_0x4e381a=>(_0x4e381a[_0x530e32(0x208)]??_0x4e381a[_0x530e32(0x1ea)]??'?')+'('+_0x4e381a['userId']+')')['join'](',\x20');throw CliErrors['validation'](_0x530e32(0x21f)+_0x3de12a+_0x530e32(0x1fc)+_0x295837+'.',_0x40e7ee);}const _0x1d5993=_0xb923a[0x0];return{'userId':_0x1d5993[_0x530e32(0x1e8)],'username':_0x1d5993[_0x530e32(0x1ea)]??String(_0x1d5993[_0x530e32(0x1e8)]),'nickname':_0x1d5993[_0x530e32(0x208)],'matchedBy':_0x530e32(0x22a)};}export const CREATE_USER_ROLE_PATH=a234_0x19aec3(0x228);export const DELETE_USER_ROLE_PATH=a234_0x19aec3(0x1fa);export function computeRoleUserMutation(_0x75137d){const _0x4c7a7e=a234_0x19aec3,{operation:_0x19b3c0,appCode:_0x1a92d9,role:_0x535d4a,relations:_0x58128a,user:_0x3ec54a}=_0x75137d,_0x379fc0=[...new Set(_0x58128a[_0x4c7a7e(0x1e9)](_0xd09749=>_0xd09749['userId']))],_0x285b0d=[];if(_0x75137d[_0x4c7a7e(0x20a)]!==undefined&&_0x75137d[_0x4c7a7e(0x20a)]!==_0x379fc0[_0x4c7a7e(0x20b)])throw CliErrors[_0x4c7a7e(0x1f4)](_0x4c7a7e(0x1eb)+_0x75137d[_0x4c7a7e(0x20a)]+_0x4c7a7e(0x1e2)+_0x379fc0[_0x4c7a7e(0x20b)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x3f704c=_0x379fc0[_0x4c7a7e(0x220)](_0x3ec54a['userId']),_0x158baf=_0x58128a[_0x4c7a7e(0x1f6)](_0xd01dcb=>_0xd01dcb[_0x4c7a7e(0x1e8)]===_0x3ec54a[_0x4c7a7e(0x1e8)])['map'](_0x2b3129=>_0x2b3129['id']),_0x7d87a9=_0x19b3c0===_0x4c7a7e(0x207)?!_0x3f704c:_0x3f704c;let _0x264e0a=_0x379fc0;_0x19b3c0===_0x4c7a7e(0x207)?_0x3f704c?_0x285b0d[_0x4c7a7e(0x214)](_0x4c7a7e(0x22b)+_0x3ec54a[_0x4c7a7e(0x1e8)]+_0x4c7a7e(0x1e6)+_0x535d4a[_0x4c7a7e(0x227)]+_0x4c7a7e(0x1ed)):_0x264e0a=[..._0x379fc0,_0x3ec54a[_0x4c7a7e(0x1e8)]]:!_0x3f704c?_0x285b0d['push'](_0x4c7a7e(0x22b)+_0x3ec54a[_0x4c7a7e(0x1e8)]+_0x4c7a7e(0x1e5)+_0x535d4a[_0x4c7a7e(0x227)]+_0x4c7a7e(0x1ed)):(_0x264e0a=_0x379fc0[_0x4c7a7e(0x1f6)](_0x1db304=>_0x1db304!==_0x3ec54a['userId']),_0x158baf[_0x4c7a7e(0x20b)]>0x1&&_0x285b0d[_0x4c7a7e(0x214)](_0x4c7a7e(0x1ec)+_0x158baf[_0x4c7a7e(0x20b)]+_0x4c7a7e(0x1ef)+_0x3ec54a['userId']+'.'));const _0x487f68={'scope':_0x4c7a7e(0x201),'operation':_0x19b3c0,'selector':{'appCode':_0x1a92d9,'roleId':_0x535d4a['id'],'roleName':_0x535d4a[_0x4c7a7e(0x227)],'userId':_0x3ec54a[_0x4c7a7e(0x1e8)]},'before':{'userIds':_0x379fc0},'after':{'userIds':_0x264e0a},'dryRun':_0x75137d[_0x4c7a7e(0x223)],'backend':{'method':_0x4c7a7e(0x1de),'path':_0x19b3c0==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x285b0d};return{'mutation':_0x487f68,'changed':_0x7d87a9,'matchingRelationIds':_0x158baf};}export async function loadDevRoleRelations(_0x24e042,_0x363e0f){const _0x4acd64=a234_0x19aec3,_0x81151b=0x64,_0x16f4fb=[];for(let _0x44c828=0x1;;_0x44c828+=0x1){const {items:_0x2040d6,paging:_0x10530e}=await listDevUserRoleRelations(_0x24e042,{'roleId':_0x363e0f,'currentPage':_0x44c828,'pageSize':_0x81151b});_0x16f4fb[_0x4acd64(0x214)](..._0x2040d6);if(_0x2040d6[_0x4acd64(0x20b)]<_0x81151b||_0x10530e&&_0x16f4fb['length']>=_0x10530e[_0x4acd64(0x211)])return _0x16f4fb;}}export function readRoleRef(_0x1dff46){const _0x3a39d1=a234_0x19aec3,_0x14acc5=_0x1dff46[_0x3a39d1(0x21c)](_0x3a39d1(0x215))['trim']();if(!_0x14acc5)throw CliErrors['flagMissing']('role',_0x3a39d1(0x1f7));return _0x14acc5;}export async function prepareUserMutation(_0x2b5fdb,_0x139760,_0x4beb70){const _0x5c7d2f=a234_0x19aec3,_0x17f7d1=readRoleRef(_0x2b5fdb),_0x1986ba=_0x2b5fdb[_0x5c7d2f(0x21c)](_0x5c7d2f(0x224))[_0x5c7d2f(0x1f3)]();if(!_0x1986ba)throw CliErrors['flagMissing']('user',_0x5c7d2f(0x20c));const _0x3c41cd=_0x2b5fdb[_0x5c7d2f(0x206)]('expect-user-count'),_0x327a9b=_0x3c41cd===undefined||_0x3c41cd===null?undefined:Number(_0x3c41cd),_0x282001=await resolveRoleRef(_0x2b5fdb['appCode'],_0x17f7d1);if(_0x282001[_0x5c7d2f(0x200)]===_0x5c7d2f(0x21a))throw CliErrors[_0x5c7d2f(0x1f4)](_0x5c7d2f(0x1fd)+_0x139760+_0x5c7d2f(0x218),_0x5c7d2f(0x1df));const _0x1d3447=await resolveUserRef(_0x1986ba),_0x56b2e1=await loadDevRoleRelations(_0x2b5fdb[_0x5c7d2f(0x1f5)],_0x282001['id']);return{...computeRoleUserMutation({'operation':_0x139760,'appCode':_0x2b5fdb[_0x5c7d2f(0x1f5)],'role':_0x282001,'relations':_0x56b2e1,'user':{'userId':_0x1d3447[_0x5c7d2f(0x1e8)],'username':_0x1d3447[_0x5c7d2f(0x1ea)],'nickname':_0x1d3447[_0x5c7d2f(0x208)]},'dryRun':_0x4beb70,..._0x327a9b!==undefined?{'expectUserCount':_0x327a9b}:{}}),'role':_0x282001,'user':_0x1d3447};}
|
|
1
|
+
const a235_0x5c3421=a235_0x3e24;(function(_0xd20ecd,_0x14260f){const _0x5d84c1=a235_0x3e24,_0x3b1e2b=_0xd20ecd();while(!![]){try{const _0x28c11a=-parseInt(_0x5d84c1(0x110))/0x1+parseInt(_0x5d84c1(0x133))/0x2*(parseInt(_0x5d84c1(0x102))/0x3)+parseInt(_0x5d84c1(0xec))/0x4+-parseInt(_0x5d84c1(0xf0))/0x5+parseInt(_0x5d84c1(0x10d))/0x6*(-parseInt(_0x5d84c1(0x139))/0x7)+parseInt(_0x5d84c1(0x10c))/0x8+parseInt(_0x5d84c1(0x11f))/0x9*(parseInt(_0x5d84c1(0x124))/0xa);if(_0x28c11a===_0x14260f)break;else _0x3b1e2b['push'](_0x3b1e2b['shift']());}catch(_0x2fcd95){_0x3b1e2b['push'](_0x3b1e2b['shift']());}}}(a235_0x48f7,0x8620e));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_0x5c3421(0x112),'required':!![],'description':a235_0x5c3421(0x106)};export const ROLE_REF_FLAG={'name':a235_0x5c3421(0x104),'type':a235_0x5c3421(0xf8),'required':!![],'description':a235_0x5c3421(0x12f)};export const USER_REF_FLAG={'name':a235_0x5c3421(0x113),'type':a235_0x5c3421(0xf8),'required':!![],'description':a235_0x5c3421(0xf1)};export const NAME_FLAG={'name':a235_0x5c3421(0x122),'type':a235_0x5c3421(0xf8),'required':!![],'description':a235_0x5c3421(0x115)};export const USER_NAME_FLAG={'name':a235_0x5c3421(0x122),'type':a235_0x5c3421(0xf8),'required':!![],'description':a235_0x5c3421(0x132)};export const REMARK_FLAG={'name':a235_0x5c3421(0x135),'type':a235_0x5c3421(0xf8),'required':![],'description':a235_0x5c3421(0x11c)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x5c3421(0x12e),'type':a235_0x5c3421(0x112),'required':![],'description':a235_0x5c3421(0x10f)};export const BUILTIN_ROLE_TYPES=[a235_0x5c3421(0xee),a235_0x5c3421(0xfa),'OWNER'];export function isBuiltinRole(_0x1460f2){const _0xc8377=a235_0x5c3421;return BUILTIN_ROLE_TYPES[_0xc8377(0x116)](_0x1460f2);}export function assertCustomRole(_0x295968,_0x53a2ed){const _0x205206=a235_0x5c3421;if(_0x295968[_0x205206(0x117)]!==_0x205206(0xff))throw CliErrors[_0x205206(0x107)]('Cannot\x20'+_0x53a2ed+_0x205206(0xf2)+_0x295968[_0x205206(0x111)]+'\x20('+_0x295968[_0x205206(0x117)]+').',_0x205206(0x136));}export function projectRole(_0x717dbd){const _0x296096=a235_0x5c3421;return{'id':_0x717dbd['id'],'roleName':_0x717dbd[_0x296096(0x111)],'roleType':_0x717dbd[_0x296096(0x117)],'remark':_0x717dbd[_0x296096(0x135)],'userCount':_0x717dbd[_0x296096(0x11e)],'permitCount':_0x717dbd[_0x296096(0xea)],'builtin':isBuiltinRole(_0x717dbd[_0x296096(0x117)])};}export async function resolveRoleRef(_0x782472,_0x50afe5){const _0xf536f5=a235_0x5c3421,_0x12d5bc=_0x50afe5[_0xf536f5(0x134)]();if(!_0x12d5bc)throw CliErrors[_0xf536f5(0x107)](_0xf536f5(0x127),_0xf536f5(0x123));if(/^\d+$/[_0xf536f5(0x138)](_0x12d5bc))return getRoleById(_0x782472,Number(_0x12d5bc));const _0x48a1cd=await listAllAppRoles(_0x782472),_0x25fba8=_0x48a1cd[_0xf536f5(0x120)](_0x5e5810=>_0x5e5810[_0xf536f5(0x111)]===_0x12d5bc);if(_0x25fba8[_0xf536f5(0xf4)]===0x0)throw CliErrors['validation'](_0xf536f5(0xfb)+_0x12d5bc+_0xf536f5(0x137)+_0x782472+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x25fba8[_0xf536f5(0xf4)]>0x1){const _0x2c93ea=_0x25fba8[_0xf536f5(0xe9)](_0x1dd860=>_0x1dd860['id'])[_0xf536f5(0xf9)](',\x20');throw CliErrors[_0xf536f5(0x107)](_0xf536f5(0xfb)+_0x12d5bc+_0xf536f5(0x105)+_0x2c93ea+').',_0xf536f5(0xef));}return _0x25fba8[0x0];}export async function getRoleById(_0x18646b,_0x5bc8b2){const _0x2f586=a235_0x5c3421,_0x5f1423=await listAllAppRoles(_0x18646b),_0x345576=_0x5f1423[_0x2f586(0x120)](_0x89eeaf=>_0x89eeaf['id']===_0x5bc8b2&&(!_0x89eeaf[_0x2f586(0xf6)]||_0x89eeaf['appCode']===_0x18646b));if(_0x345576[_0x2f586(0xf4)]!==0x1)throw CliErrors[_0x2f586(0x107)](_0x2f586(0x11b)+_0x5bc8b2+'\x20not\x20found\x20in\x20app\x20'+_0x18646b+'.',_0x2f586(0x12a));return _0x345576[0x0];}async function listAllAppRoles(_0x23dd8c){const _0x7d40d2=a235_0x5c3421,_0x5ae477=0x64,_0x2fcc0e=[];for(let _0x566456=0x1;;_0x566456+=0x1){const {items:_0x46e402,paging:_0x3a7039}=await listAppRoles(_0x23dd8c,{'currentPage':_0x566456,'pageSize':_0x5ae477});_0x2fcc0e[_0x7d40d2(0x119)](..._0x46e402);if(_0x46e402[_0x7d40d2(0xf4)]<_0x5ae477||_0x3a7039&&_0x2fcc0e[_0x7d40d2(0xf4)]>=_0x3a7039[_0x7d40d2(0x129)])return _0x2fcc0e;}}export async function resolveTenantCode(){const _0x113d74=a235_0x5c3421,_0x5c5803=await getSessionUserInfo(),_0x43a129=_0x5c5803?.['user']?.[_0x113d74(0x11a)]?.['tenant_code'];if(!_0x43a129)throw CliErrors['authRequired'](_0x113d74(0x114));return _0x43a129;}function matchMember(_0x4fb9e6,_0x3ee9e4){const _0x2d0ed7=a235_0x5c3421,_0x361107=_0x3ee9e4[_0x2d0ed7(0x134)]()[_0x2d0ed7(0x128)]();return(_0x4fb9e6['nickname']??'')[_0x2d0ed7(0x128)]()===_0x361107||(_0x4fb9e6[_0x2d0ed7(0x101)]??'')['toLowerCase']()===_0x361107;}function a235_0x3e24(_0x10ea9c,_0xc4048c){_0x10ea9c=_0x10ea9c-0xe9;const _0x48f76e=a235_0x48f7();let _0x3e2461=_0x48f76e[_0x10ea9c];return _0x3e2461;}export async function resolveUserRef(_0xf2134b,_0x64eb04=a235_0x5c3421(0xf3)){const _0x23d2bd=a235_0x5c3421,_0x19c2c3=_0xf2134b['trim']();if(!_0x19c2c3)throw CliErrors[_0x23d2bd(0x107)]('Missing\x20user\x20reference.',_0x23d2bd(0xfc));const _0x95730d=await resolveTenantCode(),_0xb8a9b3=await getTenantMembers(_0x95730d);if(/^\d+$/[_0x23d2bd(0x138)](_0x19c2c3)){const _0x382f18=Number(_0x19c2c3),_0x1ea5e8=_0xb8a9b3[_0x23d2bd(0x130)](_0x4d7ed7=>_0x4d7ed7[_0x23d2bd(0xf7)]===_0x382f18);return{'userId':_0x382f18,'username':_0x1ea5e8?.[_0x23d2bd(0x101)]??String(_0x382f18),'nickname':_0x1ea5e8?.['nickname'],'matchedBy':'id'};}const _0x36924c=_0xb8a9b3[_0x23d2bd(0x120)](_0x12603b=>matchMember(_0x12603b,_0x19c2c3));if(_0x36924c[_0x23d2bd(0xf4)]===0x0)throw CliErrors[_0x23d2bd(0x107)](_0x23d2bd(0xfe)+_0x19c2c3+'\x22.',_0x23d2bd(0x12d)+_0x64eb04);if(_0x36924c[_0x23d2bd(0xf4)]>0x1){const _0x200bfe=_0x36924c['map'](_0x57d44=>(_0x57d44[_0x23d2bd(0x126)]??_0x57d44[_0x23d2bd(0x101)]??'?')+'('+_0x57d44[_0x23d2bd(0xf7)]+')')[_0x23d2bd(0xf9)](',\x20');throw CliErrors[_0x23d2bd(0x107)](_0x23d2bd(0x103)+_0x19c2c3+_0x23d2bd(0x125)+_0x200bfe+'.',_0x64eb04);}const _0x8ff251=_0x36924c[0x0];return{'userId':_0x8ff251[_0x23d2bd(0xf7)],'username':_0x8ff251[_0x23d2bd(0x101)]??String(_0x8ff251['userId']),'nickname':_0x8ff251['nickname'],'matchedBy':_0x23d2bd(0x122)};}export const CREATE_USER_ROLE_PATH=a235_0x5c3421(0x100);export const DELETE_USER_ROLE_PATH=a235_0x5c3421(0x10e);function a235_0x48f7(){const _0xf388a2=['OWNER','User\x20','4325056fXYnno','144chimGS','/smartapi/permit/user-role/delete','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','66953KCPDtn','roleName','number','user','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Role\x20name','includes','roleType','expectUserCount','push','tenant','Role\x20id\x20','Optional\x20role\x20remark/description','Anti-drift\x20check\x20failed:\x20expected\x20','userCount','110502ChpYIR','filter','Cannot\x20','name','Pass\x20--role\x20<id|name>.','470qVeiKE','\x22:\x20','nickname','Missing\x20role\x20reference.','toLowerCase','totalCount','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','\x20member(s)\x20but\x20role\x20has\x20','str','Check\x20the\x20nickname/username.\x20','expect-user-count','Role\x20id\x20or\x20exact\x20role\x20name','find','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','10ewfrap','trim','remark','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','\x22\x20not\x20found\x20in\x20app\x20','test','190897ZhhvmF','map','permitCount','\x20is\x20not\x20a\x20member\x20of\x20role\x20','3108160WImSRi',';\x20no\x20change.','ADMIN','Disambiguate\x20with\x20--role\x20<id>.','3344255mMwZUn','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','\x20built-in\x20role\x20','Pass\x20--user\x20<id>.','length','\x20duplicate\x20memberships\x20for\x20user\x20','appCode','userId','string','join','DEV','Role\x20name\x20\x22','Pass\x20--user\x20<id|name>.','flagMissing','No\x20tenant\x20member\x20matches\x20\x22','CUSTOM','/smartapi/permit/user-role/create','username','26976qkpEWG','Multiple\x20tenant\x20members\x20match\x20\x22','role','\x22\x20is\x20ambiguous\x20(ids:\x20','Role\x20id\x20(from\x20`role\x20list`)','validation','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','POST'];a235_0x48f7=function(){return _0xf388a2;};return a235_0x48f7();}export function computeRoleUserMutation(_0x20100c){const _0x2b0ad8=a235_0x5c3421,{operation:_0x1ba0bd,appCode:_0x303ae8,role:_0x3f3c23,relations:_0x5a1c08,user:_0x206e9e}=_0x20100c,_0xdcf4fd=[...new Set(_0x5a1c08[_0x2b0ad8(0xe9)](_0x53a83f=>_0x53a83f[_0x2b0ad8(0xf7)]))],_0x3a73fd=[];if(_0x20100c[_0x2b0ad8(0x118)]!==undefined&&_0x20100c['expectUserCount']!==_0xdcf4fd[_0x2b0ad8(0xf4)])throw CliErrors[_0x2b0ad8(0x107)](_0x2b0ad8(0x11d)+_0x20100c[_0x2b0ad8(0x118)]+_0x2b0ad8(0x12b)+_0xdcf4fd['length']+'.',_0x2b0ad8(0x108));const _0x4496ce=_0xdcf4fd[_0x2b0ad8(0x116)](_0x206e9e[_0x2b0ad8(0xf7)]),_0x2a1036=_0x5a1c08['filter'](_0x461995=>_0x461995[_0x2b0ad8(0xf7)]===_0x206e9e[_0x2b0ad8(0xf7)])[_0x2b0ad8(0xe9)](_0x3aa872=>_0x3aa872['id']),_0x23005c=_0x1ba0bd==='user-add'?!_0x4496ce:_0x4496ce;let _0x463763=_0xdcf4fd;_0x1ba0bd==='user-add'?_0x4496ce?_0x3a73fd[_0x2b0ad8(0x119)](_0x2b0ad8(0x10b)+_0x206e9e[_0x2b0ad8(0xf7)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x3f3c23[_0x2b0ad8(0x111)]+_0x2b0ad8(0xed)):_0x463763=[..._0xdcf4fd,_0x206e9e['userId']]:!_0x4496ce?_0x3a73fd[_0x2b0ad8(0x119)](_0x2b0ad8(0x10b)+_0x206e9e['userId']+_0x2b0ad8(0xeb)+_0x3f3c23[_0x2b0ad8(0x111)]+_0x2b0ad8(0xed)):(_0x463763=_0xdcf4fd[_0x2b0ad8(0x120)](_0x5c62a1=>_0x5c62a1!==_0x206e9e['userId']),_0x2a1036[_0x2b0ad8(0xf4)]>0x1&&_0x3a73fd[_0x2b0ad8(0x119)]('Removed\x20'+_0x2a1036[_0x2b0ad8(0xf4)]+_0x2b0ad8(0xf5)+_0x206e9e[_0x2b0ad8(0xf7)]+'.'));const _0x1ca347={'scope':'dev','operation':_0x1ba0bd,'selector':{'appCode':_0x303ae8,'roleId':_0x3f3c23['id'],'roleName':_0x3f3c23[_0x2b0ad8(0x111)],'userId':_0x206e9e[_0x2b0ad8(0xf7)]},'before':{'userIds':_0xdcf4fd},'after':{'userIds':_0x463763},'dryRun':_0x20100c['dryRun'],'backend':{'method':_0x2b0ad8(0x109),'path':_0x1ba0bd==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x3a73fd};return{'mutation':_0x1ca347,'changed':_0x23005c,'matchingRelationIds':_0x2a1036};}export async function loadDevRoleRelations(_0x595d64,_0x49dadd){const _0x2f2c5e=a235_0x5c3421,_0x103611=0x64,_0x2715ab=[];for(let _0x2976e9=0x1;;_0x2976e9+=0x1){const {items:_0x2ed5ab,paging:_0x37321d}=await listDevUserRoleRelations(_0x595d64,{'roleId':_0x49dadd,'currentPage':_0x2976e9,'pageSize':_0x103611});_0x2715ab[_0x2f2c5e(0x119)](..._0x2ed5ab);if(_0x2ed5ab['length']<_0x103611||_0x37321d&&_0x2715ab[_0x2f2c5e(0xf4)]>=_0x37321d[_0x2f2c5e(0x129)])return _0x2715ab;}}export function readRoleRef(_0x13e228){const _0x116500=a235_0x5c3421,_0x50a1ce=_0x13e228['str']('role')[_0x116500(0x134)]();if(!_0x50a1ce)throw CliErrors[_0x116500(0xfd)](_0x116500(0x104),_0x116500(0x123));return _0x50a1ce;}export async function prepareUserMutation(_0x3a3471,_0x173804,_0x1dfa04){const _0x29ba72=a235_0x5c3421,_0x3c3f62=readRoleRef(_0x3a3471),_0x7a7824=_0x3a3471[_0x29ba72(0x12c)](_0x29ba72(0x113))[_0x29ba72(0x134)]();if(!_0x7a7824)throw CliErrors['flagMissing'](_0x29ba72(0x113),'Pass\x20--user\x20<id|name>.');const _0x43f9d1=_0x3a3471['flag'](_0x29ba72(0x12e)),_0x412f4b=_0x43f9d1===undefined||_0x43f9d1===null?undefined:Number(_0x43f9d1),_0x5846cd=await resolveRoleRef(_0x3a3471[_0x29ba72(0xf6)],_0x3c3f62);if(_0x5846cd[_0x29ba72(0x117)]===_0x29ba72(0x10a))throw CliErrors[_0x29ba72(0x107)](_0x29ba72(0x121)+_0x173804+'\x20members\x20of\x20the\x20OWNER\x20role.',_0x29ba72(0x131));const _0x43a470=await resolveUserRef(_0x7a7824),_0x59c828=await loadDevRoleRelations(_0x3a3471['appCode'],_0x5846cd['id']);return{...computeRoleUserMutation({'operation':_0x173804,'appCode':_0x3a3471[_0x29ba72(0xf6)],'role':_0x5846cd,'relations':_0x59c828,'user':{'userId':_0x43a470[_0x29ba72(0xf7)],'username':_0x43a470['username'],'nickname':_0x43a470[_0x29ba72(0x126)]},'dryRun':_0x1dfa04,..._0x412f4b!==undefined?{'expectUserCount':_0x412f4b}:{}}),'role':_0x5846cd,'user':_0x43a470};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a236_0x2dce3e=a236_0xbdeb;(function(_0x4dc4f7,_0x1988b1){const _0x4ad79a=a236_0xbdeb,_0x562b80=_0x4dc4f7();while(!![]){try{const _0x41cfe7=parseInt(_0x4ad79a(0x1d6))/0x1*(-parseInt(_0x4ad79a(0x1d2))/0x2)+-parseInt(_0x4ad79a(0x1ca))/0x3+parseInt(_0x4ad79a(0x1da))/0x4+parseInt(_0x4ad79a(0x1cb))/0x5+parseInt(_0x4ad79a(0x1d5))/0x6*(parseInt(_0x4ad79a(0x1db))/0x7)+parseInt(_0x4ad79a(0x1d0))/0x8+parseInt(_0x4ad79a(0x1cd))/0x9*(-parseInt(_0x4ad79a(0x1de))/0xa);if(_0x41cfe7===_0x1988b1)break;else _0x562b80['push'](_0x562b80['shift']());}catch(_0x55077a){_0x562b80['push'](_0x562b80['shift']());}}}(a236_0x361c,0xbcb6e));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_0x2dce3e(0x1df);function a236_0x361c(){const _0x48a913=['dev','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','3341946kEewAC','7534805ZgYBrd','validation','9IzPqdg','string','POST','2403776WDtekg','num','43146vXUziu','write','name','174tdKwNZ','39WEzHCD','roleName','Updated\x20role\x20','flag','2963136EDzlAm','140749KjCXXO','Nothing\x20to\x20update.','trim','4030170BLvAza','/smartapi/permit/role/update','--name\x20cannot\x20be\x20empty.','remark','update','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','appCode'];a236_0x361c=function(){return _0x48a913;};return a236_0x361c();}function readPatch(_0xf92e9a){const _0x22c38b=a236_0x2dce3e,_0x5babac=_0xf92e9a[_0x22c38b(0x1d9)]('name'),_0x44cf8a=_0xf92e9a[_0x22c38b(0x1d9)](_0x22c38b(0x1c4)),_0x47f496={};if(_0x5babac!==undefined&&_0x5babac!==null){const _0x3043da=String(_0x5babac)[_0x22c38b(0x1dd)]();if(!_0x3043da)throw CliErrors[_0x22c38b(0x1cc)](_0x22c38b(0x1c3));if(_0x3043da['length']>0x40)throw CliErrors[_0x22c38b(0x1cc)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x47f496[_0x22c38b(0x1d7)]=_0x3043da;}_0x44cf8a!==undefined&&_0x44cf8a!==null&&(_0x47f496[_0x22c38b(0x1c4)]=String(_0x44cf8a));if(_0x47f496['roleName']===undefined&&_0x47f496[_0x22c38b(0x1c4)]===undefined)throw CliErrors[_0x22c38b(0x1cc)](_0x22c38b(0x1dc),_0x22c38b(0x1c6));return _0x47f496;}function a236_0xbdeb(_0x48e654,_0x461bf4){_0x48e654=_0x48e654-0x1c3;const _0x361cbe=a236_0x361c();let _0xbdebdc=_0x361cbe[_0x48e654];return _0xbdebdc;}export const roleUpdate={'service':'role','command':a236_0x2dce3e(0x1c5),'description':a236_0x2dce3e(0x1c9),'risk':a236_0x2dce3e(0x1d3),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0x2dce3e(0x1d4),'type':a236_0x2dce3e(0x1ce),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5c476f){readPatch(_0x5c476f);},async 'dryRun'(_0x31fd3b){const _0x2ac6bb=a236_0x2dce3e,_0x232bb4=_0x31fd3b[_0x2ac6bb(0x1d1)]('id'),_0x1cb888=readPatch(_0x31fd3b),_0x2c91e2=await getRoleById(_0x31fd3b[_0x2ac6bb(0x1c7)],_0x232bb4);return assertCustomRole(_0x2c91e2,_0x2ac6bb(0x1c5)),asDryRunResult({'scope':_0x2ac6bb(0x1c8),'operation':_0x2ac6bb(0x1c5),'selector':{'appCode':_0x31fd3b[_0x2ac6bb(0x1c7)],'roleId':_0x232bb4,'roleName':_0x2c91e2[_0x2ac6bb(0x1d7)]},'before':projectRole(_0x2c91e2),'after':projectRole({..._0x2c91e2,..._0x1cb888[_0x2ac6bb(0x1d7)]!==undefined?{'roleName':_0x1cb888[_0x2ac6bb(0x1d7)]}:{},..._0x1cb888['remark']!==undefined?{'remark':_0x1cb888[_0x2ac6bb(0x1c4)]}:{}}),'dryRun':!![],'backend':{'method':_0x2ac6bb(0x1cf),'path':UPDATE_PATH},'warnings':[]},{'method':_0x2ac6bb(0x1cf),'url':UPDATE_PATH});},async 'execute'(_0x1af3b2){const _0x223466=a236_0x2dce3e,_0x54f501=_0x1af3b2[_0x223466(0x1d1)]('id'),_0x57f4ce=readPatch(_0x1af3b2),_0x173a48=await getRoleById(_0x1af3b2[_0x223466(0x1c7)],_0x54f501);assertCustomRole(_0x173a48,_0x223466(0x1c5)),await updateAppRole({'id':_0x54f501,'appCode':_0x1af3b2[_0x223466(0x1c7)],..._0x57f4ce[_0x223466(0x1d7)]!==undefined?{'roleName':_0x57f4ce[_0x223466(0x1d7)]}:{},..._0x57f4ce[_0x223466(0x1c4)]!==undefined?{'remark':_0x57f4ce[_0x223466(0x1c4)]}:{}});const _0x455aaf=await getRoleById(_0x1af3b2[_0x223466(0x1c7)],_0x54f501);return{'ok':!![],'data':{'scope':_0x223466(0x1c8),'operation':_0x223466(0x1c5),'selector':{'appCode':_0x1af3b2[_0x223466(0x1c7)],'roleId':_0x54f501,'roleName':_0x455aaf[_0x223466(0x1d7)]},'before':projectRole(_0x173a48),'after':projectRole(_0x455aaf),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x223466(0x1d8)+_0x455aaf[_0x223466(0x1d7)]+'\x20(id='+_0x54f501+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a237_0x3d1c(){const _0x3793e5=['8BkwJgE','8sgoAst','18823541lIHEsc','20pvbYoY','user-add','93576qGKLOR','selector','userId','5895533ABdNRa','9544140kOHIkv','No\x20change:\x20user\x20','roleName','1166140cjzJoC','username','roleId','Added\x20user\x20','82130ddafzA','403032GbbofG','POST','high-risk-write','roleType','appCode','role','348NpBNEx'];a237_0x3d1c=function(){return _0x3793e5;};return a237_0x3d1c();}const a237_0x47bb0a=a237_0x55d0;function a237_0x55d0(_0x473989,_0x1fb8e8){_0x473989=_0x473989-0x1d6;const _0x3d1cbf=a237_0x3d1c();let _0x55d0f8=_0x3d1cbf[_0x473989];return _0x55d0f8;}(function(_0x3f821d,_0x3d305e){const _0x517e2b=a237_0x55d0,_0x4fd267=_0x3f821d();while(!![]){try{const _0x17aa68=parseInt(_0x517e2b(0x1df))/0x1*(-parseInt(_0x517e2b(0x1e4))/0x2)+parseInt(_0x517e2b(0x1d8))/0x3+parseInt(_0x517e2b(0x1eb))/0x4+parseInt(_0x517e2b(0x1d7))/0x5*(-parseInt(_0x517e2b(0x1de))/0x6)+parseInt(_0x517e2b(0x1e7))/0x7*(-parseInt(_0x517e2b(0x1e0))/0x8)+-parseInt(_0x517e2b(0x1e8))/0x9+parseInt(_0x517e2b(0x1e2))/0xa*(parseInt(_0x517e2b(0x1e1))/0xb);if(_0x17aa68===_0x3d305e)break;else _0x4fd267['push'](_0x4fd267['shift']());}catch(_0x3608c4){_0x4fd267['push'](_0x4fd267['shift']());}}}(a237_0x3d1c,0x9709a));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';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_0x47bb0a(0x1dd),'command':a237_0x47bb0a(0x1e3),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a237_0x47bb0a(0x1da),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4d2f9a){const _0x33a2a6=a237_0x47bb0a,{mutation:_0x3f5e28}=await prepareUserMutation(_0x4d2f9a,_0x33a2a6(0x1e3),!![]);return asDryRunResult(_0x3f5e28,{'method':_0x33a2a6(0x1d9),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x39d148){const _0x25410c=a237_0x47bb0a,{mutation:_0x10bcd5,changed:_0xcba870,role:_0x535ca9,user:_0x444204}=await prepareUserMutation(_0x39d148,_0x25410c(0x1e3),![]);return _0xcba870&&await createDevUserRole({'appCode':_0x39d148[_0x25410c(0x1dc)],'userId':_0x444204[_0x25410c(0x1e6)],'username':_0x444204[_0x25410c(0x1ec)],'roleType':_0x535ca9[_0x25410c(0x1db)],'roleId':_0x10bcd5[_0x25410c(0x1e5)][_0x25410c(0x1ed)]}),{'ok':!![],'data':_0x10bcd5,'message':_0xcba870?_0x25410c(0x1d6)+_0x10bcd5[_0x25410c(0x1e5)]['userId']+'\x20to\x20role\x20'+_0x10bcd5[_0x25410c(0x1e5)][_0x25410c(0x1ea)]:_0x25410c(0x1e9)+_0x10bcd5[_0x25410c(0x1e5)]['userId']+'\x20already\x20in\x20role\x20'+_0x10bcd5[_0x25410c(0x1e5)][_0x25410c(0x1ea)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a238_0x351d24=a238_0x237c;(function(_0x27c63d,_0x6164e3){const _0x3af86e=a238_0x237c,_0x52aa9a=_0x27c63d();while(!![]){try{const _0x111aa6=parseInt(_0x3af86e(0x6b))/0x1+-parseInt(_0x3af86e(0x77))/0x2*(-parseInt(_0x3af86e(0x76))/0x3)+-parseInt(_0x3af86e(0x6c))/0x4*(parseInt(_0x3af86e(0x70))/0x5)+-parseInt(_0x3af86e(0x6d))/0x6*(parseInt(_0x3af86e(0x78))/0x7)+parseInt(_0x3af86e(0x79))/0x8*(parseInt(_0x3af86e(0x6e))/0x9)+parseInt(_0x3af86e(0x6f))/0xa+-parseInt(_0x3af86e(0x7a))/0xb;if(_0x111aa6===_0x6164e3)break;else _0x52aa9a['push'](_0x52aa9a['shift']());}catch(_0xd00df8){_0x52aa9a['push'](_0x52aa9a['shift']());}}}(a238_0x41bd,0xb0df8));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a238_0x237c(_0x2ab349,_0x5d52e0){_0x2ab349=_0x2ab349-0x6a;const _0x41bda1=a238_0x41bd();let _0x237cbc=_0x41bda1[_0x2ab349];return _0x237cbc;}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_0x41bd(){const _0x44fc3f=['Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','high-risk-write','1368165MowxIe','1842124SafAyh','12tcbMLJ','958077HpGdzt','4022340xQldvS','5EslTve','role','roleName','userId','user-remove','selector','2709651HpVmkP','2TLvUEe','4621442CvVirx','104jdwNiw','17072990LruxyA','No\x20change:\x20user\x20'];a238_0x41bd=function(){return _0x44fc3f;};return a238_0x41bd();}export const roleUserRemove={'service':a238_0x351d24(0x71),'command':a238_0x351d24(0x74),'description':a238_0x351d24(0x7c),'risk':a238_0x351d24(0x6a),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2f3972){const _0x253617=a238_0x351d24,{mutation:_0x326e37}=await prepareUserMutation(_0x2f3972,_0x253617(0x74),!![]);return asDryRunResult(_0x326e37,{'method':'POST','url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x430c9c){const _0xb2e832=a238_0x351d24,{matchingRelationIds:_0x2eb8ae,mutation:_0x3db4ff,changed:_0x373f30}=await prepareUserMutation(_0x430c9c,_0xb2e832(0x74),![]);if(_0x373f30)for(const _0xc9bfc of _0x2eb8ae){await deleteDevUserRole(_0xc9bfc);}return{'ok':!![],'data':_0x3db4ff,'message':_0x373f30?'Removed\x20user\x20'+_0x3db4ff[_0xb2e832(0x75)]['userId']+'\x20from\x20role\x20'+_0x3db4ff[_0xb2e832(0x75)]['roleName']:_0xb2e832(0x7b)+_0x3db4ff[_0xb2e832(0x75)][_0xb2e832(0x73)]+'\x20not\x20in\x20role\x20'+_0x3db4ff['selector'][_0xb2e832(0x72)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a239_0x7097(){const _0x1833f4=['522417CzGrVy','30yiMCHg','592758IWEjle','2205071sQDzjT','read','str','Resolved\x20\x22','696965uofiZF','137896ydsKBU','2195320ZXDEQX','user-resolve','\x22\x20→\x20userId\x20','nickname','1320633IgXpXE','role','matchedBy','Pass\x20--name\x20<nickname|username>.','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','userId','name','4mlBmyB','20NcajRu','8pUDRra','username','flagMissing'];a239_0x7097=function(){return _0x1833f4;};return a239_0x7097();}const a239_0x1f1d81=a239_0x1e25;(function(_0x209ea0,_0x27e636){const _0x556f0b=a239_0x1e25,_0xed1f91=_0x209ea0();while(!![]){try{const _0x554314=-parseInt(_0x556f0b(0x1d8))/0x1*(parseInt(_0x556f0b(0x1e5))/0x2)+-parseInt(_0x556f0b(0x1ec))/0x3+-parseInt(_0x556f0b(0x1e7))/0x4*(-parseInt(_0x556f0b(0x1d7))/0x5)+-parseInt(_0x556f0b(0x1eb))/0x6*(-parseInt(_0x556f0b(0x1ea))/0x7)+parseInt(_0x556f0b(0x1d9))/0x8+parseInt(_0x556f0b(0x1dd))/0x9+parseInt(_0x556f0b(0x1e6))/0xa*(-parseInt(_0x556f0b(0x1ed))/0xb);if(_0x554314===_0x27e636)break;else _0xed1f91['push'](_0xed1f91['shift']());}catch(_0x5c28ed){_0xed1f91['push'](_0xed1f91['shift']());}}}(a239_0x7097,0x30889));import{CliErrors}from'../../errors.js';function a239_0x1e25(_0xf01b9a,_0x447828){_0xf01b9a=_0xf01b9a-0x1d5;const _0x70979a=a239_0x7097();let _0x1e2534=_0x70979a[_0xf01b9a];return _0x1e2534;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a239_0x1f1d81(0x1de),'command':a239_0x1f1d81(0x1da),'description':a239_0x1f1d81(0x1e2),'risk':a239_0x1f1d81(0x1ee),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3f11c6){const _0xf3e756=a239_0x1f1d81;if(!_0x3f11c6[_0xf3e756(0x1d5)](_0xf3e756(0x1e4))['trim']())throw CliErrors[_0xf3e756(0x1e9)](_0xf3e756(0x1e4),_0xf3e756(0x1e0));},async 'execute'(_0xe5cd71){const _0x2e6cd6=a239_0x1f1d81,_0x157a67=_0xe5cd71[_0x2e6cd6(0x1d5)](_0x2e6cd6(0x1e4))['trim'](),_0x9e0f43=await resolveUserRef(_0x157a67,_0x2e6cd6(0x1e1));return{'ok':!![],'data':{'user':{'userId':_0x9e0f43[_0x2e6cd6(0x1e3)],'username':_0x9e0f43[_0x2e6cd6(0x1e8)],'nickname':_0x9e0f43[_0x2e6cd6(0x1dc)],'matchedBy':_0x9e0f43[_0x2e6cd6(0x1df)]}},'message':_0x2e6cd6(0x1d6)+_0x157a67+_0x2e6cd6(0x1db)+_0x9e0f43[_0x2e6cd6(0x1e3)]};}};
|
package/lib/commands/rule/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a240_0x124f97=a240_0x5d3e;(function(_0x1ab3ff,_0x52fd71){const _0xa04b00=a240_0x5d3e,_0x59f6ce=_0x1ab3ff();while(!![]){try{const _0x56223f=-parseInt(_0xa04b00(0x1b8))/0x1*(parseInt(_0xa04b00(0x1ae))/0x2)+-parseInt(_0xa04b00(0x1b2))/0x3+parseInt(_0xa04b00(0x1b0))/0x4+parseInt(_0xa04b00(0x1b3))/0x5*(parseInt(_0xa04b00(0x1ad))/0x6)+-parseInt(_0xa04b00(0x1b1))/0x7+-parseInt(_0xa04b00(0x1c2))/0x8*(-parseInt(_0xa04b00(0x1bd))/0x9)+-parseInt(_0xa04b00(0x1c0))/0xa*(-parseInt(_0xa04b00(0x1c1))/0xb);if(_0x56223f===_0x52fd71)break;else _0x59f6ce['push'](_0x59f6ce['shift']());}catch(_0x827d14){_0x59f6ce['push'](_0x59f6ce['shift']());}}}(a240_0x3770,0x7774c));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';function a240_0x3770(){const _0x32edd8=['Loaded\x20','2636580drnHYR','5056282PmbMxc','2590620YoePaq','1770tRhCuY','rule','\x20for\x20','cookie','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','503921wYcosP','\x20is\x20not\x20configured\x20for\x20app\x20','appCode','\x20--file\x20<path>\x20--dry-run`.','app_rule_not_found','7398711zggCUj','read','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','1639930MEUyBu','55aRIyBv','8FflrzT','content','4710jHvmAR','2KDwjnz'];a240_0x3770=function(){return _0x32edd8;};return a240_0x3770();}function a240_0x5d3e(_0x4ddd16,_0x1e8af8){_0x4ddd16=_0x4ddd16-0x1ac;const _0x377085=a240_0x3770();let _0x5d3eef=_0x377085[_0x4ddd16];return _0x5d3eef;}export const ruleGet={'service':a240_0x124f97(0x1b4),'command':'get','description':a240_0x124f97(0x1bf),'risk':a240_0x124f97(0x1be),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x321d84){readAppRuleType(_0x321d84);},async 'execute'(_0x3615b9){const _0x2563ce=a240_0x124f97,_0x30f98c=readAppRuleType(_0x3615b9),_0xb2faa3=await getAppRule(_0x3615b9[_0x2563ce(0x1b6)],{'appCode':_0x3615b9[_0x2563ce(0x1ba)],'type':_0x30f98c});if(!_0xb2faa3)throw appRuleError(_0x2563ce(0x1bc),appRuleFileName(_0x30f98c)+_0x2563ce(0x1b9)+_0x3615b9['appCode']+'.',_0x2563ce(0x1b7)+_0x30f98c+_0x2563ce(0x1bb));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x30f98c,_0xb2faa3),'content':_0xb2faa3[_0x2563ce(0x1ac)]}},'message':_0x2563ce(0x1af)+appRuleFileName(_0x30f98c)+_0x2563ce(0x1b5)+_0x3615b9['appCode']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x157a9c,_0x2fe36d){const _0x2bec21=a241_0x25f0,_0x17fa51=_0x157a9c();while(!![]){try{const _0x54629a=parseInt(_0x2bec21(0x84))/0x1*(parseInt(_0x2bec21(0x83))/0x2)+parseInt(_0x2bec21(0x85))/0x3+-parseInt(_0x2bec21(0x81))/0x4+-parseInt(_0x2bec21(0x86))/0x5+-parseInt(_0x2bec21(0x7f))/0x6*(parseInt(_0x2bec21(0x80))/0x7)+parseInt(_0x2bec21(0x88))/0x8*(-parseInt(_0x2bec21(0x87))/0x9)+parseInt(_0x2bec21(0x82))/0xa*(parseInt(_0x2bec21(0x89))/0xb);if(_0x54629a===_0x2fe36d)break;else _0x17fa51['push'](_0x17fa51['shift']());}catch(_0x2ca251){_0x17fa51['push'](_0x17fa51['shift']());}}}(a241_0x4614,0x20d3f));function a241_0x25f0(_0x518d44,_0x55ddba){_0x518d44=_0x518d44-0x7f;const _0x461405=a241_0x4614();let _0x25f027=_0x461405[_0x518d44];return _0x25f027;}import{ruleGet}from'../../commands/rule/get.js';function a241_0x4614(){const _0x4b4783=['707YPWeqj','840208KPyltS','52810twRToF','712Ymycfi','433oLKilw','71931DfPezN','159590MaSlyG','1021338NAaQeL','16ophOAP','1441IKOLdi','15834Vazzmm'];a241_0x4614=function(){return _0x4b4783;};return a241_0x4614();}import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a242_0x5dba5c=a242_0x592e;(function(_0x4eddb0,_0x2dd4fe){const _0x3d4fa7=a242_0x592e,_0xee104b=_0x4eddb0();while(!![]){try{const _0x38b266=-parseInt(_0x3d4fa7(0xc2))/0x1+-parseInt(_0x3d4fa7(0xbb))/0x2+parseInt(_0x3d4fa7(0xc7))/0x3+-parseInt(_0x3d4fa7(0xbc))/0x4*(-parseInt(_0x3d4fa7(0xc6))/0x5)+-parseInt(_0x3d4fa7(0xbf))/0x6+-parseInt(_0x3d4fa7(0xba))/0x7+parseInt(_0x3d4fa7(0xbd))/0x8;if(_0x38b266===_0x2dd4fe)break;else _0xee104b['push'](_0xee104b['shift']());}catch(_0x405e29){_0xee104b['push'](_0xee104b['shift']());}}}(a242_0x2077,0x7d6f9));function a242_0x592e(_0x13eb62,_0x3ded48){_0x13eb62=_0x13eb62-0xb9;const _0x207752=a242_0x2077();let _0x592e73=_0x207752[_0x13eb62];return _0x592e73;}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':a242_0x5dba5c(0xc5),'command':a242_0x5dba5c(0xc1),'description':a242_0x5dba5c(0xb9),'risk':a242_0x5dba5c(0xc9),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x500efc){const _0x5ebaef=a242_0x5dba5c,_0x3098e4=await Promise[_0x5ebaef(0xbe)](APP_RULE_TYPES[_0x5ebaef(0xca)](_0x1d865d=>getAppRule(_0x500efc[_0x5ebaef(0xc3)],{'appCode':_0x500efc['appCode'],'type':_0x1d865d}))),_0x18b822=APP_RULE_TYPES['map']((_0x37bfe0,_0x17810a)=>projectAppRule(_0x37bfe0,_0x3098e4[_0x17810a]??null));return{'ok':!![],'data':{'total':_0x18b822[_0x5ebaef(0xc8)],'rules':_0x18b822},'message':_0x5ebaef(0xc4)+_0x500efc[_0x5ebaef(0xc0)]};}};function a242_0x2077(){const _0x4d3738=['List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','5140212ArTRGV','1482776EgDFOQ','1439224oNqqCb','19220016ErFKhU','all','5220132ecdCZm','appCode','list','490580FmstUM','cookie','Loaded\x20app\x20rule\x20configuration\x20for\x20','rule','5vMoccW','1763349AXNDHc','length','read','map'];a242_0x2077=function(){return _0x4d3738;};return a242_0x2077();}
|
package/lib/commands/rule/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a243_0x42ce15=a243_0x48bd;(function(_0x5da8a8,_0x335fe9){const _0x56ec13=a243_0x48bd,_0x2c0044=_0x5da8a8();while(!![]){try{const _0x53c667=-parseInt(_0x56ec13(0x145))/0x1*(-parseInt(_0x56ec13(0x13b))/0x2)+parseInt(_0x56ec13(0x12e))/0x3+parseInt(_0x56ec13(0x150))/0x4*(-parseInt(_0x56ec13(0x14e))/0x5)+-parseInt(_0x56ec13(0x13d))/0x6*(-parseInt(_0x56ec13(0x146))/0x7)+-parseInt(_0x56ec13(0x134))/0x8+parseInt(_0x56ec13(0x141))/0x9+-parseInt(_0x56ec13(0x12f))/0xa;if(_0x53c667===_0x335fe9)break;else _0x2c0044['push'](_0x2c0044['shift']());}catch(_0x4e4462){_0x2c0044['push'](_0x2c0044['shift']());}}}(a243_0x4e4d,0xdc2c1));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';const SAVE_PATH=a243_0x42ce15(0x152),NON_ATOMIC_WARNING=a243_0x42ce15(0x148);function readSetInput(_0x1fd813){const _0x2a172d=a243_0x42ce15,_0x56411b=readAppRuleType(_0x1fd813),_0x5cb30d=_0x1fd813[_0x2a172d(0x163)](_0x2a172d(0x153))[_0x2a172d(0x123)]();if(!_0x5cb30d)throw appRuleError(_0x2a172d(0x151),_0x2a172d(0x127),_0x2a172d(0x12c));const _0x18d5f1=_0x1fd813[_0x2a172d(0x124)](_0x2a172d(0x139));let _0x2d5712;if(_0x18d5f1!==undefined){_0x2d5712=Number(_0x18d5f1);if(!Number[_0x2a172d(0x157)](_0x2d5712)||_0x2d5712<0x0)throw appRuleError(_0x2a172d(0x125),_0x2a172d(0x128));}return{'type':_0x56411b,'file':_0x5cb30d,'expectedVersion':_0x2d5712};}async function prepareSet(_0x4e27f6){const _0x3d06c3=a243_0x42ce15,_0x49c62d=readSetInput(_0x4e27f6),_0x4438e9=await readAppRuleFile(_0x49c62d[_0x3d06c3(0x153)]),_0x16918f=await getAppRule(_0x4e27f6[_0x3d06c3(0x15e)],{'appCode':_0x4e27f6[_0x3d06c3(0x15a)],'type':_0x49c62d['type']});if(_0x49c62d[_0x3d06c3(0x142)]!==undefined&&_0x16918f?.['version']!==_0x49c62d['expectedVersion'])throw appRuleError(_0x3d06c3(0x143),appRuleFileName(_0x49c62d['type'])+'\x20version\x20changed\x20before\x20write.',_0x3d06c3(0x15f)+_0x49c62d[_0x3d06c3(0x142)]+_0x3d06c3(0x160)+(_0x16918f?.[_0x3d06c3(0x132)]??_0x3d06c3(0x14c))+_0x3d06c3(0x122));return{'input':_0x49c62d,'replacement':_0x4438e9,'beforeRecord':_0x16918f,'before':projectAppRule(_0x49c62d[_0x3d06c3(0x159)],_0x16918f),'planned':{'type':_0x49c62d[_0x3d06c3(0x159)],'fileName':appRuleFileName(_0x49c62d['type']),'contextScope':appRuleContextScope(_0x49c62d[_0x3d06c3(0x159)]),'enabled':!![],'appCode':_0x4e27f6[_0x3d06c3(0x15a)],'scope':_0x3d06c3(0x137),'contentByteSize':_0x4438e9[_0x3d06c3(0x161)],'contentHash':_0x4438e9[_0x3d06c3(0x129)]}};}function a243_0x48bd(_0x126718,_0x5b47b2){_0x126718=_0x126718-0x122;const _0x4e4de2=a243_0x4e4d();let _0x48bd27=_0x4e4de2[_0x126718];return _0x48bd27;}function warningsFor(_0x49ae6d){return _0x49ae6d===undefined?[]:[NON_ATOMIC_WARNING];}export const ruleSet={'service':a243_0x42ce15(0x131),'command':a243_0x42ce15(0x14d),'description':a243_0x42ce15(0x13a),'risk':a243_0x42ce15(0x162),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x42ce15(0x153),'type':a243_0x42ce15(0x14a),'required':!![],'description':a243_0x42ce15(0x144)},{'name':a243_0x42ce15(0x139),'type':a243_0x42ce15(0x14b),'required':![],'description':a243_0x42ce15(0x15c)}],async 'validate'(_0x3d4fae){readSetInput(_0x3d4fae);},async 'dryRun'(_0xe7c2fc){const _0x22dd7c=a243_0x42ce15,_0x3a83d0=await prepareSet(_0xe7c2fc);return asDryRunResult({'operation':_0x22dd7c(0x14d),'selector':{'appCode':_0xe7c2fc[_0x22dd7c(0x15a)],'scope':_0x22dd7c(0x137),'type':_0x3a83d0[_0x22dd7c(0x133)][_0x22dd7c(0x159)]},'before':_0x3a83d0[_0x22dd7c(0x13f)],'after':_0x3a83d0['planned'],'dryRun':!![],'backend':{'method':'POST','path':SAVE_PATH},'warnings':warningsFor(_0x3a83d0[_0x22dd7c(0x133)][_0x22dd7c(0x142)]),'verification':{'expectedVersion':_0x3a83d0[_0x22dd7c(0x133)][_0x22dd7c(0x142)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x22dd7c(0x156)+_0x3a83d0[_0x22dd7c(0x133)][_0x22dd7c(0x159)]+'\x20--format\x20compress'}},{'method':'POST','url':SAVE_PATH});},async 'execute'(_0x4ac171){const _0x4df375=a243_0x42ce15,_0x3a761c=await prepareSet(_0x4ac171);let _0x4d5571=![];try{await saveAppRule(_0x4ac171[_0x4df375(0x15e)],{'appCode':_0x4ac171['appCode'],'type':_0x3a761c[_0x4df375(0x133)][_0x4df375(0x159)],'content':_0x3a761c[_0x4df375(0x126)][_0x4df375(0x158)]});}catch(_0x277a86){if(!isPlatformTransportFailure(_0x277a86))throw _0x277a86;_0x4d5571=!![];}let _0x4bb546;try{_0x4bb546=await getAppRule(_0x4ac171[_0x4df375(0x15e)],{'appCode':_0x4ac171[_0x4df375(0x15a)],'type':_0x3a761c[_0x4df375(0x133)]['type']});}catch(_0xe516fc){const _0x4d9cf2=appRuleError(_0x4d5571?_0x4df375(0x136):_0x4df375(0x15b),'The\x20set\x20request\x20was\x20sent,\x20but\x20'+appRuleFileName(_0x3a761c[_0x4df375(0x133)][_0x4df375(0x159)])+_0x4df375(0x135),_0x4df375(0x154));Object[_0x4df375(0x147)](_0x4d9cf2,_0x4df375(0x14f),{'value':_0xe516fc,'enumerable':![]});throw _0x4d9cf2;}const _0x4fe286=_0x4bb546&&inspectAppRuleContent(_0x4bb546['content'])[_0x4df375(0x129)]===_0x3a761c[_0x4df375(0x126)][_0x4df375(0x129)],_0x3169e7=_0x4bb546&&(_0x3a761c[_0x4df375(0x149)]===null||_0x4bb546[_0x4df375(0x132)]>_0x3a761c[_0x4df375(0x149)][_0x4df375(0x132)]);if(!_0x4bb546||!_0x4fe286||!_0x3169e7)throw appRuleError(_0x4d5571?_0x4df375(0x136):_0x4df375(0x155),appRuleFileName(_0x3a761c[_0x4df375(0x133)][_0x4df375(0x159)])+_0x4df375(0x140),_0x4df375(0x12b)+_0x3a761c[_0x4df375(0x133)][_0x4df375(0x159)]+_0x4df375(0x138));const _0xc2ed42=warningsFor(_0x3a761c[_0x4df375(0x133)][_0x4df375(0x142)]);_0x4d5571&&_0xc2ed42[_0x4df375(0x130)]('Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.');const _0xfb1830=projectAppRule(_0x3a761c[_0x4df375(0x133)][_0x4df375(0x159)],_0x4bb546);return{'ok':!![],'data':{'operation':_0x4df375(0x14d),'selector':{'appCode':_0x4ac171[_0x4df375(0x15a)],'scope':_0x4df375(0x137),'type':_0x3a761c[_0x4df375(0x133)]['type']},'before':_0x3a761c[_0x4df375(0x13f)],'after':_0xfb1830,'dryRun':![],'backend':{'method':_0x4df375(0x15d),'path':SAVE_PATH},'warnings':_0xc2ed42,'verification':{'status':_0x4df375(0x12a),'recoveredAfterUnknownResponse':_0x4d5571,'expectedVersion':_0x3a761c[_0x4df375(0x133)][_0x4df375(0x142)]??null,'atomicCompareAndSet':![],'lookupCommand':'rabetbase\x20rule\x20get\x20--type\x20'+_0x3a761c['input'][_0x4df375(0x159)]+_0x4df375(0x13e)}},'message':_0x4df375(0x13c)+appRuleFileName(_0x3a761c[_0x4df375(0x133)][_0x4df375(0x159)])+_0x4df375(0x12d)+_0x4ac171[_0x4df375(0x15a)]};}};function a243_0x4e4d(){const _0x5a62f9=['type','appCode','app_rule_verification_unavailable','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','POST','cookie','Expected\x20',';\x20current\x20version\x20is\x20','byteSize','write','str','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','trim','flag','app_rule_expected_version_invalid','replacement','--file\x20is\x20required.','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','contentHash','verified','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','Pass\x20a\x20UTF-8\x20Markdown\x20file.','\x20for\x20','2781036VqmoKI','16118510WcXHuw','push','rule','version','input','13808152fFXBZf','\x20could\x20not\x20be\x20verified.','app_rule_set_outcome_unknown','rules','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','expected-version','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','1609620XYjLqH','Set\x20','1386996tmhPZJ','\x20--format\x20compress','before','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','14073255IUnqFQ','expectedVersion','app_rule_version_mismatch','UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)','1btvWeT','49zHWZuH','defineProperty','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.','beforeRecord','string','number','unconfigured','set','105310QnXVNh','cause','128rPRzMl','app_rule_file_required','/smartapi/knowledge-base/save','file','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','app_rule_verification_failed','rabetbase\x20rule\x20get\x20--type\x20','isSafeInteger','content'];a243_0x4e4d=function(){return _0x5a62f9;};return a243_0x4e4d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a244_0x39dc7b=a244_0x3c8b;(function(_0x35ebdc,_0x1da223){const _0x32e282=a244_0x3c8b,_0x58ddd7=_0x35ebdc();while(!![]){try{const _0x58c8f5=-parseInt(_0x32e282(0xc2))/0x1+-parseInt(_0x32e282(0xc5))/0x2*(-parseInt(_0x32e282(0xac))/0x3)+parseInt(_0x32e282(0xb7))/0x4*(parseInt(_0x32e282(0xb5))/0x5)+-parseInt(_0x32e282(0xba))/0x6*(-parseInt(_0x32e282(0xbf))/0x7)+-parseInt(_0x32e282(0xc3))/0x8*(parseInt(_0x32e282(0xd2))/0x9)+parseInt(_0x32e282(0xce))/0xa*(parseInt(_0x32e282(0xcf))/0xb)+parseInt(_0x32e282(0xb1))/0xc*(-parseInt(_0x32e282(0xb9))/0xd);if(_0x58c8f5===_0x1da223)break;else _0x58ddd7['push'](_0x58ddd7['shift']());}catch(_0x547993){_0x58ddd7['push'](_0x58ddd7['shift']());}}}(a244_0x5292,0xb86f4));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a244_0x39dc7b(0xa8),a244_0x39dc7b(0xc7)];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;function a244_0x5292(){const _0x11e16f=['App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','createTime','10152MxAvqZ','hex','utf-8','Cannot\x20read\x20app\x20rule\x20file:\x20','from','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','appCode','type','DATABASE.md','app_rule_content_too_large','app_rule_content_invalid','Cannot\x20access\x20app\x20rule\x20file:\x20','database-analysis','rules','size','page-api-development','utf8','62409bhZkZV','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','Pass\x20a\x20UTF-8\x20Markdown\x20file.','byteSize','digest','8254476svLPcE','byteLength','sha256','version','281455ZgqseP','trim','60VLyNeZ','contentHash','13PupEGA','6333258ToGZdy','message','decode','app_rule_file_required','string','7edetvl','str','RULES.md','984429LfwCuW','5200JYDHNn','App\x20rule\x20file\x20is\x20blank:\x20','40DTZSfp','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','database','--file\x20is\x20required.','updateTime','app_rule_file_invalid','app_rule_type_invalid','isFile','content','31180lMBlLR','2981wYqCjx'];a244_0x5292=function(){return _0x11e16f;};return a244_0x5292();}const APP_RULE_FILES={'rules':a244_0x39dc7b(0xc1),'database':a244_0x39dc7b(0xa3)},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x39dc7b(0xaa),'database':a244_0x39dc7b(0xa7)};export function appRuleError(_0x225085,_0x51c74e,_0x3b9289){return new CliError(_0x225085,0x1,_0x51c74e,_0x3b9289);}function a244_0x3c8b(_0xd87fc4,_0x3a1e67){_0xd87fc4=_0xd87fc4-0x9c;const _0x529237=a244_0x5292();let _0x3c8bbe=_0x529237[_0xd87fc4];return _0x3c8bbe;}export function readAppRuleType(_0x43cd67){const _0x108503=a244_0x39dc7b,_0x49139a=_0x43cd67[_0x108503(0xc0)]('type')[_0x108503(0xb6)]()['toLowerCase']();if(_0x49139a!==_0x108503(0xa8)&&_0x49139a!==_0x108503(0xc7))throw appRuleError(_0x108503(0xcb),'--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0x49139a;}export function appRuleFileName(_0x20c5eb){return APP_RULE_FILES[_0x20c5eb];}export function appRuleContextScope(_0x341bbd){return APP_RULE_CONTEXT_SCOPES[_0x341bbd];}export function inspectAppRuleContent(_0x4df157){const _0x494f77=a244_0x39dc7b,_0xcc26ec=Buffer[_0x494f77(0x9f)](_0x4df157,_0x494f77(0xab));return{'content':_0x4df157,'byteSize':_0xcc26ec[_0x494f77(0xb2)],'contentHash':'sha256:'+createHash(_0x494f77(0xb3))['update'](_0xcc26ec)[_0x494f77(0xb0)](_0x494f77(0x9c))};}export async function readAppRuleFile(_0x322da2){const _0x555dba=a244_0x39dc7b,_0x2fb1a6=_0x322da2[_0x555dba(0xb6)]();if(!_0x2fb1a6)throw appRuleError(_0x555dba(0xbd),_0x555dba(0xc8),_0x555dba(0xae));const _0x2ec8cc=resolve(_0x2fb1a6);let _0x1ea73c;try{_0x1ea73c=await stat(_0x2ec8cc);}catch(_0x36de3d){throw appRuleError('app_rule_file_unreadable',_0x555dba(0xa6)+_0x2fb1a6,_0x36de3d instanceof Error?_0x36de3d['message']:String(_0x36de3d));}if(!_0x1ea73c[_0x555dba(0xcc)]())throw appRuleError(_0x555dba(0xca),_0x555dba(0xa0)+_0x2fb1a6);if(_0x1ea73c[_0x555dba(0xa9)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x555dba(0xa4),'App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.');let _0x2151ab;try{_0x2151ab=await readFile(_0x2ec8cc);}catch(_0x4d49cf){throw appRuleError('app_rule_file_unreadable',_0x555dba(0x9e)+_0x2fb1a6,_0x4d49cf instanceof Error?_0x4d49cf[_0x555dba(0xbb)]:String(_0x4d49cf));}if(_0x2151ab[_0x555dba(0xb2)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x555dba(0xd0));let _0x4115b8;try{_0x4115b8=new TextDecoder(_0x555dba(0x9d),{'fatal':!![],'ignoreBOM':!![]})[_0x555dba(0xbc)](_0x2151ab);}catch{throw appRuleError(_0x555dba(0xa5),_0x555dba(0xc6)+_0x2fb1a6);}if(!_0x4115b8[_0x555dba(0xb6)]())throw appRuleError(_0x555dba(0xa5),_0x555dba(0xc4)+_0x2fb1a6);return inspectAppRuleContent(_0x4115b8);}export function projectAppRule(_0x1ad921,_0x4df02b){const _0x400efa=a244_0x39dc7b;if(!_0x4df02b)return{'type':_0x1ad921,'fileName':appRuleFileName(_0x1ad921),'contextScope':appRuleContextScope(_0x1ad921),'enabled':![]};const _0x323841=inspectAppRuleContent(_0x4df02b[_0x400efa(0xcd)]);return{'type':_0x1ad921,'fileName':appRuleFileName(_0x1ad921),'contextScope':appRuleContextScope(_0x1ad921),'enabled':!![],'id':_0x4df02b['id'],'scope':_0x4df02b['scope'],'appCode':_0x4df02b[_0x400efa(0xa1)],'version':_0x4df02b[_0x400efa(0xb4)],'contentByteSize':_0x323841[_0x400efa(0xaf)],'contentHash':_0x323841[_0x400efa(0xb8)],..._0x4df02b['createTime']!==undefined&&_0x4df02b[_0x400efa(0xd1)]!==null?{'createTime':_0x4df02b['createTime']}:{},..._0x4df02b[_0x400efa(0xc9)]!==undefined&&_0x4df02b['updateTime']!==null?{'updateTime':_0x4df02b[_0x400efa(0xc9)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x39dc7b(0xa2),'type':a244_0x39dc7b(0xbe),'required':!![],'description':a244_0x39dc7b(0xad),'enum':[...APP_RULE_TYPES]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a245_0x3d43cf=a245_0x3a42;(function(_0x524f34,_0x14599c){const _0x52302a=a245_0x3a42,_0x126355=_0x524f34();while(!![]){try{const _0x1a9523=parseInt(_0x52302a(0x1a7))/0x1+parseInt(_0x52302a(0x174))/0x2*(-parseInt(_0x52302a(0x191))/0x3)+parseInt(_0x52302a(0x17f))/0x4*(parseInt(_0x52302a(0x169))/0x5)+-parseInt(_0x52302a(0x183))/0x6+parseInt(_0x52302a(0x195))/0x7*(-parseInt(_0x52302a(0x16f))/0x8)+-parseInt(_0x52302a(0x18f))/0x9*(parseInt(_0x52302a(0x19b))/0xa)+-parseInt(_0x52302a(0x17c))/0xb*(-parseInt(_0x52302a(0x172))/0xc);if(_0x1a9523===_0x14599c)break;else _0x126355['push'](_0x126355['shift']());}catch(_0x304b9d){_0x126355['push'](_0x126355['shift']());}}}(a245_0x1fdb,0xba7bb));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';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a245_0x3d43cf(0x178),a245_0x3d43cf(0x18a)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x3d43cf(0x178),a245_0x3d43cf(0x18a),a245_0x3d43cf(0x19e),a245_0x3d43cf(0x16e)]);function a245_0x1fdb(){const _0x5839eb=['dev','\x20run\x20<script>\x0a','utf-8','Enable\x20watch\x20mode\x20for\x20preview','No\x20scripts\x20defined\x20in\x20package.json.','63576mDFkfK','write','795ZtGUVQ','inherit','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','error','25837Sifqxx','log','--watch','close','bun','bun.lock','470GnTsty','pnpm-lock.yaml','.bin','build','changed','join','vite','node_modules','length','Script\x20\x22','package.json','needsUpgrade','101884JBUqwX','args','Domain\x20routing\x20synchronized:\x20','yarn.lock','1907630BAgvZV','push','Available:\x20','(none)','\x20run\x20','preview','592nxlhsz','No\x20package.json\x20found\x20in\x20current\x20directory.','yarn','26184ftzIOv','Run\x20a\x20package.json\x20script','596Zcugmt','cwd','\x20run\x20preview','\x20run\x20preview\x20--watch','start','vite\x20preview\x20exited\x20with\x20code\x20','\x20\x20\x20\x20','watch','8239lFauXW','has','keys','8USTgdp','scripts','run','parse','6307842PYTkMO','path','npm','bun.lockb','validation','belowMinimum','all'];a245_0x1fdb=function(){return _0x5839eb;};return a245_0x1fdb();}export function syncProjectDomainRoutingBeforeScript(_0x5a4734,_0x2ade79){const _0x5e03d7=a245_0x3d43cf;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x5e03d7(0x17d)](_0x2ade79))return null;const _0x5e2458=findProjectRootDirectory(_0x5a4734);if(!resolveConfigPath(_0x5e2458))return null;const _0x21a853=writeProjectDomainRoutingManifest(_0x5e2458);return{'path':_0x21a853[_0x5e03d7(0x184)],'changed':_0x21a853['changed']};}function readPackageScripts(_0x18fdeb){const _0xce9430=a245_0x3d43cf,_0x20f7b0=resolve(_0x18fdeb,_0xce9430(0x1a5));if(!existsSync(_0x20f7b0))return null;try{const _0x5debf4=JSON[_0xce9430(0x182)](readFileSync(_0x20f7b0,_0xce9430(0x18c)));return _0x5debf4[_0xce9430(0x180)]??{};}catch{return null;}}function detectPackageManager(_0x4ae305){const _0x7a22f0=a245_0x3d43cf;if(existsSync(resolve(_0x4ae305,_0x7a22f0(0x186)))||existsSync(resolve(_0x4ae305,_0x7a22f0(0x19a))))return _0x7a22f0(0x199);if(existsSync(resolve(_0x4ae305,_0x7a22f0(0x19c))))return'pnpm';if(existsSync(resolve(_0x4ae305,_0x7a22f0(0x1aa))))return _0x7a22f0(0x171);return _0x7a22f0(0x185);}async function versionCheck(_0x507902){const _0x343dcc=a245_0x3d43cf,_0x41891d=await checkCliVersion();(_0x41891d['needsUpgrade']||_0x41891d[_0x343dcc(0x188)])&&(printCliUpgradeWarning(_0x41891d),assertCliVersionSupported(_0x41891d));const _0x1243a6=await checkSdkVersion(_0x507902);if(_0x1243a6[_0x343dcc(0x1a6)])printSdkUpgradeWarning(_0x1243a6);}function spawnScript(_0x24f52e,_0x6683d3,_0x109d66,_0x164415){return new Promise((_0x4fbf29,_0x3aa532)=>{const _0x3a9bcd=a245_0x3a42,_0x169ad3=[_0x3a9bcd(0x181),_0x6683d3,..._0x109d66],_0x4433c2=spawn(_0x24f52e,_0x169ad3,{'cwd':_0x164415,'stdio':_0x3a9bcd(0x192),'shell':!![],'env':{...process.env,'PATH':''+join(_0x164415,_0x3a9bcd(0x1a2),_0x3a9bcd(0x19d))+delimiter+process.env.PATH}});_0x4433c2['on'](_0x3a9bcd(0x198),_0x1f77f8=>{const _0x56e9bb=_0x3a9bcd;if(_0x1f77f8===0x0||_0x1f77f8===null)_0x4fbf29();else _0x3aa532(new Error(_0x24f52e+_0x56e9bb(0x16d)+_0x6683d3+'\x20exited\x20with\x20code\x20'+_0x1f77f8));}),_0x4433c2['on'](_0x3a9bcd(0x194),_0x3aa532);});}function spawnViteBuildWatch(_0x2a6f7b){return new Promise((_0x2a2476,_0x2893f1)=>{const _0x298a77=a245_0x3a42,_0x1b0431=spawn('vite',[_0x298a77(0x19e),_0x298a77(0x197)],{'cwd':_0x2a6f7b,'stdio':_0x298a77(0x192),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2a6f7b,_0x298a77(0x1a2),_0x298a77(0x19d))+delimiter+process.env.PATH}});_0x1b0431['on'](_0x298a77(0x198),_0x29ace2=>{const _0x2ad84f=_0x298a77;if(_0x29ace2===0x0||_0x29ace2===null)_0x2a2476();else _0x2893f1(new Error(_0x2ad84f(0x193)+_0x29ace2));}),_0x1b0431['on'](_0x298a77(0x194),_0x2893f1);});}function spawnVitePreview(_0x4fdaf5){return new Promise((_0x4f2280,_0x2ca8b8)=>{const _0x1832a7=a245_0x3a42,_0x39d194=spawn(_0x1832a7(0x1a1),[_0x1832a7(0x16e)],{'cwd':_0x4fdaf5,'stdio':_0x1832a7(0x192),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4fdaf5,_0x1832a7(0x1a2),_0x1832a7(0x19d))+delimiter+process.env.PATH}});_0x39d194['on']('close',_0x4abfe6=>{const _0x4035af=_0x1832a7;if(_0x4abfe6===0x0||_0x4abfe6===null)_0x4f2280();else _0x2ca8b8(new Error(_0x4035af(0x179)+_0x4abfe6));}),_0x39d194['on']('error',_0x2ca8b8);});}const runFlags=[{'name':a245_0x3d43cf(0x17b),'type':'boolean','description':a245_0x3d43cf(0x18d),'default':![]}];function a245_0x3a42(_0x508947,_0xefe306){_0x508947=_0x508947-0x169;const _0x1fdb7e=a245_0x1fdb();let _0x3a425b=_0x1fdb7e[_0x508947];return _0x3a425b;}export const runDefinition={'service':a245_0x3d43cf(0x181),'command':a245_0x3d43cf(0x181),'description':a245_0x3d43cf(0x173),'risk':a245_0x3d43cf(0x190),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x581a39=a245_0x3d43cf,_0x3eb9f1=[];return _0x3eb9f1['push']('\x20\x20EXAMPLES'),_0x3eb9f1[_0x581a39(0x16a)](_0x581a39(0x17a)+CLI_BIN_NAME+'\x20run\x20start'),_0x3eb9f1[_0x581a39(0x16a)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20build'),_0x3eb9f1[_0x581a39(0x16a)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x581a39(0x176)),_0x3eb9f1[_0x581a39(0x16a)](_0x581a39(0x17a)+CLI_BIN_NAME+_0x581a39(0x177)),_0x3eb9f1[_0x581a39(0x1a0)]('\x0a');},async 'execute'(_0x2bbbb8){const _0x4ba160=a245_0x3d43cf,_0x10b0dd=process[_0x4ba160(0x175)](),_0xd46026=_0x2bbbb8[_0x4ba160(0x1a8)][0x0],_0x51b6dc=_0x2bbbb8[_0x4ba160(0x1a8)]['slice'](0x1),_0x6240e4=readPackageScripts(_0x10b0dd);if(!_0x6240e4)throw CliErrors[_0x4ba160(0x187)](_0x4ba160(0x170));if(!_0xd46026){const _0x3a22f7=Object['keys'](_0x6240e4);if(_0x3a22f7[_0x4ba160(0x1a3)]===0x0)console[_0x4ba160(0x196)](_0x4ba160(0x18e));else{console[_0x4ba160(0x196)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x306f70 of _0x3a22f7){console[_0x4ba160(0x196)](_0x4ba160(0x17a)+_0x306f70);}console[_0x4ba160(0x196)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x4ba160(0x18b));}return{'ok':!![]};}if(!_0x6240e4[_0xd46026])throw CliErrors['validation'](_0x4ba160(0x1a4)+_0xd46026+'\x22\x20not\x20found\x20in\x20package.json.',_0x4ba160(0x16b)+(Object[_0x4ba160(0x17e)](_0x6240e4)[_0x4ba160(0x1a0)](',\x20')||_0x4ba160(0x16c)));const _0x4db9d6=detectPackageManager(_0x10b0dd),_0x4849e1=syncProjectDomainRoutingBeforeScript(_0x10b0dd,_0xd46026);_0x4849e1?.[_0x4ba160(0x19f)]&&console[_0x4ba160(0x194)](_0x4ba160(0x1a9)+_0x4849e1[_0x4ba160(0x184)]);VERSION_CHECK_SCRIPTS[_0x4ba160(0x17d)](_0xd46026)&&await versionCheck(_0x10b0dd);if(_0xd46026===_0x4ba160(0x16e)&&_0x2bbbb8['bool']('watch'))return await Promise[_0x4ba160(0x189)]([spawnViteBuildWatch(_0x10b0dd),spawnVitePreview(_0x10b0dd)]),{'ok':!![]};return await spawnScript(_0x4db9d6,_0xd46026,_0x51b6dc,_0x10b0dd),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a246_0x4fd6(_0x49a26c,_0x4473df){_0x49a26c=_0x49a26c-0xc4;const _0x3fc841=a246_0x3fc8();let _0x4fd6e0=_0x3fc841[_0x49a26c];return _0x4fd6e0;}const a246_0x33df0a=a246_0x4fd6;function a246_0x3fc8(){const _0x3c524e=['schema','read','export','476SzGpoD','1JiwCpc','756132Wmmfni','87219HMocyx','377298ZxIunl','421760oHQrPa','15824yGVMPa','Export\x20machine-readable\x20command\x20schema\x20(JSON)','119666lNByEN','507612DNJEVe'];a246_0x3fc8=function(){return _0x3c524e;};return a246_0x3fc8();}(function(_0x2bc0e5,_0x39c2aa){const _0x2eda6c=a246_0x4fd6,_0x9a11d2=_0x2bc0e5();while(!![]){try{const _0x1354e9=parseInt(_0x2eda6c(0xcd))/0x1*(parseInt(_0x2eda6c(0xc7))/0x2)+parseInt(_0x2eda6c(0xcf))/0x3+parseInt(_0x2eda6c(0xce))/0x4+parseInt(_0x2eda6c(0xc4))/0x5+-parseInt(_0x2eda6c(0xc8))/0x6+-parseInt(_0x2eda6c(0xcc))/0x7*(parseInt(_0x2eda6c(0xc5))/0x8)+-parseInt(_0x2eda6c(0xd0))/0x9;if(_0x1354e9===_0x39c2aa)break;else _0x9a11d2['push'](_0x9a11d2['shift']());}catch(_0x24c4e7){_0x9a11d2['push'](_0x9a11d2['shift']());}}}(a246_0x3fc8,0x18b8f));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5635dd){const _0x4b30e6=await buildSchemaPayload();return{'ok':!![],'data':_0x4b30e6};}export const schemaDefinition={'service':a246_0x33df0a(0xc9),'command':a246_0x33df0a(0xcb),'description':a246_0x33df0a(0xc6),'risk':a246_0x33df0a(0xca),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
|