@lovrabet/rabetbase-cli 2.5.3-beta.2 → 2.5.3-beta.4
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/api-group.d.ts +22 -0
- package/lib/api/api-group.js +1 -0
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +18 -2
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.d.ts +11 -0
- package/lib/api/legacy-api-file.js +1 -0
- package/lib/api/model-registry-file.d.ts +36 -0
- package/lib/api/model-registry-file.js +1 -0
- package/lib/api/model-registry-scaffold.d.ts +7 -0
- package/lib/api/model-registry-scaffold.js +1 -0
- package/lib/api/model-source.d.ts +6 -0
- package/lib/api/model-source.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.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.d.ts +7 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-create.js +1 -0
- package/lib/commands/dataset/cross-relation-delete.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-delete.js +1 -0
- package/lib/commands/dataset/cross-relation-list.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-list.js +1 -0
- package/lib/commands/dataset/cross-relation-shared.d.ts +190 -0
- package/lib/commands/dataset/cross-relation-shared.js +1 -0
- package/lib/commands/dataset/cross-relation-update.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-update.js +1 -0
- 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-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.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/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.d.ts +28 -0
- package/lib/commands/project/api-architecture-upgrade.js +1 -0
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.d.ts +30 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.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.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.d.ts +5 -3
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.d.ts +2 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +2 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.d.ts +13 -17
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +6 -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/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.d.ts +41 -0
- package/lib/core/cross-db-relation.js +1 -0
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.d.ts +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +0 -10
- 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 +11 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.d.ts +19 -0
- 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 +6 -1
- package/skills/rabetbase/SKILL.md +16 -10
- package/skills/rabetbase/guides/backend-function.md +5 -1
- package/skills/rabetbase/guides/bff-creation-workflow.md +3 -1
- package/skills/rabetbase/guides/cross-database-bff.md +70 -0
- package/skills/rabetbase/guides/data-api-guidelines.md +35 -33
- package/skills/rabetbase/guides/sdk-client-generation.md +112 -61
- package/skills/rabetbase/guides/sql-creation-workflow.md +2 -0
- package/skills/rabetbase/guides/typescript-sdk.md +9 -0
- package/skills/rabetbase/references/rabetbase-api-pull.md +30 -19
- package/skills/rabetbase/references/rabetbase-app-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-config.md +2 -1
- package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +64 -0
- package/skills/rabetbase/references/rabetbase-project-create.md +3 -3
- package/skills/rabetbase/references/rabetbase-project-upgrade.md +24 -13
- package/skills/rabetbase.manifest.json +5 -3
- package/templates/README.md +46 -6
- package/templates/generate-api/model-runtime.ts.tpl +101 -0
- package/templates/generate-api/profile-api.ts.tpl +21 -0
- package/templates/generate-api/profile-client.ts.tpl +14 -0
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a227_0x596368=a227_0x3094;(function(_0x3d0703,_0x3aa844){const _0x45e595=a227_0x3094,_0x942296=_0x3d0703();while(!![]){try{const _0xf8370b=parseInt(_0x45e595(0x1f0))/0x1*(parseInt(_0x45e595(0x1e1))/0x2)+parseInt(_0x45e595(0x1e3))/0x3+-parseInt(_0x45e595(0x1dd))/0x4+parseInt(_0x45e595(0x1d9))/0x5*(-parseInt(_0x45e595(0x1d7))/0x6)+-parseInt(_0x45e595(0x1f2))/0x7*(-parseInt(_0x45e595(0x1de))/0x8)+parseInt(_0x45e595(0x1d2))/0x9*(-parseInt(_0x45e595(0x1f5))/0xa)+-parseInt(_0x45e595(0x1dc))/0xb;if(_0xf8370b===_0x3aa844)break;else _0x942296['push'](_0x942296['shift']());}catch(_0x9b6be9){_0x942296['push'](_0x942296['shift']());}}}(a227_0x1e86,0xdc891));function a227_0x3094(_0xde04f4,_0x156c05){_0xde04f4=_0xde04f4-0x1c8;const _0x1e862c=a227_0x1e86();let _0x309464=_0x1e862c[_0xde04f4];return _0x309464;}import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x437de4,_0x54245e,_0x1fdca5){const _0x2c4399=a227_0x3094,_0x866b31=await scanLocalSqlQueries(_0x437de4),_0x2b3f23=new Map();for(const _0x4e9b09 of _0x866b31){if(_0x1fdca5&&_0x4e9b09[_0x2c4399(0x1e2)]!==_0x1fdca5)continue;const _0x12888a=_0x2b3f23['get'](_0x4e9b09['sqlCode'])??[];_0x12888a[_0x2c4399(0x1e5)](_0x4e9b09),_0x2b3f23['set'](_0x4e9b09[_0x2c4399(0x1e2)],_0x12888a);}if(_0x1fdca5&&!_0x2b3f23['has'](_0x1fdca5))throw CliErrors['validation'](_0x2c4399(0x1e6)+_0x1fdca5);const _0x49e369=[];for(const [_0x583d33,_0x19beb0]of _0x2b3f23[_0x2c4399(0x1ff)]()){if(_0x19beb0[_0x2c4399(0x1db)]===0x1){_0x49e369[_0x2c4399(0x1e5)](_0x19beb0[0x0]);continue;}const _0x163d56=_0x54245e[_0x2c4399(0x1d5)][_0x583d33],_0x993040=_0x163d56?.[_0x2c4399(0x1eb)],_0x5cc56f=_0x993040?_0x19beb0['filter'](_0xd4e863=>_0xd4e863[_0x2c4399(0x1f4)]!==_0x993040):_0x19beb0;if(_0x163d56&&_0x5cc56f['length']===0x1){_0x49e369[_0x2c4399(0x1e5)](_0x5cc56f[0x0]);continue;}throw CliErrors[_0x2c4399(0x1f7)](_0x2c4399(0x1cb)+_0x583d33+_0x2c4399(0x1fc));}return _0x49e369;}export const sqlPush={'service':a227_0x596368(0x1e7),'command':a227_0x596368(0x1e5),'description':a227_0x596368(0x1cf),'risk':a227_0x596368(0x1cd),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a227_0x596368(0x1ce),'type':'boolean','description':a227_0x596368(0x1e8)}],async 'dryRun'(_0x512745){const _0x15e241=a227_0x596368,_0x24810e=loadSqlProjectConfig(_0x512745[_0x15e241(0x1d0)]),_0x409587=await readSqlLockFile(_0x24810e[_0x15e241(0x1df)]),{appLock:_0x11af14}=ensureSqlLockScope(_0x409587??createEmptySqlLock(),_0x512745[_0x15e241(0x1d0)],_0x24810e[_0x15e241(0x201)],_0x15e241(0x1e5)),_0x117482=await getTargetSqlQueries(_0x24810e,_0x11af14,_0x512745['str'](_0x15e241(0x1ee))||undefined),_0x54b4cc=[];for(const _0x50ad95 of _0x117482){const _0x3c5597=await computeSqlFileHash(_0x50ad95[_0x15e241(0x1d3)]),_0x46078e=_0x11af14[_0x15e241(0x1d5)][_0x50ad95['sqlCode']],_0x2e5741=!!_0x46078e&&(_0x46078e[_0x15e241(0x1eb)]!==_0x50ad95[_0x15e241(0x1f4)]||!!_0x50ad95[_0x15e241(0x1c9)]&&_0x46078e[_0x15e241(0x1c9)]!==_0x50ad95[_0x15e241(0x1c9)]);if(!_0x512745[_0x15e241(0x1ec)](_0x15e241(0x1ce))&&_0x46078e&&_0x46078e['hash']===_0x3c5597&&!_0x2e5741)continue;_0x54b4cc[_0x15e241(0x1e5)](_0x50ad95[_0x15e241(0x1e2)]);}return{'method':'POST','url':_0x15e241(0x1f3),'body':{'sqlCodes':_0x54b4cc,'appCode':_0x512745[_0x15e241(0x1d0)]},'description':'Would\x20push\x20'+_0x54b4cc[_0x15e241(0x1db)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x3820d1){const _0x437228=a227_0x596368,_0x12e85f=loadSqlProjectConfig(_0x3820d1['appCode']),_0x5c2b48=await readSqlLockFile(_0x12e85f[_0x437228(0x1df)]),{lockData:_0x2a9210,appLock:_0x5b6b83}=ensureSqlLockScope(_0x5c2b48??createEmptySqlLock(),_0x3820d1[_0x437228(0x1d0)],_0x12e85f['sqlRoot'],_0x437228(0x1e5)),_0x414510=await getTargetSqlQueries(_0x12e85f,_0x5b6b83,_0x3820d1[_0x437228(0x1cc)]('sqlcode')||undefined);if(_0x414510[_0x437228(0x1db)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x217cf3=[],_0x24300c=[],_0x1ecfe2=[];for(const _0xdf2e9f of _0x414510){const _0x3acfae=_0x5b6b83['sqls'][_0xdf2e9f[_0x437228(0x1e2)]];if(!_0x3acfae){_0x1ecfe2[_0x437228(0x1e5)]({'sqlCode':_0xdf2e9f[_0x437228(0x1e2)],'error':_0x437228(0x1d4)});continue;}try{const _0x3340e9=await computeSqlFileHash(_0xdf2e9f[_0x437228(0x1d3)]),_0x12bdc=_0x3acfae[_0x437228(0x1eb)]!==_0xdf2e9f['relativePath']||!!_0xdf2e9f['sqlName']&&_0x3acfae[_0x437228(0x1c9)]!==_0xdf2e9f['sqlName'];if(!_0x3820d1[_0x437228(0x1ec)]('force')&&_0x3acfae[_0x437228(0x1fd)]===_0x3340e9&&!_0x12bdc){_0x24300c[_0x437228(0x1e5)]({'sqlCode':_0xdf2e9f[_0x437228(0x1e2)],'reason':_0x437228(0x1fb)});continue;}if(_0x3acfae['version']==null){_0x1ecfe2[_0x437228(0x1e5)]({'sqlCode':_0xdf2e9f[_0x437228(0x1e2)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x2611c5=await readFile(_0xdf2e9f['filePath'],_0x437228(0x203)),_0x5dc164=stripLocalSqlMetadata(_0x2611c5,_0xdf2e9f[_0x437228(0x1e0)]),_0x3eb98b=_0xdf2e9f[_0x437228(0x1c9)]||_0x3acfae[_0x437228(0x1c9)],_0x3cb177=await resolveTargetDbBinding(_0x3820d1[_0x437228(0x1d0)],_0xdf2e9f,_0x3acfae),_0x5a6679=await updateSqlQuery({'id':_0x3acfae[_0x437228(0x1d8)],'appCode':_0x3820d1[_0x437228(0x1d0)],'sqlCode':_0xdf2e9f['sqlCode'],'sqlName':_0x3eb98b,'dbId':_0x3cb177['dbId'],'version':_0x3acfae['version'],'sqlContent':_0x5dc164,'sqlConfig':_0x3acfae['sqlConfig']??undefined}),_0x153e0f=_0x5a6679[_0x437228(0x1e9)]?await getDbName(_0x3820d1[_0x437228(0x1d0)],Number(_0x5a6679[_0x437228(0x1e9)]))[_0x437228(0x1da)](()=>_0x3cb177[_0x437228(0x1ef)]):_0x3cb177[_0x437228(0x1ef)];_0x5b6b83['sqls'][_0xdf2e9f[_0x437228(0x1e2)]]={...buildSqlLockEntry(_0x5a6679,_0x5dc164,_0x3340e9,{'dbName':_0x153e0f}),'path':_0xdf2e9f[_0x437228(0x1f4)],'mode':_0x3acfae[_0x437228(0x1e0)]},await archivePreviousSqlFileIfNeeded(_0x12e85f,_0x3acfae['path'],_0xdf2e9f[_0x437228(0x1f4)]),_0x217cf3[_0x437228(0x1e5)]({'sqlCode':_0xdf2e9f[_0x437228(0x1e2)],'remoteId':_0x3acfae[_0x437228(0x1d8)]});}catch(_0x2dfbd0){_0x1ecfe2['push']({'sqlCode':_0xdf2e9f['sqlCode'],'error':_0x2dfbd0 instanceof Error?_0x2dfbd0[_0x437228(0x1f6)]:String(_0x2dfbd0)});}}_0x5b6b83['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x12e85f[_0x437228(0x1df)],_0x2a9210);const _0x372c41=_0x1ecfe2['length']===0x0;return{'ok':_0x372c41,'data':{'pushed':_0x217cf3,'skipped':_0x24300c,'failed':_0x1ecfe2},'message':_0x437228(0x1ed)+_0x217cf3[_0x437228(0x1db)]+_0x437228(0x1f8)+_0x24300c[_0x437228(0x1db)]+'\x20skipped,\x20'+_0x1ecfe2['length']+_0x437228(0x1ea)};}};async function archivePreviousSqlFileIfNeeded(_0x105727,_0x553184,_0x2176af){const _0x40766e=a227_0x596368;if(!_0x553184||_0x553184===_0x2176af)return;const _0x18431f=join(_0x105727[_0x40766e(0x1f9)],_0x553184);if(!await fileExists(_0x18431f))return;const _0x3b3518=await moveToTrash(_0x105727['projectRoot'],_0x105727['trashDir'],_0x18431f);await cleanupEmptyDirectories(dirname(_0x18431f),_0x105727[_0x40766e(0x1f9)]),void _0x3b3518;}async function moveToTrash(_0x4a89a9,_0x1a22f2,_0x4be8bb){const _0x1bc4bc=a227_0x596368,_0x351278=new Date()[_0x1bc4bc(0x1fe)]()[_0x1bc4bc(0x1d1)](/[:.]/g,'-'),_0x2480b0=relative(_0x4a89a9,_0x4be8bb),_0x458f22=join(_0x1a22f2,_0x351278,_0x2480b0);return await mkdir(dirname(_0x458f22),{'recursive':!![]}),await rename(_0x4be8bb,_0x458f22),_0x458f22;}function a227_0x1e86(){const _0x211839=['sqlRootDir','\x22\x20for\x20sqlCode\x20','unchanged','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','hash','toISOString','entries','Local\x20directory\x20\x22','sqlRoot','join','utf8','exec','sqlName','dbDirectory','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','str','write','force','Push\x20local\x20SQL\x20files\x20to\x20remote','appCode','replace','18nMlyQH','filePath','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','sqls','filter','1716wcYhOe','remoteId','8210ITCQFh','catch','length','13982122aYmrfA','2662500AjjUln','6808scgeyu','lockFilePath','mode','82670KTrOaQ','sqlCode','4610985yEVtBi','isFinite','push','Local\x20SQL\x20not\x20found:\x20','sql','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','dbId','\x20failed','path','bool','Push\x20complete:\x20','sqlcode','dbName','24SZiZBY','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','9247tRAmEg','/smartapi/custom/updateUserCustomSql','relativePath','1717770BjrVCs','message','validation','\x20pushed,\x20'];a227_0x1e86=function(){return _0x211839;};return a227_0x1e86();}async function cleanupEmptyDirectories(_0x16739d,_0x43bb7e){let _0x2d150d=resolve(_0x16739d);const _0x5c5852=resolve(_0x43bb7e);while(_0x2d150d['startsWith'](''+_0x5c5852+sep)||_0x2d150d===_0x5c5852){if(_0x2d150d===_0x5c5852)return;try{const _0x428c98=await readdir(_0x2d150d);if(_0x428c98['length']>0x0)return;await rmdir(_0x2d150d);}catch{return;}_0x2d150d=dirname(_0x2d150d);}}async function resolveTargetDbBinding(_0xbb566b,_0x2730ad,_0x52fe83){const _0x2209ab=a227_0x596368,_0x4fcd10=_0x2730ad[_0x2209ab(0x1ca)];if(!_0x4fcd10)return{'dbId':_0x52fe83[_0x2209ab(0x1e9)],'dbName':_0x52fe83['dbName']};const _0x148199=buildDbDirectoryName(_0x52fe83[_0x2209ab(0x1ef)],_0x52fe83['dbId']);if(_0x4fcd10===_0x148199)return{'dbId':_0x52fe83['dbId'],'dbName':_0x52fe83[_0x2209ab(0x1ef)]};const _0x441648=parseExplicitDbDirectory(_0x4fcd10);if(_0x441648!=null)return{'dbId':_0x441648,'dbName':await getDbName(_0xbb566b,_0x441648)[_0x2209ab(0x1da)](()=>undefined)};const _0x47f85c=await listDatabases(_0xbb566b),_0x37142c=_0x47f85c[_0x2209ab(0x1d6)](_0xa3a404=>buildDbDirectoryName(_0xa3a404['dbName'],_0xa3a404[_0x2209ab(0x1e9)])===_0x4fcd10);if(_0x37142c[_0x2209ab(0x1db)]===0x1)return{'dbId':_0x37142c[0x0][_0x2209ab(0x1e9)],'dbName':_0x37142c[0x0][_0x2209ab(0x1ef)]};if(_0x37142c['length']===0x0)throw CliErrors[_0x2209ab(0x1f7)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x4fcd10+_0x2209ab(0x1fa)+_0x2730ad[_0x2209ab(0x1e2)]+'.');const _0x38d418=_0x37142c['map'](_0x39ba54=>_0x39ba54[_0x2209ab(0x1ef)]+'\x20('+_0x39ba54[_0x2209ab(0x1e9)]+')')[_0x2209ab(0x202)](',\x20');throw CliErrors['validation'](_0x2209ab(0x200)+_0x4fcd10+_0x2209ab(0x1f1)+_0x2730ad['sqlCode']+':\x20'+_0x38d418);}function parseExplicitDbDirectory(_0x31ec37){const _0xc73cc8=a227_0x596368,_0xcba9e4=/^db-(\d+)$/[_0xc73cc8(0x1c8)](_0x31ec37);if(!_0xcba9e4)return null;const _0x203b5e=Number(_0xcba9e4[0x1]);return Number[_0xc73cc8(0x1e4)](_0x203b5e)&&_0x203b5e>0x0?_0x203b5e:null;}
|
|
1
|
+
const a238_0x2d9c58=a238_0x3c8b;(function(_0x8f4753,_0x3c5193){const _0x6760c1=a238_0x3c8b,_0x408fea=_0x8f4753();while(!![]){try{const _0x4ef58a=-parseInt(_0x6760c1(0x14c))/0x1+-parseInt(_0x6760c1(0x14b))/0x2*(parseInt(_0x6760c1(0x147))/0x3)+parseInt(_0x6760c1(0x14e))/0x4+parseInt(_0x6760c1(0x13c))/0x5*(-parseInt(_0x6760c1(0x146))/0x6)+parseInt(_0x6760c1(0x16c))/0x7+-parseInt(_0x6760c1(0x13b))/0x8+parseInt(_0x6760c1(0x145))/0x9;if(_0x4ef58a===_0x3c5193)break;else _0x408fea['push'](_0x408fea['shift']());}catch(_0x199c5a){_0x408fea['push'](_0x408fea['shift']());}}}(a238_0x4fe0,0x8751d));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';function a238_0x3c8b(_0x2ce9f0,_0x16ce2f){_0x2ce9f0=_0x2ce9f0-0x12d;const _0x4fe086=a238_0x4fe0();let _0x3c8b3f=_0x4fe086[_0x2ce9f0];return _0x3c8b3f;}async function getTargetSqlQueries(_0x38b376,_0x1fafd2,_0x44421c){const _0x413543=a238_0x3c8b,_0x62e114=await scanLocalSqlQueries(_0x38b376),_0x54bf28=new Map();for(const _0x4d7ad6 of _0x62e114){if(_0x44421c&&_0x4d7ad6[_0x413543(0x131)]!==_0x44421c)continue;const _0x1ca45d=_0x54bf28[_0x413543(0x16a)](_0x4d7ad6['sqlCode'])??[];_0x1ca45d['push'](_0x4d7ad6),_0x54bf28[_0x413543(0x163)](_0x4d7ad6[_0x413543(0x131)],_0x1ca45d);}if(_0x44421c&&!_0x54bf28[_0x413543(0x158)](_0x44421c))throw CliErrors[_0x413543(0x12e)](_0x413543(0x144)+_0x44421c);const _0x4aca28=[];for(const [_0x452af6,_0x1812ff]of _0x54bf28[_0x413543(0x153)]()){if(_0x1812ff['length']===0x1){_0x4aca28[_0x413543(0x149)](_0x1812ff[0x0]);continue;}const _0x4a2ff4=_0x1fafd2[_0x413543(0x141)][_0x452af6],_0x311bce=_0x4a2ff4?.[_0x413543(0x165)],_0x484e10=_0x311bce?_0x1812ff[_0x413543(0x150)](_0x5eac6f=>_0x5eac6f[_0x413543(0x161)]!==_0x311bce):_0x1812ff;if(_0x4a2ff4&&_0x484e10[_0x413543(0x15b)]===0x1){_0x4aca28['push'](_0x484e10[0x0]);continue;}throw CliErrors[_0x413543(0x12e)](_0x413543(0x14a)+_0x452af6+_0x413543(0x154));}return _0x4aca28;}function a238_0x4fe0(){const _0x129cea=['hash','validation','bool','\x22\x20for\x20sqlCode\x20','sqlCode','No\x20database\x20matches\x20local\x20directory\x20\x22','Push\x20local\x20SQL\x20files\x20to\x20remote','/smartapi/custom/updateUserCustomSql','sqlConfig','remoteId','catch','sqlName','message','mode','6084592OiktmH','24005vAgTiS','sqlRootDir','\x20skipped,\x20','write','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','sqls','\x20SQL\x20file(s)','replace','Local\x20SQL\x20not\x20found:\x20','22370607hqdFxD','354zcYBUc','126006eouPbU','map','push','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','40wVJUzy','615427HdMhVR','unchanged','315756bMMtZu','version','filter','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','startsWith','entries','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','dbId','filePath','projectRoot','has','toISOString','exec','length','Local\x20directory\x20\x22','appCode','sqlcode','POST','isFinite','relativePath','force','set','str','path','lockFilePath','lastSync','dbName','Push\x20complete:\x20','get','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','3423049RQRDwL','No\x20local\x20SQL\x20files\x20found.'];a238_0x4fe0=function(){return _0x129cea;};return a238_0x4fe0();}export const sqlPush={'service':'sql','command':'push','description':a238_0x2d9c58(0x133),'risk':a238_0x2d9c58(0x13f),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a238_0x2d9c58(0x162),'type':'boolean','description':a238_0x2d9c58(0x16b)}],async 'dryRun'(_0x3d9bfd){const _0x626b2c=a238_0x2d9c58,_0x3e4f75=loadSqlProjectConfig(_0x3d9bfd[_0x626b2c(0x15d)]),_0x5925d5=await readSqlLockFile(_0x3e4f75['lockFilePath']),{appLock:_0x496f4a}=ensureSqlLockScope(_0x5925d5??createEmptySqlLock(),_0x3d9bfd['appCode'],_0x3e4f75['sqlRoot'],'push'),_0x49e309=await getTargetSqlQueries(_0x3e4f75,_0x496f4a,_0x3d9bfd[_0x626b2c(0x164)](_0x626b2c(0x15e))||undefined),_0x167089=[];for(const _0x2e72c0 of _0x49e309){const _0x151b4b=await computeSqlFileHash(_0x2e72c0['filePath']),_0x4c273a=_0x496f4a[_0x626b2c(0x141)][_0x2e72c0[_0x626b2c(0x131)]],_0x3245cd=!!_0x4c273a&&(_0x4c273a[_0x626b2c(0x165)]!==_0x2e72c0['relativePath']||!!_0x2e72c0[_0x626b2c(0x138)]&&_0x4c273a[_0x626b2c(0x138)]!==_0x2e72c0[_0x626b2c(0x138)]);if(!_0x3d9bfd[_0x626b2c(0x12f)]('force')&&_0x4c273a&&_0x4c273a[_0x626b2c(0x12d)]===_0x151b4b&&!_0x3245cd)continue;_0x167089[_0x626b2c(0x149)](_0x2e72c0[_0x626b2c(0x131)]);}return{'method':_0x626b2c(0x15f),'url':_0x626b2c(0x134),'body':{'sqlCodes':_0x167089,'appCode':_0x3d9bfd[_0x626b2c(0x15d)]},'description':'Would\x20push\x20'+_0x167089['length']+_0x626b2c(0x142)};},async 'execute'(_0x5d7ecb){const _0x2bf389=a238_0x2d9c58,_0x367e3e=loadSqlProjectConfig(_0x5d7ecb[_0x2bf389(0x15d)]),_0x5f46b0=await readSqlLockFile(_0x367e3e['lockFilePath']),{lockData:_0x4fd84d,appLock:_0x25b83b}=ensureSqlLockScope(_0x5f46b0??createEmptySqlLock(),_0x5d7ecb['appCode'],_0x367e3e['sqlRoot'],_0x2bf389(0x149)),_0x33af52=await getTargetSqlQueries(_0x367e3e,_0x25b83b,_0x5d7ecb[_0x2bf389(0x164)](_0x2bf389(0x15e))||undefined);if(_0x33af52[_0x2bf389(0x15b)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x2bf389(0x16d)};const _0x32437a=[],_0x522312=[],_0x25adbf=[];for(const _0x119594 of _0x33af52){const _0x1cc176=_0x25b83b[_0x2bf389(0x141)][_0x119594[_0x2bf389(0x131)]];if(!_0x1cc176){_0x25adbf[_0x2bf389(0x149)]({'sqlCode':_0x119594[_0x2bf389(0x131)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x1232f1=await computeSqlFileHash(_0x119594[_0x2bf389(0x156)]),_0x160e7c=_0x1cc176[_0x2bf389(0x165)]!==_0x119594[_0x2bf389(0x161)]||!!_0x119594['sqlName']&&_0x1cc176[_0x2bf389(0x138)]!==_0x119594[_0x2bf389(0x138)];if(!_0x5d7ecb[_0x2bf389(0x12f)]('force')&&_0x1cc176[_0x2bf389(0x12d)]===_0x1232f1&&!_0x160e7c){_0x522312['push']({'sqlCode':_0x119594[_0x2bf389(0x131)],'reason':_0x2bf389(0x14d)});continue;}if(_0x1cc176[_0x2bf389(0x14f)]==null){_0x25adbf[_0x2bf389(0x149)]({'sqlCode':_0x119594[_0x2bf389(0x131)],'error':_0x2bf389(0x151)});continue;}const _0x46ccaa=await readFile(_0x119594[_0x2bf389(0x156)],'utf8'),_0xafbeae=stripLocalSqlMetadata(_0x46ccaa,_0x119594['mode']),_0x28ff72=_0x119594['sqlName']||_0x1cc176[_0x2bf389(0x138)],_0x3bd082=await resolveTargetDbBinding(_0x5d7ecb['appCode'],_0x119594,_0x1cc176),_0x3689bc=await updateSqlQuery({'id':_0x1cc176[_0x2bf389(0x136)],'appCode':_0x5d7ecb[_0x2bf389(0x15d)],'sqlCode':_0x119594[_0x2bf389(0x131)],'sqlName':_0x28ff72,'dbId':_0x3bd082['dbId'],'version':_0x1cc176['version'],'sqlContent':_0xafbeae,'sqlConfig':_0x1cc176[_0x2bf389(0x135)]??undefined}),_0x46edcb=_0x3689bc[_0x2bf389(0x155)]?await getDbName(_0x5d7ecb['appCode'],Number(_0x3689bc[_0x2bf389(0x155)]))[_0x2bf389(0x137)](()=>_0x3bd082[_0x2bf389(0x168)]):_0x3bd082[_0x2bf389(0x168)];_0x25b83b[_0x2bf389(0x141)][_0x119594['sqlCode']]={...buildSqlLockEntry(_0x3689bc,_0xafbeae,_0x1232f1,{'dbName':_0x46edcb}),'path':_0x119594['relativePath'],'mode':_0x1cc176[_0x2bf389(0x13a)]},await archivePreviousSqlFileIfNeeded(_0x367e3e,_0x1cc176[_0x2bf389(0x165)],_0x119594[_0x2bf389(0x161)]),_0x32437a[_0x2bf389(0x149)]({'sqlCode':_0x119594[_0x2bf389(0x131)],'remoteId':_0x1cc176[_0x2bf389(0x136)]});}catch(_0x2b4c9e){_0x25adbf[_0x2bf389(0x149)]({'sqlCode':_0x119594[_0x2bf389(0x131)],'error':_0x2b4c9e instanceof Error?_0x2b4c9e[_0x2bf389(0x139)]:String(_0x2b4c9e)});}}_0x25b83b[_0x2bf389(0x167)]=new Date()[_0x2bf389(0x159)](),await writeSqlLockFile(_0x367e3e[_0x2bf389(0x166)],_0x4fd84d);const _0x326eed=_0x25adbf[_0x2bf389(0x15b)]===0x0;return{'ok':_0x326eed,'data':{'pushed':_0x32437a,'skipped':_0x522312,'failed':_0x25adbf},'message':_0x2bf389(0x169)+_0x32437a[_0x2bf389(0x15b)]+'\x20pushed,\x20'+_0x522312['length']+_0x2bf389(0x13e)+_0x25adbf[_0x2bf389(0x15b)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x3318c1,_0x236a8d,_0x3c072d){const _0x3108e0=a238_0x2d9c58;if(!_0x236a8d||_0x236a8d===_0x3c072d)return;const _0x317200=join(_0x3318c1[_0x3108e0(0x13d)],_0x236a8d);if(!await fileExists(_0x317200))return;const _0x3c0f8c=await moveToTrash(_0x3318c1[_0x3108e0(0x157)],_0x3318c1['trashDir'],_0x317200);await cleanupEmptyDirectories(dirname(_0x317200),_0x3318c1['sqlRootDir']),void _0x3c0f8c;}async function moveToTrash(_0x1677e2,_0x599c55,_0x441e7d){const _0x10dca8=a238_0x2d9c58,_0x522aad=new Date()[_0x10dca8(0x159)]()[_0x10dca8(0x143)](/[:.]/g,'-'),_0x6666a7=relative(_0x1677e2,_0x441e7d),_0x3b2e1d=join(_0x599c55,_0x522aad,_0x6666a7);return await mkdir(dirname(_0x3b2e1d),{'recursive':!![]}),await rename(_0x441e7d,_0x3b2e1d),_0x3b2e1d;}async function cleanupEmptyDirectories(_0x4bd31f,_0x20c9da){const _0x2abf6c=a238_0x2d9c58;let _0x71210d=resolve(_0x4bd31f);const _0x5cf632=resolve(_0x20c9da);while(_0x71210d[_0x2abf6c(0x152)](''+_0x5cf632+sep)||_0x71210d===_0x5cf632){if(_0x71210d===_0x5cf632)return;try{const _0x4dfc52=await readdir(_0x71210d);if(_0x4dfc52[_0x2abf6c(0x15b)]>0x0)return;await rmdir(_0x71210d);}catch{return;}_0x71210d=dirname(_0x71210d);}}async function resolveTargetDbBinding(_0x3b5130,_0x39a70e,_0x57b57e){const _0x177564=a238_0x2d9c58,_0x10ed57=_0x39a70e['dbDirectory'];if(!_0x10ed57)return{'dbId':_0x57b57e[_0x177564(0x155)],'dbName':_0x57b57e[_0x177564(0x168)]};const _0x191cbb=buildDbDirectoryName(_0x57b57e[_0x177564(0x168)],_0x57b57e[_0x177564(0x155)]);if(_0x10ed57===_0x191cbb)return{'dbId':_0x57b57e[_0x177564(0x155)],'dbName':_0x57b57e[_0x177564(0x168)]};const _0x1bd2c5=parseExplicitDbDirectory(_0x10ed57);if(_0x1bd2c5!=null)return{'dbId':_0x1bd2c5,'dbName':await getDbName(_0x3b5130,_0x1bd2c5)[_0x177564(0x137)](()=>undefined)};const _0x2c052b=await listDatabases(_0x3b5130),_0x1e7bbf=_0x2c052b[_0x177564(0x150)](_0x597e15=>buildDbDirectoryName(_0x597e15[_0x177564(0x168)],_0x597e15['dbId'])===_0x10ed57);if(_0x1e7bbf[_0x177564(0x15b)]===0x1)return{'dbId':_0x1e7bbf[0x0][_0x177564(0x155)],'dbName':_0x1e7bbf[0x0]['dbName']};if(_0x1e7bbf[_0x177564(0x15b)]===0x0)throw CliErrors['validation'](_0x177564(0x132)+_0x10ed57+_0x177564(0x130)+_0x39a70e[_0x177564(0x131)]+'.');const _0x1f34a3=_0x1e7bbf[_0x177564(0x148)](_0x38b22c=>_0x38b22c[_0x177564(0x168)]+'\x20('+_0x38b22c[_0x177564(0x155)]+')')['join'](',\x20');throw CliErrors[_0x177564(0x12e)](_0x177564(0x15c)+_0x10ed57+_0x177564(0x140)+_0x39a70e[_0x177564(0x131)]+':\x20'+_0x1f34a3);}function parseExplicitDbDirectory(_0xfe5ac8){const _0x2b7304=a238_0x2d9c58,_0x51b81c=/^db-(\d+)$/[_0x2b7304(0x15a)](_0xfe5ac8);if(!_0x51b81c)return null;const _0x3848dd=Number(_0x51b81c[0x1]);return Number[_0x2b7304(0x160)](_0x3848dd)&&_0x3848dd>0x0?_0x3848dd:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a239_0x42c8e0=a239_0x5244;(function(_0x3c6065,_0x11e6ea){const _0x20482b=a239_0x5244,_0x5c9fa4=_0x3c6065();while(!![]){try{const _0x46b860=parseInt(_0x20482b(0x12b))/0x1+-parseInt(_0x20482b(0x10c))/0x2+parseInt(_0x20482b(0x12d))/0x3+-parseInt(_0x20482b(0x125))/0x4*(-parseInt(_0x20482b(0x139))/0x5)+parseInt(_0x20482b(0x13b))/0x6+-parseInt(_0x20482b(0x111))/0x7*(parseInt(_0x20482b(0x110))/0x8)+parseInt(_0x20482b(0x12e))/0x9*(-parseInt(_0x20482b(0x114))/0xa);if(_0x46b860===_0x11e6ea)break;else _0x5c9fa4['push'](_0x5c9fa4['shift']());}catch(_0x1aafa0){_0x5c9fa4['push'](_0x5c9fa4['shift']());}}}(a239_0x7190,0xda572));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a239_0x42c8e0(0x115);export function buildSqlLockEntry(_0x44d990,_0x372e4b,_0x19e09f,_0x2f19f7){const _0x5c456c=a239_0x42c8e0,_0x5dca48=detectSqlMode(_0x372e4b);return{'path':buildSqlRelativePath(_0x44d990[_0x5c456c(0x11f)],_0x44d990[_0x5c456c(0x127)],_0x2f19f7?.[_0x5c456c(0x117)],_0x5dca48,_0x44d990[_0x5c456c(0x128)]),'hash':_0x19e09f,'remoteId':_0x44d990['id'],'version':_0x44d990[_0x5c456c(0x113)],'dbId':Number(_0x44d990[_0x5c456c(0x128)]),'dbName':_0x2f19f7?.[_0x5c456c(0x117)],'sqlName':_0x44d990[_0x5c456c(0x127)],'sqlConfig':_0x44d990[_0x5c456c(0x136)]??undefined,'mode':_0x5dca48};}function a239_0x5244(_0x52f7b0,_0x3891e6){_0x52f7b0=_0x52f7b0-0x10c;const _0x719030=a239_0x7190();let _0x52446a=_0x719030[_0x52f7b0];return _0x52446a;}export function cloneSqlLockData(_0x145548){const _0x291238=a239_0x42c8e0;return{'apps':Object[_0x291238(0x10f)](Object[_0x291238(0x10d)](_0x145548[_0x291238(0x137)])[_0x291238(0x12c)](([_0x2bfa6e,_0x4f2b15])=>[_0x2bfa6e,{'sqlRoot':_0x4f2b15[_0x291238(0x11c)],'lastSync':_0x4f2b15[_0x291238(0x123)],'sqls':{..._0x4f2b15['sqls']}}]))};}export function ensureRemoteSqlContent(_0x19a936){const _0x2562f3=a239_0x42c8e0;return _0x19a936[_0x2562f3(0x10e)]??'';}export function buildLocalSqlFileContent(_0x103c04,_0x4900d4,_0x359356){const _0x3629fe=a239_0x42c8e0,_0x171158=_0x359356?.[_0x3629fe(0x121)]??detectSqlMode(_0x4900d4),_0xba747e=stripLocalSqlMetadata(_0x4900d4,_0x171158)[_0x3629fe(0x112)](),_0x3f383b=[...buildMetadataHeaderLines({'sqlCode':_0x103c04[_0x3629fe(0x11f)],'sqlName':_0x103c04[_0x3629fe(0x127)],'dbId':_0x103c04[_0x3629fe(0x128)],'dbName':_0x359356?.['dbName'],'mode':_0x171158,'syncedAt':_0x359356?.[_0x3629fe(0x11b)],'description':_0x359356?.['description']},_0x171158),'',_0xba747e],_0x53212f=_0x3f383b['join']('\x0a');return _0x53212f[_0x3629fe(0x13a)]('\x0a')?_0x53212f:_0x53212f+'\x0a';}export function stripLocalSqlMetadata(_0x1918dc,_0x840897){const _0x524fe6=a239_0x42c8e0,_0x271a72=_0x1918dc[_0x524fe6(0x11e)](/\r\n/g,'\x0a')[_0x524fe6(0x131)]('\x0a'),_0x1b5142=[];let _0x4b5be9=0x0;if(_0x840897===_0x524fe6(0x122))while(_0x4b5be9<_0x271a72[_0x524fe6(0x12a)]){const _0x4de95e=_0x271a72[_0x4b5be9]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x4de95e)){_0x4b5be9++;continue;}if(_0x4de95e[_0x524fe6(0x112)]()===''&&_0x4b5be9>0x0){_0x4b5be9++;continue;}break;}else while(_0x4b5be9<_0x271a72['length']){const _0xf26612=_0x271a72[_0x4b5be9]??'';if(/^\s*--\s*@lovrabet\./[_0x524fe6(0x138)](_0xf26612)){_0x4b5be9++;continue;}if(_0xf26612[_0x524fe6(0x112)]()===''&&_0x4b5be9>0x0){_0x4b5be9++;continue;}break;}for(;_0x4b5be9<_0x271a72[_0x524fe6(0x12a)];_0x4b5be9++){_0x1b5142[_0x524fe6(0x132)](_0x271a72[_0x4b5be9]);}return _0x1b5142[_0x524fe6(0x126)]('\x0a')[_0x524fe6(0x12f)]();}export function resolveSqlMode(_0xb8a965,_0xeadac1){const _0x3375bb=a239_0x42c8e0;if(_0xeadac1?.[_0x3375bb(0x121)])return _0xeadac1['mode'];return detectSqlMode(_0xb8a965);}export function resolveSqlFileName(_0x13b93a,_0x58f7f4,_0x5dd7e1){const _0x5f0159=a239_0x42c8e0;if(_0x5dd7e1?.[_0x5f0159(0x134)])return _0x5dd7e1[_0x5f0159(0x134)];if(_0x5dd7e1?.['sqlName']||_0x5dd7e1?.[_0x5f0159(0x117)])return buildSqlRelativePath(_0x13b93a,_0x5dd7e1?.[_0x5f0159(0x127)],_0x5dd7e1?.[_0x5f0159(0x117)],resolveSqlMode(_0x58f7f4,_0x5dd7e1),_0x5dd7e1?.[_0x5f0159(0x128)]);return buildDefaultSqlFileName(_0x13b93a,resolveSqlMode(_0x58f7f4,_0x5dd7e1));}export function resolveSqlLocalDir(_0x41f872,_0x34c92e){return join(_0x41f872,SQL_LOCAL_REL_DIR,_0x34c92e);}export async function confirmForceOverwrite(_0x4f9162){const _0x64efa0=a239_0x42c8e0,_0x291dad=createInterface({'input':process[_0x64efa0(0x11a)],'output':process[_0x64efa0(0x129)]}),_0x45dace=await new Promise(_0x5280c1=>{const _0x48a4db=_0x64efa0;_0x291dad['question'](_0x4f9162+_0x48a4db(0x130),_0x5280c1);});return _0x291dad[_0x64efa0(0x118)](),['y',_0x64efa0(0x133)][_0x64efa0(0x135)](_0x45dace[_0x64efa0(0x112)]()['toLowerCase']());}export function findSqlLockScope(_0x5f5957,_0x55aaab){const _0x56b2b5=a239_0x42c8e0;return _0x5f5957[_0x56b2b5(0x137)][_0x55aaab];}function buildMetadataHeaderLines(_0x320c06,_0x43260f){const _0x23be27=a239_0x42c8e0,_0x175961=[[_0x23be27(0x11f),_0x320c06[_0x23be27(0x11f)]],['sqlName',_0x320c06[_0x23be27(0x127)]],['dbId',_0x320c06['dbId']],[_0x23be27(0x117),_0x320c06['dbName']],[_0x23be27(0x121),_0x320c06['mode']],[_0x23be27(0x11b),_0x320c06[_0x23be27(0x11b)]],[_0x23be27(0x124),_0x320c06[_0x23be27(0x124)]]];if(_0x43260f===_0x23be27(0x122))return _0x175961[_0x23be27(0x11d)](([,_0x1b3c7d])=>_0x1b3c7d!==undefined&&_0x1b3c7d!==null&&String(_0x1b3c7d)[_0x23be27(0x112)]()!=='')['map'](([_0x14b417,_0x3e5ca0])=>_0x23be27(0x120)+_0x14b417+':\x20'+String(_0x3e5ca0)+_0x23be27(0x116));return _0x175961[_0x23be27(0x11d)](([,_0x2cf5e7])=>_0x2cf5e7!==undefined&&_0x2cf5e7!==null&&String(_0x2cf5e7)[_0x23be27(0x112)]()!=='')[_0x23be27(0x12c)](([_0x5bda10,_0x32e34b])=>_0x23be27(0x119)+_0x5bda10+':\x20'+String(_0x32e34b));}function a239_0x7190(){const _0x3906fa=['mybatisXml','lastSync','description','192636wousPX','join','sqlName','dbId','stderr','length','1695848JABevk','map','1335069KKRCir','4336767vKKFdi','trimStart','\x20[y/N]\x20','split','push','yes','path','includes','sqlConfig','apps','test','135BftBfG','endsWith','9226656hAKkdf','2330196oNlWwb','entries','sqlContent','fromEntries','8yKexGb','10317517eDUyiv','trim','version','30yOIzdR','.rabetbase/sql','\x20-->','dbName','close','--\x20@lovrabet.','stdin','syncedAt','sqlRoot','filter','replace','sqlCode','<!--\x20@lovrabet.','mode'];a239_0x7190=function(){return _0x3906fa;};return a239_0x7190();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a240_0x5015c1=a240_0x5dc8;(function(_0x585d48,_0x597dd6){const _0x1974fa=a240_0x5dc8,_0x26c7f7=_0x585d48();while(!![]){try{const _0x454896=-parseInt(_0x1974fa(0xb3))/0x1+parseInt(_0x1974fa(0xcd))/0x2*(parseInt(_0x1974fa(0xd5))/0x3)+-parseInt(_0x1974fa(0xc9))/0x4*(-parseInt(_0x1974fa(0xc8))/0x5)+parseInt(_0x1974fa(0xb4))/0x6+parseInt(_0x1974fa(0xbf))/0x7*(parseInt(_0x1974fa(0xd4))/0x8)+parseInt(_0x1974fa(0xb2))/0x9+-parseInt(_0x1974fa(0xce))/0xa;if(_0x454896===_0x597dd6)break;else _0x26c7f7['push'](_0x26c7f7['shift']());}catch(_0x4d750a){_0x26c7f7['push'](_0x26c7f7['shift']());}}}(a240_0x164e,0x4d104));function a240_0x164e(){const _0x2e1b44=['boolean','1172549Siuvka','sql','has','sqlCode','keys','remote','\x20missing,\x20','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','status','5heHFyh','2140764ixLTyF','bool','sqlRoot','lockFilePath','105916XHsEOT','16814460ymetLe','appCode','\x20remote-only','lockKey','\x20modified,\x20','filePath','8ATsPZa','33SlqOff','sqlName','5377959dgAsjt','475545WHoBHZ','3539136aHtYOm','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','map','\x20unchanged','read','length','relativePath','paging','push','sqls'];a240_0x164e=function(){return _0x2e1b44;};return a240_0x164e();}import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a240_0x5dc8(_0x80bbfb,_0x1bc7c8){_0x80bbfb=_0x80bbfb-0xb2;const _0x164e5f=a240_0x164e();let _0x5dc832=_0x164e5f[_0x80bbfb];return _0x5dc832;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0xd3a1f8){const _0x4d846e=a240_0x5dc8,_0x101cb5=[];let _0x11f64b=0x1;while(!![]){const _0x112148=await listSqlQueries(_0xd3a1f8,{'currentPage':_0x11f64b,'pageSize':PAGE_SIZE}),_0x1a5d12=_0x112148['tableData']??[];_0x101cb5[_0x4d846e(0xbc)](..._0x1a5d12[_0x4d846e(0xb6)](_0x4d2f53=>_0x4d2f53[_0x4d846e(0xc2)]));if(_0x1a5d12[_0x4d846e(0xb9)]===0x0)break;const _0x1679f9=_0x112148[_0x4d846e(0xbb)]?.['totalCount'];if(_0x1679f9!=null?_0x101cb5[_0x4d846e(0xb9)]>=_0x1679f9:_0x1a5d12[_0x4d846e(0xb9)]<PAGE_SIZE)break;_0x11f64b++;}return _0x101cb5;}export const sqlStatus={'service':a240_0x5015c1(0xc0),'command':a240_0x5015c1(0xc7),'description':a240_0x5015c1(0xb5),'risk':a240_0x5015c1(0xb8),'flags':[{'name':a240_0x5015c1(0xc4),'type':a240_0x5015c1(0xbe),'description':a240_0x5015c1(0xc6)}],async 'execute'(_0x360df1){const _0x41bbec=a240_0x5015c1,_0x230b2c=loadSqlProjectConfig(_0x360df1['appCode']),_0x338d1c=await readSqlLockFile(_0x230b2c[_0x41bbec(0xcc)]),{appLock:_0x51ae81}=ensureSqlLockScope(_0x338d1c??createEmptySqlLock(),_0x230b2c[_0x41bbec(0xcf)],_0x230b2c[_0x41bbec(0xcb)],_0x41bbec(0xc7)),_0x415ecb=await scanLocalSqlQueries(_0x230b2c),_0x360135=[],_0x307d1c=[],_0xcc81dc=[],_0x1aeb96=[],_0x101798=new Set(_0x415ecb['map'](_0x51a3bc=>_0x51a3bc[_0x41bbec(0xd1)]));for(const _0x459ecf of _0x415ecb){const _0x462bb7=await computeSqlFileHash(_0x459ecf[_0x41bbec(0xd3)]),_0xe4c496=_0x51ae81[_0x41bbec(0xbd)][_0x459ecf[_0x41bbec(0xd1)]],_0x406ef4=!!_0xe4c496&&_0xe4c496['path']!==_0x459ecf[_0x41bbec(0xba)],_0x179bf7=!!_0xe4c496&&!!_0x459ecf[_0x41bbec(0xd6)]&&_0xe4c496[_0x41bbec(0xd6)]!==_0x459ecf['sqlName'];if(!_0xe4c496)_0x360135[_0x41bbec(0xbc)](_0x459ecf['lockKey']);else _0xe4c496['hash']!==_0x462bb7||_0x406ef4||_0x179bf7?_0x307d1c[_0x41bbec(0xbc)](_0x459ecf['lockKey']):_0xcc81dc['push'](_0x459ecf[_0x41bbec(0xd1)]);}for(const _0x3d887c of Object[_0x41bbec(0xc3)](_0x51ae81['sqls'])){!_0x101798[_0x41bbec(0xc1)](_0x3d887c)&&_0x1aeb96[_0x41bbec(0xbc)](_0x3d887c);}const _0x3f32a1=[];if(_0x360df1[_0x41bbec(0xca)]('remote')){const _0x311351=await fetchAllSqlCodes(_0x360df1['appCode']);for(const _0x281b38 of _0x311351){!_0x101798[_0x41bbec(0xc1)](_0x281b38)&&!_0x51ae81[_0x41bbec(0xbd)][_0x281b38]&&_0x3f32a1[_0x41bbec(0xbc)](_0x281b38);}}const _0x17d550=_0x360135[_0x41bbec(0xb9)]===0x0&&_0x307d1c['length']===0x0&&_0x1aeb96[_0x41bbec(0xb9)]===0x0&&_0x3f32a1[_0x41bbec(0xb9)]===0x0;return{'ok':!![],'data':{'added':_0x360135,'modified':_0x307d1c,'missing':_0x1aeb96,'unchanged':_0xcc81dc,'remoteOnly':_0x3f32a1},'message':_0x17d550?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x360135[_0x41bbec(0xb9)]+'\x20added,\x20'+_0x307d1c[_0x41bbec(0xb9)]+_0x41bbec(0xd2)+_0x1aeb96['length']+_0x41bbec(0xc5)+_0xcc81dc['length']+_0x41bbec(0xb7)+(_0x3f32a1[_0x41bbec(0xb9)]>0x0?',\x20'+_0x3f32a1[_0x41bbec(0xb9)]+_0x41bbec(0xd0):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a241_0x35dd0c=a241_0x145a;(function(_0x167053,_0x43090f){const _0x5c7607=a241_0x145a,_0x25a4d2=_0x167053();while(!![]){try{const _0x39a24c=-parseInt(_0x5c7607(0x12a))/0x1+parseInt(_0x5c7607(0x101))/0x2*(-parseInt(_0x5c7607(0x10c))/0x3)+-parseInt(_0x5c7607(0x128))/0x4*(-parseInt(_0x5c7607(0x106))/0x5)+parseInt(_0x5c7607(0x12b))/0x6+parseInt(_0x5c7607(0x100))/0x7+parseInt(_0x5c7607(0x104))/0x8*(parseInt(_0x5c7607(0xfb))/0x9)+parseInt(_0x5c7607(0x121))/0xa;if(_0x39a24c===_0x43090f)break;else _0x25a4d2['push'](_0x25a4d2['shift']());}catch(_0x505690){_0x25a4d2['push'](_0x25a4d2['shift']());}}}(a241_0x1f56,0x97e9c));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a241_0x1f56(){const _0x71cd28=['check-indexes','dataset','valid','schemas','unshift','schema:','1062300ohfjZf','split','cwd','boolean','\x22\x20not\x20found\x20or\x20not\x20accessible','length','SQL\x20schema\x20validation','4oDXOTE','tables','423174oPShhw','982938dsmtvn','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','appCode','validate','isSelectOnly','toLowerCase','name','parameters','push','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','file','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','\x22\x20not\x20found\x20in\x20any\x20dataset','1413cPIBpn','read','get','string','tableName','1159907VqHIWE','1480850Kskcvy','str','type','38048BRdeNX','reason','3016945qrFCkQ','trim','columnNames','fields','validation','from','3QzSxDU','Provide\x20--file\x20or\x20--sql','indexes','find','columns','bool','utf-8','index_name','isArray','schemaWarnings','sqlType','map','--check-indexes\x20requires\x20--schemas.','sql','filter'];a241_0x1f56=function(){return _0x71cd28;};return a241_0x1f56();}function a241_0x145a(_0x475b29,_0x9ebc86){_0x475b29=_0x475b29-0xf5;const _0x1f5606=a241_0x1f56();let _0x145a96=_0x1f5606[_0x475b29];return _0x145a96;}import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':'sql','command':a241_0x35dd0c(0x12e),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a241_0x35dd0c(0xfc),'flags':[{'name':'file','type':a241_0x35dd0c(0xfe),'description':a241_0x35dd0c(0x12c)},{'name':a241_0x35dd0c(0x119),'type':a241_0x35dd0c(0xfe),'description':a241_0x35dd0c(0xf7)},{'name':'schemas','type':'string','description':a241_0x35dd0c(0xf9)},{'name':a241_0x35dd0c(0x11b),'type':a241_0x35dd0c(0x124),'description':'Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata'}],async 'execute'(_0x15245a){const _0x4a6cc5=a241_0x35dd0c,_0xbb15a3=_0x15245a[_0x4a6cc5(0x102)]('file'),_0x886e55=_0x15245a[_0x4a6cc5(0x102)](_0x4a6cc5(0x119)),_0x34e3f1=_0x15245a[_0x4a6cc5(0x102)](_0x4a6cc5(0x11e)),_0x7e0208=_0x15245a[_0x4a6cc5(0x111)](_0x4a6cc5(0x11b));if(!_0xbb15a3&&!_0x886e55)throw CliErrors['flagMissing'](_0x4a6cc5(0xf8),_0x4a6cc5(0x10d));if(_0x7e0208&&!_0x34e3f1)throw CliErrors[_0x4a6cc5(0x10a)](_0x4a6cc5(0x118));let _0x3964c5;if(_0xbb15a3){const _0x440a7e=resolve(process[_0x4a6cc5(0x123)](),_0xbb15a3);if(!existsSync(_0x440a7e))throw CliErrors[_0x4a6cc5(0x10a)]('File\x20not\x20found:\x20'+_0x440a7e);_0x3964c5=readFileSync(_0x440a7e,_0x4a6cc5(0x112));}else _0x3964c5=_0x886e55;const _0x3ced52=validateSql(_0x3964c5),_0x2de05f={'valid':_0x3ced52[_0x4a6cc5(0x11d)],'sqlType':_0x3ced52['sqlType'][_0x4a6cc5(0x103)],'isSelectOnly':_0x3ced52[_0x4a6cc5(0x116)][_0x4a6cc5(0x12f)],'isDangerous':_0x3ced52[_0x4a6cc5(0x116)]['isDangerous'],'tables':_0x3ced52[_0x4a6cc5(0x129)],'parameters':_0x3ced52[_0x4a6cc5(0xf5)],'message':_0x3ced52['message']};_0x3ced52['sqlType'][_0x4a6cc5(0x105)]&&(_0x2de05f[_0x4a6cc5(0x105)]=_0x3ced52[_0x4a6cc5(0x116)][_0x4a6cc5(0x105)]);if(_0x34e3f1&&_0x3ced52[_0x4a6cc5(0x11d)]){const _0x3e172f=_0x34e3f1[_0x4a6cc5(0x122)](',')[_0x4a6cc5(0x117)](_0x39550f=>_0x39550f[_0x4a6cc5(0x107)]())[_0x4a6cc5(0x11a)](Boolean),_0x33659c=[],_0x4980e8=[],_0x167969=filterDbTableBackedDatasets(await listDatasets(_0x15245a[_0x4a6cc5(0x12d)])),_0x53b65b=new Map(_0x167969['map'](_0x517c00=>[_0x517c00['dbtableConfig']?.[_0x4a6cc5(0xff)]?.[_0x4a6cc5(0x130)](),_0x517c00]));for(const _0x15d75d of _0x3ced52[_0x4a6cc5(0x129)]){const _0x277d06=_0x53b65b[_0x4a6cc5(0xfd)](_0x15d75d[_0x4a6cc5(0x130)]());!_0x277d06&&_0x33659c['push']('Table\x20\x22'+_0x15d75d+_0x4a6cc5(0xfa));}for(const _0x2780f8 of _0x3e172f){let _0x4832c9;try{_0x4832c9=await getDatasetDetail(_0x2780f8);}catch{_0x33659c[_0x4a6cc5(0xf6)]('Dataset\x20\x22'+_0x2780f8+_0x4a6cc5(0x125));continue;}assertDatasetIsDbTableBacked(_0x4832c9,_0x4a6cc5(0x127));const _0x1648d2=Array[_0x4a6cc5(0x114)](_0x4832c9['fields'])?_0x4832c9[_0x4a6cc5(0x109)]:[],_0xb06868=new Set(_0x1648d2['map'](_0x525611=>_0x525611[_0x4a6cc5(0x131)]?.[_0x4a6cc5(0x130)]())),_0x3f79cd=_0x4832c9['dbtableConfig']?.[_0x4a6cc5(0xff)]||_0x4832c9[_0x4a6cc5(0xff)]||_0x2780f8;_0x2de05f[_0x4a6cc5(0x120)+_0x3f79cd]={'code':_0x2780f8,'tableName':_0x3f79cd,'fieldCount':_0xb06868['size'],'fields':Array[_0x4a6cc5(0x10b)](_0xb06868)};if(_0x7e0208){const _0x2f46a8=normalizeDatasetIndexes(_0x4832c9);_0x4980e8['push']({'tableName':_0x3f79cd,..._0x2f46a8});}}_0x33659c[_0x4a6cc5(0x126)]>0x0&&(_0x2de05f[_0x4a6cc5(0x115)]=_0x33659c),_0x7e0208&&(_0x2de05f['joinAudit']=auditSqlJoinIndexes(_0x3964c5,_0x4980e8));}return{'ok':_0x3ced52['valid'],'data':_0x2de05f,'message':_0x3ced52['message']};}};function normalizeDatasetIndexes(_0x162d8a){const _0x35ad66=a241_0x35dd0c,_0x5b599b=Array[_0x35ad66(0x114)](_0x162d8a?.[_0x35ad66(0x11c)]?.['indexes'])?_0x162d8a[_0x35ad66(0x11c)]['indexes']:Array[_0x35ad66(0x114)](_0x162d8a?.[_0x35ad66(0x10e)])?_0x162d8a[_0x35ad66(0x10e)]:[],_0xa4e4d4=_0x5b599b['flatMap'](_0x425eff=>{const _0x16ca73=_0x35ad66,_0x1e41f2=Array['isArray'](_0x425eff?.['index_columns'])?_0x425eff['index_columns']:Array[_0x16ca73(0x114)](_0x425eff?.[_0x16ca73(0x108)])?_0x425eff[_0x16ca73(0x108)]:Array[_0x16ca73(0x114)](_0x425eff?.[_0x16ca73(0x110)])?_0x425eff[_0x16ca73(0x110)]:[],_0x19891e=_0x1e41f2['filter'](_0x35115f=>typeof _0x35115f===_0x16ca73(0xfe))[_0x16ca73(0x117)](_0x418dee=>_0x418dee[_0x16ca73(0x107)]())[_0x16ca73(0x11a)](Boolean);if(_0x19891e[_0x16ca73(0x126)]===0x0)return[];const _0x39e8d8=[_0x425eff?.['indexName'],_0x425eff?.[_0x16ca73(0x113)],_0x425eff?.['name']][_0x16ca73(0x10f)](_0x1165ff=>typeof _0x1165ff===_0x16ca73(0xfe)&&_0x1165ff[_0x16ca73(0x107)]()),_0x95dfe=[_0x425eff?.['index_type'],_0x425eff?.[_0x16ca73(0x103)]]['find'](_0x2acfcf=>typeof _0x2acfcf===_0x16ca73(0xfe)&&_0x2acfcf['trim']());return[{..._0x39e8d8?{'name':_0x39e8d8[_0x16ca73(0x107)]()}:{},..._0x95dfe?{'type':_0x95dfe[_0x16ca73(0x107)]()}:{},'columns':_0x19891e}];}),_0x4ecb9b=[..._0xa4e4d4],_0x2b0d86=typeof _0x162d8a?.['dbtableConfig']?.['pkField']===_0x35ad66(0xfe)?_0x162d8a['dbtableConfig']['pkField'][_0x35ad66(0x122)](',')['map'](_0xc281fc=>_0xc281fc['trim']())[_0x35ad66(0x11a)](Boolean):[];return _0x2b0d86[_0x35ad66(0x126)]>0x0&&_0x4ecb9b[_0x35ad66(0x11f)]({'type':'primary','columns':_0x2b0d86}),{'indexes':_0x4ecb9b,'metadataAvailable':_0xa4e4d4[_0x35ad66(0x126)]>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1703d1,_0xc151ae){const _0x4bd973=a242_0x2710,_0x26b7c4=_0x1703d1();while(!![]){try{const _0x58a278=-parseInt(_0x4bd973(0x187))/0x1+-parseInt(_0x4bd973(0x18b))/0x2*(parseInt(_0x4bd973(0x190))/0x3)+parseInt(_0x4bd973(0x18a))/0x4*(-parseInt(_0x4bd973(0x193))/0x5)+parseInt(_0x4bd973(0x18f))/0x6*(-parseInt(_0x4bd973(0x192))/0x7)+parseInt(_0x4bd973(0x189))/0x8*(-parseInt(_0x4bd973(0x18d))/0x9)+-parseInt(_0x4bd973(0x18e))/0xa*(-parseInt(_0x4bd973(0x191))/0xb)+-parseInt(_0x4bd973(0x188))/0xc*(-parseInt(_0x4bd973(0x18c))/0xd);if(_0x58a278===_0xc151ae)break;else _0x26b7c4['push'](_0x26b7c4['shift']());}catch(_0x3c3a98){_0x26b7c4['push'](_0x26b7c4['shift']());}}}(a242_0x3b9e,0xa8165));function a242_0x2710(_0x2b9dc2,_0x1bb141){_0x2b9dc2=_0x2b9dc2-0x187;const _0x3b9e4b=a242_0x3b9e();let _0x2710f0=_0x3b9e4b[_0x2b9dc2];return _0x2710f0;}import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];function a242_0x3b9e(){const _0x25733c=['4xtYdyd','13584qulLoj','260SnFseh','18pVaayc','10350GsTQUt','374862BTfTEq','285JThEyt','8833NdLGoh','154nHdYcV','2270090AmAhcx','474958iUzyae','2351964OCGAcE','4455400SNJLoy'];a242_0x3b9e=function(){return _0x25733c;};return a242_0x3b9e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a243_0x17880d=a243_0x5d5d;(function(_0x3e956e,_0x277bc9){const _0xcbf2c9=a243_0x5d5d,_0x2d1d5c=_0x3e956e();while(!![]){try{const _0x1b48b7=-parseInt(_0xcbf2c9(0x72))/0x1+parseInt(_0xcbf2c9(0x77))/0x2+parseInt(_0xcbf2c9(0x6e))/0x3+parseInt(_0xcbf2c9(0x83))/0x4*(parseInt(_0xcbf2c9(0x6d))/0x5)+parseInt(_0xcbf2c9(0x6f))/0x6+parseInt(_0xcbf2c9(0x7f))/0x7+-parseInt(_0xcbf2c9(0x71))/0x8*(parseInt(_0xcbf2c9(0x79))/0x9);if(_0x1b48b7===_0x277bc9)break;else _0x2d1d5c['push'](_0x2d1d5c['shift']());}catch(_0x4d64ff){_0x2d1d5c['push'](_0x2d1d5c['shift']());}}}(a243_0x4666,0xca1a7));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';function a243_0x5d5d(_0x206537,_0x3f770f){_0x206537=_0x206537-0x6c;const _0x46666a=a243_0x4666();let _0x5d5df5=_0x46666a[_0x206537];return _0x5d5df5;}import{CliErrors}from'../../errors.js';export const taskStatus={'service':a243_0x17880d(0x75),'command':a243_0x17880d(0x82),'description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':'read','defaultOutputFormat':a243_0x17880d(0x7c),'structuredErrors':!![],'flags':[{'name':a243_0x17880d(0x7a),'type':a243_0x17880d(0x7e),'required':!![],'description':a243_0x17880d(0x70)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3403f4){const _0x734026=a243_0x17880d;if(!_0x3403f4[_0x734026(0x7d)](_0x734026(0x7a))[_0x734026(0x7b)]())throw CliErrors[_0x734026(0x81)](_0x734026(0x7a));},async 'execute'(_0x1d7197){const _0x2cd280=a243_0x17880d,_0x1df208=_0x1d7197['str'](_0x2cd280(0x7a))['trim'](),_0x5f1b68=normalizeAsyncTask(await getAsyncTaskStatus(_0x1df208,_0x1d7197[_0x2cd280(0x6c)],_0x1d7197[_0x2cd280(0x78)]));if(_0x5f1b68[_0x2cd280(0x74)]!==_0x1df208)throw CliErrors[_0x2cd280(0x80)](_0x2cd280(0x73)+_0x1df208+_0x2cd280(0x76)+_0x5f1b68[_0x2cd280(0x74)]+'.');const _0x204b4a=buildAsyncTaskStatusCommand(_0x5f1b68[_0x2cd280(0x74)],_0x1d7197['appCode']);return{'ok':!![],'message':asyncTaskMessage(_0x5f1b68),'data':{'appCode':_0x1d7197['appCode'],..._0x5f1b68,'query':_0x5f1b68[_0x2cd280(0x84)]?null:{'command':_0x204b4a}}};}};function a243_0x4666(){const _0x4ecbed=['Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','taskId','task',',\x20received\x20','1194906icQgbC','cookie','739971MAfkPH','task-id','trim','compress','str','string','8894249GAAirp','apiError','flagMissing','status','4DvOEhn','isTerminal','appCode','2819755JhOJXK','4943820YAniGy','7724700kgRdmd','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','424QCRTuF','181979jOVpZb'];a243_0x4666=function(){return _0x4ecbed;};return a243_0x4666();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4a6584,_0x490a48){const _0x2df160=a244_0xe3d8,_0x4bfd11=_0x4a6584();while(!![]){try{const _0x6288ef=-parseInt(_0x2df160(0xe5))/0x1*(parseInt(_0x2df160(0xdf))/0x2)+-parseInt(_0x2df160(0xde))/0x3*(parseInt(_0x2df160(0xe2))/0x4)+parseInt(_0x2df160(0xe6))/0x5+parseInt(_0x2df160(0xe4))/0x6+-parseInt(_0x2df160(0xe1))/0x7*(parseInt(_0x2df160(0xe0))/0x8)+-parseInt(_0x2df160(0xe7))/0x9+parseInt(_0x2df160(0xe3))/0xa;if(_0x6288ef===_0x490a48)break;else _0x4bfd11['push'](_0x4bfd11['shift']());}catch(_0x30e731){_0x4bfd11['push'](_0x4bfd11['shift']());}}}(a244_0x5e82,0x3464d));function a244_0xe3d8(_0x4c7acf,_0x54c68d){_0x4c7acf=_0x4c7acf-0xde;const _0x5e8228=a244_0x5e82();let _0xe3d8a4=_0x5e8228[_0x4c7acf];return _0xe3d8a4;}function a244_0x5e82(){const _0x55c3c4=['1524265iUfWdH','3331413zUQOsw','6YhgAIr','2zgJNDM','8mIAwhG','2671025DhPCpu','588172sWoyYZ','5941000lpyjiH','2198148blmjcM','4888UTMoHG'];a244_0x5e82=function(){return _0x55c3c4;};return a244_0x5e82();}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a245_0x27d2(_0x18e35d,_0x489f77){_0x18e35d=_0x18e35d-0x1cc;const _0x3ebcd9=a245_0x3ebc();let _0x27d2c8=_0x3ebcd9[_0x18e35d];return _0x27d2c8;}const a245_0x10e03d=a245_0x27d2;(function(_0x5de63e,_0x2f139b){const _0x3e6f33=a245_0x27d2,_0x27e0d8=_0x5de63e();while(!![]){try{const _0x60d5a5=parseInt(_0x3e6f33(0x1dc))/0x1+-parseInt(_0x3e6f33(0x1d8))/0x2*(parseInt(_0x3e6f33(0x1dd))/0x3)+parseInt(_0x3e6f33(0x1cc))/0x4+-parseInt(_0x3e6f33(0x1ce))/0x5+-parseInt(_0x3e6f33(0x1d3))/0x6*(-parseInt(_0x3e6f33(0x1cd))/0x7)+parseInt(_0x3e6f33(0x1d2))/0x8*(-parseInt(_0x3e6f33(0x1d1))/0x9)+-parseInt(_0x3e6f33(0x1de))/0xa*(-parseInt(_0x3e6f33(0x1da))/0xb);if(_0x60d5a5===_0x2f139b)break;else _0x27e0d8['push'](_0x27e0d8['shift']());}catch(_0x16a968){_0x27e0d8['push'](_0x27e0d8['shift']());}}}(a245_0x3ebc,0x5f09c));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';function a245_0x3ebc(){const _0x3a705a=['23646atSyoK','read','length','Found\x20','string','14ZvDfyg','tenant-code','176hIHuOf','flagMissing','413706TkqRyn','140019VFucfo','336650GBblMI','53488YUwShD','231GiMqzr','163850fLGyqP','\x20tenant\x20member(s)','trim','279QfYxxk','89552bizMnN'];a245_0x3ebc=function(){return _0x3a705a;};return a245_0x3ebc();}export const tenantMembersListDefinition={'service':'tenant','command':'members-list','description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':a245_0x10e03d(0x1d4),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a245_0x10e03d(0x1d9),'type':a245_0x10e03d(0x1d7),'required':!![],'description':'Exact\x20tenant\x20code'}],async 'validate'(_0xd9a4f4){const _0x4ef793=a245_0x10e03d;if(!_0xd9a4f4['str']('tenant-code')[_0x4ef793(0x1d0)]())throw CliErrors[_0x4ef793(0x1db)]('tenant-code','Pass\x20--tenant-code\x20<code>.');},async 'execute'(_0x366603){const _0x2ae5b5=a245_0x10e03d,_0x25c62b=_0x366603['str'](_0x2ae5b5(0x1d9))['trim'](),_0x1e72d9=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x25c62b,_0x1e72d9);const _0x517709=projectTenantMembers(await listTenantDirectoryMembers(_0x25c62b));return{'ok':!![],'data':{'tenantCode':_0x25c62b,'items':_0x517709,'totalCount':_0x517709[_0x2ae5b5(0x1d5)]},'message':_0x2ae5b5(0x1d6)+_0x517709['length']+_0x2ae5b5(0x1cf)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x67832f,_0x73133e){const _0x5786ca=a246_0x3a66,_0x46b666=_0x67832f();while(!![]){try{const _0x5d5d5d=parseInt(_0x5786ca(0x172))/0x1+parseInt(_0x5786ca(0x173))/0x2+parseInt(_0x5786ca(0x179))/0x3+parseInt(_0x5786ca(0x177))/0x4+parseInt(_0x5786ca(0x178))/0x5+parseInt(_0x5786ca(0x16b))/0x6*(parseInt(_0x5786ca(0x17d))/0x7)+-parseInt(_0x5786ca(0x180))/0x8;if(_0x5d5d5d===_0x73133e)break;else _0x46b666['push'](_0x46b666['shift']());}catch(_0xbabaa2){_0x46b666['push'](_0x46b666['shift']());}}}(a246_0x1e0e,0x2e87a));import{CliErrors}from'../../errors.js';function a246_0x3a66(_0x263f6b,_0x18a899){_0x263f6b=_0x263f6b-0x169;const _0x1e0e5b=a246_0x1e0e();let _0x3a66e3=_0x1e0e5b[_0x263f6b];return _0x3a66e3;}function textOrNull(_0x5d3a96){const _0x3f3b5f=_0x5d3a96?.['trim']();return _0x3f3b5f?_0x3f3b5f:null;}function a246_0x1e0e(){const _0x1c3e8d=['status','2021453iiMBtG','username','displayName','6064008hvJwSo','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','values','6yBxhjM','adminFlag','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','userId','sort','validation','MEMBER','25606MUgFVw','205494BNIUMD','set','get','some','244456ORUxkh','653965eXIlTW','1018644lmtVGq','ADMIN','isFinite'];a246_0x1e0e=function(){return _0x1c3e8d;};return a246_0x1e0e();}export function projectTenantMembers(_0x1bf46d){const _0x50af5d=a246_0x3a66,_0x246e93=new Map();for(const _0x389e1d of _0x1bf46d){const _0x3b9bbf=Number(_0x389e1d[_0x50af5d(0x16e)]);if(!Number[_0x50af5d(0x17b)](_0x3b9bbf)||_0x3b9bbf<=0x0)continue;const _0x1c2f17={'userId':_0x3b9bbf,'username':textOrNull(_0x389e1d[_0x50af5d(0x17e)]),'displayName':textOrNull(_0x389e1d['nickname']),'role':_0x389e1d[_0x50af5d(0x16c)]===!![]?_0x50af5d(0x17a):_0x50af5d(0x171),'status':textOrNull(_0x389e1d['status'])},_0x55623e=_0x246e93[_0x50af5d(0x175)](_0x3b9bbf);if(!_0x55623e){_0x246e93[_0x50af5d(0x174)](_0x3b9bbf,_0x1c2f17);continue;}_0x55623e[_0x50af5d(0x17e)]??=_0x1c2f17[_0x50af5d(0x17e)],_0x55623e[_0x50af5d(0x17f)]??=_0x1c2f17[_0x50af5d(0x17f)],_0x55623e['status']??=_0x1c2f17[_0x50af5d(0x17c)];if(_0x1c2f17['role']==='ADMIN')_0x55623e['role']=_0x50af5d(0x17a);}return[..._0x246e93[_0x50af5d(0x16a)]()][_0x50af5d(0x16f)]((_0x572a5f,_0xe27393)=>_0x572a5f['userId']-_0xe27393[_0x50af5d(0x16e)]);}export function assertTenantAccessible(_0x219c9a,_0x1311a6){const _0x2e15b0=a246_0x3a66;if(_0x1311a6[_0x2e15b0(0x176)](_0x3e92c2=>_0x3e92c2['tenantCode']===_0x219c9a))return;throw CliErrors[_0x2e15b0(0x170)]('Tenant\x20\x22'+_0x219c9a+_0x2e15b0(0x169),_0x2e15b0(0x16d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a247_0x1a9f2c=a247_0x45a3;(function(_0x454d97,_0x579656){const _0x133f4f=a247_0x45a3,_0x36510b=_0x454d97();while(!![]){try{const _0x4689a9=parseInt(_0x133f4f(0xe4))/0x1+-parseInt(_0x133f4f(0xf4))/0x2+-parseInt(_0x133f4f(0xe8))/0x3*(-parseInt(_0x133f4f(0xf5))/0x4)+-parseInt(_0x133f4f(0xea))/0x5*(parseInt(_0x133f4f(0xef))/0x6)+parseInt(_0x133f4f(0xdd))/0x7*(parseInt(_0x133f4f(0xe1))/0x8)+-parseInt(_0x133f4f(0xeb))/0x9*(parseInt(_0x133f4f(0xe2))/0xa)+parseInt(_0x133f4f(0xe9))/0xb;if(_0x4689a9===_0x579656)break;else _0x36510b['push'](_0x36510b['shift']());}catch(_0x3c6ff8){_0x36510b['push'](_0x36510b['shift']());}}}(a247_0xe2bd,0xbed70));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID='dingtalk',CURRENT_BINDING_WARNING=a247_0x1a9f2c(0xf3);function readDingTalkUserId(_0x1ebe5d){const _0x1f9606=a247_0x1a9f2c,_0x3b5297=_0x1ebe5d['str']('ding-talk-user-id')[_0x1f9606(0xee)]();if(!_0x3b5297)throw CliErrors[_0x1f9606(0xf7)](_0x1f9606(0xe6),_0x1f9606(0xdf));return _0x3b5297;}function buildBindingData(_0x32c30d,_0x3666fd){const _0x1c33a7=a247_0x1a9f2c;return{'operation':_0x1c33a7(0xec),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x32c30d},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x32c30d,'bound':!![]},'dryRun':_0x3666fd,'backend':{'method':_0x1c33a7(0xf1),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}function a247_0x45a3(_0x34d1a9,_0x735caf){_0x34d1a9=_0x34d1a9-0xdd;const _0xe2bd1f=a247_0xe2bd();let _0x45a36c=_0xe2bd1f[_0x34d1a9];return _0x45a36c;}export const dingTalkSandboxBind={'service':a247_0x1a9f2c(0xe5),'command':a247_0x1a9f2c(0xf2),'description':a247_0x1a9f2c(0xf6),'risk':a247_0x1a9f2c(0xde),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a247_0x1a9f2c(0xe3),'type':a247_0x1a9f2c(0xed),'required':!![],'description':a247_0x1a9f2c(0xf0)}],async 'validate'(_0x4b640a){readDingTalkUserId(_0x4b640a);},async 'dryRun'(_0x1cc80b){const _0x412b3b=readDingTalkUserId(_0x1cc80b);return asDryRunResult(buildBindingData(_0x412b3b,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x40c99f){const _0xcb1437=a247_0x1a9f2c,_0x515263=readDingTalkUserId(_0x40c99f),_0x52a545=await bindDingTalkSandboxAccount(_0x515263);if(_0x52a545!==!![])throw CliErrors[_0xcb1437(0xe0)]('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0xcb1437(0xe7));return{'ok':!![],'data':buildBindingData(_0x515263,![]),'message':_0xcb1437(0xf8)};}};function a247_0xe2bd(){const _0x3d8c11=['2702bbNIPx','write','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','apiError','152kgJfgE','6940sLOveh','ding-talk-user-id','359059jNkvzp','user-account','--ding-talk-user-id\x20cannot\x20be\x20empty.','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','558ydrLwZ','22380204zJcIkx','5kQRPTo','180LdOxse','bind','string','trim','6869934Sysfcm','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','POST','dingding-sandbox-bind','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','1308440WXzbgb','4168FEXAmv','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','validation','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'];a247_0xe2bd=function(){return _0x3d8c11;};return a247_0xe2bd();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a248_0x3462(){const _0x3d7dc6=['153tcDiXA','152738Cnqirt','759624CIjSCU','184744JFLDzG','1TbKmUX','45FSihHf','130pJirco','21FrwjkS','130276tpUtLG','158770bquTTH','1172534JeimKY','250698EVcbas','77tNqcVt'];a248_0x3462=function(){return _0x3d7dc6;};return a248_0x3462();}(function(_0x314e0a,_0x5ada69){const _0x98c13d=a248_0x185c,_0x3f516b=_0x314e0a();while(!![]){try{const _0x4356e8=-parseInt(_0x98c13d(0x15e))/0x1*(-parseInt(_0x98c13d(0x15b))/0x2)+-parseInt(_0x98c13d(0x161))/0x3*(parseInt(_0x98c13d(0x162))/0x4)+-parseInt(_0x98c13d(0x15f))/0x5*(parseInt(_0x98c13d(0x158))/0x6)+-parseInt(_0x98c13d(0x159))/0x7*(parseInt(_0x98c13d(0x15d))/0x8)+parseInt(_0x98c13d(0x15a))/0x9*(parseInt(_0x98c13d(0x163))/0xa)+parseInt(_0x98c13d(0x164))/0xb+parseInt(_0x98c13d(0x15c))/0xc*(parseInt(_0x98c13d(0x160))/0xd);if(_0x4356e8===_0x5ada69)break;else _0x3f516b['push'](_0x3f516b['shift']());}catch(_0x416fe8){_0x3f516b['push'](_0x3f516b['shift']());}}}(a248_0x3462,0x379ff));function a248_0x185c(_0x287a80,_0x5a853b){_0x287a80=_0x287a80-0x158;const _0x34623f=a248_0x3462();let _0x185c4c=_0x34623f[_0x287a80];return _0x185c4c;}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a249_0x3b8488=a249_0x44e1;function a249_0x403d(){const _0x338cae=['1268400TyDUuL','366448LJxBKB','2027958yuvMiy','4FCoKCt','3091915iwVYIr','workspace','5099970FDxxBf','7wmrxJB','workspace\x20add','3231KPEwSe','37461410eMPOyZ','name','App\x20profile\x20name','write','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','4664rRhOrm'];a249_0x403d=function(){return _0x338cae;};return a249_0x403d();}(function(_0x249e69,_0x35c9ba){const _0x3570d1=a249_0x44e1,_0x12dfe5=_0x249e69();while(!![]){try{const _0x2eebf8=-parseInt(_0x3570d1(0x111))/0x1+-parseInt(_0x3570d1(0x110))/0x2+-parseInt(_0x3570d1(0x112))/0x3+parseInt(_0x3570d1(0x113))/0x4*(-parseInt(_0x3570d1(0x114))/0x5)+parseInt(_0x3570d1(0x116))/0x6*(-parseInt(_0x3570d1(0x117))/0x7)+parseInt(_0x3570d1(0x10f))/0x8*(parseInt(_0x3570d1(0x109))/0x9)+parseInt(_0x3570d1(0x10a))/0xa;if(_0x2eebf8===_0x35c9ba)break;else _0x12dfe5['push'](_0x12dfe5['shift']());}catch(_0x4b1f6a){_0x12dfe5['push'](_0x12dfe5['shift']());}}}(a249_0x403d,0xc5dba));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a249_0x44e1(_0x2ce6a6,_0x5d0ca3){_0x2ce6a6=_0x2ce6a6-0x109;const _0x403d81=a249_0x403d();let _0x44e1be=_0x403d81[_0x2ce6a6];return _0x44e1be;}export const workspaceAddDefinition={'service':a249_0x3b8488(0x115),'command':'add','description':a249_0x3b8488(0x10e),'risk':a249_0x3b8488(0x10d),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a249_0x3b8488(0x10b),'description':a249_0x3b8488(0x10c),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x1dceff=>validateAppName(_0x1dceff,'workspace\x20add'),'execute':_0x54da06=>runAppAdd(_0x54da06,a249_0x3b8488(0x118))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a250_0x4a4576=a250_0x4fd1;(function(_0x50ad53,_0x2ed4dc){const _0x54f392=a250_0x4fd1,_0xf1e177=_0x50ad53();while(!![]){try{const _0x321ddb=-parseInt(_0x54f392(0xc6))/0x1+parseInt(_0x54f392(0xe7))/0x2+-parseInt(_0x54f392(0xd0))/0x3+parseInt(_0x54f392(0xcf))/0x4+-parseInt(_0x54f392(0xf7))/0x5*(parseInt(_0x54f392(0xe4))/0x6)+parseInt(_0x54f392(0xc9))/0x7+parseInt(_0x54f392(0xe1))/0x8;if(_0x321ddb===_0x2ed4dc)break;else _0xf1e177['push'](_0xf1e177['shift']());}catch(_0x3bc83b){_0xf1e177['push'](_0xf1e177['shift']());}}}(a250_0x5572,0xe1d1b));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';function a250_0x5572(){const _0x51f7dc=['Target\x20environment','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','appcode','locale','1243280pqQuSL','1183920XVWfiS','number','.\x20Credentials:\x20not\x20written.','initialized','globalConfig','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','\x20workspace\x20use\x20--app\x20<name>`.','App\x20\x22','\x22\x20not\x20found.','\x20--app\x20','Workspace\x20','Initialize\x20the\x20current\x20workspace\x20app\x20binding','Invalid\x20appcode:\x20','string',').\x20Config:\x20','app','write','2286384zfxmKH','pageSize','isArray','858AQHpMs','defaultFormat','format','1483788OSkgJI','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','apiDir','apiGroup','apps','region','Country/region\x20for\x20this\x20workspace\x20app\x20profile','env','\x20--appcode\x20<code>`.','\x20(appcode:\x20','workspace.','init','project','App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)','riskLevel','Missing\x20workspace\x20app\x20selector.','26115SbDwiZ','str','workspace','trim','Use\x20`','keys','length','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','use','12422ShIukf','validation','updated','5182758SYkAZS'];a250_0x5572=function(){return _0x51f7dc;};return a250_0x5572();}import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';import{normalizeStoredDefaultApp}from'../../config/schema.js';import{ENABLED_LOVRABET_REGION_VALUES}from'../../constant/region.js';const WORKSPACE_USAGE=CLI_BIN_NAME+'\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]',SAFE_PROFILE_KEYS=[a250_0x4a4576(0xcd),a250_0x4a4576(0xea),'region',a250_0x4a4576(0xee),a250_0x4a4576(0xe9),a250_0x4a4576(0xe6),a250_0x4a4576(0xe2),a250_0x4a4576(0xf5),a250_0x4a4576(0xce)],workspaceFlags=[{'name':'app','type':a250_0x4a4576(0xdd),'description':a250_0x4a4576(0xd5)},{'name':a250_0x4a4576(0xcd),'type':'string','description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':a250_0x4a4576(0xea),'type':'string','description':'Join\x20key\x20for\x20app\x20profiles\x20that\x20share\x20one\x20generated\x20API\x20model\x20registry'},{'name':a250_0x4a4576(0xec),'type':'string','description':a250_0x4a4576(0xed),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},{'name':'env','type':a250_0x4a4576(0xdd),'description':a250_0x4a4576(0xca),'enum':[...RABETBASE_ENV_VALUES]},{'name':a250_0x4a4576(0xe9),'type':a250_0x4a4576(0xdd),'description':a250_0x4a4576(0xe8)},{'name':'defaultFormat','type':a250_0x4a4576(0xdd),'description':a250_0x4a4576(0xcc),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a250_0x4a4576(0xe2),'type':a250_0x4a4576(0xd1),'description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a250_0x4a4576(0xf5),'type':'string','description':'Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RISK_LEVEL_VALUES]},{'name':a250_0x4a4576(0xce),'type':a250_0x4a4576(0xdd),'description':a250_0x4a4576(0xf4)}];function isRecord(_0x5010f0){const _0x27793e=a250_0x4a4576;return!!_0x5010f0&&typeof _0x5010f0==='object'&&!Array[_0x27793e(0xe3)](_0x5010f0);}function assertValidAppcode(_0x544591){const _0x4048d3=a250_0x4a4576,{valid:_0x1cff5b,message:_0x16909e}=validateAppcode(_0x544591);if(!_0x1cff5b)throw CliErrors[_0x4048d3(0xc7)](_0x4048d3(0xdc)+_0x544591,_0x16909e);}function sanitizeProfile(_0x8e91eb){if(!isRecord(_0x8e91eb))return{};const _0x4bda3e={};for(const _0x39482f of SAFE_PROFILE_KEYS){if(_0x8e91eb[_0x39482f]!==undefined)_0x4bda3e[_0x39482f]=_0x8e91eb[_0x39482f];}return _0x4bda3e;}function cloneProfile(_0x81e493){return isRecord(_0x81e493)?{..._0x81e493}:{};}function collectWorkspaceProfileOverrides(_0x29a940){const _0x238697=a250_0x4a4576,_0x42dff8={},_0x53572f=_0x29a940[_0x238697(0xf8)]('apiGroup'),_0x2b17ac=_0x29a940[_0x238697(0xf8)](_0x238697(0xec)),_0x103dd7=_0x29a940[_0x238697(0xf8)](_0x238697(0xee)),_0x17aa74=_0x29a940[_0x238697(0xf8)](_0x238697(0xe9)),_0x2aec5b=_0x29a940[_0x238697(0xf8)](_0x238697(0xe5)),_0x3ef186=_0x29a940['flag'](_0x238697(0xe2)),_0x41f20c=_0x29a940[_0x238697(0xf8)](_0x238697(0xf5)),_0x393f7b=_0x29a940[_0x238697(0xf8)](_0x238697(0xce));if(_0x53572f)_0x42dff8[_0x238697(0xea)]=_0x53572f;if(_0x2b17ac)_0x42dff8[_0x238697(0xec)]=_0x2b17ac;if(_0x103dd7)_0x42dff8[_0x238697(0xee)]=_0x103dd7;if(_0x17aa74)_0x42dff8[_0x238697(0xe9)]=_0x17aa74;if(_0x2aec5b)_0x42dff8[_0x238697(0xe6)]=_0x2aec5b;if(_0x3ef186!==undefined&&_0x3ef186!=='')_0x42dff8[_0x238697(0xe2)]=Number(_0x3ef186);if(_0x41f20c)_0x42dff8[_0x238697(0xf5)]=_0x41f20c;if(_0x393f7b)_0x42dff8[_0x238697(0xce)]=_0x393f7b;return _0x42dff8;}async function validateWorkspaceArgs(_0x4215a6){const _0xed4f8f=a250_0x4a4576,_0x4f8428=_0x4215a6['str'](_0xed4f8f(0xdf))['trim'](),_0x57b588=_0x4215a6[_0xed4f8f(0xf8)](_0xed4f8f(0xcd))['trim']();if(!_0x4f8428&&!_0x57b588)throw CliErrors[_0xed4f8f(0xc7)](_0xed4f8f(0xf6),_0xed4f8f(0xc1)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x57b588)assertValidAppcode(_0x57b588);}function resolveKnownApps(){const _0x4c19b6=a250_0x4a4576,{config:_0x3a71f,layers:_0x4e8a97}=readRawConfigWithLayers(),_0x39ee03=isRecord(_0x3a71f[_0x4c19b6(0xeb)])?_0x3a71f['apps']:{},_0x1c8573=isRecord(_0x4e8a97[_0x4c19b6(0xd4)][_0x4c19b6(0xeb)])?_0x4e8a97['globalConfig'][_0x4c19b6(0xeb)]:{};return{..._0x1c8573,..._0x39ee03};}function a250_0x4fd1(_0x549443,_0x199698){_0x549443=_0x549443-0xbf;const _0x55721f=a250_0x5572();let _0x4fd104=_0x55721f[_0x549443];return _0x4fd104;}async function configureWorkspace(_0x1df27c,_0x3465d9){const _0x4a3fad=a250_0x4a4576,_0x1da8c1=_0x1df27c['str']('app')[_0x4a3fad(0xc0)](),_0x7d116=_0x1df27c[_0x4a3fad(0xf8)]('appcode')[_0x4a3fad(0xc0)](),_0x2b08ee=_0x1da8c1||_0x7d116;if(!_0x2b08ee)throw CliErrors[_0x4a3fad(0xc7)](_0x4a3fad(0xf6),_0x4a3fad(0xc1)+CLI_BIN_NAME+_0x4a3fad(0xcb)+CLI_BIN_NAME+_0x4a3fad(0xd6));if(_0x7d116)assertValidAppcode(_0x7d116);const _0x20f598=resolveWriteConfigPath(_0x4a3fad(0xf3)),_0x143373=readConfigFile(_0x20f598),_0x9e04fa=resolveKnownApps(),_0x56c3b9=isRecord(_0x143373[_0x4a3fad(0xeb)])?{..._0x143373[_0x4a3fad(0xeb)]}:{},_0x2d636b=cloneProfile(_0x56c3b9[_0x2b08ee]),_0x1034a8=sanitizeProfile(_0x9e04fa[_0x2b08ee]),_0x4ea588=_0x7d116?{}:_0x1034a8,_0x4ef9ee=_0x7d116||_0x4ea588[_0x4a3fad(0xcd)];if(!_0x4ef9ee){const _0x4a0ef2=Object[_0x4a3fad(0xc2)](_0x9e04fa),_0x29933e=_0x4a0ef2[_0x4a3fad(0xc3)]===0x0?'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20'+_0x3465d9+_0x4a3fad(0xd9)+_0x2b08ee+_0x4a3fad(0xef):_0x4a3fad(0xc4)+_0x4a0ef2['join'](',\x20');throw CliErrors['validation'](_0x4a3fad(0xd7)+_0x2b08ee+_0x4a3fad(0xd8),_0x29933e);}assertValidAppcode(String(_0x4ef9ee));const _0x1ee2d7={..._0x4ea588,..._0x2d636b,'appcode':String(_0x4ef9ee),...collectWorkspaceProfileOverrides(_0x1df27c)};return _0x56c3b9[_0x2b08ee]=_0x1ee2d7,_0x143373[_0x4a3fad(0xeb)]=_0x56c3b9,normalizeStoredDefaultApp(_0x143373,_0x2b08ee),delete _0x143373[_0x4a3fad(0xcd)],delete _0x143373[_0x4a3fad(0xdf)],_0x1ee2d7[_0x4a3fad(0xee)]&&(_0x143373[_0x4a3fad(0xee)]=_0x1ee2d7[_0x4a3fad(0xee)]),writeConfigFile(_0x20f598,_0x143373),{'ok':!![],'message':_0x4a3fad(0xda)+(_0x3465d9===_0x4a3fad(0xf2)?_0x4a3fad(0xd3):_0x4a3fad(0xc8))+':\x20'+_0x2b08ee+_0x4a3fad(0xf0)+_0x1ee2d7[_0x4a3fad(0xcd)]+_0x4a3fad(0xde)+_0x20f598+_0x4a3fad(0xd2),'data':{'operation':_0x4a3fad(0xf1)+_0x3465d9,'configPath':_0x20f598,'app':_0x2b08ee,'appcode':_0x1ee2d7['appcode'],'apiGroup':_0x1ee2d7[_0x4a3fad(0xea)]??null,'region':_0x1ee2d7[_0x4a3fad(0xec)]??null,'env':_0x1ee2d7[_0x4a3fad(0xee)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a250_0x4a4576(0xbf),'command':a250_0x4a4576(0xf2),'description':a250_0x4a4576(0xdb),'risk':a250_0x4a4576(0xe0),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x441e45=>configureWorkspace(_0x441e45,a250_0x4a4576(0xf2))},workspaceUseDefinition={'service':a250_0x4a4576(0xbf),'command':a250_0x4a4576(0xc5),'description':'Switch\x20the\x20current\x20workspace\x20app\x20binding','risk':a250_0x4a4576(0xe0),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x21ad7c=>configureWorkspace(_0x21ad7c,a250_0x4a4576(0xc5))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a251_0x3ae55e=a251_0x2972;(function(_0x34cd79,_0x5e5f1c){const _0x27b47d=a251_0x2972,_0x8cae7a=_0x34cd79();while(!![]){try{const _0x5a2746=parseInt(_0x27b47d(0x153))/0x1+parseInt(_0x27b47d(0x14a))/0x2+parseInt(_0x27b47d(0x147))/0x3*(parseInt(_0x27b47d(0x14d))/0x4)+-parseInt(_0x27b47d(0x14c))/0x5*(parseInt(_0x27b47d(0x14b))/0x6)+parseInt(_0x27b47d(0x14e))/0x7+parseInt(_0x27b47d(0x154))/0x8*(parseInt(_0x27b47d(0x14f))/0x9)+parseInt(_0x27b47d(0x145))/0xa*(-parseInt(_0x27b47d(0x146))/0xb);if(_0x5a2746===_0x5e5f1c)break;else _0x8cae7a['push'](_0x8cae7a['shift']());}catch(_0x5aca2f){_0x8cae7a['push'](_0x8cae7a['shift']());}}}(a251_0x4f9f,0x83cc7));function a251_0x2972(_0x213d06,_0x19ddd7){_0x213d06=_0x213d06-0x144;const _0x4f9f4b=a251_0x4f9f();let _0x2972c3=_0x4f9f4b[_0x213d06];return _0x2972c3;}function a251_0x4f9f(){const _0x481a91=['18wWajbk','App\x20profile\x20name\x20to\x20remove','name','workspace','1053418MmZyyD','2261928aKuLMB','workspace\x20remove','3589030uCGRdm','33pfUNfl','3szYdJh','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','write','22264oXLdvA','78SIOqJB','205385SZRmDB','1443864QaenVl','1116913fSvCmm'];a251_0x4f9f=function(){return _0x481a91;};return a251_0x4f9f();}import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a251_0x3ae55e(0x152),'command':'remove','description':a251_0x3ae55e(0x148),'risk':a251_0x3ae55e(0x149),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a251_0x3ae55e(0x151),'description':a251_0x3ae55e(0x150),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x52543f=>validateAppName(_0x52543f,a251_0x3ae55e(0x144)),'execute':_0x5a7c45=>runAppRemove(_0x5a7c45,a251_0x3ae55e(0x144))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a241_0x4a6b10=a241_0x1542;(function(_0x427bbb,_0x1b8a44){const _0x33de4a=a241_0x1542,_0x51695c=_0x427bbb();while(!![]){try{const _0x1ef51e=parseInt(_0x33de4a(0xdf))/0x1+parseInt(_0x33de4a(0xc0))/0x2+parseInt(_0x33de4a(0xef))/0x3+-parseInt(_0x33de4a(0xd1))/0x4*(-parseInt(_0x33de4a(0xe3))/0x5)+-parseInt(_0x33de4a(0xcd))/0x6*(-parseInt(_0x33de4a(0xe6))/0x7)+parseInt(_0x33de4a(0xe7))/0x8+parseInt(_0x33de4a(0xdb))/0x9*(-parseInt(_0x33de4a(0xd7))/0xa);if(_0x1ef51e===_0x1b8a44)break;else _0x51695c['push'](_0x51695c['shift']());}catch(_0x3df823){_0x51695c['push'](_0x51695c['shift']());}}}(a241_0x7a1d,0x218e9));import{existsSync,readFileSync}from'node:fs';import{isAbsolute,resolve}from'node:path';import{CliErrors}from'../errors.js';import{ENTERPRISE_ROUTING_CDN_FIELDS,ENTERPRISE_ROUTING_DOMAIN_FIELDS,ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL,REQUIRED_ENTERPRISE_ROUTING_CDN_FIELDS,REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS}from'../generated/routing-contract.js';export const DOMAIN_CONFIG_FIELDS=['userDomain',a241_0x4a6b10(0xc3),a241_0x4a6b10(0xc4),a241_0x4a6b10(0xf0),a241_0x4a6b10(0xc7),a241_0x4a6b10(0xa4),a241_0x4a6b10(0xb9),a241_0x4a6b10(0xc6)];const DOMAIN_FLAGS={'userDomain':a241_0x4a6b10(0xa5),'apiDomain':'api-domain','runtimeDomain':a241_0x4a6b10(0xd5),'skillDomain':a241_0x4a6b10(0xe0),'kbDomain':a241_0x4a6b10(0xe5),'appDomain':'app-domain','localDomain':a241_0x4a6b10(0xed),'certificateDomain':a241_0x4a6b10(0xc5)};export const LEGACY_DOMAIN_CONFIG_FIELDS=[a241_0x4a6b10(0xec),a241_0x4a6b10(0xeb),a241_0x4a6b10(0xb8)];const ENTERPRISE_TO_LOCAL_FIELD={'userDomain':a241_0x4a6b10(0xae),'apiDomain':a241_0x4a6b10(0xc3),'runtimeDomain':a241_0x4a6b10(0xc4),'skillDomain':a241_0x4a6b10(0xf0),'kbDomain':'kbDomain','appDomain':a241_0x4a6b10(0xa4),'localDomain':a241_0x4a6b10(0xb9),'certificateDomain':'certificateDomain'},ROUTING_CONSUMER=a241_0x4a6b10(0xc8);export function normalizeDomainOrigin(_0x1c98f3,_0xf9456d){const _0x3fd6f8=a241_0x4a6b10;if(typeof _0xf9456d!=='string'||!_0xf9456d[_0x3fd6f8(0xde)]())throw CliErrors[_0x3fd6f8(0xa7)](_0x3fd6f8(0xd9)+_0x1c98f3+_0x3fd6f8(0xd2));let _0x15fbaa;try{_0x15fbaa=new URL(_0xf9456d[_0x3fd6f8(0xde)]());}catch{throw CliErrors[_0x3fd6f8(0xa7)](_0x3fd6f8(0xd9)+_0x1c98f3+_0x3fd6f8(0xd6)+_0xf9456d+_0x3fd6f8(0xd4));}if(_0x15fbaa['protocol']!==_0x3fd6f8(0xea)||_0x15fbaa[_0x3fd6f8(0xda)]||_0x15fbaa[_0x3fd6f8(0xdd)]||_0x15fbaa['pathname']!=='/'&&_0x15fbaa[_0x3fd6f8(0xcb)]!==''||_0x15fbaa[_0x3fd6f8(0xab)]||_0x15fbaa[_0x3fd6f8(0xa3)])throw CliErrors[_0x3fd6f8(0xa7)]('Invalid\x20'+_0x1c98f3+_0x3fd6f8(0xa9),_0x3fd6f8(0xe4));return _0x15fbaa[_0x3fd6f8(0xad)];}export function normalizeRoutingDomainValue(_0x2fdcc3,_0x5d5771){const _0x4407cf=a241_0x4a6b10;if(typeof _0x5d5771===_0x4407cf(0xbc))return normalizeDomainOrigin(_0x2fdcc3,_0x5d5771);if(!_0x5d5771||typeof _0x5d5771!==_0x4407cf(0xf1)||Array[_0x4407cf(0xc1)](_0x5d5771))throw CliErrors[_0x4407cf(0xa7)](_0x4407cf(0xd9)+_0x2fdcc3+':\x20expected\x20an\x20HTTPS\x20origin\x20or\x20consumer\x20Domain\x20object.');const _0x45e0d9=_0x5d5771,_0x460f7c=_0x45e0d9[ROUTING_CONSUMER]??_0x45e0d9[_0x4407cf(0xee)];if(_0x460f7c===undefined)throw CliErrors[_0x4407cf(0xa7)]('Enterprise\x20'+_0x2fdcc3+'\x20does\x20not\x20provide\x20a\x20Domain\x20for\x20'+ROUTING_CONSUMER+_0x4407cf(0xce));return normalizeDomainOrigin(_0x2fdcc3,_0x460f7c);}export function normalizeCdnBaseUrl(_0x26a7f6,_0x338e25){const _0x238da8=a241_0x4a6b10;if(typeof _0x338e25!==_0x238da8(0xbc)||!_0x338e25['trim']())throw CliErrors[_0x238da8(0xa7)](_0x238da8(0xe1)+_0x26a7f6+_0x238da8(0xbf));const _0x4474f0=_0x338e25[_0x238da8(0xde)]()[_0x238da8(0xbb)](/\/$/,'');let _0x8ab7b3;try{_0x8ab7b3=new URL(_0x4474f0);}catch{throw CliErrors[_0x238da8(0xa7)]('Invalid\x20cdn.'+_0x26a7f6+':\x20\x22'+_0x338e25+'\x22\x20is\x20not\x20a\x20valid\x20URL.');}if(_0x8ab7b3[_0x238da8(0xc2)]!==_0x238da8(0xea)||_0x8ab7b3['username']||_0x8ab7b3[_0x238da8(0xdd)]||_0x8ab7b3[_0x238da8(0xab)]||_0x8ab7b3[_0x238da8(0xa3)]||_0x8ab7b3['href'][_0x238da8(0xbb)](/\/$/,'')!==_0x4474f0||_0x26a7f6==='lovrabet'&&_0x8ab7b3['origin']!==_0x4474f0)throw CliErrors[_0x238da8(0xa7)]('Invalid\x20cdn.'+_0x26a7f6+':\x20expected\x20an\x20HTTPS\x20'+(_0x26a7f6==='lovrabet'?_0x238da8(0xad):_0x238da8(0xd3))+_0x238da8(0xa2));return _0x4474f0;}export function resolveEnterpriseRoutingConfig(_0x2e9b55){const _0x29ab36=a241_0x4a6b10;return resolveEnterpriseRoutingManifest(_0x2e9b55)?.[_0x29ab36(0xe9)];}export function resolveEnterpriseRoutingManifest(_0x3e20aa){const _0x27e5c5=a241_0x4a6b10;if(_0x3e20aa===undefined)return undefined;if(!_0x3e20aa||typeof _0x3e20aa!==_0x27e5c5(0xf1)||Array['isArray'](_0x3e20aa))throw CliErrors['validation'](_0x27e5c5(0xaa));return parseEnterpriseRoutingManifest(_0x3e20aa);}export function readDomainConfigInput(_0x331e1a){const _0x580bfa=a241_0x4a6b10,_0x37cf2e=isAbsolute(_0x331e1a)?_0x331e1a:resolve(process[_0x580bfa(0xba)](),_0x331e1a);if(!existsSync(_0x37cf2e))throw CliErrors[_0x580bfa(0xa7)](_0x580bfa(0xbe)+_0x37cf2e);let _0x48f6f0;try{_0x48f6f0=JSON[_0x580bfa(0xcf)](readFileSync(_0x37cf2e,'utf8'));}catch{throw CliErrors[_0x580bfa(0xa7)](_0x580bfa(0xe2)+_0x37cf2e);}if(!_0x48f6f0||typeof _0x48f6f0!==_0x580bfa(0xf1)||Array[_0x580bfa(0xc1)](_0x48f6f0))throw CliErrors[_0x580bfa(0xa7)](_0x580bfa(0xa6));const _0x1d74c9=_0x48f6f0;if(_0x580bfa(0xc2)in _0x1d74c9)return parseEnterpriseRoutingManifest(_0x1d74c9);const _0x4e17d7=Object[_0x580bfa(0xb4)](_0x1d74c9)['filter'](_0x4f719b=>!DOMAIN_CONFIG_FIELDS[_0x580bfa(0xb7)](_0x4f719b));if(_0x4e17d7[_0x580bfa(0xac)]>0x0)throw CliErrors[_0x580bfa(0xa7)](_0x580bfa(0xa8)+_0x4e17d7['join'](',\x20'),_0x580bfa(0xe8)+DOMAIN_CONFIG_FIELDS[_0x580bfa(0xd0)](',\x20'));const _0x126a01={};for(const _0x2c3c84 of DOMAIN_CONFIG_FIELDS){_0x1d74c9[_0x2c3c84]!==undefined&&(_0x126a01[_0x2c3c84]=normalizeDomainOrigin(_0x2c3c84,_0x1d74c9[_0x2c3c84]));}if(Object['keys'](_0x126a01)[_0x580bfa(0xac)]===0x0)throw CliErrors['validation'](_0x580bfa(0xb0));return{'mode':_0x580bfa(0xd8),'domains':_0x126a01};}export function readDomainConfig(_0x41935b){const _0x4ad315=a241_0x4a6b10;return readDomainConfigInput(_0x41935b)[_0x4ad315(0xe9)];}function a241_0x7a1d(){const _0x183a9d=['1531520fQAPFG','Allowed\x20fields:\x20','domains','https:','platformDomain','agentDomain','local-domain','default','379782FEDLtY','skillDomain','object','\x20without\x20credentials,\x20query,\x20or\x20fragment.','hash','appDomain','user-domain','Invalid\x20domain\x20config:\x20expected\x20a\x20JSON\x20object.','validation','Unsupported\x20domain\x20config\x20field(s):\x20',':\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','Invalid\x20enterprise\x20routing\x20config:\x20expected\x20an\x20object.','search','length','origin','userDomain','Enterprise\x20routing\x20manifests\x20cannot\x20be\x20combined\x20with\x20individual\x20Domain\x20flags.','Invalid\x20domain\x20config:\x20provide\x20at\x20least\x20one\x20supported\x20Domain.','Invalid\x20enterprise\x20routing\x20manifest:\x20cdn\x20must\x20be\x20an\x20object.','cdn','enterprise-v1','keys','Update\x20the\x20manifest\x20so\x20both\x20CLIs\x20consume\x20the\x20same\x20routing\x20data.','str','includes','skillHubDomain','localDomain','cwd','replace','string','mode','Domain\x20config\x20file\x20not\x20found:\x20',':\x20expected\x20a\x20non-empty\x20HTTPS\x20URL.','8730clKQUT','isArray','protocol','apiDomain','runtimeDomain','certificate-domain','certificateDomain','kbDomain','rabetbase-cli','filter','Enterprise\x20routing\x20manifest\x20is\x20missing\x20required\x20CDN\x20field(s):\x20','pathname','domain-config','184476fChZuk','\x20and\x20has\x20no\x20default.','parse','join','188hVeixV',':\x20expected\x20a\x20non-empty\x20HTTPS\x20origin.','base\x20URL','\x22\x20is\x20not\x20a\x20valid\x20URL.','runtime-domain',':\x20\x22','240330FgEDIg','legacy','Invalid\x20','username','162JmrwER','Unsupported\x20enterprise\x20CDN\x20field(s):\x20','password','trim','12205tcsMHw','skill-domain','Invalid\x20cdn.','Invalid\x20domain\x20config\x20JSON:\x20','18505lHiJyG','For\x20internal\x20deployments,\x20terminate\x20TLS\x20at\x20the\x20ingress,\x20reverse\x20proxy,\x20or\x20load\x20balancer;\x20an\x20internal\x20CA\x20is\x20supported.','kb-domain','14SjHMiM'];a241_0x7a1d=function(){return _0x183a9d;};return a241_0x7a1d();}function a241_0x1542(_0x300a78,_0x3b847f){_0x300a78=_0x300a78-0xa2;const _0x7a1db9=a241_0x7a1d();let _0x15424f=_0x7a1db9[_0x300a78];return _0x15424f;}export function resolveDomainConfigInput(_0x359964){const _0x2e7b2b=a241_0x4a6b10,_0x57d7fa=(_0x359964[_0x2e7b2b(0xb6)](_0x2e7b2b(0xcc))||'')[_0x2e7b2b(0xde)](),_0x36a995=_0x57d7fa?readDomainConfigInput(_0x57d7fa):{'mode':_0x2e7b2b(0xd8),'domains':{}},_0x321881=DOMAIN_CONFIG_FIELDS['filter'](_0x25d545=>Boolean((_0x359964[_0x2e7b2b(0xb6)](DOMAIN_FLAGS[_0x25d545])||'')['trim']()));if(_0x36a995[_0x2e7b2b(0xbd)]===_0x2e7b2b(0xb3)&&_0x321881[_0x2e7b2b(0xac)]>0x0)throw CliErrors[_0x2e7b2b(0xa7)](_0x2e7b2b(0xaf),_0x2e7b2b(0xb5));for(const _0x26cd14 of DOMAIN_CONFIG_FIELDS){const _0x4b6004=(_0x359964[_0x2e7b2b(0xb6)](DOMAIN_FLAGS[_0x26cd14])||'')['trim']();if(_0x4b6004)_0x36a995[_0x2e7b2b(0xe9)][_0x26cd14]=normalizeDomainOrigin(_0x26cd14,_0x4b6004);}return _0x36a995;}export function resolveDomainFlags(_0x3b5ed3){const _0x2f79f4=a241_0x4a6b10;return resolveDomainConfigInput(_0x3b5ed3)[_0x2f79f4(0xe9)];}export function parseEnterpriseRoutingManifest(_0x4e5fcf){const _0x1b21f3=a241_0x4a6b10;if(_0x4e5fcf['protocol']!==ENTERPRISE_ROUTING_PROTOCOL||_0x4e5fcf['kind']!==ENTERPRISE_ROUTING_KIND)throw CliErrors['validation']('Unsupported\x20routing\x20manifest:\x20expected\x20protocol\x20\x22'+ENTERPRISE_ROUTING_PROTOCOL+'\x22\x20and\x20kind\x20\x22'+ENTERPRISE_ROUTING_KIND+'\x22.');if(!_0x4e5fcf[_0x1b21f3(0xe9)]||typeof _0x4e5fcf['domains']!==_0x1b21f3(0xf1)||Array[_0x1b21f3(0xc1)](_0x4e5fcf[_0x1b21f3(0xe9)]))throw CliErrors['validation']('Invalid\x20enterprise\x20routing\x20manifest:\x20domains\x20must\x20be\x20an\x20object.');if(!_0x4e5fcf['cdn']||typeof _0x4e5fcf[_0x1b21f3(0xb2)]!==_0x1b21f3(0xf1)||Array[_0x1b21f3(0xc1)](_0x4e5fcf[_0x1b21f3(0xb2)]))throw CliErrors[_0x1b21f3(0xa7)](_0x1b21f3(0xb1));const _0x2d74c8=_0x4e5fcf[_0x1b21f3(0xe9)],_0x354d76=REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS['filter'](_0x37d4c7=>_0x2d74c8[_0x37d4c7]===undefined);if(_0x354d76[_0x1b21f3(0xac)]>0x0)throw CliErrors['validation']('Enterprise\x20routing\x20manifest\x20is\x20missing\x20required\x20Domain(s):\x20'+_0x354d76[_0x1b21f3(0xd0)](',\x20'));if(_0x2d74c8[_0x1b21f3(0xb9)]===undefined!==(_0x2d74c8[_0x1b21f3(0xc6)]===undefined))throw CliErrors['validation']('Enterprise\x20routing\x20manifest\x20requires\x20localDomain\x20and\x20certificateDomain\x20together.');const _0x5c1ca8=_0x4e5fcf['cdn'],_0x3038a0=Object[_0x1b21f3(0xb4)](_0x5c1ca8)[_0x1b21f3(0xc9)](_0x1bbe6d=>!ENTERPRISE_ROUTING_CDN_FIELDS[_0x1b21f3(0xb7)](_0x1bbe6d));if(_0x3038a0['length']>0x0)throw CliErrors[_0x1b21f3(0xa7)](_0x1b21f3(0xdc)+_0x3038a0[_0x1b21f3(0xd0)](',\x20'),'Allowed\x20fields:\x20'+ENTERPRISE_ROUTING_CDN_FIELDS[_0x1b21f3(0xd0)](',\x20'));const _0x2e2599=REQUIRED_ENTERPRISE_ROUTING_CDN_FIELDS['filter'](_0x17de4f=>_0x5c1ca8[_0x17de4f]===undefined);if(_0x2e2599[_0x1b21f3(0xac)]>0x0)throw CliErrors[_0x1b21f3(0xa7)](_0x1b21f3(0xca)+_0x2e2599[_0x1b21f3(0xd0)](',\x20'));const _0x5617d9={};for(const _0x58fbfa of ENTERPRISE_ROUTING_CDN_FIELDS){_0x5617d9[_0x58fbfa]=normalizeCdnBaseUrl(_0x58fbfa,_0x5c1ca8[_0x58fbfa]);}const _0xdd3b3={},_0x48475a={};for(const _0x34ab0e of ENTERPRISE_ROUTING_DOMAIN_FIELDS){const _0x345bcf=_0x2d74c8[_0x34ab0e];if(_0x345bcf===undefined)continue;const _0x3f925a=normalizeRoutingDomainValue(_0x34ab0e,_0x345bcf);_0xdd3b3[_0x34ab0e]=_0x3f925a;const _0x28ea67=ENTERPRISE_TO_LOCAL_FIELD[_0x34ab0e];_0x28ea67&&(_0x48475a[_0x28ea67]=_0x3f925a);}return{'mode':_0x1b21f3(0xb3),'domains':_0x48475a,'manifestDomains':_0xdd3b3,'cdn':_0x5617d9};}
|
|
1
|
+
const a252_0xb3d211=a252_0x109c;(function(_0x4a97a2,_0x237cc6){const _0x33f260=a252_0x109c,_0x5b4747=_0x4a97a2();while(!![]){try{const _0x4e0c2a=parseInt(_0x33f260(0x10c))/0x1+-parseInt(_0x33f260(0x132))/0x2*(-parseInt(_0x33f260(0x115))/0x3)+parseInt(_0x33f260(0x121))/0x4*(parseInt(_0x33f260(0x10e))/0x5)+parseInt(_0x33f260(0x140))/0x6+-parseInt(_0x33f260(0x134))/0x7+parseInt(_0x33f260(0x13b))/0x8*(-parseInt(_0x33f260(0x12f))/0x9)+-parseInt(_0x33f260(0x111))/0xa;if(_0x4e0c2a===_0x237cc6)break;else _0x5b4747['push'](_0x5b4747['shift']());}catch(_0x5c4d01){_0x5b4747['push'](_0x5b4747['shift']());}}}(a252_0x1065,0x5ee4e));import{existsSync,readFileSync}from'node:fs';import{isAbsolute,resolve}from'node:path';import{CliErrors}from'../errors.js';import{ENTERPRISE_ROUTING_CDN_FIELDS,ENTERPRISE_ROUTING_DOMAIN_FIELDS,ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL,REQUIRED_ENTERPRISE_ROUTING_CDN_FIELDS,REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS}from'../generated/routing-contract.js';export const DOMAIN_CONFIG_FIELDS=[a252_0xb3d211(0x138),a252_0xb3d211(0x12e),a252_0xb3d211(0x120),a252_0xb3d211(0x10b),a252_0xb3d211(0xfb),a252_0xb3d211(0x104),'localDomain',a252_0xb3d211(0x127)];const DOMAIN_FLAGS={'userDomain':'user-domain','apiDomain':a252_0xb3d211(0xfd),'runtimeDomain':'runtime-domain','skillDomain':a252_0xb3d211(0x13e),'kbDomain':a252_0xb3d211(0x143),'appDomain':a252_0xb3d211(0x12b),'localDomain':a252_0xb3d211(0x139),'certificateDomain':'certificate-domain'};export const LEGACY_DOMAIN_CONFIG_FIELDS=['agentDomain',a252_0xb3d211(0x123),a252_0xb3d211(0x11b)];const ENTERPRISE_TO_LOCAL_FIELD={'userDomain':a252_0xb3d211(0x138),'apiDomain':'apiDomain','runtimeDomain':'runtimeDomain','skillDomain':a252_0xb3d211(0x10b),'kbDomain':a252_0xb3d211(0xfb),'appDomain':a252_0xb3d211(0x104),'localDomain':a252_0xb3d211(0x11e),'certificateDomain':'certificateDomain'},ROUTING_CONSUMER='rabetbase-cli';export function normalizeDomainOrigin(_0x4b1390,_0x49ad83){const _0x35b87a=a252_0xb3d211;if(typeof _0x49ad83!==_0x35b87a(0x13a)||!_0x49ad83[_0x35b87a(0x107)]())throw CliErrors[_0x35b87a(0x10d)]('Invalid\x20'+_0x4b1390+_0x35b87a(0x147));let _0x39a0b6;try{_0x39a0b6=new URL(_0x49ad83[_0x35b87a(0x107)]());}catch{throw CliErrors['validation']('Invalid\x20'+_0x4b1390+_0x35b87a(0x131)+_0x49ad83+_0x35b87a(0x142));}if(_0x39a0b6['protocol']!==_0x35b87a(0x100)||_0x39a0b6[_0x35b87a(0x11a)]||_0x39a0b6[_0x35b87a(0x13f)]||_0x39a0b6[_0x35b87a(0x13c)]!=='/'&&_0x39a0b6['pathname']!==''||_0x39a0b6[_0x35b87a(0x10a)]||_0x39a0b6[_0x35b87a(0x141)])throw CliErrors['validation']('Invalid\x20'+_0x4b1390+_0x35b87a(0x110),'For\x20internal\x20deployments,\x20terminate\x20TLS\x20at\x20the\x20ingress,\x20reverse\x20proxy,\x20or\x20load\x20balancer;\x20an\x20internal\x20CA\x20is\x20supported.');return _0x39a0b6[_0x35b87a(0x102)];}export function normalizeRoutingDomainValue(_0x4b59ed,_0x5eee80){const _0x42495e=a252_0xb3d211;if(typeof _0x5eee80===_0x42495e(0x13a))return normalizeDomainOrigin(_0x4b59ed,_0x5eee80);if(!_0x5eee80||typeof _0x5eee80!==_0x42495e(0x11d)||Array[_0x42495e(0x11f)](_0x5eee80))throw CliErrors[_0x42495e(0x10d)](_0x42495e(0x129)+_0x4b59ed+_0x42495e(0x116));const _0x27a70b=_0x5eee80,_0xb00b87=_0x27a70b[ROUTING_CONSUMER]??_0x27a70b[_0x42495e(0x118)];if(_0xb00b87===undefined)throw CliErrors['validation'](_0x42495e(0x122)+_0x4b59ed+'\x20does\x20not\x20provide\x20a\x20Domain\x20for\x20'+ROUTING_CONSUMER+'\x20and\x20has\x20no\x20default.');return normalizeDomainOrigin(_0x4b59ed,_0xb00b87);}export function normalizeCdnBaseUrl(_0x498813,_0x330080){const _0x46a40c=a252_0xb3d211;if(typeof _0x330080!==_0x46a40c(0x13a)||!_0x330080[_0x46a40c(0x107)]())throw CliErrors[_0x46a40c(0x10d)](_0x46a40c(0x125)+_0x498813+_0x46a40c(0x109));const _0x213022=_0x330080[_0x46a40c(0x107)]()[_0x46a40c(0x10f)](/\/$/,'');let _0x24843d;try{_0x24843d=new URL(_0x213022);}catch{throw CliErrors[_0x46a40c(0x10d)](_0x46a40c(0x125)+_0x498813+_0x46a40c(0x131)+_0x330080+'\x22\x20is\x20not\x20a\x20valid\x20URL.');}if(_0x24843d[_0x46a40c(0x144)]!=='https:'||_0x24843d['username']||_0x24843d[_0x46a40c(0x13f)]||_0x24843d[_0x46a40c(0x10a)]||_0x24843d['hash']||_0x24843d[_0x46a40c(0x117)]['replace'](/\/$/,'')!==_0x213022||_0x498813==='lovrabet'&&_0x24843d[_0x46a40c(0x102)]!==_0x213022)throw CliErrors['validation'](_0x46a40c(0x125)+_0x498813+_0x46a40c(0x133)+(_0x498813==='lovrabet'?_0x46a40c(0x102):'base\x20URL')+'\x20without\x20credentials,\x20query,\x20or\x20fragment.');return _0x213022;}function a252_0x1065(){const _0x10215d=['userDomain','local-domain','string','96RJTqzO','pathname','keys','skill-domain','password','979422TGlnEb','hash','\x22\x20is\x20not\x20a\x20valid\x20URL.','kb-domain','protocol','Enterprise\x20routing\x20manifest\x20is\x20missing\x20required\x20CDN\x20field(s):\x20','parse',':\x20expected\x20a\x20non-empty\x20HTTPS\x20origin.','mode','Update\x20the\x20manifest\x20so\x20both\x20CLIs\x20consume\x20the\x20same\x20routing\x20data.','Invalid\x20domain\x20config:\x20expected\x20a\x20JSON\x20object.','kbDomain','legacy','api-domain','Enterprise\x20routing\x20manifest\x20is\x20missing\x20required\x20Domain(s):\x20','Unsupported\x20domain\x20config\x20field(s):\x20','https:','str','origin','Unsupported\x20routing\x20manifest:\x20expected\x20protocol\x20\x22','appDomain','domain-config','domains','trim','includes',':\x20expected\x20a\x20non-empty\x20HTTPS\x20URL.','search','skillDomain','431011jgeIES','validation','5LmvzIc','replace',':\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','7119050LbJWer','Invalid\x20enterprise\x20routing\x20manifest:\x20cdn\x20must\x20be\x20an\x20object.','cdn','Allowed\x20fields:\x20','54YJEShM',':\x20expected\x20an\x20HTTPS\x20origin\x20or\x20consumer\x20Domain\x20object.','href','default','Domain\x20config\x20file\x20not\x20found:\x20','username','skillHubDomain','\x22\x20and\x20kind\x20\x22','object','localDomain','isArray','runtimeDomain','2616004alrRgB','Enterprise\x20','platformDomain','enterprise-v1','Invalid\x20cdn.','utf8','certificateDomain','Invalid\x20domain\x20config\x20JSON:\x20','Invalid\x20','length','app-domain','join','cwd','apiDomain','80496cxUrPG','filter',':\x20\x22','68692uPnFeb',':\x20expected\x20an\x20HTTPS\x20','4609906wXCyvL','Invalid\x20domain\x20config:\x20provide\x20at\x20least\x20one\x20supported\x20Domain.','Enterprise\x20routing\x20manifests\x20cannot\x20be\x20combined\x20with\x20individual\x20Domain\x20flags.','kind'];a252_0x1065=function(){return _0x10215d;};return a252_0x1065();}export function resolveEnterpriseRoutingConfig(_0x3e5609){const _0xe40d16=a252_0xb3d211;return resolveEnterpriseRoutingManifest(_0x3e5609)?.[_0xe40d16(0x106)];}export function resolveEnterpriseRoutingManifest(_0x2c6234){const _0x437374=a252_0xb3d211;if(_0x2c6234===undefined)return undefined;if(!_0x2c6234||typeof _0x2c6234!==_0x437374(0x11d)||Array[_0x437374(0x11f)](_0x2c6234))throw CliErrors[_0x437374(0x10d)]('Invalid\x20enterprise\x20routing\x20config:\x20expected\x20an\x20object.');return parseEnterpriseRoutingManifest(_0x2c6234);}export function readDomainConfigInput(_0x6f9f04){const _0x17a53f=a252_0xb3d211,_0x280ae9=isAbsolute(_0x6f9f04)?_0x6f9f04:resolve(process[_0x17a53f(0x12d)](),_0x6f9f04);if(!existsSync(_0x280ae9))throw CliErrors[_0x17a53f(0x10d)](_0x17a53f(0x119)+_0x280ae9);let _0x428a90;try{_0x428a90=JSON[_0x17a53f(0x146)](readFileSync(_0x280ae9,_0x17a53f(0x126)));}catch{throw CliErrors[_0x17a53f(0x10d)](_0x17a53f(0x128)+_0x280ae9);}if(!_0x428a90||typeof _0x428a90!==_0x17a53f(0x11d)||Array[_0x17a53f(0x11f)](_0x428a90))throw CliErrors[_0x17a53f(0x10d)](_0x17a53f(0x14a));const _0x487725=_0x428a90;if(_0x17a53f(0x144)in _0x487725)return parseEnterpriseRoutingManifest(_0x487725);const _0x5522de=Object[_0x17a53f(0x13d)](_0x487725)[_0x17a53f(0x130)](_0x4b24cf=>!DOMAIN_CONFIG_FIELDS[_0x17a53f(0x108)](_0x4b24cf));if(_0x5522de[_0x17a53f(0x12a)]>0x0)throw CliErrors[_0x17a53f(0x10d)](_0x17a53f(0xff)+_0x5522de['join'](',\x20'),_0x17a53f(0x114)+DOMAIN_CONFIG_FIELDS[_0x17a53f(0x12c)](',\x20'));const _0x516d66={};for(const _0x5dc6e0 of DOMAIN_CONFIG_FIELDS){_0x487725[_0x5dc6e0]!==undefined&&(_0x516d66[_0x5dc6e0]=normalizeDomainOrigin(_0x5dc6e0,_0x487725[_0x5dc6e0]));}if(Object[_0x17a53f(0x13d)](_0x516d66)[_0x17a53f(0x12a)]===0x0)throw CliErrors[_0x17a53f(0x10d)](_0x17a53f(0x135));return{'mode':_0x17a53f(0xfc),'domains':_0x516d66};}function a252_0x109c(_0x4a7e8f,_0x5f3975){_0x4a7e8f=_0x4a7e8f-0xfb;const _0x1065c9=a252_0x1065();let _0x109c20=_0x1065c9[_0x4a7e8f];return _0x109c20;}export function readDomainConfig(_0x26fb07){return readDomainConfigInput(_0x26fb07)['domains'];}export function resolveDomainConfigInput(_0x4e63c4){const _0x86bb2c=a252_0xb3d211,_0x2c5c15=(_0x4e63c4[_0x86bb2c(0x101)](_0x86bb2c(0x105))||'')[_0x86bb2c(0x107)](),_0x5b8ad0=_0x2c5c15?readDomainConfigInput(_0x2c5c15):{'mode':_0x86bb2c(0xfc),'domains':{}},_0x545b91=DOMAIN_CONFIG_FIELDS[_0x86bb2c(0x130)](_0x56dddf=>Boolean((_0x4e63c4[_0x86bb2c(0x101)](DOMAIN_FLAGS[_0x56dddf])||'')[_0x86bb2c(0x107)]()));if(_0x5b8ad0[_0x86bb2c(0x148)]===_0x86bb2c(0x124)&&_0x545b91[_0x86bb2c(0x12a)]>0x0)throw CliErrors[_0x86bb2c(0x10d)](_0x86bb2c(0x136),_0x86bb2c(0x149));for(const _0x57d700 of DOMAIN_CONFIG_FIELDS){const _0x1ff7d8=(_0x4e63c4['str'](DOMAIN_FLAGS[_0x57d700])||'')[_0x86bb2c(0x107)]();if(_0x1ff7d8)_0x5b8ad0[_0x86bb2c(0x106)][_0x57d700]=normalizeDomainOrigin(_0x57d700,_0x1ff7d8);}return _0x5b8ad0;}export function resolveDomainFlags(_0x525119){const _0x3233b1=a252_0xb3d211;return resolveDomainConfigInput(_0x525119)[_0x3233b1(0x106)];}export function parseEnterpriseRoutingManifest(_0xd87051){const _0x17c758=a252_0xb3d211;if(_0xd87051['protocol']!==ENTERPRISE_ROUTING_PROTOCOL||_0xd87051[_0x17c758(0x137)]!==ENTERPRISE_ROUTING_KIND)throw CliErrors['validation'](_0x17c758(0x103)+ENTERPRISE_ROUTING_PROTOCOL+_0x17c758(0x11c)+ENTERPRISE_ROUTING_KIND+'\x22.');if(!_0xd87051[_0x17c758(0x106)]||typeof _0xd87051[_0x17c758(0x106)]!==_0x17c758(0x11d)||Array[_0x17c758(0x11f)](_0xd87051[_0x17c758(0x106)]))throw CliErrors[_0x17c758(0x10d)]('Invalid\x20enterprise\x20routing\x20manifest:\x20domains\x20must\x20be\x20an\x20object.');if(!_0xd87051[_0x17c758(0x113)]||typeof _0xd87051[_0x17c758(0x113)]!==_0x17c758(0x11d)||Array[_0x17c758(0x11f)](_0xd87051[_0x17c758(0x113)]))throw CliErrors['validation'](_0x17c758(0x112));const _0x94f45a=_0xd87051[_0x17c758(0x106)],_0x48d364=REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS[_0x17c758(0x130)](_0xc71b9e=>_0x94f45a[_0xc71b9e]===undefined);if(_0x48d364[_0x17c758(0x12a)]>0x0)throw CliErrors['validation'](_0x17c758(0xfe)+_0x48d364['join'](',\x20'));if(_0x94f45a[_0x17c758(0x11e)]===undefined!==(_0x94f45a['certificateDomain']===undefined))throw CliErrors[_0x17c758(0x10d)]('Enterprise\x20routing\x20manifest\x20requires\x20localDomain\x20and\x20certificateDomain\x20together.');const _0x3b00d4=_0xd87051['cdn'],_0x6e158=Object[_0x17c758(0x13d)](_0x3b00d4)['filter'](_0x1a3b03=>!ENTERPRISE_ROUTING_CDN_FIELDS[_0x17c758(0x108)](_0x1a3b03));if(_0x6e158[_0x17c758(0x12a)]>0x0)throw CliErrors[_0x17c758(0x10d)]('Unsupported\x20enterprise\x20CDN\x20field(s):\x20'+_0x6e158['join'](',\x20'),_0x17c758(0x114)+ENTERPRISE_ROUTING_CDN_FIELDS[_0x17c758(0x12c)](',\x20'));const _0x5ba078=REQUIRED_ENTERPRISE_ROUTING_CDN_FIELDS[_0x17c758(0x130)](_0x5864b7=>_0x3b00d4[_0x5864b7]===undefined);if(_0x5ba078['length']>0x0)throw CliErrors['validation'](_0x17c758(0x145)+_0x5ba078[_0x17c758(0x12c)](',\x20'));const _0xa23f5={};for(const _0x47c3b9 of ENTERPRISE_ROUTING_CDN_FIELDS){_0xa23f5[_0x47c3b9]=normalizeCdnBaseUrl(_0x47c3b9,_0x3b00d4[_0x47c3b9]);}const _0x4ae674={},_0x566b4d={};for(const _0x53f217 of ENTERPRISE_ROUTING_DOMAIN_FIELDS){const _0x22c444=_0x94f45a[_0x53f217];if(_0x22c444===undefined)continue;const _0x332ce9=normalizeRoutingDomainValue(_0x53f217,_0x22c444);_0x4ae674[_0x53f217]=_0x332ce9;const _0x96a373=ENTERPRISE_TO_LOCAL_FIELD[_0x53f217];_0x96a373&&(_0x566b4d[_0x96a373]=_0x332ce9);}return{'mode':'enterprise-v1','domains':_0x566b4d,'manifestDomains':_0x4ae674,'cdn':_0xa23f5};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a253_0x518f45=a253_0x2428;function a253_0x1313(){const _0x288b5c=['stringify','1182033XAbyJf','1374290XAhhrX','independent','/cert/lovrabet-dev.json','85170ZaJmAK','16syuDex','2133804HVjkJS','rabetbase.domain-routing.json','lovrabet-project-domain-routing/v1','origin','official','now','local','Independent\x20deployment\x20routing\x20requires\x20localDomain\x20and\x20certificateDomain\x20together.','.tmp','2984580hEbtHN','pid','21wwVzcq','1581936TdzfDi','http://localhost','2752566NfmJrN'];a253_0x1313=function(){return _0x288b5c;};return a253_0x1313();}(function(_0x55a366,_0x4541f9){const _0x446b01=a253_0x2428,_0x1ac5a8=_0x55a366();while(!![]){try{const _0x5e182e=-parseInt(_0x446b01(0xe0))/0x1*(parseInt(_0x446b01(0xe1))/0x2)+-parseInt(_0x446b01(0xdc))/0x3+parseInt(_0x446b01(0xe2))/0x4+parseInt(_0x446b01(0xdd))/0x5+parseInt(_0x446b01(0xda))/0x6+-parseInt(_0x446b01(0xd7))/0x7*(-parseInt(_0x446b01(0xd8))/0x8)+-parseInt(_0x446b01(0xd5))/0x9;if(_0x5e182e===_0x4541f9)break;else _0x1ac5a8['push'](_0x1ac5a8['shift']());}catch(_0x2a709a){_0x1ac5a8['push'](_0x1ac5a8['shift']());}}}(a253_0x1313,0x6eab9));import{readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{join}from'node:path';import{getActiveRegion,getActiveCdn,getApiDomain,getAppDomain,getCertificateDomain,getKbDomain,getLocalDomain,getRuntimeDomain,getSkillDomain,getUserDomain,isIndependentDeployment}from'../constant/domain.js';import{getOfficialRoutingProfile}from'../constant/routing-profile.js';export const PROJECT_DOMAIN_ROUTING_FILE_NAME=a253_0x518f45(0xe3);export const PROJECT_DOMAIN_ROUTING_PROTOCOL=a253_0x518f45(0xe4);export function getProjectDomainRoutingManifest(){const _0x5b5a55=a253_0x518f45,_0x1c9dfc=getActiveRegion(),_0x15cb98=isIndependentDeployment(),_0x3cded5=getOfficialRoutingProfile(_0x1c9dfc),_0x59f06e=getLocalDomain(),_0x5f40c2=getCertificateDomain(),_0x5c9bac=getActiveCdn();if(!!_0x59f06e!==!!_0x5f40c2)throw new Error(_0x5b5a55(0xd3));return{'protocol':PROJECT_DOMAIN_ROUTING_PROTOCOL,'mode':_0x15cb98?_0x5b5a55(0xde):_0x5b5a55(0xe6),'region':_0x15cb98?null:_0x1c9dfc,'domains':{'api':getApiDomain(),'runtime':getRuntimeDomain(),'user':getUserDomain(),'app':getAppDomain(),'skill':getSkillDomain(),'kb':getKbDomain()},'cdn':_0x5c9bac,'local':_0x59f06e&&_0x5f40c2?{'origin':_0x59f06e,'certificateUrl':_0x5f40c2+'/cert/lovrabet-dev.json'}:_0x15cb98?{'origin':_0x5b5a55(0xd9)}:{'origin':_0x3cded5[_0x5b5a55(0xd2)][_0x5b5a55(0xe5)],'certificateUrl':_0x5c9bac['lovrabet']+_0x5b5a55(0xdf)}};}function a253_0x2428(_0x145a7e,_0x327a29){_0x145a7e=_0x145a7e-0xd1;const _0x131316=a253_0x1313();let _0x2428c6=_0x131316[_0x145a7e];return _0x2428c6;}export function writeProjectDomainRoutingManifest(_0x268063){const _0x203837=a253_0x518f45,_0xad5ac8=getProjectDomainRoutingManifest(),_0x28dd9a=join(_0x268063,PROJECT_DOMAIN_ROUTING_FILE_NAME),_0x28ac4d=JSON[_0x203837(0xdb)](_0xad5ac8,null,0x2)+'\x0a';try{if(readFileSync(_0x28dd9a,'utf8')===_0x28ac4d)return{'path':_0x28dd9a,'manifest':_0xad5ac8,'changed':![]};}catch{}const _0x2c4ac3=_0x28dd9a+'.'+process[_0x203837(0xd6)]+'.'+Date[_0x203837(0xd1)]()+_0x203837(0xd4);try{writeFileSync(_0x2c4ac3,_0x28ac4d,{'encoding':'utf8','mode':0x1a4}),renameSync(_0x2c4ac3,_0x28dd9a);}catch(_0x3b801f){try{unlinkSync(_0x2c4ac3);}catch{}throw _0x3b801f;}return{'path':_0x28dd9a,'manifest':_0xad5ac8,'changed':!![]};}
|