@lovrabet/rabetbase-cli 2.1.10-beta.2 → 2.1.10-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/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/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.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-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-selector.js +1 -1
- package/lib/commands/common/flags.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/capability.js +1 -0
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/link-create.js +1 -1
- package/lib/commands/dataset/link-delete.js +1 -1
- package/lib/commands/dataset/link-shared.js +1 -1
- package/lib/commands/dataset/link-update.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.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/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.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/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/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/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/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/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.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/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.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-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/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/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 -2
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a121_0x45f068=a121_0x3871;(function(_0x47e0cb,_0x100182){const _0x4b31e4=a121_0x3871,_0x3481d1=_0x47e0cb();while(!![]){try{const _0x43137a=parseInt(_0x4b31e4(0x1d8))/0x1+-parseInt(_0x4b31e4(0x1d1))/0x2+-parseInt(_0x4b31e4(0x1c3))/0x3*(parseInt(_0x4b31e4(0x1fa))/0x4)+-parseInt(_0x4b31e4(0x1cb))/0x5+parseInt(_0x4b31e4(0x1f5))/0x6+parseInt(_0x4b31e4(0x1ef))/0x7*(-parseInt(_0x4b31e4(0x1be))/0x8)+parseInt(_0x4b31e4(0x1d0))/0x9;if(_0x43137a===_0x100182)break;else _0x3481d1['push'](_0x3481d1['shift']());}catch(_0x40f13a){_0x3481d1['push'](_0x3481d1['shift']());}}}(a121_0x5503,0x55b2d));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(_0x4ef742,_0x37dca9){const _0x58fc5e=a121_0x3871,_0x5496f9=[];let _0x17c51c=0x1;while(!![]){const _0x31be91=await listSqlQueries(_0x4ef742,{'currentPage':_0x17c51c,'pageSize':PAGE_SIZE,'sqlCode':_0x37dca9['sqlCode'],'sqlName':_0x37dca9[_0x58fc5e(0x1f1)]}),_0x55548e=_0x31be91[_0x58fc5e(0x1ca)]??[];_0x5496f9[_0x58fc5e(0x1dc)](..._0x55548e);if(_0x55548e[_0x58fc5e(0x1ee)]===0x0)break;const _0x45fecf=_0x31be91['paging']?.['totalCount'];if(_0x45fecf!=null?_0x5496f9['length']>=_0x45fecf:_0x55548e[_0x58fc5e(0x1ee)]<PAGE_SIZE)break;_0x17c51c++;}return _0x5496f9;}async function ensureSqlContent(_0x4eb5c8){const _0x540070=a121_0x3871;if(_0x4eb5c8[_0x540070(0x1c1)]!=null&&String(_0x4eb5c8[_0x540070(0x1c1)])[_0x540070(0x1ee)]>0x0)return _0x4eb5c8;return getSqlQueryDetail(_0x4eb5c8['sqlCode']);}function a121_0x3871(_0x4a2e79,_0x1f4052){_0x4a2e79=_0x4a2e79-0x1bd;const _0x550322=a121_0x5503();let _0x3871a8=_0x550322[_0x4a2e79];return _0x3871a8;}export const sqlPull={'service':a121_0x45f068(0x1c4),'command':a121_0x45f068(0x1e9),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a121_0x45f068(0x1e0),'type':a121_0x45f068(0x1e6),'description':a121_0x45f068(0x1cf)},{'name':a121_0x45f068(0x1d4),'type':a121_0x45f068(0x1db),'description':a121_0x45f068(0x1c6)}],async 'dryRun'(_0x40a5b3){const _0x4bd2d1=a121_0x45f068,_0x4a7f9b=loadSqlProjectConfig(_0x40a5b3['appCode']),_0x10824a=await readSqlLockFile(_0x4a7f9b[_0x4bd2d1(0x1f6)]),{appLock:_0x1337a9}=ensureSqlLockScope(_0x10824a??createEmptySqlLock(),_0x4a7f9b[_0x4bd2d1(0x1f9)],_0x4a7f9b[_0x4bd2d1(0x1c0)],'pull'),_0x47036d=await fetchAllSqlQueries(_0x40a5b3[_0x4bd2d1(0x1f9)],{'sqlCode':_0x40a5b3['str'](_0x4bd2d1(0x1bf))||undefined,'sqlName':_0x40a5b3['str'](_0x4bd2d1(0x1e0))||undefined}),_0x39d7b4=[];for(const _0x2948b8 of _0x47036d){const _0x1d810b=await ensureSqlContent(_0x2948b8),_0x59b18f=ensureRemoteSqlContent(_0x1d810b),_0x39dea4=detectModeFromSql(_0x1d810b),_0x292411=_0x1d810b['dbId']?await getDbName(_0x40a5b3[_0x4bd2d1(0x1f9)],Number(_0x1d810b[_0x4bd2d1(0x1eb)]))[_0x4bd2d1(0x1d3)](()=>undefined):undefined,_0x5b7ace=buildLocalSqlFileContent({'sqlCode':_0x1d810b[_0x4bd2d1(0x1c2)],'sqlName':_0x1d810b[_0x4bd2d1(0x1f1)],'dbId':_0x1d810b['dbId']},_0x59b18f,{'dbName':_0x292411,'mode':_0x39dea4,'syncedAt':new Date()[_0x4bd2d1(0x1d7)](),'description':_0x1d810b[_0x4bd2d1(0x1e1)]}),_0x42d511=buildSqlLockEntry(_0x1d810b,_0x59b18f,'',{'dbName':_0x292411}),_0x4004c9=resolveLocalSqlFilePath(_0x4a7f9b,_0x1d810b[_0x4bd2d1(0x1c2)],_0x42d511);let _0x58dc30=_0x4bd2d1(0x1ed),_0x34cb21;if(await fileExists(_0x4004c9)){const _0x5d462c=await readFile(_0x4004c9,'utf8');isEquivalentPulledSqlFile(_0x5d462c,_0x5b7ace,_0x39dea4)?(_0x58dc30=_0x4bd2d1(0x1df),_0x34cb21=_0x4bd2d1(0x1c8)):(_0x58dc30=_0x4bd2d1(0x1dd),_0x34cb21=_0x4bd2d1(0x1ea));}_0x39d7b4[_0x4bd2d1(0x1dc)]({'sqlCode':_0x1d810b['sqlCode'],'sqlName':_0x1d810b[_0x4bd2d1(0x1f1)],'filePath':_0x4004c9,'status':_0x58dc30,'reason':_0x34cb21});}return{'method':_0x4bd2d1(0x1f8),'url':_0x4bd2d1(0x1f0),'body':{'appCode':_0x40a5b3[_0x4bd2d1(0x1f9)],'sqlCode':_0x40a5b3[_0x4bd2d1(0x1ce)](_0x4bd2d1(0x1bf))||null,'sqlName':_0x40a5b3['str'](_0x4bd2d1(0x1e0))||null,'files':_0x39d7b4},'description':'Would\x20pull\x20'+_0x39d7b4[_0x4bd2d1(0x1ee)]+_0x4bd2d1(0x1e2)+_0x4a7f9b['sqlRootDir']};},async 'execute'(_0x4fcb7f){const _0x131105=a121_0x45f068,_0x364d86=loadSqlProjectConfig(_0x4fcb7f[_0x131105(0x1f9)]),_0x1d4e17=await readSqlLockFile(_0x364d86['lockFilePath']),{lockData:_0x3558c4,appLock:_0x8bed3b}=ensureSqlLockScope(_0x1d4e17??createEmptySqlLock(),_0x364d86[_0x131105(0x1f9)],_0x364d86[_0x131105(0x1c0)],_0x131105(0x1e9)),_0xcc31c1=_0x4fcb7f['bool'](_0x131105(0x1d4)),_0x487b61=await fetchAllSqlQueries(_0x4fcb7f[_0x131105(0x1f9)],{'sqlCode':_0x4fcb7f['str'](_0x131105(0x1bf))||undefined,'sqlName':_0x4fcb7f['str'](_0x131105(0x1e0))||undefined});if(_0x487b61['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x19fdd8=[],_0x39eeec=[];for(const _0x45328e of _0x487b61){try{_0x19fdd8['push'](await ensureSqlContent(_0x45328e));}catch(_0x59cc5e){_0x39eeec[_0x131105(0x1dc)]({'sqlCode':_0x45328e[_0x131105(0x1c2)],'error':_0x59cc5e instanceof Error?_0x59cc5e[_0x131105(0x1e8)]:String(_0x59cc5e)});}}if(_0xcc31c1&&!_0x4fcb7f[_0x131105(0x1d9)]){let _0x198567=![];for(const _0x358942 of _0x19fdd8){const _0x49ce7=detectModeFromSql(_0x358942),_0x212e0c=_0x358942[_0x131105(0x1eb)]?await getDbName(_0x4fcb7f['appCode'],Number(_0x358942['dbId']))[_0x131105(0x1d3)](()=>undefined):undefined,_0x45fd7d=buildLocalSqlFileContent({'sqlCode':_0x358942[_0x131105(0x1c2)],'sqlName':_0x358942[_0x131105(0x1f1)],'dbId':_0x358942['dbId']},ensureRemoteSqlContent(_0x358942),{'dbName':_0x212e0c,'mode':_0x49ce7,'syncedAt':new Date()['toISOString'](),'description':_0x358942[_0x131105(0x1e1)]}),_0x56afe1=resolveLocalSqlFilePath(_0x364d86,_0x358942[_0x131105(0x1c2)],buildSqlLockEntry(_0x358942,ensureRemoteSqlContent(_0x358942),'',{'dbName':_0x212e0c}));if(await fileExists(_0x56afe1)){const _0x506804=await readFile(_0x56afe1,_0x131105(0x1c7));if(!isEquivalentPulledSqlFile(_0x506804,_0x45fd7d,_0x49ce7)){_0x198567=!![];break;}}}if(_0x198567){const _0x2128be=await confirmForceOverwrite(_0x131105(0x1d2));if(!_0x2128be)throw CliErrors[_0x131105(0x1f2)](_0x131105(0x1fb));}}const _0x40e0a7=cloneSqlLockData(_0x3558c4),_0x8d3890=_0x40e0a7[_0x131105(0x1c9)][_0x364d86['appCode']],_0x34bd14=[],_0x223a12=[];for(const _0xa525bd of _0x19fdd8){const _0x203718=_0x8d3890[_0x131105(0x1c5)][_0xa525bd[_0x131105(0x1c2)]],_0x5c6ec2=ensureRemoteSqlContent(_0xa525bd),_0x3c9b05=detectModeFromSql(_0xa525bd),_0x282cae=_0xa525bd[_0x131105(0x1eb)]?await getDbName(_0x4fcb7f[_0x131105(0x1f9)],Number(_0xa525bd[_0x131105(0x1eb)]))[_0x131105(0x1d3)](()=>undefined):undefined,_0x33adc2=buildLocalSqlFileContent({'sqlCode':_0xa525bd['sqlCode'],'sqlName':_0xa525bd[_0x131105(0x1f1)],'dbId':_0xa525bd[_0x131105(0x1eb)]},_0x5c6ec2,{'dbName':_0x282cae,'mode':_0x3c9b05,'syncedAt':new Date()[_0x131105(0x1d7)](),'description':_0xa525bd['description']}),_0x13687e=buildSqlLockEntry(_0xa525bd,_0x5c6ec2,computeSqlContentHash(_0x33adc2),{'dbName':_0x282cae}),_0x1000db=_0x13687e[_0x131105(0x1d6)],_0xd53fba=join(_0x364d86[_0x131105(0x1f7)],_0x1000db);try{if(await fileExists(_0xd53fba)){const _0xa2e28f=await readFile(_0xd53fba,'utf8');if(isEquivalentPulledSqlFile(_0xa2e28f,_0x33adc2,_0x3c9b05)){_0x223a12[_0x131105(0x1dc)]({'sqlCode':_0xa525bd[_0x131105(0x1c2)],'reason':_0x131105(0x1c8)}),_0x8d3890['sqls'][_0xa525bd[_0x131105(0x1c2)]]={..._0x13687e,'hash':computeSqlContentHash(_0xa2e28f),'path':_0x1000db};continue;}if(!_0xcc31c1){_0x223a12['push']({'sqlCode':_0xa525bd['sqlCode'],'reason':_0x131105(0x1cc)});continue;}}const _0x29c60f=_0x203718?.[_0x131105(0x1d6)]?join(_0x364d86[_0x131105(0x1f7)],_0x203718[_0x131105(0x1d6)]):undefined;_0x29c60f&&_0x29c60f!==_0xd53fba&&await fileExists(_0x29c60f)&&await rm(_0x29c60f,{'force':!![]}),await ensureParentDirectory(_0xd53fba),await writeFile(_0xd53fba,_0x33adc2,_0x131105(0x1c7)),_0x8d3890[_0x131105(0x1c5)][_0xa525bd[_0x131105(0x1c2)]]={..._0x13687e,'path':_0x1000db},_0x34bd14[_0x131105(0x1dc)]({'sqlCode':_0xa525bd[_0x131105(0x1c2)],'filePath':_0xd53fba});}catch(_0x7cdb35){_0x39eeec['push']({'sqlCode':_0xa525bd[_0x131105(0x1c2)],'error':_0x7cdb35 instanceof Error?_0x7cdb35['message']:String(_0x7cdb35)});}}return _0x8d3890[_0x131105(0x1cd)]=new Date()[_0x131105(0x1d7)](),await writeSqlLockFile(_0x364d86[_0x131105(0x1f6)],_0x40e0a7),{'ok':_0x39eeec['length']===0x0,'data':{'pulled':_0x34bd14,'skipped':_0x223a12,'failed':_0x39eeec},'message':_0x131105(0x1f3)+_0x34bd14[_0x131105(0x1ee)]+_0x131105(0x1e4)+_0x223a12[_0x131105(0x1ee)]+_0x131105(0x1ec)+_0x39eeec['length']+_0x131105(0x1bd)};}};function detectModeFromSql(_0xd5d92e){const _0x15890=a121_0x45f068,_0x13b902=ensureRemoteSqlContent(_0xd5d92e),_0x212983=stripLocalSqlMetadata(_0x13b902,'mybatisXml')[_0x15890(0x1e7)]();if(/^<(select|insert|update|delete)\b/i[_0x15890(0x1e5)](_0x212983))return _0x15890(0x1de);return _0x15890(0x1c4);}function isEquivalentPulledSqlFile(_0x75d79a,_0x383db1,_0x1fb67d){return normalizePullComparableContent(_0x75d79a,_0x1fb67d)===normalizePullComparableContent(_0x383db1,_0x1fb67d);}function normalizePullComparableContent(_0x5258a7,_0x34c593){const _0x53d020=a121_0x45f068,_0x48bbec=_0x5258a7[_0x53d020(0x1f4)](/\r\n/g,'\x0a')[_0x53d020(0x1e3)]('\x0a'),_0x577147=_0x48bbec[_0x53d020(0x1da)](_0x349b7f=>!isSyncedAtMetadataLine(_0x349b7f,_0x34c593));return _0x577147[_0x53d020(0x1d5)]('\x0a');}function a121_0x5503(){const _0x56cfc1=['sql','sqls','Force\x20overwrite\x20local\x20unsynced\x20changes','utf8','unchanged','apps','tableData','1296445iqTCbW','local\x20differs\x20from\x20remote','lastSync','str','Filter\x20by\x20SQL\x20display\x20name','11605320CLjrTC','386860bsKpLQ','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','catch','force','join','path','toISOString','77394VOlEVi','nonInteractive','filter','boolean','push','conflict','mybatisXml','skipped','name','description','\x20SQL\x20file(s)\x20into\x20','split','\x20written,\x20','test','string','trimStart','message','pull','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','dbId','\x20skipped,\x20','would_pull','length','679392pVyGEd','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqlName','cancelled','Pull\x20complete:\x20','replace','74214eeqAxi','lockFilePath','sqlRootDir','POST','appCode','51556wMvmVa','Force\x20pull\x20cancelled.','\x20failed','40EbKoHo','sqlcode','sqlRoot','sqlContent','sqlCode','21FGGYua'];a121_0x5503=function(){return _0x56cfc1;};return a121_0x5503();}function isSyncedAtMetadataLine(_0x580699,_0x33a240){const _0x12c531=a121_0x45f068;if(_0x33a240===_0x12c531(0x1de))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x12c531(0x1e5)](_0x580699);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x12c531(0x1e5)](_0x580699);}
|
|
1
|
+
const a122_0x528b0b=a122_0x3d1c;(function(_0x333f13,_0x44a934){const _0x5dc0c4=a122_0x3d1c,_0x5e2121=_0x333f13();while(!![]){try{const _0x11e228=-parseInt(_0x5dc0c4(0x1f9))/0x1+-parseInt(_0x5dc0c4(0x1fe))/0x2*(-parseInt(_0x5dc0c4(0x1d5))/0x3)+parseInt(_0x5dc0c4(0x1db))/0x4+parseInt(_0x5dc0c4(0x1e3))/0x5+-parseInt(_0x5dc0c4(0x1cc))/0x6*(-parseInt(_0x5dc0c4(0x1f8))/0x7)+-parseInt(_0x5dc0c4(0x1d2))/0x8+parseInt(_0x5dc0c4(0x1d1))/0x9;if(_0x11e228===_0x44a934)break;else _0x5e2121['push'](_0x5e2121['shift']());}catch(_0x20f0c4){_0x5e2121['push'](_0x5e2121['shift']());}}}(a122_0x4539,0x59440));function a122_0x4539(){const _0x2d1028=['sql','split','pull','\x20skipped,\x20','sqls','filter','Pull\x20complete:\x20','56MubKyV','679717JqocFl','POST','skipped','length','replace','72922AeOeXt','\x20SQL\x20file(s)\x20into\x20','apps','name','path','description','catch','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','toISOString','149892RxUwzA','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sqlRootDir','string','test','130509nEsomU','1550696QflBXg','message','utf8','45SpRzpJ','Filter\x20by\x20SQL\x20display\x20name','sqlContent','force','sqlcode','str','72692aiKDWi','push','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','mybatisXml','conflict','sqlCode','sqlName','Would\x20pull\x20','2298705lAyNtG','lastSync','nonInteractive','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','dbId','No\x20remote\x20SQL\x20queries\x20matched.','boolean','unchanged','paging','local\x20differs\x20from\x20remote','sqlRoot','lockFilePath','bool','appCode'];a122_0x4539=function(){return _0x2d1028;};return a122_0x4539();}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(_0x5b5e5e,_0x1e89bc){const _0x493241=a122_0x3d1c,_0x3d2e3a=[];let _0x4138ad=0x1;while(!![]){const _0xaae542=await listSqlQueries(_0x5b5e5e,{'currentPage':_0x4138ad,'pageSize':PAGE_SIZE,'sqlCode':_0x1e89bc['sqlCode'],'sqlName':_0x1e89bc[_0x493241(0x1e1)]}),_0x2bb5cd=_0xaae542['tableData']??[];_0x3d2e3a[_0x493241(0x1dc)](..._0x2bb5cd);if(_0x2bb5cd[_0x493241(0x1fc)]===0x0)break;const _0x4f7b1e=_0xaae542[_0x493241(0x1eb)]?.['totalCount'];if(_0x4f7b1e!=null?_0x3d2e3a['length']>=_0x4f7b1e:_0x2bb5cd[_0x493241(0x1fc)]<PAGE_SIZE)break;_0x4138ad++;}return _0x3d2e3a;}async function ensureSqlContent(_0x43f62a){const _0x286ccd=a122_0x3d1c;if(_0x43f62a[_0x286ccd(0x1d7)]!=null&&String(_0x43f62a[_0x286ccd(0x1d7)])[_0x286ccd(0x1fc)]>0x0)return _0x43f62a;return getSqlQueryDetail(_0x43f62a[_0x286ccd(0x1e0)]);}export const sqlPull={'service':a122_0x528b0b(0x1f1),'command':'pull','description':a122_0x528b0b(0x1ca),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a122_0x528b0b(0x1c6),'type':a122_0x528b0b(0x1cf),'description':a122_0x528b0b(0x1d6)},{'name':a122_0x528b0b(0x1d8),'type':a122_0x528b0b(0x1e9),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0xb3a46e){const _0x50c576=a122_0x528b0b,_0x185002=loadSqlProjectConfig(_0xb3a46e[_0x50c576(0x1f0)]),_0x1668b=await readSqlLockFile(_0x185002['lockFilePath']),{appLock:_0x29982e}=ensureSqlLockScope(_0x1668b??createEmptySqlLock(),_0x185002[_0x50c576(0x1f0)],_0x185002['sqlRoot'],_0x50c576(0x1f3)),_0xf613c5=await fetchAllSqlQueries(_0xb3a46e['appCode'],{'sqlCode':_0xb3a46e[_0x50c576(0x1da)](_0x50c576(0x1d9))||undefined,'sqlName':_0xb3a46e['str']('name')||undefined}),_0x5b615c=[];for(const _0x3b943b of _0xf613c5){const _0x4951b0=await ensureSqlContent(_0x3b943b),_0x1f6f1a=ensureRemoteSqlContent(_0x4951b0),_0x10b2b0=detectModeFromSql(_0x4951b0),_0x23c2ce=_0x4951b0[_0x50c576(0x1e7)]?await getDbName(_0xb3a46e['appCode'],Number(_0x4951b0[_0x50c576(0x1e7)]))['catch'](()=>undefined):undefined,_0x146f39=buildLocalSqlFileContent({'sqlCode':_0x4951b0[_0x50c576(0x1e0)],'sqlName':_0x4951b0[_0x50c576(0x1e1)],'dbId':_0x4951b0[_0x50c576(0x1e7)]},_0x1f6f1a,{'dbName':_0x23c2ce,'mode':_0x10b2b0,'syncedAt':new Date()[_0x50c576(0x1cb)](),'description':_0x4951b0[_0x50c576(0x1c8)]}),_0x56fe4b=buildSqlLockEntry(_0x4951b0,_0x1f6f1a,'',{'dbName':_0x23c2ce}),_0x179962=resolveLocalSqlFilePath(_0x185002,_0x4951b0[_0x50c576(0x1e0)],_0x56fe4b);let _0x1d9386='would_pull',_0x55d0da;if(await fileExists(_0x179962)){const _0x36f623=await readFile(_0x179962,_0x50c576(0x1d4));isEquivalentPulledSqlFile(_0x36f623,_0x146f39,_0x10b2b0)?(_0x1d9386=_0x50c576(0x1fb),_0x55d0da=_0x50c576(0x1ea)):(_0x1d9386=_0x50c576(0x1df),_0x55d0da=_0x50c576(0x1cd));}_0x5b615c['push']({'sqlCode':_0x4951b0[_0x50c576(0x1e0)],'sqlName':_0x4951b0[_0x50c576(0x1e1)],'filePath':_0x179962,'status':_0x1d9386,'reason':_0x55d0da});}return{'method':_0x50c576(0x1fa),'url':_0x50c576(0x1dd),'body':{'appCode':_0xb3a46e['appCode'],'sqlCode':_0xb3a46e[_0x50c576(0x1da)](_0x50c576(0x1d9))||null,'sqlName':_0xb3a46e[_0x50c576(0x1da)](_0x50c576(0x1c6))||null,'files':_0x5b615c},'description':_0x50c576(0x1e2)+_0x5b615c[_0x50c576(0x1fc)]+_0x50c576(0x1ff)+_0x185002['sqlRootDir']};},async 'execute'(_0x502b4f){const _0x5348d2=a122_0x528b0b,_0x5c3574=loadSqlProjectConfig(_0x502b4f[_0x5348d2(0x1f0)]),_0x49262d=await readSqlLockFile(_0x5c3574[_0x5348d2(0x1ee)]),{lockData:_0x3fbeb6,appLock:_0x2ed3e7}=ensureSqlLockScope(_0x49262d??createEmptySqlLock(),_0x5c3574[_0x5348d2(0x1f0)],_0x5c3574[_0x5348d2(0x1ed)],_0x5348d2(0x1f3)),_0x5d3797=_0x502b4f[_0x5348d2(0x1ef)](_0x5348d2(0x1d8)),_0xbe51bc=await fetchAllSqlQueries(_0x502b4f['appCode'],{'sqlCode':_0x502b4f[_0x5348d2(0x1da)]('sqlcode')||undefined,'sqlName':_0x502b4f[_0x5348d2(0x1da)]('name')||undefined});if(_0xbe51bc[_0x5348d2(0x1fc)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x5348d2(0x1e8)};const _0x1d1a94=[],_0x509e75=[];for(const _0x48d092 of _0xbe51bc){try{_0x1d1a94[_0x5348d2(0x1dc)](await ensureSqlContent(_0x48d092));}catch(_0x49b2ba){_0x509e75['push']({'sqlCode':_0x48d092[_0x5348d2(0x1e0)],'error':_0x49b2ba instanceof Error?_0x49b2ba['message']:String(_0x49b2ba)});}}if(_0x5d3797&&!_0x502b4f[_0x5348d2(0x1e5)]){let _0x2525c6=![];for(const _0x3ac947 of _0x1d1a94){const _0x15930f=detectModeFromSql(_0x3ac947),_0x1ed84c=_0x3ac947['dbId']?await getDbName(_0x502b4f[_0x5348d2(0x1f0)],Number(_0x3ac947['dbId']))[_0x5348d2(0x1c9)](()=>undefined):undefined,_0x1f90cd=buildLocalSqlFileContent({'sqlCode':_0x3ac947['sqlCode'],'sqlName':_0x3ac947[_0x5348d2(0x1e1)],'dbId':_0x3ac947[_0x5348d2(0x1e7)]},ensureRemoteSqlContent(_0x3ac947),{'dbName':_0x1ed84c,'mode':_0x15930f,'syncedAt':new Date()[_0x5348d2(0x1cb)](),'description':_0x3ac947[_0x5348d2(0x1c8)]}),_0x28ae2b=resolveLocalSqlFilePath(_0x5c3574,_0x3ac947[_0x5348d2(0x1e0)],buildSqlLockEntry(_0x3ac947,ensureRemoteSqlContent(_0x3ac947),'',{'dbName':_0x1ed84c}));if(await fileExists(_0x28ae2b)){const _0x483891=await readFile(_0x28ae2b,_0x5348d2(0x1d4));if(!isEquivalentPulledSqlFile(_0x483891,_0x1f90cd,_0x15930f)){_0x2525c6=!![];break;}}}if(_0x2525c6){const _0x5ddf2f=await confirmForceOverwrite(_0x5348d2(0x1e6));if(!_0x5ddf2f)throw CliErrors['cancelled']('Force\x20pull\x20cancelled.');}}const _0x490b08=cloneSqlLockData(_0x3fbeb6),_0x5253db=_0x490b08[_0x5348d2(0x200)][_0x5c3574['appCode']],_0x372e32=[],_0x4a8ab2=[];for(const _0x1fc415 of _0x1d1a94){const _0x44b248=_0x5253db[_0x5348d2(0x1f5)][_0x1fc415[_0x5348d2(0x1e0)]],_0x17c8dc=ensureRemoteSqlContent(_0x1fc415),_0x3fb61f=detectModeFromSql(_0x1fc415),_0x3c48cb=_0x1fc415[_0x5348d2(0x1e7)]?await getDbName(_0x502b4f[_0x5348d2(0x1f0)],Number(_0x1fc415[_0x5348d2(0x1e7)]))[_0x5348d2(0x1c9)](()=>undefined):undefined,_0x20e310=buildLocalSqlFileContent({'sqlCode':_0x1fc415['sqlCode'],'sqlName':_0x1fc415[_0x5348d2(0x1e1)],'dbId':_0x1fc415[_0x5348d2(0x1e7)]},_0x17c8dc,{'dbName':_0x3c48cb,'mode':_0x3fb61f,'syncedAt':new Date()[_0x5348d2(0x1cb)](),'description':_0x1fc415[_0x5348d2(0x1c8)]}),_0x516ecc=buildSqlLockEntry(_0x1fc415,_0x17c8dc,computeSqlContentHash(_0x20e310),{'dbName':_0x3c48cb}),_0xbb4eb0=_0x516ecc[_0x5348d2(0x1c7)],_0x2f1473=join(_0x5c3574[_0x5348d2(0x1ce)],_0xbb4eb0);try{if(await fileExists(_0x2f1473)){const _0x155d79=await readFile(_0x2f1473,_0x5348d2(0x1d4));if(isEquivalentPulledSqlFile(_0x155d79,_0x20e310,_0x3fb61f)){_0x4a8ab2[_0x5348d2(0x1dc)]({'sqlCode':_0x1fc415[_0x5348d2(0x1e0)],'reason':_0x5348d2(0x1ea)}),_0x5253db[_0x5348d2(0x1f5)][_0x1fc415['sqlCode']]={..._0x516ecc,'hash':computeSqlContentHash(_0x155d79),'path':_0xbb4eb0};continue;}if(!_0x5d3797){_0x4a8ab2[_0x5348d2(0x1dc)]({'sqlCode':_0x1fc415[_0x5348d2(0x1e0)],'reason':_0x5348d2(0x1ec)});continue;}}const _0x159bee=_0x44b248?.['path']?join(_0x5c3574[_0x5348d2(0x1ce)],_0x44b248[_0x5348d2(0x1c7)]):undefined;_0x159bee&&_0x159bee!==_0x2f1473&&await fileExists(_0x159bee)&&await rm(_0x159bee,{'force':!![]}),await ensureParentDirectory(_0x2f1473),await writeFile(_0x2f1473,_0x20e310,_0x5348d2(0x1d4)),_0x5253db[_0x5348d2(0x1f5)][_0x1fc415['sqlCode']]={..._0x516ecc,'path':_0xbb4eb0},_0x372e32[_0x5348d2(0x1dc)]({'sqlCode':_0x1fc415[_0x5348d2(0x1e0)],'filePath':_0x2f1473});}catch(_0x5305c4){_0x509e75[_0x5348d2(0x1dc)]({'sqlCode':_0x1fc415[_0x5348d2(0x1e0)],'error':_0x5305c4 instanceof Error?_0x5305c4[_0x5348d2(0x1d3)]:String(_0x5305c4)});}}return _0x5253db[_0x5348d2(0x1e4)]=new Date()[_0x5348d2(0x1cb)](),await writeSqlLockFile(_0x5c3574['lockFilePath'],_0x490b08),{'ok':_0x509e75['length']===0x0,'data':{'pulled':_0x372e32,'skipped':_0x4a8ab2,'failed':_0x509e75},'message':_0x5348d2(0x1f7)+_0x372e32[_0x5348d2(0x1fc)]+'\x20written,\x20'+_0x4a8ab2[_0x5348d2(0x1fc)]+_0x5348d2(0x1f4)+_0x509e75[_0x5348d2(0x1fc)]+'\x20failed'};}};function detectModeFromSql(_0x1e50d6){const _0x2d81dd=a122_0x528b0b,_0x273b9f=ensureRemoteSqlContent(_0x1e50d6),_0x302c51=stripLocalSqlMetadata(_0x273b9f,_0x2d81dd(0x1de))['trimStart']();if(/^<(select|insert|update|delete)\b/i['test'](_0x302c51))return _0x2d81dd(0x1de);return _0x2d81dd(0x1f1);}function a122_0x3d1c(_0x14d81f,_0x56fe4b){_0x14d81f=_0x14d81f-0x1c6;const _0x45394f=a122_0x4539();let _0x3d1cb3=_0x45394f[_0x14d81f];return _0x3d1cb3;}function isEquivalentPulledSqlFile(_0x3897b6,_0x183ef8,_0x233770){return normalizePullComparableContent(_0x3897b6,_0x233770)===normalizePullComparableContent(_0x183ef8,_0x233770);}function normalizePullComparableContent(_0x581ded,_0x41b23c){const _0x486c8e=a122_0x528b0b,_0x3447e5=_0x581ded[_0x486c8e(0x1fd)](/\r\n/g,'\x0a')[_0x486c8e(0x1f2)]('\x0a'),_0xe8fa15=_0x3447e5[_0x486c8e(0x1f6)](_0x4b060c=>!isSyncedAtMetadataLine(_0x4b060c,_0x41b23c));return _0xe8fa15['join']('\x0a');}function isSyncedAtMetadataLine(_0x14460f,_0x587c09){const _0x4944a8=a122_0x528b0b;if(_0x587c09==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x4944a8(0x1d0)](_0x14460f);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x4944a8(0x1d0)](_0x14460f);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a122_0x1d17ce=a122_0x2ed9;(function(_0x54bd38,_0x3df456){const _0x348156=a122_0x2ed9,_0x598fdd=_0x54bd38();while(!![]){try{const _0xa7041a=-parseInt(_0x348156(0x17f))/0x1*(-parseInt(_0x348156(0x18c))/0x2)+parseInt(_0x348156(0x180))/0x3+-parseInt(_0x348156(0x1a8))/0x4*(parseInt(_0x348156(0x173))/0x5)+parseInt(_0x348156(0x171))/0x6+-parseInt(_0x348156(0x17d))/0x7+parseInt(_0x348156(0x1b0))/0x8*(parseInt(_0x348156(0x177))/0x9)+-parseInt(_0x348156(0x1ae))/0xa;if(_0xa7041a===_0x3df456)break;else _0x598fdd['push'](_0x598fdd['shift']());}catch(_0x21062a){_0x598fdd['push'](_0x598fdd['shift']());}}}(a122_0x1578,0x9b3e7));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';function a122_0x2ed9(_0x1f4dde,_0x25c482){_0x1f4dde=_0x1f4dde-0x171;const _0x157856=a122_0x1578();let _0x2ed9ba=_0x157856[_0x1f4dde];return _0x2ed9ba;}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';function a122_0x1578(){const _0x1fb071=['exec','2KOnCql','sqlcode','/smartapi/custom/updateUserCustomSql','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','Push\x20complete:\x20','lockFilePath','dbDirectory','dbName','filePath','get','\x20skipped,\x20','entries','force','utf8','sql','sqlCode','\x20SQL\x20file(s)','boolean','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','hash','catch','Push\x20local\x20SQL\x20files\x20to\x20remote','Would\x20push\x20','Local\x20SQL\x20not\x20found:\x20','push','sqlConfig','sqlName','\x20pushed,\x20','268hrVzhx','POST','version','\x22\x20for\x20sqlCode\x20','mode','length','1790490DeutmS','validation','8GNIdga','relativePath','lastSync','filter','5515548ujRrLA','No\x20database\x20matches\x20local\x20directory\x20\x22','90860jRTalA','sqlRoot','join','path','1023525YmJeNN','map','str','sqls','isFinite','trashDir','358064PVzvyP','projectRoot','747596zQoXck','909075xHZsBd','set','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','has','dbId','appCode','bool','Local\x20directory\x20\x22','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','remoteId','toISOString'];a122_0x1578=function(){return _0x1fb071;};return a122_0x1578();}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(_0x4541ca,_0x1e6ac9,_0x80a1c1){const _0x53b85d=a122_0x2ed9,_0x5921b0=await scanLocalSqlQueries(_0x4541ca),_0x213960=new Map();for(const _0x4fc439 of _0x5921b0){if(_0x80a1c1&&_0x4fc439[_0x53b85d(0x19b)]!==_0x80a1c1)continue;const _0x11be9a=_0x213960[_0x53b85d(0x195)](_0x4fc439[_0x53b85d(0x19b)])??[];_0x11be9a[_0x53b85d(0x1a4)](_0x4fc439),_0x213960[_0x53b85d(0x181)](_0x4fc439[_0x53b85d(0x19b)],_0x11be9a);}if(_0x80a1c1&&!_0x213960[_0x53b85d(0x183)](_0x80a1c1))throw CliErrors[_0x53b85d(0x1af)](_0x53b85d(0x1a3)+_0x80a1c1);const _0x481047=[];for(const [_0x241dbf,_0x1b2b87]of _0x213960[_0x53b85d(0x197)]()){if(_0x1b2b87[_0x53b85d(0x1ad)]===0x1){_0x481047[_0x53b85d(0x1a4)](_0x1b2b87[0x0]);continue;}const _0x2fa8ce=_0x1e6ac9[_0x53b85d(0x17a)][_0x241dbf],_0x12022f=_0x2fa8ce?.[_0x53b85d(0x176)],_0x398c0a=_0x12022f?_0x1b2b87[_0x53b85d(0x1b3)](_0xa01104=>_0xa01104[_0x53b85d(0x1b1)]!==_0x12022f):_0x1b2b87;if(_0x2fa8ce&&_0x398c0a[_0x53b85d(0x1ad)]===0x1){_0x481047[_0x53b85d(0x1a4)](_0x398c0a[0x0]);continue;}throw CliErrors[_0x53b85d(0x1af)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x241dbf+_0x53b85d(0x18f));}return _0x481047;}export const sqlPush={'service':a122_0x1d17ce(0x19a),'command':a122_0x1d17ce(0x1a4),'description':a122_0x1d17ce(0x1a1),'risk':'high-risk-write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a122_0x1d17ce(0x19d),'description':a122_0x1d17ce(0x19e)}],async 'dryRun'(_0x4777f8){const _0x526c5d=a122_0x1d17ce,_0x3843a9=loadSqlProjectConfig(_0x4777f8[_0x526c5d(0x185)]),_0x215202=await readSqlLockFile(_0x3843a9[_0x526c5d(0x191)]),{appLock:_0x451546}=ensureSqlLockScope(_0x215202??createEmptySqlLock(),_0x4777f8[_0x526c5d(0x185)],_0x3843a9[_0x526c5d(0x174)],'push'),_0xfe2346=await getTargetSqlQueries(_0x3843a9,_0x451546,_0x4777f8[_0x526c5d(0x179)](_0x526c5d(0x18d))||undefined),_0x55f317=[];for(const _0x104506 of _0xfe2346){const _0x2a22a7=await computeSqlFileHash(_0x104506[_0x526c5d(0x194)]),_0x26fe9b=_0x451546[_0x526c5d(0x17a)][_0x104506[_0x526c5d(0x19b)]],_0x42bb07=!!_0x26fe9b&&(_0x26fe9b[_0x526c5d(0x176)]!==_0x104506[_0x526c5d(0x1b1)]||!!_0x104506['sqlName']&&_0x26fe9b[_0x526c5d(0x1a6)]!==_0x104506['sqlName']);if(!_0x4777f8[_0x526c5d(0x186)](_0x526c5d(0x198))&&_0x26fe9b&&_0x26fe9b[_0x526c5d(0x19f)]===_0x2a22a7&&!_0x42bb07)continue;_0x55f317['push'](_0x104506[_0x526c5d(0x19b)]);}return{'method':_0x526c5d(0x1a9),'url':_0x526c5d(0x18e),'body':{'sqlCodes':_0x55f317,'appCode':_0x4777f8[_0x526c5d(0x185)]},'description':_0x526c5d(0x1a2)+_0x55f317[_0x526c5d(0x1ad)]+_0x526c5d(0x19c)};},async 'execute'(_0x28fa2a){const _0x4b7c76=a122_0x1d17ce,_0x2e4b5d=loadSqlProjectConfig(_0x28fa2a[_0x4b7c76(0x185)]),_0x214e30=await readSqlLockFile(_0x2e4b5d[_0x4b7c76(0x191)]),{lockData:_0x13b5bf,appLock:_0x4dcbf8}=ensureSqlLockScope(_0x214e30??createEmptySqlLock(),_0x28fa2a[_0x4b7c76(0x185)],_0x2e4b5d[_0x4b7c76(0x174)],_0x4b7c76(0x1a4)),_0x10be4a=await getTargetSqlQueries(_0x2e4b5d,_0x4dcbf8,_0x28fa2a['str'](_0x4b7c76(0x18d))||undefined);if(_0x10be4a[_0x4b7c76(0x1ad)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x4e24c9=[],_0xb14565=[],_0x326a8b=[];for(const _0x44b07a of _0x10be4a){const _0x33018a=_0x4dcbf8[_0x4b7c76(0x17a)][_0x44b07a[_0x4b7c76(0x19b)]];if(!_0x33018a){_0x326a8b[_0x4b7c76(0x1a4)]({'sqlCode':_0x44b07a[_0x4b7c76(0x19b)],'error':_0x4b7c76(0x188)});continue;}try{const _0x221e8e=await computeSqlFileHash(_0x44b07a[_0x4b7c76(0x194)]),_0x24083b=_0x33018a[_0x4b7c76(0x176)]!==_0x44b07a[_0x4b7c76(0x1b1)]||!!_0x44b07a[_0x4b7c76(0x1a6)]&&_0x33018a[_0x4b7c76(0x1a6)]!==_0x44b07a['sqlName'];if(!_0x28fa2a[_0x4b7c76(0x186)]('force')&&_0x33018a[_0x4b7c76(0x19f)]===_0x221e8e&&!_0x24083b){_0xb14565[_0x4b7c76(0x1a4)]({'sqlCode':_0x44b07a['sqlCode'],'reason':'unchanged'});continue;}if(_0x33018a[_0x4b7c76(0x1aa)]==null){_0x326a8b['push']({'sqlCode':_0x44b07a[_0x4b7c76(0x19b)],'error':_0x4b7c76(0x182)});continue;}const _0x4f4423=await readFile(_0x44b07a['filePath'],_0x4b7c76(0x199)),_0x2996f3=stripLocalSqlMetadata(_0x4f4423,_0x44b07a[_0x4b7c76(0x1ac)]),_0x1b07c2=_0x44b07a[_0x4b7c76(0x1a6)]||_0x33018a[_0x4b7c76(0x1a6)],_0x20b941=await resolveTargetDbBinding(_0x28fa2a[_0x4b7c76(0x185)],_0x44b07a,_0x33018a),_0x1b25c3=await updateSqlQuery({'id':_0x33018a['remoteId'],'appCode':_0x28fa2a[_0x4b7c76(0x185)],'sqlCode':_0x44b07a[_0x4b7c76(0x19b)],'sqlName':_0x1b07c2,'dbId':_0x20b941[_0x4b7c76(0x184)],'version':_0x33018a[_0x4b7c76(0x1aa)],'sqlContent':_0x2996f3,'sqlConfig':_0x33018a[_0x4b7c76(0x1a5)]??undefined}),_0xbd2de9=_0x1b25c3['dbId']?await getDbName(_0x28fa2a[_0x4b7c76(0x185)],Number(_0x1b25c3[_0x4b7c76(0x184)]))[_0x4b7c76(0x1a0)](()=>_0x20b941['dbName']):_0x20b941[_0x4b7c76(0x193)];_0x4dcbf8[_0x4b7c76(0x17a)][_0x44b07a['sqlCode']]={...buildSqlLockEntry(_0x1b25c3,_0x2996f3,_0x221e8e,{'dbName':_0xbd2de9}),'path':_0x44b07a['relativePath'],'mode':_0x33018a['mode']},await archivePreviousSqlFileIfNeeded(_0x2e4b5d,_0x33018a[_0x4b7c76(0x176)],_0x44b07a['relativePath']),_0x4e24c9[_0x4b7c76(0x1a4)]({'sqlCode':_0x44b07a['sqlCode'],'remoteId':_0x33018a[_0x4b7c76(0x189)]});}catch(_0x43ddbb){_0x326a8b[_0x4b7c76(0x1a4)]({'sqlCode':_0x44b07a[_0x4b7c76(0x19b)],'error':_0x43ddbb instanceof Error?_0x43ddbb['message']:String(_0x43ddbb)});}}return _0x4dcbf8[_0x4b7c76(0x1b2)]=new Date()[_0x4b7c76(0x18a)](),await writeSqlLockFile(_0x2e4b5d[_0x4b7c76(0x191)],_0x13b5bf),{'ok':_0x326a8b['length']===0x0,'data':{'pushed':_0x4e24c9,'skipped':_0xb14565,'failed':_0x326a8b},'message':_0x4b7c76(0x190)+_0x4e24c9[_0x4b7c76(0x1ad)]+_0x4b7c76(0x1a7)+_0xb14565[_0x4b7c76(0x1ad)]+_0x4b7c76(0x196)+_0x326a8b['length']+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x124ebd,_0x3fff62,_0x3f5b26){const _0x2e971a=a122_0x1d17ce;if(!_0x3fff62||_0x3fff62===_0x3f5b26)return;const _0x1b376e=join(_0x124ebd['sqlRootDir'],_0x3fff62);if(!await fileExists(_0x1b376e))return;const _0x22d91f=await moveToTrash(_0x124ebd[_0x2e971a(0x17e)],_0x124ebd[_0x2e971a(0x17c)],_0x1b376e);await cleanupEmptyDirectories(dirname(_0x1b376e),_0x124ebd['sqlRootDir']),void _0x22d91f;}async function moveToTrash(_0x8438ba,_0x3685c8,_0x2c0310){const _0x5bfac0=a122_0x1d17ce,_0x51b80f=new Date()[_0x5bfac0(0x18a)]()['replace'](/[:.]/g,'-'),_0x113c80=relative(_0x8438ba,_0x2c0310),_0x397688=join(_0x3685c8,_0x51b80f,_0x113c80);return await mkdir(dirname(_0x397688),{'recursive':!![]}),await rename(_0x2c0310,_0x397688),_0x397688;}async function cleanupEmptyDirectories(_0x184414,_0x2cfad6){const _0x5c7051=a122_0x1d17ce;let _0x5872e3=resolve(_0x184414);const _0x17e23f=resolve(_0x2cfad6);while(_0x5872e3['startsWith'](''+_0x17e23f+sep)||_0x5872e3===_0x17e23f){if(_0x5872e3===_0x17e23f)return;try{const _0x2e03c1=await readdir(_0x5872e3);if(_0x2e03c1[_0x5c7051(0x1ad)]>0x0)return;await rmdir(_0x5872e3);}catch{return;}_0x5872e3=dirname(_0x5872e3);}}async function resolveTargetDbBinding(_0x14a143,_0x17ef1d,_0x516b67){const _0x1daed9=a122_0x1d17ce,_0x33dfa0=_0x17ef1d[_0x1daed9(0x192)];if(!_0x33dfa0)return{'dbId':_0x516b67['dbId'],'dbName':_0x516b67[_0x1daed9(0x193)]};const _0x1bad53=buildDbDirectoryName(_0x516b67[_0x1daed9(0x193)],_0x516b67[_0x1daed9(0x184)]);if(_0x33dfa0===_0x1bad53)return{'dbId':_0x516b67[_0x1daed9(0x184)],'dbName':_0x516b67['dbName']};const _0x42e028=parseExplicitDbDirectory(_0x33dfa0);if(_0x42e028!=null)return{'dbId':_0x42e028,'dbName':await getDbName(_0x14a143,_0x42e028)[_0x1daed9(0x1a0)](()=>undefined)};const _0x4c4764=await listDatabases(_0x14a143),_0xa141f6=_0x4c4764[_0x1daed9(0x1b3)](_0x47b22d=>buildDbDirectoryName(_0x47b22d['dbName'],_0x47b22d[_0x1daed9(0x184)])===_0x33dfa0);if(_0xa141f6[_0x1daed9(0x1ad)]===0x1)return{'dbId':_0xa141f6[0x0][_0x1daed9(0x184)],'dbName':_0xa141f6[0x0]['dbName']};if(_0xa141f6[_0x1daed9(0x1ad)]===0x0)throw CliErrors[_0x1daed9(0x1af)](_0x1daed9(0x172)+_0x33dfa0+_0x1daed9(0x1ab)+_0x17ef1d['sqlCode']+'.');const _0x56726e=_0xa141f6[_0x1daed9(0x178)](_0x42305c=>_0x42305c[_0x1daed9(0x193)]+'\x20('+_0x42305c[_0x1daed9(0x184)]+')')[_0x1daed9(0x175)](',\x20');throw CliErrors['validation'](_0x1daed9(0x187)+_0x33dfa0+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x17ef1d[_0x1daed9(0x19b)]+':\x20'+_0x56726e);}function parseExplicitDbDirectory(_0x43f686){const _0x233e43=a122_0x1d17ce,_0x36dca6=/^db-(\d+)$/[_0x233e43(0x18b)](_0x43f686);if(!_0x36dca6)return null;const _0x39b329=Number(_0x36dca6[0x1]);return Number[_0x233e43(0x17b)](_0x39b329)&&_0x39b329>0x0?_0x39b329:null;}
|
|
1
|
+
const a123_0x564530=a123_0x31d8;(function(_0x74d77b,_0x45eac6){const _0x598c49=a123_0x31d8,_0x3448e0=_0x74d77b();while(!![]){try{const _0x35fb64=-parseInt(_0x598c49(0x1b8))/0x1+-parseInt(_0x598c49(0x1aa))/0x2*(parseInt(_0x598c49(0x1ba))/0x3)+-parseInt(_0x598c49(0x1b6))/0x4+parseInt(_0x598c49(0x1d7))/0x5*(parseInt(_0x598c49(0x1d6))/0x6)+parseInt(_0x598c49(0x1a8))/0x7+parseInt(_0x598c49(0x1b3))/0x8+-parseInt(_0x598c49(0x1db))/0x9;if(_0x35fb64===_0x45eac6)break;else _0x3448e0['push'](_0x3448e0['shift']());}catch(_0x2574a1){_0x3448e0['push'](_0x3448e0['shift']());}}}(a123_0x2ca9,0x2f966));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a123_0x2ca9(){const _0x1d474e=['2258634EwmEuO','version','5354AhsGFR','boolean','lastSync','set','POST','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','push','join','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','2797680aekbMo','has','/smartapi/custom/updateUserCustomSql','115456AwLYFb','sqlName','136119PyIsWq','mode','342arBENz','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','high-risk-write','sqlConfig','isFinite','relativePath','sqls','remoteId','Push\x20complete:\x20','dbName','No\x20database\x20matches\x20local\x20directory\x20\x22','toISOString','str','path','\x20failed','\x22\x20for\x20sqlCode\x20','filePath','projectRoot','catch','Push\x20local\x20SQL\x20files\x20to\x20remote','force','Local\x20directory\x20\x22','sqlRoot','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','sqlRootDir','appCode','filter','message','120tGgPbh','14970UADCQo','sql','entries','validation','604557xzEyYi','Would\x20push\x20','bool','trashDir','lockFilePath','dbId','replace','length','\x20pushed,\x20','exec','sqlCode','hash'];a123_0x2ca9=function(){return _0x1d474e;};return a123_0x2ca9();}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';function a123_0x31d8(_0x47b4b0,_0x42e0b8){_0x47b4b0=_0x47b4b0-0x1a4;const _0x2ca999=a123_0x2ca9();let _0x31d813=_0x2ca999[_0x47b4b0];return _0x31d813;}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0xce6159,_0x40504d,_0x21b005){const _0x4084fc=a123_0x31d8,_0x5e3e2e=await scanLocalSqlQueries(_0xce6159),_0x219e28=new Map();for(const _0x3b01da of _0x5e3e2e){if(_0x21b005&&_0x3b01da[_0x4084fc(0x1a6)]!==_0x21b005)continue;const _0x2af290=_0x219e28['get'](_0x3b01da['sqlCode'])??[];_0x2af290[_0x4084fc(0x1b0)](_0x3b01da),_0x219e28[_0x4084fc(0x1ad)](_0x3b01da[_0x4084fc(0x1a6)],_0x2af290);}if(_0x21b005&&!_0x219e28[_0x4084fc(0x1b4)](_0x21b005))throw CliErrors[_0x4084fc(0x1da)]('Local\x20SQL\x20not\x20found:\x20'+_0x21b005);const _0x30fbae=[];for(const [_0x2c724f,_0x84b85e]of _0x219e28[_0x4084fc(0x1d9)]()){if(_0x84b85e[_0x4084fc(0x1e2)]===0x1){_0x30fbae[_0x4084fc(0x1b0)](_0x84b85e[0x0]);continue;}const _0x46ab1c=_0x40504d['sqls'][_0x2c724f],_0x40d025=_0x46ab1c?.[_0x4084fc(0x1c7)],_0x223cb7=_0x40d025?_0x84b85e[_0x4084fc(0x1d4)](_0x5a51eb=>_0x5a51eb[_0x4084fc(0x1bf)]!==_0x40d025):_0x84b85e;if(_0x46ab1c&&_0x223cb7[_0x4084fc(0x1e2)]===0x1){_0x30fbae[_0x4084fc(0x1b0)](_0x223cb7[0x0]);continue;}throw CliErrors['validation'](_0x4084fc(0x1bb)+_0x2c724f+_0x4084fc(0x1af));}return _0x30fbae;}export const sqlPush={'service':a123_0x564530(0x1d8),'command':a123_0x564530(0x1b0),'description':a123_0x564530(0x1cd),'risk':a123_0x564530(0x1bc),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a123_0x564530(0x1ce),'type':a123_0x564530(0x1ab),'description':a123_0x564530(0x1b2)}],async 'dryRun'(_0x27e207){const _0x153dd2=a123_0x564530,_0x18786c=loadSqlProjectConfig(_0x27e207['appCode']),_0x3827ac=await readSqlLockFile(_0x18786c[_0x153dd2(0x1df)]),{appLock:_0x1fdc0b}=ensureSqlLockScope(_0x3827ac??createEmptySqlLock(),_0x27e207['appCode'],_0x18786c[_0x153dd2(0x1d0)],_0x153dd2(0x1b0)),_0x45b44e=await getTargetSqlQueries(_0x18786c,_0x1fdc0b,_0x27e207['str']('sqlcode')||undefined),_0x42dd00=[];for(const _0x34e656 of _0x45b44e){const _0x15e3ea=await computeSqlFileHash(_0x34e656['filePath']),_0x7a8ac0=_0x1fdc0b[_0x153dd2(0x1c0)][_0x34e656['sqlCode']],_0x2d9c00=!!_0x7a8ac0&&(_0x7a8ac0[_0x153dd2(0x1c7)]!==_0x34e656[_0x153dd2(0x1bf)]||!!_0x34e656[_0x153dd2(0x1b7)]&&_0x7a8ac0[_0x153dd2(0x1b7)]!==_0x34e656[_0x153dd2(0x1b7)]);if(!_0x27e207[_0x153dd2(0x1dd)](_0x153dd2(0x1ce))&&_0x7a8ac0&&_0x7a8ac0[_0x153dd2(0x1a7)]===_0x15e3ea&&!_0x2d9c00)continue;_0x42dd00['push'](_0x34e656[_0x153dd2(0x1a6)]);}return{'method':_0x153dd2(0x1ae),'url':_0x153dd2(0x1b5),'body':{'sqlCodes':_0x42dd00,'appCode':_0x27e207[_0x153dd2(0x1d3)]},'description':_0x153dd2(0x1dc)+_0x42dd00[_0x153dd2(0x1e2)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x29b543){const _0x2d561d=a123_0x564530,_0x467609=loadSqlProjectConfig(_0x29b543[_0x2d561d(0x1d3)]),_0x18d5d6=await readSqlLockFile(_0x467609[_0x2d561d(0x1df)]),{lockData:_0x2588c0,appLock:_0x1aef1d}=ensureSqlLockScope(_0x18d5d6??createEmptySqlLock(),_0x29b543[_0x2d561d(0x1d3)],_0x467609['sqlRoot'],_0x2d561d(0x1b0)),_0x511eda=await getTargetSqlQueries(_0x467609,_0x1aef1d,_0x29b543[_0x2d561d(0x1c6)]('sqlcode')||undefined);if(_0x511eda[_0x2d561d(0x1e2)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x360079=[],_0x80ac32=[],_0x39d288=[];for(const _0x3dee21 of _0x511eda){const _0x5778ce=_0x1aef1d[_0x2d561d(0x1c0)][_0x3dee21[_0x2d561d(0x1a6)]];if(!_0x5778ce){_0x39d288[_0x2d561d(0x1b0)]({'sqlCode':_0x3dee21['sqlCode'],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x453fed=await computeSqlFileHash(_0x3dee21['filePath']),_0x181cc7=_0x5778ce[_0x2d561d(0x1c7)]!==_0x3dee21['relativePath']||!!_0x3dee21[_0x2d561d(0x1b7)]&&_0x5778ce['sqlName']!==_0x3dee21[_0x2d561d(0x1b7)];if(!_0x29b543[_0x2d561d(0x1dd)]('force')&&_0x5778ce['hash']===_0x453fed&&!_0x181cc7){_0x80ac32[_0x2d561d(0x1b0)]({'sqlCode':_0x3dee21[_0x2d561d(0x1a6)],'reason':'unchanged'});continue;}if(_0x5778ce['version']==null){_0x39d288[_0x2d561d(0x1b0)]({'sqlCode':_0x3dee21[_0x2d561d(0x1a6)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x248512=await readFile(_0x3dee21[_0x2d561d(0x1ca)],'utf8'),_0x1089e2=stripLocalSqlMetadata(_0x248512,_0x3dee21[_0x2d561d(0x1b9)]),_0x586fee=_0x3dee21[_0x2d561d(0x1b7)]||_0x5778ce[_0x2d561d(0x1b7)],_0x3da3b9=await resolveTargetDbBinding(_0x29b543['appCode'],_0x3dee21,_0x5778ce),_0x9b74e2=await updateSqlQuery({'id':_0x5778ce[_0x2d561d(0x1c1)],'appCode':_0x29b543['appCode'],'sqlCode':_0x3dee21[_0x2d561d(0x1a6)],'sqlName':_0x586fee,'dbId':_0x3da3b9['dbId'],'version':_0x5778ce[_0x2d561d(0x1a9)],'sqlContent':_0x1089e2,'sqlConfig':_0x5778ce[_0x2d561d(0x1bd)]??undefined}),_0x4fc892=_0x9b74e2[_0x2d561d(0x1e0)]?await getDbName(_0x29b543[_0x2d561d(0x1d3)],Number(_0x9b74e2[_0x2d561d(0x1e0)]))['catch'](()=>_0x3da3b9[_0x2d561d(0x1c3)]):_0x3da3b9[_0x2d561d(0x1c3)];_0x1aef1d[_0x2d561d(0x1c0)][_0x3dee21[_0x2d561d(0x1a6)]]={...buildSqlLockEntry(_0x9b74e2,_0x1089e2,_0x453fed,{'dbName':_0x4fc892}),'path':_0x3dee21[_0x2d561d(0x1bf)],'mode':_0x5778ce[_0x2d561d(0x1b9)]},await archivePreviousSqlFileIfNeeded(_0x467609,_0x5778ce['path'],_0x3dee21[_0x2d561d(0x1bf)]),_0x360079['push']({'sqlCode':_0x3dee21[_0x2d561d(0x1a6)],'remoteId':_0x5778ce[_0x2d561d(0x1c1)]});}catch(_0x5640b2){_0x39d288['push']({'sqlCode':_0x3dee21[_0x2d561d(0x1a6)],'error':_0x5640b2 instanceof Error?_0x5640b2[_0x2d561d(0x1d5)]:String(_0x5640b2)});}}return _0x1aef1d[_0x2d561d(0x1ac)]=new Date()[_0x2d561d(0x1c5)](),await writeSqlLockFile(_0x467609[_0x2d561d(0x1df)],_0x2588c0),{'ok':_0x39d288['length']===0x0,'data':{'pushed':_0x360079,'skipped':_0x80ac32,'failed':_0x39d288},'message':_0x2d561d(0x1c2)+_0x360079[_0x2d561d(0x1e2)]+_0x2d561d(0x1a4)+_0x80ac32[_0x2d561d(0x1e2)]+'\x20skipped,\x20'+_0x39d288[_0x2d561d(0x1e2)]+_0x2d561d(0x1c8)};}};async function archivePreviousSqlFileIfNeeded(_0x1bad17,_0x370dc0,_0x50c058){const _0x10569e=a123_0x564530;if(!_0x370dc0||_0x370dc0===_0x50c058)return;const _0x540a82=join(_0x1bad17[_0x10569e(0x1d2)],_0x370dc0);if(!await fileExists(_0x540a82))return;const _0x5c613d=await moveToTrash(_0x1bad17[_0x10569e(0x1cb)],_0x1bad17[_0x10569e(0x1de)],_0x540a82);await cleanupEmptyDirectories(dirname(_0x540a82),_0x1bad17[_0x10569e(0x1d2)]),void _0x5c613d;}async function moveToTrash(_0x583813,_0x2362cb,_0xf4485b){const _0xc5a18b=a123_0x564530,_0x98897b=new Date()['toISOString']()[_0xc5a18b(0x1e1)](/[:.]/g,'-'),_0x34472d=relative(_0x583813,_0xf4485b),_0x3b89ba=join(_0x2362cb,_0x98897b,_0x34472d);return await mkdir(dirname(_0x3b89ba),{'recursive':!![]}),await rename(_0xf4485b,_0x3b89ba),_0x3b89ba;}async function cleanupEmptyDirectories(_0x490281,_0x509925){let _0x178d18=resolve(_0x490281);const _0x41af6c=resolve(_0x509925);while(_0x178d18['startsWith'](''+_0x41af6c+sep)||_0x178d18===_0x41af6c){if(_0x178d18===_0x41af6c)return;try{const _0x5a8d02=await readdir(_0x178d18);if(_0x5a8d02['length']>0x0)return;await rmdir(_0x178d18);}catch{return;}_0x178d18=dirname(_0x178d18);}}async function resolveTargetDbBinding(_0x561eb9,_0x188776,_0x3dd736){const _0x188a74=a123_0x564530,_0x5467c6=_0x188776['dbDirectory'];if(!_0x5467c6)return{'dbId':_0x3dd736[_0x188a74(0x1e0)],'dbName':_0x3dd736[_0x188a74(0x1c3)]};const _0x2a679f=buildDbDirectoryName(_0x3dd736['dbName'],_0x3dd736[_0x188a74(0x1e0)]);if(_0x5467c6===_0x2a679f)return{'dbId':_0x3dd736[_0x188a74(0x1e0)],'dbName':_0x3dd736[_0x188a74(0x1c3)]};const _0xc4b250=parseExplicitDbDirectory(_0x5467c6);if(_0xc4b250!=null)return{'dbId':_0xc4b250,'dbName':await getDbName(_0x561eb9,_0xc4b250)[_0x188a74(0x1cc)](()=>undefined)};const _0x38d21a=await listDatabases(_0x561eb9),_0x3cedf0=_0x38d21a['filter'](_0x134612=>buildDbDirectoryName(_0x134612[_0x188a74(0x1c3)],_0x134612[_0x188a74(0x1e0)])===_0x5467c6);if(_0x3cedf0[_0x188a74(0x1e2)]===0x1)return{'dbId':_0x3cedf0[0x0][_0x188a74(0x1e0)],'dbName':_0x3cedf0[0x0]['dbName']};if(_0x3cedf0[_0x188a74(0x1e2)]===0x0)throw CliErrors[_0x188a74(0x1da)](_0x188a74(0x1c4)+_0x5467c6+_0x188a74(0x1c9)+_0x188776['sqlCode']+'.');const _0x53890e=_0x3cedf0['map'](_0x225c28=>_0x225c28['dbName']+'\x20('+_0x225c28[_0x188a74(0x1e0)]+')')[_0x188a74(0x1b1)](',\x20');throw CliErrors[_0x188a74(0x1da)](_0x188a74(0x1cf)+_0x5467c6+_0x188a74(0x1d1)+_0x188776[_0x188a74(0x1a6)]+':\x20'+_0x53890e);}function parseExplicitDbDirectory(_0x528d4f){const _0x3235f2=a123_0x564530,_0x10982e=/^db-(\d+)$/[_0x3235f2(0x1a5)](_0x528d4f);if(!_0x10982e)return null;const _0x5d73c0=Number(_0x10982e[0x1]);return Number[_0x3235f2(0x1be)](_0x5d73c0)&&_0x5d73c0>0x0?_0x5d73c0:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a124_0x59d3e0=a124_0xf72b;(function(_0x23ae53,_0x1ca823){const _0x2f9915=a124_0xf72b,_0x1a6717=_0x23ae53();while(!![]){try{const _0x3cc8d7=parseInt(_0x2f9915(0x155))/0x1*(parseInt(_0x2f9915(0x14c))/0x2)+-parseInt(_0x2f9915(0x145))/0x3*(parseInt(_0x2f9915(0x14d))/0x4)+parseInt(_0x2f9915(0x14e))/0x5+-parseInt(_0x2f9915(0x150))/0x6+-parseInt(_0x2f9915(0x146))/0x7*(parseInt(_0x2f9915(0x148))/0x8)+-parseInt(_0x2f9915(0x14b))/0x9+-parseInt(_0x2f9915(0x151))/0xa*(-parseInt(_0x2f9915(0x14f))/0xb);if(_0x3cc8d7===_0x1ca823)break;else _0x1a6717['push'](_0x1a6717['shift']());}catch(_0x4d3d35){_0x1a6717['push'](_0x1a6717['shift']());}}}(a124_0x2ede,0x42095));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a124_0xf72b(_0x4defcc,_0x2425cc){_0x4defcc=_0x4defcc-0x143;const _0x2edef7=a124_0x2ede();let _0xf72bfe=_0x2edef7[_0x4defcc];return _0xf72bfe;}function a124_0x2ede(){const _0x203d1c=['13450irAyNb','file','join','validation','9675sEYsUB','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','Query\x20description','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','description','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','Path\x20to\x20the\x20SQL\x20file','string','39ueXSHJ','379694TOgEQJ','save','64OvBBzG','sql','SQL\x20query\x20display\x20name','4856328ItfWgU','66AwKeaV','145496JoAMsZ','993310ZCXmek','13343EmMGnq','2595282PVLiWn'];a124_0x2ede=function(){return _0x203d1c;};return a124_0x2ede();}const SQL_SAVE_DEPRECATED_HINT=[a124_0x59d3e0(0x159),a124_0x59d3e0(0x158),'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`.'][a124_0x59d3e0(0x153)]('\x0a');export const sqlSave={'service':a124_0x59d3e0(0x149),'command':a124_0x59d3e0(0x147),'description':a124_0x59d3e0(0x15b),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a124_0x59d3e0(0x152),'type':a124_0x59d3e0(0x144),'required':!![],'description':a124_0x59d3e0(0x143)},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':a124_0x59d3e0(0x144),'description':a124_0x59d3e0(0x14a)},{'name':'db','type':a124_0x59d3e0(0x144),'description':a124_0x59d3e0(0x156)},{'name':a124_0x59d3e0(0x15a),'type':'string','description':a124_0x59d3e0(0x157)}],async 'validate'(){const _0x44f0ad=a124_0x59d3e0;throw CliErrors[_0x44f0ad(0x154)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x16257b=a124_0x59d3e0;throw CliErrors[_0x16257b(0x154)](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3bb923,_0x5cefd1){const _0x1fd37e=a125_0x39e7,_0x27da6e=_0x3bb923();while(!![]){try{const _0x4d2dad=-parseInt(_0x1fd37e(0x187))/0x1*(parseInt(_0x1fd37e(0x175))/0x2)+-parseInt(_0x1fd37e(0x180))/0x3+-parseInt(_0x1fd37e(0x186))/0x4*(-parseInt(_0x1fd37e(0x16e))/0x5)+parseInt(_0x1fd37e(0x18a))/0x6+parseInt(_0x1fd37e(0x190))/0x7+-parseInt(_0x1fd37e(0x17d))/0x8+-parseInt(_0x1fd37e(0x171))/0x9;if(_0x4d2dad===_0x5cefd1)break;else _0x27da6e['push'](_0x27da6e['shift']());}catch(_0x212257){_0x27da6e['push'](_0x27da6e['shift']());}}}(a125_0x5004,0x70c3b));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';function a125_0x39e7(_0x56a71a,_0x4ed2e6){_0x56a71a=_0x56a71a-0x16e;const _0x5004c0=a125_0x5004();let _0x39e7f5=_0x5004c0[_0x56a71a];return _0x39e7f5;}export function buildSqlLockEntry(_0x17909b,_0x21174d,_0x2c768b,_0xd273c0){const _0x1c2739=a125_0x39e7,_0x46ac1c=detectSqlMode(_0x21174d);return{'path':buildSqlRelativePath(_0x17909b['sqlCode'],_0x17909b['sqlName'],_0xd273c0?.[_0x1c2739(0x198)],_0x46ac1c,_0x17909b[_0x1c2739(0x188)]),'hash':_0x2c768b,'remoteId':_0x17909b['id'],'version':_0x17909b[_0x1c2739(0x18e)],'dbId':Number(_0x17909b['dbId']),'dbName':_0xd273c0?.[_0x1c2739(0x198)],'sqlName':_0x17909b[_0x1c2739(0x170)],'sqlConfig':_0x17909b[_0x1c2739(0x16f)]??undefined,'mode':_0x46ac1c};}export function cloneSqlLockData(_0x5af1ca){const _0x1dad9d=a125_0x39e7;return{'apps':Object[_0x1dad9d(0x177)](Object[_0x1dad9d(0x18c)](_0x5af1ca[_0x1dad9d(0x181)])['map'](([_0x3ee28c,_0x196a64])=>[_0x3ee28c,{'sqlRoot':_0x196a64['sqlRoot'],'lastSync':_0x196a64[_0x1dad9d(0x173)],'sqls':{..._0x196a64[_0x1dad9d(0x17f)]}}]))};}export function ensureRemoteSqlContent(_0x297775){const _0x2d4909=a125_0x39e7;return _0x297775[_0x2d4909(0x178)]??'';}export function buildLocalSqlFileContent(_0x5a22cc,_0x23f094,_0x8b61d2){const _0x37dc54=a125_0x39e7,_0x3ecd01=_0x8b61d2?.['mode']??detectSqlMode(_0x23f094),_0x2e0c32=stripLocalSqlMetadata(_0x23f094,_0x3ecd01)[_0x37dc54(0x18b)](),_0x153f4d=[...buildMetadataHeaderLines({'sqlCode':_0x5a22cc[_0x37dc54(0x172)],'sqlName':_0x5a22cc['sqlName'],'dbId':_0x5a22cc[_0x37dc54(0x188)],'dbName':_0x8b61d2?.[_0x37dc54(0x198)],'mode':_0x3ecd01,'syncedAt':_0x8b61d2?.[_0x37dc54(0x17e)],'description':_0x8b61d2?.['description']},_0x3ecd01),'',_0x2e0c32],_0x5e9b42=_0x153f4d[_0x37dc54(0x179)]('\x0a');return _0x5e9b42['endsWith']('\x0a')?_0x5e9b42:_0x5e9b42+'\x0a';}export function stripLocalSqlMetadata(_0x2dec74,_0x45fa8c){const _0x2e4115=a125_0x39e7,_0x1b424b=_0x2dec74[_0x2e4115(0x18f)](/\r\n/g,'\x0a')['split']('\x0a'),_0x1a1299=[];let _0x68c447=0x0;if(_0x45fa8c===_0x2e4115(0x176))while(_0x68c447<_0x1b424b[_0x2e4115(0x195)]){const _0x1b8c24=_0x1b424b[_0x68c447]??'';if(/^\s*<!--\s*@lovrabet\./[_0x2e4115(0x191)](_0x1b8c24)){_0x68c447++;continue;}if(_0x1b8c24[_0x2e4115(0x18b)]()===''&&_0x68c447>0x0){_0x68c447++;continue;}break;}else while(_0x68c447<_0x1b424b[_0x2e4115(0x195)]){const _0x2cb56a=_0x1b424b[_0x68c447]??'';if(/^\s*--\s*@lovrabet\./[_0x2e4115(0x191)](_0x2cb56a)){_0x68c447++;continue;}if(_0x2cb56a[_0x2e4115(0x18b)]()===''&&_0x68c447>0x0){_0x68c447++;continue;}break;}for(;_0x68c447<_0x1b424b[_0x2e4115(0x195)];_0x68c447++){_0x1a1299[_0x2e4115(0x185)](_0x1b424b[_0x68c447]);}return _0x1a1299[_0x2e4115(0x179)]('\x0a')[_0x2e4115(0x17b)]();}export function resolveSqlMode(_0xc68f88,_0x184d1f){const _0x1d5bb2=a125_0x39e7;if(_0x184d1f?.['mode'])return _0x184d1f[_0x1d5bb2(0x182)];return detectSqlMode(_0xc68f88);}export function resolveSqlFileName(_0x407a40,_0x5d4807,_0x4ddad4){const _0x267390=a125_0x39e7;if(_0x4ddad4?.['path'])return _0x4ddad4[_0x267390(0x196)];if(_0x4ddad4?.[_0x267390(0x170)]||_0x4ddad4?.['dbName'])return buildSqlRelativePath(_0x407a40,_0x4ddad4?.[_0x267390(0x170)],_0x4ddad4?.[_0x267390(0x198)],resolveSqlMode(_0x5d4807,_0x4ddad4),_0x4ddad4?.[_0x267390(0x188)]);return buildDefaultSqlFileName(_0x407a40,resolveSqlMode(_0x5d4807,_0x4ddad4));}export function resolveSqlLocalDir(_0x56fabc,_0x2a4932){return join(_0x56fabc,SQL_LOCAL_REL_DIR,_0x2a4932);}export async function confirmForceOverwrite(_0x33f6ca){const _0x419771=a125_0x39e7,_0x16101f=createInterface({'input':process[_0x419771(0x184)],'output':process[_0x419771(0x197)]}),_0x182dd9=await new Promise(_0x49f56f=>{const _0x2d9e36=_0x419771;_0x16101f[_0x2d9e36(0x18d)](_0x33f6ca+'\x20[y/N]\x20',_0x49f56f);});return _0x16101f[_0x419771(0x193)](),['y',_0x419771(0x194)][_0x419771(0x17c)](_0x182dd9[_0x419771(0x18b)]()['toLowerCase']());}export function findSqlLockScope(_0x505fd6,_0x1a6065){const _0x19c03d=a125_0x39e7;return _0x505fd6[_0x19c03d(0x181)][_0x1a6065];}function a125_0x5004(){const _0xa7a6d7=['includes','2075968zWgtFJ','syncedAt','sqls','541368PfZYij','apps','mode','<!--\x20@lovrabet.','stdin','push','4XFpixW','807znchWX','dbId','description','3042930fsUfXB','trim','entries','question','version','replace','1966461WymwFL','test','\x20-->','close','yes','length','path','stderr','dbName','3885815DkQgQz','sqlConfig','sqlName','1184337icFiUr','sqlCode','lastSync','--\x20@lovrabet.','1318kJmEly','mybatisXml','fromEntries','sqlContent','join','filter','trimStart'];a125_0x5004=function(){return _0xa7a6d7;};return a125_0x5004();}function buildMetadataHeaderLines(_0x4449fb,_0x5d19a4){const _0x21921d=a125_0x39e7,_0x5651fa=[[_0x21921d(0x172),_0x4449fb[_0x21921d(0x172)]],[_0x21921d(0x170),_0x4449fb[_0x21921d(0x170)]],[_0x21921d(0x188),_0x4449fb[_0x21921d(0x188)]],[_0x21921d(0x198),_0x4449fb['dbName']],[_0x21921d(0x182),_0x4449fb['mode']],[_0x21921d(0x17e),_0x4449fb[_0x21921d(0x17e)]],[_0x21921d(0x189),_0x4449fb[_0x21921d(0x189)]]];if(_0x5d19a4===_0x21921d(0x176))return _0x5651fa['filter'](([,_0x391717])=>_0x391717!==undefined&&_0x391717!==null&&String(_0x391717)[_0x21921d(0x18b)]()!=='')['map'](([_0x1a44a9,_0x1b7218])=>_0x21921d(0x183)+_0x1a44a9+':\x20'+String(_0x1b7218)+_0x21921d(0x192));return _0x5651fa[_0x21921d(0x17a)](([,_0x18fa5c])=>_0x18fa5c!==undefined&&_0x18fa5c!==null&&String(_0x18fa5c)[_0x21921d(0x18b)]()!=='')['map'](([_0x23696e,_0x3e61f1])=>_0x21921d(0x174)+_0x23696e+':\x20'+String(_0x3e61f1));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a126_0x455f65=a126_0x62b9;(function(_0x4fd031,_0x2f52cd){const _0x536768=a126_0x62b9,_0x5a045d=_0x4fd031();while(!![]){try{const _0xdb4621=parseInt(_0x536768(0x114))/0x1+parseInt(_0x536768(0x10e))/0x2*(parseInt(_0x536768(0x10c))/0x3)+-parseInt(_0x536768(0x107))/0x4+-parseInt(_0x536768(0x105))/0x5*(parseInt(_0x536768(0x111))/0x6)+parseInt(_0x536768(0x11b))/0x7*(parseInt(_0x536768(0xff))/0x8)+parseInt(_0x536768(0xfb))/0x9*(-parseInt(_0x536768(0x11f))/0xa)+-parseInt(_0x536768(0x118))/0xb*(-parseInt(_0x536768(0x112))/0xc);if(_0xdb4621===_0x2f52cd)break;else _0x5a045d['push'](_0x5a045d['shift']());}catch(_0x227484){_0x5a045d['push'](_0x5a045d['shift']());}}}(a126_0x2df2,0x76ed0));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x57e7ea){const _0x4b3a4d=a126_0x62b9,_0x22b17c=[];let _0x148a86=0x1;while(!![]){const _0x3f995f=await listSqlQueries(_0x57e7ea,{'currentPage':_0x148a86,'pageSize':PAGE_SIZE}),_0x27b318=_0x3f995f[_0x4b3a4d(0x116)]??[];_0x22b17c[_0x4b3a4d(0xfc)](..._0x27b318['map'](_0x59eca2=>_0x59eca2[_0x4b3a4d(0x119)]));if(_0x27b318[_0x4b3a4d(0x117)]===0x0)break;const _0x5b94cd=_0x3f995f[_0x4b3a4d(0x11c)]?.['totalCount'];if(_0x5b94cd!=null?_0x22b17c[_0x4b3a4d(0x117)]>=_0x5b94cd:_0x27b318[_0x4b3a4d(0x117)]<PAGE_SIZE)break;_0x148a86++;}return _0x22b17c;}export const sqlStatus={'service':a126_0x455f65(0x113),'command':a126_0x455f65(0x11a),'description':a126_0x455f65(0x115),'risk':a126_0x455f65(0x11e),'flags':[{'name':'remote','type':a126_0x455f65(0x104),'description':a126_0x455f65(0x100)}],async 'execute'(_0x3ac187){const _0x313318=a126_0x455f65,_0x378e48=loadSqlProjectConfig(_0x3ac187[_0x313318(0x10a)]),_0x5e5281=await readSqlLockFile(_0x378e48[_0x313318(0x110)]),{appLock:_0x5d5725}=ensureSqlLockScope(_0x5e5281??createEmptySqlLock(),_0x378e48[_0x313318(0x10a)],_0x378e48['sqlRoot'],_0x313318(0x11a)),_0x168a55=await scanLocalSqlQueries(_0x378e48),_0x300614=[],_0x5f0a99=[],_0x164f99=[],_0x12fadb=[],_0x317efa=new Set(_0x168a55[_0x313318(0x10d)](_0x2d0a08=>_0x2d0a08['lockKey']));for(const _0x1b8e94 of _0x168a55){const _0x44680b=await computeSqlFileHash(_0x1b8e94[_0x313318(0x10b)]),_0x1b66cd=_0x5d5725[_0x313318(0x108)][_0x1b8e94[_0x313318(0x102)]],_0x5330d2=!!_0x1b66cd&&_0x1b66cd[_0x313318(0xfd)]!==_0x1b8e94[_0x313318(0x101)],_0x46accb=!!_0x1b66cd&&!!_0x1b8e94[_0x313318(0x103)]&&_0x1b66cd[_0x313318(0x103)]!==_0x1b8e94[_0x313318(0x103)];if(!_0x1b66cd)_0x300614[_0x313318(0xfc)](_0x1b8e94[_0x313318(0x102)]);else _0x1b66cd['hash']!==_0x44680b||_0x5330d2||_0x46accb?_0x5f0a99['push'](_0x1b8e94[_0x313318(0x102)]):_0x164f99['push'](_0x1b8e94[_0x313318(0x102)]);}for(const _0x517234 of Object[_0x313318(0xfe)](_0x5d5725[_0x313318(0x108)])){!_0x317efa['has'](_0x517234)&&_0x12fadb['push'](_0x517234);}const _0x26f52a=[];if(_0x3ac187['bool']('remote')){const _0x875a7c=await fetchAllSqlCodes(_0x3ac187[_0x313318(0x10a)]);for(const _0x15f47a of _0x875a7c){!_0x317efa['has'](_0x15f47a)&&!_0x5d5725[_0x313318(0x108)][_0x15f47a]&&_0x26f52a[_0x313318(0xfc)](_0x15f47a);}}const _0x18631f=_0x300614[_0x313318(0x117)]===0x0&&_0x5f0a99[_0x313318(0x117)]===0x0&&_0x12fadb[_0x313318(0x117)]===0x0&&_0x26f52a[_0x313318(0x117)]===0x0;return{'ok':!![],'data':{'added':_0x300614,'modified':_0x5f0a99,'missing':_0x12fadb,'unchanged':_0x164f99,'remoteOnly':_0x26f52a},'message':_0x18631f?_0x313318(0x11d):_0x300614[_0x313318(0x117)]+'\x20added,\x20'+_0x5f0a99[_0x313318(0x117)]+_0x313318(0x10f)+_0x12fadb[_0x313318(0x117)]+_0x313318(0x109)+_0x164f99[_0x313318(0x117)]+_0x313318(0x120)+(_0x26f52a[_0x313318(0x117)]>0x0?',\x20'+_0x26f52a['length']+_0x313318(0x106):'')};}};function a126_0x62b9(_0x35d6fe,_0x29acca){_0x35d6fe=_0x35d6fe-0xfb;const _0x2df239=a126_0x2df2();let _0x62b907=_0x2df239[_0x35d6fe];return _0x62b907;}function a126_0x2df2(){const _0x2c3aa8=['lockFilePath','6jjygIp','2897772idFzgZ','sql','42444wWdzzU','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','tableData','length','44fwNUeL','sqlCode','status','13027RIxmJa','paging','All\x20SQL\x20queries\x20are\x20in\x20sync.','read','130BLsSjv','\x20unchanged','192069fBgOZV','push','path','keys','1576qCrKgM','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','relativePath','lockKey','sqlName','boolean','479855rdjupY','\x20remote-only','2545812rRMICw','sqls','\x20missing,\x20','appCode','filePath','468aSTLyy','map','1564jkHyNW','\x20modified,\x20'];a126_0x2df2=function(){return _0x2c3aa8;};return a126_0x2df2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x1597ee=a127_0x5751;(function(_0x9253ee,_0x1ffa8d){const _0x2d7a4d=a127_0x5751,_0x53f297=_0x9253ee();while(!![]){try{const _0x1a55da=-parseInt(_0x2d7a4d(0x204))/0x1*(-parseInt(_0x2d7a4d(0x20b))/0x2)+-parseInt(_0x2d7a4d(0x219))/0x3+parseInt(_0x2d7a4d(0x1f1))/0x4*(parseInt(_0x2d7a4d(0x210))/0x5)+-parseInt(_0x2d7a4d(0x21c))/0x6+-parseInt(_0x2d7a4d(0x215))/0x7+parseInt(_0x2d7a4d(0x20a))/0x8+parseInt(_0x2d7a4d(0x216))/0x9*(parseInt(_0x2d7a4d(0x20f))/0xa);if(_0x1a55da===_0x1ffa8d)break;else _0x53f297['push'](_0x53f297['shift']());}catch(_0x31af76){_0x53f297['push'](_0x53f297['shift']());}}}(a127_0x11a0,0x2fdf2));import{readFileSync,existsSync}from'node:fs';function a127_0x5751(_0x29aa30,_0x4952ab){_0x29aa30=_0x29aa30-0x1ed;const _0x11a07e=a127_0x11a0();let _0x575161=_0x11a07e[_0x29aa30];return _0x575161;}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a127_0x11a0(){const _0x231a3c=['\x22\x20not\x20found\x20in\x20any\x20dataset','valid','type','from','Table\x20\x22','isDangerous','isArray','tables','schemaWarnings','SQL\x20schema\x20validation','2yRzRov','sql','get','length','file','filter','1413048NiKiZS','325292egBoTZ','cwd','message','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','80PriTQo','292585CfePIk','File\x20not\x20found:\x20','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','utf-8','reason','267085ihnEin','73782kexgbj','string','name','937731Aiacjf','trim','sqlType','1879668OSOolc','map','parameters','size','dbtableConfig','isSelectOnly','schemas','split','20OdvcwH','appCode','validation','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','toLowerCase','push','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','\x22\x20not\x20found\x20or\x20not\x20accessible','tableName'];a127_0x11a0=function(){return _0x231a3c;};return a127_0x11a0();}import{assertDatasetSupportsLocalDevelopment,filterDbBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a127_0x1597ee(0x205),'command':'validate','description':a127_0x1597ee(0x20e),'risk':'read','flags':[{'name':a127_0x1597ee(0x208),'type':a127_0x1597ee(0x217),'description':a127_0x1597ee(0x1f7)},{'name':'sql','type':a127_0x1597ee(0x217),'description':a127_0x1597ee(0x212)},{'name':a127_0x1597ee(0x1ef),'type':a127_0x1597ee(0x217),'description':a127_0x1597ee(0x1f4)}],async 'execute'(_0x3d1034){const _0x5a23f3=a127_0x1597ee,_0x25d2de=_0x3d1034['str'](_0x5a23f3(0x208)),_0x445ea=_0x3d1034['str']('sql');if(!_0x25d2de&&!_0x445ea)throw CliErrors['flagMissing'](_0x5a23f3(0x208),'Provide\x20--file\x20or\x20--sql');let _0x33b3de;if(_0x25d2de){const _0xf502b0=resolve(process[_0x5a23f3(0x20c)](),_0x25d2de);if(!existsSync(_0xf502b0))throw CliErrors[_0x5a23f3(0x1f3)](_0x5a23f3(0x211)+_0xf502b0);_0x33b3de=readFileSync(_0xf502b0,_0x5a23f3(0x213));}else _0x33b3de=_0x445ea;const _0x52f46f=validateSql(_0x33b3de),_0x5a4ab6={'valid':_0x52f46f[_0x5a23f3(0x1fb)],'sqlType':_0x52f46f[_0x5a23f3(0x21b)][_0x5a23f3(0x1fc)],'isSelectOnly':_0x52f46f[_0x5a23f3(0x21b)][_0x5a23f3(0x1ee)],'isDangerous':_0x52f46f[_0x5a23f3(0x21b)][_0x5a23f3(0x1ff)],'tables':_0x52f46f[_0x5a23f3(0x201)],'parameters':_0x52f46f[_0x5a23f3(0x21e)],'message':_0x52f46f['message']};_0x52f46f['sqlType'][_0x5a23f3(0x214)]&&(_0x5a4ab6[_0x5a23f3(0x214)]=_0x52f46f[_0x5a23f3(0x21b)][_0x5a23f3(0x214)]);const _0x5ad8a5=_0x3d1034['str'](_0x5a23f3(0x1ef));if(_0x5ad8a5&&_0x52f46f[_0x5a23f3(0x1fb)]){const _0x393918=_0x5ad8a5[_0x5a23f3(0x1f0)](',')[_0x5a23f3(0x21d)](_0x3bd257=>_0x3bd257[_0x5a23f3(0x21a)]())[_0x5a23f3(0x209)](Boolean),_0x2de1c9=[],_0x33854a=filterDbBackedDatasets(await listDatasets(_0x3d1034[_0x5a23f3(0x1f2)])),_0x4d0762=new Map(_0x33854a['map'](_0x249c6d=>[_0x249c6d[_0x5a23f3(0x1ed)]?.[_0x5a23f3(0x1f9)]?.['toLowerCase'](),_0x249c6d]));for(const _0x19e53c of _0x52f46f[_0x5a23f3(0x201)]){const _0x1884be=_0x4d0762[_0x5a23f3(0x206)](_0x19e53c['toLowerCase']());!_0x1884be&&_0x2de1c9[_0x5a23f3(0x1f6)](_0x5a23f3(0x1fe)+_0x19e53c+_0x5a23f3(0x1fa));}for(const _0x3b1e3f of _0x393918){let _0xee9201;try{_0xee9201=await getDatasetDetail(_0x3b1e3f);}catch{_0x2de1c9[_0x5a23f3(0x1f6)]('Dataset\x20\x22'+_0x3b1e3f+_0x5a23f3(0x1f8));continue;}assertDatasetSupportsLocalDevelopment(_0xee9201,_0x5a23f3(0x203));const _0x517be4=Array[_0x5a23f3(0x200)](_0xee9201['fields'])?_0xee9201['fields']:[],_0x63d724=new Set(_0x517be4['map'](_0x583f3f=>_0x583f3f[_0x5a23f3(0x218)]?.[_0x5a23f3(0x1f5)]())),_0x581d5c=_0xee9201['dbtableConfig']?.[_0x5a23f3(0x1f9)]||_0xee9201[_0x5a23f3(0x1f9)]||_0x3b1e3f;_0x5a4ab6['schema:'+_0x581d5c]={'code':_0x3b1e3f,'tableName':_0x581d5c,'fieldCount':_0x63d724[_0x5a23f3(0x21f)],'fields':Array[_0x5a23f3(0x1fd)](_0x63d724)};}_0x2de1c9[_0x5a23f3(0x207)]>0x0&&(_0x5a4ab6[_0x5a23f3(0x202)]=_0x2de1c9);}return{'ok':_0x52f46f[_0x5a23f3(0x1fb)],'data':_0x5a4ab6,'message':_0x52f46f[_0x5a23f3(0x20d)]};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a128_0x33ec7c=a128_0x67d1;(function(_0x590e0a,_0x4883d8){const _0x3fc4b2=a128_0x67d1,_0x1b6e48=_0x590e0a();while(!![]){try{const _0x58950f=-parseInt(_0x3fc4b2(0xf0))/0x1*(parseInt(_0x3fc4b2(0xf6))/0x2)+-parseInt(_0x3fc4b2(0x106))/0x3+parseInt(_0x3fc4b2(0xeb))/0x4*(parseInt(_0x3fc4b2(0x109))/0x5)+parseInt(_0x3fc4b2(0xe6))/0x6*(parseInt(_0x3fc4b2(0xec))/0x7)+parseInt(_0x3fc4b2(0xfb))/0x8*(-parseInt(_0x3fc4b2(0x102))/0x9)+-parseInt(_0x3fc4b2(0xe1))/0xa*(parseInt(_0x3fc4b2(0xf5))/0xb)+-parseInt(_0x3fc4b2(0xee))/0xc*(-parseInt(_0x3fc4b2(0xf3))/0xd);if(_0x58950f===_0x4883d8)break;else _0x1b6e48['push'](_0x1b6e48['shift']());}catch(_0x27162c){_0x1b6e48['push'](_0x1b6e48['shift']());}}}(a128_0x396d,0x197ab));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';function a128_0x67d1(_0x370447,_0x2d9a0c){_0x370447=_0x370447-0xde;const _0x396dab=a128_0x396d();let _0x67d1=_0x396dab[_0x370447];return _0x67d1;}import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=['cookie',a128_0x33ec7c(0xde),'locale',a128_0x33ec7c(0xf2),a128_0x33ec7c(0x103)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a128_0x33ec7c(0xfc),a128_0x33ec7c(0xe5),a128_0x33ec7c(0xe8),a128_0x33ec7c(0xf2),'cookie',a128_0x33ec7c(0xde),a128_0x33ec7c(0xf1)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x3670e7){const _0x163fac=a128_0x33ec7c;return[..._0x3670e7][_0x163fac(0xed)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x578721){return TOP_LEVEL_CONFIG_KEYS['has'](_0x578721);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}function a128_0x396d(){const _0x4f9394=['trim','string','Target\x20environment','Default\x20page\x20size','423270kihcbK','riskLevel','filter','API\x20directory\x20path','566904fvyINm','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','zh-CN','80ounyUl','accessKey','app','en-US','13010EgtCWS','Risk\x20level','length','Auth\x20cookie','env','1176CucxLe','cookie','locale','toLowerCase','number','21152BqXPPR','994HBQVUL','join','12lUzwma','inherit','1xGoLEo','apiDir','format','5885555DJnTCA','map','1133mTuKva','87562mELHuq','pageSize','Access\x20key','defaultApp','keys','16goOPIH','appcode','Config\x20key\x20('];a128_0x396d=function(){return _0x4f9394;};return a128_0x396d();}export function getConfigCommandKeyDescription(){const _0x5897a8=a128_0x33ec7c;return _0x5897a8(0xfd)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a128_0x33ec7c(0xe5),'apiDir':a128_0x33ec7c(0xf1),'cookie':a128_0x33ec7c(0xe7),'accessKey':'accessKey','defaultFormat':'format','pageSize':a128_0x33ec7c(0xf7),'riskLevel':a128_0x33ec7c(0x103),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x3e2bc9=a128_0x33ec7c;return[{'name':_0x3e2bc9(0xe5),'type':_0x3e2bc9(0xff),'description':_0x3e2bc9(0x100),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':'string','description':_0x3e2bc9(0x105)},{'name':_0x3e2bc9(0xe7),'type':_0x3e2bc9(0xff),'description':_0x3e2bc9(0xe4),'hidden':!![]},{'name':'accessKey','type':_0x3e2bc9(0xff),'description':_0x3e2bc9(0xf8),'hidden':!![]},{'name':'defaultFormat','type':_0x3e2bc9(0xff),'description':_0x3e2bc9(0x107),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x3e2bc9(0xf7),'type':_0x3e2bc9(0xea),'description':_0x3e2bc9(0x101)},{'name':_0x3e2bc9(0x103),'type':_0x3e2bc9(0xff),'description':_0x3e2bc9(0xe2),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x3e2bc9(0xe8),'type':_0x3e2bc9(0xff),'description':'Locale'}];}export function collectAppProfileOverrides(_0x245c60){const _0x33be4a=a128_0x33ec7c,_0x5eface={};for(const [_0x381728,_0x475e6a]of Object['entries'](APP_PROFILE_FLAG_KEY_MAP)){const _0x7a892f=_0x245c60(_0x381728);if(!_0x7a892f)continue;_0x5eface[_0x475e6a]=_0x475e6a===_0x33be4a(0xf7)?Number(_0x7a892f):_0x7a892f;}return _0x5eface;}export function buildAppProfileListFields(_0x5059a0){const _0x16e1bd=a128_0x33ec7c;return{'env':_0x5059a0['env']??null,'apiDir':_0x5059a0['apiDir']??null,'hasCookie':!!_0x5059a0[_0x16e1bd(0xe7)],'hasAccessKey':!!_0x5059a0[_0x16e1bd(0xde)],'format':_0x5059a0[_0x16e1bd(0xf2)]??null,'pageSize':_0x5059a0[_0x16e1bd(0xf7)]??null,'riskLevel':_0x5059a0['riskLevel']??null,'locale':_0x5059a0[_0x16e1bd(0xe8)]??null};}export function buildAppDoctorFields(_0x1866c9,_0x2795cc){const _0x1361ef=a128_0x33ec7c;return{'env':{'value':_0x1866c9[_0x1361ef(0xe5)]||_0x2795cc[_0x1361ef(0xe5)],'source':_0x1866c9[_0x1361ef(0xe5)]?'app':_0x1361ef(0xef)},'apiDir':{'value':_0x1866c9[_0x1361ef(0xf1)]||_0x2795cc[_0x1361ef(0xf1)],'source':_0x1866c9[_0x1361ef(0xf1)]?'app':_0x1361ef(0xef)},'cookie':{'value':_0x1866c9[_0x1361ef(0xe7)]||_0x2795cc[_0x1361ef(0xe7)],'source':_0x1866c9[_0x1361ef(0xe7)]?'app':_0x1361ef(0xef)},'accessKey':{'value':_0x1866c9[_0x1361ef(0xde)]||_0x2795cc['accessKey'],'source':_0x1866c9[_0x1361ef(0xde)]?_0x1361ef(0xdf):_0x1361ef(0xef)}};}export function buildCanonicalAppConfig(_0x59c570,_0x480243){const _0x37b307=a128_0x33ec7c,_0x1dbb80=_0x59c570[_0x37b307(0xf4)](_0x405687=>String(_0x405687||'')[_0x37b307(0xfe)]())[_0x37b307(0x104)](Boolean);if(_0x1dbb80[_0x37b307(0xe3)]===0x0)return{};const _0x59cf88={};for(const _0x48cb8a of _0x1dbb80){_0x59cf88[_0x48cb8a]=_0x480243?{'appcode':_0x48cb8a,'env':_0x480243}:{'appcode':_0x48cb8a};}return{'apps':_0x59cf88,'defaultApp':_0x1dbb80[0x0]};}export function buildCanonicalProjectConfig(_0x3410ff,_0x566709){const _0x3e6f3f=a128_0x33ec7c,{appCodes:appCodes=[],env:_0x3cf448,metadata:_0x20aca9}=_0x566709,_0x4c300f={..._0x3410ff,..._0x20aca9||{}};delete _0x4c300f[_0x3e6f3f(0xfc)],delete _0x4c300f[_0x3e6f3f(0xdf)];if(_0x3cf448)_0x4c300f['env']=_0x3cf448;else!_0x4c300f['env']&&(_0x4c300f['env']=DEFAULT_CONFIG_VALUES[_0x3e6f3f(0xe5)]);const _0x1eaf03=buildCanonicalAppConfig(appCodes,_0x4c300f['env']);return Object[_0x3e6f3f(0xfa)](_0x1eaf03)[_0x3e6f3f(0xe3)]>0x0&&(_0x4c300f['apps']=_0x1eaf03['apps'],_0x4c300f[_0x3e6f3f(0xf9)]=_0x1eaf03['defaultApp']),_0x4c300f;}const LOCALE_MAP={'zh':a128_0x33ec7c(0x108),'zh-cn':a128_0x33ec7c(0x108),'zh_cn':'zh-CN','en':a128_0x33ec7c(0xe0),'en-us':a128_0x33ec7c(0xe0),'en_us':a128_0x33ec7c(0xe0)};export function normalizeLocale(_0x439a73){const _0x27bc30=a128_0x33ec7c;if(!_0x439a73)return null;return LOCALE_MAP[_0x439a73[_0x27bc30(0xe9)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a129_0x302f(_0x26a2d7,_0x29a215){_0x26a2d7=_0x26a2d7-0xde;const _0x15fe26=a129_0x15fe();let _0x302ff2=_0x15fe26[_0x26a2d7];return _0x302ff2;}function a129_0x15fe(){const _0x2bb8e8=['1JWQtGp','21TdtiTD','3528RJAZfr','2605mxICJQ','10643370ToXxQD','5317368ZGdduU','967588GkWEJe','2112930DuGJBv','323508mmoxwx','2266873HFzoaH','11wVcFrk'];a129_0x15fe=function(){return _0x2bb8e8;};return a129_0x15fe();}(function(_0x17a6bc,_0x5927b3){const _0x3e62ee=a129_0x302f,_0x5cb699=_0x17a6bc();while(!![]){try{const _0x22bc27=-parseInt(_0x3e62ee(0xe7))/0x1*(-parseInt(_0x3e62ee(0xe2))/0x2)+parseInt(_0x3e62ee(0xe8))/0x3*(-parseInt(_0x3e62ee(0xe4))/0x4)+-parseInt(_0x3e62ee(0xdf))/0x5*(-parseInt(_0x3e62ee(0xde))/0x6)+-parseInt(_0x3e62ee(0xe5))/0x7+-parseInt(_0x3e62ee(0xe1))/0x8+parseInt(_0x3e62ee(0xe3))/0x9+-parseInt(_0x3e62ee(0xe0))/0xa*(-parseInt(_0x3e62ee(0xe6))/0xb);if(_0x22bc27===_0x5927b3)break;else _0x5cb699['push'](_0x5cb699['shift']());}catch(_0x202223){_0x5cb699['push'](_0x5cb699['shift']());}}}(a129_0x15fe,0x82848));export const CLI_VERSION_POLICY_URL='https://g.lovrabet.com/dist/rabetbase-cli/config/index.json';
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a130_0x2496d8=a130_0x3cc9;function a130_0x3cea(){const _0x4081f3=['target','production\x20|\x20daily','Operation\x20type','Title','expected-count','Rabetbase\x20CLI','Record\x20ID','description','title','SQL\x20string','Preview\x20operation\x20without\x20executing','Use\x20remote','force','fromEntries','Function\x20node','41069LGxfSz','Schemas','skipImports','1114464EqgVnW','sqlname','json\x20|\x20pretty\x20|\x20compress','descriptionFile','<name>','Force\x20overwrite','Verbose\x20output','all','Page\x20size','Use\x20global\x20config\x20scope','watch','type','yes','Page\x20number','530wZLlot','Skip\x20confirmation\x20for\x20high-risk\x20writes','operation','13815bhFQGX','map','SQL\x20code','Description','JSON\x20params','remote','Dataset\x20code','output','sqlcode','4092544phSwLH','338805EQcjtn','sql','<expr>','nonInteractive','enable-bff-save','Override\x20appcode','key','value','Skip\x20import\x20generation','name','Name','979116EJnmcM','non-interactive','Config\x20key','DB\x20ID','string','code','dry-run','global','appcode','file','Output\x20path','132NFWtgX','dbid','40676sfXoYM','Use\x20project\x20config\x20scope','Alias\x20for\x20--non-interactive','env','operationType','8ciwEHV','762feMQgG','page','expectedCount','Target\x20path','keyword','db-id','Config\x20value','project','schemas','Force\x20non-interactive\x20mode\x20(CI)','Output\x20format','Type\x20filter','Enable\x20BFF\x20save','<code>','Show\x20help','verbose','help','SQL\x20name','Confirm\x20destructive\x20action','Environment','pagesize','boolean','datasetcode','dbId','app','function-node','format','clear','Clear','skip-imports','functionNode','Code\x20filter','Expected\x20affected\x20count','operation-type','24scIUSJ','Watch\x20mode','confirm'];a130_0x3cea=function(){return _0x4081f3;};return a130_0x3cea();}(function(_0xde0bc8,_0x34318c){const _0x335a20=a130_0x3cc9,_0x9ec429=_0xde0bc8();while(!![]){try{const _0xf82b0b=-parseInt(_0x335a20(0xa8))/0x1*(-parseInt(_0x335a20(0xad))/0x2)+-parseInt(_0x335a20(0x75))/0x3+-parseInt(_0x335a20(0xd0))/0x4*(-parseInt(_0x335a20(0x90))/0x5)+-parseInt(_0x335a20(0xae))/0x6*(-parseInt(_0x335a20(0x72))/0x7)+parseInt(_0x335a20(0x8f))/0x8+parseInt(_0x335a20(0x86))/0x9*(parseInt(_0x335a20(0x83))/0xa)+-parseInt(_0x335a20(0xa6))/0xb*(parseInt(_0x335a20(0x9b))/0xc);if(_0xf82b0b===_0x34318c)break;else _0x9ec429['push'](_0x9ec429['shift']());}catch(_0x2170e7){_0x9ec429['push'](_0x9ec429['shift']());}}}(a130_0x3cea,0x87e9a));export const CLI_BIN_NAME='rabetbase';export const CLI_DISPLAY_NAME=a130_0x2496d8(0xd8);export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';export const GLOBAL_FLAGS=[{'name':a130_0x2496d8(0xa3),'meowKey':'appcode','type':'string','description':a130_0x2496d8(0x95),'hint':a130_0x2496d8(0xbb)},{'name':a130_0x2496d8(0xc6),'meowKey':a130_0x2496d8(0xc6),'type':'string','description':'Select\x20app\x20profile\x20by\x20name','hint':a130_0x2496d8(0x79)},{'name':a130_0x2496d8(0xab),'meowKey':a130_0x2496d8(0xab),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0xc1),'hint':a130_0x2496d8(0xd4)},{'name':'format','meowKey':'format','type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0xb8),'hint':a130_0x2496d8(0x77)},{'name':'jq','meowKey':'jq','type':'string','description':'Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','hint':a130_0x2496d8(0x92)},{'name':a130_0x2496d8(0xa1),'meowKey':'dryRun','type':a130_0x2496d8(0xc3),'description':a130_0x2496d8(0xdd)},{'name':a130_0x2496d8(0x81),'meowKey':a130_0x2496d8(0x81),'type':'boolean','description':a130_0x2496d8(0x84)},{'name':a130_0x2496d8(0x9c),'meowKey':a130_0x2496d8(0x93),'type':'boolean','description':a130_0x2496d8(0xb7)},{'name':'global','meowKey':a130_0x2496d8(0xa2),'type':a130_0x2496d8(0xc3),'description':a130_0x2496d8(0x7e)},{'name':a130_0x2496d8(0xb5),'meowKey':a130_0x2496d8(0xb5),'type':'boolean','description':a130_0x2496d8(0xa9)},{'name':'ci','meowKey':'ci','type':'boolean','description':a130_0x2496d8(0xaa),'hidden':!![]},{'name':'help','meowKey':a130_0x2496d8(0xbe),'type':a130_0x2496d8(0xc3),'description':a130_0x2496d8(0xbc)},{'name':a130_0x2496d8(0x99),'meowKey':a130_0x2496d8(0x99),'type':'string','description':a130_0x2496d8(0x9a),'hidden':!![]},{'name':a130_0x2496d8(0xdb),'meowKey':a130_0x2496d8(0xdb),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0xd6),'hidden':!![]},{'name':a130_0x2496d8(0xc9),'meowKey':a130_0x2496d8(0xc9),'type':a130_0x2496d8(0xc3),'description':a130_0x2496d8(0xca),'hidden':!![]},{'name':a130_0x2496d8(0x7f),'meowKey':a130_0x2496d8(0x7f),'type':a130_0x2496d8(0xc3),'description':a130_0x2496d8(0xd1),'hidden':!![]},{'name':a130_0x2496d8(0x8d),'meowKey':a130_0x2496d8(0x8d),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0xa5),'hidden':!![]},{'name':'params','meowKey':'params','type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0x8a),'hidden':!![]},{'name':'datasetcode','meowKey':a130_0x2496d8(0xc4),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0x8c),'hidden':!![]},{'name':a130_0x2496d8(0x7c),'meowKey':a130_0x2496d8(0x7c),'type':a130_0x2496d8(0xc3),'description':'Apply\x20to\x20all','hidden':!![]},{'name':a130_0x2496d8(0x94),'meowKey':'enableBffSave','type':'boolean','description':a130_0x2496d8(0xba),'hidden':!![]},{'name':'id','meowKey':'id','type':'string','description':a130_0x2496d8(0xd9),'hidden':!![]},{'name':a130_0x2496d8(0x80),'meowKey':a130_0x2496d8(0x80),'type':'string','description':a130_0x2496d8(0xb9),'hidden':!![]},{'name':a130_0x2496d8(0xa4),'meowKey':a130_0x2496d8(0xa4),'type':'string','description':'File\x20path','hidden':!![]},{'name':a130_0x2496d8(0x8e),'meowKey':a130_0x2496d8(0x8e),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0x88),'hidden':!![]},{'name':'sql-name','meowKey':'sqlName','type':'string','description':a130_0x2496d8(0xbf),'hidden':!![]},{'name':a130_0x2496d8(0x76),'meowKey':a130_0x2496d8(0x76),'type':a130_0x2496d8(0x9f),'description':'SQL\x20name','hidden':!![]},{'name':a130_0x2496d8(0xb3),'meowKey':a130_0x2496d8(0xc5),'type':a130_0x2496d8(0x9f),'description':'DB\x20ID','hidden':!![]},{'name':a130_0x2496d8(0xa7),'meowKey':'dbid','type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0x9e),'hidden':!![]},{'name':a130_0x2496d8(0xda),'meowKey':a130_0x2496d8(0xda),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0x89),'hidden':!![]},{'name':'description-file','meowKey':a130_0x2496d8(0x78),'type':a130_0x2496d8(0x9f),'description':'Description\x20file','hidden':!![]},{'name':a130_0x2496d8(0xaf),'meowKey':'page','type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0x82),'hidden':!![]},{'name':a130_0x2496d8(0xc2),'meowKey':a130_0x2496d8(0xc2),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0x7d),'hidden':!![]},{'name':a130_0x2496d8(0xb2),'meowKey':a130_0x2496d8(0xb2),'type':a130_0x2496d8(0x9f),'description':'Keyword\x20filter','hidden':!![]},{'name':'code','meowKey':a130_0x2496d8(0xa0),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0xcd),'hidden':!![]},{'name':a130_0x2496d8(0x91),'meowKey':a130_0x2496d8(0x91),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0xdc),'hidden':!![]},{'name':a130_0x2496d8(0xb6),'meowKey':'schemas','type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0x73),'hidden':!![]},{'name':a130_0x2496d8(0x85),'meowKey':a130_0x2496d8(0x85),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0xd5),'hidden':!![]},{'name':a130_0x2496d8(0xd3),'meowKey':'target','type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0xb1),'hidden':!![]},{'name':a130_0x2496d8(0xcb),'meowKey':a130_0x2496d8(0x74),'type':a130_0x2496d8(0xc3),'description':a130_0x2496d8(0x98),'hidden':!![]},{'name':a130_0x2496d8(0x96),'meowKey':a130_0x2496d8(0x96),'type':'string','description':a130_0x2496d8(0x9d),'hidden':!![]},{'name':a130_0x2496d8(0x97),'meowKey':a130_0x2496d8(0x97),'type':'string','description':a130_0x2496d8(0xb4),'hidden':!![]},{'name':a130_0x2496d8(0x6f),'meowKey':a130_0x2496d8(0x6f),'type':a130_0x2496d8(0xc3),'description':a130_0x2496d8(0x7a),'hidden':!![]},{'name':a130_0x2496d8(0xd2),'meowKey':a130_0x2496d8(0xd2),'type':a130_0x2496d8(0xc3),'description':a130_0x2496d8(0xc0),'hidden':!![]},{'name':a130_0x2496d8(0x8b),'meowKey':'remote','type':a130_0x2496d8(0xc3),'description':a130_0x2496d8(0xde),'hidden':!![]},{'name':a130_0x2496d8(0xbd),'meowKey':a130_0x2496d8(0xbd),'type':a130_0x2496d8(0xc3),'description':a130_0x2496d8(0x7b),'hidden':!![]},{'name':a130_0x2496d8(0xd7),'meowKey':a130_0x2496d8(0xb0),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0xce),'hidden':!![]},{'name':a130_0x2496d8(0xcf),'meowKey':a130_0x2496d8(0xac),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0xd5),'hidden':!![]},{'name':a130_0x2496d8(0xc7),'meowKey':a130_0x2496d8(0xcc),'type':a130_0x2496d8(0x9f),'description':a130_0x2496d8(0x71),'hidden':!![]}];function a130_0x3cc9(_0xdde173,_0xedc4d9){_0xdde173=_0xdde173-0x6f;const _0x3cea5b=a130_0x3cea();let _0x3cc957=_0x3cea5b[_0xdde173];return _0x3cc957;}export const PIPELINE_FLAG_NAMES=new Set([a130_0x2496d8(0xa3),'app','env',a130_0x2496d8(0xc8),'jq','dry-run','yes',a130_0x2496d8(0x9c),'ci']);export function buildMeowFlags(){const _0xa2ffec=a130_0x2496d8;return Object[_0xa2ffec(0x70)](GLOBAL_FLAGS[_0xa2ffec(0x87)](_0x2a99f7=>[_0x2a99f7['meowKey'],{'type':_0x2a99f7[_0xa2ffec(0x80)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a131_0x36c2(_0x504c2f,_0x26485e){_0x504c2f=_0x504c2f-0xd5;const _0xa5ac01=a131_0xa5ac();let _0x36c27a=_0xa5ac01[_0x504c2f];return _0x36c27a;}const a131_0x4342a0=a131_0x36c2;function a131_0xa5ac(){const _0x271896=['10CxWIwI','391168ckFbBi','48522QePGiV','4501485QvCGKW','compress','155FMbCIE','production','286209ODcyTo','high-risk-write','1491OQxjoX','19160MnAQJH','8LtValA','2941158NIzNHa','410517NUMMYv'];a131_0xa5ac=function(){return _0x271896;};return a131_0xa5ac();}(function(_0x34c8d4,_0x41b478){const _0x42679a=a131_0x36c2,_0xa99240=_0x34c8d4();while(!![]){try{const _0x1fd687=-parseInt(_0x42679a(0xd5))/0x1+parseInt(_0x42679a(0xd9))/0x2*(parseInt(_0x42679a(0xdb))/0x3)+parseInt(_0x42679a(0xdd))/0x4+parseInt(_0x42679a(0xe1))/0x5*(-parseInt(_0x42679a(0xde))/0x6)+parseInt(_0x42679a(0xd7))/0x7*(-parseInt(_0x42679a(0xd8))/0x8)+parseInt(_0x42679a(0xdf))/0x9+-parseInt(_0x42679a(0xdc))/0xa*(-parseInt(_0x42679a(0xda))/0xb);if(_0x1fd687===_0x41b478)break;else _0xa99240['push'](_0xa99240['shift']());}catch(_0x266f48){_0xa99240['push'](_0xa99240['shift']());}}}(a131_0xa5ac,0x59452));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a131_0x4342a0(0xe2),'format':a131_0x4342a0(0xe0),'locale':'en-US','riskLevel':a131_0x4342a0(0xd6),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a131_0x4342a0(0xe0);
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0x5d0203=a132_0x22be;(function(_0x2baa05,_0x174e88){const _0x4f824e=a132_0x22be,_0x5f4f40=_0x2baa05();while(!![]){try{const _0x58d49c=-parseInt(_0x4f824e(0x101))/0x1+parseInt(_0x4f824e(0x105))/0x2+-parseInt(_0x4f824e(0x104))/0x3*(-parseInt(_0x4f824e(0x108))/0x4)+parseInt(_0x4f824e(0x102))/0x5*(-parseInt(_0x4f824e(0x107))/0x6)+parseInt(_0x4f824e(0xfc))/0x7*(parseInt(_0x4f824e(0xfd))/0x8)+parseInt(_0x4f824e(0x100))/0x9*(-parseInt(_0x4f824e(0xfb))/0xa)+parseInt(_0x4f824e(0x103))/0xb;if(_0x58d49c===_0x174e88)break;else _0x5f4f40['push'](_0x5f4f40['shift']());}catch(_0x3efbf6){_0x5f4f40['push'](_0x5f4f40['shift']());}}}(a132_0x5b46,0xcf790));function a132_0x22be(_0x5a27ea,_0x17f2c4){_0x5a27ea=_0x5a27ea-0xf9;const _0x5b46e8=a132_0x5b46();let _0x22beca=_0x5b46e8[_0x5a27ea];return _0x22beca;}import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a132_0x5b46(){const _0xa42853=['16413848zmbwjE','12EoDtno','235268pmDzWG','userDomain','740634ZutZrX','1327572rLKNWI','apiDomain','https://daily-runtime.lovrabet.com','15465300XAeUCM','14PgsJVy','4553672IJxygt','https://runtime.lovrabet.com','https://user.lovrabet.com','9Yvlclk','1432576IRLPDn','10jtiLPS'];a132_0x5b46=function(){return _0xa42853;};return a132_0x5b46();}export function initDomains(_0x1856b5){const _0x3faaf0=a132_0x22be;customApiDomain=_0x1856b5?.[_0x3faaf0(0xf9)],customUserDomain=_0x1856b5?.[_0x3faaf0(0x106)],customRuntimeDomain=_0x1856b5?.['runtimeDomain'];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a132_0x5d0203(0xff):'https://user-daily.lovrabet.com');export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':'https://daily-api.lovrabet.com');export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a132_0x5d0203(0xfe):a132_0x5d0203(0xfa));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a133_0x46b4(){const _0x22470e=['1843763bNQPHD','654867fqFFQM','daily','10VFYNut','912PgkRNw','14752688DkqEYp','467344QNQHTH','development','dev','3246oKJXqs','production','60qVPpIK','16923885pzXHgP','8309kADObS','1588KDFMGW'];a133_0x46b4=function(){return _0x22470e;};return a133_0x46b4();}const a133_0x1e467e=a133_0x3dee;(function(_0x3d11cd,_0x43f564){const _0x1e3864=a133_0x3dee,_0xd7633=_0x3d11cd();while(!![]){try{const _0x147235=-parseInt(_0x1e3864(0x85))/0x1+-parseInt(_0x1e3864(0x93))/0x2*(-parseInt(_0x1e3864(0x89))/0x3)+-parseInt(_0x1e3864(0x8b))/0x4*(-parseInt(_0x1e3864(0x88))/0x5)+-parseInt(_0x1e3864(0x8e))/0x6*(parseInt(_0x1e3864(0x92))/0x7)+parseInt(_0x1e3864(0x8a))/0x8+parseInt(_0x1e3864(0x86))/0x9*(-parseInt(_0x1e3864(0x90))/0xa)+parseInt(_0x1e3864(0x91))/0xb;if(_0x147235===_0x43f564)break;else _0xd7633['push'](_0xd7633['shift']());}catch(_0x50bd94){_0xd7633['push'](_0xd7633['shift']());}}}(a133_0x46b4,0xe44f9));export const RABETBASE_ENV_VALUES=[a133_0x1e467e(0x8f),a133_0x1e467e(0x87)];export function normalizeEnv(_0x139df6){const _0x45573b=a133_0x1e467e;return _0x139df6==='online'?_0x45573b(0x8f):_0x139df6;}export function isProduction(_0x322b71){const _0x2aa0f2=a133_0x1e467e;return normalizeEnv(_0x322b71)===_0x2aa0f2(0x8f);}export function isDaily(_0x305fe4){const _0x4170c1=a133_0x1e467e;return normalizeEnv(_0x305fe4)===_0x4170c1(0x87);}export function isDev(_0xb37fbf){const _0x4cfccd=a133_0x1e467e,_0x4528ca=normalizeEnv(_0xb37fbf);return _0x4528ca===_0x4cfccd(0x8c)||_0x4528ca===_0x4cfccd(0x8d);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a133_0x1e467e(0x8f));export function getEnv(){return env;}function a133_0x3dee(_0x25ada1,_0x52fa1c){_0x25ada1=_0x25ada1-0x85;const _0x46b42a=a133_0x46b4();let _0x3dee70=_0x46b42a[_0x25ada1];return _0x3dee70;}export function initEnv(_0x3d4e71){env=normalizeEnv(_0x3d4e71);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x588fc8=a134_0x5aa3;function a134_0x1b98(){const _0xecd5bd=['430682oVejGr','53776ZkukJL','2145726TZTOmf','45508ujQLrq','13182381dypOhu','6uNRbYs','json','80IsUUAr','7175424AgClHN','3393278lyWvOU','compress'];a134_0x1b98=function(){return _0xecd5bd;};return a134_0x1b98();}(function(_0x33b642,_0x32f7ef){const _0x8c3842=a134_0x5aa3,_0x571cbb=_0x33b642();while(!![]){try{const _0x3f27d7=-parseInt(_0x8c3842(0xf7))/0x1+parseInt(_0x8c3842(0xf6))/0x2+-parseInt(_0x8c3842(0xf8))/0x3+-parseInt(_0x8c3842(0xee))/0x4*(-parseInt(_0x8c3842(0xf2))/0x5)+-parseInt(_0x8c3842(0xf0))/0x6*(-parseInt(_0x8c3842(0xf4))/0x7)+-parseInt(_0x8c3842(0xf3))/0x8+parseInt(_0x8c3842(0xef))/0x9;if(_0x3f27d7===_0x32f7ef)break;else _0x571cbb['push'](_0x571cbb['shift']());}catch(_0x396450){_0x571cbb['push'](_0x571cbb['shift']());}}}(a134_0x1b98,0xa63ba));function a134_0x5aa3(_0x4668f1,_0x3f1f44){_0x4668f1=_0x4668f1-0xee;const _0x1b9890=a134_0x1b98();let _0x5aa34d=_0x1b9890[_0x4668f1];return _0x5aa34d;}export const RABETBASE_OUTPUT_FORMAT_VALUES=[a134_0x588fc8(0xf1),'pretty',a134_0x588fc8(0xf5)];
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a135_0xfc68(){const _0x46d366=['29608gEAsdV','2869531huhZeC','1512325kxCmZo','675YwbgHg','6rMoeJO','8WwEbGp','591867fCBSxf','72XKdmty','2gvQhzl','199111oTbOlN','6447540RysWsL','442049opLKBa'];a135_0xfc68=function(){return _0x46d366;};return a135_0xfc68();}(function(_0x2af564,_0x33cb6c){const _0x38ce46=a135_0x1a91,_0xf37b25=_0x2af564();while(!![]){try{const _0x5b9526=parseInt(_0x38ce46(0x95))/0x1+-parseInt(_0x38ce46(0x92))/0x2*(-parseInt(_0x38ce46(0x9c))/0x3)+-parseInt(_0x38ce46(0x9b))/0x4*(parseInt(_0x38ce46(0x98))/0x5)+parseInt(_0x38ce46(0x9a))/0x6*(-parseInt(_0x38ce46(0x97))/0x7)+-parseInt(_0x38ce46(0x96))/0x8*(-parseInt(_0x38ce46(0x99))/0x9)+parseInt(_0x38ce46(0x94))/0xa+-parseInt(_0x38ce46(0x93))/0xb*(parseInt(_0x38ce46(0x91))/0xc);if(_0x5b9526===_0x33cb6c)break;else _0xf37b25['push'](_0xf37b25['shift']());}catch(_0x572cc7){_0xf37b25['push'](_0xf37b25['shift']());}}}(a135_0xfc68,0x6afb6));function a135_0x1a91(_0x3103d8,_0x505934){_0x3103d8=_0x3103d8-0x91;const _0xfc68c3=a135_0xfc68();let _0x1a9151=_0xfc68c3[_0x3103d8];return _0x1a9151;}export const DEFAULT_API_DIR='./src/api';
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a136_0x4e6225=a136_0xd71f;function a136_0x3663(){const _0x512e8e=['1358518LGJyLy','high-risk-write','23994081RyLKnx','37149WrLsdT','5532BnWRYG','3774492degKXC','10CsdHSa','2943075WgBmBw','2096vRtppq','1056BefcnJ','3476790nxSiwf'];a136_0x3663=function(){return _0x512e8e;};return a136_0x3663();}(function(_0x23297d,_0x130e8e){const _0x119949=a136_0xd71f,_0x180c45=_0x23297d();while(!![]){try{const _0x135642=parseInt(_0x119949(0x185))/0x1+-parseInt(_0x119949(0x183))/0x2*(parseInt(_0x119949(0x17e))/0x3)+-parseInt(_0x119949(0x17f))/0x4+-parseInt(_0x119949(0x181))/0x5+parseInt(_0x119949(0x184))/0x6+-parseInt(_0x119949(0x17d))/0x7*(parseInt(_0x119949(0x182))/0x8)+parseInt(_0x119949(0x187))/0x9*(parseInt(_0x119949(0x180))/0xa);if(_0x135642===_0x130e8e)break;else _0x180c45['push'](_0x180c45['shift']());}catch(_0x327926){_0x180c45['push'](_0x180c45['shift']());}}}(a136_0x3663,0xacc68));function a136_0xd71f(_0x243a1e,_0x32211c){_0x243a1e=_0x243a1e-0x17d;const _0x3663fa=a136_0x3663();let _0xd71f2c=_0x3663fa[_0x243a1e];return _0xd71f2c;}export const RISK_LEVEL_VALUES=['read','write',a136_0x4e6225(0x186)];
|