@lovrabet/rabetbase-cli 2.5.2-beta.6 → 2.5.2-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.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/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/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/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/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/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/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a204_0x28137c=a204_0x4e5c;(function(_0x57137e,_0x44aaf4){const _0x1f8e43=a204_0x4e5c,_0x38c52d=_0x57137e();while(!![]){try{const _0xbf8c97=-parseInt(_0x1f8e43(0x191))/0x1+-parseInt(_0x1f8e43(0x19f))/0x2*(-parseInt(_0x1f8e43(0x17c))/0x3)+-parseInt(_0x1f8e43(0x19d))/0x4+-parseInt(_0x1f8e43(0x178))/0x5*(-parseInt(_0x1f8e43(0x16d))/0x6)+-parseInt(_0x1f8e43(0x193))/0x7*(-parseInt(_0x1f8e43(0x1a6))/0x8)+parseInt(_0x1f8e43(0x16e))/0x9+-parseInt(_0x1f8e43(0x184))/0xa*(parseInt(_0x1f8e43(0x169))/0xb);if(_0xbf8c97===_0x44aaf4)break;else _0x38c52d['push'](_0x38c52d['shift']());}catch(_0x2715dc){_0x38c52d['push'](_0x38c52d['shift']());}}}(a204_0x3453,0x8bcb3));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start',a204_0x28137c(0x17a)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set(['start',a204_0x28137c(0x17a),a204_0x28137c(0x192),a204_0x28137c(0x175)]);export function syncProjectDomainRoutingBeforeScript(_0x57b10d,_0x194ee7){const _0x21862=a204_0x28137c;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x21862(0x1a2)](_0x194ee7))return null;const _0x160e7b=findProjectRootDirectory(_0x57b10d);if(!resolveConfigPath(_0x160e7b))return null;const _0x2bfbd3=writeProjectDomainRoutingManifest(_0x160e7b);return{'path':_0x2bfbd3[_0x21862(0x1a0)],'changed':_0x2bfbd3['changed']};}function readPackageScripts(_0x1b8c89){const _0x3e7bb3=a204_0x28137c,_0x2bdffe=resolve(_0x1b8c89,_0x3e7bb3(0x163));if(!existsSync(_0x2bdffe))return null;try{const _0x229e9c=JSON[_0x3e7bb3(0x170)](readFileSync(_0x2bdffe,'utf-8'));return _0x229e9c[_0x3e7bb3(0x180)]??{};}catch{return null;}}function detectPackageManager(_0x124290){const _0x4dc0f1=a204_0x28137c;if(existsSync(resolve(_0x124290,_0x4dc0f1(0x199)))||existsSync(resolve(_0x124290,_0x4dc0f1(0x185))))return _0x4dc0f1(0x19a);if(existsSync(resolve(_0x124290,_0x4dc0f1(0x18e))))return _0x4dc0f1(0x16b);if(existsSync(resolve(_0x124290,_0x4dc0f1(0x194))))return _0x4dc0f1(0x19e);return _0x4dc0f1(0x165);}async function versionCheck(_0x8108cd){const _0x1aa9d1=a204_0x28137c,_0xe41624=await checkCliVersion();(_0xe41624[_0x1aa9d1(0x195)]||_0xe41624[_0x1aa9d1(0x18a)])&&(printCliUpgradeWarning(_0xe41624),assertCliVersionSupported(_0xe41624));const _0x731747=await checkSdkVersion(_0x8108cd);if(_0x731747[_0x1aa9d1(0x195)])printSdkUpgradeWarning(_0x731747);}function spawnScript(_0x3cc4a2,_0x1396a9,_0xae3cc3,_0x1a7124){return new Promise((_0x432f4e,_0x5bdbe7)=>{const _0x400c72=a204_0x4e5c,_0xf6d8f3=[_0x400c72(0x186),_0x1396a9,..._0xae3cc3],_0xbc99dc=spawn(_0x3cc4a2,_0xf6d8f3,{'cwd':_0x1a7124,'stdio':_0x400c72(0x162),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1a7124,_0x400c72(0x181),_0x400c72(0x18f))+delimiter+process.env.PATH}});_0xbc99dc['on'](_0x400c72(0x1a7),_0x470563=>{const _0xaefe28=_0x400c72;if(_0x470563===0x0||_0x470563===null)_0x432f4e();else _0x5bdbe7(new Error(_0x3cc4a2+_0xaefe28(0x168)+_0x1396a9+_0xaefe28(0x164)+_0x470563));}),_0xbc99dc['on']('error',_0x5bdbe7);});}function a204_0x4e5c(_0x11d612,_0x21ed48){_0x11d612=_0x11d612-0x162;const _0x3453bc=a204_0x3453();let _0x4e5cdd=_0x3453bc[_0x11d612];return _0x4e5cdd;}function spawnViteBuildWatch(_0x3e90b4){return new Promise((_0x45889d,_0x24bea6)=>{const _0x3e7c6d=a204_0x4e5c,_0x53d253=spawn(_0x3e7c6d(0x197),[_0x3e7c6d(0x192),_0x3e7c6d(0x18d)],{'cwd':_0x3e90b4,'stdio':_0x3e7c6d(0x162),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3e90b4,'node_modules','.bin')+delimiter+process.env.PATH}});_0x53d253['on'](_0x3e7c6d(0x1a7),_0x40df8e=>{const _0x156704=_0x3e7c6d;if(_0x40df8e===0x0||_0x40df8e===null)_0x45889d();else _0x24bea6(new Error(_0x156704(0x196)+_0x40df8e));}),_0x53d253['on']('error',_0x24bea6);});}function a204_0x3453(){const _0x551f4a=['838139DDbauo','build','8057gJPgbd','yarn.lock','needsUpgrade','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','vite','length','bun.lockb','bun','error','slice','441808FECgaU','yarn','2txFtHH','path','\x22\x20not\x20found\x20in\x20package.json.','has','script','Domain\x20routing\x20synchronized:\x20','\x20\x20\x20\x20','4232mZZrXK','close','inherit','package.json','\x20exited\x20with\x20code\x20','npm','No\x20scripts\x20defined\x20in\x20package.json.','Run\x20a\x20package.json\x20script','\x20run\x20','121ckrcLV','log','pnpm','bool','3042342ToZQDw','390024FxWdVH','join','parse','push','Script\x20\x22','No\x20package.json\x20found\x20in\x20current\x20directory.','write','preview','vite\x20preview\x20exited\x20with\x20code\x20','Available:\x20','5phvQRH','cwd','dev','watch','2774253GVEDrO','Enable\x20watch\x20mode\x20for\x20preview','args','(none)','scripts','node_modules','\x20run\x20build','\x20\x20EXAMPLES','511670xWjqlT','bun.lock','run','all','validation','\x20run\x20preview\x20--watch','belowMinimum','\x20run\x20preview','\x20run\x20start','--watch','pnpm-lock.yaml','.bin','boolean'];a204_0x3453=function(){return _0x551f4a;};return a204_0x3453();}function spawnVitePreview(_0x38b152){return new Promise((_0x803359,_0x4b1d3f)=>{const _0x3ed088=a204_0x4e5c,_0x42f10f=spawn(_0x3ed088(0x197),['preview'],{'cwd':_0x38b152,'stdio':_0x3ed088(0x162),'shell':!![],'env':{...process.env,'PATH':''+join(_0x38b152,_0x3ed088(0x181),_0x3ed088(0x18f))+delimiter+process.env.PATH}});_0x42f10f['on'](_0x3ed088(0x1a7),_0x5a3857=>{const _0x6bffad=_0x3ed088;if(_0x5a3857===0x0||_0x5a3857===null)_0x803359();else _0x4b1d3f(new Error(_0x6bffad(0x176)+_0x5a3857));}),_0x42f10f['on'](_0x3ed088(0x19b),_0x4b1d3f);});}const runFlags=[{'name':a204_0x28137c(0x17b),'type':a204_0x28137c(0x190),'description':a204_0x28137c(0x17d),'default':![]}];export const runDefinition={'service':'run','command':a204_0x28137c(0x186),'description':a204_0x28137c(0x167),'risk':a204_0x28137c(0x174),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a204_0x28137c(0x1a3),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x18fa7f=a204_0x28137c,_0x37cbdb=[];return _0x37cbdb[_0x18fa7f(0x171)](_0x18fa7f(0x183)),_0x37cbdb[_0x18fa7f(0x171)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x18fa7f(0x18c)),_0x37cbdb[_0x18fa7f(0x171)](_0x18fa7f(0x1a5)+CLI_BIN_NAME+_0x18fa7f(0x182)),_0x37cbdb[_0x18fa7f(0x171)](_0x18fa7f(0x1a5)+CLI_BIN_NAME+_0x18fa7f(0x18b)),_0x37cbdb[_0x18fa7f(0x171)](_0x18fa7f(0x1a5)+CLI_BIN_NAME+_0x18fa7f(0x189)),_0x37cbdb[_0x18fa7f(0x16f)]('\x0a');},async 'execute'(_0x58baae){const _0x4ff3b4=a204_0x28137c,_0x48bd95=process[_0x4ff3b4(0x179)](),_0x16e361=_0x58baae['args'][0x0],_0x5547c4=_0x58baae[_0x4ff3b4(0x17e)][_0x4ff3b4(0x19c)](0x1),_0x5739db=readPackageScripts(_0x48bd95);if(!_0x5739db)throw CliErrors[_0x4ff3b4(0x188)](_0x4ff3b4(0x173));if(!_0x16e361){const _0x86aec2=Object['keys'](_0x5739db);if(_0x86aec2[_0x4ff3b4(0x198)]===0x0)console[_0x4ff3b4(0x16a)](_0x4ff3b4(0x166));else{console[_0x4ff3b4(0x16a)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x51f98d of _0x86aec2){console[_0x4ff3b4(0x16a)](_0x4ff3b4(0x1a5)+_0x51f98d);}console[_0x4ff3b4(0x16a)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x5739db[_0x16e361])throw CliErrors['validation'](_0x4ff3b4(0x172)+_0x16e361+_0x4ff3b4(0x1a1),_0x4ff3b4(0x177)+(Object['keys'](_0x5739db)[_0x4ff3b4(0x16f)](',\x20')||_0x4ff3b4(0x17f)));const _0x35cd8a=detectPackageManager(_0x48bd95),_0x5891b5=syncProjectDomainRoutingBeforeScript(_0x48bd95,_0x16e361);_0x5891b5?.['changed']&&console['error'](_0x4ff3b4(0x1a4)+_0x5891b5[_0x4ff3b4(0x1a0)]);VERSION_CHECK_SCRIPTS[_0x4ff3b4(0x1a2)](_0x16e361)&&await versionCheck(_0x48bd95);if(_0x16e361===_0x4ff3b4(0x175)&&_0x58baae[_0x4ff3b4(0x16c)](_0x4ff3b4(0x17b)))return await Promise[_0x4ff3b4(0x187)]([spawnViteBuildWatch(_0x48bd95),spawnVitePreview(_0x48bd95)]),{'ok':!![]};return await spawnScript(_0x35cd8a,_0x16e361,_0x5547c4,_0x48bd95),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a205_0x1b71d0=a205_0x2baa;(function(_0x89dd63,_0x3d6063){const _0x4843d6=a205_0x2baa,_0x191320=_0x89dd63();while(!![]){try{const _0x21b90d=-parseInt(_0x4843d6(0xef))/0x1*(parseInt(_0x4843d6(0xf4))/0x2)+-parseInt(_0x4843d6(0xf0))/0x3+-parseInt(_0x4843d6(0xee))/0x4+parseInt(_0x4843d6(0xf7))/0x5+-parseInt(_0x4843d6(0xf5))/0x6*(-parseInt(_0x4843d6(0xf3))/0x7)+-parseInt(_0x4843d6(0xf1))/0x8+parseInt(_0x4843d6(0xf2))/0x9;if(_0x21b90d===_0x3d6063)break;else _0x191320['push'](_0x191320['shift']());}catch(_0x4e6d9f){_0x191320['push'](_0x191320['shift']());}}}(a205_0x25dd,0x2b068));function a205_0x25dd(){const _0x497dc3=['1748795IVmsXo','schema','993232qKyLLG','5FvQhfc','356382GnUMkp','1945520SdjtCC','4041504tjqwua','1148098vdfFOf','70522rPzbEo','6fwdSiW','export'];a205_0x25dd=function(){return _0x497dc3;};return a205_0x25dd();}function a205_0x2baa(_0x34b1ca,_0x447246){_0x34b1ca=_0x34b1ca-0xee;const _0x25dda8=a205_0x25dd();let _0x2baadb=_0x25dda8[_0x34b1ca];return _0x2baadb;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x3a5809){const _0x113772=await buildSchemaPayload();return{'ok':!![],'data':_0x113772};}export const schemaDefinition={'service':a205_0x1b71d0(0xf8),'command':a205_0x1b71d0(0xf6),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a206_0x3b5acd=a206_0x51f1;(function(_0xa4ed45,_0x3b61d1){const _0x16f920=a206_0x51f1,_0x23e4cd=_0xa4ed45();while(!![]){try{const _0x3199b4=-parseInt(_0x16f920(0x1ee))/0x1+parseInt(_0x16f920(0x1e3))/0x2*(parseInt(_0x16f920(0x1e0))/0x3)+parseInt(_0x16f920(0x1d9))/0x4+-parseInt(_0x16f920(0x1fa))/0x5*(-parseInt(_0x16f920(0x1f4))/0x6)+-parseInt(_0x16f920(0x205))/0x7+-parseInt(_0x16f920(0x1ca))/0x8+parseInt(_0x16f920(0x202))/0x9*(parseInt(_0x16f920(0x1cb))/0xa);if(_0x3199b4===_0x3b61d1)break;else _0x23e4cd['push'](_0x23e4cd['shift']());}catch(_0x5d7a69){_0x23e4cd['push'](_0x23e4cd['shift']());}}}(a206_0x393c,0xeb5f2));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';function a206_0x393c(){const _0x56d6df=['isFinite','new','join','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','dbId','__manual__','2422704Lncoqv','78010vOnUcu','toISOString','nonInteractive','MyBatis\x20XML\x20(mybatisXml)','db-id','name','✎\x20Enter\x20dbId\x20manually','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','Created\x20SQL\x20query\x20','dbName','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','\x20\x20SELECT\x201\x20AS\x20id','string','/smartapi/custom/saveUserCustomSql','938272RTepLB','flag','sqlCode','sqlRoot','mybatisXml','catch','Local\x20SQL\x20file\x20mode','3UTokSQ','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','stringify','2639718EWHmma','</select>','utf8','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Plain\x20SQL\x20(sql)','Invalid\x20database\x20selection\x20payload:\x20','flagMissing','length','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','dbId\x20must\x20be\x20a\x20positive\x20integer','lastSync','1356538hrauYD','number','isInteger','POST','create','Target\x20database\x20ID','6TIRsHL','lockFilePath','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','parse','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','Target\x20database\x20dbId:','8774770iXMdAJ','write','sqlName','trim','SELECT\x201\x20AS\x20id;','str','appCode','mode','27wNxLPQ','sqlRootDir','sql','4965282HBxyZs'];a206_0x393c=function(){return _0x56d6df;};return a206_0x393c();}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x541e56){const _0x5aa9d6=a206_0x51f1;if(_0x541e56===_0x5aa9d6(0x1dd))return[_0x5aa9d6(0x1eb),_0x5aa9d6(0x1d6),_0x5aa9d6(0x1e4),''][_0x5aa9d6(0x1c6)]('\x0a');return[_0x5aa9d6(0x1fe),''][_0x5aa9d6(0x1c6)]('\x0a');}export const sqlCreate={'service':a206_0x3b5acd(0x204),'command':a206_0x3b5acd(0x1f2),'description':a206_0x3b5acd(0x1e6),'risk':a206_0x3b5acd(0x1fb),'flags':[{'name':a206_0x3b5acd(0x1d0),'type':a206_0x3b5acd(0x1d7),'description':'SQL\x20query\x20display\x20name'},{'name':'db-id','type':a206_0x3b5acd(0x1ef),'description':a206_0x3b5acd(0x1f3)},{'name':a206_0x3b5acd(0x201),'type':a206_0x3b5acd(0x1d7),'enum':['sql',a206_0x3b5acd(0x1dd)],'description':a206_0x3b5acd(0x1df)}],async 'validate'(_0xafcc1e){const _0x205fe0=a206_0x3b5acd;if(!_0xafcc1e[_0x205fe0(0x1cd)])return;if(!_0xafcc1e[_0x205fe0(0x1ff)]('name')[_0x205fe0(0x1fd)]())throw CliErrors[_0x205fe0(0x1e9)]('name',_0x205fe0(0x1f6));const _0x56fa90=resolveProvidedDbId(_0xafcc1e);if(typeof _0x56fa90!=='number'||!Number[_0x205fe0(0x206)](_0x56fa90)||_0x56fa90<=0x0)throw CliErrors[_0x205fe0(0x1e9)](_0x205fe0(0x1cf),_0x205fe0(0x1c7));if(!_0xafcc1e[_0x205fe0(0x1ff)](_0x205fe0(0x201))[_0x205fe0(0x1fd)]())throw CliErrors[_0x205fe0(0x1e9)](_0x205fe0(0x201),_0x205fe0(0x1f8));},async 'dryRun'(_0x3894fe){const _0x2f1279=a206_0x3b5acd,_0x4a6812=loadSqlProjectConfig(_0x3894fe[_0x2f1279(0x200)]),{sqlName:_0x371016,dbId:_0x4027fe,dbName:_0x1dda87,mode:_0x59f058}=await resolveSqlNewInputs(_0x3894fe),_0x47bf60=buildSqlRelativePath('<server-generated-sqlCode>',_0x371016,_0x1dda87,_0x59f058,_0x4027fe),_0x113ea1=_0x4a6812['sqlRootDir']+'/'+_0x47bf60;return{'method':_0x2f1279(0x1f1),'url':_0x2f1279(0x1d8),'body':{'appCode':_0x3894fe['appCode'],'sqlName':_0x371016,'dbId':_0x4027fe,'mode':_0x59f058,'localPath':_0x113ea1},'description':_0x2f1279(0x1d2)+_0x4a6812[_0x2f1279(0x203)]};},async 'execute'(_0x6e5766){const _0x14343d=a206_0x3b5acd,_0x484d41=loadSqlProjectConfig(_0x6e5766[_0x14343d(0x200)]),{sqlName:_0x4ec1ef,dbId:_0x4a2111,dbName:_0x2c7388,mode:_0x393f57}=await resolveSqlNewInputs(_0x6e5766),_0x46d2a3=generateSqlTemplate(_0x393f57),_0x544856=await createSqlQuery({'appCode':_0x6e5766[_0x14343d(0x200)],'sqlName':_0x4ec1ef,'dbId':_0x4a2111,'sqlContent':_0x46d2a3}),_0x1afa69=ensureRemoteSqlContent(_0x544856),_0x5ed9f7=_0x2c7388||await getDbName(_0x6e5766[_0x14343d(0x200)],_0x4a2111)['catch'](()=>undefined),_0x1da398=buildSqlRelativePath(_0x544856[_0x14343d(0x1db)],_0x544856[_0x14343d(0x1fc)],_0x5ed9f7,_0x393f57,_0x4a2111),_0x455e00=_0x484d41['sqlRootDir']+'/'+_0x1da398,_0xf0b2d=buildLocalSqlFileContent({'sqlCode':_0x544856[_0x14343d(0x1db)],'sqlName':_0x544856['sqlName'],'dbId':_0x544856[_0x14343d(0x1c8)]},_0x1afa69,{'dbName':_0x5ed9f7,'mode':_0x393f57,'syncedAt':new Date()[_0x14343d(0x1cc)](),'description':_0x544856['description']});if(await fileExists(_0x455e00))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x455e00);await ensureParentDirectory(_0x455e00),await writeFile(_0x455e00,_0xf0b2d,_0x14343d(0x1e5));const _0x1f6e0a=await readSqlLockFile(_0x484d41['lockFilePath']),{lockData:_0x3a424d,appLock:_0x40f72e}=ensureSqlLockScope(_0x1f6e0a??createEmptySqlLock(),_0x484d41[_0x14343d(0x200)],_0x484d41[_0x14343d(0x1dc)],_0x14343d(0x1c5));return _0x40f72e['sqls'][_0x544856['sqlCode']]={...buildSqlLockEntry(_0x544856,_0x1afa69,computeSqlContentHash(_0xf0b2d),{'dbName':_0x5ed9f7}),'path':_0x1da398,'mode':_0x393f57},_0x40f72e[_0x14343d(0x1ed)]=new Date()[_0x14343d(0x1cc)](),await writeSqlLockFile(_0x484d41[_0x14343d(0x1f5)],_0x3a424d),{'ok':!![],'data':{'id':_0x544856['id'],'sqlCode':_0x544856[_0x14343d(0x1db)],'sqlName':_0x544856['sqlName'],'dbId':_0x544856[_0x14343d(0x1c8)],'path':_0x455e00,'mode':_0x393f57},'message':_0x14343d(0x1d3)+_0x544856[_0x14343d(0x1db)]};}};function a206_0x51f1(_0x317c5b,_0x2957c3){_0x317c5b=_0x317c5b-0x1c5;const _0x393c6b=a206_0x393c();let _0x51f1d2=_0x393c6b[_0x317c5b];return _0x51f1d2;}async function resolveSqlNewInputs(_0x36a04e){const _0xdeb84a=await resolveSqlNameInput(_0x36a04e),{dbId:_0x5aae86,dbName:_0x4dd7f5}=await resolveDbSelection(_0x36a04e),_0x90c80e=await resolveSqlModeInput(_0x36a04e);return{'sqlName':_0xdeb84a,'dbId':_0x5aae86,'dbName':_0x4dd7f5,'mode':_0x90c80e};}async function resolveSqlNameInput(_0x42e0df){const _0x33c42b=a206_0x3b5acd,_0x3e4310=_0x42e0df[_0x33c42b(0x1ff)]('name')[_0x33c42b(0x1fd)]();if(_0x3e4310)return _0x3e4310;if(_0x42e0df['nonInteractive'])throw CliErrors['flagMissing'](_0x33c42b(0x1d0),_0x33c42b(0x1f6));return(await input({'message':'SQL\x20name:','validate':_0x25873f=>_0x25873f[_0x33c42b(0x1fd)]()?!![]:'SQL\x20name\x20cannot\x20be\x20empty'}))[_0x33c42b(0x1fd)]();}async function resolveDbSelection(_0x54c3cf){const _0x3df480=a206_0x3b5acd,_0x5415bc=resolveProvidedDbId(_0x54c3cf);if(typeof _0x5415bc===_0x3df480(0x1ef)&&Number[_0x3df480(0x206)](_0x5415bc)&&_0x5415bc>0x0)return{'dbId':_0x5415bc,'dbName':await getDbName(_0x54c3cf[_0x3df480(0x200)],_0x5415bc)[_0x3df480(0x1de)](()=>undefined)};if(_0x54c3cf[_0x3df480(0x1cd)])throw CliErrors[_0x3df480(0x1e9)](_0x3df480(0x1cf),_0x3df480(0x1c7));const _0x146377=await listDatabases(_0x54c3cf['appCode'])['catch'](()=>[]);if(_0x146377[_0x3df480(0x1ea)]===0x1)return{'dbId':_0x146377[0x0]['dbId'],'dbName':_0x146377[0x0][_0x3df480(0x1d4)]};if(_0x146377[_0x3df480(0x1ea)]>0x1){const _0x47d243=await select({'message':'Select\x20the\x20target\x20database:','choices':[..._0x146377['map'](_0x4da806=>({'name':_0x4da806[_0x3df480(0x1d4)]+'\x20('+_0x4da806[_0x3df480(0x1c8)]+')','value':serializeDbSelection(_0x4da806)})),{'name':_0x3df480(0x1d1),'value':_0x3df480(0x1c9)}]});if(_0x47d243!==_0x3df480(0x1c9))return deserializeDbSelection(_0x47d243);}const _0x3066f2=await input({'message':_0x3df480(0x1f9),'validate':_0x12e6d5=>{const _0x5cc1d4=_0x3df480,_0x412836=_0x12e6d5[_0x5cc1d4(0x1fd)]();if(!_0x412836)return'dbId\x20cannot\x20be\x20empty';const _0x556731=Number(_0x412836);if(!Number[_0x5cc1d4(0x1f0)](_0x556731)||_0x556731<=0x0)return _0x5cc1d4(0x1ec);return!![];}});return{'dbId':Number(_0x3066f2[_0x3df480(0x1fd)]())};}async function resolveSqlModeInput(_0x302064){const _0x41b590=a206_0x3b5acd,_0x18740d=_0x302064[_0x41b590(0x1ff)](_0x41b590(0x201))[_0x41b590(0x1fd)]();if(_0x18740d===_0x41b590(0x204)||_0x18740d==='mybatisXml')return _0x18740d;if(_0x302064[_0x41b590(0x1cd)])throw CliErrors['flagMissing'](_0x41b590(0x201),_0x41b590(0x1f8));return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x41b590(0x1e7),'value':_0x41b590(0x204),'description':_0x41b590(0x1d5)},{'name':_0x41b590(0x1ce),'value':_0x41b590(0x1dd),'description':_0x41b590(0x1e1)}]});}function serializeDbSelection(_0x3c0f74){const _0x32ea7f=a206_0x3b5acd;return JSON[_0x32ea7f(0x1e2)]({'dbId':_0x3c0f74[_0x32ea7f(0x1c8)],'dbName':_0x3c0f74[_0x32ea7f(0x1d4)]});}function deserializeDbSelection(_0x5e4fa7){const _0x112211=a206_0x3b5acd;try{const _0x519e19=JSON[_0x112211(0x1f7)](_0x5e4fa7);if(typeof _0x519e19[_0x112211(0x1c8)]===_0x112211(0x1ef)&&Number['isFinite'](_0x519e19[_0x112211(0x1c8)]))return{'dbId':_0x519e19[_0x112211(0x1c8)],'dbName':_0x519e19['dbName']};}catch{}throw CliErrors['validation'](_0x112211(0x1e8)+_0x5e4fa7);}function resolveProvidedDbId(_0x661188){const _0x200e82=a206_0x3b5acd,_0x497d8a=_0x661188[_0x200e82(0x1da)](_0x200e82(0x1cf));if(typeof _0x497d8a===_0x200e82(0x1ef)&&Number[_0x200e82(0x206)](_0x497d8a))return _0x497d8a;return undefined;}
|
|
1
|
+
const a206_0x2a836d=a206_0xfef7;(function(_0x23615e,_0x2d8231){const _0x470d38=a206_0xfef7,_0x134304=_0x23615e();while(!![]){try{const _0x538a1f=parseInt(_0x470d38(0x1e2))/0x1+parseInt(_0x470d38(0x1d1))/0x2*(parseInt(_0x470d38(0x1ec))/0x3)+parseInt(_0x470d38(0x1de))/0x4*(parseInt(_0x470d38(0x203))/0x5)+parseInt(_0x470d38(0x1df))/0x6+parseInt(_0x470d38(0x1e0))/0x7+parseInt(_0x470d38(0x1d3))/0x8+-parseInt(_0x470d38(0x1d9))/0x9*(parseInt(_0x470d38(0x1eb))/0xa);if(_0x538a1f===_0x2d8231)break;else _0x134304['push'](_0x134304['shift']());}catch(_0x672b2e){_0x134304['push'](_0x134304['shift']());}}}(a206_0x4953,0xaa4da));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x328314){const _0x559410=a206_0xfef7;if(_0x328314===_0x559410(0x20b))return[_0x559410(0x1ce),_0x559410(0x207),'</select>',''][_0x559410(0x204)]('\x0a');return[_0x559410(0x1e7),''][_0x559410(0x204)]('\x0a');}function a206_0xfef7(_0x493baf,_0x3c9de1){_0x493baf=_0x493baf-0x1c8;const _0x4953bf=a206_0x4953();let _0xfef79d=_0x4953bf[_0x493baf];return _0xfef79d;}export const sqlCreate={'service':a206_0x2a836d(0x1f1),'command':'create','description':a206_0x2a836d(0x206),'risk':'write','flags':[{'name':a206_0x2a836d(0x1d4),'type':a206_0x2a836d(0x20a),'description':a206_0x2a836d(0x1fe)},{'name':'db-id','type':'number','description':a206_0x2a836d(0x1dd)},{'name':a206_0x2a836d(0x1ea),'type':a206_0x2a836d(0x20a),'enum':['sql',a206_0x2a836d(0x20b)],'description':a206_0x2a836d(0x1cd)}],async 'validate'(_0x337afa){const _0x4cb939=a206_0x2a836d;if(!_0x337afa[_0x4cb939(0x1c8)])return;if(!_0x337afa['str'](_0x4cb939(0x1d4))[_0x4cb939(0x1cb)]())throw CliErrors['flagMissing'](_0x4cb939(0x1d4),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0xdbbefe=resolveProvidedDbId(_0x337afa);if(typeof _0xdbbefe!==_0x4cb939(0x1db)||!Number['isFinite'](_0xdbbefe)||_0xdbbefe<=0x0)throw CliErrors[_0x4cb939(0x200)](_0x4cb939(0x1f9),_0x4cb939(0x1d6));if(!_0x337afa[_0x4cb939(0x208)](_0x4cb939(0x1ea))[_0x4cb939(0x1cb)]())throw CliErrors[_0x4cb939(0x200)]('mode',_0x4cb939(0x1e4));},async 'dryRun'(_0x393ce7){const _0x2b7460=a206_0x2a836d,_0x29abdd=loadSqlProjectConfig(_0x393ce7['appCode']),{sqlName:_0x5cc8b9,dbId:_0x18d7b2,dbName:_0x1e491b,mode:_0x4b4fc5}=await resolveSqlNewInputs(_0x393ce7),_0x5c338a=buildSqlRelativePath(_0x2b7460(0x1f8),_0x5cc8b9,_0x1e491b,_0x4b4fc5,_0x18d7b2),_0x316224=_0x29abdd[_0x2b7460(0x1f6)]+'/'+_0x5c338a;return{'method':_0x2b7460(0x1c9),'url':_0x2b7460(0x1dc),'body':{'appCode':_0x393ce7[_0x2b7460(0x1f2)],'sqlName':_0x5cc8b9,'dbId':_0x18d7b2,'mode':_0x4b4fc5,'localPath':_0x316224},'description':_0x2b7460(0x1f3)+_0x29abdd[_0x2b7460(0x1f6)]};},async 'execute'(_0x4235b7){const _0x23d786=a206_0x2a836d,_0x3d53a7=loadSqlProjectConfig(_0x4235b7[_0x23d786(0x1f2)]),{sqlName:_0x2357cf,dbId:_0x188c37,dbName:_0x40c20c,mode:_0x221334}=await resolveSqlNewInputs(_0x4235b7),_0x50341f=generateSqlTemplate(_0x221334),_0x4ef40d=await createSqlQuery({'appCode':_0x4235b7[_0x23d786(0x1f2)],'sqlName':_0x2357cf,'dbId':_0x188c37,'sqlContent':_0x50341f}),_0x4d8637=ensureRemoteSqlContent(_0x4ef40d),_0x251df2=_0x40c20c||await getDbName(_0x4235b7['appCode'],_0x188c37)[_0x23d786(0x1fd)](()=>undefined),_0x2fa3af=buildSqlRelativePath(_0x4ef40d[_0x23d786(0x1e9)],_0x4ef40d[_0x23d786(0x1e5)],_0x251df2,_0x221334,_0x188c37),_0xbe9a37=_0x3d53a7[_0x23d786(0x1f6)]+'/'+_0x2fa3af,_0x5f31c0=buildLocalSqlFileContent({'sqlCode':_0x4ef40d['sqlCode'],'sqlName':_0x4ef40d[_0x23d786(0x1e5)],'dbId':_0x4ef40d[_0x23d786(0x1d7)]},_0x4d8637,{'dbName':_0x251df2,'mode':_0x221334,'syncedAt':new Date()[_0x23d786(0x1f4)](),'description':_0x4ef40d[_0x23d786(0x1f5)]});if(await fileExists(_0xbe9a37))throw CliErrors[_0x23d786(0x1ee)](_0x23d786(0x201)+_0xbe9a37);await ensureParentDirectory(_0xbe9a37),await writeFile(_0xbe9a37,_0x5f31c0,_0x23d786(0x209));const _0x1064bc=await readSqlLockFile(_0x3d53a7[_0x23d786(0x1e6)]),{lockData:_0x499ff7,appLock:_0x556bea}=ensureSqlLockScope(_0x1064bc??createEmptySqlLock(),_0x3d53a7[_0x23d786(0x1f2)],_0x3d53a7[_0x23d786(0x1da)],_0x23d786(0x1e3));return _0x556bea[_0x23d786(0x1e1)][_0x4ef40d['sqlCode']]={...buildSqlLockEntry(_0x4ef40d,_0x4d8637,computeSqlContentHash(_0x5f31c0),{'dbName':_0x251df2}),'path':_0x2fa3af,'mode':_0x221334},_0x556bea[_0x23d786(0x1d5)]=new Date()[_0x23d786(0x1f4)](),await writeSqlLockFile(_0x3d53a7['lockFilePath'],_0x499ff7),{'ok':!![],'data':{'id':_0x4ef40d['id'],'sqlCode':_0x4ef40d[_0x23d786(0x1e9)],'sqlName':_0x4ef40d['sqlName'],'dbId':_0x4ef40d[_0x23d786(0x1d7)],'path':_0xbe9a37,'mode':_0x221334},'message':'Created\x20SQL\x20query\x20'+_0x4ef40d[_0x23d786(0x1e9)]};}};function a206_0x4953(){const _0x588601=['length','validation','__manual__','Target\x20database\x20dbId:','sql','appCode','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','toISOString','description','sqlRootDir','Select\x20the\x20target\x20database:','<server-generated-sqlCode>','db-id','dbId\x20cannot\x20be\x20empty','parse','Plain\x20SQL\x20(sql)','catch','SQL\x20query\x20display\x20name','map','flagMissing','File\x20already\x20exists:\x20','✎\x20Enter\x20dbId\x20manually','3137795hcasiM','join','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','\x20\x20SELECT\x201\x20AS\x20id','str','utf8','string','mybatisXml','stringify','Invalid\x20database\x20selection\x20payload:\x20','nonInteractive','POST','flag','trim','dbName','Local\x20SQL\x20file\x20mode','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','Select\x20the\x20local\x20SQL\x20mode:','isFinite','198EdKVQY','dbId\x20must\x20be\x20a\x20positive\x20integer','891160jivmEK','name','lastSync','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','dbId','SQL\x20name:','9FoOTfb','sqlRoot','number','/smartapi/custom/saveUserCustomSql','Target\x20database\x20ID','4IIolRq','8007378pZTfmz','3200659NYvXht','sqls','380607qcybnI','new','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlName','lockFilePath','SELECT\x201\x20AS\x20id;','SQL\x20name\x20cannot\x20be\x20empty','sqlCode','mode','24878310ivAImL','8304jTIKuM'];a206_0x4953=function(){return _0x588601;};return a206_0x4953();}async function resolveSqlNewInputs(_0x12d0cc){const _0x16a0f8=await resolveSqlNameInput(_0x12d0cc),{dbId:_0x5e01d1,dbName:_0x5558b4}=await resolveDbSelection(_0x12d0cc),_0x53acf4=await resolveSqlModeInput(_0x12d0cc);return{'sqlName':_0x16a0f8,'dbId':_0x5e01d1,'dbName':_0x5558b4,'mode':_0x53acf4};}async function resolveSqlNameInput(_0x244021){const _0x191c1d=a206_0x2a836d,_0x58fd41=_0x244021[_0x191c1d(0x208)](_0x191c1d(0x1d4))['trim']();if(_0x58fd41)return _0x58fd41;if(_0x244021['nonInteractive'])throw CliErrors['flagMissing'](_0x191c1d(0x1d4),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':_0x191c1d(0x1d8),'validate':_0x4e0043=>_0x4e0043[_0x191c1d(0x1cb)]()?!![]:_0x191c1d(0x1e8)}))[_0x191c1d(0x1cb)]();}async function resolveDbSelection(_0x44098e){const _0x28b7f0=a206_0x2a836d,_0x4ca9a2=resolveProvidedDbId(_0x44098e);if(typeof _0x4ca9a2==='number'&&Number[_0x28b7f0(0x1d0)](_0x4ca9a2)&&_0x4ca9a2>0x0)return{'dbId':_0x4ca9a2,'dbName':await getDbName(_0x44098e['appCode'],_0x4ca9a2)['catch'](()=>undefined)};if(_0x44098e['nonInteractive'])throw CliErrors['flagMissing'](_0x28b7f0(0x1f9),_0x28b7f0(0x1d6));const _0x26199a=await listDatabases(_0x44098e['appCode'])['catch'](()=>[]);if(_0x26199a[_0x28b7f0(0x1ed)]===0x1)return{'dbId':_0x26199a[0x0]['dbId'],'dbName':_0x26199a[0x0]['dbName']};if(_0x26199a[_0x28b7f0(0x1ed)]>0x1){const _0x32aede=await select({'message':_0x28b7f0(0x1f7),'choices':[..._0x26199a[_0x28b7f0(0x1ff)](_0x3c5821=>({'name':_0x3c5821[_0x28b7f0(0x1cc)]+'\x20('+_0x3c5821[_0x28b7f0(0x1d7)]+')','value':serializeDbSelection(_0x3c5821)})),{'name':_0x28b7f0(0x202),'value':_0x28b7f0(0x1ef)}]});if(_0x32aede!==_0x28b7f0(0x1ef))return deserializeDbSelection(_0x32aede);}const _0x3946b4=await input({'message':_0x28b7f0(0x1f0),'validate':_0x276bd=>{const _0x43f217=_0x28b7f0,_0x35b661=_0x276bd[_0x43f217(0x1cb)]();if(!_0x35b661)return _0x43f217(0x1fa);const _0x2e7522=Number(_0x35b661);if(!Number['isInteger'](_0x2e7522)||_0x2e7522<=0x0)return _0x43f217(0x1d2);return!![];}});return{'dbId':Number(_0x3946b4[_0x28b7f0(0x1cb)]())};}async function resolveSqlModeInput(_0x2fc159){const _0x4b819e=a206_0x2a836d,_0x1a89a8=_0x2fc159[_0x4b819e(0x208)]('mode')['trim']();if(_0x1a89a8==='sql'||_0x1a89a8===_0x4b819e(0x20b))return _0x1a89a8;if(_0x2fc159['nonInteractive'])throw CliErrors['flagMissing'](_0x4b819e(0x1ea),_0x4b819e(0x1e4));return await select({'message':_0x4b819e(0x1cf),'choices':[{'name':_0x4b819e(0x1fc),'value':_0x4b819e(0x1f1),'description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':'MyBatis\x20XML\x20(mybatisXml)','value':'mybatisXml','description':_0x4b819e(0x205)}]});}function serializeDbSelection(_0x52c643){const _0x47d512=a206_0x2a836d;return JSON[_0x47d512(0x20c)]({'dbId':_0x52c643[_0x47d512(0x1d7)],'dbName':_0x52c643[_0x47d512(0x1cc)]});}function deserializeDbSelection(_0x381b8f){const _0x3b2d95=a206_0x2a836d;try{const _0x3bdb62=JSON[_0x3b2d95(0x1fb)](_0x381b8f);if(typeof _0x3bdb62[_0x3b2d95(0x1d7)]==='number'&&Number[_0x3b2d95(0x1d0)](_0x3bdb62[_0x3b2d95(0x1d7)]))return{'dbId':_0x3bdb62[_0x3b2d95(0x1d7)],'dbName':_0x3bdb62['dbName']};}catch{}throw CliErrors[_0x3b2d95(0x1ee)](_0x3b2d95(0x20d)+_0x381b8f);}function resolveProvidedDbId(_0xd98f6e){const _0x53fc60=a206_0x2a836d,_0x4aa751=_0xd98f6e[_0x53fc60(0x1ca)](_0x53fc60(0x1f9));if(typeof _0x4aa751===_0x53fc60(0x1db)&&Number[_0x53fc60(0x1d0)](_0x4aa751))return _0x4aa751;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a207_0x3478(_0x3bd57c,_0x3a0818){_0x3bd57c=_0x3bd57c-0x1b7;const _0x104ba2=a207_0x104b();let _0x3478b3=_0x104ba2[_0x3bd57c];return _0x3478b3;}const a207_0x4c96e4=a207_0x3478;(function(_0x46da81,_0x2cf45b){const _0x5e2ddf=a207_0x3478,_0x49978c=_0x46da81();while(!![]){try{const _0x304962=parseInt(_0x5e2ddf(0x1c4))/0x1*(parseInt(_0x5e2ddf(0x1c1))/0x2)+parseInt(_0x5e2ddf(0x1ca))/0x3*(parseInt(_0x5e2ddf(0x1d3))/0x4)+-parseInt(_0x5e2ddf(0x1d4))/0x5*(-parseInt(_0x5e2ddf(0x1c8))/0x6)+parseInt(_0x5e2ddf(0x1b9))/0x7+-parseInt(_0x5e2ddf(0x1be))/0x8+parseInt(_0x5e2ddf(0x1d8))/0x9+-parseInt(_0x5e2ddf(0x1bd))/0xa;if(_0x304962===_0x2cf45b)break;else _0x49978c['push'](_0x49978c['shift']());}catch(_0x2a26f5){_0x49978c['push'](_0x49978c['shift']());}}}(a207_0x104b,0x87ae7));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a207_0x104b(){const _0x572a6e=['filter','32541zkcjeX','SQL\x20lock\x20file\x20not\x20found.','/smartapi/custom/deleteUserCustomSql','sql','sqlRoot','delete','Would\x20delete\x20SQL\x20','entries','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','272qoZWrQ','1081045qlwFvn','length','lastSync','sqlcode','2776275qWsNzq','lockFilePath','validation','startsWith','sqls','replace','str','toISOString','1658286kOHIFV','Deleted\x20','fromEntries','trashedTo','16273550fIzrHZ','4634592zrSWkw','POST','trashDir','2094086GjdGUq','remoteId','\x20(local\x20file\x20moved\x20to\x20trash)','1siDBRN','appCode','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','projectRoot','12wiPGzj'];a207_0x104b=function(){return _0x572a6e;};return a207_0x104b();}import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a207_0x4c96e4(0x1cd),'command':'delete','description':a207_0x4c96e4(0x1d2),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x2fef75){const _0x4f126c=a207_0x4c96e4,_0x5b93b4=loadSqlProjectConfig(_0x2fef75[_0x4f126c(0x1c5)]),_0x5c4f3a=await readSqlLockFile(_0x5b93b4[_0x4f126c(0x1d9)]);if(!_0x5c4f3a)throw CliErrors[_0x4f126c(0x1da)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x277abe){const _0x571c88=a207_0x4c96e4,_0x38f1c9=loadSqlProjectConfig(_0x277abe[_0x571c88(0x1c5)]),_0x391b3d=await readSqlLockFile(_0x38f1c9['lockFilePath']);if(!_0x391b3d)throw CliErrors[_0x571c88(0x1da)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x22df07}=ensureSqlLockScope(_0x391b3d,_0x277abe['appCode'],_0x38f1c9[_0x571c88(0x1ce)],_0x571c88(0x1cf)),_0x5d1041=_0x277abe[_0x571c88(0x1b7)]('sqlcode'),_0x39564f=_0x22df07[_0x571c88(0x1dc)][_0x5d1041];if(!_0x39564f)throw CliErrors[_0x571c88(0x1da)](_0x571c88(0x1c6)+_0x5d1041+'\x22.');return{'method':_0x571c88(0x1bf),'url':_0x571c88(0x1cc),'body':{'sqlCode':_0x5d1041,'id':_0x39564f[_0x571c88(0x1c2)],'localPath':resolveLocalSqlFilePath(_0x38f1c9,_0x5d1041,_0x39564f)},'description':_0x571c88(0x1d0)+_0x5d1041+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x38f1c9[_0x571c88(0x1c0)]};},async 'execute'(_0x386876){const _0x109350=a207_0x4c96e4,_0x19b874=loadSqlProjectConfig(_0x386876[_0x109350(0x1c5)]),_0x329391=await readSqlLockFile(_0x19b874[_0x109350(0x1d9)]);if(!_0x329391)throw CliErrors[_0x109350(0x1da)](_0x109350(0x1cb));const {lockData:_0x4f023c,appLock:_0x456323}=ensureSqlLockScope(_0x329391,_0x386876[_0x109350(0x1c5)],_0x19b874['sqlRoot'],_0x109350(0x1cf)),_0x5c1dc2=_0x386876[_0x109350(0x1b7)](_0x109350(0x1d7)),_0xa8d46e=_0x456323['sqls'][_0x5c1dc2];if(!_0xa8d46e)throw CliErrors['validation'](_0x109350(0x1c6)+_0x5c1dc2+'\x22.');await deleteSqlQuery({'id':_0xa8d46e[_0x109350(0x1c2)],'sqlCode':_0x5c1dc2}),_0x456323[_0x109350(0x1dc)]=Object[_0x109350(0x1bb)](Object[_0x109350(0x1d1)](_0x456323[_0x109350(0x1dc)])[_0x109350(0x1c9)](([_0xed9343])=>_0xed9343!==_0x5c1dc2)),_0x456323[_0x109350(0x1d6)]=new Date()[_0x109350(0x1b8)](),await writeSqlLockFile(_0x19b874[_0x109350(0x1d9)],_0x4f023c);const _0x4ffaf9=resolveLocalSqlFilePath(_0x19b874,_0x5c1dc2,_0xa8d46e);let _0x240ab4;await fileExists(_0x4ffaf9)&&(_0x240ab4=await moveToTrash(_0x19b874[_0x109350(0x1c7)],_0x19b874[_0x109350(0x1c0)],_0x4ffaf9),await cleanupEmptyDirectories(dirname(_0x4ffaf9),_0x19b874['sqlRootDir']));const _0x285589={'deleted':_0x5c1dc2,'remoteId':_0xa8d46e[_0x109350(0x1c2)]};if(_0x240ab4)_0x285589[_0x109350(0x1bc)]=_0x240ab4;return{'ok':!![],'data':_0x285589,'message':_0x109350(0x1ba)+_0x5c1dc2+(_0x240ab4?_0x109350(0x1c3):'')};}};async function moveToTrash(_0x1403bf,_0x1d706d,_0x2e06c5){const _0x5cf1f9=a207_0x4c96e4,_0x286a91=new Date()[_0x5cf1f9(0x1b8)]()[_0x5cf1f9(0x1dd)](/[:.]/g,'-'),_0x2d4f30=relative(_0x1403bf,_0x2e06c5),_0x7cee00=join(_0x1d706d,_0x286a91,_0x2d4f30);return await mkdir(dirname(_0x7cee00),{'recursive':!![]}),await rename(_0x2e06c5,_0x7cee00),_0x7cee00;}async function cleanupEmptyDirectories(_0x466f02,_0x5d4996){const _0x4d59dc=a207_0x4c96e4;let _0x4049e8=resolve(_0x466f02);const _0x43d5c8=resolve(_0x5d4996);while(_0x4049e8[_0x4d59dc(0x1db)](''+_0x43d5c8+sep)||_0x4049e8===_0x43d5c8){if(_0x4049e8===_0x43d5c8)return;try{const _0x2c48c5=await readdir(_0x4049e8);if(_0x2c48c5[_0x4d59dc(0x1d5)]>0x0)return;await rmdir(_0x4049e8);}catch{return;}_0x4049e8=dirname(_0x4049e8);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a208_0x44c5e0=a208_0x1506;(function(_0x1cb54f,_0x34dc99){const _0x3e526c=a208_0x1506,_0x41956b=_0x1cb54f();while(!![]){try{const _0x2cc484=-parseInt(_0x3e526c(0x81))/0x1+parseInt(_0x3e526c(0x80))/0x2+parseInt(_0x3e526c(0x82))/0x3+parseInt(_0x3e526c(0x86))/0x4+parseInt(_0x3e526c(0x7c))/0x5*(parseInt(_0x3e526c(0x83))/0x6)+-parseInt(_0x3e526c(0x8f))/0x7*(parseInt(_0x3e526c(0x7e))/0x8)+parseInt(_0x3e526c(0x90))/0x9;if(_0x2cc484===_0x34dc99)break;else _0x41956b['push'](_0x41956b['shift']());}catch(_0x1eabe2){_0x41956b['push'](_0x41956b['shift']());}}}(a208_0x48cd,0x87208));import{getSqlQueryInfo}from'../../core/api-client.js';function a208_0x1506(_0x1f6a96,_0x2dd3bb){_0x1f6a96=_0x1f6a96-0x7b;const _0x48cd43=a208_0x48cd();let _0x1506ba=_0x48cd43[_0x1f6a96];return _0x1506ba;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a208_0x48cd(){const _0x1e0f1c=['description','72cunkFD','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','357936CjFXNg','792537Wqreah','3176865dNkYHy','6knQuqp','detail','bool','2233056xfsWAj','read','sqlContent','verbose','boolean','appCode','Return\x20full\x20raw\x20SQL\x20query\x20object','str','sqlcode','537180TIFWIA','886221Rmtioo','dbId','sqlCode','sqlName','sql','710105fAkngn'];a208_0x48cd=function(){return _0x1e0f1c;};return a208_0x48cd();}export const sqlDetail={'service':a208_0x44c5e0(0x7b),'command':a208_0x44c5e0(0x84),'description':a208_0x44c5e0(0x7f),'risk':a208_0x44c5e0(0x87),'flags':[SQLCODE_FLAG,{'name':a208_0x44c5e0(0x89),'type':a208_0x44c5e0(0x8a),'description':a208_0x44c5e0(0x8c)}],async 'execute'(_0x2e1eab){const _0x38e47b=a208_0x44c5e0,_0x3eaca7=await getSqlQueryInfo(_0x2e1eab[_0x38e47b(0x8b)],_0x2e1eab[_0x38e47b(0x8d)](_0x38e47b(0x8e))),_0x30c9fa=_0x2e1eab[_0x38e47b(0x85)](_0x38e47b(0x89));if(_0x30c9fa)return{'ok':!![],'data':_0x3eaca7};const _0x4c2c98=_0x3eaca7[_0x38e47b(0x91)]?await getDbName(_0x2e1eab[_0x38e47b(0x8b)],_0x3eaca7[_0x38e47b(0x91)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x3eaca7[_0x38e47b(0x92)],'sqlName':_0x3eaca7[_0x38e47b(0x93)],'db':_0x4c2c98?_0x4c2c98+'\x20('+_0x3eaca7[_0x38e47b(0x91)]+')':_0x3eaca7[_0x38e47b(0x91)]??'','description':_0x3eaca7[_0x38e47b(0x7d)]??'','sqlContent':_0x3eaca7[_0x38e47b(0x88)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a209_0x43a29c=a209_0x1735;(function(_0x4e7218,_0x15edd3){const _0x385bd1=a209_0x1735,_0x2dba6f=_0x4e7218();while(!![]){try{const _0x227c93=parseInt(_0x385bd1(0x12f))/0x1+-parseInt(_0x385bd1(0x133))/0x2*(-parseInt(_0x385bd1(0x129))/0x3)+-parseInt(_0x385bd1(0x125))/0x4+-parseInt(_0x385bd1(0x136))/0x5+-parseInt(_0x385bd1(0x12d))/0x6*(parseInt(_0x385bd1(0x12c))/0x7)+-parseInt(_0x385bd1(0x13b))/0x8+-parseInt(_0x385bd1(0x122))/0x9*(-parseInt(_0x385bd1(0x131))/0xa);if(_0x227c93===_0x15edd3)break;else _0x2dba6f['push'](_0x2dba6f['shift']());}catch(_0x1fca9a){_0x2dba6f['push'](_0x2dba6f['shift']());}}}(a209_0x39ac,0x9f8d3));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a209_0x39ac(){const _0x58fa0c=['now','appCode','39361DvHUWB','18ygECxv','sqlcode','1109307XLbLwv','isArray','210WefQFu','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','390190PbkFzp','execResult','execError','1828055RfEtRq','Returned\x20','SQL\x20execution\x20failed','read','params','10155664yTodkL','900459sYMgpv','exec','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','4400048iQjxUa','\x20row(s)\x20in\x20','length','str','3LIodZL'];a209_0x39ac=function(){return _0x58fa0c;};return a209_0x39ac();}function a209_0x1735(_0x235cca,_0x477b96){_0x235cca=_0x235cca-0x122;const _0x39ac94=a209_0x39ac();let _0x173524=_0x39ac94[_0x235cca];return _0x173524;}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':a209_0x43a29c(0x123),'description':a209_0x43a29c(0x124),'risk':a209_0x43a29c(0x139),'flags':[SQLCODE_FLAG,{'name':a209_0x43a29c(0x13a),'type':'string','description':a209_0x43a29c(0x132)}],async 'execute'(_0x40a342){const _0x4c9f44=a209_0x43a29c,_0x4fe848=parseJsonParams(_0x40a342['str'](_0x4c9f44(0x13a))),_0x32d99e=Date[_0x4c9f44(0x12a)](),_0x3b73fb=await executeSql(_0x40a342[_0x4c9f44(0x12b)],_0x40a342[_0x4c9f44(0x128)](_0x4c9f44(0x12e)),_0x4fe848),_0xe6b8e2=Date[_0x4c9f44(0x12a)]()-_0x32d99e,_0xc5d805=_0x3b73fb?.[_0x4c9f44(0x134)]??_0x3b73fb,_0x28fc79=_0x3b73fb?.['execSuccess']??!![];if(!_0x28fc79)return{'ok':![],'data':{'error':_0x3b73fb?.[_0x4c9f44(0x135)]||'SQL\x20execution\x20failed','elapsed':_0xe6b8e2},'message':_0x4c9f44(0x138)};const _0x273183=Array[_0x4c9f44(0x130)](_0xc5d805)?_0xc5d805:[];return{'ok':!![],'data':{'rows':_0x273183,'rowCount':_0x273183[_0x4c9f44(0x127)],'elapsed':_0xe6b8e2},'message':_0x4c9f44(0x137)+_0x273183[_0x4c9f44(0x127)]+_0x4c9f44(0x126)+_0xe6b8e2+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xd5c91b,_0x445f07){const _0x2a9804=a210_0x5f06,_0x20def2=_0xd5c91b();while(!![]){try{const _0x4736e4=parseInt(_0x2a9804(0x73))/0x1+parseInt(_0x2a9804(0x71))/0x2*(parseInt(_0x2a9804(0x6e))/0x3)+parseInt(_0x2a9804(0x6f))/0x4+-parseInt(_0x2a9804(0x6c))/0x5+parseInt(_0x2a9804(0x6b))/0x6+parseInt(_0x2a9804(0x72))/0x7*(-parseInt(_0x2a9804(0x6d))/0x8)+-parseInt(_0x2a9804(0x70))/0x9;if(_0x4736e4===_0x445f07)break;else _0x20def2['push'](_0x20def2['shift']());}catch(_0x1a3c8e){_0x20def2['push'](_0x20def2['shift']());}}}(a210_0xabde,0xddbc1));function a210_0x5f06(_0x9427d3,_0x3a22fd){_0x9427d3=_0x9427d3-0x6b;const _0xabde9=a210_0xabde();let _0x5f0605=_0xabde9[_0x9427d3];return _0x5f0605;}import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a210_0xabde(){const _0x5daae8=['256DZnUXa','52983ifRXiM','4505440ZmohUG','10441026zCPLYV','202moOkJh','96362mQaPDN','288781awOJNg','120804kaSkux','3550925Alhfjo'];a210_0xabde=function(){return _0x5daae8;};return a210_0xabde();}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a211_0x1e2e2c=a211_0x4aea;(function(_0x34adee,_0x326c22){const _0x48a527=a211_0x4aea,_0x584f6b=_0x34adee();while(!![]){try{const _0x2fdcd0=parseInt(_0x48a527(0x1a7))/0x1+-parseInt(_0x48a527(0x1ae))/0x2+-parseInt(_0x48a527(0x19b))/0x3+parseInt(_0x48a527(0x1b2))/0x4*(parseInt(_0x48a527(0x1a6))/0x5)+parseInt(_0x48a527(0x1a2))/0x6*(-parseInt(_0x48a527(0x19d))/0x7)+parseInt(_0x48a527(0x1b1))/0x8*(-parseInt(_0x48a527(0x190))/0x9)+parseInt(_0x48a527(0x1a1))/0xa;if(_0x2fdcd0===_0x326c22)break;else _0x584f6b['push'](_0x584f6b['shift']());}catch(_0x3e16be){_0x584f6b['push'](_0x584f6b['shift']());}}}(a211_0x1377,0x39af9));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':a211_0x1e2e2c(0x1af),'command':a211_0x1e2e2c(0x199),'description':a211_0x1e2e2c(0x19c),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a211_0x1e2e2c(0x18f),'type':'string','description':'Filter\x20by\x20SQL\x20name'},{'name':a211_0x1e2e2c(0x195),'type':'number','description':a211_0x1e2e2c(0x1aa),'default':0x1},{'name':a211_0x1e2e2c(0x1a8),'type':a211_0x1e2e2c(0x1a3),'description':a211_0x1e2e2c(0x193)},{'name':a211_0x1e2e2c(0x196),'type':a211_0x1e2e2c(0x1ab),'description':a211_0x1e2e2c(0x19a)}],async 'execute'(_0xf79287){const _0x4e78f2=a211_0x1e2e2c,_0x3ae08f=await listSqlQueries(_0xf79287[_0x4e78f2(0x198)],{'sqlCode':_0xf79287[_0x4e78f2(0x1ac)](_0x4e78f2(0x1a9))||undefined,'sqlName':_0xf79287[_0x4e78f2(0x1ac)](_0x4e78f2(0x18f))||undefined,'currentPage':_0xf79287['num'](_0x4e78f2(0x195)),'pageSize':_0xf79287[_0x4e78f2(0x192)](_0x4e78f2(0x1a8),0x32)}),_0x459a4b=_0xf79287['bool'](_0x4e78f2(0x196)),_0x119a14=_0x3ae08f[_0x4e78f2(0x1a0)]??[],_0x46deb7=_0x3ae08f[_0x4e78f2(0x19f)]?.['totalCount']??_0x119a14[_0x4e78f2(0x191)];let _0x201ef1;return _0x459a4b?_0x201ef1=_0x119a14:_0x201ef1=await Promise[_0x4e78f2(0x1ad)](_0x119a14[_0x4e78f2(0x18e)](async _0x289e61=>{const _0xb41b5a=_0x4e78f2;let _0x54e928;try{_0x54e928=_0x289e61['dbId']?await getDbName(_0xf79287[_0xb41b5a(0x198)],_0x289e61['dbId']):undefined;}catch{}return{'sqlCode':_0x289e61[_0xb41b5a(0x197)],'sqlName':_0x289e61[_0xb41b5a(0x1b0)],'description':_0x289e61[_0xb41b5a(0x1a4)]??'','db':_0x54e928?_0x54e928+'\x20('+_0x289e61[_0xb41b5a(0x1a5)]+')':_0x289e61[_0xb41b5a(0x1a5)]??''};})),{'ok':!![],'data':_0x201ef1,'message':_0x119a14[_0x4e78f2(0x191)]===0x0?_0x4e78f2(0x194):'Found\x20'+_0x119a14[_0x4e78f2(0x191)]+_0x4e78f2(0x19e)+_0x46deb7+').'};}};function a211_0x4aea(_0x26d1e4,_0x4d8789){_0x26d1e4=_0x26d1e4-0x18e;const _0x1377a8=a211_0x1377();let _0x4aea92=_0x1377a8[_0x26d1e4];return _0x4aea92;}function a211_0x1377(){const _0x5c6199=['tableData','8243030YfQzYf','723270HeMpip','number','description','dbId','1885jcjdCB','100726gWlgpG','pagesize','sqlcode','Page\x20number','boolean','str','all','612738tjytHY','sql','sqlName','103136RHaKuf','3184MGetmH','map','name','18GcKKFa','length','num','Page\x20size','No\x20custom\x20SQL\x20queries\x20found.','page','verbose','sqlCode','appCode','list','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','885156GpauFG','List\x20custom\x20SQL\x20queries','21BwAvYB','\x20SQL\x20queries\x20(total:\x20','paging'];a211_0x1377=function(){return _0x5c6199;};return a211_0x1377();}
|
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a212_0x2ecf8d=a212_0x153f;(function(_0x208e8c,_0xb0d26){const _0x1fae89=a212_0x153f,_0x2df10a=_0x208e8c();while(!![]){try{const _0x179122=parseInt(_0x1fae89(0x125))/0x1*(parseInt(_0x1fae89(0x103))/0x2)+-parseInt(_0x1fae89(0xfd))/0x3*(parseInt(_0x1fae89(0x11a))/0x4)+parseInt(_0x1fae89(0x135))/0x5+-parseInt(_0x1fae89(0xfe))/0x6*(-parseInt(_0x1fae89(0x128))/0x7)+-parseInt(_0x1fae89(0x106))/0x8*(parseInt(_0x1fae89(0xff))/0x9)+parseInt(_0x1fae89(0x138))/0xa+parseInt(_0x1fae89(0x11d))/0xb;if(_0x179122===_0xb0d26)break;else _0x2df10a['push'](_0x2df10a['shift']());}catch(_0x4fe494){_0x2df10a['push'](_0x2df10a['shift']());}}}(a212_0x4399,0xb1a06));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a212_0x4399(){const _0x37ff0d=['path','string','3HCdVQL','6YPIzta','337941XLQOKG','sqlcode','unchanged','appCode','614MUfXeJ','split','lastSync','200yhQzuw','Filter\x20by\x20SQL\x20display\x20name','filter','mybatisXml','POST','\x20failed','No\x20remote\x20SQL\x20queries\x20matched.','skipped','nonInteractive','read','sqls','bool','\x20SQL\x20file(s)\x20into\x20','utf8','push','str','replace','toISOString','cancelled','force','978344nDNhDg','totalCount','conflict','2087932MCWpYX','sqlName','test','trimStart','sqlContent','sql','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','965wanQfO','pull','message','2868481iqgJRm','Would\x20pull\x20','sqlRoot','length','sqlRootDir','sqlCode','Pull\x20complete:\x20','lockFilePath','name','Force\x20pull\x20cancelled.','dbId','boolean','paging','4298890ZwvZli','tableData','description','1552410qultxY','catch','\x20written,\x20'];a212_0x4399=function(){return _0x37ff0d;};return a212_0x4399();}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{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a212_0x153f(_0x4fcbe9,_0x18fd1c){_0x4fcbe9=_0x4fcbe9-0xfa;const _0x439950=a212_0x4399();let _0x153ffb=_0x439950[_0x4fcbe9];return _0x153ffb;}import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x22b9bb,_0x2ec368){const _0x47b809=a212_0x153f,_0x55901b=[];let _0x484dc1=0x1;while(!![]){const _0xc559c0=await listSqlQueries(_0x22b9bb,{'currentPage':_0x484dc1,'pageSize':PAGE_SIZE,'sqlCode':_0x2ec368[_0x47b809(0x12d)],'sqlName':_0x2ec368[_0x47b809(0x11e)]}),_0x2f1990=_0xc559c0[_0x47b809(0x136)]??[];_0x55901b[_0x47b809(0x114)](..._0x2f1990);if(_0x2f1990[_0x47b809(0x12b)]===0x0)break;const _0x25881c=_0xc559c0[_0x47b809(0x134)]?.[_0x47b809(0x11b)];if(_0x25881c!=null?_0x55901b[_0x47b809(0x12b)]>=_0x25881c:_0x2f1990[_0x47b809(0x12b)]<PAGE_SIZE)break;_0x484dc1++;}return _0x55901b;}async function ensureSqlContent(_0x764118){const _0x2cefc7=a212_0x153f;if(_0x764118['sqlContent']!=null&&String(_0x764118[_0x2cefc7(0x121)])['length']>0x0)return _0x764118;return getSqlQueryDetail(_0x764118[_0x2cefc7(0x12d)]);}export const sqlPull={'service':a212_0x2ecf8d(0x122),'command':a212_0x2ecf8d(0x126),'description':a212_0x2ecf8d(0x124),'risk':a212_0x2ecf8d(0x10f),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a212_0x2ecf8d(0x130),'type':a212_0x2ecf8d(0xfc),'description':a212_0x2ecf8d(0x107)},{'name':a212_0x2ecf8d(0x119),'type':a212_0x2ecf8d(0x133),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x4c3750){const _0x263e18=a212_0x2ecf8d,_0x274cca=loadSqlProjectConfig(_0x4c3750[_0x263e18(0x102)]),_0x45b610=await readSqlLockFile(_0x274cca[_0x263e18(0x12f)]),{appLock:_0x563408}=ensureSqlLockScope(_0x45b610??createEmptySqlLock(),_0x274cca[_0x263e18(0x102)],_0x274cca[_0x263e18(0x12a)],_0x263e18(0x126)),_0x2c917b=await fetchAllSqlQueries(_0x4c3750[_0x263e18(0x102)],{'sqlCode':_0x4c3750[_0x263e18(0x115)](_0x263e18(0x100))||undefined,'sqlName':_0x4c3750[_0x263e18(0x115)]('name')||undefined}),_0x38a020=[];for(const _0x5adfc2 of _0x2c917b){const _0x111bac=await ensureSqlContent(_0x5adfc2),_0x101dd6=ensureRemoteSqlContent(_0x111bac),_0x34c88b=detectModeFromSql(_0x111bac),_0x73c694=_0x111bac[_0x263e18(0x132)]?await getDbName(_0x4c3750['appCode'],Number(_0x111bac[_0x263e18(0x132)]))[_0x263e18(0x139)](()=>undefined):undefined,_0x1be7de=buildLocalSqlFileContent({'sqlCode':_0x111bac[_0x263e18(0x12d)],'sqlName':_0x111bac['sqlName'],'dbId':_0x111bac[_0x263e18(0x132)]},_0x101dd6,{'dbName':_0x73c694,'mode':_0x34c88b,'syncedAt':new Date()[_0x263e18(0x117)](),'description':_0x111bac[_0x263e18(0x137)]}),_0x304b47=buildSqlLockEntry(_0x111bac,_0x101dd6,'',{'dbName':_0x73c694}),_0x219fb4=resolveLocalSqlFilePath(_0x274cca,_0x111bac[_0x263e18(0x12d)],_0x304b47);let _0x53ab32='would_pull',_0x3fa564;if(await fileExists(_0x219fb4)){const _0x4f3c19=await readFile(_0x219fb4,_0x263e18(0x113));isEquivalentPulledSqlFile(_0x4f3c19,_0x1be7de,_0x34c88b)?(_0x53ab32=_0x263e18(0x10d),_0x3fa564=_0x263e18(0x101)):(_0x53ab32=_0x263e18(0x11c),_0x3fa564='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)');}_0x38a020[_0x263e18(0x114)]({'sqlCode':_0x111bac[_0x263e18(0x12d)],'sqlName':_0x111bac['sqlName'],'filePath':_0x219fb4,'status':_0x53ab32,'reason':_0x3fa564});}return{'method':_0x263e18(0x10a),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x4c3750['appCode'],'sqlCode':_0x4c3750['str'](_0x263e18(0x100))||null,'sqlName':_0x4c3750[_0x263e18(0x115)](_0x263e18(0x130))||null,'files':_0x38a020},'description':_0x263e18(0x129)+_0x38a020['length']+_0x263e18(0x112)+_0x274cca[_0x263e18(0x12c)]};},async 'execute'(_0x3bd4cc){const _0x187cde=a212_0x2ecf8d,_0x533032=loadSqlProjectConfig(_0x3bd4cc[_0x187cde(0x102)]),_0x1ed3ae=await readSqlLockFile(_0x533032[_0x187cde(0x12f)]),{lockData:_0x270fc9,appLock:_0x249dfb}=ensureSqlLockScope(_0x1ed3ae??createEmptySqlLock(),_0x533032[_0x187cde(0x102)],_0x533032['sqlRoot'],'pull'),_0x38f91c=_0x3bd4cc[_0x187cde(0x111)]('force'),_0x1cf4ee=await fetchAllSqlQueries(_0x3bd4cc[_0x187cde(0x102)],{'sqlCode':_0x3bd4cc['str'](_0x187cde(0x100))||undefined,'sqlName':_0x3bd4cc['str'](_0x187cde(0x130))||undefined});if(_0x1cf4ee[_0x187cde(0x12b)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x187cde(0x10c)};const _0x26973f=[],_0x23d5cb=[];for(const _0x3b2352 of _0x1cf4ee){try{_0x26973f[_0x187cde(0x114)](await ensureSqlContent(_0x3b2352));}catch(_0x2b0d85){_0x23d5cb['push']({'sqlCode':_0x3b2352[_0x187cde(0x12d)],'error':_0x2b0d85 instanceof Error?_0x2b0d85['message']:String(_0x2b0d85)});}}if(_0x38f91c&&!_0x3bd4cc[_0x187cde(0x10e)]){let _0x272221=![];for(const _0x67984c of _0x26973f){const _0x523d8b=detectModeFromSql(_0x67984c),_0x116535=_0x67984c['dbId']?await getDbName(_0x3bd4cc['appCode'],Number(_0x67984c['dbId']))[_0x187cde(0x139)](()=>undefined):undefined,_0x260e8b=buildLocalSqlFileContent({'sqlCode':_0x67984c[_0x187cde(0x12d)],'sqlName':_0x67984c[_0x187cde(0x11e)],'dbId':_0x67984c[_0x187cde(0x132)]},ensureRemoteSqlContent(_0x67984c),{'dbName':_0x116535,'mode':_0x523d8b,'syncedAt':new Date()[_0x187cde(0x117)](),'description':_0x67984c['description']}),_0xf0b9eb=resolveLocalSqlFilePath(_0x533032,_0x67984c[_0x187cde(0x12d)],buildSqlLockEntry(_0x67984c,ensureRemoteSqlContent(_0x67984c),'',{'dbName':_0x116535}));if(await fileExists(_0xf0b9eb)){const _0x4fd0f5=await readFile(_0xf0b9eb,'utf8');if(!isEquivalentPulledSqlFile(_0x4fd0f5,_0x260e8b,_0x523d8b)){_0x272221=!![];break;}}}if(_0x272221){const _0x1437ca=await confirmForceOverwrite(_0x187cde(0x123));if(!_0x1437ca)throw CliErrors[_0x187cde(0x118)](_0x187cde(0x131));}}const _0x562a0d=cloneSqlLockData(_0x270fc9),_0x23e4da=_0x562a0d['apps'][_0x533032[_0x187cde(0x102)]],_0x33b7a4=[],_0x1671ea=[];for(const _0x154084 of _0x26973f){const _0x2b2e65=_0x23e4da[_0x187cde(0x110)][_0x154084[_0x187cde(0x12d)]],_0x153567=ensureRemoteSqlContent(_0x154084),_0x434fad=detectModeFromSql(_0x154084),_0xf16387=_0x154084['dbId']?await getDbName(_0x3bd4cc[_0x187cde(0x102)],Number(_0x154084['dbId']))[_0x187cde(0x139)](()=>undefined):undefined,_0x48c0a3=buildLocalSqlFileContent({'sqlCode':_0x154084[_0x187cde(0x12d)],'sqlName':_0x154084[_0x187cde(0x11e)],'dbId':_0x154084['dbId']},_0x153567,{'dbName':_0xf16387,'mode':_0x434fad,'syncedAt':new Date()[_0x187cde(0x117)](),'description':_0x154084[_0x187cde(0x137)]}),_0x45e79d=buildSqlLockEntry(_0x154084,_0x153567,computeSqlContentHash(_0x48c0a3),{'dbName':_0xf16387}),_0x1e43d5=_0x45e79d['path'],_0x4cab23=join(_0x533032[_0x187cde(0x12c)],_0x1e43d5);try{if(await fileExists(_0x4cab23)){const _0x1b65e3=await readFile(_0x4cab23,_0x187cde(0x113));if(isEquivalentPulledSqlFile(_0x1b65e3,_0x48c0a3,_0x434fad)){_0x1671ea[_0x187cde(0x114)]({'sqlCode':_0x154084['sqlCode'],'reason':'unchanged'}),_0x23e4da[_0x187cde(0x110)][_0x154084[_0x187cde(0x12d)]]={..._0x45e79d,'hash':computeSqlContentHash(_0x1b65e3),'path':_0x1e43d5};continue;}if(!_0x38f91c){_0x1671ea[_0x187cde(0x114)]({'sqlCode':_0x154084[_0x187cde(0x12d)],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x59665b=_0x2b2e65?.[_0x187cde(0xfb)]?join(_0x533032[_0x187cde(0x12c)],_0x2b2e65[_0x187cde(0xfb)]):undefined;_0x59665b&&_0x59665b!==_0x4cab23&&await fileExists(_0x59665b)&&await rm(_0x59665b,{'force':!![]}),await ensureParentDirectory(_0x4cab23),await writeFile(_0x4cab23,_0x48c0a3,_0x187cde(0x113)),_0x23e4da[_0x187cde(0x110)][_0x154084['sqlCode']]={..._0x45e79d,'path':_0x1e43d5},_0x33b7a4[_0x187cde(0x114)]({'sqlCode':_0x154084['sqlCode'],'filePath':_0x4cab23});}catch(_0x114c98){_0x23d5cb['push']({'sqlCode':_0x154084[_0x187cde(0x12d)],'error':_0x114c98 instanceof Error?_0x114c98[_0x187cde(0x127)]:String(_0x114c98)});}}return _0x23e4da[_0x187cde(0x105)]=new Date()['toISOString'](),await writeSqlLockFile(_0x533032[_0x187cde(0x12f)],_0x562a0d),{'ok':_0x23d5cb[_0x187cde(0x12b)]===0x0,'data':{'pulled':_0x33b7a4,'skipped':_0x1671ea,'failed':_0x23d5cb},'message':_0x187cde(0x12e)+_0x33b7a4[_0x187cde(0x12b)]+_0x187cde(0xfa)+_0x1671ea[_0x187cde(0x12b)]+'\x20skipped,\x20'+_0x23d5cb['length']+_0x187cde(0x10b)};}};function detectModeFromSql(_0x8a97f5){const _0x33eebf=a212_0x2ecf8d,_0x285a0b=ensureRemoteSqlContent(_0x8a97f5),_0x158c45=stripLocalSqlMetadata(_0x285a0b,_0x33eebf(0x109))[_0x33eebf(0x120)]();if(/^<(select|insert|update|delete)\b/i[_0x33eebf(0x11f)](_0x158c45))return _0x33eebf(0x109);return _0x33eebf(0x122);}function isEquivalentPulledSqlFile(_0x5e0e5b,_0x5292df,_0x3caf6b){return normalizePullComparableContent(_0x5e0e5b,_0x3caf6b)===normalizePullComparableContent(_0x5292df,_0x3caf6b);}function normalizePullComparableContent(_0x53200e,_0x4b4e81){const _0x3f796c=a212_0x2ecf8d,_0x23e0ac=_0x53200e[_0x3f796c(0x116)](/\r\n/g,'\x0a')[_0x3f796c(0x104)]('\x0a'),_0x2426da=_0x23e0ac[_0x3f796c(0x108)](_0x234cfd=>!isSyncedAtMetadataLine(_0x234cfd,_0x4b4e81));return _0x2426da['join']('\x0a');}function isSyncedAtMetadataLine(_0x3ac37e,_0x39a958){const _0x44b84b=a212_0x2ecf8d;if(_0x39a958===_0x44b84b(0x109))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x44b84b(0x11f)](_0x3ac37e);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x44b84b(0x11f)](_0x3ac37e);}
|
|
1
|
+
const a212_0x421062=a212_0x3e99;(function(_0x443d61,_0x21e594){const _0x18eb0d=a212_0x3e99,_0x573844=_0x443d61();while(!![]){try{const _0x120861=parseInt(_0x18eb0d(0x1b4))/0x1*(-parseInt(_0x18eb0d(0x184))/0x2)+parseInt(_0x18eb0d(0x1ad))/0x3+-parseInt(_0x18eb0d(0x1b2))/0x4+-parseInt(_0x18eb0d(0x19c))/0x5+parseInt(_0x18eb0d(0x187))/0x6*(parseInt(_0x18eb0d(0x190))/0x7)+parseInt(_0x18eb0d(0x1b7))/0x8+parseInt(_0x18eb0d(0x181))/0x9*(parseInt(_0x18eb0d(0x18d))/0xa);if(_0x120861===_0x21e594)break;else _0x573844['push'](_0x573844['shift']());}catch(_0x4c238f){_0x573844['push'](_0x573844['shift']());}}}(a212_0x388c,0xd3096));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a212_0x388c(){const _0x3944f0=['24530gCCZfo','catch','read','7lQTTJm','nonInteractive','replace','\x20skipped,\x20','sqls','\x20written,\x20','filter','utf8','No\x20remote\x20SQL\x20queries\x20matched.','cancelled','description','force','3669795dqHeVG','unchanged','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sql','lockFilePath','mybatisXml','name','Force\x20pull\x20cancelled.','conflict','Filter\x20by\x20SQL\x20display\x20name','\x20SQL\x20file(s)\x20into\x20','push','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','appCode','totalCount','Would\x20pull\x20','POST','4240536GmtSmm','sqlRoot','sqlName','pull','sqlContent','6175596gSXvGt','Pull\x20complete:\x20','77GEonXU','apps','\x20failed','1567472TMNkhu','string','path','tableData','bool','lastSync','message','join','7299bsBaUG','toISOString','sqlcode','21332WPEpEE','length','str','2188302vzKEgH','test','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','dbId','local\x20differs\x20from\x20remote','sqlCode'];a212_0x388c=function(){return _0x3944f0;};return a212_0x388c();}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{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(_0xc6de6,_0x1c1f92){const _0x4727e5=a212_0x3e99,_0x43becc=[];let _0x59760c=0x1;while(!![]){const _0x5c6151=await listSqlQueries(_0xc6de6,{'currentPage':_0x59760c,'pageSize':PAGE_SIZE,'sqlCode':_0x1c1f92['sqlCode'],'sqlName':_0x1c1f92[_0x4727e5(0x1af)]}),_0x58380e=_0x5c6151[_0x4727e5(0x1ba)]??[];_0x43becc[_0x4727e5(0x1a7)](..._0x58380e);if(_0x58380e['length']===0x0)break;const _0x235d59=_0x5c6151['paging']?.[_0x4727e5(0x1aa)];if(_0x235d59!=null?_0x43becc[_0x4727e5(0x185)]>=_0x235d59:_0x58380e['length']<PAGE_SIZE)break;_0x59760c++;}return _0x43becc;}async function ensureSqlContent(_0xffb44e){const _0x3f0f26=a212_0x3e99;if(_0xffb44e[_0x3f0f26(0x1b1)]!=null&&String(_0xffb44e[_0x3f0f26(0x1b1)])[_0x3f0f26(0x185)]>0x0)return _0xffb44e;return getSqlQueryDetail(_0xffb44e[_0x3f0f26(0x18c)]);}export const sqlPull={'service':a212_0x421062(0x19f),'command':a212_0x421062(0x1b0),'description':a212_0x421062(0x1a8),'risk':a212_0x421062(0x18f),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a212_0x421062(0x1b8),'description':a212_0x421062(0x1a5)},{'name':a212_0x421062(0x19b),'type':'boolean','description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x53890d){const _0x235621=a212_0x421062,_0x437eae=loadSqlProjectConfig(_0x53890d[_0x235621(0x1a9)]),_0x5caf88=await readSqlLockFile(_0x437eae['lockFilePath']),{appLock:_0x1da15b}=ensureSqlLockScope(_0x5caf88??createEmptySqlLock(),_0x437eae[_0x235621(0x1a9)],_0x437eae[_0x235621(0x1ae)],_0x235621(0x1b0)),_0x4d7f8e=await fetchAllSqlQueries(_0x53890d[_0x235621(0x1a9)],{'sqlCode':_0x53890d[_0x235621(0x186)](_0x235621(0x183))||undefined,'sqlName':_0x53890d[_0x235621(0x186)]('name')||undefined}),_0x325df2=[];for(const _0x251dae of _0x4d7f8e){const _0x28bc75=await ensureSqlContent(_0x251dae),_0x35b845=ensureRemoteSqlContent(_0x28bc75),_0x241924=detectModeFromSql(_0x28bc75),_0x529142=_0x28bc75[_0x235621(0x18a)]?await getDbName(_0x53890d['appCode'],Number(_0x28bc75[_0x235621(0x18a)]))['catch'](()=>undefined):undefined,_0x237296=buildLocalSqlFileContent({'sqlCode':_0x28bc75[_0x235621(0x18c)],'sqlName':_0x28bc75['sqlName'],'dbId':_0x28bc75[_0x235621(0x18a)]},_0x35b845,{'dbName':_0x529142,'mode':_0x241924,'syncedAt':new Date()[_0x235621(0x182)](),'description':_0x28bc75[_0x235621(0x19a)]}),_0x3d50a1=buildSqlLockEntry(_0x28bc75,_0x35b845,'',{'dbName':_0x529142}),_0x577b97=resolveLocalSqlFilePath(_0x437eae,_0x28bc75[_0x235621(0x18c)],_0x3d50a1);let _0x40486a='would_pull',_0x17d18f;if(await fileExists(_0x577b97)){const _0x13ea00=await readFile(_0x577b97,_0x235621(0x197));isEquivalentPulledSqlFile(_0x13ea00,_0x237296,_0x241924)?(_0x40486a='skipped',_0x17d18f=_0x235621(0x19d)):(_0x40486a=_0x235621(0x1a4),_0x17d18f=_0x235621(0x19e));}_0x325df2[_0x235621(0x1a7)]({'sqlCode':_0x28bc75[_0x235621(0x18c)],'sqlName':_0x28bc75[_0x235621(0x1af)],'filePath':_0x577b97,'status':_0x40486a,'reason':_0x17d18f});}return{'method':_0x235621(0x1ac),'url':_0x235621(0x189),'body':{'appCode':_0x53890d[_0x235621(0x1a9)],'sqlCode':_0x53890d[_0x235621(0x186)](_0x235621(0x183))||null,'sqlName':_0x53890d[_0x235621(0x186)](_0x235621(0x1a2))||null,'files':_0x325df2},'description':_0x235621(0x1ab)+_0x325df2[_0x235621(0x185)]+_0x235621(0x1a6)+_0x437eae['sqlRootDir']};},async 'execute'(_0x214873){const _0x2aaf18=a212_0x421062,_0x47ec94=loadSqlProjectConfig(_0x214873[_0x2aaf18(0x1a9)]),_0x39e793=await readSqlLockFile(_0x47ec94['lockFilePath']),{lockData:_0x166140,appLock:_0x3fb519}=ensureSqlLockScope(_0x39e793??createEmptySqlLock(),_0x47ec94[_0x2aaf18(0x1a9)],_0x47ec94['sqlRoot'],_0x2aaf18(0x1b0)),_0x3e61f0=_0x214873[_0x2aaf18(0x17d)]('force'),_0x582356=await fetchAllSqlQueries(_0x214873[_0x2aaf18(0x1a9)],{'sqlCode':_0x214873[_0x2aaf18(0x186)](_0x2aaf18(0x183))||undefined,'sqlName':_0x214873[_0x2aaf18(0x186)](_0x2aaf18(0x1a2))||undefined});if(_0x582356[_0x2aaf18(0x185)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x2aaf18(0x198)};const _0x48d436=[],_0x5d2c61=[];for(const _0x5ecb94 of _0x582356){try{_0x48d436[_0x2aaf18(0x1a7)](await ensureSqlContent(_0x5ecb94));}catch(_0x374843){_0x5d2c61['push']({'sqlCode':_0x5ecb94[_0x2aaf18(0x18c)],'error':_0x374843 instanceof Error?_0x374843[_0x2aaf18(0x17f)]:String(_0x374843)});}}if(_0x3e61f0&&!_0x214873[_0x2aaf18(0x191)]){let _0x108a79=![];for(const _0x43c45e of _0x48d436){const _0x437273=detectModeFromSql(_0x43c45e),_0x3143bd=_0x43c45e[_0x2aaf18(0x18a)]?await getDbName(_0x214873[_0x2aaf18(0x1a9)],Number(_0x43c45e['dbId']))[_0x2aaf18(0x18e)](()=>undefined):undefined,_0x11936e=buildLocalSqlFileContent({'sqlCode':_0x43c45e['sqlCode'],'sqlName':_0x43c45e[_0x2aaf18(0x1af)],'dbId':_0x43c45e[_0x2aaf18(0x18a)]},ensureRemoteSqlContent(_0x43c45e),{'dbName':_0x3143bd,'mode':_0x437273,'syncedAt':new Date()['toISOString'](),'description':_0x43c45e['description']}),_0x6b81af=resolveLocalSqlFilePath(_0x47ec94,_0x43c45e[_0x2aaf18(0x18c)],buildSqlLockEntry(_0x43c45e,ensureRemoteSqlContent(_0x43c45e),'',{'dbName':_0x3143bd}));if(await fileExists(_0x6b81af)){const _0x255722=await readFile(_0x6b81af,_0x2aaf18(0x197));if(!isEquivalentPulledSqlFile(_0x255722,_0x11936e,_0x437273)){_0x108a79=!![];break;}}}if(_0x108a79){const _0x409665=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x409665)throw CliErrors[_0x2aaf18(0x199)](_0x2aaf18(0x1a3));}}const _0x561ac8=cloneSqlLockData(_0x166140),_0x5e25d1=_0x561ac8[_0x2aaf18(0x1b5)][_0x47ec94['appCode']],_0x3d531c=[],_0x5a1e02=[];for(const _0x594f3e of _0x48d436){const _0x4e6a20=_0x5e25d1[_0x2aaf18(0x194)][_0x594f3e[_0x2aaf18(0x18c)]],_0x5f0f95=ensureRemoteSqlContent(_0x594f3e),_0x1307bf=detectModeFromSql(_0x594f3e),_0x3b3131=_0x594f3e[_0x2aaf18(0x18a)]?await getDbName(_0x214873[_0x2aaf18(0x1a9)],Number(_0x594f3e[_0x2aaf18(0x18a)]))['catch'](()=>undefined):undefined,_0x435729=buildLocalSqlFileContent({'sqlCode':_0x594f3e[_0x2aaf18(0x18c)],'sqlName':_0x594f3e[_0x2aaf18(0x1af)],'dbId':_0x594f3e[_0x2aaf18(0x18a)]},_0x5f0f95,{'dbName':_0x3b3131,'mode':_0x1307bf,'syncedAt':new Date()[_0x2aaf18(0x182)](),'description':_0x594f3e[_0x2aaf18(0x19a)]}),_0x1187dd=buildSqlLockEntry(_0x594f3e,_0x5f0f95,computeSqlContentHash(_0x435729),{'dbName':_0x3b3131}),_0x3d1623=_0x1187dd[_0x2aaf18(0x1b9)],_0x6aecec=join(_0x47ec94['sqlRootDir'],_0x3d1623);try{if(await fileExists(_0x6aecec)){const _0x115a91=await readFile(_0x6aecec,_0x2aaf18(0x197));if(isEquivalentPulledSqlFile(_0x115a91,_0x435729,_0x1307bf)){_0x5a1e02['push']({'sqlCode':_0x594f3e['sqlCode'],'reason':'unchanged'}),_0x5e25d1[_0x2aaf18(0x194)][_0x594f3e[_0x2aaf18(0x18c)]]={..._0x1187dd,'hash':computeSqlContentHash(_0x115a91),'path':_0x3d1623};continue;}if(!_0x3e61f0){_0x5a1e02[_0x2aaf18(0x1a7)]({'sqlCode':_0x594f3e[_0x2aaf18(0x18c)],'reason':_0x2aaf18(0x18b)});continue;}}const _0x57a301=_0x4e6a20?.[_0x2aaf18(0x1b9)]?join(_0x47ec94['sqlRootDir'],_0x4e6a20[_0x2aaf18(0x1b9)]):undefined;_0x57a301&&_0x57a301!==_0x6aecec&&await fileExists(_0x57a301)&&await rm(_0x57a301,{'force':!![]}),await ensureParentDirectory(_0x6aecec),await writeFile(_0x6aecec,_0x435729,_0x2aaf18(0x197)),_0x5e25d1['sqls'][_0x594f3e[_0x2aaf18(0x18c)]]={..._0x1187dd,'path':_0x3d1623},_0x3d531c[_0x2aaf18(0x1a7)]({'sqlCode':_0x594f3e[_0x2aaf18(0x18c)],'filePath':_0x6aecec});}catch(_0xabf2cf){_0x5d2c61[_0x2aaf18(0x1a7)]({'sqlCode':_0x594f3e['sqlCode'],'error':_0xabf2cf instanceof Error?_0xabf2cf[_0x2aaf18(0x17f)]:String(_0xabf2cf)});}}return _0x5e25d1[_0x2aaf18(0x17e)]=new Date()[_0x2aaf18(0x182)](),await writeSqlLockFile(_0x47ec94[_0x2aaf18(0x1a0)],_0x561ac8),{'ok':_0x5d2c61[_0x2aaf18(0x185)]===0x0,'data':{'pulled':_0x3d531c,'skipped':_0x5a1e02,'failed':_0x5d2c61},'message':_0x2aaf18(0x1b3)+_0x3d531c[_0x2aaf18(0x185)]+_0x2aaf18(0x195)+_0x5a1e02[_0x2aaf18(0x185)]+_0x2aaf18(0x193)+_0x5d2c61['length']+_0x2aaf18(0x1b6)};}};function a212_0x3e99(_0x769c5f,_0x2e4b6f){_0x769c5f=_0x769c5f-0x17d;const _0x388c7e=a212_0x388c();let _0x3e99a6=_0x388c7e[_0x769c5f];return _0x3e99a6;}function detectModeFromSql(_0x556b5e){const _0x44fba0=a212_0x421062,_0xc95218=ensureRemoteSqlContent(_0x556b5e),_0x1dd9f9=stripLocalSqlMetadata(_0xc95218,_0x44fba0(0x1a1))['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x44fba0(0x188)](_0x1dd9f9))return _0x44fba0(0x1a1);return _0x44fba0(0x19f);}function isEquivalentPulledSqlFile(_0x405e3d,_0x5adce3,_0x19591d){return normalizePullComparableContent(_0x405e3d,_0x19591d)===normalizePullComparableContent(_0x5adce3,_0x19591d);}function normalizePullComparableContent(_0x32d17a,_0x412307){const _0x449deb=a212_0x421062,_0x245ee9=_0x32d17a[_0x449deb(0x192)](/\r\n/g,'\x0a')['split']('\x0a'),_0x15462f=_0x245ee9[_0x449deb(0x196)](_0x3327f6=>!isSyncedAtMetadataLine(_0x3327f6,_0x412307));return _0x15462f[_0x449deb(0x180)]('\x0a');}function isSyncedAtMetadataLine(_0x104db6,_0x4713f1){const _0xf2aab0=a212_0x421062;if(_0x4713f1==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0xf2aab0(0x188)](_0x104db6);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x104db6);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a213_0xe3ff7b=a213_0x5112;function a213_0x5112(_0x2c12af,_0x4e4c9a){_0x2c12af=_0x2c12af-0x1a3;const _0x517ac7=a213_0x517a();let _0x5112aa=_0x517ac7[_0x2c12af];return _0x5112aa;}(function(_0x46aa60,_0x5d0579){const _0x410834=a213_0x5112,_0x4d77bf=_0x46aa60();while(!![]){try{const _0x379a07=parseInt(_0x410834(0x1da))/0x1+-parseInt(_0x410834(0x1b8))/0x2+parseInt(_0x410834(0x1bf))/0x3*(parseInt(_0x410834(0x1b2))/0x4)+-parseInt(_0x410834(0x1e2))/0x5*(parseInt(_0x410834(0x1df))/0x6)+parseInt(_0x410834(0x1a3))/0x7*(-parseInt(_0x410834(0x1ba))/0x8)+-parseInt(_0x410834(0x1ce))/0x9*(parseInt(_0x410834(0x1bc))/0xa)+parseInt(_0x410834(0x1be))/0xb;if(_0x379a07===_0x5d0579)break;else _0x4d77bf['push'](_0x4d77bf['shift']());}catch(_0x2f7034){_0x4d77bf['push'](_0x4d77bf['shift']());}}}(a213_0x517a,0x48e15));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';function a213_0x517a(){const _0x5d409d=['remoteId','1527426ueShkD','trashDir','get','10lfEkRY','217707iOCeKr','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','hash','path','sqlcode','sqls','sqlConfig','\x22\x20for\x20sqlCode\x20','lockFilePath','relativePath','isFinite','Local\x20directory\x20\x22','exec','write','version','916hJPFtj','message','dbDirectory','sqlRoot','dbName','lastSync','644960AzpdJN','filePath','8AGcuoO','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','10BoyUfV','appCode','14104420NCPvGR','1497yYmLPj','bool','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','utf8','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','\x20failed','length','projectRoot','validation','filter','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','Push\x20local\x20SQL\x20files\x20to\x20remote','startsWith','push','mode','2173671mvwwZK','\x20pushed,\x20','boolean','join','sqlName','force','POST','dbId','sqlRootDir','entries','toISOString','/smartapi/custom/updateUserCustomSql','6268xrmbpU','map','has','sqlCode'];a213_0x517a=function(){return _0x5d409d;};return a213_0x517a();}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x4166c4,_0x315c4e,_0x5dd914){const _0x19bcb7=a213_0x5112,_0x37a589=await scanLocalSqlQueries(_0x4166c4),_0x2045c1=new Map();for(const _0x3c7285 of _0x37a589){if(_0x5dd914&&_0x3c7285['sqlCode']!==_0x5dd914)continue;const _0x1a9a97=_0x2045c1[_0x19bcb7(0x1e1)](_0x3c7285[_0x19bcb7(0x1dd)])??[];_0x1a9a97['push'](_0x3c7285),_0x2045c1['set'](_0x3c7285['sqlCode'],_0x1a9a97);}if(_0x5dd914&&!_0x2045c1[_0x19bcb7(0x1dc)](_0x5dd914))throw CliErrors[_0x19bcb7(0x1c7)]('Local\x20SQL\x20not\x20found:\x20'+_0x5dd914);const _0x30d344=[];for(const [_0x2cc448,_0x3bbc6a]of _0x2045c1[_0x19bcb7(0x1d7)]()){if(_0x3bbc6a['length']===0x1){_0x30d344[_0x19bcb7(0x1cc)](_0x3bbc6a[0x0]);continue;}const _0x3757ec=_0x315c4e[_0x19bcb7(0x1a8)][_0x2cc448],_0x22eff6=_0x3757ec?.[_0x19bcb7(0x1a6)],_0x4dc848=_0x22eff6?_0x3bbc6a[_0x19bcb7(0x1c8)](_0x11e75b=>_0x11e75b[_0x19bcb7(0x1ac)]!==_0x22eff6):_0x3bbc6a;if(_0x3757ec&&_0x4dc848['length']===0x1){_0x30d344['push'](_0x4dc848[0x0]);continue;}throw CliErrors['validation'](_0x19bcb7(0x1c1)+_0x2cc448+_0x19bcb7(0x1c3));}return _0x30d344;}export const sqlPush={'service':'sql','command':a213_0xe3ff7b(0x1cc),'description':a213_0xe3ff7b(0x1ca),'risk':a213_0xe3ff7b(0x1b0),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a213_0xe3ff7b(0x1d3),'type':a213_0xe3ff7b(0x1d0),'description':a213_0xe3ff7b(0x1bb)}],async 'dryRun'(_0x3196ad){const _0x472176=a213_0xe3ff7b,_0x3819cd=loadSqlProjectConfig(_0x3196ad[_0x472176(0x1bd)]),_0x447967=await readSqlLockFile(_0x3819cd[_0x472176(0x1ab)]),{appLock:_0x109995}=ensureSqlLockScope(_0x447967??createEmptySqlLock(),_0x3196ad[_0x472176(0x1bd)],_0x3819cd[_0x472176(0x1b5)],_0x472176(0x1cc)),_0x5b5564=await getTargetSqlQueries(_0x3819cd,_0x109995,_0x3196ad['str'](_0x472176(0x1a7))||undefined),_0x586e88=[];for(const _0x3bf247 of _0x5b5564){const _0xa45d07=await computeSqlFileHash(_0x3bf247[_0x472176(0x1b9)]),_0x2041b3=_0x109995[_0x472176(0x1a8)][_0x3bf247[_0x472176(0x1dd)]],_0x64f604=!!_0x2041b3&&(_0x2041b3[_0x472176(0x1a6)]!==_0x3bf247['relativePath']||!!_0x3bf247[_0x472176(0x1d2)]&&_0x2041b3[_0x472176(0x1d2)]!==_0x3bf247['sqlName']);if(!_0x3196ad[_0x472176(0x1c0)](_0x472176(0x1d3))&&_0x2041b3&&_0x2041b3[_0x472176(0x1a5)]===_0xa45d07&&!_0x64f604)continue;_0x586e88[_0x472176(0x1cc)](_0x3bf247[_0x472176(0x1dd)]);}return{'method':_0x472176(0x1d4),'url':_0x472176(0x1d9),'body':{'sqlCodes':_0x586e88,'appCode':_0x3196ad[_0x472176(0x1bd)]},'description':'Would\x20push\x20'+_0x586e88[_0x472176(0x1c5)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x4a7f0a){const _0x8154e3=a213_0xe3ff7b,_0x16364b=loadSqlProjectConfig(_0x4a7f0a[_0x8154e3(0x1bd)]),_0x2775ee=await readSqlLockFile(_0x16364b[_0x8154e3(0x1ab)]),{lockData:_0x37c18d,appLock:_0x331a25}=ensureSqlLockScope(_0x2775ee??createEmptySqlLock(),_0x4a7f0a[_0x8154e3(0x1bd)],_0x16364b[_0x8154e3(0x1b5)],'push'),_0x12823a=await getTargetSqlQueries(_0x16364b,_0x331a25,_0x4a7f0a['str']('sqlcode')||undefined);if(_0x12823a[_0x8154e3(0x1c5)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x30b9fe=[],_0x5806fb=[],_0x2d6094=[];for(const _0x4a18b4 of _0x12823a){const _0x125dbf=_0x331a25['sqls'][_0x4a18b4['sqlCode']];if(!_0x125dbf){_0x2d6094['push']({'sqlCode':_0x4a18b4[_0x8154e3(0x1dd)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x58a9e2=await computeSqlFileHash(_0x4a18b4[_0x8154e3(0x1b9)]),_0x1dcf14=_0x125dbf[_0x8154e3(0x1a6)]!==_0x4a18b4[_0x8154e3(0x1ac)]||!!_0x4a18b4['sqlName']&&_0x125dbf[_0x8154e3(0x1d2)]!==_0x4a18b4['sqlName'];if(!_0x4a7f0a[_0x8154e3(0x1c0)](_0x8154e3(0x1d3))&&_0x125dbf['hash']===_0x58a9e2&&!_0x1dcf14){_0x5806fb['push']({'sqlCode':_0x4a18b4['sqlCode'],'reason':'unchanged'});continue;}if(_0x125dbf[_0x8154e3(0x1b1)]==null){_0x2d6094[_0x8154e3(0x1cc)]({'sqlCode':_0x4a18b4[_0x8154e3(0x1dd)],'error':_0x8154e3(0x1a4)});continue;}const _0x3b90a9=await readFile(_0x4a18b4[_0x8154e3(0x1b9)],_0x8154e3(0x1c2)),_0x463e6e=stripLocalSqlMetadata(_0x3b90a9,_0x4a18b4[_0x8154e3(0x1cd)]),_0x4dc4d5=_0x4a18b4[_0x8154e3(0x1d2)]||_0x125dbf[_0x8154e3(0x1d2)],_0x549104=await resolveTargetDbBinding(_0x4a7f0a['appCode'],_0x4a18b4,_0x125dbf),_0x10aa74=await updateSqlQuery({'id':_0x125dbf[_0x8154e3(0x1de)],'appCode':_0x4a7f0a[_0x8154e3(0x1bd)],'sqlCode':_0x4a18b4['sqlCode'],'sqlName':_0x4dc4d5,'dbId':_0x549104['dbId'],'version':_0x125dbf[_0x8154e3(0x1b1)],'sqlContent':_0x463e6e,'sqlConfig':_0x125dbf[_0x8154e3(0x1a9)]??undefined}),_0x14b7d9=_0x10aa74['dbId']?await getDbName(_0x4a7f0a[_0x8154e3(0x1bd)],Number(_0x10aa74[_0x8154e3(0x1d5)]))['catch'](()=>_0x549104[_0x8154e3(0x1b6)]):_0x549104[_0x8154e3(0x1b6)];_0x331a25[_0x8154e3(0x1a8)][_0x4a18b4[_0x8154e3(0x1dd)]]={...buildSqlLockEntry(_0x10aa74,_0x463e6e,_0x58a9e2,{'dbName':_0x14b7d9}),'path':_0x4a18b4['relativePath'],'mode':_0x125dbf[_0x8154e3(0x1cd)]},await archivePreviousSqlFileIfNeeded(_0x16364b,_0x125dbf[_0x8154e3(0x1a6)],_0x4a18b4[_0x8154e3(0x1ac)]),_0x30b9fe[_0x8154e3(0x1cc)]({'sqlCode':_0x4a18b4['sqlCode'],'remoteId':_0x125dbf[_0x8154e3(0x1de)]});}catch(_0x19349c){_0x2d6094[_0x8154e3(0x1cc)]({'sqlCode':_0x4a18b4['sqlCode'],'error':_0x19349c instanceof Error?_0x19349c[_0x8154e3(0x1b3)]:String(_0x19349c)});}}_0x331a25[_0x8154e3(0x1b7)]=new Date()['toISOString'](),await writeSqlLockFile(_0x16364b[_0x8154e3(0x1ab)],_0x37c18d);const _0x42d232=_0x2d6094[_0x8154e3(0x1c5)]===0x0;return{'ok':_0x42d232,'data':{'pushed':_0x30b9fe,'skipped':_0x5806fb,'failed':_0x2d6094},'message':'Push\x20complete:\x20'+_0x30b9fe[_0x8154e3(0x1c5)]+_0x8154e3(0x1cf)+_0x5806fb['length']+'\x20skipped,\x20'+_0x2d6094[_0x8154e3(0x1c5)]+_0x8154e3(0x1c4)};}};async function archivePreviousSqlFileIfNeeded(_0x3a0100,_0x39dab3,_0x278661){const _0xf3b1eb=a213_0xe3ff7b;if(!_0x39dab3||_0x39dab3===_0x278661)return;const _0x32e628=join(_0x3a0100[_0xf3b1eb(0x1d6)],_0x39dab3);if(!await fileExists(_0x32e628))return;const _0x518e56=await moveToTrash(_0x3a0100[_0xf3b1eb(0x1c6)],_0x3a0100[_0xf3b1eb(0x1e0)],_0x32e628);await cleanupEmptyDirectories(dirname(_0x32e628),_0x3a0100[_0xf3b1eb(0x1d6)]),void _0x518e56;}async function moveToTrash(_0x4e5dfa,_0x4cd183,_0x59e94b){const _0x30598c=a213_0xe3ff7b,_0x41727d=new Date()[_0x30598c(0x1d8)]()['replace'](/[:.]/g,'-'),_0x4d0d00=relative(_0x4e5dfa,_0x59e94b),_0x1c6b03=join(_0x4cd183,_0x41727d,_0x4d0d00);return await mkdir(dirname(_0x1c6b03),{'recursive':!![]}),await rename(_0x59e94b,_0x1c6b03),_0x1c6b03;}async function cleanupEmptyDirectories(_0x71e3c7,_0x285d98){const _0x2b1c80=a213_0xe3ff7b;let _0x39b529=resolve(_0x71e3c7);const _0x29c7a1=resolve(_0x285d98);while(_0x39b529[_0x2b1c80(0x1cb)](''+_0x29c7a1+sep)||_0x39b529===_0x29c7a1){if(_0x39b529===_0x29c7a1)return;try{const _0x31b1d9=await readdir(_0x39b529);if(_0x31b1d9[_0x2b1c80(0x1c5)]>0x0)return;await rmdir(_0x39b529);}catch{return;}_0x39b529=dirname(_0x39b529);}}async function resolveTargetDbBinding(_0x30504f,_0x4691b0,_0x3fb295){const _0x5fbee5=a213_0xe3ff7b,_0x3a8c87=_0x4691b0[_0x5fbee5(0x1b4)];if(!_0x3a8c87)return{'dbId':_0x3fb295[_0x5fbee5(0x1d5)],'dbName':_0x3fb295[_0x5fbee5(0x1b6)]};const _0x541002=buildDbDirectoryName(_0x3fb295[_0x5fbee5(0x1b6)],_0x3fb295[_0x5fbee5(0x1d5)]);if(_0x3a8c87===_0x541002)return{'dbId':_0x3fb295[_0x5fbee5(0x1d5)],'dbName':_0x3fb295[_0x5fbee5(0x1b6)]};const _0x4b3947=parseExplicitDbDirectory(_0x3a8c87);if(_0x4b3947!=null)return{'dbId':_0x4b3947,'dbName':await getDbName(_0x30504f,_0x4b3947)['catch'](()=>undefined)};const _0x5ec471=await listDatabases(_0x30504f),_0x1225dc=_0x5ec471[_0x5fbee5(0x1c8)](_0x74a0e2=>buildDbDirectoryName(_0x74a0e2['dbName'],_0x74a0e2[_0x5fbee5(0x1d5)])===_0x3a8c87);if(_0x1225dc[_0x5fbee5(0x1c5)]===0x1)return{'dbId':_0x1225dc[0x0][_0x5fbee5(0x1d5)],'dbName':_0x1225dc[0x0][_0x5fbee5(0x1b6)]};if(_0x1225dc['length']===0x0)throw CliErrors[_0x5fbee5(0x1c7)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x3a8c87+_0x5fbee5(0x1aa)+_0x4691b0[_0x5fbee5(0x1dd)]+'.');const _0x513232=_0x1225dc[_0x5fbee5(0x1db)](_0x56f0c4=>_0x56f0c4[_0x5fbee5(0x1b6)]+'\x20('+_0x56f0c4['dbId']+')')[_0x5fbee5(0x1d1)](',\x20');throw CliErrors[_0x5fbee5(0x1c7)](_0x5fbee5(0x1ae)+_0x3a8c87+_0x5fbee5(0x1c9)+_0x4691b0[_0x5fbee5(0x1dd)]+':\x20'+_0x513232);}function parseExplicitDbDirectory(_0x21c598){const _0x4f9788=a213_0xe3ff7b,_0x5a4580=/^db-(\d+)$/[_0x4f9788(0x1af)](_0x21c598);if(!_0x5a4580)return null;const _0x31c4fc=Number(_0x5a4580[0x1]);return Number[_0x4f9788(0x1ad)](_0x31c4fc)&&_0x31c4fc>0x0?_0x31c4fc:null;}
|
|
1
|
+
const a213_0x4c4300=a213_0x2ecd;(function(_0x3965b4,_0x206685){const _0xf413c7=a213_0x2ecd,_0x42e61a=_0x3965b4();while(!![]){try{const _0x2ccbcb=parseInt(_0xf413c7(0x129))/0x1*(-parseInt(_0xf413c7(0x139))/0x2)+parseInt(_0xf413c7(0x14d))/0x3*(-parseInt(_0xf413c7(0x125))/0x4)+parseInt(_0xf413c7(0x126))/0x5+-parseInt(_0xf413c7(0x136))/0x6*(-parseInt(_0xf413c7(0x12e))/0x7)+-parseInt(_0xf413c7(0x12b))/0x8+parseInt(_0xf413c7(0x147))/0x9*(parseInt(_0xf413c7(0x127))/0xa)+-parseInt(_0xf413c7(0x142))/0xb;if(_0x2ccbcb===_0x206685)break;else _0x42e61a['push'](_0x42e61a['shift']());}catch(_0x398a3a){_0x42e61a['push'](_0x42e61a['shift']());}}}(a213_0x834e,0x8169a));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x4f53d3,_0x805809,_0x176099){const _0x39818a=a213_0x2ecd,_0x550841=await scanLocalSqlQueries(_0x4f53d3),_0x3b2726=new Map();for(const _0x3159df of _0x550841){if(_0x176099&&_0x3159df[_0x39818a(0x12d)]!==_0x176099)continue;const _0x46a97d=_0x3b2726[_0x39818a(0x15a)](_0x3159df[_0x39818a(0x12d)])??[];_0x46a97d[_0x39818a(0x128)](_0x3159df),_0x3b2726[_0x39818a(0x144)](_0x3159df[_0x39818a(0x12d)],_0x46a97d);}if(_0x176099&&!_0x3b2726['has'](_0x176099))throw CliErrors[_0x39818a(0x132)](_0x39818a(0x159)+_0x176099);const _0x2b184a=[];for(const [_0x18918f,_0x514c8d]of _0x3b2726[_0x39818a(0x124)]()){if(_0x514c8d[_0x39818a(0x13d)]===0x1){_0x2b184a[_0x39818a(0x128)](_0x514c8d[0x0]);continue;}const _0x3d162c=_0x805809['sqls'][_0x18918f],_0x471dfc=_0x3d162c?.[_0x39818a(0x143)],_0x1f0eb7=_0x471dfc?_0x514c8d['filter'](_0x6bbc98=>_0x6bbc98[_0x39818a(0x138)]!==_0x471dfc):_0x514c8d;if(_0x3d162c&&_0x1f0eb7[_0x39818a(0x13d)]===0x1){_0x2b184a[_0x39818a(0x128)](_0x1f0eb7[0x0]);continue;}throw CliErrors[_0x39818a(0x132)](_0x39818a(0x154)+_0x18918f+_0x39818a(0x12f));}return _0x2b184a;}export const sqlPush={'service':a213_0x4c4300(0x14c),'command':'push','description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':'boolean','description':a213_0x4c4300(0x14f)}],async 'dryRun'(_0x2c6332){const _0x2f6896=a213_0x4c4300,_0x432a42=loadSqlProjectConfig(_0x2c6332['appCode']),_0x2d4e26=await readSqlLockFile(_0x432a42[_0x2f6896(0x157)]),{appLock:_0x4eaf49}=ensureSqlLockScope(_0x2d4e26??createEmptySqlLock(),_0x2c6332[_0x2f6896(0x152)],_0x432a42[_0x2f6896(0x130)],'push'),_0x27a205=await getTargetSqlQueries(_0x432a42,_0x4eaf49,_0x2c6332[_0x2f6896(0x13f)](_0x2f6896(0x11e))||undefined),_0x2f2c4f=[];for(const _0x35dc36 of _0x27a205){const _0x2b4691=await computeSqlFileHash(_0x35dc36['filePath']),_0x41f4a2=_0x4eaf49[_0x2f6896(0x11f)][_0x35dc36[_0x2f6896(0x12d)]],_0x10fd8c=!!_0x41f4a2&&(_0x41f4a2['path']!==_0x35dc36['relativePath']||!!_0x35dc36[_0x2f6896(0x121)]&&_0x41f4a2[_0x2f6896(0x121)]!==_0x35dc36[_0x2f6896(0x121)]);if(!_0x2c6332[_0x2f6896(0x11a)](_0x2f6896(0x131))&&_0x41f4a2&&_0x41f4a2[_0x2f6896(0x146)]===_0x2b4691&&!_0x10fd8c)continue;_0x2f2c4f[_0x2f6896(0x128)](_0x35dc36[_0x2f6896(0x12d)]);}return{'method':_0x2f6896(0x11d),'url':_0x2f6896(0x137),'body':{'sqlCodes':_0x2f2c4f,'appCode':_0x2c6332[_0x2f6896(0x152)]},'description':_0x2f6896(0x13a)+_0x2f2c4f[_0x2f6896(0x13d)]+_0x2f6896(0x155)};},async 'execute'(_0x451304){const _0x1331b7=a213_0x4c4300,_0x307017=loadSqlProjectConfig(_0x451304[_0x1331b7(0x152)]),_0x3d63b8=await readSqlLockFile(_0x307017['lockFilePath']),{lockData:_0x1543bd,appLock:_0x11bb2e}=ensureSqlLockScope(_0x3d63b8??createEmptySqlLock(),_0x451304['appCode'],_0x307017['sqlRoot'],_0x1331b7(0x128)),_0xc08584=await getTargetSqlQueries(_0x307017,_0x11bb2e,_0x451304['str'](_0x1331b7(0x11e))||undefined);if(_0xc08584[_0x1331b7(0x13d)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x1331b7(0x12c)};const _0x1181e6=[],_0xbd5189=[],_0xfacbdb=[];for(const _0x2067e2 of _0xc08584){const _0x494de0=_0x11bb2e['sqls'][_0x2067e2['sqlCode']];if(!_0x494de0){_0xfacbdb[_0x1331b7(0x128)]({'sqlCode':_0x2067e2['sqlCode'],'error':_0x1331b7(0x145)});continue;}try{const _0x5c0e78=await computeSqlFileHash(_0x2067e2[_0x1331b7(0x13e)]),_0x3e80f2=_0x494de0[_0x1331b7(0x143)]!==_0x2067e2[_0x1331b7(0x138)]||!!_0x2067e2[_0x1331b7(0x121)]&&_0x494de0[_0x1331b7(0x121)]!==_0x2067e2[_0x1331b7(0x121)];if(!_0x451304[_0x1331b7(0x11a)]('force')&&_0x494de0[_0x1331b7(0x146)]===_0x5c0e78&&!_0x3e80f2){_0xbd5189[_0x1331b7(0x128)]({'sqlCode':_0x2067e2[_0x1331b7(0x12d)],'reason':_0x1331b7(0x140)});continue;}if(_0x494de0[_0x1331b7(0x156)]==null){_0xfacbdb['push']({'sqlCode':_0x2067e2['sqlCode'],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x40292b=await readFile(_0x2067e2[_0x1331b7(0x13e)],_0x1331b7(0x134)),_0x1aaf70=stripLocalSqlMetadata(_0x40292b,_0x2067e2[_0x1331b7(0x141)]),_0x51da31=_0x2067e2[_0x1331b7(0x121)]||_0x494de0[_0x1331b7(0x121)],_0x309e35=await resolveTargetDbBinding(_0x451304['appCode'],_0x2067e2,_0x494de0),_0x26b475=await updateSqlQuery({'id':_0x494de0['remoteId'],'appCode':_0x451304['appCode'],'sqlCode':_0x2067e2['sqlCode'],'sqlName':_0x51da31,'dbId':_0x309e35['dbId'],'version':_0x494de0[_0x1331b7(0x156)],'sqlContent':_0x1aaf70,'sqlConfig':_0x494de0[_0x1331b7(0x123)]??undefined}),_0x4e74c2=_0x26b475[_0x1331b7(0x150)]?await getDbName(_0x451304[_0x1331b7(0x152)],Number(_0x26b475[_0x1331b7(0x150)]))['catch'](()=>_0x309e35[_0x1331b7(0x11b)]):_0x309e35[_0x1331b7(0x11b)];_0x11bb2e[_0x1331b7(0x11f)][_0x2067e2[_0x1331b7(0x12d)]]={...buildSqlLockEntry(_0x26b475,_0x1aaf70,_0x5c0e78,{'dbName':_0x4e74c2}),'path':_0x2067e2['relativePath'],'mode':_0x494de0[_0x1331b7(0x141)]},await archivePreviousSqlFileIfNeeded(_0x307017,_0x494de0[_0x1331b7(0x143)],_0x2067e2[_0x1331b7(0x138)]),_0x1181e6[_0x1331b7(0x128)]({'sqlCode':_0x2067e2['sqlCode'],'remoteId':_0x494de0[_0x1331b7(0x14e)]});}catch(_0x4ef679){_0xfacbdb[_0x1331b7(0x128)]({'sqlCode':_0x2067e2['sqlCode'],'error':_0x4ef679 instanceof Error?_0x4ef679[_0x1331b7(0x12a)]:String(_0x4ef679)});}}_0x11bb2e['lastSync']=new Date()[_0x1331b7(0x11c)](),await writeSqlLockFile(_0x307017[_0x1331b7(0x157)],_0x1543bd);const _0x2d9ca9=_0xfacbdb['length']===0x0;return{'ok':_0x2d9ca9,'data':{'pushed':_0x1181e6,'skipped':_0xbd5189,'failed':_0xfacbdb},'message':_0x1331b7(0x148)+_0x1181e6['length']+'\x20pushed,\x20'+_0xbd5189[_0x1331b7(0x13d)]+_0x1331b7(0x13b)+_0xfacbdb['length']+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x5e1a22,_0x93e62b,_0x264a81){const _0x38b2a1=a213_0x4c4300;if(!_0x93e62b||_0x93e62b===_0x264a81)return;const _0x50fd21=join(_0x5e1a22['sqlRootDir'],_0x93e62b);if(!await fileExists(_0x50fd21))return;const _0x2a4b73=await moveToTrash(_0x5e1a22[_0x38b2a1(0x120)],_0x5e1a22[_0x38b2a1(0x122)],_0x50fd21);await cleanupEmptyDirectories(dirname(_0x50fd21),_0x5e1a22['sqlRootDir']),void _0x2a4b73;}async function moveToTrash(_0x5000d4,_0x46a451,_0x33b824){const _0x48257b=a213_0x4c4300,_0x3e9235=new Date()['toISOString']()[_0x48257b(0x135)](/[:.]/g,'-'),_0x15636c=relative(_0x5000d4,_0x33b824),_0x5439c0=join(_0x46a451,_0x3e9235,_0x15636c);return await mkdir(dirname(_0x5439c0),{'recursive':!![]}),await rename(_0x33b824,_0x5439c0),_0x5439c0;}async function cleanupEmptyDirectories(_0x372803,_0x2a1091){const _0x2f4eba=a213_0x4c4300;let _0x1a3735=resolve(_0x372803);const _0x5d48a6=resolve(_0x2a1091);while(_0x1a3735[_0x2f4eba(0x151)](''+_0x5d48a6+sep)||_0x1a3735===_0x5d48a6){if(_0x1a3735===_0x5d48a6)return;try{const _0x3a594e=await readdir(_0x1a3735);if(_0x3a594e['length']>0x0)return;await rmdir(_0x1a3735);}catch{return;}_0x1a3735=dirname(_0x1a3735);}}async function resolveTargetDbBinding(_0x14a391,_0x191fdd,_0x37bafc){const _0x2d8f63=a213_0x4c4300,_0x38ff7c=_0x191fdd[_0x2d8f63(0x158)];if(!_0x38ff7c)return{'dbId':_0x37bafc[_0x2d8f63(0x150)],'dbName':_0x37bafc[_0x2d8f63(0x11b)]};const _0x4e5d27=buildDbDirectoryName(_0x37bafc['dbName'],_0x37bafc[_0x2d8f63(0x150)]);if(_0x38ff7c===_0x4e5d27)return{'dbId':_0x37bafc[_0x2d8f63(0x150)],'dbName':_0x37bafc[_0x2d8f63(0x11b)]};const _0x2086d7=parseExplicitDbDirectory(_0x38ff7c);if(_0x2086d7!=null)return{'dbId':_0x2086d7,'dbName':await getDbName(_0x14a391,_0x2086d7)[_0x2d8f63(0x149)](()=>undefined)};const _0xfbc808=await listDatabases(_0x14a391),_0x13e5b6=_0xfbc808[_0x2d8f63(0x13c)](_0x4ee088=>buildDbDirectoryName(_0x4ee088[_0x2d8f63(0x11b)],_0x4ee088[_0x2d8f63(0x150)])===_0x38ff7c);if(_0x13e5b6['length']===0x1)return{'dbId':_0x13e5b6[0x0][_0x2d8f63(0x150)],'dbName':_0x13e5b6[0x0][_0x2d8f63(0x11b)]};if(_0x13e5b6[_0x2d8f63(0x13d)]===0x0)throw CliErrors['validation'](_0x2d8f63(0x14b)+_0x38ff7c+_0x2d8f63(0x14a)+_0x191fdd[_0x2d8f63(0x12d)]+'.');const _0x45cb57=_0x13e5b6[_0x2d8f63(0x133)](_0x20fe43=>_0x20fe43[_0x2d8f63(0x11b)]+'\x20('+_0x20fe43[_0x2d8f63(0x150)]+')')['join'](',\x20');throw CliErrors[_0x2d8f63(0x132)]('Local\x20directory\x20\x22'+_0x38ff7c+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x191fdd[_0x2d8f63(0x12d)]+':\x20'+_0x45cb57);}function a213_0x2ecd(_0x1ace19,_0x5c1e2c){_0x1ace19=_0x1ace19-0x11a;const _0x834e93=a213_0x834e();let _0x2ecd57=_0x834e93[_0x1ace19];return _0x2ecd57;}function a213_0x834e(){const _0x3a32a1=['.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','sqlRoot','force','validation','map','utf8','replace','17490qkMNqt','/smartapi/custom/updateUserCustomSql','relativePath','42788cyKLVX','Would\x20push\x20','\x20skipped,\x20','filter','length','filePath','str','unchanged','mode','4282421BlacGD','path','set','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','hash','41679mgEkYy','Push\x20complete:\x20','catch','\x22\x20for\x20sqlCode\x20','No\x20database\x20matches\x20local\x20directory\x20\x22','sql','49746zoBkFu','remoteId','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','dbId','startsWith','appCode','isFinite','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','\x20SQL\x20file(s)','version','lockFilePath','dbDirectory','Local\x20SQL\x20not\x20found:\x20','get','bool','dbName','toISOString','POST','sqlcode','sqls','projectRoot','sqlName','trashDir','sqlConfig','entries','40IZfGOJ','3486860JdLOmA','1670feHJAC','push','16trgGzz','message','6898840xTuHXG','No\x20local\x20SQL\x20files\x20found.','sqlCode','1967hYGWGR'];a213_0x834e=function(){return _0x3a32a1;};return a213_0x834e();}function parseExplicitDbDirectory(_0x4f1100){const _0x18003a=a213_0x4c4300,_0x13902f=/^db-(\d+)$/['exec'](_0x4f1100);if(!_0x13902f)return null;const _0x3a98fe=Number(_0x13902f[0x1]);return Number[_0x18003a(0x153)](_0x3a98fe)&&_0x3a98fe>0x0?_0x3a98fe:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a214_0x205afa=a214_0x2dd6;(function(_0x464958,_0x26bb7c){const _0x48d4e7=a214_0x2dd6,_0x1bea76=_0x464958();while(!![]){try{const _0x11a4ad=-parseInt(_0x48d4e7(0x14c))/0x1*(parseInt(_0x48d4e7(0x13f))/0x2)+parseInt(_0x48d4e7(0x153))/0x3*(-parseInt(_0x48d4e7(0x147))/0x4)+parseInt(_0x48d4e7(0x155))/0x5*(-parseInt(_0x48d4e7(0x130))/0x6)+-parseInt(_0x48d4e7(0x139))/0x7+-parseInt(_0x48d4e7(0x157))/0x8+-parseInt(_0x48d4e7(0x15c))/0x9*(parseInt(_0x48d4e7(0x13a))/0xa)+-parseInt(_0x48d4e7(0x141))/0xb*(-parseInt(_0x48d4e7(0x144))/0xc);if(_0x11a4ad===_0x26bb7c)break;else _0x1bea76['push'](_0x1bea76['shift']());}catch(_0x23baa5){_0x1bea76['push'](_0x1bea76['shift']());}}}(a214_0x1f99,0xca9f1));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';function a214_0x1f99(){const _0x55be3b=['includes','3896716pjpovI','endsWith','sqlName','path','toLowerCase','401eKGOfK','mybatisXml','test','length','apps','fromEntries','<!--\x20@lovrabet.','3vrqHYS','map','24540dbvUXp','trim','6258752gLsyPX','version','replace','sqlCode','entries','9FUwuPS','push','636jzvDOo','join','syncedAt','\x20-->','dbId','filter','lastSync','\x20[y/N]\x20','close','7778274UGFZIU','9999970ZdLSCk','mode','.rabetbase/sql','dbName','yes','4310cpKVGi','sqlContent','11CgxGwh','trimStart','question','72984504vlIoqP','stdin'];a214_0x1f99=function(){return _0x55be3b;};return a214_0x1f99();}export const SQL_LOCAL_REL_DIR=a214_0x205afa(0x13c);export function buildSqlLockEntry(_0x48b252,_0xd4300b,_0x22cb42,_0x1a5059){const _0x1fa41e=a214_0x205afa,_0x19ac67=detectSqlMode(_0xd4300b);return{'path':buildSqlRelativePath(_0x48b252[_0x1fa41e(0x15a)],_0x48b252[_0x1fa41e(0x149)],_0x1a5059?.['dbName'],_0x19ac67,_0x48b252['dbId']),'hash':_0x22cb42,'remoteId':_0x48b252['id'],'version':_0x48b252[_0x1fa41e(0x158)],'dbId':Number(_0x48b252[_0x1fa41e(0x134)]),'dbName':_0x1a5059?.[_0x1fa41e(0x13d)],'sqlName':_0x48b252[_0x1fa41e(0x149)],'sqlConfig':_0x48b252['sqlConfig']??undefined,'mode':_0x19ac67};}export function cloneSqlLockData(_0x8c4530){const _0xd1722=a214_0x205afa;return{'apps':Object[_0xd1722(0x151)](Object[_0xd1722(0x15b)](_0x8c4530[_0xd1722(0x150)])[_0xd1722(0x154)](([_0x380b55,_0x387215])=>[_0x380b55,{'sqlRoot':_0x387215['sqlRoot'],'lastSync':_0x387215[_0xd1722(0x136)],'sqls':{..._0x387215['sqls']}}]))};}export function ensureRemoteSqlContent(_0x2a398d){const _0x509506=a214_0x205afa;return _0x2a398d[_0x509506(0x140)]??'';}export function buildLocalSqlFileContent(_0x4e7573,_0x13cce9,_0x339f5f){const _0x1d7733=a214_0x205afa,_0x14631f=_0x339f5f?.[_0x1d7733(0x13b)]??detectSqlMode(_0x13cce9),_0x69a107=stripLocalSqlMetadata(_0x13cce9,_0x14631f)[_0x1d7733(0x156)](),_0x2e4c5d=[...buildMetadataHeaderLines({'sqlCode':_0x4e7573[_0x1d7733(0x15a)],'sqlName':_0x4e7573['sqlName'],'dbId':_0x4e7573[_0x1d7733(0x134)],'dbName':_0x339f5f?.[_0x1d7733(0x13d)],'mode':_0x14631f,'syncedAt':_0x339f5f?.[_0x1d7733(0x132)],'description':_0x339f5f?.['description']},_0x14631f),'',_0x69a107],_0x328a16=_0x2e4c5d[_0x1d7733(0x131)]('\x0a');return _0x328a16[_0x1d7733(0x148)]('\x0a')?_0x328a16:_0x328a16+'\x0a';}export function stripLocalSqlMetadata(_0xec7796,_0x92fae8){const _0x4c5561=a214_0x205afa,_0x2c0685=_0xec7796[_0x4c5561(0x159)](/\r\n/g,'\x0a')['split']('\x0a'),_0x4a82b9=[];let _0x323268=0x0;if(_0x92fae8===_0x4c5561(0x14d))while(_0x323268<_0x2c0685[_0x4c5561(0x14f)]){const _0x45bcb5=_0x2c0685[_0x323268]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x45bcb5)){_0x323268++;continue;}if(_0x45bcb5[_0x4c5561(0x156)]()===''&&_0x323268>0x0){_0x323268++;continue;}break;}else while(_0x323268<_0x2c0685[_0x4c5561(0x14f)]){const _0xf0193c=_0x2c0685[_0x323268]??'';if(/^\s*--\s*@lovrabet\./[_0x4c5561(0x14e)](_0xf0193c)){_0x323268++;continue;}if(_0xf0193c[_0x4c5561(0x156)]()===''&&_0x323268>0x0){_0x323268++;continue;}break;}for(;_0x323268<_0x2c0685[_0x4c5561(0x14f)];_0x323268++){_0x4a82b9[_0x4c5561(0x15d)](_0x2c0685[_0x323268]);}return _0x4a82b9[_0x4c5561(0x131)]('\x0a')[_0x4c5561(0x142)]();}export function resolveSqlMode(_0x5bc41e,_0x52317e){const _0x487968=a214_0x205afa;if(_0x52317e?.[_0x487968(0x13b)])return _0x52317e['mode'];return detectSqlMode(_0x5bc41e);}export function resolveSqlFileName(_0x57d130,_0x2dbbdf,_0x1404b2){const _0x448087=a214_0x205afa;if(_0x1404b2?.[_0x448087(0x14a)])return _0x1404b2[_0x448087(0x14a)];if(_0x1404b2?.[_0x448087(0x149)]||_0x1404b2?.[_0x448087(0x13d)])return buildSqlRelativePath(_0x57d130,_0x1404b2?.[_0x448087(0x149)],_0x1404b2?.[_0x448087(0x13d)],resolveSqlMode(_0x2dbbdf,_0x1404b2),_0x1404b2?.[_0x448087(0x134)]);return buildDefaultSqlFileName(_0x57d130,resolveSqlMode(_0x2dbbdf,_0x1404b2));}export function resolveSqlLocalDir(_0x5edac4,_0x2265c2){return join(_0x5edac4,SQL_LOCAL_REL_DIR,_0x2265c2);}function a214_0x2dd6(_0x59134d,_0x4f7236){_0x59134d=_0x59134d-0x130;const _0x1f9970=a214_0x1f99();let _0x2dd687=_0x1f9970[_0x59134d];return _0x2dd687;}export async function confirmForceOverwrite(_0x4e8c54){const _0xf24d88=a214_0x205afa,_0x5726c2=createInterface({'input':process[_0xf24d88(0x145)],'output':process['stderr']}),_0x27584b=await new Promise(_0x48984c=>{const _0x400abe=_0xf24d88;_0x5726c2[_0x400abe(0x143)](_0x4e8c54+_0x400abe(0x137),_0x48984c);});return _0x5726c2[_0xf24d88(0x138)](),['y',_0xf24d88(0x13e)][_0xf24d88(0x146)](_0x27584b[_0xf24d88(0x156)]()[_0xf24d88(0x14b)]());}export function findSqlLockScope(_0x166c9a,_0x173428){return _0x166c9a['apps'][_0x173428];}function buildMetadataHeaderLines(_0x4fd06c,_0x4e057e){const _0x39b702=a214_0x205afa,_0x2e2cd0=[[_0x39b702(0x15a),_0x4fd06c[_0x39b702(0x15a)]],[_0x39b702(0x149),_0x4fd06c[_0x39b702(0x149)]],[_0x39b702(0x134),_0x4fd06c[_0x39b702(0x134)]],[_0x39b702(0x13d),_0x4fd06c[_0x39b702(0x13d)]],[_0x39b702(0x13b),_0x4fd06c[_0x39b702(0x13b)]],[_0x39b702(0x132),_0x4fd06c[_0x39b702(0x132)]],['description',_0x4fd06c['description']]];if(_0x4e057e===_0x39b702(0x14d))return _0x2e2cd0[_0x39b702(0x135)](([,_0x991873])=>_0x991873!==undefined&&_0x991873!==null&&String(_0x991873)[_0x39b702(0x156)]()!=='')['map'](([_0x45c4ae,_0x1a222e])=>_0x39b702(0x152)+_0x45c4ae+':\x20'+String(_0x1a222e)+_0x39b702(0x133));return _0x2e2cd0[_0x39b702(0x135)](([,_0x3d92e4])=>_0x3d92e4!==undefined&&_0x3d92e4!==null&&String(_0x3d92e4)['trim']()!=='')['map'](([_0x55bef7,_0x3a35dd])=>'--\x20@lovrabet.'+_0x55bef7+':\x20'+String(_0x3a35dd));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a215_0x24a09e=a215_0xf5fa;(function(_0x3673f7,_0x2e6fb7){const _0x59a6e2=a215_0xf5fa,_0x1ec59b=_0x3673f7();while(!![]){try{const _0x29caa5=-parseInt(_0x59a6e2(0x1bc))/0x1+parseInt(_0x59a6e2(0x1cf))/0x2*(-parseInt(_0x59a6e2(0x1cc))/0x3)+parseInt(_0x59a6e2(0x1b1))/0x4*(-parseInt(_0x59a6e2(0x1c0))/0x5)+parseInt(_0x59a6e2(0x1d3))/0x6+-parseInt(_0x59a6e2(0x1cd))/0x7+-parseInt(_0x59a6e2(0x1d0))/0x8*(-parseInt(_0x59a6e2(0x1c4))/0x9)+-parseInt(_0x59a6e2(0x1bf))/0xa*(-parseInt(_0x59a6e2(0x1c9))/0xb);if(_0x29caa5===_0x2e6fb7)break;else _0x1ec59b['push'](_0x1ec59b['shift']());}catch(_0x5e61fc){_0x1ec59b['push'](_0x1ec59b['shift']());}}}(a215_0x46c3,0x9b9ed));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a215_0xf5fa(_0x13c9d3,_0x2fbf6d){_0x13c9d3=_0x13c9d3-0x1b1;const _0x46c300=a215_0x46c3();let _0xf5fa87=_0x46c300[_0x13c9d3];return _0xf5fa87;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x2d57b8){const _0x208dd6=a215_0xf5fa,_0x30f945=[];let _0x1d5053=0x1;while(!![]){const _0x5e8cf1=await listSqlQueries(_0x2d57b8,{'currentPage':_0x1d5053,'pageSize':PAGE_SIZE}),_0x3e647b=_0x5e8cf1['tableData']??[];_0x30f945['push'](..._0x3e647b['map'](_0x249b3c=>_0x249b3c['sqlCode']));if(_0x3e647b[_0x208dd6(0x1cb)]===0x0)break;const _0x793aca=_0x5e8cf1['paging']?.[_0x208dd6(0x1b6)];if(_0x793aca!=null?_0x30f945['length']>=_0x793aca:_0x3e647b['length']<PAGE_SIZE)break;_0x1d5053++;}return _0x30f945;}export const sqlStatus={'service':a215_0x24a09e(0x1c6),'command':'status','description':a215_0x24a09e(0x1b5),'risk':a215_0x24a09e(0x1ca),'flags':[{'name':a215_0x24a09e(0x1ba),'type':a215_0x24a09e(0x1bd),'description':a215_0x24a09e(0x1b3)}],async 'execute'(_0x1fcac1){const _0x240075=a215_0x24a09e,_0x589e79=loadSqlProjectConfig(_0x1fcac1[_0x240075(0x1c1)]),_0x6764e7=await readSqlLockFile(_0x589e79[_0x240075(0x1b9)]),{appLock:_0x21d50d}=ensureSqlLockScope(_0x6764e7??createEmptySqlLock(),_0x589e79[_0x240075(0x1c1)],_0x589e79[_0x240075(0x1c3)],'status'),_0x481125=await scanLocalSqlQueries(_0x589e79),_0x172353=[],_0x188aab=[],_0xc22eba=[],_0xa07824=[],_0x3b2a18=new Set(_0x481125[_0x240075(0x1b2)](_0x257698=>_0x257698['lockKey']));for(const _0x52d6f8 of _0x481125){const _0x407ee3=await computeSqlFileHash(_0x52d6f8[_0x240075(0x1c7)]),_0x515813=_0x21d50d[_0x240075(0x1d4)][_0x52d6f8[_0x240075(0x1b4)]],_0x4a78dd=!!_0x515813&&_0x515813[_0x240075(0x1d1)]!==_0x52d6f8['relativePath'],_0x3fea08=!!_0x515813&&!!_0x52d6f8[_0x240075(0x1c5)]&&_0x515813[_0x240075(0x1c5)]!==_0x52d6f8['sqlName'];if(!_0x515813)_0x172353['push'](_0x52d6f8[_0x240075(0x1b4)]);else _0x515813[_0x240075(0x1c8)]!==_0x407ee3||_0x4a78dd||_0x3fea08?_0x188aab['push'](_0x52d6f8[_0x240075(0x1b4)]):_0xc22eba['push'](_0x52d6f8[_0x240075(0x1b4)]);}for(const _0x6280c7 of Object['keys'](_0x21d50d[_0x240075(0x1d4)])){!_0x3b2a18[_0x240075(0x1ce)](_0x6280c7)&&_0xa07824[_0x240075(0x1bb)](_0x6280c7);}const _0x210641=[];if(_0x1fcac1[_0x240075(0x1d2)](_0x240075(0x1ba))){const _0x569549=await fetchAllSqlCodes(_0x1fcac1[_0x240075(0x1c1)]);for(const _0x33d55f of _0x569549){!_0x3b2a18[_0x240075(0x1ce)](_0x33d55f)&&!_0x21d50d[_0x240075(0x1d4)][_0x33d55f]&&_0x210641['push'](_0x33d55f);}}const _0x2913cf=_0x172353['length']===0x0&&_0x188aab['length']===0x0&&_0xa07824[_0x240075(0x1cb)]===0x0&&_0x210641['length']===0x0;return{'ok':!![],'data':{'added':_0x172353,'modified':_0x188aab,'missing':_0xa07824,'unchanged':_0xc22eba,'remoteOnly':_0x210641},'message':_0x2913cf?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x172353[_0x240075(0x1cb)]+_0x240075(0x1be)+_0x188aab[_0x240075(0x1cb)]+_0x240075(0x1b7)+_0xa07824[_0x240075(0x1cb)]+_0x240075(0x1b8)+_0xc22eba['length']+_0x240075(0x1c2)+(_0x210641[_0x240075(0x1cb)]>0x0?',\x20'+_0x210641[_0x240075(0x1cb)]+'\x20remote-only':'')};}};function a215_0x46c3(){const _0x2587e7=['935222iNpahw','boolean','\x20added,\x20','20336030oiNlTk','20645KnVgyV','appCode','\x20unchanged','sqlRoot','6093PFwLHm','sqlName','sql','filePath','hash','11DyoNHX','read','length','3527268pGyFmt','1023960hJajTA','has','2qaTcyr','8848WxqWzV','path','bool','2086002tSUpRJ','sqls','228vysUqe','map','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','lockKey','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','totalCount','\x20modified,\x20','\x20missing,\x20','lockFilePath','remote','push'];a215_0x46c3=function(){return _0x2587e7;};return a215_0x46c3();}
|