@lovrabet/rabetbase-cli 2.3.13-beta.1 → 2.3.13-beta.2
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/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/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.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/get.js +1 -1
- package/lib/commands/config/index.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/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.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/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/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/update.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.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/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.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/non-interactive.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/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.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/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/save.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/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.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/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.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/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/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.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/copy-directory.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/rules-cdn.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
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a164_0x20cf8d=a164_0x200c;(function(_0x58b51c,_0x45100c){const _0x2e61d1=a164_0x200c,_0x34f1f1=_0x58b51c();while(!![]){try{const _0x360029=-parseInt(_0x2e61d1(0xd7))/0x1+parseInt(_0x2e61d1(0xd6))/0x2*(parseInt(_0x2e61d1(0xf3))/0x3)+parseInt(_0x2e61d1(0xf1))/0x4*(parseInt(_0x2e61d1(0xc7))/0x5)+-parseInt(_0x2e61d1(0xeb))/0x6+-parseInt(_0x2e61d1(0xea))/0x7+-parseInt(_0x2e61d1(0xc1))/0x8+-parseInt(_0x2e61d1(0xd8))/0x9*(-parseInt(_0x2e61d1(0xf5))/0xa);if(_0x360029===_0x45100c)break;else _0x34f1f1['push'](_0x34f1f1['shift']());}catch(_0x4b07df){_0x34f1f1['push'](_0x34f1f1['shift']());}}}(a164_0x19c3,0x84e67));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{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';function a164_0x19c3(){const _0x4b6f28=['cwd','script','\x20exited\x20with\x20code\x20','2124896HPEvDE','pnpm','No\x20package.json\x20found\x20in\x20current\x20directory.','preview','slice','bun.lockb','25mdfbJt','scripts','start','node_modules','.bin','bun','join','\x0a\x20\x20Available\x20scripts:\x0a','read','Script\x20name\x20defined\x20in\x20package.json','error','package.json','args','parse','close','2UNnOuw','660078HBGNuQ','597267HtoDnz','\x20run\x20preview\x20--watch','dev','npm','build','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','inherit','has','run','boolean','(none)','push','needsUpgrade','bool','Available:\x20','vite\x20preview\x20exited\x20with\x20code\x20','pnpm-lock.yaml','\x20run\x20','4282789sWvIyH','6398826JsRClm','keys','\x20\x20\x20\x20','vite','\x20run\x20preview','Run\x20a\x20package.json\x20script','290708WfqCSf','\x20\x20EXAMPLES','2780394xCBfrc','belowMinimum','280VkNRGX','validation','log'];a164_0x19c3=function(){return _0x4b6f28;};return a164_0x19c3();}function a164_0x200c(_0x403962,_0x333fbd){_0x403962=_0x403962-0xbe;const _0x19c39e=a164_0x19c3();let _0x200c1d=_0x19c39e[_0x403962];return _0x200c1d;}const VERSION_CHECK_SCRIPTS=new Set([a164_0x20cf8d(0xc9),a164_0x20cf8d(0xda)]);function readPackageScripts(_0x10d461){const _0x2cb3f1=a164_0x20cf8d,_0x374386=resolve(_0x10d461,_0x2cb3f1(0xd2));if(!existsSync(_0x374386))return null;try{const _0x603091=JSON[_0x2cb3f1(0xd4)](readFileSync(_0x374386,'utf-8'));return _0x603091[_0x2cb3f1(0xc8)]??{};}catch{return null;}}function detectPackageManager(_0x10355b){const _0x5ae08c=a164_0x20cf8d;if(existsSync(resolve(_0x10355b,_0x5ae08c(0xc6)))||existsSync(resolve(_0x10355b,'bun.lock')))return _0x5ae08c(0xcc);if(existsSync(resolve(_0x10355b,_0x5ae08c(0xe8))))return _0x5ae08c(0xc2);if(existsSync(resolve(_0x10355b,'yarn.lock')))return'yarn';return _0x5ae08c(0xdb);}async function versionCheck(_0x19492e){const _0x298090=a164_0x20cf8d,_0x2d36b7=await checkCliVersion();(_0x2d36b7['needsUpgrade']||_0x2d36b7[_0x298090(0xf4)])&&(printCliUpgradeWarning(_0x2d36b7),assertCliVersionSupported(_0x2d36b7));const _0x238ddf=await checkSdkVersion(_0x19492e);if(_0x238ddf[_0x298090(0xe4)])printSdkUpgradeWarning(_0x238ddf);}function spawnScript(_0x25ee79,_0x56302c,_0x4b58dd,_0x26a512){return new Promise((_0x2967c0,_0x7fa99a)=>{const _0x27ad02=a164_0x200c,_0x458e1d=['run',_0x56302c,..._0x4b58dd],_0x4547bb=spawn(_0x25ee79,_0x458e1d,{'cwd':_0x26a512,'stdio':_0x27ad02(0xde),'shell':!![],'env':{...process.env,'PATH':''+join(_0x26a512,'node_modules',_0x27ad02(0xcb))+delimiter+process.env.PATH}});_0x4547bb['on'](_0x27ad02(0xd5),_0x35f42b=>{const _0xe127be=_0x27ad02;if(_0x35f42b===0x0||_0x35f42b===null)_0x2967c0();else _0x7fa99a(new Error(_0x25ee79+_0xe127be(0xe9)+_0x56302c+_0xe127be(0xc0)+_0x35f42b));}),_0x4547bb['on'](_0x27ad02(0xd1),_0x7fa99a);});}function spawnViteBuildWatch(_0x46f9a2){return new Promise((_0x4ecb6b,_0x1c63fc)=>{const _0x413753=a164_0x200c,_0x5df8e0=spawn(_0x413753(0xee),[_0x413753(0xdc),'--watch'],{'cwd':_0x46f9a2,'stdio':_0x413753(0xde),'shell':!![],'env':{...process.env,'PATH':''+join(_0x46f9a2,'node_modules',_0x413753(0xcb))+delimiter+process.env.PATH}});_0x5df8e0['on'](_0x413753(0xd5),_0xf33228=>{const _0x20214c=_0x413753;if(_0xf33228===0x0||_0xf33228===null)_0x4ecb6b();else _0x1c63fc(new Error(_0x20214c(0xdd)+_0xf33228));}),_0x5df8e0['on'](_0x413753(0xd1),_0x1c63fc);});}function spawnVitePreview(_0x28a44e){return new Promise((_0x19c9e1,_0x4e86c7)=>{const _0xf09635=a164_0x200c,_0xb0b77b=spawn(_0xf09635(0xee),['preview'],{'cwd':_0x28a44e,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x28a44e,_0xf09635(0xca),_0xf09635(0xcb))+delimiter+process.env.PATH}});_0xb0b77b['on'](_0xf09635(0xd5),_0x1df94c=>{const _0x31f124=_0xf09635;if(_0x1df94c===0x0||_0x1df94c===null)_0x19c9e1();else _0x4e86c7(new Error(_0x31f124(0xe7)+_0x1df94c));}),_0xb0b77b['on'](_0xf09635(0xd1),_0x4e86c7);});}const runFlags=[{'name':'watch','type':a164_0x20cf8d(0xe1),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a164_0x20cf8d(0xe0),'command':a164_0x20cf8d(0xe0),'description':a164_0x20cf8d(0xf0),'risk':a164_0x20cf8d(0xcf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a164_0x20cf8d(0xbf),'description':a164_0x20cf8d(0xd0),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x53dae8=a164_0x20cf8d,_0x4511c2=[];return _0x4511c2[_0x53dae8(0xe3)](_0x53dae8(0xf2)),_0x4511c2[_0x53dae8(0xe3)](_0x53dae8(0xed)+CLI_BIN_NAME+'\x20run\x20start'),_0x4511c2['push'](_0x53dae8(0xed)+CLI_BIN_NAME+'\x20run\x20build'),_0x4511c2[_0x53dae8(0xe3)](_0x53dae8(0xed)+CLI_BIN_NAME+_0x53dae8(0xef)),_0x4511c2[_0x53dae8(0xe3)](_0x53dae8(0xed)+CLI_BIN_NAME+_0x53dae8(0xd9)),_0x4511c2[_0x53dae8(0xcd)]('\x0a');},async 'execute'(_0x40ac14){const _0xb6024a=a164_0x20cf8d,_0xe419ff=process[_0xb6024a(0xbe)](),_0x440123=_0x40ac14['args'][0x0],_0x5d9ede=_0x40ac14[_0xb6024a(0xd3)][_0xb6024a(0xc5)](0x1),_0x51e7bb=readPackageScripts(_0xe419ff);if(!_0x51e7bb)throw CliErrors['validation'](_0xb6024a(0xc3));if(!_0x440123){const _0x10fe88=Object[_0xb6024a(0xec)](_0x51e7bb);if(_0x10fe88['length']===0x0)console[_0xb6024a(0xf7)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console[_0xb6024a(0xf7)](_0xb6024a(0xce));for(const _0x5545d2 of _0x10fe88){console[_0xb6024a(0xf7)](_0xb6024a(0xed)+_0x5545d2);}console[_0xb6024a(0xf7)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x51e7bb[_0x440123])throw CliErrors[_0xb6024a(0xf6)]('Script\x20\x22'+_0x440123+'\x22\x20not\x20found\x20in\x20package.json.',_0xb6024a(0xe6)+(Object['keys'](_0x51e7bb)[_0xb6024a(0xcd)](',\x20')||_0xb6024a(0xe2)));const _0x509b11=detectPackageManager(_0xe419ff);VERSION_CHECK_SCRIPTS[_0xb6024a(0xdf)](_0x440123)&&await versionCheck(_0xe419ff);if(_0x440123===_0xb6024a(0xc4)&&_0x40ac14[_0xb6024a(0xe5)]('watch'))return await Promise['all']([spawnViteBuildWatch(_0xe419ff),spawnVitePreview(_0xe419ff)]),{'ok':!![]};return await spawnScript(_0x509b11,_0x440123,_0x5d9ede,_0xe419ff),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a165_0x42fc38=a165_0x407c;(function(_0x16d801,_0x3a773e){const _0x1233b2=a165_0x407c,_0x48ec8e=_0x16d801();while(!![]){try{const _0x32d036=parseInt(_0x1233b2(0xa4))/0x1+parseInt(_0x1233b2(0xa2))/0x2+parseInt(_0x1233b2(0xa9))/0x3+parseInt(_0x1233b2(0x9c))/0x4*(-parseInt(_0x1233b2(0xa7))/0x5)+-parseInt(_0x1233b2(0xa3))/0x6*(parseInt(_0x1233b2(0xa6))/0x7)+parseInt(_0x1233b2(0xa1))/0x8*(-parseInt(_0x1233b2(0xa5))/0x9)+parseInt(_0x1233b2(0x9f))/0xa*(parseInt(_0x1233b2(0x9e))/0xb);if(_0x32d036===_0x3a773e)break;else _0x48ec8e['push'](_0x48ec8e['shift']());}catch(_0x414394){_0x48ec8e['push'](_0x48ec8e['shift']());}}}(a165_0x261d,0x738e6));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5045c8){const _0x5d0bca=await buildSchemaPayload();return{'ok':!![],'data':_0x5d0bca};}function a165_0x407c(_0x21cc46,_0x2e40bf){_0x21cc46=_0x21cc46-0x9b;const _0x261d5e=a165_0x261d();let _0x407cb8=_0x261d5e[_0x21cc46];return _0x407cb8;}export const schemaDefinition={'service':a165_0x42fc38(0x9d),'command':'export','description':a165_0x42fc38(0xa8),'risk':a165_0x42fc38(0xa0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a165_0x42fc38(0x9b),'flags':[],'execute':execute};function a165_0x261d(){const _0x1b1095=['534VcnQid','274376UHkIIE','45nddZIB','28133fjrfpw','5ZVgjdZ','Export\x20machine-readable\x20command\x20schema\x20(JSON)','511446nZjRcR','json','234220ABLZyZ','schema','54945ynrHMx','2150runqKh','read','1389400ANFQHf','478312lJSOms'];a165_0x261d=function(){return _0x1b1095;};return a165_0x261d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a166_0x3cf64e=a166_0x3f31;(function(_0x4b280d,_0x153a92){const _0x7ae830=a166_0x3f31,_0x5d0e23=_0x4b280d();while(!![]){try{const _0x4b247d=parseInt(_0x7ae830(0xb2))/0x1*(parseInt(_0x7ae830(0x99))/0x2)+-parseInt(_0x7ae830(0x7e))/0x3+-parseInt(_0x7ae830(0x9b))/0x4*(-parseInt(_0x7ae830(0xbb))/0x5)+parseInt(_0x7ae830(0xae))/0x6*(parseInt(_0x7ae830(0x87))/0x7)+parseInt(_0x7ae830(0xab))/0x8*(parseInt(_0x7ae830(0x80))/0x9)+parseInt(_0x7ae830(0x81))/0xa+-parseInt(_0x7ae830(0x7f))/0xb*(parseInt(_0x7ae830(0x92))/0xc);if(_0x4b247d===_0x153a92)break;else _0x5d0e23['push'](_0x5d0e23['shift']());}catch(_0x3e23bd){_0x5d0e23['push'](_0x5d0e23['shift']());}}}(a166_0x2caf,0x66912));function a166_0x2caf(){const _0x184d06=['--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','18bYoEef','</select>','db-id','lockFilePath','554335khSGVu','POST','toISOString','name','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlRootDir','length','catch','5xCEJbW','high-risk-write','sql','lastSync','str','description','314571gplKTZ','11MmOmNw','9ZLSNhF','1176530coLyMW','trim','appCode','__manual__','stringify','flagMissing','386554lZrjAg','sqls','validation','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','dbId\x20不能为空','<server-generated-sqlCode>','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','✎\x20手动输入\x20dbId','适合带动态标签的\x20MyBatis\x20XML\x20SQL','flag','19281180zcuykM','mybatisXml','请选择目标数据库:','sqlRoot','Created\x20SQL\x20query\x20','utf8','请选择本地\x20SQL\x20模式:','2bMaPqp','mode','1965464OKAHbt','dbName','/smartapi/custom/saveUserCustomSql','普通\x20SQL(sql)','请输入\x20SQL\x20名称:','create','nonInteractive','Target\x20database\x20ID','sqlName','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','number','string','SQL\x20query\x20display\x20name','dbId','File\x20already\x20exists:\x20','isFinite','6421728pkXOXC','sqlCode'];a166_0x2caf=function(){return _0x184d06;};return a166_0x2caf();}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';function a166_0x3f31(_0x40154d,_0x120cf2){_0x40154d=_0x40154d-0x79;const _0x2cafd2=a166_0x2caf();let _0x3f312b=_0x2cafd2[_0x40154d];return _0x3f312b;}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x494806){const _0x1b9f7d=a166_0x3f31;if(_0x494806===_0x1b9f7d(0x93))return[_0x1b9f7d(0x8e),'\x20\x20SELECT\x201\x20AS\x20id',_0x1b9f7d(0xaf),'']['join']('\x0a');return['SELECT\x201\x20AS\x20id;','']['join']('\x0a');}export const sqlCreate={'service':a166_0x3cf64e(0x7a),'command':a166_0x3cf64e(0xa0),'description':a166_0x3cf64e(0x8a),'risk':a166_0x3cf64e(0x79),'flags':[{'name':a166_0x3cf64e(0xb5),'type':a166_0x3cf64e(0xa6),'description':a166_0x3cf64e(0xa7)},{'name':'db-id','type':a166_0x3cf64e(0xa5),'description':a166_0x3cf64e(0xa2)},{'name':a166_0x3cf64e(0x9a),'type':a166_0x3cf64e(0xa6),'enum':[a166_0x3cf64e(0x7a),'mybatisXml'],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x558b29){const _0x408255=a166_0x3cf64e;if(!_0x558b29[_0x408255(0xa1)])return;if(!_0x558b29[_0x408255(0x7c)](_0x408255(0xb5))[_0x408255(0x82)]())throw CliErrors[_0x408255(0x86)](_0x408255(0xb5),_0x408255(0xb6));const _0x34b1f1=resolveProvidedDbId(_0x558b29);if(typeof _0x34b1f1!=='number'||!Number[_0x408255(0xaa)](_0x34b1f1)||_0x34b1f1<=0x0)throw CliErrors[_0x408255(0x86)](_0x408255(0xb0),_0x408255(0xad));if(!_0x558b29[_0x408255(0x7c)](_0x408255(0x9a))['trim']())throw CliErrors['flagMissing'](_0x408255(0x9a),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x1e99ad){const _0x35109b=a166_0x3cf64e,_0x3fdc49=loadSqlProjectConfig(_0x1e99ad[_0x35109b(0x83)]),{sqlName:_0x5d7aa1,dbId:_0x3d945d,dbName:_0x5b4ab5,mode:_0x296fb1}=await resolveSqlNewInputs(_0x1e99ad),_0x220fa0=buildSqlRelativePath(_0x35109b(0x8d),_0x5d7aa1,_0x5b4ab5,_0x296fb1,_0x3d945d),_0x160e6e=_0x3fdc49[_0x35109b(0xb8)]+'/'+_0x220fa0;return{'method':_0x35109b(0xb3),'url':_0x35109b(0x9d),'body':{'appCode':_0x1e99ad['appCode'],'sqlName':_0x5d7aa1,'dbId':_0x3d945d,'mode':_0x296fb1,'localPath':_0x160e6e},'description':_0x35109b(0x8b)+_0x3fdc49[_0x35109b(0xb8)]};},async 'execute'(_0x208343){const _0x2e4af2=a166_0x3cf64e,_0x49a4b5=loadSqlProjectConfig(_0x208343[_0x2e4af2(0x83)]),{sqlName:_0x297f51,dbId:_0x5b3973,dbName:_0x8f3107,mode:_0x3a4199}=await resolveSqlNewInputs(_0x208343),_0x595f20=generateSqlTemplate(_0x3a4199),_0x262c29=await createSqlQuery({'appCode':_0x208343[_0x2e4af2(0x83)],'sqlName':_0x297f51,'dbId':_0x5b3973,'sqlContent':_0x595f20}),_0x5094fc=ensureRemoteSqlContent(_0x262c29),_0x5509e1=_0x8f3107||await getDbName(_0x208343[_0x2e4af2(0x83)],_0x5b3973)[_0x2e4af2(0xba)](()=>undefined),_0x358df0=buildSqlRelativePath(_0x262c29[_0x2e4af2(0xac)],_0x262c29['sqlName'],_0x5509e1,_0x3a4199,_0x5b3973),_0x23495b=_0x49a4b5[_0x2e4af2(0xb8)]+'/'+_0x358df0,_0x4c9c3b=buildLocalSqlFileContent({'sqlCode':_0x262c29[_0x2e4af2(0xac)],'sqlName':_0x262c29[_0x2e4af2(0xa3)],'dbId':_0x262c29[_0x2e4af2(0xa8)]},_0x5094fc,{'dbName':_0x5509e1,'mode':_0x3a4199,'syncedAt':new Date()[_0x2e4af2(0xb4)](),'description':_0x262c29[_0x2e4af2(0x7d)]});if(await fileExists(_0x23495b))throw CliErrors[_0x2e4af2(0x89)](_0x2e4af2(0xa9)+_0x23495b);await ensureParentDirectory(_0x23495b),await writeFile(_0x23495b,_0x4c9c3b,_0x2e4af2(0x97));const _0x3ca64c=await readSqlLockFile(_0x49a4b5[_0x2e4af2(0xb1)]),{lockData:_0x5932d4,appLock:_0x219024}=ensureSqlLockScope(_0x3ca64c??createEmptySqlLock(),_0x49a4b5[_0x2e4af2(0x83)],_0x49a4b5[_0x2e4af2(0x95)],'new');return _0x219024[_0x2e4af2(0x88)][_0x262c29[_0x2e4af2(0xac)]]={...buildSqlLockEntry(_0x262c29,_0x5094fc,computeSqlContentHash(_0x4c9c3b),{'dbName':_0x5509e1}),'path':_0x358df0,'mode':_0x3a4199},_0x219024[_0x2e4af2(0x7b)]=new Date()[_0x2e4af2(0xb4)](),await writeSqlLockFile(_0x49a4b5[_0x2e4af2(0xb1)],_0x5932d4),{'ok':!![],'data':{'id':_0x262c29['id'],'sqlCode':_0x262c29[_0x2e4af2(0xac)],'sqlName':_0x262c29['sqlName'],'dbId':_0x262c29[_0x2e4af2(0xa8)],'path':_0x23495b,'mode':_0x3a4199},'message':_0x2e4af2(0x96)+_0x262c29[_0x2e4af2(0xac)]};}};async function resolveSqlNewInputs(_0x39edd4){const _0x212aac=await resolveSqlNameInput(_0x39edd4),{dbId:_0x1f56ad,dbName:_0x161fc5}=await resolveDbSelection(_0x39edd4),_0x2538ba=await resolveSqlModeInput(_0x39edd4);return{'sqlName':_0x212aac,'dbId':_0x1f56ad,'dbName':_0x161fc5,'mode':_0x2538ba};}async function resolveSqlNameInput(_0x1b147c){const _0x563533=a166_0x3cf64e,_0xa7f95d=_0x1b147c[_0x563533(0x7c)]('name')[_0x563533(0x82)]();if(_0xa7f95d)return _0xa7f95d;if(_0x1b147c[_0x563533(0xa1)])throw CliErrors[_0x563533(0x86)]('name',_0x563533(0xb6));return(await input({'message':_0x563533(0x9f),'validate':_0x2e9b7e=>_0x2e9b7e['trim']()?!![]:'SQL\x20名称不能为空'}))[_0x563533(0x82)]();}async function resolveDbSelection(_0x4f4d50){const _0xf837bf=a166_0x3cf64e,_0x244e36=resolveProvidedDbId(_0x4f4d50);if(typeof _0x244e36===_0xf837bf(0xa5)&&Number[_0xf837bf(0xaa)](_0x244e36)&&_0x244e36>0x0)return{'dbId':_0x244e36,'dbName':await getDbName(_0x4f4d50[_0xf837bf(0x83)],_0x244e36)[_0xf837bf(0xba)](()=>undefined)};if(_0x4f4d50[_0xf837bf(0xa1)])throw CliErrors[_0xf837bf(0x86)](_0xf837bf(0xb0),_0xf837bf(0xad));const _0x3a8530=await listDatabases(_0x4f4d50['appCode'])[_0xf837bf(0xba)](()=>[]);if(_0x3a8530[_0xf837bf(0xb9)]===0x1)return{'dbId':_0x3a8530[0x0][_0xf837bf(0xa8)],'dbName':_0x3a8530[0x0][_0xf837bf(0x9c)]};if(_0x3a8530[_0xf837bf(0xb9)]>0x1){const _0xe2b1c5=await select({'message':_0xf837bf(0x94),'choices':[..._0x3a8530['map'](_0xef2951=>({'name':_0xef2951['dbName']+'\x20('+_0xef2951[_0xf837bf(0xa8)]+')','value':serializeDbSelection(_0xef2951)})),{'name':_0xf837bf(0x8f),'value':'__manual__'}]});if(_0xe2b1c5!==_0xf837bf(0x84))return deserializeDbSelection(_0xe2b1c5);}const _0x4ad779=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x4b78f8=>{const _0x1c923f=_0xf837bf,_0x131639=_0x4b78f8[_0x1c923f(0x82)]();if(!_0x131639)return _0x1c923f(0x8c);const _0x2c851e=Number(_0x131639);if(!Number['isInteger'](_0x2c851e)||_0x2c851e<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x4ad779[_0xf837bf(0x82)]())};}async function resolveSqlModeInput(_0x23b164){const _0x546b05=a166_0x3cf64e,_0x449471=_0x23b164[_0x546b05(0x7c)]('mode')[_0x546b05(0x82)]();if(_0x449471===_0x546b05(0x7a)||_0x449471===_0x546b05(0x93))return _0x449471;if(_0x23b164[_0x546b05(0xa1)])throw CliErrors['flagMissing'](_0x546b05(0x9a),_0x546b05(0xb7));return await select({'message':_0x546b05(0x98),'choices':[{'name':_0x546b05(0x9e),'value':_0x546b05(0x7a),'description':_0x546b05(0xa4)},{'name':'MyBatis\x20XML(mybatisXml)','value':_0x546b05(0x93),'description':_0x546b05(0x90)}]});}function serializeDbSelection(_0x58c014){const _0x51944b=a166_0x3cf64e;return JSON[_0x51944b(0x85)]({'dbId':_0x58c014[_0x51944b(0xa8)],'dbName':_0x58c014[_0x51944b(0x9c)]});}function deserializeDbSelection(_0x33dca3){const _0x260123=a166_0x3cf64e;try{const _0x464fa7=JSON['parse'](_0x33dca3);if(typeof _0x464fa7[_0x260123(0xa8)]===_0x260123(0xa5)&&Number[_0x260123(0xaa)](_0x464fa7[_0x260123(0xa8)]))return{'dbId':_0x464fa7[_0x260123(0xa8)],'dbName':_0x464fa7[_0x260123(0x9c)]};}catch{}throw CliErrors[_0x260123(0x89)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x33dca3);}function resolveProvidedDbId(_0x34e3e6){const _0x32e7af=a166_0x3cf64e,_0x10d983=_0x34e3e6[_0x32e7af(0x91)]('db-id');if(typeof _0x10d983===_0x32e7af(0xa5)&&Number[_0x32e7af(0xaa)](_0x10d983))return _0x10d983;return undefined;}
|
|
1
|
+
const a166_0x23a21e=a166_0x1447;(function(_0x2c44e2,_0x15f315){const _0x693205=a166_0x1447,_0x1660a7=_0x2c44e2();while(!![]){try{const _0x325033=parseInt(_0x693205(0xab))/0x1+-parseInt(_0x693205(0xbf))/0x2+parseInt(_0x693205(0x9e))/0x3+-parseInt(_0x693205(0xb8))/0x4*(parseInt(_0x693205(0x93))/0x5)+parseInt(_0x693205(0xc4))/0x6*(parseInt(_0x693205(0x81))/0x7)+-parseInt(_0x693205(0x8c))/0x8+parseInt(_0x693205(0x8a))/0x9;if(_0x325033===_0x15f315)break;else _0x1660a7['push'](_0x1660a7['shift']());}catch(_0x3373fd){_0x1660a7['push'](_0x1660a7['shift']());}}}(a166_0x4041,0x4aeca));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(_0x148b7e){const _0x4a9b5f=a166_0x1447;if(_0x148b7e==='mybatisXml')return[_0x4a9b5f(0xa5),_0x4a9b5f(0xad),'</select>',''][_0x4a9b5f(0xbd)]('\x0a');return[_0x4a9b5f(0x9b),''][_0x4a9b5f(0xbd)]('\x0a');}export const sqlCreate={'service':a166_0x23a21e(0x9f),'command':a166_0x23a21e(0x99),'description':a166_0x23a21e(0x87),'risk':a166_0x23a21e(0xa6),'flags':[{'name':a166_0x23a21e(0xa9),'type':a166_0x23a21e(0x8d),'description':a166_0x23a21e(0x9d)},{'name':a166_0x23a21e(0x8e),'type':a166_0x23a21e(0xae),'description':'Target\x20database\x20ID'},{'name':a166_0x23a21e(0x95),'type':a166_0x23a21e(0x8d),'enum':[a166_0x23a21e(0x9f),'mybatisXml'],'description':a166_0x23a21e(0x98)}],async 'validate'(_0x411729){const _0x25dd64=a166_0x23a21e;if(!_0x411729[_0x25dd64(0xc3)])return;if(!_0x411729['str'](_0x25dd64(0xa9))[_0x25dd64(0x84)]())throw CliErrors[_0x25dd64(0x90)](_0x25dd64(0xa9),_0x25dd64(0xba));const _0x349df6=resolveProvidedDbId(_0x411729);if(typeof _0x349df6!==_0x25dd64(0xae)||!Number['isFinite'](_0x349df6)||_0x349df6<=0x0)throw CliErrors[_0x25dd64(0x90)](_0x25dd64(0x8e),_0x25dd64(0x97));if(!_0x411729[_0x25dd64(0x8f)](_0x25dd64(0x95))['trim']())throw CliErrors[_0x25dd64(0x90)]('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x738888){const _0x3525b1=a166_0x23a21e,_0x4abdbf=loadSqlProjectConfig(_0x738888[_0x3525b1(0xac)]),{sqlName:_0x33fa2c,dbId:_0x591784,dbName:_0x4e3e2e,mode:_0x146aa3}=await resolveSqlNewInputs(_0x738888),_0x52ce84=buildSqlRelativePath(_0x3525b1(0xc6),_0x33fa2c,_0x4e3e2e,_0x146aa3,_0x591784),_0x20d3ac=_0x4abdbf[_0x3525b1(0x92)]+'/'+_0x52ce84;return{'method':_0x3525b1(0xa7),'url':_0x3525b1(0x85),'body':{'appCode':_0x738888[_0x3525b1(0xac)],'sqlName':_0x33fa2c,'dbId':_0x591784,'mode':_0x146aa3,'localPath':_0x20d3ac},'description':_0x3525b1(0xb3)+_0x4abdbf['sqlRootDir']};},async 'execute'(_0x33b614){const _0xabee42=a166_0x23a21e,_0x51b4d7=loadSqlProjectConfig(_0x33b614[_0xabee42(0xac)]),{sqlName:_0x5fd8b0,dbId:_0x44f879,dbName:_0x5b9c17,mode:_0x362b06}=await resolveSqlNewInputs(_0x33b614),_0xf8d7e1=generateSqlTemplate(_0x362b06),_0x87cf4d=await createSqlQuery({'appCode':_0x33b614[_0xabee42(0xac)],'sqlName':_0x5fd8b0,'dbId':_0x44f879,'sqlContent':_0xf8d7e1}),_0xfb2e7c=ensureRemoteSqlContent(_0x87cf4d),_0x9c4a7=_0x5b9c17||await getDbName(_0x33b614[_0xabee42(0xac)],_0x44f879)['catch'](()=>undefined),_0x285289=buildSqlRelativePath(_0x87cf4d['sqlCode'],_0x87cf4d[_0xabee42(0x91)],_0x9c4a7,_0x362b06,_0x44f879),_0x428793=_0x51b4d7[_0xabee42(0x92)]+'/'+_0x285289,_0x418266=buildLocalSqlFileContent({'sqlCode':_0x87cf4d['sqlCode'],'sqlName':_0x87cf4d[_0xabee42(0x91)],'dbId':_0x87cf4d['dbId']},_0xfb2e7c,{'dbName':_0x9c4a7,'mode':_0x362b06,'syncedAt':new Date()[_0xabee42(0xb2)](),'description':_0x87cf4d['description']});if(await fileExists(_0x428793))throw CliErrors[_0xabee42(0xb9)](_0xabee42(0x9a)+_0x428793);await ensureParentDirectory(_0x428793),await writeFile(_0x428793,_0x418266,'utf8');const _0x4c5f2e=await readSqlLockFile(_0x51b4d7['lockFilePath']),{lockData:_0x3e4fcc,appLock:_0x472c77}=ensureSqlLockScope(_0x4c5f2e??createEmptySqlLock(),_0x51b4d7['appCode'],_0x51b4d7[_0xabee42(0xa4)],_0xabee42(0x80));return _0x472c77[_0xabee42(0xb6)][_0x87cf4d['sqlCode']]={...buildSqlLockEntry(_0x87cf4d,_0xfb2e7c,computeSqlContentHash(_0x418266),{'dbName':_0x9c4a7}),'path':_0x285289,'mode':_0x362b06},_0x472c77[_0xabee42(0xc0)]=new Date()['toISOString'](),await writeSqlLockFile(_0x51b4d7[_0xabee42(0xbe)],_0x3e4fcc),{'ok':!![],'data':{'id':_0x87cf4d['id'],'sqlCode':_0x87cf4d['sqlCode'],'sqlName':_0x87cf4d['sqlName'],'dbId':_0x87cf4d[_0xabee42(0xaf)],'path':_0x428793,'mode':_0x362b06},'message':_0xabee42(0xaa)+_0x87cf4d[_0xabee42(0xb0)]};}};async function resolveSqlNewInputs(_0x1dadd4){const _0x2d62a8=await resolveSqlNameInput(_0x1dadd4),{dbId:_0x4d171d,dbName:_0x22f415}=await resolveDbSelection(_0x1dadd4),_0x2adf56=await resolveSqlModeInput(_0x1dadd4);return{'sqlName':_0x2d62a8,'dbId':_0x4d171d,'dbName':_0x22f415,'mode':_0x2adf56};}function a166_0x1447(_0x16b174,_0x5dacfa){_0x16b174=_0x16b174-0x80;const _0x404181=a166_0x4041();let _0x14471b=_0x404181[_0x16b174];return _0x14471b;}async function resolveSqlNameInput(_0x1d0cd4){const _0x44cd2d=a166_0x23a21e,_0x109c80=_0x1d0cd4['str'](_0x44cd2d(0xa9))[_0x44cd2d(0x84)]();if(_0x109c80)return _0x109c80;if(_0x1d0cd4[_0x44cd2d(0xc3)])throw CliErrors[_0x44cd2d(0x90)](_0x44cd2d(0xa9),_0x44cd2d(0xba));return(await input({'message':_0x44cd2d(0xb7),'validate':_0x46c42b=>_0x46c42b[_0x44cd2d(0x84)]()?!![]:_0x44cd2d(0xbc)}))[_0x44cd2d(0x84)]();}async function resolveDbSelection(_0xf89b8a){const _0xc91b4e=a166_0x23a21e,_0x277983=resolveProvidedDbId(_0xf89b8a);if(typeof _0x277983===_0xc91b4e(0xae)&&Number['isFinite'](_0x277983)&&_0x277983>0x0)return{'dbId':_0x277983,'dbName':await getDbName(_0xf89b8a[_0xc91b4e(0xac)],_0x277983)[_0xc91b4e(0xc2)](()=>undefined)};if(_0xf89b8a[_0xc91b4e(0xc3)])throw CliErrors['flagMissing'](_0xc91b4e(0x8e),_0xc91b4e(0x97));const _0x12efd2=await listDatabases(_0xf89b8a[_0xc91b4e(0xac)])[_0xc91b4e(0xc2)](()=>[]);if(_0x12efd2[_0xc91b4e(0x9c)]===0x1)return{'dbId':_0x12efd2[0x0][_0xc91b4e(0xaf)],'dbName':_0x12efd2[0x0][_0xc91b4e(0xb4)]};if(_0x12efd2['length']>0x1){const _0x4ebd53=await select({'message':_0xc91b4e(0xa1),'choices':[..._0x12efd2[_0xc91b4e(0xb5)](_0x4483cd=>({'name':_0x4483cd['dbName']+'\x20('+_0x4483cd[_0xc91b4e(0xaf)]+')','value':serializeDbSelection(_0x4483cd)})),{'name':_0xc91b4e(0x82),'value':_0xc91b4e(0xa2)}]});if(_0x4ebd53!==_0xc91b4e(0xa2))return deserializeDbSelection(_0x4ebd53);}const _0x1de467=await input({'message':_0xc91b4e(0xb1),'validate':_0x2125b0=>{const _0x4128d8=_0xc91b4e,_0x69e686=_0x2125b0[_0x4128d8(0x84)]();if(!_0x69e686)return _0x4128d8(0xbb);const _0x51fd4c=Number(_0x69e686);if(!Number[_0x4128d8(0x86)](_0x51fd4c)||_0x51fd4c<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x1de467[_0xc91b4e(0x84)]())};}async function resolveSqlModeInput(_0x55c91f){const _0x3627f6=a166_0x23a21e,_0x11243b=_0x55c91f[_0x3627f6(0x8f)]('mode')['trim']();if(_0x11243b===_0x3627f6(0x9f)||_0x11243b===_0x3627f6(0x89))return _0x11243b;if(_0x55c91f[_0x3627f6(0xc3)])throw CliErrors[_0x3627f6(0x90)]('mode',_0x3627f6(0x83));return await select({'message':_0x3627f6(0x96),'choices':[{'name':_0x3627f6(0xa8),'value':_0x3627f6(0x9f),'description':'适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'},{'name':_0x3627f6(0x88),'value':'mybatisXml','description':_0x3627f6(0xa3)}]});}function serializeDbSelection(_0x1bb0c4){const _0x375c2f=a166_0x23a21e;return JSON[_0x375c2f(0xa0)]({'dbId':_0x1bb0c4[_0x375c2f(0xaf)],'dbName':_0x1bb0c4[_0x375c2f(0xb4)]});}function deserializeDbSelection(_0x1da922){const _0x44140d=a166_0x23a21e;try{const _0x5e873b=JSON[_0x44140d(0x8b)](_0x1da922);if(typeof _0x5e873b['dbId']===_0x44140d(0xae)&&Number[_0x44140d(0x94)](_0x5e873b[_0x44140d(0xaf)]))return{'dbId':_0x5e873b[_0x44140d(0xaf)],'dbName':_0x5e873b['dbName']};}catch{}throw CliErrors['validation'](_0x44140d(0xc1)+_0x1da922);}function a166_0x4041(){const _0x3d1f2f=['SQL\x20名称不能为空','join','lockFilePath','306166Cfrkwu','lastSync','Invalid\x20database\x20selection\x20payload:\x20','catch','nonInteractive','107838rOVKVN','flag','<server-generated-sqlCode>','new','91QoAVTj','✎\x20手动输入\x20dbId','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','trim','/smartapi/custom/saveUserCustomSql','isInteger','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','MyBatis\x20XML(mybatisXml)','mybatisXml','2589174BSmXRu','parse','1733392PDYTyj','string','db-id','str','flagMissing','sqlName','sqlRootDir','1014835dDuTuS','isFinite','mode','请选择本地\x20SQL\x20模式:','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','Local\x20SQL\x20file\x20mode','create','File\x20already\x20exists:\x20','SELECT\x201\x20AS\x20id;','length','SQL\x20query\x20display\x20name','1713195NZVtEF','sql','stringify','请选择目标数据库:','__manual__','适合带动态标签的\x20MyBatis\x20XML\x20SQL','sqlRoot','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','high-risk-write','POST','普通\x20SQL(sql)','name','Created\x20SQL\x20query\x20','193148WoNDMk','appCode','\x20\x20SELECT\x201\x20AS\x20id','number','dbId','sqlCode','请输入目标数据库\x20dbId:','toISOString','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','dbName','map','sqls','请输入\x20SQL\x20名称:','12MixvgN','validation','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','dbId\x20不能为空'];a166_0x4041=function(){return _0x3d1f2f;};return a166_0x4041();}function resolveProvidedDbId(_0x339a0e){const _0x5c7ace=a166_0x23a21e,_0x1ef87a=_0x339a0e[_0x5c7ace(0xc5)](_0x5c7ace(0x8e));if(typeof _0x1ef87a===_0x5c7ace(0xae)&&Number[_0x5c7ace(0x94)](_0x1ef87a))return _0x1ef87a;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a167_0x25af45=a167_0x27e6;(function(_0x2a29fb,_0x464055){const _0x8ad3af=a167_0x27e6,_0x22598d=_0x2a29fb();while(!![]){try{const _0x2b5193=parseInt(_0x8ad3af(0x12c))/0x1*(-parseInt(_0x8ad3af(0x132))/0x2)+parseInt(_0x8ad3af(0x12d))/0x3*(-parseInt(_0x8ad3af(0x14a))/0x4)+-parseInt(_0x8ad3af(0x148))/0x5+parseInt(_0x8ad3af(0x13a))/0x6+parseInt(_0x8ad3af(0x134))/0x7+-parseInt(_0x8ad3af(0x126))/0x8+-parseInt(_0x8ad3af(0x13f))/0x9*(-parseInt(_0x8ad3af(0x127))/0xa);if(_0x2b5193===_0x464055)break;else _0x22598d['push'](_0x22598d['shift']());}catch(_0x109617){_0x22598d['push'](_0x22598d['shift']());}}}(a167_0x2a0d,0xd218d));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a167_0x2a0d(){const _0x3b32c8=['92olKszu','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','8752872JkKkcR','6573030UxDAhL','Deleted\x20','entries','lockFilePath','filter','5LFcsmO','43473VgLzdT','SQL\x20lock\x20file\x20not\x20found.','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','startsWith','sqlRoot','86582qmGNMT','sqlRootDir','1383781sGhrBI','delete','fromEntries','appCode','str','sqlcode','1713654UlGsIH','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','projectRoot','toISOString','validation','36DKqnec','Would\x20delete\x20SQL\x20','lastSync','sql','length','replace','remoteId','\x20(local\x20file\x20moved\x20to\x20trash)','sqls','3040450pZaUqJ','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.'];a167_0x2a0d=function(){return _0x3b32c8;};return a167_0x2a0d();}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';function a167_0x27e6(_0x174d6b,_0x1650eb){_0x174d6b=_0x174d6b-0x126;const _0x2a0d11=a167_0x2a0d();let _0x27e63f=_0x2a0d11[_0x174d6b];return _0x27e63f;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a167_0x25af45(0x142),'command':'delete','description':a167_0x25af45(0x14b),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x5e5592){const _0x2820a9=a167_0x25af45,_0x4b6158=loadSqlProjectConfig(_0x5e5592[_0x2820a9(0x137)]),_0xa7da8c=await readSqlLockFile(_0x4b6158['lockFilePath']);if(!_0xa7da8c)throw CliErrors[_0x2820a9(0x13e)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x2e1b8b){const _0x22abbd=a167_0x25af45,_0x5b4f67=loadSqlProjectConfig(_0x2e1b8b['appCode']),_0x1cdf40=await readSqlLockFile(_0x5b4f67[_0x22abbd(0x12a)]);if(!_0x1cdf40)throw CliErrors[_0x22abbd(0x13e)](_0x22abbd(0x149));const {appLock:_0x49ec92}=ensureSqlLockScope(_0x1cdf40,_0x2e1b8b[_0x22abbd(0x137)],_0x5b4f67[_0x22abbd(0x131)],_0x22abbd(0x135)),_0x2f5ca2=_0x2e1b8b[_0x22abbd(0x138)]('sqlcode'),_0x4cf386=_0x49ec92[_0x22abbd(0x147)][_0x2f5ca2];if(!_0x4cf386)throw CliErrors[_0x22abbd(0x13e)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x2f5ca2+'\x22.');return{'method':'POST','url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x2f5ca2,'id':_0x4cf386['remoteId'],'localPath':resolveLocalSqlFilePath(_0x5b4f67,_0x2f5ca2,_0x4cf386)},'description':_0x22abbd(0x140)+_0x2f5ca2+_0x22abbd(0x13b)+_0x5b4f67['trashDir']};},async 'execute'(_0x27791c){const _0x23e3c3=a167_0x25af45,_0x20b1fc=loadSqlProjectConfig(_0x27791c[_0x23e3c3(0x137)]),_0x269b03=await readSqlLockFile(_0x20b1fc[_0x23e3c3(0x12a)]);if(!_0x269b03)throw CliErrors['validation'](_0x23e3c3(0x12e));const {lockData:_0x1fa83c,appLock:_0x592b42}=ensureSqlLockScope(_0x269b03,_0x27791c[_0x23e3c3(0x137)],_0x20b1fc[_0x23e3c3(0x131)],_0x23e3c3(0x135)),_0x304e15=_0x27791c[_0x23e3c3(0x138)](_0x23e3c3(0x139)),_0x48e7fe=_0x592b42['sqls'][_0x304e15];if(!_0x48e7fe)throw CliErrors[_0x23e3c3(0x13e)](_0x23e3c3(0x12f)+_0x304e15+'\x22.');await deleteSqlQuery({'id':_0x48e7fe[_0x23e3c3(0x145)],'sqlCode':_0x304e15}),_0x592b42[_0x23e3c3(0x147)]=Object[_0x23e3c3(0x136)](Object[_0x23e3c3(0x129)](_0x592b42['sqls'])[_0x23e3c3(0x12b)](([_0x99571d])=>_0x99571d!==_0x304e15)),_0x592b42[_0x23e3c3(0x141)]=new Date()[_0x23e3c3(0x13d)](),await writeSqlLockFile(_0x20b1fc['lockFilePath'],_0x1fa83c);const _0x2bf8c9=resolveLocalSqlFilePath(_0x20b1fc,_0x304e15,_0x48e7fe);let _0x515e00;await fileExists(_0x2bf8c9)&&(_0x515e00=await moveToTrash(_0x20b1fc[_0x23e3c3(0x13c)],_0x20b1fc['trashDir'],_0x2bf8c9),await cleanupEmptyDirectories(dirname(_0x2bf8c9),_0x20b1fc[_0x23e3c3(0x133)]));const _0x340da6={'deleted':_0x304e15,'remoteId':_0x48e7fe[_0x23e3c3(0x145)]};if(_0x515e00)_0x340da6['trashedTo']=_0x515e00;return{'ok':!![],'data':_0x340da6,'message':_0x23e3c3(0x128)+_0x304e15+(_0x515e00?_0x23e3c3(0x146):'')};}};async function moveToTrash(_0x1e0936,_0x40d838,_0xed4bab){const _0x507f63=a167_0x25af45,_0xc93bc8=new Date()[_0x507f63(0x13d)]()[_0x507f63(0x144)](/[:.]/g,'-'),_0x2d0d61=relative(_0x1e0936,_0xed4bab),_0x10796d=join(_0x40d838,_0xc93bc8,_0x2d0d61);return await mkdir(dirname(_0x10796d),{'recursive':!![]}),await rename(_0xed4bab,_0x10796d),_0x10796d;}async function cleanupEmptyDirectories(_0x5281c3,_0x2aadc7){const _0x438973=a167_0x25af45;let _0x399ddd=resolve(_0x5281c3);const _0xf12f4b=resolve(_0x2aadc7);while(_0x399ddd[_0x438973(0x130)](''+_0xf12f4b+sep)||_0x399ddd===_0xf12f4b){if(_0x399ddd===_0xf12f4b)return;try{const _0x1bfdfb=await readdir(_0x399ddd);if(_0x1bfdfb[_0x438973(0x143)]>0x0)return;await rmdir(_0x399ddd);}catch{return;}_0x399ddd=dirname(_0x399ddd);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a168_0x3174(_0x3b9cf2,_0x5dfede){_0x3b9cf2=_0x3b9cf2-0xe3;const _0x2563d2=a168_0x2563();let _0x3174d7=_0x2563d2[_0x3b9cf2];return _0x3174d7;}function a168_0x2563(){const _0x1ec165=['sqlcode','verbose','sql','sqlName','1317411CVomuf','28NKzCEs','sqlContent','166745FzlyXi','3vCEsNk','7145730tGvXVc','appCode','414144JiAuXQ','27145900LlCQKm','str','2277486LkAoSI','38278smPHaX','Return\x20full\x20raw\x20SQL\x20query\x20object','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','dbId','boolean','bool','detail','28KtbaSR'];a168_0x2563=function(){return _0x1ec165;};return a168_0x2563();}const a168_0x1821eb=a168_0x3174;(function(_0x309fdb,_0x2f8162){const _0x5a6150=a168_0x3174,_0x12f50e=_0x309fdb();while(!![]){try{const _0x28221a=-parseInt(_0x5a6150(0xed))/0x1+parseInt(_0x5a6150(0xf8))/0x2*(parseInt(_0x5a6150(0xf1))/0x3)+parseInt(_0x5a6150(0xee))/0x4*(parseInt(_0x5a6150(0xf0))/0x5)+-parseInt(_0x5a6150(0xf7))/0x6+parseInt(_0x5a6150(0xe8))/0x7*(parseInt(_0x5a6150(0xf4))/0x8)+-parseInt(_0x5a6150(0xf2))/0x9+parseInt(_0x5a6150(0xf5))/0xa;if(_0x28221a===_0x2f8162)break;else _0x12f50e['push'](_0x12f50e['shift']());}catch(_0x19c2c2){_0x12f50e['push'](_0x12f50e['shift']());}}}(a168_0x2563,0xa6d12));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a168_0x1821eb(0xeb),'command':a168_0x1821eb(0xe7),'description':a168_0x1821eb(0xe3),'risk':'read','flags':[SQLCODE_FLAG,{'name':a168_0x1821eb(0xea),'type':a168_0x1821eb(0xe5),'description':a168_0x1821eb(0xf9)}],async 'execute'(_0x4fb901){const _0x4a29ee=a168_0x1821eb,_0x68cc7b=await getSqlQueryInfo(_0x4fb901['appCode'],_0x4fb901[_0x4a29ee(0xf6)](_0x4a29ee(0xe9))),_0x147f0e=_0x4fb901[_0x4a29ee(0xe6)](_0x4a29ee(0xea));if(_0x147f0e)return{'ok':!![],'data':_0x68cc7b};const _0x1b4570=_0x68cc7b['dbId']?await getDbName(_0x4fb901[_0x4a29ee(0xf3)],_0x68cc7b[_0x4a29ee(0xe4)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x68cc7b['sqlCode'],'sqlName':_0x68cc7b[_0x4a29ee(0xec)],'db':_0x1b4570?_0x1b4570+'\x20('+_0x68cc7b[_0x4a29ee(0xe4)]+')':_0x68cc7b[_0x4a29ee(0xe4)]??'','description':_0x68cc7b['description']??'','sqlContent':_0x68cc7b[_0x4a29ee(0xef)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a169_0x4cbc70=a169_0x1079;(function(_0x218212,_0xa0f34d){const _0x2ce25b=a169_0x1079,_0x32bf02=_0x218212();while(!![]){try{const _0x50e590=-parseInt(_0x2ce25b(0xe4))/0x1+parseInt(_0x2ce25b(0xe3))/0x2*(-parseInt(_0x2ce25b(0xe0))/0x3)+parseInt(_0x2ce25b(0xdb))/0x4*(-parseInt(_0x2ce25b(0xd1))/0x5)+parseInt(_0x2ce25b(0xdd))/0x6+parseInt(_0x2ce25b(0xda))/0x7+parseInt(_0x2ce25b(0xd3))/0x8*(parseInt(_0x2ce25b(0xd0))/0x9)+parseInt(_0x2ce25b(0xd9))/0xa;if(_0x50e590===_0xa0f34d)break;else _0x32bf02['push'](_0x32bf02['shift']());}catch(_0x177bd3){_0x32bf02['push'](_0x32bf02['shift']());}}}(a169_0x4597,0xb4012));function a169_0x1079(_0x3a4924,_0x2e1e48){_0x3a4924=_0x3a4924-0xcb;const _0x459719=a169_0x4597();let _0x107914=_0x459719[_0x3a4924];return _0x107914;}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a169_0x4597(){const _0x405e0a=['\x20row(s)\x20in\x20','params','appCode','now','24234640XEKMWJ','5051921HdFaHR','2080060utIuVT','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','599370pUntsh','length','isArray','2962887rzNOQo','execResult','read','2wlAncK','1391165OkmpcF','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','str','exec','sql','Returned\x20','3573Udtlra','5NvubFX','SQL\x20execution\x20failed','7880filxCX','string'];a169_0x4597=function(){return _0x405e0a;};return a169_0x4597();}export const sqlExec={'service':a169_0x4cbc70(0xce),'command':a169_0x4cbc70(0xcd),'description':a169_0x4cbc70(0xcb),'risk':a169_0x4cbc70(0xe2),'flags':[SQLCODE_FLAG,{'name':a169_0x4cbc70(0xd6),'type':a169_0x4cbc70(0xd4),'description':a169_0x4cbc70(0xdc)}],async 'execute'(_0x1197b5){const _0x2c67eb=a169_0x4cbc70,_0x11d2e8=parseJsonParams(_0x1197b5[_0x2c67eb(0xcc)](_0x2c67eb(0xd6))),_0x3b15e1=Date['now'](),_0x5335d3=await executeSql(_0x1197b5[_0x2c67eb(0xd7)],_0x1197b5[_0x2c67eb(0xcc)]('sqlcode'),_0x11d2e8),_0x38320e=Date[_0x2c67eb(0xd8)]()-_0x3b15e1,_0x3e55df=_0x5335d3?.[_0x2c67eb(0xe1)]??_0x5335d3,_0x3e83f7=_0x5335d3?.['execSuccess']??!![];if(!_0x3e83f7)return{'ok':![],'data':{'error':_0x5335d3?.['execError']||_0x2c67eb(0xd2),'elapsed':_0x38320e},'message':_0x2c67eb(0xd2)};const _0x492a66=Array[_0x2c67eb(0xdf)](_0x3e55df)?_0x3e55df:[];return{'ok':!![],'data':{'rows':_0x492a66,'rowCount':_0x492a66['length'],'elapsed':_0x38320e},'message':_0x2c67eb(0xcf)+_0x492a66[_0x2c67eb(0xde)]+_0x2c67eb(0xd5)+_0x38320e+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x337afa,_0x35f2f0){const _0x1f5cbb=a170_0x2820,_0x16d2ef=_0x337afa();while(!![]){try{const _0x50ff2d=-parseInt(_0x1f5cbb(0x93))/0x1+-parseInt(_0x1f5cbb(0x8e))/0x2*(-parseInt(_0x1f5cbb(0x8d))/0x3)+parseInt(_0x1f5cbb(0x8f))/0x4*(-parseInt(_0x1f5cbb(0x8a))/0x5)+parseInt(_0x1f5cbb(0x92))/0x6*(-parseInt(_0x1f5cbb(0x90))/0x7)+parseInt(_0x1f5cbb(0x8c))/0x8+-parseInt(_0x1f5cbb(0x91))/0x9+parseInt(_0x1f5cbb(0x8b))/0xa;if(_0x50ff2d===_0x35f2f0)break;else _0x16d2ef['push'](_0x16d2ef['shift']());}catch(_0x5e6e7d){_0x16d2ef['push'](_0x16d2ef['shift']());}}}(a170_0x4fc5,0x5884a));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';function a170_0x4fc5(){const _0x10c92e=['35kfQdqQ','11996280etAeYs','3779064XsyKDX','156306dAOjRW','4xNnUWd','183184GOUxBd','77GQAXnC','2548116kMGBZE','193092xCYYbh','455947gZSXxT'];a170_0x4fc5=function(){return _0x10c92e;};return a170_0x4fc5();}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';function a170_0x2820(_0x3bb88a,_0x46cea5){_0x3bb88a=_0x3bb88a-0x8a;const _0x4fc582=a170_0x4fc5();let _0x282083=_0x4fc582[_0x3bb88a];return _0x282083;}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,sqlSave,sqlExec,sqlPull,sqlDelete];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a171_0x454035=a171_0x5092;(function(_0x3b7dea,_0x5cb2cb){const _0x5f5d0c=a171_0x5092,_0xf77215=_0x3b7dea();while(!![]){try{const _0x209579=-parseInt(_0x5f5d0c(0x167))/0x1*(parseInt(_0x5f5d0c(0x16d))/0x2)+-parseInt(_0x5f5d0c(0x16f))/0x3+-parseInt(_0x5f5d0c(0x171))/0x4*(-parseInt(_0x5f5d0c(0x160))/0x5)+-parseInt(_0x5f5d0c(0x177))/0x6+-parseInt(_0x5f5d0c(0x16a))/0x7*(parseInt(_0x5f5d0c(0x16e))/0x8)+parseInt(_0x5f5d0c(0x166))/0x9+parseInt(_0x5f5d0c(0x170))/0xa;if(_0x209579===_0x5cb2cb)break;else _0xf77215['push'](_0xf77215['shift']());}catch(_0x293501){_0xf77215['push'](_0xf77215['shift']());}}}(a171_0x45f6,0x87ac0));import{listSqlQueries}from'../../core/api-client.js';function a171_0x45f6(){const _0x1e5e1d=['19035070PRbqlF','74956XElukA','tableData','dbId','string','Filter\x20by\x20SQL\x20name','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','4156980lzbSxc','Page\x20size','Found\x20','\x20SQL\x20queries\x20(total:\x20','str','sqlCode','length','sqlName','number','45PmQPzY','verbose','boolean','sql','name','bool','9221724HJyaCP','3xlpAuj','No\x20custom\x20SQL\x20queries\x20found.','appCode','1475159eJIniV','read','page','686130HRDNxn','16fBFHcb','1192749zSHXHK'];a171_0x45f6=function(){return _0x1e5e1d;};return a171_0x45f6();}function a171_0x5092(_0x54aa9b,_0x596d46){_0x54aa9b=_0x54aa9b-0x15c;const _0x45f656=a171_0x45f6();let _0x509260=_0x45f656[_0x54aa9b];return _0x509260;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a171_0x454035(0x163),'command':'list','description':'List\x20custom\x20SQL\x20queries','risk':a171_0x454035(0x16b),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a171_0x454035(0x164),'type':a171_0x454035(0x174),'description':a171_0x454035(0x175)},{'name':a171_0x454035(0x16c),'type':a171_0x454035(0x15f),'description':'Page\x20number','default':0x1},{'name':'pagesize','type':a171_0x454035(0x15f),'description':a171_0x454035(0x178)},{'name':a171_0x454035(0x161),'type':a171_0x454035(0x162),'description':a171_0x454035(0x176)}],async 'execute'(_0x38736d){const _0x205fa7=a171_0x454035,_0x40567c=await listSqlQueries(_0x38736d[_0x205fa7(0x169)],{'sqlCode':_0x38736d[_0x205fa7(0x17b)]('sqlcode')||undefined,'sqlName':_0x38736d[_0x205fa7(0x17b)](_0x205fa7(0x164))||undefined,'currentPage':_0x38736d['num']('page'),'pageSize':_0x38736d['num']('pagesize',0x32)}),_0x3eb8a0=_0x38736d[_0x205fa7(0x165)](_0x205fa7(0x161)),_0x23dfe3=_0x40567c[_0x205fa7(0x172)]??[],_0x52d688=_0x40567c['paging']?.['totalCount']??_0x23dfe3['length'];let _0x6386f2;return _0x3eb8a0?_0x6386f2=_0x23dfe3:_0x6386f2=await Promise['all'](_0x23dfe3['map'](async _0x3dbb56=>{const _0x287199=_0x205fa7;let _0x43dd4b;try{_0x43dd4b=_0x3dbb56[_0x287199(0x173)]?await getDbName(_0x38736d['appCode'],_0x3dbb56[_0x287199(0x173)]):undefined;}catch{}return{'sqlCode':_0x3dbb56[_0x287199(0x15c)],'sqlName':_0x3dbb56[_0x287199(0x15e)],'description':_0x3dbb56['description']??'','db':_0x43dd4b?_0x43dd4b+'\x20('+_0x3dbb56[_0x287199(0x173)]+')':_0x3dbb56[_0x287199(0x173)]??''};})),{'ok':!![],'data':_0x6386f2,'message':_0x23dfe3['length']===0x0?_0x205fa7(0x168):_0x205fa7(0x179)+_0x23dfe3[_0x205fa7(0x15d)]+_0x205fa7(0x17a)+_0x52d688+').'};}};
|
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a172_0x518cec=a172_0x73db;(function(_0x54795d,_0x1dbca9){const _0x242e13=a172_0x73db,_0x847ba4=_0x54795d();while(!![]){try{const _0x29a423=-parseInt(_0x242e13(0x18b))/0x1*(-parseInt(_0x242e13(0x1a0))/0x2)+-parseInt(_0x242e13(0x188))/0x3+-parseInt(_0x242e13(0x19e))/0x4*(-parseInt(_0x242e13(0x191))/0x5)+-parseInt(_0x242e13(0x1bc))/0x6+-parseInt(_0x242e13(0x1b7))/0x7+-parseInt(_0x242e13(0x1b3))/0x8+parseInt(_0x242e13(0x1ad))/0x9;if(_0x29a423===_0x1dbca9)break;else _0x847ba4['push'](_0x847ba4['shift']());}catch(_0x2ff41d){_0x847ba4['push'](_0x847ba4['shift']());}}}(a172_0x4107,0x57116));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';function a172_0x4107(){const _0xb29091=['pull','dbId','join','sqlContent','write','\x20SQL\x20file(s)\x20into\x20','sql','string','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','Force\x20pull\x20cancelled.','paging','16765335WTCbNi','boolean','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqlCode','local\x20differs\x20from\x20remote','sqls','4591776Xvnxpf','would_pull','tableData','push','4456956ZwLpSe','sqlcode','path','Filter\x20by\x20SQL\x20display\x20name','unchanged','4002510qKZoVH','force','catch','skipped','name','sqlName','utf8','cancelled','1319256hixzbV','lastSync','trimStart','53782OqQthf','No\x20remote\x20SQL\x20queries\x20matched.','totalCount','length','description','sqlRootDir','16495mQRiQz','apps','lockFilePath','\x20written,\x20','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','bool','mybatisXml','filter','test','appCode','split','POST','sqlRoot','136xHzKTh','Force\x20overwrite\x20local\x20unsynced\x20changes','26fIVcYb','str'];a172_0x4107=function(){return _0xb29091;};return a172_0x4107();}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(_0x2a8bcc,_0x28f66c){const _0x1286b1=a172_0x73db,_0x8a033b=[];let _0xcf9b72=0x1;while(!![]){const _0x2f55d9=await listSqlQueries(_0x2a8bcc,{'currentPage':_0xcf9b72,'pageSize':PAGE_SIZE,'sqlCode':_0x28f66c[_0x1286b1(0x1b0)],'sqlName':_0x28f66c[_0x1286b1(0x185)]}),_0x305d23=_0x2f55d9[_0x1286b1(0x1b5)]??[];_0x8a033b['push'](..._0x305d23);if(_0x305d23[_0x1286b1(0x18e)]===0x0)break;const _0x1a99ce=_0x2f55d9[_0x1286b1(0x1ac)]?.[_0x1286b1(0x18d)];if(_0x1a99ce!=null?_0x8a033b[_0x1286b1(0x18e)]>=_0x1a99ce:_0x305d23[_0x1286b1(0x18e)]<PAGE_SIZE)break;_0xcf9b72++;}return _0x8a033b;}async function ensureSqlContent(_0x3df757){const _0x43c603=a172_0x73db;if(_0x3df757[_0x43c603(0x1a5)]!=null&&String(_0x3df757[_0x43c603(0x1a5)])[_0x43c603(0x18e)]>0x0)return _0x3df757;return getSqlQueryDetail(_0x3df757[_0x43c603(0x1b0)]);}function a172_0x73db(_0x2bbb08,_0x23f962){_0x2bbb08=_0x2bbb08-0x182;const _0x410711=a172_0x4107();let _0x73db98=_0x410711[_0x2bbb08];return _0x73db98;}export const sqlPull={'service':a172_0x518cec(0x1a8),'command':a172_0x518cec(0x1a2),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a172_0x518cec(0x1a6),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a172_0x518cec(0x184),'type':a172_0x518cec(0x1a9),'description':a172_0x518cec(0x1ba)},{'name':a172_0x518cec(0x1bd),'type':a172_0x518cec(0x1ae),'description':a172_0x518cec(0x19f)}],async 'dryRun'(_0xb456e5){const _0x444027=a172_0x518cec,_0x37fdd2=loadSqlProjectConfig(_0xb456e5[_0x444027(0x19a)]),_0x38eaec=await readSqlLockFile(_0x37fdd2[_0x444027(0x193)]),{appLock:_0x4984c8}=ensureSqlLockScope(_0x38eaec??createEmptySqlLock(),_0x37fdd2[_0x444027(0x19a)],_0x37fdd2[_0x444027(0x19d)],_0x444027(0x1a2)),_0x59503f=await fetchAllSqlQueries(_0xb456e5['appCode'],{'sqlCode':_0xb456e5[_0x444027(0x1a1)](_0x444027(0x1b8))||undefined,'sqlName':_0xb456e5[_0x444027(0x1a1)](_0x444027(0x184))||undefined}),_0x39924e=[];for(const _0x51df11 of _0x59503f){const _0x46f8e8=await ensureSqlContent(_0x51df11),_0x58e130=ensureRemoteSqlContent(_0x46f8e8),_0x30773d=detectModeFromSql(_0x46f8e8),_0x3e871f=_0x46f8e8[_0x444027(0x1a3)]?await getDbName(_0xb456e5[_0x444027(0x19a)],Number(_0x46f8e8['dbId']))[_0x444027(0x182)](()=>undefined):undefined,_0x3e908a=buildLocalSqlFileContent({'sqlCode':_0x46f8e8[_0x444027(0x1b0)],'sqlName':_0x46f8e8[_0x444027(0x185)],'dbId':_0x46f8e8[_0x444027(0x1a3)]},_0x58e130,{'dbName':_0x3e871f,'mode':_0x30773d,'syncedAt':new Date()['toISOString'](),'description':_0x46f8e8['description']}),_0x1d1ca2=buildSqlLockEntry(_0x46f8e8,_0x58e130,'',{'dbName':_0x3e871f}),_0x2c3633=resolveLocalSqlFilePath(_0x37fdd2,_0x46f8e8['sqlCode'],_0x1d1ca2);let _0x7a4cd8=_0x444027(0x1b4),_0x4fc09d;if(await fileExists(_0x2c3633)){const _0x2b86c4=await readFile(_0x2c3633,_0x444027(0x186));isEquivalentPulledSqlFile(_0x2b86c4,_0x3e908a,_0x30773d)?(_0x7a4cd8=_0x444027(0x183),_0x4fc09d=_0x444027(0x1bb)):(_0x7a4cd8='conflict',_0x4fc09d=_0x444027(0x1aa));}_0x39924e[_0x444027(0x1b6)]({'sqlCode':_0x46f8e8[_0x444027(0x1b0)],'sqlName':_0x46f8e8['sqlName'],'filePath':_0x2c3633,'status':_0x7a4cd8,'reason':_0x4fc09d});}return{'method':_0x444027(0x19c),'url':_0x444027(0x1af),'body':{'appCode':_0xb456e5[_0x444027(0x19a)],'sqlCode':_0xb456e5[_0x444027(0x1a1)](_0x444027(0x1b8))||null,'sqlName':_0xb456e5[_0x444027(0x1a1)](_0x444027(0x184))||null,'files':_0x39924e},'description':'Would\x20pull\x20'+_0x39924e[_0x444027(0x18e)]+_0x444027(0x1a7)+_0x37fdd2['sqlRootDir']};},async 'execute'(_0xddccb0){const _0x1e51b5=a172_0x518cec,_0x48bd17=loadSqlProjectConfig(_0xddccb0[_0x1e51b5(0x19a)]),_0x14f8ea=await readSqlLockFile(_0x48bd17[_0x1e51b5(0x193)]),{lockData:_0x145172,appLock:_0x36a21a}=ensureSqlLockScope(_0x14f8ea??createEmptySqlLock(),_0x48bd17[_0x1e51b5(0x19a)],_0x48bd17[_0x1e51b5(0x19d)],'pull'),_0x565b11=_0xddccb0[_0x1e51b5(0x196)]('force'),_0x312b95=await fetchAllSqlQueries(_0xddccb0[_0x1e51b5(0x19a)],{'sqlCode':_0xddccb0['str'](_0x1e51b5(0x1b8))||undefined,'sqlName':_0xddccb0[_0x1e51b5(0x1a1)](_0x1e51b5(0x184))||undefined});if(_0x312b95[_0x1e51b5(0x18e)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x1e51b5(0x18c)};const _0x444039=[],_0x3f82f6=[];for(const _0x53cc83 of _0x312b95){try{_0x444039[_0x1e51b5(0x1b6)](await ensureSqlContent(_0x53cc83));}catch(_0x51b773){_0x3f82f6[_0x1e51b5(0x1b6)]({'sqlCode':_0x53cc83[_0x1e51b5(0x1b0)],'error':_0x51b773 instanceof Error?_0x51b773['message']:String(_0x51b773)});}}if(_0x565b11&&!_0xddccb0['nonInteractive']){let _0x42137c=![];for(const _0x22bccc of _0x444039){const _0x4e563f=detectModeFromSql(_0x22bccc),_0x430140=_0x22bccc[_0x1e51b5(0x1a3)]?await getDbName(_0xddccb0['appCode'],Number(_0x22bccc['dbId']))[_0x1e51b5(0x182)](()=>undefined):undefined,_0x370d03=buildLocalSqlFileContent({'sqlCode':_0x22bccc[_0x1e51b5(0x1b0)],'sqlName':_0x22bccc[_0x1e51b5(0x185)],'dbId':_0x22bccc[_0x1e51b5(0x1a3)]},ensureRemoteSqlContent(_0x22bccc),{'dbName':_0x430140,'mode':_0x4e563f,'syncedAt':new Date()['toISOString'](),'description':_0x22bccc[_0x1e51b5(0x18f)]}),_0x1d331e=resolveLocalSqlFilePath(_0x48bd17,_0x22bccc[_0x1e51b5(0x1b0)],buildSqlLockEntry(_0x22bccc,ensureRemoteSqlContent(_0x22bccc),'',{'dbName':_0x430140}));if(await fileExists(_0x1d331e)){const _0x3aed33=await readFile(_0x1d331e,_0x1e51b5(0x186));if(!isEquivalentPulledSqlFile(_0x3aed33,_0x370d03,_0x4e563f)){_0x42137c=!![];break;}}}if(_0x42137c){const _0x4056b2=await confirmForceOverwrite(_0x1e51b5(0x195));if(!_0x4056b2)throw CliErrors[_0x1e51b5(0x187)](_0x1e51b5(0x1ab));}}const _0x1cefab=cloneSqlLockData(_0x145172),_0x3a699d=_0x1cefab[_0x1e51b5(0x192)][_0x48bd17[_0x1e51b5(0x19a)]],_0x181f62=[],_0xd61585=[];for(const _0x2c4e34 of _0x444039){const _0xccc11b=_0x3a699d[_0x1e51b5(0x1b2)][_0x2c4e34['sqlCode']],_0x32e1da=ensureRemoteSqlContent(_0x2c4e34),_0xa04e86=detectModeFromSql(_0x2c4e34),_0x2d1424=_0x2c4e34[_0x1e51b5(0x1a3)]?await getDbName(_0xddccb0[_0x1e51b5(0x19a)],Number(_0x2c4e34[_0x1e51b5(0x1a3)]))[_0x1e51b5(0x182)](()=>undefined):undefined,_0x4f0a90=buildLocalSqlFileContent({'sqlCode':_0x2c4e34[_0x1e51b5(0x1b0)],'sqlName':_0x2c4e34['sqlName'],'dbId':_0x2c4e34[_0x1e51b5(0x1a3)]},_0x32e1da,{'dbName':_0x2d1424,'mode':_0xa04e86,'syncedAt':new Date()['toISOString'](),'description':_0x2c4e34[_0x1e51b5(0x18f)]}),_0x44718a=buildSqlLockEntry(_0x2c4e34,_0x32e1da,computeSqlContentHash(_0x4f0a90),{'dbName':_0x2d1424}),_0x506a97=_0x44718a[_0x1e51b5(0x1b9)],_0x3c89ab=join(_0x48bd17[_0x1e51b5(0x190)],_0x506a97);try{if(await fileExists(_0x3c89ab)){const _0x5b6d9a=await readFile(_0x3c89ab,_0x1e51b5(0x186));if(isEquivalentPulledSqlFile(_0x5b6d9a,_0x4f0a90,_0xa04e86)){_0xd61585[_0x1e51b5(0x1b6)]({'sqlCode':_0x2c4e34[_0x1e51b5(0x1b0)],'reason':_0x1e51b5(0x1bb)}),_0x3a699d[_0x1e51b5(0x1b2)][_0x2c4e34[_0x1e51b5(0x1b0)]]={..._0x44718a,'hash':computeSqlContentHash(_0x5b6d9a),'path':_0x506a97};continue;}if(!_0x565b11){_0xd61585[_0x1e51b5(0x1b6)]({'sqlCode':_0x2c4e34[_0x1e51b5(0x1b0)],'reason':_0x1e51b5(0x1b1)});continue;}}const _0x27ac51=_0xccc11b?.[_0x1e51b5(0x1b9)]?join(_0x48bd17[_0x1e51b5(0x190)],_0xccc11b[_0x1e51b5(0x1b9)]):undefined;_0x27ac51&&_0x27ac51!==_0x3c89ab&&await fileExists(_0x27ac51)&&await rm(_0x27ac51,{'force':!![]}),await ensureParentDirectory(_0x3c89ab),await writeFile(_0x3c89ab,_0x4f0a90,_0x1e51b5(0x186)),_0x3a699d[_0x1e51b5(0x1b2)][_0x2c4e34[_0x1e51b5(0x1b0)]]={..._0x44718a,'path':_0x506a97},_0x181f62[_0x1e51b5(0x1b6)]({'sqlCode':_0x2c4e34[_0x1e51b5(0x1b0)],'filePath':_0x3c89ab});}catch(_0x94f76d){_0x3f82f6[_0x1e51b5(0x1b6)]({'sqlCode':_0x2c4e34[_0x1e51b5(0x1b0)],'error':_0x94f76d instanceof Error?_0x94f76d['message']:String(_0x94f76d)});}}return _0x3a699d[_0x1e51b5(0x189)]=new Date()['toISOString'](),await writeSqlLockFile(_0x48bd17[_0x1e51b5(0x193)],_0x1cefab),{'ok':_0x3f82f6[_0x1e51b5(0x18e)]===0x0,'data':{'pulled':_0x181f62,'skipped':_0xd61585,'failed':_0x3f82f6},'message':'Pull\x20complete:\x20'+_0x181f62[_0x1e51b5(0x18e)]+_0x1e51b5(0x194)+_0xd61585[_0x1e51b5(0x18e)]+'\x20skipped,\x20'+_0x3f82f6[_0x1e51b5(0x18e)]+'\x20failed'};}};function detectModeFromSql(_0x2002e4){const _0x4b787c=a172_0x518cec,_0x5943a0=ensureRemoteSqlContent(_0x2002e4),_0xd1ac67=stripLocalSqlMetadata(_0x5943a0,_0x4b787c(0x197))[_0x4b787c(0x18a)]();if(/^<(select|insert|update|delete)\b/i['test'](_0xd1ac67))return _0x4b787c(0x197);return _0x4b787c(0x1a8);}function isEquivalentPulledSqlFile(_0x3e8842,_0x4601e7,_0x4e684c){return normalizePullComparableContent(_0x3e8842,_0x4e684c)===normalizePullComparableContent(_0x4601e7,_0x4e684c);}function normalizePullComparableContent(_0x2ab356,_0x4af141){const _0x382628=a172_0x518cec,_0x206a5d=_0x2ab356['replace'](/\r\n/g,'\x0a')[_0x382628(0x19b)]('\x0a'),_0x6752e6=_0x206a5d[_0x382628(0x198)](_0x4039cd=>!isSyncedAtMetadataLine(_0x4039cd,_0x4af141));return _0x6752e6[_0x382628(0x1a4)]('\x0a');}function isSyncedAtMetadataLine(_0x6a9b82,_0x2d9041){const _0x481f3b=a172_0x518cec;if(_0x2d9041===_0x481f3b(0x197))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x481f3b(0x199)](_0x6a9b82);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x6a9b82);}
|
|
1
|
+
const a172_0x198c14=a172_0x17af;function a172_0x17af(_0x47e8e4,_0x3bbc27){_0x47e8e4=_0x47e8e4-0x105;const _0x4762ca=a172_0x4762();let _0x17af51=_0x4762ca[_0x47e8e4];return _0x17af51;}(function(_0x5a673e,_0xa925fe){const _0x241e32=a172_0x17af,_0x5c421b=_0x5a673e();while(!![]){try{const _0x11de17=-parseInt(_0x241e32(0x10a))/0x1*(-parseInt(_0x241e32(0x115))/0x2)+parseInt(_0x241e32(0x110))/0x3*(-parseInt(_0x241e32(0x138))/0x4)+-parseInt(_0x241e32(0x12f))/0x5*(-parseInt(_0x241e32(0x12a))/0x6)+-parseInt(_0x241e32(0x144))/0x7+-parseInt(_0x241e32(0x13e))/0x8+parseInt(_0x241e32(0x112))/0x9*(-parseInt(_0x241e32(0x13f))/0xa)+-parseInt(_0x241e32(0x137))/0xb*(-parseInt(_0x241e32(0x11c))/0xc);if(_0x11de17===_0xa925fe)break;else _0x5c421b['push'](_0x5c421b['shift']());}catch(_0x26fc48){_0x5c421b['push'](_0x5c421b['shift']());}}}(a172_0x4762,0xe108c));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{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(_0x13e1c1,_0x1fed43){const _0x40015f=a172_0x17af,_0xc77ffa=[];let _0x5cb7f8=0x1;while(!![]){const _0xe1b409=await listSqlQueries(_0x13e1c1,{'currentPage':_0x5cb7f8,'pageSize':PAGE_SIZE,'sqlCode':_0x1fed43[_0x40015f(0x118)],'sqlName':_0x1fed43[_0x40015f(0x111)]}),_0x17309f=_0xe1b409[_0x40015f(0x13b)]??[];_0xc77ffa[_0x40015f(0x119)](..._0x17309f);if(_0x17309f[_0x40015f(0x107)]===0x0)break;const _0x44165a=_0xe1b409[_0x40015f(0x120)]?.[_0x40015f(0x12d)];if(_0x44165a!=null?_0xc77ffa[_0x40015f(0x107)]>=_0x44165a:_0x17309f['length']<PAGE_SIZE)break;_0x5cb7f8++;}return _0xc77ffa;}async function ensureSqlContent(_0x387a85){const _0x9aac6e=a172_0x17af;if(_0x387a85[_0x9aac6e(0x117)]!=null&&String(_0x387a85[_0x9aac6e(0x117)])['length']>0x0)return _0x387a85;return getSqlQueryDetail(_0x387a85[_0x9aac6e(0x118)]);}export const sqlPull={'service':a172_0x198c14(0x141),'command':a172_0x198c14(0x11a),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a172_0x198c14(0x11b),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a172_0x198c14(0x126),'type':a172_0x198c14(0x134),'description':a172_0x198c14(0x108)},{'name':a172_0x198c14(0x132),'type':a172_0x198c14(0x13c),'description':a172_0x198c14(0x10f)}],async 'dryRun'(_0xd2eee1){const _0x442026=a172_0x198c14,_0x140b69=loadSqlProjectConfig(_0xd2eee1['appCode']),_0x3e0c27=await readSqlLockFile(_0x140b69['lockFilePath']),{appLock:_0x30fa7f}=ensureSqlLockScope(_0x3e0c27??createEmptySqlLock(),_0x140b69['appCode'],_0x140b69[_0x442026(0x142)],_0x442026(0x11a)),_0x507865=await fetchAllSqlQueries(_0xd2eee1['appCode'],{'sqlCode':_0xd2eee1[_0x442026(0x109)](_0x442026(0x127))||undefined,'sqlName':_0xd2eee1[_0x442026(0x109)](_0x442026(0x126))||undefined}),_0xc563eb=[];for(const _0x4e03c2 of _0x507865){const _0x1e4de0=await ensureSqlContent(_0x4e03c2),_0x3297a3=ensureRemoteSqlContent(_0x1e4de0),_0x5c2344=detectModeFromSql(_0x1e4de0),_0x4967bd=_0x1e4de0['dbId']?await getDbName(_0xd2eee1[_0x442026(0x11e)],Number(_0x1e4de0[_0x442026(0x116)]))[_0x442026(0x11f)](()=>undefined):undefined,_0xeed0db=buildLocalSqlFileContent({'sqlCode':_0x1e4de0['sqlCode'],'sqlName':_0x1e4de0[_0x442026(0x111)],'dbId':_0x1e4de0[_0x442026(0x116)]},_0x3297a3,{'dbName':_0x4967bd,'mode':_0x5c2344,'syncedAt':new Date()['toISOString'](),'description':_0x1e4de0[_0x442026(0x13d)]}),_0x50acdf=buildSqlLockEntry(_0x1e4de0,_0x3297a3,'',{'dbName':_0x4967bd}),_0x320bc5=resolveLocalSqlFilePath(_0x140b69,_0x1e4de0['sqlCode'],_0x50acdf);let _0x438718=_0x442026(0x10c),_0x43478c;if(await fileExists(_0x320bc5)){const _0x4fe838=await readFile(_0x320bc5,'utf8');isEquivalentPulledSqlFile(_0x4fe838,_0xeed0db,_0x5c2344)?(_0x438718=_0x442026(0x130),_0x43478c=_0x442026(0x106)):(_0x438718='conflict',_0x43478c=_0x442026(0x140));}_0xc563eb[_0x442026(0x119)]({'sqlCode':_0x1e4de0[_0x442026(0x118)],'sqlName':_0x1e4de0[_0x442026(0x111)],'filePath':_0x320bc5,'status':_0x438718,'reason':_0x43478c});}return{'method':_0x442026(0x10d),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0xd2eee1[_0x442026(0x11e)],'sqlCode':_0xd2eee1[_0x442026(0x109)]('sqlcode')||null,'sqlName':_0xd2eee1['str']('name')||null,'files':_0xc563eb},'description':_0x442026(0x10e)+_0xc563eb[_0x442026(0x107)]+_0x442026(0x145)+_0x140b69['sqlRootDir']};},async 'execute'(_0x139a0b){const _0x271d68=a172_0x198c14,_0x5bcaed=loadSqlProjectConfig(_0x139a0b[_0x271d68(0x11e)]),_0x264e51=await readSqlLockFile(_0x5bcaed[_0x271d68(0x121)]),{lockData:_0x1c7cbd,appLock:_0x28bd1f}=ensureSqlLockScope(_0x264e51??createEmptySqlLock(),_0x5bcaed[_0x271d68(0x11e)],_0x5bcaed[_0x271d68(0x142)],_0x271d68(0x11a)),_0x2afb0b=_0x139a0b['bool'](_0x271d68(0x132)),_0x5363d0=await fetchAllSqlQueries(_0x139a0b[_0x271d68(0x11e)],{'sqlCode':_0x139a0b[_0x271d68(0x109)](_0x271d68(0x127))||undefined,'sqlName':_0x139a0b['str'](_0x271d68(0x126))||undefined});if(_0x5363d0[_0x271d68(0x107)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x271d68(0x128)};const _0x5dc5e9=[],_0x10d60c=[];for(const _0x35f9a4 of _0x5363d0){try{_0x5dc5e9[_0x271d68(0x119)](await ensureSqlContent(_0x35f9a4));}catch(_0x2ee05e){_0x10d60c[_0x271d68(0x119)]({'sqlCode':_0x35f9a4[_0x271d68(0x118)],'error':_0x2ee05e instanceof Error?_0x2ee05e['message']:String(_0x2ee05e)});}}if(_0x2afb0b&&!_0x139a0b[_0x271d68(0x12c)]){let _0x296790=![];for(const _0x119797 of _0x5dc5e9){const _0x19758d=detectModeFromSql(_0x119797),_0x47893b=_0x119797[_0x271d68(0x116)]?await getDbName(_0x139a0b['appCode'],Number(_0x119797[_0x271d68(0x116)]))[_0x271d68(0x11f)](()=>undefined):undefined,_0x229a22=buildLocalSqlFileContent({'sqlCode':_0x119797[_0x271d68(0x118)],'sqlName':_0x119797[_0x271d68(0x111)],'dbId':_0x119797[_0x271d68(0x116)]},ensureRemoteSqlContent(_0x119797),{'dbName':_0x47893b,'mode':_0x19758d,'syncedAt':new Date()[_0x271d68(0x114)](),'description':_0x119797['description']}),_0x3f86b0=resolveLocalSqlFilePath(_0x5bcaed,_0x119797[_0x271d68(0x118)],buildSqlLockEntry(_0x119797,ensureRemoteSqlContent(_0x119797),'',{'dbName':_0x47893b}));if(await fileExists(_0x3f86b0)){const _0x28ed9f=await readFile(_0x3f86b0,_0x271d68(0x131));if(!isEquivalentPulledSqlFile(_0x28ed9f,_0x229a22,_0x19758d)){_0x296790=!![];break;}}}if(_0x296790){const _0x3a3aa4=await confirmForceOverwrite(_0x271d68(0x13a));if(!_0x3a3aa4)throw CliErrors[_0x271d68(0x129)]('Force\x20pull\x20cancelled.');}}const _0x173da6=cloneSqlLockData(_0x1c7cbd),_0x33da70=_0x173da6[_0x271d68(0x124)][_0x5bcaed[_0x271d68(0x11e)]],_0x247d79=[],_0x2bbe05=[];for(const _0xb52b01 of _0x5dc5e9){const _0x55b60d=_0x33da70[_0x271d68(0x143)][_0xb52b01[_0x271d68(0x118)]],_0x54e71b=ensureRemoteSqlContent(_0xb52b01),_0x19cf5f=detectModeFromSql(_0xb52b01),_0x4209df=_0xb52b01[_0x271d68(0x116)]?await getDbName(_0x139a0b[_0x271d68(0x11e)],Number(_0xb52b01[_0x271d68(0x116)]))[_0x271d68(0x11f)](()=>undefined):undefined,_0x30425b=buildLocalSqlFileContent({'sqlCode':_0xb52b01[_0x271d68(0x118)],'sqlName':_0xb52b01[_0x271d68(0x111)],'dbId':_0xb52b01[_0x271d68(0x116)]},_0x54e71b,{'dbName':_0x4209df,'mode':_0x19cf5f,'syncedAt':new Date()[_0x271d68(0x114)](),'description':_0xb52b01[_0x271d68(0x13d)]}),_0x4bff0f=buildSqlLockEntry(_0xb52b01,_0x54e71b,computeSqlContentHash(_0x30425b),{'dbName':_0x4209df}),_0x53eb11=_0x4bff0f[_0x271d68(0x12e)],_0x5a8a94=join(_0x5bcaed[_0x271d68(0x133)],_0x53eb11);try{if(await fileExists(_0x5a8a94)){const _0x49e9d2=await readFile(_0x5a8a94,_0x271d68(0x131));if(isEquivalentPulledSqlFile(_0x49e9d2,_0x30425b,_0x19cf5f)){_0x2bbe05[_0x271d68(0x119)]({'sqlCode':_0xb52b01[_0x271d68(0x118)],'reason':'unchanged'}),_0x33da70[_0x271d68(0x143)][_0xb52b01[_0x271d68(0x118)]]={..._0x4bff0f,'hash':computeSqlContentHash(_0x49e9d2),'path':_0x53eb11};continue;}if(!_0x2afb0b){_0x2bbe05['push']({'sqlCode':_0xb52b01['sqlCode'],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x588e20=_0x55b60d?.[_0x271d68(0x12e)]?join(_0x5bcaed[_0x271d68(0x133)],_0x55b60d['path']):undefined;_0x588e20&&_0x588e20!==_0x5a8a94&&await fileExists(_0x588e20)&&await rm(_0x588e20,{'force':!![]}),await ensureParentDirectory(_0x5a8a94),await writeFile(_0x5a8a94,_0x30425b,_0x271d68(0x131)),_0x33da70[_0x271d68(0x143)][_0xb52b01[_0x271d68(0x118)]]={..._0x4bff0f,'path':_0x53eb11},_0x247d79[_0x271d68(0x119)]({'sqlCode':_0xb52b01[_0x271d68(0x118)],'filePath':_0x5a8a94});}catch(_0x1612f6){_0x10d60c[_0x271d68(0x119)]({'sqlCode':_0xb52b01[_0x271d68(0x118)],'error':_0x1612f6 instanceof Error?_0x1612f6[_0x271d68(0x123)]:String(_0x1612f6)});}}return _0x33da70[_0x271d68(0x122)]=new Date()[_0x271d68(0x114)](),await writeSqlLockFile(_0x5bcaed[_0x271d68(0x121)],_0x173da6),{'ok':_0x10d60c[_0x271d68(0x107)]===0x0,'data':{'pulled':_0x247d79,'skipped':_0x2bbe05,'failed':_0x10d60c},'message':_0x271d68(0x136)+_0x247d79[_0x271d68(0x107)]+_0x271d68(0x105)+_0x2bbe05[_0x271d68(0x107)]+_0x271d68(0x139)+_0x10d60c[_0x271d68(0x107)]+_0x271d68(0x10b)};}};function detectModeFromSql(_0x4f07ea){const _0x3c13e7=a172_0x198c14,_0x5d28b9=ensureRemoteSqlContent(_0x4f07ea),_0x337f85=stripLocalSqlMetadata(_0x5d28b9,_0x3c13e7(0x135))['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x3c13e7(0x125)](_0x337f85))return _0x3c13e7(0x135);return _0x3c13e7(0x141);}function isEquivalentPulledSqlFile(_0x1cd122,_0x427c66,_0x37b588){return normalizePullComparableContent(_0x1cd122,_0x37b588)===normalizePullComparableContent(_0x427c66,_0x37b588);}function normalizePullComparableContent(_0x15f3c3,_0x344ac5){const _0x44c08e=a172_0x198c14,_0x4fc601=_0x15f3c3['replace'](/\r\n/g,'\x0a')[_0x44c08e(0x113)]('\x0a'),_0x50fc38=_0x4fc601[_0x44c08e(0x11d)](_0x527b7b=>!isSyncedAtMetadataLine(_0x527b7b,_0x344ac5));return _0x50fc38[_0x44c08e(0x12b)]('\x0a');}function a172_0x4762(){const _0x27442a=['split','toISOString','10mJnXNL','dbId','sqlContent','sqlCode','push','pull','write','12gLCmYZ','filter','appCode','catch','paging','lockFilePath','lastSync','message','apps','test','name','sqlcode','No\x20remote\x20SQL\x20queries\x20matched.','cancelled','4029708ECbpPa','join','nonInteractive','totalCount','path','10ExVJkP','skipped','utf8','force','sqlRootDir','string','mybatisXml','Pull\x20complete:\x20','44506330GdMwBD','2012352XEPETh','\x20skipped,\x20','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','tableData','boolean','description','7752888kayXqW','3160900ZwckFN','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sql','sqlRoot','sqls','10595137niOFuO','\x20SQL\x20file(s)\x20into\x20','\x20written,\x20','unchanged','length','Filter\x20by\x20SQL\x20display\x20name','str','31324DibiSq','\x20failed','would_pull','POST','Would\x20pull\x20','Force\x20overwrite\x20local\x20unsynced\x20changes','9abqzIX','sqlName','18abJYpZ'];a172_0x4762=function(){return _0x27442a;};return a172_0x4762();}function isSyncedAtMetadataLine(_0x37867e,_0x37c40a){const _0x27b94a=a172_0x198c14;if(_0x37c40a===_0x27b94a(0x135))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x27b94a(0x125)](_0x37867e);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x37867e);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a173_0x186e53=a173_0x1ff8;(function(_0x99c2ac,_0x3e980a){const _0x17c32c=a173_0x1ff8,_0x3235c7=_0x99c2ac();while(!![]){try{const _0x514a6a=-parseInt(_0x17c32c(0x188))/0x1+-parseInt(_0x17c32c(0x19c))/0x2+-parseInt(_0x17c32c(0x198))/0x3*(-parseInt(_0x17c32c(0x164))/0x4)+-parseInt(_0x17c32c(0x16a))/0x5*(parseInt(_0x17c32c(0x189))/0x6)+parseInt(_0x17c32c(0x19b))/0x7*(-parseInt(_0x17c32c(0x18d))/0x8)+-parseInt(_0x17c32c(0x162))/0x9+parseInt(_0x17c32c(0x199))/0xa;if(_0x514a6a===_0x3e980a)break;else _0x3235c7['push'](_0x3235c7['shift']());}catch(_0x42ca2c){_0x3235c7['push'](_0x3235c7['shift']());}}}(a173_0x5a52,0x9c5f9));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';function a173_0x5a52(){const _0x9218f5=['828748hCtEIJ','has','dbDirectory','Would\x20push\x20','trashDir','mode','3872570iPzHLP','\x20SQL\x20file(s)','version','dbName','sqlName','relativePath','catch','dbId','high-risk-write','remoteId','toISOString','Local\x20directory\x20\x22','lockFilePath','No\x20local\x20SQL\x20files\x20found.','sqls','set','filePath','push','appCode','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sqlRoot','filter','validation','force','str','sqlcode','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','\x20pushed,\x20','\x20skipped,\x20','\x22\x20for\x20sqlCode\x20','288353HcVVRS','6gxmMBN','POST','map','join','4970744brgqkT','No\x20database\x20matches\x20local\x20directory\x20\x22','message','hash','sql','path','entries','isFinite','length','bool','Push\x20complete:\x20','3nQQHZo','40727160zwNGCM','sqlCode','14mSeAXO','1277854CKRIFD','Push\x20local\x20SQL\x20files\x20to\x20remote','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','6254262ABWGIp','boolean'];a173_0x5a52=function(){return _0x9218f5;};return a173_0x5a52();}import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';function a173_0x1ff8(_0x30b46c,_0x1517a1){_0x30b46c=_0x30b46c-0x160;const _0x5a52db=a173_0x5a52();let _0x1ff8c3=_0x5a52db[_0x30b46c];return _0x1ff8c3;}async function getTargetSqlQueries(_0x30310b,_0x1b4d71,_0x24b4ae){const _0x378916=a173_0x1ff8,_0x10f0c0=await scanLocalSqlQueries(_0x30310b),_0x253078=new Map();for(const _0x4cd2a6 of _0x10f0c0){if(_0x24b4ae&&_0x4cd2a6['sqlCode']!==_0x24b4ae)continue;const _0xcd7544=_0x253078['get'](_0x4cd2a6['sqlCode'])??[];_0xcd7544[_0x378916(0x17b)](_0x4cd2a6),_0x253078[_0x378916(0x179)](_0x4cd2a6['sqlCode'],_0xcd7544);}if(_0x24b4ae&&!_0x253078[_0x378916(0x165)](_0x24b4ae))throw CliErrors[_0x378916(0x180)]('Local\x20SQL\x20not\x20found:\x20'+_0x24b4ae);const _0xfe2d71=[];for(const [_0x45633a,_0x15bd23]of _0x253078[_0x378916(0x193)]()){if(_0x15bd23[_0x378916(0x195)]===0x1){_0xfe2d71[_0x378916(0x17b)](_0x15bd23[0x0]);continue;}const _0x5bb241=_0x1b4d71['sqls'][_0x45633a],_0x311a0b=_0x5bb241?.['path'],_0x5bc0d7=_0x311a0b?_0x15bd23['filter'](_0x393e57=>_0x393e57[_0x378916(0x16f)]!==_0x311a0b):_0x15bd23;if(_0x5bb241&&_0x5bc0d7[_0x378916(0x195)]===0x1){_0xfe2d71[_0x378916(0x17b)](_0x5bc0d7[0x0]);continue;}throw CliErrors[_0x378916(0x180)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x45633a+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0xfe2d71;}export const sqlPush={'service':a173_0x186e53(0x191),'command':a173_0x186e53(0x17b),'description':a173_0x186e53(0x160),'risk':a173_0x186e53(0x172),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a173_0x186e53(0x181),'type':a173_0x186e53(0x163),'description':a173_0x186e53(0x184)}],async 'dryRun'(_0x1f5007){const _0x2fb114=a173_0x186e53,_0xf92402=loadSqlProjectConfig(_0x1f5007[_0x2fb114(0x17c)]),_0x1be2a0=await readSqlLockFile(_0xf92402[_0x2fb114(0x176)]),{appLock:_0x1b481c}=ensureSqlLockScope(_0x1be2a0??createEmptySqlLock(),_0x1f5007[_0x2fb114(0x17c)],_0xf92402[_0x2fb114(0x17e)],_0x2fb114(0x17b)),_0x3110cd=await getTargetSqlQueries(_0xf92402,_0x1b481c,_0x1f5007[_0x2fb114(0x182)](_0x2fb114(0x183))||undefined),_0x26dbae=[];for(const _0x34b3b1 of _0x3110cd){const _0x27ac61=await computeSqlFileHash(_0x34b3b1[_0x2fb114(0x17a)]),_0x29dc6f=_0x1b481c[_0x2fb114(0x178)][_0x34b3b1['sqlCode']],_0xbab337=!!_0x29dc6f&&(_0x29dc6f['path']!==_0x34b3b1[_0x2fb114(0x16f)]||!!_0x34b3b1[_0x2fb114(0x16e)]&&_0x29dc6f[_0x2fb114(0x16e)]!==_0x34b3b1[_0x2fb114(0x16e)]);if(!_0x1f5007[_0x2fb114(0x196)](_0x2fb114(0x181))&&_0x29dc6f&&_0x29dc6f[_0x2fb114(0x190)]===_0x27ac61&&!_0xbab337)continue;_0x26dbae[_0x2fb114(0x17b)](_0x34b3b1[_0x2fb114(0x19a)]);}return{'method':_0x2fb114(0x18a),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x26dbae,'appCode':_0x1f5007[_0x2fb114(0x17c)]},'description':_0x2fb114(0x167)+_0x26dbae[_0x2fb114(0x195)]+_0x2fb114(0x16b)};},async 'execute'(_0x2ccbb7){const _0x4a63b1=a173_0x186e53,_0x2b632b=loadSqlProjectConfig(_0x2ccbb7['appCode']),_0x2c83ea=await readSqlLockFile(_0x2b632b[_0x4a63b1(0x176)]),{lockData:_0xd5023b,appLock:_0x2830c1}=ensureSqlLockScope(_0x2c83ea??createEmptySqlLock(),_0x2ccbb7[_0x4a63b1(0x17c)],_0x2b632b['sqlRoot'],_0x4a63b1(0x17b)),_0x10c2af=await getTargetSqlQueries(_0x2b632b,_0x2830c1,_0x2ccbb7[_0x4a63b1(0x182)](_0x4a63b1(0x183))||undefined);if(_0x10c2af[_0x4a63b1(0x195)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x4a63b1(0x177)};const _0x4daa37=[],_0x1bcd47=[],_0x301b70=[];for(const _0x11d819 of _0x10c2af){const _0x5ea23c=_0x2830c1[_0x4a63b1(0x178)][_0x11d819[_0x4a63b1(0x19a)]];if(!_0x5ea23c){_0x301b70[_0x4a63b1(0x17b)]({'sqlCode':_0x11d819[_0x4a63b1(0x19a)],'error':_0x4a63b1(0x161)});continue;}try{const _0x18afa4=await computeSqlFileHash(_0x11d819[_0x4a63b1(0x17a)]),_0x4574e3=_0x5ea23c[_0x4a63b1(0x192)]!==_0x11d819[_0x4a63b1(0x16f)]||!!_0x11d819[_0x4a63b1(0x16e)]&&_0x5ea23c[_0x4a63b1(0x16e)]!==_0x11d819['sqlName'];if(!_0x2ccbb7[_0x4a63b1(0x196)]('force')&&_0x5ea23c[_0x4a63b1(0x190)]===_0x18afa4&&!_0x4574e3){_0x1bcd47[_0x4a63b1(0x17b)]({'sqlCode':_0x11d819[_0x4a63b1(0x19a)],'reason':'unchanged'});continue;}if(_0x5ea23c[_0x4a63b1(0x16c)]==null){_0x301b70['push']({'sqlCode':_0x11d819[_0x4a63b1(0x19a)],'error':_0x4a63b1(0x17d)});continue;}const _0x2c1498=await readFile(_0x11d819['filePath'],'utf8'),_0x4ae0a2=stripLocalSqlMetadata(_0x2c1498,_0x11d819['mode']),_0xf7f079=_0x11d819[_0x4a63b1(0x16e)]||_0x5ea23c[_0x4a63b1(0x16e)],_0x5dbe37=await resolveTargetDbBinding(_0x2ccbb7[_0x4a63b1(0x17c)],_0x11d819,_0x5ea23c),_0x5b51ad=await updateSqlQuery({'id':_0x5ea23c[_0x4a63b1(0x173)],'appCode':_0x2ccbb7['appCode'],'sqlCode':_0x11d819[_0x4a63b1(0x19a)],'sqlName':_0xf7f079,'dbId':_0x5dbe37['dbId'],'version':_0x5ea23c[_0x4a63b1(0x16c)],'sqlContent':_0x4ae0a2,'sqlConfig':_0x5ea23c['sqlConfig']??undefined}),_0x404876=_0x5b51ad[_0x4a63b1(0x171)]?await getDbName(_0x2ccbb7[_0x4a63b1(0x17c)],Number(_0x5b51ad[_0x4a63b1(0x171)]))[_0x4a63b1(0x170)](()=>_0x5dbe37['dbName']):_0x5dbe37[_0x4a63b1(0x16d)];_0x2830c1['sqls'][_0x11d819[_0x4a63b1(0x19a)]]={...buildSqlLockEntry(_0x5b51ad,_0x4ae0a2,_0x18afa4,{'dbName':_0x404876}),'path':_0x11d819[_0x4a63b1(0x16f)],'mode':_0x5ea23c[_0x4a63b1(0x169)]},await archivePreviousSqlFileIfNeeded(_0x2b632b,_0x5ea23c[_0x4a63b1(0x192)],_0x11d819['relativePath']),_0x4daa37[_0x4a63b1(0x17b)]({'sqlCode':_0x11d819[_0x4a63b1(0x19a)],'remoteId':_0x5ea23c[_0x4a63b1(0x173)]});}catch(_0x2f04ce){_0x301b70[_0x4a63b1(0x17b)]({'sqlCode':_0x11d819[_0x4a63b1(0x19a)],'error':_0x2f04ce instanceof Error?_0x2f04ce[_0x4a63b1(0x18f)]:String(_0x2f04ce)});}}return _0x2830c1['lastSync']=new Date()[_0x4a63b1(0x174)](),await writeSqlLockFile(_0x2b632b['lockFilePath'],_0xd5023b),{'ok':_0x301b70[_0x4a63b1(0x195)]===0x0,'data':{'pushed':_0x4daa37,'skipped':_0x1bcd47,'failed':_0x301b70},'message':_0x4a63b1(0x197)+_0x4daa37['length']+_0x4a63b1(0x185)+_0x1bcd47[_0x4a63b1(0x195)]+_0x4a63b1(0x186)+_0x301b70[_0x4a63b1(0x195)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x37614a,_0x5847dc,_0x3279a0){const _0x1934c0=a173_0x186e53;if(!_0x5847dc||_0x5847dc===_0x3279a0)return;const _0x1b5712=join(_0x37614a['sqlRootDir'],_0x5847dc);if(!await fileExists(_0x1b5712))return;const _0x4bdb52=await moveToTrash(_0x37614a['projectRoot'],_0x37614a[_0x1934c0(0x168)],_0x1b5712);await cleanupEmptyDirectories(dirname(_0x1b5712),_0x37614a['sqlRootDir']),void _0x4bdb52;}async function moveToTrash(_0x234428,_0x1580ea,_0x13ac7f){const _0x203a50=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x5740a5=relative(_0x234428,_0x13ac7f),_0x3ed478=join(_0x1580ea,_0x203a50,_0x5740a5);return await mkdir(dirname(_0x3ed478),{'recursive':!![]}),await rename(_0x13ac7f,_0x3ed478),_0x3ed478;}async function cleanupEmptyDirectories(_0x250c9f,_0x3f3462){const _0x3d28fa=a173_0x186e53;let _0x490d97=resolve(_0x250c9f);const _0x13e60d=resolve(_0x3f3462);while(_0x490d97['startsWith'](''+_0x13e60d+sep)||_0x490d97===_0x13e60d){if(_0x490d97===_0x13e60d)return;try{const _0x536a60=await readdir(_0x490d97);if(_0x536a60[_0x3d28fa(0x195)]>0x0)return;await rmdir(_0x490d97);}catch{return;}_0x490d97=dirname(_0x490d97);}}async function resolveTargetDbBinding(_0x5bb2dc,_0x1caea1,_0x38c50c){const _0x3bc29a=a173_0x186e53,_0x1f0c81=_0x1caea1[_0x3bc29a(0x166)];if(!_0x1f0c81)return{'dbId':_0x38c50c[_0x3bc29a(0x171)],'dbName':_0x38c50c[_0x3bc29a(0x16d)]};const _0x5aed43=buildDbDirectoryName(_0x38c50c['dbName'],_0x38c50c[_0x3bc29a(0x171)]);if(_0x1f0c81===_0x5aed43)return{'dbId':_0x38c50c['dbId'],'dbName':_0x38c50c[_0x3bc29a(0x16d)]};const _0x41d25d=parseExplicitDbDirectory(_0x1f0c81);if(_0x41d25d!=null)return{'dbId':_0x41d25d,'dbName':await getDbName(_0x5bb2dc,_0x41d25d)[_0x3bc29a(0x170)](()=>undefined)};const _0x2c25c0=await listDatabases(_0x5bb2dc),_0x2da950=_0x2c25c0[_0x3bc29a(0x17f)](_0x5e0462=>buildDbDirectoryName(_0x5e0462['dbName'],_0x5e0462[_0x3bc29a(0x171)])===_0x1f0c81);if(_0x2da950['length']===0x1)return{'dbId':_0x2da950[0x0][_0x3bc29a(0x171)],'dbName':_0x2da950[0x0]['dbName']};if(_0x2da950[_0x3bc29a(0x195)]===0x0)throw CliErrors['validation'](_0x3bc29a(0x18e)+_0x1f0c81+_0x3bc29a(0x187)+_0x1caea1[_0x3bc29a(0x19a)]+'.');const _0x299684=_0x2da950[_0x3bc29a(0x18b)](_0x57d80f=>_0x57d80f[_0x3bc29a(0x16d)]+'\x20('+_0x57d80f[_0x3bc29a(0x171)]+')')[_0x3bc29a(0x18c)](',\x20');throw CliErrors[_0x3bc29a(0x180)](_0x3bc29a(0x175)+_0x1f0c81+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x1caea1[_0x3bc29a(0x19a)]+':\x20'+_0x299684);}function parseExplicitDbDirectory(_0xad8a88){const _0x4bcd6a=a173_0x186e53,_0x47532b=/^db-(\d+)$/['exec'](_0xad8a88);if(!_0x47532b)return null;const _0x4dfda9=Number(_0x47532b[0x1]);return Number[_0x4bcd6a(0x194)](_0x4dfda9)&&_0x4dfda9>0x0?_0x4dfda9:null;}
|
|
1
|
+
const a173_0x4314f0=a173_0x1450;(function(_0xa9b461,_0x4d18d7){const _0x2e9122=a173_0x1450,_0x13e605=_0xa9b461();while(!![]){try{const _0x35499f=-parseInt(_0x2e9122(0xc4))/0x1*(parseInt(_0x2e9122(0xb7))/0x2)+parseInt(_0x2e9122(0xab))/0x3+-parseInt(_0x2e9122(0xa9))/0x4+-parseInt(_0x2e9122(0xa3))/0x5*(parseInt(_0x2e9122(0xb8))/0x6)+parseInt(_0x2e9122(0xcd))/0x7*(-parseInt(_0x2e9122(0xa6))/0x8)+parseInt(_0x2e9122(0x90))/0x9*(-parseInt(_0x2e9122(0xa1))/0xa)+parseInt(_0x2e9122(0xc9))/0xb*(parseInt(_0x2e9122(0x9f))/0xc);if(_0x35499f===_0x4d18d7)break;else _0x13e605['push'](_0x13e605['shift']());}catch(_0x9e7489){_0x13e605['push'](_0x13e605['shift']());}}}(a173_0x38f2,0x22d13));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a173_0x1450(_0x461735,_0x5b4264){_0x461735=_0x461735-0x8e;const _0x38f296=a173_0x38f2();let _0x1450bc=_0x38f296[_0x461735];return _0x1450bc;}import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';function a173_0x38f2(){const _0x621961=['2265TcgPds','sqlCode','Push\x20complete:\x20','8RVMJeq','Local\x20directory\x20\x22','push','1066580eNSTqx','No\x20database\x20matches\x20local\x20directory\x20\x22','114267OdzxjY','dbId','validation','str','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','bool','sqlConfig','sql','entries','lockFilePath','startsWith','47666UiETki','72hsTMhI','get','No\x20local\x20SQL\x20files\x20found.','toISOString','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','Would\x20push\x20','boolean','\x20failed','mode','replace','lastSync','force','6upFTHm','hash','appCode','dbName','sqlName','1086118KPscOS','\x20SQL\x20file(s)','utf8','filter','688681uEJFjj','remoteId','filePath','high-risk-write','109773BDHKhc','version','message','trashDir','sqls','relativePath','path','catch','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','isFinite','has','length','sqlcode','sqlRoot','join','84jCEqmX','Local\x20SQL\x20not\x20found:\x20','60CFiqEH','sqlRootDir'];a173_0x38f2=function(){return _0x621961;};return a173_0x38f2();}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(_0x4a841c,_0x4e4a3b,_0x7c4f37){const _0x55a685=a173_0x1450,_0x4c2eec=await scanLocalSqlQueries(_0x4a841c),_0x1a4368=new Map();for(const _0x413caa of _0x4c2eec){if(_0x7c4f37&&_0x413caa[_0x55a685(0xa4)]!==_0x7c4f37)continue;const _0x5ead5d=_0x1a4368[_0x55a685(0xb9)](_0x413caa[_0x55a685(0xa4)])??[];_0x5ead5d[_0x55a685(0xa8)](_0x413caa),_0x1a4368['set'](_0x413caa[_0x55a685(0xa4)],_0x5ead5d);}if(_0x7c4f37&&!_0x1a4368[_0x55a685(0x9a)](_0x7c4f37))throw CliErrors[_0x55a685(0xad)](_0x55a685(0xa0)+_0x7c4f37);const _0x5727f5=[];for(const [_0x4fb760,_0xecd05f]of _0x1a4368[_0x55a685(0xb4)]()){if(_0xecd05f['length']===0x1){_0x5727f5[_0x55a685(0xa8)](_0xecd05f[0x0]);continue;}const _0x4ebf15=_0x4e4a3b['sqls'][_0x4fb760],_0x3163b8=_0x4ebf15?.[_0x55a685(0x96)],_0x339d04=_0x3163b8?_0xecd05f[_0x55a685(0xcc)](_0x4ca238=>_0x4ca238[_0x55a685(0x95)]!==_0x3163b8):_0xecd05f;if(_0x4ebf15&&_0x339d04[_0x55a685(0x9b)]===0x1){_0x5727f5[_0x55a685(0xa8)](_0x339d04[0x0]);continue;}throw CliErrors[_0x55a685(0xad)](_0x55a685(0xb0)+_0x4fb760+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x5727f5;}export const sqlPush={'service':a173_0x4314f0(0xb3),'command':'push','description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a173_0x4314f0(0x8f),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a173_0x4314f0(0xc3),'type':a173_0x4314f0(0xbe),'description':a173_0x4314f0(0xaf)}],async 'dryRun'(_0x5bb5c4){const _0x24a137=a173_0x4314f0,_0x1f0f6e=loadSqlProjectConfig(_0x5bb5c4[_0x24a137(0xc6)]),_0x291707=await readSqlLockFile(_0x1f0f6e[_0x24a137(0xb5)]),{appLock:_0x9a6467}=ensureSqlLockScope(_0x291707??createEmptySqlLock(),_0x5bb5c4[_0x24a137(0xc6)],_0x1f0f6e[_0x24a137(0x9d)],_0x24a137(0xa8)),_0x2be6a1=await getTargetSqlQueries(_0x1f0f6e,_0x9a6467,_0x5bb5c4[_0x24a137(0xae)](_0x24a137(0x9c))||undefined),_0x577143=[];for(const _0x134568 of _0x2be6a1){const _0x4fe53e=await computeSqlFileHash(_0x134568[_0x24a137(0x8e)]),_0x3b2f88=_0x9a6467[_0x24a137(0x94)][_0x134568[_0x24a137(0xa4)]],_0x53a341=!!_0x3b2f88&&(_0x3b2f88['path']!==_0x134568[_0x24a137(0x95)]||!!_0x134568[_0x24a137(0xc8)]&&_0x3b2f88[_0x24a137(0xc8)]!==_0x134568[_0x24a137(0xc8)]);if(!_0x5bb5c4[_0x24a137(0xb1)]('force')&&_0x3b2f88&&_0x3b2f88['hash']===_0x4fe53e&&!_0x53a341)continue;_0x577143['push'](_0x134568[_0x24a137(0xa4)]);}return{'method':'POST','url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x577143,'appCode':_0x5bb5c4[_0x24a137(0xc6)]},'description':_0x24a137(0xbd)+_0x577143[_0x24a137(0x9b)]+_0x24a137(0xca)};},async 'execute'(_0x2babe8){const _0x3cfd98=a173_0x4314f0,_0x17569d=loadSqlProjectConfig(_0x2babe8[_0x3cfd98(0xc6)]),_0x48868d=await readSqlLockFile(_0x17569d['lockFilePath']),{lockData:_0x464e41,appLock:_0x462efb}=ensureSqlLockScope(_0x48868d??createEmptySqlLock(),_0x2babe8[_0x3cfd98(0xc6)],_0x17569d[_0x3cfd98(0x9d)],'push'),_0xc19ad3=await getTargetSqlQueries(_0x17569d,_0x462efb,_0x2babe8[_0x3cfd98(0xae)](_0x3cfd98(0x9c))||undefined);if(_0xc19ad3[_0x3cfd98(0x9b)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x3cfd98(0xba)};const _0x544c25=[],_0x4e86c0=[],_0xc58632=[];for(const _0x49593a of _0xc19ad3){const _0x1cdc39=_0x462efb[_0x3cfd98(0x94)][_0x49593a['sqlCode']];if(!_0x1cdc39){_0xc58632[_0x3cfd98(0xa8)]({'sqlCode':_0x49593a[_0x3cfd98(0xa4)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x15aba1=await computeSqlFileHash(_0x49593a['filePath']),_0x2d90ea=_0x1cdc39[_0x3cfd98(0x96)]!==_0x49593a[_0x3cfd98(0x95)]||!!_0x49593a[_0x3cfd98(0xc8)]&&_0x1cdc39[_0x3cfd98(0xc8)]!==_0x49593a[_0x3cfd98(0xc8)];if(!_0x2babe8['bool'](_0x3cfd98(0xc3))&&_0x1cdc39[_0x3cfd98(0xc5)]===_0x15aba1&&!_0x2d90ea){_0x4e86c0['push']({'sqlCode':_0x49593a[_0x3cfd98(0xa4)],'reason':'unchanged'});continue;}if(_0x1cdc39[_0x3cfd98(0x91)]==null){_0xc58632[_0x3cfd98(0xa8)]({'sqlCode':_0x49593a[_0x3cfd98(0xa4)],'error':_0x3cfd98(0x98)});continue;}const _0x671f10=await readFile(_0x49593a['filePath'],_0x3cfd98(0xcb)),_0xcc449a=stripLocalSqlMetadata(_0x671f10,_0x49593a['mode']),_0x130bae=_0x49593a[_0x3cfd98(0xc8)]||_0x1cdc39[_0x3cfd98(0xc8)],_0x1e6fa6=await resolveTargetDbBinding(_0x2babe8['appCode'],_0x49593a,_0x1cdc39),_0x288168=await updateSqlQuery({'id':_0x1cdc39[_0x3cfd98(0xce)],'appCode':_0x2babe8['appCode'],'sqlCode':_0x49593a[_0x3cfd98(0xa4)],'sqlName':_0x130bae,'dbId':_0x1e6fa6['dbId'],'version':_0x1cdc39[_0x3cfd98(0x91)],'sqlContent':_0xcc449a,'sqlConfig':_0x1cdc39[_0x3cfd98(0xb2)]??undefined}),_0x470741=_0x288168[_0x3cfd98(0xac)]?await getDbName(_0x2babe8[_0x3cfd98(0xc6)],Number(_0x288168[_0x3cfd98(0xac)]))[_0x3cfd98(0x97)](()=>_0x1e6fa6[_0x3cfd98(0xc7)]):_0x1e6fa6[_0x3cfd98(0xc7)];_0x462efb[_0x3cfd98(0x94)][_0x49593a[_0x3cfd98(0xa4)]]={...buildSqlLockEntry(_0x288168,_0xcc449a,_0x15aba1,{'dbName':_0x470741}),'path':_0x49593a['relativePath'],'mode':_0x1cdc39[_0x3cfd98(0xc0)]},await archivePreviousSqlFileIfNeeded(_0x17569d,_0x1cdc39[_0x3cfd98(0x96)],_0x49593a[_0x3cfd98(0x95)]),_0x544c25['push']({'sqlCode':_0x49593a[_0x3cfd98(0xa4)],'remoteId':_0x1cdc39[_0x3cfd98(0xce)]});}catch(_0x534f34){_0xc58632[_0x3cfd98(0xa8)]({'sqlCode':_0x49593a['sqlCode'],'error':_0x534f34 instanceof Error?_0x534f34[_0x3cfd98(0x92)]:String(_0x534f34)});}}return _0x462efb[_0x3cfd98(0xc2)]=new Date()[_0x3cfd98(0xbb)](),await writeSqlLockFile(_0x17569d['lockFilePath'],_0x464e41),{'ok':_0xc58632[_0x3cfd98(0x9b)]===0x0,'data':{'pushed':_0x544c25,'skipped':_0x4e86c0,'failed':_0xc58632},'message':_0x3cfd98(0xa5)+_0x544c25[_0x3cfd98(0x9b)]+'\x20pushed,\x20'+_0x4e86c0[_0x3cfd98(0x9b)]+'\x20skipped,\x20'+_0xc58632['length']+_0x3cfd98(0xbf)};}};async function archivePreviousSqlFileIfNeeded(_0x69436a,_0x3350c2,_0x5c79f8){const _0x1fb4fd=a173_0x4314f0;if(!_0x3350c2||_0x3350c2===_0x5c79f8)return;const _0x3c5d91=join(_0x69436a['sqlRootDir'],_0x3350c2);if(!await fileExists(_0x3c5d91))return;const _0x2e2585=await moveToTrash(_0x69436a['projectRoot'],_0x69436a[_0x1fb4fd(0x93)],_0x3c5d91);await cleanupEmptyDirectories(dirname(_0x3c5d91),_0x69436a[_0x1fb4fd(0xa2)]),void _0x2e2585;}async function moveToTrash(_0x1ec126,_0x5e1fd8,_0x1a0a1b){const _0x468aee=a173_0x4314f0,_0x10ea94=new Date()[_0x468aee(0xbb)]()[_0x468aee(0xc1)](/[:.]/g,'-'),_0xf6b133=relative(_0x1ec126,_0x1a0a1b),_0x482611=join(_0x5e1fd8,_0x10ea94,_0xf6b133);return await mkdir(dirname(_0x482611),{'recursive':!![]}),await rename(_0x1a0a1b,_0x482611),_0x482611;}async function cleanupEmptyDirectories(_0x2c5ca5,_0x1f84c5){const _0x537fff=a173_0x4314f0;let _0xe684c5=resolve(_0x2c5ca5);const _0x15f571=resolve(_0x1f84c5);while(_0xe684c5[_0x537fff(0xb6)](''+_0x15f571+sep)||_0xe684c5===_0x15f571){if(_0xe684c5===_0x15f571)return;try{const _0x1fdd4b=await readdir(_0xe684c5);if(_0x1fdd4b['length']>0x0)return;await rmdir(_0xe684c5);}catch{return;}_0xe684c5=dirname(_0xe684c5);}}async function resolveTargetDbBinding(_0x530022,_0x56621d,_0x5824e0){const _0x568241=a173_0x4314f0,_0x3b5bcf=_0x56621d['dbDirectory'];if(!_0x3b5bcf)return{'dbId':_0x5824e0[_0x568241(0xac)],'dbName':_0x5824e0['dbName']};const _0x3f2d2b=buildDbDirectoryName(_0x5824e0[_0x568241(0xc7)],_0x5824e0[_0x568241(0xac)]);if(_0x3b5bcf===_0x3f2d2b)return{'dbId':_0x5824e0[_0x568241(0xac)],'dbName':_0x5824e0[_0x568241(0xc7)]};const _0x4e1ad7=parseExplicitDbDirectory(_0x3b5bcf);if(_0x4e1ad7!=null)return{'dbId':_0x4e1ad7,'dbName':await getDbName(_0x530022,_0x4e1ad7)['catch'](()=>undefined)};const _0x1b7844=await listDatabases(_0x530022),_0x11f95e=_0x1b7844[_0x568241(0xcc)](_0x445741=>buildDbDirectoryName(_0x445741[_0x568241(0xc7)],_0x445741['dbId'])===_0x3b5bcf);if(_0x11f95e[_0x568241(0x9b)]===0x1)return{'dbId':_0x11f95e[0x0][_0x568241(0xac)],'dbName':_0x11f95e[0x0][_0x568241(0xc7)]};if(_0x11f95e[_0x568241(0x9b)]===0x0)throw CliErrors['validation'](_0x568241(0xaa)+_0x3b5bcf+'\x22\x20for\x20sqlCode\x20'+_0x56621d['sqlCode']+'.');const _0x3aaf57=_0x11f95e['map'](_0x174014=>_0x174014[_0x568241(0xc7)]+'\x20('+_0x174014[_0x568241(0xac)]+')')[_0x568241(0x9e)](',\x20');throw CliErrors['validation'](_0x568241(0xa7)+_0x3b5bcf+_0x568241(0xbc)+_0x56621d[_0x568241(0xa4)]+':\x20'+_0x3aaf57);}function parseExplicitDbDirectory(_0x439e7c){const _0x2bc95c=a173_0x4314f0,_0xd9e1b0=/^db-(\d+)$/['exec'](_0x439e7c);if(!_0xd9e1b0)return null;const _0xe1e86c=Number(_0xd9e1b0[0x1]);return Number[_0x2bc95c(0x99)](_0xe1e86c)&&_0xe1e86c>0x0?_0xe1e86c:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a174_0x33c5(){const _0x10dc17=['6988192egPmwW','Update\x20existing\x20SQL\x20by\x20editing\x20the\x20synced\x20file\x20under\x20`.rabetbase/sql/<appCode>/<dbName|db-<id>>/`\x20and\x20then\x20running\x20`rabetbase\x20sql\x20push\x20--sqlcode\x20<code>\x20--yes`.','54703FTQvOz','540rmcllA','save','2944455bFmHlB','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','file','SQL\x20query\x20display\x20name','sqlname','5236sUvXDs','validation','4AyFEEY','write','10483587ryFrbT','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','Query\x20description','349eZxfuu','string','182395uoDewk','14SfsEhm','2091018opdLhi','join','Path\x20to\x20the\x20SQL\x20file'];a174_0x33c5=function(){return _0x10dc17;};return a174_0x33c5();}const a174_0xe7e1fb=a174_0x114c;(function(_0x2e4449,_0x1da81a){const _0x2ddf3b=a174_0x114c,_0x5ad2ef=_0x2e4449();while(!![]){try{const _0x10820a=-parseInt(_0x2ddf3b(0xd9))/0x1*(parseInt(_0x2ddf3b(0xd2))/0x2)+-parseInt(_0x2ddf3b(0xcd))/0x3+-parseInt(_0x2ddf3b(0xd4))/0x4*(-parseInt(_0x2ddf3b(0xdb))/0x5)+parseInt(_0x2ddf3b(0xdd))/0x6*(parseInt(_0x2ddf3b(0xdc))/0x7)+parseInt(_0x2ddf3b(0xe0))/0x8+parseInt(_0x2ddf3b(0xd6))/0x9+parseInt(_0x2ddf3b(0xcb))/0xa*(-parseInt(_0x2ddf3b(0xca))/0xb);if(_0x10820a===_0x1da81a)break;else _0x5ad2ef['push'](_0x5ad2ef['shift']());}catch(_0x1a04ce){_0x5ad2ef['push'](_0x5ad2ef['shift']());}}}(a174_0x33c5,0x9478f));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a174_0x114c(_0x50c0f0,_0x47eb04){_0x50c0f0=_0x50c0f0-0xc9;const _0x33c53f=a174_0x33c5();let _0x114c08=_0x33c53f[_0x50c0f0];return _0x114c08;}const SQL_SAVE_DEPRECATED_HINT=['`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.',a174_0xe7e1fb(0xce),a174_0xe7e1fb(0xc9)][a174_0xe7e1fb(0xde)]('\x0a');export const sqlSave={'service':'sql','command':a174_0xe7e1fb(0xcc),'description':a174_0xe7e1fb(0xd7),'risk':a174_0xe7e1fb(0xd5),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a174_0xe7e1fb(0xcf),'type':a174_0xe7e1fb(0xda),'required':!![],'description':a174_0xe7e1fb(0xdf)},SQLCODE_FLAG_OPTIONAL,{'name':a174_0xe7e1fb(0xd1),'type':a174_0xe7e1fb(0xda),'description':a174_0xe7e1fb(0xd0)},{'name':'db','type':a174_0xe7e1fb(0xda),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':'description','type':a174_0xe7e1fb(0xda),'description':a174_0xe7e1fb(0xd8)}],async 'validate'(){const _0x552186=a174_0xe7e1fb;throw CliErrors[_0x552186(0xd3)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a175_0x3440ac=a175_0x3cd9;(function(_0x5ebb57,_0x1f1414){const _0xf268a6=a175_0x3cd9,_0x455f72=_0x5ebb57();while(!![]){try{const _0x561af8=-parseInt(_0xf268a6(0x16b))/0x1+parseInt(_0xf268a6(0x17e))/0x2*(-parseInt(_0xf268a6(0x168))/0x3)+-parseInt(_0xf268a6(0x185))/0x4+-parseInt(_0xf268a6(0x17d))/0x5+-parseInt(_0xf268a6(0x16c))/0x6+parseInt(_0xf268a6(0x15d))/0x7+parseInt(_0xf268a6(0x173))/0x8;if(_0x561af8===_0x1f1414)break;else _0x455f72['push'](_0x455f72['shift']());}catch(_0x55868f){_0x455f72['push'](_0x455f72['shift']());}}}(a175_0x4312,0xe4f9f));import{createInterface}from'node:readline';import{join}from'node:path';function a175_0x4312(){const _0x1a7a31=['stderr','423513UyonqN','10703526KOPTGT','dbId','trim','sqls','split','filter','version','53097016czDoLu','close','fromEntries','sqlRoot','apps','--\x20@lovrabet.','sqlCode','sqlContent','join','includes','3702745EYbRNQ','1235246RzwXMm','dbName','yes','lastSync','length','\x20[y/N]\x20','endsWith','7058864Oplgpk','sqlName','mode','1740935jBSzGn','entries','toLowerCase','question','map','.rabetbase/sql','test','syncedAt','<!--\x20@lovrabet.','trimStart','\x20-->','6TwKluR','description'];a175_0x4312=function(){return _0x1a7a31;};return a175_0x4312();}import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a175_0x3440ac(0x162);export function buildSqlLockEntry(_0x968f9c,_0x5b6c4b,_0x74b7e9,_0x459a2f){const _0x118bb2=a175_0x3440ac,_0x427797=detectSqlMode(_0x5b6c4b);return{'path':buildSqlRelativePath(_0x968f9c['sqlCode'],_0x968f9c[_0x118bb2(0x186)],_0x459a2f?.[_0x118bb2(0x17f)],_0x427797,_0x968f9c[_0x118bb2(0x16d)]),'hash':_0x74b7e9,'remoteId':_0x968f9c['id'],'version':_0x968f9c[_0x118bb2(0x172)],'dbId':Number(_0x968f9c[_0x118bb2(0x16d)]),'dbName':_0x459a2f?.[_0x118bb2(0x17f)],'sqlName':_0x968f9c[_0x118bb2(0x186)],'sqlConfig':_0x968f9c['sqlConfig']??undefined,'mode':_0x427797};}export function cloneSqlLockData(_0xb05c15){const _0x14f3d6=a175_0x3440ac;return{'apps':Object[_0x14f3d6(0x175)](Object[_0x14f3d6(0x15e)](_0xb05c15['apps'])[_0x14f3d6(0x161)](([_0x47e22a,_0x1dc154])=>[_0x47e22a,{'sqlRoot':_0x1dc154[_0x14f3d6(0x176)],'lastSync':_0x1dc154[_0x14f3d6(0x181)],'sqls':{..._0x1dc154[_0x14f3d6(0x16f)]}}]))};}export function ensureRemoteSqlContent(_0x2e7698){const _0x260918=a175_0x3440ac;return _0x2e7698[_0x260918(0x17a)]??'';}export function buildLocalSqlFileContent(_0x3fd735,_0x91bab5,_0x1d6779){const _0x38b449=a175_0x3440ac,_0x4e3b40=_0x1d6779?.[_0x38b449(0x15c)]??detectSqlMode(_0x91bab5),_0x46a86d=stripLocalSqlMetadata(_0x91bab5,_0x4e3b40)['trim'](),_0x2e603d=[...buildMetadataHeaderLines({'sqlCode':_0x3fd735[_0x38b449(0x179)],'sqlName':_0x3fd735[_0x38b449(0x186)],'dbId':_0x3fd735[_0x38b449(0x16d)],'dbName':_0x1d6779?.[_0x38b449(0x17f)],'mode':_0x4e3b40,'syncedAt':_0x1d6779?.[_0x38b449(0x164)],'description':_0x1d6779?.[_0x38b449(0x169)]},_0x4e3b40),'',_0x46a86d],_0x434fc7=_0x2e603d[_0x38b449(0x17b)]('\x0a');return _0x434fc7[_0x38b449(0x184)]('\x0a')?_0x434fc7:_0x434fc7+'\x0a';}export function stripLocalSqlMetadata(_0x2e525d,_0x376e62){const _0x24a97f=a175_0x3440ac,_0x2f58c9=_0x2e525d['replace'](/\r\n/g,'\x0a')[_0x24a97f(0x170)]('\x0a'),_0xf61cb=[];let _0x55a1f7=0x0;if(_0x376e62==='mybatisXml')while(_0x55a1f7<_0x2f58c9[_0x24a97f(0x182)]){const _0x59f9ea=_0x2f58c9[_0x55a1f7]??'';if(/^\s*<!--\s*@lovrabet\./[_0x24a97f(0x163)](_0x59f9ea)){_0x55a1f7++;continue;}if(_0x59f9ea['trim']()===''&&_0x55a1f7>0x0){_0x55a1f7++;continue;}break;}else while(_0x55a1f7<_0x2f58c9[_0x24a97f(0x182)]){const _0x17ef1a=_0x2f58c9[_0x55a1f7]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x17ef1a)){_0x55a1f7++;continue;}if(_0x17ef1a[_0x24a97f(0x16e)]()===''&&_0x55a1f7>0x0){_0x55a1f7++;continue;}break;}for(;_0x55a1f7<_0x2f58c9['length'];_0x55a1f7++){_0xf61cb['push'](_0x2f58c9[_0x55a1f7]);}return _0xf61cb[_0x24a97f(0x17b)]('\x0a')[_0x24a97f(0x166)]();}export function resolveSqlMode(_0x484bd3,_0x2e8b83){const _0x4cdb55=a175_0x3440ac;if(_0x2e8b83?.[_0x4cdb55(0x15c)])return _0x2e8b83[_0x4cdb55(0x15c)];return detectSqlMode(_0x484bd3);}export function resolveSqlFileName(_0x168bc5,_0x52c909,_0x1c0024){const _0x5cf74f=a175_0x3440ac;if(_0x1c0024?.['path'])return _0x1c0024['path'];if(_0x1c0024?.[_0x5cf74f(0x186)]||_0x1c0024?.['dbName'])return buildSqlRelativePath(_0x168bc5,_0x1c0024?.[_0x5cf74f(0x186)],_0x1c0024?.['dbName'],resolveSqlMode(_0x52c909,_0x1c0024),_0x1c0024?.[_0x5cf74f(0x16d)]);return buildDefaultSqlFileName(_0x168bc5,resolveSqlMode(_0x52c909,_0x1c0024));}function a175_0x3cd9(_0x35d059,_0x1bff0f){_0x35d059=_0x35d059-0x15c;const _0x43127f=a175_0x4312();let _0x3cd962=_0x43127f[_0x35d059];return _0x3cd962;}export function resolveSqlLocalDir(_0x2a2f01,_0x15aeba){return join(_0x2a2f01,SQL_LOCAL_REL_DIR,_0x15aeba);}export async function confirmForceOverwrite(_0x735454){const _0x4097f7=a175_0x3440ac,_0x41864e=createInterface({'input':process['stdin'],'output':process[_0x4097f7(0x16a)]}),_0x305f2a=await new Promise(_0x2aa461=>{const _0x305ece=_0x4097f7;_0x41864e[_0x305ece(0x160)](_0x735454+_0x305ece(0x183),_0x2aa461);});return _0x41864e[_0x4097f7(0x174)](),['y',_0x4097f7(0x180)][_0x4097f7(0x17c)](_0x305f2a[_0x4097f7(0x16e)]()[_0x4097f7(0x15f)]());}export function findSqlLockScope(_0x39d010,_0x8e4e7f){const _0x364df=a175_0x3440ac;return _0x39d010[_0x364df(0x177)][_0x8e4e7f];}function buildMetadataHeaderLines(_0x1bd599,_0x3ceffc){const _0x2edf7e=a175_0x3440ac,_0x5a2f23=[[_0x2edf7e(0x179),_0x1bd599[_0x2edf7e(0x179)]],['sqlName',_0x1bd599['sqlName']],[_0x2edf7e(0x16d),_0x1bd599[_0x2edf7e(0x16d)]],[_0x2edf7e(0x17f),_0x1bd599[_0x2edf7e(0x17f)]],[_0x2edf7e(0x15c),_0x1bd599[_0x2edf7e(0x15c)]],[_0x2edf7e(0x164),_0x1bd599[_0x2edf7e(0x164)]],['description',_0x1bd599[_0x2edf7e(0x169)]]];if(_0x3ceffc==='mybatisXml')return _0x5a2f23[_0x2edf7e(0x171)](([,_0x35796a])=>_0x35796a!==undefined&&_0x35796a!==null&&String(_0x35796a)[_0x2edf7e(0x16e)]()!=='')[_0x2edf7e(0x161)](([_0x39dd31,_0x727a34])=>_0x2edf7e(0x165)+_0x39dd31+':\x20'+String(_0x727a34)+_0x2edf7e(0x167));return _0x5a2f23[_0x2edf7e(0x171)](([,_0x2d1e59])=>_0x2d1e59!==undefined&&_0x2d1e59!==null&&String(_0x2d1e59)[_0x2edf7e(0x16e)]()!=='')[_0x2edf7e(0x161)](([_0x7b2e88,_0x518c08])=>_0x2edf7e(0x178)+_0x7b2e88+':\x20'+String(_0x518c08));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a176_0x2e13d3=a176_0x5a5d;(function(_0xcf69e6,_0x615036){const _0x21f5a8=a176_0x5a5d,_0x35899b=_0xcf69e6();while(!![]){try{const _0x17c326=parseInt(_0x21f5a8(0x11c))/0x1+parseInt(_0x21f5a8(0x107))/0x2+-parseInt(_0x21f5a8(0x116))/0x3*(parseInt(_0x21f5a8(0x118))/0x4)+-parseInt(_0x21f5a8(0x111))/0x5+-parseInt(_0x21f5a8(0x10e))/0x6+-parseInt(_0x21f5a8(0x11d))/0x7*(-parseInt(_0x21f5a8(0x11a))/0x8)+-parseInt(_0x21f5a8(0xff))/0x9;if(_0x17c326===_0x615036)break;else _0x35899b['push'](_0x35899b['shift']());}catch(_0x4c6807){_0x35899b['push'](_0x35899b['shift']());}}}(a176_0x4ded,0xe0e1c));import{listSqlQueries}from'../../core/api-client.js';function a176_0x4ded(){const _0x122a13=['status','lockKey','sqlRoot','hash','has','2871056mLaeTH','\x20added,\x20','paging','totalCount','sql','path','keys','70452keaFtr','map','tableData','5099015jHOOJY','push','boolean','remote','length','1009284gDnZku','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','8xfgpOA','appCode','7541384tHjLFY','lockFilePath','758940vhKImw','7OjDTQg','\x20modified,\x20','sqls','bool','relativePath','sqlCode','sqlName','4604616hOzlDU','All\x20SQL\x20queries\x20are\x20in\x20sync.','\x20missing,\x20'];a176_0x4ded=function(){return _0x122a13;};return a176_0x4ded();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';function a176_0x5a5d(_0x2c5360,_0x3fc373){_0x2c5360=_0x2c5360-0xf9;const _0x4dedd7=a176_0x4ded();let _0x5a5d74=_0x4dedd7[_0x2c5360];return _0x5a5d74;}import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x1345e6){const _0x4e11c0=a176_0x5a5d,_0xc1cd41=[];let _0x33b164=0x1;while(!![]){const _0x4a0457=await listSqlQueries(_0x1345e6,{'currentPage':_0x33b164,'pageSize':PAGE_SIZE}),_0x5a9809=_0x4a0457[_0x4e11c0(0x110)]??[];_0xc1cd41[_0x4e11c0(0x112)](..._0x5a9809[_0x4e11c0(0x10f)](_0x47d424=>_0x47d424[_0x4e11c0(0xfd)]));if(_0x5a9809[_0x4e11c0(0x115)]===0x0)break;const _0x29787b=_0x4a0457[_0x4e11c0(0x109)]?.[_0x4e11c0(0x10a)];if(_0x29787b!=null?_0xc1cd41[_0x4e11c0(0x115)]>=_0x29787b:_0x5a9809[_0x4e11c0(0x115)]<PAGE_SIZE)break;_0x33b164++;}return _0xc1cd41;}export const sqlStatus={'service':a176_0x2e13d3(0x10b),'command':a176_0x2e13d3(0x102),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':'read','flags':[{'name':a176_0x2e13d3(0x114),'type':a176_0x2e13d3(0x113),'description':a176_0x2e13d3(0x117)}],async 'execute'(_0xc00c69){const _0x21414f=a176_0x2e13d3,_0x210ff6=loadSqlProjectConfig(_0xc00c69['appCode']),_0xe466db=await readSqlLockFile(_0x210ff6[_0x21414f(0x11b)]),{appLock:_0x400815}=ensureSqlLockScope(_0xe466db??createEmptySqlLock(),_0x210ff6[_0x21414f(0x119)],_0x210ff6[_0x21414f(0x104)],_0x21414f(0x102)),_0x3257e9=await scanLocalSqlQueries(_0x210ff6),_0x3ba6de=[],_0x15095d=[],_0x3354f0=[],_0x15fe0a=[],_0x56f638=new Set(_0x3257e9[_0x21414f(0x10f)](_0x4efbe2=>_0x4efbe2[_0x21414f(0x103)]));for(const _0x52b90a of _0x3257e9){const _0xd2fef2=await computeSqlFileHash(_0x52b90a['filePath']),_0x4022fb=_0x400815['sqls'][_0x52b90a[_0x21414f(0x103)]],_0x269d6d=!!_0x4022fb&&_0x4022fb[_0x21414f(0x10c)]!==_0x52b90a[_0x21414f(0xfc)],_0x184f91=!!_0x4022fb&&!!_0x52b90a['sqlName']&&_0x4022fb[_0x21414f(0xfe)]!==_0x52b90a[_0x21414f(0xfe)];if(!_0x4022fb)_0x3ba6de[_0x21414f(0x112)](_0x52b90a['lockKey']);else _0x4022fb[_0x21414f(0x105)]!==_0xd2fef2||_0x269d6d||_0x184f91?_0x15095d['push'](_0x52b90a['lockKey']):_0x3354f0[_0x21414f(0x112)](_0x52b90a[_0x21414f(0x103)]);}for(const _0x3b2dc3 of Object[_0x21414f(0x10d)](_0x400815[_0x21414f(0xfa)])){!_0x56f638['has'](_0x3b2dc3)&&_0x15fe0a['push'](_0x3b2dc3);}const _0x5107c1=[];if(_0xc00c69[_0x21414f(0xfb)](_0x21414f(0x114))){const _0x558e92=await fetchAllSqlCodes(_0xc00c69[_0x21414f(0x119)]);for(const _0x38a397 of _0x558e92){!_0x56f638[_0x21414f(0x106)](_0x38a397)&&!_0x400815['sqls'][_0x38a397]&&_0x5107c1[_0x21414f(0x112)](_0x38a397);}}const _0x51b68f=_0x3ba6de[_0x21414f(0x115)]===0x0&&_0x15095d[_0x21414f(0x115)]===0x0&&_0x15fe0a[_0x21414f(0x115)]===0x0&&_0x5107c1[_0x21414f(0x115)]===0x0;return{'ok':!![],'data':{'added':_0x3ba6de,'modified':_0x15095d,'missing':_0x15fe0a,'unchanged':_0x3354f0,'remoteOnly':_0x5107c1},'message':_0x51b68f?_0x21414f(0x100):_0x3ba6de['length']+_0x21414f(0x108)+_0x15095d['length']+_0x21414f(0xf9)+_0x15fe0a[_0x21414f(0x115)]+_0x21414f(0x101)+_0x3354f0['length']+'\x20unchanged'+(_0x5107c1[_0x21414f(0x115)]>0x0?',\x20'+_0x5107c1[_0x21414f(0x115)]+'\x20remote-only':'')};}};
|