@lovrabet/rabetbase-cli 2.5.7-beta.1 → 2.5.7
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/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.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/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +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(_0x159034,_0x37ad56){const _0x3677e9=a229_0xdc0b,_0x36d813=_0x159034();while(!![]){try{const _0x1ffbef=-parseInt(_0x3677e9(0x1b1))/0x1+parseInt(_0x3677e9(0x1a2))/0x2+parseInt(_0x3677e9(0x1ad))/0x3+parseInt(_0x3677e9(0x192))/0x4*(parseInt(_0x3677e9(0x181))/0x5)+parseInt(_0x3677e9(0x1ae))/0x6+-parseInt(_0x3677e9(0x1a5))/0x7*(parseInt(_0x3677e9(0x17c))/0x8)+-parseInt(_0x3677e9(0x17a))/0x9*(-parseInt(_0x3677e9(0x187))/0xa);if(_0x1ffbef===_0x37ad56)break;else _0x36d813['push'](_0x36d813['shift']());}catch(_0x314649){_0x36d813['push'](_0x36d813['shift']());}}}(a229_0x29bc,0xe9d4f));import a229_0x4a37c0 from'chalk';import a229_0x14c143 from'ora';import{existsSync,readFileSync,writeFileSync}from'node:fs';import{resolve}from'node:path';function a229_0x29bc(){const _0x1f84b1=['latest','path','join','profiles','Upgrade\x20application\x20source','\x20\x20Historical\x20ungrouped\x20multi-app\x20directories\x20keep\x20their\x20prefixed\x20API\x20files.','188922EYtZSX','3303600zxvCWB','\x20\x20bun\x20install','Step\x202/2:\x20Application\x20source\x20—\x20','618151ikUkWJ','some','\x20\x20Step\x20','\x20\x20\x20\x20','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','Upgrade\x20@lovrabet/sdk','@lovrabet/sdk','@lovrabet/sdk:','\x20→\x20latest','start','push','fail','white','Your\x20project\x20is\x20already\x20up-to-date.','parse','sdkUpgrade','cwd','cyan','gray','label','upgrade\x20needed','green','882npwkrQ','candidatePath','6904XciJaV','yellow','Application\x20source:','object','Step\x202/2:\x20Upgrading\x20application\x20source\x20structure...','3654905wJqXtg','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','Upgrade\x20candidates\x20were\x20written,\x20but\x20project-owned\x20source\x20files\x20still\x20require\x20manual\x20merging.','succeed','action','up-to-date','12110BgCqog','padEnd','utf8','manualMergeRequired','bold','Proceed\x20with\x20upgrade?','apiArchitecture','done','files','dependencies','package.json','8ROZglv','\x20\x20npm\x20install','stringify','FAIL','red','source\x20structure\x20is\x20current','detail','string','log','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','apiDir','Upgrade\x20cancelled.','devDependencies','\x20\x20Current\x20version\x20in\x20','message','\x20\x20\x20\x20\x20\x20\x20','1909922HECSqj','needed','[\x22@lovrabet/sdk\x22]:\x20','12761VnfHrQ','failed'];a229_0x29bc=function(){return _0x1f84b1;};return a229_0x29bc();}import{askConfirm}from'../../commands/menu/shared/inquirer.js';import{analyzeProjectApiArchitecture,upgradeProjectApiArchitecture}from'../../commands/project/api-architecture-upgrade.js';import{NEW_CONFIG_NAME}from'../../context.js';function readProjectConfig(_0x4586b4){const _0x200451=a229_0xdc0b;try{const _0xcaebf6=JSON[_0x200451(0x172)](readFileSync(_0x4586b4,_0x200451(0x189)));return _0xcaebf6&&typeof _0xcaebf6===_0x200451(0x17f)?_0xcaebf6:{};}catch{return{};}}export function analyseProjectUpgrade(_0x12390e){const _0x447c94=a229_0xdc0b;let _0xbbf5fe=null;const _0x1832d2=resolve(_0x12390e,_0x447c94(0x191));if(existsSync(_0x1832d2))try{const _0x439d14=JSON[_0x447c94(0x172)](readFileSync(_0x1832d2,_0x447c94(0x189)));for(const _0x56405a of[_0x447c94(0x190),_0x447c94(0x19e)]){const _0x24f1c4=_0x439d14?.[_0x56405a]?.[_0x447c94(0x1b7)];if(typeof _0x24f1c4===_0x447c94(0x199)){_0x24f1c4!==_0x447c94(0x1a7)&&(_0xbbf5fe={'pkgPath':_0x1832d2,'currentVersion':_0x24f1c4,'field':_0x56405a});break;}}}catch{}const _0x20091e=resolve(_0x12390e,NEW_CONFIG_NAME),_0x726fd8=existsSync(_0x20091e)?readProjectConfig(_0x20091e):{},_0x2f7ddb=analyzeProjectApiArchitecture(_0x12390e,_0x726fd8);return{'sdkUpgrade':_0xbbf5fe,'apiArchitecture':_0x2f7ddb};}function a229_0xdc0b(_0xf00da,_0x440e28){_0xf00da=_0xf00da-0x170;const _0x29bc1b=a229_0x29bc();let _0xdc0b94=_0x29bc1b[_0xf00da];return _0xdc0b94;}function printReport(_0x316ad1){const _0x9792c3=a229_0xdc0b;console[_0x9792c3(0x19a)](''),console[_0x9792c3(0x19a)](a229_0x4a37c0['bold']('===\x20Upgrade\x20Analysis\x20===')),console[_0x9792c3(0x19a)](''),console[_0x9792c3(0x19a)](a229_0x4a37c0[_0x9792c3(0x175)](_0x9792c3(0x17e))+('\x20\x20'+(_0x316ad1['apiArchitecture']['needed']?a229_0x4a37c0[_0x9792c3(0x17d)](_0x9792c3(0x178)):a229_0x4a37c0[_0x9792c3(0x179)](_0x9792c3(0x186)))));for(const _0x3b4576 of _0x316ad1[_0x9792c3(0x18d)]['groups']){console[_0x9792c3(0x19a)]('\x20\x20'+_0x3b4576[_0x9792c3(0x19c)]+'\x20('+_0x3b4576[_0x9792c3(0x1aa)][_0x9792c3(0x1a9)](',\x20')+')');for(const _0x3dced0 of _0x3b4576[_0x9792c3(0x18f)]){console['log'](_0x9792c3(0x1b4)+_0x3dced0[_0x9792c3(0x185)][_0x9792c3(0x188)](0x11)+'\x20'+_0x3dced0[_0x9792c3(0x1a8)]),_0x3dced0['candidatePath']&&console[_0x9792c3(0x19a)]('\x20\x20\x20\x20\x20\x20candidate:\x20'+_0x3dced0[_0x9792c3(0x17b)]);}}_0x316ad1[_0x9792c3(0x18d)]['skippedLegacyDirectories']['length']>0x0&&console[_0x9792c3(0x19a)](_0x9792c3(0x1ac));console[_0x9792c3(0x19a)]('');if(_0x316ad1[_0x9792c3(0x173)]){const {currentVersion:_0x3b0995,field:_0x17f2b4,pkgPath:_0x3d0212}=_0x316ad1[_0x9792c3(0x173)];console[_0x9792c3(0x19a)](a229_0x4a37c0[_0x9792c3(0x175)](_0x9792c3(0x1b8))+('\x20\x20'+a229_0x4a37c0['yellow'](_0x3d0212))),console[_0x9792c3(0x19a)](_0x9792c3(0x19f)+_0x17f2b4+':\x20'+a229_0x4a37c0[_0x9792c3(0x17d)](_0x3b0995)+'\x20→\x20'+a229_0x4a37c0['green'](_0x9792c3(0x1a7))),console[_0x9792c3(0x19a)]('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console['log'](a229_0x4a37c0['cyan'](_0x9792c3(0x1b8))+'\x20\x20'+a229_0x4a37c0[_0x9792c3(0x176)]('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x9792c3(0x19a)]('');}function execUpgradeSdk(_0x83fb63){const _0x32a2f2=a229_0xdc0b;if(!_0x83fb63[_0x32a2f2(0x173)])return{'step':0x1,'label':_0x32a2f2(0x1b6),'ok':!![],'detail':_0x32a2f2(0x1b5)};const {pkgPath:_0x5c001d,currentVersion:_0x2712cd,field:_0x4b1dd6}=_0x83fb63[_0x32a2f2(0x173)];try{const _0x4da078=readFileSync(_0x5c001d,_0x32a2f2(0x189)),_0x136ce1=JSON[_0x32a2f2(0x172)](_0x4da078);return _0x136ce1[_0x4b1dd6]['@lovrabet/sdk']=_0x32a2f2(0x1a7),writeFileSync(_0x5c001d,JSON[_0x32a2f2(0x194)](_0x136ce1,null,0x2)+'\x0a',_0x32a2f2(0x189)),{'step':0x1,'label':_0x32a2f2(0x1b6),'ok':!![],'detail':_0x4b1dd6+_0x32a2f2(0x1a4)+_0x2712cd+_0x32a2f2(0x1b9)};}catch(_0x40eb7d){return{'step':0x1,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0x40eb7d instanceof Error?_0x40eb7d[_0x32a2f2(0x1a0)]:String(_0x40eb7d)};}}function printSummary(_0x5c3085){const _0x3ff114=a229_0xdc0b;console['log'](''),console[_0x3ff114(0x19a)](a229_0x4a37c0['bold']('===\x20Upgrade\x20Summary\x20===')),console[_0x3ff114(0x19a)]('');for(const _0x433d46 of _0x5c3085){const _0xd31cb2=_0x433d46['ok']?a229_0x4a37c0[_0x3ff114(0x179)]('OK'):a229_0x4a37c0[_0x3ff114(0x196)](_0x3ff114(0x195));console[_0x3ff114(0x19a)]('\x20\x20'+_0xd31cb2+_0x3ff114(0x1b3)+_0x433d46['step']+':\x20'+_0x433d46[_0x3ff114(0x177)]);if(_0x433d46[_0x3ff114(0x198)])console[_0x3ff114(0x19a)](_0x3ff114(0x1a1)+a229_0x4a37c0[_0x3ff114(0x176)](_0x433d46[_0x3ff114(0x198)]));}console[_0x3ff114(0x19a)]('');}export async function upgradeApp(_0x418768,_0x59eed4){const _0x53e0d1=a229_0xdc0b,_0xef45b5=process[_0x53e0d1(0x174)](),_0x315a11=analyseProjectUpgrade(_0xef45b5);if(!_0x315a11[_0x53e0d1(0x173)]&&!_0x315a11[_0x53e0d1(0x18d)][_0x53e0d1(0x1a3)])return console[_0x53e0d1(0x19a)](a229_0x4a37c0['green'](_0x53e0d1(0x171))),{'analysis':_0x315a11,'steps':[],'completed':!![]};printReport(_0x315a11);const _0x1e2841=!!(_0x59eed4['yes']||_0x59eed4['Y']||_0x418768);if(!_0x1e2841)try{const _0x3c57d7=await askConfirm(_0x53e0d1(0x18c));if(!_0x3c57d7)return console['log'](a229_0x4a37c0[_0x53e0d1(0x176)](_0x53e0d1(0x19d))),{'analysis':_0x315a11,'steps':[],'completed':![],'cancelled':!![]};}catch(_0x273bd2){if(_0x273bd2?.[_0x53e0d1(0x1a0)]==='CANCEL')return console[_0x53e0d1(0x19a)](a229_0x4a37c0['gray']('Upgrade\x20cancelled.')),{'analysis':_0x315a11,'steps':[],'completed':![],'cancelled':!![]};throw _0x273bd2;}const _0x56980f=[],_0x5e7ace=a229_0x14c143({'text':'Step\x201/2:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','color':'cyan'})[_0x53e0d1(0x1ba)](),_0x15041f=execUpgradeSdk(_0x315a11);_0x56980f[_0x53e0d1(0x1bb)](_0x15041f),_0x5e7ace[_0x15041f['ok']?_0x53e0d1(0x184):_0x53e0d1(0x1bc)]('Step\x201/2:\x20@lovrabet/sdk\x20—\x20'+(_0x15041f[_0x53e0d1(0x198)]??(_0x15041f['ok']?_0x53e0d1(0x18e):_0x53e0d1(0x1a6))));const _0x1d7d57=a229_0x14c143({'text':_0x53e0d1(0x180),'color':_0x53e0d1(0x175)})[_0x53e0d1(0x1ba)]();let _0x3fe4c1;try{_0x3fe4c1=await upgradeProjectApiArchitecture(_0xef45b5);const _0x3a5a21=_0x3fe4c1[_0x53e0d1(0x18a)]?'candidate\x20entrypoints\x20written;\x20manual\x20merge\x20required':_0x53e0d1(0x197);_0x1d7d57[_0x53e0d1(0x184)](_0x53e0d1(0x1b0)+_0x3a5a21),_0x56980f['push']({'step':0x2,'label':'Upgrade\x20application\x20source','ok':!![],'detail':_0x3a5a21});}catch(_0x30d228){const _0x3e8a9d=_0x30d228 instanceof Error?_0x30d228[_0x53e0d1(0x1a0)]:String(_0x30d228);_0x1d7d57['fail']('Step\x202/2:\x20Application\x20source\x20—\x20'+_0x3e8a9d),_0x56980f[_0x53e0d1(0x1bb)]({'step':0x2,'label':_0x53e0d1(0x1ab),'ok':![],'detail':_0x3e8a9d});}printSummary(_0x56980f);const _0x149ad1=_0x56980f[_0x53e0d1(0x1b2)](_0x553282=>!_0x553282['ok']);if(_0x149ad1)console[_0x53e0d1(0x19a)](a229_0x4a37c0[_0x53e0d1(0x17d)](_0x53e0d1(0x182)));else _0x3fe4c1?.[_0x53e0d1(0x18a)]?console[_0x53e0d1(0x19a)](a229_0x4a37c0['yellow'](_0x53e0d1(0x183))):console[_0x53e0d1(0x19a)](a229_0x4a37c0['green']('Upgrade\x20completed\x20successfully!'));return _0x15041f['ok']&&_0x315a11[_0x53e0d1(0x173)]&&(console[_0x53e0d1(0x19a)](''),console[_0x53e0d1(0x19a)](a229_0x4a37c0[_0x53e0d1(0x18b)][_0x53e0d1(0x175)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x53e0d1(0x19a)](a229_0x4a37c0['cyan'](_0x53e0d1(0x19b))),console[_0x53e0d1(0x19a)](''),console[_0x53e0d1(0x19a)](a229_0x4a37c0[_0x53e0d1(0x170)](_0x53e0d1(0x193))),console[_0x53e0d1(0x19a)](a229_0x4a37c0[_0x53e0d1(0x170)]('\x20\x20#\x20or')),console[_0x53e0d1(0x19a)](a229_0x4a37c0[_0x53e0d1(0x170)](_0x53e0d1(0x1af))),console[_0x53e0d1(0x19a)]('')),{'analysis':_0x315a11,'steps':_0x56980f,'apiArchitecture':_0x3fe4c1,'completed':!_0x149ad1&&!_0x3fe4c1?.[_0x53e0d1(0x18a)]};}
|
|
1
|
+
(function(_0x55d2c6,_0x5777c7){const _0x4adf94=a229_0x267c,_0x485801=_0x55d2c6();while(!![]){try{const _0x48c1e9=-parseInt(_0x4adf94(0x141))/0x1*(-parseInt(_0x4adf94(0x115))/0x2)+parseInt(_0x4adf94(0x149))/0x3*(parseInt(_0x4adf94(0x118))/0x4)+-parseInt(_0x4adf94(0x14c))/0x5*(parseInt(_0x4adf94(0x15d))/0x6)+parseInt(_0x4adf94(0x12e))/0x7*(parseInt(_0x4adf94(0x15f))/0x8)+-parseInt(_0x4adf94(0x121))/0x9+-parseInt(_0x4adf94(0x134))/0xa*(parseInt(_0x4adf94(0x151))/0xb)+parseInt(_0x4adf94(0x159))/0xc*(parseInt(_0x4adf94(0x14b))/0xd);if(_0x48c1e9===_0x5777c7)break;else _0x485801['push'](_0x485801['shift']());}catch(_0x7e81fc){_0x485801['push'](_0x485801['shift']());}}}(a229_0x1246,0x31de8));import a229_0x2d86af from'chalk';import a229_0x5b4dc9 from'ora';function a229_0x1246(){const _0x4b6aa2=['devDependencies','yellow','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','action','6IJUspK','length','13LITqRB','130VmmENE','some','\x20\x20\x20\x20','bold','Proceed\x20with\x20upgrade?','2409THgbSA','string','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','cyan','FAIL','source\x20structure\x20is\x20current','\x20\x20Current\x20version\x20in\x20','parse','600924BsNplH','Upgrade\x20candidates\x20were\x20written,\x20but\x20project-owned\x20source\x20files\x20still\x20require\x20manual\x20merging.','\x20\x20Historical\x20ungrouped\x20multi-app\x20directories\x20keep\x20their\x20prefixed\x20API\x20files.','path','89928kfeSKA','needed','644792srGRuR','message','profiles','start','gray','@lovrabet/sdk','Step\x201/2:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','object','sdkUpgrade','338962IYPReb','Step\x202/2:\x20Application\x20source\x20—\x20','white','694704dbQOEz','Upgrade\x20cancelled.','groups','up-to-date','succeed','utf8','Upgrade\x20@lovrabet/sdk','candidate\x20entrypoints\x20written;\x20manual\x20merge\x20required','Upgrade\x20application\x20source','1501209SeTWen','skippedLegacyDirectories','detail','step','label','manualMergeRequired','push','files','package.json','done','\x20\x20bun\x20install','[\x22@lovrabet/sdk\x22]:\x20','failed','28otCzQg','apiDir','apiArchitecture','dependencies','\x20\x20#\x20or','\x20\x20npm\x20install','5870asrdog','\x20→\x20','latest','log','join','green','@lovrabet/sdk:','fail','upgrade\x20needed','\x20\x20Step\x20','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','\x20→\x20latest','\x20\x20\x20\x20\x20\x20candidate:\x20','1tAKkkz','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','Your\x20project\x20is\x20already\x20up-to-date.','===\x20Upgrade\x20Analysis\x20==='];a229_0x1246=function(){return _0x4b6aa2;};return a229_0x1246();}import{existsSync,readFileSync,writeFileSync}from'node:fs';import{resolve}from'node:path';function a229_0x267c(_0x31187b,_0x595c90){_0x31187b=_0x31187b-0x111;const _0x124629=a229_0x1246();let _0x267c66=_0x124629[_0x31187b];return _0x267c66;}import{askConfirm}from'../../commands/menu/shared/inquirer.js';import{analyzeProjectApiArchitecture,upgradeProjectApiArchitecture}from'../../commands/project/api-architecture-upgrade.js';import{NEW_CONFIG_NAME}from'../../context.js';function readProjectConfig(_0x139d7e){const _0x105a3b=a229_0x267c;try{const _0x4da154=JSON['parse'](readFileSync(_0x139d7e,_0x105a3b(0x11d)));return _0x4da154&&typeof _0x4da154===_0x105a3b(0x113)?_0x4da154:{};}catch{return{};}}export function analyseProjectUpgrade(_0x4f2aef){const _0x51b3e4=a229_0x267c;let _0x3a854e=null;const _0x4b4f54=resolve(_0x4f2aef,_0x51b3e4(0x129));if(existsSync(_0x4b4f54))try{const _0x4f9985=JSON[_0x51b3e4(0x158)](readFileSync(_0x4b4f54,_0x51b3e4(0x11d)));for(const _0xa022f9 of[_0x51b3e4(0x131),_0x51b3e4(0x145)]){const _0x1d9f76=_0x4f9985?.[_0xa022f9]?.[_0x51b3e4(0x111)];if(typeof _0x1d9f76===_0x51b3e4(0x152)){_0x1d9f76!==_0x51b3e4(0x136)&&(_0x3a854e={'pkgPath':_0x4b4f54,'currentVersion':_0x1d9f76,'field':_0xa022f9});break;}}}catch{}const _0xb1ac8b=resolve(_0x4f2aef,NEW_CONFIG_NAME),_0x41e7df=existsSync(_0xb1ac8b)?readProjectConfig(_0xb1ac8b):{},_0xd87ecb=analyzeProjectApiArchitecture(_0x4f2aef,_0x41e7df);return{'sdkUpgrade':_0x3a854e,'apiArchitecture':_0xd87ecb};}function printReport(_0x39bd72){const _0x14497a=a229_0x267c;console[_0x14497a(0x137)](''),console[_0x14497a(0x137)](a229_0x2d86af[_0x14497a(0x14f)](_0x14497a(0x144))),console[_0x14497a(0x137)](''),console[_0x14497a(0x137)](a229_0x2d86af[_0x14497a(0x154)]('Application\x20source:')+('\x20\x20'+(_0x39bd72['apiArchitecture'][_0x14497a(0x15e)]?a229_0x2d86af[_0x14497a(0x146)](_0x14497a(0x13c)):a229_0x2d86af['green'](_0x14497a(0x11b)))));for(const _0x4a254a of _0x39bd72[_0x14497a(0x130)][_0x14497a(0x11a)]){console[_0x14497a(0x137)]('\x20\x20'+_0x4a254a[_0x14497a(0x12f)]+'\x20('+_0x4a254a[_0x14497a(0x161)][_0x14497a(0x138)](',\x20')+')');for(const _0x3abcb3 of _0x4a254a[_0x14497a(0x128)]){console[_0x14497a(0x137)](_0x14497a(0x14e)+_0x3abcb3[_0x14497a(0x148)]['padEnd'](0x11)+'\x20'+_0x3abcb3[_0x14497a(0x15c)]),_0x3abcb3['candidatePath']&&console['log'](_0x14497a(0x140)+_0x3abcb3['candidatePath']);}}_0x39bd72[_0x14497a(0x130)][_0x14497a(0x122)][_0x14497a(0x14a)]>0x0&&console['log'](_0x14497a(0x15b));console['log']('');if(_0x39bd72[_0x14497a(0x114)]){const {currentVersion:_0x1132f7,field:_0xdf490b,pkgPath:_0x28c2f7}=_0x39bd72[_0x14497a(0x114)];console[_0x14497a(0x137)](a229_0x2d86af[_0x14497a(0x154)](_0x14497a(0x13a))+('\x20\x20'+a229_0x2d86af['yellow'](_0x28c2f7))),console['log'](_0x14497a(0x157)+_0xdf490b+':\x20'+a229_0x2d86af[_0x14497a(0x146)](_0x1132f7)+_0x14497a(0x135)+a229_0x2d86af[_0x14497a(0x139)](_0x14497a(0x136))),console[_0x14497a(0x137)](_0x14497a(0x13e));}else console[_0x14497a(0x137)](a229_0x2d86af[_0x14497a(0x154)]('@lovrabet/sdk:')+'\x20\x20'+a229_0x2d86af[_0x14497a(0x163)]('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x14497a(0x137)]('');}function execUpgradeSdk(_0x2d0ee0){const _0x4c8b5a=a229_0x267c;if(!_0x2d0ee0[_0x4c8b5a(0x114)])return{'step':0x1,'label':_0x4c8b5a(0x11e),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x42a4e4,currentVersion:_0x5558b2,field:_0x3aae87}=_0x2d0ee0[_0x4c8b5a(0x114)];try{const _0x17ba89=readFileSync(_0x42a4e4,'utf8'),_0x875cd3=JSON[_0x4c8b5a(0x158)](_0x17ba89);return _0x875cd3[_0x3aae87][_0x4c8b5a(0x111)]=_0x4c8b5a(0x136),writeFileSync(_0x42a4e4,JSON['stringify'](_0x875cd3,null,0x2)+'\x0a','utf8'),{'step':0x1,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x3aae87+_0x4c8b5a(0x12c)+_0x5558b2+_0x4c8b5a(0x13f)};}catch(_0x15f08e){return{'step':0x1,'label':_0x4c8b5a(0x11e),'ok':![],'detail':_0x15f08e instanceof Error?_0x15f08e['message']:String(_0x15f08e)};}}function printSummary(_0x138d45){const _0x4e2e4a=a229_0x267c;console[_0x4e2e4a(0x137)](''),console[_0x4e2e4a(0x137)](a229_0x2d86af[_0x4e2e4a(0x14f)]('===\x20Upgrade\x20Summary\x20===')),console[_0x4e2e4a(0x137)]('');for(const _0x1c6b2d of _0x138d45){const _0x1f3c61=_0x1c6b2d['ok']?a229_0x2d86af[_0x4e2e4a(0x139)]('OK'):a229_0x2d86af['red'](_0x4e2e4a(0x155));console[_0x4e2e4a(0x137)]('\x20\x20'+_0x1f3c61+_0x4e2e4a(0x13d)+_0x1c6b2d[_0x4e2e4a(0x124)]+':\x20'+_0x1c6b2d[_0x4e2e4a(0x125)]);if(_0x1c6b2d['detail'])console[_0x4e2e4a(0x137)]('\x20\x20\x20\x20\x20\x20\x20'+a229_0x2d86af[_0x4e2e4a(0x163)](_0x1c6b2d[_0x4e2e4a(0x123)]));}console[_0x4e2e4a(0x137)]('');}export async function upgradeApp(_0x5b6516,_0xe24933){const _0x469f63=a229_0x267c,_0x3e6cb0=process['cwd'](),_0xa1ee86=analyseProjectUpgrade(_0x3e6cb0);if(!_0xa1ee86[_0x469f63(0x114)]&&!_0xa1ee86[_0x469f63(0x130)][_0x469f63(0x15e)])return console['log'](a229_0x2d86af[_0x469f63(0x139)](_0x469f63(0x143))),{'analysis':_0xa1ee86,'steps':[],'completed':!![]};printReport(_0xa1ee86);const _0x3e2412=!!(_0xe24933['yes']||_0xe24933['Y']||_0x5b6516);if(!_0x3e2412)try{const _0x36bcf8=await askConfirm(_0x469f63(0x150));if(!_0x36bcf8)return console[_0x469f63(0x137)](a229_0x2d86af[_0x469f63(0x163)](_0x469f63(0x119))),{'analysis':_0xa1ee86,'steps':[],'completed':![],'cancelled':!![]};}catch(_0x27ccdf){if(_0x27ccdf?.[_0x469f63(0x160)]==='CANCEL')return console[_0x469f63(0x137)](a229_0x2d86af[_0x469f63(0x163)](_0x469f63(0x119))),{'analysis':_0xa1ee86,'steps':[],'completed':![],'cancelled':!![]};throw _0x27ccdf;}const _0x35a918=[],_0x353200=a229_0x5b4dc9({'text':_0x469f63(0x112),'color':'cyan'})[_0x469f63(0x162)](),_0x4783c1=execUpgradeSdk(_0xa1ee86);_0x35a918[_0x469f63(0x127)](_0x4783c1),_0x353200[_0x4783c1['ok']?_0x469f63(0x11c):_0x469f63(0x13b)]('Step\x201/2:\x20@lovrabet/sdk\x20—\x20'+(_0x4783c1[_0x469f63(0x123)]??(_0x4783c1['ok']?_0x469f63(0x12a):_0x469f63(0x12d))));const _0x297585=a229_0x5b4dc9({'text':'Step\x202/2:\x20Upgrading\x20application\x20source\x20structure...','color':_0x469f63(0x154)})[_0x469f63(0x162)]();let _0x3c448f;try{_0x3c448f=await upgradeProjectApiArchitecture(_0x3e6cb0);const _0xf112dc=_0x3c448f[_0x469f63(0x126)]?_0x469f63(0x11f):_0x469f63(0x156);_0x297585['succeed'](_0x469f63(0x116)+_0xf112dc),_0x35a918[_0x469f63(0x127)]({'step':0x2,'label':'Upgrade\x20application\x20source','ok':!![],'detail':_0xf112dc});}catch(_0x22f7ba){const _0xeac11f=_0x22f7ba instanceof Error?_0x22f7ba['message']:String(_0x22f7ba);_0x297585[_0x469f63(0x13b)](_0x469f63(0x116)+_0xeac11f),_0x35a918[_0x469f63(0x127)]({'step':0x2,'label':_0x469f63(0x120),'ok':![],'detail':_0xeac11f});}printSummary(_0x35a918);const _0x128e44=_0x35a918[_0x469f63(0x14d)](_0x513b84=>!_0x513b84['ok']);if(_0x128e44)console[_0x469f63(0x137)](a229_0x2d86af[_0x469f63(0x146)](_0x469f63(0x142)));else _0x3c448f?.['manualMergeRequired']?console[_0x469f63(0x137)](a229_0x2d86af[_0x469f63(0x146)](_0x469f63(0x15a))):console[_0x469f63(0x137)](a229_0x2d86af['green']('Upgrade\x20completed\x20successfully!'));return _0x4783c1['ok']&&_0xa1ee86[_0x469f63(0x114)]&&(console[_0x469f63(0x137)](''),console[_0x469f63(0x137)](a229_0x2d86af[_0x469f63(0x14f)]['cyan'](_0x469f63(0x153))),console[_0x469f63(0x137)](a229_0x2d86af[_0x469f63(0x154)](_0x469f63(0x147))),console[_0x469f63(0x137)](''),console['log'](a229_0x2d86af[_0x469f63(0x117)](_0x469f63(0x133))),console[_0x469f63(0x137)](a229_0x2d86af[_0x469f63(0x117)](_0x469f63(0x132))),console[_0x469f63(0x137)](a229_0x2d86af[_0x469f63(0x117)](_0x469f63(0x12b))),console[_0x469f63(0x137)]('')),{'analysis':_0xa1ee86,'steps':_0x35a918,'apiArchitecture':_0x3c448f,'completed':!_0x128e44&&!_0x3c448f?.[_0x469f63(0x126)]};}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a230_0x47f921=a230_0x2cfe;(function(_0x3919a2,_0x408625){const _0x54543d=a230_0x2cfe,_0x267bce=_0x3919a2();while(!![]){try{const _0x463feb=parseInt(_0x54543d(0xca))/0x1*(parseInt(_0x54543d(0xe8))/0x2)+parseInt(_0x54543d(0xc6))/0x3+-parseInt(_0x54543d(0xcd))/0x4*(-parseInt(_0x54543d(0xa6))/0x5)+-parseInt(_0x54543d(0x108))/0x6*(-parseInt(_0x54543d(0xe1))/0x7)+-parseInt(_0x54543d(0xdb))/0x8+parseInt(_0x54543d(0xf3))/0x9*(parseInt(_0x54543d(0xd5))/0xa)+parseInt(_0x54543d(0xe7))/0xb*(-parseInt(_0x54543d(0x99))/0xc);if(_0x463feb===_0x408625)break;else _0x267bce['push'](_0x267bce['shift']());}catch(_0x1dca92){_0x267bce['push'](_0x267bce['shift']());}}}(a230_0x27e5,0xcd564));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dbDefinitions}from'../commands/db/index.js';import{deploymentDefinitions}from'../commands/deployment/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';function a230_0x2cfe(_0x9053a4,_0x5a9919){_0x9053a4=_0x9053a4-0x97;const _0x27e5be=a230_0x27e5();let _0x2cfeba=_0x27e5be[_0x9053a4];return _0x2cfeba;}import{menuDefinitions}from'../commands/menu/index.js';import{taskDefinitions}from'../commands/task/index.js';import{tenantDefinitions}from'../commands/tenant/index.js';import{roleDefinitions}from'../commands/role/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{ruleDefinitions}from'../commands/rule/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{instantApiPolicyDefinitions}from'../commands/instant-api-policy/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{userAccountDefinitions}from'../commands/user-account/index.js';import{flowDefinitions}from'../commands/flow/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];function a230_0x27e5(){const _0x543354=['Platform\x20Issue','command','Use\x20`','API\x20Development','OCR','flow:enable','No\x20executable\x20CLI\x20replacement\x20is\x20available\x20under\x20the\x20current\x20server\x20authentication\x20contract.','from','defaultCommand','deployment:sync','permit:role-apis-set','rabetbase\x20cli-skill\x20install','skills:install','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27','rabetbase\x20page\x20custom-publish','rabetbase\x20dataset\x20design-start\x20--file\x20<manifest.json>','Code\x20Generation','Self\x20Update','show','263838IVGmZs','Configuration','rabetbase\x20run\x20preview','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','rabetbase\x20page\x20custom-update','knowledge-base:update','Schema','project:init','menu:update','`rabetbase\x20','12KCnLcw','commands','Dataset\x20&\x20Operations','Data\x20List\x20Pages\x20&\x20Custom\x20Pages','Async\x20Tasks','flow:disable','read','Instant\x20API\x20Policy','app:add','Deployment','rabetbase\x20menu\x20asset-update','data:getOne','User\x20Accounts','385565yWCuoo','page:standard-page-status','page:react-list','rabetbase\x20project\x20create\x20<project-name>','rabetbase\x20run\x20start','wildcardDef','rabetbase\x20page\x20custom-detail','\x20\x20[write]','push','knowledge-base:create','sql:new','sql:save','rabetbase\x20menu\x20subapp-assets-status\x20--appcode\x20<host-appcode>\x20--app-name\x20<name>','knowledge-base:delete','set','App\x20Management','Tenant\x20Members','write','Agent\x20Context\x20Rules','rabetbase\x20run\x20build','rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml','service','app:remote','`\x20instead.','permit:page-get','page:custom-create','\x20\x20[','rabetbase\x20page\x20create\x20--page-pattern\x20BLANK','rabetbase\x20kb\x20update','Menu','Notification\x20Configuration','Database\x20Connections','4442805EEDzdv','page:react-detail','<script>','skills:','1333627DHYabi','permit:role-menus-set','knowledge-base:detail','4eIepdv','values','description','page:react-update','login','install','has','Run\x20any\x20package.json\x20script','1190RBeAxZ','rabetbase\x20auth\x20logout','get','start','data:filter','rabetbase\x20page\x20custom-list','5626808lruXRE','hidden','This\x20lifecycle\x20operation\x20is\x20no\x20longer\x20exposed\x20by\x20Rabetbase\x20CLI;\x20no\x20replacement\x20command\x20is\x20available.','rabetbase\x20app\x20list\x20--remote','app:assets-update','isSingleCommand','28cqNGvc','Project','skill:','dataset:generate-start','page:react-publish','risk','18498304WjXrtK','2uarTKy','permit:page-set','Diagnostics','rabetbase\x20kb\x20list','bff:new','logout','preview','rabetbase\x20bff\x20create','filter','SQL\x20Queries','page:react-create','11988gDUpwt','knowledge-base:list'];a230_0x27e5=function(){return _0x543354;};return a230_0x27e5();}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x14b409){const _0x2a7ee1=a230_0x2cfe;for(const _0x1511c4 of _0x14b409){definitions['set'](_0x1511c4[_0x2a7ee1(0xbb)]+':'+_0x1511c4[_0x2a7ee1(0xf6)],_0x1511c4);let _0x14e8d2=serviceGroups[_0x2a7ee1(0xd7)](_0x1511c4[_0x2a7ee1(0xbb)]);!_0x14e8d2&&(_0x14e8d2=[],serviceGroups[_0x2a7ee1(0xb4)](_0x1511c4['service'],_0x14e8d2)),_0x14e8d2[_0x2a7ee1(0xae)](_0x1511c4);}}function registerDeclarativeService(_0x2c4511,_0x9d2680,_0x26c9ae){const _0x57964c=a230_0x2cfe;registerDefinitions(_0x9d2680);_0x26c9ae?.[_0x57964c(0xab)]&®isterDefinitions([_0x26c9ae['wildcardDef']]);const _0x43e81f=_0x3e738b=>_0x3e738b===_0x57964c(0x9f)?'':_0x3e738b===_0x57964c(0xb7)?_0x57964c(0xad):'\x20\x20[high-risk-write]',_0x1fe525={'service':_0x9d2680[0x0][_0x57964c(0xbb)],'label':_0x2c4511,'commands':_0x9d2680[_0x57964c(0xf0)](_0x5b6057=>!_0x5b6057[_0x57964c(0xdc)])['map'](_0x3da311=>({'command':_0x3da311['command'],'description':_0x3da311[_0x57964c(0xcf)],'tag':_0x43e81f(_0x3da311['risk'])})),'declarative':!![],'defaultCommand':_0x26c9ae?.[_0x57964c(0xfd)]??(_0x26c9ae?.[_0x57964c(0xe0)]?_0x9d2680[0x0]['command']:undefined),'wildcardDef':_0x26c9ae?.[_0x57964c(0xab)],'isSingleCommand':_0x26c9ae?.[_0x57964c(0xe0)]};serviceRegistry[_0x57964c(0xae)](_0x1fe525),serviceByName[_0x57964c(0xb4)](_0x1fe525[_0x57964c(0xbb)],_0x1fe525);}registerDeclarativeService(a230_0x47f921(0xe2),projectDefinitions),registerDeclarativeService('Workspace',workspaceDefinitions),registerDeclarativeService(a230_0x47f921(0xb5),appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a230_0x47f921(0xd1)}),registerDeclarativeService(a230_0x47f921(0xb6),tenantDefinitions),registerDeclarativeService(a230_0x47f921(0xa5),userAccountDefinitions),registerDeclarativeService(a230_0x47f921(0x9b),datasetDefinitions),registerDeclarativeService(a230_0x47f921(0x9c),pageDefinitions),registerDeclarativeService(a230_0x47f921(0xf8),apiDefinitions),registerDeclarativeService('Backend\x20Function\x20Scripts',bffDefinitions),registerDeclarativeService(a230_0x47f921(0xa0),instantApiPolicyDefinitions),registerDeclarativeService(a230_0x47f921(0xc4),notificationDefinitions),registerDeclarativeService(a230_0x47f921(0xf1),sqlDefinitions),registerDeclarativeService(a230_0x47f921(0xc5),dbDefinitions),registerDeclarativeService(a230_0x47f921(0xa2),deploymentDefinitions),registerDeclarativeService(a230_0x47f921(0xc3),menuDefinitions),registerDeclarativeService(a230_0x47f921(0x9d),taskDefinitions),registerDeclarativeService('Roles',roleDefinitions),registerDeclarativeService('Runtime\x20App\x20Config\x20Management',appConfigDefinitions),registerDeclarativeService('Company\x20Knowledge\x20Base',kbDefinitions),registerDeclarativeService(a230_0x47f921(0xb8),ruleDefinitions),registerDeclarativeService(a230_0x47f921(0xf5),issueDefinitions),registerDeclarativeService('File',fileDefinitions),registerDeclarativeService(a230_0x47f921(0xf9),ocrDefinitions),registerDeclarativeService(a230_0x47f921(0x105),codegenDefinitions),registerDeclarativeService(a230_0x47f921(0x109),configDefinitions),registerDeclarativeService(a230_0x47f921(0xea),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a230_0x47f921(0x10e),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a230_0x47f921(0x106),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a230_0x47f921(0xd2)}),registerDeclarativeService('Approval\x20Flows',flowDefinitions),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':a230_0x47f921(0x107)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry['length']-0x1];last[a230_0x47f921(0x9a)]=[{'command':a230_0x47f921(0xc8),'description':a230_0x47f921(0xd4),'tag':a230_0x47f921(0xc0)+runDefinition[a230_0x47f921(0xe6)]+']'}];}const REMOVED_COMMAND_REPLACEMENTS=new Map([[a230_0x47f921(0xe4),a230_0x47f921(0x104)],['dataset:generate-status','rabetbase\x20dataset\x20design-status\x20--operation-id\x20<id>'],[a230_0x47f921(0xb1),a230_0x47f921(0xba)],[a230_0x47f921(0xec),a230_0x47f921(0xef)],[a230_0x47f921(0xb0),'rabetbase\x20sql\x20create'],[a230_0x47f921(0x97),a230_0x47f921(0xa3)],[a230_0x47f921(0x10f),'rabetbase\x20workspace\x20init\x20--appcode\x20<code>'],[a230_0x47f921(0xe3),a230_0x47f921(0x100)],['skill:install',a230_0x47f921(0x100)],[a230_0x47f921(0xc9),'rabetbase\x20cli-skill\x20install'],[a230_0x47f921(0x101),a230_0x47f921(0x100)],['app:assets-status',a230_0x47f921(0xb2)],[a230_0x47f921(0xdf),'rabetbase\x20menu\x20subapp-assets-update\x20--appcode\x20<host-appcode>\x20--app-name\x20<name>\x20--resources\x20\x27<json>\x27'],[a230_0x47f921(0xbc),a230_0x47f921(0xde)],['app:use','rabetbase\x20workspace\x20use\x20--app\x20<name>'],[a230_0x47f921(0xa1),'rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>'],['app:remove','rabetbase\x20workspace\x20remove\x20<name>'],[a230_0x47f921(0xf4),a230_0x47f921(0xeb)],[a230_0x47f921(0xcc),'rabetbase\x20kb\x20detail'],[a230_0x47f921(0xaf),'rabetbase\x20kb\x20create'],[a230_0x47f921(0x10d),a230_0x47f921(0xc2)],[a230_0x47f921(0xb3),'rabetbase\x20kb\x20delete'],['role:create','rabetbase\x20role\x20list'],[a230_0x47f921(0xd9),a230_0x47f921(0x102)],[a230_0x47f921(0xa4),a230_0x47f921(0x10b)],[a230_0x47f921(0xa7),'rabetbase\x20page\x20data-list-status'],[a230_0x47f921(0xf2),'rabetbase\x20page\x20create\x20--page-pattern\x20BLANK'],[a230_0x47f921(0xbf),a230_0x47f921(0xc1)],[a230_0x47f921(0xa8),a230_0x47f921(0xda)],[a230_0x47f921(0xc7),a230_0x47f921(0xac)],[a230_0x47f921(0xd0),a230_0x47f921(0x10c)],[a230_0x47f921(0xe5),a230_0x47f921(0x103)]]),REMOVED_COMMAND_HINTS=new Map([[a230_0x47f921(0xfa),a230_0x47f921(0xdd)],[a230_0x47f921(0x9e),a230_0x47f921(0xdd)],[a230_0x47f921(0xfe),'Resource\x20saves\x20are\x20synchronized\x20automatically\x20by\x20the\x20server;\x20no\x20manual\x20CLI\x20replacement\x20is\x20required.'],[a230_0x47f921(0xbe),a230_0x47f921(0xfb)],[a230_0x47f921(0xe9),'No\x20executable\x20CLI\x20replacement\x20is\x20available\x20under\x20the\x20current\x20server\x20authentication\x20contract.'],['permit:role-menus','No\x20executable\x20CLI\x20replacement\x20is\x20available\x20under\x20the\x20current\x20server\x20authentication\x20contract.'],[a230_0x47f921(0xcb),a230_0x47f921(0xfb)],[a230_0x47f921(0xff),a230_0x47f921(0xfb)]]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([['create',a230_0x47f921(0xa9)],[a230_0x47f921(0xd8),a230_0x47f921(0xaa)],['build',a230_0x47f921(0xb9)],[a230_0x47f921(0xee),a230_0x47f921(0x10a)],[a230_0x47f921(0xed),a230_0x47f921(0xd6)]]);export function resolveRemovedCommand(_0x18db12,_0x1ad69a){const _0x506c1c=a230_0x47f921;if(!_0x18db12)return undefined;const _0x76c5b5=REMOVED_COMMAND_REPLACEMENTS[_0x506c1c(0xd7)](_0x18db12+':'+(_0x1ad69a??'')),_0x20eef6=REMOVED_FLAT_COMMAND_REPLACEMENTS[_0x506c1c(0xd7)](_0x18db12),_0x2635a0=_0x76c5b5??_0x20eef6,_0x549377=REMOVED_COMMAND_HINTS[_0x506c1c(0xd7)](_0x18db12+':'+(_0x1ad69a??''));if(!_0x2635a0&&!_0x549377)return undefined;const _0x31aa4e=_0x20eef6?_0x18db12:_0x1ad69a?_0x18db12+'\x20'+_0x1ad69a:_0x18db12;return{'command':_0x31aa4e,'message':_0x506c1c(0x98)+_0x31aa4e+'`\x20has\x20been\x20removed.','hint':_0x549377??_0x506c1c(0xf7)+_0x2635a0+_0x506c1c(0xbd)};}export function findDefinition(_0x2ecc49,_0x10c312){const _0x278a99=a230_0x47f921;return definitions[_0x278a99(0xd7)](_0x2ecc49+':'+_0x10c312);}export function isKnownService(_0x132c36){const _0x18ba55=a230_0x47f921;return serviceByName[_0x18ba55(0xd3)](_0x132c36);}export function isDeclarativeService(_0xaff460){const _0x36581d=a230_0x47f921;return serviceGroups[_0x36581d(0xd3)](_0xaff460)||serviceByName['get'](_0xaff460)?.[_0x36581d(0xab)]!==undefined;}export function getServiceEntry(_0x4773f1){return serviceByName['get'](_0x4773f1);}export function getLegacyHandler(_0x57298d,_0x2db1c8){return undefined;}export function getAllDefinitions(){const _0x537b35=a230_0x47f921;return Array[_0x537b35(0xfc)](definitions[_0x537b35(0xce)]());}
|
|
1
|
+
const a230_0x40f642=a230_0x1f90;(function(_0x123dcf,_0x5b4a4a){const _0x4f427e=a230_0x1f90,_0x1b52cf=_0x123dcf();while(!![]){try{const _0x1a5834=-parseInt(_0x4f427e(0x193))/0x1*(-parseInt(_0x4f427e(0x172))/0x2)+parseInt(_0x4f427e(0x16a))/0x3*(parseInt(_0x4f427e(0x143))/0x4)+parseInt(_0x4f427e(0x19d))/0x5*(parseInt(_0x4f427e(0x18b))/0x6)+parseInt(_0x4f427e(0x190))/0x7+parseInt(_0x4f427e(0x175))/0x8+parseInt(_0x4f427e(0x15c))/0x9+parseInt(_0x4f427e(0x176))/0xa*(-parseInt(_0x4f427e(0x17f))/0xb);if(_0x1a5834===_0x5b4a4a)break;else _0x1b52cf['push'](_0x1b52cf['shift']());}catch(_0x57532c){_0x1b52cf['push'](_0x1b52cf['shift']());}}}(a230_0x2331,0xf1537));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dbDefinitions}from'../commands/db/index.js';import{deploymentDefinitions}from'../commands/deployment/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{taskDefinitions}from'../commands/task/index.js';import{tenantDefinitions}from'../commands/tenant/index.js';function a230_0x1f90(_0x3488ac,_0x30ea5f){_0x3488ac=_0x3488ac-0x13a;const _0x233192=a230_0x2331();let _0x1f9087=_0x233192[_0x3488ac];return _0x1f9087;}import{roleDefinitions}from'../commands/role/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{ruleDefinitions}from'../commands/rule/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{instantApiPolicyDefinitions}from'../commands/instant-api-policy/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';function a230_0x2331(){const _0x182e25=['rabetbase\x20menu\x20asset-update','permit:role-apis-set','data:getOne','rabetbase\x20page\x20custom-update','knowledge-base:detail','app:assets-update','project:init','start','preview','12602574Thjuzg','rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>','This\x20lifecycle\x20operation\x20is\x20no\x20longer\x20exposed\x20by\x20Rabetbase\x20CLI;\x20no\x20replacement\x20command\x20is\x20available.','create','description','Notification\x20Configuration','has','Instant\x20API\x20Policy','data:filter','Async\x20Tasks','page:react-publish','Platform\x20Issue','page:custom-create','rabetbase\x20app\x20list\x20--remote','59673jdYJtJ','skill:','rabetbase\x20kb\x20update','rabetbase\x20kb\x20create','User\x20Accounts','push','Approval\x20Flows','Menu','439384SOKSlK','app:remove','Deployment','11019856MaSCLE','427240TkXeBw','get','knowledge-base:delete','`\x20has\x20been\x20removed.','app:use','login','page:react-update','rabetbase\x20kb\x20detail','Database\x20Connections','1177kUuaHs','app:remote','rabetbase\x20page\x20custom-detail','rabetbase\x20auth\x20logout','Run\x20Scripts','Tenant\x20Members','rabetbase\x20page\x20custom-publish','Resource\x20saves\x20are\x20synchronized\x20automatically\x20by\x20the\x20server;\x20no\x20manual\x20CLI\x20replacement\x20is\x20required.','rabetbase\x20run\x20preview','permit:page-get','Diagnostics','rabetbase\x20workspace\x20remove\x20<name>','1860618EWvLRo','rabetbase\x20kb\x20list','rabetbase\x20menu\x20subapp-assets-update\x20--appcode\x20<host-appcode>\x20--app-name\x20<name>\x20--resources\x20\x27<json>\x27','rabetbase\x20sql\x20create','Authentication','583562hCuOtf','CLI\x20Built-in\x20Skill','Schema','2vuIcmB','knowledge-base:update','Data\x20List\x20Pages\x20&\x20Custom\x20Pages','Configuration','Workspace','from','rabetbase\x20menu\x20subapp-assets-status\x20--appcode\x20<host-appcode>\x20--app-name\x20<name>','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27','service','SQL\x20Queries','5lRCSSs','risk','rabetbase\x20role\x20list','read','Project','build','No\x20executable\x20CLI\x20replacement\x20is\x20available\x20under\x20the\x20current\x20server\x20authentication\x20contract.','wildcardDef','role:create','map','\x20\x20[high-risk-write]','command','Run\x20any\x20package.json\x20script','flow:disable','API\x20Development','Company\x20Knowledge\x20Base','defaultCommand','skills:','filter','app:assets-status','rabetbase\x20cli-skill\x20install','menu:update','rabetbase\x20dataset\x20design-start\x20--file\x20<manifest.json>','Code\x20Generation','write','\x20\x20[','rabetbase\x20kb\x20delete','rabetbase\x20run\x20build','dataset:generate-start','rabetbase\x20bff\x20create','Runtime\x20App\x20Config\x20Management','skill:install','Dataset\x20&\x20Operations','rabetbase\x20page\x20data-list-status','deployment:sync','bff:new','page:react-list','dataset:generate-status','392LcuQpF','rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml','App\x20Management','set','Roles','isSingleCommand','rabetbase\x20project\x20create\x20<project-name>','rabetbase\x20page\x20create\x20--page-pattern\x20BLANK','sql:save','Self\x20Update','permit:page-set','permit:role-menus-set','rabetbase\x20workspace\x20init\x20--appcode\x20<code>','length','knowledge-base:create','Agent\x20Context\x20Rules'];a230_0x2331=function(){return _0x182e25;};return a230_0x2331();}import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{userAccountDefinitions}from'../commands/user-account/index.js';import{flowDefinitions}from'../commands/flow/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x575ac2){const _0x4a9489=a230_0x1f90;for(const _0x5ca8dc of _0x575ac2){definitions[_0x4a9489(0x146)](_0x5ca8dc[_0x4a9489(0x19b)]+':'+_0x5ca8dc[_0x4a9489(0x1a8)],_0x5ca8dc);let _0x3010fc=serviceGroups['get'](_0x5ca8dc[_0x4a9489(0x19b)]);!_0x3010fc&&(_0x3010fc=[],serviceGroups['set'](_0x5ca8dc[_0x4a9489(0x19b)],_0x3010fc)),_0x3010fc[_0x4a9489(0x16f)](_0x5ca8dc);}}function registerDeclarativeService(_0x52923b,_0x31be19,_0x3cad2d){const _0x320479=a230_0x1f90;registerDefinitions(_0x31be19);_0x3cad2d?.[_0x320479(0x1a4)]&®isterDefinitions([_0x3cad2d['wildcardDef']]);const _0x451c1d=_0x15d393=>_0x15d393===_0x320479(0x1a0)?'':_0x15d393===_0x320479(0x1b5)?'\x20\x20[write]':_0x320479(0x1a7),_0x32279f={'service':_0x31be19[0x0][_0x320479(0x19b)],'label':_0x52923b,'commands':_0x31be19[_0x320479(0x1af)](_0x456f6a=>!_0x456f6a['hidden'])[_0x320479(0x1a6)](_0x8c2dab=>({'command':_0x8c2dab[_0x320479(0x1a8)],'description':_0x8c2dab[_0x320479(0x160)],'tag':_0x451c1d(_0x8c2dab[_0x320479(0x19e)])})),'declarative':!![],'defaultCommand':_0x3cad2d?.[_0x320479(0x1ad)]??(_0x3cad2d?.[_0x320479(0x148)]?_0x31be19[0x0][_0x320479(0x1a8)]:undefined),'wildcardDef':_0x3cad2d?.['wildcardDef'],'isSingleCommand':_0x3cad2d?.['isSingleCommand']};serviceRegistry[_0x320479(0x16f)](_0x32279f),serviceByName[_0x320479(0x146)](_0x32279f[_0x320479(0x19b)],_0x32279f);}registerDeclarativeService(a230_0x40f642(0x1a1),projectDefinitions),registerDeclarativeService(a230_0x40f642(0x197),workspaceDefinitions),registerDeclarativeService(a230_0x40f642(0x145),appDefinitions),registerDeclarativeService(a230_0x40f642(0x18f),authDefinitions,{'defaultCommand':a230_0x40f642(0x17b)}),registerDeclarativeService(a230_0x40f642(0x184),tenantDefinitions),registerDeclarativeService(a230_0x40f642(0x16e),userAccountDefinitions),registerDeclarativeService(a230_0x40f642(0x13d),datasetDefinitions),registerDeclarativeService(a230_0x40f642(0x195),pageDefinitions),registerDeclarativeService(a230_0x40f642(0x1ab),apiDefinitions),registerDeclarativeService('Backend\x20Function\x20Scripts',bffDefinitions),registerDeclarativeService(a230_0x40f642(0x163),instantApiPolicyDefinitions),registerDeclarativeService(a230_0x40f642(0x161),notificationDefinitions),registerDeclarativeService(a230_0x40f642(0x19c),sqlDefinitions),registerDeclarativeService(a230_0x40f642(0x17e),dbDefinitions),registerDeclarativeService(a230_0x40f642(0x174),deploymentDefinitions),registerDeclarativeService(a230_0x40f642(0x171),menuDefinitions),registerDeclarativeService(a230_0x40f642(0x165),taskDefinitions),registerDeclarativeService(a230_0x40f642(0x147),roleDefinitions),registerDeclarativeService(a230_0x40f642(0x13b),appConfigDefinitions),registerDeclarativeService(a230_0x40f642(0x1ac),kbDefinitions),registerDeclarativeService(a230_0x40f642(0x152),ruleDefinitions),registerDeclarativeService(a230_0x40f642(0x167),issueDefinitions),registerDeclarativeService('File',fileDefinitions),registerDeclarativeService('OCR',ocrDefinitions),registerDeclarativeService(a230_0x40f642(0x1b4),codegenDefinitions),registerDeclarativeService(a230_0x40f642(0x196),configDefinitions),registerDeclarativeService(a230_0x40f642(0x189),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a230_0x40f642(0x192),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a230_0x40f642(0x14c),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a230_0x40f642(0x191),cliSkillDefinitions,{'defaultCommand':'install'}),registerDeclarativeService(a230_0x40f642(0x170),flowDefinitions),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':'show'}),registerDeclarativeService(a230_0x40f642(0x183),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a230_0x40f642(0x150)]-0x1];last['commands']=[{'command':'<script>','description':a230_0x40f642(0x1a9),'tag':a230_0x40f642(0x1b6)+runDefinition['risk']+']'}];}const REMOVED_COMMAND_REPLACEMENTS=new Map([[a230_0x40f642(0x1b9),a230_0x40f642(0x1b3)],[a230_0x40f642(0x142),'rabetbase\x20dataset\x20design-status\x20--operation-id\x20<id>'],[a230_0x40f642(0x14b),a230_0x40f642(0x144)],[a230_0x40f642(0x140),a230_0x40f642(0x13a)],['sql:new',a230_0x40f642(0x18e)],[a230_0x40f642(0x1b2),a230_0x40f642(0x153)],[a230_0x40f642(0x159),a230_0x40f642(0x14f)],[a230_0x40f642(0x16b),'rabetbase\x20cli-skill\x20install'],[a230_0x40f642(0x13c),'rabetbase\x20cli-skill\x20install'],[a230_0x40f642(0x1ae),'rabetbase\x20cli-skill\x20install'],['skills:install',a230_0x40f642(0x1b1)],[a230_0x40f642(0x1b0),a230_0x40f642(0x199)],[a230_0x40f642(0x158),a230_0x40f642(0x18d)],[a230_0x40f642(0x180),a230_0x40f642(0x169)],[a230_0x40f642(0x17a),'rabetbase\x20workspace\x20use\x20--app\x20<name>'],['app:add',a230_0x40f642(0x15d)],[a230_0x40f642(0x173),a230_0x40f642(0x18a)],['knowledge-base:list',a230_0x40f642(0x18c)],[a230_0x40f642(0x157),a230_0x40f642(0x17d)],[a230_0x40f642(0x151),a230_0x40f642(0x16d)],[a230_0x40f642(0x194),a230_0x40f642(0x16c)],[a230_0x40f642(0x178),a230_0x40f642(0x1b7)],[a230_0x40f642(0x1a5),a230_0x40f642(0x19f)],[a230_0x40f642(0x164),a230_0x40f642(0x19a)],[a230_0x40f642(0x155),'lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27'],['page:standard-page-status',a230_0x40f642(0x13e)],['page:react-create','rabetbase\x20page\x20create\x20--page-pattern\x20BLANK'],[a230_0x40f642(0x168),a230_0x40f642(0x14a)],[a230_0x40f642(0x141),'rabetbase\x20page\x20custom-list'],['page:react-detail',a230_0x40f642(0x181)],[a230_0x40f642(0x17c),a230_0x40f642(0x156)],[a230_0x40f642(0x166),a230_0x40f642(0x185)]]),REMOVED_COMMAND_HINTS=new Map([['flow:enable',a230_0x40f642(0x15e)],[a230_0x40f642(0x1aa),a230_0x40f642(0x15e)],[a230_0x40f642(0x13f),a230_0x40f642(0x186)],[a230_0x40f642(0x188),'No\x20executable\x20CLI\x20replacement\x20is\x20available\x20under\x20the\x20current\x20server\x20authentication\x20contract.'],[a230_0x40f642(0x14d),a230_0x40f642(0x1a3)],['permit:role-menus','No\x20executable\x20CLI\x20replacement\x20is\x20available\x20under\x20the\x20current\x20server\x20authentication\x20contract.'],[a230_0x40f642(0x14e),a230_0x40f642(0x1a3)],[a230_0x40f642(0x154),a230_0x40f642(0x1a3)]]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([[a230_0x40f642(0x15f),a230_0x40f642(0x149)],[a230_0x40f642(0x15a),'rabetbase\x20run\x20start'],[a230_0x40f642(0x1a2),a230_0x40f642(0x1b8)],[a230_0x40f642(0x15b),a230_0x40f642(0x187)],['logout',a230_0x40f642(0x182)]]);export function resolveRemovedCommand(_0x32a55f,_0x3dfe84){const _0x18587a=a230_0x40f642;if(!_0x32a55f)return undefined;const _0x44ca2=REMOVED_COMMAND_REPLACEMENTS[_0x18587a(0x177)](_0x32a55f+':'+(_0x3dfe84??'')),_0x41b3f7=REMOVED_FLAT_COMMAND_REPLACEMENTS['get'](_0x32a55f),_0x398086=_0x44ca2??_0x41b3f7,_0x38716d=REMOVED_COMMAND_HINTS[_0x18587a(0x177)](_0x32a55f+':'+(_0x3dfe84??''));if(!_0x398086&&!_0x38716d)return undefined;const _0x35fe6=_0x41b3f7?_0x32a55f:_0x3dfe84?_0x32a55f+'\x20'+_0x3dfe84:_0x32a55f;return{'command':_0x35fe6,'message':'`rabetbase\x20'+_0x35fe6+_0x18587a(0x179),'hint':_0x38716d??'Use\x20`'+_0x398086+'`\x20instead.'};}export function findDefinition(_0x226bbb,_0x9f7b84){const _0x482b41=a230_0x40f642;return definitions[_0x482b41(0x177)](_0x226bbb+':'+_0x9f7b84);}export function isKnownService(_0x2a32e9){const _0x401f34=a230_0x40f642;return serviceByName[_0x401f34(0x162)](_0x2a32e9);}export function isDeclarativeService(_0x17de4d){const _0x439cf8=a230_0x40f642;return serviceGroups[_0x439cf8(0x162)](_0x17de4d)||serviceByName[_0x439cf8(0x177)](_0x17de4d)?.[_0x439cf8(0x1a4)]!==undefined;}export function getServiceEntry(_0x3d28e0){const _0x3a7c62=a230_0x40f642;return serviceByName[_0x3a7c62(0x177)](_0x3d28e0);}export function getLegacyHandler(_0x26e00d,_0x52d751){return undefined;}export function getAllDefinitions(){const _0x35dcaf=a230_0x40f642;return Array[_0x35dcaf(0x198)](definitions['values']());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a231_0x174704=a231_0x51ac;(function(_0x30741e,_0x3c4e45){const _0x3290eb=a231_0x51ac,_0x384b89=_0x30741e();while(!![]){try{const _0x3904c9=-parseInt(_0x3290eb(0xc7))/0x1*(parseInt(_0x3290eb(0xc2))/0x2)+-parseInt(_0x3290eb(0xc6))/0x3+parseInt(_0x3290eb(0xc0))/0x4*(parseInt(_0x3290eb(0xbd))/0x5)+-parseInt(_0x3290eb(0xbc))/0x6+parseInt(_0x3290eb(0xce))/0x7+parseInt(_0x3290eb(0xd2))/0x8*(parseInt(_0x3290eb(0xd1))/0x9)+-parseInt(_0x3290eb(0xc4))/0xa*(-parseInt(_0x3290eb(0xd0))/0xb);if(_0x3904c9===_0x3c4e45)break;else _0x384b89['push'](_0x384b89['shift']());}catch(_0x141f93){_0x384b89['push'](_0x384b89['shift']());}}}(a231_0x2173,0xcbb61));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a231_0x51ac(_0x293adb,_0x3a3cc1){_0x293adb=_0x293adb-0xba;const _0x217352=a231_0x2173();let _0x51ac75=_0x217352[_0x293adb];return _0x51ac75;}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a231_0x2173(){const _0x4a6cbd=['num','roleName','dev','705824UfLsGs','high-risk-write','106315arXrWd','10050813pumVQG','8yTKPkJ','appCode','role','874926VdlXQp','848270jdkBoA','Deleted\x20role\x20','userCount','20vlUxZw','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','1564636FSojED','Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','660jCpcbx','POST','476673lxkkpi','2FqyakG','\x20(id=','Role\x20still\x20has\x20','delete'];a231_0x2173=function(){return _0x4a6cbd;};return a231_0x2173();}const DELETE_PATH='/smartapi/permit/role/delete';export const roleDelete={'service':a231_0x174704(0xbb),'command':a231_0x174704(0xca),'description':a231_0x174704(0xc3),'risk':a231_0x174704(0xcf),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x125180){const _0x1972a5=a231_0x174704,_0x2ed68e=_0x125180[_0x1972a5(0xcb)]('id'),_0x19bd60=await getRoleById(_0x125180['appCode'],_0x2ed68e);return assertCustomRole(_0x19bd60,'delete'),asDryRunResult({'scope':'dev','operation':_0x1972a5(0xca),'selector':{'appCode':_0x125180[_0x1972a5(0xba)],'roleId':_0x2ed68e,'roleName':_0x19bd60[_0x1972a5(0xcc)]},'before':projectRole(_0x19bd60),'after':null,'dryRun':!![],'backend':{'method':_0x1972a5(0xc5),'path':DELETE_PATH},'warnings':_0x19bd60[_0x1972a5(0xbf)]>0x0?[_0x1972a5(0xc9)+_0x19bd60['userCount']+_0x1972a5(0xc1)]:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0xb05b10){const _0x5b9c8a=a231_0x174704,_0x37c480=_0xb05b10['num']('id'),_0x35da55=await getRoleById(_0xb05b10['appCode'],_0x37c480);return assertCustomRole(_0x35da55,'delete'),await deleteAppRole(_0x37c480),{'ok':!![],'data':{'scope':_0x5b9c8a(0xcd),'operation':'delete','selector':{'appCode':_0xb05b10['appCode'],'roleId':_0x37c480,'roleName':_0x35da55[_0x5b9c8a(0xcc)]},'before':projectRole(_0x35da55),'after':null,'dryRun':![],'backend':{'method':_0x5b9c8a(0xc5),'path':DELETE_PATH},'warnings':[]},'message':_0x5b9c8a(0xbe)+_0x35da55[_0x5b9c8a(0xcc)]+_0x5b9c8a(0xc8)+_0x37c480+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a232_0x56c3dd=a232_0x4980;function a232_0x4980(_0x389e26,_0x3dcc21){_0x389e26=_0x389e26-0x19b;const _0x5574ee=a232_0x5574();let _0x4980a0=_0x5574ee[_0x389e26];return _0x4980a0;}(function(_0x55ac1a,_0x4c2e03){const _0x52502e=a232_0x4980,_0x275e0f=_0x55ac1a();while(!![]){try{const _0x4550de=-parseInt(_0x52502e(0x1a7))/0x1+parseInt(_0x52502e(0x19d))/0x2*(parseInt(_0x52502e(0x1a5))/0x3)+parseInt(_0x52502e(0x19c))/0x4+-parseInt(_0x52502e(0x1aa))/0x5*(parseInt(_0x52502e(0x19e))/0x6)+parseInt(_0x52502e(0x1ab))/0x7*(-parseInt(_0x52502e(0x1a3))/0x8)+-parseInt(_0x52502e(0x1a0))/0x9*(-parseInt(_0x52502e(0x1a6))/0xa)+parseInt(_0x52502e(0x19b))/0xb*(parseInt(_0x52502e(0x1a1))/0xc);if(_0x4550de===_0x4c2e03)break;else _0x275e0f['push'](_0x275e0f['shift']());}catch(_0x2d4ee6){_0x275e0f['push'](_0x275e0f['shift']());}}}(a232_0x5574,0x48ad1));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a232_0x5574(){const _0x389e86=['roleName','17811nrSdMz','1185020BeUDSE','465366XiUNTk','role','Show\x20a\x20single\x20role\x27s\x20detail','770mWSmkp','10563zVjpjN','3275349mWPEGf','1830632HKQyOw','2Tdndqb','22818sUsMem','read','27miLvNs','36BvmBKX','num','1928eBfWzr'];a232_0x5574=function(){return _0x389e86;};return a232_0x5574();}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a232_0x56c3dd(0x1a8),'command':'detail','description':a232_0x56c3dd(0x1a9),'risk':a232_0x56c3dd(0x19f),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x295c3a){const _0x3de477=a232_0x56c3dd,_0x1730f6=_0x295c3a[_0x3de477(0x1a2)]('id'),_0x1f836c=await getRoleById(_0x295c3a['appCode'],_0x1730f6);return{'ok':!![],'data':{'scope':'dev','role':projectRole(_0x1f836c)},'message':'Role\x20'+_0x1f836c[_0x3de477(0x1a4)]+'\x20('+_0x1f836c['roleType']+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27fb7c,_0x1ebd2a){const _0x1b1623=a233_0x3123,_0x12eaf3=_0x27fb7c();while(!![]){try{const _0x38b2a1=parseInt(_0x1b1623(0xf4))/0x1*(parseInt(_0x1b1623(0xf6))/0x2)+-parseInt(_0x1b1623(0xf7))/0x3*(parseInt(_0x1b1623(0xf1))/0x4)+parseInt(_0x1b1623(0xf0))/0x5+-parseInt(_0x1b1623(0xf2))/0x6+parseInt(_0x1b1623(0xf5))/0x7+parseInt(_0x1b1623(0xef))/0x8*(-parseInt(_0x1b1623(0xf3))/0x9)+-parseInt(_0x1b1623(0xf8))/0xa;if(_0x38b2a1===_0x1ebd2a)break;else _0x12eaf3['push'](_0x12eaf3['shift']());}catch(_0x13a886){_0x12eaf3['push'](_0x12eaf3['shift']());}}}(a233_0x2404,0x64192));import{roleList}from'../../commands/role/list.js';function a233_0x3123(_0x2eefd8,_0x5ce8b7){_0x2eefd8=_0x2eefd8-0xef;const _0x24047a=a233_0x2404();let _0x31230c=_0x24047a[_0x2eefd8];return _0x31230c;}import{roleDetail}from'../../commands/role/detail.js';function a233_0x2404(){const _0x23cd4b=['434WiJQAj','3yMTOZI','2137040GSWSQw','8hOUzqV','598185oFBeSp','825152lqwUbC','622824BOHzWa','1647819jtwrBg','2721YObuzB','2847565ovgNjR'];a233_0x2404=function(){return _0x23cd4b;};return a233_0x2404();}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a234_0x41a1a6=a234_0x3c0f;(function(_0x184054,_0x45ece2){const _0x556a47=a234_0x3c0f,_0x4b9f2c=_0x184054();while(!![]){try{const _0x18c559=-parseInt(_0x556a47(0x1ac))/0x1*(parseInt(_0x556a47(0x1b4))/0x2)+parseInt(_0x556a47(0x1bb))/0x3*(parseInt(_0x556a47(0x1cb))/0x4)+-parseInt(_0x556a47(0x1c7))/0x5*(-parseInt(_0x556a47(0x1ca))/0x6)+-parseInt(_0x556a47(0x1c5))/0x7+-parseInt(_0x556a47(0x1bd))/0x8+parseInt(_0x556a47(0x1c9))/0x9+parseInt(_0x556a47(0x1b3))/0xa;if(_0x18c559===_0x45ece2)break;else _0x4b9f2c['push'](_0x4b9f2c['shift']());}catch(_0x2a5ad1){_0x4b9f2c['push'](_0x4b9f2c['shift']());}}}(a234_0x560b,0xb1153));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a234_0x3c0f(_0x585719,_0x7bfcd9){_0x585719=_0x585719-0x1a9;const _0x560bb5=a234_0x560b();let _0x3c0f7d=_0x560bb5[_0x585719];return _0x3c0f7d;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a234_0x41a1a6(0x1c0),'DEV','OWNER',a234_0x41a1a6(0x1b6)];function a234_0x560b(){const _0x5a6c59=['toUpperCase','3SLuKis','page','7916632MJXvRf','number','length','ADMIN','Invalid\x20--type\x20\x22','num','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','Page\x20index\x20(1-based)','9601123oxFoBg','list','2195iAzJxC','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','12565242vLlZQU','6474SZkpCK','3591932VePmXh','pagesize','type','validation','67874UAzmzp','str','role','Filter\x20by\x20role\x20type','Use\x20one\x20of:\x20','filter','trim','9974370izsjty','20Hnfjvu','read','CUSTOM','map','Found\x20','appCode'];a234_0x560b=function(){return _0x5a6c59;};return a234_0x560b();}export const roleList={'service':a234_0x41a1a6(0x1ae),'command':a234_0x41a1a6(0x1c6),'description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a234_0x41a1a6(0x1b5),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0x41a1a6(0x1aa),'type':'string','required':![],'description':a234_0x41a1a6(0x1af),'enum':ROLE_TYPES},{'name':a234_0x41a1a6(0x1bc),'type':a234_0x41a1a6(0x1be),'description':a234_0x41a1a6(0x1c4),'default':0x1},{'name':a234_0x41a1a6(0x1a9),'type':a234_0x41a1a6(0x1be),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x4344a1){const _0x29b18f=a234_0x41a1a6,_0x41289c=_0x4344a1[_0x29b18f(0x1ad)](_0x29b18f(0x1aa))[_0x29b18f(0x1b2)]();if(_0x41289c&&!ROLE_TYPES['includes'](_0x41289c[_0x29b18f(0x1ba)]()))throw CliErrors['validation'](_0x29b18f(0x1c1)+_0x41289c+'\x22.',_0x29b18f(0x1b0)+ROLE_TYPES['join'](',\x20')+'.');const _0x21e495=_0x4344a1[_0x29b18f(0x1c2)](_0x29b18f(0x1bc),0x1),_0x196a7f=_0x4344a1[_0x29b18f(0x1c2)]('pagesize',0x64);if(_0x21e495<0x1)throw CliErrors[_0x29b18f(0x1ab)](_0x29b18f(0x1c8));if(_0x196a7f<0x1||_0x196a7f>0x64)throw CliErrors[_0x29b18f(0x1ab)](_0x29b18f(0x1c3));},async 'execute'(_0xff2a29){const _0x59014c=a234_0x41a1a6,_0x27c4fb=_0xff2a29[_0x59014c(0x1c2)](_0x59014c(0x1bc),0x1)||0x1,_0xec843e=_0xff2a29[_0x59014c(0x1c2)](_0x59014c(0x1a9),0x64)||0x64,_0x399730=_0xff2a29['str']('type')['trim']()[_0x59014c(0x1ba)](),{items:_0x5eeaaa,paging:_0x1ce6f9}=await listAppRoles(_0xff2a29[_0x59014c(0x1b9)],{'currentPage':_0x27c4fb,'pageSize':_0xec843e}),_0x35eced=_0x399730?_0x5eeaaa[_0x59014c(0x1b1)](_0x83b26c=>_0x83b26c['roleType']===_0x399730):_0x5eeaaa,_0x2d838f=_0x35eced[_0x59014c(0x1b7)](projectRole);return{'ok':!![],'data':{'scope':'dev','roles':_0x2d838f,'paging':_0x1ce6f9},'message':_0x59014c(0x1b8)+_0x2d838f[_0x59014c(0x1bf)]+'\x20role(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a235_0x5c3421=a235_0x3e24;(function(_0xd20ecd,_0x14260f){const _0x5d84c1=a235_0x3e24,_0x3b1e2b=_0xd20ecd();while(!![]){try{const _0x28c11a=-parseInt(_0x5d84c1(0x110))/0x1+parseInt(_0x5d84c1(0x133))/0x2*(parseInt(_0x5d84c1(0x102))/0x3)+parseInt(_0x5d84c1(0xec))/0x4+-parseInt(_0x5d84c1(0xf0))/0x5+parseInt(_0x5d84c1(0x10d))/0x6*(-parseInt(_0x5d84c1(0x139))/0x7)+parseInt(_0x5d84c1(0x10c))/0x8+parseInt(_0x5d84c1(0x11f))/0x9*(parseInt(_0x5d84c1(0x124))/0xa);if(_0x28c11a===_0x14260f)break;else _0x3b1e2b['push'](_0x3b1e2b['shift']());}catch(_0x2fcd95){_0x3b1e2b['push'](_0x3b1e2b['shift']());}}}(a235_0x48f7,0x8620e));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a235_0x5c3421(0x112),'required':!![],'description':a235_0x5c3421(0x106)};export const ROLE_REF_FLAG={'name':a235_0x5c3421(0x104),'type':a235_0x5c3421(0xf8),'required':!![],'description':a235_0x5c3421(0x12f)};export const USER_REF_FLAG={'name':a235_0x5c3421(0x113),'type':a235_0x5c3421(0xf8),'required':!![],'description':a235_0x5c3421(0xf1)};export const NAME_FLAG={'name':a235_0x5c3421(0x122),'type':a235_0x5c3421(0xf8),'required':!![],'description':a235_0x5c3421(0x115)};export const USER_NAME_FLAG={'name':a235_0x5c3421(0x122),'type':a235_0x5c3421(0xf8),'required':!![],'description':a235_0x5c3421(0x132)};export const REMARK_FLAG={'name':a235_0x5c3421(0x135),'type':a235_0x5c3421(0xf8),'required':![],'description':a235_0x5c3421(0x11c)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x5c3421(0x12e),'type':a235_0x5c3421(0x112),'required':![],'description':a235_0x5c3421(0x10f)};export const BUILTIN_ROLE_TYPES=[a235_0x5c3421(0xee),a235_0x5c3421(0xfa),'OWNER'];export function isBuiltinRole(_0x1460f2){const _0xc8377=a235_0x5c3421;return BUILTIN_ROLE_TYPES[_0xc8377(0x116)](_0x1460f2);}export function assertCustomRole(_0x295968,_0x53a2ed){const _0x205206=a235_0x5c3421;if(_0x295968[_0x205206(0x117)]!==_0x205206(0xff))throw CliErrors[_0x205206(0x107)]('Cannot\x20'+_0x53a2ed+_0x205206(0xf2)+_0x295968[_0x205206(0x111)]+'\x20('+_0x295968[_0x205206(0x117)]+').',_0x205206(0x136));}export function projectRole(_0x717dbd){const _0x296096=a235_0x5c3421;return{'id':_0x717dbd['id'],'roleName':_0x717dbd[_0x296096(0x111)],'roleType':_0x717dbd[_0x296096(0x117)],'remark':_0x717dbd[_0x296096(0x135)],'userCount':_0x717dbd[_0x296096(0x11e)],'permitCount':_0x717dbd[_0x296096(0xea)],'builtin':isBuiltinRole(_0x717dbd[_0x296096(0x117)])};}export async function resolveRoleRef(_0x782472,_0x50afe5){const _0xf536f5=a235_0x5c3421,_0x12d5bc=_0x50afe5[_0xf536f5(0x134)]();if(!_0x12d5bc)throw CliErrors[_0xf536f5(0x107)](_0xf536f5(0x127),_0xf536f5(0x123));if(/^\d+$/[_0xf536f5(0x138)](_0x12d5bc))return getRoleById(_0x782472,Number(_0x12d5bc));const _0x48a1cd=await listAllAppRoles(_0x782472),_0x25fba8=_0x48a1cd[_0xf536f5(0x120)](_0x5e5810=>_0x5e5810[_0xf536f5(0x111)]===_0x12d5bc);if(_0x25fba8[_0xf536f5(0xf4)]===0x0)throw CliErrors['validation'](_0xf536f5(0xfb)+_0x12d5bc+_0xf536f5(0x137)+_0x782472+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x25fba8[_0xf536f5(0xf4)]>0x1){const _0x2c93ea=_0x25fba8[_0xf536f5(0xe9)](_0x1dd860=>_0x1dd860['id'])[_0xf536f5(0xf9)](',\x20');throw CliErrors[_0xf536f5(0x107)](_0xf536f5(0xfb)+_0x12d5bc+_0xf536f5(0x105)+_0x2c93ea+').',_0xf536f5(0xef));}return _0x25fba8[0x0];}export async function getRoleById(_0x18646b,_0x5bc8b2){const _0x2f586=a235_0x5c3421,_0x5f1423=await listAllAppRoles(_0x18646b),_0x345576=_0x5f1423[_0x2f586(0x120)](_0x89eeaf=>_0x89eeaf['id']===_0x5bc8b2&&(!_0x89eeaf[_0x2f586(0xf6)]||_0x89eeaf['appCode']===_0x18646b));if(_0x345576[_0x2f586(0xf4)]!==0x1)throw CliErrors[_0x2f586(0x107)](_0x2f586(0x11b)+_0x5bc8b2+'\x20not\x20found\x20in\x20app\x20'+_0x18646b+'.',_0x2f586(0x12a));return _0x345576[0x0];}async function listAllAppRoles(_0x23dd8c){const _0x7d40d2=a235_0x5c3421,_0x5ae477=0x64,_0x2fcc0e=[];for(let _0x566456=0x1;;_0x566456+=0x1){const {items:_0x46e402,paging:_0x3a7039}=await listAppRoles(_0x23dd8c,{'currentPage':_0x566456,'pageSize':_0x5ae477});_0x2fcc0e[_0x7d40d2(0x119)](..._0x46e402);if(_0x46e402[_0x7d40d2(0xf4)]<_0x5ae477||_0x3a7039&&_0x2fcc0e[_0x7d40d2(0xf4)]>=_0x3a7039[_0x7d40d2(0x129)])return _0x2fcc0e;}}export async function resolveTenantCode(){const _0x113d74=a235_0x5c3421,_0x5c5803=await getSessionUserInfo(),_0x43a129=_0x5c5803?.['user']?.[_0x113d74(0x11a)]?.['tenant_code'];if(!_0x43a129)throw CliErrors['authRequired'](_0x113d74(0x114));return _0x43a129;}function matchMember(_0x4fb9e6,_0x3ee9e4){const _0x2d0ed7=a235_0x5c3421,_0x361107=_0x3ee9e4[_0x2d0ed7(0x134)]()[_0x2d0ed7(0x128)]();return(_0x4fb9e6['nickname']??'')[_0x2d0ed7(0x128)]()===_0x361107||(_0x4fb9e6[_0x2d0ed7(0x101)]??'')['toLowerCase']()===_0x361107;}function a235_0x3e24(_0x10ea9c,_0xc4048c){_0x10ea9c=_0x10ea9c-0xe9;const _0x48f76e=a235_0x48f7();let _0x3e2461=_0x48f76e[_0x10ea9c];return _0x3e2461;}export async function resolveUserRef(_0xf2134b,_0x64eb04=a235_0x5c3421(0xf3)){const _0x23d2bd=a235_0x5c3421,_0x19c2c3=_0xf2134b['trim']();if(!_0x19c2c3)throw CliErrors[_0x23d2bd(0x107)]('Missing\x20user\x20reference.',_0x23d2bd(0xfc));const _0x95730d=await resolveTenantCode(),_0xb8a9b3=await getTenantMembers(_0x95730d);if(/^\d+$/[_0x23d2bd(0x138)](_0x19c2c3)){const _0x382f18=Number(_0x19c2c3),_0x1ea5e8=_0xb8a9b3[_0x23d2bd(0x130)](_0x4d7ed7=>_0x4d7ed7[_0x23d2bd(0xf7)]===_0x382f18);return{'userId':_0x382f18,'username':_0x1ea5e8?.[_0x23d2bd(0x101)]??String(_0x382f18),'nickname':_0x1ea5e8?.['nickname'],'matchedBy':'id'};}const _0x36924c=_0xb8a9b3[_0x23d2bd(0x120)](_0x12603b=>matchMember(_0x12603b,_0x19c2c3));if(_0x36924c[_0x23d2bd(0xf4)]===0x0)throw CliErrors[_0x23d2bd(0x107)](_0x23d2bd(0xfe)+_0x19c2c3+'\x22.',_0x23d2bd(0x12d)+_0x64eb04);if(_0x36924c[_0x23d2bd(0xf4)]>0x1){const _0x200bfe=_0x36924c['map'](_0x57d44=>(_0x57d44[_0x23d2bd(0x126)]??_0x57d44[_0x23d2bd(0x101)]??'?')+'('+_0x57d44[_0x23d2bd(0xf7)]+')')[_0x23d2bd(0xf9)](',\x20');throw CliErrors[_0x23d2bd(0x107)](_0x23d2bd(0x103)+_0x19c2c3+_0x23d2bd(0x125)+_0x200bfe+'.',_0x64eb04);}const _0x8ff251=_0x36924c[0x0];return{'userId':_0x8ff251[_0x23d2bd(0xf7)],'username':_0x8ff251[_0x23d2bd(0x101)]??String(_0x8ff251['userId']),'nickname':_0x8ff251['nickname'],'matchedBy':_0x23d2bd(0x122)};}export const CREATE_USER_ROLE_PATH=a235_0x5c3421(0x100);export const DELETE_USER_ROLE_PATH=a235_0x5c3421(0x10e);function a235_0x48f7(){const _0xf388a2=['OWNER','User\x20','4325056fXYnno','144chimGS','/smartapi/permit/user-role/delete','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','66953KCPDtn','roleName','number','user','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Role\x20name','includes','roleType','expectUserCount','push','tenant','Role\x20id\x20','Optional\x20role\x20remark/description','Anti-drift\x20check\x20failed:\x20expected\x20','userCount','110502ChpYIR','filter','Cannot\x20','name','Pass\x20--role\x20<id|name>.','470qVeiKE','\x22:\x20','nickname','Missing\x20role\x20reference.','toLowerCase','totalCount','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','\x20member(s)\x20but\x20role\x20has\x20','str','Check\x20the\x20nickname/username.\x20','expect-user-count','Role\x20id\x20or\x20exact\x20role\x20name','find','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','10ewfrap','trim','remark','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','\x22\x20not\x20found\x20in\x20app\x20','test','190897ZhhvmF','map','permitCount','\x20is\x20not\x20a\x20member\x20of\x20role\x20','3108160WImSRi',';\x20no\x20change.','ADMIN','Disambiguate\x20with\x20--role\x20<id>.','3344255mMwZUn','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','\x20built-in\x20role\x20','Pass\x20--user\x20<id>.','length','\x20duplicate\x20memberships\x20for\x20user\x20','appCode','userId','string','join','DEV','Role\x20name\x20\x22','Pass\x20--user\x20<id|name>.','flagMissing','No\x20tenant\x20member\x20matches\x20\x22','CUSTOM','/smartapi/permit/user-role/create','username','26976qkpEWG','Multiple\x20tenant\x20members\x20match\x20\x22','role','\x22\x20is\x20ambiguous\x20(ids:\x20','Role\x20id\x20(from\x20`role\x20list`)','validation','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','POST'];a235_0x48f7=function(){return _0xf388a2;};return a235_0x48f7();}export function computeRoleUserMutation(_0x20100c){const _0x2b0ad8=a235_0x5c3421,{operation:_0x1ba0bd,appCode:_0x303ae8,role:_0x3f3c23,relations:_0x5a1c08,user:_0x206e9e}=_0x20100c,_0xdcf4fd=[...new Set(_0x5a1c08[_0x2b0ad8(0xe9)](_0x53a83f=>_0x53a83f[_0x2b0ad8(0xf7)]))],_0x3a73fd=[];if(_0x20100c[_0x2b0ad8(0x118)]!==undefined&&_0x20100c['expectUserCount']!==_0xdcf4fd[_0x2b0ad8(0xf4)])throw CliErrors[_0x2b0ad8(0x107)](_0x2b0ad8(0x11d)+_0x20100c[_0x2b0ad8(0x118)]+_0x2b0ad8(0x12b)+_0xdcf4fd['length']+'.',_0x2b0ad8(0x108));const _0x4496ce=_0xdcf4fd[_0x2b0ad8(0x116)](_0x206e9e[_0x2b0ad8(0xf7)]),_0x2a1036=_0x5a1c08['filter'](_0x461995=>_0x461995[_0x2b0ad8(0xf7)]===_0x206e9e[_0x2b0ad8(0xf7)])[_0x2b0ad8(0xe9)](_0x3aa872=>_0x3aa872['id']),_0x23005c=_0x1ba0bd==='user-add'?!_0x4496ce:_0x4496ce;let _0x463763=_0xdcf4fd;_0x1ba0bd==='user-add'?_0x4496ce?_0x3a73fd[_0x2b0ad8(0x119)](_0x2b0ad8(0x10b)+_0x206e9e[_0x2b0ad8(0xf7)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x3f3c23[_0x2b0ad8(0x111)]+_0x2b0ad8(0xed)):_0x463763=[..._0xdcf4fd,_0x206e9e['userId']]:!_0x4496ce?_0x3a73fd[_0x2b0ad8(0x119)](_0x2b0ad8(0x10b)+_0x206e9e['userId']+_0x2b0ad8(0xeb)+_0x3f3c23[_0x2b0ad8(0x111)]+_0x2b0ad8(0xed)):(_0x463763=_0xdcf4fd[_0x2b0ad8(0x120)](_0x5c62a1=>_0x5c62a1!==_0x206e9e['userId']),_0x2a1036[_0x2b0ad8(0xf4)]>0x1&&_0x3a73fd[_0x2b0ad8(0x119)]('Removed\x20'+_0x2a1036[_0x2b0ad8(0xf4)]+_0x2b0ad8(0xf5)+_0x206e9e[_0x2b0ad8(0xf7)]+'.'));const _0x1ca347={'scope':'dev','operation':_0x1ba0bd,'selector':{'appCode':_0x303ae8,'roleId':_0x3f3c23['id'],'roleName':_0x3f3c23[_0x2b0ad8(0x111)],'userId':_0x206e9e[_0x2b0ad8(0xf7)]},'before':{'userIds':_0xdcf4fd},'after':{'userIds':_0x463763},'dryRun':_0x20100c['dryRun'],'backend':{'method':_0x2b0ad8(0x109),'path':_0x1ba0bd==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x3a73fd};return{'mutation':_0x1ca347,'changed':_0x23005c,'matchingRelationIds':_0x2a1036};}export async function loadDevRoleRelations(_0x595d64,_0x49dadd){const _0x2f2c5e=a235_0x5c3421,_0x103611=0x64,_0x2715ab=[];for(let _0x2976e9=0x1;;_0x2976e9+=0x1){const {items:_0x2ed5ab,paging:_0x37321d}=await listDevUserRoleRelations(_0x595d64,{'roleId':_0x49dadd,'currentPage':_0x2976e9,'pageSize':_0x103611});_0x2715ab[_0x2f2c5e(0x119)](..._0x2ed5ab);if(_0x2ed5ab['length']<_0x103611||_0x37321d&&_0x2715ab[_0x2f2c5e(0xf4)]>=_0x37321d[_0x2f2c5e(0x129)])return _0x2715ab;}}export function readRoleRef(_0x13e228){const _0x116500=a235_0x5c3421,_0x50a1ce=_0x13e228['str']('role')[_0x116500(0x134)]();if(!_0x50a1ce)throw CliErrors[_0x116500(0xfd)](_0x116500(0x104),_0x116500(0x123));return _0x50a1ce;}export async function prepareUserMutation(_0x3a3471,_0x173804,_0x1dfa04){const _0x29ba72=a235_0x5c3421,_0x3c3f62=readRoleRef(_0x3a3471),_0x7a7824=_0x3a3471[_0x29ba72(0x12c)](_0x29ba72(0x113))[_0x29ba72(0x134)]();if(!_0x7a7824)throw CliErrors['flagMissing'](_0x29ba72(0x113),'Pass\x20--user\x20<id|name>.');const _0x43f9d1=_0x3a3471['flag'](_0x29ba72(0x12e)),_0x412f4b=_0x43f9d1===undefined||_0x43f9d1===null?undefined:Number(_0x43f9d1),_0x5846cd=await resolveRoleRef(_0x3a3471[_0x29ba72(0xf6)],_0x3c3f62);if(_0x5846cd[_0x29ba72(0x117)]===_0x29ba72(0x10a))throw CliErrors[_0x29ba72(0x107)](_0x29ba72(0x121)+_0x173804+'\x20members\x20of\x20the\x20OWNER\x20role.',_0x29ba72(0x131));const _0x43a470=await resolveUserRef(_0x7a7824),_0x59c828=await loadDevRoleRelations(_0x3a3471['appCode'],_0x5846cd['id']);return{...computeRoleUserMutation({'operation':_0x173804,'appCode':_0x3a3471[_0x29ba72(0xf6)],'role':_0x5846cd,'relations':_0x59c828,'user':{'userId':_0x43a470[_0x29ba72(0xf7)],'username':_0x43a470['username'],'nickname':_0x43a470[_0x29ba72(0x126)]},'dryRun':_0x1dfa04,..._0x412f4b!==undefined?{'expectUserCount':_0x412f4b}:{}}),'role':_0x5846cd,'user':_0x43a470};}
|
|
1
|
+
const a235_0x33f649=a235_0x12cd;(function(_0x323245,_0x170c30){const _0x5d1179=a235_0x12cd,_0x3838d7=_0x323245();while(!![]){try{const _0x4bc158=-parseInt(_0x5d1179(0x151))/0x1*(parseInt(_0x5d1179(0x163))/0x2)+-parseInt(_0x5d1179(0x154))/0x3+parseInt(_0x5d1179(0x16c))/0x4*(parseInt(_0x5d1179(0x126))/0x5)+-parseInt(_0x5d1179(0x168))/0x6+parseInt(_0x5d1179(0x170))/0x7+-parseInt(_0x5d1179(0x165))/0x8*(-parseInt(_0x5d1179(0x155))/0x9)+parseInt(_0x5d1179(0x13c))/0xa;if(_0x4bc158===_0x170c30)break;else _0x3838d7['push'](_0x3838d7['shift']());}catch(_0x58f709){_0x3838d7['push'](_0x3838d7['shift']());}}}(a235_0x5e39,0x9bbe1));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_0x33f649(0x130),'required':!![],'description':a235_0x33f649(0x124)};function a235_0x5e39(){const _0x37ae3b=['roleName','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','\x20member(s)\x20but\x20role\x20has\x20','join','test','find','str','Role\x20id\x20or\x20exact\x20role\x20name','Role\x20id\x20','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','role','934294aaoFTd','length','80aPFVnw','\x20members\x20of\x20the\x20OWNER\x20role.','user-add','5623230KTmVAw','\x22:\x20','roleType','\x20duplicate\x20memberships\x20for\x20user\x20','12BASJDr','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','toLowerCase','2919434KrEdOJ','expectUserCount','Role\x20name','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','authRequired','Role\x20id\x20(from\x20`role\x20list`)','flagMissing','82435vkJcSP','userId','Missing\x20user\x20reference.','Cannot\x20','Check\x20the\x20nickname/username.\x20','dev','filter','validation','remark','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','number','User\x20','string','Multiple\x20tenant\x20members\x20match\x20\x22',';\x20no\x20change.','Removed\x20','push','totalCount','Pass\x20--user\x20<id|name>.','trim','appCode','\x20is\x20already\x20a\x20member\x20of\x20role\x20','22524010XvoWiq','includes','username','user','map','permitCount','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','\x22\x20is\x20ambiguous\x20(ids:\x20','name','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Optional\x20role\x20remark/description','DEV','CUSTOM','Pass\x20--user\x20<id>.','No\x20tenant\x20member\x20matches\x20\x22','tenant_code','\x20is\x20not\x20a\x20member\x20of\x20role\x20','Role\x20name\x20\x22','userCount','expect-user-count','/smartapi/permit/user-role/delete','2QhPwXF','OWNER','flag','1346862pBkfER','215505kucAJM','nickname','/smartapi/permit/user-role/create'];a235_0x5e39=function(){return _0x37ae3b;};return a235_0x5e39();}export const ROLE_REF_FLAG={'name':a235_0x33f649(0x162),'type':'string','required':!![],'description':a235_0x33f649(0x15f)};export const USER_REF_FLAG={'name':a235_0x33f649(0x13f),'type':a235_0x33f649(0x132),'required':!![],'description':a235_0x33f649(0x142)};export const NAME_FLAG={'name':'name','type':a235_0x33f649(0x132),'required':!![],'description':a235_0x33f649(0x172)};export const USER_NAME_FLAG={'name':'name','type':a235_0x33f649(0x132),'required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a235_0x33f649(0x12e),'type':a235_0x33f649(0x132),'required':![],'description':a235_0x33f649(0x146)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':'number','required':![],'description':a235_0x33f649(0x161)};export const BUILTIN_ROLE_TYPES=['ADMIN',a235_0x33f649(0x147),a235_0x33f649(0x152)];export function isBuiltinRole(_0x255413){return BUILTIN_ROLE_TYPES['includes'](_0x255413);}export function assertCustomRole(_0x4e0d0b,_0x1ce7e7){const _0x41337c=a235_0x33f649;if(_0x4e0d0b[_0x41337c(0x16a)]!==_0x41337c(0x148))throw CliErrors[_0x41337c(0x12d)](_0x41337c(0x129)+_0x1ce7e7+'\x20built-in\x20role\x20'+_0x4e0d0b[_0x41337c(0x158)]+'\x20('+_0x4e0d0b[_0x41337c(0x16a)]+').',_0x41337c(0x16e));}export function projectRole(_0xfef809){const _0x746767=a235_0x33f649;return{'id':_0xfef809['id'],'roleName':_0xfef809[_0x746767(0x158)],'roleType':_0xfef809[_0x746767(0x16a)],'remark':_0xfef809[_0x746767(0x12e)],'userCount':_0xfef809[_0x746767(0x14e)],'permitCount':_0xfef809[_0x746767(0x141)],'builtin':isBuiltinRole(_0xfef809[_0x746767(0x16a)])};}export async function resolveRoleRef(_0x2eb882,_0x135f49){const _0x44de88=a235_0x33f649,_0x21f72c=_0x135f49[_0x44de88(0x139)]();if(!_0x21f72c)throw CliErrors[_0x44de88(0x12d)]('Missing\x20role\x20reference.','Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x44de88(0x15c)](_0x21f72c))return getRoleById(_0x2eb882,Number(_0x21f72c));const _0x3bb640=await listAllAppRoles(_0x2eb882),_0x5e036f=_0x3bb640[_0x44de88(0x12c)](_0x117dae=>_0x117dae[_0x44de88(0x158)]===_0x21f72c);if(_0x5e036f[_0x44de88(0x164)]===0x0)throw CliErrors[_0x44de88(0x12d)](_0x44de88(0x14d)+_0x21f72c+'\x22\x20not\x20found\x20in\x20app\x20'+_0x2eb882+'.',_0x44de88(0x159));if(_0x5e036f[_0x44de88(0x164)]>0x1){const _0x2b4307=_0x5e036f[_0x44de88(0x140)](_0x2471c=>_0x2471c['id'])[_0x44de88(0x15b)](',\x20');throw CliErrors[_0x44de88(0x12d)](_0x44de88(0x14d)+_0x21f72c+_0x44de88(0x143)+_0x2b4307+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x5e036f[0x0];}export async function getRoleById(_0x3407fb,_0x52d368){const _0x95b281=a235_0x33f649,_0x217b7c=await listAllAppRoles(_0x3407fb),_0x3ff3b5=_0x217b7c[_0x95b281(0x12c)](_0x3affe1=>_0x3affe1['id']===_0x52d368&&(!_0x3affe1[_0x95b281(0x13a)]||_0x3affe1[_0x95b281(0x13a)]===_0x3407fb));if(_0x3ff3b5[_0x95b281(0x164)]!==0x1)throw CliErrors[_0x95b281(0x12d)](_0x95b281(0x160)+_0x52d368+'\x20not\x20found\x20in\x20app\x20'+_0x3407fb+'.',_0x95b281(0x145));return _0x3ff3b5[0x0];}async function listAllAppRoles(_0x528822){const _0x11a0e3=a235_0x33f649,_0x4ab2da=0x64,_0x4113a=[];for(let _0x674a28=0x1;;_0x674a28+=0x1){const {items:_0x602515,paging:_0x510f8e}=await listAppRoles(_0x528822,{'currentPage':_0x674a28,'pageSize':_0x4ab2da});_0x4113a[_0x11a0e3(0x136)](..._0x602515);if(_0x602515[_0x11a0e3(0x164)]<_0x4ab2da||_0x510f8e&&_0x4113a[_0x11a0e3(0x164)]>=_0x510f8e['totalCount'])return _0x4113a;}}export async function resolveTenantCode(){const _0x58596b=a235_0x33f649,_0x1efbd8=await getSessionUserInfo(),_0xf78495=_0x1efbd8?.[_0x58596b(0x13f)]?.['tenant']?.[_0x58596b(0x14b)];if(!_0xf78495)throw CliErrors[_0x58596b(0x123)](_0x58596b(0x173));return _0xf78495;}function matchMember(_0xd57a2c,_0x56a8c8){const _0x388d91=a235_0x33f649,_0x78e218=_0x56a8c8['trim']()[_0x388d91(0x16f)]();return(_0xd57a2c[_0x388d91(0x156)]??'')[_0x388d91(0x16f)]()===_0x78e218||(_0xd57a2c['username']??'')[_0x388d91(0x16f)]()===_0x78e218;}export async function resolveUserRef(_0x1f6e62,_0x18bc71=a235_0x33f649(0x149)){const _0x32478e=a235_0x33f649,_0x39983d=_0x1f6e62[_0x32478e(0x139)]();if(!_0x39983d)throw CliErrors['validation'](_0x32478e(0x128),_0x32478e(0x138));const _0x3509cc=await resolveTenantCode(),_0x290e54=await getTenantMembers(_0x3509cc);if(/^\d+$/[_0x32478e(0x15c)](_0x39983d)){const _0x2e8236=Number(_0x39983d),_0x2c6b89=_0x290e54[_0x32478e(0x15d)](_0xe9e43f=>_0xe9e43f['userId']===_0x2e8236);return{'userId':_0x2e8236,'username':_0x2c6b89?.[_0x32478e(0x13e)]??String(_0x2e8236),'nickname':_0x2c6b89?.[_0x32478e(0x156)],'matchedBy':'id'};}const _0x19bc87=_0x290e54['filter'](_0x54ab08=>matchMember(_0x54ab08,_0x39983d));if(_0x19bc87[_0x32478e(0x164)]===0x0)throw CliErrors['validation'](_0x32478e(0x14a)+_0x39983d+'\x22.',_0x32478e(0x12a)+_0x18bc71);if(_0x19bc87['length']>0x1){const _0x367bbc=_0x19bc87['map'](_0x2869ea=>(_0x2869ea[_0x32478e(0x156)]??_0x2869ea[_0x32478e(0x13e)]??'?')+'('+_0x2869ea[_0x32478e(0x127)]+')')['join'](',\x20');throw CliErrors[_0x32478e(0x12d)](_0x32478e(0x133)+_0x39983d+_0x32478e(0x169)+_0x367bbc+'.',_0x18bc71);}const _0x9637c7=_0x19bc87[0x0];return{'userId':_0x9637c7['userId'],'username':_0x9637c7[_0x32478e(0x13e)]??String(_0x9637c7['userId']),'nickname':_0x9637c7[_0x32478e(0x156)],'matchedBy':_0x32478e(0x144)};}export const CREATE_USER_ROLE_PATH=a235_0x33f649(0x157);export const DELETE_USER_ROLE_PATH=a235_0x33f649(0x150);function a235_0x12cd(_0x309356,_0x3f6edc){_0x309356=_0x309356-0x123;const _0x5e3978=a235_0x5e39();let _0x12cd78=_0x5e3978[_0x309356];return _0x12cd78;}export function computeRoleUserMutation(_0x52089f){const _0x5f00ed=a235_0x33f649,{operation:_0x337bd0,appCode:_0x4a894e,role:_0x3171ce,relations:_0x49e356,user:_0x494c35}=_0x52089f,_0x5d5040=[...new Set(_0x49e356['map'](_0x54f456=>_0x54f456['userId']))],_0x357514=[];if(_0x52089f[_0x5f00ed(0x171)]!==undefined&&_0x52089f[_0x5f00ed(0x171)]!==_0x5d5040['length'])throw CliErrors['validation']('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x52089f[_0x5f00ed(0x171)]+_0x5f00ed(0x15a)+_0x5d5040[_0x5f00ed(0x164)]+'.',_0x5f00ed(0x12f));const _0x1bfe33=_0x5d5040[_0x5f00ed(0x13d)](_0x494c35['userId']),_0x42cfaa=_0x49e356['filter'](_0x4a42fb=>_0x4a42fb['userId']===_0x494c35[_0x5f00ed(0x127)])[_0x5f00ed(0x140)](_0x53b9b3=>_0x53b9b3['id']),_0x536553=_0x337bd0==='user-add'?!_0x1bfe33:_0x1bfe33;let _0xfeeaf9=_0x5d5040;_0x337bd0===_0x5f00ed(0x167)?_0x1bfe33?_0x357514[_0x5f00ed(0x136)](_0x5f00ed(0x131)+_0x494c35['userId']+_0x5f00ed(0x13b)+_0x3171ce[_0x5f00ed(0x158)]+_0x5f00ed(0x134)):_0xfeeaf9=[..._0x5d5040,_0x494c35[_0x5f00ed(0x127)]]:!_0x1bfe33?_0x357514[_0x5f00ed(0x136)](_0x5f00ed(0x131)+_0x494c35[_0x5f00ed(0x127)]+_0x5f00ed(0x14c)+_0x3171ce[_0x5f00ed(0x158)]+';\x20no\x20change.'):(_0xfeeaf9=_0x5d5040['filter'](_0x4063bb=>_0x4063bb!==_0x494c35[_0x5f00ed(0x127)]),_0x42cfaa[_0x5f00ed(0x164)]>0x1&&_0x357514[_0x5f00ed(0x136)](_0x5f00ed(0x135)+_0x42cfaa[_0x5f00ed(0x164)]+_0x5f00ed(0x16b)+_0x494c35[_0x5f00ed(0x127)]+'.'));const _0x266cba={'scope':_0x5f00ed(0x12b),'operation':_0x337bd0,'selector':{'appCode':_0x4a894e,'roleId':_0x3171ce['id'],'roleName':_0x3171ce[_0x5f00ed(0x158)],'userId':_0x494c35[_0x5f00ed(0x127)]},'before':{'userIds':_0x5d5040},'after':{'userIds':_0xfeeaf9},'dryRun':_0x52089f['dryRun'],'backend':{'method':'POST','path':_0x337bd0===_0x5f00ed(0x167)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x357514};return{'mutation':_0x266cba,'changed':_0x536553,'matchingRelationIds':_0x42cfaa};}export async function loadDevRoleRelations(_0x47046e,_0x2e00f2){const _0x2468f2=a235_0x33f649,_0x16ba5e=0x64,_0x3465f2=[];for(let _0x5860d4=0x1;;_0x5860d4+=0x1){const {items:_0x59a61c,paging:_0x5f8439}=await listDevUserRoleRelations(_0x47046e,{'roleId':_0x2e00f2,'currentPage':_0x5860d4,'pageSize':_0x16ba5e});_0x3465f2[_0x2468f2(0x136)](..._0x59a61c);if(_0x59a61c[_0x2468f2(0x164)]<_0x16ba5e||_0x5f8439&&_0x3465f2['length']>=_0x5f8439[_0x2468f2(0x137)])return _0x3465f2;}}export function readRoleRef(_0x507e12){const _0x5c8daa=a235_0x33f649,_0x4dae85=_0x507e12[_0x5c8daa(0x15e)](_0x5c8daa(0x162))[_0x5c8daa(0x139)]();if(!_0x4dae85)throw CliErrors['flagMissing']('role','Pass\x20--role\x20<id|name>.');return _0x4dae85;}export async function prepareUserMutation(_0x258131,_0x1a78c1,_0x479b47){const _0x3c3ccb=a235_0x33f649,_0x317f85=readRoleRef(_0x258131),_0x31ee5a=_0x258131[_0x3c3ccb(0x15e)](_0x3c3ccb(0x13f))[_0x3c3ccb(0x139)]();if(!_0x31ee5a)throw CliErrors[_0x3c3ccb(0x125)](_0x3c3ccb(0x13f),_0x3c3ccb(0x138));const _0xb925c5=_0x258131[_0x3c3ccb(0x153)](_0x3c3ccb(0x14f)),_0x3ab232=_0xb925c5===undefined||_0xb925c5===null?undefined:Number(_0xb925c5),_0x5efe18=await resolveRoleRef(_0x258131[_0x3c3ccb(0x13a)],_0x317f85);if(_0x5efe18[_0x3c3ccb(0x16a)]===_0x3c3ccb(0x152))throw CliErrors['validation']('Cannot\x20'+_0x1a78c1+_0x3c3ccb(0x166),_0x3c3ccb(0x16d));const _0x34337c=await resolveUserRef(_0x31ee5a),_0x4f6cc1=await loadDevRoleRelations(_0x258131[_0x3c3ccb(0x13a)],_0x5efe18['id']);return{...computeRoleUserMutation({'operation':_0x1a78c1,'appCode':_0x258131[_0x3c3ccb(0x13a)],'role':_0x5efe18,'relations':_0x4f6cc1,'user':{'userId':_0x34337c[_0x3c3ccb(0x127)],'username':_0x34337c[_0x3c3ccb(0x13e)],'nickname':_0x34337c[_0x3c3ccb(0x156)]},'dryRun':_0x479b47,..._0x3ab232!==undefined?{'expectUserCount':_0x3ab232}:{}}),'role':_0x5efe18,'user':_0x34337c};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a236_0x295c6f=a236_0x2f36;function a236_0xee2b(){const _0x41043e=['remark','27736foPGGq','name','/smartapi/permit/role/update','string','dev','validation','2648088FQySnO','flag','appCode','Updated\x20role\x20','572AKvGaF','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','250gHjqkh','45CipLTB','\x20(id=','num','roleName','POST','2357792crmPFV','write','1435698nMKmHF','202190JMlAJE','length','1037930XQeRGO','New\x20role\x20name','7LeayKX','2268UkCnLy','--name\x20cannot\x20be\x20empty.','update'];a236_0xee2b=function(){return _0x41043e;};return a236_0xee2b();}(function(_0x502ddd,_0x7c8c55){const _0x39b5ac=a236_0x2f36,_0x5569c6=_0x502ddd();while(!![]){try{const _0x3c33dc=-parseInt(_0x39b5ac(0x8c))/0x1*(-parseInt(_0x39b5ac(0x9a))/0x2)+parseInt(_0x39b5ac(0x8d))/0x3*(-parseInt(_0x39b5ac(0x7f))/0x4)+parseInt(_0x39b5ac(0x97))/0x5+parseInt(_0x39b5ac(0x94))/0x6+-parseInt(_0x39b5ac(0x99))/0x7*(-parseInt(_0x39b5ac(0x92))/0x8)+parseInt(_0x39b5ac(0x85))/0x9+parseInt(_0x39b5ac(0x95))/0xa*(-parseInt(_0x39b5ac(0x89))/0xb);if(_0x3c33dc===_0x7c8c55)break;else _0x5569c6['push'](_0x5569c6['shift']());}catch(_0x599e43){_0x5569c6['push'](_0x5569c6['shift']());}}}(a236_0xee2b,0x28057));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a236_0x295c6f(0x81);function readPatch(_0x4f87c6){const _0x5441e7=a236_0x295c6f,_0x4fbd29=_0x4f87c6[_0x5441e7(0x86)](_0x5441e7(0x80)),_0x596b91=_0x4f87c6[_0x5441e7(0x86)](_0x5441e7(0x7e)),_0x410de4={};if(_0x4fbd29!==undefined&&_0x4fbd29!==null){const _0x3ada25=String(_0x4fbd29)['trim']();if(!_0x3ada25)throw CliErrors['validation'](_0x5441e7(0x7c));if(_0x3ada25[_0x5441e7(0x96)]>0x40)throw CliErrors[_0x5441e7(0x84)](_0x5441e7(0x8b));_0x410de4[_0x5441e7(0x90)]=_0x3ada25;}_0x596b91!==undefined&&_0x596b91!==null&&(_0x410de4[_0x5441e7(0x7e)]=String(_0x596b91));if(_0x410de4[_0x5441e7(0x90)]===undefined&&_0x410de4[_0x5441e7(0x7e)]===undefined)throw CliErrors[_0x5441e7(0x84)]('Nothing\x20to\x20update.','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x410de4;}function a236_0x2f36(_0xc007d5,_0xef9979){_0xc007d5=_0xc007d5-0x7c;const _0xee2b44=a236_0xee2b();let _0x2f361b=_0xee2b44[_0xc007d5];return _0x2f361b;}export const roleUpdate={'service':'role','command':'update','description':a236_0x295c6f(0x8a),'risk':a236_0x295c6f(0x93),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0x295c6f(0x80),'type':a236_0x295c6f(0x82),'required':![],'description':a236_0x295c6f(0x98)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2f1d03){readPatch(_0x2f1d03);},async 'dryRun'(_0x304210){const _0x391b91=a236_0x295c6f,_0xd218e1=_0x304210['num']('id'),_0x2e8ea1=readPatch(_0x304210),_0x26922e=await getRoleById(_0x304210[_0x391b91(0x87)],_0xd218e1);return assertCustomRole(_0x26922e,_0x391b91(0x7d)),asDryRunResult({'scope':_0x391b91(0x83),'operation':_0x391b91(0x7d),'selector':{'appCode':_0x304210[_0x391b91(0x87)],'roleId':_0xd218e1,'roleName':_0x26922e[_0x391b91(0x90)]},'before':projectRole(_0x26922e),'after':projectRole({..._0x26922e,..._0x2e8ea1['roleName']!==undefined?{'roleName':_0x2e8ea1[_0x391b91(0x90)]}:{},..._0x2e8ea1['remark']!==undefined?{'remark':_0x2e8ea1['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x391b91(0x91),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x4aeebf){const _0x1f58bc=a236_0x295c6f,_0x400e18=_0x4aeebf[_0x1f58bc(0x8f)]('id'),_0x30e0c1=readPatch(_0x4aeebf),_0x2e4cd1=await getRoleById(_0x4aeebf[_0x1f58bc(0x87)],_0x400e18);assertCustomRole(_0x2e4cd1,'update'),await updateAppRole({'id':_0x400e18,'appCode':_0x4aeebf[_0x1f58bc(0x87)],..._0x30e0c1[_0x1f58bc(0x90)]!==undefined?{'roleName':_0x30e0c1[_0x1f58bc(0x90)]}:{},..._0x30e0c1['remark']!==undefined?{'remark':_0x30e0c1['remark']}:{}});const _0x1df2b5=await getRoleById(_0x4aeebf[_0x1f58bc(0x87)],_0x400e18);return{'ok':!![],'data':{'scope':_0x1f58bc(0x83),'operation':'update','selector':{'appCode':_0x4aeebf[_0x1f58bc(0x87)],'roleId':_0x400e18,'roleName':_0x1df2b5[_0x1f58bc(0x90)]},'before':projectRole(_0x2e4cd1),'after':projectRole(_0x1df2b5),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x1f58bc(0x88)+_0x1df2b5['roleName']+_0x1f58bc(0x8e)+_0x400e18+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a237_0x2901a9=a237_0x18f1;function a237_0x3dc0(){const _0x4df742=['user-add','313058oXOUXc','role','roleName','328832rQhGLm','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','appCode','\x20to\x20role\x20','userId','\x20already\x20in\x20role\x20','81EIgIol','1319490BFrSpl','246771SdfaSE','username','2dYxNRf','1371080qXOEpN','roleType','POST','2408466mQLUeB','high-risk-write','298983QLYwZS','Added\x20user\x20','selector','No\x20change:\x20user\x20','roleId'];a237_0x3dc0=function(){return _0x4df742;};return a237_0x3dc0();}(function(_0x96a1f6,_0x23c370){const _0x3f5455=a237_0x18f1,_0x52a60c=_0x96a1f6();while(!![]){try{const _0x175df0=-parseInt(_0x3f5455(0xf6))/0x1*(-parseInt(_0x3f5455(0xe9))/0x2)+parseInt(_0x3f5455(0xe3))/0x3+parseInt(_0x3f5455(0xf7))/0x4+parseInt(_0x3f5455(0xf3))/0x5+-parseInt(_0x3f5455(0xe1))/0x6+-parseInt(_0x3f5455(0xf4))/0x7+parseInt(_0x3f5455(0xec))/0x8*(-parseInt(_0x3f5455(0xf2))/0x9);if(_0x175df0===_0x23c370)break;else _0x52a60c['push'](_0x52a60c['shift']());}catch(_0x398133){_0x52a60c['push'](_0x52a60c['shift']());}}}(a237_0x3dc0,0x33f33));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a237_0x18f1(_0x1fa703,_0x19b3e8){_0x1fa703=_0x1fa703-0xe1;const _0x3dc087=a237_0x3dc0();let _0x18f1d1=_0x3dc087[_0x1fa703];return _0x18f1d1;}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_0x2901a9(0xea),'command':a237_0x2901a9(0xe8),'description':a237_0x2901a9(0xed),'risk':a237_0x2901a9(0xe2),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1f8656){const _0x3faa36=a237_0x2901a9,{mutation:_0x1bb841}=await prepareUserMutation(_0x1f8656,'user-add',!![]);return asDryRunResult(_0x1bb841,{'method':_0x3faa36(0xf9),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x407f6){const _0x1bf72a=a237_0x2901a9,{mutation:_0xd48151,changed:_0x468ef2,role:_0x329b4f,user:_0x17507d}=await prepareUserMutation(_0x407f6,_0x1bf72a(0xe8),![]);return _0x468ef2&&await createDevUserRole({'appCode':_0x407f6[_0x1bf72a(0xee)],'userId':_0x17507d[_0x1bf72a(0xf0)],'username':_0x17507d[_0x1bf72a(0xf5)],'roleType':_0x329b4f[_0x1bf72a(0xf8)],'roleId':_0xd48151[_0x1bf72a(0xe5)][_0x1bf72a(0xe7)]}),{'ok':!![],'data':_0xd48151,'message':_0x468ef2?_0x1bf72a(0xe4)+_0xd48151[_0x1bf72a(0xe5)][_0x1bf72a(0xf0)]+_0x1bf72a(0xef)+_0xd48151[_0x1bf72a(0xe5)][_0x1bf72a(0xeb)]:_0x1bf72a(0xe6)+_0xd48151['selector'][_0x1bf72a(0xf0)]+_0x1bf72a(0xf1)+_0xd48151[_0x1bf72a(0xe5)]['roleName']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a238_0x25dc(_0xe8b66b,_0x18cd83){_0xe8b66b=_0xe8b66b-0x182;const _0x3315ad=a238_0x3315();let _0x25dc12=_0x3315ad[_0xe8b66b];return _0x25dc12;}const a238_0x178d49=a238_0x25dc;(function(_0xec51c6,_0x25245f){const _0x559f0e=a238_0x25dc,_0x6dfc50=_0xec51c6();while(!![]){try{const _0x3c4d6c=-parseInt(_0x559f0e(0x185))/0x1*(-parseInt(_0x559f0e(0x18c))/0x2)+-parseInt(_0x559f0e(0x184))/0x3*(-parseInt(_0x559f0e(0x193))/0x4)+-parseInt(_0x559f0e(0x18f))/0x5+-parseInt(_0x559f0e(0x186))/0x6+-parseInt(_0x559f0e(0x18a))/0x7+-parseInt(_0x559f0e(0x189))/0x8*(parseInt(_0x559f0e(0x188))/0x9)+-parseInt(_0x559f0e(0x194))/0xa*(-parseInt(_0x559f0e(0x187))/0xb);if(_0x3c4d6c===_0x25245f)break;else _0x6dfc50['push'](_0x6dfc50['shift']());}catch(_0x41c491){_0x6dfc50['push'](_0x6dfc50['shift']());}}}(a238_0x3315,0x63922));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a238_0x178d49(0x191),'command':'user-remove','description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a238_0x178d49(0x192),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x418e85){const {mutation:_0x45569a}=await prepareUserMutation(_0x418e85,'user-remove',!![]);return asDryRunResult(_0x45569a,{'method':'POST','url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x5ba7d0){const _0x40d8b2=a238_0x178d49,{matchingRelationIds:_0x5ee6c7,mutation:_0x8fc0da,changed:_0xcf49ad}=await prepareUserMutation(_0x5ba7d0,_0x40d8b2(0x18b),![]);if(_0xcf49ad)for(const _0x979014 of _0x5ee6c7){await deleteDevUserRole(_0x979014);}return{'ok':!![],'data':_0x8fc0da,'message':_0xcf49ad?_0x40d8b2(0x18d)+_0x8fc0da[_0x40d8b2(0x196)][_0x40d8b2(0x182)]+_0x40d8b2(0x190)+_0x8fc0da[_0x40d8b2(0x196)][_0x40d8b2(0x195)]:_0x40d8b2(0x18e)+_0x8fc0da['selector']['userId']+_0x40d8b2(0x183)+_0x8fc0da[_0x40d8b2(0x196)][_0x40d8b2(0x195)]};}};function a238_0x3315(){const _0x10f8b5=['5613qOpTOa','91456UWTWUg','2476098vFNoCG','15004UMHOZu','7243389YcOXNq','8KtdWRq','1877960kBSVJm','user-remove','2aiVqCw','Removed\x20user\x20','No\x20change:\x20user\x20','2055295xxqZdD','\x20from\x20role\x20','role','high-risk-write','28GHqmMO','16130muVwBa','roleName','selector','userId','\x20not\x20in\x20role\x20'];a238_0x3315=function(){return _0x10f8b5;};return a238_0x3315();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a239_0x2622(_0x15fff0,_0x2f96b0){_0x15fff0=_0x15fff0-0x8d;const _0x27ce34=a239_0x27ce();let _0x262298=_0x27ce34[_0x15fff0];return _0x262298;}function a239_0x27ce(){const _0x37fbe1=['matchedBy','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','3592986emqUXp','2041944pfpodj','591273Fzaegx','Pass\x20--name\x20<nickname|username>.','582736abvCxM','user-resolve','trim','3154744hoPlCF','2075293qDvmEy','name','8ZkXTTz','read','role','\x22\x20→\x20userId\x20','userId','18FDVEld','131592CtmTQy','str','Resolved\x20\x22','flagMissing','username','5gcuHCo','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','40uCKHck','nickname'];a239_0x27ce=function(){return _0x37fbe1;};return a239_0x27ce();}const a239_0x45d839=a239_0x2622;(function(_0x5d078e,_0x5b017f){const _0x5ad83f=a239_0x2622,_0x7ef4fc=_0x5d078e();while(!![]){try{const _0x37d47b=parseInt(_0x5ad83f(0x9b))/0x1+parseInt(_0x5ad83f(0x95))/0x2*(-parseInt(_0x5ad83f(0x8d))/0x3)+parseInt(_0x5ad83f(0x92))/0x4+-parseInt(_0x5ad83f(0xa0))/0x5*(-parseInt(_0x5ad83f(0xa6))/0x6)+-parseInt(_0x5ad83f(0x8f))/0x7+-parseInt(_0x5ad83f(0xa7))/0x8*(-parseInt(_0x5ad83f(0x9a))/0x9)+-parseInt(_0x5ad83f(0xa2))/0xa*(parseInt(_0x5ad83f(0x93))/0xb);if(_0x37d47b===_0x5b017f)break;else _0x7ef4fc['push'](_0x7ef4fc['shift']());}catch(_0x386c22){_0x7ef4fc['push'](_0x7ef4fc['shift']());}}}(a239_0x27ce,0x62783));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a239_0x45d839(0x97),'command':a239_0x45d839(0x90),'description':a239_0x45d839(0xa1),'risk':a239_0x45d839(0x96),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3a1bcb){const _0x5a3245=a239_0x45d839;if(!_0x3a1bcb[_0x5a3245(0x9c)]('name')[_0x5a3245(0x91)]())throw CliErrors[_0x5a3245(0x9e)](_0x5a3245(0x94),_0x5a3245(0x8e));},async 'execute'(_0x4a7738){const _0x1038c6=a239_0x45d839,_0xffeb74=_0x4a7738[_0x1038c6(0x9c)](_0x1038c6(0x94))[_0x1038c6(0x91)](),_0x1fdfdb=await resolveUserRef(_0xffeb74,_0x1038c6(0xa5));return{'ok':!![],'data':{'user':{'userId':_0x1fdfdb[_0x1038c6(0x99)],'username':_0x1fdfdb[_0x1038c6(0x9f)],'nickname':_0x1fdfdb[_0x1038c6(0xa3)],'matchedBy':_0x1fdfdb[_0x1038c6(0xa4)]}},'message':_0x1038c6(0x9d)+_0xffeb74+_0x1038c6(0x98)+_0x1fdfdb[_0x1038c6(0x99)]};}};
|
package/lib/commands/rule/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a240_0x123a(_0x35c71c,_0x25b7b2){_0x35c71c=_0x35c71c-0x151;const _0x3508ea=a240_0x3508();let _0x123ad1=_0x3508ea[_0x35c71c];return _0x123ad1;}const a240_0x3fa191=a240_0x123a;(function(_0x21d9b0,_0xc30c99){const _0xc1c5a2=a240_0x123a,_0xea5347=_0x21d9b0();while(!![]){try{const _0x237dcb=parseInt(_0xc1c5a2(0x165))/0x1*(-parseInt(_0xc1c5a2(0x15a))/0x2)+parseInt(_0xc1c5a2(0x15c))/0x3*(parseInt(_0xc1c5a2(0x166))/0x4)+-parseInt(_0xc1c5a2(0x158))/0x5+parseInt(_0xc1c5a2(0x161))/0x6+parseInt(_0xc1c5a2(0x164))/0x7*(parseInt(_0xc1c5a2(0x162))/0x8)+-parseInt(_0xc1c5a2(0x152))/0x9+parseInt(_0xc1c5a2(0x160))/0xa*(parseInt(_0xc1c5a2(0x15b))/0xb);if(_0x237dcb===_0xc30c99)break;else _0xea5347['push'](_0xea5347['shift']());}catch(_0x3a3514){_0xea5347['push'](_0xea5347['shift']());}}}(a240_0x3508,0x5acc7));function a240_0x3508(){const _0x2b1c49=['cookie','6483735KiuURb','content','\x20--file\x20<path>\x20--dry-run`.','read','\x20is\x20not\x20configured\x20for\x20app\x20','appCode','2264745tAxgRs','rule','268xyJcab','13010932gbiPnZ','99xxZRrd','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','\x20for\x20','Loaded\x20','10SnNKMI','2666538hnAHnk','268808zflqDI','get','7rphjen','1070GuLJYI','3372sZLoQf'];a240_0x3508=function(){return _0x2b1c49;};return a240_0x3508();}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a240_0x3fa191(0x159),'command':a240_0x3fa191(0x163),'description':a240_0x3fa191(0x15d),'risk':a240_0x3fa191(0x155),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x442680){readAppRuleType(_0x442680);},async 'execute'(_0x447ec0){const _0x311f1f=a240_0x3fa191,_0x3be4d1=readAppRuleType(_0x447ec0),_0x2b79b1=await getAppRule(_0x447ec0[_0x311f1f(0x151)],{'appCode':_0x447ec0[_0x311f1f(0x157)],'type':_0x3be4d1});if(!_0x2b79b1)throw appRuleError('app_rule_not_found',appRuleFileName(_0x3be4d1)+_0x311f1f(0x156)+_0x447ec0[_0x311f1f(0x157)]+'.','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20'+_0x3be4d1+_0x311f1f(0x154));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x3be4d1,_0x2b79b1),'content':_0x2b79b1[_0x311f1f(0x153)]}},'message':_0x311f1f(0x15f)+appRuleFileName(_0x3be4d1)+_0x311f1f(0x15e)+_0x447ec0[_0x311f1f(0x157)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e5c93,_0x1db9c8){const _0x31f13e=a241_0x13cf,_0x46cf3b=_0x3e5c93();while(!![]){try{const _0x5c10ad=parseInt(_0x31f13e(0xc0))/0x1*(parseInt(_0x31f13e(0xc6))/0x2)+parseInt(_0x31f13e(0xc4))/0x3+-parseInt(_0x31f13e(0xca))/0x4+-parseInt(_0x31f13e(0xc7))/0x5*(-parseInt(_0x31f13e(0xc9))/0x6)+parseInt(_0x31f13e(0xc2))/0x7*(-parseInt(_0x31f13e(0xc1))/0x8)+parseInt(_0x31f13e(0xc5))/0x9*(parseInt(_0x31f13e(0xc8))/0xa)+parseInt(_0x31f13e(0xcb))/0xb*(-parseInt(_0x31f13e(0xc3))/0xc);if(_0x5c10ad===_0x1db9c8)break;else _0x46cf3b['push'](_0x46cf3b['shift']());}catch(_0x500c87){_0x46cf3b['push'](_0x46cf3b['shift']());}}}(a241_0x2806,0xe46b7));function a241_0x13cf(_0x207a73,_0x2f51a8){_0x207a73=_0x207a73-0xc0;const _0x2806cd=a241_0x2806();let _0x13cfa4=_0x2806cd[_0x207a73];return _0x13cfa4;}import{ruleGet}from'../../commands/rule/get.js';function a241_0x2806(){const _0x4caffb=['1092384MBkUMB','21QFknZk','4067916uLZnpi','2731032PozuAq','13374ttcSfc','52858biNUvZ','493770lmJMFc','2510vrCQqF','72ZommYt','6625164LDZVMf','11dRuPIQ','33kDdFsi'];a241_0x2806=function(){return _0x4caffb;};return a241_0x2806();}import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a242_0x46fb(){const _0x2e0666=['12JjsUsO','rule','1208aWIpiv','17493QEwOHv','read','appCode','map','863DuwHix','6utrTXb','7443CnGOol','1257080xTSbBl','2279460JKbkFB','Loaded\x20app\x20rule\x20configuration\x20for\x20','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','2586518VnPyVi','cookie','4177062qemLTZ','length','1214OtvORn'];a242_0x46fb=function(){return _0x2e0666;};return a242_0x46fb();}const a242_0x3089d4=a242_0x307a;(function(_0x311c4c,_0x395d92){const _0x3c924d=a242_0x307a,_0x57a865=_0x311c4c();while(!![]){try{const _0x399024=-parseInt(_0x3c924d(0x16b))/0x1*(-parseInt(_0x3c924d(0x176))/0x2)+-parseInt(_0x3c924d(0x16d))/0x3*(-parseInt(_0x3c924d(0x177))/0x4)+-parseInt(_0x3c924d(0x16f))/0x5*(parseInt(_0x3c924d(0x16c))/0x6)+-parseInt(_0x3c924d(0x167))/0x7*(-parseInt(_0x3c924d(0x166))/0x8)+-parseInt(_0x3c924d(0x174))/0x9+parseInt(_0x3c924d(0x16e))/0xa+parseInt(_0x3c924d(0x172))/0xb;if(_0x399024===_0x395d92)break;else _0x57a865['push'](_0x57a865['shift']());}catch(_0x4ff6b6){_0x57a865['push'](_0x57a865['shift']());}}}(a242_0x46fb,0x5551d));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';function a242_0x307a(_0x2d2ec7,_0x2a24a0){_0x2d2ec7=_0x2d2ec7-0x165;const _0x46fb77=a242_0x46fb();let _0x307ad7=_0x46fb77[_0x2d2ec7];return _0x307ad7;}export const ruleList={'service':a242_0x3089d4(0x165),'command':'list','description':a242_0x3089d4(0x171),'risk':a242_0x3089d4(0x168),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x354026){const _0x5eb69e=a242_0x3089d4,_0x12875e=await Promise['all'](APP_RULE_TYPES[_0x5eb69e(0x16a)](_0x556d05=>getAppRule(_0x354026[_0x5eb69e(0x173)],{'appCode':_0x354026[_0x5eb69e(0x169)],'type':_0x556d05}))),_0x62f985=APP_RULE_TYPES['map']((_0x395988,_0x23ddd1)=>projectAppRule(_0x395988,_0x12875e[_0x23ddd1]??null));return{'ok':!![],'data':{'total':_0x62f985[_0x5eb69e(0x175)],'rules':_0x62f985},'message':_0x5eb69e(0x170)+_0x354026[_0x5eb69e(0x169)]};}};
|
package/lib/commands/rule/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a243_0xada9bc=a243_0x2601;function a243_0x1bae(){const _0x439b89=['number','write','Expected\x20','contentHash','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','Pass\x20a\x20UTF-8\x20Markdown\x20file.','rule','version','flag','\x20for\x20','expectedVersion','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','\x20--format\x20compress','app_rule_version_mismatch','412948OIahnK','--file\x20is\x20required.','/smartapi/knowledge-base/save','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','4543506bzLDSd','push','cookie','beforeRecord','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','str','isSafeInteger','app_rule_set_outcome_unknown','type','rules','before','content','POST','appCode','Set\x20','byteSize','4984QjBcua','input',';\x20current\x20version\x20is\x20','replacement','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','trim','set','533093meJvIz','verified','5736960jGisKx','defineProperty','file','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','3952SroWWz','12383RUBnpB','410nVjCtr','60YnLdQc','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','string','\x20version\x20changed\x20before\x20write.','1002ADPfWr','rabetbase\x20rule\x20get\x20--type\x20','cause','43768zetZkk','app_rule_expected_version_invalid','unconfigured'];a243_0x1bae=function(){return _0x439b89;};return a243_0x1bae();}(function(_0x22d2a7,_0x52bca5){const _0x17f47c=a243_0x2601,_0x5dec2d=_0x22d2a7();while(!![]){try{const _0x28f370=-parseInt(_0x17f47c(0x16f))/0x1+parseInt(_0x17f47c(0x183))/0x2*(-parseInt(_0x17f47c(0x197))/0x3)+-parseInt(_0x17f47c(0x15e))/0x4*(parseInt(_0x17f47c(0x192))/0x5)+parseInt(_0x17f47c(0x18c))/0x6+-parseInt(_0x17f47c(0x191))/0x7*(-parseInt(_0x17f47c(0x190))/0x8)+parseInt(_0x17f47c(0x173))/0x9+parseInt(_0x17f47c(0x193))/0xa*(parseInt(_0x17f47c(0x18a))/0xb);if(_0x28f370===_0x52bca5)break;else _0x5dec2d['push'](_0x5dec2d['shift']());}catch(_0xacb31e){_0x5dec2d['push'](_0x5dec2d['shift']());}}}(a243_0x1bae,0x75f42));import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';function a243_0x2601(_0x412ede,_0x2c3489){_0x412ede=_0x412ede-0x15d;const _0x1bae4d=a243_0x1bae();let _0x260110=_0x1bae4d[_0x412ede];return _0x260110;}const SAVE_PATH=a243_0xada9bc(0x171),NON_ATOMIC_WARNING='--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.';function readSetInput(_0x2772cd){const _0x12e1f6=a243_0xada9bc,_0x398bd3=readAppRuleType(_0x2772cd),_0x42953c=_0x2772cd[_0x12e1f6(0x178)](_0x12e1f6(0x18e))[_0x12e1f6(0x188)]();if(!_0x42953c)throw appRuleError('app_rule_file_required',_0x12e1f6(0x170),_0x12e1f6(0x166));const _0x8273c0=_0x2772cd[_0x12e1f6(0x169)]('expected-version');let _0x485e35;if(_0x8273c0!==undefined){_0x485e35=Number(_0x8273c0);if(!Number[_0x12e1f6(0x179)](_0x485e35)||_0x485e35<0x0)throw appRuleError(_0x12e1f6(0x15f),_0x12e1f6(0x194));}return{'type':_0x398bd3,'file':_0x42953c,'expectedVersion':_0x485e35};}async function prepareSet(_0x53d0e0){const _0x38ba87=a243_0xada9bc,_0x120463=readSetInput(_0x53d0e0),_0x1b067a=await readAppRuleFile(_0x120463[_0x38ba87(0x18e)]),_0x599fe7=await getAppRule(_0x53d0e0[_0x38ba87(0x175)],{'appCode':_0x53d0e0[_0x38ba87(0x180)],'type':_0x120463['type']});if(_0x120463[_0x38ba87(0x16b)]!==undefined&&_0x599fe7?.[_0x38ba87(0x168)]!==_0x120463[_0x38ba87(0x16b)])throw appRuleError(_0x38ba87(0x16e),appRuleFileName(_0x120463[_0x38ba87(0x17b)])+_0x38ba87(0x196),_0x38ba87(0x163)+_0x120463[_0x38ba87(0x16b)]+_0x38ba87(0x185)+(_0x599fe7?.[_0x38ba87(0x168)]??_0x38ba87(0x160))+_0x38ba87(0x187));return{'input':_0x120463,'replacement':_0x1b067a,'beforeRecord':_0x599fe7,'before':projectAppRule(_0x120463['type'],_0x599fe7),'planned':{'type':_0x120463[_0x38ba87(0x17b)],'fileName':appRuleFileName(_0x120463[_0x38ba87(0x17b)]),'contextScope':appRuleContextScope(_0x120463[_0x38ba87(0x17b)]),'enabled':!![],'appCode':_0x53d0e0[_0x38ba87(0x180)],'scope':_0x38ba87(0x17c),'contentByteSize':_0x1b067a[_0x38ba87(0x182)],'contentHash':_0x1b067a[_0x38ba87(0x164)]}};}function warningsFor(_0x4364a2){return _0x4364a2===undefined?[]:[NON_ATOMIC_WARNING];}export const ruleSet={'service':a243_0xada9bc(0x167),'command':'set','description':'Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','risk':a243_0xada9bc(0x162),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0xada9bc(0x18e),'type':a243_0xada9bc(0x195),'required':!![],'description':'UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)'},{'name':'expected-version','type':a243_0xada9bc(0x161),'required':![],'description':a243_0xada9bc(0x172)}],async 'validate'(_0x12260b){readSetInput(_0x12260b);},async 'dryRun'(_0x1aa3a5){const _0x85bcf4=a243_0xada9bc,_0x1207ad=await prepareSet(_0x1aa3a5);return asDryRunResult({'operation':_0x85bcf4(0x189),'selector':{'appCode':_0x1aa3a5[_0x85bcf4(0x180)],'scope':_0x85bcf4(0x17c),'type':_0x1207ad[_0x85bcf4(0x184)]['type']},'before':_0x1207ad[_0x85bcf4(0x17d)],'after':_0x1207ad['planned'],'dryRun':!![],'backend':{'method':_0x85bcf4(0x17f),'path':SAVE_PATH},'warnings':warningsFor(_0x1207ad[_0x85bcf4(0x184)][_0x85bcf4(0x16b)]),'verification':{'expectedVersion':_0x1207ad[_0x85bcf4(0x184)][_0x85bcf4(0x16b)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x85bcf4(0x198)+_0x1207ad['input'][_0x85bcf4(0x17b)]+_0x85bcf4(0x16d)}},{'method':_0x85bcf4(0x17f),'url':SAVE_PATH});},async 'execute'(_0x404106){const _0x3704cd=a243_0xada9bc,_0x273114=await prepareSet(_0x404106);let _0x2ee331=![];try{await saveAppRule(_0x404106[_0x3704cd(0x175)],{'appCode':_0x404106[_0x3704cd(0x180)],'type':_0x273114[_0x3704cd(0x184)]['type'],'content':_0x273114['replacement'][_0x3704cd(0x17e)]});}catch(_0x42aa79){if(!isPlatformTransportFailure(_0x42aa79))throw _0x42aa79;_0x2ee331=!![];}let _0x2f9d12;try{_0x2f9d12=await getAppRule(_0x404106[_0x3704cd(0x175)],{'appCode':_0x404106[_0x3704cd(0x180)],'type':_0x273114[_0x3704cd(0x184)][_0x3704cd(0x17b)]});}catch(_0x4e2302){const _0x45c2cc=appRuleError(_0x2ee331?_0x3704cd(0x17a):'app_rule_verification_unavailable','The\x20set\x20request\x20was\x20sent,\x20but\x20'+appRuleFileName(_0x273114['input'][_0x3704cd(0x17b)])+'\x20could\x20not\x20be\x20verified.',_0x3704cd(0x16c));Object[_0x3704cd(0x18d)](_0x45c2cc,_0x3704cd(0x15d),{'value':_0x4e2302,'enumerable':![]});throw _0x45c2cc;}const _0x128312=_0x2f9d12&&inspectAppRuleContent(_0x2f9d12[_0x3704cd(0x17e)])[_0x3704cd(0x164)]===_0x273114[_0x3704cd(0x186)][_0x3704cd(0x164)],_0x2af342=_0x2f9d12&&(_0x273114[_0x3704cd(0x176)]===null||_0x2f9d12[_0x3704cd(0x168)]>_0x273114[_0x3704cd(0x176)][_0x3704cd(0x168)]);if(!_0x2f9d12||!_0x128312||!_0x2af342)throw appRuleError(_0x2ee331?_0x3704cd(0x17a):'app_rule_verification_failed',appRuleFileName(_0x273114[_0x3704cd(0x184)]['type'])+_0x3704cd(0x177),_0x3704cd(0x165)+_0x273114['input']['type']+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x38af85=warningsFor(_0x273114[_0x3704cd(0x184)][_0x3704cd(0x16b)]);_0x2ee331&&_0x38af85[_0x3704cd(0x174)](_0x3704cd(0x18f));const _0x27aa73=projectAppRule(_0x273114['input']['type'],_0x2f9d12);return{'ok':!![],'data':{'operation':_0x3704cd(0x189),'selector':{'appCode':_0x404106['appCode'],'scope':_0x3704cd(0x17c),'type':_0x273114[_0x3704cd(0x184)][_0x3704cd(0x17b)]},'before':_0x273114['before'],'after':_0x27aa73,'dryRun':![],'backend':{'method':_0x3704cd(0x17f),'path':SAVE_PATH},'warnings':_0x38af85,'verification':{'status':_0x3704cd(0x18b),'recoveredAfterUnknownResponse':_0x2ee331,'expectedVersion':_0x273114[_0x3704cd(0x184)]['expectedVersion']??null,'atomicCompareAndSet':![],'lookupCommand':_0x3704cd(0x198)+_0x273114[_0x3704cd(0x184)]['type']+'\x20--format\x20compress'}},'message':_0x3704cd(0x181)+appRuleFileName(_0x273114[_0x3704cd(0x184)][_0x3704cd(0x17b)])+_0x3704cd(0x16a)+_0x404106[_0x3704cd(0x180)]};}};
|