@lovrabet/rabetbase-cli 2.1.10-beta.0 → 2.1.10-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/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/link-create.js +1 -1
- package/lib/commands/dataset/link-delete.js +1 -1
- package/lib/commands/dataset/link-shared.js +1 -1
- package/lib/commands/dataset/link-update.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -1
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a121_0x20b0fd=a121_0x4ec4;(function(_0x2174e0,_0x1e528b){const _0x1ff7cb=a121_0x4ec4,_0x1e3ca7=_0x2174e0();while(!![]){try{const _0x2582ad=parseInt(_0x1ff7cb(0x1cd))/0x1+parseInt(_0x1ff7cb(0x1db))/0x2+-parseInt(_0x1ff7cb(0x1f3))/0x3*(-parseInt(_0x1ff7cb(0x1ca))/0x4)+parseInt(_0x1ff7cb(0x1fb))/0x5*(parseInt(_0x1ff7cb(0x1f7))/0x6)+-parseInt(_0x1ff7cb(0x1da))/0x7*(-parseInt(_0x1ff7cb(0x1fd))/0x8)+parseInt(_0x1ff7cb(0x1f8))/0x9+-parseInt(_0x1ff7cb(0x1c2))/0xa*(parseInt(_0x1ff7cb(0x1c6))/0xb);if(_0x2582ad===_0x1e528b)break;else _0x1e3ca7['push'](_0x1e3ca7['shift']());}catch(_0x363698){_0x1e3ca7['push'](_0x1e3ca7['shift']());}}}(a121_0x3e57,0xd450b));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';function a121_0x3e57(){const _0x27aee4=['filter','3475674bpTVCU','6263163foEIsT','sqlRootDir','sql','15dwiqQs','path','72VdUAyX','catch','210YMHgNr','push','mybatisXml','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','2829981LTEbAq','message','No\x20remote\x20SQL\x20queries\x20matched.','bool','52lSvgyG','paging','Force\x20pull\x20cancelled.','530901tmIupn','skipped','string','lockFilePath','replace','boolean','sqlCode','toISOString','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','tableData','Pull\x20complete:\x20','local\x20differs\x20from\x20remote','984389QEpVKp','2616184SPikKn','would_pull','length','\x20skipped,\x20','totalCount','trimStart','utf8','test','conflict','dbId','appCode','sqlcode','pull','force','split','Would\x20pull\x20','lastSync','str','sqls','unchanged','description','sqlContent','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','write','169374RkEPSX','name','sqlName'];a121_0x3e57=function(){return _0x27aee4;};return a121_0x3e57();}import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x4e7cb3,_0x4b2c8e){const _0x11b6cc=a121_0x4ec4,_0x320754=[];let _0x3e727b=0x1;while(!![]){const _0x3aeddb=await listSqlQueries(_0x4e7cb3,{'currentPage':_0x3e727b,'pageSize':PAGE_SIZE,'sqlCode':_0x4b2c8e['sqlCode'],'sqlName':_0x4b2c8e[_0x11b6cc(0x1f5)]}),_0x78c43d=_0x3aeddb[_0x11b6cc(0x1d7)]??[];_0x320754[_0x11b6cc(0x1c3)](..._0x78c43d);if(_0x78c43d['length']===0x0)break;const _0x552de9=_0x3aeddb[_0x11b6cc(0x1cb)]?.[_0x11b6cc(0x1df)];if(_0x552de9!=null?_0x320754[_0x11b6cc(0x1dd)]>=_0x552de9:_0x78c43d[_0x11b6cc(0x1dd)]<PAGE_SIZE)break;_0x3e727b++;}return _0x320754;}async function ensureSqlContent(_0x1aad33){const _0x131959=a121_0x4ec4;if(_0x1aad33['sqlContent']!=null&&String(_0x1aad33[_0x131959(0x1f0)])[_0x131959(0x1dd)]>0x0)return _0x1aad33;return getSqlQueryDetail(_0x1aad33[_0x131959(0x1d3)]);}export const sqlPull={'service':a121_0x20b0fd(0x1fa),'command':a121_0x20b0fd(0x1e7),'description':a121_0x20b0fd(0x1d5),'risk':a121_0x20b0fd(0x1f2),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a121_0x20b0fd(0x1f4),'type':a121_0x20b0fd(0x1cf),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a121_0x20b0fd(0x1e8),'type':a121_0x20b0fd(0x1d2),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x489f9a){const _0x578e28=a121_0x20b0fd,_0x34c260=loadSqlProjectConfig(_0x489f9a[_0x578e28(0x1e5)]),_0x5e2c84=await readSqlLockFile(_0x34c260[_0x578e28(0x1d0)]),{appLock:_0xc1806f}=ensureSqlLockScope(_0x5e2c84??createEmptySqlLock(),_0x34c260[_0x578e28(0x1e5)],_0x34c260['sqlRoot'],'pull'),_0x20a640=await fetchAllSqlQueries(_0x489f9a[_0x578e28(0x1e5)],{'sqlCode':_0x489f9a['str']('sqlcode')||undefined,'sqlName':_0x489f9a[_0x578e28(0x1ec)](_0x578e28(0x1f4))||undefined}),_0x3fb4b7=[];for(const _0x293db8 of _0x20a640){const _0x423ac9=await ensureSqlContent(_0x293db8),_0x48d394=ensureRemoteSqlContent(_0x423ac9),_0x71a6cd=detectModeFromSql(_0x423ac9),_0x48ad5b=_0x423ac9[_0x578e28(0x1e4)]?await getDbName(_0x489f9a[_0x578e28(0x1e5)],Number(_0x423ac9[_0x578e28(0x1e4)]))[_0x578e28(0x1c1)](()=>undefined):undefined,_0x520adb=buildLocalSqlFileContent({'sqlCode':_0x423ac9['sqlCode'],'sqlName':_0x423ac9[_0x578e28(0x1f5)],'dbId':_0x423ac9[_0x578e28(0x1e4)]},_0x48d394,{'dbName':_0x48ad5b,'mode':_0x71a6cd,'syncedAt':new Date()[_0x578e28(0x1d4)](),'description':_0x423ac9[_0x578e28(0x1ef)]}),_0xa0a5ba=buildSqlLockEntry(_0x423ac9,_0x48d394,'',{'dbName':_0x48ad5b}),_0x22c828=resolveLocalSqlFilePath(_0x34c260,_0x423ac9[_0x578e28(0x1d3)],_0xa0a5ba);let _0x3ba48f=_0x578e28(0x1dc),_0x3459b9;if(await fileExists(_0x22c828)){const _0x316a0a=await readFile(_0x22c828,_0x578e28(0x1e1));isEquivalentPulledSqlFile(_0x316a0a,_0x520adb,_0x71a6cd)?(_0x3ba48f=_0x578e28(0x1ce),_0x3459b9=_0x578e28(0x1ee)):(_0x3ba48f=_0x578e28(0x1e3),_0x3459b9=_0x578e28(0x1f1));}_0x3fb4b7[_0x578e28(0x1c3)]({'sqlCode':_0x423ac9[_0x578e28(0x1d3)],'sqlName':_0x423ac9[_0x578e28(0x1f5)],'filePath':_0x22c828,'status':_0x3ba48f,'reason':_0x3459b9});}return{'method':'POST','url':_0x578e28(0x1d6),'body':{'appCode':_0x489f9a[_0x578e28(0x1e5)],'sqlCode':_0x489f9a[_0x578e28(0x1ec)]('sqlcode')||null,'sqlName':_0x489f9a[_0x578e28(0x1ec)](_0x578e28(0x1f4))||null,'files':_0x3fb4b7},'description':_0x578e28(0x1ea)+_0x3fb4b7['length']+'\x20SQL\x20file(s)\x20into\x20'+_0x34c260[_0x578e28(0x1f9)]};},async 'execute'(_0x5b9eb3){const _0x411c1b=a121_0x20b0fd,_0x37c952=loadSqlProjectConfig(_0x5b9eb3['appCode']),_0x791aa0=await readSqlLockFile(_0x37c952[_0x411c1b(0x1d0)]),{lockData:_0x3dd0be,appLock:_0x1da9af}=ensureSqlLockScope(_0x791aa0??createEmptySqlLock(),_0x37c952[_0x411c1b(0x1e5)],_0x37c952['sqlRoot'],'pull'),_0x1b8ad1=_0x5b9eb3[_0x411c1b(0x1c9)](_0x411c1b(0x1e8)),_0xc2c0d7=await fetchAllSqlQueries(_0x5b9eb3['appCode'],{'sqlCode':_0x5b9eb3['str'](_0x411c1b(0x1e6))||undefined,'sqlName':_0x5b9eb3['str'](_0x411c1b(0x1f4))||undefined});if(_0xc2c0d7['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x411c1b(0x1c8)};const _0x1ac7ed=[],_0x251214=[];for(const _0x235e9f of _0xc2c0d7){try{_0x1ac7ed[_0x411c1b(0x1c3)](await ensureSqlContent(_0x235e9f));}catch(_0x3ef649){_0x251214[_0x411c1b(0x1c3)]({'sqlCode':_0x235e9f[_0x411c1b(0x1d3)],'error':_0x3ef649 instanceof Error?_0x3ef649[_0x411c1b(0x1c7)]:String(_0x3ef649)});}}if(_0x1b8ad1&&!_0x5b9eb3['nonInteractive']){let _0xd912d3=![];for(const _0xebd8a3 of _0x1ac7ed){const _0x2a90c9=detectModeFromSql(_0xebd8a3),_0x2ec860=_0xebd8a3[_0x411c1b(0x1e4)]?await getDbName(_0x5b9eb3[_0x411c1b(0x1e5)],Number(_0xebd8a3[_0x411c1b(0x1e4)]))['catch'](()=>undefined):undefined,_0xfe4635=buildLocalSqlFileContent({'sqlCode':_0xebd8a3['sqlCode'],'sqlName':_0xebd8a3[_0x411c1b(0x1f5)],'dbId':_0xebd8a3[_0x411c1b(0x1e4)]},ensureRemoteSqlContent(_0xebd8a3),{'dbName':_0x2ec860,'mode':_0x2a90c9,'syncedAt':new Date()[_0x411c1b(0x1d4)](),'description':_0xebd8a3[_0x411c1b(0x1ef)]}),_0x316af=resolveLocalSqlFilePath(_0x37c952,_0xebd8a3['sqlCode'],buildSqlLockEntry(_0xebd8a3,ensureRemoteSqlContent(_0xebd8a3),'',{'dbName':_0x2ec860}));if(await fileExists(_0x316af)){const _0x18ad3d=await readFile(_0x316af,'utf8');if(!isEquivalentPulledSqlFile(_0x18ad3d,_0xfe4635,_0x2a90c9)){_0xd912d3=!![];break;}}}if(_0xd912d3){const _0x472410=await confirmForceOverwrite(_0x411c1b(0x1c5));if(!_0x472410)throw CliErrors['cancelled'](_0x411c1b(0x1cc));}}const _0xc5ade0=cloneSqlLockData(_0x3dd0be),_0x30a3e6=_0xc5ade0['apps'][_0x37c952['appCode']],_0x2edb77=[],_0x6160b5=[];for(const _0x27f062 of _0x1ac7ed){const _0x8c18c=_0x30a3e6[_0x411c1b(0x1ed)][_0x27f062[_0x411c1b(0x1d3)]],_0x134d86=ensureRemoteSqlContent(_0x27f062),_0x10adc5=detectModeFromSql(_0x27f062),_0x3e8aa1=_0x27f062[_0x411c1b(0x1e4)]?await getDbName(_0x5b9eb3[_0x411c1b(0x1e5)],Number(_0x27f062[_0x411c1b(0x1e4)]))[_0x411c1b(0x1c1)](()=>undefined):undefined,_0x3abb46=buildLocalSqlFileContent({'sqlCode':_0x27f062[_0x411c1b(0x1d3)],'sqlName':_0x27f062[_0x411c1b(0x1f5)],'dbId':_0x27f062[_0x411c1b(0x1e4)]},_0x134d86,{'dbName':_0x3e8aa1,'mode':_0x10adc5,'syncedAt':new Date()[_0x411c1b(0x1d4)](),'description':_0x27f062[_0x411c1b(0x1ef)]}),_0x42e0b9=buildSqlLockEntry(_0x27f062,_0x134d86,computeSqlContentHash(_0x3abb46),{'dbName':_0x3e8aa1}),_0x5ccc4f=_0x42e0b9['path'],_0xfcbda4=join(_0x37c952[_0x411c1b(0x1f9)],_0x5ccc4f);try{if(await fileExists(_0xfcbda4)){const _0xfb0c07=await readFile(_0xfcbda4,_0x411c1b(0x1e1));if(isEquivalentPulledSqlFile(_0xfb0c07,_0x3abb46,_0x10adc5)){_0x6160b5[_0x411c1b(0x1c3)]({'sqlCode':_0x27f062[_0x411c1b(0x1d3)],'reason':_0x411c1b(0x1ee)}),_0x30a3e6[_0x411c1b(0x1ed)][_0x27f062[_0x411c1b(0x1d3)]]={..._0x42e0b9,'hash':computeSqlContentHash(_0xfb0c07),'path':_0x5ccc4f};continue;}if(!_0x1b8ad1){_0x6160b5[_0x411c1b(0x1c3)]({'sqlCode':_0x27f062[_0x411c1b(0x1d3)],'reason':_0x411c1b(0x1d9)});continue;}}const _0x24739b=_0x8c18c?.[_0x411c1b(0x1fc)]?join(_0x37c952[_0x411c1b(0x1f9)],_0x8c18c[_0x411c1b(0x1fc)]):undefined;_0x24739b&&_0x24739b!==_0xfcbda4&&await fileExists(_0x24739b)&&await rm(_0x24739b,{'force':!![]}),await ensureParentDirectory(_0xfcbda4),await writeFile(_0xfcbda4,_0x3abb46,_0x411c1b(0x1e1)),_0x30a3e6['sqls'][_0x27f062[_0x411c1b(0x1d3)]]={..._0x42e0b9,'path':_0x5ccc4f},_0x2edb77['push']({'sqlCode':_0x27f062[_0x411c1b(0x1d3)],'filePath':_0xfcbda4});}catch(_0x5e2fb2){_0x251214[_0x411c1b(0x1c3)]({'sqlCode':_0x27f062[_0x411c1b(0x1d3)],'error':_0x5e2fb2 instanceof Error?_0x5e2fb2['message']:String(_0x5e2fb2)});}}return _0x30a3e6[_0x411c1b(0x1eb)]=new Date()['toISOString'](),await writeSqlLockFile(_0x37c952['lockFilePath'],_0xc5ade0),{'ok':_0x251214['length']===0x0,'data':{'pulled':_0x2edb77,'skipped':_0x6160b5,'failed':_0x251214},'message':_0x411c1b(0x1d8)+_0x2edb77[_0x411c1b(0x1dd)]+'\x20written,\x20'+_0x6160b5[_0x411c1b(0x1dd)]+_0x411c1b(0x1de)+_0x251214[_0x411c1b(0x1dd)]+'\x20failed'};}};function a121_0x4ec4(_0xca2212,_0x53788f){_0xca2212=_0xca2212-0x1c1;const _0x3e5719=a121_0x3e57();let _0x4ec47c=_0x3e5719[_0xca2212];return _0x4ec47c;}function detectModeFromSql(_0x21145c){const _0x1ae73b=a121_0x20b0fd,_0x425e30=ensureRemoteSqlContent(_0x21145c),_0x1e5755=stripLocalSqlMetadata(_0x425e30,_0x1ae73b(0x1c4))[_0x1ae73b(0x1e0)]();if(/^<(select|insert|update|delete)\b/i[_0x1ae73b(0x1e2)](_0x1e5755))return _0x1ae73b(0x1c4);return'sql';}function isEquivalentPulledSqlFile(_0x16c628,_0x57266f,_0x34db9d){return normalizePullComparableContent(_0x16c628,_0x34db9d)===normalizePullComparableContent(_0x57266f,_0x34db9d);}function normalizePullComparableContent(_0x200958,_0x3fafc0){const _0x3337df=a121_0x20b0fd,_0x1e8d92=_0x200958[_0x3337df(0x1d1)](/\r\n/g,'\x0a')[_0x3337df(0x1e9)]('\x0a'),_0x424793=_0x1e8d92[_0x3337df(0x1f6)](_0xaa6bd5=>!isSyncedAtMetadataLine(_0xaa6bd5,_0x3fafc0));return _0x424793['join']('\x0a');}function isSyncedAtMetadataLine(_0x50f038,_0x437a30){const _0x54006d=a121_0x20b0fd;if(_0x437a30===_0x54006d(0x1c4))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x54006d(0x1e2)](_0x50f038);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x54006d(0x1e2)](_0x50f038);}
|
|
1
|
+
const a121_0x45f068=a121_0x3871;(function(_0x47e0cb,_0x100182){const _0x4b31e4=a121_0x3871,_0x3481d1=_0x47e0cb();while(!![]){try{const _0x43137a=parseInt(_0x4b31e4(0x1d8))/0x1+-parseInt(_0x4b31e4(0x1d1))/0x2+-parseInt(_0x4b31e4(0x1c3))/0x3*(parseInt(_0x4b31e4(0x1fa))/0x4)+-parseInt(_0x4b31e4(0x1cb))/0x5+parseInt(_0x4b31e4(0x1f5))/0x6+parseInt(_0x4b31e4(0x1ef))/0x7*(-parseInt(_0x4b31e4(0x1be))/0x8)+parseInt(_0x4b31e4(0x1d0))/0x9;if(_0x43137a===_0x100182)break;else _0x3481d1['push'](_0x3481d1['shift']());}catch(_0x40f13a){_0x3481d1['push'](_0x3481d1['shift']());}}}(a121_0x5503,0x55b2d));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x4ef742,_0x37dca9){const _0x58fc5e=a121_0x3871,_0x5496f9=[];let _0x17c51c=0x1;while(!![]){const _0x31be91=await listSqlQueries(_0x4ef742,{'currentPage':_0x17c51c,'pageSize':PAGE_SIZE,'sqlCode':_0x37dca9['sqlCode'],'sqlName':_0x37dca9[_0x58fc5e(0x1f1)]}),_0x55548e=_0x31be91[_0x58fc5e(0x1ca)]??[];_0x5496f9[_0x58fc5e(0x1dc)](..._0x55548e);if(_0x55548e[_0x58fc5e(0x1ee)]===0x0)break;const _0x45fecf=_0x31be91['paging']?.['totalCount'];if(_0x45fecf!=null?_0x5496f9['length']>=_0x45fecf:_0x55548e[_0x58fc5e(0x1ee)]<PAGE_SIZE)break;_0x17c51c++;}return _0x5496f9;}async function ensureSqlContent(_0x4eb5c8){const _0x540070=a121_0x3871;if(_0x4eb5c8[_0x540070(0x1c1)]!=null&&String(_0x4eb5c8[_0x540070(0x1c1)])[_0x540070(0x1ee)]>0x0)return _0x4eb5c8;return getSqlQueryDetail(_0x4eb5c8['sqlCode']);}function a121_0x3871(_0x4a2e79,_0x1f4052){_0x4a2e79=_0x4a2e79-0x1bd;const _0x550322=a121_0x5503();let _0x3871a8=_0x550322[_0x4a2e79];return _0x3871a8;}export const sqlPull={'service':a121_0x45f068(0x1c4),'command':a121_0x45f068(0x1e9),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a121_0x45f068(0x1e0),'type':a121_0x45f068(0x1e6),'description':a121_0x45f068(0x1cf)},{'name':a121_0x45f068(0x1d4),'type':a121_0x45f068(0x1db),'description':a121_0x45f068(0x1c6)}],async 'dryRun'(_0x40a5b3){const _0x4bd2d1=a121_0x45f068,_0x4a7f9b=loadSqlProjectConfig(_0x40a5b3['appCode']),_0x10824a=await readSqlLockFile(_0x4a7f9b[_0x4bd2d1(0x1f6)]),{appLock:_0x1337a9}=ensureSqlLockScope(_0x10824a??createEmptySqlLock(),_0x4a7f9b[_0x4bd2d1(0x1f9)],_0x4a7f9b[_0x4bd2d1(0x1c0)],'pull'),_0x47036d=await fetchAllSqlQueries(_0x40a5b3[_0x4bd2d1(0x1f9)],{'sqlCode':_0x40a5b3['str'](_0x4bd2d1(0x1bf))||undefined,'sqlName':_0x40a5b3['str'](_0x4bd2d1(0x1e0))||undefined}),_0x39d7b4=[];for(const _0x2948b8 of _0x47036d){const _0x1d810b=await ensureSqlContent(_0x2948b8),_0x59b18f=ensureRemoteSqlContent(_0x1d810b),_0x39dea4=detectModeFromSql(_0x1d810b),_0x292411=_0x1d810b['dbId']?await getDbName(_0x40a5b3[_0x4bd2d1(0x1f9)],Number(_0x1d810b[_0x4bd2d1(0x1eb)]))[_0x4bd2d1(0x1d3)](()=>undefined):undefined,_0x5b7ace=buildLocalSqlFileContent({'sqlCode':_0x1d810b[_0x4bd2d1(0x1c2)],'sqlName':_0x1d810b[_0x4bd2d1(0x1f1)],'dbId':_0x1d810b['dbId']},_0x59b18f,{'dbName':_0x292411,'mode':_0x39dea4,'syncedAt':new Date()[_0x4bd2d1(0x1d7)](),'description':_0x1d810b[_0x4bd2d1(0x1e1)]}),_0x42d511=buildSqlLockEntry(_0x1d810b,_0x59b18f,'',{'dbName':_0x292411}),_0x4004c9=resolveLocalSqlFilePath(_0x4a7f9b,_0x1d810b[_0x4bd2d1(0x1c2)],_0x42d511);let _0x58dc30=_0x4bd2d1(0x1ed),_0x34cb21;if(await fileExists(_0x4004c9)){const _0x5d462c=await readFile(_0x4004c9,'utf8');isEquivalentPulledSqlFile(_0x5d462c,_0x5b7ace,_0x39dea4)?(_0x58dc30=_0x4bd2d1(0x1df),_0x34cb21=_0x4bd2d1(0x1c8)):(_0x58dc30=_0x4bd2d1(0x1dd),_0x34cb21=_0x4bd2d1(0x1ea));}_0x39d7b4[_0x4bd2d1(0x1dc)]({'sqlCode':_0x1d810b['sqlCode'],'sqlName':_0x1d810b[_0x4bd2d1(0x1f1)],'filePath':_0x4004c9,'status':_0x58dc30,'reason':_0x34cb21});}return{'method':_0x4bd2d1(0x1f8),'url':_0x4bd2d1(0x1f0),'body':{'appCode':_0x40a5b3[_0x4bd2d1(0x1f9)],'sqlCode':_0x40a5b3[_0x4bd2d1(0x1ce)](_0x4bd2d1(0x1bf))||null,'sqlName':_0x40a5b3['str'](_0x4bd2d1(0x1e0))||null,'files':_0x39d7b4},'description':'Would\x20pull\x20'+_0x39d7b4[_0x4bd2d1(0x1ee)]+_0x4bd2d1(0x1e2)+_0x4a7f9b['sqlRootDir']};},async 'execute'(_0x4fcb7f){const _0x131105=a121_0x45f068,_0x364d86=loadSqlProjectConfig(_0x4fcb7f[_0x131105(0x1f9)]),_0x1d4e17=await readSqlLockFile(_0x364d86['lockFilePath']),{lockData:_0x3558c4,appLock:_0x8bed3b}=ensureSqlLockScope(_0x1d4e17??createEmptySqlLock(),_0x364d86[_0x131105(0x1f9)],_0x364d86[_0x131105(0x1c0)],_0x131105(0x1e9)),_0xcc31c1=_0x4fcb7f['bool'](_0x131105(0x1d4)),_0x487b61=await fetchAllSqlQueries(_0x4fcb7f[_0x131105(0x1f9)],{'sqlCode':_0x4fcb7f['str'](_0x131105(0x1bf))||undefined,'sqlName':_0x4fcb7f['str'](_0x131105(0x1e0))||undefined});if(_0x487b61['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x19fdd8=[],_0x39eeec=[];for(const _0x45328e of _0x487b61){try{_0x19fdd8['push'](await ensureSqlContent(_0x45328e));}catch(_0x59cc5e){_0x39eeec[_0x131105(0x1dc)]({'sqlCode':_0x45328e[_0x131105(0x1c2)],'error':_0x59cc5e instanceof Error?_0x59cc5e[_0x131105(0x1e8)]:String(_0x59cc5e)});}}if(_0xcc31c1&&!_0x4fcb7f[_0x131105(0x1d9)]){let _0x198567=![];for(const _0x358942 of _0x19fdd8){const _0x49ce7=detectModeFromSql(_0x358942),_0x212e0c=_0x358942[_0x131105(0x1eb)]?await getDbName(_0x4fcb7f['appCode'],Number(_0x358942['dbId']))[_0x131105(0x1d3)](()=>undefined):undefined,_0x45fd7d=buildLocalSqlFileContent({'sqlCode':_0x358942[_0x131105(0x1c2)],'sqlName':_0x358942[_0x131105(0x1f1)],'dbId':_0x358942['dbId']},ensureRemoteSqlContent(_0x358942),{'dbName':_0x212e0c,'mode':_0x49ce7,'syncedAt':new Date()['toISOString'](),'description':_0x358942[_0x131105(0x1e1)]}),_0x56afe1=resolveLocalSqlFilePath(_0x364d86,_0x358942[_0x131105(0x1c2)],buildSqlLockEntry(_0x358942,ensureRemoteSqlContent(_0x358942),'',{'dbName':_0x212e0c}));if(await fileExists(_0x56afe1)){const _0x506804=await readFile(_0x56afe1,_0x131105(0x1c7));if(!isEquivalentPulledSqlFile(_0x506804,_0x45fd7d,_0x49ce7)){_0x198567=!![];break;}}}if(_0x198567){const _0x2128be=await confirmForceOverwrite(_0x131105(0x1d2));if(!_0x2128be)throw CliErrors[_0x131105(0x1f2)](_0x131105(0x1fb));}}const _0x40e0a7=cloneSqlLockData(_0x3558c4),_0x8d3890=_0x40e0a7[_0x131105(0x1c9)][_0x364d86['appCode']],_0x34bd14=[],_0x223a12=[];for(const _0xa525bd of _0x19fdd8){const _0x203718=_0x8d3890[_0x131105(0x1c5)][_0xa525bd[_0x131105(0x1c2)]],_0x5c6ec2=ensureRemoteSqlContent(_0xa525bd),_0x3c9b05=detectModeFromSql(_0xa525bd),_0x282cae=_0xa525bd[_0x131105(0x1eb)]?await getDbName(_0x4fcb7f[_0x131105(0x1f9)],Number(_0xa525bd[_0x131105(0x1eb)]))[_0x131105(0x1d3)](()=>undefined):undefined,_0x33adc2=buildLocalSqlFileContent({'sqlCode':_0xa525bd['sqlCode'],'sqlName':_0xa525bd[_0x131105(0x1f1)],'dbId':_0xa525bd[_0x131105(0x1eb)]},_0x5c6ec2,{'dbName':_0x282cae,'mode':_0x3c9b05,'syncedAt':new Date()[_0x131105(0x1d7)](),'description':_0xa525bd['description']}),_0x13687e=buildSqlLockEntry(_0xa525bd,_0x5c6ec2,computeSqlContentHash(_0x33adc2),{'dbName':_0x282cae}),_0x1000db=_0x13687e[_0x131105(0x1d6)],_0xd53fba=join(_0x364d86[_0x131105(0x1f7)],_0x1000db);try{if(await fileExists(_0xd53fba)){const _0xa2e28f=await readFile(_0xd53fba,'utf8');if(isEquivalentPulledSqlFile(_0xa2e28f,_0x33adc2,_0x3c9b05)){_0x223a12[_0x131105(0x1dc)]({'sqlCode':_0xa525bd[_0x131105(0x1c2)],'reason':_0x131105(0x1c8)}),_0x8d3890['sqls'][_0xa525bd[_0x131105(0x1c2)]]={..._0x13687e,'hash':computeSqlContentHash(_0xa2e28f),'path':_0x1000db};continue;}if(!_0xcc31c1){_0x223a12['push']({'sqlCode':_0xa525bd['sqlCode'],'reason':_0x131105(0x1cc)});continue;}}const _0x29c60f=_0x203718?.[_0x131105(0x1d6)]?join(_0x364d86[_0x131105(0x1f7)],_0x203718[_0x131105(0x1d6)]):undefined;_0x29c60f&&_0x29c60f!==_0xd53fba&&await fileExists(_0x29c60f)&&await rm(_0x29c60f,{'force':!![]}),await ensureParentDirectory(_0xd53fba),await writeFile(_0xd53fba,_0x33adc2,_0x131105(0x1c7)),_0x8d3890[_0x131105(0x1c5)][_0xa525bd[_0x131105(0x1c2)]]={..._0x13687e,'path':_0x1000db},_0x34bd14[_0x131105(0x1dc)]({'sqlCode':_0xa525bd[_0x131105(0x1c2)],'filePath':_0xd53fba});}catch(_0x7cdb35){_0x39eeec['push']({'sqlCode':_0xa525bd[_0x131105(0x1c2)],'error':_0x7cdb35 instanceof Error?_0x7cdb35['message']:String(_0x7cdb35)});}}return _0x8d3890[_0x131105(0x1cd)]=new Date()[_0x131105(0x1d7)](),await writeSqlLockFile(_0x364d86[_0x131105(0x1f6)],_0x40e0a7),{'ok':_0x39eeec['length']===0x0,'data':{'pulled':_0x34bd14,'skipped':_0x223a12,'failed':_0x39eeec},'message':_0x131105(0x1f3)+_0x34bd14[_0x131105(0x1ee)]+_0x131105(0x1e4)+_0x223a12[_0x131105(0x1ee)]+_0x131105(0x1ec)+_0x39eeec['length']+_0x131105(0x1bd)};}};function detectModeFromSql(_0xd5d92e){const _0x15890=a121_0x45f068,_0x13b902=ensureRemoteSqlContent(_0xd5d92e),_0x212983=stripLocalSqlMetadata(_0x13b902,'mybatisXml')[_0x15890(0x1e7)]();if(/^<(select|insert|update|delete)\b/i[_0x15890(0x1e5)](_0x212983))return _0x15890(0x1de);return _0x15890(0x1c4);}function isEquivalentPulledSqlFile(_0x75d79a,_0x383db1,_0x1fb67d){return normalizePullComparableContent(_0x75d79a,_0x1fb67d)===normalizePullComparableContent(_0x383db1,_0x1fb67d);}function normalizePullComparableContent(_0x5258a7,_0x34c593){const _0x53d020=a121_0x45f068,_0x48bbec=_0x5258a7[_0x53d020(0x1f4)](/\r\n/g,'\x0a')[_0x53d020(0x1e3)]('\x0a'),_0x577147=_0x48bbec[_0x53d020(0x1da)](_0x349b7f=>!isSyncedAtMetadataLine(_0x349b7f,_0x34c593));return _0x577147[_0x53d020(0x1d5)]('\x0a');}function a121_0x5503(){const _0x56cfc1=['sql','sqls','Force\x20overwrite\x20local\x20unsynced\x20changes','utf8','unchanged','apps','tableData','1296445iqTCbW','local\x20differs\x20from\x20remote','lastSync','str','Filter\x20by\x20SQL\x20display\x20name','11605320CLjrTC','386860bsKpLQ','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','catch','force','join','path','toISOString','77394VOlEVi','nonInteractive','filter','boolean','push','conflict','mybatisXml','skipped','name','description','\x20SQL\x20file(s)\x20into\x20','split','\x20written,\x20','test','string','trimStart','message','pull','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','dbId','\x20skipped,\x20','would_pull','length','679392pVyGEd','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqlName','cancelled','Pull\x20complete:\x20','replace','74214eeqAxi','lockFilePath','sqlRootDir','POST','appCode','51556wMvmVa','Force\x20pull\x20cancelled.','\x20failed','40EbKoHo','sqlcode','sqlRoot','sqlContent','sqlCode','21FGGYua'];a121_0x5503=function(){return _0x56cfc1;};return a121_0x5503();}function isSyncedAtMetadataLine(_0x580699,_0x33a240){const _0x12c531=a121_0x45f068;if(_0x33a240===_0x12c531(0x1de))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x12c531(0x1e5)](_0x580699);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x12c531(0x1e5)](_0x580699);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a122_0x282861=a122_0x1326;(function(_0x15ff88,_0x5e5760){const _0x2f190d=a122_0x1326,_0x5b8b2e=_0x15ff88();while(!![]){try{const _0x2fa933=parseInt(_0x2f190d(0x1d0))/0x1*(parseInt(_0x2f190d(0x1b4))/0x2)+parseInt(_0x2f190d(0x1b1))/0x3*(-parseInt(_0x2f190d(0x1bc))/0x4)+parseInt(_0x2f190d(0x1a3))/0x5*(parseInt(_0x2f190d(0x1d5))/0x6)+parseInt(_0x2f190d(0x1c6))/0x7+-parseInt(_0x2f190d(0x19e))/0x8*(-parseInt(_0x2f190d(0x1cd))/0x9)+-parseInt(_0x2f190d(0x19d))/0xa+-parseInt(_0x2f190d(0x1bf))/0xb;if(_0x2fa933===_0x5e5760)break;else _0x5b8b2e['push'](_0x5b8b2e['shift']());}catch(_0x14fdbc){_0x5b8b2e['push'](_0x5b8b2e['shift']());}}}(a122_0x56dc,0xba4f3));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';function a122_0x56dc(){const _0x391e23=['force','39ZDTqQo','unchanged','validation','6TUauKs','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','Would\x20push\x20','message','relativePath','lastSync','path','filter','340808ZclKUs','set','lockFilePath','6040452rIElww','bool','sqlRootDir','version','Local\x20SQL\x20not\x20found:\x20','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','dbName','1329328jSGdFT','dbDirectory','sqlName','appCode','No\x20database\x20matches\x20local\x20directory\x20\x22','sqlCode','mode','9KndvpS','remoteId','dbId','92212ttSubs','\x20SQL\x20file(s)','replace','toISOString','Push\x20complete:\x20','150XzuNdd','sqlcode','trashDir','push','\x20skipped,\x20','hash','\x20pushed,\x20','3765070JQLkvc','10357784NGhHFB','filePath','boolean','sql','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','207025Dluopj','\x22\x20for\x20sqlCode\x20','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','/smartapi/custom/updateUserCustomSql','utf8','sqls','has','get','str','length','sqlConfig','POST','sqlRoot'];a122_0x56dc=function(){return _0x391e23;};return a122_0x56dc();}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x5ea487,_0x1f656f,_0x7f2780){const _0x5f0b36=a122_0x1326,_0x291963=await scanLocalSqlQueries(_0x5ea487),_0x274825=new Map();for(const _0x267858 of _0x291963){if(_0x7f2780&&_0x267858['sqlCode']!==_0x7f2780)continue;const _0x560b9c=_0x274825[_0x5f0b36(0x1aa)](_0x267858[_0x5f0b36(0x1cb)])??[];_0x560b9c[_0x5f0b36(0x1d8)](_0x267858),_0x274825[_0x5f0b36(0x1bd)](_0x267858[_0x5f0b36(0x1cb)],_0x560b9c);}if(_0x7f2780&&!_0x274825[_0x5f0b36(0x1a9)](_0x7f2780))throw CliErrors['validation'](_0x5f0b36(0x1c3)+_0x7f2780);const _0x5ef86d=[];for(const [_0x10aae8,_0x191f8f]of _0x274825['entries']()){if(_0x191f8f[_0x5f0b36(0x1ac)]===0x1){_0x5ef86d[_0x5f0b36(0x1d8)](_0x191f8f[0x0]);continue;}const _0x26f993=_0x1f656f[_0x5f0b36(0x1a8)][_0x10aae8],_0x79c2df=_0x26f993?.['path'],_0x262fee=_0x79c2df?_0x191f8f[_0x5f0b36(0x1bb)](_0x520b81=>_0x520b81['relativePath']!==_0x79c2df):_0x191f8f;if(_0x26f993&&_0x262fee[_0x5f0b36(0x1ac)]===0x1){_0x5ef86d[_0x5f0b36(0x1d8)](_0x262fee[0x0]);continue;}throw CliErrors[_0x5f0b36(0x1b3)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x10aae8+_0x5f0b36(0x1a5));}return _0x5ef86d;}export const sqlPush={'service':a122_0x282861(0x1a1),'command':a122_0x282861(0x1d8),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':'high-risk-write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a122_0x282861(0x1b0),'type':a122_0x282861(0x1a0),'description':a122_0x282861(0x1c4)}],async 'dryRun'(_0x4041a5){const _0x2de754=a122_0x282861,_0x488f99=loadSqlProjectConfig(_0x4041a5['appCode']),_0x30c6ee=await readSqlLockFile(_0x488f99[_0x2de754(0x1be)]),{appLock:_0x2a8bc5}=ensureSqlLockScope(_0x30c6ee??createEmptySqlLock(),_0x4041a5['appCode'],_0x488f99[_0x2de754(0x1af)],_0x2de754(0x1d8)),_0x5c1eb3=await getTargetSqlQueries(_0x488f99,_0x2a8bc5,_0x4041a5[_0x2de754(0x1ab)](_0x2de754(0x1d6))||undefined),_0x3e16be=[];for(const _0x24a784 of _0x5c1eb3){const _0x163f7a=await computeSqlFileHash(_0x24a784[_0x2de754(0x19f)]),_0xc1c69d=_0x2a8bc5[_0x2de754(0x1a8)][_0x24a784[_0x2de754(0x1cb)]],_0x2f8d4b=!!_0xc1c69d&&(_0xc1c69d[_0x2de754(0x1ba)]!==_0x24a784[_0x2de754(0x1b8)]||!!_0x24a784['sqlName']&&_0xc1c69d[_0x2de754(0x1c8)]!==_0x24a784[_0x2de754(0x1c8)]);if(!_0x4041a5['bool'](_0x2de754(0x1b0))&&_0xc1c69d&&_0xc1c69d['hash']===_0x163f7a&&!_0x2f8d4b)continue;_0x3e16be[_0x2de754(0x1d8)](_0x24a784[_0x2de754(0x1cb)]);}return{'method':_0x2de754(0x1ae),'url':_0x2de754(0x1a6),'body':{'sqlCodes':_0x3e16be,'appCode':_0x4041a5['appCode']},'description':_0x2de754(0x1b6)+_0x3e16be[_0x2de754(0x1ac)]+_0x2de754(0x1d1)};},async 'execute'(_0x2c4c18){const _0xcf602=a122_0x282861,_0x2fb0ad=loadSqlProjectConfig(_0x2c4c18[_0xcf602(0x1c9)]),_0x1f6d4b=await readSqlLockFile(_0x2fb0ad[_0xcf602(0x1be)]),{lockData:_0x318068,appLock:_0x26f09b}=ensureSqlLockScope(_0x1f6d4b??createEmptySqlLock(),_0x2c4c18[_0xcf602(0x1c9)],_0x2fb0ad['sqlRoot'],_0xcf602(0x1d8)),_0x77cf14=await getTargetSqlQueries(_0x2fb0ad,_0x26f09b,_0x2c4c18[_0xcf602(0x1ab)]('sqlcode')||undefined);if(_0x77cf14[_0xcf602(0x1ac)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x215276=[],_0x33da16=[],_0x1eb4c6=[];for(const _0x48885c of _0x77cf14){const _0x3374b3=_0x26f09b[_0xcf602(0x1a8)][_0x48885c[_0xcf602(0x1cb)]];if(!_0x3374b3){_0x1eb4c6[_0xcf602(0x1d8)]({'sqlCode':_0x48885c[_0xcf602(0x1cb)],'error':_0xcf602(0x1a2)});continue;}try{const _0x40d2f2=await computeSqlFileHash(_0x48885c['filePath']),_0x5c7b48=_0x3374b3[_0xcf602(0x1ba)]!==_0x48885c[_0xcf602(0x1b8)]||!!_0x48885c[_0xcf602(0x1c8)]&&_0x3374b3[_0xcf602(0x1c8)]!==_0x48885c[_0xcf602(0x1c8)];if(!_0x2c4c18[_0xcf602(0x1c0)](_0xcf602(0x1b0))&&_0x3374b3[_0xcf602(0x19b)]===_0x40d2f2&&!_0x5c7b48){_0x33da16[_0xcf602(0x1d8)]({'sqlCode':_0x48885c[_0xcf602(0x1cb)],'reason':_0xcf602(0x1b2)});continue;}if(_0x3374b3[_0xcf602(0x1c2)]==null){_0x1eb4c6[_0xcf602(0x1d8)]({'sqlCode':_0x48885c[_0xcf602(0x1cb)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x50850e=await readFile(_0x48885c[_0xcf602(0x19f)],_0xcf602(0x1a7)),_0x15b87b=stripLocalSqlMetadata(_0x50850e,_0x48885c[_0xcf602(0x1cc)]),_0x5d896a=_0x48885c[_0xcf602(0x1c8)]||_0x3374b3[_0xcf602(0x1c8)],_0x1f9a3d=await resolveTargetDbBinding(_0x2c4c18['appCode'],_0x48885c,_0x3374b3),_0x393ddc=await updateSqlQuery({'id':_0x3374b3[_0xcf602(0x1ce)],'appCode':_0x2c4c18[_0xcf602(0x1c9)],'sqlCode':_0x48885c[_0xcf602(0x1cb)],'sqlName':_0x5d896a,'dbId':_0x1f9a3d[_0xcf602(0x1cf)],'version':_0x3374b3['version'],'sqlContent':_0x15b87b,'sqlConfig':_0x3374b3[_0xcf602(0x1ad)]??undefined}),_0x5f092c=_0x393ddc[_0xcf602(0x1cf)]?await getDbName(_0x2c4c18['appCode'],Number(_0x393ddc[_0xcf602(0x1cf)]))['catch'](()=>_0x1f9a3d['dbName']):_0x1f9a3d[_0xcf602(0x1c5)];_0x26f09b[_0xcf602(0x1a8)][_0x48885c[_0xcf602(0x1cb)]]={...buildSqlLockEntry(_0x393ddc,_0x15b87b,_0x40d2f2,{'dbName':_0x5f092c}),'path':_0x48885c[_0xcf602(0x1b8)],'mode':_0x3374b3[_0xcf602(0x1cc)]},await archivePreviousSqlFileIfNeeded(_0x2fb0ad,_0x3374b3[_0xcf602(0x1ba)],_0x48885c['relativePath']),_0x215276[_0xcf602(0x1d8)]({'sqlCode':_0x48885c['sqlCode'],'remoteId':_0x3374b3['remoteId']});}catch(_0x49537a){_0x1eb4c6['push']({'sqlCode':_0x48885c[_0xcf602(0x1cb)],'error':_0x49537a instanceof Error?_0x49537a[_0xcf602(0x1b7)]:String(_0x49537a)});}}return _0x26f09b[_0xcf602(0x1b9)]=new Date()[_0xcf602(0x1d3)](),await writeSqlLockFile(_0x2fb0ad['lockFilePath'],_0x318068),{'ok':_0x1eb4c6['length']===0x0,'data':{'pushed':_0x215276,'skipped':_0x33da16,'failed':_0x1eb4c6},'message':_0xcf602(0x1d4)+_0x215276[_0xcf602(0x1ac)]+_0xcf602(0x19c)+_0x33da16[_0xcf602(0x1ac)]+_0xcf602(0x19a)+_0x1eb4c6[_0xcf602(0x1ac)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x15f991,_0x31bfd7,_0x55ff0f){const _0x3e6d06=a122_0x282861;if(!_0x31bfd7||_0x31bfd7===_0x55ff0f)return;const _0x3e9758=join(_0x15f991[_0x3e6d06(0x1c1)],_0x31bfd7);if(!await fileExists(_0x3e9758))return;const _0x1f2bbc=await moveToTrash(_0x15f991['projectRoot'],_0x15f991[_0x3e6d06(0x1d7)],_0x3e9758);await cleanupEmptyDirectories(dirname(_0x3e9758),_0x15f991[_0x3e6d06(0x1c1)]),void _0x1f2bbc;}async function moveToTrash(_0x5f399d,_0x5894f4,_0x26aa71){const _0x5ad3e9=a122_0x282861,_0x226eab=new Date()[_0x5ad3e9(0x1d3)]()[_0x5ad3e9(0x1d2)](/[:.]/g,'-'),_0x4d1dde=relative(_0x5f399d,_0x26aa71),_0x13b13f=join(_0x5894f4,_0x226eab,_0x4d1dde);return await mkdir(dirname(_0x13b13f),{'recursive':!![]}),await rename(_0x26aa71,_0x13b13f),_0x13b13f;}async function cleanupEmptyDirectories(_0x9c2444,_0x551592){const _0x41cd0e=a122_0x282861;let _0xace721=resolve(_0x9c2444);const _0x41e1cd=resolve(_0x551592);while(_0xace721['startsWith'](''+_0x41e1cd+sep)||_0xace721===_0x41e1cd){if(_0xace721===_0x41e1cd)return;try{const _0x23e410=await readdir(_0xace721);if(_0x23e410[_0x41cd0e(0x1ac)]>0x0)return;await rmdir(_0xace721);}catch{return;}_0xace721=dirname(_0xace721);}}function a122_0x1326(_0x4b1eee,_0x3e516a){_0x4b1eee=_0x4b1eee-0x19a;const _0x56dcef=a122_0x56dc();let _0x1326b9=_0x56dcef[_0x4b1eee];return _0x1326b9;}async function resolveTargetDbBinding(_0xdeb861,_0x17742d,_0x7809e3){const _0x2efc47=a122_0x282861,_0x5e900c=_0x17742d[_0x2efc47(0x1c7)];if(!_0x5e900c)return{'dbId':_0x7809e3[_0x2efc47(0x1cf)],'dbName':_0x7809e3[_0x2efc47(0x1c5)]};const _0xee7f99=buildDbDirectoryName(_0x7809e3[_0x2efc47(0x1c5)],_0x7809e3[_0x2efc47(0x1cf)]);if(_0x5e900c===_0xee7f99)return{'dbId':_0x7809e3[_0x2efc47(0x1cf)],'dbName':_0x7809e3[_0x2efc47(0x1c5)]};const _0x37cb0e=parseExplicitDbDirectory(_0x5e900c);if(_0x37cb0e!=null)return{'dbId':_0x37cb0e,'dbName':await getDbName(_0xdeb861,_0x37cb0e)['catch'](()=>undefined)};const _0x27a24f=await listDatabases(_0xdeb861),_0x204280=_0x27a24f[_0x2efc47(0x1bb)](_0x7f4ba4=>buildDbDirectoryName(_0x7f4ba4[_0x2efc47(0x1c5)],_0x7f4ba4[_0x2efc47(0x1cf)])===_0x5e900c);if(_0x204280[_0x2efc47(0x1ac)]===0x1)return{'dbId':_0x204280[0x0][_0x2efc47(0x1cf)],'dbName':_0x204280[0x0][_0x2efc47(0x1c5)]};if(_0x204280[_0x2efc47(0x1ac)]===0x0)throw CliErrors[_0x2efc47(0x1b3)](_0x2efc47(0x1ca)+_0x5e900c+_0x2efc47(0x1a4)+_0x17742d[_0x2efc47(0x1cb)]+'.');const _0x1bd0cd=_0x204280['map'](_0x4a57fb=>_0x4a57fb[_0x2efc47(0x1c5)]+'\x20('+_0x4a57fb[_0x2efc47(0x1cf)]+')')['join'](',\x20');throw CliErrors[_0x2efc47(0x1b3)]('Local\x20directory\x20\x22'+_0x5e900c+_0x2efc47(0x1b5)+_0x17742d[_0x2efc47(0x1cb)]+':\x20'+_0x1bd0cd);}function parseExplicitDbDirectory(_0x17a0cc){const _0x5c0c56=/^db-(\d+)$/['exec'](_0x17a0cc);if(!_0x5c0c56)return null;const _0x37d2c2=Number(_0x5c0c56[0x1]);return Number['isFinite'](_0x37d2c2)&&_0x37d2c2>0x0?_0x37d2c2:null;}
|
|
1
|
+
const a122_0x1d17ce=a122_0x2ed9;(function(_0x54bd38,_0x3df456){const _0x348156=a122_0x2ed9,_0x598fdd=_0x54bd38();while(!![]){try{const _0xa7041a=-parseInt(_0x348156(0x17f))/0x1*(-parseInt(_0x348156(0x18c))/0x2)+parseInt(_0x348156(0x180))/0x3+-parseInt(_0x348156(0x1a8))/0x4*(parseInt(_0x348156(0x173))/0x5)+parseInt(_0x348156(0x171))/0x6+-parseInt(_0x348156(0x17d))/0x7+parseInt(_0x348156(0x1b0))/0x8*(parseInt(_0x348156(0x177))/0x9)+-parseInt(_0x348156(0x1ae))/0xa;if(_0xa7041a===_0x3df456)break;else _0x598fdd['push'](_0x598fdd['shift']());}catch(_0x21062a){_0x598fdd['push'](_0x598fdd['shift']());}}}(a122_0x1578,0x9b3e7));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';function a122_0x2ed9(_0x1f4dde,_0x25c482){_0x1f4dde=_0x1f4dde-0x171;const _0x157856=a122_0x1578();let _0x2ed9ba=_0x157856[_0x1f4dde];return _0x2ed9ba;}import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';function a122_0x1578(){const _0x1fb071=['exec','2KOnCql','sqlcode','/smartapi/custom/updateUserCustomSql','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','Push\x20complete:\x20','lockFilePath','dbDirectory','dbName','filePath','get','\x20skipped,\x20','entries','force','utf8','sql','sqlCode','\x20SQL\x20file(s)','boolean','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','hash','catch','Push\x20local\x20SQL\x20files\x20to\x20remote','Would\x20push\x20','Local\x20SQL\x20not\x20found:\x20','push','sqlConfig','sqlName','\x20pushed,\x20','268hrVzhx','POST','version','\x22\x20for\x20sqlCode\x20','mode','length','1790490DeutmS','validation','8GNIdga','relativePath','lastSync','filter','5515548ujRrLA','No\x20database\x20matches\x20local\x20directory\x20\x22','90860jRTalA','sqlRoot','join','path','1023525YmJeNN','map','str','sqls','isFinite','trashDir','358064PVzvyP','projectRoot','747596zQoXck','909075xHZsBd','set','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','has','dbId','appCode','bool','Local\x20directory\x20\x22','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','remoteId','toISOString'];a122_0x1578=function(){return _0x1fb071;};return a122_0x1578();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x4541ca,_0x1e6ac9,_0x80a1c1){const _0x53b85d=a122_0x2ed9,_0x5921b0=await scanLocalSqlQueries(_0x4541ca),_0x213960=new Map();for(const _0x4fc439 of _0x5921b0){if(_0x80a1c1&&_0x4fc439[_0x53b85d(0x19b)]!==_0x80a1c1)continue;const _0x11be9a=_0x213960[_0x53b85d(0x195)](_0x4fc439[_0x53b85d(0x19b)])??[];_0x11be9a[_0x53b85d(0x1a4)](_0x4fc439),_0x213960[_0x53b85d(0x181)](_0x4fc439[_0x53b85d(0x19b)],_0x11be9a);}if(_0x80a1c1&&!_0x213960[_0x53b85d(0x183)](_0x80a1c1))throw CliErrors[_0x53b85d(0x1af)](_0x53b85d(0x1a3)+_0x80a1c1);const _0x481047=[];for(const [_0x241dbf,_0x1b2b87]of _0x213960[_0x53b85d(0x197)]()){if(_0x1b2b87[_0x53b85d(0x1ad)]===0x1){_0x481047[_0x53b85d(0x1a4)](_0x1b2b87[0x0]);continue;}const _0x2fa8ce=_0x1e6ac9[_0x53b85d(0x17a)][_0x241dbf],_0x12022f=_0x2fa8ce?.[_0x53b85d(0x176)],_0x398c0a=_0x12022f?_0x1b2b87[_0x53b85d(0x1b3)](_0xa01104=>_0xa01104[_0x53b85d(0x1b1)]!==_0x12022f):_0x1b2b87;if(_0x2fa8ce&&_0x398c0a[_0x53b85d(0x1ad)]===0x1){_0x481047[_0x53b85d(0x1a4)](_0x398c0a[0x0]);continue;}throw CliErrors[_0x53b85d(0x1af)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x241dbf+_0x53b85d(0x18f));}return _0x481047;}export const sqlPush={'service':a122_0x1d17ce(0x19a),'command':a122_0x1d17ce(0x1a4),'description':a122_0x1d17ce(0x1a1),'risk':'high-risk-write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a122_0x1d17ce(0x19d),'description':a122_0x1d17ce(0x19e)}],async 'dryRun'(_0x4777f8){const _0x526c5d=a122_0x1d17ce,_0x3843a9=loadSqlProjectConfig(_0x4777f8[_0x526c5d(0x185)]),_0x215202=await readSqlLockFile(_0x3843a9[_0x526c5d(0x191)]),{appLock:_0x451546}=ensureSqlLockScope(_0x215202??createEmptySqlLock(),_0x4777f8[_0x526c5d(0x185)],_0x3843a9[_0x526c5d(0x174)],'push'),_0xfe2346=await getTargetSqlQueries(_0x3843a9,_0x451546,_0x4777f8[_0x526c5d(0x179)](_0x526c5d(0x18d))||undefined),_0x55f317=[];for(const _0x104506 of _0xfe2346){const _0x2a22a7=await computeSqlFileHash(_0x104506[_0x526c5d(0x194)]),_0x26fe9b=_0x451546[_0x526c5d(0x17a)][_0x104506[_0x526c5d(0x19b)]],_0x42bb07=!!_0x26fe9b&&(_0x26fe9b[_0x526c5d(0x176)]!==_0x104506[_0x526c5d(0x1b1)]||!!_0x104506['sqlName']&&_0x26fe9b[_0x526c5d(0x1a6)]!==_0x104506['sqlName']);if(!_0x4777f8[_0x526c5d(0x186)](_0x526c5d(0x198))&&_0x26fe9b&&_0x26fe9b[_0x526c5d(0x19f)]===_0x2a22a7&&!_0x42bb07)continue;_0x55f317['push'](_0x104506[_0x526c5d(0x19b)]);}return{'method':_0x526c5d(0x1a9),'url':_0x526c5d(0x18e),'body':{'sqlCodes':_0x55f317,'appCode':_0x4777f8[_0x526c5d(0x185)]},'description':_0x526c5d(0x1a2)+_0x55f317[_0x526c5d(0x1ad)]+_0x526c5d(0x19c)};},async 'execute'(_0x28fa2a){const _0x4b7c76=a122_0x1d17ce,_0x2e4b5d=loadSqlProjectConfig(_0x28fa2a[_0x4b7c76(0x185)]),_0x214e30=await readSqlLockFile(_0x2e4b5d[_0x4b7c76(0x191)]),{lockData:_0x13b5bf,appLock:_0x4dcbf8}=ensureSqlLockScope(_0x214e30??createEmptySqlLock(),_0x28fa2a[_0x4b7c76(0x185)],_0x2e4b5d[_0x4b7c76(0x174)],_0x4b7c76(0x1a4)),_0x10be4a=await getTargetSqlQueries(_0x2e4b5d,_0x4dcbf8,_0x28fa2a['str'](_0x4b7c76(0x18d))||undefined);if(_0x10be4a[_0x4b7c76(0x1ad)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x4e24c9=[],_0xb14565=[],_0x326a8b=[];for(const _0x44b07a of _0x10be4a){const _0x33018a=_0x4dcbf8[_0x4b7c76(0x17a)][_0x44b07a[_0x4b7c76(0x19b)]];if(!_0x33018a){_0x326a8b[_0x4b7c76(0x1a4)]({'sqlCode':_0x44b07a[_0x4b7c76(0x19b)],'error':_0x4b7c76(0x188)});continue;}try{const _0x221e8e=await computeSqlFileHash(_0x44b07a[_0x4b7c76(0x194)]),_0x24083b=_0x33018a[_0x4b7c76(0x176)]!==_0x44b07a[_0x4b7c76(0x1b1)]||!!_0x44b07a[_0x4b7c76(0x1a6)]&&_0x33018a[_0x4b7c76(0x1a6)]!==_0x44b07a['sqlName'];if(!_0x28fa2a[_0x4b7c76(0x186)]('force')&&_0x33018a[_0x4b7c76(0x19f)]===_0x221e8e&&!_0x24083b){_0xb14565[_0x4b7c76(0x1a4)]({'sqlCode':_0x44b07a['sqlCode'],'reason':'unchanged'});continue;}if(_0x33018a[_0x4b7c76(0x1aa)]==null){_0x326a8b['push']({'sqlCode':_0x44b07a[_0x4b7c76(0x19b)],'error':_0x4b7c76(0x182)});continue;}const _0x4f4423=await readFile(_0x44b07a['filePath'],_0x4b7c76(0x199)),_0x2996f3=stripLocalSqlMetadata(_0x4f4423,_0x44b07a[_0x4b7c76(0x1ac)]),_0x1b07c2=_0x44b07a[_0x4b7c76(0x1a6)]||_0x33018a[_0x4b7c76(0x1a6)],_0x20b941=await resolveTargetDbBinding(_0x28fa2a[_0x4b7c76(0x185)],_0x44b07a,_0x33018a),_0x1b25c3=await updateSqlQuery({'id':_0x33018a['remoteId'],'appCode':_0x28fa2a[_0x4b7c76(0x185)],'sqlCode':_0x44b07a[_0x4b7c76(0x19b)],'sqlName':_0x1b07c2,'dbId':_0x20b941[_0x4b7c76(0x184)],'version':_0x33018a[_0x4b7c76(0x1aa)],'sqlContent':_0x2996f3,'sqlConfig':_0x33018a[_0x4b7c76(0x1a5)]??undefined}),_0xbd2de9=_0x1b25c3['dbId']?await getDbName(_0x28fa2a[_0x4b7c76(0x185)],Number(_0x1b25c3[_0x4b7c76(0x184)]))[_0x4b7c76(0x1a0)](()=>_0x20b941['dbName']):_0x20b941[_0x4b7c76(0x193)];_0x4dcbf8[_0x4b7c76(0x17a)][_0x44b07a['sqlCode']]={...buildSqlLockEntry(_0x1b25c3,_0x2996f3,_0x221e8e,{'dbName':_0xbd2de9}),'path':_0x44b07a['relativePath'],'mode':_0x33018a['mode']},await archivePreviousSqlFileIfNeeded(_0x2e4b5d,_0x33018a[_0x4b7c76(0x176)],_0x44b07a['relativePath']),_0x4e24c9[_0x4b7c76(0x1a4)]({'sqlCode':_0x44b07a['sqlCode'],'remoteId':_0x33018a[_0x4b7c76(0x189)]});}catch(_0x43ddbb){_0x326a8b[_0x4b7c76(0x1a4)]({'sqlCode':_0x44b07a[_0x4b7c76(0x19b)],'error':_0x43ddbb instanceof Error?_0x43ddbb['message']:String(_0x43ddbb)});}}return _0x4dcbf8[_0x4b7c76(0x1b2)]=new Date()[_0x4b7c76(0x18a)](),await writeSqlLockFile(_0x2e4b5d[_0x4b7c76(0x191)],_0x13b5bf),{'ok':_0x326a8b['length']===0x0,'data':{'pushed':_0x4e24c9,'skipped':_0xb14565,'failed':_0x326a8b},'message':_0x4b7c76(0x190)+_0x4e24c9[_0x4b7c76(0x1ad)]+_0x4b7c76(0x1a7)+_0xb14565[_0x4b7c76(0x1ad)]+_0x4b7c76(0x196)+_0x326a8b['length']+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x124ebd,_0x3fff62,_0x3f5b26){const _0x2e971a=a122_0x1d17ce;if(!_0x3fff62||_0x3fff62===_0x3f5b26)return;const _0x1b376e=join(_0x124ebd['sqlRootDir'],_0x3fff62);if(!await fileExists(_0x1b376e))return;const _0x22d91f=await moveToTrash(_0x124ebd[_0x2e971a(0x17e)],_0x124ebd[_0x2e971a(0x17c)],_0x1b376e);await cleanupEmptyDirectories(dirname(_0x1b376e),_0x124ebd['sqlRootDir']),void _0x22d91f;}async function moveToTrash(_0x8438ba,_0x3685c8,_0x2c0310){const _0x5bfac0=a122_0x1d17ce,_0x51b80f=new Date()[_0x5bfac0(0x18a)]()['replace'](/[:.]/g,'-'),_0x113c80=relative(_0x8438ba,_0x2c0310),_0x397688=join(_0x3685c8,_0x51b80f,_0x113c80);return await mkdir(dirname(_0x397688),{'recursive':!![]}),await rename(_0x2c0310,_0x397688),_0x397688;}async function cleanupEmptyDirectories(_0x184414,_0x2cfad6){const _0x5c7051=a122_0x1d17ce;let _0x5872e3=resolve(_0x184414);const _0x17e23f=resolve(_0x2cfad6);while(_0x5872e3['startsWith'](''+_0x17e23f+sep)||_0x5872e3===_0x17e23f){if(_0x5872e3===_0x17e23f)return;try{const _0x2e03c1=await readdir(_0x5872e3);if(_0x2e03c1[_0x5c7051(0x1ad)]>0x0)return;await rmdir(_0x5872e3);}catch{return;}_0x5872e3=dirname(_0x5872e3);}}async function resolveTargetDbBinding(_0x14a143,_0x17ef1d,_0x516b67){const _0x1daed9=a122_0x1d17ce,_0x33dfa0=_0x17ef1d[_0x1daed9(0x192)];if(!_0x33dfa0)return{'dbId':_0x516b67['dbId'],'dbName':_0x516b67[_0x1daed9(0x193)]};const _0x1bad53=buildDbDirectoryName(_0x516b67[_0x1daed9(0x193)],_0x516b67[_0x1daed9(0x184)]);if(_0x33dfa0===_0x1bad53)return{'dbId':_0x516b67[_0x1daed9(0x184)],'dbName':_0x516b67['dbName']};const _0x42e028=parseExplicitDbDirectory(_0x33dfa0);if(_0x42e028!=null)return{'dbId':_0x42e028,'dbName':await getDbName(_0x14a143,_0x42e028)[_0x1daed9(0x1a0)](()=>undefined)};const _0x4c4764=await listDatabases(_0x14a143),_0xa141f6=_0x4c4764[_0x1daed9(0x1b3)](_0x47b22d=>buildDbDirectoryName(_0x47b22d['dbName'],_0x47b22d[_0x1daed9(0x184)])===_0x33dfa0);if(_0xa141f6[_0x1daed9(0x1ad)]===0x1)return{'dbId':_0xa141f6[0x0][_0x1daed9(0x184)],'dbName':_0xa141f6[0x0]['dbName']};if(_0xa141f6[_0x1daed9(0x1ad)]===0x0)throw CliErrors[_0x1daed9(0x1af)](_0x1daed9(0x172)+_0x33dfa0+_0x1daed9(0x1ab)+_0x17ef1d['sqlCode']+'.');const _0x56726e=_0xa141f6[_0x1daed9(0x178)](_0x42305c=>_0x42305c[_0x1daed9(0x193)]+'\x20('+_0x42305c[_0x1daed9(0x184)]+')')[_0x1daed9(0x175)](',\x20');throw CliErrors['validation'](_0x1daed9(0x187)+_0x33dfa0+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x17ef1d[_0x1daed9(0x19b)]+':\x20'+_0x56726e);}function parseExplicitDbDirectory(_0x43f686){const _0x233e43=a122_0x1d17ce,_0x36dca6=/^db-(\d+)$/[_0x233e43(0x18b)](_0x43f686);if(!_0x36dca6)return null;const _0x39b329=Number(_0x36dca6[0x1]);return Number[_0x233e43(0x17b)](_0x39b329)&&_0x39b329>0x0?_0x39b329:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a123_0x3e358d=a123_0x67f9;(function(_0x1c0285,_0x34e7f3){const _0x586c37=a123_0x67f9,_0x974d6d=_0x1c0285();while(!![]){try{const _0x42feab=parseInt(_0x586c37(0x134))/0x1*(parseInt(_0x586c37(0x11e))/0x2)+parseInt(_0x586c37(0x12e))/0x3*(parseInt(_0x586c37(0x121))/0x4)+-parseInt(_0x586c37(0x11f))/0x5+parseInt(_0x586c37(0x12c))/0x6+parseInt(_0x586c37(0x12d))/0x7+-parseInt(_0x586c37(0x122))/0x8*(parseInt(_0x586c37(0x126))/0x9)+-parseInt(_0x586c37(0x127))/0xa;if(_0x42feab===_0x34e7f3)break;else _0x974d6d['push'](_0x974d6d['shift']());}catch(_0xd2ab43){_0x974d6d['push'](_0x974d6d['shift']());}}}(a123_0x89c2,0x4cacd));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a123_0x89c2(){const _0x452f4e=['Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','validation','62apQWrZ','1688915ZEQUxA','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','220gJLszi','311656ZFiEaI','write','description','string','72zKDJly','4059440KNJzIj','SQL\x20query\x20display\x20name','sql','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','save','3027624MpunxJ','3492755bQfhvS','12018seKynZ','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','Query\x20description','Path\x20to\x20the\x20SQL\x20file','join','file','4695ZaWFUk'];a123_0x89c2=function(){return _0x452f4e;};return a123_0x89c2();}const SQL_SAVE_DEPRECATED_HINT=[a123_0x3e358d(0x12a),a123_0x3e358d(0x12f),'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`.'][a123_0x3e358d(0x132)]('\x0a');function a123_0x67f9(_0x2be915,_0x42fb9d){_0x2be915=_0x2be915-0x11c;const _0x89c264=a123_0x89c2();let _0x67f916=_0x89c264[_0x2be915];return _0x67f916;}export const sqlSave={'service':a123_0x3e358d(0x129),'command':a123_0x3e358d(0x12b),'description':a123_0x3e358d(0x11c),'risk':a123_0x3e358d(0x123),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a123_0x3e358d(0x133),'type':a123_0x3e358d(0x125),'required':!![],'description':a123_0x3e358d(0x131)},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':a123_0x3e358d(0x125),'description':a123_0x3e358d(0x128)},{'name':'db','type':a123_0x3e358d(0x125),'description':a123_0x3e358d(0x120)},{'name':a123_0x3e358d(0x124),'type':a123_0x3e358d(0x125),'description':a123_0x3e358d(0x130)}],async 'validate'(){const _0x2d3c32=a123_0x3e358d;throw CliErrors[_0x2d3c32(0x11d)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x2d1d4b=a123_0x3e358d;throw CliErrors[_0x2d1d4b(0x11d)](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a124_0x5ae1(_0x3cd677,_0x29b495){_0x3cd677=_0x3cd677-0xec;const _0x56d37a=a124_0x56d3();let _0x5ae178=_0x56d37a[_0x3cd677];return _0x5ae178;}const a124_0x1db453=a124_0x5ae1;(function(_0x373071,_0x234dc6){const _0x2c3d40=a124_0x5ae1,_0x30caa3=_0x373071();while(!![]){try{const _0x540783=-parseInt(_0x2c3d40(0xf0))/0x1+parseInt(_0x2c3d40(0xf5))/0x2+parseInt(_0x2c3d40(0xfb))/0x3*(parseInt(_0x2c3d40(0xfe))/0x4)+-parseInt(_0x2c3d40(0x114))/0x5*(-parseInt(_0x2c3d40(0x10d))/0x6)+parseInt(_0x2c3d40(0x111))/0x7*(-parseInt(_0x2c3d40(0xee))/0x8)+-parseInt(_0x2c3d40(0x10a))/0x9+-parseInt(_0x2c3d40(0x100))/0xa;if(_0x540783===_0x234dc6)break;else _0x30caa3['push'](_0x30caa3['shift']());}catch(_0x920ed1){_0x30caa3['push'](_0x30caa3['shift']());}}}(a124_0x56d3,0xe2423));import{createInterface}from'node:readline';import{join}from'node:path';function a124_0x56d3(){const _0x510516=['99822kjaLlR','join','length','lastSync','endsWith','3507650CyIEEH','stderr','mode','apps','path','sqlContent','117IRdAbr','toLowerCase','question','61956zGoIdG','sqlName','3423470zXzkjN','sqlRoot','trim','.rabetbase/sql','split','includes','\x20-->','yes','description','entries','13082382GmJuvb','syncedAt','--\x20@lovrabet.','1794TnxxRD','dbName','sqlCode','mybatisXml','435127mafuqs','\x20[y/N]\x20','close','17125JTtevO','test','filter','trimStart','version','<!--\x20@lovrabet.','replace','dbId','72QuWdTc','map'];a124_0x56d3=function(){return _0x510516;};return a124_0x56d3();}import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a124_0x1db453(0x103);export function buildSqlLockEntry(_0x1a45e8,_0x3f39ad,_0x559d14,_0x2a03ca){const _0x4bfd68=a124_0x1db453,_0x2294d4=detectSqlMode(_0x3f39ad);return{'path':buildSqlRelativePath(_0x1a45e8['sqlCode'],_0x1a45e8[_0x4bfd68(0xff)],_0x2a03ca?.[_0x4bfd68(0x10e)],_0x2294d4,_0x1a45e8[_0x4bfd68(0xed)]),'hash':_0x559d14,'remoteId':_0x1a45e8['id'],'version':_0x1a45e8[_0x4bfd68(0x118)],'dbId':Number(_0x1a45e8[_0x4bfd68(0xed)]),'dbName':_0x2a03ca?.[_0x4bfd68(0x10e)],'sqlName':_0x1a45e8['sqlName'],'sqlConfig':_0x1a45e8['sqlConfig']??undefined,'mode':_0x2294d4};}export function cloneSqlLockData(_0x2eb7a1){const _0x1dbe85=a124_0x1db453;return{'apps':Object['fromEntries'](Object[_0x1dbe85(0x109)](_0x2eb7a1[_0x1dbe85(0xf8)])[_0x1dbe85(0xef)](([_0x417db7,_0x220d6e])=>[_0x417db7,{'sqlRoot':_0x220d6e[_0x1dbe85(0x101)],'lastSync':_0x220d6e[_0x1dbe85(0xf3)],'sqls':{..._0x220d6e['sqls']}}]))};}export function ensureRemoteSqlContent(_0x2caf0f){const _0x3e7b77=a124_0x1db453;return _0x2caf0f[_0x3e7b77(0xfa)]??'';}export function buildLocalSqlFileContent(_0x35b341,_0x1e8d5f,_0x2b8bf6){const _0x18f4bc=a124_0x1db453,_0x452cfb=_0x2b8bf6?.['mode']??detectSqlMode(_0x1e8d5f),_0x1d2d16=stripLocalSqlMetadata(_0x1e8d5f,_0x452cfb)[_0x18f4bc(0x102)](),_0x17a00e=[...buildMetadataHeaderLines({'sqlCode':_0x35b341[_0x18f4bc(0x10f)],'sqlName':_0x35b341[_0x18f4bc(0xff)],'dbId':_0x35b341[_0x18f4bc(0xed)],'dbName':_0x2b8bf6?.[_0x18f4bc(0x10e)],'mode':_0x452cfb,'syncedAt':_0x2b8bf6?.['syncedAt'],'description':_0x2b8bf6?.[_0x18f4bc(0x108)]},_0x452cfb),'',_0x1d2d16],_0x288c03=_0x17a00e[_0x18f4bc(0xf1)]('\x0a');return _0x288c03[_0x18f4bc(0xf4)]('\x0a')?_0x288c03:_0x288c03+'\x0a';}export function stripLocalSqlMetadata(_0x3e4a25,_0x23ed13){const _0x5693fc=a124_0x1db453,_0x21e6cb=_0x3e4a25[_0x5693fc(0xec)](/\r\n/g,'\x0a')[_0x5693fc(0x104)]('\x0a'),_0x391f60=[];let _0x581eb0=0x0;if(_0x23ed13===_0x5693fc(0x110))while(_0x581eb0<_0x21e6cb[_0x5693fc(0xf2)]){const _0x13f442=_0x21e6cb[_0x581eb0]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x13f442)){_0x581eb0++;continue;}if(_0x13f442[_0x5693fc(0x102)]()===''&&_0x581eb0>0x0){_0x581eb0++;continue;}break;}else while(_0x581eb0<_0x21e6cb[_0x5693fc(0xf2)]){const _0xd8b623=_0x21e6cb[_0x581eb0]??'';if(/^\s*--\s*@lovrabet\./[_0x5693fc(0x115)](_0xd8b623)){_0x581eb0++;continue;}if(_0xd8b623[_0x5693fc(0x102)]()===''&&_0x581eb0>0x0){_0x581eb0++;continue;}break;}for(;_0x581eb0<_0x21e6cb[_0x5693fc(0xf2)];_0x581eb0++){_0x391f60['push'](_0x21e6cb[_0x581eb0]);}return _0x391f60[_0x5693fc(0xf1)]('\x0a')[_0x5693fc(0x117)]();}export function resolveSqlMode(_0x1aa151,_0x281b76){const _0x4a1a2a=a124_0x1db453;if(_0x281b76?.[_0x4a1a2a(0xf7)])return _0x281b76[_0x4a1a2a(0xf7)];return detectSqlMode(_0x1aa151);}export function resolveSqlFileName(_0x3f3ef8,_0x5438fd,_0x2b9788){const _0x20dfb5=a124_0x1db453;if(_0x2b9788?.['path'])return _0x2b9788[_0x20dfb5(0xf9)];if(_0x2b9788?.[_0x20dfb5(0xff)]||_0x2b9788?.[_0x20dfb5(0x10e)])return buildSqlRelativePath(_0x3f3ef8,_0x2b9788?.[_0x20dfb5(0xff)],_0x2b9788?.[_0x20dfb5(0x10e)],resolveSqlMode(_0x5438fd,_0x2b9788),_0x2b9788?.['dbId']);return buildDefaultSqlFileName(_0x3f3ef8,resolveSqlMode(_0x5438fd,_0x2b9788));}export function resolveSqlLocalDir(_0x40723e,_0xa0225e){return join(_0x40723e,SQL_LOCAL_REL_DIR,_0xa0225e);}export async function confirmForceOverwrite(_0x5bb0ce){const _0x311bca=a124_0x1db453,_0x3d89a7=createInterface({'input':process['stdin'],'output':process[_0x311bca(0xf6)]}),_0x2b226e=await new Promise(_0x551fa2=>{const _0x2a2ad2=_0x311bca;_0x3d89a7[_0x2a2ad2(0xfd)](_0x5bb0ce+_0x2a2ad2(0x112),_0x551fa2);});return _0x3d89a7[_0x311bca(0x113)](),['y',_0x311bca(0x107)][_0x311bca(0x105)](_0x2b226e[_0x311bca(0x102)]()[_0x311bca(0xfc)]());}export function findSqlLockScope(_0x21dc74,_0xcf618e){return _0x21dc74['apps'][_0xcf618e];}function buildMetadataHeaderLines(_0x4be044,_0x2ab915){const _0x3f8320=a124_0x1db453,_0x4a0bee=[['sqlCode',_0x4be044[_0x3f8320(0x10f)]],['sqlName',_0x4be044[_0x3f8320(0xff)]],['dbId',_0x4be044[_0x3f8320(0xed)]],[_0x3f8320(0x10e),_0x4be044[_0x3f8320(0x10e)]],[_0x3f8320(0xf7),_0x4be044['mode']],[_0x3f8320(0x10b),_0x4be044[_0x3f8320(0x10b)]],[_0x3f8320(0x108),_0x4be044[_0x3f8320(0x108)]]];if(_0x2ab915===_0x3f8320(0x110))return _0x4a0bee[_0x3f8320(0x116)](([,_0x1f7402])=>_0x1f7402!==undefined&&_0x1f7402!==null&&String(_0x1f7402)[_0x3f8320(0x102)]()!=='')[_0x3f8320(0xef)](([_0x168033,_0x4e1e60])=>_0x3f8320(0x119)+_0x168033+':\x20'+String(_0x4e1e60)+_0x3f8320(0x106));return _0x4a0bee[_0x3f8320(0x116)](([,_0x5229ae])=>_0x5229ae!==undefined&&_0x5229ae!==null&&String(_0x5229ae)[_0x3f8320(0x102)]()!=='')['map'](([_0x217f89,_0x5f12c1])=>_0x3f8320(0x10c)+_0x217f89+':\x20'+String(_0x5f12c1));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a125_0x2f91a3=a125_0x3ed9;(function(_0x76f07d,_0x46469){const _0x501d84=a125_0x3ed9,_0x3bd5e7=_0x76f07d();while(!![]){try{const _0x58796=-parseInt(_0x501d84(0x11e))/0x1*(parseInt(_0x501d84(0x104))/0x2)+parseInt(_0x501d84(0x10e))/0x3*(parseInt(_0x501d84(0x10c))/0x4)+-parseInt(_0x501d84(0x110))/0x5*(parseInt(_0x501d84(0x121))/0x6)+parseInt(_0x501d84(0x124))/0x7+parseInt(_0x501d84(0x11b))/0x8*(-parseInt(_0x501d84(0x126))/0x9)+parseInt(_0x501d84(0x125))/0xa*(-parseInt(_0x501d84(0x128))/0xb)+parseInt(_0x501d84(0x119))/0xc;if(_0x58796===_0x46469)break;else _0x3bd5e7['push'](_0x3bd5e7['shift']());}catch(_0x490722){_0x3bd5e7['push'](_0x3bd5e7['shift']());}}}(a125_0x1a26,0x351b0));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x3cd531){const _0x3b4b45=a125_0x3ed9,_0x568c0d=[];let _0x5afce4=0x1;while(!![]){const _0x1e6ee2=await listSqlQueries(_0x3cd531,{'currentPage':_0x5afce4,'pageSize':PAGE_SIZE}),_0x3c86f4=_0x1e6ee2[_0x3b4b45(0x108)]??[];_0x568c0d[_0x3b4b45(0x12a)](..._0x3c86f4['map'](_0x55245f=>_0x55245f[_0x3b4b45(0x11d)]));if(_0x3c86f4['length']===0x0)break;const _0x16308f=_0x1e6ee2[_0x3b4b45(0x113)]?.['totalCount'];if(_0x16308f!=null?_0x568c0d['length']>=_0x16308f:_0x3c86f4[_0x3b4b45(0x122)]<PAGE_SIZE)break;_0x5afce4++;}return _0x568c0d;}export const sqlStatus={'service':a125_0x2f91a3(0x115),'command':'status','description':a125_0x2f91a3(0x114),'risk':'read','flags':[{'name':a125_0x2f91a3(0x11f),'type':a125_0x2f91a3(0x127),'description':a125_0x2f91a3(0x116)}],async 'execute'(_0x552345){const _0x400f5b=a125_0x2f91a3,_0x164d25=loadSqlProjectConfig(_0x552345[_0x400f5b(0x106)]),_0x31e7e6=await readSqlLockFile(_0x164d25[_0x400f5b(0x10b)]),{appLock:_0xb665aa}=ensureSqlLockScope(_0x31e7e6??createEmptySqlLock(),_0x164d25[_0x400f5b(0x106)],_0x164d25['sqlRoot'],_0x400f5b(0x105)),_0xe81831=await scanLocalSqlQueries(_0x164d25),_0x1d143f=[],_0xcf26a=[],_0x11038e=[],_0x1a409e=[],_0x1b0244=new Set(_0xe81831[_0x400f5b(0x107)](_0x55be4a=>_0x55be4a[_0x400f5b(0x120)]));for(const _0x2beaf5 of _0xe81831){const _0x594c3e=await computeSqlFileHash(_0x2beaf5[_0x400f5b(0x10d)]),_0x4005b1=_0xb665aa[_0x400f5b(0x109)][_0x2beaf5[_0x400f5b(0x120)]],_0x1d5466=!!_0x4005b1&&_0x4005b1[_0x400f5b(0x11a)]!==_0x2beaf5['relativePath'],_0x390d8e=!!_0x4005b1&&!!_0x2beaf5[_0x400f5b(0x129)]&&_0x4005b1[_0x400f5b(0x129)]!==_0x2beaf5[_0x400f5b(0x129)];if(!_0x4005b1)_0x1d143f[_0x400f5b(0x12a)](_0x2beaf5[_0x400f5b(0x120)]);else _0x4005b1['hash']!==_0x594c3e||_0x1d5466||_0x390d8e?_0xcf26a[_0x400f5b(0x12a)](_0x2beaf5['lockKey']):_0x11038e['push'](_0x2beaf5['lockKey']);}for(const _0x333379 of Object[_0x400f5b(0x10a)](_0xb665aa['sqls'])){!_0x1b0244[_0x400f5b(0x117)](_0x333379)&&_0x1a409e[_0x400f5b(0x12a)](_0x333379);}const _0x1a8802=[];if(_0x552345[_0x400f5b(0x123)](_0x400f5b(0x11f))){const _0x1bab1d=await fetchAllSqlCodes(_0x552345[_0x400f5b(0x106)]);for(const _0x39a219 of _0x1bab1d){!_0x1b0244[_0x400f5b(0x117)](_0x39a219)&&!_0xb665aa[_0x400f5b(0x109)][_0x39a219]&&_0x1a8802[_0x400f5b(0x12a)](_0x39a219);}}const _0x257af9=_0x1d143f[_0x400f5b(0x122)]===0x0&&_0xcf26a[_0x400f5b(0x122)]===0x0&&_0x1a409e[_0x400f5b(0x122)]===0x0&&_0x1a8802['length']===0x0;return{'ok':!![],'data':{'added':_0x1d143f,'modified':_0xcf26a,'missing':_0x1a409e,'unchanged':_0x11038e,'remoteOnly':_0x1a8802},'message':_0x257af9?_0x400f5b(0x111):_0x1d143f['length']+_0x400f5b(0x10f)+_0xcf26a[_0x400f5b(0x122)]+_0x400f5b(0x11c)+_0x1a409e[_0x400f5b(0x122)]+_0x400f5b(0x12b)+_0x11038e[_0x400f5b(0x122)]+_0x400f5b(0x118)+(_0x1a8802[_0x400f5b(0x122)]>0x0?',\x20'+_0x1a8802['length']+_0x400f5b(0x112):'')};}};function a125_0x3ed9(_0x224b1c,_0x46b83b){_0x224b1c=_0x224b1c-0x104;const _0x1a261a=a125_0x1a26();let _0x3ed971=_0x1a261a[_0x224b1c];return _0x3ed971;}function a125_0x1a26(){const _0x230ff8=['\x20modified,\x20','sqlCode','356spXBrM','remote','lockKey','150xwoAyZ','length','bool','545076NUaxiL','10XBsrEj','12429DBcSXF','boolean','741983lDoQFN','sqlName','push','\x20missing,\x20','1048UlXgly','status','appCode','map','tableData','sqls','keys','lockFilePath','1116988OfltzY','filePath','3fPvxTa','\x20added,\x20','21515OBbYNR','All\x20SQL\x20queries\x20are\x20in\x20sync.','\x20remote-only','paging','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','sql','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','has','\x20unchanged','5497536iNrurQ','path','1368aICmye'];a125_0x1a26=function(){return _0x230ff8;};return a125_0x1a26();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a126_0x42059e=a126_0x19a7;(function(_0x75fbcd,_0x288062){const _0x5eb316=a126_0x19a7,_0x433d7d=_0x75fbcd();while(!![]){try{const _0x6210fe=parseInt(_0x5eb316(0x1bf))/0x1+parseInt(_0x5eb316(0x1d1))/0x2*(parseInt(_0x5eb316(0x1b5))/0x3)+parseInt(_0x5eb316(0x1d8))/0x4*(parseInt(_0x5eb316(0x1e0))/0x5)+parseInt(_0x5eb316(0x1be))/0x6*(parseInt(_0x5eb316(0x1bb))/0x7)+-parseInt(_0x5eb316(0x1c5))/0x8+parseInt(_0x5eb316(0x1e2))/0x9+-parseInt(_0x5eb316(0x1ba))/0xa;if(_0x6210fe===_0x288062)break;else _0x433d7d['push'](_0x433d7d['shift']());}catch(_0x524dd3){_0x433d7d['push'](_0x433d7d['shift']());}}}(a126_0xb7a5,0xc9522));function a126_0x19a7(_0x4fdc9b,_0x557462){_0x4fdc9b=_0x4fdc9b-0x1b3;const _0xb7a506=a126_0xb7a5();let _0x19a744=_0xb7a506[_0x4fdc9b];return _0x19a744;}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a126_0xb7a5(){const _0x343891=['isSelectOnly','get','validate','size','filter','sqlType','2UIKESJ','sql','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','Dataset\x20\x22','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','reason','14772FiYorZ','message','valid','cwd','utf-8','\x22\x20not\x20found\x20or\x20not\x20accessible','flagMissing','dbtableConfig','2065sezYeZ','toLowerCase','13952574RkQANN','schemas','trim','length','from','type','string','1935699ACgrYE','File\x20not\x20found:\x20','schemaWarnings','push','file','36799280rAyOIL','14tANZze','isDangerous','validation','3387036ohXewA','706134irRRvI','appCode','map','tables','str','split','8410688TzcRJf','Table\x20\x22','fields','name','tableName','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)'];a126_0xb7a5=function(){return _0x343891;};return a126_0xb7a5();}import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a126_0x42059e(0x1d2),'command':a126_0x42059e(0x1cd),'description':a126_0x42059e(0x1ca),'risk':'read','flags':[{'name':a126_0x42059e(0x1b9),'type':'string','description':a126_0x42059e(0x1d4)},{'name':'sql','type':a126_0x42059e(0x1b4),'description':a126_0x42059e(0x1d6)},{'name':a126_0x42059e(0x1e3),'type':a126_0x42059e(0x1b4),'description':a126_0x42059e(0x1d3)}],async 'execute'(_0x2811a6){const _0x4f69a9=a126_0x42059e,_0x186a32=_0x2811a6[_0x4f69a9(0x1c3)]('file'),_0x5cde1a=_0x2811a6[_0x4f69a9(0x1c3)]('sql');if(!_0x186a32&&!_0x5cde1a)throw CliErrors[_0x4f69a9(0x1de)](_0x4f69a9(0x1b9),'Provide\x20--file\x20or\x20--sql');let _0x4b9ce9;if(_0x186a32){const _0x4882bf=resolve(process[_0x4f69a9(0x1db)](),_0x186a32);if(!existsSync(_0x4882bf))throw CliErrors[_0x4f69a9(0x1bd)](_0x4f69a9(0x1b6)+_0x4882bf);_0x4b9ce9=readFileSync(_0x4882bf,_0x4f69a9(0x1dc));}else _0x4b9ce9=_0x5cde1a;const _0x548055=validateSql(_0x4b9ce9),_0x28442a={'valid':_0x548055[_0x4f69a9(0x1da)],'sqlType':_0x548055[_0x4f69a9(0x1d0)][_0x4f69a9(0x1b3)],'isSelectOnly':_0x548055['sqlType'][_0x4f69a9(0x1cb)],'isDangerous':_0x548055['sqlType'][_0x4f69a9(0x1bc)],'tables':_0x548055['tables'],'parameters':_0x548055['parameters'],'message':_0x548055[_0x4f69a9(0x1d9)]};_0x548055['sqlType'][_0x4f69a9(0x1d7)]&&(_0x28442a[_0x4f69a9(0x1d7)]=_0x548055['sqlType'][_0x4f69a9(0x1d7)]);const _0x396ab8=_0x2811a6['str'](_0x4f69a9(0x1e3));if(_0x396ab8&&_0x548055['valid']){const _0x272eef=_0x396ab8[_0x4f69a9(0x1c4)](',')[_0x4f69a9(0x1c1)](_0x4532ce=>_0x4532ce[_0x4f69a9(0x1e4)]())[_0x4f69a9(0x1cf)](Boolean),_0x4a5af5=[],_0x2a9b4f=await listDatasets(_0x2811a6[_0x4f69a9(0x1c0)]),_0x237092=new Map(_0x2a9b4f['map'](_0xdaa92f=>[_0xdaa92f[_0x4f69a9(0x1df)]?.['tableName']?.[_0x4f69a9(0x1e1)](),_0xdaa92f]));for(const _0x399ed7 of _0x548055[_0x4f69a9(0x1c2)]){const _0x275edb=_0x237092[_0x4f69a9(0x1cc)](_0x399ed7[_0x4f69a9(0x1e1)]());!_0x275edb&&_0x4a5af5[_0x4f69a9(0x1b8)](_0x4f69a9(0x1c6)+_0x399ed7+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x29f350 of _0x272eef){try{const _0x3ee5ea=await getDatasetDetail(_0x29f350),_0x460b12=Array['isArray'](_0x3ee5ea['fields'])?_0x3ee5ea[_0x4f69a9(0x1c7)]:[],_0x1dc7bd=new Set(_0x460b12[_0x4f69a9(0x1c1)](_0x4ed547=>_0x4ed547[_0x4f69a9(0x1c8)]?.['toLowerCase']())),_0x15bf4c=_0x3ee5ea[_0x4f69a9(0x1df)]?.[_0x4f69a9(0x1c9)]||_0x3ee5ea[_0x4f69a9(0x1c9)]||_0x29f350;_0x28442a['schema:'+_0x15bf4c]={'code':_0x29f350,'tableName':_0x15bf4c,'fieldCount':_0x1dc7bd[_0x4f69a9(0x1ce)],'fields':Array[_0x4f69a9(0x1e6)](_0x1dc7bd)};}catch{_0x4a5af5['push'](_0x4f69a9(0x1d5)+_0x29f350+_0x4f69a9(0x1dd));}}_0x4a5af5[_0x4f69a9(0x1e5)]>0x0&&(_0x28442a[_0x4f69a9(0x1b7)]=_0x4a5af5);}return{'ok':_0x548055['valid'],'data':_0x28442a,'message':_0x548055['message']};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x2abc63=a127_0x3978;(function(_0x21f895,_0x489583){const _0x1fc623=a127_0x3978,_0x4f15e3=_0x21f895();while(!![]){try{const _0x5db7cc=-parseInt(_0x1fc623(0x140))/0x1*(parseInt(_0x1fc623(0x13a))/0x2)+-parseInt(_0x1fc623(0x12d))/0x3+parseInt(_0x1fc623(0x126))/0x4*(-parseInt(_0x1fc623(0x14a))/0x5)+-parseInt(_0x1fc623(0x12c))/0x6+-parseInt(_0x1fc623(0x125))/0x7*(parseInt(_0x1fc623(0x141))/0x8)+parseInt(_0x1fc623(0x147))/0x9*(-parseInt(_0x1fc623(0x13e))/0xa)+parseInt(_0x1fc623(0x13b))/0xb;if(_0x5db7cc===_0x489583)break;else _0x4f15e3['push'](_0x4f15e3['shift']());}catch(_0x5dbfb6){_0x4f15e3['push'](_0x4f15e3['shift']());}}}(a127_0x182f,0x46151));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=[a127_0x2abc63(0x12b),a127_0x2abc63(0x14f),a127_0x2abc63(0x146),a127_0x2abc63(0x138),a127_0x2abc63(0x12e)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a127_0x2abc63(0x12f),'env',a127_0x2abc63(0x146),a127_0x2abc63(0x138),a127_0x2abc63(0x12b),a127_0x2abc63(0x14f),a127_0x2abc63(0x13f)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x30d37d){const _0x5f21cb=a127_0x2abc63;return[..._0x30d37d][_0x5f21cb(0x14d)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x1a72af){const _0x3037ff=a127_0x2abc63;return TOP_LEVEL_CONFIG_KEYS[_0x3037ff(0x143)](_0x1a72af);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}function a127_0x182f(){const _0x48daba=['entries','app','zh-CN','length','number','defaultApp','env','Access\x20key','format','Auth\x20cookie','472HtqCxS','20668516ZrONXO','trim','map','304270TMJXNv','apiDir','1252SWkowB','496aSEJmG','pageSize','has','toLowerCase','string','locale','54RmrIVe','Risk\x20level','Locale','35095jXciSb','API\x20directory\x20path','keys','join','inherit','accessKey','en-US','19677fRuoPV','100iZDtqO','Config\x20key\x20(','filter','apps','Target\x20environment','cookie','2553600cmbVjt','1015524fxUHxn','riskLevel','appcode'];a127_0x182f=function(){return _0x48daba;};return a127_0x182f();}export function getConfigCommandKeyDescription(){const _0x2845ce=a127_0x2abc63;return _0x2845ce(0x127)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a127_0x2abc63(0x136),'apiDir':a127_0x2abc63(0x13f),'cookie':a127_0x2abc63(0x12b),'accessKey':a127_0x2abc63(0x14f),'defaultFormat':a127_0x2abc63(0x138),'pageSize':a127_0x2abc63(0x142),'riskLevel':'riskLevel','locale':'locale'};export function getAppProfileFlagDefs(){const _0x4636d0=a127_0x2abc63;return[{'name':_0x4636d0(0x136),'type':'string','description':_0x4636d0(0x12a),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x4636d0(0x13f),'type':_0x4636d0(0x145),'description':_0x4636d0(0x14b)},{'name':_0x4636d0(0x12b),'type':_0x4636d0(0x145),'description':_0x4636d0(0x139),'hidden':!![]},{'name':_0x4636d0(0x14f),'type':'string','description':_0x4636d0(0x137),'hidden':!![]},{'name':'defaultFormat','type':'string','description':'Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x4636d0(0x142),'type':_0x4636d0(0x134),'description':'Default\x20page\x20size'},{'name':'riskLevel','type':_0x4636d0(0x145),'description':_0x4636d0(0x148),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x4636d0(0x146),'type':_0x4636d0(0x145),'description':_0x4636d0(0x149)}];}export function collectAppProfileOverrides(_0x25d5d5){const _0x1ab42f=a127_0x2abc63,_0x78b6a0={};for(const [_0x41a9c7,_0x476336]of Object[_0x1ab42f(0x130)](APP_PROFILE_FLAG_KEY_MAP)){const _0x5acf00=_0x25d5d5(_0x41a9c7);if(!_0x5acf00)continue;_0x78b6a0[_0x476336]=_0x476336==='pageSize'?Number(_0x5acf00):_0x5acf00;}return _0x78b6a0;}function a127_0x3978(_0x5a508d,_0x22494d){_0x5a508d=_0x5a508d-0x124;const _0x182f61=a127_0x182f();let _0x3978a2=_0x182f61[_0x5a508d];return _0x3978a2;}export function buildAppProfileListFields(_0x434ca6){const _0x33345c=a127_0x2abc63;return{'env':_0x434ca6['env']??null,'apiDir':_0x434ca6[_0x33345c(0x13f)]??null,'hasCookie':!!_0x434ca6['cookie'],'hasAccessKey':!!_0x434ca6['accessKey'],'format':_0x434ca6['format']??null,'pageSize':_0x434ca6[_0x33345c(0x142)]??null,'riskLevel':_0x434ca6[_0x33345c(0x12e)]??null,'locale':_0x434ca6[_0x33345c(0x146)]??null};}export function buildAppDoctorFields(_0x3d2173,_0x291c36){const _0xa246fe=a127_0x2abc63;return{'env':{'value':_0x3d2173[_0xa246fe(0x136)]||_0x291c36[_0xa246fe(0x136)],'source':_0x3d2173[_0xa246fe(0x136)]?'app':_0xa246fe(0x14e)},'apiDir':{'value':_0x3d2173[_0xa246fe(0x13f)]||_0x291c36[_0xa246fe(0x13f)],'source':_0x3d2173[_0xa246fe(0x13f)]?_0xa246fe(0x131):_0xa246fe(0x14e)},'cookie':{'value':_0x3d2173[_0xa246fe(0x12b)]||_0x291c36[_0xa246fe(0x12b)],'source':_0x3d2173[_0xa246fe(0x12b)]?'app':_0xa246fe(0x14e)},'accessKey':{'value':_0x3d2173[_0xa246fe(0x14f)]||_0x291c36[_0xa246fe(0x14f)],'source':_0x3d2173[_0xa246fe(0x14f)]?_0xa246fe(0x131):_0xa246fe(0x14e)}};}export function buildCanonicalAppConfig(_0xbb7197,_0x19d15c){const _0x237d54=a127_0x2abc63,_0x13a0d6=_0xbb7197[_0x237d54(0x13d)](_0x40f57d=>String(_0x40f57d||'')[_0x237d54(0x13c)]())[_0x237d54(0x128)](Boolean);if(_0x13a0d6[_0x237d54(0x133)]===0x0)return{};const _0x567ad6={};for(const _0x46903d of _0x13a0d6){_0x567ad6[_0x46903d]=_0x19d15c?{'appcode':_0x46903d,'env':_0x19d15c}:{'appcode':_0x46903d};}return{'apps':_0x567ad6,'defaultApp':_0x13a0d6[0x0]};}export function buildCanonicalProjectConfig(_0x14454b,_0x1c747d){const _0x2c58ad=a127_0x2abc63,{appCodes:appCodes=[],env:_0x157ec5,metadata:_0x59c570}=_0x1c747d,_0xc98d89={..._0x14454b,..._0x59c570||{}};delete _0xc98d89[_0x2c58ad(0x12f)],delete _0xc98d89[_0x2c58ad(0x131)];if(_0x157ec5)_0xc98d89['env']=_0x157ec5;else!_0xc98d89['env']&&(_0xc98d89['env']=DEFAULT_CONFIG_VALUES['env']);const _0x5f16ee=buildCanonicalAppConfig(appCodes,_0xc98d89[_0x2c58ad(0x136)]);return Object[_0x2c58ad(0x14c)](_0x5f16ee)['length']>0x0&&(_0xc98d89['apps']=_0x5f16ee[_0x2c58ad(0x129)],_0xc98d89[_0x2c58ad(0x135)]=_0x5f16ee[_0x2c58ad(0x135)]),_0xc98d89;}const LOCALE_MAP={'zh':a127_0x2abc63(0x132),'zh-cn':'zh-CN','zh_cn':a127_0x2abc63(0x132),'en':a127_0x2abc63(0x124),'en-us':a127_0x2abc63(0x124),'en_us':a127_0x2abc63(0x124)};export function normalizeLocale(_0x493db2){const _0x43fb69=a127_0x2abc63;if(!_0x493db2)return null;return LOCALE_MAP[_0x493db2[_0x43fb69(0x144)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a128_0x3c39c7=a128_0x437b;function a128_0x30af(){const _0x595b57=['2046726fVlOzp','8861ShpwZU','6WLXpLM','4gzSDvX','22HILedk','409485boGOPO','2325584FXZKGX','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','861519GMdhHc','4jjvJIS','576625pmDpBj','3555810TRwWIE'];a128_0x30af=function(){return _0x595b57;};return a128_0x30af();}(function(_0x2153e0,_0x83b188){const _0x3c7b04=a128_0x437b,_0x112713=_0x2153e0();while(!![]){try{const _0x34f9de=-parseInt(_0x3c7b04(0x106))/0x1*(-parseInt(_0x3c7b04(0x102))/0x2)+-parseInt(_0x3c7b04(0x101))/0x3+parseInt(_0x3c7b04(0x108))/0x4*(-parseInt(_0x3c7b04(0xfe))/0x5)+parseInt(_0x3c7b04(0x107))/0x6*(-parseInt(_0x3c7b04(0x103))/0x7)+-parseInt(_0x3c7b04(0xff))/0x8+parseInt(_0x3c7b04(0x105))/0x9+-parseInt(_0x3c7b04(0x104))/0xa*(-parseInt(_0x3c7b04(0xfd))/0xb);if(_0x34f9de===_0x83b188)break;else _0x112713['push'](_0x112713['shift']());}catch(_0x14d501){_0x112713['push'](_0x112713['shift']());}}}(a128_0x30af,0x3448b));function a128_0x437b(_0x59e9a4,_0x22a1d9){_0x59e9a4=_0x59e9a4-0xfd;const _0x30af80=a128_0x30af();let _0x437b40=_0x30af80[_0x59e9a4];return _0x437b40;}export const CLI_VERSION_POLICY_URL=a128_0x3c39c7(0x100);
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a129_0x3daf28=a129_0x55a5;(function(_0x24fbae,_0x380ec8){const _0x457d54=a129_0x55a5,_0x1d49fc=_0x24fbae();while(!![]){try{const _0x182e52=-parseInt(_0x457d54(0x235))/0x1*(-parseInt(_0x457d54(0x241))/0x2)+-parseInt(_0x457d54(0x201))/0x3*(parseInt(_0x457d54(0x1eb))/0x4)+parseInt(_0x457d54(0x216))/0x5+-parseInt(_0x457d54(0x1ea))/0x6*(-parseInt(_0x457d54(0x245))/0x7)+-parseInt(_0x457d54(0x237))/0x8*(parseInt(_0x457d54(0x200))/0x9)+parseInt(_0x457d54(0x206))/0xa*(-parseInt(_0x457d54(0x209))/0xb)+-parseInt(_0x457d54(0x230))/0xc*(-parseInt(_0x457d54(0x234))/0xd);if(_0x182e52===_0x380ec8)break;else _0x1d49fc['push'](_0x1d49fc['shift']());}catch(_0x3f430d){_0x1d49fc['push'](_0x1d49fc['shift']());}}}(a129_0x18eb,0xa6179));function a129_0x55a5(_0x261ef1,_0x3481c5){_0x261ef1=_0x261ef1-0x1e3;const _0x18eb7f=a129_0x18eb();let _0x55a509=_0x18eb7f[_0x261ef1];return _0x55a509;}export const CLI_BIN_NAME=a129_0x3daf28(0x20b);function a129_0x18eb(){const _0x32087a=['operationType','keyword','format','97480iFfqKH','Operation\x20type','confirm','1507ZHgYXI','sqlcode','rabetbase','Title','yes','db-id','output','File\x20path','fromEntries','title','Rabetbase\x20CLI','target','sqlname','3197830QtsBhv','key','Config\x20key','json\x20|\x20pretty\x20|\x20compress','skip-imports','type','Override\x20appcode','app','appcode','Description\x20file','string','non-interactive','dbId','DB\x20ID','map','<name>','schemas','Environment','Verbose\x20output','JSON\x20params','env','enable-bff-save','verbose','Expected\x20affected\x20count','<code>','sql','1049916WsLyWN','nonInteractive','Use\x20global\x20config\x20scope','Watch\x20mode','143mDIMec','772630octHUs','global','9848udsmGE','Name','name','function-node','expectedCount','Output\x20format','meowKey','<expr>','Output\x20path','params','2jprotG','dbid','pagesize','Clear','3304231EJHulO','description-file','SQL\x20code','dryRun','Record\x20ID','watch','value','file','Skip\x20confirmation\x20for\x20high-risk\x20writes','Schemas','clear','boolean','12NsfZev','4908bmenAN','SQL\x20name','Force\x20overwrite','Confirm\x20destructive\x20action','force','all','Preview\x20operation\x20without\x20executing','sql-name','code','operation-type','Use\x20remote','functionNode','@lovrabet/rabetbase-cli','project','operation','description','page','Target\x20path','SQL\x20string','datasetcode','Enable\x20BFF\x20save','5121tbBvxd','1473gZbliW','expected-count'];a129_0x18eb=function(){return _0x32087a;};return a129_0x18eb();}export const CLI_DISPLAY_NAME=a129_0x3daf28(0x213);export const NPM_PACKAGE_NAME=a129_0x3daf28(0x1f7);export const GLOBAL_FLAGS=[{'name':a129_0x3daf28(0x21e),'meowKey':a129_0x3daf28(0x21e),'type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x21c),'hint':a129_0x3daf28(0x22e)},{'name':a129_0x3daf28(0x21d),'meowKey':a129_0x3daf28(0x21d),'type':'string','description':'Select\x20app\x20profile\x20by\x20name','hint':a129_0x3daf28(0x225)},{'name':a129_0x3daf28(0x22a),'meowKey':a129_0x3daf28(0x22a),'type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x227),'hint':'production\x20|\x20daily'},{'name':'format','meowKey':a129_0x3daf28(0x205),'type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x23c),'hint':a129_0x3daf28(0x219)},{'name':'jq','meowKey':'jq','type':a129_0x3daf28(0x220),'description':'Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','hint':a129_0x3daf28(0x23e)},{'name':'dry-run','meowKey':a129_0x3daf28(0x248),'type':a129_0x3daf28(0x1e9),'description':a129_0x3daf28(0x1f1)},{'name':a129_0x3daf28(0x20d),'meowKey':a129_0x3daf28(0x20d),'type':a129_0x3daf28(0x1e9),'description':a129_0x3daf28(0x1e6)},{'name':a129_0x3daf28(0x221),'meowKey':a129_0x3daf28(0x231),'type':a129_0x3daf28(0x1e9),'description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':a129_0x3daf28(0x236),'meowKey':a129_0x3daf28(0x236),'type':a129_0x3daf28(0x1e9),'description':a129_0x3daf28(0x232)},{'name':a129_0x3daf28(0x1f8),'meowKey':a129_0x3daf28(0x1f8),'type':a129_0x3daf28(0x1e9),'description':'Use\x20project\x20config\x20scope'},{'name':'ci','meowKey':'ci','type':a129_0x3daf28(0x1e9),'description':'Alias\x20for\x20--non-interactive','hidden':!![]},{'name':'help','meowKey':'help','type':a129_0x3daf28(0x1e9),'description':'Show\x20help'},{'name':'name','meowKey':a129_0x3daf28(0x239),'type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x238),'hidden':!![]},{'name':a129_0x3daf28(0x212),'meowKey':'title','type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x20c),'hidden':!![]},{'name':a129_0x3daf28(0x1e8),'meowKey':'clear','type':a129_0x3daf28(0x1e9),'description':a129_0x3daf28(0x244),'hidden':!![]},{'name':a129_0x3daf28(0x1e3),'meowKey':a129_0x3daf28(0x1e3),'type':'boolean','description':a129_0x3daf28(0x233),'hidden':!![]},{'name':a129_0x3daf28(0x20f),'meowKey':a129_0x3daf28(0x20f),'type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x23f),'hidden':!![]},{'name':a129_0x3daf28(0x240),'meowKey':'params','type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x229),'hidden':!![]},{'name':a129_0x3daf28(0x1fe),'meowKey':a129_0x3daf28(0x1fe),'type':a129_0x3daf28(0x220),'description':'Dataset\x20code','hidden':!![]},{'name':'all','meowKey':a129_0x3daf28(0x1f0),'type':a129_0x3daf28(0x1e9),'description':'Apply\x20to\x20all','hidden':!![]},{'name':a129_0x3daf28(0x22b),'meowKey':'enableBffSave','type':a129_0x3daf28(0x1e9),'description':a129_0x3daf28(0x1ff),'hidden':!![]},{'name':'id','meowKey':'id','type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x249),'hidden':!![]},{'name':a129_0x3daf28(0x21b),'meowKey':a129_0x3daf28(0x21b),'type':a129_0x3daf28(0x220),'description':'Type\x20filter','hidden':!![]},{'name':a129_0x3daf28(0x1e5),'meowKey':a129_0x3daf28(0x1e5),'type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x210),'hidden':!![]},{'name':a129_0x3daf28(0x20a),'meowKey':'sqlcode','type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x247),'hidden':!![]},{'name':a129_0x3daf28(0x1f2),'meowKey':'sqlName','type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x1ec),'hidden':!![]},{'name':a129_0x3daf28(0x215),'meowKey':'sqlname','type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x1ec),'hidden':!![]},{'name':a129_0x3daf28(0x20e),'meowKey':a129_0x3daf28(0x222),'type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x223),'hidden':!![]},{'name':a129_0x3daf28(0x242),'meowKey':'dbid','type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x223),'hidden':!![]},{'name':a129_0x3daf28(0x1fa),'meowKey':a129_0x3daf28(0x1fa),'type':a129_0x3daf28(0x220),'description':'Description','hidden':!![]},{'name':a129_0x3daf28(0x246),'meowKey':'descriptionFile','type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x21f),'hidden':!![]},{'name':a129_0x3daf28(0x1fb),'meowKey':a129_0x3daf28(0x1fb),'type':a129_0x3daf28(0x220),'description':'Page\x20number','hidden':!![]},{'name':a129_0x3daf28(0x243),'meowKey':'pagesize','type':a129_0x3daf28(0x220),'description':'Page\x20size','hidden':!![]},{'name':'keyword','meowKey':a129_0x3daf28(0x204),'type':a129_0x3daf28(0x220),'description':'Keyword\x20filter','hidden':!![]},{'name':a129_0x3daf28(0x1f3),'meowKey':a129_0x3daf28(0x1f3),'type':a129_0x3daf28(0x220),'description':'Code\x20filter','hidden':!![]},{'name':a129_0x3daf28(0x22f),'meowKey':'sql','type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x1fd),'hidden':!![]},{'name':a129_0x3daf28(0x226),'meowKey':a129_0x3daf28(0x226),'type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x1e7),'hidden':!![]},{'name':a129_0x3daf28(0x1f9),'meowKey':a129_0x3daf28(0x1f9),'type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x207),'hidden':!![]},{'name':a129_0x3daf28(0x214),'meowKey':a129_0x3daf28(0x214),'type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x1fc),'hidden':!![]},{'name':a129_0x3daf28(0x21a),'meowKey':'skipImports','type':a129_0x3daf28(0x1e9),'description':'Skip\x20import\x20generation','hidden':!![]},{'name':a129_0x3daf28(0x217),'meowKey':a129_0x3daf28(0x217),'type':'string','description':a129_0x3daf28(0x218),'hidden':!![]},{'name':a129_0x3daf28(0x1e4),'meowKey':'value','type':a129_0x3daf28(0x220),'description':'Config\x20value','hidden':!![]},{'name':a129_0x3daf28(0x1ef),'meowKey':a129_0x3daf28(0x1ef),'type':a129_0x3daf28(0x1e9),'description':a129_0x3daf28(0x1ed),'hidden':!![]},{'name':'confirm','meowKey':a129_0x3daf28(0x208),'type':a129_0x3daf28(0x1e9),'description':a129_0x3daf28(0x1ee),'hidden':!![]},{'name':'remote','meowKey':'remote','type':a129_0x3daf28(0x1e9),'description':a129_0x3daf28(0x1f5),'hidden':!![]},{'name':'verbose','meowKey':a129_0x3daf28(0x22c),'type':a129_0x3daf28(0x1e9),'description':a129_0x3daf28(0x228),'hidden':!![]},{'name':a129_0x3daf28(0x202),'meowKey':a129_0x3daf28(0x23b),'type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x22d),'hidden':!![]},{'name':a129_0x3daf28(0x1f4),'meowKey':a129_0x3daf28(0x203),'type':a129_0x3daf28(0x220),'description':a129_0x3daf28(0x207),'hidden':!![]},{'name':a129_0x3daf28(0x23a),'meowKey':a129_0x3daf28(0x1f6),'type':a129_0x3daf28(0x220),'description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set(['appcode',a129_0x3daf28(0x21d),a129_0x3daf28(0x22a),a129_0x3daf28(0x205),'jq','dry-run',a129_0x3daf28(0x20d),a129_0x3daf28(0x221),'ci']);export function buildMeowFlags(){const _0x2a6cde=a129_0x3daf28;return Object[_0x2a6cde(0x211)](GLOBAL_FLAGS[_0x2a6cde(0x224)](_0x5ee7d3=>[_0x5ee7d3[_0x2a6cde(0x23d)],{'type':_0x5ee7d3[_0x2a6cde(0x21b)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a130_0x1ca161=a130_0x84b4;(function(_0x1c6c10,_0x40e5cd){const _0x71f2aa=a130_0x84b4,_0x455537=_0x1c6c10();while(!![]){try{const _0x41ad2d=parseInt(_0x71f2aa(0xa8))/0x1+-parseInt(_0x71f2aa(0xa3))/0x2+-parseInt(_0x71f2aa(0xa7))/0x3+parseInt(_0x71f2aa(0xa1))/0x4+parseInt(_0x71f2aa(0xa4))/0x5+-parseInt(_0x71f2aa(0xa5))/0x6+parseInt(_0x71f2aa(0xab))/0x7*(parseInt(_0x71f2aa(0xa9))/0x8);if(_0x41ad2d===_0x40e5cd)break;else _0x455537['push'](_0x455537['shift']());}catch(_0x1ff0a0){_0x455537['push'](_0x455537['shift']());}}}(a130_0x37ba,0x4fc9e));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':'production','format':a130_0x1ca161(0xaa),'locale':a130_0x1ca161(0xa6),'riskLevel':a130_0x1ca161(0xa2),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a130_0x1ca161(0xaa);function a130_0x84b4(_0x368edb,_0x59e2b7){_0x368edb=_0x368edb-0xa1;const _0x37bacd=a130_0x37ba();let _0x84b46d=_0x37bacd[_0x368edb];return _0x84b46d;}function a130_0x37ba(){const _0x10cfc1=['324256WNRgvF','157016SoyTez','compress','77doqaGz','1612736rXcAcO','high-risk-write','910414hCayPj','1623465evMXFF','322314oDoMsf','en-US','1296870trbDOY'];a130_0x37ba=function(){return _0x10cfc1;};return a130_0x37ba();}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x1a4c30=a131_0x2992;(function(_0x428311,_0x220d30){const _0x577a78=a131_0x2992,_0x1baa38=_0x428311();while(!![]){try{const _0x1fc5de=-parseInt(_0x577a78(0x168))/0x1+-parseInt(_0x577a78(0x16f))/0x2+-parseInt(_0x577a78(0x16b))/0x3*(-parseInt(_0x577a78(0x163))/0x4)+-parseInt(_0x577a78(0x174))/0x5*(-parseInt(_0x577a78(0x164))/0x6)+-parseInt(_0x577a78(0x167))/0x7*(-parseInt(_0x577a78(0x166))/0x8)+parseInt(_0x577a78(0x16d))/0x9+-parseInt(_0x577a78(0x175))/0xa*(parseInt(_0x577a78(0x171))/0xb);if(_0x1fc5de===_0x220d30)break;else _0x1baa38['push'](_0x1baa38['shift']());}catch(_0x31713c){_0x1baa38['push'](_0x1baa38['shift']());}}}(a131_0x1a41,0xe8d01));function a131_0x2992(_0x10526b,_0x2b29ca){_0x10526b=_0x10526b-0x163;const _0x1a4116=a131_0x1a41();let _0x2992e1=_0x1a4116[_0x10526b];return _0x2992e1;}import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a131_0x1a41(){const _0x519d82=['208aGPPtc','148169kWOfKi','1534289UNISPm','runtimeDomain','https://daily-api.lovrabet.com','285eDrTXh','apiDomain','7482006nZmZGS','https://user.lovrabet.com','444010wWJCqx','userDomain','740443uFzEgH','https://daily-runtime.lovrabet.com','https://runtime.lovrabet.com','2285jjgwNe','50LUAhey','1652TYyZBU','21342onVRLE','https://api.lovrabet.com'];a131_0x1a41=function(){return _0x519d82;};return a131_0x1a41();}export function initDomains(_0x1da3a0){const _0x3057b6=a131_0x2992;customApiDomain=_0x1da3a0?.[_0x3057b6(0x16c)],customUserDomain=_0x1da3a0?.[_0x3057b6(0x170)],customRuntimeDomain=_0x1da3a0?.[_0x3057b6(0x169)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a131_0x1a4c30(0x16e):'https://user-daily.lovrabet.com');export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a131_0x1a4c30(0x165):a131_0x1a4c30(0x16a));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a131_0x1a4c30(0x173):a131_0x1a4c30(0x172));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0xf40caa=a132_0x2c65;(function(_0x246a2a,_0x3efa4d){const _0x16b3f1=a132_0x2c65,_0x4d454d=_0x246a2a();while(!![]){try{const _0x5d9c7f=-parseInt(_0x16b3f1(0x13a))/0x1+parseInt(_0x16b3f1(0x13c))/0x2+-parseInt(_0x16b3f1(0x13d))/0x3+parseInt(_0x16b3f1(0x142))/0x4+-parseInt(_0x16b3f1(0x13f))/0x5+parseInt(_0x16b3f1(0x143))/0x6*(-parseInt(_0x16b3f1(0x139))/0x7)+parseInt(_0x16b3f1(0x13b))/0x8;if(_0x5d9c7f===_0x3efa4d)break;else _0x4d454d['push'](_0x4d454d['shift']());}catch(_0x19f190){_0x4d454d['push'](_0x4d454d['shift']());}}}(a132_0xa1ba,0x7b357));export const RABETBASE_ENV_VALUES=[a132_0xf40caa(0x141),a132_0xf40caa(0x13e)];export function normalizeEnv(_0x3e4e46){const _0x16f50b=a132_0xf40caa;return _0x3e4e46==='online'?_0x16f50b(0x141):_0x3e4e46;}export function isProduction(_0x165104){const _0x1b02bf=a132_0xf40caa;return normalizeEnv(_0x165104)===_0x1b02bf(0x141);}export function isDaily(_0x37a7c2){const _0x3faab3=a132_0xf40caa;return normalizeEnv(_0x37a7c2)===_0x3faab3(0x13e);}export function isDev(_0x4111a5){const _0x3cd460=a132_0xf40caa,_0x441046=normalizeEnv(_0x4111a5);return _0x441046===_0x3cd460(0x140)||_0x441046===_0x3cd460(0x138);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||'production');function a132_0x2c65(_0x1550c9,_0x178c64){_0x1550c9=_0x1550c9-0x138;const _0xa1bae=a132_0xa1ba();let _0x2c658c=_0xa1bae[_0x1550c9];return _0x2c658c;}export function getEnv(){return env;}export function initEnv(_0x1bb797){env=normalizeEnv(_0x1bb797);}function a132_0xa1ba(){const _0x3e293d=['7HXiffp','26803SZfLXA','16107568AtxDsp','979446TGrVRL','1746690LcUPHV','daily','3798005kvtCww','development','production','257980iMLYlz','4166202KhbPsc','dev'];a132_0xa1ba=function(){return _0x3e293d;};return a132_0xa1ba();}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a133_0x1e534e=a133_0x91dd;function a133_0x91dd(_0x40b0f1,_0x3d1449){_0x40b0f1=_0x40b0f1-0x15e;const _0x226868=a133_0x2268();let _0x91dd3a=_0x226868[_0x40b0f1];return _0x91dd3a;}(function(_0x22d6f5,_0xe87c5f){const _0x34127e=a133_0x91dd,_0x2bb176=_0x22d6f5();while(!![]){try{const _0x248f94=parseInt(_0x34127e(0x160))/0x1*(-parseInt(_0x34127e(0x15f))/0x2)+parseInt(_0x34127e(0x167))/0x3*(parseInt(_0x34127e(0x16b))/0x4)+parseInt(_0x34127e(0x163))/0x5+parseInt(_0x34127e(0x165))/0x6+parseInt(_0x34127e(0x166))/0x7*(-parseInt(_0x34127e(0x162))/0x8)+-parseInt(_0x34127e(0x164))/0x9+-parseInt(_0x34127e(0x169))/0xa*(-parseInt(_0x34127e(0x15e))/0xb);if(_0x248f94===_0xe87c5f)break;else _0x2bb176['push'](_0x2bb176['shift']());}catch(_0x4a7d4b){_0x2bb176['push'](_0x2bb176['shift']());}}}(a133_0x2268,0xe1aca));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a133_0x1e534e(0x161),a133_0x1e534e(0x16a),a133_0x1e534e(0x168)];function a133_0x2268(){const _0x46e905=['1422315HpLMHN','6798240ZyrJaV','7bqCAVt','84eiJGIy','compress','10930SJZffi','pretty','214872ChypQC','7150fapGCO','124166JqhWxr','29ghVykR','json','8938184KaIefy','3262415NZolNt'];a133_0x2268=function(){return _0x46e905;};return a133_0x2268();}
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a134_0x32c138=a134_0x2d59;(function(_0x4c039e,_0x4dc2ee){const _0x350eeb=a134_0x2d59,_0x413266=_0x4c039e();while(!![]){try{const _0xd4b63d=parseInt(_0x350eeb(0x7c))/0x1*(-parseInt(_0x350eeb(0x7d))/0x2)+parseInt(_0x350eeb(0x7b))/0x3+-parseInt(_0x350eeb(0x83))/0x4*(-parseInt(_0x350eeb(0x7a))/0x5)+parseInt(_0x350eeb(0x81))/0x6+parseInt(_0x350eeb(0x80))/0x7+parseInt(_0x350eeb(0x82))/0x8+-parseInt(_0x350eeb(0x7e))/0x9;if(_0xd4b63d===_0x4dc2ee)break;else _0x413266['push'](_0x413266['shift']());}catch(_0xb79749){_0x413266['push'](_0x413266['shift']());}}}(a134_0x354b,0x731ba));function a134_0x354b(){const _0x233706=['4oKikru','362836rNCoNf','3869154AyOSmq','./src/api','867552Txohle','1075110scalJc','1366024LkZdkm','268KsXCTM','42870enWCkA','1736184Egugoq'];a134_0x354b=function(){return _0x233706;};return a134_0x354b();}function a134_0x2d59(_0x57097e,_0x482237){_0x57097e=_0x57097e-0x7a;const _0x354b9a=a134_0x354b();let _0x2d59f1=_0x354b9a[_0x57097e];return _0x2d59f1;}export const DEFAULT_API_DIR=a134_0x32c138(0x7f);
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a135_0x3595(_0x16f346,_0x44782d){_0x16f346=_0x16f346-0x181;const _0x3151ea=a135_0x3151();let _0x35953c=_0x3151ea[_0x16f346];return _0x35953c;}function a135_0x3151(){const _0x3bafdb=['write','4800570LYGeTe','9247023tIRtzi','30EOctOR','67294qVGhhD','8BsqOks','562548TfZbDd','672991qdbEAI','4063880BhZFOC','5266926qWnzMS','read'];a135_0x3151=function(){return _0x3bafdb;};return a135_0x3151();}const a135_0x1265f7=a135_0x3595;(function(_0x40d914,_0x2b4680){const _0x568d94=a135_0x3595,_0x643a90=_0x40d914();while(!![]){try{const _0x5714c5=-parseInt(_0x568d94(0x18b))/0x1+-parseInt(_0x568d94(0x188))/0x2*(parseInt(_0x568d94(0x187))/0x3)+parseInt(_0x568d94(0x18a))/0x4+parseInt(_0x568d94(0x181))/0x5+parseInt(_0x568d94(0x185))/0x6+parseInt(_0x568d94(0x182))/0x7+parseInt(_0x568d94(0x189))/0x8*(-parseInt(_0x568d94(0x186))/0x9);if(_0x5714c5===_0x2b4680)break;else _0x643a90['push'](_0x643a90['shift']());}catch(_0x354e28){_0x643a90['push'](_0x643a90['shift']());}}}(a135_0x3151,0x7281a));export const RISK_LEVEL_VALUES=[a135_0x1265f7(0x183),a135_0x1265f7(0x184),'high-risk-write'];
|