@lovrabet/rabetbase-cli 2.5.11-beta.1 → 2.5.12-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/context.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/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.d.ts +1 -0
- 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.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.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.d.ts +2 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase/references/rabetbase-kb.md +1 -1
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a249_0x2358b1=a249_0x6be0;(function(_0x51785c,_0x113762){const _0x35f285=a249_0x6be0,_0x5ec8c0=_0x51785c();while(!![]){try{const _0x1cff1e=-parseInt(_0x35f285(0x1a7))/0x1*(-parseInt(_0x35f285(0x1b2))/0x2)+-parseInt(_0x35f285(0x1b7))/0x3+parseInt(_0x35f285(0x1a4))/0x4+parseInt(_0x35f285(0x1bb))/0x5*(parseInt(_0x35f285(0x1b5))/0x6)+-parseInt(_0x35f285(0x1aa))/0x7+parseInt(_0x35f285(0x1b9))/0x8+-parseInt(_0x35f285(0x1b0))/0x9;if(_0x1cff1e===_0x113762)break;else _0x5ec8c0['push'](_0x5ec8c0['shift']());}catch(_0x49a412){_0x5ec8c0['push'](_0x5ec8c0['shift']());}}}(a249_0x290e,0x831e2));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a249_0x290e(){const _0xa1d56c=['3712856qvxcEP','appCode','bool','sqlContent','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','verbose','7623108teWkPM','str','62XcbLFs','Return\x20full\x20raw\x20SQL\x20query\x20object','sql','250266WEmAmt','read','1614150CaXCmR','detail','7191672dPmaew','description','85YNtTsy','3291748QyJufS','boolean','sqlName','695xrwcpz','dbId','sqlcode'];a249_0x290e=function(){return _0xa1d56c;};return a249_0x290e();}function a249_0x6be0(_0x370a57,_0x15da48){_0x370a57=_0x370a57-0x1a4;const _0x290ee0=a249_0x290e();let _0x6be0ea=_0x290ee0[_0x370a57];return _0x6be0ea;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a249_0x2358b1(0x1b4),'command':a249_0x2358b1(0x1b8),'description':a249_0x2358b1(0x1ae),'risk':a249_0x2358b1(0x1b6),'flags':[SQLCODE_FLAG,{'name':a249_0x2358b1(0x1af),'type':a249_0x2358b1(0x1a5),'description':a249_0x2358b1(0x1b3)}],async 'execute'(_0x1c410e){const _0x11934f=a249_0x2358b1,_0x283b2c=await getSqlQueryInfo(_0x1c410e[_0x11934f(0x1ab)],_0x1c410e[_0x11934f(0x1b1)](_0x11934f(0x1a9))),_0x79ede5=_0x1c410e[_0x11934f(0x1ac)]('verbose');if(_0x79ede5)return{'ok':!![],'data':_0x283b2c};const _0xa0b80d=_0x283b2c[_0x11934f(0x1a8)]?await getDbName(_0x1c410e[_0x11934f(0x1ab)],_0x283b2c[_0x11934f(0x1a8)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x283b2c['sqlCode'],'sqlName':_0x283b2c[_0x11934f(0x1a6)],'db':_0xa0b80d?_0xa0b80d+'\x20('+_0x283b2c[_0x11934f(0x1a8)]+')':_0x283b2c[_0x11934f(0x1a8)]??'','description':_0x283b2c[_0x11934f(0x1ba)]??'','sqlContent':_0x283b2c[_0x11934f(0x1ad)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a250_0x491de2=a250_0x24b5;(function(_0x219687,_0xca23c3){const _0x498692=a250_0x24b5,_0x3a4fc3=_0x219687();while(!![]){try{const _0x4080dd=-parseInt(_0x498692(0x17c))/0x1+parseInt(_0x498692(0x176))/0x2*(parseInt(_0x498692(0x17a))/0x3)+-parseInt(_0x498692(0x16c))/0x4+-parseInt(_0x498692(0x16b))/0x5*(-parseInt(_0x498692(0x183))/0x6)+parseInt(_0x498692(0x179))/0x7+-parseInt(_0x498692(0x174))/0x8*(-parseInt(_0x498692(0x172))/0x9)+parseInt(_0x498692(0x17d))/0xa*(parseInt(_0x498692(0x175))/0xb);if(_0x4080dd===_0xca23c3)break;else _0x3a4fc3['push'](_0x3a4fc3['shift']());}catch(_0x261e9a){_0x3a4fc3['push'](_0x3a4fc3['shift']());}}}(a250_0xb7c3,0xa1b66));function a250_0x24b5(_0x16deb1,_0x5b4175){_0x16deb1=_0x16deb1-0x16b;const _0xb7c388=a250_0xb7c3();let _0x24b53e=_0xb7c388[_0x16deb1];return _0x24b53e;}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a250_0xb7c3(){const _0x3ea492=['execResult','958746syXXQW','isArray','5oLSigy','3229884jJYBEw','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','Returned\x20','read','params','exec','505854kSVhHi','execSuccess','32HbIJTl','77BwvzlJ','2yfOBGG','SQL\x20execution\x20failed','\x20row(s)\x20in\x20','272251CIjrCc','1002477haxavO','string','602849csqYAa','1878610sDgNsx','now','str','execError','sqlcode'];a250_0xb7c3=function(){return _0x3ea492;};return a250_0xb7c3();}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':a250_0x491de2(0x171),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a250_0x491de2(0x16f),'flags':[SQLCODE_FLAG,{'name':a250_0x491de2(0x170),'type':a250_0x491de2(0x17b),'description':a250_0x491de2(0x16d)}],async 'execute'(_0x15bd1d){const _0x33e01f=a250_0x491de2,_0xf429c2=parseJsonParams(_0x15bd1d[_0x33e01f(0x17f)]('params')),_0x15eedb=Date[_0x33e01f(0x17e)](),_0x37d199=await executeSql(_0x15bd1d['appCode'],_0x15bd1d[_0x33e01f(0x17f)](_0x33e01f(0x181)),_0xf429c2),_0x4ca653=Date[_0x33e01f(0x17e)]()-_0x15eedb,_0x116e77=_0x37d199?.[_0x33e01f(0x182)]??_0x37d199,_0x268da5=_0x37d199?.[_0x33e01f(0x173)]??!![];if(!_0x268da5)return{'ok':![],'data':{'error':_0x37d199?.[_0x33e01f(0x180)]||_0x33e01f(0x177),'elapsed':_0x4ca653},'message':'SQL\x20execution\x20failed'};const _0xe8efcf=Array[_0x33e01f(0x184)](_0x116e77)?_0x116e77:[];return{'ok':!![],'data':{'rows':_0xe8efcf,'rowCount':_0xe8efcf['length'],'elapsed':_0x4ca653},'message':_0x33e01f(0x16e)+_0xe8efcf['length']+_0x33e01f(0x178)+_0x4ca653+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x37110f,_0x321789){const _0x588fdf=a251_0x2b96,_0x5c78c2=_0x37110f();while(!![]){try{const _0x7f5898=parseInt(_0x588fdf(0xdc))/0x1+parseInt(_0x588fdf(0xdd))/0x2+parseInt(_0x588fdf(0xd9))/0x3*(parseInt(_0x588fdf(0xd8))/0x4)+-parseInt(_0x588fdf(0xd7))/0x5+-parseInt(_0x588fdf(0xda))/0x6+-parseInt(_0x588fdf(0xde))/0x7+parseInt(_0x588fdf(0xdb))/0x8;if(_0x7f5898===_0x321789)break;else _0x5c78c2['push'](_0x5c78c2['shift']());}catch(_0x3d4840){_0x5c78c2['push'](_0x5c78c2['shift']());}}}(a251_0xcd6a,0x43f2d));import{sqlList}from'../../commands/sql/list.js';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';function a251_0xcd6a(){const _0x598ef6=['889539CtWtpu','602115vTDpUU','8uNqnYb','58965twMZTL','1081650Wpewcp','2052648cOUqFq','334818DcrlUg','150766JuvSjy'];a251_0xcd6a=function(){return _0x598ef6;};return a251_0xcd6a();}function a251_0x2b96(_0x3fc200,_0x23ff95){_0x3fc200=_0x3fc200-0xd7;const _0xcd6a7e=a251_0xcd6a();let _0x2b96e4=_0xcd6a7e[_0x3fc200];return _0x2b96e4;}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
|
-
|
|
1
|
+
function a252_0x268d(_0x17a24,_0x91486f){_0x17a24=_0x17a24-0x1c4;const _0xc924f7=a252_0xc924();let _0x268dc1=_0xc924f7[_0x17a24];return _0x268dc1;}const a252_0xf44a16=a252_0x268d;function a252_0xc924(){const _0x43e0f1=['verbose','all','num','List\x20custom\x20SQL\x20queries','66849CAbfVD','487990dRGVcJ','str','map','sql','\x20SQL\x20queries\x20(total:\x20','read','bool','appCode','dbId','string','1702028eLYZqG','Page\x20number','tableData','203jtmWqX','9kGUULa','sqlCode','totalCount','length','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','7880895lesmmw','196408XYEEUc','No\x20custom\x20SQL\x20queries\x20found.','Page\x20size','number','sqlName','boolean','paging','page','sqlcode','6ppMLRp','Found\x20','2684545pxlkMc','pagesize','1CtYiyR','description','name','4xwjKfQ','26760540YIXDSG'];a252_0xc924=function(){return _0x43e0f1;};return a252_0xc924();}(function(_0x272e47,_0x2e0413){const _0x5f4ec2=a252_0x268d,_0x2e4eda=_0x272e47();while(!![]){try{const _0x2482da=-parseInt(_0x5f4ec2(0x1cb))/0x1*(-parseInt(_0x5f4ec2(0x1df))/0x2)+-parseInt(_0x5f4ec2(0x1d4))/0x3*(parseInt(_0x5f4ec2(0x1ce))/0x4)+-parseInt(_0x5f4ec2(0x1c9))/0x5*(-parseInt(_0x5f4ec2(0x1c7))/0x6)+parseInt(_0x5f4ec2(0x1e2))/0x7*(parseInt(_0x5f4ec2(0x1e9))/0x8)+parseInt(_0x5f4ec2(0x1e3))/0x9*(-parseInt(_0x5f4ec2(0x1d5))/0xa)+parseInt(_0x5f4ec2(0x1e8))/0xb+-parseInt(_0x5f4ec2(0x1cf))/0xc;if(_0x2482da===_0x2e0413)break;else _0x2e4eda['push'](_0x2e4eda['shift']());}catch(_0x39990a){_0x2e4eda['push'](_0x2e4eda['shift']());}}}(a252_0xc924,0x7dc94));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_0xf44a16(0x1d8),'command':'list','description':a252_0xf44a16(0x1d3),'risk':a252_0xf44a16(0x1da),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a252_0xf44a16(0x1cd),'type':a252_0xf44a16(0x1de),'description':'Filter\x20by\x20SQL\x20name'},{'name':a252_0xf44a16(0x1c5),'type':a252_0xf44a16(0x1ec),'description':a252_0xf44a16(0x1e0),'default':0x1},{'name':a252_0xf44a16(0x1ca),'type':a252_0xf44a16(0x1ec),'description':a252_0xf44a16(0x1eb)},{'name':'verbose','type':a252_0xf44a16(0x1ee),'description':a252_0xf44a16(0x1e7)}],async 'execute'(_0x15f414){const _0xb51bc=a252_0xf44a16,_0x58f266=await listSqlQueries(_0x15f414[_0xb51bc(0x1dc)],{'sqlCode':_0x15f414[_0xb51bc(0x1d6)](_0xb51bc(0x1c6))||undefined,'sqlName':_0x15f414[_0xb51bc(0x1d6)](_0xb51bc(0x1cd))||undefined,'currentPage':_0x15f414[_0xb51bc(0x1d2)](_0xb51bc(0x1c5)),'pageSize':_0x15f414['num'](_0xb51bc(0x1ca),0x32)}),_0x5cbe85=_0x15f414[_0xb51bc(0x1db)](_0xb51bc(0x1d0)),_0x3c727e=_0x58f266[_0xb51bc(0x1e1)]??[],_0x12f141=_0x58f266[_0xb51bc(0x1c4)]?.[_0xb51bc(0x1e5)]??_0x3c727e[_0xb51bc(0x1e6)];let _0x2b3b6c;return _0x5cbe85?_0x2b3b6c=_0x3c727e:_0x2b3b6c=await Promise[_0xb51bc(0x1d1)](_0x3c727e[_0xb51bc(0x1d7)](async _0x4150ba=>{const _0x560a79=_0xb51bc;let _0x3fffbf;try{_0x3fffbf=_0x4150ba['dbId']?await getDbName(_0x15f414[_0x560a79(0x1dc)],_0x4150ba[_0x560a79(0x1dd)]):undefined;}catch{}return{'sqlCode':_0x4150ba[_0x560a79(0x1e4)],'sqlName':_0x4150ba[_0x560a79(0x1ed)],'description':_0x4150ba[_0x560a79(0x1cc)]??'','db':_0x3fffbf?_0x3fffbf+'\x20('+_0x4150ba[_0x560a79(0x1dd)]+')':_0x4150ba[_0x560a79(0x1dd)]??''};})),{'ok':!![],'data':_0x2b3b6c,'message':_0x3c727e['length']===0x0?_0xb51bc(0x1ea):_0xb51bc(0x1c8)+_0x3c727e[_0xb51bc(0x1e6)]+_0xb51bc(0x1d9)+_0x12f141+').'};}};
|
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a253_0x42326f=a253_0xfdbc;(function(_0xa06f62,_0x425d35){const _0x4593e5=a253_0xfdbc,_0x411d58=_0xa06f62();while(!![]){try{const _0x130234=-parseInt(_0x4593e5(0x205))/0x1*(parseInt(_0x4593e5(0x1d0))/0x2)+-parseInt(_0x4593e5(0x1eb))/0x3+parseInt(_0x4593e5(0x1f4))/0x4*(-parseInt(_0x4593e5(0x1c4))/0x5)+-parseInt(_0x4593e5(0x1cd))/0x6*(-parseInt(_0x4593e5(0x1bf))/0x7)+parseInt(_0x4593e5(0x1e9))/0x8+-parseInt(_0x4593e5(0x1e1))/0x9+-parseInt(_0x4593e5(0x1f2))/0xa*(-parseInt(_0x4593e5(0x1ca))/0xb);if(_0x130234===_0x425d35)break;else _0x411d58['push'](_0x411d58['shift']());}catch(_0x237e64){_0x411d58['push'](_0x411d58['shift']());}}}(a253_0x2ce7,0x31238));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';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(_0x3b64e2,_0x3bdff6){const _0x2bd64e=a253_0xfdbc,_0x372f8b=[];let _0x2331f4=0x1;while(!![]){const _0x1cd815=await listSqlQueries(_0x3b64e2,{'currentPage':_0x2331f4,'pageSize':PAGE_SIZE,'sqlCode':_0x3bdff6[_0x2bd64e(0x1f0)],'sqlName':_0x3bdff6[_0x2bd64e(0x1dd)]}),_0x314e9c=_0x1cd815[_0x2bd64e(0x1c7)]??[];_0x372f8b['push'](..._0x314e9c);if(_0x314e9c[_0x2bd64e(0x1d9)]===0x0)break;const _0x2754dd=_0x1cd815[_0x2bd64e(0x1d1)]?.[_0x2bd64e(0x1d8)];if(_0x2754dd!=null?_0x372f8b[_0x2bd64e(0x1d9)]>=_0x2754dd:_0x314e9c[_0x2bd64e(0x1d9)]<PAGE_SIZE)break;_0x2331f4++;}return _0x372f8b;}async function ensureSqlContent(_0x57934f){const _0x58a96e=a253_0xfdbc;if(_0x57934f[_0x58a96e(0x1c6)]!=null&&String(_0x57934f[_0x58a96e(0x1c6)])[_0x58a96e(0x1d9)]>0x0)return _0x57934f;return getSqlQueryDetail(_0x57934f['sqlCode']);}export const sqlPull={'service':'sql','command':a253_0x42326f(0x1ed),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a253_0x42326f(0x1ef),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a253_0x42326f(0x1fd),'type':a253_0x42326f(0x1d4),'description':a253_0x42326f(0x204)},{'name':a253_0x42326f(0x1de),'type':a253_0x42326f(0x1e5),'description':a253_0x42326f(0x1cc)}],async 'dryRun'(_0x3622a2){const _0x943b0b=a253_0x42326f,_0x42143e=loadSqlProjectConfig(_0x3622a2[_0x943b0b(0x1c5)]),_0x410851=await readSqlLockFile(_0x42143e['lockFilePath']),{appLock:_0xac21e6}=ensureSqlLockScope(_0x410851??createEmptySqlLock(),_0x42143e['appCode'],_0x42143e[_0x943b0b(0x1ee)],_0x943b0b(0x1ed)),_0x581480=await fetchAllSqlQueries(_0x3622a2[_0x943b0b(0x1c5)],{'sqlCode':_0x3622a2['str'](_0x943b0b(0x1ba))||undefined,'sqlName':_0x3622a2[_0x943b0b(0x1d6)](_0x943b0b(0x1fd))||undefined}),_0x55d30b=[];for(const _0x4a212a of _0x581480){const _0x12e525=await ensureSqlContent(_0x4a212a),_0x121ec0=ensureRemoteSqlContent(_0x12e525),_0x11b7c=detectSqlMode(_0x121ec0),_0x272c22=_0x12e525[_0x943b0b(0x200)]?await getDbName(_0x3622a2[_0x943b0b(0x1c5)],Number(_0x12e525[_0x943b0b(0x200)]))[_0x943b0b(0x1ec)](()=>undefined):undefined,_0x5e3ed5=buildLocalSqlFileContent({'sqlCode':_0x12e525[_0x943b0b(0x1f0)],'sqlName':_0x12e525[_0x943b0b(0x1dd)],'dbId':_0x12e525[_0x943b0b(0x200)]},_0x121ec0,{'dbName':_0x272c22,'mode':_0x11b7c,'syncedAt':new Date()[_0x943b0b(0x1e8)](),'description':_0x12e525[_0x943b0b(0x1bc)]}),_0x11d31d=buildSqlLockEntry(_0x12e525,_0x121ec0,'',{'dbName':_0x272c22}),_0x3408b4=resolveLocalSqlFilePath(_0x42143e,_0x12e525[_0x943b0b(0x1f0)],_0x11d31d);let _0x277ca8=_0x943b0b(0x1c8),_0xe6fd1e;const _0x960ddc=await findExistingSqlFiles(_0x42143e,_0x3408b4,_0x11b7c,_0xac21e6[_0x943b0b(0x1df)][_0x12e525[_0x943b0b(0x1f0)]]);if(_0x960ddc['length']>0x0){const _0x1fe851=await compareExistingSqlFiles(_0x960ddc,_0x5e3ed5,_0x11b7c);if(_0x1fe851[_0x943b0b(0x1b9)](({equivalent:_0x3f130d})=>!_0x3f130d))_0x277ca8=_0x943b0b(0x1e3),_0xe6fd1e=_0x943b0b(0x203);else _0x1fe851[_0x943b0b(0x1d9)]===0x1&&_0x1fe851[0x0]?.['file'][_0x943b0b(0x1d7)]&&(_0x277ca8=_0x943b0b(0x1fa),_0xe6fd1e=_0x943b0b(0x1e6));}_0x55d30b[_0x943b0b(0x1ce)]({'sqlCode':_0x12e525[_0x943b0b(0x1f0)],'sqlName':_0x12e525['sqlName'],'filePath':_0x3408b4,'status':_0x277ca8,'reason':_0xe6fd1e});}return{'method':_0x943b0b(0x1ea),'url':_0x943b0b(0x1f1),'body':{'appCode':_0x3622a2[_0x943b0b(0x1c5)],'sqlCode':_0x3622a2['str'](_0x943b0b(0x1ba))||null,'sqlName':_0x3622a2[_0x943b0b(0x1d6)](_0x943b0b(0x1fd))||null,'files':_0x55d30b},'description':_0x943b0b(0x1da)+_0x55d30b[_0x943b0b(0x1d9)]+_0x943b0b(0x1cf)+_0x42143e[_0x943b0b(0x202)]};},async 'execute'(_0x5bf717){const _0x8207a9=a253_0x42326f,_0x36fdf3=loadSqlProjectConfig(_0x5bf717[_0x8207a9(0x1c5)]),_0x53c8f0=await readSqlLockFile(_0x36fdf3[_0x8207a9(0x1bb)]),{lockData:_0x44d74e,appLock:_0x323f08}=ensureSqlLockScope(_0x53c8f0??createEmptySqlLock(),_0x36fdf3['appCode'],_0x36fdf3[_0x8207a9(0x1ee)],'pull'),_0x33867a=_0x5bf717[_0x8207a9(0x1fc)](_0x8207a9(0x1de)),_0x58f8b8=await fetchAllSqlQueries(_0x5bf717['appCode'],{'sqlCode':_0x5bf717[_0x8207a9(0x1d6)](_0x8207a9(0x1ba))||undefined,'sqlName':_0x5bf717[_0x8207a9(0x1d6)](_0x8207a9(0x1fd))||undefined});if(_0x58f8b8[_0x8207a9(0x1d9)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x8207a9(0x1e7)};const _0x4d1301=[],_0x39af0f=[];for(const _0x57ab4c of _0x58f8b8){try{_0x4d1301[_0x8207a9(0x1ce)](await ensureSqlContent(_0x57ab4c));}catch(_0x1334a4){_0x39af0f['push']({'sqlCode':_0x57ab4c[_0x8207a9(0x1f0)],'error':_0x1334a4 instanceof Error?_0x1334a4['message']:String(_0x1334a4)});}}if(_0x33867a&&!_0x5bf717[_0x8207a9(0x1e0)]){let _0x30b547=![];for(const _0x4ef1b8 of _0x4d1301){const _0x4f6a6b=detectSqlMode(ensureRemoteSqlContent(_0x4ef1b8)),_0x4373b3=_0x4ef1b8[_0x8207a9(0x200)]?await getDbName(_0x5bf717[_0x8207a9(0x1c5)],Number(_0x4ef1b8[_0x8207a9(0x200)]))[_0x8207a9(0x1ec)](()=>undefined):undefined,_0x2f8b5f=buildLocalSqlFileContent({'sqlCode':_0x4ef1b8['sqlCode'],'sqlName':_0x4ef1b8['sqlName'],'dbId':_0x4ef1b8[_0x8207a9(0x200)]},ensureRemoteSqlContent(_0x4ef1b8),{'dbName':_0x4373b3,'mode':_0x4f6a6b,'syncedAt':new Date()[_0x8207a9(0x1e8)](),'description':_0x4ef1b8[_0x8207a9(0x1bc)]}),_0x209bde=resolveLocalSqlFilePath(_0x36fdf3,_0x4ef1b8['sqlCode'],buildSqlLockEntry(_0x4ef1b8,ensureRemoteSqlContent(_0x4ef1b8),'',{'dbName':_0x4373b3})),_0x5c3c7e=await findExistingSqlFiles(_0x36fdf3,_0x209bde,_0x4f6a6b,_0x323f08[_0x8207a9(0x1df)][_0x4ef1b8[_0x8207a9(0x1f0)]]),_0x2d5840=await compareExistingSqlFiles(_0x5c3c7e,_0x2f8b5f,_0x4f6a6b);if(_0x2d5840['some'](({equivalent:_0x4a150f})=>!_0x4a150f)){_0x30b547=!![];break;}}if(_0x30b547){const _0x551dd0=await confirmForceOverwrite(_0x8207a9(0x1c0));if(!_0x551dd0)throw CliErrors[_0x8207a9(0x1f3)](_0x8207a9(0x1c2));}}const _0x1fdc99=cloneSqlLockData(_0x44d74e),_0x9b5c15=_0x1fdc99[_0x8207a9(0x1dc)][_0x36fdf3[_0x8207a9(0x1c5)]],_0x452351=[],_0x14b46e=[];for(const _0x194e3d of _0x4d1301){const _0x3de197=_0x9b5c15[_0x8207a9(0x1df)][_0x194e3d[_0x8207a9(0x1f0)]],_0x5f21a4=ensureRemoteSqlContent(_0x194e3d),_0x115d2e=detectSqlMode(_0x5f21a4),_0x337ef4=_0x194e3d[_0x8207a9(0x200)]?await getDbName(_0x5bf717[_0x8207a9(0x1c5)],Number(_0x194e3d['dbId']))[_0x8207a9(0x1ec)](()=>undefined):undefined,_0x3d0974=buildLocalSqlFileContent({'sqlCode':_0x194e3d[_0x8207a9(0x1f0)],'sqlName':_0x194e3d[_0x8207a9(0x1dd)],'dbId':_0x194e3d['dbId']},_0x5f21a4,{'dbName':_0x337ef4,'mode':_0x115d2e,'syncedAt':new Date()[_0x8207a9(0x1e8)](),'description':_0x194e3d[_0x8207a9(0x1bc)]}),_0x3b6c66=buildSqlLockEntry(_0x194e3d,_0x5f21a4,computeSqlContentHash(_0x3d0974),{'dbName':_0x337ef4}),_0x2018e8=_0x3b6c66['path'],_0x29e1e6=join(_0x36fdf3[_0x8207a9(0x202)],_0x2018e8);try{const _0x39263d=await findExistingSqlFiles(_0x36fdf3,_0x29e1e6,_0x115d2e,_0x3de197),_0xa83f31=await compareExistingSqlFiles(_0x39263d,_0x3d0974,_0x115d2e);if(!_0x33867a&&_0xa83f31['some'](({equivalent:_0x1d7736})=>!_0x1d7736)){_0x14b46e[_0x8207a9(0x1ce)]({'sqlCode':_0x194e3d[_0x8207a9(0x1f0)],'reason':'local\x20differs\x20from\x20remote'});continue;}const _0x546240=_0xa83f31['find'](({file:_0x6510cc})=>_0x6510cc[_0x8207a9(0x1d7)]),_0x222911=_0xa83f31[_0x8207a9(0x1fe)](({file:_0x5721b9})=>!_0x5721b9[_0x8207a9(0x1d7)]);if(_0x546240?.[_0x8207a9(0x206)]&&!_0x222911){_0x14b46e['push']({'sqlCode':_0x194e3d['sqlCode'],'reason':'unchanged'}),_0x9b5c15[_0x8207a9(0x1df)][_0x194e3d[_0x8207a9(0x1f0)]]={..._0x3b6c66,'hash':computeSqlContentHash(_0x546240[_0x8207a9(0x1c1)]),'path':_0x2018e8};continue;}!_0x546240?.['equivalent']&&(await ensureParentDirectory(_0x29e1e6),await writeFile(_0x29e1e6,_0x3d0974,_0x8207a9(0x1d5))),_0x222911&&await rm(_0x222911[_0x8207a9(0x1db)][_0x8207a9(0x201)],{'force':!![]}),_0x9b5c15[_0x8207a9(0x1df)][_0x194e3d[_0x8207a9(0x1f0)]]={..._0x3b6c66,'hash':_0x546240?.[_0x8207a9(0x206)]?computeSqlContentHash(_0x546240[_0x8207a9(0x1c1)]):_0x3b6c66[_0x8207a9(0x1f8)],'path':_0x2018e8},_0x452351[_0x8207a9(0x1ce)]({'sqlCode':_0x194e3d[_0x8207a9(0x1f0)],'filePath':_0x29e1e6});}catch(_0x33dd53){_0x39af0f[_0x8207a9(0x1ce)]({'sqlCode':_0x194e3d[_0x8207a9(0x1f0)],'error':_0x33dd53 instanceof Error?_0x33dd53[_0x8207a9(0x1fb)]:String(_0x33dd53)});}}return _0x9b5c15['lastSync']=new Date()[_0x8207a9(0x1e8)](),await writeSqlLockFile(_0x36fdf3[_0x8207a9(0x1bb)],_0x1fdc99),{'ok':_0x39af0f[_0x8207a9(0x1d9)]===0x0,'data':{'pulled':_0x452351,'skipped':_0x14b46e,'failed':_0x39af0f},'message':'Pull\x20complete:\x20'+_0x452351[_0x8207a9(0x1d9)]+_0x8207a9(0x1e2)+_0x14b46e[_0x8207a9(0x1d9)]+_0x8207a9(0x1f5)+_0x39af0f[_0x8207a9(0x1d9)]+_0x8207a9(0x1f9)};}};function isEquivalentPulledSqlFile(_0x366d53,_0x1ed986,_0x742f95,_0x31acc1){if(_0x742f95!==_0x31acc1)return normalizePulledSqlBody(_0x366d53,_0x742f95)===normalizePulledSqlBody(_0x1ed986,_0x31acc1);return normalizePullComparableContent(_0x366d53,_0x742f95)===normalizePullComparableContent(_0x1ed986,_0x31acc1);}async function findExistingSqlFiles(_0x130a1b,_0x29b35a,_0x390bf6,_0x2b7cde){const _0x544372=a253_0x42326f,_0x15a255=[];await fileExists(_0x29b35a)&&_0x15a255[_0x544372(0x1ce)]({'filePath':_0x29b35a,'mode':_0x390bf6,'isCanonical':!![]});if(!_0x2b7cde?.[_0x544372(0x1e4)])return _0x15a255;const _0x4c460b=join(_0x130a1b[_0x544372(0x202)],_0x2b7cde['path']);if(_0x4c460b===_0x29b35a)return _0x15a255;return await fileExists(_0x4c460b)&&_0x15a255['push']({'filePath':_0x4c460b,'mode':_0x2b7cde[_0x544372(0x1be)]??modeFromFilePath(_0x4c460b),'isCanonical':![]}),_0x15a255;}function a253_0xfdbc(_0x4f8401,_0x97c7f1){_0x4f8401=_0x4f8401-0x1b9;const _0x2ce706=a253_0x2ce7();let _0xfdbcf7=_0x2ce706[_0x4f8401];return _0xfdbcf7;}async function compareExistingSqlFiles(_0x4eb718,_0x4ce404,_0x5e237f){const _0x590cb6=a253_0x42326f;return Promise['all'](_0x4eb718[_0x590cb6(0x1d3)](async _0x4e8031=>{const _0x2475cd=_0x590cb6,_0x46862c=await readFile(_0x4e8031['filePath'],_0x2475cd(0x1d5));return{'file':_0x4e8031,'content':_0x46862c,'equivalent':isEquivalentPulledSqlFile(_0x46862c,_0x4ce404,_0x4e8031[_0x2475cd(0x1be)],_0x5e237f)};}));}function a253_0x2ce7(){const _0x57d778=['bool','name','find','test','dbId','filePath','sqlRootDir','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','Filter\x20by\x20SQL\x20display\x20name','19jrYegS','equivalent','some','sqlcode','lockFilePath','description','trim','mode','1404683eEPzuj','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','content','Force\x20pull\x20cancelled.','endsWith','2955XNhTWh','appCode','sqlContent','tableData','would_pull','filter','242vHbQjP','mybatisXml','Force\x20overwrite\x20local\x20unsynced\x20changes','6JZYTem','push','\x20SQL\x20file(s)\x20into\x20','6430KBgxfC','paging','split','map','string','utf8','str','isCanonical','totalCount','length','Would\x20pull\x20','file','apps','sqlName','force','sqls','nonInteractive','285444yStxIT','\x20written,\x20','conflict','path','boolean','unchanged','No\x20remote\x20SQL\x20queries\x20matched.','toISOString','2850416OjXeMh','POST','686325XjgZzn','catch','pull','sqlRoot','read','sqlCode','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','116390vxcsuw','cancelled','1964BUKYyj','\x20skipped,\x20','toLowerCase','replace','hash','\x20failed','skipped','message'];a253_0x2ce7=function(){return _0x57d778;};return a253_0x2ce7();}function modeFromFilePath(_0x1846f6){const _0x194185=a253_0x42326f;return _0x1846f6[_0x194185(0x1f6)]()[_0x194185(0x1c3)]('.xml')?_0x194185(0x1cb):'sql';}function normalizePulledSqlBody(_0x1f740f,_0x108f9e){const _0x1121a2=a253_0x42326f;return stripLocalSqlMetadata(_0x1f740f,_0x108f9e)['replace'](/\r\n/g,'\x0a')[_0x1121a2(0x1bd)]();}function normalizePullComparableContent(_0x3b11f9,_0x32bfa6){const _0xf17d69=a253_0x42326f,_0x75b7a9=_0x3b11f9[_0xf17d69(0x1f7)](/\r\n/g,'\x0a')[_0xf17d69(0x1d2)]('\x0a'),_0x3c1996=_0x75b7a9[_0xf17d69(0x1c9)](_0x5d0215=>!isSyncedAtMetadataLine(_0x5d0215,_0x32bfa6));return _0x3c1996['join']('\x0a');}function isSyncedAtMetadataLine(_0x5c45e1,_0x520763){const _0x5af6bd=a253_0x42326f;if(_0x520763==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x5af6bd(0x1ff)](_0x5c45e1);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x5af6bd(0x1ff)](_0x5c45e1);}
|
|
1
|
+
const a253_0x113200=a253_0x287d;(function(_0x5e5a45,_0xc02bf2){const _0x491977=a253_0x287d,_0x4446de=_0x5e5a45();while(!![]){try{const _0x342dc3=-parseInt(_0x491977(0x182))/0x1+parseInt(_0x491977(0x157))/0x2*(parseInt(_0x491977(0x16b))/0x3)+parseInt(_0x491977(0x153))/0x4+-parseInt(_0x491977(0x184))/0x5+-parseInt(_0x491977(0x155))/0x6*(parseInt(_0x491977(0x154))/0x7)+parseInt(_0x491977(0x169))/0x8*(-parseInt(_0x491977(0x14e))/0x9)+parseInt(_0x491977(0x170))/0xa*(parseInt(_0x491977(0x17f))/0xb);if(_0x342dc3===_0xc02bf2)break;else _0x4446de['push'](_0x4446de['shift']());}catch(_0x343967){_0x4446de['push'](_0x4446de['shift']());}}}(a253_0x48fa,0xdb3ef));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';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(_0x426bbb,_0x35c980){const _0x2928f3=a253_0x287d,_0x2eb322=[];let _0x193cee=0x1;while(!![]){const _0x32eab0=await listSqlQueries(_0x426bbb,{'currentPage':_0x193cee,'pageSize':PAGE_SIZE,'sqlCode':_0x35c980[_0x2928f3(0x18e)],'sqlName':_0x35c980[_0x2928f3(0x162)]}),_0xe92d65=_0x32eab0['tableData']??[];_0x2eb322[_0x2928f3(0x185)](..._0xe92d65);if(_0xe92d65[_0x2928f3(0x172)]===0x0)break;const _0x1c5d2d=_0x32eab0['paging']?.[_0x2928f3(0x152)];if(_0x1c5d2d!=null?_0x2eb322[_0x2928f3(0x172)]>=_0x1c5d2d:_0xe92d65['length']<PAGE_SIZE)break;_0x193cee++;}return _0x2eb322;}async function ensureSqlContent(_0x55edc2){const _0x2f92ef=a253_0x287d;if(_0x55edc2['sqlContent']!=null&&String(_0x55edc2[_0x2f92ef(0x18a)])['length']>0x0)return _0x55edc2;return getSqlQueryDetail(_0x55edc2[_0x2f92ef(0x18e)]);}function a253_0x48fa(){const _0x21d344=['lockFilePath','string','POST','unchanged','replace','filePath','Filter\x20by\x20SQL\x20display\x20name','trim','appCode','boolean','sqlName','apps','dbId','some','sqlcode','\x20failed','isCanonical','120IHioQH','pull','2608437ujlMVZ','lastSync','path','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','content','13517260bHljEd','sqls','length','test','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','Force\x20pull\x20cancelled.','equivalent','description','catch','Force\x20overwrite\x20local\x20unsynced\x20changes','toISOString','No\x20remote\x20SQL\x20queries\x20matched.','skipped','str','mode','22OHSYMC','would_pull','cancelled','710817gemynB','Pull\x20complete:\x20','7792945eMBZtS','push','map','.xml','sqlRootDir','sql','sqlContent','mybatisXml','force','Would\x20pull\x20','sqlCode','nonInteractive','hash','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sqlRoot','utf8','bool','conflict','\x20SQL\x20file(s)\x20into\x20','name','601362TLXpMs','join','message','file','totalCount','3495348oMOsAd','3227KkMWWG','3606AAysPi','find','2dioIVX'];a253_0x48fa=function(){return _0x21d344;};return a253_0x48fa();}export const sqlPull={'service':a253_0x113200(0x189),'command':a253_0x113200(0x16a),'description':a253_0x113200(0x174),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a253_0x113200(0x14d),'type':a253_0x113200(0x159),'description':a253_0x113200(0x15e)},{'name':a253_0x113200(0x18c),'type':a253_0x113200(0x161),'description':a253_0x113200(0x179)}],async 'dryRun'(_0x235b96){const _0x3e2f24=a253_0x113200,_0x8be9d1=loadSqlProjectConfig(_0x235b96['appCode']),_0x2d8b5e=await readSqlLockFile(_0x8be9d1[_0x3e2f24(0x158)]),{appLock:_0x28d7e7}=ensureSqlLockScope(_0x2d8b5e??createEmptySqlLock(),_0x8be9d1[_0x3e2f24(0x160)],_0x8be9d1[_0x3e2f24(0x148)],_0x3e2f24(0x16a)),_0x293cd0=await fetchAllSqlQueries(_0x235b96[_0x3e2f24(0x160)],{'sqlCode':_0x235b96[_0x3e2f24(0x17d)](_0x3e2f24(0x166))||undefined,'sqlName':_0x235b96[_0x3e2f24(0x17d)]('name')||undefined}),_0x113e80=[];for(const _0x5f2ec0 of _0x293cd0){const _0x266ebd=await ensureSqlContent(_0x5f2ec0),_0x8dc059=ensureRemoteSqlContent(_0x266ebd),_0x53a6c8=detectSqlMode(_0x8dc059),_0x44404e=_0x266ebd[_0x3e2f24(0x164)]?await getDbName(_0x235b96[_0x3e2f24(0x160)],Number(_0x266ebd[_0x3e2f24(0x164)]))['catch'](()=>undefined):undefined,_0xb145b3=buildLocalSqlFileContent({'sqlCode':_0x266ebd[_0x3e2f24(0x18e)],'sqlName':_0x266ebd['sqlName'],'dbId':_0x266ebd[_0x3e2f24(0x164)]},_0x8dc059,{'dbName':_0x44404e,'mode':_0x53a6c8,'syncedAt':new Date()[_0x3e2f24(0x17a)](),'description':_0x266ebd['description']}),_0x1fd4d9=buildSqlLockEntry(_0x266ebd,_0x8dc059,'',{'dbName':_0x44404e}),_0x3da1e2=resolveLocalSqlFilePath(_0x8be9d1,_0x266ebd[_0x3e2f24(0x18e)],_0x1fd4d9);let _0x45dbf7=_0x3e2f24(0x180),_0x3ccc38;const _0x144a2b=await findExistingSqlFiles(_0x8be9d1,_0x3da1e2,_0x53a6c8,_0x28d7e7['sqls'][_0x266ebd['sqlCode']]);if(_0x144a2b[_0x3e2f24(0x172)]>0x0){const _0x1e63b1=await compareExistingSqlFiles(_0x144a2b,_0xb145b3,_0x53a6c8);if(_0x1e63b1['some'](({equivalent:_0x22eee3})=>!_0x22eee3))_0x45dbf7=_0x3e2f24(0x14b),_0x3ccc38=_0x3e2f24(0x147);else _0x1e63b1[_0x3e2f24(0x172)]===0x1&&_0x1e63b1[0x0]?.[_0x3e2f24(0x151)]['isCanonical']&&(_0x45dbf7=_0x3e2f24(0x17c),_0x3ccc38=_0x3e2f24(0x15b));}_0x113e80[_0x3e2f24(0x185)]({'sqlCode':_0x266ebd[_0x3e2f24(0x18e)],'sqlName':_0x266ebd[_0x3e2f24(0x162)],'filePath':_0x3da1e2,'status':_0x45dbf7,'reason':_0x3ccc38});}return{'method':_0x3e2f24(0x15a),'url':_0x3e2f24(0x16e),'body':{'appCode':_0x235b96[_0x3e2f24(0x160)],'sqlCode':_0x235b96['str'](_0x3e2f24(0x166))||null,'sqlName':_0x235b96['str'](_0x3e2f24(0x14d))||null,'files':_0x113e80},'description':_0x3e2f24(0x18d)+_0x113e80[_0x3e2f24(0x172)]+_0x3e2f24(0x14c)+_0x8be9d1[_0x3e2f24(0x188)]};},async 'execute'(_0x2dd4f5){const _0x34a2f3=a253_0x113200,_0x438a1d=loadSqlProjectConfig(_0x2dd4f5[_0x34a2f3(0x160)]),_0x49a88e=await readSqlLockFile(_0x438a1d['lockFilePath']),{lockData:_0x1200ed,appLock:_0x126bcf}=ensureSqlLockScope(_0x49a88e??createEmptySqlLock(),_0x438a1d[_0x34a2f3(0x160)],_0x438a1d[_0x34a2f3(0x148)],_0x34a2f3(0x16a)),_0x4bb678=_0x2dd4f5[_0x34a2f3(0x14a)](_0x34a2f3(0x18c)),_0x55f346=await fetchAllSqlQueries(_0x2dd4f5[_0x34a2f3(0x160)],{'sqlCode':_0x2dd4f5[_0x34a2f3(0x17d)](_0x34a2f3(0x166))||undefined,'sqlName':_0x2dd4f5['str'](_0x34a2f3(0x14d))||undefined});if(_0x55f346[_0x34a2f3(0x172)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x34a2f3(0x17b)};const _0x3abec8=[],_0x4aadd7=[];for(const _0x1b7f8f of _0x55f346){try{_0x3abec8[_0x34a2f3(0x185)](await ensureSqlContent(_0x1b7f8f));}catch(_0x59ff32){_0x4aadd7['push']({'sqlCode':_0x1b7f8f[_0x34a2f3(0x18e)],'error':_0x59ff32 instanceof Error?_0x59ff32[_0x34a2f3(0x150)]:String(_0x59ff32)});}}if(_0x4bb678&&!_0x2dd4f5[_0x34a2f3(0x145)]){let _0x233d51=![];for(const _0x1dfde5 of _0x3abec8){const _0x43a323=detectSqlMode(ensureRemoteSqlContent(_0x1dfde5)),_0x48c93e=_0x1dfde5['dbId']?await getDbName(_0x2dd4f5[_0x34a2f3(0x160)],Number(_0x1dfde5['dbId']))['catch'](()=>undefined):undefined,_0x5979ae=buildLocalSqlFileContent({'sqlCode':_0x1dfde5['sqlCode'],'sqlName':_0x1dfde5[_0x34a2f3(0x162)],'dbId':_0x1dfde5[_0x34a2f3(0x164)]},ensureRemoteSqlContent(_0x1dfde5),{'dbName':_0x48c93e,'mode':_0x43a323,'syncedAt':new Date()[_0x34a2f3(0x17a)](),'description':_0x1dfde5['description']}),_0xb6abce=resolveLocalSqlFilePath(_0x438a1d,_0x1dfde5[_0x34a2f3(0x18e)],buildSqlLockEntry(_0x1dfde5,ensureRemoteSqlContent(_0x1dfde5),'',{'dbName':_0x48c93e})),_0x1804fd=await findExistingSqlFiles(_0x438a1d,_0xb6abce,_0x43a323,_0x126bcf[_0x34a2f3(0x171)][_0x1dfde5[_0x34a2f3(0x18e)]]),_0x3e3ef9=await compareExistingSqlFiles(_0x1804fd,_0x5979ae,_0x43a323);if(_0x3e3ef9[_0x34a2f3(0x165)](({equivalent:_0x2543b7})=>!_0x2543b7)){_0x233d51=!![];break;}}if(_0x233d51){const _0x3465b0=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x3465b0)throw CliErrors[_0x34a2f3(0x181)](_0x34a2f3(0x175));}}const _0x520d3e=cloneSqlLockData(_0x1200ed),_0x457c0e=_0x520d3e[_0x34a2f3(0x163)][_0x438a1d[_0x34a2f3(0x160)]],_0x53df61=[],_0x3daeec=[];for(const _0x2b92c1 of _0x3abec8){const _0x14b4b7=_0x457c0e[_0x34a2f3(0x171)][_0x2b92c1['sqlCode']],_0x3a7a2f=ensureRemoteSqlContent(_0x2b92c1),_0x2b1940=detectSqlMode(_0x3a7a2f),_0x5a9eed=_0x2b92c1[_0x34a2f3(0x164)]?await getDbName(_0x2dd4f5[_0x34a2f3(0x160)],Number(_0x2b92c1['dbId']))[_0x34a2f3(0x178)](()=>undefined):undefined,_0x2b5108=buildLocalSqlFileContent({'sqlCode':_0x2b92c1['sqlCode'],'sqlName':_0x2b92c1[_0x34a2f3(0x162)],'dbId':_0x2b92c1[_0x34a2f3(0x164)]},_0x3a7a2f,{'dbName':_0x5a9eed,'mode':_0x2b1940,'syncedAt':new Date()['toISOString'](),'description':_0x2b92c1[_0x34a2f3(0x177)]}),_0x477606=buildSqlLockEntry(_0x2b92c1,_0x3a7a2f,computeSqlContentHash(_0x2b5108),{'dbName':_0x5a9eed}),_0x20d09e=_0x477606[_0x34a2f3(0x16d)],_0x2449e4=join(_0x438a1d[_0x34a2f3(0x188)],_0x20d09e);try{const _0x7f3797=await findExistingSqlFiles(_0x438a1d,_0x2449e4,_0x2b1940,_0x14b4b7),_0x425d8c=await compareExistingSqlFiles(_0x7f3797,_0x2b5108,_0x2b1940);if(!_0x4bb678&&_0x425d8c[_0x34a2f3(0x165)](({equivalent:_0x54c168})=>!_0x54c168)){_0x3daeec[_0x34a2f3(0x185)]({'sqlCode':_0x2b92c1[_0x34a2f3(0x18e)],'reason':'local\x20differs\x20from\x20remote'});continue;}const _0x188b3c=_0x425d8c[_0x34a2f3(0x156)](({file:_0x157ee})=>_0x157ee[_0x34a2f3(0x168)]),_0x494397=_0x425d8c[_0x34a2f3(0x156)](({file:_0x5b348e})=>!_0x5b348e[_0x34a2f3(0x168)]);if(_0x188b3c?.[_0x34a2f3(0x176)]&&!_0x494397){_0x3daeec[_0x34a2f3(0x185)]({'sqlCode':_0x2b92c1[_0x34a2f3(0x18e)],'reason':_0x34a2f3(0x15b)}),_0x457c0e[_0x34a2f3(0x171)][_0x2b92c1[_0x34a2f3(0x18e)]]={..._0x477606,'hash':computeSqlContentHash(_0x188b3c['content']),'path':_0x20d09e};continue;}!_0x188b3c?.[_0x34a2f3(0x176)]&&(await ensureParentDirectory(_0x2449e4),await writeFile(_0x2449e4,_0x2b5108,_0x34a2f3(0x149))),_0x494397&&await rm(_0x494397[_0x34a2f3(0x151)][_0x34a2f3(0x15d)],{'force':!![]}),_0x457c0e[_0x34a2f3(0x171)][_0x2b92c1[_0x34a2f3(0x18e)]]={..._0x477606,'hash':_0x188b3c?.['equivalent']?computeSqlContentHash(_0x188b3c[_0x34a2f3(0x16f)]):_0x477606[_0x34a2f3(0x146)],'path':_0x20d09e},_0x53df61['push']({'sqlCode':_0x2b92c1['sqlCode'],'filePath':_0x2449e4});}catch(_0x28338c){_0x4aadd7[_0x34a2f3(0x185)]({'sqlCode':_0x2b92c1['sqlCode'],'error':_0x28338c instanceof Error?_0x28338c[_0x34a2f3(0x150)]:String(_0x28338c)});}}return _0x457c0e[_0x34a2f3(0x16c)]=new Date()[_0x34a2f3(0x17a)](),await writeSqlLockFile(_0x438a1d[_0x34a2f3(0x158)],_0x520d3e),{'ok':_0x4aadd7[_0x34a2f3(0x172)]===0x0,'data':{'pulled':_0x53df61,'skipped':_0x3daeec,'failed':_0x4aadd7},'message':_0x34a2f3(0x183)+_0x53df61[_0x34a2f3(0x172)]+'\x20written,\x20'+_0x3daeec['length']+'\x20skipped,\x20'+_0x4aadd7[_0x34a2f3(0x172)]+_0x34a2f3(0x167)};}};function isEquivalentPulledSqlFile(_0x2718ae,_0x1daa75,_0xb0e41d,_0x10e147){if(_0xb0e41d!==_0x10e147)return normalizePulledSqlBody(_0x2718ae,_0xb0e41d)===normalizePulledSqlBody(_0x1daa75,_0x10e147);return normalizePullComparableContent(_0x2718ae,_0xb0e41d)===normalizePullComparableContent(_0x1daa75,_0x10e147);}async function findExistingSqlFiles(_0x3a0089,_0x3f8d90,_0x217f34,_0x3e8fa6){const _0xf909fe=a253_0x113200,_0x252595=[];await fileExists(_0x3f8d90)&&_0x252595[_0xf909fe(0x185)]({'filePath':_0x3f8d90,'mode':_0x217f34,'isCanonical':!![]});if(!_0x3e8fa6?.[_0xf909fe(0x16d)])return _0x252595;const _0x472ec2=join(_0x3a0089[_0xf909fe(0x188)],_0x3e8fa6[_0xf909fe(0x16d)]);if(_0x472ec2===_0x3f8d90)return _0x252595;return await fileExists(_0x472ec2)&&_0x252595[_0xf909fe(0x185)]({'filePath':_0x472ec2,'mode':_0x3e8fa6[_0xf909fe(0x17e)]??modeFromFilePath(_0x472ec2),'isCanonical':![]}),_0x252595;}async function compareExistingSqlFiles(_0x56057d,_0x45efe6,_0x258de8){const _0x13fba8=a253_0x113200;return Promise['all'](_0x56057d[_0x13fba8(0x186)](async _0x108caf=>{const _0x434f48=_0x13fba8,_0x489184=await readFile(_0x108caf[_0x434f48(0x15d)],_0x434f48(0x149));return{'file':_0x108caf,'content':_0x489184,'equivalent':isEquivalentPulledSqlFile(_0x489184,_0x45efe6,_0x108caf['mode'],_0x258de8)};}));}function modeFromFilePath(_0xbc1667){const _0x196c92=a253_0x113200;return _0xbc1667['toLowerCase']()['endsWith'](_0x196c92(0x187))?_0x196c92(0x18b):_0x196c92(0x189);}function a253_0x287d(_0x3bbbb8,_0x40b8b9){_0x3bbbb8=_0x3bbbb8-0x145;const _0x48fa6f=a253_0x48fa();let _0x287d6e=_0x48fa6f[_0x3bbbb8];return _0x287d6e;}function normalizePulledSqlBody(_0x3fb90a,_0x241bf5){const _0x4ff69c=a253_0x113200;return stripLocalSqlMetadata(_0x3fb90a,_0x241bf5)[_0x4ff69c(0x15c)](/\r\n/g,'\x0a')[_0x4ff69c(0x15f)]();}function normalizePullComparableContent(_0x38d341,_0x3a76b7){const _0x230759=a253_0x113200,_0x2d3866=_0x38d341['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x254f24=_0x2d3866['filter'](_0x31a5ed=>!isSyncedAtMetadataLine(_0x31a5ed,_0x3a76b7));return _0x254f24[_0x230759(0x14f)]('\x0a');}function isSyncedAtMetadataLine(_0x457226,_0x103344){const _0x4c0ab4=a253_0x113200;if(_0x103344===_0x4c0ab4(0x18b))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x457226);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x4c0ab4(0x173)](_0x457226);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a254_0x14a522=a254_0x2889;(function(_0x36ea08,_0x4c34b6){const _0x1c858f=a254_0x2889,_0x3186c4=_0x36ea08();while(!![]){try{const _0x5bccac=parseInt(_0x1c858f(0x21f))/0x1+parseInt(_0x1c858f(0x211))/0x2*(parseInt(_0x1c858f(0x1fe))/0x3)+-parseInt(_0x1c858f(0x215))/0x4+-parseInt(_0x1c858f(0x20c))/0x5*(-parseInt(_0x1c858f(0x209))/0x6)+parseInt(_0x1c858f(0x218))/0x7+parseInt(_0x1c858f(0x225))/0x8+-parseInt(_0x1c858f(0x224))/0x9;if(_0x5bccac===_0x4c34b6)break;else _0x3186c4['push'](_0x3186c4['shift']());}catch(_0x42d625){_0x3186c4['push'](_0x3186c4['shift']());}}}(a254_0xc998,0x18f79));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';function a254_0xc998(){const _0x2a389c=['200445sczfCL','dbName','map','utf8','force','length','appCode','64929BxgxJy','toISOString','dbId',':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','sqlcode','3242826UsLnJk','1558872zVBaaO','sqlCode','set','entries','hash','relativePath','\x20pushed,\x20','isFinite','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','sqlRootDir','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','sql','sqlName','lockFilePath','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','\x22\x20for\x20sqlCode\x20','str','path','/smartapi/custom/updateUserCustomSql','\x20failed','projectRoot','remoteId','version','join','bool','has','103389UqEGgD','sqls','\x20skipped,\x20','validation','exec','unchanged','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','Push\x20complete:\x20','sqlConfig','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','Local\x20directory\x20\x22','28116KAnHHd','POST','Push\x20local\x20SQL\x20files\x20to\x20remote','170OVsEzj','message','mode','filter','dbDirectory','6mCoqaV','filePath',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','354228Ipttod','catch','push'];a254_0xc998=function(){return _0x2a389c;};return a254_0xc998();}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(_0x59d0d3){const _0x2fd7a7=a254_0x2889,_0x4b427c=stripLocalSqlMetadata(await readFile(_0x59d0d3['filePath'],_0x2fd7a7(0x21b)),_0x59d0d3['mode']);if(!_0x4b427c['trim']())throw CliErrors['validation'](_0x59d0d3['sqlCode']+':\x20SQL\x20content\x20is\x20empty.');return _0x4b427c;}async function getTargetSqlQueries(_0x2894f1,_0xd464be,_0x445617){const _0x34a9f3=a254_0x2889,_0x4cb3d2=await scanLocalSqlQueries(_0x2894f1),_0x455d9b=new Map();for(const _0x2f78f0 of _0x4cb3d2){if(_0x445617&&_0x2f78f0[_0x34a9f3(0x226)]!==_0x445617)continue;const _0x3a3b71=_0x455d9b['get'](_0x2f78f0[_0x34a9f3(0x226)])??[];_0x3a3b71[_0x34a9f3(0x217)](_0x2f78f0),_0x455d9b[_0x34a9f3(0x227)](_0x2f78f0['sqlCode'],_0x3a3b71);}if(_0x445617&&!_0x455d9b[_0x34a9f3(0x1fd)](_0x445617))throw CliErrors[_0x34a9f3(0x201)]('Local\x20SQL\x20not\x20found:\x20'+_0x445617);const _0x4ebd3d=[];for(const [_0x26ed03,_0x1e57a6]of _0x455d9b[_0x34a9f3(0x228)]()){if(_0x1e57a6[_0x34a9f3(0x21d)]===0x1){_0x4ebd3d['push'](_0x1e57a6[0x0]);continue;}const _0x43682f=_0xd464be[_0x34a9f3(0x1ff)][_0x26ed03],_0x58f69b=_0x43682f?.['path'],_0x3a8d73=_0x58f69b?_0x1e57a6['filter'](_0x1419b3=>_0x1419b3[_0x34a9f3(0x22a)]!==_0x58f69b):_0x1e57a6;if(_0x43682f&&_0x3a8d73[_0x34a9f3(0x21d)]===0x1){_0x4ebd3d[_0x34a9f3(0x217)](_0x3a8d73[0x0]);continue;}throw CliErrors[_0x34a9f3(0x201)](_0x34a9f3(0x1ec)+_0x26ed03+_0x34a9f3(0x1ee));}return _0x4ebd3d;}export const sqlPush={'service':a254_0x14a522(0x1ef),'command':a254_0x14a522(0x217),'description':a254_0x14a522(0x20b),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a254_0x14a522(0x21c),'type':'boolean','description':a254_0x14a522(0x1f2)}],async 'dryRun'(_0x44646d){const _0x471059=a254_0x14a522,_0x32f52a=loadSqlProjectConfig(_0x44646d[_0x471059(0x21e)]),_0x245b19=await readSqlLockFile(_0x32f52a[_0x471059(0x1f1)]),{appLock:_0x3cdd63}=ensureSqlLockScope(_0x245b19??createEmptySqlLock(),_0x44646d['appCode'],_0x32f52a['sqlRoot'],_0x471059(0x217)),_0x2d9cff=await getTargetSqlQueries(_0x32f52a,_0x3cdd63,_0x44646d[_0x471059(0x1f4)]('sqlcode')||undefined),_0x4c6515=[];for(const _0x4989bc of _0x2d9cff){const _0x141010=await computeSqlFileHash(_0x4989bc[_0x471059(0x212)]),_0x1e23c2=_0x3cdd63[_0x471059(0x1ff)][_0x4989bc['sqlCode']],_0x46f4e1=!!_0x1e23c2&&(_0x1e23c2[_0x471059(0x1f5)]!==_0x4989bc[_0x471059(0x22a)]||!!_0x4989bc['sqlName']&&_0x1e23c2['sqlName']!==_0x4989bc[_0x471059(0x1f0)]||_0x1e23c2['mode']!==_0x4989bc['mode']);if(!_0x44646d[_0x471059(0x1fc)](_0x471059(0x21c))&&_0x1e23c2&&_0x1e23c2['hash']===_0x141010&&!_0x46f4e1)continue;if(!_0x1e23c2)throw CliErrors['validation'](_0x4989bc['sqlCode']+_0x471059(0x222));if(_0x1e23c2[_0x471059(0x1fa)]==null)throw CliErrors[_0x471059(0x201)](_0x4989bc[_0x471059(0x226)]+_0x471059(0x213));await resolveTargetDbBinding(_0x44646d['appCode'],_0x4989bc,_0x1e23c2),await readSqlUploadContent(_0x4989bc),_0x4c6515[_0x471059(0x217)](_0x4989bc['sqlCode']);}return{'method':_0x471059(0x20a),'url':_0x471059(0x1f6),'body':{'sqlCodes':_0x4c6515,'appCode':_0x44646d[_0x471059(0x21e)]},'description':'Would\x20push\x20'+_0x4c6515[_0x471059(0x21d)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x415d82){const _0x23fcb3=a254_0x14a522,_0x30947e=loadSqlProjectConfig(_0x415d82[_0x23fcb3(0x21e)]),_0x341238=await readSqlLockFile(_0x30947e[_0x23fcb3(0x1f1)]),{lockData:_0x5bdccc,appLock:_0x2e6e78}=ensureSqlLockScope(_0x341238??createEmptySqlLock(),_0x415d82[_0x23fcb3(0x21e)],_0x30947e['sqlRoot'],_0x23fcb3(0x217)),_0x3924f4=await getTargetSqlQueries(_0x30947e,_0x2e6e78,_0x415d82[_0x23fcb3(0x1f4)](_0x23fcb3(0x223))||undefined);if(_0x3924f4[_0x23fcb3(0x21d)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x5384b9=[],_0x2b2f25=[],_0x40969f=[];let _0x3d01f9=![];for(const _0x24b867 of _0x3924f4){const _0x4f7c4c=_0x2e6e78[_0x23fcb3(0x1ff)][_0x24b867[_0x23fcb3(0x226)]];if(!_0x4f7c4c){_0x40969f[_0x23fcb3(0x217)]({'sqlCode':_0x24b867[_0x23fcb3(0x226)],'error':_0x23fcb3(0x207)});continue;}try{const _0x13577a=await computeSqlFileHash(_0x24b867[_0x23fcb3(0x212)]),_0x8e664f=_0x4f7c4c['path']!==_0x24b867[_0x23fcb3(0x22a)]||!!_0x24b867[_0x23fcb3(0x1f0)]&&_0x4f7c4c[_0x23fcb3(0x1f0)]!==_0x24b867[_0x23fcb3(0x1f0)]||_0x4f7c4c[_0x23fcb3(0x20e)]!==_0x24b867[_0x23fcb3(0x20e)];if(!_0x415d82[_0x23fcb3(0x1fc)](_0x23fcb3(0x21c))&&_0x4f7c4c[_0x23fcb3(0x229)]===_0x13577a&&!_0x8e664f){_0x2b2f25['push']({'sqlCode':_0x24b867[_0x23fcb3(0x226)],'reason':_0x23fcb3(0x203)});continue;}if(_0x4f7c4c[_0x23fcb3(0x1fa)]==null){_0x40969f['push']({'sqlCode':_0x24b867[_0x23fcb3(0x226)],'error':_0x23fcb3(0x214)});continue;}const _0xa310ad=_0x24b867[_0x23fcb3(0x1f0)]||_0x4f7c4c[_0x23fcb3(0x1f0)],_0x161f5f=await resolveTargetDbBinding(_0x415d82['appCode'],_0x24b867,_0x4f7c4c),_0x169032=await readSqlUploadContent(_0x24b867),_0x543406=await updateSqlQuery({'id':_0x4f7c4c[_0x23fcb3(0x1f9)],'appCode':_0x415d82[_0x23fcb3(0x21e)],'sqlCode':_0x24b867[_0x23fcb3(0x226)],'sqlName':_0xa310ad,'dbId':_0x161f5f[_0x23fcb3(0x221)],'version':_0x4f7c4c[_0x23fcb3(0x1fa)],'sqlContent':_0x169032,'sqlConfig':_0x4f7c4c[_0x23fcb3(0x206)]??undefined}),_0x6243fe=_0x543406[_0x23fcb3(0x221)]?await getDbName(_0x415d82[_0x23fcb3(0x21e)],Number(_0x543406['dbId']))[_0x23fcb3(0x216)](()=>_0x161f5f['dbName']):_0x161f5f[_0x23fcb3(0x219)];_0x2e6e78['sqls'][_0x24b867['sqlCode']]={...buildSqlLockEntry(_0x543406,_0x169032,_0x13577a,{'dbName':_0x6243fe}),'path':_0x24b867[_0x23fcb3(0x22a)],'mode':_0x24b867[_0x23fcb3(0x20e)]},_0x3d01f9=!![],await archivePreviousSqlFileIfNeeded(_0x30947e,_0x4f7c4c[_0x23fcb3(0x1f5)],_0x24b867['relativePath']),_0x5384b9['push']({'sqlCode':_0x24b867[_0x23fcb3(0x226)],'remoteId':_0x4f7c4c[_0x23fcb3(0x1f9)]});}catch(_0x47960d){_0x40969f[_0x23fcb3(0x217)]({'sqlCode':_0x24b867[_0x23fcb3(0x226)],'error':_0x47960d instanceof Error?_0x47960d[_0x23fcb3(0x20d)]:String(_0x47960d)});}}(_0x3d01f9||_0x40969f[_0x23fcb3(0x21d)]===0x0)&&(_0x2e6e78['lastSync']=new Date()[_0x23fcb3(0x220)](),await writeSqlLockFile(_0x30947e[_0x23fcb3(0x1f1)],_0x5bdccc));const _0x30aebe=_0x40969f[_0x23fcb3(0x21d)]===0x0;return{'ok':_0x30aebe,'data':{'pushed':_0x5384b9,'skipped':_0x2b2f25,'failed':_0x40969f},'message':_0x23fcb3(0x205)+_0x5384b9[_0x23fcb3(0x21d)]+_0x23fcb3(0x22b)+_0x2b2f25['length']+_0x23fcb3(0x200)+_0x40969f[_0x23fcb3(0x21d)]+_0x23fcb3(0x1f7)};}};async function archivePreviousSqlFileIfNeeded(_0x9ef87f,_0x5e6ee4,_0x345232){const _0x132364=a254_0x14a522;if(!_0x5e6ee4||_0x5e6ee4===_0x345232)return;const _0x256ef1=join(_0x9ef87f[_0x132364(0x1ed)],_0x5e6ee4);if(!await fileExists(_0x256ef1))return;const _0x44220d=await moveToTrash(_0x9ef87f[_0x132364(0x1f8)],_0x9ef87f['trashDir'],_0x256ef1);await cleanupEmptyDirectories(dirname(_0x256ef1),_0x9ef87f[_0x132364(0x1ed)]),void _0x44220d;}async function moveToTrash(_0x2e4102,_0x310bad,_0x1ece01){const _0x4e49af=a254_0x14a522,_0x5c77c9=new Date()[_0x4e49af(0x220)]()['replace'](/[:.]/g,'-'),_0x32610e=relative(_0x2e4102,_0x1ece01),_0x27d881=join(_0x310bad,_0x5c77c9,_0x32610e);return await mkdir(dirname(_0x27d881),{'recursive':!![]}),await rename(_0x1ece01,_0x27d881),_0x27d881;}async function cleanupEmptyDirectories(_0x414a26,_0x565155){const _0x3c74da=a254_0x14a522;let _0x49a066=resolve(_0x414a26);const _0x3d5cd3=resolve(_0x565155);while(_0x49a066['startsWith'](''+_0x3d5cd3+sep)||_0x49a066===_0x3d5cd3){if(_0x49a066===_0x3d5cd3)return;try{const _0x18c6f9=await readdir(_0x49a066);if(_0x18c6f9[_0x3c74da(0x21d)]>0x0)return;await rmdir(_0x49a066);}catch{return;}_0x49a066=dirname(_0x49a066);}}async function resolveTargetDbBinding(_0x6e24ac,_0x5105b8,_0x23c992){const _0x3059fc=a254_0x14a522,_0x69faa7=_0x5105b8[_0x3059fc(0x210)];if(!_0x69faa7)return{'dbId':_0x23c992[_0x3059fc(0x221)],'dbName':_0x23c992[_0x3059fc(0x219)]};const _0x3ca565=buildDbDirectoryName(_0x23c992[_0x3059fc(0x219)],_0x23c992[_0x3059fc(0x221)]);if(_0x69faa7===_0x3ca565)return{'dbId':_0x23c992[_0x3059fc(0x221)],'dbName':_0x23c992[_0x3059fc(0x219)]};const _0x559370=parseExplicitDbDirectory(_0x69faa7);if(_0x559370!=null)return{'dbId':_0x559370,'dbName':await getDbName(_0x6e24ac,_0x559370)['catch'](()=>undefined)};const _0x4eeee5=await listDatabases(_0x6e24ac),_0x41c046=_0x4eeee5[_0x3059fc(0x20f)](_0x568d56=>buildDbDirectoryName(_0x568d56[_0x3059fc(0x219)],_0x568d56[_0x3059fc(0x221)])===_0x69faa7);if(_0x41c046[_0x3059fc(0x21d)]===0x1)return{'dbId':_0x41c046[0x0]['dbId'],'dbName':_0x41c046[0x0][_0x3059fc(0x219)]};if(_0x41c046[_0x3059fc(0x21d)]===0x0)throw CliErrors[_0x3059fc(0x201)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x69faa7+_0x3059fc(0x1f3)+_0x5105b8[_0x3059fc(0x226)]+'.');const _0xbfb792=_0x41c046[_0x3059fc(0x21a)](_0x109012=>_0x109012[_0x3059fc(0x219)]+'\x20('+_0x109012[_0x3059fc(0x221)]+')')[_0x3059fc(0x1fb)](',\x20');throw CliErrors[_0x3059fc(0x201)](_0x3059fc(0x208)+_0x69faa7+_0x3059fc(0x204)+_0x5105b8[_0x3059fc(0x226)]+':\x20'+_0xbfb792);}function a254_0x2889(_0x5ee617,_0x3f5da8){_0x5ee617=_0x5ee617-0x1eb;const _0xc998d2=a254_0xc998();let _0x2889ad=_0xc998d2[_0x5ee617];return _0x2889ad;}function parseExplicitDbDirectory(_0xeca043){const _0x2880e1=a254_0x14a522,_0x248192=/^db-(\d+)$/[_0x2880e1(0x202)](_0xeca043);if(!_0x248192)return null;const _0x2023b4=Number(_0x248192[0x1]);return Number[_0x2880e1(0x1eb)](_0x2023b4)&&_0x2023b4>0x0?_0x2023b4:null;}
|
|
1
|
+
const a254_0x397be5=a254_0x324e;(function(_0x256453,_0x55b6ab){const _0x41529f=a254_0x324e,_0x1666d2=_0x256453();while(!![]){try{const _0x5d6dd2=parseInt(_0x41529f(0xf5))/0x1+parseInt(_0x41529f(0xe1))/0x2*(-parseInt(_0x41529f(0xcc))/0x3)+parseInt(_0x41529f(0xe4))/0x4*(-parseInt(_0x41529f(0xd5))/0x5)+-parseInt(_0x41529f(0xf6))/0x6*(-parseInt(_0x41529f(0xd9))/0x7)+parseInt(_0x41529f(0xd7))/0x8*(-parseInt(_0x41529f(0xdd))/0x9)+parseInt(_0x41529f(0xeb))/0xa*(-parseInt(_0x41529f(0xc3))/0xb)+parseInt(_0x41529f(0xc7))/0xc;if(_0x5d6dd2===_0x55b6ab)break;else _0x1666d2['push'](_0x1666d2['shift']());}catch(_0x5059e2){_0x1666d2['push'](_0x1666d2['shift']());}}}(a254_0x5257,0xe20d0));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';function a254_0x324e(_0x208192,_0x2c362e){_0x208192=_0x208192-0xc2;const _0x52571e=a254_0x5257();let _0x324eac=_0x52571e[_0x208192];return _0x324eac;}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(_0x38df17){const _0x418a82=a254_0x324e,_0x405a83=stripLocalSqlMetadata(await readFile(_0x38df17['filePath'],'utf8'),_0x38df17[_0x418a82(0xe5)]);if(!_0x405a83['trim']())throw CliErrors[_0x418a82(0xf9)](_0x38df17[_0x418a82(0xf7)]+':\x20SQL\x20content\x20is\x20empty.');return _0x405a83;}async function getTargetSqlQueries(_0x2415db,_0x16d2a9,_0x1dd92c){const _0x12dae1=a254_0x324e,_0xeaf20e=await scanLocalSqlQueries(_0x2415db),_0x11242e=new Map();for(const _0x39e70c of _0xeaf20e){if(_0x1dd92c&&_0x39e70c[_0x12dae1(0xf7)]!==_0x1dd92c)continue;const _0x311dae=_0x11242e[_0x12dae1(0xdc)](_0x39e70c[_0x12dae1(0xf7)])??[];_0x311dae[_0x12dae1(0xde)](_0x39e70c),_0x11242e[_0x12dae1(0xf2)](_0x39e70c[_0x12dae1(0xf7)],_0x311dae);}if(_0x1dd92c&&!_0x11242e[_0x12dae1(0xf4)](_0x1dd92c))throw CliErrors[_0x12dae1(0xf9)](_0x12dae1(0x107)+_0x1dd92c);const _0x5c98d2=[];for(const [_0x3037d4,_0x196298]of _0x11242e[_0x12dae1(0xee)]()){if(_0x196298['length']===0x1){_0x5c98d2[_0x12dae1(0xde)](_0x196298[0x0]);continue;}const _0x1fd89d=_0x16d2a9['sqls'][_0x3037d4],_0x13d015=_0x1fd89d?.['path'],_0x15e226=_0x13d015?_0x196298[_0x12dae1(0xdf)](_0x5abcbe=>_0x5abcbe[_0x12dae1(0xc4)]!==_0x13d015):_0x196298;if(_0x1fd89d&&_0x15e226['length']===0x1){_0x5c98d2[_0x12dae1(0xde)](_0x15e226[0x0]);continue;}throw CliErrors[_0x12dae1(0xf9)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x3037d4+_0x12dae1(0xcf));}return _0x5c98d2;}export const sqlPush={'service':'sql','command':a254_0x397be5(0xde),'description':a254_0x397be5(0xc8),'risk':a254_0x397be5(0xe2),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a254_0x397be5(0xdb),'type':a254_0x397be5(0xec),'description':a254_0x397be5(0xda)}],async 'dryRun'(_0x500d82){const _0x222608=a254_0x397be5,_0x1a3e5e=loadSqlProjectConfig(_0x500d82['appCode']),_0x266835=await readSqlLockFile(_0x1a3e5e['lockFilePath']),{appLock:_0x12c1a7}=ensureSqlLockScope(_0x266835??createEmptySqlLock(),_0x500d82['appCode'],_0x1a3e5e[_0x222608(0xe7)],'push'),_0x42ab67=await getTargetSqlQueries(_0x1a3e5e,_0x12c1a7,_0x500d82[_0x222608(0xe3)](_0x222608(0xc5))||undefined),_0x1a228e=[];for(const _0x199812 of _0x42ab67){const _0x5e850c=await computeSqlFileHash(_0x199812[_0x222608(0xc2)]),_0x39a7db=_0x12c1a7[_0x222608(0xc9)][_0x199812[_0x222608(0xf7)]],_0x506eba=!!_0x39a7db&&(_0x39a7db[_0x222608(0x102)]!==_0x199812['relativePath']||!!_0x199812[_0x222608(0xff)]&&_0x39a7db[_0x222608(0xff)]!==_0x199812['sqlName']||_0x39a7db[_0x222608(0xe5)]!==_0x199812[_0x222608(0xe5)]);if(!_0x500d82[_0x222608(0xd2)](_0x222608(0xdb))&&_0x39a7db&&_0x39a7db['hash']===_0x5e850c&&!_0x506eba)continue;if(!_0x39a7db)throw CliErrors[_0x222608(0xf9)](_0x199812[_0x222608(0xf7)]+_0x222608(0xd4));if(_0x39a7db[_0x222608(0xef)]==null)throw CliErrors[_0x222608(0xf9)](_0x199812[_0x222608(0xf7)]+_0x222608(0xca));await resolveTargetDbBinding(_0x500d82[_0x222608(0xf0)],_0x199812,_0x39a7db),await readSqlUploadContent(_0x199812),_0x1a228e[_0x222608(0xde)](_0x199812[_0x222608(0xf7)]);}return{'method':_0x222608(0xea),'url':_0x222608(0xfd),'body':{'sqlCodes':_0x1a228e,'appCode':_0x500d82[_0x222608(0xf0)]},'description':'Would\x20push\x20'+_0x1a228e[_0x222608(0xd6)]+_0x222608(0xfa)};},async 'execute'(_0xd06323){const _0x558d5c=a254_0x397be5,_0x5de37f=loadSqlProjectConfig(_0xd06323[_0x558d5c(0xf0)]),_0x3a3b01=await readSqlLockFile(_0x5de37f[_0x558d5c(0xed)]),{lockData:_0x176e71,appLock:_0x1a4b06}=ensureSqlLockScope(_0x3a3b01??createEmptySqlLock(),_0xd06323[_0x558d5c(0xf0)],_0x5de37f[_0x558d5c(0xe7)],_0x558d5c(0xde)),_0x194bc6=await getTargetSqlQueries(_0x5de37f,_0x1a4b06,_0xd06323[_0x558d5c(0xe3)](_0x558d5c(0xc5))||undefined);if(_0x194bc6['length']===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x558d5c(0xd0)};const _0x221e84=[],_0x224846=[],_0x23b2e1=[];let _0x55e97d=![];for(const _0x4bef79 of _0x194bc6){const _0x166992=_0x1a4b06[_0x558d5c(0xc9)][_0x4bef79[_0x558d5c(0xf7)]];if(!_0x166992){_0x23b2e1[_0x558d5c(0xde)]({'sqlCode':_0x4bef79['sqlCode'],'error':_0x558d5c(0xe6)});continue;}try{const _0x109f43=await computeSqlFileHash(_0x4bef79['filePath']),_0x4d1a9d=_0x166992['path']!==_0x4bef79[_0x558d5c(0xc4)]||!!_0x4bef79['sqlName']&&_0x166992[_0x558d5c(0xff)]!==_0x4bef79[_0x558d5c(0xff)]||_0x166992[_0x558d5c(0xe5)]!==_0x4bef79[_0x558d5c(0xe5)];if(!_0xd06323[_0x558d5c(0xd2)](_0x558d5c(0xdb))&&_0x166992['hash']===_0x109f43&&!_0x4d1a9d){_0x224846['push']({'sqlCode':_0x4bef79[_0x558d5c(0xf7)],'reason':_0x558d5c(0xc6)});continue;}if(_0x166992['version']==null){_0x23b2e1[_0x558d5c(0xde)]({'sqlCode':_0x4bef79[_0x558d5c(0xf7)],'error':_0x558d5c(0xe8)});continue;}const _0x59c3ac=_0x4bef79[_0x558d5c(0xff)]||_0x166992['sqlName'],_0x43fba4=await resolveTargetDbBinding(_0xd06323[_0x558d5c(0xf0)],_0x4bef79,_0x166992),_0x2895d9=await readSqlUploadContent(_0x4bef79),_0x2e1a79=await updateSqlQuery({'id':_0x166992[_0x558d5c(0x101)],'appCode':_0xd06323[_0x558d5c(0xf0)],'sqlCode':_0x4bef79['sqlCode'],'sqlName':_0x59c3ac,'dbId':_0x43fba4[_0x558d5c(0xce)],'version':_0x166992[_0x558d5c(0xef)],'sqlContent':_0x2895d9,'sqlConfig':_0x166992[_0x558d5c(0xd3)]??undefined}),_0x20fda0=_0x2e1a79['dbId']?await getDbName(_0xd06323[_0x558d5c(0xf0)],Number(_0x2e1a79['dbId']))[_0x558d5c(0x106)](()=>_0x43fba4[_0x558d5c(0xf3)]):_0x43fba4['dbName'];_0x1a4b06[_0x558d5c(0xc9)][_0x4bef79[_0x558d5c(0xf7)]]={...buildSqlLockEntry(_0x2e1a79,_0x2895d9,_0x109f43,{'dbName':_0x20fda0}),'path':_0x4bef79['relativePath'],'mode':_0x4bef79[_0x558d5c(0xe5)]},_0x55e97d=!![],await archivePreviousSqlFileIfNeeded(_0x5de37f,_0x166992['path'],_0x4bef79['relativePath']),_0x221e84['push']({'sqlCode':_0x4bef79['sqlCode'],'remoteId':_0x166992[_0x558d5c(0x101)]});}catch(_0x1c6f57){_0x23b2e1[_0x558d5c(0xde)]({'sqlCode':_0x4bef79[_0x558d5c(0xf7)],'error':_0x1c6f57 instanceof Error?_0x1c6f57[_0x558d5c(0xd8)]:String(_0x1c6f57)});}}(_0x55e97d||_0x23b2e1[_0x558d5c(0xd6)]===0x0)&&(_0x1a4b06[_0x558d5c(0xf1)]=new Date()[_0x558d5c(0xcd)](),await writeSqlLockFile(_0x5de37f[_0x558d5c(0xed)],_0x176e71));const _0x46b1a1=_0x23b2e1['length']===0x0;return{'ok':_0x46b1a1,'data':{'pushed':_0x221e84,'skipped':_0x224846,'failed':_0x23b2e1},'message':_0x558d5c(0x100)+_0x221e84[_0x558d5c(0xd6)]+_0x558d5c(0x105)+_0x224846[_0x558d5c(0xd6)]+_0x558d5c(0xd1)+_0x23b2e1['length']+_0x558d5c(0xfe)};}};async function archivePreviousSqlFileIfNeeded(_0xe99575,_0x37d2b4,_0x366e09){const _0x31dabc=a254_0x397be5;if(!_0x37d2b4||_0x37d2b4===_0x366e09)return;const _0x4d59f9=join(_0xe99575[_0x31dabc(0x103)],_0x37d2b4);if(!await fileExists(_0x4d59f9))return;const _0x32ec60=await moveToTrash(_0xe99575[_0x31dabc(0xe0)],_0xe99575['trashDir'],_0x4d59f9);await cleanupEmptyDirectories(dirname(_0x4d59f9),_0xe99575[_0x31dabc(0x103)]),void _0x32ec60;}async function moveToTrash(_0x423a0e,_0x154abd,_0xe05996){const _0x4b8083=a254_0x397be5,_0x2f51fd=new Date()['toISOString']()[_0x4b8083(0xe9)](/[:.]/g,'-'),_0x1e0217=relative(_0x423a0e,_0xe05996),_0x33105c=join(_0x154abd,_0x2f51fd,_0x1e0217);return await mkdir(dirname(_0x33105c),{'recursive':!![]}),await rename(_0xe05996,_0x33105c),_0x33105c;}function a254_0x5257(){const _0x26a1f3=[':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','1190990GrntzU','length','4422520rgaViF','message','6223ClcqRh','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','force','get','18BCLRIL','push','filter','projectRoot','58QeaubT','write','str','8NvYxzD','mode','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','sqlRoot','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','replace','POST','340HiZjze','boolean','lockFilePath','entries','version','appCode','lastSync','set','dbName','has','828681XultFw','4014CFwKZm','sqlCode','isFinite','validation','\x20SQL\x20file(s)','startsWith','dbDirectory','/smartapi/custom/updateUserCustomSql','\x20failed','sqlName','Push\x20complete:\x20','remoteId','path','sqlRootDir','Local\x20directory\x20\x22','\x20pushed,\x20','catch','Local\x20SQL\x20not\x20found:\x20','filePath','54307gOqaaM','relativePath','sqlcode','unchanged','18873096BHORLq','Push\x20local\x20SQL\x20files\x20to\x20remote','sqls',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','exec','33144KnFqgs','toISOString','dbId','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','No\x20local\x20SQL\x20files\x20found.','\x20skipped,\x20','bool','sqlConfig'];a254_0x5257=function(){return _0x26a1f3;};return a254_0x5257();}async function cleanupEmptyDirectories(_0x176373,_0x17c29b){const _0x30f039=a254_0x397be5;let _0x544580=resolve(_0x176373);const _0x15c020=resolve(_0x17c29b);while(_0x544580[_0x30f039(0xfb)](''+_0x15c020+sep)||_0x544580===_0x15c020){if(_0x544580===_0x15c020)return;try{const _0x2611c9=await readdir(_0x544580);if(_0x2611c9['length']>0x0)return;await rmdir(_0x544580);}catch{return;}_0x544580=dirname(_0x544580);}}async function resolveTargetDbBinding(_0x417592,_0x3315d7,_0x272295){const _0x159b54=a254_0x397be5,_0x497f75=_0x3315d7[_0x159b54(0xfc)];if(!_0x497f75)return{'dbId':_0x272295[_0x159b54(0xce)],'dbName':_0x272295[_0x159b54(0xf3)]};const _0x24d3e1=buildDbDirectoryName(_0x272295['dbName'],_0x272295[_0x159b54(0xce)]);if(_0x497f75===_0x24d3e1)return{'dbId':_0x272295['dbId'],'dbName':_0x272295[_0x159b54(0xf3)]};const _0x401833=parseExplicitDbDirectory(_0x497f75);if(_0x401833!=null)return{'dbId':_0x401833,'dbName':await getDbName(_0x417592,_0x401833)[_0x159b54(0x106)](()=>undefined)};const _0x543d3e=await listDatabases(_0x417592),_0x302c3e=_0x543d3e['filter'](_0x5432a1=>buildDbDirectoryName(_0x5432a1['dbName'],_0x5432a1[_0x159b54(0xce)])===_0x497f75);if(_0x302c3e['length']===0x1)return{'dbId':_0x302c3e[0x0][_0x159b54(0xce)],'dbName':_0x302c3e[0x0]['dbName']};if(_0x302c3e[_0x159b54(0xd6)]===0x0)throw CliErrors[_0x159b54(0xf9)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x497f75+'\x22\x20for\x20sqlCode\x20'+_0x3315d7[_0x159b54(0xf7)]+'.');const _0x17f060=_0x302c3e['map'](_0x1cb22b=>_0x1cb22b[_0x159b54(0xf3)]+'\x20('+_0x1cb22b['dbId']+')')['join'](',\x20');throw CliErrors[_0x159b54(0xf9)](_0x159b54(0x104)+_0x497f75+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x3315d7['sqlCode']+':\x20'+_0x17f060);}function parseExplicitDbDirectory(_0x15caa4){const _0xfece3a=a254_0x397be5,_0x292137=/^db-(\d+)$/[_0xfece3a(0xcb)](_0x15caa4);if(!_0x292137)return null;const _0x247f78=Number(_0x292137[0x1]);return Number[_0xfece3a(0xf8)](_0x247f78)&&_0x247f78>0x0?_0x247f78:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a255_0x12d2f7=a255_0x17c3;(function(_0x1d847e,_0x131ee3){const _0x28af7f=a255_0x17c3,_0x3eefc0=_0x1d847e();while(!![]){try{const _0x2d40c1=-parseInt(_0x28af7f(0x205))/0x1*(-parseInt(_0x28af7f(0x1fb))/0x2)+parseInt(_0x28af7f(0x223))/0x3*(-parseInt(_0x28af7f(0x21d))/0x4)+-parseInt(_0x28af7f(0x210))/0x5*(parseInt(_0x28af7f(0x217))/0x6)+parseInt(_0x28af7f(0x215))/0x7*(-parseInt(_0x28af7f(0x20b))/0x8)+-parseInt(_0x28af7f(0x209))/0x9+parseInt(_0x28af7f(0x1f4))/0xa*(parseInt(_0x28af7f(0x1fe))/0xb)+parseInt(_0x28af7f(0x20c))/0xc;if(_0x2d40c1===_0x131ee3)break;else _0x3eefc0['push'](_0x3eefc0['shift']());}catch(_0x4542df){_0x3eefc0['push'](_0x3eefc0['shift']());}}}(a255_0x3d86,0x65e73));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a255_0x12d2f7(0x222);export function buildSqlLockEntry(_0x26d74f,_0xa969a1,_0x58f0f2,_0x240c02){const _0x290e7c=a255_0x12d2f7,_0x351c14=detectSqlMode(_0xa969a1);return{'path':buildSqlRelativePath(_0x26d74f[_0x290e7c(0x212)],_0x26d74f[_0x290e7c(0x21c)],_0x240c02?.[_0x290e7c(0x219)],_0x351c14,_0x26d74f[_0x290e7c(0x20d)]),'hash':_0x58f0f2,'remoteId':_0x26d74f['id'],'version':_0x26d74f[_0x290e7c(0x214)],'dbId':Number(_0x26d74f[_0x290e7c(0x20d)]),'dbName':_0x240c02?.[_0x290e7c(0x219)],'sqlName':_0x26d74f[_0x290e7c(0x21c)],'sqlConfig':_0x26d74f['sqlConfig']??undefined,'mode':_0x351c14};}export function cloneSqlLockData(_0xfbfb14){const _0x4dcd85=a255_0x12d2f7;return{'apps':Object[_0x4dcd85(0x21b)](Object[_0x4dcd85(0x1fc)](_0xfbfb14[_0x4dcd85(0x207)])[_0x4dcd85(0x204)](([_0x3b9147,_0x12e9ef])=>[_0x3b9147,{'sqlRoot':_0x12e9ef[_0x4dcd85(0x200)],'lastSync':_0x12e9ef[_0x4dcd85(0x1f5)],'sqls':{..._0x12e9ef[_0x4dcd85(0x1fa)]}}]))};}export function ensureRemoteSqlContent(_0x48a178){const _0x31c970=a255_0x12d2f7;return _0x48a178[_0x31c970(0x208)]??'';}export function buildLocalSqlFileContent(_0x50a3e9,_0x332223,_0x15da1c){const _0x14d311=a255_0x12d2f7,_0x244f19=_0x15da1c?.[_0x14d311(0x21f)]??detectSqlMode(_0x332223),_0x5ead58=stripLocalSqlMetadata(_0x332223,_0x244f19)[_0x14d311(0x216)](),_0x1ba934=buildMetadataHeaderLines({'sqlCode':_0x50a3e9[_0x14d311(0x212)],'sqlName':_0x50a3e9[_0x14d311(0x21c)],'dbId':_0x50a3e9[_0x14d311(0x20d)],'dbName':_0x15da1c?.[_0x14d311(0x219)],'mode':_0x244f19,'syncedAt':_0x15da1c?.[_0x14d311(0x1f3)],'description':_0x15da1c?.[_0x14d311(0x203)]},_0x244f19),_0x385e68=_0x244f19===_0x14d311(0x20f)?splitXmlDeclaration(_0x5ead58):{'body':_0x5ead58},_0x1474e1=[..._0x385e68[_0x14d311(0x220)]?[_0x385e68[_0x14d311(0x220)]]:[],..._0x1ba934,'',_0x385e68[_0x14d311(0x1f9)][_0x14d311(0x21a)]()],_0x47b3da=_0x1474e1['join']('\x0a');return _0x47b3da[_0x14d311(0x206)]('\x0a')?_0x47b3da:_0x47b3da+'\x0a';}export function stripLocalSqlMetadata(_0x538665,_0x5d8c9c){const _0x591ff3=a255_0x12d2f7;if(_0x5d8c9c==='mybatisXml'){const {declaration:_0x3954a2,body:_0x4926f5}=splitXmlDeclaration(_0x538665['replace'](/\r\n/g,'\x0a')),_0x34bae1=stripLeadingMetadataLines(_0x4926f5,/^\s*<!--\s*@lovrabet\./);return _0x3954a2?''+_0x3954a2+(_0x34bae1?'\x0a'+_0x34bae1:''):_0x34bae1;}return stripLeadingMetadataLines(_0x538665[_0x591ff3(0x201)](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0x33f57b,_0x36ce40){const _0x45975a=a255_0x12d2f7;if(_0x36ce40?.[_0x45975a(0x21f)])return _0x36ce40[_0x45975a(0x21f)];return detectSqlMode(_0x33f57b);}function a255_0x3d86(){const _0x46c52c=['version','7wDdENT','trim','3054piDkUS','filter','dbName','trimStart','fromEntries','sqlName','528536lgRBfm','question','mode','declaration','yes','.rabetbase/sql','6wtWUUo','slice','exec','close','syncedAt','837560IZXRYR','lastSync','includes','join','\x20[y/N]\x20','body','sqls','8LgzeyF','entries','length','55cNKEiJ','split','sqlRoot','replace','<!--\x20@lovrabet.','description','map','34690cEmHfg','endsWith','apps','sqlContent','5677065FtzcSy','stdin','2540720PEtAzB','17408220zcdiVW','dbId','path','mybatisXml','3715ICiCPS','toLowerCase','sqlCode','\x20-->'];a255_0x3d86=function(){return _0x46c52c;};return a255_0x3d86();}export function resolveSqlFileName(_0x3bd073,_0x2edbca,_0xcbc3d8){const _0x4b7315=a255_0x12d2f7;if(_0xcbc3d8?.[_0x4b7315(0x20e)])return _0xcbc3d8['path'];if(_0xcbc3d8?.['sqlName']||_0xcbc3d8?.[_0x4b7315(0x219)])return buildSqlRelativePath(_0x3bd073,_0xcbc3d8?.[_0x4b7315(0x21c)],_0xcbc3d8?.['dbName'],resolveSqlMode(_0x2edbca,_0xcbc3d8),_0xcbc3d8?.[_0x4b7315(0x20d)]);return buildDefaultSqlFileName(_0x3bd073,resolveSqlMode(_0x2edbca,_0xcbc3d8));}export function resolveSqlLocalDir(_0x53769d,_0x5d98b2){return join(_0x53769d,SQL_LOCAL_REL_DIR,_0x5d98b2);}export async function confirmForceOverwrite(_0x563db){const _0x4f44fe=a255_0x12d2f7,_0x4a7f67=createInterface({'input':process[_0x4f44fe(0x20a)],'output':process['stderr']}),_0xfc3170=await new Promise(_0x227f46=>{const _0x1f27ec=_0x4f44fe;_0x4a7f67[_0x1f27ec(0x21e)](_0x563db+_0x1f27ec(0x1f8),_0x227f46);});return _0x4a7f67[_0x4f44fe(0x1f2)](),['y',_0x4f44fe(0x221)][_0x4f44fe(0x1f6)](_0xfc3170[_0x4f44fe(0x216)]()[_0x4f44fe(0x211)]());}export function findSqlLockScope(_0x25cda1,_0xb39d66){const _0x868335=a255_0x12d2f7;return _0x25cda1[_0x868335(0x207)][_0xb39d66];}function buildMetadataHeaderLines(_0x452151,_0x279869){const _0x563271=a255_0x12d2f7,_0x44ae4c=[['sqlCode',_0x452151[_0x563271(0x212)]],[_0x563271(0x21c),_0x452151[_0x563271(0x21c)]],['dbId',_0x452151[_0x563271(0x20d)]],[_0x563271(0x219),_0x452151[_0x563271(0x219)]],[_0x563271(0x21f),_0x452151[_0x563271(0x21f)]],[_0x563271(0x1f3),_0x452151[_0x563271(0x1f3)]],[_0x563271(0x203),_0x452151[_0x563271(0x203)]]];if(_0x279869==='mybatisXml')return _0x44ae4c[_0x563271(0x218)](([,_0x1f4d4c])=>_0x1f4d4c!==undefined&&_0x1f4d4c!==null&&String(_0x1f4d4c)['trim']()!=='')[_0x563271(0x204)](([_0x3cfd97,_0x57929c])=>_0x563271(0x202)+_0x3cfd97+':\x20'+String(_0x57929c)+_0x563271(0x213));return _0x44ae4c['filter'](([,_0x32c017])=>_0x32c017!==undefined&&_0x32c017!==null&&String(_0x32c017)['trim']()!=='')['map'](([_0x162095,_0x293c7c])=>'--\x20@lovrabet.'+_0x162095+':\x20'+String(_0x293c7c));}function splitXmlDeclaration(_0x526693){const _0x4d72a7=a255_0x12d2f7,_0x1dc750=_0x526693[_0x4d72a7(0x21a)](),_0x10c2fa=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i[_0x4d72a7(0x225)](_0x1dc750);if(!_0x10c2fa)return{'body':_0x526693};return{'declaration':_0x10c2fa[0x0],'body':_0x1dc750[_0x4d72a7(0x224)](_0x10c2fa[0x0][_0x4d72a7(0x1fd)])};}function a255_0x17c3(_0xda09c,_0xac0a3f){_0xda09c=_0xda09c-0x1f2;const _0x3d861a=a255_0x3d86();let _0x17c397=_0x3d861a[_0xda09c];return _0x17c397;}function stripLeadingMetadataLines(_0x4652d8,_0x5d8f07){const _0x440970=a255_0x12d2f7,_0x4d3e79=_0x4652d8[_0x440970(0x1ff)]('\x0a');let _0x202ce9=0x0;while(_0x202ce9<_0x4d3e79[_0x440970(0x1fd)]){const _0x4c5a3e=_0x4d3e79[_0x202ce9]??'';if(_0x5d8f07['test'](_0x4c5a3e)||_0x4c5a3e[_0x440970(0x216)]()===''){_0x202ce9++;continue;}break;}return _0x4d3e79[_0x440970(0x224)](_0x202ce9)[_0x440970(0x1f7)]('\x0a')[_0x440970(0x21a)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a256_0x8b56f7=a256_0x67fc;(function(_0x415a36,_0x11c8e0){const _0x3fef84=a256_0x67fc,_0x2b9679=_0x415a36();while(!![]){try{const _0x22dac5=-parseInt(_0x3fef84(0x134))/0x1*(parseInt(_0x3fef84(0x11a))/0x2)+-parseInt(_0x3fef84(0x122))/0x3+-parseInt(_0x3fef84(0x135))/0x4+parseInt(_0x3fef84(0x11c))/0x5+parseInt(_0x3fef84(0x120))/0x6+parseInt(_0x3fef84(0x116))/0x7+parseInt(_0x3fef84(0x123))/0x8;if(_0x22dac5===_0x11c8e0)break;else _0x2b9679['push'](_0x2b9679['shift']());}catch(_0x38f4f7){_0x2b9679['push'](_0x2b9679['shift']());}}}(a256_0x45e8,0x8c408));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;async function fetchAllSqlCodes(_0x23a0b6){const _0x45913e=a256_0x67fc,_0x2c0847=[];let _0x2d0d7e=0x1;while(!![]){const _0x5b7b5a=await listSqlQueries(_0x23a0b6,{'currentPage':_0x2d0d7e,'pageSize':PAGE_SIZE}),_0x4b5494=_0x5b7b5a[_0x45913e(0x12d)]??[];_0x2c0847[_0x45913e(0x136)](..._0x4b5494['map'](_0x15239b=>_0x15239b[_0x45913e(0x137)]));if(_0x4b5494['length']===0x0)break;const _0x10c3cf=_0x5b7b5a[_0x45913e(0x125)]?.['totalCount'];if(_0x10c3cf!=null?_0x2c0847[_0x45913e(0x115)]>=_0x10c3cf:_0x4b5494[_0x45913e(0x115)]<PAGE_SIZE)break;_0x2d0d7e++;}return _0x2c0847;}export const sqlStatus={'service':a256_0x8b56f7(0x11d),'command':a256_0x8b56f7(0x133),'description':a256_0x8b56f7(0x118),'risk':a256_0x8b56f7(0x124),'flags':[{'name':a256_0x8b56f7(0x132),'type':a256_0x8b56f7(0x117),'description':a256_0x8b56f7(0x11f)}],async 'execute'(_0x3f91d1){const _0x551ce4=a256_0x8b56f7,_0x462e4d=loadSqlProjectConfig(_0x3f91d1[_0x551ce4(0x12f)]),_0x5c35df=await readSqlLockFile(_0x462e4d[_0x551ce4(0x138)]),{appLock:_0x3e7b2a}=ensureSqlLockScope(_0x5c35df??createEmptySqlLock(),_0x462e4d[_0x551ce4(0x12f)],_0x462e4d['sqlRoot'],_0x551ce4(0x133)),_0x334978=await scanLocalSqlQueries(_0x462e4d),_0x20921f=[],_0x11aefe=[],_0x44a125=[],_0x3b6eb4=[],_0x5acbf9=new Set(_0x334978[_0x551ce4(0x12b)](_0xec1f99=>_0xec1f99[_0x551ce4(0x127)]));for(const _0x4fe9ce of _0x334978){const _0x3ec5f5=await computeSqlFileHash(_0x4fe9ce[_0x551ce4(0x12c)]),_0x4f0ecc=_0x3e7b2a['sqls'][_0x4fe9ce[_0x551ce4(0x127)]],_0x4f52ea=!!_0x4f0ecc&&_0x4f0ecc['path']!==_0x4fe9ce['relativePath'],_0x4be020=!!_0x4f0ecc&&!!_0x4fe9ce[_0x551ce4(0x12a)]&&_0x4f0ecc[_0x551ce4(0x12a)]!==_0x4fe9ce[_0x551ce4(0x12a)];if(!_0x4f0ecc)_0x20921f['push'](_0x4fe9ce[_0x551ce4(0x127)]);else _0x4f0ecc[_0x551ce4(0x130)]!==_0x3ec5f5||_0x4f52ea||_0x4be020?_0x11aefe[_0x551ce4(0x136)](_0x4fe9ce[_0x551ce4(0x127)]):_0x44a125[_0x551ce4(0x136)](_0x4fe9ce['lockKey']);}for(const _0x1b1cac of Object[_0x551ce4(0x121)](_0x3e7b2a['sqls'])){!_0x5acbf9['has'](_0x1b1cac)&&_0x3b6eb4[_0x551ce4(0x136)](_0x1b1cac);}const _0x5d7e92=[];if(_0x3f91d1[_0x551ce4(0x126)](_0x551ce4(0x132))){const _0x312ae1=await fetchAllSqlCodes(_0x3f91d1['appCode']);for(const _0x544c34 of _0x312ae1){!_0x5acbf9[_0x551ce4(0x11b)](_0x544c34)&&!_0x3e7b2a[_0x551ce4(0x129)][_0x544c34]&&_0x5d7e92[_0x551ce4(0x136)](_0x544c34);}}const _0x2c85d4=_0x20921f[_0x551ce4(0x115)]===0x0&&_0x11aefe[_0x551ce4(0x115)]===0x0&&_0x3b6eb4['length']===0x0&&_0x5d7e92[_0x551ce4(0x115)]===0x0;return{'ok':!![],'data':{'added':_0x20921f,'modified':_0x11aefe,'missing':_0x3b6eb4,'unchanged':_0x44a125,'remoteOnly':_0x5d7e92},'message':_0x2c85d4?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x20921f[_0x551ce4(0x115)]+_0x551ce4(0x131)+_0x11aefe['length']+_0x551ce4(0x128)+_0x3b6eb4[_0x551ce4(0x115)]+_0x551ce4(0x11e)+_0x44a125[_0x551ce4(0x115)]+_0x551ce4(0x12e)+(_0x5d7e92[_0x551ce4(0x115)]>0x0?',\x20'+_0x5d7e92[_0x551ce4(0x115)]+_0x551ce4(0x119):'')};}};function a256_0x67fc(_0x4ddf6b,_0x413c52){_0x4ddf6b=_0x4ddf6b-0x115;const _0x45e8da=a256_0x45e8();let _0x67fc08=_0x45e8da[_0x4ddf6b];return _0x67fc08;}function a256_0x45e8(){const _0x3b61d7=['read','paging','bool','lockKey','\x20modified,\x20','sqls','sqlName','map','filePath','tableData','\x20unchanged','appCode','hash','\x20added,\x20','remote','status','27053WSfdvT','2500636wxKlgA','push','sqlCode','lockFilePath','length','555128kxLZxH','boolean','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','\x20remote-only','18RZAjpS','has','1141570AZyQdc','sql','\x20missing,\x20','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','1613454qqvdOy','keys','2012367SnzNfx','12298960TIzdBe'];a256_0x45e8=function(){return _0x3b61d7;};return a256_0x45e8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a257_0x3982(){const _0x350bda=['isArray','check-indexes','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','8MTASbl','validate','toLowerCase','isSelectOnly','index_type','message','from','cwd','type','--check-indexes\x20requires\x20--schemas.','schemaWarnings','filter','Dataset\x20\x22','name','joinAudit','string','367483WcZPZD','sqlType','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','\x22\x20not\x20found\x20in\x20any\x20dataset','index_columns','indexes','parameters','sql','map','utf-8','read','indexName','validation','9416862ZnbxNj','split','dataset','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','isLockingRead','Table\x20\x22','1486724fJAqqu','file','bool','3095UpHiFu','dbtableConfig','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','columns','columnNames','Provide\x20--file\x20or\x20--sql','str','tableName','flagMissing','reason','schemas','SQL\x20schema\x20validation','File\x20not\x20found:\x20','2778CDLCdk','tables','323194CCmXuZ','2504719RTpYsF','find','length','valid','trim','31215loXTdn','flatMap','fields'];a257_0x3982=function(){return _0x350bda;};return a257_0x3982();}const a257_0x5ce3f1=a257_0xed2e;(function(_0x16ae0,_0x3a9041){const _0x414449=a257_0xed2e,_0x286026=_0x16ae0();while(!![]){try{const _0x3449a8=-parseInt(_0x414449(0x1d3))/0x1+-parseInt(_0x414449(0x1b7))/0x2+parseInt(_0x414449(0x1bd))/0x3+parseInt(_0x414449(0x1a5))/0x4+-parseInt(_0x414449(0x1a8))/0x5*(parseInt(_0x414449(0x1b5))/0x6)+parseInt(_0x414449(0x1b8))/0x7*(-parseInt(_0x414449(0x1c3))/0x8)+parseInt(_0x414449(0x19f))/0x9;if(_0x3449a8===_0x3a9041)break;else _0x286026['push'](_0x286026['shift']());}catch(_0x5e0740){_0x286026['push'](_0x286026['shift']());}}}(a257_0x3982,0x3e3be));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';function a257_0xed2e(_0x453eae,_0x1b2502){_0x453eae=_0x453eae-0x19d;const _0x398207=a257_0x3982();let _0xed2e90=_0x398207[_0x453eae];return _0xed2e90;}export const sqlValidate={'service':a257_0x5ce3f1(0x1da),'command':a257_0x5ce3f1(0x1c4),'description':a257_0x5ce3f1(0x1d5),'risk':a257_0x5ce3f1(0x1dd),'flags':[{'name':a257_0x5ce3f1(0x1a6),'type':a257_0x5ce3f1(0x1d2),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a257_0x5ce3f1(0x1da),'type':'string','description':a257_0x5ce3f1(0x1a2)},{'name':a257_0x5ce3f1(0x1b2),'type':a257_0x5ce3f1(0x1d2),'description':a257_0x5ce3f1(0x1aa)},{'name':a257_0x5ce3f1(0x1c1),'type':'boolean','description':a257_0x5ce3f1(0x1c2)}],async 'execute'(_0xeab5bf){const _0x4e26cc=a257_0x5ce3f1,_0x8e416d=_0xeab5bf['str'](_0x4e26cc(0x1a6)),_0x5732f3=_0xeab5bf[_0x4e26cc(0x1ae)](_0x4e26cc(0x1da)),_0x4f9bdb=_0xeab5bf[_0x4e26cc(0x1ae)](_0x4e26cc(0x1b2)),_0x4d8817=_0xeab5bf[_0x4e26cc(0x1a7)]('check-indexes');if(!_0x8e416d&&!_0x5732f3)throw CliErrors[_0x4e26cc(0x1b0)](_0x4e26cc(0x1a6),_0x4e26cc(0x1ad));if(_0x4d8817&&!_0x4f9bdb)throw CliErrors[_0x4e26cc(0x19e)](_0x4e26cc(0x1cc));let _0x1c691d;if(_0x8e416d){const _0x2dd79a=resolve(process[_0x4e26cc(0x1ca)](),_0x8e416d);if(!existsSync(_0x2dd79a))throw CliErrors['validation'](_0x4e26cc(0x1b4)+_0x2dd79a);_0x1c691d=readFileSync(_0x2dd79a,_0x4e26cc(0x1dc));}else _0x1c691d=_0x5732f3;const _0x1f75ab=validateSql(_0x1c691d),_0x58a9cc={'valid':_0x1f75ab[_0x4e26cc(0x1bb)],'sqlType':_0x1f75ab['sqlType'][_0x4e26cc(0x1cb)],'isSelectOnly':_0x1f75ab[_0x4e26cc(0x1d4)][_0x4e26cc(0x1c6)],'isLockingRead':_0x1f75ab[_0x4e26cc(0x1d4)][_0x4e26cc(0x1a3)]??![],'isDangerous':_0x1f75ab['sqlType']['isDangerous'],'tables':_0x1f75ab[_0x4e26cc(0x1b6)],'parameters':_0x1f75ab[_0x4e26cc(0x1d9)],'message':_0x1f75ab[_0x4e26cc(0x1c8)]};_0x1f75ab[_0x4e26cc(0x1d4)]['reason']&&(_0x58a9cc[_0x4e26cc(0x1b1)]=_0x1f75ab[_0x4e26cc(0x1d4)]['reason']);if(_0x4f9bdb&&_0x1f75ab['valid']){const _0x4fab16=_0x4f9bdb[_0x4e26cc(0x1a0)](',')['map'](_0x3caf4a=>_0x3caf4a[_0x4e26cc(0x1bc)]())[_0x4e26cc(0x1ce)](Boolean),_0x3a3fd5=[],_0xd8e78b=[],_0x39324f=filterDbTableBackedDatasets(await listDatasets(_0xeab5bf['appCode'])),_0x5bdc7f=new Map(_0x39324f[_0x4e26cc(0x1db)](_0x589554=>[_0x589554[_0x4e26cc(0x1a9)]?.[_0x4e26cc(0x1af)]?.[_0x4e26cc(0x1c5)](),_0x589554]));for(const _0x1bbb63 of _0x1f75ab[_0x4e26cc(0x1b6)]){const _0x3f32a0=_0x5bdc7f['get'](_0x1bbb63['toLowerCase']());!_0x3f32a0&&_0x3a3fd5['push'](_0x4e26cc(0x1a4)+_0x1bbb63+_0x4e26cc(0x1d6));}for(const _0x2a6795 of _0x4fab16){let _0x262632;try{_0x262632=await getDatasetDetail(_0x2a6795);}catch{_0x3a3fd5['push'](_0x4e26cc(0x1cf)+_0x2a6795+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0x262632,_0x4e26cc(0x1b3));const _0x4ebee6=Array[_0x4e26cc(0x1c0)](_0x262632[_0x4e26cc(0x1bf)])?_0x262632[_0x4e26cc(0x1bf)]:[],_0x3363bf=new Set(_0x4ebee6[_0x4e26cc(0x1db)](_0x530ee4=>_0x530ee4[_0x4e26cc(0x1d0)]?.[_0x4e26cc(0x1c5)]())),_0x446bf5=_0x262632[_0x4e26cc(0x1a9)]?.['tableName']||_0x262632['tableName']||_0x2a6795;_0x58a9cc['schema:'+_0x446bf5]={'code':_0x2a6795,'tableName':_0x446bf5,'fieldCount':_0x3363bf['size'],'fields':Array[_0x4e26cc(0x1c9)](_0x3363bf)};if(_0x4d8817){const _0x114651=normalizeDatasetIndexes(_0x262632);_0xd8e78b['push']({'tableName':_0x446bf5,..._0x114651});}}_0x3a3fd5[_0x4e26cc(0x1ba)]>0x0&&(_0x58a9cc[_0x4e26cc(0x1cd)]=_0x3a3fd5),_0x4d8817&&(_0x58a9cc[_0x4e26cc(0x1d1)]=auditSqlJoinIndexes(_0x1c691d,_0xd8e78b));}return{'ok':_0x1f75ab[_0x4e26cc(0x1bb)],'data':_0x58a9cc,'message':_0x1f75ab[_0x4e26cc(0x1c8)]};}};function normalizeDatasetIndexes(_0x14a5ab){const _0x5b95b8=a257_0x5ce3f1,_0x30cdc5=Array[_0x5b95b8(0x1c0)](_0x14a5ab?.[_0x5b95b8(0x1a1)]?.[_0x5b95b8(0x1d8)])?_0x14a5ab[_0x5b95b8(0x1a1)][_0x5b95b8(0x1d8)]:Array[_0x5b95b8(0x1c0)](_0x14a5ab?.[_0x5b95b8(0x1d8)])?_0x14a5ab[_0x5b95b8(0x1d8)]:[],_0x4b7e4a=_0x30cdc5[_0x5b95b8(0x1be)](_0x2c7138=>{const _0x3b77b8=_0x5b95b8,_0x46f7cc=Array[_0x3b77b8(0x1c0)](_0x2c7138?.[_0x3b77b8(0x1d7)])?_0x2c7138['index_columns']:Array[_0x3b77b8(0x1c0)](_0x2c7138?.['columnNames'])?_0x2c7138[_0x3b77b8(0x1ac)]:Array['isArray'](_0x2c7138?.[_0x3b77b8(0x1ab)])?_0x2c7138['columns']:[],_0x68f90e=_0x46f7cc[_0x3b77b8(0x1ce)](_0x47c0c9=>typeof _0x47c0c9===_0x3b77b8(0x1d2))[_0x3b77b8(0x1db)](_0x1c17d3=>_0x1c17d3[_0x3b77b8(0x1bc)]())[_0x3b77b8(0x1ce)](Boolean);if(_0x68f90e[_0x3b77b8(0x1ba)]===0x0)return[];const _0x45034e=[_0x2c7138?.[_0x3b77b8(0x19d)],_0x2c7138?.['index_name'],_0x2c7138?.[_0x3b77b8(0x1d0)]][_0x3b77b8(0x1b9)](_0x216b83=>typeof _0x216b83===_0x3b77b8(0x1d2)&&_0x216b83['trim']()),_0x2ee8fa=[_0x2c7138?.[_0x3b77b8(0x1c7)],_0x2c7138?.[_0x3b77b8(0x1cb)]]['find'](_0x5d8463=>typeof _0x5d8463==='string'&&_0x5d8463[_0x3b77b8(0x1bc)]());return[{..._0x45034e?{'name':_0x45034e['trim']()}:{},..._0x2ee8fa?{'type':_0x2ee8fa[_0x3b77b8(0x1bc)]()}:{},'columns':_0x68f90e}];}),_0x416623=[..._0x4b7e4a],_0x4a4e9d=typeof _0x14a5ab?.[_0x5b95b8(0x1a9)]?.['pkField']==='string'?_0x14a5ab[_0x5b95b8(0x1a9)]['pkField'][_0x5b95b8(0x1a0)](',')[_0x5b95b8(0x1db)](_0x4a1a4f=>_0x4a1a4f[_0x5b95b8(0x1bc)]())[_0x5b95b8(0x1ce)](Boolean):[];return _0x4a4e9d['length']>0x0&&_0x416623['unshift']({'type':'primary','columns':_0x4a4e9d}),{'indexes':_0x416623,'metadataAvailable':_0x4b7e4a[_0x5b95b8(0x1ba)]>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a258_0x4d78(_0x3c08c6,_0x3730be){_0x3c08c6=_0x3c08c6-0x1bd;const _0x4531f6=a258_0x4531();let _0x4d7855=_0x4531f6[_0x3c08c6];return _0x4d7855;}(function(_0x206dcd,_0x2bb933){const _0x4b095c=a258_0x4d78,_0x359565=_0x206dcd();while(!![]){try{const _0x32f5ed=parseInt(_0x4b095c(0x1c3))/0x1*(parseInt(_0x4b095c(0x1c5))/0x2)+-parseInt(_0x4b095c(0x1c6))/0x3+parseInt(_0x4b095c(0x1be))/0x4*(parseInt(_0x4b095c(0x1c0))/0x5)+-parseInt(_0x4b095c(0x1bd))/0x6+-parseInt(_0x4b095c(0x1c2))/0x7+parseInt(_0x4b095c(0x1bf))/0x8*(-parseInt(_0x4b095c(0x1c4))/0x9)+parseInt(_0x4b095c(0x1c1))/0xa;if(_0x32f5ed===_0x2bb933)break;else _0x359565['push'](_0x359565['shift']());}catch(_0x355472){_0x359565['push'](_0x359565['shift']());}}}(a258_0x4531,0x2be9f));function a258_0x4531(){const _0x389597=['1289605xzdnJC','1243720JQJwUL','1860782saDNCy','181SSmSEO','117PUeNSV','3304WokEqo','3210seEngw','281610JajjJZ','4dszeiD','115448Mpnijs'];a258_0x4531=function(){return _0x389597;};return a258_0x4531();}import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a259_0x120166=a259_0x5d99;(function(_0x27422d,_0x3e4a3b){const _0x35eedd=a259_0x5d99,_0x24982d=_0x27422d();while(!![]){try{const _0x4b7a43=-parseInt(_0x35eedd(0xb3))/0x1*(parseInt(_0x35eedd(0xbb))/0x2)+parseInt(_0x35eedd(0xb6))/0x3+-parseInt(_0x35eedd(0xba))/0x4+parseInt(_0x35eedd(0xc0))/0x5+parseInt(_0x35eedd(0xbd))/0x6*(-parseInt(_0x35eedd(0xae))/0x7)+-parseInt(_0x35eedd(0xb0))/0x8*(-parseInt(_0x35eedd(0xbc))/0x9)+-parseInt(_0x35eedd(0xc7))/0xa*(parseInt(_0x35eedd(0xc2))/0xb);if(_0x4b7a43===_0x3e4a3b)break;else _0x24982d['push'](_0x24982d['shift']());}catch(_0x54506a){_0x24982d['push'](_0x24982d['shift']());}}}(a259_0x174e,0xaa896));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a259_0x5d99(_0x107fe3,_0x267823){_0x107fe3=_0x107fe3-0xae;const _0x174eca=a259_0x174e();let _0x5d9950=_0x174eca[_0x107fe3];return _0x5d9950;}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a259_0x174e(){const _0x3ba3bd=['string','task','813104DZizvU','10ryvXkD','9703746QzATgR','4404CdjXAy','isTerminal','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','385145dMuIjp','apiError','154FdvOQt','compress','str','task-id','status','423960AtYwOp','3871eXOqXW','trim','8zyFEZj','taskId','cookie','50877XJvhMz','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED',',\x20received\x20','3001206kkjuTV','appCode'];a259_0x174e=function(){return _0x3ba3bd;};return a259_0x174e();}export const taskStatus={'service':a259_0x120166(0xb9),'command':a259_0x120166(0xc6),'description':a259_0x120166(0xb4),'risk':'read','defaultOutputFormat':a259_0x120166(0xc3),'structuredErrors':!![],'flags':[{'name':a259_0x120166(0xc5),'type':a259_0x120166(0xb8),'required':!![],'description':a259_0x120166(0xbf)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x597c42){const _0x395589=a259_0x120166;if(!_0x597c42[_0x395589(0xc4)](_0x395589(0xc5))['trim']())throw CliErrors['flagMissing'](_0x395589(0xc5));},async 'execute'(_0x27d5ec){const _0xba5363=a259_0x120166,_0x42cee3=_0x27d5ec[_0xba5363(0xc4)](_0xba5363(0xc5))[_0xba5363(0xaf)](),_0x21116c=normalizeAsyncTask(await getAsyncTaskStatus(_0x42cee3,_0x27d5ec[_0xba5363(0xb7)],_0x27d5ec[_0xba5363(0xb2)]));if(_0x21116c['taskId']!==_0x42cee3)throw CliErrors[_0xba5363(0xc1)]('Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20'+_0x42cee3+_0xba5363(0xb5)+_0x21116c[_0xba5363(0xb1)]+'.');const _0x20a9ee=buildAsyncTaskStatusCommand(_0x21116c[_0xba5363(0xb1)],_0x27d5ec[_0xba5363(0xb7)]);return{'ok':!![],'message':asyncTaskMessage(_0x21116c),'data':{'appCode':_0x27d5ec[_0xba5363(0xb7)],..._0x21116c,'query':_0x21116c[_0xba5363(0xbe)]?null:{'command':_0x20a9ee}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x20274c,_0x431ddb){const _0x53ee77=a260_0x3f58,_0x2a19b9=_0x20274c();while(!![]){try{const _0x58efe9=-parseInt(_0x53ee77(0xb3))/0x1+parseInt(_0x53ee77(0xb1))/0x2*(-parseInt(_0x53ee77(0xbc))/0x3)+parseInt(_0x53ee77(0xb7))/0x4*(-parseInt(_0x53ee77(0xb2))/0x5)+-parseInt(_0x53ee77(0xb9))/0x6+parseInt(_0x53ee77(0xba))/0x7*(parseInt(_0x53ee77(0xb4))/0x8)+-parseInt(_0x53ee77(0xbb))/0x9*(-parseInt(_0x53ee77(0xb5))/0xa)+parseInt(_0x53ee77(0xb8))/0xb*(parseInt(_0x53ee77(0xb6))/0xc);if(_0x58efe9===_0x431ddb)break;else _0x2a19b9['push'](_0x2a19b9['shift']());}catch(_0x35a9fe){_0x2a19b9['push'](_0x2a19b9['shift']());}}}(a260_0x1344,0x22e2e));function a260_0x3f58(_0x3950e1,_0x1e81e8){_0x3950e1=_0x3950e1-0xb1;const _0x134456=a260_0x1344();let _0x3f58b1=_0x134456[_0x3950e1];return _0x3f58b1;}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a260_0x1344(){const _0x5206cf=['9SucpRk','590073aRLVeq','2JlrhIF','135350hhHSiU','152656NloeYw','112hudKDG','642310xVfdpF','7453764EgZtYP','32Snoaxo','11MhAPXq','1281666XDFZTW','118517jFVpRX'];a260_0x1344=function(){return _0x5206cf;};return a260_0x1344();}export const tenantDefinitions=[tenantMembersListDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a261_0x5455(){const _0x2a4505=['1188TAhIbT','trim','232MJMcaF','flagMissing','34092RvQTnU','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','145625CyAIEV','3PxuGQh','146970Kugtbt','members-list','tenant','Exact\x20tenant\x20code','7580MbUkat','69dDBPZj','1426509aCknxH','str','tenant-code','5649OXeioM','90044mbFpnL','string'];a261_0x5455=function(){return _0x2a4505;};return a261_0x5455();}const a261_0xfbe902=a261_0x3827;function a261_0x3827(_0x1e1d2e,_0x5a51b9){_0x1e1d2e=_0x1e1d2e-0x8f;const _0x545519=a261_0x5455();let _0x3827d1=_0x545519[_0x1e1d2e];return _0x3827d1;}(function(_0x2f625e,_0x21f622){const _0x3262b3=a261_0x3827,_0xd52d28=_0x2f625e();while(!![]){try{const _0x3a0c1a=parseInt(_0x3262b3(0x9a))/0x1*(parseInt(_0x3262b3(0x91))/0x2)+-parseInt(_0x3262b3(0xa0))/0x3*(parseInt(_0x3262b3(0x97))/0x4)+-parseInt(_0x3262b3(0x99))/0x5+parseInt(_0x3262b3(0x9b))/0x6+parseInt(_0x3262b3(0x90))/0x7*(-parseInt(_0x3262b3(0x95))/0x8)+parseInt(_0x3262b3(0xa1))/0x9+-parseInt(_0x3262b3(0x9f))/0xa*(-parseInt(_0x3262b3(0x93))/0xb);if(_0x3a0c1a===_0x21f622)break;else _0xd52d28['push'](_0xd52d28['shift']());}catch(_0x3a8382){_0xd52d28['push'](_0xd52d28['shift']());}}}(a261_0x5455,0x24f49));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a261_0xfbe902(0x9d),'command':a261_0xfbe902(0x9c),'description':a261_0xfbe902(0x98),'risk':'read','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a261_0xfbe902(0x8f),'type':a261_0xfbe902(0x92),'required':!![],'description':a261_0xfbe902(0x9e)}],async 'validate'(_0x3a3aab){const _0x561ce2=a261_0xfbe902;if(!_0x3a3aab['str'](_0x561ce2(0x8f))[_0x561ce2(0x94)]())throw CliErrors[_0x561ce2(0x96)](_0x561ce2(0x8f),'Pass\x20--tenant-code\x20<code>.');},async 'execute'(_0x4bd744){const _0x25ded7=a261_0xfbe902,_0x1d8968=_0x4bd744[_0x25ded7(0xa2)](_0x25ded7(0x8f))['trim'](),_0x402d99=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x1d8968,_0x402d99);const _0x17dc77=projectTenantMembers(await listTenantDirectoryMembers(_0x1d8968));return{'ok':!![],'data':{'tenantCode':_0x1d8968,'items':_0x17dc77,'totalCount':_0x17dc77['length']},'message':'Found\x20'+_0x17dc77['length']+'\x20tenant\x20member(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1babf1,_0xa1cebf){const _0x24249b=a262_0x5502,_0x1c1f1a=_0x1babf1();while(!![]){try{const _0x4274e7=-parseInt(_0x24249b(0x8c))/0x1*(parseInt(_0x24249b(0x96))/0x2)+-parseInt(_0x24249b(0x8e))/0x3+parseInt(_0x24249b(0x9d))/0x4+parseInt(_0x24249b(0x93))/0x5+parseInt(_0x24249b(0x88))/0x6*(parseInt(_0x24249b(0x9c))/0x7)+-parseInt(_0x24249b(0x8b))/0x8*(parseInt(_0x24249b(0x9a))/0x9)+parseInt(_0x24249b(0x9b))/0xa;if(_0x4274e7===_0xa1cebf)break;else _0x1c1f1a['push'](_0x1c1f1a['shift']());}catch(_0x48bdca){_0x1c1f1a['push'](_0x1c1f1a['shift']());}}}(a262_0x13ba,0x2b50c));function a262_0x5502(_0x7a2a85,_0x3e2a50){_0x7a2a85=_0x7a2a85-0x82;const _0x13ba1d=a262_0x13ba();let _0x5502b1=_0x13ba1d[_0x7a2a85];return _0x5502b1;}import{CliErrors}from'../../errors.js';function a262_0x13ba(){const _0x4bd3ae=['displayName','status','47896VhwObH','300631neBRkh','values','551274sMYJbP','username','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','validation','ADMIN','1397990OZEUTJ','userId','some','2tdUJYr','isFinite','role','get','495HdNwgB','5424060EKhQTv','7ofkhre','366124EqOeCB','trim','nickname','Tenant\x20\x22','sort','set','tenantCode','adminFlag','465354HwJkJD'];a262_0x13ba=function(){return _0x4bd3ae;};return a262_0x13ba();}function textOrNull(_0x5b7651){const _0x9fb73d=a262_0x5502,_0xb355ad=_0x5b7651?.[_0x9fb73d(0x9e)]();return _0xb355ad?_0xb355ad:null;}export function projectTenantMembers(_0x139ddf){const _0x1fd13f=a262_0x5502,_0x3442d9=new Map();for(const _0x6075d6 of _0x139ddf){const _0x2f73bc=Number(_0x6075d6[_0x1fd13f(0x94)]);if(!Number[_0x1fd13f(0x97)](_0x2f73bc)||_0x2f73bc<=0x0)continue;const _0x41e780={'userId':_0x2f73bc,'username':textOrNull(_0x6075d6[_0x1fd13f(0x8f)]),'displayName':textOrNull(_0x6075d6[_0x1fd13f(0x82)]),'role':_0x6075d6[_0x1fd13f(0x87)]===!![]?_0x1fd13f(0x92):'MEMBER','status':textOrNull(_0x6075d6[_0x1fd13f(0x8a)])},_0x3f02c0=_0x3442d9[_0x1fd13f(0x99)](_0x2f73bc);if(!_0x3f02c0){_0x3442d9[_0x1fd13f(0x85)](_0x2f73bc,_0x41e780);continue;}_0x3f02c0[_0x1fd13f(0x8f)]??=_0x41e780[_0x1fd13f(0x8f)],_0x3f02c0['displayName']??=_0x41e780[_0x1fd13f(0x89)],_0x3f02c0[_0x1fd13f(0x8a)]??=_0x41e780[_0x1fd13f(0x8a)];if(_0x41e780[_0x1fd13f(0x98)]===_0x1fd13f(0x92))_0x3f02c0[_0x1fd13f(0x98)]='ADMIN';}return[..._0x3442d9[_0x1fd13f(0x8d)]()][_0x1fd13f(0x84)]((_0x40ac6e,_0x4c8058)=>_0x40ac6e[_0x1fd13f(0x94)]-_0x4c8058[_0x1fd13f(0x94)]);}export function assertTenantAccessible(_0x555786,_0x2daa09){const _0x3a5fee=a262_0x5502;if(_0x2daa09[_0x3a5fee(0x95)](_0x12153d=>_0x12153d[_0x3a5fee(0x86)]===_0x555786))return;throw CliErrors[_0x3a5fee(0x91)](_0x3a5fee(0x83)+_0x555786+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.',_0x3a5fee(0x90));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a263_0x5c5e41=a263_0x1296;(function(_0x563984,_0x3793ba){const _0x3b5554=a263_0x1296,_0x441f6e=_0x563984();while(!![]){try{const _0x34082e=parseInt(_0x3b5554(0x151))/0x1*(parseInt(_0x3b5554(0x162))/0x2)+-parseInt(_0x3b5554(0x14a))/0x3*(parseInt(_0x3b5554(0x14d))/0x4)+parseInt(_0x3b5554(0x14e))/0x5*(parseInt(_0x3b5554(0x14b))/0x6)+-parseInt(_0x3b5554(0x15e))/0x7+parseInt(_0x3b5554(0x157))/0x8+-parseInt(_0x3b5554(0x152))/0x9+parseInt(_0x3b5554(0x14c))/0xa*(parseInt(_0x3b5554(0x15c))/0xb);if(_0x34082e===_0x3793ba)break;else _0x441f6e['push'](_0x441f6e['shift']());}catch(_0x384f87){_0x441f6e['push'](_0x441f6e['shift']());}}}(a263_0x4248,0x3fed5));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';function a263_0x1296(_0x18b545,_0x9259a6){_0x18b545=_0x18b545-0x14a;const _0x424804=a263_0x4248();let _0x129667=_0x424804[_0x18b545];return _0x129667;}function a263_0x4248(){const _0x1c8d3c=['Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','dingtalk','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','3101984BpyBqn','POST','apiError','user-account','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','367345ErDubP','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','1582525nfbWei','dingding-sandbox-bind','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','--ding-talk-user-id\x20cannot\x20be\x20empty.','2NZOrmA','bind','str','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','write','510105mkJqOf','6KIyKRQ','130BbIPCD','12vrAgob','129245EMFlIz','ding-talk-user-id','string','398457CuRduf','2233476eTXDLD','validation'];a263_0x4248=function(){return _0x1c8d3c;};return a263_0x4248();}const PROVIDER_ID=a263_0x5c5e41(0x155),CURRENT_BINDING_WARNING=a263_0x5c5e41(0x160);function readDingTalkUserId(_0x1e75a1){const _0x2c4d2b=a263_0x5c5e41,_0xff330d=_0x1e75a1[_0x2c4d2b(0x164)](_0x2c4d2b(0x14f))['trim']();if(!_0xff330d)throw CliErrors[_0x2c4d2b(0x153)](_0x2c4d2b(0x161),_0x2c4d2b(0x15b));return _0xff330d;}function buildBindingData(_0x171ed1,_0x50f338){const _0x3f69fe=a263_0x5c5e41;return{'operation':_0x3f69fe(0x163),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x171ed1},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x171ed1,'bound':!![]},'dryRun':_0x50f338,'backend':{'method':_0x3f69fe(0x158),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a263_0x5c5e41(0x15a),'command':a263_0x5c5e41(0x15f),'description':a263_0x5c5e41(0x15d),'risk':a263_0x5c5e41(0x166),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a263_0x5c5e41(0x14f),'type':a263_0x5c5e41(0x150),'required':!![],'description':a263_0x5c5e41(0x156)}],async 'validate'(_0x3b6052){readDingTalkUserId(_0x3b6052);},async 'dryRun'(_0x1aa9dd){const _0x1efe26=a263_0x5c5e41,_0x3ffa61=readDingTalkUserId(_0x1aa9dd);return asDryRunResult(buildBindingData(_0x3ffa61,!![]),{'method':_0x1efe26(0x158),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x2c92a5){const _0x1c7aeb=a263_0x5c5e41,_0x3bc985=readDingTalkUserId(_0x2c92a5),_0x1cd49e=await bindDingTalkSandboxAccount(_0x3bc985);if(_0x1cd49e!==!![])throw CliErrors[_0x1c7aeb(0x159)](_0x1c7aeb(0x165),'Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.');return{'ok':!![],'data':buildBindingData(_0x3bc985,![]),'message':_0x1c7aeb(0x154)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a264_0x17fb00=a264_0xb105;(function(_0x40e777,_0x2d0b24){const _0x5343b6=a264_0xb105,_0x6a891a=_0x40e777();while(!![]){try{const _0x52bbdf=-parseInt(_0x5343b6(0x137))/0x1*(-parseInt(_0x5343b6(0x147))/0x2)+-parseInt(_0x5343b6(0x13b))/0x3+parseInt(_0x5343b6(0x136))/0x4+parseInt(_0x5343b6(0x141))/0x5*(-parseInt(_0x5343b6(0x143))/0x6)+-parseInt(_0x5343b6(0x146))/0x7+-parseInt(_0x5343b6(0x14a))/0x8*(-parseInt(_0x5343b6(0x132))/0x9)+parseInt(_0x5343b6(0x13f))/0xa*(parseInt(_0x5343b6(0x145))/0xb);if(_0x52bbdf===_0x2d0b24)break;else _0x6a891a['push'](_0x6a891a['shift']());}catch(_0x8dba0a){_0x6a891a['push'](_0x6a891a['shift']());}}}(a264_0x4722,0x7c166));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindFeishuAccount,FEISHU_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a264_0xb105(_0x16b54f,_0x5e7307){_0x16b54f=_0x16b54f-0x131;const _0x4722f0=a264_0x4722();let _0xb105ff=_0x4722f0[_0x16b54f];return _0xb105ff;}const PROVIDER_ID=a264_0x17fb00(0x144),CURRENT_BINDING_WARNING=a264_0x17fb00(0x133);function readUnionId(_0x29b806){const _0x5d6953=a264_0x17fb00,_0x4d3aa1=_0x29b806[_0x5d6953(0x13c)](_0x5d6953(0x140))[_0x5d6953(0x142)]();if(!/^on_[A-Za-z0-9_-]+$/[_0x5d6953(0x13d)](_0x4d3aa1))throw CliErrors[_0x5d6953(0x134)]('--union-id\x20must\x20match\x20on_\x20followed\x20by\x20letters,\x20digits,\x20underscores,\x20or\x20hyphens.','Pass\x20a\x20Feishu\x20union\x20id\x20such\x20as\x20on_example_001.');return _0x4d3aa1;}function buildBindingData(_0x5a9682,_0x541393){return{'operation':'bind','selector':{'providerId':PROVIDER_ID,'unionId':_0x5a9682},'before':null,'after':{'providerId':PROVIDER_ID,'unionId':_0x5a9682,'bound':!![]},'dryRun':_0x541393,'backend':{'method':'POST','path':FEISHU_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const feishuBind={'service':a264_0x17fb00(0x135),'command':a264_0x17fb00(0x13a),'description':a264_0x17fb00(0x138),'risk':a264_0x17fb00(0x13e),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a264_0x17fb00(0x140),'type':a264_0x17fb00(0x131),'required':!![],'description':'Feishu\x20union_id\x20for\x20the\x20configured\x20Feishu\x20application\x20developer'}],async 'validate'(_0x4954e6){readUnionId(_0x4954e6);},async 'dryRun'(_0x988696){const _0x6522d=a264_0x17fb00,_0xcfac6b=readUnionId(_0x988696);return asDryRunResult(buildBindingData(_0xcfac6b,!![]),{'method':_0x6522d(0x14b),'url':FEISHU_BIND_PATH});},async 'execute'(_0xdcee0c){const _0x206c84=a264_0x17fb00,_0x41c85e=readUnionId(_0xdcee0c),_0x4fe650=await bindFeishuAccount(_0x41c85e);if(_0x4fe650!==!![])throw CliErrors[_0x206c84(0x139)](_0x206c84(0x149),'Verify\x20the\x20current\x20binding\x20through\x20the\x20platform\x20before\x20explicitly\x20retrying;\x20do\x20not\x20automatically\x20retry.');return{'ok':!![],'data':buildBindingData(_0x41c85e,![]),'message':_0x206c84(0x148)};}};function a264_0x4722(){const _0x195073=['apiError','feishu-bind','512706huVmnG','str','test','write','10WnYKOz','union-id','3005315HIZVYQ','trim','6TeFGln','feishu','2074666kafgFQ','3744314NjCHdJ','2FPKzPM','Bound\x20current\x20user\x20to\x20Feishu\x20account.','Feishu\x20account\x20binding\x20was\x20not\x20confirmed.','8VCzAeN','POST','string','165600uUfboa','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','validation','user-account','3726352MjyYsr','676535ANDVmE','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20Feishu\x20account'];a264_0x4722=function(){return _0x195073;};return a264_0x4722();}
|