@lovrabet/rabetbase-cli 2.5.13-beta.1 → 2.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a232_0x4e4b08=a232_0x3e55;(function(_0x27428b,_0x51f1c0){const _0x203967=a232_0x3e55,_0x3e46d6=_0x27428b();while(!![]){try{const _0x408114=-parseInt(_0x203967(0x161))/0x1*(-parseInt(_0x203967(0x157))/0x2)+-parseInt(_0x203967(0x160))/0x3*(-parseInt(_0x203967(0x162))/0x4)+-parseInt(_0x203967(0x165))/0x5*(-parseInt(_0x203967(0x159))/0x6)+parseInt(_0x203967(0x164))/0x7*(parseInt(_0x203967(0x168))/0x8)+-parseInt(_0x203967(0x15c))/0x9+parseInt(_0x203967(0x167))/0xa+parseInt(_0x203967(0x166))/0xb*(-parseInt(_0x203967(0x163))/0xc);if(_0x408114===_0x51f1c0)break;else _0x3e46d6['push'](_0x3e46d6['shift']());}catch(_0x1bd570){_0x3e46d6['push'](_0x3e46d6['shift']());}}}(a232_0x1ead,0xaca9d));function a232_0x3e55(_0x3c41c3,_0x12161d){_0x3c41c3=_0x3c41c3-0x157;const _0x1eadcf=a232_0x1ead();let _0x3e5554=_0x1eadcf[_0x3c41c3];return _0x3e5554;}function a232_0x1ead(){const _0xec8ecc=['1ejcTPC','4wEWBkh','22563804UPbRmm','8987916mEyMYc','33980AJNSuc','11TqExmr','1776030wGSvax','8QiaPnD','detail','1598648DQaVyb','Show\x20a\x20single\x20role\x27s\x20detail','72YPvDjj','dev','role','5716053NcggJU','roleName','roleType','appCode','2640588gICbaZ'];a232_0x1ead=function(){return _0xec8ecc;};return a232_0x1ead();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a232_0x4e4b08(0x15b),'command':a232_0x4e4b08(0x169),'description':a232_0x4e4b08(0x158),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0xcc70ae){const _0x48a38d=a232_0x4e4b08,_0x8ce034=_0xcc70ae['num']('id'),_0x310c8c=await getRoleById(_0xcc70ae[_0x48a38d(0x15f)],_0x8ce034);return{'ok':!![],'data':{'scope':_0x48a38d(0x15a),'role':projectRole(_0x310c8c)},'message':'Role\x20'+_0x310c8c[_0x48a38d(0x15d)]+'\x20('+_0x310c8c[_0x48a38d(0x15e)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x78ada,_0x43c2e8){const _0xeb4bac=a233_0x5433,_0x5e7611=_0x78ada();while(!![]){try{const _0x3f3a9b=-parseInt(_0xeb4bac(0xf2))/0x1+parseInt(_0xeb4bac(0xf3))/0x2*(-parseInt(_0xeb4bac(0xf1))/0x3)+-parseInt(_0xeb4bac(0xee))/0x4*(-parseInt(_0xeb4bac(0xec))/0x5)+-parseInt(_0xeb4bac(0xed))/0x6*(parseInt(_0xeb4bac(0xea))/0x7)+-parseInt(_0xeb4bac(0xf0))/0x8+-parseInt(_0xeb4bac(0xef))/0x9+parseInt(_0xeb4bac(0xeb))/0xa;if(_0x3f3a9b===_0x43c2e8)break;else _0x5e7611['push'](_0x5e7611['shift']());}catch(_0x54a09e){_0x5e7611['push'](_0x5e7611['shift']());}}}(a233_0x40d5,0x2dc27));import{roleList}from'../../commands/role/list.js';function a233_0x5433(_0x26956a,_0x2c30d7){_0x26956a=_0x26956a-0xea;const _0x40d5aa=a233_0x40d5();let _0x5433fd=_0x40d5aa[_0x26956a];return _0x5433fd;}import{roleDetail}from'../../commands/role/detail.js';function a233_0x40d5(){const _0x56250b=['226505leEIVq','3382HWooir','7343pVZrsc','6020050cPYkOx','560yboUaj','396FptAWZ','1996ZpGhta','644031VRMsWh','608864uVlhIG','48WhwhQE'];a233_0x40d5=function(){return _0x56250b;};return a233_0x40d5();}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
|
+
const a234_0x59f164=a234_0x19da;(function(_0xb45bb7,_0x1af4eb){const _0x437953=a234_0x19da,_0x3b5647=_0xb45bb7();while(!![]){try{const _0x33f741=parseInt(_0x437953(0x17f))/0x1+parseInt(_0x437953(0x184))/0x2+parseInt(_0x437953(0x17d))/0x3*(parseInt(_0x437953(0x17b))/0x4)+-parseInt(_0x437953(0x18f))/0x5*(parseInt(_0x437953(0x18a))/0x6)+parseInt(_0x437953(0x186))/0x7*(parseInt(_0x437953(0x176))/0x8)+-parseInt(_0x437953(0x16b))/0x9+parseInt(_0x437953(0x18c))/0xa*(-parseInt(_0x437953(0x18d))/0xb);if(_0x33f741===_0x1af4eb)break;else _0x3b5647['push'](_0x3b5647['shift']());}catch(_0x2ab219){_0x3b5647['push'](_0x3b5647['shift']());}}}(a234_0x1e1b,0x3acf9));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a234_0x19da(_0x2485a7,_0x1cfdb6){_0x2485a7=_0x2485a7-0x169;const _0x1e1bd7=a234_0x1e1b();let _0x19da3b=_0x1e1bd7[_0x2485a7];return _0x19da3b;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a234_0x1e1b(){const _0x2b4721=['86382arwutC','CUSTOM','9394WfHgVR','join','read','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','12zfRQpv','Invalid\x20--type\x20\x22','74350maZLIB','209ZCtKIO','validation','467655khHQzf','type','appCode','includes','3650058yOTaWF','dev','map','string','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','Page\x20index\x20(1-based)','number','Page\x20size\x20(1-100)','role','trim','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','776lNqRDu','page','pagesize','OWNER','DEV','1356412KBIgaU','Use\x20one\x20of:\x20','3XwVRqc','\x20role(s)','462310jdybmW','ADMIN','str','num','Found\x20'];a234_0x1e1b=function(){return _0x2b4721;};return a234_0x1e1b();}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a234_0x59f164(0x180),a234_0x59f164(0x17a),a234_0x59f164(0x179),a234_0x59f164(0x185)];export const roleList={'service':a234_0x59f164(0x173),'command':'list','description':a234_0x59f164(0x175),'risk':a234_0x59f164(0x188),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0x59f164(0x190),'type':a234_0x59f164(0x16e),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':a234_0x59f164(0x177),'type':a234_0x59f164(0x171),'description':a234_0x59f164(0x170),'default':0x1},{'name':'pagesize','type':a234_0x59f164(0x171),'description':a234_0x59f164(0x172),'default':0x64}],async 'validate'(_0x122bb9){const _0x1096df=a234_0x59f164,_0x2fea7b=_0x122bb9[_0x1096df(0x181)]('type')['trim']();if(_0x2fea7b&&!ROLE_TYPES[_0x1096df(0x16a)](_0x2fea7b['toUpperCase']()))throw CliErrors['validation'](_0x1096df(0x18b)+_0x2fea7b+'\x22.',_0x1096df(0x17c)+ROLE_TYPES[_0x1096df(0x187)](',\x20')+'.');const _0x26d29c=_0x122bb9['num'](_0x1096df(0x177),0x1),_0x3f4121=_0x122bb9[_0x1096df(0x182)](_0x1096df(0x178),0x64);if(_0x26d29c<0x1)throw CliErrors[_0x1096df(0x18e)](_0x1096df(0x189));if(_0x3f4121<0x1||_0x3f4121>0x64)throw CliErrors[_0x1096df(0x18e)](_0x1096df(0x16f));},async 'execute'(_0x29cc08){const _0x56a6c7=a234_0x59f164,_0x59e26d=_0x29cc08[_0x56a6c7(0x182)](_0x56a6c7(0x177),0x1)||0x1,_0x3fd5f9=_0x29cc08[_0x56a6c7(0x182)](_0x56a6c7(0x178),0x64)||0x64,_0x5cfccd=_0x29cc08[_0x56a6c7(0x181)](_0x56a6c7(0x190))[_0x56a6c7(0x174)]()['toUpperCase'](),{items:_0x5ccdda,paging:_0x1bf4ec}=await listAppRoles(_0x29cc08[_0x56a6c7(0x169)],{'currentPage':_0x59e26d,'pageSize':_0x3fd5f9}),_0x76fe3e=_0x5cfccd?_0x5ccdda['filter'](_0x3fd61a=>_0x3fd61a['roleType']===_0x5cfccd):_0x5ccdda,_0x4d1a49=_0x76fe3e[_0x56a6c7(0x16d)](projectRole);return{'ok':!![],'data':{'scope':_0x56a6c7(0x16c),'roles':_0x4d1a49,'paging':_0x1bf4ec},'message':_0x56a6c7(0x183)+_0x4d1a49['length']+_0x56a6c7(0x17e)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a235_0x40e920=a235_0x2bfd;(function(_0x15edcc,_0x126296){const _0x11b934=a235_0x2bfd,_0x7b6748=_0x15edcc();while(!![]){try{const _0x35bdf4=-parseInt(_0x11b934(0x1c9))/0x1*(-parseInt(_0x11b934(0x1b2))/0x2)+parseInt(_0x11b934(0x1b6))/0x3*(-parseInt(_0x11b934(0x1b4))/0x4)+parseInt(_0x11b934(0x1bd))/0x5+parseInt(_0x11b934(0x1c1))/0x6*(parseInt(_0x11b934(0x1d5))/0x7)+parseInt(_0x11b934(0x1c8))/0x8+parseInt(_0x11b934(0x1fb))/0x9+-parseInt(_0x11b934(0x1ef))/0xa;if(_0x35bdf4===_0x126296)break;else _0x7b6748['push'](_0x7b6748['shift']());}catch(_0x4e4eec){_0x7b6748['push'](_0x7b6748['shift']());}}}(a235_0x71bf,0xf40d3));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';function a235_0x2bfd(_0x39396a,_0x10bd88){_0x39396a=_0x39396a-0x1b0;const _0x71bf3c=a235_0x71bf();let _0x2bfdc6=_0x71bf3c[_0x39396a];return _0x2bfdc6;}export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':a235_0x40e920(0x1cc)};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};export const USER_REF_FLAG={'name':a235_0x40e920(0x1e4),'type':a235_0x40e920(0x1ce),'required':!![],'description':a235_0x40e920(0x1df)};export const NAME_FLAG={'name':a235_0x40e920(0x1d2),'type':a235_0x40e920(0x1ce),'required':!![],'description':a235_0x40e920(0x1fc)};export const USER_NAME_FLAG={'name':a235_0x40e920(0x1d2),'type':a235_0x40e920(0x1ce),'required':!![],'description':a235_0x40e920(0x1c7)};export const REMARK_FLAG={'name':'remark','type':a235_0x40e920(0x1ce),'required':![],'description':a235_0x40e920(0x1f6)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x40e920(0x1f7),'type':a235_0x40e920(0x1b1),'required':![],'description':a235_0x40e920(0x1c3)};export const BUILTIN_ROLE_TYPES=[a235_0x40e920(0x1f0),a235_0x40e920(0x1eb),'OWNER'];export function isBuiltinRole(_0x4a10fb){return BUILTIN_ROLE_TYPES['includes'](_0x4a10fb);}export function assertCustomRole(_0x2b5daa,_0x1e6f22){const _0x1452aa=a235_0x40e920;if(_0x2b5daa[_0x1452aa(0x1e6)]!==_0x1452aa(0x1b9))throw CliErrors['validation']('Cannot\x20'+_0x1e6f22+_0x1452aa(0x1f9)+_0x2b5daa['roleName']+'\x20('+_0x2b5daa['roleType']+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0x4bade3){const _0x27e670=a235_0x40e920;return{'id':_0x4bade3['id'],'roleName':_0x4bade3[_0x27e670(0x1c6)],'roleType':_0x4bade3['roleType'],'remark':_0x4bade3[_0x27e670(0x1c4)],'userCount':_0x4bade3[_0x27e670(0x1be)],'permitCount':_0x4bade3['permitCount'],'builtin':isBuiltinRole(_0x4bade3[_0x27e670(0x1e6)])};}export async function resolveRoleRef(_0x4a3fbd,_0x2db4fa){const _0x3a3431=a235_0x40e920,_0x1538f5=_0x2db4fa[_0x3a3431(0x1ea)]();if(!_0x1538f5)throw CliErrors[_0x3a3431(0x1c5)](_0x3a3431(0x1fe),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x3a3431(0x1bf)](_0x1538f5))return getRoleById(_0x4a3fbd,Number(_0x1538f5));const _0x34bcf0=await listAllAppRoles(_0x4a3fbd),_0x4862a6=_0x34bcf0['filter'](_0x45feca=>_0x45feca[_0x3a3431(0x1c6)]===_0x1538f5);if(_0x4862a6[_0x3a3431(0x1cf)]===0x0)throw CliErrors['validation'](_0x3a3431(0x1d6)+_0x1538f5+_0x3a3431(0x1d8)+_0x4a3fbd+'.',_0x3a3431(0x1b0));if(_0x4862a6['length']>0x1){const _0x569716=_0x4862a6[_0x3a3431(0x1ee)](_0x4fb189=>_0x4fb189['id'])['join'](',\x20');throw CliErrors[_0x3a3431(0x1c5)](_0x3a3431(0x1d6)+_0x1538f5+_0x3a3431(0x1d4)+_0x569716+').',_0x3a3431(0x1c0));}return _0x4862a6[0x0];}export async function getRoleById(_0x43f92f,_0x82c723){const _0x22e23b=a235_0x40e920,_0x5c6fae=await listAllAppRoles(_0x43f92f),_0x43e398=_0x5c6fae[_0x22e23b(0x1e7)](_0x2735c1=>_0x2735c1['id']===_0x82c723&&(!_0x2735c1[_0x22e23b(0x1d0)]||_0x2735c1[_0x22e23b(0x1d0)]===_0x43f92f));if(_0x43e398[_0x22e23b(0x1cf)]!==0x1)throw CliErrors[_0x22e23b(0x1c5)](_0x22e23b(0x1b3)+_0x82c723+_0x22e23b(0x1e2)+_0x43f92f+'.',_0x22e23b(0x1db));return _0x43e398[0x0];}async function listAllAppRoles(_0x49dcdc){const _0xaefc07=a235_0x40e920,_0x1916b7=0x64,_0x5de646=[];for(let _0x4b73fb=0x1;;_0x4b73fb+=0x1){const {items:_0x5bdd52,paging:_0x38d45d}=await listAppRoles(_0x49dcdc,{'currentPage':_0x4b73fb,'pageSize':_0x1916b7});_0x5de646[_0xaefc07(0x1de)](..._0x5bdd52);if(_0x5bdd52['length']<_0x1916b7||_0x38d45d&&_0x5de646['length']>=_0x38d45d[_0xaefc07(0x1f4)])return _0x5de646;}}export async function resolveTenantCode(){const _0x4c57d0=a235_0x40e920,_0xc9590=await getSessionUserInfo(),_0x42ca8b=_0xc9590?.['user']?.['tenant']?.[_0x4c57d0(0x1f3)];if(!_0x42ca8b)throw CliErrors['authRequired'](_0x4c57d0(0x1e5));return _0x42ca8b;}function matchMember(_0x28e6ac,_0x97ffc7){const _0x1a6591=a235_0x40e920,_0x5875c6=_0x97ffc7[_0x1a6591(0x1ea)]()[_0x1a6591(0x1b7)]();return(_0x28e6ac[_0x1a6591(0x1d1)]??'')[_0x1a6591(0x1b7)]()===_0x5875c6||(_0x28e6ac[_0x1a6591(0x1ca)]??'')[_0x1a6591(0x1b7)]()===_0x5875c6;}export async function resolveUserRef(_0x53048f,_0x547d4e='Pass\x20--user\x20<id>.'){const _0xa26f7=a235_0x40e920,_0x4d88a0=_0x53048f[_0xa26f7(0x1ea)]();if(!_0x4d88a0)throw CliErrors['validation'](_0xa26f7(0x1f1),_0xa26f7(0x1cd));const _0x327547=await resolveTenantCode(),_0x5255be=await getTenantMembers(_0x327547);if(/^\d+$/[_0xa26f7(0x1bf)](_0x4d88a0)){const _0x377df2=Number(_0x4d88a0),_0x3ef366=_0x5255be['find'](_0x2e9729=>_0x2e9729[_0xa26f7(0x1da)]===_0x377df2);return{'userId':_0x377df2,'username':_0x3ef366?.[_0xa26f7(0x1ca)]??String(_0x377df2),'nickname':_0x3ef366?.[_0xa26f7(0x1d1)],'matchedBy':'id'};}const _0x32ebdf=_0x5255be[_0xa26f7(0x1e7)](_0x3f2fbc=>matchMember(_0x3f2fbc,_0x4d88a0));if(_0x32ebdf[_0xa26f7(0x1cf)]===0x0)throw CliErrors['validation'](_0xa26f7(0x1ed)+_0x4d88a0+'\x22.',_0xa26f7(0x1ff)+_0x547d4e);if(_0x32ebdf[_0xa26f7(0x1cf)]>0x1){const _0x10275d=_0x32ebdf[_0xa26f7(0x1ee)](_0x5f265c=>(_0x5f265c[_0xa26f7(0x1d1)]??_0x5f265c['username']??'?')+'('+_0x5f265c[_0xa26f7(0x1da)]+')')['join'](',\x20');throw CliErrors[_0xa26f7(0x1c5)](_0xa26f7(0x200)+_0x4d88a0+_0xa26f7(0x1e1)+_0x10275d+'.',_0x547d4e);}const _0xc8900a=_0x32ebdf[0x0];return{'userId':_0xc8900a['userId'],'username':_0xc8900a['username']??String(_0xc8900a[_0xa26f7(0x1da)]),'nickname':_0xc8900a[_0xa26f7(0x1d1)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a235_0x40e920(0x1e0);export const DELETE_USER_ROLE_PATH=a235_0x40e920(0x1cb);export function computeRoleUserMutation(_0x3fa3c7){const _0x267530=a235_0x40e920,{operation:_0xcd3515,appCode:_0x3314f0,role:_0x37350e,relations:_0x13e58b,user:_0x477731}=_0x3fa3c7,_0x2947cb=[...new Set(_0x13e58b[_0x267530(0x1ee)](_0x5d8896=>_0x5d8896[_0x267530(0x1da)]))],_0x9ca31b=[];if(_0x3fa3c7[_0x267530(0x1d9)]!==undefined&&_0x3fa3c7['expectUserCount']!==_0x2947cb['length'])throw CliErrors['validation'](_0x267530(0x1e3)+_0x3fa3c7['expectUserCount']+_0x267530(0x1b8)+_0x2947cb[_0x267530(0x1cf)]+'.',_0x267530(0x1d3));const _0x409bf6=_0x2947cb[_0x267530(0x1fa)](_0x477731[_0x267530(0x1da)]),_0x22dad7=_0x13e58b[_0x267530(0x1e7)](_0x3473c9=>_0x3473c9[_0x267530(0x1da)]===_0x477731[_0x267530(0x1da)])[_0x267530(0x1ee)](_0x3d886a=>_0x3d886a['id']),_0x5784e0=_0xcd3515===_0x267530(0x1d7)?!_0x409bf6:_0x409bf6;let _0xb0db93=_0x2947cb;_0xcd3515===_0x267530(0x1d7)?_0x409bf6?_0x9ca31b['push'](_0x267530(0x1f5)+_0x477731['userId']+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x37350e[_0x267530(0x1c6)]+_0x267530(0x1dc)):_0xb0db93=[..._0x2947cb,_0x477731[_0x267530(0x1da)]]:!_0x409bf6?_0x9ca31b['push'](_0x267530(0x1f5)+_0x477731[_0x267530(0x1da)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x37350e[_0x267530(0x1c6)]+_0x267530(0x1dc)):(_0xb0db93=_0x2947cb['filter'](_0x484921=>_0x484921!==_0x477731[_0x267530(0x1da)]),_0x22dad7['length']>0x1&&_0x9ca31b['push'](_0x267530(0x1bb)+_0x22dad7[_0x267530(0x1cf)]+_0x267530(0x1e9)+_0x477731[_0x267530(0x1da)]+'.'));const _0x41c2f2={'scope':_0x267530(0x1e8),'operation':_0xcd3515,'selector':{'appCode':_0x3314f0,'roleId':_0x37350e['id'],'roleName':_0x37350e[_0x267530(0x1c6)],'userId':_0x477731[_0x267530(0x1da)]},'before':{'userIds':_0x2947cb},'after':{'userIds':_0xb0db93},'dryRun':_0x3fa3c7[_0x267530(0x1c2)],'backend':{'method':'POST','path':_0xcd3515===_0x267530(0x1d7)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x9ca31b};return{'mutation':_0x41c2f2,'changed':_0x5784e0,'matchingRelationIds':_0x22dad7};}export async function loadDevRoleRelations(_0x45eb3b,_0x4cac4d){const _0x2b8da4=a235_0x40e920,_0x1fb858=0x64,_0x297fbc=[];for(let _0x1b75db=0x1;;_0x1b75db+=0x1){const {items:_0x4f1c46,paging:_0x228382}=await listDevUserRoleRelations(_0x45eb3b,{'roleId':_0x4cac4d,'currentPage':_0x1b75db,'pageSize':_0x1fb858});_0x297fbc['push'](..._0x4f1c46);if(_0x4f1c46[_0x2b8da4(0x1cf)]<_0x1fb858||_0x228382&&_0x297fbc[_0x2b8da4(0x1cf)]>=_0x228382[_0x2b8da4(0x1f4)])return _0x297fbc;}}export function readRoleRef(_0x14adb2){const _0x1bcea9=a235_0x40e920,_0x387dc0=_0x14adb2[_0x1bcea9(0x1dd)](_0x1bcea9(0x1f8))[_0x1bcea9(0x1ea)]();if(!_0x387dc0)throw CliErrors[_0x1bcea9(0x1fd)](_0x1bcea9(0x1f8),_0x1bcea9(0x1b5));return _0x387dc0;}function a235_0x71bf(){const _0x4d39d9=['Pass\x20--user\x20<id|name>.','string','length','appCode','nickname','name','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x22\x20is\x20ambiguous\x20(ids:\x20','385kjzZKe','Role\x20name\x20\x22','user-add','\x22\x20not\x20found\x20in\x20app\x20','expectUserCount','userId','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.',';\x20no\x20change.','str','push','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','/smartapi/permit/user-role/create','\x22:\x20','\x20not\x20found\x20in\x20app\x20','Anti-drift\x20check\x20failed:\x20expected\x20','user','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','roleType','filter','dev','\x20duplicate\x20memberships\x20for\x20user\x20','trim','DEV','flag','No\x20tenant\x20member\x20matches\x20\x22','map','13976340myTRFs','ADMIN','Missing\x20user\x20reference.','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','tenant_code','totalCount','User\x20','Optional\x20role\x20remark/description','expect-user-count','role','\x20built-in\x20role\x20','includes','1339704NIbgjz','Role\x20name','flagMissing','Missing\x20role\x20reference.','Check\x20the\x20nickname/username.\x20','Multiple\x20tenant\x20members\x20match\x20\x22','OWNER','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','number','507418MiaPVe','Role\x20id\x20','344Hozrrz','Pass\x20--role\x20<id|name>.','36222drrdAo','toLowerCase','\x20member(s)\x20but\x20role\x20has\x20','CUSTOM','\x20members\x20of\x20the\x20OWNER\x20role.','Removed\x20','Cannot\x20','8372320dTRZYY','userCount','test','Disambiguate\x20with\x20--role\x20<id>.','33666rKiHmV','dryRun','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','remark','validation','roleName','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','281304ZfDmDx','5kfamDT','username','/smartapi/permit/user-role/delete','Role\x20id\x20(from\x20`role\x20list`)'];a235_0x71bf=function(){return _0x4d39d9;};return a235_0x71bf();}export async function prepareUserMutation(_0xa72084,_0xd58d67,_0x266747){const _0x38e508=a235_0x40e920,_0x2218b9=readRoleRef(_0xa72084),_0x1d8263=_0xa72084[_0x38e508(0x1dd)](_0x38e508(0x1e4))[_0x38e508(0x1ea)]();if(!_0x1d8263)throw CliErrors['flagMissing'](_0x38e508(0x1e4),_0x38e508(0x1cd));const _0x55335d=_0xa72084[_0x38e508(0x1ec)](_0x38e508(0x1f7)),_0x13c6a6=_0x55335d===undefined||_0x55335d===null?undefined:Number(_0x55335d),_0x25a1ca=await resolveRoleRef(_0xa72084[_0x38e508(0x1d0)],_0x2218b9);if(_0x25a1ca[_0x38e508(0x1e6)]===_0x38e508(0x201))throw CliErrors[_0x38e508(0x1c5)](_0x38e508(0x1bc)+_0xd58d67+_0x38e508(0x1ba),_0x38e508(0x1f2));const _0x4810ca=await resolveUserRef(_0x1d8263),_0x39d3c7=await loadDevRoleRelations(_0xa72084[_0x38e508(0x1d0)],_0x25a1ca['id']);return{...computeRoleUserMutation({'operation':_0xd58d67,'appCode':_0xa72084[_0x38e508(0x1d0)],'role':_0x25a1ca,'relations':_0x39d3c7,'user':{'userId':_0x4810ca[_0x38e508(0x1da)],'username':_0x4810ca[_0x38e508(0x1ca)],'nickname':_0x4810ca[_0x38e508(0x1d1)]},'dryRun':_0x266747,..._0x13c6a6!==undefined?{'expectUserCount':_0x13c6a6}:{}}),'role':_0x25a1ca,'user':_0x4810ca};}
|
|
1
|
+
const a235_0x18cccf=a235_0x55ea;function a235_0x2714(){const _0x15c2c2=['username','totalCount','Optional\x20role\x20remark/description','Role\x20id\x20','Role\x20id\x20(from\x20`role\x20list`)','Removed\x20','userId','roleType','authRequired','\x20duplicate\x20memberships\x20for\x20user\x20',';\x20no\x20change.','nickname','validation','expect-user-count','Cannot\x20','Missing\x20user\x20reference.','Role\x20id\x20or\x20exact\x20role\x20name','join','includes','Pass\x20--role\x20<id|name>.','16028FzSYDS','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','name','userCount','Role\x20name','User\x20','appCode','DEV','245kbPClG','\x20not\x20found\x20in\x20app\x20','length','\x22\x20not\x20found\x20in\x20app\x20','/smartapi/permit/user-role/create','Pass\x20--user\x20<id|name>.','Disambiguate\x20with\x20--role\x20<id>.','121286ANUZFx','ADMIN','map','Check\x20the\x20nickname/username.\x20','push','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','str','toLowerCase','number','14367240wPvPDv','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','user-add','remark','CUSTOM','filter','/smartapi/permit/user-role/delete','dev','tenant','\x22\x20is\x20ambiguous\x20(ids:\x20','36glThuY','Missing\x20role\x20reference.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','trim','test','\x20is\x20already\x20a\x20member\x20of\x20role\x20','OWNER','user','3088848hzBjjI','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','\x22:\x20','\x20is\x20not\x20a\x20member\x20of\x20role\x20','\x20members\x20of\x20the\x20OWNER\x20role.','flag','Role\x20name\x20\x22','Anti-drift\x20check\x20failed:\x20expected\x20','No\x20tenant\x20member\x20matches\x20\x22','string','roleName','194356DHrufv','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','2248112kpApVv','role','Multiple\x20tenant\x20members\x20match\x20\x22','permitCount','tenant_code','3480750HYBluX','flagMissing'];a235_0x2714=function(){return _0x15c2c2;};return a235_0x2714();}(function(_0x33114b,_0x4841f6){const _0x2d9823=a235_0x55ea,_0x4fd3fc=_0x33114b();while(!![]){try{const _0x209383=-parseInt(_0x2d9823(0xc2))/0x1+parseInt(_0x2d9823(0xee))/0x2*(parseInt(_0x2d9823(0x102))/0x3)+-parseInt(_0x2d9823(0xdf))/0x4*(-parseInt(_0x2d9823(0xe7))/0x5)+parseInt(_0x2d9823(0xb7))/0x6+parseInt(_0x2d9823(0xc9))/0x7+parseInt(_0x2d9823(0xc4))/0x8+-parseInt(_0x2d9823(0xf7))/0x9;if(_0x209383===_0x4841f6)break;else _0x4fd3fc['push'](_0x4fd3fc['shift']());}catch(_0x165619){_0x4fd3fc['push'](_0x4fd3fc['shift']());}}}(a235_0x2714,0x681af));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_0x18cccf(0xf6),'required':!![],'description':a235_0x18cccf(0xcf)};export const ROLE_REF_FLAG={'name':a235_0x18cccf(0xc5),'type':a235_0x18cccf(0xc0),'required':!![],'description':a235_0x18cccf(0xdb)};export const USER_REF_FLAG={'name':a235_0x18cccf(0xb6),'type':a235_0x18cccf(0xc0),'required':!![],'description':a235_0x18cccf(0xf9)};export const NAME_FLAG={'name':a235_0x18cccf(0xe1),'type':a235_0x18cccf(0xc0),'required':!![],'description':a235_0x18cccf(0xe3)};export const USER_NAME_FLAG={'name':'name','type':a235_0x18cccf(0xc0),'required':!![],'description':a235_0x18cccf(0xe0)};export const REMARK_FLAG={'name':'remark','type':a235_0x18cccf(0xc0),'required':![],'description':a235_0x18cccf(0xcd)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x18cccf(0xd8),'type':'number','required':![],'description':a235_0x18cccf(0xb8)};export const BUILTIN_ROLE_TYPES=[a235_0x18cccf(0xef),a235_0x18cccf(0xe6),a235_0x18cccf(0xb5)];export function isBuiltinRole(_0xc0e65e){const _0xb535a1=a235_0x18cccf;return BUILTIN_ROLE_TYPES[_0xb535a1(0xdd)](_0xc0e65e);}export function assertCustomRole(_0x439acb,_0x367c1d){const _0x327d3b=a235_0x18cccf;if(_0x439acb[_0x327d3b(0xd2)]!==_0x327d3b(0xfc))throw CliErrors[_0x327d3b(0xd7)](_0x327d3b(0xd9)+_0x367c1d+'\x20built-in\x20role\x20'+_0x439acb[_0x327d3b(0xc1)]+'\x20('+_0x439acb['roleType']+').',_0x327d3b(0xc3));}export function projectRole(_0x5a6bf4){const _0xbfc086=a235_0x18cccf;return{'id':_0x5a6bf4['id'],'roleName':_0x5a6bf4[_0xbfc086(0xc1)],'roleType':_0x5a6bf4[_0xbfc086(0xd2)],'remark':_0x5a6bf4[_0xbfc086(0xfb)],'userCount':_0x5a6bf4[_0xbfc086(0xe2)],'permitCount':_0x5a6bf4[_0xbfc086(0xc7)],'builtin':isBuiltinRole(_0x5a6bf4[_0xbfc086(0xd2)])};}export async function resolveRoleRef(_0x4902a6,_0x50c9f3){const _0x22addf=a235_0x18cccf,_0x381eb5=_0x50c9f3[_0x22addf(0x105)]();if(!_0x381eb5)throw CliErrors['validation'](_0x22addf(0x103),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x22addf(0x106)](_0x381eb5))return getRoleById(_0x4902a6,Number(_0x381eb5));const _0x37e053=await listAllAppRoles(_0x4902a6),_0x47e2cb=_0x37e053['filter'](_0x32b4d4=>_0x32b4d4['roleName']===_0x381eb5);if(_0x47e2cb[_0x22addf(0xe9)]===0x0)throw CliErrors[_0x22addf(0xd7)](_0x22addf(0xbd)+_0x381eb5+_0x22addf(0xea)+_0x4902a6+'.',_0x22addf(0xf3));if(_0x47e2cb['length']>0x1){const _0x4740fd=_0x47e2cb[_0x22addf(0xf0)](_0x43bd2b=>_0x43bd2b['id'])[_0x22addf(0xdc)](',\x20');throw CliErrors[_0x22addf(0xd7)](_0x22addf(0xbd)+_0x381eb5+_0x22addf(0x101)+_0x4740fd+').',_0x22addf(0xed));}return _0x47e2cb[0x0];}export async function getRoleById(_0x134042,_0x31b939){const _0x2c4c71=a235_0x18cccf,_0x5cf222=await listAllAppRoles(_0x134042),_0x353813=_0x5cf222[_0x2c4c71(0xfd)](_0x23d773=>_0x23d773['id']===_0x31b939&&(!_0x23d773[_0x2c4c71(0xe5)]||_0x23d773[_0x2c4c71(0xe5)]===_0x134042));if(_0x353813[_0x2c4c71(0xe9)]!==0x1)throw CliErrors[_0x2c4c71(0xd7)](_0x2c4c71(0xce)+_0x31b939+_0x2c4c71(0xe8)+_0x134042+'.',_0x2c4c71(0xf8));return _0x353813[0x0];}async function listAllAppRoles(_0x302988){const _0x1b7c34=a235_0x18cccf,_0x5ae4cd=0x64,_0x4da93e=[];for(let _0x49f67e=0x1;;_0x49f67e+=0x1){const {items:_0x545112,paging:_0x5ecbc3}=await listAppRoles(_0x302988,{'currentPage':_0x49f67e,'pageSize':_0x5ae4cd});_0x4da93e[_0x1b7c34(0xf2)](..._0x545112);if(_0x545112[_0x1b7c34(0xe9)]<_0x5ae4cd||_0x5ecbc3&&_0x4da93e[_0x1b7c34(0xe9)]>=_0x5ecbc3[_0x1b7c34(0xcc)])return _0x4da93e;}}export async function resolveTenantCode(){const _0x32f656=a235_0x18cccf,_0x1b3a9b=await getSessionUserInfo(),_0x3a2631=_0x1b3a9b?.[_0x32f656(0xb6)]?.[_0x32f656(0x100)]?.[_0x32f656(0xc8)];if(!_0x3a2631)throw CliErrors[_0x32f656(0xd3)]('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x3a2631;}function matchMember(_0x21618e,_0x30c9a6){const _0x519d98=a235_0x18cccf,_0x16ea86=_0x30c9a6['trim']()['toLowerCase']();return(_0x21618e['nickname']??'')[_0x519d98(0xf5)]()===_0x16ea86||(_0x21618e[_0x519d98(0xcb)]??'')[_0x519d98(0xf5)]()===_0x16ea86;}export async function resolveUserRef(_0x288b6b,_0x41b655='Pass\x20--user\x20<id>.'){const _0x4665a0=a235_0x18cccf,_0x44b2fa=_0x288b6b[_0x4665a0(0x105)]();if(!_0x44b2fa)throw CliErrors[_0x4665a0(0xd7)](_0x4665a0(0xda),'Pass\x20--user\x20<id|name>.');const _0x15803b=await resolveTenantCode(),_0x7f3297=await getTenantMembers(_0x15803b);if(/^\d+$/['test'](_0x44b2fa)){const _0x482872=Number(_0x44b2fa),_0x52d766=_0x7f3297['find'](_0x4ded4a=>_0x4ded4a['userId']===_0x482872);return{'userId':_0x482872,'username':_0x52d766?.[_0x4665a0(0xcb)]??String(_0x482872),'nickname':_0x52d766?.['nickname'],'matchedBy':'id'};}const _0x4d64eb=_0x7f3297[_0x4665a0(0xfd)](_0xb4e5a8=>matchMember(_0xb4e5a8,_0x44b2fa));if(_0x4d64eb[_0x4665a0(0xe9)]===0x0)throw CliErrors[_0x4665a0(0xd7)](_0x4665a0(0xbf)+_0x44b2fa+'\x22.',_0x4665a0(0xf1)+_0x41b655);if(_0x4d64eb[_0x4665a0(0xe9)]>0x1){const _0x663e89=_0x4d64eb[_0x4665a0(0xf0)](_0x1ddb8f=>(_0x1ddb8f[_0x4665a0(0xd6)]??_0x1ddb8f[_0x4665a0(0xcb)]??'?')+'('+_0x1ddb8f[_0x4665a0(0xd1)]+')')['join'](',\x20');throw CliErrors['validation'](_0x4665a0(0xc6)+_0x44b2fa+_0x4665a0(0xb9)+_0x663e89+'.',_0x41b655);}const _0xdaad72=_0x4d64eb[0x0];return{'userId':_0xdaad72[_0x4665a0(0xd1)],'username':_0xdaad72['username']??String(_0xdaad72['userId']),'nickname':_0xdaad72['nickname'],'matchedBy':_0x4665a0(0xe1)};}export const CREATE_USER_ROLE_PATH=a235_0x18cccf(0xeb);export const DELETE_USER_ROLE_PATH=a235_0x18cccf(0xfe);export function computeRoleUserMutation(_0x54fdf8){const _0x2e1081=a235_0x18cccf,{operation:_0x4ea097,appCode:_0x5df8d0,role:_0x443367,relations:_0x430dd5,user:_0xc9d420}=_0x54fdf8,_0x289617=[...new Set(_0x430dd5[_0x2e1081(0xf0)](_0x36a321=>_0x36a321[_0x2e1081(0xd1)]))],_0x4d056d=[];if(_0x54fdf8['expectUserCount']!==undefined&&_0x54fdf8['expectUserCount']!==_0x289617['length'])throw CliErrors[_0x2e1081(0xd7)](_0x2e1081(0xbe)+_0x54fdf8['expectUserCount']+'\x20member(s)\x20but\x20role\x20has\x20'+_0x289617['length']+'.',_0x2e1081(0x104));const _0x23633b=_0x289617[_0x2e1081(0xdd)](_0xc9d420['userId']),_0x5430e6=_0x430dd5['filter'](_0x2ab7d3=>_0x2ab7d3[_0x2e1081(0xd1)]===_0xc9d420['userId'])[_0x2e1081(0xf0)](_0x17fb8e=>_0x17fb8e['id']),_0x2cd77b=_0x4ea097===_0x2e1081(0xfa)?!_0x23633b:_0x23633b;let _0x58af32=_0x289617;_0x4ea097==='user-add'?_0x23633b?_0x4d056d['push']('User\x20'+_0xc9d420[_0x2e1081(0xd1)]+_0x2e1081(0xb4)+_0x443367[_0x2e1081(0xc1)]+_0x2e1081(0xd5)):_0x58af32=[..._0x289617,_0xc9d420['userId']]:!_0x23633b?_0x4d056d[_0x2e1081(0xf2)](_0x2e1081(0xe4)+_0xc9d420['userId']+_0x2e1081(0xba)+_0x443367['roleName']+_0x2e1081(0xd5)):(_0x58af32=_0x289617['filter'](_0x31a4c3=>_0x31a4c3!==_0xc9d420[_0x2e1081(0xd1)]),_0x5430e6['length']>0x1&&_0x4d056d[_0x2e1081(0xf2)](_0x2e1081(0xd0)+_0x5430e6[_0x2e1081(0xe9)]+_0x2e1081(0xd4)+_0xc9d420['userId']+'.'));const _0x3259dd={'scope':_0x2e1081(0xff),'operation':_0x4ea097,'selector':{'appCode':_0x5df8d0,'roleId':_0x443367['id'],'roleName':_0x443367['roleName'],'userId':_0xc9d420['userId']},'before':{'userIds':_0x289617},'after':{'userIds':_0x58af32},'dryRun':_0x54fdf8['dryRun'],'backend':{'method':'POST','path':_0x4ea097===_0x2e1081(0xfa)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x4d056d};return{'mutation':_0x3259dd,'changed':_0x2cd77b,'matchingRelationIds':_0x5430e6};}export async function loadDevRoleRelations(_0x32a331,_0x430072){const _0x3f80eb=a235_0x18cccf,_0x2990b5=0x64,_0x3ffde7=[];for(let _0x4001c6=0x1;;_0x4001c6+=0x1){const {items:_0x5d15cf,paging:_0x3ceda8}=await listDevUserRoleRelations(_0x32a331,{'roleId':_0x430072,'currentPage':_0x4001c6,'pageSize':_0x2990b5});_0x3ffde7[_0x3f80eb(0xf2)](..._0x5d15cf);if(_0x5d15cf[_0x3f80eb(0xe9)]<_0x2990b5||_0x3ceda8&&_0x3ffde7[_0x3f80eb(0xe9)]>=_0x3ceda8[_0x3f80eb(0xcc)])return _0x3ffde7;}}function a235_0x55ea(_0x1702c7,_0x4ccec1){_0x1702c7=_0x1702c7-0xb4;const _0x271493=a235_0x2714();let _0x55ea65=_0x271493[_0x1702c7];return _0x55ea65;}export function readRoleRef(_0x5e252){const _0x296031=a235_0x18cccf,_0x18f419=_0x5e252['str']('role')[_0x296031(0x105)]();if(!_0x18f419)throw CliErrors[_0x296031(0xca)]('role',_0x296031(0xde));return _0x18f419;}export async function prepareUserMutation(_0x178054,_0x30de4d,_0x1276f6){const _0x35fed2=a235_0x18cccf,_0x20468f=readRoleRef(_0x178054),_0x54449c=_0x178054[_0x35fed2(0xf4)](_0x35fed2(0xb6))['trim']();if(!_0x54449c)throw CliErrors['flagMissing'](_0x35fed2(0xb6),_0x35fed2(0xec));const _0x49c19e=_0x178054[_0x35fed2(0xbc)](_0x35fed2(0xd8)),_0x4dc37b=_0x49c19e===undefined||_0x49c19e===null?undefined:Number(_0x49c19e),_0x44fcf7=await resolveRoleRef(_0x178054['appCode'],_0x20468f);if(_0x44fcf7[_0x35fed2(0xd2)]===_0x35fed2(0xb5))throw CliErrors[_0x35fed2(0xd7)](_0x35fed2(0xd9)+_0x30de4d+_0x35fed2(0xbb),'Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.');const _0x14c100=await resolveUserRef(_0x54449c),_0x2702a1=await loadDevRoleRelations(_0x178054['appCode'],_0x44fcf7['id']);return{...computeRoleUserMutation({'operation':_0x30de4d,'appCode':_0x178054[_0x35fed2(0xe5)],'role':_0x44fcf7,'relations':_0x2702a1,'user':{'userId':_0x14c100['userId'],'username':_0x14c100[_0x35fed2(0xcb)],'nickname':_0x14c100[_0x35fed2(0xd6)]},'dryRun':_0x1276f6,..._0x4dc37b!==undefined?{'expectUserCount':_0x4dc37b}:{}}),'role':_0x44fcf7,'user':_0x14c100};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a236_0x3048(){const _0x22292e=['num','1988928tPoBIA','validation','188rpEuZC','remark','update','dev','2046255XUKlin','--name\x20cannot\x20be\x20empty.','flag','trim','appCode','Updated\x20role\x20','Nothing\x20to\x20update.','1596VWmhMG','5129634ngdOcj','18416OiSsJB','/smartapi/permit/role/update','POST','write','roleName','name','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','23478318oXeBqr','842324WjCISB','89631IofdKZ','New\x20role\x20name'];a236_0x3048=function(){return _0x22292e;};return a236_0x3048();}const a236_0x349557=a236_0x320a;(function(_0x3ec7c9,_0x3d07e7){const _0x590f16=a236_0x320a,_0x574c4c=_0x3ec7c9();while(!![]){try{const _0x3dbe95=parseInt(_0x590f16(0x80))/0x1+-parseInt(_0x590f16(0x84))/0x2+parseInt(_0x590f16(0x81))/0x3*(-parseInt(_0x590f16(0x86))/0x4)+-parseInt(_0x590f16(0x8a))/0x5+parseInt(_0x590f16(0x92))/0x6+parseInt(_0x590f16(0x91))/0x7*(-parseInt(_0x590f16(0x93))/0x8)+parseInt(_0x590f16(0x7f))/0x9;if(_0x3dbe95===_0x3d07e7)break;else _0x574c4c['push'](_0x574c4c['shift']());}catch(_0x54d8ed){_0x574c4c['push'](_0x574c4c['shift']());}}}(a236_0x3048,0xed977));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a236_0x349557(0x94);function a236_0x320a(_0x13b47e,_0x1d2870){_0x13b47e=_0x13b47e-0x7c;const _0x30489c=a236_0x3048();let _0x320ab7=_0x30489c[_0x13b47e];return _0x320ab7;}function readPatch(_0x4bd21c){const _0xdea676=a236_0x349557,_0x1b403c=_0x4bd21c[_0xdea676(0x8c)](_0xdea676(0x7d)),_0x5658bf=_0x4bd21c[_0xdea676(0x8c)]('remark'),_0x399228={};if(_0x1b403c!==undefined&&_0x1b403c!==null){const _0x61a182=String(_0x1b403c)[_0xdea676(0x8d)]();if(!_0x61a182)throw CliErrors[_0xdea676(0x85)](_0xdea676(0x8b));if(_0x61a182['length']>0x40)throw CliErrors[_0xdea676(0x85)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x399228[_0xdea676(0x7c)]=_0x61a182;}_0x5658bf!==undefined&&_0x5658bf!==null&&(_0x399228[_0xdea676(0x87)]=String(_0x5658bf));if(_0x399228[_0xdea676(0x7c)]===undefined&&_0x399228[_0xdea676(0x87)]===undefined)throw CliErrors[_0xdea676(0x85)](_0xdea676(0x90),_0xdea676(0x7e));return _0x399228;}export const roleUpdate={'service':'role','command':a236_0x349557(0x88),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','risk':a236_0x349557(0x96),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':'string','required':![],'description':a236_0x349557(0x82)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x341493){readPatch(_0x341493);},async 'dryRun'(_0x312ab8){const _0x3890ed=a236_0x349557,_0x4af490=_0x312ab8[_0x3890ed(0x83)]('id'),_0x5b0335=readPatch(_0x312ab8),_0xd4622f=await getRoleById(_0x312ab8[_0x3890ed(0x8e)],_0x4af490);return assertCustomRole(_0xd4622f,_0x3890ed(0x88)),asDryRunResult({'scope':_0x3890ed(0x89),'operation':_0x3890ed(0x88),'selector':{'appCode':_0x312ab8['appCode'],'roleId':_0x4af490,'roleName':_0xd4622f[_0x3890ed(0x7c)]},'before':projectRole(_0xd4622f),'after':projectRole({..._0xd4622f,..._0x5b0335[_0x3890ed(0x7c)]!==undefined?{'roleName':_0x5b0335[_0x3890ed(0x7c)]}:{},..._0x5b0335['remark']!==undefined?{'remark':_0x5b0335['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x3890ed(0x95),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x49d0e0){const _0x42e550=a236_0x349557,_0x4c8a88=_0x49d0e0[_0x42e550(0x83)]('id'),_0x492600=readPatch(_0x49d0e0),_0x5eb8d5=await getRoleById(_0x49d0e0[_0x42e550(0x8e)],_0x4c8a88);assertCustomRole(_0x5eb8d5,'update'),await updateAppRole({'id':_0x4c8a88,'appCode':_0x49d0e0['appCode'],..._0x492600[_0x42e550(0x7c)]!==undefined?{'roleName':_0x492600[_0x42e550(0x7c)]}:{},..._0x492600[_0x42e550(0x87)]!==undefined?{'remark':_0x492600['remark']}:{}});const _0x168efe=await getRoleById(_0x49d0e0[_0x42e550(0x8e)],_0x4c8a88);return{'ok':!![],'data':{'scope':'dev','operation':_0x42e550(0x88),'selector':{'appCode':_0x49d0e0['appCode'],'roleId':_0x4c8a88,'roleName':_0x168efe[_0x42e550(0x7c)]},'before':projectRole(_0x5eb8d5),'after':projectRole(_0x168efe),'dryRun':![],'backend':{'method':_0x42e550(0x95),'path':UPDATE_PATH},'warnings':[]},'message':_0x42e550(0x8f)+_0x168efe[_0x42e550(0x7c)]+'\x20(id='+_0x4c8a88+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a237_0x41c2f0=a237_0x1e67;(function(_0x36d3c1,_0x406cd2){const _0x34e174=a237_0x1e67,_0x263f07=_0x36d3c1();while(!![]){try{const _0x50a6f0=parseInt(_0x34e174(0xe0))/0x1*(parseInt(_0x34e174(0xe1))/0x2)+parseInt(_0x34e174(0xe4))/0x3+-parseInt(_0x34e174(0xea))/0x4+parseInt(_0x34e174(0xef))/0x5*(-parseInt(_0x34e174(0xde))/0x6)+parseInt(_0x34e174(0xe9))/0x7*(-parseInt(_0x34e174(0xe6))/0x8)+parseInt(_0x34e174(0xed))/0x9*(-parseInt(_0x34e174(0xee))/0xa)+parseInt(_0x34e174(0xe8))/0xb*(parseInt(_0x34e174(0xd9))/0xc);if(_0x50a6f0===_0x406cd2)break;else _0x263f07['push'](_0x263f07['shift']());}catch(_0x170eae){_0x263f07['push'](_0x263f07['shift']());}}}(a237_0x5e94,0x7b688));function a237_0x1e67(_0x4ce3d1,_0x475822){_0x4ce3d1=_0x4ce3d1-0xd9;const _0x5e94f0=a237_0x5e94();let _0x1e67c8=_0x5e94f0[_0x4ce3d1];return _0x1e67c8;}import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a237_0x5e94(){const _0x5040dd=['846BqVYjZ','590xWoVtP','39265fatSDq','4478484NeTWdR','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','\x20already\x20in\x20role\x20','\x20to\x20role\x20','appCode','30JzWkNF','No\x20change:\x20user\x20','671841QPLfSI','2dSxmpO','Added\x20user\x20','selector','1011606UPTnRj','userId','1879536JVsugy','user-add','11IzbuaZ','21QzMHgd','508532niTdno','roleName','high-risk-write'];a237_0x5e94=function(){return _0x5040dd;};return a237_0x5e94();}export const roleUserAdd={'service':'role','command':'user-add','description':a237_0x41c2f0(0xda),'risk':a237_0x41c2f0(0xec),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x492f8b){const _0xa32424=a237_0x41c2f0,{mutation:_0x50edd2}=await prepareUserMutation(_0x492f8b,_0xa32424(0xe7),!![]);return asDryRunResult(_0x50edd2,{'method':'POST','url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x34c4bc){const _0x359bba=a237_0x41c2f0,{mutation:_0x43ee7b,changed:_0x2548f3,role:_0x408ec4,user:_0x33c4e6}=await prepareUserMutation(_0x34c4bc,_0x359bba(0xe7),![]);return _0x2548f3&&await createDevUserRole({'appCode':_0x34c4bc[_0x359bba(0xdd)],'userId':_0x33c4e6[_0x359bba(0xe5)],'username':_0x33c4e6['username'],'roleType':_0x408ec4['roleType'],'roleId':_0x43ee7b[_0x359bba(0xe3)]['roleId']}),{'ok':!![],'data':_0x43ee7b,'message':_0x2548f3?_0x359bba(0xe2)+_0x43ee7b['selector'][_0x359bba(0xe5)]+_0x359bba(0xdc)+_0x43ee7b[_0x359bba(0xe3)][_0x359bba(0xeb)]:_0x359bba(0xdf)+_0x43ee7b[_0x359bba(0xe3)][_0x359bba(0xe5)]+_0x359bba(0xdb)+_0x43ee7b[_0x359bba(0xe3)]['roleName']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a238_0x3963e5=a238_0x14b8;(function(_0xead39b,_0x9637ee){const _0x299508=a238_0x14b8,_0xcb9ea9=_0xead39b();while(!![]){try{const _0x153a8e=-parseInt(_0x299508(0xd6))/0x1+-parseInt(_0x299508(0xdd))/0x2*(parseInt(_0x299508(0xdb))/0x3)+-parseInt(_0x299508(0xd9))/0x4+parseInt(_0x299508(0xdc))/0x5+parseInt(_0x299508(0xd2))/0x6+parseInt(_0x299508(0xd5))/0x7+parseInt(_0x299508(0xd7))/0x8;if(_0x153a8e===_0x9637ee)break;else _0xcb9ea9['push'](_0xcb9ea9['shift']());}catch(_0x41acbb){_0xcb9ea9['push'](_0xcb9ea9['shift']());}}}(a238_0x59be,0x4ae4b));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a238_0x14b8(_0x170ee7,_0x321f74){_0x170ee7=_0x170ee7-0xd1;const _0x59be28=a238_0x59be();let _0x14b866=_0x59be28[_0x170ee7];return _0x14b866;}export const roleUserRemove={'service':a238_0x3963e5(0xdf),'command':a238_0x3963e5(0xd4),'description':a238_0x3963e5(0xd8),'risk':a238_0x3963e5(0xda),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x5d1e7a){const _0xc025c1=a238_0x3963e5,{mutation:_0x4c2052}=await prepareUserMutation(_0x5d1e7a,_0xc025c1(0xd4),!![]);return asDryRunResult(_0x4c2052,{'method':'POST','url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x213980){const _0x430e34=a238_0x3963e5,{matchingRelationIds:_0x1b9459,mutation:_0x250375,changed:_0x3b17e7}=await prepareUserMutation(_0x213980,_0x430e34(0xd4),![]);if(_0x3b17e7)for(const _0x507876 of _0x1b9459){await deleteDevUserRole(_0x507876);}return{'ok':!![],'data':_0x250375,'message':_0x3b17e7?'Removed\x20user\x20'+_0x250375[_0x430e34(0xd1)]['userId']+_0x430e34(0xd3)+_0x250375[_0x430e34(0xd1)]['roleName']:_0x430e34(0xe1)+_0x250375[_0x430e34(0xd1)]['userId']+_0x430e34(0xe0)+_0x250375[_0x430e34(0xd1)][_0x430e34(0xde)]};}};function a238_0x59be(){const _0x45246f=['No\x20change:\x20user\x20','selector','2617266PnsDdz','\x20from\x20role\x20','user-remove','930993eOlzoy','115183qBfeDp','4412504cretSe','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','1850888SjegXy','high-risk-write','916323lMXXTk','1873885qPXXzc','4BnrXQg','roleName','role','\x20not\x20in\x20role\x20'];a238_0x59be=function(){return _0x45246f;};return a238_0x59be();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a239_0x12a347=a239_0x67c8;function a239_0x67c8(_0x797d60,_0xfc1832){_0x797d60=_0x797d60-0x1f3;const _0x5893a7=a239_0x5893();let _0x67c881=_0x5893a7[_0x797d60];return _0x67c881;}function a239_0x5893(){const _0x144c04=['nickname','username','2540654iYkihu','role','1HCBDnS','str','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','\x22\x20→\x20userId\x20','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','827982zPaOXj','Resolved\x20\x22','8935816koCHjQ','26855433UaYZUH','name','user-resolve','Pass\x20--name\x20<nickname|username>.','1124207ZtqBFr','1049277yAVcrv','read','trim','40gKPacK','userId','306652hmFVbR','flagMissing'];a239_0x5893=function(){return _0x144c04;};return a239_0x5893();}(function(_0x8c29c7,_0x50dc5a){const _0x48a8e3=a239_0x67c8,_0x4adcef=_0x8c29c7();while(!![]){try{const _0xffbd93=parseInt(_0x48a8e3(0x1fc))/0x1*(parseInt(_0x48a8e3(0x1fa))/0x2)+parseInt(_0x48a8e3(0x209))/0x3+parseInt(_0x48a8e3(0x1f6))/0x4+parseInt(_0x48a8e3(0x1f4))/0x5*(parseInt(_0x48a8e3(0x201))/0x6)+-parseInt(_0x48a8e3(0x208))/0x7+parseInt(_0x48a8e3(0x203))/0x8+-parseInt(_0x48a8e3(0x204))/0x9;if(_0xffbd93===_0x50dc5a)break;else _0x4adcef['push'](_0x4adcef['shift']());}catch(_0x310e2e){_0x4adcef['push'](_0x4adcef['shift']());}}}(a239_0x5893,0xbcc2c));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_0x12a347(0x1fb),'command':a239_0x12a347(0x206),'description':a239_0x12a347(0x200),'risk':a239_0x12a347(0x20a),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x31b4da){const _0x4195fd=a239_0x12a347;if(!_0x31b4da[_0x4195fd(0x1fd)](_0x4195fd(0x205))[_0x4195fd(0x1f3)]())throw CliErrors[_0x4195fd(0x1f7)](_0x4195fd(0x205),_0x4195fd(0x207));},async 'execute'(_0x520c2f){const _0x2fdc3c=a239_0x12a347,_0x2b88d3=_0x520c2f['str'](_0x2fdc3c(0x205))[_0x2fdc3c(0x1f3)](),_0x4b55d6=await resolveUserRef(_0x2b88d3,_0x2fdc3c(0x1fe));return{'ok':!![],'data':{'user':{'userId':_0x4b55d6[_0x2fdc3c(0x1f5)],'username':_0x4b55d6[_0x2fdc3c(0x1f9)],'nickname':_0x4b55d6[_0x2fdc3c(0x1f8)],'matchedBy':_0x4b55d6['matchedBy']}},'message':_0x2fdc3c(0x202)+_0x2b88d3+_0x2fdc3c(0x1ff)+_0x4b55d6[_0x2fdc3c(0x1f5)]};}};
|
package/lib/commands/rule/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a240_0xa2bc1a=a240_0x1198;(function(_0x579738,_0x3d9202){const _0x3821f4=a240_0x1198,_0x85cda=_0x579738();while(!![]){try{const _0x22345e=parseInt(_0x3821f4(0xa4))/0x1+parseInt(_0x3821f4(0xae))/0x2+parseInt(_0x3821f4(0xb4))/0x3+parseInt(_0x3821f4(0xa6))/0x4+-parseInt(_0x3821f4(0xac))/0x5+parseInt(_0x3821f4(0xa5))/0x6*(-parseInt(_0x3821f4(0xa9))/0x7)+-parseInt(_0x3821f4(0xa7))/0x8;if(_0x22345e===_0x3d9202)break;else _0x85cda['push'](_0x85cda['shift']());}catch(_0x378712){_0x85cda['push'](_0x85cda['shift']());}}}(a240_0x2267,0x35d4b));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';function a240_0x1198(_0x4af37a,_0x3940dc){_0x4af37a=_0x4af37a-0xa4;const _0x22670f=a240_0x2267();let _0x11987c=_0x22670f[_0x4af37a];return _0x11987c;}export const ruleGet={'service':a240_0xa2bc1a(0xb1),'command':a240_0xa2bc1a(0xaf),'description':a240_0xa2bc1a(0xab),'risk':a240_0xa2bc1a(0xb5),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x3e2f7c){readAppRuleType(_0x3e2f7c);},async 'execute'(_0x15fcc6){const _0x5e6e8a=a240_0xa2bc1a,_0x1258ba=readAppRuleType(_0x15fcc6),_0x1bcf0b=await getAppRule(_0x15fcc6[_0x5e6e8a(0xb2)],{'appCode':_0x15fcc6[_0x5e6e8a(0xaa)],'type':_0x1258ba});if(!_0x1bcf0b)throw appRuleError('app_rule_not_found',appRuleFileName(_0x1258ba)+_0x5e6e8a(0xad)+_0x15fcc6[_0x5e6e8a(0xaa)]+'.',_0x5e6e8a(0xa8)+_0x1258ba+'\x20--file\x20<path>\x20--dry-run`.');return{'ok':!![],'data':{'rule':{...projectAppRule(_0x1258ba,_0x1bcf0b),'content':_0x1bcf0b[_0x5e6e8a(0xb3)]}},'message':_0x5e6e8a(0xb0)+appRuleFileName(_0x1258ba)+'\x20for\x20'+_0x15fcc6[_0x5e6e8a(0xaa)]};}};function a240_0x2267(){const _0x2d5a5d=['223230lHyTfg','\x20is\x20not\x20configured\x20for\x20app\x20','260346mzzCBJ','get','Loaded\x20','rule','cookie','content','892989eCXELA','read','177231vHCWeM','783708YXAZiu','1677664HpBdQK','3984880mYGOhY','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','14zHQndr','appCode','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app'];a240_0x2267=function(){return _0x2d5a5d;};return a240_0x2267();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a241_0x4a9737=a241_0x28db;(function(_0x1ac2b3,_0x34fb21){const _0x1e8879=a241_0x28db,_0x189bd3=_0x1ac2b3();while(!![]){try{const _0x1d9594=parseInt(_0x1e8879(0xf9))/0x1+parseInt(_0x1e8879(0xf6))/0x2+parseInt(_0x1e8879(0xfb))/0x3*(-parseInt(_0x1e8879(0xfe))/0x4)+parseInt(_0x1e8879(0xfa))/0x5+parseInt(_0x1e8879(0xfc))/0x6*(parseInt(_0x1e8879(0xfd))/0x7)+parseInt(_0x1e8879(0xf8))/0x8*(-parseInt(_0x1e8879(0xff))/0x9)+parseInt(_0x1e8879(0xf7))/0xa;if(_0x1d9594===_0x34fb21)break;else _0x189bd3['push'](_0x189bd3['shift']());}catch(_0x1b6676){_0x189bd3['push'](_0x189bd3['shift']());}}}(a241_0x3621,0x946c9));import{withKbManagementSession}from'../../core/kb-management-client.js';function a241_0x28db(_0x52715d,_0x205ffa){_0x52715d=_0x52715d-0xf4;const _0x3621bf=a241_0x3621();let _0x28dbb8=_0x3621bf[_0x52715d];return _0x28dbb8;}import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet][a241_0x4a9737(0xf4)](_0x531153=>({..._0x531153,'execute':_0x2a067f=>withKbManagementSession(_0x2a067f[a241_0x4a9737(0xf5)],()=>_0x531153['execute'](_0x2a067f)),..._0x531153[a241_0x4a9737(0x100)]?{'dryRun':_0x3aa138=>withKbManagementSession(_0x3aa138['signal'],()=>_0x531153['dryRun'](_0x3aa138))}:{}}));function a241_0x3621(){const _0x104bf8=['4FyTAvu','18LFkARu','dryRun','map','signal','1527462VuvTqT','10767630GuXqYM','4863392tpeEAq','190391WMapJI','794845uoktBq','3139377vcIDPS','140772LyJpDb','203VpdyFH'];a241_0x3621=function(){return _0x104bf8;};return a241_0x3621();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a242_0x88f392=a242_0x4f84;(function(_0x2f09b7,_0xd05d9e){const _0x29bb5a=a242_0x4f84,_0x189567=_0x2f09b7();while(!![]){try{const _0x167138=parseInt(_0x29bb5a(0x176))/0x1+parseInt(_0x29bb5a(0x171))/0x2+parseInt(_0x29bb5a(0x179))/0x3+-parseInt(_0x29bb5a(0x16f))/0x4+parseInt(_0x29bb5a(0x177))/0x5*(-parseInt(_0x29bb5a(0x17a))/0x6)+parseInt(_0x29bb5a(0x172))/0x7*(-parseInt(_0x29bb5a(0x173))/0x8)+parseInt(_0x29bb5a(0x17b))/0x9*(parseInt(_0x29bb5a(0x174))/0xa);if(_0x167138===_0xd05d9e)break;else _0x189567['push'](_0x189567['shift']());}catch(_0x5b1a50){_0x189567['push'](_0x189567['shift']());}}}(a242_0x8634,0x3b48e));function a242_0x4f84(_0x49aa89,_0x443b6b){_0x49aa89=_0x49aa89-0x16e;const _0x86343=a242_0x8634();let _0x4f84a1=_0x86343[_0x49aa89];return _0x4f84a1;}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':'rule','command':a242_0x88f392(0x175),'description':a242_0x88f392(0x16e),'risk':'read','requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x4a578f){const _0x51b8a7=a242_0x88f392,_0x3b0e32=await Promise['all'](APP_RULE_TYPES[_0x51b8a7(0x178)](_0xebc869=>getAppRule(_0x4a578f[_0x51b8a7(0x17c)],{'appCode':_0x4a578f[_0x51b8a7(0x17e)],'type':_0xebc869}))),_0x2a598b=APP_RULE_TYPES[_0x51b8a7(0x178)]((_0x3406c2,_0x521fac)=>projectAppRule(_0x3406c2,_0x3b0e32[_0x521fac]??null));return{'ok':!![],'data':{'total':_0x2a598b[_0x51b8a7(0x17d)],'rules':_0x2a598b},'message':_0x51b8a7(0x170)+_0x4a578f['appCode']};}};function a242_0x8634(){const _0x3ed61c=['46382pEYNvh','24dzTZmO','650150nepswg','list','340654lcTxWC','7915qSXYCM','map','79866yopCHt','36ekqVet','9faQYzp','cookie','length','appCode','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','1050740GvoSuW','Loaded\x20app\x20rule\x20configuration\x20for\x20','205200KiwiJL'];a242_0x8634=function(){return _0x3ed61c;};return a242_0x8634();}
|
package/lib/commands/rule/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a243_0x469320=a243_0x2c8b;(function(_0x4d52ab,_0xe170da){const _0x3b154c=a243_0x2c8b,_0x3d3dba=_0x4d52ab();while(!![]){try{const _0x5dcdec=parseInt(_0x3b154c(0xab))/0x1+parseInt(_0x3b154c(0x90))/0x2*(-parseInt(_0x3b154c(0xa6))/0x3)+-parseInt(_0x3b154c(0x9d))/0x4*(-parseInt(_0x3b154c(0x89))/0x5)+parseInt(_0x3b154c(0xa3))/0x6+-parseInt(_0x3b154c(0x93))/0x7+parseInt(_0x3b154c(0x8c))/0x8*(parseInt(_0x3b154c(0x91))/0x9)+parseInt(_0x3b154c(0x9b))/0xa*(-parseInt(_0x3b154c(0x86))/0xb);if(_0x5dcdec===_0xe170da)break;else _0x3d3dba['push'](_0x3d3dba['shift']());}catch(_0x52f04e){_0x3d3dba['push'](_0x3d3dba['shift']());}}}(a243_0x2217,0x61e7c));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 a243_0x2217(){const _0x3804ee=['658904LZXudx','rule','expected-version','app_rule_content_too_large','251572lCNOKO','54umGqwA','--file\x20is\x20required.','2721292jCsBpX','push','RULES','app_rule_verification_failed','flag','version','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','app_rule_file_required','13792780TKtiDa','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','2386768vsymVh','\x20--format\x20compress','replacement','content','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','unconfigured','4665744uMWnbd','app_rule_set_outcome_unknown','rabetbase\x20rule\x20get\x20--type\x20','6nFFinK','cause','planned','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','appCode','552132veUErJ','contentHash','beforeRecord','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','DATABASE','byteSize','before','update','trim','app_rule_verification_unavailable','Set\x20','\x20could\x20not\x20be\x20verified.','input','str','set','\x20version\x20changed\x20before\x20write.','app_rule_expected_version_invalid','app_rule_version_mismatch','expectedVersion','create','POST','rules','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','file',';\x20current\x20version\x20is\x20','verified','type','11cxHxRO','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','cookie','5uazjkK','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','number'];a243_0x2217=function(){return _0x3804ee;};return a243_0x2217();}function readSetInput(_0x7f8d6d){const _0xbacc73=a243_0x2c8b,_0x563062=readAppRuleType(_0x7f8d6d),_0x22b906=_0x7f8d6d[_0xbacc73(0xb8)](_0xbacc73(0x82))[_0xbacc73(0xb3)]();if(!_0x22b906)throw appRuleError(_0xbacc73(0x9a),_0xbacc73(0x92),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x565212=_0x7f8d6d[_0xbacc73(0x97)](_0xbacc73(0x8e));let _0x588326;if(_0x565212!==undefined){_0x588326=Number(_0x565212);if(!Number['isSafeInteger'](_0x588326)||_0x588326<0x0)throw appRuleError(_0xbacc73(0x7b),_0xbacc73(0xa9));}return{'type':_0x563062,'file':_0x22b906,'expectedVersion':_0x588326};}async function prepareSet(_0x281346){const _0x55fdd9=a243_0x2c8b,_0x12e92a=readSetInput(_0x281346),_0x4f83d6=await readAppRuleFile(_0x12e92a['file']);if(_0x12e92a[_0x55fdd9(0x85)]===_0x55fdd9(0x80)&&_0x4f83d6[_0x55fdd9(0xa0)]['length']>0x7d0)throw appRuleError(_0x55fdd9(0x8f),_0x55fdd9(0x8a));const _0x4fe725=await getAppRule(_0x281346['cookie'],{'appCode':_0x281346[_0x55fdd9(0xaa)],'type':_0x12e92a['type']});if(_0x12e92a['expectedVersion']!==undefined&&(_0x4fe725?.['version']??0x0)!==_0x12e92a[_0x55fdd9(0x7d)])throw appRuleError(_0x55fdd9(0x7c),appRuleFileName(_0x12e92a[_0x55fdd9(0x85)])+_0x55fdd9(0x7a),'Expected\x20'+_0x12e92a['expectedVersion']+_0x55fdd9(0x83)+(_0x4fe725?.[_0x55fdd9(0x98)]??_0x55fdd9(0xa2))+_0x55fdd9(0xae));return{'input':_0x12e92a,'replacement':_0x4f83d6,'beforeRecord':_0x4fe725,'before':projectAppRule(_0x12e92a[_0x55fdd9(0x85)],_0x4fe725),'planned':{'type':_0x12e92a[_0x55fdd9(0x85)],'fileName':appRuleFileName(_0x12e92a[_0x55fdd9(0x85)]),'contextScope':appRuleContextScope(_0x12e92a['type']),'enabled':!![],'appCode':_0x281346[_0x55fdd9(0xaa)],'scope':_0x55fdd9(0x80),'contentByteSize':_0x4f83d6[_0x55fdd9(0xb0)],'contentHash':_0x4f83d6[_0x55fdd9(0xac)]}};}function warningsFor(_0x24ee10){return[];}function a243_0x2c8b(_0x182a65,_0x355fcb){_0x182a65=_0x182a65-0x79;const _0x2217a1=a243_0x2217();let _0x2c8be0=_0x2217a1[_0x182a65];return _0x2c8be0;}export const ruleSet={'service':a243_0x469320(0x8d),'command':a243_0x469320(0x79),'description':'Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x469320(0x82),'type':'string','required':!![],'description':'UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)'},{'name':a243_0x469320(0x8e),'type':a243_0x469320(0x8b),'required':![],'description':'Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set'}],async 'validate'(_0x4b6b5a){readSetInput(_0x4b6b5a);},async 'dryRun'(_0x28b51f){const _0x31838d=a243_0x469320,_0x45f010=await prepareSet(_0x28b51f);return asDryRunResult({'operation':_0x31838d(0x79),'selector':{'appCode':_0x28b51f[_0x31838d(0xaa)],'scope':'rules','type':_0x45f010[_0x31838d(0xb7)][_0x31838d(0x85)]},'before':_0x45f010[_0x31838d(0xb1)],'after':_0x45f010[_0x31838d(0xa8)],'dryRun':!![],'backend':{'method':_0x31838d(0x7f),'path':knowledgeDocumentsPath(_0x31838d(0x80),_0x45f010[_0x31838d(0xad)]?_0x31838d(0xb2):_0x31838d(0x7e)),'body':{'appCode':_0x28b51f[_0x31838d(0xaa)],..._0x45f010[_0x31838d(0xad)]?{'id':_0x45f010[_0x31838d(0xad)]['id']}:{},'title':_0x45f010[_0x31838d(0xb7)][_0x31838d(0x85)]===_0x31838d(0x80)?_0x31838d(0x95):_0x31838d(0xaf),'contentHash':_0x45f010[_0x31838d(0x9f)][_0x31838d(0xac)],'contentByteSize':_0x45f010['replacement']['byteSize'],..._0x45f010[_0x31838d(0xad)]?{'expectedVersion':_0x45f010[_0x31838d(0xad)][_0x31838d(0x98)]}:{}}},'warnings':warningsFor(_0x45f010['input'][_0x31838d(0x7d)]),'verification':{'expectedVersion':_0x45f010[_0x31838d(0xad)]?.[_0x31838d(0x98)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x31838d(0xa5)+_0x45f010[_0x31838d(0xb7)][_0x31838d(0x85)]+_0x31838d(0x9e)}},{'method':_0x31838d(0x7f),'url':knowledgeDocumentsPath(_0x31838d(0x80),_0x45f010[_0x31838d(0xad)]?_0x31838d(0xb2):_0x31838d(0x7e))});},async 'execute'(_0x152327){const _0x22bdff=a243_0x469320,_0x5a7585=await prepareSet(_0x152327),_0x5698f2=_0x5a7585[_0x22bdff(0xad)]===null?0x1:_0x5a7585['beforeRecord'][_0x22bdff(0x98)]+(_0x5a7585[_0x22bdff(0xad)][_0x22bdff(0xa0)]===_0x5a7585[_0x22bdff(0x9f)][_0x22bdff(0xa0)]?0x0:0x1);let _0x3aaee1,_0x19e4da=![];try{_0x3aaee1=await saveAppRule(_0x152327[_0x22bdff(0x88)],{'appCode':_0x152327['appCode'],'type':_0x5a7585['input'][_0x22bdff(0x85)],'content':_0x5a7585[_0x22bdff(0x9f)][_0x22bdff(0xa0)],'expectedVersion':_0x5a7585[_0x22bdff(0xad)]?.['version']??0x0,..._0x5a7585[_0x22bdff(0xad)]?{'id':_0x5a7585[_0x22bdff(0xad)]['id']}:{}});if(_0x3aaee1['version']!==_0x5698f2||_0x3aaee1[_0x22bdff(0xa0)]!==_0x5a7585[_0x22bdff(0x9f)]['content']||_0x5a7585['beforeRecord']!==null&&_0x3aaee1['id']!==_0x5a7585[_0x22bdff(0xad)]['id'])throw appRuleError(_0x22bdff(0x96),_0x22bdff(0x81),_0x22bdff(0x87));}catch(_0x33f02e){if(!isPlatformTransportFailure(_0x33f02e))throw _0x33f02e;_0x19e4da=!![];}let _0x1e8c91;try{_0x1e8c91=await getAppRule(_0x152327['cookie'],{'appCode':_0x152327[_0x22bdff(0xaa)],'type':_0x5a7585[_0x22bdff(0xb7)][_0x22bdff(0x85)]});}catch(_0x52a3c2){const _0x5221fd=appRuleError(_0x19e4da?_0x22bdff(0xa4):_0x22bdff(0xb4),'The\x20set\x20request\x20was\x20sent,\x20but\x20'+appRuleFileName(_0x5a7585[_0x22bdff(0xb7)][_0x22bdff(0x85)])+_0x22bdff(0xb6),_0x22bdff(0x99));Object['defineProperty'](_0x5221fd,_0x22bdff(0xa7),{'value':_0x52a3c2,'enumerable':![]});throw _0x5221fd;}const _0x3ff671=_0x1e8c91&&inspectAppRuleContent(_0x1e8c91['content'])[_0x22bdff(0xac)]===_0x5a7585['replacement'][_0x22bdff(0xac)],_0x18463b=_0x1e8c91&&_0x1e8c91[_0x22bdff(0x98)]===_0x5698f2&&(!_0x3aaee1||_0x1e8c91['id']===_0x3aaee1['id']&&_0x1e8c91[_0x22bdff(0x98)]===_0x3aaee1['version']);if(!_0x1e8c91||!_0x3ff671||!_0x18463b||_0x5a7585['beforeRecord']!==null&&_0x1e8c91['id']!==_0x5a7585[_0x22bdff(0xad)]['id'])throw appRuleError(_0x19e4da?_0x22bdff(0xa4):_0x22bdff(0x96),appRuleFileName(_0x5a7585[_0x22bdff(0xb7)][_0x22bdff(0x85)])+_0x22bdff(0x9c),_0x22bdff(0xa1)+_0x5a7585[_0x22bdff(0xb7)][_0x22bdff(0x85)]+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x37a7dc=warningsFor(_0x5a7585[_0x22bdff(0xb7)][_0x22bdff(0x7d)]);_0x19e4da&&_0x37a7dc[_0x22bdff(0x94)]('Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.');const _0x4957d8=projectAppRule(_0x5a7585['input'][_0x22bdff(0x85)],_0x1e8c91);return{'ok':!![],'data':{'operation':_0x22bdff(0x79),'selector':{'appCode':_0x152327[_0x22bdff(0xaa)],'scope':'rules','type':_0x5a7585[_0x22bdff(0xb7)][_0x22bdff(0x85)]},'before':_0x5a7585['before'],'after':_0x4957d8,'dryRun':![],'backend':{'method':_0x22bdff(0x7f),'path':knowledgeDocumentsPath(_0x22bdff(0x80),_0x5a7585['beforeRecord']?_0x22bdff(0xb2):_0x22bdff(0x7e))},'warnings':_0x37a7dc,'verification':{'status':_0x22bdff(0x84),'recoveredAfterUnknownResponse':_0x19e4da,'expectedVersion':_0x5a7585['beforeRecord']?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x22bdff(0xa5)+_0x5a7585[_0x22bdff(0xb7)]['type']+_0x22bdff(0x9e)}},'message':_0x22bdff(0xb5)+appRuleFileName(_0x5a7585[_0x22bdff(0xb7)][_0x22bdff(0x85)])+'\x20for\x20'+_0x152327[_0x22bdff(0xaa)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a244_0x356b0f=a244_0x525c;(function(_0x21c8e6,_0x21db9e){const _0x4430a8=a244_0x525c,_0x2ec67c=_0x21c8e6();while(!![]){try{const _0x7b8dab=-parseInt(_0x4430a8(0xdf))/0x1*(parseInt(_0x4430a8(0xbc))/0x2)+-parseInt(_0x4430a8(0xd9))/0x3+-parseInt(_0x4430a8(0xb3))/0x4+parseInt(_0x4430a8(0xd1))/0x5*(-parseInt(_0x4430a8(0xd7))/0x6)+parseInt(_0x4430a8(0xd3))/0x7+parseInt(_0x4430a8(0xc2))/0x8*(-parseInt(_0x4430a8(0xc7))/0x9)+parseInt(_0x4430a8(0xcb))/0xa;if(_0x7b8dab===_0x21db9e)break;else _0x2ec67c['push'](_0x2ec67c['shift']());}catch(_0x4815a0){_0x2ec67c['push'](_0x2ec67c['shift']());}}}(a244_0x23bd,0x6febd));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_0x356b0f(0xb5),a244_0x356b0f(0xc9)];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_0x356b0f(0xb7),'database':a244_0x356b0f(0xde)},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x356b0f(0xc0),'database':'database-analysis'};export function appRuleError(_0x4eba76,_0x2b632f,_0x54f02b){return new CliError(_0x4eba76,0x1,_0x2b632f,_0x54f02b);}export function readAppRuleType(_0x1a96ad){const _0x1e1e9f=a244_0x356b0f,_0x15ee8f=_0x1a96ad['str']('type')[_0x1e1e9f(0xdc)]()[_0x1e1e9f(0xc6)]();if(_0x15ee8f!==_0x1e1e9f(0xb5)&&_0x15ee8f!==_0x1e1e9f(0xc9))throw appRuleError(_0x1e1e9f(0xd5),_0x1e1e9f(0xd6));return _0x15ee8f;}function a244_0x23bd(){const _0x48f5f1=['6060gkdory','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','3851624lmQTpc','scope','app_rule_type_invalid','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','2868xqZoZq','app_rule_content_too_large','1666407VyWvDq','app_rule_file_required','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','trim','version','DATABASE.md','108ALbNqb','type','appCode','3156236guYTHl','contentHash','rules','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','RULES.md','isFile','utf-8','message','byteLength','5736sakHFx','app_rule_file_invalid','Cannot\x20read\x20app\x20rule\x20file:\x20','hex','page-api-development','Cannot\x20access\x20app\x20rule\x20file:\x20','1167560SEcLKE','app_rule_file_unreadable','createTime','updateTime','toLowerCase','27KnLSnU','indexStatus','database','app_rule_content_invalid','25796400OAmutm','content','--file\x20is\x20required.','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','update','from'];a244_0x23bd=function(){return _0x48f5f1;};return a244_0x23bd();}export function appRuleFileName(_0xe38029){return APP_RULE_FILES[_0xe38029];}export function appRuleContextScope(_0x349364){return APP_RULE_CONTEXT_SCOPES[_0x349364];}export function inspectAppRuleContent(_0x24971c){const _0x1eb3b9=a244_0x356b0f,_0x5f510d=Buffer[_0x1eb3b9(0xd0)](_0x24971c,'utf8');return{'content':_0x24971c,'byteSize':_0x5f510d[_0x1eb3b9(0xbb)],'contentHash':'sha256:'+createHash('sha256')[_0x1eb3b9(0xcf)](_0x5f510d)['digest'](_0x1eb3b9(0xbf))};}export async function readAppRuleFile(_0x240173){const _0x30e207=a244_0x356b0f,_0x1421ad=_0x240173[_0x30e207(0xdc)]();if(!_0x1421ad)throw appRuleError(_0x30e207(0xda),_0x30e207(0xcd),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x9417e=resolve(_0x1421ad);let _0x4d5a11;try{_0x4d5a11=await stat(_0x9417e);}catch(_0x2e7420){throw appRuleError(_0x30e207(0xc3),_0x30e207(0xc1)+_0x1421ad,_0x2e7420 instanceof Error?_0x2e7420[_0x30e207(0xba)]:String(_0x2e7420));}if(!_0x4d5a11[_0x30e207(0xb8)]())throw appRuleError(_0x30e207(0xbd),_0x30e207(0xdb)+_0x1421ad);if(_0x4d5a11['size']>MAX_APP_RULE_BYTES)throw appRuleError(_0x30e207(0xd8),'App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.');let _0x43bf17;try{_0x43bf17=await readFile(_0x9417e);}catch(_0x255675){throw appRuleError(_0x30e207(0xc3),_0x30e207(0xbe)+_0x1421ad,_0x255675 instanceof Error?_0x255675[_0x30e207(0xba)]:String(_0x255675));}if(_0x43bf17[_0x30e207(0xbb)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x30e207(0xd8),_0x30e207(0xd2));let _0x20b17f;try{_0x20b17f=new TextDecoder(_0x30e207(0xb9),{'fatal':!![],'ignoreBOM':!![]})['decode'](_0x43bf17);}catch{throw appRuleError(_0x30e207(0xca),_0x30e207(0xce)+_0x1421ad);}if(_0x20b17f['length']>MAX_APP_RULE_UNITS)throw appRuleError(_0x30e207(0xd8),'App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.');if(!_0x20b17f[_0x30e207(0xdc)]())throw appRuleError(_0x30e207(0xca),'App\x20rule\x20file\x20is\x20blank:\x20'+_0x1421ad);return inspectAppRuleContent(_0x20b17f);}function a244_0x525c(_0x421b66,_0x3fb902){_0x421b66=_0x421b66-0xb1;const _0x23bd74=a244_0x23bd();let _0x525c1a=_0x23bd74[_0x421b66];return _0x525c1a;}export function projectAppRule(_0x529d44,_0x28ee2b){const _0x19ef31=a244_0x356b0f;if(!_0x28ee2b)return{'type':_0x529d44,'fileName':appRuleFileName(_0x529d44),'contextScope':appRuleContextScope(_0x529d44),'enabled':![]};const _0x58dee1=inspectAppRuleContent(_0x28ee2b[_0x19ef31(0xcc)]);return{'type':_0x529d44,'fileName':appRuleFileName(_0x529d44),'contextScope':appRuleContextScope(_0x529d44),'enabled':!![],'id':_0x28ee2b['id'],'scope':_0x28ee2b[_0x19ef31(0xd4)],'appCode':_0x28ee2b[_0x19ef31(0xb2)],'version':_0x28ee2b[_0x19ef31(0xdd)],..._0x28ee2b[_0x19ef31(0xc8)]!==undefined?{'indexStatus':_0x28ee2b[_0x19ef31(0xc8)]}:{},'contentByteSize':_0x58dee1['byteSize'],'contentHash':_0x58dee1[_0x19ef31(0xb4)],..._0x28ee2b[_0x19ef31(0xc4)]!==undefined&&_0x28ee2b['createTime']!==null?{'createTime':_0x28ee2b[_0x19ef31(0xc4)]}:{},..._0x28ee2b[_0x19ef31(0xc5)]!==undefined&&_0x28ee2b[_0x19ef31(0xc5)]!==null?{'updateTime':_0x28ee2b[_0x19ef31(0xc5)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x356b0f(0xb1),'type':'string','required':!![],'description':a244_0x356b0f(0xb6),'enum':[...APP_RULE_TYPES]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a245_0x508598=a245_0x4efe;(function(_0x398bb1,_0x3120e4){const _0x597852=a245_0x4efe,_0x24edf8=_0x398bb1();while(!![]){try{const _0x3f62ab=-parseInt(_0x597852(0x13d))/0x1*(-parseInt(_0x597852(0x11b))/0x2)+-parseInt(_0x597852(0x118))/0x3*(parseInt(_0x597852(0x139))/0x4)+parseInt(_0x597852(0x111))/0x5*(parseInt(_0x597852(0x115))/0x6)+-parseInt(_0x597852(0x125))/0x7*(-parseInt(_0x597852(0x11d))/0x8)+parseInt(_0x597852(0x122))/0x9*(parseInt(_0x597852(0x13f))/0xa)+parseInt(_0x597852(0x119))/0xb*(parseInt(_0x597852(0x127))/0xc)+-parseInt(_0x597852(0x142))/0xd;if(_0x3f62ab===_0x3120e4)break;else _0x24edf8['push'](_0x24edf8['shift']());}catch(_0x2be4a2){_0x24edf8['push'](_0x24edf8['shift']());}}}(a245_0x5209,0x7bf44));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';function a245_0x4efe(_0x42aaa5,_0x24ce04){_0x42aaa5=_0x42aaa5-0x110;const _0x5209ad=a245_0x5209();let _0x4efe04=_0x5209ad[_0x42aaa5];return _0x4efe04;}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(['start',a245_0x508598(0x138)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x508598(0x13e),'dev','build',a245_0x508598(0x11a)]);export function syncProjectDomainRoutingBeforeScript(_0xf14f53,_0x106d63){const _0x4848e8=a245_0x508598;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x4848e8(0x120)](_0x106d63))return null;const _0x4bbac0=findProjectRootDirectory(_0xf14f53);if(!resolveConfigPath(_0x4bbac0))return null;const _0x124b5=writeProjectDomainRoutingManifest(_0x4bbac0);return{'path':_0x124b5[_0x4848e8(0x14e)],'changed':_0x124b5[_0x4848e8(0x14b)]};}function readPackageScripts(_0x13c348){const _0x41aebe=a245_0x508598,_0x382373=resolve(_0x13c348,_0x41aebe(0x12c));if(!existsSync(_0x382373))return null;try{const _0x2250dd=JSON[_0x41aebe(0x143)](readFileSync(_0x382373,_0x41aebe(0x14c)));return _0x2250dd['scripts']??{};}catch{return null;}}function detectPackageManager(_0x5d376a){const _0x12d8f1=a245_0x508598;if(existsSync(resolve(_0x5d376a,_0x12d8f1(0x147)))||existsSync(resolve(_0x5d376a,_0x12d8f1(0x130))))return _0x12d8f1(0x141);if(existsSync(resolve(_0x5d376a,_0x12d8f1(0x112))))return _0x12d8f1(0x116);if(existsSync(resolve(_0x5d376a,_0x12d8f1(0x114))))return'yarn';return'npm';}async function versionCheck(_0xd7af5a){const _0x2395fd=a245_0x508598,_0x120b1b=await checkCliVersion();(_0x120b1b['needsUpgrade']||_0x120b1b['belowMinimum'])&&(printCliUpgradeWarning(_0x120b1b),assertCliVersionSupported(_0x120b1b));const _0x210853=await checkSdkVersion(_0xd7af5a);if(_0x210853[_0x2395fd(0x123)])printSdkUpgradeWarning(_0x210853);}function spawnScript(_0x15f182,_0x5507d1,_0x24953e,_0x535695){return new Promise((_0x3a0765,_0x437379)=>{const _0x4d6c62=a245_0x4efe,_0x5cf14c=[_0x4d6c62(0x148),_0x5507d1,..._0x24953e],_0x3c9ba8=spawn(_0x15f182,_0x5cf14c,{'cwd':_0x535695,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x535695,_0x4d6c62(0x113),_0x4d6c62(0x110))+delimiter+process.env.PATH}});_0x3c9ba8['on']('close',_0x4a40b6=>{const _0x591813=_0x4d6c62;if(_0x4a40b6===0x0||_0x4a40b6===null)_0x3a0765();else _0x437379(new Error(_0x15f182+_0x591813(0x13b)+_0x5507d1+_0x591813(0x12e)+_0x4a40b6));}),_0x3c9ba8['on'](_0x4d6c62(0x146),_0x437379);});}function spawnViteBuildWatch(_0xc870db){return new Promise((_0x4e4521,_0x57da73)=>{const _0x28948e=a245_0x4efe,_0x5a520e=spawn(_0x28948e(0x149),[_0x28948e(0x121),'--watch'],{'cwd':_0xc870db,'stdio':_0x28948e(0x140),'shell':!![],'env':{...process.env,'PATH':''+join(_0xc870db,_0x28948e(0x113),'.bin')+delimiter+process.env.PATH}});_0x5a520e['on'](_0x28948e(0x124),_0x33b923=>{const _0x447f5f=_0x28948e;if(_0x33b923===0x0||_0x33b923===null)_0x4e4521();else _0x57da73(new Error(_0x447f5f(0x11c)+_0x33b923));}),_0x5a520e['on'](_0x28948e(0x146),_0x57da73);});}function spawnVitePreview(_0x250e03){return new Promise((_0x53de58,_0xd60f0d)=>{const _0x4f97b4=a245_0x4efe,_0x86c1b9=spawn('vite',[_0x4f97b4(0x11a)],{'cwd':_0x250e03,'stdio':_0x4f97b4(0x140),'shell':!![],'env':{...process.env,'PATH':''+join(_0x250e03,'node_modules',_0x4f97b4(0x110))+delimiter+process.env.PATH}});_0x86c1b9['on'](_0x4f97b4(0x124),_0x4474d5=>{const _0x403c9=_0x4f97b4;if(_0x4474d5===0x0||_0x4474d5===null)_0x53de58();else _0xd60f0d(new Error(_0x403c9(0x145)+_0x4474d5));}),_0x86c1b9['on'](_0x4f97b4(0x146),_0xd60f0d);});}const runFlags=[{'name':a245_0x508598(0x12d),'type':a245_0x508598(0x12a),'description':a245_0x508598(0x12b),'default':![]}];export const runDefinition={'service':a245_0x508598(0x148),'command':a245_0x508598(0x148),'description':a245_0x508598(0x135),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4f51ef=a245_0x508598,_0x2cf706=[];return _0x2cf706[_0x4f51ef(0x129)]('\x20\x20EXAMPLES'),_0x2cf706[_0x4f51ef(0x129)](_0x4f51ef(0x134)+CLI_BIN_NAME+'\x20run\x20start'),_0x2cf706['push'](_0x4f51ef(0x134)+CLI_BIN_NAME+_0x4f51ef(0x13c)),_0x2cf706[_0x4f51ef(0x129)](_0x4f51ef(0x134)+CLI_BIN_NAME+_0x4f51ef(0x131)),_0x2cf706[_0x4f51ef(0x129)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x2cf706[_0x4f51ef(0x117)]('\x0a');},async 'execute'(_0x3ffbac){const _0x59c5bd=a245_0x508598,_0x5ed125=process[_0x59c5bd(0x11f)](),_0x2859d9=_0x3ffbac[_0x59c5bd(0x144)][0x0],_0x7750da=_0x3ffbac[_0x59c5bd(0x144)]['slice'](0x1),_0xf11507=readPackageScripts(_0x5ed125);if(!_0xf11507)throw CliErrors[_0x59c5bd(0x13a)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x2859d9){const _0x3756bf=Object['keys'](_0xf11507);if(_0x3756bf[_0x59c5bd(0x11e)]===0x0)console[_0x59c5bd(0x136)](_0x59c5bd(0x133));else{console['log'](_0x59c5bd(0x12f));for(const _0xc98352 of _0x3756bf){console[_0x59c5bd(0x136)](_0x59c5bd(0x134)+_0xc98352);}console[_0x59c5bd(0x136)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x59c5bd(0x14d));}return{'ok':!![]};}if(!_0xf11507[_0x2859d9])throw CliErrors[_0x59c5bd(0x13a)](_0x59c5bd(0x128)+_0x2859d9+'\x22\x20not\x20found\x20in\x20package.json.',_0x59c5bd(0x126)+(Object[_0x59c5bd(0x14a)](_0xf11507)[_0x59c5bd(0x117)](',\x20')||_0x59c5bd(0x132)));const _0x21351e=detectPackageManager(_0x5ed125),_0x207d94=syncProjectDomainRoutingBeforeScript(_0x5ed125,_0x2859d9);_0x207d94?.[_0x59c5bd(0x14b)]&&console[_0x59c5bd(0x146)](_0x59c5bd(0x137)+_0x207d94[_0x59c5bd(0x14e)]);VERSION_CHECK_SCRIPTS[_0x59c5bd(0x120)](_0x2859d9)&&await versionCheck(_0x5ed125);if(_0x2859d9===_0x59c5bd(0x11a)&&_0x3ffbac['bool'](_0x59c5bd(0x12d)))return await Promise['all']([spawnViteBuildWatch(_0x5ed125),spawnVitePreview(_0x5ed125)]),{'ok':!![]};return await spawnScript(_0x21351e,_0x2859d9,_0x7750da,_0x5ed125),{'ok':!![]};}};function a245_0x5209(){const _0x51f743=['21786AMmHdk','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','16owyWhc','length','cwd','has','build','6583419AuTaYg','needsUpgrade','close','1843716OCMCzL','Available:\x20','153372ZiPCbL','Script\x20\x22','push','boolean','Enable\x20watch\x20mode\x20for\x20preview','package.json','watch','\x20exited\x20with\x20code\x20','\x0a\x20\x20Available\x20scripts:\x0a','bun.lock','\x20run\x20preview','(none)','No\x20scripts\x20defined\x20in\x20package.json.','\x20\x20\x20\x20','Run\x20a\x20package.json\x20script','log','Domain\x20routing\x20synchronized:\x20','dev','4172TVYDQb','validation','\x20run\x20','\x20run\x20build','25JBRdSu','start','10bLbTsT','inherit','bun','31030155GlzzbI','parse','args','vite\x20preview\x20exited\x20with\x20code\x20','error','bun.lockb','run','vite','keys','changed','utf-8','\x20run\x20<script>\x0a','path','.bin','1275oPMrFc','pnpm-lock.yaml','node_modules','yarn.lock','19974SAzPBf','pnpm','join','99dmgKPO','473fgVWXW','preview'];a245_0x5209=function(){return _0x51f743;};return a245_0x5209();}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a246_0x853e63=a246_0xce5c;(function(_0x3e1397,_0x442beb){const _0xe692db=a246_0xce5c,_0x1b1d4d=_0x3e1397();while(!![]){try{const _0x5a175f=parseInt(_0xe692db(0xdd))/0x1*(parseInt(_0xe692db(0xd9))/0x2)+parseInt(_0xe692db(0xd6))/0x3+parseInt(_0xe692db(0xdb))/0x4*(-parseInt(_0xe692db(0xdc))/0x5)+-parseInt(_0xe692db(0xd7))/0x6+parseInt(_0xe692db(0xda))/0x7+parseInt(_0xe692db(0xd3))/0x8+-parseInt(_0xe692db(0xde))/0x9*(parseInt(_0xe692db(0xd1))/0xa);if(_0x5a175f===_0x442beb)break;else _0x1b1d4d['push'](_0x1b1d4d['shift']());}catch(_0x3110d0){_0x1b1d4d['push'](_0x1b1d4d['shift']());}}}(a246_0x28c2,0x7cbb6));function a246_0xce5c(_0x11ce6e,_0x577727){_0x11ce6e=_0x11ce6e-0xd0;const _0x28c2c1=a246_0x28c2();let _0xce5c62=_0x28c2c1[_0x11ce6e];return _0xce5c62;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x54d8fe){const _0x69c8cc=await buildSchemaPayload();return{'ok':!![],'data':_0x69c8cc};}export const schemaDefinition={'service':a246_0x853e63(0xd4),'command':a246_0x853e63(0xd8),'description':a246_0x853e63(0xd0),'risk':a246_0x853e63(0xd2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x853e63(0xd5),'flags':[],'execute':execute};function a246_0x28c2(){const _0x40503d=['read','7938888kAAwuT','schema','json','1034595yFRgon','3854982MoEbxt','export','109708iFdVzY','3463838vrgcsW','20peNqWj','378415IrBfKL','14nZosFo','9DeQEkr','Export\x20machine-readable\x20command\x20schema\x20(JSON)','10682020odRgFn'];a246_0x28c2=function(){return _0x40503d;};return a246_0x28c2();}
|