@lovrabet/rabetbase-cli 2.5.10-beta.5 → 2.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a232_0x4e91(_0x2e9841,_0x21986e){_0x2e9841=_0x2e9841-0x10c;const _0x1f8a87=a232_0x1f8a();let _0x4e91e6=_0x1f8a87[_0x2e9841];return _0x4e91e6;}function a232_0x1f8a(){const _0x452568=['591124zLLHap','Show\x20a\x20single\x20role\x27s\x20detail','1092VquOVs','33516750FRyKsn','267580nSiqGb','Role\x20','appCode','roleType','read','4211259urSXyM','detail','4PDRzPs','5607RfkpdB','5769834CcEaJI','18952Oeogbu','17060qeegbf','num','roleName'];a232_0x1f8a=function(){return _0x452568;};return a232_0x1f8a();}const a232_0x4f377a=a232_0x4e91;(function(_0x2676ff,_0x2ebc97){const _0x428f56=a232_0x4e91,_0x329522=_0x2676ff();while(!![]){try{const _0x3e1c02=parseInt(_0x428f56(0x11b))/0x1*(-parseInt(_0x428f56(0x110))/0x2)+-parseInt(_0x428f56(0x119))/0x3+parseInt(_0x428f56(0x114))/0x4+parseInt(_0x428f56(0x10d))/0x5*(-parseInt(_0x428f56(0x112))/0x6)+-parseInt(_0x428f56(0x11d))/0x7+-parseInt(_0x428f56(0x10c))/0x8*(-parseInt(_0x428f56(0x11c))/0x9)+parseInt(_0x428f56(0x113))/0xa;if(_0x3e1c02===_0x2ebc97)break;else _0x329522['push'](_0x329522['shift']());}catch(_0x3e5b69){_0x329522['push'](_0x329522['shift']());}}}(a232_0x1f8a,0xd2bea));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':'role','command':a232_0x4f377a(0x11a),'description':a232_0x4f377a(0x111),'risk':a232_0x4f377a(0x118),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x40bfee){const _0x1ba50c=a232_0x4f377a,_0x32ea4f=_0x40bfee[_0x1ba50c(0x10e)]('id'),_0x280fe4=await getRoleById(_0x40bfee[_0x1ba50c(0x116)],_0x32ea4f);return{'ok':!![],'data':{'scope':'dev','role':projectRole(_0x280fe4)},'message':_0x1ba50c(0x115)+_0x280fe4[_0x1ba50c(0x10f)]+'\x20('+_0x280fe4[_0x1ba50c(0x117)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a233_0x5494(){const _0x5523b8=['268404zuUCtN','4613xRYpwO','625816aIFxTF','583749aOKeQI','294955rYnGbd','1595000Yzkyif','3752jcnNLz','1721715lNCZAw'];a233_0x5494=function(){return _0x5523b8;};return a233_0x5494();}(function(_0x52eb9b,_0xca0d4b){const _0x37d751=a233_0x5cde,_0x452477=_0x52eb9b();while(!![]){try{const _0x54cc4e=parseInt(_0x37d751(0x14c))/0x1+-parseInt(_0x37d751(0x14a))/0x2+-parseInt(_0x37d751(0x14b))/0x3+parseInt(_0x37d751(0x14d))/0x4+parseInt(_0x37d751(0x14f))/0x5+parseInt(_0x37d751(0x148))/0x6+-parseInt(_0x37d751(0x149))/0x7*(parseInt(_0x37d751(0x14e))/0x8);if(_0x54cc4e===_0xca0d4b)break;else _0x452477['push'](_0x452477['shift']());}catch(_0x28948b){_0x452477['push'](_0x452477['shift']());}}}(a233_0x5494,0x40fec));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';function a233_0x5cde(_0x14c057,_0x57ee24){_0x14c057=_0x14c057-0x148;const _0x5494e2=a233_0x5494();let _0x5cde3f=_0x5494e2[_0x14c057];return _0x5cde3f;}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_0x151818=a234_0x313f;function a234_0x18f3(){const _0xbb2ad9=['--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','\x20role(s)','Page\x20index\x20(1-based)','Invalid\x20--type\x20\x22','659853yiNkjF','Use\x20one\x20of:\x20','2028750MibRlW','validation','ADMIN','OWNER','8AOYQdy','CUSTOM','Filter\x20by\x20role\x20type','number','list','string','666690CYIBFG','Found\x20','join','page','type','pagesize','Page\x20size\x20(1-100)','map','4333194gFWMyp','2lmuQIc','1717872TXzCjE','trim','11bdcpsW','str','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','includes','filter','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','toUpperCase','21452150gVDZqy','2849360hIVfEd','DEV','14UtrldA','num','roleType'];a234_0x18f3=function(){return _0xbb2ad9;};return a234_0x18f3();}(function(_0x4b7e5b,_0x1cc146){const _0x2e72ee=a234_0x313f,_0x2bebe0=_0x4b7e5b();while(!![]){try{const _0x1f189a=-parseInt(_0x2e72ee(0x189))/0x1+-parseInt(_0x2e72ee(0x192))/0x2*(parseInt(_0x2e72ee(0x17d))/0x3)+parseInt(_0x2e72ee(0x174))/0x4+-parseInt(_0x2e72ee(0x17f))/0x5+-parseInt(_0x2e72ee(0x193))/0x6*(parseInt(_0x2e72ee(0x176))/0x7)+-parseInt(_0x2e72ee(0x183))/0x8*(parseInt(_0x2e72ee(0x191))/0x9)+-parseInt(_0x2e72ee(0x173))/0xa*(-parseInt(_0x2e72ee(0x16c))/0xb);if(_0x1f189a===_0x1cc146)break;else _0x2bebe0['push'](_0x2bebe0['shift']());}catch(_0x48db1f){_0x2bebe0['push'](_0x2bebe0['shift']());}}}(a234_0x18f3,0x7cc62));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a234_0x313f(_0x3b7d02,_0xde5d9c){_0x3b7d02=_0x3b7d02-0x16b;const _0x18f3da=a234_0x18f3();let _0x313f79=_0x18f3da[_0x3b7d02];return _0x313f79;}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a234_0x151818(0x181),a234_0x151818(0x175),a234_0x151818(0x182),a234_0x151818(0x184)];export const roleList={'service':'role','command':a234_0x151818(0x187),'description':a234_0x151818(0x16e),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':a234_0x151818(0x188),'required':![],'description':a234_0x151818(0x185),'enum':ROLE_TYPES},{'name':'page','type':a234_0x151818(0x186),'description':a234_0x151818(0x17b),'default':0x1},{'name':a234_0x151818(0x18e),'type':a234_0x151818(0x186),'description':a234_0x151818(0x18f),'default':0x64}],async 'validate'(_0x663ce3){const _0x383056=a234_0x151818,_0x3cfe0c=_0x663ce3[_0x383056(0x16d)](_0x383056(0x18d))['trim']();if(_0x3cfe0c&&!ROLE_TYPES[_0x383056(0x16f)](_0x3cfe0c[_0x383056(0x172)]()))throw CliErrors[_0x383056(0x180)](_0x383056(0x17c)+_0x3cfe0c+'\x22.',_0x383056(0x17e)+ROLE_TYPES[_0x383056(0x18b)](',\x20')+'.');const _0xe846be=_0x663ce3['num'](_0x383056(0x18c),0x1),_0x333c33=_0x663ce3['num']('pagesize',0x64);if(_0xe846be<0x1)throw CliErrors['validation'](_0x383056(0x171));if(_0x333c33<0x1||_0x333c33>0x64)throw CliErrors[_0x383056(0x180)](_0x383056(0x179));},async 'execute'(_0x587e9d){const _0x4d13d2=a234_0x151818,_0x2def81=_0x587e9d[_0x4d13d2(0x177)](_0x4d13d2(0x18c),0x1)||0x1,_0x407cc8=_0x587e9d[_0x4d13d2(0x177)](_0x4d13d2(0x18e),0x64)||0x64,_0x12e612=_0x587e9d[_0x4d13d2(0x16d)](_0x4d13d2(0x18d))[_0x4d13d2(0x16b)]()[_0x4d13d2(0x172)](),{items:_0x542078,paging:_0x2acf8d}=await listAppRoles(_0x587e9d['appCode'],{'currentPage':_0x2def81,'pageSize':_0x407cc8}),_0x601e29=_0x12e612?_0x542078[_0x4d13d2(0x170)](_0x530b8f=>_0x530b8f[_0x4d13d2(0x178)]===_0x12e612):_0x542078,_0x234784=_0x601e29[_0x4d13d2(0x190)](projectRole);return{'ok':!![],'data':{'scope':'dev','roles':_0x234784,'paging':_0x2acf8d},'message':_0x4d13d2(0x18a)+_0x234784['length']+_0x4d13d2(0x17a)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a235_0x7479(_0x13b43c,_0x4176fd){_0x13b43c=_0x13b43c-0xb7;const _0x22c641=a235_0x22c6();let _0x74796d=_0x22c641[_0x13b43c];return _0x74796d;}const a235_0x341aaf=a235_0x7479;(function(_0xa8c8bc,_0x4c22af){const _0x3faec2=a235_0x7479,_0x253ccf=_0xa8c8bc();while(!![]){try{const _0x5a914e=-parseInt(_0x3faec2(0xf6))/0x1+-parseInt(_0x3faec2(0xcd))/0x2*(parseInt(_0x3faec2(0xba))/0x3)+-parseInt(_0x3faec2(0xf9))/0x4*(-parseInt(_0x3faec2(0xce))/0x5)+parseInt(_0x3faec2(0xc5))/0x6+-parseInt(_0x3faec2(0xe2))/0x7+-parseInt(_0x3faec2(0xc4))/0x8*(-parseInt(_0x3faec2(0xef))/0x9)+parseInt(_0x3faec2(0xf7))/0xa;if(_0x5a914e===_0x4c22af)break;else _0x253ccf['push'](_0x253ccf['shift']());}catch(_0x4170cc){_0x253ccf['push'](_0x253ccf['shift']());}}}(a235_0x22c6,0x68fb8));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':'number','required':!![],'description':a235_0x341aaf(0xc1)};export const ROLE_REF_FLAG={'name':a235_0x341aaf(0xdb),'type':'string','required':!![],'description':a235_0x341aaf(0xff)};export const USER_REF_FLAG={'name':a235_0x341aaf(0xca),'type':a235_0x341aaf(0xd7),'required':!![],'description':a235_0x341aaf(0xec)};export const NAME_FLAG={'name':'name','type':'string','required':!![],'description':a235_0x341aaf(0xd9)};export const USER_NAME_FLAG={'name':'name','type':a235_0x341aaf(0xd7),'required':!![],'description':a235_0x341aaf(0xf3)};export const REMARK_FLAG={'name':a235_0x341aaf(0xe4),'type':a235_0x341aaf(0xd7),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x341aaf(0xfb),'type':'number','required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};function a235_0x22c6(){const _0x3bf5c2=['Check\x20the\x20nickname/username.\x20','Pass\x20--user\x20<id|name>.','validation','\x20member(s)\x20but\x20role\x20has\x20','Role\x20name\x20\x22','\x22\x20not\x20found\x20in\x20app\x20','filter','userId','string','find','Role\x20name','nickname','role','toLowerCase','trim','CUSTOM','user-add','OWNER','totalCount','5584488KajItS','Cannot\x20','remark','tenant_code','\x22:\x20','tenant','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Anti-drift\x20check\x20failed:\x20expected\x20','\x20built-in\x20role\x20','test','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','str','roleType','594gUuLsl','join','appCode','Role\x20id\x20','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','dev','/smartapi/permit/user-role/delete','325044reDWRR','5066890GuVdAF','permitCount','693580ezacLa','flag','expect-user-count','name','length','username','Role\x20id\x20or\x20exact\x20role\x20name','Missing\x20user\x20reference.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Pass\x20--role\x20<id|name>.','dryRun','DEV','Removed\x20','POST','ADMIN','134571VHOwbY','includes','expectUserCount','map','flagMissing','User\x20','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Role\x20id\x20(from\x20`role\x20list`)','push','No\x20tenant\x20member\x20matches\x20\x22','84616WbySCi','80046wpSkyK','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Pass\x20--user\x20<id>.',';\x20no\x20change.','user','roleName','Multiple\x20tenant\x20members\x20match\x20\x22','16jGdsGO','20qsyNsj'];a235_0x22c6=function(){return _0x3bf5c2;};return a235_0x22c6();}export const BUILTIN_ROLE_TYPES=[a235_0x341aaf(0xb9),a235_0x341aaf(0x104),a235_0x341aaf(0xe0)];export function isBuiltinRole(_0xb34b22){const _0x158b65=a235_0x341aaf;return BUILTIN_ROLE_TYPES[_0x158b65(0xbb)](_0xb34b22);}export function assertCustomRole(_0x55ae41,_0xc7b1e){const _0x3d1982=a235_0x341aaf;if(_0x55ae41[_0x3d1982(0xee)]!==_0x3d1982(0xde))throw CliErrors[_0x3d1982(0xd1)](_0x3d1982(0xe3)+_0xc7b1e+_0x3d1982(0xea)+_0x55ae41['roleName']+'\x20('+_0x55ae41[_0x3d1982(0xee)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0x677094){const _0x526e3f=a235_0x341aaf;return{'id':_0x677094['id'],'roleName':_0x677094['roleName'],'roleType':_0x677094[_0x526e3f(0xee)],'remark':_0x677094[_0x526e3f(0xe4)],'userCount':_0x677094['userCount'],'permitCount':_0x677094[_0x526e3f(0xf8)],'builtin':isBuiltinRole(_0x677094[_0x526e3f(0xee)])};}export async function resolveRoleRef(_0x250b4c,_0x13abf5){const _0x49873b=a235_0x341aaf,_0x3a69ab=_0x13abf5[_0x49873b(0xdd)]();if(!_0x3a69ab)throw CliErrors[_0x49873b(0xd1)]('Missing\x20role\x20reference.',_0x49873b(0x102));if(/^\d+$/[_0x49873b(0xeb)](_0x3a69ab))return getRoleById(_0x250b4c,Number(_0x3a69ab));const _0x55df59=await listAllAppRoles(_0x250b4c),_0x55eafd=_0x55df59[_0x49873b(0xd5)](_0x2c3f7c=>_0x2c3f7c[_0x49873b(0xcb)]===_0x3a69ab);if(_0x55eafd[_0x49873b(0xfd)]===0x0)throw CliErrors[_0x49873b(0xd1)](_0x49873b(0xd3)+_0x3a69ab+_0x49873b(0xd4)+_0x250b4c+'.',_0x49873b(0x101));if(_0x55eafd[_0x49873b(0xfd)]>0x1){const _0x228e41=_0x55eafd[_0x49873b(0xbd)](_0x3337aa=>_0x3337aa['id'])[_0x49873b(0xf0)](',\x20');throw CliErrors[_0x49873b(0xd1)](_0x49873b(0xd3)+_0x3a69ab+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x228e41+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x55eafd[0x0];}export async function getRoleById(_0x1a3723,_0xf0b31f){const _0x546671=a235_0x341aaf,_0x1b2148=await listAllAppRoles(_0x1a3723),_0x4ff432=_0x1b2148[_0x546671(0xd5)](_0x1c07dc=>_0x1c07dc['id']===_0xf0b31f&&(!_0x1c07dc[_0x546671(0xf1)]||_0x1c07dc[_0x546671(0xf1)]===_0x1a3723));if(_0x4ff432[_0x546671(0xfd)]!==0x1)throw CliErrors[_0x546671(0xd1)](_0x546671(0xf2)+_0xf0b31f+'\x20not\x20found\x20in\x20app\x20'+_0x1a3723+'.',_0x546671(0xe8));return _0x4ff432[0x0];}async function listAllAppRoles(_0x12cdc4){const _0x108bdb=a235_0x341aaf,_0xda289c=0x64,_0x93e449=[];for(let _0x1b0a2e=0x1;;_0x1b0a2e+=0x1){const {items:_0x8f6a4d,paging:_0x22f4bc}=await listAppRoles(_0x12cdc4,{'currentPage':_0x1b0a2e,'pageSize':_0xda289c});_0x93e449[_0x108bdb(0xc2)](..._0x8f6a4d);if(_0x8f6a4d[_0x108bdb(0xfd)]<_0xda289c||_0x22f4bc&&_0x93e449[_0x108bdb(0xfd)]>=_0x22f4bc[_0x108bdb(0xe1)])return _0x93e449;}}export async function resolveTenantCode(){const _0x30b9a9=a235_0x341aaf,_0x826ebb=await getSessionUserInfo(),_0x269ca7=_0x826ebb?.[_0x30b9a9(0xca)]?.[_0x30b9a9(0xe7)]?.[_0x30b9a9(0xe5)];if(!_0x269ca7)throw CliErrors['authRequired'](_0x30b9a9(0xc7));return _0x269ca7;}function matchMember(_0x4542d4,_0x1a0bb6){const _0x8f3406=a235_0x341aaf,_0x19eba0=_0x1a0bb6[_0x8f3406(0xdd)]()[_0x8f3406(0xdc)]();return(_0x4542d4['nickname']??'')[_0x8f3406(0xdc)]()===_0x19eba0||(_0x4542d4[_0x8f3406(0xfe)]??'')['toLowerCase']()===_0x19eba0;}export async function resolveUserRef(_0x5cac08,_0x42f662=a235_0x341aaf(0xc8)){const _0x44a007=a235_0x341aaf,_0x546ffa=_0x5cac08['trim']();if(!_0x546ffa)throw CliErrors['validation'](_0x44a007(0x100),_0x44a007(0xd0));const _0x454cc1=await resolveTenantCode(),_0xb9cc9e=await getTenantMembers(_0x454cc1);if(/^\d+$/['test'](_0x546ffa)){const _0x2d73a1=Number(_0x546ffa),_0x4b7c1b=_0xb9cc9e[_0x44a007(0xd8)](_0x3529ff=>_0x3529ff[_0x44a007(0xd6)]===_0x2d73a1);return{'userId':_0x2d73a1,'username':_0x4b7c1b?.[_0x44a007(0xfe)]??String(_0x2d73a1),'nickname':_0x4b7c1b?.[_0x44a007(0xda)],'matchedBy':'id'};}const _0x58b9e2=_0xb9cc9e[_0x44a007(0xd5)](_0x1bc181=>matchMember(_0x1bc181,_0x546ffa));if(_0x58b9e2['length']===0x0)throw CliErrors[_0x44a007(0xd1)](_0x44a007(0xc3)+_0x546ffa+'\x22.',_0x44a007(0xcf)+_0x42f662);if(_0x58b9e2[_0x44a007(0xfd)]>0x1){const _0x32b3a7=_0x58b9e2['map'](_0x4d96cc=>(_0x4d96cc[_0x44a007(0xda)]??_0x4d96cc[_0x44a007(0xfe)]??'?')+'('+_0x4d96cc[_0x44a007(0xd6)]+')')['join'](',\x20');throw CliErrors['validation'](_0x44a007(0xcc)+_0x546ffa+_0x44a007(0xe6)+_0x32b3a7+'.',_0x42f662);}const _0x1ea73d=_0x58b9e2[0x0];return{'userId':_0x1ea73d[_0x44a007(0xd6)],'username':_0x1ea73d['username']??String(_0x1ea73d[_0x44a007(0xd6)]),'nickname':_0x1ea73d[_0x44a007(0xda)],'matchedBy':_0x44a007(0xfc)};}export const CREATE_USER_ROLE_PATH='/smartapi/permit/user-role/create';export const DELETE_USER_ROLE_PATH=a235_0x341aaf(0xf5);export function computeRoleUserMutation(_0x435df8){const _0x5b8409=a235_0x341aaf,{operation:_0x5a10ae,appCode:_0x4bb0ab,role:_0x366064,relations:_0xdf7af,user:_0x42902b}=_0x435df8,_0xd6b2b2=[...new Set(_0xdf7af['map'](_0x229cc9=>_0x229cc9['userId']))],_0x31b3d9=[];if(_0x435df8[_0x5b8409(0xbc)]!==undefined&&_0x435df8[_0x5b8409(0xbc)]!==_0xd6b2b2[_0x5b8409(0xfd)])throw CliErrors[_0x5b8409(0xd1)](_0x5b8409(0xe9)+_0x435df8[_0x5b8409(0xbc)]+_0x5b8409(0xd2)+_0xd6b2b2['length']+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x9a1c9e=_0xd6b2b2[_0x5b8409(0xbb)](_0x42902b[_0x5b8409(0xd6)]),_0x2f4e71=_0xdf7af['filter'](_0x31ed85=>_0x31ed85['userId']===_0x42902b['userId'])[_0x5b8409(0xbd)](_0x41fffb=>_0x41fffb['id']),_0x6eabdb=_0x5a10ae===_0x5b8409(0xdf)?!_0x9a1c9e:_0x9a1c9e;let _0xa75a26=_0xd6b2b2;_0x5a10ae==='user-add'?_0x9a1c9e?_0x31b3d9[_0x5b8409(0xc2)]('User\x20'+_0x42902b[_0x5b8409(0xd6)]+_0x5b8409(0xc6)+_0x366064[_0x5b8409(0xcb)]+';\x20no\x20change.'):_0xa75a26=[..._0xd6b2b2,_0x42902b[_0x5b8409(0xd6)]]:!_0x9a1c9e?_0x31b3d9[_0x5b8409(0xc2)](_0x5b8409(0xbf)+_0x42902b['userId']+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x366064['roleName']+_0x5b8409(0xc9)):(_0xa75a26=_0xd6b2b2[_0x5b8409(0xd5)](_0x48d310=>_0x48d310!==_0x42902b['userId']),_0x2f4e71[_0x5b8409(0xfd)]>0x1&&_0x31b3d9[_0x5b8409(0xc2)](_0x5b8409(0xb7)+_0x2f4e71[_0x5b8409(0xfd)]+'\x20duplicate\x20memberships\x20for\x20user\x20'+_0x42902b['userId']+'.'));const _0x1dd22c={'scope':_0x5b8409(0xf4),'operation':_0x5a10ae,'selector':{'appCode':_0x4bb0ab,'roleId':_0x366064['id'],'roleName':_0x366064['roleName'],'userId':_0x42902b[_0x5b8409(0xd6)]},'before':{'userIds':_0xd6b2b2},'after':{'userIds':_0xa75a26},'dryRun':_0x435df8[_0x5b8409(0x103)],'backend':{'method':_0x5b8409(0xb8),'path':_0x5a10ae==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x31b3d9};return{'mutation':_0x1dd22c,'changed':_0x6eabdb,'matchingRelationIds':_0x2f4e71};}export async function loadDevRoleRelations(_0x4c3780,_0x265c87){const _0x6d192a=a235_0x341aaf,_0x373e3f=0x64,_0x1036d8=[];for(let _0x15c5b4=0x1;;_0x15c5b4+=0x1){const {items:_0x213733,paging:_0x5a8dc3}=await listDevUserRoleRelations(_0x4c3780,{'roleId':_0x265c87,'currentPage':_0x15c5b4,'pageSize':_0x373e3f});_0x1036d8[_0x6d192a(0xc2)](..._0x213733);if(_0x213733[_0x6d192a(0xfd)]<_0x373e3f||_0x5a8dc3&&_0x1036d8[_0x6d192a(0xfd)]>=_0x5a8dc3[_0x6d192a(0xe1)])return _0x1036d8;}}export function readRoleRef(_0x880e78){const _0x4a047b=a235_0x341aaf,_0x2e098b=_0x880e78[_0x4a047b(0xed)](_0x4a047b(0xdb))[_0x4a047b(0xdd)]();if(!_0x2e098b)throw CliErrors[_0x4a047b(0xbe)](_0x4a047b(0xdb),_0x4a047b(0x102));return _0x2e098b;}export async function prepareUserMutation(_0x2509fc,_0x244e84,_0x247963){const _0x2e4c51=a235_0x341aaf,_0x5c0d16=readRoleRef(_0x2509fc),_0xf956a2=_0x2509fc[_0x2e4c51(0xed)](_0x2e4c51(0xca))[_0x2e4c51(0xdd)]();if(!_0xf956a2)throw CliErrors[_0x2e4c51(0xbe)](_0x2e4c51(0xca),'Pass\x20--user\x20<id|name>.');const _0x4259ca=_0x2509fc[_0x2e4c51(0xfa)]('expect-user-count'),_0x31da9a=_0x4259ca===undefined||_0x4259ca===null?undefined:Number(_0x4259ca),_0x3b38d1=await resolveRoleRef(_0x2509fc[_0x2e4c51(0xf1)],_0x5c0d16);if(_0x3b38d1[_0x2e4c51(0xee)]===_0x2e4c51(0xe0))throw CliErrors[_0x2e4c51(0xd1)](_0x2e4c51(0xe3)+_0x244e84+'\x20members\x20of\x20the\x20OWNER\x20role.',_0x2e4c51(0xc0));const _0x12b068=await resolveUserRef(_0xf956a2),_0x10a353=await loadDevRoleRelations(_0x2509fc['appCode'],_0x3b38d1['id']);return{...computeRoleUserMutation({'operation':_0x244e84,'appCode':_0x2509fc[_0x2e4c51(0xf1)],'role':_0x3b38d1,'relations':_0x10a353,'user':{'userId':_0x12b068['userId'],'username':_0x12b068[_0x2e4c51(0xfe)],'nickname':_0x12b068['nickname']},'dryRun':_0x247963,..._0x31da9a!==undefined?{'expectUserCount':_0x31da9a}:{}}),'role':_0x3b38d1,'user':_0x12b068};}
|
|
1
|
+
const a235_0x4704d6=a235_0x1601;(function(_0x52491c,_0x1320c8){const _0x10df1f=a235_0x1601,_0x1f4d4f=_0x52491c();while(!![]){try{const _0x5340bd=-parseInt(_0x10df1f(0x168))/0x1*(parseInt(_0x10df1f(0x188))/0x2)+parseInt(_0x10df1f(0x14e))/0x3+parseInt(_0x10df1f(0x17d))/0x4*(-parseInt(_0x10df1f(0x13b))/0x5)+parseInt(_0x10df1f(0x13d))/0x6+-parseInt(_0x10df1f(0x179))/0x7*(-parseInt(_0x10df1f(0x145))/0x8)+parseInt(_0x10df1f(0x14c))/0x9+parseInt(_0x10df1f(0x173))/0xa;if(_0x5340bd===_0x1320c8)break;else _0x1f4d4f['push'](_0x1f4d4f['shift']());}catch(_0x373e1d){_0x1f4d4f['push'](_0x1f4d4f['shift']());}}}(a235_0xea02,0x378dc));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_0x4704d6(0x15b),'required':!![],'description':a235_0x4704d6(0x164)};export const ROLE_REF_FLAG={'name':'role','type':a235_0x4704d6(0x17f),'required':!![],'description':a235_0x4704d6(0x14f)};export const USER_REF_FLAG={'name':a235_0x4704d6(0x153),'type':'string','required':!![],'description':a235_0x4704d6(0x182)};export const NAME_FLAG={'name':a235_0x4704d6(0x185),'type':a235_0x4704d6(0x17f),'required':!![],'description':a235_0x4704d6(0x15e)};export const USER_NAME_FLAG={'name':a235_0x4704d6(0x185),'type':a235_0x4704d6(0x17f),'required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a235_0x4704d6(0x141),'type':a235_0x4704d6(0x17f),'required':![],'description':a235_0x4704d6(0x140)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a235_0x4704d6(0x15b),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a235_0x4704d6(0x181),a235_0x4704d6(0x169),a235_0x4704d6(0x15a)];export function isBuiltinRole(_0x2ed7ec){const _0x1256b1=a235_0x4704d6;return BUILTIN_ROLE_TYPES[_0x1256b1(0x13c)](_0x2ed7ec);}export function assertCustomRole(_0x1a0f65,_0x527a24){const _0x2b5fa3=a235_0x4704d6;if(_0x1a0f65['roleType']!==_0x2b5fa3(0x155))throw CliErrors[_0x2b5fa3(0x171)](_0x2b5fa3(0x158)+_0x527a24+_0x2b5fa3(0x160)+_0x1a0f65['roleName']+'\x20('+_0x1a0f65[_0x2b5fa3(0x152)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0x42205f){const _0x42957f=a235_0x4704d6;return{'id':_0x42205f['id'],'roleName':_0x42205f[_0x42957f(0x146)],'roleType':_0x42205f['roleType'],'remark':_0x42205f['remark'],'userCount':_0x42205f[_0x42957f(0x142)],'permitCount':_0x42205f['permitCount'],'builtin':isBuiltinRole(_0x42205f['roleType'])};}export async function resolveRoleRef(_0x1d26de,_0x3c2770){const _0x254879=a235_0x4704d6,_0x13bc8b=_0x3c2770[_0x254879(0x170)]();if(!_0x13bc8b)throw CliErrors[_0x254879(0x171)](_0x254879(0x167),'Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x13bc8b))return getRoleById(_0x1d26de,Number(_0x13bc8b));const _0x31be14=await listAllAppRoles(_0x1d26de),_0x1e5ddf=_0x31be14['filter'](_0x415245=>_0x415245[_0x254879(0x146)]===_0x13bc8b);if(_0x1e5ddf[_0x254879(0x13e)]===0x0)throw CliErrors[_0x254879(0x171)](_0x254879(0x144)+_0x13bc8b+'\x22\x20not\x20found\x20in\x20app\x20'+_0x1d26de+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x1e5ddf[_0x254879(0x13e)]>0x1){const _0x3fa095=_0x1e5ddf[_0x254879(0x138)](_0x278122=>_0x278122['id'])[_0x254879(0x183)](',\x20');throw CliErrors[_0x254879(0x171)]('Role\x20name\x20\x22'+_0x13bc8b+_0x254879(0x17a)+_0x3fa095+').',_0x254879(0x14d));}return _0x1e5ddf[0x0];}export async function getRoleById(_0x30c368,_0x444f71){const _0x3ab03b=a235_0x4704d6,_0x22a0d0=await listAllAppRoles(_0x30c368),_0xce9043=_0x22a0d0[_0x3ab03b(0x151)](_0x3ce0cb=>_0x3ce0cb['id']===_0x444f71&&(!_0x3ce0cb[_0x3ab03b(0x178)]||_0x3ce0cb['appCode']===_0x30c368));if(_0xce9043[_0x3ab03b(0x13e)]!==0x1)throw CliErrors[_0x3ab03b(0x171)](_0x3ab03b(0x17c)+_0x444f71+_0x3ab03b(0x175)+_0x30c368+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0xce9043[0x0];}async function listAllAppRoles(_0x103ef4){const _0x2d7fa6=a235_0x4704d6,_0x31cc35=0x64,_0x10297c=[];for(let _0x2cb0d0=0x1;;_0x2cb0d0+=0x1){const {items:_0xebdba4,paging:_0xc791fb}=await listAppRoles(_0x103ef4,{'currentPage':_0x2cb0d0,'pageSize':_0x31cc35});_0x10297c['push'](..._0xebdba4);if(_0xebdba4[_0x2d7fa6(0x13e)]<_0x31cc35||_0xc791fb&&_0x10297c['length']>=_0xc791fb['totalCount'])return _0x10297c;}}export async function resolveTenantCode(){const _0x48b6f2=a235_0x4704d6,_0x4d688a=await getSessionUserInfo(),_0x598fc7=_0x4d688a?.['user']?.[_0x48b6f2(0x147)]?.[_0x48b6f2(0x15c)];if(!_0x598fc7)throw CliErrors[_0x48b6f2(0x16f)](_0x48b6f2(0x174));return _0x598fc7;}function matchMember(_0xc52cac,_0x47afbd){const _0x37ec97=a235_0x4704d6,_0x5585b6=_0x47afbd[_0x37ec97(0x170)]()[_0x37ec97(0x14b)]();return(_0xc52cac[_0x37ec97(0x186)]??'')[_0x37ec97(0x14b)]()===_0x5585b6||(_0xc52cac[_0x37ec97(0x166)]??'')[_0x37ec97(0x14b)]()===_0x5585b6;}export async function resolveUserRef(_0x3232a7,_0x49773d=a235_0x4704d6(0x17e)){const _0x1ced8b=a235_0x4704d6,_0x450de8=_0x3232a7['trim']();if(!_0x450de8)throw CliErrors[_0x1ced8b(0x171)](_0x1ced8b(0x184),_0x1ced8b(0x157));const _0x4a1aa2=await resolveTenantCode(),_0x3a7898=await getTenantMembers(_0x4a1aa2);if(/^\d+$/[_0x1ced8b(0x139)](_0x450de8)){const _0x3a0772=Number(_0x450de8),_0x5e9712=_0x3a7898[_0x1ced8b(0x16d)](_0xc5469d=>_0xc5469d[_0x1ced8b(0x162)]===_0x3a0772);return{'userId':_0x3a0772,'username':_0x5e9712?.[_0x1ced8b(0x166)]??String(_0x3a0772),'nickname':_0x5e9712?.[_0x1ced8b(0x186)],'matchedBy':'id'};}const _0x422e38=_0x3a7898[_0x1ced8b(0x151)](_0x315434=>matchMember(_0x315434,_0x450de8));if(_0x422e38['length']===0x0)throw CliErrors[_0x1ced8b(0x171)](_0x1ced8b(0x154)+_0x450de8+'\x22.','Check\x20the\x20nickname/username.\x20'+_0x49773d);if(_0x422e38[_0x1ced8b(0x13e)]>0x1){const _0x215f8e=_0x422e38[_0x1ced8b(0x138)](_0x1525b5=>(_0x1525b5['nickname']??_0x1525b5[_0x1ced8b(0x166)]??'?')+'('+_0x1525b5['userId']+')')['join'](',\x20');throw CliErrors[_0x1ced8b(0x171)](_0x1ced8b(0x180)+_0x450de8+'\x22:\x20'+_0x215f8e+'.',_0x49773d);}const _0x8c0a6=_0x422e38[0x0];return{'userId':_0x8c0a6[_0x1ced8b(0x162)],'username':_0x8c0a6[_0x1ced8b(0x166)]??String(_0x8c0a6['userId']),'nickname':_0x8c0a6[_0x1ced8b(0x186)],'matchedBy':_0x1ced8b(0x185)};}export const CREATE_USER_ROLE_PATH=a235_0x4704d6(0x187);export const DELETE_USER_ROLE_PATH=a235_0x4704d6(0x149);export function computeRoleUserMutation(_0x7ebbdc){const _0x55b616=a235_0x4704d6,{operation:_0x48cbf7,appCode:_0x222114,role:_0x23bbdb,relations:_0x4a74eb,user:_0x2802fd}=_0x7ebbdc,_0x20a675=[...new Set(_0x4a74eb['map'](_0x57b7b6=>_0x57b7b6[_0x55b616(0x162)]))],_0x3e393c=[];if(_0x7ebbdc['expectUserCount']!==undefined&&_0x7ebbdc[_0x55b616(0x177)]!==_0x20a675[_0x55b616(0x13e)])throw CliErrors['validation'](_0x55b616(0x148)+_0x7ebbdc['expectUserCount']+_0x55b616(0x161)+_0x20a675[_0x55b616(0x13e)]+'.',_0x55b616(0x159));const _0x1ee467=_0x20a675[_0x55b616(0x13c)](_0x2802fd[_0x55b616(0x162)]),_0x4103e8=_0x4a74eb[_0x55b616(0x151)](_0x488c75=>_0x488c75[_0x55b616(0x162)]===_0x2802fd[_0x55b616(0x162)])[_0x55b616(0x138)](_0x406ce9=>_0x406ce9['id']),_0x48c782=_0x48cbf7==='user-add'?!_0x1ee467:_0x1ee467;let _0x16f70f=_0x20a675;_0x48cbf7==='user-add'?_0x1ee467?_0x3e393c[_0x55b616(0x176)](_0x55b616(0x163)+_0x2802fd[_0x55b616(0x162)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x23bbdb['roleName']+';\x20no\x20change.'):_0x16f70f=[..._0x20a675,_0x2802fd[_0x55b616(0x162)]]:!_0x1ee467?_0x3e393c[_0x55b616(0x176)](_0x55b616(0x163)+_0x2802fd['userId']+_0x55b616(0x165)+_0x23bbdb['roleName']+_0x55b616(0x17b)):(_0x16f70f=_0x20a675[_0x55b616(0x151)](_0x19ff70=>_0x19ff70!==_0x2802fd[_0x55b616(0x162)]),_0x4103e8[_0x55b616(0x13e)]>0x1&&_0x3e393c[_0x55b616(0x176)](_0x55b616(0x16e)+_0x4103e8[_0x55b616(0x13e)]+_0x55b616(0x13a)+_0x2802fd[_0x55b616(0x162)]+'.'));const _0x340805={'scope':_0x55b616(0x15d),'operation':_0x48cbf7,'selector':{'appCode':_0x222114,'roleId':_0x23bbdb['id'],'roleName':_0x23bbdb[_0x55b616(0x146)],'userId':_0x2802fd[_0x55b616(0x162)]},'before':{'userIds':_0x20a675},'after':{'userIds':_0x16f70f},'dryRun':_0x7ebbdc[_0x55b616(0x143)],'backend':{'method':_0x55b616(0x13f),'path':_0x48cbf7==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x3e393c};return{'mutation':_0x340805,'changed':_0x48c782,'matchingRelationIds':_0x4103e8};}export async function loadDevRoleRelations(_0x921e68,_0x29f61a){const _0x59ff33=a235_0x4704d6,_0x4442f4=0x64,_0x25bd0d=[];for(let _0x3eaa99=0x1;;_0x3eaa99+=0x1){const {items:_0x5e444c,paging:_0x4f0910}=await listDevUserRoleRelations(_0x921e68,{'roleId':_0x29f61a,'currentPage':_0x3eaa99,'pageSize':_0x4442f4});_0x25bd0d['push'](..._0x5e444c);if(_0x5e444c[_0x59ff33(0x13e)]<_0x4442f4||_0x4f0910&&_0x25bd0d[_0x59ff33(0x13e)]>=_0x4f0910[_0x59ff33(0x172)])return _0x25bd0d;}}function a235_0xea02(){const _0x513f97=['Removed\x20','authRequired','trim','validation','totalCount','753370NWfTgR','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','\x20not\x20found\x20in\x20app\x20','push','expectUserCount','appCode','91126CMMgbz','\x22\x20is\x20ambiguous\x20(ids:\x20',';\x20no\x20change.','Role\x20id\x20','3372FZyCnl','Pass\x20--user\x20<id>.','string','Multiple\x20tenant\x20members\x20match\x20\x22','ADMIN','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','join','Missing\x20user\x20reference.','name','nickname','/smartapi/permit/user-role/create','5962SAEDPB','Pass\x20--role\x20<id|name>.','map','test','\x20duplicate\x20memberships\x20for\x20user\x20','2515saRrxj','includes','796254WLBWLS','length','POST','Optional\x20role\x20remark/description','remark','userCount','dryRun','Role\x20name\x20\x22','112PFLZPT','roleName','tenant','Anti-drift\x20check\x20failed:\x20expected\x20','/smartapi/permit/user-role/delete','\x20members\x20of\x20the\x20OWNER\x20role.','toLowerCase','400311hlpbUe','Disambiguate\x20with\x20--role\x20<id>.','1258524axUfIW','Role\x20id\x20or\x20exact\x20role\x20name','flag','filter','roleType','user','No\x20tenant\x20member\x20matches\x20\x22','CUSTOM','role','Pass\x20--user\x20<id|name>.','Cannot\x20','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','OWNER','number','tenant_code','dev','Role\x20name','flagMissing','\x20built-in\x20role\x20','\x20member(s)\x20but\x20role\x20has\x20','userId','User\x20','Role\x20id\x20(from\x20`role\x20list`)','\x20is\x20not\x20a\x20member\x20of\x20role\x20','username','Missing\x20role\x20reference.','68buiPAL','DEV','expect-user-count','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','str','find'];a235_0xea02=function(){return _0x513f97;};return a235_0xea02();}export function readRoleRef(_0x1022aa){const _0x151602=a235_0x4704d6,_0x751e4d=_0x1022aa['str'](_0x151602(0x156))[_0x151602(0x170)]();if(!_0x751e4d)throw CliErrors[_0x151602(0x15f)](_0x151602(0x156),_0x151602(0x189));return _0x751e4d;}function a235_0x1601(_0x5206d4,_0x5abf7e){_0x5206d4=_0x5206d4-0x138;const _0xea0229=a235_0xea02();let _0x1601dc=_0xea0229[_0x5206d4];return _0x1601dc;}export async function prepareUserMutation(_0x33d5d3,_0x59515b,_0x414906){const _0x4cd48e=a235_0x4704d6,_0x202088=readRoleRef(_0x33d5d3),_0x5b2632=_0x33d5d3[_0x4cd48e(0x16c)](_0x4cd48e(0x153))[_0x4cd48e(0x170)]();if(!_0x5b2632)throw CliErrors[_0x4cd48e(0x15f)](_0x4cd48e(0x153),_0x4cd48e(0x157));const _0x2f38cb=_0x33d5d3[_0x4cd48e(0x150)](_0x4cd48e(0x16a)),_0x537d5f=_0x2f38cb===undefined||_0x2f38cb===null?undefined:Number(_0x2f38cb),_0xedb88b=await resolveRoleRef(_0x33d5d3[_0x4cd48e(0x178)],_0x202088);if(_0xedb88b[_0x4cd48e(0x152)]==='OWNER')throw CliErrors[_0x4cd48e(0x171)](_0x4cd48e(0x158)+_0x59515b+_0x4cd48e(0x14a),_0x4cd48e(0x16b));const _0x3c4c4b=await resolveUserRef(_0x5b2632),_0x29c8d8=await loadDevRoleRelations(_0x33d5d3[_0x4cd48e(0x178)],_0xedb88b['id']);return{...computeRoleUserMutation({'operation':_0x59515b,'appCode':_0x33d5d3['appCode'],'role':_0xedb88b,'relations':_0x29c8d8,'user':{'userId':_0x3c4c4b['userId'],'username':_0x3c4c4b[_0x4cd48e(0x166)],'nickname':_0x3c4c4b['nickname']},'dryRun':_0x414906,..._0x537d5f!==undefined?{'expectUserCount':_0x537d5f}:{}}),'role':_0xedb88b,'user':_0x3c4c4b};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a236_0x2127e1=a236_0x4699;(function(_0x5c0ac8,_0x42cc50){const _0x2ca8b0=a236_0x4699,_0x158a71=_0x5c0ac8();while(!![]){try{const _0x4236c8=parseInt(_0x2ca8b0(0x85))/0x1+parseInt(_0x2ca8b0(0x77))/0x2*(-parseInt(_0x2ca8b0(0x7f))/0x3)+parseInt(_0x2ca8b0(0x88))/0x4*(parseInt(_0x2ca8b0(0x70))/0x5)+parseInt(_0x2ca8b0(0x7c))/0x6*(-parseInt(_0x2ca8b0(0x79))/0x7)+-parseInt(_0x2ca8b0(0x8b))/0x8*(parseInt(_0x2ca8b0(0x71))/0x9)+parseInt(_0x2ca8b0(0x83))/0xa+parseInt(_0x2ca8b0(0x8d))/0xb;if(_0x4236c8===_0x42cc50)break;else _0x158a71['push'](_0x158a71['shift']());}catch(_0x35adb7){_0x158a71['push'](_0x158a71['shift']());}}}(a236_0x582f,0xc3901));import{updateAppRole}from'../../core/api-client.js';function a236_0x582f(){const _0x134653=['num','56593aICMtu','write','flag','380JjVkHz','validation','/smartapi/permit/role/update','8ZgyLDU','appCode','27938669XZsTVF','POST','19905VWQVqW','7884603AknTDH','dev','trim','role','--name\x20cannot\x20be\x20empty.','remark','2SKoNCM','name','7UIXLPH','update','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','4950234RiKlZS','\x20(id=','Nothing\x20to\x20update.','3959088tjcTZP','Updated\x20role\x20','New\x20role\x20name','roleName','8471600cTUidE'];a236_0x582f=function(){return _0x134653;};return a236_0x582f();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a236_0x2127e1(0x8a);function a236_0x4699(_0x420bdc,_0xf94d56){_0x420bdc=_0x420bdc-0x70;const _0x582fe6=a236_0x582f();let _0x469930=_0x582fe6[_0x420bdc];return _0x469930;}function readPatch(_0x53332c){const _0x110259=a236_0x2127e1,_0xf9351a=_0x53332c[_0x110259(0x87)](_0x110259(0x78)),_0x3499ee=_0x53332c[_0x110259(0x87)](_0x110259(0x76)),_0x26ed43={};if(_0xf9351a!==undefined&&_0xf9351a!==null){const _0x42e256=String(_0xf9351a)[_0x110259(0x73)]();if(!_0x42e256)throw CliErrors['validation'](_0x110259(0x75));if(_0x42e256['length']>0x40)throw CliErrors['validation']('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x26ed43[_0x110259(0x82)]=_0x42e256;}_0x3499ee!==undefined&&_0x3499ee!==null&&(_0x26ed43[_0x110259(0x76)]=String(_0x3499ee));if(_0x26ed43[_0x110259(0x82)]===undefined&&_0x26ed43[_0x110259(0x76)]===undefined)throw CliErrors[_0x110259(0x89)](_0x110259(0x7e),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x26ed43;}export const roleUpdate={'service':a236_0x2127e1(0x74),'command':a236_0x2127e1(0x7a),'description':a236_0x2127e1(0x7b),'risk':a236_0x2127e1(0x86),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0x2127e1(0x78),'type':'string','required':![],'description':a236_0x2127e1(0x81)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x135ed7){readPatch(_0x135ed7);},async 'dryRun'(_0x4e9ab4){const _0x1244f2=a236_0x2127e1,_0x5e7355=_0x4e9ab4[_0x1244f2(0x84)]('id'),_0x4d1e05=readPatch(_0x4e9ab4),_0x4b1b80=await getRoleById(_0x4e9ab4[_0x1244f2(0x8c)],_0x5e7355);return assertCustomRole(_0x4b1b80,_0x1244f2(0x7a)),asDryRunResult({'scope':_0x1244f2(0x72),'operation':_0x1244f2(0x7a),'selector':{'appCode':_0x4e9ab4['appCode'],'roleId':_0x5e7355,'roleName':_0x4b1b80[_0x1244f2(0x82)]},'before':projectRole(_0x4b1b80),'after':projectRole({..._0x4b1b80,..._0x4d1e05[_0x1244f2(0x82)]!==undefined?{'roleName':_0x4d1e05['roleName']}:{},..._0x4d1e05['remark']!==undefined?{'remark':_0x4d1e05[_0x1244f2(0x76)]}:{}}),'dryRun':!![],'backend':{'method':_0x1244f2(0x8e),'path':UPDATE_PATH},'warnings':[]},{'method':_0x1244f2(0x8e),'url':UPDATE_PATH});},async 'execute'(_0x2f3d1d){const _0x10685f=a236_0x2127e1,_0x27ac7e=_0x2f3d1d[_0x10685f(0x84)]('id'),_0x5ef191=readPatch(_0x2f3d1d),_0x3acc24=await getRoleById(_0x2f3d1d[_0x10685f(0x8c)],_0x27ac7e);assertCustomRole(_0x3acc24,'update'),await updateAppRole({'id':_0x27ac7e,'appCode':_0x2f3d1d[_0x10685f(0x8c)],..._0x5ef191[_0x10685f(0x82)]!==undefined?{'roleName':_0x5ef191[_0x10685f(0x82)]}:{},..._0x5ef191[_0x10685f(0x76)]!==undefined?{'remark':_0x5ef191['remark']}:{}});const _0x1b1d8d=await getRoleById(_0x2f3d1d[_0x10685f(0x8c)],_0x27ac7e);return{'ok':!![],'data':{'scope':'dev','operation':_0x10685f(0x7a),'selector':{'appCode':_0x2f3d1d[_0x10685f(0x8c)],'roleId':_0x27ac7e,'roleName':_0x1b1d8d['roleName']},'before':projectRole(_0x3acc24),'after':projectRole(_0x1b1d8d),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x10685f(0x80)+_0x1b1d8d[_0x10685f(0x82)]+_0x10685f(0x7d)+_0x27ac7e+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a237_0x4162(){const _0x3ab6df=['roleType','roleName','POST','273825RQosBO','username','3212235dlVSKw','53158850MlhLVp','1986WTzqjm','user-add','7576vvNWNX','8063070XtaZbg','userId','\x20already\x20in\x20role\x20','8vImfYe','2933700cvlyVn','role','988654VamSaA','roleId','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','selector','2PAZbRX'];a237_0x4162=function(){return _0x3ab6df;};return a237_0x4162();}const a237_0x4c04f5=a237_0x16af;(function(_0x4cea09,_0x110737){const _0x5d0c76=a237_0x16af,_0x26050a=_0x4cea09();while(!![]){try{const _0x3077fe=parseInt(_0x5d0c76(0x100))/0x1*(-parseInt(_0x5d0c76(0x104))/0x2)+-parseInt(_0x5d0c76(0x10c))/0x3*(parseInt(_0x5d0c76(0x10e))/0x4)+-parseInt(_0x5d0c76(0x10a))/0x5+-parseInt(_0x5d0c76(0xfa))/0x6+-parseInt(_0x5d0c76(0xfe))/0x7+parseInt(_0x5d0c76(0xfd))/0x8*(parseInt(_0x5d0c76(0x108))/0x9)+parseInt(_0x5d0c76(0x10b))/0xa;if(_0x3077fe===_0x110737)break;else _0x26050a['push'](_0x26050a['shift']());}catch(_0x77e91a){_0x26050a['push'](_0x26050a['shift']());}}}(a237_0x4162,0xaa844));function a237_0x16af(_0x27e67d,_0x476294){_0x27e67d=_0x27e67d-0xfa;const _0x41629b=a237_0x4162();let _0x16af7f=_0x41629b[_0x27e67d];return _0x16af7f;}import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a237_0x4c04f5(0xff),'command':a237_0x4c04f5(0x10d),'description':a237_0x4c04f5(0x102),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x51f944){const _0x1593c8=a237_0x4c04f5,{mutation:_0x71481e}=await prepareUserMutation(_0x51f944,_0x1593c8(0x10d),!![]);return asDryRunResult(_0x71481e,{'method':_0x1593c8(0x107),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x312e32){const _0x16100f=a237_0x4c04f5,{mutation:_0x48cd53,changed:_0x21c823,role:_0xce48f3,user:_0x116bf6}=await prepareUserMutation(_0x312e32,_0x16100f(0x10d),![]);return _0x21c823&&await createDevUserRole({'appCode':_0x312e32['appCode'],'userId':_0x116bf6[_0x16100f(0xfb)],'username':_0x116bf6[_0x16100f(0x109)],'roleType':_0xce48f3[_0x16100f(0x105)],'roleId':_0x48cd53[_0x16100f(0x103)][_0x16100f(0x101)]}),{'ok':!![],'data':_0x48cd53,'message':_0x21c823?'Added\x20user\x20'+_0x48cd53[_0x16100f(0x103)][_0x16100f(0xfb)]+'\x20to\x20role\x20'+_0x48cd53['selector'][_0x16100f(0x106)]:'No\x20change:\x20user\x20'+_0x48cd53[_0x16100f(0x103)][_0x16100f(0xfb)]+_0x16100f(0xfc)+_0x48cd53[_0x16100f(0x103)][_0x16100f(0x106)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a238_0x139d18=a238_0x5ee9;(function(_0x5a036d,_0x5b0bea){const _0x3c1ef4=a238_0x5ee9,_0x594179=_0x5a036d();while(!![]){try{const _0x1bd90f=parseInt(_0x3c1ef4(0x1cd))/0x1*(parseInt(_0x3c1ef4(0x1c0))/0x2)+parseInt(_0x3c1ef4(0x1d0))/0x3+-parseInt(_0x3c1ef4(0x1be))/0x4*(parseInt(_0x3c1ef4(0x1c8))/0x5)+parseInt(_0x3c1ef4(0x1c6))/0x6+parseInt(_0x3c1ef4(0x1cb))/0x7*(parseInt(_0x3c1ef4(0x1bf))/0x8)+-parseInt(_0x3c1ef4(0x1ca))/0x9*(parseInt(_0x3c1ef4(0x1c3))/0xa)+-parseInt(_0x3c1ef4(0x1c4))/0xb;if(_0x1bd90f===_0x5b0bea)break;else _0x594179['push'](_0x594179['shift']());}catch(_0x5cac00){_0x594179['push'](_0x594179['shift']());}}}(a238_0x33be,0x2d265));import{deleteDevUserRole}from'../../core/api-client.js';function a238_0x33be(){const _0x549030=['Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','No\x20change:\x20user\x20','545901nZFYMg','user-remove','selector','1956pmSKtU','1712bPVNZW','2LBvLRl','role','Removed\x20user\x20','2209150NbjLDG','2851277CSlTri','high-risk-write','2084304kwgZWN','roleName','3095INiLwD','userId','9YXNAzS','6139Syqqde','\x20not\x20in\x20role\x20','250717FKbvfL'];a238_0x33be=function(){return _0x549030;};return a238_0x33be();}function a238_0x5ee9(_0x401946,_0x1badd9){_0x401946=_0x401946-0x1bc;const _0x33beb3=a238_0x33be();let _0x5ee90f=_0x33beb3[_0x401946];return _0x5ee90f;}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_0x139d18(0x1c1),'command':a238_0x139d18(0x1bc),'description':a238_0x139d18(0x1ce),'risk':a238_0x139d18(0x1c5),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x9f1908){const _0x85ee47=a238_0x139d18,{mutation:_0xe65ce4}=await prepareUserMutation(_0x9f1908,_0x85ee47(0x1bc),!![]);return asDryRunResult(_0xe65ce4,{'method':'POST','url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x4d6868){const _0x2d58fe=a238_0x139d18,{matchingRelationIds:_0x315d9d,mutation:_0x436c37,changed:_0x1d63e7}=await prepareUserMutation(_0x4d6868,_0x2d58fe(0x1bc),![]);if(_0x1d63e7)for(const _0x38d9d6 of _0x315d9d){await deleteDevUserRole(_0x38d9d6);}return{'ok':!![],'data':_0x436c37,'message':_0x1d63e7?_0x2d58fe(0x1c2)+_0x436c37[_0x2d58fe(0x1bd)][_0x2d58fe(0x1c9)]+'\x20from\x20role\x20'+_0x436c37[_0x2d58fe(0x1bd)][_0x2d58fe(0x1c7)]:_0x2d58fe(0x1cf)+_0x436c37[_0x2d58fe(0x1bd)]['userId']+_0x2d58fe(0x1cc)+_0x436c37[_0x2d58fe(0x1bd)][_0x2d58fe(0x1c7)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a239_0x21607a=a239_0x3a21;function a239_0x14bb(){const _0x45fd52=['32otnpIf','nickname','role','886062OsoYZU','Pass\x20--name\x20<nickname|username>.','6476zuQRMx','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','read','665410QoatKa','1415Qcdcfm','\x22\x20→\x20userId\x20','flagMissing','23630751dlaiwT','userId','561806uZNtfa','name','trim','str','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','matchedBy','Resolved\x20\x22','1097656gxyFKq','671349BCYGMr'];a239_0x14bb=function(){return _0x45fd52;};return a239_0x14bb();}(function(_0x2cbb96,_0x17bdd0){const _0x122e10=a239_0x3a21,_0x569c5c=_0x2cbb96();while(!![]){try{const _0x452194=-parseInt(_0x122e10(0x115))/0x1+-parseInt(_0x122e10(0x122))/0x2+-parseInt(_0x122e10(0x123))/0x3+parseInt(_0x122e10(0x112))/0x4*(-parseInt(_0x122e10(0x116))/0x5)+parseInt(_0x122e10(0x110))/0x6+-parseInt(_0x122e10(0x11b))/0x7*(parseInt(_0x122e10(0x124))/0x8)+parseInt(_0x122e10(0x119))/0x9;if(_0x452194===_0x17bdd0)break;else _0x569c5c['push'](_0x569c5c['shift']());}catch(_0x2fe089){_0x569c5c['push'](_0x569c5c['shift']());}}}(a239_0x14bb,0x87c36));import{CliErrors}from'../../errors.js';function a239_0x3a21(_0x540e9b,_0x4f409b){_0x540e9b=_0x540e9b-0x10f;const _0x14bb22=a239_0x14bb();let _0x3a2142=_0x14bb22[_0x540e9b];return _0x3a2142;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a239_0x21607a(0x10f),'command':'user-resolve','description':a239_0x21607a(0x113),'risk':a239_0x21607a(0x114),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x20e90a){const _0x392081=a239_0x21607a;if(!_0x20e90a[_0x392081(0x11e)](_0x392081(0x11c))[_0x392081(0x11d)]())throw CliErrors[_0x392081(0x118)]('name',_0x392081(0x111));},async 'execute'(_0x4dab04){const _0x5dac76=a239_0x21607a,_0x19b413=_0x4dab04[_0x5dac76(0x11e)](_0x5dac76(0x11c))['trim'](),_0x4ee466=await resolveUserRef(_0x19b413,_0x5dac76(0x11f));return{'ok':!![],'data':{'user':{'userId':_0x4ee466[_0x5dac76(0x11a)],'username':_0x4ee466['username'],'nickname':_0x4ee466[_0x5dac76(0x125)],'matchedBy':_0x4ee466[_0x5dac76(0x120)]}},'message':_0x5dac76(0x121)+_0x19b413+_0x5dac76(0x117)+_0x4ee466[_0x5dac76(0x11a)]};}};
|
package/lib/commands/rule/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a240_0x3523fa=a240_0x2347;function a240_0xf2ae(){const _0x4d95f0=['Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','\x20is\x20not\x20configured\x20for\x20app\x20','cookie','70sEIgEX','Loaded\x20','28957511GjxjGa','312qHhJSX','1327230famIcX','277333dacRlu','421164FLOeNO','3170wDSzkH','app_rule_not_found','read','rule','get','2323756TgNOKe','645dTTjOB','1236080rzZHVA','6MBHrvV','\x20for\x20','content','appCode'];a240_0xf2ae=function(){return _0x4d95f0;};return a240_0xf2ae();}(function(_0x4631cc,_0x1c3842){const _0x92b8cc=a240_0x2347,_0x59a2c6=_0x4631cc();while(!![]){try{const _0x5a573c=-parseInt(_0x92b8cc(0x90))/0x1*(-parseInt(_0x92b8cc(0x8a))/0x2)+-parseInt(_0x92b8cc(0x92))/0x3*(parseInt(_0x92b8cc(0x8f))/0x4)+-parseInt(_0x92b8cc(0x91))/0x5+-parseInt(_0x92b8cc(0x9d))/0x6+parseInt(_0x92b8cc(0x88))/0x7*(-parseInt(_0x92b8cc(0x9c))/0x8)+parseInt(_0x92b8cc(0x89))/0x9*(parseInt(_0x92b8cc(0x99))/0xa)+parseInt(_0x92b8cc(0x9b))/0xb;if(_0x5a573c===_0x1c3842)break;else _0x59a2c6['push'](_0x59a2c6['shift']());}catch(_0x1138bf){_0x59a2c6['push'](_0x59a2c6['shift']());}}}(a240_0xf2ae,0xc502e));import{getAppRule}from'../../core/api-client.js';function a240_0x2347(_0x42045b,_0x555ec5){_0x42045b=_0x42045b-0x88;const _0xf2ae92=a240_0xf2ae();let _0x2347db=_0xf2ae92[_0x42045b];return _0x2347db;}import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a240_0x3523fa(0x8d),'command':a240_0x3523fa(0x8e),'description':'Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','risk':a240_0x3523fa(0x8c),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x529f69){readAppRuleType(_0x529f69);},async 'execute'(_0x47919c){const _0x571301=a240_0x3523fa,_0x4cf9c3=readAppRuleType(_0x47919c),_0xfa5027=await getAppRule(_0x47919c[_0x571301(0x98)],{'appCode':_0x47919c['appCode'],'type':_0x4cf9c3});if(!_0xfa5027)throw appRuleError(_0x571301(0x8b),appRuleFileName(_0x4cf9c3)+_0x571301(0x97)+_0x47919c[_0x571301(0x95)]+'.',_0x571301(0x96)+_0x4cf9c3+'\x20--file\x20<path>\x20--dry-run`.');return{'ok':!![],'data':{'rule':{...projectAppRule(_0x4cf9c3,_0xfa5027),'content':_0xfa5027[_0x571301(0x94)]}},'message':_0x571301(0x9a)+appRuleFileName(_0x4cf9c3)+_0x571301(0x93)+_0x47919c[_0x571301(0x95)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a241_0x99a3c8=a241_0x4bba;(function(_0x96835f,_0x36afc6){const _0x211fab=a241_0x4bba,_0x5d90a8=_0x96835f();while(!![]){try{const _0x158eee=parseInt(_0x211fab(0x18b))/0x1*(-parseInt(_0x211fab(0x18f))/0x2)+-parseInt(_0x211fab(0x18c))/0x3*(-parseInt(_0x211fab(0x192))/0x4)+-parseInt(_0x211fab(0x191))/0x5*(parseInt(_0x211fab(0x18e))/0x6)+-parseInt(_0x211fab(0x196))/0x7*(-parseInt(_0x211fab(0x195))/0x8)+parseInt(_0x211fab(0x18d))/0x9+parseInt(_0x211fab(0x18a))/0xa+-parseInt(_0x211fab(0x189))/0xb;if(_0x158eee===_0x36afc6)break;else _0x5d90a8['push'](_0x5d90a8['shift']());}catch(_0x4d2633){_0x5d90a8['push'](_0x5d90a8['shift']());}}}(a241_0x3f4b,0x2adcf));import{withKbManagementSession}from'../../core/kb-management-client.js';import{ruleGet}from'../../commands/rule/get.js';function a241_0x4bba(_0x5e3938,_0x254719){_0x5e3938=_0x5e3938-0x189;const _0x3f4b0c=a241_0x3f4b();let _0x4bba85=_0x3f4b0c[_0x5e3938];return _0x4bba85;}function a241_0x3f4b(){const _0x304cac=['signal','17905ejxFEv','16xSMZAN','dryRun','map','88vSmoRA','95809pKkbnF','1221242SBhUrf','997130lhKWOc','61678GjrMcL','128031dOJXTF','2221191veuveO','432HiOGZZ','4ZMghGL'];a241_0x3f4b=function(){return _0x304cac;};return a241_0x3f4b();}import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet][a241_0x99a3c8(0x194)](_0x2c3b61=>({..._0x2c3b61,'execute':_0x106589=>withKbManagementSession(_0x106589[a241_0x99a3c8(0x190)],()=>_0x2c3b61['execute'](_0x106589)),..._0x2c3b61[a241_0x99a3c8(0x193)]?{'dryRun':_0x2c93fa=>withKbManagementSession(_0x2c93fa[a241_0x99a3c8(0x190)],()=>_0x2c3b61[a241_0x99a3c8(0x193)](_0x2c93fa))}:{}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a242_0x1e79(){const _0x35eba7=['880292QiFrbT','appCode','all','list','rule','40072oRNArw','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','Loaded\x20app\x20rule\x20configuration\x20for\x20','10cdxQgp','29080oUMrzK','2466KvpDFp','6607376EBKtHV','1851294FhcKSz','map','7FetSZS','2073072qKkliA','862532mwNExX'];a242_0x1e79=function(){return _0x35eba7;};return a242_0x1e79();}function a242_0x1e4b(_0x5994ad,_0x2db2e8){_0x5994ad=_0x5994ad-0xcd;const _0x1e79c5=a242_0x1e79();let _0x1e4b5a=_0x1e79c5[_0x5994ad];return _0x1e4b5a;}const a242_0x1cce6f=a242_0x1e4b;(function(_0x1a20c9,_0x163c39){const _0x42b07a=a242_0x1e4b,_0x2a1906=_0x1a20c9();while(!![]){try{const _0x4f59e6=-parseInt(_0x42b07a(0xd5))/0x1+parseInt(_0x42b07a(0xd0))/0x2+parseInt(_0x42b07a(0xdc))/0x3+parseInt(_0x42b07a(0xcf))/0x4+-parseInt(_0x42b07a(0xd8))/0x5*(parseInt(_0x42b07a(0xce))/0x6)+-parseInt(_0x42b07a(0xcd))/0x7*(-parseInt(_0x42b07a(0xdb))/0x8)+-parseInt(_0x42b07a(0xda))/0x9*(parseInt(_0x42b07a(0xd9))/0xa);if(_0x4f59e6===_0x163c39)break;else _0x2a1906['push'](_0x2a1906['shift']());}catch(_0xa94793){_0x2a1906['push'](_0x2a1906['shift']());}}}(a242_0x1e79,0x8b61f));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':a242_0x1cce6f(0xd4),'command':a242_0x1cce6f(0xd3),'description':a242_0x1cce6f(0xd6),'risk':'read','requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x551637){const _0x331f1e=a242_0x1cce6f,_0x4165f9=await Promise[_0x331f1e(0xd2)](APP_RULE_TYPES[_0x331f1e(0xdd)](_0x371a81=>getAppRule(_0x551637['cookie'],{'appCode':_0x551637[_0x331f1e(0xd1)],'type':_0x371a81}))),_0x5880a2=APP_RULE_TYPES['map']((_0x53a083,_0x3ce8de)=>projectAppRule(_0x53a083,_0x4165f9[_0x3ce8de]??null));return{'ok':!![],'data':{'total':_0x5880a2['length'],'rules':_0x5880a2},'message':_0x331f1e(0xd7)+_0x551637[_0x331f1e(0xd1)]};}};
|
package/lib/commands/rule/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a243_0x52a21b=a243_0x3e7e;(function(_0x2f1cb5,_0x16837d){const _0x21e7ec=a243_0x3e7e,_0x2af9e9=_0x2f1cb5();while(!![]){try{const _0x193c1e=parseInt(_0x21e7ec(0x104))/0x1+-parseInt(_0x21e7ec(0x124))/0x2+parseInt(_0x21e7ec(0x128))/0x3+parseInt(_0x21e7ec(0x133))/0x4+parseInt(_0x21e7ec(0x132))/0x5*(-parseInt(_0x21e7ec(0x117))/0x6)+-parseInt(_0x21e7ec(0x111))/0x7*(-parseInt(_0x21e7ec(0x11c))/0x8)+-parseInt(_0x21e7ec(0x11a))/0x9;if(_0x193c1e===_0x16837d)break;else _0x2af9e9['push'](_0x2af9e9['shift']());}catch(_0x72c850){_0x2af9e9['push'](_0x2af9e9['shift']());}}}(a243_0x3cf0,0xdf979));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(_0xa4c766){const _0x474f8d=a243_0x3e7e,_0x48cc30=readAppRuleType(_0xa4c766),_0x1c2be6=_0xa4c766['str'](_0x474f8d(0x127))[_0x474f8d(0x12b)]();if(!_0x1c2be6)throw appRuleError(_0x474f8d(0x114),'--file\x20is\x20required.',_0x474f8d(0x129));const _0x4d465f=_0xa4c766[_0x474f8d(0x11e)](_0x474f8d(0x11d));let _0x5a6f10;if(_0x4d465f!==undefined){_0x5a6f10=Number(_0x4d465f);if(!Number[_0x474f8d(0x134)](_0x5a6f10)||_0x5a6f10<0x0)throw appRuleError(_0x474f8d(0x106),_0x474f8d(0x11b));}return{'type':_0x48cc30,'file':_0x1c2be6,'expectedVersion':_0x5a6f10};}function a243_0x3cf0(){const _0x263bd2=['rule','app_rule_file_required','update','set','89988NFDTxz','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','contentHash','12134655rfNzNM','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','27584AQwpHD','expected-version','flag','unconfigured','POST','replacement','\x20version\x20changed\x20before\x20write.','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','902454MBkDol','defineProperty','beforeRecord','file','3935031iyINgX','Pass\x20a\x20UTF-8\x20Markdown\x20file.','length','trim','appCode','planned','RULES','app_rule_verification_failed','write','The\x20set\x20request\x20was\x20sent,\x20but\x20','205ouYxEV','4114768pEZzXw','isSafeInteger','content','rabetbase\x20rule\x20get\x20--type\x20','string','app_rule_verification_unavailable','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','cookie','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','DATABASE','create','\x20could\x20not\x20be\x20verified.','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','expectedVersion','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','version','934736YjWPNq','before','app_rule_expected_version_invalid','app_rule_set_outcome_unknown','rules','input','\x20--format\x20compress',';\x20current\x20version\x20is\x20','Expected\x20','type','number','verified','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','112ATUSjc','push'];a243_0x3cf0=function(){return _0x263bd2;};return a243_0x3cf0();}async function prepareSet(_0xcd3c67){const _0x46d30e=a243_0x3e7e,_0x5b6c5c=readSetInput(_0xcd3c67),_0x121383=await readAppRuleFile(_0x5b6c5c[_0x46d30e(0x127)]);if(_0x5b6c5c[_0x46d30e(0x10d)]===_0x46d30e(0x108)&&_0x121383[_0x46d30e(0x135)][_0x46d30e(0x12a)]>0x7d0)throw appRuleError('app_rule_content_too_large','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.');const _0x9af2d8=await getAppRule(_0xcd3c67[_0x46d30e(0x13a)],{'appCode':_0xcd3c67[_0x46d30e(0x12c)],'type':_0x5b6c5c['type']});if(_0x5b6c5c['expectedVersion']!==undefined&&(_0x9af2d8?.['version']??0x0)!==_0x5b6c5c[_0x46d30e(0x101)])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x5b6c5c[_0x46d30e(0x10d)])+_0x46d30e(0x122),_0x46d30e(0x10c)+_0x5b6c5c[_0x46d30e(0x101)]+_0x46d30e(0x10b)+(_0x9af2d8?.[_0x46d30e(0x103)]??_0x46d30e(0x11f))+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x5b6c5c,'replacement':_0x121383,'beforeRecord':_0x9af2d8,'before':projectAppRule(_0x5b6c5c['type'],_0x9af2d8),'planned':{'type':_0x5b6c5c['type'],'fileName':appRuleFileName(_0x5b6c5c[_0x46d30e(0x10d)]),'contextScope':appRuleContextScope(_0x5b6c5c[_0x46d30e(0x10d)]),'enabled':!![],'appCode':_0xcd3c67[_0x46d30e(0x12c)],'scope':_0x46d30e(0x108),'contentByteSize':_0x121383['byteSize'],'contentHash':_0x121383[_0x46d30e(0x119)]}};}function warningsFor(_0x587844){return[];}function a243_0x3e7e(_0x1ddd15,_0x335aaf){_0x1ddd15=_0x1ddd15-0x100;const _0x3cf095=a243_0x3cf0();let _0x3e7ee0=_0x3cf095[_0x1ddd15];return _0x3e7ee0;}export const ruleSet={'service':a243_0x52a21b(0x113),'command':a243_0x52a21b(0x116),'description':'Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','risk':a243_0x52a21b(0x130),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x52a21b(0x127),'type':a243_0x52a21b(0x137),'required':!![],'description':a243_0x52a21b(0x13c)},{'name':a243_0x52a21b(0x11d),'type':a243_0x52a21b(0x10e),'required':![],'description':a243_0x52a21b(0x100)}],async 'validate'(_0x20a897){readSetInput(_0x20a897);},async 'dryRun'(_0x4d7637){const _0x100b6b=a243_0x52a21b,_0x463531=await prepareSet(_0x4d7637);return asDryRunResult({'operation':'set','selector':{'appCode':_0x4d7637[_0x100b6b(0x12c)],'scope':_0x100b6b(0x108),'type':_0x463531[_0x100b6b(0x109)][_0x100b6b(0x10d)]},'before':_0x463531[_0x100b6b(0x105)],'after':_0x463531[_0x100b6b(0x12d)],'dryRun':!![],'backend':{'method':_0x100b6b(0x120),'path':knowledgeDocumentsPath('rules',_0x463531[_0x100b6b(0x126)]?_0x100b6b(0x115):_0x100b6b(0x13e)),'body':{'appCode':_0x4d7637[_0x100b6b(0x12c)],..._0x463531[_0x100b6b(0x126)]?{'id':_0x463531[_0x100b6b(0x126)]['id']}:{},'title':_0x463531[_0x100b6b(0x109)][_0x100b6b(0x10d)]===_0x100b6b(0x108)?_0x100b6b(0x12e):_0x100b6b(0x13d),'contentHash':_0x463531[_0x100b6b(0x121)][_0x100b6b(0x119)],'contentByteSize':_0x463531['replacement']['byteSize'],..._0x463531[_0x100b6b(0x126)]?{'expectedVersion':_0x463531[_0x100b6b(0x126)]['version']}:{}}},'warnings':warningsFor(_0x463531[_0x100b6b(0x109)][_0x100b6b(0x101)]),'verification':{'expectedVersion':_0x463531[_0x100b6b(0x126)]?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x100b6b(0x136)+_0x463531['input'][_0x100b6b(0x10d)]+_0x100b6b(0x10a)}},{'method':_0x100b6b(0x120),'url':knowledgeDocumentsPath(_0x100b6b(0x108),_0x463531[_0x100b6b(0x126)]?'update':_0x100b6b(0x13e))});},async 'execute'(_0x3a8625){const _0x9284f2=a243_0x52a21b,_0x3b8377=await prepareSet(_0x3a8625),_0x398b16=_0x3b8377[_0x9284f2(0x126)]===null?0x1:_0x3b8377[_0x9284f2(0x126)]['version']+(_0x3b8377[_0x9284f2(0x126)][_0x9284f2(0x135)]===_0x3b8377[_0x9284f2(0x121)]['content']?0x0:0x1);let _0x1b3c96,_0x2ce320=![];try{_0x1b3c96=await saveAppRule(_0x3a8625[_0x9284f2(0x13a)],{'appCode':_0x3a8625[_0x9284f2(0x12c)],'type':_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)],'content':_0x3b8377[_0x9284f2(0x121)][_0x9284f2(0x135)],'expectedVersion':_0x3b8377[_0x9284f2(0x126)]?.[_0x9284f2(0x103)]??0x0,..._0x3b8377['beforeRecord']?{'id':_0x3b8377[_0x9284f2(0x126)]['id']}:{}});if(_0x1b3c96[_0x9284f2(0x103)]!==_0x398b16||_0x1b3c96[_0x9284f2(0x135)]!==_0x3b8377[_0x9284f2(0x121)][_0x9284f2(0x135)]||_0x3b8377[_0x9284f2(0x126)]!==null&&_0x1b3c96['id']!==_0x3b8377['beforeRecord']['id'])throw appRuleError('app_rule_verification_failed',_0x9284f2(0x118),_0x9284f2(0x102));}catch(_0x215a0d){if(!isPlatformTransportFailure(_0x215a0d))throw _0x215a0d;_0x2ce320=!![];}let _0x1f4bc4;try{_0x1f4bc4=await getAppRule(_0x3a8625[_0x9284f2(0x13a)],{'appCode':_0x3a8625[_0x9284f2(0x12c)],'type':_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)]});}catch(_0x1243d0){const _0x61dcf3=appRuleError(_0x2ce320?_0x9284f2(0x107):_0x9284f2(0x138),_0x9284f2(0x131)+appRuleFileName(_0x3b8377['input'][_0x9284f2(0x10d)])+_0x9284f2(0x13f),_0x9284f2(0x110));Object[_0x9284f2(0x125)](_0x61dcf3,'cause',{'value':_0x1243d0,'enumerable':![]});throw _0x61dcf3;}const _0x54947a=_0x1f4bc4&&inspectAppRuleContent(_0x1f4bc4[_0x9284f2(0x135)])[_0x9284f2(0x119)]===_0x3b8377[_0x9284f2(0x121)][_0x9284f2(0x119)],_0x488ed9=_0x1f4bc4&&_0x1f4bc4[_0x9284f2(0x103)]===_0x398b16&&(!_0x1b3c96||_0x1f4bc4['id']===_0x1b3c96['id']&&_0x1f4bc4[_0x9284f2(0x103)]===_0x1b3c96[_0x9284f2(0x103)]);if(!_0x1f4bc4||!_0x54947a||!_0x488ed9||_0x3b8377['beforeRecord']!==null&&_0x1f4bc4['id']!==_0x3b8377[_0x9284f2(0x126)]['id'])throw appRuleError(_0x2ce320?_0x9284f2(0x107):_0x9284f2(0x12f),appRuleFileName(_0x3b8377['input'][_0x9284f2(0x10d)])+_0x9284f2(0x123),'Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20'+_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)]+_0x9284f2(0x139));const _0x8a4820=warningsFor(_0x3b8377['input'][_0x9284f2(0x101)]);_0x2ce320&&_0x8a4820[_0x9284f2(0x112)](_0x9284f2(0x13b));const _0x29c728=projectAppRule(_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)],_0x1f4bc4);return{'ok':!![],'data':{'operation':'set','selector':{'appCode':_0x3a8625[_0x9284f2(0x12c)],'scope':_0x9284f2(0x108),'type':_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)]},'before':_0x3b8377[_0x9284f2(0x105)],'after':_0x29c728,'dryRun':![],'backend':{'method':'POST','path':knowledgeDocumentsPath(_0x9284f2(0x108),_0x3b8377[_0x9284f2(0x126)]?_0x9284f2(0x115):_0x9284f2(0x13e))},'warnings':_0x8a4820,'verification':{'status':_0x9284f2(0x10f),'recoveredAfterUnknownResponse':_0x2ce320,'expectedVersion':_0x3b8377[_0x9284f2(0x126)]?.[_0x9284f2(0x103)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x9284f2(0x136)+_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)]+_0x9284f2(0x10a)}},'message':'Set\x20'+appRuleFileName(_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)])+'\x20for\x20'+_0x3a8625[_0x9284f2(0x12c)]};}};
|
|
1
|
+
function a243_0x18c4(){const _0x78365e=['app_rule_set_outcome_unknown','1676820fDIvrE','\x20--format\x20compress','7397UlrtnE','app_rule_expected_version_invalid','rules','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','POST','push','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','expected-version','str','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','app_rule_verification_failed','byteSize','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','update','unconfigured','cause','Set\x20','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','planned','isSafeInteger','version','1654620eiaAvP','\x20version\x20changed\x20before\x20write.','set','--file\x20is\x20required.','replacement','rule','contentHash','beforeRecord','\x20could\x20not\x20be\x20verified.','number','\x20for\x20','string','trim','app_rule_version_mismatch','input','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','file','1062018SvgPTq','4278169mJdqWm','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','verified','appCode','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','expectedVersion','cookie','defineProperty','26AeloRk','78960JUOejb','943032XRRzbv','content','before',';\x20current\x20version\x20is\x20','app_rule_file_required','create','type','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.'];a243_0x18c4=function(){return _0x78365e;};return a243_0x18c4();}const a243_0x3c8b44=a243_0x358e;(function(_0x4060d9,_0x58525d){const _0x110eae=a243_0x358e,_0xeb5516=_0x4060d9();while(!![]){try{const _0x3c9745=parseInt(_0x110eae(0xbe))/0x1*(-parseInt(_0x110eae(0xb1))/0x2)+parseInt(_0x110eae(0xbc))/0x3+parseInt(_0x110eae(0xd3))/0x4+-parseInt(_0x110eae(0xb2))/0x5+parseInt(_0x110eae(0xa8))/0x6+-parseInt(_0x110eae(0xa9))/0x7+-parseInt(_0x110eae(0xb3))/0x8;if(_0x3c9745===_0x58525d)break;else _0xeb5516['push'](_0xeb5516['shift']());}catch(_0x532b24){_0xeb5516['push'](_0xeb5516['shift']());}}}(a243_0x18c4,0x4b577));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(_0x4a9d8a){const _0x41d680=a243_0x358e,_0x3eaea2=readAppRuleType(_0x4a9d8a),_0x20dc9d=_0x4a9d8a[_0x41d680(0xc6)]('file')[_0x41d680(0xa3)]();if(!_0x20dc9d)throw appRuleError(_0x41d680(0xb7),_0x41d680(0xd6),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x41b76a=_0x4a9d8a['flag'](_0x41d680(0xc5));let _0x38dd3a;if(_0x41b76a!==undefined){_0x38dd3a=Number(_0x41b76a);if(!Number[_0x41d680(0xd1)](_0x38dd3a)||_0x38dd3a<0x0)throw appRuleError(_0x41d680(0xbf),'--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.');}return{'type':_0x3eaea2,'file':_0x20dc9d,'expectedVersion':_0x38dd3a};}async function prepareSet(_0x54ba5c){const _0x469d57=a243_0x358e,_0x1c8c9b=readSetInput(_0x54ba5c),_0x3ff889=await readAppRuleFile(_0x1c8c9b[_0x469d57(0xa7)]);if(_0x1c8c9b[_0x469d57(0xb9)]===_0x469d57(0xc0)&&_0x3ff889[_0x469d57(0xb4)]['length']>0x7d0)throw appRuleError('app_rule_content_too_large',_0x469d57(0xc7));const _0x4970a5=await getAppRule(_0x54ba5c[_0x469d57(0xaf)],{'appCode':_0x54ba5c[_0x469d57(0xac)],'type':_0x1c8c9b[_0x469d57(0xb9)]});if(_0x1c8c9b[_0x469d57(0xae)]!==undefined&&(_0x4970a5?.[_0x469d57(0xd2)]??0x0)!==_0x1c8c9b[_0x469d57(0xae)])throw appRuleError(_0x469d57(0xa4),appRuleFileName(_0x1c8c9b[_0x469d57(0xb9)])+_0x469d57(0xd4),'Expected\x20'+_0x1c8c9b['expectedVersion']+_0x469d57(0xb6)+(_0x4970a5?.['version']??_0x469d57(0xcc))+_0x469d57(0xba));return{'input':_0x1c8c9b,'replacement':_0x3ff889,'beforeRecord':_0x4970a5,'before':projectAppRule(_0x1c8c9b[_0x469d57(0xb9)],_0x4970a5),'planned':{'type':_0x1c8c9b[_0x469d57(0xb9)],'fileName':appRuleFileName(_0x1c8c9b[_0x469d57(0xb9)]),'contextScope':appRuleContextScope(_0x1c8c9b['type']),'enabled':!![],'appCode':_0x54ba5c[_0x469d57(0xac)],'scope':'rules','contentByteSize':_0x3ff889['byteSize'],'contentHash':_0x3ff889[_0x469d57(0xd9)]}};}function warningsFor(_0x94239){return[];}function a243_0x358e(_0x2f322e,_0x528aaa){_0x2f322e=_0x2f322e-0x9f;const _0x18c45b=a243_0x18c4();let _0x358eba=_0x18c45b[_0x2f322e];return _0x358eba;}export const ruleSet={'service':a243_0x3c8b44(0xd8),'command':a243_0x3c8b44(0xd5),'description':a243_0x3c8b44(0xc4),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x3c8b44(0xa7),'type':a243_0x3c8b44(0xa2),'required':!![],'description':a243_0x3c8b44(0xad)},{'name':a243_0x3c8b44(0xc5),'type':a243_0x3c8b44(0xa0),'required':![],'description':a243_0x3c8b44(0xaa)}],async 'validate'(_0x42d3dd){readSetInput(_0x42d3dd);},async 'dryRun'(_0x58773e){const _0x42d439=a243_0x3c8b44,_0x280699=await prepareSet(_0x58773e);return asDryRunResult({'operation':_0x42d439(0xd5),'selector':{'appCode':_0x58773e['appCode'],'scope':_0x42d439(0xc0),'type':_0x280699[_0x42d439(0xa5)][_0x42d439(0xb9)]},'before':_0x280699[_0x42d439(0xb5)],'after':_0x280699[_0x42d439(0xd0)],'dryRun':!![],'backend':{'method':_0x42d439(0xc2),'path':knowledgeDocumentsPath('rules',_0x280699[_0x42d439(0xda)]?_0x42d439(0xcb):'create'),'body':{'appCode':_0x58773e['appCode'],..._0x280699[_0x42d439(0xda)]?{'id':_0x280699[_0x42d439(0xda)]['id']}:{},'title':_0x280699['input']['type']===_0x42d439(0xc0)?'RULES':'DATABASE','contentHash':_0x280699[_0x42d439(0xd7)][_0x42d439(0xd9)],'contentByteSize':_0x280699['replacement'][_0x42d439(0xc9)],..._0x280699[_0x42d439(0xda)]?{'expectedVersion':_0x280699['beforeRecord'][_0x42d439(0xd2)]}:{}}},'warnings':warningsFor(_0x280699[_0x42d439(0xa5)]['expectedVersion']),'verification':{'expectedVersion':_0x280699[_0x42d439(0xda)]?.[_0x42d439(0xd2)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':'rabetbase\x20rule\x20get\x20--type\x20'+_0x280699[_0x42d439(0xa5)][_0x42d439(0xb9)]+_0x42d439(0xbd)}},{'method':'POST','url':knowledgeDocumentsPath(_0x42d439(0xc0),_0x280699[_0x42d439(0xda)]?'update':_0x42d439(0xb8))});},async 'execute'(_0x1d0061){const _0x722575=a243_0x3c8b44,_0x14d833=await prepareSet(_0x1d0061),_0x2908f6=_0x14d833['beforeRecord']===null?0x1:_0x14d833[_0x722575(0xda)][_0x722575(0xd2)]+(_0x14d833['beforeRecord'][_0x722575(0xb4)]===_0x14d833[_0x722575(0xd7)][_0x722575(0xb4)]?0x0:0x1);let _0x386c0d,_0x19eb55=![];try{_0x386c0d=await saveAppRule(_0x1d0061[_0x722575(0xaf)],{'appCode':_0x1d0061[_0x722575(0xac)],'type':_0x14d833[_0x722575(0xa5)]['type'],'content':_0x14d833[_0x722575(0xd7)][_0x722575(0xb4)],'expectedVersion':_0x14d833['beforeRecord']?.['version']??0x0,..._0x14d833[_0x722575(0xda)]?{'id':_0x14d833[_0x722575(0xda)]['id']}:{}});if(_0x386c0d[_0x722575(0xd2)]!==_0x2908f6||_0x386c0d[_0x722575(0xb4)]!==_0x14d833[_0x722575(0xd7)]['content']||_0x14d833[_0x722575(0xda)]!==null&&_0x386c0d['id']!==_0x14d833[_0x722575(0xda)]['id'])throw appRuleError(_0x722575(0xc8),_0x722575(0xa6),'Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.');}catch(_0x177b8a){if(!isPlatformTransportFailure(_0x177b8a))throw _0x177b8a;_0x19eb55=!![];}let _0x33657b;try{_0x33657b=await getAppRule(_0x1d0061['cookie'],{'appCode':_0x1d0061[_0x722575(0xac)],'type':_0x14d833[_0x722575(0xa5)][_0x722575(0xb9)]});}catch(_0x5272a8){const _0xc0af7f=appRuleError(_0x19eb55?'app_rule_set_outcome_unknown':'app_rule_verification_unavailable','The\x20set\x20request\x20was\x20sent,\x20but\x20'+appRuleFileName(_0x14d833['input']['type'])+_0x722575(0x9f),'Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.');Object[_0x722575(0xb0)](_0xc0af7f,_0x722575(0xcd),{'value':_0x5272a8,'enumerable':![]});throw _0xc0af7f;}const _0x571e9a=_0x33657b&&inspectAppRuleContent(_0x33657b[_0x722575(0xb4)])[_0x722575(0xd9)]===_0x14d833[_0x722575(0xd7)]['contentHash'],_0x427b1c=_0x33657b&&_0x33657b[_0x722575(0xd2)]===_0x2908f6&&(!_0x386c0d||_0x33657b['id']===_0x386c0d['id']&&_0x33657b[_0x722575(0xd2)]===_0x386c0d[_0x722575(0xd2)]);if(!_0x33657b||!_0x571e9a||!_0x427b1c||_0x14d833[_0x722575(0xda)]!==null&&_0x33657b['id']!==_0x14d833[_0x722575(0xda)]['id'])throw appRuleError(_0x19eb55?_0x722575(0xbb):'app_rule_verification_failed',appRuleFileName(_0x14d833[_0x722575(0xa5)][_0x722575(0xb9)])+_0x722575(0xc1),_0x722575(0xca)+_0x14d833[_0x722575(0xa5)][_0x722575(0xb9)]+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x21f047=warningsFor(_0x14d833[_0x722575(0xa5)][_0x722575(0xae)]);_0x19eb55&&_0x21f047[_0x722575(0xc3)](_0x722575(0xcf));const _0x41c418=projectAppRule(_0x14d833[_0x722575(0xa5)][_0x722575(0xb9)],_0x33657b);return{'ok':!![],'data':{'operation':_0x722575(0xd5),'selector':{'appCode':_0x1d0061[_0x722575(0xac)],'scope':_0x722575(0xc0),'type':_0x14d833[_0x722575(0xa5)][_0x722575(0xb9)]},'before':_0x14d833['before'],'after':_0x41c418,'dryRun':![],'backend':{'method':_0x722575(0xc2),'path':knowledgeDocumentsPath(_0x722575(0xc0),_0x14d833['beforeRecord']?'update':_0x722575(0xb8))},'warnings':_0x21f047,'verification':{'status':_0x722575(0xab),'recoveredAfterUnknownResponse':_0x19eb55,'expectedVersion':_0x14d833[_0x722575(0xda)]?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':'rabetbase\x20rule\x20get\x20--type\x20'+_0x14d833[_0x722575(0xa5)]['type']+_0x722575(0xbd)}},'message':_0x722575(0xce)+appRuleFileName(_0x14d833[_0x722575(0xa5)][_0x722575(0xb9)])+_0x722575(0xa1)+_0x1d0061[_0x722575(0xac)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a244_0x5644e6=a244_0x3da8;(function(_0x490827,_0x185418){const _0x26d0c0=a244_0x3da8,_0x1f4f38=_0x490827();while(!![]){try{const _0x4542b0=-parseInt(_0x26d0c0(0x99))/0x1*(-parseInt(_0x26d0c0(0x8d))/0x2)+parseInt(_0x26d0c0(0xa8))/0x3*(parseInt(_0x26d0c0(0x87))/0x4)+-parseInt(_0x26d0c0(0x94))/0x5*(-parseInt(_0x26d0c0(0x91))/0x6)+parseInt(_0x26d0c0(0x95))/0x7*(parseInt(_0x26d0c0(0xa3))/0x8)+-parseInt(_0x26d0c0(0x9b))/0x9+parseInt(_0x26d0c0(0x86))/0xa+-parseInt(_0x26d0c0(0xa5))/0xb;if(_0x4542b0===_0x185418)break;else _0x1f4f38['push'](_0x1f4f38['shift']());}catch(_0xe976c7){_0x1f4f38['push'](_0x1f4f38['shift']());}}}(a244_0x3bb1,0xcfe1d));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';function a244_0x3bb1(){const _0x36f038=['database','127918Bdeiji','byteSize','4862268qfbRVv','indexStatus','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','appCode','byteLength','str','--file\x20is\x20required.','RULES.md','8sseZxb','sha256','39531272uQvJyL','size','app_rule_content_too_large','3xOzroY','message','contentHash','utf8','from','DATABASE.md','database-analysis','string','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','hex','7650140mUTAaU','905508nDTlmh','app_rule_file_unreadable','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','rules','updateTime','26QocMMd','trim','app_rule_content_invalid','sha256:','9785382SfpNAE','update','createTime','5tKLFNj','4901869RZkaHN','isFile','type'];a244_0x3bb1=function(){return _0x36f038;};return a244_0x3bb1();}import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a244_0x5644e6(0x8b),'database'];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_0x5644e6(0xa2),'database':a244_0x5644e6(0xad)},APP_RULE_CONTEXT_SCOPES={'rules':'page-api-development','database':a244_0x5644e6(0xae)};export function appRuleError(_0x110564,_0x3433e6,_0x152929){return new CliError(_0x110564,0x1,_0x3433e6,_0x152929);}function a244_0x3da8(_0x2d3933,_0x4db1f9){_0x2d3933=_0x2d3933-0x83;const _0x3bb15b=a244_0x3bb1();let _0x3da81e=_0x3bb15b[_0x2d3933];return _0x3da81e;}export function readAppRuleType(_0x16f736){const _0x1e0ab1=a244_0x5644e6,_0x225b45=_0x16f736[_0x1e0ab1(0xa0)]('type')[_0x1e0ab1(0x8e)]()['toLowerCase']();if(_0x225b45!==_0x1e0ab1(0x8b)&&_0x225b45!==_0x1e0ab1(0x98))throw appRuleError('app_rule_type_invalid','--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0x225b45;}export function appRuleFileName(_0x213773){return APP_RULE_FILES[_0x213773];}export function appRuleContextScope(_0x5293b2){return APP_RULE_CONTEXT_SCOPES[_0x5293b2];}export function inspectAppRuleContent(_0x26205f){const _0x1fefb3=a244_0x5644e6,_0x5a6e61=Buffer[_0x1fefb3(0xac)](_0x26205f,_0x1fefb3(0xab));return{'content':_0x26205f,'byteSize':_0x5a6e61[_0x1fefb3(0x9f)],'contentHash':_0x1fefb3(0x90)+createHash(_0x1fefb3(0xa4))[_0x1fefb3(0x92)](_0x5a6e61)['digest'](_0x1fefb3(0x85))};}export async function readAppRuleFile(_0xd0ff98){const _0x2c8bc0=a244_0x5644e6,_0x4e36ec=_0xd0ff98[_0x2c8bc0(0x8e)]();if(!_0x4e36ec)throw appRuleError('app_rule_file_required',_0x2c8bc0(0xa1),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x25d9a3=resolve(_0x4e36ec);let _0x39249e;try{_0x39249e=await stat(_0x25d9a3);}catch(_0x172a3e){throw appRuleError(_0x2c8bc0(0x88),'Cannot\x20access\x20app\x20rule\x20file:\x20'+_0x4e36ec,_0x172a3e instanceof Error?_0x172a3e[_0x2c8bc0(0xa9)]:String(_0x172a3e));}if(!_0x39249e[_0x2c8bc0(0x96)]())throw appRuleError('app_rule_file_invalid','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x4e36ec);if(_0x39249e[_0x2c8bc0(0xa6)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x2c8bc0(0xa7),_0x2c8bc0(0x8a));let _0x22045f;try{_0x22045f=await readFile(_0x25d9a3);}catch(_0x39e751){throw appRuleError(_0x2c8bc0(0x88),'Cannot\x20read\x20app\x20rule\x20file:\x20'+_0x4e36ec,_0x39e751 instanceof Error?_0x39e751[_0x2c8bc0(0xa9)]:String(_0x39e751));}if(_0x22045f[_0x2c8bc0(0x9f)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x2c8bc0(0xa7),_0x2c8bc0(0x8a));let _0x19676e;try{_0x19676e=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})['decode'](_0x22045f);}catch{throw appRuleError(_0x2c8bc0(0x8f),_0x2c8bc0(0x84)+_0x4e36ec);}if(_0x19676e['length']>MAX_APP_RULE_UNITS)throw appRuleError(_0x2c8bc0(0xa7),_0x2c8bc0(0x9d));if(!_0x19676e[_0x2c8bc0(0x8e)]())throw appRuleError(_0x2c8bc0(0x8f),'App\x20rule\x20file\x20is\x20blank:\x20'+_0x4e36ec);return inspectAppRuleContent(_0x19676e);}export function projectAppRule(_0x30e8d,_0x462d02){const _0xffb08b=a244_0x5644e6;if(!_0x462d02)return{'type':_0x30e8d,'fileName':appRuleFileName(_0x30e8d),'contextScope':appRuleContextScope(_0x30e8d),'enabled':![]};const _0x4981e9=inspectAppRuleContent(_0x462d02['content']);return{'type':_0x30e8d,'fileName':appRuleFileName(_0x30e8d),'contextScope':appRuleContextScope(_0x30e8d),'enabled':!![],'id':_0x462d02['id'],'scope':_0x462d02['scope'],'appCode':_0x462d02[_0xffb08b(0x9e)],'version':_0x462d02['version'],..._0x462d02[_0xffb08b(0x9c)]!==undefined?{'indexStatus':_0x462d02[_0xffb08b(0x9c)]}:{},'contentByteSize':_0x4981e9[_0xffb08b(0x9a)],'contentHash':_0x4981e9[_0xffb08b(0xaa)],..._0x462d02[_0xffb08b(0x93)]!==undefined&&_0x462d02['createTime']!==null?{'createTime':_0x462d02[_0xffb08b(0x93)]}:{},..._0x462d02[_0xffb08b(0x8c)]!==undefined&&_0x462d02[_0xffb08b(0x8c)]!==null?{'updateTime':_0x462d02[_0xffb08b(0x8c)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x5644e6(0x97),'type':a244_0x5644e6(0x83),'required':!![],'description':a244_0x5644e6(0x89),'enum':[...APP_RULE_TYPES]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a245_0x599f59=a245_0x1b34;(function(_0x28762f,_0x411525){const _0x4df9b9=a245_0x1b34,_0xe50b6e=_0x28762f();while(!![]){try{const _0x29e457=parseInt(_0x4df9b9(0x132))/0x1+-parseInt(_0x4df9b9(0x12e))/0x2*(-parseInt(_0x4df9b9(0x158))/0x3)+-parseInt(_0x4df9b9(0x152))/0x4*(parseInt(_0x4df9b9(0x135))/0x5)+parseInt(_0x4df9b9(0x156))/0x6+parseInt(_0x4df9b9(0x133))/0x7+parseInt(_0x4df9b9(0x16c))/0x8*(parseInt(_0x4df9b9(0x153))/0x9)+parseInt(_0x4df9b9(0x145))/0xa*(-parseInt(_0x4df9b9(0x164))/0xb);if(_0x29e457===_0x411525)break;else _0xe50b6e['push'](_0xe50b6e['shift']());}catch(_0x16fbc8){_0xe50b6e['push'](_0xe50b6e['shift']());}}}(a245_0xa241,0x8bae8));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a245_0x599f59(0x159),a245_0x599f59(0x14d)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x599f59(0x159),'dev',a245_0x599f59(0x134),a245_0x599f59(0x13a)]);export function syncProjectDomainRoutingBeforeScript(_0x5ea0bb,_0x3677ac){const _0x586424=a245_0x599f59;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x586424(0x155)](_0x3677ac))return null;const _0x53d6f0=findProjectRootDirectory(_0x5ea0bb);if(!resolveConfigPath(_0x53d6f0))return null;const _0x1792ec=writeProjectDomainRoutingManifest(_0x53d6f0);return{'path':_0x1792ec[_0x586424(0x15d)],'changed':_0x1792ec[_0x586424(0x14f)]};}function readPackageScripts(_0x9b184c){const _0x1e49fd=a245_0x599f59,_0x11802c=resolve(_0x9b184c,_0x1e49fd(0x171));if(!existsSync(_0x11802c))return null;try{const _0xd6c097=JSON[_0x1e49fd(0x139)](readFileSync(_0x11802c,_0x1e49fd(0x13e)));return _0xd6c097['scripts']??{};}catch{return null;}}function a245_0x1b34(_0x17e0f0,_0x51233b){_0x17e0f0=_0x17e0f0-0x12a;const _0xa241bf=a245_0xa241();let _0x1b3489=_0xa241bf[_0x17e0f0];return _0x1b3489;}function detectPackageManager(_0x7f4454){const _0x542a0f=a245_0x599f59;if(existsSync(resolve(_0x7f4454,_0x542a0f(0x12b)))||existsSync(resolve(_0x7f4454,_0x542a0f(0x13d))))return _0x542a0f(0x12d);if(existsSync(resolve(_0x7f4454,'pnpm-lock.yaml')))return _0x542a0f(0x12a);if(existsSync(resolve(_0x7f4454,_0x542a0f(0x137))))return _0x542a0f(0x16e);return _0x542a0f(0x14c);}async function versionCheck(_0x60452b){const _0x115921=a245_0x599f59,_0x5ad0d1=await checkCliVersion();(_0x5ad0d1['needsUpgrade']||_0x5ad0d1[_0x115921(0x169)])&&(printCliUpgradeWarning(_0x5ad0d1),assertCliVersionSupported(_0x5ad0d1));const _0x16ef81=await checkSdkVersion(_0x60452b);if(_0x16ef81[_0x115921(0x147)])printSdkUpgradeWarning(_0x16ef81);}function spawnScript(_0x410d2e,_0x5611ed,_0x213fc5,_0x147f90){return new Promise((_0x345dcf,_0x893ee3)=>{const _0x2763c6=a245_0x1b34,_0x544a27=[_0x2763c6(0x13f),_0x5611ed,..._0x213fc5],_0x1c22f3=spawn(_0x410d2e,_0x544a27,{'cwd':_0x147f90,'stdio':_0x2763c6(0x138),'shell':!![],'env':{...process.env,'PATH':''+join(_0x147f90,_0x2763c6(0x15f),'.bin')+delimiter+process.env.PATH}});_0x1c22f3['on'](_0x2763c6(0x16b),_0x2b0b39=>{const _0x5d0eb5=_0x2763c6;if(_0x2b0b39===0x0||_0x2b0b39===null)_0x345dcf();else _0x893ee3(new Error(_0x410d2e+_0x5d0eb5(0x157)+_0x5611ed+_0x5d0eb5(0x15e)+_0x2b0b39));}),_0x1c22f3['on'](_0x2763c6(0x130),_0x893ee3);});}function spawnViteBuildWatch(_0x323842){return new Promise((_0x33062c,_0x200925)=>{const _0x1d2698=a245_0x1b34,_0x9dbb4d=spawn(_0x1d2698(0x14b),[_0x1d2698(0x134),_0x1d2698(0x136)],{'cwd':_0x323842,'stdio':_0x1d2698(0x138),'shell':!![],'env':{...process.env,'PATH':''+join(_0x323842,_0x1d2698(0x15f),'.bin')+delimiter+process.env.PATH}});_0x9dbb4d['on'](_0x1d2698(0x16b),_0x5e6825=>{const _0xbd09f=_0x1d2698;if(_0x5e6825===0x0||_0x5e6825===null)_0x33062c();else _0x200925(new Error(_0xbd09f(0x165)+_0x5e6825));}),_0x9dbb4d['on'](_0x1d2698(0x130),_0x200925);});}function spawnVitePreview(_0x1b048b){return new Promise((_0x15cdde,_0x728f88)=>{const _0x36a1ee=a245_0x1b34,_0x48a50e=spawn('vite',[_0x36a1ee(0x13a)],{'cwd':_0x1b048b,'stdio':_0x36a1ee(0x138),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1b048b,_0x36a1ee(0x15f),_0x36a1ee(0x146))+delimiter+process.env.PATH}});_0x48a50e['on']('close',_0x326912=>{const _0x5381e8=_0x36a1ee;if(_0x326912===0x0||_0x326912===null)_0x15cdde();else _0x728f88(new Error(_0x5381e8(0x16a)+_0x326912));}),_0x48a50e['on'](_0x36a1ee(0x130),_0x728f88);});}function a245_0xa241(){const _0xcc9804=['48fpHakG','Enable\x20watch\x20mode\x20for\x20preview','yarn','\x0a\x20\x20Usage:\x20','cwd','package.json','pnpm','bun.lockb','\x22\x20not\x20found\x20in\x20package.json.','bun','2VvAReT','\x20run\x20<script>\x0a','error','keys','997171ZszkJj','1481648cVozsZ','build','10IVpwSW','--watch','yarn.lock','inherit','parse','preview','slice','write','bun.lock','utf-8','run','\x20run\x20preview','\x20run\x20build','\x20run\x20preview\x20--watch','No\x20package.json\x20found\x20in\x20current\x20directory.','No\x20scripts\x20defined\x20in\x20package.json.','5510piVASx','.bin','needsUpgrade','log','Script\x20name\x20defined\x20in\x20package.json','\x0a\x20\x20Available\x20scripts:\x0a','vite','npm','dev','Run\x20a\x20package.json\x20script','changed','all','Available:\x20','1763636kaCAAA','1442313xzHMUC','validation','has','1078728NnQEuA','\x20run\x20','1761243UxpPTJ','start','Domain\x20routing\x20synchronized:\x20','watch','\x20\x20EXAMPLES','path','\x20exited\x20with\x20code\x20','node_modules','\x20\x20\x20\x20','Script\x20\x22','join','push','29612ksRVHL','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20run\x20start','args','bool','belowMinimum','vite\x20preview\x20exited\x20with\x20code\x20','close'];a245_0xa241=function(){return _0xcc9804;};return a245_0xa241();}const runFlags=[{'name':a245_0x599f59(0x15b),'type':'boolean','description':a245_0x599f59(0x16d),'default':![]}];export const runDefinition={'service':a245_0x599f59(0x13f),'command':'run','description':a245_0x599f59(0x14e),'risk':a245_0x599f59(0x13c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':a245_0x599f59(0x149),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x390a33=a245_0x599f59,_0x5a1487=[];return _0x5a1487[_0x390a33(0x163)](_0x390a33(0x15c)),_0x5a1487[_0x390a33(0x163)](_0x390a33(0x160)+CLI_BIN_NAME+_0x390a33(0x166)),_0x5a1487[_0x390a33(0x163)](_0x390a33(0x160)+CLI_BIN_NAME+_0x390a33(0x141)),_0x5a1487['push'](_0x390a33(0x160)+CLI_BIN_NAME+_0x390a33(0x140)),_0x5a1487[_0x390a33(0x163)](_0x390a33(0x160)+CLI_BIN_NAME+_0x390a33(0x142)),_0x5a1487[_0x390a33(0x162)]('\x0a');},async 'execute'(_0x3b4bd9){const _0x2654d1=a245_0x599f59,_0x1e45b9=process[_0x2654d1(0x170)](),_0x3c67b9=_0x3b4bd9[_0x2654d1(0x167)][0x0],_0x398a08=_0x3b4bd9[_0x2654d1(0x167)][_0x2654d1(0x13b)](0x1),_0x9d04cd=readPackageScripts(_0x1e45b9);if(!_0x9d04cd)throw CliErrors['validation'](_0x2654d1(0x143));if(!_0x3c67b9){const _0x3b6416=Object[_0x2654d1(0x131)](_0x9d04cd);if(_0x3b6416['length']===0x0)console['log'](_0x2654d1(0x144));else{console['log'](_0x2654d1(0x14a));for(const _0x20358c of _0x3b6416){console[_0x2654d1(0x148)](_0x2654d1(0x160)+_0x20358c);}console[_0x2654d1(0x148)](_0x2654d1(0x16f)+CLI_BIN_NAME+_0x2654d1(0x12f));}return{'ok':!![]};}if(!_0x9d04cd[_0x3c67b9])throw CliErrors[_0x2654d1(0x154)](_0x2654d1(0x161)+_0x3c67b9+_0x2654d1(0x12c),_0x2654d1(0x151)+(Object['keys'](_0x9d04cd)['join'](',\x20')||'(none)'));const _0x5a3ee5=detectPackageManager(_0x1e45b9),_0x1730e2=syncProjectDomainRoutingBeforeScript(_0x1e45b9,_0x3c67b9);_0x1730e2?.[_0x2654d1(0x14f)]&&console[_0x2654d1(0x130)](_0x2654d1(0x15a)+_0x1730e2[_0x2654d1(0x15d)]);VERSION_CHECK_SCRIPTS[_0x2654d1(0x155)](_0x3c67b9)&&await versionCheck(_0x1e45b9);if(_0x3c67b9===_0x2654d1(0x13a)&&_0x3b4bd9[_0x2654d1(0x168)](_0x2654d1(0x15b)))return await Promise[_0x2654d1(0x150)]([spawnViteBuildWatch(_0x1e45b9),spawnVitePreview(_0x1e45b9)]),{'ok':!![]};return await spawnScript(_0x5a3ee5,_0x3c67b9,_0x398a08,_0x1e45b9),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a246_0x93ef6d=a246_0x4f34;function a246_0x4f34(_0xd13647,_0x2cf494){_0xd13647=_0xd13647-0x159;const _0x31155d=a246_0x3115();let _0x4f34aa=_0x31155d[_0xd13647];return _0x4f34aa;}(function(_0x5966ce,_0x268d61){const _0x34f497=a246_0x4f34,_0x1d7168=_0x5966ce();while(!![]){try{const _0x416100=parseInt(_0x34f497(0x15e))/0x1+parseInt(_0x34f497(0x15f))/0x2+-parseInt(_0x34f497(0x15b))/0x3+-parseInt(_0x34f497(0x15d))/0x4*(parseInt(_0x34f497(0x160))/0x5)+parseInt(_0x34f497(0x159))/0x6*(parseInt(_0x34f497(0x15c))/0x7)+parseInt(_0x34f497(0x15a))/0x8+parseInt(_0x34f497(0x162))/0x9;if(_0x416100===_0x268d61)break;else _0x1d7168['push'](_0x1d7168['shift']());}catch(_0x2ba23c){_0x1d7168['push'](_0x1d7168['shift']());}}}(a246_0x3115,0xb476e));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x1fd9c9){const _0x1edf4f=await buildSchemaPayload();return{'ok':!![],'data':_0x1edf4f};}function a246_0x3115(){const _0x49065e=['262562fSKaZR','1054190HPDehv','schema','6395895VpsFTZ','18wIrHJL','596160zOxOZn','4032384ussfzo','2192148lzUBbL','12KycKfx','859876GAIVru'];a246_0x3115=function(){return _0x49065e;};return a246_0x3115();}export const schemaDefinition={'service':a246_0x93ef6d(0x161),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a247_0x2ed3f2=a247_0x2c78;(function(_0x4263fb,_0x242193){const _0x44eb6e=a247_0x2c78,_0x3d133a=_0x4263fb();while(!![]){try{const _0x1dc8b4=parseInt(_0x44eb6e(0x1e2))/0x1*(parseInt(_0x44eb6e(0x200))/0x2)+parseInt(_0x44eb6e(0x207))/0x3*(-parseInt(_0x44eb6e(0x1f1))/0x4)+parseInt(_0x44eb6e(0x204))/0x5+-parseInt(_0x44eb6e(0x206))/0x6*(-parseInt(_0x44eb6e(0x1da))/0x7)+-parseInt(_0x44eb6e(0x1f4))/0x8+-parseInt(_0x44eb6e(0x1f5))/0x9+parseInt(_0x44eb6e(0x1f3))/0xa;if(_0x1dc8b4===_0x242193)break;else _0x3d133a['push'](_0x3d133a['shift']());}catch(_0x2773ae){_0x3d133a['push'](_0x3d133a['shift']());}}}(a247_0x4ad0,0xe3068));import{writeFile}from'node:fs/promises';function a247_0x4ad0(){const _0x5bcec0=['appCode','map','length','Invalid\x20database\x20selection\x20payload:\x20','mode','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Local\x20SQL\x20file\x20mode','23485YsGoCZ','sqlCode','sqlRoot','catch','description','dbId','db-id','isInteger','343481uEaIDL','lockFilePath','SQL\x20name:','__manual__','SQL\x20name\x20cannot\x20be\x20empty','✎\x20Enter\x20dbId\x20manually','Target\x20database\x20dbId:','write','Plain\x20SQL\x20(sql)','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','File\x20already\x20exists:\x20','mybatisXml','sql','new','8vtKdPa','\x20\x20SELECT\x201\x20AS\x20id','42087680aIHqev','10085456kBlkwO','12560445clRIrr','str','name','POST','utf8','<server-generated-sqlCode>','trim','SQL\x20query\x20display\x20name','MyBatis\x20XML\x20(mybatisXml)','number','sqlRootDir','6IUkHxS','sqls','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','isFinite','152565nMZUyL','Created\x20SQL\x20query\x20','18MdDpYK','2540409VavjAA','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','parse','nonInteractive','flagMissing','string','toISOString','sqlName','dbId\x20cannot\x20be\x20empty','/smartapi/custom/saveUserCustomSql','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','join','dbName'];a247_0x4ad0=function(){return _0x5bcec0;};return a247_0x4ad0();}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';function a247_0x2c78(_0x39575b,_0x53c1d1){_0x39575b=_0x39575b-0x1d9;const _0x4ad0c4=a247_0x4ad0();let _0x2c783a=_0x4ad0c4[_0x39575b];return _0x2c783a;}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(_0x1f0f26){const _0x45d43f=a247_0x2c78;if(_0x1f0f26==='mybatisXml')return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x45d43f(0x1f2),'</select>','']['join']('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0x45d43f(0x212)]('\x0a');}export const sqlCreate={'service':a247_0x2ed3f2(0x1ef),'command':'create','description':a247_0x2ed3f2(0x219),'risk':a247_0x2ed3f2(0x1e9),'flags':[{'name':a247_0x2ed3f2(0x1f7),'type':a247_0x2ed3f2(0x20c),'description':a247_0x2ed3f2(0x1fc)},{'name':a247_0x2ed3f2(0x1e0),'type':a247_0x2ed3f2(0x1fe),'description':'Target\x20database\x20ID'},{'name':'mode','type':a247_0x2ed3f2(0x20c),'enum':[a247_0x2ed3f2(0x1ef),a247_0x2ed3f2(0x1ee)],'description':a247_0x2ed3f2(0x1d9)}],async 'validate'(_0x1c5a28){const _0x1ef209=a247_0x2ed3f2;if(!_0x1c5a28[_0x1ef209(0x20a)])return;if(!_0x1c5a28['str'](_0x1ef209(0x1f7))[_0x1ef209(0x1fb)]())throw CliErrors[_0x1ef209(0x20b)](_0x1ef209(0x1f7),_0x1ef209(0x208));const _0x350372=resolveProvidedDbId(_0x1c5a28);if(typeof _0x350372!==_0x1ef209(0x1fe)||!Number[_0x1ef209(0x203)](_0x350372)||_0x350372<=0x0)throw CliErrors[_0x1ef209(0x20b)](_0x1ef209(0x1e0),_0x1ef209(0x211));if(!_0x1c5a28['str'](_0x1ef209(0x218))[_0x1ef209(0x1fb)]())throw CliErrors[_0x1ef209(0x20b)](_0x1ef209(0x218),_0x1ef209(0x1ec));},async 'dryRun'(_0x3bae48){const _0xf5ce52=a247_0x2ed3f2,_0x4d2072=loadSqlProjectConfig(_0x3bae48['appCode']),{sqlName:_0x467295,dbId:_0xf59b70,dbName:_0x1c48a2,mode:_0x135adf}=await resolveSqlNewInputs(_0x3bae48),_0x261965=buildSqlRelativePath(_0xf5ce52(0x1fa),_0x467295,_0x1c48a2,_0x135adf,_0xf59b70),_0x3d84e7=_0x4d2072[_0xf5ce52(0x1ff)]+'/'+_0x261965;return{'method':_0xf5ce52(0x1f8),'url':_0xf5ce52(0x210),'body':{'appCode':_0x3bae48['appCode'],'sqlName':_0x467295,'dbId':_0xf59b70,'mode':_0x135adf,'localPath':_0x3d84e7},'description':_0xf5ce52(0x202)+_0x4d2072[_0xf5ce52(0x1ff)]};},async 'execute'(_0x57f9da){const _0x15d88=a247_0x2ed3f2,_0x304fc7=loadSqlProjectConfig(_0x57f9da[_0x15d88(0x214)]),{sqlName:_0x661a47,dbId:_0x99c219,dbName:_0x5b9902,mode:_0x40abea}=await resolveSqlNewInputs(_0x57f9da),_0x4befa4=generateSqlTemplate(_0x40abea),_0x3e3338=await createSqlQuery({'appCode':_0x57f9da[_0x15d88(0x214)],'sqlName':_0x661a47,'dbId':_0x99c219,'sqlContent':_0x4befa4}),_0x117a38=ensureRemoteSqlContent(_0x3e3338),_0x4d36bf=_0x5b9902||await getDbName(_0x57f9da[_0x15d88(0x214)],_0x99c219)[_0x15d88(0x1dd)](()=>undefined),_0x1d58c2=buildSqlRelativePath(_0x3e3338[_0x15d88(0x1db)],_0x3e3338[_0x15d88(0x20e)],_0x4d36bf,_0x40abea,_0x99c219),_0x5f1c2e=_0x304fc7[_0x15d88(0x1ff)]+'/'+_0x1d58c2,_0x40e464=buildLocalSqlFileContent({'sqlCode':_0x3e3338['sqlCode'],'sqlName':_0x3e3338[_0x15d88(0x20e)],'dbId':_0x3e3338['dbId']},_0x117a38,{'dbName':_0x4d36bf,'mode':_0x40abea,'syncedAt':new Date()[_0x15d88(0x20d)](),'description':_0x3e3338[_0x15d88(0x1de)]});if(await fileExists(_0x5f1c2e))throw CliErrors['validation'](_0x15d88(0x1ed)+_0x5f1c2e);await ensureParentDirectory(_0x5f1c2e),await writeFile(_0x5f1c2e,_0x40e464,_0x15d88(0x1f9));const _0x39f4df=await readSqlLockFile(_0x304fc7['lockFilePath']),{lockData:_0x182e04,appLock:_0x471c05}=ensureSqlLockScope(_0x39f4df??createEmptySqlLock(),_0x304fc7['appCode'],_0x304fc7[_0x15d88(0x1dc)],_0x15d88(0x1f0));return _0x471c05[_0x15d88(0x201)][_0x3e3338[_0x15d88(0x1db)]]={...buildSqlLockEntry(_0x3e3338,_0x117a38,computeSqlContentHash(_0x40e464),{'dbName':_0x4d36bf}),'path':_0x1d58c2,'mode':_0x40abea},_0x471c05['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x304fc7[_0x15d88(0x1e3)],_0x182e04),{'ok':!![],'data':{'id':_0x3e3338['id'],'sqlCode':_0x3e3338[_0x15d88(0x1db)],'sqlName':_0x3e3338[_0x15d88(0x20e)],'dbId':_0x3e3338[_0x15d88(0x1df)],'path':_0x5f1c2e,'mode':_0x40abea},'message':_0x15d88(0x205)+_0x3e3338[_0x15d88(0x1db)]};}};async function resolveSqlNewInputs(_0x4f107d){const _0x3a7c9f=await resolveSqlNameInput(_0x4f107d),{dbId:_0x5261bf,dbName:_0x1269cf}=await resolveDbSelection(_0x4f107d),_0x58a4db=await resolveSqlModeInput(_0x4f107d);return{'sqlName':_0x3a7c9f,'dbId':_0x5261bf,'dbName':_0x1269cf,'mode':_0x58a4db};}async function resolveSqlNameInput(_0x57b545){const _0x2e4e23=a247_0x2ed3f2,_0x4c6903=_0x57b545[_0x2e4e23(0x1f6)](_0x2e4e23(0x1f7))[_0x2e4e23(0x1fb)]();if(_0x4c6903)return _0x4c6903;if(_0x57b545['nonInteractive'])throw CliErrors[_0x2e4e23(0x20b)](_0x2e4e23(0x1f7),_0x2e4e23(0x208));return(await input({'message':_0x2e4e23(0x1e4),'validate':_0x49b37f=>_0x49b37f['trim']()?!![]:_0x2e4e23(0x1e6)}))[_0x2e4e23(0x1fb)]();}async function resolveDbSelection(_0x194bbe){const _0x5b1b71=a247_0x2ed3f2,_0x39df54=resolveProvidedDbId(_0x194bbe);if(typeof _0x39df54===_0x5b1b71(0x1fe)&&Number['isFinite'](_0x39df54)&&_0x39df54>0x0)return{'dbId':_0x39df54,'dbName':await getDbName(_0x194bbe[_0x5b1b71(0x214)],_0x39df54)[_0x5b1b71(0x1dd)](()=>undefined)};if(_0x194bbe[_0x5b1b71(0x20a)])throw CliErrors[_0x5b1b71(0x20b)](_0x5b1b71(0x1e0),_0x5b1b71(0x211));const _0x3327df=await listDatabases(_0x194bbe['appCode'])[_0x5b1b71(0x1dd)](()=>[]);if(_0x3327df[_0x5b1b71(0x216)]===0x1)return{'dbId':_0x3327df[0x0]['dbId'],'dbName':_0x3327df[0x0][_0x5b1b71(0x213)]};if(_0x3327df[_0x5b1b71(0x216)]>0x1){const _0x316c32=await select({'message':'Select\x20the\x20target\x20database:','choices':[..._0x3327df[_0x5b1b71(0x215)](_0x180d4f=>({'name':_0x180d4f[_0x5b1b71(0x213)]+'\x20('+_0x180d4f['dbId']+')','value':serializeDbSelection(_0x180d4f)})),{'name':_0x5b1b71(0x1e7),'value':_0x5b1b71(0x1e5)}]});if(_0x316c32!==_0x5b1b71(0x1e5))return deserializeDbSelection(_0x316c32);}const _0xc59731=await input({'message':_0x5b1b71(0x1e8),'validate':_0xb2dbd5=>{const _0x1d71b1=_0x5b1b71,_0x24ea46=_0xb2dbd5['trim']();if(!_0x24ea46)return _0x1d71b1(0x20f);const _0x59c4f0=Number(_0x24ea46);if(!Number[_0x1d71b1(0x1e1)](_0x59c4f0)||_0x59c4f0<=0x0)return'dbId\x20must\x20be\x20a\x20positive\x20integer';return!![];}});return{'dbId':Number(_0xc59731['trim']())};}async function resolveSqlModeInput(_0x376980){const _0x385646=a247_0x2ed3f2,_0x319f3b=_0x376980[_0x385646(0x1f6)](_0x385646(0x218))[_0x385646(0x1fb)]();if(_0x319f3b===_0x385646(0x1ef)||_0x319f3b===_0x385646(0x1ee))return _0x319f3b;if(_0x376980['nonInteractive'])throw CliErrors[_0x385646(0x20b)](_0x385646(0x218),_0x385646(0x1ec));return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x385646(0x1ea),'value':_0x385646(0x1ef),'description':_0x385646(0x1eb)},{'name':_0x385646(0x1fd),'value':'mybatisXml','description':'For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags'}]});}function serializeDbSelection(_0x1e3935){const _0x315443=a247_0x2ed3f2;return JSON['stringify']({'dbId':_0x1e3935[_0x315443(0x1df)],'dbName':_0x1e3935[_0x315443(0x213)]});}function deserializeDbSelection(_0x11d7df){const _0x594e50=a247_0x2ed3f2;try{const _0x3a07b3=JSON[_0x594e50(0x209)](_0x11d7df);if(typeof _0x3a07b3[_0x594e50(0x1df)]===_0x594e50(0x1fe)&&Number[_0x594e50(0x203)](_0x3a07b3[_0x594e50(0x1df)]))return{'dbId':_0x3a07b3['dbId'],'dbName':_0x3a07b3['dbName']};}catch{}throw CliErrors['validation'](_0x594e50(0x217)+_0x11d7df);}function resolveProvidedDbId(_0x582a20){const _0x1a8fbe=a247_0x2ed3f2,_0x553076=_0x582a20['flag']('db-id');if(typeof _0x553076===_0x1a8fbe(0x1fe)&&Number[_0x1a8fbe(0x203)](_0x553076))return _0x553076;return undefined;}
|
|
1
|
+
const a247_0xce62b3=a247_0x26c6;(function(_0x262efa,_0x335d71){const _0x23a803=a247_0x26c6,_0x5ab64b=_0x262efa();while(!![]){try{const _0x5abfcf=parseInt(_0x23a803(0xea))/0x1+-parseInt(_0x23a803(0xcb))/0x2*(-parseInt(_0x23a803(0xda))/0x3)+-parseInt(_0x23a803(0xf2))/0x4*(parseInt(_0x23a803(0xfa))/0x5)+-parseInt(_0x23a803(0xcf))/0x6*(-parseInt(_0x23a803(0xe1))/0x7)+parseInt(_0x23a803(0xc3))/0x8+-parseInt(_0x23a803(0xf3))/0x9*(-parseInt(_0x23a803(0xf6))/0xa)+parseInt(_0x23a803(0xd7))/0xb*(-parseInt(_0x23a803(0xed))/0xc);if(_0x5abfcf===_0x335d71)break;else _0x5ab64b['push'](_0x5ab64b['shift']());}catch(_0x5bc2fc){_0x5ab64b['push'](_0x5ab64b['shift']());}}}(a247_0x148e,0x34e88));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';function a247_0x26c6(_0x18d78c,_0x259ae6){_0x18d78c=_0x18d78c-0xbd;const _0x148e3c=a247_0x148e();let _0x26c6e0=_0x148e3c[_0x18d78c];return _0x26c6e0;}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(_0x33ed1b){const _0x4b43ed=a247_0x26c6;if(_0x33ed1b==='mybatisXml')return[_0x4b43ed(0xe3),'\x20\x20SELECT\x201\x20AS\x20id',_0x4b43ed(0xf8),''][_0x4b43ed(0xd4)]('\x0a');return[_0x4b43ed(0xcc),''][_0x4b43ed(0xd4)]('\x0a');}export const sqlCreate={'service':'sql','command':a247_0xce62b3(0xd1),'description':a247_0xce62b3(0xd2),'risk':a247_0xce62b3(0xd5),'flags':[{'name':a247_0xce62b3(0x100),'type':a247_0xce62b3(0xc6),'description':a247_0xce62b3(0xbe)},{'name':a247_0xce62b3(0xe5),'type':a247_0xce62b3(0xc9),'description':'Target\x20database\x20ID'},{'name':a247_0xce62b3(0xf4),'type':'string','enum':[a247_0xce62b3(0xc8),a247_0xce62b3(0xf5)],'description':a247_0xce62b3(0xf7)}],async 'validate'(_0x585e0c){const _0x4fceba=a247_0xce62b3;if(!_0x585e0c[_0x4fceba(0xef)])return;if(!_0x585e0c['str'](_0x4fceba(0x100))['trim']())throw CliErrors[_0x4fceba(0xc5)]('name',_0x4fceba(0xfd));const _0x5b4297=resolveProvidedDbId(_0x585e0c);if(typeof _0x5b4297!==_0x4fceba(0xc9)||!Number[_0x4fceba(0xee)](_0x5b4297)||_0x5b4297<=0x0)throw CliErrors['flagMissing']('db-id',_0x4fceba(0xde));if(!_0x585e0c['str']('mode')[_0x4fceba(0xc1)]())throw CliErrors[_0x4fceba(0xc5)](_0x4fceba(0xf4),_0x4fceba(0xd8));},async 'dryRun'(_0x260079){const _0x4fd6bf=a247_0xce62b3,_0x5e9c11=loadSqlProjectConfig(_0x260079[_0x4fd6bf(0xfe)]),{sqlName:_0x4251e3,dbId:_0xe7e4d9,dbName:_0x192c08,mode:_0x3d855a}=await resolveSqlNewInputs(_0x260079),_0xbde4d=buildSqlRelativePath(_0x4fd6bf(0xf9),_0x4251e3,_0x192c08,_0x3d855a,_0xe7e4d9),_0x1a23ca=_0x5e9c11[_0x4fd6bf(0x102)]+'/'+_0xbde4d;return{'method':_0x4fd6bf(0xd3),'url':_0x4fd6bf(0xe7),'body':{'appCode':_0x260079[_0x4fd6bf(0xfe)],'sqlName':_0x4251e3,'dbId':_0xe7e4d9,'mode':_0x3d855a,'localPath':_0x1a23ca},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x5e9c11[_0x4fd6bf(0x102)]};},async 'execute'(_0x2a5d40){const _0x367ffa=a247_0xce62b3,_0x5970e7=loadSqlProjectConfig(_0x2a5d40[_0x367ffa(0xfe)]),{sqlName:_0x5ba33f,dbId:_0x5532a6,dbName:_0x7631ac,mode:_0x1743a8}=await resolveSqlNewInputs(_0x2a5d40),_0x567ebb=generateSqlTemplate(_0x1743a8),_0x358e01=await createSqlQuery({'appCode':_0x2a5d40[_0x367ffa(0xfe)],'sqlName':_0x5ba33f,'dbId':_0x5532a6,'sqlContent':_0x567ebb}),_0x377760=ensureRemoteSqlContent(_0x358e01),_0x3d0ef9=_0x7631ac||await getDbName(_0x2a5d40[_0x367ffa(0xfe)],_0x5532a6)['catch'](()=>undefined),_0x5348ee=buildSqlRelativePath(_0x358e01[_0x367ffa(0xff)],_0x358e01[_0x367ffa(0xca)],_0x3d0ef9,_0x1743a8,_0x5532a6),_0x521fb5=_0x5970e7[_0x367ffa(0x102)]+'/'+_0x5348ee,_0x1df0ff=buildLocalSqlFileContent({'sqlCode':_0x358e01[_0x367ffa(0xff)],'sqlName':_0x358e01[_0x367ffa(0xca)],'dbId':_0x358e01[_0x367ffa(0xe0)]},_0x377760,{'dbName':_0x3d0ef9,'mode':_0x1743a8,'syncedAt':new Date()[_0x367ffa(0xce)](),'description':_0x358e01[_0x367ffa(0xc0)]});if(await fileExists(_0x521fb5))throw CliErrors['validation'](_0x367ffa(0xdc)+_0x521fb5);await ensureParentDirectory(_0x521fb5),await writeFile(_0x521fb5,_0x1df0ff,'utf8');const _0xe42b7c=await readSqlLockFile(_0x5970e7[_0x367ffa(0xe4)]),{lockData:_0x13ad9d,appLock:_0x67407f}=ensureSqlLockScope(_0xe42b7c??createEmptySqlLock(),_0x5970e7[_0x367ffa(0xfe)],_0x5970e7[_0x367ffa(0xec)],_0x367ffa(0xbf));return _0x67407f['sqls'][_0x358e01[_0x367ffa(0xff)]]={...buildSqlLockEntry(_0x358e01,_0x377760,computeSqlContentHash(_0x1df0ff),{'dbName':_0x3d0ef9}),'path':_0x5348ee,'mode':_0x1743a8},_0x67407f[_0x367ffa(0xc7)]=new Date()[_0x367ffa(0xce)](),await writeSqlLockFile(_0x5970e7[_0x367ffa(0xe4)],_0x13ad9d),{'ok':!![],'data':{'id':_0x358e01['id'],'sqlCode':_0x358e01[_0x367ffa(0xff)],'sqlName':_0x358e01['sqlName'],'dbId':_0x358e01[_0x367ffa(0xe0)],'path':_0x521fb5,'mode':_0x1743a8},'message':'Created\x20SQL\x20query\x20'+_0x358e01['sqlCode']};}};async function resolveSqlNewInputs(_0x346e0e){const _0x19eb89=await resolveSqlNameInput(_0x346e0e),{dbId:_0x11a483,dbName:_0x4004b4}=await resolveDbSelection(_0x346e0e),_0x4186da=await resolveSqlModeInput(_0x346e0e);return{'sqlName':_0x19eb89,'dbId':_0x11a483,'dbName':_0x4004b4,'mode':_0x4186da};}async function resolveSqlNameInput(_0x16359f){const _0x28ea3f=a247_0xce62b3,_0x1120c9=_0x16359f[_0x28ea3f(0xf0)](_0x28ea3f(0x100))[_0x28ea3f(0xc1)]();if(_0x1120c9)return _0x1120c9;if(_0x16359f[_0x28ea3f(0xef)])throw CliErrors[_0x28ea3f(0xc5)](_0x28ea3f(0x100),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':'SQL\x20name:','validate':_0x279f20=>_0x279f20[_0x28ea3f(0xc1)]()?!![]:_0x28ea3f(0xd9)}))[_0x28ea3f(0xc1)]();}async function resolveDbSelection(_0x8f7f93){const _0x302b57=a247_0xce62b3,_0x23c32d=resolveProvidedDbId(_0x8f7f93);if(typeof _0x23c32d==='number'&&Number[_0x302b57(0xee)](_0x23c32d)&&_0x23c32d>0x0)return{'dbId':_0x23c32d,'dbName':await getDbName(_0x8f7f93[_0x302b57(0xfe)],_0x23c32d)[_0x302b57(0xcd)](()=>undefined)};if(_0x8f7f93[_0x302b57(0xef)])throw CliErrors[_0x302b57(0xc5)]('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x2f53cb=await listDatabases(_0x8f7f93[_0x302b57(0xfe)])[_0x302b57(0xcd)](()=>[]);if(_0x2f53cb['length']===0x1)return{'dbId':_0x2f53cb[0x0][_0x302b57(0xe0)],'dbName':_0x2f53cb[0x0][_0x302b57(0x101)]};if(_0x2f53cb[_0x302b57(0xe8)]>0x1){const _0x526c33=await select({'message':'Select\x20the\x20target\x20database:','choices':[..._0x2f53cb[_0x302b57(0xe9)](_0x46d354=>({'name':_0x46d354[_0x302b57(0x101)]+'\x20('+_0x46d354[_0x302b57(0xe0)]+')','value':serializeDbSelection(_0x46d354)})),{'name':_0x302b57(0xd6),'value':_0x302b57(0xdf)}]});if(_0x526c33!==_0x302b57(0xdf))return deserializeDbSelection(_0x526c33);}const _0x13892c=await input({'message':_0x302b57(0xe2),'validate':_0x47639e=>{const _0x25c321=_0x302b57,_0x309aae=_0x47639e[_0x25c321(0xc1)]();if(!_0x309aae)return _0x25c321(0xbd);const _0x439ddf=Number(_0x309aae);if(!Number[_0x25c321(0xe6)](_0x439ddf)||_0x439ddf<=0x0)return _0x25c321(0xdb);return!![];}});return{'dbId':Number(_0x13892c['trim']())};}async function resolveSqlModeInput(_0xe050aa){const _0x1f031e=a247_0xce62b3,_0x17711f=_0xe050aa[_0x1f031e(0xf0)](_0x1f031e(0xf4))[_0x1f031e(0xc1)]();if(_0x17711f===_0x1f031e(0xc8)||_0x17711f===_0x1f031e(0xf5))return _0x17711f;if(_0xe050aa['nonInteractive'])throw CliErrors['flagMissing']('mode',_0x1f031e(0xd8));return await select({'message':_0x1f031e(0xfc),'choices':[{'name':'Plain\x20SQL\x20(sql)','value':_0x1f031e(0xc8),'description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':_0x1f031e(0xc2),'value':_0x1f031e(0xf5),'description':_0x1f031e(0xf1)}]});}function serializeDbSelection(_0x16e2ed){const _0x6e8806=a247_0xce62b3;return JSON[_0x6e8806(0xeb)]({'dbId':_0x16e2ed[_0x6e8806(0xe0)],'dbName':_0x16e2ed['dbName']});}function deserializeDbSelection(_0x13b939){const _0x2e43f6=a247_0xce62b3;try{const _0x44956f=JSON[_0x2e43f6(0xd0)](_0x13b939);if(typeof _0x44956f[_0x2e43f6(0xe0)]===_0x2e43f6(0xc9)&&Number[_0x2e43f6(0xee)](_0x44956f[_0x2e43f6(0xe0)]))return{'dbId':_0x44956f[_0x2e43f6(0xe0)],'dbName':_0x44956f['dbName']};}catch{}throw CliErrors[_0x2e43f6(0xfb)](_0x2e43f6(0xdd)+_0x13b939);}function resolveProvidedDbId(_0xe2e0ec){const _0x22f88a=a247_0xce62b3,_0x1e589b=_0xe2e0ec[_0x22f88a(0xc4)](_0x22f88a(0xe5));if(typeof _0x1e589b===_0x22f88a(0xc9)&&Number[_0x22f88a(0xee)](_0x1e589b))return _0x1e589b;return undefined;}function a247_0x148e(){const _0x54582c=['Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','POST','join','write','✎\x20Enter\x20dbId\x20manually','1595jOVwMh','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','SQL\x20name\x20cannot\x20be\x20empty','408xvVbQS','dbId\x20must\x20be\x20a\x20positive\x20integer','File\x20already\x20exists:\x20','Invalid\x20database\x20selection\x20payload:\x20','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','__manual__','dbId','25459Arpxpn','Target\x20database\x20dbId:','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','lockFilePath','db-id','isInteger','/smartapi/custom/saveUserCustomSql','length','map','311653rxYvpW','stringify','sqlRoot','43308IOrMGr','isFinite','nonInteractive','str','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','344YsAzFX','123426gDOnIy','mode','mybatisXml','40qKiClr','Local\x20SQL\x20file\x20mode','</select>','<server-generated-sqlCode>','13840MLIIJz','validation','Select\x20the\x20local\x20SQL\x20mode:','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','appCode','sqlCode','name','dbName','sqlRootDir','dbId\x20cannot\x20be\x20empty','SQL\x20query\x20display\x20name','new','description','trim','MyBatis\x20XML\x20(mybatisXml)','1718008vqeTCm','flag','flagMissing','string','lastSync','sql','number','sqlName','5354YSNruf','SELECT\x201\x20AS\x20id;','catch','toISOString','54gPslgq','parse','create'];a247_0x148e=function(){return _0x54582c;};return a247_0x148e();}
|