@lovrabet/rabetbase-cli 2.4.7 → 2.5.0-beta.2
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/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +13 -3
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.d.ts +7 -0
- package/lib/api/generate-sdk-config-file.js +1 -0
- 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/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.d.ts +2 -5
- 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/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.d.ts +5 -0
- package/lib/commands/config/delete.js +1 -0
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.d.ts +12 -0
- package/lib/commands/config/init.js +1 -0
- 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/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/delete.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-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/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/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/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.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/service.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/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/template.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/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +1 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.d.ts +6 -2
- 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.d.ts +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/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.d.ts +2 -2
- 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.d.ts +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/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/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.d.ts +10 -0
- package/lib/config/domain-config.js +1 -0
- package/lib/config/schema.d.ts +3 -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.d.ts +23 -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.d.ts +9 -0
- package/lib/constant/region.js +1 -0
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.d.ts +4 -6
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +2 -2
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +2 -0
- 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/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.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/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.d.ts +11 -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.d.ts +2 -2
- 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/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.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/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/types/index.d.ts +28 -0
- package/lib/utils/ai_config.d.ts +1 -2
- 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 -3
- package/skills/rabetbase/SKILL.md +33 -28
- package/skills/rabetbase/guides/backend-function.md +41 -12
- package/skills/rabetbase/guides/bff-creation-workflow.md +6 -4
- package/skills/rabetbase/guides/custom-page-workflow.md +1 -1
- package/skills/rabetbase/guides/data-api-guidelines.md +8 -8
- package/skills/rabetbase/guides/database-connection-workflow.md +8 -16
- package/skills/rabetbase/guides/menu-anomaly-manual-cleanup.md +1 -6
- package/skills/rabetbase/guides/sdk-client-generation.md +146 -0
- package/skills/rabetbase/guides/sql-creation-workflow.md +1 -1
- package/skills/rabetbase/guides/troubleshooting.md +1 -1
- package/skills/rabetbase/guides/typescript-sdk.md +46 -10
- package/skills/rabetbase/references/rabetbase-api-list.md +4 -4
- package/skills/rabetbase/references/rabetbase-api-pull.md +44 -29
- package/skills/rabetbase/references/rabetbase-app-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-auth-login.md +4 -2
- package/skills/rabetbase/references/rabetbase-bff-push.md +3 -1
- package/skills/rabetbase/references/rabetbase-codegen-sql.md +3 -1
- package/skills/rabetbase/references/rabetbase-config.md +75 -30
- package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +17 -6
- package/skills/rabetbase/references/rabetbase-dataset-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-db-analyze.md +3 -3
- package/skills/rabetbase/references/rabetbase-db-detail.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +4 -4
- package/skills/rabetbase/references/rabetbase-db-diff.md +6 -9
- package/skills/rabetbase/references/rabetbase-doctor.md +1 -1
- package/skills/rabetbase/references/rabetbase-init.md +57 -51
- package/skills/rabetbase/references/rabetbase-kb.md +2 -0
- package/skills/rabetbase/references/rabetbase-page-create.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-custom-detail.md +3 -3
- package/skills/rabetbase/references/rabetbase-page-custom-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-project-create.md +12 -3
- package/skills/rabetbase/references/rabetbase-project-upgrade.md +2 -2
- package/skills/rabetbase/references/rabetbase-role-user-resolve.md +2 -2
- package/skills/rabetbase/references/rabetbase-user-account.md +1 -1
- package/skills/rabetbase/references/rabetbase-workspace.md +6 -6
- package/skills/rabetbase.manifest.json +4 -3
- package/templates/README.md +17 -28
- package/templates/generate-api/api.ts.tpl +3 -3
- package/templates/generate-api/client.ts.tpl +10 -37
- package/lib/commands/data/filter.d.ts +0 -7
- package/lib/commands/data/filter.js +0 -1
- package/lib/commands/data/getOne.d.ts +0 -7
- package/lib/commands/data/getOne.js +0 -1
- package/lib/commands/data/index.d.ts +0 -8
- package/lib/commands/data/index.js +0 -1
- package/lib/commands/data/shared.d.ts +0 -33
- package/lib/commands/data/shared.js +0 -1
- package/lib/commands/init/index.d.ts +0 -11
- package/lib/commands/init/index.js +0 -1
- package/lib/utils/rules-cdn.d.ts +0 -38
- package/lib/utils/rules-cdn.js +0 -1
- package/templates/rules/lovrabet_rules.mdc.tpl +0 -893
- package/templates/skill/SKILL.md.tpl +0 -120
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x259e0d,_0x3439ed){const _0x49a980=a49_0x27bc,_0x5bd3ca=_0x259e0d();while(!![]){try{const _0x5a20b4=-parseInt(_0x49a980(0x195))/0x1*(-parseInt(_0x49a980(0x191))/0x2)+parseInt(_0x49a980(0x19c))/0x3+-parseInt(_0x49a980(0x18f))/0x4+-parseInt(_0x49a980(0x19d))/0x5*(-parseInt(_0x49a980(0x1a2))/0x6)+-parseInt(_0x49a980(0x193))/0x7*(-parseInt(_0x49a980(0x1a0))/0x8)+-parseInt(_0x49a980(0x190))/0x9*(-parseInt(_0x49a980(0x196))/0xa)+-parseInt(_0x49a980(0x19f))/0xb*(parseInt(_0x49a980(0x194))/0xc);if(_0x5a20b4===_0x3439ed)break;else _0x5bd3ca['push'](_0x5bd3ca['shift']());}catch(_0x58f085){_0x5bd3ca['push'](_0x5bd3ca['shift']());}}}(a49_0x267c,0x6badc));function a49_0x27bc(_0x439563,_0x592e07){_0x439563=_0x439563-0x18f;const _0x267cad=a49_0x267c();let _0x27bc0a=_0x267cad[_0x439563];return _0x27bc0a;}function a49_0x267c(){const _0x1128b1=['ceil','264JHDmyZ','isFile','2211412omIEsu','9EgZosq','4300XgmbeU','validation','7539PAPVUR','13082976cevVVE','125zxJaWx','5013350Htulvi','\x20MB','File\x20not\x20found:\x20','size','File\x20is\x20not\x20a\x20regular\x20file:\x20','toFixed','2132526pCHoec','39910CSRsur','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','11xlFpie','1872mwgFwW'];a49_0x267c=function(){return _0x1128b1;};return a49_0x267c();}import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x3f0695){const _0x3e5819=a49_0x27bc;if(_0x3f0695>=BYTES_PER_MB){const _0x257bbd=Math[_0x3e5819(0x1a1)](_0x3f0695/BYTES_PER_MB*0x64)/0x64;return _0x257bbd[_0x3e5819(0x19b)](0x2)+_0x3e5819(0x197);}return _0x3f0695+'\x20B';}export function requireDevelopmentUploadFile(_0x13a617,_0x589d12){const _0x5a3e48=a49_0x27bc,_0xdd42e6=_0x13a617['trim']();if(!_0xdd42e6)throw CliErrors['validation'](_0x589d12+'\x20path\x20is\x20required.');if(!existsSync(_0xdd42e6))throw CliErrors[_0x5a3e48(0x192)](_0x5a3e48(0x198)+_0xdd42e6);const _0x5803f5=statSync(_0xdd42e6);if(!_0x5803f5[_0x5a3e48(0x1a3)]())throw CliErrors['validation'](_0x5a3e48(0x19a)+_0xdd42e6);if(_0x5803f5[_0x5a3e48(0x199)]>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x5a3e48(0x192)](_0x5a3e48(0x19e)+_0xdd42e6+'\x20('+formatBytes(_0x5803f5[_0x5a3e48(0x199)])+')');return{'path':_0xdd42e6,'size':_0x5803f5[_0x5a3e48(0x199)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x6b2801,_0x372a32){const _0x279706=a50_0x35e5,_0x2d2e73=_0x6b2801();while(!![]){try{const _0xf58fda=-parseInt(_0x279706(0xf3))/0x1+-parseInt(_0x279706(0xee))/0x2*(parseInt(_0x279706(0xef))/0x3)+parseInt(_0x279706(0xf0))/0x4+-parseInt(_0x279706(0xfa))/0x5+parseInt(_0x279706(0xf6))/0x6*(-parseInt(_0x279706(0xec))/0x7)+parseInt(_0x279706(0xf1))/0x8+parseInt(_0x279706(0xf2))/0x9*(parseInt(_0x279706(0xf7))/0xa);if(_0xf58fda===_0x372a32)break;else _0x2d2e73['push'](_0x2d2e73['shift']());}catch(_0x19e85a){_0x2d2e73['push'](_0x2d2e73['shift']());}}}(a50_0x3001,0xe828a));function a50_0x3001(){const _0x2ce37b=['App\x20Code\x20cannot\x20be\x20empty','752283ANjoAT','test','148ULxlSK','66414xvYMaO','5609028osrcfl','9978872ERiiLN','9azdrxc','874811lenwKd','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','trim','72JWZQuS','33112540geKSpJ','length','App\x20Code\x20cannot\x20exceed\x20100\x20characters','6036485jmZYqD'];a50_0x3001=function(){return _0x2ce37b;};return a50_0x3001();}function a50_0x35e5(_0x44d963,_0x38b8f1){_0x44d963=_0x44d963-0xec;const _0x3001a0=a50_0x3001();let _0x35e59c=_0x3001a0[_0x44d963];return _0x35e59c;}export function validateAppcode(_0x321376){const _0x21fa0f=a50_0x35e5,_0x24162=_0x321376[_0x21fa0f(0xf5)]();if(!_0x24162)return{'valid':![],'message':_0x21fa0f(0xfb)};if(_0x24162[_0x21fa0f(0xf8)]>0x64)return{'valid':![],'message':_0x21fa0f(0xf9)};if(!/^[A-Za-z0-9_-]+$/[_0x21fa0f(0xed)](_0x24162))return{'valid':![],'message':_0x21fa0f(0xf4)};return{'valid':!![]};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a51_0x56ca8b=a51_0x3e54;(function(_0x122ab0,_0x5f2ac4){const _0x54b10b=a51_0x3e54,_0x46619a=_0x122ab0();while(!![]){try{const _0x5a3d40=parseInt(_0x54b10b(0x124))/0x1+parseInt(_0x54b10b(0x11b))/0x2*(parseInt(_0x54b10b(0x120))/0x3)+parseInt(_0x54b10b(0x121))/0x4+-parseInt(_0x54b10b(0x12b))/0x5+-parseInt(_0x54b10b(0x138))/0x6*(-parseInt(_0x54b10b(0x127))/0x7)+-parseInt(_0x54b10b(0x139))/0x8+-parseInt(_0x54b10b(0x136))/0x9;if(_0x5a3d40===_0x5f2ac4)break;else _0x46619a['push'](_0x46619a['shift']());}catch(_0x3506d1){_0x46619a['push'](_0x46619a['shift']());}}}(a51_0x70ae,0xc0cb2));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,isTopLevelConfigKey,readScopedConfig,resolveWriteScope,writeScopedConfig}from'../../commands/config/shared.js';function a51_0x3e54(_0x264d35,_0x46e580){_0x264d35=_0x264d35-0x11a;const _0x70ae8d=a51_0x70ae();let _0x3e5437=_0x70ae8d[_0x264d35];return _0x3e5437;}const LEGACY_DELETABLE_KEYS=new Set([a51_0x56ca8b(0x12a)]),EXTRA_DELETABLE_KEYS=new Set(['defaultApp']);async function execute(_0x563cb5){const _0x595bfc=a51_0x56ca8b,_0x4248d0=_0x563cb5['args'][0x0]?.[_0x595bfc(0x12d)]();if(!_0x4248d0)throw CliErrors[_0x595bfc(0x134)](_0x595bfc(0x135),_0x595bfc(0x12c)+CLI_BIN_NAME+_0x595bfc(0x125));if(_0x4248d0===_0x595bfc(0x11f))throw CliErrors[_0x595bfc(0x134)](_0x595bfc(0x131));if(!isTopLevelConfigKey(_0x4248d0)&&!EXTRA_DELETABLE_KEYS[_0x595bfc(0x11e)](_0x4248d0)&&!LEGACY_DELETABLE_KEYS[_0x595bfc(0x11e)](_0x4248d0))throw CliErrors[_0x595bfc(0x134)](_0x595bfc(0x130)+_0x4248d0+_0x595bfc(0x126),_0x595bfc(0x137));const _0x3f02df=resolveWriteScope({'global':_0x563cb5[_0x595bfc(0x132)](_0x595bfc(0x11c))}),_0x5672ac=readScopedConfig(_0x3f02df),_0x2556ca=Object['prototype']['hasOwnProperty']['call'](_0x5672ac,_0x4248d0);_0x2556ca&&(delete _0x5672ac[_0x4248d0],writeScopedConfig(_0x5672ac,_0x3f02df));const _0x2059fb=_0x3f02df===_0x595bfc(0x11c)?'Global':_0x595bfc(0x12e);return{'ok':!![],'message':_0x2556ca?'✓\x20'+_0x2059fb+'\x20'+_0x4248d0+'\x20deleted':'✓\x20'+_0x2059fb+'\x20'+_0x4248d0+_0x595bfc(0x129),'data':{'key':_0x4248d0,'scope':_0x3f02df,'changed':_0x2556ca}};}export const configDeleteDefinition={'service':a51_0x56ca8b(0x128),'command':a51_0x56ca8b(0x11d),'description':a51_0x56ca8b(0x11a),'risk':a51_0x56ca8b(0x13a),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a51_0x56ca8b(0x122),'description':a51_0x56ca8b(0x123),'required':!![]}],'flags':[{'name':a51_0x56ca8b(0x11c),'type':a51_0x56ca8b(0x12f),'description':a51_0x56ca8b(0x133),'default':![]}],'execute':execute};function a51_0x70ae(){const _0x4a9301=['Use\x20workspace\x20commands\x20to\x20modify\x20apps\x20and\x20their\x20default\x20selection.','4588626WRJPmQ','727720luTTNK','write','Delete\x20a\x20config\x20value\x20from\x20one\x20scope','224292JWoPMK','global','delete','has','riskLevel','6htEOzg','4869372VQJGfo','key','Top-level\x20config\x20key;\x20legacy\x20inherit\x20is\x20accepted\x20for\x20migration','777778UCCkQU','\x20config\x20delete\x20<key>\x20[--global]','\x22\x20is\x20not\x20deletable.','7VBhkpY','config','\x20already\x20absent','inherit','5090240ywJqai','Usage:\x20','trim','Project','boolean','Top-level\x20key\x20\x22','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','bool','Delete\x20from\x20global\x20config\x20(~/.rabetbase.json)','validation','Missing\x20key\x20argument.','9769401foyIfa'];a51_0x70ae=function(){return _0x4a9301;};return a51_0x70ae();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a52_0x594bf1=a52_0x2466;function a52_0x1fc3(){const _0x1fc03c=['str','\x20config\x20get\x20--key\x20<key>','Key\x20not\x20found:\x20','1231284UwIvcr','2814623GLHtiw','9zqAXob','validation','get','Get\x20a\x20config\x20value\x20by\x20key','1358947QESYGr','10531640UbbrvT','21172430RjNvum','appcode','key','read','config','90Alliel','6uktAnU','Usage:\x20','app','string','4285245HRFGto','145268KcRAbu'];a52_0x1fc3=function(){return _0x1fc03c;};return a52_0x1fc3();}(function(_0x13e2dd,_0x247f01){const _0xd6d648=a52_0x2466,_0x48da10=_0x13e2dd();while(!![]){try{const _0x4fa6c3=parseInt(_0xd6d648(0x129))/0x1+parseInt(_0xd6d648(0x123))/0x2+-parseInt(_0xd6d648(0x119))/0x3*(-parseInt(_0xd6d648(0x11f))/0x4)+parseInt(_0xd6d648(0x11e))/0x5+-parseInt(_0xd6d648(0x11a))/0x6*(-parseInt(_0xd6d648(0x124))/0x7)+parseInt(_0xd6d648(0x12a))/0x8*(-parseInt(_0xd6d648(0x125))/0x9)+-parseInt(_0xd6d648(0x114))/0xa;if(_0x4fa6c3===_0x247f01)break;else _0x48da10['push'](_0x48da10['shift']());}catch(_0xcb8205){_0x48da10['push'](_0x48da10['shift']());}}}(a52_0x1fc3,0xd92c3));import{CliErrors}from'../../errors.js';import{readConfig}from'../../utils/config.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';function a52_0x2466(_0x2e6492,_0x4e4669){_0x2e6492=_0x2e6492-0x114;const _0x1fc317=a52_0x1fc3();let _0x246619=_0x1fc317[_0x2e6492];return _0x246619;}async function execute(_0x23b780){const _0x4081dd=a52_0x2466,_0x2870c8=_0x23b780[_0x4081dd(0x120)](_0x4081dd(0x116));if(!_0x2870c8)throw CliErrors[_0x4081dd(0x126)]('Missing\x20key.',_0x4081dd(0x11b)+CLI_BIN_NAME+_0x4081dd(0x121));const _0x2ef5bc=readConfig(),_0x434be8=_0x2870c8===_0x4081dd(0x11c)?_0x4081dd(0x115):_0x2870c8,_0x4753d9=_0x2ef5bc[_0x434be8];if(_0x4753d9===undefined)throw CliErrors[_0x4081dd(0x126)](_0x4081dd(0x122)+_0x2870c8);return{'ok':!![],'data':typeof _0x4753d9==='object'?_0x4753d9:{[_0x434be8]:_0x4753d9},'message':typeof _0x4753d9==='object'?undefined:String(_0x4753d9)};}export const configGetDefinition={'service':a52_0x594bf1(0x118),'command':a52_0x594bf1(0x127),'description':a52_0x594bf1(0x128),'risk':a52_0x594bf1(0x117),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a52_0x594bf1(0x116),'type':a52_0x594bf1(0x11d),'description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a53_0x4252(_0x4e27ff,_0x2a9620){_0x4e27ff=_0x4e27ff-0xc4;const _0x5297aa=a53_0x5297();let _0x4252aa=_0x5297aa[_0x4e27ff];return _0x4252aa;}(function(_0x2f9c6a,_0xacebd6){const _0x417db8=a53_0x4252,_0x38787c=_0x2f9c6a();while(!![]){try{const _0x289db6=parseInt(_0x417db8(0xcc))/0x1*(-parseInt(_0x417db8(0xc4))/0x2)+-parseInt(_0x417db8(0xc5))/0x3+-parseInt(_0x417db8(0xc9))/0x4*(parseInt(_0x417db8(0xc8))/0x5)+-parseInt(_0x417db8(0xcd))/0x6+-parseInt(_0x417db8(0xc6))/0x7*(-parseInt(_0x417db8(0xca))/0x8)+parseInt(_0x417db8(0xcb))/0x9+parseInt(_0x417db8(0xc7))/0xa;if(_0x289db6===_0xacebd6)break;else _0x38787c['push'](_0x38787c['shift']());}catch(_0xb81d4e){_0x38787c['push'](_0x38787c['shift']());}}}(a53_0x5297,0xf3fd8));import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';import{configSetDefinition}from'../../commands/config/set.js';import{configDeleteDefinition}from'../../commands/config/delete.js';function a53_0x5297(){const _0x41e193=['6856TmuuNj','16053039KpBdtK','154651FkHpce','2240724KRUXQU','2MdVHTw','3013188TtHLUT','16177QzzXbg','7444980XCkofe','255awkqgg','155044WJTyri'];a53_0x5297=function(){return _0x41e193;};return a53_0x5297();}import{configInitDefinition}from'../../commands/config/init.js';export const configDefinitions=[configInitDefinition,configListDefinition,configGetDefinition,configSetDefinition,configDeleteDefinition];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandDefinition, FlagDef, RuntimeContext } from "../../framework/types.js";
|
|
2
|
+
export declare const configInitFlags: FlagDef[];
|
|
3
|
+
export declare function executeConfigInit(ctx: RuntimeContext): Promise<{
|
|
4
|
+
ok: boolean;
|
|
5
|
+
message: string;
|
|
6
|
+
data: {
|
|
7
|
+
mode: string;
|
|
8
|
+
region: "global" | "id" | "cn" | null;
|
|
9
|
+
domains: Partial<Record<"apiDomain" | "userDomain" | "runtimeDomain" | "skillDomain" | "kbDomain" | "appDomain", string>>;
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
export declare const configInitDefinition: CommandDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a54_0x2300e3=a54_0x4ad6;(function(_0x16c4a3,_0xd25c1e){const _0x11f518=a54_0x4ad6,_0x673de2=_0x16c4a3();while(!![]){try{const _0x411c45=-parseInt(_0x11f518(0x87))/0x1*(parseInt(_0x11f518(0x65))/0x2)+-parseInt(_0x11f518(0x77))/0x3+-parseInt(_0x11f518(0x89))/0x4*(parseInt(_0x11f518(0x7e))/0x5)+-parseInt(_0x11f518(0x8f))/0x6*(-parseInt(_0x11f518(0x79))/0x7)+parseInt(_0x11f518(0x80))/0x8*(parseInt(_0x11f518(0x81))/0x9)+-parseInt(_0x11f518(0x84))/0xa+parseInt(_0x11f518(0x6c))/0xb;if(_0x411c45===_0xd25c1e)break;else _0x673de2['push'](_0x673de2['shift']());}catch(_0x2c3b19){_0x673de2['push'](_0x673de2['shift']());}}}(a54_0x16ee,0x8aac7));import{select}from'@inquirer/prompts';function a54_0x4ad6(_0x2b26bd,_0x64e79f){_0x2b26bd=_0x2b26bd-0x65;const _0x16ee45=a54_0x16ee();let _0x4ad602=_0x16ee45[_0x2b26bd];return _0x4ad602;}import{CliErrors}from'../../errors.js';import{readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{DOMAIN_CONFIG_FIELDS,LEGACY_DOMAIN_CONFIG_FIELDS,resolveDomainFlags}from'../../config/domain-config.js';import{DEFAULT_LOVRABET_REGION,ENABLED_LOVRABET_REGION_VALUES,isEnabledLovrabetRegion}from'../../constant/region.js';export const configInitFlags=[{'name':a54_0x2300e3(0x7a),'type':'string','description':a54_0x2300e3(0x86),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},{'name':a54_0x2300e3(0x83),'type':a54_0x2300e3(0x74),'description':a54_0x2300e3(0x6b)},{'name':a54_0x2300e3(0x7f),'type':a54_0x2300e3(0x74),'description':a54_0x2300e3(0x7d)},{'name':'api-domain','type':'string','description':'Custom\x20platform\x20API\x20HTTPS\x20origin'},{'name':a54_0x2300e3(0x66),'type':'string','description':'Custom\x20Runtime\x20HTTPS\x20origin'},{'name':a54_0x2300e3(0x90),'type':'string','description':a54_0x2300e3(0x68)},{'name':'kb-domain','type':a54_0x2300e3(0x74),'description':a54_0x2300e3(0x73)},{'name':'app-domain','type':a54_0x2300e3(0x74),'description':a54_0x2300e3(0x70)}];function a54_0x16ee(){const _0x268f25=['cancelled','Custom\x20Lovrabet\x20workspace\x20HTTPS\x20origin','independent','str','Custom\x20knowledge-base\x20HTTPS\x20origin','string','Rabetbase\x20connection\x20configured\x20for\x20region:\x20','Rabetbase\x20connection\x20configured\x20for\x20independent\x20deployment.\x20Domains:\x20','603021XuNYoB','keys','6235467fNEbAz','region','nonInteractive','validation','Custom\x20User\x20HTTPS\x20origin','290YmMWrF','user-domain','730672OZUrxw','45QjTNOE','assign','domain-config','2908230jIlogi','length','Official\x20Lovrabet\x20region:\x20cn\x20or\x20id','4168NHJJxG','Available\x20regions:\x20','62480bdbptU','init','Updates\x20the\x20global\x20Rabetbase\x20region\x20or\x20independent-deployment\x20domain\x20configuration.\x20Cookie,\x20output\x20format,\x20and\x20app\x20bindings\x20stay\x20unchanged.','ExitPromptError','Select\x20Lovrabet\x20region','join','6BSvFPg','skill-domain','name','188kxDvGb','runtime-domain','\x22\x20is\x20not\x20currently\x20available.','Custom\x20SkillHub\x20HTTPS\x20origin','config','global','Independent-deployment\x20Domain\x20JSON\x20file','11111518EEvHLo','Region\x20\x22','official'];a54_0x16ee=function(){return _0x268f25;};return a54_0x16ee();}async function resolveRegion(_0x4f9807){const _0x2184d1=a54_0x2300e3,_0x1d8c3a=_0x4f9807[_0x2184d1(0x72)](_0x2184d1(0x7a));if(_0x1d8c3a){if(!isEnabledLovrabetRegion(_0x1d8c3a))throw CliErrors[_0x2184d1(0x7c)](_0x2184d1(0x6d)+_0x1d8c3a+_0x2184d1(0x67),_0x2184d1(0x88)+ENABLED_LOVRABET_REGION_VALUES['join'](',\x20'));return _0x1d8c3a;}if(_0x4f9807[_0x2184d1(0x7b)])return DEFAULT_LOVRABET_REGION;try{return await select({'message':_0x2184d1(0x8d),'default':DEFAULT_LOVRABET_REGION,'choices':[{'name':'Mainland\x20China\x20(cn)','value':'cn'},{'name':'Indonesia\x20(id)','value':'id'}]});}catch(_0x318e2e){if(_0x318e2e?.[_0x2184d1(0x91)]===_0x2184d1(0x8c))throw CliErrors[_0x2184d1(0x6f)]();throw _0x318e2e;}}export async function executeConfigInit(_0x30c266){const _0x6c7a0d=a54_0x2300e3,_0x23a932=resolveDomainFlags(_0x30c266),_0x276787=Object[_0x6c7a0d(0x78)](_0x23a932)[_0x6c7a0d(0x85)]>0x0;if(_0x276787&&_0x30c266[_0x6c7a0d(0x72)](_0x6c7a0d(0x7a)))throw CliErrors[_0x6c7a0d(0x7c)]('Choose\x20either\x20an\x20official\x20region\x20or\x20independent-deployment\x20Domains,\x20not\x20both.');const _0x15b210=readScopedConfig(_0x6c7a0d(0x6a));for(const _0x4ecb7e of DOMAIN_CONFIG_FIELDS)delete _0x15b210[_0x4ecb7e];for(const _0x346b57 of LEGACY_DOMAIN_CONFIG_FIELDS)delete _0x15b210[_0x346b57];let _0x4e815d=null;if(_0x276787)delete _0x15b210[_0x6c7a0d(0x7a)],Object[_0x6c7a0d(0x82)](_0x15b210,_0x23a932);else{_0x4e815d=await resolveRegion(_0x30c266);if(_0x4e815d===DEFAULT_LOVRABET_REGION)delete _0x15b210[_0x6c7a0d(0x7a)];else _0x15b210['region']=_0x4e815d;}return writeScopedConfig(_0x15b210,_0x6c7a0d(0x6a)),{'ok':!![],'message':_0x276787?_0x6c7a0d(0x76)+Object[_0x6c7a0d(0x78)](_0x23a932)[_0x6c7a0d(0x8e)](',\x20')+'.':_0x6c7a0d(0x75)+_0x4e815d+'.','data':{'mode':_0x276787?_0x6c7a0d(0x71):_0x6c7a0d(0x6e),'region':_0x4e815d,'domains':_0x23a932}};}export const configInitDefinition={'service':a54_0x2300e3(0x69),'command':a54_0x2300e3(0x8a),'description':'Initialize\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domains','risk':'write','confirmationDescription':a54_0x2300e3(0x8b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':configInitFlags,'execute':executeConfigInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a55_0x58c8(_0xab8c9f,_0x297866){_0xab8c9f=_0xab8c9f-0x126;const _0x4949ca=a55_0x4949();let _0x58c804=_0x4949ca[_0xab8c9f];return _0x58c804;}const a55_0x9c8f3c=a55_0x58c8;(function(_0x2e6e28,_0x173aef){const _0x1cb186=a55_0x58c8,_0x4b40ab=_0x2e6e28();while(!![]){try{const _0x562521=parseInt(_0x1cb186(0x138))/0x1*(-parseInt(_0x1cb186(0x130))/0x2)+-parseInt(_0x1cb186(0x131))/0x3+-parseInt(_0x1cb186(0x126))/0x4*(parseInt(_0x1cb186(0x12e))/0x5)+parseInt(_0x1cb186(0x12b))/0x6*(parseInt(_0x1cb186(0x12a))/0x7)+parseInt(_0x1cb186(0x137))/0x8+parseInt(_0x1cb186(0x127))/0x9*(parseInt(_0x1cb186(0x129))/0xa)+parseInt(_0x1cb186(0x136))/0xb;if(_0x562521===_0x173aef)break;else _0x4b40ab['push'](_0x4b40ab['shift']());}catch(_0x4e35e4){_0x4b40ab['push'](_0x4b40ab['shift']());}}}(a55_0x4949,0xef31f));function a55_0x4949(){const _0x2d5bb3=['read','List\x20all\x20config\x20values','6264120bhKRlg','bool','78FVjlPx','4267695rDShXD','boolean','list','config','Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','15447333GlUHKy','10006928gLSQRt','40966RwJOsC','4nDRFlt','9fHlsQE','global','8306490GEPlFU','756xLrBzl','98166mBiuXO'];a55_0x4949=function(){return _0x2d5bb3;};return a55_0x4949();}import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';async function execute(_0xb60227){const _0x4ca0d0=a55_0x58c8,_0x5a433c=_0xb60227[_0x4ca0d0(0x12f)](_0x4ca0d0(0x128))?readScopedConfig('global'):readConfig();return{'ok':!![],'data':_0x5a433c};}export const configListDefinition={'service':a55_0x9c8f3c(0x134),'command':a55_0x9c8f3c(0x133),'description':a55_0x9c8f3c(0x12d),'risk':a55_0x9c8f3c(0x12c),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a55_0x9c8f3c(0x128),'type':a55_0x9c8f3c(0x132),'description':a55_0x9c8f3c(0x135),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a56_0x587ddb=a56_0xe878;function a56_0x2200(){const _0x201276=['Global','appcode','set','414984DjkDja','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.','env','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','locale','apps','bool','app','`,\x20`','Missing\x20key.','value','key','\x20set\x20to:\x20','Usage:\x20','object','10uWkIrI','35fbiQis','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','Project','includes','Settable\x20top-level\x20keys:\x20','riskLevel','1514385HnCAQb','string','global','105uEAmLD','keys','27204lHDbnZ','Top-level\x20key\x20\x22','Invalid\x20value\x20for\x20\x22','\x22.\x20Allowed:\x20','55nrQzSG','boolean','10MJmJXc','Missing\x20value.','7856vRQZST','Set\x20a\x20config\x20value','str','validation','config','\x22\x20is\x20not\x20settable.','9331311BSpuay','Invalid\x20locale\x20value.','\x20(stored\x20as\x20a\x20single\x20app\x20profile)','\x20appcode\x20set\x20to:\x20','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','2602tlEqIj','19390500IjSpXB','length','\x20workspace\x20add\x20<name>\x20--appcode\x20'];a56_0x2200=function(){return _0x201276;};return a56_0x2200();}(function(_0x3bc2a9,_0x9a5c9a){const _0x15e36e=a56_0xe878,_0x2dbe8c=_0x3bc2a9();while(!![]){try{const _0x2f08d3=parseInt(_0x15e36e(0x20c))/0x1*(-parseInt(_0x15e36e(0x1e5))/0x2)+parseInt(_0x15e36e(0x206))/0x3*(-parseInt(_0x15e36e(0x208))/0x4)+-parseInt(_0x15e36e(0x20e))/0x5*(parseInt(_0x15e36e(0x1ec))/0x6)+parseInt(_0x15e36e(0x1fd))/0x7*(-parseInt(_0x15e36e(0x210))/0x8)+parseInt(_0x15e36e(0x203))/0x9*(parseInt(_0x15e36e(0x1fc))/0xa)+-parseInt(_0x15e36e(0x1df))/0xb+parseInt(_0x15e36e(0x1e6))/0xc;if(_0x2f08d3===_0x9a5c9a)break;else _0x2dbe8c['push'](_0x2dbe8c['shift']());}catch(_0x12ec21){_0x2dbe8c['push'](_0x2dbe8c['shift']());}}}(a56_0x2200,0x75ec3));import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';function a56_0xe878(_0x383389,_0x483aa2){_0x383389=_0x383389-0x1dd;const _0x2200c3=a56_0x2200();let _0xe87856=_0x2200c3[_0x383389];return _0xe87856;}import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';import{DOMAIN_CONFIG_FIELDS,normalizeDomainOrigin}from'../../config/domain-config.js';async function execute(_0x209bae){const _0x3d957c=a56_0xe878,_0x431804=_0x209bae[_0x3d957c(0x212)]('key'),_0x572d5a=_0x209bae[_0x3d957c(0x212)](_0x3d957c(0x1f7));if(!_0x431804)throw CliErrors[_0x3d957c(0x213)](_0x3d957c(0x1f6),'Usage:\x20'+CLI_BIN_NAME+_0x3d957c(0x1fe));if(_0x572d5a===undefined||_0x572d5a==='')throw CliErrors['validation'](_0x3d957c(0x20f),_0x3d957c(0x1fa)+CLI_BIN_NAME+_0x3d957c(0x1fe));let _0x4747c5=_0x431804,_0x5e64f0=_0x572d5a;if(_0x572d5a[_0x3d957c(0x1e7)]>0x1f4)throw CliErrors[_0x3d957c(0x213)]('Config\x20value\x20is\x20invalid\x20or\x20too\x20long.');if(_0x431804===_0x3d957c(0x202))throw CliErrors['validation'](_0x3d957c(0x1ed));if(!isTopLevelConfigKey(_0x431804))throw CliErrors[_0x3d957c(0x213)](_0x3d957c(0x209)+_0x431804+_0x3d957c(0x1de),_0x3d957c(0x201)+getTopLevelConfigKeySummary());if(CONFIG_ENUM_VALUES[_0x431804]&&!CONFIG_ENUM_VALUES[_0x431804][_0x3d957c(0x200)](_0x572d5a))throw CliErrors[_0x3d957c(0x213)](_0x3d957c(0x20a)+_0x431804+_0x3d957c(0x20b)+CONFIG_ENUM_VALUES[_0x431804]['join'](',\x20'));if(_0x431804==='locale'&&!normalizeLocale(_0x572d5a))throw CliErrors[_0x3d957c(0x213)](_0x3d957c(0x1e0),'Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US');DOMAIN_CONFIG_FIELDS[_0x3d957c(0x200)](_0x431804)&&(_0x5e64f0=normalizeDomainOrigin(_0x431804,_0x572d5a));const _0x17788a={'global':_0x209bae[_0x3d957c(0x1f3)](_0x3d957c(0x205))},_0x1909a9=resolveWriteScope(_0x17788a),_0xa51141=readScopedConfig(_0x1909a9);_0x431804===_0x3d957c(0x1f4)&&(_0x4747c5=_0x3d957c(0x1ea),delete _0xa51141[_0x3d957c(0x1f4)]);_0x431804===_0x3d957c(0x1f1)&&(_0x5e64f0=normalizeLocale(_0x572d5a));if(_0x431804===_0x3d957c(0x1ef)){_0x5e64f0=normalizeEnv(_0x572d5a);if(!isProduction(_0x5e64f0)&&!isDaily(_0x5e64f0))throw CliErrors['validation'](_0x3d957c(0x1f0),_0x3d957c(0x1e3));}if(_0x431804===_0x3d957c(0x1ea)){const _0x430a3a=_0xa51141[_0x3d957c(0x1f2)]&&typeof _0xa51141[_0x3d957c(0x1f2)]===_0x3d957c(0x1fb)?Object[_0x3d957c(0x207)](_0xa51141['apps']):[];if(_0x430a3a[_0x3d957c(0x1e7)]>0x0)throw CliErrors[_0x3d957c(0x213)](_0x3d957c(0x1ee),'Use\x20`'+CLI_BIN_NAME+_0x3d957c(0x1e8)+_0x5e64f0+_0x3d957c(0x1f5)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.');const _0x5b10c8=buildCanonicalProjectConfig({..._0xa51141},{'appCodes':[_0x5e64f0],'env':typeof _0xa51141['env']===_0x3d957c(0x204)?_0xa51141[_0x3d957c(0x1ef)]:undefined});writeScopedConfig(_0x5b10c8,_0x1909a9);const _0x449df0=_0x1909a9==='global'?_0x3d957c(0x1e9):_0x3d957c(0x1ff);return{'ok':!![],'message':'✓\x20'+_0x449df0+_0x3d957c(0x1e2)+_0x5e64f0+_0x3d957c(0x1e1)};}_0xa51141[_0x4747c5]=_0x5e64f0,writeScopedConfig(_0xa51141,_0x1909a9);const _0x25fde0=_0x1909a9===_0x3d957c(0x205)?_0x3d957c(0x1e9):_0x3d957c(0x1ff);return{'ok':!![],'message':'✓\x20'+_0x25fde0+'\x20'+_0x4747c5+_0x3d957c(0x1f9)+_0x5e64f0};}export const configSetDefinition={'service':a56_0x587ddb(0x1dd),'command':a56_0x587ddb(0x1eb),'description':a56_0x587ddb(0x211),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a56_0x587ddb(0x1f8),'type':'string','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a56_0x587ddb(0x1f7),'type':'string','description':'Config\x20value','required':!![]},{'name':a56_0x587ddb(0x205),'type':a56_0x587ddb(0x20d),'description':a56_0x587ddb(0x1e4),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xecbed7,_0x4d2660){var _0x22f0c2=a57_0xf7e2,_0x3d8847=_0xecbed7();while(!![]){try{var _0x3555c9=parseInt(_0x22f0c2(0x197))/0x1*(parseInt(_0x22f0c2(0x18f))/0x2)+-parseInt(_0x22f0c2(0x194))/0x3+parseInt(_0x22f0c2(0x19c))/0x4+-parseInt(_0x22f0c2(0x191))/0x5*(-parseInt(_0x22f0c2(0x18d))/0x6)+parseInt(_0x22f0c2(0x190))/0x7*(parseInt(_0x22f0c2(0x19a))/0x8)+parseInt(_0x22f0c2(0x196))/0x9*(parseInt(_0x22f0c2(0x199))/0xa)+-parseInt(_0x22f0c2(0x192))/0xb;if(_0x3555c9===_0x4d2660)break;else _0x3d8847['push'](_0x3d8847['shift']());}catch(_0x4ad3d5){_0x3d8847['push'](_0x3d8847['shift']());}}}(a57_0x2284,0x76121));import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';import{CliErrors}from'../../errors.js';function a57_0xf7e2(_0x111a02,_0x29050a){_0x111a02=_0x111a02-0x18d;var _0x228430=a57_0x2284();var _0xf7e22f=_0x228430[_0x111a02];return _0xf7e22f;}import{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';export{CLI_BIN_NAME};export{normalizeLocale};export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x5eb6be){var _0x8d43db=a57_0xf7e2;if(_0x5eb6be[_0x8d43db(0x198)])return _0x8d43db(0x198);if(!isInProject())throw CliErrors[_0x8d43db(0x195)](_0x8d43db(0x18e),'Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`'+CLI_BIN_NAME+_0x8d43db(0x193));return _0x8d43db(0x19b);}function a57_0x2284(){var _0x42ae4d=['3287540yqQHLr','1635594SHgVwY','Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).','4RBUrfU','105mSjJNN','5MFMWxM','24776873foxgbC','\x20workspace\x20init\x20--appcode\x20<code>`\x20first.','1410123KBrujU','validation','162JSRITd','440807YiopRV','global','496110aPvmFz','179736gVWcTl','project'];a57_0x2284=function(){return _0x42ae4d;};return a57_0x2284();}export function readScopedConfig(_0x46ccec){return readConfigFile(resolveWriteConfigPath(_0x46ccec));}export function writeScopedConfig(_0xccc047,_0x2947f6){writeConfigFile(resolveWriteConfigPath(_0x2947f6),_0xccc047);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a59_0x296f38=a59_0x3da9;(function(_0x33b2c6,_0xbf6302){const _0x5730a3=a59_0x3da9,_0x4c84fc=_0x33b2c6();while(!![]){try{const _0x426fe0=parseInt(_0x5730a3(0xb8))/0x1*(-parseInt(_0x5730a3(0x91))/0x2)+-parseInt(_0x5730a3(0x88))/0x3+parseInt(_0x5730a3(0xad))/0x4*(-parseInt(_0x5730a3(0xb3))/0x5)+-parseInt(_0x5730a3(0xb1))/0x6*(-parseInt(_0x5730a3(0x87))/0x7)+parseInt(_0x5730a3(0x8a))/0x8+-parseInt(_0x5730a3(0x86))/0x9+parseInt(_0x5730a3(0xab))/0xa;if(_0x426fe0===_0xbf6302)break;else _0x4c84fc['push'](_0x4c84fc['shift']());}catch(_0x1b2580){_0x4c84fc['push'](_0x4c84fc['shift']());}}}(a59_0x2715,0x83a8d));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const BACKEND_PATH=a59_0x296f38(0xaf);function a59_0x3da9(_0x35b484,_0x6da3a3){_0x35b484=_0x35b484-0x83;const _0x2715b7=a59_0x2715();let _0x3da985=_0x2715b7[_0x35b484];return _0x3da985;}export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x1ea386,input:_0x3c7e8f,dryRun:_0xa49763}){const _0x40bf38=a59_0x296f38;validateInput(_0x3c7e8f);const _0x30be59=normalizeBusinessGroup(_0x3c7e8f['businessGroup']),_0x4b5686=await getDatasetDetail(_0x3c7e8f[_0x40bf38(0x9e)]),_0x49a8bb=resolveBusinessGroupDataset(_0x4b5686,_0x3c7e8f[_0x40bf38(0x9e)]),_0x61bccb=loadCurrentBusinessGroup(_0x4b5686,_0x49a8bb);assertExpectedBusinessGroup(_0x61bccb,_0x3c7e8f[_0x40bf38(0x89)]);const _0x216cbe=buildBackendPayload(_0x1ea386,_0x49a8bb,_0x30be59),_0x4ca0b6=_0x61bccb!==_0x30be59;let _0x14e173;if(_0x4ca0b6&&!_0xa49763){await updateErBusinessGroup(_0x216cbe);const _0x2fd053=await getDatasetDetail(_0x49a8bb['code']),_0x810d19=resolveBusinessGroupDataset(_0x2fd053,_0x49a8bb[_0x40bf38(0x9e)]),_0x44504c=loadCurrentBusinessGroup(_0x2fd053,_0x810d19);if(_0x44504c!==_0x30be59)throw CliErrors[_0x40bf38(0xb2)](_0x40bf38(0x94),_0x40bf38(0x9a)+JSON[_0x40bf38(0xb6)](_0x30be59)+_0x40bf38(0xb4)+JSON[_0x40bf38(0xb6)](_0x44504c)+'.');_0x14e173={'verified':!![],'status':_0x40bf38(0x9c),'afterReadback':{'businessGroup':_0x44504c}};}else!_0x4ca0b6&&(_0x14e173={'verified':!![],'status':_0x40bf38(0x9f),'afterReadback':{'businessGroup':_0x61bccb}});const _0x5d9f33={'operation':'update','appCode':_0x1ea386,'selector':{'code':_0x49a8bb[_0x40bf38(0x9e)]},'dataset':_0x49a8bb,'before':{'businessGroup':_0x61bccb},'after':{'businessGroup':_0x30be59},'changed':_0x4ca0b6,'dryRun':_0xa49763,'submitted':_0x4ca0b6&&!_0xa49763,'backend':{'method':_0x40bf38(0xa6),'path':BACKEND_PATH,'payload':_0x216cbe},..._0x14e173?{'verification':_0x14e173}:{},'warnings':[]};return{'ok':!![],'data':_0x5d9f33,'message':_0x4ca0b6?_0xa49763?_0x40bf38(0xa2)+_0x49a8bb[_0x40bf38(0x9e)]:_0x40bf38(0x96)+_0x49a8bb[_0x40bf38(0x9e)]:_0x40bf38(0xb7)+_0x49a8bb[_0x40bf38(0x9e)]};}export const datasetBusinessGroupUpdate={'service':a59_0x296f38(0x85),'command':'business-group-update','description':a59_0x296f38(0x8d),'risk':a59_0x296f38(0x90),'flags':[CODE_FLAG,{'name':a59_0x296f38(0xb9),'type':a59_0x296f38(0xc0),'required':!![],'description':a59_0x296f38(0x8c)},{'name':'expect-business-group','type':a59_0x296f38(0xc0),'required':![],'description':'Expected\x20current\x20business\x20scenario\x20group;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x45e369){validateInput(readBusinessGroupUpdateInput(_0x45e369));},async 'dryRun'(_0x3af9ee){const _0xd2b1e6=a59_0x296f38,_0x4a5212=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x3af9ee[_0xd2b1e6(0x8b)],'input':readBusinessGroupUpdateInput(_0x3af9ee),'dryRun':!![]});return{'method':_0xd2b1e6(0xa6),'url':BACKEND_PATH,'body':_0x4a5212[_0xd2b1e6(0xbc)][_0xd2b1e6(0xb0)][_0xd2b1e6(0x97)],'description':_0x4a5212['message'],..._0x4a5212[_0xd2b1e6(0xbc)]};},async 'execute'(_0x5c9b99){const _0x2b23bb=a59_0x296f38;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x5c9b99[_0x2b23bb(0x8b)],'input':readBusinessGroupUpdateInput(_0x5c9b99),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x574a73){const _0x3118f9=a59_0x296f38,_0x4bf807=_0x574a73['str'](_0x3118f9(0xa0));return{'code':trim(_0x574a73[_0x3118f9(0xa7)]('code')),'businessGroup':_0x574a73['str'](_0x3118f9(0xb9)),'expectBusinessGroup':_0x4bf807===undefined||_0x4bf807===''?undefined:_0x4bf807};}function validateInput(_0x4a97ce){const _0x7320a2=a59_0x296f38;if(!trim(_0x4a97ce[_0x7320a2(0x9e)]))throw CliErrors[_0x7320a2(0xa5)]('--code\x20is\x20required');if(_0x4a97ce['businessGroup']===undefined)throw CliErrors[_0x7320a2(0xa5)]('--business-group\x20is\x20required');}function resolveBusinessGroupDataset(_0x1bb8d4,_0x1561e1){const _0xec4889=a59_0x296f38,_0x368091=asPlainObject(_0x1bb8d4[_0xec4889(0x85)]),_0x7dd222=asPlainObject(_0x1bb8d4[_0xec4889(0xb5)]),_0xfa3141=resolveSourceType(_0x1bb8d4,_0x368091,_0x7dd222),_0x4befbb=firstString(_0x1bb8d4[_0xec4889(0xbd)],_0x1bb8d4[_0xec4889(0x9e)],_0x368091[_0xec4889(0xa4)],_0x1561e1)||_0x1561e1;return{'id':firstNumber(_0x1bb8d4[_0xec4889(0x9d)],_0x1bb8d4['id'],_0x368091[_0xec4889(0x84)])??firstString(_0x1bb8d4[_0xec4889(0x9d)],_0x1bb8d4['id'],_0x368091[_0xec4889(0x84)])??null,'code':_0x4befbb,'name':firstString(_0x1bb8d4[_0xec4889(0x92)],_0x368091['datasetName'],_0x368091['name'])||null,'sourceType':_0xfa3141};}function resolveSourceType(_0x2f5966,_0x110971,_0x5ddfc2){const _0x391844=a59_0x296f38,_0xff419f=firstString(_0x2f5966[_0x391844(0xba)],_0x2f5966[_0x391844(0x8e)],_0x110971[_0x391844(0xba)],_0x110971[_0x391844(0x8e)])?.[_0x391844(0x99)]()[_0x391844(0xa1)]();if(_0xff419f==='DB_TABLE'||_0xff419f===_0x391844(0xbe))return _0xff419f;if(Object[_0x391844(0x93)](_0x5ddfc2)[_0x391844(0xac)]>0x0)return _0x391844(0xae);throw CliErrors[_0x391844(0xa5)]('Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.');}function loadCurrentBusinessGroup(_0x46f1fe,_0x490fdf){const _0x3ae9ff=a59_0x296f38,_0x3e4f79=readBusinessGroupFromDatasetDetail(_0x46f1fe,_0x490fdf['sourceType']);if(_0x3e4f79[_0x3ae9ff(0xa8)])return normalizeBusinessGroup(_0x3e4f79[_0x3ae9ff(0xa3)]);if(_0x490fdf[_0x3ae9ff(0x8e)]===_0x3ae9ff(0xbe))return'';throw CliErrors[_0x3ae9ff(0xa5)]('Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','Business\x20scenario\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.');}function readBusinessGroupFromDatasetDetail(_0x251c01,_0x356521){const _0x3ca290=a59_0x296f38,_0xcfb668=asPlainObject(_0x251c01[_0x3ca290(0x85)]),_0x4fb367=firstPresent(_0x251c01[_0x3ca290(0x83)]);if(_0x4fb367['found'])return _0x4fb367;const _0x6031f=firstPresent(_0xcfb668[_0x3ca290(0x83)]);if(_0x6031f[_0x3ca290(0xa8)])return _0x6031f;if(_0x356521===_0x3ca290(0xae))return{'found':![]};const _0x30f57e=readBusinessGroupFromExtend(_0x251c01[_0x3ca290(0x8f)]);if(_0x30f57e[_0x3ca290(0xa8)])return _0x30f57e;return readBusinessGroupFromExtend(_0xcfb668[_0x3ca290(0x8f)]);}function readBusinessGroupFromExtend(_0xf0cdfe){const _0x5ec3aa=a59_0x296f38;if(_0xf0cdfe===undefined||_0xf0cdfe===null||_0xf0cdfe==='')return{'found':![]};if(typeof _0xf0cdfe===_0x5ec3aa(0xc0))try{const _0x2c3c0f=JSON[_0x5ec3aa(0xa9)](_0xf0cdfe);return readBusinessGroupFromExtend(_0x2c3c0f);}catch{return{'found':![]};}const _0x131d9a=asPlainObject(_0xf0cdfe);if(Object['prototype'][_0x5ec3aa(0xaa)]['call'](_0x131d9a,_0x5ec3aa(0x83)))return{'found':!![],'value':_0x131d9a[_0x5ec3aa(0x83)]};return{'found':![]};}function firstPresent(..._0x34cbab){for(const _0x35319f of _0x34cbab){if(_0x35319f!==undefined&&_0x35319f!==null)return{'found':!![],'value':_0x35319f};}return{'found':![]};}function assertExpectedBusinessGroup(_0x49a460,_0x27fb9c){const _0x160f37=a59_0x296f38;if(_0x27fb9c===undefined)return;const _0x79746e=normalizeBusinessGroup(_0x27fb9c);if(_0x49a460!==_0x79746e)throw CliErrors[_0x160f37(0xa5)](_0x160f37(0x98),_0x160f37(0x9a)+JSON['stringify'](_0x79746e)+_0x160f37(0xb4)+JSON[_0x160f37(0xb6)](_0x49a460));}function buildBackendPayload(_0x1ed4d0,_0x2d624a,_0xf88ab3){const _0xd19137=a59_0x296f38;return{'appCode':_0x1ed4d0,'datasetCode':_0x2d624a[_0xd19137(0x9e)],'businessGroup':_0xf88ab3};}function normalizeBusinessGroup(_0x587317){const _0x5dd0e7=a59_0x296f38;if(_0x587317===undefined||_0x587317===null)return'';return String(_0x587317)[_0x5dd0e7(0x99)]();}function asPlainObject(_0x849fec){const _0x116c20=a59_0x296f38;if(!_0x849fec||typeof _0x849fec!==_0x116c20(0xbf)||Array[_0x116c20(0x9b)](_0x849fec))return{};return _0x849fec;}function firstString(..._0x51bdd0){const _0x41f083=a59_0x296f38;for(const _0x269cc7 of _0x51bdd0){if(typeof _0x269cc7===_0x41f083(0xc0)&&_0x269cc7['trim']())return _0x269cc7[_0x41f083(0x99)]();if(typeof _0x269cc7==='number'&&Number[_0x41f083(0x95)](_0x269cc7))return String(_0x269cc7);}return undefined;}function firstNumber(..._0x36868d){const _0x425ca5=a59_0x296f38;for(const _0x287bfe of _0x36868d){if(typeof _0x287bfe===_0x425ca5(0xbb)&&Number[_0x425ca5(0x95)](_0x287bfe))return _0x287bfe;if(typeof _0x287bfe==='string'&&_0x287bfe[_0x425ca5(0x99)]()&&Number['isFinite'](Number(_0x287bfe)))return Number(_0x287bfe);}return null;}function a59_0x2715(){const _0x184af8=['/smartapi/question/er-config/business-group/edit','backend','6bDnAex','apiError','1145tVgwKZ',',\x20actual\x20','dbtableConfig','stringify','No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20','437739fOESjQ','business-group','source','number','data','modelCode','METADATA','object','string','businessGroup','datasetId','dataset','5549751ftSqis','6511225jCjFGC','1465095dEQgVB','expectBusinessGroup','5046016BnMtBA','appCode','Business\x20scenario\x20group\x20(not\x20technical):\x20use\x20<scenario>,\x20or\x20<domain>---<scenario>\x20when\x20needed\x20for\x20disambiguation\x20or\x20an\x20existing\x20hierarchy;\x20empty\x20string\x20clears\x20it','Update\x20business\x20scenario\x20group','sourceType','extend','write','2Jydany','name','keys','Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','isFinite','Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20','payload','Expectation\x20mismatch\x20at\x20businessGroup','trim','Expected\x20','isArray','matched','modelId','code','unchanged','expect-business-group','toUpperCase','Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20','value','datasetCode','validation','POST','str','found','parse','hasOwnProperty','13184710hPLGSM','length','13928PZuUNw','DB_TABLE'];a59_0x2715=function(){return _0x184af8;};return a59_0x2715();}function trim(_0x42ee48){const _0x18ea8e=a59_0x296f38;return String(_0x42ee48||'')[_0x18ea8e(0x99)]();}
|
|
1
|
+
const a58_0x3869d0=a58_0x18c0;(function(_0x141fb5,_0x1484f7){const _0x263963=a58_0x18c0,_0x18683c=_0x141fb5();while(!![]){try{const _0x5e1750=parseInt(_0x263963(0xe8))/0x1+-parseInt(_0x263963(0xd5))/0x2*(parseInt(_0x263963(0x101))/0x3)+parseInt(_0x263963(0xd2))/0x4*(-parseInt(_0x263963(0xf1))/0x5)+-parseInt(_0x263963(0xeb))/0x6*(parseInt(_0x263963(0xfc))/0x7)+parseInt(_0x263963(0x111))/0x8*(parseInt(_0x263963(0xf0))/0x9)+parseInt(_0x263963(0x10e))/0xa+parseInt(_0x263963(0xfa))/0xb*(parseInt(_0x263963(0x112))/0xc);if(_0x5e1750===_0x1484f7)break;else _0x18683c['push'](_0x18683c['shift']());}catch(_0x1e9119){_0x18683c['push'](_0x18683c['shift']());}}}(a58_0x2912,0xe6fbb));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const BACKEND_PATH=a58_0x3869d0(0x104),UNGROUPED_BUSINESS_GROUP=a58_0x3869d0(0x100);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x56101d,input:_0x3002cf,dryRun:_0x11805d}){const _0x20b024=a58_0x3869d0;validateInput(_0x3002cf);const _0x208072=normalizeBusinessGroupArgument(_0x3002cf[_0x20b024(0xfe)]),_0x3cdd12=await getDatasetDetail(_0x3002cf[_0x20b024(0xe9)]),_0x5aa5f1=resolveBusinessGroupDataset(_0x3cdd12,_0x3002cf[_0x20b024(0xe9)]),_0x592ab9=loadCurrentBusinessGroup(_0x3cdd12,_0x5aa5f1);assertExpectedBusinessGroup(_0x592ab9,_0x3002cf['expectBusinessGroup']);const _0x44d0c0=buildBackendPayload(_0x56101d,_0x5aa5f1,_0x208072),_0x2629e5=_0x592ab9!==_0x208072;let _0x2e79d4;if(_0x2629e5&&!_0x11805d){await updateErBusinessGroup(_0x44d0c0);const _0x1275c3=await getDatasetDetail(_0x5aa5f1['code']),_0x57454e=resolveBusinessGroupDataset(_0x1275c3,_0x5aa5f1[_0x20b024(0xe9)]),_0xee8069=loadCurrentBusinessGroup(_0x1275c3,_0x57454e);if(_0xee8069!==_0x208072)throw CliErrors[_0x20b024(0x10c)](_0x20b024(0xd3),_0x20b024(0xed)+JSON[_0x20b024(0xe2)](_0x208072)+_0x20b024(0xec)+JSON[_0x20b024(0xe2)](_0xee8069)+'.');_0x2e79d4={'verified':!![],'status':_0x20b024(0x10b),'afterReadback':{'businessGroup':_0xee8069}};}else!_0x2629e5&&(_0x2e79d4={'verified':!![],'status':_0x20b024(0xf5),'afterReadback':{'businessGroup':_0x592ab9}});const _0x4b754a={'operation':_0x20b024(0xf7),'appCode':_0x56101d,'selector':{'code':_0x5aa5f1[_0x20b024(0xe9)]},'dataset':_0x5aa5f1,'before':{'businessGroup':_0x592ab9},'after':{'businessGroup':_0x208072},'changed':_0x2629e5,'dryRun':_0x11805d,'submitted':_0x2629e5&&!_0x11805d,'backend':{'method':_0x20b024(0x106),'path':BACKEND_PATH,'payload':_0x44d0c0},..._0x2e79d4?{'verification':_0x2e79d4}:{},'warnings':[]};return{'ok':!![],'data':_0x4b754a,'message':_0x2629e5?_0x11805d?'Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20'+_0x5aa5f1[_0x20b024(0xe9)]:_0x20b024(0xe5)+_0x5aa5f1[_0x20b024(0xe9)]:_0x20b024(0x107)+_0x5aa5f1[_0x20b024(0xe9)]};}function a58_0x18c0(_0x274109,_0x2c4970){_0x274109=_0x274109-0xd1;const _0x29121b=a58_0x2912();let _0x18c0db=_0x29121b[_0x274109];return _0x18c0db;}function a58_0x2912(){const _0x553b41=['Expected\x20','object','name','225LblIuq','5YbjmxA','METADATA','isArray','number','unchanged','source','update','modelCode','value','55BrkzTP','payload','1638zbfCxw','business-group','businessGroup','toUpperCase','ungrouped','35202hKIPAD','isFinite','found','/smartapi/question/er-config/business-group/edit','write','POST','No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20','data','Business\x20scenario\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.','string','matched','apiError','DB_TABLE','10143630CkbEky','Expectation\x20mismatch\x20at\x20businessGroup','--business-group\x20is\x20required','555344PEhhRe','107460PvNrwl','hasOwnProperty','prototype','884436fLrkNb','Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','datasetCode','314WYfauv','modelId','parse','keys','sourceType','str','Update\x20business\x20scenario\x20group','Expected\x20current\x20business\x20scenario\x20group;\x20use\x20ungrouped\x20to\x20expect\x20no\x20group;\x20mismatch\x20aborts\x20without\x20writing','extend','dataset','datasetId','trim','call','stringify','dbtableConfig','validation','Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20','business-group-update','appCode','1488762ebhNzO','code','expect-business-group','32664kxTdAq',',\x20actual\x20'];a58_0x2912=function(){return _0x553b41;};return a58_0x2912();}export const datasetBusinessGroupUpdate={'service':a58_0x3869d0(0xde),'command':a58_0x3869d0(0xe6),'description':a58_0x3869d0(0xdb),'risk':a58_0x3869d0(0x105),'flags':[CODE_FLAG,{'name':a58_0x3869d0(0xfd),'type':a58_0x3869d0(0x10a),'required':!![],'description':'Business\x20scenario\x20group\x20(not\x20technical):\x20use\x20<scenario>,\x20<domain>---<scenario>\x20when\x20needed,\x20or\x20the\x20reserved\x20value\x20ungrouped\x20to\x20clear\x20it'},{'name':a58_0x3869d0(0xea),'type':a58_0x3869d0(0x10a),'required':![],'description':a58_0x3869d0(0xdc)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2de244){validateInput(readBusinessGroupUpdateInput(_0x2de244));},async 'dryRun'(_0x25b837){const _0x999879=a58_0x3869d0,_0x4ffad4=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x25b837[_0x999879(0xe7)],'input':readBusinessGroupUpdateInput(_0x25b837),'dryRun':!![]});return{'method':_0x999879(0x106),'url':BACKEND_PATH,'body':_0x4ffad4[_0x999879(0x108)]['backend'][_0x999879(0xfb)],'description':_0x4ffad4['message'],..._0x4ffad4[_0x999879(0x108)]};},async 'execute'(_0x472c7b){const _0x10565e=a58_0x3869d0;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x472c7b[_0x10565e(0xe7)],'input':readBusinessGroupUpdateInput(_0x472c7b),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x37ad4d){const _0x52a188=a58_0x3869d0,_0x57f528=_0x37ad4d[_0x52a188(0xda)](_0x52a188(0xea));return{'code':trim(_0x37ad4d[_0x52a188(0xda)](_0x52a188(0xe9))),'businessGroup':_0x37ad4d[_0x52a188(0xda)]('business-group'),'expectBusinessGroup':_0x57f528===undefined||_0x57f528===''?undefined:_0x57f528};}function validateInput(_0x5eea59){const _0x10dcb2=a58_0x3869d0;if(!trim(_0x5eea59[_0x10dcb2(0xe9)]))throw CliErrors[_0x10dcb2(0xe4)]('--code\x20is\x20required');if(_0x5eea59[_0x10dcb2(0xfe)]===undefined)throw CliErrors[_0x10dcb2(0xe4)](_0x10dcb2(0x110));}function resolveBusinessGroupDataset(_0x1e6983,_0x4df32a){const _0x2a3dd7=a58_0x3869d0,_0x512bab=asPlainObject(_0x1e6983[_0x2a3dd7(0xde)]),_0x4e6be7=asPlainObject(_0x1e6983[_0x2a3dd7(0xe3)]),_0x114666=resolveSourceType(_0x1e6983,_0x512bab,_0x4e6be7),_0x11972d=firstString(_0x1e6983[_0x2a3dd7(0xf8)],_0x1e6983['code'],_0x512bab[_0x2a3dd7(0xd4)],_0x4df32a)||_0x4df32a;return{'id':firstNumber(_0x1e6983[_0x2a3dd7(0xd6)],_0x1e6983['id'],_0x512bab['datasetId'])??firstString(_0x1e6983[_0x2a3dd7(0xd6)],_0x1e6983['id'],_0x512bab[_0x2a3dd7(0xdf)])??null,'code':_0x11972d,'name':firstString(_0x1e6983[_0x2a3dd7(0xef)],_0x512bab['datasetName'],_0x512bab[_0x2a3dd7(0xef)])||null,'sourceType':_0x114666};}function resolveSourceType(_0x9ee2ad,_0x2df7b6,_0x344611){const _0x4e2e2b=a58_0x3869d0,_0x15567b=firstString(_0x9ee2ad[_0x4e2e2b(0xf6)],_0x9ee2ad[_0x4e2e2b(0xd9)],_0x2df7b6[_0x4e2e2b(0xf6)],_0x2df7b6[_0x4e2e2b(0xd9)])?.[_0x4e2e2b(0xe0)]()[_0x4e2e2b(0xff)]();if(_0x15567b===_0x4e2e2b(0x10d)||_0x15567b===_0x4e2e2b(0xf2))return _0x15567b;if(Object[_0x4e2e2b(0xd8)](_0x344611)['length']>0x0)return _0x4e2e2b(0x10d);throw CliErrors[_0x4e2e2b(0xe4)]('Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.');}function loadCurrentBusinessGroup(_0x165c63,_0x43d3f9){const _0xc580de=a58_0x3869d0,_0x1bc62c=readBusinessGroupFromDatasetDetail(_0x165c63,_0x43d3f9['sourceType']);if(_0x1bc62c[_0xc580de(0x103)])return normalizeBusinessGroup(_0x1bc62c[_0xc580de(0xf9)]);if(_0x43d3f9[_0xc580de(0xd9)]===_0xc580de(0xf2))return'';throw CliErrors[_0xc580de(0xe4)]('Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.',_0xc580de(0x109));}function readBusinessGroupFromDatasetDetail(_0x1525bf,_0x25863f){const _0x4ba143=a58_0x3869d0,_0x5dc64e=asPlainObject(_0x1525bf[_0x4ba143(0xde)]),_0x50f19d=firstPresent(_0x1525bf[_0x4ba143(0xfe)]);if(_0x50f19d[_0x4ba143(0x103)])return _0x50f19d;const _0x44c76c=firstPresent(_0x5dc64e[_0x4ba143(0xfe)]);if(_0x44c76c[_0x4ba143(0x103)])return _0x44c76c;if(_0x25863f==='DB_TABLE')return{'found':![]};const _0x3ca0a7=readBusinessGroupFromExtend(_0x1525bf[_0x4ba143(0xdd)]);if(_0x3ca0a7[_0x4ba143(0x103)])return _0x3ca0a7;return readBusinessGroupFromExtend(_0x5dc64e[_0x4ba143(0xdd)]);}function readBusinessGroupFromExtend(_0x3b5c72){const _0x30e727=a58_0x3869d0;if(_0x3b5c72===undefined||_0x3b5c72===null||_0x3b5c72==='')return{'found':![]};if(typeof _0x3b5c72===_0x30e727(0x10a))try{const _0x473e9b=JSON[_0x30e727(0xd7)](_0x3b5c72);return readBusinessGroupFromExtend(_0x473e9b);}catch{return{'found':![]};}const _0x21e440=asPlainObject(_0x3b5c72);if(Object[_0x30e727(0xd1)][_0x30e727(0x113)][_0x30e727(0xe1)](_0x21e440,'businessGroup'))return{'found':!![],'value':_0x21e440[_0x30e727(0xfe)]};return{'found':![]};}function firstPresent(..._0x4cdbf0){for(const _0x5283b6 of _0x4cdbf0){if(_0x5283b6!==undefined&&_0x5283b6!==null)return{'found':!![],'value':_0x5283b6};}return{'found':![]};}function assertExpectedBusinessGroup(_0x4be981,_0x21a46b){const _0x3b7a2b=a58_0x3869d0;if(_0x21a46b===undefined)return;const _0x4aae78=normalizeBusinessGroupArgument(_0x21a46b);if(_0x4be981!==_0x4aae78)throw CliErrors['validation'](_0x3b7a2b(0x10f),_0x3b7a2b(0xed)+JSON[_0x3b7a2b(0xe2)](_0x4aae78)+',\x20actual\x20'+JSON[_0x3b7a2b(0xe2)](_0x4be981));}function buildBackendPayload(_0x3ff228,_0xa401af,_0x5d81f6){const _0x4b8f8d=a58_0x3869d0;return{'appCode':_0x3ff228,'datasetCode':_0xa401af[_0x4b8f8d(0xe9)],'businessGroup':_0x5d81f6};}function normalizeBusinessGroup(_0x4f8df5){const _0x312184=a58_0x3869d0;if(_0x4f8df5===undefined||_0x4f8df5===null)return'';return String(_0x4f8df5)[_0x312184(0xe0)]();}function normalizeBusinessGroupArgument(_0x57da04){const _0x4c9ffd=normalizeBusinessGroup(_0x57da04);return _0x4c9ffd===UNGROUPED_BUSINESS_GROUP?'':_0x4c9ffd;}function asPlainObject(_0x15c77b){const _0x5be935=a58_0x3869d0;if(!_0x15c77b||typeof _0x15c77b!==_0x5be935(0xee)||Array[_0x5be935(0xf3)](_0x15c77b))return{};return _0x15c77b;}function firstString(..._0x561b2f){const _0x155ad0=a58_0x3869d0;for(const _0x5378de of _0x561b2f){if(typeof _0x5378de===_0x155ad0(0x10a)&&_0x5378de[_0x155ad0(0xe0)]())return _0x5378de[_0x155ad0(0xe0)]();if(typeof _0x5378de===_0x155ad0(0xf4)&&Number[_0x155ad0(0x102)](_0x5378de))return String(_0x5378de);}return undefined;}function firstNumber(..._0x4ce719){const _0x1568f8=a58_0x3869d0;for(const _0x2e0595 of _0x4ce719){if(typeof _0x2e0595===_0x1568f8(0xf4)&&Number['isFinite'](_0x2e0595))return _0x2e0595;if(typeof _0x2e0595===_0x1568f8(0x10a)&&_0x2e0595['trim']()&&Number[_0x1568f8(0x102)](Number(_0x2e0595)))return Number(_0x2e0595);}return null;}function trim(_0x470d96){const _0x4d3037=a58_0x3869d0;return String(_0x470d96||'')[_0x4d3037(0xe0)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a59_0x1a6fbf=a59_0x425c;(function(_0x1afee6,_0x35c986){const _0x17e777=a59_0x425c,_0x2d5383=_0x1afee6();while(!![]){try{const _0x5dcd79=parseInt(_0x17e777(0x9a))/0x1+-parseInt(_0x17e777(0x9c))/0x2+-parseInt(_0x17e777(0x98))/0x3*(parseInt(_0x17e777(0xa0))/0x4)+-parseInt(_0x17e777(0x99))/0x5+-parseInt(_0x17e777(0x9b))/0x6+-parseInt(_0x17e777(0x9e))/0x7+parseInt(_0x17e777(0x9d))/0x8;if(_0x5dcd79===_0x35c986)break;else _0x2d5383['push'](_0x2d5383['shift']());}catch(_0xc2f0d5){_0x2d5383['push'](_0x2d5383['shift']());}}}(a59_0x18fa,0x4242a));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a59_0x425c(_0x378937,_0x30ca5e){_0x378937=_0x378937-0x96;const _0x18fa70=a59_0x18fa();let _0x425c02=_0x18fa70[_0x378937];return _0x425c02;}import{getErBusinessGroupSummary}from'../../core/api-client.js';function a59_0x18fa(){const _0x3e7eb7=['1567197CFzVdm','596220ISUbax','37785TzUYuH','2514582htcevo','471910GYHFsX','12324480ftgLcQ','71736CfvwuF','number','4gXpThW','num','dataset','DB_TABLE','appCode','read','groups','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)'];a59_0x18fa=function(){return _0x3e7eb7;};return a59_0x18fa();}export const datasetBusinessGroups={'service':a59_0x1a6fbf(0xa2),'command':'business-groups','description':'List\x20DB_TABLE\x20dataset\x20business\x20groups\x20for\x20a\x20database\x20connection;\x20does\x20not\x20include\x20METADATA','risk':a59_0x1a6fbf(0xa5),'flags':[{'name':'dbid','type':a59_0x1a6fbf(0x9f),'required':!![],'description':a59_0x1a6fbf(0x97)},APPCODE_FLAG_OPTIONAL],async 'execute'(_0x50a5ee){const _0x316095=a59_0x1a6fbf,_0x4b5cea=_0x50a5ee[_0x316095(0xa1)]('dbid'),_0x60ab65=await getErBusinessGroupSummary(_0x50a5ee[_0x316095(0xa4)],_0x4b5cea);return{'ok':!![],'data':{..._0x60ab65,'scope':_0x316095(0xa3)},'message':'Found\x20'+_0x60ab65[_0x316095(0x96)]['length']+'\x20business\x20group(s)\x20for\x20database\x20connection\x20'+_0x4b5cea};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0x5e8036=a60_0x3e6e;(function(_0x51440a,_0x260ab3){const _0x3b3711=a60_0x3e6e,_0x43c5d6=_0x51440a();while(!![]){try{const _0x32e1f8=-parseInt(_0x3b3711(0x11b))/0x1+parseInt(_0x3b3711(0x121))/0x2+-parseInt(_0x3b3711(0x10e))/0x3+parseInt(_0x3b3711(0x122))/0x4+parseInt(_0x3b3711(0x110))/0x5*(-parseInt(_0x3b3711(0x118))/0x6)+-parseInt(_0x3b3711(0x113))/0x7+-parseInt(_0x3b3711(0x109))/0x8*(-parseInt(_0x3b3711(0x117))/0x9);if(_0x32e1f8===_0x260ab3)break;else _0x43c5d6['push'](_0x43c5d6['shift']());}catch(_0x14cf5c){_0x43c5d6['push'](_0x43c5d6['shift']());}}}(a60_0x53a3,0x7335f));import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a60_0x5e8036(0x126),'filter':a60_0x5e8036(0x112),'getOne':a60_0x5e8036(0x111)};export const RUNTIME_DATA_ACCESS_SUMMARY='Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.';function a60_0x53a3(){const _0x1e6ad4=['The\x20current\x20dataset\x20\x22','dbId','809452RWyWKn','171364IPuuNi','tableName','code','Upgrade\x20or\x20migrate\x20this\x20dataset\x20to\x20a\x20DB_TABLE\x20dataset,\x20then\x20continue\x20with\x20the\x20new\x20dataset\x20code.','lovrabet','modelCode','filter','UNKNOWN','96hMgVtS','getOne','To\x20inspect\x20real\x20runtime\x20rows,\x20switch\x20to\x20lovrabet\x20CLI:\x20','\x20and\x20has\x20no\x20DB_TABLE\x20data-source\x20context\x20for\x20','name','1970160bxDyzL','unknown','5MtFOmh','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','366702cwVvMg','dbtable','object','join','1030770XMhNKh','1064094qzcBuO','datasetName','\x20is\x20','463569YlDhdG','Reason:\x20schema\x20introspection\x20and\x20custom\x20SQL\x20require\x20source=DB_TABLE,\x20dbtableConfig.dbId,\x20dbtableConfig.tableName,\x20and\x20a\x20database\x20connection\x20context.','toUpperCase','dataset'];a60_0x53a3=function(){return _0x1e6ad4;};return a60_0x53a3();}function valueToString(_0x36d416){return _0x36d416==null?'':String(_0x36d416)['trim']();}function getDatasetCode(_0x1dbc2a){const _0x47ed8c=a60_0x5e8036;return valueToString(_0x1dbc2a[_0x47ed8c(0x124)]??_0x1dbc2a[_0x47ed8c(0x127)]??_0x1dbc2a[_0x47ed8c(0x11e)]?.['datasetCode']);}function getDatasetName(_0x5219ca){const _0x495985=a60_0x5e8036;return valueToString(_0x5219ca[_0x495985(0x10d)]??_0x5219ca['dataset']?.[_0x495985(0x119)])||_0x495985(0x10f);}function getDatasetSource(_0x1a9f29){const _0x4e794e=a60_0x5e8036;return valueToString(_0x1a9f29['source']??_0x1a9f29[_0x4e794e(0x11e)]?.['sourceType'])[_0x4e794e(0x11d)]();}function getDbtableConfig(_0x22bae0){const _0x3c1f19=a60_0x5e8036,_0x5c6ef7=_0x22bae0['dbtableConfig']??_0x22bae0[_0x3c1f19(0x114)];return _0x5c6ef7&&typeof _0x5c6ef7===_0x3c1f19(0x115)?_0x5c6ef7:{};}export function isDbTableBackedDataset(_0x266b44){const _0x65b804=a60_0x5e8036,_0x3d3466=getDatasetSource(_0x266b44);if(_0x3d3466==='METADATA')return![];const _0x3c8478=getDbtableConfig(_0x266b44),_0x671ca2=_0x3c8478[_0x65b804(0x120)]??_0x3c8478['id'],_0x122f2b=valueToString(_0x3c8478[_0x65b804(0x123)]??_0x266b44[_0x65b804(0x123)]??_0x266b44[_0x65b804(0x11e)]?.['tableName']);return _0x671ca2!==undefined&&_0x671ca2!==null&&_0x122f2b['length']>0x0;}export function filterDbTableBackedDatasets(_0x52c35e){const _0x66376b=a60_0x5e8036;return _0x52c35e[_0x66376b(0x128)](_0x15bed2=>isDbTableBackedDataset(_0x15bed2));}export function buildDbTableBackedRequirementMessage(_0x168b0b,_0x17b7a5='SQL\x20schema\x20validation'){const _0xe9cdac=a60_0x5e8036,_0x14774c=getDatasetSource(_0x168b0b)||_0xe9cdac(0x129),_0x2f90d3=getDatasetName(_0x168b0b),_0x27267f=getDatasetCode(_0x168b0b),_0x11527c=_0x27267f?'\x20('+_0x27267f+')':'';return[_0xe9cdac(0x11f)+_0x2f90d3+'\x22'+_0x11527c+_0xe9cdac(0x11a)+_0x14774c+_0xe9cdac(0x10c)+_0x17b7a5+'.',_0xe9cdac(0x11c),_0xe9cdac(0x125),_0xe9cdac(0x10b)+RUNTIME_DATA_ACCESS_COMMANDS['filter']+';\x20'+RUNTIME_DATA_ACCESS_COMMANDS[_0xe9cdac(0x10a)]+'.'][_0xe9cdac(0x116)]('\x20');}function a60_0x3e6e(_0x304faf,_0x443be7){_0x304faf=_0x304faf-0x109;const _0x53a370=a60_0x53a3();let _0x3e6e62=_0x53a370[_0x304faf];return _0x3e6e62;}export function assertDatasetIsDbTableBacked(_0x3eddc8,_0x30edef){if(!isDbTableBackedDataset(_0x3eddc8))throw CliErrors['validation'](buildDbTableBackedRequirementMessage(_0x3eddc8,_0x30edef));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x35baa3=a61_0x3b7d;(function(_0x55b652,_0x63c57a){const _0x595843=a61_0x3b7d,_0x443364=_0x55b652();while(!![]){try{const _0xc4b6c9=parseInt(_0x595843(0x1c5))/0x1+parseInt(_0x595843(0x1da))/0x2*(-parseInt(_0x595843(0x1f7))/0x3)+-parseInt(_0x595843(0x1ce))/0x4+parseInt(_0x595843(0x1e6))/0x5*(parseInt(_0x595843(0x1cc))/0x6)+-parseInt(_0x595843(0x1f9))/0x7+-parseInt(_0x595843(0x1df))/0x8*(parseInt(_0x595843(0x1bf))/0x9)+parseInt(_0x595843(0x1de))/0xa*(parseInt(_0x595843(0x1e5))/0xb);if(_0xc4b6c9===_0x63c57a)break;else _0x443364['push'](_0x443364['shift']());}catch(_0x4abb9b){_0x443364['push'](_0x443364['shift']());}}}(a61_0x4132,0x8a744));import{deleteDataset,getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a61_0x3b7d(_0x488543,_0x510fac){_0x488543=_0x488543-0x1bc;const _0x413298=a61_0x4132();let _0x3b7dca=_0x413298[_0x488543];return _0x3b7dca;}const DATASET_ID_FLAG={'name':'id','type':a61_0x35baa3(0x1e8),'description':a61_0x35baa3(0x1e2)},DBID_FLAG={'name':a61_0x35baa3(0x1eb),'type':a61_0x35baa3(0x1e8),'description':a61_0x35baa3(0x1f1)},CONFIRM_FLAG={'name':'confirm','type':a61_0x35baa3(0x1f3),'description':a61_0x35baa3(0x1d0)},CASCADE_FLAG={'name':a61_0x35baa3(0x1d6),'type':a61_0x35baa3(0x1f3),'description':'Also\x20delete\x20related\x20pages\x20and\x20menus;\x20requires\x20explicit\x20--confirm'},EXPECTED_COUNT_FLAG={'name':a61_0x35baa3(0x1d2),'type':a61_0x35baa3(0x1e8),'description':a61_0x35baa3(0x1ee)};function a61_0x4132(){const _0x4ecfb5=['name','Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id','map','boolean','dbtableConfig','One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.','num','2946GLjwXf','relatedPageInfoList','475545upoqff','\x20dataset(s)\x20and\x20their\x20listed\x20related\x20pages/menus.\x20Restore\x20each\x20Dataset\x20first,\x20then\x20restore\x20pages\x20explicitly\x20when\x20needed.','relatedPages','\x20--appcode\x20','\x20dataset(s)','POST','\x20dataset(s),\x20but\x20--expected-count\x20is\x20','111546JFqtSL','filter','Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id','No\x20undeleted\x20dataset\x20found\x20for\x20','Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.','--confirm\x20is\x20required\x20to\x20delete\x20datasets.','761938FIDCmo','Matched\x20','push','title','id=','object','deleted','6VCUyQA','appCode','944544QhMSFp','length','Required\x20to\x20execute\x20dataset\x20deletion','/smartapi/dataset/delete?cascade=','expected-count','Would\x20delete\x20','code','true','cascade','rabetbase\x20page\x20restore\x20--id\x20','Would\x20safely\x20delete\x20','delete','1412xCIiTT','str','false','bool','20HbFFef','184hiMZrL','high-risk-write','validation','Dataset\x20id','type','isArray','4443274LfBTdV','1398635xUfpHC','isInteger','number','confirm','dbId','dbid','dbName','\x20dataset(s);\x20','Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value','message'];a61_0x4132=function(){return _0x4ecfb5;};return a61_0x4132();}export const datasetDelete={'service':'dataset','command':a61_0x35baa3(0x1d9),'description':a61_0x35baa3(0x1c1),'risk':a61_0x35baa3(0x1e0),'flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CASCADE_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4d9558){const _0x2af62f=a61_0x35baa3,_0x5a3d5d=_0x4d9558['num']('id'),_0x1c290c=_0x4d9558[_0x2af62f(0x1db)](_0x2af62f(0x1d4)),_0x3b3fd2=_0x4d9558['num'](_0x2af62f(0x1eb)),_0x49f638=[_0x5a3d5d>0x0,Boolean(_0x1c290c),_0x3b3fd2>0x0][_0x2af62f(0x1c0)](Boolean);if(_0x49f638['length']===0x0)throw CliErrors[_0x2af62f(0x1e1)](_0x2af62f(0x1f5));if(_0x49f638[_0x2af62f(0x1cf)]>0x1)throw CliErrors['validation'](_0x2af62f(0x1c3));},async 'dryRun'(_0x503a56){const _0x4bb397=a61_0x35baa3,_0xb30905=await resolveTargets(_0x503a56),_0x7887e6=_0x503a56[_0x4bb397(0x1dd)](_0x4bb397(0x1d6));return{'method':_0x4bb397(0x1bd),'url':_0x4bb397(0x1d1)+(_0x7887e6?_0x4bb397(0x1d5):_0x4bb397(0x1dc)),'body':{'count':_0xb30905[_0x4bb397(0x1cf)],'cascade':_0x7887e6,'datasets':_0xb30905},'description':_0x7887e6?_0x4bb397(0x1d3)+_0xb30905[_0x4bb397(0x1cf)]+_0x4bb397(0x1fa):_0x4bb397(0x1d8)+_0xb30905[_0x4bb397(0x1cf)]+'\x20dataset(s)\x20without\x20cascading\x20to\x20pages.\x20The\x20server\x20blocks\x20a\x20Dataset\x20that\x20still\x20has\x20related\x20pages.'};},async 'execute'(_0x3de8e8){const _0x421881=a61_0x35baa3;if(!_0x3de8e8[_0x421881(0x1dd)](_0x421881(0x1e9)))throw CliErrors[_0x421881(0x1e1)](_0x421881(0x1c4),'Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.');const _0x826393=await resolveTargets(_0x3de8e8),_0x9990c5=_0x3de8e8[_0x421881(0x1dd)](_0x421881(0x1d6)),_0x4619db=[],_0xf24257=[];for(const _0x5f420b of _0x826393){try{await deleteDataset(_0x5f420b['id'],_0x9990c5),_0x4619db[_0x421881(0x1c7)](_0x5f420b);}catch(_0x1bf3ef){_0xf24257[_0x421881(0x1c7)]({..._0x5f420b,'error':_0x1bf3ef instanceof Error?_0x1bf3ef[_0x421881(0x1ef)]:String(_0x1bf3ef)});}}if(_0xf24257['length']>0x0){const _0x1c5e5a=buildPageRestoreCommands(_0x3de8e8[_0x421881(0x1cd)],_0x9990c5?_0x4619db:[]);return{'ok':![],'data':{'requested':_0x826393[_0x421881(0x1cf)],'cascade':_0x9990c5,'deletedCount':_0x4619db['length'],'failedCount':_0xf24257[_0x421881(0x1cf)],'deleted':_0x4619db,'failed':_0xf24257,'pageRestoreCommands':_0x1c5e5a},'message':'Deleted\x20'+_0x4619db[_0x421881(0x1cf)]+'/'+_0x826393[_0x421881(0x1cf)]+_0x421881(0x1ed)+_0xf24257[_0x421881(0x1cf)]+'\x20failed'};}return{'ok':!![],'data':{'requested':_0x826393[_0x421881(0x1cf)],'cascade':_0x9990c5,'deletedCount':_0x4619db[_0x421881(0x1cf)],'deleted':_0x4619db,'pageRestoreCommands':buildPageRestoreCommands(_0x3de8e8[_0x421881(0x1cd)],_0x9990c5?_0x4619db:[])},'message':'Deleted\x20'+_0x4619db[_0x421881(0x1cf)]+_0x421881(0x1bc)};}};async function resolveTargets(_0xdf3894){const _0x290e72=a61_0x35baa3,_0x1c6277=_0xdf3894['num']('id'),_0xf0713=_0xdf3894[_0x290e72(0x1db)](_0x290e72(0x1d4)),_0x158c08=_0xdf3894[_0x290e72(0x1f6)](_0x290e72(0x1eb));let _0x33fd6c;_0xf0713?(_0x33fd6c=await listDatasets(_0xdf3894[_0x290e72(0x1cd)],{'code':_0xf0713}),_0x33fd6c=_0x33fd6c[_0x290e72(0x1c0)](_0x5bdf3c=>_0x5bdf3c[_0x290e72(0x1d4)]===_0xf0713)):(_0x33fd6c=await listDatasets(_0xdf3894['appCode']),_0x1c6277>0x0&&(_0x33fd6c=_0x33fd6c[_0x290e72(0x1c0)](_0xd6b733=>_0xd6b733['id']===_0x1c6277)),_0x158c08>0x0&&(_0x33fd6c=_0x33fd6c['filter'](_0x588c40=>_0x588c40[_0x290e72(0x1f4)]?.[_0x290e72(0x1ea)]===_0x158c08)));const _0x534de4=[];for(const _0x43c3bd of _0x33fd6c){const _0x38494=await getDatasetDetail(_0x43c3bd[_0x290e72(0x1d4)]),_0x196220=Array[_0x290e72(0x1e4)](_0x38494[_0x290e72(0x1f8)])?_0x38494[_0x290e72(0x1f8)]['filter'](_0x13035a=>_0x13035a!=null&&typeof _0x13035a===_0x290e72(0x1ca)&&_0x13035a[_0x290e72(0x1cb)]!==!![]):[];_0x534de4['push'](normalizeTarget(_0x43c3bd,_0x196220));}if(_0x534de4[_0x290e72(0x1cf)]===0x0){const _0x592f1e=_0xf0713||(_0x1c6277>0x0?_0x290e72(0x1c9)+_0x1c6277:'dbid='+_0x158c08);throw CliErrors[_0x290e72(0x1e1)](_0x290e72(0x1c2)+_0x592f1e+'.');}const _0x715c47=_0xdf3894[_0x290e72(0x1f6)](_0x290e72(0x1d2));if(_0x715c47>0x0&&_0x534de4[_0x290e72(0x1cf)]!==_0x715c47)throw CliErrors['validation'](_0x290e72(0x1c6)+_0x534de4[_0x290e72(0x1cf)]+_0x290e72(0x1be)+_0x715c47+'.');return _0x534de4;}function normalizeTarget(_0xdb086a,_0x334973){const _0x2b7d57=a61_0x35baa3,_0x460702=_0xdb086a[_0x2b7d57(0x1f4)]??{},_0x49b89b=_0x334973[_0x2b7d57(0x1f2)](_0x58ed57=>{const _0x4a9f1e=_0x2b7d57;if(_0x58ed57==null||typeof _0x58ed57!==_0x4a9f1e(0x1ca))return null;const _0x53e0e5=_0x58ed57,_0x1b3f1b=Number(_0x53e0e5['id']);if(!Number[_0x4a9f1e(0x1e7)](_0x1b3f1b)||_0x1b3f1b<=0x0)return null;const _0x588eaa=_0x53e0e5[_0x4a9f1e(0x1c8)]??_0x53e0e5[_0x4a9f1e(0x1f0)];return{'id':_0x1b3f1b,..._0x588eaa?{'name':String(_0x588eaa)}:{},..._0x53e0e5[_0x4a9f1e(0x1e3)]?{'type':String(_0x53e0e5[_0x4a9f1e(0x1e3)])}:{}};})[_0x2b7d57(0x1c0)](_0x22a75d=>_0x22a75d!==null);return{'id':_0xdb086a['id'],'code':_0xdb086a[_0x2b7d57(0x1d4)],'name':_0xdb086a[_0x2b7d57(0x1f0)],'description':_0xdb086a['description'],'source':_0xdb086a['source'],'dbId':_0x460702[_0x2b7d57(0x1ea)],'dbName':_0x460702[_0x2b7d57(0x1ec)],'tableName':_0x460702['tableName'],'relatedPageCount':_0x49b89b[_0x2b7d57(0x1cf)],'relatedPages':_0x49b89b};}function buildPageRestoreCommands(_0x39df1f,_0x487b54){const _0x545cd9=a61_0x35baa3,_0x4abe54=new Set();for(const _0x3e644a of _0x487b54){for(const _0x1b949b of _0x3e644a[_0x545cd9(0x1fb)])_0x4abe54['add'](_0x1b949b['id']);}return[..._0x4abe54][_0x545cd9(0x1f2)](_0x57a5b3=>_0x545cd9(0x1d7)+_0x57a5b3+_0x545cd9(0x1fc)+_0x39df1f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a62_0x139fa0=a62_0x2a9c;(function(_0x349831,_0x40074c){const _0x1c643d=a62_0x2a9c,_0x4a1ab4=_0x349831();while(!![]){try{const _0x199595=-parseInt(_0x1c643d(0x10b))/0x1*(-parseInt(_0x1c643d(0xeb))/0x2)+parseInt(_0x1c643d(0xfe))/0x3*(parseInt(_0x1c643d(0x11c))/0x4)+-parseInt(_0x1c643d(0xe9))/0x5+parseInt(_0x1c643d(0xfb))/0x6*(parseInt(_0x1c643d(0x11d))/0x7)+-parseInt(_0x1c643d(0x108))/0x8*(parseInt(_0x1c643d(0x119))/0x9)+parseInt(_0x1c643d(0x116))/0xa+parseInt(_0x1c643d(0xe1))/0xb;if(_0x199595===_0x40074c)break;else _0x4a1ab4['push'](_0x4a1ab4['shift']());}catch(_0x3dea8d){_0x4a1ab4['push'](_0x4a1ab4['shift']());}}}(a62_0x1ef9,0xb5e22));import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function normalizeField(_0x313827){const _0x2f7419=a62_0x2a9c;if(_0x313827['deleted'])return null;const _0xb3046e=Boolean(_0x313827[_0x2f7419(0xf0)]!==undefined||_0x313827['doType']!==undefined);let _0x1e6643={};if(!_0xb3046e&&typeof _0x313827[_0x2f7419(0x126)]===_0x2f7419(0xe3))try{_0x1e6643=JSON[_0x2f7419(0x11e)](_0x313827[_0x2f7419(0x126)]);}catch{}const _0x4f9629=_0xb3046e?_0x313827[_0x2f7419(0xf6)]:_0x313827[_0x2f7419(0x120)],_0x1441ae=_0xb3046e?_0x313827[_0x2f7419(0xf0)]:_0x313827[_0x2f7419(0xf6)],_0xee5543=_0xb3046e?_0x313827[_0x2f7419(0xe2)]:_0x313827[_0x2f7419(0xf9)]||_0x313827['dataType'],_0x2a4672=_0xb3046e?_0x313827[_0x2f7419(0xdb)]===!![]:_0x1e6643[_0x2f7419(0xdb)]===!![],_0x20193c=_0xb3046e?_0x313827[_0x2f7419(0x11a)]===!![]:_0x1e6643[_0x2f7419(0x11a)]===!![],_0x343673=_0xb3046e?_0x313827['options']??null:_0x1e6643['options']??null,_0x2435d5={'name':_0x4f9629,'displayName':_0x1441ae||_0x4f9629,'type':_0xee5543,'dbType':_0x313827['dbType'],'pk':_0x2a4672,'required':_0x20193c,'deprecated':_0x313827[_0x2f7419(0xef)]===!![],'description':_0x313827[_0x2f7419(0x118)]||undefined};return Array[_0x2f7419(0x117)](_0x343673)&&_0x343673[_0x2f7419(0x110)]>0x0&&(_0x2435d5[_0x2f7419(0xe7)]=_0x343673),_0x2435d5;}function parseJsonMaybe(_0x34ebac){const _0x9f00f9=a62_0x2a9c;if(typeof _0x34ebac!==_0x9f00f9(0xe3))return _0x34ebac;try{return JSON[_0x9f00f9(0x11e)](_0x34ebac);}catch{return _0x34ebac;}}function normalizeOperationEntry(_0x579989,_0x33002b){const _0x2d99cf=a62_0x2a9c;if(!_0x33002b||typeof _0x33002b!==_0x2d99cf(0x111))return null;if(!_0x33002b['method']||!_0x33002b['path'])return null;const _0x520b09={'name':_0x579989,'method':_0x33002b[_0x2d99cf(0x10d)],'path':_0x33002b[_0x2d99cf(0xda)]};if(_0x33002b['host'])_0x520b09['host']=_0x33002b[_0x2d99cf(0xee)];if(_0x33002b[_0x2d99cf(0x107)]!=null){const _0x25e28c=parseJsonMaybe(_0x33002b[_0x2d99cf(0x107)]);_0x520b09[_0x2d99cf(0x107)]=_0x25e28c;}if(_0x33002b[_0x2d99cf(0xed)]!=null){const _0x147cfa=parseJsonMaybe(_0x33002b[_0x2d99cf(0xed)]);_0x520b09[_0x2d99cf(0xed)]=_0x147cfa;}if(_0x33002b['beforeScriptId']!=null)_0x520b09[_0x2d99cf(0xde)]=_0x33002b[_0x2d99cf(0xde)];if(_0x33002b[_0x2d99cf(0x106)]!=null)_0x520b09[_0x2d99cf(0x106)]=_0x33002b[_0x2d99cf(0x106)];if(Array[_0x2d99cf(0x117)](_0x33002b[_0x2d99cf(0x11f)]))_0x520b09[_0x2d99cf(0x11f)]=_0x33002b[_0x2d99cf(0x11f)];if(Array[_0x2d99cf(0x117)](_0x33002b['responseFields']))_0x520b09[_0x2d99cf(0x105)]=_0x33002b['responseFields'];return _0x520b09;}function summarizeDbtable(_0x1ea271){const _0x5ca67f=a62_0x2a9c,_0x1440ef={},_0x51c799=[_0x5ca67f(0x114),_0x5ca67f(0xdc),_0x5ca67f(0xf3),'datasetKey',_0x5ca67f(0xdb),_0x5ca67f(0x103),'logicField',_0x5ca67f(0xe5),_0x5ca67f(0xfa),'creatorIdField',_0x5ca67f(0xf8),_0x5ca67f(0x112),_0x5ca67f(0x10a),_0x5ca67f(0xfd),_0x5ca67f(0xdf)];for(const _0x37edaf of _0x51c799){if(_0x1ea271[_0x37edaf]!==undefined)_0x1440ef[_0x37edaf]=_0x1ea271[_0x37edaf];}return typeof _0x1440ef[_0x5ca67f(0x103)]===_0x5ca67f(0xe3)&&_0x1440ef[_0x5ca67f(0x103)]['length']>0x0&&(_0x1440ef[_0x5ca67f(0x102)]=_0x1440ef[_0x5ca67f(0x103)][_0x5ca67f(0xdd)](',')['map'](_0x3dd644=>_0x3dd644['trim']())[_0x5ca67f(0x100)](Boolean)),_0x1440ef;}function normalizeRelatedPages(_0x137fb3){const _0x248b9d=a62_0x2a9c;if(!Array[_0x248b9d(0x117)](_0x137fb3))return[];return _0x137fb3[_0x248b9d(0x100)](_0x2bf9d5=>_0x2bf9d5&&typeof _0x2bf9d5==='object')[_0x248b9d(0xfc)](_0x42c322=>({'id':_0x42c322['id'],'type':_0x42c322[_0x248b9d(0xf9)],'code':_0x42c322[_0x248b9d(0x120)],'title':_0x42c322[_0x248b9d(0x109)],'deleted':_0x42c322['deleted']===!![]}));}function a62_0x2a9c(_0x44f6be,_0x3f911e){_0x44f6be=_0x44f6be-0xda;const _0x1ef990=a62_0x1ef9();let _0x2a9cc0=_0x1ef990[_0x44f6be];return _0x2a9cc0;}function a62_0x1ef9(){const _0x1a4152=['title','modifierNameField','1gaxgrc','toFieldLabel','method','toDatasetName','operations','length','object','modifierIdField','doVersion','dbId','main_sub','11695810gvSYAP','isArray','description','9RIPTuK','required','columnCodeListWithDeleted','1850172nOfuYT','84WQYlln','parse','requestFields','code','push','relations','str','alias','toField','extend','path','pkField','dbName','split','beforeScriptId','dblinkInfoDTO','fields','1958924QNJPQY','doType','string','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','createTimeField','toTableName','options','entries','4836715UerRbX','relatedPageInfoList','795516PNzzsv','dataset','responseBody','host','deprecated','displayName','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','properties','tableName','validateRules','indexes','name','bizRelationType','creatorNameField','type','updateTimeField','333144rJJkAc','map','labelField','3vHXxQG','modelCode','filter','detail','allFieldNames','allFields','cardinality','responseFields','afterScriptId','requestBody','9295336mIElzi'];a62_0x1ef9=function(){return _0x1a4152;};return a62_0x1ef9();}export const datasetDetail={'service':a62_0x139fa0(0xec),'command':a62_0x139fa0(0x101),'description':a62_0x139fa0(0xe4),'risk':'read','flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':a62_0x139fa0(0x124),'type':a62_0x139fa0(0xe3),'description':a62_0x139fa0(0xf1)}],async 'execute'(_0x1ecbc7){const _0x3d5bba=a62_0x139fa0,_0x194e12=await getDatasetDetail(_0x1ecbc7[_0x3d5bba(0x123)](_0x3d5bba(0x120))),_0x110ebd=Array[_0x3d5bba(0x117)](_0x194e12[_0x3d5bba(0xe0)])?_0x194e12[_0x3d5bba(0xe0)]:Array[_0x3d5bba(0x117)](_0x194e12[_0x3d5bba(0xf2)])?_0x194e12['properties']:[],_0xb4e643=_0x110ebd[_0x3d5bba(0xfc)](_0x195075=>normalizeField(_0x195075))[_0x3d5bba(0x100)](_0x314a73=>_0x314a73!==null),_0x555b28=_0x194e12[_0x3d5bba(0x10f)]??{},_0x36b55a=[];for(const [_0x132b7d,_0x294f39]of Object[_0x3d5bba(0xe8)](_0x555b28)){const _0x490036=normalizeOperationEntry(_0x132b7d,_0x294f39);if(_0x490036)_0x36b55a[_0x3d5bba(0x121)](_0x490036);}const _0x38371e=_0x194e12['dbtableConfig']??{},_0x4e7304=_0x194e12[_0x3d5bba(0xec)]??{},_0x15e9e4=_0x38371e[_0x3d5bba(0x114)]!=null?{'id':_0x38371e['dbId'],'name':_0x38371e[_0x3d5bba(0xdc)]??null}:undefined;let _0x176360;return typeof _0x194e12[_0x3d5bba(0x126)]===_0x3d5bba(0xe3)&&(_0x176360=parseJsonMaybe(_0x194e12[_0x3d5bba(0x126)])),{'ok':!![],'data':{'id':_0x194e12['modelId']??_0x194e12['id'],'name':_0x194e12['name'],'code':_0x194e12[_0x3d5bba(0xff)]||_0x194e12[_0x3d5bba(0x120)],'doVersion':_0x194e12[_0x3d5bba(0x113)],'description':_0x194e12[_0x3d5bba(0x118)]||_0x4e7304['tableComment']||undefined,'source':_0x194e12['source']||_0x4e7304['sourceType'],'table':_0x38371e[_0x3d5bba(0xf3)]||_0x4e7304[_0x3d5bba(0xf3)],'datasetKey':_0x38371e['datasetKey'],'pk':_0x38371e['pkField'],'db':_0x15e9e4,'dbtable':summarizeDbtable(_0x38371e),'fields':_0xb4e643,'operations':_0x36b55a,'indexes':Array[_0x3d5bba(0x117)](_0x4e7304['indexes'])?_0x4e7304[_0x3d5bba(0xf5)]:[],'relations':Array[_0x3d5bba(0x117)](_0x194e12[_0x3d5bba(0x122)])?_0x194e12[_0x3d5bba(0x122)][_0x3d5bba(0xfc)](_0x1e706d=>({..._0x1e706d['relationId']!=null?{'relationId':_0x1e706d['relationId']}:{},'fromDataset':_0x194e12[_0x3d5bba(0xf6)],'fromCode':_0x194e12[_0x3d5bba(0xff)]||_0x194e12[_0x3d5bba(0x120)],'fromTable':_0x38371e['tableName']||_0x4e7304[_0x3d5bba(0xf3)],'fromField':_0x1e706d['fromField'],'toDataset':_0x1e706d[_0x3d5bba(0x10e)],'toCode':_0x1e706d['toDatasetCode'],'toTable':_0x1e706d[_0x3d5bba(0xe6)],'toField':_0x1e706d[_0x3d5bba(0x125)],'labelField':_0x1e706d[_0x3d5bba(0x10c)]||undefined,'cardinality':_0x1e706d[_0x3d5bba(0x104)]||undefined,'bizRelationType':_0x1e706d[_0x3d5bba(0xf7)]===_0x3d5bba(0x115)?_0x3d5bba(0x115):null})):[],'relatedPages':normalizeRelatedPages(_0x194e12[_0x3d5bba(0xea)]),...Array[_0x3d5bba(0x117)](_0x194e12[_0x3d5bba(0x11b)])?{'columnCodeListWithDeleted':_0x194e12[_0x3d5bba(0x11b)]}:{},'formatRules':Array[_0x3d5bba(0x117)](_0x194e12['formatRules'])?_0x194e12['formatRules']:[],'validateRules':Array[_0x3d5bba(0x117)](_0x194e12[_0x3d5bba(0xf4)])?_0x194e12[_0x3d5bba(0xf4)]:[],..._0x176360!==undefined?{'extend':_0x176360}:{},'stats':{'fieldCount':_0xb4e643['length'],'operationCount':_0x36b55a['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a64_0x3b4c4e=a64_0x53f9;(function(_0x39b948,_0x4aadc3){const _0x2aec8f=a64_0x53f9,_0x29f8ad=_0x39b948();while(!![]){try{const _0xd14e06=-parseInt(_0x2aec8f(0x111))/0x1*(-parseInt(_0x2aec8f(0xdd))/0x2)+-parseInt(_0x2aec8f(0x105))/0x3*(parseInt(_0x2aec8f(0xfb))/0x4)+-parseInt(_0x2aec8f(0x103))/0x5*(parseInt(_0x2aec8f(0xff))/0x6)+-parseInt(_0x2aec8f(0xfe))/0x7*(-parseInt(_0x2aec8f(0xe3))/0x8)+parseInt(_0x2aec8f(0xe2))/0x9*(parseInt(_0x2aec8f(0xe8))/0xa)+-parseInt(_0x2aec8f(0x10c))/0xb+parseInt(_0x2aec8f(0x113))/0xc;if(_0xd14e06===_0x4aadc3)break;else _0x29f8ad['push'](_0x29f8ad['shift']());}catch(_0x5aea1a){_0x29f8ad['push'](_0x29f8ad['shift']());}}}(a64_0x28c8,0x5380e));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([[a64_0x3b4c4e(0x115),{'message':a64_0x3b4c4e(0xdf),'hint':a64_0x3b4c4e(0xf5)}]]);export function parseJsonObjectFlag(_0x2b2b92,_0x44a44b){const _0x561e6f=a64_0x3b4c4e;if(!_0x2b2b92)return undefined;let _0x1cd2e7;try{_0x1cd2e7=JSON[_0x561e6f(0x11a)](_0x2b2b92);}catch(_0x4ae9b6){const _0x37fe5d=_0x4ae9b6 instanceof Error?_0x4ae9b6['message']:String(_0x4ae9b6);throw CliErrors[_0x561e6f(0xea)](_0x44a44b+_0x561e6f(0x100)+_0x37fe5d);}if(!isPlainObject(_0x1cd2e7)||Array[_0x561e6f(0xfa)](_0x1cd2e7))throw CliErrors[_0x561e6f(0xea)](_0x44a44b+_0x561e6f(0xe5));return _0x1cd2e7;}export function validateExtendPatchKeys(_0x34ed1f){const _0x3d674b=a64_0x3b4c4e,_0x5f426f=Object['keys'](_0x34ed1f);if(_0x5f426f['length']===0x0)throw CliErrors[_0x3d674b(0xea)](_0x3d674b(0x122));for(const _0x41a400 of _0x5f426f){const _0x22adf1=EXTEND_PATCH_REDIRECTS['get'](_0x41a400);if(_0x22adf1)throw CliErrors['validation'](_0x22adf1['message'],_0x22adf1[_0x3d674b(0x114)]);if(!MUTABLE_EXTEND_KEYS[_0x3d674b(0xec)](_0x41a400))throw CliErrors['validation'](_0x3d674b(0x110)+_0x41a400,describeMutableExtendKeys());}}function a64_0x53f9(_0x3ce523,_0x346cb9){_0x3ce523=_0x3ce523-0xd9;const _0x28c859=a64_0x28c8();let _0x53f967=_0x28c859[_0x3ce523];return _0x53f967;}function describeMutableExtendKeys(){const _0x1b7777=a64_0x3b4c4e,_0x29ffcf=Array[_0x1b7777(0xf3)](MUTABLE_EXTEND_KEYS)[_0x1b7777(0x106)]();return _0x29ffcf[_0x1b7777(0xfc)]>0x0?_0x1b7777(0xeb)+_0x29ffcf[_0x1b7777(0xf1)](',\x20'):_0x1b7777(0x104);}export function applyExtendPatch(_0x5be801,_0xa02762){const _0xbe55d2=a64_0x3b4c4e;validateExtendPatchKeys(_0xa02762);const _0xe28120=deepClone(_0x5be801),_0x2ea9e4=[];for(const [_0x17c621,_0x78544f]of Object[_0xbe55d2(0xdb)](_0xa02762)){const _0x3a0d70=_0xe28120[_0x17c621],_0x1ff917=deepClone(_0x78544f);!deepEqual(_0x3a0d70,_0x1ff917)&&(_0xe28120[_0x17c621]=_0x1ff917,_0x2ea9e4[_0xbe55d2(0xf6)](_0xbe55d2(0x109)+_0x17c621));}return _0x2ea9e4['sort'](),{'after':_0xe28120,'changedPaths':_0x2ea9e4,'changed':_0x2ea9e4[_0xbe55d2(0xfc)]>0x0};}export function assertExpectation(_0x5baddb,_0x3fcce0){const _0x2ff0c7=a64_0x3b4c4e;if(!_0x3fcce0)return;for(const [_0x52d965,_0xa6cf28]of Object[_0x2ff0c7(0xdb)](_0x3fcce0)){const _0x16f999=_0x5baddb[_0x52d965];if(!deepEqual(_0x16f999,_0xa6cf28))throw CliErrors[_0x2ff0c7(0xea)](_0x2ff0c7(0x117)+_0x52d965,_0x2ff0c7(0xf4)+JSON[_0x2ff0c7(0x120)](_0xa6cf28)+_0x2ff0c7(0x10a)+JSON[_0x2ff0c7(0x120)](_0x16f999));}}export async function buildDatasetExtendUpdateResult({appCode:_0x49ece8,input:_0x374308,dryRun:_0x28bf84}){const _0x4a41fb=a64_0x3b4c4e;validateInput(_0x374308);const _0x406e2b=await getDatasetDetail(_0x374308[_0x4a41fb(0x11f)]),_0x3c164c=parseDatasetExtend(_0x406e2b['extend']),_0xa3da6a=deepClone(_0x3c164c[_0x4a41fb(0x10f)]);assertExpectation(_0xa3da6a,_0x374308[_0x4a41fb(0xee)]);const {after:_0x500f3f,changedPaths:_0x4baafe,changed:_0x1755b1}=applyExtendPatch(_0xa3da6a,_0x374308[_0x4a41fb(0xf0)]),_0x1e2974=summarizeDataset(_0x406e2b,_0x374308[_0x4a41fb(0x11f)]);return _0x1755b1&&!_0x28bf84&&(_0x406e2b['extend']=serializeDatasetExtend(_0x500f3f,_0x3c164c[_0x4a41fb(0x102)]),await updateDrivenData(_0x406e2b)),{'ok':!![],'data':{'appCode':_0x49ece8,'selector':{'code':_0x374308['code']},'dataset':_0x1e2974,'dryRun':_0x28bf84,'changed':_0x1755b1,'changedPaths':_0x4baafe,'before':{'extend':_0xa3da6a},'after':{'extend':_0x500f3f},'submitted':_0x1755b1&&!_0x28bf84},'message':_0x1755b1?_0x28bf84?_0x4a41fb(0x11d)+_0x4baafe[_0x4a41fb(0xf1)](',\x20')+')':'Updated\x20dataset\x20extend\x20('+_0x4baafe[_0x4a41fb(0xf1)](',\x20')+')':_0x4a41fb(0xf9)};}export const datasetExtendUpdate={'service':a64_0x3b4c4e(0xf2),'command':a64_0x3b4c4e(0xe4),'description':a64_0x3b4c4e(0xde),'risk':a64_0x3b4c4e(0x118),'flags':[CODE_FLAG,{'name':a64_0x3b4c4e(0xda),'type':a64_0x3b4c4e(0xf8),'required':!![],'description':a64_0x3b4c4e(0xed)},{'name':a64_0x3b4c4e(0x10d),'type':'string','required':![],'description':a64_0x3b4c4e(0x107)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x122ea0){validateInput(readExtendUpdateInput(_0x122ea0));},async 'dryRun'(_0x32c44e){const _0x4480f1=a64_0x3b4c4e,_0x1a64d8=await buildDatasetExtendUpdateResult({'appCode':_0x32c44e[_0x4480f1(0x108)],'input':readExtendUpdateInput(_0x32c44e),'dryRun':!![]});return{'method':'POST','url':_0x4480f1(0x116),'body':_0x1a64d8[_0x4480f1(0x10b)],'description':_0x1a64d8[_0x4480f1(0xdc)]};},async 'execute'(_0x219d37){const _0x24cc77=a64_0x3b4c4e;return buildDatasetExtendUpdateResult({'appCode':_0x219d37[_0x24cc77(0x108)],'input':readExtendUpdateInput(_0x219d37),'dryRun':![]});}};function readExtendUpdateInput(_0x4899c5){const _0x7cdb8d=a64_0x3b4c4e,_0x20a900=trim(_0x4899c5['str']('code')),_0x200c4e=parseJsonObjectFlag(_0x4899c5[_0x7cdb8d(0xef)]('patch-json'),_0x7cdb8d(0x11e)),_0x17d515=parseJsonObjectFlag(_0x4899c5[_0x7cdb8d(0xef)](_0x7cdb8d(0x10d)),'--expect-json');return{'code':_0x20a900,'patch':_0x200c4e||{},'expect':_0x17d515};}function validateInput(_0xa68269){const _0x5b9c80=a64_0x3b4c4e;if(!_0xa68269['code'])throw CliErrors[_0x5b9c80(0xea)](_0x5b9c80(0x11c));validateExtendPatchKeys(_0xa68269[_0x5b9c80(0xf0)]);}function parseDatasetExtend(_0x38c931){const _0xd4b487=a64_0x3b4c4e;if(typeof _0x38c931===_0xd4b487(0xf8)){const _0x172891=_0x38c931[_0xd4b487(0xe9)]();if(!_0x172891)return{'value':{},'shape':_0xd4b487(0xf8)};let _0x3e4c96;try{_0x3e4c96=JSON[_0xd4b487(0x11a)](_0x172891);}catch(_0x4b382e){const _0x4e793f=_0x4b382e instanceof Error?_0x4b382e[_0xd4b487(0xdc)]:String(_0x4b382e);throw CliErrors[_0xd4b487(0xea)](_0xd4b487(0x119)+_0x4e793f);}if(!isPlainObject(_0x3e4c96)||Array[_0xd4b487(0xfa)](_0x3e4c96))throw CliErrors['validation']('Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object');return{'value':_0x3e4c96,'shape':_0xd4b487(0xf8)};}if(_0x38c931===undefined||_0x38c931===null)return{'value':{},'shape':_0xd4b487(0xf8)};if(!isPlainObject(_0x38c931)||Array[_0xd4b487(0xfa)](_0x38c931))throw CliErrors[_0xd4b487(0xea)](_0xd4b487(0xf7));return{'value':_0x38c931,'shape':_0xd4b487(0x11b)};}function a64_0x28c8(){const _0x49c4b6=['str','patch','join','dataset','from','Expected\x20','Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.','push','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','string','No\x20changes\x20for\x20dataset\x20extend','isArray','100DYkjCv','length','datasetId','7uEBYQZ','216756HfTpUj','\x20must\x20be\x20valid\x20JSON\x20object:\x20','modelCode','shape','85WeQrPf','No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.','24639zXCVRS','sort','JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing','appCode','extend.',',\x20actual\x20','data','7049273FyWkZs','expect-json','tableName','value','Unsupported\x20patch\x20key:\x20','64OGwYuP','modelId','14389608novjZP','hint','businessGroup','/smartapi/dataset/update-driven-data','Expectation\x20mismatch\x20at\x20extend.','write','Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20','parse','object','--code\x20is\x20required','Dry-run:\x20dataset\x20extend\x20would\x20change\x20(','--patch-json','code','stringify','dbId','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','dbName','patch-json','entries','message','13332qilCnN','Patch\x20dataset\x20top-level\x20extend\x20safely','dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','datasetCode','name','351dVuVax','1067896eBNknp','extend-update','\x20must\x20be\x20a\x20JSON\x20object','datasetName','dbtableConfig','11050zgOMGz','trim','validation','Allowed\x20keys:\x20','has','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','expect'];a64_0x28c8=function(){return _0x49c4b6;};return a64_0x28c8();}function serializeDatasetExtend(_0x35290e,_0x4abfab){return _0x4abfab==='string'?JSON['stringify'](_0x35290e):_0x35290e;}function summarizeDataset(_0x265ab0,_0x5bbc81){const _0x5243ad=a64_0x3b4c4e,_0xe02026=isPlainObject(_0x265ab0[_0x5243ad(0xf2)])?_0x265ab0[_0x5243ad(0xf2)]:{},_0x2c0191=isPlainObject(_0x265ab0['dbtableConfig'])?_0x265ab0[_0x5243ad(0xe7)]:{};return{'id':_0x265ab0[_0x5243ad(0x112)]??_0x265ab0['id']??_0xe02026[_0x5243ad(0xfd)]??null,'code':_0x265ab0[_0x5243ad(0x101)]??_0x265ab0[_0x5243ad(0x11f)]??_0xe02026[_0x5243ad(0xe0)]??_0x5bbc81,'name':_0x265ab0[_0x5243ad(0xe1)]??_0xe02026[_0x5243ad(0xe6)]??null,'table':_0x2c0191[_0x5243ad(0x10e)]??_0xe02026['tableName']??null,'db':_0x2c0191[_0x5243ad(0xd9)]??_0x2c0191[_0x5243ad(0x121)]??null};}function deepClone(_0x52dd6b){const _0x3b64f5=a64_0x3b4c4e;if(_0x52dd6b===undefined)return _0x52dd6b;return JSON[_0x3b64f5(0x11a)](JSON[_0x3b64f5(0x120)](_0x52dd6b));}function deepEqual(_0x19bbea,_0x17d8b9){const _0x493ca6=a64_0x3b4c4e;return JSON[_0x493ca6(0x120)](_0x19bbea)===JSON['stringify'](_0x17d8b9);}function isPlainObject(_0x5763df){const _0x2c2ee6=a64_0x3b4c4e;return Boolean(_0x5763df)&&typeof _0x5763df===_0x2c2ee6(0x11b)&&!Array[_0x2c2ee6(0xfa)](_0x5763df);}function trim(_0x209999){const _0x2ddbf5=a64_0x3b4c4e,_0x4e0ea2=String(_0x209999||'')[_0x2ddbf5(0xe9)]();return _0x4e0ea2;}
|
|
1
|
+
const a63_0x12fa23=a63_0x4354;(function(_0x41ab08,_0x4c026b){const _0x1ae351=a63_0x4354,_0x4acb51=_0x41ab08();while(!![]){try{const _0x5e75e2=-parseInt(_0x1ae351(0x131))/0x1+-parseInt(_0x1ae351(0x16c))/0x2*(-parseInt(_0x1ae351(0x16a))/0x3)+-parseInt(_0x1ae351(0x172))/0x4+-parseInt(_0x1ae351(0x159))/0x5*(-parseInt(_0x1ae351(0x173))/0x6)+parseInt(_0x1ae351(0x153))/0x7*(parseInt(_0x1ae351(0x174))/0x8)+parseInt(_0x1ae351(0x160))/0x9*(-parseInt(_0x1ae351(0x137))/0xa)+-parseInt(_0x1ae351(0x138))/0xb;if(_0x5e75e2===_0x4c026b)break;else _0x4acb51['push'](_0x4acb51['shift']());}catch(_0x1a7242){_0x4acb51['push'](_0x4acb51['shift']());}}}(a63_0xa331,0x280ff));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([[a63_0x12fa23(0x13e),{'message':a63_0x12fa23(0x164),'hint':'Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.'}]]);export function parseJsonObjectFlag(_0x3fde12,_0x5e75b2){const _0x24d6a5=a63_0x12fa23;if(!_0x3fde12)return undefined;let _0x5e9598;try{_0x5e9598=JSON[_0x24d6a5(0x163)](_0x3fde12);}catch(_0xeb8e77){const _0x519b5f=_0xeb8e77 instanceof Error?_0xeb8e77[_0x24d6a5(0x169)]:String(_0xeb8e77);throw CliErrors[_0x24d6a5(0x14a)](_0x5e75b2+_0x24d6a5(0x141)+_0x519b5f);}if(!isPlainObject(_0x5e9598)||Array['isArray'](_0x5e9598))throw CliErrors[_0x24d6a5(0x14a)](_0x5e75b2+_0x24d6a5(0x147));return _0x5e9598;}export function validateExtendPatchKeys(_0x2ec704){const _0x95f7d=a63_0x12fa23,_0x4ca855=Object[_0x95f7d(0x15a)](_0x2ec704);if(_0x4ca855[_0x95f7d(0x15b)]===0x0)throw CliErrors[_0x95f7d(0x14a)](_0x95f7d(0x171));for(const _0x33d9ac of _0x4ca855){const _0x32fdaf=EXTEND_PATCH_REDIRECTS[_0x95f7d(0x152)](_0x33d9ac);if(_0x32fdaf)throw CliErrors[_0x95f7d(0x14a)](_0x32fdaf['message'],_0x32fdaf[_0x95f7d(0x14d)]);if(!MUTABLE_EXTEND_KEYS[_0x95f7d(0x16b)](_0x33d9ac))throw CliErrors[_0x95f7d(0x14a)](_0x95f7d(0x158)+_0x33d9ac,describeMutableExtendKeys());}}function a63_0x4354(_0xcdbf7f,_0x284a9c){_0xcdbf7f=_0xcdbf7f-0x130;const _0xa331f1=a63_0xa331();let _0x43541f=_0xa331f1[_0xcdbf7f];return _0x43541f;}function describeMutableExtendKeys(){const _0x470a09=a63_0x12fa23,_0x1fc6c3=Array[_0x470a09(0x143)](MUTABLE_EXTEND_KEYS)[_0x470a09(0x15d)]();return _0x1fc6c3[_0x470a09(0x15b)]>0x0?_0x470a09(0x166)+_0x1fc6c3[_0x470a09(0x14b)](',\x20'):_0x470a09(0x14e);}export function applyExtendPatch(_0xb76050,_0x11fa49){const _0x155cc2=a63_0x12fa23;validateExtendPatchKeys(_0x11fa49);const _0xeb9c7a=deepClone(_0xb76050),_0x3990c7=[];for(const [_0x266bcf,_0x349735]of Object[_0x155cc2(0x150)](_0x11fa49)){const _0x2cf70d=_0xeb9c7a[_0x266bcf],_0x323980=deepClone(_0x349735);!deepEqual(_0x2cf70d,_0x323980)&&(_0xeb9c7a[_0x266bcf]=_0x323980,_0x3990c7[_0x155cc2(0x13f)](_0x155cc2(0x130)+_0x266bcf));}return _0x3990c7[_0x155cc2(0x15d)](),{'after':_0xeb9c7a,'changedPaths':_0x3990c7,'changed':_0x3990c7[_0x155cc2(0x15b)]>0x0};}export function assertExpectation(_0xf9244b,_0x192a1d){const _0x3efbc2=a63_0x12fa23;if(!_0x192a1d)return;for(const [_0x2a4939,_0x3ec338]of Object[_0x3efbc2(0x150)](_0x192a1d)){const _0x1a2293=_0xf9244b[_0x2a4939];if(!deepEqual(_0x1a2293,_0x3ec338))throw CliErrors[_0x3efbc2(0x14a)](_0x3efbc2(0x167)+_0x2a4939,_0x3efbc2(0x154)+JSON['stringify'](_0x3ec338)+_0x3efbc2(0x175)+JSON['stringify'](_0x1a2293));}}export async function buildDatasetExtendUpdateResult({appCode:_0x2f9846,input:_0x1c9dbd,dryRun:_0x266b9f}){const _0xe6b38c=a63_0x12fa23;validateInput(_0x1c9dbd);const _0x5e9eb8=await getDatasetDetail(_0x1c9dbd['code']),_0x5da01b=parseDatasetExtend(_0x5e9eb8[_0xe6b38c(0x15c)]),_0x49622e=deepClone(_0x5da01b[_0xe6b38c(0x14f)]);assertExpectation(_0x49622e,_0x1c9dbd['expect']);const {after:_0x3884aa,changedPaths:_0x4cc81a,changed:_0x1cac28}=applyExtendPatch(_0x49622e,_0x1c9dbd['patch']),_0x31640d=summarizeDataset(_0x5e9eb8,_0x1c9dbd[_0xe6b38c(0x15f)]);return _0x1cac28&&!_0x266b9f&&(_0x5e9eb8[_0xe6b38c(0x15c)]=serializeDatasetExtend(_0x3884aa,_0x5da01b['shape']),await updateDrivenData(_0x5e9eb8)),{'ok':!![],'data':{'appCode':_0x2f9846,'selector':{'code':_0x1c9dbd['code']},'dataset':_0x31640d,'dryRun':_0x266b9f,'changed':_0x1cac28,'changedPaths':_0x4cc81a,'before':{'extend':_0x49622e},'after':{'extend':_0x3884aa},'submitted':_0x1cac28&&!_0x266b9f},'message':_0x1cac28?_0x266b9f?_0xe6b38c(0x168)+_0x4cc81a['join'](',\x20')+')':_0xe6b38c(0x155)+_0x4cc81a[_0xe6b38c(0x14b)](',\x20')+')':_0xe6b38c(0x139)};}export const datasetExtendUpdate={'service':a63_0x12fa23(0x13a),'command':a63_0x12fa23(0x16d),'description':a63_0x12fa23(0x135),'risk':a63_0x12fa23(0x151),'flags':[CODE_FLAG,{'name':a63_0x12fa23(0x16e),'type':'string','required':!![],'description':a63_0x12fa23(0x136)},{'name':'expect-json','type':'string','required':![],'description':'JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1d17aa){validateInput(readExtendUpdateInput(_0x1d17aa));},async 'dryRun'(_0x39d624){const _0x3c20c1=a63_0x12fa23,_0x503c24=await buildDatasetExtendUpdateResult({'appCode':_0x39d624[_0x3c20c1(0x162)],'input':readExtendUpdateInput(_0x39d624),'dryRun':!![]});return{'method':'POST','url':_0x3c20c1(0x144),'body':_0x503c24['data'],'description':_0x503c24[_0x3c20c1(0x169)]};},async 'execute'(_0x2ef46f){const _0x4c33f1=a63_0x12fa23;return buildDatasetExtendUpdateResult({'appCode':_0x2ef46f[_0x4c33f1(0x162)],'input':readExtendUpdateInput(_0x2ef46f),'dryRun':![]});}};function readExtendUpdateInput(_0x3793e3){const _0x440c53=a63_0x12fa23,_0x9f2ca3=trim(_0x3793e3[_0x440c53(0x156)](_0x440c53(0x15f))),_0x16da01=parseJsonObjectFlag(_0x3793e3[_0x440c53(0x156)](_0x440c53(0x16e)),_0x440c53(0x145)),_0x45263c=parseJsonObjectFlag(_0x3793e3[_0x440c53(0x156)](_0x440c53(0x161)),_0x440c53(0x132));return{'code':_0x9f2ca3,'patch':_0x16da01||{},'expect':_0x45263c};}function validateInput(_0x2a1950){const _0x1abcbd=a63_0x12fa23;if(!_0x2a1950[_0x1abcbd(0x15f)])throw CliErrors['validation'](_0x1abcbd(0x15e));validateExtendPatchKeys(_0x2a1950[_0x1abcbd(0x13d)]);}function parseDatasetExtend(_0x85261f){const _0x25e980=a63_0x12fa23;if(typeof _0x85261f===_0x25e980(0x157)){const _0x2ed51b=_0x85261f[_0x25e980(0x134)]();if(!_0x2ed51b)return{'value':{},'shape':_0x25e980(0x157)};let _0x5e614c;try{_0x5e614c=JSON[_0x25e980(0x163)](_0x2ed51b);}catch(_0x552c50){const _0x20f107=_0x552c50 instanceof Error?_0x552c50[_0x25e980(0x169)]:String(_0x552c50);throw CliErrors['validation']('Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x20f107);}if(!isPlainObject(_0x5e614c)||Array[_0x25e980(0x13c)](_0x5e614c))throw CliErrors[_0x25e980(0x14a)](_0x25e980(0x142));return{'value':_0x5e614c,'shape':_0x25e980(0x157)};}if(_0x85261f===undefined||_0x85261f===null)return{'value':{},'shape':'string'};if(!isPlainObject(_0x85261f)||Array['isArray'](_0x85261f))throw CliErrors['validation'](_0x25e980(0x142));return{'value':_0x85261f,'shape':_0x25e980(0x148)};}function serializeDatasetExtend(_0x2d830c,_0x260bb7){const _0x330b90=a63_0x12fa23;return _0x260bb7===_0x330b90(0x157)?JSON[_0x330b90(0x14c)](_0x2d830c):_0x2d830c;}function summarizeDataset(_0x25539d,_0x33e6a9){const _0x24007c=a63_0x12fa23,_0x5d997d=isPlainObject(_0x25539d['dataset'])?_0x25539d[_0x24007c(0x13a)]:{},_0x4adbf8=isPlainObject(_0x25539d[_0x24007c(0x13b)])?_0x25539d[_0x24007c(0x13b)]:{};return{'id':_0x25539d[_0x24007c(0x140)]??_0x25539d['id']??_0x5d997d[_0x24007c(0x146)]??null,'code':_0x25539d['modelCode']??_0x25539d[_0x24007c(0x15f)]??_0x5d997d[_0x24007c(0x16f)]??_0x33e6a9,'name':_0x25539d[_0x24007c(0x133)]??_0x5d997d[_0x24007c(0x170)]??null,'table':_0x4adbf8[_0x24007c(0x149)]??_0x5d997d[_0x24007c(0x149)]??null,'db':_0x4adbf8['dbName']??_0x4adbf8[_0x24007c(0x165)]??null};}function a63_0xa331(){const _0x14f6b4=['tableName','validation','join','stringify','hint','No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.','value','entries','write','get','651XCUjPQ','Expected\x20','Updated\x20dataset\x20extend\x20(','str','string','Unsupported\x20patch\x20key:\x20','104585aNsVUd','keys','length','extend','sort','--code\x20is\x20required','code','608913UHaVqS','expect-json','appCode','parse','dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','dbId','Allowed\x20keys:\x20','Expectation\x20mismatch\x20at\x20extend.','Dry-run:\x20dataset\x20extend\x20would\x20change\x20(','message','51TjgxIg','has','25786EpBbkN','extend-update','patch-json','datasetCode','datasetName','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','159092rArjnk','78vPbOhX','17960VwfOyY',',\x20actual\x20','extend.','174257IXRQXj','--expect-json','name','trim','Patch\x20dataset\x20top-level\x20extend\x20safely','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','10RdPqTp','2795155pFktmm','No\x20changes\x20for\x20dataset\x20extend','dataset','dbtableConfig','isArray','patch','businessGroup','push','modelId','\x20must\x20be\x20valid\x20JSON\x20object:\x20','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','from','/smartapi/dataset/update-driven-data','--patch-json','datasetId','\x20must\x20be\x20a\x20JSON\x20object','object'];a63_0xa331=function(){return _0x14f6b4;};return a63_0xa331();}function deepClone(_0x27130b){const _0x13e872=a63_0x12fa23;if(_0x27130b===undefined)return _0x27130b;return JSON[_0x13e872(0x163)](JSON[_0x13e872(0x14c)](_0x27130b));}function deepEqual(_0x5828ab,_0x40bfc1){const _0x4eb632=a63_0x12fa23;return JSON[_0x4eb632(0x14c)](_0x5828ab)===JSON[_0x4eb632(0x14c)](_0x40bfc1);}function isPlainObject(_0x59ef5c){const _0x1d7fea=a63_0x12fa23;return Boolean(_0x59ef5c)&&typeof _0x59ef5c===_0x1d7fea(0x148)&&!Array[_0x1d7fea(0x13c)](_0x59ef5c);}function trim(_0x287b09){const _0x14fdd9=a63_0x12fa23,_0x2a5076=String(_0x287b09||'')[_0x14fdd9(0x134)]();return _0x2a5076;}
|