@lovrabet/rabetbase-cli 2.5.10-beta.2 → 2.5.10-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.d.ts +2 -2
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/context.d.ts +3 -0
- package/lib/commands/issue/context.js +1 -0
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
- package/skills/rabetbase/SKILL.md +2 -2
- package/skills/rabetbase/references/rabetbase-issue-report.md +4 -1
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
- package/lib/commands/issue/shared.d.ts +0 -32
- package/lib/commands/issue/shared.js +0 -1
- package/lib/telemetry/send-platform-issue-collect-log.d.ts +0 -26
- package/lib/telemetry/send-platform-issue-collect-log.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a232_0x5c42dd=a232_0x5613;function a232_0x14fe(){const _0x3a1c4d=['roleName','1161966VUZvMK','dev','Role\x20','Show\x20a\x20single\x20role\x27s\x20detail','9569DOcEKs','534600UjJUTP','appCode','32VVFDIx','num','read','515961gWezMk','2233884ajHDhy','1563528vWtbNI','4795000KCilPh','detail','1416fmuchB','role','1xOraoy'];a232_0x14fe=function(){return _0x3a1c4d;};return a232_0x14fe();}function a232_0x5613(_0x255247,_0x408e6b){_0x255247=_0x255247-0x7c;const _0x14fe77=a232_0x14fe();let _0x5613a3=_0x14fe77[_0x255247];return _0x5613a3;}(function(_0x7619b4,_0x50acc5){const _0x25a58b=a232_0x5613,_0x544655=_0x7619b4();while(!![]){try{const _0x8b043=-parseInt(_0x25a58b(0x88))/0x1*(parseInt(_0x25a58b(0x8a))/0x2)+parseInt(_0x25a58b(0x83))/0x3+parseInt(_0x25a58b(0x82))/0x4+-parseInt(_0x25a58b(0x7c))/0x5+parseInt(_0x25a58b(0x86))/0x6*(-parseInt(_0x25a58b(0x8e))/0x7)+-parseInt(_0x25a58b(0x7e))/0x8*(parseInt(_0x25a58b(0x81))/0x9)+parseInt(_0x25a58b(0x84))/0xa;if(_0x8b043===_0x50acc5)break;else _0x544655['push'](_0x544655['shift']());}catch(_0x577d6e){_0x544655['push'](_0x544655['shift']());}}}(a232_0x14fe,0x4df54));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_0x5c42dd(0x87),'command':a232_0x5c42dd(0x85),'description':a232_0x5c42dd(0x8d),'risk':a232_0x5c42dd(0x80),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x414f70){const _0x3c68bc=a232_0x5c42dd,_0x3fcab9=_0x414f70[_0x3c68bc(0x7f)]('id'),_0x1b4eb0=await getRoleById(_0x414f70[_0x3c68bc(0x7d)],_0x3fcab9);return{'ok':!![],'data':{'scope':_0x3c68bc(0x8b),'role':projectRole(_0x1b4eb0)},'message':_0x3c68bc(0x8c)+_0x1b4eb0[_0x3c68bc(0x89)]+'\x20('+_0x1b4eb0['roleType']+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3550ac,_0x686be6){const _0x50b5f2=a233_0x2025,_0x3eb09b=_0x3550ac();while(!![]){try{const _0x211f8d=-parseInt(_0x50b5f2(0xe8))/0x1+parseInt(_0x50b5f2(0xe9))/0x2+-parseInt(_0x50b5f2(0xe5))/0x3*(parseInt(_0x50b5f2(0xec))/0x4)+-parseInt(_0x50b5f2(0xea))/0x5*(parseInt(_0x50b5f2(0xeb))/0x6)+parseInt(_0x50b5f2(0xe7))/0x7+parseInt(_0x50b5f2(0xe4))/0x8*(parseInt(_0x50b5f2(0xe3))/0x9)+parseInt(_0x50b5f2(0xed))/0xa*(parseInt(_0x50b5f2(0xe6))/0xb);if(_0x211f8d===_0x686be6)break;else _0x3eb09b['push'](_0x3eb09b['shift']());}catch(_0x571f9a){_0x3eb09b['push'](_0x3eb09b['shift']());}}}(a233_0x2c8a,0x73379));import{roleList}from'../../commands/role/list.js';function a233_0x2025(_0x7e0e92,_0x697c2c){_0x7e0e92=_0x7e0e92-0xe3;const _0x2c8a1f=a233_0x2c8a();let _0x2025a1=_0x2c8a1f[_0x7e0e92];return _0x2025a1;}import{roleDetail}from'../../commands/role/detail.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';function a233_0x2c8a(){const _0x391f1a=['4164emMljR','11UFlacG','5026994NrDQVO','886669NvVyVk','1149906nERzja','5mlDqVq','4883178tycgWf','1384anRZkY','5881990wCpslC','639tJpwRg','86920mRTPrd'];a233_0x2c8a=function(){return _0x391f1a;};return a233_0x2c8a();}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_0x387f86=a234_0xccab;function a234_0x13f4(){const _0x344fcb=['list','roleType','length','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','161753qMRLtP','152510xDmItK','2269287plmMgk','Filter\x20by\x20role\x20type','4668pEfyvb','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','string','\x20role(s)','OWNER','num','read','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','pagesize','page','DEV','trim','4FTkHfr','8682710pYvSnb','dev','5245gMfJNe','type','3642056WWShGd','CUSTOM','ADMIN','role','10089959aCFbcK','24PhrbYx','str','Page\x20index\x20(1-based)','Invalid\x20--type\x20\x22','7hzQItU','validation','join','9cPSXGl','toUpperCase','number'];a234_0x13f4=function(){return _0x344fcb;};return a234_0x13f4();}(function(_0x3bb7c8,_0x518655){const _0x4c45f3=a234_0xccab,_0xcb2f25=_0x3bb7c8();while(!![]){try{const _0x556c2c=-parseInt(_0x4c45f3(0x141))/0x1+-parseInt(_0x4c45f3(0x142))/0x2+parseInt(_0x4c45f3(0x143))/0x3*(-parseInt(_0x4c45f3(0x129))/0x4)+parseInt(_0x4c45f3(0x12c))/0x5*(-parseInt(_0x4c45f3(0x145))/0x6)+parseInt(_0x4c45f3(0x137))/0x7*(-parseInt(_0x4c45f3(0x12e))/0x8)+parseInt(_0x4c45f3(0x13a))/0x9*(parseInt(_0x4c45f3(0x12a))/0xa)+parseInt(_0x4c45f3(0x132))/0xb*(parseInt(_0x4c45f3(0x133))/0xc);if(_0x556c2c===_0x518655)break;else _0xcb2f25['push'](_0xcb2f25['shift']());}catch(_0x2fc79c){_0xcb2f25['push'](_0xcb2f25['shift']());}}}(a234_0x13f4,0x6ab01));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a234_0xccab(_0x520d25,_0x409112){_0x520d25=_0x520d25-0x123;const _0x13f47f=a234_0x13f4();let _0xccab69=_0x13f47f[_0x520d25];return _0xccab69;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a234_0x387f86(0x130),a234_0x387f86(0x127),a234_0x387f86(0x149),a234_0x387f86(0x12f)];export const roleList={'service':a234_0x387f86(0x131),'command':a234_0x387f86(0x13d),'description':a234_0x387f86(0x124),'risk':a234_0x387f86(0x123),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0x387f86(0x12d),'type':a234_0x387f86(0x147),'required':![],'description':a234_0x387f86(0x144),'enum':ROLE_TYPES},{'name':a234_0x387f86(0x126),'type':a234_0x387f86(0x13c),'description':a234_0x387f86(0x135),'default':0x1},{'name':'pagesize','type':a234_0x387f86(0x13c),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x1a20c4){const _0x75de04=a234_0x387f86,_0x564f4e=_0x1a20c4[_0x75de04(0x134)](_0x75de04(0x12d))[_0x75de04(0x128)]();if(_0x564f4e&&!ROLE_TYPES['includes'](_0x564f4e[_0x75de04(0x13b)]()))throw CliErrors[_0x75de04(0x138)](_0x75de04(0x136)+_0x564f4e+'\x22.','Use\x20one\x20of:\x20'+ROLE_TYPES[_0x75de04(0x139)](',\x20')+'.');const _0x2c5192=_0x1a20c4[_0x75de04(0x14a)](_0x75de04(0x126),0x1),_0x5239b0=_0x1a20c4[_0x75de04(0x14a)](_0x75de04(0x125),0x64);if(_0x2c5192<0x1)throw CliErrors[_0x75de04(0x138)](_0x75de04(0x140));if(_0x5239b0<0x1||_0x5239b0>0x64)throw CliErrors[_0x75de04(0x138)](_0x75de04(0x146));},async 'execute'(_0x59616d){const _0x2afa69=a234_0x387f86,_0x197272=_0x59616d[_0x2afa69(0x14a)](_0x2afa69(0x126),0x1)||0x1,_0x2c3054=_0x59616d[_0x2afa69(0x14a)]('pagesize',0x64)||0x64,_0x5565fc=_0x59616d[_0x2afa69(0x134)]('type')[_0x2afa69(0x128)]()[_0x2afa69(0x13b)](),{items:_0x3bc91c,paging:_0x59b564}=await listAppRoles(_0x59616d['appCode'],{'currentPage':_0x197272,'pageSize':_0x2c3054}),_0x216c6d=_0x5565fc?_0x3bc91c['filter'](_0x452e8f=>_0x452e8f[_0x2afa69(0x13e)]===_0x5565fc):_0x3bc91c,_0x253872=_0x216c6d['map'](projectRole);return{'ok':!![],'data':{'scope':_0x2afa69(0x12b),'roles':_0x253872,'paging':_0x59b564},'message':'Found\x20'+_0x253872[_0x2afa69(0x13f)]+_0x2afa69(0x148)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a235_0x1d92(_0x50d2f3,_0x4c9964){_0x50d2f3=_0x50d2f3-0x89;const _0x631f9d=a235_0x631f();let _0x1d9240=_0x631f9d[_0x50d2f3];return _0x1d9240;}const a235_0x166d90=a235_0x1d92;(function(_0xf617f9,_0x5f2cc7){const _0x2f7d0f=a235_0x1d92,_0x504785=_0xf617f9();while(!![]){try{const _0x54dfe7=parseInt(_0x2f7d0f(0xad))/0x1+-parseInt(_0x2f7d0f(0xaa))/0x2*(-parseInt(_0x2f7d0f(0x8f))/0x3)+parseInt(_0x2f7d0f(0x93))/0x4+-parseInt(_0x2f7d0f(0xd0))/0x5+parseInt(_0x2f7d0f(0xc5))/0x6*(-parseInt(_0x2f7d0f(0xab))/0x7)+-parseInt(_0x2f7d0f(0xcf))/0x8*(-parseInt(_0x2f7d0f(0xc4))/0x9)+-parseInt(_0x2f7d0f(0xd8))/0xa;if(_0x54dfe7===_0x5f2cc7)break;else _0x504785['push'](_0x504785['shift']());}catch(_0x3ba0d7){_0x504785['push'](_0x504785['shift']());}}}(a235_0x631f,0xb3159));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a235_0x166d90(0x9b),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':a235_0x166d90(0xc7)};export const USER_REF_FLAG={'name':'user','type':a235_0x166d90(0xc9),'required':!![],'description':a235_0x166d90(0xa5)};export const NAME_FLAG={'name':a235_0x166d90(0xa2),'type':a235_0x166d90(0xc9),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':'name','type':a235_0x166d90(0xc9),'required':!![],'description':a235_0x166d90(0xa3)};export const REMARK_FLAG={'name':'remark','type':a235_0x166d90(0xc9),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x166d90(0x9f),'type':'number','required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a235_0x166d90(0xbf),a235_0x166d90(0xb9),'OWNER'];export function isBuiltinRole(_0x25bc26){const _0x480808=a235_0x166d90;return BUILTIN_ROLE_TYPES[_0x480808(0xb1)](_0x25bc26);}export function assertCustomRole(_0x33d62d,_0x469f93){const _0x1c95c4=a235_0x166d90;if(_0x33d62d[_0x1c95c4(0xb7)]!==_0x1c95c4(0x8a))throw CliErrors[_0x1c95c4(0xa7)]('Cannot\x20'+_0x469f93+_0x1c95c4(0xb8)+_0x33d62d[_0x1c95c4(0xd9)]+'\x20('+_0x33d62d[_0x1c95c4(0xb7)]+').',_0x1c95c4(0x92));}export function projectRole(_0x30e993){const _0x8351ac=a235_0x166d90;return{'id':_0x30e993['id'],'roleName':_0x30e993[_0x8351ac(0xd9)],'roleType':_0x30e993['roleType'],'remark':_0x30e993['remark'],'userCount':_0x30e993[_0x8351ac(0xcd)],'permitCount':_0x30e993[_0x8351ac(0xd2)],'builtin':isBuiltinRole(_0x30e993[_0x8351ac(0xb7)])};}export async function resolveRoleRef(_0x3edba0,_0x5791fe){const _0x452a32=a235_0x166d90,_0x4974d0=_0x5791fe[_0x452a32(0xb3)]();if(!_0x4974d0)throw CliErrors[_0x452a32(0xa7)](_0x452a32(0xb0),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x452a32(0xba)](_0x4974d0))return getRoleById(_0x3edba0,Number(_0x4974d0));const _0x46ed05=await listAllAppRoles(_0x3edba0),_0x15b229=_0x46ed05[_0x452a32(0xb5)](_0x5875e4=>_0x5875e4[_0x452a32(0xd9)]===_0x4974d0);if(_0x15b229['length']===0x0)throw CliErrors[_0x452a32(0xa7)](_0x452a32(0xcc)+_0x4974d0+_0x452a32(0xd5)+_0x3edba0+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x15b229[_0x452a32(0xc8)]>0x1){const _0xb4afec=_0x15b229[_0x452a32(0xa9)](_0x13eb99=>_0x13eb99['id'])[_0x452a32(0x8b)](',\x20');throw CliErrors[_0x452a32(0xa7)](_0x452a32(0xcc)+_0x4974d0+_0x452a32(0x8d)+_0xb4afec+').',_0x452a32(0xaf));}return _0x15b229[0x0];}export async function getRoleById(_0x4e7537,_0x415039){const _0x40378c=a235_0x166d90,_0x2a068e=await listAllAppRoles(_0x4e7537),_0x3cb3f7=_0x2a068e[_0x40378c(0xb5)](_0x41ca6b=>_0x41ca6b['id']===_0x415039&&(!_0x41ca6b['appCode']||_0x41ca6b[_0x40378c(0x8e)]===_0x4e7537));if(_0x3cb3f7[_0x40378c(0xc8)]!==0x1)throw CliErrors[_0x40378c(0xa7)](_0x40378c(0x94)+_0x415039+'\x20not\x20found\x20in\x20app\x20'+_0x4e7537+'.',_0x40378c(0xbe));return _0x3cb3f7[0x0];}async function listAllAppRoles(_0x176af8){const _0xa205a8=a235_0x166d90,_0x59110b=0x64,_0x47bc19=[];for(let _0x4a6efc=0x1;;_0x4a6efc+=0x1){const {items:_0x146c98,paging:_0x1ee05d}=await listAppRoles(_0x176af8,{'currentPage':_0x4a6efc,'pageSize':_0x59110b});_0x47bc19[_0xa205a8(0xa6)](..._0x146c98);if(_0x146c98[_0xa205a8(0xc8)]<_0x59110b||_0x1ee05d&&_0x47bc19[_0xa205a8(0xc8)]>=_0x1ee05d[_0xa205a8(0xa8)])return _0x47bc19;}}export async function resolveTenantCode(){const _0x52f6ea=a235_0x166d90,_0x4f08ff=await getSessionUserInfo(),_0x3be4d4=_0x4f08ff?.['user']?.[_0x52f6ea(0x95)]?.[_0x52f6ea(0xc3)];if(!_0x3be4d4)throw CliErrors['authRequired'](_0x52f6ea(0xd4));return _0x3be4d4;}function matchMember(_0xe67eca,_0x25734f){const _0x3e97a4=a235_0x166d90,_0x1b8435=_0x25734f[_0x3e97a4(0xb3)]()[_0x3e97a4(0xd1)]();return(_0xe67eca[_0x3e97a4(0x96)]??'')['toLowerCase']()===_0x1b8435||(_0xe67eca[_0x3e97a4(0x9e)]??'')[_0x3e97a4(0xd1)]()===_0x1b8435;}export async function resolveUserRef(_0x54a16f,_0xf9244f=a235_0x166d90(0x9a)){const _0x20f75d=a235_0x166d90,_0x31add0=_0x54a16f[_0x20f75d(0xb3)]();if(!_0x31add0)throw CliErrors[_0x20f75d(0xa7)](_0x20f75d(0x99),_0x20f75d(0xb6));const _0x5e2f1d=await resolveTenantCode(),_0x3ccab8=await getTenantMembers(_0x5e2f1d);if(/^\d+$/[_0x20f75d(0xba)](_0x31add0)){const _0xfb408=Number(_0x31add0),_0x851d87=_0x3ccab8[_0x20f75d(0x8c)](_0x53b5b9=>_0x53b5b9['userId']===_0xfb408);return{'userId':_0xfb408,'username':_0x851d87?.[_0x20f75d(0x9e)]??String(_0xfb408),'nickname':_0x851d87?.[_0x20f75d(0x96)],'matchedBy':'id'};}const _0x54849a=_0x3ccab8[_0x20f75d(0xb5)](_0x460e94=>matchMember(_0x460e94,_0x31add0));if(_0x54849a[_0x20f75d(0xc8)]===0x0)throw CliErrors[_0x20f75d(0xa7)]('No\x20tenant\x20member\x20matches\x20\x22'+_0x31add0+'\x22.',_0x20f75d(0xae)+_0xf9244f);if(_0x54849a[_0x20f75d(0xc8)]>0x1){const _0x3742b8=_0x54849a[_0x20f75d(0xa9)](_0x59dc4a=>(_0x59dc4a[_0x20f75d(0x96)]??_0x59dc4a[_0x20f75d(0x9e)]??'?')+'('+_0x59dc4a[_0x20f75d(0x89)]+')')[_0x20f75d(0x8b)](',\x20');throw CliErrors[_0x20f75d(0xa7)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x31add0+_0x20f75d(0xac)+_0x3742b8+'.',_0xf9244f);}const _0x4a8003=_0x54849a[0x0];return{'userId':_0x4a8003['userId'],'username':_0x4a8003[_0x20f75d(0x9e)]??String(_0x4a8003['userId']),'nickname':_0x4a8003[_0x20f75d(0x96)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a235_0x166d90(0xb4);export const DELETE_USER_ROLE_PATH=a235_0x166d90(0x97);function a235_0x631f(){const _0x26d94c=['769432LsyDEI','4360980wDtZCO','toLowerCase','permitCount','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','\x22\x20not\x20found\x20in\x20app\x20','POST','flag','19887950vnBBeo','roleName','userId','CUSTOM','join','find','\x22\x20is\x20ambiguous\x20(ids:\x20','appCode','3LbzpxR','\x20duplicate\x20memberships\x20for\x20user\x20','User\x20','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','4971072cAQWfu','Role\x20id\x20','tenant','nickname','/smartapi/permit/user-role/delete','Anti-drift\x20check\x20failed:\x20expected\x20','Missing\x20user\x20reference.','Pass\x20--user\x20<id>.','number','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Cannot\x20','username','expect-user-count','OWNER','flagMissing','name','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','expectUserCount','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','push','validation','totalCount','map','1039146Qvxzjf','1844836FyGZnL','\x22:\x20','1443686jtDhfH','Check\x20the\x20nickname/username.\x20','Disambiguate\x20with\x20--role\x20<id>.','Missing\x20role\x20reference.','includes','\x20is\x20already\x20a\x20member\x20of\x20role\x20','trim','/smartapi/permit/user-role/create','filter','Pass\x20--user\x20<id|name>.','roleType','\x20built-in\x20role\x20','DEV','test','dev','dryRun','user-add','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','ADMIN','\x20members\x20of\x20the\x20OWNER\x20role.','\x20is\x20not\x20a\x20member\x20of\x20role\x20','str','tenant_code','135exRcVS','24uzNNXd','user','Role\x20id\x20or\x20exact\x20role\x20name','length','string','role',';\x20no\x20change.','Role\x20name\x20\x22','userCount','\x20member(s)\x20but\x20role\x20has\x20'];a235_0x631f=function(){return _0x26d94c;};return a235_0x631f();}export function computeRoleUserMutation(_0x395bfb){const _0x28c0ed=a235_0x166d90,{operation:_0x18d905,appCode:_0x3fffd8,role:_0x37ffa9,relations:_0x1ac5ba,user:_0x2f23c5}=_0x395bfb,_0x234c64=[...new Set(_0x1ac5ba[_0x28c0ed(0xa9)](_0xcf9fc0=>_0xcf9fc0[_0x28c0ed(0x89)]))],_0x1b9b33=[];if(_0x395bfb[_0x28c0ed(0xa4)]!==undefined&&_0x395bfb[_0x28c0ed(0xa4)]!==_0x234c64[_0x28c0ed(0xc8)])throw CliErrors[_0x28c0ed(0xa7)](_0x28c0ed(0x98)+_0x395bfb[_0x28c0ed(0xa4)]+_0x28c0ed(0xce)+_0x234c64[_0x28c0ed(0xc8)]+'.',_0x28c0ed(0x9c));const _0x10c6a5=_0x234c64[_0x28c0ed(0xb1)](_0x2f23c5[_0x28c0ed(0x89)]),_0x1a160c=_0x1ac5ba['filter'](_0x1be26e=>_0x1be26e[_0x28c0ed(0x89)]===_0x2f23c5[_0x28c0ed(0x89)])['map'](_0x2adbee=>_0x2adbee['id']),_0x585083=_0x18d905===_0x28c0ed(0xbd)?!_0x10c6a5:_0x10c6a5;let _0x3905d0=_0x234c64;_0x18d905===_0x28c0ed(0xbd)?_0x10c6a5?_0x1b9b33[_0x28c0ed(0xa6)](_0x28c0ed(0x91)+_0x2f23c5['userId']+_0x28c0ed(0xb2)+_0x37ffa9[_0x28c0ed(0xd9)]+';\x20no\x20change.'):_0x3905d0=[..._0x234c64,_0x2f23c5[_0x28c0ed(0x89)]]:!_0x10c6a5?_0x1b9b33[_0x28c0ed(0xa6)](_0x28c0ed(0x91)+_0x2f23c5[_0x28c0ed(0x89)]+_0x28c0ed(0xc1)+_0x37ffa9[_0x28c0ed(0xd9)]+_0x28c0ed(0xcb)):(_0x3905d0=_0x234c64[_0x28c0ed(0xb5)](_0x4af92d=>_0x4af92d!==_0x2f23c5[_0x28c0ed(0x89)]),_0x1a160c[_0x28c0ed(0xc8)]>0x1&&_0x1b9b33[_0x28c0ed(0xa6)]('Removed\x20'+_0x1a160c[_0x28c0ed(0xc8)]+_0x28c0ed(0x90)+_0x2f23c5[_0x28c0ed(0x89)]+'.'));const _0x1e53c3={'scope':_0x28c0ed(0xbb),'operation':_0x18d905,'selector':{'appCode':_0x3fffd8,'roleId':_0x37ffa9['id'],'roleName':_0x37ffa9['roleName'],'userId':_0x2f23c5[_0x28c0ed(0x89)]},'before':{'userIds':_0x234c64},'after':{'userIds':_0x3905d0},'dryRun':_0x395bfb[_0x28c0ed(0xbc)],'backend':{'method':_0x28c0ed(0xd6),'path':_0x18d905===_0x28c0ed(0xbd)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x1b9b33};return{'mutation':_0x1e53c3,'changed':_0x585083,'matchingRelationIds':_0x1a160c};}export async function loadDevRoleRelations(_0x13f877,_0x15927e){const _0x35fe7b=a235_0x166d90,_0x4c6d4d=0x64,_0x5f58b0=[];for(let _0x14b8a0=0x1;;_0x14b8a0+=0x1){const {items:_0x3ba842,paging:_0x43f0a2}=await listDevUserRoleRelations(_0x13f877,{'roleId':_0x15927e,'currentPage':_0x14b8a0,'pageSize':_0x4c6d4d});_0x5f58b0[_0x35fe7b(0xa6)](..._0x3ba842);if(_0x3ba842['length']<_0x4c6d4d||_0x43f0a2&&_0x5f58b0[_0x35fe7b(0xc8)]>=_0x43f0a2['totalCount'])return _0x5f58b0;}}export function readRoleRef(_0x580f78){const _0x3b25c4=a235_0x166d90,_0x2f4113=_0x580f78[_0x3b25c4(0xc2)](_0x3b25c4(0xca))[_0x3b25c4(0xb3)]();if(!_0x2f4113)throw CliErrors[_0x3b25c4(0xa1)](_0x3b25c4(0xca),'Pass\x20--role\x20<id|name>.');return _0x2f4113;}export async function prepareUserMutation(_0x534889,_0x124f4b,_0x2ee37a){const _0x15e6c8=a235_0x166d90,_0x12c92d=readRoleRef(_0x534889),_0x51f0f4=_0x534889[_0x15e6c8(0xc2)](_0x15e6c8(0xc6))[_0x15e6c8(0xb3)]();if(!_0x51f0f4)throw CliErrors[_0x15e6c8(0xa1)](_0x15e6c8(0xc6),_0x15e6c8(0xb6));const _0x2f025a=_0x534889[_0x15e6c8(0xd7)](_0x15e6c8(0x9f)),_0x20ea89=_0x2f025a===undefined||_0x2f025a===null?undefined:Number(_0x2f025a),_0x48fd32=await resolveRoleRef(_0x534889[_0x15e6c8(0x8e)],_0x12c92d);if(_0x48fd32['roleType']===_0x15e6c8(0xa0))throw CliErrors[_0x15e6c8(0xa7)](_0x15e6c8(0x9d)+_0x124f4b+_0x15e6c8(0xc0),_0x15e6c8(0xd3));const _0x48dc57=await resolveUserRef(_0x51f0f4),_0x2c8738=await loadDevRoleRelations(_0x534889[_0x15e6c8(0x8e)],_0x48fd32['id']);return{...computeRoleUserMutation({'operation':_0x124f4b,'appCode':_0x534889[_0x15e6c8(0x8e)],'role':_0x48fd32,'relations':_0x2c8738,'user':{'userId':_0x48dc57[_0x15e6c8(0x89)],'username':_0x48dc57[_0x15e6c8(0x9e)],'nickname':_0x48dc57[_0x15e6c8(0x96)]},'dryRun':_0x2ee37a,..._0x20ea89!==undefined?{'expectUserCount':_0x20ea89}:{}}),'role':_0x48fd32,'user':_0x48dc57};}
|
|
1
|
+
const a235_0x1446c5=a235_0x2529;(function(_0x5ab451,_0x78a6cf){const _0x223b8d=a235_0x2529,_0x4d065a=_0x5ab451();while(!![]){try{const _0x35eeed=parseInt(_0x223b8d(0x9f))/0x1*(-parseInt(_0x223b8d(0xc6))/0x2)+-parseInt(_0x223b8d(0xc1))/0x3*(parseInt(_0x223b8d(0x97))/0x4)+-parseInt(_0x223b8d(0xa5))/0x5*(-parseInt(_0x223b8d(0xba))/0x6)+parseInt(_0x223b8d(0x8c))/0x7+parseInt(_0x223b8d(0x81))/0x8+parseInt(_0x223b8d(0xa6))/0x9+parseInt(_0x223b8d(0xca))/0xa;if(_0x35eeed===_0x78a6cf)break;else _0x4d065a['push'](_0x4d065a['shift']());}catch(_0x43639a){_0x4d065a['push'](_0x4d065a['shift']());}}}(a235_0x5132,0xd0206));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_0x1446c5(0x9d),'required':!![],'description':a235_0x1446c5(0xae)};export const ROLE_REF_FLAG={'name':a235_0x1446c5(0xc9),'type':a235_0x1446c5(0xb8),'required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};export const USER_REF_FLAG={'name':a235_0x1446c5(0x7f),'type':'string','required':!![],'description':a235_0x1446c5(0x93)};function a235_0x5132(){const _0x34d7a8=['validation','Cannot\x20','flag','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','filter','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','appCode','4501424pevLEl','userId','/smartapi/permit/user-role/create','\x20is\x20not\x20a\x20member\x20of\x20role\x20','\x20is\x20already\x20a\x20member\x20of\x20role\x20','tenant','number','\x20members\x20of\x20the\x20OWNER\x20role.','141593MycGUJ','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x22\x20is\x20ambiguous\x20(ids:\x20','Disambiguate\x20with\x20--role\x20<id>.','\x20built-in\x20role\x20','remark','505ZoTGPI','5002704vontyK',';\x20no\x20change.','Role\x20id\x20','map','Multiple\x20tenant\x20members\x20match\x20\x22','roleType','test','Role\x20name\x20\x22','Role\x20id\x20(from\x20`role\x20list`)','totalCount','\x20duplicate\x20memberships\x20for\x20user\x20','\x22:\x20','str','/smartapi/permit/user-role/delete','\x20member(s)\x20but\x20role\x20has\x20','Missing\x20role\x20reference.','name','Missing\x20user\x20reference.','string','join','8754wFcLVV','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Check\x20the\x20nickname/username.\x20','\x20not\x20found\x20in\x20app\x20','nickname','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Pass\x20--user\x20<id|name>.','3CRRbCN','POST','find','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','trim','12rwocWE','Pass\x20--role\x20<id|name>.','tenant_code','role','3786430nwFUoE','ADMIN','push','dev','username','User\x20','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','user','expectUserCount','3579000RKsODX','Removed\x20','includes','flagMissing','OWNER','length','Pass\x20--user\x20<id>.','toLowerCase','userCount','Role\x20name','CUSTOM','9087169pNUIQI','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','user-add','roleName'];a235_0x5132=function(){return _0x34d7a8;};return a235_0x5132();}export const NAME_FLAG={'name':a235_0x1446c5(0xb6),'type':a235_0x1446c5(0xb8),'required':!![],'description':a235_0x1446c5(0x8a)};export const USER_NAME_FLAG={'name':a235_0x1446c5(0xb6),'type':a235_0x1446c5(0xb8),'required':!![],'description':a235_0x1446c5(0x95)};export const REMARK_FLAG={'name':'remark','type':a235_0x1446c5(0xb8),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a235_0x1446c5(0x9d),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a235_0x1446c5(0x79),'DEV','OWNER'];export function isBuiltinRole(_0x1fde32){return BUILTIN_ROLE_TYPES['includes'](_0x1fde32);}export function assertCustomRole(_0x4f4d3f,_0x296503){const _0x537327=a235_0x1446c5;if(_0x4f4d3f[_0x537327(0xab)]!==_0x537327(0x8b))throw CliErrors[_0x537327(0x90)](_0x537327(0x91)+_0x296503+_0x537327(0xa3)+_0x4f4d3f[_0x537327(0x8f)]+'\x20('+_0x4f4d3f[_0x537327(0xab)]+').',_0x537327(0x7e));}export function projectRole(_0x3ecdea){const _0x802293=a235_0x1446c5;return{'id':_0x3ecdea['id'],'roleName':_0x3ecdea['roleName'],'roleType':_0x3ecdea[_0x802293(0xab)],'remark':_0x3ecdea[_0x802293(0xa4)],'userCount':_0x3ecdea[_0x802293(0x89)],'permitCount':_0x3ecdea['permitCount'],'builtin':isBuiltinRole(_0x3ecdea[_0x802293(0xab)])};}function a235_0x2529(_0x4271ac,_0x211d51){_0x4271ac=_0x4271ac-0x79;const _0x513288=a235_0x5132();let _0x25291b=_0x513288[_0x4271ac];return _0x25291b;}export async function resolveRoleRef(_0x1ec2d5,_0x23d10c){const _0x265e86=a235_0x1446c5,_0x4d1a89=_0x23d10c['trim']();if(!_0x4d1a89)throw CliErrors[_0x265e86(0x90)](_0x265e86(0xb5),_0x265e86(0xc7));if(/^\d+$/[_0x265e86(0xac)](_0x4d1a89))return getRoleById(_0x1ec2d5,Number(_0x4d1a89));const _0x33c1e4=await listAllAppRoles(_0x1ec2d5),_0x3fd91d=_0x33c1e4[_0x265e86(0x94)](_0x49ee13=>_0x49ee13['roleName']===_0x4d1a89);if(_0x3fd91d[_0x265e86(0x86)]===0x0)throw CliErrors[_0x265e86(0x90)](_0x265e86(0xad)+_0x4d1a89+'\x22\x20not\x20found\x20in\x20app\x20'+_0x1ec2d5+'.',_0x265e86(0x8d));if(_0x3fd91d['length']>0x1){const _0x1f63d5=_0x3fd91d[_0x265e86(0xa9)](_0x476300=>_0x476300['id'])[_0x265e86(0xb9)](',\x20');throw CliErrors[_0x265e86(0x90)](_0x265e86(0xad)+_0x4d1a89+_0x265e86(0xa1)+_0x1f63d5+').',_0x265e86(0xa2));}return _0x3fd91d[0x0];}export async function getRoleById(_0x367f19,_0x4246fd){const _0x2a60bb=a235_0x1446c5,_0x561a34=await listAllAppRoles(_0x367f19),_0x76e97c=_0x561a34[_0x2a60bb(0x94)](_0x3e0872=>_0x3e0872['id']===_0x4246fd&&(!_0x3e0872[_0x2a60bb(0x96)]||_0x3e0872['appCode']===_0x367f19));if(_0x76e97c[_0x2a60bb(0x86)]!==0x1)throw CliErrors[_0x2a60bb(0x90)](_0x2a60bb(0xa8)+_0x4246fd+_0x2a60bb(0xbd)+_0x367f19+'.',_0x2a60bb(0xbb));return _0x76e97c[0x0];}async function listAllAppRoles(_0x8b8609){const _0x45f606=a235_0x1446c5,_0x54b684=0x64,_0x18c853=[];for(let _0x4187e0=0x1;;_0x4187e0+=0x1){const {items:_0x42b065,paging:_0x3d5ea2}=await listAppRoles(_0x8b8609,{'currentPage':_0x4187e0,'pageSize':_0x54b684});_0x18c853[_0x45f606(0x7a)](..._0x42b065);if(_0x42b065[_0x45f606(0x86)]<_0x54b684||_0x3d5ea2&&_0x18c853['length']>=_0x3d5ea2[_0x45f606(0xaf)])return _0x18c853;}}export async function resolveTenantCode(){const _0x742e8d=a235_0x1446c5,_0x55083a=await getSessionUserInfo(),_0x5ce7ae=_0x55083a?.[_0x742e8d(0x7f)]?.[_0x742e8d(0x9c)]?.[_0x742e8d(0xc8)];if(!_0x5ce7ae)throw CliErrors['authRequired'](_0x742e8d(0xc4));return _0x5ce7ae;}function matchMember(_0x22e12b,_0x160dc6){const _0x35cc21=a235_0x1446c5,_0x5cfd26=_0x160dc6['trim']()[_0x35cc21(0x88)]();return(_0x22e12b['nickname']??'')['toLowerCase']()===_0x5cfd26||(_0x22e12b[_0x35cc21(0x7c)]??'')[_0x35cc21(0x88)]()===_0x5cfd26;}export async function resolveUserRef(_0x18cc04,_0x55d692=a235_0x1446c5(0x87)){const _0x56c32f=a235_0x1446c5,_0x30f62c=_0x18cc04['trim']();if(!_0x30f62c)throw CliErrors[_0x56c32f(0x90)](_0x56c32f(0xb7),_0x56c32f(0xc0));const _0x38a718=await resolveTenantCode(),_0x508bf0=await getTenantMembers(_0x38a718);if(/^\d+$/['test'](_0x30f62c)){const _0xa540e5=Number(_0x30f62c),_0x2f6115=_0x508bf0[_0x56c32f(0xc3)](_0x31a5ea=>_0x31a5ea['userId']===_0xa540e5);return{'userId':_0xa540e5,'username':_0x2f6115?.[_0x56c32f(0x7c)]??String(_0xa540e5),'nickname':_0x2f6115?.[_0x56c32f(0xbe)],'matchedBy':'id'};}const _0xc4490d=_0x508bf0['filter'](_0x3f7202=>matchMember(_0x3f7202,_0x30f62c));if(_0xc4490d[_0x56c32f(0x86)]===0x0)throw CliErrors[_0x56c32f(0x90)]('No\x20tenant\x20member\x20matches\x20\x22'+_0x30f62c+'\x22.',_0x56c32f(0xbc)+_0x55d692);if(_0xc4490d[_0x56c32f(0x86)]>0x1){const _0x3c6c63=_0xc4490d[_0x56c32f(0xa9)](_0x3c9625=>(_0x3c9625[_0x56c32f(0xbe)]??_0x3c9625['username']??'?')+'('+_0x3c9625[_0x56c32f(0x98)]+')')[_0x56c32f(0xb9)](',\x20');throw CliErrors[_0x56c32f(0x90)](_0x56c32f(0xaa)+_0x30f62c+_0x56c32f(0xb1)+_0x3c6c63+'.',_0x55d692);}const _0x139381=_0xc4490d[0x0];return{'userId':_0x139381[_0x56c32f(0x98)],'username':_0x139381[_0x56c32f(0x7c)]??String(_0x139381['userId']),'nickname':_0x139381[_0x56c32f(0xbe)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a235_0x1446c5(0x99);export const DELETE_USER_ROLE_PATH=a235_0x1446c5(0xb3);export function computeRoleUserMutation(_0x47c654){const _0x5b6cfc=a235_0x1446c5,{operation:_0x2289f2,appCode:_0x533262,role:_0x422678,relations:_0x19da78,user:_0x4cfb70}=_0x47c654,_0x2a16bd=[...new Set(_0x19da78['map'](_0x5e5e05=>_0x5e5e05[_0x5b6cfc(0x98)]))],_0x1f0423=[];if(_0x47c654[_0x5b6cfc(0x80)]!==undefined&&_0x47c654[_0x5b6cfc(0x80)]!==_0x2a16bd['length'])throw CliErrors[_0x5b6cfc(0x90)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x47c654[_0x5b6cfc(0x80)]+_0x5b6cfc(0xb4)+_0x2a16bd[_0x5b6cfc(0x86)]+'.',_0x5b6cfc(0xa0));const _0x27b866=_0x2a16bd[_0x5b6cfc(0x83)](_0x4cfb70[_0x5b6cfc(0x98)]),_0xb0efe6=_0x19da78['filter'](_0x458ec6=>_0x458ec6[_0x5b6cfc(0x98)]===_0x4cfb70[_0x5b6cfc(0x98)])['map'](_0x2279ae=>_0x2279ae['id']),_0xc79e0b=_0x2289f2===_0x5b6cfc(0x8e)?!_0x27b866:_0x27b866;let _0x2d067e=_0x2a16bd;_0x2289f2==='user-add'?_0x27b866?_0x1f0423[_0x5b6cfc(0x7a)](_0x5b6cfc(0x7d)+_0x4cfb70[_0x5b6cfc(0x98)]+_0x5b6cfc(0x9b)+_0x422678[_0x5b6cfc(0x8f)]+_0x5b6cfc(0xa7)):_0x2d067e=[..._0x2a16bd,_0x4cfb70['userId']]:!_0x27b866?_0x1f0423[_0x5b6cfc(0x7a)](_0x5b6cfc(0x7d)+_0x4cfb70[_0x5b6cfc(0x98)]+_0x5b6cfc(0x9a)+_0x422678[_0x5b6cfc(0x8f)]+_0x5b6cfc(0xa7)):(_0x2d067e=_0x2a16bd['filter'](_0x3f0c6e=>_0x3f0c6e!==_0x4cfb70['userId']),_0xb0efe6[_0x5b6cfc(0x86)]>0x1&&_0x1f0423['push'](_0x5b6cfc(0x82)+_0xb0efe6[_0x5b6cfc(0x86)]+_0x5b6cfc(0xb0)+_0x4cfb70[_0x5b6cfc(0x98)]+'.'));const _0x4ad5c3={'scope':_0x5b6cfc(0x7b),'operation':_0x2289f2,'selector':{'appCode':_0x533262,'roleId':_0x422678['id'],'roleName':_0x422678[_0x5b6cfc(0x8f)],'userId':_0x4cfb70[_0x5b6cfc(0x98)]},'before':{'userIds':_0x2a16bd},'after':{'userIds':_0x2d067e},'dryRun':_0x47c654['dryRun'],'backend':{'method':_0x5b6cfc(0xc2),'path':_0x2289f2===_0x5b6cfc(0x8e)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x1f0423};return{'mutation':_0x4ad5c3,'changed':_0xc79e0b,'matchingRelationIds':_0xb0efe6};}export async function loadDevRoleRelations(_0xff7f32,_0x5cec9e){const _0x97f22b=a235_0x1446c5,_0x839798=0x64,_0x927835=[];for(let _0x1a6cfd=0x1;;_0x1a6cfd+=0x1){const {items:_0x333af8,paging:_0x14b711}=await listDevUserRoleRelations(_0xff7f32,{'roleId':_0x5cec9e,'currentPage':_0x1a6cfd,'pageSize':_0x839798});_0x927835['push'](..._0x333af8);if(_0x333af8[_0x97f22b(0x86)]<_0x839798||_0x14b711&&_0x927835[_0x97f22b(0x86)]>=_0x14b711[_0x97f22b(0xaf)])return _0x927835;}}export function readRoleRef(_0xdb7d1d){const _0x1fc5b1=a235_0x1446c5,_0x53208e=_0xdb7d1d[_0x1fc5b1(0xb2)](_0x1fc5b1(0xc9))[_0x1fc5b1(0xc5)]();if(!_0x53208e)throw CliErrors['flagMissing']('role',_0x1fc5b1(0xc7));return _0x53208e;}export async function prepareUserMutation(_0x272ba6,_0x703ffd,_0xba954c){const _0x3b4132=a235_0x1446c5,_0x524276=readRoleRef(_0x272ba6),_0x52fb6d=_0x272ba6[_0x3b4132(0xb2)](_0x3b4132(0x7f))['trim']();if(!_0x52fb6d)throw CliErrors[_0x3b4132(0x84)](_0x3b4132(0x7f),_0x3b4132(0xc0));const _0x471ea8=_0x272ba6[_0x3b4132(0x92)]('expect-user-count'),_0x408618=_0x471ea8===undefined||_0x471ea8===null?undefined:Number(_0x471ea8),_0x5cf2a2=await resolveRoleRef(_0x272ba6[_0x3b4132(0x96)],_0x524276);if(_0x5cf2a2['roleType']===_0x3b4132(0x85))throw CliErrors['validation'](_0x3b4132(0x91)+_0x703ffd+_0x3b4132(0x9e),_0x3b4132(0xbf));const _0xc982f7=await resolveUserRef(_0x52fb6d),_0x4426c8=await loadDevRoleRelations(_0x272ba6[_0x3b4132(0x96)],_0x5cf2a2['id']);return{...computeRoleUserMutation({'operation':_0x703ffd,'appCode':_0x272ba6[_0x3b4132(0x96)],'role':_0x5cf2a2,'relations':_0x4426c8,'user':{'userId':_0xc982f7[_0x3b4132(0x98)],'username':_0xc982f7['username'],'nickname':_0xc982f7[_0x3b4132(0xbe)]},'dryRun':_0xba954c,..._0x408618!==undefined?{'expectUserCount':_0x408618}:{}}),'role':_0x5cf2a2,'user':_0xc982f7};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a236_0x505347=a236_0x3c2c;(function(_0x2ccc14,_0x13130d){const _0x56ba6f=a236_0x3c2c,_0x16668a=_0x2ccc14();while(!![]){try{const _0x4ccce5=parseInt(_0x56ba6f(0x10d))/0x1+parseInt(_0x56ba6f(0x107))/0x2*(parseInt(_0x56ba6f(0x10c))/0x3)+parseInt(_0x56ba6f(0x121))/0x4*(-parseInt(_0x56ba6f(0x104))/0x5)+-parseInt(_0x56ba6f(0x11d))/0x6+parseInt(_0x56ba6f(0x113))/0x7+-parseInt(_0x56ba6f(0x116))/0x8+parseInt(_0x56ba6f(0x11e))/0x9;if(_0x4ccce5===_0x13130d)break;else _0x16668a['push'](_0x16668a['shift']());}catch(_0x19158c){_0x16668a['push'](_0x16668a['shift']());}}}(a236_0x5783,0x722bb));function a236_0x5783(){const _0x3dbcd1=['write','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','13284oSkPFx','num','105IpIhcV','--name\x20cannot\x20be\x20empty.','\x20(id=','412usORdf','POST','validation','flag','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','9HJShSr','323783eTMFIN','Updated\x20role\x20','trim','remark','role','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','6056491QpORwW','name','New\x20role\x20name','5297704ITMRbo','appCode','length','roleName','dev','update','string','1995204xRcQGo','3082653kMawjo'];a236_0x5783=function(){return _0x3dbcd1;};return a236_0x5783();}import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a236_0x3c2c(_0x12201f,_0x1e2af4){_0x12201f=_0x12201f-0x104;const _0x5783d5=a236_0x5783();let _0x3c2c73=_0x5783d5[_0x12201f];return _0x3c2c73;}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='/smartapi/permit/role/update';function readPatch(_0x5a5b0a){const _0x5efe7e=a236_0x3c2c,_0x1d2d74=_0x5a5b0a[_0x5efe7e(0x10a)](_0x5efe7e(0x114)),_0x5bba28=_0x5a5b0a[_0x5efe7e(0x10a)](_0x5efe7e(0x110)),_0x2e112d={};if(_0x1d2d74!==undefined&&_0x1d2d74!==null){const _0x2d386d=String(_0x1d2d74)[_0x5efe7e(0x10f)]();if(!_0x2d386d)throw CliErrors[_0x5efe7e(0x109)](_0x5efe7e(0x105));if(_0x2d386d[_0x5efe7e(0x118)]>0x40)throw CliErrors[_0x5efe7e(0x109)](_0x5efe7e(0x120));_0x2e112d['roleName']=_0x2d386d;}_0x5bba28!==undefined&&_0x5bba28!==null&&(_0x2e112d[_0x5efe7e(0x110)]=String(_0x5bba28));if(_0x2e112d[_0x5efe7e(0x119)]===undefined&&_0x2e112d[_0x5efe7e(0x110)]===undefined)throw CliErrors[_0x5efe7e(0x109)]('Nothing\x20to\x20update.',_0x5efe7e(0x10b));return _0x2e112d;}export const roleUpdate={'service':a236_0x505347(0x111),'command':a236_0x505347(0x11b),'description':a236_0x505347(0x112),'risk':a236_0x505347(0x11f),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0x505347(0x114),'type':a236_0x505347(0x11c),'required':![],'description':a236_0x505347(0x115)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3dca5a){readPatch(_0x3dca5a);},async 'dryRun'(_0x4f682d){const _0x16745a=a236_0x505347,_0x289c5e=_0x4f682d[_0x16745a(0x122)]('id'),_0x279118=readPatch(_0x4f682d),_0x5eaec0=await getRoleById(_0x4f682d[_0x16745a(0x117)],_0x289c5e);return assertCustomRole(_0x5eaec0,'update'),asDryRunResult({'scope':_0x16745a(0x11a),'operation':_0x16745a(0x11b),'selector':{'appCode':_0x4f682d[_0x16745a(0x117)],'roleId':_0x289c5e,'roleName':_0x5eaec0[_0x16745a(0x119)]},'before':projectRole(_0x5eaec0),'after':projectRole({..._0x5eaec0,..._0x279118[_0x16745a(0x119)]!==undefined?{'roleName':_0x279118[_0x16745a(0x119)]}:{},..._0x279118[_0x16745a(0x110)]!==undefined?{'remark':_0x279118[_0x16745a(0x110)]}:{}}),'dryRun':!![],'backend':{'method':_0x16745a(0x108),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x29d6ca){const _0x32c302=a236_0x505347,_0x1d2392=_0x29d6ca['num']('id'),_0x11224f=readPatch(_0x29d6ca),_0x6e165a=await getRoleById(_0x29d6ca['appCode'],_0x1d2392);assertCustomRole(_0x6e165a,_0x32c302(0x11b)),await updateAppRole({'id':_0x1d2392,'appCode':_0x29d6ca[_0x32c302(0x117)],..._0x11224f[_0x32c302(0x119)]!==undefined?{'roleName':_0x11224f[_0x32c302(0x119)]}:{},..._0x11224f['remark']!==undefined?{'remark':_0x11224f['remark']}:{}});const _0x1b8d37=await getRoleById(_0x29d6ca[_0x32c302(0x117)],_0x1d2392);return{'ok':!![],'data':{'scope':_0x32c302(0x11a),'operation':_0x32c302(0x11b),'selector':{'appCode':_0x29d6ca['appCode'],'roleId':_0x1d2392,'roleName':_0x1b8d37[_0x32c302(0x119)]},'before':projectRole(_0x6e165a),'after':projectRole(_0x1b8d37),'dryRun':![],'backend':{'method':_0x32c302(0x108),'path':UPDATE_PATH},'warnings':[]},'message':_0x32c302(0x10e)+_0x1b8d37[_0x32c302(0x119)]+_0x32c302(0x106)+_0x1d2392+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a237_0x8081(){const _0xca8ba6=['15BGfsPH','No\x20change:\x20user\x20','4174570GVUUUb','appCode','POST','Added\x20user\x20','roleType','119308qfmyoQ','roleId','12259872lPmYqP','4195758WUYfeO','high-risk-write','3497NCPrGl','selector','\x20to\x20role\x20','1354566pfwyZr','5923400BEeeWD','46tDZvfw','userId'];a237_0x8081=function(){return _0xca8ba6;};return a237_0x8081();}const a237_0x1b67de=a237_0x1925;(function(_0xc40466,_0x51789c){const _0x503272=a237_0x1925,_0x3551f0=_0xc40466();while(!![]){try{const _0x25e115=-parseInt(_0x503272(0x1d2))/0x1*(parseInt(_0x503272(0x1d7))/0x2)+parseInt(_0x503272(0x1d9))/0x3*(parseInt(_0x503272(0x1cd))/0x4)+-parseInt(_0x503272(0x1db))/0x5+-parseInt(_0x503272(0x1d5))/0x6+-parseInt(_0x503272(0x1d0))/0x7+parseInt(_0x503272(0x1d6))/0x8+parseInt(_0x503272(0x1cf))/0x9;if(_0x25e115===_0x51789c)break;else _0x3551f0['push'](_0x3551f0['shift']());}catch(_0x11f960){_0x3551f0['push'](_0x3551f0['shift']());}}}(a237_0x8081,0x7cd24));import{createDevUserRole}from'../../core/api-client.js';function a237_0x1925(_0x3addfd,_0x4306f2){_0x3addfd=_0x3addfd-0x1cd;const _0x808195=a237_0x8081();let _0x1925ed=_0x808195[_0x3addfd];return _0x1925ed;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':'role','command':'user-add','description':'Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a237_0x1b67de(0x1d1),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1ec930){const _0x5cbe7d=a237_0x1b67de,{mutation:_0x59dc64}=await prepareUserMutation(_0x1ec930,'user-add',!![]);return asDryRunResult(_0x59dc64,{'method':_0x5cbe7d(0x1dd),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x2b4db5){const _0xacc1a9=a237_0x1b67de,{mutation:_0xb124a9,changed:_0x48665d,role:_0x17dde2,user:_0x1fb5d4}=await prepareUserMutation(_0x2b4db5,'user-add',![]);return _0x48665d&&await createDevUserRole({'appCode':_0x2b4db5[_0xacc1a9(0x1dc)],'userId':_0x1fb5d4[_0xacc1a9(0x1d8)],'username':_0x1fb5d4['username'],'roleType':_0x17dde2[_0xacc1a9(0x1df)],'roleId':_0xb124a9[_0xacc1a9(0x1d3)][_0xacc1a9(0x1ce)]}),{'ok':!![],'data':_0xb124a9,'message':_0x48665d?_0xacc1a9(0x1de)+_0xb124a9['selector'][_0xacc1a9(0x1d8)]+_0xacc1a9(0x1d4)+_0xb124a9['selector']['roleName']:_0xacc1a9(0x1da)+_0xb124a9['selector'][_0xacc1a9(0x1d8)]+'\x20already\x20in\x20role\x20'+_0xb124a9[_0xacc1a9(0x1d3)]['roleName']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a238_0x29ad(_0xd1d6d3,_0x190df6){_0xd1d6d3=_0xd1d6d3-0x176;const _0x4d791b=a238_0x4d79();let _0x29ad16=_0x4d791b[_0xd1d6d3];return _0x29ad16;}const a238_0xa7a319=a238_0x29ad;(function(_0x536613,_0x3aea93){const _0x45053c=a238_0x29ad,_0x418465=_0x536613();while(!![]){try{const _0x158efe=-parseInt(_0x45053c(0x17e))/0x1+parseInt(_0x45053c(0x18a))/0x2*(parseInt(_0x45053c(0x17a))/0x3)+-parseInt(_0x45053c(0x17c))/0x4+-parseInt(_0x45053c(0x17f))/0x5+-parseInt(_0x45053c(0x17b))/0x6+parseInt(_0x45053c(0x181))/0x7*(parseInt(_0x45053c(0x182))/0x8)+parseInt(_0x45053c(0x17d))/0x9;if(_0x158efe===_0x3aea93)break;else _0x418465['push'](_0x418465['shift']());}catch(_0x224ad5){_0x418465['push'](_0x418465['shift']());}}}(a238_0x4d79,0x1d774));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';export const roleUserRemove={'service':a238_0xa7a319(0x189),'command':a238_0xa7a319(0x185),'description':a238_0xa7a319(0x188),'risk':a238_0xa7a319(0x180),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x25aa0b){const _0x2230a8=a238_0xa7a319,{mutation:_0x280ac4}=await prepareUserMutation(_0x25aa0b,'user-remove',!![]);return asDryRunResult(_0x280ac4,{'method':_0x2230a8(0x186),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x5189e6){const _0x3f2e60=a238_0xa7a319,{matchingRelationIds:_0x4ecc2d,mutation:_0x36196e,changed:_0x36733b}=await prepareUserMutation(_0x5189e6,'user-remove',![]);if(_0x36733b)for(const _0x1e84cd of _0x4ecc2d){await deleteDevUserRole(_0x1e84cd);}return{'ok':!![],'data':_0x36196e,'message':_0x36733b?_0x3f2e60(0x176)+_0x36196e[_0x3f2e60(0x179)][_0x3f2e60(0x183)]+_0x3f2e60(0x187)+_0x36196e['selector'][_0x3f2e60(0x184)]:_0x3f2e60(0x177)+_0x36196e[_0x3f2e60(0x179)][_0x3f2e60(0x183)]+_0x3f2e60(0x178)+_0x36196e[_0x3f2e60(0x179)]['roleName']};}};function a238_0x4d79(){const _0x3809cc=['9728btVabk','1382508lKCJZO','142783fvSsfP','336000dBNYIB','high-risk-write','240590hCBmNA','8cJbyFS','userId','roleName','user-remove','POST','\x20from\x20role\x20','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','role','339928WwYgvU','Removed\x20user\x20','No\x20change:\x20user\x20','\x20not\x20in\x20role\x20','selector','3XJybze','149034BtUMZk'];a238_0x4d79=function(){return _0x3809cc;};return a238_0x4d79();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a239_0x5e9c(_0x3bb868,_0x2f99e5){_0x3bb868=_0x3bb868-0xfb;const _0x3b15af=a239_0x3b15();let _0x5e9c38=_0x3b15af[_0x3bb868];return _0x5e9c38;}const a239_0x1edc7f=a239_0x5e9c;(function(_0x4fb4cf,_0x2feb01){const _0x539050=a239_0x5e9c,_0x267676=_0x4fb4cf();while(!![]){try{const _0x377655=parseInt(_0x539050(0x106))/0x1+-parseInt(_0x539050(0xff))/0x2+parseInt(_0x539050(0x101))/0x3+-parseInt(_0x539050(0xfb))/0x4*(-parseInt(_0x539050(0x103))/0x5)+parseInt(_0x539050(0x107))/0x6+parseInt(_0x539050(0xfd))/0x7+-parseInt(_0x539050(0xfc))/0x8;if(_0x377655===_0x2feb01)break;else _0x267676['push'](_0x267676['shift']());}catch(_0x40064c){_0x267676['push'](_0x267676['shift']());}}}(a239_0x3b15,0xaaecf));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a239_0x3b15(){const _0x15fe88=['name','userId','nickname','username','1645468msqAxS','12063984IPoKAg','7121121ibXhlT','role','2248704WizyOz','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','839880yCHicg','Pass\x20--name\x20<nickname|username>.','5kKAFCT','read','trim','997290hSkctc','3759246OTFclr'];a239_0x3b15=function(){return _0x15fe88;};return a239_0x3b15();}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a239_0x1edc7f(0xfe),'command':'user-resolve','description':a239_0x1edc7f(0x100),'risk':a239_0x1edc7f(0x104),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x17eae9){const _0x26382a=a239_0x1edc7f;if(!_0x17eae9['str'](_0x26382a(0x108))[_0x26382a(0x105)]())throw CliErrors['flagMissing'](_0x26382a(0x108),_0x26382a(0x102));},async 'execute'(_0x4bf0e3){const _0x4f9f76=a239_0x1edc7f,_0x393838=_0x4bf0e3['str']('name')[_0x4f9f76(0x105)](),_0xa8165a=await resolveUserRef(_0x393838,'Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.');return{'ok':!![],'data':{'user':{'userId':_0xa8165a[_0x4f9f76(0x109)],'username':_0xa8165a[_0x4f9f76(0x10b)],'nickname':_0xa8165a[_0x4f9f76(0x10a)],'matchedBy':_0xa8165a['matchedBy']}},'message':'Resolved\x20\x22'+_0x393838+'\x22\x20→\x20userId\x20'+_0xa8165a[_0x4f9f76(0x109)]};}};
|
package/lib/commands/rule/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a240_0x5cadfa=a240_0x48eb;(function(_0x1550a2,_0x1f9eb9){const _0x1ce151=a240_0x48eb,_0x4637e5=_0x1550a2();while(!![]){try{const _0x180485=-parseInt(_0x1ce151(0xca))/0x1+parseInt(_0x1ce151(0xd7))/0x2*(-parseInt(_0x1ce151(0xd5))/0x3)+-parseInt(_0x1ce151(0xc9))/0x4*(parseInt(_0x1ce151(0xdc))/0x5)+-parseInt(_0x1ce151(0xcc))/0x6*(-parseInt(_0x1ce151(0xd1))/0x7)+parseInt(_0x1ce151(0xd4))/0x8+parseInt(_0x1ce151(0xcb))/0x9*(-parseInt(_0x1ce151(0xd0))/0xa)+parseInt(_0x1ce151(0xd9))/0xb;if(_0x180485===_0x1f9eb9)break;else _0x4637e5['push'](_0x4637e5['shift']());}catch(_0x2276e0){_0x4637e5['push'](_0x4637e5['shift']());}}}(a240_0x1433,0x2eb12));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';function a240_0x48eb(_0x1b949a,_0x1e9b98){_0x1b949a=_0x1b949a-0xc8;const _0x1433df=a240_0x1433();let _0x48eb45=_0x1433df[_0x1b949a];return _0x48eb45;}export const ruleGet={'service':a240_0x5cadfa(0xdd),'command':a240_0x5cadfa(0xc8),'description':'Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','risk':a240_0x5cadfa(0xdb),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x5a5782){readAppRuleType(_0x5a5782);},async 'execute'(_0x3f791b){const _0x106620=a240_0x5cadfa,_0x8aff02=readAppRuleType(_0x3f791b),_0x562e10=await getAppRule(_0x3f791b[_0x106620(0xda)],{'appCode':_0x3f791b[_0x106620(0xd6)],'type':_0x8aff02});if(!_0x562e10)throw appRuleError('app_rule_not_found',appRuleFileName(_0x8aff02)+_0x106620(0xcd)+_0x3f791b[_0x106620(0xd6)]+'.',_0x106620(0xd2)+_0x8aff02+_0x106620(0xd8));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x8aff02,_0x562e10),'content':_0x562e10[_0x106620(0xd3)]}},'message':_0x106620(0xcf)+appRuleFileName(_0x8aff02)+_0x106620(0xce)+_0x3f791b[_0x106620(0xd6)]};}};function a240_0x1433(){const _0x4be2af=['rule','get','387716PBDRZj','186872yjEwso','47943CvjBCz','6JtHZsv','\x20is\x20not\x20configured\x20for\x20app\x20','\x20for\x20','Loaded\x20','430ZlQTgP','2340709DvmKas','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','content','742296UZGMik','243pvrIjl','appCode','4298ztXlaR','\x20--file\x20<path>\x20--dry-run`.','4961077aomjAb','cookie','read','5rMHLtH'];a240_0x1433=function(){return _0x4be2af;};return a240_0x1433();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a241_0x5adc(){const _0xcde255=['123519pDkvam','dryRun','990465TmuvJf','8iQluMO','2393046GpnxCB','379088UZOeCO','execute','150602coJvbz','696857LgMkIT','map','6XyOLTl','signal','11ZbJhnr','4rDKJGY','238860pBNbJL'];a241_0x5adc=function(){return _0xcde255;};return a241_0x5adc();}const a241_0x4ce8ae=a241_0x483c;(function(_0x1589f8,_0x329617){const _0x341316=a241_0x483c,_0x61baa9=_0x1589f8();while(!![]){try{const _0x289345=-parseInt(_0x341316(0x1f5))/0x1+parseInt(_0x341316(0x1f7))/0x2+parseInt(_0x341316(0x1f0))/0x3*(-parseInt(_0x341316(0x1ee))/0x4)+parseInt(_0x341316(0x1f2))/0x5+-parseInt(_0x341316(0x1fa))/0x6*(-parseInt(_0x341316(0x1f8))/0x7)+parseInt(_0x341316(0x1f3))/0x8*(parseInt(_0x341316(0x1f4))/0x9)+-parseInt(_0x341316(0x1ef))/0xa*(parseInt(_0x341316(0x1fc))/0xb);if(_0x289345===_0x329617)break;else _0x61baa9['push'](_0x61baa9['shift']());}catch(_0x42f69c){_0x61baa9['push'](_0x61baa9['shift']());}}}(a241_0x5adc,0x2f884));import{withKbManagementSession}from'../../core/kb-management-client.js';import{ruleGet}from'../../commands/rule/get.js';function a241_0x483c(_0x348730,_0x5ab5b9){_0x348730=_0x348730-0x1ee;const _0x5adce4=a241_0x5adc();let _0x483ca2=_0x5adce4[_0x348730];return _0x483ca2;}import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet][a241_0x4ce8ae(0x1f9)](_0x144f1c=>({..._0x144f1c,'execute':_0x18da17=>withKbManagementSession(_0x18da17[a241_0x4ce8ae(0x1fb)],()=>_0x144f1c[a241_0x4ce8ae(0x1f6)](_0x18da17)),..._0x144f1c['dryRun']?{'dryRun':_0x32fc0e=>withKbManagementSession(_0x32fc0e[a241_0x4ce8ae(0x1fb)],()=>_0x144f1c[a241_0x4ce8ae(0x1f1)](_0x32fc0e))}:{}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a242_0x911f55=a242_0x23f0;(function(_0xc780d0,_0x5e43c0){const _0x34edfd=a242_0x23f0,_0x34478c=_0xc780d0();while(!![]){try{const _0x96a9b7=-parseInt(_0x34edfd(0x107))/0x1*(-parseInt(_0x34edfd(0x10f))/0x2)+-parseInt(_0x34edfd(0x115))/0x3*(parseInt(_0x34edfd(0x106))/0x4)+-parseInt(_0x34edfd(0x111))/0x5*(parseInt(_0x34edfd(0x110))/0x6)+parseInt(_0x34edfd(0x10b))/0x7*(parseInt(_0x34edfd(0x117))/0x8)+parseInt(_0x34edfd(0x108))/0x9+-parseInt(_0x34edfd(0x114))/0xa+parseInt(_0x34edfd(0x116))/0xb;if(_0x96a9b7===_0x5e43c0)break;else _0x34478c['push'](_0x34478c['shift']());}catch(_0x331b8c){_0x34478c['push'](_0x34478c['shift']());}}}(a242_0x28ad,0xea86e));function a242_0x28ad(){const _0x59d57d=['Loaded\x20app\x20rule\x20configuration\x20for\x20','4stmRWB','1EOSVFg','3040452NoOClx','cookie','appCode','7WBBMmq','list','read','all','3023174TvCVky','930MrHcMc','895Vbedpr','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','length','9206160osqXoa','3756093FbhGuT','12075294YrMcpW','1710760tIEDPR'];a242_0x28ad=function(){return _0x59d57d;};return a242_0x28ad();}function a242_0x23f0(_0x5649df,_0x347e18){_0x5649df=_0x5649df-0x106;const _0x28ad1c=a242_0x28ad();let _0x23f070=_0x28ad1c[_0x5649df];return _0x23f070;}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':'rule','command':a242_0x911f55(0x10c),'description':a242_0x911f55(0x112),'risk':a242_0x911f55(0x10d),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0xc61db8){const _0x55ed74=a242_0x911f55,_0x2404fe=await Promise[_0x55ed74(0x10e)](APP_RULE_TYPES['map'](_0x393b9a=>getAppRule(_0xc61db8[_0x55ed74(0x109)],{'appCode':_0xc61db8[_0x55ed74(0x10a)],'type':_0x393b9a}))),_0x284cfd=APP_RULE_TYPES['map']((_0x13d624,_0x1e33d9)=>projectAppRule(_0x13d624,_0x2404fe[_0x1e33d9]??null));return{'ok':!![],'data':{'total':_0x284cfd[_0x55ed74(0x113)],'rules':_0x284cfd},'message':_0x55ed74(0x118)+_0xc61db8['appCode']};}};
|
package/lib/commands/rule/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a243_0x4c1c(){const _0x207ae0=['Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','file','expected-version','12zWghQS','app_rule_verification_failed','cookie',';\x20current\x20version\x20is\x20','\x20version\x20changed\x20before\x20write.','flag','460884IlTMRY','POST','before','The\x20set\x20request\x20was\x20sent,\x20but\x20','DATABASE','5825865GBQfAO','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','unconfigured','create','type','version','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','set','defineProperty','716588StjGsB','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','rabetbase\x20rule\x20get\x20--type\x20','--file\x20is\x20required.','replacement','app_rule_set_outcome_unknown','app_rule_content_too_large','trim','2OkxlEu','app_rule_verification_unavailable','expectedVersion','\x20could\x20not\x20be\x20verified.','contentHash','string','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','write','input','19481LVqBhP','isSafeInteger','update','appCode','beforeRecord','verified','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','28EdLxjK','byteSize','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','18228wJvbZm','content','1685994qLvUrk','13350490liLoCI','RULES','9431472LMqvQT','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','rules','\x20for\x20','Pass\x20a\x20UTF-8\x20Markdown\x20file.','Expected\x20','app_rule_file_required','9mHtvod','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set'];a243_0x4c1c=function(){return _0x207ae0;};return a243_0x4c1c();}const a243_0x29ae8e=a243_0x484f;(function(_0x5acf1d,_0x5b9b7f){const _0x1e5724=a243_0x484f,_0x35f800=_0x5acf1d();while(!![]){try{const _0xc69b78=-parseInt(_0x1e5724(0x19d))/0x1*(-parseInt(_0x1e5724(0x1a6))/0x2)+parseInt(_0x1e5724(0x18f))/0x3*(-parseInt(_0x1e5724(0x189))/0x4)+-parseInt(_0x1e5724(0x194))/0x5+-parseInt(_0x1e5724(0x1bb))/0x6*(parseInt(_0x1e5724(0x1b6))/0x7)+-parseInt(_0x1e5724(0x1be))/0x8+-parseInt(_0x1e5724(0x184))/0x9*(-parseInt(_0x1e5724(0x1bc))/0xa)+parseInt(_0x1e5724(0x1af))/0xb*(parseInt(_0x1e5724(0x1b9))/0xc);if(_0xc69b78===_0x5b9b7f)break;else _0x35f800['push'](_0x35f800['shift']());}catch(_0x3a10a5){_0x35f800['push'](_0x35f800['shift']());}}}(a243_0x4c1c,0xc66ff));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';function readSetInput(_0x3c185f){const _0x1e825e=a243_0x484f,_0xf852d1=readAppRuleType(_0x3c185f),_0x2dea44=_0x3c185f['str'](_0x1e825e(0x187))[_0x1e825e(0x1a5)]();if(!_0x2dea44)throw appRuleError(_0x1e825e(0x183),_0x1e825e(0x1a1),_0x1e825e(0x1c2));const _0x5ae5d4=_0x3c185f[_0x1e825e(0x18e)]('expected-version');let _0x62a1dc;if(_0x5ae5d4!==undefined){_0x62a1dc=Number(_0x5ae5d4);if(!Number[_0x1e825e(0x1b0)](_0x62a1dc)||_0x62a1dc<0x0)throw appRuleError('app_rule_expected_version_invalid',_0x1e825e(0x1b8));}return{'type':_0xf852d1,'file':_0x2dea44,'expectedVersion':_0x62a1dc};}async function prepareSet(_0x51ecd0){const _0x38b423=a243_0x484f,_0x218674=readSetInput(_0x51ecd0),_0x43941c=await readAppRuleFile(_0x218674['file']);if(_0x218674[_0x38b423(0x198)]===_0x38b423(0x1c0)&&_0x43941c[_0x38b423(0x1ba)]['length']>0x7d0)throw appRuleError(_0x38b423(0x1a4),_0x38b423(0x19e));const _0x5de74a=await getAppRule(_0x51ecd0['cookie'],{'appCode':_0x51ecd0['appCode'],'type':_0x218674[_0x38b423(0x198)]});if(_0x218674[_0x38b423(0x1a8)]!==undefined&&(_0x5de74a?.[_0x38b423(0x199)]??0x0)!==_0x218674[_0x38b423(0x1a8)])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x218674[_0x38b423(0x198)])+_0x38b423(0x18d),_0x38b423(0x1c3)+_0x218674[_0x38b423(0x1a8)]+_0x38b423(0x18c)+(_0x5de74a?.[_0x38b423(0x199)]??_0x38b423(0x196))+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x218674,'replacement':_0x43941c,'beforeRecord':_0x5de74a,'before':projectAppRule(_0x218674[_0x38b423(0x198)],_0x5de74a),'planned':{'type':_0x218674['type'],'fileName':appRuleFileName(_0x218674[_0x38b423(0x198)]),'contextScope':appRuleContextScope(_0x218674[_0x38b423(0x198)]),'enabled':!![],'appCode':_0x51ecd0[_0x38b423(0x1b2)],'scope':_0x38b423(0x1c0),'contentByteSize':_0x43941c[_0x38b423(0x1b7)],'contentHash':_0x43941c[_0x38b423(0x1aa)]}};}function warningsFor(_0x47e968){return[];}function a243_0x484f(_0x4d3fe0,_0x98d6ba){_0x4d3fe0=_0x4d3fe0-0x183;const _0x4c1cf9=a243_0x4c1c();let _0x484f9c=_0x4c1cf9[_0x4d3fe0];return _0x484f9c;}export const ruleSet={'service':'rule','command':a243_0x29ae8e(0x19b),'description':a243_0x29ae8e(0x186),'risk':a243_0x29ae8e(0x1ad),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x29ae8e(0x187),'type':a243_0x29ae8e(0x1ab),'required':!![],'description':a243_0x29ae8e(0x1ac)},{'name':a243_0x29ae8e(0x188),'type':'number','required':![],'description':a243_0x29ae8e(0x185)}],async 'validate'(_0x505a81){readSetInput(_0x505a81);},async 'dryRun'(_0x241b68){const _0x146ad1=a243_0x29ae8e,_0x5aca7c=await prepareSet(_0x241b68);return asDryRunResult({'operation':_0x146ad1(0x19b),'selector':{'appCode':_0x241b68[_0x146ad1(0x1b2)],'scope':_0x146ad1(0x1c0),'type':_0x5aca7c['input'][_0x146ad1(0x198)]},'before':_0x5aca7c[_0x146ad1(0x191)],'after':_0x5aca7c['planned'],'dryRun':!![],'backend':{'method':_0x146ad1(0x190),'path':knowledgeDocumentsPath('rules',_0x5aca7c[_0x146ad1(0x1b3)]?_0x146ad1(0x1b1):_0x146ad1(0x197)),'body':{'appCode':_0x241b68[_0x146ad1(0x1b2)],..._0x5aca7c['beforeRecord']?{'id':_0x5aca7c['beforeRecord']['id']}:{},'title':_0x5aca7c[_0x146ad1(0x1ae)]['type']===_0x146ad1(0x1c0)?_0x146ad1(0x1bd):_0x146ad1(0x193),'contentHash':_0x5aca7c[_0x146ad1(0x1a2)][_0x146ad1(0x1aa)],'contentByteSize':_0x5aca7c['replacement'][_0x146ad1(0x1b7)],..._0x5aca7c[_0x146ad1(0x1b3)]?{'expectedVersion':_0x5aca7c['beforeRecord']['version']}:{}}},'warnings':warningsFor(_0x5aca7c[_0x146ad1(0x1ae)]['expectedVersion']),'verification':{'expectedVersion':_0x5aca7c[_0x146ad1(0x1b3)]?.[_0x146ad1(0x199)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x146ad1(0x1a0)+_0x5aca7c['input'][_0x146ad1(0x198)]+'\x20--format\x20compress'}},{'method':_0x146ad1(0x190),'url':knowledgeDocumentsPath(_0x146ad1(0x1c0),_0x5aca7c[_0x146ad1(0x1b3)]?_0x146ad1(0x1b1):_0x146ad1(0x197))});},async 'execute'(_0x4ede9f){const _0x26f7dc=a243_0x29ae8e,_0xbc2c2b=await prepareSet(_0x4ede9f),_0x26065f=_0xbc2c2b[_0x26f7dc(0x1b3)]===null?0x1:_0xbc2c2b[_0x26f7dc(0x1b3)]['version']+(_0xbc2c2b[_0x26f7dc(0x1b3)][_0x26f7dc(0x1ba)]===_0xbc2c2b[_0x26f7dc(0x1a2)]['content']?0x0:0x1);let _0x35a2df,_0x1400fc=![];try{_0x35a2df=await saveAppRule(_0x4ede9f['cookie'],{'appCode':_0x4ede9f[_0x26f7dc(0x1b2)],'type':_0xbc2c2b[_0x26f7dc(0x1ae)][_0x26f7dc(0x198)],'content':_0xbc2c2b[_0x26f7dc(0x1a2)][_0x26f7dc(0x1ba)],'expectedVersion':_0xbc2c2b[_0x26f7dc(0x1b3)]?.[_0x26f7dc(0x199)]??0x0,..._0xbc2c2b[_0x26f7dc(0x1b3)]?{'id':_0xbc2c2b[_0x26f7dc(0x1b3)]['id']}:{}});if(_0x35a2df[_0x26f7dc(0x199)]!==_0x26065f||_0x35a2df[_0x26f7dc(0x1ba)]!==_0xbc2c2b['replacement']['content']||_0xbc2c2b['beforeRecord']!==null&&_0x35a2df['id']!==_0xbc2c2b[_0x26f7dc(0x1b3)]['id'])throw appRuleError('app_rule_verification_failed',_0x26f7dc(0x19a),'Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.');}catch(_0x3b00d6){if(!isPlatformTransportFailure(_0x3b00d6))throw _0x3b00d6;_0x1400fc=!![];}let _0x31ddd6;try{_0x31ddd6=await getAppRule(_0x4ede9f[_0x26f7dc(0x18b)],{'appCode':_0x4ede9f['appCode'],'type':_0xbc2c2b[_0x26f7dc(0x1ae)]['type']});}catch(_0x5b0e19){const _0x576e26=appRuleError(_0x1400fc?_0x26f7dc(0x1a3):_0x26f7dc(0x1a7),_0x26f7dc(0x192)+appRuleFileName(_0xbc2c2b[_0x26f7dc(0x1ae)]['type'])+_0x26f7dc(0x1a9),_0x26f7dc(0x1b5));Object[_0x26f7dc(0x19c)](_0x576e26,'cause',{'value':_0x5b0e19,'enumerable':![]});throw _0x576e26;}const _0x599817=_0x31ddd6&&inspectAppRuleContent(_0x31ddd6[_0x26f7dc(0x1ba)])['contentHash']===_0xbc2c2b[_0x26f7dc(0x1a2)][_0x26f7dc(0x1aa)],_0x312d3f=_0x31ddd6&&_0x31ddd6[_0x26f7dc(0x199)]===_0x26065f&&(!_0x35a2df||_0x31ddd6['id']===_0x35a2df['id']&&_0x31ddd6[_0x26f7dc(0x199)]===_0x35a2df[_0x26f7dc(0x199)]);if(!_0x31ddd6||!_0x599817||!_0x312d3f||_0xbc2c2b[_0x26f7dc(0x1b3)]!==null&&_0x31ddd6['id']!==_0xbc2c2b[_0x26f7dc(0x1b3)]['id'])throw appRuleError(_0x1400fc?'app_rule_set_outcome_unknown':_0x26f7dc(0x18a),appRuleFileName(_0xbc2c2b['input'][_0x26f7dc(0x198)])+'\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.',_0x26f7dc(0x1bf)+_0xbc2c2b[_0x26f7dc(0x1ae)][_0x26f7dc(0x198)]+_0x26f7dc(0x195));const _0x320160=warningsFor(_0xbc2c2b['input']['expectedVersion']);_0x1400fc&&_0x320160['push'](_0x26f7dc(0x19f));const _0x5ae8dc=projectAppRule(_0xbc2c2b['input'][_0x26f7dc(0x198)],_0x31ddd6);return{'ok':!![],'data':{'operation':_0x26f7dc(0x19b),'selector':{'appCode':_0x4ede9f[_0x26f7dc(0x1b2)],'scope':_0x26f7dc(0x1c0),'type':_0xbc2c2b[_0x26f7dc(0x1ae)]['type']},'before':_0xbc2c2b[_0x26f7dc(0x191)],'after':_0x5ae8dc,'dryRun':![],'backend':{'method':'POST','path':knowledgeDocumentsPath('rules',_0xbc2c2b[_0x26f7dc(0x1b3)]?_0x26f7dc(0x1b1):'create')},'warnings':_0x320160,'verification':{'status':_0x26f7dc(0x1b4),'recoveredAfterUnknownResponse':_0x1400fc,'expectedVersion':_0xbc2c2b[_0x26f7dc(0x1b3)]?.[_0x26f7dc(0x199)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x26f7dc(0x1a0)+_0xbc2c2b[_0x26f7dc(0x1ae)][_0x26f7dc(0x198)]+'\x20--format\x20compress'}},'message':'Set\x20'+appRuleFileName(_0xbc2c2b[_0x26f7dc(0x1ae)][_0x26f7dc(0x198)])+_0x26f7dc(0x1c1)+_0x4ede9f[_0x26f7dc(0x1b2)]};}};
|
|
1
|
+
const a243_0x1185c5=a243_0x14f6;(function(_0x25549e,_0x260528){const _0x517b60=a243_0x14f6,_0x215300=_0x25549e();while(!![]){try{const _0x3a9cfe=-parseInt(_0x517b60(0x13e))/0x1+-parseInt(_0x517b60(0x170))/0x2*(parseInt(_0x517b60(0x16b))/0x3)+-parseInt(_0x517b60(0x15f))/0x4+-parseInt(_0x517b60(0x178))/0x5+-parseInt(_0x517b60(0x172))/0x6+parseInt(_0x517b60(0x153))/0x7*(-parseInt(_0x517b60(0x156))/0x8)+parseInt(_0x517b60(0x159))/0x9;if(_0x3a9cfe===_0x260528)break;else _0x215300['push'](_0x215300['shift']());}catch(_0x2c96d9){_0x215300['push'](_0x215300['shift']());}}}(a243_0x4343,0xb0567));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';function a243_0x4343(){const _0x1760aa=['1571095soXeFQ','app_rule_verification_failed','unconfigured','\x20for\x20','rule','\x20version\x20changed\x20before\x20write.','app_rule_expected_version_invalid','app_rule_content_too_large','byteSize','417289APErou','trim','app_rule_version_mismatch','rabetbase\x20rule\x20get\x20--type\x20','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','--file\x20is\x20required.','write','content','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','verified','planned','Expected\x20','number','input','version','replacement','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','defineProperty','isSafeInteger','RULES','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','91BvAQdU','contentHash','flag','230856hgQuTY','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','beforeRecord','27155205GaXAtO','POST','create','type','\x20could\x20not\x20be\x20verified.','cause','95732vQBtRH','rules','\x20--format\x20compress','cookie','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','The\x20set\x20request\x20was\x20sent,\x20but\x20','expected-version','appCode','before','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','string','file','28011VDtovG','update',';\x20current\x20version\x20is\x20','set','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','142Ahoxjp','expectedVersion','3008742gfgqXP','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','DATABASE','Set\x20','str','Pass\x20a\x20UTF-8\x20Markdown\x20file.'];a243_0x4343=function(){return _0x1760aa;};return a243_0x4343();}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_0x14f6(_0x47f191,_0x476cd6){_0x47f191=_0x47f191-0x13c;const _0x434398=a243_0x4343();let _0x14f6c5=_0x434398[_0x47f191];return _0x14f6c5;}function readSetInput(_0x164170){const _0x5cd121=a243_0x14f6,_0x1bd0df=readAppRuleType(_0x164170),_0x77527b=_0x164170[_0x5cd121(0x176)](_0x5cd121(0x16a))[_0x5cd121(0x13f)]();if(!_0x77527b)throw appRuleError('app_rule_file_required',_0x5cd121(0x143),_0x5cd121(0x177));const _0x2abc6e=_0x164170[_0x5cd121(0x155)](_0x5cd121(0x165));let _0x417558;if(_0x2abc6e!==undefined){_0x417558=Number(_0x2abc6e);if(!Number[_0x5cd121(0x150)](_0x417558)||_0x417558<0x0)throw appRuleError(_0x5cd121(0x17e),'--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.');}return{'type':_0x1bd0df,'file':_0x77527b,'expectedVersion':_0x417558};}async function prepareSet(_0x10ac2e){const _0x239a61=a243_0x14f6,_0x392952=readSetInput(_0x10ac2e),_0x418829=await readAppRuleFile(_0x392952[_0x239a61(0x16a)]);if(_0x392952[_0x239a61(0x15c)]===_0x239a61(0x160)&&_0x418829[_0x239a61(0x145)]['length']>0x7d0)throw appRuleError(_0x239a61(0x13c),_0x239a61(0x16f));const _0x3aad16=await getAppRule(_0x10ac2e['cookie'],{'appCode':_0x10ac2e[_0x239a61(0x166)],'type':_0x392952[_0x239a61(0x15c)]});if(_0x392952['expectedVersion']!==undefined&&(_0x3aad16?.[_0x239a61(0x14c)]??0x0)!==_0x392952[_0x239a61(0x171)])throw appRuleError(_0x239a61(0x140),appRuleFileName(_0x392952[_0x239a61(0x15c)])+_0x239a61(0x17d),_0x239a61(0x149)+_0x392952[_0x239a61(0x171)]+_0x239a61(0x16d)+(_0x3aad16?.[_0x239a61(0x14c)]??_0x239a61(0x17a))+_0x239a61(0x168));return{'input':_0x392952,'replacement':_0x418829,'beforeRecord':_0x3aad16,'before':projectAppRule(_0x392952[_0x239a61(0x15c)],_0x3aad16),'planned':{'type':_0x392952[_0x239a61(0x15c)],'fileName':appRuleFileName(_0x392952['type']),'contextScope':appRuleContextScope(_0x392952['type']),'enabled':!![],'appCode':_0x10ac2e[_0x239a61(0x166)],'scope':_0x239a61(0x160),'contentByteSize':_0x418829[_0x239a61(0x13d)],'contentHash':_0x418829[_0x239a61(0x154)]}};}function warningsFor(_0xe29dde){return[];}export const ruleSet={'service':a243_0x1185c5(0x17c),'command':a243_0x1185c5(0x16e),'description':'Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','risk':a243_0x1185c5(0x144),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':'file','type':a243_0x1185c5(0x169),'required':!![],'description':a243_0x1185c5(0x14e)},{'name':'expected-version','type':a243_0x1185c5(0x14a),'required':![],'description':a243_0x1185c5(0x142)}],async 'validate'(_0x405bad){readSetInput(_0x405bad);},async 'dryRun'(_0x53127d){const _0xdf161d=a243_0x1185c5,_0x41d556=await prepareSet(_0x53127d);return asDryRunResult({'operation':'set','selector':{'appCode':_0x53127d[_0xdf161d(0x166)],'scope':_0xdf161d(0x160),'type':_0x41d556[_0xdf161d(0x14b)][_0xdf161d(0x15c)]},'before':_0x41d556[_0xdf161d(0x167)],'after':_0x41d556[_0xdf161d(0x148)],'dryRun':!![],'backend':{'method':_0xdf161d(0x15a),'path':knowledgeDocumentsPath(_0xdf161d(0x160),_0x41d556[_0xdf161d(0x158)]?_0xdf161d(0x16c):_0xdf161d(0x15b)),'body':{'appCode':_0x53127d[_0xdf161d(0x166)],..._0x41d556[_0xdf161d(0x158)]?{'id':_0x41d556[_0xdf161d(0x158)]['id']}:{},'title':_0x41d556[_0xdf161d(0x14b)][_0xdf161d(0x15c)]===_0xdf161d(0x160)?_0xdf161d(0x151):_0xdf161d(0x174),'contentHash':_0x41d556['replacement'][_0xdf161d(0x154)],'contentByteSize':_0x41d556[_0xdf161d(0x14d)][_0xdf161d(0x13d)],..._0x41d556[_0xdf161d(0x158)]?{'expectedVersion':_0x41d556[_0xdf161d(0x158)][_0xdf161d(0x14c)]}:{}}},'warnings':warningsFor(_0x41d556[_0xdf161d(0x14b)][_0xdf161d(0x171)]),'verification':{'expectedVersion':_0x41d556[_0xdf161d(0x158)]?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0xdf161d(0x141)+_0x41d556[_0xdf161d(0x14b)][_0xdf161d(0x15c)]+_0xdf161d(0x161)}},{'method':'POST','url':knowledgeDocumentsPath(_0xdf161d(0x160),_0x41d556[_0xdf161d(0x158)]?_0xdf161d(0x16c):_0xdf161d(0x15b))});},async 'execute'(_0x59bdc2){const _0x219581=a243_0x1185c5,_0x1289bd=await prepareSet(_0x59bdc2),_0x21c1d8=_0x1289bd['beforeRecord']===null?0x1:_0x1289bd[_0x219581(0x158)][_0x219581(0x14c)]+(_0x1289bd[_0x219581(0x158)][_0x219581(0x145)]===_0x1289bd[_0x219581(0x14d)][_0x219581(0x145)]?0x0:0x1);let _0x43bfd1,_0x2d7c20=![];try{_0x43bfd1=await saveAppRule(_0x59bdc2['cookie'],{'appCode':_0x59bdc2['appCode'],'type':_0x1289bd[_0x219581(0x14b)][_0x219581(0x15c)],'content':_0x1289bd[_0x219581(0x14d)][_0x219581(0x145)],'expectedVersion':_0x1289bd[_0x219581(0x158)]?.[_0x219581(0x14c)]??0x0,..._0x1289bd[_0x219581(0x158)]?{'id':_0x1289bd[_0x219581(0x158)]['id']}:{}});if(_0x43bfd1['version']!==_0x21c1d8||_0x43bfd1[_0x219581(0x145)]!==_0x1289bd[_0x219581(0x14d)]['content']||_0x1289bd['beforeRecord']!==null&&_0x43bfd1['id']!==_0x1289bd[_0x219581(0x158)]['id'])throw appRuleError(_0x219581(0x179),_0x219581(0x146),_0x219581(0x163));}catch(_0x2ac210){if(!isPlatformTransportFailure(_0x2ac210))throw _0x2ac210;_0x2d7c20=!![];}let _0x734a44;try{_0x734a44=await getAppRule(_0x59bdc2[_0x219581(0x162)],{'appCode':_0x59bdc2[_0x219581(0x166)],'type':_0x1289bd[_0x219581(0x14b)][_0x219581(0x15c)]});}catch(_0xc12a2b){const _0x17ad51=appRuleError(_0x2d7c20?'app_rule_set_outcome_unknown':'app_rule_verification_unavailable',_0x219581(0x164)+appRuleFileName(_0x1289bd[_0x219581(0x14b)]['type'])+_0x219581(0x15d),'Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.');Object[_0x219581(0x14f)](_0x17ad51,_0x219581(0x15e),{'value':_0xc12a2b,'enumerable':![]});throw _0x17ad51;}const _0x175e40=_0x734a44&&inspectAppRuleContent(_0x734a44[_0x219581(0x145)])[_0x219581(0x154)]===_0x1289bd['replacement'][_0x219581(0x154)],_0x3b1427=_0x734a44&&_0x734a44[_0x219581(0x14c)]===_0x21c1d8&&(!_0x43bfd1||_0x734a44['id']===_0x43bfd1['id']&&_0x734a44[_0x219581(0x14c)]===_0x43bfd1[_0x219581(0x14c)]);if(!_0x734a44||!_0x175e40||!_0x3b1427||_0x1289bd[_0x219581(0x158)]!==null&&_0x734a44['id']!==_0x1289bd[_0x219581(0x158)]['id'])throw appRuleError(_0x2d7c20?'app_rule_set_outcome_unknown':_0x219581(0x179),appRuleFileName(_0x1289bd[_0x219581(0x14b)][_0x219581(0x15c)])+_0x219581(0x173),_0x219581(0x157)+_0x1289bd[_0x219581(0x14b)]['type']+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x4d95f4=warningsFor(_0x1289bd[_0x219581(0x14b)]['expectedVersion']);_0x2d7c20&&_0x4d95f4['push'](_0x219581(0x152));const _0x42c8f4=projectAppRule(_0x1289bd[_0x219581(0x14b)][_0x219581(0x15c)],_0x734a44);return{'ok':!![],'data':{'operation':_0x219581(0x16e),'selector':{'appCode':_0x59bdc2[_0x219581(0x166)],'scope':_0x219581(0x160),'type':_0x1289bd['input'][_0x219581(0x15c)]},'before':_0x1289bd[_0x219581(0x167)],'after':_0x42c8f4,'dryRun':![],'backend':{'method':_0x219581(0x15a),'path':knowledgeDocumentsPath(_0x219581(0x160),_0x1289bd[_0x219581(0x158)]?_0x219581(0x16c):_0x219581(0x15b))},'warnings':_0x4d95f4,'verification':{'status':_0x219581(0x147),'recoveredAfterUnknownResponse':_0x2d7c20,'expectedVersion':_0x1289bd['beforeRecord']?.[_0x219581(0x14c)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x219581(0x141)+_0x1289bd[_0x219581(0x14b)]['type']+_0x219581(0x161)}},'message':_0x219581(0x175)+appRuleFileName(_0x1289bd[_0x219581(0x14b)]['type'])+_0x219581(0x17b)+_0x59bdc2['appCode']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a244_0x22b0c3=a244_0x3b40;(function(_0x395138,_0xaadeb){const _0x5c777f=a244_0x3b40,_0xcb132e=_0x395138();while(!![]){try{const _0x541f86=parseInt(_0x5c777f(0x208))/0x1+-parseInt(_0x5c777f(0x20e))/0x2*(parseInt(_0x5c777f(0x203))/0x3)+-parseInt(_0x5c777f(0x1ec))/0x4*(-parseInt(_0x5c777f(0x1eb))/0x5)+-parseInt(_0x5c777f(0x1e0))/0x6+parseInt(_0x5c777f(0x204))/0x7*(parseInt(_0x5c777f(0x20a))/0x8)+-parseInt(_0x5c777f(0x1f4))/0x9*(-parseInt(_0x5c777f(0x201))/0xa)+-parseInt(_0x5c777f(0x1ed))/0xb;if(_0x541f86===_0xaadeb)break;else _0xcb132e['push'](_0xcb132e['shift']());}catch(_0xc59466){_0xcb132e['push'](_0xcb132e['shift']());}}}(a244_0x3792,0xac2c2));function a244_0x3792(){const _0x2a2ff2=['hex','10WZxJbl','474256WOwnjv','11678524pRGSEj','Pass\x20a\x20UTF-8\x20Markdown\x20file.','digest','decode','page-api-development','updateTime','content','9BGszHa','database','App\x20rule\x20file\x20is\x20blank:\x20','contentHash','str','app_rule_file_required','app_rule_content_too_large','appCode','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','length','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','size','isFile','5427480VhhIbk','app_rule_file_invalid','819KAznTf','2872226nCIPWR','--file\x20is\x20required.','RULES.md','from','1338435gsjeeR','version','16SnUWPX','rules','Cannot\x20access\x20app\x20rule\x20file:\x20','byteSize','3236dBpUEb','trim','app_rule_file_unreadable','createTime','byteLength','message','4381986oWVJxs','app_rule_content_invalid','update','indexStatus','utf8','string','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','type','sha256','sha256:'];a244_0x3792=function(){return _0x2a2ff2;};return a244_0x3792();}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_0x22b0c3(0x20b),a244_0x22b0c3(0x1f5)];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_0x22b0c3(0x206),'database':'DATABASE.md'},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x22b0c3(0x1f1),'database':'database-analysis'};export function appRuleError(_0x5404b1,_0x5a499d,_0x382d5a){return new CliError(_0x5404b1,0x1,_0x5a499d,_0x382d5a);}function a244_0x3b40(_0x407062,_0x1227f2){_0x407062=_0x407062-0x1de;const _0x37922c=a244_0x3792();let _0x3b4073=_0x37922c[_0x407062];return _0x3b4073;}export function readAppRuleType(_0x44108e){const _0x40e69f=a244_0x22b0c3,_0x5e5591=_0x44108e[_0x40e69f(0x1f8)](_0x40e69f(0x1e7))['trim']()['toLowerCase']();if(_0x5e5591!==_0x40e69f(0x20b)&&_0x5e5591!=='database')throw appRuleError('app_rule_type_invalid','--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0x5e5591;}export function appRuleFileName(_0x4aa014){return APP_RULE_FILES[_0x4aa014];}export function appRuleContextScope(_0x1183ac){return APP_RULE_CONTEXT_SCOPES[_0x1183ac];}export function inspectAppRuleContent(_0x3f726f){const _0x4be4a0=a244_0x22b0c3,_0x44db4f=Buffer[_0x4be4a0(0x207)](_0x3f726f,_0x4be4a0(0x1e4));return{'content':_0x3f726f,'byteSize':_0x44db4f[_0x4be4a0(0x1de)],'contentHash':_0x4be4a0(0x1e9)+createHash(_0x4be4a0(0x1e8))[_0x4be4a0(0x1e2)](_0x44db4f)[_0x4be4a0(0x1ef)](_0x4be4a0(0x1ea))};}export async function readAppRuleFile(_0x5df32d){const _0x123f56=a244_0x22b0c3,_0x2bbbfe=_0x5df32d[_0x123f56(0x20f)]();if(!_0x2bbbfe)throw appRuleError(_0x123f56(0x1f9),_0x123f56(0x205),_0x123f56(0x1ee));const _0x11d347=resolve(_0x2bbbfe);let _0x2d35f7;try{_0x2d35f7=await stat(_0x11d347);}catch(_0x1b82e3){throw appRuleError('app_rule_file_unreadable',_0x123f56(0x20c)+_0x2bbbfe,_0x1b82e3 instanceof Error?_0x1b82e3[_0x123f56(0x1df)]:String(_0x1b82e3));}if(!_0x2d35f7[_0x123f56(0x200)]())throw appRuleError(_0x123f56(0x202),_0x123f56(0x1e6)+_0x2bbbfe);if(_0x2d35f7[_0x123f56(0x1ff)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x123f56(0x1fa),'App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.');let _0x278d94;try{_0x278d94=await readFile(_0x11d347);}catch(_0x4db0c8){throw appRuleError(_0x123f56(0x210),'Cannot\x20read\x20app\x20rule\x20file:\x20'+_0x2bbbfe,_0x4db0c8 instanceof Error?_0x4db0c8[_0x123f56(0x1df)]:String(_0x4db0c8));}if(_0x278d94[_0x123f56(0x1de)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.');let _0x3f7a87;try{_0x3f7a87=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x123f56(0x1f0)](_0x278d94);}catch{throw appRuleError(_0x123f56(0x1e1),'App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x2bbbfe);}if(_0x3f7a87[_0x123f56(0x1fd)]>MAX_APP_RULE_UNITS)throw appRuleError(_0x123f56(0x1fa),_0x123f56(0x1fc));if(!_0x3f7a87['trim']())throw appRuleError('app_rule_content_invalid',_0x123f56(0x1f6)+_0x2bbbfe);return inspectAppRuleContent(_0x3f7a87);}export function projectAppRule(_0xa0f201,_0xcdab46){const _0x4bb778=a244_0x22b0c3;if(!_0xcdab46)return{'type':_0xa0f201,'fileName':appRuleFileName(_0xa0f201),'contextScope':appRuleContextScope(_0xa0f201),'enabled':![]};const _0x3904e1=inspectAppRuleContent(_0xcdab46[_0x4bb778(0x1f3)]);return{'type':_0xa0f201,'fileName':appRuleFileName(_0xa0f201),'contextScope':appRuleContextScope(_0xa0f201),'enabled':!![],'id':_0xcdab46['id'],'scope':_0xcdab46['scope'],'appCode':_0xcdab46[_0x4bb778(0x1fb)],'version':_0xcdab46[_0x4bb778(0x209)],..._0xcdab46[_0x4bb778(0x1e3)]!==undefined?{'indexStatus':_0xcdab46[_0x4bb778(0x1e3)]}:{},'contentByteSize':_0x3904e1[_0x4bb778(0x20d)],'contentHash':_0x3904e1[_0x4bb778(0x1f7)],..._0xcdab46[_0x4bb778(0x211)]!==undefined&&_0xcdab46[_0x4bb778(0x211)]!==null?{'createTime':_0xcdab46[_0x4bb778(0x211)]}:{},..._0xcdab46['updateTime']!==undefined&&_0xcdab46[_0x4bb778(0x1f2)]!==null?{'updateTime':_0xcdab46[_0x4bb778(0x1f2)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x22b0c3(0x1e7),'type':a244_0x22b0c3(0x1e5),'required':!![],'description':a244_0x22b0c3(0x1fe),'enum':[...APP_RULE_TYPES]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a245_0x4fb4ff=a245_0x35a6;(function(_0x348bbc,_0x14eb71){const _0x15aedb=a245_0x35a6,_0x5905c1=_0x348bbc();while(!![]){try{const _0x1662d5=parseInt(_0x15aedb(0xe7))/0x1*(parseInt(_0x15aedb(0xe8))/0x2)+-parseInt(_0x15aedb(0xe2))/0x3+-parseInt(_0x15aedb(0xe4))/0x4+-parseInt(_0x15aedb(0xf4))/0x5+parseInt(_0x15aedb(0x106))/0x6+-parseInt(_0x15aedb(0xe5))/0x7+parseInt(_0x15aedb(0x117))/0x8;if(_0x1662d5===_0x14eb71)break;else _0x5905c1['push'](_0x5905c1['shift']());}catch(_0x2a1425){_0x5905c1['push'](_0x5905c1['shift']());}}}(a245_0x2acb,0x19543));function a245_0x2acb(){const _0x4d33cf=['dev','error','parse','npm','join','write','\x20exited\x20with\x20code\x20','script','keys','245028heqZWM','package.json','204128UNAPjy','417221rJpSGH','boolean','297ukNyLJ','906amlojw','scripts','pnpm-lock.yaml','validation','path','No\x20package.json\x20found\x20in\x20current\x20directory.','args','.bin','push','\x22\x20not\x20found\x20in\x20package.json.','close','--watch','724550jbCQnU','(none)','Script\x20\x22','length','\x0a\x20\x20Available\x20scripts:\x0a','log','run','\x0a\x20\x20Usage:\x20','cwd','vite','preview','Available:\x20','bun.lock','inherit','No\x20scripts\x20defined\x20in\x20package.json.','start','\x20run\x20build','\x20\x20EXAMPLES','572244TKDXcs','\x20\x20\x20\x20','\x20run\x20preview\x20--watch','bun','changed','has','\x20run\x20<script>\x0a','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','utf-8','\x20run\x20start','node_modules','\x20run\x20','needsUpgrade','Script\x20name\x20defined\x20in\x20package.json','bool','watch','yarn.lock','1688424CEqwEl'];a245_0x2acb=function(){return _0x4d33cf;};return a245_0x2acb();}import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';function a245_0x35a6(_0x18066b,_0x2996b7){_0x18066b=_0x18066b-0xd9;const _0x2acbc7=a245_0x2acb();let _0x35a64f=_0x2acbc7[_0x18066b];return _0x35a64f;}import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a245_0x4fb4ff(0x103),'dev']),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x4fb4ff(0x103),a245_0x4fb4ff(0xd9),'build',a245_0x4fb4ff(0xfe)]);export function syncProjectDomainRoutingBeforeScript(_0x23e1bc,_0x4640d8){const _0x2df660=a245_0x4fb4ff;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x2df660(0x10b)](_0x4640d8))return null;const _0x49cccc=findProjectRootDirectory(_0x23e1bc);if(!resolveConfigPath(_0x49cccc))return null;const _0x5c1feb=writeProjectDomainRoutingManifest(_0x49cccc);return{'path':_0x5c1feb[_0x2df660(0xec)],'changed':_0x5c1feb[_0x2df660(0x10a)]};}function readPackageScripts(_0x5208c8){const _0x5046e1=a245_0x4fb4ff,_0x35e2ba=resolve(_0x5208c8,_0x5046e1(0xe3));if(!existsSync(_0x35e2ba))return null;try{const _0x43e5b9=JSON[_0x5046e1(0xdb)](readFileSync(_0x35e2ba,_0x5046e1(0x10e)));return _0x43e5b9[_0x5046e1(0xe9)]??{};}catch{return null;}}function detectPackageManager(_0x3100f1){const _0x301c65=a245_0x4fb4ff;if(existsSync(resolve(_0x3100f1,'bun.lockb'))||existsSync(resolve(_0x3100f1,_0x301c65(0x100))))return _0x301c65(0x109);if(existsSync(resolve(_0x3100f1,_0x301c65(0xea))))return'pnpm';if(existsSync(resolve(_0x3100f1,_0x301c65(0x116))))return'yarn';return _0x301c65(0xdc);}async function versionCheck(_0x205ade){const _0x2591d4=a245_0x4fb4ff,_0x467a17=await checkCliVersion();(_0x467a17[_0x2591d4(0x112)]||_0x467a17['belowMinimum'])&&(printCliUpgradeWarning(_0x467a17),assertCliVersionSupported(_0x467a17));const _0xe7d1a6=await checkSdkVersion(_0x205ade);if(_0xe7d1a6[_0x2591d4(0x112)])printSdkUpgradeWarning(_0xe7d1a6);}function spawnScript(_0x490873,_0x47caf3,_0x36fc86,_0x3779d5){return new Promise((_0x304f65,_0x290b64)=>{const _0x4feb7d=a245_0x35a6,_0x56427e=[_0x4feb7d(0xfa),_0x47caf3,..._0x36fc86],_0x14538e=spawn(_0x490873,_0x56427e,{'cwd':_0x3779d5,'stdio':_0x4feb7d(0x101),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3779d5,_0x4feb7d(0x110),_0x4feb7d(0xef))+delimiter+process.env.PATH}});_0x14538e['on'](_0x4feb7d(0xf2),_0x9513e7=>{const _0x4d293a=_0x4feb7d;if(_0x9513e7===0x0||_0x9513e7===null)_0x304f65();else _0x290b64(new Error(_0x490873+_0x4d293a(0x111)+_0x47caf3+_0x4d293a(0xdf)+_0x9513e7));}),_0x14538e['on'](_0x4feb7d(0xda),_0x290b64);});}function spawnViteBuildWatch(_0x3907f6){return new Promise((_0x25f8ad,_0x1ebacf)=>{const _0x49a6dd=a245_0x35a6,_0x44b882=spawn(_0x49a6dd(0xfd),['build',_0x49a6dd(0xf3)],{'cwd':_0x3907f6,'stdio':_0x49a6dd(0x101),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3907f6,_0x49a6dd(0x110),_0x49a6dd(0xef))+delimiter+process.env.PATH}});_0x44b882['on']('close',_0x100fb4=>{const _0x1b8de7=_0x49a6dd;if(_0x100fb4===0x0||_0x100fb4===null)_0x25f8ad();else _0x1ebacf(new Error(_0x1b8de7(0x10d)+_0x100fb4));}),_0x44b882['on'](_0x49a6dd(0xda),_0x1ebacf);});}function spawnVitePreview(_0x453408){return new Promise((_0x3b083d,_0x4c0f59)=>{const _0x55d68e=a245_0x35a6,_0x3df2cc=spawn('vite',[_0x55d68e(0xfe)],{'cwd':_0x453408,'stdio':_0x55d68e(0x101),'shell':!![],'env':{...process.env,'PATH':''+join(_0x453408,_0x55d68e(0x110),'.bin')+delimiter+process.env.PATH}});_0x3df2cc['on'](_0x55d68e(0xf2),_0x5bbdfa=>{if(_0x5bbdfa===0x0||_0x5bbdfa===null)_0x3b083d();else _0x4c0f59(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x5bbdfa));}),_0x3df2cc['on'](_0x55d68e(0xda),_0x4c0f59);});}const runFlags=[{'name':'watch','type':a245_0x4fb4ff(0xe6),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a245_0x4fb4ff(0xfa),'command':a245_0x4fb4ff(0xfa),'description':'Run\x20a\x20package.json\x20script','risk':a245_0x4fb4ff(0xde),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a245_0x4fb4ff(0xe0),'description':a245_0x4fb4ff(0x113),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x2fa9d6=a245_0x4fb4ff,_0x229e45=[];return _0x229e45[_0x2fa9d6(0xf0)](_0x2fa9d6(0x105)),_0x229e45['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x2fa9d6(0x10f)),_0x229e45[_0x2fa9d6(0xf0)](_0x2fa9d6(0x107)+CLI_BIN_NAME+_0x2fa9d6(0x104)),_0x229e45[_0x2fa9d6(0xf0)](_0x2fa9d6(0x107)+CLI_BIN_NAME+'\x20run\x20preview'),_0x229e45[_0x2fa9d6(0xf0)](_0x2fa9d6(0x107)+CLI_BIN_NAME+_0x2fa9d6(0x108)),_0x229e45[_0x2fa9d6(0xdd)]('\x0a');},async 'execute'(_0x43e494){const _0x4b690c=a245_0x4fb4ff,_0x3623bf=process[_0x4b690c(0xfc)](),_0x3766e6=_0x43e494[_0x4b690c(0xee)][0x0],_0x24710d=_0x43e494[_0x4b690c(0xee)]['slice'](0x1),_0x2a1715=readPackageScripts(_0x3623bf);if(!_0x2a1715)throw CliErrors[_0x4b690c(0xeb)](_0x4b690c(0xed));if(!_0x3766e6){const _0x430756=Object[_0x4b690c(0xe1)](_0x2a1715);if(_0x430756[_0x4b690c(0xf7)]===0x0)console[_0x4b690c(0xf9)](_0x4b690c(0x102));else{console[_0x4b690c(0xf9)](_0x4b690c(0xf8));for(const _0x2f9f23 of _0x430756){console['log'](_0x4b690c(0x107)+_0x2f9f23);}console[_0x4b690c(0xf9)](_0x4b690c(0xfb)+CLI_BIN_NAME+_0x4b690c(0x10c));}return{'ok':!![]};}if(!_0x2a1715[_0x3766e6])throw CliErrors[_0x4b690c(0xeb)](_0x4b690c(0xf6)+_0x3766e6+_0x4b690c(0xf1),_0x4b690c(0xff)+(Object[_0x4b690c(0xe1)](_0x2a1715)['join'](',\x20')||_0x4b690c(0xf5)));const _0x73ea50=detectPackageManager(_0x3623bf),_0x2dbdce=syncProjectDomainRoutingBeforeScript(_0x3623bf,_0x3766e6);_0x2dbdce?.['changed']&&console['error']('Domain\x20routing\x20synchronized:\x20'+_0x2dbdce['path']);VERSION_CHECK_SCRIPTS[_0x4b690c(0x10b)](_0x3766e6)&&await versionCheck(_0x3623bf);if(_0x3766e6===_0x4b690c(0xfe)&&_0x43e494[_0x4b690c(0x114)](_0x4b690c(0x115)))return await Promise['all']([spawnViteBuildWatch(_0x3623bf),spawnVitePreview(_0x3623bf)]),{'ok':!![]};return await spawnScript(_0x73ea50,_0x3766e6,_0x24710d,_0x3623bf),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a246_0x24d8a3=a246_0x49d8;function a246_0x49d8(_0x246604,_0x5affea){_0x246604=_0x246604-0x1f3;const _0x304dd4=a246_0x304d();let _0x49d825=_0x304dd4[_0x246604];return _0x49d825;}(function(_0x3bbb86,_0x2a1587){const _0x27fb48=a246_0x49d8,_0xad5b92=_0x3bbb86();while(!![]){try{const _0x2c7024=parseInt(_0x27fb48(0x1fa))/0x1*(-parseInt(_0x27fb48(0x1f3))/0x2)+parseInt(_0x27fb48(0x1fc))/0x3*(parseInt(_0x27fb48(0x1ff))/0x4)+parseInt(_0x27fb48(0x1fb))/0x5+parseInt(_0x27fb48(0x1f9))/0x6*(parseInt(_0x27fb48(0x201))/0x7)+parseInt(_0x27fb48(0x1fd))/0x8*(-parseInt(_0x27fb48(0x1f6))/0x9)+parseInt(_0x27fb48(0x1f4))/0xa+-parseInt(_0x27fb48(0x1f5))/0xb;if(_0x2c7024===_0x2a1587)break;else _0xad5b92['push'](_0xad5b92['shift']());}catch(_0x1c3b31){_0xad5b92['push'](_0xad5b92['shift']());}}}(a246_0x304d,0xd6953));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2b854e){const _0x17b07d=await buildSchemaPayload();return{'ok':!![],'data':_0x17b07d};}function a246_0x304d(){const _0xdbc8e0=['718035pmITXw','3gIFxAh','6896XbHzKN','json','2599276PoJvgu','export','251552pLfFGQ','2RySMnP','9562010CDytYl','14920147NMucBR','2304ZzaaHe','schema','Export\x20machine-readable\x20command\x20schema\x20(JSON)','264aROQlt','874831fZYbEv'];a246_0x304d=function(){return _0xdbc8e0;};return a246_0x304d();}export const schemaDefinition={'service':a246_0x24d8a3(0x1f7),'command':a246_0x24d8a3(0x200),'description':a246_0x24d8a3(0x1f8),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x24d8a3(0x1fe),'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a247_0x54982a=a247_0x2581;(function(_0x1d6587,_0x1b2356){const _0x53ae59=a247_0x2581,_0x44bb6a=_0x1d6587();while(!![]){try{const _0x3a6f2c=parseInt(_0x53ae59(0x86))/0x1+-parseInt(_0x53ae59(0xb0))/0x2*(parseInt(_0x53ae59(0x9d))/0x3)+parseInt(_0x53ae59(0x8c))/0x4*(parseInt(_0x53ae59(0xb6))/0x5)+-parseInt(_0x53ae59(0xaa))/0x6+-parseInt(_0x53ae59(0x8b))/0x7+-parseInt(_0x53ae59(0x88))/0x8+parseInt(_0x53ae59(0xab))/0x9*(parseInt(_0x53ae59(0x99))/0xa);if(_0x3a6f2c===_0x1b2356)break;else _0x44bb6a['push'](_0x44bb6a['shift']());}catch(_0x24bd41){_0x44bb6a['push'](_0x44bb6a['shift']());}}}(a247_0x5b82,0x576fc));function a247_0x2581(_0x11c36e,_0x4f981d){_0x11c36e=_0x11c36e-0x76;const _0x5b82ec=a247_0x5b82();let _0x258111=_0x5b82ec[_0x11c36e];return _0x258111;}import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';function a247_0x5b82(){const _0x623017=['flagMissing','✎\x20Enter\x20dbId\x20manually','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','File\x20already\x20exists:\x20','Local\x20SQL\x20file\x20mode','Target\x20database\x20dbId:','/smartapi/custom/saveUserCustomSql','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','mode','utf8','23667gEQWCt','parse','1033248KJbUsW','Target\x20database\x20ID','SQL\x20name:','2269925RmadUC','468548nvaEzZ','length','trim','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','description','MyBatis\x20XML\x20(mybatisXml)','Plain\x20SQL\x20(sql)','sqlName','name','dbId','SELECT\x201\x20AS\x20id;','join','map','170wZXiKt','sqlRootDir','nonInteractive','__manual__','10515aWbwFM','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','string','lastSync','appCode','Created\x20SQL\x20query\x20','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','Invalid\x20database\x20selection\x20payload:\x20','sqlCode','db-id','mybatisXml','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','number','2175666AbocUL','715941ILpkUB','isFinite','sql','catch','flag','182JwedtZ','isInteger','<server-generated-sqlCode>','Select\x20the\x20target\x20database:','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','dbId\x20must\x20be\x20a\x20positive\x20integer','5weDTBV','str','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','write','sqls','\x20\x20SELECT\x201\x20AS\x20id','dbName'];a247_0x5b82=function(){return _0x623017;};return a247_0x5b82();}import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x3ddd7d){const _0x1150f4=a247_0x2581;if(_0x3ddd7d===_0x1150f4(0xa7))return[_0x1150f4(0x8f),_0x1150f4(0x7a),'</select>',''][_0x1150f4(0x97)]('\x0a');return[_0x1150f4(0x96),'']['join']('\x0a');}export const sqlCreate={'service':a247_0x54982a(0xad),'command':'create','description':a247_0x54982a(0x83),'risk':a247_0x54982a(0x78),'flags':[{'name':'name','type':a247_0x54982a(0x9f),'description':'SQL\x20query\x20display\x20name'},{'name':a247_0x54982a(0xa6),'type':a247_0x54982a(0xa9),'description':a247_0x54982a(0x89)},{'name':a247_0x54982a(0x84),'type':a247_0x54982a(0x9f),'enum':[a247_0x54982a(0xad),'mybatisXml'],'description':a247_0x54982a(0x80)}],async 'validate'(_0x1f4596){const _0x5971c9=a247_0x54982a;if(!_0x1f4596['nonInteractive'])return;if(!_0x1f4596[_0x5971c9(0x76)](_0x5971c9(0x94))[_0x5971c9(0x8e)]())throw CliErrors[_0x5971c9(0x7c)]('name',_0x5971c9(0x77));const _0x2a08b0=resolveProvidedDbId(_0x1f4596);if(typeof _0x2a08b0!==_0x5971c9(0xa9)||!Number['isFinite'](_0x2a08b0)||_0x2a08b0<=0x0)throw CliErrors[_0x5971c9(0x7c)](_0x5971c9(0xa6),_0x5971c9(0xa3));if(!_0x1f4596[_0x5971c9(0x76)](_0x5971c9(0x84))[_0x5971c9(0x8e)]())throw CliErrors['flagMissing'](_0x5971c9(0x84),_0x5971c9(0x9e));},async 'dryRun'(_0x27b95e){const _0x32dea2=a247_0x54982a,_0x465852=loadSqlProjectConfig(_0x27b95e[_0x32dea2(0xa1)]),{sqlName:_0x71ae0,dbId:_0x566ae8,dbName:_0x2b888a,mode:_0x6190dc}=await resolveSqlNewInputs(_0x27b95e),_0x390580=buildSqlRelativePath(_0x32dea2(0xb2),_0x71ae0,_0x2b888a,_0x6190dc,_0x566ae8),_0x33edaa=_0x465852[_0x32dea2(0x9a)]+'/'+_0x390580;return{'method':'POST','url':_0x32dea2(0x82),'body':{'appCode':_0x27b95e[_0x32dea2(0xa1)],'sqlName':_0x71ae0,'dbId':_0x566ae8,'mode':_0x6190dc,'localPath':_0x33edaa},'description':_0x32dea2(0x7e)+_0x465852[_0x32dea2(0x9a)]};},async 'execute'(_0x2a6c90){const _0x4b611f=a247_0x54982a,_0x5b47ad=loadSqlProjectConfig(_0x2a6c90[_0x4b611f(0xa1)]),{sqlName:_0x1e7a9e,dbId:_0x522ca3,dbName:_0x2d0b35,mode:_0x462d18}=await resolveSqlNewInputs(_0x2a6c90),_0x5d0c51=generateSqlTemplate(_0x462d18),_0x458b81=await createSqlQuery({'appCode':_0x2a6c90[_0x4b611f(0xa1)],'sqlName':_0x1e7a9e,'dbId':_0x522ca3,'sqlContent':_0x5d0c51}),_0x5e276f=ensureRemoteSqlContent(_0x458b81),_0x749272=_0x2d0b35||await getDbName(_0x2a6c90[_0x4b611f(0xa1)],_0x522ca3)['catch'](()=>undefined),_0x43132d=buildSqlRelativePath(_0x458b81[_0x4b611f(0xa5)],_0x458b81[_0x4b611f(0x93)],_0x749272,_0x462d18,_0x522ca3),_0x569016=_0x5b47ad[_0x4b611f(0x9a)]+'/'+_0x43132d,_0x631ba5=buildLocalSqlFileContent({'sqlCode':_0x458b81[_0x4b611f(0xa5)],'sqlName':_0x458b81[_0x4b611f(0x93)],'dbId':_0x458b81['dbId']},_0x5e276f,{'dbName':_0x749272,'mode':_0x462d18,'syncedAt':new Date()['toISOString'](),'description':_0x458b81[_0x4b611f(0x90)]});if(await fileExists(_0x569016))throw CliErrors['validation'](_0x4b611f(0x7f)+_0x569016);await ensureParentDirectory(_0x569016),await writeFile(_0x569016,_0x631ba5,_0x4b611f(0x85));const _0x8a3c40=await readSqlLockFile(_0x5b47ad['lockFilePath']),{lockData:_0x4c8717,appLock:_0x343373}=ensureSqlLockScope(_0x8a3c40??createEmptySqlLock(),_0x5b47ad[_0x4b611f(0xa1)],_0x5b47ad['sqlRoot'],'new');return _0x343373[_0x4b611f(0x79)][_0x458b81[_0x4b611f(0xa5)]]={...buildSqlLockEntry(_0x458b81,_0x5e276f,computeSqlContentHash(_0x631ba5),{'dbName':_0x749272}),'path':_0x43132d,'mode':_0x462d18},_0x343373[_0x4b611f(0xa0)]=new Date()['toISOString'](),await writeSqlLockFile(_0x5b47ad['lockFilePath'],_0x4c8717),{'ok':!![],'data':{'id':_0x458b81['id'],'sqlCode':_0x458b81[_0x4b611f(0xa5)],'sqlName':_0x458b81[_0x4b611f(0x93)],'dbId':_0x458b81[_0x4b611f(0x95)],'path':_0x569016,'mode':_0x462d18},'message':_0x4b611f(0xa2)+_0x458b81[_0x4b611f(0xa5)]};}};async function resolveSqlNewInputs(_0x12e997){const _0x337261=await resolveSqlNameInput(_0x12e997),{dbId:_0x85ee76,dbName:_0x12391d}=await resolveDbSelection(_0x12e997),_0x146c38=await resolveSqlModeInput(_0x12e997);return{'sqlName':_0x337261,'dbId':_0x85ee76,'dbName':_0x12391d,'mode':_0x146c38};}async function resolveSqlNameInput(_0x4e2095){const _0x5a176d=a247_0x54982a,_0x199a14=_0x4e2095['str'](_0x5a176d(0x94))[_0x5a176d(0x8e)]();if(_0x199a14)return _0x199a14;if(_0x4e2095[_0x5a176d(0x9b)])throw CliErrors['flagMissing']('name',_0x5a176d(0x77));return(await input({'message':_0x5a176d(0x8a),'validate':_0x9bdc3f=>_0x9bdc3f['trim']()?!![]:'SQL\x20name\x20cannot\x20be\x20empty'}))['trim']();}async function resolveDbSelection(_0x289853){const _0x3363f2=a247_0x54982a,_0x1ef555=resolveProvidedDbId(_0x289853);if(typeof _0x1ef555===_0x3363f2(0xa9)&&Number[_0x3363f2(0xac)](_0x1ef555)&&_0x1ef555>0x0)return{'dbId':_0x1ef555,'dbName':await getDbName(_0x289853[_0x3363f2(0xa1)],_0x1ef555)[_0x3363f2(0xae)](()=>undefined)};if(_0x289853[_0x3363f2(0x9b)])throw CliErrors['flagMissing']('db-id',_0x3363f2(0xa3));const _0x3ec53a=await listDatabases(_0x289853['appCode'])[_0x3363f2(0xae)](()=>[]);if(_0x3ec53a[_0x3363f2(0x8d)]===0x1)return{'dbId':_0x3ec53a[0x0][_0x3363f2(0x95)],'dbName':_0x3ec53a[0x0][_0x3363f2(0x7b)]};if(_0x3ec53a[_0x3363f2(0x8d)]>0x1){const _0x6b4ecd=await select({'message':_0x3363f2(0xb3),'choices':[..._0x3ec53a[_0x3363f2(0x98)](_0x54944f=>({'name':_0x54944f[_0x3363f2(0x7b)]+'\x20('+_0x54944f[_0x3363f2(0x95)]+')','value':serializeDbSelection(_0x54944f)})),{'name':_0x3363f2(0x7d),'value':_0x3363f2(0x9c)}]});if(_0x6b4ecd!==_0x3363f2(0x9c))return deserializeDbSelection(_0x6b4ecd);}const _0x383fd6=await input({'message':_0x3363f2(0x81),'validate':_0x3f0994=>{const _0x2087a8=_0x3363f2,_0x915939=_0x3f0994[_0x2087a8(0x8e)]();if(!_0x915939)return'dbId\x20cannot\x20be\x20empty';const _0x42e0aa=Number(_0x915939);if(!Number[_0x2087a8(0xb1)](_0x42e0aa)||_0x42e0aa<=0x0)return _0x2087a8(0xb5);return!![];}});return{'dbId':Number(_0x383fd6[_0x3363f2(0x8e)]())};}async function resolveSqlModeInput(_0x3b2254){const _0x27314e=a247_0x54982a,_0xf57b7e=_0x3b2254[_0x27314e(0x76)](_0x27314e(0x84))[_0x27314e(0x8e)]();if(_0xf57b7e===_0x27314e(0xad)||_0xf57b7e===_0x27314e(0xa7))return _0xf57b7e;if(_0x3b2254['nonInteractive'])throw CliErrors[_0x27314e(0x7c)](_0x27314e(0x84),_0x27314e(0x9e));return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x27314e(0x92),'value':_0x27314e(0xad),'description':_0x27314e(0xb4)},{'name':_0x27314e(0x91),'value':_0x27314e(0xa7),'description':_0x27314e(0xa8)}]});}function serializeDbSelection(_0x2cbf9a){const _0x1698e9=a247_0x54982a;return JSON['stringify']({'dbId':_0x2cbf9a[_0x1698e9(0x95)],'dbName':_0x2cbf9a[_0x1698e9(0x7b)]});}function deserializeDbSelection(_0x166de7){const _0x4e4d33=a247_0x54982a;try{const _0x4ab865=JSON[_0x4e4d33(0x87)](_0x166de7);if(typeof _0x4ab865['dbId']===_0x4e4d33(0xa9)&&Number[_0x4e4d33(0xac)](_0x4ab865[_0x4e4d33(0x95)]))return{'dbId':_0x4ab865[_0x4e4d33(0x95)],'dbName':_0x4ab865[_0x4e4d33(0x7b)]};}catch{}throw CliErrors['validation'](_0x4e4d33(0xa4)+_0x166de7);}function resolveProvidedDbId(_0x447830){const _0x341214=a247_0x54982a,_0x7467be=_0x447830[_0x341214(0xaf)](_0x341214(0xa6));if(typeof _0x7467be===_0x341214(0xa9)&&Number[_0x341214(0xac)](_0x7467be))return _0x7467be;return undefined;}
|
|
1
|
+
const a247_0x517cef=a247_0x145c;(function(_0x1c486f,_0x3654cd){const _0x26746b=a247_0x145c,_0x180be2=_0x1c486f();while(!![]){try{const _0x1a0c39=-parseInt(_0x26746b(0xa6))/0x1*(-parseInt(_0x26746b(0x9c))/0x2)+parseInt(_0x26746b(0x80))/0x3*(parseInt(_0x26746b(0x91))/0x4)+-parseInt(_0x26746b(0x93))/0x5+parseInt(_0x26746b(0x89))/0x6*(-parseInt(_0x26746b(0xae))/0x7)+-parseInt(_0x26746b(0x86))/0x8+parseInt(_0x26746b(0xb6))/0x9+parseInt(_0x26746b(0x81))/0xa*(parseInt(_0x26746b(0xb2))/0xb);if(_0x1a0c39===_0x3654cd)break;else _0x180be2['push'](_0x180be2['shift']());}catch(_0x4fc8d5){_0x180be2['push'](_0x180be2['shift']());}}}(a247_0x26b3,0x585fd));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';function a247_0x145c(_0x47e1eb,_0x1bfb45){_0x47e1eb=_0x47e1eb-0x7d;const _0x26b305=a247_0x26b3();let _0x145cf6=_0x26b305[_0x47e1eb];return _0x145cf6;}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x150abe){const _0x467aae=a247_0x145c;if(_0x150abe===_0x467aae(0x87))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x467aae(0xa9),_0x467aae(0x90),'']['join']('\x0a');return[_0x467aae(0x97),''][_0x467aae(0x82)]('\x0a');}export const sqlCreate={'service':a247_0x517cef(0x9d),'command':'create','description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a247_0x517cef(0x94),'flags':[{'name':a247_0x517cef(0xb0),'type':a247_0x517cef(0x9e),'description':'SQL\x20query\x20display\x20name'},{'name':a247_0x517cef(0x9f),'type':a247_0x517cef(0x84),'description':'Target\x20database\x20ID'},{'name':a247_0x517cef(0xac),'type':'string','enum':[a247_0x517cef(0x9d),a247_0x517cef(0x87)],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x5723db){const _0x598ebc=a247_0x517cef;if(!_0x5723db[_0x598ebc(0xad)])return;if(!_0x5723db[_0x598ebc(0x83)]('name')[_0x598ebc(0xb5)]())throw CliErrors[_0x598ebc(0x9b)](_0x598ebc(0xb0),_0x598ebc(0x8d));const _0xeb409c=resolveProvidedDbId(_0x5723db);if(typeof _0xeb409c!==_0x598ebc(0x84)||!Number['isFinite'](_0xeb409c)||_0xeb409c<=0x0)throw CliErrors[_0x598ebc(0x9b)](_0x598ebc(0x9f),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x5723db[_0x598ebc(0x83)](_0x598ebc(0xac))['trim']())throw CliErrors[_0x598ebc(0x9b)]('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0xd5b485){const _0x2b548d=a247_0x517cef,_0x21426a=loadSqlProjectConfig(_0xd5b485[_0x2b548d(0xaf)]),{sqlName:_0x23738d,dbId:_0x4b13cd,dbName:_0x215be7,mode:_0x544d1e}=await resolveSqlNewInputs(_0xd5b485),_0x4ee230=buildSqlRelativePath(_0x2b548d(0xa7),_0x23738d,_0x215be7,_0x544d1e,_0x4b13cd),_0x1c5b7f=_0x21426a[_0x2b548d(0x8f)]+'/'+_0x4ee230;return{'method':_0x2b548d(0x96),'url':_0x2b548d(0xa3),'body':{'appCode':_0xd5b485[_0x2b548d(0xaf)],'sqlName':_0x23738d,'dbId':_0x4b13cd,'mode':_0x544d1e,'localPath':_0x1c5b7f},'description':_0x2b548d(0xa1)+_0x21426a[_0x2b548d(0x8f)]};},async 'execute'(_0x31298b){const _0x331ef8=a247_0x517cef,_0x3778c7=loadSqlProjectConfig(_0x31298b['appCode']),{sqlName:_0x237123,dbId:_0x55e2eb,dbName:_0x308027,mode:_0x4508f3}=await resolveSqlNewInputs(_0x31298b),_0x34e837=generateSqlTemplate(_0x4508f3),_0x106b18=await createSqlQuery({'appCode':_0x31298b[_0x331ef8(0xaf)],'sqlName':_0x237123,'dbId':_0x55e2eb,'sqlContent':_0x34e837}),_0x29c7f4=ensureRemoteSqlContent(_0x106b18),_0xf24741=_0x308027||await getDbName(_0x31298b[_0x331ef8(0xaf)],_0x55e2eb)[_0x331ef8(0x85)](()=>undefined),_0xdfc6b8=buildSqlRelativePath(_0x106b18[_0x331ef8(0x8a)],_0x106b18[_0x331ef8(0x95)],_0xf24741,_0x4508f3,_0x55e2eb),_0x4c181=_0x3778c7[_0x331ef8(0x8f)]+'/'+_0xdfc6b8,_0x166ec0=buildLocalSqlFileContent({'sqlCode':_0x106b18['sqlCode'],'sqlName':_0x106b18[_0x331ef8(0x95)],'dbId':_0x106b18[_0x331ef8(0xb1)]},_0x29c7f4,{'dbName':_0xf24741,'mode':_0x4508f3,'syncedAt':new Date()[_0x331ef8(0xb7)](),'description':_0x106b18['description']});if(await fileExists(_0x4c181))throw CliErrors['validation'](_0x331ef8(0xa0)+_0x4c181);await ensureParentDirectory(_0x4c181),await writeFile(_0x4c181,_0x166ec0,_0x331ef8(0xa4));const _0x4280f6=await readSqlLockFile(_0x3778c7['lockFilePath']),{lockData:_0x5f3495,appLock:_0x4cd4fb}=ensureSqlLockScope(_0x4280f6??createEmptySqlLock(),_0x3778c7[_0x331ef8(0xaf)],_0x3778c7[_0x331ef8(0xa8)],'new');return _0x4cd4fb['sqls'][_0x106b18[_0x331ef8(0x8a)]]={...buildSqlLockEntry(_0x106b18,_0x29c7f4,computeSqlContentHash(_0x166ec0),{'dbName':_0xf24741}),'path':_0xdfc6b8,'mode':_0x4508f3},_0x4cd4fb[_0x331ef8(0x98)]=new Date()[_0x331ef8(0xb7)](),await writeSqlLockFile(_0x3778c7['lockFilePath'],_0x5f3495),{'ok':!![],'data':{'id':_0x106b18['id'],'sqlCode':_0x106b18[_0x331ef8(0x8a)],'sqlName':_0x106b18['sqlName'],'dbId':_0x106b18['dbId'],'path':_0x4c181,'mode':_0x4508f3},'message':'Created\x20SQL\x20query\x20'+_0x106b18[_0x331ef8(0x8a)]};}};async function resolveSqlNewInputs(_0x12398e){const _0x33510c=await resolveSqlNameInput(_0x12398e),{dbId:_0x4de2fd,dbName:_0x17b9e4}=await resolveDbSelection(_0x12398e),_0x431d4e=await resolveSqlModeInput(_0x12398e);return{'sqlName':_0x33510c,'dbId':_0x4de2fd,'dbName':_0x17b9e4,'mode':_0x431d4e};}function a247_0x26b3(){const _0x5ccf4e=['write','sqlName','POST','SELECT\x201\x20AS\x20id;','lastSync','length','Target\x20database\x20dbId:','flagMissing','4698aVRgok','sql','string','db-id','File\x20already\x20exists:\x20','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','__manual__','/smartapi/custom/saveUserCustomSql','utf8','dbId\x20must\x20be\x20a\x20positive\x20integer','131JpBZtG','<server-generated-sqlCode>','sqlRoot','\x20\x20SELECT\x201\x20AS\x20id','SQL\x20name:','Plain\x20SQL\x20(sql)','mode','nonInteractive','975107hYewkU','appCode','name','dbId','4446959PPgCoM','SQL\x20name\x20cannot\x20be\x20empty','dbId\x20cannot\x20be\x20empty','trim','4602816ryvvgr','toISOString','isInteger','MyBatis\x20XML\x20(mybatisXml)','validation','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','stringify','dbName','171471TzrgDQ','10keOjHU','join','str','number','catch','3682656joxYUp','mybatisXml','isFinite','6EaVdDz','sqlCode','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','✎\x20Enter\x20dbId\x20manually','sqlRootDir','</select>','4POSdKs','Select\x20the\x20target\x20database:','1594775JTjQTD'];a247_0x26b3=function(){return _0x5ccf4e;};return a247_0x26b3();}async function resolveSqlNameInput(_0x58e2c3){const _0x302be0=a247_0x517cef,_0x2166e3=_0x58e2c3['str'](_0x302be0(0xb0))[_0x302be0(0xb5)]();if(_0x2166e3)return _0x2166e3;if(_0x58e2c3['nonInteractive'])throw CliErrors[_0x302be0(0x9b)](_0x302be0(0xb0),_0x302be0(0x8d));return(await input({'message':_0x302be0(0xaa),'validate':_0x52233a=>_0x52233a[_0x302be0(0xb5)]()?!![]:_0x302be0(0xb3)}))['trim']();}async function resolveDbSelection(_0x156a84){const _0x8e88de=a247_0x517cef,_0x5694d6=resolveProvidedDbId(_0x156a84);if(typeof _0x5694d6===_0x8e88de(0x84)&&Number[_0x8e88de(0x88)](_0x5694d6)&&_0x5694d6>0x0)return{'dbId':_0x5694d6,'dbName':await getDbName(_0x156a84[_0x8e88de(0xaf)],_0x5694d6)[_0x8e88de(0x85)](()=>undefined)};if(_0x156a84[_0x8e88de(0xad)])throw CliErrors[_0x8e88de(0x9b)](_0x8e88de(0x9f),_0x8e88de(0x8b));const _0x32064b=await listDatabases(_0x156a84[_0x8e88de(0xaf)])[_0x8e88de(0x85)](()=>[]);if(_0x32064b[_0x8e88de(0x99)]===0x1)return{'dbId':_0x32064b[0x0][_0x8e88de(0xb1)],'dbName':_0x32064b[0x0][_0x8e88de(0x7f)]};if(_0x32064b[_0x8e88de(0x99)]>0x1){const _0x44b7b0=await select({'message':_0x8e88de(0x92),'choices':[..._0x32064b['map'](_0x74d856=>({'name':_0x74d856[_0x8e88de(0x7f)]+'\x20('+_0x74d856[_0x8e88de(0xb1)]+')','value':serializeDbSelection(_0x74d856)})),{'name':_0x8e88de(0x8e),'value':'__manual__'}]});if(_0x44b7b0!==_0x8e88de(0xa2))return deserializeDbSelection(_0x44b7b0);}const _0xa7c522=await input({'message':_0x8e88de(0x9a),'validate':_0x27d20a=>{const _0x1b3f17=_0x8e88de,_0x13e07d=_0x27d20a[_0x1b3f17(0xb5)]();if(!_0x13e07d)return _0x1b3f17(0xb4);const _0x8716b=Number(_0x13e07d);if(!Number[_0x1b3f17(0xb8)](_0x8716b)||_0x8716b<=0x0)return _0x1b3f17(0xa5);return!![];}});return{'dbId':Number(_0xa7c522[_0x8e88de(0xb5)]())};}async function resolveSqlModeInput(_0x117647){const _0x1921a6=a247_0x517cef,_0xdce764=_0x117647['str'](_0x1921a6(0xac))['trim']();if(_0xdce764===_0x1921a6(0x9d)||_0xdce764===_0x1921a6(0x87))return _0xdce764;if(_0x117647[_0x1921a6(0xad)])throw CliErrors[_0x1921a6(0x9b)]('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x1921a6(0xab),'value':_0x1921a6(0x9d),'description':_0x1921a6(0x8c)},{'name':_0x1921a6(0xb9),'value':_0x1921a6(0x87),'description':_0x1921a6(0x7d)}]});}function serializeDbSelection(_0x54c3e5){const _0x459ff4=a247_0x517cef;return JSON[_0x459ff4(0x7e)]({'dbId':_0x54c3e5[_0x459ff4(0xb1)],'dbName':_0x54c3e5[_0x459ff4(0x7f)]});}function deserializeDbSelection(_0x132099){const _0x359386=a247_0x517cef;try{const _0x4c5554=JSON['parse'](_0x132099);if(typeof _0x4c5554['dbId']==='number'&&Number['isFinite'](_0x4c5554[_0x359386(0xb1)]))return{'dbId':_0x4c5554[_0x359386(0xb1)],'dbName':_0x4c5554[_0x359386(0x7f)]};}catch{}throw CliErrors[_0x359386(0xba)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x132099);}function resolveProvidedDbId(_0x572ffc){const _0x384728=a247_0x517cef,_0x237b5d=_0x572ffc['flag'](_0x384728(0x9f));if(typeof _0x237b5d===_0x384728(0x84)&&Number[_0x384728(0x88)](_0x237b5d))return _0x237b5d;return undefined;}
|