@lovrabet/rabetbase-cli 2.5.8-beta.2 → 2.5.9-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.d.ts +8 -5
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.d.ts +5 -3
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +14 -11
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-management-client.d.ts +2 -2
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.d.ts +3 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase/references/rabetbase-kb.md +17 -15
- package/skills/rabetbase/references/rabetbase-rule.md +8 -6
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a59_0x528269=a59_0x2178;(function(_0x50c009,_0x437b48){const _0x246fc7=a59_0x2178,_0x373190=_0x50c009();while(!![]){try{const _0x8c66d3=parseInt(_0x246fc7(0x13d))/0x1+-parseInt(_0x246fc7(0x142))/0x2+-parseInt(_0x246fc7(0x149))/0x3*(-parseInt(_0x246fc7(0x14a))/0x4)+parseInt(_0x246fc7(0x144))/0x5*(parseInt(_0x246fc7(0x13a))/0x6)+parseInt(_0x246fc7(0x141))/0x7*(parseInt(_0x246fc7(0x13b))/0x8)+-parseInt(_0x246fc7(0x13c))/0x9+-parseInt(_0x246fc7(0x140))/0xa;if(_0x8c66d3===_0x437b48)break;else _0x373190['push'](_0x373190['shift']());}catch(_0x327fa6){_0x373190['push'](_0x373190['shift']());}}}(a59_0x5eb5,0xc2855));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';async function execute(_0x5b8692){const _0x3f1509=a59_0x2178,_0x48c3d5=_0x5b8692[_0x3f1509(0x143)]('key');if(!_0x48c3d5)throw CliErrors['validation'](_0x3f1509(0x13f),'Usage:\x20'+CLI_BIN_NAME+'\x20config\x20get\x20--key\x20<key>');const _0x50a86b=readConfig(),_0x17d61d=_0x48c3d5==='app'?_0x3f1509(0x147):_0x48c3d5,_0x3f9100=_0x50a86b[_0x17d61d];if(_0x3f9100===undefined)throw CliErrors[_0x3f1509(0x148)]('Key\x20not\x20found:\x20'+_0x48c3d5);return{'ok':!![],'data':typeof _0x3f9100===_0x3f1509(0x139)?_0x3f9100:{[_0x17d61d]:_0x3f9100},'message':typeof _0x3f9100===_0x3f1509(0x139)?undefined:String(_0x3f9100)};}function a59_0x2178(_0x198933,_0x4b4fac){_0x198933=_0x198933-0x138;const _0x5eb5fa=a59_0x5eb5();let _0x21786e=_0x5eb5fa[_0x198933];return _0x21786e;}export const configGetDefinition={'service':a59_0x528269(0x146),'command':a59_0x528269(0x145),'description':'Get\x20a\x20config\x20value\x20by\x20key','risk':a59_0x528269(0x13e),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'key','type':a59_0x528269(0x138),'description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};function a59_0x5eb5(){const _0x568156=['str','15xGHXOy','get','config','appcode','validation','2301459OFHXEI','8IKFMbj','string','object','1765434LkeHMs','196072GhxzmV','8738775gSMvDT','715196TnxIzR','read','Missing\x20key.','11655220poYtYa','203PEvvxK','1819452MjIxEl'];a59_0x5eb5=function(){return _0x568156;};return a59_0x5eb5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a60_0xbf26(_0x5c61ac,_0x5e69ec){_0x5c61ac=_0x5c61ac-0xf6;const _0x2e4c76=a60_0x2e4c();let _0xbf2618=_0x2e4c76[_0x5c61ac];return _0xbf2618;}(function(_0x3f98e9,_0x3f4463){const _0x4b781e=a60_0xbf26,_0x4535e1=_0x3f98e9();while(!![]){try{const _0x49b7d1=-parseInt(_0x4b781e(0xfe))/0x1+-parseInt(_0x4b781e(0x100))/0x2*(parseInt(_0x4b781e(0xf9))/0x3)+-parseInt(_0x4b781e(0xfb))/0x4*(parseInt(_0x4b781e(0xfc))/0x5)+-parseInt(_0x4b781e(0xf7))/0x6*(parseInt(_0x4b781e(0xf8))/0x7)+parseInt(_0x4b781e(0xff))/0x8*(-parseInt(_0x4b781e(0xfa))/0x9)+-parseInt(_0x4b781e(0xfd))/0xa*(parseInt(_0x4b781e(0x101))/0xb)+parseInt(_0x4b781e(0xf6))/0xc;if(_0x49b7d1===_0x3f4463)break;else _0x4535e1['push'](_0x4535e1['shift']());}catch(_0x59eb31){_0x4535e1['push'](_0x4535e1['shift']());}}}(a60_0x2e4c,0x9abea));import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';function a60_0x2e4c(){const _0xf3c80e=['7CxmfUJ','3514305IJrrIi','1044tommzs','4WpZXyA','3007075VVcGOP','19590JiNqFV','10393rjeBuu','5176eSKQPl','2lksYvO','1782NdKUuw','40829016KaFtLB','3557586uGesMz'];a60_0x2e4c=function(){return _0xf3c80e;};return a60_0x2e4c();}import{configSetDefinition}from'../../commands/config/set.js';import{configDeleteDefinition}from'../../commands/config/delete.js';import{configInitDefinition}from'../../commands/config/init.js';export const configDefinitions=[configInitDefinition,configListDefinition,configGetDefinition,configSetDefinition,configDeleteDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x4f3305=a61_0x25a7;(function(_0x3b28b7,_0x23b85b){const _0x9b3e93=a61_0x25a7,_0x5808c2=_0x3b28b7();while(!![]){try{const _0x21c6ca=-parseInt(_0x9b3e93(0x161))/0x1*(-parseInt(_0x9b3e93(0x146))/0x2)+-parseInt(_0x9b3e93(0x14c))/0x3+-parseInt(_0x9b3e93(0x174))/0x4*(parseInt(_0x9b3e93(0x140))/0x5)+parseInt(_0x9b3e93(0x13c))/0x6+parseInt(_0x9b3e93(0x167))/0x7*(parseInt(_0x9b3e93(0x13b))/0x8)+-parseInt(_0x9b3e93(0x15e))/0x9+parseInt(_0x9b3e93(0x13f))/0xa;if(_0x21c6ca===_0x23b85b)break;else _0x5808c2['push'](_0x5808c2['shift']());}catch(_0x3f1ed5){_0x5808c2['push'](_0x5808c2['shift']());}}}(a61_0x55d6,0x283ea));import{select}from'@inquirer/prompts';import{CliErrors}from'../../errors.js';import{readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{DOMAIN_CONFIG_FIELDS,LEGACY_DOMAIN_CONFIG_FIELDS,resolveDomainConfigInput}from'../../config/domain-config.js';function a61_0x55d6(){const _0x4e8242=['9775YPWxrn','certificateDomain','Custom\x20SkillHub\x20HTTPS\x20origin','cdn','Initialize\x20the\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domains','Custom\x20certificate\x20service\x20HTTPS\x20origin','37082tHCnfZ','cancelled','assign','join','nonInteractive','Independent-deployment\x20Domain\x20JSON\x20file','980838MVJnRn','label','global','map','Custom\x20platform\x20API\x20HTTPS\x20origin','certificate-domain','Independent\x20deployment\x20requires\x20--local-domain\x20and\x20--certificate-domain\x20together.','Custom\x20local\x20callback\x20HTTPS\x20origin','region','localDomain','Custom\x20KB\x20Service\x20HTTPS\x20origin','Custom\x20Lovrabet\x20workspace\x20HTTPS\x20origin','name','Custom\x20Runtime\x20HTTPS\x20origin','config','Updates\x20the\x20selected\x20Rabetbase\x20region\x20or\x20independent-deployment\x20Domain\x20configuration.\x20Cookie,\x20output\x20format,\x20and\x20app\x20bindings\x20stay\x20unchanged.','keys','\x22\x20is\x20not\x20currently\x20available.','2865141nrkNcE','kb-domain','domains','1eRseSE','app-domain','kb-service-domain','length','enterprise-v1','api-domain','105119fqdpRV','official','Region\x20\x22','skill-domain','domain-config','validation','mode','user-domain','project','Official\x20Lovrabet\x20region:\x20','string','routing','independent','384HKstHH','str','104BxZeGX','1257606ACPPvz','manifestDomains','Select\x20Lovrabet\x20region','5744540iKxcUV'];a61_0x55d6=function(){return _0x4e8242;};return a61_0x55d6();}import{ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL}from'../../generated/routing-contract.js';import{DEFAULT_LOVRABET_REGION,ENABLED_LOVRABET_REGION_VALUES,isEnabledLovrabetRegion}from'../../constant/region.js';import{getOfficialRoutingProfile}from'../../constant/routing-profile.js';import{GLOBAL_SCOPE_FLAG}from'../../commands/common/flags.js';function a61_0x25a7(_0x5af528,_0x2890e8){_0x5af528=_0x5af528-0x13b;const _0x55d6d2=a61_0x55d6();let _0x25a730=_0x55d6d2[_0x5af528];return _0x25a730;}export const configInitFlags=[GLOBAL_SCOPE_FLAG,{'name':a61_0x4f3305(0x154),'type':a61_0x4f3305(0x171),'description':a61_0x4f3305(0x170)+ENABLED_LOVRABET_REGION_VALUES[a61_0x4f3305(0x149)](',\x20'),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},{'name':a61_0x4f3305(0x16b),'type':a61_0x4f3305(0x171),'description':a61_0x4f3305(0x14b)},{'name':a61_0x4f3305(0x16e),'type':a61_0x4f3305(0x171),'description':'Custom\x20User\x20HTTPS\x20origin'},{'name':a61_0x4f3305(0x166),'type':'string','description':a61_0x4f3305(0x150)},{'name':'runtime-domain','type':a61_0x4f3305(0x171),'description':a61_0x4f3305(0x159)},{'name':a61_0x4f3305(0x16a),'type':a61_0x4f3305(0x171),'description':a61_0x4f3305(0x142)},{'name':a61_0x4f3305(0x15f),'type':'string','description':'Custom\x20knowledge-base\x20HTTPS\x20origin'},{'name':a61_0x4f3305(0x163),'type':'string','description':a61_0x4f3305(0x156)},{'name':a61_0x4f3305(0x162),'type':'string','description':a61_0x4f3305(0x157)},{'name':'local-domain','type':'string','description':a61_0x4f3305(0x153)},{'name':a61_0x4f3305(0x151),'type':a61_0x4f3305(0x171),'description':a61_0x4f3305(0x145)}];async function resolveRegion(_0x58f41f){const _0x4b08c5=a61_0x4f3305,_0x4c38a5=_0x58f41f[_0x4b08c5(0x175)](_0x4b08c5(0x154));if(_0x4c38a5){if(!isEnabledLovrabetRegion(_0x4c38a5))throw CliErrors[_0x4b08c5(0x16c)](_0x4b08c5(0x169)+_0x4c38a5+_0x4b08c5(0x15d),'Available\x20regions:\x20'+ENABLED_LOVRABET_REGION_VALUES[_0x4b08c5(0x149)](',\x20'));return _0x4c38a5;}if(_0x58f41f[_0x4b08c5(0x14a)])return DEFAULT_LOVRABET_REGION;try{return await select({'message':_0x4b08c5(0x13e),'default':DEFAULT_LOVRABET_REGION,'choices':ENABLED_LOVRABET_REGION_VALUES[_0x4b08c5(0x14f)](_0x23653a=>({'name':getOfficialRoutingProfile(_0x23653a)[_0x4b08c5(0x14d)]+'\x20('+_0x23653a+')','value':_0x23653a}))});}catch(_0x3661dc){if(_0x3661dc?.[_0x4b08c5(0x158)]==='ExitPromptError')throw CliErrors[_0x4b08c5(0x147)]();throw _0x3661dc;}}export async function executeConfigInit(_0x32e9a2){const _0x2ed136=a61_0x4f3305,_0xa8ce56=resolveDomainConfigInput(_0x32e9a2),_0x36bd92=_0xa8ce56[_0x2ed136(0x160)],_0x285b42=Object['keys'](_0x36bd92)[_0x2ed136(0x164)]>0x0;if(_0x285b42&&_0x32e9a2['str'](_0x2ed136(0x154)))throw CliErrors[_0x2ed136(0x16c)]('Choose\x20either\x20an\x20official\x20region\x20or\x20independent-deployment\x20Domains,\x20not\x20both.');if(!!_0x36bd92[_0x2ed136(0x155)]!==!!_0x36bd92[_0x2ed136(0x141)])throw CliErrors[_0x2ed136(0x16c)](_0x2ed136(0x152));const _0x4121e0=_0x32e9a2['bool']('global')?_0x2ed136(0x14e):_0x2ed136(0x16f),_0x328d9b=readScopedConfig(_0x4121e0);for(const _0x3e8348 of DOMAIN_CONFIG_FIELDS)delete _0x328d9b[_0x3e8348];for(const _0x152035 of LEGACY_DOMAIN_CONFIG_FIELDS)delete _0x328d9b[_0x152035];delete _0x328d9b[_0x2ed136(0x172)];let _0x3e696c=null;if(_0x285b42)delete _0x328d9b[_0x2ed136(0x154)],_0xa8ce56[_0x2ed136(0x16d)]===_0x2ed136(0x165)?_0x328d9b[_0x2ed136(0x172)]={'protocol':ENTERPRISE_ROUTING_PROTOCOL,'kind':ENTERPRISE_ROUTING_KIND,'domains':_0xa8ce56[_0x2ed136(0x13d)],'cdn':_0xa8ce56[_0x2ed136(0x143)]}:Object[_0x2ed136(0x148)](_0x328d9b,_0x36bd92);else{_0x3e696c=await resolveRegion(_0x32e9a2);if(_0x3e696c===DEFAULT_LOVRABET_REGION)delete _0x328d9b[_0x2ed136(0x154)];else _0x328d9b[_0x2ed136(0x154)]=_0x3e696c;}return writeScopedConfig(_0x328d9b,_0x4121e0),{'ok':!![],'message':_0x285b42?'Rabetbase\x20connection\x20configured\x20for\x20independent\x20deployment.\x20Domains:\x20'+Object[_0x2ed136(0x15c)](_0xa8ce56[_0x2ed136(0x16d)]==='enterprise-v1'?_0xa8ce56[_0x2ed136(0x13d)]:_0x36bd92)[_0x2ed136(0x149)](',\x20')+'.':'Rabetbase\x20connection\x20configured\x20for\x20region:\x20'+_0x3e696c+'.','data':{'mode':_0x285b42?_0x2ed136(0x173):_0x2ed136(0x168),'protocol':_0xa8ce56['mode']===_0x2ed136(0x165)?ENTERPRISE_ROUTING_PROTOCOL:undefined,'region':_0x3e696c,'domains':_0x36bd92,'cdn':_0xa8ce56[_0x2ed136(0x16d)]===_0x2ed136(0x165)?_0xa8ce56[_0x2ed136(0x143)]:undefined}};}export const configInitDefinition={'service':a61_0x4f3305(0x15a),'command':'init','description':a61_0x4f3305(0x144),'risk':'write','confirmationDescription':a61_0x4f3305(0x15b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':configInitFlags,'execute':executeConfigInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a62_0x285ce2=a62_0x355f;function a62_0x171c(){const _0x361a9f=['70890UrEedz','9hnOQtK','global','config','List\x20all\x20config\x20values','1560210RpWUBW','38236168Dffyqh','list','8064444YPtOgV','3404884RZtmsh','boolean','3fcRAqW','4508760xFyrqv','read','2153720gVkWVD'];a62_0x171c=function(){return _0x361a9f;};return a62_0x171c();}(function(_0x49830f,_0x160b77){const _0x1136b7=a62_0x355f,_0x4de1fe=_0x49830f();while(!![]){try{const _0x5025fe=parseInt(_0x1136b7(0x9c))/0x1+parseInt(_0x1136b7(0xa1))/0x2*(-parseInt(_0x1136b7(0x98))/0x3)+-parseInt(_0x1136b7(0x99))/0x4+-parseInt(_0x1136b7(0x9b))/0x5+-parseInt(_0x1136b7(0x95))/0x6+-parseInt(_0x1136b7(0x96))/0x7+parseInt(_0x1136b7(0xa2))/0x8*(parseInt(_0x1136b7(0x9d))/0x9);if(_0x5025fe===_0x160b77)break;else _0x4de1fe['push'](_0x4de1fe['shift']());}catch(_0x23a131){_0x4de1fe['push'](_0x4de1fe['shift']());}}}(a62_0x171c,0xa679e));import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';function a62_0x355f(_0xd8d6e9,_0x8d1754){_0xd8d6e9=_0xd8d6e9-0x94;const _0x171c1d=a62_0x171c();let _0x355f92=_0x171c1d[_0xd8d6e9];return _0x355f92;}async function execute(_0x2c5248){const _0x282db=a62_0x355f,_0x4b6bd0=_0x2c5248['bool'](_0x282db(0x9e))?readScopedConfig('global'):readConfig();return{'ok':!![],'data':_0x4b6bd0};}export const configListDefinition={'service':a62_0x285ce2(0x9f),'command':a62_0x285ce2(0x94),'description':a62_0x285ce2(0xa0),'risk':a62_0x285ce2(0x9a),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a62_0x285ce2(0x9e),'type':a62_0x285ce2(0x97),'description':'Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0x46a039=a63_0x3aee;function a63_0x1d3f(){const _0x1a3be9=['Missing\x20key.','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','\x22.\x20Allowed:\x20','850496heJzua','\x20workspace\x20use\x20--app\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.','3880GxqBDS','env','object','6FMnMzw','app','validation','Top-level\x20key\x20\x22','Set\x20a\x20config\x20value','Settable\x20top-level\x20keys:\x20','\x20appcode\x20set\x20to:\x20','Usage:\x20','Config\x20value\x20is\x20invalid\x20or\x20too\x20long.','locale','4765sUzNvm','Project','16523451HKPACw','key','string','length','includes','\x20set\x20to:\x20','apps','config','value','str','Invalid\x20value\x20for\x20\x22','1265162umADDf','boolean','riskLevel','Global','Config\x20value','global','write','4533712skarUT','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','\x20workspace\x20add\x20<name>\x20--appcode\x20','Use\x20`','\x22\x20is\x20not\x20settable.','set','4771445vFetDF','appcode','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','88941YtWiPF','bool','\x20(stored\x20as\x20a\x20single\x20app\x20profile)','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','`,\x20`'];a63_0x1d3f=function(){return _0x1a3be9;};return a63_0x1d3f();}(function(_0x26cb77,_0x2bd940){const _0x4f0649=a63_0x3aee,_0x1b25c4=_0x26cb77();while(!![]){try{const _0x219769=-parseInt(_0x4f0649(0x9a))/0x1+parseInt(_0x4f0649(0xb6))/0x2+-parseInt(_0x4f0649(0x92))/0x3+parseInt(_0x4f0649(0x9c))/0x4*(-parseInt(_0x4f0649(0xa9))/0x5)+parseInt(_0x4f0649(0x9f))/0x6*(-parseInt(_0x4f0649(0xc3))/0x7)+parseInt(_0x4f0649(0xbd))/0x8+parseInt(_0x4f0649(0xab))/0x9;if(_0x219769===_0x2bd940)break;else _0x1b25c4['push'](_0x1b25c4['shift']());}catch(_0x22cb1d){_0x1b25c4['push'](_0x1b25c4['shift']());}}}(a63_0x1d3f,0x860b6));import{CliErrors}from'../../errors.js';function a63_0x3aee(_0x58e208,_0x120780){_0x58e208=_0x58e208-0x92;const _0x1d3f03=a63_0x1d3f();let _0x3aee33=_0x1d3f03[_0x58e208];return _0x3aee33;}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';import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';import{DOMAIN_CONFIG_FIELDS,normalizeDomainOrigin}from'../../config/domain-config.js';async function execute(_0x172993){const _0x525517=a63_0x3aee,_0x266842=_0x172993[_0x525517(0xb4)](_0x525517(0xac)),_0xb31b6d=_0x172993[_0x525517(0xb4)](_0x525517(0xb3));if(!_0x266842)throw CliErrors['validation'](_0x525517(0x97),_0x525517(0xa6)+CLI_BIN_NAME+'\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>');if(_0xb31b6d===undefined||_0xb31b6d==='')throw CliErrors[_0x525517(0xa1)]('Missing\x20value.','Usage:\x20'+CLI_BIN_NAME+_0x525517(0x98));let _0x44136f=_0x266842,_0x22a6a5=_0xb31b6d;if(_0xb31b6d['length']>0x1f4)throw CliErrors[_0x525517(0xa1)](_0x525517(0xa7));if(_0x266842===_0x525517(0xb8))throw CliErrors[_0x525517(0xa1)](_0x525517(0xbe));if(!isTopLevelConfigKey(_0x266842))throw CliErrors[_0x525517(0xa1)](_0x525517(0xa2)+_0x266842+_0x525517(0xc1),_0x525517(0xa4)+getTopLevelConfigKeySummary());if(CONFIG_ENUM_VALUES[_0x266842]&&!CONFIG_ENUM_VALUES[_0x266842][_0x525517(0xaf)](_0xb31b6d))throw CliErrors['validation'](_0x525517(0xb5)+_0x266842+_0x525517(0x99)+CONFIG_ENUM_VALUES[_0x266842]['join'](',\x20'));if(_0x266842===_0x525517(0xa8)&&!normalizeLocale(_0xb31b6d))throw CliErrors[_0x525517(0xa1)]('Invalid\x20locale\x20value.',_0x525517(0x95));DOMAIN_CONFIG_FIELDS[_0x525517(0xaf)](_0x266842)&&(_0x22a6a5=normalizeDomainOrigin(_0x266842,_0xb31b6d));const _0x5ebd1a={'global':_0x172993[_0x525517(0x93)](_0x525517(0xbb))},_0xf6e9e7=resolveWriteScope(_0x5ebd1a),_0x58bee4=readScopedConfig(_0xf6e9e7);_0x266842===_0x525517(0xa0)&&(_0x44136f=_0x525517(0xc4),delete _0x58bee4[_0x525517(0xa0)]);_0x266842===_0x525517(0xa8)&&(_0x22a6a5=normalizeLocale(_0xb31b6d));if(_0x266842===_0x525517(0x9d)){_0x22a6a5=normalizeEnv(_0xb31b6d);if(!isProduction(_0x22a6a5)&&!isDaily(_0x22a6a5))throw CliErrors[_0x525517(0xa1)](_0x525517(0xc5),'Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.');}if(_0x266842===_0x525517(0xc4)){const _0x54fce=_0x58bee4[_0x525517(0xb1)]&&typeof _0x58bee4[_0x525517(0xb1)]===_0x525517(0x9e)?Object['keys'](_0x58bee4[_0x525517(0xb1)]):[];if(_0x54fce[_0x525517(0xae)]>0x0)throw CliErrors['validation']('Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.',_0x525517(0xc0)+CLI_BIN_NAME+_0x525517(0xbf)+_0x22a6a5+_0x525517(0x96)+CLI_BIN_NAME+_0x525517(0x9b));const _0xe37ad=buildCanonicalProjectConfig({..._0x58bee4},{'appCodes':[_0x22a6a5],'env':typeof _0x58bee4[_0x525517(0x9d)]===_0x525517(0xad)?_0x58bee4[_0x525517(0x9d)]:undefined});writeScopedConfig(_0xe37ad,_0xf6e9e7);const _0x49a985=_0xf6e9e7===_0x525517(0xbb)?_0x525517(0xb9):_0x525517(0xaa);return{'ok':!![],'message':'✓\x20'+_0x49a985+_0x525517(0xa5)+_0x22a6a5+_0x525517(0x94)};}_0x58bee4[_0x44136f]=_0x22a6a5,writeScopedConfig(_0x58bee4,_0xf6e9e7);const _0x34a6cd=_0xf6e9e7===_0x525517(0xbb)?_0x525517(0xb9):'Project';return{'ok':!![],'message':'✓\x20'+_0x34a6cd+'\x20'+_0x44136f+_0x525517(0xb0)+_0x22a6a5};}export const configSetDefinition={'service':a63_0x46a039(0xb2),'command':a63_0x46a039(0xc2),'description':a63_0x46a039(0xa3),'risk':a63_0x46a039(0xbc),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'key','type':a63_0x46a039(0xad),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a63_0x46a039(0xb3),'type':'string','description':a63_0x46a039(0xba),'required':!![]},{'name':a63_0x46a039(0xbb),'type':a63_0x46a039(0xb7),'description':'Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5921a8,_0x113e8e){var _0x5a6c24=a64_0x3f39,_0x1cc378=_0x5921a8();while(!![]){try{var _0x4b1509=-parseInt(_0x5a6c24(0x16a))/0x1+parseInt(_0x5a6c24(0x16d))/0x2*(-parseInt(_0x5a6c24(0x16e))/0x3)+parseInt(_0x5a6c24(0x164))/0x4+parseInt(_0x5a6c24(0x167))/0x5*(parseInt(_0x5a6c24(0x168))/0x6)+-parseInt(_0x5a6c24(0x166))/0x7*(parseInt(_0x5a6c24(0x16c))/0x8)+parseInt(_0x5a6c24(0x161))/0x9+parseInt(_0x5a6c24(0x15f))/0xa*(parseInt(_0x5a6c24(0x160))/0xb);if(_0x4b1509===_0x113e8e)break;else _0x1cc378['push'](_0x1cc378['shift']());}catch(_0x5131ea){_0x1cc378['push'](_0x1cc378['shift']());}}}(a64_0xa649,0x263c4));function a64_0xa649(){var _0x33a233=['validation','200848StxcZR','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','7HcesRo','45515EAjqwS','66naVpyA','global','159178fguMal','project','886216BsbaTk','16qaaVaI','14277JueRLu','10oUPdtf','1064107EHzjOp','1958013pQvkoZ','\x20workspace\x20init\x20--appcode\x20<code>`\x20first.'];a64_0xa649=function(){return _0x33a233;};return a64_0xa649();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';import{CliErrors}from'../../errors.js';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(_0x5ab588){var _0x2bfe67=a64_0x3f39;if(_0x5ab588[_0x2bfe67(0x169)])return _0x2bfe67(0x169);if(!isInProject())throw CliErrors[_0x2bfe67(0x163)]('Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).',_0x2bfe67(0x165)+CLI_BIN_NAME+_0x2bfe67(0x162));return _0x2bfe67(0x16b);}function a64_0x3f39(_0x4206e7,_0x2b8214){_0x4206e7=_0x4206e7-0x15f;var _0xa64958=a64_0xa649();var _0x3f395f=_0xa64958[_0x4206e7];return _0x3f395f;}export function readScopedConfig(_0x2c00d0){return readConfigFile(resolveWriteConfigPath(_0x2c00d0));}export function writeScopedConfig(_0x494e99,_0x511ebd){writeConfigFile(resolveWriteConfigPath(_0x511ebd),_0x494e99);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a65_0x40be2e=a65_0x58f4;(function(_0x3803ab,_0xf3d775){const _0x335de1=a65_0x58f4,_0x33351c=_0x3803ab();while(!![]){try{const _0x5abd0b=parseInt(_0x335de1(0x152))/0x1*(-parseInt(_0x335de1(0x161))/0x2)+parseInt(_0x335de1(0x13f))/0x3+-parseInt(_0x335de1(0x111))/0x4*(-parseInt(_0x335de1(0x12a))/0x5)+parseInt(_0x335de1(0x11f))/0x6+parseInt(_0x335de1(0x16f))/0x7+parseInt(_0x335de1(0x118))/0x8*(parseInt(_0x335de1(0x16c))/0x9)+-parseInt(_0x335de1(0x17e))/0xa*(parseInt(_0x335de1(0x174))/0xb);if(_0x5abd0b===_0xf3d775)break;else _0x33351c['push'](_0x33351c['shift']());}catch(_0x149c50){_0x33351c['push'](_0x33351c['shift']());}}}(a65_0x17b0,0x9b28d));import{CliErrors}from'../../errors.js';const LOCAL_KEY=/^[a-z][a-z0-9_]{0,63}$/,SUPPORTED_CARDINALITIES=new Set([a65_0x40be2e(0x126),a65_0x40be2e(0x155)]),SUPPORTED_FIELD_TYPES=new Set([a65_0x40be2e(0x11c),'NUMBER',a65_0x40be2e(0x167),a65_0x40be2e(0x146),a65_0x40be2e(0x170),a65_0x40be2e(0x132),a65_0x40be2e(0x17f),a65_0x40be2e(0x130),'ADDRESS',a65_0x40be2e(0x17c)]);export function isDatasetBatchDesign(_0x3abc2c){const _0x5e974c=a65_0x40be2e;return isObject(_0x3abc2c)&&_0x3abc2c[_0x5e974c(0x136)]==='dataset-batch';}export function validateDatasetBatchDesign(_0x489687){const _0x5411b2=a65_0x40be2e;(!isObject(_0x489687)||_0x489687['kind']!==_0x5411b2(0x163))&&fail(_0x5411b2(0x10f));_0x489687[_0x5411b2(0x144)]!==0x1&&fail(_0x5411b2(0x15d));const _0x4ee7ce=objectArray(_0x489687[_0x5411b2(0x129)],_0x5411b2(0x129),0x1,0x14),_0x305cfe=objectArray(_0x489687[_0x5411b2(0x11b)],_0x5411b2(0x11b),0x0,0xc8),_0x571bb3=objectArray(_0x489687[_0x5411b2(0x178)],'unresolvedRelations',0x0,0xc8),_0x52fe5f=new Set(),_0x272656=new Map();for(const [_0x3e65dc,_0x23d628]of _0x4ee7ce['entries']()){const _0x252298=requiredString(_0x23d628['localKey'],_0x5411b2(0x12d)+_0x3e65dc+_0x5411b2(0x164));!LOCAL_KEY[_0x5411b2(0x145)](_0x252298)&&fail('datasets['+_0x3e65dc+_0x5411b2(0x180)+LOCAL_KEY[_0x5411b2(0x12e)]+'.');_0x52fe5f[_0x5411b2(0x11a)](_0x252298)&&fail(_0x5411b2(0x115));_0x52fe5f['add'](_0x252298);!isObject(_0x23d628[_0x5411b2(0x175)])&&fail(_0x5411b2(0x12d)+_0x3e65dc+_0x5411b2(0x14c));rejectServerDatasetIdentity(_0x23d628[_0x5411b2(0x175)],'datasets['+_0x3e65dc+_0x5411b2(0x15b));if(!isObject(_0x23d628[_0x5411b2(0x175)][_0x5411b2(0x10e)]))fail(_0x5411b2(0x12d)+_0x3e65dc+_0x5411b2(0x17a));rejectServerDatasetIdentity(_0x23d628[_0x5411b2(0x175)][_0x5411b2(0x10e)],_0x5411b2(0x12d)+_0x3e65dc+_0x5411b2(0x12b)),requiredString(_0x23d628[_0x5411b2(0x175)][_0x5411b2(0x10e)][_0x5411b2(0x162)],_0x5411b2(0x12d)+_0x3e65dc+_0x5411b2(0x172));_0x5411b2(0x11b)in _0x23d628[_0x5411b2(0x175)]&&(!Array['isArray'](_0x23d628[_0x5411b2(0x175)][_0x5411b2(0x11b)])||_0x23d628[_0x5411b2(0x175)][_0x5411b2(0x11b)][_0x5411b2(0x15e)]!==0x0)&&fail(_0x5411b2(0x12d)+_0x3e65dc+_0x5411b2(0x13a));const _0x40c0ec=objectArray(_0x23d628['design'][_0x5411b2(0x128)],_0x5411b2(0x12d)+_0x3e65dc+_0x5411b2(0x125),0x1,0xc8),_0x57b90d=new Map();for(const [_0x45af29,_0x6294c3]of _0x40c0ec[_0x5411b2(0x120)]()){const _0x147b3a=fieldName(_0x6294c3);if(!_0x147b3a)fail(_0x5411b2(0x12d)+_0x3e65dc+'].design.fields['+_0x45af29+_0x5411b2(0x11d));const _0x3e09d9=_0x147b3a[_0x5411b2(0x149)]();if(_0x57b90d[_0x5411b2(0x11a)](_0x3e09d9))fail(_0x5411b2(0x14f)+_0x252298+_0x5411b2(0x12f));const _0x28bb9a=stringValue(_0x6294c3[_0x5411b2(0x166)]??_0x6294c3[_0x5411b2(0x114)])[_0x5411b2(0x143)]();if(!SUPPORTED_FIELD_TYPES['has'](_0x28bb9a))fail('datasets['+_0x3e65dc+_0x5411b2(0x157)+_0x45af29+_0x5411b2(0x16a));_0x57b90d['set'](_0x3e09d9,_0x28bb9a),[_0x6294c3[_0x5411b2(0x153)],_0x6294c3[_0x5411b2(0x13c)],_0x6294c3[_0x5411b2(0x173)]][_0x5411b2(0x124)](_0x187684=>stringValue(_0x187684))&&fail(_0x5411b2(0x12d)+_0x3e65dc+_0x5411b2(0x157)+_0x45af29+_0x5411b2(0x119));}_0x272656['set'](_0x252298,_0x57b90d);}const _0x5caa75=new Set(),_0x13fe77=new Set();for(const [_0x34d8b0,_0x1d0b41]of _0x305cfe['entries']()){const _0x27273a=validateRelation(_0x1d0b41,_0x34d8b0,_0x52fe5f,_0x272656);if(_0x5caa75[_0x5411b2(0x11a)](_0x27273a))fail(_0x5411b2(0x154));_0x5caa75[_0x5411b2(0x13b)](_0x27273a);const _0x9db294=_0x27273a[_0x5411b2(0x15c)]('\x00',0x2)[_0x5411b2(0x16b)]('\x00');if(_0x13fe77[_0x5411b2(0x11a)](_0x9db294))fail('Each\x20source\x20field\x20may\x20target\x20at\x20most\x20one\x20relation.');_0x13fe77['add'](_0x9db294);}for(const [_0x1b373b,_0x7444dc]of _0x571bb3[_0x5411b2(0x120)]()){requiredString(_0x7444dc['reason'],_0x5411b2(0x165)+_0x1b373b+_0x5411b2(0x14e)),validateConfidence(_0x7444dc[_0x5411b2(0x122)],_0x5411b2(0x165)+_0x1b373b+_0x5411b2(0x17b));}return _0x489687;}export function reconcileBatchResult(_0x438f11){const _0x30f0b4=a65_0x40be2e;if(!isObject(_0x438f11))return null;try{const _0x4988e2=stringArray(_0x438f11['expectedLocalKeys'],_0x30f0b4(0x179),0x1,0x14),_0x16d76c=new Set(_0x4988e2);if(_0x16d76c[_0x30f0b4(0x15f)]!==_0x4988e2[_0x30f0b4(0x15e)]||_0x4988e2[_0x30f0b4(0x124)](_0xf73c28=>!LOCAL_KEY[_0x30f0b4(0x145)](_0xf73c28)))return null;const _0x369bd6=objectArray(_0x438f11[_0x30f0b4(0x133)],_0x30f0b4(0x133),0x1,0x14),_0x1a3513=new Map(),_0x44a9ca=new Set();for(const _0x5d9b18 of _0x369bd6){const _0x1f20a7=requiredString(_0x5d9b18[_0x30f0b4(0x14b)],_0x30f0b4(0x13d)),_0x2d03ee=requiredString(_0x5d9b18[_0x30f0b4(0x140)]??_0x5d9b18[_0x30f0b4(0x121)],_0x30f0b4(0x117));if(_0x1a3513['has'](_0x1f20a7)||_0x44a9ca[_0x30f0b4(0x11a)](_0x2d03ee))return null;_0x1a3513[_0x30f0b4(0x138)](_0x1f20a7,_0x2d03ee),_0x44a9ca[_0x30f0b4(0x13b)](_0x2d03ee);}if(!sameSet(_0x16d76c,new Set(_0x1a3513['keys']())))return null;const _0x228cb5=objectArray(_0x438f11[_0x30f0b4(0x177)],_0x30f0b4(0x177),0x0,0xc8),_0x16b216=objectArray(_0x438f11['createdRelations'],_0x30f0b4(0x171),0x0,0xc8),_0x493d21=relationTupleSet(_0x228cb5,![],_0x1a3513),_0xb32102=relationTupleSet(_0x16b216,!![],_0x1a3513);if(!_0x493d21||!_0xb32102||!sameSet(_0x493d21,_0xb32102))return null;const _0x3ccd83=objectArray(_0x438f11[_0x30f0b4(0x178)],_0x30f0b4(0x178),0x0,0xc8);return{'expectedLocalKeys':_0x4988e2,'expectedRelations':_0x228cb5,'createdDatasets':_0x369bd6,'createdRelations':_0x16b216,'unresolvedRelations':_0x3ccd83,...isObject(_0x438f11['metrics'])?{'metrics':_0x438f11['metrics']}:{}};}catch{return null;}}function validateRelation(_0x4c034a,_0x1c93b9,_0x2b21da,_0x504d5d){const _0x44463d=a65_0x40be2e,_0x147772='relations['+_0x1c93b9+']',_0xe9e2b9=requiredString(_0x4c034a['fromDatasetKey'],_0x147772+_0x44463d(0x15a)),_0x56b5be=requiredString(_0x4c034a['toDatasetKey'],_0x147772+_0x44463d(0x112)),_0x50891e=requiredString(_0x4c034a[_0x44463d(0x147)],_0x147772+'.fromField')[_0x44463d(0x149)](),_0x59f4e6=requiredString(_0x4c034a[_0x44463d(0x16d)],_0x147772+_0x44463d(0x13e))['toLowerCase']();if(!_0x2b21da[_0x44463d(0x11a)](_0xe9e2b9)||!_0x2b21da[_0x44463d(0x11a)](_0x56b5be))fail(_0x147772+_0x44463d(0x176));const _0x24d9ef=_0x504d5d[_0x44463d(0x141)](_0xe9e2b9)?.[_0x44463d(0x141)](_0x50891e),_0x1d867c=_0x504d5d[_0x44463d(0x141)](_0x56b5be)?.[_0x44463d(0x141)](_0x59f4e6);if(_0x24d9ef===undefined||_0x1d867c===undefined)fail(_0x147772+'\x20references\x20an\x20unknown\x20field.');if(_0x24d9ef&&_0x1d867c&&_0x24d9ef!==_0x1d867c)fail(_0x147772+_0x44463d(0x151));const _0x5f35ff=stringValue(_0x4c034a[_0x44463d(0x10d)])||'lookup';if(_0x5f35ff!==_0x44463d(0x12c))fail(_0x147772+'.relationType\x20must\x20be\x20\x22lookup\x22.');const _0x197195=stringValue(_0x4c034a[_0x44463d(0x148)])||_0x44463d(0x126);if(!SUPPORTED_CARDINALITIES[_0x44463d(0x11a)](_0x197195))fail(_0x147772+_0x44463d(0x139));return requiredString(_0x4c034a[_0x44463d(0x142)],_0x147772+_0x44463d(0x150)),validateConfidence(_0x4c034a[_0x44463d(0x122)],_0x147772+'.confidence'),tuple(_0xe9e2b9,_0x50891e,_0x56b5be,_0x59f4e6,_0x44463d(0x12c),_0x197195);}function relationTupleSet(_0x1f4057,_0x4f8901,_0x21000d){const _0x44f768=a65_0x40be2e,_0x1c05fb=new Set();for(const _0x414afd of _0x1f4057){const _0xe4745=stringValue(_0x414afd[_0x44f768(0x14a)]),_0x4d28a4=stringValue(_0x414afd[_0x44f768(0x17d)]),_0xa4e56a=stringValue(_0x414afd[_0x44f768(0x147)])['toLowerCase'](),_0x310888=stringValue(_0x414afd[_0x44f768(0x16d)])[_0x44f768(0x149)](),_0x319224=stringValue(_0x414afd[_0x44f768(0x10d)]),_0x1707b4=stringValue(_0x414afd[_0x44f768(0x148)]);if(!_0xe4745||!_0x4d28a4||!_0xa4e56a||!_0x310888||_0x319224!==_0x44f768(0x12c)||!SUPPORTED_CARDINALITIES[_0x44f768(0x11a)](_0x1707b4))return null;if(!_0x21000d[_0x44f768(0x11a)](_0xe4745)||!_0x21000d['has'](_0x4d28a4))return null;if(_0x4f8901&&(stringValue(_0x414afd['fromDatasetCode'])!==_0x21000d[_0x44f768(0x141)](_0xe4745)||stringValue(_0x414afd[_0x44f768(0x134)])!==_0x21000d[_0x44f768(0x141)](_0x4d28a4)))return null;const _0x1b9fa5=tuple(_0xe4745,_0xa4e56a,_0x4d28a4,_0x310888,_0x319224,_0x1707b4);if(_0x1c05fb['has'](_0x1b9fa5))return null;_0x1c05fb[_0x44f768(0x13b)](_0x1b9fa5);}return _0x1c05fb;}function rejectServerDatasetIdentity(_0x3cd403,_0x50a950){const _0x3fcba7=a65_0x40be2e;for(const _0x363191 of['id',_0x3fcba7(0x169),_0x3fcba7(0x159),_0x3fcba7(0x140),'datasetCode',_0x3fcba7(0x137)]){if(_0x3cd403[_0x363191]!==undefined&&_0x3cd403[_0x363191]!==null&&_0x3cd403[_0x363191]!=='')fail(_0x50a950+'.'+_0x363191+_0x3fcba7(0x127));}}function a65_0x58f4(_0x3bc290,_0x29837a){_0x3bc290=_0x3bc290-0x10d;const _0x17b06e=a65_0x17b0();let _0x58f4aa=_0x17b06e[_0x3bc290];return _0x58f4aa;}function a65_0x17b0(){const _0x2cf9ac=['some','].design.fields','MANY_TO_ONE','\x20must\x20not\x20be\x20supplied\x20by\x20the\x20client.','fields','datasets','5aswecp','].design.dataset','lookup','datasets[','source','\x20field\x20names\x20must\x20be\x20unique\x20ignoring\x20case.','USER','object','MULTI_SELECT','createdDatasets','toDatasetCode','\x20objects.','kind','modelCode','set','.cardinality\x20is\x20not\x20supported.','].design.relations\x20must\x20be\x20an\x20empty\x20array;\x20use\x20top-level\x20relations.','add','refTableField','createdDatasets[].localKey','.toField','695190jWSJse','code','get','reason','toUpperCase','schemaVersion','test','BOOLEAN','fromField','cardinality','toLowerCase','fromDatasetKey','localKey','].design\x20must\x20be\x20an\x20object.','fieldName','].reason','Dataset\x20','.reason','\x20connects\x20incompatible\x20field\x20types.','163653reqDbV','refTable','Dataset\x20batch\x20relations\x20must\x20be\x20unique.','ONE_TO_ONE','trim','].design.fields[','isFinite','modelId','.fromDatasetKey','].design','split','Dataset\x20batch\x20schemaVersion\x20must\x20be\x201.','length','size','\x20is\x20required.','10HiBWWB','datasetName','dataset-batch','].localKey','unresolvedRelations[','type','DATETIME','every','datasetId','].type\x20is\x20not\x20supported.','join','1143gCdvAG','toField','isArray','2677479HrRuWV','SELECT','createdRelations','].design.dataset.datasetName','refTableLabelField','1254YwhtNu','design','\x20references\x20an\x20unknown\x20dataset\x20localKey.','expectedRelations','unresolvedRelations','expectedLocalKeys','].design.dataset\x20must\x20be\x20an\x20object.','].confidence','UPLOAD','toDatasetKey','92510VmwqBA','DATE_RANGE','].localKey\x20must\x20match\x20','relationType','dataset','Batch\x20--design-file\x20must\x20have\x20kind\x20\x22dataset-batch\x22.','map','1216232rNXEku','.toDatasetKey','\x20must\x20contain\x20','fieldType','Dataset\x20batch\x20localKey\x20values\x20must\x20be\x20unique.','string','createdDatasets[].code','53744DQitXi',']\x20must\x20not\x20contain\x20embedded\x20relation\x20references.','has','relations','TEXT',']\x20must\x20have\x20a\x20non-empty\x20name\x20or\x20code.','fieldCode','4421646aJhFCB','entries','datasetCode','confidence','name'];a65_0x17b0=function(){return _0x2cf9ac;};return a65_0x17b0();}function objectArray(_0x1c85b9,_0x593580,_0x433544,_0x3298bd){const _0x39b434=a65_0x40be2e;return(!Array['isArray'](_0x1c85b9)||_0x1c85b9[_0x39b434(0x15e)]<_0x433544||_0x1c85b9[_0x39b434(0x15e)]>_0x3298bd||_0x1c85b9[_0x39b434(0x124)](_0x4788d2=>!isObject(_0x4788d2)))&&fail(_0x593580+_0x39b434(0x113)+_0x433544+'..'+_0x3298bd+_0x39b434(0x135)),_0x1c85b9;}function stringArray(_0x4df20e,_0x504b6a,_0x577be7,_0xadbd21){const _0x5dd16f=a65_0x40be2e;return(!Array['isArray'](_0x4df20e)||_0x4df20e[_0x5dd16f(0x15e)]<_0x577be7||_0x4df20e[_0x5dd16f(0x15e)]>_0xadbd21||_0x4df20e[_0x5dd16f(0x124)](_0x38753f=>typeof _0x38753f!==_0x5dd16f(0x116)||!_0x38753f['trim']()))&&fail(_0x504b6a+_0x5dd16f(0x113)+_0x577be7+'..'+_0xadbd21+'\x20non-empty\x20strings.'),_0x4df20e;}function requiredString(_0x2f6a61,_0x2c2649){const _0x441d8f=a65_0x40be2e,_0x3347be=stringValue(_0x2f6a61);if(!_0x3347be)fail(_0x2c2649+_0x441d8f(0x160));return _0x3347be;}function stringValue(_0x4382ae){const _0x32fedb=a65_0x40be2e;return typeof _0x4382ae===_0x32fedb(0x116)?_0x4382ae[_0x32fedb(0x156)]():'';}function fieldName(_0x5eb3a5){const _0x53916f=a65_0x40be2e;return stringValue(_0x5eb3a5[_0x53916f(0x140)]??_0x5eb3a5[_0x53916f(0x11e)]??_0x5eb3a5[_0x53916f(0x123)]??_0x5eb3a5[_0x53916f(0x14d)]);}function validateConfidence(_0x51fea5,_0x1cb6aa){const _0x219250=a65_0x40be2e;_0x51fea5!==undefined&&_0x51fea5!==null&&(typeof _0x51fea5!=='number'||!Number[_0x219250(0x158)](_0x51fea5)||_0x51fea5<0x0||_0x51fea5>0x1)&&fail(_0x1cb6aa+'\x20must\x20be\x20between\x200\x20and\x201.');}function tuple(..._0x44a8e8){const _0x4bb0da=a65_0x40be2e;return _0x44a8e8[_0x4bb0da(0x110)]((_0x20e1f5,_0x1b6391)=>_0x1b6391===0x1||_0x1b6391===0x3?_0x20e1f5['toLowerCase']():_0x20e1f5)[_0x4bb0da(0x16b)]('\x00');}function sameSet(_0xe0e202,_0x55d05c){const _0x5b0943=a65_0x40be2e;return _0xe0e202[_0x5b0943(0x15f)]===_0x55d05c[_0x5b0943(0x15f)]&&[..._0xe0e202][_0x5b0943(0x168)](_0x8bbfd8=>_0x55d05c[_0x5b0943(0x11a)](_0x8bbfd8));}function isObject(_0x22c497){const _0x1eee84=a65_0x40be2e;return typeof _0x22c497===_0x1eee84(0x131)&&_0x22c497!==null&&!Array[_0x1eee84(0x16e)](_0x22c497);}function fail(_0x49433d){throw CliErrors['validation'](_0x49433d);}
|
|
1
|
+
const a65_0x4f5b8f=a65_0x2e94;(function(_0xe6a949,_0x3096b9){const _0x41a864=a65_0x2e94,_0x36c75c=_0xe6a949();while(!![]){try{const _0x259d2e=-parseInt(_0x41a864(0x1fc))/0x1+parseInt(_0x41a864(0x1aa))/0x2+-parseInt(_0x41a864(0x1bc))/0x3*(parseInt(_0x41a864(0x1bf))/0x4)+-parseInt(_0x41a864(0x1ac))/0x5*(-parseInt(_0x41a864(0x1e1))/0x6)+parseInt(_0x41a864(0x1f5))/0x7+parseInt(_0x41a864(0x1a1))/0x8*(parseInt(_0x41a864(0x191))/0x9)+-parseInt(_0x41a864(0x1bb))/0xa;if(_0x259d2e===_0x3096b9)break;else _0x36c75c['push'](_0x36c75c['shift']());}catch(_0x2228a1){_0x36c75c['push'](_0x36c75c['shift']());}}}(a65_0x2d22,0xd2a22));import{CliErrors}from'../../errors.js';const LOCAL_KEY=/^[a-z][a-z0-9_]{0,63}$/,SUPPORTED_CARDINALITIES=new Set([a65_0x4f5b8f(0x1bd),a65_0x4f5b8f(0x1ed)]),SUPPORTED_FIELD_TYPES=new Set([a65_0x4f5b8f(0x1cf),a65_0x4f5b8f(0x1c0),a65_0x4f5b8f(0x1d7),a65_0x4f5b8f(0x1ce),a65_0x4f5b8f(0x1a5),'MULTI_SELECT',a65_0x4f5b8f(0x1d1),a65_0x4f5b8f(0x198),a65_0x4f5b8f(0x1d5),a65_0x4f5b8f(0x1b9)]);export function isDatasetBatchDesign(_0x10528c){const _0x49419b=a65_0x4f5b8f;return isObject(_0x10528c)&&_0x10528c[_0x49419b(0x1a8)]===_0x49419b(0x190);}export function validateDatasetBatchDesign(_0x3d77c8){const _0x5e0812=a65_0x4f5b8f;(!isObject(_0x3d77c8)||_0x3d77c8['kind']!==_0x5e0812(0x190))&&fail(_0x5e0812(0x1ab));_0x3d77c8['schemaVersion']!==0x1&&fail(_0x5e0812(0x193));const _0x370e73=objectArray(_0x3d77c8[_0x5e0812(0x1a4)],_0x5e0812(0x1a4),0x1,0x14),_0x1a5afe=objectArray(_0x3d77c8[_0x5e0812(0x1a7)],_0x5e0812(0x1a7),0x0,0xc8),_0x3307a1=objectArray(_0x3d77c8[_0x5e0812(0x195)],_0x5e0812(0x195),0x0,0xc8),_0x1af27c=new Set(),_0x5c7042=new Map();for(const [_0x55bc44,_0x269412]of _0x370e73['entries']()){const _0x24e1f6=requiredString(_0x269412[_0x5e0812(0x1c7)],'datasets['+_0x55bc44+_0x5e0812(0x1c5));!LOCAL_KEY[_0x5e0812(0x1c8)](_0x24e1f6)&&fail(_0x5e0812(0x199)+_0x55bc44+_0x5e0812(0x19a)+LOCAL_KEY[_0x5e0812(0x1de)]+'.');_0x1af27c['has'](_0x24e1f6)&&fail(_0x5e0812(0x1d9));_0x1af27c[_0x5e0812(0x1da)](_0x24e1f6);!isObject(_0x269412[_0x5e0812(0x1dc)])&&fail(_0x5e0812(0x199)+_0x55bc44+_0x5e0812(0x1ca));rejectServerDatasetIdentity(_0x269412[_0x5e0812(0x1dc)],_0x5e0812(0x199)+_0x55bc44+_0x5e0812(0x1e5));if(!isObject(_0x269412['design'][_0x5e0812(0x1dd)]))fail(_0x5e0812(0x199)+_0x55bc44+_0x5e0812(0x1c4));rejectServerDatasetIdentity(_0x269412[_0x5e0812(0x1dc)][_0x5e0812(0x1dd)],_0x5e0812(0x199)+_0x55bc44+'].design.dataset'),requiredString(_0x269412[_0x5e0812(0x1dc)]['dataset'][_0x5e0812(0x19c)],'datasets['+_0x55bc44+_0x5e0812(0x1b6));'relations'in _0x269412['design']&&(!Array[_0x5e0812(0x1c3)](_0x269412[_0x5e0812(0x1dc)][_0x5e0812(0x1a7)])||_0x269412['design'][_0x5e0812(0x1a7)][_0x5e0812(0x197)]!==0x0)&&fail(_0x5e0812(0x199)+_0x55bc44+'].design.relations\x20must\x20be\x20an\x20empty\x20array;\x20use\x20top-level\x20relations.');const _0xd6038a=objectArray(_0x269412[_0x5e0812(0x1dc)][_0x5e0812(0x1e6)],_0x5e0812(0x199)+_0x55bc44+_0x5e0812(0x192),0x1,0xc8),_0x4f453b=new Map();for(const [_0x285ce1,_0x5c2f81]of _0xd6038a[_0x5e0812(0x1b7)]()){const _0x487aab=fieldName(_0x5c2f81);if(!_0x487aab)fail(_0x5e0812(0x199)+_0x55bc44+_0x5e0812(0x1e9)+_0x285ce1+']\x20must\x20have\x20a\x20non-empty\x20name\x20or\x20code.');const _0x3810d6=_0x487aab['toLowerCase']();if(_0x4f453b[_0x5e0812(0x1c6)](_0x3810d6))fail(_0x5e0812(0x1e8)+_0x24e1f6+_0x5e0812(0x1f1));const _0x460bd6=stringValue(_0x5c2f81['type']??_0x5c2f81[_0x5e0812(0x1eb)])['toUpperCase']();if(!SUPPORTED_FIELD_TYPES[_0x5e0812(0x1c6)](_0x460bd6))fail(_0x5e0812(0x199)+_0x55bc44+'].design.fields['+_0x285ce1+'].type\x20is\x20not\x20supported.');_0x4f453b[_0x5e0812(0x1cc)](_0x3810d6,_0x460bd6),[_0x5c2f81[_0x5e0812(0x1f8)],_0x5c2f81[_0x5e0812(0x1fa)],_0x5c2f81['refTableLabelField']][_0x5e0812(0x1ec)](_0x2dfb5d=>stringValue(_0x2dfb5d))&&fail('datasets['+_0x55bc44+_0x5e0812(0x1e9)+_0x285ce1+']\x20must\x20not\x20contain\x20embedded\x20relation\x20references.');}_0x5c7042[_0x5e0812(0x1cc)](_0x24e1f6,_0x4f453b);}const _0x5608f9=new Set(),_0x22294e=new Set();for(const [_0x555fcb,_0x1ca0e1]of _0x1a5afe[_0x5e0812(0x1b7)]()){const _0x388e3d=validateRelation(_0x1ca0e1,_0x555fcb,_0x1af27c,_0x5c7042);if(_0x5608f9['has'](_0x388e3d))fail(_0x5e0812(0x1ad));_0x5608f9[_0x5e0812(0x1da)](_0x388e3d);const _0x582519=_0x388e3d[_0x5e0812(0x1e0)]('\x00',0x2)[_0x5e0812(0x1cd)]('\x00');if(_0x22294e[_0x5e0812(0x1c6)](_0x582519))fail(_0x5e0812(0x1fb));_0x22294e[_0x5e0812(0x1da)](_0x582519);}for(const [_0x43e467,_0x28eb28]of _0x3307a1[_0x5e0812(0x1b7)]()){requiredString(_0x28eb28[_0x5e0812(0x1b2)],_0x5e0812(0x1ba)+_0x43e467+_0x5e0812(0x1d3)),validateConfidence(_0x28eb28[_0x5e0812(0x18f)],_0x5e0812(0x1ba)+_0x43e467+_0x5e0812(0x1b3));}return _0x3d77c8;}export function reconcileBatchResult(_0x23812b){const _0x364f2a=a65_0x4f5b8f;if(!isObject(_0x23812b))return null;try{const _0x2dee03=stringArray(_0x23812b[_0x364f2a(0x19f)],_0x364f2a(0x19f),0x1,0x14),_0x3a9576=new Set(_0x2dee03);if(_0x3a9576[_0x364f2a(0x1d2)]!==_0x2dee03[_0x364f2a(0x197)]||_0x2dee03[_0x364f2a(0x1ec)](_0x10af9d=>!LOCAL_KEY[_0x364f2a(0x1c8)](_0x10af9d)))return null;const _0x41d754=objectArray(_0x23812b[_0x364f2a(0x1b8)],_0x364f2a(0x1b8),0x1,0x14),_0x3a6260=new Map(),_0x24a3cd=new Set();for(const _0x5597d7 of _0x41d754){const _0x3e1912=requiredString(_0x5597d7['localKey'],_0x364f2a(0x1ea)),_0x3b7ac7=requiredString(_0x5597d7['code']??_0x5597d7[_0x364f2a(0x1f2)],_0x364f2a(0x1f4));if(_0x3a6260[_0x364f2a(0x1c6)](_0x3e1912)||_0x24a3cd[_0x364f2a(0x1c6)](_0x3b7ac7))return null;_0x3a6260['set'](_0x3e1912,_0x3b7ac7),_0x24a3cd[_0x364f2a(0x1da)](_0x3b7ac7);}if(!sameSet(_0x3a9576,new Set(_0x3a6260[_0x364f2a(0x1ef)]())))return null;const _0x419ec7=objectArray(_0x23812b[_0x364f2a(0x1ee)],_0x364f2a(0x1ee),0x0,0xc8),_0x1d4fd3=objectArray(_0x23812b[_0x364f2a(0x1b5)],_0x364f2a(0x1b5),0x0,0xc8),_0x39fa45=relationTupleSet(_0x419ec7,![],_0x3a6260),_0x3ddac4=relationTupleSet(_0x1d4fd3,!![],_0x3a6260);if(!_0x39fa45||!_0x3ddac4||!sameSet(_0x39fa45,_0x3ddac4))return null;const _0x37d438=objectArray(_0x23812b['unresolvedRelations'],_0x364f2a(0x195),0x0,0xc8);return{'expectedLocalKeys':_0x2dee03,'expectedRelations':_0x419ec7,'createdDatasets':_0x41d754,'createdRelations':_0x1d4fd3,'unresolvedRelations':_0x37d438,...isObject(_0x23812b[_0x364f2a(0x19b)])?{'metrics':_0x23812b[_0x364f2a(0x19b)]}:{}};}catch{return null;}}function validateRelation(_0x49c42f,_0x22ccff,_0x1386f2,_0x3c34b8){const _0x534417=a65_0x4f5b8f,_0x1d6882='relations['+_0x22ccff+']',_0x2bdc1f=requiredString(_0x49c42f['fromDatasetKey'],_0x1d6882+'.fromDatasetKey'),_0x4b710a=requiredString(_0x49c42f[_0x534417(0x1a3)],_0x1d6882+_0x534417(0x1fd)),_0x556138=requiredString(_0x49c42f['fromField'],_0x1d6882+'.fromField')['toLowerCase'](),_0xb07bcf=requiredString(_0x49c42f[_0x534417(0x1df)],_0x1d6882+_0x534417(0x1f3))['toLowerCase']();if(!_0x1386f2[_0x534417(0x1c6)](_0x2bdc1f)||!_0x1386f2['has'](_0x4b710a))fail(_0x1d6882+_0x534417(0x19e));const _0x1ed96e=_0x3c34b8[_0x534417(0x1d0)](_0x2bdc1f)?.[_0x534417(0x1d0)](_0x556138),_0xa6227c=_0x3c34b8[_0x534417(0x1d0)](_0x4b710a)?.[_0x534417(0x1d0)](_0xb07bcf);if(_0x1ed96e===undefined||_0xa6227c===undefined)fail(_0x1d6882+'\x20references\x20an\x20unknown\x20field.');if(_0x1ed96e&&_0xa6227c&&_0x1ed96e!==_0xa6227c)fail(_0x1d6882+_0x534417(0x1be));const _0x489d61=stringValue(_0x49c42f[_0x534417(0x1a9)])||'lookup';if(_0x489d61!==_0x534417(0x1e7))fail(_0x1d6882+_0x534417(0x1d8));const _0x406bc9=stringValue(_0x49c42f[_0x534417(0x1a0)])||_0x534417(0x1bd);if(!SUPPORTED_CARDINALITIES[_0x534417(0x1c6)](_0x406bc9))fail(_0x1d6882+_0x534417(0x194));return requiredString(_0x49c42f[_0x534417(0x1b2)],_0x1d6882+_0x534417(0x1b4)),validateConfidence(_0x49c42f['confidence'],_0x1d6882+_0x534417(0x1c9)),tuple(_0x2bdc1f,_0x556138,_0x4b710a,_0xb07bcf,'lookup',_0x406bc9);}function relationTupleSet(_0x13d41e,_0x2ddf82,_0x4f480a){const _0x57a891=a65_0x4f5b8f,_0x27d741=new Set();for(const _0x8dd25d of _0x13d41e){const _0xc064a2=stringValue(_0x8dd25d[_0x57a891(0x1e2)]),_0x56947c=stringValue(_0x8dd25d[_0x57a891(0x1a3)]),_0x1c06e=stringValue(_0x8dd25d[_0x57a891(0x1af)])[_0x57a891(0x1b0)](),_0x594998=stringValue(_0x8dd25d[_0x57a891(0x1df)])[_0x57a891(0x1b0)](),_0x156f23=stringValue(_0x8dd25d[_0x57a891(0x1a9)]),_0x19e1c5=stringValue(_0x8dd25d['cardinality']);if(!_0xc064a2||!_0x56947c||!_0x1c06e||!_0x594998||_0x156f23!==_0x57a891(0x1e7)||!SUPPORTED_CARDINALITIES['has'](_0x19e1c5))return null;if(!_0x4f480a['has'](_0xc064a2)||!_0x4f480a['has'](_0x56947c))return null;if(_0x2ddf82&&(stringValue(_0x8dd25d['fromDatasetCode'])!==_0x4f480a['get'](_0xc064a2)||stringValue(_0x8dd25d[_0x57a891(0x1d4)])!==_0x4f480a[_0x57a891(0x1d0)](_0x56947c)))return null;const _0x14d54b=tuple(_0xc064a2,_0x1c06e,_0x56947c,_0x594998,_0x156f23,_0x19e1c5);if(_0x27d741['has'](_0x14d54b))return null;_0x27d741['add'](_0x14d54b);}return _0x27d741;}function rejectServerDatasetIdentity(_0x416c3f,_0x2ec1a7){const _0x21cbff=a65_0x4f5b8f;for(const _0x296922 of['id',_0x21cbff(0x1c1),'modelId',_0x21cbff(0x196),_0x21cbff(0x1f2),_0x21cbff(0x1e4)]){if(_0x416c3f[_0x296922]!==undefined&&_0x416c3f[_0x296922]!==null&&_0x416c3f[_0x296922]!=='')fail(_0x2ec1a7+'.'+_0x296922+_0x21cbff(0x1c2));}}function objectArray(_0x1bd7e6,_0x48fb80,_0x253d08,_0x2b15f3){const _0x574e82=a65_0x4f5b8f;return(!Array[_0x574e82(0x1c3)](_0x1bd7e6)||_0x1bd7e6[_0x574e82(0x197)]<_0x253d08||_0x1bd7e6[_0x574e82(0x197)]>_0x2b15f3||_0x1bd7e6['some'](_0x2e6cb2=>!isObject(_0x2e6cb2)))&&fail(_0x48fb80+_0x574e82(0x1db)+_0x253d08+'..'+_0x2b15f3+_0x574e82(0x1d6)),_0x1bd7e6;}function stringArray(_0x6c3e6d,_0x1343b2,_0x5e81c7,_0x1c0633){const _0x276941=a65_0x4f5b8f;return(!Array[_0x276941(0x1c3)](_0x6c3e6d)||_0x6c3e6d[_0x276941(0x197)]<_0x5e81c7||_0x6c3e6d[_0x276941(0x197)]>_0x1c0633||_0x6c3e6d[_0x276941(0x1ec)](_0x4743c3=>typeof _0x4743c3!==_0x276941(0x19d)||!_0x4743c3[_0x276941(0x1a2)]()))&&fail(_0x1343b2+_0x276941(0x1db)+_0x5e81c7+'..'+_0x1c0633+_0x276941(0x1f7)),_0x6c3e6d;}function requiredString(_0x45891e,_0x2611d5){const _0x406274=a65_0x4f5b8f,_0x3918e4=stringValue(_0x45891e);if(!_0x3918e4)fail(_0x2611d5+_0x406274(0x1f6));return _0x3918e4;}function stringValue(_0x4b7cc4){const _0x566ba6=a65_0x4f5b8f;return typeof _0x4b7cc4===_0x566ba6(0x19d)?_0x4b7cc4[_0x566ba6(0x1a2)]():'';}function a65_0x2e94(_0x24e48c,_0x41bc77){_0x24e48c=_0x24e48c-0x18f;const _0x2d2245=a65_0x2d22();let _0x2e941c=_0x2d2245[_0x24e48c];return _0x2e941c;}function fieldName(_0x476731){const _0x586c3d=a65_0x4f5b8f;return stringValue(_0x476731[_0x586c3d(0x196)]??_0x476731[_0x586c3d(0x1f0)]??_0x476731[_0x586c3d(0x1a6)]??_0x476731[_0x586c3d(0x1ae)]);}function a65_0x2d22(){const _0x199863=['fieldCode','\x20field\x20names\x20must\x20be\x20unique\x20ignoring\x20case.','datasetCode','.toField','createdDatasets[].code','2121280UYtvPy','\x20is\x20required.','\x20non-empty\x20strings.','refTable','map','refTableField','Each\x20source\x20field\x20may\x20target\x20at\x20most\x20one\x20relation.','911688uWjvvF','.toDatasetKey','confidence','dataset-batch','2060109XOkNGW','].design.fields','Dataset\x20batch\x20schemaVersion\x20must\x20be\x201.','.cardinality\x20is\x20not\x20supported.','unresolvedRelations','code','length','USER','datasets[','].localKey\x20must\x20match\x20','metrics','datasetName','string','\x20references\x20an\x20unknown\x20dataset\x20localKey.','expectedLocalKeys','cardinality','8qmOBZo','trim','toDatasetKey','datasets','SELECT','name','relations','kind','relationType','2335078IJdyXJ','Batch\x20--design-file\x20must\x20have\x20kind\x20\x22dataset-batch\x22.','193940idqVan','Dataset\x20batch\x20relations\x20must\x20be\x20unique.','fieldName','fromField','toLowerCase','isFinite','reason','].confidence','.reason','createdRelations','].design.dataset.datasetName','entries','createdDatasets','UPLOAD','unresolvedRelations[','8642970HBroyX','243vTzcAT','MANY_TO_ONE','\x20connects\x20incompatible\x20field\x20types.','12996FBUtnQ','NUMBER','datasetId','\x20must\x20not\x20be\x20supplied\x20by\x20the\x20client.','isArray','].design.dataset\x20must\x20be\x20an\x20object.','].localKey','has','localKey','test','.confidence','].design\x20must\x20be\x20an\x20object.','object','set','join','BOOLEAN','TEXT','get','DATE_RANGE','size','].reason','toDatasetCode','ADDRESS','\x20objects.','DATETIME','.relationType\x20must\x20be\x20\x22lookup\x22.','Dataset\x20batch\x20localKey\x20values\x20must\x20be\x20unique.','add','\x20must\x20contain\x20','design','dataset','source','toField','split','186evUCzO','fromDatasetKey','\x20must\x20be\x20between\x200\x20and\x201.','modelCode','].design','fields','lookup','Dataset\x20','].design.fields[','createdDatasets[].localKey','fieldType','some','ONE_TO_ONE','expectedRelations','keys'];a65_0x2d22=function(){return _0x199863;};return a65_0x2d22();}function validateConfidence(_0x2827b6,_0x5a291e){const _0x93df00=a65_0x4f5b8f;_0x2827b6!==undefined&&_0x2827b6!==null&&(typeof _0x2827b6!=='number'||!Number[_0x93df00(0x1b1)](_0x2827b6)||_0x2827b6<0x0||_0x2827b6>0x1)&&fail(_0x5a291e+_0x93df00(0x1e3));}function tuple(..._0x4dfa46){const _0x3c8c56=a65_0x4f5b8f;return _0x4dfa46[_0x3c8c56(0x1f9)]((_0xfaf771,_0x21a18d)=>_0x21a18d===0x1||_0x21a18d===0x3?_0xfaf771['toLowerCase']():_0xfaf771)['join']('\x00');}function sameSet(_0x26774f,_0x8bed32){const _0x573802=a65_0x4f5b8f;return _0x26774f[_0x573802(0x1d2)]===_0x8bed32[_0x573802(0x1d2)]&&[..._0x26774f]['every'](_0x4d026f=>_0x8bed32[_0x573802(0x1c6)](_0x4d026f));}function isObject(_0x5f1fad){const _0x471a0b=a65_0x4f5b8f;return typeof _0x5f1fad===_0x471a0b(0x1cb)&&_0x5f1fad!==null&&!Array[_0x471a0b(0x1c3)](_0x5f1fad);}function fail(_0x22cdc0){throw CliErrors['validation'](_0x22cdc0);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a66_0x30f605=a66_0x28db;(function(_0x3a0edd,_0x41896d){const _0x3e1e2e=a66_0x28db,_0x13e221=_0x3a0edd();while(!![]){try{const _0x5885f5=-parseInt(_0x3e1e2e(0x215))/0x1+-parseInt(_0x3e1e2e(0x219))/0x2+-parseInt(_0x3e1e2e(0x202))/0x3*(-parseInt(_0x3e1e2e(0x1f9))/0x4)+parseInt(_0x3e1e2e(0x227))/0x5*(parseInt(_0x3e1e2e(0x1ee))/0x6)+parseInt(_0x3e1e2e(0x1e1))/0x7*(-parseInt(_0x3e1e2e(0x1f1))/0x8)+parseInt(_0x3e1e2e(0x1f3))/0x9*(-parseInt(_0x3e1e2e(0x20f))/0xa)+parseInt(_0x3e1e2e(0x1eb))/0xb;if(_0x5885f5===_0x41896d)break;else _0x13e221['push'](_0x13e221['shift']());}catch(_0xd1c909){_0x13e221['push'](_0x13e221['shift']());}}}(a66_0x12fc,0x6b94b));function a66_0x28db(_0x436eae,_0x3074e3){_0x436eae=_0x436eae-0x1e0;const _0x12fc38=a66_0x12fc();let _0x28db0f=_0x12fc38[_0x436eae];return _0x28db0f;}import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDbTableBusinessGroup,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const DB_TABLE_BACKEND_PATH='/smartapi/dblink/updateTableBusinessGroup',METADATA_BACKEND_PATH='/smartapi/question/er-config/business-group/edit',UNGROUPED_BUSINESS_GROUP=a66_0x30f605(0x229);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x4cbc52,input:_0x39db72,dryRun:_0x4cbc82}){const _0x337c3f=a66_0x30f605;validateInput(_0x39db72);const _0x5e3875=normalizeBusinessGroupArgument(_0x39db72[_0x337c3f(0x1e0)]),_0xb6334c=await getDatasetDetail(_0x39db72['code']),_0x1809cb=resolveBusinessGroupDataset(_0xb6334c,_0x39db72['code']);assertBusinessGroupUpdateSupported(_0x1809cb,_0x5e3875);const _0x4180e8=loadCurrentBusinessGroup(_0xb6334c,_0x1809cb);assertExpectedBusinessGroup(_0x4180e8,_0x39db72[_0x337c3f(0x1e2)]);const _0x2d3c01=buildBackendPlan(_0x4cbc52,_0x1809cb,_0x5e3875),_0x17aaf2=_0x4180e8!==_0x5e3875;let _0x3ad97d;if(_0x17aaf2&&!_0x4cbc82){_0x2d3c01[_0x337c3f(0x203)]===_0x337c3f(0x20a)?await updateDbTableBusinessGroup(_0x2d3c01[_0x337c3f(0x1e5)]):await updateErBusinessGroup(_0x2d3c01[_0x337c3f(0x1e5)]);const _0x9fa106=await getDatasetDetail(_0x1809cb[_0x337c3f(0x228)]),_0x26cd3a=resolveBusinessGroupDataset(_0x9fa106,_0x1809cb['code']),_0x3c7eb6=loadCurrentBusinessGroup(_0x9fa106,_0x26cd3a);if(_0x3c7eb6!==_0x5e3875)throw CliErrors['apiError'](_0x337c3f(0x1fc),_0x337c3f(0x1ff)+JSON[_0x337c3f(0x1ed)](displayBusinessGroup(_0x5e3875))+_0x337c3f(0x201)+JSON[_0x337c3f(0x1ed)](displayBusinessGroup(_0x3c7eb6))+'.');_0x3ad97d={'verified':!![],'status':_0x337c3f(0x21e),'afterReadback':{'businessGroup':displayBusinessGroup(_0x3c7eb6)}};}else!_0x17aaf2&&(_0x3ad97d={'verified':!![],'status':_0x337c3f(0x210),'afterReadback':{'businessGroup':displayBusinessGroup(_0x4180e8)}});const _0x25d4a8={'operation':_0x337c3f(0x204),'appCode':_0x4cbc52,'selector':{'code':_0x1809cb['code']},'dataset':{'id':_0x1809cb['id'],'code':_0x1809cb[_0x337c3f(0x228)],'name':_0x1809cb[_0x337c3f(0x226)],'sourceType':_0x1809cb[_0x337c3f(0x1fb)]},'before':{'businessGroup':displayBusinessGroup(_0x4180e8)},'after':{'businessGroup':displayBusinessGroup(_0x5e3875)},'changed':_0x17aaf2,'dryRun':_0x4cbc82,'submitted':_0x17aaf2&&!_0x4cbc82,'backend':{'method':_0x2d3c01[_0x337c3f(0x200)],'path':_0x2d3c01['path'],'payload':_0x2d3c01[_0x337c3f(0x1e5)]},..._0x3ad97d?{'verification':_0x3ad97d}:{},'warnings':[]};return{'ok':!![],'data':_0x25d4a8,'message':_0x17aaf2?_0x4cbc82?'Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20'+_0x1809cb[_0x337c3f(0x228)]:_0x337c3f(0x1f6)+_0x1809cb[_0x337c3f(0x228)]:'No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20'+_0x1809cb[_0x337c3f(0x228)]};}export const datasetBusinessGroupUpdate={'service':'dataset','command':a66_0x30f605(0x21d),'description':'Update\x20business\x20scenario\x20group','risk':a66_0x30f605(0x216),'flags':[CODE_FLAG,{'name':a66_0x30f605(0x1e9),'type':'string','required':!![],'description':a66_0x30f605(0x211)},{'name':'expect-business-group','type':a66_0x30f605(0x222),'required':![],'description':a66_0x30f605(0x21f)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x550e83){validateInput(readBusinessGroupUpdateInput(_0x550e83));},async 'dryRun'(_0xf91c4f){const _0x1df7eb=a66_0x30f605,_0xb27b1d=await buildDatasetBusinessGroupUpdateResult({'appCode':_0xf91c4f[_0x1df7eb(0x212)],'input':readBusinessGroupUpdateInput(_0xf91c4f),'dryRun':!![]});return{'method':_0xb27b1d[_0x1df7eb(0x206)]['backend'][_0x1df7eb(0x200)],'url':_0xb27b1d[_0x1df7eb(0x206)][_0x1df7eb(0x1f5)][_0x1df7eb(0x205)],'body':_0xb27b1d['data'][_0x1df7eb(0x1f5)][_0x1df7eb(0x1e5)],'description':_0xb27b1d[_0x1df7eb(0x224)],..._0xb27b1d[_0x1df7eb(0x206)]};},async 'execute'(_0x371ea2){const _0x1f56ec=a66_0x30f605;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x371ea2[_0x1f56ec(0x212)],'input':readBusinessGroupUpdateInput(_0x371ea2),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x2f205a){const _0x2c2c60=a66_0x30f605,_0x4da06e=_0x2f205a[_0x2c2c60(0x1f7)](_0x2c2c60(0x1f0));return{'code':trim(_0x2f205a[_0x2c2c60(0x1f7)](_0x2c2c60(0x228))),'businessGroup':_0x2f205a['str'](_0x2c2c60(0x1e9)),'expectBusinessGroup':_0x4da06e===undefined||_0x4da06e===''?undefined:_0x4da06e};}function a66_0x12fc(){const _0x331ae5=['source','18578868tDDteb','metadata','stringify','2899188jHzNjR','DB_TABLE','expect-business-group','1024RPDVls','trim','4149hLgZvU','value','backend','Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20','str','isFinite','28yucOBF','Run\x20dataset\x20detail\x20and\x20complete\x20database\x20analysis\x20before\x20updating\x20the\x20business\x20group.','sourceType','Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','dbId','hasOwnProperty','Expected\x20','method',',\x20actual\x20','112203TjONmp','kind','update','path','data','call','POST','isArray','db-table','toUpperCase','DB_TABLE\x20dataset\x20requires\x20dbtableConfig.dbId\x20and\x20tableName.','extend','dbTableSelector','16110fXRlFJ','unchanged','Business\x20scenario\x20group\x20(not\x20technical):\x20use\x20<scenario>,\x20<domain>---<scenario>\x20when\x20needed;\x20METADATA\x20accepts\x20ungrouped\x20to\x20clear\x20it','appCode','dataset','datasetName','427147CITiWm','write','tableName','modelCode','558792RKersF','keys','parse','found','business-group-update','matched','Expected\x20current\x20business\x20scenario\x20group;\x20use\x20ungrouped\x20to\x20expect\x20no\x20group;\x20mismatch\x20aborts\x20without\x20writing','dbtableConfig','object','string','datasetId','message','Expectation\x20mismatch\x20at\x20businessGroup','name','5EzjwbB','code','ungrouped','businessGroup','29757eewtMr','expectBusinessGroup','length','Clearing\x20business\x20scenario\x20groups\x20is\x20not\x20supported\x20for\x20DB_TABLE\x20datasets.','payload','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','number','validation','business-group'];a66_0x12fc=function(){return _0x331ae5;};return a66_0x12fc();}function validateInput(_0x3abba7){const _0x3b8c69=a66_0x30f605;if(!trim(_0x3abba7[_0x3b8c69(0x228)]))throw CliErrors[_0x3b8c69(0x1e8)]('--code\x20is\x20required');if(_0x3abba7['businessGroup']===undefined)throw CliErrors[_0x3b8c69(0x1e8)]('--business-group\x20is\x20required');if(!trim(_0x3abba7['businessGroup']))throw CliErrors['validation']('--business-group\x20must\x20not\x20be\x20blank');}function assertBusinessGroupUpdateSupported(_0x120fcd,_0x1d7662){const _0x24be27=a66_0x30f605;if(_0x120fcd[_0x24be27(0x1fb)]===_0x24be27(0x1ef)&&!_0x1d7662)throw CliErrors['validation'](_0x24be27(0x1e4));}function resolveBusinessGroupDataset(_0x4befb0,_0x20962f){const _0x476ad7=a66_0x30f605,_0x23ae6c=asPlainObject(_0x4befb0[_0x476ad7(0x213)]),_0x47bd16=asPlainObject(_0x4befb0[_0x476ad7(0x220)]),_0x4c0962=resolveSourceType(_0x4befb0,_0x23ae6c,_0x47bd16),_0x1341b4=firstString(_0x4befb0[_0x476ad7(0x218)],_0x4befb0[_0x476ad7(0x228)],_0x23ae6c['datasetCode'],_0x20962f)||_0x20962f;return{'id':firstNumber(_0x4befb0['modelId'],_0x4befb0['id'],_0x23ae6c['datasetId'])??firstString(_0x4befb0['modelId'],_0x4befb0['id'],_0x23ae6c[_0x476ad7(0x223)])??null,'code':_0x1341b4,'name':firstString(_0x4befb0['name'],_0x23ae6c[_0x476ad7(0x214)],_0x23ae6c[_0x476ad7(0x226)])||null,'sourceType':_0x4c0962,'dbTableSelector':_0x4c0962==='DB_TABLE'?{'dbLinkId':firstNumber(_0x47bd16[_0x476ad7(0x1fd)]),'tableName':firstString(_0x47bd16[_0x476ad7(0x217)])||null}:null};}function resolveSourceType(_0x3d2fcd,_0x738f33,_0x42fe8a){const _0x42cc1f=a66_0x30f605,_0x434e28=firstString(_0x3d2fcd[_0x42cc1f(0x1ea)],_0x3d2fcd[_0x42cc1f(0x1fb)],_0x738f33[_0x42cc1f(0x1ea)],_0x738f33[_0x42cc1f(0x1fb)])?.[_0x42cc1f(0x1f2)]()[_0x42cc1f(0x20b)]();if(_0x434e28===_0x42cc1f(0x1ef)||_0x434e28==='METADATA')return _0x434e28;if(Object[_0x42cc1f(0x21a)](_0x42fe8a)[_0x42cc1f(0x1e3)]>0x0)return _0x42cc1f(0x1ef);throw CliErrors[_0x42cc1f(0x1e8)](_0x42cc1f(0x1e6));}function loadCurrentBusinessGroup(_0x118256,_0x642d50){const _0x23a1bf=a66_0x30f605,_0x571ed7=readBusinessGroupFromDatasetDetail(_0x118256,_0x642d50[_0x23a1bf(0x1fb)]);if(_0x571ed7['found'])return normalizeBusinessGroup(_0x571ed7[_0x23a1bf(0x1f4)]);return'';}function readBusinessGroupFromDatasetDetail(_0x31a191,_0x2fdf1f){const _0x285fdd=a66_0x30f605,_0x3f6af5=asPlainObject(_0x31a191[_0x285fdd(0x213)]),_0x595a48=firstPresent(_0x31a191[_0x285fdd(0x1e0)]);if(_0x595a48[_0x285fdd(0x21c)])return _0x595a48;const _0x1b19ff=firstPresent(_0x3f6af5['businessGroup']);if(_0x1b19ff[_0x285fdd(0x21c)])return _0x1b19ff;if(_0x2fdf1f===_0x285fdd(0x1ef))return{'found':![]};const _0x12c5a2=readBusinessGroupFromExtend(_0x31a191[_0x285fdd(0x20d)]);if(_0x12c5a2['found'])return _0x12c5a2;return readBusinessGroupFromExtend(_0x3f6af5['extend']);}function readBusinessGroupFromExtend(_0x5cff75){const _0x1e45c3=a66_0x30f605;if(_0x5cff75===undefined||_0x5cff75===null||_0x5cff75==='')return{'found':![]};if(typeof _0x5cff75===_0x1e45c3(0x222))try{const _0x3f789f=JSON[_0x1e45c3(0x21b)](_0x5cff75);return readBusinessGroupFromExtend(_0x3f789f);}catch{return{'found':![]};}const _0xf4bdaa=asPlainObject(_0x5cff75);if(Object['prototype'][_0x1e45c3(0x1fe)][_0x1e45c3(0x207)](_0xf4bdaa,'businessGroup'))return{'found':!![],'value':_0xf4bdaa[_0x1e45c3(0x1e0)]};return{'found':![]};}function firstPresent(..._0x2a8442){for(const _0x2312f8 of _0x2a8442){if(_0x2312f8!==undefined&&_0x2312f8!==null)return{'found':!![],'value':_0x2312f8};}return{'found':![]};}function assertExpectedBusinessGroup(_0x5274bb,_0x55cf23){const _0x2fac50=a66_0x30f605;if(_0x55cf23===undefined)return;const _0x30ada3=normalizeBusinessGroupArgument(_0x55cf23);if(_0x5274bb!==_0x30ada3)throw CliErrors['validation'](_0x2fac50(0x225),_0x2fac50(0x1ff)+JSON[_0x2fac50(0x1ed)](_0x30ada3)+_0x2fac50(0x201)+JSON['stringify'](_0x5274bb));}function buildBackendPlan(_0x5de5af,_0x5164fc,_0x4beb61){const _0x2f81d4=a66_0x30f605;if(_0x5164fc['sourceType']==='DB_TABLE'){if(!_0x5164fc[_0x2f81d4(0x20e)]||_0x5164fc[_0x2f81d4(0x20e)]['dbLinkId']===null||!_0x5164fc[_0x2f81d4(0x20e)][_0x2f81d4(0x217)])throw CliErrors[_0x2f81d4(0x1e8)](_0x2f81d4(0x20c),_0x2f81d4(0x1fa));return{'kind':'db-table','method':_0x2f81d4(0x208),'path':DB_TABLE_BACKEND_PATH,'payload':{'dbLinkId':_0x5164fc[_0x2f81d4(0x20e)]['dbLinkId'],'tableName':_0x5164fc[_0x2f81d4(0x20e)][_0x2f81d4(0x217)],'businessGroup':_0x4beb61}};}return{'kind':_0x2f81d4(0x1ec),'method':_0x2f81d4(0x208),'path':METADATA_BACKEND_PATH,'payload':{'appCode':_0x5de5af,'datasetCode':_0x5164fc[_0x2f81d4(0x228)],'businessGroup':_0x4beb61}};}function normalizeBusinessGroup(_0x489afe){const _0x5e8fff=a66_0x30f605;if(_0x489afe===undefined||_0x489afe===null)return'';return String(_0x489afe)[_0x5e8fff(0x1f2)]();}function normalizeBusinessGroupArgument(_0x3887cb){const _0x1292aa=normalizeBusinessGroup(_0x3887cb);return _0x1292aa===UNGROUPED_BUSINESS_GROUP?'':_0x1292aa;}function displayBusinessGroup(_0x3ed7f1){return _0x3ed7f1||UNGROUPED_BUSINESS_GROUP;}function asPlainObject(_0x3352e1){const _0x2351bf=a66_0x30f605;if(!_0x3352e1||typeof _0x3352e1!==_0x2351bf(0x221)||Array[_0x2351bf(0x209)](_0x3352e1))return{};return _0x3352e1;}function firstString(..._0x3364c0){const _0x3b8f71=a66_0x30f605;for(const _0x4560db of _0x3364c0){if(typeof _0x4560db===_0x3b8f71(0x222)&&_0x4560db[_0x3b8f71(0x1f2)]())return _0x4560db[_0x3b8f71(0x1f2)]();if(typeof _0x4560db==='number'&&Number[_0x3b8f71(0x1f8)](_0x4560db))return String(_0x4560db);}return undefined;}function firstNumber(..._0x24b58c){const _0x236db4=a66_0x30f605;for(const _0x5db8d2 of _0x24b58c){if(typeof _0x5db8d2===_0x236db4(0x1e7)&&Number[_0x236db4(0x1f8)](_0x5db8d2))return _0x5db8d2;if(typeof _0x5db8d2===_0x236db4(0x222)&&_0x5db8d2['trim']()&&Number['isFinite'](Number(_0x5db8d2)))return Number(_0x5db8d2);}return null;}function trim(_0x1925f9){const _0x4f3287=a66_0x30f605;return String(_0x1925f9||'')[_0x4f3287(0x1f2)]();}
|
|
1
|
+
const a66_0x3443e7=a66_0x2e67;(function(_0x5ba4f8,_0x4e0134){const _0x394382=a66_0x2e67,_0x1ec958=_0x5ba4f8();while(!![]){try{const _0x3e6f6c=-parseInt(_0x394382(0x1f9))/0x1*(-parseInt(_0x394382(0x230))/0x2)+-parseInt(_0x394382(0x234))/0x3*(parseInt(_0x394382(0x227))/0x4)+-parseInt(_0x394382(0x22d))/0x5+-parseInt(_0x394382(0x1fd))/0x6+-parseInt(_0x394382(0x231))/0x7*(-parseInt(_0x394382(0x1f7))/0x8)+-parseInt(_0x394382(0x233))/0x9+parseInt(_0x394382(0x212))/0xa*(parseInt(_0x394382(0x1f2))/0xb);if(_0x3e6f6c===_0x4e0134)break;else _0x1ec958['push'](_0x1ec958['shift']());}catch(_0x161656){_0x1ec958['push'](_0x1ec958['shift']());}}}(a66_0x3d81,0xd1447));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDbTableBusinessGroup,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const DB_TABLE_BACKEND_PATH=a66_0x3443e7(0x208),METADATA_BACKEND_PATH=a66_0x3443e7(0x21c),UNGROUPED_BUSINESS_GROUP=a66_0x3443e7(0x1f8);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x1edfbc,input:_0x24bd35,dryRun:_0x3cf8a4}){const _0x11423a=a66_0x3443e7;validateInput(_0x24bd35);const _0x318b9b=normalizeBusinessGroupArgument(_0x24bd35[_0x11423a(0x1f6)]),_0x3bffb0=await getDatasetDetail(_0x24bd35[_0x11423a(0x202)]),_0x4d3aa3=resolveBusinessGroupDataset(_0x3bffb0,_0x24bd35['code']);assertBusinessGroupUpdateSupported(_0x4d3aa3,_0x318b9b);const _0x7440f3=loadCurrentBusinessGroup(_0x3bffb0,_0x4d3aa3);assertExpectedBusinessGroup(_0x7440f3,_0x24bd35[_0x11423a(0x1f0)]);const _0x67dcbc=buildBackendPlan(_0x1edfbc,_0x4d3aa3,_0x318b9b),_0x3945e5=_0x7440f3!==_0x318b9b;let _0x153768;if(_0x3945e5&&!_0x3cf8a4){_0x67dcbc[_0x11423a(0x229)]===_0x11423a(0x200)?await updateDbTableBusinessGroup(_0x67dcbc[_0x11423a(0x21d)]):await updateErBusinessGroup(_0x67dcbc[_0x11423a(0x21d)]);const _0x5ef8a8=await getDatasetDetail(_0x4d3aa3[_0x11423a(0x202)]),_0xcbc83c=resolveBusinessGroupDataset(_0x5ef8a8,_0x4d3aa3['code']),_0x2003e6=loadCurrentBusinessGroup(_0x5ef8a8,_0xcbc83c);if(_0x2003e6!==_0x318b9b)throw CliErrors['apiError'](_0x11423a(0x21f),_0x11423a(0x1f1)+JSON['stringify'](displayBusinessGroup(_0x318b9b))+_0x11423a(0x20c)+JSON[_0x11423a(0x213)](displayBusinessGroup(_0x2003e6))+'.');_0x153768={'verified':!![],'status':_0x11423a(0x22e),'afterReadback':{'businessGroup':displayBusinessGroup(_0x2003e6)}};}else!_0x3945e5&&(_0x153768={'verified':!![],'status':'unchanged','afterReadback':{'businessGroup':displayBusinessGroup(_0x7440f3)}});const _0x26fa75={'operation':_0x11423a(0x1f3),'appCode':_0x1edfbc,'selector':{'code':_0x4d3aa3[_0x11423a(0x202)]},'dataset':{'id':_0x4d3aa3['id'],'code':_0x4d3aa3[_0x11423a(0x202)],'name':_0x4d3aa3['name'],'sourceType':_0x4d3aa3[_0x11423a(0x21a)]},'before':{'businessGroup':displayBusinessGroup(_0x7440f3)},'after':{'businessGroup':displayBusinessGroup(_0x318b9b)},'changed':_0x3945e5,'dryRun':_0x3cf8a4,'submitted':_0x3945e5&&!_0x3cf8a4,'backend':{'method':_0x67dcbc[_0x11423a(0x216)],'path':_0x67dcbc[_0x11423a(0x221)],'payload':_0x67dcbc[_0x11423a(0x21d)]},..._0x153768?{'verification':_0x153768}:{},'warnings':[]};return{'ok':!![],'data':_0x26fa75,'message':_0x3945e5?_0x3cf8a4?'Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20'+_0x4d3aa3['code']:'Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20'+_0x4d3aa3[_0x11423a(0x202)]:_0x11423a(0x20b)+_0x4d3aa3[_0x11423a(0x202)]};}export const datasetBusinessGroupUpdate={'service':a66_0x3443e7(0x1ec),'command':a66_0x3443e7(0x201),'description':a66_0x3443e7(0x223),'risk':a66_0x3443e7(0x1ff),'flags':[CODE_FLAG,{'name':a66_0x3443e7(0x205),'type':a66_0x3443e7(0x211),'required':!![],'description':'Business\x20scenario\x20group\x20(not\x20technical):\x20use\x20<scenario>,\x20<domain>---<scenario>\x20when\x20needed;\x20METADATA\x20accepts\x20ungrouped\x20to\x20clear\x20it'},{'name':a66_0x3443e7(0x1fb),'type':a66_0x3443e7(0x211),'required':![],'description':a66_0x3443e7(0x1fe)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x133f09){validateInput(readBusinessGroupUpdateInput(_0x133f09));},async 'dryRun'(_0x5ed9cf){const _0x3b6864=a66_0x3443e7,_0x78b58d=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x5ed9cf['appCode'],'input':readBusinessGroupUpdateInput(_0x5ed9cf),'dryRun':!![]});return{'method':_0x78b58d[_0x3b6864(0x22f)][_0x3b6864(0x206)][_0x3b6864(0x216)],'url':_0x78b58d['data']['backend'][_0x3b6864(0x221)],'body':_0x78b58d[_0x3b6864(0x22f)][_0x3b6864(0x206)][_0x3b6864(0x21d)],'description':_0x78b58d['message'],..._0x78b58d[_0x3b6864(0x22f)]};},async 'execute'(_0x118817){const _0x3f0d8c=a66_0x3443e7;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x118817[_0x3f0d8c(0x22c)],'input':readBusinessGroupUpdateInput(_0x118817),'dryRun':![]});}};function a66_0x3d81(){const _0x70ecdd=['matched','data','28862Bvvoxr','2324154pGSFLx','isFinite','4817313gQxfQp','3161061iQgfzs','name','dataset','tableName','source','keys','expectBusinessGroup','Expected\x20','11VWgQpo','update','toUpperCase','value','businessGroup','32kVYFAa','ungrouped','2qOamow','dbLinkId','expect-business-group','METADATA','9922848ajjqbf','Expected\x20current\x20business\x20scenario\x20group;\x20use\x20ungrouped\x20to\x20expect\x20no\x20group;\x20mismatch\x20aborts\x20without\x20writing','write','db-table','business-group-update','code','found','number','business-group','backend','datasetId','/smartapi/dblink/updateTableBusinessGroup','dbId','datasetName','No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20',',\x20actual\x20','Run\x20dataset\x20detail\x20and\x20complete\x20database\x20analysis\x20before\x20updating\x20the\x20business\x20group.','Expectation\x20mismatch\x20at\x20businessGroup','prototype','metadata','string','31817010GfEhTn','stringify','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','str','method','POST','--business-group\x20must\x20not\x20be\x20blank','extend','sourceType','length','/smartapi/question/er-config/business-group/edit','payload','dbTableSelector','Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','modelId','path','DB_TABLE','Update\x20business\x20scenario\x20group','trim','hasOwnProperty','modelCode','4cNnhwb','call','kind','DB_TABLE\x20dataset\x20requires\x20dbtableConfig.dbId\x20and\x20tableName.','validation','appCode','2193700wsbuSc'];a66_0x3d81=function(){return _0x70ecdd;};return a66_0x3d81();}function readBusinessGroupUpdateInput(_0x20b98f){const _0xf6db09=a66_0x3443e7,_0x295732=_0x20b98f[_0xf6db09(0x215)]('expect-business-group');return{'code':trim(_0x20b98f['str'](_0xf6db09(0x202))),'businessGroup':_0x20b98f[_0xf6db09(0x215)]('business-group'),'expectBusinessGroup':_0x295732===undefined||_0x295732===''?undefined:_0x295732};}function validateInput(_0x528b16){const _0xaf65fb=a66_0x3443e7;if(!trim(_0x528b16[_0xaf65fb(0x202)]))throw CliErrors[_0xaf65fb(0x22b)]('--code\x20is\x20required');if(_0x528b16[_0xaf65fb(0x1f6)]===undefined)throw CliErrors['validation']('--business-group\x20is\x20required');if(!trim(_0x528b16[_0xaf65fb(0x1f6)]))throw CliErrors[_0xaf65fb(0x22b)](_0xaf65fb(0x218));}function assertBusinessGroupUpdateSupported(_0x57c9bd,_0x151e2d){const _0xcd4fb4=a66_0x3443e7;if(_0x57c9bd[_0xcd4fb4(0x21a)]===_0xcd4fb4(0x222)&&!_0x151e2d)throw CliErrors[_0xcd4fb4(0x22b)]('Clearing\x20business\x20scenario\x20groups\x20is\x20not\x20supported\x20for\x20DB_TABLE\x20datasets.');}function resolveBusinessGroupDataset(_0x424c19,_0x4a768a){const _0x210c3f=a66_0x3443e7,_0x2b200a=asPlainObject(_0x424c19[_0x210c3f(0x1ec)]),_0x4c8452=asPlainObject(_0x424c19['dbtableConfig']),_0x183727=resolveSourceType(_0x424c19,_0x2b200a,_0x4c8452),_0x3d596f=firstString(_0x424c19[_0x210c3f(0x226)],_0x424c19[_0x210c3f(0x202)],_0x2b200a['datasetCode'],_0x4a768a)||_0x4a768a;return{'id':firstNumber(_0x424c19[_0x210c3f(0x220)],_0x424c19['id'],_0x2b200a[_0x210c3f(0x207)])??firstString(_0x424c19['modelId'],_0x424c19['id'],_0x2b200a[_0x210c3f(0x207)])??null,'code':_0x3d596f,'name':firstString(_0x424c19[_0x210c3f(0x1eb)],_0x2b200a[_0x210c3f(0x20a)],_0x2b200a['name'])||null,'sourceType':_0x183727,'dbTableSelector':_0x183727===_0x210c3f(0x222)?{'dbLinkId':firstNumber(_0x4c8452[_0x210c3f(0x209)]),'tableName':firstString(_0x4c8452[_0x210c3f(0x1ed)])||null}:null};}function resolveSourceType(_0x56c742,_0xe3cc06,_0x3d7a41){const _0x21b23b=a66_0x3443e7,_0x51adcb=firstString(_0x56c742[_0x21b23b(0x1ee)],_0x56c742[_0x21b23b(0x21a)],_0xe3cc06[_0x21b23b(0x1ee)],_0xe3cc06['sourceType'])?.[_0x21b23b(0x224)]()[_0x21b23b(0x1f4)]();if(_0x51adcb===_0x21b23b(0x222)||_0x51adcb===_0x21b23b(0x1fc))return _0x51adcb;if(Object[_0x21b23b(0x1ef)](_0x3d7a41)[_0x21b23b(0x21b)]>0x0)return _0x21b23b(0x222);throw CliErrors[_0x21b23b(0x22b)](_0x21b23b(0x214));}function loadCurrentBusinessGroup(_0x201b55,_0x367eb9){const _0x59376d=a66_0x3443e7,_0x59d1b5=readBusinessGroupFromDatasetDetail(_0x201b55,_0x367eb9['sourceType']);if(_0x59d1b5[_0x59376d(0x203)])return normalizeBusinessGroup(_0x59d1b5[_0x59376d(0x1f5)]);return'';}function readBusinessGroupFromDatasetDetail(_0x5a1a27,_0x4e0f7d){const _0x877f=a66_0x3443e7,_0x26199a=asPlainObject(_0x5a1a27[_0x877f(0x1ec)]),_0x3abf20=firstPresent(_0x5a1a27[_0x877f(0x1f6)]);if(_0x3abf20['found'])return _0x3abf20;const _0x7e0658=firstPresent(_0x26199a[_0x877f(0x1f6)]);if(_0x7e0658[_0x877f(0x203)])return _0x7e0658;if(_0x4e0f7d===_0x877f(0x222))return{'found':![]};const _0x578d1b=readBusinessGroupFromExtend(_0x5a1a27['extend']);if(_0x578d1b[_0x877f(0x203)])return _0x578d1b;return readBusinessGroupFromExtend(_0x26199a[_0x877f(0x219)]);}function readBusinessGroupFromExtend(_0x4fdc7d){const _0x357cd3=a66_0x3443e7;if(_0x4fdc7d===undefined||_0x4fdc7d===null||_0x4fdc7d==='')return{'found':![]};if(typeof _0x4fdc7d===_0x357cd3(0x211))try{const _0x1004c1=JSON['parse'](_0x4fdc7d);return readBusinessGroupFromExtend(_0x1004c1);}catch{return{'found':![]};}const _0x115af0=asPlainObject(_0x4fdc7d);if(Object[_0x357cd3(0x20f)][_0x357cd3(0x225)][_0x357cd3(0x228)](_0x115af0,_0x357cd3(0x1f6)))return{'found':!![],'value':_0x115af0[_0x357cd3(0x1f6)]};return{'found':![]};}function firstPresent(..._0xfd7576){for(const _0x16874c of _0xfd7576){if(_0x16874c!==undefined&&_0x16874c!==null)return{'found':!![],'value':_0x16874c};}return{'found':![]};}function assertExpectedBusinessGroup(_0x523c97,_0x466b55){const _0xd0a7a0=a66_0x3443e7;if(_0x466b55===undefined)return;const _0x5ef4f2=normalizeBusinessGroupArgument(_0x466b55);if(_0x523c97!==_0x5ef4f2)throw CliErrors['validation'](_0xd0a7a0(0x20e),_0xd0a7a0(0x1f1)+JSON[_0xd0a7a0(0x213)](_0x5ef4f2)+_0xd0a7a0(0x20c)+JSON[_0xd0a7a0(0x213)](_0x523c97));}function buildBackendPlan(_0x9a4fdb,_0x4af92b,_0x364af6){const _0x287712=a66_0x3443e7;if(_0x4af92b['sourceType']===_0x287712(0x222)){if(!_0x4af92b[_0x287712(0x21e)]||_0x4af92b['dbTableSelector'][_0x287712(0x1fa)]===null||!_0x4af92b[_0x287712(0x21e)][_0x287712(0x1ed)])throw CliErrors[_0x287712(0x22b)](_0x287712(0x22a),_0x287712(0x20d));return{'kind':'db-table','method':_0x287712(0x217),'path':DB_TABLE_BACKEND_PATH,'payload':{'dbLinkId':_0x4af92b['dbTableSelector'][_0x287712(0x1fa)],'tableName':_0x4af92b['dbTableSelector']['tableName'],'businessGroup':_0x364af6}};}return{'kind':_0x287712(0x210),'method':'POST','path':METADATA_BACKEND_PATH,'payload':{'appCode':_0x9a4fdb,'datasetCode':_0x4af92b[_0x287712(0x202)],'businessGroup':_0x364af6}};}function normalizeBusinessGroup(_0x35415d){const _0x469f3b=a66_0x3443e7;if(_0x35415d===undefined||_0x35415d===null)return'';return String(_0x35415d)[_0x469f3b(0x224)]();}function normalizeBusinessGroupArgument(_0x685ad5){const _0x5635a6=normalizeBusinessGroup(_0x685ad5);return _0x5635a6===UNGROUPED_BUSINESS_GROUP?'':_0x5635a6;}function displayBusinessGroup(_0x6715fc){return _0x6715fc||UNGROUPED_BUSINESS_GROUP;}function asPlainObject(_0x1aa4ed){if(!_0x1aa4ed||typeof _0x1aa4ed!=='object'||Array['isArray'](_0x1aa4ed))return{};return _0x1aa4ed;}function firstString(..._0x34ddf3){const _0x91b86e=a66_0x3443e7;for(const _0x393842 of _0x34ddf3){if(typeof _0x393842===_0x91b86e(0x211)&&_0x393842[_0x91b86e(0x224)]())return _0x393842['trim']();if(typeof _0x393842==='number'&&Number['isFinite'](_0x393842))return String(_0x393842);}return undefined;}function firstNumber(..._0x5b1c2f){const _0x4a5fff=a66_0x3443e7;for(const _0x46c6c9 of _0x5b1c2f){if(typeof _0x46c6c9===_0x4a5fff(0x204)&&Number[_0x4a5fff(0x232)](_0x46c6c9))return _0x46c6c9;if(typeof _0x46c6c9===_0x4a5fff(0x211)&&_0x46c6c9[_0x4a5fff(0x224)]()&&Number[_0x4a5fff(0x232)](Number(_0x46c6c9)))return Number(_0x46c6c9);}return null;}function a66_0x2e67(_0x152aeb,_0x146ecf){_0x152aeb=_0x152aeb-0x1eb;const _0x3d81ee=a66_0x3d81();let _0x2e678c=_0x3d81ee[_0x152aeb];return _0x2e678c;}function trim(_0xd51fdd){const _0x3048e7=a66_0x3443e7;return String(_0xd51fdd||'')[_0x3048e7(0x224)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a67_0x442192=a67_0x5d36;function a67_0x5d36(_0x8c6ee8,_0x497674){_0x8c6ee8=_0x8c6ee8-0x1e5;const _0x96ed54=a67_0x96ed();let _0x5d36d2=_0x96ed54[_0x8c6ee8];return _0x5d36d2;}function a67_0x96ed(){const _0x1df7b9=['2358NNqfqr','\x20business\x20group(s)\x20for\x20database\x20connection\x20','200427cLbbzT','2040XKFblZ','trim','DB_TABLE','read','1690030ZpEXRr','37376utQwRx','groups','16RdajYy','num','number','business-groups','11pbBrvz','20538CIghLF','1049144IDBUhU','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','dbid','ungrouped','1660071HRuZUp','12GinTKz'];a67_0x96ed=function(){return _0x1df7b9;};return a67_0x96ed();}(function(_0x2b98cb,_0x4fe3db){const _0x4ed5be=a67_0x5d36,_0x42d54e=_0x2b98cb();while(!![]){try{const _0x1103d5=-parseInt(_0x4ed5be(0x1e7))/0x1+-parseInt(_0x4ed5be(0x1ed))/0x2*(-parseInt(_0x4ed5be(0x1fa))/0x3)+parseInt(_0x4ed5be(0x1f5))/0x4+-parseInt(_0x4ed5be(0x1e8))/0x5*(-parseInt(_0x4ed5be(0x1e5))/0x6)+-parseInt(_0x4ed5be(0x1f9))/0x7+-parseInt(_0x4ed5be(0x1ef))/0x8*(parseInt(_0x4ed5be(0x1f4))/0x9)+parseInt(_0x4ed5be(0x1ec))/0xa*(parseInt(_0x4ed5be(0x1f3))/0xb);if(_0x1103d5===_0x4fe3db)break;else _0x42d54e['push'](_0x42d54e['shift']());}catch(_0x20f275){_0x42d54e['push'](_0x42d54e['shift']());}}}(a67_0x96ed,0x36bf1));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getErBusinessGroupSummary}from'../../core/api-client.js';export const datasetBusinessGroups={'service':'dataset','command':a67_0x442192(0x1f2),'description':'List\x20DB_TABLE\x20dataset\x20business\x20groups\x20for\x20a\x20database\x20connection;\x20does\x20not\x20include\x20METADATA','risk':a67_0x442192(0x1eb),'flags':[{'name':a67_0x442192(0x1f7),'type':a67_0x442192(0x1f1),'required':!![],'description':a67_0x442192(0x1f6)},APPCODE_FLAG_OPTIONAL],async 'execute'(_0x3e2bbc){const _0x346696=a67_0x442192,_0x4f72fa=_0x3e2bbc[_0x346696(0x1f0)]('dbid'),_0xfe5f1d=await getErBusinessGroupSummary(_0x3e2bbc['appCode'],_0x4f72fa),_0x49271b=_0xfe5f1d[_0x346696(0x1ee)]['map'](_0x147976=>({..._0x147976,'businessGroup':_0x147976['businessGroup'][_0x346696(0x1e9)]()||_0x346696(0x1f8)}));return{'ok':!![],'data':{..._0xfe5f1d,'groups':_0x49271b,'scope':_0x346696(0x1ea)},'message':'Found\x20'+_0x49271b['length']+_0x346696(0x1e6)+_0x4f72fa};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a68_0x586004=a68_0x1970;(function(_0xabb6c0,_0x4f23b9){const _0x217283=a68_0x1970,_0x134819=_0xabb6c0();while(!![]){try{const _0x58fdad=-parseInt(_0x217283(0x114))/0x1*(parseInt(_0x217283(0x123))/0x2)+parseInt(_0x217283(0x118))/0x3+-parseInt(_0x217283(0x10e))/0x4+parseInt(_0x217283(0x111))/0x5*(parseInt(_0x217283(0x12a))/0x6)+-parseInt(_0x217283(0x11b))/0x7*(parseInt(_0x217283(0x113))/0x8)+parseInt(_0x217283(0x117))/0x9*(parseInt(_0x217283(0x10d))/0xa)+-parseInt(_0x217283(0x128))/0xb*(-parseInt(_0x217283(0x10a))/0xc);if(_0x58fdad===_0x4f23b9)break;else _0x134819['push'](_0x134819['shift']());}catch(_0x2d8d57){_0x134819['push'](_0x134819['shift']());}}}(a68_0x56e2,0x5e551));import{CliErrors}from'../../errors.js';function a68_0x56e2(){const _0x79dd8f=['dbId','727688smLYXg','2611UMzMUC','modelCode','name','1285047nuLUSU','1082658psfchJ','object','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','49AARLmd','METADATA','unknown','dataset','filter','Upgrade\x20or\x20migrate\x20this\x20dataset\x20to\x20a\x20DB_TABLE\x20dataset,\x20then\x20continue\x20with\x20the\x20new\x20dataset\x20code.','dbtableConfig','code','458RfNaAd','datasetName','tableName','Reason:\x20schema\x20introspection\x20and\x20custom\x20SQL\x20require\x20source=DB_TABLE,\x20dbtableConfig.dbId,\x20dbtableConfig.tableName,\x20and\x20a\x20database\x20connection\x20context.','UNKNOWN','59752NsGyRJ','dbtable','1751664GZLCQW','\x20is\x20','source','trim','join','The\x20current\x20dataset\x20\x22','getOne','sourceType','996szbMSQ','\x20and\x20has\x20no\x20DB_TABLE\x20data-source\x20context\x20for\x20','length','50iDfsLU','786280vvnBTB','toUpperCase','Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.','5ZesvuK'];a68_0x56e2=function(){return _0x79dd8f;};return a68_0x56e2();}export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':'lovrabet','filter':a68_0x586004(0x11a),'getOne':'lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress'};export const RUNTIME_DATA_ACCESS_SUMMARY=a68_0x586004(0x110);function valueToString(_0x1d0c16){const _0x5a36e0=a68_0x586004;return _0x1d0c16==null?'':String(_0x1d0c16)[_0x5a36e0(0x12d)]();}function a68_0x1970(_0x4815f3,_0x2b7716){_0x4815f3=_0x4815f3-0x107;const _0x56e26c=a68_0x56e2();let _0x197098=_0x56e26c[_0x4815f3];return _0x197098;}function getDatasetCode(_0x38ec04){const _0x373072=a68_0x586004;return valueToString(_0x38ec04[_0x373072(0x122)]??_0x38ec04[_0x373072(0x115)]??_0x38ec04['dataset']?.['datasetCode']);}function getDatasetName(_0x14e21e){const _0x2c1f4e=a68_0x586004;return valueToString(_0x14e21e[_0x2c1f4e(0x116)]??_0x14e21e[_0x2c1f4e(0x11e)]?.[_0x2c1f4e(0x124)])||_0x2c1f4e(0x11d);}function getDatasetSource(_0x6af620){const _0xcce491=a68_0x586004;return valueToString(_0x6af620[_0xcce491(0x12c)]??_0x6af620[_0xcce491(0x11e)]?.[_0xcce491(0x109)])[_0xcce491(0x10f)]();}function getDbtableConfig(_0x5a0152){const _0x2ccd9c=a68_0x586004,_0x382c22=_0x5a0152[_0x2ccd9c(0x121)]??_0x5a0152[_0x2ccd9c(0x129)];return _0x382c22&&typeof _0x382c22===_0x2ccd9c(0x119)?_0x382c22:{};}export function isDbTableBackedDataset(_0x2be099){const _0x5d5536=a68_0x586004,_0x2643c8=getDatasetSource(_0x2be099);if(_0x2643c8===_0x5d5536(0x11c))return![];const _0x5e85d4=getDbtableConfig(_0x2be099),_0x45e99b=_0x5e85d4[_0x5d5536(0x112)]??_0x5e85d4['id'],_0x430f5a=valueToString(_0x5e85d4[_0x5d5536(0x125)]??_0x2be099[_0x5d5536(0x125)]??_0x2be099['dataset']?.[_0x5d5536(0x125)]);return _0x45e99b!==undefined&&_0x45e99b!==null&&_0x430f5a[_0x5d5536(0x10c)]>0x0;}export function filterDbTableBackedDatasets(_0x3f8f28){return _0x3f8f28['filter'](_0x5852d4=>isDbTableBackedDataset(_0x5852d4));}export function buildDbTableBackedRequirementMessage(_0x20657e,_0x30aa5e='SQL\x20schema\x20validation'){const _0x5042e1=a68_0x586004,_0x53fc11=getDatasetSource(_0x20657e)||_0x5042e1(0x127),_0x591792=getDatasetName(_0x20657e),_0x8dc054=getDatasetCode(_0x20657e),_0xcc88fa=_0x8dc054?'\x20('+_0x8dc054+')':'';return[_0x5042e1(0x107)+_0x591792+'\x22'+_0xcc88fa+_0x5042e1(0x12b)+_0x53fc11+_0x5042e1(0x10b)+_0x30aa5e+'.',_0x5042e1(0x126),_0x5042e1(0x120),'To\x20inspect\x20real\x20runtime\x20rows,\x20switch\x20to\x20lovrabet\x20CLI:\x20'+RUNTIME_DATA_ACCESS_COMMANDS[_0x5042e1(0x11f)]+';\x20'+RUNTIME_DATA_ACCESS_COMMANDS[_0x5042e1(0x108)]+'.'][_0x5042e1(0x12e)]('\x20');}export function assertDatasetIsDbTableBacked(_0x27529c,_0xb14c53){if(!isDbTableBackedDataset(_0x27529c))throw CliErrors['validation'](buildDbTableBackedRequirementMessage(_0x27529c,_0xb14c53));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a69_0x56f580=a69_0x4e2d;(function(_0x4302b0,_0x124022){const _0xe04f7b=a69_0x4e2d,_0xec60df=_0x4302b0();while(!![]){try{const _0x338339=parseInt(_0xe04f7b(0x68))/0x1*(-parseInt(_0xe04f7b(0x71))/0x2)+-parseInt(_0xe04f7b(0x72))/0x3*(-parseInt(_0xe04f7b(0x65))/0x4)+parseInt(_0xe04f7b(0x6d))/0x5+parseInt(_0xe04f7b(0x67))/0x6+-parseInt(_0xe04f7b(0x6b))/0x7*(-parseInt(_0xe04f7b(0x64))/0x8)+parseInt(_0xe04f7b(0x6a))/0x9*(-parseInt(_0xe04f7b(0x73))/0xa)+-parseInt(_0xe04f7b(0x6f))/0xb;if(_0x338339===_0x124022)break;else _0xec60df['push'](_0xec60df['shift']());}catch(_0x466f2a){_0xec60df['push'](_0xec60df['shift']());}}}(a69_0x15f3,0x9dc53));import{createCrossDbRelation}from'../../core/api-client.js';import{CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_TO_DATASET_FLAG,CROSS_RELATION_TO_COLUMN_FLAG,CROSS_RELATION_LABEL_FLAG,CROSS_RELATION_CARDINALITY_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{executeCrossRelation,previewCrossRelation,validateCrossRelation}from'../../commands/dataset/cross-relation-shared.js';function a69_0x4e2d(_0x4414fa,_0x400ecd){_0x4414fa=_0x4414fa-0x64;const _0x15f36e=a69_0x15f3();let _0x4e2d05=_0x15f36e[_0x4414fa];return _0x4e2d05;}function a69_0x15f3(){const _0x1e826e=['35yqRacL','dataset','18fLFBmy','1530193jwkQhE','create','6088810rKDqAr','Create\x20a\x20logical\x20relation\x20between\x20DB_TABLE\x20datasets\x20in\x20different\x20database\x20connections','11933702OMhomP','write','14218JkUdJp','3yCZHyl','4310350eAqrXr','8AtwyRx','2028788AIbiSn','cross-relation-create','5390616orUXKL'];a69_0x15f3=function(){return _0x1e826e;};return a69_0x15f3();}export const datasetCrossRelationCreate={'service':a69_0x56f580(0x69),'command':a69_0x56f580(0x66),'description':a69_0x56f580(0x6e),'risk':a69_0x56f580(0x70),'strictFlags':!![],'requiresCookieAuth':!![],'structuredErrors':!![],'flags':[CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_TO_DATASET_FLAG,CROSS_RELATION_TO_COLUMN_FLAG,CROSS_RELATION_LABEL_FLAG,CROSS_RELATION_CARDINALITY_FLAG,APPCODE_FLAG_OPTIONAL],'validate':async _0x2c1807=>validateCrossRelation(_0x2c1807,a69_0x56f580(0x6c)),'dryRun':_0x4db6e5=>previewCrossRelation(_0x4db6e5,a69_0x56f580(0x6c)),'execute':_0x1b8e2d=>executeCrossRelation(_0x1b8e2d,a69_0x56f580(0x6c),createCrossDbRelation)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a70_0x325311=a70_0x160a;(function(_0x400c7b,_0x6280ac){const _0x598f31=a70_0x160a,_0x2070e1=_0x400c7b();while(!![]){try{const _0x1ecd0e=parseInt(_0x598f31(0xbb))/0x1*(-parseInt(_0x598f31(0xba))/0x2)+parseInt(_0x598f31(0xbc))/0x3+parseInt(_0x598f31(0xb9))/0x4+parseInt(_0x598f31(0xb3))/0x5+parseInt(_0x598f31(0xb6))/0x6+-parseInt(_0x598f31(0xb8))/0x7*(parseInt(_0x598f31(0xb7))/0x8)+-parseInt(_0x598f31(0xbd))/0x9;if(_0x1ecd0e===_0x6280ac)break;else _0x2070e1['push'](_0x2070e1['shift']());}catch(_0x2a0cc6){_0x2070e1['push'](_0x2070e1['shift']());}}}(a70_0x15d2,0x56ee2));import{deleteCrossDbRelation}from'../../core/api-client.js';import{CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_DBLINK_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{executeCrossRelation,previewCrossRelation,validateCrossRelation}from'../../commands/dataset/cross-relation-shared.js';function a70_0x15d2(){const _0x2db738=['2424156cJJKTp','2yBszCj','390658eMoRAa','174258JgCFsM','610956GberXU','delete','3283905IsreIQ','cross-relation-delete','high-risk-write','188028RQYZfs','48ErMzEE','627242nZJjoH'];a70_0x15d2=function(){return _0x2db738;};return a70_0x15d2();}function a70_0x160a(_0x57fc01,_0x788d8f){_0x57fc01=_0x57fc01-0xb2;const _0x15d27b=a70_0x15d2();let _0x160aea=_0x15d27b[_0x57fc01];return _0x160aea;}export const datasetCrossRelationDelete={'service':'dataset','command':a70_0x325311(0xb4),'description':'Delete\x20the\x20single\x20cross-database\x20relation\x20matching\x20a\x20source\x20dataset\x20and\x20field','risk':a70_0x325311(0xb5),'strictFlags':!![],'requiresCookieAuth':!![],'structuredErrors':!![],'flags':[CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_DBLINK_FLAG,APPCODE_FLAG_OPTIONAL],'validate':async _0xc62d66=>validateCrossRelation(_0xc62d66,'delete'),'dryRun':_0x3343ee=>previewCrossRelation(_0x3343ee,'delete'),'execute':_0x1b93ae=>executeCrossRelation(_0x1b93ae,a70_0x325311(0xb2),deleteCrossDbRelation)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a71_0x2f29(){const _0x4668d1=['cross-relation-list','9299479YBtPGx','length','1676450uXZWSq','3283040REXTLH','63492RLMjDQ','appCode','20981600DFPQOg','List\x20outgoing\x20cross-database\x20relations\x20by\x20source\x20dataset\x20or\x20database\x20connection','50XTrrIb','28000CVwJqT','Cross-database\x20relations:\x20','map','8UyiZDM','8731575vJUgXf','read','12ZlBaIw'];a71_0x2f29=function(){return _0x4668d1;};return a71_0x2f29();}const a71_0x19dafc=a71_0xb36e;(function(_0x2229b4,_0x5154e6){const _0x53402b=a71_0xb36e,_0x11b962=_0x2229b4();while(!![]){try{const _0x4e09d2=-parseInt(_0x53402b(0x17c))/0x1*(parseInt(_0x53402b(0x17b))/0x2)+parseInt(_0x53402b(0x177))/0x3+-parseInt(_0x53402b(0x176))/0x4+parseInt(_0x53402b(0x175))/0x5*(parseInt(_0x53402b(0x171))/0x6)+-parseInt(_0x53402b(0x173))/0x7*(parseInt(_0x53402b(0x17f))/0x8)+parseInt(_0x53402b(0x180))/0x9+parseInt(_0x53402b(0x179))/0xa;if(_0x4e09d2===_0x5154e6)break;else _0x11b962['push'](_0x11b962['shift']());}catch(_0x10d41a){_0x11b962['push'](_0x11b962['shift']());}}}(a71_0x2f29,0xde5e6));import{queryCrossDbRelations}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CROSS_RELATION_DBLINK_FLAG,CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG}from'../../commands/common/flags.js';function a71_0xb36e(_0x39b627,_0x32d70f){_0x39b627=_0x39b627-0x171;const _0x2f29a9=a71_0x2f29();let _0xb36ed1=_0x2f29a9[_0x39b627];return _0xb36ed1;}import{projectCrossRelation,resolveCrossRelationQuery,validateCrossRelation}from'../../commands/dataset/cross-relation-shared.js';export const datasetCrossRelationList={'service':'dataset','command':a71_0x19dafc(0x172),'description':a71_0x19dafc(0x17a),'risk':a71_0x19dafc(0x181),'strictFlags':!![],'requiresCookieAuth':!![],'structuredErrors':!![],'flags':[{...CROSS_RELATION_FROM_DATASET_FLAG,'required':![]},CROSS_RELATION_DBLINK_FLAG,{...CROSS_RELATION_FROM_COLUMN_FLAG,'required':![]},APPCODE_FLAG_OPTIONAL],'validate':async _0x39ba63=>validateCrossRelation(_0x39ba63,'list'),async 'execute'(_0x56f76b){const _0x34c3fb=a71_0x19dafc,_0x3eba18=await resolveCrossRelationQuery(_0x56f76b),_0x5d69a0=await queryCrossDbRelations(_0x3eba18);return{'ok':!![],'data':{'appCode':_0x56f76b[_0x34c3fb(0x178)],'selector':_0x3eba18,'total':_0x5d69a0[_0x34c3fb(0x174)],'relations':_0x5d69a0[_0x34c3fb(0x17e)](projectCrossRelation)},'message':_0x34c3fb(0x17d)+_0x5d69a0['length']+'\x20relation(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a72_0x31ca6c=a72_0xe622;(function(_0x39f5f7,_0x1ea992){const _0x348efe=a72_0xe622,_0x9efa4f=_0x39f5f7();while(!![]){try{const _0x4192ed=-parseInt(_0x348efe(0x19c))/0x1+parseInt(_0x348efe(0x187))/0x2*(-parseInt(_0x348efe(0x18a))/0x3)+parseInt(_0x348efe(0x194))/0x4*(-parseInt(_0x348efe(0x175))/0x5)+parseInt(_0x348efe(0x1a0))/0x6*(parseInt(_0x348efe(0x17a))/0x7)+-parseInt(_0x348efe(0x192))/0x8*(-parseInt(_0x348efe(0x189))/0x9)+parseInt(_0x348efe(0x1ba))/0xa+parseInt(_0x348efe(0x1a7))/0xb;if(_0x4192ed===_0x1ea992)break;else _0x9efa4f['push'](_0x9efa4f['shift']());}catch(_0x5ee759){_0x9efa4f['push'](_0x9efa4f['shift']());}}}(a72_0x31ac,0xb9381));import{getDatasetDetail,queryCrossDbRelations}from'../../core/api-client.js';import{CROSS_DB_RELATION_PATHS}from'../../core/cross-db-relation.js';import{CliError,CliErrors}from'../../errors.js';import{CROSS_RELATION_CARDINALITY_FLAG}from'../../commands/common/flags.js';function required(_0x3bb325,_0x5d4501){const _0x3c829c=a72_0xe622,_0x3fd6e9=_0x3bb325[_0x3c829c(0x182)](_0x5d4501)[_0x3c829c(0x1b1)]();if(!_0x3fd6e9)throw CliErrors[_0x3c829c(0x19f)](_0x5d4501);return _0x3fd6e9;}function a72_0xe622(_0x169b8d,_0x59ad0f){_0x169b8d=_0x169b8d-0x16e;const _0x31ace8=a72_0x31ac();let _0xe6227f=_0x31ace8[_0x169b8d];return _0xe6227f;}function explicitDblink(_0x398d8c){const _0x162378=a72_0xe622,_0x454e27=_0x398d8c[_0x162378(0x1be)](_0x162378(0x193));if(_0x454e27===undefined||_0x454e27===null)return undefined;const _0x112085=Number(_0x454e27);if(!Number[_0x162378(0x19e)](_0x112085)||_0x112085<=0x0)throw CliErrors[_0x162378(0x1c3)](_0x162378(0x1af));return _0x112085;}function a72_0x31ac(){const _0x350f95=['includes','relationId','sourceType','4809270YyueeG','enum','toDatasetCode','The\x20target\x20display\x20field\x20is\x20inherited.\x20When\x20changing\x20the\x20target\x20dataset,\x20provide\x20--to-label-column\x20explicitly.','\x20must\x20be\x20a\x20DB_TABLE\x20dataset.','7ShgtPP','map','delete','to-datasetcode','filter','from-column','catch','tableName','str','parse','\x20write\x20was\x20not\x20verified.','dbtable','storageProfile','2WJHiWJ','fromField','18TbkqKz','3885498YBUAzK','defineProperty','The\x20write\x20was\x20accepted,\x20but\x20current\x20state\x20could\x20not\x20be\x20confirmed.\x20Run\x20dataset\x20cross-relation-list\x20before\x20attempting\x20another\x20write.','before','dataset','Cross-database\x20relation\x20already\x20exists\x20for\x20these\x20source\x20and\x20target\x20endpoints.','message','update','2017488zPUPhU','from-dblink-id','4AGIKwY','source','body','expectedCardinality','DB_TABLE','multiple\x20cross-database\x20relations\x20matched','query','Invalid\x20--cardinality.','579969xPukqD','apiError','isSafeInteger','flagMissing','642378YsGuIc','--from-dblink-id\x20does\x20not\x20match\x20the\x20source\x20dataset\x20connection.','Would\x20','appCode','some','fromTableName','expectedLabel','23778920dAduEv','\x20verified.','data','fromDatasetCode','dbId','refTableLabelName','relationType','POST','--from-dblink-id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','datasetCode','trim','toTableName','label_inherited','table','toLowerCase','fromDblinkId','unconfirmed','string','dbtableConfig','8224910CdGVBU','Cross-database\x20relation\x20','from','cardinality','flag','\x20is\x20missing\x20its\x20database\x20connection\x20or\x20physical\x20table\x20name.','toDblinkId','to-label-column','toField','validation','fromDatasetName','extend','from-datasetcode','length','Dataset\x20','dblinkId','\x20a\x20cross-database\x20relation\x20for\x20','Provide\x20--from-datasetcode\x20or\x20--from-dblink-id.'];a72_0x31ac=function(){return _0x350f95;};return a72_0x31ac();}export function validateCrossRelation(_0x4ae527,_0x59f762){const _0x15f967=a72_0xe622,_0x3967d4=explicitDblink(_0x4ae527);if(_0x59f762==='list'){if(!_0x4ae527[_0x15f967(0x182)]('from-datasetcode')['trim']()&&_0x3967d4===undefined)throw CliErrors[_0x15f967(0x1c3)](_0x15f967(0x171));return;}required(_0x4ae527,_0x15f967(0x1c6)),required(_0x4ae527,_0x15f967(0x17f));if(_0x59f762!==_0x15f967(0x17c)){required(_0x4ae527,'to-datasetcode'),required(_0x4ae527,'to-column');const _0x1c0766=_0x4ae527[_0x15f967(0x182)](_0x15f967(0x1bd))[_0x15f967(0x1b1)]();if(_0x1c0766&&!CROSS_RELATION_CARDINALITY_FLAG[_0x15f967(0x176)][_0x15f967(0x172)](_0x1c0766))throw CliErrors[_0x15f967(0x1c3)](_0x15f967(0x19b));}}async function resolveEndpoint(_0x269472){const _0x32b9f3=a72_0xe622,_0x5a3b06=await getDatasetDetail(_0x269472),_0x478b91=_0x5a3b06?.[_0x32b9f3(0x18e)]??{};if((_0x5a3b06?.[_0x32b9f3(0x195)]??_0x478b91[_0x32b9f3(0x174)])!==_0x32b9f3(0x198))throw CliErrors['validation'](_0x32b9f3(0x16e)+_0x269472+_0x32b9f3(0x179));const _0x375edd=_0x5a3b06[_0x32b9f3(0x1b9)]??_0x5a3b06[_0x32b9f3(0x185)]??{};let _0x6d78a2=_0x5a3b06[_0x32b9f3(0x1c5)]??_0x478b91['extend']??{};if(typeof _0x6d78a2===_0x32b9f3(0x1b8))try{_0x6d78a2=_0x6d78a2[_0x32b9f3(0x1b1)]()?JSON[_0x32b9f3(0x183)](_0x6d78a2):{};}catch{throw CliErrors['validation'](_0x32b9f3(0x16e)+_0x269472+'\x20has\x20invalid\x20storage\x20configuration.');}const _0x34c90e=Number(_0x6d78a2?.[_0x32b9f3(0x186)]?.[_0x32b9f3(0x1ab)]??_0x5a3b06[_0x32b9f3(0x186)]?.[_0x32b9f3(0x1ab)]??_0x478b91[_0x32b9f3(0x186)]?.[_0x32b9f3(0x1ab)]??_0x375edd['dbId']??_0x478b91[_0x32b9f3(0x1ab)]??_0x5a3b06[_0x32b9f3(0x1ab)]),_0x5ded3d=String(_0x5a3b06[_0x32b9f3(0x181)]??_0x478b91['tableName']??_0x375edd[_0x32b9f3(0x181)]??'')['trim']();if(!Number[_0x32b9f3(0x19e)](_0x34c90e)||_0x34c90e<=0x0||!_0x5ded3d)throw CliErrors[_0x32b9f3(0x1c3)](_0x32b9f3(0x16e)+_0x269472+_0x32b9f3(0x1bf));return{'datasetCode':_0x269472,'dblinkId':_0x34c90e,'table':_0x5ded3d};}export async function resolveCrossRelationQuery(_0x4906f7){const _0x403197=a72_0xe622,_0x2cb8d1=_0x4906f7['str'](_0x403197(0x1c6))[_0x403197(0x1b1)](),_0x3d7c1b=explicitDblink(_0x4906f7),_0x45a039=_0x2cb8d1?await resolveEndpoint(_0x2cb8d1):undefined;if(_0x45a039&&_0x3d7c1b!==undefined&&_0x45a039['dblinkId']!==_0x3d7c1b)throw CliErrors[_0x403197(0x1c3)](_0x403197(0x1a1));const _0x4aa298=_0x45a039?.[_0x403197(0x16f)]??_0x3d7c1b;if(_0x4aa298===undefined)throw CliErrors[_0x403197(0x1c3)]('Provide\x20--from-datasetcode\x20or\x20--from-dblink-id.');return{'appCode':_0x4906f7[_0x403197(0x1a3)],'fromDblinkId':_0x4aa298,..._0x2cb8d1?{'fromDatasetCode':_0x2cb8d1}:{},..._0x4906f7[_0x403197(0x182)]('from-column')[_0x403197(0x1b1)]()?{'fromField':_0x4906f7['str'](_0x403197(0x17f))['trim']()}:{}};}export function projectCrossRelation(_0x34c45f){const _0x4569e6=a72_0xe622;return{'relationId':_0x34c45f[_0x4569e6(0x173)],'from':{'source':_0x4569e6(0x198),'datasetCode':_0x34c45f[_0x4569e6(0x1aa)],'datasetName':_0x34c45f[_0x4569e6(0x1c4)],'dblinkId':_0x34c45f[_0x4569e6(0x1b6)],'table':_0x34c45f['fromTableName'],'field':_0x34c45f[_0x4569e6(0x188)]},'to':{'source':_0x4569e6(0x198),'datasetCode':_0x34c45f[_0x4569e6(0x177)],'datasetName':_0x34c45f['toDatasetName'],'dblinkId':_0x34c45f['toDblinkId'],'table':_0x34c45f[_0x4569e6(0x1b2)],'field':_0x34c45f[_0x4569e6(0x1c2)],'labelField':_0x34c45f[_0x4569e6(0x1ac)]},'relation':{'cardinality':_0x34c45f[_0x4569e6(0x1bd)],'relationType':_0x34c45f[_0x4569e6(0x1ad)]}};}function ambiguity(_0x5896b0){const _0x571ed5=a72_0xe622,_0x1e3e2f=CliErrors[_0x571ed5(0x1c3)]('Multiple\x20cross-database\x20relations\x20match\x20this\x20source\x20field;\x20update/delete\x20cannot\x20select\x20one\x20target.','Run\x20dataset\x20cross-relation-list\x20to\x20inspect\x20the\x20candidates.\x20This\x20command\x20accepts\x20only\x20a\x20source\x20dataset\x20and\x20field.');return Object[_0x571ed5(0x18b)](_0x1e3e2f,_0x571ed5(0x1a9),{'value':{'candidates':_0x5896b0[_0x571ed5(0x17b)](projectCrossRelation)}}),_0x1e3e2f;}const sameName=(_0x418055,_0x477cb3)=>_0x418055['toLowerCase']()===_0x477cb3[a72_0x31ca6c(0x1b5)]();function matchesEndpoint(_0x48ee0b,_0x275a15,_0x53e28d,_0x220236,_0x326e83){const _0x45458a=a72_0x31ca6c;return _0x48ee0b['fromDblinkId']===_0x275a15[_0x45458a(0x16f)]&&sameName(_0x48ee0b[_0x45458a(0x1a5)],_0x275a15['table'])&&sameName(_0x48ee0b['fromField'],_0x53e28d)&&_0x48ee0b[_0x45458a(0x1c0)]===_0x220236[_0x45458a(0x16f)]&&sameName(_0x48ee0b[_0x45458a(0x1b2)],_0x220236[_0x45458a(0x1b4)])&&sameName(_0x48ee0b[_0x45458a(0x1c2)],_0x326e83);}export async function prepareCrossRelation(_0x2acdc8,_0x40433b){const _0x4d3fc8=a72_0x31ca6c,_0x35f403=await resolveEndpoint(required(_0x2acdc8,_0x4d3fc8(0x1c6))),_0xb7f5dc=explicitDblink(_0x2acdc8);if(_0xb7f5dc!==undefined&&_0x35f403[_0x4d3fc8(0x16f)]!==_0xb7f5dc)throw CliErrors['validation'](_0x4d3fc8(0x1a1));const _0x5b6788={'appCode':_0x2acdc8['appCode'],'fromDatasetCode':_0x35f403[_0x4d3fc8(0x1b0)],'fromField':required(_0x2acdc8,'from-column'),..._0xb7f5dc!==undefined?{'fromDblinkId':_0xb7f5dc}:{}},_0x5c6c8a={'appCode':_0x2acdc8[_0x4d3fc8(0x1a3)],'fromDblinkId':_0x35f403[_0x4d3fc8(0x16f)],'fromDatasetCode':_0x35f403[_0x4d3fc8(0x1b0)],'fromField':_0x5b6788[_0x4d3fc8(0x188)]},_0x38eec7=await queryCrossDbRelations(_0x5c6c8a);let _0x5236e4=null;if(_0x40433b!=='create'){if(_0x38eec7[_0x4d3fc8(0x1c7)]>0x1)throw ambiguity(_0x38eec7);_0x5236e4=_0x38eec7[0x0]??null;if(!_0x5236e4)throw CliErrors[_0x4d3fc8(0x1c3)]('Cross-database\x20relation\x20not\x20found\x20for\x20this\x20source\x20dataset\x20and\x20field.');}if(_0x40433b===_0x4d3fc8(0x17c))return{'operation':_0x40433b,'from':_0x35f403,'query':_0x5c6c8a,'body':_0x5b6788,'before':_0x5236e4};const _0x2db6dc=await resolveEndpoint(required(_0x2acdc8,_0x4d3fc8(0x17d)));if(_0x35f403[_0x4d3fc8(0x16f)]===_0x2db6dc['dblinkId'])throw CliErrors[_0x4d3fc8(0x1c3)]('Cross-database\x20relations\x20require\x20different\x20source\x20and\x20target\x20database\x20connections.');const _0xd48e6f=_0x2acdc8['str'](_0x4d3fc8(0x1c1))[_0x4d3fc8(0x1b1)](),_0x245b6a=_0x2acdc8[_0x4d3fc8(0x182)](_0x4d3fc8(0x1bd))['trim'](),_0x3ef4e4={..._0x5b6788,'toDatasetCode':_0x2db6dc[_0x4d3fc8(0x1b0)],'toField':required(_0x2acdc8,'to-column'),..._0xd48e6f?{'refTableLabelName':_0xd48e6f}:{},..._0x245b6a?{'cardinality':_0x245b6a}:{}};if(_0x38eec7[_0x4d3fc8(0x1a4)](_0x5c81a3=>_0x5c81a3[_0x4d3fc8(0x173)]!==_0x5236e4?.['relationId']&&matchesEndpoint(_0x5c81a3,_0x35f403,_0x3ef4e4[_0x4d3fc8(0x188)],_0x2db6dc,_0x3ef4e4[_0x4d3fc8(0x1c2)])))throw CliErrors[_0x4d3fc8(0x1c3)](_0x4d3fc8(0x18f));return{'operation':_0x40433b,'from':_0x35f403,'to':_0x2db6dc,'query':_0x5c6c8a,'body':_0x3ef4e4,'before':_0x5236e4,'expectedLabel':_0xd48e6f||_0x5236e4?.['refTableLabelName']||_0x3ef4e4[_0x4d3fc8(0x1c2)],'expectedCardinality':_0x245b6a||_0x5236e4?.[_0x4d3fc8(0x1bd)]||null};}function mutationData(_0x80a4cb,_0x33f571,_0x425129){const _0x19fcc8=a72_0x31ca6c,{operation:_0x1b9dfb,body:_0x4c0983,before:_0xb9254a}=_0x80a4cb;return{'operation':_0x1b9dfb,'selector':{'appCode':_0x4c0983[_0x19fcc8(0x1a3)],'from':{'datasetCode':_0x4c0983[_0x19fcc8(0x1aa)],'field':_0x4c0983['fromField'],'dblinkId':_0x80a4cb[_0x19fcc8(0x1bc)][_0x19fcc8(0x16f)]}},'before':_0xb9254a?projectCrossRelation(_0xb9254a):null,'after':_0x425129,'dryRun':_0x33f571,'backend':{'method':_0x19fcc8(0x1ae),'path':CROSS_DB_RELATION_PATHS[_0x1b9dfb]},'warnings':_0x1b9dfb===_0x19fcc8(0x191)&&!_0x4c0983[_0x19fcc8(0x1ac)]?[{'code':_0x19fcc8(0x1b3),'message':_0x19fcc8(0x178)}]:[]};}export async function previewCrossRelation(_0x3ffd93,_0x2a76e8){const _0x31258e=a72_0x31ca6c,_0x152047=await prepareCrossRelation(_0x3ffd93,_0x2a76e8),_0x54afb1=_0x152047[_0x31258e(0x196)],_0x98739d=_0x2a76e8===_0x31258e(0x17c)?null:{..._0x152047['before']?{'relationId':_0x152047[_0x31258e(0x18d)][_0x31258e(0x173)]}:{},'from':{'datasetCode':_0x152047['from']['datasetCode'],'dblinkId':_0x152047['from'][_0x31258e(0x16f)],'table':_0x152047[_0x31258e(0x1bc)][_0x31258e(0x1b4)],'field':_0x54afb1[_0x31258e(0x188)]},'to':{'datasetCode':_0x152047['to'][_0x31258e(0x1b0)],'dblinkId':_0x152047['to']['dblinkId'],'table':_0x152047['to']['table'],'field':_0x54afb1[_0x31258e(0x1c2)],'labelField':_0x152047[_0x31258e(0x1a6)]},'relation':{'cardinality':_0x152047[_0x31258e(0x197)],'relationType':0x2}};return{...mutationData(_0x152047,!![],null),'after':_0x98739d,'method':'POST','url':CROSS_DB_RELATION_PATHS[_0x2a76e8],'body':_0x152047[_0x31258e(0x196)],'description':_0x31258e(0x1a2)+_0x2a76e8+_0x31258e(0x170)+_0x54afb1['fromDatasetCode']+'.'+_0x54afb1['fromField']};}export async function executeCrossRelation(_0x1e5081,_0x3a72eb,_0x3bc4fa){const _0x5a2c54=a72_0x31ca6c,_0x211914=await prepareCrossRelation(_0x1e5081,_0x3a72eb);try{await _0x3bc4fa(_0x211914[_0x5a2c54(0x196)]);}catch(_0x213292){if(_0x213292 instanceof CliError&&_0x213292[_0x5a2c54(0x190)][_0x5a2c54(0x172)](_0x5a2c54(0x199))){const _0x343dec=await queryCrossDbRelations(_0x211914[_0x5a2c54(0x19a)])[_0x5a2c54(0x180)](()=>[]);throw ambiguity(_0x343dec);}throw _0x213292;}let _0x3557d5=[],_0x3bcdcc,_0x832922=![];try{_0x3557d5=await queryCrossDbRelations(_0x211914['query']);if(_0x3a72eb==='delete')_0x832922=!_0x3557d5[_0x5a2c54(0x1a4)](_0x267c63=>_0x267c63['relationId']===_0x211914[_0x5a2c54(0x18d)][_0x5a2c54(0x173)]);else{const _0x881e12=_0x211914[_0x5a2c54(0x196)],_0x489ed1=_0x3557d5[_0x5a2c54(0x17e)](_0x35c2b5=>matchesEndpoint(_0x35c2b5,_0x211914[_0x5a2c54(0x1bc)],_0x881e12[_0x5a2c54(0x188)],_0x211914['to'],_0x881e12[_0x5a2c54(0x1c2)])&&(_0x3a72eb==='create'||_0x35c2b5[_0x5a2c54(0x173)]===_0x211914[_0x5a2c54(0x18d)][_0x5a2c54(0x173)]));_0x3bcdcc=_0x489ed1[_0x5a2c54(0x1c7)]===0x1?_0x489ed1[0x0]:undefined,_0x832922=!!_0x3bcdcc&&_0x3bcdcc[_0x5a2c54(0x1ac)]===_0x211914[_0x5a2c54(0x1a6)]&&_0x3bcdcc[_0x5a2c54(0x1bd)]===_0x211914[_0x5a2c54(0x197)]&&_0x3bcdcc[_0x5a2c54(0x1ad)]===0x2;}}catch{}const _0x1d6d45={...mutationData(_0x211914,![],_0x3bcdcc?projectCrossRelation(_0x3bcdcc):null),'verification':{'status':_0x832922?'matched':_0x5a2c54(0x1b7),'verified':_0x832922}};if(!_0x832922){const _0x572446=CliErrors[_0x5a2c54(0x19d)](_0x5a2c54(0x1bb)+_0x3a72eb+_0x5a2c54(0x184),_0x5a2c54(0x18c));Object[_0x5a2c54(0x18b)](_0x572446,'data',{'value':{..._0x1d6d45,'candidates':_0x3557d5[_0x5a2c54(0x17b)](projectCrossRelation)}});throw _0x572446;}return{'ok':!![],'data':_0x1d6d45,'message':_0x5a2c54(0x1bb)+_0x3a72eb+_0x5a2c54(0x1a8)};}
|
|
1
|
+
function a72_0x579e(_0x2e65a7,_0x2e7173){_0x2e65a7=_0x2e65a7-0xa8;const _0xe0f479=a72_0xe0f4();let _0x579e1f=_0xe0f479[_0x2e65a7];return _0x579e1f;}const a72_0x437a82=a72_0x579e;(function(_0x3f4da2,_0x427596){const _0x5b9d68=a72_0x579e,_0x1f4c21=_0x3f4da2();while(!![]){try{const _0x360333=parseInt(_0x5b9d68(0xfe))/0x1+parseInt(_0x5b9d68(0xe8))/0x2*(-parseInt(_0x5b9d68(0xde))/0x3)+-parseInt(_0x5b9d68(0xbf))/0x4+-parseInt(_0x5b9d68(0xab))/0x5*(parseInt(_0x5b9d68(0xfc))/0x6)+-parseInt(_0x5b9d68(0xbc))/0x7+-parseInt(_0x5b9d68(0xce))/0x8*(-parseInt(_0x5b9d68(0xf4))/0x9)+parseInt(_0x5b9d68(0xc4))/0xa;if(_0x360333===_0x427596)break;else _0x1f4c21['push'](_0x1f4c21['shift']());}catch(_0x2334fa){_0x1f4c21['push'](_0x1f4c21['shift']());}}}(a72_0xe0f4,0x18d87));import{getDatasetDetail,queryCrossDbRelations}from'../../core/api-client.js';import{CROSS_DB_RELATION_PATHS}from'../../core/cross-db-relation.js';import{CliError,CliErrors}from'../../errors.js';import{CROSS_RELATION_CARDINALITY_FLAG}from'../../commands/common/flags.js';function required(_0x545a8d,_0x37d361){const _0x3e96fb=a72_0x579e,_0x2f6f1d=_0x545a8d[_0x3e96fb(0xe7)](_0x37d361)['trim']();if(!_0x2f6f1d)throw CliErrors[_0x3e96fb(0xc5)](_0x37d361);return _0x2f6f1d;}function explicitDblink(_0x496ea8){const _0x2611b6=a72_0x579e,_0x3cb94a=_0x496ea8[_0x2611b6(0xeb)]('from-dblink-id');if(_0x3cb94a===undefined||_0x3cb94a===null)return undefined;const _0x5d99a8=Number(_0x3cb94a);if(!Number[_0x2611b6(0xc3)](_0x5d99a8)||_0x5d99a8<=0x0)throw CliErrors[_0x2611b6(0xb4)](_0x2611b6(0xe0));return _0x5d99a8;}export function validateCrossRelation(_0x1af598,_0x33ad19){const _0x1b2096=a72_0x579e,_0x92099e=explicitDblink(_0x1af598);if(_0x33ad19===_0x1b2096(0xcd)){if(!_0x1af598[_0x1b2096(0xe7)](_0x1b2096(0xc2))[_0x1b2096(0xd6)]()&&_0x92099e===undefined)throw CliErrors[_0x1b2096(0xb4)](_0x1b2096(0xd3));return;}required(_0x1af598,'from-datasetcode'),required(_0x1af598,_0x1b2096(0xc9));if(_0x33ad19!==_0x1b2096(0xd8)){required(_0x1af598,'to-datasetcode'),required(_0x1af598,'to-column');const _0x2ed52c=_0x1af598[_0x1b2096(0xe7)](_0x1b2096(0xc6))[_0x1b2096(0xd6)]();if(_0x2ed52c&&!CROSS_RELATION_CARDINALITY_FLAG[_0x1b2096(0xc8)][_0x1b2096(0xb9)](_0x2ed52c))throw CliErrors[_0x1b2096(0xb4)](_0x1b2096(0xf2));}}async function resolveEndpoint(_0x522cc5){const _0x12a9d=a72_0x579e,_0x4ebd51=await getDatasetDetail(_0x522cc5),_0x2ac89a=_0x4ebd51?.[_0x12a9d(0xbe)]??{};if((_0x4ebd51?.[_0x12a9d(0xb6)]??_0x2ac89a[_0x12a9d(0xe9)])!=='DB_TABLE')throw CliErrors['validation'](_0x12a9d(0xa8)+_0x522cc5+_0x12a9d(0xaa));const _0x1d67df=_0x4ebd51[_0x12a9d(0xb1)]??_0x4ebd51[_0x12a9d(0xb0)]??{};let _0x3f9a1b=_0x4ebd51[_0x12a9d(0xdd)]??_0x2ac89a['extend']??{};if(typeof _0x3f9a1b===_0x12a9d(0xd0))try{_0x3f9a1b=_0x3f9a1b[_0x12a9d(0xd6)]()?JSON[_0x12a9d(0xcb)](_0x3f9a1b):{};}catch{throw CliErrors['validation'](_0x12a9d(0xa8)+_0x522cc5+_0x12a9d(0xfb));}const _0x4fc4c0=Number(_0x3f9a1b?.[_0x12a9d(0xf1)]?.['dbId']??_0x4ebd51[_0x12a9d(0xf1)]?.[_0x12a9d(0xc7)]??_0x2ac89a['storageProfile']?.[_0x12a9d(0xc7)]??_0x1d67df[_0x12a9d(0xc7)]??_0x2ac89a['dbId']??_0x4ebd51['dbId']),_0x208e41=String(_0x4ebd51[_0x12a9d(0xe6)]??_0x2ac89a[_0x12a9d(0xe6)]??_0x1d67df['tableName']??'')[_0x12a9d(0xd6)]();if(!Number[_0x12a9d(0xc3)](_0x4fc4c0)||_0x4fc4c0<=0x0||!_0x208e41)throw CliErrors[_0x12a9d(0xb4)]('Dataset\x20'+_0x522cc5+_0x12a9d(0xae));return{'datasetCode':_0x522cc5,'dblinkId':_0x4fc4c0,'table':_0x208e41};}export async function resolveCrossRelationQuery(_0x3a11de){const _0x38a602=a72_0x579e,_0x18f79a=_0x3a11de['str'](_0x38a602(0xc2))[_0x38a602(0xd6)](),_0x8f4dea=explicitDblink(_0x3a11de),_0x1ab808=_0x18f79a?await resolveEndpoint(_0x18f79a):undefined;if(_0x1ab808&&_0x8f4dea!==undefined&&_0x1ab808[_0x38a602(0xcc)]!==_0x8f4dea)throw CliErrors['validation'](_0x38a602(0xdb));const _0x2408da=_0x1ab808?.[_0x38a602(0xcc)]??_0x8f4dea;if(_0x2408da===undefined)throw CliErrors[_0x38a602(0xb4)]('Provide\x20--from-datasetcode\x20or\x20--from-dblink-id.');return{'appCode':_0x3a11de[_0x38a602(0xd1)],'fromDblinkId':_0x2408da,..._0x18f79a?{'fromDatasetCode':_0x18f79a}:{},..._0x3a11de['str']('from-column')[_0x38a602(0xd6)]()?{'fromField':_0x3a11de[_0x38a602(0xe7)]('from-column')['trim']()}:{}};}export function projectCrossRelation(_0xcf0936){const _0x1059ce=a72_0x579e;return{'relationId':_0xcf0936[_0x1059ce(0xfd)],'from':{'source':_0x1059ce(0xda),'datasetCode':_0xcf0936[_0x1059ce(0xad)],'datasetName':_0xcf0936[_0x1059ce(0xff)],'dblinkId':_0xcf0936[_0x1059ce(0xa9)],'table':_0xcf0936[_0x1059ce(0xed)],'field':_0xcf0936[_0x1059ce(0xec)]},'to':{'source':_0x1059ce(0xda),'datasetCode':_0xcf0936[_0x1059ce(0xe2)],'datasetName':_0xcf0936['toDatasetName'],'dblinkId':_0xcf0936[_0x1059ce(0xb5)],'table':_0xcf0936['toTableName'],'field':_0xcf0936[_0x1059ce(0xf7)],'labelField':_0xcf0936[_0x1059ce(0xb3)]},'relation':{'cardinality':_0xcf0936['cardinality'],'relationType':_0xcf0936[_0x1059ce(0xd4)]}};}function ambiguity(_0x4f6793){const _0x113178=a72_0x579e,_0x540d52=CliErrors[_0x113178(0xb4)](_0x113178(0xcf),_0x113178(0xc1));return Object[_0x113178(0xc0)](_0x540d52,_0x113178(0xe3),{'value':{'candidates':_0x4f6793['map'](projectCrossRelation)}}),_0x540d52;}const sameName=(_0x1bd27f,_0x40a1e0)=>_0x1bd27f[a72_0x437a82(0xb2)]()===_0x40a1e0[a72_0x437a82(0xb2)]();function matchesEndpoint(_0x1f2674,_0x1c5bfd,_0x483b7e,_0x3d3eec,_0x2998d5){const _0x36591e=a72_0x437a82;return _0x1f2674['fromDblinkId']===_0x1c5bfd[_0x36591e(0xcc)]&&sameName(_0x1f2674[_0x36591e(0xed)],_0x1c5bfd[_0x36591e(0xf3)])&&sameName(_0x1f2674[_0x36591e(0xec)],_0x483b7e)&&_0x1f2674[_0x36591e(0xb5)]===_0x3d3eec['dblinkId']&&sameName(_0x1f2674['toTableName'],_0x3d3eec[_0x36591e(0xf3)])&&sameName(_0x1f2674[_0x36591e(0xf7)],_0x2998d5);}export async function prepareCrossRelation(_0x1bc6e7,_0x2348e1){const _0x3bd8bf=a72_0x437a82,_0x117123=await resolveEndpoint(required(_0x1bc6e7,_0x3bd8bf(0xc2))),_0x2442dd=explicitDblink(_0x1bc6e7);if(_0x2442dd!==undefined&&_0x117123['dblinkId']!==_0x2442dd)throw CliErrors[_0x3bd8bf(0xb4)](_0x3bd8bf(0xdb));const _0x593861={'appCode':_0x1bc6e7['appCode'],'fromDatasetCode':_0x117123[_0x3bd8bf(0xef)],'fromField':required(_0x1bc6e7,_0x3bd8bf(0xc9)),..._0x2442dd!==undefined?{'fromDblinkId':_0x2442dd}:{}},_0x46d43a={'appCode':_0x1bc6e7['appCode'],'fromDblinkId':_0x117123[_0x3bd8bf(0xcc)],'fromDatasetCode':_0x117123[_0x3bd8bf(0xef)],'fromField':_0x593861[_0x3bd8bf(0xec)]},_0x4333be=await queryCrossDbRelations(_0x46d43a);let _0x11376e=null;if(_0x2348e1!==_0x3bd8bf(0xf9)){if(_0x4333be[_0x3bd8bf(0xac)]>0x1)throw ambiguity(_0x4333be);_0x11376e=_0x4333be[0x0]??null;if(!_0x11376e)throw CliErrors[_0x3bd8bf(0xb4)](_0x3bd8bf(0xca));}if(_0x2348e1==='delete')return{'operation':_0x2348e1,'from':_0x117123,'query':_0x46d43a,'body':_0x593861,'before':_0x11376e};const _0x23cded=await resolveEndpoint(required(_0x1bc6e7,'to-datasetcode'));if(_0x117123[_0x3bd8bf(0xcc)]===_0x23cded[_0x3bd8bf(0xcc)])throw CliErrors['validation'](_0x3bd8bf(0xd5));const _0x522119=_0x1bc6e7['str'](_0x3bd8bf(0xe1))['trim'](),_0x62130b=_0x1bc6e7[_0x3bd8bf(0xe7)](_0x3bd8bf(0xc6))[_0x3bd8bf(0xd6)](),_0x100b71={..._0x593861,'toDatasetCode':_0x23cded['datasetCode'],'toField':required(_0x1bc6e7,'to-column'),..._0x522119?{'refTableLabelName':_0x522119}:{},..._0x62130b?{'cardinality':_0x62130b}:{}};if(_0x4333be['some'](_0x306a47=>_0x306a47[_0x3bd8bf(0xfd)]!==_0x11376e?.[_0x3bd8bf(0xfd)]&&matchesEndpoint(_0x306a47,_0x117123,_0x100b71['fromField'],_0x23cded,_0x100b71[_0x3bd8bf(0xf7)])))throw CliErrors[_0x3bd8bf(0xb4)](_0x3bd8bf(0xb7));return{'operation':_0x2348e1,'from':_0x117123,'to':_0x23cded,'query':_0x46d43a,'body':_0x100b71,'before':_0x11376e,'expectedLabel':_0x522119||_0x11376e?.[_0x3bd8bf(0xb3)]||_0x100b71['toField'],'expectedCardinality':_0x62130b||_0x11376e?.[_0x3bd8bf(0xc6)]||null};}function mutationData(_0xe9f69d,_0x287b1d,_0x427416){const _0x4b4604=a72_0x437a82,{operation:_0x52b3f1,body:_0x5e6c72,before:_0x3d316c}=_0xe9f69d;return{'operation':_0x52b3f1,'selector':{'appCode':_0x5e6c72[_0x4b4604(0xd1)],'from':{'datasetCode':_0x5e6c72[_0x4b4604(0xad)],'field':_0x5e6c72[_0x4b4604(0xec)],'dblinkId':_0xe9f69d[_0x4b4604(0xe5)][_0x4b4604(0xcc)]}},'before':_0x3d316c?projectCrossRelation(_0x3d316c):null,'after':_0x427416,'dryRun':_0x287b1d,'backend':{'method':_0x4b4604(0xba),'path':CROSS_DB_RELATION_PATHS[_0x52b3f1]},'warnings':_0x52b3f1===_0x4b4604(0xd2)&&!_0x5e6c72['refTableLabelName']?[{'code':_0x4b4604(0xb8),'message':'The\x20target\x20display\x20field\x20is\x20inherited.\x20When\x20changing\x20the\x20target\x20dataset,\x20provide\x20--to-label-column\x20explicitly.'}]:[]};}export async function previewCrossRelation(_0x5808bb,_0x4539fc){const _0x176132=a72_0x437a82,_0x3e76d4=await prepareCrossRelation(_0x5808bb,_0x4539fc),_0x2ab988=_0x3e76d4[_0x176132(0xdf)],_0x4471f6=_0x4539fc===_0x176132(0xd8)?null:{..._0x3e76d4[_0x176132(0xfa)]?{'relationId':_0x3e76d4['before'][_0x176132(0xfd)]}:{},'from':{'datasetCode':_0x3e76d4[_0x176132(0xe5)][_0x176132(0xef)],'dblinkId':_0x3e76d4[_0x176132(0xe5)][_0x176132(0xcc)],'table':_0x3e76d4[_0x176132(0xe5)]['table'],'field':_0x2ab988['fromField']},'to':{'datasetCode':_0x3e76d4['to'][_0x176132(0xef)],'dblinkId':_0x3e76d4['to'][_0x176132(0xcc)],'table':_0x3e76d4['to']['table'],'field':_0x2ab988[_0x176132(0xf7)],'labelField':_0x3e76d4[_0x176132(0xd9)]},'relation':{'cardinality':_0x3e76d4[_0x176132(0xe4)],'relationType':0x2}};return{...mutationData(_0x3e76d4,!![],null),'after':_0x4471f6,'method':_0x176132(0xba),'url':CROSS_DB_RELATION_PATHS[_0x4539fc],'body':_0x3e76d4[_0x176132(0xdf)],'description':_0x176132(0xbd)+_0x4539fc+_0x176132(0xd7)+_0x2ab988[_0x176132(0xad)]+'.'+_0x2ab988[_0x176132(0xec)]};}function a72_0xe0f4(){const _0x300ba4=['442500gnPISI','defineProperty','Run\x20dataset\x20cross-relation-list\x20to\x20inspect\x20the\x20candidates.\x20This\x20command\x20accepts\x20only\x20a\x20source\x20dataset\x20and\x20field.','from-datasetcode','isSafeInteger','4877940NJqgNK','flagMissing','cardinality','dbId','enum','from-column','Cross-database\x20relation\x20not\x20found\x20for\x20this\x20source\x20dataset\x20and\x20field.','parse','dblinkId','list','8WevlON','Multiple\x20cross-database\x20relations\x20match\x20this\x20source\x20field;\x20update/delete\x20cannot\x20select\x20one\x20target.','string','appCode','update','Provide\x20--from-datasetcode\x20or\x20--from-dblink-id.','relationType','Cross-database\x20relations\x20require\x20different\x20source\x20and\x20target\x20database\x20connections.','trim','\x20a\x20cross-database\x20relation\x20for\x20','delete','expectedLabel','DB_TABLE','--from-dblink-id\x20does\x20not\x20match\x20the\x20source\x20dataset\x20connection.','\x20write\x20was\x20not\x20verified.','extend','843kKGWYq','body','--from-dblink-id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','to-label-column','toDatasetCode','data','expectedCardinality','from','tableName','str','1412eamowM','sourceType','filter','flag','fromField','fromTableName','\x20verified.','datasetCode','catch','storageProfile','Invalid\x20--cardinality.','table','1695159JXGCTe','Cross-database\x20relation\x20','The\x20write\x20was\x20accepted,\x20but\x20current\x20state\x20could\x20not\x20be\x20confirmed.\x20Run\x20dataset\x20cross-relation-list\x20before\x20attempting\x20another\x20write.','toField','matched','create','before','\x20has\x20invalid\x20storage\x20configuration.','18dzhIzW','relationId','36592pSeSCP','fromDatasetName','map','Dataset\x20','fromDblinkId','\x20must\x20be\x20a\x20DB_TABLE\x20dataset.','265015tAJCjY','length','fromDatasetCode','\x20is\x20missing\x20its\x20database\x20connection\x20or\x20physical\x20table\x20name.','query','dbtable','dbtableConfig','toLowerCase','refTableLabelName','validation','toDblinkId','source','Cross-database\x20relation\x20already\x20exists\x20for\x20these\x20source\x20and\x20target\x20endpoints.','label_inherited','includes','POST','apiError','1000650MZNMRA','Would\x20','dataset'];a72_0xe0f4=function(){return _0x300ba4;};return a72_0xe0f4();}export async function executeCrossRelation(_0x70f857,_0x1a379a,_0x8abb98){const _0x269daa=a72_0x437a82,_0x182482=await prepareCrossRelation(_0x70f857,_0x1a379a);try{await _0x8abb98(_0x182482[_0x269daa(0xdf)]);}catch(_0x1c2235){if(_0x1c2235 instanceof CliError&&_0x1c2235['message'][_0x269daa(0xb9)]('multiple\x20cross-database\x20relations\x20matched')){const _0x500ca0=await queryCrossDbRelations(_0x182482[_0x269daa(0xaf)])[_0x269daa(0xf0)](()=>[]);throw ambiguity(_0x500ca0);}throw _0x1c2235;}let _0x114e41=[],_0x11ab08,_0xc803f3=![];try{_0x114e41=await queryCrossDbRelations(_0x182482[_0x269daa(0xaf)]);if(_0x1a379a===_0x269daa(0xd8))_0xc803f3=!_0x114e41['some'](_0x55eeae=>_0x55eeae[_0x269daa(0xfd)]===_0x182482[_0x269daa(0xfa)][_0x269daa(0xfd)]);else{const _0x2b7845=_0x182482['body'],_0x310d22=_0x114e41[_0x269daa(0xea)](_0x315ff7=>matchesEndpoint(_0x315ff7,_0x182482[_0x269daa(0xe5)],_0x2b7845[_0x269daa(0xec)],_0x182482['to'],_0x2b7845[_0x269daa(0xf7)])&&(_0x1a379a==='create'||_0x315ff7[_0x269daa(0xfd)]===_0x182482[_0x269daa(0xfa)][_0x269daa(0xfd)]));_0x11ab08=_0x310d22[_0x269daa(0xac)]===0x1?_0x310d22[0x0]:undefined,_0xc803f3=!!_0x11ab08&&_0x11ab08[_0x269daa(0xb3)]===_0x182482[_0x269daa(0xd9)]&&_0x11ab08[_0x269daa(0xc6)]===_0x182482[_0x269daa(0xe4)]&&_0x11ab08['relationType']===0x2;}}catch{}const _0x3a535c={...mutationData(_0x182482,![],_0x11ab08?projectCrossRelation(_0x11ab08):null),'verification':{'status':_0xc803f3?_0x269daa(0xf8):'unconfirmed','verified':_0xc803f3}};if(!_0xc803f3){const _0x3fa86d=CliErrors[_0x269daa(0xbb)](_0x269daa(0xf5)+_0x1a379a+_0x269daa(0xdc),_0x269daa(0xf6));Object['defineProperty'](_0x3fa86d,_0x269daa(0xe3),{'value':{..._0x3a535c,'candidates':_0x114e41[_0x269daa(0x100)](projectCrossRelation)}});throw _0x3fa86d;}return{'ok':!![],'data':_0x3a535c,'message':_0x269daa(0xf5)+_0x1a379a+_0x269daa(0xee)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a73_0x54f6(_0x37d864,_0x19127c){_0x37d864=_0x37d864-0x168;const _0x1cea3c=a73_0x1cea();let _0x54f64c=_0x1cea3c[_0x37d864];return _0x54f64c;}const a73_0x3d0ecb=a73_0x54f6;(function(_0x280368,_0x51de37){const _0x296a45=a73_0x54f6,_0x500b3a=_0x280368();while(!![]){try{const _0x59c532=parseInt(_0x296a45(0x16c))/0x1+parseInt(_0x296a45(0x16f))/0x2+-parseInt(_0x296a45(0x170))/0x3+-parseInt(_0x296a45(0x175))/0x4+parseInt(_0x296a45(0x169))/0x5*(-parseInt(_0x296a45(0x16e))/0x6)+parseInt(_0x296a45(0x173))/0x7*(-parseInt(_0x296a45(0x171))/0x8)+parseInt(_0x296a45(0x172))/0x9;if(_0x59c532===_0x51de37)break;else _0x500b3a['push'](_0x500b3a['shift']());}catch(_0x58a1b6){_0x500b3a['push'](_0x500b3a['shift']());}}}(a73_0x1cea,0xeb38a));import{updateCrossDbRelation}from'../../core/api-client.js';import{CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_TO_DATASET_FLAG,CROSS_RELATION_TO_COLUMN_FLAG,CROSS_RELATION_LABEL_FLAG,CROSS_RELATION_CARDINALITY_FLAG,CROSS_RELATION_DBLINK_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{executeCrossRelation,previewCrossRelation,validateCrossRelation}from'../../commands/dataset/cross-relation-shared.js';export const datasetCrossRelationUpdate={'service':a73_0x3d0ecb(0x16d),'command':a73_0x3d0ecb(0x16b),'description':a73_0x3d0ecb(0x168),'risk':a73_0x3d0ecb(0x16a),'strictFlags':!![],'requiresCookieAuth':!![],'structuredErrors':!![],'flags':[CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_TO_DATASET_FLAG,CROSS_RELATION_TO_COLUMN_FLAG,CROSS_RELATION_LABEL_FLAG,CROSS_RELATION_CARDINALITY_FLAG,CROSS_RELATION_DBLINK_FLAG,APPCODE_FLAG_OPTIONAL],'validate':async _0x1844b0=>validateCrossRelation(_0x1844b0,a73_0x3d0ecb(0x174)),'dryRun':_0x505bed=>previewCrossRelation(_0x505bed,'update'),'execute':_0x576600=>executeCrossRelation(_0x576600,'update',updateCrossDbRelation)};function a73_0x1cea(){const _0x32d27e=['Update\x20the\x20target\x20or\x20properties\x20of\x20the\x20single\x20cross-database\x20relation\x20matching\x20a\x20source\x20dataset\x20and\x20field','136135rwYoyB','write','cross-relation-update','843803TAcfGa','dataset','18EfzhcZ','3513884hoJJwv','1301868MlSGma','59736jpDWuU','4836708EsSYkT','826oHMOiN','update','3111792zoMpdC'];a73_0x1cea=function(){return _0x32d27e;};return a73_0x1cea();}
|