@lovrabet/rabetbase-cli 2.1.10-beta.2 → 2.1.10-beta.3
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 -1
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_0x240423=a122_0x42f3;(function(_0x5df11e,_0x44e5f3){const _0x305e99=a122_0x42f3,_0x520223=_0x5df11e();while(!![]){try{const _0x99b98a=parseInt(_0x305e99(0xa2))/0x1*(-parseInt(_0x305e99(0x95))/0x2)+parseInt(_0x305e99(0xb0))/0x3+-parseInt(_0x305e99(0x93))/0x4+-parseInt(_0x305e99(0x9f))/0x5+-parseInt(_0x305e99(0x90))/0x6+-parseInt(_0x305e99(0xa1))/0x7+parseInt(_0x305e99(0x96))/0x8;if(_0x99b98a===_0x44e5f3)break;else _0x520223['push'](_0x520223['shift']());}catch(_0x2bc0d8){_0x520223['push'](_0x520223['shift']());}}}(a122_0x388c,0x3cb89));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';function a122_0x388c(){const _0x12758f=['sqlCode','Force\x20pull\x20cancelled.','push','local\x20differs\x20from\x20remote','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqls','write','sqlRootDir','path','filter','Pull\x20complete:\x20','trimStart','appCode','tableData','nonInteractive','lockFilePath','1269246bSFtzn','message','sqlName','1958860wWjdJm','description','4cXGEUY','11554784BHlkCu','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','join','utf8','Force\x20overwrite\x20local\x20unsynced\x20changes','catch','test','sqlRoot','POST','1236320vMbgSl','sqlContent','2857862VoPgmN','129201xGeqMe','sql','replace','force','apps','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','Would\x20pull\x20','\x20failed','mybatisXml','skipped','toISOString','dbId','unchanged','str','1258659qdyKHV','length','boolean','sqlcode','string','\x20SQL\x20file(s)\x20into\x20','pull','conflict','split','name'];a122_0x388c=function(){return _0x12758f;};return a122_0x388c();}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';function a122_0x42f3(_0x12b815,_0x59c780){_0x12b815=_0x12b815-0x81;const _0x388cec=a122_0x388c();let _0x42f39c=_0x388cec[_0x12b815];return _0x42f39c;}const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x5528e5,_0x32727b){const _0x21426c=a122_0x42f3,_0x3d20aa=[];let _0x46e8b2=0x1;while(!![]){const _0x88293=await listSqlQueries(_0x5528e5,{'currentPage':_0x46e8b2,'pageSize':PAGE_SIZE,'sqlCode':_0x32727b[_0x21426c(0xba)],'sqlName':_0x32727b[_0x21426c(0x92)]}),_0x4c60b8=_0x88293[_0x21426c(0x8d)]??[];_0x3d20aa[_0x21426c(0x82)](..._0x4c60b8);if(_0x4c60b8['length']===0x0)break;const _0xeb2ca7=_0x88293['paging']?.['totalCount'];if(_0xeb2ca7!=null?_0x3d20aa['length']>=_0xeb2ca7:_0x4c60b8[_0x21426c(0xb1)]<PAGE_SIZE)break;_0x46e8b2++;}return _0x3d20aa;}async function ensureSqlContent(_0x5b6cc0){const _0x5f4ae1=a122_0x42f3;if(_0x5b6cc0[_0x5f4ae1(0xa0)]!=null&&String(_0x5b6cc0[_0x5f4ae1(0xa0)])[_0x5f4ae1(0xb1)]>0x0)return _0x5b6cc0;return getSqlQueryDetail(_0x5b6cc0[_0x5f4ae1(0xba)]);}export const sqlPull={'service':a122_0x240423(0xa3),'command':a122_0x240423(0xb6),'description':a122_0x240423(0x84),'risk':a122_0x240423(0x86),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a122_0x240423(0xb9),'type':a122_0x240423(0xb4),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a122_0x240423(0xa5),'type':a122_0x240423(0xb2),'description':a122_0x240423(0x9a)}],async 'dryRun'(_0x474acc){const _0x241cce=a122_0x240423,_0x4d0d68=loadSqlProjectConfig(_0x474acc[_0x241cce(0x8c)]),_0x59979b=await readSqlLockFile(_0x4d0d68[_0x241cce(0x8f)]),{appLock:_0x43ee08}=ensureSqlLockScope(_0x59979b??createEmptySqlLock(),_0x4d0d68['appCode'],_0x4d0d68[_0x241cce(0x9d)],_0x241cce(0xb6)),_0x3d7330=await fetchAllSqlQueries(_0x474acc[_0x241cce(0x8c)],{'sqlCode':_0x474acc[_0x241cce(0xaf)]('sqlcode')||undefined,'sqlName':_0x474acc[_0x241cce(0xaf)](_0x241cce(0xb9))||undefined}),_0x11e984=[];for(const _0x335769 of _0x3d7330){const _0x536970=await ensureSqlContent(_0x335769),_0x281d06=ensureRemoteSqlContent(_0x536970),_0x5565fc=detectModeFromSql(_0x536970),_0x34bc55=_0x536970[_0x241cce(0xad)]?await getDbName(_0x474acc[_0x241cce(0x8c)],Number(_0x536970['dbId']))[_0x241cce(0x9b)](()=>undefined):undefined,_0x36bc22=buildLocalSqlFileContent({'sqlCode':_0x536970['sqlCode'],'sqlName':_0x536970['sqlName'],'dbId':_0x536970[_0x241cce(0xad)]},_0x281d06,{'dbName':_0x34bc55,'mode':_0x5565fc,'syncedAt':new Date()[_0x241cce(0xac)](),'description':_0x536970[_0x241cce(0x94)]}),_0x128db0=buildSqlLockEntry(_0x536970,_0x281d06,'',{'dbName':_0x34bc55}),_0x40740f=resolveLocalSqlFilePath(_0x4d0d68,_0x536970['sqlCode'],_0x128db0);let _0xdd2bda='would_pull',_0x1d64ba;if(await fileExists(_0x40740f)){const _0x23885a=await readFile(_0x40740f,_0x241cce(0x99));isEquivalentPulledSqlFile(_0x23885a,_0x36bc22,_0x5565fc)?(_0xdd2bda=_0x241cce(0xab),_0x1d64ba=_0x241cce(0xae)):(_0xdd2bda=_0x241cce(0xb7),_0x1d64ba=_0x241cce(0xa7));}_0x11e984[_0x241cce(0x82)]({'sqlCode':_0x536970[_0x241cce(0xba)],'sqlName':_0x536970[_0x241cce(0x92)],'filePath':_0x40740f,'status':_0xdd2bda,'reason':_0x1d64ba});}return{'method':_0x241cce(0x9e),'url':_0x241cce(0x97),'body':{'appCode':_0x474acc[_0x241cce(0x8c)],'sqlCode':_0x474acc[_0x241cce(0xaf)](_0x241cce(0xb3))||null,'sqlName':_0x474acc['str'](_0x241cce(0xb9))||null,'files':_0x11e984},'description':_0x241cce(0xa8)+_0x11e984['length']+_0x241cce(0xb5)+_0x4d0d68['sqlRootDir']};},async 'execute'(_0x2af192){const _0x43addd=a122_0x240423,_0x1a2886=loadSqlProjectConfig(_0x2af192['appCode']),_0x5ca85e=await readSqlLockFile(_0x1a2886['lockFilePath']),{lockData:_0x97f80f,appLock:_0x3c0e3e}=ensureSqlLockScope(_0x5ca85e??createEmptySqlLock(),_0x1a2886[_0x43addd(0x8c)],_0x1a2886[_0x43addd(0x9d)],_0x43addd(0xb6)),_0x5881ac=_0x2af192['bool']('force'),_0x59dd88=await fetchAllSqlQueries(_0x2af192[_0x43addd(0x8c)],{'sqlCode':_0x2af192['str'](_0x43addd(0xb3))||undefined,'sqlName':_0x2af192[_0x43addd(0xaf)](_0x43addd(0xb9))||undefined});if(_0x59dd88['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x28a84d=[],_0x14795f=[];for(const _0x41e92c of _0x59dd88){try{_0x28a84d[_0x43addd(0x82)](await ensureSqlContent(_0x41e92c));}catch(_0x4b6d3d){_0x14795f['push']({'sqlCode':_0x41e92c[_0x43addd(0xba)],'error':_0x4b6d3d instanceof Error?_0x4b6d3d[_0x43addd(0x91)]:String(_0x4b6d3d)});}}if(_0x5881ac&&!_0x2af192[_0x43addd(0x8e)]){let _0xc5ac6d=![];for(const _0x5f9bf3 of _0x28a84d){const _0x52673f=detectModeFromSql(_0x5f9bf3),_0x55f9bc=_0x5f9bf3[_0x43addd(0xad)]?await getDbName(_0x2af192[_0x43addd(0x8c)],Number(_0x5f9bf3[_0x43addd(0xad)]))[_0x43addd(0x9b)](()=>undefined):undefined,_0x55d65e=buildLocalSqlFileContent({'sqlCode':_0x5f9bf3['sqlCode'],'sqlName':_0x5f9bf3[_0x43addd(0x92)],'dbId':_0x5f9bf3[_0x43addd(0xad)]},ensureRemoteSqlContent(_0x5f9bf3),{'dbName':_0x55f9bc,'mode':_0x52673f,'syncedAt':new Date()['toISOString'](),'description':_0x5f9bf3['description']}),_0x387b0a=resolveLocalSqlFilePath(_0x1a2886,_0x5f9bf3[_0x43addd(0xba)],buildSqlLockEntry(_0x5f9bf3,ensureRemoteSqlContent(_0x5f9bf3),'',{'dbName':_0x55f9bc}));if(await fileExists(_0x387b0a)){const _0x2ef27a=await readFile(_0x387b0a,_0x43addd(0x99));if(!isEquivalentPulledSqlFile(_0x2ef27a,_0x55d65e,_0x52673f)){_0xc5ac6d=!![];break;}}}if(_0xc5ac6d){const _0x146f9f=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x146f9f)throw CliErrors['cancelled'](_0x43addd(0x81));}}const _0x2b98e2=cloneSqlLockData(_0x97f80f),_0x28d5ec=_0x2b98e2[_0x43addd(0xa6)][_0x1a2886[_0x43addd(0x8c)]],_0x367085=[],_0xa01527=[];for(const _0x36c7d2 of _0x28a84d){const _0x1361d5=_0x28d5ec[_0x43addd(0x85)][_0x36c7d2[_0x43addd(0xba)]],_0x1f8c53=ensureRemoteSqlContent(_0x36c7d2),_0x19d912=detectModeFromSql(_0x36c7d2),_0x4c9090=_0x36c7d2[_0x43addd(0xad)]?await getDbName(_0x2af192[_0x43addd(0x8c)],Number(_0x36c7d2['dbId']))['catch'](()=>undefined):undefined,_0x2d0548=buildLocalSqlFileContent({'sqlCode':_0x36c7d2[_0x43addd(0xba)],'sqlName':_0x36c7d2[_0x43addd(0x92)],'dbId':_0x36c7d2['dbId']},_0x1f8c53,{'dbName':_0x4c9090,'mode':_0x19d912,'syncedAt':new Date()[_0x43addd(0xac)](),'description':_0x36c7d2[_0x43addd(0x94)]}),_0x4fc375=buildSqlLockEntry(_0x36c7d2,_0x1f8c53,computeSqlContentHash(_0x2d0548),{'dbName':_0x4c9090}),_0x3d1cc8=_0x4fc375['path'],_0x5dadb1=join(_0x1a2886[_0x43addd(0x87)],_0x3d1cc8);try{if(await fileExists(_0x5dadb1)){const _0x14b893=await readFile(_0x5dadb1,_0x43addd(0x99));if(isEquivalentPulledSqlFile(_0x14b893,_0x2d0548,_0x19d912)){_0xa01527['push']({'sqlCode':_0x36c7d2[_0x43addd(0xba)],'reason':_0x43addd(0xae)}),_0x28d5ec[_0x43addd(0x85)][_0x36c7d2['sqlCode']]={..._0x4fc375,'hash':computeSqlContentHash(_0x14b893),'path':_0x3d1cc8};continue;}if(!_0x5881ac){_0xa01527[_0x43addd(0x82)]({'sqlCode':_0x36c7d2[_0x43addd(0xba)],'reason':_0x43addd(0x83)});continue;}}const _0xed11b0=_0x1361d5?.[_0x43addd(0x88)]?join(_0x1a2886['sqlRootDir'],_0x1361d5['path']):undefined;_0xed11b0&&_0xed11b0!==_0x5dadb1&&await fileExists(_0xed11b0)&&await rm(_0xed11b0,{'force':!![]}),await ensureParentDirectory(_0x5dadb1),await writeFile(_0x5dadb1,_0x2d0548,_0x43addd(0x99)),_0x28d5ec[_0x43addd(0x85)][_0x36c7d2['sqlCode']]={..._0x4fc375,'path':_0x3d1cc8},_0x367085['push']({'sqlCode':_0x36c7d2[_0x43addd(0xba)],'filePath':_0x5dadb1});}catch(_0x56b3ad){_0x14795f[_0x43addd(0x82)]({'sqlCode':_0x36c7d2['sqlCode'],'error':_0x56b3ad instanceof Error?_0x56b3ad[_0x43addd(0x91)]:String(_0x56b3ad)});}}return _0x28d5ec['lastSync']=new Date()[_0x43addd(0xac)](),await writeSqlLockFile(_0x1a2886[_0x43addd(0x8f)],_0x2b98e2),{'ok':_0x14795f[_0x43addd(0xb1)]===0x0,'data':{'pulled':_0x367085,'skipped':_0xa01527,'failed':_0x14795f},'message':_0x43addd(0x8a)+_0x367085[_0x43addd(0xb1)]+'\x20written,\x20'+_0xa01527[_0x43addd(0xb1)]+'\x20skipped,\x20'+_0x14795f[_0x43addd(0xb1)]+_0x43addd(0xa9)};}};function detectModeFromSql(_0x43c902){const _0x3715f9=a122_0x240423,_0x68cb51=ensureRemoteSqlContent(_0x43c902),_0x55bfd4=stripLocalSqlMetadata(_0x68cb51,_0x3715f9(0xaa))[_0x3715f9(0x8b)]();if(/^<(select|insert|update|delete)\b/i[_0x3715f9(0x9c)](_0x55bfd4))return _0x3715f9(0xaa);return _0x3715f9(0xa3);}function isEquivalentPulledSqlFile(_0x1f633e,_0x713836,_0x47d194){return normalizePullComparableContent(_0x1f633e,_0x47d194)===normalizePullComparableContent(_0x713836,_0x47d194);}function normalizePullComparableContent(_0x46673d,_0xb5d1cd){const _0x450bbd=a122_0x240423,_0x52591e=_0x46673d[_0x450bbd(0xa4)](/\r\n/g,'\x0a')[_0x450bbd(0xb8)]('\x0a'),_0xb6dc03=_0x52591e[_0x450bbd(0x89)](_0x1a81fd=>!isSyncedAtMetadataLine(_0x1a81fd,_0xb5d1cd));return _0xb6dc03[_0x450bbd(0x98)]('\x0a');}function isSyncedAtMetadataLine(_0x3a2f50,_0x7c86d1){const _0x5b89b0=a122_0x240423;if(_0x7c86d1===_0x5b89b0(0xaa))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x3a2f50);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x5b89b0(0x9c)](_0x3a2f50);}
|
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_0x5687c4=a123_0x3513;(function(_0x45883e,_0x11f53d){const _0x3685d8=a123_0x3513,_0x5df8e8=_0x45883e();while(!![]){try{const _0x1ff3d2=-parseInt(_0x3685d8(0x18a))/0x1+parseInt(_0x3685d8(0x17f))/0x2*(parseInt(_0x3685d8(0x177))/0x3)+-parseInt(_0x3685d8(0x18e))/0x4*(parseInt(_0x3685d8(0x17d))/0x5)+parseInt(_0x3685d8(0x188))/0x6*(-parseInt(_0x3685d8(0x17b))/0x7)+parseInt(_0x3685d8(0x14b))/0x8+-parseInt(_0x3685d8(0x14f))/0x9+-parseInt(_0x3685d8(0x164))/0xa*(-parseInt(_0x3685d8(0x152))/0xb);if(_0x1ff3d2===_0x11f53d)break;else _0x5df8e8['push'](_0x5df8e8['shift']());}catch(_0x5d5746){_0x5df8e8['push'](_0x5df8e8['shift']());}}}(a123_0x1d29,0x27174));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a123_0x1d29(){const _0x120767=['/smartapi/custom/updateUserCustomSql','high-risk-write','map','1396880fMeMbO','validation','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','Push\x20local\x20SQL\x20files\x20to\x20remote','2523492fCOSAX','bool','remoteId','11VxdTdS','relativePath','trashDir','sqlRoot','No\x20local\x20SQL\x20files\x20found.','projectRoot','force','str','boolean','\x20pushed,\x20','sqlName','sqlRootDir','dbName','Push\x20complete:\x20','catch','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','No\x20database\x20matches\x20local\x20directory\x20\x22','Would\x20push\x20','7102240rqPaLU','Local\x20SQL\x20not\x20found:\x20','dbId','\x20SQL\x20file(s)','push','appCode','join','sqls','startsWith','\x22\x20for\x20sqlCode\x20','entries','sqlcode','sql','unchanged','exec','\x20failed','set','isFinite','lockFilePath','42OspNFZ','filePath','path','Local\x20directory\x20\x22','35FAfHJt','filter','138235voXTAU','has','6542IAbDqe','length','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sqlCode','mode','utf8','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','lastSync','sqlConfig','62676glOrbi','hash','216718kfUDKp','version','\x20skipped,\x20','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','32rdwZEv','dbDirectory'];a123_0x1d29=function(){return _0x120767;};return a123_0x1d29();}import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';function a123_0x3513(_0x1290b0,_0x2010e1){_0x1290b0=_0x1290b0-0x149;const _0x1d2987=a123_0x1d29();let _0x351379=_0x1d2987[_0x1290b0];return _0x351379;}async function getTargetSqlQueries(_0x189660,_0x1c8e24,_0x329c28){const _0x2beb2a=a123_0x3513,_0x5d4a07=await scanLocalSqlQueries(_0x189660),_0x5388fd=new Map();for(const _0x57086c of _0x5d4a07){if(_0x329c28&&_0x57086c[_0x2beb2a(0x182)]!==_0x329c28)continue;const _0x8723ed=_0x5388fd['get'](_0x57086c[_0x2beb2a(0x182)])??[];_0x8723ed[_0x2beb2a(0x168)](_0x57086c),_0x5388fd[_0x2beb2a(0x174)](_0x57086c[_0x2beb2a(0x182)],_0x8723ed);}if(_0x329c28&&!_0x5388fd[_0x2beb2a(0x17e)](_0x329c28))throw CliErrors[_0x2beb2a(0x14c)](_0x2beb2a(0x165)+_0x329c28);const _0xfe777e=[];for(const [_0x399ccf,_0xb6981c]of _0x5388fd[_0x2beb2a(0x16e)]()){if(_0xb6981c[_0x2beb2a(0x180)]===0x1){_0xfe777e[_0x2beb2a(0x168)](_0xb6981c[0x0]);continue;}const _0x125567=_0x1c8e24['sqls'][_0x399ccf],_0x225bbc=_0x125567?.[_0x2beb2a(0x179)],_0x29abe4=_0x225bbc?_0xb6981c[_0x2beb2a(0x17c)](_0x2e7a3d=>_0x2e7a3d[_0x2beb2a(0x153)]!==_0x225bbc):_0xb6981c;if(_0x125567&&_0x29abe4[_0x2beb2a(0x180)]===0x1){_0xfe777e['push'](_0x29abe4[0x0]);continue;}throw CliErrors[_0x2beb2a(0x14c)](_0x2beb2a(0x185)+_0x399ccf+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0xfe777e;}export const sqlPush={'service':a123_0x5687c4(0x170),'command':a123_0x5687c4(0x168),'description':a123_0x5687c4(0x14e),'risk':a123_0x5687c4(0x149),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a123_0x5687c4(0x158),'type':a123_0x5687c4(0x15a),'description':a123_0x5687c4(0x14d)}],async 'dryRun'(_0x184dc5){const _0x1e9471=a123_0x5687c4,_0x1150e0=loadSqlProjectConfig(_0x184dc5['appCode']),_0x2f9366=await readSqlLockFile(_0x1150e0['lockFilePath']),{appLock:_0x7fc70e}=ensureSqlLockScope(_0x2f9366??createEmptySqlLock(),_0x184dc5[_0x1e9471(0x169)],_0x1150e0[_0x1e9471(0x155)],_0x1e9471(0x168)),_0x40937a=await getTargetSqlQueries(_0x1150e0,_0x7fc70e,_0x184dc5['str']('sqlcode')||undefined),_0x467869=[];for(const _0x4dd599 of _0x40937a){const _0x3e16b8=await computeSqlFileHash(_0x4dd599[_0x1e9471(0x178)]),_0xd1ebd1=_0x7fc70e[_0x1e9471(0x16b)][_0x4dd599[_0x1e9471(0x182)]],_0x574ae7=!!_0xd1ebd1&&(_0xd1ebd1[_0x1e9471(0x179)]!==_0x4dd599[_0x1e9471(0x153)]||!!_0x4dd599['sqlName']&&_0xd1ebd1[_0x1e9471(0x15c)]!==_0x4dd599[_0x1e9471(0x15c)]);if(!_0x184dc5[_0x1e9471(0x150)](_0x1e9471(0x158))&&_0xd1ebd1&&_0xd1ebd1[_0x1e9471(0x189)]===_0x3e16b8&&!_0x574ae7)continue;_0x467869[_0x1e9471(0x168)](_0x4dd599[_0x1e9471(0x182)]);}return{'method':'POST','url':_0x1e9471(0x190),'body':{'sqlCodes':_0x467869,'appCode':_0x184dc5[_0x1e9471(0x169)]},'description':_0x1e9471(0x163)+_0x467869[_0x1e9471(0x180)]+_0x1e9471(0x167)};},async 'execute'(_0x1b80eb){const _0x5b5457=a123_0x5687c4,_0x283d12=loadSqlProjectConfig(_0x1b80eb['appCode']),_0x32132a=await readSqlLockFile(_0x283d12[_0x5b5457(0x176)]),{lockData:_0x1baa5e,appLock:_0x34eaed}=ensureSqlLockScope(_0x32132a??createEmptySqlLock(),_0x1b80eb[_0x5b5457(0x169)],_0x283d12[_0x5b5457(0x155)],_0x5b5457(0x168)),_0x22645d=await getTargetSqlQueries(_0x283d12,_0x34eaed,_0x1b80eb[_0x5b5457(0x159)](_0x5b5457(0x16f))||undefined);if(_0x22645d[_0x5b5457(0x180)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x5b5457(0x156)};const _0x21af23=[],_0x17a456=[],_0x5752dd=[];for(const _0x910c80 of _0x22645d){const _0x400a4d=_0x34eaed['sqls'][_0x910c80[_0x5b5457(0x182)]];if(!_0x400a4d){_0x5752dd[_0x5b5457(0x168)]({'sqlCode':_0x910c80[_0x5b5457(0x182)],'error':_0x5b5457(0x161)});continue;}try{const _0x37d02c=await computeSqlFileHash(_0x910c80[_0x5b5457(0x178)]),_0x4db4cd=_0x400a4d['path']!==_0x910c80[_0x5b5457(0x153)]||!!_0x910c80[_0x5b5457(0x15c)]&&_0x400a4d[_0x5b5457(0x15c)]!==_0x910c80[_0x5b5457(0x15c)];if(!_0x1b80eb[_0x5b5457(0x150)]('force')&&_0x400a4d['hash']===_0x37d02c&&!_0x4db4cd){_0x17a456[_0x5b5457(0x168)]({'sqlCode':_0x910c80[_0x5b5457(0x182)],'reason':_0x5b5457(0x171)});continue;}if(_0x400a4d[_0x5b5457(0x18b)]==null){_0x5752dd[_0x5b5457(0x168)]({'sqlCode':_0x910c80[_0x5b5457(0x182)],'error':_0x5b5457(0x181)});continue;}const _0x2a9c4a=await readFile(_0x910c80['filePath'],_0x5b5457(0x184)),_0x34e1fe=stripLocalSqlMetadata(_0x2a9c4a,_0x910c80[_0x5b5457(0x183)]),_0x22a86f=_0x910c80[_0x5b5457(0x15c)]||_0x400a4d['sqlName'],_0x201a61=await resolveTargetDbBinding(_0x1b80eb[_0x5b5457(0x169)],_0x910c80,_0x400a4d),_0x3a32e0=await updateSqlQuery({'id':_0x400a4d[_0x5b5457(0x151)],'appCode':_0x1b80eb[_0x5b5457(0x169)],'sqlCode':_0x910c80[_0x5b5457(0x182)],'sqlName':_0x22a86f,'dbId':_0x201a61[_0x5b5457(0x166)],'version':_0x400a4d[_0x5b5457(0x18b)],'sqlContent':_0x34e1fe,'sqlConfig':_0x400a4d[_0x5b5457(0x187)]??undefined}),_0x3fe639=_0x3a32e0[_0x5b5457(0x166)]?await getDbName(_0x1b80eb[_0x5b5457(0x169)],Number(_0x3a32e0['dbId']))[_0x5b5457(0x160)](()=>_0x201a61[_0x5b5457(0x15e)]):_0x201a61[_0x5b5457(0x15e)];_0x34eaed['sqls'][_0x910c80[_0x5b5457(0x182)]]={...buildSqlLockEntry(_0x3a32e0,_0x34e1fe,_0x37d02c,{'dbName':_0x3fe639}),'path':_0x910c80[_0x5b5457(0x153)],'mode':_0x400a4d[_0x5b5457(0x183)]},await archivePreviousSqlFileIfNeeded(_0x283d12,_0x400a4d[_0x5b5457(0x179)],_0x910c80[_0x5b5457(0x153)]),_0x21af23[_0x5b5457(0x168)]({'sqlCode':_0x910c80[_0x5b5457(0x182)],'remoteId':_0x400a4d[_0x5b5457(0x151)]});}catch(_0x5eb0b9){_0x5752dd[_0x5b5457(0x168)]({'sqlCode':_0x910c80[_0x5b5457(0x182)],'error':_0x5eb0b9 instanceof Error?_0x5eb0b9['message']:String(_0x5eb0b9)});}}return _0x34eaed[_0x5b5457(0x186)]=new Date()['toISOString'](),await writeSqlLockFile(_0x283d12[_0x5b5457(0x176)],_0x1baa5e),{'ok':_0x5752dd[_0x5b5457(0x180)]===0x0,'data':{'pushed':_0x21af23,'skipped':_0x17a456,'failed':_0x5752dd},'message':_0x5b5457(0x15f)+_0x21af23[_0x5b5457(0x180)]+_0x5b5457(0x15b)+_0x17a456[_0x5b5457(0x180)]+_0x5b5457(0x18c)+_0x5752dd[_0x5b5457(0x180)]+_0x5b5457(0x173)};}};async function archivePreviousSqlFileIfNeeded(_0x277173,_0x5da1b0,_0x500fd9){const _0xc5f126=a123_0x5687c4;if(!_0x5da1b0||_0x5da1b0===_0x500fd9)return;const _0x9c8d1f=join(_0x277173[_0xc5f126(0x15d)],_0x5da1b0);if(!await fileExists(_0x9c8d1f))return;const _0x591315=await moveToTrash(_0x277173[_0xc5f126(0x157)],_0x277173[_0xc5f126(0x154)],_0x9c8d1f);await cleanupEmptyDirectories(dirname(_0x9c8d1f),_0x277173[_0xc5f126(0x15d)]),void _0x591315;}async function moveToTrash(_0x402ea9,_0x3a5a19,_0x197566){const _0x4b87d7=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x39a6db=relative(_0x402ea9,_0x197566),_0x36f43d=join(_0x3a5a19,_0x4b87d7,_0x39a6db);return await mkdir(dirname(_0x36f43d),{'recursive':!![]}),await rename(_0x197566,_0x36f43d),_0x36f43d;}async function cleanupEmptyDirectories(_0x1e8005,_0x37d615){const _0x55189a=a123_0x5687c4;let _0x231797=resolve(_0x1e8005);const _0x1f243d=resolve(_0x37d615);while(_0x231797[_0x55189a(0x16c)](''+_0x1f243d+sep)||_0x231797===_0x1f243d){if(_0x231797===_0x1f243d)return;try{const _0x43f514=await readdir(_0x231797);if(_0x43f514[_0x55189a(0x180)]>0x0)return;await rmdir(_0x231797);}catch{return;}_0x231797=dirname(_0x231797);}}async function resolveTargetDbBinding(_0xf47aa,_0x379702,_0x2b3144){const _0x5e8670=a123_0x5687c4,_0x1f5df9=_0x379702[_0x5e8670(0x18f)];if(!_0x1f5df9)return{'dbId':_0x2b3144[_0x5e8670(0x166)],'dbName':_0x2b3144[_0x5e8670(0x15e)]};const _0x2caa92=buildDbDirectoryName(_0x2b3144['dbName'],_0x2b3144[_0x5e8670(0x166)]);if(_0x1f5df9===_0x2caa92)return{'dbId':_0x2b3144['dbId'],'dbName':_0x2b3144[_0x5e8670(0x15e)]};const _0x4e36f5=parseExplicitDbDirectory(_0x1f5df9);if(_0x4e36f5!=null)return{'dbId':_0x4e36f5,'dbName':await getDbName(_0xf47aa,_0x4e36f5)[_0x5e8670(0x160)](()=>undefined)};const _0x2b30fd=await listDatabases(_0xf47aa),_0x31c58d=_0x2b30fd[_0x5e8670(0x17c)](_0x4845d7=>buildDbDirectoryName(_0x4845d7[_0x5e8670(0x15e)],_0x4845d7[_0x5e8670(0x166)])===_0x1f5df9);if(_0x31c58d[_0x5e8670(0x180)]===0x1)return{'dbId':_0x31c58d[0x0][_0x5e8670(0x166)],'dbName':_0x31c58d[0x0][_0x5e8670(0x15e)]};if(_0x31c58d[_0x5e8670(0x180)]===0x0)throw CliErrors[_0x5e8670(0x14c)](_0x5e8670(0x162)+_0x1f5df9+_0x5e8670(0x16d)+_0x379702[_0x5e8670(0x182)]+'.');const _0x184e53=_0x31c58d[_0x5e8670(0x14a)](_0x20747d=>_0x20747d[_0x5e8670(0x15e)]+'\x20('+_0x20747d['dbId']+')')[_0x5e8670(0x16a)](',\x20');throw CliErrors[_0x5e8670(0x14c)](_0x5e8670(0x17a)+_0x1f5df9+_0x5e8670(0x18d)+_0x379702['sqlCode']+':\x20'+_0x184e53);}function parseExplicitDbDirectory(_0x5d2f7d){const _0x342dcc=a123_0x5687c4,_0x53e0f5=/^db-(\d+)$/[_0x342dcc(0x172)](_0x5d2f7d);if(!_0x53e0f5)return null;const _0xfabd0f=Number(_0x53e0f5[0x1]);return Number[_0x342dcc(0x175)](_0xfabd0f)&&_0xfabd0f>0x0?_0xfabd0f:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a124_0x1dc5(){const _0x3595f0=['sql','SQL\x20query\x20display\x20name','838664jUBkxq','1303196AYwUTu','1rIqHgx','30446FQxsbb','join','18peACWe','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','description','write','string','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','save','12104780ydMqtF','file','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`.','sqlname','411024PhIJbB','3397072EBjtWM','1910232KpFmkP','5ywZiTI','validation'];a124_0x1dc5=function(){return _0x3595f0;};return a124_0x1dc5();}const a124_0x2db467=a124_0x1972;(function(_0x17a8e6,_0x129911){const _0x5cfcdb=a124_0x1972,_0x54953b=_0x17a8e6();while(!![]){try{const _0x2fb250=parseInt(_0x5cfcdb(0x123))/0x1*(-parseInt(_0x5cfcdb(0x124))/0x2)+parseInt(_0x5cfcdb(0x11c))/0x3+parseInt(_0x5cfcdb(0x122))/0x4*(parseInt(_0x5cfcdb(0x11d))/0x5)+-parseInt(_0x5cfcdb(0x11a))/0x6+parseInt(_0x5cfcdb(0x11b))/0x7+-parseInt(_0x5cfcdb(0x121))/0x8*(-parseInt(_0x5cfcdb(0x126))/0x9)+-parseInt(_0x5cfcdb(0x116))/0xa;if(_0x2fb250===_0x129911)break;else _0x54953b['push'](_0x54953b['shift']());}catch(_0x587add){_0x54953b['push'](_0x54953b['shift']());}}}(a124_0x1dc5,0x58b24));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=['`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.',a124_0x2db467(0x127),a124_0x2db467(0x118)][a124_0x2db467(0x125)]('\x0a');function a124_0x1972(_0x306ac8,_0x3f6e91){_0x306ac8=_0x306ac8-0x115;const _0x1dc588=a124_0x1dc5();let _0x197264=_0x1dc588[_0x306ac8];return _0x197264;}export const sqlSave={'service':a124_0x2db467(0x11f),'command':a124_0x2db467(0x115),'description':a124_0x2db467(0x12b),'risk':a124_0x2db467(0x129),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a124_0x2db467(0x117),'type':a124_0x2db467(0x12a),'required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':a124_0x2db467(0x119),'type':'string','description':a124_0x2db467(0x120)},{'name':'db','type':a124_0x2db467(0x12a),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':a124_0x2db467(0x128),'type':'string','description':'Query\x20description'}],async 'validate'(){const _0x3cb513=a124_0x2db467;throw CliErrors[_0x3cb513(0x11e)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x55d8a7=a124_0x2db467;throw CliErrors[_0x55d8a7(0x11e)](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a125_0x545810=a125_0x2f0c;(function(_0x4cf807,_0x249e06){const _0x2e91a0=a125_0x2f0c,_0x1c485f=_0x4cf807();while(!![]){try{const _0x3a81c6=parseInt(_0x2e91a0(0xa7))/0x1+parseInt(_0x2e91a0(0x8b))/0x2+-parseInt(_0x2e91a0(0xa0))/0x3*(-parseInt(_0x2e91a0(0x9f))/0x4)+-parseInt(_0x2e91a0(0x91))/0x5*(-parseInt(_0x2e91a0(0xa4))/0x6)+parseInt(_0x2e91a0(0xad))/0x7+-parseInt(_0x2e91a0(0xb7))/0x8*(-parseInt(_0x2e91a0(0x96))/0x9)+-parseInt(_0x2e91a0(0x92))/0xa;if(_0x3a81c6===_0x249e06)break;else _0x1c485f['push'](_0x1c485f['shift']());}catch(_0x484f8c){_0x1c485f['push'](_0x1c485f['shift']());}}}(a125_0xfe1d,0x77e8a));import{createInterface}from'node:readline';import{join}from'node:path';function a125_0xfe1d(){const _0x49f2a0=['4609194rMgSSy','yes','<!--\x20@lovrabet.','479849dzOrsf','filter','sqlRoot','apps','fromEntries','endsWith','2803437ZgTGRO','description','mybatisXml','\x20-->','toLowerCase','trimStart','length','entries','syncedAt','map','2628720mrHjbi','.rabetbase/sql','join','191286dFOHDZ','trim','close','mode','path','dbId','5tEuOQW','22650500dphZXG','split','version','\x20[y/N]\x20','9NnnFyE','sqlName','sqlContent','question','sqlCode','stderr','test','includes','push','151872LAjyia','54usIJSk','stdin','dbName','replace'];a125_0xfe1d=function(){return _0x49f2a0;};return a125_0xfe1d();}import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a125_0x545810(0x89);export function buildSqlLockEntry(_0x283376,_0x25f5aa,_0x2de795,_0x1ba195){const _0x168401=a125_0x545810,_0x489115=detectSqlMode(_0x25f5aa);return{'path':buildSqlRelativePath(_0x283376['sqlCode'],_0x283376[_0x168401(0x97)],_0x1ba195?.[_0x168401(0xa2)],_0x489115,_0x283376[_0x168401(0x90)]),'hash':_0x2de795,'remoteId':_0x283376['id'],'version':_0x283376[_0x168401(0x94)],'dbId':Number(_0x283376[_0x168401(0x90)]),'dbName':_0x1ba195?.['dbName'],'sqlName':_0x283376['sqlName'],'sqlConfig':_0x283376['sqlConfig']??undefined,'mode':_0x489115};}function a125_0x2f0c(_0x234543,_0x482821){_0x234543=_0x234543-0x89;const _0xfe1de8=a125_0xfe1d();let _0x2f0c72=_0xfe1de8[_0x234543];return _0x2f0c72;}export function cloneSqlLockData(_0x466648){const _0x314b3c=a125_0x545810;return{'apps':Object[_0x314b3c(0xab)](Object[_0x314b3c(0xb4)](_0x466648[_0x314b3c(0xaa)])[_0x314b3c(0xb6)](([_0x48fb6e,_0x33c9c6])=>[_0x48fb6e,{'sqlRoot':_0x33c9c6[_0x314b3c(0xa9)],'lastSync':_0x33c9c6['lastSync'],'sqls':{..._0x33c9c6['sqls']}}]))};}export function ensureRemoteSqlContent(_0x449b89){const _0x5982f0=a125_0x545810;return _0x449b89[_0x5982f0(0x98)]??'';}export function buildLocalSqlFileContent(_0x44b28c,_0x185945,_0x51cc1a){const _0x5a8b4c=a125_0x545810,_0x5a284c=_0x51cc1a?.[_0x5a8b4c(0x8e)]??detectSqlMode(_0x185945),_0x5aaad5=stripLocalSqlMetadata(_0x185945,_0x5a284c)[_0x5a8b4c(0x8c)](),_0x3701c6=[...buildMetadataHeaderLines({'sqlCode':_0x44b28c[_0x5a8b4c(0x9a)],'sqlName':_0x44b28c[_0x5a8b4c(0x97)],'dbId':_0x44b28c['dbId'],'dbName':_0x51cc1a?.[_0x5a8b4c(0xa2)],'mode':_0x5a284c,'syncedAt':_0x51cc1a?.[_0x5a8b4c(0xb5)],'description':_0x51cc1a?.['description']},_0x5a284c),'',_0x5aaad5],_0x489d7c=_0x3701c6[_0x5a8b4c(0x8a)]('\x0a');return _0x489d7c[_0x5a8b4c(0xac)]('\x0a')?_0x489d7c:_0x489d7c+'\x0a';}export function stripLocalSqlMetadata(_0x44db39,_0x1a061e){const _0x4cfc8b=a125_0x545810,_0x170532=_0x44db39[_0x4cfc8b(0xa3)](/\r\n/g,'\x0a')[_0x4cfc8b(0x93)]('\x0a'),_0x535aa8=[];let _0x19bf5b=0x0;if(_0x1a061e==='mybatisXml')while(_0x19bf5b<_0x170532[_0x4cfc8b(0xb3)]){const _0x3607bc=_0x170532[_0x19bf5b]??'';if(/^\s*<!--\s*@lovrabet\./[_0x4cfc8b(0x9c)](_0x3607bc)){_0x19bf5b++;continue;}if(_0x3607bc[_0x4cfc8b(0x8c)]()===''&&_0x19bf5b>0x0){_0x19bf5b++;continue;}break;}else while(_0x19bf5b<_0x170532[_0x4cfc8b(0xb3)]){const _0x11d7db=_0x170532[_0x19bf5b]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x11d7db)){_0x19bf5b++;continue;}if(_0x11d7db[_0x4cfc8b(0x8c)]()===''&&_0x19bf5b>0x0){_0x19bf5b++;continue;}break;}for(;_0x19bf5b<_0x170532[_0x4cfc8b(0xb3)];_0x19bf5b++){_0x535aa8[_0x4cfc8b(0x9e)](_0x170532[_0x19bf5b]);}return _0x535aa8[_0x4cfc8b(0x8a)]('\x0a')[_0x4cfc8b(0xb2)]();}export function resolveSqlMode(_0x3ba0ba,_0x176888){const _0x20bda1=a125_0x545810;if(_0x176888?.[_0x20bda1(0x8e)])return _0x176888['mode'];return detectSqlMode(_0x3ba0ba);}export function resolveSqlFileName(_0x453c8f,_0x56bf33,_0x35b26d){const _0x5cf1b3=a125_0x545810;if(_0x35b26d?.[_0x5cf1b3(0x8f)])return _0x35b26d[_0x5cf1b3(0x8f)];if(_0x35b26d?.[_0x5cf1b3(0x97)]||_0x35b26d?.[_0x5cf1b3(0xa2)])return buildSqlRelativePath(_0x453c8f,_0x35b26d?.[_0x5cf1b3(0x97)],_0x35b26d?.['dbName'],resolveSqlMode(_0x56bf33,_0x35b26d),_0x35b26d?.['dbId']);return buildDefaultSqlFileName(_0x453c8f,resolveSqlMode(_0x56bf33,_0x35b26d));}export function resolveSqlLocalDir(_0x53cf63,_0xb803a0){return join(_0x53cf63,SQL_LOCAL_REL_DIR,_0xb803a0);}export async function confirmForceOverwrite(_0x582d09){const _0x447bed=a125_0x545810,_0x2c03c8=createInterface({'input':process[_0x447bed(0xa1)],'output':process[_0x447bed(0x9b)]}),_0x1cd910=await new Promise(_0x174894=>{const _0x4206b5=_0x447bed;_0x2c03c8[_0x4206b5(0x99)](_0x582d09+_0x4206b5(0x95),_0x174894);});return _0x2c03c8[_0x447bed(0x8d)](),['y',_0x447bed(0xa5)][_0x447bed(0x9d)](_0x1cd910[_0x447bed(0x8c)]()[_0x447bed(0xb1)]());}export function findSqlLockScope(_0x10280e,_0x20b28c){return _0x10280e['apps'][_0x20b28c];}function buildMetadataHeaderLines(_0x446c4c,_0x5f0496){const _0x217fd4=a125_0x545810,_0x1f7906=[[_0x217fd4(0x9a),_0x446c4c['sqlCode']],[_0x217fd4(0x97),_0x446c4c['sqlName']],['dbId',_0x446c4c[_0x217fd4(0x90)]],['dbName',_0x446c4c[_0x217fd4(0xa2)]],[_0x217fd4(0x8e),_0x446c4c[_0x217fd4(0x8e)]],[_0x217fd4(0xb5),_0x446c4c[_0x217fd4(0xb5)]],[_0x217fd4(0xae),_0x446c4c['description']]];if(_0x5f0496===_0x217fd4(0xaf))return _0x1f7906[_0x217fd4(0xa8)](([,_0x60c598])=>_0x60c598!==undefined&&_0x60c598!==null&&String(_0x60c598)[_0x217fd4(0x8c)]()!=='')[_0x217fd4(0xb6)](([_0x260e63,_0x370ca7])=>_0x217fd4(0xa6)+_0x260e63+':\x20'+String(_0x370ca7)+_0x217fd4(0xb0));return _0x1f7906[_0x217fd4(0xa8)](([,_0x28796c])=>_0x28796c!==undefined&&_0x28796c!==null&&String(_0x28796c)[_0x217fd4(0x8c)]()!=='')[_0x217fd4(0xb6)](([_0x319d43,_0x1c849b])=>'--\x20@lovrabet.'+_0x319d43+':\x20'+String(_0x1c849b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a126_0x3c8e49=a126_0x3cda;(function(_0x40ba29,_0x200620){const _0x480433=a126_0x3cda,_0x10ab79=_0x40ba29();while(!![]){try{const _0x5e3b4e=-parseInt(_0x480433(0x1a2))/0x1+-parseInt(_0x480433(0x19e))/0x2+-parseInt(_0x480433(0x1a9))/0x3*(parseInt(_0x480433(0x189))/0x4)+-parseInt(_0x480433(0x19b))/0x5*(-parseInt(_0x480433(0x18a))/0x6)+-parseInt(_0x480433(0x1a5))/0x7*(-parseInt(_0x480433(0x1a3))/0x8)+parseInt(_0x480433(0x1ab))/0x9*(-parseInt(_0x480433(0x185))/0xa)+parseInt(_0x480433(0x192))/0xb*(-parseInt(_0x480433(0x194))/0xc);if(_0x5e3b4e===_0x200620)break;else _0x10ab79['push'](_0x10ab79['shift']());}catch(_0x2e1f74){_0x10ab79['push'](_0x10ab79['shift']());}}}(a126_0x19bf,0x74720));import{listSqlQueries}from'../../core/api-client.js';function a126_0x19bf(){const _0x56d885=['14192wnrWTe','210462CjmjMY','path','remote','sql','appCode','keys','All\x20SQL\x20queries\x20are\x20in\x20sync.','filePath','15785DrVGkz','sqls','2988IonLZR','sqlRoot','\x20modified,\x20','boolean','\x20remote-only','lockKey','relativePath','120TuaMlC','\x20missing,\x20','sqlName','958280mSNcwr','status','length','paging','106125FkFQrY','1976WeBtnF','read','26929OTwMRb','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','\x20unchanged','has','201GxmOcN','tableData','1467fnWGLf','totalCount','push','sqlCode','8270mCaiwi','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','lockFilePath','map'];a126_0x19bf=function(){return _0x56d885;};return a126_0x19bf();}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(_0x22400a){const _0x35946c=a126_0x3cda,_0x233429=[];let _0x25219a=0x1;while(!![]){const _0x5516a0=await listSqlQueries(_0x22400a,{'currentPage':_0x25219a,'pageSize':PAGE_SIZE}),_0x55e1d6=_0x5516a0[_0x35946c(0x1aa)]??[];_0x233429[_0x35946c(0x1ad)](..._0x55e1d6[_0x35946c(0x188)](_0x543cd8=>_0x543cd8[_0x35946c(0x184)]));if(_0x55e1d6[_0x35946c(0x1a0)]===0x0)break;const _0x4160d0=_0x5516a0[_0x35946c(0x1a1)]?.[_0x35946c(0x1ac)];if(_0x4160d0!=null?_0x233429[_0x35946c(0x1a0)]>=_0x4160d0:_0x55e1d6[_0x35946c(0x1a0)]<PAGE_SIZE)break;_0x25219a++;}return _0x233429;}function a126_0x3cda(_0x326593,_0x14da66){_0x326593=_0x326593-0x184;const _0x19bf5b=a126_0x19bf();let _0x3cda66=_0x19bf5b[_0x326593];return _0x3cda66;}export const sqlStatus={'service':a126_0x3c8e49(0x18d),'command':a126_0x3c8e49(0x19f),'description':a126_0x3c8e49(0x1a6),'risk':a126_0x3c8e49(0x1a4),'flags':[{'name':a126_0x3c8e49(0x18c),'type':a126_0x3c8e49(0x197),'description':a126_0x3c8e49(0x186)}],async 'execute'(_0x53842a){const _0x52e9af=a126_0x3c8e49,_0x377f24=loadSqlProjectConfig(_0x53842a[_0x52e9af(0x18e)]),_0x3ad4ee=await readSqlLockFile(_0x377f24[_0x52e9af(0x187)]),{appLock:_0x1adf3c}=ensureSqlLockScope(_0x3ad4ee??createEmptySqlLock(),_0x377f24[_0x52e9af(0x18e)],_0x377f24[_0x52e9af(0x195)],_0x52e9af(0x19f)),_0x5461e1=await scanLocalSqlQueries(_0x377f24),_0x44c91b=[],_0x111104=[],_0x128255=[],_0x351c80=[],_0x1893fb=new Set(_0x5461e1[_0x52e9af(0x188)](_0xe57885=>_0xe57885[_0x52e9af(0x199)]));for(const _0x3808e4 of _0x5461e1){const _0x4f1f1b=await computeSqlFileHash(_0x3808e4[_0x52e9af(0x191)]),_0x5840e1=_0x1adf3c['sqls'][_0x3808e4[_0x52e9af(0x199)]],_0x478249=!!_0x5840e1&&_0x5840e1[_0x52e9af(0x18b)]!==_0x3808e4[_0x52e9af(0x19a)],_0x135383=!!_0x5840e1&&!!_0x3808e4['sqlName']&&_0x5840e1['sqlName']!==_0x3808e4[_0x52e9af(0x19d)];if(!_0x5840e1)_0x44c91b[_0x52e9af(0x1ad)](_0x3808e4['lockKey']);else _0x5840e1['hash']!==_0x4f1f1b||_0x478249||_0x135383?_0x111104[_0x52e9af(0x1ad)](_0x3808e4[_0x52e9af(0x199)]):_0x128255[_0x52e9af(0x1ad)](_0x3808e4[_0x52e9af(0x199)]);}for(const _0x206e66 of Object[_0x52e9af(0x18f)](_0x1adf3c[_0x52e9af(0x193)])){!_0x1893fb[_0x52e9af(0x1a8)](_0x206e66)&&_0x351c80[_0x52e9af(0x1ad)](_0x206e66);}const _0x49ad6a=[];if(_0x53842a['bool'](_0x52e9af(0x18c))){const _0x901bb8=await fetchAllSqlCodes(_0x53842a[_0x52e9af(0x18e)]);for(const _0x4cccf7 of _0x901bb8){!_0x1893fb['has'](_0x4cccf7)&&!_0x1adf3c[_0x52e9af(0x193)][_0x4cccf7]&&_0x49ad6a['push'](_0x4cccf7);}}const _0x3fb320=_0x44c91b[_0x52e9af(0x1a0)]===0x0&&_0x111104['length']===0x0&&_0x351c80[_0x52e9af(0x1a0)]===0x0&&_0x49ad6a[_0x52e9af(0x1a0)]===0x0;return{'ok':!![],'data':{'added':_0x44c91b,'modified':_0x111104,'missing':_0x351c80,'unchanged':_0x128255,'remoteOnly':_0x49ad6a},'message':_0x3fb320?_0x52e9af(0x190):_0x44c91b[_0x52e9af(0x1a0)]+'\x20added,\x20'+_0x111104[_0x52e9af(0x1a0)]+_0x52e9af(0x196)+_0x351c80[_0x52e9af(0x1a0)]+_0x52e9af(0x19c)+_0x128255['length']+_0x52e9af(0x1a7)+(_0x49ad6a[_0x52e9af(0x1a0)]>0x0?',\x20'+_0x49ad6a[_0x52e9af(0x1a0)]+_0x52e9af(0x198):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0xd3eb57=a127_0x60be;(function(_0x48ebe7,_0x28e0f7){const _0x2a1bcd=a127_0x60be,_0x2c8547=_0x48ebe7();while(!![]){try{const _0xfabf2a=-parseInt(_0x2a1bcd(0xa5))/0x1*(-parseInt(_0x2a1bcd(0x9b))/0x2)+-parseInt(_0x2a1bcd(0xbc))/0x3*(-parseInt(_0x2a1bcd(0xae))/0x4)+-parseInt(_0x2a1bcd(0xa4))/0x5*(-parseInt(_0x2a1bcd(0xab))/0x6)+-parseInt(_0x2a1bcd(0xbb))/0x7+parseInt(_0x2a1bcd(0xa2))/0x8*(-parseInt(_0x2a1bcd(0xac))/0x9)+parseInt(_0x2a1bcd(0xb5))/0xa*(-parseInt(_0x2a1bcd(0xb8))/0xb)+-parseInt(_0x2a1bcd(0xaf))/0xc;if(_0xfabf2a===_0x28e0f7)break;else _0x2c8547['push'](_0x2c8547['shift']());}catch(_0xcd3fa3){_0x2c8547['push'](_0x2c8547['shift']());}}}(a127_0x3792,0x2e2d0));import{readFileSync,existsSync}from'node:fs';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';import{assertDatasetSupportsLocalDevelopment,filterDbBackedDatasets}from'../../commands/dataset/capability.js';function a127_0x3792(){const _0x42d83=['993wPHiZI','tables','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','valid','string','size','tableName','isDangerous','utf-8','File\x20not\x20found:\x20','SQL\x20schema\x20validation','cwd','map','schemas','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','Provide\x20--file\x20or\x20--sql','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','Dataset\x20\x22','2yVtEeb','toLowerCase','validation','isSelectOnly','Table\x20\x22','file','validate','824FwxdYM','str','119230bDAGXW','235063LZrvIS','appCode','schema:','reason','trim','sql','54DHMCbn','2232ErBDXn','get','3828WsLGsH','3493848qxAHjd','dbtableConfig','message','fields','\x22\x20not\x20found\x20or\x20not\x20accessible','name','10ZmWzVo','parameters','type','1936451eswGLi','sqlType','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','591983yInHuz'];a127_0x3792=function(){return _0x42d83;};return a127_0x3792();}function a127_0x60be(_0x279f88,_0x5e4c7c){_0x279f88=_0x279f88-0x93;const _0x379203=a127_0x3792();let _0x60be2=_0x379203[_0x279f88];return _0x60be2;}export const sqlValidate={'service':a127_0xd3eb57(0xaa),'command':a127_0xd3eb57(0xa1),'description':a127_0xd3eb57(0x97),'risk':'read','flags':[{'name':a127_0xd3eb57(0xa0),'type':a127_0xd3eb57(0xc0),'description':a127_0xd3eb57(0xbe)},{'name':a127_0xd3eb57(0xaa),'type':'string','description':a127_0xd3eb57(0x99)},{'name':a127_0xd3eb57(0x96),'type':a127_0xd3eb57(0xc0),'description':a127_0xd3eb57(0xba)}],async 'execute'(_0x310e55){const _0x10f350=a127_0xd3eb57,_0x298619=_0x310e55[_0x10f350(0xa3)](_0x10f350(0xa0)),_0x1bcaf2=_0x310e55[_0x10f350(0xa3)](_0x10f350(0xaa));if(!_0x298619&&!_0x1bcaf2)throw CliErrors['flagMissing'](_0x10f350(0xa0),_0x10f350(0x98));let _0x4163ad;if(_0x298619){const _0x12cbbc=resolve(process[_0x10f350(0x94)](),_0x298619);if(!existsSync(_0x12cbbc))throw CliErrors[_0x10f350(0x9d)](_0x10f350(0xc5)+_0x12cbbc);_0x4163ad=readFileSync(_0x12cbbc,_0x10f350(0xc4));}else _0x4163ad=_0x1bcaf2;const _0x49679a=validateSql(_0x4163ad),_0x58d7d0={'valid':_0x49679a['valid'],'sqlType':_0x49679a[_0x10f350(0xb9)][_0x10f350(0xb7)],'isSelectOnly':_0x49679a[_0x10f350(0xb9)][_0x10f350(0x9e)],'isDangerous':_0x49679a[_0x10f350(0xb9)][_0x10f350(0xc3)],'tables':_0x49679a['tables'],'parameters':_0x49679a[_0x10f350(0xb6)],'message':_0x49679a[_0x10f350(0xb1)]};_0x49679a[_0x10f350(0xb9)][_0x10f350(0xa8)]&&(_0x58d7d0[_0x10f350(0xa8)]=_0x49679a[_0x10f350(0xb9)][_0x10f350(0xa8)]);const _0x507ce1=_0x310e55[_0x10f350(0xa3)]('schemas');if(_0x507ce1&&_0x49679a[_0x10f350(0xbf)]){const _0x225162=_0x507ce1['split'](',')[_0x10f350(0x95)](_0xf050ec=>_0xf050ec[_0x10f350(0xa9)]())['filter'](Boolean),_0x21490b=[],_0x32fc9f=filterDbBackedDatasets(await listDatasets(_0x310e55[_0x10f350(0xa6)])),_0x171a2b=new Map(_0x32fc9f[_0x10f350(0x95)](_0x19d549=>[_0x19d549[_0x10f350(0xb0)]?.[_0x10f350(0xc2)]?.['toLowerCase'](),_0x19d549]));for(const _0x21c069 of _0x49679a[_0x10f350(0xbd)]){const _0x4ba36e=_0x171a2b[_0x10f350(0xad)](_0x21c069[_0x10f350(0x9c)]());!_0x4ba36e&&_0x21490b['push'](_0x10f350(0x9f)+_0x21c069+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x2c928b of _0x225162){let _0x3de06d;try{_0x3de06d=await getDatasetDetail(_0x2c928b);}catch{_0x21490b['push'](_0x10f350(0x9a)+_0x2c928b+_0x10f350(0xb3));continue;}assertDatasetSupportsLocalDevelopment(_0x3de06d,_0x10f350(0x93));const _0x2d0b94=Array['isArray'](_0x3de06d['fields'])?_0x3de06d[_0x10f350(0xb2)]:[],_0x591d8b=new Set(_0x2d0b94[_0x10f350(0x95)](_0x97e476=>_0x97e476[_0x10f350(0xb4)]?.['toLowerCase']())),_0x21121f=_0x3de06d[_0x10f350(0xb0)]?.[_0x10f350(0xc2)]||_0x3de06d[_0x10f350(0xc2)]||_0x2c928b;_0x58d7d0[_0x10f350(0xa7)+_0x21121f]={'code':_0x2c928b,'tableName':_0x21121f,'fieldCount':_0x591d8b[_0x10f350(0xc1)],'fields':Array['from'](_0x591d8b)};}_0x21490b['length']>0x0&&(_0x58d7d0['schemaWarnings']=_0x21490b);}return{'ok':_0x49679a[_0x10f350(0xbf)],'data':_0x58d7d0,'message':_0x49679a[_0x10f350(0xb1)]};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a128_0x2224b3=a128_0x1a0b;(function(_0x328046,_0x357db0){const _0x3bc6c6=a128_0x1a0b,_0x5e0d69=_0x328046();while(!![]){try{const _0x50bdea=-parseInt(_0x3bc6c6(0x210))/0x1*(-parseInt(_0x3bc6c6(0x206))/0x2)+-parseInt(_0x3bc6c6(0x203))/0x3*(parseInt(_0x3bc6c6(0x20a))/0x4)+-parseInt(_0x3bc6c6(0x20d))/0x5+-parseInt(_0x3bc6c6(0x1f7))/0x6*(-parseInt(_0x3bc6c6(0x21c))/0x7)+-parseInt(_0x3bc6c6(0x20f))/0x8*(-parseInt(_0x3bc6c6(0x212))/0x9)+parseInt(_0x3bc6c6(0x21f))/0xa*(parseInt(_0x3bc6c6(0x215))/0xb)+-parseInt(_0x3bc6c6(0x1f4))/0xc;if(_0x50bdea===_0x357db0)break;else _0x5e0d69['push'](_0x5e0d69['shift']());}catch(_0xc3f2d5){_0x5e0d69['push'](_0x5e0d69['shift']());}}}(a128_0x1cd3,0xac309));function a128_0x1cd3(){const _0x329acd=['defaultFormat','riskLevel','1976280MTGphC','env','8HLpbBF','1otzGDV','app','3964131NBoEHa','locale','Config\x20key\x20(','11snvZiu','Risk\x20level','Default\x20page\x20size','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','appcode','entries','Locale','10185NIIbdE','string','join','7692220ilzGse','keys','map','19167000zIBgnk','Access\x20key','accessKey','5742cSTCLr','format','has','apps','number','zh-CN','filter','pageSize','apiDir','en-US','defaultApp','inherit','156vRgLIL','cookie','Target\x20environment','2052022DZcwpV','API\x20directory\x20path','toLowerCase','length','71564jGnuFg'];a128_0x1cd3=function(){return _0x329acd;};return a128_0x1cd3();}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';import{RISK_LEVEL_VALUES}from'../constant/risk.js';function a128_0x1a0b(_0x1d71df,_0x325dbc){_0x1d71df=_0x1d71df-0x1f3;const _0x1cd3be=a128_0x1cd3();let _0x1a0b5a=_0x1cd3be[_0x1d71df];return _0x1a0b5a;}export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a128_0x2224b3(0x204),a128_0x2224b3(0x1f6),a128_0x2224b3(0x213),a128_0x2224b3(0x1f8),'riskLevel'];export const TOP_LEVEL_CONFIG_KEYS=new Set([a128_0x2224b3(0x219),a128_0x2224b3(0x20e),'locale',a128_0x2224b3(0x1f8),a128_0x2224b3(0x204),a128_0x2224b3(0x1f6),a128_0x2224b3(0x1ff)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x1d9ee1){const _0x1405e2=a128_0x2224b3;return[..._0x1d9ee1][_0x1405e2(0x21e)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x1e3253){const _0x1a0c34=a128_0x2224b3;return TOP_LEVEL_CONFIG_KEYS[_0x1a0c34(0x1f9)](_0x1e3253);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x4e4df4=a128_0x2224b3;return _0x4e4df4(0x214)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a128_0x2224b3(0x20e),'apiDir':'apiDir','cookie':a128_0x2224b3(0x204),'accessKey':'accessKey','defaultFormat':'format','pageSize':a128_0x2224b3(0x1fe),'riskLevel':a128_0x2224b3(0x20c),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x23de54=a128_0x2224b3;return[{'name':'env','type':_0x23de54(0x21d),'description':_0x23de54(0x205),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x23de54(0x1ff),'type':_0x23de54(0x21d),'description':_0x23de54(0x207)},{'name':_0x23de54(0x204),'type':_0x23de54(0x21d),'description':'Auth\x20cookie','hidden':!![]},{'name':_0x23de54(0x1f6),'type':_0x23de54(0x21d),'description':_0x23de54(0x1f5),'hidden':!![]},{'name':_0x23de54(0x20b),'type':_0x23de54(0x21d),'description':_0x23de54(0x218),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x23de54(0x1fe),'type':_0x23de54(0x1fb),'description':_0x23de54(0x217)},{'name':_0x23de54(0x20c),'type':'string','description':_0x23de54(0x216),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x23de54(0x213),'type':_0x23de54(0x21d),'description':_0x23de54(0x21b)}];}export function collectAppProfileOverrides(_0x5bd3e5){const _0x6514bc=a128_0x2224b3,_0x19cc1f={};for(const [_0x122828,_0x1152da]of Object[_0x6514bc(0x21a)](APP_PROFILE_FLAG_KEY_MAP)){const _0x2f539f=_0x5bd3e5(_0x122828);if(!_0x2f539f)continue;_0x19cc1f[_0x1152da]=_0x1152da===_0x6514bc(0x1fe)?Number(_0x2f539f):_0x2f539f;}return _0x19cc1f;}export function buildAppProfileListFields(_0x1d3187){const _0x2fe8d1=a128_0x2224b3;return{'env':_0x1d3187[_0x2fe8d1(0x20e)]??null,'apiDir':_0x1d3187['apiDir']??null,'hasCookie':!!_0x1d3187['cookie'],'hasAccessKey':!!_0x1d3187[_0x2fe8d1(0x1f6)],'format':_0x1d3187[_0x2fe8d1(0x1f8)]??null,'pageSize':_0x1d3187[_0x2fe8d1(0x1fe)]??null,'riskLevel':_0x1d3187[_0x2fe8d1(0x20c)]??null,'locale':_0x1d3187['locale']??null};}export function buildAppDoctorFields(_0xbbb9b6,_0x25cb32){const _0x574437=a128_0x2224b3;return{'env':{'value':_0xbbb9b6[_0x574437(0x20e)]||_0x25cb32[_0x574437(0x20e)],'source':_0xbbb9b6['env']?'app':_0x574437(0x202)},'apiDir':{'value':_0xbbb9b6['apiDir']||_0x25cb32[_0x574437(0x1ff)],'source':_0xbbb9b6[_0x574437(0x1ff)]?_0x574437(0x211):'inherit'},'cookie':{'value':_0xbbb9b6[_0x574437(0x204)]||_0x25cb32['cookie'],'source':_0xbbb9b6[_0x574437(0x204)]?_0x574437(0x211):_0x574437(0x202)},'accessKey':{'value':_0xbbb9b6[_0x574437(0x1f6)]||_0x25cb32[_0x574437(0x1f6)],'source':_0xbbb9b6['accessKey']?_0x574437(0x211):_0x574437(0x202)}};}export function buildCanonicalAppConfig(_0x1dfe77,_0x124383){const _0x12f9e2=a128_0x2224b3,_0x240e34=_0x1dfe77[_0x12f9e2(0x1f3)](_0x469e54=>String(_0x469e54||'')['trim']())[_0x12f9e2(0x1fd)](Boolean);if(_0x240e34['length']===0x0)return{};const _0x4d3f82={};for(const _0x28b4c3 of _0x240e34){_0x4d3f82[_0x28b4c3]=_0x124383?{'appcode':_0x28b4c3,'env':_0x124383}:{'appcode':_0x28b4c3};}return{'apps':_0x4d3f82,'defaultApp':_0x240e34[0x0]};}export function buildCanonicalProjectConfig(_0x361f8e,_0x3661c5){const _0x864abf=a128_0x2224b3,{appCodes:appCodes=[],env:_0x217da0,metadata:_0x4ff272}=_0x3661c5,_0xf2d014={..._0x361f8e,..._0x4ff272||{}};delete _0xf2d014['appcode'],delete _0xf2d014[_0x864abf(0x211)];if(_0x217da0)_0xf2d014[_0x864abf(0x20e)]=_0x217da0;else!_0xf2d014[_0x864abf(0x20e)]&&(_0xf2d014[_0x864abf(0x20e)]=DEFAULT_CONFIG_VALUES['env']);const _0x4c102c=buildCanonicalAppConfig(appCodes,_0xf2d014[_0x864abf(0x20e)]);return Object[_0x864abf(0x220)](_0x4c102c)[_0x864abf(0x209)]>0x0&&(_0xf2d014[_0x864abf(0x1fa)]=_0x4c102c[_0x864abf(0x1fa)],_0xf2d014[_0x864abf(0x201)]=_0x4c102c[_0x864abf(0x201)]),_0xf2d014;}const LOCALE_MAP={'zh':a128_0x2224b3(0x1fc),'zh-cn':a128_0x2224b3(0x1fc),'zh_cn':a128_0x2224b3(0x1fc),'en':a128_0x2224b3(0x200),'en-us':a128_0x2224b3(0x200),'en_us':'en-US'};export function normalizeLocale(_0x3d119c){const _0x3f76a7=a128_0x2224b3;if(!_0x3d119c)return null;return LOCALE_MAP[_0x3d119c[_0x3f76a7(0x208)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a129_0x5ca8(){const _0x8169fc=['6674166gHlGtd','7RsqIiu','4375896KOuyDB','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','25754648phKbfi','728051pGtBty','1770964gOoPEa','3823515VGkSLE','2402439XliqNx'];a129_0x5ca8=function(){return _0x8169fc;};return a129_0x5ca8();}const a129_0x5cc178=a129_0x284f;(function(_0x1299e3,_0x537bb0){const _0x439271=a129_0x284f,_0x27e868=_0x1299e3();while(!![]){try{const _0x2f2f58=-parseInt(_0x439271(0x132))/0x1+-parseInt(_0x439271(0x133))/0x2+parseInt(_0x439271(0x135))/0x3+-parseInt(_0x439271(0x138))/0x4+parseInt(_0x439271(0x134))/0x5+-parseInt(_0x439271(0x136))/0x6+-parseInt(_0x439271(0x137))/0x7*(-parseInt(_0x439271(0x131))/0x8);if(_0x2f2f58===_0x537bb0)break;else _0x27e868['push'](_0x27e868['shift']());}catch(_0x29b55f){_0x27e868['push'](_0x27e868['shift']());}}}(a129_0x5ca8,0xeb973));function a129_0x284f(_0x370d0e,_0x4a2abf){_0x370d0e=_0x370d0e-0x130;const _0x5ca88e=a129_0x5ca8();let _0x284fbf=_0x5ca88e[_0x370d0e];return _0x284fbf;}export const CLI_VERSION_POLICY_URL=a129_0x5cc178(0x130);
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a130_0x4fcb13=a130_0x129d;(function(_0x1b3a2f,_0x334ed4){const _0x2accc2=a130_0x129d,_0x419a04=_0x1b3a2f();while(!![]){try{const _0x32ff63=parseInt(_0x2accc2(0x1ec))/0x1+parseInt(_0x2accc2(0x20b))/0x2+-parseInt(_0x2accc2(0x227))/0x3*(-parseInt(_0x2accc2(0x224))/0x4)+-parseInt(_0x2accc2(0x232))/0x5*(parseInt(_0x2accc2(0x205))/0x6)+parseInt(_0x2accc2(0x1f8))/0x7*(-parseInt(_0x2accc2(0x1f1))/0x8)+parseInt(_0x2accc2(0x24b))/0x9*(-parseInt(_0x2accc2(0x1f5))/0xa)+-parseInt(_0x2accc2(0x253))/0xb*(-parseInt(_0x2accc2(0x236))/0xc);if(_0x32ff63===_0x334ed4)break;else _0x419a04['push'](_0x419a04['shift']());}catch(_0x2b54a7){_0x419a04['push'](_0x419a04['shift']());}}}(a130_0x3964,0x1e21e));export const CLI_BIN_NAME=a130_0x4fcb13(0x22b);export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';function a130_0x129d(_0x1d92db,_0x79759b){_0x1d92db=_0x1d92db-0x1e4;const _0x3964f8=a130_0x3964();let _0x129d91=_0x3964f8[_0x1d92db];return _0x129d91;}export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';function a130_0x3964(){const _0x45d4cc=['enable-bff-save','Function\x20node','app','Alias\x20for\x20--non-interactive','Record\x20ID','code','all','verbose','Config\x20key','value','dry-run','operationType','project','Watch\x20mode','Output\x20path','Skip\x20import\x20generation','name','SQL\x20name','nonInteractive','340731ekyEVm','sql','DB\x20ID','function-node','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Use\x20global\x20config\x20scope','Enable\x20BFF\x20save','<code>','66qZxPks','page','dbId','Verbose\x20output','output','Override\x20appcode','Keyword\x20filter','type','Use\x20project\x20config\x20scope','appcode','enableBffSave','116083OZmPrA','Apply\x20to\x20all','File\x20path','datasetcode','Dataset\x20code','1223248vSsUCG','JSON\x20params','key','file','50ABHSxl','force','clear','7HwpqUK','SQL\x20code','help','Force\x20non-interactive\x20mode\x20(CI)','target','string','Code\x20filter','global','json\x20|\x20pretty\x20|\x20compress','sql-name','confirm','boolean','Preview\x20operation\x20without\x20executing','42hAEdSM','description-file','format','Show\x20help','Clear','Description','371208QSHFuB','sqlname','production\x20|\x20daily','pagesize','description','schemas','sqlName','Title','dbid','yes','non-interactive','db-id','Output\x20format','Select\x20app\x20profile\x20by\x20name','Environment','Expected\x20affected\x20count','<name>','env','keyword','skipImports','Use\x20remote','Config\x20value','expectedCount','operation','watch','10508eJNFtG','sqlcode','operation-type','129ZuZoqg','Force\x20overwrite','functionNode','descriptionFile','rabetbase','Skip\x20confirmation\x20for\x20high-risk\x20writes','meowKey','remote','Page\x20number','expected-count','skip-imports','40325YzzSjk','title','<expr>','SQL\x20string','214860ajKFWH','Operation\x20type'];a130_0x3964=function(){return _0x45d4cc;};return a130_0x3964();}export const GLOBAL_FLAGS=[{'name':a130_0x4fcb13(0x1ea),'meowKey':a130_0x4fcb13(0x1ea),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x1e6),'hint':a130_0x4fcb13(0x252)},{'name':a130_0x4fcb13(0x23a),'meowKey':a130_0x4fcb13(0x23a),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x218),'hint':a130_0x4fcb13(0x21b)},{'name':a130_0x4fcb13(0x21c),'meowKey':'env','type':'string','description':a130_0x4fcb13(0x219),'hint':a130_0x4fcb13(0x20d)},{'name':a130_0x4fcb13(0x207),'meowKey':a130_0x4fcb13(0x207),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x217),'hint':a130_0x4fcb13(0x200)},{'name':'jq','meowKey':'jq','type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x24f),'hint':a130_0x4fcb13(0x234)},{'name':a130_0x4fcb13(0x242),'meowKey':'dryRun','type':'boolean','description':a130_0x4fcb13(0x204)},{'name':a130_0x4fcb13(0x214),'meowKey':a130_0x4fcb13(0x214),'type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x22c)},{'name':'non-interactive','meowKey':a130_0x4fcb13(0x24a),'type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x1fb)},{'name':a130_0x4fcb13(0x1ff),'meowKey':a130_0x4fcb13(0x1ff),'type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x250)},{'name':a130_0x4fcb13(0x244),'meowKey':a130_0x4fcb13(0x244),'type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x1e9)},{'name':'ci','meowKey':'ci','type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x23b),'hidden':!![]},{'name':'help','meowKey':a130_0x4fcb13(0x1fa),'type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x208)},{'name':a130_0x4fcb13(0x248),'meowKey':'name','type':a130_0x4fcb13(0x1fd),'description':'Name','hidden':!![]},{'name':a130_0x4fcb13(0x233),'meowKey':a130_0x4fcb13(0x233),'type':'string','description':a130_0x4fcb13(0x212),'hidden':!![]},{'name':a130_0x4fcb13(0x1f7),'meowKey':a130_0x4fcb13(0x1f7),'type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x209),'hidden':!![]},{'name':'watch','meowKey':a130_0x4fcb13(0x223),'type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x245),'hidden':!![]},{'name':a130_0x4fcb13(0x1e5),'meowKey':a130_0x4fcb13(0x1e5),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x246),'hidden':!![]},{'name':'params','meowKey':'params','type':'string','description':a130_0x4fcb13(0x1f2),'hidden':!![]},{'name':a130_0x4fcb13(0x1ef),'meowKey':'datasetcode','type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x1f0),'hidden':!![]},{'name':'all','meowKey':a130_0x4fcb13(0x23e),'type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x1ed),'hidden':!![]},{'name':a130_0x4fcb13(0x238),'meowKey':a130_0x4fcb13(0x1eb),'type':'boolean','description':a130_0x4fcb13(0x251),'hidden':!![]},{'name':'id','meowKey':'id','type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x23c),'hidden':!![]},{'name':a130_0x4fcb13(0x1e8),'meowKey':a130_0x4fcb13(0x1e8),'type':a130_0x4fcb13(0x1fd),'description':'Type\x20filter','hidden':!![]},{'name':a130_0x4fcb13(0x1f4),'meowKey':a130_0x4fcb13(0x1f4),'type':'string','description':a130_0x4fcb13(0x1ee),'hidden':!![]},{'name':a130_0x4fcb13(0x225),'meowKey':'sqlcode','type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x1f9),'hidden':!![]},{'name':a130_0x4fcb13(0x201),'meowKey':a130_0x4fcb13(0x211),'type':'string','description':a130_0x4fcb13(0x249),'hidden':!![]},{'name':'sqlname','meowKey':a130_0x4fcb13(0x20c),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x249),'hidden':!![]},{'name':a130_0x4fcb13(0x216),'meowKey':a130_0x4fcb13(0x255),'type':'string','description':'DB\x20ID','hidden':!![]},{'name':a130_0x4fcb13(0x213),'meowKey':a130_0x4fcb13(0x213),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x24d),'hidden':!![]},{'name':'description','meowKey':a130_0x4fcb13(0x20f),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x20a),'hidden':!![]},{'name':a130_0x4fcb13(0x206),'meowKey':a130_0x4fcb13(0x22a),'type':a130_0x4fcb13(0x1fd),'description':'Description\x20file','hidden':!![]},{'name':a130_0x4fcb13(0x254),'meowKey':'page','type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x22f),'hidden':!![]},{'name':a130_0x4fcb13(0x20e),'meowKey':'pagesize','type':a130_0x4fcb13(0x1fd),'description':'Page\x20size','hidden':!![]},{'name':a130_0x4fcb13(0x21d),'meowKey':'keyword','type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x1e7),'hidden':!![]},{'name':a130_0x4fcb13(0x23d),'meowKey':a130_0x4fcb13(0x23d),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x1fe),'hidden':!![]},{'name':a130_0x4fcb13(0x24c),'meowKey':a130_0x4fcb13(0x24c),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x235),'hidden':!![]},{'name':a130_0x4fcb13(0x210),'meowKey':'schemas','type':a130_0x4fcb13(0x1fd),'description':'Schemas','hidden':!![]},{'name':'operation','meowKey':a130_0x4fcb13(0x222),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x237),'hidden':!![]},{'name':a130_0x4fcb13(0x1fc),'meowKey':a130_0x4fcb13(0x1fc),'type':'string','description':'Target\x20path','hidden':!![]},{'name':a130_0x4fcb13(0x231),'meowKey':a130_0x4fcb13(0x21e),'type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x247),'hidden':!![]},{'name':'key','meowKey':a130_0x4fcb13(0x1f3),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x240),'hidden':!![]},{'name':a130_0x4fcb13(0x241),'meowKey':a130_0x4fcb13(0x241),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x220),'hidden':!![]},{'name':'force','meowKey':a130_0x4fcb13(0x1f6),'type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x228),'hidden':!![]},{'name':'confirm','meowKey':a130_0x4fcb13(0x202),'type':a130_0x4fcb13(0x203),'description':'Confirm\x20destructive\x20action','hidden':!![]},{'name':a130_0x4fcb13(0x22e),'meowKey':a130_0x4fcb13(0x22e),'type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x21f),'hidden':!![]},{'name':a130_0x4fcb13(0x23f),'meowKey':a130_0x4fcb13(0x23f),'type':a130_0x4fcb13(0x203),'description':a130_0x4fcb13(0x1e4),'hidden':!![]},{'name':a130_0x4fcb13(0x230),'meowKey':a130_0x4fcb13(0x221),'type':'string','description':a130_0x4fcb13(0x21a),'hidden':!![]},{'name':a130_0x4fcb13(0x226),'meowKey':a130_0x4fcb13(0x243),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x237),'hidden':!![]},{'name':a130_0x4fcb13(0x24e),'meowKey':a130_0x4fcb13(0x229),'type':a130_0x4fcb13(0x1fd),'description':a130_0x4fcb13(0x239),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a130_0x4fcb13(0x1ea),'app',a130_0x4fcb13(0x21c),'format','jq',a130_0x4fcb13(0x242),a130_0x4fcb13(0x214),a130_0x4fcb13(0x215),'ci']);export function buildMeowFlags(){const _0x1e7a96=a130_0x4fcb13;return Object['fromEntries'](GLOBAL_FLAGS['map'](_0x2e2699=>[_0x2e2699[_0x1e7a96(0x22d)],{'type':_0x2e2699[_0x1e7a96(0x1e8)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x2fa7df=a131_0x1118;(function(_0x551885,_0x337a59){const _0x231c76=a131_0x1118,_0x25c8fe=_0x551885();while(!![]){try{const _0x375d1a=parseInt(_0x231c76(0x14e))/0x1+parseInt(_0x231c76(0x154))/0x2*(-parseInt(_0x231c76(0x153))/0x3)+-parseInt(_0x231c76(0x14d))/0x4*(-parseInt(_0x231c76(0x14b))/0x5)+parseInt(_0x231c76(0x14f))/0x6*(parseInt(_0x231c76(0x156))/0x7)+parseInt(_0x231c76(0x150))/0x8+parseInt(_0x231c76(0x14a))/0x9+-parseInt(_0x231c76(0x152))/0xa*(parseInt(_0x231c76(0x157))/0xb);if(_0x375d1a===_0x337a59)break;else _0x25c8fe['push'](_0x25c8fe['shift']());}catch(_0x6ad8b8){_0x25c8fe['push'](_0x25c8fe['shift']());}}}(a131_0xfc46,0x98737));function a131_0xfc46(){const _0x3e25a7=['2005160giHpdj','1154909UHJCVF','6hdonVd','4646584NOlOwF','production','10nWobVL','3WvNMTp','174822bMhmnM','en-US','5347097HMevvc','42095614KJunZT','compress','9328869OOrAlB','10dGuFgl','high-risk-write'];a131_0xfc46=function(){return _0x3e25a7;};return a131_0xfc46();}import{DEFAULT_API_DIR}from'../constant/paths.js';function a131_0x1118(_0x1340aa,_0xc7c1ab){_0x1340aa=_0x1340aa-0x149;const _0xfc463c=a131_0xfc46();let _0x11188d=_0xfc463c[_0x1340aa];return _0x11188d;}export const DEFAULT_CONFIG_VALUES={'env':a131_0x2fa7df(0x151),'format':a131_0x2fa7df(0x149),'locale':a131_0x2fa7df(0x155),'riskLevel':a131_0x2fa7df(0x14c),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a131_0x2fa7df(0x149);
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0x3934e2=a132_0x4e1f;(function(_0x59b136,_0x281347){const _0x2ba352=a132_0x4e1f,_0x238e59=_0x59b136();while(!![]){try{const _0x1238db=-parseInt(_0x2ba352(0x161))/0x1*(parseInt(_0x2ba352(0x15d))/0x2)+parseInt(_0x2ba352(0x15c))/0x3+-parseInt(_0x2ba352(0x15b))/0x4+-parseInt(_0x2ba352(0x163))/0x5+parseInt(_0x2ba352(0x164))/0x6*(-parseInt(_0x2ba352(0x160))/0x7)+parseInt(_0x2ba352(0x166))/0x8*(parseInt(_0x2ba352(0x16a))/0x9)+parseInt(_0x2ba352(0x162))/0xa;if(_0x1238db===_0x281347)break;else _0x238e59['push'](_0x238e59['shift']());}catch(_0x12ea2b){_0x238e59['push'](_0x238e59['shift']());}}}(a132_0x4cc8,0xc4106));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x3fb78b){const _0x439d33=a132_0x4e1f;customApiDomain=_0x3fb78b?.[_0x439d33(0x169)],customUserDomain=_0x3fb78b?.['userDomain'],customRuntimeDomain=_0x3fb78b?.[_0x439d33(0x168)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a132_0x3934e2(0x15e):a132_0x3934e2(0x167));function a132_0x4cc8(){const _0x4ed9d7=['https://user.lovrabet.com','https://daily-api.lovrabet.com','63oDfALn','367559KjHEDQ','18947530DwrYDd','4943440vpyzRH','93606AHHxzk','https://daily-runtime.lovrabet.com','15752gLZEWr','https://user-daily.lovrabet.com','runtimeDomain','apiDomain','6507zDYydL','https://api.lovrabet.com','1445028QfOefq','1335984pfuzvA','8atxynb'];a132_0x4cc8=function(){return _0x4ed9d7;};return a132_0x4cc8();}function a132_0x4e1f(_0x258874,_0x397b37){_0x258874=_0x258874-0x15b;const _0x4cc8e5=a132_0x4cc8();let _0x4e1f59=_0x4cc8e5[_0x258874];return _0x4e1f59;}export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a132_0x3934e2(0x16b):a132_0x3934e2(0x15f));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?'https://runtime.lovrabet.com':a132_0x3934e2(0x165));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a133_0x446ae6=a133_0x2484;function a133_0x338e(){const _0x43b477=['online','754PJttKd','3927915GmJYPw','dev','production','176858EtBRvZ','7tZSMoj','daily','4907403RMofvL','3837FXOSKm','710AOcfhx','3396464tdJPiO','6cZJaoY','155360QHcDDX','856411jYTlef'];a133_0x338e=function(){return _0x43b477;};return a133_0x338e();}(function(_0xd4f2e6,_0x2f7d3c){const _0x18fde4=a133_0x2484,_0x106146=_0xd4f2e6();while(!![]){try{const _0xb1b087=-parseInt(_0x18fde4(0x77))/0x1+parseInt(_0x18fde4(0x79))/0x2*(-parseInt(_0x18fde4(0x72))/0x3)+parseInt(_0x18fde4(0x74))/0x4+-parseInt(_0x18fde4(0x7a))/0x5*(parseInt(_0x18fde4(0x75))/0x6)+-parseInt(_0x18fde4(0x6f))/0x7*(-parseInt(_0x18fde4(0x76))/0x8)+parseInt(_0x18fde4(0x71))/0x9+parseInt(_0x18fde4(0x73))/0xa*(parseInt(_0x18fde4(0x6e))/0xb);if(_0xb1b087===_0x2f7d3c)break;else _0x106146['push'](_0x106146['shift']());}catch(_0xa6e5e2){_0x106146['push'](_0x106146['shift']());}}}(a133_0x338e,0x6943c));export const RABETBASE_ENV_VALUES=[a133_0x446ae6(0x6d),a133_0x446ae6(0x70)];export function normalizeEnv(_0x1f06a9){const _0xa7670d=a133_0x446ae6;return _0x1f06a9===_0xa7670d(0x78)?_0xa7670d(0x6d):_0x1f06a9;}export function isProduction(_0x443bd2){const _0x50d25a=a133_0x446ae6;return normalizeEnv(_0x443bd2)===_0x50d25a(0x6d);}export function isDaily(_0x26cd51){const _0x38f860=a133_0x446ae6;return normalizeEnv(_0x26cd51)===_0x38f860(0x70);}export function isDev(_0x3f821b){const _0x5aae6c=a133_0x446ae6,_0x15ba25=normalizeEnv(_0x3f821b);return _0x15ba25==='development'||_0x15ba25===_0x5aae6c(0x6c);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a133_0x446ae6(0x6d));function a133_0x2484(_0x4dc5b4,_0x48c993){_0x4dc5b4=_0x4dc5b4-0x6c;const _0x338e6f=a133_0x338e();let _0x2484f8=_0x338e6f[_0x4dc5b4];return _0x2484f8;}export function getEnv(){return env;}export function initEnv(_0x1457e2){env=normalizeEnv(_0x1457e2);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a134_0x4206(_0x3ed6bf,_0x322857){_0x3ed6bf=_0x3ed6bf-0x8c;const _0xa74bd2=a134_0xa74b();let _0x42062d=_0xa74bd2[_0x3ed6bf];return _0x42062d;}const a134_0x222a5c=a134_0x4206;(function(_0x553ea6,_0x2a1b72){const _0x15eef5=a134_0x4206,_0x7d661e=_0x553ea6();while(!![]){try{const _0x216c90=-parseInt(_0x15eef5(0x96))/0x1*(parseInt(_0x15eef5(0x97))/0x2)+parseInt(_0x15eef5(0x8d))/0x3+parseInt(_0x15eef5(0x90))/0x4+parseInt(_0x15eef5(0x8c))/0x5*(parseInt(_0x15eef5(0x91))/0x6)+parseInt(_0x15eef5(0x95))/0x7+-parseInt(_0x15eef5(0x92))/0x8*(-parseInt(_0x15eef5(0x8e))/0x9)+-parseInt(_0x15eef5(0x8f))/0xa*(parseInt(_0x15eef5(0x94))/0xb);if(_0x216c90===_0x2a1b72)break;else _0x7d661e['push'](_0x7d661e['shift']());}catch(_0xad25a2){_0x7d661e['push'](_0x7d661e['shift']());}}}(a134_0xa74b,0x9ec0b));function a134_0xa74b(){const _0x18b2ed=['838940bvEUra','42UsXbdU','5224PNipwz','json','11DPIljj','1945902Fqkjjl','97687XzEsEK','2LvZIWl','compress','pretty','58700USVGPg','1274100dIOAkr','17730pvNAUt','15330730hULCsc'];a134_0xa74b=function(){return _0x18b2ed;};return a134_0xa74b();}export const RABETBASE_OUTPUT_FORMAT_VALUES=[a134_0x222a5c(0x93),a134_0x222a5c(0x99),a134_0x222a5c(0x98)];
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a135_0x5e8d97=a135_0xbb6c;(function(_0x5e77b8,_0x5d2a94){const _0x538adc=a135_0xbb6c,_0x59c228=_0x5e77b8();while(!![]){try{const _0x531030=parseInt(_0x538adc(0x13c))/0x1*(-parseInt(_0x538adc(0x138))/0x2)+-parseInt(_0x538adc(0x13b))/0x3+-parseInt(_0x538adc(0x13f))/0x4+parseInt(_0x538adc(0x139))/0x5*(parseInt(_0x538adc(0x13e))/0x6)+-parseInt(_0x538adc(0x135))/0x7*(-parseInt(_0x538adc(0x137))/0x8)+-parseInt(_0x538adc(0x13a))/0x9+-parseInt(_0x538adc(0x136))/0xa;if(_0x531030===_0x5d2a94)break;else _0x59c228['push'](_0x59c228['shift']());}catch(_0x9fb71){_0x59c228['push'](_0x59c228['shift']());}}}(a135_0x4a15,0x5e8f9));function a135_0xbb6c(_0x3cbd5b,_0x47ec17){_0x3cbd5b=_0x3cbd5b-0x135;const _0x4a158c=a135_0x4a15();let _0xbb6c=_0x4a158c[_0x3cbd5b];return _0xbb6c;}function a135_0x4a15(){const _0x16eebe=['312hqLRUK','2THvEjy','29315igtHRN','880830NSIsuc','901227lKpkAA','10258zGuPnB','./src/api','654tPpDiP','1429780UpOvKh','96474jCEAFS','232620riVxll'];a135_0x4a15=function(){return _0x16eebe;};return a135_0x4a15();}export const DEFAULT_API_DIR=a135_0x5e8d97(0x13d);
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a136_0x51a955=a136_0x542b;(function(_0x5d1b7f,_0x456665){const _0x5e205a=a136_0x542b,_0x203ad7=_0x5d1b7f();while(!![]){try{const _0x5e2021=parseInt(_0x5e205a(0x15e))/0x1+-parseInt(_0x5e205a(0x158))/0x2*(-parseInt(_0x5e205a(0x15b))/0x3)+parseInt(_0x5e205a(0x160))/0x4+-parseInt(_0x5e205a(0x15f))/0x5*(parseInt(_0x5e205a(0x161))/0x6)+-parseInt(_0x5e205a(0x156))/0x7*(parseInt(_0x5e205a(0x157))/0x8)+-parseInt(_0x5e205a(0x15c))/0x9*(-parseInt(_0x5e205a(0x15a))/0xa)+parseInt(_0x5e205a(0x162))/0xb;if(_0x5e2021===_0x456665)break;else _0x203ad7['push'](_0x203ad7['shift']());}catch(_0x23c005){_0x203ad7['push'](_0x203ad7['shift']());}}}(a136_0x4b61,0x70e5c));function a136_0x542b(_0x29463d,_0x4ca303){_0x29463d=_0x29463d-0x156;const _0x4b6187=a136_0x4b61();let _0x542bb6=_0x4b6187[_0x29463d];return _0x542bb6;}export const RISK_LEVEL_VALUES=[a136_0x51a955(0x159),'write',a136_0x51a955(0x15d)];function a136_0x4b61(){const _0x4662a9=['369TOHZeJ','high-risk-write','683242ledseB','10IBZtDm','164172VmpoPx','1944624jNfESE','3864663grahEL','7tVOsah','1825544wwFFXj','291738gkXihK','read','28620KjEXWW','3RNkJcG'];a136_0x4b61=function(){return _0x4662a9;};return a136_0x4b61();}
|