@lovrabet/rabetbase-cli 2.2.3-beta.2 → 2.2.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a128_0x4a3d0e=a128_0x2ffb;(function(_0x49733f,_0x295cff){const _0x2d3383=a128_0x2ffb,_0x1bd2af=_0x49733f();while(!![]){try{const _0x489eb8=-parseInt(_0x2d3383(0x14e))/0x1*(-parseInt(_0x2d3383(0x16f))/0x2)+-parseInt(_0x2d3383(0x16d))/0x3*(parseInt(_0x2d3383(0x166))/0x4)+-parseInt(_0x2d3383(0x15d))/0x5+parseInt(_0x2d3383(0x160))/0x6+-parseInt(_0x2d3383(0x153))/0x7*(-parseInt(_0x2d3383(0x155))/0x8)+parseInt(_0x2d3383(0x174))/0x9*(parseInt(_0x2d3383(0x154))/0xa)+-parseInt(_0x2d3383(0x165))/0xb;if(_0x489eb8===_0x295cff)break;else _0x1bd2af['push'](_0x1bd2af['shift']());}catch(_0x5e7c1b){_0x1bd2af['push'](_0x1bd2af['shift']());}}}(a128_0x42f3,0x6b186));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';function a128_0x42f3(){const _0x3c6020=['length','POST','write','name','appCode','2199bzktcP','toISOString','438282qkFJqo','paging','test','sqlName','skipped','9pYwNzn','utf8','message','replace','local\x20differs\x20from\x20remote','lastSync','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqls','Force\x20overwrite\x20local\x20unsynced\x20changes','Pull\x20complete:\x20','sqlcode','pull','str','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sql','force','nonInteractive','\x20SQL\x20file(s)\x20into\x20','push','string','cancelled','filter','sqlCode','unchanged','catch','trimStart','1XwbzAM','would_pull','totalCount','sqlRootDir','sqlRoot','96299mclcba','5664760VogZhe','376ozjtEx','description','mybatisXml','sqlContent','Force\x20pull\x20cancelled.','lockFilePath','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','dbId','2536070vFvKOS','\x20skipped,\x20','tableData','4037472ppNPXP','bool','conflict','split','path','11848496CANvUc','448HegAkY','\x20failed'];a128_0x42f3=function(){return _0x3c6020;};return a128_0x42f3();}import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x4589b2,_0x8334e8){const _0x431360=a128_0x2ffb,_0x2be717=[];let _0x2ed8c9=0x1;while(!![]){const _0x163938=await listSqlQueries(_0x4589b2,{'currentPage':_0x2ed8c9,'pageSize':PAGE_SIZE,'sqlCode':_0x8334e8[_0x431360(0x14a)],'sqlName':_0x8334e8['sqlName']}),_0x4f64da=_0x163938[_0x431360(0x15f)]??[];_0x2be717['push'](..._0x4f64da);if(_0x4f64da[_0x431360(0x168)]===0x0)break;const _0x4e46f4=_0x163938[_0x431360(0x170)]?.[_0x431360(0x150)];if(_0x4e46f4!=null?_0x2be717[_0x431360(0x168)]>=_0x4e46f4:_0x4f64da['length']<PAGE_SIZE)break;_0x2ed8c9++;}return _0x2be717;}async function ensureSqlContent(_0x5a27e9){const _0xf68585=a128_0x2ffb;if(_0x5a27e9[_0xf68585(0x158)]!=null&&String(_0x5a27e9['sqlContent'])[_0xf68585(0x168)]>0x0)return _0x5a27e9;return getSqlQueryDetail(_0x5a27e9['sqlCode']);}export const sqlPull={'service':a128_0x4a3d0e(0x182),'command':'pull','description':a128_0x4a3d0e(0x17a),'risk':a128_0x4a3d0e(0x16a),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0x4a3d0e(0x16b),'type':a128_0x4a3d0e(0x147),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a128_0x4a3d0e(0x183),'type':'boolean','description':a128_0x4a3d0e(0x17c)}],async 'dryRun'(_0x2266d9){const _0x41ea44=a128_0x4a3d0e,_0x4e11fa=loadSqlProjectConfig(_0x2266d9[_0x41ea44(0x16c)]),_0x1a4f2b=await readSqlLockFile(_0x4e11fa[_0x41ea44(0x15a)]),{appLock:_0x1ec7b2}=ensureSqlLockScope(_0x1a4f2b??createEmptySqlLock(),_0x4e11fa[_0x41ea44(0x16c)],_0x4e11fa['sqlRoot'],_0x41ea44(0x17f)),_0x14369d=await fetchAllSqlQueries(_0x2266d9['appCode'],{'sqlCode':_0x2266d9[_0x41ea44(0x180)](_0x41ea44(0x17e))||undefined,'sqlName':_0x2266d9[_0x41ea44(0x180)](_0x41ea44(0x16b))||undefined}),_0x20bba1=[];for(const _0x24e69d of _0x14369d){const _0x28c248=await ensureSqlContent(_0x24e69d),_0x30b33e=ensureRemoteSqlContent(_0x28c248),_0x966cda=detectModeFromSql(_0x28c248),_0x524c85=_0x28c248[_0x41ea44(0x15c)]?await getDbName(_0x2266d9[_0x41ea44(0x16c)],Number(_0x28c248[_0x41ea44(0x15c)]))['catch'](()=>undefined):undefined,_0x2c12a4=buildLocalSqlFileContent({'sqlCode':_0x28c248[_0x41ea44(0x14a)],'sqlName':_0x28c248[_0x41ea44(0x172)],'dbId':_0x28c248[_0x41ea44(0x15c)]},_0x30b33e,{'dbName':_0x524c85,'mode':_0x966cda,'syncedAt':new Date()[_0x41ea44(0x16e)](),'description':_0x28c248[_0x41ea44(0x156)]}),_0x3232f9=buildSqlLockEntry(_0x28c248,_0x30b33e,'',{'dbName':_0x524c85}),_0xe2f394=resolveLocalSqlFilePath(_0x4e11fa,_0x28c248[_0x41ea44(0x14a)],_0x3232f9);let _0x2824ee=_0x41ea44(0x14f),_0x548b18;if(await fileExists(_0xe2f394)){const _0xefafb8=await readFile(_0xe2f394,_0x41ea44(0x175));isEquivalentPulledSqlFile(_0xefafb8,_0x2c12a4,_0x966cda)?(_0x2824ee=_0x41ea44(0x173),_0x548b18=_0x41ea44(0x14b)):(_0x2824ee=_0x41ea44(0x162),_0x548b18=_0x41ea44(0x181));}_0x20bba1['push']({'sqlCode':_0x28c248[_0x41ea44(0x14a)],'sqlName':_0x28c248['sqlName'],'filePath':_0xe2f394,'status':_0x2824ee,'reason':_0x548b18});}return{'method':_0x41ea44(0x169),'url':_0x41ea44(0x15b),'body':{'appCode':_0x2266d9['appCode'],'sqlCode':_0x2266d9[_0x41ea44(0x180)](_0x41ea44(0x17e))||null,'sqlName':_0x2266d9[_0x41ea44(0x180)](_0x41ea44(0x16b))||null,'files':_0x20bba1},'description':'Would\x20pull\x20'+_0x20bba1[_0x41ea44(0x168)]+_0x41ea44(0x145)+_0x4e11fa[_0x41ea44(0x151)]};},async 'execute'(_0xe2aec5){const _0x4b853e=a128_0x4a3d0e,_0x281de8=loadSqlProjectConfig(_0xe2aec5[_0x4b853e(0x16c)]),_0x197a93=await readSqlLockFile(_0x281de8[_0x4b853e(0x15a)]),{lockData:_0x596935,appLock:_0x4909cc}=ensureSqlLockScope(_0x197a93??createEmptySqlLock(),_0x281de8[_0x4b853e(0x16c)],_0x281de8[_0x4b853e(0x152)],_0x4b853e(0x17f)),_0x3fd46b=_0xe2aec5[_0x4b853e(0x161)](_0x4b853e(0x183)),_0x342016=await fetchAllSqlQueries(_0xe2aec5['appCode'],{'sqlCode':_0xe2aec5[_0x4b853e(0x180)]('sqlcode')||undefined,'sqlName':_0xe2aec5['str'](_0x4b853e(0x16b))||undefined});if(_0x342016[_0x4b853e(0x168)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0xfd6970=[],_0xcb379b=[];for(const _0xa25f2c of _0x342016){try{_0xfd6970[_0x4b853e(0x146)](await ensureSqlContent(_0xa25f2c));}catch(_0x594f22){_0xcb379b[_0x4b853e(0x146)]({'sqlCode':_0xa25f2c[_0x4b853e(0x14a)],'error':_0x594f22 instanceof Error?_0x594f22['message']:String(_0x594f22)});}}if(_0x3fd46b&&!_0xe2aec5[_0x4b853e(0x184)]){let _0x275868=![];for(const _0x2859cd of _0xfd6970){const _0x38c389=detectModeFromSql(_0x2859cd),_0x305c71=_0x2859cd['dbId']?await getDbName(_0xe2aec5[_0x4b853e(0x16c)],Number(_0x2859cd['dbId']))[_0x4b853e(0x14c)](()=>undefined):undefined,_0x4fd84c=buildLocalSqlFileContent({'sqlCode':_0x2859cd[_0x4b853e(0x14a)],'sqlName':_0x2859cd[_0x4b853e(0x172)],'dbId':_0x2859cd['dbId']},ensureRemoteSqlContent(_0x2859cd),{'dbName':_0x305c71,'mode':_0x38c389,'syncedAt':new Date()['toISOString'](),'description':_0x2859cd[_0x4b853e(0x156)]}),_0xa2ae0b=resolveLocalSqlFilePath(_0x281de8,_0x2859cd[_0x4b853e(0x14a)],buildSqlLockEntry(_0x2859cd,ensureRemoteSqlContent(_0x2859cd),'',{'dbName':_0x305c71}));if(await fileExists(_0xa2ae0b)){const _0x5cba1e=await readFile(_0xa2ae0b,_0x4b853e(0x175));if(!isEquivalentPulledSqlFile(_0x5cba1e,_0x4fd84c,_0x38c389)){_0x275868=!![];break;}}}if(_0x275868){const _0x4f7630=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x4f7630)throw CliErrors[_0x4b853e(0x148)](_0x4b853e(0x159));}}const _0x73995b=cloneSqlLockData(_0x596935),_0x427ed4=_0x73995b['apps'][_0x281de8[_0x4b853e(0x16c)]],_0x3e7c35=[],_0x1bb96b=[];for(const _0x470420 of _0xfd6970){const _0x591476=_0x427ed4['sqls'][_0x470420[_0x4b853e(0x14a)]],_0x5f80b9=ensureRemoteSqlContent(_0x470420),_0x209966=detectModeFromSql(_0x470420),_0x3723ab=_0x470420[_0x4b853e(0x15c)]?await getDbName(_0xe2aec5[_0x4b853e(0x16c)],Number(_0x470420[_0x4b853e(0x15c)]))[_0x4b853e(0x14c)](()=>undefined):undefined,_0x544e9f=buildLocalSqlFileContent({'sqlCode':_0x470420['sqlCode'],'sqlName':_0x470420[_0x4b853e(0x172)],'dbId':_0x470420[_0x4b853e(0x15c)]},_0x5f80b9,{'dbName':_0x3723ab,'mode':_0x209966,'syncedAt':new Date()[_0x4b853e(0x16e)](),'description':_0x470420[_0x4b853e(0x156)]}),_0x4374ba=buildSqlLockEntry(_0x470420,_0x5f80b9,computeSqlContentHash(_0x544e9f),{'dbName':_0x3723ab}),_0x478571=_0x4374ba[_0x4b853e(0x164)],_0x43290b=join(_0x281de8[_0x4b853e(0x151)],_0x478571);try{if(await fileExists(_0x43290b)){const _0x3bcdb7=await readFile(_0x43290b,_0x4b853e(0x175));if(isEquivalentPulledSqlFile(_0x3bcdb7,_0x544e9f,_0x209966)){_0x1bb96b[_0x4b853e(0x146)]({'sqlCode':_0x470420['sqlCode'],'reason':_0x4b853e(0x14b)}),_0x427ed4[_0x4b853e(0x17b)][_0x470420[_0x4b853e(0x14a)]]={..._0x4374ba,'hash':computeSqlContentHash(_0x3bcdb7),'path':_0x478571};continue;}if(!_0x3fd46b){_0x1bb96b['push']({'sqlCode':_0x470420['sqlCode'],'reason':_0x4b853e(0x178)});continue;}}const _0x2d71cd=_0x591476?.[_0x4b853e(0x164)]?join(_0x281de8['sqlRootDir'],_0x591476['path']):undefined;_0x2d71cd&&_0x2d71cd!==_0x43290b&&await fileExists(_0x2d71cd)&&await rm(_0x2d71cd,{'force':!![]}),await ensureParentDirectory(_0x43290b),await writeFile(_0x43290b,_0x544e9f,'utf8'),_0x427ed4[_0x4b853e(0x17b)][_0x470420[_0x4b853e(0x14a)]]={..._0x4374ba,'path':_0x478571},_0x3e7c35['push']({'sqlCode':_0x470420['sqlCode'],'filePath':_0x43290b});}catch(_0x147b40){_0xcb379b[_0x4b853e(0x146)]({'sqlCode':_0x470420['sqlCode'],'error':_0x147b40 instanceof Error?_0x147b40[_0x4b853e(0x176)]:String(_0x147b40)});}}return _0x427ed4[_0x4b853e(0x179)]=new Date()['toISOString'](),await writeSqlLockFile(_0x281de8[_0x4b853e(0x15a)],_0x73995b),{'ok':_0xcb379b['length']===0x0,'data':{'pulled':_0x3e7c35,'skipped':_0x1bb96b,'failed':_0xcb379b},'message':_0x4b853e(0x17d)+_0x3e7c35['length']+'\x20written,\x20'+_0x1bb96b[_0x4b853e(0x168)]+_0x4b853e(0x15e)+_0xcb379b['length']+_0x4b853e(0x167)};}};function detectModeFromSql(_0x10ae62){const _0x5371ff=a128_0x4a3d0e,_0x5b298a=ensureRemoteSqlContent(_0x10ae62),_0x42ed88=stripLocalSqlMetadata(_0x5b298a,_0x5371ff(0x157))[_0x5371ff(0x14d)]();if(/^<(select|insert|update|delete)\b/i[_0x5371ff(0x171)](_0x42ed88))return _0x5371ff(0x157);return _0x5371ff(0x182);}function a128_0x2ffb(_0x4af106,_0x1a14e0){_0x4af106=_0x4af106-0x145;const _0x42f383=a128_0x42f3();let _0x2ffb0d=_0x42f383[_0x4af106];return _0x2ffb0d;}function isEquivalentPulledSqlFile(_0x67a6c7,_0x1585f7,_0x47faee){return normalizePullComparableContent(_0x67a6c7,_0x47faee)===normalizePullComparableContent(_0x1585f7,_0x47faee);}function normalizePullComparableContent(_0x59f393,_0x466391){const _0x298c18=a128_0x4a3d0e,_0xc534c6=_0x59f393[_0x298c18(0x177)](/\r\n/g,'\x0a')[_0x298c18(0x163)]('\x0a'),_0x3d4017=_0xc534c6[_0x298c18(0x149)](_0x449ce9=>!isSyncedAtMetadataLine(_0x449ce9,_0x466391));return _0x3d4017['join']('\x0a');}function isSyncedAtMetadataLine(_0x103fc2,_0x123c25){const _0x33e01d=a128_0x4a3d0e;if(_0x123c25===_0x33e01d(0x157))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x103fc2);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x33e01d(0x171)](_0x103fc2);}
|
|
1
|
+
const a128_0x1979bd=a128_0x5a49;(function(_0x31516e,_0x40a779){const _0x5b9f0c=a128_0x5a49,_0x1ed127=_0x31516e();while(!![]){try{const _0x4fca86=parseInt(_0x5b9f0c(0xd1))/0x1+-parseInt(_0x5b9f0c(0xce))/0x2*(parseInt(_0x5b9f0c(0xb7))/0x3)+-parseInt(_0x5b9f0c(0xb6))/0x4*(parseInt(_0x5b9f0c(0xe8))/0x5)+parseInt(_0x5b9f0c(0xc1))/0x6+-parseInt(_0x5b9f0c(0xdf))/0x7*(-parseInt(_0x5b9f0c(0xbf))/0x8)+parseInt(_0x5b9f0c(0xbd))/0x9+parseInt(_0x5b9f0c(0xc8))/0xa*(-parseInt(_0x5b9f0c(0xc2))/0xb);if(_0x4fca86===_0x40a779)break;else _0x1ed127['push'](_0x1ed127['shift']());}catch(_0x391e64){_0x1ed127['push'](_0x1ed127['shift']());}}}(a128_0xb4a8,0xe57ac));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';function a128_0xb4a8(){const _0x29aca8=['POST','local\x20differs\x20from\x20remote','Filter\x20by\x20SQL\x20display\x20name','test','replace','sqlcode','167655HwHvra','Would\x20pull\x20','toISOString','tableData','description','appCode','apps','sql','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','lockFilePath','bool','108wTNjtY','1227sdCQjX','\x20written,\x20','boolean','totalCount','message','\x20failed','12474297YCNGeh','unchanged','695016VmTnGW','dbId','3373374hTSgpm','33473SaSknu','name','mybatisXml','sqlCode','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','length','1140MaJtZt','sqlRootDir','cancelled','join','sqlContent','str','7484qRhJjN','push','conflict','297494mxMJjy','sqls','Force\x20overwrite\x20local\x20unsynced\x20changes','sqlName','filter','skipped','path','utf8','paging','pull','sqlRoot','catch','\x20SQL\x20file(s)\x20into\x20','lastSync','119ACyyOj','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','force'];a128_0xb4a8=function(){return _0x29aca8;};return a128_0xb4a8();}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(_0x2b7c0d,_0x92074e){const _0x52cb92=a128_0x5a49,_0x466fc8=[];let _0x10be0c=0x1;while(!![]){const _0x479db4=await listSqlQueries(_0x2b7c0d,{'currentPage':_0x10be0c,'pageSize':PAGE_SIZE,'sqlCode':_0x92074e[_0x52cb92(0xc5)],'sqlName':_0x92074e[_0x52cb92(0xd4)]}),_0x309426=_0x479db4[_0x52cb92(0xae)]??[];_0x466fc8[_0x52cb92(0xcf)](..._0x309426);if(_0x309426[_0x52cb92(0xc7)]===0x0)break;const _0x362c78=_0x479db4[_0x52cb92(0xd9)]?.[_0x52cb92(0xba)];if(_0x362c78!=null?_0x466fc8[_0x52cb92(0xc7)]>=_0x362c78:_0x309426[_0x52cb92(0xc7)]<PAGE_SIZE)break;_0x10be0c++;}return _0x466fc8;}async function ensureSqlContent(_0x420bbf){const _0x5965cd=a128_0x5a49;if(_0x420bbf[_0x5965cd(0xcc)]!=null&&String(_0x420bbf['sqlContent'])[_0x5965cd(0xc7)]>0x0)return _0x420bbf;return getSqlQueryDetail(_0x420bbf[_0x5965cd(0xc5)]);}export const sqlPull={'service':'sql','command':a128_0x1979bd(0xda),'description':a128_0x1979bd(0xe0),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0x1979bd(0xc3),'type':'string','description':a128_0x1979bd(0xe4)},{'name':a128_0x1979bd(0xe1),'type':a128_0x1979bd(0xb9),'description':a128_0x1979bd(0xd3)}],async 'dryRun'(_0x3353b5){const _0x4e5bba=a128_0x1979bd,_0x5c5aaf=loadSqlProjectConfig(_0x3353b5[_0x4e5bba(0xb0)]),_0x2ecbae=await readSqlLockFile(_0x5c5aaf[_0x4e5bba(0xb4)]),{appLock:_0x44de77}=ensureSqlLockScope(_0x2ecbae??createEmptySqlLock(),_0x5c5aaf[_0x4e5bba(0xb0)],_0x5c5aaf[_0x4e5bba(0xdb)],_0x4e5bba(0xda)),_0x1ee8dd=await fetchAllSqlQueries(_0x3353b5[_0x4e5bba(0xb0)],{'sqlCode':_0x3353b5[_0x4e5bba(0xcd)](_0x4e5bba(0xe7))||undefined,'sqlName':_0x3353b5[_0x4e5bba(0xcd)](_0x4e5bba(0xc3))||undefined}),_0x29ae9a=[];for(const _0x4c13da of _0x1ee8dd){const _0xe8bd0d=await ensureSqlContent(_0x4c13da),_0x4c5a80=ensureRemoteSqlContent(_0xe8bd0d),_0x319e67=detectModeFromSql(_0xe8bd0d),_0x2e8008=_0xe8bd0d['dbId']?await getDbName(_0x3353b5[_0x4e5bba(0xb0)],Number(_0xe8bd0d[_0x4e5bba(0xc0)]))[_0x4e5bba(0xdc)](()=>undefined):undefined,_0x386e68=buildLocalSqlFileContent({'sqlCode':_0xe8bd0d[_0x4e5bba(0xc5)],'sqlName':_0xe8bd0d[_0x4e5bba(0xd4)],'dbId':_0xe8bd0d[_0x4e5bba(0xc0)]},_0x4c5a80,{'dbName':_0x2e8008,'mode':_0x319e67,'syncedAt':new Date()[_0x4e5bba(0xad)](),'description':_0xe8bd0d['description']}),_0x32e824=buildSqlLockEntry(_0xe8bd0d,_0x4c5a80,'',{'dbName':_0x2e8008}),_0x21cbec=resolveLocalSqlFilePath(_0x5c5aaf,_0xe8bd0d[_0x4e5bba(0xc5)],_0x32e824);let _0x456292='would_pull',_0x2c4fb7;if(await fileExists(_0x21cbec)){const _0x1f8e8b=await readFile(_0x21cbec,_0x4e5bba(0xd8));isEquivalentPulledSqlFile(_0x1f8e8b,_0x386e68,_0x319e67)?(_0x456292=_0x4e5bba(0xd6),_0x2c4fb7='unchanged'):(_0x456292=_0x4e5bba(0xd0),_0x2c4fb7=_0x4e5bba(0xc6));}_0x29ae9a[_0x4e5bba(0xcf)]({'sqlCode':_0xe8bd0d['sqlCode'],'sqlName':_0xe8bd0d[_0x4e5bba(0xd4)],'filePath':_0x21cbec,'status':_0x456292,'reason':_0x2c4fb7});}return{'method':_0x4e5bba(0xe2),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x3353b5['appCode'],'sqlCode':_0x3353b5['str'](_0x4e5bba(0xe7))||null,'sqlName':_0x3353b5[_0x4e5bba(0xcd)](_0x4e5bba(0xc3))||null,'files':_0x29ae9a},'description':_0x4e5bba(0xe9)+_0x29ae9a[_0x4e5bba(0xc7)]+_0x4e5bba(0xdd)+_0x5c5aaf[_0x4e5bba(0xc9)]};},async 'execute'(_0x15048a){const _0x1e2dbf=a128_0x1979bd,_0x41087c=loadSqlProjectConfig(_0x15048a[_0x1e2dbf(0xb0)]),_0x393327=await readSqlLockFile(_0x41087c['lockFilePath']),{lockData:_0x4d4c91,appLock:_0x465db1}=ensureSqlLockScope(_0x393327??createEmptySqlLock(),_0x41087c[_0x1e2dbf(0xb0)],_0x41087c['sqlRoot'],'pull'),_0x134405=_0x15048a[_0x1e2dbf(0xb5)](_0x1e2dbf(0xe1)),_0x49756c=await fetchAllSqlQueries(_0x15048a[_0x1e2dbf(0xb0)],{'sqlCode':_0x15048a['str'](_0x1e2dbf(0xe7))||undefined,'sqlName':_0x15048a['str'](_0x1e2dbf(0xc3))||undefined});if(_0x49756c['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x397a5a=[],_0x4336a9=[];for(const _0x52b742 of _0x49756c){try{_0x397a5a[_0x1e2dbf(0xcf)](await ensureSqlContent(_0x52b742));}catch(_0x1a6b0f){_0x4336a9['push']({'sqlCode':_0x52b742['sqlCode'],'error':_0x1a6b0f instanceof Error?_0x1a6b0f[_0x1e2dbf(0xbb)]:String(_0x1a6b0f)});}}if(_0x134405&&!_0x15048a['nonInteractive']){let _0x571098=![];for(const _0x1f5e12 of _0x397a5a){const _0x22da93=detectModeFromSql(_0x1f5e12),_0x5a718c=_0x1f5e12[_0x1e2dbf(0xc0)]?await getDbName(_0x15048a[_0x1e2dbf(0xb0)],Number(_0x1f5e12[_0x1e2dbf(0xc0)]))[_0x1e2dbf(0xdc)](()=>undefined):undefined,_0xdada8a=buildLocalSqlFileContent({'sqlCode':_0x1f5e12[_0x1e2dbf(0xc5)],'sqlName':_0x1f5e12['sqlName'],'dbId':_0x1f5e12[_0x1e2dbf(0xc0)]},ensureRemoteSqlContent(_0x1f5e12),{'dbName':_0x5a718c,'mode':_0x22da93,'syncedAt':new Date()['toISOString'](),'description':_0x1f5e12[_0x1e2dbf(0xaf)]}),_0x178c6a=resolveLocalSqlFilePath(_0x41087c,_0x1f5e12['sqlCode'],buildSqlLockEntry(_0x1f5e12,ensureRemoteSqlContent(_0x1f5e12),'',{'dbName':_0x5a718c}));if(await fileExists(_0x178c6a)){const _0x3fa328=await readFile(_0x178c6a,_0x1e2dbf(0xd8));if(!isEquivalentPulledSqlFile(_0x3fa328,_0xdada8a,_0x22da93)){_0x571098=!![];break;}}}if(_0x571098){const _0x5452f5=await confirmForceOverwrite(_0x1e2dbf(0xb3));if(!_0x5452f5)throw CliErrors[_0x1e2dbf(0xca)]('Force\x20pull\x20cancelled.');}}const _0x4df837=cloneSqlLockData(_0x4d4c91),_0x36304d=_0x4df837[_0x1e2dbf(0xb1)][_0x41087c['appCode']],_0x1cf22f=[],_0x2fd8b9=[];for(const _0x5f5c3c of _0x397a5a){const _0x3766bd=_0x36304d[_0x1e2dbf(0xd2)][_0x5f5c3c[_0x1e2dbf(0xc5)]],_0x3633b7=ensureRemoteSqlContent(_0x5f5c3c),_0x598119=detectModeFromSql(_0x5f5c3c),_0x3541d2=_0x5f5c3c[_0x1e2dbf(0xc0)]?await getDbName(_0x15048a[_0x1e2dbf(0xb0)],Number(_0x5f5c3c[_0x1e2dbf(0xc0)]))[_0x1e2dbf(0xdc)](()=>undefined):undefined,_0x13f049=buildLocalSqlFileContent({'sqlCode':_0x5f5c3c[_0x1e2dbf(0xc5)],'sqlName':_0x5f5c3c[_0x1e2dbf(0xd4)],'dbId':_0x5f5c3c['dbId']},_0x3633b7,{'dbName':_0x3541d2,'mode':_0x598119,'syncedAt':new Date()['toISOString'](),'description':_0x5f5c3c[_0x1e2dbf(0xaf)]}),_0x3a1edb=buildSqlLockEntry(_0x5f5c3c,_0x3633b7,computeSqlContentHash(_0x13f049),{'dbName':_0x3541d2}),_0x27af03=_0x3a1edb['path'],_0x40ec4e=join(_0x41087c[_0x1e2dbf(0xc9)],_0x27af03);try{if(await fileExists(_0x40ec4e)){const _0x60da38=await readFile(_0x40ec4e,'utf8');if(isEquivalentPulledSqlFile(_0x60da38,_0x13f049,_0x598119)){_0x2fd8b9[_0x1e2dbf(0xcf)]({'sqlCode':_0x5f5c3c['sqlCode'],'reason':_0x1e2dbf(0xbe)}),_0x36304d[_0x1e2dbf(0xd2)][_0x5f5c3c[_0x1e2dbf(0xc5)]]={..._0x3a1edb,'hash':computeSqlContentHash(_0x60da38),'path':_0x27af03};continue;}if(!_0x134405){_0x2fd8b9[_0x1e2dbf(0xcf)]({'sqlCode':_0x5f5c3c['sqlCode'],'reason':_0x1e2dbf(0xe3)});continue;}}const _0x1e6af9=_0x3766bd?.[_0x1e2dbf(0xd7)]?join(_0x41087c[_0x1e2dbf(0xc9)],_0x3766bd[_0x1e2dbf(0xd7)]):undefined;_0x1e6af9&&_0x1e6af9!==_0x40ec4e&&await fileExists(_0x1e6af9)&&await rm(_0x1e6af9,{'force':!![]}),await ensureParentDirectory(_0x40ec4e),await writeFile(_0x40ec4e,_0x13f049,_0x1e2dbf(0xd8)),_0x36304d[_0x1e2dbf(0xd2)][_0x5f5c3c[_0x1e2dbf(0xc5)]]={..._0x3a1edb,'path':_0x27af03},_0x1cf22f[_0x1e2dbf(0xcf)]({'sqlCode':_0x5f5c3c[_0x1e2dbf(0xc5)],'filePath':_0x40ec4e});}catch(_0x29b025){_0x4336a9['push']({'sqlCode':_0x5f5c3c[_0x1e2dbf(0xc5)],'error':_0x29b025 instanceof Error?_0x29b025[_0x1e2dbf(0xbb)]:String(_0x29b025)});}}return _0x36304d[_0x1e2dbf(0xde)]=new Date()[_0x1e2dbf(0xad)](),await writeSqlLockFile(_0x41087c['lockFilePath'],_0x4df837),{'ok':_0x4336a9[_0x1e2dbf(0xc7)]===0x0,'data':{'pulled':_0x1cf22f,'skipped':_0x2fd8b9,'failed':_0x4336a9},'message':'Pull\x20complete:\x20'+_0x1cf22f[_0x1e2dbf(0xc7)]+_0x1e2dbf(0xb8)+_0x2fd8b9[_0x1e2dbf(0xc7)]+'\x20skipped,\x20'+_0x4336a9[_0x1e2dbf(0xc7)]+_0x1e2dbf(0xbc)};}};function a128_0x5a49(_0x165701,_0x3069da){_0x165701=_0x165701-0xad;const _0xb4a829=a128_0xb4a8();let _0x5a49aa=_0xb4a829[_0x165701];return _0x5a49aa;}function detectModeFromSql(_0x7888e5){const _0x2ef16b=a128_0x1979bd,_0x104b0b=ensureRemoteSqlContent(_0x7888e5),_0x51b5f4=stripLocalSqlMetadata(_0x104b0b,'mybatisXml')['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x2ef16b(0xe5)](_0x51b5f4))return _0x2ef16b(0xc4);return _0x2ef16b(0xb2);}function isEquivalentPulledSqlFile(_0x1a3da8,_0x1f5f04,_0x4a2121){return normalizePullComparableContent(_0x1a3da8,_0x4a2121)===normalizePullComparableContent(_0x1f5f04,_0x4a2121);}function normalizePullComparableContent(_0x45c40f,_0x106ddd){const _0xe1c73d=a128_0x1979bd,_0x1ea924=_0x45c40f[_0xe1c73d(0xe6)](/\r\n/g,'\x0a')['split']('\x0a'),_0xe77c51=_0x1ea924[_0xe1c73d(0xd5)](_0x195282=>!isSyncedAtMetadataLine(_0x195282,_0x106ddd));return _0xe77c51[_0xe1c73d(0xcb)]('\x0a');}function isSyncedAtMetadataLine(_0x3bf1ec,_0x2e2c08){const _0x23c249=a128_0x1979bd;if(_0x2e2c08==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x23c249(0xe5)](_0x3bf1ec);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x23c249(0xe5)](_0x3bf1ec);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a129_0x23cd3e=a129_0x1a9e;(function(_0x591363,_0x10c512){const _0x26104f=a129_0x1a9e,_0x5a15cc=_0x591363();while(!![]){try{const _0x1ce908=-parseInt(_0x26104f(0x10f))/0x1+parseInt(_0x26104f(0xed))/0x2*(-parseInt(_0x26104f(0xfb))/0x3)+-parseInt(_0x26104f(0x115))/0x4*(parseInt(_0x26104f(0xe9))/0x5)+parseInt(_0x26104f(0xe3))/0x6+parseInt(_0x26104f(0xfa))/0x7*(parseInt(_0x26104f(0x107))/0x8)+-parseInt(_0x26104f(0xee))/0x9*(-parseInt(_0x26104f(0x112))/0xa)+parseInt(_0x26104f(0x10e))/0xb;if(_0x1ce908===_0x10c512)break;else _0x5a15cc['push'](_0x5a15cc['shift']());}catch(_0x3af2e6){_0x5a15cc['push'](_0x5a15cc['shift']());}}}(a129_0x4cec,0x9f4af));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';function a129_0x4cec(){const _0x4b3c5b=['Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','high-risk-write','replace','\x20pushed,\x20','path','mode','validation','/smartapi/custom/updateUserCustomSql','has','exec','7532aONXxu','2072661ZAyTnI','lockFilePath','lastSync','isFinite','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','force','No\x20local\x20SQL\x20files\x20found.','filePath','version','Push\x20complete:\x20','utf8','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','104IiYUWT','hash','trashDir','sqlRootDir','remoteId','sqls','Local\x20directory\x20\x22','10991783fbgfvB','938958fDPusk','dbName','length','9370fALDNf','sqlCode','relativePath','28pawLje','Push\x20local\x20SQL\x20files\x20to\x20remote','map','sqlRoot','No\x20database\x20matches\x20local\x20directory\x20\x22','sqlcode','unchanged','bool','POST','startsWith','appCode','join','dbId','message','catch','\x20skipped,\x20','get','toISOString','537240MSaStE','Local\x20SQL\x20not\x20found:\x20','entries','\x20SQL\x20file(s)','push','str','71725LgnTOJ','filter','sqlName','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','2CUkKAl','12294BwkMnD','Would\x20push\x20'];a129_0x4cec=function(){return _0x4b3c5b;};return a129_0x4cec();}import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x757bb4,_0x24003d,_0x1112ff){const _0x5f5337=a129_0x1a9e,_0x41fc65=await scanLocalSqlQueries(_0x757bb4),_0x59ce97=new Map();for(const _0x165daf of _0x41fc65){if(_0x1112ff&&_0x165daf['sqlCode']!==_0x1112ff)continue;const _0x25ced3=_0x59ce97[_0x5f5337(0x125)](_0x165daf[_0x5f5337(0x113)])??[];_0x25ced3['push'](_0x165daf),_0x59ce97['set'](_0x165daf[_0x5f5337(0x113)],_0x25ced3);}if(_0x1112ff&&!_0x59ce97[_0x5f5337(0xf8)](_0x1112ff))throw CliErrors['validation'](_0x5f5337(0xe4)+_0x1112ff);const _0x33f7e5=[];for(const [_0x4d570c,_0x4f2018]of _0x59ce97[_0x5f5337(0xe5)]()){if(_0x4f2018['length']===0x1){_0x33f7e5[_0x5f5337(0xe7)](_0x4f2018[0x0]);continue;}const _0x4bdf67=_0x24003d[_0x5f5337(0x10c)][_0x4d570c],_0x40d3f4=_0x4bdf67?.[_0x5f5337(0xf4)],_0x53a257=_0x40d3f4?_0x4f2018[_0x5f5337(0xea)](_0x8336c8=>_0x8336c8[_0x5f5337(0x114)]!==_0x40d3f4):_0x4f2018;if(_0x4bdf67&&_0x53a257['length']===0x1){_0x33f7e5[_0x5f5337(0xe7)](_0x53a257[0x0]);continue;}throw CliErrors['validation'](_0x5f5337(0xf0)+_0x4d570c+_0x5f5337(0xff));}return _0x33f7e5;}export const sqlPush={'service':'sql','command':a129_0x23cd3e(0xe7),'description':a129_0x23cd3e(0x116),'risk':a129_0x23cd3e(0xf1),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':'boolean','description':a129_0x23cd3e(0xec)}],async 'dryRun'(_0x3f946f){const _0x14493f=a129_0x23cd3e,_0xe7c04e=loadSqlProjectConfig(_0x3f946f[_0x14493f(0x11f)]),_0x3132e2=await readSqlLockFile(_0xe7c04e[_0x14493f(0xfc)]),{appLock:_0x1f602d}=ensureSqlLockScope(_0x3132e2??createEmptySqlLock(),_0x3f946f[_0x14493f(0x11f)],_0xe7c04e[_0x14493f(0x118)],'push'),_0x44e7fb=await getTargetSqlQueries(_0xe7c04e,_0x1f602d,_0x3f946f[_0x14493f(0xe8)](_0x14493f(0x11a))||undefined),_0x3e297b=[];for(const _0x5abfd5 of _0x44e7fb){const _0x32c614=await computeSqlFileHash(_0x5abfd5[_0x14493f(0x102)]),_0x23a413=_0x1f602d[_0x14493f(0x10c)][_0x5abfd5['sqlCode']],_0x113cdf=!!_0x23a413&&(_0x23a413['path']!==_0x5abfd5['relativePath']||!!_0x5abfd5['sqlName']&&_0x23a413[_0x14493f(0xeb)]!==_0x5abfd5['sqlName']);if(!_0x3f946f['bool']('force')&&_0x23a413&&_0x23a413[_0x14493f(0x108)]===_0x32c614&&!_0x113cdf)continue;_0x3e297b['push'](_0x5abfd5[_0x14493f(0x113)]);}return{'method':_0x14493f(0x11d),'url':_0x14493f(0xf7),'body':{'sqlCodes':_0x3e297b,'appCode':_0x3f946f[_0x14493f(0x11f)]},'description':_0x14493f(0xef)+_0x3e297b[_0x14493f(0x111)]+_0x14493f(0xe6)};},async 'execute'(_0x2ba0e2){const _0x41e65c=a129_0x23cd3e,_0x354105=loadSqlProjectConfig(_0x2ba0e2[_0x41e65c(0x11f)]),_0xd55f19=await readSqlLockFile(_0x354105['lockFilePath']),{lockData:_0x5efeb8,appLock:_0x72beeb}=ensureSqlLockScope(_0xd55f19??createEmptySqlLock(),_0x2ba0e2[_0x41e65c(0x11f)],_0x354105[_0x41e65c(0x118)],'push'),_0x4d7397=await getTargetSqlQueries(_0x354105,_0x72beeb,_0x2ba0e2[_0x41e65c(0xe8)]('sqlcode')||undefined);if(_0x4d7397[_0x41e65c(0x111)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x41e65c(0x101)};const _0x45c1dc=[],_0xdabfcb=[],_0x52cd9c=[];for(const _0x695fda of _0x4d7397){const _0x4b2fb1=_0x72beeb[_0x41e65c(0x10c)][_0x695fda[_0x41e65c(0x113)]];if(!_0x4b2fb1){_0x52cd9c[_0x41e65c(0xe7)]({'sqlCode':_0x695fda['sqlCode'],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x4dbbb4=await computeSqlFileHash(_0x695fda['filePath']),_0x25d2d6=_0x4b2fb1['path']!==_0x695fda[_0x41e65c(0x114)]||!!_0x695fda[_0x41e65c(0xeb)]&&_0x4b2fb1[_0x41e65c(0xeb)]!==_0x695fda['sqlName'];if(!_0x2ba0e2[_0x41e65c(0x11c)](_0x41e65c(0x100))&&_0x4b2fb1[_0x41e65c(0x108)]===_0x4dbbb4&&!_0x25d2d6){_0xdabfcb['push']({'sqlCode':_0x695fda[_0x41e65c(0x113)],'reason':_0x41e65c(0x11b)});continue;}if(_0x4b2fb1[_0x41e65c(0x103)]==null){_0x52cd9c[_0x41e65c(0xe7)]({'sqlCode':_0x695fda[_0x41e65c(0x113)],'error':_0x41e65c(0x106)});continue;}const _0x4a4141=await readFile(_0x695fda[_0x41e65c(0x102)],_0x41e65c(0x105)),_0x35a1ed=stripLocalSqlMetadata(_0x4a4141,_0x695fda[_0x41e65c(0xf5)]),_0x8537ed=_0x695fda['sqlName']||_0x4b2fb1[_0x41e65c(0xeb)],_0x5b8d74=await resolveTargetDbBinding(_0x2ba0e2[_0x41e65c(0x11f)],_0x695fda,_0x4b2fb1),_0x5d8e7f=await updateSqlQuery({'id':_0x4b2fb1[_0x41e65c(0x10b)],'appCode':_0x2ba0e2['appCode'],'sqlCode':_0x695fda[_0x41e65c(0x113)],'sqlName':_0x8537ed,'dbId':_0x5b8d74[_0x41e65c(0x121)],'version':_0x4b2fb1[_0x41e65c(0x103)],'sqlContent':_0x35a1ed,'sqlConfig':_0x4b2fb1['sqlConfig']??undefined}),_0x1879f3=_0x5d8e7f[_0x41e65c(0x121)]?await getDbName(_0x2ba0e2[_0x41e65c(0x11f)],Number(_0x5d8e7f[_0x41e65c(0x121)]))[_0x41e65c(0x123)](()=>_0x5b8d74[_0x41e65c(0x110)]):_0x5b8d74[_0x41e65c(0x110)];_0x72beeb['sqls'][_0x695fda[_0x41e65c(0x113)]]={...buildSqlLockEntry(_0x5d8e7f,_0x35a1ed,_0x4dbbb4,{'dbName':_0x1879f3}),'path':_0x695fda[_0x41e65c(0x114)],'mode':_0x4b2fb1[_0x41e65c(0xf5)]},await archivePreviousSqlFileIfNeeded(_0x354105,_0x4b2fb1[_0x41e65c(0xf4)],_0x695fda[_0x41e65c(0x114)]),_0x45c1dc[_0x41e65c(0xe7)]({'sqlCode':_0x695fda['sqlCode'],'remoteId':_0x4b2fb1[_0x41e65c(0x10b)]});}catch(_0x283cca){_0x52cd9c[_0x41e65c(0xe7)]({'sqlCode':_0x695fda[_0x41e65c(0x113)],'error':_0x283cca instanceof Error?_0x283cca[_0x41e65c(0x122)]:String(_0x283cca)});}}return _0x72beeb[_0x41e65c(0xfd)]=new Date()[_0x41e65c(0xe2)](),await writeSqlLockFile(_0x354105['lockFilePath'],_0x5efeb8),{'ok':_0x52cd9c[_0x41e65c(0x111)]===0x0,'data':{'pushed':_0x45c1dc,'skipped':_0xdabfcb,'failed':_0x52cd9c},'message':_0x41e65c(0x104)+_0x45c1dc[_0x41e65c(0x111)]+_0x41e65c(0xf3)+_0xdabfcb[_0x41e65c(0x111)]+_0x41e65c(0x124)+_0x52cd9c['length']+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x364bb9,_0x121198,_0x534dbe){const _0x2ef8c1=a129_0x23cd3e;if(!_0x121198||_0x121198===_0x534dbe)return;const _0x2f84d8=join(_0x364bb9['sqlRootDir'],_0x121198);if(!await fileExists(_0x2f84d8))return;const _0x4d5d99=await moveToTrash(_0x364bb9['projectRoot'],_0x364bb9[_0x2ef8c1(0x109)],_0x2f84d8);await cleanupEmptyDirectories(dirname(_0x2f84d8),_0x364bb9[_0x2ef8c1(0x10a)]),void _0x4d5d99;}async function moveToTrash(_0x4d0fd1,_0x3739c1,_0x1b8dff){const _0x58aaaf=a129_0x23cd3e,_0x3e736a=new Date()['toISOString']()[_0x58aaaf(0xf2)](/[:.]/g,'-'),_0x49edd1=relative(_0x4d0fd1,_0x1b8dff),_0x436ca9=join(_0x3739c1,_0x3e736a,_0x49edd1);return await mkdir(dirname(_0x436ca9),{'recursive':!![]}),await rename(_0x1b8dff,_0x436ca9),_0x436ca9;}async function cleanupEmptyDirectories(_0x52876a,_0x56aa7d){const _0x63a750=a129_0x23cd3e;let _0x376f90=resolve(_0x52876a);const _0x22bddd=resolve(_0x56aa7d);while(_0x376f90[_0x63a750(0x11e)](''+_0x22bddd+sep)||_0x376f90===_0x22bddd){if(_0x376f90===_0x22bddd)return;try{const _0x2c9c6e=await readdir(_0x376f90);if(_0x2c9c6e[_0x63a750(0x111)]>0x0)return;await rmdir(_0x376f90);}catch{return;}_0x376f90=dirname(_0x376f90);}}function a129_0x1a9e(_0x2de54a,_0x254edb){_0x2de54a=_0x2de54a-0xe2;const _0x4cec73=a129_0x4cec();let _0x1a9e6b=_0x4cec73[_0x2de54a];return _0x1a9e6b;}async function resolveTargetDbBinding(_0x5bc1d5,_0x58d1f9,_0x230cdd){const _0x2a96da=a129_0x23cd3e,_0x3c8d00=_0x58d1f9['dbDirectory'];if(!_0x3c8d00)return{'dbId':_0x230cdd[_0x2a96da(0x121)],'dbName':_0x230cdd[_0x2a96da(0x110)]};const _0x246736=buildDbDirectoryName(_0x230cdd[_0x2a96da(0x110)],_0x230cdd['dbId']);if(_0x3c8d00===_0x246736)return{'dbId':_0x230cdd['dbId'],'dbName':_0x230cdd[_0x2a96da(0x110)]};const _0x290d48=parseExplicitDbDirectory(_0x3c8d00);if(_0x290d48!=null)return{'dbId':_0x290d48,'dbName':await getDbName(_0x5bc1d5,_0x290d48)[_0x2a96da(0x123)](()=>undefined)};const _0x15e2ec=await listDatabases(_0x5bc1d5),_0x3ceb7b=_0x15e2ec[_0x2a96da(0xea)](_0x3842ea=>buildDbDirectoryName(_0x3842ea[_0x2a96da(0x110)],_0x3842ea[_0x2a96da(0x121)])===_0x3c8d00);if(_0x3ceb7b[_0x2a96da(0x111)]===0x1)return{'dbId':_0x3ceb7b[0x0]['dbId'],'dbName':_0x3ceb7b[0x0][_0x2a96da(0x110)]};if(_0x3ceb7b[_0x2a96da(0x111)]===0x0)throw CliErrors[_0x2a96da(0xf6)](_0x2a96da(0x119)+_0x3c8d00+'\x22\x20for\x20sqlCode\x20'+_0x58d1f9[_0x2a96da(0x113)]+'.');const _0x24ceb1=_0x3ceb7b[_0x2a96da(0x117)](_0x42a856=>_0x42a856[_0x2a96da(0x110)]+'\x20('+_0x42a856['dbId']+')')[_0x2a96da(0x120)](',\x20');throw CliErrors['validation'](_0x2a96da(0x10d)+_0x3c8d00+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x58d1f9[_0x2a96da(0x113)]+':\x20'+_0x24ceb1);}function parseExplicitDbDirectory(_0x54a731){const _0x456eab=a129_0x23cd3e,_0x21429e=/^db-(\d+)$/[_0x456eab(0xf9)](_0x54a731);if(!_0x21429e)return null;const _0x7c954a=Number(_0x21429e[0x1]);return Number[_0x456eab(0xfe)](_0x7c954a)&&_0x7c954a>0x0?_0x7c954a:null;}
|
|
1
|
+
const a129_0x50ca10=a129_0x739b;(function(_0x2fa844,_0x57650b){const _0x47126c=a129_0x739b,_0xc520=_0x2fa844();while(!![]){try{const _0x174aa6=parseInt(_0x47126c(0x17c))/0x1+parseInt(_0x47126c(0x1b0))/0x2+parseInt(_0x47126c(0x175))/0x3*(parseInt(_0x47126c(0x19f))/0x4)+-parseInt(_0x47126c(0x1a0))/0x5*(-parseInt(_0x47126c(0x173))/0x6)+-parseInt(_0x47126c(0x1a8))/0x7*(parseInt(_0x47126c(0x18e))/0x8)+parseInt(_0x47126c(0x19c))/0x9+-parseInt(_0x47126c(0x177))/0xa;if(_0x174aa6===_0x57650b)break;else _0xc520['push'](_0xc520['shift']());}catch(_0x3e948a){_0xc520['push'](_0xc520['shift']());}}}(a129_0x61cb,0xecdde));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';function a129_0x739b(_0x22879d,_0x40766a){_0x22879d=_0x22879d-0x172;const _0x61cb08=a129_0x61cb();let _0x739b99=_0x61cb08[_0x22879d];return _0x739b99;}function a129_0x61cb(){const _0x4d154=['lockFilePath','message','1385587LFZfay','unchanged','sqlRoot','\x20pushed,\x20','str','relativePath','filter','lastSync','/smartapi/custom/updateUserCustomSql','toISOString','Would\x20push\x20','sqls','mode','dbName','entries','dbDirectory','remoteId','path','8fEZMLg','sql','No\x20database\x20matches\x20local\x20directory\x20\x22','\x20SQL\x20file(s)','validation','bool','map','appCode','sqlName','sqlRootDir','sqlCode','boolean','utf8','Local\x20directory\x20\x22','15710634BfCbIb','catch','dbId','4VIQvvr','5780260uXDzFm','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','push','get','version','replace','startsWith','exec','3974621ctQPRC','Push\x20complete:\x20','\x20skipped,\x20','hash','sqlConfig','sqlcode','high-risk-write','filePath','1605574Hgpmdd','join','6ZBYOVV','force','1084911xgXPFt','No\x20local\x20SQL\x20files\x20found.','39136800uHPvQV','length','isFinite'];a129_0x61cb=function(){return _0x4d154;};return a129_0x61cb();}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(_0x228f14,_0x3cb418,_0xb58f10){const _0x641146=a129_0x739b,_0x102a81=await scanLocalSqlQueries(_0x228f14),_0x3d1a7b=new Map();for(const _0xb48cdb of _0x102a81){if(_0xb58f10&&_0xb48cdb['sqlCode']!==_0xb58f10)continue;const _0x560632=_0x3d1a7b[_0x641146(0x1a3)](_0xb48cdb[_0x641146(0x198)])??[];_0x560632['push'](_0xb48cdb),_0x3d1a7b['set'](_0xb48cdb['sqlCode'],_0x560632);}if(_0xb58f10&&!_0x3d1a7b['has'](_0xb58f10))throw CliErrors['validation']('Local\x20SQL\x20not\x20found:\x20'+_0xb58f10);const _0x528a22=[];for(const [_0x510bff,_0x436191]of _0x3d1a7b[_0x641146(0x18a)]()){if(_0x436191[_0x641146(0x178)]===0x1){_0x528a22[_0x641146(0x1a2)](_0x436191[0x0]);continue;}const _0x4d9020=_0x3cb418['sqls'][_0x510bff],_0x13dbbd=_0x4d9020?.[_0x641146(0x18d)],_0x32859e=_0x13dbbd?_0x436191[_0x641146(0x182)](_0x37ee77=>_0x37ee77[_0x641146(0x181)]!==_0x13dbbd):_0x436191;if(_0x4d9020&&_0x32859e[_0x641146(0x178)]===0x1){_0x528a22[_0x641146(0x1a2)](_0x32859e[0x0]);continue;}throw CliErrors['validation']('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x510bff+_0x641146(0x1a1));}return _0x528a22;}export const sqlPush={'service':a129_0x50ca10(0x18f),'command':a129_0x50ca10(0x1a2),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a129_0x50ca10(0x1ae),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a129_0x50ca10(0x174),'type':a129_0x50ca10(0x199),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0xe59cca){const _0x19168a=a129_0x50ca10,_0x1f017f=loadSqlProjectConfig(_0xe59cca[_0x19168a(0x195)]),_0x15d76a=await readSqlLockFile(_0x1f017f[_0x19168a(0x17a)]),{appLock:_0x3b1b20}=ensureSqlLockScope(_0x15d76a??createEmptySqlLock(),_0xe59cca[_0x19168a(0x195)],_0x1f017f['sqlRoot'],_0x19168a(0x1a2)),_0x184c72=await getTargetSqlQueries(_0x1f017f,_0x3b1b20,_0xe59cca[_0x19168a(0x180)](_0x19168a(0x1ad))||undefined),_0x5617fc=[];for(const _0x30e791 of _0x184c72){const _0x536ae5=await computeSqlFileHash(_0x30e791[_0x19168a(0x1af)]),_0x20194c=_0x3b1b20[_0x19168a(0x187)][_0x30e791[_0x19168a(0x198)]],_0x14bc47=!!_0x20194c&&(_0x20194c[_0x19168a(0x18d)]!==_0x30e791[_0x19168a(0x181)]||!!_0x30e791[_0x19168a(0x196)]&&_0x20194c[_0x19168a(0x196)]!==_0x30e791[_0x19168a(0x196)]);if(!_0xe59cca[_0x19168a(0x193)](_0x19168a(0x174))&&_0x20194c&&_0x20194c['hash']===_0x536ae5&&!_0x14bc47)continue;_0x5617fc[_0x19168a(0x1a2)](_0x30e791[_0x19168a(0x198)]);}return{'method':'POST','url':_0x19168a(0x184),'body':{'sqlCodes':_0x5617fc,'appCode':_0xe59cca[_0x19168a(0x195)]},'description':_0x19168a(0x186)+_0x5617fc[_0x19168a(0x178)]+_0x19168a(0x191)};},async 'execute'(_0x58a5ed){const _0xae1e18=a129_0x50ca10,_0x5b05a9=loadSqlProjectConfig(_0x58a5ed[_0xae1e18(0x195)]),_0x29b81a=await readSqlLockFile(_0x5b05a9['lockFilePath']),{lockData:_0x2ea936,appLock:_0x567961}=ensureSqlLockScope(_0x29b81a??createEmptySqlLock(),_0x58a5ed[_0xae1e18(0x195)],_0x5b05a9[_0xae1e18(0x17e)],'push'),_0x39c519=await getTargetSqlQueries(_0x5b05a9,_0x567961,_0x58a5ed[_0xae1e18(0x180)]('sqlcode')||undefined);if(_0x39c519[_0xae1e18(0x178)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xae1e18(0x176)};const _0x16a320=[],_0x5d5a57=[],_0x2fa317=[];for(const _0x4e50c8 of _0x39c519){const _0x142091=_0x567961[_0xae1e18(0x187)][_0x4e50c8[_0xae1e18(0x198)]];if(!_0x142091){_0x2fa317['push']({'sqlCode':_0x4e50c8['sqlCode'],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x26548f=await computeSqlFileHash(_0x4e50c8[_0xae1e18(0x1af)]),_0x125e9e=_0x142091['path']!==_0x4e50c8[_0xae1e18(0x181)]||!!_0x4e50c8[_0xae1e18(0x196)]&&_0x142091[_0xae1e18(0x196)]!==_0x4e50c8['sqlName'];if(!_0x58a5ed['bool']('force')&&_0x142091[_0xae1e18(0x1ab)]===_0x26548f&&!_0x125e9e){_0x5d5a57[_0xae1e18(0x1a2)]({'sqlCode':_0x4e50c8[_0xae1e18(0x198)],'reason':_0xae1e18(0x17d)});continue;}if(_0x142091[_0xae1e18(0x1a4)]==null){_0x2fa317['push']({'sqlCode':_0x4e50c8['sqlCode'],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x2c4d76=await readFile(_0x4e50c8['filePath'],_0xae1e18(0x19a)),_0x19099c=stripLocalSqlMetadata(_0x2c4d76,_0x4e50c8[_0xae1e18(0x188)]),_0x26621f=_0x4e50c8['sqlName']||_0x142091[_0xae1e18(0x196)],_0x4eb764=await resolveTargetDbBinding(_0x58a5ed[_0xae1e18(0x195)],_0x4e50c8,_0x142091),_0x1f29fb=await updateSqlQuery({'id':_0x142091['remoteId'],'appCode':_0x58a5ed[_0xae1e18(0x195)],'sqlCode':_0x4e50c8['sqlCode'],'sqlName':_0x26621f,'dbId':_0x4eb764[_0xae1e18(0x19e)],'version':_0x142091[_0xae1e18(0x1a4)],'sqlContent':_0x19099c,'sqlConfig':_0x142091[_0xae1e18(0x1ac)]??undefined}),_0x4b499b=_0x1f29fb['dbId']?await getDbName(_0x58a5ed['appCode'],Number(_0x1f29fb['dbId']))[_0xae1e18(0x19d)](()=>_0x4eb764[_0xae1e18(0x189)]):_0x4eb764[_0xae1e18(0x189)];_0x567961[_0xae1e18(0x187)][_0x4e50c8['sqlCode']]={...buildSqlLockEntry(_0x1f29fb,_0x19099c,_0x26548f,{'dbName':_0x4b499b}),'path':_0x4e50c8[_0xae1e18(0x181)],'mode':_0x142091[_0xae1e18(0x188)]},await archivePreviousSqlFileIfNeeded(_0x5b05a9,_0x142091[_0xae1e18(0x18d)],_0x4e50c8[_0xae1e18(0x181)]),_0x16a320[_0xae1e18(0x1a2)]({'sqlCode':_0x4e50c8[_0xae1e18(0x198)],'remoteId':_0x142091[_0xae1e18(0x18c)]});}catch(_0x3b0289){_0x2fa317[_0xae1e18(0x1a2)]({'sqlCode':_0x4e50c8['sqlCode'],'error':_0x3b0289 instanceof Error?_0x3b0289[_0xae1e18(0x17b)]:String(_0x3b0289)});}}return _0x567961[_0xae1e18(0x183)]=new Date()[_0xae1e18(0x185)](),await writeSqlLockFile(_0x5b05a9[_0xae1e18(0x17a)],_0x2ea936),{'ok':_0x2fa317['length']===0x0,'data':{'pushed':_0x16a320,'skipped':_0x5d5a57,'failed':_0x2fa317},'message':_0xae1e18(0x1a9)+_0x16a320['length']+_0xae1e18(0x17f)+_0x5d5a57[_0xae1e18(0x178)]+_0xae1e18(0x1aa)+_0x2fa317[_0xae1e18(0x178)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x43dfac,_0x2cb08c,_0x375bbf){const _0x4b3c08=a129_0x50ca10;if(!_0x2cb08c||_0x2cb08c===_0x375bbf)return;const _0x244d52=join(_0x43dfac[_0x4b3c08(0x197)],_0x2cb08c);if(!await fileExists(_0x244d52))return;const _0x39a69b=await moveToTrash(_0x43dfac['projectRoot'],_0x43dfac['trashDir'],_0x244d52);await cleanupEmptyDirectories(dirname(_0x244d52),_0x43dfac[_0x4b3c08(0x197)]),void _0x39a69b;}async function moveToTrash(_0x56a014,_0x2e54c5,_0x469000){const _0x461fd9=a129_0x50ca10,_0x4f5bfd=new Date()[_0x461fd9(0x185)]()[_0x461fd9(0x1a5)](/[:.]/g,'-'),_0x1c375a=relative(_0x56a014,_0x469000),_0x413a3a=join(_0x2e54c5,_0x4f5bfd,_0x1c375a);return await mkdir(dirname(_0x413a3a),{'recursive':!![]}),await rename(_0x469000,_0x413a3a),_0x413a3a;}async function cleanupEmptyDirectories(_0x448869,_0x3b06a7){const _0x161eed=a129_0x50ca10;let _0x56ea17=resolve(_0x448869);const _0x15df75=resolve(_0x3b06a7);while(_0x56ea17[_0x161eed(0x1a6)](''+_0x15df75+sep)||_0x56ea17===_0x15df75){if(_0x56ea17===_0x15df75)return;try{const _0x1dbfdc=await readdir(_0x56ea17);if(_0x1dbfdc[_0x161eed(0x178)]>0x0)return;await rmdir(_0x56ea17);}catch{return;}_0x56ea17=dirname(_0x56ea17);}}async function resolveTargetDbBinding(_0x1df6b3,_0x333bbf,_0x1dbd40){const _0x3e0282=a129_0x50ca10,_0x36212b=_0x333bbf[_0x3e0282(0x18b)];if(!_0x36212b)return{'dbId':_0x1dbd40[_0x3e0282(0x19e)],'dbName':_0x1dbd40[_0x3e0282(0x189)]};const _0x4eb064=buildDbDirectoryName(_0x1dbd40[_0x3e0282(0x189)],_0x1dbd40[_0x3e0282(0x19e)]);if(_0x36212b===_0x4eb064)return{'dbId':_0x1dbd40[_0x3e0282(0x19e)],'dbName':_0x1dbd40[_0x3e0282(0x189)]};const _0x4fcff7=parseExplicitDbDirectory(_0x36212b);if(_0x4fcff7!=null)return{'dbId':_0x4fcff7,'dbName':await getDbName(_0x1df6b3,_0x4fcff7)[_0x3e0282(0x19d)](()=>undefined)};const _0x4076b1=await listDatabases(_0x1df6b3),_0x53bf79=_0x4076b1[_0x3e0282(0x182)](_0x471502=>buildDbDirectoryName(_0x471502[_0x3e0282(0x189)],_0x471502[_0x3e0282(0x19e)])===_0x36212b);if(_0x53bf79[_0x3e0282(0x178)]===0x1)return{'dbId':_0x53bf79[0x0][_0x3e0282(0x19e)],'dbName':_0x53bf79[0x0]['dbName']};if(_0x53bf79[_0x3e0282(0x178)]===0x0)throw CliErrors[_0x3e0282(0x192)](_0x3e0282(0x190)+_0x36212b+'\x22\x20for\x20sqlCode\x20'+_0x333bbf[_0x3e0282(0x198)]+'.');const _0x42afd0=_0x53bf79[_0x3e0282(0x194)](_0xc51128=>_0xc51128[_0x3e0282(0x189)]+'\x20('+_0xc51128['dbId']+')')[_0x3e0282(0x172)](',\x20');throw CliErrors[_0x3e0282(0x192)](_0x3e0282(0x19b)+_0x36212b+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x333bbf['sqlCode']+':\x20'+_0x42afd0);}function parseExplicitDbDirectory(_0x43008b){const _0xce364e=a129_0x50ca10,_0x47544b=/^db-(\d+)$/[_0xce364e(0x1a7)](_0x43008b);if(!_0x47544b)return null;const _0x97af0e=Number(_0x47544b[0x1]);return Number[_0xce364e(0x179)](_0x97af0e)&&_0x97af0e>0x0?_0x97af0e:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a130_0x16c4(_0x4b2bf9,_0x33871e){_0x4b2bf9=_0x4b2bf9-0x16d;const _0x469b50=a130_0x469b();let _0x16c45d=_0x469b50[_0x4b2bf9];return _0x16c45d;}const a130_0xcbfa48=a130_0x16c4;(function(_0x4d7a8c,_0x199503){const _0x48ab78=a130_0x16c4,_0x573281=_0x4d7a8c();while(!![]){try{const _0x1ae018=-parseInt(_0x48ab78(0x16f))/0x1*(parseInt(_0x48ab78(0x17c))/0x2)+-parseInt(_0x48ab78(0x17a))/0x3+-parseInt(_0x48ab78(0x176))/0x4+-parseInt(_0x48ab78(0x180))/0x5*(parseInt(_0x48ab78(0x173))/0x6)+parseInt(_0x48ab78(0x174))/0x7*(-parseInt(_0x48ab78(0x172))/0x8)+parseInt(_0x48ab78(0x17f))/0x9+parseInt(_0x48ab78(0x179))/0xa;if(_0x1ae018===_0x199503)break;else _0x573281['push'](_0x573281['shift']());}catch(_0x1d417b){_0x573281['push'](_0x573281['shift']());}}}(a130_0x469b,0x4320b));import{CliErrors}from'../../errors.js';function a130_0x469b(){const _0x895e88=['file','11045740ACANLc','853827tCCQOr','validation','692Lgoerm','write','SQL\x20query\x20display\x20name','2614707cbJPMh','1945mFeBhx','save','join','248VqHbdD','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','sqlname','1254032SLwxQA','7764HMhYzd','7eAnIaV','string','358420bSeHCb','description'];a130_0x469b=function(){return _0x895e88;};return a130_0x469b();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=['`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','Update\x20existing\x20SQL\x20by\x20editing\x20the\x20synced\x20file\x20under\x20`.rabetbase/sql/<appCode>/<dbName|db-<id>>/`\x20and\x20then\x20running\x20`rabetbase\x20sql\x20push\x20--sqlcode\x20<code>\x20--yes`.'][a130_0xcbfa48(0x16e)]('\x0a');export const sqlSave={'service':'sql','command':a130_0xcbfa48(0x16d),'description':a130_0xcbfa48(0x170),'risk':a130_0xcbfa48(0x17d),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a130_0xcbfa48(0x178),'type':a130_0xcbfa48(0x175),'required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':a130_0xcbfa48(0x171),'type':a130_0xcbfa48(0x175),'description':a130_0xcbfa48(0x17e)},{'name':'db','type':a130_0xcbfa48(0x175),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':a130_0xcbfa48(0x177),'type':a130_0xcbfa48(0x175),'description':'Query\x20description'}],async 'validate'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x52606d=a130_0xcbfa48;throw CliErrors[_0x52606d(0x17b)](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x283a25,_0x3c6e3d){const _0x51fd9b=a131_0x3596,_0x53abd8=_0x283a25();while(!![]){try{const _0x13e042=-parseInt(_0x51fd9b(0x140))/0x1+parseInt(_0x51fd9b(0x131))/0x2*(-parseInt(_0x51fd9b(0x130))/0x3)+-parseInt(_0x51fd9b(0x13f))/0x4*(parseInt(_0x51fd9b(0x142))/0x5)+parseInt(_0x51fd9b(0x12a))/0x6+-parseInt(_0x51fd9b(0x121))/0x7*(-parseInt(_0x51fd9b(0x129))/0x8)+-parseInt(_0x51fd9b(0x13c))/0x9*(-parseInt(_0x51fd9b(0x11c))/0xa)+-parseInt(_0x51fd9b(0x11b))/0xb*(-parseInt(_0x51fd9b(0x12b))/0xc);if(_0x13e042===_0x3c6e3d)break;else _0x53abd8['push'](_0x53abd8['shift']());}catch(_0x8fa29a){_0x53abd8['push'](_0x53abd8['shift']());}}}(a131_0xa6fe,0x20efc));import{createInterface}from'node:readline';function a131_0x3596(_0x1fd5cf,_0x53125c){_0x1fd5cf=_0x1fd5cf-0x114;const _0xa6fe92=a131_0xa6fe();let _0x3596a2=_0xa6fe92[_0x1fd5cf];return _0x3596a2;}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(_0x19ad3e,_0x39f642,_0x287379,_0x8ecf4b){const _0x59e3ce=a131_0x3596,_0x5a7bce=detectSqlMode(_0x39f642);return{'path':buildSqlRelativePath(_0x19ad3e[_0x59e3ce(0x141)],_0x19ad3e[_0x59e3ce(0x12c)],_0x8ecf4b?.['dbName'],_0x5a7bce,_0x19ad3e[_0x59e3ce(0x124)]),'hash':_0x287379,'remoteId':_0x19ad3e['id'],'version':_0x19ad3e[_0x59e3ce(0x123)],'dbId':Number(_0x19ad3e[_0x59e3ce(0x124)]),'dbName':_0x8ecf4b?.[_0x59e3ce(0x137)],'sqlName':_0x19ad3e['sqlName'],'sqlConfig':_0x19ad3e[_0x59e3ce(0x11a)]??undefined,'mode':_0x5a7bce};}export function cloneSqlLockData(_0x192cca){const _0x4fbeaa=a131_0x3596;return{'apps':Object[_0x4fbeaa(0x120)](Object[_0x4fbeaa(0x11e)](_0x192cca[_0x4fbeaa(0x11d)])['map'](([_0x62aefe,_0x4cb770])=>[_0x62aefe,{'sqlRoot':_0x4cb770[_0x4fbeaa(0x12e)],'lastSync':_0x4cb770[_0x4fbeaa(0x127)],'sqls':{..._0x4cb770[_0x4fbeaa(0x128)]}}]))};}export function ensureRemoteSqlContent(_0x407d74){const _0x1819d2=a131_0x3596;return _0x407d74[_0x1819d2(0x119)]??'';}export function buildLocalSqlFileContent(_0x5d39ec,_0x586949,_0x1bc60a){const _0x42caab=a131_0x3596,_0x271940=_0x1bc60a?.[_0x42caab(0x126)]??detectSqlMode(_0x586949),_0x368e0d=stripLocalSqlMetadata(_0x586949,_0x271940)[_0x42caab(0x114)](),_0x10b193=[...buildMetadataHeaderLines({'sqlCode':_0x5d39ec['sqlCode'],'sqlName':_0x5d39ec[_0x42caab(0x12c)],'dbId':_0x5d39ec[_0x42caab(0x124)],'dbName':_0x1bc60a?.[_0x42caab(0x137)],'mode':_0x271940,'syncedAt':_0x1bc60a?.[_0x42caab(0x133)],'description':_0x1bc60a?.['description']},_0x271940),'',_0x368e0d],_0x880d3c=_0x10b193[_0x42caab(0x138)]('\x0a');return _0x880d3c['endsWith']('\x0a')?_0x880d3c:_0x880d3c+'\x0a';}export function stripLocalSqlMetadata(_0x373a9a,_0x28833a){const _0x1b744b=a131_0x3596,_0x1781da=_0x373a9a[_0x1b744b(0x135)](/\r\n/g,'\x0a')[_0x1b744b(0x12d)]('\x0a'),_0x25fe49=[];let _0x1797b0=0x0;if(_0x28833a===_0x1b744b(0x13a))while(_0x1797b0<_0x1781da[_0x1b744b(0x13e)]){const _0x54a2b6=_0x1781da[_0x1797b0]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x54a2b6)){_0x1797b0++;continue;}if(_0x54a2b6[_0x1b744b(0x114)]()===''&&_0x1797b0>0x0){_0x1797b0++;continue;}break;}else while(_0x1797b0<_0x1781da[_0x1b744b(0x13e)]){const _0x322975=_0x1781da[_0x1797b0]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x322975)){_0x1797b0++;continue;}if(_0x322975[_0x1b744b(0x114)]()===''&&_0x1797b0>0x0){_0x1797b0++;continue;}break;}for(;_0x1797b0<_0x1781da[_0x1b744b(0x13e)];_0x1797b0++){_0x25fe49[_0x1b744b(0x139)](_0x1781da[_0x1797b0]);}return _0x25fe49[_0x1b744b(0x138)]('\x0a')['trimStart']();}export function resolveSqlMode(_0x4cc7f3,_0x1c2dc6){const _0x37638b=a131_0x3596;if(_0x1c2dc6?.[_0x37638b(0x126)])return _0x1c2dc6[_0x37638b(0x126)];return detectSqlMode(_0x4cc7f3);}export function resolveSqlFileName(_0xb87106,_0x25f862,_0x51517f){const _0x4e84ed=a131_0x3596;if(_0x51517f?.[_0x4e84ed(0x116)])return _0x51517f['path'];if(_0x51517f?.[_0x4e84ed(0x12c)]||_0x51517f?.['dbName'])return buildSqlRelativePath(_0xb87106,_0x51517f?.[_0x4e84ed(0x12c)],_0x51517f?.[_0x4e84ed(0x137)],resolveSqlMode(_0x25f862,_0x51517f),_0x51517f?.[_0x4e84ed(0x124)]);return buildDefaultSqlFileName(_0xb87106,resolveSqlMode(_0x25f862,_0x51517f));}export function resolveSqlLocalDir(_0x27eebd,_0x4f7a6e){return join(_0x27eebd,SQL_LOCAL_REL_DIR,_0x4f7a6e);}export async function confirmForceOverwrite(_0x418f76){const _0x293055=a131_0x3596,_0x12fe98=createInterface({'input':process[_0x293055(0x117)],'output':process['stderr']}),_0x3a51ef=await new Promise(_0x47ac90=>{const _0x178bba=_0x293055;_0x12fe98[_0x178bba(0x11f)](_0x418f76+_0x178bba(0x136),_0x47ac90);});return _0x12fe98[_0x293055(0x134)](),['y',_0x293055(0x118)][_0x293055(0x13b)](_0x3a51ef[_0x293055(0x114)]()[_0x293055(0x12f)]());}export function findSqlLockScope(_0x3fdc60,_0x526c8a){return _0x3fdc60['apps'][_0x526c8a];}function a131_0xa6fe(){const _0x68479c=['1142160LoeKjE','apps','entries','question','fromEntries','49btHLgg','<!--\x20@lovrabet.','version','dbId','filter','mode','lastSync','sqls','25768TTysOY','543012zqFqUx','1240404QIsdMJ','sqlName','split','sqlRoot','toLowerCase','261Ktzewm','4022WRsuvo','\x20-->','syncedAt','close','replace','\x20[y/N]\x20','dbName','join','push','mybatisXml','includes','18tktxCZ','map','length','296aCIvXP','163314rrhuMe','sqlCode','5070qPwsLj','trim','description','path','stdin','yes','sqlContent','sqlConfig','22vczbkp'];a131_0xa6fe=function(){return _0x68479c;};return a131_0xa6fe();}function buildMetadataHeaderLines(_0x50a74b,_0x5492dc){const _0xbbffb5=a131_0x3596,_0x4e2259=[[_0xbbffb5(0x141),_0x50a74b[_0xbbffb5(0x141)]],[_0xbbffb5(0x12c),_0x50a74b[_0xbbffb5(0x12c)]],['dbId',_0x50a74b[_0xbbffb5(0x124)]],[_0xbbffb5(0x137),_0x50a74b[_0xbbffb5(0x137)]],[_0xbbffb5(0x126),_0x50a74b['mode']],[_0xbbffb5(0x133),_0x50a74b[_0xbbffb5(0x133)]],[_0xbbffb5(0x115),_0x50a74b['description']]];if(_0x5492dc==='mybatisXml')return _0x4e2259['filter'](([,_0x216a02])=>_0x216a02!==undefined&&_0x216a02!==null&&String(_0x216a02)[_0xbbffb5(0x114)]()!=='')[_0xbbffb5(0x13d)](([_0x52cb09,_0x38b4d7])=>_0xbbffb5(0x122)+_0x52cb09+':\x20'+String(_0x38b4d7)+_0xbbffb5(0x132));return _0x4e2259[_0xbbffb5(0x125)](([,_0x186f75])=>_0x186f75!==undefined&&_0x186f75!==null&&String(_0x186f75)[_0xbbffb5(0x114)]()!=='')[_0xbbffb5(0x13d)](([_0x31bfff,_0x200a7b])=>'--\x20@lovrabet.'+_0x31bfff+':\x20'+String(_0x200a7b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a132_0x4c6e(_0x593ece,_0x389159){_0x593ece=_0x593ece-0x134;const _0x495b96=a132_0x495b();let _0x4c6e57=_0x495b96[_0x593ece];return _0x4c6e57;}const a132_0x3f25ed=a132_0x4c6e;(function(_0x565af5,_0x5045e7){const _0x34120f=a132_0x4c6e,_0x2ad231=_0x565af5();while(!![]){try{const _0x8fd637=parseInt(_0x34120f(0x143))/0x1+-parseInt(_0x34120f(0x151))/0x2+-parseInt(_0x34120f(0x146))/0x3+parseInt(_0x34120f(0x153))/0x4+-parseInt(_0x34120f(0x139))/0x5*(parseInt(_0x34120f(0x134))/0x6)+-parseInt(_0x34120f(0x14c))/0x7*(-parseInt(_0x34120f(0x149))/0x8)+parseInt(_0x34120f(0x14f))/0x9*(parseInt(_0x34120f(0x141))/0xa);if(_0x8fd637===_0x5045e7)break;else _0x2ad231['push'](_0x2ad231['shift']());}catch(_0x4c42c9){_0x2ad231['push'](_0x2ad231['shift']());}}}(a132_0x495b,0x2cb2d));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a132_0x495b(){const _0x520e4d=['sqls','1886844GjuSAf','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','boolean','appCode','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','5CYjYwX','hash','bool','sqlName','length','lockKey','All\x20SQL\x20queries\x20are\x20in\x20sync.','relativePath','1973830IjYsJr','sqlRoot','236337HKhkhT','sqlCode','path','974433KELijd','push','read','732016kcxPQq','status','paging','28dyDPQC','tableData','map','9nSghrK','totalCount','479714ubwJxk','sql','1049996SwWlTA'];a132_0x495b=function(){return _0x520e4d;};return a132_0x495b();}async function fetchAllSqlCodes(_0x2d2993){const _0x2fe846=a132_0x4c6e,_0x36b5fb=[];let _0x4b3d73=0x1;while(!![]){const _0x3ca05b=await listSqlQueries(_0x2d2993,{'currentPage':_0x4b3d73,'pageSize':PAGE_SIZE}),_0x10a876=_0x3ca05b[_0x2fe846(0x14d)]??[];_0x36b5fb[_0x2fe846(0x147)](..._0x10a876['map'](_0x3a63bb=>_0x3a63bb[_0x2fe846(0x144)]));if(_0x10a876[_0x2fe846(0x13d)]===0x0)break;const _0x5b3584=_0x3ca05b[_0x2fe846(0x14b)]?.[_0x2fe846(0x150)];if(_0x5b3584!=null?_0x36b5fb['length']>=_0x5b3584:_0x10a876[_0x2fe846(0x13d)]<PAGE_SIZE)break;_0x4b3d73++;}return _0x36b5fb;}export const sqlStatus={'service':a132_0x3f25ed(0x152),'command':a132_0x3f25ed(0x14a),'description':a132_0x3f25ed(0x138),'risk':a132_0x3f25ed(0x148),'flags':[{'name':'remote','type':a132_0x3f25ed(0x136),'description':a132_0x3f25ed(0x135)}],async 'execute'(_0x30d7d1){const _0x1056f6=a132_0x3f25ed,_0x349a92=loadSqlProjectConfig(_0x30d7d1[_0x1056f6(0x137)]),_0x185f25=await readSqlLockFile(_0x349a92['lockFilePath']),{appLock:_0x5ed1b9}=ensureSqlLockScope(_0x185f25??createEmptySqlLock(),_0x349a92[_0x1056f6(0x137)],_0x349a92[_0x1056f6(0x142)],'status'),_0x249002=await scanLocalSqlQueries(_0x349a92),_0x1f60d2=[],_0x31f096=[],_0x38cfd2=[],_0x6c6acd=[],_0x366226=new Set(_0x249002[_0x1056f6(0x14e)](_0x361b53=>_0x361b53[_0x1056f6(0x13e)]));for(const _0x1dbe71 of _0x249002){const _0x513c4e=await computeSqlFileHash(_0x1dbe71['filePath']),_0x3fe3a1=_0x5ed1b9[_0x1056f6(0x154)][_0x1dbe71['lockKey']],_0x5d9637=!!_0x3fe3a1&&_0x3fe3a1[_0x1056f6(0x145)]!==_0x1dbe71[_0x1056f6(0x140)],_0x361a6a=!!_0x3fe3a1&&!!_0x1dbe71[_0x1056f6(0x13c)]&&_0x3fe3a1['sqlName']!==_0x1dbe71['sqlName'];if(!_0x3fe3a1)_0x1f60d2['push'](_0x1dbe71[_0x1056f6(0x13e)]);else _0x3fe3a1[_0x1056f6(0x13a)]!==_0x513c4e||_0x5d9637||_0x361a6a?_0x31f096[_0x1056f6(0x147)](_0x1dbe71[_0x1056f6(0x13e)]):_0x38cfd2[_0x1056f6(0x147)](_0x1dbe71[_0x1056f6(0x13e)]);}for(const _0x5573a9 of Object['keys'](_0x5ed1b9[_0x1056f6(0x154)])){!_0x366226['has'](_0x5573a9)&&_0x6c6acd['push'](_0x5573a9);}const _0x43d14b=[];if(_0x30d7d1[_0x1056f6(0x13b)]('remote')){const _0x50cf2c=await fetchAllSqlCodes(_0x30d7d1[_0x1056f6(0x137)]);for(const _0x26a250 of _0x50cf2c){!_0x366226['has'](_0x26a250)&&!_0x5ed1b9[_0x1056f6(0x154)][_0x26a250]&&_0x43d14b['push'](_0x26a250);}}const _0x276f8d=_0x1f60d2[_0x1056f6(0x13d)]===0x0&&_0x31f096[_0x1056f6(0x13d)]===0x0&&_0x6c6acd[_0x1056f6(0x13d)]===0x0&&_0x43d14b[_0x1056f6(0x13d)]===0x0;return{'ok':!![],'data':{'added':_0x1f60d2,'modified':_0x31f096,'missing':_0x6c6acd,'unchanged':_0x38cfd2,'remoteOnly':_0x43d14b},'message':_0x276f8d?_0x1056f6(0x13f):_0x1f60d2[_0x1056f6(0x13d)]+'\x20added,\x20'+_0x31f096['length']+'\x20modified,\x20'+_0x6c6acd[_0x1056f6(0x13d)]+'\x20missing,\x20'+_0x38cfd2['length']+'\x20unchanged'+(_0x43d14b[_0x1056f6(0x13d)]>0x0?',\x20'+_0x43d14b[_0x1056f6(0x13d)]+'\x20remote-only':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a133_0x36d20d=a133_0x2d98;(function(_0x39c7f7,_0x15b27c){const _0x4c12a2=a133_0x2d98,_0x3c9aee=_0x39c7f7();while(!![]){try{const _0x397ac0=-parseInt(_0x4c12a2(0x19a))/0x1*(-parseInt(_0x4c12a2(0x1b8))/0x2)+-parseInt(_0x4c12a2(0x1a6))/0x3+parseInt(_0x4c12a2(0x1b4))/0x4*(parseInt(_0x4c12a2(0x1bf))/0x5)+parseInt(_0x4c12a2(0x1a7))/0x6+-parseInt(_0x4c12a2(0x18f))/0x7*(parseInt(_0x4c12a2(0x1bd))/0x8)+parseInt(_0x4c12a2(0x1a0))/0x9*(-parseInt(_0x4c12a2(0x1aa))/0xa)+parseInt(_0x4c12a2(0x1b1))/0xb;if(_0x397ac0===_0x15b27c)break;else _0x3c9aee['push'](_0x3c9aee['shift']());}catch(_0x2e626a){_0x3c9aee['push'](_0x3c9aee['shift']());}}}(a133_0x5856,0x7a2b2));import{readFileSync,existsSync}from'node:fs';function a133_0x2d98(_0x52f69d,_0x472d73){_0x52f69d=_0x52f69d-0x18b;const _0x585639=a133_0x5856();let _0x2d98f8=_0x585639[_0x52f69d];return _0x2d98f8;}function a133_0x5856(){const _0x3f25aa=['isDangerous','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','148pnBXAr','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','from','sql','reason','2715112SZnUNL','Dataset\x20\x22','25ISduEI','schemaWarnings','split','read','isArray','7ZeTtMW','dbtableConfig','validation','map','tables','get','filter','tableName','fields','utf-8','file','11325DVLSYZ','str','Provide\x20--file\x20or\x20--sql','isSelectOnly','size','Table\x20\x22','8632539fdWSrX','\x22\x20not\x20found\x20in\x20any\x20dataset','flagMissing','push','toLowerCase','schema:','2541594wjPZkd','4410852VZWiDL','message','File\x20not\x20found:\x20','10smylwA','\x22\x20not\x20found\x20or\x20not\x20accessible','string','SQL\x20schema\x20validation','length','parameters','trim','4599353AlCUvt','valid','sqlType','523876DbmSuD','validate'];a133_0x5856=function(){return _0x3f25aa;};return a133_0x5856();}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a133_0x36d20d(0x1bb),'command':a133_0x36d20d(0x1b5),'description':a133_0x36d20d(0x1b9),'risk':a133_0x36d20d(0x18d),'flags':[{'name':a133_0x36d20d(0x199),'type':a133_0x36d20d(0x1ac),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a133_0x36d20d(0x1bb),'type':'string','description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':'schemas','type':a133_0x36d20d(0x1ac),'description':a133_0x36d20d(0x1b7)}],async 'execute'(_0x4f4252){const _0x4f2918=a133_0x36d20d,_0x1d2c6c=_0x4f4252[_0x4f2918(0x19b)](_0x4f2918(0x199)),_0x162203=_0x4f4252[_0x4f2918(0x19b)]('sql');if(!_0x1d2c6c&&!_0x162203)throw CliErrors[_0x4f2918(0x1a2)](_0x4f2918(0x199),_0x4f2918(0x19c));let _0x53bce0;if(_0x1d2c6c){const _0x1926db=resolve(process['cwd'](),_0x1d2c6c);if(!existsSync(_0x1926db))throw CliErrors[_0x4f2918(0x191)](_0x4f2918(0x1a9)+_0x1926db);_0x53bce0=readFileSync(_0x1926db,_0x4f2918(0x198));}else _0x53bce0=_0x162203;const _0x3417b3=validateSql(_0x53bce0),_0x52b2bc={'valid':_0x3417b3[_0x4f2918(0x1b2)],'sqlType':_0x3417b3[_0x4f2918(0x1b3)]['type'],'isSelectOnly':_0x3417b3[_0x4f2918(0x1b3)][_0x4f2918(0x19d)],'isDangerous':_0x3417b3[_0x4f2918(0x1b3)][_0x4f2918(0x1b6)],'tables':_0x3417b3['tables'],'parameters':_0x3417b3[_0x4f2918(0x1af)],'message':_0x3417b3['message']};_0x3417b3[_0x4f2918(0x1b3)][_0x4f2918(0x1bc)]&&(_0x52b2bc[_0x4f2918(0x1bc)]=_0x3417b3[_0x4f2918(0x1b3)][_0x4f2918(0x1bc)]);const _0x4c6133=_0x4f4252['str']('schemas');if(_0x4c6133&&_0x3417b3[_0x4f2918(0x1b2)]){const _0x320a0a=_0x4c6133[_0x4f2918(0x18c)](',')[_0x4f2918(0x192)](_0x2c928d=>_0x2c928d[_0x4f2918(0x1b0)]())[_0x4f2918(0x195)](Boolean),_0xa1abd0=[],_0x1273a0=filterDbTableBackedDatasets(await listDatasets(_0x4f4252['appCode'])),_0x31111f=new Map(_0x1273a0[_0x4f2918(0x192)](_0x1a4823=>[_0x1a4823[_0x4f2918(0x190)]?.[_0x4f2918(0x196)]?.[_0x4f2918(0x1a4)](),_0x1a4823]));for(const _0x262571 of _0x3417b3[_0x4f2918(0x193)]){const _0x1a6e2b=_0x31111f[_0x4f2918(0x194)](_0x262571['toLowerCase']());!_0x1a6e2b&&_0xa1abd0['push'](_0x4f2918(0x19f)+_0x262571+_0x4f2918(0x1a1));}for(const _0x1c5340 of _0x320a0a){let _0x215a80;try{_0x215a80=await getDatasetDetail(_0x1c5340);}catch{_0xa1abd0[_0x4f2918(0x1a3)](_0x4f2918(0x1be)+_0x1c5340+_0x4f2918(0x1ab));continue;}assertDatasetIsDbTableBacked(_0x215a80,_0x4f2918(0x1ad));const _0x108597=Array[_0x4f2918(0x18e)](_0x215a80[_0x4f2918(0x197)])?_0x215a80['fields']:[],_0x422ae8=new Set(_0x108597[_0x4f2918(0x192)](_0x3ab18e=>_0x3ab18e['name']?.['toLowerCase']())),_0x3e8f9a=_0x215a80['dbtableConfig']?.[_0x4f2918(0x196)]||_0x215a80['tableName']||_0x1c5340;_0x52b2bc[_0x4f2918(0x1a5)+_0x3e8f9a]={'code':_0x1c5340,'tableName':_0x3e8f9a,'fieldCount':_0x422ae8[_0x4f2918(0x19e)],'fields':Array[_0x4f2918(0x1ba)](_0x422ae8)};}_0xa1abd0[_0x4f2918(0x1ae)]>0x0&&(_0x52b2bc[_0x4f2918(0x18b)]=_0xa1abd0);}return{'ok':_0x3417b3['valid'],'data':_0x52b2bc,'message':_0x3417b3[_0x4f2918(0x1a8)]};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x3d4f3b=a134_0x2ca3;(function(_0x24f6cf,_0x24ee34){const _0x14151b=a134_0x2ca3,_0x406f5d=_0x24f6cf();while(!![]){try{const _0x28b4a8=parseInt(_0x14151b(0x175))/0x1*(-parseInt(_0x14151b(0x182))/0x2)+-parseInt(_0x14151b(0x181))/0x3*(parseInt(_0x14151b(0x188))/0x4)+parseInt(_0x14151b(0x167))/0x5*(parseInt(_0x14151b(0x17a))/0x6)+parseInt(_0x14151b(0x174))/0x7+parseInt(_0x14151b(0x18b))/0x8*(-parseInt(_0x14151b(0x18c))/0x9)+-parseInt(_0x14151b(0x18f))/0xa+parseInt(_0x14151b(0x17e))/0xb*(parseInt(_0x14151b(0x173))/0xc);if(_0x28b4a8===_0x24ee34)break;else _0x406f5d['push'](_0x406f5d['shift']());}catch(_0x5205dd){_0x406f5d['push'](_0x406f5d['shift']());}}}(a134_0x2e80,0xe2647));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a134_0x3d4f3b(0x169),'accessKey',a134_0x3d4f3b(0x16e),'format',a134_0x3d4f3b(0x179)];export const TOP_LEVEL_CONFIG_KEYS=new Set(['appcode','env','locale',a134_0x3d4f3b(0x171),'cookie',a134_0x3d4f3b(0x186),a134_0x3d4f3b(0x16d)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x478390){const _0x58c143=a134_0x3d4f3b;return[..._0x478390][_0x58c143(0x172)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x109ddf){const _0x4e7bef=a134_0x3d4f3b;return TOP_LEVEL_CONFIG_KEYS[_0x4e7bef(0x16b)](_0x109ddf);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}function a134_0x2ca3(_0x2b660d,_0xdec99a){_0x2b660d=_0x2b660d-0x165;const _0x2e80a3=a134_0x2e80();let _0x2ca3b5=_0x2e80a3[_0x2b660d];return _0x2ca3b5;}export function getConfigCommandKeyDescription(){const _0x28fb25=a134_0x3d4f3b;return _0x28fb25(0x16a)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a134_0x3d4f3b(0x17d),'apiDir':a134_0x3d4f3b(0x16d),'cookie':'cookie','accessKey':a134_0x3d4f3b(0x186),'defaultFormat':a134_0x3d4f3b(0x171),'pageSize':a134_0x3d4f3b(0x177),'riskLevel':a134_0x3d4f3b(0x179),'locale':'locale'};function a134_0x2e80(){const _0x48b36a=['cookie','Config\x20key\x20(','has','app','apiDir','locale','appcode','inherit','format','join','12RbatEI','8010954QkRVsi','4VFsnRs','en-US','pageSize','Auth\x20cookie','riskLevel','90OyepKv','length','defaultApp','env','45099032EssKHW','Default\x20page\x20size','string','213297NLVxBT','837048wFWxgQ','defaultFormat','apps','Risk\x20level','accessKey','zh-CN','20PPnrPG','number','Locale','3568JBmVHt','31869SyYZou','Access\x20key','keys','17914990qcjPSf','Target\x20environment','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','toLowerCase','361115EVYdfN','map'];a134_0x2e80=function(){return _0x48b36a;};return a134_0x2e80();}export function getAppProfileFlagDefs(){const _0x229475=a134_0x3d4f3b;return[{'name':_0x229475(0x17d),'type':_0x229475(0x180),'description':_0x229475(0x190),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x229475(0x16d),'type':'string','description':'API\x20directory\x20path'},{'name':_0x229475(0x169),'type':_0x229475(0x180),'description':_0x229475(0x178),'hidden':!![]},{'name':_0x229475(0x186),'type':'string','description':_0x229475(0x18d),'hidden':!![]},{'name':_0x229475(0x183),'type':_0x229475(0x180),'description':_0x229475(0x165),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x229475(0x177),'type':_0x229475(0x189),'description':_0x229475(0x17f)},{'name':_0x229475(0x179),'type':_0x229475(0x180),'description':_0x229475(0x185),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x229475(0x16e),'type':'string','description':_0x229475(0x18a)}];}export function collectAppProfileOverrides(_0x487549){const _0x22ebc1=a134_0x3d4f3b,_0xb55c8c={};for(const [_0x161832,_0x97204b]of Object['entries'](APP_PROFILE_FLAG_KEY_MAP)){const _0x40d6ee=_0x487549(_0x161832);if(!_0x40d6ee)continue;_0xb55c8c[_0x97204b]=_0x97204b===_0x22ebc1(0x177)?Number(_0x40d6ee):_0x40d6ee;}return _0xb55c8c;}export function buildAppProfileListFields(_0x3133a2){const _0x4aac27=a134_0x3d4f3b;return{'env':_0x3133a2['env']??null,'apiDir':_0x3133a2[_0x4aac27(0x16d)]??null,'hasCookie':!!_0x3133a2['cookie'],'hasAccessKey':!!_0x3133a2['accessKey'],'format':_0x3133a2['format']??null,'pageSize':_0x3133a2[_0x4aac27(0x177)]??null,'riskLevel':_0x3133a2[_0x4aac27(0x179)]??null,'locale':_0x3133a2[_0x4aac27(0x16e)]??null};}export function buildAppDoctorFields(_0x421e62,_0x37eb4e){const _0x1162fb=a134_0x3d4f3b;return{'env':{'value':_0x421e62[_0x1162fb(0x17d)]||_0x37eb4e['env'],'source':_0x421e62[_0x1162fb(0x17d)]?_0x1162fb(0x16c):'inherit'},'apiDir':{'value':_0x421e62['apiDir']||_0x37eb4e['apiDir'],'source':_0x421e62[_0x1162fb(0x16d)]?'app':_0x1162fb(0x170)},'cookie':{'value':_0x421e62[_0x1162fb(0x169)]||_0x37eb4e['cookie'],'source':_0x421e62[_0x1162fb(0x169)]?'app':_0x1162fb(0x170)},'accessKey':{'value':_0x421e62[_0x1162fb(0x186)]||_0x37eb4e[_0x1162fb(0x186)],'source':_0x421e62[_0x1162fb(0x186)]?_0x1162fb(0x16c):_0x1162fb(0x170)}};}export function buildCanonicalAppConfig(_0x50fe2c,_0x34b76f){const _0x5d3d88=a134_0x3d4f3b,_0x1f124c=_0x50fe2c[_0x5d3d88(0x168)](_0x2bf535=>String(_0x2bf535||'')['trim']())['filter'](Boolean);if(_0x1f124c[_0x5d3d88(0x17b)]===0x0)return{};const _0x501d70={};for(const _0x6fc2fe of _0x1f124c){_0x501d70[_0x6fc2fe]=_0x34b76f?{'appcode':_0x6fc2fe,'env':_0x34b76f}:{'appcode':_0x6fc2fe};}return{'apps':_0x501d70,'defaultApp':_0x1f124c[0x0]};}export function buildCanonicalProjectConfig(_0x381811,_0x117b07){const _0x40754f=a134_0x3d4f3b,{appCodes:appCodes=[],env:_0x26f19a,metadata:_0xc0a036}=_0x117b07,_0x4840d1={..._0x381811,..._0xc0a036||{}};delete _0x4840d1[_0x40754f(0x16f)],delete _0x4840d1[_0x40754f(0x16c)];if(_0x26f19a)_0x4840d1[_0x40754f(0x17d)]=_0x26f19a;else!_0x4840d1[_0x40754f(0x17d)]&&(_0x4840d1['env']=DEFAULT_CONFIG_VALUES['env']);const _0x1ed527=buildCanonicalAppConfig(appCodes,_0x4840d1[_0x40754f(0x17d)]);return Object[_0x40754f(0x18e)](_0x1ed527)[_0x40754f(0x17b)]>0x0&&(_0x4840d1[_0x40754f(0x184)]=_0x1ed527[_0x40754f(0x184)],_0x4840d1[_0x40754f(0x17c)]=_0x1ed527[_0x40754f(0x17c)]),_0x4840d1;}const LOCALE_MAP={'zh':'zh-CN','zh-cn':a134_0x3d4f3b(0x187),'zh_cn':a134_0x3d4f3b(0x187),'en':a134_0x3d4f3b(0x176),'en-us':a134_0x3d4f3b(0x176),'en_us':a134_0x3d4f3b(0x176)};export function normalizeLocale(_0x5303d1){const _0x165332=a134_0x3d4f3b;if(!_0x5303d1)return null;return LOCALE_MAP[_0x5303d1[_0x165332(0x166)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a135_0x1002(){const _0x3095a2=['4893YhJgLL','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','9KhzkuA','108485qLhOOM','989544YJRwiB','546VlpyDz','86703ClOnwD','4200040ZZPddR','25bjxgZK','137684qHiPjp','263318pcafbh'];a135_0x1002=function(){return _0x3095a2;};return a135_0x1002();}function a135_0x4512(_0x33e063,_0x4c079a){_0x33e063=_0x33e063-0x6c;const _0x1002ce=a135_0x1002();let _0x4512f1=_0x1002ce[_0x33e063];return _0x4512f1;}const a135_0x3d0959=a135_0x4512;(function(_0x2d8225,_0x38e8de){const _0x5adad4=a135_0x4512,_0x5da23f=_0x2d8225();while(!![]){try{const _0xc2d786=parseInt(_0x5adad4(0x6c))/0x1+-parseInt(_0x5adad4(0x73))/0x2+-parseInt(_0x5adad4(0x6f))/0x3+-parseInt(_0x5adad4(0x72))/0x4*(parseInt(_0x5adad4(0x71))/0x5)+-parseInt(_0x5adad4(0x6e))/0x6*(-parseInt(_0x5adad4(0x74))/0x7)+parseInt(_0x5adad4(0x6d))/0x8*(-parseInt(_0x5adad4(0x76))/0x9)+parseInt(_0x5adad4(0x70))/0xa;if(_0xc2d786===_0x38e8de)break;else _0x5da23f['push'](_0x5da23f['shift']());}catch(_0x2a794d){_0x5da23f['push'](_0x5da23f['shift']());}}}(a135_0x1002,0x2123c));export const CLI_VERSION_POLICY_URL=a135_0x3d0959(0x75);
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a136_0x2fadd2=a136_0x1ff3;function a136_0x1ff3(_0x38eb5f,_0x3fc3d7){_0x38eb5f=_0x38eb5f-0xdf;const _0x15c7e4=a136_0x15c7();let _0x1ff3c6=_0x15c7e4[_0x38eb5f];return _0x1ff3c6;}(function(_0x4bb3c2,_0x2faa2b){const _0x4e6496=a136_0x1ff3,_0x31d404=_0x4bb3c2();while(!![]){try{const _0x5a5f2d=parseInt(_0x4e6496(0x102))/0x1+-parseInt(_0x4e6496(0xe3))/0x2+-parseInt(_0x4e6496(0xe5))/0x3*(parseInt(_0x4e6496(0x109))/0x4)+parseInt(_0x4e6496(0x13b))/0x5+parseInt(_0x4e6496(0x108))/0x6*(parseInt(_0x4e6496(0xeb))/0x7)+-parseInt(_0x4e6496(0x11e))/0x8*(parseInt(_0x4e6496(0x10f))/0x9)+parseInt(_0x4e6496(0x112))/0xa;if(_0x5a5f2d===_0x2faa2b)break;else _0x31d404['push'](_0x31d404['shift']());}catch(_0xe79239){_0x31d404['push'](_0x31d404['shift']());}}}(a136_0x15c7,0x9d568));export const CLI_BIN_NAME='rabetbase';function a136_0x15c7(){const _0x1d1d0b=['enableBffSave','fromEntries','Config\x20value','775926dEwbZL','type','remote','5755500MhxLDq','dryRun','skipImports','<code>','Skip\x20import\x20generation','@lovrabet/rabetbase-cli','title','verbose','operation','force','schemas','Select\x20app\x20profile\x20by\x20name','16oNMrZg','Show\x20help','file','Page\x20size','Use\x20remote','Confirm\x20destructive\x20action','format','watch','expected-count','keyword','non-interactive','page','Rabetbase\x20CLI','Schemas','File\x20path','Dataset\x20code','operation-type','appcode','Enable\x20BFF\x20save','params','Override\x20appcode','sql','boolean','operationType','function-node','global','functionNode','dbId','Title','4034505xRqCZJ','app','<name>','Alias\x20for\x20--non-interactive','sqlcode','env','json\x20|\x20pretty\x20|\x20compress','Config\x20key','DB\x20ID','key','dbid','expectedCount','enable-bff-save','Output\x20format','sqlName','2300074JPEXQC','all','2121KeRxof','Page\x20number','sqlname','pagesize','nonInteractive','Use\x20global\x20config\x20scope','1526uozuxq','db-id','Record\x20ID','Code\x20filter','project','skip-imports','target','yes','Function\x20node','value','dry-run','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','output','Apply\x20to\x20all','SQL\x20name','clear','Preview\x20operation\x20without\x20executing','description','SQL\x20code','Type\x20filter','Environment','Expected\x20affected\x20count','description-file','80761hEdhcC','string','datasetcode','Use\x20project\x20config\x20scope','Operation\x20type','descriptionFile','34626ITRcZi','4268OGsuHI','help','confirm'];a136_0x15c7=function(){return _0x1d1d0b;};return a136_0x15c7();}export const CLI_DISPLAY_NAME=a136_0x2fadd2(0x12a);export const NPM_PACKAGE_NAME=a136_0x2fadd2(0x117);export const GLOBAL_FLAGS=[{'name':a136_0x2fadd2(0x12f),'meowKey':a136_0x2fadd2(0x12f),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0x132),'hint':a136_0x2fadd2(0x115)},{'name':'app','meowKey':a136_0x2fadd2(0x13c),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0x11d),'hint':a136_0x2fadd2(0x13d)},{'name':a136_0x2fadd2(0x140),'meowKey':a136_0x2fadd2(0x140),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0xff),'hint':'production\x20|\x20daily'},{'name':'format','meowKey':a136_0x2fadd2(0x124),'type':'string','description':a136_0x2fadd2(0xe1),'hint':a136_0x2fadd2(0x141)},{'name':'jq','meowKey':'jq','type':'string','description':a136_0x2fadd2(0xf6),'hint':'<expr>'},{'name':a136_0x2fadd2(0xf5),'meowKey':a136_0x2fadd2(0x113),'type':a136_0x2fadd2(0x134),'description':a136_0x2fadd2(0xfb)},{'name':a136_0x2fadd2(0xf2),'meowKey':a136_0x2fadd2(0xf2),'type':'boolean','description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a136_0x2fadd2(0x128),'meowKey':a136_0x2fadd2(0xe9),'type':'boolean','description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':a136_0x2fadd2(0x137),'meowKey':'global','type':a136_0x2fadd2(0x134),'description':a136_0x2fadd2(0xea)},{'name':a136_0x2fadd2(0xef),'meowKey':a136_0x2fadd2(0xef),'type':a136_0x2fadd2(0x134),'description':a136_0x2fadd2(0x105)},{'name':'ci','meowKey':'ci','type':a136_0x2fadd2(0x134),'description':a136_0x2fadd2(0x13e),'hidden':!![]},{'name':'help','meowKey':a136_0x2fadd2(0x10a),'type':a136_0x2fadd2(0x134),'description':a136_0x2fadd2(0x11f)},{'name':'name','meowKey':'name','type':'string','description':'Name','hidden':!![]},{'name':a136_0x2fadd2(0x118),'meowKey':a136_0x2fadd2(0x118),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0x13a),'hidden':!![]},{'name':a136_0x2fadd2(0xfa),'meowKey':a136_0x2fadd2(0xfa),'type':a136_0x2fadd2(0x134),'description':'Clear','hidden':!![]},{'name':a136_0x2fadd2(0x125),'meowKey':'watch','type':a136_0x2fadd2(0x134),'description':'Watch\x20mode','hidden':!![]},{'name':a136_0x2fadd2(0xf7),'meowKey':'output','type':'string','description':'Output\x20path','hidden':!![]},{'name':a136_0x2fadd2(0x131),'meowKey':a136_0x2fadd2(0x131),'type':a136_0x2fadd2(0x103),'description':'JSON\x20params','hidden':!![]},{'name':a136_0x2fadd2(0x104),'meowKey':a136_0x2fadd2(0x104),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0x12d),'hidden':!![]},{'name':a136_0x2fadd2(0xe4),'meowKey':a136_0x2fadd2(0xe4),'type':a136_0x2fadd2(0x134),'description':a136_0x2fadd2(0xf8),'hidden':!![]},{'name':a136_0x2fadd2(0xe0),'meowKey':a136_0x2fadd2(0x10c),'type':a136_0x2fadd2(0x134),'description':a136_0x2fadd2(0x130),'hidden':!![]},{'name':'id','meowKey':'id','type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0xed),'hidden':!![]},{'name':'type','meowKey':a136_0x2fadd2(0x110),'type':'string','description':a136_0x2fadd2(0xfe),'hidden':!![]},{'name':a136_0x2fadd2(0x120),'meowKey':a136_0x2fadd2(0x120),'type':'string','description':a136_0x2fadd2(0x12c),'hidden':!![]},{'name':a136_0x2fadd2(0x13f),'meowKey':'sqlcode','type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0xfd),'hidden':!![]},{'name':'sql-name','meowKey':a136_0x2fadd2(0xe2),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0xf9),'hidden':!![]},{'name':'sqlname','meowKey':a136_0x2fadd2(0xe7),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0xf9),'hidden':!![]},{'name':a136_0x2fadd2(0xec),'meowKey':a136_0x2fadd2(0x139),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0x143),'hidden':!![]},{'name':a136_0x2fadd2(0x145),'meowKey':a136_0x2fadd2(0x145),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0x143),'hidden':!![]},{'name':'description','meowKey':a136_0x2fadd2(0xfc),'type':a136_0x2fadd2(0x103),'description':'Description','hidden':!![]},{'name':a136_0x2fadd2(0x101),'meowKey':a136_0x2fadd2(0x107),'type':a136_0x2fadd2(0x103),'description':'Description\x20file','hidden':!![]},{'name':a136_0x2fadd2(0x129),'meowKey':a136_0x2fadd2(0x129),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0xe6),'hidden':!![]},{'name':a136_0x2fadd2(0xe8),'meowKey':a136_0x2fadd2(0xe8),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0x121),'hidden':!![]},{'name':'keyword','meowKey':a136_0x2fadd2(0x127),'type':a136_0x2fadd2(0x103),'description':'Keyword\x20filter','hidden':!![]},{'name':'code','meowKey':'code','type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0xee),'hidden':!![]},{'name':'sql','meowKey':a136_0x2fadd2(0x133),'type':a136_0x2fadd2(0x103),'description':'SQL\x20string','hidden':!![]},{'name':a136_0x2fadd2(0x11c),'meowKey':a136_0x2fadd2(0x11c),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0x12b),'hidden':!![]},{'name':a136_0x2fadd2(0x11a),'meowKey':a136_0x2fadd2(0x11a),'type':'string','description':a136_0x2fadd2(0x106),'hidden':!![]},{'name':a136_0x2fadd2(0xf1),'meowKey':a136_0x2fadd2(0xf1),'type':'string','description':'Target\x20path','hidden':!![]},{'name':a136_0x2fadd2(0xf0),'meowKey':a136_0x2fadd2(0x114),'type':a136_0x2fadd2(0x134),'description':a136_0x2fadd2(0x116),'hidden':!![]},{'name':a136_0x2fadd2(0x144),'meowKey':'key','type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0x142),'hidden':!![]},{'name':a136_0x2fadd2(0xf4),'meowKey':'value','type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0x10e),'hidden':!![]},{'name':'force','meowKey':a136_0x2fadd2(0x11b),'type':a136_0x2fadd2(0x134),'description':'Force\x20overwrite','hidden':!![]},{'name':a136_0x2fadd2(0x10b),'meowKey':a136_0x2fadd2(0x10b),'type':a136_0x2fadd2(0x134),'description':a136_0x2fadd2(0x123),'hidden':!![]},{'name':a136_0x2fadd2(0x111),'meowKey':a136_0x2fadd2(0x111),'type':a136_0x2fadd2(0x134),'description':a136_0x2fadd2(0x122),'hidden':!![]},{'name':a136_0x2fadd2(0x119),'meowKey':'verbose','type':a136_0x2fadd2(0x134),'description':'Verbose\x20output','hidden':!![]},{'name':a136_0x2fadd2(0x126),'meowKey':a136_0x2fadd2(0xdf),'type':'string','description':a136_0x2fadd2(0x100),'hidden':!![]},{'name':a136_0x2fadd2(0x12e),'meowKey':a136_0x2fadd2(0x135),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0x106),'hidden':!![]},{'name':a136_0x2fadd2(0x136),'meowKey':a136_0x2fadd2(0x138),'type':a136_0x2fadd2(0x103),'description':a136_0x2fadd2(0xf3),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a136_0x2fadd2(0x12f),a136_0x2fadd2(0x13c),'env',a136_0x2fadd2(0x124),'jq',a136_0x2fadd2(0xf5),a136_0x2fadd2(0xf2),a136_0x2fadd2(0x128),'ci']);export function buildMeowFlags(){const _0x856772=a136_0x2fadd2;return Object[_0x856772(0x10d)](GLOBAL_FLAGS['map'](_0x1ea05a=>[_0x1ea05a['meowKey'],{'type':_0x1ea05a[_0x856772(0x110)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a137_0x3dc1f9=a137_0xf0b7;(function(_0x472270,_0x45f4ed){const _0x398555=a137_0xf0b7,_0x111bcc=_0x472270();while(!![]){try{const _0x54c417=parseInt(_0x398555(0x10c))/0x1+parseInt(_0x398555(0x115))/0x2*(parseInt(_0x398555(0x10a))/0x3)+parseInt(_0x398555(0x117))/0x4*(parseInt(_0x398555(0x113))/0x5)+-parseInt(_0x398555(0x10f))/0x6+parseInt(_0x398555(0x111))/0x7*(parseInt(_0x398555(0x110))/0x8)+parseInt(_0x398555(0x10e))/0x9*(-parseInt(_0x398555(0x10d))/0xa)+-parseInt(_0x398555(0x114))/0xb;if(_0x54c417===_0x45f4ed)break;else _0x111bcc['push'](_0x111bcc['shift']());}catch(_0x4cc867){_0x111bcc['push'](_0x111bcc['shift']());}}}(a137_0x5605,0x9e6a6));import{DEFAULT_API_DIR}from'../constant/paths.js';function a137_0xf0b7(_0x3f7030,_0x5cd3be){_0x3f7030=_0x3f7030-0x109;const _0x56053f=a137_0x5605();let _0xf0b726=_0x56053f[_0x3f7030];return _0xf0b726;}export const DEFAULT_CONFIG_VALUES={'env':a137_0x3dc1f9(0x109),'format':'compress','locale':a137_0x3dc1f9(0x112),'riskLevel':a137_0x3dc1f9(0x116),'apiDir':DEFAULT_API_DIR};function a137_0x5605(){const _0x57ecb9=['2bnIDvn','high-risk-write','4zfOHIj','production','1042638GDUHGt','compress','1182084XRvesJ','10fyjZYA','74475iHarVw','1812390tSHdTh','221536syHUQG','98VeruKc','en-US','3029980Ijwbhu','17205144zwSJMc'];a137_0x5605=function(){return _0x57ecb9;};return a137_0x5605();}export const DEFAULT_COMMAND_OUTPUT_FORMAT=a137_0x3dc1f9(0x10b);
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a138_0x477a13=a138_0x58e4;(function(_0x5213d4,_0x5c3e0f){const _0x2de2d8=a138_0x58e4,_0x3b8b0f=_0x5213d4();while(!![]){try{const _0x1241a2=-parseInt(_0x2de2d8(0x12d))/0x1*(-parseInt(_0x2de2d8(0x131))/0x2)+-parseInt(_0x2de2d8(0x12b))/0x3+parseInt(_0x2de2d8(0x124))/0x4+parseInt(_0x2de2d8(0x128))/0x5+parseInt(_0x2de2d8(0x126))/0x6+parseInt(_0x2de2d8(0x125))/0x7*(-parseInt(_0x2de2d8(0x127))/0x8)+-parseInt(_0x2de2d8(0x130))/0x9;if(_0x1241a2===_0x5c3e0f)break;else _0x3b8b0f['push'](_0x3b8b0f['shift']());}catch(_0xbf54d0){_0x3b8b0f['push'](_0x3b8b0f['shift']());}}}(a138_0x54f8,0xed01c));function a138_0x54f8(){const _0x9cee8f=['2647368TAZtAU','userDomain','2lXAUnd','/app/','https://app.lovrabet.com','263610MlZatR','1105746lALaoL','trim','apiDomain','1875376qGIdBM','10867213VYypdI','3875628fNTGBS','8mOOpuL','6072285FVqlaM','https://daily-api.lovrabet.com','runtimeDomain'];a138_0x54f8=function(){return _0x9cee8f;};return a138_0x54f8();}import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x2aa0a6){const _0x80be1c=a138_0x58e4;customApiDomain=_0x2aa0a6?.[_0x80be1c(0x123)],customUserDomain=_0x2aa0a6?.[_0x80be1c(0x12c)],customRuntimeDomain=_0x2aa0a6?.[_0x80be1c(0x12a)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':'https://user-daily.lovrabet.com');function a138_0x58e4(_0x79f1dd,_0x55e04f){_0x79f1dd=_0x79f1dd-0x123;const _0x54f829=a138_0x54f8();let _0x58e4fc=_0x54f829[_0x79f1dd];return _0x58e4fc;}export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':a138_0x477a13(0x129));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?'https://runtime.lovrabet.com':'https://daily-runtime.lovrabet.com');export const getAppDomain=()=>isProduction(getEnv())?a138_0x477a13(0x12f):'https://daily.lovrabet.com';export const getAppBaseUrl=_0x5e8317=>{const _0x3a9c4a=a138_0x477a13,_0x5683f8=encodeURIComponent(_0x5e8317[_0x3a9c4a(0x132)]());return isProduction(getEnv())?getAppDomain()+_0x3a9c4a(0x12e)+_0x5683f8:getAppDomain()+'/web-app/app/'+_0x5683f8;};
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a139_0x58e7fb=a139_0x1181;(function(_0x2ebb03,_0x49b197){const _0x24ef5a=a139_0x1181,_0x317aba=_0x2ebb03();while(!![]){try{const _0x2cf0e8=-parseInt(_0x24ef5a(0xcc))/0x1*(parseInt(_0x24ef5a(0xc8))/0x2)+-parseInt(_0x24ef5a(0xc7))/0x3*(parseInt(_0x24ef5a(0xc0))/0x4)+-parseInt(_0x24ef5a(0xc4))/0x5*(parseInt(_0x24ef5a(0xc6))/0x6)+-parseInt(_0x24ef5a(0xcb))/0x7+-parseInt(_0x24ef5a(0xbf))/0x8*(parseInt(_0x24ef5a(0xc1))/0x9)+parseInt(_0x24ef5a(0xca))/0xa*(-parseInt(_0x24ef5a(0xbd))/0xb)+-parseInt(_0x24ef5a(0xc5))/0xc*(-parseInt(_0x24ef5a(0xcd))/0xd);if(_0x2cf0e8===_0x49b197)break;else _0x317aba['push'](_0x317aba['shift']());}catch(_0x49ab6d){_0x317aba['push'](_0x317aba['shift']());}}}(a139_0x366c,0x99a70));export const RABETBASE_ENV_VALUES=[a139_0x58e7fb(0xbe),a139_0x58e7fb(0xc2)];export function normalizeEnv(_0x38d9c0){const _0x3a1354=a139_0x58e7fb;return _0x38d9c0==='online'?_0x3a1354(0xbe):_0x38d9c0;}function a139_0x366c(){const _0x251019=['1nnZDJv','481cpFpgu','6115483QffOZa','production','16KYWvtd','4YXTcAG','1784799pmrLuZ','daily','dev','145nlxnIe','1309764cnPaoS','84192AQZqKO','1614234alqppK','575038mEUtLX','development','10VUmwOy','8567853hXweOV'];a139_0x366c=function(){return _0x251019;};return a139_0x366c();}export function isProduction(_0x4d6bda){return normalizeEnv(_0x4d6bda)==='production';}export function isDaily(_0x20e1ae){const _0x29eaa2=a139_0x58e7fb;return normalizeEnv(_0x20e1ae)===_0x29eaa2(0xc2);}export function isDev(_0x4c7773){const _0x1102a3=a139_0x58e7fb,_0x103f03=normalizeEnv(_0x4c7773);return _0x103f03===_0x1102a3(0xc9)||_0x103f03===_0x1102a3(0xc3);}function a139_0x1181(_0x2178cb,_0x46d347){_0x2178cb=_0x2178cb-0xbd;const _0x366cdc=a139_0x366c();let _0x1181e8=_0x366cdc[_0x2178cb];return _0x1181e8;}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a139_0x58e7fb(0xbe));export function getEnv(){return env;}export function initEnv(_0x3e109b){env=normalizeEnv(_0x3e109b);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a140_0x20cc(){const _0x5dcbaf=['11469996jYrKmm','797880lvOPzx','10stwjoa','pretty','2GExZLQ','4055YZTEol','json','945259LlaFtv','747870vyTjlP','792682udUmlJ','4644kcFfBv','2697864JmvPQl'];a140_0x20cc=function(){return _0x5dcbaf;};return a140_0x20cc();}const a140_0xacb56b=a140_0x2c14;function a140_0x2c14(_0x5461da,_0x43f785){_0x5461da=_0x5461da-0x1c6;const _0x20cc0f=a140_0x20cc();let _0x2c14f8=_0x20cc0f[_0x5461da];return _0x2c14f8;}(function(_0x181bdb,_0x28ce3d){const _0x5ae664=a140_0x2c14,_0x3e3097=_0x181bdb();while(!![]){try{const _0x52cf37=parseInt(_0x5ae664(0x1d0))/0x1+-parseInt(_0x5ae664(0x1cb))/0x2*(-parseInt(_0x5ae664(0x1cf))/0x3)+parseInt(_0x5ae664(0x1d1))/0x4*(parseInt(_0x5ae664(0x1cc))/0x5)+-parseInt(_0x5ae664(0x1c6))/0x6+parseInt(_0x5ae664(0x1ce))/0x7+parseInt(_0x5ae664(0x1c8))/0x8+-parseInt(_0x5ae664(0x1c7))/0x9*(parseInt(_0x5ae664(0x1c9))/0xa);if(_0x52cf37===_0x28ce3d)break;else _0x3e3097['push'](_0x3e3097['shift']());}catch(_0x1ef78c){_0x3e3097['push'](_0x3e3097['shift']());}}}(a140_0x20cc,0x78a93));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a140_0xacb56b(0x1cd),a140_0xacb56b(0x1ca),'compress'];
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a141_0x5d2f(_0xfd6f0d,_0xefb440){_0xfd6f0d=_0xfd6f0d-0x10b;const _0x11adbf=a141_0x11ad();let _0x5d2f54=_0x11adbf[_0xfd6f0d];return _0x5d2f54;}const a141_0x216830=a141_0x5d2f;(function(_0x45eaa3,_0x477b7c){const _0x2b4833=a141_0x5d2f,_0x10b3fe=_0x45eaa3();while(!![]){try{const _0x47c830=-parseInt(_0x2b4833(0x116))/0x1*(-parseInt(_0x2b4833(0x110))/0x2)+-parseInt(_0x2b4833(0x10c))/0x3+parseInt(_0x2b4833(0x111))/0x4*(-parseInt(_0x2b4833(0x10f))/0x5)+-parseInt(_0x2b4833(0x10e))/0x6*(-parseInt(_0x2b4833(0x115))/0x7)+parseInt(_0x2b4833(0x10b))/0x8*(parseInt(_0x2b4833(0x10d))/0x9)+-parseInt(_0x2b4833(0x114))/0xa+parseInt(_0x2b4833(0x112))/0xb;if(_0x47c830===_0x477b7c)break;else _0x10b3fe['push'](_0x10b3fe['shift']());}catch(_0x332cff){_0x10b3fe['push'](_0x10b3fe['shift']());}}}(a141_0x11ad,0x6ab7b));function a141_0x11ad(){const _0x3493f=['40GcCTpN','1780023aUkZeW','1310598dfhtJw','438YfYOws','5kffytT','10ZgAYiY','460820xlpFZb','7254005UrJRRU','./src/api','6575360lruguL','39053wdqgeM','1673NSBLCN'];a141_0x11ad=function(){return _0x3493f;};return a141_0x11ad();}export const DEFAULT_API_DIR=a141_0x216830(0x113);
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a142_0x286b(_0x35fd9d,_0x3d45cb){_0x35fd9d=_0x35fd9d-0xde;const _0x58efb3=a142_0x58ef();let _0x286b08=_0x58efb3[_0x35fd9d];return _0x286b08;}function a142_0x58ef(){const _0x5852ea=['2HcCjlt','write','3048635lyIHUK','read','22713SXvOhA','136hOWRot','45IdmcnB','1361990FMTqdq','high-risk-write','10233630xCaRSz','443739NmNEdo','140TiKuJO','2992674QAGPVm','283829NBFJXr'];a142_0x58ef=function(){return _0x5852ea;};return a142_0x58ef();}const a142_0x3c324b=a142_0x286b;(function(_0x3b5d85,_0x1cab78){const _0x214be8=a142_0x286b,_0xdd0577=_0x3b5d85();while(!![]){try{const _0xb625e8=-parseInt(_0x214be8(0xeb))/0x1*(parseInt(_0x214be8(0xe1))/0x2)+-parseInt(_0x214be8(0xe5))/0x3*(-parseInt(_0x214be8(0xde))/0x4)+parseInt(_0x214be8(0xe3))/0x5+parseInt(_0x214be8(0xdf))/0x6+parseInt(_0x214be8(0xe0))/0x7*(-parseInt(_0x214be8(0xe6))/0x8)+-parseInt(_0x214be8(0xe7))/0x9*(parseInt(_0x214be8(0xe8))/0xa)+parseInt(_0x214be8(0xea))/0xb;if(_0xb625e8===_0x1cab78)break;else _0xdd0577['push'](_0xdd0577['shift']());}catch(_0x297cfb){_0xdd0577['push'](_0xdd0577['shift']());}}}(a142_0x58ef,0x7793c));export const RISK_LEVEL_VALUES=[a142_0x3c324b(0xe4),a142_0x3c324b(0xe2),a142_0x3c324b(0xe9)];
|