@lovrabet/rabetbase-cli 2.2.3-beta.1 → 2.2.3-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/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 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/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/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.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/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/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/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a128_0x32764b=a128_0xdfd8;(function(_0xade6ae,_0x3a0682){const _0x339b0f=a128_0xdfd8,_0x4f82eb=_0xade6ae();while(!![]){try{const _0x4c463a=parseInt(_0x339b0f(0x1af))/0x1*(-parseInt(_0x339b0f(0x1e0))/0x2)+parseInt(_0x339b0f(0x1d5))/0x3*(parseInt(_0x339b0f(0x1cb))/0x4)+parseInt(_0x339b0f(0x1d9))/0x5*(parseInt(_0x339b0f(0x1e1))/0x6)+-parseInt(_0x339b0f(0x1df))/0x7+parseInt(_0x339b0f(0x1de))/0x8*(parseInt(_0x339b0f(0x1b9))/0x9)+parseInt(_0x339b0f(0x1b2))/0xa*(-parseInt(_0x339b0f(0x1c0))/0xb)+-parseInt(_0x339b0f(0x1d4))/0xc;if(_0x4c463a===_0x3a0682)break;else _0x4f82eb['push'](_0x4f82eb['shift']());}catch(_0x57d07c){_0x4f82eb['push'](_0x4f82eb['shift']());}}}(a128_0x15f8,0xb028e));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';function a128_0xdfd8(_0x5f294e,_0x4474f9){_0x5f294e=_0x5f294e-0x1a9;const _0x15f8e1=a128_0x15f8();let _0xdfd868=_0x15f8e1[_0x5f294e];return _0xdfd868;}const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x20ae1c,_0x568304){const _0x28db95=a128_0xdfd8,_0x4e6578=[];let _0x39f46e=0x1;while(!![]){const _0x59ff8f=await listSqlQueries(_0x20ae1c,{'currentPage':_0x39f46e,'pageSize':PAGE_SIZE,'sqlCode':_0x568304['sqlCode'],'sqlName':_0x568304[_0x28db95(0x1cc)]}),_0xcf6f9f=_0x59ff8f[_0x28db95(0x1c7)]??[];_0x4e6578[_0x28db95(0x1c4)](..._0xcf6f9f);if(_0xcf6f9f[_0x28db95(0x1a9)]===0x0)break;const _0x4c51a7=_0x59ff8f[_0x28db95(0x1b3)]?.[_0x28db95(0x1dd)];if(_0x4c51a7!=null?_0x4e6578[_0x28db95(0x1a9)]>=_0x4c51a7:_0xcf6f9f[_0x28db95(0x1a9)]<PAGE_SIZE)break;_0x39f46e++;}return _0x4e6578;}async function ensureSqlContent(_0x2bf14a){const _0x299523=a128_0xdfd8;if(_0x2bf14a[_0x299523(0x1c8)]!=null&&String(_0x2bf14a[_0x299523(0x1c8)])[_0x299523(0x1a9)]>0x0)return _0x2bf14a;return getSqlQueryDetail(_0x2bf14a[_0x299523(0x1cd)]);}export const sqlPull={'service':'sql','command':'pull','description':a128_0x32764b(0x1bb),'risk':a128_0x32764b(0x1d0),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0x32764b(0x1b6),'type':a128_0x32764b(0x1dc),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a128_0x32764b(0x1d6),'type':'boolean','description':a128_0x32764b(0x1b8)}],async 'dryRun'(_0x46e5db){const _0x47957d=a128_0x32764b,_0x43bc4=loadSqlProjectConfig(_0x46e5db['appCode']),_0x139eaa=await readSqlLockFile(_0x43bc4[_0x47957d(0x1aa)]),{appLock:_0x1b246e}=ensureSqlLockScope(_0x139eaa??createEmptySqlLock(),_0x43bc4['appCode'],_0x43bc4[_0x47957d(0x1bf)],_0x47957d(0x1bd)),_0x36e893=await fetchAllSqlQueries(_0x46e5db[_0x47957d(0x1ae)],{'sqlCode':_0x46e5db['str']('sqlcode')||undefined,'sqlName':_0x46e5db[_0x47957d(0x1b1)](_0x47957d(0x1b6))||undefined}),_0x15bf6f=[];for(const _0x76cfca of _0x36e893){const _0x34d206=await ensureSqlContent(_0x76cfca),_0x38e97a=ensureRemoteSqlContent(_0x34d206),_0x42a777=detectModeFromSql(_0x34d206),_0x22c1ab=_0x34d206[_0x47957d(0x1e2)]?await getDbName(_0x46e5db[_0x47957d(0x1ae)],Number(_0x34d206[_0x47957d(0x1e2)]))['catch'](()=>undefined):undefined,_0x5f001c=buildLocalSqlFileContent({'sqlCode':_0x34d206['sqlCode'],'sqlName':_0x34d206[_0x47957d(0x1cc)],'dbId':_0x34d206[_0x47957d(0x1e2)]},_0x38e97a,{'dbName':_0x22c1ab,'mode':_0x42a777,'syncedAt':new Date()[_0x47957d(0x1cf)](),'description':_0x34d206[_0x47957d(0x1d2)]}),_0xa523c7=buildSqlLockEntry(_0x34d206,_0x38e97a,'',{'dbName':_0x22c1ab}),_0x495d40=resolveLocalSqlFilePath(_0x43bc4,_0x34d206[_0x47957d(0x1cd)],_0xa523c7);let _0x127efa='would_pull',_0xa2a842;if(await fileExists(_0x495d40)){const _0xc040de=await readFile(_0x495d40,_0x47957d(0x1c6));isEquivalentPulledSqlFile(_0xc040de,_0x5f001c,_0x42a777)?(_0x127efa=_0x47957d(0x1ba),_0xa2a842=_0x47957d(0x1ab)):(_0x127efa=_0x47957d(0x1d3),_0xa2a842=_0x47957d(0x1bc));}_0x15bf6f[_0x47957d(0x1c4)]({'sqlCode':_0x34d206['sqlCode'],'sqlName':_0x34d206[_0x47957d(0x1cc)],'filePath':_0x495d40,'status':_0x127efa,'reason':_0xa2a842});}return{'method':_0x47957d(0x1c9),'url':_0x47957d(0x1b4),'body':{'appCode':_0x46e5db[_0x47957d(0x1ae)],'sqlCode':_0x46e5db['str'](_0x47957d(0x1ad))||null,'sqlName':_0x46e5db[_0x47957d(0x1b1)](_0x47957d(0x1b6))||null,'files':_0x15bf6f},'description':'Would\x20pull\x20'+_0x15bf6f[_0x47957d(0x1a9)]+_0x47957d(0x1c1)+_0x43bc4['sqlRootDir']};},async 'execute'(_0x5bfe34){const _0x3280d3=a128_0x32764b,_0x361e25=loadSqlProjectConfig(_0x5bfe34[_0x3280d3(0x1ae)]),_0x17c264=await readSqlLockFile(_0x361e25[_0x3280d3(0x1aa)]),{lockData:_0x4f9073,appLock:_0x161c83}=ensureSqlLockScope(_0x17c264??createEmptySqlLock(),_0x361e25[_0x3280d3(0x1ae)],_0x361e25[_0x3280d3(0x1bf)],'pull'),_0x2dd95d=_0x5bfe34[_0x3280d3(0x1ca)]('force'),_0x482f7b=await fetchAllSqlQueries(_0x5bfe34[_0x3280d3(0x1ae)],{'sqlCode':_0x5bfe34[_0x3280d3(0x1b1)](_0x3280d3(0x1ad))||undefined,'sqlName':_0x5bfe34[_0x3280d3(0x1b1)](_0x3280d3(0x1b6))||undefined});if(_0x482f7b['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x1324d1=[],_0x5374ba=[];for(const _0x40e2e9 of _0x482f7b){try{_0x1324d1['push'](await ensureSqlContent(_0x40e2e9));}catch(_0xa05927){_0x5374ba[_0x3280d3(0x1c4)]({'sqlCode':_0x40e2e9[_0x3280d3(0x1cd)],'error':_0xa05927 instanceof Error?_0xa05927[_0x3280d3(0x1be)]:String(_0xa05927)});}}if(_0x2dd95d&&!_0x5bfe34[_0x3280d3(0x1d8)]){let _0x5c258c=![];for(const _0x3da972 of _0x1324d1){const _0x93d930=detectModeFromSql(_0x3da972),_0x3a547c=_0x3da972[_0x3280d3(0x1e2)]?await getDbName(_0x5bfe34[_0x3280d3(0x1ae)],Number(_0x3da972[_0x3280d3(0x1e2)]))[_0x3280d3(0x1c5)](()=>undefined):undefined,_0x412b90=buildLocalSqlFileContent({'sqlCode':_0x3da972[_0x3280d3(0x1cd)],'sqlName':_0x3da972[_0x3280d3(0x1cc)],'dbId':_0x3da972[_0x3280d3(0x1e2)]},ensureRemoteSqlContent(_0x3da972),{'dbName':_0x3a547c,'mode':_0x93d930,'syncedAt':new Date()[_0x3280d3(0x1cf)](),'description':_0x3da972['description']}),_0x5a238e=resolveLocalSqlFilePath(_0x361e25,_0x3da972[_0x3280d3(0x1cd)],buildSqlLockEntry(_0x3da972,ensureRemoteSqlContent(_0x3da972),'',{'dbName':_0x3a547c}));if(await fileExists(_0x5a238e)){const _0x459943=await readFile(_0x5a238e,'utf8');if(!isEquivalentPulledSqlFile(_0x459943,_0x412b90,_0x93d930)){_0x5c258c=!![];break;}}}if(_0x5c258c){const _0x5bccd5=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x5bccd5)throw CliErrors['cancelled']('Force\x20pull\x20cancelled.');}}const _0x4368d5=cloneSqlLockData(_0x4f9073),_0xf9c1e5=_0x4368d5[_0x3280d3(0x1d7)][_0x361e25[_0x3280d3(0x1ae)]],_0x25ec62=[],_0x145da9=[];for(const _0x47da0d of _0x1324d1){const _0x9d7975=_0xf9c1e5[_0x3280d3(0x1ce)][_0x47da0d[_0x3280d3(0x1cd)]],_0x54bfc9=ensureRemoteSqlContent(_0x47da0d),_0x2240ee=detectModeFromSql(_0x47da0d),_0x36f6a9=_0x47da0d['dbId']?await getDbName(_0x5bfe34[_0x3280d3(0x1ae)],Number(_0x47da0d[_0x3280d3(0x1e2)]))[_0x3280d3(0x1c5)](()=>undefined):undefined,_0x56c29a=buildLocalSqlFileContent({'sqlCode':_0x47da0d['sqlCode'],'sqlName':_0x47da0d[_0x3280d3(0x1cc)],'dbId':_0x47da0d[_0x3280d3(0x1e2)]},_0x54bfc9,{'dbName':_0x36f6a9,'mode':_0x2240ee,'syncedAt':new Date()[_0x3280d3(0x1cf)](),'description':_0x47da0d[_0x3280d3(0x1d2)]}),_0x112015=buildSqlLockEntry(_0x47da0d,_0x54bfc9,computeSqlContentHash(_0x56c29a),{'dbName':_0x36f6a9}),_0xb190f5=_0x112015[_0x3280d3(0x1db)],_0x15ea76=join(_0x361e25[_0x3280d3(0x1b5)],_0xb190f5);try{if(await fileExists(_0x15ea76)){const _0x2a3d32=await readFile(_0x15ea76,'utf8');if(isEquivalentPulledSqlFile(_0x2a3d32,_0x56c29a,_0x2240ee)){_0x145da9[_0x3280d3(0x1c4)]({'sqlCode':_0x47da0d[_0x3280d3(0x1cd)],'reason':_0x3280d3(0x1ab)}),_0xf9c1e5[_0x3280d3(0x1ce)][_0x47da0d['sqlCode']]={..._0x112015,'hash':computeSqlContentHash(_0x2a3d32),'path':_0xb190f5};continue;}if(!_0x2dd95d){_0x145da9['push']({'sqlCode':_0x47da0d['sqlCode'],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x165647=_0x9d7975?.[_0x3280d3(0x1db)]?join(_0x361e25[_0x3280d3(0x1b5)],_0x9d7975[_0x3280d3(0x1db)]):undefined;_0x165647&&_0x165647!==_0x15ea76&&await fileExists(_0x165647)&&await rm(_0x165647,{'force':!![]}),await ensureParentDirectory(_0x15ea76),await writeFile(_0x15ea76,_0x56c29a,_0x3280d3(0x1c6)),_0xf9c1e5[_0x3280d3(0x1ce)][_0x47da0d[_0x3280d3(0x1cd)]]={..._0x112015,'path':_0xb190f5},_0x25ec62[_0x3280d3(0x1c4)]({'sqlCode':_0x47da0d[_0x3280d3(0x1cd)],'filePath':_0x15ea76});}catch(_0x203b05){_0x5374ba[_0x3280d3(0x1c4)]({'sqlCode':_0x47da0d[_0x3280d3(0x1cd)],'error':_0x203b05 instanceof Error?_0x203b05[_0x3280d3(0x1be)]:String(_0x203b05)});}}return _0xf9c1e5['lastSync']=new Date()[_0x3280d3(0x1cf)](),await writeSqlLockFile(_0x361e25[_0x3280d3(0x1aa)],_0x4368d5),{'ok':_0x5374ba[_0x3280d3(0x1a9)]===0x0,'data':{'pulled':_0x25ec62,'skipped':_0x145da9,'failed':_0x5374ba},'message':_0x3280d3(0x1e4)+_0x25ec62[_0x3280d3(0x1a9)]+_0x3280d3(0x1da)+_0x145da9[_0x3280d3(0x1a9)]+'\x20skipped,\x20'+_0x5374ba[_0x3280d3(0x1a9)]+_0x3280d3(0x1ac)};}};function detectModeFromSql(_0x183e40){const _0x746742=a128_0x32764b,_0x6f1038=ensureRemoteSqlContent(_0x183e40),_0x4e86ec=stripLocalSqlMetadata(_0x6f1038,_0x746742(0x1c3))['trimStart']();if(/^<(select|insert|update|delete)\b/i['test'](_0x4e86ec))return'mybatisXml';return _0x746742(0x1e3);}function isEquivalentPulledSqlFile(_0x3cf631,_0x242e1f,_0x3739b1){return normalizePullComparableContent(_0x3cf631,_0x3739b1)===normalizePullComparableContent(_0x242e1f,_0x3739b1);}function normalizePullComparableContent(_0x3adc3e,_0x3959ec){const _0x5f3a1f=a128_0x32764b,_0x4237a5=_0x3adc3e[_0x5f3a1f(0x1b0)](/\r\n/g,'\x0a')[_0x5f3a1f(0x1c2)]('\x0a'),_0x825e40=_0x4237a5['filter'](_0x3c1bd2=>!isSyncedAtMetadataLine(_0x3c1bd2,_0x3959ec));return _0x825e40[_0x5f3a1f(0x1b7)]('\x0a');}function a128_0x15f8(){const _0x1b24fb=['write','test','description','conflict','2378532DplsyM','8385itOjVF','force','apps','nonInteractive','4165naWVKV','\x20written,\x20','path','string','totalCount','3326480XpVyrK','988239svrHxB','2410244bQBFKc','8958zrspmG','dbId','sql','Pull\x20complete:\x20','length','lockFilePath','unchanged','\x20failed','sqlcode','appCode','1ScVMLB','replace','str','140PeyodR','paging','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqlRootDir','name','join','Force\x20overwrite\x20local\x20unsynced\x20changes','9QdVazg','skipped','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','pull','message','sqlRoot','548966qrNlKx','\x20SQL\x20file(s)\x20into\x20','split','mybatisXml','push','catch','utf8','tableData','sqlContent','POST','bool','1868twYGnE','sqlName','sqlCode','sqls','toISOString'];a128_0x15f8=function(){return _0x1b24fb;};return a128_0x15f8();}function isSyncedAtMetadataLine(_0xab96a8,_0x29a32d){const _0x51eaca=a128_0x32764b;if(_0x29a32d===_0x51eaca(0x1c3))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0xab96a8);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x51eaca(0x1d1)](_0xab96a8);}
|
|
1
|
+
const a128_0x4a3d0e=a128_0x2ffb;(function(_0x49733f,_0x295cff){const _0x2d3383=a128_0x2ffb,_0x1bd2af=_0x49733f();while(!![]){try{const _0x489eb8=-parseInt(_0x2d3383(0x14e))/0x1*(-parseInt(_0x2d3383(0x16f))/0x2)+-parseInt(_0x2d3383(0x16d))/0x3*(parseInt(_0x2d3383(0x166))/0x4)+-parseInt(_0x2d3383(0x15d))/0x5+parseInt(_0x2d3383(0x160))/0x6+-parseInt(_0x2d3383(0x153))/0x7*(-parseInt(_0x2d3383(0x155))/0x8)+parseInt(_0x2d3383(0x174))/0x9*(parseInt(_0x2d3383(0x154))/0xa)+-parseInt(_0x2d3383(0x165))/0xb;if(_0x489eb8===_0x295cff)break;else _0x1bd2af['push'](_0x1bd2af['shift']());}catch(_0x5e7c1b){_0x1bd2af['push'](_0x1bd2af['shift']());}}}(a128_0x42f3,0x6b186));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';function a128_0x42f3(){const _0x3c6020=['length','POST','write','name','appCode','2199bzktcP','toISOString','438282qkFJqo','paging','test','sqlName','skipped','9pYwNzn','utf8','message','replace','local\x20differs\x20from\x20remote','lastSync','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqls','Force\x20overwrite\x20local\x20unsynced\x20changes','Pull\x20complete:\x20','sqlcode','pull','str','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sql','force','nonInteractive','\x20SQL\x20file(s)\x20into\x20','push','string','cancelled','filter','sqlCode','unchanged','catch','trimStart','1XwbzAM','would_pull','totalCount','sqlRootDir','sqlRoot','96299mclcba','5664760VogZhe','376ozjtEx','description','mybatisXml','sqlContent','Force\x20pull\x20cancelled.','lockFilePath','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','dbId','2536070vFvKOS','\x20skipped,\x20','tableData','4037472ppNPXP','bool','conflict','split','path','11848496CANvUc','448HegAkY','\x20failed'];a128_0x42f3=function(){return _0x3c6020;};return a128_0x42f3();}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(_0x4589b2,_0x8334e8){const _0x431360=a128_0x2ffb,_0x2be717=[];let _0x2ed8c9=0x1;while(!![]){const _0x163938=await listSqlQueries(_0x4589b2,{'currentPage':_0x2ed8c9,'pageSize':PAGE_SIZE,'sqlCode':_0x8334e8[_0x431360(0x14a)],'sqlName':_0x8334e8['sqlName']}),_0x4f64da=_0x163938[_0x431360(0x15f)]??[];_0x2be717['push'](..._0x4f64da);if(_0x4f64da[_0x431360(0x168)]===0x0)break;const _0x4e46f4=_0x163938[_0x431360(0x170)]?.[_0x431360(0x150)];if(_0x4e46f4!=null?_0x2be717[_0x431360(0x168)]>=_0x4e46f4:_0x4f64da['length']<PAGE_SIZE)break;_0x2ed8c9++;}return _0x2be717;}async function ensureSqlContent(_0x5a27e9){const _0xf68585=a128_0x2ffb;if(_0x5a27e9[_0xf68585(0x158)]!=null&&String(_0x5a27e9['sqlContent'])[_0xf68585(0x168)]>0x0)return _0x5a27e9;return getSqlQueryDetail(_0x5a27e9['sqlCode']);}export const sqlPull={'service':a128_0x4a3d0e(0x182),'command':'pull','description':a128_0x4a3d0e(0x17a),'risk':a128_0x4a3d0e(0x16a),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0x4a3d0e(0x16b),'type':a128_0x4a3d0e(0x147),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a128_0x4a3d0e(0x183),'type':'boolean','description':a128_0x4a3d0e(0x17c)}],async 'dryRun'(_0x2266d9){const _0x41ea44=a128_0x4a3d0e,_0x4e11fa=loadSqlProjectConfig(_0x2266d9[_0x41ea44(0x16c)]),_0x1a4f2b=await readSqlLockFile(_0x4e11fa[_0x41ea44(0x15a)]),{appLock:_0x1ec7b2}=ensureSqlLockScope(_0x1a4f2b??createEmptySqlLock(),_0x4e11fa[_0x41ea44(0x16c)],_0x4e11fa['sqlRoot'],_0x41ea44(0x17f)),_0x14369d=await fetchAllSqlQueries(_0x2266d9['appCode'],{'sqlCode':_0x2266d9[_0x41ea44(0x180)](_0x41ea44(0x17e))||undefined,'sqlName':_0x2266d9[_0x41ea44(0x180)](_0x41ea44(0x16b))||undefined}),_0x20bba1=[];for(const _0x24e69d of _0x14369d){const _0x28c248=await ensureSqlContent(_0x24e69d),_0x30b33e=ensureRemoteSqlContent(_0x28c248),_0x966cda=detectModeFromSql(_0x28c248),_0x524c85=_0x28c248[_0x41ea44(0x15c)]?await getDbName(_0x2266d9[_0x41ea44(0x16c)],Number(_0x28c248[_0x41ea44(0x15c)]))['catch'](()=>undefined):undefined,_0x2c12a4=buildLocalSqlFileContent({'sqlCode':_0x28c248[_0x41ea44(0x14a)],'sqlName':_0x28c248[_0x41ea44(0x172)],'dbId':_0x28c248[_0x41ea44(0x15c)]},_0x30b33e,{'dbName':_0x524c85,'mode':_0x966cda,'syncedAt':new Date()[_0x41ea44(0x16e)](),'description':_0x28c248[_0x41ea44(0x156)]}),_0x3232f9=buildSqlLockEntry(_0x28c248,_0x30b33e,'',{'dbName':_0x524c85}),_0xe2f394=resolveLocalSqlFilePath(_0x4e11fa,_0x28c248[_0x41ea44(0x14a)],_0x3232f9);let _0x2824ee=_0x41ea44(0x14f),_0x548b18;if(await fileExists(_0xe2f394)){const _0xefafb8=await readFile(_0xe2f394,_0x41ea44(0x175));isEquivalentPulledSqlFile(_0xefafb8,_0x2c12a4,_0x966cda)?(_0x2824ee=_0x41ea44(0x173),_0x548b18=_0x41ea44(0x14b)):(_0x2824ee=_0x41ea44(0x162),_0x548b18=_0x41ea44(0x181));}_0x20bba1['push']({'sqlCode':_0x28c248[_0x41ea44(0x14a)],'sqlName':_0x28c248['sqlName'],'filePath':_0xe2f394,'status':_0x2824ee,'reason':_0x548b18});}return{'method':_0x41ea44(0x169),'url':_0x41ea44(0x15b),'body':{'appCode':_0x2266d9['appCode'],'sqlCode':_0x2266d9[_0x41ea44(0x180)](_0x41ea44(0x17e))||null,'sqlName':_0x2266d9[_0x41ea44(0x180)](_0x41ea44(0x16b))||null,'files':_0x20bba1},'description':'Would\x20pull\x20'+_0x20bba1[_0x41ea44(0x168)]+_0x41ea44(0x145)+_0x4e11fa[_0x41ea44(0x151)]};},async 'execute'(_0xe2aec5){const _0x4b853e=a128_0x4a3d0e,_0x281de8=loadSqlProjectConfig(_0xe2aec5[_0x4b853e(0x16c)]),_0x197a93=await readSqlLockFile(_0x281de8[_0x4b853e(0x15a)]),{lockData:_0x596935,appLock:_0x4909cc}=ensureSqlLockScope(_0x197a93??createEmptySqlLock(),_0x281de8[_0x4b853e(0x16c)],_0x281de8[_0x4b853e(0x152)],_0x4b853e(0x17f)),_0x3fd46b=_0xe2aec5[_0x4b853e(0x161)](_0x4b853e(0x183)),_0x342016=await fetchAllSqlQueries(_0xe2aec5['appCode'],{'sqlCode':_0xe2aec5[_0x4b853e(0x180)]('sqlcode')||undefined,'sqlName':_0xe2aec5['str'](_0x4b853e(0x16b))||undefined});if(_0x342016[_0x4b853e(0x168)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0xfd6970=[],_0xcb379b=[];for(const _0xa25f2c of _0x342016){try{_0xfd6970[_0x4b853e(0x146)](await ensureSqlContent(_0xa25f2c));}catch(_0x594f22){_0xcb379b[_0x4b853e(0x146)]({'sqlCode':_0xa25f2c[_0x4b853e(0x14a)],'error':_0x594f22 instanceof Error?_0x594f22['message']:String(_0x594f22)});}}if(_0x3fd46b&&!_0xe2aec5[_0x4b853e(0x184)]){let _0x275868=![];for(const _0x2859cd of _0xfd6970){const _0x38c389=detectModeFromSql(_0x2859cd),_0x305c71=_0x2859cd['dbId']?await getDbName(_0xe2aec5[_0x4b853e(0x16c)],Number(_0x2859cd['dbId']))[_0x4b853e(0x14c)](()=>undefined):undefined,_0x4fd84c=buildLocalSqlFileContent({'sqlCode':_0x2859cd[_0x4b853e(0x14a)],'sqlName':_0x2859cd[_0x4b853e(0x172)],'dbId':_0x2859cd['dbId']},ensureRemoteSqlContent(_0x2859cd),{'dbName':_0x305c71,'mode':_0x38c389,'syncedAt':new Date()['toISOString'](),'description':_0x2859cd[_0x4b853e(0x156)]}),_0xa2ae0b=resolveLocalSqlFilePath(_0x281de8,_0x2859cd[_0x4b853e(0x14a)],buildSqlLockEntry(_0x2859cd,ensureRemoteSqlContent(_0x2859cd),'',{'dbName':_0x305c71}));if(await fileExists(_0xa2ae0b)){const _0x5cba1e=await readFile(_0xa2ae0b,_0x4b853e(0x175));if(!isEquivalentPulledSqlFile(_0x5cba1e,_0x4fd84c,_0x38c389)){_0x275868=!![];break;}}}if(_0x275868){const _0x4f7630=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x4f7630)throw CliErrors[_0x4b853e(0x148)](_0x4b853e(0x159));}}const _0x73995b=cloneSqlLockData(_0x596935),_0x427ed4=_0x73995b['apps'][_0x281de8[_0x4b853e(0x16c)]],_0x3e7c35=[],_0x1bb96b=[];for(const _0x470420 of _0xfd6970){const _0x591476=_0x427ed4['sqls'][_0x470420[_0x4b853e(0x14a)]],_0x5f80b9=ensureRemoteSqlContent(_0x470420),_0x209966=detectModeFromSql(_0x470420),_0x3723ab=_0x470420[_0x4b853e(0x15c)]?await getDbName(_0xe2aec5[_0x4b853e(0x16c)],Number(_0x470420[_0x4b853e(0x15c)]))[_0x4b853e(0x14c)](()=>undefined):undefined,_0x544e9f=buildLocalSqlFileContent({'sqlCode':_0x470420['sqlCode'],'sqlName':_0x470420[_0x4b853e(0x172)],'dbId':_0x470420[_0x4b853e(0x15c)]},_0x5f80b9,{'dbName':_0x3723ab,'mode':_0x209966,'syncedAt':new Date()[_0x4b853e(0x16e)](),'description':_0x470420[_0x4b853e(0x156)]}),_0x4374ba=buildSqlLockEntry(_0x470420,_0x5f80b9,computeSqlContentHash(_0x544e9f),{'dbName':_0x3723ab}),_0x478571=_0x4374ba[_0x4b853e(0x164)],_0x43290b=join(_0x281de8[_0x4b853e(0x151)],_0x478571);try{if(await fileExists(_0x43290b)){const _0x3bcdb7=await readFile(_0x43290b,_0x4b853e(0x175));if(isEquivalentPulledSqlFile(_0x3bcdb7,_0x544e9f,_0x209966)){_0x1bb96b[_0x4b853e(0x146)]({'sqlCode':_0x470420['sqlCode'],'reason':_0x4b853e(0x14b)}),_0x427ed4[_0x4b853e(0x17b)][_0x470420[_0x4b853e(0x14a)]]={..._0x4374ba,'hash':computeSqlContentHash(_0x3bcdb7),'path':_0x478571};continue;}if(!_0x3fd46b){_0x1bb96b['push']({'sqlCode':_0x470420['sqlCode'],'reason':_0x4b853e(0x178)});continue;}}const _0x2d71cd=_0x591476?.[_0x4b853e(0x164)]?join(_0x281de8['sqlRootDir'],_0x591476['path']):undefined;_0x2d71cd&&_0x2d71cd!==_0x43290b&&await fileExists(_0x2d71cd)&&await rm(_0x2d71cd,{'force':!![]}),await ensureParentDirectory(_0x43290b),await writeFile(_0x43290b,_0x544e9f,'utf8'),_0x427ed4[_0x4b853e(0x17b)][_0x470420[_0x4b853e(0x14a)]]={..._0x4374ba,'path':_0x478571},_0x3e7c35['push']({'sqlCode':_0x470420['sqlCode'],'filePath':_0x43290b});}catch(_0x147b40){_0xcb379b[_0x4b853e(0x146)]({'sqlCode':_0x470420['sqlCode'],'error':_0x147b40 instanceof Error?_0x147b40[_0x4b853e(0x176)]:String(_0x147b40)});}}return _0x427ed4[_0x4b853e(0x179)]=new Date()['toISOString'](),await writeSqlLockFile(_0x281de8[_0x4b853e(0x15a)],_0x73995b),{'ok':_0xcb379b['length']===0x0,'data':{'pulled':_0x3e7c35,'skipped':_0x1bb96b,'failed':_0xcb379b},'message':_0x4b853e(0x17d)+_0x3e7c35['length']+'\x20written,\x20'+_0x1bb96b[_0x4b853e(0x168)]+_0x4b853e(0x15e)+_0xcb379b['length']+_0x4b853e(0x167)};}};function detectModeFromSql(_0x10ae62){const _0x5371ff=a128_0x4a3d0e,_0x5b298a=ensureRemoteSqlContent(_0x10ae62),_0x42ed88=stripLocalSqlMetadata(_0x5b298a,_0x5371ff(0x157))[_0x5371ff(0x14d)]();if(/^<(select|insert|update|delete)\b/i[_0x5371ff(0x171)](_0x42ed88))return _0x5371ff(0x157);return _0x5371ff(0x182);}function a128_0x2ffb(_0x4af106,_0x1a14e0){_0x4af106=_0x4af106-0x145;const _0x42f383=a128_0x42f3();let _0x2ffb0d=_0x42f383[_0x4af106];return _0x2ffb0d;}function isEquivalentPulledSqlFile(_0x67a6c7,_0x1585f7,_0x47faee){return normalizePullComparableContent(_0x67a6c7,_0x47faee)===normalizePullComparableContent(_0x1585f7,_0x47faee);}function normalizePullComparableContent(_0x59f393,_0x466391){const _0x298c18=a128_0x4a3d0e,_0xc534c6=_0x59f393[_0x298c18(0x177)](/\r\n/g,'\x0a')[_0x298c18(0x163)]('\x0a'),_0x3d4017=_0xc534c6[_0x298c18(0x149)](_0x449ce9=>!isSyncedAtMetadataLine(_0x449ce9,_0x466391));return _0x3d4017['join']('\x0a');}function isSyncedAtMetadataLine(_0x103fc2,_0x123c25){const _0x33e01d=a128_0x4a3d0e;if(_0x123c25===_0x33e01d(0x157))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x103fc2);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x33e01d(0x171)](_0x103fc2);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a129_0x1b9372=a129_0x1cdd;(function(_0x40fa4e,_0x23e7f9){const _0x566017=a129_0x1cdd,_0x41c23f=_0x40fa4e();while(!![]){try{const _0x58aae4=-parseInt(_0x566017(0xbc))/0x1+-parseInt(_0x566017(0xe5))/0x2*(-parseInt(_0x566017(0xe6))/0x3)+parseInt(_0x566017(0xe9))/0x4+parseInt(_0x566017(0xc3))/0x5+-parseInt(_0x566017(0xdd))/0x6+-parseInt(_0x566017(0xb6))/0x7*(parseInt(_0x566017(0xd9))/0x8)+parseInt(_0x566017(0xd5))/0x9*(parseInt(_0x566017(0xc8))/0xa);if(_0x58aae4===_0x23e7f9)break;else _0x41c23f['push'](_0x41c23f['shift']());}catch(_0x1e7470){_0x41c23f['push'](_0x41c23f['shift']());}}}(a129_0x3797,0x28294));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a129_0x1cdd(_0x4d550b,_0x371b10){_0x4d550b=_0x4d550b-0xaf;const _0x37978f=a129_0x3797();let _0x1cdd6e=_0x37978f[_0x4d550b];return _0x1cdd6e;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';function a129_0x3797(){const _0x455bb9=['filter','isFinite','1172260PUJcMR','get','version','hash','sqlRootDir','utf8','toISOString','sqlCode','sqlRoot','str','force','dbDirectory','length','\x20pushed,\x20','Would\x20push\x20','push','dbId','63fPEPJi','map','sqls','lastSync','remoteId','exec','299037OnbThB','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','trashDir','Local\x20directory\x20\x22','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','relativePath','\x22\x20for\x20sqlCode\x20','244060hWRCXd','No\x20local\x20SQL\x20files\x20found.','sqlcode','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','Push\x20complete:\x20','1240qtkbMw','has','Local\x20SQL\x20not\x20found:\x20','replace','startsWith','mode','message','dbName','validation','filePath','set','join','high-risk-write','30420VNvFkJ','path','No\x20database\x20matches\x20local\x20directory\x20\x22','boolean','279688dMBRGl','POST','sqlConfig','lockFilePath','1797252vwtUVu','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sqlName','bool','catch','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','appCode','211154DiSYqX','9PVtfjh'];a129_0x3797=function(){return _0x455bb9;};return a129_0x3797();}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x46057a,_0x3349fe,_0x24ddfc){const _0x799d5=a129_0x1cdd,_0x4056be=await scanLocalSqlQueries(_0x46057a),_0x4f440f=new Map();for(const _0x2ac5b5 of _0x4056be){if(_0x24ddfc&&_0x2ac5b5[_0x799d5(0xf0)]!==_0x24ddfc)continue;const _0x14a46a=_0x4f440f[_0x799d5(0xea)](_0x2ac5b5[_0x799d5(0xf0)])??[];_0x14a46a[_0x799d5(0xb4)](_0x2ac5b5),_0x4f440f[_0x799d5(0xd2)](_0x2ac5b5[_0x799d5(0xf0)],_0x14a46a);}if(_0x24ddfc&&!_0x4f440f[_0x799d5(0xc9)](_0x24ddfc))throw CliErrors[_0x799d5(0xd0)](_0x799d5(0xca)+_0x24ddfc);const _0x303cd3=[];for(const [_0x54c1f9,_0x592516]of _0x4f440f['entries']()){if(_0x592516['length']===0x1){_0x303cd3[_0x799d5(0xb4)](_0x592516[0x0]);continue;}const _0x98b1a3=_0x3349fe['sqls'][_0x54c1f9],_0x26b8c3=_0x98b1a3?.[_0x799d5(0xd6)],_0x385ac9=_0x26b8c3?_0x592516[_0x799d5(0xe7)](_0x1cd31b=>_0x1cd31b[_0x799d5(0xc1)]!==_0x26b8c3):_0x592516;if(_0x98b1a3&&_0x385ac9[_0x799d5(0xb1)]===0x1){_0x303cd3[_0x799d5(0xb4)](_0x385ac9[0x0]);continue;}throw CliErrors['validation'](_0x799d5(0xbd)+_0x54c1f9+_0x799d5(0xde));}return _0x303cd3;}export const sqlPush={'service':'sql','command':a129_0x1b9372(0xb4),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a129_0x1b9372(0xd4),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a129_0x1b9372(0xaf),'type':a129_0x1b9372(0xd8),'description':a129_0x1b9372(0xe3)}],async 'dryRun'(_0x201c02){const _0x1271cf=a129_0x1b9372,_0x2c5a6b=loadSqlProjectConfig(_0x201c02[_0x1271cf(0xe4)]),_0x438535=await readSqlLockFile(_0x2c5a6b[_0x1271cf(0xdc)]),{appLock:_0x2a244b}=ensureSqlLockScope(_0x438535??createEmptySqlLock(),_0x201c02[_0x1271cf(0xe4)],_0x2c5a6b[_0x1271cf(0xf1)],'push'),_0x150727=await getTargetSqlQueries(_0x2c5a6b,_0x2a244b,_0x201c02['str'](_0x1271cf(0xc5))||undefined),_0x22cd7b=[];for(const _0x465b6f of _0x150727){const _0x59afbc=await computeSqlFileHash(_0x465b6f[_0x1271cf(0xd1)]),_0x1d3899=_0x2a244b['sqls'][_0x465b6f['sqlCode']],_0xe28c44=!!_0x1d3899&&(_0x1d3899['path']!==_0x465b6f[_0x1271cf(0xc1)]||!!_0x465b6f[_0x1271cf(0xe0)]&&_0x1d3899[_0x1271cf(0xe0)]!==_0x465b6f[_0x1271cf(0xe0)]);if(!_0x201c02[_0x1271cf(0xe1)](_0x1271cf(0xaf))&&_0x1d3899&&_0x1d3899[_0x1271cf(0xec)]===_0x59afbc&&!_0xe28c44)continue;_0x22cd7b['push'](_0x465b6f[_0x1271cf(0xf0)]);}return{'method':_0x1271cf(0xda),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x22cd7b,'appCode':_0x201c02['appCode']},'description':_0x1271cf(0xb3)+_0x22cd7b[_0x1271cf(0xb1)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x22ea6d){const _0x2a08e2=a129_0x1b9372,_0x2d7ce3=loadSqlProjectConfig(_0x22ea6d[_0x2a08e2(0xe4)]),_0x260527=await readSqlLockFile(_0x2d7ce3[_0x2a08e2(0xdc)]),{lockData:_0x28bf5c,appLock:_0x3c6c63}=ensureSqlLockScope(_0x260527??createEmptySqlLock(),_0x22ea6d[_0x2a08e2(0xe4)],_0x2d7ce3['sqlRoot'],'push'),_0x36d19d=await getTargetSqlQueries(_0x2d7ce3,_0x3c6c63,_0x22ea6d[_0x2a08e2(0xf2)]('sqlcode')||undefined);if(_0x36d19d[_0x2a08e2(0xb1)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x2a08e2(0xc4)};const _0x2ebb35=[],_0x3cfd78=[],_0x5002e3=[];for(const _0x408300 of _0x36d19d){const _0xb3bc47=_0x3c6c63[_0x2a08e2(0xb8)][_0x408300[_0x2a08e2(0xf0)]];if(!_0xb3bc47){_0x5002e3[_0x2a08e2(0xb4)]({'sqlCode':_0x408300[_0x2a08e2(0xf0)],'error':_0x2a08e2(0xc6)});continue;}try{const _0xe0d9ad=await computeSqlFileHash(_0x408300[_0x2a08e2(0xd1)]),_0x1340d6=_0xb3bc47[_0x2a08e2(0xd6)]!==_0x408300['relativePath']||!!_0x408300[_0x2a08e2(0xe0)]&&_0xb3bc47[_0x2a08e2(0xe0)]!==_0x408300[_0x2a08e2(0xe0)];if(!_0x22ea6d[_0x2a08e2(0xe1)](_0x2a08e2(0xaf))&&_0xb3bc47['hash']===_0xe0d9ad&&!_0x1340d6){_0x3cfd78[_0x2a08e2(0xb4)]({'sqlCode':_0x408300[_0x2a08e2(0xf0)],'reason':'unchanged'});continue;}if(_0xb3bc47[_0x2a08e2(0xeb)]==null){_0x5002e3[_0x2a08e2(0xb4)]({'sqlCode':_0x408300[_0x2a08e2(0xf0)],'error':_0x2a08e2(0xdf)});continue;}const _0x46e97a=await readFile(_0x408300[_0x2a08e2(0xd1)],_0x2a08e2(0xee)),_0x453632=stripLocalSqlMetadata(_0x46e97a,_0x408300[_0x2a08e2(0xcd)]),_0x23096d=_0x408300[_0x2a08e2(0xe0)]||_0xb3bc47[_0x2a08e2(0xe0)],_0x5a4e46=await resolveTargetDbBinding(_0x22ea6d[_0x2a08e2(0xe4)],_0x408300,_0xb3bc47),_0xefd3b5=await updateSqlQuery({'id':_0xb3bc47[_0x2a08e2(0xba)],'appCode':_0x22ea6d[_0x2a08e2(0xe4)],'sqlCode':_0x408300[_0x2a08e2(0xf0)],'sqlName':_0x23096d,'dbId':_0x5a4e46['dbId'],'version':_0xb3bc47[_0x2a08e2(0xeb)],'sqlContent':_0x453632,'sqlConfig':_0xb3bc47[_0x2a08e2(0xdb)]??undefined}),_0xd8afb=_0xefd3b5[_0x2a08e2(0xb5)]?await getDbName(_0x22ea6d[_0x2a08e2(0xe4)],Number(_0xefd3b5['dbId']))[_0x2a08e2(0xe2)](()=>_0x5a4e46['dbName']):_0x5a4e46[_0x2a08e2(0xcf)];_0x3c6c63[_0x2a08e2(0xb8)][_0x408300[_0x2a08e2(0xf0)]]={...buildSqlLockEntry(_0xefd3b5,_0x453632,_0xe0d9ad,{'dbName':_0xd8afb}),'path':_0x408300[_0x2a08e2(0xc1)],'mode':_0xb3bc47['mode']},await archivePreviousSqlFileIfNeeded(_0x2d7ce3,_0xb3bc47[_0x2a08e2(0xd6)],_0x408300[_0x2a08e2(0xc1)]),_0x2ebb35[_0x2a08e2(0xb4)]({'sqlCode':_0x408300[_0x2a08e2(0xf0)],'remoteId':_0xb3bc47[_0x2a08e2(0xba)]});}catch(_0x3ff745){_0x5002e3[_0x2a08e2(0xb4)]({'sqlCode':_0x408300[_0x2a08e2(0xf0)],'error':_0x3ff745 instanceof Error?_0x3ff745[_0x2a08e2(0xce)]:String(_0x3ff745)});}}return _0x3c6c63[_0x2a08e2(0xb9)]=new Date()[_0x2a08e2(0xef)](),await writeSqlLockFile(_0x2d7ce3[_0x2a08e2(0xdc)],_0x28bf5c),{'ok':_0x5002e3['length']===0x0,'data':{'pushed':_0x2ebb35,'skipped':_0x3cfd78,'failed':_0x5002e3},'message':_0x2a08e2(0xc7)+_0x2ebb35[_0x2a08e2(0xb1)]+_0x2a08e2(0xb2)+_0x3cfd78[_0x2a08e2(0xb1)]+'\x20skipped,\x20'+_0x5002e3[_0x2a08e2(0xb1)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x2f5223,_0x3f8053,_0x4e298e){const _0x26253a=a129_0x1b9372;if(!_0x3f8053||_0x3f8053===_0x4e298e)return;const _0x59ecdd=join(_0x2f5223[_0x26253a(0xed)],_0x3f8053);if(!await fileExists(_0x59ecdd))return;const _0x28f618=await moveToTrash(_0x2f5223['projectRoot'],_0x2f5223[_0x26253a(0xbe)],_0x59ecdd);await cleanupEmptyDirectories(dirname(_0x59ecdd),_0x2f5223['sqlRootDir']),void _0x28f618;}async function moveToTrash(_0x2c31bc,_0x42f6f5,_0x39920c){const _0x3374d8=a129_0x1b9372,_0x42cd40=new Date()[_0x3374d8(0xef)]()[_0x3374d8(0xcb)](/[:.]/g,'-'),_0x3c5a90=relative(_0x2c31bc,_0x39920c),_0x2e8b27=join(_0x42f6f5,_0x42cd40,_0x3c5a90);return await mkdir(dirname(_0x2e8b27),{'recursive':!![]}),await rename(_0x39920c,_0x2e8b27),_0x2e8b27;}async function cleanupEmptyDirectories(_0x2325d7,_0x139e07){const _0x46e0b5=a129_0x1b9372;let _0x5be4a9=resolve(_0x2325d7);const _0x56f9d6=resolve(_0x139e07);while(_0x5be4a9[_0x46e0b5(0xcc)](''+_0x56f9d6+sep)||_0x5be4a9===_0x56f9d6){if(_0x5be4a9===_0x56f9d6)return;try{const _0x4605ea=await readdir(_0x5be4a9);if(_0x4605ea[_0x46e0b5(0xb1)]>0x0)return;await rmdir(_0x5be4a9);}catch{return;}_0x5be4a9=dirname(_0x5be4a9);}}async function resolveTargetDbBinding(_0x538d74,_0x1f0743,_0x1b23cf){const _0x3faa68=a129_0x1b9372,_0x1a370c=_0x1f0743[_0x3faa68(0xb0)];if(!_0x1a370c)return{'dbId':_0x1b23cf[_0x3faa68(0xb5)],'dbName':_0x1b23cf['dbName']};const _0x8c9118=buildDbDirectoryName(_0x1b23cf[_0x3faa68(0xcf)],_0x1b23cf[_0x3faa68(0xb5)]);if(_0x1a370c===_0x8c9118)return{'dbId':_0x1b23cf['dbId'],'dbName':_0x1b23cf[_0x3faa68(0xcf)]};const _0x49fcb8=parseExplicitDbDirectory(_0x1a370c);if(_0x49fcb8!=null)return{'dbId':_0x49fcb8,'dbName':await getDbName(_0x538d74,_0x49fcb8)[_0x3faa68(0xe2)](()=>undefined)};const _0x6e9626=await listDatabases(_0x538d74),_0x3258ee=_0x6e9626[_0x3faa68(0xe7)](_0x306263=>buildDbDirectoryName(_0x306263[_0x3faa68(0xcf)],_0x306263[_0x3faa68(0xb5)])===_0x1a370c);if(_0x3258ee['length']===0x1)return{'dbId':_0x3258ee[0x0][_0x3faa68(0xb5)],'dbName':_0x3258ee[0x0][_0x3faa68(0xcf)]};if(_0x3258ee[_0x3faa68(0xb1)]===0x0)throw CliErrors[_0x3faa68(0xd0)](_0x3faa68(0xd7)+_0x1a370c+_0x3faa68(0xc2)+_0x1f0743['sqlCode']+'.');const _0x549054=_0x3258ee[_0x3faa68(0xb7)](_0x9c7f51=>_0x9c7f51[_0x3faa68(0xcf)]+'\x20('+_0x9c7f51[_0x3faa68(0xb5)]+')')[_0x3faa68(0xd3)](',\x20');throw CliErrors['validation'](_0x3faa68(0xbf)+_0x1a370c+_0x3faa68(0xc0)+_0x1f0743['sqlCode']+':\x20'+_0x549054);}function parseExplicitDbDirectory(_0x43193b){const _0x28f3cf=a129_0x1b9372,_0x22eb57=/^db-(\d+)$/[_0x28f3cf(0xbb)](_0x43193b);if(!_0x22eb57)return null;const _0x583606=Number(_0x22eb57[0x1]);return Number[_0x28f3cf(0xe8)](_0x583606)&&_0x583606>0x0?_0x583606:null;}
|
|
1
|
+
const a129_0x23cd3e=a129_0x1a9e;(function(_0x591363,_0x10c512){const _0x26104f=a129_0x1a9e,_0x5a15cc=_0x591363();while(!![]){try{const _0x1ce908=-parseInt(_0x26104f(0x10f))/0x1+parseInt(_0x26104f(0xed))/0x2*(-parseInt(_0x26104f(0xfb))/0x3)+-parseInt(_0x26104f(0x115))/0x4*(parseInt(_0x26104f(0xe9))/0x5)+parseInt(_0x26104f(0xe3))/0x6+parseInt(_0x26104f(0xfa))/0x7*(parseInt(_0x26104f(0x107))/0x8)+-parseInt(_0x26104f(0xee))/0x9*(-parseInt(_0x26104f(0x112))/0xa)+parseInt(_0x26104f(0x10e))/0xb;if(_0x1ce908===_0x10c512)break;else _0x5a15cc['push'](_0x5a15cc['shift']());}catch(_0x3af2e6){_0x5a15cc['push'](_0x5a15cc['shift']());}}}(a129_0x4cec,0x9f4af));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 a129_0x4cec(){const _0x4b3c5b=['Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','high-risk-write','replace','\x20pushed,\x20','path','mode','validation','/smartapi/custom/updateUserCustomSql','has','exec','7532aONXxu','2072661ZAyTnI','lockFilePath','lastSync','isFinite','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','force','No\x20local\x20SQL\x20files\x20found.','filePath','version','Push\x20complete:\x20','utf8','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','104IiYUWT','hash','trashDir','sqlRootDir','remoteId','sqls','Local\x20directory\x20\x22','10991783fbgfvB','938958fDPusk','dbName','length','9370fALDNf','sqlCode','relativePath','28pawLje','Push\x20local\x20SQL\x20files\x20to\x20remote','map','sqlRoot','No\x20database\x20matches\x20local\x20directory\x20\x22','sqlcode','unchanged','bool','POST','startsWith','appCode','join','dbId','message','catch','\x20skipped,\x20','get','toISOString','537240MSaStE','Local\x20SQL\x20not\x20found:\x20','entries','\x20SQL\x20file(s)','push','str','71725LgnTOJ','filter','sqlName','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','2CUkKAl','12294BwkMnD','Would\x20push\x20'];a129_0x4cec=function(){return _0x4b3c5b;};return a129_0x4cec();}import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x757bb4,_0x24003d,_0x1112ff){const _0x5f5337=a129_0x1a9e,_0x41fc65=await scanLocalSqlQueries(_0x757bb4),_0x59ce97=new Map();for(const _0x165daf of _0x41fc65){if(_0x1112ff&&_0x165daf['sqlCode']!==_0x1112ff)continue;const _0x25ced3=_0x59ce97[_0x5f5337(0x125)](_0x165daf[_0x5f5337(0x113)])??[];_0x25ced3['push'](_0x165daf),_0x59ce97['set'](_0x165daf[_0x5f5337(0x113)],_0x25ced3);}if(_0x1112ff&&!_0x59ce97[_0x5f5337(0xf8)](_0x1112ff))throw CliErrors['validation'](_0x5f5337(0xe4)+_0x1112ff);const _0x33f7e5=[];for(const [_0x4d570c,_0x4f2018]of _0x59ce97[_0x5f5337(0xe5)]()){if(_0x4f2018['length']===0x1){_0x33f7e5[_0x5f5337(0xe7)](_0x4f2018[0x0]);continue;}const _0x4bdf67=_0x24003d[_0x5f5337(0x10c)][_0x4d570c],_0x40d3f4=_0x4bdf67?.[_0x5f5337(0xf4)],_0x53a257=_0x40d3f4?_0x4f2018[_0x5f5337(0xea)](_0x8336c8=>_0x8336c8[_0x5f5337(0x114)]!==_0x40d3f4):_0x4f2018;if(_0x4bdf67&&_0x53a257['length']===0x1){_0x33f7e5[_0x5f5337(0xe7)](_0x53a257[0x0]);continue;}throw CliErrors['validation'](_0x5f5337(0xf0)+_0x4d570c+_0x5f5337(0xff));}return _0x33f7e5;}export const sqlPush={'service':'sql','command':a129_0x23cd3e(0xe7),'description':a129_0x23cd3e(0x116),'risk':a129_0x23cd3e(0xf1),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':'boolean','description':a129_0x23cd3e(0xec)}],async 'dryRun'(_0x3f946f){const _0x14493f=a129_0x23cd3e,_0xe7c04e=loadSqlProjectConfig(_0x3f946f[_0x14493f(0x11f)]),_0x3132e2=await readSqlLockFile(_0xe7c04e[_0x14493f(0xfc)]),{appLock:_0x1f602d}=ensureSqlLockScope(_0x3132e2??createEmptySqlLock(),_0x3f946f[_0x14493f(0x11f)],_0xe7c04e[_0x14493f(0x118)],'push'),_0x44e7fb=await getTargetSqlQueries(_0xe7c04e,_0x1f602d,_0x3f946f[_0x14493f(0xe8)](_0x14493f(0x11a))||undefined),_0x3e297b=[];for(const _0x5abfd5 of _0x44e7fb){const _0x32c614=await computeSqlFileHash(_0x5abfd5[_0x14493f(0x102)]),_0x23a413=_0x1f602d[_0x14493f(0x10c)][_0x5abfd5['sqlCode']],_0x113cdf=!!_0x23a413&&(_0x23a413['path']!==_0x5abfd5['relativePath']||!!_0x5abfd5['sqlName']&&_0x23a413[_0x14493f(0xeb)]!==_0x5abfd5['sqlName']);if(!_0x3f946f['bool']('force')&&_0x23a413&&_0x23a413[_0x14493f(0x108)]===_0x32c614&&!_0x113cdf)continue;_0x3e297b['push'](_0x5abfd5[_0x14493f(0x113)]);}return{'method':_0x14493f(0x11d),'url':_0x14493f(0xf7),'body':{'sqlCodes':_0x3e297b,'appCode':_0x3f946f[_0x14493f(0x11f)]},'description':_0x14493f(0xef)+_0x3e297b[_0x14493f(0x111)]+_0x14493f(0xe6)};},async 'execute'(_0x2ba0e2){const _0x41e65c=a129_0x23cd3e,_0x354105=loadSqlProjectConfig(_0x2ba0e2[_0x41e65c(0x11f)]),_0xd55f19=await readSqlLockFile(_0x354105['lockFilePath']),{lockData:_0x5efeb8,appLock:_0x72beeb}=ensureSqlLockScope(_0xd55f19??createEmptySqlLock(),_0x2ba0e2[_0x41e65c(0x11f)],_0x354105[_0x41e65c(0x118)],'push'),_0x4d7397=await getTargetSqlQueries(_0x354105,_0x72beeb,_0x2ba0e2[_0x41e65c(0xe8)]('sqlcode')||undefined);if(_0x4d7397[_0x41e65c(0x111)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x41e65c(0x101)};const _0x45c1dc=[],_0xdabfcb=[],_0x52cd9c=[];for(const _0x695fda of _0x4d7397){const _0x4b2fb1=_0x72beeb[_0x41e65c(0x10c)][_0x695fda[_0x41e65c(0x113)]];if(!_0x4b2fb1){_0x52cd9c[_0x41e65c(0xe7)]({'sqlCode':_0x695fda['sqlCode'],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x4dbbb4=await computeSqlFileHash(_0x695fda['filePath']),_0x25d2d6=_0x4b2fb1['path']!==_0x695fda[_0x41e65c(0x114)]||!!_0x695fda[_0x41e65c(0xeb)]&&_0x4b2fb1[_0x41e65c(0xeb)]!==_0x695fda['sqlName'];if(!_0x2ba0e2[_0x41e65c(0x11c)](_0x41e65c(0x100))&&_0x4b2fb1[_0x41e65c(0x108)]===_0x4dbbb4&&!_0x25d2d6){_0xdabfcb['push']({'sqlCode':_0x695fda[_0x41e65c(0x113)],'reason':_0x41e65c(0x11b)});continue;}if(_0x4b2fb1[_0x41e65c(0x103)]==null){_0x52cd9c[_0x41e65c(0xe7)]({'sqlCode':_0x695fda[_0x41e65c(0x113)],'error':_0x41e65c(0x106)});continue;}const _0x4a4141=await readFile(_0x695fda[_0x41e65c(0x102)],_0x41e65c(0x105)),_0x35a1ed=stripLocalSqlMetadata(_0x4a4141,_0x695fda[_0x41e65c(0xf5)]),_0x8537ed=_0x695fda['sqlName']||_0x4b2fb1[_0x41e65c(0xeb)],_0x5b8d74=await resolveTargetDbBinding(_0x2ba0e2[_0x41e65c(0x11f)],_0x695fda,_0x4b2fb1),_0x5d8e7f=await updateSqlQuery({'id':_0x4b2fb1[_0x41e65c(0x10b)],'appCode':_0x2ba0e2['appCode'],'sqlCode':_0x695fda[_0x41e65c(0x113)],'sqlName':_0x8537ed,'dbId':_0x5b8d74[_0x41e65c(0x121)],'version':_0x4b2fb1[_0x41e65c(0x103)],'sqlContent':_0x35a1ed,'sqlConfig':_0x4b2fb1['sqlConfig']??undefined}),_0x1879f3=_0x5d8e7f[_0x41e65c(0x121)]?await getDbName(_0x2ba0e2[_0x41e65c(0x11f)],Number(_0x5d8e7f[_0x41e65c(0x121)]))[_0x41e65c(0x123)](()=>_0x5b8d74[_0x41e65c(0x110)]):_0x5b8d74[_0x41e65c(0x110)];_0x72beeb['sqls'][_0x695fda[_0x41e65c(0x113)]]={...buildSqlLockEntry(_0x5d8e7f,_0x35a1ed,_0x4dbbb4,{'dbName':_0x1879f3}),'path':_0x695fda[_0x41e65c(0x114)],'mode':_0x4b2fb1[_0x41e65c(0xf5)]},await archivePreviousSqlFileIfNeeded(_0x354105,_0x4b2fb1[_0x41e65c(0xf4)],_0x695fda[_0x41e65c(0x114)]),_0x45c1dc[_0x41e65c(0xe7)]({'sqlCode':_0x695fda['sqlCode'],'remoteId':_0x4b2fb1[_0x41e65c(0x10b)]});}catch(_0x283cca){_0x52cd9c[_0x41e65c(0xe7)]({'sqlCode':_0x695fda[_0x41e65c(0x113)],'error':_0x283cca instanceof Error?_0x283cca[_0x41e65c(0x122)]:String(_0x283cca)});}}return _0x72beeb[_0x41e65c(0xfd)]=new Date()[_0x41e65c(0xe2)](),await writeSqlLockFile(_0x354105['lockFilePath'],_0x5efeb8),{'ok':_0x52cd9c[_0x41e65c(0x111)]===0x0,'data':{'pushed':_0x45c1dc,'skipped':_0xdabfcb,'failed':_0x52cd9c},'message':_0x41e65c(0x104)+_0x45c1dc[_0x41e65c(0x111)]+_0x41e65c(0xf3)+_0xdabfcb[_0x41e65c(0x111)]+_0x41e65c(0x124)+_0x52cd9c['length']+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x364bb9,_0x121198,_0x534dbe){const _0x2ef8c1=a129_0x23cd3e;if(!_0x121198||_0x121198===_0x534dbe)return;const _0x2f84d8=join(_0x364bb9['sqlRootDir'],_0x121198);if(!await fileExists(_0x2f84d8))return;const _0x4d5d99=await moveToTrash(_0x364bb9['projectRoot'],_0x364bb9[_0x2ef8c1(0x109)],_0x2f84d8);await cleanupEmptyDirectories(dirname(_0x2f84d8),_0x364bb9[_0x2ef8c1(0x10a)]),void _0x4d5d99;}async function moveToTrash(_0x4d0fd1,_0x3739c1,_0x1b8dff){const _0x58aaaf=a129_0x23cd3e,_0x3e736a=new Date()['toISOString']()[_0x58aaaf(0xf2)](/[:.]/g,'-'),_0x49edd1=relative(_0x4d0fd1,_0x1b8dff),_0x436ca9=join(_0x3739c1,_0x3e736a,_0x49edd1);return await mkdir(dirname(_0x436ca9),{'recursive':!![]}),await rename(_0x1b8dff,_0x436ca9),_0x436ca9;}async function cleanupEmptyDirectories(_0x52876a,_0x56aa7d){const _0x63a750=a129_0x23cd3e;let _0x376f90=resolve(_0x52876a);const _0x22bddd=resolve(_0x56aa7d);while(_0x376f90[_0x63a750(0x11e)](''+_0x22bddd+sep)||_0x376f90===_0x22bddd){if(_0x376f90===_0x22bddd)return;try{const _0x2c9c6e=await readdir(_0x376f90);if(_0x2c9c6e[_0x63a750(0x111)]>0x0)return;await rmdir(_0x376f90);}catch{return;}_0x376f90=dirname(_0x376f90);}}function a129_0x1a9e(_0x2de54a,_0x254edb){_0x2de54a=_0x2de54a-0xe2;const _0x4cec73=a129_0x4cec();let _0x1a9e6b=_0x4cec73[_0x2de54a];return _0x1a9e6b;}async function resolveTargetDbBinding(_0x5bc1d5,_0x58d1f9,_0x230cdd){const _0x2a96da=a129_0x23cd3e,_0x3c8d00=_0x58d1f9['dbDirectory'];if(!_0x3c8d00)return{'dbId':_0x230cdd[_0x2a96da(0x121)],'dbName':_0x230cdd[_0x2a96da(0x110)]};const _0x246736=buildDbDirectoryName(_0x230cdd[_0x2a96da(0x110)],_0x230cdd['dbId']);if(_0x3c8d00===_0x246736)return{'dbId':_0x230cdd['dbId'],'dbName':_0x230cdd[_0x2a96da(0x110)]};const _0x290d48=parseExplicitDbDirectory(_0x3c8d00);if(_0x290d48!=null)return{'dbId':_0x290d48,'dbName':await getDbName(_0x5bc1d5,_0x290d48)[_0x2a96da(0x123)](()=>undefined)};const _0x15e2ec=await listDatabases(_0x5bc1d5),_0x3ceb7b=_0x15e2ec[_0x2a96da(0xea)](_0x3842ea=>buildDbDirectoryName(_0x3842ea[_0x2a96da(0x110)],_0x3842ea[_0x2a96da(0x121)])===_0x3c8d00);if(_0x3ceb7b[_0x2a96da(0x111)]===0x1)return{'dbId':_0x3ceb7b[0x0]['dbId'],'dbName':_0x3ceb7b[0x0][_0x2a96da(0x110)]};if(_0x3ceb7b[_0x2a96da(0x111)]===0x0)throw CliErrors[_0x2a96da(0xf6)](_0x2a96da(0x119)+_0x3c8d00+'\x22\x20for\x20sqlCode\x20'+_0x58d1f9[_0x2a96da(0x113)]+'.');const _0x24ceb1=_0x3ceb7b[_0x2a96da(0x117)](_0x42a856=>_0x42a856[_0x2a96da(0x110)]+'\x20('+_0x42a856['dbId']+')')[_0x2a96da(0x120)](',\x20');throw CliErrors['validation'](_0x2a96da(0x10d)+_0x3c8d00+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x58d1f9[_0x2a96da(0x113)]+':\x20'+_0x24ceb1);}function parseExplicitDbDirectory(_0x54a731){const _0x456eab=a129_0x23cd3e,_0x21429e=/^db-(\d+)$/[_0x456eab(0xf9)](_0x54a731);if(!_0x21429e)return null;const _0x7c954a=Number(_0x21429e[0x1]);return Number[_0x456eab(0xfe)](_0x7c954a)&&_0x7c954a>0x0?_0x7c954a:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a130_0x34d67a=a130_0x245a;function a130_0x245a(_0x4708e6,_0x217e4d){_0x4708e6=_0x4708e6-0xed;const _0x5ba73b=a130_0x5ba7();let _0x245af5=_0x5ba73b[_0x4708e6];return _0x245af5;}function a130_0x5ba7(){const _0x42c650=['sqlname','19514FNwguZ','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','110wqfBRN','62862vClktF','1829247wtEUsj','278800ZcQkTd','sql','save','description','81477PcFaGM','string','1332BJXvtD','329816THVsZB','40XAGUzs','2uwZPdb','Path\x20to\x20the\x20SQL\x20file','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','9xJcsDD','file','write','145400htXFUW','Query\x20description','join'];a130_0x5ba7=function(){return _0x42c650;};return a130_0x5ba7();}(function(_0x856b0a,_0x12ca54){const _0x592402=a130_0x245a,_0x2228c2=_0x856b0a();while(!![]){try{const _0x47e0e0=-parseInt(_0x592402(0xfd))/0x1*(-parseInt(_0x592402(0xf7))/0x2)+parseInt(_0x592402(0xfa))/0x3*(parseInt(_0x592402(0xf5))/0x4)+parseInt(_0x592402(0x103))/0x5*(parseInt(_0x592402(0x104))/0x6)+-parseInt(_0x592402(0xed))/0x7+parseInt(_0x592402(0xee))/0x8+-parseInt(_0x592402(0xf2))/0x9*(parseInt(_0x592402(0xf6))/0xa)+-parseInt(_0x592402(0x101))/0xb*(parseInt(_0x592402(0xf4))/0xc);if(_0x47e0e0===_0x12ca54)break;else _0x2228c2['push'](_0x2228c2['shift']());}catch(_0x5b7286){_0x2228c2['push'](_0x2228c2['shift']());}}}(a130_0x5ba7,0x27f4b));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a130_0x34d67a(0xf9),'Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','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`.'][a130_0x34d67a(0xff)]('\x0a');export const sqlSave={'service':a130_0x34d67a(0xef),'command':a130_0x34d67a(0xf0),'description':a130_0x34d67a(0x102),'risk':a130_0x34d67a(0xfc),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a130_0x34d67a(0xfb),'type':a130_0x34d67a(0xf3),'required':!![],'description':a130_0x34d67a(0xf8)},SQLCODE_FLAG_OPTIONAL,{'name':a130_0x34d67a(0x100),'type':'string','description':'SQL\x20query\x20display\x20name'},{'name':'db','type':a130_0x34d67a(0xf3),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':a130_0x34d67a(0xf1),'type':a130_0x34d67a(0xf3),'description':a130_0x34d67a(0xfe)}],async 'validate'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1b187b,_0x298c99){const _0x27e63b=a131_0x1c7a,_0x4ecec7=_0x1b187b();while(!![]){try{const _0x259235=parseInt(_0x27e63b(0xc2))/0x1*(-parseInt(_0x27e63b(0xd5))/0x2)+parseInt(_0x27e63b(0xe6))/0x3+parseInt(_0x27e63b(0xd1))/0x4+-parseInt(_0x27e63b(0xc5))/0x5+parseInt(_0x27e63b(0xd0))/0x6*(parseInt(_0x27e63b(0xd8))/0x7)+-parseInt(_0x27e63b(0xc7))/0x8*(-parseInt(_0x27e63b(0xcf))/0x9)+-parseInt(_0x27e63b(0xd2))/0xa*(parseInt(_0x27e63b(0xc6))/0xb);if(_0x259235===_0x298c99)break;else _0x4ecec7['push'](_0x4ecec7['shift']());}catch(_0x329378){_0x4ecec7['push'](_0x4ecec7['shift']());}}}(a131_0x4a2d,0x99a47));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x29e6a6,_0x13be11,_0x3bde9f,_0x3a1381){const _0x16a385=a131_0x1c7a,_0x459090=detectSqlMode(_0x13be11);return{'path':buildSqlRelativePath(_0x29e6a6[_0x16a385(0xe2)],_0x29e6a6[_0x16a385(0xd7)],_0x3a1381?.[_0x16a385(0xdd)],_0x459090,_0x29e6a6[_0x16a385(0xc1)]),'hash':_0x3bde9f,'remoteId':_0x29e6a6['id'],'version':_0x29e6a6['version'],'dbId':Number(_0x29e6a6[_0x16a385(0xc1)]),'dbName':_0x3a1381?.[_0x16a385(0xdd)],'sqlName':_0x29e6a6[_0x16a385(0xd7)],'sqlConfig':_0x29e6a6['sqlConfig']??undefined,'mode':_0x459090};}export function cloneSqlLockData(_0x12ec06){const _0x3f0b30=a131_0x1c7a;return{'apps':Object[_0x3f0b30(0xc8)](Object[_0x3f0b30(0xc4)](_0x12ec06['apps'])[_0x3f0b30(0xe3)](([_0x382a3d,_0x503396])=>[_0x382a3d,{'sqlRoot':_0x503396['sqlRoot'],'lastSync':_0x503396['lastSync'],'sqls':{..._0x503396[_0x3f0b30(0xcb)]}}]))};}function a131_0x4a2d(){const _0x73a65c=['length','toLowerCase','description','dbId','1TrtBAZ','replace','entries','4197945vioxPV','27379BLAfeK','173544GHgnky','fromEntries','syncedAt','join','sqls','mybatisXml','sqlContent','path','441hQThvo','12fHpkmc','500540vmvPwH','2140ecaDXl','test','includes','1661366CkuUdz','question','sqlName','3974817WImyfn','\x20-->','stdin','endsWith','--\x20@lovrabet.','dbName','close','split','push','mode','sqlCode','map','trimStart','<!--\x20@lovrabet.','1525449MmizOJ','apps','yes','trim'];a131_0x4a2d=function(){return _0x73a65c;};return a131_0x4a2d();}export function ensureRemoteSqlContent(_0x584fb1){const _0x2bb510=a131_0x1c7a;return _0x584fb1[_0x2bb510(0xcd)]??'';}export function buildLocalSqlFileContent(_0x53877c,_0x10caf4,_0x10bed8){const _0x1148b9=a131_0x1c7a,_0x32958a=_0x10bed8?.[_0x1148b9(0xe1)]??detectSqlMode(_0x10caf4),_0x3cc025=stripLocalSqlMetadata(_0x10caf4,_0x32958a)['trim'](),_0x2adcac=[...buildMetadataHeaderLines({'sqlCode':_0x53877c[_0x1148b9(0xe2)],'sqlName':_0x53877c['sqlName'],'dbId':_0x53877c[_0x1148b9(0xc1)],'dbName':_0x10bed8?.[_0x1148b9(0xdd)],'mode':_0x32958a,'syncedAt':_0x10bed8?.['syncedAt'],'description':_0x10bed8?.[_0x1148b9(0xc0)]},_0x32958a),'',_0x3cc025],_0x390966=_0x2adcac[_0x1148b9(0xca)]('\x0a');return _0x390966[_0x1148b9(0xdb)]('\x0a')?_0x390966:_0x390966+'\x0a';}function a131_0x1c7a(_0x29691b,_0x30b837){_0x29691b=_0x29691b-0xbd;const _0x4a2dc3=a131_0x4a2d();let _0x1c7aae=_0x4a2dc3[_0x29691b];return _0x1c7aae;}export function stripLocalSqlMetadata(_0xdb236b,_0x5360da){const _0x113534=a131_0x1c7a,_0x5b13ff=_0xdb236b[_0x113534(0xc3)](/\r\n/g,'\x0a')[_0x113534(0xdf)]('\x0a'),_0x1b96e0=[];let _0x58d243=0x0;if(_0x5360da===_0x113534(0xcc))while(_0x58d243<_0x5b13ff[_0x113534(0xbe)]){const _0x33664d=_0x5b13ff[_0x58d243]??'';if(/^\s*<!--\s*@lovrabet\./[_0x113534(0xd3)](_0x33664d)){_0x58d243++;continue;}if(_0x33664d[_0x113534(0xbd)]()===''&&_0x58d243>0x0){_0x58d243++;continue;}break;}else while(_0x58d243<_0x5b13ff[_0x113534(0xbe)]){const _0x1f632d=_0x5b13ff[_0x58d243]??'';if(/^\s*--\s*@lovrabet\./[_0x113534(0xd3)](_0x1f632d)){_0x58d243++;continue;}if(_0x1f632d[_0x113534(0xbd)]()===''&&_0x58d243>0x0){_0x58d243++;continue;}break;}for(;_0x58d243<_0x5b13ff[_0x113534(0xbe)];_0x58d243++){_0x1b96e0[_0x113534(0xe0)](_0x5b13ff[_0x58d243]);}return _0x1b96e0[_0x113534(0xca)]('\x0a')[_0x113534(0xe4)]();}export function resolveSqlMode(_0x2dc4ab,_0xdcde8c){const _0x2d2c8b=a131_0x1c7a;if(_0xdcde8c?.['mode'])return _0xdcde8c[_0x2d2c8b(0xe1)];return detectSqlMode(_0x2dc4ab);}export function resolveSqlFileName(_0x255ec6,_0x16c9ad,_0x45b077){const _0x1cad3c=a131_0x1c7a;if(_0x45b077?.[_0x1cad3c(0xce)])return _0x45b077[_0x1cad3c(0xce)];if(_0x45b077?.[_0x1cad3c(0xd7)]||_0x45b077?.[_0x1cad3c(0xdd)])return buildSqlRelativePath(_0x255ec6,_0x45b077?.[_0x1cad3c(0xd7)],_0x45b077?.[_0x1cad3c(0xdd)],resolveSqlMode(_0x16c9ad,_0x45b077),_0x45b077?.[_0x1cad3c(0xc1)]);return buildDefaultSqlFileName(_0x255ec6,resolveSqlMode(_0x16c9ad,_0x45b077));}export function resolveSqlLocalDir(_0x141378,_0x385616){return join(_0x141378,SQL_LOCAL_REL_DIR,_0x385616);}export async function confirmForceOverwrite(_0x2d9f8e){const _0x39e27f=a131_0x1c7a,_0x1008a2=createInterface({'input':process[_0x39e27f(0xda)],'output':process['stderr']}),_0x5adfc8=await new Promise(_0xe5b01b=>{const _0x2bd925=_0x39e27f;_0x1008a2[_0x2bd925(0xd6)](_0x2d9f8e+'\x20[y/N]\x20',_0xe5b01b);});return _0x1008a2[_0x39e27f(0xde)](),['y',_0x39e27f(0xe8)][_0x39e27f(0xd4)](_0x5adfc8[_0x39e27f(0xbd)]()[_0x39e27f(0xbf)]());}export function findSqlLockScope(_0x5d583f,_0x5231cf){const _0x2a1313=a131_0x1c7a;return _0x5d583f[_0x2a1313(0xe7)][_0x5231cf];}function buildMetadataHeaderLines(_0x12395c,_0x14ac1d){const _0x222ef8=a131_0x1c7a,_0xe9b618=[[_0x222ef8(0xe2),_0x12395c['sqlCode']],[_0x222ef8(0xd7),_0x12395c[_0x222ef8(0xd7)]],[_0x222ef8(0xc1),_0x12395c[_0x222ef8(0xc1)]],['dbName',_0x12395c[_0x222ef8(0xdd)]],['mode',_0x12395c[_0x222ef8(0xe1)]],[_0x222ef8(0xc9),_0x12395c['syncedAt']],[_0x222ef8(0xc0),_0x12395c[_0x222ef8(0xc0)]]];if(_0x14ac1d==='mybatisXml')return _0xe9b618['filter'](([,_0x4f224f])=>_0x4f224f!==undefined&&_0x4f224f!==null&&String(_0x4f224f)[_0x222ef8(0xbd)]()!=='')[_0x222ef8(0xe3)](([_0xa7a814,_0x24daa4])=>_0x222ef8(0xe5)+_0xa7a814+':\x20'+String(_0x24daa4)+_0x222ef8(0xd9));return _0xe9b618['filter'](([,_0x20d4fb])=>_0x20d4fb!==undefined&&_0x20d4fb!==null&&String(_0x20d4fb)[_0x222ef8(0xbd)]()!=='')[_0x222ef8(0xe3)](([_0x1fef32,_0x43027f])=>_0x222ef8(0xdc)+_0x1fef32+':\x20'+String(_0x43027f));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0xb72b66=a132_0x3e78;function a132_0x3e78(_0x30b7d6,_0x3b232d){_0x30b7d6=_0x30b7d6-0x84;const _0xc73e14=a132_0xc73e();let _0x3e781f=_0xc73e14[_0x30b7d6];return _0x3e781f;}(function(_0x5c46bf,_0x32e786){const _0x45f0cc=a132_0x3e78,_0x3e5c5f=_0x5c46bf();while(!![]){try{const _0x2d7a3f=-parseInt(_0x45f0cc(0x90))/0x1*(parseInt(_0x45f0cc(0xa6))/0x2)+-parseInt(_0x45f0cc(0x8b))/0x3*(parseInt(_0x45f0cc(0x92))/0x4)+parseInt(_0x45f0cc(0x9b))/0x5*(parseInt(_0x45f0cc(0xa8))/0x6)+-parseInt(_0x45f0cc(0xa7))/0x7*(parseInt(_0x45f0cc(0x86))/0x8)+parseInt(_0x45f0cc(0xa2))/0x9*(parseInt(_0x45f0cc(0x87))/0xa)+parseInt(_0x45f0cc(0x97))/0xb+parseInt(_0x45f0cc(0x8f))/0xc;if(_0x2d7a3f===_0x32e786)break;else _0x3e5c5f['push'](_0x3e5c5f['shift']());}catch(_0x4cbdc1){_0x3e5c5f['push'](_0x3e5c5f['shift']());}}}(a132_0xc73e,0xd8f37));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a132_0xc73e(){const _0x78f8cf=['\x20modified,\x20','179184gneqAJ','boolean','relativePath','read','\x20remote-only','334378fjiMsO','lockKey','push','bool','1123175wnWKHz','sql','filePath','sqlName','\x20unchanged','All\x20SQL\x20queries\x20are\x20in\x20sync.','status','10364391hUWixV','keys','path','\x20missing,\x20','1625342XOPSgS','21jQzOpE','6IqThPD','remote','has','681288QBvuDL','10hMNMyo','appCode','paging','length','33pqPeyS','lockFilePath','map','sqls','12514908sZDmhf','1Bpwahf'];a132_0xc73e=function(){return _0x78f8cf;};return a132_0xc73e();}async function fetchAllSqlCodes(_0x44a615){const _0x41ccf5=a132_0x3e78,_0x47c22e=[];let _0x42feca=0x1;while(!![]){const _0x419df8=await listSqlQueries(_0x44a615,{'currentPage':_0x42feca,'pageSize':PAGE_SIZE}),_0x604647=_0x419df8['tableData']??[];_0x47c22e[_0x41ccf5(0x99)](..._0x604647[_0x41ccf5(0x8d)](_0x414768=>_0x414768['sqlCode']));if(_0x604647[_0x41ccf5(0x8a)]===0x0)break;const _0x820aca=_0x419df8[_0x41ccf5(0x89)]?.['totalCount'];if(_0x820aca!=null?_0x47c22e[_0x41ccf5(0x8a)]>=_0x820aca:_0x604647['length']<PAGE_SIZE)break;_0x42feca++;}return _0x47c22e;}export const sqlStatus={'service':a132_0xb72b66(0x9c),'command':'status','description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a132_0xb72b66(0x95),'flags':[{'name':a132_0xb72b66(0x84),'type':a132_0xb72b66(0x93),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x315865){const _0x575f11=a132_0xb72b66,_0x328c89=loadSqlProjectConfig(_0x315865[_0x575f11(0x88)]),_0x4dad1b=await readSqlLockFile(_0x328c89[_0x575f11(0x8c)]),{appLock:_0x4fd9e0}=ensureSqlLockScope(_0x4dad1b??createEmptySqlLock(),_0x328c89[_0x575f11(0x88)],_0x328c89['sqlRoot'],_0x575f11(0xa1)),_0x2ed468=await scanLocalSqlQueries(_0x328c89),_0x55eb95=[],_0x295990=[],_0x5946d0=[],_0x3b7229=[],_0x37bb17=new Set(_0x2ed468[_0x575f11(0x8d)](_0x38383e=>_0x38383e[_0x575f11(0x98)]));for(const _0x382d89 of _0x2ed468){const _0x5b1f67=await computeSqlFileHash(_0x382d89[_0x575f11(0x9d)]),_0x43287e=_0x4fd9e0[_0x575f11(0x8e)][_0x382d89['lockKey']],_0x2ea615=!!_0x43287e&&_0x43287e[_0x575f11(0xa4)]!==_0x382d89[_0x575f11(0x94)],_0x207cc4=!!_0x43287e&&!!_0x382d89[_0x575f11(0x9e)]&&_0x43287e[_0x575f11(0x9e)]!==_0x382d89[_0x575f11(0x9e)];if(!_0x43287e)_0x55eb95[_0x575f11(0x99)](_0x382d89[_0x575f11(0x98)]);else _0x43287e['hash']!==_0x5b1f67||_0x2ea615||_0x207cc4?_0x295990[_0x575f11(0x99)](_0x382d89[_0x575f11(0x98)]):_0x5946d0[_0x575f11(0x99)](_0x382d89[_0x575f11(0x98)]);}for(const _0x1977c9 of Object[_0x575f11(0xa3)](_0x4fd9e0[_0x575f11(0x8e)])){!_0x37bb17['has'](_0x1977c9)&&_0x3b7229['push'](_0x1977c9);}const _0xde86d5=[];if(_0x315865[_0x575f11(0x9a)](_0x575f11(0x84))){const _0x5922a0=await fetchAllSqlCodes(_0x315865[_0x575f11(0x88)]);for(const _0x5a5013 of _0x5922a0){!_0x37bb17[_0x575f11(0x85)](_0x5a5013)&&!_0x4fd9e0[_0x575f11(0x8e)][_0x5a5013]&&_0xde86d5[_0x575f11(0x99)](_0x5a5013);}}const _0x38d701=_0x55eb95['length']===0x0&&_0x295990[_0x575f11(0x8a)]===0x0&&_0x3b7229[_0x575f11(0x8a)]===0x0&&_0xde86d5[_0x575f11(0x8a)]===0x0;return{'ok':!![],'data':{'added':_0x55eb95,'modified':_0x295990,'missing':_0x3b7229,'unchanged':_0x5946d0,'remoteOnly':_0xde86d5},'message':_0x38d701?_0x575f11(0xa0):_0x55eb95[_0x575f11(0x8a)]+'\x20added,\x20'+_0x295990[_0x575f11(0x8a)]+_0x575f11(0x91)+_0x3b7229[_0x575f11(0x8a)]+_0x575f11(0xa5)+_0x5946d0[_0x575f11(0x8a)]+_0x575f11(0x9f)+(_0xde86d5[_0x575f11(0x8a)]>0x0?',\x20'+_0xde86d5[_0x575f11(0x8a)]+_0x575f11(0x96):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a133_0xe249e3=a133_0x117b;(function(_0x198c07,_0x2ab8a4){const _0x16174a=a133_0x117b,_0x22a216=_0x198c07();while(!![]){try{const _0x5b706c=-parseInt(_0x16174a(0xa3))/0x1*(parseInt(_0x16174a(0x8f))/0x2)+-parseInt(_0x16174a(0xb4))/0x3+-parseInt(_0x16174a(0x9f))/0x4*(-parseInt(_0x16174a(0x8e))/0x5)+parseInt(_0x16174a(0x93))/0x6+-parseInt(_0x16174a(0xbf))/0x7+parseInt(_0x16174a(0x9e))/0x8*(parseInt(_0x16174a(0xac))/0x9)+-parseInt(_0x16174a(0xa7))/0xa*(-parseInt(_0x16174a(0xb5))/0xb);if(_0x5b706c===_0x2ab8a4)break;else _0x22a216['push'](_0x22a216['shift']());}catch(_0x3d40ee){_0x22a216['push'](_0x22a216['shift']());}}}(a133_0x2797,0x7eab2));function a133_0x2797(){const _0x50317c=['Provide\x20--file\x20or\x20--sql','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','10WDhFwv','flagMissing','Table\x20\x22','Dataset\x20\x22','name','9JTqLRe','isDangerous','schemaWarnings','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','schemas','appCode','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','map','556245rwboaj','1794353Pfuxlr','File\x20not\x20found:\x20','valid','push','string','isSelectOnly','SQL\x20schema\x20validation','from','file','message','4458020iAUxHS','reason','5LCdzbk','2fMHYfY','size','isArray','str','1946154evCAXC','fields','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','type','tables','trim','split','toLowerCase','validate','tableName','length','3020128MhiFNn','3313512mmiPWh','sqlType','sql','\x22\x20not\x20found\x20or\x20not\x20accessible','352267llWcPh','filter'];a133_0x2797=function(){return _0x50317c;};return a133_0x2797();}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';function a133_0x117b(_0x324909,_0x23004f){_0x324909=_0x324909-0x8d;const _0x27971c=a133_0x2797();let _0x117bf1=_0x27971c[_0x324909];return _0x117bf1;}import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':'sql','command':a133_0xe249e3(0x9b),'description':a133_0xe249e3(0xb2),'risk':'read','flags':[{'name':a133_0xe249e3(0xbd),'type':'string','description':a133_0xe249e3(0x95)},{'name':a133_0xe249e3(0xa1),'type':a133_0xe249e3(0xb9),'description':a133_0xe249e3(0xaf)},{'name':a133_0xe249e3(0xb0),'type':a133_0xe249e3(0xb9),'description':a133_0xe249e3(0xa6)}],async 'execute'(_0x25f042){const _0x250062=a133_0xe249e3,_0x44007b=_0x25f042['str']('file'),_0x1fd3e2=_0x25f042[_0x250062(0x92)](_0x250062(0xa1));if(!_0x44007b&&!_0x1fd3e2)throw CliErrors[_0x250062(0xa8)]('file',_0x250062(0xa5));let _0x1adf33;if(_0x44007b){const _0x5e7808=resolve(process['cwd'](),_0x44007b);if(!existsSync(_0x5e7808))throw CliErrors['validation'](_0x250062(0xb6)+_0x5e7808);_0x1adf33=readFileSync(_0x5e7808,'utf-8');}else _0x1adf33=_0x1fd3e2;const _0x232448=validateSql(_0x1adf33),_0x5be6f8={'valid':_0x232448['valid'],'sqlType':_0x232448[_0x250062(0xa0)][_0x250062(0x96)],'isSelectOnly':_0x232448[_0x250062(0xa0)][_0x250062(0xba)],'isDangerous':_0x232448[_0x250062(0xa0)][_0x250062(0xad)],'tables':_0x232448[_0x250062(0x97)],'parameters':_0x232448['parameters'],'message':_0x232448['message']};_0x232448[_0x250062(0xa0)][_0x250062(0x8d)]&&(_0x5be6f8[_0x250062(0x8d)]=_0x232448[_0x250062(0xa0)][_0x250062(0x8d)]);const _0xbca67c=_0x25f042[_0x250062(0x92)]('schemas');if(_0xbca67c&&_0x232448['valid']){const _0x125ced=_0xbca67c[_0x250062(0x99)](',')['map'](_0x4e965=>_0x4e965[_0x250062(0x98)]())[_0x250062(0xa4)](Boolean),_0x56a5ae=[],_0x30a897=filterDbTableBackedDatasets(await listDatasets(_0x25f042[_0x250062(0xb1)])),_0x141ec2=new Map(_0x30a897['map'](_0x570964=>[_0x570964['dbtableConfig']?.[_0x250062(0x9c)]?.[_0x250062(0x9a)](),_0x570964]));for(const _0x294b9a of _0x232448[_0x250062(0x97)]){const _0xc77022=_0x141ec2['get'](_0x294b9a[_0x250062(0x9a)]());!_0xc77022&&_0x56a5ae[_0x250062(0xb8)](_0x250062(0xa9)+_0x294b9a+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x1aa9ca of _0x125ced){let _0x45328b;try{_0x45328b=await getDatasetDetail(_0x1aa9ca);}catch{_0x56a5ae[_0x250062(0xb8)](_0x250062(0xaa)+_0x1aa9ca+_0x250062(0xa2));continue;}assertDatasetIsDbTableBacked(_0x45328b,_0x250062(0xbb));const _0x4e12fd=Array[_0x250062(0x91)](_0x45328b[_0x250062(0x94)])?_0x45328b[_0x250062(0x94)]:[],_0x245f48=new Set(_0x4e12fd[_0x250062(0xb3)](_0x235769=>_0x235769[_0x250062(0xab)]?.[_0x250062(0x9a)]())),_0x3069d3=_0x45328b['dbtableConfig']?.[_0x250062(0x9c)]||_0x45328b[_0x250062(0x9c)]||_0x1aa9ca;_0x5be6f8['schema:'+_0x3069d3]={'code':_0x1aa9ca,'tableName':_0x3069d3,'fieldCount':_0x245f48[_0x250062(0x90)],'fields':Array[_0x250062(0xbc)](_0x245f48)};}_0x56a5ae[_0x250062(0x9d)]>0x0&&(_0x5be6f8[_0x250062(0xae)]=_0x56a5ae);}return{'ok':_0x232448[_0x250062(0xb7)],'data':_0x5be6f8,'message':_0x232448[_0x250062(0xbe)]};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x509157=a134_0x2c8a;(function(_0x21c82b,_0xd84c98){const _0x384127=a134_0x2c8a,_0x484dc8=_0x21c82b();while(!![]){try{const _0xed980f=-parseInt(_0x384127(0xa9))/0x1+parseInt(_0x384127(0xa6))/0x2*(-parseInt(_0x384127(0xb0))/0x3)+parseInt(_0x384127(0x9e))/0x4+-parseInt(_0x384127(0xaa))/0x5*(parseInt(_0x384127(0xc0))/0x6)+parseInt(_0x384127(0x9d))/0x7*(-parseInt(_0x384127(0xb9))/0x8)+-parseInt(_0x384127(0xae))/0x9+parseInt(_0x384127(0xa1))/0xa*(parseInt(_0x384127(0x9c))/0xb);if(_0xed980f===_0xd84c98)break;else _0x484dc8['push'](_0x484dc8['shift']());}catch(_0x4ab2ee){_0x484dc8['push'](_0x484dc8['shift']());}}}(a134_0xd9fe,0xf03ee));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';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a134_0x509157(0xb7),a134_0x509157(0xa4),a134_0x509157(0xb4),'format','riskLevel'];export const TOP_LEVEL_CONFIG_KEYS=new Set([a134_0x509157(0x9b),a134_0x509157(0xbc),a134_0x509157(0xb4),a134_0x509157(0xb8),a134_0x509157(0xb7),a134_0x509157(0xa4),a134_0x509157(0xac)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};function a134_0xd9fe(){const _0x503441=['filter','appcode','108834TrsohH','900858EuHKep','6832200zJEoRC','map','defaultFormat','3750zFnTRW','API\x20directory\x20path','riskLevel','accessKey','apps','1911232gLPJwv','Default\x20page\x20size','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','950552kcYyBb','37585qEyKRk','en-US','apiDir','app','10423638heyWKO','Auth\x20cookie','3RJwBme','inherit','number','entries','locale','length','zh-CN','cookie','format','16BkNyag','join','pageSize','env','defaultApp','Locale','string','888JSzVNI','Access\x20key','toLowerCase'];a134_0xd9fe=function(){return _0x503441;};return a134_0xd9fe();}export function formatConfigKeyList(_0x19737b){const _0x50666f=a134_0x509157;return[..._0x19737b][_0x50666f(0xba)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}function a134_0x2c8a(_0x203dd2,_0x1526e8){_0x203dd2=_0x203dd2-0x9b;const _0xd9fe1f=a134_0xd9fe();let _0x2c8a40=_0xd9fe1f[_0x203dd2];return _0x2c8a40;}export function isTopLevelConfigKey(_0x5511cd){return TOP_LEVEL_CONFIG_KEYS['has'](_0x5511cd);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a134_0x509157(0xbc),'apiDir':a134_0x509157(0xac),'cookie':'cookie','accessKey':a134_0x509157(0xa4),'defaultFormat':a134_0x509157(0xb8),'pageSize':'pageSize','riskLevel':a134_0x509157(0xa3),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x14d6ab=a134_0x509157;return[{'name':_0x14d6ab(0xbc),'type':_0x14d6ab(0xbf),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0x14d6ab(0xac),'type':_0x14d6ab(0xbf),'description':_0x14d6ab(0xa2)},{'name':_0x14d6ab(0xb7),'type':_0x14d6ab(0xbf),'description':_0x14d6ab(0xaf),'hidden':!![]},{'name':_0x14d6ab(0xa4),'type':_0x14d6ab(0xbf),'description':_0x14d6ab(0xc1),'hidden':!![]},{'name':_0x14d6ab(0xa0),'type':'string','description':_0x14d6ab(0xa8),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x14d6ab(0xbb),'type':_0x14d6ab(0xb2),'description':_0x14d6ab(0xa7)},{'name':'riskLevel','type':_0x14d6ab(0xbf),'description':'Risk\x20level','enum':[...RISK_LEVEL_VALUES]},{'name':_0x14d6ab(0xb4),'type':'string','description':_0x14d6ab(0xbe)}];}export function collectAppProfileOverrides(_0x873491){const _0xc73ca7=a134_0x509157,_0x3448ff={};for(const [_0x264619,_0xbf260c]of Object[_0xc73ca7(0xb3)](APP_PROFILE_FLAG_KEY_MAP)){const _0xb0f431=_0x873491(_0x264619);if(!_0xb0f431)continue;_0x3448ff[_0xbf260c]=_0xbf260c==='pageSize'?Number(_0xb0f431):_0xb0f431;}return _0x3448ff;}export function buildAppProfileListFields(_0x221201){const _0x4183b7=a134_0x509157;return{'env':_0x221201['env']??null,'apiDir':_0x221201[_0x4183b7(0xac)]??null,'hasCookie':!!_0x221201[_0x4183b7(0xb7)],'hasAccessKey':!!_0x221201['accessKey'],'format':_0x221201[_0x4183b7(0xb8)]??null,'pageSize':_0x221201[_0x4183b7(0xbb)]??null,'riskLevel':_0x221201[_0x4183b7(0xa3)]??null,'locale':_0x221201[_0x4183b7(0xb4)]??null};}export function buildAppDoctorFields(_0x1636c9,_0x2f73a6){const _0x3caf24=a134_0x509157;return{'env':{'value':_0x1636c9[_0x3caf24(0xbc)]||_0x2f73a6['env'],'source':_0x1636c9[_0x3caf24(0xbc)]?_0x3caf24(0xad):_0x3caf24(0xb1)},'apiDir':{'value':_0x1636c9[_0x3caf24(0xac)]||_0x2f73a6[_0x3caf24(0xac)],'source':_0x1636c9[_0x3caf24(0xac)]?_0x3caf24(0xad):'inherit'},'cookie':{'value':_0x1636c9[_0x3caf24(0xb7)]||_0x2f73a6[_0x3caf24(0xb7)],'source':_0x1636c9[_0x3caf24(0xb7)]?_0x3caf24(0xad):_0x3caf24(0xb1)},'accessKey':{'value':_0x1636c9[_0x3caf24(0xa4)]||_0x2f73a6[_0x3caf24(0xa4)],'source':_0x1636c9[_0x3caf24(0xa4)]?_0x3caf24(0xad):_0x3caf24(0xb1)}};}export function buildCanonicalAppConfig(_0x8ddb78,_0x150961){const _0x2c2c46=a134_0x509157,_0x3d33c2=_0x8ddb78[_0x2c2c46(0x9f)](_0x168235=>String(_0x168235||'')['trim']())[_0x2c2c46(0xc3)](Boolean);if(_0x3d33c2[_0x2c2c46(0xb5)]===0x0)return{};const _0x2dc5ce={};for(const _0x9c376b of _0x3d33c2){_0x2dc5ce[_0x9c376b]=_0x150961?{'appcode':_0x9c376b,'env':_0x150961}:{'appcode':_0x9c376b};}return{'apps':_0x2dc5ce,'defaultApp':_0x3d33c2[0x0]};}export function buildCanonicalProjectConfig(_0xbca122,_0x499b0a){const _0x1ea15a=a134_0x509157,{appCodes:appCodes=[],env:_0x5e9e60,metadata:_0x5ee503}=_0x499b0a,_0x44a480={..._0xbca122,..._0x5ee503||{}};delete _0x44a480[_0x1ea15a(0x9b)],delete _0x44a480[_0x1ea15a(0xad)];if(_0x5e9e60)_0x44a480[_0x1ea15a(0xbc)]=_0x5e9e60;else!_0x44a480[_0x1ea15a(0xbc)]&&(_0x44a480['env']=DEFAULT_CONFIG_VALUES[_0x1ea15a(0xbc)]);const _0xd3d09b=buildCanonicalAppConfig(appCodes,_0x44a480[_0x1ea15a(0xbc)]);return Object['keys'](_0xd3d09b)['length']>0x0&&(_0x44a480[_0x1ea15a(0xa5)]=_0xd3d09b[_0x1ea15a(0xa5)],_0x44a480[_0x1ea15a(0xbd)]=_0xd3d09b['defaultApp']),_0x44a480;}const LOCALE_MAP={'zh':a134_0x509157(0xb6),'zh-cn':a134_0x509157(0xb6),'zh_cn':'zh-CN','en':'en-US','en-us':a134_0x509157(0xab),'en_us':'en-US'};export function normalizeLocale(_0x31e9ec){const _0x3f45c1=a134_0x509157;if(!_0x31e9ec)return null;return LOCALE_MAP[_0x31e9ec[_0x3f45c1(0xc2)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a135_0xf599(){const _0x3d508d=['5072agtzlw','2279347aKXamv','3751509ZBODkG','1677696QErpaJ','1324976rwkukM','2151NJgvVa','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','1xGCXVy','2899430ZjsGHP','3307030HcRxJY'];a135_0xf599=function(){return _0x3d508d;};return a135_0xf599();}const a135_0x517ab4=a135_0x4c86;function a135_0x4c86(_0x5c24a4,_0x4b2791){_0x5c24a4=_0x5c24a4-0x1af;const _0xf59989=a135_0xf599();let _0x4c8645=_0xf59989[_0x5c24a4];return _0x4c8645;}(function(_0x1e9ce3,_0x2f65e1){const _0x3d0c3e=a135_0x4c86,_0x370822=_0x1e9ce3();while(!![]){try{const _0x7a4caf=-parseInt(_0x3d0c3e(0x1b3))/0x1*(parseInt(_0x3d0c3e(0x1b5))/0x2)+parseInt(_0x3d0c3e(0x1b8))/0x3+parseInt(_0x3d0c3e(0x1b0))/0x4+parseInt(_0x3d0c3e(0x1b4))/0x5+parseInt(_0x3d0c3e(0x1af))/0x6+parseInt(_0x3d0c3e(0x1b7))/0x7+parseInt(_0x3d0c3e(0x1b6))/0x8*(-parseInt(_0x3d0c3e(0x1b1))/0x9);if(_0x7a4caf===_0x2f65e1)break;else _0x370822['push'](_0x370822['shift']());}catch(_0x3b6e85){_0x370822['push'](_0x370822['shift']());}}}(a135_0xf599,0xead25));export const CLI_VERSION_POLICY_URL=a135_0x517ab4(0x1b2);
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a136_0x36910e=a136_0x1072;function a136_0x53e6(){const _0x2ceef5=['json\x20|\x20pretty\x20|\x20compress','Confirm\x20destructive\x20action','Use\x20project\x20config\x20scope','non-interactive','dryRun','params','Environment','file','Output\x20path','Output\x20format','Force\x20overwrite','Show\x20help','remote','appcode','sqlName','clear','global','output','2985057ICuAMD','Expected\x20affected\x20count','nonInteractive','sql-name','Override\x20appcode','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Function\x20node','Title','project','3334460KzNOJh','354PbgCft','descriptionFile','expected-count','db-id','code','Config\x20key','File\x20path','target','title','SQL\x20string','skipImports','page','meowKey','sqlcode','name','enable-bff-save','Clear','dbid','131033Hdzoqo','keyword','schemas','verbose','350824acIopC','5WwYpwk','env','Type\x20filter','force','Description\x20file','watch','SQL\x20name','2585848HPXpje','<expr>','dbId','<name>','2312340MzJZvy','confirm','string','Skip\x20confirmation\x20for\x20high-risk\x20writes','format','Use\x20remote','sqlname','type','3exkILj','description','operationType','Page\x20number','DB\x20ID','Target\x20path','key','yes','help','app','description-file','Schemas','1806020cLftEF','Verbose\x20output','enableBffSave','Enable\x20BFF\x20save','operation-type','<code>','production\x20|\x20daily','skip-imports','sql','fromEntries','value','Name','@lovrabet/rabetbase-cli','Operation\x20type','datasetcode','Rabetbase\x20CLI','pagesize','SQL\x20code','boolean','dry-run'];a136_0x53e6=function(){return _0x2ceef5;};return a136_0x53e6();}(function(_0x5860a8,_0x21d0ac){const _0x3b393d=a136_0x1072,_0xbdfb35=_0x5860a8();while(!![]){try{const _0x1450d5=-parseInt(_0x3b393d(0x14f))/0x1*(-parseInt(_0x3b393d(0x14e))/0x2)+-parseInt(_0x3b393d(0x162))/0x3*(parseInt(_0x3b393d(0x19d))/0x4)+-parseInt(_0x3b393d(0x15a))/0x5+parseInt(_0x3b393d(0x19e))/0x6*(parseInt(_0x3b393d(0x1b0))/0x7)+parseInt(_0x3b393d(0x156))/0x8+-parseInt(_0x3b393d(0x194))/0x9+parseInt(_0x3b393d(0x16e))/0xa;if(_0x1450d5===_0x21d0ac)break;else _0xbdfb35['push'](_0xbdfb35['shift']());}catch(_0x24cc00){_0xbdfb35['push'](_0xbdfb35['shift']());}}}(a136_0x53e6,0xd15d6));export const CLI_BIN_NAME='rabetbase';export const CLI_DISPLAY_NAME=a136_0x36910e(0x17d);export const NPM_PACKAGE_NAME=a136_0x36910e(0x17a);export const GLOBAL_FLAGS=[{'name':a136_0x36910e(0x18f),'meowKey':a136_0x36910e(0x18f),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x198),'hint':a136_0x36910e(0x173)},{'name':'app','meowKey':'app','type':a136_0x36910e(0x15c),'description':'Select\x20app\x20profile\x20by\x20name','hint':a136_0x36910e(0x159)},{'name':'env','meowKey':a136_0x36910e(0x150),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x188),'hint':a136_0x36910e(0x174)},{'name':a136_0x36910e(0x15e),'meowKey':a136_0x36910e(0x15e),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x18b),'hint':a136_0x36910e(0x182)},{'name':'jq','meowKey':'jq','type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x199),'hint':a136_0x36910e(0x157)},{'name':a136_0x36910e(0x181),'meowKey':a136_0x36910e(0x186),'type':'boolean','description':'Preview\x20operation\x20without\x20executing'},{'name':a136_0x36910e(0x169),'meowKey':'yes','type':a136_0x36910e(0x180),'description':a136_0x36910e(0x15d)},{'name':a136_0x36910e(0x185),'meowKey':a136_0x36910e(0x196),'type':'boolean','description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':a136_0x36910e(0x192),'meowKey':a136_0x36910e(0x192),'type':a136_0x36910e(0x180),'description':'Use\x20global\x20config\x20scope'},{'name':a136_0x36910e(0x19c),'meowKey':'project','type':a136_0x36910e(0x180),'description':a136_0x36910e(0x184)},{'name':'ci','meowKey':'ci','type':'boolean','description':'Alias\x20for\x20--non-interactive','hidden':!![]},{'name':a136_0x36910e(0x16a),'meowKey':a136_0x36910e(0x16a),'type':a136_0x36910e(0x180),'description':a136_0x36910e(0x18d)},{'name':a136_0x36910e(0x1ac),'meowKey':'name','type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x179),'hidden':!![]},{'name':'title','meowKey':a136_0x36910e(0x1a6),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x19b),'hidden':!![]},{'name':a136_0x36910e(0x191),'meowKey':'clear','type':a136_0x36910e(0x180),'description':a136_0x36910e(0x1ae),'hidden':!![]},{'name':a136_0x36910e(0x154),'meowKey':'watch','type':a136_0x36910e(0x180),'description':'Watch\x20mode','hidden':!![]},{'name':'output','meowKey':a136_0x36910e(0x193),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x18a),'hidden':!![]},{'name':'params','meowKey':a136_0x36910e(0x187),'type':a136_0x36910e(0x15c),'description':'JSON\x20params','hidden':!![]},{'name':a136_0x36910e(0x17c),'meowKey':'datasetcode','type':'string','description':'Dataset\x20code','hidden':!![]},{'name':'all','meowKey':'all','type':a136_0x36910e(0x180),'description':'Apply\x20to\x20all','hidden':!![]},{'name':a136_0x36910e(0x1ad),'meowKey':a136_0x36910e(0x170),'type':a136_0x36910e(0x180),'description':a136_0x36910e(0x171),'hidden':!![]},{'name':'id','meowKey':'id','type':'string','description':'Record\x20ID','hidden':!![]},{'name':a136_0x36910e(0x161),'meowKey':a136_0x36910e(0x161),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x151),'hidden':!![]},{'name':'file','meowKey':a136_0x36910e(0x189),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x1a4),'hidden':!![]},{'name':'sqlcode','meowKey':a136_0x36910e(0x1ab),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x17f),'hidden':!![]},{'name':a136_0x36910e(0x197),'meowKey':a136_0x36910e(0x190),'type':'string','description':'SQL\x20name','hidden':!![]},{'name':a136_0x36910e(0x160),'meowKey':a136_0x36910e(0x160),'type':'string','description':a136_0x36910e(0x155),'hidden':!![]},{'name':a136_0x36910e(0x1a1),'meowKey':a136_0x36910e(0x158),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x166),'hidden':!![]},{'name':a136_0x36910e(0x1af),'meowKey':a136_0x36910e(0x1af),'type':'string','description':a136_0x36910e(0x166),'hidden':!![]},{'name':'description','meowKey':a136_0x36910e(0x163),'type':'string','description':'Description','hidden':!![]},{'name':a136_0x36910e(0x16c),'meowKey':a136_0x36910e(0x19f),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x153),'hidden':!![]},{'name':a136_0x36910e(0x1a9),'meowKey':'page','type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x165),'hidden':!![]},{'name':a136_0x36910e(0x17e),'meowKey':a136_0x36910e(0x17e),'type':a136_0x36910e(0x15c),'description':'Page\x20size','hidden':!![]},{'name':a136_0x36910e(0x1b1),'meowKey':'keyword','type':'string','description':'Keyword\x20filter','hidden':!![]},{'name':a136_0x36910e(0x1a2),'meowKey':a136_0x36910e(0x1a2),'type':a136_0x36910e(0x15c),'description':'Code\x20filter','hidden':!![]},{'name':a136_0x36910e(0x176),'meowKey':a136_0x36910e(0x176),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x1a7),'hidden':!![]},{'name':a136_0x36910e(0x14c),'meowKey':a136_0x36910e(0x14c),'type':'string','description':a136_0x36910e(0x16d),'hidden':!![]},{'name':'operation','meowKey':'operation','type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x17b),'hidden':!![]},{'name':a136_0x36910e(0x1a5),'meowKey':a136_0x36910e(0x1a5),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x167),'hidden':!![]},{'name':a136_0x36910e(0x175),'meowKey':a136_0x36910e(0x1a8),'type':'boolean','description':'Skip\x20import\x20generation','hidden':!![]},{'name':a136_0x36910e(0x168),'meowKey':'key','type':'string','description':a136_0x36910e(0x1a3),'hidden':!![]},{'name':a136_0x36910e(0x178),'meowKey':'value','type':a136_0x36910e(0x15c),'description':'Config\x20value','hidden':!![]},{'name':a136_0x36910e(0x152),'meowKey':a136_0x36910e(0x152),'type':a136_0x36910e(0x180),'description':a136_0x36910e(0x18c),'hidden':!![]},{'name':a136_0x36910e(0x15b),'meowKey':'confirm','type':a136_0x36910e(0x180),'description':a136_0x36910e(0x183),'hidden':!![]},{'name':a136_0x36910e(0x18e),'meowKey':a136_0x36910e(0x18e),'type':a136_0x36910e(0x180),'description':a136_0x36910e(0x15f),'hidden':!![]},{'name':a136_0x36910e(0x14d),'meowKey':'verbose','type':a136_0x36910e(0x180),'description':a136_0x36910e(0x16f),'hidden':!![]},{'name':a136_0x36910e(0x1a0),'meowKey':'expectedCount','type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x195),'hidden':!![]},{'name':a136_0x36910e(0x172),'meowKey':a136_0x36910e(0x164),'type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x17b),'hidden':!![]},{'name':'function-node','meowKey':'functionNode','type':a136_0x36910e(0x15c),'description':a136_0x36910e(0x19a),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a136_0x36910e(0x18f),a136_0x36910e(0x16b),a136_0x36910e(0x150),a136_0x36910e(0x15e),'jq',a136_0x36910e(0x181),a136_0x36910e(0x169),a136_0x36910e(0x185),'ci']);function a136_0x1072(_0x22bb7e,_0x44841a){_0x22bb7e=_0x22bb7e-0x14c;const _0x53e672=a136_0x53e6();let _0x107258=_0x53e672[_0x22bb7e];return _0x107258;}export function buildMeowFlags(){const _0x351f99=a136_0x36910e;return Object[_0x351f99(0x177)](GLOBAL_FLAGS['map'](_0x3a07b1=>[_0x3a07b1[_0x351f99(0x1aa)],{'type':_0x3a07b1[_0x351f99(0x161)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a137_0x472576=a137_0x460e;function a137_0xc0d8(){const _0x43694b=['40245rfmclT','20QDIQgF','en-US','high-risk-write','10864294ThaumA','2770212sjTNuX','1894347QmYQij','compress','7728728dmKvMx','14804330GkdHbL','90709zxichV','9LLsaep','606pgymwh'];a137_0xc0d8=function(){return _0x43694b;};return a137_0xc0d8();}function a137_0x460e(_0x594a7f,_0x36776e){_0x594a7f=_0x594a7f-0xf4;const _0xc0d8ce=a137_0xc0d8();let _0x460e8a=_0xc0d8ce[_0x594a7f];return _0x460e8a;}(function(_0x47254d,_0x45a75a){const _0x77dc3d=a137_0x460e,_0x20ba6a=_0x47254d();while(!![]){try{const _0x32a7e2=parseInt(_0x77dc3d(0xfb))/0x1*(parseInt(_0x77dc3d(0xff))/0x2)+-parseInt(_0x77dc3d(0xf7))/0x3+parseInt(_0x77dc3d(0xf6))/0x4+-parseInt(_0x77dc3d(0xfe))/0x5*(-parseInt(_0x77dc3d(0xfd))/0x6)+parseInt(_0x77dc3d(0xf5))/0x7+-parseInt(_0x77dc3d(0xf9))/0x8+-parseInt(_0x77dc3d(0xfc))/0x9*(parseInt(_0x77dc3d(0xfa))/0xa);if(_0x32a7e2===_0x45a75a)break;else _0x20ba6a['push'](_0x20ba6a['shift']());}catch(_0x48408a){_0x20ba6a['push'](_0x20ba6a['shift']());}}}(a137_0xc0d8,0xd8785));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':'production','format':a137_0x472576(0xf8),'locale':a137_0x472576(0x100),'riskLevel':a137_0x472576(0xf4),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT='compress';
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a138_0x47668c=a138_0x11c1;(function(_0x266828,_0x21128b){const _0x374e85=a138_0x11c1,_0x37c459=_0x266828();while(!![]){try{const _0x31c470=parseInt(_0x374e85(0x8a))/0x1+parseInt(_0x374e85(0x90))/0x2+-parseInt(_0x374e85(0x97))/0x3+-parseInt(_0x374e85(0x98))/0x4*(-parseInt(_0x374e85(0x8f))/0x5)+-parseInt(_0x374e85(0x99))/0x6+parseInt(_0x374e85(0x8b))/0x7*(parseInt(_0x374e85(0x9d))/0x8)+-parseInt(_0x374e85(0x95))/0x9*(parseInt(_0x374e85(0x8e))/0xa);if(_0x31c470===_0x21128b)break;else _0x37c459['push'](_0x37c459['shift']());}catch(_0x2c53a9){_0x37c459['push'](_0x37c459['shift']());}}}(a138_0x9735,0x285b8));import{getEnv,isProduction}from'../constant/env.js';function a138_0x11c1(_0x424576,_0x5b8e7e){_0x424576=_0x424576-0x88;const _0x9735dd=a138_0x9735();let _0x11c12d=_0x9735dd[_0x424576];return _0x11c12d;}let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x1d1e33){const _0x20f8ca=a138_0x11c1;customApiDomain=_0x1d1e33?.[_0x20f8ca(0x9c)],customUserDomain=_0x1d1e33?.['userDomain'],customRuntimeDomain=_0x1d1e33?.[_0x20f8ca(0x89)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a138_0x47668c(0x96):a138_0x47668c(0x91));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a138_0x47668c(0x92):a138_0x47668c(0x88));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a138_0x47668c(0x94):a138_0x47668c(0x8d));function a138_0x9735(){const _0x498f95=['https://daily-api.lovrabet.com','runtimeDomain','234649PKJutz','1540147WhcITZ','https://app.lovrabet.com','https://daily-runtime.lovrabet.com','4433550wcqPuN','70TQbbeS','409014SLFrjY','https://user-daily.lovrabet.com','https://api.lovrabet.com','/app/','https://runtime.lovrabet.com','9RmKSzk','https://user.lovrabet.com','905973yDqpBy','93540yyoBfh','455502iePaYj','trim','/web-app/app/','apiDomain','8WgcERw'];a138_0x9735=function(){return _0x498f95;};return a138_0x9735();}export const getAppDomain=()=>isProduction(getEnv())?a138_0x47668c(0x8c):'https://daily.lovrabet.com';export const getAppBaseUrl=_0x358073=>{const _0xbd47f7=a138_0x47668c,_0x468572=encodeURIComponent(_0x358073[_0xbd47f7(0x9a)]());return isProduction(getEnv())?getAppDomain()+_0xbd47f7(0x93)+_0x468572:getAppDomain()+_0xbd47f7(0x9b)+_0x468572;};
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a139_0x3807e8=a139_0x1943;(function(_0x1a23a4,_0x43996b){const _0x1428b0=a139_0x1943,_0x2df2dc=_0x1a23a4();while(!![]){try{const _0x4d963d=-parseInt(_0x1428b0(0x1cb))/0x1+-parseInt(_0x1428b0(0x1c1))/0x2+-parseInt(_0x1428b0(0x1c9))/0x3+-parseInt(_0x1428b0(0x1c2))/0x4*(parseInt(_0x1428b0(0x1c7))/0x5)+-parseInt(_0x1428b0(0x1c0))/0x6+parseInt(_0x1428b0(0x1cc))/0x7+parseInt(_0x1428b0(0x1c4))/0x8*(parseInt(_0x1428b0(0x1c8))/0x9);if(_0x4d963d===_0x43996b)break;else _0x2df2dc['push'](_0x2df2dc['shift']());}catch(_0xae4277){_0x2df2dc['push'](_0x2df2dc['shift']());}}}(a139_0x3204,0x4bea3));function a139_0x3204(){const _0x1d2ec3=['63OjSeyN','81855eXxUSo','production','594507OQzPPt','2801771hXhOkx','2825736qCvXjX','69078uDUqlA','50504pPFsby','dev','1590296iOIzqQ','development','online','140yQewtk'];a139_0x3204=function(){return _0x1d2ec3;};return a139_0x3204();}function a139_0x1943(_0x120a39,_0x320499){_0x120a39=_0x120a39-0x1c0;const _0x3204d1=a139_0x3204();let _0x1943eb=_0x3204d1[_0x120a39];return _0x1943eb;}export const RABETBASE_ENV_VALUES=[a139_0x3807e8(0x1ca),'daily'];export function normalizeEnv(_0x3183b8){const _0x197487=a139_0x3807e8;return _0x3183b8===_0x197487(0x1c6)?_0x197487(0x1ca):_0x3183b8;}export function isProduction(_0x9d3541){const _0x486dd5=a139_0x3807e8;return normalizeEnv(_0x9d3541)===_0x486dd5(0x1ca);}export function isDaily(_0x2f64d3){return normalizeEnv(_0x2f64d3)==='daily';}export function isDev(_0x1c8839){const _0x5dacdf=a139_0x3807e8,_0x4dda37=normalizeEnv(_0x1c8839);return _0x4dda37===_0x5dacdf(0x1c5)||_0x4dda37===_0x5dacdf(0x1c3);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a139_0x3807e8(0x1ca));export function getEnv(){return env;}export function initEnv(_0x1dc7ff){env=normalizeEnv(_0x1dc7ff);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a140_0x2884(_0x276ed7,_0x1d05db){_0x276ed7=_0x276ed7-0x71;const _0x3a59ae=a140_0x3a59();let _0x28848b=_0x3a59ae[_0x276ed7];return _0x28848b;}function a140_0x3a59(){const _0x482a8a=['4776289ONywAO','5642STKEDi','69QIyvdH','12837vdunsx','1197488QVssqs','compress','3080lBjTFC','90881sOnKTE','1255jVEbWa','json','279MNaytg','61176eOpNyF','pretty','16278WteydZ'];a140_0x3a59=function(){return _0x482a8a;};return a140_0x3a59();}const a140_0x584557=a140_0x2884;(function(_0x49713d,_0x31319d){const _0x2e152c=a140_0x2884,_0x5c0f17=_0x49713d();while(!![]){try{const _0x23a59e=parseInt(_0x2e152c(0x77))/0x1+parseInt(_0x2e152c(0x71))/0x2*(-parseInt(_0x2e152c(0x72))/0x3)+parseInt(_0x2e152c(0x74))/0x4+parseInt(_0x2e152c(0x78))/0x5*(parseInt(_0x2e152c(0x7d))/0x6)+-parseInt(_0x2e152c(0x7e))/0x7+-parseInt(_0x2e152c(0x7b))/0x8*(parseInt(_0x2e152c(0x7a))/0x9)+-parseInt(_0x2e152c(0x76))/0xa*(-parseInt(_0x2e152c(0x73))/0xb);if(_0x23a59e===_0x31319d)break;else _0x5c0f17['push'](_0x5c0f17['shift']());}catch(_0x1d6c44){_0x5c0f17['push'](_0x5c0f17['shift']());}}}(a140_0x3a59,0x6cfb1));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a140_0x584557(0x79),a140_0x584557(0x7c),a140_0x584557(0x75)];
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a141_0x553ee5=a141_0x4939;(function(_0x7d97c1,_0x1c1e8e){const _0x474ff1=a141_0x4939,_0x2ad57a=_0x7d97c1();while(!![]){try{const _0x168121=parseInt(_0x474ff1(0x17e))/0x1+parseInt(_0x474ff1(0x187))/0x2*(parseInt(_0x474ff1(0x17f))/0x3)+parseInt(_0x474ff1(0x185))/0x4+-parseInt(_0x474ff1(0x17d))/0x5*(-parseInt(_0x474ff1(0x186))/0x6)+-parseInt(_0x474ff1(0x183))/0x7+parseInt(_0x474ff1(0x182))/0x8*(-parseInt(_0x474ff1(0x180))/0x9)+-parseInt(_0x474ff1(0x181))/0xa;if(_0x168121===_0x1c1e8e)break;else _0x2ad57a['push'](_0x2ad57a['shift']());}catch(_0x175657){_0x2ad57a['push'](_0x2ad57a['shift']());}}}(a141_0x5644,0x70754));export const DEFAULT_API_DIR=a141_0x553ee5(0x184);function a141_0x4939(_0x3f9b60,_0x2c1bed){_0x3f9b60=_0x3f9b60-0x17d;const _0x564475=a141_0x5644();let _0x493928=_0x564475[_0x3f9b60];return _0x493928;}function a141_0x5644(){const _0x467d1a=['130764qfGKVT','6054YmBcss','170SXWiiJ','228483cipBpH','537LmHvgR','230040mgohGR','4679540tLaUfD','208wushPr','3094539TjHfrA','./src/api','2095628WXxLIh'];a141_0x5644=function(){return _0x467d1a;};return a141_0x5644();}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a142_0x3b1b85=a142_0x123d;function a142_0x45b4(){const _0x16c3fb=['559594wHLSDE','high-risk-write','850255jOJswp','1287171QGTQmk','45nJLiDc','8161406TTkJVI','2816920ZHDgIG','18qbUlsG','8kXcgWG','9916grjUhD','write','3zlEiOn','279743LkPyuB'];a142_0x45b4=function(){return _0x16c3fb;};return a142_0x45b4();}function a142_0x123d(_0x78b5,_0x5e6dbb){_0x78b5=_0x78b5-0xe3;const _0x45b45f=a142_0x45b4();let _0x123dfa=_0x45b45f[_0x78b5];return _0x123dfa;}(function(_0x1a9530,_0x56cea2){const _0x3808cc=a142_0x123d,_0x4fc010=_0x1a9530();while(!![]){try{const _0xee25b0=-parseInt(_0x3808cc(0xe7))/0x1+parseInt(_0x3808cc(0xe8))/0x2*(parseInt(_0x3808cc(0xe6))/0x3)+-parseInt(_0x3808cc(0xe4))/0x4*(parseInt(_0x3808cc(0xec))/0x5)+parseInt(_0x3808cc(0xef))/0x6*(-parseInt(_0x3808cc(0xea))/0x7)+-parseInt(_0x3808cc(0xe3))/0x8*(-parseInt(_0x3808cc(0xeb))/0x9)+-parseInt(_0x3808cc(0xee))/0xa+parseInt(_0x3808cc(0xed))/0xb;if(_0xee25b0===_0x56cea2)break;else _0x4fc010['push'](_0x4fc010['shift']());}catch(_0x5c9290){_0x4fc010['push'](_0x4fc010['shift']());}}}(a142_0x45b4,0x34e2d));export const RISK_LEVEL_VALUES=['read',a142_0x3b1b85(0xe5),a142_0x3b1b85(0xe9)];
|