@lovrabet/rabetbase-cli 2.3.16-beta.4 → 2.3.16-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.d.ts +9 -0
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.d.ts +2 -0
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +8 -0
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.d.ts +13 -0
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.d.ts +25 -0
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.d.ts +2 -0
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.d.ts +1 -0
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.d.ts +51 -0
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.d.ts +1 -0
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.d.ts +5 -0
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.d.ts +1 -0
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.d.ts +12 -0
- package/lib/cli-flags.js +1 -1
- package/lib/cli.d.ts +2 -0
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.d.ts +2 -0
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.d.ts +2 -0
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.d.ts +2 -0
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.d.ts +2 -0
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.d.ts +18 -0
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.d.ts +5 -0
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.d.ts +10 -0
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.d.ts +2 -0
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.d.ts +11 -0
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.d.ts +46 -0
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.d.ts +2 -0
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.d.ts +2 -0
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.d.ts +2 -0
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.d.ts +2 -0
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.d.ts +2 -0
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.d.ts +105 -0
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.d.ts +2 -0
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.d.ts +4 -0
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.d.ts +2 -0
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.d.ts +2 -0
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.d.ts +5 -0
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.d.ts +2 -0
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.d.ts +2 -0
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.d.ts +2 -0
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.d.ts +2 -0
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.d.ts +8 -0
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.d.ts +2 -0
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.d.ts +2 -0
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.d.ts +2 -0
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.d.ts +2 -0
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.d.ts +17 -0
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.d.ts +17 -0
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.d.ts +11 -0
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.d.ts +12 -0
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.d.ts +26 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.d.ts +6 -0
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.d.ts +13 -0
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.d.ts +5 -0
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.d.ts +5 -0
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.d.ts +5 -0
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.d.ts +5 -0
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.d.ts +16 -0
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.d.ts +7 -0
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.d.ts +7 -0
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.d.ts +8 -0
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.d.ts +33 -0
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.d.ts +18 -0
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.d.ts +11 -0
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.d.ts +2 -0
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.d.ts +2 -0
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.d.ts +26 -0
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.d.ts +27 -0
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.d.ts +3 -0
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.d.ts +2 -0
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.d.ts +2 -0
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.d.ts +2 -0
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.d.ts +2 -0
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.d.ts +2 -0
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.d.ts +2 -0
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.d.ts +128 -0
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.d.ts +2 -0
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.d.ts +53 -0
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.d.ts +17 -0
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.d.ts +2 -0
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.d.ts +30 -0
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.d.ts +2 -0
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.d.ts +2 -0
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.d.ts +2 -0
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.d.ts +2 -0
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.d.ts +2 -0
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.d.ts +2 -0
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.d.ts +2 -0
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.d.ts +2 -0
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.d.ts +5 -0
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.d.ts +2 -0
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.d.ts +15 -0
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.d.ts +2 -0
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.d.ts +2 -0
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.d.ts +2 -0
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.d.ts +2 -0
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.d.ts +2 -0
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.d.ts +11 -0
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.d.ts +2 -0
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.d.ts +23 -0
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.d.ts +2 -0
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.d.ts +32 -0
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.d.ts +2 -0
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.d.ts +2 -0
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.d.ts +2 -0
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.d.ts +2 -0
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.d.ts +2 -0
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.d.ts +33 -0
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.d.ts +2 -0
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.d.ts +5 -0
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.d.ts +2 -0
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.d.ts +2 -0
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.d.ts +3 -0
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.d.ts +2 -0
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.d.ts +2 -0
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.d.ts +2 -0
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.d.ts +17 -0
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.d.ts +2 -0
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.d.ts +2 -0
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.d.ts +2 -0
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.d.ts +2 -0
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.d.ts +27 -0
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.d.ts +51 -0
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.d.ts +12 -0
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.d.ts +12 -0
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.d.ts +10 -0
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.d.ts +12 -0
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.d.ts +28 -0
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.d.ts +69 -0
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.d.ts +17 -0
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.d.ts +7 -0
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/types.d.ts +162 -0
- package/lib/commands/menu/shared/update-core.d.ts +11 -0
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.d.ts +6 -0
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.d.ts +2 -0
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.d.ts +2 -0
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.d.ts +2 -0
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.d.ts +2 -0
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.d.ts +2 -0
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.d.ts +2 -0
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.d.ts +2 -0
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.d.ts +2 -0
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.d.ts +2 -0
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.d.ts +2 -0
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.d.ts +2 -0
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.d.ts +105 -0
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.d.ts +2 -0
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.d.ts +2 -0
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.d.ts +2 -0
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.d.ts +2 -0
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.d.ts +2 -0
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.d.ts +2 -0
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.d.ts +2 -0
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.d.ts +2 -0
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.d.ts +74 -0
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.d.ts +7 -0
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.d.ts +1 -0
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +6 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.d.ts +9 -0
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.d.ts +4 -0
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +1 -0
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.d.ts +1 -0
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.d.ts +1 -0
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.d.ts +2 -0
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.d.ts +1 -0
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.d.ts +66 -0
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.d.ts +2 -0
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.d.ts +2 -0
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.d.ts +2 -0
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.d.ts +2 -0
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.d.ts +2 -0
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.d.ts +107 -0
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.d.ts +2 -0
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.d.ts +2 -0
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.d.ts +2 -0
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.d.ts +2 -0
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.d.ts +2 -0
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.d.ts +5 -0
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.d.ts +10 -0
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.d.ts +5 -0
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.d.ts +2 -0
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.d.ts +2 -0
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.d.ts +5 -0
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.d.ts +2 -0
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.d.ts +5 -0
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.d.ts +5 -0
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.d.ts +23 -0
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.d.ts +5 -0
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.d.ts +2 -0
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.d.ts +2 -0
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.d.ts +2 -0
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.d.ts +2 -0
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.d.ts +2 -0
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.d.ts +10 -0
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/workspace/add.d.ts +6 -0
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.d.ts +11 -0
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.d.ts +6 -0
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.d.ts +50 -0
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.d.ts +1 -0
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.d.ts +34 -0
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.d.ts +10 -0
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.d.ts +14 -0
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.d.ts +11 -0
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.d.ts +1 -0
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.d.ts +5 -0
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.d.ts +1 -0
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.d.ts +36 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.d.ts +5 -0
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.d.ts +61 -0
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +102 -0
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.d.ts +31 -0
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +1018 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.d.ts +8 -0
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.d.ts +28 -0
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.d.ts +7 -0
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.d.ts +25 -0
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/types.d.ts +92 -0
- package/lib/core/bff/utils.d.ts +25 -0
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.d.ts +43 -0
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.d.ts +6 -0
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.d.ts +4 -0
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.d.ts +8 -0
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/types.d.ts +22 -0
- package/lib/core/sql-index-auditor.d.ts +33 -0
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.d.ts +7 -0
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.d.ts +7 -0
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.d.ts +5 -0
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.d.ts +14 -0
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/types.d.ts +43 -0
- package/lib/core/sql-sync/utils.d.ts +10 -0
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.d.ts +34 -0
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.d.ts +3 -0
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.d.ts +2 -0
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.d.ts +9 -0
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.d.ts +3 -0
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.d.ts +3 -0
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.d.ts +4 -0
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.d.ts +11 -0
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.d.ts +15 -0
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.d.ts +2 -0
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.d.ts +14 -0
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.d.ts +36 -0
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.d.ts +3 -0
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.d.ts +63 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -0
- package/lib/generated/build-info.js +1 -1
- package/lib/help.d.ts +1 -0
- package/lib/help.js +1 -1
- package/lib/runtime/confirmation.d.ts +4 -0
- package/lib/runtime/confirmation.js +1 -0
- package/lib/runtime/event.d.ts +5 -0
- package/lib/runtime/event.js +1 -0
- package/lib/runtime/index.d.ts +7 -0
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/queue.d.ts +5 -0
- package/lib/runtime/queue.js +1 -0
- package/lib/runtime/resolve.d.ts +8 -0
- package/lib/runtime/resolve.js +1 -0
- package/lib/runtime/types.d.ts +50 -0
- package/lib/runtime/types.js +1 -0
- package/lib/skills/main.d.ts +41 -0
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +99 -0
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.d.ts +44 -0
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.d.ts +12 -0
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.d.ts +8 -0
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.d.ts +6 -0
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.d.ts +3 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.d.ts +17 -0
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.d.ts +26 -0
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +93 -0
- package/lib/utils/ai_config.d.ts +47 -0
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.d.ts +1 -0
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.d.ts +42 -0
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.d.ts +23 -0
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.d.ts +37 -0
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.d.ts +9 -0
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.d.ts +42 -0
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.d.ts +1 -0
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.d.ts +30 -0
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.d.ts +25 -0
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.d.ts +80 -0
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.d.ts +30 -0
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.d.ts +7 -0
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.d.ts +62 -0
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.d.ts +15 -0
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.d.ts +21 -0
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.d.ts +38 -0
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.d.ts +1 -0
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.d.ts +55 -0
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.d.ts +10 -0
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.d.ts +1 -0
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.d.ts +1 -0
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.d.ts +6 -0
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a71_0xd4c39c=a71_0xb829;(function(_0x523694,_0x128a82){const _0x5142d3=a71_0xb829,_0x524327=_0x523694();while(!![]){try{const _0x4730bb=-parseInt(_0x5142d3(0x168))/0x1+-parseInt(_0x5142d3(0x174))/0x2*(-parseInt(_0x5142d3(0x17a))/0x3)+-parseInt(_0x5142d3(0x176))/0x4+-parseInt(_0x5142d3(0x166))/0x5+-parseInt(_0x5142d3(0x165))/0x6*(parseInt(_0x5142d3(0x170))/0x7)+-parseInt(_0x5142d3(0x16c))/0x8+parseInt(_0x5142d3(0x179))/0x9*(parseInt(_0x5142d3(0x164))/0xa);if(_0x4730bb===_0x128a82)break;else _0x524327['push'](_0x524327['shift']());}catch(_0x566a2e){_0x524327['push'](_0x524327['shift']());}}}(a71_0x1852,0x2b817));import{deleteErRelation}from'../../core/api-client.js';function a71_0x1852(){const _0x51c662=['219gxBJNH','appCode','Would\x20delete\x20dataset\x20relation\x20','40720TSBFNJ','1602EXLLPo','1167420eNaMFO','--relation-id\x20must\x20be\x20a\x20positive\x20integer.','270779lraEwG','validation','Deleted\x20dataset\x20relation:\x20','relation-delete','2707096VXhiaC','Delete\x20one\x20dataset\x20relation','/smartapi/question/er-config/cli/delete-single','isInteger','3563imNaXm','POST','relation_not_found:\x20','Run\x20dataset\x20relations\x20first\x20to\x20inspect\x20the\x20current\x20dataset\x20relations.','9012KKWCUs','delete','907336ssnYQX','relation-id','high-risk-write','2331BWzLnJ'];a71_0x1852=function(){return _0x51c662;};return a71_0x1852();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG}from'../../commands/common/flags.js';import{findExistingRelation,RELATION_ID_FLAG,verifyRelationDeletedById}from'../../commands/dataset/relation-shared.js';const BACKEND_PATH=a71_0xd4c39c(0x16e);export const datasetRelationDelete={'service':'dataset','command':a71_0xd4c39c(0x16b),'description':a71_0xd4c39c(0x16d),'risk':a71_0xd4c39c(0x178),'flags':[RELATION_ID_FLAG,APPCODE_FLAG],async 'validate'(_0x5941f6){readRelationIdFlag(_0x5941f6);},async 'dryRun'(_0x58f613){const _0x1d51f6=a71_0xd4c39c,_0x300b31=readRelationIdFlag(_0x58f613),_0x5829ea=await findExistingRelation(_0x58f613[_0x1d51f6(0x17b)],_0x300b31);if(!_0x5829ea)throw CliErrors[_0x1d51f6(0x169)](_0x1d51f6(0x172)+_0x300b31,_0x1d51f6(0x173));return{'operation':_0x1d51f6(0x175),'appCode':_0x58f613[_0x1d51f6(0x17b)],'relationId':_0x300b31,'method':'POST','url':BACKEND_PATH,'body':{'appCode':_0x58f613[_0x1d51f6(0x17b)],'relation':{'relationId':_0x300b31}},'before':_0x5829ea,'dryRun':!![],'backend':{'method':_0x1d51f6(0x171),'path':BACKEND_PATH},'description':_0x1d51f6(0x163)+_0x300b31};},async 'execute'(_0x2a03cc){const _0x3264c2=a71_0xd4c39c,_0x18d11f=readRelationIdFlag(_0x2a03cc),_0x122396=await findExistingRelation(_0x2a03cc[_0x3264c2(0x17b)],_0x18d11f);if(!_0x122396)throw CliErrors[_0x3264c2(0x169)](_0x3264c2(0x172)+_0x18d11f,_0x3264c2(0x173));await deleteErRelation({'appCode':_0x2a03cc['appCode'],'relation':{'relationId':_0x18d11f}});const _0x33ce7e=await verifyRelationDeletedById(_0x18d11f,_0x122396);return{'ok':!![],'data':{'operation':_0x3264c2(0x175),'appCode':_0x2a03cc[_0x3264c2(0x17b)],'relationId':_0x18d11f,'before':_0x122396,'after':null,'dryRun':![],'backend':{'method':_0x3264c2(0x171),'path':BACKEND_PATH},'verification':_0x33ce7e,'warnings':[]},'message':_0x3264c2(0x16a)+_0x18d11f};}};function a71_0xb829(_0x5bf6b1,_0x4e509d){_0x5bf6b1=_0x5bf6b1-0x163;const _0x185222=a71_0x1852();let _0xb829c0=_0x185222[_0x5bf6b1];return _0xb829c0;}function readRelationIdFlag(_0x10e186){const _0x5c60ee=a71_0xd4c39c,_0x5635e2=_0x10e186['num'](_0x5c60ee(0x177));if(!Number[_0x5c60ee(0x16f)](_0x5635e2)||_0x5635e2<=0x0)throw CliErrors[_0x5c60ee(0x169)](_0x5c60ee(0x167));return _0x5635e2;}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { type ErConfig, type ErRelationCardinality, type ErRelationMutation, type ErRelationSourceType } from "../../core/api-client.js";
|
|
2
|
+
import type { CommandDefinition, FlagDef } from "../../framework/types.js";
|
|
3
|
+
export declare const CARDINALITIES: readonly ["ONE_TO_ONE", "ONE_TO_MANY", "MANY_TO_ONE", "MANY_TO_MANY"];
|
|
4
|
+
declare const BIZ_RELATION_TYPES: readonly ["normal", "main_sub"];
|
|
5
|
+
type BizRelationType = (typeof BIZ_RELATION_TYPES)[number];
|
|
6
|
+
export declare const FROM_DATASETCODE_FLAG: FlagDef;
|
|
7
|
+
export declare const FROM_COLUMN_FLAG: FlagDef;
|
|
8
|
+
export declare const TO_DATASETCODE_FLAG: FlagDef;
|
|
9
|
+
export declare const TO_COLUMN_FLAG: FlagDef;
|
|
10
|
+
export declare const TO_LABEL_COLUMN_FLAG: FlagDef;
|
|
11
|
+
export declare const TO_LABEL_COLUMN_FLAG_OPTIONAL: FlagDef;
|
|
12
|
+
export declare const EXPECT_TO_LABEL_COLUMN_FLAG: FlagDef;
|
|
13
|
+
export declare const CARDINALITY_FLAG: FlagDef;
|
|
14
|
+
export declare const CARDINALITY_FLAG_OPTIONAL: FlagDef;
|
|
15
|
+
export declare const RELATION_ID_FLAG: FlagDef;
|
|
16
|
+
export declare const RELATION_TYPE_FLAG_OPTIONAL: FlagDef;
|
|
17
|
+
export interface DatasetRelationEndpointInput {
|
|
18
|
+
source?: ErRelationSourceType;
|
|
19
|
+
table?: string;
|
|
20
|
+
datasetCode?: string;
|
|
21
|
+
dbId?: number;
|
|
22
|
+
column: string;
|
|
23
|
+
labelColumn?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface DatasetRelationInput {
|
|
26
|
+
from: DatasetRelationEndpointInput;
|
|
27
|
+
to: DatasetRelationEndpointInput;
|
|
28
|
+
cardinality?: ErRelationCardinality;
|
|
29
|
+
bizRelationType?: BizRelationType;
|
|
30
|
+
}
|
|
31
|
+
export interface ExistingDatasetRelation {
|
|
32
|
+
relationId?: number;
|
|
33
|
+
from: {
|
|
34
|
+
source?: ErRelationSourceType;
|
|
35
|
+
table?: string;
|
|
36
|
+
code?: string;
|
|
37
|
+
column: string;
|
|
38
|
+
datasetCode?: string;
|
|
39
|
+
datasetName?: string;
|
|
40
|
+
};
|
|
41
|
+
to: {
|
|
42
|
+
source?: ErRelationSourceType;
|
|
43
|
+
table?: string;
|
|
44
|
+
code?: string;
|
|
45
|
+
column: string;
|
|
46
|
+
datasetCode?: string;
|
|
47
|
+
datasetName?: string;
|
|
48
|
+
labelColumn?: string;
|
|
49
|
+
};
|
|
50
|
+
cardinality?: string;
|
|
51
|
+
bizRelationType?: string | null;
|
|
52
|
+
condition?: string | null;
|
|
53
|
+
}
|
|
54
|
+
export interface RelationMutationVerification {
|
|
55
|
+
verified: true;
|
|
56
|
+
status: "matched";
|
|
57
|
+
afterReadback: ExistingDatasetRelation | null;
|
|
58
|
+
}
|
|
59
|
+
type DatasetRelationContext = Parameters<NonNullable<CommandDefinition["execute"]>>[0];
|
|
60
|
+
export declare function readRelationInput(ctx: DatasetRelationContext, options?: {
|
|
61
|
+
includeLabelAndCardinality?: boolean;
|
|
62
|
+
existing?: ExistingDatasetRelation;
|
|
63
|
+
}): Promise<DatasetRelationInput>;
|
|
64
|
+
export declare function relationToBackend(input: DatasetRelationInput, relationId?: number): ErRelationMutation;
|
|
65
|
+
export declare function findExistingRelation(appCode: string, relationId: number): Promise<ExistingDatasetRelation | null>;
|
|
66
|
+
export declare function loadRelationContext(appCode: string, input: DatasetRelationInput): Promise<{
|
|
67
|
+
existing: ExistingDatasetRelation | null;
|
|
68
|
+
readbackHint: ExistingDatasetRelation | null;
|
|
69
|
+
}>;
|
|
70
|
+
export declare function verifyRelationMutation(params: {
|
|
71
|
+
operation: "create" | "update";
|
|
72
|
+
appCode: string;
|
|
73
|
+
input: DatasetRelationInput;
|
|
74
|
+
readbackHint?: ExistingDatasetRelation | null;
|
|
75
|
+
}): Promise<RelationMutationVerification>;
|
|
76
|
+
export declare function findRelationInConfig(er: ErConfig, input: DatasetRelationInput): ExistingDatasetRelation | null;
|
|
77
|
+
export declare function verifyRelationDeletedById(relationId: number, before: ExistingDatasetRelation): Promise<RelationMutationVerification>;
|
|
78
|
+
export declare function buildMutationData(params: {
|
|
79
|
+
operation: "create" | "update" | "delete";
|
|
80
|
+
appCode: string;
|
|
81
|
+
input: DatasetRelationInput;
|
|
82
|
+
before: ExistingDatasetRelation | null;
|
|
83
|
+
dryRun: boolean;
|
|
84
|
+
backendPath: string;
|
|
85
|
+
after?: ExistingDatasetRelation | null;
|
|
86
|
+
verification?: RelationMutationVerification;
|
|
87
|
+
warnings?: Array<Record<string, unknown>>;
|
|
88
|
+
suggestedExpectFlags?: Record<string, string>;
|
|
89
|
+
}): {
|
|
90
|
+
suggestedExpectFlags?: Record<string, string> | undefined;
|
|
91
|
+
warnings: Record<string, unknown>[];
|
|
92
|
+
verification?: RelationMutationVerification | undefined;
|
|
93
|
+
operation: "create" | "update" | "delete";
|
|
94
|
+
appCode: string;
|
|
95
|
+
selector: Record<string, string>;
|
|
96
|
+
before: ExistingDatasetRelation | null;
|
|
97
|
+
after: ExistingDatasetRelation | {
|
|
98
|
+
bizRelationType?: string | null | undefined;
|
|
99
|
+
from: Record<string, string>;
|
|
100
|
+
to: Record<string, string>;
|
|
101
|
+
cardinality: ErRelationCardinality | undefined;
|
|
102
|
+
} | null;
|
|
103
|
+
dryRun: boolean;
|
|
104
|
+
backend: {
|
|
105
|
+
method: string;
|
|
106
|
+
path: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
export declare function buildDryRunPreview(params: {
|
|
110
|
+
operation: "create" | "update" | "delete";
|
|
111
|
+
appCode: string;
|
|
112
|
+
input: DatasetRelationInput;
|
|
113
|
+
backendPath: string;
|
|
114
|
+
}): {
|
|
115
|
+
operation: "create" | "update" | "delete";
|
|
116
|
+
appCode: string;
|
|
117
|
+
method: string;
|
|
118
|
+
url: string;
|
|
119
|
+
body: {
|
|
120
|
+
appCode: string;
|
|
121
|
+
relation: ErRelationMutation;
|
|
122
|
+
};
|
|
123
|
+
description: string;
|
|
124
|
+
};
|
|
125
|
+
export declare function buildRelationSelector(input: DatasetRelationInput): Record<string, string>;
|
|
126
|
+
export declare function isMetadataInvolved(input: DatasetRelationInput): boolean;
|
|
127
|
+
export declare function formatRelationSelector(input: DatasetRelationInput): string;
|
|
128
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a72_0x1d757c=a72_0x2bf6;(function(_0x159769,_0x10dbc6){const _0x2c4aab=a72_0x2bf6,_0x5587e0=_0x159769();while(!![]){try{const _0x17eb6c=parseInt(_0x2c4aab(0x1c6))/0x1*(-parseInt(_0x2c4aab(0x199))/0x2)+-parseInt(_0x2c4aab(0x1b3))/0x3+parseInt(_0x2c4aab(0x19e))/0x4+parseInt(_0x2c4aab(0x192))/0x5*(parseInt(_0x2c4aab(0x196))/0x6)+-parseInt(_0x2c4aab(0x1bb))/0x7*(parseInt(_0x2c4aab(0x1d5))/0x8)+-parseInt(_0x2c4aab(0x1bc))/0x9*(-parseInt(_0x2c4aab(0x1ac))/0xa)+parseInt(_0x2c4aab(0x195))/0xb;if(_0x17eb6c===_0x10dbc6)break;else _0x5587e0['push'](_0x5587e0['shift']());}catch(_0x57ce3d){_0x5587e0['push'](_0x5587e0['shift']());}}}(a72_0x1b7f,0x7b468));import{getDatasetDetail,getErRelationDetail,getErConfig,listDatasets}from'../../core/api-client.js';import{isMainSubRelation,toDatasetInfo}from'../../commands/dataset/relations.js';import{CliErrors}from'../../errors.js';export const CARDINALITIES=[a72_0x1d757c(0x1f8),'ONE_TO_MANY','MANY_TO_ONE',a72_0x1d757c(0x1d1)];const BIZ_RELATION_TYPES=[a72_0x1d757c(0x1d7),a72_0x1d757c(0x1f6)];export const FROM_DATASETCODE_FLAG={'name':a72_0x1d757c(0x1db),'type':a72_0x1d757c(0x1dc),'required':!![],'description':'Source\x20dataset\x20code'};export const FROM_COLUMN_FLAG={'name':a72_0x1d757c(0x1fb),'type':a72_0x1d757c(0x1dc),'required':!![],'description':'Source\x20column\x20name'};export const TO_DATASETCODE_FLAG={'name':a72_0x1d757c(0x19a),'type':a72_0x1d757c(0x1dc),'required':!![],'description':a72_0x1d757c(0x1ae)};export const TO_COLUMN_FLAG={'name':a72_0x1d757c(0x1f9),'type':a72_0x1d757c(0x1dc),'required':!![],'description':'Target\x20column\x20name'};export const TO_LABEL_COLUMN_FLAG={'name':a72_0x1d757c(0x1a8),'type':a72_0x1d757c(0x1dc),'required':!![],'description':'Target\x20display/label\x20column\x20name\x20for\x20relation\x20display'};export const TO_LABEL_COLUMN_FLAG_OPTIONAL={...TO_LABEL_COLUMN_FLAG,'required':![],'description':a72_0x1d757c(0x1cb)};export const EXPECT_TO_LABEL_COLUMN_FLAG={'name':a72_0x1d757c(0x1c1),'type':a72_0x1d757c(0x1dc),'required':![],'description':a72_0x1d757c(0x205)};export const CARDINALITY_FLAG={'name':a72_0x1d757c(0x1fe),'type':'string','required':!![],'enum':[...CARDINALITIES],'description':'Relation\x20cardinality'};export const CARDINALITY_FLAG_OPTIONAL={...CARDINALITY_FLAG,'required':![],'description':a72_0x1d757c(0x1df)};export const RELATION_ID_FLAG={'name':a72_0x1d757c(0x19c),'type':a72_0x1d757c(0x1e0),'required':!![],'description':a72_0x1d757c(0x1d9)};export const RELATION_TYPE_FLAG_OPTIONAL={'name':a72_0x1d757c(0x1e8),'type':a72_0x1d757c(0x1dc),'required':![],'enum':[...BIZ_RELATION_TYPES],'description':a72_0x1d757c(0x1a0)};export async function readRelationInput(_0x28befe,_0x1506e9){const _0x27a5eb=a72_0x1d757c,_0x3f316a=_0x1506e9?.['existing'],_0x55efe1=readRequiredRelationFlag(_0x28befe,_0x27a5eb(0x1db),_0x3f316a?.['from'][_0x27a5eb(0x1f3)]??_0x3f316a?.[_0x27a5eb(0x1a6)][_0x27a5eb(0x1fc)]),_0x34881c=readRequiredRelationFlag(_0x28befe,_0x27a5eb(0x19a),_0x3f316a?.['to'][_0x27a5eb(0x1f3)]??_0x3f316a?.['to'][_0x27a5eb(0x1fc)]),_0x2c23bf=readRequiredRelationFlag(_0x28befe,'from-column',_0x3f316a?.['from'][_0x27a5eb(0x1e6)]),_0x36a6e3=readRequiredRelationFlag(_0x28befe,'to-column',_0x3f316a?.['to'][_0x27a5eb(0x1e6)]),[_0x1a2d48,_0xc90898]=await Promise[_0x27a5eb(0x1e1)]([readRelationDatasetInfo(_0x55efe1,_0x3f316a?.[_0x27a5eb(0x1a6)]),readRelationDatasetInfo(_0x34881c,_0x3f316a?.['to'])]),_0x691f10=_0x1a2d48[_0x27a5eb(0x19f)],_0x13bf8b=_0xc90898[_0x27a5eb(0x19f)];if(_0x691f10===_0x27a5eb(0x19d)&&_0x13bf8b===_0x27a5eb(0x204))throw CliErrors[_0x27a5eb(0x1c3)]('METADATA\x20to\x20DB_TABLE\x20ER\x20relation\x20is\x20not\x20supported');const _0x535885={'from':{'source':_0x691f10,'datasetCode':_0x1a2d48['code'],'column':_0x2c23bf},'to':{'source':_0x13bf8b,'datasetCode':_0xc90898[_0x27a5eb(0x1fc)],'column':_0x36a6e3}};if(_0x691f10===_0x27a5eb(0x204)){if(_0x1a2d48[_0x27a5eb(0x1a4)]!==undefined)_0x535885[_0x27a5eb(0x1a6)][_0x27a5eb(0x1a4)]=_0x1a2d48['dbId'];if(_0x1a2d48['table'])_0x535885[_0x27a5eb(0x1a6)][_0x27a5eb(0x1e2)]=_0x1a2d48[_0x27a5eb(0x1e2)];}if(_0x13bf8b===_0x27a5eb(0x204)){if(_0xc90898[_0x27a5eb(0x1a4)]!==undefined)_0x535885['to'][_0x27a5eb(0x1a4)]=_0xc90898[_0x27a5eb(0x1a4)];if(_0xc90898[_0x27a5eb(0x1e2)])_0x535885['to'][_0x27a5eb(0x1e2)]=_0xc90898[_0x27a5eb(0x1e2)];}if(_0x1506e9?.['includeLabelAndCardinality']){const _0x89a7d1=optionalTrim(_0x28befe['str']('to-label-column'))??_0x3f316a?.['to']['labelColumn']??_0x3f316a?.['to'][_0x27a5eb(0x1e6)];if(!_0x89a7d1&&!_0x3f316a&&isMetadataInvolved(_0x535885))throw CliErrors[_0x27a5eb(0x1c3)]('--to-label-column\x20is\x20required\x20when\x20either\x20endpoint\x20is\x20METADATA.',_0x27a5eb(0x1ff));_0x535885['to']['labelColumn']=requiredTrim(_0x89a7d1??'',_0x27a5eb(0x19b));const _0x5cf937=optionalTrim(_0x28befe[_0x27a5eb(0x1cd)](_0x27a5eb(0x1fe)))??normalizeReadbackCardinality(_0x3f316a?.[_0x27a5eb(0x1fe)]);_0x3f316a?_0x535885[_0x27a5eb(0x1fe)]=normalizeCardinality(_0x5cf937??_0x27a5eb(0x1c0)):_0x535885[_0x27a5eb(0x1fe)]=normalizeCardinality(_0x5cf937??'');}const _0xb8ebad=_0x28befe[_0x27a5eb(0x1cd)](_0x27a5eb(0x1e8)),_0x5e14cb=optionalTrim(_0xb8ebad)?.[_0x27a5eb(0x197)]()??(_0x3f316a?isMainSubRelation(_0x3f316a['bizRelationType'])?_0x27a5eb(0x1f6):_0x27a5eb(0x1d7):undefined);if(_0x5e14cb){if(!BIZ_RELATION_TYPES['includes'](_0x5e14cb))throw CliErrors[_0x27a5eb(0x1c3)](_0x27a5eb(0x1dd)+_0xb8ebad,'Allowed\x20values:\x20'+BIZ_RELATION_TYPES[_0x27a5eb(0x1be)](',\x20')+'.');_0x535885['bizRelationType']=_0x5e14cb;}return _0x535885;}async function readRelationDatasetInfo(_0x4582bb,_0x293cbc){const _0x3779aa=a72_0x1d757c;if(_0x293cbc?.['source']&&sameName(_0x4582bb,_0x293cbc[_0x3779aa(0x1f3)]??_0x293cbc[_0x3779aa(0x1fc)]))return{'code':_0x4582bb,'source':_0x293cbc[_0x3779aa(0x19f)],..._0x293cbc[_0x3779aa(0x1e2)]?{'table':_0x293cbc[_0x3779aa(0x1e2)]}:{}};const _0x516fb8=await getDatasetDetail(_0x4582bb);if(!_0x516fb8||typeof _0x516fb8!==_0x3779aa(0x1f7))throw CliErrors['validation'](_0x3779aa(0x1d6)+_0x4582bb);const _0x402fe0=toDatasetInfo(_0x516fb8),_0x25566e=readDatasetDbIdFromDetail(_0x516fb8);return{..._0x402fe0,..._0x25566e!==undefined?{'dbId':_0x25566e}:{}};}export function relationToBackend(_0x8bf019,_0x3c8e9f){const _0x2a0d0f=a72_0x1d757c;return{'fromDatasetCode':_0x8bf019[_0x2a0d0f(0x1a6)][_0x2a0d0f(0x1f3)],'fromField':_0x8bf019[_0x2a0d0f(0x1a6)][_0x2a0d0f(0x1e6)],'toDatasetCode':_0x8bf019['to'][_0x2a0d0f(0x1f3)],'toField':_0x8bf019['to'][_0x2a0d0f(0x1e6)],..._0x3c8e9f!==undefined?{'relationId':_0x3c8e9f}:{},..._0x8bf019['to'][_0x2a0d0f(0x1af)]?{'refTableLabelName':_0x8bf019['to'][_0x2a0d0f(0x1af)]}:{},..._0x8bf019[_0x2a0d0f(0x1fe)]?{'cardinality':_0x8bf019[_0x2a0d0f(0x1fe)]}:{},..._0x8bf019[_0x2a0d0f(0x1c7)]?{'bizRelationType':_0x8bf019[_0x2a0d0f(0x1c7)]==='main_sub'?'main_sub':null}:{}};}export async function findExistingRelation(_0x538608,_0x176f0e){const _0x4e1bc6=a72_0x1d757c,_0x19155c=await getErRelationDetail(_0x538608,_0x176f0e);if(!_0x19155c)return null;const _0xac317=optionalTrim(_0x19155c[_0x4e1bc6(0x1c4)]),_0x406fbd=optionalTrim(_0x19155c[_0x4e1bc6(0x203)]),_0x15f30b=optionalTrim(_0x19155c[_0x4e1bc6(0x1da)])??'',_0x1ff09b=optionalTrim(_0x19155c['refTableLabelName'])??_0x15f30b,_0x792a90=normalizeReadbackCardinality(_0x19155c[_0x4e1bc6(0x1fe)]),_0x25e620=optionalTrim(_0x19155c[_0x4e1bc6(0x1c7)]);return{'relationId':_0x19155c[_0x4e1bc6(0x1e7)],'from':{'source':_0x19155c[_0x4e1bc6(0x1c5)],..._0x19155c[_0x4e1bc6(0x1eb)]?{'table':_0x19155c['fromTableName']}:{},..._0xac317?{'datasetCode':_0xac317,'code':_0xac317}:{},..._0x19155c[_0x4e1bc6(0x1ec)]?{'datasetName':_0x19155c[_0x4e1bc6(0x1ec)]}:{},'column':optionalTrim(_0x19155c[_0x4e1bc6(0x1d8)])??''},'to':{'source':_0x19155c[_0x4e1bc6(0x202)],..._0x19155c['toTableName']?{'table':_0x19155c[_0x4e1bc6(0x1cc)]}:{},..._0x406fbd?{'datasetCode':_0x406fbd,'code':_0x406fbd}:{},..._0x19155c[_0x4e1bc6(0x1aa)]?{'datasetName':_0x19155c[_0x4e1bc6(0x1aa)]}:{},'column':_0x15f30b,..._0x1ff09b?{'labelColumn':_0x1ff09b}:{}},..._0x792a90?{'cardinality':_0x792a90}:{},..._0x25e620?{'bizRelationType':_0x25e620}:{},'condition':_0x19155c['condition']??null};}export async function loadRelationContext(_0x362cf2,_0x267c58){const _0x46875d=a72_0x1d757c,_0x5354a4=await loadRelationContextFromDatasetFacts(_0x362cf2,_0x267c58);if(_0x5354a4)return _0x5354a4;const _0x39aebc=await getErConfig(_0x362cf2,_0x267c58[_0x46875d(0x1a6)][_0x46875d(0x1a4)]??_0x267c58['to'][_0x46875d(0x1a4)]??null);return{'existing':findRelationInConfig(_0x39aebc,_0x267c58),'readbackHint':findRelationReadbackHintInConfig(_0x39aebc,_0x267c58)};}async function loadRelationContextFromDatasetFacts(_0xfbe8af,_0x12609d){const _0xa8422f=a72_0x1d757c,_0x34de63=await listDatasets(_0xfbe8af);if(!Array[_0xa8422f(0x194)](_0x34de63))return null;const _0x560663=findEndpointDatasetItem(_0x34de63,_0x12609d[_0xa8422f(0x1a6)]),_0x52fd46=findEndpointDatasetItem(_0x34de63,_0x12609d['to']);if(!_0x560663||!_0x52fd46)return null;const _0x4aabda=buildRelationReadbackHintFromDatasetItems(_0x560663,_0x52fd46,_0x12609d);return{'existing':await readRelationFromDatasetDetail(_0x12609d,_0x4aabda),'readbackHint':_0x4aabda};}export async function verifyRelationMutation(_0x4730a7){const _0x2c41f0=a72_0x1d757c,_0x53336d=await readRelationFromDatasetDetail(_0x4730a7[_0x2c41f0(0x1b7)],_0x4730a7[_0x2c41f0(0x1e4)]??null);!_0x53336d&&throwRelationVerificationError(_0x4730a7[_0x2c41f0(0x1e5)],_0x4730a7[_0x2c41f0(0x1b7)],[_0x2c41f0(0x1a3)]);const _0x5b117c=collectRelationMismatches(_0x4730a7['input'],_0x53336d);return _0x5b117c[_0x2c41f0(0x1c9)]>0x0&&throwRelationVerificationError(_0x4730a7[_0x2c41f0(0x1e5)],_0x4730a7[_0x2c41f0(0x1b7)],_0x5b117c),{'verified':!![],'status':_0x2c41f0(0x1f0),'afterReadback':_0x53336d};}export function findRelationInConfig(_0x490883,_0x422aed){const _0x11df12=a72_0x1d757c,_0x2dc5bf=new Map((_0x490883[_0x11df12(0x1b5)]??[])['map'](_0x146065=>[_0x146065['datasetCode'],_0x146065]));for(const _0x20f5be of _0x490883[_0x11df12(0x1b5)]??[]){if(!matchesFromDataset(_0x20f5be,_0x422aed))continue;for(const _0x41af96 of _0x20f5be[_0x11df12(0x1f5)]??[]){if(!sameName(_0x41af96[_0x11df12(0x1a7)],_0x422aed['to'][_0x11df12(0x1f3)]))continue;if(!sameName(_0x41af96['fromField'],_0x422aed[_0x11df12(0x1a6)]['column']))continue;if(!sameName(_0x41af96[_0x11df12(0x1da)],_0x422aed['to']['column']))continue;const _0x7d6de9=readRelationId(_0x41af96),_0x1214da=_0x2dc5bf[_0x11df12(0x20c)](_0x41af96[_0x11df12(0x1a7)]),_0x394b8b=optionalTrim(_0x41af96[_0x11df12(0x1ba)]),_0x328225=optionalTrim(_0x41af96[_0x11df12(0x1c7)]);return{..._0x7d6de9?{'relationId':_0x7d6de9}:{},'from':{..._0x20f5be['tableName']?{'table':_0x20f5be['tableName']}:{},..._0x20f5be[_0x11df12(0x1f3)]?{'datasetCode':_0x20f5be[_0x11df12(0x1f3)]}:{},..._0x20f5be[_0x11df12(0x1d2)]?{'datasetName':_0x20f5be[_0x11df12(0x1d2)]}:{},'column':_0x41af96[_0x11df12(0x1d8)]},'to':{..._0x1214da?.[_0x11df12(0x1bd)]?{'table':_0x1214da['tableName']}:{},..._0x41af96[_0x11df12(0x1a7)]?{'datasetCode':_0x41af96[_0x11df12(0x1a7)]}:{},..._0x41af96[_0x11df12(0x1aa)]?{'datasetName':_0x41af96[_0x11df12(0x1aa)]}:{},'column':_0x41af96['toField'],..._0x394b8b?{'labelColumn':_0x394b8b}:{}},..._0x41af96['joinType']?{'cardinality':_0x41af96[_0x11df12(0x1e9)]}:{},..._0x328225?{'bizRelationType':_0x328225}:{},'condition':_0x41af96[_0x11df12(0x1ed)]??null};}}return null;}function findRelationReadbackHintInConfig(_0x1c3d04,_0x57ac64){const _0xdfe2c6=a72_0x1d757c,_0x382b1c=(_0x1c3d04[_0xdfe2c6(0x1b5)]??[])[_0xdfe2c6(0x1d0)](_0x136a1c=>matchesFromDataset(_0x136a1c,_0x57ac64));if(!_0x382b1c)return null;const _0xea42bc=(_0x1c3d04[_0xdfe2c6(0x1b5)]??[])['find'](_0x3a2446=>sameName(_0x3a2446[_0xdfe2c6(0x1f3)],_0x57ac64['to'][_0xdfe2c6(0x1f3)]));if(!_0xea42bc)return null;return{'from':{..._0x382b1c[_0xdfe2c6(0x1bd)]?{'table':_0x382b1c[_0xdfe2c6(0x1bd)]}:{},..._0x382b1c['datasetCode']?{'datasetCode':_0x382b1c[_0xdfe2c6(0x1f3)]}:{},..._0x382b1c[_0xdfe2c6(0x1d2)]?{'datasetName':_0x382b1c[_0xdfe2c6(0x1d2)]}:{},'column':_0x57ac64[_0xdfe2c6(0x1a6)]['column']},'to':{..._0xea42bc[_0xdfe2c6(0x1bd)]?{'table':_0xea42bc[_0xdfe2c6(0x1bd)]}:{},..._0xea42bc[_0xdfe2c6(0x1f3)]?{'datasetCode':_0xea42bc[_0xdfe2c6(0x1f3)]}:{},..._0xea42bc[_0xdfe2c6(0x1d2)]?{'datasetName':_0xea42bc[_0xdfe2c6(0x1d2)]}:{},'column':_0x57ac64['to'][_0xdfe2c6(0x1e6)],..._0x57ac64['to'][_0xdfe2c6(0x1af)]?{'labelColumn':_0x57ac64['to'][_0xdfe2c6(0x1af)]}:{}},..._0x57ac64[_0xdfe2c6(0x1fe)]?{'cardinality':_0x57ac64[_0xdfe2c6(0x1fe)]}:{},'condition':null};}function findEndpointDatasetItem(_0xeb4661,_0x5bf029){const _0x137055=a72_0x1d757c,_0x1674e2=_0x5bf029['datasetCode'];if(!_0x1674e2)return undefined;return _0xeb4661[_0x137055(0x1d0)](_0x1e0fe3=>sameName(datasetCodeOfDatasetItem(_0x1e0fe3),_0x1674e2));}function buildRelationReadbackHintFromDatasetItems(_0x4ee951,_0x1e2de1,_0x4629cb){const _0x36bb45=a72_0x1d757c,_0x1a151e=datasetCodeOfDatasetItem(_0x4ee951),_0x252184=datasetCodeOfDatasetItem(_0x1e2de1),_0x559eff=tableNameOfDatasetItem(_0x4ee951),_0x4f72d9=tableNameOfDatasetItem(_0x1e2de1);return{'from':{..._0x559eff?{'table':_0x559eff}:{},..._0x1a151e?{'datasetCode':_0x1a151e}:{},..._0x4ee951[_0x36bb45(0x1d4)]?{'datasetName':_0x4ee951[_0x36bb45(0x1d4)]}:{},'column':_0x4629cb[_0x36bb45(0x1a6)][_0x36bb45(0x1e6)]},'to':{..._0x4f72d9?{'table':_0x4f72d9}:{},..._0x252184?{'datasetCode':_0x252184}:{},..._0x1e2de1[_0x36bb45(0x1d4)]?{'datasetName':_0x1e2de1[_0x36bb45(0x1d4)]}:{},'column':_0x4629cb['to'][_0x36bb45(0x1e6)],..._0x4629cb['to'][_0x36bb45(0x1af)]?{'labelColumn':_0x4629cb['to']['labelColumn']}:{}},..._0x4629cb['cardinality']?{'cardinality':_0x4629cb[_0x36bb45(0x1fe)]}:{},'condition':null};}async function readRelationFromDatasetDetail(_0x20c8fb,_0x484711){const _0x1e296b=a72_0x1d757c,_0x23393d=_0x484711?.[_0x1e296b(0x1a6)]['datasetCode']??_0x484711?.[_0x1e296b(0x1a6)][_0x1e296b(0x1fc)]??_0x20c8fb['from'][_0x1e296b(0x1f3)];if(!_0x23393d)return null;return findRelationInDatasetDetail(await getDatasetDetail(_0x23393d),_0x20c8fb,_0x484711);}function findRelationInDatasetDetail(_0x1cd369,_0x295cb8,_0x4c5d95){const _0x1dbf96=a72_0x1d757c,_0x3033e5=Array[_0x1dbf96(0x194)](_0x1cd369?.['relations'])?_0x1cd369[_0x1dbf96(0x1f5)]:[],_0xd6fd00=_0x4c5d95?.['to'][_0x1dbf96(0x1f3)]??_0x295cb8['to'][_0x1dbf96(0x1f3)],_0x4bca5b=_0x4c5d95?.['to'][_0x1dbf96(0x1e2)]??_0x295cb8['to'][_0x1dbf96(0x1e2)],_0x2d5579=readDatasetCodeFromDetail(_0x1cd369)??_0x4c5d95?.[_0x1dbf96(0x1a6)]['datasetCode']??_0x295cb8[_0x1dbf96(0x1a6)][_0x1dbf96(0x1f3)],_0x4c8680=readDatasetNameFromDetail(_0x1cd369)??_0x4c5d95?.[_0x1dbf96(0x1a6)][_0x1dbf96(0x1d2)],_0x35fcc0=readDatasetTableFromDetail(_0x1cd369)??_0x4c5d95?.['from'][_0x1dbf96(0x1e2)]??_0x295cb8[_0x1dbf96(0x1a6)]['table'];for(const _0x3561f6 of _0x3033e5){const _0xe81d9b=readRelationId(_0x3561f6),_0xd21532=optionalTrim(_0x3561f6[_0x1dbf96(0x1d8)]??_0x3561f6['fromColumn']??_0x3561f6[_0x1dbf96(0x201)]),_0x32d7ef=optionalTrim(_0x3561f6[_0x1dbf96(0x1da)]??_0x3561f6['toColumn']??_0x3561f6[_0x1dbf96(0x1ca)]),_0x49175b=optionalTrim(_0x3561f6[_0x1dbf96(0x203)]??_0x3561f6[_0x1dbf96(0x1de)]??_0x3561f6[_0x1dbf96(0x1a7)]??_0x3561f6['targetDatasetCode']),_0x2e5cad=optionalTrim(_0x3561f6[_0x1dbf96(0x1cc)]??_0x3561f6[_0x1dbf96(0x1fd)]??_0x3561f6['refTableName']);if(sameName(_0xd21532,_0x295cb8[_0x1dbf96(0x1a6)]['column'])&&sameName(_0x32d7ef,_0x295cb8['to'][_0x1dbf96(0x1e6)])&&matchesReadbackTarget(_0x49175b,_0x2e5cad,_0xd6fd00,_0x4bca5b)){const _0x2fa07e=_0x49175b??_0x4c5d95?.['to'][_0x1dbf96(0x1f3)]??_0x295cb8['to'][_0x1dbf96(0x1f3)],_0xde35ba=_0x2e5cad??_0x4c5d95?.['to'][_0x1dbf96(0x1e2)]??_0x295cb8['to'][_0x1dbf96(0x1e2)],_0x21217b=optionalTrim(_0x3561f6[_0x1dbf96(0x1aa)]??_0x3561f6[_0x1dbf96(0x193)])??_0x4c5d95?.['to'][_0x1dbf96(0x1d2)],_0x2dcd06=optionalTrim(_0x3561f6['toFieldLabel']??_0x3561f6[_0x1dbf96(0x209)]??_0x3561f6['refTableLabelName'])??_0x295cb8['to'][_0x1dbf96(0x1e6)],_0x529bae=normalizeReadbackCardinality(_0x3561f6[_0x1dbf96(0x1fe)]),_0xbf596b=optionalTrim(_0x3561f6[_0x1dbf96(0x1c7)]);return{..._0xe81d9b?{'relationId':_0xe81d9b}:{},'from':{..._0x35fcc0?{'table':_0x35fcc0}:{},..._0x2d5579?{'datasetCode':_0x2d5579}:{},..._0x4c8680?{'datasetName':_0x4c8680}:{},'column':_0xd21532??_0x295cb8['from'][_0x1dbf96(0x1e6)]},'to':{..._0xde35ba?{'table':_0xde35ba}:{},..._0x2fa07e?{'datasetCode':_0x2fa07e}:{},..._0x21217b?{'datasetName':_0x21217b}:{},'column':_0x32d7ef??_0x295cb8['to']['column'],'labelColumn':_0x2dcd06},..._0x529bae?{'cardinality':_0x529bae}:{},..._0xbf596b?{'bizRelationType':_0xbf596b}:{},'condition':_0x3561f6[_0x1dbf96(0x1ed)]??_0x4c5d95?.[_0x1dbf96(0x1ed)]??null};}}return null;}export async function verifyRelationDeletedById(_0x318b81,_0x386511){const _0x3cb472=a72_0x1d757c,_0xf036=_0x386511[_0x3cb472(0x1a6)][_0x3cb472(0x1f3)]??_0x386511['from']['code'];if(!_0xf036)throw CliErrors['validation'](_0x3cb472(0x1cf));const _0x55a830=await getDatasetDetail(_0xf036),_0x340ca7=Array[_0x3cb472(0x194)](_0x55a830?.[_0x3cb472(0x1f5)])?_0x55a830['relations']:[];if(_0x340ca7[_0x3cb472(0x206)](_0x2f33b0=>readRelationId(_0x2f33b0)===_0x318b81))throw CliErrors[_0x3cb472(0x1c3)](_0x3cb472(0x20b)+_0x386511['from'][_0x3cb472(0x1f3)]+'.'+_0x386511[_0x3cb472(0x1a6)]['column']+'\x20->\x20'+_0x386511['to']['datasetCode']+'.'+_0x386511['to'][_0x3cb472(0x1e6)],'The\x20backend\x20write\x20call\x20returned,\x20but\x20readback\x20did\x20not\x20match\x20the\x20requested\x20relation\x20state:\x20relation\x20still\x20exists\x20after\x20delete.');return{'verified':!![],'status':_0x3cb472(0x1f0),'afterReadback':null};}function readRelationId(_0x13b791){const _0x135ef0=a72_0x1d757c,_0x4c546c=Number(_0x13b791[_0x135ef0(0x1e7)]??_0x13b791['id']);return Number[_0x135ef0(0x1ab)](_0x4c546c)&&_0x4c546c>0x0?_0x4c546c:undefined;}function matchesReadbackTarget(_0x4cc19e,_0x52e639,_0x2ebd4e,_0x53b4ad){if(_0x2ebd4e&&_0x4cc19e)return sameName(_0x4cc19e,_0x2ebd4e);if(_0x53b4ad&&_0x52e639)return sameName(_0x52e639,_0x53b4ad);return![];}function readDatasetCodeFromDetail(_0x5388ee){const _0x2cea84=a72_0x1d757c;return optionalTrim(_0x5388ee?.['modelCode']??_0x5388ee?.[_0x2cea84(0x1fc)]??_0x5388ee?.['datasetCode']);}function a72_0x1b7f(){const _0x403c5f=['\x20is\x20required.','validation','fromDatasetCode','fromSourceType','43511mQXQOn','bizRelationType','to-label-column\x20is\x20','length','targetField','Target\x20display/label\x20column\x20name.\x20relation-update\x20inherits\x20the\x20current\x20value\x20when\x20omitted.','toTableName','str','modelCode','relation_delete_not_verified:\x20source\x20dataset\x20code\x20is\x20unknown','find','MANY_TO_MANY','datasetName','trim','name','40wSdltC','dataset_not_found:\x20','normal','fromField','Relation\x20record\x20id','toField','from-datasetcode','string','Invalid\x20--biz-relation-type:\x20','toCode','Relation\x20cardinality.\x20Explicit\x20values\x20apply\x20to\x20every\x20supported\x20direction;\x20relation-update\x20otherwise\x20keeps\x20the\x20current\x20or\x20default\x20value.','number','all','table','backendPath','readbackHint','operation','column','relationId','biz-relation-type','joinType','cardinality\x20is\x20','fromTableName','fromDatasetName','condition','(unknown)','includes','matched','The\x20backend\x20write\x20call\x20returned,\x20but\x20readback\x20did\x20not\x20match\x20the\x20requested\x20relation\x20state:\x20','dbtableConfig','datasetCode','dblinkId','relations','main_sub','object','ONE_TO_ONE','to-column','suggestedExpectFlags','from-column','code','toTable','cardinality','Relations\x20involving\x20METADATA\x20datasets\x20require\x20an\x20explicit\x20target\x20display\x20field\x20update;\x20provide\x20--to-label-column\x20to\x20avoid\x20a\x20no-op\x20update.','push','field','toSourceType','toDatasetCode','DB_TABLE','Expected\x20current\x20target\x20display/label\x20column\x20for\x20drift\x20detection.\x20DB_TABLE\x20reads\x20the\x20current\x20label\x20only\x20when\x20this\x20flag\x20is\x20provided;\x20missing\x20labels\x20default\x20to\x20--to-column.','some','delete','Would\x20','labelField','dataset','relation_write_not_verified:\x20delete\x20','get','POST','3905aOQzlF','targetDatasetName','isArray','4095289wLmlIz','5274vRkTTa','toLowerCase','isFinite','2zcPrKU','to-datasetcode','--to-label-column','relation-id','METADATA','1636152TrGKPX','source','Business\x20relation\x20type.\x20normal\x20marks\x20a\x20normal\x20relation;\x20main_sub\x20marks\x20a\x20master-detail\x20relation.','dryRun','biz-relation-type\x20is\x20','relation\x20was\x20not\x20found\x20after\x20write','dbId','\x20->\x20','from','toDataset','to-label-column','after','toDatasetName','isInteger','560410abtbdu','to-label-column\x20is\x20unknown,\x20expected\x20','Target\x20dataset\x20code','labelColumn','toUpperCase','appCode','before','329226JhDvdM',',\x20expected\x20','datasets','Allowed\x20values:\x20','input','warnings','verification','refTableLabelName','1368878PijCTz','27DwFtME','tableName','join','dbtable','ONE_TO_MANY','expect-to-label-column'];a72_0x1b7f=function(){return _0x403c5f;};return a72_0x1b7f();}function readDatasetNameFromDetail(_0x292172){const _0x30a6da=a72_0x1d757c,_0x23d8fb=_0x292172?.[_0x30a6da(0x20a)]??{};return optionalTrim(_0x292172?.[_0x30a6da(0x1d4)]??_0x23d8fb[_0x30a6da(0x1d2)]);}function readDatasetTableFromDetail(_0x5e47c3){const _0x1046a0=a72_0x1d757c,_0xc3cd90=_0x5e47c3?.['dataset']??{},_0x598993=_0x5e47c3?.[_0x1046a0(0x1f2)]??_0x5e47c3?.[_0x1046a0(0x1bf)]??{};return optionalTrim(_0x598993[_0x1046a0(0x1bd)]??_0xc3cd90[_0x1046a0(0x1bd)]);}function readDatasetDbIdFromDetail(_0x3efe53){const _0x3c113e=a72_0x1d757c,_0x31c859=_0x3efe53?.['dataset']??{},_0x24102f=_0x3efe53?.['dbtableConfig']??_0x3efe53?.[_0x3c113e(0x1bf)]??{},_0x358f34=_0x24102f[_0x3c113e(0x1a4)]??_0x31c859[_0x3c113e(0x1a4)]??_0x3efe53?.[_0x3c113e(0x1a4)]??_0x3efe53?.[_0x3c113e(0x1f4)],_0x506310=Number(optionalTrim(_0x358f34));return Number[_0x3c113e(0x198)](_0x506310)&&_0x506310>0x0?_0x506310:undefined;}function normalizeReadbackCardinality(_0x43fb21){const _0xb5f2cc=a72_0x1d757c,_0x465ef8=optionalTrim(_0x43fb21)?.[_0xb5f2cc(0x1b0)]();if(!_0x465ef8)return undefined;return CARDINALITIES['includes'](_0x465ef8)?_0x465ef8:undefined;}function datasetCodeOfDatasetItem(_0x3340f6){const _0x424ef9=a72_0x1d757c;return optionalTrim(_0x3340f6[_0x424ef9(0x1fc)]??_0x3340f6[_0x424ef9(0x1ce)]??_0x3340f6['datasetCode']);}function tableNameOfDatasetItem(_0x48b1e7){const _0x2d4eb4=a72_0x1d757c;return optionalTrim(_0x48b1e7['dbtableConfig']?.[_0x2d4eb4(0x1bd)]??_0x48b1e7['tableName']??_0x48b1e7[_0x2d4eb4(0x20a)]?.[_0x2d4eb4(0x1bd)]);}export function buildMutationData(_0x5a4c2e){const _0x23df17=a72_0x1d757c,_0x3bfd05=_0x5a4c2e[_0x23df17(0x1a9)]!==undefined?_0x5a4c2e[_0x23df17(0x1a9)]:_0x5a4c2e[_0x23df17(0x1e5)]===_0x23df17(0x207)?null:{'from':endpointForOutput(_0x5a4c2e[_0x23df17(0x1b7)][_0x23df17(0x1a6)]),'to':endpointForOutput(_0x5a4c2e[_0x23df17(0x1b7)]['to']),'cardinality':_0x5a4c2e[_0x23df17(0x1b7)]['cardinality'],..._0x5a4c2e[_0x23df17(0x1b7)]['bizRelationType']?{'bizRelationType':_0x5a4c2e['input'][_0x23df17(0x1c7)]===_0x23df17(0x1f6)?_0x23df17(0x1f6):null}:{}};return{'operation':_0x5a4c2e[_0x23df17(0x1e5)],'appCode':_0x5a4c2e['appCode'],'selector':buildRelationSelector(_0x5a4c2e[_0x23df17(0x1b7)]),'before':_0x5a4c2e[_0x23df17(0x1b2)],'after':_0x3bfd05,'dryRun':_0x5a4c2e[_0x23df17(0x1a1)],'backend':{'method':'POST','path':_0x5a4c2e[_0x23df17(0x1e3)]},..._0x5a4c2e[_0x23df17(0x1b9)]?{'verification':_0x5a4c2e['verification']}:{},'warnings':_0x5a4c2e[_0x23df17(0x1b8)]??[],..._0x5a4c2e[_0x23df17(0x1fa)]?{'suggestedExpectFlags':_0x5a4c2e[_0x23df17(0x1fa)]}:{}};}export function buildDryRunPreview(_0x429acd){const _0x48d966=a72_0x1d757c;return{'operation':_0x429acd[_0x48d966(0x1e5)],'appCode':_0x429acd['appCode'],'method':_0x48d966(0x191),'url':_0x429acd[_0x48d966(0x1e3)],'body':{'appCode':_0x429acd[_0x48d966(0x1b1)],'relation':relationToBackend(_0x429acd['input'])},'description':_0x48d966(0x208)+_0x429acd[_0x48d966(0x1e5)]+'\x20dataset\x20relation\x20'+formatRelationSelector(_0x429acd[_0x48d966(0x1b7)])};}export function buildRelationSelector(_0x51577){const _0x200495=a72_0x1d757c;return{'fromDatasetCode':_0x51577[_0x200495(0x1a6)][_0x200495(0x1f3)],'fromColumn':_0x51577[_0x200495(0x1a6)][_0x200495(0x1e6)],'toDatasetCode':_0x51577['to']['datasetCode'],'toColumn':_0x51577['to']['column']};}export function isMetadataInvolved(_0x586eb7){const _0x3ea30d=a72_0x1d757c;return _0x586eb7[_0x3ea30d(0x1a6)][_0x3ea30d(0x19f)]===_0x3ea30d(0x19d)||_0x586eb7['to'][_0x3ea30d(0x19f)]===_0x3ea30d(0x19d);}function endpointForOutput(_0x5cc233){const _0x3f9fca=a72_0x1d757c;return{..._0x5cc233['datasetCode']?{'datasetCode':_0x5cc233[_0x3f9fca(0x1f3)]}:{},'column':_0x5cc233[_0x3f9fca(0x1e6)],..._0x5cc233[_0x3f9fca(0x1af)]?{'labelColumn':_0x5cc233[_0x3f9fca(0x1af)]}:{}};}function matchesFromDataset(_0x4a29f1,_0x10b219){const _0x2c289d=a72_0x1d757c;return sameName(_0x4a29f1[_0x2c289d(0x1f3)],_0x10b219[_0x2c289d(0x1a6)]['datasetCode']);}function requiredTrim(_0x150b3c,_0x164f95){const _0x1a09a3=a72_0x1d757c,_0x356ebe=_0x150b3c[_0x1a09a3(0x1d3)]();if(!_0x356ebe)throw CliErrors[_0x1a09a3(0x1c3)](_0x164f95+_0x1a09a3(0x1c2));return _0x356ebe;}function readRequiredRelationFlag(_0x3aa28a,_0x557389,_0x57a89c){const _0x2a1f21=a72_0x1d757c;return requiredTrim(optionalTrim(_0x3aa28a[_0x2a1f21(0x1cd)](_0x557389))??_0x57a89c??'','--'+_0x557389);}function a72_0x2bf6(_0xf432ba,_0x20ab7f){_0xf432ba=_0xf432ba-0x191;const _0x1b7f5a=a72_0x1b7f();let _0x2bf6e9=_0x1b7f5a[_0xf432ba];return _0x2bf6e9;}function optionalTrim(_0x1b48ff){const _0x5bc797=_0x1b48ff==null?'':String(_0x1b48ff)['trim']();return _0x5bc797||undefined;}function normalizeCardinality(_0xa5088c){const _0x322d6d=a72_0x1d757c,_0x38e001=requiredTrim(_0xa5088c,'--cardinality')['toUpperCase']();if(!CARDINALITIES[_0x322d6d(0x1ef)](_0x38e001))throw CliErrors[_0x322d6d(0x1c3)]('Invalid\x20--cardinality:\x20'+_0xa5088c,_0x322d6d(0x1b6)+CARDINALITIES[_0x322d6d(0x1be)](',\x20'));return _0x38e001;}export function formatRelationSelector(_0x383764){const _0x4ffa25=a72_0x1d757c;return _0x383764[_0x4ffa25(0x1a6)]['datasetCode']+'.'+_0x383764[_0x4ffa25(0x1a6)][_0x4ffa25(0x1e6)]+_0x4ffa25(0x1a5)+_0x383764['to'][_0x4ffa25(0x1f3)]+'.'+_0x383764['to'][_0x4ffa25(0x1e6)];}function sameName(_0x21e580,_0x4709b6){const _0x54145a=a72_0x1d757c;return(_0x21e580??'')[_0x54145a(0x1d3)]()[_0x54145a(0x197)]()===(_0x4709b6??'')[_0x54145a(0x1d3)]()[_0x54145a(0x197)]();}function collectRelationMismatches(_0x49be44,_0x45a9c0){const _0x193c3e=a72_0x1d757c,_0x5df5ca=[];if(_0x49be44['to']['labelColumn']){if(!_0x45a9c0['to'][_0x193c3e(0x1af)])_0x5df5ca[_0x193c3e(0x200)](_0x193c3e(0x1ad)+_0x49be44['to'][_0x193c3e(0x1af)]);else!sameName(_0x45a9c0['to'][_0x193c3e(0x1af)],_0x49be44['to'][_0x193c3e(0x1af)])&&_0x5df5ca[_0x193c3e(0x200)](_0x193c3e(0x1c8)+_0x45a9c0['to']['labelColumn']+_0x193c3e(0x1b4)+_0x49be44['to'][_0x193c3e(0x1af)]);}_0x49be44[_0x193c3e(0x1fe)]&&!sameName(_0x45a9c0[_0x193c3e(0x1fe)],_0x49be44['cardinality'])&&_0x5df5ca['push'](_0x193c3e(0x1ea)+(_0x45a9c0[_0x193c3e(0x1fe)]??_0x193c3e(0x1ee))+',\x20expected\x20'+_0x49be44[_0x193c3e(0x1fe)]);if(_0x49be44[_0x193c3e(0x1c7)]){const _0x4b7c91=isMainSubRelation(_0x45a9c0['bizRelationType'])?'main_sub':'normal';_0x4b7c91!==_0x49be44[_0x193c3e(0x1c7)]&&_0x5df5ca[_0x193c3e(0x200)](_0x193c3e(0x1a2)+_0x4b7c91+',\x20expected\x20'+_0x49be44['bizRelationType']);}return _0x5df5ca;}function throwRelationVerificationError(_0x1288f9,_0x116c9e,_0x171010){const _0x1991b3=a72_0x1d757c;throw CliErrors[_0x1991b3(0x1c3)]('relation_write_not_verified:\x20'+_0x1288f9+'\x20'+formatRelationSelector(_0x116c9e),_0x1991b3(0x1f1)+_0x171010[_0x1991b3(0x1be)](';\x20')+'.');}
|
|
1
|
+
const a72_0x9ba2b0=a72_0x4af6;(function(_0xaccb92,_0x5e08f8){const _0x49502c=a72_0x4af6,_0xc030c9=_0xaccb92();while(!![]){try{const _0x25e607=-parseInt(_0x49502c(0x14b))/0x1*(parseInt(_0x49502c(0x159))/0x2)+-parseInt(_0x49502c(0x164))/0x3*(-parseInt(_0x49502c(0x136))/0x4)+-parseInt(_0x49502c(0x11f))/0x5+-parseInt(_0x49502c(0x188))/0x6*(-parseInt(_0x49502c(0x148))/0x7)+-parseInt(_0x49502c(0x178))/0x8*(-parseInt(_0x49502c(0x161))/0x9)+parseInt(_0x49502c(0x12c))/0xa*(parseInt(_0x49502c(0x16c))/0xb)+-parseInt(_0x49502c(0x145))/0xc;if(_0x25e607===_0x5e08f8)break;else _0xc030c9['push'](_0xc030c9['shift']());}catch(_0x4ae428){_0xc030c9['push'](_0xc030c9['shift']());}}}(a72_0x3b70,0x874b9));import{getDatasetDetail,getErRelationDetail,getErConfig,listDatasets}from'../../core/api-client.js';import{isMainSubRelation,toDatasetInfo}from'../../commands/dataset/relations.js';import{CliErrors}from'../../errors.js';export const CARDINALITIES=[a72_0x9ba2b0(0x13e),a72_0x9ba2b0(0x187),'MANY_TO_ONE',a72_0x9ba2b0(0x16d)];const BIZ_RELATION_TYPES=['normal','main_sub'];export const FROM_DATASETCODE_FLAG={'name':a72_0x9ba2b0(0x139),'type':'string','required':!![],'description':a72_0x9ba2b0(0x197)};export const FROM_COLUMN_FLAG={'name':a72_0x9ba2b0(0x162),'type':a72_0x9ba2b0(0x175),'required':!![],'description':'Source\x20column\x20name'};export const TO_DATASETCODE_FLAG={'name':a72_0x9ba2b0(0x185),'type':a72_0x9ba2b0(0x175),'required':!![],'description':a72_0x9ba2b0(0x15c)};export const TO_COLUMN_FLAG={'name':'to-column','type':a72_0x9ba2b0(0x175),'required':!![],'description':'Target\x20column\x20name'};export const TO_LABEL_COLUMN_FLAG={'name':a72_0x9ba2b0(0x130),'type':a72_0x9ba2b0(0x175),'required':!![],'description':a72_0x9ba2b0(0x127)};export const TO_LABEL_COLUMN_FLAG_OPTIONAL={...TO_LABEL_COLUMN_FLAG,'required':![],'description':a72_0x9ba2b0(0x194)};export const EXPECT_TO_LABEL_COLUMN_FLAG={'name':a72_0x9ba2b0(0x15b),'type':a72_0x9ba2b0(0x175),'required':![],'description':a72_0x9ba2b0(0x134)};export const CARDINALITY_FLAG={'name':a72_0x9ba2b0(0x14c),'type':a72_0x9ba2b0(0x175),'required':!![],'enum':[...CARDINALITIES],'description':a72_0x9ba2b0(0x184)};export const CARDINALITY_FLAG_OPTIONAL={...CARDINALITY_FLAG,'required':![],'description':a72_0x9ba2b0(0x123)};export const RELATION_ID_FLAG={'name':'relation-id','type':a72_0x9ba2b0(0x143),'required':!![],'description':'Relation\x20record\x20id'};export const RELATION_TYPE_FLAG_OPTIONAL={'name':'biz-relation-type','type':'string','required':![],'enum':[...BIZ_RELATION_TYPES],'description':a72_0x9ba2b0(0x135)};export async function readRelationInput(_0x11e7a2,_0x4371f9){const _0x3e82e6=a72_0x9ba2b0,_0x5446d8=_0x4371f9?.['existing'],_0x4619ae=readRequiredRelationFlag(_0x11e7a2,'from-datasetcode',_0x5446d8?.[_0x3e82e6(0x156)]['datasetCode']??_0x5446d8?.['from'][_0x3e82e6(0x158)]),_0x387a8b=readRequiredRelationFlag(_0x11e7a2,'to-datasetcode',_0x5446d8?.['to'][_0x3e82e6(0x11d)]??_0x5446d8?.['to'][_0x3e82e6(0x158)]),_0x5f5249=readRequiredRelationFlag(_0x11e7a2,_0x3e82e6(0x162),_0x5446d8?.[_0x3e82e6(0x156)][_0x3e82e6(0x163)]),_0x381f2c=readRequiredRelationFlag(_0x11e7a2,'to-column',_0x5446d8?.['to'][_0x3e82e6(0x163)]),[_0x5cdc2a,_0x348459]=await Promise['all']([readRelationDatasetInfo(_0x4619ae,_0x5446d8?.['from']),readRelationDatasetInfo(_0x387a8b,_0x5446d8?.['to'])]),_0x51eee1=_0x5cdc2a[_0x3e82e6(0x155)],_0x16a686=_0x348459[_0x3e82e6(0x155)];if(_0x51eee1==='METADATA'&&_0x16a686==='DB_TABLE')throw CliErrors[_0x3e82e6(0x133)](_0x3e82e6(0x16a));const _0x474a2={'from':{'source':_0x51eee1,'datasetCode':_0x5cdc2a[_0x3e82e6(0x158)],'column':_0x5f5249},'to':{'source':_0x16a686,'datasetCode':_0x348459['code'],'column':_0x381f2c}};if(_0x51eee1===_0x3e82e6(0x15a)){if(_0x5cdc2a[_0x3e82e6(0x17a)]!==undefined)_0x474a2['from'][_0x3e82e6(0x17a)]=_0x5cdc2a[_0x3e82e6(0x17a)];if(_0x5cdc2a[_0x3e82e6(0x16b)])_0x474a2[_0x3e82e6(0x156)][_0x3e82e6(0x16b)]=_0x5cdc2a['table'];}if(_0x16a686===_0x3e82e6(0x15a)){if(_0x348459[_0x3e82e6(0x17a)]!==undefined)_0x474a2['to'][_0x3e82e6(0x17a)]=_0x348459[_0x3e82e6(0x17a)];if(_0x348459[_0x3e82e6(0x16b)])_0x474a2['to']['table']=_0x348459[_0x3e82e6(0x16b)];}if(_0x4371f9?.['includeLabelAndCardinality']){const _0x577c77=optionalTrim(_0x11e7a2[_0x3e82e6(0x191)](_0x3e82e6(0x130)))??_0x5446d8?.['to']['labelColumn']??_0x5446d8?.['to'][_0x3e82e6(0x163)];if(!_0x577c77&&!_0x5446d8&&isMetadataInvolved(_0x474a2))throw CliErrors[_0x3e82e6(0x133)](_0x3e82e6(0x190),'Relations\x20involving\x20METADATA\x20datasets\x20require\x20an\x20explicit\x20target\x20display\x20field\x20update;\x20provide\x20--to-label-column\x20to\x20avoid\x20a\x20no-op\x20update.');_0x474a2['to'][_0x3e82e6(0x171)]=requiredTrim(_0x577c77??'',_0x3e82e6(0x182));const _0x485a36=optionalTrim(_0x11e7a2['str'](_0x3e82e6(0x14c)))??normalizeReadbackCardinality(_0x5446d8?.[_0x3e82e6(0x14c)]);_0x5446d8?_0x474a2[_0x3e82e6(0x14c)]=normalizeCardinality(_0x485a36??_0x3e82e6(0x187)):_0x474a2[_0x3e82e6(0x14c)]=normalizeCardinality(_0x485a36??'');}const _0x474b62=_0x11e7a2[_0x3e82e6(0x191)](_0x3e82e6(0x15e)),_0x573121=optionalTrim(_0x474b62)?.['toLowerCase']()??(_0x5446d8?isMainSubRelation(_0x5446d8['bizRelationType'])?'main_sub':'normal':undefined);if(_0x573121){if(!BIZ_RELATION_TYPES['includes'](_0x573121))throw CliErrors[_0x3e82e6(0x133)](_0x3e82e6(0x18e)+_0x474b62,'Allowed\x20values:\x20'+BIZ_RELATION_TYPES[_0x3e82e6(0x192)](',\x20')+'.');_0x474a2[_0x3e82e6(0x149)]=_0x573121;}return _0x474a2;}async function readRelationDatasetInfo(_0x29c15f,_0x596706){const _0x2f0c7=a72_0x9ba2b0;if(_0x596706?.[_0x2f0c7(0x155)]&&sameName(_0x29c15f,_0x596706[_0x2f0c7(0x11d)]??_0x596706['code']))return{'code':_0x29c15f,'source':_0x596706[_0x2f0c7(0x155)],..._0x596706[_0x2f0c7(0x16b)]?{'table':_0x596706[_0x2f0c7(0x16b)]}:{}};const _0x3ff4a3=await getDatasetDetail(_0x29c15f);if(!_0x3ff4a3||typeof _0x3ff4a3!==_0x2f0c7(0x13b))throw CliErrors[_0x2f0c7(0x133)]('dataset_not_found:\x20'+_0x29c15f);const _0xd43711=toDatasetInfo(_0x3ff4a3),_0x3cde7c=readDatasetDbIdFromDetail(_0x3ff4a3);return{..._0xd43711,..._0x3cde7c!==undefined?{'dbId':_0x3cde7c}:{}};}export function relationToBackend(_0x3eaffa,_0x217051){const _0x5c3d7c=a72_0x9ba2b0;return{'fromDatasetCode':_0x3eaffa[_0x5c3d7c(0x156)][_0x5c3d7c(0x11d)],'fromField':_0x3eaffa[_0x5c3d7c(0x156)][_0x5c3d7c(0x163)],'toDatasetCode':_0x3eaffa['to'][_0x5c3d7c(0x11d)],'toField':_0x3eaffa['to'][_0x5c3d7c(0x163)],..._0x217051!==undefined?{'relationId':_0x217051}:{},..._0x3eaffa['to'][_0x5c3d7c(0x171)]?{'refTableLabelName':_0x3eaffa['to'][_0x5c3d7c(0x171)]}:{},..._0x3eaffa[_0x5c3d7c(0x14c)]?{'cardinality':_0x3eaffa[_0x5c3d7c(0x14c)]}:{},..._0x3eaffa[_0x5c3d7c(0x149)]?{'bizRelationType':_0x3eaffa[_0x5c3d7c(0x149)]===_0x5c3d7c(0x18c)?_0x5c3d7c(0x18c):null}:{}};}export async function findExistingRelation(_0x56ec6d,_0x2f5e4d){const _0x389044=a72_0x9ba2b0,_0x25e3ce=await getErRelationDetail(_0x56ec6d,_0x2f5e4d);if(!_0x25e3ce)return null;const _0x4ddbc2=optionalTrim(_0x25e3ce[_0x389044(0x138)]),_0x402f2c=optionalTrim(_0x25e3ce['toDatasetCode']),_0x54b3ca=optionalTrim(_0x25e3ce[_0x389044(0x126)])??'',_0x3ef025=optionalTrim(_0x25e3ce[_0x389044(0x17f)])??_0x54b3ca,_0x450aa0=normalizeReadbackCardinality(_0x25e3ce['cardinality']),_0x1c5398=optionalTrim(_0x25e3ce[_0x389044(0x149)]);return{'relationId':_0x25e3ce[_0x389044(0x165)],'from':{'source':_0x25e3ce[_0x389044(0x132)],..._0x25e3ce[_0x389044(0x193)]?{'table':_0x25e3ce[_0x389044(0x193)]}:{},..._0x4ddbc2?{'datasetCode':_0x4ddbc2,'code':_0x4ddbc2}:{},..._0x25e3ce['fromDatasetName']?{'datasetName':_0x25e3ce[_0x389044(0x142)]}:{},'column':optionalTrim(_0x25e3ce[_0x389044(0x12a)])??''},'to':{'source':_0x25e3ce['toSourceType'],..._0x25e3ce[_0x389044(0x186)]?{'table':_0x25e3ce['toTableName']}:{},..._0x402f2c?{'datasetCode':_0x402f2c,'code':_0x402f2c}:{},..._0x25e3ce[_0x389044(0x13a)]?{'datasetName':_0x25e3ce[_0x389044(0x13a)]}:{},'column':_0x54b3ca,..._0x3ef025?{'labelColumn':_0x3ef025}:{}},..._0x450aa0?{'cardinality':_0x450aa0}:{},..._0x1c5398?{'bizRelationType':_0x1c5398}:{},'condition':_0x25e3ce[_0x389044(0x17c)]??null};}export async function loadRelationContext(_0x44e89b,_0x19fe0b){const _0x14c3bf=await loadRelationContextFromDatasetFacts(_0x44e89b,_0x19fe0b);if(_0x14c3bf)return _0x14c3bf;const _0x5890fe=await getErConfig(_0x44e89b,_0x19fe0b['from']['dbId']??_0x19fe0b['to']['dbId']??null);return{'existing':findRelationInConfig(_0x5890fe,_0x19fe0b),'readbackHint':findRelationReadbackHintInConfig(_0x5890fe,_0x19fe0b)};}async function loadRelationContextFromDatasetFacts(_0x227f22,_0x3aaf04){const _0x484320=a72_0x9ba2b0,_0x298c4a=await listDatasets(_0x227f22);if(!Array['isArray'](_0x298c4a))return null;const _0xc699e=findEndpointDatasetItem(_0x298c4a,_0x3aaf04[_0x484320(0x156)]),_0x590695=findEndpointDatasetItem(_0x298c4a,_0x3aaf04['to']);if(!_0xc699e||!_0x590695)return null;const _0xc368f=buildRelationReadbackHintFromDatasetItems(_0xc699e,_0x590695,_0x3aaf04);return{'existing':await readRelationFromDatasetDetail(_0x3aaf04,_0xc368f),'readbackHint':_0xc368f};}export async function verifyRelationMutation(_0x41d9f6){const _0x83fd2e=a72_0x9ba2b0,_0x21385e=await readRelationFromDatasetDetail(_0x41d9f6[_0x83fd2e(0x12b)],_0x41d9f6['readbackHint']??null);!_0x21385e&&throwRelationVerificationError(_0x41d9f6['operation'],_0x41d9f6[_0x83fd2e(0x12b)],[_0x83fd2e(0x18d)]);const _0x3f4c7a=collectRelationMismatches(_0x41d9f6['input'],_0x21385e);return _0x3f4c7a[_0x83fd2e(0x12d)]>0x0&&throwRelationVerificationError(_0x41d9f6[_0x83fd2e(0x153)],_0x41d9f6[_0x83fd2e(0x12b)],_0x3f4c7a),{'verified':!![],'status':'matched','afterReadback':_0x21385e};}export function findRelationInConfig(_0x27046a,_0x1c4c28){const _0x50790f=a72_0x9ba2b0,_0x2996be=new Map((_0x27046a[_0x50790f(0x177)]??[])['map'](_0x18c639=>[_0x18c639[_0x50790f(0x11d)],_0x18c639]));for(const _0x7aedde of _0x27046a[_0x50790f(0x177)]??[]){if(!matchesFromDataset(_0x7aedde,_0x1c4c28))continue;for(const _0x422499 of _0x7aedde[_0x50790f(0x131)]??[]){if(!sameName(_0x422499[_0x50790f(0x12f)],_0x1c4c28['to'][_0x50790f(0x11d)]))continue;if(!sameName(_0x422499[_0x50790f(0x12a)],_0x1c4c28[_0x50790f(0x156)][_0x50790f(0x163)]))continue;if(!sameName(_0x422499['toField'],_0x1c4c28['to'][_0x50790f(0x163)]))continue;const _0x498aca=readRelationId(_0x422499),_0x1b5e0f=_0x2996be[_0x50790f(0x120)](_0x422499['toDataset']),_0x4ebbce=optionalTrim(_0x422499[_0x50790f(0x17f)]),_0x580c14=optionalTrim(_0x422499[_0x50790f(0x149)]);return{..._0x498aca?{'relationId':_0x498aca}:{},'from':{..._0x7aedde[_0x50790f(0x125)]?{'table':_0x7aedde['tableName']}:{},..._0x7aedde[_0x50790f(0x11d)]?{'datasetCode':_0x7aedde[_0x50790f(0x11d)]}:{},..._0x7aedde[_0x50790f(0x128)]?{'datasetName':_0x7aedde['datasetName']}:{},'column':_0x422499[_0x50790f(0x12a)]},'to':{..._0x1b5e0f?.[_0x50790f(0x125)]?{'table':_0x1b5e0f[_0x50790f(0x125)]}:{},..._0x422499[_0x50790f(0x12f)]?{'datasetCode':_0x422499[_0x50790f(0x12f)]}:{},..._0x422499[_0x50790f(0x13a)]?{'datasetName':_0x422499['toDatasetName']}:{},'column':_0x422499[_0x50790f(0x126)],..._0x4ebbce?{'labelColumn':_0x4ebbce}:{}},..._0x422499[_0x50790f(0x147)]?{'cardinality':_0x422499[_0x50790f(0x147)]}:{},..._0x580c14?{'bizRelationType':_0x580c14}:{},'condition':_0x422499['condition']??null};}}return null;}function findRelationReadbackHintInConfig(_0x341787,_0x66c462){const _0x21dc4c=a72_0x9ba2b0,_0x2f60c3=(_0x341787[_0x21dc4c(0x177)]??[])[_0x21dc4c(0x154)](_0x154dd9=>matchesFromDataset(_0x154dd9,_0x66c462));if(!_0x2f60c3)return null;const _0x168ba7=(_0x341787[_0x21dc4c(0x177)]??[])[_0x21dc4c(0x154)](_0x37bc20=>sameName(_0x37bc20['datasetCode'],_0x66c462['to']['datasetCode']));if(!_0x168ba7)return null;return{'from':{..._0x2f60c3[_0x21dc4c(0x125)]?{'table':_0x2f60c3[_0x21dc4c(0x125)]}:{},..._0x2f60c3[_0x21dc4c(0x11d)]?{'datasetCode':_0x2f60c3[_0x21dc4c(0x11d)]}:{},..._0x2f60c3[_0x21dc4c(0x128)]?{'datasetName':_0x2f60c3[_0x21dc4c(0x128)]}:{},'column':_0x66c462[_0x21dc4c(0x156)]['column']},'to':{..._0x168ba7['tableName']?{'table':_0x168ba7[_0x21dc4c(0x125)]}:{},..._0x168ba7[_0x21dc4c(0x11d)]?{'datasetCode':_0x168ba7[_0x21dc4c(0x11d)]}:{},..._0x168ba7['datasetName']?{'datasetName':_0x168ba7['datasetName']}:{},'column':_0x66c462['to'][_0x21dc4c(0x163)],..._0x66c462['to'][_0x21dc4c(0x171)]?{'labelColumn':_0x66c462['to'][_0x21dc4c(0x171)]}:{}},..._0x66c462['cardinality']?{'cardinality':_0x66c462[_0x21dc4c(0x14c)]}:{},'condition':null};}function findEndpointDatasetItem(_0xc39e11,_0x44173d){const _0x442401=a72_0x9ba2b0,_0x179b9f=_0x44173d['datasetCode'];if(!_0x179b9f)return undefined;return _0xc39e11[_0x442401(0x154)](_0x261a05=>sameName(datasetCodeOfDatasetItem(_0x261a05),_0x179b9f));}function buildRelationReadbackHintFromDatasetItems(_0x109f01,_0x3628a5,_0x316dd3){const _0x152717=a72_0x9ba2b0,_0x189e38=datasetCodeOfDatasetItem(_0x109f01),_0x236eb5=datasetCodeOfDatasetItem(_0x3628a5),_0x45cc8d=tableNameOfDatasetItem(_0x109f01),_0x31c383=tableNameOfDatasetItem(_0x3628a5);return{'from':{..._0x45cc8d?{'table':_0x45cc8d}:{},..._0x189e38?{'datasetCode':_0x189e38}:{},..._0x109f01[_0x152717(0x173)]?{'datasetName':_0x109f01['name']}:{},'column':_0x316dd3[_0x152717(0x156)][_0x152717(0x163)]},'to':{..._0x31c383?{'table':_0x31c383}:{},..._0x236eb5?{'datasetCode':_0x236eb5}:{},..._0x3628a5[_0x152717(0x173)]?{'datasetName':_0x3628a5[_0x152717(0x173)]}:{},'column':_0x316dd3['to'][_0x152717(0x163)],..._0x316dd3['to'][_0x152717(0x171)]?{'labelColumn':_0x316dd3['to']['labelColumn']}:{}},..._0x316dd3[_0x152717(0x14c)]?{'cardinality':_0x316dd3[_0x152717(0x14c)]}:{},'condition':null};}async function readRelationFromDatasetDetail(_0x5b0d11,_0x494ff6){const _0x9194f=a72_0x9ba2b0,_0x1f19b1=_0x494ff6?.['from'][_0x9194f(0x11d)]??_0x494ff6?.[_0x9194f(0x156)]['code']??_0x5b0d11[_0x9194f(0x156)][_0x9194f(0x11d)];if(!_0x1f19b1)return null;return findRelationInDatasetDetail(await getDatasetDetail(_0x1f19b1),_0x5b0d11,_0x494ff6);}function findRelationInDatasetDetail(_0x54bfe8,_0x4e48ac,_0x182e28){const _0x49b66e=a72_0x9ba2b0,_0x138046=Array[_0x49b66e(0x168)](_0x54bfe8?.['relations'])?_0x54bfe8[_0x49b66e(0x131)]:[],_0x102504=_0x182e28?.['to'][_0x49b66e(0x11d)]??_0x4e48ac['to']['datasetCode'],_0x176334=_0x182e28?.['to'][_0x49b66e(0x16b)]??_0x4e48ac['to'][_0x49b66e(0x16b)],_0x320254=readDatasetCodeFromDetail(_0x54bfe8)??_0x182e28?.['from'][_0x49b66e(0x11d)]??_0x4e48ac[_0x49b66e(0x156)][_0x49b66e(0x11d)],_0x5a3960=readDatasetNameFromDetail(_0x54bfe8)??_0x182e28?.[_0x49b66e(0x156)][_0x49b66e(0x128)],_0x44cf21=readDatasetTableFromDetail(_0x54bfe8)??_0x182e28?.['from']['table']??_0x4e48ac[_0x49b66e(0x156)][_0x49b66e(0x16b)];for(const _0x2b3b87 of _0x138046){const _0x512ec0=readRelationId(_0x2b3b87),_0x46dc43=optionalTrim(_0x2b3b87[_0x49b66e(0x12a)]??_0x2b3b87[_0x49b66e(0x196)]??_0x2b3b87[_0x49b66e(0x17b)]),_0x1a931d=optionalTrim(_0x2b3b87['toField']??_0x2b3b87[_0x49b66e(0x129)]??_0x2b3b87[_0x49b66e(0x181)]),_0x1d97b7=optionalTrim(_0x2b3b87[_0x49b66e(0x15d)]??_0x2b3b87[_0x49b66e(0x14e)]??_0x2b3b87['toDataset']??_0x2b3b87[_0x49b66e(0x122)]),_0x2ebbfd=optionalTrim(_0x2b3b87[_0x49b66e(0x186)]??_0x2b3b87[_0x49b66e(0x150)]??_0x2b3b87[_0x49b66e(0x17d)]);if(sameName(_0x46dc43,_0x4e48ac['from'][_0x49b66e(0x163)])&&sameName(_0x1a931d,_0x4e48ac['to'][_0x49b66e(0x163)])&&matchesReadbackTarget(_0x1d97b7,_0x2ebbfd,_0x102504,_0x176334)){const _0x2c912e=_0x1d97b7??_0x182e28?.['to']['datasetCode']??_0x4e48ac['to'][_0x49b66e(0x11d)],_0x37ffb0=_0x2ebbfd??_0x182e28?.['to'][_0x49b66e(0x16b)]??_0x4e48ac['to'][_0x49b66e(0x16b)],_0x17c03e=optionalTrim(_0x2b3b87[_0x49b66e(0x13a)]??_0x2b3b87[_0x49b66e(0x13f)])??_0x182e28?.['to'][_0x49b66e(0x128)],_0x54b6cc=optionalTrim(_0x2b3b87[_0x49b66e(0x170)]??_0x2b3b87[_0x49b66e(0x167)]??_0x2b3b87['refTableLabelName'])??_0x4e48ac['to']['column'],_0x57b3d1=normalizeReadbackCardinality(_0x2b3b87[_0x49b66e(0x14c)]),_0x204af6=optionalTrim(_0x2b3b87[_0x49b66e(0x149)]);return{..._0x512ec0?{'relationId':_0x512ec0}:{},'from':{..._0x44cf21?{'table':_0x44cf21}:{},..._0x320254?{'datasetCode':_0x320254}:{},..._0x5a3960?{'datasetName':_0x5a3960}:{},'column':_0x46dc43??_0x4e48ac[_0x49b66e(0x156)][_0x49b66e(0x163)]},'to':{..._0x37ffb0?{'table':_0x37ffb0}:{},..._0x2c912e?{'datasetCode':_0x2c912e}:{},..._0x17c03e?{'datasetName':_0x17c03e}:{},'column':_0x1a931d??_0x4e48ac['to']['column'],'labelColumn':_0x54b6cc},..._0x57b3d1?{'cardinality':_0x57b3d1}:{},..._0x204af6?{'bizRelationType':_0x204af6}:{},'condition':_0x2b3b87[_0x49b66e(0x17c)]??_0x182e28?.[_0x49b66e(0x17c)]??null};}}return null;}export async function verifyRelationDeletedById(_0x42526e,_0x556e00){const _0x40661f=a72_0x9ba2b0,_0x4c0e00=_0x556e00[_0x40661f(0x156)][_0x40661f(0x11d)]??_0x556e00[_0x40661f(0x156)][_0x40661f(0x158)];if(!_0x4c0e00)throw CliErrors[_0x40661f(0x133)]('relation_delete_not_verified:\x20source\x20dataset\x20code\x20is\x20unknown');const _0x3b5b7e=await getDatasetDetail(_0x4c0e00),_0x4d41a0=Array[_0x40661f(0x168)](_0x3b5b7e?.[_0x40661f(0x131)])?_0x3b5b7e['relations']:[];if(_0x4d41a0[_0x40661f(0x17e)](_0x3bdbee=>readRelationId(_0x3bdbee)===_0x42526e))throw CliErrors['validation'](_0x40661f(0x121)+_0x556e00['from']['datasetCode']+'.'+_0x556e00['from'][_0x40661f(0x163)]+_0x40661f(0x141)+_0x556e00['to'][_0x40661f(0x11d)]+'.'+_0x556e00['to']['column'],_0x40661f(0x189));return{'verified':!![],'status':_0x40661f(0x172),'afterReadback':null};}function readRelationId(_0x2f542f){const _0x42757b=a72_0x9ba2b0,_0x57acfb=Number(_0x2f542f[_0x42757b(0x165)]??_0x2f542f['id']);return Number[_0x42757b(0x160)](_0x57acfb)&&_0x57acfb>0x0?_0x57acfb:undefined;}function a72_0x4af6(_0x11b972,_0x23564b){_0x11b972=_0x11b972-0x11d;const _0x3b70ff=a72_0x3b70();let _0x4af63f=_0x3b70ff[_0x11b972];return _0x4af63f;}function matchesReadbackTarget(_0x898cd6,_0x3c6304,_0x269ef9,_0x19bd3a){if(_0x269ef9&&_0x898cd6)return sameName(_0x898cd6,_0x269ef9);if(_0x19bd3a&&_0x3c6304)return sameName(_0x3c6304,_0x19bd3a);return![];}function readDatasetCodeFromDetail(_0x250943){const _0x50694f=a72_0x9ba2b0;return optionalTrim(_0x250943?.[_0x50694f(0x166)]??_0x250943?.[_0x50694f(0x158)]??_0x250943?.[_0x50694f(0x11d)]);}function readDatasetNameFromDetail(_0x1a3032){const _0x2373e0=a72_0x9ba2b0,_0x15ae98=_0x1a3032?.[_0x2373e0(0x13d)]??{};return optionalTrim(_0x1a3032?.[_0x2373e0(0x173)]??_0x15ae98[_0x2373e0(0x128)]);}function a72_0x3b70(){const _0x1ef55f=['fromDatasetCode','from-datasetcode','toDatasetName','object','Would\x20','dataset','ONE_TO_ONE','targetDatasetName','(unknown)','\x20->\x20','fromDatasetName','number','cardinality\x20is\x20','19840656HsKEgb','toUpperCase','joinType','84RdGjox','bizRelationType','push','53sfKDXl','cardinality','suggestedExpectFlags','toCode','trim','toTable','dbtable','to-label-column\x20is\x20','operation','find','source','from','warnings','code','23446ozffbt','DB_TABLE','expect-to-label-column','Target\x20dataset\x20code','toDatasetCode','biz-relation-type','before','isInteger','275679kSglWw','from-column','column','3fAlLJX','relationId','modelCode','labelField','isArray','isFinite','METADATA\x20to\x20DB_TABLE\x20ER\x20relation\x20is\x20not\x20supported','table','1595jSJzyz','MANY_TO_MANY','after','dblinkId','toFieldLabel','labelColumn','matched','name','appCode','string','\x20is\x20required.','datasets','272FQHJHv','verification','dbId','field','condition','refTableName','some','refTableLabelName','dbtableConfig','targetField','--to-label-column','The\x20backend\x20write\x20call\x20returned,\x20but\x20readback\x20did\x20not\x20match\x20the\x20requested\x20relation\x20state:\x20','Relation\x20cardinality','to-datasetcode','toTableName','ONE_TO_MANY','237114oKllEI','The\x20backend\x20write\x20call\x20returned,\x20but\x20readback\x20did\x20not\x20match\x20the\x20requested\x20relation\x20state:\x20relation\x20still\x20exists\x20after\x20delete.',',\x20expected\x20','\x20dataset\x20relation\x20','main_sub','relation\x20was\x20not\x20found\x20after\x20write','Invalid\x20--biz-relation-type:\x20','relation_write_not_verified:\x20','--to-label-column\x20is\x20required\x20when\x20either\x20endpoint\x20is\x20METADATA.','str','join','fromTableName','Target\x20display/label\x20column\x20name.\x20relation-update\x20inherits\x20the\x20current\x20value\x20when\x20omitted.','toLowerCase','fromColumn','Source\x20dataset\x20code','datasetCode','delete','2481735NYmHvZ','get','relation_write_not_verified:\x20delete\x20','targetDatasetCode','Relation\x20cardinality.\x20Explicit\x20values\x20apply\x20to\x20every\x20supported\x20direction;\x20relation-update\x20otherwise\x20keeps\x20the\x20current\x20or\x20default\x20value.','backendPath','tableName','toField','Target\x20display/label\x20column\x20name\x20for\x20relation\x20display','datasetName','toColumn','fromField','input','69470oxmjzX','length','to-label-column\x20is\x20unknown,\x20expected\x20','toDataset','to-label-column','relations','fromSourceType','validation','Expected\x20current\x20target\x20display/label\x20column\x20for\x20drift\x20detection.\x20DB_TABLE\x20reads\x20the\x20current\x20label\x20only\x20when\x20this\x20flag\x20is\x20provided;\x20missing\x20labels\x20default\x20to\x20--to-column.','Business\x20relation\x20type.\x20normal\x20marks\x20a\x20normal\x20relation;\x20main_sub\x20marks\x20a\x20master-detail\x20relation.','3208904cMDszl','METADATA'];a72_0x3b70=function(){return _0x1ef55f;};return a72_0x3b70();}function readDatasetTableFromDetail(_0x1b0230){const _0x5724bd=a72_0x9ba2b0,_0x4a0c5d=_0x1b0230?.[_0x5724bd(0x13d)]??{},_0x4d805e=_0x1b0230?.[_0x5724bd(0x180)]??_0x1b0230?.[_0x5724bd(0x151)]??{};return optionalTrim(_0x4d805e[_0x5724bd(0x125)]??_0x4a0c5d[_0x5724bd(0x125)]);}function readDatasetDbIdFromDetail(_0x598864){const _0x320af3=a72_0x9ba2b0,_0x5af751=_0x598864?.[_0x320af3(0x13d)]??{},_0x5f0c83=_0x598864?.[_0x320af3(0x180)]??_0x598864?.[_0x320af3(0x151)]??{},_0xd6c1af=_0x5f0c83[_0x320af3(0x17a)]??_0x5af751['dbId']??_0x598864?.['dbId']??_0x598864?.[_0x320af3(0x16f)],_0x230d8=Number(optionalTrim(_0xd6c1af));return Number[_0x320af3(0x169)](_0x230d8)&&_0x230d8>0x0?_0x230d8:undefined;}function normalizeReadbackCardinality(_0x1e2e06){const _0x222229=a72_0x9ba2b0,_0x4ae636=optionalTrim(_0x1e2e06)?.[_0x222229(0x146)]();if(!_0x4ae636)return undefined;return CARDINALITIES['includes'](_0x4ae636)?_0x4ae636:undefined;}function datasetCodeOfDatasetItem(_0x1d99b0){const _0x16da2a=a72_0x9ba2b0;return optionalTrim(_0x1d99b0['code']??_0x1d99b0['modelCode']??_0x1d99b0[_0x16da2a(0x11d)]);}function tableNameOfDatasetItem(_0x15e483){const _0x3e88e1=a72_0x9ba2b0;return optionalTrim(_0x15e483[_0x3e88e1(0x180)]?.[_0x3e88e1(0x125)]??_0x15e483[_0x3e88e1(0x125)]??_0x15e483['dataset']?.[_0x3e88e1(0x125)]);}export function buildMutationData(_0x253620){const _0x12a520=a72_0x9ba2b0,_0x3d2305=_0x253620['after']!==undefined?_0x253620[_0x12a520(0x16e)]:_0x253620[_0x12a520(0x153)]===_0x12a520(0x11e)?null:{'from':endpointForOutput(_0x253620['input'][_0x12a520(0x156)]),'to':endpointForOutput(_0x253620['input']['to']),'cardinality':_0x253620[_0x12a520(0x12b)][_0x12a520(0x14c)],..._0x253620['input'][_0x12a520(0x149)]?{'bizRelationType':_0x253620[_0x12a520(0x12b)]['bizRelationType']===_0x12a520(0x18c)?_0x12a520(0x18c):null}:{}};return{'operation':_0x253620[_0x12a520(0x153)],'appCode':_0x253620[_0x12a520(0x174)],'selector':buildRelationSelector(_0x253620[_0x12a520(0x12b)]),'before':_0x253620[_0x12a520(0x15f)],'after':_0x3d2305,'dryRun':_0x253620['dryRun'],'backend':{'method':'POST','path':_0x253620[_0x12a520(0x124)]},..._0x253620[_0x12a520(0x179)]?{'verification':_0x253620['verification']}:{},'warnings':_0x253620[_0x12a520(0x157)]??[],..._0x253620[_0x12a520(0x14d)]?{'suggestedExpectFlags':_0x253620[_0x12a520(0x14d)]}:{}};}export function buildDryRunPreview(_0x3074bb){const _0x2878e9=a72_0x9ba2b0;return{'operation':_0x3074bb[_0x2878e9(0x153)],'appCode':_0x3074bb[_0x2878e9(0x174)],'method':'POST','url':_0x3074bb[_0x2878e9(0x124)],'body':{'appCode':_0x3074bb[_0x2878e9(0x174)],'relation':relationToBackend(_0x3074bb[_0x2878e9(0x12b)])},'description':_0x2878e9(0x13c)+_0x3074bb[_0x2878e9(0x153)]+_0x2878e9(0x18b)+formatRelationSelector(_0x3074bb[_0x2878e9(0x12b)])};}export function buildRelationSelector(_0x51478a){const _0xfeddb=a72_0x9ba2b0;return{'fromDatasetCode':_0x51478a[_0xfeddb(0x156)][_0xfeddb(0x11d)],'fromColumn':_0x51478a['from'][_0xfeddb(0x163)],'toDatasetCode':_0x51478a['to']['datasetCode'],'toColumn':_0x51478a['to'][_0xfeddb(0x163)]};}export function isMetadataInvolved(_0x9b4bc5){const _0x1f49bd=a72_0x9ba2b0;return _0x9b4bc5[_0x1f49bd(0x156)][_0x1f49bd(0x155)]===_0x1f49bd(0x137)||_0x9b4bc5['to'][_0x1f49bd(0x155)]===_0x1f49bd(0x137);}function endpointForOutput(_0x14f06a){const _0x13c8b3=a72_0x9ba2b0;return{..._0x14f06a['datasetCode']?{'datasetCode':_0x14f06a[_0x13c8b3(0x11d)]}:{},'column':_0x14f06a[_0x13c8b3(0x163)],..._0x14f06a[_0x13c8b3(0x171)]?{'labelColumn':_0x14f06a[_0x13c8b3(0x171)]}:{}};}function matchesFromDataset(_0x5a5049,_0x20ae1b){const _0x5994d0=a72_0x9ba2b0;return sameName(_0x5a5049[_0x5994d0(0x11d)],_0x20ae1b[_0x5994d0(0x156)][_0x5994d0(0x11d)]);}function requiredTrim(_0x57c12d,_0x3a68b4){const _0x186699=a72_0x9ba2b0,_0x146aa4=_0x57c12d['trim']();if(!_0x146aa4)throw CliErrors[_0x186699(0x133)](_0x3a68b4+_0x186699(0x176));return _0x146aa4;}function readRequiredRelationFlag(_0x4b754f,_0x13d6a8,_0x3fbf2d){const _0x48b987=a72_0x9ba2b0;return requiredTrim(optionalTrim(_0x4b754f[_0x48b987(0x191)](_0x13d6a8))??_0x3fbf2d??'','--'+_0x13d6a8);}function optionalTrim(_0x1a064f){const _0x47e8ae=a72_0x9ba2b0,_0x2a5566=_0x1a064f==null?'':String(_0x1a064f)[_0x47e8ae(0x14f)]();return _0x2a5566||undefined;}function normalizeCardinality(_0xf35b07){const _0x3378bc=a72_0x9ba2b0,_0x3771fd=requiredTrim(_0xf35b07,'--cardinality')['toUpperCase']();if(!CARDINALITIES['includes'](_0x3771fd))throw CliErrors['validation']('Invalid\x20--cardinality:\x20'+_0xf35b07,'Allowed\x20values:\x20'+CARDINALITIES[_0x3378bc(0x192)](',\x20'));return _0x3771fd;}export function formatRelationSelector(_0x24fee4){const _0x2c49fa=a72_0x9ba2b0;return _0x24fee4[_0x2c49fa(0x156)][_0x2c49fa(0x11d)]+'.'+_0x24fee4['from']['column']+_0x2c49fa(0x141)+_0x24fee4['to'][_0x2c49fa(0x11d)]+'.'+_0x24fee4['to'][_0x2c49fa(0x163)];}function sameName(_0x37c78a,_0x52e88c){const _0x3dbfde=a72_0x9ba2b0;return(_0x37c78a??'')[_0x3dbfde(0x14f)]()[_0x3dbfde(0x195)]()===(_0x52e88c??'')[_0x3dbfde(0x14f)]()[_0x3dbfde(0x195)]();}function collectRelationMismatches(_0x1636e6,_0x55317f){const _0x46fdc7=a72_0x9ba2b0,_0x47e201=[];if(_0x1636e6['to'][_0x46fdc7(0x171)]){if(!_0x55317f['to'][_0x46fdc7(0x171)])_0x47e201['push'](_0x46fdc7(0x12e)+_0x1636e6['to'][_0x46fdc7(0x171)]);else!sameName(_0x55317f['to'][_0x46fdc7(0x171)],_0x1636e6['to'][_0x46fdc7(0x171)])&&_0x47e201['push'](_0x46fdc7(0x152)+_0x55317f['to'][_0x46fdc7(0x171)]+',\x20expected\x20'+_0x1636e6['to'][_0x46fdc7(0x171)]);}_0x1636e6['cardinality']&&!sameName(_0x55317f[_0x46fdc7(0x14c)],_0x1636e6[_0x46fdc7(0x14c)])&&_0x47e201[_0x46fdc7(0x14a)](_0x46fdc7(0x144)+(_0x55317f[_0x46fdc7(0x14c)]??_0x46fdc7(0x140))+_0x46fdc7(0x18a)+_0x1636e6['cardinality']);if(_0x1636e6[_0x46fdc7(0x149)]){const _0x3cadd0=isMainSubRelation(_0x55317f[_0x46fdc7(0x149)])?_0x46fdc7(0x18c):'normal';_0x3cadd0!==_0x1636e6[_0x46fdc7(0x149)]&&_0x47e201['push']('biz-relation-type\x20is\x20'+_0x3cadd0+_0x46fdc7(0x18a)+_0x1636e6[_0x46fdc7(0x149)]);}return _0x47e201;}function throwRelationVerificationError(_0xd76baf,_0x1542f5,_0x1e4516){const _0x41886b=a72_0x9ba2b0;throw CliErrors[_0x41886b(0x133)](_0x41886b(0x18f)+_0xd76baf+'\x20'+formatRelationSelector(_0x1542f5),_0x41886b(0x183)+_0x1e4516[_0x41886b(0x192)](';\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a73_0x292733=a73_0x2072;(function(_0x1becb4,_0x12bea3){const _0x22eb95=a73_0x2072,_0x23cd80=_0x1becb4();while(!![]){try{const _0x19b76c=parseInt(_0x22eb95(0x1f0))/0x1*(-parseInt(_0x22eb95(0x1ea))/0x2)+parseInt(_0x22eb95(0x1ec))/0x3*(parseInt(_0x22eb95(0x1f1))/0x4)+parseInt(_0x22eb95(0x20c))/0x5*(parseInt(_0x22eb95(0x200))/0x6)+-parseInt(_0x22eb95(0x1e9))/0x7*(-parseInt(_0x22eb95(0x1fa))/0x8)+-parseInt(_0x22eb95(0x1eb))/0x9+-parseInt(_0x22eb95(0x1fc))/0xa+-parseInt(_0x22eb95(0x1f8))/0xb*(parseInt(_0x22eb95(0x206))/0xc);if(_0x19b76c===_0x12bea3)break;else _0x23cd80['push'](_0x23cd80['shift']());}catch(_0x5ca781){_0x23cd80['push'](_0x23cd80['shift']());}}}(a73_0x17ae,0x2a808));import{updateErRelation}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG}from'../../commands/common/flags.js';function a73_0x2072(_0x16d676,_0x80b297){_0x16d676=_0x16d676-0x1e8;const _0x17ae48=a73_0x17ae();let _0x207295=_0x17ae48[_0x16d676];return _0x207295;}import{buildMutationData,RELATION_TYPE_FLAG_OPTIONAL,CARDINALITY_FLAG_OPTIONAL,EXPECT_TO_LABEL_COLUMN_FLAG,FROM_COLUMN_FLAG,FROM_DATASETCODE_FLAG,findExistingRelation,formatRelationSelector,isMetadataInvolved,readRelationInput,relationToBackend,RELATION_ID_FLAG,TO_COLUMN_FLAG,TO_DATASETCODE_FLAG,TO_LABEL_COLUMN_FLAG_OPTIONAL,verifyRelationMutation}from'../../commands/dataset/relation-shared.js';const BACKEND_PATH=a73_0x292733(0x1ed);export const datasetRelationUpdate={'service':a73_0x292733(0x1f2),'command':a73_0x292733(0x1fb),'description':a73_0x292733(0x201),'risk':a73_0x292733(0x1ee),'flags':[RELATION_ID_FLAG,{...FROM_DATASETCODE_FLAG,'required':![]},{...FROM_COLUMN_FLAG,'required':![]},{...TO_DATASETCODE_FLAG,'required':![]},{...TO_COLUMN_FLAG,'required':![]},TO_LABEL_COLUMN_FLAG_OPTIONAL,EXPECT_TO_LABEL_COLUMN_FLAG,CARDINALITY_FLAG_OPTIONAL,RELATION_TYPE_FLAG_OPTIONAL,APPCODE_FLAG],async 'validate'(_0x3ed590){readRelationIdFlag(_0x3ed590);},async 'dryRun'(_0x5ccc83){const _0x42f88d=a73_0x292733,{relationId:_0x1b1e00,before:_0x5b0fd4,input:_0x13d16a}=await readRelationUpdate(_0x5ccc83);return{'method':_0x42f88d(0x1ff),'url':BACKEND_PATH,'body':{'appCode':_0x5ccc83[_0x42f88d(0x1fe)],'relation':relationToBackend(_0x13d16a,_0x1b1e00)},...buildMutationData({'operation':'update','appCode':_0x5ccc83['appCode'],'input':_0x13d16a,'before':_0x5b0fd4,'dryRun':!![],'backendPath':BACKEND_PATH,...buildDriftWarnings(_0x5ccc83[_0x42f88d(0x207)]('expect-to-label-column'),_0x5b0fd4,_0x13d16a)})};},async 'execute'(_0x4c058d){const _0x3bef87=a73_0x292733,{relationId:_0x51603f,before:_0x5aaf0d,input:_0x3331b0}=await readRelationUpdate(_0x4c058d),_0x278363=_0x4c058d[_0x3bef87(0x207)](_0x3bef87(0x1f3));validateExpectedLabel(_0x278363,_0x5aaf0d);const _0x4d7a3f=buildDriftWarnings(_0x278363,_0x5aaf0d,_0x3331b0);await updateErRelation({'appCode':_0x4c058d[_0x3bef87(0x1fe)],'relation':relationToBackend(_0x3331b0,_0x51603f)});const _0x20e97e=await verifyRelationMutation({'operation':'update','appCode':_0x4c058d[_0x3bef87(0x1fe)],'input':_0x3331b0});return{'ok':!![],'data':buildMutationData({'operation':_0x3bef87(0x20b),'appCode':_0x4c058d[_0x3bef87(0x1fe)],'input':_0x3331b0,'before':_0x5aaf0d,'dryRun':![],'backendPath':BACKEND_PATH,'after':_0x20e97e[_0x3bef87(0x204)],'verification':_0x20e97e,..._0x4d7a3f}),'message':_0x3bef87(0x1f9)+formatRelationSelector(_0x3331b0)};}};function a73_0x17ae(){const _0x1a641e=['afterReadback','No\x20--expect-to-label-column\x20was\x20provided.\x20Pass\x20the\x20suggested\x20expect\x20flag\x20for\x20optimistic\x20concurrency\x20control.','12kOLQCw','str','relation-id','trim','isInteger','update','1432660VuoXuh','relation_not_found:\x20appCode=','7yVnPYO','382NbHNlv','197046RlXCil','861813iwVGQH','/smartapi/question/er-config/cli/update-single','write','Run\x20dataset\x20relations\x20first\x20to\x20inspect\x20the\x20current\x20dataset\x20relations.','221RvnwEv','4VjCjjj','dataset','expect-to-label-column',',\x20expected\x20','num','(unknown)',',\x20relationId=','4070957moohFT','Updated\x20dataset\x20relation:\x20','2170312QBJpkR','relation-update','2368120pywLck','validation','appCode','POST','6xPcrkJ','Update\x20one\x20dataset\x20relation','--relation-id\x20must\x20be\x20a\x20positive\x20integer.','labelColumn'];a73_0x17ae=function(){return _0x1a641e;};return a73_0x17ae();}async function readRelationUpdate(_0x43850a){const _0x4f882e=a73_0x292733,_0x2ac0a0=readRelationIdFlag(_0x43850a),_0x3bcd27=await findExistingRelation(_0x43850a[_0x4f882e(0x1fe)],_0x2ac0a0);if(!_0x3bcd27)throw CliErrors[_0x4f882e(0x1fd)](_0x4f882e(0x1e8)+_0x43850a[_0x4f882e(0x1fe)]+_0x4f882e(0x1f7)+_0x2ac0a0,_0x4f882e(0x1ef));const _0x10c145=await readRelationInput(_0x43850a,{'includeLabelAndCardinality':!![],'existing':_0x3bcd27});return{'relationId':_0x2ac0a0,'before':_0x3bcd27,'input':_0x10c145};}function readRelationIdFlag(_0x52d45a){const _0x3a601c=a73_0x292733,_0x3b01d1=_0x52d45a[_0x3a601c(0x1f5)](_0x3a601c(0x208));if(!Number[_0x3a601c(0x20a)](_0x3b01d1)||_0x3b01d1<=0x0)throw CliErrors[_0x3a601c(0x1fd)](_0x3a601c(0x202));return _0x3b01d1;}function validateExpectedLabel(_0x1df054,_0xe7d256){const _0x440e15=a73_0x292733,_0x3da79a=_0x1df054[_0x440e15(0x209)]();if(!_0x3da79a)return;const _0x3ef653=_0xe7d256['to'][_0x440e15(0x203)];if(_0x3ef653!==_0x3da79a)throw CliErrors[_0x440e15(0x1fd)]('Expectation\x20mismatch:\x20current\x20to-label-column\x20is\x20'+(_0x3ef653??_0x440e15(0x1f6))+_0x440e15(0x1f4)+_0x3da79a+'.');}function buildDriftWarnings(_0x4a1eca,_0x16e609,_0x261f66){const _0x1a3a37=a73_0x292733;if(!isMetadataInvolved(_0x261f66)||_0x4a1eca['trim']()||!_0x16e609['to']['labelColumn'])return{'warnings':[]};return{'warnings':[{'code':'no_drift_check_applied','message':_0x1a3a37(0x205)}],'suggestedExpectFlags':{'--expect-to-label-column':_0x16e609['to'][_0x1a3a37(0x203)]}};}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type DatasetItem } from "../../core/api-client.js";
|
|
2
|
+
import type { CommandDefinition } from "../../framework/types.js";
|
|
3
|
+
export declare const SOURCE_TYPES: readonly ["DB_TABLE", "METADATA"];
|
|
4
|
+
export type SourceType = typeof SOURCE_TYPES[number];
|
|
5
|
+
export interface DatasetInfo {
|
|
6
|
+
code: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
source: SourceType;
|
|
9
|
+
table?: string;
|
|
10
|
+
doVersion?: string;
|
|
11
|
+
detail: Record<string, any>;
|
|
12
|
+
}
|
|
13
|
+
export interface DatasetRelationFact {
|
|
14
|
+
relationId?: number;
|
|
15
|
+
from: {
|
|
16
|
+
source: SourceType;
|
|
17
|
+
datasetCode: string;
|
|
18
|
+
datasetName?: string;
|
|
19
|
+
table?: string;
|
|
20
|
+
field: string;
|
|
21
|
+
};
|
|
22
|
+
to: {
|
|
23
|
+
source: SourceType;
|
|
24
|
+
datasetCode: string;
|
|
25
|
+
datasetName?: string;
|
|
26
|
+
table?: string;
|
|
27
|
+
field: string;
|
|
28
|
+
labelField?: string;
|
|
29
|
+
};
|
|
30
|
+
relation: {
|
|
31
|
+
cardinality?: string;
|
|
32
|
+
bizRelationType: "main_sub" | null;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface DatasetRelationFacts {
|
|
36
|
+
appCode: string;
|
|
37
|
+
datasetCode?: string;
|
|
38
|
+
relations: DatasetRelationFact[];
|
|
39
|
+
detailByCode: Map<string, DatasetInfo>;
|
|
40
|
+
listByCode: Map<string, DatasetItem>;
|
|
41
|
+
}
|
|
42
|
+
type DatasetRelationsContext = Parameters<NonNullable<CommandDefinition["execute"]>>[0];
|
|
43
|
+
export declare const datasetRelations: CommandDefinition;
|
|
44
|
+
export declare function collectDatasetRelationFacts(ctx: DatasetRelationsContext, options?: {
|
|
45
|
+
includeUnsupportedDirections?: boolean;
|
|
46
|
+
}): Promise<DatasetRelationFacts>;
|
|
47
|
+
export declare function toDatasetInfo(detail: Record<string, any>, listItem?: DatasetItem): DatasetInfo;
|
|
48
|
+
export declare function datasetCodeOf(value: Record<string, any>): string;
|
|
49
|
+
export declare function sourceOf(value: unknown, tableName?: unknown): SourceType;
|
|
50
|
+
export declare function readSourceFilter(value: unknown, flagName: string): SourceType | undefined;
|
|
51
|
+
export declare function trim(value: unknown): string;
|
|
52
|
+
export declare function isMainSubRelation(value: unknown): boolean;
|
|
53
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a74_0x51bb99=a74_0x199c;(function(_0x20982a,_0xcbba2b){const _0x1c2b6f=a74_0x199c,_0x76bd3c=_0x20982a();while(!![]){try{const _0x2ee20b=parseInt(_0x1c2b6f(0x1cc))/0x1+-parseInt(_0x1c2b6f(0x19a))/0x2+-parseInt(_0x1c2b6f(0x1a2))/0x3+-parseInt(_0x1c2b6f(0x1cd))/0x4+parseInt(_0x1c2b6f(0x1aa))/0x5*(-parseInt(_0x1c2b6f(0x1b0))/0x6)+parseInt(_0x1c2b6f(0x1b5))/0x7*(-parseInt(_0x1c2b6f(0x1b9))/0x8)+parseInt(_0x1c2b6f(0x196))/0x9;if(_0x2ee20b===_0xcbba2b)break;else _0x76bd3c['push'](_0x76bd3c['shift']());}catch(_0xab693d){_0x76bd3c['push'](_0x76bd3c['shift']());}}}(a74_0x21d0,0x922fd));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a74_0x21d0(){const _0x37c033=['toColumn','METADATA','toSource','bizRelationType','METADATA\x20to\x20DB_TABLE\x20dataset\x20relation\x20is\x20not\x20supported','toField','do-version','table','List\x20V2\x20dataset\x20relation\x20facts\x20using\x20datasetCode\x20+\x20field\x20as\x20the\x20primary\x20locator.\x20','targetDatasetCode','Legacy\x20troubleshooting\x20filter\x20for\x20dataset\x20version;\x20defaults\x20to\x20v2','toCode','labelField','relations','Filter\x20source\x20dataset\x20type:\x20DB_TABLE\x20or\x20METADATA','map','set','refTableLabelName','793179IUQCTG','1113908twHXic','Invalid\x20','read','datasetName','toDataset','toDatasetCode','dataset','main_sub','--to-source','includes','to-source','DB_TABLE','number','ONE_TO_MANY','name','toLowerCase','code','detail','20633148XlSztZ','datasetCode','Filter\x20target\x20dataset\x20type:\x20DB_TABLE\x20or\x20METADATA','Supports\x20DB_TABLE\x20->\x20DB_TABLE,\x20DB_TABLE\x20->\x20METADATA,\x20and\x20METADATA\x20->\x20METADATA.','892032eDdRpN','source','datasetcode','toSourceType','str','trim','from-source','doVersion','1697850UHtgyk','toFieldLabel','toUpperCase','object','Dataset\x20relations:\x20','flatMap','toDatasetName','fromColumn','40znZvSx','catch','tableName','fromField','includeUnsupportedDirections','--from-source','395484mOpGrg','get','all','isArray','appCode','936901KxEUUQ','toTableName','string','MANY_TO_MANY','40kdcnHC'];a74_0x21d0=function(){return _0x37c033;};return a74_0x21d0();}import{CliErrors}from'../../errors.js';export const SOURCE_TYPES=[a74_0x51bb99(0x18f),'METADATA'];const DEFAULT_DO_VERSION='v2';export const datasetRelations={'service':a74_0x51bb99(0x1d3),'command':a74_0x51bb99(0x1c7),'description':a74_0x51bb99(0x1c2)+a74_0x51bb99(0x199),'risk':a74_0x51bb99(0x1cf),'flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a74_0x51bb99(0x1a0),'type':a74_0x51bb99(0x1b7),'required':![],'enum':[...SOURCE_TYPES],'description':a74_0x51bb99(0x1c8)},{'name':a74_0x51bb99(0x18e),'type':'string','required':![],'enum':[...SOURCE_TYPES],'description':a74_0x51bb99(0x198)},{'name':a74_0x51bb99(0x1c0),'type':a74_0x51bb99(0x1b7),'required':![],'enum':['v1','v2'],'description':a74_0x51bb99(0x1c4)}],async 'validate'(_0x30800d){const _0x2ea74c=a74_0x51bb99;readSourceFilter(_0x30800d[_0x2ea74c(0x19e)](_0x2ea74c(0x1a0)),_0x2ea74c(0x1af)),readSourceFilter(_0x30800d[_0x2ea74c(0x19e)](_0x2ea74c(0x18e)),_0x2ea74c(0x18c)),rejectUnsupportedDirection(readSourceFilter(_0x30800d[_0x2ea74c(0x19e)](_0x2ea74c(0x1a0)),_0x2ea74c(0x1af)),readSourceFilter(_0x30800d['str']('to-source'),'--to-source'));},async 'execute'(_0x4bdb65){const _0x485301=a74_0x51bb99,_0x190383=await collectDatasetRelationFacts(_0x4bdb65);return{'ok':!![],'data':{'appCode':_0x4bdb65['appCode'],'total':_0x190383[_0x485301(0x1c7)]['length'],'relations':_0x190383[_0x485301(0x1c7)]},'message':_0x485301(0x1a6)+_0x190383['relations']['length']+'\x20relation(s)'};}};function a74_0x199c(_0x58c016,_0x5e8798){_0x58c016=_0x58c016-0x18b;const _0x21d051=a74_0x21d0();let _0x199ca3=_0x21d051[_0x58c016];return _0x199ca3;}export async function collectDatasetRelationFacts(_0x32f802,_0x205067){const _0x4719a5=a74_0x51bb99,_0x3ecce2=trim(_0x32f802[_0x4719a5(0x19e)](_0x4719a5(0x19c))),_0x101d3b=readSourceFilter(_0x32f802['str'](_0x4719a5(0x1a0)),_0x4719a5(0x1af)),_0x3a85be=readSourceFilter(_0x32f802[_0x4719a5(0x19e)]('to-source'),_0x4719a5(0x18c)),_0x55931f=trim(_0x32f802['str']('do-version')||DEFAULT_DO_VERSION)[_0x4719a5(0x193)]();!_0x205067?.['includeUnsupportedDirections']&&rejectUnsupportedDirection(_0x101d3b,_0x3a85be);const _0x5bfaa2=await listDatasets(_0x32f802[_0x4719a5(0x1b4)],{..._0x3ecce2?{'code':_0x3ecce2}:{}}),_0x3e2dca=new Map();for(const _0x5392b5 of _0x5bfaa2){const _0x3b2eda=datasetCodeOf(_0x5392b5);if(_0x3b2eda)_0x3e2dca[_0x4719a5(0x1ca)](_0x3b2eda,_0x5392b5);}const _0x4cc55b=_0x3ecce2?[toDatasetInfo(await getDatasetDetail(_0x3ecce2),_0x3e2dca[_0x4719a5(0x1b1)](_0x3ecce2))]:await Promise[_0x4719a5(0x1b2)](_0x5bfaa2[_0x4719a5(0x1c9)](async _0x18f0c4=>toDatasetInfo(await getDatasetDetail(datasetCodeOf(_0x18f0c4)),_0x18f0c4))),_0x517cb4=_0x4cc55b['filter'](_0x5c299c=>{const _0x1d47fb=_0x4719a5;if(_0x55931f&&normalizeDoVersion(_0x5c299c[_0x1d47fb(0x1a1)])!==_0x55931f)return![];return!![];}),_0x4835bd=new Map(_0x517cb4[_0x4719a5(0x1c9)](_0x17f678=>[_0x17f678[_0x4719a5(0x194)],_0x17f678]));if(_0x3ecce2){const _0x216d60=new Set(_0x517cb4[_0x4719a5(0x1a7)](_0x557523=>Array[_0x4719a5(0x1b3)](_0x557523[_0x4719a5(0x195)][_0x4719a5(0x1c7)])?_0x557523[_0x4719a5(0x195)][_0x4719a5(0x1c7)]:[])[_0x4719a5(0x1c9)](_0x5bba7b=>trim(_0x5bba7b[_0x4719a5(0x1d2)]??_0x5bba7b['toCode']??_0x5bba7b['toDataset']??_0x5bba7b['targetDatasetCode']))['filter'](_0x256768=>_0x256768&&!_0x4835bd['has'](_0x256768)));await Promise[_0x4719a5(0x1b2)]([..._0x216d60][_0x4719a5(0x1c9)](async _0x3bd938=>{const _0x1f1011=_0x4719a5,_0x13c5f0=await getDatasetDetail(_0x3bd938)[_0x1f1011(0x1ab)](()=>null);if(!_0x13c5f0||typeof _0x13c5f0!==_0x1f1011(0x1a5))return;const _0x47f461=toDatasetInfo(_0x13c5f0);if(_0x47f461[_0x1f1011(0x194)])_0x4835bd[_0x1f1011(0x1ca)](_0x47f461[_0x1f1011(0x194)],_0x47f461);}));}const _0x17bb19=_0x517cb4[_0x4719a5(0x1a7)](_0x4845f0=>{const _0x466d44=_0x4719a5,_0x2c3b70=Array['isArray'](_0x4845f0[_0x466d44(0x195)][_0x466d44(0x1c7)])?_0x4845f0[_0x466d44(0x195)][_0x466d44(0x1c7)]:[];return _0x2c3b70['flatMap'](_0x55db23=>{const _0x501aed=_0x466d44,_0x1def0b=trim(_0x55db23[_0x501aed(0x1ad)]??_0x55db23[_0x501aed(0x1a9)]??_0x55db23['field']),_0x2a95f0=trim(_0x55db23['toDatasetCode']??_0x55db23[_0x501aed(0x1c5)]??_0x55db23[_0x501aed(0x1d1)]??_0x55db23[_0x501aed(0x1c3)]),_0x182414=trim(_0x55db23[_0x501aed(0x1bf)]??_0x55db23[_0x501aed(0x1ba)]??_0x55db23['targetField']);if(!_0x1def0b||!_0x2a95f0||!_0x182414)return[];const _0x593b23=_0x4835bd[_0x501aed(0x1b1)](_0x2a95f0)??(_0x3e2dca['has'](_0x2a95f0)?toDatasetInfo(_0x3e2dca[_0x501aed(0x1b1)](_0x2a95f0)??{},_0x3e2dca['get'](_0x2a95f0)):undefined),_0x4cd9d6=_0x593b23?.[_0x501aed(0x19b)]??sourceOf(_0x55db23[_0x501aed(0x19d)]??_0x55db23[_0x501aed(0x1bc)]??_0x55db23['sourceType'],_0x55db23[_0x501aed(0x1b6)]);if(_0x4845f0[_0x501aed(0x19b)]===_0x501aed(0x1bb)&&_0x4cd9d6===_0x501aed(0x18f)&&!_0x205067?.[_0x501aed(0x1ae)])return[];if(_0x101d3b&&_0x4845f0[_0x501aed(0x19b)]!==_0x101d3b)return[];if(_0x3a85be&&_0x4cd9d6!==_0x3a85be)return[];const _0x564c2c=readRelationLabelField(_0x55db23),_0x3999f0=_0x55db23['relationId'],_0x3a5d58=typeof _0x3999f0===_0x501aed(0x190)||typeof _0x3999f0===_0x501aed(0x1b7)?Number(_0x3999f0):undefined,_0x1e92d0=normalizeCardinality(_0x55db23['cardinality']);return[{..._0x3a5d58!==undefined&&Number['isInteger'](_0x3a5d58)&&_0x3a5d58>0x0?{'relationId':_0x3a5d58}:{},'from':{'source':_0x4845f0[_0x501aed(0x19b)],'datasetCode':_0x4845f0[_0x501aed(0x194)],..._0x4845f0['name']?{'datasetName':_0x4845f0[_0x501aed(0x192)]}:{},..._0x4845f0[_0x501aed(0x1c1)]?{'table':_0x4845f0[_0x501aed(0x1c1)]}:{},'field':_0x1def0b},'to':{'source':_0x4cd9d6,'datasetCode':_0x2a95f0,'datasetName':_0x593b23?.[_0x501aed(0x192)]??trim(_0x55db23[_0x501aed(0x1a8)]),..._0x4cd9d6==='DB_TABLE'&&_0x593b23?.[_0x501aed(0x1c1)]?{'table':_0x593b23[_0x501aed(0x1c1)]}:{},'field':_0x182414,..._0x564c2c?{'labelField':_0x564c2c}:{}},'relation':{..._0x1e92d0?{'cardinality':_0x1e92d0}:{},'bizRelationType':isMainSubRelation(_0x55db23[_0x501aed(0x1bd)])?_0x501aed(0x18b):null}}];});});return{'appCode':_0x32f802[_0x4719a5(0x1b4)],..._0x3ecce2?{'datasetCode':_0x3ecce2}:{},'relations':_0x17bb19,'detailByCode':_0x4835bd,'listByCode':_0x3e2dca};}export function toDatasetInfo(_0x409bf3,_0xc4da55){const _0x3576c5=a74_0x51bb99,_0x524839=_0x409bf3['dataset']??{},_0x321a53=_0x409bf3['dbtableConfig']??_0xc4da55?.['dbtableConfig']??{},_0x2c1ac1=datasetCodeOf(_0x409bf3)||datasetCodeOf(_0xc4da55??{});return{'code':_0x2c1ac1,'name':_0x409bf3[_0x3576c5(0x192)]??_0x524839[_0x3576c5(0x1d0)]??_0xc4da55?.[_0x3576c5(0x192)],'source':sourceOf(_0x409bf3[_0x3576c5(0x19b)]??_0x524839['sourceType']??_0xc4da55?.['source'],_0x321a53[_0x3576c5(0x1ac)]),'table':_0x321a53['tableName']??_0x524839['tableName'],'doVersion':_0x409bf3['doVersion']??_0x524839[_0x3576c5(0x1a1)]??_0xc4da55?.['doVersion'],'detail':_0x409bf3};}export function datasetCodeOf(_0x2b9694){const _0x531e44=a74_0x51bb99;return trim(_0x2b9694['modelCode']??_0x2b9694[_0x531e44(0x194)]??_0x2b9694[_0x531e44(0x197)]);}export function sourceOf(_0x252f5f,_0x262561){const _0x416c43=a74_0x51bb99,_0x8db0c1=trim(_0x252f5f)['toUpperCase']();if(_0x8db0c1==='DB_TABLE'||_0x8db0c1===_0x416c43(0x1bb))return _0x8db0c1;return _0x262561?_0x416c43(0x18f):_0x416c43(0x1bb);}export function readSourceFilter(_0x8d5cc8,_0x359f89){const _0x25a969=a74_0x51bb99,_0x4d473f=trim(_0x8d5cc8)[_0x25a969(0x1a4)]();if(!_0x4d473f)return undefined;if(_0x4d473f==='DB_TABLE'||_0x4d473f==='METADATA')return _0x4d473f;throw CliErrors['validation'](_0x25a969(0x1ce)+_0x359f89+':\x20'+_0x8d5cc8,'Allowed\x20values:\x20DB_TABLE,\x20METADATA.');}function rejectUnsupportedDirection(_0x14cddf,_0x2a729f){const _0x18f945=a74_0x51bb99;if(_0x14cddf===_0x18f945(0x1bb)&&_0x2a729f===_0x18f945(0x18f))throw CliErrors['validation'](_0x18f945(0x1be));}function normalizeDoVersion(_0x1bb765){const _0x564c18=a74_0x51bb99;return trim(_0x1bb765)[_0x564c18(0x193)]();}function normalizeCardinality(_0xc538f){const _0x532769=a74_0x51bb99,_0x48080f=trim(_0xc538f)[_0x532769(0x1a4)]();if(!_0x48080f)return undefined;return['ONE_TO_ONE',_0x532769(0x191),'MANY_TO_ONE',_0x532769(0x1b8)][_0x532769(0x18d)](_0x48080f)?_0x48080f:undefined;}function readRelationLabelField(_0x3cb384){const _0x443e76=a74_0x51bb99;return trim(_0x3cb384[_0x443e76(0x1a3)]??_0x3cb384[_0x443e76(0x1cb)]??_0x3cb384[_0x443e76(0x1c6)]);}export function trim(_0x361da0){const _0x292951=a74_0x51bb99;return typeof _0x361da0===_0x292951(0x1b7)?_0x361da0[_0x292951(0x19f)]():'';}export function isMainSubRelation(_0x40a4ac){const _0x2246ce=a74_0x51bb99;return trim(_0x40a4ac)[_0x2246ce(0x193)]()===_0x2246ce(0x18b);}
|
|
1
|
+
const a74_0x18e093=a74_0x4f4f;(function(_0x546015,_0x5c16d8){const _0x594802=a74_0x4f4f,_0x4ceed0=_0x546015();while(!![]){try{const _0x170e3c=-parseInt(_0x594802(0xf3))/0x1*(-parseInt(_0x594802(0xf0))/0x2)+-parseInt(_0x594802(0xb4))/0x3*(parseInt(_0x594802(0xf7))/0x4)+-parseInt(_0x594802(0xe9))/0x5+parseInt(_0x594802(0xc2))/0x6+-parseInt(_0x594802(0xf9))/0x7*(-parseInt(_0x594802(0xc6))/0x8)+parseInt(_0x594802(0xf4))/0x9+-parseInt(_0x594802(0xbd))/0xa;if(_0x170e3c===_0x5c16d8)break;else _0x4ceed0['push'](_0x4ceed0['shift']());}catch(_0x3f9b16){_0x4ceed0['push'](_0x4ceed0['shift']());}}}(a74_0x3fa1,0x5a746));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';export const SOURCE_TYPES=[a74_0x18e093(0xd8),a74_0x18e093(0xfc)];const DEFAULT_DO_VERSION='v2';export const datasetRelations={'service':a74_0x18e093(0xdc),'command':a74_0x18e093(0xc4),'description':a74_0x18e093(0xfb)+a74_0x18e093(0xdd),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a74_0x18e093(0xbf),'type':a74_0x18e093(0xef),'required':![],'enum':[...SOURCE_TYPES],'description':a74_0x18e093(0xc3)},{'name':a74_0x18e093(0xd6),'type':a74_0x18e093(0xef),'required':![],'enum':[...SOURCE_TYPES],'description':a74_0x18e093(0xd7)},{'name':a74_0x18e093(0xc1),'type':a74_0x18e093(0xef),'required':![],'enum':['v1','v2'],'description':'Legacy\x20troubleshooting\x20filter\x20for\x20dataset\x20version;\x20defaults\x20to\x20v2'}],async 'validate'(_0x5d91f1){const _0x14ac5a=a74_0x18e093;readSourceFilter(_0x5d91f1[_0x14ac5a(0xf1)]('from-source'),_0x14ac5a(0x104)),readSourceFilter(_0x5d91f1[_0x14ac5a(0xf1)]('to-source'),_0x14ac5a(0xd4)),rejectUnsupportedDirection(readSourceFilter(_0x5d91f1['str'](_0x14ac5a(0xbf)),_0x14ac5a(0x104)),readSourceFilter(_0x5d91f1[_0x14ac5a(0xf1)](_0x14ac5a(0xd6)),'--to-source'));},async 'execute'(_0x8776af){const _0x2f153b=a74_0x18e093,_0x542c18=await collectDatasetRelationFacts(_0x8776af);return{'ok':!![],'data':{'appCode':_0x8776af[_0x2f153b(0xf6)],'total':_0x542c18[_0x2f153b(0xc4)]['length'],'relations':_0x542c18['relations']},'message':_0x2f153b(0xe2)+_0x542c18[_0x2f153b(0xc4)][_0x2f153b(0xd9)]+_0x2f153b(0xfa)};}};export async function collectDatasetRelationFacts(_0x3cd3b3,_0xb20801){const _0x15a5fa=a74_0x18e093,_0x1e869b=trim(_0x3cd3b3[_0x15a5fa(0xf1)](_0x15a5fa(0xfd))),_0x415ee9=readSourceFilter(_0x3cd3b3['str'](_0x15a5fa(0xbf)),_0x15a5fa(0x104)),_0x16692f=readSourceFilter(_0x3cd3b3['str'](_0x15a5fa(0xd6)),_0x15a5fa(0xd4)),_0x1129e1=trim(_0x3cd3b3[_0x15a5fa(0xf1)]('do-version')||DEFAULT_DO_VERSION)[_0x15a5fa(0xb9)]();!_0xb20801?.['includeUnsupportedDirections']&&rejectUnsupportedDirection(_0x415ee9,_0x16692f);const _0x24ed29=await listDatasets(_0x3cd3b3['appCode'],{..._0x1e869b?{'code':_0x1e869b}:{}}),_0x2fe68b=new Map();for(const _0xe4345b of _0x24ed29){const _0x30275b=datasetCodeOf(_0xe4345b);if(_0x30275b)_0x2fe68b[_0x15a5fa(0xd1)](_0x30275b,_0xe4345b);}const _0x1ea8b3=_0x1e869b?[toDatasetInfo(await getDatasetDetail(_0x1e869b),_0x2fe68b['get'](_0x1e869b))]:await Promise['all'](_0x24ed29['map'](async _0x5809c3=>toDatasetInfo(await getDatasetDetail(datasetCodeOf(_0x5809c3)),_0x5809c3))),_0x38eac8=_0x1ea8b3[_0x15a5fa(0xe7)](_0x3ff08d=>{const _0x4cb557=_0x15a5fa;if(_0x1129e1&&normalizeDoVersion(_0x3ff08d[_0x4cb557(0xce)])!==_0x1129e1)return![];return!![];}),_0x340708=new Map(_0x38eac8[_0x15a5fa(0xcd)](_0x31d850=>[_0x31d850['code'],_0x31d850]));if(_0x1e869b){const _0x335f9c=new Set(_0x38eac8[_0x15a5fa(0xf8)](_0x9f326c=>Array[_0x15a5fa(0x102)](_0x9f326c[_0x15a5fa(0xe1)]['relations'])?_0x9f326c[_0x15a5fa(0xe1)][_0x15a5fa(0xc4)]:[])[_0x15a5fa(0xcd)](_0xe59cc1=>trim(_0xe59cc1[_0x15a5fa(0xb8)]??_0xe59cc1[_0x15a5fa(0xd5)]??_0xe59cc1[_0x15a5fa(0xbc)]??_0xe59cc1['targetDatasetCode']))[_0x15a5fa(0xe7)](_0x5b2e93=>_0x5b2e93&&!_0x340708[_0x15a5fa(0xba)](_0x5b2e93)));await Promise[_0x15a5fa(0xe0)]([..._0x335f9c][_0x15a5fa(0xcd)](async _0x494675=>{const _0x1b4b64=_0x15a5fa,_0x49f271=await getDatasetDetail(_0x494675)[_0x1b4b64(0xff)](()=>null);if(!_0x49f271||typeof _0x49f271!=='object')return;const _0x29e25f=toDatasetInfo(_0x49f271);if(_0x29e25f['code'])_0x340708[_0x1b4b64(0xd1)](_0x29e25f[_0x1b4b64(0x105)],_0x29e25f);}));}const _0x2b7212=_0x38eac8['flatMap'](_0x345e3e=>{const _0x273074=_0x15a5fa,_0x315faa=Array['isArray'](_0x345e3e['detail'][_0x273074(0xc4)])?_0x345e3e['detail'][_0x273074(0xc4)]:[];return _0x315faa[_0x273074(0xf8)](_0x2c7baa=>{const _0x40a6b4=_0x273074,_0x2776bc=trim(_0x2c7baa[_0x40a6b4(0xbe)]??_0x2c7baa[_0x40a6b4(0xf5)]??_0x2c7baa['field']),_0x22ac91=trim(_0x2c7baa['toDatasetCode']??_0x2c7baa[_0x40a6b4(0xd5)]??_0x2c7baa[_0x40a6b4(0xbc)]??_0x2c7baa['targetDatasetCode']),_0x9e0b95=trim(_0x2c7baa[_0x40a6b4(0xe6)]??_0x2c7baa[_0x40a6b4(0xcb)]??_0x2c7baa[_0x40a6b4(0xe5)]);if(!_0x2776bc||!_0x22ac91||!_0x9e0b95)return[];const _0x209e24=_0x340708[_0x40a6b4(0x103)](_0x22ac91)??(_0x2fe68b[_0x40a6b4(0xba)](_0x22ac91)?toDatasetInfo(_0x2fe68b[_0x40a6b4(0x103)](_0x22ac91)??{},_0x2fe68b[_0x40a6b4(0x103)](_0x22ac91)):undefined),_0x464f0a=_0x209e24?.['source']??sourceOf(_0x2c7baa[_0x40a6b4(0xe3)]??_0x2c7baa[_0x40a6b4(0xbb)]??_0x2c7baa[_0x40a6b4(0xc7)],_0x2c7baa[_0x40a6b4(0xd0)]);if(_0x345e3e[_0x40a6b4(0xc0)]===_0x40a6b4(0xfc)&&_0x464f0a===_0x40a6b4(0xd8)&&!_0xb20801?.[_0x40a6b4(0xc8)])return[];if(_0x415ee9&&_0x345e3e[_0x40a6b4(0xc0)]!==_0x415ee9)return[];if(_0x16692f&&_0x464f0a!==_0x16692f)return[];const _0x2b961e=readRelationLabelField(_0x2c7baa),_0x3b73c1=_0x2c7baa[_0x40a6b4(0xcc)],_0x19d3fb=typeof _0x3b73c1===_0x40a6b4(0xe4)||typeof _0x3b73c1===_0x40a6b4(0xef)?Number(_0x3b73c1):undefined,_0x30745e=normalizeCardinality(_0x2c7baa[_0x40a6b4(0xed)]);return[{..._0x19d3fb!==undefined&&Number[_0x40a6b4(0xfe)](_0x19d3fb)&&_0x19d3fb>0x0?{'relationId':_0x19d3fb}:{},'from':{'source':_0x345e3e['source'],'datasetCode':_0x345e3e[_0x40a6b4(0x105)],..._0x345e3e[_0x40a6b4(0xdb)]?{'datasetName':_0x345e3e[_0x40a6b4(0xdb)]}:{},..._0x345e3e['table']?{'table':_0x345e3e[_0x40a6b4(0xc5)]}:{},'field':_0x2776bc},'to':{'source':_0x464f0a,'datasetCode':_0x22ac91,'datasetName':_0x209e24?.['name']??trim(_0x2c7baa[_0x40a6b4(0x106)]),..._0x464f0a===_0x40a6b4(0xd8)&&_0x209e24?.[_0x40a6b4(0xc5)]?{'table':_0x209e24[_0x40a6b4(0xc5)]}:{},'field':_0x9e0b95,..._0x2b961e?{'labelField':_0x2b961e}:{}},'relation':{..._0x30745e?{'cardinality':_0x30745e}:{},'bizRelationType':isMainSubRelation(_0x2c7baa[_0x40a6b4(0x101)])?_0x40a6b4(0xb7):null}}];});});return{'appCode':_0x3cd3b3[_0x15a5fa(0xf6)],..._0x1e869b?{'datasetCode':_0x1e869b}:{},'relations':_0x2b7212,'detailByCode':_0x340708,'listByCode':_0x2fe68b};}export function toDatasetInfo(_0x37c777,_0x38427d){const _0x4e2f62=a74_0x18e093,_0x191022=_0x37c777[_0x4e2f62(0xdc)]??{},_0xa81aea=_0x37c777[_0x4e2f62(0xdf)]??_0x38427d?.[_0x4e2f62(0xdf)]??{},_0x5f0a58=datasetCodeOf(_0x37c777)||datasetCodeOf(_0x38427d??{});return{'code':_0x5f0a58,'name':_0x37c777[_0x4e2f62(0xdb)]??_0x191022[_0x4e2f62(0xcf)]??_0x38427d?.[_0x4e2f62(0xdb)],'source':sourceOf(_0x37c777[_0x4e2f62(0xc0)]??_0x191022[_0x4e2f62(0xc7)]??_0x38427d?.['source'],_0xa81aea[_0x4e2f62(0xb5)]),'table':_0xa81aea[_0x4e2f62(0xb5)]??_0x191022[_0x4e2f62(0xb5)],'doVersion':_0x37c777['doVersion']??_0x191022[_0x4e2f62(0xce)]??_0x38427d?.[_0x4e2f62(0xce)],'detail':_0x37c777};}export function datasetCodeOf(_0x1fd1e9){const _0x211101=a74_0x18e093;return trim(_0x1fd1e9[_0x211101(0xb6)]??_0x1fd1e9['code']??_0x1fd1e9[_0x211101(0xd3)]);}export function sourceOf(_0x5b9612,_0x278fb8){const _0x173ba9=a74_0x18e093,_0x2252db=trim(_0x5b9612)[_0x173ba9(0xf2)]();if(_0x2252db==='DB_TABLE'||_0x2252db===_0x173ba9(0xfc))return _0x2252db;return _0x278fb8?_0x173ba9(0xd8):_0x173ba9(0xfc);}export function readSourceFilter(_0x1b44e8,_0x3ba8d5){const _0x51f8a3=a74_0x18e093,_0x22cd78=trim(_0x1b44e8)[_0x51f8a3(0xf2)]();if(!_0x22cd78)return undefined;if(_0x22cd78===_0x51f8a3(0xd8)||_0x22cd78===_0x51f8a3(0xfc))return _0x22cd78;throw CliErrors[_0x51f8a3(0xeb)](_0x51f8a3(0x100)+_0x3ba8d5+':\x20'+_0x1b44e8,_0x51f8a3(0xec));}function rejectUnsupportedDirection(_0x4b045f,_0xd47d66){const _0x224900=a74_0x18e093;if(_0x4b045f===_0x224900(0xfc)&&_0xd47d66===_0x224900(0xd8))throw CliErrors[_0x224900(0xeb)](_0x224900(0xde));}function normalizeDoVersion(_0x2ab6ca){return trim(_0x2ab6ca)['toLowerCase']();}function normalizeCardinality(_0x4b6d9b){const _0x2a8d23=a74_0x18e093,_0x3903c8=trim(_0x4b6d9b)[_0x2a8d23(0xf2)]();if(!_0x3903c8)return undefined;return[_0x2a8d23(0xd2),_0x2a8d23(0xca),'MANY_TO_ONE','MANY_TO_MANY'][_0x2a8d23(0xe8)](_0x3903c8)?_0x3903c8:undefined;}function readRelationLabelField(_0x12b5fd){const _0x3c293b=a74_0x18e093;return trim(_0x12b5fd[_0x3c293b(0xee)]??_0x12b5fd[_0x3c293b(0xda)]??_0x12b5fd[_0x3c293b(0xea)]);}export function trim(_0x2c2069){const _0x12eac4=a74_0x18e093;return typeof _0x2c2069===_0x12eac4(0xef)?_0x2c2069[_0x12eac4(0xc9)]():'';}function a74_0x3fa1(){const _0x115b1a=['--from-source','code','toDatasetName','3VPrUKo','tableName','modelCode','main_sub','toDatasetCode','toLowerCase','has','toSource','toDataset','4579750lraoOG','fromField','from-source','source','do-version','2452236XfFojJ','Filter\x20source\x20dataset\x20type:\x20DB_TABLE\x20or\x20METADATA','relations','table','112PLjMhV','sourceType','includeUnsupportedDirections','trim','ONE_TO_MANY','toColumn','relationId','map','doVersion','datasetName','toTableName','set','ONE_TO_ONE','datasetCode','--to-source','toCode','to-source','Filter\x20target\x20dataset\x20type:\x20DB_TABLE\x20or\x20METADATA','DB_TABLE','length','refTableLabelName','name','dataset','Supports\x20DB_TABLE\x20->\x20DB_TABLE,\x20DB_TABLE\x20->\x20METADATA,\x20and\x20METADATA\x20->\x20METADATA.','METADATA\x20to\x20DB_TABLE\x20dataset\x20relation\x20is\x20not\x20supported','dbtableConfig','all','detail','Dataset\x20relations:\x20','toSourceType','number','targetField','toField','filter','includes','1760790LAPpxO','labelField','validation','Allowed\x20values:\x20DB_TABLE,\x20METADATA.','cardinality','toFieldLabel','string','488118DFtyEs','str','toUpperCase','3ujRtqs','734823BrkMDp','fromColumn','appCode','2211972gJSqhf','flatMap','255549MzIWsu','\x20relation(s)','List\x20V2\x20dataset\x20relation\x20facts\x20using\x20datasetCode\x20+\x20field\x20as\x20the\x20primary\x20locator.\x20','METADATA','datasetcode','isInteger','catch','Invalid\x20','bizRelationType','isArray','get'];a74_0x3fa1=function(){return _0x115b1a;};return a74_0x3fa1();}function a74_0x4f4f(_0x568cf5,_0x1a34bb){_0x568cf5=_0x568cf5-0xb4;const _0x3fa1db=a74_0x3fa1();let _0x4f4fe8=_0x3fa1db[_0x568cf5];return _0x4f4fe8;}export function isMainSubRelation(_0x3fd392){const _0x545cd7=a74_0x18e093;return trim(_0x3fd392)['toLowerCase']()===_0x545cd7(0xb7);}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CommandDefinition } from "../../framework/types.js";
|
|
2
|
+
interface DatasetRenameInput {
|
|
3
|
+
code: string;
|
|
4
|
+
name: string;
|
|
5
|
+
expectName: string;
|
|
6
|
+
}
|
|
7
|
+
interface BuildDatasetRenameResultOptions {
|
|
8
|
+
input: DatasetRenameInput;
|
|
9
|
+
dryRun: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function buildDatasetRenameResult({ input, dryRun, }: BuildDatasetRenameResultOptions): Promise<{
|
|
12
|
+
ok: true;
|
|
13
|
+
data: Record<string, unknown>;
|
|
14
|
+
message: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const datasetRename: CommandDefinition;
|
|
17
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a75_0x36ff21=a75_0xeee2;(function(_0x487f90,_0x2c1be9){const _0x4f6262=a75_0xeee2,_0x38dd8b=_0x487f90();while(!![]){try{const _0x3f26f7=-parseInt(_0x4f6262(0x14a))/0x1+parseInt(_0x4f6262(0x12f))/0x2+parseInt(_0x4f6262(0x126))/0x3+parseInt(_0x4f6262(0x132))/0x4*(parseInt(_0x4f6262(0x13f))/0x5)+parseInt(_0x4f6262(0x133))/0x6*(-parseInt(_0x4f6262(0x145))/0x7)+parseInt(_0x4f6262(0x141))/0x8+parseInt(_0x4f6262(0x140))/0x9*(-parseInt(_0x4f6262(0x125))/0xa);if(_0x3f26f7===_0x2c1be9)break;else _0x38dd8b['push'](_0x38dd8b['shift']());}catch(_0x485a46){_0x38dd8b['push'](_0x38dd8b['shift']());}}}(a75_0x48e1,0xe1a22));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';export async function buildDatasetRenameResult({input:_0x524d35,dryRun:_0x4d036c}){const _0x5696c9=a75_0xeee2;validateInput(_0x524d35);const _0x567059=await getDatasetDetail(_0x524d35['code']),_0x1532c8=resolveCurrentName(_0x567059);if(_0x1532c8!==_0x524d35[_0x5696c9(0x127)])throw CliErrors['validation'](_0x5696c9(0x139),_0x5696c9(0x13b)+JSON['stringify'](_0x524d35[_0x5696c9(0x127)])+_0x5696c9(0x123)+JSON[_0x5696c9(0x149)](_0x1532c8));const _0x21686e=buildRenameRequest(_0x567059,_0x524d35),_0x549411=_0x1532c8!==_0x524d35['name'];let _0x1c779b;return _0x549411&&!_0x4d036c&&(_0x1c779b=await updateDrivenData(_0x21686e)),{'ok':!![],'data':{'dataset':{'id':_0x21686e[_0x5696c9(0x129)],'code':_0x21686e[_0x5696c9(0x144)]},'dryRun':_0x4d036c,'changed':_0x549411,'before':{'name':_0x1532c8},'after':{'name':_0x524d35[_0x5696c9(0x122)]},'request':_0x21686e,'submitted':_0x549411&&!_0x4d036c,..._0x1c779b!==undefined?{'version':_0x1c779b}:{}},'message':_0x549411?_0x4d036c?_0x5696c9(0x13e)+_0x21686e[_0x5696c9(0x144)]+_0x5696c9(0x142)+_0x524d35[_0x5696c9(0x122)]:_0x5696c9(0x13a)+_0x21686e[_0x5696c9(0x144)]+_0x5696c9(0x136)+_0x524d35[_0x5696c9(0x122)]:'No\x20changes\x20for\x20dataset\x20'+_0x21686e['modelCode']};}function a75_0x48e1(){const _0xd26e74=['data','stringify','1665141cEZXKY','request','datasetId','isArray','datasetName','name',',\x20actual\x20','/smartapi/dataset/update-driven-data','6501250MEQZtm','3066798aEqnLi','expectName','rename','modelId','validation','POST','trim','string','code','2471484AMeyWg','datasetCode','New\x20dataset\x20display\x20name','88akeXFE','6usxyPk','message','str','\x20to\x20','dataset','Dataset\x20detail\x20does\x20not\x20contain\x20dataset\x20id','Expectation\x20mismatch\x20at\x20dataset.name','Renamed\x20dataset\x20','Expected\x20','write','object','Dry-run:\x20dataset\x20','147385kSBfFj','27SpwvXz','13312440AXkdwE','\x20would\x20be\x20renamed\x20to\x20','expect-name','modelCode','215929ZeYcbE','Expected\x20current\x20dataset\x20display\x20name;\x20mismatch\x20aborts\x20without\x20writing','Rename\x20dataset\x20display\x20name\x20safely'];a75_0x48e1=function(){return _0xd26e74;};return a75_0x48e1();}export const datasetRename={'service':a75_0x36ff21(0x137),'command':a75_0x36ff21(0x128),'description':a75_0x36ff21(0x147),'risk':a75_0x36ff21(0x13c),'flags':[CODE_FLAG,{'name':a75_0x36ff21(0x122),'type':'string','required':!![],'description':a75_0x36ff21(0x131)},{'name':a75_0x36ff21(0x143),'type':a75_0x36ff21(0x12d),'required':!![],'description':a75_0x36ff21(0x146)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x124f74){validateInput(readDatasetRenameInput(_0x124f74));},async 'dryRun'(_0x28af22){const _0x4ace24=a75_0x36ff21,_0x1a77f3=await buildDatasetRenameResult({'input':readDatasetRenameInput(_0x28af22),'dryRun':!![]});return{'method':_0x4ace24(0x12b),'url':_0x4ace24(0x124),'body':_0x1a77f3['data'][_0x4ace24(0x14b)],'description':_0x1a77f3[_0x4ace24(0x134)],..._0x1a77f3[_0x4ace24(0x148)]};},async 'execute'(_0x506730){return buildDatasetRenameResult({'input':readDatasetRenameInput(_0x506730),'dryRun':![]});}};function readDatasetRenameInput(_0x15e2f7){const _0x415789=a75_0x36ff21;return{'code':trim(_0x15e2f7[_0x415789(0x135)](_0x415789(0x12e))),'name':trim(_0x15e2f7[_0x415789(0x135)](_0x415789(0x122))),'expectName':trim(_0x15e2f7['str']('expect-name'))};}function validateInput(_0x151896){const _0x10f01e=a75_0x36ff21;if(!_0x151896[_0x10f01e(0x12e)])throw CliErrors[_0x10f01e(0x12a)]('--code\x20is\x20required');if(!_0x151896[_0x10f01e(0x122)])throw CliErrors[_0x10f01e(0x12a)]('--name\x20is\x20required');if(!_0x151896[_0x10f01e(0x127)])throw CliErrors[_0x10f01e(0x12a)]('--expect-name\x20is\x20required');}function a75_0xeee2(_0x584234,_0x40ba71){_0x584234=_0x584234-0x121;const _0x48e10e=a75_0x48e1();let _0xeee238=_0x48e10e[_0x584234];return _0xeee238;}function resolveCurrentName(_0x17d520){const _0x344894=a75_0x36ff21;return String(_0x17d520['dataset']?.[_0x344894(0x121)]??_0x17d520[_0x344894(0x122)]??'')[_0x344894(0x12c)]();}function buildRenameRequest(_0xde3de,_0x4760b2){const _0x4d6b93=a75_0x36ff21,_0x2626d3=isPlainObject(_0xde3de[_0x4d6b93(0x137)])?_0xde3de[_0x4d6b93(0x137)]:{},_0x47d3f4=_0xde3de[_0x4d6b93(0x129)]??_0xde3de['id']??_0x2626d3[_0x4d6b93(0x14c)];if(_0x47d3f4===undefined||_0x47d3f4===null||_0x47d3f4==='')throw CliErrors[_0x4d6b93(0x12a)](_0x4d6b93(0x138));const _0xe96207=String(_0xde3de[_0x4d6b93(0x144)]??_0xde3de[_0x4d6b93(0x12e)]??_0x2626d3[_0x4d6b93(0x130)]??_0x4760b2[_0x4d6b93(0x12e)])[_0x4d6b93(0x12c)]();if(!_0xe96207)throw CliErrors[_0x4d6b93(0x12a)]('Dataset\x20detail\x20does\x20not\x20contain\x20dataset\x20code');return{'modelId':_0x47d3f4,'modelCode':_0xe96207,'name':_0x4760b2[_0x4d6b93(0x122)],'dataset':{'datasetId':_0x47d3f4,'datasetCode':_0xe96207,'datasetName':_0x4760b2['name']}};}function isPlainObject(_0x16d511){const _0x29b4d2=a75_0x36ff21;return Boolean(_0x16d511)&&typeof _0x16d511===_0x29b4d2(0x13d)&&!Array[_0x29b4d2(0x14d)](_0x16d511);}function trim(_0x2e3680){const _0x192c58=a75_0x36ff21;return String(_0x2e3680||'')[_0x192c58(0x12c)]();}
|