@lovrabet/rabetbase-cli 2.1.7-beta.9 → 2.1.8
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/index.js +1 -1
- package/lib/commands/dataset/link-create.js +1 -1
- package/lib/commands/dataset/link-delete.js +1 -1
- package/lib/commands/dataset/link-shared.js +1 -1
- package/lib/commands/dataset/link-update.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a120_0x28ec(){const _0x219bde=['279232jpVobP','19449QCmaPu','Force\x20overwrite\x20local\x20unsynced\x20changes','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','boolean','description','join','498rYqRiD','POST','appCode','toISOString','bool','Filter\x20by\x20SQL\x20display\x20name','lockFilePath','lastSync','skipped','apps','1554800cnOOyR','sql','No\x20remote\x20SQL\x20queries\x20matched.','sqlName','replace','sqlRootDir','sqlCode','11963rPFTxK','74082VrTLPt','push','Pull\x20complete:\x20','length','unchanged','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','Would\x20pull\x20','test','trimStart','Force\x20pull\x20cancelled.','local\x20differs\x20from\x20remote','\x20skipped,\x20','nonInteractive','name','catch','mybatisXml','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','filter','130PxVNZj','4wXVMEi','sqlcode','sqls','paging','str','would_pull','35876pnRtUT','85lrODQy','write','sqlRoot','path','utf8','\x20failed','4113395SFDsfq','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlContent','dbId','\x20written,\x20','conflict','string','pull'];a120_0x28ec=function(){return _0x219bde;};return a120_0x28ec();}const a120_0x5b5265=a120_0x47fb;(function(_0x34ad0f,_0x18df49){const _0x20af07=a120_0x47fb,_0x498bb8=_0x34ad0f();while(!![]){try{const _0x51ff04=parseInt(_0x20af07(0x17d))/0x1+-parseInt(_0x20af07(0x1a9))/0x2*(parseInt(_0x20af07(0x196))/0x3)+-parseInt(_0x20af07(0x1af))/0x4*(parseInt(_0x20af07(0x1b0))/0x5)+-parseInt(_0x20af07(0x184))/0x6*(parseInt(_0x20af07(0x195))/0x7)+-parseInt(_0x20af07(0x18e))/0x8+-parseInt(_0x20af07(0x17e))/0x9*(-parseInt(_0x20af07(0x1a8))/0xa)+parseInt(_0x20af07(0x175))/0xb;if(_0x51ff04===_0x18df49)break;else _0x498bb8['push'](_0x498bb8['shift']());}catch(_0x373da1){_0x498bb8['push'](_0x498bb8['shift']());}}}(a120_0x28ec,0x22f6c));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';function a120_0x47fb(_0x5d2be6,_0x8e40ff){_0x5d2be6=_0x5d2be6-0x175;const _0x28ec8e=a120_0x28ec();let _0x47fb3f=_0x28ec8e[_0x5d2be6];return _0x47fb3f;}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(_0x5586ee,_0x11a94f){const _0x493b2c=a120_0x47fb,_0x44aecb=[];let _0x212155=0x1;while(!![]){const _0x1b9fba=await listSqlQueries(_0x5586ee,{'currentPage':_0x212155,'pageSize':PAGE_SIZE,'sqlCode':_0x11a94f[_0x493b2c(0x194)],'sqlName':_0x11a94f[_0x493b2c(0x191)]}),_0x540565=_0x1b9fba['tableData']??[];_0x44aecb[_0x493b2c(0x197)](..._0x540565);if(_0x540565[_0x493b2c(0x199)]===0x0)break;const _0x25924e=_0x1b9fba[_0x493b2c(0x1ac)]?.['totalCount'];if(_0x25924e!=null?_0x44aecb[_0x493b2c(0x199)]>=_0x25924e:_0x540565[_0x493b2c(0x199)]<PAGE_SIZE)break;_0x212155++;}return _0x44aecb;}async function ensureSqlContent(_0x2f5957){const _0x4e7696=a120_0x47fb;if(_0x2f5957[_0x4e7696(0x177)]!=null&&String(_0x2f5957[_0x4e7696(0x177)])[_0x4e7696(0x199)]>0x0)return _0x2f5957;return getSqlQueryDetail(_0x2f5957[_0x4e7696(0x194)]);}export const sqlPull={'service':'sql','command':a120_0x5b5265(0x17c),'description':a120_0x5b5265(0x176),'risk':a120_0x5b5265(0x1b1),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a120_0x5b5265(0x1a3),'type':a120_0x5b5265(0x17b),'description':a120_0x5b5265(0x189)},{'name':'force','type':a120_0x5b5265(0x181),'description':a120_0x5b5265(0x17f)}],async 'dryRun'(_0x1163e6){const _0x21e039=a120_0x5b5265,_0x291abc=loadSqlProjectConfig(_0x1163e6[_0x21e039(0x186)]),_0x42c3b2=await readSqlLockFile(_0x291abc[_0x21e039(0x18a)]),{appLock:_0x1f37e6}=ensureSqlLockScope(_0x42c3b2??createEmptySqlLock(),_0x291abc[_0x21e039(0x186)],_0x291abc['sqlRoot'],_0x21e039(0x17c)),_0xecb83a=await fetchAllSqlQueries(_0x1163e6[_0x21e039(0x186)],{'sqlCode':_0x1163e6['str']('sqlcode')||undefined,'sqlName':_0x1163e6[_0x21e039(0x1ad)]('name')||undefined}),_0x1f0165=[];for(const _0x3cb94a of _0xecb83a){const _0x477dc7=await ensureSqlContent(_0x3cb94a),_0x37a7e2=ensureRemoteSqlContent(_0x477dc7),_0x3d92b4=detectModeFromSql(_0x477dc7),_0x5898ef=_0x477dc7['dbId']?await getDbName(_0x1163e6[_0x21e039(0x186)],Number(_0x477dc7['dbId']))[_0x21e039(0x1a4)](()=>undefined):undefined,_0x442692=buildLocalSqlFileContent({'sqlCode':_0x477dc7[_0x21e039(0x194)],'sqlName':_0x477dc7[_0x21e039(0x191)],'dbId':_0x477dc7[_0x21e039(0x178)]},_0x37a7e2,{'dbName':_0x5898ef,'mode':_0x3d92b4,'syncedAt':new Date()[_0x21e039(0x187)](),'description':_0x477dc7[_0x21e039(0x182)]}),_0x472c27=buildSqlLockEntry(_0x477dc7,_0x37a7e2,'',{'dbName':_0x5898ef}),_0x14e9cc=resolveLocalSqlFilePath(_0x291abc,_0x477dc7[_0x21e039(0x194)],_0x472c27);let _0x17db02=_0x21e039(0x1ae),_0x189cc8;if(await fileExists(_0x14e9cc)){const _0x491491=await readFile(_0x14e9cc,_0x21e039(0x1b4));isEquivalentPulledSqlFile(_0x491491,_0x442692,_0x3d92b4)?(_0x17db02=_0x21e039(0x18c),_0x189cc8='unchanged'):(_0x17db02=_0x21e039(0x17a),_0x189cc8=_0x21e039(0x1a6));}_0x1f0165[_0x21e039(0x197)]({'sqlCode':_0x477dc7[_0x21e039(0x194)],'sqlName':_0x477dc7['sqlName'],'filePath':_0x14e9cc,'status':_0x17db02,'reason':_0x189cc8});}return{'method':_0x21e039(0x185),'url':_0x21e039(0x19b),'body':{'appCode':_0x1163e6[_0x21e039(0x186)],'sqlCode':_0x1163e6[_0x21e039(0x1ad)]('sqlcode')||null,'sqlName':_0x1163e6[_0x21e039(0x1ad)](_0x21e039(0x1a3))||null,'files':_0x1f0165},'description':_0x21e039(0x19c)+_0x1f0165['length']+'\x20SQL\x20file(s)\x20into\x20'+_0x291abc['sqlRootDir']};},async 'execute'(_0x5ca377){const _0x2b04c5=a120_0x5b5265,_0x4f5355=loadSqlProjectConfig(_0x5ca377[_0x2b04c5(0x186)]),_0x47384b=await readSqlLockFile(_0x4f5355[_0x2b04c5(0x18a)]),{lockData:_0x2bb963,appLock:_0x3c1f91}=ensureSqlLockScope(_0x47384b??createEmptySqlLock(),_0x4f5355[_0x2b04c5(0x186)],_0x4f5355[_0x2b04c5(0x1b2)],_0x2b04c5(0x17c)),_0x3299d8=_0x5ca377[_0x2b04c5(0x188)]('force'),_0x26cc00=await fetchAllSqlQueries(_0x5ca377['appCode'],{'sqlCode':_0x5ca377[_0x2b04c5(0x1ad)](_0x2b04c5(0x1aa))||undefined,'sqlName':_0x5ca377[_0x2b04c5(0x1ad)](_0x2b04c5(0x1a3))||undefined});if(_0x26cc00['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x2b04c5(0x190)};const _0x46cf1d=[],_0x43e4c1=[];for(const _0x5b2b22 of _0x26cc00){try{_0x46cf1d['push'](await ensureSqlContent(_0x5b2b22));}catch(_0x9ad96){_0x43e4c1[_0x2b04c5(0x197)]({'sqlCode':_0x5b2b22[_0x2b04c5(0x194)],'error':_0x9ad96 instanceof Error?_0x9ad96['message']:String(_0x9ad96)});}}if(_0x3299d8&&!_0x5ca377[_0x2b04c5(0x1a2)]){let _0xa2b9ef=![];for(const _0x5ea3d8 of _0x46cf1d){const _0x1e5f9e=detectModeFromSql(_0x5ea3d8),_0x5ce561=_0x5ea3d8[_0x2b04c5(0x178)]?await getDbName(_0x5ca377[_0x2b04c5(0x186)],Number(_0x5ea3d8[_0x2b04c5(0x178)]))[_0x2b04c5(0x1a4)](()=>undefined):undefined,_0x1a71b0=buildLocalSqlFileContent({'sqlCode':_0x5ea3d8[_0x2b04c5(0x194)],'sqlName':_0x5ea3d8[_0x2b04c5(0x191)],'dbId':_0x5ea3d8[_0x2b04c5(0x178)]},ensureRemoteSqlContent(_0x5ea3d8),{'dbName':_0x5ce561,'mode':_0x1e5f9e,'syncedAt':new Date()[_0x2b04c5(0x187)](),'description':_0x5ea3d8[_0x2b04c5(0x182)]}),_0x5c402b=resolveLocalSqlFilePath(_0x4f5355,_0x5ea3d8['sqlCode'],buildSqlLockEntry(_0x5ea3d8,ensureRemoteSqlContent(_0x5ea3d8),'',{'dbName':_0x5ce561}));if(await fileExists(_0x5c402b)){const _0x4057b3=await readFile(_0x5c402b,'utf8');if(!isEquivalentPulledSqlFile(_0x4057b3,_0x1a71b0,_0x1e5f9e)){_0xa2b9ef=!![];break;}}}if(_0xa2b9ef){const _0x3f6a45=await confirmForceOverwrite(_0x2b04c5(0x180));if(!_0x3f6a45)throw CliErrors['cancelled'](_0x2b04c5(0x19f));}}const _0x53de49=cloneSqlLockData(_0x2bb963),_0x3e2214=_0x53de49[_0x2b04c5(0x18d)][_0x4f5355[_0x2b04c5(0x186)]],_0x47d5e0=[],_0x2acf69=[];for(const _0x109307 of _0x46cf1d){const _0x450cc7=_0x3e2214[_0x2b04c5(0x1ab)][_0x109307[_0x2b04c5(0x194)]],_0x432f5b=ensureRemoteSqlContent(_0x109307),_0x502413=detectModeFromSql(_0x109307),_0x358ac7=_0x109307['dbId']?await getDbName(_0x5ca377['appCode'],Number(_0x109307['dbId']))['catch'](()=>undefined):undefined,_0x51f15a=buildLocalSqlFileContent({'sqlCode':_0x109307[_0x2b04c5(0x194)],'sqlName':_0x109307['sqlName'],'dbId':_0x109307[_0x2b04c5(0x178)]},_0x432f5b,{'dbName':_0x358ac7,'mode':_0x502413,'syncedAt':new Date()[_0x2b04c5(0x187)](),'description':_0x109307[_0x2b04c5(0x182)]}),_0x3d0f0a=buildSqlLockEntry(_0x109307,_0x432f5b,computeSqlContentHash(_0x51f15a),{'dbName':_0x358ac7}),_0x3b1d48=_0x3d0f0a[_0x2b04c5(0x1b3)],_0x322547=join(_0x4f5355[_0x2b04c5(0x193)],_0x3b1d48);try{if(await fileExists(_0x322547)){const _0x3ae9f8=await readFile(_0x322547,'utf8');if(isEquivalentPulledSqlFile(_0x3ae9f8,_0x51f15a,_0x502413)){_0x2acf69['push']({'sqlCode':_0x109307['sqlCode'],'reason':_0x2b04c5(0x19a)}),_0x3e2214['sqls'][_0x109307[_0x2b04c5(0x194)]]={..._0x3d0f0a,'hash':computeSqlContentHash(_0x3ae9f8),'path':_0x3b1d48};continue;}if(!_0x3299d8){_0x2acf69[_0x2b04c5(0x197)]({'sqlCode':_0x109307[_0x2b04c5(0x194)],'reason':_0x2b04c5(0x1a0)});continue;}}const _0x15c469=_0x450cc7?.[_0x2b04c5(0x1b3)]?join(_0x4f5355[_0x2b04c5(0x193)],_0x450cc7[_0x2b04c5(0x1b3)]):undefined;_0x15c469&&_0x15c469!==_0x322547&&await fileExists(_0x15c469)&&await rm(_0x15c469,{'force':!![]}),await ensureParentDirectory(_0x322547),await writeFile(_0x322547,_0x51f15a,_0x2b04c5(0x1b4)),_0x3e2214['sqls'][_0x109307[_0x2b04c5(0x194)]]={..._0x3d0f0a,'path':_0x3b1d48},_0x47d5e0[_0x2b04c5(0x197)]({'sqlCode':_0x109307[_0x2b04c5(0x194)],'filePath':_0x322547});}catch(_0x2f542b){_0x43e4c1[_0x2b04c5(0x197)]({'sqlCode':_0x109307[_0x2b04c5(0x194)],'error':_0x2f542b instanceof Error?_0x2f542b['message']:String(_0x2f542b)});}}return _0x3e2214[_0x2b04c5(0x18b)]=new Date()['toISOString'](),await writeSqlLockFile(_0x4f5355[_0x2b04c5(0x18a)],_0x53de49),{'ok':_0x43e4c1[_0x2b04c5(0x199)]===0x0,'data':{'pulled':_0x47d5e0,'skipped':_0x2acf69,'failed':_0x43e4c1},'message':_0x2b04c5(0x198)+_0x47d5e0[_0x2b04c5(0x199)]+_0x2b04c5(0x179)+_0x2acf69['length']+_0x2b04c5(0x1a1)+_0x43e4c1[_0x2b04c5(0x199)]+_0x2b04c5(0x1b5)};}};function detectModeFromSql(_0x5e2a25){const _0x5108dd=a120_0x5b5265,_0x5abcbc=ensureRemoteSqlContent(_0x5e2a25),_0x1b53e6=stripLocalSqlMetadata(_0x5abcbc,_0x5108dd(0x1a5))[_0x5108dd(0x19e)]();if(/^<(select|insert|update|delete)\b/i[_0x5108dd(0x19d)](_0x1b53e6))return _0x5108dd(0x1a5);return _0x5108dd(0x18f);}function isEquivalentPulledSqlFile(_0xab58fe,_0x38a4da,_0x3c1e2e){return normalizePullComparableContent(_0xab58fe,_0x3c1e2e)===normalizePullComparableContent(_0x38a4da,_0x3c1e2e);}function normalizePullComparableContent(_0x1e507b,_0x489231){const _0x42cdc2=a120_0x5b5265,_0x4b8e8c=_0x1e507b[_0x42cdc2(0x192)](/\r\n/g,'\x0a')['split']('\x0a'),_0x42da1a=_0x4b8e8c[_0x42cdc2(0x1a7)](_0xd17786=>!isSyncedAtMetadataLine(_0xd17786,_0x489231));return _0x42da1a[_0x42cdc2(0x183)]('\x0a');}function isSyncedAtMetadataLine(_0x4a194c,_0x5eee3f){const _0x496a3a=a120_0x5b5265;if(_0x5eee3f==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x496a3a(0x19d)](_0x4a194c);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x4a194c);}
|
|
1
|
+
const a120_0x4889ed=a120_0x54fb;(function(_0x21013a,_0x1db557){const _0x773419=a120_0x54fb,_0x10028a=_0x21013a();while(!![]){try{const _0x48e00f=parseInt(_0x773419(0x17b))/0x1*(-parseInt(_0x773419(0x1aa))/0x2)+-parseInt(_0x773419(0x18a))/0x3*(-parseInt(_0x773419(0x19f))/0x4)+parseInt(_0x773419(0x1a9))/0x5+parseInt(_0x773419(0x1b6))/0x6*(-parseInt(_0x773419(0x183))/0x7)+parseInt(_0x773419(0x1ac))/0x8+-parseInt(_0x773419(0x181))/0x9+parseInt(_0x773419(0x17a))/0xa*(parseInt(_0x773419(0x182))/0xb);if(_0x48e00f===_0x1db557)break;else _0x10028a['push'](_0x10028a['shift']());}catch(_0x151f98){_0x10028a['push'](_0x10028a['shift']());}}}(a120_0x549c,0xd29c7));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';function a120_0x549c(){const _0x13278b=['mybatisXml','conflict','\x20failed','totalCount','7104663lMKyTI','22AyXFVr','3031mIYNgw','length','str','path','nonInteractive','force','write','2409KtQkEO','catch','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','filter','unchanged','Would\x20pull\x20','description','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','apps','string','bool','sqlRoot','name','test','pull','message','Pull\x20complete:\x20','push','\x20skipped,\x20','sqlContent','tableData','7444SwJZjn','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sqls','sqlRootDir','toISOString','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','paging','No\x20remote\x20SQL\x20queries\x20matched.','boolean','cancelled','1458875NIyJOd','838364mjcDDU','sqlName','7981024HnbqvR','sql','lastSync','\x20written,\x20','Force\x20pull\x20cancelled.','Force\x20overwrite\x20local\x20unsynced\x20changes','dbId','appCode','sqlCode','sqlcode','11028LfakGa','skipped','utf8','split','POST','would_pull','4608420TIwyEI','3BuKRBV','lockFilePath'];a120_0x549c=function(){return _0x13278b;};return a120_0x549c();}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;function a120_0x54fb(_0x52ec6e,_0x328825){_0x52ec6e=_0x52ec6e-0x179;const _0x549cbd=a120_0x549c();let _0x54fbc7=_0x549cbd[_0x52ec6e];return _0x54fbc7;}async function fetchAllSqlQueries(_0x18128f,_0x14f909){const _0x4eb69f=a120_0x54fb,_0x565c43=[];let _0xc7cb44=0x1;while(!![]){const _0x33f782=await listSqlQueries(_0x18128f,{'currentPage':_0xc7cb44,'pageSize':PAGE_SIZE,'sqlCode':_0x14f909[_0x4eb69f(0x1b4)],'sqlName':_0x14f909[_0x4eb69f(0x1ab)]}),_0x1c1e52=_0x33f782[_0x4eb69f(0x19e)]??[];_0x565c43['push'](..._0x1c1e52);if(_0x1c1e52[_0x4eb69f(0x184)]===0x0)break;const _0x17179f=_0x33f782[_0x4eb69f(0x1a5)]?.[_0x4eb69f(0x180)];if(_0x17179f!=null?_0x565c43[_0x4eb69f(0x184)]>=_0x17179f:_0x1c1e52[_0x4eb69f(0x184)]<PAGE_SIZE)break;_0xc7cb44++;}return _0x565c43;}async function ensureSqlContent(_0x19f1d4){const _0x3b6b10=a120_0x54fb;if(_0x19f1d4['sqlContent']!=null&&String(_0x19f1d4[_0x3b6b10(0x19d)])['length']>0x0)return _0x19f1d4;return getSqlQueryDetail(_0x19f1d4[_0x3b6b10(0x1b4)]);}export const sqlPull={'service':a120_0x4889ed(0x1ad),'command':a120_0x4889ed(0x198),'description':a120_0x4889ed(0x1a4),'risk':a120_0x4889ed(0x189),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a120_0x4889ed(0x196),'type':a120_0x4889ed(0x193),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':'force','type':a120_0x4889ed(0x1a7),'description':a120_0x4889ed(0x1b1)}],async 'dryRun'(_0x2d8d6b){const _0x503e05=a120_0x4889ed,_0x29d6b2=loadSqlProjectConfig(_0x2d8d6b[_0x503e05(0x1b3)]),_0x47f34b=await readSqlLockFile(_0x29d6b2[_0x503e05(0x17c)]),{appLock:_0x336d5c}=ensureSqlLockScope(_0x47f34b??createEmptySqlLock(),_0x29d6b2[_0x503e05(0x1b3)],_0x29d6b2[_0x503e05(0x195)],_0x503e05(0x198)),_0x29f617=await fetchAllSqlQueries(_0x2d8d6b[_0x503e05(0x1b3)],{'sqlCode':_0x2d8d6b[_0x503e05(0x185)](_0x503e05(0x1b5))||undefined,'sqlName':_0x2d8d6b[_0x503e05(0x185)](_0x503e05(0x196))||undefined}),_0x2dda48=[];for(const _0x318ca7 of _0x29f617){const _0x7e49c0=await ensureSqlContent(_0x318ca7),_0x188a7a=ensureRemoteSqlContent(_0x7e49c0),_0x4eeb71=detectModeFromSql(_0x7e49c0),_0x20718e=_0x7e49c0['dbId']?await getDbName(_0x2d8d6b[_0x503e05(0x1b3)],Number(_0x7e49c0[_0x503e05(0x1b2)]))[_0x503e05(0x18b)](()=>undefined):undefined,_0x4bea53=buildLocalSqlFileContent({'sqlCode':_0x7e49c0[_0x503e05(0x1b4)],'sqlName':_0x7e49c0[_0x503e05(0x1ab)],'dbId':_0x7e49c0[_0x503e05(0x1b2)]},_0x188a7a,{'dbName':_0x20718e,'mode':_0x4eeb71,'syncedAt':new Date()[_0x503e05(0x1a3)](),'description':_0x7e49c0[_0x503e05(0x190)]}),_0x3dfdc7=buildSqlLockEntry(_0x7e49c0,_0x188a7a,'',{'dbName':_0x20718e}),_0x1630d6=resolveLocalSqlFilePath(_0x29d6b2,_0x7e49c0[_0x503e05(0x1b4)],_0x3dfdc7);let _0x6c617d=_0x503e05(0x179),_0x359a93;if(await fileExists(_0x1630d6)){const _0x1c5c71=await readFile(_0x1630d6,_0x503e05(0x1b8));isEquivalentPulledSqlFile(_0x1c5c71,_0x4bea53,_0x4eeb71)?(_0x6c617d=_0x503e05(0x1b7),_0x359a93=_0x503e05(0x18e)):(_0x6c617d=_0x503e05(0x17e),_0x359a93=_0x503e05(0x1a0));}_0x2dda48[_0x503e05(0x19b)]({'sqlCode':_0x7e49c0[_0x503e05(0x1b4)],'sqlName':_0x7e49c0[_0x503e05(0x1ab)],'filePath':_0x1630d6,'status':_0x6c617d,'reason':_0x359a93});}return{'method':_0x503e05(0x1ba),'url':_0x503e05(0x191),'body':{'appCode':_0x2d8d6b['appCode'],'sqlCode':_0x2d8d6b[_0x503e05(0x185)](_0x503e05(0x1b5))||null,'sqlName':_0x2d8d6b[_0x503e05(0x185)]('name')||null,'files':_0x2dda48},'description':_0x503e05(0x18f)+_0x2dda48['length']+'\x20SQL\x20file(s)\x20into\x20'+_0x29d6b2[_0x503e05(0x1a2)]};},async 'execute'(_0x63da69){const _0x1e50fb=a120_0x4889ed,_0x4e4f27=loadSqlProjectConfig(_0x63da69[_0x1e50fb(0x1b3)]),_0x193ef0=await readSqlLockFile(_0x4e4f27[_0x1e50fb(0x17c)]),{lockData:_0xbad6c3,appLock:_0x5d26cf}=ensureSqlLockScope(_0x193ef0??createEmptySqlLock(),_0x4e4f27['appCode'],_0x4e4f27[_0x1e50fb(0x195)],_0x1e50fb(0x198)),_0x59f8e6=_0x63da69[_0x1e50fb(0x194)](_0x1e50fb(0x188)),_0x1396b4=await fetchAllSqlQueries(_0x63da69['appCode'],{'sqlCode':_0x63da69['str'](_0x1e50fb(0x1b5))||undefined,'sqlName':_0x63da69[_0x1e50fb(0x185)]('name')||undefined});if(_0x1396b4[_0x1e50fb(0x184)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x1e50fb(0x1a6)};const _0x2c787a=[],_0x5d65f0=[];for(const _0x5f196c of _0x1396b4){try{_0x2c787a[_0x1e50fb(0x19b)](await ensureSqlContent(_0x5f196c));}catch(_0x57dfa6){_0x5d65f0[_0x1e50fb(0x19b)]({'sqlCode':_0x5f196c[_0x1e50fb(0x1b4)],'error':_0x57dfa6 instanceof Error?_0x57dfa6[_0x1e50fb(0x199)]:String(_0x57dfa6)});}}if(_0x59f8e6&&!_0x63da69[_0x1e50fb(0x187)]){let _0x19c305=![];for(const _0x339566 of _0x2c787a){const _0x3ea473=detectModeFromSql(_0x339566),_0x1f35d4=_0x339566[_0x1e50fb(0x1b2)]?await getDbName(_0x63da69['appCode'],Number(_0x339566['dbId']))[_0x1e50fb(0x18b)](()=>undefined):undefined,_0x5a6360=buildLocalSqlFileContent({'sqlCode':_0x339566['sqlCode'],'sqlName':_0x339566['sqlName'],'dbId':_0x339566[_0x1e50fb(0x1b2)]},ensureRemoteSqlContent(_0x339566),{'dbName':_0x1f35d4,'mode':_0x3ea473,'syncedAt':new Date()['toISOString'](),'description':_0x339566[_0x1e50fb(0x190)]}),_0xd424b1=resolveLocalSqlFilePath(_0x4e4f27,_0x339566[_0x1e50fb(0x1b4)],buildSqlLockEntry(_0x339566,ensureRemoteSqlContent(_0x339566),'',{'dbName':_0x1f35d4}));if(await fileExists(_0xd424b1)){const _0x26f695=await readFile(_0xd424b1,'utf8');if(!isEquivalentPulledSqlFile(_0x26f695,_0x5a6360,_0x3ea473)){_0x19c305=!![];break;}}}if(_0x19c305){const _0x531ad4=await confirmForceOverwrite(_0x1e50fb(0x18c));if(!_0x531ad4)throw CliErrors[_0x1e50fb(0x1a8)](_0x1e50fb(0x1b0));}}const _0x84884a=cloneSqlLockData(_0xbad6c3),_0x4a11c7=_0x84884a[_0x1e50fb(0x192)][_0x4e4f27[_0x1e50fb(0x1b3)]],_0xb0d6fe=[],_0x4cc8bd=[];for(const _0x3087ab of _0x2c787a){const _0x53b9f8=_0x4a11c7['sqls'][_0x3087ab['sqlCode']],_0xa64e1f=ensureRemoteSqlContent(_0x3087ab),_0x4e799a=detectModeFromSql(_0x3087ab),_0x5b70b6=_0x3087ab[_0x1e50fb(0x1b2)]?await getDbName(_0x63da69[_0x1e50fb(0x1b3)],Number(_0x3087ab['dbId']))['catch'](()=>undefined):undefined,_0x4539f7=buildLocalSqlFileContent({'sqlCode':_0x3087ab[_0x1e50fb(0x1b4)],'sqlName':_0x3087ab[_0x1e50fb(0x1ab)],'dbId':_0x3087ab[_0x1e50fb(0x1b2)]},_0xa64e1f,{'dbName':_0x5b70b6,'mode':_0x4e799a,'syncedAt':new Date()[_0x1e50fb(0x1a3)](),'description':_0x3087ab[_0x1e50fb(0x190)]}),_0x2199a9=buildSqlLockEntry(_0x3087ab,_0xa64e1f,computeSqlContentHash(_0x4539f7),{'dbName':_0x5b70b6}),_0x272b57=_0x2199a9['path'],_0x3f144b=join(_0x4e4f27['sqlRootDir'],_0x272b57);try{if(await fileExists(_0x3f144b)){const _0x55e838=await readFile(_0x3f144b,_0x1e50fb(0x1b8));if(isEquivalentPulledSqlFile(_0x55e838,_0x4539f7,_0x4e799a)){_0x4cc8bd['push']({'sqlCode':_0x3087ab[_0x1e50fb(0x1b4)],'reason':_0x1e50fb(0x18e)}),_0x4a11c7[_0x1e50fb(0x1a1)][_0x3087ab['sqlCode']]={..._0x2199a9,'hash':computeSqlContentHash(_0x55e838),'path':_0x272b57};continue;}if(!_0x59f8e6){_0x4cc8bd['push']({'sqlCode':_0x3087ab[_0x1e50fb(0x1b4)],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0xf549d9=_0x53b9f8?.[_0x1e50fb(0x186)]?join(_0x4e4f27[_0x1e50fb(0x1a2)],_0x53b9f8['path']):undefined;_0xf549d9&&_0xf549d9!==_0x3f144b&&await fileExists(_0xf549d9)&&await rm(_0xf549d9,{'force':!![]}),await ensureParentDirectory(_0x3f144b),await writeFile(_0x3f144b,_0x4539f7,_0x1e50fb(0x1b8)),_0x4a11c7[_0x1e50fb(0x1a1)][_0x3087ab[_0x1e50fb(0x1b4)]]={..._0x2199a9,'path':_0x272b57},_0xb0d6fe[_0x1e50fb(0x19b)]({'sqlCode':_0x3087ab['sqlCode'],'filePath':_0x3f144b});}catch(_0x544c2b){_0x5d65f0['push']({'sqlCode':_0x3087ab[_0x1e50fb(0x1b4)],'error':_0x544c2b instanceof Error?_0x544c2b[_0x1e50fb(0x199)]:String(_0x544c2b)});}}return _0x4a11c7[_0x1e50fb(0x1ae)]=new Date()[_0x1e50fb(0x1a3)](),await writeSqlLockFile(_0x4e4f27[_0x1e50fb(0x17c)],_0x84884a),{'ok':_0x5d65f0[_0x1e50fb(0x184)]===0x0,'data':{'pulled':_0xb0d6fe,'skipped':_0x4cc8bd,'failed':_0x5d65f0},'message':_0x1e50fb(0x19a)+_0xb0d6fe['length']+_0x1e50fb(0x1af)+_0x4cc8bd['length']+_0x1e50fb(0x19c)+_0x5d65f0[_0x1e50fb(0x184)]+_0x1e50fb(0x17f)};}};function detectModeFromSql(_0xde3e6f){const _0x14b0c6=a120_0x4889ed,_0x79c20e=ensureRemoteSqlContent(_0xde3e6f),_0x2ad92c=stripLocalSqlMetadata(_0x79c20e,'mybatisXml')['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x14b0c6(0x197)](_0x2ad92c))return _0x14b0c6(0x17d);return'sql';}function isEquivalentPulledSqlFile(_0xb46ecb,_0x565115,_0x3115ed){return normalizePullComparableContent(_0xb46ecb,_0x3115ed)===normalizePullComparableContent(_0x565115,_0x3115ed);}function normalizePullComparableContent(_0x42b1fd,_0x10da84){const _0x17330c=a120_0x4889ed,_0x416da8=_0x42b1fd['replace'](/\r\n/g,'\x0a')[_0x17330c(0x1b9)]('\x0a'),_0x3635d7=_0x416da8[_0x17330c(0x18d)](_0x4a4236=>!isSyncedAtMetadataLine(_0x4a4236,_0x10da84));return _0x3635d7['join']('\x0a');}function isSyncedAtMetadataLine(_0x15ded,_0x301c54){const _0x410517=a120_0x4889ed;if(_0x301c54===_0x410517(0x17d))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x410517(0x197)](_0x15ded);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x15ded);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a121_0x16bd1e=a121_0x5652;(function(_0x5048fd,_0x361671){const _0x33defb=a121_0x5652,_0x51d025=_0x5048fd();while(!![]){try{const _0x6b38a9=parseInt(_0x33defb(0xae))/0x1*(parseInt(_0x33defb(0xce))/0x2)+-parseInt(_0x33defb(0xb2))/0x3+parseInt(_0x33defb(0xa2))/0x4*(-parseInt(_0x33defb(0xcd))/0x5)+-parseInt(_0x33defb(0xb3))/0x6+parseInt(_0x33defb(0xad))/0x7+parseInt(_0x33defb(0xa9))/0x8*(parseInt(_0x33defb(0xc4))/0x9)+parseInt(_0x33defb(0xbd))/0xa;if(_0x6b38a9===_0x361671)break;else _0x51d025['push'](_0x51d025['shift']());}catch(_0x18e8b1){_0x51d025['push'](_0x51d025['shift']());}}}(a121_0x2983,0xd8931));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';function a121_0x2983(){const _0x323b00=['str','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','validation','631043AmGRnd','3553nqWVir','get','exec','map','3299061VLbVIU','1994352NLzmLW','Push\x20local\x20SQL\x20files\x20to\x20remote','dbDirectory','dbId','high-risk-write','sql','remoteId','sqlRoot','mode','force','17654990fWstHC','filePath','sqlCode','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','sqlName','projectRoot','unchanged','369PdBPHV','sqlConfig','/smartapi/custom/updateUserCustomSql','boolean','filter','version','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','appCode','startsWith','25XCtZuC','132LzJJkH','replace','sqlRootDir','toISOString','join','\x20pushed,\x20','lastSync','sqls','POST','Would\x20push\x20','push','utf8','No\x20local\x20SQL\x20files\x20found.','trashDir','sqlcode','message','length','path','relativePath','626516FbzizT','dbName','bool','No\x20database\x20matches\x20local\x20directory\x20\x22','catch','hash','lockFilePath','197496mVjori'];a121_0x2983=function(){return _0x323b00;};return a121_0x2983();}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';function a121_0x5652(_0x53ece0,_0x1deea9){_0x53ece0=_0x53ece0-0x98;const _0x29833e=a121_0x2983();let _0x56525c=_0x29833e[_0x53ece0];return _0x56525c;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0xd6b912,_0x3eed7a,_0x2671bb){const _0x1bb1e4=a121_0x5652,_0x50d18a=await scanLocalSqlQueries(_0xd6b912),_0x3432c2=new Map();for(const _0x209088 of _0x50d18a){if(_0x2671bb&&_0x209088[_0x1bb1e4(0xbf)]!==_0x2671bb)continue;const _0x164b89=_0x3432c2[_0x1bb1e4(0xaf)](_0x209088[_0x1bb1e4(0xbf)])??[];_0x164b89[_0x1bb1e4(0x99)](_0x209088),_0x3432c2['set'](_0x209088[_0x1bb1e4(0xbf)],_0x164b89);}if(_0x2671bb&&!_0x3432c2['has'](_0x2671bb))throw CliErrors[_0x1bb1e4(0xac)]('Local\x20SQL\x20not\x20found:\x20'+_0x2671bb);const _0x3903c7=[];for(const [_0x32c87e,_0x2f8e1e]of _0x3432c2['entries']()){if(_0x2f8e1e[_0x1bb1e4(0x9f)]===0x1){_0x3903c7[_0x1bb1e4(0x99)](_0x2f8e1e[0x0]);continue;}const _0x4b4d79=_0x3eed7a[_0x1bb1e4(0xd5)][_0x32c87e],_0x17f231=_0x4b4d79?.[_0x1bb1e4(0xa0)],_0x36f2d6=_0x17f231?_0x2f8e1e['filter'](_0x5f2d25=>_0x5f2d25['relativePath']!==_0x17f231):_0x2f8e1e;if(_0x4b4d79&&_0x36f2d6[_0x1bb1e4(0x9f)]===0x1){_0x3903c7[_0x1bb1e4(0x99)](_0x36f2d6[0x0]);continue;}throw CliErrors['validation']('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x32c87e+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x3903c7;}export const sqlPush={'service':a121_0x16bd1e(0xb8),'command':a121_0x16bd1e(0x99),'description':a121_0x16bd1e(0xb4),'risk':a121_0x16bd1e(0xb7),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a121_0x16bd1e(0xc7),'description':a121_0x16bd1e(0xab)}],async 'dryRun'(_0x229f79){const _0x4e25d2=a121_0x16bd1e,_0x44886f=loadSqlProjectConfig(_0x229f79['appCode']),_0x3c198a=await readSqlLockFile(_0x44886f[_0x4e25d2(0xa8)]),{appLock:_0x11d93e}=ensureSqlLockScope(_0x3c198a??createEmptySqlLock(),_0x229f79[_0x4e25d2(0xcb)],_0x44886f[_0x4e25d2(0xba)],_0x4e25d2(0x99)),_0x168f05=await getTargetSqlQueries(_0x44886f,_0x11d93e,_0x229f79[_0x4e25d2(0xaa)](_0x4e25d2(0x9d))||undefined),_0x1216d0=[];for(const _0x401dcc of _0x168f05){const _0x331cec=await computeSqlFileHash(_0x401dcc[_0x4e25d2(0xbe)]),_0x55f52e=_0x11d93e['sqls'][_0x401dcc[_0x4e25d2(0xbf)]],_0x54ed9c=!!_0x55f52e&&(_0x55f52e[_0x4e25d2(0xa0)]!==_0x401dcc[_0x4e25d2(0xa1)]||!!_0x401dcc[_0x4e25d2(0xc1)]&&_0x55f52e['sqlName']!==_0x401dcc[_0x4e25d2(0xc1)]);if(!_0x229f79[_0x4e25d2(0xa4)](_0x4e25d2(0xbc))&&_0x55f52e&&_0x55f52e[_0x4e25d2(0xa7)]===_0x331cec&&!_0x54ed9c)continue;_0x1216d0['push'](_0x401dcc[_0x4e25d2(0xbf)]);}return{'method':_0x4e25d2(0xd6),'url':_0x4e25d2(0xc6),'body':{'sqlCodes':_0x1216d0,'appCode':_0x229f79[_0x4e25d2(0xcb)]},'description':_0x4e25d2(0x98)+_0x1216d0[_0x4e25d2(0x9f)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x5730a8){const _0x2779c5=a121_0x16bd1e,_0x11f1ee=loadSqlProjectConfig(_0x5730a8[_0x2779c5(0xcb)]),_0x1ec88a=await readSqlLockFile(_0x11f1ee[_0x2779c5(0xa8)]),{lockData:_0x5df2b0,appLock:_0x99ccad}=ensureSqlLockScope(_0x1ec88a??createEmptySqlLock(),_0x5730a8[_0x2779c5(0xcb)],_0x11f1ee['sqlRoot'],_0x2779c5(0x99)),_0x4640bb=await getTargetSqlQueries(_0x11f1ee,_0x99ccad,_0x5730a8['str'](_0x2779c5(0x9d))||undefined);if(_0x4640bb[_0x2779c5(0x9f)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x2779c5(0x9b)};const _0x43b13b=[],_0x681a29=[],_0xdfbfc3=[];for(const _0xd25aad of _0x4640bb){const _0x38bee4=_0x99ccad[_0x2779c5(0xd5)][_0xd25aad[_0x2779c5(0xbf)]];if(!_0x38bee4){_0xdfbfc3[_0x2779c5(0x99)]({'sqlCode':_0xd25aad[_0x2779c5(0xbf)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x2fbfc2=await computeSqlFileHash(_0xd25aad[_0x2779c5(0xbe)]),_0x4ae418=_0x38bee4[_0x2779c5(0xa0)]!==_0xd25aad['relativePath']||!!_0xd25aad[_0x2779c5(0xc1)]&&_0x38bee4[_0x2779c5(0xc1)]!==_0xd25aad[_0x2779c5(0xc1)];if(!_0x5730a8[_0x2779c5(0xa4)](_0x2779c5(0xbc))&&_0x38bee4[_0x2779c5(0xa7)]===_0x2fbfc2&&!_0x4ae418){_0x681a29['push']({'sqlCode':_0xd25aad[_0x2779c5(0xbf)],'reason':_0x2779c5(0xc3)});continue;}if(_0x38bee4['version']==null){_0xdfbfc3[_0x2779c5(0x99)]({'sqlCode':_0xd25aad[_0x2779c5(0xbf)],'error':_0x2779c5(0xca)});continue;}const _0x399c52=await readFile(_0xd25aad[_0x2779c5(0xbe)],_0x2779c5(0x9a)),_0x465434=stripLocalSqlMetadata(_0x399c52,_0xd25aad[_0x2779c5(0xbb)]),_0x387c1e=_0xd25aad[_0x2779c5(0xc1)]||_0x38bee4['sqlName'],_0x2ff236=await resolveTargetDbBinding(_0x5730a8[_0x2779c5(0xcb)],_0xd25aad,_0x38bee4),_0x1ec4e8=await updateSqlQuery({'id':_0x38bee4[_0x2779c5(0xb9)],'appCode':_0x5730a8['appCode'],'sqlCode':_0xd25aad[_0x2779c5(0xbf)],'sqlName':_0x387c1e,'dbId':_0x2ff236[_0x2779c5(0xb6)],'version':_0x38bee4[_0x2779c5(0xc9)],'sqlContent':_0x465434,'sqlConfig':_0x38bee4[_0x2779c5(0xc5)]??undefined}),_0x49ba84=_0x1ec4e8[_0x2779c5(0xb6)]?await getDbName(_0x5730a8['appCode'],Number(_0x1ec4e8[_0x2779c5(0xb6)]))['catch'](()=>_0x2ff236[_0x2779c5(0xa3)]):_0x2ff236[_0x2779c5(0xa3)];_0x99ccad[_0x2779c5(0xd5)][_0xd25aad['sqlCode']]={...buildSqlLockEntry(_0x1ec4e8,_0x465434,_0x2fbfc2,{'dbName':_0x49ba84}),'path':_0xd25aad['relativePath'],'mode':_0x38bee4[_0x2779c5(0xbb)]},await archivePreviousSqlFileIfNeeded(_0x11f1ee,_0x38bee4[_0x2779c5(0xa0)],_0xd25aad[_0x2779c5(0xa1)]),_0x43b13b[_0x2779c5(0x99)]({'sqlCode':_0xd25aad[_0x2779c5(0xbf)],'remoteId':_0x38bee4[_0x2779c5(0xb9)]});}catch(_0x14c104){_0xdfbfc3[_0x2779c5(0x99)]({'sqlCode':_0xd25aad['sqlCode'],'error':_0x14c104 instanceof Error?_0x14c104[_0x2779c5(0x9e)]:String(_0x14c104)});}}return _0x99ccad[_0x2779c5(0xd4)]=new Date()[_0x2779c5(0xd1)](),await writeSqlLockFile(_0x11f1ee[_0x2779c5(0xa8)],_0x5df2b0),{'ok':_0xdfbfc3['length']===0x0,'data':{'pushed':_0x43b13b,'skipped':_0x681a29,'failed':_0xdfbfc3},'message':'Push\x20complete:\x20'+_0x43b13b['length']+_0x2779c5(0xd3)+_0x681a29[_0x2779c5(0x9f)]+'\x20skipped,\x20'+_0xdfbfc3[_0x2779c5(0x9f)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x2116cc,_0x4137ba,_0x765ea7){const _0x4380af=a121_0x16bd1e;if(!_0x4137ba||_0x4137ba===_0x765ea7)return;const _0x1f0eda=join(_0x2116cc['sqlRootDir'],_0x4137ba);if(!await fileExists(_0x1f0eda))return;const _0x5d7b84=await moveToTrash(_0x2116cc[_0x4380af(0xc2)],_0x2116cc[_0x4380af(0x9c)],_0x1f0eda);await cleanupEmptyDirectories(dirname(_0x1f0eda),_0x2116cc[_0x4380af(0xd0)]),void _0x5d7b84;}async function moveToTrash(_0x351616,_0x7cf02e,_0x13a1d3){const _0x28c927=a121_0x16bd1e,_0x2e4823=new Date()[_0x28c927(0xd1)]()[_0x28c927(0xcf)](/[:.]/g,'-'),_0x32a059=relative(_0x351616,_0x13a1d3),_0x523332=join(_0x7cf02e,_0x2e4823,_0x32a059);return await mkdir(dirname(_0x523332),{'recursive':!![]}),await rename(_0x13a1d3,_0x523332),_0x523332;}async function cleanupEmptyDirectories(_0x343e2e,_0x3b1598){const _0x5b7588=a121_0x16bd1e;let _0x3eab1c=resolve(_0x343e2e);const _0x39b8ff=resolve(_0x3b1598);while(_0x3eab1c[_0x5b7588(0xcc)](''+_0x39b8ff+sep)||_0x3eab1c===_0x39b8ff){if(_0x3eab1c===_0x39b8ff)return;try{const _0x22d387=await readdir(_0x3eab1c);if(_0x22d387[_0x5b7588(0x9f)]>0x0)return;await rmdir(_0x3eab1c);}catch{return;}_0x3eab1c=dirname(_0x3eab1c);}}async function resolveTargetDbBinding(_0x107f26,_0x280170,_0x49d4cc){const _0x58f9e8=a121_0x16bd1e,_0x46c07c=_0x280170[_0x58f9e8(0xb5)];if(!_0x46c07c)return{'dbId':_0x49d4cc[_0x58f9e8(0xb6)],'dbName':_0x49d4cc[_0x58f9e8(0xa3)]};const _0x45e0e9=buildDbDirectoryName(_0x49d4cc[_0x58f9e8(0xa3)],_0x49d4cc['dbId']);if(_0x46c07c===_0x45e0e9)return{'dbId':_0x49d4cc[_0x58f9e8(0xb6)],'dbName':_0x49d4cc[_0x58f9e8(0xa3)]};const _0x5c2c04=parseExplicitDbDirectory(_0x46c07c);if(_0x5c2c04!=null)return{'dbId':_0x5c2c04,'dbName':await getDbName(_0x107f26,_0x5c2c04)[_0x58f9e8(0xa6)](()=>undefined)};const _0x11cf1b=await listDatabases(_0x107f26),_0x347df6=_0x11cf1b[_0x58f9e8(0xc8)](_0x466168=>buildDbDirectoryName(_0x466168[_0x58f9e8(0xa3)],_0x466168[_0x58f9e8(0xb6)])===_0x46c07c);if(_0x347df6[_0x58f9e8(0x9f)]===0x1)return{'dbId':_0x347df6[0x0][_0x58f9e8(0xb6)],'dbName':_0x347df6[0x0][_0x58f9e8(0xa3)]};if(_0x347df6[_0x58f9e8(0x9f)]===0x0)throw CliErrors['validation'](_0x58f9e8(0xa5)+_0x46c07c+'\x22\x20for\x20sqlCode\x20'+_0x280170[_0x58f9e8(0xbf)]+'.');const _0x3eda5f=_0x347df6[_0x58f9e8(0xb1)](_0x57bbba=>_0x57bbba[_0x58f9e8(0xa3)]+'\x20('+_0x57bbba['dbId']+')')[_0x58f9e8(0xd2)](',\x20');throw CliErrors[_0x58f9e8(0xac)]('Local\x20directory\x20\x22'+_0x46c07c+_0x58f9e8(0xc0)+_0x280170['sqlCode']+':\x20'+_0x3eda5f);}function parseExplicitDbDirectory(_0xf1205f){const _0x469fa=a121_0x16bd1e,_0xc00ab9=/^db-(\d+)$/[_0x469fa(0xb0)](_0xf1205f);if(!_0xc00ab9)return null;const _0x2b3870=Number(_0xc00ab9[0x1]);return Number['isFinite'](_0x2b3870)&&_0x2b3870>0x0?_0x2b3870:null;}
|
|
1
|
+
const a121_0x4585ee=a121_0x28f9;(function(_0x3525b5,_0x771c74){const _0xe869a6=a121_0x28f9,_0x57e2bf=_0x3525b5();while(!![]){try{const _0x1e7a24=parseInt(_0xe869a6(0xec))/0x1*(-parseInt(_0xe869a6(0x10d))/0x2)+parseInt(_0xe869a6(0x115))/0x3+-parseInt(_0xe869a6(0xfa))/0x4*(-parseInt(_0xe869a6(0x107))/0x5)+parseInt(_0xe869a6(0x102))/0x6+parseInt(_0xe869a6(0x10a))/0x7*(parseInt(_0xe869a6(0xfe))/0x8)+-parseInt(_0xe869a6(0x10e))/0x9*(parseInt(_0xe869a6(0x100))/0xa)+-parseInt(_0xe869a6(0xff))/0xb;if(_0x1e7a24===_0x771c74)break;else _0x57e2bf['push'](_0x57e2bf['shift']());}catch(_0x1d00b9){_0x57e2bf['push'](_0x57e2bf['shift']());}}}(a121_0x468e,0x6fef9));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a121_0x28f9(_0x42ac03,_0xca87a6){_0x42ac03=_0x42ac03-0xe4;const _0x468e67=a121_0x468e();let _0x28f9b1=_0x468e67[_0x42ac03];return _0x28f9b1;}import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x246cfe,_0x36ec73,_0x5e8609){const _0x1a0e65=a121_0x28f9,_0x4eaf99=await scanLocalSqlQueries(_0x246cfe),_0x2d6fc7=new Map();for(const _0x3481ad of _0x4eaf99){if(_0x5e8609&&_0x3481ad[_0x1a0e65(0xf7)]!==_0x5e8609)continue;const _0x5a213e=_0x2d6fc7[_0x1a0e65(0xfd)](_0x3481ad[_0x1a0e65(0xf7)])??[];_0x5a213e['push'](_0x3481ad),_0x2d6fc7[_0x1a0e65(0x11d)](_0x3481ad[_0x1a0e65(0xf7)],_0x5a213e);}if(_0x5e8609&&!_0x2d6fc7['has'](_0x5e8609))throw CliErrors[_0x1a0e65(0xf5)](_0x1a0e65(0xf6)+_0x5e8609);const _0xb350ad=[];for(const [_0x35fdc1,_0x826910]of _0x2d6fc7['entries']()){if(_0x826910[_0x1a0e65(0x103)]===0x1){_0xb350ad[_0x1a0e65(0xeb)](_0x826910[0x0]);continue;}const _0x2c3152=_0x36ec73[_0x1a0e65(0x104)][_0x35fdc1],_0x1ebb53=_0x2c3152?.[_0x1a0e65(0xf0)],_0xc9afd0=_0x1ebb53?_0x826910[_0x1a0e65(0xf9)](_0x5b8d46=>_0x5b8d46['relativePath']!==_0x1ebb53):_0x826910;if(_0x2c3152&&_0xc9afd0[_0x1a0e65(0x103)]===0x1){_0xb350ad['push'](_0xc9afd0[0x0]);continue;}throw CliErrors[_0x1a0e65(0xf5)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x35fdc1+_0x1a0e65(0x11b));}return _0xb350ad;}export const sqlPush={'service':'sql','command':a121_0x4585ee(0xeb),'description':a121_0x4585ee(0x113),'risk':a121_0x4585ee(0xe7),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a121_0x4585ee(0x10f),'type':a121_0x4585ee(0x120),'description':a121_0x4585ee(0x106)}],async 'dryRun'(_0x2c6d27){const _0xe8d0d=a121_0x4585ee,_0x324e15=loadSqlProjectConfig(_0x2c6d27[_0xe8d0d(0x121)]),_0x361af9=await readSqlLockFile(_0x324e15[_0xe8d0d(0xe5)]),{appLock:_0x408030}=ensureSqlLockScope(_0x361af9??createEmptySqlLock(),_0x2c6d27[_0xe8d0d(0x121)],_0x324e15[_0xe8d0d(0x11f)],_0xe8d0d(0xeb)),_0x1b29bd=await getTargetSqlQueries(_0x324e15,_0x408030,_0x2c6d27[_0xe8d0d(0xe9)]('sqlcode')||undefined),_0x49ac3d=[];for(const _0x4cfed9 of _0x1b29bd){const _0x567079=await computeSqlFileHash(_0x4cfed9[_0xe8d0d(0xe8)]),_0x3032c1=_0x408030[_0xe8d0d(0x104)][_0x4cfed9[_0xe8d0d(0xf7)]],_0xf53ca6=!!_0x3032c1&&(_0x3032c1[_0xe8d0d(0xf0)]!==_0x4cfed9[_0xe8d0d(0x108)]||!!_0x4cfed9[_0xe8d0d(0x110)]&&_0x3032c1[_0xe8d0d(0x110)]!==_0x4cfed9[_0xe8d0d(0x110)]);if(!_0x2c6d27['bool'](_0xe8d0d(0x10f))&&_0x3032c1&&_0x3032c1[_0xe8d0d(0x114)]===_0x567079&&!_0xf53ca6)continue;_0x49ac3d['push'](_0x4cfed9[_0xe8d0d(0xf7)]);}return{'method':_0xe8d0d(0x109),'url':_0xe8d0d(0xee),'body':{'sqlCodes':_0x49ac3d,'appCode':_0x2c6d27[_0xe8d0d(0x121)]},'description':'Would\x20push\x20'+_0x49ac3d[_0xe8d0d(0x103)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x5cd0d1){const _0x5a413f=a121_0x4585ee,_0x1e81c4=loadSqlProjectConfig(_0x5cd0d1[_0x5a413f(0x121)]),_0x1859fe=await readSqlLockFile(_0x1e81c4['lockFilePath']),{lockData:_0x127585,appLock:_0x35f708}=ensureSqlLockScope(_0x1859fe??createEmptySqlLock(),_0x5cd0d1[_0x5a413f(0x121)],_0x1e81c4['sqlRoot'],_0x5a413f(0xeb)),_0x2f12da=await getTargetSqlQueries(_0x1e81c4,_0x35f708,_0x5cd0d1['str']('sqlcode')||undefined);if(_0x2f12da[_0x5a413f(0x103)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x5a413f(0x11c)};const _0xdc2b2c=[],_0x20ccea=[],_0x3b2e1b=[];for(const _0x357d38 of _0x2f12da){const _0x3355ea=_0x35f708['sqls'][_0x357d38['sqlCode']];if(!_0x3355ea){_0x3b2e1b['push']({'sqlCode':_0x357d38[_0x5a413f(0xf7)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x4dc014=await computeSqlFileHash(_0x357d38[_0x5a413f(0xe8)]),_0x4040b7=_0x3355ea[_0x5a413f(0xf0)]!==_0x357d38['relativePath']||!!_0x357d38[_0x5a413f(0x110)]&&_0x3355ea['sqlName']!==_0x357d38['sqlName'];if(!_0x5cd0d1['bool'](_0x5a413f(0x10f))&&_0x3355ea[_0x5a413f(0x114)]===_0x4dc014&&!_0x4040b7){_0x20ccea[_0x5a413f(0xeb)]({'sqlCode':_0x357d38[_0x5a413f(0xf7)],'reason':_0x5a413f(0xe6)});continue;}if(_0x3355ea[_0x5a413f(0xf3)]==null){_0x3b2e1b[_0x5a413f(0xeb)]({'sqlCode':_0x357d38[_0x5a413f(0xf7)],'error':_0x5a413f(0xf2)});continue;}const _0x396d16=await readFile(_0x357d38[_0x5a413f(0xe8)],'utf8'),_0x24fec9=stripLocalSqlMetadata(_0x396d16,_0x357d38['mode']),_0x3cd0e1=_0x357d38['sqlName']||_0x3355ea['sqlName'],_0x13345f=await resolveTargetDbBinding(_0x5cd0d1[_0x5a413f(0x121)],_0x357d38,_0x3355ea),_0x352b77=await updateSqlQuery({'id':_0x3355ea[_0x5a413f(0x10b)],'appCode':_0x5cd0d1[_0x5a413f(0x121)],'sqlCode':_0x357d38[_0x5a413f(0xf7)],'sqlName':_0x3cd0e1,'dbId':_0x13345f[_0x5a413f(0x105)],'version':_0x3355ea[_0x5a413f(0xf3)],'sqlContent':_0x24fec9,'sqlConfig':_0x3355ea[_0x5a413f(0x111)]??undefined}),_0x217310=_0x352b77[_0x5a413f(0x105)]?await getDbName(_0x5cd0d1['appCode'],Number(_0x352b77[_0x5a413f(0x105)]))[_0x5a413f(0xfc)](()=>_0x13345f[_0x5a413f(0x10c)]):_0x13345f['dbName'];_0x35f708[_0x5a413f(0x104)][_0x357d38[_0x5a413f(0xf7)]]={...buildSqlLockEntry(_0x352b77,_0x24fec9,_0x4dc014,{'dbName':_0x217310}),'path':_0x357d38[_0x5a413f(0x108)],'mode':_0x3355ea[_0x5a413f(0x112)]},await archivePreviousSqlFileIfNeeded(_0x1e81c4,_0x3355ea['path'],_0x357d38['relativePath']),_0xdc2b2c[_0x5a413f(0xeb)]({'sqlCode':_0x357d38[_0x5a413f(0xf7)],'remoteId':_0x3355ea['remoteId']});}catch(_0x25c779){_0x3b2e1b[_0x5a413f(0xeb)]({'sqlCode':_0x357d38[_0x5a413f(0xf7)],'error':_0x25c779 instanceof Error?_0x25c779[_0x5a413f(0xe4)]:String(_0x25c779)});}}return _0x35f708[_0x5a413f(0xed)]=new Date()[_0x5a413f(0x119)](),await writeSqlLockFile(_0x1e81c4[_0x5a413f(0xe5)],_0x127585),{'ok':_0x3b2e1b[_0x5a413f(0x103)]===0x0,'data':{'pushed':_0xdc2b2c,'skipped':_0x20ccea,'failed':_0x3b2e1b},'message':_0x5a413f(0x116)+_0xdc2b2c[_0x5a413f(0x103)]+'\x20pushed,\x20'+_0x20ccea['length']+_0x5a413f(0xef)+_0x3b2e1b[_0x5a413f(0x103)]+'\x20failed'};}};function a121_0x468e(){const _0x34d3f7=['str','sqlRootDir','push','3tsvDEP','lastSync','/smartapi/custom/updateUserCustomSql','\x20skipped,\x20','path','replace','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','version','startsWith','validation','Local\x20SQL\x20not\x20found:\x20','sqlCode','exec','filter','88OUwjim','trashDir','catch','get','6184tGRoQP','4528018Lmjbpu','60STAmuH','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','1448178PcuxnH','length','sqls','dbId','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','13415CAAtIl','relativePath','POST','7581gQNKcq','remoteId','dbName','125318YmalDQ','841959IepVrX','force','sqlName','sqlConfig','mode','Push\x20local\x20SQL\x20files\x20to\x20remote','hash','1445586kYiZLp','Push\x20complete:\x20','Local\x20directory\x20\x22','dbDirectory','toISOString','\x22\x20for\x20sqlCode\x20','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','No\x20local\x20SQL\x20files\x20found.','set','join','sqlRoot','boolean','appCode','message','lockFilePath','unchanged','high-risk-write','filePath'];a121_0x468e=function(){return _0x34d3f7;};return a121_0x468e();}async function archivePreviousSqlFileIfNeeded(_0x5bc858,_0x47265f,_0x490480){const _0x46ae6c=a121_0x4585ee;if(!_0x47265f||_0x47265f===_0x490480)return;const _0xc2d39d=join(_0x5bc858[_0x46ae6c(0xea)],_0x47265f);if(!await fileExists(_0xc2d39d))return;const _0x29a683=await moveToTrash(_0x5bc858['projectRoot'],_0x5bc858[_0x46ae6c(0xfb)],_0xc2d39d);await cleanupEmptyDirectories(dirname(_0xc2d39d),_0x5bc858[_0x46ae6c(0xea)]),void _0x29a683;}async function moveToTrash(_0x4e2b91,_0x1ea841,_0x3b46ce){const _0x4dee21=a121_0x4585ee,_0xb02742=new Date()[_0x4dee21(0x119)]()[_0x4dee21(0xf1)](/[:.]/g,'-'),_0x329d45=relative(_0x4e2b91,_0x3b46ce),_0x154d63=join(_0x1ea841,_0xb02742,_0x329d45);return await mkdir(dirname(_0x154d63),{'recursive':!![]}),await rename(_0x3b46ce,_0x154d63),_0x154d63;}async function cleanupEmptyDirectories(_0x4134ed,_0xa975b4){const _0x28e386=a121_0x4585ee;let _0x16429c=resolve(_0x4134ed);const _0xb1d4e3=resolve(_0xa975b4);while(_0x16429c[_0x28e386(0xf4)](''+_0xb1d4e3+sep)||_0x16429c===_0xb1d4e3){if(_0x16429c===_0xb1d4e3)return;try{const _0xe57b59=await readdir(_0x16429c);if(_0xe57b59['length']>0x0)return;await rmdir(_0x16429c);}catch{return;}_0x16429c=dirname(_0x16429c);}}async function resolveTargetDbBinding(_0x1da415,_0x29533e,_0x339fc4){const _0x27fb2a=a121_0x4585ee,_0x5a292f=_0x29533e[_0x27fb2a(0x118)];if(!_0x5a292f)return{'dbId':_0x339fc4[_0x27fb2a(0x105)],'dbName':_0x339fc4['dbName']};const _0x1b19b9=buildDbDirectoryName(_0x339fc4[_0x27fb2a(0x10c)],_0x339fc4[_0x27fb2a(0x105)]);if(_0x5a292f===_0x1b19b9)return{'dbId':_0x339fc4[_0x27fb2a(0x105)],'dbName':_0x339fc4['dbName']};const _0x263195=parseExplicitDbDirectory(_0x5a292f);if(_0x263195!=null)return{'dbId':_0x263195,'dbName':await getDbName(_0x1da415,_0x263195)[_0x27fb2a(0xfc)](()=>undefined)};const _0x50727d=await listDatabases(_0x1da415),_0x238885=_0x50727d['filter'](_0x4a07a4=>buildDbDirectoryName(_0x4a07a4['dbName'],_0x4a07a4['dbId'])===_0x5a292f);if(_0x238885[_0x27fb2a(0x103)]===0x1)return{'dbId':_0x238885[0x0][_0x27fb2a(0x105)],'dbName':_0x238885[0x0]['dbName']};if(_0x238885[_0x27fb2a(0x103)]===0x0)throw CliErrors['validation']('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x5a292f+_0x27fb2a(0x11a)+_0x29533e[_0x27fb2a(0xf7)]+'.');const _0x15b208=_0x238885['map'](_0x903cb3=>_0x903cb3[_0x27fb2a(0x10c)]+'\x20('+_0x903cb3[_0x27fb2a(0x105)]+')')[_0x27fb2a(0x11e)](',\x20');throw CliErrors[_0x27fb2a(0xf5)](_0x27fb2a(0x117)+_0x5a292f+_0x27fb2a(0x101)+_0x29533e[_0x27fb2a(0xf7)]+':\x20'+_0x15b208);}function parseExplicitDbDirectory(_0x2aeb50){const _0x16be5a=a121_0x4585ee,_0x17c8a0=/^db-(\d+)$/[_0x16be5a(0xf8)](_0x2aeb50);if(!_0x17c8a0)return null;const _0x1b0f4a=Number(_0x17c8a0[0x1]);return Number['isFinite'](_0x1b0f4a)&&_0x1b0f4a>0x0?_0x1b0f4a:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a122_0x5e758f=a122_0x17d2;function a122_0x18b2(){const _0x2d3488=['Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','52806HjUaPK','2702508mbjVVC','string','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','16618bufals','27445XnmueB','sqlname','1580JPfQgr','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','Query\x20description','260sXRznY','validation','file','Update\x20existing\x20SQL\x20by\x20editing\x20the\x20synced\x20file\x20under\x20`.rabetbase/sql/<appCode>/<dbName|db-<id>>/`\x20and\x20then\x20running\x20`rabetbase\x20sql\x20push\x20--sqlcode\x20<code>\x20--yes`.','Path\x20to\x20the\x20SQL\x20file','40PicDSn','289TcBTrx','3570pbjNPq','144qTMVhJ','join','466NvkSDQ','write','164169cLdEkk','description'];a122_0x18b2=function(){return _0x2d3488;};return a122_0x18b2();}(function(_0x4eb016,_0x23b392){const _0x9d4a2c=a122_0x17d2,_0x167f90=_0x4eb016();while(!![]){try{const _0x109dc8=parseInt(_0x9d4a2c(0x186))/0x1*(-parseInt(_0x9d4a2c(0x18a))/0x2)+parseInt(_0x9d4a2c(0x18f))/0x3*(parseInt(_0x9d4a2c(0x185))/0x4)+parseInt(_0x9d4a2c(0x17d))/0x5*(-parseInt(_0x9d4a2c(0x187))/0x6)+-parseInt(_0x9d4a2c(0x17a))/0x7*(-parseInt(_0x9d4a2c(0x188))/0x8)+-parseInt(_0x9d4a2c(0x18c))/0x9+parseInt(_0x9d4a2c(0x180))/0xa*(-parseInt(_0x9d4a2c(0x17b))/0xb)+parseInt(_0x9d4a2c(0x190))/0xc;if(_0x109dc8===_0x23b392)break;else _0x167f90['push'](_0x167f90['shift']());}catch(_0x1a2b4){_0x167f90['push'](_0x167f90['shift']());}}}(a122_0x18b2,0x19c15));function a122_0x17d2(_0x413a6a,_0x3f666e){_0x413a6a=_0x413a6a-0x17a;const _0x18b2eb=a122_0x18b2();let _0x17d2a3=_0x18b2eb[_0x413a6a];return _0x17d2a3;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a122_0x5e758f(0x192),'Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.',a122_0x5e758f(0x183)][a122_0x5e758f(0x189)]('\x0a');export const sqlSave={'service':'sql','command':'save','description':a122_0x5e758f(0x17e),'risk':a122_0x5e758f(0x18b),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a122_0x5e758f(0x182),'type':a122_0x5e758f(0x191),'required':!![],'description':a122_0x5e758f(0x184)},SQLCODE_FLAG_OPTIONAL,{'name':a122_0x5e758f(0x17c),'type':'string','description':'SQL\x20query\x20display\x20name'},{'name':'db','type':'string','description':a122_0x5e758f(0x18e)},{'name':a122_0x5e758f(0x18d),'type':a122_0x5e758f(0x191),'description':a122_0x5e758f(0x17f)}],async 'validate'(){const _0x527e90=a122_0x5e758f;throw CliErrors[_0x527e90(0x181)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x19e896=a122_0x5e758f;throw CliErrors[_0x19e896(0x181)](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2545a3,_0x3ff25f){const _0x2438fe=a123_0x4475,_0x668919=_0x2545a3();while(!![]){try{const _0x3adcc5=parseInt(_0x2438fe(0x1f2))/0x1+parseInt(_0x2438fe(0x213))/0x2+-parseInt(_0x2438fe(0x1f5))/0x3*(-parseInt(_0x2438fe(0x215))/0x4)+-parseInt(_0x2438fe(0x205))/0x5+-parseInt(_0x2438fe(0x20a))/0x6+-parseInt(_0x2438fe(0x214))/0x7+parseInt(_0x2438fe(0x20d))/0x8;if(_0x3adcc5===_0x3ff25f)break;else _0x668919['push'](_0x668919['shift']());}catch(_0x5ea267){_0x668919['push'](_0x668919['shift']());}}}(a123_0x2c84,0x6529b));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x3dd372,_0x57ac69,_0x2b2a57,_0x42416b){const _0x122ee0=a123_0x4475,_0x11c8db=detectSqlMode(_0x57ac69);return{'path':buildSqlRelativePath(_0x3dd372[_0x122ee0(0x1f8)],_0x3dd372[_0x122ee0(0x20e)],_0x42416b?.[_0x122ee0(0x1f3)],_0x11c8db,_0x3dd372[_0x122ee0(0x1fb)]),'hash':_0x2b2a57,'remoteId':_0x3dd372['id'],'version':_0x3dd372[_0x122ee0(0x210)],'dbId':Number(_0x3dd372['dbId']),'dbName':_0x42416b?.[_0x122ee0(0x1f3)],'sqlName':_0x3dd372['sqlName'],'sqlConfig':_0x3dd372[_0x122ee0(0x207)]??undefined,'mode':_0x11c8db};}export function cloneSqlLockData(_0x3186ac){const _0x2e4010=a123_0x4475;return{'apps':Object[_0x2e4010(0x1fd)](Object[_0x2e4010(0x20b)](_0x3186ac[_0x2e4010(0x21b)])['map'](([_0x238449,_0x32fd59])=>[_0x238449,{'sqlRoot':_0x32fd59[_0x2e4010(0x202)],'lastSync':_0x32fd59['lastSync'],'sqls':{..._0x32fd59[_0x2e4010(0x1f9)]}}]))};}export function ensureRemoteSqlContent(_0x38a2df){const _0x5831b7=a123_0x4475;return _0x38a2df[_0x5831b7(0x204)]??'';}function a123_0x4475(_0xddc41b,_0x23dc58){_0xddc41b=_0xddc41b-0x1f1;const _0x2c8463=a123_0x2c84();let _0x4475f4=_0x2c8463[_0xddc41b];return _0x4475f4;}function a123_0x2c84(){const _0x4eb544=['6425856tIjKcr','sqlName','push','version','split','includes','837652jtnQjp','2786595lHOzXl','7864WjykmO','length','mybatisXml','<!--\x20@lovrabet.','endsWith','map','apps','stderr','description','402786wHCIet','dbName','yes','315PVPdLK','path','trim','sqlCode','sqls','syncedAt','dbId','close','fromEntries','\x20-->','question','test','toLowerCase','sqlRoot','mode','sqlContent','2315740sHcOur','filter','sqlConfig','stdin','--\x20@lovrabet.','3334068TVLiQZ','entries','\x20[y/N]\x20'];a123_0x2c84=function(){return _0x4eb544;};return a123_0x2c84();}export function buildLocalSqlFileContent(_0x4314cd,_0x43384,_0x585f9e){const _0x13ead1=a123_0x4475,_0x318969=_0x585f9e?.['mode']??detectSqlMode(_0x43384),_0x302f14=stripLocalSqlMetadata(_0x43384,_0x318969)[_0x13ead1(0x1f7)](),_0x5f2b0c=[...buildMetadataHeaderLines({'sqlCode':_0x4314cd['sqlCode'],'sqlName':_0x4314cd[_0x13ead1(0x20e)],'dbId':_0x4314cd['dbId'],'dbName':_0x585f9e?.[_0x13ead1(0x1f3)],'mode':_0x318969,'syncedAt':_0x585f9e?.[_0x13ead1(0x1fa)],'description':_0x585f9e?.[_0x13ead1(0x1f1)]},_0x318969),'',_0x302f14],_0x2c676c=_0x5f2b0c['join']('\x0a');return _0x2c676c[_0x13ead1(0x219)]('\x0a')?_0x2c676c:_0x2c676c+'\x0a';}export function stripLocalSqlMetadata(_0x1145f1,_0x485258){const _0x222548=a123_0x4475,_0x4ef0e8=_0x1145f1['replace'](/\r\n/g,'\x0a')[_0x222548(0x211)]('\x0a'),_0x13c108=[];let _0x59f499=0x0;if(_0x485258===_0x222548(0x217))while(_0x59f499<_0x4ef0e8[_0x222548(0x216)]){const _0x8f9157=_0x4ef0e8[_0x59f499]??'';if(/^\s*<!--\s*@lovrabet\./[_0x222548(0x200)](_0x8f9157)){_0x59f499++;continue;}if(_0x8f9157['trim']()===''&&_0x59f499>0x0){_0x59f499++;continue;}break;}else while(_0x59f499<_0x4ef0e8[_0x222548(0x216)]){const _0x22a385=_0x4ef0e8[_0x59f499]??'';if(/^\s*--\s*@lovrabet\./[_0x222548(0x200)](_0x22a385)){_0x59f499++;continue;}if(_0x22a385[_0x222548(0x1f7)]()===''&&_0x59f499>0x0){_0x59f499++;continue;}break;}for(;_0x59f499<_0x4ef0e8[_0x222548(0x216)];_0x59f499++){_0x13c108[_0x222548(0x20f)](_0x4ef0e8[_0x59f499]);}return _0x13c108['join']('\x0a')['trimStart']();}export function resolveSqlMode(_0x5497d4,_0x5d1b90){const _0x16cd39=a123_0x4475;if(_0x5d1b90?.[_0x16cd39(0x203)])return _0x5d1b90[_0x16cd39(0x203)];return detectSqlMode(_0x5497d4);}export function resolveSqlFileName(_0x534685,_0x48765,_0xb543ed){const _0x456fa2=a123_0x4475;if(_0xb543ed?.[_0x456fa2(0x1f6)])return _0xb543ed[_0x456fa2(0x1f6)];if(_0xb543ed?.[_0x456fa2(0x20e)]||_0xb543ed?.[_0x456fa2(0x1f3)])return buildSqlRelativePath(_0x534685,_0xb543ed?.[_0x456fa2(0x20e)],_0xb543ed?.[_0x456fa2(0x1f3)],resolveSqlMode(_0x48765,_0xb543ed),_0xb543ed?.['dbId']);return buildDefaultSqlFileName(_0x534685,resolveSqlMode(_0x48765,_0xb543ed));}export function resolveSqlLocalDir(_0x42ed8e,_0x1f0b6f){return join(_0x42ed8e,SQL_LOCAL_REL_DIR,_0x1f0b6f);}export async function confirmForceOverwrite(_0x3f1829){const _0xddc20b=a123_0x4475,_0x2df95d=createInterface({'input':process[_0xddc20b(0x208)],'output':process[_0xddc20b(0x21c)]}),_0x237ffc=await new Promise(_0x4dcbdb=>{const _0x690a67=_0xddc20b;_0x2df95d[_0x690a67(0x1ff)](_0x3f1829+_0x690a67(0x20c),_0x4dcbdb);});return _0x2df95d[_0xddc20b(0x1fc)](),['y',_0xddc20b(0x1f4)][_0xddc20b(0x212)](_0x237ffc[_0xddc20b(0x1f7)]()[_0xddc20b(0x201)]());}export function findSqlLockScope(_0x4d845b,_0x260154){const _0x3fe9dd=a123_0x4475;return _0x4d845b[_0x3fe9dd(0x21b)][_0x260154];}function buildMetadataHeaderLines(_0xc8748,_0x4195ea){const _0x374b36=a123_0x4475,_0x7e6308=[[_0x374b36(0x1f8),_0xc8748[_0x374b36(0x1f8)]],[_0x374b36(0x20e),_0xc8748['sqlName']],[_0x374b36(0x1fb),_0xc8748[_0x374b36(0x1fb)]],[_0x374b36(0x1f3),_0xc8748[_0x374b36(0x1f3)]],['mode',_0xc8748[_0x374b36(0x203)]],[_0x374b36(0x1fa),_0xc8748[_0x374b36(0x1fa)]],[_0x374b36(0x1f1),_0xc8748['description']]];if(_0x4195ea===_0x374b36(0x217))return _0x7e6308[_0x374b36(0x206)](([,_0x3878fc])=>_0x3878fc!==undefined&&_0x3878fc!==null&&String(_0x3878fc)[_0x374b36(0x1f7)]()!=='')['map'](([_0x143021,_0x5c4ad6])=>_0x374b36(0x218)+_0x143021+':\x20'+String(_0x5c4ad6)+_0x374b36(0x1fe));return _0x7e6308[_0x374b36(0x206)](([,_0x436b08])=>_0x436b08!==undefined&&_0x436b08!==null&&String(_0x436b08)[_0x374b36(0x1f7)]()!=='')[_0x374b36(0x21a)](([_0x5497cd,_0x99b628])=>_0x374b36(0x209)+_0x5497cd+':\x20'+String(_0x99b628));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a124_0x1054e8=a124_0x3774;(function(_0x1213cc,_0x44bc5b){const _0x1b44cc=a124_0x3774,_0x1a4d00=_0x1213cc();while(!![]){try{const _0x4f3439=parseInt(_0x1b44cc(0x1e4))/0x1+-parseInt(_0x1b44cc(0x1cf))/0x2+-parseInt(_0x1b44cc(0x1d3))/0x3*(-parseInt(_0x1b44cc(0x1e3))/0x4)+-parseInt(_0x1b44cc(0x1ce))/0x5*(-parseInt(_0x1b44cc(0x1e2))/0x6)+-parseInt(_0x1b44cc(0x1ed))/0x7+-parseInt(_0x1b44cc(0x1ee))/0x8*(-parseInt(_0x1b44cc(0x1d1))/0x9)+parseInt(_0x1b44cc(0x1ea))/0xa*(-parseInt(_0x1b44cc(0x1e7))/0xb);if(_0x4f3439===_0x44bc5b)break;else _0x1a4d00['push'](_0x1a4d00['shift']());}catch(_0x1bcd1e){_0x1a4d00['push'](_0x1a4d00['shift']());}}}(a124_0x57e1,0x4f0a3));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a124_0x57e1(){const _0x24e06a=['totalCount','remote','1290qWyyCl','\x20added,\x20','sqlName','376292ocsdlC','16WBivgu','tableData','relativePath','\x20unchanged','lockFilePath','\x20missing,\x20','sqlRoot','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','5ixKOei','843760sbZzFl','\x20remote-only','2113119lmyrek','map','30IDboDk','push','read','paging','sqlCode','keys','has','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','lockKey','status','appCode','length','filePath','path','sql','3533226IIEmQH','190492SHiNtH','510195vLXIXi','hash','sqls','106205pUKOmg'];a124_0x57e1=function(){return _0x24e06a;};return a124_0x57e1();}function a124_0x3774(_0x494041,_0x212dda){_0x494041=_0x494041-0x1c7;const _0x57e1be=a124_0x57e1();let _0x377409=_0x57e1be[_0x494041];return _0x377409;}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(_0x25c0dc){const _0xa0a146=a124_0x3774,_0x2dfed0=[];let _0x37fb24=0x1;while(!![]){const _0x4f19ea=await listSqlQueries(_0x25c0dc,{'currentPage':_0x37fb24,'pageSize':PAGE_SIZE}),_0x5c74bc=_0x4f19ea[_0xa0a146(0x1c7)]??[];_0x2dfed0[_0xa0a146(0x1d4)](..._0x5c74bc[_0xa0a146(0x1d2)](_0x54651f=>_0x54651f[_0xa0a146(0x1d7)]));if(_0x5c74bc['length']===0x0)break;const _0x37de13=_0x4f19ea[_0xa0a146(0x1d6)]?.[_0xa0a146(0x1e8)];if(_0x37de13!=null?_0x2dfed0[_0xa0a146(0x1de)]>=_0x37de13:_0x5c74bc[_0xa0a146(0x1de)]<PAGE_SIZE)break;_0x37fb24++;}return _0x2dfed0;}export const sqlStatus={'service':a124_0x1054e8(0x1e1),'command':'status','description':a124_0x1054e8(0x1cd),'risk':a124_0x1054e8(0x1d5),'flags':[{'name':'remote','type':'boolean','description':a124_0x1054e8(0x1da)}],async 'execute'(_0x55d080){const _0x912fc5=a124_0x1054e8,_0x14bd01=loadSqlProjectConfig(_0x55d080[_0x912fc5(0x1dd)]),_0x4934a8=await readSqlLockFile(_0x14bd01[_0x912fc5(0x1ca)]),{appLock:_0x3283c8}=ensureSqlLockScope(_0x4934a8??createEmptySqlLock(),_0x14bd01[_0x912fc5(0x1dd)],_0x14bd01[_0x912fc5(0x1cc)],_0x912fc5(0x1dc)),_0x3260f7=await scanLocalSqlQueries(_0x14bd01),_0x24cce5=[],_0x3141fc=[],_0x2692b7=[],_0x277a9a=[],_0x4195a2=new Set(_0x3260f7['map'](_0x3a0ca9=>_0x3a0ca9[_0x912fc5(0x1db)]));for(const _0x4b94ef of _0x3260f7){const _0x3eb8eb=await computeSqlFileHash(_0x4b94ef[_0x912fc5(0x1df)]),_0x3e33b0=_0x3283c8[_0x912fc5(0x1e6)][_0x4b94ef[_0x912fc5(0x1db)]],_0x487ad4=!!_0x3e33b0&&_0x3e33b0[_0x912fc5(0x1e0)]!==_0x4b94ef[_0x912fc5(0x1c8)],_0x3625cb=!!_0x3e33b0&&!!_0x4b94ef['sqlName']&&_0x3e33b0[_0x912fc5(0x1ec)]!==_0x4b94ef[_0x912fc5(0x1ec)];if(!_0x3e33b0)_0x24cce5[_0x912fc5(0x1d4)](_0x4b94ef[_0x912fc5(0x1db)]);else _0x3e33b0[_0x912fc5(0x1e5)]!==_0x3eb8eb||_0x487ad4||_0x3625cb?_0x3141fc[_0x912fc5(0x1d4)](_0x4b94ef[_0x912fc5(0x1db)]):_0x2692b7[_0x912fc5(0x1d4)](_0x4b94ef[_0x912fc5(0x1db)]);}for(const _0x51422a of Object[_0x912fc5(0x1d8)](_0x3283c8[_0x912fc5(0x1e6)])){!_0x4195a2[_0x912fc5(0x1d9)](_0x51422a)&&_0x277a9a[_0x912fc5(0x1d4)](_0x51422a);}const _0x3ceb41=[];if(_0x55d080['bool'](_0x912fc5(0x1e9))){const _0x5310d1=await fetchAllSqlCodes(_0x55d080[_0x912fc5(0x1dd)]);for(const _0x4f812c of _0x5310d1){!_0x4195a2['has'](_0x4f812c)&&!_0x3283c8[_0x912fc5(0x1e6)][_0x4f812c]&&_0x3ceb41[_0x912fc5(0x1d4)](_0x4f812c);}}const _0x19dea5=_0x24cce5[_0x912fc5(0x1de)]===0x0&&_0x3141fc['length']===0x0&&_0x277a9a[_0x912fc5(0x1de)]===0x0&&_0x3ceb41[_0x912fc5(0x1de)]===0x0;return{'ok':!![],'data':{'added':_0x24cce5,'modified':_0x3141fc,'missing':_0x277a9a,'unchanged':_0x2692b7,'remoteOnly':_0x3ceb41},'message':_0x19dea5?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x24cce5[_0x912fc5(0x1de)]+_0x912fc5(0x1eb)+_0x3141fc[_0x912fc5(0x1de)]+'\x20modified,\x20'+_0x277a9a[_0x912fc5(0x1de)]+_0x912fc5(0x1cb)+_0x2692b7[_0x912fc5(0x1de)]+_0x912fc5(0x1c9)+(_0x3ceb41[_0x912fc5(0x1de)]>0x0?',\x20'+_0x3ceb41[_0x912fc5(0x1de)]+_0x912fc5(0x1d0):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a125_0x2f62a1=a125_0x56a7;function a125_0x56a7(_0x1a65c5,_0x50a6a3){_0x1a65c5=_0x1a65c5-0x1bf;const _0x5e9fb4=a125_0x5e9f();let _0x56a724=_0x5e9fb4[_0x1a65c5];return _0x56a724;}(function(_0x3e91f1,_0x22619b){const _0x1b2243=a125_0x56a7,_0x4d3578=_0x3e91f1();while(!![]){try{const _0x51f49b=-parseInt(_0x1b2243(0x1d7))/0x1+parseInt(_0x1b2243(0x1d8))/0x2+-parseInt(_0x1b2243(0x1d1))/0x3+parseInt(_0x1b2243(0x1df))/0x4+-parseInt(_0x1b2243(0x1cd))/0x5+parseInt(_0x1b2243(0x1e4))/0x6+-parseInt(_0x1b2243(0x1d5))/0x7;if(_0x51f49b===_0x22619b)break;else _0x4d3578['push'](_0x4d3578['shift']());}catch(_0x173423){_0x4d3578['push'](_0x4d3578['shift']());}}}(a125_0x5e9f,0xd1ba1));function a125_0x5e9f(){const _0x3d4ee5=['2387830JXVoec','isDangerous','filter','size','2149806svXZhE','get','reason','Provide\x20--file\x20or\x20--sql','1169126NwIOxu','utf-8','302056JOUQWs','1359428yeFLtn','dbtableConfig','sqlType','validate','sql','cwd','isSelectOnly','2332008tDxJef','File\x20not\x20found:\x20','flagMissing','Table\x20\x22','string','7557402Fhkmol','tables','file','schemas','parameters','read','Dataset\x20\x22','message','fields','schemaWarnings','type','map','trim','validation','valid','isArray','from','tableName','str','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','toLowerCase','\x22\x20not\x20found\x20in\x20any\x20dataset','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','push'];a125_0x5e9f=function(){return _0x3d4ee5;};return a125_0x5e9f();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a125_0x2f62a1(0x1dc),'command':a125_0x2f62a1(0x1db),'description':a125_0x2f62a1(0x1c8),'risk':a125_0x2f62a1(0x1e9),'flags':[{'name':a125_0x2f62a1(0x1e6),'type':a125_0x2f62a1(0x1e3),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a125_0x2f62a1(0x1dc),'type':a125_0x2f62a1(0x1e3),'description':a125_0x2f62a1(0x1cb)},{'name':a125_0x2f62a1(0x1e7),'type':a125_0x2f62a1(0x1e3),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x287f0b){const _0x172a43=a125_0x2f62a1,_0x2dd6cd=_0x287f0b[_0x172a43(0x1c7)](_0x172a43(0x1e6)),_0x2e1942=_0x287f0b[_0x172a43(0x1c7)](_0x172a43(0x1dc));if(!_0x2dd6cd&&!_0x2e1942)throw CliErrors[_0x172a43(0x1e1)](_0x172a43(0x1e6),_0x172a43(0x1d4));let _0x1643b3;if(_0x2dd6cd){const _0x2382c0=resolve(process[_0x172a43(0x1dd)](),_0x2dd6cd);if(!existsSync(_0x2382c0))throw CliErrors[_0x172a43(0x1c2)](_0x172a43(0x1e0)+_0x2382c0);_0x1643b3=readFileSync(_0x2382c0,_0x172a43(0x1d6));}else _0x1643b3=_0x2e1942;const _0x3b2786=validateSql(_0x1643b3),_0x640130={'valid':_0x3b2786[_0x172a43(0x1c3)],'sqlType':_0x3b2786[_0x172a43(0x1da)][_0x172a43(0x1bf)],'isSelectOnly':_0x3b2786[_0x172a43(0x1da)][_0x172a43(0x1de)],'isDangerous':_0x3b2786['sqlType'][_0x172a43(0x1ce)],'tables':_0x3b2786[_0x172a43(0x1e5)],'parameters':_0x3b2786[_0x172a43(0x1e8)],'message':_0x3b2786[_0x172a43(0x1eb)]};_0x3b2786['sqlType'][_0x172a43(0x1d3)]&&(_0x640130[_0x172a43(0x1d3)]=_0x3b2786[_0x172a43(0x1da)]['reason']);const _0xbf0ce8=_0x287f0b[_0x172a43(0x1c7)](_0x172a43(0x1e7));if(_0xbf0ce8&&_0x3b2786['valid']){const _0x5762fc=_0xbf0ce8['split'](',')[_0x172a43(0x1c0)](_0xfa563f=>_0xfa563f[_0x172a43(0x1c1)]())[_0x172a43(0x1cf)](Boolean),_0x193e08=[],_0x4b89ef=await listDatasets(_0x287f0b['appCode']),_0x3033bc=new Map(_0x4b89ef[_0x172a43(0x1c0)](_0x1f6213=>[_0x1f6213[_0x172a43(0x1d9)]?.['tableName']?.[_0x172a43(0x1c9)](),_0x1f6213]));for(const _0x2a045f of _0x3b2786[_0x172a43(0x1e5)]){const _0x54633f=_0x3033bc[_0x172a43(0x1d2)](_0x2a045f[_0x172a43(0x1c9)]());!_0x54633f&&_0x193e08[_0x172a43(0x1cc)](_0x172a43(0x1e2)+_0x2a045f+_0x172a43(0x1ca));}for(const _0x3468a7 of _0x5762fc){try{const _0x1287b9=await getDatasetDetail(_0x3468a7),_0x315b2c=Array[_0x172a43(0x1c4)](_0x1287b9[_0x172a43(0x1ec)])?_0x1287b9[_0x172a43(0x1ec)]:[],_0x28e454=new Set(_0x315b2c[_0x172a43(0x1c0)](_0x109154=>_0x109154['name']?.[_0x172a43(0x1c9)]())),_0x2d62b7=_0x1287b9[_0x172a43(0x1d9)]?.[_0x172a43(0x1c6)]||_0x1287b9[_0x172a43(0x1c6)]||_0x3468a7;_0x640130['schema:'+_0x2d62b7]={'code':_0x3468a7,'tableName':_0x2d62b7,'fieldCount':_0x28e454[_0x172a43(0x1d0)],'fields':Array[_0x172a43(0x1c5)](_0x28e454)};}catch{_0x193e08[_0x172a43(0x1cc)](_0x172a43(0x1ea)+_0x3468a7+'\x22\x20not\x20found\x20or\x20not\x20accessible');}}_0x193e08['length']>0x0&&(_0x640130[_0x172a43(0x1ed)]=_0x193e08);}return{'ok':_0x3b2786[_0x172a43(0x1c3)],'data':_0x640130,'message':_0x3b2786[_0x172a43(0x1eb)]};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a126_0x52207c=a126_0x3496;(function(_0x2817c0,_0x4b7bfb){const _0x44b271=a126_0x3496,_0x1dd957=_0x2817c0();while(!![]){try{const _0x5744fb=parseInt(_0x44b271(0x10e))/0x1+parseInt(_0x44b271(0x107))/0x2+parseInt(_0x44b271(0x12d))/0x3+parseInt(_0x44b271(0x11d))/0x4*(parseInt(_0x44b271(0x119))/0x5)+-parseInt(_0x44b271(0x10a))/0x6*(-parseInt(_0x44b271(0x109))/0x7)+parseInt(_0x44b271(0x115))/0x8+parseInt(_0x44b271(0x126))/0x9*(-parseInt(_0x44b271(0x125))/0xa);if(_0x5744fb===_0x4b7bfb)break;else _0x1dd957['push'](_0x1dd957['shift']());}catch(_0x5161ef){_0x1dd957['push'](_0x1dd957['shift']());}}}(a126_0x449f,0x2b7bf));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=[a126_0x52207c(0x114),a126_0x52207c(0x110),a126_0x52207c(0x112),a126_0x52207c(0x127),a126_0x52207c(0x113)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a126_0x52207c(0x111),'env',a126_0x52207c(0x112),a126_0x52207c(0x127),a126_0x52207c(0x114),'accessKey','apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x4fe3c3){return[..._0x4fe3c3]['join'](',\x20');}function a126_0x3496(_0x11f30c,_0x5c5f6a){_0x11f30c=_0x11f30c-0x107;const _0x449f72=a126_0x449f();let _0x3496b7=_0x449f72[_0x11f30c];return _0x3496b7;}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x30d96b){const _0x1722de=a126_0x52207c;return TOP_LEVEL_CONFIG_KEYS[_0x1722de(0x124)](_0x30d96b);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x20d201=a126_0x52207c;return _0x20d201(0x10b)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a126_0x52207c(0x12c),'apiDir':a126_0x52207c(0x10c),'cookie':a126_0x52207c(0x114),'accessKey':a126_0x52207c(0x110),'defaultFormat':a126_0x52207c(0x127),'pageSize':a126_0x52207c(0x108),'riskLevel':a126_0x52207c(0x113),'locale':a126_0x52207c(0x112)};function a126_0x449f(){const _0x43e4cb=['en-US','Auth\x20cookie','463272UBDrAn','pageSize','321433HjNcNn','24XgQTtA','Config\x20key\x20(','apiDir','inherit','133037OmZpVu','entries','accessKey','appcode','locale','riskLevel','cookie','1642528KwtRGY','length','zh-CN','toLowerCase','5jlHvIf','Target\x20environment','defaultApp','string','1149740qrNyJb','app','Risk\x20level','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','apps','trim','Locale','has','2525200JxaayX','36wajXVe','format','map','defaultFormat','filter','number','env','441273hPDRjK'];a126_0x449f=function(){return _0x43e4cb;};return a126_0x449f();}export function getAppProfileFlagDefs(){const _0x5aea9f=a126_0x52207c;return[{'name':_0x5aea9f(0x12c),'type':_0x5aea9f(0x11c),'description':_0x5aea9f(0x11a),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x5aea9f(0x10c),'type':_0x5aea9f(0x11c),'description':'API\x20directory\x20path'},{'name':_0x5aea9f(0x114),'type':_0x5aea9f(0x11c),'description':_0x5aea9f(0x12f),'hidden':!![]},{'name':_0x5aea9f(0x110),'type':_0x5aea9f(0x11c),'description':'Access\x20key','hidden':!![]},{'name':_0x5aea9f(0x129),'type':'string','description':_0x5aea9f(0x120),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x5aea9f(0x108),'type':_0x5aea9f(0x12b),'description':'Default\x20page\x20size'},{'name':'riskLevel','type':'string','description':_0x5aea9f(0x11f),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x5aea9f(0x112),'type':'string','description':_0x5aea9f(0x123)}];}export function collectAppProfileOverrides(_0x515cbc){const _0x45fe81=a126_0x52207c,_0xf0ef8a={};for(const [_0x4f1d08,_0x5ed817]of Object[_0x45fe81(0x10f)](APP_PROFILE_FLAG_KEY_MAP)){const _0x12e5a5=_0x515cbc(_0x4f1d08);if(!_0x12e5a5)continue;_0xf0ef8a[_0x5ed817]=_0x5ed817===_0x45fe81(0x108)?Number(_0x12e5a5):_0x12e5a5;}return _0xf0ef8a;}export function buildAppProfileListFields(_0x4de3c5){const _0x9e22ad=a126_0x52207c;return{'env':_0x4de3c5[_0x9e22ad(0x12c)]??null,'apiDir':_0x4de3c5['apiDir']??null,'hasCookie':!!_0x4de3c5['cookie'],'hasAccessKey':!!_0x4de3c5[_0x9e22ad(0x110)],'format':_0x4de3c5['format']??null,'pageSize':_0x4de3c5['pageSize']??null,'riskLevel':_0x4de3c5['riskLevel']??null,'locale':_0x4de3c5[_0x9e22ad(0x112)]??null};}export function buildAppDoctorFields(_0x49f664,_0x4aa8a0){const _0x4896d9=a126_0x52207c;return{'env':{'value':_0x49f664['env']||_0x4aa8a0[_0x4896d9(0x12c)],'source':_0x49f664[_0x4896d9(0x12c)]?_0x4896d9(0x11e):_0x4896d9(0x10d)},'apiDir':{'value':_0x49f664['apiDir']||_0x4aa8a0[_0x4896d9(0x10c)],'source':_0x49f664[_0x4896d9(0x10c)]?_0x4896d9(0x11e):_0x4896d9(0x10d)},'cookie':{'value':_0x49f664[_0x4896d9(0x114)]||_0x4aa8a0[_0x4896d9(0x114)],'source':_0x49f664[_0x4896d9(0x114)]?'app':_0x4896d9(0x10d)},'accessKey':{'value':_0x49f664[_0x4896d9(0x110)]||_0x4aa8a0[_0x4896d9(0x110)],'source':_0x49f664[_0x4896d9(0x110)]?_0x4896d9(0x11e):_0x4896d9(0x10d)}};}export function buildCanonicalAppConfig(_0x4e37a3,_0x2afdc0){const _0x4534b6=a126_0x52207c,_0xa7d13=_0x4e37a3[_0x4534b6(0x128)](_0x271a42=>String(_0x271a42||'')[_0x4534b6(0x122)]())[_0x4534b6(0x12a)](Boolean);if(_0xa7d13[_0x4534b6(0x116)]===0x0)return{};const _0x46688f={};for(const _0x46856f of _0xa7d13){_0x46688f[_0x46856f]=_0x2afdc0?{'appcode':_0x46856f,'env':_0x2afdc0}:{'appcode':_0x46856f};}return{'apps':_0x46688f,'defaultApp':_0xa7d13[0x0]};}export function buildCanonicalProjectConfig(_0xf628f3,_0x488d20){const _0x4ac513=a126_0x52207c,{appCodes:appCodes=[],env:_0x317d8c,metadata:_0x20d0a7}=_0x488d20,_0xff316={..._0xf628f3,..._0x20d0a7||{}};delete _0xff316[_0x4ac513(0x111)],delete _0xff316[_0x4ac513(0x11e)];if(_0x317d8c)_0xff316[_0x4ac513(0x12c)]=_0x317d8c;else!_0xff316['env']&&(_0xff316['env']=DEFAULT_CONFIG_VALUES['env']);const _0x5d2644=buildCanonicalAppConfig(appCodes,_0xff316['env']);return Object['keys'](_0x5d2644)['length']>0x0&&(_0xff316['apps']=_0x5d2644[_0x4ac513(0x121)],_0xff316['defaultApp']=_0x5d2644[_0x4ac513(0x11b)]),_0xff316;}const LOCALE_MAP={'zh':a126_0x52207c(0x117),'zh-cn':a126_0x52207c(0x117),'zh_cn':'zh-CN','en':a126_0x52207c(0x12e),'en-us':a126_0x52207c(0x12e),'en_us':a126_0x52207c(0x12e)};export function normalizeLocale(_0x2d358e){const _0x140f67=a126_0x52207c;if(!_0x2d358e)return null;return LOCALE_MAP[_0x2d358e[_0x140f67(0x118)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a127_0x2cdc94=a127_0x542c;function a127_0x542c(_0x52c6e8,_0x1b818f){_0x52c6e8=_0x52c6e8-0xd6;const _0xffc122=a127_0xffc1();let _0x542c37=_0xffc122[_0x52c6e8];return _0x542c37;}(function(_0x552884,_0x3f18de){const _0x31071c=a127_0x542c,_0x395178=_0x552884();while(!![]){try{const _0x4d475f=-parseInt(_0x31071c(0xdf))/0x1*(parseInt(_0x31071c(0xd7))/0x2)+parseInt(_0x31071c(0xe0))/0x3*(parseInt(_0x31071c(0xda))/0x4)+parseInt(_0x31071c(0xdc))/0x5+-parseInt(_0x31071c(0xdb))/0x6+parseInt(_0x31071c(0xd8))/0x7+-parseInt(_0x31071c(0xdd))/0x8*(parseInt(_0x31071c(0xde))/0x9)+parseInt(_0x31071c(0xe1))/0xa*(parseInt(_0x31071c(0xd9))/0xb);if(_0x4d475f===_0x3f18de)break;else _0x395178['push'](_0x395178['shift']());}catch(_0x482c62){_0x395178['push'](_0x395178['shift']());}}}(a127_0xffc1,0xa02c2));export const CLI_VERSION_POLICY_URL=a127_0x2cdc94(0xd6);function a127_0xffc1(){const _0x1f76a4=['3UYTdRn','3855JPpdvY','90cJAlWU','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','505714FVwzSw','4326133gNYssJ','564223OfCbSP','3148kFMhqX','4336260azoEaq','6559425CMrlJd','94616PQqOct','963gqvfRu'];a127_0xffc1=function(){return _0x1f76a4;};return a127_0xffc1();}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a128_0x47dd(){const _0xc3ef9a=['verbose','operationType','output','function-node','target','pagesize','Description\x20file','key','db-id','52420dbDSWy','dbid','7oFPvtG','production\x20|\x20daily','Title','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Code\x20filter','format','SQL\x20string','global','Force\x20overwrite','Override\x20appcode','type','sqlname','Dataset\x20code','all','sql','Config\x20value','dbId','@lovrabet/rabetbase-cli','JSON\x20params','Confirm\x20destructive\x20action','datasetcode','value','Name','page','nonInteractive','file','env','Preview\x20operation\x20without\x20executing','Clear','skip-imports','Type\x20filter','File\x20path','title','yes','Skip\x20import\x20generation','description-file','confirm','name','Use\x20remote','Page\x20size','DB\x20ID','expected-count','non-interactive','Skip\x20confirmation\x20for\x20high-risk\x20writes','Select\x20app\x20profile\x20by\x20name','dryRun','operation','13543060gfQSQW','fromEntries','Expected\x20affected\x20count','app','boolean','dry-run','string','description','params','Operation\x20type','map','clear','SQL\x20code','sqlcode','Alias\x20for\x20--non-interactive','1109262TbLVKm','Page\x20number','remote','1032816pSDsOn','8986752FOeoxs','meowKey','SQL\x20name','appcode','Description','force','help','1439135nTLqGO','schemas','Rabetbase\x20CLI','descriptionFile','project','Schemas','129PecCCS','Enable\x20BFF\x20save','<code>','skipImports','Output\x20format','watch','Target\x20path','18uHTIBC','keyword','Verbose\x20output','enable-bff-save','code','1092600ynbxbS'];a128_0x47dd=function(){return _0xc3ef9a;};return a128_0x47dd();}const a128_0x2dc4d4=a128_0x4d9c;(function(_0x3ac0ce,_0x97c1f7){const _0x44e4da=a128_0x4d9c,_0x379a61=_0x3ac0ce();while(!![]){try{const _0x5c9f2d=parseInt(_0x44e4da(0x156))/0x1+parseInt(_0x44e4da(0x1ba))/0x2+parseInt(_0x44e4da(0x164))/0x3*(-parseInt(_0x44e4da(0x17a))/0x4)+-parseInt(_0x44e4da(0x15e))/0x5*(parseInt(_0x44e4da(0x16b))/0x6)+-parseInt(_0x44e4da(0x17c))/0x7*(-parseInt(_0x44e4da(0x170))/0x8)+-parseInt(_0x44e4da(0x157))/0x9+parseInt(_0x44e4da(0x1ab))/0xa;if(_0x5c9f2d===_0x97c1f7)break;else _0x379a61['push'](_0x379a61['shift']());}catch(_0x146cb1){_0x379a61['push'](_0x379a61['shift']());}}}(a128_0x47dd,0x9f604));export const CLI_BIN_NAME='rabetbase';export const CLI_DISPLAY_NAME=a128_0x2dc4d4(0x160);export const NPM_PACKAGE_NAME=a128_0x2dc4d4(0x18d);export const GLOBAL_FLAGS=[{'name':a128_0x2dc4d4(0x15a),'meowKey':a128_0x2dc4d4(0x15a),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x185),'hint':a128_0x2dc4d4(0x166)},{'name':'app','meowKey':a128_0x2dc4d4(0x1ae),'type':'string','description':a128_0x2dc4d4(0x1a8),'hint':'<name>'},{'name':'env','meowKey':a128_0x2dc4d4(0x196),'type':a128_0x2dc4d4(0x1b1),'description':'Environment','hint':a128_0x2dc4d4(0x17d)},{'name':a128_0x2dc4d4(0x181),'meowKey':'format','type':'string','description':a128_0x2dc4d4(0x168),'hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x17f),'hint':'<expr>'},{'name':a128_0x2dc4d4(0x1b0),'meowKey':a128_0x2dc4d4(0x1a9),'type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x197)},{'name':a128_0x2dc4d4(0x19d),'meowKey':a128_0x2dc4d4(0x19d),'type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x1a7)},{'name':a128_0x2dc4d4(0x1a6),'meowKey':a128_0x2dc4d4(0x194),'type':a128_0x2dc4d4(0x1af),'description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':a128_0x2dc4d4(0x183),'meowKey':a128_0x2dc4d4(0x183),'type':a128_0x2dc4d4(0x1af),'description':'Use\x20global\x20config\x20scope'},{'name':a128_0x2dc4d4(0x162),'meowKey':a128_0x2dc4d4(0x162),'type':a128_0x2dc4d4(0x1af),'description':'Use\x20project\x20config\x20scope'},{'name':'ci','meowKey':'ci','type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x1b9),'hidden':!![]},{'name':a128_0x2dc4d4(0x15d),'meowKey':a128_0x2dc4d4(0x15d),'type':a128_0x2dc4d4(0x1af),'description':'Show\x20help'},{'name':'name','meowKey':a128_0x2dc4d4(0x1a1),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x192),'hidden':!![]},{'name':a128_0x2dc4d4(0x19c),'meowKey':a128_0x2dc4d4(0x19c),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x17e),'hidden':!![]},{'name':'clear','meowKey':a128_0x2dc4d4(0x1b6),'type':'boolean','description':a128_0x2dc4d4(0x198),'hidden':!![]},{'name':a128_0x2dc4d4(0x169),'meowKey':a128_0x2dc4d4(0x169),'type':a128_0x2dc4d4(0x1af),'description':'Watch\x20mode','hidden':!![]},{'name':'output','meowKey':a128_0x2dc4d4(0x173),'type':a128_0x2dc4d4(0x1b1),'description':'Output\x20path','hidden':!![]},{'name':'params','meowKey':a128_0x2dc4d4(0x1b3),'type':'string','description':a128_0x2dc4d4(0x18e),'hidden':!![]},{'name':a128_0x2dc4d4(0x190),'meowKey':a128_0x2dc4d4(0x190),'type':'string','description':a128_0x2dc4d4(0x188),'hidden':!![]},{'name':a128_0x2dc4d4(0x189),'meowKey':a128_0x2dc4d4(0x189),'type':a128_0x2dc4d4(0x1af),'description':'Apply\x20to\x20all','hidden':!![]},{'name':a128_0x2dc4d4(0x16e),'meowKey':'enableBffSave','type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x165),'hidden':!![]},{'name':'id','meowKey':'id','type':a128_0x2dc4d4(0x1b1),'description':'Record\x20ID','hidden':!![]},{'name':a128_0x2dc4d4(0x186),'meowKey':a128_0x2dc4d4(0x186),'type':'string','description':a128_0x2dc4d4(0x19a),'hidden':!![]},{'name':'file','meowKey':a128_0x2dc4d4(0x195),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x19b),'hidden':!![]},{'name':a128_0x2dc4d4(0x1b8),'meowKey':a128_0x2dc4d4(0x1b8),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x1b7),'hidden':!![]},{'name':'sql-name','meowKey':'sqlName','type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x159),'hidden':!![]},{'name':a128_0x2dc4d4(0x187),'meowKey':a128_0x2dc4d4(0x187),'type':'string','description':'SQL\x20name','hidden':!![]},{'name':a128_0x2dc4d4(0x179),'meowKey':a128_0x2dc4d4(0x18c),'type':'string','description':a128_0x2dc4d4(0x1a4),'hidden':!![]},{'name':a128_0x2dc4d4(0x17b),'meowKey':a128_0x2dc4d4(0x17b),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x1a4),'hidden':!![]},{'name':a128_0x2dc4d4(0x1b2),'meowKey':'description','type':'string','description':a128_0x2dc4d4(0x15b),'hidden':!![]},{'name':a128_0x2dc4d4(0x19f),'meowKey':a128_0x2dc4d4(0x161),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x177),'hidden':!![]},{'name':'page','meowKey':a128_0x2dc4d4(0x193),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x1bb),'hidden':!![]},{'name':a128_0x2dc4d4(0x176),'meowKey':a128_0x2dc4d4(0x176),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x1a3),'hidden':!![]},{'name':a128_0x2dc4d4(0x16c),'meowKey':a128_0x2dc4d4(0x16c),'type':a128_0x2dc4d4(0x1b1),'description':'Keyword\x20filter','hidden':!![]},{'name':a128_0x2dc4d4(0x16f),'meowKey':a128_0x2dc4d4(0x16f),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x180),'hidden':!![]},{'name':'sql','meowKey':a128_0x2dc4d4(0x18a),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x182),'hidden':!![]},{'name':'schemas','meowKey':a128_0x2dc4d4(0x15f),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x163),'hidden':!![]},{'name':a128_0x2dc4d4(0x1aa),'meowKey':a128_0x2dc4d4(0x1aa),'type':a128_0x2dc4d4(0x1b1),'description':'Operation\x20type','hidden':!![]},{'name':a128_0x2dc4d4(0x175),'meowKey':a128_0x2dc4d4(0x175),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x16a),'hidden':!![]},{'name':a128_0x2dc4d4(0x199),'meowKey':a128_0x2dc4d4(0x167),'type':'boolean','description':a128_0x2dc4d4(0x19e),'hidden':!![]},{'name':a128_0x2dc4d4(0x178),'meowKey':a128_0x2dc4d4(0x178),'type':'string','description':'Config\x20key','hidden':!![]},{'name':a128_0x2dc4d4(0x191),'meowKey':'value','type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x18b),'hidden':!![]},{'name':a128_0x2dc4d4(0x15c),'meowKey':a128_0x2dc4d4(0x15c),'type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x184),'hidden':!![]},{'name':a128_0x2dc4d4(0x1a0),'meowKey':a128_0x2dc4d4(0x1a0),'type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x18f),'hidden':!![]},{'name':a128_0x2dc4d4(0x155),'meowKey':a128_0x2dc4d4(0x155),'type':'boolean','description':a128_0x2dc4d4(0x1a2),'hidden':!![]},{'name':a128_0x2dc4d4(0x171),'meowKey':a128_0x2dc4d4(0x171),'type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x16d),'hidden':!![]},{'name':a128_0x2dc4d4(0x1a5),'meowKey':'expectedCount','type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x1ad),'hidden':!![]},{'name':'operation-type','meowKey':a128_0x2dc4d4(0x172),'type':'string','description':a128_0x2dc4d4(0x1b4),'hidden':!![]},{'name':a128_0x2dc4d4(0x174),'meowKey':'functionNode','type':a128_0x2dc4d4(0x1b1),'description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set(['appcode',a128_0x2dc4d4(0x1ae),a128_0x2dc4d4(0x196),'format','jq',a128_0x2dc4d4(0x1b0),a128_0x2dc4d4(0x19d),'non-interactive','ci']);function a128_0x4d9c(_0x4dc740,_0x5b5ae2){_0x4dc740=_0x4dc740-0x155;const _0x47ddd5=a128_0x47dd();let _0x4d9c2f=_0x47ddd5[_0x4dc740];return _0x4d9c2f;}export function buildMeowFlags(){const _0x163594=a128_0x2dc4d4;return Object[_0x163594(0x1ac)](GLOBAL_FLAGS[_0x163594(0x1b5)](_0x2ee2b3=>[_0x2ee2b3[_0x163594(0x158)],{'type':_0x2ee2b3['type']}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a129_0x16316a=a129_0x4578;(function(_0x2f273f,_0x188125){const _0x269f3a=a129_0x4578,_0x423904=_0x2f273f();while(!![]){try{const _0x486fda=parseInt(_0x269f3a(0x6d))/0x1+-parseInt(_0x269f3a(0x70))/0x2+parseInt(_0x269f3a(0x76))/0x3+-parseInt(_0x269f3a(0x74))/0x4*(-parseInt(_0x269f3a(0x77))/0x5)+parseInt(_0x269f3a(0x71))/0x6*(-parseInt(_0x269f3a(0x72))/0x7)+parseInt(_0x269f3a(0x75))/0x8+-parseInt(_0x269f3a(0x6f))/0x9;if(_0x486fda===_0x188125)break;else _0x423904['push'](_0x423904['shift']());}catch(_0x23518d){_0x423904['push'](_0x423904['shift']());}}}(a129_0x1b40,0x97700));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':'production','format':'compress','locale':a129_0x16316a(0x73),'riskLevel':a129_0x16316a(0x6e),'apiDir':DEFAULT_API_DIR};function a129_0x1b40(){const _0x58ae5d=['7RgFqZP','en-US','16sIlDti','3803280DAuJwc','1343100XYwnCc','486120DfsdJf','compress','644042ijhHnp','high-risk-write','6030261TioJuc','1122588gnOswM','626622NiMfDF'];a129_0x1b40=function(){return _0x58ae5d;};return a129_0x1b40();}function a129_0x4578(_0x25b879,_0x7f0a00){_0x25b879=_0x25b879-0x6c;const _0x1b4022=a129_0x1b40();let _0x4578e7=_0x1b4022[_0x25b879];return _0x4578e7;}export const DEFAULT_COMMAND_OUTPUT_FORMAT=a129_0x16316a(0x6c);
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a130_0x85f8e4=a130_0x4025;(function(_0x17ed9f,_0x287be8){const _0x57c580=a130_0x4025,_0x70aa6d=_0x17ed9f();while(!![]){try{const _0x3b4994=parseInt(_0x57c580(0x1ab))/0x1+parseInt(_0x57c580(0x1ac))/0x2+parseInt(_0x57c580(0x1a9))/0x3+parseInt(_0x57c580(0x1b1))/0x4*(-parseInt(_0x57c580(0x1b6))/0x5)+parseInt(_0x57c580(0x1b7))/0x6+parseInt(_0x57c580(0x1b3))/0x7*(-parseInt(_0x57c580(0x1b4))/0x8)+-parseInt(_0x57c580(0x1b5))/0x9*(parseInt(_0x57c580(0x1af))/0xa);if(_0x3b4994===_0x287be8)break;else _0x70aa6d['push'](_0x70aa6d['shift']());}catch(_0x477bec){_0x70aa6d['push'](_0x70aa6d['shift']());}}}(a130_0x5b41,0x53b98));function a130_0x5b41(){const _0x2a8614=['runtimeDomain','680cVzFQm','userDomain','409160gQGyhU','https://user-daily.lovrabet.com','21553GHNjfP','1264XsVUws','36126pdrRQK','10waOEkF','1437606NTKZst','https://runtime.lovrabet.com','1080786uGYXpC','https://daily-api.lovrabet.com','186861MyBTxH','1040452MWXwSf','https://daily-runtime.lovrabet.com'];a130_0x5b41=function(){return _0x2a8614;};return a130_0x5b41();}import{getEnv,isProduction}from'../constant/env.js';function a130_0x4025(_0x1b317b,_0x2b6557){_0x1b317b=_0x1b317b-0x1a9;const _0x5b4139=a130_0x5b41();let _0x402575=_0x5b4139[_0x1b317b];return _0x402575;}let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x226807){const _0x5e4c16=a130_0x4025;customApiDomain=_0x226807?.['apiDomain'],customUserDomain=_0x226807?.[_0x5e4c16(0x1b0)],customRuntimeDomain=_0x226807?.[_0x5e4c16(0x1ae)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a130_0x85f8e4(0x1b2));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':a130_0x85f8e4(0x1aa));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a130_0x85f8e4(0x1b8):a130_0x85f8e4(0x1ad));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x7d281=a131_0x21e1;function a131_0x4b59(){const _0x5b1a16=['development','96913KjZBub','1381041pxHAnb','production','1736912XQeYLq','4465AtUphU','4oBVEpO','1746oYtaCJ','26829JbbFAs','daily','2110LLpaPI','497163YiMSiq','online','72424yBCCIr','7yRQqWI'];a131_0x4b59=function(){return _0x5b1a16;};return a131_0x4b59();}(function(_0x14a02b,_0x1b94e4){const _0x30099e=a131_0x21e1,_0x131491=_0x14a02b();while(!![]){try{const _0x2aea81=-parseInt(_0x30099e(0x199))/0x1+-parseInt(_0x30099e(0x196))/0x2+parseInt(_0x30099e(0x194))/0x3*(parseInt(_0x30099e(0x19e))/0x4)+-parseInt(_0x30099e(0x19d))/0x5*(-parseInt(_0x30099e(0x19f))/0x6)+-parseInt(_0x30099e(0x197))/0x7*(-parseInt(_0x30099e(0x19c))/0x8)+parseInt(_0x30099e(0x19a))/0x9+parseInt(_0x30099e(0x1a2))/0xa*(-parseInt(_0x30099e(0x1a0))/0xb);if(_0x2aea81===_0x1b94e4)break;else _0x131491['push'](_0x131491['shift']());}catch(_0x3d7dd7){_0x131491['push'](_0x131491['shift']());}}}(a131_0x4b59,0x243a9));export const RABETBASE_ENV_VALUES=['production',a131_0x7d281(0x1a1)];export function normalizeEnv(_0x269be5){const _0x246dd5=a131_0x7d281;return _0x269be5===_0x246dd5(0x195)?_0x246dd5(0x19b):_0x269be5;}function a131_0x21e1(_0x5a4c33,_0x595941){_0x5a4c33=_0x5a4c33-0x194;const _0x4b59ab=a131_0x4b59();let _0x21e1b8=_0x4b59ab[_0x5a4c33];return _0x21e1b8;}export function isProduction(_0x47a289){const _0x48f6f3=a131_0x7d281;return normalizeEnv(_0x47a289)===_0x48f6f3(0x19b);}export function isDaily(_0x246554){return normalizeEnv(_0x246554)==='daily';}export function isDev(_0x3f4f0b){const _0x52bb26=a131_0x7d281,_0x2855e3=normalizeEnv(_0x3f4f0b);return _0x2855e3===_0x52bb26(0x198)||_0x2855e3==='dev';}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a131_0x7d281(0x19b));export function getEnv(){return env;}export function initEnv(_0x3d7d2f){env=normalizeEnv(_0x3d7d2f);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a132_0x4b8c(_0x4c172a,_0x202964){_0x4c172a=_0x4c172a-0x73;const _0x373dc1=a132_0x373d();let _0x4b8c2e=_0x373dc1[_0x4c172a];return _0x4b8c2e;}const a132_0x234921=a132_0x4b8c;(function(_0x243556,_0x4e215a){const _0x43ff61=a132_0x4b8c,_0x1419c0=_0x243556();while(!![]){try{const _0x374e0f=-parseInt(_0x43ff61(0x7d))/0x1*(parseInt(_0x43ff61(0x75))/0x2)+parseInt(_0x43ff61(0x76))/0x3+parseInt(_0x43ff61(0x79))/0x4*(-parseInt(_0x43ff61(0x74))/0x5)+-parseInt(_0x43ff61(0x7a))/0x6+parseInt(_0x43ff61(0x78))/0x7+-parseInt(_0x43ff61(0x7b))/0x8+parseInt(_0x43ff61(0x7c))/0x9*(parseInt(_0x43ff61(0x77))/0xa);if(_0x374e0f===_0x4e215a)break;else _0x1419c0['push'](_0x1419c0['shift']());}catch(_0x50027c){_0x1419c0['push'](_0x1419c0['shift']());}}}(a132_0x373d,0xbd5b5));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a132_0x234921(0x7e),'pretty',a132_0x234921(0x73)];function a132_0x373d(){const _0x7e7fb8=['26171720JlJJFr','3684478IgbwIN','29576iRrWGh','1769556UUQDsx','7620392bMpvMJ','9VOBFlK','2382XAEplf','json','compress','965igDcwK','122kVdnyW','1355694FPIDsl'];a132_0x373d=function(){return _0x7e7fb8;};return a132_0x373d();}
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a133_0x38c349=a133_0xc20b;function a133_0x5dab(){const _0x432b24=['8752920dmYyMa','1270psbmRU','19156nqfRde','./src/api','6DOfBax','8036630LoeMUF','5711990oUDAFC','101VPNBYg','44937WRDHfI','925336uWoGVc','133008qeWcsq','116XLhdeY'];a133_0x5dab=function(){return _0x432b24;};return a133_0x5dab();}function a133_0xc20b(_0x588aa5,_0x3e1282){_0x588aa5=_0x588aa5-0xe8;const _0x5dab28=a133_0x5dab();let _0xc20b38=_0x5dab28[_0x588aa5];return _0xc20b38;}(function(_0x3bfc8a,_0x1a58eb){const _0x25c2bf=a133_0xc20b,_0x556cfa=_0x3bfc8a();while(!![]){try{const _0x26d133=-parseInt(_0x25c2bf(0xe8))/0x1*(-parseInt(_0x25c2bf(0xef))/0x2)+parseInt(_0x25c2bf(0xeb))/0x3*(-parseInt(_0x25c2bf(0xec))/0x4)+parseInt(_0x25c2bf(0xf3))/0x5*(parseInt(_0x25c2bf(0xf1))/0x6)+parseInt(_0x25c2bf(0xf2))/0x7+parseInt(_0x25c2bf(0xea))/0x8+-parseInt(_0x25c2bf(0xe9))/0x9*(parseInt(_0x25c2bf(0xee))/0xa)+-parseInt(_0x25c2bf(0xed))/0xb;if(_0x26d133===_0x1a58eb)break;else _0x556cfa['push'](_0x556cfa['shift']());}catch(_0x3caa21){_0x556cfa['push'](_0x556cfa['shift']());}}}(a133_0x5dab,0xa0a26));export const DEFAULT_API_DIR=a133_0x38c349(0xf0);
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x266009=a134_0x43a8;(function(_0x4466e3,_0x417089){const _0xbe670c=a134_0x43a8,_0xb58e24=_0x4466e3();while(!![]){try{const _0x26fff6=-parseInt(_0xbe670c(0x89))/0x1*(-parseInt(_0xbe670c(0x8b))/0x2)+-parseInt(_0xbe670c(0x8f))/0x3*(parseInt(_0xbe670c(0x92))/0x4)+-parseInt(_0xbe670c(0x8d))/0x5+-parseInt(_0xbe670c(0x91))/0x6*(-parseInt(_0xbe670c(0x90))/0x7)+parseInt(_0xbe670c(0x8a))/0x8+parseInt(_0xbe670c(0x94))/0x9+parseInt(_0xbe670c(0x95))/0xa*(parseInt(_0xbe670c(0x8e))/0xb);if(_0x26fff6===_0x417089)break;else _0xb58e24['push'](_0xb58e24['shift']());}catch(_0x2bc2c9){_0xb58e24['push'](_0xb58e24['shift']());}}}(a134_0xacc0,0xdc8d9));export const RISK_LEVEL_VALUES=[a134_0x266009(0x93),a134_0x266009(0x8c),'high-risk-write'];function a134_0x43a8(_0x3b33cc,_0x5cdc08){_0x3b33cc=_0x3b33cc-0x89;const _0xacc031=a134_0xacc0();let _0x43a8fc=_0xacc031[_0x3b33cc];return _0x43a8fc;}function a134_0xacc0(){const _0xb0912c=['20mBBZgt','read','3571569KutWet','69130UlyMdO','57973HuuCYQ','6324224EyEXcV','10HvMEmQ','write','5518725DwJULm','407CZmLkW','913449rlCdsf','12575710llDnmC','6WTECSZ'];a134_0xacc0=function(){return _0xb0912c;};return a134_0xacc0();}
|