@lovrabet/rabetbase-cli 2.5.10-beta.2 → 2.5.10-beta.3
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/README.md +10 -0
- 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.d.ts +2 -2
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/context.d.ts +3 -0
- package/lib/commands/issue/context.js +1 -0
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
- package/skills/rabetbase/SKILL.md +2 -2
- package/skills/rabetbase/references/rabetbase-issue-report.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 +3 -3
- package/lib/commands/issue/shared.d.ts +0 -32
- package/lib/commands/issue/shared.js +0 -1
- package/lib/telemetry/send-platform-issue-collect-log.d.ts +0 -26
- package/lib/telemetry/send-platform-issue-collect-log.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a231_0x10083b=a231_0x1862;(function(_0x5854ac,_0x4bf3be){const _0x194210=a231_0x1862,_0x1fa13c=_0x5854ac();while(!![]){try{const _0x5ae440=-parseInt(_0x194210(0x103))/0x1+-parseInt(_0x194210(0x111))/0x2+parseInt(_0x194210(0x10c))/0x3+parseInt(_0x194210(0x10f))/0x4+-parseInt(_0x194210(0x117))/0x5+-parseInt(_0x194210(0x106))/0x6+-parseInt(_0x194210(0x10b))/0x7*(-parseInt(_0x194210(0x118))/0x8);if(_0x5ae440===_0x4bf3be)break;else _0x1fa13c['push'](_0x1fa13c['shift']());}catch(_0x1e24fd){_0x1fa13c['push'](_0x1fa13c['shift']());}}}(a231_0x273d,0xc7b3f));function a231_0x1862(_0x523f80,_0x1fc4da){_0x523f80=_0x523f80-0x103;const _0x273d52=a231_0x273d();let _0x18629e=_0x273d52[_0x523f80];return _0x18629e;}import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a231_0x10083b(0x10d);function a231_0x273d(){const _0x590403=['num','delete','roleName','\x20(id=','1503915YioNkq','8nWTDcy','1585987aGMAUY','userCount','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','9173784iZrgpu','POST','Deleted\x20role\x20','dev','appCode','29713614vJAXvV','1398177eRxFdP','/smartapi/permit/role/delete','role','4431932lvBxld','high-risk-write','3170254MDkzeP','Role\x20still\x20has\x20'];a231_0x273d=function(){return _0x590403;};return a231_0x273d();}export const roleDelete={'service':a231_0x10083b(0x10e),'command':a231_0x10083b(0x114),'description':'Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','risk':a231_0x10083b(0x110),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4a78a8){const _0x4f1c3f=a231_0x10083b,_0x186f19=_0x4a78a8['num']('id'),_0x1aade5=await getRoleById(_0x4a78a8[_0x4f1c3f(0x10a)],_0x186f19);return assertCustomRole(_0x1aade5,_0x4f1c3f(0x114)),asDryRunResult({'scope':'dev','operation':_0x4f1c3f(0x114),'selector':{'appCode':_0x4a78a8['appCode'],'roleId':_0x186f19,'roleName':_0x1aade5['roleName']},'before':projectRole(_0x1aade5),'after':null,'dryRun':!![],'backend':{'method':_0x4f1c3f(0x107),'path':DELETE_PATH},'warnings':_0x1aade5[_0x4f1c3f(0x104)]>0x0?[_0x4f1c3f(0x112)+_0x1aade5[_0x4f1c3f(0x104)]+_0x4f1c3f(0x105)]:[]},{'method':_0x4f1c3f(0x107),'url':DELETE_PATH});},async 'execute'(_0x395782){const _0x56ecf0=a231_0x10083b,_0x174fec=_0x395782[_0x56ecf0(0x113)]('id'),_0x1674d3=await getRoleById(_0x395782['appCode'],_0x174fec);return assertCustomRole(_0x1674d3,_0x56ecf0(0x114)),await deleteAppRole(_0x174fec),{'ok':!![],'data':{'scope':_0x56ecf0(0x109),'operation':_0x56ecf0(0x114),'selector':{'appCode':_0x395782['appCode'],'roleId':_0x174fec,'roleName':_0x1674d3['roleName']},'before':projectRole(_0x1674d3),'after':null,'dryRun':![],'backend':{'method':_0x56ecf0(0x107),'path':DELETE_PATH},'warnings':[]},'message':_0x56ecf0(0x108)+_0x1674d3[_0x56ecf0(0x115)]+_0x56ecf0(0x116)+_0x174fec+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a232_0x2fee02=a232_0x4125;function a232_0x4125(_0x34d6e3,_0x574bb7){_0x34d6e3=_0x34d6e3-0xcc;const _0x14bbe1=a232_0x14bb();let _0x412548=_0x14bbe1[_0x34d6e3];return _0x412548;}(function(_0x4a0a3a,_0x388a9d){const _0x1733c9=a232_0x4125,_0xa1d772=_0x4a0a3a();while(!![]){try{const _0x271102=-parseInt(_0x1733c9(0xd0))/0x1*(parseInt(_0x1733c9(0xd5))/0x2)+parseInt(_0x1733c9(0xd8))/0x3*(parseInt(_0x1733c9(0xcf))/0x4)+-parseInt(_0x1733c9(0xcd))/0x5*(-parseInt(_0x1733c9(0xce))/0x6)+-parseInt(_0x1733c9(0xd1))/0x7+-parseInt(_0x1733c9(0xda))/0x8+parseInt(_0x1733c9(0xd4))/0x9+-parseInt(_0x1733c9(0xd3))/0xa;if(_0x271102===_0x388a9d)break;else _0xa1d772['push'](_0xa1d772['shift']());}catch(_0x28c255){_0xa1d772['push'](_0xa1d772['shift']());}}}(a232_0x14bb,0x3f9dd));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a232_0x14bb(){const _0x319fc9=['role','36jymnLF','Role\x20','606488oJNWNM','num','read','dev','roleName','205BcDnMq','34716eZkysC','149588OmpgWR','149239xeHrnP','3494876JFglfw','Show\x20a\x20single\x20role\x27s\x20detail','941350omCOkX','3537324oZJymk','2pUxSAX','appCode'];a232_0x14bb=function(){return _0x319fc9;};return a232_0x14bb();}export const roleDetail={'service':a232_0x2fee02(0xd7),'command':'detail','description':a232_0x2fee02(0xd2),'risk':a232_0x2fee02(0xdc),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x4994dc){const _0x2129f6=a232_0x2fee02,_0x122a61=_0x4994dc[_0x2129f6(0xdb)]('id'),_0x7b50a8=await getRoleById(_0x4994dc[_0x2129f6(0xd6)],_0x122a61);return{'ok':!![],'data':{'scope':_0x2129f6(0xdd),'role':projectRole(_0x7b50a8)},'message':_0x2129f6(0xd9)+_0x7b50a8[_0x2129f6(0xcc)]+'\x20('+_0x7b50a8['roleType']+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x59e9e6,_0x4f4e08){const _0x1771a9=a233_0x3468,_0x1f32b0=_0x59e9e6();while(!![]){try{const _0x14220f=parseInt(_0x1771a9(0xc0))/0x1*(parseInt(_0x1771a9(0xbf))/0x2)+parseInt(_0x1771a9(0xc2))/0x3*(parseInt(_0x1771a9(0xbc))/0x4)+parseInt(_0x1771a9(0xb9))/0x5+-parseInt(_0x1771a9(0xba))/0x6+-parseInt(_0x1771a9(0xbe))/0x7+parseInt(_0x1771a9(0xc1))/0x8+-parseInt(_0x1771a9(0xbb))/0x9*(parseInt(_0x1771a9(0xbd))/0xa);if(_0x14220f===_0x4f4e08)break;else _0x1f32b0['push'](_0x1f32b0['shift']());}catch(_0x5b47b0){_0x1f32b0['push'](_0x1f32b0['shift']());}}}(a233_0xd4ed,0xd7f55));import{roleList}from'../../commands/role/list.js';function a233_0x3468(_0x24a69e,_0x54dea1){_0x24a69e=_0x24a69e-0xb9;const _0xd4eda4=a233_0xd4ed();let _0x3468aa=_0xd4eda4[_0x24a69e];return _0x3468aa;}import{roleDetail}from'../../commands/role/detail.js';function a233_0xd4ed(){const _0x4d5b5c=['16206PPqbuw','3091745eCWGQl','3669666TafpxO','828OxWqgW','1292mBsBDG','245620Aflgmq','1981168Dtdpij','1762spjBBJ','181xVsWaC','12129984KYQdWQ'];a233_0xd4ed=function(){return _0x4d5b5c;};return a233_0xd4ed();}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a234_0x4b57(){const _0xe4e00=['811812ZvckiR','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','pagesize','filter','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','DEV','str','type','1335246WAJITp','page','read','dev','string','Filter\x20by\x20role\x20type','map','748776bLEvBu','8GrWVXd','includes','appCode','list','ADMIN','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','1292755AipAUT','5393605IUbmTt','\x20role(s)','number','validation','Invalid\x20--type\x20\x22','Found\x20','roleType','role','num','21578744qQfoJD','1033704BXavTU','Page\x20index\x20(1-based)','CUSTOM','OWNER','Use\x20one\x20of:\x20'];a234_0x4b57=function(){return _0xe4e00;};return a234_0x4b57();}const a234_0x2fdcc5=a234_0x5068;(function(_0x6a0274,_0x3f8f6f){const _0x18d6ae=a234_0x5068,_0x3b6740=_0x6a0274();while(!![]){try{const _0x257ffe=-parseInt(_0x18d6ae(0x172))/0x1+-parseInt(_0x18d6ae(0x151))/0x2+-parseInt(_0x18d6ae(0x160))/0x3+parseInt(_0x18d6ae(0x161))/0x4*(parseInt(_0x18d6ae(0x167))/0x5)+-parseInt(_0x18d6ae(0x159))/0x6+-parseInt(_0x18d6ae(0x168))/0x7+parseInt(_0x18d6ae(0x171))/0x8;if(_0x257ffe===_0x3f8f6f)break;else _0x3b6740['push'](_0x3b6740['shift']());}catch(_0x2c1144){_0x3b6740['push'](_0x3b6740['shift']());}}}(a234_0x4b57,0x81edb));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';function a234_0x5068(_0x1be0d9,_0x454f1f){_0x1be0d9=_0x1be0d9-0x14f;const _0x4b572b=a234_0x4b57();let _0x506808=_0x4b572b[_0x1be0d9];return _0x506808;}const ROLE_TYPES=[a234_0x2fdcc5(0x165),a234_0x2fdcc5(0x156),a234_0x2fdcc5(0x14f),a234_0x2fdcc5(0x174)];export const roleList={'service':a234_0x2fdcc5(0x16f),'command':a234_0x2fdcc5(0x164),'description':a234_0x2fdcc5(0x152),'risk':a234_0x2fdcc5(0x15b),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0x2fdcc5(0x158),'type':a234_0x2fdcc5(0x15d),'required':![],'description':a234_0x2fdcc5(0x15e),'enum':ROLE_TYPES},{'name':a234_0x2fdcc5(0x15a),'type':a234_0x2fdcc5(0x16a),'description':a234_0x2fdcc5(0x173),'default':0x1},{'name':a234_0x2fdcc5(0x153),'type':a234_0x2fdcc5(0x16a),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x33d440){const _0x127eff=a234_0x2fdcc5,_0x47a8a4=_0x33d440[_0x127eff(0x157)](_0x127eff(0x158))['trim']();if(_0x47a8a4&&!ROLE_TYPES[_0x127eff(0x162)](_0x47a8a4['toUpperCase']()))throw CliErrors['validation'](_0x127eff(0x16c)+_0x47a8a4+'\x22.',_0x127eff(0x150)+ROLE_TYPES['join'](',\x20')+'.');const _0x24ead6=_0x33d440[_0x127eff(0x170)]('page',0x1),_0xaea1f6=_0x33d440[_0x127eff(0x170)]('pagesize',0x64);if(_0x24ead6<0x1)throw CliErrors[_0x127eff(0x16b)](_0x127eff(0x166));if(_0xaea1f6<0x1||_0xaea1f6>0x64)throw CliErrors[_0x127eff(0x16b)](_0x127eff(0x155));},async 'execute'(_0x1b215e){const _0x17e38e=a234_0x2fdcc5,_0xfb1430=_0x1b215e[_0x17e38e(0x170)](_0x17e38e(0x15a),0x1)||0x1,_0x443b45=_0x1b215e[_0x17e38e(0x170)](_0x17e38e(0x153),0x64)||0x64,_0x39005c=_0x1b215e[_0x17e38e(0x157)]('type')['trim']()['toUpperCase'](),{items:_0x33e0f9,paging:_0x487483}=await listAppRoles(_0x1b215e[_0x17e38e(0x163)],{'currentPage':_0xfb1430,'pageSize':_0x443b45}),_0x532ca6=_0x39005c?_0x33e0f9[_0x17e38e(0x154)](_0x35f4a5=>_0x35f4a5[_0x17e38e(0x16e)]===_0x39005c):_0x33e0f9,_0x1fa5a7=_0x532ca6[_0x17e38e(0x15f)](projectRole);return{'ok':!![],'data':{'scope':_0x17e38e(0x15c),'roles':_0x1fa5a7,'paging':_0x487483},'message':_0x17e38e(0x16d)+_0x1fa5a7['length']+_0x17e38e(0x169)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a235_0x1d92(_0x50d2f3,_0x4c9964){_0x50d2f3=_0x50d2f3-0x89;const _0x631f9d=a235_0x631f();let _0x1d9240=_0x631f9d[_0x50d2f3];return _0x1d9240;}const a235_0x166d90=a235_0x1d92;(function(_0xf617f9,_0x5f2cc7){const _0x2f7d0f=a235_0x1d92,_0x504785=_0xf617f9();while(!![]){try{const _0x54dfe7=parseInt(_0x2f7d0f(0xad))/0x1+-parseInt(_0x2f7d0f(0xaa))/0x2*(-parseInt(_0x2f7d0f(0x8f))/0x3)+parseInt(_0x2f7d0f(0x93))/0x4+-parseInt(_0x2f7d0f(0xd0))/0x5+parseInt(_0x2f7d0f(0xc5))/0x6*(-parseInt(_0x2f7d0f(0xab))/0x7)+-parseInt(_0x2f7d0f(0xcf))/0x8*(-parseInt(_0x2f7d0f(0xc4))/0x9)+-parseInt(_0x2f7d0f(0xd8))/0xa;if(_0x54dfe7===_0x5f2cc7)break;else _0x504785['push'](_0x504785['shift']());}catch(_0x3ba0d7){_0x504785['push'](_0x504785['shift']());}}}(a235_0x631f,0xb3159));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_0x166d90(0x9b),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':a235_0x166d90(0xc7)};export const USER_REF_FLAG={'name':'user','type':a235_0x166d90(0xc9),'required':!![],'description':a235_0x166d90(0xa5)};export const NAME_FLAG={'name':a235_0x166d90(0xa2),'type':a235_0x166d90(0xc9),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':'name','type':a235_0x166d90(0xc9),'required':!![],'description':a235_0x166d90(0xa3)};export const REMARK_FLAG={'name':'remark','type':a235_0x166d90(0xc9),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x166d90(0x9f),'type':'number','required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a235_0x166d90(0xbf),a235_0x166d90(0xb9),'OWNER'];export function isBuiltinRole(_0x25bc26){const _0x480808=a235_0x166d90;return BUILTIN_ROLE_TYPES[_0x480808(0xb1)](_0x25bc26);}export function assertCustomRole(_0x33d62d,_0x469f93){const _0x1c95c4=a235_0x166d90;if(_0x33d62d[_0x1c95c4(0xb7)]!==_0x1c95c4(0x8a))throw CliErrors[_0x1c95c4(0xa7)]('Cannot\x20'+_0x469f93+_0x1c95c4(0xb8)+_0x33d62d[_0x1c95c4(0xd9)]+'\x20('+_0x33d62d[_0x1c95c4(0xb7)]+').',_0x1c95c4(0x92));}export function projectRole(_0x30e993){const _0x8351ac=a235_0x166d90;return{'id':_0x30e993['id'],'roleName':_0x30e993[_0x8351ac(0xd9)],'roleType':_0x30e993['roleType'],'remark':_0x30e993['remark'],'userCount':_0x30e993[_0x8351ac(0xcd)],'permitCount':_0x30e993[_0x8351ac(0xd2)],'builtin':isBuiltinRole(_0x30e993[_0x8351ac(0xb7)])};}export async function resolveRoleRef(_0x3edba0,_0x5791fe){const _0x452a32=a235_0x166d90,_0x4974d0=_0x5791fe[_0x452a32(0xb3)]();if(!_0x4974d0)throw CliErrors[_0x452a32(0xa7)](_0x452a32(0xb0),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x452a32(0xba)](_0x4974d0))return getRoleById(_0x3edba0,Number(_0x4974d0));const _0x46ed05=await listAllAppRoles(_0x3edba0),_0x15b229=_0x46ed05[_0x452a32(0xb5)](_0x5875e4=>_0x5875e4[_0x452a32(0xd9)]===_0x4974d0);if(_0x15b229['length']===0x0)throw CliErrors[_0x452a32(0xa7)](_0x452a32(0xcc)+_0x4974d0+_0x452a32(0xd5)+_0x3edba0+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x15b229[_0x452a32(0xc8)]>0x1){const _0xb4afec=_0x15b229[_0x452a32(0xa9)](_0x13eb99=>_0x13eb99['id'])[_0x452a32(0x8b)](',\x20');throw CliErrors[_0x452a32(0xa7)](_0x452a32(0xcc)+_0x4974d0+_0x452a32(0x8d)+_0xb4afec+').',_0x452a32(0xaf));}return _0x15b229[0x0];}export async function getRoleById(_0x4e7537,_0x415039){const _0x40378c=a235_0x166d90,_0x2a068e=await listAllAppRoles(_0x4e7537),_0x3cb3f7=_0x2a068e[_0x40378c(0xb5)](_0x41ca6b=>_0x41ca6b['id']===_0x415039&&(!_0x41ca6b['appCode']||_0x41ca6b[_0x40378c(0x8e)]===_0x4e7537));if(_0x3cb3f7[_0x40378c(0xc8)]!==0x1)throw CliErrors[_0x40378c(0xa7)](_0x40378c(0x94)+_0x415039+'\x20not\x20found\x20in\x20app\x20'+_0x4e7537+'.',_0x40378c(0xbe));return _0x3cb3f7[0x0];}async function listAllAppRoles(_0x176af8){const _0xa205a8=a235_0x166d90,_0x59110b=0x64,_0x47bc19=[];for(let _0x4a6efc=0x1;;_0x4a6efc+=0x1){const {items:_0x146c98,paging:_0x1ee05d}=await listAppRoles(_0x176af8,{'currentPage':_0x4a6efc,'pageSize':_0x59110b});_0x47bc19[_0xa205a8(0xa6)](..._0x146c98);if(_0x146c98[_0xa205a8(0xc8)]<_0x59110b||_0x1ee05d&&_0x47bc19[_0xa205a8(0xc8)]>=_0x1ee05d[_0xa205a8(0xa8)])return _0x47bc19;}}export async function resolveTenantCode(){const _0x52f6ea=a235_0x166d90,_0x4f08ff=await getSessionUserInfo(),_0x3be4d4=_0x4f08ff?.['user']?.[_0x52f6ea(0x95)]?.[_0x52f6ea(0xc3)];if(!_0x3be4d4)throw CliErrors['authRequired'](_0x52f6ea(0xd4));return _0x3be4d4;}function matchMember(_0xe67eca,_0x25734f){const _0x3e97a4=a235_0x166d90,_0x1b8435=_0x25734f[_0x3e97a4(0xb3)]()[_0x3e97a4(0xd1)]();return(_0xe67eca[_0x3e97a4(0x96)]??'')['toLowerCase']()===_0x1b8435||(_0xe67eca[_0x3e97a4(0x9e)]??'')[_0x3e97a4(0xd1)]()===_0x1b8435;}export async function resolveUserRef(_0x54a16f,_0xf9244f=a235_0x166d90(0x9a)){const _0x20f75d=a235_0x166d90,_0x31add0=_0x54a16f[_0x20f75d(0xb3)]();if(!_0x31add0)throw CliErrors[_0x20f75d(0xa7)](_0x20f75d(0x99),_0x20f75d(0xb6));const _0x5e2f1d=await resolveTenantCode(),_0x3ccab8=await getTenantMembers(_0x5e2f1d);if(/^\d+$/[_0x20f75d(0xba)](_0x31add0)){const _0xfb408=Number(_0x31add0),_0x851d87=_0x3ccab8[_0x20f75d(0x8c)](_0x53b5b9=>_0x53b5b9['userId']===_0xfb408);return{'userId':_0xfb408,'username':_0x851d87?.[_0x20f75d(0x9e)]??String(_0xfb408),'nickname':_0x851d87?.[_0x20f75d(0x96)],'matchedBy':'id'};}const _0x54849a=_0x3ccab8[_0x20f75d(0xb5)](_0x460e94=>matchMember(_0x460e94,_0x31add0));if(_0x54849a[_0x20f75d(0xc8)]===0x0)throw CliErrors[_0x20f75d(0xa7)]('No\x20tenant\x20member\x20matches\x20\x22'+_0x31add0+'\x22.',_0x20f75d(0xae)+_0xf9244f);if(_0x54849a[_0x20f75d(0xc8)]>0x1){const _0x3742b8=_0x54849a[_0x20f75d(0xa9)](_0x59dc4a=>(_0x59dc4a[_0x20f75d(0x96)]??_0x59dc4a[_0x20f75d(0x9e)]??'?')+'('+_0x59dc4a[_0x20f75d(0x89)]+')')[_0x20f75d(0x8b)](',\x20');throw CliErrors[_0x20f75d(0xa7)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x31add0+_0x20f75d(0xac)+_0x3742b8+'.',_0xf9244f);}const _0x4a8003=_0x54849a[0x0];return{'userId':_0x4a8003['userId'],'username':_0x4a8003[_0x20f75d(0x9e)]??String(_0x4a8003['userId']),'nickname':_0x4a8003[_0x20f75d(0x96)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a235_0x166d90(0xb4);export const DELETE_USER_ROLE_PATH=a235_0x166d90(0x97);function a235_0x631f(){const _0x26d94c=['769432LsyDEI','4360980wDtZCO','toLowerCase','permitCount','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','\x22\x20not\x20found\x20in\x20app\x20','POST','flag','19887950vnBBeo','roleName','userId','CUSTOM','join','find','\x22\x20is\x20ambiguous\x20(ids:\x20','appCode','3LbzpxR','\x20duplicate\x20memberships\x20for\x20user\x20','User\x20','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','4971072cAQWfu','Role\x20id\x20','tenant','nickname','/smartapi/permit/user-role/delete','Anti-drift\x20check\x20failed:\x20expected\x20','Missing\x20user\x20reference.','Pass\x20--user\x20<id>.','number','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Cannot\x20','username','expect-user-count','OWNER','flagMissing','name','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','expectUserCount','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','push','validation','totalCount','map','1039146Qvxzjf','1844836FyGZnL','\x22:\x20','1443686jtDhfH','Check\x20the\x20nickname/username.\x20','Disambiguate\x20with\x20--role\x20<id>.','Missing\x20role\x20reference.','includes','\x20is\x20already\x20a\x20member\x20of\x20role\x20','trim','/smartapi/permit/user-role/create','filter','Pass\x20--user\x20<id|name>.','roleType','\x20built-in\x20role\x20','DEV','test','dev','dryRun','user-add','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','ADMIN','\x20members\x20of\x20the\x20OWNER\x20role.','\x20is\x20not\x20a\x20member\x20of\x20role\x20','str','tenant_code','135exRcVS','24uzNNXd','user','Role\x20id\x20or\x20exact\x20role\x20name','length','string','role',';\x20no\x20change.','Role\x20name\x20\x22','userCount','\x20member(s)\x20but\x20role\x20has\x20'];a235_0x631f=function(){return _0x26d94c;};return a235_0x631f();}export function computeRoleUserMutation(_0x395bfb){const _0x28c0ed=a235_0x166d90,{operation:_0x18d905,appCode:_0x3fffd8,role:_0x37ffa9,relations:_0x1ac5ba,user:_0x2f23c5}=_0x395bfb,_0x234c64=[...new Set(_0x1ac5ba[_0x28c0ed(0xa9)](_0xcf9fc0=>_0xcf9fc0[_0x28c0ed(0x89)]))],_0x1b9b33=[];if(_0x395bfb[_0x28c0ed(0xa4)]!==undefined&&_0x395bfb[_0x28c0ed(0xa4)]!==_0x234c64[_0x28c0ed(0xc8)])throw CliErrors[_0x28c0ed(0xa7)](_0x28c0ed(0x98)+_0x395bfb[_0x28c0ed(0xa4)]+_0x28c0ed(0xce)+_0x234c64[_0x28c0ed(0xc8)]+'.',_0x28c0ed(0x9c));const _0x10c6a5=_0x234c64[_0x28c0ed(0xb1)](_0x2f23c5[_0x28c0ed(0x89)]),_0x1a160c=_0x1ac5ba['filter'](_0x1be26e=>_0x1be26e[_0x28c0ed(0x89)]===_0x2f23c5[_0x28c0ed(0x89)])['map'](_0x2adbee=>_0x2adbee['id']),_0x585083=_0x18d905===_0x28c0ed(0xbd)?!_0x10c6a5:_0x10c6a5;let _0x3905d0=_0x234c64;_0x18d905===_0x28c0ed(0xbd)?_0x10c6a5?_0x1b9b33[_0x28c0ed(0xa6)](_0x28c0ed(0x91)+_0x2f23c5['userId']+_0x28c0ed(0xb2)+_0x37ffa9[_0x28c0ed(0xd9)]+';\x20no\x20change.'):_0x3905d0=[..._0x234c64,_0x2f23c5[_0x28c0ed(0x89)]]:!_0x10c6a5?_0x1b9b33[_0x28c0ed(0xa6)](_0x28c0ed(0x91)+_0x2f23c5[_0x28c0ed(0x89)]+_0x28c0ed(0xc1)+_0x37ffa9[_0x28c0ed(0xd9)]+_0x28c0ed(0xcb)):(_0x3905d0=_0x234c64[_0x28c0ed(0xb5)](_0x4af92d=>_0x4af92d!==_0x2f23c5[_0x28c0ed(0x89)]),_0x1a160c[_0x28c0ed(0xc8)]>0x1&&_0x1b9b33[_0x28c0ed(0xa6)]('Removed\x20'+_0x1a160c[_0x28c0ed(0xc8)]+_0x28c0ed(0x90)+_0x2f23c5[_0x28c0ed(0x89)]+'.'));const _0x1e53c3={'scope':_0x28c0ed(0xbb),'operation':_0x18d905,'selector':{'appCode':_0x3fffd8,'roleId':_0x37ffa9['id'],'roleName':_0x37ffa9['roleName'],'userId':_0x2f23c5[_0x28c0ed(0x89)]},'before':{'userIds':_0x234c64},'after':{'userIds':_0x3905d0},'dryRun':_0x395bfb[_0x28c0ed(0xbc)],'backend':{'method':_0x28c0ed(0xd6),'path':_0x18d905===_0x28c0ed(0xbd)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x1b9b33};return{'mutation':_0x1e53c3,'changed':_0x585083,'matchingRelationIds':_0x1a160c};}export async function loadDevRoleRelations(_0x13f877,_0x15927e){const _0x35fe7b=a235_0x166d90,_0x4c6d4d=0x64,_0x5f58b0=[];for(let _0x14b8a0=0x1;;_0x14b8a0+=0x1){const {items:_0x3ba842,paging:_0x43f0a2}=await listDevUserRoleRelations(_0x13f877,{'roleId':_0x15927e,'currentPage':_0x14b8a0,'pageSize':_0x4c6d4d});_0x5f58b0[_0x35fe7b(0xa6)](..._0x3ba842);if(_0x3ba842['length']<_0x4c6d4d||_0x43f0a2&&_0x5f58b0[_0x35fe7b(0xc8)]>=_0x43f0a2['totalCount'])return _0x5f58b0;}}export function readRoleRef(_0x580f78){const _0x3b25c4=a235_0x166d90,_0x2f4113=_0x580f78[_0x3b25c4(0xc2)](_0x3b25c4(0xca))[_0x3b25c4(0xb3)]();if(!_0x2f4113)throw CliErrors[_0x3b25c4(0xa1)](_0x3b25c4(0xca),'Pass\x20--role\x20<id|name>.');return _0x2f4113;}export async function prepareUserMutation(_0x534889,_0x124f4b,_0x2ee37a){const _0x15e6c8=a235_0x166d90,_0x12c92d=readRoleRef(_0x534889),_0x51f0f4=_0x534889[_0x15e6c8(0xc2)](_0x15e6c8(0xc6))[_0x15e6c8(0xb3)]();if(!_0x51f0f4)throw CliErrors[_0x15e6c8(0xa1)](_0x15e6c8(0xc6),_0x15e6c8(0xb6));const _0x2f025a=_0x534889[_0x15e6c8(0xd7)](_0x15e6c8(0x9f)),_0x20ea89=_0x2f025a===undefined||_0x2f025a===null?undefined:Number(_0x2f025a),_0x48fd32=await resolveRoleRef(_0x534889[_0x15e6c8(0x8e)],_0x12c92d);if(_0x48fd32['roleType']===_0x15e6c8(0xa0))throw CliErrors[_0x15e6c8(0xa7)](_0x15e6c8(0x9d)+_0x124f4b+_0x15e6c8(0xc0),_0x15e6c8(0xd3));const _0x48dc57=await resolveUserRef(_0x51f0f4),_0x2c8738=await loadDevRoleRelations(_0x534889[_0x15e6c8(0x8e)],_0x48fd32['id']);return{...computeRoleUserMutation({'operation':_0x124f4b,'appCode':_0x534889[_0x15e6c8(0x8e)],'role':_0x48fd32,'relations':_0x2c8738,'user':{'userId':_0x48dc57[_0x15e6c8(0x89)],'username':_0x48dc57[_0x15e6c8(0x9e)],'nickname':_0x48dc57[_0x15e6c8(0x96)]},'dryRun':_0x2ee37a,..._0x20ea89!==undefined?{'expectUserCount':_0x20ea89}:{}}),'role':_0x48fd32,'user':_0x48dc57};}
|
|
1
|
+
const a235_0x25a3ea=a235_0x182d;(function(_0x524186,_0x4213ae){const _0x3d6690=a235_0x182d,_0x3477c7=_0x524186();while(!![]){try{const _0x2d46bd=parseInt(_0x3d6690(0x1b8))/0x1*(-parseInt(_0x3d6690(0x1ca))/0x2)+parseInt(_0x3d6690(0x1ab))/0x3+parseInt(_0x3d6690(0x1a8))/0x4*(parseInt(_0x3d6690(0x1ad))/0x5)+-parseInt(_0x3d6690(0x1d8))/0x6*(-parseInt(_0x3d6690(0x19e))/0x7)+parseInt(_0x3d6690(0x1d1))/0x8+parseInt(_0x3d6690(0x1b5))/0x9+-parseInt(_0x3d6690(0x19b))/0xa*(parseInt(_0x3d6690(0x1c6))/0xb);if(_0x2d46bd===_0x4213ae)break;else _0x3477c7['push'](_0x3477c7['shift']());}catch(_0x402ed2){_0x3477c7['push'](_0x3477c7['shift']());}}}(a235_0x123d,0xde7e4));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_0x25a3ea(0x1dc),'required':!![],'description':a235_0x25a3ea(0x193)};export const ROLE_REF_FLAG={'name':'role','type':a235_0x25a3ea(0x1be),'required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};function a235_0x182d(_0xa76495,_0x1c28a9){_0xa76495=_0xa76495-0x190;const _0x123d19=a235_0x123d();let _0x182dc3=_0x123d19[_0xa76495];return _0x182dc3;}export const USER_REF_FLAG={'name':a235_0x25a3ea(0x1b4),'type':'string','required':!![],'description':a235_0x25a3ea(0x1cd)};export const NAME_FLAG={'name':'name','type':a235_0x25a3ea(0x1be),'required':!![],'description':'Role\x20name'};function a235_0x123d(){const _0x5593cd=['push','name','expect-user-count','Role\x20name\x20\x22','5847368ETIitU','username','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','2491608DXhCUj','validation','5upqaGr','\x20built-in\x20role\x20','DEV','dryRun','\x22\x20not\x20found\x20in\x20app\x20','\x22\x20is\x20ambiguous\x20(ids:\x20','Disambiguate\x20with\x20--role\x20<id>.','user','16205913MrfxrY','Anti-drift\x20check\x20failed:\x20expected\x20','find','1TZqrqt','\x22:\x20','permitCount','User\x20','expectUserCount','Pass\x20--user\x20<id|name>.','string','user-add','Multiple\x20tenant\x20members\x20match\x20\x22','Missing\x20role\x20reference.','roleType','\x20is\x20already\x20a\x20member\x20of\x20role\x20','toLowerCase','remark','253IeqaJm','Cannot\x20','roleName','/smartapi/permit/user-role/delete','1994086Uvyjkp','OWNER','length','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','/smartapi/permit/user-role/create','role','Removed\x20','6032264BNwLIb','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Role\x20id\x20','Pass\x20--role\x20<id|name>.','map','tenant_code','flag','88470oXEwda','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','appCode','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','number','dev','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Missing\x20user\x20reference.','Role\x20id\x20(from\x20`role\x20list`)','\x20members\x20of\x20the\x20OWNER\x20role.','userId','totalCount',';\x20no\x20change.','flagMissing','filter','nickname','1700810OJMmeT','trim','join','462sXYdiZ','includes','\x20member(s)\x20but\x20role\x20has\x20','Optional\x20role\x20remark/description','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','test'];a235_0x123d=function(){return _0x5593cd;};return a235_0x123d();}export const USER_NAME_FLAG={'name':'name','type':a235_0x25a3ea(0x1be),'required':!![],'description':a235_0x25a3ea(0x191)};export const REMARK_FLAG={'name':a235_0x25a3ea(0x1c5),'type':a235_0x25a3ea(0x1be),'required':![],'description':a235_0x25a3ea(0x1a1)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x25a3ea(0x1a6),'type':a235_0x25a3ea(0x1dc),'required':![],'description':a235_0x25a3ea(0x1d9)};export const BUILTIN_ROLE_TYPES=['ADMIN',a235_0x25a3ea(0x1af),a235_0x25a3ea(0x1cb)];export function isBuiltinRole(_0x430868){return BUILTIN_ROLE_TYPES['includes'](_0x430868);}export function assertCustomRole(_0x3c7360,_0x26b96b){const _0x4e95c5=a235_0x25a3ea;if(_0x3c7360[_0x4e95c5(0x1c2)]!=='CUSTOM')throw CliErrors['validation'](_0x4e95c5(0x1c7)+_0x26b96b+_0x4e95c5(0x1ae)+_0x3c7360['roleName']+'\x20('+_0x3c7360[_0x4e95c5(0x1c2)]+').',_0x4e95c5(0x1d2));}export function projectRole(_0x3466cf){const _0x304295=a235_0x25a3ea;return{'id':_0x3466cf['id'],'roleName':_0x3466cf[_0x304295(0x1c8)],'roleType':_0x3466cf[_0x304295(0x1c2)],'remark':_0x3466cf[_0x304295(0x1c5)],'userCount':_0x3466cf['userCount'],'permitCount':_0x3466cf[_0x304295(0x1ba)],'builtin':isBuiltinRole(_0x3466cf[_0x304295(0x1c2)])};}export async function resolveRoleRef(_0x125869,_0x9ea3c4){const _0x557d94=a235_0x25a3ea,_0x5391c1=_0x9ea3c4[_0x557d94(0x19c)]();if(!_0x5391c1)throw CliErrors['validation'](_0x557d94(0x1c1),_0x557d94(0x1d4));if(/^\d+$/[_0x557d94(0x1a3)](_0x5391c1))return getRoleById(_0x125869,Number(_0x5391c1));const _0x161344=await listAllAppRoles(_0x125869),_0x36e8ce=_0x161344[_0x557d94(0x199)](_0x2c7259=>_0x2c7259[_0x557d94(0x1c8)]===_0x5391c1);if(_0x36e8ce[_0x557d94(0x1cc)]===0x0)throw CliErrors[_0x557d94(0x1ac)](_0x557d94(0x1a7)+_0x5391c1+_0x557d94(0x1b1)+_0x125869+'.',_0x557d94(0x1aa));if(_0x36e8ce[_0x557d94(0x1cc)]>0x1){const _0x41f43a=_0x36e8ce['map'](_0x39978b=>_0x39978b['id'])[_0x557d94(0x19d)](',\x20');throw CliErrors[_0x557d94(0x1ac)](_0x557d94(0x1a7)+_0x5391c1+_0x557d94(0x1b2)+_0x41f43a+').',_0x557d94(0x1b3));}return _0x36e8ce[0x0];}export async function getRoleById(_0x5f5ab3,_0x54d36f){const _0x4fff0e=a235_0x25a3ea,_0x506253=await listAllAppRoles(_0x5f5ab3),_0x2dbbf9=_0x506253[_0x4fff0e(0x199)](_0x9e418b=>_0x9e418b['id']===_0x54d36f&&(!_0x9e418b['appCode']||_0x9e418b[_0x4fff0e(0x1da)]===_0x5f5ab3));if(_0x2dbbf9['length']!==0x1)throw CliErrors['validation'](_0x4fff0e(0x1d3)+_0x54d36f+'\x20not\x20found\x20in\x20app\x20'+_0x5f5ab3+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x2dbbf9[0x0];}async function listAllAppRoles(_0x122146){const _0x385314=a235_0x25a3ea,_0x5c720d=0x64,_0x107252=[];for(let _0x551ef2=0x1;;_0x551ef2+=0x1){const {items:_0x483d31,paging:_0x5c7e57}=await listAppRoles(_0x122146,{'currentPage':_0x551ef2,'pageSize':_0x5c720d});_0x107252[_0x385314(0x1a4)](..._0x483d31);if(_0x483d31[_0x385314(0x1cc)]<_0x5c720d||_0x5c7e57&&_0x107252['length']>=_0x5c7e57[_0x385314(0x196)])return _0x107252;}}export async function resolveTenantCode(){const _0x5a845d=a235_0x25a3ea,_0x30848a=await getSessionUserInfo(),_0x264f7e=_0x30848a?.[_0x5a845d(0x1b4)]?.['tenant']?.[_0x5a845d(0x1d6)];if(!_0x264f7e)throw CliErrors['authRequired']('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x264f7e;}function matchMember(_0x393e5b,_0xb2c4ab){const _0x379081=a235_0x25a3ea,_0x12c6a2=_0xb2c4ab[_0x379081(0x19c)]()[_0x379081(0x1c4)]();return(_0x393e5b[_0x379081(0x19a)]??'')['toLowerCase']()===_0x12c6a2||(_0x393e5b[_0x379081(0x1a9)]??'')[_0x379081(0x1c4)]()===_0x12c6a2;}export async function resolveUserRef(_0x1a1c18,_0x3adb06='Pass\x20--user\x20<id>.'){const _0x34770e=a235_0x25a3ea,_0x2c5bbb=_0x1a1c18[_0x34770e(0x19c)]();if(!_0x2c5bbb)throw CliErrors[_0x34770e(0x1ac)](_0x34770e(0x192),_0x34770e(0x1bd));const _0x408c28=await resolveTenantCode(),_0x47fc1c=await getTenantMembers(_0x408c28);if(/^\d+$/[_0x34770e(0x1a3)](_0x2c5bbb)){const _0x24ec9e=Number(_0x2c5bbb),_0x5c4ed1=_0x47fc1c[_0x34770e(0x1b7)](_0x293ccd=>_0x293ccd['userId']===_0x24ec9e);return{'userId':_0x24ec9e,'username':_0x5c4ed1?.[_0x34770e(0x1a9)]??String(_0x24ec9e),'nickname':_0x5c4ed1?.[_0x34770e(0x19a)],'matchedBy':'id'};}const _0x393300=_0x47fc1c[_0x34770e(0x199)](_0x1d1470=>matchMember(_0x1d1470,_0x2c5bbb));if(_0x393300[_0x34770e(0x1cc)]===0x0)throw CliErrors['validation']('No\x20tenant\x20member\x20matches\x20\x22'+_0x2c5bbb+'\x22.','Check\x20the\x20nickname/username.\x20'+_0x3adb06);if(_0x393300[_0x34770e(0x1cc)]>0x1){const _0x594f3b=_0x393300[_0x34770e(0x1d5)](_0x5de014=>(_0x5de014[_0x34770e(0x19a)]??_0x5de014[_0x34770e(0x1a9)]??'?')+'('+_0x5de014[_0x34770e(0x195)]+')')[_0x34770e(0x19d)](',\x20');throw CliErrors[_0x34770e(0x1ac)](_0x34770e(0x1c0)+_0x2c5bbb+_0x34770e(0x1b9)+_0x594f3b+'.',_0x3adb06);}const _0x39b5e8=_0x393300[0x0];return{'userId':_0x39b5e8[_0x34770e(0x195)],'username':_0x39b5e8['username']??String(_0x39b5e8[_0x34770e(0x195)]),'nickname':_0x39b5e8[_0x34770e(0x19a)],'matchedBy':_0x34770e(0x1a5)};}export const CREATE_USER_ROLE_PATH=a235_0x25a3ea(0x1ce);export const DELETE_USER_ROLE_PATH=a235_0x25a3ea(0x1c9);export function computeRoleUserMutation(_0x51123e){const _0x532238=a235_0x25a3ea,{operation:_0x2c30b5,appCode:_0x58026d,role:_0x1347ce,relations:_0x5a9eeb,user:_0x1ce200}=_0x51123e,_0x3eea1e=[...new Set(_0x5a9eeb[_0x532238(0x1d5)](_0x103600=>_0x103600[_0x532238(0x195)]))],_0x383a0e=[];if(_0x51123e[_0x532238(0x1bc)]!==undefined&&_0x51123e['expectUserCount']!==_0x3eea1e[_0x532238(0x1cc)])throw CliErrors[_0x532238(0x1ac)](_0x532238(0x1b6)+_0x51123e[_0x532238(0x1bc)]+_0x532238(0x1a0)+_0x3eea1e['length']+'.',_0x532238(0x1a2));const _0x237c1c=_0x3eea1e[_0x532238(0x19f)](_0x1ce200[_0x532238(0x195)]),_0x1a92f5=_0x5a9eeb[_0x532238(0x199)](_0x410edf=>_0x410edf['userId']===_0x1ce200[_0x532238(0x195)])[_0x532238(0x1d5)](_0x1606da=>_0x1606da['id']),_0x3d71ca=_0x2c30b5===_0x532238(0x1bf)?!_0x237c1c:_0x237c1c;let _0x38131b=_0x3eea1e;_0x2c30b5===_0x532238(0x1bf)?_0x237c1c?_0x383a0e[_0x532238(0x1a4)](_0x532238(0x1bb)+_0x1ce200['userId']+_0x532238(0x1c3)+_0x1347ce['roleName']+_0x532238(0x197)):_0x38131b=[..._0x3eea1e,_0x1ce200[_0x532238(0x195)]]:!_0x237c1c?_0x383a0e[_0x532238(0x1a4)](_0x532238(0x1bb)+_0x1ce200['userId']+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x1347ce[_0x532238(0x1c8)]+_0x532238(0x197)):(_0x38131b=_0x3eea1e[_0x532238(0x199)](_0x286f93=>_0x286f93!==_0x1ce200[_0x532238(0x195)]),_0x1a92f5['length']>0x1&&_0x383a0e[_0x532238(0x1a4)](_0x532238(0x1d0)+_0x1a92f5[_0x532238(0x1cc)]+'\x20duplicate\x20memberships\x20for\x20user\x20'+_0x1ce200[_0x532238(0x195)]+'.'));const _0x2f7a7b={'scope':_0x532238(0x190),'operation':_0x2c30b5,'selector':{'appCode':_0x58026d,'roleId':_0x1347ce['id'],'roleName':_0x1347ce[_0x532238(0x1c8)],'userId':_0x1ce200['userId']},'before':{'userIds':_0x3eea1e},'after':{'userIds':_0x38131b},'dryRun':_0x51123e[_0x532238(0x1b0)],'backend':{'method':'POST','path':_0x2c30b5===_0x532238(0x1bf)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x383a0e};return{'mutation':_0x2f7a7b,'changed':_0x3d71ca,'matchingRelationIds':_0x1a92f5};}export async function loadDevRoleRelations(_0x586198,_0x31be67){const _0x7a1f5e=a235_0x25a3ea,_0x3f21a2=0x64,_0x251cd8=[];for(let _0x2684b4=0x1;;_0x2684b4+=0x1){const {items:_0x5ba088,paging:_0x187fe2}=await listDevUserRoleRelations(_0x586198,{'roleId':_0x31be67,'currentPage':_0x2684b4,'pageSize':_0x3f21a2});_0x251cd8[_0x7a1f5e(0x1a4)](..._0x5ba088);if(_0x5ba088[_0x7a1f5e(0x1cc)]<_0x3f21a2||_0x187fe2&&_0x251cd8['length']>=_0x187fe2[_0x7a1f5e(0x196)])return _0x251cd8;}}export function readRoleRef(_0x23c2ba){const _0x21b340=a235_0x25a3ea,_0x2ba071=_0x23c2ba['str'](_0x21b340(0x1cf))[_0x21b340(0x19c)]();if(!_0x2ba071)throw CliErrors[_0x21b340(0x198)]('role',_0x21b340(0x1d4));return _0x2ba071;}export async function prepareUserMutation(_0x3602e0,_0x1814b6,_0x4e7e3c){const _0x2c2462=a235_0x25a3ea,_0x3b6d57=readRoleRef(_0x3602e0),_0x1da6be=_0x3602e0['str']('user')[_0x2c2462(0x19c)]();if(!_0x1da6be)throw CliErrors[_0x2c2462(0x198)]('user',_0x2c2462(0x1bd));const _0x1fa456=_0x3602e0[_0x2c2462(0x1d7)]('expect-user-count'),_0x475958=_0x1fa456===undefined||_0x1fa456===null?undefined:Number(_0x1fa456),_0x32e256=await resolveRoleRef(_0x3602e0['appCode'],_0x3b6d57);if(_0x32e256[_0x2c2462(0x1c2)]===_0x2c2462(0x1cb))throw CliErrors[_0x2c2462(0x1ac)](_0x2c2462(0x1c7)+_0x1814b6+_0x2c2462(0x194),_0x2c2462(0x1db));const _0x28f5c5=await resolveUserRef(_0x1da6be),_0x3fcd84=await loadDevRoleRelations(_0x3602e0[_0x2c2462(0x1da)],_0x32e256['id']);return{...computeRoleUserMutation({'operation':_0x1814b6,'appCode':_0x3602e0['appCode'],'role':_0x32e256,'relations':_0x3fcd84,'user':{'userId':_0x28f5c5[_0x2c2462(0x195)],'username':_0x28f5c5[_0x2c2462(0x1a9)],'nickname':_0x28f5c5[_0x2c2462(0x19a)]},'dryRun':_0x4e7e3c,..._0x475958!==undefined?{'expectUserCount':_0x475958}:{}}),'role':_0x32e256,'user':_0x28f5c5};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a236_0x125633=a236_0x4922;(function(_0x55bd49,_0xe1e988){const _0x363500=a236_0x4922,_0x2bb96e=_0x55bd49();while(!![]){try{const _0x5b476a=parseInt(_0x363500(0x116))/0x1+-parseInt(_0x363500(0x118))/0x2+parseInt(_0x363500(0x123))/0x3*(-parseInt(_0x363500(0x109))/0x4)+-parseInt(_0x363500(0x11a))/0x5*(-parseInt(_0x363500(0x110))/0x6)+parseInt(_0x363500(0x112))/0x7*(parseInt(_0x363500(0x108))/0x8)+-parseInt(_0x363500(0x114))/0x9*(-parseInt(_0x363500(0x10c))/0xa)+-parseInt(_0x363500(0x10e))/0xb;if(_0x5b476a===_0xe1e988)break;else _0x2bb96e['push'](_0x2bb96e['shift']());}catch(_0x20aaac){_0x2bb96e['push'](_0x2bb96e['shift']());}}}(a236_0x486f,0x42a77));import{updateAppRole}from'../../core/api-client.js';function a236_0x486f(){const _0x1e55b4=['appCode','943281aeUCkX','length','434504SjXaCk','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','424776nhpltl','Updated\x20role\x20','345kWhUnT','validation','--name\x20cannot\x20be\x20empty.','roleName','POST','role','New\x20role\x20name','remark','write','3LOjWvN','num','Nothing\x20to\x20update.','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','16LAKNpj','1770884iqlnLq','dev','\x20(id=','20JlnvRH','name','654236LShMjo','/smartapi/permit/role/update','2076vbNtaK','update','1118614FAzWrc'];a236_0x486f=function(){return _0x1e55b4;};return a236_0x486f();}function a236_0x4922(_0x1a7a97,_0x46728a){_0x1a7a97=_0x1a7a97-0x108;const _0x486f64=a236_0x486f();let _0x49221e=_0x486f64[_0x1a7a97];return _0x49221e;}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_0x125633(0x10f);function readPatch(_0x4d0e73){const _0x381cb2=a236_0x125633,_0x5f3756=_0x4d0e73['flag'](_0x381cb2(0x10d)),_0x147762=_0x4d0e73['flag'](_0x381cb2(0x121)),_0x3316b5={};if(_0x5f3756!==undefined&&_0x5f3756!==null){const _0x1b5240=String(_0x5f3756)['trim']();if(!_0x1b5240)throw CliErrors[_0x381cb2(0x11b)](_0x381cb2(0x11c));if(_0x1b5240[_0x381cb2(0x115)]>0x40)throw CliErrors[_0x381cb2(0x11b)](_0x381cb2(0x126));_0x3316b5[_0x381cb2(0x11d)]=_0x1b5240;}_0x147762!==undefined&&_0x147762!==null&&(_0x3316b5[_0x381cb2(0x121)]=String(_0x147762));if(_0x3316b5[_0x381cb2(0x11d)]===undefined&&_0x3316b5[_0x381cb2(0x121)]===undefined)throw CliErrors[_0x381cb2(0x11b)](_0x381cb2(0x125),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x3316b5;}export const roleUpdate={'service':a236_0x125633(0x11f),'command':a236_0x125633(0x111),'description':a236_0x125633(0x117),'risk':a236_0x125633(0x122),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0x125633(0x10d),'type':'string','required':![],'description':a236_0x125633(0x120)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2cff00){readPatch(_0x2cff00);},async 'dryRun'(_0x1fce7b){const _0x2355fb=a236_0x125633,_0x4de9cb=_0x1fce7b[_0x2355fb(0x124)]('id'),_0x3565b8=readPatch(_0x1fce7b),_0xb0f9d9=await getRoleById(_0x1fce7b[_0x2355fb(0x113)],_0x4de9cb);return assertCustomRole(_0xb0f9d9,_0x2355fb(0x111)),asDryRunResult({'scope':'dev','operation':_0x2355fb(0x111),'selector':{'appCode':_0x1fce7b[_0x2355fb(0x113)],'roleId':_0x4de9cb,'roleName':_0xb0f9d9[_0x2355fb(0x11d)]},'before':projectRole(_0xb0f9d9),'after':projectRole({..._0xb0f9d9,..._0x3565b8[_0x2355fb(0x11d)]!==undefined?{'roleName':_0x3565b8[_0x2355fb(0x11d)]}:{},..._0x3565b8[_0x2355fb(0x121)]!==undefined?{'remark':_0x3565b8[_0x2355fb(0x121)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x2355fb(0x11e),'url':UPDATE_PATH});},async 'execute'(_0x369aaf){const _0x35c2fb=a236_0x125633,_0x2d6eae=_0x369aaf[_0x35c2fb(0x124)]('id'),_0x50607e=readPatch(_0x369aaf),_0x3f59e8=await getRoleById(_0x369aaf[_0x35c2fb(0x113)],_0x2d6eae);assertCustomRole(_0x3f59e8,_0x35c2fb(0x111)),await updateAppRole({'id':_0x2d6eae,'appCode':_0x369aaf['appCode'],..._0x50607e[_0x35c2fb(0x11d)]!==undefined?{'roleName':_0x50607e[_0x35c2fb(0x11d)]}:{},..._0x50607e[_0x35c2fb(0x121)]!==undefined?{'remark':_0x50607e[_0x35c2fb(0x121)]}:{}});const _0x56f06b=await getRoleById(_0x369aaf[_0x35c2fb(0x113)],_0x2d6eae);return{'ok':!![],'data':{'scope':_0x35c2fb(0x10a),'operation':_0x35c2fb(0x111),'selector':{'appCode':_0x369aaf['appCode'],'roleId':_0x2d6eae,'roleName':_0x56f06b[_0x35c2fb(0x11d)]},'before':projectRole(_0x3f59e8),'after':projectRole(_0x56f06b),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x35c2fb(0x119)+_0x56f06b['roleName']+_0x35c2fb(0x10b)+_0x2d6eae+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a237_0x577eeb=a237_0x18af;(function(_0x11d5ed,_0x29583f){const _0x2931ba=a237_0x18af,_0x182a05=_0x11d5ed();while(!![]){try{const _0x47085b=-parseInt(_0x2931ba(0xbb))/0x1*(-parseInt(_0x2931ba(0xb9))/0x2)+-parseInt(_0x2931ba(0xaf))/0x3*(parseInt(_0x2931ba(0xb1))/0x4)+-parseInt(_0x2931ba(0xa7))/0x5*(-parseInt(_0x2931ba(0xa8))/0x6)+-parseInt(_0x2931ba(0xae))/0x7+-parseInt(_0x2931ba(0xad))/0x8+parseInt(_0x2931ba(0xba))/0x9*(-parseInt(_0x2931ba(0xb6))/0xa)+parseInt(_0x2931ba(0xa9))/0xb;if(_0x47085b===_0x29583f)break;else _0x182a05['push'](_0x182a05['shift']());}catch(_0x11aed1){_0x182a05['push'](_0x182a05['shift']());}}}(a237_0xc9c5,0x43600));import{createDevUserRole}from'../../core/api-client.js';function a237_0xc9c5(){const _0x5e6646=['112zAIZpe','appCode','roleId','Added\x20user\x20','roleType','470600MjUHGD','POST','roleName','2FoRBES','90hSAbzT','110270AMxSqE','\x20already\x20in\x20role\x20','\x20to\x20role\x20','role','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','461255OjafRB','12qszgjq','20936806JBrome','No\x20change:\x20user\x20','user-add','selector','4129720tttiZu','3095393ZMKtRE','52836SGzPNk','userId'];a237_0xc9c5=function(){return _0x5e6646;};return a237_0xc9c5();}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';function a237_0x18af(_0x2fc3f1,_0x16afdb){_0x2fc3f1=_0x2fc3f1-0xa4;const _0xc9c58e=a237_0xc9c5();let _0x18af55=_0xc9c58e[_0x2fc3f1];return _0x18af55;}export const roleUserAdd={'service':a237_0x577eeb(0xa5),'command':'user-add','description':a237_0x577eeb(0xa6),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x130eac){const _0x103fb1=a237_0x577eeb,{mutation:_0x3760d7}=await prepareUserMutation(_0x130eac,_0x103fb1(0xab),!![]);return asDryRunResult(_0x3760d7,{'method':_0x103fb1(0xb7),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x4fa35e){const _0x1b3353=a237_0x577eeb,{mutation:_0x442578,changed:_0x2719e4,role:_0x35aebf,user:_0x144e30}=await prepareUserMutation(_0x4fa35e,_0x1b3353(0xab),![]);return _0x2719e4&&await createDevUserRole({'appCode':_0x4fa35e[_0x1b3353(0xb2)],'userId':_0x144e30[_0x1b3353(0xb0)],'username':_0x144e30['username'],'roleType':_0x35aebf[_0x1b3353(0xb5)],'roleId':_0x442578['selector'][_0x1b3353(0xb3)]}),{'ok':!![],'data':_0x442578,'message':_0x2719e4?_0x1b3353(0xb4)+_0x442578[_0x1b3353(0xac)]['userId']+_0x1b3353(0xa4)+_0x442578[_0x1b3353(0xac)][_0x1b3353(0xb8)]:_0x1b3353(0xaa)+_0x442578[_0x1b3353(0xac)]['userId']+_0x1b3353(0xbc)+_0x442578[_0x1b3353(0xac)][_0x1b3353(0xb8)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a238_0x223347=a238_0xcf35;(function(_0x41758d,_0x5be8aa){const _0x3f91f7=a238_0xcf35,_0x3d2a2c=_0x41758d();while(!![]){try{const _0xbf5738=-parseInt(_0x3f91f7(0x1c5))/0x1*(-parseInt(_0x3f91f7(0x1cb))/0x2)+-parseInt(_0x3f91f7(0x1da))/0x3*(parseInt(_0x3f91f7(0x1ce))/0x4)+-parseInt(_0x3f91f7(0x1c9))/0x5*(-parseInt(_0x3f91f7(0x1d1))/0x6)+parseInt(_0x3f91f7(0x1d3))/0x7+parseInt(_0x3f91f7(0x1c8))/0x8+parseInt(_0x3f91f7(0x1d0))/0x9+parseInt(_0x3f91f7(0x1d8))/0xa*(parseInt(_0x3f91f7(0x1d2))/0xb);if(_0xbf5738===_0x5be8aa)break;else _0x3d2a2c['push'](_0x3d2a2c['shift']());}catch(_0x4932f3){_0x3d2a2c['push'](_0x3d2a2c['shift']());}}}(a238_0x4047,0x3eda7));function a238_0x4047(){const _0x1d6400=['userId','role','4iTrkBm','high-risk-write','1342845UTzSGf','1130124adQuxw','1382722oAseBz','241822xmhuKE','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','POST','selector','No\x20change:\x20user\x20','10gkLLdq','\x20not\x20in\x20role\x20','1023441oNLwYP','27LXFwae','user-remove','roleName','160888GEgrNz','5YPzqAL','\x20from\x20role\x20','5976eFgZgz'];a238_0x4047=function(){return _0x1d6400;};return a238_0x4047();}import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a238_0xcf35(_0x25c955,_0x5d0847){_0x25c955=_0x25c955-0x1c5;const _0x4047a8=a238_0x4047();let _0xcf3571=_0x4047a8[_0x25c955];return _0xcf3571;}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';export const roleUserRemove={'service':a238_0x223347(0x1cd),'command':'user-remove','description':a238_0x223347(0x1d4),'risk':a238_0x223347(0x1cf),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x99573){const _0x2b7d5f=a238_0x223347,{mutation:_0x367d79}=await prepareUserMutation(_0x99573,_0x2b7d5f(0x1c6),!![]);return asDryRunResult(_0x367d79,{'method':_0x2b7d5f(0x1d5),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x5681f3){const _0x5808a5=a238_0x223347,{matchingRelationIds:_0x5e4851,mutation:_0x322cf9,changed:_0x3eb92a}=await prepareUserMutation(_0x5681f3,_0x5808a5(0x1c6),![]);if(_0x3eb92a)for(const _0x404097 of _0x5e4851){await deleteDevUserRole(_0x404097);}return{'ok':!![],'data':_0x322cf9,'message':_0x3eb92a?'Removed\x20user\x20'+_0x322cf9['selector'][_0x5808a5(0x1cc)]+_0x5808a5(0x1ca)+_0x322cf9[_0x5808a5(0x1d6)][_0x5808a5(0x1c7)]:_0x5808a5(0x1d7)+_0x322cf9['selector'][_0x5808a5(0x1cc)]+_0x5808a5(0x1d9)+_0x322cf9[_0x5808a5(0x1d6)][_0x5808a5(0x1c7)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a239_0x14bf(_0x15fec1,_0x30d634){_0x15fec1=_0x15fec1-0xf2;const _0x5a91cb=a239_0x5a91();let _0x14bf73=_0x5a91cb[_0x15fec1];return _0x14bf73;}function a239_0x5a91(){const _0x327ee5=['13715046bvikaC','55567900xfBSDe','userId','user-resolve','18grdHqe','148LQAnrH','role','68182SPuVrO','559118wRZBnP','name','24QWdVey','Pass\x20--name\x20<nickname|username>.','\x22\x20→\x20userId\x20','read','194205gzXocA','281920RDzBQQ','matchedBy','Resolved\x20\x22','str','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','8191904afplYO','username'];a239_0x5a91=function(){return _0x327ee5;};return a239_0x5a91();}const a239_0x2409cd=a239_0x14bf;(function(_0x4a257a,_0x21911c){const _0x571af7=a239_0x14bf,_0x2aeeea=_0x4a257a();while(!![]){try{const _0x359a78=-parseInt(_0x571af7(0xf4))/0x1+-parseInt(_0x571af7(0x102))/0x2*(parseInt(_0x571af7(0x105))/0x3)+-parseInt(_0x571af7(0x100))/0x4*(parseInt(_0x571af7(0xf3))/0x5)+-parseInt(_0x571af7(0xff))/0x6*(parseInt(_0x571af7(0x103))/0x7)+-parseInt(_0x571af7(0xf9))/0x8+-parseInt(_0x571af7(0xfb))/0x9+parseInt(_0x571af7(0xfc))/0xa;if(_0x359a78===_0x21911c)break;else _0x2aeeea['push'](_0x2aeeea['shift']());}catch(_0x126d9e){_0x2aeeea['push'](_0x2aeeea['shift']());}}}(a239_0x5a91,0xbdd31));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a239_0x2409cd(0x101),'command':a239_0x2409cd(0xfe),'description':a239_0x2409cd(0xf8),'risk':a239_0x2409cd(0xf2),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x417484){const _0x34956a=a239_0x2409cd;if(!_0x417484[_0x34956a(0xf7)]('name')['trim']())throw CliErrors['flagMissing']('name',_0x34956a(0x106));},async 'execute'(_0x839c23){const _0x251c9c=a239_0x2409cd,_0x5daa29=_0x839c23[_0x251c9c(0xf7)](_0x251c9c(0x104))['trim'](),_0x2a3174=await resolveUserRef(_0x5daa29,'Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.');return{'ok':!![],'data':{'user':{'userId':_0x2a3174['userId'],'username':_0x2a3174[_0x251c9c(0xfa)],'nickname':_0x2a3174['nickname'],'matchedBy':_0x2a3174[_0x251c9c(0xf5)]}},'message':_0x251c9c(0xf6)+_0x5daa29+_0x251c9c(0x107)+_0x2a3174[_0x251c9c(0xfd)]};}};
|
package/lib/commands/rule/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a240_0xefb1ab=a240_0x19e8;(function(_0xd3665b,_0x30f1a8){const _0x4c194f=a240_0x19e8,_0x36db62=_0xd3665b();while(!![]){try{const _0x55a2f8=parseInt(_0x4c194f(0xb7))/0x1*(parseInt(_0x4c194f(0xb5))/0x2)+parseInt(_0x4c194f(0xb3))/0x3+-parseInt(_0x4c194f(0xbb))/0x4+parseInt(_0x4c194f(0xb4))/0x5+-parseInt(_0x4c194f(0xb8))/0x6+parseInt(_0x4c194f(0xb2))/0x7+-parseInt(_0x4c194f(0xba))/0x8;if(_0x55a2f8===_0x30f1a8)break;else _0x36db62['push'](_0x36db62['shift']());}catch(_0x1018a3){_0x36db62['push'](_0x36db62['shift']());}}}(a240_0x14cf,0xb5c54));function a240_0x14cf(){const _0x9ad917=['rule','\x20for\x20','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','read','cookie','content','7355761HGixxs','3443145bUngPI','2316020BdDbiy','4vZOtjO','\x20--file\x20<path>\x20--dry-run`.','462556hMlCPw','2619522YYGXyn','appCode','17836872CgWqGN','704504VpdfNL','\x20is\x20not\x20configured\x20for\x20app\x20','Loaded\x20','app_rule_not_found','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app'];a240_0x14cf=function(){return _0x9ad917;};return a240_0x14cf();}function a240_0x19e8(_0x1c9a12,_0x71349b){_0x1c9a12=_0x1c9a12-0xac;const _0x14cf09=a240_0x14cf();let _0x19e8bd=_0x14cf09[_0x1c9a12];return _0x19e8bd;}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a240_0xefb1ab(0xac),'command':'get','description':a240_0xefb1ab(0xbf),'risk':a240_0xefb1ab(0xaf),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x4d6f64){readAppRuleType(_0x4d6f64);},async 'execute'(_0x5cc216){const _0x38cf12=a240_0xefb1ab,_0x32cd24=readAppRuleType(_0x5cc216),_0x98a628=await getAppRule(_0x5cc216[_0x38cf12(0xb0)],{'appCode':_0x5cc216[_0x38cf12(0xb9)],'type':_0x32cd24});if(!_0x98a628)throw appRuleError(_0x38cf12(0xbe),appRuleFileName(_0x32cd24)+_0x38cf12(0xbc)+_0x5cc216[_0x38cf12(0xb9)]+'.',_0x38cf12(0xae)+_0x32cd24+_0x38cf12(0xb6));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x32cd24,_0x98a628),'content':_0x98a628[_0x38cf12(0xb1)]}},'message':_0x38cf12(0xbd)+appRuleFileName(_0x32cd24)+_0x38cf12(0xad)+_0x5cc216[_0x38cf12(0xb9)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a241_0x5a01d1=a241_0x4513;(function(_0x29057b,_0x530efd){const _0x37bfa9=a241_0x4513,_0x40c2bd=_0x29057b();while(!![]){try{const _0x444bf8=parseInt(_0x37bfa9(0x1b6))/0x1*(-parseInt(_0x37bfa9(0x1bd))/0x2)+-parseInt(_0x37bfa9(0x1be))/0x3*(-parseInt(_0x37bfa9(0x1b2))/0x4)+-parseInt(_0x37bfa9(0x1b5))/0x5*(parseInt(_0x37bfa9(0x1b1))/0x6)+parseInt(_0x37bfa9(0x1b9))/0x7+-parseInt(_0x37bfa9(0x1b8))/0x8*(-parseInt(_0x37bfa9(0x1bc))/0x9)+-parseInt(_0x37bfa9(0x1b4))/0xa*(parseInt(_0x37bfa9(0x1ba))/0xb)+-parseInt(_0x37bfa9(0x1b0))/0xc*(-parseInt(_0x37bfa9(0x1bb))/0xd);if(_0x444bf8===_0x530efd)break;else _0x40c2bd['push'](_0x40c2bd['shift']());}catch(_0x37e282){_0x40c2bd['push'](_0x40c2bd['shift']());}}}(a241_0x1d07,0xdf841));import{withKbManagementSession}from'../../core/kb-management-client.js';import{ruleGet}from'../../commands/rule/get.js';function a241_0x4513(_0x1432a4,_0x59e8ea){_0x1432a4=_0x1432a4-0x1ae;const _0x1d0736=a241_0x1d07();let _0x451380=_0x1d0736[_0x1432a4];return _0x451380;}function a241_0x1d07(){const _0x2acd12=['execute','dryRun','5820bwIHSK','6nTSlUZ','16UGUBgs','signal','5841140oGOWYM','1727295uhPmqX','96349KbHcoS','map','1215352rfnRoU','6607839tKMxng','33zVFLoa','28691ZHIcvL','45ViISFZ','2XNciZQ','251778DBqmqy'];a241_0x1d07=function(){return _0x2acd12;};return a241_0x1d07();}import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet][a241_0x5a01d1(0x1b7)](_0x1ef5b9=>({..._0x1ef5b9,'execute':_0x1ac6c7=>withKbManagementSession(_0x1ac6c7['signal'],()=>_0x1ef5b9[a241_0x5a01d1(0x1ae)](_0x1ac6c7)),..._0x1ef5b9[a241_0x5a01d1(0x1af)]?{'dryRun':_0x102617=>withKbManagementSession(_0x102617[a241_0x5a01d1(0x1b3)],()=>_0x1ef5b9[a241_0x5a01d1(0x1af)](_0x102617))}:{}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a242_0x4da0da=a242_0x2212;function a242_0x4ab4(){const _0xf2973a=['rule','cookie','762081EbgumW','16wsHHcs','read','6137256mEDREe','list','all','59717kLNfTd','Loaded\x20app\x20rule\x20configuration\x20for\x20','877108wstNGr','882wFzhsP','length','14319891obioPd','1162554EONIMR','appCode','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','map','1883885xqMzML'];a242_0x4ab4=function(){return _0xf2973a;};return a242_0x4ab4();}function a242_0x2212(_0x57e359,_0x54666a){_0x57e359=_0x57e359-0x1ca;const _0x4ab433=a242_0x4ab4();let _0x221253=_0x4ab433[_0x57e359];return _0x221253;}(function(_0x3dd2fa,_0x1b2ee4){const _0x326477=a242_0x2212,_0x251242=_0x3dd2fa();while(!![]){try{const _0x2496fc=parseInt(_0x326477(0x1cb))/0x1+-parseInt(_0x326477(0x1da))/0x2+parseInt(_0x326477(0x1d2))/0x3+parseInt(_0x326477(0x1d5))/0x4+parseInt(_0x326477(0x1cf))/0x5+-parseInt(_0x326477(0x1db))/0x6*(-parseInt(_0x326477(0x1d8))/0x7)+parseInt(_0x326477(0x1d3))/0x8*(-parseInt(_0x326477(0x1ca))/0x9);if(_0x2496fc===_0x1b2ee4)break;else _0x251242['push'](_0x251242['shift']());}catch(_0x4c2547){_0x251242['push'](_0x251242['shift']());}}}(a242_0x4ab4,0xea9d1));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':a242_0x4da0da(0x1d0),'command':a242_0x4da0da(0x1d6),'description':a242_0x4da0da(0x1cd),'risk':a242_0x4da0da(0x1d4),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x3e02db){const _0x41e2fb=a242_0x4da0da,_0x58e48a=await Promise[_0x41e2fb(0x1d7)](APP_RULE_TYPES[_0x41e2fb(0x1ce)](_0x1aa2bd=>getAppRule(_0x3e02db[_0x41e2fb(0x1d1)],{'appCode':_0x3e02db['appCode'],'type':_0x1aa2bd}))),_0x3907af=APP_RULE_TYPES['map']((_0x26c9b6,_0x5183cb)=>projectAppRule(_0x26c9b6,_0x58e48a[_0x5183cb]??null));return{'ok':!![],'data':{'total':_0x3907af[_0x41e2fb(0x1dc)],'rules':_0x3907af},'message':_0x41e2fb(0x1d9)+_0x3e02db[_0x41e2fb(0x1cc)]};}};
|
package/lib/commands/rule/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a243_0x4c1c(){const _0x207ae0=['Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','file','expected-version','12zWghQS','app_rule_verification_failed','cookie',';\x20current\x20version\x20is\x20','\x20version\x20changed\x20before\x20write.','flag','460884IlTMRY','POST','before','The\x20set\x20request\x20was\x20sent,\x20but\x20','DATABASE','5825865GBQfAO','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','unconfigured','create','type','version','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','set','defineProperty','716588StjGsB','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','rabetbase\x20rule\x20get\x20--type\x20','--file\x20is\x20required.','replacement','app_rule_set_outcome_unknown','app_rule_content_too_large','trim','2OkxlEu','app_rule_verification_unavailable','expectedVersion','\x20could\x20not\x20be\x20verified.','contentHash','string','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','write','input','19481LVqBhP','isSafeInteger','update','appCode','beforeRecord','verified','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','28EdLxjK','byteSize','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','18228wJvbZm','content','1685994qLvUrk','13350490liLoCI','RULES','9431472LMqvQT','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','rules','\x20for\x20','Pass\x20a\x20UTF-8\x20Markdown\x20file.','Expected\x20','app_rule_file_required','9mHtvod','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set'];a243_0x4c1c=function(){return _0x207ae0;};return a243_0x4c1c();}const a243_0x29ae8e=a243_0x484f;(function(_0x5acf1d,_0x5b9b7f){const _0x1e5724=a243_0x484f,_0x35f800=_0x5acf1d();while(!![]){try{const _0xc69b78=-parseInt(_0x1e5724(0x19d))/0x1*(-parseInt(_0x1e5724(0x1a6))/0x2)+parseInt(_0x1e5724(0x18f))/0x3*(-parseInt(_0x1e5724(0x189))/0x4)+-parseInt(_0x1e5724(0x194))/0x5+-parseInt(_0x1e5724(0x1bb))/0x6*(parseInt(_0x1e5724(0x1b6))/0x7)+-parseInt(_0x1e5724(0x1be))/0x8+-parseInt(_0x1e5724(0x184))/0x9*(-parseInt(_0x1e5724(0x1bc))/0xa)+parseInt(_0x1e5724(0x1af))/0xb*(parseInt(_0x1e5724(0x1b9))/0xc);if(_0xc69b78===_0x5b9b7f)break;else _0x35f800['push'](_0x35f800['shift']());}catch(_0x3a10a5){_0x35f800['push'](_0x35f800['shift']());}}}(a243_0x4c1c,0xc66ff));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';function readSetInput(_0x3c185f){const _0x1e825e=a243_0x484f,_0xf852d1=readAppRuleType(_0x3c185f),_0x2dea44=_0x3c185f['str'](_0x1e825e(0x187))[_0x1e825e(0x1a5)]();if(!_0x2dea44)throw appRuleError(_0x1e825e(0x183),_0x1e825e(0x1a1),_0x1e825e(0x1c2));const _0x5ae5d4=_0x3c185f[_0x1e825e(0x18e)]('expected-version');let _0x62a1dc;if(_0x5ae5d4!==undefined){_0x62a1dc=Number(_0x5ae5d4);if(!Number[_0x1e825e(0x1b0)](_0x62a1dc)||_0x62a1dc<0x0)throw appRuleError('app_rule_expected_version_invalid',_0x1e825e(0x1b8));}return{'type':_0xf852d1,'file':_0x2dea44,'expectedVersion':_0x62a1dc};}async function prepareSet(_0x51ecd0){const _0x38b423=a243_0x484f,_0x218674=readSetInput(_0x51ecd0),_0x43941c=await readAppRuleFile(_0x218674['file']);if(_0x218674[_0x38b423(0x198)]===_0x38b423(0x1c0)&&_0x43941c[_0x38b423(0x1ba)]['length']>0x7d0)throw appRuleError(_0x38b423(0x1a4),_0x38b423(0x19e));const _0x5de74a=await getAppRule(_0x51ecd0['cookie'],{'appCode':_0x51ecd0['appCode'],'type':_0x218674[_0x38b423(0x198)]});if(_0x218674[_0x38b423(0x1a8)]!==undefined&&(_0x5de74a?.[_0x38b423(0x199)]??0x0)!==_0x218674[_0x38b423(0x1a8)])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x218674[_0x38b423(0x198)])+_0x38b423(0x18d),_0x38b423(0x1c3)+_0x218674[_0x38b423(0x1a8)]+_0x38b423(0x18c)+(_0x5de74a?.[_0x38b423(0x199)]??_0x38b423(0x196))+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x218674,'replacement':_0x43941c,'beforeRecord':_0x5de74a,'before':projectAppRule(_0x218674[_0x38b423(0x198)],_0x5de74a),'planned':{'type':_0x218674['type'],'fileName':appRuleFileName(_0x218674[_0x38b423(0x198)]),'contextScope':appRuleContextScope(_0x218674[_0x38b423(0x198)]),'enabled':!![],'appCode':_0x51ecd0[_0x38b423(0x1b2)],'scope':_0x38b423(0x1c0),'contentByteSize':_0x43941c[_0x38b423(0x1b7)],'contentHash':_0x43941c[_0x38b423(0x1aa)]}};}function warningsFor(_0x47e968){return[];}function a243_0x484f(_0x4d3fe0,_0x98d6ba){_0x4d3fe0=_0x4d3fe0-0x183;const _0x4c1cf9=a243_0x4c1c();let _0x484f9c=_0x4c1cf9[_0x4d3fe0];return _0x484f9c;}export const ruleSet={'service':'rule','command':a243_0x29ae8e(0x19b),'description':a243_0x29ae8e(0x186),'risk':a243_0x29ae8e(0x1ad),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x29ae8e(0x187),'type':a243_0x29ae8e(0x1ab),'required':!![],'description':a243_0x29ae8e(0x1ac)},{'name':a243_0x29ae8e(0x188),'type':'number','required':![],'description':a243_0x29ae8e(0x185)}],async 'validate'(_0x505a81){readSetInput(_0x505a81);},async 'dryRun'(_0x241b68){const _0x146ad1=a243_0x29ae8e,_0x5aca7c=await prepareSet(_0x241b68);return asDryRunResult({'operation':_0x146ad1(0x19b),'selector':{'appCode':_0x241b68[_0x146ad1(0x1b2)],'scope':_0x146ad1(0x1c0),'type':_0x5aca7c['input'][_0x146ad1(0x198)]},'before':_0x5aca7c[_0x146ad1(0x191)],'after':_0x5aca7c['planned'],'dryRun':!![],'backend':{'method':_0x146ad1(0x190),'path':knowledgeDocumentsPath('rules',_0x5aca7c[_0x146ad1(0x1b3)]?_0x146ad1(0x1b1):_0x146ad1(0x197)),'body':{'appCode':_0x241b68[_0x146ad1(0x1b2)],..._0x5aca7c['beforeRecord']?{'id':_0x5aca7c['beforeRecord']['id']}:{},'title':_0x5aca7c[_0x146ad1(0x1ae)]['type']===_0x146ad1(0x1c0)?_0x146ad1(0x1bd):_0x146ad1(0x193),'contentHash':_0x5aca7c[_0x146ad1(0x1a2)][_0x146ad1(0x1aa)],'contentByteSize':_0x5aca7c['replacement'][_0x146ad1(0x1b7)],..._0x5aca7c[_0x146ad1(0x1b3)]?{'expectedVersion':_0x5aca7c['beforeRecord']['version']}:{}}},'warnings':warningsFor(_0x5aca7c[_0x146ad1(0x1ae)]['expectedVersion']),'verification':{'expectedVersion':_0x5aca7c[_0x146ad1(0x1b3)]?.[_0x146ad1(0x199)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x146ad1(0x1a0)+_0x5aca7c['input'][_0x146ad1(0x198)]+'\x20--format\x20compress'}},{'method':_0x146ad1(0x190),'url':knowledgeDocumentsPath(_0x146ad1(0x1c0),_0x5aca7c[_0x146ad1(0x1b3)]?_0x146ad1(0x1b1):_0x146ad1(0x197))});},async 'execute'(_0x4ede9f){const _0x26f7dc=a243_0x29ae8e,_0xbc2c2b=await prepareSet(_0x4ede9f),_0x26065f=_0xbc2c2b[_0x26f7dc(0x1b3)]===null?0x1:_0xbc2c2b[_0x26f7dc(0x1b3)]['version']+(_0xbc2c2b[_0x26f7dc(0x1b3)][_0x26f7dc(0x1ba)]===_0xbc2c2b[_0x26f7dc(0x1a2)]['content']?0x0:0x1);let _0x35a2df,_0x1400fc=![];try{_0x35a2df=await saveAppRule(_0x4ede9f['cookie'],{'appCode':_0x4ede9f[_0x26f7dc(0x1b2)],'type':_0xbc2c2b[_0x26f7dc(0x1ae)][_0x26f7dc(0x198)],'content':_0xbc2c2b[_0x26f7dc(0x1a2)][_0x26f7dc(0x1ba)],'expectedVersion':_0xbc2c2b[_0x26f7dc(0x1b3)]?.[_0x26f7dc(0x199)]??0x0,..._0xbc2c2b[_0x26f7dc(0x1b3)]?{'id':_0xbc2c2b[_0x26f7dc(0x1b3)]['id']}:{}});if(_0x35a2df[_0x26f7dc(0x199)]!==_0x26065f||_0x35a2df[_0x26f7dc(0x1ba)]!==_0xbc2c2b['replacement']['content']||_0xbc2c2b['beforeRecord']!==null&&_0x35a2df['id']!==_0xbc2c2b[_0x26f7dc(0x1b3)]['id'])throw appRuleError('app_rule_verification_failed',_0x26f7dc(0x19a),'Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.');}catch(_0x3b00d6){if(!isPlatformTransportFailure(_0x3b00d6))throw _0x3b00d6;_0x1400fc=!![];}let _0x31ddd6;try{_0x31ddd6=await getAppRule(_0x4ede9f[_0x26f7dc(0x18b)],{'appCode':_0x4ede9f['appCode'],'type':_0xbc2c2b[_0x26f7dc(0x1ae)]['type']});}catch(_0x5b0e19){const _0x576e26=appRuleError(_0x1400fc?_0x26f7dc(0x1a3):_0x26f7dc(0x1a7),_0x26f7dc(0x192)+appRuleFileName(_0xbc2c2b[_0x26f7dc(0x1ae)]['type'])+_0x26f7dc(0x1a9),_0x26f7dc(0x1b5));Object[_0x26f7dc(0x19c)](_0x576e26,'cause',{'value':_0x5b0e19,'enumerable':![]});throw _0x576e26;}const _0x599817=_0x31ddd6&&inspectAppRuleContent(_0x31ddd6[_0x26f7dc(0x1ba)])['contentHash']===_0xbc2c2b[_0x26f7dc(0x1a2)][_0x26f7dc(0x1aa)],_0x312d3f=_0x31ddd6&&_0x31ddd6[_0x26f7dc(0x199)]===_0x26065f&&(!_0x35a2df||_0x31ddd6['id']===_0x35a2df['id']&&_0x31ddd6[_0x26f7dc(0x199)]===_0x35a2df[_0x26f7dc(0x199)]);if(!_0x31ddd6||!_0x599817||!_0x312d3f||_0xbc2c2b[_0x26f7dc(0x1b3)]!==null&&_0x31ddd6['id']!==_0xbc2c2b[_0x26f7dc(0x1b3)]['id'])throw appRuleError(_0x1400fc?'app_rule_set_outcome_unknown':_0x26f7dc(0x18a),appRuleFileName(_0xbc2c2b['input'][_0x26f7dc(0x198)])+'\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.',_0x26f7dc(0x1bf)+_0xbc2c2b[_0x26f7dc(0x1ae)][_0x26f7dc(0x198)]+_0x26f7dc(0x195));const _0x320160=warningsFor(_0xbc2c2b['input']['expectedVersion']);_0x1400fc&&_0x320160['push'](_0x26f7dc(0x19f));const _0x5ae8dc=projectAppRule(_0xbc2c2b['input'][_0x26f7dc(0x198)],_0x31ddd6);return{'ok':!![],'data':{'operation':_0x26f7dc(0x19b),'selector':{'appCode':_0x4ede9f[_0x26f7dc(0x1b2)],'scope':_0x26f7dc(0x1c0),'type':_0xbc2c2b[_0x26f7dc(0x1ae)]['type']},'before':_0xbc2c2b[_0x26f7dc(0x191)],'after':_0x5ae8dc,'dryRun':![],'backend':{'method':'POST','path':knowledgeDocumentsPath('rules',_0xbc2c2b[_0x26f7dc(0x1b3)]?_0x26f7dc(0x1b1):'create')},'warnings':_0x320160,'verification':{'status':_0x26f7dc(0x1b4),'recoveredAfterUnknownResponse':_0x1400fc,'expectedVersion':_0xbc2c2b[_0x26f7dc(0x1b3)]?.[_0x26f7dc(0x199)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x26f7dc(0x1a0)+_0xbc2c2b[_0x26f7dc(0x1ae)][_0x26f7dc(0x198)]+'\x20--format\x20compress'}},'message':'Set\x20'+appRuleFileName(_0xbc2c2b[_0x26f7dc(0x1ae)][_0x26f7dc(0x198)])+_0x26f7dc(0x1c1)+_0x4ede9f[_0x26f7dc(0x1b2)]};}};
|
|
1
|
+
const a243_0x3f3639=a243_0x3d3c;(function(_0x456dd0,_0x19fcf9){const _0x5d082f=a243_0x3d3c,_0x468181=_0x456dd0();while(!![]){try{const _0x448c86=parseInt(_0x5d082f(0x142))/0x1*(-parseInt(_0x5d082f(0x145))/0x2)+-parseInt(_0x5d082f(0x11a))/0x3+parseInt(_0x5d082f(0x129))/0x4+-parseInt(_0x5d082f(0x148))/0x5*(-parseInt(_0x5d082f(0x14c))/0x6)+-parseInt(_0x5d082f(0x127))/0x7+parseInt(_0x5d082f(0x115))/0x8*(-parseInt(_0x5d082f(0x12c))/0x9)+parseInt(_0x5d082f(0x125))/0xa;if(_0x448c86===_0x19fcf9)break;else _0x468181['push'](_0x468181['shift']());}catch(_0x4ce1bb){_0x468181['push'](_0x468181['shift']());}}}(a243_0x4119,0x43e5b));function a243_0x4119(){const _0x196a3b=['\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','file','string',';\x20current\x20version\x20is\x20','\x20for\x20','number','Expected\x20','cookie','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','app_rule_expected_version_invalid','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','content','app_rule_verification_failed','rules','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','str','push','2399DEZOYn','unconfigured','planned','88XGLTOP','appCode','expectedVersion','11945drfVfF','\x20--format\x20compress','type','before','1050xMzSEO','replacement','contentHash','trim','beforeRecord','version','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','2592536VtmQTN','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','POST','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','rule','1525797zwnzqe','expected-version','The\x20set\x20request\x20was\x20sent,\x20but\x20','create','\x20version\x20changed\x20before\x20write.','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','byteSize','--file\x20is\x20required.','app_rule_set_outcome_unknown','flag','input','8533170SAElHG','rabetbase\x20rule\x20get\x20--type\x20','1518076OxJBMX','isSafeInteger','647220rgEhFh','Set\x20','update','9CvmZqO','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','DATABASE'];a243_0x4119=function(){return _0x196a3b;};return a243_0x4119();}import{knowledgeDocumentsPath}from'../../core/api-client.js';function a243_0x3d3c(_0x58f1d5,_0xed2b65){_0x58f1d5=_0x58f1d5-0x112;const _0x411923=a243_0x4119();let _0x3d3cfb=_0x411923[_0x58f1d5];return _0x3d3cfb;}import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';function readSetInput(_0x34d28a){const _0x23088a=a243_0x3d3c,_0x3d35f6=readAppRuleType(_0x34d28a),_0x53f610=_0x34d28a[_0x23088a(0x140)](_0x23088a(0x130))[_0x23088a(0x14f)]();if(!_0x53f610)throw appRuleError('app_rule_file_required',_0x23088a(0x121),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x43f723=_0x34d28a[_0x23088a(0x123)](_0x23088a(0x11b));let _0x4c171d;if(_0x43f723!==undefined){_0x4c171d=Number(_0x43f723);if(!Number[_0x23088a(0x128)](_0x4c171d)||_0x4c171d<0x0)throw appRuleError(_0x23088a(0x139),_0x23088a(0x12d));}return{'type':_0x3d35f6,'file':_0x53f610,'expectedVersion':_0x4c171d};}async function prepareSet(_0x30fa3e){const _0x591296=a243_0x3d3c,_0x283801=readSetInput(_0x30fa3e),_0x22f8b7=await readAppRuleFile(_0x283801[_0x591296(0x130)]);if(_0x283801[_0x591296(0x14a)]===_0x591296(0x13e)&&_0x22f8b7[_0x591296(0x13c)]['length']>0x7d0)throw appRuleError('app_rule_content_too_large',_0x591296(0x137));const _0x458f09=await getAppRule(_0x30fa3e[_0x591296(0x136)],{'appCode':_0x30fa3e[_0x591296(0x146)],'type':_0x283801[_0x591296(0x14a)]});if(_0x283801['expectedVersion']!==undefined&&(_0x458f09?.[_0x591296(0x113)]??0x0)!==_0x283801[_0x591296(0x147)])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x283801[_0x591296(0x14a)])+_0x591296(0x11e),_0x591296(0x135)+_0x283801[_0x591296(0x147)]+_0x591296(0x132)+(_0x458f09?.[_0x591296(0x113)]??_0x591296(0x143))+_0x591296(0x11f));return{'input':_0x283801,'replacement':_0x22f8b7,'beforeRecord':_0x458f09,'before':projectAppRule(_0x283801['type'],_0x458f09),'planned':{'type':_0x283801[_0x591296(0x14a)],'fileName':appRuleFileName(_0x283801[_0x591296(0x14a)]),'contextScope':appRuleContextScope(_0x283801[_0x591296(0x14a)]),'enabled':!![],'appCode':_0x30fa3e[_0x591296(0x146)],'scope':'rules','contentByteSize':_0x22f8b7[_0x591296(0x120)],'contentHash':_0x22f8b7[_0x591296(0x14e)]}};}function warningsFor(_0x37a4ea){return[];}export const ruleSet={'service':a243_0x3f3639(0x119),'command':'set','description':a243_0x3f3639(0x118),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x3f3639(0x130),'type':a243_0x3f3639(0x131),'required':!![],'description':a243_0x3f3639(0x116)},{'name':a243_0x3f3639(0x11b),'type':a243_0x3f3639(0x134),'required':![],'description':'Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set'}],async 'validate'(_0x41defa){readSetInput(_0x41defa);},async 'dryRun'(_0x1bc78c){const _0x4a515e=a243_0x3f3639,_0x486958=await prepareSet(_0x1bc78c);return asDryRunResult({'operation':'set','selector':{'appCode':_0x1bc78c[_0x4a515e(0x146)],'scope':'rules','type':_0x486958[_0x4a515e(0x124)][_0x4a515e(0x14a)]},'before':_0x486958[_0x4a515e(0x14b)],'after':_0x486958[_0x4a515e(0x144)],'dryRun':!![],'backend':{'method':_0x4a515e(0x117),'path':knowledgeDocumentsPath('rules',_0x486958[_0x4a515e(0x112)]?_0x4a515e(0x12b):_0x4a515e(0x11d)),'body':{'appCode':_0x1bc78c[_0x4a515e(0x146)],..._0x486958['beforeRecord']?{'id':_0x486958[_0x4a515e(0x112)]['id']}:{},'title':_0x486958[_0x4a515e(0x124)][_0x4a515e(0x14a)]===_0x4a515e(0x13e)?'RULES':_0x4a515e(0x12e),'contentHash':_0x486958['replacement'][_0x4a515e(0x14e)],'contentByteSize':_0x486958['replacement'][_0x4a515e(0x120)],..._0x486958['beforeRecord']?{'expectedVersion':_0x486958[_0x4a515e(0x112)][_0x4a515e(0x113)]}:{}}},'warnings':warningsFor(_0x486958[_0x4a515e(0x124)][_0x4a515e(0x147)]),'verification':{'expectedVersion':_0x486958[_0x4a515e(0x112)]?.[_0x4a515e(0x113)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x4a515e(0x126)+_0x486958[_0x4a515e(0x124)]['type']+_0x4a515e(0x149)}},{'method':'POST','url':knowledgeDocumentsPath(_0x4a515e(0x13e),_0x486958[_0x4a515e(0x112)]?_0x4a515e(0x12b):_0x4a515e(0x11d))});},async 'execute'(_0x37293a){const _0x29652c=a243_0x3f3639,_0x18e20a=await prepareSet(_0x37293a),_0x5e0335=_0x18e20a[_0x29652c(0x112)]===null?0x1:_0x18e20a[_0x29652c(0x112)][_0x29652c(0x113)]+(_0x18e20a[_0x29652c(0x112)][_0x29652c(0x13c)]===_0x18e20a['replacement']['content']?0x0:0x1);let _0x718a8e,_0x3fe441=![];try{_0x718a8e=await saveAppRule(_0x37293a[_0x29652c(0x136)],{'appCode':_0x37293a[_0x29652c(0x146)],'type':_0x18e20a['input'][_0x29652c(0x14a)],'content':_0x18e20a[_0x29652c(0x14d)][_0x29652c(0x13c)],'expectedVersion':_0x18e20a['beforeRecord']?.['version']??0x0,..._0x18e20a[_0x29652c(0x112)]?{'id':_0x18e20a[_0x29652c(0x112)]['id']}:{}});if(_0x718a8e[_0x29652c(0x113)]!==_0x5e0335||_0x718a8e['content']!==_0x18e20a[_0x29652c(0x14d)][_0x29652c(0x13c)]||_0x18e20a[_0x29652c(0x112)]!==null&&_0x718a8e['id']!==_0x18e20a[_0x29652c(0x112)]['id'])throw appRuleError(_0x29652c(0x13d),'The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.',_0x29652c(0x138));}catch(_0x3f4804){if(!isPlatformTransportFailure(_0x3f4804))throw _0x3f4804;_0x3fe441=!![];}let _0x1e18e0;try{_0x1e18e0=await getAppRule(_0x37293a[_0x29652c(0x136)],{'appCode':_0x37293a[_0x29652c(0x146)],'type':_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)]});}catch(_0x1ac9bc){const _0xe7d65e=appRuleError(_0x3fe441?_0x29652c(0x122):'app_rule_verification_unavailable',_0x29652c(0x11c)+appRuleFileName(_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)])+'\x20could\x20not\x20be\x20verified.',_0x29652c(0x13b));Object['defineProperty'](_0xe7d65e,'cause',{'value':_0x1ac9bc,'enumerable':![]});throw _0xe7d65e;}const _0x1d0c9a=_0x1e18e0&&inspectAppRuleContent(_0x1e18e0[_0x29652c(0x13c)])[_0x29652c(0x14e)]===_0x18e20a[_0x29652c(0x14d)][_0x29652c(0x14e)],_0x73c373=_0x1e18e0&&_0x1e18e0[_0x29652c(0x113)]===_0x5e0335&&(!_0x718a8e||_0x1e18e0['id']===_0x718a8e['id']&&_0x1e18e0[_0x29652c(0x113)]===_0x718a8e[_0x29652c(0x113)]);if(!_0x1e18e0||!_0x1d0c9a||!_0x73c373||_0x18e20a[_0x29652c(0x112)]!==null&&_0x1e18e0['id']!==_0x18e20a['beforeRecord']['id'])throw appRuleError(_0x3fe441?_0x29652c(0x122):'app_rule_verification_failed',appRuleFileName(_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)])+_0x29652c(0x12f),_0x29652c(0x13a)+_0x18e20a[_0x29652c(0x124)]['type']+_0x29652c(0x114));const _0x42fa75=warningsFor(_0x18e20a['input'][_0x29652c(0x147)]);_0x3fe441&&_0x42fa75[_0x29652c(0x141)](_0x29652c(0x13f));const _0x46218e=projectAppRule(_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)],_0x1e18e0);return{'ok':!![],'data':{'operation':'set','selector':{'appCode':_0x37293a[_0x29652c(0x146)],'scope':_0x29652c(0x13e),'type':_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)]},'before':_0x18e20a[_0x29652c(0x14b)],'after':_0x46218e,'dryRun':![],'backend':{'method':'POST','path':knowledgeDocumentsPath(_0x29652c(0x13e),_0x18e20a[_0x29652c(0x112)]?_0x29652c(0x12b):_0x29652c(0x11d))},'warnings':_0x42fa75,'verification':{'status':'verified','recoveredAfterUnknownResponse':_0x3fe441,'expectedVersion':_0x18e20a[_0x29652c(0x112)]?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x29652c(0x126)+_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)]+'\x20--format\x20compress'}},'message':_0x29652c(0x12a)+appRuleFileName(_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)])+_0x29652c(0x133)+_0x37293a[_0x29652c(0x146)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a244_0x3d4fe3=a244_0x8735;(function(_0x5b8359,_0x40172d){const _0x111fd2=a244_0x8735,_0x146c8c=_0x5b8359();while(!![]){try{const _0x58dbd0=-parseInt(_0x111fd2(0xd8))/0x1*(-parseInt(_0x111fd2(0xed))/0x2)+parseInt(_0x111fd2(0xd9))/0x3+parseInt(_0x111fd2(0xf2))/0x4*(parseInt(_0x111fd2(0xe0))/0x5)+parseInt(_0x111fd2(0xcd))/0x6+parseInt(_0x111fd2(0xf6))/0x7*(-parseInt(_0x111fd2(0xde))/0x8)+parseInt(_0x111fd2(0xce))/0x9*(-parseInt(_0x111fd2(0xf3))/0xa)+parseInt(_0x111fd2(0xe2))/0xb*(parseInt(_0x111fd2(0xeb))/0xc);if(_0x58dbd0===_0x40172d)break;else _0x146c8c['push'](_0x146c8c['shift']());}catch(_0x295f51){_0x146c8c['push'](_0x146c8c['shift']());}}}(a244_0x59d7,0x71805));function a244_0x8735(_0x4f31ae,_0x1712e8){_0x4f31ae=_0x4f31ae-0xc7;const _0x59d7f3=a244_0x59d7();let _0x8735aa=_0x59d7f3[_0x4f31ae];return _0x8735aa;}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_0x3d4fe3(0xcb),a244_0x3d4fe3(0xf0)];export const MAX_APP_RULE_UNITS=0x5*0x400*0x400;export const MAX_APP_RULE_BYTES=MAX_APP_RULE_UNITS*0x4;const APP_RULE_FILES={'rules':a244_0x3d4fe3(0xcf),'database':'DATABASE.md'},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x3d4fe3(0xe9),'database':a244_0x3d4fe3(0xd1)};function a244_0x59d7(){const _0x16d24b=['653986frFeia','string','indexStatus','database','hex','533164HgVEJU','540490GbubMc','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','str','1082291BEeDav','app_rule_content_invalid','createTime','utf8','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','app_rule_content_too_large','toLowerCase','updateTime','sha256','update','rules','utf-8','794958NUgEYI','135sRAinO','RULES.md','appCode','database-analysis','App\x20rule\x20file\x20is\x20blank:\x20','length','app_rule_file_unreadable','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','app_rule_type_invalid','1Rgdqwj','402330qUcaeB','decode','byteLength','contentHash','--file\x20is\x20required.','8VhNvjH','message','10QyfArK','byteSize','11BRGRxL','type','sha256:','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','digest','scope','trim','page-api-development','size','6840852CkHVCk','version'];a244_0x59d7=function(){return _0x16d24b;};return a244_0x59d7();}export function appRuleError(_0x2c8b0a,_0x37482c,_0x59d9f4){return new CliError(_0x2c8b0a,0x1,_0x37482c,_0x59d9f4);}export function readAppRuleType(_0x500071){const _0x168d3b=a244_0x3d4fe3,_0x7bc338=_0x500071[_0x168d3b(0xf5)]('type')[_0x168d3b(0xe8)]()[_0x168d3b(0xc7)]();if(_0x7bc338!==_0x168d3b(0xcb)&&_0x7bc338!==_0x168d3b(0xf0))throw appRuleError(_0x168d3b(0xd7),_0x168d3b(0xe5));return _0x7bc338;}export function appRuleFileName(_0x3bb6fa){return APP_RULE_FILES[_0x3bb6fa];}export function appRuleContextScope(_0x5b0f32){return APP_RULE_CONTEXT_SCOPES[_0x5b0f32];}export function inspectAppRuleContent(_0x59172c){const _0x37f576=a244_0x3d4fe3,_0x3d1c79=Buffer['from'](_0x59172c,_0x37f576(0xf9));return{'content':_0x59172c,'byteSize':_0x3d1c79[_0x37f576(0xdb)],'contentHash':_0x37f576(0xe4)+createHash(_0x37f576(0xc9))[_0x37f576(0xca)](_0x3d1c79)[_0x37f576(0xe6)](_0x37f576(0xf1))};}export async function readAppRuleFile(_0x5de938){const _0x1c1231=a244_0x3d4fe3,_0x338e08=_0x5de938[_0x1c1231(0xe8)]();if(!_0x338e08)throw appRuleError('app_rule_file_required',_0x1c1231(0xdd),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x396773=resolve(_0x338e08);let _0x115795;try{_0x115795=await stat(_0x396773);}catch(_0x54d22d){throw appRuleError(_0x1c1231(0xd4),'Cannot\x20access\x20app\x20rule\x20file:\x20'+_0x338e08,_0x54d22d instanceof Error?_0x54d22d[_0x1c1231(0xdf)]:String(_0x54d22d));}if(!_0x115795['isFile']())throw appRuleError('app_rule_file_invalid',_0x1c1231(0xd6)+_0x338e08);if(_0x115795[_0x1c1231(0xea)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x1c1231(0xfb),'App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.');let _0x3343ba;try{_0x3343ba=await readFile(_0x396773);}catch(_0x12cb19){throw appRuleError(_0x1c1231(0xd4),'Cannot\x20read\x20app\x20rule\x20file:\x20'+_0x338e08,_0x12cb19 instanceof Error?_0x12cb19[_0x1c1231(0xdf)]:String(_0x12cb19));}if(_0x3343ba['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError(_0x1c1231(0xfb),_0x1c1231(0xfa));let _0x5c1abd;try{_0x5c1abd=new TextDecoder(_0x1c1231(0xcc),{'fatal':!![],'ignoreBOM':!![]})[_0x1c1231(0xda)](_0x3343ba);}catch{throw appRuleError(_0x1c1231(0xf7),_0x1c1231(0xd5)+_0x338e08);}if(_0x5c1abd[_0x1c1231(0xd3)]>MAX_APP_RULE_UNITS)throw appRuleError(_0x1c1231(0xfb),_0x1c1231(0xf4));if(!_0x5c1abd[_0x1c1231(0xe8)]())throw appRuleError('app_rule_content_invalid',_0x1c1231(0xd2)+_0x338e08);return inspectAppRuleContent(_0x5c1abd);}export function projectAppRule(_0x4179b7,_0x50d91e){const _0x246246=a244_0x3d4fe3;if(!_0x50d91e)return{'type':_0x4179b7,'fileName':appRuleFileName(_0x4179b7),'contextScope':appRuleContextScope(_0x4179b7),'enabled':![]};const _0x2d72d4=inspectAppRuleContent(_0x50d91e['content']);return{'type':_0x4179b7,'fileName':appRuleFileName(_0x4179b7),'contextScope':appRuleContextScope(_0x4179b7),'enabled':!![],'id':_0x50d91e['id'],'scope':_0x50d91e[_0x246246(0xe7)],'appCode':_0x50d91e[_0x246246(0xd0)],'version':_0x50d91e[_0x246246(0xec)],..._0x50d91e['indexStatus']!==undefined?{'indexStatus':_0x50d91e[_0x246246(0xef)]}:{},'contentByteSize':_0x2d72d4[_0x246246(0xe1)],'contentHash':_0x2d72d4[_0x246246(0xdc)],..._0x50d91e[_0x246246(0xf8)]!==undefined&&_0x50d91e['createTime']!==null?{'createTime':_0x50d91e[_0x246246(0xf8)]}:{},..._0x50d91e[_0x246246(0xc8)]!==undefined&&_0x50d91e[_0x246246(0xc8)]!==null?{'updateTime':_0x50d91e[_0x246246(0xc8)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x3d4fe3(0xe3),'type':a244_0x3d4fe3(0xee),'required':!![],'description':'Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','enum':[...APP_RULE_TYPES]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a245_0x19ec(_0x459ab9,_0x33298c){_0x459ab9=_0x459ab9-0x15b;const _0x518ac5=a245_0x518a();let _0x19ec5a=_0x518ac5[_0x459ab9];return _0x19ec5a;}const a245_0x517c89=a245_0x19ec;(function(_0xb681e0,_0x1f8a97){const _0x41bf5c=a245_0x19ec,_0x51e0b7=_0xb681e0();while(!![]){try{const _0x5e0dc7=-parseInt(_0x41bf5c(0x197))/0x1+-parseInt(_0x41bf5c(0x18c))/0x2+parseInt(_0x41bf5c(0x191))/0x3*(-parseInt(_0x41bf5c(0x18b))/0x4)+-parseInt(_0x41bf5c(0x176))/0x5+-parseInt(_0x41bf5c(0x193))/0x6+parseInt(_0x41bf5c(0x18d))/0x7*(parseInt(_0x41bf5c(0x18a))/0x8)+parseInt(_0x41bf5c(0x188))/0x9*(parseInt(_0x41bf5c(0x181))/0xa);if(_0x5e0dc7===_0x1f8a97)break;else _0x51e0b7['push'](_0x51e0b7['shift']());}catch(_0x4df994){_0x51e0b7['push'](_0x51e0b7['shift']());}}}(a245_0x518a,0x350f8));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_0x517c89(0x19c),'dev']),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x517c89(0x19c),'dev',a245_0x517c89(0x172),'preview']);export function syncProjectDomainRoutingBeforeScript(_0x63ff05,_0xb1e2f4){const _0x2fffad=a245_0x517c89;if(!DOMAIN_ROUTING_SYNC_SCRIPTS['has'](_0xb1e2f4))return null;const _0x518ba3=findProjectRootDirectory(_0x63ff05);if(!resolveConfigPath(_0x518ba3))return null;const _0x58d5c4=writeProjectDomainRoutingManifest(_0x518ba3);return{'path':_0x58d5c4[_0x2fffad(0x16c)],'changed':_0x58d5c4[_0x2fffad(0x16d)]};}function readPackageScripts(_0x3327af){const _0x432092=a245_0x517c89,_0x1e5d2e=resolve(_0x3327af,_0x432092(0x15d));if(!existsSync(_0x1e5d2e))return null;try{const _0x20ac76=JSON[_0x432092(0x195)](readFileSync(_0x1e5d2e,_0x432092(0x19f)));return _0x20ac76[_0x432092(0x179)]??{};}catch{return null;}}function detectPackageManager(_0x105ec4){const _0x480bd9=a245_0x517c89;if(existsSync(resolve(_0x105ec4,_0x480bd9(0x17c)))||existsSync(resolve(_0x105ec4,_0x480bd9(0x17d))))return _0x480bd9(0x185);if(existsSync(resolve(_0x105ec4,_0x480bd9(0x167))))return'pnpm';if(existsSync(resolve(_0x105ec4,_0x480bd9(0x199))))return _0x480bd9(0x17f);return _0x480bd9(0x19a);}async function versionCheck(_0x2b273a){const _0x2ba757=a245_0x517c89,_0x2673ea=await checkCliVersion();(_0x2673ea['needsUpgrade']||_0x2673ea[_0x2ba757(0x15e)])&&(printCliUpgradeWarning(_0x2673ea),assertCliVersionSupported(_0x2673ea));const _0x39085d=await checkSdkVersion(_0x2b273a);if(_0x39085d[_0x2ba757(0x16e)])printSdkUpgradeWarning(_0x39085d);}function spawnScript(_0x15e656,_0x5127bc,_0x4e7f76,_0xd24219){return new Promise((_0x1ff958,_0x20851a)=>{const _0x2b0236=a245_0x19ec,_0x3131e1=[_0x2b0236(0x18e),_0x5127bc,..._0x4e7f76],_0xd78585=spawn(_0x15e656,_0x3131e1,{'cwd':_0xd24219,'stdio':_0x2b0236(0x183),'shell':!![],'env':{...process.env,'PATH':''+join(_0xd24219,_0x2b0236(0x164),'.bin')+delimiter+process.env.PATH}});_0xd78585['on'](_0x2b0236(0x19e),_0x103e0b=>{const _0x1aafcf=_0x2b0236;if(_0x103e0b===0x0||_0x103e0b===null)_0x1ff958();else _0x20851a(new Error(_0x15e656+_0x1aafcf(0x171)+_0x5127bc+'\x20exited\x20with\x20code\x20'+_0x103e0b));}),_0xd78585['on'](_0x2b0236(0x173),_0x20851a);});}function spawnViteBuildWatch(_0x34b9ac){return new Promise((_0x11d18b,_0x166b23)=>{const _0x5ca0a7=a245_0x19ec,_0x14a6ea=spawn(_0x5ca0a7(0x168),[_0x5ca0a7(0x172),_0x5ca0a7(0x190)],{'cwd':_0x34b9ac,'stdio':_0x5ca0a7(0x183),'shell':!![],'env':{...process.env,'PATH':''+join(_0x34b9ac,_0x5ca0a7(0x164),_0x5ca0a7(0x18f))+delimiter+process.env.PATH}});_0x14a6ea['on'](_0x5ca0a7(0x19e),_0x7b7496=>{const _0x361653=_0x5ca0a7;if(_0x7b7496===0x0||_0x7b7496===null)_0x11d18b();else _0x166b23(new Error(_0x361653(0x19b)+_0x7b7496));}),_0x14a6ea['on'](_0x5ca0a7(0x173),_0x166b23);});}function spawnVitePreview(_0x4e3d04){return new Promise((_0x1562ec,_0x2e625a)=>{const _0x1ca6f7=a245_0x19ec,_0x558450=spawn(_0x1ca6f7(0x168),[_0x1ca6f7(0x163)],{'cwd':_0x4e3d04,'stdio':_0x1ca6f7(0x183),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4e3d04,_0x1ca6f7(0x164),_0x1ca6f7(0x18f))+delimiter+process.env.PATH}});_0x558450['on'](_0x1ca6f7(0x19e),_0x2bd7f0=>{const _0x256668=_0x1ca6f7;if(_0x2bd7f0===0x0||_0x2bd7f0===null)_0x1562ec();else _0x2e625a(new Error(_0x256668(0x174)+_0x2bd7f0));}),_0x558450['on'](_0x1ca6f7(0x173),_0x2e625a);});}const runFlags=[{'name':a245_0x517c89(0x17e),'type':a245_0x517c89(0x162),'description':a245_0x517c89(0x16a),'default':![]}];export const runDefinition={'service':a245_0x517c89(0x18e),'command':a245_0x517c89(0x18e),'description':a245_0x517c89(0x196),'risk':a245_0x517c89(0x186),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a245_0x517c89(0x182),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x8b90fa=a245_0x517c89,_0x394de5=[];return _0x394de5[_0x8b90fa(0x194)](_0x8b90fa(0x198)),_0x394de5[_0x8b90fa(0x194)](_0x8b90fa(0x161)+CLI_BIN_NAME+_0x8b90fa(0x189)),_0x394de5[_0x8b90fa(0x194)](_0x8b90fa(0x161)+CLI_BIN_NAME+_0x8b90fa(0x170)),_0x394de5[_0x8b90fa(0x194)](_0x8b90fa(0x161)+CLI_BIN_NAME+_0x8b90fa(0x169)),_0x394de5['push'](_0x8b90fa(0x161)+CLI_BIN_NAME+_0x8b90fa(0x19d)),_0x394de5[_0x8b90fa(0x17b)]('\x0a');},async 'execute'(_0x1ce304){const _0x45cdd7=a245_0x517c89,_0x4e5a97=process[_0x45cdd7(0x175)](),_0x2fb32d=_0x1ce304[_0x45cdd7(0x178)][0x0],_0x554550=_0x1ce304[_0x45cdd7(0x178)]['slice'](0x1),_0x58be1b=readPackageScripts(_0x4e5a97);if(!_0x58be1b)throw CliErrors[_0x45cdd7(0x165)](_0x45cdd7(0x16b));if(!_0x2fb32d){const _0x5b3f8b=Object['keys'](_0x58be1b);if(_0x5b3f8b[_0x45cdd7(0x15b)]===0x0)console[_0x45cdd7(0x166)](_0x45cdd7(0x177));else{console[_0x45cdd7(0x166)](_0x45cdd7(0x16f));for(const _0x2ee6df of _0x5b3f8b){console[_0x45cdd7(0x166)](_0x45cdd7(0x161)+_0x2ee6df);}console[_0x45cdd7(0x166)](_0x45cdd7(0x160)+CLI_BIN_NAME+_0x45cdd7(0x187));}return{'ok':!![]};}if(!_0x58be1b[_0x2fb32d])throw CliErrors[_0x45cdd7(0x165)](_0x45cdd7(0x17a)+_0x2fb32d+_0x45cdd7(0x180),_0x45cdd7(0x184)+(Object[_0x45cdd7(0x15f)](_0x58be1b)[_0x45cdd7(0x17b)](',\x20')||'(none)'));const _0x112386=detectPackageManager(_0x4e5a97),_0x498b2f=syncProjectDomainRoutingBeforeScript(_0x4e5a97,_0x2fb32d);_0x498b2f?.[_0x45cdd7(0x16d)]&&console['error']('Domain\x20routing\x20synchronized:\x20'+_0x498b2f[_0x45cdd7(0x16c)]);VERSION_CHECK_SCRIPTS['has'](_0x2fb32d)&&await versionCheck(_0x4e5a97);if(_0x2fb32d===_0x45cdd7(0x163)&&_0x1ce304[_0x45cdd7(0x15c)](_0x45cdd7(0x17e)))return await Promise[_0x45cdd7(0x192)]([spawnViteBuildWatch(_0x4e5a97),spawnVitePreview(_0x4e5a97)]),{'ok':!![]};return await spawnScript(_0x112386,_0x2fb32d,_0x554550,_0x4e5a97),{'ok':!![]};}};function a245_0x518a(){const _0x379553=['utf-8','length','bool','package.json','belowMinimum','keys','\x0a\x20\x20Usage:\x20','\x20\x20\x20\x20','boolean','preview','node_modules','validation','log','pnpm-lock.yaml','vite','\x20run\x20preview','Enable\x20watch\x20mode\x20for\x20preview','No\x20package.json\x20found\x20in\x20current\x20directory.','path','changed','needsUpgrade','\x0a\x20\x20Available\x20scripts:\x0a','\x20run\x20build','\x20run\x20','build','error','vite\x20preview\x20exited\x20with\x20code\x20','cwd','2080090KWFpCD','No\x20scripts\x20defined\x20in\x20package.json.','args','scripts','Script\x20\x22','join','bun.lockb','bun.lock','watch','yarn','\x22\x20not\x20found\x20in\x20package.json.','280LuNSJO','script','inherit','Available:\x20','bun','write','\x20run\x20<script>\x0a','348363IrZbzO','\x20run\x20start','264lCeBWZ','20kDNhkb','482926qrgivn','79464djNnfW','run','.bin','--watch','209037gAbcXA','all','373368OllDPw','push','parse','Run\x20a\x20package.json\x20script','172972toSnkN','\x20\x20EXAMPLES','yarn.lock','npm','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','start','\x20run\x20preview\x20--watch','close'];a245_0x518a=function(){return _0x379553;};return a245_0x518a();}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a246_0x3caf3d=a246_0x39e7;function a246_0x2591(){const _0x1326c9=['4509603vLiViO','6101809jGeehq','1578EiWhXk','8DTyIIc','read','36NHALOG','915920WBvgwY','schema','export','36790zumsLX','187uINyJV','190131FibaCD','json','3023rdncnk','5529927tVnumC','438xEtdmT','84KtaWIv'];a246_0x2591=function(){return _0x1326c9;};return a246_0x2591();}(function(_0x3253c8,_0x463b7d){const _0xfc726b=a246_0x39e7,_0x4b1cce=_0x3253c8();while(!![]){try{const _0x15c375=-parseInt(_0xfc726b(0xbf))/0x1*(-parseInt(_0xfc726b(0xb0))/0x2)+-parseInt(_0xfc726b(0xbd))/0x3*(parseInt(_0xfc726b(0xb7))/0x4)+-parseInt(_0xfc726b(0xbb))/0x5*(-parseInt(_0xfc726b(0xb4))/0x6)+parseInt(_0xfc726b(0xb3))/0x7+parseInt(_0xfc726b(0xb5))/0x8*(-parseInt(_0xfc726b(0xb2))/0x9)+-parseInt(_0xfc726b(0xb8))/0xa*(-parseInt(_0xfc726b(0xbc))/0xb)+-parseInt(_0xfc726b(0xb1))/0xc*(parseInt(_0xfc726b(0xaf))/0xd);if(_0x15c375===_0x463b7d)break;else _0x4b1cce['push'](_0x4b1cce['shift']());}catch(_0x48947c){_0x4b1cce['push'](_0x4b1cce['shift']());}}}(a246_0x2591,0xee7bd));import{buildSchemaPayload}from'../framework/schema-export.js';function a246_0x39e7(_0x208a16,_0x8da7c2){_0x208a16=_0x208a16-0xaf;const _0x2591d0=a246_0x2591();let _0x39e75c=_0x2591d0[_0x208a16];return _0x39e75c;}async function execute(_0x114725){const _0x119d6d=await buildSchemaPayload();return{'ok':!![],'data':_0x119d6d};}export const schemaDefinition={'service':a246_0x3caf3d(0xb9),'command':a246_0x3caf3d(0xba),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a246_0x3caf3d(0xb6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x3caf3d(0xbe),'flags':[],'execute':execute};
|