@lovrabet/rabetbase-cli 2.4.7-beta.2 → 2.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +13 -3
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.d.ts +7 -0
- package/lib/api/generate-sdk-config-file.js +1 -0
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.d.ts +2 -5
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.d.ts +5 -0
- package/lib/commands/config/delete.js +1 -0
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.d.ts +12 -0
- package/lib/commands/config/init.js +1 -0
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +1 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.d.ts +6 -2
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.d.ts +2 -2
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.d.ts +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.d.ts +10 -0
- package/lib/config/domain-config.js +1 -0
- package/lib/config/schema.d.ts +3 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.d.ts +23 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.d.ts +9 -0
- package/lib/constant/region.js +1 -0
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.d.ts +4 -6
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +2 -2
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +2 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.d.ts +11 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.d.ts +2 -2
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +28 -0
- package/lib/utils/ai_config.d.ts +1 -2
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -3
- package/skills/rabetbase/SKILL.md +33 -28
- package/skills/rabetbase/guides/backend-function.md +41 -12
- package/skills/rabetbase/guides/bff-creation-workflow.md +6 -4
- package/skills/rabetbase/guides/custom-page-workflow.md +1 -1
- package/skills/rabetbase/guides/data-api-guidelines.md +8 -8
- package/skills/rabetbase/guides/database-connection-workflow.md +8 -16
- package/skills/rabetbase/guides/menu-anomaly-manual-cleanup.md +1 -6
- package/skills/rabetbase/guides/sdk-client-generation.md +146 -0
- package/skills/rabetbase/guides/sql-creation-workflow.md +1 -1
- package/skills/rabetbase/guides/troubleshooting.md +1 -1
- package/skills/rabetbase/guides/typescript-sdk.md +46 -10
- package/skills/rabetbase/references/rabetbase-api-list.md +4 -4
- package/skills/rabetbase/references/rabetbase-api-pull.md +44 -29
- package/skills/rabetbase/references/rabetbase-app-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-auth-login.md +4 -2
- package/skills/rabetbase/references/rabetbase-bff-push.md +3 -1
- package/skills/rabetbase/references/rabetbase-codegen-sql.md +3 -1
- package/skills/rabetbase/references/rabetbase-config.md +75 -30
- package/skills/rabetbase/references/rabetbase-dataset-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-db-analyze.md +3 -3
- package/skills/rabetbase/references/rabetbase-db-detail.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +4 -4
- package/skills/rabetbase/references/rabetbase-db-diff.md +6 -9
- package/skills/rabetbase/references/rabetbase-doctor.md +1 -1
- package/skills/rabetbase/references/rabetbase-init.md +57 -51
- package/skills/rabetbase/references/rabetbase-kb.md +2 -0
- package/skills/rabetbase/references/rabetbase-page-create.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-custom-detail.md +3 -3
- package/skills/rabetbase/references/rabetbase-page-custom-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-project-create.md +12 -3
- package/skills/rabetbase/references/rabetbase-project-upgrade.md +2 -2
- package/skills/rabetbase/references/rabetbase-role-user-resolve.md +2 -2
- package/skills/rabetbase/references/rabetbase-user-account.md +1 -1
- package/skills/rabetbase/references/rabetbase-workspace.md +6 -6
- package/skills/rabetbase.manifest.json +4 -3
- package/templates/README.md +17 -28
- package/templates/generate-api/api.ts.tpl +3 -3
- package/templates/generate-api/client.ts.tpl +10 -37
- package/lib/commands/data/filter.d.ts +0 -7
- package/lib/commands/data/filter.js +0 -1
- package/lib/commands/data/getOne.d.ts +0 -7
- package/lib/commands/data/getOne.js +0 -1
- package/lib/commands/data/index.d.ts +0 -8
- package/lib/commands/data/index.js +0 -1
- package/lib/commands/data/shared.d.ts +0 -33
- package/lib/commands/data/shared.js +0 -1
- package/lib/commands/init/index.d.ts +0 -11
- package/lib/commands/init/index.js +0 -1
- package/lib/utils/rules-cdn.d.ts +0 -38
- package/lib/utils/rules-cdn.js +0 -1
- package/templates/rules/lovrabet_rules.mdc.tpl +0 -893
- package/templates/skill/SKILL.md.tpl +0 -120
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x4dc2a3=a48_0x174e;(function(_0xa83743,_0xfe0c3e){const _0x5acda7=a48_0x174e,_0x4889e8=_0xa83743();while(!![]){try{const _0x577641=parseInt(_0x5acda7(0x103))/0x1*(parseInt(_0x5acda7(0x10a))/0x2)+-parseInt(_0x5acda7(0x100))/0x3*(parseInt(_0x5acda7(0x10b))/0x4)+-parseInt(_0x5acda7(0x10d))/0x5*(parseInt(_0x5acda7(0x10c))/0x6)+parseInt(_0x5acda7(0x105))/0x7+parseInt(_0x5acda7(0xfc))/0x8+-parseInt(_0x5acda7(0x102))/0x9*(parseInt(_0x5acda7(0xfa))/0xa)+parseInt(_0x5acda7(0x107))/0xb;if(_0x577641===_0xfe0c3e)break;else _0x4889e8['push'](_0x4889e8['shift']());}catch(_0x3e0fb7){_0x4889e8['push'](_0x4889e8['shift']());}}}(a48_0x554b,0x4480f));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}(?:_[^_\s]+_[^_\s]+)?$/i,'description':'a\x2032-character\x20hex\x20code,\x20optionally\x20with\x20`_xx_xx`\x20suffix\x20(e.g.\x2099a909313f1fa7153186431e1c551588\x20or\x2099a909313f1fa7153186431e1c551588_75_3c7120aa)'};export const CODE_FLAG={'name':'code','type':a48_0x4dc2a3(0x104),'required':!![],'description':a48_0x4dc2a3(0x109),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':a48_0x4dc2a3(0x106),'description':a48_0x4dc2a3(0x109)};export const SQLCODE_FLAG={'name':a48_0x4dc2a3(0xf8),'type':a48_0x4dc2a3(0x104),'required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a48_0x4dc2a3(0xf9)}};function a48_0x554b(){const _0x18da15=['string','756693ICOYCC','datasetcode','11299332hfLIqN','boolean','Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)','50rWPVis','1451980ixYYss','30OBzjxJ','477030hbZfJF','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','appcode','dbtype','App\x20code\x20(e.g.\x20app-xxxxx)','sqlcode','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','210YrsMmF','POSTGRESQL','2259912pYnQUg','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','MYSQL','Database\x20product\x20type','3urOjEC','number','172611lUvKik','4223hqKdwR'];a48_0x554b=function(){return _0x18da15;};return a48_0x554b();}export const APPCODE_FLAG_OPTIONAL={'name':a48_0x4dc2a3(0xf5),'type':a48_0x4dc2a3(0x104),'required':![],'description':a48_0x4dc2a3(0xfd)};export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':a48_0x4dc2a3(0xf7)};function a48_0x174e(_0x1e0ed3,_0x5e0a2b){_0x1e0ed3=_0x1e0ed3-0xf4;const _0x554bf5=a48_0x554b();let _0x174ea5=_0x554bf5[_0x1e0ed3];return _0x174ea5;}export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a48_0x4dc2a3(0x101),'required':!![],'description':a48_0x4dc2a3(0xf4)};export const DB_TYPE_FLAG={'name':a48_0x4dc2a3(0xf6),'type':'string','required':!![],'description':a48_0x4dc2a3(0xff),'enum':[a48_0x4dc2a3(0xfe),a48_0x4dc2a3(0xfb)]};export const SKIP_CONNECTION_TEST_FLAG={'name':'skip-connection-test','type':a48_0x4dc2a3(0x108),'description':'Skip\x20testing\x20the\x20unsaved\x20database\x20configuration\x20before\x20create/update'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d40d5,_0x37b1ea){const _0x2472ef=a49_0x28cc,_0x16eaee=_0x4d40d5();while(!![]){try{const _0x1b3d1a=parseInt(_0x2472ef(0xa7))/0x1*(-parseInt(_0x2472ef(0xa3))/0x2)+-parseInt(_0x2472ef(0x9b))/0x3+-parseInt(_0x2472ef(0x9c))/0x4*(-parseInt(_0x2472ef(0xa9))/0x5)+-parseInt(_0x2472ef(0xa8))/0x6*(parseInt(_0x2472ef(0xa1))/0x7)+parseInt(_0x2472ef(0x9f))/0x8+parseInt(_0x2472ef(0x9e))/0x9+parseInt(_0x2472ef(0xa2))/0xa;if(_0x1b3d1a===_0x37b1ea)break;else _0x16eaee['push'](_0x16eaee['shift']());}catch(_0xe71b9){_0x16eaee['push'](_0x16eaee['shift']());}}}(a49_0x21e6,0x1d259));function a49_0x21e6(){const _0x56545e=['\x20MB','\x20path\x20is\x20required.','ceil','toFixed','202497HzBmDv','108YjgiKD','validation','1006335rPrgDX','433904QlzSlc','File\x20not\x20found:\x20','70NsDJeM','2843530YPMuSB','10cDTCce','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','size','trim','46741SkRZwg','98550GaBumi','24895xoCDXB'];a49_0x21e6=function(){return _0x56545e;};return a49_0x21e6();}import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function a49_0x28cc(_0x2ccd8d,_0x35c87f){_0x2ccd8d=_0x2ccd8d-0x97;const _0x21e68c=a49_0x21e6();let _0x28cc15=_0x21e68c[_0x2ccd8d];return _0x28cc15;}function formatBytes(_0x20dd2e){const _0x492b1f=a49_0x28cc;if(_0x20dd2e>=BYTES_PER_MB){const _0x34d51b=Math[_0x492b1f(0x99)](_0x20dd2e/BYTES_PER_MB*0x64)/0x64;return _0x34d51b[_0x492b1f(0x9a)](0x2)+_0x492b1f(0x97);}return _0x20dd2e+'\x20B';}export function requireDevelopmentUploadFile(_0x514bc3,_0x493f55){const _0x5b2a5b=a49_0x28cc,_0x168298=_0x514bc3[_0x5b2a5b(0xa6)]();if(!_0x168298)throw CliErrors[_0x5b2a5b(0x9d)](_0x493f55+_0x5b2a5b(0x98));if(!existsSync(_0x168298))throw CliErrors['validation'](_0x5b2a5b(0xa0)+_0x168298);const _0x4f465b=statSync(_0x168298);if(!_0x4f465b['isFile']())throw CliErrors[_0x5b2a5b(0x9d)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x168298);if(_0x4f465b[_0x5b2a5b(0xa5)]>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x5b2a5b(0x9d)](_0x5b2a5b(0xa4)+_0x168298+'\x20('+formatBytes(_0x4f465b['size'])+')');return{'path':_0x168298,'size':_0x4f465b['size']};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x37702e,_0xba06fc){const _0x56e1c5=a50_0x1626,_0x61a7d5=_0x37702e();while(!![]){try{const _0x2aacc8=parseInt(_0x56e1c5(0x12b))/0x1+-parseInt(_0x56e1c5(0x12a))/0x2+-parseInt(_0x56e1c5(0x133))/0x3+-parseInt(_0x56e1c5(0x12d))/0x4*(-parseInt(_0x56e1c5(0x12e))/0x5)+-parseInt(_0x56e1c5(0x130))/0x6*(-parseInt(_0x56e1c5(0x132))/0x7)+-parseInt(_0x56e1c5(0x125))/0x8*(-parseInt(_0x56e1c5(0x129))/0x9)+-parseInt(_0x56e1c5(0x12c))/0xa;if(_0x2aacc8===_0xba06fc)break;else _0x61a7d5['push'](_0x61a7d5['shift']());}catch(_0x591926){_0x61a7d5['push'](_0x61a7d5['shift']());}}}(a50_0x3821,0x7217e));function a50_0x3821(){const _0xb0f483=['trim','4502646lRBTqG','1089032QcUWWm','68653dCSvWC','10719540ZnmYME','884008ATzikh','20PHodZp','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','6QiYLdM','App\x20Code\x20cannot\x20be\x20empty','5274255QVsUxg','367872ezQqnh','8MmJWGC','test','length'];a50_0x3821=function(){return _0xb0f483;};return a50_0x3821();}function a50_0x1626(_0x10e336,_0x4a6ce6){_0x10e336=_0x10e336-0x125;const _0x382150=a50_0x3821();let _0x1626b6=_0x382150[_0x10e336];return _0x1626b6;}export function validateAppcode(_0x1af3cb){const _0xf3d765=a50_0x1626,_0x3f0d1b=_0x1af3cb[_0xf3d765(0x128)]();if(!_0x3f0d1b)return{'valid':![],'message':_0xf3d765(0x131)};if(_0x3f0d1b[_0xf3d765(0x127)]>0x64)return{'valid':![],'message':'App\x20Code\x20cannot\x20exceed\x20100\x20characters'};if(!/^[A-Za-z0-9_-]+$/[_0xf3d765(0x126)](_0x3f0d1b))return{'valid':![],'message':_0xf3d765(0x12f)};return{'valid':!![]};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a51_0x3c41(_0x490e35,_0xeea83e){_0x490e35=_0x490e35-0xea;const _0x1fe243=a51_0x1fe2();let _0x3c41b0=_0x1fe243[_0x490e35];return _0x3c41b0;}const a51_0x2d8e69=a51_0x3c41;(function(_0x499580,_0xf9dd4b){const _0x5205dd=a51_0x3c41,_0x36f0df=_0x499580();while(!![]){try{const _0x149732=parseInt(_0x5205dd(0x101))/0x1+parseInt(_0x5205dd(0x104))/0x2+parseInt(_0x5205dd(0xf1))/0x3*(-parseInt(_0x5205dd(0xf3))/0x4)+parseInt(_0x5205dd(0xfe))/0x5+parseInt(_0x5205dd(0x103))/0x6*(parseInt(_0x5205dd(0x107))/0x7)+parseInt(_0x5205dd(0x102))/0x8*(parseInt(_0x5205dd(0xfd))/0x9)+-parseInt(_0x5205dd(0xfa))/0xa*(parseInt(_0x5205dd(0xf4))/0xb);if(_0x149732===_0xf9dd4b)break;else _0x36f0df['push'](_0x36f0df['shift']());}catch(_0x41ea34){_0x36f0df['push'](_0x36f0df['shift']());}}}(a51_0x1fe2,0x2fecf));function a51_0x1fe2(){const _0x2b45b3=['1735482yQBZsi','178472SClInT','defaultApp','bool','7WSTnwo','\x22\x20is\x20not\x20deletable.','key','write','Top-level\x20key\x20\x22','prototype','Use\x20workspace\x20commands\x20to\x20modify\x20apps\x20and\x20their\x20default\x20selection.','Missing\x20key\x20argument.','inherit','Delete\x20from\x20global\x20config\x20(~/.rabetbase.json)','call','riskLevel','398127TeOKEw','has','4bKpHUk','234707iCdRPi','delete','\x20already\x20absent','trim','Top-level\x20config\x20key;\x20legacy\x20inherit\x20is\x20accepted\x20for\x20migration','config','410efQfxB','global','validation','27aooniS','964110fpCfzD','Global','Project','299068GOwOVJ','889216yNWwfw'];a51_0x1fe2=function(){return _0x2b45b3;};return a51_0x1fe2();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,isTopLevelConfigKey,readScopedConfig,resolveWriteScope,writeScopedConfig}from'../../commands/config/shared.js';const LEGACY_DELETABLE_KEYS=new Set([a51_0x2d8e69(0xed)]),EXTRA_DELETABLE_KEYS=new Set([a51_0x2d8e69(0x105)]);async function execute(_0x4c9d7c){const _0x55f742=a51_0x2d8e69,_0x21a12f=_0x4c9d7c['args'][0x0]?.[_0x55f742(0xf7)]();if(!_0x21a12f)throw CliErrors['validation'](_0x55f742(0xec),'Usage:\x20'+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');if(_0x21a12f===_0x55f742(0xf0))throw CliErrors[_0x55f742(0xfc)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(!isTopLevelConfigKey(_0x21a12f)&&!EXTRA_DELETABLE_KEYS[_0x55f742(0xf2)](_0x21a12f)&&!LEGACY_DELETABLE_KEYS[_0x55f742(0xf2)](_0x21a12f))throw CliErrors[_0x55f742(0xfc)](_0x55f742(0x10b)+_0x21a12f+_0x55f742(0x108),_0x55f742(0xeb));const _0x2a2f1d=resolveWriteScope({'global':_0x4c9d7c[_0x55f742(0x106)]('global')}),_0x3a51eb=readScopedConfig(_0x2a2f1d),_0x47f8cd=Object[_0x55f742(0xea)]['hasOwnProperty'][_0x55f742(0xef)](_0x3a51eb,_0x21a12f);_0x47f8cd&&(delete _0x3a51eb[_0x21a12f],writeScopedConfig(_0x3a51eb,_0x2a2f1d));const _0x53cad1=_0x2a2f1d==='global'?_0x55f742(0xff):_0x55f742(0x100);return{'ok':!![],'message':_0x47f8cd?'✓\x20'+_0x53cad1+'\x20'+_0x21a12f+'\x20deleted':'✓\x20'+_0x53cad1+'\x20'+_0x21a12f+_0x55f742(0xf6),'data':{'key':_0x21a12f,'scope':_0x2a2f1d,'changed':_0x47f8cd}};}export const configDeleteDefinition={'service':a51_0x2d8e69(0xf9),'command':a51_0x2d8e69(0xf5),'description':'Delete\x20a\x20config\x20value\x20from\x20one\x20scope','risk':a51_0x2d8e69(0x10a),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a51_0x2d8e69(0x109),'description':a51_0x2d8e69(0xf8),'required':!![]}],'flags':[{'name':a51_0x2d8e69(0xfb),'type':'boolean','description':a51_0x2d8e69(0xee),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a52_0x54f525=a52_0x29d5;(function(_0x25c677,_0x14c0dc){const _0x3a6edd=a52_0x29d5,_0x57b60d=_0x25c677();while(!![]){try{const _0x4da561=parseInt(_0x3a6edd(0xc6))/0x1*(parseInt(_0x3a6edd(0xbe))/0x2)+-parseInt(_0x3a6edd(0xc4))/0x3*(-parseInt(_0x3a6edd(0xc1))/0x4)+parseInt(_0x3a6edd(0xbf))/0x5+parseInt(_0x3a6edd(0xc7))/0x6*(parseInt(_0x3a6edd(0xc2))/0x7)+parseInt(_0x3a6edd(0xb6))/0x8+parseInt(_0x3a6edd(0xc0))/0x9+-parseInt(_0x3a6edd(0xb5))/0xa;if(_0x4da561===_0x14c0dc)break;else _0x57b60d['push'](_0x57b60d['shift']());}catch(_0x30e497){_0x57b60d['push'](_0x57b60d['shift']());}}}(a52_0x2e72,0x9f153));import{CliErrors}from'../../errors.js';import{readConfig}from'../../utils/config.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a52_0x29d5(_0x434bcf,_0x395994){_0x434bcf=_0x434bcf-0xb5;const _0x2e7203=a52_0x2e72();let _0x29d528=_0x2e7203[_0x434bcf];return _0x29d528;}import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';async function execute(_0xe158d4){const _0x46445a=a52_0x29d5,_0x21eec6=_0xe158d4['str']('key');if(!_0x21eec6)throw CliErrors[_0x46445a(0xc3)](_0x46445a(0xbc),_0x46445a(0xc5)+CLI_BIN_NAME+_0x46445a(0xb7));const _0x4d106c=readConfig(),_0x5554b1=_0x21eec6===_0x46445a(0xbb)?_0x46445a(0xc8):_0x21eec6,_0xd8ca11=_0x4d106c[_0x5554b1];if(_0xd8ca11===undefined)throw CliErrors[_0x46445a(0xc3)](_0x46445a(0xbd)+_0x21eec6);return{'ok':!![],'data':typeof _0xd8ca11===_0x46445a(0xc9)?_0xd8ca11:{[_0x5554b1]:_0xd8ca11},'message':typeof _0xd8ca11===_0x46445a(0xc9)?undefined:String(_0xd8ca11)};}export const configGetDefinition={'service':'config','command':a52_0x54f525(0xb8),'description':'Get\x20a\x20config\x20value\x20by\x20key','risk':a52_0x54f525(0xca),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a52_0x54f525(0xb9),'type':a52_0x54f525(0xba),'description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};function a52_0x2e72(){const _0x567c2a=['11578464rMBKML','4qSpnAr','63vIoshh','validation','1822167gVEyxX','Usage:\x20','382486SJLBcA','17964wMhWZg','appcode','object','read','40554990udlKec','7013584jzLMRG','\x20config\x20get\x20--key\x20<key>','get','key','string','app','Missing\x20key.','Key\x20not\x20found:\x20','4SAHVxj','5723005LEqOLZ'];a52_0x2e72=function(){return _0x567c2a;};return a52_0x2e72();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a53_0x21ef(_0x4eb6ce,_0x5cb823){_0x4eb6ce=_0x4eb6ce-0x1ec;const _0x42ee12=a53_0x42ee();let _0x21efae=_0x42ee12[_0x4eb6ce];return _0x21efae;}(function(_0xa9ea39,_0x1f836f){const _0x29f717=a53_0x21ef,_0x20f49a=_0xa9ea39();while(!![]){try{const _0xce7dc4=parseInt(_0x29f717(0x1ed))/0x1+parseInt(_0x29f717(0x1f0))/0x2*(-parseInt(_0x29f717(0x1f3))/0x3)+parseInt(_0x29f717(0x1f6))/0x4*(parseInt(_0x29f717(0x1f1))/0x5)+-parseInt(_0x29f717(0x1f4))/0x6*(-parseInt(_0x29f717(0x1ec))/0x7)+-parseInt(_0x29f717(0x1ee))/0x8*(parseInt(_0x29f717(0x1f2))/0x9)+-parseInt(_0x29f717(0x1ef))/0xa+parseInt(_0x29f717(0x1f5))/0xb;if(_0xce7dc4===_0x1f836f)break;else _0x20f49a['push'](_0x20f49a['shift']());}catch(_0x8e1bfb){_0x20f49a['push'](_0x20f49a['shift']());}}}(a53_0x42ee,0x3d327));import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';import{configSetDefinition}from'../../commands/config/set.js';import{configDeleteDefinition}from'../../commands/config/delete.js';import{configInitDefinition}from'../../commands/config/init.js';function a53_0x42ee(){const _0x1980fa=['1464323ulDcZt','116989etMmQv','16gkIzNc','2087970dyBUDV','477046NeWEBy','787805rqablA','1589040vxqjrh','3RRLIPg','6NOEUFp','4507833TYiSsv','8RCzVBj'];a53_0x42ee=function(){return _0x1980fa;};return a53_0x42ee();}export const configDefinitions=[configInitDefinition,configListDefinition,configGetDefinition,configSetDefinition,configDeleteDefinition];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandDefinition, FlagDef, RuntimeContext } from "../../framework/types.js";
|
|
2
|
+
export declare const configInitFlags: FlagDef[];
|
|
3
|
+
export declare function executeConfigInit(ctx: RuntimeContext): Promise<{
|
|
4
|
+
ok: boolean;
|
|
5
|
+
message: string;
|
|
6
|
+
data: {
|
|
7
|
+
mode: string;
|
|
8
|
+
region: "global" | "id" | "cn" | null;
|
|
9
|
+
domains: Partial<Record<"apiDomain" | "userDomain" | "runtimeDomain" | "skillDomain" | "kbDomain" | "appDomain", string>>;
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
export declare const configInitDefinition: CommandDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a54_0x2ca7ee=a54_0x4744;(function(_0xdab618,_0x4a534b){const _0x1b4bd0=a54_0x4744,_0x3b7177=_0xdab618();while(!![]){try{const _0x180510=-parseInt(_0x1b4bd0(0x1e0))/0x1*(-parseInt(_0x1b4bd0(0x1c7))/0x2)+parseInt(_0x1b4bd0(0x1cd))/0x3*(parseInt(_0x1b4bd0(0x1ca))/0x4)+parseInt(_0x1b4bd0(0x1d5))/0x5+-parseInt(_0x1b4bd0(0x1d7))/0x6+parseInt(_0x1b4bd0(0x1c4))/0x7*(-parseInt(_0x1b4bd0(0x1dc))/0x8)+parseInt(_0x1b4bd0(0x1d3))/0x9*(parseInt(_0x1b4bd0(0x1c9))/0xa)+-parseInt(_0x1b4bd0(0x1d8))/0xb*(parseInt(_0x1b4bd0(0x1c3))/0xc);if(_0x180510===_0x4a534b)break;else _0x3b7177['push'](_0x3b7177['shift']());}catch(_0x431555){_0x3b7177['push'](_0x3b7177['shift']());}}}(a54_0x1323,0xc9c14));import{select}from'@inquirer/prompts';import{CliErrors}from'../../errors.js';function a54_0x1323(){const _0x55bc7b=['3fXvtVl','validation','Region\x20\x22','\x22\x20is\x20not\x20currently\x20available.','length','keys','1753821NvrBqC','api-domain','6670060LAtAnO','Select\x20Lovrabet\x20region','663372xwYclg','33094633MywUKp','domain-config','Custom\x20knowledge-base\x20HTTPS\x20origin','region','296AIkqLA','cancelled','str','user-domain','156EYgnks','Independent-deployment\x20Domain\x20JSON\x20file','Initialize\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domains','Official\x20Lovrabet\x20region:\x20cn\x20or\x20id','nonInteractive','Rabetbase\x20connection\x20configured\x20for\x20independent\x20deployment.\x20Domains:\x20','kb-domain','write','Custom\x20Lovrabet\x20workspace\x20HTTPS\x20origin','official','Mainland\x20China\x20(cn)','Custom\x20User\x20HTTPS\x20origin','Available\x20regions:\x20','join','ExitPromptError','12dApZcj','30667SeZJGs','string','global','14068YIhevd','init','70WioVay','1249004TZkfFn','Custom\x20platform\x20API\x20HTTPS\x20origin','Custom\x20Runtime\x20HTTPS\x20origin'];a54_0x1323=function(){return _0x55bc7b;};return a54_0x1323();}import{readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{DOMAIN_CONFIG_FIELDS,LEGACY_DOMAIN_CONFIG_FIELDS,resolveDomainFlags}from'../../config/domain-config.js';import{DEFAULT_LOVRABET_REGION,ENABLED_LOVRABET_REGION_VALUES,isEnabledLovrabetRegion}from'../../constant/region.js';export const configInitFlags=[{'name':'region','type':a54_0x2ca7ee(0x1c5),'description':a54_0x2ca7ee(0x1e3),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},{'name':a54_0x2ca7ee(0x1d9),'type':a54_0x2ca7ee(0x1c5),'description':a54_0x2ca7ee(0x1e1)},{'name':a54_0x2ca7ee(0x1df),'type':a54_0x2ca7ee(0x1c5),'description':a54_0x2ca7ee(0x1eb)},{'name':a54_0x2ca7ee(0x1d4),'type':a54_0x2ca7ee(0x1c5),'description':a54_0x2ca7ee(0x1cb)},{'name':'runtime-domain','type':a54_0x2ca7ee(0x1c5),'description':a54_0x2ca7ee(0x1cc)},{'name':'skill-domain','type':a54_0x2ca7ee(0x1c5),'description':'Custom\x20SkillHub\x20HTTPS\x20origin'},{'name':a54_0x2ca7ee(0x1e6),'type':a54_0x2ca7ee(0x1c5),'description':a54_0x2ca7ee(0x1da)},{'name':'app-domain','type':'string','description':a54_0x2ca7ee(0x1e8)}];function a54_0x4744(_0x20ff9a,_0xa7e495){_0x20ff9a=_0x20ff9a-0x1c2;const _0x1323e5=a54_0x1323();let _0x4744d5=_0x1323e5[_0x20ff9a];return _0x4744d5;}async function resolveRegion(_0x4d541f){const _0xd0b162=a54_0x2ca7ee,_0x39a946=_0x4d541f['str'](_0xd0b162(0x1db));if(_0x39a946){if(!isEnabledLovrabetRegion(_0x39a946))throw CliErrors[_0xd0b162(0x1ce)](_0xd0b162(0x1cf)+_0x39a946+_0xd0b162(0x1d0),_0xd0b162(0x1ec)+ENABLED_LOVRABET_REGION_VALUES['join'](',\x20'));return _0x39a946;}if(_0x4d541f[_0xd0b162(0x1e4)])return DEFAULT_LOVRABET_REGION;try{return await select({'message':_0xd0b162(0x1d6),'default':DEFAULT_LOVRABET_REGION,'choices':[{'name':_0xd0b162(0x1ea),'value':'cn'},{'name':'Indonesia\x20(id)','value':'id'}]});}catch(_0x206e7f){if(_0x206e7f?.['name']===_0xd0b162(0x1c2))throw CliErrors[_0xd0b162(0x1dd)]();throw _0x206e7f;}}export async function executeConfigInit(_0x14dc56){const _0x1759ff=a54_0x2ca7ee,_0x2f6ff3=resolveDomainFlags(_0x14dc56),_0x3f7843=Object[_0x1759ff(0x1d2)](_0x2f6ff3)[_0x1759ff(0x1d1)]>0x0;if(_0x3f7843&&_0x14dc56[_0x1759ff(0x1de)](_0x1759ff(0x1db)))throw CliErrors['validation']('Choose\x20either\x20an\x20official\x20region\x20or\x20independent-deployment\x20Domains,\x20not\x20both.');const _0x4d885a=readScopedConfig('global');for(const _0x1a96d6 of DOMAIN_CONFIG_FIELDS)delete _0x4d885a[_0x1a96d6];for(const _0x5cf382 of LEGACY_DOMAIN_CONFIG_FIELDS)delete _0x4d885a[_0x5cf382];let _0x2b015a=null;if(_0x3f7843)delete _0x4d885a[_0x1759ff(0x1db)],Object['assign'](_0x4d885a,_0x2f6ff3);else{_0x2b015a=await resolveRegion(_0x14dc56);if(_0x2b015a===DEFAULT_LOVRABET_REGION)delete _0x4d885a[_0x1759ff(0x1db)];else _0x4d885a[_0x1759ff(0x1db)]=_0x2b015a;}return writeScopedConfig(_0x4d885a,_0x1759ff(0x1c6)),{'ok':!![],'message':_0x3f7843?_0x1759ff(0x1e5)+Object[_0x1759ff(0x1d2)](_0x2f6ff3)[_0x1759ff(0x1ed)](',\x20')+'.':'Rabetbase\x20connection\x20configured\x20for\x20region:\x20'+_0x2b015a+'.','data':{'mode':_0x3f7843?'independent':_0x1759ff(0x1e9),'region':_0x2b015a,'domains':_0x2f6ff3}};}export const configInitDefinition={'service':'config','command':a54_0x2ca7ee(0x1c8),'description':a54_0x2ca7ee(0x1e2),'risk':a54_0x2ca7ee(0x1e7),'confirmationDescription':'Updates\x20the\x20global\x20Rabetbase\x20region\x20or\x20independent-deployment\x20domain\x20configuration.\x20Cookie,\x20output\x20format,\x20and\x20app\x20bindings\x20stay\x20unchanged.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':configInitFlags,'execute':executeConfigInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a55_0x613b9f=a55_0x133f;(function(_0x33b6ce,_0x5ecec6){const _0x27ec2b=a55_0x133f,_0x2acc6b=_0x33b6ce();while(!![]){try{const _0x32ad72=-parseInt(_0x27ec2b(0x1bb))/0x1+-parseInt(_0x27ec2b(0x1bd))/0x2*(parseInt(_0x27ec2b(0x1b6))/0x3)+-parseInt(_0x27ec2b(0x1b5))/0x4*(-parseInt(_0x27ec2b(0x1bc))/0x5)+parseInt(_0x27ec2b(0x1b4))/0x6+-parseInt(_0x27ec2b(0x1b9))/0x7*(-parseInt(_0x27ec2b(0x1c0))/0x8)+parseInt(_0x27ec2b(0x1ba))/0x9+-parseInt(_0x27ec2b(0x1b2))/0xa*(-parseInt(_0x27ec2b(0x1bf))/0xb);if(_0x32ad72===_0x5ecec6)break;else _0x2acc6b['push'](_0x2acc6b['shift']());}catch(_0x414e15){_0x2acc6b['push'](_0x2acc6b['shift']());}}}(a55_0x4aba,0xc4c72));import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';async function execute(_0x4e951a){const _0x29f4bd=a55_0x133f,_0x113305=_0x4e951a['bool'](_0x29f4bd(0x1b7))?readScopedConfig('global'):readConfig();return{'ok':!![],'data':_0x113305};}function a55_0x133f(_0x1ff9b6,_0x50b1e5){_0x1ff9b6=_0x1ff9b6-0x1b2;const _0x4aba17=a55_0x4aba();let _0x133f7e=_0x4aba17[_0x1ff9b6];return _0x133f7e;}function a55_0x4aba(){const _0x4416db=['1002749MZqTua','225FatgAM','482xXjsxp','List\x20all\x20config\x20values','322685QtrPym','8OhDzAx','20fQgHXR','list','5914038qjcjRK','50584vTHYzL','7233CbCqeR','global','read','2789311EQkOQn','3401244fGplqv'];a55_0x4aba=function(){return _0x4416db;};return a55_0x4aba();}export const configListDefinition={'service':'config','command':a55_0x613b9f(0x1b3),'description':a55_0x613b9f(0x1be),'risk':a55_0x613b9f(0x1b8),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a55_0x613b9f(0x1b7),'type':'boolean','description':'Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a56_0x2b37(_0x3ef9ae,_0xcecf39){_0x3ef9ae=_0x3ef9ae-0x11b;const _0x2fbd5f=a56_0x2fbd();let _0x2b3758=_0x2fbd5f[_0x3ef9ae];return _0x2b3758;}const a56_0x40e6d6=a56_0x2b37;(function(_0x3b71ac,_0x3b1c2d){const _0x49a12c=a56_0x2b37,_0x59410b=_0x3b71ac();while(!![]){try{const _0x2fe750=-parseInt(_0x49a12c(0x121))/0x1*(parseInt(_0x49a12c(0x135))/0x2)+parseInt(_0x49a12c(0x12b))/0x3*(parseInt(_0x49a12c(0x125))/0x4)+-parseInt(_0x49a12c(0x13f))/0x5+-parseInt(_0x49a12c(0x13d))/0x6+-parseInt(_0x49a12c(0x12d))/0x7*(-parseInt(_0x49a12c(0x12e))/0x8)+parseInt(_0x49a12c(0x12a))/0x9+parseInt(_0x49a12c(0x138))/0xa*(parseInt(_0x49a12c(0x126))/0xb);if(_0x2fe750===_0x3b1c2d)break;else _0x59410b['push'](_0x59410b['shift']());}catch(_0x32c3a0){_0x59410b['push'](_0x59410b['shift']());}}}(a56_0x2fbd,0x5730a));import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';import{DOMAIN_CONFIG_FIELDS,normalizeDomainOrigin}from'../../config/domain-config.js';function a56_0x2fbd(){const _0x1b0405=['string','906492AjDtSH','env','3429110TTuYeI','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','\x20appcode\x20set\x20to:\x20','Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','app','str','includes','global','\x20workspace\x20add\x20<name>\x20--appcode\x20','Config\x20value','riskLevel','\x20set\x20to:\x20','Usage:\x20','Config\x20value\x20is\x20invalid\x20or\x20too\x20long.','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','validation','locale','Settable\x20top-level\x20keys:\x20','1KJumjT','length','join','\x22.\x20Allowed:\x20','1242876HTkJNI','26785ShAuGX','`,\x20`','object','Missing\x20key.','3647259koYuKo','3AQRbKp','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','273htAtzj','88936XXFkfb','apps','\x22\x20is\x20not\x20settable.','Global','Missing\x20value.','Top-level\x20key\x20\x22','set','636628VzfCjq','key','value','1490nintmk','bool','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','appcode'];a56_0x2fbd=function(){return _0x1b0405;};return a56_0x2fbd();}async function execute(_0x50b82d){const _0x2bfbf1=a56_0x2b37,_0x25b9e9=_0x50b82d[_0x2bfbf1(0x144)](_0x2bfbf1(0x136)),_0x5099f0=_0x50b82d[_0x2bfbf1(0x144)](_0x2bfbf1(0x137));if(!_0x25b9e9)throw CliErrors['validation'](_0x2bfbf1(0x129),_0x2bfbf1(0x11b)+CLI_BIN_NAME+_0x2bfbf1(0x11d));if(_0x5099f0===undefined||_0x5099f0==='')throw CliErrors[_0x2bfbf1(0x11e)](_0x2bfbf1(0x132),_0x2bfbf1(0x11b)+CLI_BIN_NAME+_0x2bfbf1(0x11d));let _0x22fbf8=_0x25b9e9,_0x4c5c46=_0x5099f0;if(_0x5099f0[_0x2bfbf1(0x122)]>0x1f4)throw CliErrors['validation'](_0x2bfbf1(0x11c));if(_0x25b9e9===_0x2bfbf1(0x149))throw CliErrors[_0x2bfbf1(0x11e)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(!isTopLevelConfigKey(_0x25b9e9))throw CliErrors[_0x2bfbf1(0x11e)](_0x2bfbf1(0x133)+_0x25b9e9+_0x2bfbf1(0x130),_0x2bfbf1(0x120)+getTopLevelConfigKeySummary());if(CONFIG_ENUM_VALUES[_0x25b9e9]&&!CONFIG_ENUM_VALUES[_0x25b9e9][_0x2bfbf1(0x145)](_0x5099f0))throw CliErrors[_0x2bfbf1(0x11e)]('Invalid\x20value\x20for\x20\x22'+_0x25b9e9+_0x2bfbf1(0x124)+CONFIG_ENUM_VALUES[_0x25b9e9][_0x2bfbf1(0x123)](',\x20'));if(_0x25b9e9==='locale'&&!normalizeLocale(_0x5099f0))throw CliErrors[_0x2bfbf1(0x11e)]('Invalid\x20locale\x20value.',_0x2bfbf1(0x140));DOMAIN_CONFIG_FIELDS[_0x2bfbf1(0x145)](_0x25b9e9)&&(_0x4c5c46=normalizeDomainOrigin(_0x25b9e9,_0x5099f0));const _0x54f58e={'global':_0x50b82d[_0x2bfbf1(0x139)](_0x2bfbf1(0x146))},_0x181dc9=resolveWriteScope(_0x54f58e),_0x516c69=readScopedConfig(_0x181dc9);_0x25b9e9===_0x2bfbf1(0x143)&&(_0x22fbf8=_0x2bfbf1(0x13b),delete _0x516c69[_0x2bfbf1(0x143)]);_0x25b9e9===_0x2bfbf1(0x11f)&&(_0x4c5c46=normalizeLocale(_0x5099f0));if(_0x25b9e9===_0x2bfbf1(0x13e)){_0x4c5c46=normalizeEnv(_0x5099f0);if(!isProduction(_0x4c5c46)&&!isDaily(_0x4c5c46))throw CliErrors[_0x2bfbf1(0x11e)](_0x2bfbf1(0x13a),_0x2bfbf1(0x12c));}if(_0x25b9e9===_0x2bfbf1(0x13b)){const _0x385b9c=_0x516c69[_0x2bfbf1(0x12f)]&&typeof _0x516c69[_0x2bfbf1(0x12f)]===_0x2bfbf1(0x128)?Object['keys'](_0x516c69[_0x2bfbf1(0x12f)]):[];if(_0x385b9c[_0x2bfbf1(0x122)]>0x0)throw CliErrors['validation']('Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.','Use\x20`'+CLI_BIN_NAME+_0x2bfbf1(0x147)+_0x4c5c46+_0x2bfbf1(0x127)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.');const _0x522295=buildCanonicalProjectConfig({..._0x516c69},{'appCodes':[_0x4c5c46],'env':typeof _0x516c69[_0x2bfbf1(0x13e)]===_0x2bfbf1(0x13c)?_0x516c69[_0x2bfbf1(0x13e)]:undefined});writeScopedConfig(_0x522295,_0x181dc9);const _0x53fe3b=_0x181dc9===_0x2bfbf1(0x146)?_0x2bfbf1(0x131):'Project';return{'ok':!![],'message':'✓\x20'+_0x53fe3b+_0x2bfbf1(0x141)+_0x4c5c46+'\x20(stored\x20as\x20a\x20single\x20app\x20profile)'};}_0x516c69[_0x22fbf8]=_0x4c5c46,writeScopedConfig(_0x516c69,_0x181dc9);const _0x508d5f=_0x181dc9==='global'?'Global':'Project';return{'ok':!![],'message':'✓\x20'+_0x508d5f+'\x20'+_0x22fbf8+_0x2bfbf1(0x14a)+_0x4c5c46};}export const configSetDefinition={'service':'config','command':a56_0x40e6d6(0x134),'description':'Set\x20a\x20config\x20value','risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a56_0x40e6d6(0x136),'type':'string','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a56_0x40e6d6(0x137),'type':a56_0x40e6d6(0x13c),'description':a56_0x40e6d6(0x148),'required':!![]},{'name':a56_0x40e6d6(0x146),'type':'boolean','description':a56_0x40e6d6(0x142),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1b2c8e,_0x358388){var _0x5446db=a57_0x1448,_0x52896f=_0x1b2c8e();while(!![]){try{var _0x78b20c=parseInt(_0x5446db(0xa2))/0x1*(-parseInt(_0x5446db(0xa3))/0x2)+parseInt(_0x5446db(0x93))/0x3+parseInt(_0x5446db(0x9f))/0x4*(-parseInt(_0x5446db(0x9a))/0x5)+-parseInt(_0x5446db(0x95))/0x6*(parseInt(_0x5446db(0x99))/0x7)+-parseInt(_0x5446db(0x94))/0x8*(parseInt(_0x5446db(0x9e))/0x9)+-parseInt(_0x5446db(0x9b))/0xa*(parseInt(_0x5446db(0x9d))/0xb)+parseInt(_0x5446db(0x9c))/0xc;if(_0x78b20c===_0x358388)break;else _0x52896f['push'](_0x52896f['shift']());}catch(_0xdab5d4){_0x52896f['push'](_0x52896f['shift']());}}}(a57_0x4100,0xbf82d));import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';import{CliErrors}from'../../errors.js';import{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';export{CLI_BIN_NAME};export{normalizeLocale};function a57_0x1448(_0x5d5fe2,_0x433d98){_0x5d5fe2=_0x5d5fe2-0x93;var _0x41002d=a57_0x4100();var _0x144840=_0x41002d[_0x5d5fe2];return _0x144840;}export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x29f2e8){var _0x183933=a57_0x1448;if(_0x29f2e8[_0x183933(0x98)])return _0x183933(0x98);if(!isInProject())throw CliErrors[_0x183933(0x97)]('Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).',_0x183933(0xa1)+CLI_BIN_NAME+_0x183933(0xa0));return _0x183933(0x96);}export function readScopedConfig(_0x4de1b7){return readConfigFile(resolveWriteConfigPath(_0x4de1b7));}export function writeScopedConfig(_0x540349,_0x571dee){writeConfigFile(resolveWriteConfigPath(_0x571dee),_0x540349);}function a57_0x4100(){var _0x28740d=['26191kIwURy','2542509CvlMKf','1189436pSsPUu','\x20workspace\x20init\x20--appcode\x20<code>`\x20first.','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','4327obgQFB','470jqGBOV','306153ruUVbB','24UcdkwQ','186kHhMSs','project','validation','global','216629sKVrjl','25ytlElF','6130OBLYgj','77429172zXjBLX'];a57_0x4100=function(){return _0x28740d;};return a57_0x4100();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a59_0x8f71c9=a59_0x53bf;(function(_0x1c6c5d,_0xf3ffab){const _0x409ca2=a59_0x53bf,_0x35422d=_0x1c6c5d();while(!![]){try{const _0x39ef8c=-parseInt(_0x409ca2(0x178))/0x1+-parseInt(_0x409ca2(0x1a1))/0x2+parseInt(_0x409ca2(0x188))/0x3*(-parseInt(_0x409ca2(0x186))/0x4)+parseInt(_0x409ca2(0x1a5))/0x5+-parseInt(_0x409ca2(0x173))/0x6+-parseInt(_0x409ca2(0x17c))/0x7+-parseInt(_0x409ca2(0x191))/0x8*(-parseInt(_0x409ca2(0x18d))/0x9);if(_0x39ef8c===_0xf3ffab)break;else _0x35422d['push'](_0x35422d['shift']());}catch(_0x5d46e0){_0x35422d['push'](_0x35422d['shift']());}}}(a59_0x4fd2,0x9e7c7));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const BACKEND_PATH=a59_0x8f71c9(0x17d);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x28a9f5,input:_0x3b4d45,dryRun:_0x49a8de}){const _0x4d060d=a59_0x8f71c9;validateInput(_0x3b4d45);const _0x2eaf3a=normalizeBusinessGroup(_0x3b4d45[_0x4d060d(0x193)]),_0x1b994f=await getDatasetDetail(_0x3b4d45[_0x4d060d(0x174)]),_0x18f71d=resolveBusinessGroupDataset(_0x1b994f,_0x3b4d45['code']),_0x33fe10=loadCurrentBusinessGroup(_0x1b994f,_0x18f71d);assertExpectedBusinessGroup(_0x33fe10,_0x3b4d45[_0x4d060d(0x198)]);const _0x2e300d=buildBackendPayload(_0x28a9f5,_0x18f71d,_0x2eaf3a),_0x3218bc=_0x33fe10!==_0x2eaf3a;let _0x1ff776;if(_0x3218bc&&!_0x49a8de){await updateErBusinessGroup(_0x2e300d);const _0x26a62a=await getDatasetDetail(_0x18f71d['code']),_0x23c0d6=resolveBusinessGroupDataset(_0x26a62a,_0x18f71d[_0x4d060d(0x174)]),_0x1b28a0=loadCurrentBusinessGroup(_0x26a62a,_0x23c0d6);if(_0x1b28a0!==_0x2eaf3a)throw CliErrors[_0x4d060d(0x17e)](_0x4d060d(0x170),_0x4d060d(0x18f)+JSON[_0x4d060d(0x194)](_0x2eaf3a)+',\x20actual\x20'+JSON['stringify'](_0x1b28a0)+'.');_0x1ff776={'verified':!![],'status':'matched','afterReadback':{'businessGroup':_0x1b28a0}};}else!_0x3218bc&&(_0x1ff776={'verified':!![],'status':_0x4d060d(0x175),'afterReadback':{'businessGroup':_0x33fe10}});const _0x59bc58={'operation':_0x4d060d(0x182),'appCode':_0x28a9f5,'selector':{'code':_0x18f71d[_0x4d060d(0x174)]},'dataset':_0x18f71d,'before':{'businessGroup':_0x33fe10},'after':{'businessGroup':_0x2eaf3a},'changed':_0x3218bc,'dryRun':_0x49a8de,'submitted':_0x3218bc&&!_0x49a8de,'backend':{'method':_0x4d060d(0x19b),'path':BACKEND_PATH,'payload':_0x2e300d},..._0x1ff776?{'verification':_0x1ff776}:{},'warnings':[]};return{'ok':!![],'data':_0x59bc58,'message':_0x3218bc?_0x49a8de?_0x4d060d(0x199)+_0x18f71d['code']:_0x4d060d(0x1a9)+_0x18f71d[_0x4d060d(0x174)]:_0x4d060d(0x17b)+_0x18f71d['code']};}export const datasetBusinessGroupUpdate={'service':'dataset','command':'business-group-update','description':a59_0x8f71c9(0x171),'risk':a59_0x8f71c9(0x18e),'flags':[CODE_FLAG,{'name':a59_0x8f71c9(0x19c),'type':a59_0x8f71c9(0x19d),'required':!![],'description':'Business\x20scenario\x20group\x20(not\x20technical):\x20use\x20<scenario>,\x20or\x20<domain>---<scenario>\x20when\x20needed\x20for\x20disambiguation\x20or\x20an\x20existing\x20hierarchy;\x20empty\x20string\x20clears\x20it'},{'name':a59_0x8f71c9(0x19a),'type':a59_0x8f71c9(0x19d),'required':![],'description':'Expected\x20current\x20business\x20scenario\x20group;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x19a224){validateInput(readBusinessGroupUpdateInput(_0x19a224));},async 'dryRun'(_0xc928cb){const _0x3022f4=a59_0x8f71c9,_0x15b099=await buildDatasetBusinessGroupUpdateResult({'appCode':_0xc928cb[_0x3022f4(0x185)],'input':readBusinessGroupUpdateInput(_0xc928cb),'dryRun':!![]});return{'method':_0x3022f4(0x19b),'url':BACKEND_PATH,'body':_0x15b099[_0x3022f4(0x17f)][_0x3022f4(0x17a)][_0x3022f4(0x176)],'description':_0x15b099['message'],..._0x15b099[_0x3022f4(0x17f)]};},async 'execute'(_0x2225d6){const _0x1f2406=a59_0x8f71c9;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x2225d6[_0x1f2406(0x185)],'input':readBusinessGroupUpdateInput(_0x2225d6),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0xc8d8d7){const _0x13869d=a59_0x8f71c9,_0x489428=_0xc8d8d7[_0x13869d(0x177)](_0x13869d(0x19a));return{'code':trim(_0xc8d8d7[_0x13869d(0x177)](_0x13869d(0x174))),'businessGroup':_0xc8d8d7[_0x13869d(0x177)](_0x13869d(0x19c)),'expectBusinessGroup':_0x489428===undefined||_0x489428===''?undefined:_0x489428};}function validateInput(_0x41f9e2){const _0x1c532a=a59_0x8f71c9;if(!trim(_0x41f9e2[_0x1c532a(0x174)]))throw CliErrors[_0x1c532a(0x1a8)](_0x1c532a(0x192));if(_0x41f9e2[_0x1c532a(0x193)]===undefined)throw CliErrors['validation'](_0x1c532a(0x195));}function resolveBusinessGroupDataset(_0x282495,_0x48e2bb){const _0x2cc340=a59_0x8f71c9,_0x28c43b=asPlainObject(_0x282495[_0x2cc340(0x183)]),_0x4d8366=asPlainObject(_0x282495['dbtableConfig']),_0x46f8c4=resolveSourceType(_0x282495,_0x28c43b,_0x4d8366),_0x326ec5=firstString(_0x282495[_0x2cc340(0x196)],_0x282495[_0x2cc340(0x174)],_0x28c43b[_0x2cc340(0x1a4)],_0x48e2bb)||_0x48e2bb;return{'id':firstNumber(_0x282495['modelId'],_0x282495['id'],_0x28c43b[_0x2cc340(0x16f)])??firstString(_0x282495[_0x2cc340(0x181)],_0x282495['id'],_0x28c43b['datasetId'])??null,'code':_0x326ec5,'name':firstString(_0x282495['name'],_0x28c43b['datasetName'],_0x28c43b[_0x2cc340(0x184)])||null,'sourceType':_0x46f8c4};}function resolveSourceType(_0x39a35c,_0x2f1f48,_0x337996){const _0x46544c=a59_0x8f71c9,_0x47ef94=firstString(_0x39a35c[_0x46544c(0x1ab)],_0x39a35c[_0x46544c(0x19f)],_0x2f1f48[_0x46544c(0x1ab)],_0x2f1f48[_0x46544c(0x19f)])?.[_0x46544c(0x19e)]()[_0x46544c(0x1a0)]();if(_0x47ef94===_0x46544c(0x189)||_0x47ef94===_0x46544c(0x179))return _0x47ef94;if(Object['keys'](_0x337996)['length']>0x0)return _0x46544c(0x189);throw CliErrors['validation'](_0x46544c(0x1aa));}function loadCurrentBusinessGroup(_0x3b91cc,_0x417520){const _0x39d712=a59_0x8f71c9,_0x50e8bb=readBusinessGroupFromDatasetDetail(_0x3b91cc,_0x417520[_0x39d712(0x19f)]);if(_0x50e8bb[_0x39d712(0x1a6)])return normalizeBusinessGroup(_0x50e8bb[_0x39d712(0x1a7)]);if(_0x417520[_0x39d712(0x19f)]===_0x39d712(0x179))return'';throw CliErrors[_0x39d712(0x1a8)](_0x39d712(0x1ac),_0x39d712(0x197));}function readBusinessGroupFromDatasetDetail(_0x1e5335,_0x67ced0){const _0x1561e0=a59_0x8f71c9,_0x4d3b7d=asPlainObject(_0x1e5335[_0x1561e0(0x183)]),_0x1afcb6=firstPresent(_0x1e5335[_0x1561e0(0x193)]);if(_0x1afcb6['found'])return _0x1afcb6;const _0x51f1e6=firstPresent(_0x4d3b7d[_0x1561e0(0x193)]);if(_0x51f1e6['found'])return _0x51f1e6;if(_0x67ced0===_0x1561e0(0x189))return{'found':![]};const _0x1217a6=readBusinessGroupFromExtend(_0x1e5335[_0x1561e0(0x1a2)]);if(_0x1217a6['found'])return _0x1217a6;return readBusinessGroupFromExtend(_0x4d3b7d[_0x1561e0(0x1a2)]);}function readBusinessGroupFromExtend(_0xc41681){const _0x4498d8=a59_0x8f71c9;if(_0xc41681===undefined||_0xc41681===null||_0xc41681==='')return{'found':![]};if(typeof _0xc41681==='string')try{const _0x1e9a96=JSON[_0x4498d8(0x180)](_0xc41681);return readBusinessGroupFromExtend(_0x1e9a96);}catch{return{'found':![]};}const _0x2ef743=asPlainObject(_0xc41681);if(Object[_0x4498d8(0x187)]['hasOwnProperty']['call'](_0x2ef743,_0x4498d8(0x193)))return{'found':!![],'value':_0x2ef743[_0x4498d8(0x193)]};return{'found':![]};}function firstPresent(..._0x21701d){for(const _0x5ba393 of _0x21701d){if(_0x5ba393!==undefined&&_0x5ba393!==null)return{'found':!![],'value':_0x5ba393};}return{'found':![]};}function assertExpectedBusinessGroup(_0x4cf560,_0xe86206){const _0x49aa94=a59_0x8f71c9;if(_0xe86206===undefined)return;const _0x138257=normalizeBusinessGroup(_0xe86206);if(_0x4cf560!==_0x138257)throw CliErrors[_0x49aa94(0x1a8)](_0x49aa94(0x18b),_0x49aa94(0x18f)+JSON[_0x49aa94(0x194)](_0x138257)+_0x49aa94(0x190)+JSON['stringify'](_0x4cf560));}function buildBackendPayload(_0x375eac,_0x232577,_0x853544){const _0x2bf1d0=a59_0x8f71c9;return{'appCode':_0x375eac,'datasetCode':_0x232577[_0x2bf1d0(0x174)],'businessGroup':_0x853544};}function normalizeBusinessGroup(_0x462dc6){const _0x298a30=a59_0x8f71c9;if(_0x462dc6===undefined||_0x462dc6===null)return'';return String(_0x462dc6)[_0x298a30(0x19e)]();}function a59_0x4fd2(){const _0x2b2fc9=['modelId','update','dataset','name','appCode','4wtPFbV','prototype','1263723mkzUNt','DB_TABLE','isFinite','Expectation\x20mismatch\x20at\x20businessGroup','number','18LOAEpu','write','Expected\x20',',\x20actual\x20','14106632tbPRVf','--code\x20is\x20required','businessGroup','stringify','--business-group\x20is\x20required','modelCode','Business\x20scenario\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.','expectBusinessGroup','Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20','expect-business-group','POST','business-group','string','trim','sourceType','toUpperCase','2164682XTvhgd','extend','isArray','datasetCode','809985pboKaV','found','value','validation','Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','source','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','datasetId','Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','Update\x20business\x20scenario\x20group','object','3560826wMszJz','code','unchanged','payload','str','298275uSwhGX','METADATA','backend','No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20','4509176AawPFk','/smartapi/question/er-config/business-group/edit','apiError','data','parse'];a59_0x4fd2=function(){return _0x2b2fc9;};return a59_0x4fd2();}function asPlainObject(_0x32c007){const _0xd028b0=a59_0x8f71c9;if(!_0x32c007||typeof _0x32c007!==_0xd028b0(0x172)||Array[_0xd028b0(0x1a3)](_0x32c007))return{};return _0x32c007;}function firstString(..._0x5b7032){const _0x1c415e=a59_0x8f71c9;for(const _0x347896 of _0x5b7032){if(typeof _0x347896===_0x1c415e(0x19d)&&_0x347896[_0x1c415e(0x19e)]())return _0x347896[_0x1c415e(0x19e)]();if(typeof _0x347896==='number'&&Number[_0x1c415e(0x18a)](_0x347896))return String(_0x347896);}return undefined;}function a59_0x53bf(_0x5f3f84,_0x221bf7){_0x5f3f84=_0x5f3f84-0x16f;const _0x4fd2e2=a59_0x4fd2();let _0x53bf79=_0x4fd2e2[_0x5f3f84];return _0x53bf79;}function firstNumber(..._0xbc53b5){const _0x4c17a3=a59_0x8f71c9;for(const _0x332f13 of _0xbc53b5){if(typeof _0x332f13===_0x4c17a3(0x18c)&&Number[_0x4c17a3(0x18a)](_0x332f13))return _0x332f13;if(typeof _0x332f13===_0x4c17a3(0x19d)&&_0x332f13[_0x4c17a3(0x19e)]()&&Number['isFinite'](Number(_0x332f13)))return Number(_0x332f13);}return null;}function trim(_0x442f3f){const _0x2d51ab=a59_0x8f71c9;return String(_0x442f3f||'')[_0x2d51ab(0x19e)]();}
|
|
1
|
+
function a58_0x1865(_0x5a209d,_0x2b70b2){_0x5a209d=_0x5a209d-0x9e;const _0x37700e=a58_0x3770();let _0x186599=_0x37700e[_0x5a209d];return _0x186599;}const a58_0x288f5c=a58_0x1865;(function(_0x51869f,_0x5ccf5d){const _0xaf8472=a58_0x1865,_0x288c27=_0x51869f();while(!![]){try{const _0x32a336=parseInt(_0xaf8472(0xc7))/0x1*(parseInt(_0xaf8472(0xcc))/0x2)+parseInt(_0xaf8472(0xaa))/0x3*(parseInt(_0xaf8472(0xab))/0x4)+parseInt(_0xaf8472(0xd4))/0x5+parseInt(_0xaf8472(0xb5))/0x6+parseInt(_0xaf8472(0x9f))/0x7*(-parseInt(_0xaf8472(0xbf))/0x8)+-parseInt(_0xaf8472(0xdc))/0x9+parseInt(_0xaf8472(0xc3))/0xa*(-parseInt(_0xaf8472(0xd8))/0xb);if(_0x32a336===_0x5ccf5d)break;else _0x288c27['push'](_0x288c27['shift']());}catch(_0x173128){_0x288c27['push'](_0x288c27['shift']());}}}(a58_0x3770,0xba936));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const BACKEND_PATH='/smartapi/question/er-config/business-group/edit';export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x3dabd7,input:_0x4571f9,dryRun:_0x230e87}){const _0xc307ff=a58_0x1865;validateInput(_0x4571f9);const _0x209336=normalizeBusinessGroup(_0x4571f9['businessGroup']),_0x522818=await getDatasetDetail(_0x4571f9[_0xc307ff(0xac)]),_0x32653e=resolveBusinessGroupDataset(_0x522818,_0x4571f9[_0xc307ff(0xac)]),_0x12226b=loadCurrentBusinessGroup(_0x522818,_0x32653e);assertExpectedBusinessGroup(_0x12226b,_0x4571f9['expectBusinessGroup']);const _0x3e2001=buildBackendPayload(_0x3dabd7,_0x32653e,_0x209336),_0x45b865=_0x12226b!==_0x209336;let _0x4023d7;if(_0x45b865&&!_0x230e87){await updateErBusinessGroup(_0x3e2001);const _0x49ea90=await getDatasetDetail(_0x32653e[_0xc307ff(0xac)]),_0x32c737=resolveBusinessGroupDataset(_0x49ea90,_0x32653e['code']),_0x441c1a=loadCurrentBusinessGroup(_0x49ea90,_0x32c737);if(_0x441c1a!==_0x209336)throw CliErrors[_0xc307ff(0xb9)](_0xc307ff(0xd6),'Expected\x20'+JSON[_0xc307ff(0xc1)](_0x209336)+',\x20actual\x20'+JSON[_0xc307ff(0xc1)](_0x441c1a)+'.');_0x4023d7={'verified':!![],'status':'matched','afterReadback':{'businessGroup':_0x441c1a}};}else!_0x45b865&&(_0x4023d7={'verified':!![],'status':_0xc307ff(0xd3),'afterReadback':{'businessGroup':_0x12226b}});const _0x4ce18d={'operation':_0xc307ff(0xbb),'appCode':_0x3dabd7,'selector':{'code':_0x32653e[_0xc307ff(0xac)]},'dataset':_0x32653e,'before':{'businessGroup':_0x12226b},'after':{'businessGroup':_0x209336},'changed':_0x45b865,'dryRun':_0x230e87,'submitted':_0x45b865&&!_0x230e87,'backend':{'method':_0xc307ff(0xbe),'path':BACKEND_PATH,'payload':_0x3e2001},..._0x4023d7?{'verification':_0x4023d7}:{},'warnings':[]};return{'ok':!![],'data':_0x4ce18d,'message':_0x45b865?_0x230e87?_0xc307ff(0xc8)+_0x32653e[_0xc307ff(0xac)]:_0xc307ff(0xc4)+_0x32653e[_0xc307ff(0xac)]:'No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20'+_0x32653e[_0xc307ff(0xac)]};}export const datasetBusinessGroupUpdate={'service':'dataset','command':a58_0x288f5c(0xb0),'description':a58_0x288f5c(0xcb),'risk':a58_0x288f5c(0xd5),'flags':[CODE_FLAG,{'name':a58_0x288f5c(0xd0),'type':'string','required':!![],'description':a58_0x288f5c(0xa6)},{'name':a58_0x288f5c(0x9e),'type':a58_0x288f5c(0xdb),'required':![],'description':a58_0x288f5c(0xc6)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0xb37c8d){validateInput(readBusinessGroupUpdateInput(_0xb37c8d));},async 'dryRun'(_0x46597e){const _0xe6b108=a58_0x288f5c,_0x223fde=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x46597e['appCode'],'input':readBusinessGroupUpdateInput(_0x46597e),'dryRun':!![]});return{'method':_0xe6b108(0xbe),'url':BACKEND_PATH,'body':_0x223fde[_0xe6b108(0xd9)][_0xe6b108(0xa9)][_0xe6b108(0xc2)],'description':_0x223fde[_0xe6b108(0xd2)],..._0x223fde['data']};},async 'execute'(_0x3cfd62){const _0x548595=a58_0x288f5c;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x3cfd62[_0x548595(0xa0)],'input':readBusinessGroupUpdateInput(_0x3cfd62),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x1d1593){const _0x4aef13=a58_0x288f5c,_0x5cdfe8=_0x1d1593['str']('expect-business-group');return{'code':trim(_0x1d1593[_0x4aef13(0xcd)](_0x4aef13(0xac))),'businessGroup':_0x1d1593[_0x4aef13(0xcd)](_0x4aef13(0xd0)),'expectBusinessGroup':_0x5cdfe8===undefined||_0x5cdfe8===''?undefined:_0x5cdfe8};}function validateInput(_0x14a769){const _0xc5cdcb=a58_0x288f5c;if(!trim(_0x14a769[_0xc5cdcb(0xac)]))throw CliErrors['validation']('--code\x20is\x20required');if(_0x14a769[_0xc5cdcb(0xb4)]===undefined)throw CliErrors[_0xc5cdcb(0xcf)](_0xc5cdcb(0xd1));}function resolveBusinessGroupDataset(_0x5ac0a1,_0x5251d9){const _0x2f905c=a58_0x288f5c,_0x225048=asPlainObject(_0x5ac0a1[_0x2f905c(0xa5)]),_0x229f70=asPlainObject(_0x5ac0a1[_0x2f905c(0xb3)]),_0x2bf826=resolveSourceType(_0x5ac0a1,_0x225048,_0x229f70),_0x33c360=firstString(_0x5ac0a1['modelCode'],_0x5ac0a1[_0x2f905c(0xac)],_0x225048[_0x2f905c(0xa7)],_0x5251d9)||_0x5251d9;return{'id':firstNumber(_0x5ac0a1[_0x2f905c(0xa8)],_0x5ac0a1['id'],_0x225048[_0x2f905c(0xae)])??firstString(_0x5ac0a1['modelId'],_0x5ac0a1['id'],_0x225048[_0x2f905c(0xae)])??null,'code':_0x33c360,'name':firstString(_0x5ac0a1[_0x2f905c(0xda)],_0x225048['datasetName'],_0x225048['name'])||null,'sourceType':_0x2bf826};}function resolveSourceType(_0x1a85df,_0x41ae0b,_0x5b3ec5){const _0x4da2cb=a58_0x288f5c,_0x42aca0=firstString(_0x1a85df[_0x4da2cb(0xd7)],_0x1a85df['sourceType'],_0x41ae0b['source'],_0x41ae0b['sourceType'])?.[_0x4da2cb(0xca)]()[_0x4da2cb(0xaf)]();if(_0x42aca0===_0x4da2cb(0xc5)||_0x42aca0===_0x4da2cb(0xbd))return _0x42aca0;if(Object[_0x4da2cb(0xa2)](_0x5b3ec5)['length']>0x0)return _0x4da2cb(0xc5);throw CliErrors[_0x4da2cb(0xcf)](_0x4da2cb(0xbc));}function loadCurrentBusinessGroup(_0x5caf25,_0x187dde){const _0x4048f7=a58_0x288f5c,_0x14f8a8=readBusinessGroupFromDatasetDetail(_0x5caf25,_0x187dde['sourceType']);if(_0x14f8a8[_0x4048f7(0xb7)])return normalizeBusinessGroup(_0x14f8a8[_0x4048f7(0xc0)]);if(_0x187dde['sourceType']===_0x4048f7(0xbd))return'';throw CliErrors['validation'](_0x4048f7(0xba),'Business\x20scenario\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.');}function readBusinessGroupFromDatasetDetail(_0x46cd0a,_0x1749bf){const _0x398af8=a58_0x288f5c,_0x558dcd=asPlainObject(_0x46cd0a[_0x398af8(0xa5)]),_0x5d6ce6=firstPresent(_0x46cd0a[_0x398af8(0xb4)]);if(_0x5d6ce6[_0x398af8(0xb7)])return _0x5d6ce6;const _0x2ca143=firstPresent(_0x558dcd[_0x398af8(0xb4)]);if(_0x2ca143[_0x398af8(0xb7)])return _0x2ca143;if(_0x1749bf==='DB_TABLE')return{'found':![]};const _0x1b153a=readBusinessGroupFromExtend(_0x46cd0a[_0x398af8(0xc9)]);if(_0x1b153a[_0x398af8(0xb7)])return _0x1b153a;return readBusinessGroupFromExtend(_0x558dcd[_0x398af8(0xc9)]);}function readBusinessGroupFromExtend(_0x22af35){const _0x55f2d8=a58_0x288f5c;if(_0x22af35===undefined||_0x22af35===null||_0x22af35==='')return{'found':![]};if(typeof _0x22af35===_0x55f2d8(0xdb))try{const _0x4082f1=JSON[_0x55f2d8(0xa1)](_0x22af35);return readBusinessGroupFromExtend(_0x4082f1);}catch{return{'found':![]};}const _0x261e81=asPlainObject(_0x22af35);if(Object[_0x55f2d8(0xb2)][_0x55f2d8(0xad)]['call'](_0x261e81,_0x55f2d8(0xb4)))return{'found':!![],'value':_0x261e81[_0x55f2d8(0xb4)]};return{'found':![]};}function firstPresent(..._0x1dae89){for(const _0x3ce5be of _0x1dae89){if(_0x3ce5be!==undefined&&_0x3ce5be!==null)return{'found':!![],'value':_0x3ce5be};}return{'found':![]};}function a58_0x3770(){const _0x458da0=['business-group','--business-group\x20is\x20required','message','unchanged','1630845OtuAes','write','Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','source','99JHoDEe','data','name','string','6527700RSCPXs','expect-business-group','18186dRlQhn','appCode','parse','keys','Expectation\x20mismatch\x20at\x20businessGroup','number','dataset','Business\x20scenario\x20group\x20(not\x20technical):\x20use\x20<scenario>,\x20or\x20<domain>---<scenario>\x20when\x20needed\x20for\x20disambiguation\x20or\x20an\x20existing\x20hierarchy;\x20empty\x20string\x20clears\x20it','datasetCode','modelId','backend','30zqCEzJ','232364DyiDbc','code','hasOwnProperty','datasetId','toUpperCase','business-group-update',',\x20actual\x20','prototype','dbtableConfig','businessGroup','5568474VcVMDn','Expected\x20','found','isFinite','apiError','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','update','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','METADATA','POST','4024xjcMxb','value','stringify','payload','122390Txmjpz','Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20','DB_TABLE','Expected\x20current\x20business\x20scenario\x20group;\x20mismatch\x20aborts\x20without\x20writing','97391GiKwUu','Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20','extend','trim','Update\x20business\x20scenario\x20group','22eehXTK','str','isArray','validation'];a58_0x3770=function(){return _0x458da0;};return a58_0x3770();}function assertExpectedBusinessGroup(_0x152320,_0x1cf9e8){const _0x4da740=a58_0x288f5c;if(_0x1cf9e8===undefined)return;const _0x4b007d=normalizeBusinessGroup(_0x1cf9e8);if(_0x152320!==_0x4b007d)throw CliErrors[_0x4da740(0xcf)](_0x4da740(0xa3),_0x4da740(0xb6)+JSON[_0x4da740(0xc1)](_0x4b007d)+_0x4da740(0xb1)+JSON[_0x4da740(0xc1)](_0x152320));}function buildBackendPayload(_0x2c7560,_0x2f70dd,_0x5dcfb3){const _0x1133fd=a58_0x288f5c;return{'appCode':_0x2c7560,'datasetCode':_0x2f70dd[_0x1133fd(0xac)],'businessGroup':_0x5dcfb3};}function normalizeBusinessGroup(_0x124392){const _0x5f5380=a58_0x288f5c;if(_0x124392===undefined||_0x124392===null)return'';return String(_0x124392)[_0x5f5380(0xca)]();}function asPlainObject(_0x241ee1){const _0xf85fed=a58_0x288f5c;if(!_0x241ee1||typeof _0x241ee1!=='object'||Array[_0xf85fed(0xce)](_0x241ee1))return{};return _0x241ee1;}function firstString(..._0x397a18){const _0x4ee50c=a58_0x288f5c;for(const _0x104b2a of _0x397a18){if(typeof _0x104b2a===_0x4ee50c(0xdb)&&_0x104b2a['trim']())return _0x104b2a['trim']();if(typeof _0x104b2a==='number'&&Number[_0x4ee50c(0xb8)](_0x104b2a))return String(_0x104b2a);}return undefined;}function firstNumber(..._0x19d5c1){const _0x454523=a58_0x288f5c;for(const _0x350fa7 of _0x19d5c1){if(typeof _0x350fa7===_0x454523(0xa4)&&Number[_0x454523(0xb8)](_0x350fa7))return _0x350fa7;if(typeof _0x350fa7===_0x454523(0xdb)&&_0x350fa7[_0x454523(0xca)]()&&Number[_0x454523(0xb8)](Number(_0x350fa7)))return Number(_0x350fa7);}return null;}function trim(_0x11daac){const _0x5229eb=a58_0x288f5c;return String(_0x11daac||'')[_0x5229eb(0xca)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a59_0x49994e=a59_0x188c;function a59_0x188c(_0x1e35b9,_0x157ed0){_0x1e35b9=_0x1e35b9-0xdc;const _0xd06d49=a59_0xd06d();let _0x188c32=_0xd06d49[_0x1e35b9];return _0x188c32;}(function(_0x2cfb20,_0x4c2b93){const _0x78c8d8=a59_0x188c,_0x5f2f7f=_0x2cfb20();while(!![]){try{const _0x56c94b=-parseInt(_0x78c8d8(0xdd))/0x1*(-parseInt(_0x78c8d8(0xe6))/0x2)+-parseInt(_0x78c8d8(0xe5))/0x3*(-parseInt(_0x78c8d8(0xea))/0x4)+-parseInt(_0x78c8d8(0xdc))/0x5+parseInt(_0x78c8d8(0xe4))/0x6*(parseInt(_0x78c8d8(0xe2))/0x7)+parseInt(_0x78c8d8(0xec))/0x8*(-parseInt(_0x78c8d8(0xee))/0x9)+-parseInt(_0x78c8d8(0xe1))/0xa+-parseInt(_0x78c8d8(0xe3))/0xb;if(_0x56c94b===_0x4c2b93)break;else _0x5f2f7f['push'](_0x5f2f7f['shift']());}catch(_0x10a424){_0x5f2f7f['push'](_0x5f2f7f['shift']());}}}(a59_0xd06d,0x4865e));function a59_0xd06d(){const _0x223405=['groups','List\x20DB_TABLE\x20dataset\x20business\x20groups\x20for\x20a\x20database\x20connection;\x20does\x20not\x20include\x20METADATA','3290760dkoziG','7jawipk','495495hXFWGn','2958036FjqywT','3453XqqGzi','10566sFlLAy','\x20business\x20group(s)\x20for\x20database\x20connection\x20','length','DB_TABLE','2004rqrLJN','read','84968rARvpD','dbid','477KEtuQD','num','1531340NPQsBG','89NwVJJM','dataset'];a59_0xd06d=function(){return _0x223405;};return a59_0xd06d();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getErBusinessGroupSummary}from'../../core/api-client.js';export const datasetBusinessGroups={'service':a59_0x49994e(0xde),'command':'business-groups','description':a59_0x49994e(0xe0),'risk':a59_0x49994e(0xeb),'flags':[{'name':a59_0x49994e(0xed),'type':'number','required':!![],'description':'Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)'},APPCODE_FLAG_OPTIONAL],async 'execute'(_0x59ba6d){const _0x199bcb=a59_0x49994e,_0x4fd9a0=_0x59ba6d[_0x199bcb(0xef)](_0x199bcb(0xed)),_0x66f365=await getErBusinessGroupSummary(_0x59ba6d['appCode'],_0x4fd9a0);return{'ok':!![],'data':{..._0x66f365,'scope':_0x199bcb(0xe9)},'message':'Found\x20'+_0x66f365[_0x199bcb(0xdf)][_0x199bcb(0xe8)]+_0x199bcb(0xe7)+_0x4fd9a0};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a60_0x30c644=a60_0x3e18;(function(_0x42360c,_0x1ef885){const _0x56228d=a60_0x3e18,_0x3791e2=_0x42360c();while(!![]){try{const _0x5edff6=-parseInt(_0x56228d(0xea))/0x1+parseInt(_0x56228d(0xe3))/0x2+-parseInt(_0x56228d(0xfe))/0x3*(-parseInt(_0x56228d(0xfd))/0x4)+parseInt(_0x56228d(0xdf))/0x5*(parseInt(_0x56228d(0xf4))/0x6)+parseInt(_0x56228d(0xde))/0x7*(parseInt(_0x56228d(0xf6))/0x8)+parseInt(_0x56228d(0xff))/0x9*(parseInt(_0x56228d(0xef))/0xa)+-parseInt(_0x56228d(0xee))/0xb;if(_0x5edff6===_0x1ef885)break;else _0x3791e2['push'](_0x3791e2['shift']());}catch(_0x2b96cf){_0x3791e2['push'](_0x3791e2['shift']());}}}(a60_0x2cba,0xb3f20));import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a60_0x30c644(0xe0),'filter':'lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','getOne':a60_0x30c644(0xf5)};export const RUNTIME_DATA_ACCESS_SUMMARY='Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.';function valueToString(_0x24bd83){return _0x24bd83==null?'':String(_0x24bd83)['trim']();}function a60_0x3e18(_0x5c1bf3,_0x425604){_0x5c1bf3=_0x5c1bf3-0xde;const _0x2cba81=a60_0x2cba();let _0x3e1803=_0x2cba81[_0x5c1bf3];return _0x3e1803;}function a60_0x2cba(){const _0x63a562=['\x20and\x20has\x20no\x20DB_TABLE\x20data-source\x20context\x20for\x20','5598308gFpxON','3PEHQsl','9IjvHON','4039714iZeqOH','20kdBQuX','lovrabet','\x20is\x20','dataset','1702524cmTYJF','Reason:\x20schema\x20introspection\x20and\x20custom\x20SQL\x20require\x20source=DB_TABLE,\x20dbtableConfig.dbId,\x20dbtableConfig.tableName,\x20and\x20a\x20database\x20connection\x20context.','join','filter','SQL\x20schema\x20validation','Upgrade\x20or\x20migrate\x20this\x20dataset\x20to\x20a\x20DB_TABLE\x20dataset,\x20then\x20continue\x20with\x20the\x20new\x20dataset\x20code.','object','195135XMmTkd','dbtableConfig','toUpperCase','source','46960353JEKeOB','12854490pMzZhO','sourceType','validation','length','METADATA','1631886opyBim','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress','8zljCYG','name','UNKNOWN','To\x20inspect\x20real\x20runtime\x20rows,\x20switch\x20to\x20lovrabet\x20CLI:\x20','datasetName','tableName'];a60_0x2cba=function(){return _0x63a562;};return a60_0x2cba();}function getDatasetCode(_0x44a4a6){const _0x1dda67=a60_0x30c644;return valueToString(_0x44a4a6['code']??_0x44a4a6['modelCode']??_0x44a4a6[_0x1dda67(0xe2)]?.['datasetCode']);}function getDatasetName(_0x222e16){const _0xa5a1c6=a60_0x30c644;return valueToString(_0x222e16[_0xa5a1c6(0xf7)]??_0x222e16[_0xa5a1c6(0xe2)]?.[_0xa5a1c6(0xfa)])||'unknown';}function getDatasetSource(_0x36f0e8){const _0x19cd51=a60_0x30c644;return valueToString(_0x36f0e8[_0x19cd51(0xed)]??_0x36f0e8[_0x19cd51(0xe2)]?.[_0x19cd51(0xf0)])[_0x19cd51(0xec)]();}function getDbtableConfig(_0x599c0a){const _0x3db6af=a60_0x30c644,_0x58c60c=_0x599c0a[_0x3db6af(0xeb)]??_0x599c0a['dbtable'];return _0x58c60c&&typeof _0x58c60c===_0x3db6af(0xe9)?_0x58c60c:{};}export function isDbTableBackedDataset(_0x1b97a8){const _0xe7b4bd=a60_0x30c644,_0x26084f=getDatasetSource(_0x1b97a8);if(_0x26084f===_0xe7b4bd(0xf3))return![];const _0x53a581=getDbtableConfig(_0x1b97a8),_0x9243d1=_0x53a581['dbId']??_0x53a581['id'],_0x9aa95b=valueToString(_0x53a581['tableName']??_0x1b97a8['tableName']??_0x1b97a8[_0xe7b4bd(0xe2)]?.[_0xe7b4bd(0xfb)]);return _0x9243d1!==undefined&&_0x9243d1!==null&&_0x9aa95b[_0xe7b4bd(0xf2)]>0x0;}export function filterDbTableBackedDatasets(_0x1956fb){const _0x4e2da5=a60_0x30c644;return _0x1956fb[_0x4e2da5(0xe6)](_0x4d6fa6=>isDbTableBackedDataset(_0x4d6fa6));}export function buildDbTableBackedRequirementMessage(_0x17aeb4,_0x38133e=a60_0x30c644(0xe7)){const _0x1e518d=a60_0x30c644,_0x110a97=getDatasetSource(_0x17aeb4)||_0x1e518d(0xf8),_0x2bbfba=getDatasetName(_0x17aeb4),_0xb7b47f=getDatasetCode(_0x17aeb4),_0x57d924=_0xb7b47f?'\x20('+_0xb7b47f+')':'';return['The\x20current\x20dataset\x20\x22'+_0x2bbfba+'\x22'+_0x57d924+_0x1e518d(0xe1)+_0x110a97+_0x1e518d(0xfc)+_0x38133e+'.',_0x1e518d(0xe4),_0x1e518d(0xe8),_0x1e518d(0xf9)+RUNTIME_DATA_ACCESS_COMMANDS[_0x1e518d(0xe6)]+';\x20'+RUNTIME_DATA_ACCESS_COMMANDS['getOne']+'.'][_0x1e518d(0xe5)]('\x20');}export function assertDatasetIsDbTableBacked(_0x565bcb,_0x49f92d){const _0x16508c=a60_0x30c644;if(!isDbTableBackedDataset(_0x565bcb))throw CliErrors[_0x16508c(0xf1)](buildDbTableBackedRequirementMessage(_0x565bcb,_0x49f92d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x4ab2d2=a61_0x5216;(function(_0xea27b1,_0x49d9ac){const _0x6be0b7=a61_0x5216,_0x574a9b=_0xea27b1();while(!![]){try{const _0x5ad2b6=parseInt(_0x6be0b7(0xe9))/0x1*(parseInt(_0x6be0b7(0xf3))/0x2)+parseInt(_0x6be0b7(0xf5))/0x3+parseInt(_0x6be0b7(0xce))/0x4*(-parseInt(_0x6be0b7(0xe8))/0x5)+parseInt(_0x6be0b7(0xd9))/0x6+parseInt(_0x6be0b7(0xd1))/0x7*(-parseInt(_0x6be0b7(0xf9))/0x8)+parseInt(_0x6be0b7(0xe7))/0x9*(parseInt(_0x6be0b7(0xbd))/0xa)+-parseInt(_0x6be0b7(0xea))/0xb;if(_0x5ad2b6===_0x49d9ac)break;else _0x574a9b['push'](_0x574a9b['shift']());}catch(_0xb76cba){_0x574a9b['push'](_0x574a9b['shift']());}}}(a61_0x1c8f,0xdb7be));import{deleteDataset,getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const DATASET_ID_FLAG={'name':'id','type':a61_0x4ab2d2(0xe6),'description':a61_0x4ab2d2(0xca)},DBID_FLAG={'name':a61_0x4ab2d2(0xcb),'type':a61_0x4ab2d2(0xe6),'description':a61_0x4ab2d2(0xf2)},CONFIRM_FLAG={'name':a61_0x4ab2d2(0xc3),'type':a61_0x4ab2d2(0xc5),'description':a61_0x4ab2d2(0xcc)},CASCADE_FLAG={'name':'cascade','type':a61_0x4ab2d2(0xc5),'description':'Also\x20delete\x20related\x20pages\x20and\x20menus;\x20requires\x20explicit\x20--confirm'},EXPECTED_COUNT_FLAG={'name':a61_0x4ab2d2(0xd8),'type':a61_0x4ab2d2(0xe6),'description':a61_0x4ab2d2(0xc0)};function a61_0x5216(_0x30e5f6,_0x514268){_0x30e5f6=_0x30e5f6-0xbd;const _0x1c8f6d=a61_0x1c8f();let _0x5216db=_0x1c8f6d[_0x30e5f6];return _0x5216db;}function a61_0x1c8f(){const _0x115534=['appCode','deleted','map','add','num','object','relatedPageInfoList','dbid=','Deleted\x20','number','4383297LVJbzQ','5492460PVthrD','8OyHOZe','8196562jEYSHD','cascade','validation','filter','description','str','high-risk-write','\x20dataset(s)\x20and\x20their\x20listed\x20related\x20pages/menus.\x20Restore\x20each\x20Dataset\x20first,\x20then\x20restore\x20pages\x20explicitly\x20when\x20needed.','Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id','166550VwxIMk','delete','3086604xOYahj','message','One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.','bool','2500160opVoso','Would\x20delete\x20','source','30opwvXm','dbId','\x20failed','Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value','dbName','dataset','confirm','true','boolean','\x20dataset(s)\x20without\x20cascading\x20to\x20pages.\x20The\x20server\x20blocks\x20a\x20Dataset\x20that\x20still\x20has\x20related\x20pages.','name','length','type','Dataset\x20id','dbid','Required\x20to\x20execute\x20dataset\x20deletion','\x20dataset(s),\x20but\x20--expected-count\x20is\x20','4dBkLbM','isInteger','title','14sDWkSX','false','Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.','code','relatedPages','/smartapi/dataset/delete?cascade=','dbtableConfig','expected-count','1269078KypDfO','push','\x20--appcode\x20','Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id'];a61_0x1c8f=function(){return _0x115534;};return a61_0x1c8f();}export const datasetDelete={'service':a61_0x4ab2d2(0xc2),'command':a61_0x4ab2d2(0xf4),'description':a61_0x4ab2d2(0xdc),'risk':a61_0x4ab2d2(0xf0),'flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CASCADE_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x507ef9){const _0x370795=a61_0x4ab2d2,_0x884bc2=_0x507ef9['num']('id'),_0x15f8c6=_0x507ef9[_0x370795(0xef)]('code'),_0x418aab=_0x507ef9[_0x370795(0xe1)](_0x370795(0xcb)),_0x99ef98=[_0x884bc2>0x0,Boolean(_0x15f8c6),_0x418aab>0x0][_0x370795(0xed)](Boolean);if(_0x99ef98[_0x370795(0xc8)]===0x0)throw CliErrors[_0x370795(0xec)](_0x370795(0xf7));if(_0x99ef98[_0x370795(0xc8)]>0x1)throw CliErrors[_0x370795(0xec)](_0x370795(0xd3));},async 'dryRun'(_0x3d088c){const _0x11dd93=a61_0x4ab2d2,_0x1238d3=await resolveTargets(_0x3d088c),_0x4569d3=_0x3d088c['bool'](_0x11dd93(0xeb));return{'method':'POST','url':_0x11dd93(0xd6)+(_0x4569d3?_0x11dd93(0xc4):_0x11dd93(0xd2)),'body':{'count':_0x1238d3[_0x11dd93(0xc8)],'cascade':_0x4569d3,'datasets':_0x1238d3},'description':_0x4569d3?_0x11dd93(0xfa)+_0x1238d3[_0x11dd93(0xc8)]+_0x11dd93(0xf1):'Would\x20safely\x20delete\x20'+_0x1238d3['length']+_0x11dd93(0xc6)};},async 'execute'(_0x31ac70){const _0x2cc78a=a61_0x4ab2d2;if(!_0x31ac70[_0x2cc78a(0xf8)](_0x2cc78a(0xc3)))throw CliErrors[_0x2cc78a(0xec)]('--confirm\x20is\x20required\x20to\x20delete\x20datasets.','Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.');const _0x563144=await resolveTargets(_0x31ac70),_0x412fa6=_0x31ac70[_0x2cc78a(0xf8)](_0x2cc78a(0xeb)),_0x5c1319=[],_0x2b4c88=[];for(const _0x91ff85 of _0x563144){try{await deleteDataset(_0x91ff85['id'],_0x412fa6),_0x5c1319['push'](_0x91ff85);}catch(_0x40c137){_0x2b4c88['push']({..._0x91ff85,'error':_0x40c137 instanceof Error?_0x40c137[_0x2cc78a(0xf6)]:String(_0x40c137)});}}if(_0x2b4c88[_0x2cc78a(0xc8)]>0x0){const _0x273b1d=buildPageRestoreCommands(_0x31ac70[_0x2cc78a(0xdd)],_0x412fa6?_0x5c1319:[]);return{'ok':![],'data':{'requested':_0x563144['length'],'cascade':_0x412fa6,'deletedCount':_0x5c1319['length'],'failedCount':_0x2b4c88[_0x2cc78a(0xc8)],'deleted':_0x5c1319,'failed':_0x2b4c88,'pageRestoreCommands':_0x273b1d},'message':_0x2cc78a(0xe5)+_0x5c1319[_0x2cc78a(0xc8)]+'/'+_0x563144['length']+'\x20dataset(s);\x20'+_0x2b4c88[_0x2cc78a(0xc8)]+_0x2cc78a(0xbf)};}return{'ok':!![],'data':{'requested':_0x563144[_0x2cc78a(0xc8)],'cascade':_0x412fa6,'deletedCount':_0x5c1319[_0x2cc78a(0xc8)],'deleted':_0x5c1319,'pageRestoreCommands':buildPageRestoreCommands(_0x31ac70[_0x2cc78a(0xdd)],_0x412fa6?_0x5c1319:[])},'message':_0x2cc78a(0xe5)+_0x5c1319[_0x2cc78a(0xc8)]+'\x20dataset(s)'};}};async function resolveTargets(_0x58b9a0){const _0x16e4fb=a61_0x4ab2d2,_0x408d58=_0x58b9a0['num']('id'),_0x294b3a=_0x58b9a0[_0x16e4fb(0xef)](_0x16e4fb(0xd4)),_0x218af4=_0x58b9a0[_0x16e4fb(0xe1)](_0x16e4fb(0xcb));let _0x19d662;_0x294b3a?(_0x19d662=await listDatasets(_0x58b9a0['appCode'],{'code':_0x294b3a}),_0x19d662=_0x19d662['filter'](_0x2cb588=>_0x2cb588[_0x16e4fb(0xd4)]===_0x294b3a)):(_0x19d662=await listDatasets(_0x58b9a0[_0x16e4fb(0xdd)]),_0x408d58>0x0&&(_0x19d662=_0x19d662['filter'](_0x4062d6=>_0x4062d6['id']===_0x408d58)),_0x218af4>0x0&&(_0x19d662=_0x19d662[_0x16e4fb(0xed)](_0x197088=>_0x197088[_0x16e4fb(0xd7)]?.[_0x16e4fb(0xbe)]===_0x218af4)));const _0xb8a2f8=[];for(const _0x54104d of _0x19d662){const _0x21f1d7=await getDatasetDetail(_0x54104d[_0x16e4fb(0xd4)]),_0x46cd48=Array['isArray'](_0x21f1d7['relatedPageInfoList'])?_0x21f1d7[_0x16e4fb(0xe3)][_0x16e4fb(0xed)](_0x5e29c0=>_0x5e29c0!=null&&typeof _0x5e29c0===_0x16e4fb(0xe2)&&_0x5e29c0[_0x16e4fb(0xde)]!==!![]):[];_0xb8a2f8[_0x16e4fb(0xda)](normalizeTarget(_0x54104d,_0x46cd48));}if(_0xb8a2f8[_0x16e4fb(0xc8)]===0x0){const _0x2dbfa0=_0x294b3a||(_0x408d58>0x0?'id='+_0x408d58:_0x16e4fb(0xe4)+_0x218af4);throw CliErrors['validation']('No\x20undeleted\x20dataset\x20found\x20for\x20'+_0x2dbfa0+'.');}const _0x172933=_0x58b9a0[_0x16e4fb(0xe1)]('expected-count');if(_0x172933>0x0&&_0xb8a2f8[_0x16e4fb(0xc8)]!==_0x172933)throw CliErrors['validation']('Matched\x20'+_0xb8a2f8['length']+_0x16e4fb(0xcd)+_0x172933+'.');return _0xb8a2f8;}function normalizeTarget(_0x35150b,_0x51bdd4){const _0x286eee=a61_0x4ab2d2,_0x25220d=_0x35150b['dbtableConfig']??{},_0x4e3b55=_0x51bdd4[_0x286eee(0xdf)](_0x2942a1=>{const _0x5f1c20=_0x286eee;if(_0x2942a1==null||typeof _0x2942a1!=='object')return null;const _0xc48648=_0x2942a1,_0x2cf05b=Number(_0xc48648['id']);if(!Number[_0x5f1c20(0xcf)](_0x2cf05b)||_0x2cf05b<=0x0)return null;const _0x198182=_0xc48648[_0x5f1c20(0xd0)]??_0xc48648[_0x5f1c20(0xc7)];return{'id':_0x2cf05b,..._0x198182?{'name':String(_0x198182)}:{},..._0xc48648[_0x5f1c20(0xc9)]?{'type':String(_0xc48648[_0x5f1c20(0xc9)])}:{}};})[_0x286eee(0xed)](_0x132391=>_0x132391!==null);return{'id':_0x35150b['id'],'code':_0x35150b[_0x286eee(0xd4)],'name':_0x35150b[_0x286eee(0xc7)],'description':_0x35150b[_0x286eee(0xee)],'source':_0x35150b[_0x286eee(0xfb)],'dbId':_0x25220d[_0x286eee(0xbe)],'dbName':_0x25220d[_0x286eee(0xc1)],'tableName':_0x25220d['tableName'],'relatedPageCount':_0x4e3b55['length'],'relatedPages':_0x4e3b55};}function buildPageRestoreCommands(_0x864c73,_0x4f0af2){const _0x400df2=a61_0x4ab2d2,_0x14f3aa=new Set();for(const _0x1459cc of _0x4f0af2){for(const _0x317f23 of _0x1459cc[_0x400df2(0xd5)])_0x14f3aa[_0x400df2(0xe0)](_0x317f23['id']);}return[..._0x14f3aa][_0x400df2(0xdf)](_0x396580=>'rabetbase\x20page\x20restore\x20--id\x20'+_0x396580+_0x400df2(0xdb)+_0x864c73);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a62_0x339f5a=a62_0x112a;function a62_0x58a0(){const _0x38cd42=['doVersion','datasetKey','dblinkInfoDTO','allFieldNames','modelCode','dataset','entries','doType','createTimeField','creatorIdField','str','isArray','dbType','1588500WjIbpP','modifierNameField','afterScriptId','type','requestFields','3616645RLXpnB','252408dAisrn','fields','validateRules','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','operations','formatRules','dbtableConfig','length','relations','options','deprecated','30065AyVJfK','logicField','dbId','responseFields','toField','main_sub','split','filter','extend','displayName','parse','indexes','columnCodeListWithDeleted','2033469IPUqWT','method','1737735ehRoMj','allFields','fromField','4VmHVJS','1656fNxnRF','modelId','read','deleted','modifierIdField','responseBody','beforeScriptId','detail','object','string','title','relatedPageInfoList','host','creatorNameField','code','properties','bizRelationType','updateTimeField','required','751119vEUzeh','dbName','toTableName','source','sourceType','tableName','pkField','relationId','requestBody','name','tableComment','toDatasetName','path','alias','description','map'];a62_0x58a0=function(){return _0x38cd42;};return a62_0x58a0();}(function(_0x16db43,_0x55cb4b){const _0x4e5d3a=a62_0x112a,_0xc01e7e=_0x16db43();while(!![]){try{const _0x15262e=parseInt(_0x4e5d3a(0xb9))/0x1+parseInt(_0x4e5d3a(0xed))/0x2+parseInt(_0x4e5d3a(0xd0))/0x3+-parseInt(_0x4e5d3a(0xbc))/0x4*(parseInt(_0x4e5d3a(0xf2))/0x5)+-parseInt(_0x4e5d3a(0xf3))/0x6+parseInt(_0x4e5d3a(0xaa))/0x7*(-parseInt(_0x4e5d3a(0xbd))/0x8)+-parseInt(_0x4e5d3a(0xb7))/0x9;if(_0x15262e===_0x55cb4b)break;else _0xc01e7e['push'](_0xc01e7e['shift']());}catch(_0x4f2a17){_0xc01e7e['push'](_0xc01e7e['shift']());}}}(a62_0x58a0,0xdc343));import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function normalizeField(_0x3f1481){const _0x34e473=a62_0x112a;if(_0x3f1481[_0x34e473(0xc0)])return null;const _0x313ccb=Boolean(_0x3f1481['displayName']!==undefined||_0x3f1481[_0x34e473(0xe7)]!==undefined);let _0x48179c={};if(!_0x313ccb&&typeof _0x3f1481[_0x34e473(0xb2)]==='string')try{_0x48179c=JSON[_0x34e473(0xb4)](_0x3f1481[_0x34e473(0xb2)]);}catch{}const _0x169444=_0x313ccb?_0x3f1481[_0x34e473(0xd9)]:_0x3f1481[_0x34e473(0xcb)],_0x3d1d46=_0x313ccb?_0x3f1481[_0x34e473(0xb3)]:_0x3f1481[_0x34e473(0xd9)],_0x1e84d2=_0x313ccb?_0x3f1481[_0x34e473(0xe7)]:_0x3f1481[_0x34e473(0xf0)]||_0x3f1481['dataType'],_0x35395c=_0x313ccb?_0x3f1481[_0x34e473(0xd6)]===!![]:_0x48179c[_0x34e473(0xd6)]===!![],_0x11cd7a=_0x313ccb?_0x3f1481[_0x34e473(0xcf)]===!![]:_0x48179c['required']===!![],_0x15c757=_0x313ccb?_0x3f1481[_0x34e473(0xa8)]??null:_0x48179c[_0x34e473(0xa8)]??null,_0x209c5b={'name':_0x169444,'displayName':_0x3d1d46||_0x169444,'type':_0x1e84d2,'dbType':_0x3f1481[_0x34e473(0xec)],'pk':_0x35395c,'required':_0x11cd7a,'deprecated':_0x3f1481[_0x34e473(0xa9)]===!![],'description':_0x3f1481['description']||undefined};return Array[_0x34e473(0xeb)](_0x15c757)&&_0x15c757[_0x34e473(0xa6)]>0x0&&(_0x209c5b[_0x34e473(0xa8)]=_0x15c757),_0x209c5b;}function parseJsonMaybe(_0xa47f65){const _0x5c7881=a62_0x112a;if(typeof _0xa47f65!==_0x5c7881(0xc6))return _0xa47f65;try{return JSON[_0x5c7881(0xb4)](_0xa47f65);}catch{return _0xa47f65;}}function a62_0x112a(_0x7f881d,_0x504592){_0x7f881d=_0x7f881d-0xa2;const _0x58a0dc=a62_0x58a0();let _0x112a19=_0x58a0dc[_0x7f881d];return _0x112a19;}function normalizeOperationEntry(_0x461b17,_0x157d89){const _0x130a64=a62_0x112a;if(!_0x157d89||typeof _0x157d89!==_0x130a64(0xc5))return null;if(!_0x157d89[_0x130a64(0xb8)]||!_0x157d89[_0x130a64(0xdc)])return null;const _0x27b5f6={'name':_0x461b17,'method':_0x157d89[_0x130a64(0xb8)],'path':_0x157d89['path']};if(_0x157d89[_0x130a64(0xc9)])_0x27b5f6[_0x130a64(0xc9)]=_0x157d89[_0x130a64(0xc9)];if(_0x157d89[_0x130a64(0xd8)]!=null){const _0x1f95ff=parseJsonMaybe(_0x157d89[_0x130a64(0xd8)]);_0x27b5f6[_0x130a64(0xd8)]=_0x1f95ff;}if(_0x157d89[_0x130a64(0xc2)]!=null){const _0xbf64ba=parseJsonMaybe(_0x157d89[_0x130a64(0xc2)]);_0x27b5f6['responseBody']=_0xbf64ba;}if(_0x157d89['beforeScriptId']!=null)_0x27b5f6[_0x130a64(0xc3)]=_0x157d89[_0x130a64(0xc3)];if(_0x157d89[_0x130a64(0xef)]!=null)_0x27b5f6[_0x130a64(0xef)]=_0x157d89[_0x130a64(0xef)];if(Array[_0x130a64(0xeb)](_0x157d89['requestFields']))_0x27b5f6[_0x130a64(0xf1)]=_0x157d89[_0x130a64(0xf1)];if(Array[_0x130a64(0xeb)](_0x157d89[_0x130a64(0xad)]))_0x27b5f6['responseFields']=_0x157d89[_0x130a64(0xad)];return _0x27b5f6;}function summarizeDbtable(_0x76e4b5){const _0x1360df=a62_0x112a,_0x300351={},_0x58c295=['dbId',_0x1360df(0xd1),_0x1360df(0xd5),_0x1360df(0xe1),_0x1360df(0xd6),'allFields',_0x1360df(0xab),_0x1360df(0xe8),_0x1360df(0xce),_0x1360df(0xe9),_0x1360df(0xca),_0x1360df(0xc1),_0x1360df(0xee),'labelField',_0x1360df(0xe2)];for(const _0x145021 of _0x58c295){if(_0x76e4b5[_0x145021]!==undefined)_0x300351[_0x145021]=_0x76e4b5[_0x145021];}return typeof _0x300351[_0x1360df(0xba)]===_0x1360df(0xc6)&&_0x300351[_0x1360df(0xba)]['length']>0x0&&(_0x300351[_0x1360df(0xe3)]=_0x300351[_0x1360df(0xba)][_0x1360df(0xb0)](',')['map'](_0x5ef4ac=>_0x5ef4ac['trim']())['filter'](Boolean)),_0x300351;}function normalizeRelatedPages(_0x240130){const _0x14a67a=a62_0x112a;if(!Array[_0x14a67a(0xeb)](_0x240130))return[];return _0x240130['filter'](_0x4ac615=>_0x4ac615&&typeof _0x4ac615===_0x14a67a(0xc5))[_0x14a67a(0xdf)](_0x792a03=>({'id':_0x792a03['id'],'type':_0x792a03[_0x14a67a(0xf0)],'code':_0x792a03['code'],'title':_0x792a03[_0x14a67a(0xc7)],'deleted':_0x792a03[_0x14a67a(0xc0)]===!![]}));}export const datasetDetail={'service':a62_0x339f5a(0xe5),'command':a62_0x339f5a(0xc4),'description':a62_0x339f5a(0xa2),'risk':a62_0x339f5a(0xbf),'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':a62_0x339f5a(0xdd),'type':a62_0x339f5a(0xc6),'description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically'}],async 'execute'(_0x489c2b){const _0x53a9d7=a62_0x339f5a,_0x52573=await getDatasetDetail(_0x489c2b[_0x53a9d7(0xea)]('code')),_0x1664fe=Array['isArray'](_0x52573[_0x53a9d7(0xf4)])?_0x52573[_0x53a9d7(0xf4)]:Array[_0x53a9d7(0xeb)](_0x52573['properties'])?_0x52573[_0x53a9d7(0xcc)]:[],_0x259812=_0x1664fe[_0x53a9d7(0xdf)](_0x8f1a=>normalizeField(_0x8f1a))[_0x53a9d7(0xb1)](_0x3290d0=>_0x3290d0!==null),_0x1cce65=_0x52573[_0x53a9d7(0xa3)]??{},_0x15ca45=[];for(const [_0x1304b9,_0x2b9ff2]of Object[_0x53a9d7(0xe6)](_0x1cce65)){const _0x50d46e=normalizeOperationEntry(_0x1304b9,_0x2b9ff2);if(_0x50d46e)_0x15ca45['push'](_0x50d46e);}const _0xe90261=_0x52573[_0x53a9d7(0xa5)]??{},_0x38340f=_0x52573[_0x53a9d7(0xe5)]??{},_0x1cbbe=_0xe90261[_0x53a9d7(0xac)]!=null?{'id':_0xe90261[_0x53a9d7(0xac)],'name':_0xe90261[_0x53a9d7(0xd1)]??null}:undefined;let _0x5cacb0;return typeof _0x52573[_0x53a9d7(0xb2)]==='string'&&(_0x5cacb0=parseJsonMaybe(_0x52573[_0x53a9d7(0xb2)])),{'ok':!![],'data':{'id':_0x52573[_0x53a9d7(0xbe)]??_0x52573['id'],'name':_0x52573[_0x53a9d7(0xd9)],'code':_0x52573[_0x53a9d7(0xe4)]||_0x52573[_0x53a9d7(0xcb)],'doVersion':_0x52573[_0x53a9d7(0xe0)],'description':_0x52573[_0x53a9d7(0xde)]||_0x38340f[_0x53a9d7(0xda)]||undefined,'source':_0x52573[_0x53a9d7(0xd3)]||_0x38340f[_0x53a9d7(0xd4)],'table':_0xe90261[_0x53a9d7(0xd5)]||_0x38340f[_0x53a9d7(0xd5)],'datasetKey':_0xe90261['datasetKey'],'pk':_0xe90261['pkField'],'db':_0x1cbbe,'dbtable':summarizeDbtable(_0xe90261),'fields':_0x259812,'operations':_0x15ca45,'indexes':Array[_0x53a9d7(0xeb)](_0x38340f[_0x53a9d7(0xb5)])?_0x38340f['indexes']:[],'relations':Array[_0x53a9d7(0xeb)](_0x52573[_0x53a9d7(0xa7)])?_0x52573[_0x53a9d7(0xa7)][_0x53a9d7(0xdf)](_0x247c55=>({..._0x247c55['relationId']!=null?{'relationId':_0x247c55[_0x53a9d7(0xd7)]}:{},'fromDataset':_0x52573[_0x53a9d7(0xd9)],'fromCode':_0x52573[_0x53a9d7(0xe4)]||_0x52573[_0x53a9d7(0xcb)],'fromTable':_0xe90261[_0x53a9d7(0xd5)]||_0x38340f[_0x53a9d7(0xd5)],'fromField':_0x247c55[_0x53a9d7(0xbb)],'toDataset':_0x247c55[_0x53a9d7(0xdb)],'toCode':_0x247c55['toDatasetCode'],'toTable':_0x247c55[_0x53a9d7(0xd2)],'toField':_0x247c55[_0x53a9d7(0xae)],'labelField':_0x247c55['toFieldLabel']||undefined,'cardinality':_0x247c55['cardinality']||undefined,'bizRelationType':_0x247c55[_0x53a9d7(0xcd)]===_0x53a9d7(0xaf)?_0x53a9d7(0xaf):null})):[],'relatedPages':normalizeRelatedPages(_0x52573[_0x53a9d7(0xc8)]),...Array[_0x53a9d7(0xeb)](_0x52573[_0x53a9d7(0xb6)])?{'columnCodeListWithDeleted':_0x52573[_0x53a9d7(0xb6)]}:{},'formatRules':Array[_0x53a9d7(0xeb)](_0x52573['formatRules'])?_0x52573[_0x53a9d7(0xa4)]:[],'validateRules':Array['isArray'](_0x52573[_0x53a9d7(0xf5)])?_0x52573['validateRules']:[],..._0x5cacb0!==undefined?{'extend':_0x5cacb0}:{},'stats':{'fieldCount':_0x259812[_0x53a9d7(0xa6)],'operationCount':_0x15ca45[_0x53a9d7(0xa6)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a64_0x3d481f=a64_0x5822;(function(_0x5c2ac9,_0x152b1c){const _0x1ccc03=a64_0x5822,_0x52ffc3=_0x5c2ac9();while(!![]){try{const _0x1f57f3=parseInt(_0x1ccc03(0xab))/0x1+-parseInt(_0x1ccc03(0xb2))/0x2+parseInt(_0x1ccc03(0xad))/0x3*(-parseInt(_0x1ccc03(0x8f))/0x4)+-parseInt(_0x1ccc03(0x90))/0x5+-parseInt(_0x1ccc03(0xb1))/0x6+-parseInt(_0x1ccc03(0x89))/0x7*(parseInt(_0x1ccc03(0x88))/0x8)+parseInt(_0x1ccc03(0xb9))/0x9;if(_0x1f57f3===_0x152b1c)break;else _0x52ffc3['push'](_0x52ffc3['shift']());}catch(_0x22d92d){_0x52ffc3['push'](_0x52ffc3['shift']());}}}(a64_0x5849,0x9f4fb));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';function a64_0x5849(){const _0x166c29=['Expectation\x20mismatch\x20at\x20extend.','Patch\x20dataset\x20top-level\x20extend\x20safely','dataset','expect-json','patch-json','join','shape','object','3698456KUdlhH','14lfRwWB','stringify','dbName','patch','POST','dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','836IuWvrV','5392670XhjwkN','message','--patch-json','hint','tableName','str','dbId','parse','Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.','length','value','--expect-json','Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20','extend.','validation','Allowed\x20keys:\x20','--code\x20is\x20required','No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.','dbtableConfig','\x20must\x20be\x20a\x20JSON\x20object','isArray','write','sort','name','appCode','Expected\x20','No\x20changes\x20for\x20dataset\x20extend','979918GwufHg','code','7263ggfRJL','entries','push','string','5917116AHgNhv','1225548zdnkZr','has','expect','keys','extend','Unsupported\x20patch\x20key:\x20',',\x20actual\x20','34026462MKloxO','extend-update','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','trim','get','Dry-run:\x20dataset\x20extend\x20would\x20change\x20('];a64_0x5849=function(){return _0x166c29;};return a64_0x5849();}import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([['businessGroup',{'message':a64_0x3d481f(0x8e),'hint':a64_0x3d481f(0x98)}]]);export function parseJsonObjectFlag(_0x428f9f,_0x34907f){const _0x31ad3e=a64_0x3d481f;if(!_0x428f9f)return undefined;let _0x3eff92;try{_0x3eff92=JSON['parse'](_0x428f9f);}catch(_0x3f3930){const _0xc410aa=_0x3f3930 instanceof Error?_0x3f3930[_0x31ad3e(0x91)]:String(_0x3f3930);throw CliErrors[_0x31ad3e(0x9e)](_0x34907f+'\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0xc410aa);}if(!isPlainObject(_0x3eff92)||Array['isArray'](_0x3eff92))throw CliErrors[_0x31ad3e(0x9e)](_0x34907f+_0x31ad3e(0xa3));return _0x3eff92;}export function validateExtendPatchKeys(_0x5d6750){const _0x387b19=a64_0x3d481f,_0x193c10=Object[_0x387b19(0xb5)](_0x5d6750);if(_0x193c10[_0x387b19(0x99)]===0x0)throw CliErrors[_0x387b19(0x9e)]('--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key');for(const _0x398171 of _0x193c10){const _0x119400=EXTEND_PATCH_REDIRECTS[_0x387b19(0x7e)](_0x398171);if(_0x119400)throw CliErrors[_0x387b19(0x9e)](_0x119400[_0x387b19(0x91)],_0x119400[_0x387b19(0x93)]);if(!MUTABLE_EXTEND_KEYS[_0x387b19(0xb3)](_0x398171))throw CliErrors['validation'](_0x387b19(0xb7)+_0x398171,describeMutableExtendKeys());}}function describeMutableExtendKeys(){const _0x2b4a20=a64_0x3d481f,_0x4dd7cc=Array['from'](MUTABLE_EXTEND_KEYS)[_0x2b4a20(0xa6)]();return _0x4dd7cc['length']>0x0?_0x2b4a20(0x9f)+_0x4dd7cc['join'](',\x20'):_0x2b4a20(0xa1);}export function applyExtendPatch(_0x5a19c8,_0x582735){const _0xfca6b7=a64_0x3d481f;validateExtendPatchKeys(_0x582735);const _0x19751b=deepClone(_0x5a19c8),_0x51e848=[];for(const [_0x437eed,_0x18bf55]of Object[_0xfca6b7(0xae)](_0x582735)){const _0x5f2c46=_0x19751b[_0x437eed],_0x2397a1=deepClone(_0x18bf55);!deepEqual(_0x5f2c46,_0x2397a1)&&(_0x19751b[_0x437eed]=_0x2397a1,_0x51e848[_0xfca6b7(0xaf)](_0xfca6b7(0x9d)+_0x437eed));}return _0x51e848[_0xfca6b7(0xa6)](),{'after':_0x19751b,'changedPaths':_0x51e848,'changed':_0x51e848[_0xfca6b7(0x99)]>0x0};}export function assertExpectation(_0x272d43,_0x971b5a){const _0x5e8438=a64_0x3d481f;if(!_0x971b5a)return;for(const [_0x286117,_0x5e42b4]of Object[_0x5e8438(0xae)](_0x971b5a)){const _0x252a41=_0x272d43[_0x286117];if(!deepEqual(_0x252a41,_0x5e42b4))throw CliErrors['validation'](_0x5e8438(0x80)+_0x286117,_0x5e8438(0xa9)+JSON[_0x5e8438(0x8a)](_0x5e42b4)+_0x5e8438(0xb8)+JSON[_0x5e8438(0x8a)](_0x252a41));}}export async function buildDatasetExtendUpdateResult({appCode:_0x17ccfb,input:_0x2f623d,dryRun:_0x5668bd}){const _0x1e0877=a64_0x3d481f;validateInput(_0x2f623d);const _0x4a9ec7=await getDatasetDetail(_0x2f623d[_0x1e0877(0xac)]),_0x591649=parseDatasetExtend(_0x4a9ec7[_0x1e0877(0xb6)]),_0x36ccac=deepClone(_0x591649[_0x1e0877(0x9a)]);assertExpectation(_0x36ccac,_0x2f623d[_0x1e0877(0xb4)]);const {after:_0x53650a,changedPaths:_0x39f3ee,changed:_0x18a093}=applyExtendPatch(_0x36ccac,_0x2f623d[_0x1e0877(0x8c)]),_0x4e79f8=summarizeDataset(_0x4a9ec7,_0x2f623d[_0x1e0877(0xac)]);return _0x18a093&&!_0x5668bd&&(_0x4a9ec7[_0x1e0877(0xb6)]=serializeDatasetExtend(_0x53650a,_0x591649[_0x1e0877(0x86)]),await updateDrivenData(_0x4a9ec7)),{'ok':!![],'data':{'appCode':_0x17ccfb,'selector':{'code':_0x2f623d['code']},'dataset':_0x4e79f8,'dryRun':_0x5668bd,'changed':_0x18a093,'changedPaths':_0x39f3ee,'before':{'extend':_0x36ccac},'after':{'extend':_0x53650a},'submitted':_0x18a093&&!_0x5668bd},'message':_0x18a093?_0x5668bd?_0x1e0877(0x7f)+_0x39f3ee[_0x1e0877(0x85)](',\x20')+')':'Updated\x20dataset\x20extend\x20('+_0x39f3ee['join'](',\x20')+')':_0x1e0877(0xaa)};}export const datasetExtendUpdate={'service':a64_0x3d481f(0x82),'command':a64_0x3d481f(0xba),'description':a64_0x3d481f(0x81),'risk':a64_0x3d481f(0xa5),'flags':[CODE_FLAG,{'name':a64_0x3d481f(0x84),'type':'string','required':!![],'description':a64_0x3d481f(0xbb)},{'name':a64_0x3d481f(0x83),'type':a64_0x3d481f(0xb0),'required':![],'description':'JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4bdbb3){validateInput(readExtendUpdateInput(_0x4bdbb3));},async 'dryRun'(_0x399b38){const _0x13982b=a64_0x3d481f,_0x166c92=await buildDatasetExtendUpdateResult({'appCode':_0x399b38['appCode'],'input':readExtendUpdateInput(_0x399b38),'dryRun':!![]});return{'method':_0x13982b(0x8d),'url':'/smartapi/dataset/update-driven-data','body':_0x166c92['data'],'description':_0x166c92['message']};},async 'execute'(_0x1068a3){const _0x3e4a41=a64_0x3d481f;return buildDatasetExtendUpdateResult({'appCode':_0x1068a3[_0x3e4a41(0xa8)],'input':readExtendUpdateInput(_0x1068a3),'dryRun':![]});}};function readExtendUpdateInput(_0x2c39e5){const _0x1ba747=a64_0x3d481f,_0x38a008=trim(_0x2c39e5[_0x1ba747(0x95)]('code')),_0x563245=parseJsonObjectFlag(_0x2c39e5[_0x1ba747(0x95)](_0x1ba747(0x84)),_0x1ba747(0x92)),_0x1524e2=parseJsonObjectFlag(_0x2c39e5[_0x1ba747(0x95)](_0x1ba747(0x83)),_0x1ba747(0x9b));return{'code':_0x38a008,'patch':_0x563245||{},'expect':_0x1524e2};}function validateInput(_0x575025){const _0x3d8f09=a64_0x3d481f;if(!_0x575025[_0x3d8f09(0xac)])throw CliErrors['validation'](_0x3d8f09(0xa0));validateExtendPatchKeys(_0x575025['patch']);}function parseDatasetExtend(_0x1750d8){const _0x6b8507=a64_0x3d481f;if(typeof _0x1750d8===_0x6b8507(0xb0)){const _0x3a00b6=_0x1750d8['trim']();if(!_0x3a00b6)return{'value':{},'shape':_0x6b8507(0xb0)};let _0x15e2ec;try{_0x15e2ec=JSON['parse'](_0x3a00b6);}catch(_0x29ff0a){const _0x1f53df=_0x29ff0a instanceof Error?_0x29ff0a[_0x6b8507(0x91)]:String(_0x29ff0a);throw CliErrors['validation'](_0x6b8507(0x9c)+_0x1f53df);}if(!isPlainObject(_0x15e2ec)||Array[_0x6b8507(0xa4)](_0x15e2ec))throw CliErrors[_0x6b8507(0x9e)]('Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object');return{'value':_0x15e2ec,'shape':_0x6b8507(0xb0)};}if(_0x1750d8===undefined||_0x1750d8===null)return{'value':{},'shape':_0x6b8507(0xb0)};if(!isPlainObject(_0x1750d8)||Array[_0x6b8507(0xa4)](_0x1750d8))throw CliErrors[_0x6b8507(0x9e)]('Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object');return{'value':_0x1750d8,'shape':'object'};}function serializeDatasetExtend(_0x23d607,_0x1d83e6){const _0x45b129=a64_0x3d481f;return _0x1d83e6===_0x45b129(0xb0)?JSON[_0x45b129(0x8a)](_0x23d607):_0x23d607;}function a64_0x5822(_0x4ce47b,_0x3082fc){_0x4ce47b=_0x4ce47b-0x7d;const _0x58493c=a64_0x5849();let _0x5822eb=_0x58493c[_0x4ce47b];return _0x5822eb;}function summarizeDataset(_0x45e656,_0x308b56){const _0x178b6b=a64_0x3d481f,_0x399059=isPlainObject(_0x45e656[_0x178b6b(0x82)])?_0x45e656['dataset']:{},_0x2d0ad7=isPlainObject(_0x45e656[_0x178b6b(0xa2)])?_0x45e656[_0x178b6b(0xa2)]:{};return{'id':_0x45e656['modelId']??_0x45e656['id']??_0x399059['datasetId']??null,'code':_0x45e656['modelCode']??_0x45e656['code']??_0x399059['datasetCode']??_0x308b56,'name':_0x45e656[_0x178b6b(0xa7)]??_0x399059['datasetName']??null,'table':_0x2d0ad7[_0x178b6b(0x94)]??_0x399059[_0x178b6b(0x94)]??null,'db':_0x2d0ad7[_0x178b6b(0x8b)]??_0x2d0ad7[_0x178b6b(0x96)]??null};}function deepClone(_0x5abd8f){const _0x2e5e13=a64_0x3d481f;if(_0x5abd8f===undefined)return _0x5abd8f;return JSON[_0x2e5e13(0x97)](JSON[_0x2e5e13(0x8a)](_0x5abd8f));}function deepEqual(_0x2059f5,_0x1bae17){const _0x339781=a64_0x3d481f;return JSON['stringify'](_0x2059f5)===JSON[_0x339781(0x8a)](_0x1bae17);}function isPlainObject(_0xe52d2a){const _0x56bfcc=a64_0x3d481f;return Boolean(_0xe52d2a)&&typeof _0xe52d2a===_0x56bfcc(0x87)&&!Array[_0x56bfcc(0xa4)](_0xe52d2a);}function trim(_0x148377){const _0x82baf4=a64_0x3d481f,_0xffd83=String(_0x148377||'')[_0x82baf4(0x7d)]();return _0xffd83;}
|
|
1
|
+
const a63_0x374b6b=a63_0x1fa5;(function(_0x2b8def,_0x5bba8e){const _0x2ae4da=a63_0x1fa5,_0xc6cd43=_0x2b8def();while(!![]){try{const _0x2c7938=-parseInt(_0x2ae4da(0xf8))/0x1*(-parseInt(_0x2ae4da(0x130))/0x2)+-parseInt(_0x2ae4da(0x127))/0x3*(parseInt(_0x2ae4da(0x13b))/0x4)+parseInt(_0x2ae4da(0x10b))/0x5*(parseInt(_0x2ae4da(0x113))/0x6)+-parseInt(_0x2ae4da(0x10e))/0x7+parseInt(_0x2ae4da(0x120))/0x8*(-parseInt(_0x2ae4da(0x125))/0x9)+parseInt(_0x2ae4da(0x131))/0xa*(parseInt(_0x2ae4da(0x102))/0xb)+parseInt(_0x2ae4da(0x119))/0xc*(parseInt(_0x2ae4da(0x11d))/0xd);if(_0x2c7938===_0x5bba8e)break;else _0xc6cd43['push'](_0xc6cd43['shift']());}catch(_0x37953e){_0xc6cd43['push'](_0xc6cd43['shift']());}}}(a63_0x28c4,0xcafb7));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([[a63_0x374b6b(0x135),{'message':a63_0x374b6b(0x112),'hint':a63_0x374b6b(0x13a)}]]);export function parseJsonObjectFlag(_0x4ecd50,_0x1baae1){const _0xa5219=a63_0x374b6b;if(!_0x4ecd50)return undefined;let _0x10814f;try{_0x10814f=JSON[_0xa5219(0x122)](_0x4ecd50);}catch(_0x5d6bc2){const _0x16db46=_0x5d6bc2 instanceof Error?_0x5d6bc2[_0xa5219(0x11c)]:String(_0x5d6bc2);throw CliErrors['validation'](_0x1baae1+'\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x16db46);}if(!isPlainObject(_0x10814f)||Array[_0xa5219(0xf7)](_0x10814f))throw CliErrors['validation'](_0x1baae1+'\x20must\x20be\x20a\x20JSON\x20object');return _0x10814f;}export function validateExtendPatchKeys(_0x5b85b0){const _0x597303=a63_0x374b6b,_0x5503fe=Object[_0x597303(0x12f)](_0x5b85b0);if(_0x5503fe[_0x597303(0x101)]===0x0)throw CliErrors['validation']('--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key');for(const _0x3c0ad4 of _0x5503fe){const _0x454ab3=EXTEND_PATCH_REDIRECTS[_0x597303(0xfa)](_0x3c0ad4);if(_0x454ab3)throw CliErrors['validation'](_0x454ab3['message'],_0x454ab3[_0x597303(0x11e)]);if(!MUTABLE_EXTEND_KEYS[_0x597303(0x137)](_0x3c0ad4))throw CliErrors[_0x597303(0x12b)](_0x597303(0x105)+_0x3c0ad4,describeMutableExtendKeys());}}function describeMutableExtendKeys(){const _0x39a93b=a63_0x374b6b,_0x5cdd86=Array[_0x39a93b(0x108)](MUTABLE_EXTEND_KEYS)['sort']();return _0x5cdd86[_0x39a93b(0x101)]>0x0?_0x39a93b(0x115)+_0x5cdd86[_0x39a93b(0x10c)](',\x20'):'No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.';}export function applyExtendPatch(_0x1cebca,_0x2fecb0){const _0x36ada6=a63_0x374b6b;validateExtendPatchKeys(_0x2fecb0);const _0x1c2ae5=deepClone(_0x1cebca),_0x3470fe=[];for(const [_0x54db03,_0x1ad6f2]of Object[_0x36ada6(0x11b)](_0x2fecb0)){const _0x52cc27=_0x1c2ae5[_0x54db03],_0x1da738=deepClone(_0x1ad6f2);!deepEqual(_0x52cc27,_0x1da738)&&(_0x1c2ae5[_0x54db03]=_0x1da738,_0x3470fe['push'](_0x36ada6(0xfb)+_0x54db03));}return _0x3470fe[_0x36ada6(0x121)](),{'after':_0x1c2ae5,'changedPaths':_0x3470fe,'changed':_0x3470fe['length']>0x0};}export function assertExpectation(_0x92301d,_0x5adbdf){const _0x416e82=a63_0x374b6b;if(!_0x5adbdf)return;for(const [_0x454d2e,_0x162386]of Object['entries'](_0x5adbdf)){const _0xb9063=_0x92301d[_0x454d2e];if(!deepEqual(_0xb9063,_0x162386))throw CliErrors[_0x416e82(0x12b)](_0x416e82(0x12a)+_0x454d2e,_0x416e82(0x124)+JSON[_0x416e82(0x126)](_0x162386)+_0x416e82(0xf9)+JSON[_0x416e82(0x126)](_0xb9063));}}function a63_0x1fa5(_0x523961,_0x232ca9){_0x523961=_0x523961-0xf7;const _0x28c45c=a63_0x28c4();let _0x1fa579=_0x28c45c[_0x523961];return _0x1fa579;}export async function buildDatasetExtendUpdateResult({appCode:_0x50eaab,input:_0x5494bd,dryRun:_0x3de63f}){const _0x24d3dd=a63_0x374b6b;validateInput(_0x5494bd);const _0x4875d9=await getDatasetDetail(_0x5494bd[_0x24d3dd(0x100)]),_0x1faf9=parseDatasetExtend(_0x4875d9[_0x24d3dd(0x139)]),_0x110b3d=deepClone(_0x1faf9[_0x24d3dd(0x11f)]);assertExpectation(_0x110b3d,_0x5494bd[_0x24d3dd(0x12c)]);const {after:_0x53a255,changedPaths:_0x107ac4,changed:_0x4761eb}=applyExtendPatch(_0x110b3d,_0x5494bd['patch']),_0x45070b=summarizeDataset(_0x4875d9,_0x5494bd[_0x24d3dd(0x100)]);return _0x4761eb&&!_0x3de63f&&(_0x4875d9[_0x24d3dd(0x139)]=serializeDatasetExtend(_0x53a255,_0x1faf9[_0x24d3dd(0x136)]),await updateDrivenData(_0x4875d9)),{'ok':!![],'data':{'appCode':_0x50eaab,'selector':{'code':_0x5494bd[_0x24d3dd(0x100)]},'dataset':_0x45070b,'dryRun':_0x3de63f,'changed':_0x4761eb,'changedPaths':_0x107ac4,'before':{'extend':_0x110b3d},'after':{'extend':_0x53a255},'submitted':_0x4761eb&&!_0x3de63f},'message':_0x4761eb?_0x3de63f?_0x24d3dd(0xfe)+_0x107ac4['join'](',\x20')+')':_0x24d3dd(0x129)+_0x107ac4[_0x24d3dd(0x10c)](',\x20')+')':_0x24d3dd(0x134)};}export const datasetExtendUpdate={'service':'dataset','command':'extend-update','description':a63_0x374b6b(0x123),'risk':a63_0x374b6b(0xff),'flags':[CODE_FLAG,{'name':'patch-json','type':a63_0x374b6b(0x12d),'required':!![],'description':a63_0x374b6b(0x104)},{'name':a63_0x374b6b(0x114),'type':a63_0x374b6b(0x12d),'required':![],'description':'JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2b5431){validateInput(readExtendUpdateInput(_0x2b5431));},async 'dryRun'(_0x285e4e){const _0x2425bf=a63_0x374b6b,_0x4a72a6=await buildDatasetExtendUpdateResult({'appCode':_0x285e4e[_0x2425bf(0x110)],'input':readExtendUpdateInput(_0x285e4e),'dryRun':!![]});return{'method':'POST','url':_0x2425bf(0x133),'body':_0x4a72a6[_0x2425bf(0x11a)],'description':_0x4a72a6['message']};},async 'execute'(_0x19b2bd){const _0x210a06=a63_0x374b6b;return buildDatasetExtendUpdateResult({'appCode':_0x19b2bd[_0x210a06(0x110)],'input':readExtendUpdateInput(_0x19b2bd),'dryRun':![]});}};function readExtendUpdateInput(_0x249b5a){const _0x117390=a63_0x374b6b,_0x3a97e2=trim(_0x249b5a['str'](_0x117390(0x100))),_0x5ba802=parseJsonObjectFlag(_0x249b5a[_0x117390(0x13c)](_0x117390(0x107)),_0x117390(0x10f)),_0x2a32e9=parseJsonObjectFlag(_0x249b5a[_0x117390(0x13c)](_0x117390(0x114)),_0x117390(0xfc));return{'code':_0x3a97e2,'patch':_0x5ba802||{},'expect':_0x2a32e9};}function validateInput(_0x4c855c){const _0x1a7fd3=a63_0x374b6b;if(!_0x4c855c[_0x1a7fd3(0x100)])throw CliErrors[_0x1a7fd3(0x12b)]('--code\x20is\x20required');validateExtendPatchKeys(_0x4c855c[_0x1a7fd3(0x117)]);}function parseDatasetExtend(_0x471600){const _0x528a40=a63_0x374b6b;if(typeof _0x471600===_0x528a40(0x12d)){const _0x629894=_0x471600[_0x528a40(0x12e)]();if(!_0x629894)return{'value':{},'shape':_0x528a40(0x12d)};let _0x3f4754;try{_0x3f4754=JSON[_0x528a40(0x122)](_0x629894);}catch(_0x442a29){const _0x53ce7c=_0x442a29 instanceof Error?_0x442a29[_0x528a40(0x11c)]:String(_0x442a29);throw CliErrors[_0x528a40(0x12b)]('Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x53ce7c);}if(!isPlainObject(_0x3f4754)||Array[_0x528a40(0xf7)](_0x3f4754))throw CliErrors[_0x528a40(0x12b)]('Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object');return{'value':_0x3f4754,'shape':_0x528a40(0x12d)};}if(_0x471600===undefined||_0x471600===null)return{'value':{},'shape':_0x528a40(0x12d)};if(!isPlainObject(_0x471600)||Array[_0x528a40(0xf7)](_0x471600))throw CliErrors['validation'](_0x528a40(0x116));return{'value':_0x471600,'shape':_0x528a40(0x111)};}function a63_0x28c4(){const _0xd3e763=['get','extend.','--expect-json','dbtableConfig','Dry-run:\x20dataset\x20extend\x20would\x20change\x20(','write','code','length','1406218QKoMLD','name','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','Unsupported\x20patch\x20key:\x20','datasetName','patch-json','from','datasetId','dataset','11725gdauyk','join','modelId','10906385BxfgLC','--patch-json','appCode','object','dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','750zMTfsK','expect-json','Allowed\x20keys:\x20','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','patch','dbName','1464tCcXIK','data','entries','message','112697zIOaWM','hint','value','120248uvShYi','sort','parse','Patch\x20dataset\x20top-level\x20extend\x20safely','Expected\x20','396tSFCLO','stringify','27oOwynQ','tableName','Updated\x20dataset\x20extend\x20(','Expectation\x20mismatch\x20at\x20extend.','validation','expect','string','trim','keys','210814YjACJf','80toZBuZ','dbId','/smartapi/dataset/update-driven-data','No\x20changes\x20for\x20dataset\x20extend','businessGroup','shape','has','datasetCode','extend','Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.','26872AHyqvL','str','modelCode','isArray','7CPUawT',',\x20actual\x20'];a63_0x28c4=function(){return _0xd3e763;};return a63_0x28c4();}function serializeDatasetExtend(_0x1114d2,_0x3d0928){const _0x2ab7d8=a63_0x374b6b;return _0x3d0928==='string'?JSON[_0x2ab7d8(0x126)](_0x1114d2):_0x1114d2;}function summarizeDataset(_0xca81ab,_0x386ba5){const _0x475add=a63_0x374b6b,_0x3da22b=isPlainObject(_0xca81ab[_0x475add(0x10a)])?_0xca81ab[_0x475add(0x10a)]:{},_0x33bd03=isPlainObject(_0xca81ab[_0x475add(0xfd)])?_0xca81ab[_0x475add(0xfd)]:{};return{'id':_0xca81ab[_0x475add(0x10d)]??_0xca81ab['id']??_0x3da22b[_0x475add(0x109)]??null,'code':_0xca81ab[_0x475add(0x13d)]??_0xca81ab['code']??_0x3da22b[_0x475add(0x138)]??_0x386ba5,'name':_0xca81ab[_0x475add(0x103)]??_0x3da22b[_0x475add(0x106)]??null,'table':_0x33bd03[_0x475add(0x128)]??_0x3da22b[_0x475add(0x128)]??null,'db':_0x33bd03[_0x475add(0x118)]??_0x33bd03[_0x475add(0x132)]??null};}function deepClone(_0x102f4d){const _0x56b199=a63_0x374b6b;if(_0x102f4d===undefined)return _0x102f4d;return JSON[_0x56b199(0x122)](JSON[_0x56b199(0x126)](_0x102f4d));}function deepEqual(_0x5359b1,_0x161f72){const _0xce613f=a63_0x374b6b;return JSON[_0xce613f(0x126)](_0x5359b1)===JSON['stringify'](_0x161f72);}function isPlainObject(_0x2eb73a){const _0x462a52=a63_0x374b6b;return Boolean(_0x2eb73a)&&typeof _0x2eb73a===_0x462a52(0x111)&&!Array[_0x462a52(0xf7)](_0x2eb73a);}function trim(_0x1594d8){const _0x4417c5=a63_0x374b6b,_0x2885bc=String(_0x1594d8||'')[_0x4417c5(0x12e)]();return _0x2885bc;}
|