@lovrabet/rabetbase-cli 2.5.8 → 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_0x589f6e=a65_0x53f6;(function(_0x39f791,_0x5ab111){const _0x15c1ae=a65_0x53f6,_0x80a4fc=_0x39f791();while(!![]){try{const _0x32d46c=parseInt(_0x15c1ae(0x224))/0x1+parseInt(_0x15c1ae(0x1f1))/0x2*(parseInt(_0x15c1ae(0x233))/0x3)+parseInt(_0x15c1ae(0x22b))/0x4+-parseInt(_0x15c1ae(0x23c))/0x5+parseInt(_0x15c1ae(0x221))/0x6*(parseInt(_0x15c1ae(0x231))/0x7)+-parseInt(_0x15c1ae(0x1f3))/0x8+-parseInt(_0x15c1ae(0x245))/0x9*(parseInt(_0x15c1ae(0x1e1))/0xa);if(_0x32d46c===_0x5ab111)break;else _0x80a4fc['push'](_0x80a4fc['shift']());}catch(_0x2341cd){_0x80a4fc['push'](_0x80a4fc['shift']());}}}(a65_0x2bdb,0x9e6e5));import{CliErrors}from'../../errors.js';const LOCAL_KEY=/^[a-z][a-z0-9_]{0,63}$/,SUPPORTED_CARDINALITIES=new Set([a65_0x589f6e(0x1ef),a65_0x589f6e(0x20c)]),SUPPORTED_FIELD_TYPES=new Set([a65_0x589f6e(0x1f9),'NUMBER',a65_0x589f6e(0x237),a65_0x589f6e(0x248),a65_0x589f6e(0x219),a65_0x589f6e(0x21f),a65_0x589f6e(0x23d),a65_0x589f6e(0x1f0),'ADDRESS',a65_0x589f6e(0x214)]);export function isDatasetBatchDesign(_0x8f8492){const _0x25a292=a65_0x589f6e;return isObject(_0x8f8492)&&_0x8f8492[_0x25a292(0x1e3)]===_0x25a292(0x24b);}export function validateDatasetBatchDesign(_0x2d7e14){const _0x5e8835=a65_0x589f6e;(!isObject(_0x2d7e14)||_0x2d7e14[_0x5e8835(0x1e3)]!=='dataset-batch')&&fail(_0x5e8835(0x1e4));_0x2d7e14[_0x5e8835(0x204)]!==0x1&&fail(_0x5e8835(0x238));const _0x1499db=objectArray(_0x2d7e14[_0x5e8835(0x22c)],_0x5e8835(0x22c),0x1,0x14),_0x354264=objectArray(_0x2d7e14[_0x5e8835(0x1f5)],_0x5e8835(0x1f5),0x0,0xc8),_0x20a878=objectArray(_0x2d7e14['unresolvedRelations'],_0x5e8835(0x1fc),0x0,0xc8),_0xff2b72=new Set(),_0x27beb2=new Map();for(const [_0x5b7bc9,_0x52ab78]of _0x1499db[_0x5e8835(0x1ea)]()){const _0x1ab375=requiredString(_0x52ab78[_0x5e8835(0x206)],_0x5e8835(0x234)+_0x5b7bc9+_0x5e8835(0x200));!LOCAL_KEY['test'](_0x1ab375)&&fail(_0x5e8835(0x234)+_0x5b7bc9+_0x5e8835(0x225)+LOCAL_KEY[_0x5e8835(0x23f)]+'.');_0xff2b72['has'](_0x1ab375)&&fail(_0x5e8835(0x207));_0xff2b72[_0x5e8835(0x1ee)](_0x1ab375);!isObject(_0x52ab78[_0x5e8835(0x247)])&&fail(_0x5e8835(0x234)+_0x5b7bc9+_0x5e8835(0x24e));rejectServerDatasetIdentity(_0x52ab78[_0x5e8835(0x247)],_0x5e8835(0x234)+_0x5b7bc9+_0x5e8835(0x1ff));if(!isObject(_0x52ab78[_0x5e8835(0x247)]['dataset']))fail(_0x5e8835(0x234)+_0x5b7bc9+_0x5e8835(0x243));rejectServerDatasetIdentity(_0x52ab78[_0x5e8835(0x247)][_0x5e8835(0x1ec)],_0x5e8835(0x234)+_0x5b7bc9+_0x5e8835(0x24a)),requiredString(_0x52ab78[_0x5e8835(0x247)][_0x5e8835(0x1ec)][_0x5e8835(0x216)],_0x5e8835(0x234)+_0x5b7bc9+_0x5e8835(0x222));_0x5e8835(0x1f5)in _0x52ab78[_0x5e8835(0x247)]&&(!Array[_0x5e8835(0x1f6)](_0x52ab78['design']['relations'])||_0x52ab78[_0x5e8835(0x247)][_0x5e8835(0x1f5)][_0x5e8835(0x24c)]!==0x0)&&fail('datasets['+_0x5b7bc9+_0x5e8835(0x1e0));const _0x3411e9=objectArray(_0x52ab78[_0x5e8835(0x247)]['fields'],_0x5e8835(0x234)+_0x5b7bc9+_0x5e8835(0x205),0x1,0xc8),_0x58cb4d=new Map();for(const [_0x4237c5,_0x364f40]of _0x3411e9['entries']()){const _0x495892=fieldName(_0x364f40);if(!_0x495892)fail(_0x5e8835(0x234)+_0x5b7bc9+_0x5e8835(0x1df)+_0x4237c5+_0x5e8835(0x215));const _0xae07a8=_0x495892['toLowerCase']();if(_0x58cb4d[_0x5e8835(0x1f2)](_0xae07a8))fail(_0x5e8835(0x226)+_0x1ab375+_0x5e8835(0x249));const _0x762266=stringValue(_0x364f40[_0x5e8835(0x239)]??_0x364f40[_0x5e8835(0x209)])[_0x5e8835(0x1e7)]();if(!SUPPORTED_FIELD_TYPES[_0x5e8835(0x1f2)](_0x762266))fail(_0x5e8835(0x234)+_0x5b7bc9+_0x5e8835(0x1df)+_0x4237c5+'].type\x20is\x20not\x20supported.');_0x58cb4d[_0x5e8835(0x210)](_0xae07a8,_0x762266),[_0x364f40['refTable'],_0x364f40[_0x5e8835(0x244)],_0x364f40[_0x5e8835(0x20f)]][_0x5e8835(0x208)](_0x434785=>stringValue(_0x434785))&&fail('datasets['+_0x5b7bc9+_0x5e8835(0x1df)+_0x4237c5+']\x20must\x20not\x20contain\x20embedded\x20relation\x20references.');}_0x27beb2[_0x5e8835(0x210)](_0x1ab375,_0x58cb4d);}const _0x4dc414=new Set(),_0x549b4d=new Set();for(const [_0x35233f,_0x3ea5c4]of _0x354264[_0x5e8835(0x1ea)]()){const _0x721996=validateRelation(_0x3ea5c4,_0x35233f,_0xff2b72,_0x27beb2);if(_0x4dc414[_0x5e8835(0x1f2)](_0x721996))fail(_0x5e8835(0x213));_0x4dc414[_0x5e8835(0x1ee)](_0x721996);const _0x1e2e17=_0x721996['split']('\x00',0x2)[_0x5e8835(0x1e6)]('\x00');if(_0x549b4d[_0x5e8835(0x1f2)](_0x1e2e17))fail(_0x5e8835(0x1eb));_0x549b4d[_0x5e8835(0x1ee)](_0x1e2e17);}for(const [_0x35f40f,_0x14f704]of _0x20a878[_0x5e8835(0x1ea)]()){requiredString(_0x14f704[_0x5e8835(0x22f)],_0x5e8835(0x21d)+_0x35f40f+_0x5e8835(0x21e)),validateConfidence(_0x14f704[_0x5e8835(0x242)],'unresolvedRelations['+_0x35f40f+_0x5e8835(0x223));}return _0x2d7e14;}export function reconcileBatchResult(_0x213296){const _0x4a8ab5=a65_0x589f6e;if(!isObject(_0x213296))return null;try{const _0x55ab02=stringArray(_0x213296['expectedLocalKeys'],_0x4a8ab5(0x228),0x1,0x14),_0x13f86b=new Set(_0x55ab02);if(_0x13f86b['size']!==_0x55ab02[_0x4a8ab5(0x24c)]||_0x55ab02[_0x4a8ab5(0x208)](_0x354078=>!LOCAL_KEY[_0x4a8ab5(0x1e8)](_0x354078)))return null;const _0x4b0668=objectArray(_0x213296[_0x4a8ab5(0x20a)],_0x4a8ab5(0x20a),0x1,0x14),_0x3cfb51=new Map(),_0x5d646d=new Set();for(const _0x26141f of _0x4b0668){const _0x25a018=requiredString(_0x26141f[_0x4a8ab5(0x206)],_0x4a8ab5(0x235)),_0x2a4ca3=requiredString(_0x26141f[_0x4a8ab5(0x211)]??_0x26141f[_0x4a8ab5(0x1ed)],'createdDatasets[].code');if(_0x3cfb51[_0x4a8ab5(0x1f2)](_0x25a018)||_0x5d646d[_0x4a8ab5(0x1f2)](_0x2a4ca3))return null;_0x3cfb51[_0x4a8ab5(0x210)](_0x25a018,_0x2a4ca3),_0x5d646d[_0x4a8ab5(0x1ee)](_0x2a4ca3);}if(!sameSet(_0x13f86b,new Set(_0x3cfb51[_0x4a8ab5(0x1f8)]())))return null;const _0x56a2db=objectArray(_0x213296['expectedRelations'],_0x4a8ab5(0x23a),0x0,0xc8),_0x462df4=objectArray(_0x213296[_0x4a8ab5(0x1fb)],_0x4a8ab5(0x1fb),0x0,0xc8),_0xdf9859=relationTupleSet(_0x56a2db,![],_0x3cfb51),_0x31d58d=relationTupleSet(_0x462df4,!![],_0x3cfb51);if(!_0xdf9859||!_0x31d58d||!sameSet(_0xdf9859,_0x31d58d))return null;const _0x5298df=objectArray(_0x213296[_0x4a8ab5(0x1fc)],_0x4a8ab5(0x1fc),0x0,0xc8);return{'expectedLocalKeys':_0x55ab02,'expectedRelations':_0x56a2db,'createdDatasets':_0x4b0668,'createdRelations':_0x462df4,'unresolvedRelations':_0x5298df,...isObject(_0x213296[_0x4a8ab5(0x1f4)])?{'metrics':_0x213296[_0x4a8ab5(0x1f4)]}:{}};}catch{return null;}}function validateRelation(_0xa48130,_0x2bbd28,_0x3ef594,_0x556010){const _0x21dbae=a65_0x589f6e,_0x2de03d=_0x21dbae(0x227)+_0x2bbd28+']',_0x148a44=requiredString(_0xa48130['fromDatasetKey'],_0x2de03d+_0x21dbae(0x1fa)),_0xe16075=requiredString(_0xa48130[_0x21dbae(0x229)],_0x2de03d+_0x21dbae(0x21a)),_0x58f533=requiredString(_0xa48130['fromField'],_0x2de03d+'.fromField')[_0x21dbae(0x241)](),_0x4528ea=requiredString(_0xa48130[_0x21dbae(0x23e)],_0x2de03d+'.toField')[_0x21dbae(0x241)]();if(!_0x3ef594['has'](_0x148a44)||!_0x3ef594[_0x21dbae(0x1f2)](_0xe16075))fail(_0x2de03d+'\x20references\x20an\x20unknown\x20dataset\x20localKey.');const _0x25c823=_0x556010[_0x21dbae(0x218)](_0x148a44)?.[_0x21dbae(0x218)](_0x58f533),_0x43223a=_0x556010['get'](_0xe16075)?.[_0x21dbae(0x218)](_0x4528ea);if(_0x25c823===undefined||_0x43223a===undefined)fail(_0x2de03d+_0x21dbae(0x1e9));if(_0x25c823&&_0x43223a&&_0x25c823!==_0x43223a)fail(_0x2de03d+_0x21dbae(0x24d));const _0x4a2ed5=stringValue(_0xa48130['relationType'])||_0x21dbae(0x24f);if(_0x4a2ed5!==_0x21dbae(0x24f))fail(_0x2de03d+_0x21dbae(0x246));const _0x4e6d8c=stringValue(_0xa48130[_0x21dbae(0x220)])||_0x21dbae(0x1ef);if(!SUPPORTED_CARDINALITIES['has'](_0x4e6d8c))fail(_0x2de03d+_0x21dbae(0x22a));return requiredString(_0xa48130[_0x21dbae(0x22f)],_0x2de03d+'.reason'),validateConfidence(_0xa48130[_0x21dbae(0x242)],_0x2de03d+_0x21dbae(0x22e)),tuple(_0x148a44,_0x58f533,_0xe16075,_0x4528ea,_0x21dbae(0x24f),_0x4e6d8c);}function relationTupleSet(_0x3df333,_0x4f8577,_0x513207){const _0x263f1d=a65_0x589f6e,_0x4a8df7=new Set();for(const _0x14e38c of _0x3df333){const _0x50c2be=stringValue(_0x14e38c[_0x263f1d(0x230)]),_0x1855cc=stringValue(_0x14e38c[_0x263f1d(0x229)]),_0x104353=stringValue(_0x14e38c[_0x263f1d(0x1e2)])[_0x263f1d(0x241)](),_0x89f36c=stringValue(_0x14e38c['toField'])[_0x263f1d(0x241)](),_0x3fe714=stringValue(_0x14e38c[_0x263f1d(0x201)]),_0x534726=stringValue(_0x14e38c[_0x263f1d(0x220)]);if(!_0x50c2be||!_0x1855cc||!_0x104353||!_0x89f36c||_0x3fe714!==_0x263f1d(0x24f)||!SUPPORTED_CARDINALITIES[_0x263f1d(0x1f2)](_0x534726))return null;if(!_0x513207[_0x263f1d(0x1f2)](_0x50c2be)||!_0x513207[_0x263f1d(0x1f2)](_0x1855cc))return null;if(_0x4f8577&&(stringValue(_0x14e38c['fromDatasetCode'])!==_0x513207['get'](_0x50c2be)||stringValue(_0x14e38c['toDatasetCode'])!==_0x513207['get'](_0x1855cc)))return null;const _0x29fa31=tuple(_0x50c2be,_0x104353,_0x1855cc,_0x89f36c,_0x3fe714,_0x534726);if(_0x4a8df7['has'](_0x29fa31))return null;_0x4a8df7[_0x263f1d(0x1ee)](_0x29fa31);}return _0x4a8df7;}function rejectServerDatasetIdentity(_0x178d19,_0x2f026){const _0x2a78bf=a65_0x589f6e;for(const _0x337a8a of['id',_0x2a78bf(0x217),_0x2a78bf(0x20e),'code',_0x2a78bf(0x1ed),_0x2a78bf(0x23b)]){if(_0x178d19[_0x337a8a]!==undefined&&_0x178d19[_0x337a8a]!==null&&_0x178d19[_0x337a8a]!=='')fail(_0x2f026+'.'+_0x337a8a+'\x20must\x20not\x20be\x20supplied\x20by\x20the\x20client.');}}function objectArray(_0x8e6d47,_0x6405c,_0x32f911,_0x1090ab){const _0x480ff7=a65_0x589f6e;return(!Array[_0x480ff7(0x1f6)](_0x8e6d47)||_0x8e6d47[_0x480ff7(0x24c)]<_0x32f911||_0x8e6d47[_0x480ff7(0x24c)]>_0x1090ab||_0x8e6d47[_0x480ff7(0x208)](_0x14a1e8=>!isObject(_0x14a1e8)))&&fail(_0x6405c+'\x20must\x20contain\x20'+_0x32f911+'..'+_0x1090ab+_0x480ff7(0x1de)),_0x8e6d47;}function stringArray(_0x513595,_0x101e80,_0x69a373,_0x43fe6b){const _0x16954b=a65_0x589f6e;return(!Array['isArray'](_0x513595)||_0x513595['length']<_0x69a373||_0x513595[_0x16954b(0x24c)]>_0x43fe6b||_0x513595[_0x16954b(0x208)](_0x59fe8b=>typeof _0x59fe8b!==_0x16954b(0x22d)||!_0x59fe8b[_0x16954b(0x1e5)]()))&&fail(_0x101e80+_0x16954b(0x240)+_0x69a373+'..'+_0x43fe6b+_0x16954b(0x1fd)),_0x513595;}function requiredString(_0x50cf47,_0x1301bf){const _0x10ea92=a65_0x589f6e,_0x1e7f06=stringValue(_0x50cf47);if(!_0x1e7f06)fail(_0x1301bf+_0x10ea92(0x20b));return _0x1e7f06;}function stringValue(_0x40c04b){const _0x5a5491=a65_0x589f6e;return typeof _0x40c04b===_0x5a5491(0x22d)?_0x40c04b[_0x5a5491(0x1e5)]():'';}function a65_0x2bdb(){const _0x427ba3=['\x20field\x20names\x20must\x20be\x20unique\x20ignoring\x20case.','].design.dataset','dataset-batch','length','\x20connects\x20incompatible\x20field\x20types.','].design\x20must\x20be\x20an\x20object.','lookup','\x20objects.','].design.fields[','].design.relations\x20must\x20be\x20an\x20empty\x20array;\x20use\x20top-level\x20relations.','1002640bRtZxW','fromField','kind','Batch\x20--design-file\x20must\x20have\x20kind\x20\x22dataset-batch\x22.','trim','join','toUpperCase','test','\x20references\x20an\x20unknown\x20field.','entries','Each\x20source\x20field\x20may\x20target\x20at\x20most\x20one\x20relation.','dataset','datasetCode','add','MANY_TO_ONE','USER','4598fJDTzn','has','7635976EGjFgx','metrics','relations','isArray','number','keys','TEXT','.fromDatasetKey','createdRelations','unresolvedRelations','\x20non-empty\x20strings.','validation','].design','].localKey','relationType','size','name','schemaVersion','].design.fields','localKey','Dataset\x20batch\x20localKey\x20values\x20must\x20be\x20unique.','some','fieldType','createdDatasets','\x20is\x20required.','ONE_TO_ONE','fieldCode','modelId','refTableLabelField','set','code','isFinite','Dataset\x20batch\x20relations\x20must\x20be\x20unique.','UPLOAD',']\x20must\x20have\x20a\x20non-empty\x20name\x20or\x20code.','datasetName','datasetId','get','SELECT','.toDatasetKey','\x20must\x20be\x20between\x200\x20and\x201.','every','unresolvedRelations[','].reason','MULTI_SELECT','cardinality','1552416sEWgVr','].design.dataset.datasetName','].confidence','60005wwuMmo','].localKey\x20must\x20match\x20','Dataset\x20','relations[','expectedLocalKeys','toDatasetKey','.cardinality\x20is\x20not\x20supported.','3615868TwpRrw','datasets','string','.confidence','reason','fromDatasetKey','7usxedy','fieldName','771djUAMW','datasets[','createdDatasets[].localKey','map','DATETIME','Dataset\x20batch\x20schemaVersion\x20must\x20be\x201.','type','expectedRelations','modelCode','47965qeTKou','DATE_RANGE','toField','source','\x20must\x20contain\x20','toLowerCase','confidence','].design.dataset\x20must\x20be\x20an\x20object.','refTableField','18fbhmrM','.relationType\x20must\x20be\x20\x22lookup\x22.','design','BOOLEAN'];a65_0x2bdb=function(){return _0x427ba3;};return a65_0x2bdb();}function fieldName(_0x3ef60d){const _0x4c334b=a65_0x589f6e;return stringValue(_0x3ef60d[_0x4c334b(0x211)]??_0x3ef60d[_0x4c334b(0x20d)]??_0x3ef60d[_0x4c334b(0x203)]??_0x3ef60d[_0x4c334b(0x232)]);}function a65_0x53f6(_0x348619,_0x520a6c){_0x348619=_0x348619-0x1de;const _0x2bdbd0=a65_0x2bdb();let _0x53f695=_0x2bdbd0[_0x348619];return _0x53f695;}function validateConfidence(_0x410413,_0x3d758d){const _0x1a52b0=a65_0x589f6e;_0x410413!==undefined&&_0x410413!==null&&(typeof _0x410413!==_0x1a52b0(0x1f7)||!Number[_0x1a52b0(0x212)](_0x410413)||_0x410413<0x0||_0x410413>0x1)&&fail(_0x3d758d+_0x1a52b0(0x21b));}function tuple(..._0x534aba){const _0xcb4da9=a65_0x589f6e;return _0x534aba[_0xcb4da9(0x236)]((_0x1df801,_0x22bd95)=>_0x22bd95===0x1||_0x22bd95===0x3?_0x1df801[_0xcb4da9(0x241)]():_0x1df801)[_0xcb4da9(0x1e6)]('\x00');}function sameSet(_0x2a7473,_0xf1c70){const _0x281bdf=a65_0x589f6e;return _0x2a7473['size']===_0xf1c70[_0x281bdf(0x202)]&&[..._0x2a7473][_0x281bdf(0x21c)](_0x4d8cac=>_0xf1c70[_0x281bdf(0x1f2)](_0x4d8cac));}function isObject(_0x2211f1){return typeof _0x2211f1==='object'&&_0x2211f1!==null&&!Array['isArray'](_0x2211f1);}function fail(_0x522408){const _0x5101e4=a65_0x589f6e;throw CliErrors[_0x5101e4(0x1fe)](_0x522408);}
|
|
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_0x16846e=a66_0x7d9a;(function(_0x3ef10d,_0x564a4a){const _0x249d1f=a66_0x7d9a,_0x3b5d4f=_0x3ef10d();while(!![]){try{const _0x11f77a=parseInt(_0x249d1f(0x193))/0x1*(parseInt(_0x249d1f(0x1b7))/0x2)+parseInt(_0x249d1f(0x181))/0x3*(parseInt(_0x249d1f(0x1a0))/0x4)+-parseInt(_0x249d1f(0x19a))/0x5+-parseInt(_0x249d1f(0x1ac))/0x6+parseInt(_0x249d1f(0x1b6))/0x7*(-parseInt(_0x249d1f(0x171))/0x8)+parseInt(_0x249d1f(0x19f))/0x9*(-parseInt(_0x249d1f(0x18d))/0xa)+parseInt(_0x249d1f(0x19e))/0xb;if(_0x11f77a===_0x564a4a)break;else _0x3b5d4f['push'](_0x3b5d4f['shift']());}catch(_0x5e9743){_0x3b5d4f['push'](_0x3b5d4f['shift']());}}}(a66_0x9cf5,0xcd0d1));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_0x16846e(0x1bb),METADATA_BACKEND_PATH=a66_0x16846e(0x189),UNGROUPED_BUSINESS_GROUP='ungrouped';export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x44d8d8,input:_0x469d24,dryRun:_0x5a28a1}){const _0x54680c=a66_0x16846e;validateInput(_0x469d24);const _0x5415bb=normalizeBusinessGroupArgument(_0x469d24[_0x54680c(0x196)]),_0xb3216b=await getDatasetDetail(_0x469d24[_0x54680c(0x17f)]),_0x8622af=resolveBusinessGroupDataset(_0xb3216b,_0x469d24['code']);assertBusinessGroupUpdateSupported(_0x8622af,_0x5415bb);const _0x3af7a1=loadCurrentBusinessGroup(_0xb3216b,_0x8622af);assertExpectedBusinessGroup(_0x3af7a1,_0x469d24[_0x54680c(0x199)]);const _0xc2c087=buildBackendPlan(_0x44d8d8,_0x8622af,_0x5415bb),_0x8b2433=_0x3af7a1!==_0x5415bb;let _0x5ee6f1;if(_0x8b2433&&!_0x5a28a1){_0xc2c087[_0x54680c(0x186)]==='db-table'?await updateDbTableBusinessGroup(_0xc2c087[_0x54680c(0x19b)]):await updateErBusinessGroup(_0xc2c087[_0x54680c(0x19b)]);const _0x111625=await getDatasetDetail(_0x8622af[_0x54680c(0x17f)]),_0x268dd2=resolveBusinessGroupDataset(_0x111625,_0x8622af[_0x54680c(0x17f)]),_0x101278=loadCurrentBusinessGroup(_0x111625,_0x268dd2);if(_0x101278!==_0x5415bb)throw CliErrors['apiError'](_0x54680c(0x172),_0x54680c(0x174)+JSON[_0x54680c(0x1a9)](displayBusinessGroup(_0x5415bb))+_0x54680c(0x1ba)+JSON[_0x54680c(0x1a9)](displayBusinessGroup(_0x101278))+'.');_0x5ee6f1={'verified':!![],'status':_0x54680c(0x1af),'afterReadback':{'businessGroup':displayBusinessGroup(_0x101278)}};}else!_0x8b2433&&(_0x5ee6f1={'verified':!![],'status':_0x54680c(0x17e),'afterReadback':{'businessGroup':displayBusinessGroup(_0x3af7a1)}});const _0x35bb20={'operation':_0x54680c(0x184),'appCode':_0x44d8d8,'selector':{'code':_0x8622af[_0x54680c(0x17f)]},'dataset':{'id':_0x8622af['id'],'code':_0x8622af[_0x54680c(0x17f)],'name':_0x8622af['name'],'sourceType':_0x8622af[_0x54680c(0x1b2)]},'before':{'businessGroup':displayBusinessGroup(_0x3af7a1)},'after':{'businessGroup':displayBusinessGroup(_0x5415bb)},'changed':_0x8b2433,'dryRun':_0x5a28a1,'submitted':_0x8b2433&&!_0x5a28a1,'backend':{'method':_0xc2c087['method'],'path':_0xc2c087[_0x54680c(0x1a6)],'payload':_0xc2c087[_0x54680c(0x19b)]},..._0x5ee6f1?{'verification':_0x5ee6f1}:{},'warnings':[]};return{'ok':!![],'data':_0x35bb20,'message':_0x8b2433?_0x5a28a1?_0x54680c(0x175)+_0x8622af[_0x54680c(0x17f)]:_0x54680c(0x1a7)+_0x8622af[_0x54680c(0x17f)]:_0x54680c(0x1ad)+_0x8622af[_0x54680c(0x17f)]};}export const datasetBusinessGroupUpdate={'service':a66_0x16846e(0x1b5),'command':'business-group-update','description':a66_0x16846e(0x1b8),'risk':'write','flags':[CODE_FLAG,{'name':a66_0x16846e(0x178),'type':'string','required':!![],'description':a66_0x16846e(0x1b4)},{'name':a66_0x16846e(0x188),'type':a66_0x16846e(0x1a4),'required':![],'description':a66_0x16846e(0x194)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5a0a66){validateInput(readBusinessGroupUpdateInput(_0x5a0a66));},async 'dryRun'(_0x1b5df2){const _0x2637d9=a66_0x16846e,_0x44d0ce=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x1b5df2[_0x2637d9(0x1b3)],'input':readBusinessGroupUpdateInput(_0x1b5df2),'dryRun':!![]});return{'method':_0x44d0ce[_0x2637d9(0x1a8)][_0x2637d9(0x18e)][_0x2637d9(0x191)],'url':_0x44d0ce[_0x2637d9(0x1a8)][_0x2637d9(0x18e)][_0x2637d9(0x1a6)],'body':_0x44d0ce[_0x2637d9(0x1a8)][_0x2637d9(0x18e)]['payload'],'description':_0x44d0ce[_0x2637d9(0x1b9)],..._0x44d0ce[_0x2637d9(0x1a8)]};},async 'execute'(_0x199716){const _0x1a656e=a66_0x16846e;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x199716[_0x1a656e(0x1b3)],'input':readBusinessGroupUpdateInput(_0x199716),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x1ea188){const _0x105733=a66_0x16846e,_0x272872=_0x1ea188[_0x105733(0x182)](_0x105733(0x188));return{'code':trim(_0x1ea188[_0x105733(0x182)](_0x105733(0x17f))),'businessGroup':_0x1ea188[_0x105733(0x182)](_0x105733(0x178)),'expectBusinessGroup':_0x272872===undefined||_0x272872===''?undefined:_0x272872};}function validateInput(_0x12cfe7){const _0x4a31c5=a66_0x16846e;if(!trim(_0x12cfe7[_0x4a31c5(0x17f)]))throw CliErrors[_0x4a31c5(0x198)]('--code\x20is\x20required');if(_0x12cfe7[_0x4a31c5(0x196)]===undefined)throw CliErrors[_0x4a31c5(0x198)](_0x4a31c5(0x183));if(!trim(_0x12cfe7['businessGroup']))throw CliErrors[_0x4a31c5(0x198)](_0x4a31c5(0x1a2));}function assertBusinessGroupUpdateSupported(_0x59ff6f,_0xfc3116){const _0x356f09=a66_0x16846e;if(_0x59ff6f[_0x356f09(0x1b2)]===_0x356f09(0x1aa)&&!_0xfc3116)throw CliErrors[_0x356f09(0x198)](_0x356f09(0x176));}function resolveBusinessGroupDataset(_0x4fe5fb,_0xb8bd26){const _0x9ea0c5=a66_0x16846e,_0x5531fa=asPlainObject(_0x4fe5fb[_0x9ea0c5(0x1b5)]),_0x2f9570=asPlainObject(_0x4fe5fb['dbtableConfig']),_0x3d7d25=resolveSourceType(_0x4fe5fb,_0x5531fa,_0x2f9570),_0x346a1c=firstString(_0x4fe5fb['modelCode'],_0x4fe5fb['code'],_0x5531fa[_0x9ea0c5(0x17c)],_0xb8bd26)||_0xb8bd26;return{'id':firstNumber(_0x4fe5fb['modelId'],_0x4fe5fb['id'],_0x5531fa[_0x9ea0c5(0x17d)])??firstString(_0x4fe5fb[_0x9ea0c5(0x187)],_0x4fe5fb['id'],_0x5531fa[_0x9ea0c5(0x17d)])??null,'code':_0x346a1c,'name':firstString(_0x4fe5fb[_0x9ea0c5(0x1a3)],_0x5531fa[_0x9ea0c5(0x185)],_0x5531fa[_0x9ea0c5(0x1a3)])||null,'sourceType':_0x3d7d25,'dbTableSelector':_0x3d7d25===_0x9ea0c5(0x1aa)?{'dbLinkId':firstNumber(_0x2f9570['dbId']),'tableName':firstString(_0x2f9570['tableName'])||null}:null};}function a66_0x9cf5(){const _0x19e39b=['unchanged','code','parse','564201BRMhEn','str','--business-group\x20is\x20required','update','datasetName','kind','modelId','expect-business-group','/smartapi/question/er-config/business-group/edit','tableName','extend','number','410OVBFFu','backend','prototype','source','method','object','12OUdUpI','Expected\x20current\x20business\x20scenario\x20group;\x20use\x20ungrouped\x20to\x20expect\x20no\x20group;\x20mismatch\x20aborts\x20without\x20writing','isFinite','businessGroup','Expectation\x20mismatch\x20at\x20businessGroup','validation','expectBusinessGroup','4304685NDVIzo','payload','dbLinkId','METADATA','42028283wVYLOT','210861HtYOUJ','8JwUvED','POST','--business-group\x20must\x20not\x20be\x20blank','name','string','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','path','Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20','data','stringify','DB_TABLE','trim','9391362BZUxOI','No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20','found','matched','hasOwnProperty','DB_TABLE\x20dataset\x20requires\x20dbtableConfig.dbId\x20and\x20tableName.','sourceType','appCode','Business\x20scenario\x20group\x20(not\x20technical):\x20use\x20<scenario>,\x20<domain>---<scenario>\x20when\x20needed;\x20METADATA\x20accepts\x20ungrouped\x20to\x20clear\x20it','dataset','1053815GOrzHt','30050YGZGAk','Update\x20business\x20scenario\x20group','message',',\x20actual\x20','/smartapi/dblink/updateTableBusinessGroup','dbTableSelector','8JKRjbd','Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','value','Expected\x20','Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20','Clearing\x20business\x20scenario\x20groups\x20is\x20not\x20supported\x20for\x20DB_TABLE\x20datasets.','Run\x20dataset\x20detail\x20and\x20complete\x20database\x20analysis\x20before\x20updating\x20the\x20business\x20group.','business-group','isArray','length','toUpperCase','datasetCode','datasetId'];a66_0x9cf5=function(){return _0x19e39b;};return a66_0x9cf5();}function resolveSourceType(_0x301f2,_0x28166d,_0x2ba73a){const _0x227e25=a66_0x16846e,_0x96b535=firstString(_0x301f2[_0x227e25(0x190)],_0x301f2[_0x227e25(0x1b2)],_0x28166d[_0x227e25(0x190)],_0x28166d[_0x227e25(0x1b2)])?.[_0x227e25(0x1ab)]()[_0x227e25(0x17b)]();if(_0x96b535==='DB_TABLE'||_0x96b535===_0x227e25(0x19d))return _0x96b535;if(Object['keys'](_0x2ba73a)[_0x227e25(0x17a)]>0x0)return _0x227e25(0x1aa);throw CliErrors[_0x227e25(0x198)](_0x227e25(0x1a5));}function loadCurrentBusinessGroup(_0x5d5203,_0x399a4a){const _0x20dc57=a66_0x16846e,_0x103fad=readBusinessGroupFromDatasetDetail(_0x5d5203,_0x399a4a['sourceType']);if(_0x103fad[_0x20dc57(0x1ae)])return normalizeBusinessGroup(_0x103fad[_0x20dc57(0x173)]);return'';}function readBusinessGroupFromDatasetDetail(_0x43d7e9,_0x4d3cab){const _0x3f3efe=a66_0x16846e,_0x310c09=asPlainObject(_0x43d7e9[_0x3f3efe(0x1b5)]),_0x8ad4e1=firstPresent(_0x43d7e9[_0x3f3efe(0x196)]);if(_0x8ad4e1['found'])return _0x8ad4e1;const _0x5216c0=firstPresent(_0x310c09[_0x3f3efe(0x196)]);if(_0x5216c0[_0x3f3efe(0x1ae)])return _0x5216c0;if(_0x4d3cab==='DB_TABLE')return{'found':![]};const _0x4f4272=readBusinessGroupFromExtend(_0x43d7e9[_0x3f3efe(0x18b)]);if(_0x4f4272[_0x3f3efe(0x1ae)])return _0x4f4272;return readBusinessGroupFromExtend(_0x310c09[_0x3f3efe(0x18b)]);}function readBusinessGroupFromExtend(_0x29b795){const _0x4d79f5=a66_0x16846e;if(_0x29b795===undefined||_0x29b795===null||_0x29b795==='')return{'found':![]};if(typeof _0x29b795===_0x4d79f5(0x1a4))try{const _0x46c441=JSON[_0x4d79f5(0x180)](_0x29b795);return readBusinessGroupFromExtend(_0x46c441);}catch{return{'found':![]};}const _0x3072eb=asPlainObject(_0x29b795);if(Object[_0x4d79f5(0x18f)][_0x4d79f5(0x1b0)]['call'](_0x3072eb,'businessGroup'))return{'found':!![],'value':_0x3072eb['businessGroup']};return{'found':![]};}function firstPresent(..._0x21a126){for(const _0x207891 of _0x21a126){if(_0x207891!==undefined&&_0x207891!==null)return{'found':!![],'value':_0x207891};}return{'found':![]};}function assertExpectedBusinessGroup(_0x1e2f1f,_0x3587e6){const _0x19c593=a66_0x16846e;if(_0x3587e6===undefined)return;const _0x216f8d=normalizeBusinessGroupArgument(_0x3587e6);if(_0x1e2f1f!==_0x216f8d)throw CliErrors[_0x19c593(0x198)](_0x19c593(0x197),_0x19c593(0x174)+JSON['stringify'](_0x216f8d)+',\x20actual\x20'+JSON[_0x19c593(0x1a9)](_0x1e2f1f));}function buildBackendPlan(_0x1d33eb,_0x454493,_0x40031b){const _0x5e3f6a=a66_0x16846e;if(_0x454493[_0x5e3f6a(0x1b2)]===_0x5e3f6a(0x1aa)){if(!_0x454493[_0x5e3f6a(0x1bc)]||_0x454493[_0x5e3f6a(0x1bc)][_0x5e3f6a(0x19c)]===null||!_0x454493[_0x5e3f6a(0x1bc)][_0x5e3f6a(0x18a)])throw CliErrors[_0x5e3f6a(0x198)](_0x5e3f6a(0x1b1),_0x5e3f6a(0x177));return{'kind':'db-table','method':_0x5e3f6a(0x1a1),'path':DB_TABLE_BACKEND_PATH,'payload':{'dbLinkId':_0x454493['dbTableSelector'][_0x5e3f6a(0x19c)],'tableName':_0x454493['dbTableSelector'][_0x5e3f6a(0x18a)],'businessGroup':_0x40031b}};}return{'kind':'metadata','method':_0x5e3f6a(0x1a1),'path':METADATA_BACKEND_PATH,'payload':{'appCode':_0x1d33eb,'datasetCode':_0x454493[_0x5e3f6a(0x17f)],'businessGroup':_0x40031b}};}function normalizeBusinessGroup(_0xf0fba4){if(_0xf0fba4===undefined||_0xf0fba4===null)return'';return String(_0xf0fba4)['trim']();}function normalizeBusinessGroupArgument(_0x193c11){const _0x41a27d=normalizeBusinessGroup(_0x193c11);return _0x41a27d===UNGROUPED_BUSINESS_GROUP?'':_0x41a27d;}function displayBusinessGroup(_0x19827){return _0x19827||UNGROUPED_BUSINESS_GROUP;}function a66_0x7d9a(_0x17bbb4,_0x58803d){_0x17bbb4=_0x17bbb4-0x171;const _0x9cf50b=a66_0x9cf5();let _0x7d9a55=_0x9cf50b[_0x17bbb4];return _0x7d9a55;}function asPlainObject(_0x63fd10){const _0x56223e=a66_0x16846e;if(!_0x63fd10||typeof _0x63fd10!==_0x56223e(0x192)||Array[_0x56223e(0x179)](_0x63fd10))return{};return _0x63fd10;}function firstString(..._0x23d037){const _0x194548=a66_0x16846e;for(const _0x2e91b8 of _0x23d037){if(typeof _0x2e91b8===_0x194548(0x1a4)&&_0x2e91b8['trim']())return _0x2e91b8[_0x194548(0x1ab)]();if(typeof _0x2e91b8===_0x194548(0x18c)&&Number[_0x194548(0x195)](_0x2e91b8))return String(_0x2e91b8);}return undefined;}function firstNumber(..._0x15b202){const _0x1ccfc6=a66_0x16846e;for(const _0x564052 of _0x15b202){if(typeof _0x564052===_0x1ccfc6(0x18c)&&Number[_0x1ccfc6(0x195)](_0x564052))return _0x564052;if(typeof _0x564052===_0x1ccfc6(0x1a4)&&_0x564052[_0x1ccfc6(0x1ab)]()&&Number[_0x1ccfc6(0x195)](Number(_0x564052)))return Number(_0x564052);}return null;}function trim(_0x295b45){const _0x125608=a66_0x16846e;return String(_0x295b45||'')[_0x125608(0x1ab)]();}
|
|
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
|
-
function
|
|
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
|
-
const
|
|
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_0xc32d68=a72_0x8856;(function(_0x338cb9,_0x3ad0ca){const _0x433df7=a72_0x8856,_0x5b4e6b=_0x338cb9();while(!![]){try{const _0x434e9f=-parseInt(_0x433df7(0x186))/0x1*(parseInt(_0x433df7(0x172))/0x2)+parseInt(_0x433df7(0x171))/0x3+-parseInt(_0x433df7(0x178))/0x4*(parseInt(_0x433df7(0x18e))/0x5)+-parseInt(_0x433df7(0x16c))/0x6+-parseInt(_0x433df7(0x149))/0x7+parseInt(_0x433df7(0x187))/0x8*(parseInt(_0x433df7(0x152))/0x9)+parseInt(_0x433df7(0x156))/0xa;if(_0x434e9f===_0x3ad0ca)break;else _0x5b4e6b['push'](_0x5b4e6b['shift']());}catch(_0x1c9660){_0x5b4e6b['push'](_0x5b4e6b['shift']());}}}(a72_0x3128,0xc735f));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(_0x2d5455,_0x2ab03a){const _0x148d5d=a72_0x8856,_0x1ad569=_0x2d5455[_0x148d5d(0x15e)](_0x2ab03a)[_0x148d5d(0x150)]();if(!_0x1ad569)throw CliErrors[_0x148d5d(0x14d)](_0x2ab03a);return _0x1ad569;}function a72_0x3128(){const _0x40ccaa=['Provide\x20--from-datasetcode\x20or\x20--from-dblink-id.','sourceType','7olzAbo','8zdhUjl','relationId','storageProfile','tableName','label_inherited','multiple\x20cross-database\x20relations\x20matched','fromDatasetCode','60ykwjNh','Multiple\x20cross-database\x20relations\x20match\x20this\x20source\x20field;\x20update/delete\x20cannot\x20select\x20one\x20target.','some','includes','Would\x20','dataset','isSafeInteger','update','fromDblinkId','delete','from-datasetcode','body','query','validation','datasetCode','dblinkId','fromField','catch','DB_TABLE','dbtable','1388163tZzlJA','from-dblink-id','Dataset\x20','fromTableName','flagMissing','before','\x20must\x20be\x20a\x20DB_TABLE\x20dataset.','trim','parse','9470367ReviBN','toLowerCase','from-column','matched','20730470JQQwXi','defineProperty','expectedLabel','expectedCardinality','\x20write\x20was\x20not\x20verified.','length','\x20a\x20cross-database\x20relation\x20for\x20','relationType','str','to-label-column','refTableLabelName','create','Invalid\x20--cardinality.','data','extend','\x20is\x20missing\x20its\x20database\x20connection\x20or\x20physical\x20table\x20name.','to-column','string','--from-dblink-id\x20does\x20not\x20match\x20the\x20source\x20dataset\x20connection.','flag','Cross-database\x20relation\x20','toTableName','6277176CYrBZs','cardinality','toDblinkId','map','dbId','2130492AbcKxZ','108980JSyMnt','appCode','The\x20target\x20display\x20field\x20is\x20inherited.\x20When\x20changing\x20the\x20target\x20dataset,\x20provide\x20--to-label-column\x20explicitly.','Run\x20dataset\x20cross-relation-list\x20to\x20inspect\x20the\x20candidates.\x20This\x20command\x20accepts\x20only\x20a\x20source\x20dataset\x20and\x20field.','enum','apiError','464524rNKstN','list','Cross-database\x20relation\x20not\x20found\x20for\x20this\x20source\x20dataset\x20and\x20field.','to-datasetcode','from','\x20has\x20invalid\x20storage\x20configuration.','Cross-database\x20relation\x20already\x20exists\x20for\x20these\x20source\x20and\x20target\x20endpoints.','table','dbtableConfig','source','Cross-database\x20relations\x20require\x20different\x20source\x20and\x20target\x20database\x20connections.','toField'];a72_0x3128=function(){return _0x40ccaa;};return a72_0x3128();}function explicitDblink(_0x255650){const _0x2bb2c3=a72_0x8856,_0x4a15c8=_0x255650[_0x2bb2c3(0x169)](_0x2bb2c3(0x14a));if(_0x4a15c8===undefined||_0x4a15c8===null)return undefined;const _0x3c76f9=Number(_0x4a15c8);if(!Number[_0x2bb2c3(0x13b)](_0x3c76f9)||_0x3c76f9<=0x0)throw CliErrors[_0x2bb2c3(0x142)]('--from-dblink-id\x20must\x20be\x20a\x20positive\x20safe\x20integer.');return _0x3c76f9;}export function validateCrossRelation(_0x160b24,_0x204c81){const _0x83df89=a72_0x8856,_0x3fa2f1=explicitDblink(_0x160b24);if(_0x204c81===_0x83df89(0x179)){if(!_0x160b24['str'](_0x83df89(0x13f))[_0x83df89(0x150)]()&&_0x3fa2f1===undefined)throw CliErrors[_0x83df89(0x142)](_0x83df89(0x184));return;}required(_0x160b24,'from-datasetcode'),required(_0x160b24,_0x83df89(0x154));if(_0x204c81!==_0x83df89(0x13e)){required(_0x160b24,_0x83df89(0x17b)),required(_0x160b24,_0x83df89(0x166));const _0x1357c2=_0x160b24[_0x83df89(0x15e)]('cardinality')[_0x83df89(0x150)]();if(_0x1357c2&&!CROSS_RELATION_CARDINALITY_FLAG[_0x83df89(0x176)][_0x83df89(0x191)](_0x1357c2))throw CliErrors[_0x83df89(0x142)](_0x83df89(0x162));}}async function resolveEndpoint(_0x17d462){const _0x4dd250=a72_0x8856,_0x2c81ee=await getDatasetDetail(_0x17d462),_0x1c9147=_0x2c81ee?.[_0x4dd250(0x193)]??{};if((_0x2c81ee?.[_0x4dd250(0x181)]??_0x1c9147[_0x4dd250(0x185)])!=='DB_TABLE')throw CliErrors['validation'](_0x4dd250(0x14b)+_0x17d462+_0x4dd250(0x14f));const _0x2f8fe6=_0x2c81ee[_0x4dd250(0x180)]??_0x2c81ee[_0x4dd250(0x148)]??{};let _0x749b35=_0x2c81ee[_0x4dd250(0x164)]??_0x1c9147['extend']??{};if(typeof _0x749b35===_0x4dd250(0x167))try{_0x749b35=_0x749b35[_0x4dd250(0x150)]()?JSON[_0x4dd250(0x151)](_0x749b35):{};}catch{throw CliErrors[_0x4dd250(0x142)](_0x4dd250(0x14b)+_0x17d462+_0x4dd250(0x17d));}const _0x25d5df=Number(_0x749b35?.[_0x4dd250(0x189)]?.[_0x4dd250(0x170)]??_0x2c81ee[_0x4dd250(0x189)]?.['dbId']??_0x1c9147['storageProfile']?.[_0x4dd250(0x170)]??_0x2f8fe6[_0x4dd250(0x170)]??_0x1c9147[_0x4dd250(0x170)]??_0x2c81ee[_0x4dd250(0x170)]),_0x40f3f1=String(_0x2c81ee[_0x4dd250(0x18a)]??_0x1c9147['tableName']??_0x2f8fe6[_0x4dd250(0x18a)]??'')[_0x4dd250(0x150)]();if(!Number[_0x4dd250(0x13b)](_0x25d5df)||_0x25d5df<=0x0||!_0x40f3f1)throw CliErrors[_0x4dd250(0x142)]('Dataset\x20'+_0x17d462+_0x4dd250(0x165));return{'datasetCode':_0x17d462,'dblinkId':_0x25d5df,'table':_0x40f3f1};}export async function resolveCrossRelationQuery(_0x47f45f){const _0x3ff655=a72_0x8856,_0x3b26ea=_0x47f45f[_0x3ff655(0x15e)](_0x3ff655(0x13f))[_0x3ff655(0x150)](),_0x5ce15a=explicitDblink(_0x47f45f),_0x4bc8fe=_0x3b26ea?await resolveEndpoint(_0x3b26ea):undefined;if(_0x4bc8fe&&_0x5ce15a!==undefined&&_0x4bc8fe[_0x3ff655(0x144)]!==_0x5ce15a)throw CliErrors['validation'](_0x3ff655(0x168));const _0x3cd71d=_0x4bc8fe?.['dblinkId']??_0x5ce15a;if(_0x3cd71d===undefined)throw CliErrors[_0x3ff655(0x142)](_0x3ff655(0x184));return{'appCode':_0x47f45f[_0x3ff655(0x173)],'fromDblinkId':_0x3cd71d,..._0x3b26ea?{'fromDatasetCode':_0x3b26ea}:{},..._0x47f45f[_0x3ff655(0x15e)](_0x3ff655(0x154))['trim']()?{'fromField':_0x47f45f[_0x3ff655(0x15e)](_0x3ff655(0x154))['trim']()}:{}};}export function projectCrossRelation(_0x5451c2){const _0x57b6f9=a72_0x8856;return{'relationId':_0x5451c2[_0x57b6f9(0x188)],'from':{'source':_0x57b6f9(0x147),'datasetCode':_0x5451c2[_0x57b6f9(0x18d)],'datasetName':_0x5451c2['fromDatasetName'],'dblinkId':_0x5451c2[_0x57b6f9(0x13d)],'table':_0x5451c2[_0x57b6f9(0x14c)],'field':_0x5451c2['fromField']},'to':{'source':_0x57b6f9(0x147),'datasetCode':_0x5451c2['toDatasetCode'],'datasetName':_0x5451c2['toDatasetName'],'dblinkId':_0x5451c2[_0x57b6f9(0x16e)],'table':_0x5451c2['toTableName'],'field':_0x5451c2['toField'],'labelField':_0x5451c2[_0x57b6f9(0x160)]},'relation':{'cardinality':_0x5451c2[_0x57b6f9(0x16d)],'relationType':_0x5451c2[_0x57b6f9(0x15d)]}};}function a72_0x8856(_0x69e93b,_0x4ee09f){_0x69e93b=_0x69e93b-0x13b;const _0x31285c=a72_0x3128();let _0x8856e2=_0x31285c[_0x69e93b];return _0x8856e2;}function ambiguity(_0xc006df){const _0x5c3598=a72_0x8856,_0x12619=CliErrors[_0x5c3598(0x142)](_0x5c3598(0x18f),_0x5c3598(0x175));return Object[_0x5c3598(0x157)](_0x12619,_0x5c3598(0x163),{'value':{'candidates':_0xc006df[_0x5c3598(0x16f)](projectCrossRelation)}}),_0x12619;}const sameName=(_0x1b8134,_0x36ea79)=>_0x1b8134[a72_0xc32d68(0x153)]()===_0x36ea79['toLowerCase']();function matchesEndpoint(_0x877c7f,_0xe98520,_0x2ffe7e,_0x84626b,_0x31fab7){const _0x5e8995=a72_0xc32d68;return _0x877c7f[_0x5e8995(0x13d)]===_0xe98520['dblinkId']&&sameName(_0x877c7f['fromTableName'],_0xe98520[_0x5e8995(0x17f)])&&sameName(_0x877c7f[_0x5e8995(0x145)],_0x2ffe7e)&&_0x877c7f[_0x5e8995(0x16e)]===_0x84626b['dblinkId']&&sameName(_0x877c7f[_0x5e8995(0x16b)],_0x84626b['table'])&&sameName(_0x877c7f[_0x5e8995(0x183)],_0x31fab7);}export async function prepareCrossRelation(_0x11f81c,_0x45ee22){const _0x44f840=a72_0xc32d68,_0x5840c5=await resolveEndpoint(required(_0x11f81c,_0x44f840(0x13f))),_0x34d3a1=explicitDblink(_0x11f81c);if(_0x34d3a1!==undefined&&_0x5840c5['dblinkId']!==_0x34d3a1)throw CliErrors[_0x44f840(0x142)](_0x44f840(0x168));const _0x2836ea={'appCode':_0x11f81c[_0x44f840(0x173)],'fromDatasetCode':_0x5840c5[_0x44f840(0x143)],'fromField':required(_0x11f81c,'from-column'),..._0x34d3a1!==undefined?{'fromDblinkId':_0x34d3a1}:{}},_0x4b2366={'appCode':_0x11f81c[_0x44f840(0x173)],'fromDblinkId':_0x5840c5[_0x44f840(0x144)],'fromDatasetCode':_0x5840c5[_0x44f840(0x143)],'fromField':_0x2836ea[_0x44f840(0x145)]},_0x23942f=await queryCrossDbRelations(_0x4b2366);let _0x5073ce=null;if(_0x45ee22!==_0x44f840(0x161)){if(_0x23942f[_0x44f840(0x15b)]>0x1)throw ambiguity(_0x23942f);_0x5073ce=_0x23942f[0x0]??null;if(!_0x5073ce)throw CliErrors['validation'](_0x44f840(0x17a));}if(_0x45ee22===_0x44f840(0x13e))return{'operation':_0x45ee22,'from':_0x5840c5,'query':_0x4b2366,'body':_0x2836ea,'before':_0x5073ce};const _0x52e2d8=await resolveEndpoint(required(_0x11f81c,_0x44f840(0x17b)));if(_0x5840c5['dblinkId']===_0x52e2d8[_0x44f840(0x144)])throw CliErrors[_0x44f840(0x142)](_0x44f840(0x182));const _0x5ad431=_0x11f81c['str'](_0x44f840(0x15f))[_0x44f840(0x150)](),_0x4026cf=_0x11f81c[_0x44f840(0x15e)](_0x44f840(0x16d))[_0x44f840(0x150)](),_0x1d141a={..._0x2836ea,'toDatasetCode':_0x52e2d8[_0x44f840(0x143)],'toField':required(_0x11f81c,_0x44f840(0x166)),..._0x5ad431?{'refTableLabelName':_0x5ad431}:{},..._0x4026cf?{'cardinality':_0x4026cf}:{}};if(_0x23942f[_0x44f840(0x190)](_0x108376=>_0x108376['relationId']!==_0x5073ce?.[_0x44f840(0x188)]&&matchesEndpoint(_0x108376,_0x5840c5,_0x1d141a[_0x44f840(0x145)],_0x52e2d8,_0x1d141a[_0x44f840(0x183)])))throw CliErrors[_0x44f840(0x142)](_0x44f840(0x17e));return{'operation':_0x45ee22,'from':_0x5840c5,'to':_0x52e2d8,'query':_0x4b2366,'body':_0x1d141a,'before':_0x5073ce,'expectedLabel':_0x5ad431||_0x5073ce?.['refTableLabelName']||_0x1d141a['toField'],'expectedCardinality':_0x4026cf||_0x5073ce?.[_0x44f840(0x16d)]||null};}function mutationData(_0x5aefdb,_0x12196a,_0x1961d5){const _0x5b765d=a72_0xc32d68,{operation:_0x50b00b,body:_0x175412,before:_0x3b8099}=_0x5aefdb;return{'operation':_0x50b00b,'selector':{'appCode':_0x175412[_0x5b765d(0x173)],'from':{'datasetCode':_0x175412['fromDatasetCode'],'field':_0x175412[_0x5b765d(0x145)],'dblinkId':_0x5aefdb['from'][_0x5b765d(0x144)]}},'before':_0x3b8099?projectCrossRelation(_0x3b8099):null,'after':_0x1961d5,'dryRun':_0x12196a,'backend':{'method':'POST','path':CROSS_DB_RELATION_PATHS[_0x50b00b]},'warnings':_0x50b00b===_0x5b765d(0x13c)&&!_0x175412['refTableLabelName']?[{'code':_0x5b765d(0x18b),'message':_0x5b765d(0x174)}]:[]};}export async function previewCrossRelation(_0xd1c4b6,_0x1efbd9){const _0x379f3a=a72_0xc32d68,_0xc8d5af=await prepareCrossRelation(_0xd1c4b6,_0x1efbd9),_0x5a5cf9=_0xc8d5af['body'],_0x3f52d8=_0x1efbd9===_0x379f3a(0x13e)?null:{..._0xc8d5af[_0x379f3a(0x14e)]?{'relationId':_0xc8d5af['before']['relationId']}:{},'from':{'datasetCode':_0xc8d5af[_0x379f3a(0x17c)][_0x379f3a(0x143)],'dblinkId':_0xc8d5af['from']['dblinkId'],'table':_0xc8d5af[_0x379f3a(0x17c)][_0x379f3a(0x17f)],'field':_0x5a5cf9['fromField']},'to':{'datasetCode':_0xc8d5af['to'][_0x379f3a(0x143)],'dblinkId':_0xc8d5af['to'][_0x379f3a(0x144)],'table':_0xc8d5af['to'][_0x379f3a(0x17f)],'field':_0x5a5cf9[_0x379f3a(0x183)],'labelField':_0xc8d5af[_0x379f3a(0x158)]},'relation':{'cardinality':_0xc8d5af[_0x379f3a(0x159)],'relationType':0x2}};return{...mutationData(_0xc8d5af,!![],null),'after':_0x3f52d8,'method':'POST','url':CROSS_DB_RELATION_PATHS[_0x1efbd9],'body':_0xc8d5af['body'],'description':_0x379f3a(0x192)+_0x1efbd9+_0x379f3a(0x15c)+_0x5a5cf9[_0x379f3a(0x18d)]+'.'+_0x5a5cf9['fromField']};}export async function executeCrossRelation(_0x578730,_0x3e8b04,_0x221919){const _0x40b70b=a72_0xc32d68,_0x3303b8=await prepareCrossRelation(_0x578730,_0x3e8b04);try{await _0x221919(_0x3303b8['body']);}catch(_0x24380f){if(_0x24380f instanceof CliError&&_0x24380f['message'][_0x40b70b(0x191)](_0x40b70b(0x18c))){const _0x53d1a8=await queryCrossDbRelations(_0x3303b8[_0x40b70b(0x141)])[_0x40b70b(0x146)](()=>[]);throw ambiguity(_0x53d1a8);}throw _0x24380f;}let _0x244f78=[],_0x1cc3e8,_0x3ef1c7=![];try{_0x244f78=await queryCrossDbRelations(_0x3303b8['query']);if(_0x3e8b04===_0x40b70b(0x13e))_0x3ef1c7=!_0x244f78[_0x40b70b(0x190)](_0xb19a0=>_0xb19a0[_0x40b70b(0x188)]===_0x3303b8[_0x40b70b(0x14e)][_0x40b70b(0x188)]);else{const _0xc782e3=_0x3303b8[_0x40b70b(0x140)],_0x10a7ec=_0x244f78['filter'](_0x47afe6=>matchesEndpoint(_0x47afe6,_0x3303b8['from'],_0xc782e3[_0x40b70b(0x145)],_0x3303b8['to'],_0xc782e3['toField'])&&(_0x3e8b04===_0x40b70b(0x161)||_0x47afe6[_0x40b70b(0x188)]===_0x3303b8[_0x40b70b(0x14e)]['relationId']));_0x1cc3e8=_0x10a7ec[_0x40b70b(0x15b)]===0x1?_0x10a7ec[0x0]:undefined,_0x3ef1c7=!!_0x1cc3e8&&_0x1cc3e8[_0x40b70b(0x160)]===_0x3303b8[_0x40b70b(0x158)]&&_0x1cc3e8['cardinality']===_0x3303b8[_0x40b70b(0x159)]&&_0x1cc3e8['relationType']===0x2;}}catch{}const _0x31195f={...mutationData(_0x3303b8,![],_0x1cc3e8?projectCrossRelation(_0x1cc3e8):null),'verification':{'status':_0x3ef1c7?_0x40b70b(0x155):'unconfirmed','verified':_0x3ef1c7}};if(!_0x3ef1c7){const _0x2d0fa4=CliErrors[_0x40b70b(0x177)](_0x40b70b(0x16a)+_0x3e8b04+_0x40b70b(0x15a),'The\x20write\x20was\x20accepted,\x20but\x20current\x20state\x20could\x20not\x20be\x20confirmed.\x20Run\x20dataset\x20cross-relation-list\x20before\x20attempting\x20another\x20write.');Object[_0x40b70b(0x157)](_0x2d0fa4,'data',{'value':{..._0x31195f,'candidates':_0x244f78[_0x40b70b(0x16f)](projectCrossRelation)}});throw _0x2d0fa4;}return{'ok':!![],'data':_0x31195f,'message':_0x40b70b(0x16a)+_0x3e8b04+'\x20verified.'};}
|
|
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
|
-
const
|
|
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();}
|