@lovrabet/rabetbase-cli 2.5.6-beta.1 → 2.5.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.d.ts +1 -0
- package/lib/commands/dataset/design-context.js +1 -0
- package/lib/commands/dataset/design-start.d.ts +1 -0
- package/lib/commands/dataset/design-start.js +1 -0
- package/lib/commands/dataset/design-status.d.ts +1 -0
- package/lib/commands/dataset/design-status.js +1 -0
- package/lib/commands/dataset/design-sync-retry.d.ts +1 -0
- package/lib/commands/dataset/design-sync-retry.js +1 -0
- package/lib/commands/dataset/design-sync-status.d.ts +1 -0
- package/lib/commands/dataset/design-sync-status.js +1 -0
- package/lib/commands/dataset/design-validate.d.ts +1 -0
- package/lib/commands/dataset/design-validate.js +1 -0
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.d.ts +2 -0
- package/lib/commands/flow/page-list.js +1 -0
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.d.ts +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.d.ts +6 -2
- 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/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +37 -6
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.d.ts +12 -0
- 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.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.d.ts +17 -0
- package/lib/services/dataset-design/checkpoint.js +1 -0
- package/lib/services/dataset-design/commands.d.ts +6 -0
- package/lib/services/dataset-design/commands.js +1 -0
- package/lib/services/dataset-design/contract.d.ts +7 -0
- package/lib/services/dataset-design/contract.js +1 -0
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +3 -2
- package/skills/rabetbase/SKILL.md +11 -7
- package/skills/rabetbase/guides/approval-flow-development-workflow.md +52 -13
- package/skills/rabetbase/guides/backend-function.md +26 -4
- package/skills/rabetbase/guides/bff-creation-workflow.md +9 -0
- package/skills/rabetbase/guides/cross-database-bff.md +1 -0
- package/skills/rabetbase/guides/custom-page-flow-sdk.md +2 -0
- package/skills/rabetbase/guides/data-api-guidelines.md +2 -0
- package/skills/rabetbase/guides/flow-config-examples.md +75 -0
- package/skills/rabetbase/guides/form-flow-start.md +61 -0
- package/skills/rabetbase/guides/typescript-sdk.md +1 -1
- package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +18 -4
- package/skills/rabetbase/references/rabetbase-codegen-sdk.md +5 -4
- package/skills/rabetbase/references/rabetbase-dataset-design.md +25 -0
- package/skills/rabetbase/references/rabetbase-dataset-generate.md +2 -255
- package/skills/rabetbase/references/rabetbase-flow-commands.md +21 -2
- package/skills/rabetbase/references/rabetbase-flow-resources.md +21 -3
- package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +6 -2
- package/skills/rabetbase/references/rabetbase-kb.md +4 -1
- package/skills/rabetbase-dataset-generation/SKILL.md +45 -0
- package/skills/rabetbase-dataset-generation/references/workflow.md +60 -0
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +6 -3
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a250_0x28ab67=a250_0x67c3;(function(_0x412c2a,_0x5f1772){const _0x52c5a2=a250_0x67c3,_0x53fb9f=_0x412c2a();while(!![]){try{const _0x2ca7c3=-parseInt(_0x52c5a2(0xdd))/0x1+parseInt(_0x52c5a2(0xe9))/0x2*(-parseInt(_0x52c5a2(0xd6))/0x3)+parseInt(_0x52c5a2(0xd8))/0x4*(-parseInt(_0x52c5a2(0xd4))/0x5)+parseInt(_0x52c5a2(0xdb))/0x6+-parseInt(_0x52c5a2(0xe7))/0x7+-parseInt(_0x52c5a2(0xeb))/0x8*(-parseInt(_0x52c5a2(0xdf))/0x9)+parseInt(_0x52c5a2(0xde))/0xa;if(_0x2ca7c3===_0x5f1772)break;else _0x53fb9f['push'](_0x53fb9f['shift']());}catch(_0x13b0f7){_0x53fb9f['push'](_0x53fb9f['shift']());}}}(a250_0x17f7,0xd1aa8));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a250_0x67c3(_0x596247,_0x6d292d){_0x596247=_0x596247-0xd4;const _0x17f78b=a250_0x17f7();let _0x67c384=_0x17f78b[_0x596247];return _0x67c384;}export const sqlExec={'service':a250_0x28ab67(0xe1),'command':a250_0x28ab67(0xe0),'description':a250_0x28ab67(0xe2),'risk':a250_0x28ab67(0xdc),'flags':[SQLCODE_FLAG,{'name':a250_0x28ab67(0xe6),'type':a250_0x28ab67(0xe5),'description':a250_0x28ab67(0xda)}],async 'execute'(_0x7256b){const _0x4828d2=a250_0x28ab67,_0xb8567c=parseJsonParams(_0x7256b['str']('params')),_0x49fe14=Date[_0x4828d2(0xd5)](),_0x50a801=await executeSql(_0x7256b['appCode'],_0x7256b[_0x4828d2(0xea)]('sqlcode'),_0xb8567c),_0x3f49ff=Date[_0x4828d2(0xd5)]()-_0x49fe14,_0x17f9a1=_0x50a801?.['execResult']??_0x50a801,_0x570a42=_0x50a801?.[_0x4828d2(0xe3)]??!![];if(!_0x570a42)return{'ok':![],'data':{'error':_0x50a801?.['execError']||'SQL\x20execution\x20failed','elapsed':_0x3f49ff},'message':_0x4828d2(0xe4)};const _0x24da9d=Array[_0x4828d2(0xe8)](_0x17f9a1)?_0x17f9a1:[];return{'ok':!![],'data':{'rows':_0x24da9d,'rowCount':_0x24da9d[_0x4828d2(0xd7)],'elapsed':_0x3f49ff},'message':_0x4828d2(0xec)+_0x24da9d[_0x4828d2(0xd7)]+_0x4828d2(0xd9)+_0x3f49ff+'ms'};}};function a250_0x17f7(){const _0x267075=['exec','sql','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','execSuccess','SQL\x20execution\x20failed','string','params','2514323BbTaal','isArray','65746xxgkZr','str','56XaDdLx','Returned\x20','5QQalfU','now','21KOuXVB','length','6849016YsoTjF','\x20row(s)\x20in\x20','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','9234312sIhYKv','read','1365390SDAnzG','20552570yfvnfK','1197549MYCxaD'];a250_0x17f7=function(){return _0x267075;};return a250_0x17f7();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xd77006,_0x3a7cd4){const _0x338e40=a251_0x40ee,_0x5362db=_0xd77006();while(!![]){try{const _0x2bbaaa=-parseInt(_0x338e40(0x15c))/0x1*(-parseInt(_0x338e40(0x160))/0x2)+parseInt(_0x338e40(0x157))/0x3+parseInt(_0x338e40(0x156))/0x4+-parseInt(_0x338e40(0x15b))/0x5*(parseInt(_0x338e40(0x15f))/0x6)+-parseInt(_0x338e40(0x159))/0x7*(parseInt(_0x338e40(0x15d))/0x8)+parseInt(_0x338e40(0x15e))/0x9+-parseInt(_0x338e40(0x158))/0xa*(-parseInt(_0x338e40(0x15a))/0xb);if(_0x2bbaaa===_0x3a7cd4)break;else _0x5362db['push'](_0x5362db['shift']());}catch(_0x4d1ff8){_0x5362db['push'](_0x5362db['shift']());}}}(a251_0x4709,0xcf721));function a251_0x40ee(_0x2013c3,_0x58bc9e){_0x2013c3=_0x2013c3-0x156;const _0x470911=a251_0x4709();let _0x40eec6=_0x470911[_0x2013c3];return _0x40eec6;}import{sqlList}from'../../commands/sql/list.js';function a251_0x4709(){const _0x46e047=['2278397rCvgsP','2531240zmUtcu','1IbgsaF','48yBjAZu','5971734AdjmOL','6jyOuKD','1238650IAcvZx','878024cgBKMs','1980573NPYYou','10OxvePR','1182685xJtOzB'];a251_0x4709=function(){return _0x46e047;};return a251_0x4709();}import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a252_0xc681(_0x296bfc,_0x2c5e8c){_0x296bfc=_0x296bfc-0x18f;const _0x7b66bf=a252_0x7b66();let _0xc68196=_0x7b66bf[_0x296bfc];return _0xc68196;}const a252_0x590de2=a252_0xc681;(function(_0x36d167,_0x64dde5){const _0x43001a=a252_0xc681,_0x3b91c7=_0x36d167();while(!![]){try{const _0x176f9c=-parseInt(_0x43001a(0x1a2))/0x1+-parseInt(_0x43001a(0x1ad))/0x2*(parseInt(_0x43001a(0x196))/0x3)+-parseInt(_0x43001a(0x19a))/0x4*(-parseInt(_0x43001a(0x192))/0x5)+-parseInt(_0x43001a(0x197))/0x6+parseInt(_0x43001a(0x1aa))/0x7*(parseInt(_0x43001a(0x19f))/0x8)+parseInt(_0x43001a(0x1a5))/0x9+-parseInt(_0x43001a(0x1a3))/0xa*(parseInt(_0x43001a(0x1a8))/0xb);if(_0x176f9c===_0x64dde5)break;else _0x3b91c7['push'](_0x3b91c7['shift']());}catch(_0x33b530){_0x3b91c7['push'](_0x3b91c7['shift']());}}}(a252_0x7b66,0xf1c5b));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a252_0x590de2(0x1a6),'command':'list','description':a252_0x590de2(0x198),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a252_0x590de2(0x19c),'type':'string','description':a252_0x590de2(0x1ac)},{'name':a252_0x590de2(0x1af),'type':a252_0x590de2(0x194),'description':'Page\x20number','default':0x1},{'name':a252_0x590de2(0x1a0),'type':a252_0x590de2(0x194),'description':a252_0x590de2(0x1b2)},{'name':'verbose','type':'boolean','description':a252_0x590de2(0x1a7)}],async 'execute'(_0x2d151e){const _0x47aa4d=a252_0x590de2,_0x427322=await listSqlQueries(_0x2d151e[_0x47aa4d(0x1a9)],{'sqlCode':_0x2d151e[_0x47aa4d(0x195)](_0x47aa4d(0x19d))||undefined,'sqlName':_0x2d151e[_0x47aa4d(0x195)](_0x47aa4d(0x19c))||undefined,'currentPage':_0x2d151e[_0x47aa4d(0x1a4)](_0x47aa4d(0x1af)),'pageSize':_0x2d151e[_0x47aa4d(0x1a4)](_0x47aa4d(0x1a0),0x32)}),_0x4ff9c6=_0x2d151e['bool'](_0x47aa4d(0x1ae)),_0x4efbc8=_0x427322[_0x47aa4d(0x18f)]??[],_0x42bca9=_0x427322[_0x47aa4d(0x191)]?.[_0x47aa4d(0x19e)]??_0x4efbc8[_0x47aa4d(0x1b0)];let _0x28bd22;return _0x4ff9c6?_0x28bd22=_0x4efbc8:_0x28bd22=await Promise[_0x47aa4d(0x1b1)](_0x4efbc8[_0x47aa4d(0x193)](async _0xa0fe5a=>{const _0x549c8d=_0x47aa4d;let _0x409f14;try{_0x409f14=_0xa0fe5a[_0x549c8d(0x19b)]?await getDbName(_0x2d151e[_0x549c8d(0x1a9)],_0xa0fe5a[_0x549c8d(0x19b)]):undefined;}catch{}return{'sqlCode':_0xa0fe5a[_0x549c8d(0x199)],'sqlName':_0xa0fe5a[_0x549c8d(0x1a1)],'description':_0xa0fe5a[_0x549c8d(0x190)]??'','db':_0x409f14?_0x409f14+'\x20('+_0xa0fe5a[_0x549c8d(0x19b)]+')':_0xa0fe5a[_0x549c8d(0x19b)]??''};})),{'ok':!![],'data':_0x28bd22,'message':_0x4efbc8['length']===0x0?_0x47aa4d(0x1ab):'Found\x20'+_0x4efbc8[_0x47aa4d(0x1b0)]+'\x20SQL\x20queries\x20(total:\x20'+_0x42bca9+').'};}};function a252_0x7b66(){const _0x2f477f=['243rKlIFL','4208076Xczjcy','List\x20custom\x20SQL\x20queries','sqlCode','6641764zYKHEW','dbId','name','sqlcode','totalCount','16FQmIjk','pagesize','sqlName','222066YnuIjj','7057870JNHTou','num','5351184bFLDfG','sql','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','11ugVAFl','appCode','3671542xyWPXB','No\x20custom\x20SQL\x20queries\x20found.','Filter\x20by\x20SQL\x20name','16902avUSsr','verbose','page','length','all','Page\x20size','tableData','description','paging','5ZUXfUx','map','number','str'];a252_0x7b66=function(){return _0x2f477f;};return a252_0x7b66();}
|
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a246_0x46dcea=a246_0x3a6a;(function(_0x5e1686,_0x1b07de){const _0x56b6f6=a246_0x3a6a,_0x1a2dc7=_0x5e1686();while(!![]){try{const _0x558e8d=parseInt(_0x56b6f6(0xc7))/0x1+-parseInt(_0x56b6f6(0xd5))/0x2+-parseInt(_0x56b6f6(0xb4))/0x3+parseInt(_0x56b6f6(0xf4))/0x4*(parseInt(_0x56b6f6(0xd0))/0x5)+parseInt(_0x56b6f6(0xdc))/0x6*(-parseInt(_0x56b6f6(0xbe))/0x7)+parseInt(_0x56b6f6(0xd4))/0x8*(parseInt(_0x56b6f6(0xf5))/0x9)+parseInt(_0x56b6f6(0xd3))/0xa;if(_0x558e8d===_0x1b07de)break;else _0x1a2dc7['push'](_0x1a2dc7['shift']());}catch(_0x4a720e){_0x1a2dc7['push'](_0x1a2dc7['shift']());}}}(a246_0x4610,0xbc91f));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a246_0x3a6a(_0x48b1a1,_0x40c63a){_0x48b1a1=_0x48b1a1-0xb3;const _0x4610b2=a246_0x4610();let _0x3a6a73=_0x4610b2[_0x48b1a1];return _0x3a6a73;}import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{detectSqlMode}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x1a2fbb,_0x354bb8){const _0x1e40a2=a246_0x3a6a,_0x4a800f=[];let _0x326f54=0x1;while(!![]){const _0x251d69=await listSqlQueries(_0x1a2fbb,{'currentPage':_0x326f54,'pageSize':PAGE_SIZE,'sqlCode':_0x354bb8['sqlCode'],'sqlName':_0x354bb8[_0x1e40a2(0xe4)]}),_0x3d5a4a=_0x251d69[_0x1e40a2(0xc3)]??[];_0x4a800f[_0x1e40a2(0xff)](..._0x3d5a4a);if(_0x3d5a4a[_0x1e40a2(0xed)]===0x0)break;const _0x2f127c=_0x251d69[_0x1e40a2(0xbb)]?.[_0x1e40a2(0xf3)];if(_0x2f127c!=null?_0x4a800f[_0x1e40a2(0xed)]>=_0x2f127c:_0x3d5a4a[_0x1e40a2(0xed)]<PAGE_SIZE)break;_0x326f54++;}return _0x4a800f;}async function ensureSqlContent(_0x285f09){const _0x3a876e=a246_0x3a6a;if(_0x285f09['sqlContent']!=null&&String(_0x285f09[_0x3a876e(0x100)])[_0x3a876e(0xed)]>0x0)return _0x285f09;return getSqlQueryDetail(_0x285f09[_0x3a876e(0xc1)]);}export const sqlPull={'service':a246_0x46dcea(0xcc),'command':a246_0x46dcea(0xe0),'description':a246_0x46dcea(0xef),'risk':a246_0x46dcea(0xfb),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a246_0x46dcea(0x101),'type':a246_0x46dcea(0xd2),'description':a246_0x46dcea(0xec)},{'name':a246_0x46dcea(0xe3),'type':a246_0x46dcea(0xfa),'description':a246_0x46dcea(0xb7)}],async 'dryRun'(_0x4f1da3){const _0x370a60=a246_0x46dcea,_0x38cee7=loadSqlProjectConfig(_0x4f1da3[_0x370a60(0xcd)]),_0x1f599e=await readSqlLockFile(_0x38cee7[_0x370a60(0xce)]),{appLock:_0x1cc48d}=ensureSqlLockScope(_0x1f599e??createEmptySqlLock(),_0x38cee7['appCode'],_0x38cee7['sqlRoot'],_0x370a60(0xe0)),_0x25750b=await fetchAllSqlQueries(_0x4f1da3[_0x370a60(0xcd)],{'sqlCode':_0x4f1da3[_0x370a60(0xc5)]('sqlcode')||undefined,'sqlName':_0x4f1da3[_0x370a60(0xc5)](_0x370a60(0x101))||undefined}),_0x26d65d=[];for(const _0xd2ec70 of _0x25750b){const _0x27ce08=await ensureSqlContent(_0xd2ec70),_0x13b1f9=ensureRemoteSqlContent(_0x27ce08),_0x24cfe9=detectSqlMode(_0x13b1f9),_0x295dd5=_0x27ce08[_0x370a60(0xfd)]?await getDbName(_0x4f1da3[_0x370a60(0xcd)],Number(_0x27ce08[_0x370a60(0xfd)]))[_0x370a60(0xc8)](()=>undefined):undefined,_0x27575e=buildLocalSqlFileContent({'sqlCode':_0x27ce08[_0x370a60(0xc1)],'sqlName':_0x27ce08[_0x370a60(0xe4)],'dbId':_0x27ce08['dbId']},_0x13b1f9,{'dbName':_0x295dd5,'mode':_0x24cfe9,'syncedAt':new Date()[_0x370a60(0xd7)](),'description':_0x27ce08[_0x370a60(0xcb)]}),_0x388c3c=buildSqlLockEntry(_0x27ce08,_0x13b1f9,'',{'dbName':_0x295dd5}),_0x5c6d89=resolveLocalSqlFilePath(_0x38cee7,_0x27ce08[_0x370a60(0xc1)],_0x388c3c);let _0x1609fb=_0x370a60(0xde),_0xd275c1;const _0x2bd716=await findExistingSqlFiles(_0x38cee7,_0x5c6d89,_0x24cfe9,_0x1cc48d['sqls'][_0x27ce08[_0x370a60(0xc1)]]);if(_0x2bd716['length']>0x0){const _0x335438=await compareExistingSqlFiles(_0x2bd716,_0x27575e,_0x24cfe9);if(_0x335438[_0x370a60(0xd9)](({equivalent:_0x5533bc})=>!_0x5533bc))_0x1609fb=_0x370a60(0xc2),_0xd275c1=_0x370a60(0xdb);else _0x335438[_0x370a60(0xed)]===0x1&&_0x335438[0x0]?.['file'][_0x370a60(0xe9)]&&(_0x1609fb='skipped',_0xd275c1=_0x370a60(0xba));}_0x26d65d[_0x370a60(0xff)]({'sqlCode':_0x27ce08[_0x370a60(0xc1)],'sqlName':_0x27ce08[_0x370a60(0xe4)],'filePath':_0x5c6d89,'status':_0x1609fb,'reason':_0xd275c1});}return{'method':_0x370a60(0xf7),'url':_0x370a60(0xf8),'body':{'appCode':_0x4f1da3[_0x370a60(0xcd)],'sqlCode':_0x4f1da3[_0x370a60(0xc5)](_0x370a60(0xe1))||null,'sqlName':_0x4f1da3[_0x370a60(0xc5)](_0x370a60(0x101))||null,'files':_0x26d65d},'description':_0x370a60(0xb5)+_0x26d65d[_0x370a60(0xed)]+_0x370a60(0xbf)+_0x38cee7[_0x370a60(0xbd)]};},async 'execute'(_0x5063bc){const _0x3ab690=a246_0x46dcea,_0x2b8a2a=loadSqlProjectConfig(_0x5063bc[_0x3ab690(0xcd)]),_0x2e8320=await readSqlLockFile(_0x2b8a2a[_0x3ab690(0xce)]),{lockData:_0x367d94,appLock:_0x1e5029}=ensureSqlLockScope(_0x2e8320??createEmptySqlLock(),_0x2b8a2a[_0x3ab690(0xcd)],_0x2b8a2a['sqlRoot'],_0x3ab690(0xe0)),_0x38b6d8=_0x5063bc[_0x3ab690(0xb3)](_0x3ab690(0xe3)),_0x373306=await fetchAllSqlQueries(_0x5063bc[_0x3ab690(0xcd)],{'sqlCode':_0x5063bc[_0x3ab690(0xc5)](_0x3ab690(0xe1))||undefined,'sqlName':_0x5063bc[_0x3ab690(0xc5)](_0x3ab690(0x101))||undefined});if(_0x373306['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x3ab690(0xda)};const _0x55a834=[],_0x265942=[];for(const _0x53b9e2 of _0x373306){try{_0x55a834[_0x3ab690(0xff)](await ensureSqlContent(_0x53b9e2));}catch(_0x2a4ff9){_0x265942[_0x3ab690(0xff)]({'sqlCode':_0x53b9e2[_0x3ab690(0xc1)],'error':_0x2a4ff9 instanceof Error?_0x2a4ff9[_0x3ab690(0xf0)]:String(_0x2a4ff9)});}}if(_0x38b6d8&&!_0x5063bc[_0x3ab690(0xeb)]){let _0x19117a=![];for(const _0x2646e4 of _0x55a834){const _0x403736=detectSqlMode(ensureRemoteSqlContent(_0x2646e4)),_0x2855ae=_0x2646e4[_0x3ab690(0xfd)]?await getDbName(_0x5063bc[_0x3ab690(0xcd)],Number(_0x2646e4[_0x3ab690(0xfd)]))[_0x3ab690(0xc8)](()=>undefined):undefined,_0x4c25c0=buildLocalSqlFileContent({'sqlCode':_0x2646e4[_0x3ab690(0xc1)],'sqlName':_0x2646e4[_0x3ab690(0xe4)],'dbId':_0x2646e4[_0x3ab690(0xfd)]},ensureRemoteSqlContent(_0x2646e4),{'dbName':_0x2855ae,'mode':_0x403736,'syncedAt':new Date()[_0x3ab690(0xd7)](),'description':_0x2646e4['description']}),_0x337f07=resolveLocalSqlFilePath(_0x2b8a2a,_0x2646e4[_0x3ab690(0xc1)],buildSqlLockEntry(_0x2646e4,ensureRemoteSqlContent(_0x2646e4),'',{'dbName':_0x2855ae})),_0x3c3c3a=await findExistingSqlFiles(_0x2b8a2a,_0x337f07,_0x403736,_0x1e5029[_0x3ab690(0xc9)][_0x2646e4[_0x3ab690(0xc1)]]),_0x158a25=await compareExistingSqlFiles(_0x3c3c3a,_0x4c25c0,_0x403736);if(_0x158a25['some'](({equivalent:_0xdc190c})=>!_0xdc190c)){_0x19117a=!![];break;}}if(_0x19117a){const _0x395361=await confirmForceOverwrite(_0x3ab690(0xd8));if(!_0x395361)throw CliErrors[_0x3ab690(0xd6)](_0x3ab690(0xf6));}}const _0x4a39c4=cloneSqlLockData(_0x367d94),_0x171eb7=_0x4a39c4[_0x3ab690(0xb9)][_0x2b8a2a[_0x3ab690(0xcd)]],_0x4de8b8=[],_0x50ee86=[];for(const _0x4944e1 of _0x55a834){const _0x36d64e=_0x171eb7['sqls'][_0x4944e1['sqlCode']],_0x487bc7=ensureRemoteSqlContent(_0x4944e1),_0x598492=detectSqlMode(_0x487bc7),_0x499100=_0x4944e1[_0x3ab690(0xfd)]?await getDbName(_0x5063bc[_0x3ab690(0xcd)],Number(_0x4944e1[_0x3ab690(0xfd)]))[_0x3ab690(0xc8)](()=>undefined):undefined,_0x1375d7=buildLocalSqlFileContent({'sqlCode':_0x4944e1[_0x3ab690(0xc1)],'sqlName':_0x4944e1[_0x3ab690(0xe4)],'dbId':_0x4944e1[_0x3ab690(0xfd)]},_0x487bc7,{'dbName':_0x499100,'mode':_0x598492,'syncedAt':new Date()[_0x3ab690(0xd7)](),'description':_0x4944e1[_0x3ab690(0xcb)]}),_0x2d4af1=buildSqlLockEntry(_0x4944e1,_0x487bc7,computeSqlContentHash(_0x1375d7),{'dbName':_0x499100}),_0x5bd5c6=_0x2d4af1[_0x3ab690(0xd1)],_0x5a8d34=join(_0x2b8a2a[_0x3ab690(0xbd)],_0x5bd5c6);try{const _0x32c2e0=await findExistingSqlFiles(_0x2b8a2a,_0x5a8d34,_0x598492,_0x36d64e),_0x4da76a=await compareExistingSqlFiles(_0x32c2e0,_0x1375d7,_0x598492);if(!_0x38b6d8&&_0x4da76a[_0x3ab690(0xd9)](({equivalent:_0xe72b9f})=>!_0xe72b9f)){_0x50ee86[_0x3ab690(0xff)]({'sqlCode':_0x4944e1[_0x3ab690(0xc1)],'reason':_0x3ab690(0xe7)});continue;}const _0x4872dc=_0x4da76a[_0x3ab690(0xe2)](({file:_0x2712ac})=>_0x2712ac[_0x3ab690(0xe9)]),_0x40c278=_0x4da76a[_0x3ab690(0xe2)](({file:_0x5cf39f})=>!_0x5cf39f[_0x3ab690(0xe9)]);if(_0x4872dc?.[_0x3ab690(0xb6)]&&!_0x40c278){_0x50ee86[_0x3ab690(0xff)]({'sqlCode':_0x4944e1[_0x3ab690(0xc1)],'reason':_0x3ab690(0xba)}),_0x171eb7['sqls'][_0x4944e1[_0x3ab690(0xc1)]]={..._0x2d4af1,'hash':computeSqlContentHash(_0x4872dc[_0x3ab690(0xca)]),'path':_0x5bd5c6};continue;}!_0x4872dc?.['equivalent']&&(await ensureParentDirectory(_0x5a8d34),await writeFile(_0x5a8d34,_0x1375d7,_0x3ab690(0xdd))),_0x40c278&&await rm(_0x40c278['file'][_0x3ab690(0xc0)],{'force':!![]}),_0x171eb7[_0x3ab690(0xc9)][_0x4944e1[_0x3ab690(0xc1)]]={..._0x2d4af1,'hash':_0x4872dc?.[_0x3ab690(0xb6)]?computeSqlContentHash(_0x4872dc['content']):_0x2d4af1['hash'],'path':_0x5bd5c6},_0x4de8b8[_0x3ab690(0xff)]({'sqlCode':_0x4944e1[_0x3ab690(0xc1)],'filePath':_0x5a8d34});}catch(_0x18b51d){_0x265942[_0x3ab690(0xff)]({'sqlCode':_0x4944e1[_0x3ab690(0xc1)],'error':_0x18b51d instanceof Error?_0x18b51d[_0x3ab690(0xf0)]:String(_0x18b51d)});}}return _0x171eb7[_0x3ab690(0xf9)]=new Date()[_0x3ab690(0xd7)](),await writeSqlLockFile(_0x2b8a2a[_0x3ab690(0xce)],_0x4a39c4),{'ok':_0x265942[_0x3ab690(0xed)]===0x0,'data':{'pulled':_0x4de8b8,'skipped':_0x50ee86,'failed':_0x265942},'message':_0x3ab690(0xbc)+_0x4de8b8[_0x3ab690(0xed)]+_0x3ab690(0x102)+_0x50ee86['length']+_0x3ab690(0xdf)+_0x265942[_0x3ab690(0xed)]+_0x3ab690(0xf2)};}};function isEquivalentPulledSqlFile(_0x43cea9,_0x256feb,_0xfed297,_0x300eef){if(_0xfed297!==_0x300eef)return normalizePulledSqlBody(_0x43cea9,_0xfed297)===normalizePulledSqlBody(_0x256feb,_0x300eef);return normalizePullComparableContent(_0x43cea9,_0xfed297)===normalizePullComparableContent(_0x256feb,_0x300eef);}async function findExistingSqlFiles(_0x97ce14,_0xa4cd48,_0x489c95,_0x56e1cc){const _0x46eb67=a246_0x46dcea,_0x4f22a9=[];await fileExists(_0xa4cd48)&&_0x4f22a9['push']({'filePath':_0xa4cd48,'mode':_0x489c95,'isCanonical':!![]});if(!_0x56e1cc?.[_0x46eb67(0xd1)])return _0x4f22a9;const _0x208929=join(_0x97ce14[_0x46eb67(0xbd)],_0x56e1cc[_0x46eb67(0xd1)]);if(_0x208929===_0xa4cd48)return _0x4f22a9;return await fileExists(_0x208929)&&_0x4f22a9[_0x46eb67(0xff)]({'filePath':_0x208929,'mode':_0x56e1cc['mode']??modeFromFilePath(_0x208929),'isCanonical':![]}),_0x4f22a9;}async function compareExistingSqlFiles(_0x412a83,_0x232ead,_0xdc56c7){const _0x5854ea=a246_0x46dcea;return Promise[_0x5854ea(0xea)](_0x412a83[_0x5854ea(0xc6)](async _0x235816=>{const _0x331799=_0x5854ea,_0x56df7d=await readFile(_0x235816[_0x331799(0xc0)],_0x331799(0xdd));return{'file':_0x235816,'content':_0x56df7d,'equivalent':isEquivalentPulledSqlFile(_0x56df7d,_0x232ead,_0x235816[_0x331799(0xc4)],_0xdc56c7)};}));}function modeFromFilePath(_0x3e43ac){const _0x43b13a=a246_0x46dcea;return _0x3e43ac[_0x43b13a(0xf1)]()['endsWith'](_0x43b13a(0xcf))?_0x43b13a(0xe8):'sql';}function normalizePulledSqlBody(_0x71d1bf,_0x1dd7d4){const _0x26951b=a246_0x46dcea;return stripLocalSqlMetadata(_0x71d1bf,_0x1dd7d4)[_0x26951b(0xee)](/\r\n/g,'\x0a')[_0x26951b(0xb8)]();}function normalizePullComparableContent(_0x47b9c7,_0x4bcdca){const _0x5ce3f6=a246_0x46dcea,_0x1e55f1=_0x47b9c7[_0x5ce3f6(0xee)](/\r\n/g,'\x0a')[_0x5ce3f6(0xfe)]('\x0a'),_0x2302ba=_0x1e55f1[_0x5ce3f6(0xe6)](_0x9745cf=>!isSyncedAtMetadataLine(_0x9745cf,_0x4bcdca));return _0x2302ba[_0x5ce3f6(0xe5)]('\x0a');}function isSyncedAtMetadataLine(_0x448720,_0x40bf4e){const _0x304261=a246_0x46dcea;if(_0x40bf4e==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x304261(0xfc)](_0x448720);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x304261(0xfc)](_0x448720);}function a246_0x4610(){const _0x2c9c3f=['catch','sqls','content','description','sql','appCode','lockFilePath','.xml','5MMHgOY','path','string','13245860nDuotU','72VLDBrW','1177836PJCnan','cancelled','toISOString','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','some','No\x20remote\x20SQL\x20queries\x20matched.','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','257274jYmraW','utf8','would_pull','\x20skipped,\x20','pull','sqlcode','find','force','sqlName','join','filter','local\x20differs\x20from\x20remote','mybatisXml','isCanonical','all','nonInteractive','Filter\x20by\x20SQL\x20display\x20name','length','replace','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','message','toLowerCase','\x20failed','totalCount','596384ZmCBot','67653ipgefd','Force\x20pull\x20cancelled.','POST','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','lastSync','boolean','read','test','dbId','split','push','sqlContent','name','\x20written,\x20','bool','430419ejHtzr','Would\x20pull\x20','equivalent','Force\x20overwrite\x20local\x20unsynced\x20changes','trim','apps','unchanged','paging','Pull\x20complete:\x20','sqlRootDir','168bFbFBm','\x20SQL\x20file(s)\x20into\x20','filePath','sqlCode','conflict','tableData','mode','str','map','992535CHnWJO'];a246_0x4610=function(){return _0x2c9c3f;};return a246_0x4610();}
|
|
1
|
+
const a253_0x4a9810=a253_0x5b6e;(function(_0x4a653e,_0xb06ce9){const _0x118bf5=a253_0x5b6e,_0x35ec40=_0x4a653e();while(!![]){try{const _0x274e4e=-parseInt(_0x118bf5(0x1b7))/0x1*(parseInt(_0x118bf5(0x1af))/0x2)+parseInt(_0x118bf5(0x1c2))/0x3+-parseInt(_0x118bf5(0x193))/0x4+-parseInt(_0x118bf5(0x1d3))/0x5+parseInt(_0x118bf5(0x1a3))/0x6+-parseInt(_0x118bf5(0x1be))/0x7*(-parseInt(_0x118bf5(0x1ae))/0x8)+parseInt(_0x118bf5(0x1c4))/0x9*(-parseInt(_0x118bf5(0x1cd))/0xa);if(_0x274e4e===_0xb06ce9)break;else _0x35ec40['push'](_0x35ec40['shift']());}catch(_0x1a2928){_0x35ec40['push'](_0x35ec40['shift']());}}}(a253_0x37a3,0x6496f));import{readFile,rm,writeFile}from'node:fs/promises';function a253_0x37a3(){const _0x1e8d27=['file','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','utf8','2xhHjDl','sqlName','unchanged','length','description','push','dbId','189URYYTQ','local\x20differs\x20from\x20remote','would_pull','name','1946298sOztHp','conflict','9YlbnYk','appCode','sqls','\x20failed','filePath','cancelled','read','path','find','1444150FJaVEv','sql','sqlRoot','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','str','replace','1855395MSUnnZ','toLowerCase','mode','join','.xml','boolean','equivalent','hash','1567972RCxZom','message','trim','POST','content','lockFilePath','No\x20remote\x20SQL\x20queries\x20matched.','paging','toISOString','mybatisXml','sqlCode','\x20SQL\x20file(s)\x20into\x20','skipped','Filter\x20by\x20SQL\x20display\x20name','isCanonical','sqlRootDir','2285664piIvBZ','filter','tableData','catch','sqlcode','pull','sqlContent','string','Pull\x20complete:\x20','Force\x20pull\x20cancelled.','lastSync','236432vwGtLe','508166jkVGbt','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','some','test'];a253_0x37a3=function(){return _0x1e8d27;};return a253_0x37a3();}import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{detectSqlMode}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a253_0x5b6e(_0x23e53b,_0x5b0dc7){_0x23e53b=_0x23e53b-0x193;const _0x37a39d=a253_0x37a3();let _0x5b6ee5=_0x37a39d[_0x23e53b];return _0x5b6ee5;}import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x135855,_0x184b5e){const _0x5820a8=a253_0x5b6e,_0x3b0e91=[];let _0x4d2875=0x1;while(!![]){const _0x2ccf16=await listSqlQueries(_0x135855,{'currentPage':_0x4d2875,'pageSize':PAGE_SIZE,'sqlCode':_0x184b5e[_0x5820a8(0x19d)],'sqlName':_0x184b5e[_0x5820a8(0x1b8)]}),_0x28186e=_0x2ccf16[_0x5820a8(0x1a5)]??[];_0x3b0e91[_0x5820a8(0x1bc)](..._0x28186e);if(_0x28186e['length']===0x0)break;const _0x1437b5=_0x2ccf16[_0x5820a8(0x19a)]?.['totalCount'];if(_0x1437b5!=null?_0x3b0e91[_0x5820a8(0x1ba)]>=_0x1437b5:_0x28186e[_0x5820a8(0x1ba)]<PAGE_SIZE)break;_0x4d2875++;}return _0x3b0e91;}async function ensureSqlContent(_0x299bbc){const _0x4b7cad=a253_0x5b6e;if(_0x299bbc[_0x4b7cad(0x1a9)]!=null&&String(_0x299bbc[_0x4b7cad(0x1a9)])['length']>0x0)return _0x299bbc;return getSqlQueryDetail(_0x299bbc[_0x4b7cad(0x19d)]);}export const sqlPull={'service':a253_0x4a9810(0x1ce),'command':a253_0x4a9810(0x1a8),'description':a253_0x4a9810(0x1b0),'risk':a253_0x4a9810(0x1ca),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a253_0x4a9810(0x1c1),'type':a253_0x4a9810(0x1aa),'description':a253_0x4a9810(0x1a0)},{'name':'force','type':a253_0x4a9810(0x1d8),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x582949){const _0x54aa7d=a253_0x4a9810,_0x11f92e=loadSqlProjectConfig(_0x582949[_0x54aa7d(0x1c5)]),_0x1f8c78=await readSqlLockFile(_0x11f92e[_0x54aa7d(0x198)]),{appLock:_0x1e0c7c}=ensureSqlLockScope(_0x1f8c78??createEmptySqlLock(),_0x11f92e[_0x54aa7d(0x1c5)],_0x11f92e[_0x54aa7d(0x1cf)],'pull'),_0xceb65=await fetchAllSqlQueries(_0x582949[_0x54aa7d(0x1c5)],{'sqlCode':_0x582949['str']('sqlcode')||undefined,'sqlName':_0x582949[_0x54aa7d(0x1d1)](_0x54aa7d(0x1c1))||undefined}),_0xd291ec=[];for(const _0x4cfc15 of _0xceb65){const _0x1afba1=await ensureSqlContent(_0x4cfc15),_0x3e39d2=ensureRemoteSqlContent(_0x1afba1),_0x55e0d8=detectSqlMode(_0x3e39d2),_0x56b063=_0x1afba1[_0x54aa7d(0x1bd)]?await getDbName(_0x582949[_0x54aa7d(0x1c5)],Number(_0x1afba1[_0x54aa7d(0x1bd)]))[_0x54aa7d(0x1a6)](()=>undefined):undefined,_0x2f089e=buildLocalSqlFileContent({'sqlCode':_0x1afba1[_0x54aa7d(0x19d)],'sqlName':_0x1afba1[_0x54aa7d(0x1b8)],'dbId':_0x1afba1[_0x54aa7d(0x1bd)]},_0x3e39d2,{'dbName':_0x56b063,'mode':_0x55e0d8,'syncedAt':new Date()[_0x54aa7d(0x19b)](),'description':_0x1afba1['description']}),_0x3f6cd3=buildSqlLockEntry(_0x1afba1,_0x3e39d2,'',{'dbName':_0x56b063}),_0x55c66c=resolveLocalSqlFilePath(_0x11f92e,_0x1afba1['sqlCode'],_0x3f6cd3);let _0x23f083=_0x54aa7d(0x1c0),_0xa62e61;const _0x480aec=await findExistingSqlFiles(_0x11f92e,_0x55c66c,_0x55e0d8,_0x1e0c7c['sqls'][_0x1afba1['sqlCode']]);if(_0x480aec[_0x54aa7d(0x1ba)]>0x0){const _0x58d6bd=await compareExistingSqlFiles(_0x480aec,_0x2f089e,_0x55e0d8);if(_0x58d6bd['some'](({equivalent:_0x596c52})=>!_0x596c52))_0x23f083=_0x54aa7d(0x1c3),_0xa62e61=_0x54aa7d(0x1d0);else _0x58d6bd['length']===0x1&&_0x58d6bd[0x0]?.['file'][_0x54aa7d(0x1a1)]&&(_0x23f083=_0x54aa7d(0x19f),_0xa62e61='unchanged');}_0xd291ec[_0x54aa7d(0x1bc)]({'sqlCode':_0x1afba1[_0x54aa7d(0x19d)],'sqlName':_0x1afba1[_0x54aa7d(0x1b8)],'filePath':_0x55c66c,'status':_0x23f083,'reason':_0xa62e61});}return{'method':_0x54aa7d(0x196),'url':_0x54aa7d(0x1b4),'body':{'appCode':_0x582949['appCode'],'sqlCode':_0x582949[_0x54aa7d(0x1d1)](_0x54aa7d(0x1a7))||null,'sqlName':_0x582949[_0x54aa7d(0x1d1)](_0x54aa7d(0x1c1))||null,'files':_0xd291ec},'description':'Would\x20pull\x20'+_0xd291ec['length']+_0x54aa7d(0x19e)+_0x11f92e[_0x54aa7d(0x1a2)]};},async 'execute'(_0x4238db){const _0x332a56=a253_0x4a9810,_0x367b66=loadSqlProjectConfig(_0x4238db[_0x332a56(0x1c5)]),_0x41e78a=await readSqlLockFile(_0x367b66[_0x332a56(0x198)]),{lockData:_0x3cec87,appLock:_0x2ef236}=ensureSqlLockScope(_0x41e78a??createEmptySqlLock(),_0x367b66[_0x332a56(0x1c5)],_0x367b66['sqlRoot'],_0x332a56(0x1a8)),_0xf8528f=_0x4238db['bool']('force'),_0x408235=await fetchAllSqlQueries(_0x4238db[_0x332a56(0x1c5)],{'sqlCode':_0x4238db['str'](_0x332a56(0x1a7))||undefined,'sqlName':_0x4238db['str'](_0x332a56(0x1c1))||undefined});if(_0x408235['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x332a56(0x199)};const _0x4beb3f=[],_0x13d7e9=[];for(const _0x34e155 of _0x408235){try{_0x4beb3f['push'](await ensureSqlContent(_0x34e155));}catch(_0x382875){_0x13d7e9['push']({'sqlCode':_0x34e155[_0x332a56(0x19d)],'error':_0x382875 instanceof Error?_0x382875['message']:String(_0x382875)});}}if(_0xf8528f&&!_0x4238db['nonInteractive']){let _0x4c71dd=![];for(const _0x7ed117 of _0x4beb3f){const _0x463435=detectSqlMode(ensureRemoteSqlContent(_0x7ed117)),_0x2a5b52=_0x7ed117[_0x332a56(0x1bd)]?await getDbName(_0x4238db['appCode'],Number(_0x7ed117[_0x332a56(0x1bd)]))[_0x332a56(0x1a6)](()=>undefined):undefined,_0x471f65=buildLocalSqlFileContent({'sqlCode':_0x7ed117[_0x332a56(0x19d)],'sqlName':_0x7ed117[_0x332a56(0x1b8)],'dbId':_0x7ed117[_0x332a56(0x1bd)]},ensureRemoteSqlContent(_0x7ed117),{'dbName':_0x2a5b52,'mode':_0x463435,'syncedAt':new Date()['toISOString'](),'description':_0x7ed117['description']}),_0x50f79e=resolveLocalSqlFilePath(_0x367b66,_0x7ed117[_0x332a56(0x19d)],buildSqlLockEntry(_0x7ed117,ensureRemoteSqlContent(_0x7ed117),'',{'dbName':_0x2a5b52})),_0x55337c=await findExistingSqlFiles(_0x367b66,_0x50f79e,_0x463435,_0x2ef236['sqls'][_0x7ed117[_0x332a56(0x19d)]]),_0x244c25=await compareExistingSqlFiles(_0x55337c,_0x471f65,_0x463435);if(_0x244c25[_0x332a56(0x1b1)](({equivalent:_0x53d7a2})=>!_0x53d7a2)){_0x4c71dd=!![];break;}}if(_0x4c71dd){const _0x38cf91=await confirmForceOverwrite(_0x332a56(0x1b5));if(!_0x38cf91)throw CliErrors[_0x332a56(0x1c9)](_0x332a56(0x1ac));}}const _0x2dd17f=cloneSqlLockData(_0x3cec87),_0x442b43=_0x2dd17f['apps'][_0x367b66[_0x332a56(0x1c5)]],_0x5bfde5=[],_0x39509c=[];for(const _0x274b8f of _0x4beb3f){const _0x5cb8e1=_0x442b43[_0x332a56(0x1c6)][_0x274b8f[_0x332a56(0x19d)]],_0x3e5a7c=ensureRemoteSqlContent(_0x274b8f),_0x4bba59=detectSqlMode(_0x3e5a7c),_0x46bb94=_0x274b8f['dbId']?await getDbName(_0x4238db['appCode'],Number(_0x274b8f[_0x332a56(0x1bd)]))[_0x332a56(0x1a6)](()=>undefined):undefined,_0x3f12af=buildLocalSqlFileContent({'sqlCode':_0x274b8f[_0x332a56(0x19d)],'sqlName':_0x274b8f[_0x332a56(0x1b8)],'dbId':_0x274b8f['dbId']},_0x3e5a7c,{'dbName':_0x46bb94,'mode':_0x4bba59,'syncedAt':new Date()[_0x332a56(0x19b)](),'description':_0x274b8f[_0x332a56(0x1bb)]}),_0x208978=buildSqlLockEntry(_0x274b8f,_0x3e5a7c,computeSqlContentHash(_0x3f12af),{'dbName':_0x46bb94}),_0x4f43dc=_0x208978[_0x332a56(0x1cb)],_0x2f8cc6=join(_0x367b66[_0x332a56(0x1a2)],_0x4f43dc);try{const _0x5c4436=await findExistingSqlFiles(_0x367b66,_0x2f8cc6,_0x4bba59,_0x5cb8e1),_0x4b6c60=await compareExistingSqlFiles(_0x5c4436,_0x3f12af,_0x4bba59);if(!_0xf8528f&&_0x4b6c60[_0x332a56(0x1b1)](({equivalent:_0x2b10ad})=>!_0x2b10ad)){_0x39509c[_0x332a56(0x1bc)]({'sqlCode':_0x274b8f[_0x332a56(0x19d)],'reason':_0x332a56(0x1bf)});continue;}const _0xfaa030=_0x4b6c60[_0x332a56(0x1cc)](({file:_0x513f87})=>_0x513f87[_0x332a56(0x1a1)]),_0x137005=_0x4b6c60[_0x332a56(0x1cc)](({file:_0x3ba545})=>!_0x3ba545['isCanonical']);if(_0xfaa030?.[_0x332a56(0x1d9)]&&!_0x137005){_0x39509c[_0x332a56(0x1bc)]({'sqlCode':_0x274b8f[_0x332a56(0x19d)],'reason':_0x332a56(0x1b9)}),_0x442b43[_0x332a56(0x1c6)][_0x274b8f['sqlCode']]={..._0x208978,'hash':computeSqlContentHash(_0xfaa030['content']),'path':_0x4f43dc};continue;}!_0xfaa030?.['equivalent']&&(await ensureParentDirectory(_0x2f8cc6),await writeFile(_0x2f8cc6,_0x3f12af,_0x332a56(0x1b6))),_0x137005&&await rm(_0x137005[_0x332a56(0x1b3)][_0x332a56(0x1c8)],{'force':!![]}),_0x442b43['sqls'][_0x274b8f['sqlCode']]={..._0x208978,'hash':_0xfaa030?.[_0x332a56(0x1d9)]?computeSqlContentHash(_0xfaa030[_0x332a56(0x197)]):_0x208978[_0x332a56(0x1da)],'path':_0x4f43dc},_0x5bfde5[_0x332a56(0x1bc)]({'sqlCode':_0x274b8f[_0x332a56(0x19d)],'filePath':_0x2f8cc6});}catch(_0x3e00b6){_0x13d7e9[_0x332a56(0x1bc)]({'sqlCode':_0x274b8f[_0x332a56(0x19d)],'error':_0x3e00b6 instanceof Error?_0x3e00b6[_0x332a56(0x194)]:String(_0x3e00b6)});}}return _0x442b43[_0x332a56(0x1ad)]=new Date()[_0x332a56(0x19b)](),await writeSqlLockFile(_0x367b66[_0x332a56(0x198)],_0x2dd17f),{'ok':_0x13d7e9[_0x332a56(0x1ba)]===0x0,'data':{'pulled':_0x5bfde5,'skipped':_0x39509c,'failed':_0x13d7e9},'message':_0x332a56(0x1ab)+_0x5bfde5[_0x332a56(0x1ba)]+'\x20written,\x20'+_0x39509c[_0x332a56(0x1ba)]+'\x20skipped,\x20'+_0x13d7e9[_0x332a56(0x1ba)]+_0x332a56(0x1c7)};}};function isEquivalentPulledSqlFile(_0x5bb416,_0x3cfff7,_0x5daa4d,_0x1873d6){if(_0x5daa4d!==_0x1873d6)return normalizePulledSqlBody(_0x5bb416,_0x5daa4d)===normalizePulledSqlBody(_0x3cfff7,_0x1873d6);return normalizePullComparableContent(_0x5bb416,_0x5daa4d)===normalizePullComparableContent(_0x3cfff7,_0x1873d6);}async function findExistingSqlFiles(_0x4e102f,_0x1d9bc1,_0x35bacc,_0x423cfc){const _0x181706=a253_0x4a9810,_0x44981b=[];await fileExists(_0x1d9bc1)&&_0x44981b[_0x181706(0x1bc)]({'filePath':_0x1d9bc1,'mode':_0x35bacc,'isCanonical':!![]});if(!_0x423cfc?.[_0x181706(0x1cb)])return _0x44981b;const _0x437f0f=join(_0x4e102f[_0x181706(0x1a2)],_0x423cfc[_0x181706(0x1cb)]);if(_0x437f0f===_0x1d9bc1)return _0x44981b;return await fileExists(_0x437f0f)&&_0x44981b[_0x181706(0x1bc)]({'filePath':_0x437f0f,'mode':_0x423cfc['mode']??modeFromFilePath(_0x437f0f),'isCanonical':![]}),_0x44981b;}async function compareExistingSqlFiles(_0x1b00d9,_0x25c19d,_0x3d4e6a){return Promise['all'](_0x1b00d9['map'](async _0x271fff=>{const _0x2da366=a253_0x5b6e,_0x3d101a=await readFile(_0x271fff[_0x2da366(0x1c8)],_0x2da366(0x1b6));return{'file':_0x271fff,'content':_0x3d101a,'equivalent':isEquivalentPulledSqlFile(_0x3d101a,_0x25c19d,_0x271fff[_0x2da366(0x1d5)],_0x3d4e6a)};}));}function modeFromFilePath(_0x5f27c7){const _0x536711=a253_0x4a9810;return _0x5f27c7[_0x536711(0x1d4)]()['endsWith'](_0x536711(0x1d7))?_0x536711(0x19c):_0x536711(0x1ce);}function normalizePulledSqlBody(_0x32c8d6,_0x55557f){const _0x1feec6=a253_0x4a9810;return stripLocalSqlMetadata(_0x32c8d6,_0x55557f)['replace'](/\r\n/g,'\x0a')[_0x1feec6(0x195)]();}function normalizePullComparableContent(_0x31ab57,_0xd375cc){const _0x3b65ad=a253_0x4a9810,_0x4ec8fd=_0x31ab57[_0x3b65ad(0x1d2)](/\r\n/g,'\x0a')['split']('\x0a'),_0x58f827=_0x4ec8fd[_0x3b65ad(0x1a4)](_0x1c2437=>!isSyncedAtMetadataLine(_0x1c2437,_0xd375cc));return _0x58f827[_0x3b65ad(0x1d6)]('\x0a');}function isSyncedAtMetadataLine(_0x19e0a7,_0x4d88b6){const _0x15e26f=a253_0x4a9810;if(_0x4d88b6==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x15e26f(0x1b2)](_0x19e0a7);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x15e26f(0x1b2)](_0x19e0a7);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a247_0x3e21a1=a247_0x3fd7;(function(_0x347df9,_0x4165f9){const _0x206468=a247_0x3fd7,_0x4ac99d=_0x347df9();while(!![]){try{const _0x331369=parseInt(_0x206468(0x20c))/0x1+parseInt(_0x206468(0x1eb))/0x2*(parseInt(_0x206468(0x1e2))/0x3)+parseInt(_0x206468(0x1d8))/0x4*(-parseInt(_0x206468(0x1e8))/0x5)+parseInt(_0x206468(0x1f4))/0x6*(parseInt(_0x206468(0x1fa))/0x7)+parseInt(_0x206468(0x1ea))/0x8*(parseInt(_0x206468(0x1d0))/0x9)+parseInt(_0x206468(0x203))/0xa*(parseInt(_0x206468(0x1ca))/0xb)+-parseInt(_0x206468(0x20d))/0xc*(parseInt(_0x206468(0x1e7))/0xd);if(_0x331369===_0x4165f9)break;else _0x4ac99d['push'](_0x4ac99d['shift']());}catch(_0xaf4425){_0x4ac99d['push'](_0x4ac99d['shift']());}}}(a247_0x4436,0x63311));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';function a247_0x4436(){const _0x174aa9=['write','appCode','1533904boZoMZ','remoteId','sqlRoot','filter','dbName','\x20skipped,\x20','push','version','get','projectRoot','15WzgmUq','sql','relativePath','trim','force','316381YwDixR','5aIedgn','\x22\x20for\x20sqlCode\x20','5864pBigzp','62998RiLvGm','sqlName','startsWith','bool','sqlCode','str','dbId','\x20pushed,\x20','No\x20local\x20SQL\x20files\x20found.','339468jIfCAB','sqlRootDir','Local\x20directory\x20\x22','validation','\x20SQL\x20file(s)','lastSync','63qqULEv','utf8','\x20failed','replace','boolean','hash','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','Push\x20complete:\x20','mode','150oTVDDa',':\x20SQL\x20content\x20is\x20empty.','Would\x20push\x20','sqls','unchanged','toISOString','sqlcode','length','Push\x20local\x20SQL\x20files\x20to\x20remote','330811TILBzl','372ldQlmK','catch','1529pSiUcb','map','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','/smartapi/custom/updateUserCustomSql','lockFilePath','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','6687eAdmJu',':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','Local\x20SQL\x20not\x20found:\x20','path','message','filePath'];a247_0x4436=function(){return _0x174aa9;};return a247_0x4436();}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';function a247_0x3fd7(_0x1a564f,_0x2beaa1){_0x1a564f=_0x1a564f-0x1ca;const _0x4436a8=a247_0x4436();let _0x3fd7d4=_0x4436a8[_0x1a564f];return _0x3fd7d4;}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function readSqlUploadContent(_0x2dfa66){const _0x2fe421=a247_0x3fd7,_0x193472=stripLocalSqlMetadata(await readFile(_0x2dfa66[_0x2fe421(0x1d5)],_0x2fe421(0x1fb)),_0x2dfa66[_0x2fe421(0x202)]);if(!_0x193472[_0x2fe421(0x1e5)]())throw CliErrors[_0x2fe421(0x1f7)](_0x2dfa66[_0x2fe421(0x1ef)]+_0x2fe421(0x204));return _0x193472;}async function getTargetSqlQueries(_0x24eb76,_0x1434da,_0x164ce2){const _0x4fa9b0=a247_0x3fd7,_0x205a8e=await scanLocalSqlQueries(_0x24eb76),_0x3a2a6a=new Map();for(const _0x391222 of _0x205a8e){if(_0x164ce2&&_0x391222[_0x4fa9b0(0x1ef)]!==_0x164ce2)continue;const _0x376e92=_0x3a2a6a[_0x4fa9b0(0x1e0)](_0x391222['sqlCode'])??[];_0x376e92[_0x4fa9b0(0x1de)](_0x391222),_0x3a2a6a['set'](_0x391222[_0x4fa9b0(0x1ef)],_0x376e92);}if(_0x164ce2&&!_0x3a2a6a['has'](_0x164ce2))throw CliErrors[_0x4fa9b0(0x1f7)](_0x4fa9b0(0x1d2)+_0x164ce2);const _0x43d7c2=[];for(const [_0xb4989,_0x14c43f]of _0x3a2a6a['entries']()){if(_0x14c43f[_0x4fa9b0(0x20a)]===0x1){_0x43d7c2[_0x4fa9b0(0x1de)](_0x14c43f[0x0]);continue;}const _0x4fec58=_0x1434da[_0x4fa9b0(0x206)][_0xb4989],_0x42d67e=_0x4fec58?.[_0x4fa9b0(0x1d3)],_0x4d1833=_0x42d67e?_0x14c43f[_0x4fa9b0(0x1db)](_0x5b1507=>_0x5b1507[_0x4fa9b0(0x1e4)]!==_0x42d67e):_0x14c43f;if(_0x4fec58&&_0x4d1833['length']===0x1){_0x43d7c2[_0x4fa9b0(0x1de)](_0x4d1833[0x0]);continue;}throw CliErrors[_0x4fa9b0(0x1f7)](_0x4fa9b0(0x1cf)+_0xb4989+_0x4fa9b0(0x1cc));}return _0x43d7c2;}export const sqlPush={'service':a247_0x3e21a1(0x1e3),'command':a247_0x3e21a1(0x1de),'description':a247_0x3e21a1(0x20b),'risk':a247_0x3e21a1(0x1d6),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a247_0x3e21a1(0x1e6),'type':a247_0x3e21a1(0x1fe),'description':a247_0x3e21a1(0x200)}],async 'dryRun'(_0x1b1cf1){const _0x1c65d1=a247_0x3e21a1,_0x360301=loadSqlProjectConfig(_0x1b1cf1[_0x1c65d1(0x1d7)]),_0x4218c7=await readSqlLockFile(_0x360301['lockFilePath']),{appLock:_0x217329}=ensureSqlLockScope(_0x4218c7??createEmptySqlLock(),_0x1b1cf1[_0x1c65d1(0x1d7)],_0x360301[_0x1c65d1(0x1da)],_0x1c65d1(0x1de)),_0x57404c=await getTargetSqlQueries(_0x360301,_0x217329,_0x1b1cf1[_0x1c65d1(0x1f0)](_0x1c65d1(0x209))||undefined),_0x2d308c=[];for(const _0x5f4f3f of _0x57404c){const _0x50ad16=await computeSqlFileHash(_0x5f4f3f[_0x1c65d1(0x1d5)]),_0x5a9782=_0x217329[_0x1c65d1(0x206)][_0x5f4f3f[_0x1c65d1(0x1ef)]],_0x58ac30=!!_0x5a9782&&(_0x5a9782[_0x1c65d1(0x1d3)]!==_0x5f4f3f[_0x1c65d1(0x1e4)]||!!_0x5f4f3f['sqlName']&&_0x5a9782[_0x1c65d1(0x1ec)]!==_0x5f4f3f[_0x1c65d1(0x1ec)]||_0x5a9782[_0x1c65d1(0x202)]!==_0x5f4f3f[_0x1c65d1(0x202)]);if(!_0x1b1cf1[_0x1c65d1(0x1ee)](_0x1c65d1(0x1e6))&&_0x5a9782&&_0x5a9782['hash']===_0x50ad16&&!_0x58ac30)continue;if(!_0x5a9782)throw CliErrors[_0x1c65d1(0x1f7)](_0x5f4f3f[_0x1c65d1(0x1ef)]+_0x1c65d1(0x1d1));if(_0x5a9782['version']==null)throw CliErrors[_0x1c65d1(0x1f7)](_0x5f4f3f[_0x1c65d1(0x1ef)]+':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.');await resolveTargetDbBinding(_0x1b1cf1[_0x1c65d1(0x1d7)],_0x5f4f3f,_0x5a9782),await readSqlUploadContent(_0x5f4f3f),_0x2d308c[_0x1c65d1(0x1de)](_0x5f4f3f[_0x1c65d1(0x1ef)]);}return{'method':'POST','url':_0x1c65d1(0x1cd),'body':{'sqlCodes':_0x2d308c,'appCode':_0x1b1cf1[_0x1c65d1(0x1d7)]},'description':_0x1c65d1(0x205)+_0x2d308c['length']+_0x1c65d1(0x1f8)};},async 'execute'(_0x385b1d){const _0x197f8a=a247_0x3e21a1,_0x498c1e=loadSqlProjectConfig(_0x385b1d[_0x197f8a(0x1d7)]),_0x20dae3=await readSqlLockFile(_0x498c1e[_0x197f8a(0x1ce)]),{lockData:_0x567cb9,appLock:_0x2f32c3}=ensureSqlLockScope(_0x20dae3??createEmptySqlLock(),_0x385b1d['appCode'],_0x498c1e[_0x197f8a(0x1da)],_0x197f8a(0x1de)),_0x4b6c88=await getTargetSqlQueries(_0x498c1e,_0x2f32c3,_0x385b1d['str'](_0x197f8a(0x209))||undefined);if(_0x4b6c88[_0x197f8a(0x20a)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x197f8a(0x1f3)};const _0x28278c=[],_0xb88f33=[],_0x51faa6=[];let _0x320614=![];for(const _0x476234 of _0x4b6c88){const _0x45fc03=_0x2f32c3[_0x197f8a(0x206)][_0x476234['sqlCode']];if(!_0x45fc03){_0x51faa6[_0x197f8a(0x1de)]({'sqlCode':_0x476234[_0x197f8a(0x1ef)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x22f7e9=await computeSqlFileHash(_0x476234[_0x197f8a(0x1d5)]),_0x5a5619=_0x45fc03[_0x197f8a(0x1d3)]!==_0x476234[_0x197f8a(0x1e4)]||!!_0x476234[_0x197f8a(0x1ec)]&&_0x45fc03[_0x197f8a(0x1ec)]!==_0x476234['sqlName']||_0x45fc03[_0x197f8a(0x202)]!==_0x476234[_0x197f8a(0x202)];if(!_0x385b1d[_0x197f8a(0x1ee)](_0x197f8a(0x1e6))&&_0x45fc03[_0x197f8a(0x1ff)]===_0x22f7e9&&!_0x5a5619){_0xb88f33['push']({'sqlCode':_0x476234[_0x197f8a(0x1ef)],'reason':_0x197f8a(0x207)});continue;}if(_0x45fc03[_0x197f8a(0x1df)]==null){_0x51faa6['push']({'sqlCode':_0x476234[_0x197f8a(0x1ef)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x147618=_0x476234[_0x197f8a(0x1ec)]||_0x45fc03['sqlName'],_0x2b08af=await resolveTargetDbBinding(_0x385b1d['appCode'],_0x476234,_0x45fc03),_0x1de568=await readSqlUploadContent(_0x476234),_0x19e551=await updateSqlQuery({'id':_0x45fc03[_0x197f8a(0x1d9)],'appCode':_0x385b1d[_0x197f8a(0x1d7)],'sqlCode':_0x476234['sqlCode'],'sqlName':_0x147618,'dbId':_0x2b08af[_0x197f8a(0x1f1)],'version':_0x45fc03['version'],'sqlContent':_0x1de568,'sqlConfig':_0x45fc03['sqlConfig']??undefined}),_0xf95e35=_0x19e551['dbId']?await getDbName(_0x385b1d[_0x197f8a(0x1d7)],Number(_0x19e551['dbId']))['catch'](()=>_0x2b08af[_0x197f8a(0x1dc)]):_0x2b08af[_0x197f8a(0x1dc)];_0x2f32c3['sqls'][_0x476234[_0x197f8a(0x1ef)]]={...buildSqlLockEntry(_0x19e551,_0x1de568,_0x22f7e9,{'dbName':_0xf95e35}),'path':_0x476234[_0x197f8a(0x1e4)],'mode':_0x476234['mode']},_0x320614=!![],await archivePreviousSqlFileIfNeeded(_0x498c1e,_0x45fc03[_0x197f8a(0x1d3)],_0x476234['relativePath']),_0x28278c[_0x197f8a(0x1de)]({'sqlCode':_0x476234[_0x197f8a(0x1ef)],'remoteId':_0x45fc03[_0x197f8a(0x1d9)]});}catch(_0x5a64b9){_0x51faa6[_0x197f8a(0x1de)]({'sqlCode':_0x476234[_0x197f8a(0x1ef)],'error':_0x5a64b9 instanceof Error?_0x5a64b9[_0x197f8a(0x1d4)]:String(_0x5a64b9)});}}(_0x320614||_0x51faa6[_0x197f8a(0x20a)]===0x0)&&(_0x2f32c3[_0x197f8a(0x1f9)]=new Date()[_0x197f8a(0x208)](),await writeSqlLockFile(_0x498c1e[_0x197f8a(0x1ce)],_0x567cb9));const _0x56411c=_0x51faa6[_0x197f8a(0x20a)]===0x0;return{'ok':_0x56411c,'data':{'pushed':_0x28278c,'skipped':_0xb88f33,'failed':_0x51faa6},'message':_0x197f8a(0x201)+_0x28278c[_0x197f8a(0x20a)]+_0x197f8a(0x1f2)+_0xb88f33[_0x197f8a(0x20a)]+_0x197f8a(0x1dd)+_0x51faa6['length']+_0x197f8a(0x1fc)};}};async function archivePreviousSqlFileIfNeeded(_0x3f3303,_0x19bf07,_0xb111dd){const _0x9cc997=a247_0x3e21a1;if(!_0x19bf07||_0x19bf07===_0xb111dd)return;const _0x510569=join(_0x3f3303[_0x9cc997(0x1f5)],_0x19bf07);if(!await fileExists(_0x510569))return;const _0x109742=await moveToTrash(_0x3f3303[_0x9cc997(0x1e1)],_0x3f3303['trashDir'],_0x510569);await cleanupEmptyDirectories(dirname(_0x510569),_0x3f3303[_0x9cc997(0x1f5)]),void _0x109742;}async function moveToTrash(_0x29343f,_0x57a1eb,_0x553275){const _0x52c802=a247_0x3e21a1,_0x3bfe1a=new Date()[_0x52c802(0x208)]()[_0x52c802(0x1fd)](/[:.]/g,'-'),_0xf74a59=relative(_0x29343f,_0x553275),_0x491b3b=join(_0x57a1eb,_0x3bfe1a,_0xf74a59);return await mkdir(dirname(_0x491b3b),{'recursive':!![]}),await rename(_0x553275,_0x491b3b),_0x491b3b;}async function cleanupEmptyDirectories(_0x3af366,_0x5e4dd0){const _0x273fcb=a247_0x3e21a1;let _0x304da8=resolve(_0x3af366);const _0x24d2bf=resolve(_0x5e4dd0);while(_0x304da8[_0x273fcb(0x1ed)](''+_0x24d2bf+sep)||_0x304da8===_0x24d2bf){if(_0x304da8===_0x24d2bf)return;try{const _0x3e0e3f=await readdir(_0x304da8);if(_0x3e0e3f[_0x273fcb(0x20a)]>0x0)return;await rmdir(_0x304da8);}catch{return;}_0x304da8=dirname(_0x304da8);}}async function resolveTargetDbBinding(_0xc88c05,_0x405e74,_0x11c3d1){const _0x3a84ac=a247_0x3e21a1,_0x51453a=_0x405e74['dbDirectory'];if(!_0x51453a)return{'dbId':_0x11c3d1[_0x3a84ac(0x1f1)],'dbName':_0x11c3d1['dbName']};const _0x4ff406=buildDbDirectoryName(_0x11c3d1['dbName'],_0x11c3d1[_0x3a84ac(0x1f1)]);if(_0x51453a===_0x4ff406)return{'dbId':_0x11c3d1[_0x3a84ac(0x1f1)],'dbName':_0x11c3d1[_0x3a84ac(0x1dc)]};const _0x3949ba=parseExplicitDbDirectory(_0x51453a);if(_0x3949ba!=null)return{'dbId':_0x3949ba,'dbName':await getDbName(_0xc88c05,_0x3949ba)[_0x3a84ac(0x20e)](()=>undefined)};const _0x2ec529=await listDatabases(_0xc88c05),_0x5e750c=_0x2ec529['filter'](_0x5d4450=>buildDbDirectoryName(_0x5d4450[_0x3a84ac(0x1dc)],_0x5d4450[_0x3a84ac(0x1f1)])===_0x51453a);if(_0x5e750c[_0x3a84ac(0x20a)]===0x1)return{'dbId':_0x5e750c[0x0][_0x3a84ac(0x1f1)],'dbName':_0x5e750c[0x0][_0x3a84ac(0x1dc)]};if(_0x5e750c[_0x3a84ac(0x20a)]===0x0)throw CliErrors['validation']('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x51453a+_0x3a84ac(0x1e9)+_0x405e74[_0x3a84ac(0x1ef)]+'.');const _0x11c076=_0x5e750c[_0x3a84ac(0x1cb)](_0x4f3d59=>_0x4f3d59[_0x3a84ac(0x1dc)]+'\x20('+_0x4f3d59[_0x3a84ac(0x1f1)]+')')['join'](',\x20');throw CliErrors['validation'](_0x3a84ac(0x1f6)+_0x51453a+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x405e74[_0x3a84ac(0x1ef)]+':\x20'+_0x11c076);}function parseExplicitDbDirectory(_0x1c195e){const _0x553a61=/^db-(\d+)$/['exec'](_0x1c195e);if(!_0x553a61)return null;const _0x22a764=Number(_0x553a61[0x1]);return Number['isFinite'](_0x22a764)&&_0x22a764>0x0?_0x22a764:null;}
|
|
1
|
+
const a254_0x3b7f8e=a254_0x125c;(function(_0x433bd9,_0x1fb3a5){const _0x2bcc0d=a254_0x125c,_0x36cafa=_0x433bd9();while(!![]){try{const _0x113554=parseInt(_0x2bcc0d(0xc2))/0x1*(-parseInt(_0x2bcc0d(0x91))/0x2)+parseInt(_0x2bcc0d(0x97))/0x3+-parseInt(_0x2bcc0d(0xa7))/0x4+-parseInt(_0x2bcc0d(0xc1))/0x5+-parseInt(_0x2bcc0d(0xa2))/0x6+-parseInt(_0x2bcc0d(0xb6))/0x7+parseInt(_0x2bcc0d(0x96))/0x8;if(_0x113554===_0x1fb3a5)break;else _0x36cafa['push'](_0x36cafa['shift']());}catch(_0x5dd1c2){_0x36cafa['push'](_0x36cafa['shift']());}}}(a254_0x58b2,0x36e1b));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a254_0x125c(_0x5741cc,_0x4570c0){_0x5741cc=_0x5741cc-0x83;const _0x58b201=a254_0x58b2();let _0x125c77=_0x58b201[_0x5741cc];return _0x125c77;}import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a254_0x58b2(){const _0x56c302=['\x20pushed,\x20','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','dbName','hash','Local\x20SQL\x20not\x20found:\x20','toISOString','trim','filter','Push\x20local\x20SQL\x20files\x20to\x20remote','sqls','bool','sqlRoot','6bXXPSz',':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','has','length','validation','6060656SZJOWO','1182798sPpGDR','sqlConfig','appCode','sqlCode','remoteId','force','version','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','\x20failed','lockFilePath','sqlRootDir','1885878ilkDem','mode','startsWith','projectRoot','write','1587744JmMCDm','No\x20database\x20matches\x20local\x20directory\x20\x22','lastSync','Would\x20push\x20','relativePath','unchanged','boolean','set',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','get','sqlName','\x20SQL\x20file(s)','message','dbId','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','855596udwUxz','isFinite','replace','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first',':\x20SQL\x20content\x20is\x20empty.','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','No\x20local\x20SQL\x20files\x20found.','path','catch','str','sql','279495EaucgJ','12559iOmpjT','push','entries','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','filePath'];a254_0x58b2=function(){return _0x56c302;};return a254_0x58b2();}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 readSqlUploadContent(_0x422f87){const _0x204f97=a254_0x125c,_0x1df030=stripLocalSqlMetadata(await readFile(_0x422f87[_0x204f97(0x84)],'utf8'),_0x422f87[_0x204f97(0xa3)]);if(!_0x1df030[_0x204f97(0x8b)]())throw CliErrors[_0x204f97(0x95)](_0x422f87['sqlCode']+_0x204f97(0xba));return _0x1df030;}async function getTargetSqlQueries(_0x5ca594,_0x2c3085,_0x1554de){const _0x189f0e=a254_0x125c,_0x4068c1=await scanLocalSqlQueries(_0x5ca594),_0x2a589e=new Map();for(const _0x4decbe of _0x4068c1){if(_0x1554de&&_0x4decbe[_0x189f0e(0x9a)]!==_0x1554de)continue;const _0x258f0c=_0x2a589e[_0x189f0e(0xb0)](_0x4decbe['sqlCode'])??[];_0x258f0c[_0x189f0e(0xc3)](_0x4decbe),_0x2a589e[_0x189f0e(0xae)](_0x4decbe[_0x189f0e(0x9a)],_0x258f0c);}if(_0x1554de&&!_0x2a589e[_0x189f0e(0x93)](_0x1554de))throw CliErrors['validation'](_0x189f0e(0x89)+_0x1554de);const _0x58ad44=[];for(const [_0x28955f,_0x2340fc]of _0x2a589e[_0x189f0e(0xc4)]()){if(_0x2340fc[_0x189f0e(0x94)]===0x1){_0x58ad44[_0x189f0e(0xc3)](_0x2340fc[0x0]);continue;}const _0x4b66a6=_0x2c3085[_0x189f0e(0x8e)][_0x28955f],_0x3b6f0d=_0x4b66a6?.[_0x189f0e(0xbd)],_0xc501ed=_0x3b6f0d?_0x2340fc[_0x189f0e(0x8c)](_0x27e244=>_0x27e244['relativePath']!==_0x3b6f0d):_0x2340fc;if(_0x4b66a6&&_0xc501ed[_0x189f0e(0x94)]===0x1){_0x58ad44[_0x189f0e(0xc3)](_0xc501ed[0x0]);continue;}throw CliErrors[_0x189f0e(0x95)](_0x189f0e(0x83)+_0x28955f+_0x189f0e(0x86));}return _0x58ad44;}export const sqlPush={'service':a254_0x3b7f8e(0xc0),'command':'push','description':a254_0x3b7f8e(0x8d),'risk':a254_0x3b7f8e(0xa6),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a254_0x3b7f8e(0xad),'description':a254_0x3b7f8e(0xbb)}],async 'dryRun'(_0x111b19){const _0x3daa2d=a254_0x3b7f8e,_0xd2717b=loadSqlProjectConfig(_0x111b19[_0x3daa2d(0x99)]),_0x91d3d8=await readSqlLockFile(_0xd2717b[_0x3daa2d(0xa0)]),{appLock:_0x52aac0}=ensureSqlLockScope(_0x91d3d8??createEmptySqlLock(),_0x111b19['appCode'],_0xd2717b[_0x3daa2d(0x90)],_0x3daa2d(0xc3)),_0x4c0f95=await getTargetSqlQueries(_0xd2717b,_0x52aac0,_0x111b19[_0x3daa2d(0xbf)]('sqlcode')||undefined),_0x363625=[];for(const _0x1ade64 of _0x4c0f95){const _0x3a255e=await computeSqlFileHash(_0x1ade64[_0x3daa2d(0x84)]),_0x4a732b=_0x52aac0[_0x3daa2d(0x8e)][_0x1ade64[_0x3daa2d(0x9a)]],_0x14f69e=!!_0x4a732b&&(_0x4a732b[_0x3daa2d(0xbd)]!==_0x1ade64[_0x3daa2d(0xab)]||!!_0x1ade64[_0x3daa2d(0xb1)]&&_0x4a732b['sqlName']!==_0x1ade64['sqlName']||_0x4a732b[_0x3daa2d(0xa3)]!==_0x1ade64[_0x3daa2d(0xa3)]);if(!_0x111b19[_0x3daa2d(0x8f)](_0x3daa2d(0x9c))&&_0x4a732b&&_0x4a732b[_0x3daa2d(0x88)]===_0x3a255e&&!_0x14f69e)continue;if(!_0x4a732b)throw CliErrors[_0x3daa2d(0x95)](_0x1ade64[_0x3daa2d(0x9a)]+_0x3daa2d(0x92));if(_0x4a732b[_0x3daa2d(0x9d)]==null)throw CliErrors[_0x3daa2d(0x95)](_0x1ade64[_0x3daa2d(0x9a)]+_0x3daa2d(0xaf));await resolveTargetDbBinding(_0x111b19[_0x3daa2d(0x99)],_0x1ade64,_0x4a732b),await readSqlUploadContent(_0x1ade64),_0x363625[_0x3daa2d(0xc3)](_0x1ade64['sqlCode']);}return{'method':'POST','url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x363625,'appCode':_0x111b19[_0x3daa2d(0x99)]},'description':_0x3daa2d(0xaa)+_0x363625[_0x3daa2d(0x94)]+_0x3daa2d(0xb2)};},async 'execute'(_0x211f1b){const _0x19b6da=a254_0x3b7f8e,_0x2d0f56=loadSqlProjectConfig(_0x211f1b[_0x19b6da(0x99)]),_0x462e6d=await readSqlLockFile(_0x2d0f56['lockFilePath']),{lockData:_0x19f285,appLock:_0x36b8d3}=ensureSqlLockScope(_0x462e6d??createEmptySqlLock(),_0x211f1b[_0x19b6da(0x99)],_0x2d0f56[_0x19b6da(0x90)],_0x19b6da(0xc3)),_0x3c5f68=await getTargetSqlQueries(_0x2d0f56,_0x36b8d3,_0x211f1b[_0x19b6da(0xbf)]('sqlcode')||undefined);if(_0x3c5f68['length']===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x19b6da(0xbc)};const _0x2c2823=[],_0x3d8dd6=[],_0x5aeedb=[];let _0x1b5961=![];for(const _0x379d01 of _0x3c5f68){const _0x9e068d=_0x36b8d3['sqls'][_0x379d01[_0x19b6da(0x9a)]];if(!_0x9e068d){_0x5aeedb['push']({'sqlCode':_0x379d01[_0x19b6da(0x9a)],'error':_0x19b6da(0x9e)});continue;}try{const _0x4cedc2=await computeSqlFileHash(_0x379d01['filePath']),_0x5f3d36=_0x9e068d[_0x19b6da(0xbd)]!==_0x379d01['relativePath']||!!_0x379d01[_0x19b6da(0xb1)]&&_0x9e068d[_0x19b6da(0xb1)]!==_0x379d01['sqlName']||_0x9e068d['mode']!==_0x379d01['mode'];if(!_0x211f1b[_0x19b6da(0x8f)](_0x19b6da(0x9c))&&_0x9e068d[_0x19b6da(0x88)]===_0x4cedc2&&!_0x5f3d36){_0x3d8dd6[_0x19b6da(0xc3)]({'sqlCode':_0x379d01[_0x19b6da(0x9a)],'reason':_0x19b6da(0xac)});continue;}if(_0x9e068d[_0x19b6da(0x9d)]==null){_0x5aeedb['push']({'sqlCode':_0x379d01[_0x19b6da(0x9a)],'error':_0x19b6da(0xb9)});continue;}const _0x248bf3=_0x379d01[_0x19b6da(0xb1)]||_0x9e068d[_0x19b6da(0xb1)],_0x3c834f=await resolveTargetDbBinding(_0x211f1b['appCode'],_0x379d01,_0x9e068d),_0x3c0882=await readSqlUploadContent(_0x379d01),_0x2976b8=await updateSqlQuery({'id':_0x9e068d[_0x19b6da(0x9b)],'appCode':_0x211f1b[_0x19b6da(0x99)],'sqlCode':_0x379d01[_0x19b6da(0x9a)],'sqlName':_0x248bf3,'dbId':_0x3c834f[_0x19b6da(0xb4)],'version':_0x9e068d['version'],'sqlContent':_0x3c0882,'sqlConfig':_0x9e068d[_0x19b6da(0x98)]??undefined}),_0x284aed=_0x2976b8['dbId']?await getDbName(_0x211f1b[_0x19b6da(0x99)],Number(_0x2976b8[_0x19b6da(0xb4)]))[_0x19b6da(0xbe)](()=>_0x3c834f[_0x19b6da(0x87)]):_0x3c834f[_0x19b6da(0x87)];_0x36b8d3[_0x19b6da(0x8e)][_0x379d01['sqlCode']]={...buildSqlLockEntry(_0x2976b8,_0x3c0882,_0x4cedc2,{'dbName':_0x284aed}),'path':_0x379d01['relativePath'],'mode':_0x379d01['mode']},_0x1b5961=!![],await archivePreviousSqlFileIfNeeded(_0x2d0f56,_0x9e068d['path'],_0x379d01[_0x19b6da(0xab)]),_0x2c2823[_0x19b6da(0xc3)]({'sqlCode':_0x379d01[_0x19b6da(0x9a)],'remoteId':_0x9e068d['remoteId']});}catch(_0x199695){_0x5aeedb['push']({'sqlCode':_0x379d01[_0x19b6da(0x9a)],'error':_0x199695 instanceof Error?_0x199695[_0x19b6da(0xb3)]:String(_0x199695)});}}(_0x1b5961||_0x5aeedb[_0x19b6da(0x94)]===0x0)&&(_0x36b8d3[_0x19b6da(0xa9)]=new Date()['toISOString'](),await writeSqlLockFile(_0x2d0f56[_0x19b6da(0xa0)],_0x19f285));const _0x362952=_0x5aeedb[_0x19b6da(0x94)]===0x0;return{'ok':_0x362952,'data':{'pushed':_0x2c2823,'skipped':_0x3d8dd6,'failed':_0x5aeedb},'message':'Push\x20complete:\x20'+_0x2c2823[_0x19b6da(0x94)]+_0x19b6da(0x85)+_0x3d8dd6['length']+'\x20skipped,\x20'+_0x5aeedb[_0x19b6da(0x94)]+_0x19b6da(0x9f)};}};async function archivePreviousSqlFileIfNeeded(_0x58b4d1,_0x35869d,_0x17bc8f){const _0x417c0b=a254_0x3b7f8e;if(!_0x35869d||_0x35869d===_0x17bc8f)return;const _0x47b15f=join(_0x58b4d1[_0x417c0b(0xa1)],_0x35869d);if(!await fileExists(_0x47b15f))return;const _0x5eefb8=await moveToTrash(_0x58b4d1[_0x417c0b(0xa5)],_0x58b4d1['trashDir'],_0x47b15f);await cleanupEmptyDirectories(dirname(_0x47b15f),_0x58b4d1[_0x417c0b(0xa1)]),void _0x5eefb8;}async function moveToTrash(_0x286484,_0x50513e,_0x5e6d93){const _0x1832d4=a254_0x3b7f8e,_0x53b093=new Date()[_0x1832d4(0x8a)]()[_0x1832d4(0xb8)](/[:.]/g,'-'),_0x44d2f7=relative(_0x286484,_0x5e6d93),_0x2550ad=join(_0x50513e,_0x53b093,_0x44d2f7);return await mkdir(dirname(_0x2550ad),{'recursive':!![]}),await rename(_0x5e6d93,_0x2550ad),_0x2550ad;}async function cleanupEmptyDirectories(_0x589054,_0x3e05f4){const _0x1ef57b=a254_0x3b7f8e;let _0x13d3e3=resolve(_0x589054);const _0x3b8d38=resolve(_0x3e05f4);while(_0x13d3e3[_0x1ef57b(0xa4)](''+_0x3b8d38+sep)||_0x13d3e3===_0x3b8d38){if(_0x13d3e3===_0x3b8d38)return;try{const _0xa86a1f=await readdir(_0x13d3e3);if(_0xa86a1f[_0x1ef57b(0x94)]>0x0)return;await rmdir(_0x13d3e3);}catch{return;}_0x13d3e3=dirname(_0x13d3e3);}}async function resolveTargetDbBinding(_0x5479ec,_0xd8166c,_0x2133b7){const _0x1489e4=a254_0x3b7f8e,_0x3450b6=_0xd8166c['dbDirectory'];if(!_0x3450b6)return{'dbId':_0x2133b7[_0x1489e4(0xb4)],'dbName':_0x2133b7[_0x1489e4(0x87)]};const _0x3f9d5f=buildDbDirectoryName(_0x2133b7[_0x1489e4(0x87)],_0x2133b7['dbId']);if(_0x3450b6===_0x3f9d5f)return{'dbId':_0x2133b7[_0x1489e4(0xb4)],'dbName':_0x2133b7[_0x1489e4(0x87)]};const _0x48c36f=parseExplicitDbDirectory(_0x3450b6);if(_0x48c36f!=null)return{'dbId':_0x48c36f,'dbName':await getDbName(_0x5479ec,_0x48c36f)[_0x1489e4(0xbe)](()=>undefined)};const _0x1fd432=await listDatabases(_0x5479ec),_0x23b442=_0x1fd432[_0x1489e4(0x8c)](_0x36a9aa=>buildDbDirectoryName(_0x36a9aa[_0x1489e4(0x87)],_0x36a9aa[_0x1489e4(0xb4)])===_0x3450b6);if(_0x23b442[_0x1489e4(0x94)]===0x1)return{'dbId':_0x23b442[0x0]['dbId'],'dbName':_0x23b442[0x0]['dbName']};if(_0x23b442[_0x1489e4(0x94)]===0x0)throw CliErrors[_0x1489e4(0x95)](_0x1489e4(0xa8)+_0x3450b6+'\x22\x20for\x20sqlCode\x20'+_0xd8166c[_0x1489e4(0x9a)]+'.');const _0x1171ca=_0x23b442['map'](_0x1a90c9=>_0x1a90c9[_0x1489e4(0x87)]+'\x20('+_0x1a90c9['dbId']+')')['join'](',\x20');throw CliErrors[_0x1489e4(0x95)]('Local\x20directory\x20\x22'+_0x3450b6+_0x1489e4(0xb5)+_0xd8166c['sqlCode']+':\x20'+_0x1171ca);}function parseExplicitDbDirectory(_0x38b497){const _0x3972a0=a254_0x3b7f8e,_0x280042=/^db-(\d+)$/['exec'](_0x38b497);if(!_0x280042)return null;const _0x24678d=Number(_0x280042[0x1]);return Number[_0x3972a0(0xb7)](_0x24678d)&&_0x24678d>0x0?_0x24678d:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a255_0x13ae(_0x1b92e9,_0x416bb5){_0x1b92e9=_0x1b92e9-0x8b;const _0x12b3c0=a255_0x12b3();let _0x13aeec=_0x12b3c0[_0x1b92e9];return _0x13aeec;}const a255_0x5e47cc=a255_0x13ae;(function(_0x19e19e,_0x5d5ff2){const _0x185295=a255_0x13ae,_0x21152e=_0x19e19e();while(!![]){try{const _0x20cb48=-parseInt(_0x185295(0xb3))/0x1*(-parseInt(_0x185295(0xa4))/0x2)+-parseInt(_0x185295(0xa2))/0x3*(parseInt(_0x185295(0xb5))/0x4)+parseInt(_0x185295(0x8e))/0x5*(-parseInt(_0x185295(0xb0))/0x6)+-parseInt(_0x185295(0x95))/0x7+parseInt(_0x185295(0xac))/0x8*(parseInt(_0x185295(0xb1))/0x9)+parseInt(_0x185295(0x9a))/0xa+-parseInt(_0x185295(0x8c))/0xb;if(_0x20cb48===_0x5d5ff2)break;else _0x21152e['push'](_0x21152e['shift']());}catch(_0x3ffab1){_0x21152e['push'](_0x21152e['shift']());}}}(a255_0x12b3,0x78e3f));import{createInterface}from'node:readline';function a255_0x12b3(){const _0x27030b=['dbId','sqlCode','\x20[y/N]\x20','mybatisXml','3555ZGApQL','fromEntries','9394cVXMsN','length','slice','<!--\x20@lovrabet.','path','trim','syncedAt','declaration','80EaXrEM','mode','\x20-->','endsWith','126njtbuf','322479SpTKxe','stderr','193Yysalx','sqlName','884IVsoCh','filter','join','includes','--\x20@lovrabet.','description','close','stdin','2953313UozBDd','test','158265fTfUAT','version','yes','sqlRoot','lastSync','sqlContent','dbName','2230956PLyauw','replace','split','toLowerCase','map','7441250afajYN','trimStart','.rabetbase/sql','exec'];a255_0x12b3=function(){return _0x27030b;};return a255_0x12b3();}import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a255_0x5e47cc(0x9c);export function buildSqlLockEntry(_0x43eac8,_0x314cdc,_0x59acf7,_0x2c9475){const _0x4d7ca8=a255_0x5e47cc,_0x50e147=detectSqlMode(_0x314cdc);return{'path':buildSqlRelativePath(_0x43eac8[_0x4d7ca8(0x9f)],_0x43eac8[_0x4d7ca8(0xb4)],_0x2c9475?.[_0x4d7ca8(0x94)],_0x50e147,_0x43eac8['dbId']),'hash':_0x59acf7,'remoteId':_0x43eac8['id'],'version':_0x43eac8[_0x4d7ca8(0x8f)],'dbId':Number(_0x43eac8[_0x4d7ca8(0x9e)]),'dbName':_0x2c9475?.['dbName'],'sqlName':_0x43eac8[_0x4d7ca8(0xb4)],'sqlConfig':_0x43eac8['sqlConfig']??undefined,'mode':_0x50e147};}export function cloneSqlLockData(_0x1c6d86){const _0xd622ff=a255_0x5e47cc;return{'apps':Object[_0xd622ff(0xa3)](Object['entries'](_0x1c6d86['apps'])[_0xd622ff(0x99)](([_0x17f753,_0x20d0ac])=>[_0x17f753,{'sqlRoot':_0x20d0ac[_0xd622ff(0x91)],'lastSync':_0x20d0ac[_0xd622ff(0x92)],'sqls':{..._0x20d0ac['sqls']}}]))};}export function ensureRemoteSqlContent(_0x11192e){const _0x5db4a2=a255_0x5e47cc;return _0x11192e[_0x5db4a2(0x93)]??'';}export function buildLocalSqlFileContent(_0x2c31ea,_0x43d0ba,_0xbaf384){const _0x57aa19=a255_0x5e47cc,_0xb47f34=_0xbaf384?.[_0x57aa19(0xad)]??detectSqlMode(_0x43d0ba),_0x32f2da=stripLocalSqlMetadata(_0x43d0ba,_0xb47f34)[_0x57aa19(0xa9)](),_0x4ba3b0=buildMetadataHeaderLines({'sqlCode':_0x2c31ea['sqlCode'],'sqlName':_0x2c31ea[_0x57aa19(0xb4)],'dbId':_0x2c31ea[_0x57aa19(0x9e)],'dbName':_0xbaf384?.['dbName'],'mode':_0xb47f34,'syncedAt':_0xbaf384?.[_0x57aa19(0xaa)],'description':_0xbaf384?.[_0x57aa19(0xba)]},_0xb47f34),_0x47fb03=_0xb47f34===_0x57aa19(0xa1)?splitXmlDeclaration(_0x32f2da):{'body':_0x32f2da},_0x53d24e=[..._0x47fb03[_0x57aa19(0xab)]?[_0x47fb03[_0x57aa19(0xab)]]:[],..._0x4ba3b0,'',_0x47fb03['body'][_0x57aa19(0x9b)]()],_0xbcf214=_0x53d24e[_0x57aa19(0xb7)]('\x0a');return _0xbcf214[_0x57aa19(0xaf)]('\x0a')?_0xbcf214:_0xbcf214+'\x0a';}export function stripLocalSqlMetadata(_0x3d639b,_0x34333e){const _0x14cfa3=a255_0x5e47cc;if(_0x34333e==='mybatisXml'){const {declaration:_0x59b710,body:_0x2f48ec}=splitXmlDeclaration(_0x3d639b[_0x14cfa3(0x96)](/\r\n/g,'\x0a')),_0x2338ff=stripLeadingMetadataLines(_0x2f48ec,/^\s*<!--\s*@lovrabet\./);return _0x59b710?''+_0x59b710+(_0x2338ff?'\x0a'+_0x2338ff:''):_0x2338ff;}return stripLeadingMetadataLines(_0x3d639b[_0x14cfa3(0x96)](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0x1c050b,_0x5cc8ed){const _0x4aba1e=a255_0x5e47cc;if(_0x5cc8ed?.[_0x4aba1e(0xad)])return _0x5cc8ed['mode'];return detectSqlMode(_0x1c050b);}export function resolveSqlFileName(_0x2b0c89,_0x174cff,_0xc79900){const _0x2011de=a255_0x5e47cc;if(_0xc79900?.[_0x2011de(0xa8)])return _0xc79900[_0x2011de(0xa8)];if(_0xc79900?.[_0x2011de(0xb4)]||_0xc79900?.[_0x2011de(0x94)])return buildSqlRelativePath(_0x2b0c89,_0xc79900?.[_0x2011de(0xb4)],_0xc79900?.[_0x2011de(0x94)],resolveSqlMode(_0x174cff,_0xc79900),_0xc79900?.[_0x2011de(0x9e)]);return buildDefaultSqlFileName(_0x2b0c89,resolveSqlMode(_0x174cff,_0xc79900));}export function resolveSqlLocalDir(_0x3b120d,_0x5939c3){return join(_0x3b120d,SQL_LOCAL_REL_DIR,_0x5939c3);}export async function confirmForceOverwrite(_0x3143e3){const _0x4ce281=a255_0x5e47cc,_0x282dbf=createInterface({'input':process[_0x4ce281(0x8b)],'output':process[_0x4ce281(0xb2)]}),_0x3f3fe5=await new Promise(_0x4e2525=>{const _0x464f6c=_0x4ce281;_0x282dbf['question'](_0x3143e3+_0x464f6c(0xa0),_0x4e2525);});return _0x282dbf[_0x4ce281(0xbb)](),['y',_0x4ce281(0x90)][_0x4ce281(0xb8)](_0x3f3fe5[_0x4ce281(0xa9)]()[_0x4ce281(0x98)]());}export function findSqlLockScope(_0x359b81,_0x3f8746){return _0x359b81['apps'][_0x3f8746];}function buildMetadataHeaderLines(_0x184d32,_0x382c74){const _0x1d132a=a255_0x5e47cc,_0x287500=[[_0x1d132a(0x9f),_0x184d32[_0x1d132a(0x9f)]],[_0x1d132a(0xb4),_0x184d32[_0x1d132a(0xb4)]],['dbId',_0x184d32[_0x1d132a(0x9e)]],[_0x1d132a(0x94),_0x184d32[_0x1d132a(0x94)]],['mode',_0x184d32['mode']],['syncedAt',_0x184d32['syncedAt']],[_0x1d132a(0xba),_0x184d32['description']]];if(_0x382c74===_0x1d132a(0xa1))return _0x287500[_0x1d132a(0xb6)](([,_0x52db21])=>_0x52db21!==undefined&&_0x52db21!==null&&String(_0x52db21)[_0x1d132a(0xa9)]()!=='')[_0x1d132a(0x99)](([_0x1db499,_0x53de0f])=>_0x1d132a(0xa7)+_0x1db499+':\x20'+String(_0x53de0f)+_0x1d132a(0xae));return _0x287500['filter'](([,_0x4bb533])=>_0x4bb533!==undefined&&_0x4bb533!==null&&String(_0x4bb533)[_0x1d132a(0xa9)]()!=='')[_0x1d132a(0x99)](([_0x41988b,_0x2e4d35])=>_0x1d132a(0xb9)+_0x41988b+':\x20'+String(_0x2e4d35));}function splitXmlDeclaration(_0x14013e){const _0x39eeb2=a255_0x5e47cc,_0x4c76e2=_0x14013e[_0x39eeb2(0x9b)](),_0x3714e2=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i[_0x39eeb2(0x9d)](_0x4c76e2);if(!_0x3714e2)return{'body':_0x14013e};return{'declaration':_0x3714e2[0x0],'body':_0x4c76e2[_0x39eeb2(0xa6)](_0x3714e2[0x0][_0x39eeb2(0xa5)])};}function stripLeadingMetadataLines(_0x21d1a3,_0x4f2b85){const _0x4fa3be=a255_0x5e47cc,_0x3877c7=_0x21d1a3[_0x4fa3be(0x97)]('\x0a');let _0x1da842=0x0;while(_0x1da842<_0x3877c7['length']){const _0x17c58b=_0x3877c7[_0x1da842]??'';if(_0x4f2b85[_0x4fa3be(0x8d)](_0x17c58b)||_0x17c58b[_0x4fa3be(0xa9)]()===''){_0x1da842++;continue;}break;}return _0x3877c7['slice'](_0x1da842)['join']('\x0a')['trimStart']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a256_0x2b4d88=a256_0x38b5;(function(_0x55af35,_0x3a99f9){const _0x1f5aa5=a256_0x38b5,_0x29841f=_0x55af35();while(!![]){try{const _0x15f106=parseInt(_0x1f5aa5(0x101))/0x1+-parseInt(_0x1f5aa5(0xf0))/0x2+-parseInt(_0x1f5aa5(0xf6))/0x3*(-parseInt(_0x1f5aa5(0xf2))/0x4)+-parseInt(_0x1f5aa5(0xf4))/0x5*(-parseInt(_0x1f5aa5(0xfc))/0x6)+-parseInt(_0x1f5aa5(0xf8))/0x7+parseInt(_0x1f5aa5(0xe3))/0x8*(-parseInt(_0x1f5aa5(0xf9))/0x9)+parseInt(_0x1f5aa5(0xeb))/0xa;if(_0x15f106===_0x3a99f9)break;else _0x29841f['push'](_0x29841f['shift']());}catch(_0x5c9d5c){_0x29841f['push'](_0x29841f['shift']());}}}(a256_0xe5c3,0x78c28));function a256_0x38b5(_0xbee430,_0x3eb31e){_0xbee430=_0xbee430-0xe1;const _0xe5c32b=a256_0xe5c3();let _0x38b5d8=_0xe5c32b[_0xbee430];return _0x38b5d8;}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';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a256_0xe5c3(){const _0x1d761b=['bool','hash','lockKey','sqls','boolean','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','2361660wlvPAl','length','has','keys','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','816936IYCcMn','All\x20SQL\x20queries\x20are\x20in\x20sync.','28vfYovp','\x20missing,\x20','10apfWMi','\x20unchanged','175038jnkyHO','sqlName','1482936VqxAXf','3471768VfvHty','remote','path','855006HpxOFT','status','read','appCode','tableData','571110vRKGmc','relativePath','map','push','\x20remote-only','lockFilePath','sqlRoot','\x20modified,\x20','8SSnKpd','sql'];a256_0xe5c3=function(){return _0x1d761b;};return a256_0xe5c3();}async function fetchAllSqlCodes(_0x1a7f07){const _0x26dea9=a256_0x38b5,_0x451a42=[];let _0x406fc7=0x1;while(!![]){const _0x44ec9a=await listSqlQueries(_0x1a7f07,{'currentPage':_0x406fc7,'pageSize':PAGE_SIZE}),_0x468adb=_0x44ec9a[_0x26dea9(0x100)]??[];_0x451a42[_0x26dea9(0x104)](..._0x468adb[_0x26dea9(0x103)](_0x1ebfb8=>_0x1ebfb8['sqlCode']));if(_0x468adb['length']===0x0)break;const _0x22942b=_0x44ec9a['paging']?.['totalCount'];if(_0x22942b!=null?_0x451a42['length']>=_0x22942b:_0x468adb[_0x26dea9(0xec)]<PAGE_SIZE)break;_0x406fc7++;}return _0x451a42;}export const sqlStatus={'service':a256_0x2b4d88(0xe4),'command':a256_0x2b4d88(0xfd),'description':a256_0x2b4d88(0xef),'risk':a256_0x2b4d88(0xfe),'flags':[{'name':a256_0x2b4d88(0xfa),'type':a256_0x2b4d88(0xe9),'description':a256_0x2b4d88(0xea)}],async 'execute'(_0x25a88c){const _0x1e1589=a256_0x2b4d88,_0x5d016d=loadSqlProjectConfig(_0x25a88c['appCode']),_0x38c562=await readSqlLockFile(_0x5d016d[_0x1e1589(0x106)]),{appLock:_0x515ef8}=ensureSqlLockScope(_0x38c562??createEmptySqlLock(),_0x5d016d[_0x1e1589(0xff)],_0x5d016d[_0x1e1589(0xe1)],_0x1e1589(0xfd)),_0xe31d3e=await scanLocalSqlQueries(_0x5d016d),_0x17134a=[],_0x4303a1=[],_0x4e44ad=[],_0x22bd44=[],_0x5645c4=new Set(_0xe31d3e[_0x1e1589(0x103)](_0x5e0d44=>_0x5e0d44[_0x1e1589(0xe7)]));for(const _0x161e8e of _0xe31d3e){const _0x2984ec=await computeSqlFileHash(_0x161e8e['filePath']),_0x3d4ddc=_0x515ef8['sqls'][_0x161e8e[_0x1e1589(0xe7)]],_0x29e79b=!!_0x3d4ddc&&_0x3d4ddc[_0x1e1589(0xfb)]!==_0x161e8e[_0x1e1589(0x102)],_0x1c4341=!!_0x3d4ddc&&!!_0x161e8e[_0x1e1589(0xf7)]&&_0x3d4ddc[_0x1e1589(0xf7)]!==_0x161e8e[_0x1e1589(0xf7)];if(!_0x3d4ddc)_0x17134a['push'](_0x161e8e[_0x1e1589(0xe7)]);else _0x3d4ddc[_0x1e1589(0xe6)]!==_0x2984ec||_0x29e79b||_0x1c4341?_0x4303a1[_0x1e1589(0x104)](_0x161e8e[_0x1e1589(0xe7)]):_0x4e44ad[_0x1e1589(0x104)](_0x161e8e[_0x1e1589(0xe7)]);}for(const _0x5e88f0 of Object[_0x1e1589(0xee)](_0x515ef8['sqls'])){!_0x5645c4[_0x1e1589(0xed)](_0x5e88f0)&&_0x22bd44[_0x1e1589(0x104)](_0x5e88f0);}const _0xe7a593=[];if(_0x25a88c[_0x1e1589(0xe5)](_0x1e1589(0xfa))){const _0x3ebf10=await fetchAllSqlCodes(_0x25a88c[_0x1e1589(0xff)]);for(const _0x2ee0ba of _0x3ebf10){!_0x5645c4[_0x1e1589(0xed)](_0x2ee0ba)&&!_0x515ef8[_0x1e1589(0xe8)][_0x2ee0ba]&&_0xe7a593[_0x1e1589(0x104)](_0x2ee0ba);}}const _0x1c140f=_0x17134a[_0x1e1589(0xec)]===0x0&&_0x4303a1[_0x1e1589(0xec)]===0x0&&_0x22bd44[_0x1e1589(0xec)]===0x0&&_0xe7a593['length']===0x0;return{'ok':!![],'data':{'added':_0x17134a,'modified':_0x4303a1,'missing':_0x22bd44,'unchanged':_0x4e44ad,'remoteOnly':_0xe7a593},'message':_0x1c140f?_0x1e1589(0xf1):_0x17134a['length']+'\x20added,\x20'+_0x4303a1[_0x1e1589(0xec)]+_0x1e1589(0xe2)+_0x22bd44['length']+_0x1e1589(0xf3)+_0x4e44ad[_0x1e1589(0xec)]+_0x1e1589(0xf5)+(_0xe7a593[_0x1e1589(0xec)]>0x0?',\x20'+_0xe7a593[_0x1e1589(0xec)]+_0x1e1589(0x105):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a257_0x32660c=a257_0x1194;(function(_0x3e0d0c,_0x280f5d){const _0x38665c=a257_0x1194,_0x406b80=_0x3e0d0c();while(!![]){try{const _0x14d26c=parseInt(_0x38665c(0x154))/0x1+-parseInt(_0x38665c(0x167))/0x2+parseInt(_0x38665c(0x150))/0x3+parseInt(_0x38665c(0x15b))/0x4+-parseInt(_0x38665c(0x16a))/0x5*(parseInt(_0x38665c(0x165))/0x6)+parseInt(_0x38665c(0x13f))/0x7+parseInt(_0x38665c(0x138))/0x8*(-parseInt(_0x38665c(0x140))/0x9);if(_0x14d26c===_0x280f5d)break;else _0x406b80['push'](_0x406b80['shift']());}catch(_0x37a2c0){_0x406b80['push'](_0x406b80['shift']());}}}(a257_0x2ba0,0x49ca4));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a257_0x1194(_0x319318,_0x5d9382){_0x319318=_0x319318-0x127;const _0x2ba0f2=a257_0x2ba0();let _0x119489=_0x2ba0f2[_0x319318];return _0x119489;}import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a257_0x32660c(0x15a),'command':a257_0x32660c(0x160),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a257_0x32660c(0x130),'flags':[{'name':a257_0x32660c(0x146),'type':a257_0x32660c(0x139),'description':a257_0x32660c(0x134)},{'name':'sql','type':a257_0x32660c(0x139),'description':a257_0x32660c(0x15e)},{'name':a257_0x32660c(0x158),'type':a257_0x32660c(0x139),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a257_0x32660c(0x162),'type':a257_0x32660c(0x159),'description':a257_0x32660c(0x12f)}],async 'execute'(_0x5e3a24){const _0x5addac=a257_0x32660c,_0x189936=_0x5e3a24['str'](_0x5addac(0x146)),_0x527f1e=_0x5e3a24[_0x5addac(0x15c)](_0x5addac(0x15a)),_0x3dd249=_0x5e3a24[_0x5addac(0x15c)](_0x5addac(0x158)),_0x3a7e6e=_0x5e3a24[_0x5addac(0x131)](_0x5addac(0x162));if(!_0x189936&&!_0x527f1e)throw CliErrors[_0x5addac(0x13e)]('file',_0x5addac(0x156));if(_0x3a7e6e&&!_0x3dd249)throw CliErrors[_0x5addac(0x14e)](_0x5addac(0x127));let _0x1a55dd;if(_0x189936){const _0x142899=resolve(process[_0x5addac(0x12a)](),_0x189936);if(!existsSync(_0x142899))throw CliErrors[_0x5addac(0x14e)]('File\x20not\x20found:\x20'+_0x142899);_0x1a55dd=readFileSync(_0x142899,_0x5addac(0x132));}else _0x1a55dd=_0x527f1e;const _0x311888=validateSql(_0x1a55dd),_0x31ea51={'valid':_0x311888[_0x5addac(0x136)],'sqlType':_0x311888[_0x5addac(0x144)][_0x5addac(0x15d)],'isSelectOnly':_0x311888[_0x5addac(0x144)][_0x5addac(0x15f)],'isLockingRead':_0x311888[_0x5addac(0x144)][_0x5addac(0x166)]??![],'isDangerous':_0x311888['sqlType'][_0x5addac(0x168)],'tables':_0x311888[_0x5addac(0x128)],'parameters':_0x311888[_0x5addac(0x157)],'message':_0x311888[_0x5addac(0x149)]};_0x311888[_0x5addac(0x144)][_0x5addac(0x145)]&&(_0x31ea51[_0x5addac(0x145)]=_0x311888[_0x5addac(0x144)][_0x5addac(0x145)]);if(_0x3dd249&&_0x311888['valid']){const _0x2c0bd8=_0x3dd249['split'](',')[_0x5addac(0x14c)](_0x947b1f=>_0x947b1f[_0x5addac(0x12b)]())['filter'](Boolean),_0x12289a=[],_0x4d3ba9=[],_0x119dba=filterDbTableBackedDatasets(await listDatasets(_0x5e3a24[_0x5addac(0x155)])),_0x228765=new Map(_0x119dba[_0x5addac(0x14c)](_0x12503a=>[_0x12503a[_0x5addac(0x153)]?.[_0x5addac(0x14a)]?.[_0x5addac(0x142)](),_0x12503a]));for(const _0x109249 of _0x311888[_0x5addac(0x128)]){const _0x1cf31a=_0x228765[_0x5addac(0x164)](_0x109249['toLowerCase']());!_0x1cf31a&&_0x12289a[_0x5addac(0x13a)](_0x5addac(0x137)+_0x109249+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x194be8 of _0x2c0bd8){let _0x31dd2e;try{_0x31dd2e=await getDatasetDetail(_0x194be8);}catch{_0x12289a[_0x5addac(0x13a)](_0x5addac(0x148)+_0x194be8+_0x5addac(0x163));continue;}assertDatasetIsDbTableBacked(_0x31dd2e,_0x5addac(0x151));const _0x36d55e=Array[_0x5addac(0x13c)](_0x31dd2e[_0x5addac(0x14f)])?_0x31dd2e[_0x5addac(0x14f)]:[],_0x3a10f3=new Set(_0x36d55e[_0x5addac(0x14c)](_0x76e154=>_0x76e154[_0x5addac(0x141)]?.[_0x5addac(0x142)]())),_0x3d4729=_0x31dd2e['dbtableConfig']?.[_0x5addac(0x14a)]||_0x31dd2e[_0x5addac(0x14a)]||_0x194be8;_0x31ea51[_0x5addac(0x135)+_0x3d4729]={'code':_0x194be8,'tableName':_0x3d4729,'fieldCount':_0x3a10f3['size'],'fields':Array['from'](_0x3a10f3)};if(_0x3a7e6e){const _0x678ff4=normalizeDatasetIndexes(_0x31dd2e);_0x4d3ba9[_0x5addac(0x13a)]({'tableName':_0x3d4729,..._0x678ff4});}}_0x12289a[_0x5addac(0x129)]>0x0&&(_0x31ea51['schemaWarnings']=_0x12289a),_0x3a7e6e&&(_0x31ea51['joinAudit']=auditSqlJoinIndexes(_0x1a55dd,_0x4d3ba9));}return{'ok':_0x311888[_0x5addac(0x136)],'data':_0x31ea51,'message':_0x311888[_0x5addac(0x149)]};}};function normalizeDatasetIndexes(_0x1be379){const _0x836e0b=a257_0x32660c,_0xe8065d=Array[_0x836e0b(0x13c)](_0x1be379?.[_0x836e0b(0x13b)]?.[_0x836e0b(0x143)])?_0x1be379[_0x836e0b(0x13b)][_0x836e0b(0x143)]:Array['isArray'](_0x1be379?.[_0x836e0b(0x143)])?_0x1be379[_0x836e0b(0x143)]:[],_0x7e4a6d=_0xe8065d[_0x836e0b(0x13d)](_0x1497d9=>{const _0x3b410a=_0x836e0b,_0x5c8443=Array['isArray'](_0x1497d9?.['index_columns'])?_0x1497d9[_0x3b410a(0x133)]:Array[_0x3b410a(0x13c)](_0x1497d9?.['columnNames'])?_0x1497d9[_0x3b410a(0x12e)]:Array['isArray'](_0x1497d9?.[_0x3b410a(0x14b)])?_0x1497d9['columns']:[],_0x2186ff=_0x5c8443[_0x3b410a(0x12c)](_0x153a40=>typeof _0x153a40===_0x3b410a(0x139))['map'](_0x1541d0=>_0x1541d0[_0x3b410a(0x12b)]())[_0x3b410a(0x12c)](Boolean);if(_0x2186ff[_0x3b410a(0x129)]===0x0)return[];const _0x2715e7=[_0x1497d9?.[_0x3b410a(0x161)],_0x1497d9?.['index_name'],_0x1497d9?.[_0x3b410a(0x141)]][_0x3b410a(0x12d)](_0x3214=>typeof _0x3214===_0x3b410a(0x139)&&_0x3214[_0x3b410a(0x12b)]()),_0x512614=[_0x1497d9?.[_0x3b410a(0x147)],_0x1497d9?.[_0x3b410a(0x15d)]][_0x3b410a(0x12d)](_0xbed82e=>typeof _0xbed82e===_0x3b410a(0x139)&&_0xbed82e[_0x3b410a(0x12b)]());return[{..._0x2715e7?{'name':_0x2715e7['trim']()}:{},..._0x512614?{'type':_0x512614[_0x3b410a(0x12b)]()}:{},'columns':_0x2186ff}];}),_0x20d539=[..._0x7e4a6d],_0x233494=typeof _0x1be379?.[_0x836e0b(0x153)]?.[_0x836e0b(0x14d)]==='string'?_0x1be379[_0x836e0b(0x153)][_0x836e0b(0x14d)][_0x836e0b(0x169)](',')[_0x836e0b(0x14c)](_0x266129=>_0x266129[_0x836e0b(0x12b)]())[_0x836e0b(0x12c)](Boolean):[];return _0x233494[_0x836e0b(0x129)]>0x0&&_0x20d539['unshift']({'type':_0x836e0b(0x152),'columns':_0x233494}),{'indexes':_0x20d539,'metadataAvailable':_0x7e4a6d[_0x836e0b(0x129)]>0x0};}function a257_0x2ba0(){const _0x4bc462=['sql','1836492UauYJr','str','type','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','isSelectOnly','validate','indexName','check-indexes','\x22\x20not\x20found\x20or\x20not\x20accessible','get','12534gNDYeQ','isLockingRead','1204246yBHCit','isDangerous','split','785TfomSs','--check-indexes\x20requires\x20--schemas.','tables','length','cwd','trim','filter','find','columnNames','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','read','bool','utf-8','index_columns','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','schema:','valid','Table\x20\x22','895704rmYNcB','string','push','dataset','isArray','flatMap','flagMissing','3835664BcxKlw','36BOTxKS','name','toLowerCase','indexes','sqlType','reason','file','index_type','Dataset\x20\x22','message','tableName','columns','map','pkField','validation','fields','388458NIxMmW','SQL\x20schema\x20validation','primary','dbtableConfig','543631WXkseQ','appCode','Provide\x20--file\x20or\x20--sql','parameters','schemas','boolean'];a257_0x2ba0=function(){return _0x4bc462;};return a257_0x2ba0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4ffc70,_0x19f4a3){const _0x3b71eb=a258_0x45e0,_0xdaaaf9=_0x4ffc70();while(!![]){try{const _0x5d7caf=parseInt(_0x3b71eb(0x185))/0x1+-parseInt(_0x3b71eb(0x182))/0x2*(-parseInt(_0x3b71eb(0x180))/0x3)+parseInt(_0x3b71eb(0x188))/0x4*(parseInt(_0x3b71eb(0x184))/0x5)+parseInt(_0x3b71eb(0x186))/0x6*(parseInt(_0x3b71eb(0x17f))/0x7)+-parseInt(_0x3b71eb(0x17e))/0x8+-parseInt(_0x3b71eb(0x183))/0x9*(-parseInt(_0x3b71eb(0x187))/0xa)+-parseInt(_0x3b71eb(0x181))/0xb;if(_0x5d7caf===_0x19f4a3)break;else _0xdaaaf9['push'](_0xdaaaf9['shift']());}catch(_0x3ab944){_0xdaaaf9['push'](_0xdaaaf9['shift']());}}}(a258_0xed4e,0x83311));function a258_0x45e0(_0x12c35c,_0x35bfc3){_0x12c35c=_0x12c35c-0x17e;const _0xed4e6=a258_0xed4e();let _0x45e0cb=_0xed4e6[_0x12c35c];return _0x45e0cb;}function a258_0xed4e(){const _0x5e238b=['1533510egmKMj','564112LozsOX','3070928ngnKMD','463806QyodfH','9jnflUa','16984220LwShVn','369142zcXaxu','9qnNttO','15TNKcmt','805035brQwpI','48fkZzHs'];a258_0xed4e=function(){return _0x5e238b;};return a258_0xed4e();}import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a259_0xeb99(){const _0x589877=['100NCzZmS','taskId','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','38823hSsuNj','2408Jamnqq','isTerminal','task','flagMissing','677303pYtdxh','compress','apiError','appCode','452KojAkc','status','cookie','4146uVkHUn','30109HJuOtu','22239uemXBC',',\x20received\x20','string','read','40XLbnjt','3630536seGZZY','trim','13TocUht','12983928cvUbpG','255OTJcmw','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','task-id','str'];a259_0xeb99=function(){return _0x589877;};return a259_0xeb99();}const a259_0xf8aa4c=a259_0x1d2b;(function(_0x1457fd,_0x5a35ba){const _0x19ffa0=a259_0x1d2b,_0x48a7c2=_0x1457fd();while(!![]){try{const _0x1205b5=-parseInt(_0x19ffa0(0xfc))/0x1*(parseInt(_0x19ffa0(0x10a))/0x2)+parseInt(_0x19ffa0(0x10e))/0x3*(parseInt(_0x19ffa0(0xf8))/0x4)+parseInt(_0x19ffa0(0x106))/0x5*(-parseInt(_0x19ffa0(0xfb))/0x6)+-parseInt(_0x19ffa0(0x102))/0x7+-parseInt(_0x19ffa0(0x10f))/0x8*(-parseInt(_0x19ffa0(0xfd))/0x9)+-parseInt(_0x19ffa0(0x101))/0xa*(parseInt(_0x19ffa0(0x113))/0xb)+-parseInt(_0x19ffa0(0x105))/0xc*(-parseInt(_0x19ffa0(0x104))/0xd);if(_0x1205b5===_0x5a35ba)break;else _0x48a7c2['push'](_0x48a7c2['shift']());}catch(_0x13701e){_0x48a7c2['push'](_0x48a7c2['shift']());}}}(a259_0xeb99,0xefdc3));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 a259_0x1d2b(_0x1e6415,_0x392113){_0x1e6415=_0x1e6415-0xf5;const _0xeb99f9=a259_0xeb99();let _0x1d2b6b=_0xeb99f9[_0x1e6415];return _0x1d2b6b;}import{CliErrors}from'../../errors.js';export const taskStatus={'service':a259_0xf8aa4c(0x111),'command':a259_0xf8aa4c(0xf9),'description':a259_0xf8aa4c(0x107),'risk':a259_0xf8aa4c(0x100),'defaultOutputFormat':a259_0xf8aa4c(0xf5),'structuredErrors':!![],'flags':[{'name':a259_0xf8aa4c(0x108),'type':a259_0xf8aa4c(0xff),'required':!![],'description':a259_0xf8aa4c(0x10d)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x59e87e){const _0x50bd73=a259_0xf8aa4c;if(!_0x59e87e[_0x50bd73(0x109)]('task-id')[_0x50bd73(0x103)]())throw CliErrors[_0x50bd73(0x112)](_0x50bd73(0x108));},async 'execute'(_0x9893db){const _0xcc70bd=a259_0xf8aa4c,_0x49c5f3=_0x9893db[_0xcc70bd(0x109)]('task-id')[_0xcc70bd(0x103)](),_0x246249=normalizeAsyncTask(await getAsyncTaskStatus(_0x49c5f3,_0x9893db[_0xcc70bd(0xf7)],_0x9893db[_0xcc70bd(0xfa)]));if(_0x246249[_0xcc70bd(0x10b)]!==_0x49c5f3)throw CliErrors[_0xcc70bd(0xf6)](_0xcc70bd(0x10c)+_0x49c5f3+_0xcc70bd(0xfe)+_0x246249[_0xcc70bd(0x10b)]+'.');const _0x2dfa4b=buildAsyncTaskStatusCommand(_0x246249[_0xcc70bd(0x10b)],_0x9893db['appCode']);return{'ok':!![],'message':asyncTaskMessage(_0x246249),'data':{'appCode':_0x9893db[_0xcc70bd(0xf7)],..._0x246249,'query':_0x246249[_0xcc70bd(0x110)]?null:{'command':_0x2dfa4b}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x26860e,_0x1aa47e){const _0x717e4=a260_0x2e96,_0x53b3a4=_0x26860e();while(!![]){try{const _0x216fdd=-parseInt(_0x717e4(0x148))/0x1*(-parseInt(_0x717e4(0x146))/0x2)+parseInt(_0x717e4(0x145))/0x3*(parseInt(_0x717e4(0x142))/0x4)+parseInt(_0x717e4(0x144))/0x5*(-parseInt(_0x717e4(0x14a))/0x6)+-parseInt(_0x717e4(0x143))/0x7+-parseInt(_0x717e4(0x141))/0x8+-parseInt(_0x717e4(0x149))/0x9+parseInt(_0x717e4(0x147))/0xa*(parseInt(_0x717e4(0x14b))/0xb);if(_0x216fdd===_0x1aa47e)break;else _0x53b3a4['push'](_0x53b3a4['shift']());}catch(_0x3202d9){_0x53b3a4['push'](_0x53b3a4['shift']());}}}(a260_0x2414,0x9c7d3));function a260_0x2414(){const _0x2ae62b=['12DdXirs','3395150nQfmUC','7023152XIZZzj','692PfIVwl','5453210HtiSdE','1172385IAmfqr','12255qRhsvy','1795324HQXEKk','50FxoLcF','1BzvwaC','3426840PqWGsh'];a260_0x2414=function(){return _0x2ae62b;};return a260_0x2414();}function a260_0x2e96(_0x4b00c9,_0x2560be){_0x4b00c9=_0x4b00c9-0x141;const _0x2414fe=a260_0x2414();let _0x2e961d=_0x2414fe[_0x4b00c9];return _0x2e961d;}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a261_0x2881af=a261_0x2fe9;(function(_0x56fd8f,_0x2c863a){const _0x4acae9=a261_0x2fe9,_0x2e6fa6=_0x56fd8f();while(!![]){try{const _0x11bbb7=-parseInt(_0x4acae9(0x13e))/0x1*(parseInt(_0x4acae9(0x138))/0x2)+-parseInt(_0x4acae9(0x136))/0x3*(-parseInt(_0x4acae9(0x13c))/0x4)+parseInt(_0x4acae9(0x12d))/0x5+parseInt(_0x4acae9(0x134))/0x6+parseInt(_0x4acae9(0x139))/0x7+parseInt(_0x4acae9(0x12b))/0x8*(parseInt(_0x4acae9(0x131))/0x9)+-parseInt(_0x4acae9(0x129))/0xa*(parseInt(_0x4acae9(0x13a))/0xb);if(_0x11bbb7===_0x2c863a)break;else _0x2e6fa6['push'](_0x2e6fa6['shift']());}catch(_0x186864){_0x2e6fa6['push'](_0x2e6fa6['shift']());}}}(a261_0x570b,0x41d64));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a261_0x570b(){const _0x112815=['str','274VLewnx','2545256QoNESW','1656457DvCaWN','members-list','87252iJgIXo','length','3490CZmHwH','10iHELMq','tenant-code','152MqJqfQ','trim','670830BXxnMh','Found\x20','tenant','Pass\x20--tenant-code\x20<code>.','18657ZNFHIn','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','flagMissing','204174AxtUPA','\x20tenant\x20member(s)','45xOOHBf'];a261_0x570b=function(){return _0x112815;};return a261_0x570b();}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';function a261_0x2fe9(_0x2a332c,_0x3a4038){_0x2a332c=_0x2a332c-0x129;const _0x570b4e=a261_0x570b();let _0x2fe923=_0x570b4e[_0x2a332c];return _0x2fe923;}export const tenantMembersListDefinition={'service':a261_0x2881af(0x12f),'command':a261_0x2881af(0x13b),'description':a261_0x2881af(0x132),'risk':'read','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a261_0x2881af(0x12a),'type':'string','required':!![],'description':'Exact\x20tenant\x20code'}],async 'validate'(_0x5f182d){const _0x3bcec7=a261_0x2881af;if(!_0x5f182d[_0x3bcec7(0x137)](_0x3bcec7(0x12a))[_0x3bcec7(0x12c)]())throw CliErrors[_0x3bcec7(0x133)]('tenant-code',_0x3bcec7(0x130));},async 'execute'(_0xf67808){const _0x683383=a261_0x2881af,_0x590549=_0xf67808[_0x683383(0x137)](_0x683383(0x12a))['trim'](),_0x5a45ce=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x590549,_0x5a45ce);const _0x4bf26c=projectTenantMembers(await listTenantDirectoryMembers(_0x590549));return{'ok':!![],'data':{'tenantCode':_0x590549,'items':_0x4bf26c,'totalCount':_0x4bf26c[_0x683383(0x13d)]},'message':_0x683383(0x12e)+_0x4bf26c['length']+_0x683383(0x135)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x233874,_0x550dbe){const _0xca5abc=a262_0x29d5,_0xd52ecd=_0x233874();while(!![]){try{const _0x49b85c=parseInt(_0xca5abc(0x183))/0x1*(-parseInt(_0xca5abc(0x174))/0x2)+-parseInt(_0xca5abc(0x17d))/0x3*(-parseInt(_0xca5abc(0x186))/0x4)+-parseInt(_0xca5abc(0x182))/0x5+-parseInt(_0xca5abc(0x178))/0x6+parseInt(_0xca5abc(0x185))/0x7*(-parseInt(_0xca5abc(0x170))/0x8)+parseInt(_0xca5abc(0x187))/0x9*(-parseInt(_0xca5abc(0x180))/0xa)+parseInt(_0xca5abc(0x173))/0xb;if(_0x49b85c===_0x550dbe)break;else _0xd52ecd['push'](_0xd52ecd['shift']());}catch(_0x4f8653){_0xd52ecd['push'](_0xd52ecd['shift']());}}}(a262_0x4f3a,0x61c54));function a262_0x29d5(_0x884ebc,_0x43d7f8){_0x884ebc=_0x884ebc-0x16f;const _0x4f3a43=a262_0x4f3a();let _0x29d550=_0x4f3a43[_0x884ebc];return _0x29d550;}function a262_0x4f3a(){const _0x4861cc=['200ifnfDq','set','displayName','26930145DcZNJz','24tESXNV','adminFlag','validation','nickname','2520258zBxpQg','isFinite','status','MEMBER','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','90ttLGCj','role','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','1487340mwDokV','userId','3934690zktdZO','2453dCypHT','ADMIN','72170AHgEnl','25348NIXofq','45UzGfgB','Tenant\x20\x22'];a262_0x4f3a=function(){return _0x4861cc;};return a262_0x4f3a();}import{CliErrors}from'../../errors.js';function textOrNull(_0x436052){const _0x55dde9=_0x436052?.['trim']();return _0x55dde9?_0x55dde9:null;}export function projectTenantMembers(_0x3474b6){const _0x82010a=a262_0x29d5,_0x3a7078=new Map();for(const _0x24ccf8 of _0x3474b6){const _0xe68146=Number(_0x24ccf8[_0x82010a(0x181)]);if(!Number[_0x82010a(0x179)](_0xe68146)||_0xe68146<=0x0)continue;const _0x4dc3e8={'userId':_0xe68146,'username':textOrNull(_0x24ccf8['username']),'displayName':textOrNull(_0x24ccf8[_0x82010a(0x177)]),'role':_0x24ccf8[_0x82010a(0x175)]===!![]?_0x82010a(0x184):_0x82010a(0x17b),'status':textOrNull(_0x24ccf8[_0x82010a(0x17a)])},_0x39d63a=_0x3a7078['get'](_0xe68146);if(!_0x39d63a){_0x3a7078[_0x82010a(0x171)](_0xe68146,_0x4dc3e8);continue;}_0x39d63a['username']??=_0x4dc3e8['username'],_0x39d63a[_0x82010a(0x172)]??=_0x4dc3e8[_0x82010a(0x172)],_0x39d63a[_0x82010a(0x17a)]??=_0x4dc3e8[_0x82010a(0x17a)];if(_0x4dc3e8[_0x82010a(0x17e)]===_0x82010a(0x184))_0x39d63a['role']=_0x82010a(0x184);}return[..._0x3a7078['values']()]['sort']((_0x135ca7,_0x4b5087)=>_0x135ca7[_0x82010a(0x181)]-_0x4b5087['userId']);}export function assertTenantAccessible(_0x4a85ff,_0x2f6a96){const _0x1e3eec=a262_0x29d5;if(_0x2f6a96['some'](_0x406b2c=>_0x406b2c['tenantCode']===_0x4a85ff))return;throw CliErrors[_0x1e3eec(0x176)](_0x1e3eec(0x16f)+_0x4a85ff+_0x1e3eec(0x17f),_0x1e3eec(0x17c));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a263_0x1f36(_0x390e64,_0x3e539b){_0x390e64=_0x390e64-0x1d2;const _0x3382c1=a263_0x3382();let _0x1f36aa=_0x3382c1[_0x390e64];return _0x1f36aa;}const a263_0x204de7=a263_0x1f36;(function(_0x46cb0a,_0x33717c){const _0x3c57e4=a263_0x1f36,_0x18ff73=_0x46cb0a();while(!![]){try{const _0x2bf471=parseInt(_0x3c57e4(0x1e2))/0x1+-parseInt(_0x3c57e4(0x1e9))/0x2*(parseInt(_0x3c57e4(0x1e4))/0x3)+-parseInt(_0x3c57e4(0x1e8))/0x4*(-parseInt(_0x3c57e4(0x1d9))/0x5)+-parseInt(_0x3c57e4(0x1df))/0x6*(-parseInt(_0x3c57e4(0x1e7))/0x7)+parseInt(_0x3c57e4(0x1dc))/0x8*(parseInt(_0x3c57e4(0x1d5))/0x9)+parseInt(_0x3c57e4(0x1dd))/0xa+-parseInt(_0x3c57e4(0x1d3))/0xb*(parseInt(_0x3c57e4(0x1e3))/0xc);if(_0x2bf471===_0x33717c)break;else _0x18ff73['push'](_0x18ff73['shift']());}catch(_0x1b1c65){_0x18ff73['push'](_0x18ff73['shift']());}}}(a263_0x3382,0xcb431));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=a263_0x204de7(0x1e6),CURRENT_BINDING_WARNING=a263_0x204de7(0x1ea);function readDingTalkUserId(_0x39a555){const _0x10b913=a263_0x204de7,_0x25f785=_0x39a555[_0x10b913(0x1e5)]('ding-talk-user-id')[_0x10b913(0x1db)]();if(!_0x25f785)throw CliErrors[_0x10b913(0x1da)](_0x10b913(0x1d4),'Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.');return _0x25f785;}function buildBindingData(_0x269ca9,_0x1fc35a){const _0x362c20=a263_0x204de7;return{'operation':_0x362c20(0x1d8),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x269ca9},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x269ca9,'bound':!![]},'dryRun':_0x1fc35a,'backend':{'method':_0x362c20(0x1d7),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}function a263_0x3382(){const _0x50bc6c=['trim','600816aDuNKJ','16052650wCTtOt','user-account','2211618XvbzoZ','ding-talk-user-id','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','480899rVPquI','24ouSdCu','6EgJzUp','str','dingtalk','14EPIxdE','4432876OMmVMh','131834gniBSn','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','string','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','19210994aDbrbC','--ding-talk-user-id\x20cannot\x20be\x20empty.','63KCByaG','dingding-sandbox-bind','POST','bind','5NioqHt','validation'];a263_0x3382=function(){return _0x50bc6c;};return a263_0x3382();}export const dingTalkSandboxBind={'service':a263_0x204de7(0x1de),'command':a263_0x204de7(0x1d6),'description':'Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','risk':'write','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a263_0x204de7(0x1e0),'type':a263_0x204de7(0x1ec),'required':!![],'description':a263_0x204de7(0x1d2)}],async 'validate'(_0x123dd8){readDingTalkUserId(_0x123dd8);},async 'dryRun'(_0x4973eb){const _0x41c1d9=readDingTalkUserId(_0x4973eb);return asDryRunResult(buildBindingData(_0x41c1d9,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x46fdc5){const _0x19ee33=a263_0x204de7,_0x15da5d=readDingTalkUserId(_0x46fdc5),_0x52c746=await bindDingTalkSandboxAccount(_0x15da5d);if(_0x52c746!==!![])throw CliErrors['apiError']('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x19ee33(0x1eb));return{'ok':!![],'data':buildBindingData(_0x15da5d,![]),'message':_0x19ee33(0x1e1)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a264_0x10a0(_0x242c5f,_0x577b34){_0x242c5f=_0x242c5f-0x1c7;const _0x142505=a264_0x1425();let _0x10a0f3=_0x142505[_0x242c5f];return _0x10a0f3;}const a264_0x5075b1=a264_0x10a0;(function(_0x425a3b,_0x5489d6){const _0x16e2eb=a264_0x10a0,_0x6a19d6=_0x425a3b();while(!![]){try{const _0x4c37b3=-parseInt(_0x16e2eb(0x1d1))/0x1*(-parseInt(_0x16e2eb(0x1c7))/0x2)+parseInt(_0x16e2eb(0x1d7))/0x3*(parseInt(_0x16e2eb(0x1d9))/0x4)+parseInt(_0x16e2eb(0x1e7))/0x5*(-parseInt(_0x16e2eb(0x1e4))/0x6)+parseInt(_0x16e2eb(0x1dc))/0x7*(-parseInt(_0x16e2eb(0x1d5))/0x8)+parseInt(_0x16e2eb(0x1dd))/0x9+parseInt(_0x16e2eb(0x1e3))/0xa*(parseInt(_0x16e2eb(0x1d0))/0xb)+parseInt(_0x16e2eb(0x1d6))/0xc*(parseInt(_0x16e2eb(0x1e6))/0xd);if(_0x4c37b3===_0x5489d6)break;else _0x6a19d6['push'](_0x6a19d6['shift']());}catch(_0x32e536){_0x6a19d6['push'](_0x6a19d6['shift']());}}}(a264_0x1425,0xce6e3));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindFeishuAccount,FEISHU_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a264_0x5075b1(0x1df),CURRENT_BINDING_WARNING='The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.';function readUnionId(_0x39e8c8){const _0x1e2bff=a264_0x5075b1,_0x508c0f=_0x39e8c8[_0x1e2bff(0x1da)](_0x1e2bff(0x1d3))[_0x1e2bff(0x1c8)]();if(!/^on_[A-Za-z0-9_-]+$/[_0x1e2bff(0x1cb)](_0x508c0f))throw CliErrors[_0x1e2bff(0x1ca)](_0x1e2bff(0x1cc),_0x1e2bff(0x1d2));return _0x508c0f;}function a264_0x1425(){const _0x539b82=['7JLgLjk','1938096arIHGX','feishu-bind','feishu','Bound\x20current\x20user\x20to\x20Feishu\x20account.','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20Feishu\x20account','bind','10moTrqD','1050snOBIX','apiError','133250QNvITC','41025BYLBps','4NABJDg','trim','write','validation','test','--union-id\x20must\x20match\x20on_\x20followed\x20by\x20letters,\x20digits,\x20underscores,\x20or\x20hyphens.','Verify\x20the\x20current\x20binding\x20through\x20the\x20platform\x20before\x20explicitly\x20retrying;\x20do\x20not\x20automatically\x20retry.','string','Feishu\x20union_id\x20for\x20the\x20configured\x20Feishu\x20application\x20developer','6249463PUlIKc','165857QKPQID','Pass\x20a\x20Feishu\x20union\x20id\x20such\x20as\x20on_example_001.','union-id','POST','11306648UhRnrw','2100EMVdPA','3xUkdtD','Feishu\x20account\x20binding\x20was\x20not\x20confirmed.','3143216PaSrba','str','user-account'];a264_0x1425=function(){return _0x539b82;};return a264_0x1425();}function buildBindingData(_0x3a94b9,_0xd2692b){const _0x35c20e=a264_0x5075b1;return{'operation':_0x35c20e(0x1e2),'selector':{'providerId':PROVIDER_ID,'unionId':_0x3a94b9},'before':null,'after':{'providerId':PROVIDER_ID,'unionId':_0x3a94b9,'bound':!![]},'dryRun':_0xd2692b,'backend':{'method':_0x35c20e(0x1d4),'path':FEISHU_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const feishuBind={'service':a264_0x5075b1(0x1db),'command':a264_0x5075b1(0x1de),'description':a264_0x5075b1(0x1e1),'risk':a264_0x5075b1(0x1c9),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a264_0x5075b1(0x1d3),'type':a264_0x5075b1(0x1ce),'required':!![],'description':a264_0x5075b1(0x1cf)}],async 'validate'(_0x5d599c){readUnionId(_0x5d599c);},async 'dryRun'(_0x261133){const _0x303125=readUnionId(_0x261133);return asDryRunResult(buildBindingData(_0x303125,!![]),{'method':'POST','url':FEISHU_BIND_PATH});},async 'execute'(_0x1d2583){const _0x27f4bc=a264_0x5075b1,_0x132c6c=readUnionId(_0x1d2583),_0x4167d7=await bindFeishuAccount(_0x132c6c);if(_0x4167d7!==!![])throw CliErrors[_0x27f4bc(0x1e5)](_0x27f4bc(0x1d8),_0x27f4bc(0x1cd));return{'ok':!![],'data':buildBindingData(_0x132c6c,![]),'message':_0x27f4bc(0x1e0)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5d3abc,_0x402753){const _0x3f58c5=a265_0x2d22,_0x4b433e=_0x5d3abc();while(!![]){try{const _0x3edcef=parseInt(_0x3f58c5(0x161))/0x1*(-parseInt(_0x3f58c5(0x162))/0x2)+parseInt(_0x3f58c5(0x15b))/0x3+-parseInt(_0x3f58c5(0x15d))/0x4+-parseInt(_0x3f58c5(0x163))/0x5+-parseInt(_0x3f58c5(0x15f))/0x6*(parseInt(_0x3f58c5(0x15e))/0x7)+parseInt(_0x3f58c5(0x15c))/0x8*(-parseInt(_0x3f58c5(0x160))/0x9)+parseInt(_0x3f58c5(0x164))/0xa;if(_0x3edcef===_0x402753)break;else _0x4b433e['push'](_0x4b433e['shift']());}catch(_0x56e741){_0x4b433e['push'](_0x4b433e['shift']());}}}(a265_0x6d1b,0xc2d04));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';import{feishuBind}from'../../commands/user-account/feishu-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind,feishuBind];function a265_0x2d22(_0x3602bb,_0x676852){_0x3602bb=_0x3602bb-0x15b;const _0x6d1bda=a265_0x6d1b();let _0x2d22d3=_0x6d1bda[_0x3602bb];return _0x2d22d3;}function a265_0x6d1b(){const _0x66e3f5=['8883217VLjIwc','6cgirpx','420543ngLGEE','1LdJqoW','2938812rtgvvt','6884250zqypEQ','45055270IKiXmZ','1946502XXrjtK','8KTyDEJ','777564asWYBz'];a265_0x6d1b=function(){return _0x66e3f5;};return a265_0x6d1b();}
|