@lovrabet/rabetbase-cli 2.2.3-beta.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/capability.js +1 -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_0x426776=a128_0x509b;(function(_0x4d27fd,_0x509121){const _0x270aca=a128_0x509b,_0x2d1d4c=_0x4d27fd();while(!![]){try{const _0x33b75b=parseInt(_0x270aca(0x1c5))/0x1+parseInt(_0x270aca(0x1c4))/0x2*(-parseInt(_0x270aca(0x1dd))/0x3)+-parseInt(_0x270aca(0x1c6))/0x4*(parseInt(_0x270aca(0x1f0))/0x5)+parseInt(_0x270aca(0x1cd))/0x6*(parseInt(_0x270aca(0x1de))/0x7)+-parseInt(_0x270aca(0x1d1))/0x8+-parseInt(_0x270aca(0x1d3))/0x9+parseInt(_0x270aca(0x1fc))/0xa;if(_0x33b75b===_0x509121)break;else _0x2d1d4c['push'](_0x2d1d4c['shift']());}catch(_0x12fb0c){_0x2d1d4c['push'](_0x2d1d4c['shift']());}}}(a128_0x1001,0xeb24c));import{readFile,rm,writeFile}from'node:fs/promises';function a128_0x509b(_0x495a98,_0x4b4be7){_0x495a98=_0x495a98-0x1bf;const _0x100111=a128_0x1001();let _0x509b10=_0x100111[_0x495a98];return _0x509b10;}import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';function a128_0x1001(){const _0x2fa45e=['Would\x20pull\x20','Pull\x20complete:\x20','4ZoPVbt','89504wBjhzf','16HhFLxL','tableData','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','sqlRootDir','str','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqlcode','28716JxHIZK','replace','lockFilePath','sqlCode','7447320EqWfsS','Force\x20pull\x20cancelled.','10928106DfQTtv','POST','string','cancelled','sqlName','description','apps','length','nonInteractive','catch','1910901pbrODC','406iBZWxN','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlContent','skipped','sqlRoot','would_pull','write','bool','No\x20remote\x20SQL\x20queries\x20matched.','sqls','path','utf8','dbId','sql','Force\x20overwrite\x20local\x20unsynced\x20changes','mybatisXml','\x20SQL\x20file(s)\x20into\x20','join','673835vIKIin','conflict','paging','toISOString','appCode','boolean','test','split','name','pull','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','lastSync','45542070maLAUI','local\x20differs\x20from\x20remote','\x20skipped,\x20','push','force','message','totalCount','trimStart'];a128_0x1001=function(){return _0x2fa45e;};return a128_0x1001();}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(_0x7d8774,_0x501d21){const _0x478e3d=a128_0x509b,_0x1e733f=[];let _0x1e9d57=0x1;while(!![]){const _0x487c6b=await listSqlQueries(_0x7d8774,{'currentPage':_0x1e9d57,'pageSize':PAGE_SIZE,'sqlCode':_0x501d21[_0x478e3d(0x1d0)],'sqlName':_0x501d21[_0x478e3d(0x1d7)]}),_0x42a630=_0x487c6b[_0x478e3d(0x1c7)]??[];_0x1e733f['push'](..._0x42a630);if(_0x42a630[_0x478e3d(0x1da)]===0x0)break;const _0xae445f=_0x487c6b[_0x478e3d(0x1f2)]?.[_0x478e3d(0x1c0)];if(_0xae445f!=null?_0x1e733f[_0x478e3d(0x1da)]>=_0xae445f:_0x42a630[_0x478e3d(0x1da)]<PAGE_SIZE)break;_0x1e9d57++;}return _0x1e733f;}async function ensureSqlContent(_0x510307){const _0x3ee6ba=a128_0x509b;if(_0x510307[_0x3ee6ba(0x1e0)]!=null&&String(_0x510307['sqlContent'])[_0x3ee6ba(0x1da)]>0x0)return _0x510307;return getSqlQueryDetail(_0x510307[_0x3ee6ba(0x1d0)]);}export const sqlPull={'service':a128_0x426776(0x1eb),'command':a128_0x426776(0x1f9),'description':a128_0x426776(0x1df),'risk':a128_0x426776(0x1e4),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0x426776(0x1f8),'type':a128_0x426776(0x1d5),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':'force','type':a128_0x426776(0x1f5),'description':a128_0x426776(0x1ec)}],async 'dryRun'(_0x314e45){const _0x996899=a128_0x426776,_0x2843dd=loadSqlProjectConfig(_0x314e45['appCode']),_0x5adadf=await readSqlLockFile(_0x2843dd[_0x996899(0x1cf)]),{appLock:_0x3e13c5}=ensureSqlLockScope(_0x5adadf??createEmptySqlLock(),_0x2843dd[_0x996899(0x1f4)],_0x2843dd['sqlRoot'],_0x996899(0x1f9)),_0x2aa64=await fetchAllSqlQueries(_0x314e45[_0x996899(0x1f4)],{'sqlCode':_0x314e45['str']('sqlcode')||undefined,'sqlName':_0x314e45[_0x996899(0x1ca)](_0x996899(0x1f8))||undefined}),_0x1f5b21=[];for(const _0x41af18 of _0x2aa64){const _0x2f5417=await ensureSqlContent(_0x41af18),_0x40bd8f=ensureRemoteSqlContent(_0x2f5417),_0x3cc30d=detectModeFromSql(_0x2f5417),_0x45e35b=_0x2f5417[_0x996899(0x1ea)]?await getDbName(_0x314e45['appCode'],Number(_0x2f5417[_0x996899(0x1ea)]))[_0x996899(0x1dc)](()=>undefined):undefined,_0x4425d8=buildLocalSqlFileContent({'sqlCode':_0x2f5417[_0x996899(0x1d0)],'sqlName':_0x2f5417[_0x996899(0x1d7)],'dbId':_0x2f5417[_0x996899(0x1ea)]},_0x40bd8f,{'dbName':_0x45e35b,'mode':_0x3cc30d,'syncedAt':new Date()[_0x996899(0x1f3)](),'description':_0x2f5417['description']}),_0x31aeca=buildSqlLockEntry(_0x2f5417,_0x40bd8f,'',{'dbName':_0x45e35b}),_0x233a3b=resolveLocalSqlFilePath(_0x2843dd,_0x2f5417[_0x996899(0x1d0)],_0x31aeca);let _0x16dc80=_0x996899(0x1e3),_0x2f4e4c;if(await fileExists(_0x233a3b)){const _0x1bb635=await readFile(_0x233a3b,_0x996899(0x1e9));isEquivalentPulledSqlFile(_0x1bb635,_0x4425d8,_0x3cc30d)?(_0x16dc80=_0x996899(0x1e1),_0x2f4e4c='unchanged'):(_0x16dc80=_0x996899(0x1f1),_0x2f4e4c=_0x996899(0x1fa));}_0x1f5b21[_0x996899(0x1ff)]({'sqlCode':_0x2f5417['sqlCode'],'sqlName':_0x2f5417[_0x996899(0x1d7)],'filePath':_0x233a3b,'status':_0x16dc80,'reason':_0x2f4e4c});}return{'method':_0x996899(0x1d4),'url':_0x996899(0x1cb),'body':{'appCode':_0x314e45[_0x996899(0x1f4)],'sqlCode':_0x314e45[_0x996899(0x1ca)](_0x996899(0x1cc))||null,'sqlName':_0x314e45['str']('name')||null,'files':_0x1f5b21},'description':_0x996899(0x1c2)+_0x1f5b21['length']+_0x996899(0x1ee)+_0x2843dd[_0x996899(0x1c9)]};},async 'execute'(_0x296912){const _0x566e5d=a128_0x426776,_0x399a55=loadSqlProjectConfig(_0x296912[_0x566e5d(0x1f4)]),_0x4825b5=await readSqlLockFile(_0x399a55[_0x566e5d(0x1cf)]),{lockData:_0x464969,appLock:_0x4523a1}=ensureSqlLockScope(_0x4825b5??createEmptySqlLock(),_0x399a55['appCode'],_0x399a55[_0x566e5d(0x1e2)],_0x566e5d(0x1f9)),_0x2935ee=_0x296912[_0x566e5d(0x1e5)](_0x566e5d(0x200)),_0x4da222=await fetchAllSqlQueries(_0x296912[_0x566e5d(0x1f4)],{'sqlCode':_0x296912[_0x566e5d(0x1ca)](_0x566e5d(0x1cc))||undefined,'sqlName':_0x296912['str'](_0x566e5d(0x1f8))||undefined});if(_0x4da222[_0x566e5d(0x1da)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x566e5d(0x1e6)};const _0x4cd920=[],_0x6b4a17=[];for(const _0x1c5ae6 of _0x4da222){try{_0x4cd920[_0x566e5d(0x1ff)](await ensureSqlContent(_0x1c5ae6));}catch(_0x22dab2){_0x6b4a17[_0x566e5d(0x1ff)]({'sqlCode':_0x1c5ae6[_0x566e5d(0x1d0)],'error':_0x22dab2 instanceof Error?_0x22dab2[_0x566e5d(0x1bf)]:String(_0x22dab2)});}}if(_0x2935ee&&!_0x296912[_0x566e5d(0x1db)]){let _0x59e2f4=![];for(const _0x156be2 of _0x4cd920){const _0x310903=detectModeFromSql(_0x156be2),_0x281c70=_0x156be2[_0x566e5d(0x1ea)]?await getDbName(_0x296912[_0x566e5d(0x1f4)],Number(_0x156be2[_0x566e5d(0x1ea)]))[_0x566e5d(0x1dc)](()=>undefined):undefined,_0x243621=buildLocalSqlFileContent({'sqlCode':_0x156be2[_0x566e5d(0x1d0)],'sqlName':_0x156be2['sqlName'],'dbId':_0x156be2[_0x566e5d(0x1ea)]},ensureRemoteSqlContent(_0x156be2),{'dbName':_0x281c70,'mode':_0x310903,'syncedAt':new Date()['toISOString'](),'description':_0x156be2[_0x566e5d(0x1d8)]}),_0x20e579=resolveLocalSqlFilePath(_0x399a55,_0x156be2[_0x566e5d(0x1d0)],buildSqlLockEntry(_0x156be2,ensureRemoteSqlContent(_0x156be2),'',{'dbName':_0x281c70}));if(await fileExists(_0x20e579)){const _0x4638df=await readFile(_0x20e579,'utf8');if(!isEquivalentPulledSqlFile(_0x4638df,_0x243621,_0x310903)){_0x59e2f4=!![];break;}}}if(_0x59e2f4){const _0x53a33c=await confirmForceOverwrite(_0x566e5d(0x1c8));if(!_0x53a33c)throw CliErrors[_0x566e5d(0x1d6)](_0x566e5d(0x1d2));}}const _0x408e4d=cloneSqlLockData(_0x464969),_0x48e7f2=_0x408e4d[_0x566e5d(0x1d9)][_0x399a55[_0x566e5d(0x1f4)]],_0x1f7bc0=[],_0x3f1425=[];for(const _0x34fa30 of _0x4cd920){const _0x21dfb6=_0x48e7f2[_0x566e5d(0x1e7)][_0x34fa30[_0x566e5d(0x1d0)]],_0x1da45a=ensureRemoteSqlContent(_0x34fa30),_0x599560=detectModeFromSql(_0x34fa30),_0x22be8c=_0x34fa30[_0x566e5d(0x1ea)]?await getDbName(_0x296912[_0x566e5d(0x1f4)],Number(_0x34fa30['dbId']))[_0x566e5d(0x1dc)](()=>undefined):undefined,_0x54875a=buildLocalSqlFileContent({'sqlCode':_0x34fa30[_0x566e5d(0x1d0)],'sqlName':_0x34fa30[_0x566e5d(0x1d7)],'dbId':_0x34fa30['dbId']},_0x1da45a,{'dbName':_0x22be8c,'mode':_0x599560,'syncedAt':new Date()[_0x566e5d(0x1f3)](),'description':_0x34fa30[_0x566e5d(0x1d8)]}),_0x547d03=buildSqlLockEntry(_0x34fa30,_0x1da45a,computeSqlContentHash(_0x54875a),{'dbName':_0x22be8c}),_0x5d91bd=_0x547d03[_0x566e5d(0x1e8)],_0xa973a9=join(_0x399a55[_0x566e5d(0x1c9)],_0x5d91bd);try{if(await fileExists(_0xa973a9)){const _0xabac26=await readFile(_0xa973a9,_0x566e5d(0x1e9));if(isEquivalentPulledSqlFile(_0xabac26,_0x54875a,_0x599560)){_0x3f1425[_0x566e5d(0x1ff)]({'sqlCode':_0x34fa30[_0x566e5d(0x1d0)],'reason':'unchanged'}),_0x48e7f2['sqls'][_0x34fa30[_0x566e5d(0x1d0)]]={..._0x547d03,'hash':computeSqlContentHash(_0xabac26),'path':_0x5d91bd};continue;}if(!_0x2935ee){_0x3f1425[_0x566e5d(0x1ff)]({'sqlCode':_0x34fa30[_0x566e5d(0x1d0)],'reason':_0x566e5d(0x1fd)});continue;}}const _0x43c056=_0x21dfb6?.[_0x566e5d(0x1e8)]?join(_0x399a55['sqlRootDir'],_0x21dfb6[_0x566e5d(0x1e8)]):undefined;_0x43c056&&_0x43c056!==_0xa973a9&&await fileExists(_0x43c056)&&await rm(_0x43c056,{'force':!![]}),await ensureParentDirectory(_0xa973a9),await writeFile(_0xa973a9,_0x54875a,_0x566e5d(0x1e9)),_0x48e7f2[_0x566e5d(0x1e7)][_0x34fa30[_0x566e5d(0x1d0)]]={..._0x547d03,'path':_0x5d91bd},_0x1f7bc0['push']({'sqlCode':_0x34fa30[_0x566e5d(0x1d0)],'filePath':_0xa973a9});}catch(_0x3b3797){_0x6b4a17['push']({'sqlCode':_0x34fa30[_0x566e5d(0x1d0)],'error':_0x3b3797 instanceof Error?_0x3b3797['message']:String(_0x3b3797)});}}return _0x48e7f2[_0x566e5d(0x1fb)]=new Date()[_0x566e5d(0x1f3)](),await writeSqlLockFile(_0x399a55[_0x566e5d(0x1cf)],_0x408e4d),{'ok':_0x6b4a17[_0x566e5d(0x1da)]===0x0,'data':{'pulled':_0x1f7bc0,'skipped':_0x3f1425,'failed':_0x6b4a17},'message':_0x566e5d(0x1c3)+_0x1f7bc0[_0x566e5d(0x1da)]+'\x20written,\x20'+_0x3f1425[_0x566e5d(0x1da)]+_0x566e5d(0x1fe)+_0x6b4a17[_0x566e5d(0x1da)]+'\x20failed'};}};function detectModeFromSql(_0x4de8b3){const _0x29ff11=a128_0x426776,_0x5dd9ae=ensureRemoteSqlContent(_0x4de8b3),_0x310063=stripLocalSqlMetadata(_0x5dd9ae,_0x29ff11(0x1ed))[_0x29ff11(0x1c1)]();if(/^<(select|insert|update|delete)\b/i[_0x29ff11(0x1f6)](_0x310063))return'mybatisXml';return _0x29ff11(0x1eb);}function isEquivalentPulledSqlFile(_0x5042b6,_0x22aa27,_0x279f13){return normalizePullComparableContent(_0x5042b6,_0x279f13)===normalizePullComparableContent(_0x22aa27,_0x279f13);}function normalizePullComparableContent(_0x245b05,_0x3ec59f){const _0x3c26cf=a128_0x426776,_0x51beaf=_0x245b05[_0x3c26cf(0x1ce)](/\r\n/g,'\x0a')[_0x3c26cf(0x1f7)]('\x0a'),_0xf49163=_0x51beaf['filter'](_0x1cc131=>!isSyncedAtMetadataLine(_0x1cc131,_0x3ec59f));return _0xf49163[_0x3c26cf(0x1ef)]('\x0a');}function isSyncedAtMetadataLine(_0x19e265,_0x56156c){const _0x169f76=a128_0x426776;if(_0x56156c===_0x169f76(0x1ed))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x19e265);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x169f76(0x1f6)](_0x19e265);}
|
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_0x1a9626=a129_0x43de;(function(_0x596053,_0x5e915a){const _0x56a083=a129_0x43de,_0x591bf5=_0x596053();while(!![]){try{const _0x1df8dc=-parseInt(_0x56a083(0x151))/0x1+-parseInt(_0x56a083(0x164))/0x2+parseInt(_0x56a083(0x132))/0x3*(-parseInt(_0x56a083(0x137))/0x4)+-parseInt(_0x56a083(0x14b))/0x5+parseInt(_0x56a083(0x147))/0x6+parseInt(_0x56a083(0x12f))/0x7+parseInt(_0x56a083(0x169))/0x8*(parseInt(_0x56a083(0x141))/0x9);if(_0x1df8dc===_0x5e915a)break;else _0x591bf5['push'](_0x591bf5['shift']());}catch(_0x23dcc2){_0x591bf5['push'](_0x591bf5['shift']());}}}(a129_0x414d,0xeaa8b));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_0x414d(){const _0x3e0da8=['sqlCode','Local\x20SQL\x20not\x20found:\x20','\x22\x20for\x20sqlCode\x20','remoteId','No\x20local\x20SQL\x20files\x20found.','sqls','high-risk-write','170908WWVTBz','toISOString','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','get','hash','1520eUjHPT','relativePath','Local\x20directory\x20\x22','\x20failed','sqlRootDir','utf8','11951618IPEPJG','exec','Push\x20local\x20SQL\x20files\x20to\x20remote','85233oVZysp','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','str','startsWith','set','76GOcpad','push','validation','isFinite','dbDirectory','replace','appCode','map','filePath','version','42921gVRWZG','sqlcode','bool','filter','sqlRoot','length','6013938MumycC','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','has','lockFilePath','7121775eMbUaX','path','entries','Would\x20push\x20','boolean','\x20skipped,\x20','605026IYprRc','sqlName','projectRoot','catch','join','force','mode','Push\x20complete:\x20','dbName','dbId','lastSync','POST'];a129_0x414d=function(){return _0x3e0da8;};return a129_0x414d();}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(_0x2252a8,_0x3ce0fe,_0x549f5b){const _0x3b143c=a129_0x43de,_0x2ac323=await scanLocalSqlQueries(_0x2252a8),_0x1cda7e=new Map();for(const _0x132429 of _0x2ac323){if(_0x549f5b&&_0x132429[_0x3b143c(0x15d)]!==_0x549f5b)continue;const _0x2583dd=_0x1cda7e[_0x3b143c(0x167)](_0x132429[_0x3b143c(0x15d)])??[];_0x2583dd[_0x3b143c(0x138)](_0x132429),_0x1cda7e[_0x3b143c(0x136)](_0x132429[_0x3b143c(0x15d)],_0x2583dd);}if(_0x549f5b&&!_0x1cda7e[_0x3b143c(0x149)](_0x549f5b))throw CliErrors['validation'](_0x3b143c(0x15e)+_0x549f5b);const _0x29e7d3=[];for(const [_0x2c66f6,_0x11bd94]of _0x1cda7e[_0x3b143c(0x14d)]()){if(_0x11bd94['length']===0x1){_0x29e7d3[_0x3b143c(0x138)](_0x11bd94[0x0]);continue;}const _0xf9c57e=_0x3ce0fe[_0x3b143c(0x162)][_0x2c66f6],_0x31f081=_0xf9c57e?.[_0x3b143c(0x14c)],_0x5c4761=_0x31f081?_0x11bd94[_0x3b143c(0x144)](_0x3129fd=>_0x3129fd['relativePath']!==_0x31f081):_0x11bd94;if(_0xf9c57e&&_0x5c4761[_0x3b143c(0x146)]===0x1){_0x29e7d3[_0x3b143c(0x138)](_0x5c4761[0x0]);continue;}throw CliErrors[_0x3b143c(0x139)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x2c66f6+_0x3b143c(0x133));}return _0x29e7d3;}export const sqlPush={'service':'sql','command':a129_0x1a9626(0x138),'description':a129_0x1a9626(0x131),'risk':a129_0x1a9626(0x163),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a129_0x1a9626(0x156),'type':a129_0x1a9626(0x14f),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x11a26e){const _0x145e19=a129_0x1a9626,_0x84bd31=loadSqlProjectConfig(_0x11a26e[_0x145e19(0x13d)]),_0x3a63b0=await readSqlLockFile(_0x84bd31[_0x145e19(0x14a)]),{appLock:_0x5398a4}=ensureSqlLockScope(_0x3a63b0??createEmptySqlLock(),_0x11a26e['appCode'],_0x84bd31[_0x145e19(0x145)],_0x145e19(0x138)),_0x16f6c7=await getTargetSqlQueries(_0x84bd31,_0x5398a4,_0x11a26e[_0x145e19(0x134)]('sqlcode')||undefined),_0x59e677=[];for(const _0x14d3a4 of _0x16f6c7){const _0x595dec=await computeSqlFileHash(_0x14d3a4[_0x145e19(0x13f)]),_0x39acfc=_0x5398a4[_0x145e19(0x162)][_0x14d3a4[_0x145e19(0x15d)]],_0x3be6c2=!!_0x39acfc&&(_0x39acfc['path']!==_0x14d3a4[_0x145e19(0x16a)]||!!_0x14d3a4[_0x145e19(0x152)]&&_0x39acfc[_0x145e19(0x152)]!==_0x14d3a4[_0x145e19(0x152)]);if(!_0x11a26e[_0x145e19(0x143)](_0x145e19(0x156))&&_0x39acfc&&_0x39acfc['hash']===_0x595dec&&!_0x3be6c2)continue;_0x59e677[_0x145e19(0x138)](_0x14d3a4[_0x145e19(0x15d)]);}return{'method':_0x145e19(0x15c),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x59e677,'appCode':_0x11a26e[_0x145e19(0x13d)]},'description':_0x145e19(0x14e)+_0x59e677[_0x145e19(0x146)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x1546d2){const _0x413781=a129_0x1a9626,_0x1d7a6a=loadSqlProjectConfig(_0x1546d2[_0x413781(0x13d)]),_0x5413b6=await readSqlLockFile(_0x1d7a6a[_0x413781(0x14a)]),{lockData:_0x20a542,appLock:_0x3e75f7}=ensureSqlLockScope(_0x5413b6??createEmptySqlLock(),_0x1546d2[_0x413781(0x13d)],_0x1d7a6a['sqlRoot'],_0x413781(0x138)),_0x9cdea4=await getTargetSqlQueries(_0x1d7a6a,_0x3e75f7,_0x1546d2[_0x413781(0x134)](_0x413781(0x142))||undefined);if(_0x9cdea4[_0x413781(0x146)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x413781(0x161)};const _0x209b45=[],_0x51fcba=[],_0x5eea97=[];for(const _0x326312 of _0x9cdea4){const _0x70638c=_0x3e75f7['sqls'][_0x326312[_0x413781(0x15d)]];if(!_0x70638c){_0x5eea97[_0x413781(0x138)]({'sqlCode':_0x326312[_0x413781(0x15d)],'error':_0x413781(0x148)});continue;}try{const _0x377fd5=await computeSqlFileHash(_0x326312[_0x413781(0x13f)]),_0x4091f7=_0x70638c[_0x413781(0x14c)]!==_0x326312[_0x413781(0x16a)]||!!_0x326312[_0x413781(0x152)]&&_0x70638c['sqlName']!==_0x326312[_0x413781(0x152)];if(!_0x1546d2[_0x413781(0x143)](_0x413781(0x156))&&_0x70638c[_0x413781(0x168)]===_0x377fd5&&!_0x4091f7){_0x51fcba[_0x413781(0x138)]({'sqlCode':_0x326312[_0x413781(0x15d)],'reason':'unchanged'});continue;}if(_0x70638c[_0x413781(0x140)]==null){_0x5eea97[_0x413781(0x138)]({'sqlCode':_0x326312['sqlCode'],'error':_0x413781(0x166)});continue;}const _0x169409=await readFile(_0x326312['filePath'],_0x413781(0x12e)),_0xe933fb=stripLocalSqlMetadata(_0x169409,_0x326312[_0x413781(0x157)]),_0x5b6b32=_0x326312[_0x413781(0x152)]||_0x70638c[_0x413781(0x152)],_0x5e6ffd=await resolveTargetDbBinding(_0x1546d2['appCode'],_0x326312,_0x70638c),_0x4c5df0=await updateSqlQuery({'id':_0x70638c[_0x413781(0x160)],'appCode':_0x1546d2[_0x413781(0x13d)],'sqlCode':_0x326312[_0x413781(0x15d)],'sqlName':_0x5b6b32,'dbId':_0x5e6ffd[_0x413781(0x15a)],'version':_0x70638c[_0x413781(0x140)],'sqlContent':_0xe933fb,'sqlConfig':_0x70638c['sqlConfig']??undefined}),_0x502802=_0x4c5df0[_0x413781(0x15a)]?await getDbName(_0x1546d2[_0x413781(0x13d)],Number(_0x4c5df0['dbId']))[_0x413781(0x154)](()=>_0x5e6ffd[_0x413781(0x159)]):_0x5e6ffd['dbName'];_0x3e75f7[_0x413781(0x162)][_0x326312[_0x413781(0x15d)]]={...buildSqlLockEntry(_0x4c5df0,_0xe933fb,_0x377fd5,{'dbName':_0x502802}),'path':_0x326312['relativePath'],'mode':_0x70638c[_0x413781(0x157)]},await archivePreviousSqlFileIfNeeded(_0x1d7a6a,_0x70638c[_0x413781(0x14c)],_0x326312[_0x413781(0x16a)]),_0x209b45[_0x413781(0x138)]({'sqlCode':_0x326312['sqlCode'],'remoteId':_0x70638c['remoteId']});}catch(_0x41f859){_0x5eea97[_0x413781(0x138)]({'sqlCode':_0x326312[_0x413781(0x15d)],'error':_0x41f859 instanceof Error?_0x41f859['message']:String(_0x41f859)});}}return _0x3e75f7[_0x413781(0x15b)]=new Date()['toISOString'](),await writeSqlLockFile(_0x1d7a6a['lockFilePath'],_0x20a542),{'ok':_0x5eea97['length']===0x0,'data':{'pushed':_0x209b45,'skipped':_0x51fcba,'failed':_0x5eea97},'message':_0x413781(0x158)+_0x209b45[_0x413781(0x146)]+'\x20pushed,\x20'+_0x51fcba[_0x413781(0x146)]+_0x413781(0x150)+_0x5eea97[_0x413781(0x146)]+_0x413781(0x16c)};}};async function archivePreviousSqlFileIfNeeded(_0xcc480,_0x375586,_0x19a62d){const _0x45fd2a=a129_0x1a9626;if(!_0x375586||_0x375586===_0x19a62d)return;const _0x26e150=join(_0xcc480[_0x45fd2a(0x16d)],_0x375586);if(!await fileExists(_0x26e150))return;const _0x5e32c5=await moveToTrash(_0xcc480[_0x45fd2a(0x153)],_0xcc480['trashDir'],_0x26e150);await cleanupEmptyDirectories(dirname(_0x26e150),_0xcc480[_0x45fd2a(0x16d)]),void _0x5e32c5;}function a129_0x43de(_0x37cfe7,_0x43cc92){_0x37cfe7=_0x37cfe7-0x12e;const _0x414d51=a129_0x414d();let _0x43dedc=_0x414d51[_0x37cfe7];return _0x43dedc;}async function moveToTrash(_0x3ebb6c,_0x5c6d6c,_0xcba139){const _0x3c2fe4=a129_0x1a9626,_0x20f506=new Date()[_0x3c2fe4(0x165)]()[_0x3c2fe4(0x13c)](/[:.]/g,'-'),_0x17fec7=relative(_0x3ebb6c,_0xcba139),_0x29d506=join(_0x5c6d6c,_0x20f506,_0x17fec7);return await mkdir(dirname(_0x29d506),{'recursive':!![]}),await rename(_0xcba139,_0x29d506),_0x29d506;}async function cleanupEmptyDirectories(_0x1b5588,_0x50bd12){const _0xdeffe7=a129_0x1a9626;let _0x4a6f9a=resolve(_0x1b5588);const _0x302e4d=resolve(_0x50bd12);while(_0x4a6f9a[_0xdeffe7(0x135)](''+_0x302e4d+sep)||_0x4a6f9a===_0x302e4d){if(_0x4a6f9a===_0x302e4d)return;try{const _0x5243ee=await readdir(_0x4a6f9a);if(_0x5243ee['length']>0x0)return;await rmdir(_0x4a6f9a);}catch{return;}_0x4a6f9a=dirname(_0x4a6f9a);}}async function resolveTargetDbBinding(_0x53b072,_0x41d99d,_0x1a1ed1){const _0x3ec8b4=a129_0x1a9626,_0x5e01f4=_0x41d99d[_0x3ec8b4(0x13b)];if(!_0x5e01f4)return{'dbId':_0x1a1ed1[_0x3ec8b4(0x15a)],'dbName':_0x1a1ed1[_0x3ec8b4(0x159)]};const _0x42cfdc=buildDbDirectoryName(_0x1a1ed1['dbName'],_0x1a1ed1[_0x3ec8b4(0x15a)]);if(_0x5e01f4===_0x42cfdc)return{'dbId':_0x1a1ed1[_0x3ec8b4(0x15a)],'dbName':_0x1a1ed1[_0x3ec8b4(0x159)]};const _0x493f37=parseExplicitDbDirectory(_0x5e01f4);if(_0x493f37!=null)return{'dbId':_0x493f37,'dbName':await getDbName(_0x53b072,_0x493f37)[_0x3ec8b4(0x154)](()=>undefined)};const _0x209652=await listDatabases(_0x53b072),_0x53c4d4=_0x209652[_0x3ec8b4(0x144)](_0x1c7518=>buildDbDirectoryName(_0x1c7518[_0x3ec8b4(0x159)],_0x1c7518['dbId'])===_0x5e01f4);if(_0x53c4d4[_0x3ec8b4(0x146)]===0x1)return{'dbId':_0x53c4d4[0x0][_0x3ec8b4(0x15a)],'dbName':_0x53c4d4[0x0][_0x3ec8b4(0x159)]};if(_0x53c4d4[_0x3ec8b4(0x146)]===0x0)throw CliErrors[_0x3ec8b4(0x139)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x5e01f4+_0x3ec8b4(0x15f)+_0x41d99d[_0x3ec8b4(0x15d)]+'.');const _0x322ed0=_0x53c4d4[_0x3ec8b4(0x13e)](_0x4c0a7a=>_0x4c0a7a['dbName']+'\x20('+_0x4c0a7a[_0x3ec8b4(0x15a)]+')')[_0x3ec8b4(0x155)](',\x20');throw CliErrors[_0x3ec8b4(0x139)](_0x3ec8b4(0x16b)+_0x5e01f4+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x41d99d[_0x3ec8b4(0x15d)]+':\x20'+_0x322ed0);}function parseExplicitDbDirectory(_0x59351d){const _0x2e7725=a129_0x1a9626,_0x2d9869=/^db-(\d+)$/[_0x2e7725(0x130)](_0x59351d);if(!_0x2d9869)return null;const _0xa7c2b7=Number(_0x2d9869[0x1]);return Number[_0x2e7725(0x13a)](_0xa7c2b7)&&_0xa7c2b7>0x0?_0xa7c2b7:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a130_0x4321(_0xbdb7d5,_0x4ef00e){_0xbdb7d5=_0xbdb7d5-0x135;const _0xb5928d=a130_0xb592();let _0x432180=_0xb5928d[_0xbdb7d5];return _0x432180;}const a130_0x2c50c1=a130_0x4321;(function(_0x274863,_0x225482){const _0x461ee3=a130_0x4321,_0x3716b2=_0x274863();while(!![]){try{const _0x3f9078=-parseInt(_0x461ee3(0x149))/0x1+-parseInt(_0x461ee3(0x141))/0x2+parseInt(_0x461ee3(0x139))/0x3+parseInt(_0x461ee3(0x140))/0x4+-parseInt(_0x461ee3(0x13b))/0x5*(parseInt(_0x461ee3(0x136))/0x6)+-parseInt(_0x461ee3(0x14a))/0x7*(-parseInt(_0x461ee3(0x146))/0x8)+-parseInt(_0x461ee3(0x142))/0x9*(-parseInt(_0x461ee3(0x147))/0xa);if(_0x3f9078===_0x225482)break;else _0x3716b2['push'](_0x3716b2['shift']());}catch(_0x8449ee){_0x3716b2['push'](_0x3716b2['shift']());}}}(a130_0xb592,0x37620));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=['`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.',a130_0x2c50c1(0x143)][a130_0x2c50c1(0x135)]('\x0a');export const sqlSave={'service':a130_0x2c50c1(0x13c),'command':a130_0x2c50c1(0x14b),'description':'Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','risk':a130_0x2c50c1(0x138),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a130_0x2c50c1(0x13d),'type':a130_0x2c50c1(0x137),'required':!![],'description':a130_0x2c50c1(0x145)},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':'string','description':a130_0x2c50c1(0x13a)},{'name':'db','type':a130_0x2c50c1(0x137),'description':a130_0x2c50c1(0x13e)},{'name':a130_0x2c50c1(0x144),'type':a130_0x2c50c1(0x137),'description':a130_0x2c50c1(0x148)}],async 'validate'(){const _0x1419cc=a130_0x2c50c1;throw CliErrors[_0x1419cc(0x13f)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x3b0793=a130_0x2c50c1;throw CliErrors[_0x3b0793(0x13f)](SQL_SAVE_DEPRECATED_HINT);}};function a130_0xb592(){const _0x1ff16c=['995azXexC','sql','file','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','validation','844032qtrmfo','405794aezxLK','135yEclPe','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`.','description','Path\x20to\x20the\x20SQL\x20file','8sDOFCq','271930owaZML','Query\x20description','399702ngiJvj','417991yNzfDh','save','join','4614EkFDPC','string','write','911586WEsHeU','SQL\x20query\x20display\x20name'];a130_0xb592=function(){return _0x1ff16c;};return a130_0xb592();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a131_0x14f7c2=a131_0x3b41;function a131_0x3b41(_0x2c0283,_0x440b48){_0x2c0283=_0x2c0283-0x98;const _0x1362bf=a131_0x1362();let _0x3b41a6=_0x1362bf[_0x2c0283];return _0x3b41a6;}(function(_0x35bf51,_0x4c0a5a){const _0x5244b3=a131_0x3b41,_0x2092fa=_0x35bf51();while(!![]){try{const _0x3592c8=parseInt(_0x5244b3(0xb5))/0x1+parseInt(_0x5244b3(0xc2))/0x2*(parseInt(_0x5244b3(0xc4))/0x3)+-parseInt(_0x5244b3(0xa3))/0x4*(parseInt(_0x5244b3(0xb7))/0x5)+parseInt(_0x5244b3(0xae))/0x6+parseInt(_0x5244b3(0xa8))/0x7*(-parseInt(_0x5244b3(0xc1))/0x8)+parseInt(_0x5244b3(0x9f))/0x9*(-parseInt(_0x5244b3(0xac))/0xa)+-parseInt(_0x5244b3(0x99))/0xb*(parseInt(_0x5244b3(0xb1))/0xc);if(_0x3592c8===_0x4c0a5a)break;else _0x2092fa['push'](_0x2092fa['shift']());}catch(_0x526b1e){_0x2092fa['push'](_0x2092fa['shift']());}}}(a131_0x1362,0x51245));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a131_0x14f7c2(0x9b);export function buildSqlLockEntry(_0x51583e,_0x3dfc2b,_0x1f7d8c,_0x63fbde){const _0x576f00=a131_0x14f7c2,_0x172a02=detectSqlMode(_0x3dfc2b);return{'path':buildSqlRelativePath(_0x51583e['sqlCode'],_0x51583e[_0x576f00(0xc5)],_0x63fbde?.[_0x576f00(0xbd)],_0x172a02,_0x51583e['dbId']),'hash':_0x1f7d8c,'remoteId':_0x51583e['id'],'version':_0x51583e[_0x576f00(0xbe)],'dbId':Number(_0x51583e[_0x576f00(0xa4)]),'dbName':_0x63fbde?.['dbName'],'sqlName':_0x51583e[_0x576f00(0xc5)],'sqlConfig':_0x51583e[_0x576f00(0xa5)]??undefined,'mode':_0x172a02};}export function cloneSqlLockData(_0x140d63){const _0x276abd=a131_0x14f7c2;return{'apps':Object[_0x276abd(0x9a)](Object[_0x276abd(0xab)](_0x140d63['apps'])[_0x276abd(0xc7)](([_0x56b5c2,_0x13bbe8])=>[_0x56b5c2,{'sqlRoot':_0x13bbe8[_0x276abd(0xba)],'lastSync':_0x13bbe8[_0x276abd(0xbf)],'sqls':{..._0x13bbe8[_0x276abd(0xb3)]}}]))};}export function ensureRemoteSqlContent(_0x46df7b){const _0x4f806f=a131_0x14f7c2;return _0x46df7b[_0x4f806f(0x98)]??'';}export function buildLocalSqlFileContent(_0x26785b,_0x46738a,_0x26c75d){const _0x48823d=a131_0x14f7c2,_0x276755=_0x26c75d?.['mode']??detectSqlMode(_0x46738a),_0x968cb5=stripLocalSqlMetadata(_0x46738a,_0x276755)[_0x48823d(0xaa)](),_0x4699c9=[...buildMetadataHeaderLines({'sqlCode':_0x26785b['sqlCode'],'sqlName':_0x26785b[_0x48823d(0xc5)],'dbId':_0x26785b[_0x48823d(0xa4)],'dbName':_0x26c75d?.['dbName'],'mode':_0x276755,'syncedAt':_0x26c75d?.[_0x48823d(0xaf)],'description':_0x26c75d?.[_0x48823d(0xa9)]},_0x276755),'',_0x968cb5],_0x45cb93=_0x4699c9[_0x48823d(0x9c)]('\x0a');return _0x45cb93['endsWith']('\x0a')?_0x45cb93:_0x45cb93+'\x0a';}function a131_0x1362(){const _0x3e4303=['question','sqlCode','mybatisXml','4EnfIpU','dbId','sqlConfig','split','stdin','28tLQuvX','description','trim','entries','8980EsXAjr','replace','951960DNdkVh','syncedAt','length','48kaJAFX','close','sqls','push','342941UHnnEQ','filter','24470qUsbmR','path','toLowerCase','sqlRoot','trimStart','yes','dbName','version','lastSync','--\x20@lovrabet.','523888fQUKhn','53188vtpuDi','mode','48RhihtG','sqlName','<!--\x20@lovrabet.','map','sqlContent','360932Yxstpc','fromEntries','.rabetbase/sql','join','stderr','test','1971sbNoVf'];a131_0x1362=function(){return _0x3e4303;};return a131_0x1362();}export function stripLocalSqlMetadata(_0x43cda8,_0xb58f6f){const _0x1a40c8=a131_0x14f7c2,_0x6c3df5=_0x43cda8[_0x1a40c8(0xad)](/\r\n/g,'\x0a')[_0x1a40c8(0xa6)]('\x0a'),_0x35ef6f=[];let _0xe06b05=0x0;if(_0xb58f6f===_0x1a40c8(0xa2))while(_0xe06b05<_0x6c3df5[_0x1a40c8(0xb0)]){const _0x45a4e0=_0x6c3df5[_0xe06b05]??'';if(/^\s*<!--\s*@lovrabet\./[_0x1a40c8(0x9e)](_0x45a4e0)){_0xe06b05++;continue;}if(_0x45a4e0[_0x1a40c8(0xaa)]()===''&&_0xe06b05>0x0){_0xe06b05++;continue;}break;}else while(_0xe06b05<_0x6c3df5[_0x1a40c8(0xb0)]){const _0x15cf1e=_0x6c3df5[_0xe06b05]??'';if(/^\s*--\s*@lovrabet\./[_0x1a40c8(0x9e)](_0x15cf1e)){_0xe06b05++;continue;}if(_0x15cf1e[_0x1a40c8(0xaa)]()===''&&_0xe06b05>0x0){_0xe06b05++;continue;}break;}for(;_0xe06b05<_0x6c3df5[_0x1a40c8(0xb0)];_0xe06b05++){_0x35ef6f[_0x1a40c8(0xb4)](_0x6c3df5[_0xe06b05]);}return _0x35ef6f['join']('\x0a')[_0x1a40c8(0xbb)]();}export function resolveSqlMode(_0x1610a3,_0x2e403b){const _0x5c9a38=a131_0x14f7c2;if(_0x2e403b?.[_0x5c9a38(0xc3)])return _0x2e403b['mode'];return detectSqlMode(_0x1610a3);}export function resolveSqlFileName(_0x5e25fc,_0x49262f,_0x31a48e){const _0x8b4c7f=a131_0x14f7c2;if(_0x31a48e?.[_0x8b4c7f(0xb8)])return _0x31a48e['path'];if(_0x31a48e?.[_0x8b4c7f(0xc5)]||_0x31a48e?.[_0x8b4c7f(0xbd)])return buildSqlRelativePath(_0x5e25fc,_0x31a48e?.[_0x8b4c7f(0xc5)],_0x31a48e?.[_0x8b4c7f(0xbd)],resolveSqlMode(_0x49262f,_0x31a48e),_0x31a48e?.['dbId']);return buildDefaultSqlFileName(_0x5e25fc,resolveSqlMode(_0x49262f,_0x31a48e));}export function resolveSqlLocalDir(_0x3a044b,_0x4924a9){return join(_0x3a044b,SQL_LOCAL_REL_DIR,_0x4924a9);}export async function confirmForceOverwrite(_0x4fb7fd){const _0x399d38=a131_0x14f7c2,_0x581c5f=createInterface({'input':process[_0x399d38(0xa7)],'output':process[_0x399d38(0x9d)]}),_0x3f0ecf=await new Promise(_0xa56b81=>{const _0x31d9dd=_0x399d38;_0x581c5f[_0x31d9dd(0xa0)](_0x4fb7fd+'\x20[y/N]\x20',_0xa56b81);});return _0x581c5f[_0x399d38(0xb2)](),['y',_0x399d38(0xbc)]['includes'](_0x3f0ecf['trim']()[_0x399d38(0xb9)]());}export function findSqlLockScope(_0x287b84,_0x5b3ba9){return _0x287b84['apps'][_0x5b3ba9];}function buildMetadataHeaderLines(_0x436518,_0x274038){const _0x253310=a131_0x14f7c2,_0xc10d4d=[[_0x253310(0xa1),_0x436518['sqlCode']],[_0x253310(0xc5),_0x436518[_0x253310(0xc5)]],[_0x253310(0xa4),_0x436518[_0x253310(0xa4)]],[_0x253310(0xbd),_0x436518[_0x253310(0xbd)]],[_0x253310(0xc3),_0x436518[_0x253310(0xc3)]],[_0x253310(0xaf),_0x436518[_0x253310(0xaf)]],['description',_0x436518['description']]];if(_0x274038===_0x253310(0xa2))return _0xc10d4d[_0x253310(0xb6)](([,_0x568500])=>_0x568500!==undefined&&_0x568500!==null&&String(_0x568500)[_0x253310(0xaa)]()!=='')[_0x253310(0xc7)](([_0x48b9d5,_0x18ff88])=>_0x253310(0xc6)+_0x48b9d5+':\x20'+String(_0x18ff88)+'\x20-->');return _0xc10d4d['filter'](([,_0x28d3e7])=>_0x28d3e7!==undefined&&_0x28d3e7!==null&&String(_0x28d3e7)[_0x253310(0xaa)]()!=='')[_0x253310(0xc7)](([_0x5df9ce,_0x51718c])=>_0x253310(0xc0)+_0x5df9ce+':\x20'+String(_0x51718c));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0x103772=a132_0x2803;(function(_0x564689,_0x450f21){const _0x458348=a132_0x2803,_0x43ec9a=_0x564689();while(!![]){try{const _0xf835ef=-parseInt(_0x458348(0x13a))/0x1+-parseInt(_0x458348(0x139))/0x2+-parseInt(_0x458348(0x145))/0x3+-parseInt(_0x458348(0x146))/0x4+parseInt(_0x458348(0x153))/0x5*(parseInt(_0x458348(0x141))/0x6)+-parseInt(_0x458348(0x13d))/0x7+parseInt(_0x458348(0x148))/0x8*(parseInt(_0x458348(0x150))/0x9);if(_0xf835ef===_0x450f21)break;else _0x43ec9a['push'](_0x43ec9a['shift']());}catch(_0x5777f8){_0x43ec9a['push'](_0x43ec9a['shift']());}}}(a132_0x17eb,0x5e586));function a132_0x2803(_0x50298c,_0x17c369){_0x50298c=_0x50298c-0x131;const _0x17ebc7=a132_0x17eb();let _0x280341=_0x17ebc7[_0x50298c];return _0x280341;}function a132_0x17eb(){const _0x138e38=['has','1191189YouktO','2004692aWzfuY','sqls','8ObaGaA','remote','map','sqlCode','boolean','read','\x20remote-only','sql','24458877WXMpVl','tableData','sqlName','24010kqQhuq','lockKey','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','sqlRoot','push','length','lockFilePath','All\x20SQL\x20queries\x20are\x20in\x20sync.','appCode','status','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','1449446SvZVeR','688436goaeQh','\x20modified,\x20','filePath','5046384swliiu','keys','\x20missing,\x20','hash','876WxrSAv','relativePath','\x20unchanged'];a132_0x17eb=function(){return _0x138e38;};return a132_0x17eb();}import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x3b96e8){const _0x179071=a132_0x2803,_0x5da93d=[];let _0x34c2a2=0x1;while(!![]){const _0x5bbc67=await listSqlQueries(_0x3b96e8,{'currentPage':_0x34c2a2,'pageSize':PAGE_SIZE}),_0x2f64e5=_0x5bbc67[_0x179071(0x151)]??[];_0x5da93d['push'](..._0x2f64e5[_0x179071(0x14a)](_0x5a998d=>_0x5a998d[_0x179071(0x14b)]));if(_0x2f64e5['length']===0x0)break;const _0x5a5517=_0x5bbc67['paging']?.['totalCount'];if(_0x5a5517!=null?_0x5da93d[_0x179071(0x133)]>=_0x5a5517:_0x2f64e5[_0x179071(0x133)]<PAGE_SIZE)break;_0x34c2a2++;}return _0x5da93d;}export const sqlStatus={'service':a132_0x103772(0x14f),'command':a132_0x103772(0x137),'description':a132_0x103772(0x155),'risk':a132_0x103772(0x14d),'flags':[{'name':a132_0x103772(0x149),'type':a132_0x103772(0x14c),'description':a132_0x103772(0x138)}],async 'execute'(_0x4c64a4){const _0x879e08=a132_0x103772,_0x3731bf=loadSqlProjectConfig(_0x4c64a4[_0x879e08(0x136)]),_0x1862cb=await readSqlLockFile(_0x3731bf[_0x879e08(0x134)]),{appLock:_0x293e40}=ensureSqlLockScope(_0x1862cb??createEmptySqlLock(),_0x3731bf['appCode'],_0x3731bf[_0x879e08(0x131)],_0x879e08(0x137)),_0x11433f=await scanLocalSqlQueries(_0x3731bf),_0x1b13c0=[],_0x533a7b=[],_0x3cf29d=[],_0x5a179a=[],_0x14283d=new Set(_0x11433f[_0x879e08(0x14a)](_0x424708=>_0x424708[_0x879e08(0x154)]));for(const _0x12a6dd of _0x11433f){const _0x5617e4=await computeSqlFileHash(_0x12a6dd[_0x879e08(0x13c)]),_0x4001b0=_0x293e40[_0x879e08(0x147)][_0x12a6dd['lockKey']],_0x1cd4f9=!!_0x4001b0&&_0x4001b0['path']!==_0x12a6dd[_0x879e08(0x142)],_0x3c268d=!!_0x4001b0&&!!_0x12a6dd[_0x879e08(0x152)]&&_0x4001b0[_0x879e08(0x152)]!==_0x12a6dd[_0x879e08(0x152)];if(!_0x4001b0)_0x1b13c0['push'](_0x12a6dd[_0x879e08(0x154)]);else _0x4001b0[_0x879e08(0x140)]!==_0x5617e4||_0x1cd4f9||_0x3c268d?_0x533a7b[_0x879e08(0x132)](_0x12a6dd[_0x879e08(0x154)]):_0x3cf29d[_0x879e08(0x132)](_0x12a6dd[_0x879e08(0x154)]);}for(const _0x220550 of Object[_0x879e08(0x13e)](_0x293e40[_0x879e08(0x147)])){!_0x14283d[_0x879e08(0x144)](_0x220550)&&_0x5a179a['push'](_0x220550);}const _0x18d51d=[];if(_0x4c64a4['bool'](_0x879e08(0x149))){const _0x3bc8c6=await fetchAllSqlCodes(_0x4c64a4[_0x879e08(0x136)]);for(const _0x1e9bcd of _0x3bc8c6){!_0x14283d[_0x879e08(0x144)](_0x1e9bcd)&&!_0x293e40[_0x879e08(0x147)][_0x1e9bcd]&&_0x18d51d[_0x879e08(0x132)](_0x1e9bcd);}}const _0x997fa9=_0x1b13c0[_0x879e08(0x133)]===0x0&&_0x533a7b[_0x879e08(0x133)]===0x0&&_0x5a179a['length']===0x0&&_0x18d51d[_0x879e08(0x133)]===0x0;return{'ok':!![],'data':{'added':_0x1b13c0,'modified':_0x533a7b,'missing':_0x5a179a,'unchanged':_0x3cf29d,'remoteOnly':_0x18d51d},'message':_0x997fa9?_0x879e08(0x135):_0x1b13c0['length']+'\x20added,\x20'+_0x533a7b['length']+_0x879e08(0x13b)+_0x5a179a[_0x879e08(0x133)]+_0x879e08(0x13f)+_0x3cf29d[_0x879e08(0x133)]+_0x879e08(0x143)+(_0x18d51d[_0x879e08(0x133)]>0x0?',\x20'+_0x18d51d[_0x879e08(0x133)]+_0x879e08(0x14e):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a133_0x4e0889=a133_0x2aa4;(function(_0x3eea81,_0x2be01e){const _0x33f6f7=a133_0x2aa4,_0x1e8f2b=_0x3eea81();while(!![]){try{const _0x5ebf3b=parseInt(_0x33f6f7(0xd9))/0x1+parseInt(_0x33f6f7(0xb3))/0x2+-parseInt(_0x33f6f7(0xd4))/0x3*(-parseInt(_0x33f6f7(0xaf))/0x4)+parseInt(_0x33f6f7(0xcc))/0x5+-parseInt(_0x33f6f7(0xb8))/0x6*(parseInt(_0x33f6f7(0xd2))/0x7)+-parseInt(_0x33f6f7(0xd1))/0x8*(-parseInt(_0x33f6f7(0xbd))/0x9)+parseInt(_0x33f6f7(0xc8))/0xa*(-parseInt(_0x33f6f7(0xc4))/0xb);if(_0x5ebf3b===_0x2be01e)break;else _0x1e8f2b['push'](_0x1e8f2b['shift']());}catch(_0xe54250){_0x1e8f2b['push'](_0x1e8f2b['shift']());}}}(a133_0x1344,0xb15be));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a133_0x2aa4(_0xd1dc08,_0x316274){_0xd1dc08=_0xd1dc08-0xa9;const _0x134463=a133_0x1344();let _0x2aa481=_0x134463[_0xd1dc08];return _0x2aa481;}import{validateSql}from'../../core/sql-validator.js';function a133_0x1344(){const _0x34b337=['Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','fields','schemaWarnings','249983ylwBKu','from','read','split','reason','dbtableConfig','tableName','4WANDch','schemas','str','schema:','1689588JonWqp','sql','validate','Table\x20\x22','push','619026JPGbJo','cwd','valid','message','type','495qXlRtE','parameters','Dataset\x20\x22','file','map','\x22\x20not\x20found\x20in\x20any\x20dataset','Provide\x20--file\x20or\x20--sql','12266727lQcTSz','SQL\x20schema\x20validation','tables','sqlType','20votKEh','get','string','isSelectOnly','1876330SUprks','isArray','appCode','toLowerCase','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','163352hAHJVe','42THTVPN','name','2948142iiJFlr','flagMissing'];a133_0x1344=function(){return _0x34b337;};return a133_0x1344();}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_0x4e0889(0xb4),'command':a133_0x4e0889(0xb5),'description':a133_0x4e0889(0xd6),'risk':a133_0x4e0889(0xaa),'flags':[{'name':a133_0x4e0889(0xc0),'type':a133_0x4e0889(0xca),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a133_0x4e0889(0xb4),'type':'string','description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a133_0x4e0889(0xb0),'type':a133_0x4e0889(0xca),'description':a133_0x4e0889(0xd0)}],async 'execute'(_0x448b49){const _0x4b9753=a133_0x4e0889,_0x3705be=_0x448b49[_0x4b9753(0xb1)](_0x4b9753(0xc0)),_0x4b8abe=_0x448b49[_0x4b9753(0xb1)]('sql');if(!_0x3705be&&!_0x4b8abe)throw CliErrors[_0x4b9753(0xd5)](_0x4b9753(0xc0),_0x4b9753(0xc3));let _0x28b097;if(_0x3705be){const _0x26760d=resolve(process[_0x4b9753(0xb9)](),_0x3705be);if(!existsSync(_0x26760d))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x26760d);_0x28b097=readFileSync(_0x26760d,'utf-8');}else _0x28b097=_0x4b8abe;const _0x434e48=validateSql(_0x28b097),_0x4bd49b={'valid':_0x434e48[_0x4b9753(0xba)],'sqlType':_0x434e48[_0x4b9753(0xc7)][_0x4b9753(0xbc)],'isSelectOnly':_0x434e48[_0x4b9753(0xc7)][_0x4b9753(0xcb)],'isDangerous':_0x434e48[_0x4b9753(0xc7)]['isDangerous'],'tables':_0x434e48[_0x4b9753(0xc6)],'parameters':_0x434e48[_0x4b9753(0xbe)],'message':_0x434e48[_0x4b9753(0xbb)]};_0x434e48['sqlType'][_0x4b9753(0xac)]&&(_0x4bd49b[_0x4b9753(0xac)]=_0x434e48['sqlType'][_0x4b9753(0xac)]);const _0x14b8b2=_0x448b49[_0x4b9753(0xb1)]('schemas');if(_0x14b8b2&&_0x434e48['valid']){const _0x30c516=_0x14b8b2[_0x4b9753(0xab)](',')[_0x4b9753(0xc1)](_0x40cd7d=>_0x40cd7d['trim']())['filter'](Boolean),_0x4bee8b=[],_0x2a4e0c=filterDbTableBackedDatasets(await listDatasets(_0x448b49[_0x4b9753(0xce)])),_0xf256ef=new Map(_0x2a4e0c[_0x4b9753(0xc1)](_0x4393dc=>[_0x4393dc[_0x4b9753(0xad)]?.[_0x4b9753(0xae)]?.[_0x4b9753(0xcf)](),_0x4393dc]));for(const _0x30b363 of _0x434e48[_0x4b9753(0xc6)]){const _0x47c650=_0xf256ef[_0x4b9753(0xc9)](_0x30b363['toLowerCase']());!_0x47c650&&_0x4bee8b[_0x4b9753(0xb7)](_0x4b9753(0xb6)+_0x30b363+_0x4b9753(0xc2));}for(const _0x2aa31f of _0x30c516){let _0x516778;try{_0x516778=await getDatasetDetail(_0x2aa31f);}catch{_0x4bee8b[_0x4b9753(0xb7)](_0x4b9753(0xbf)+_0x2aa31f+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0x516778,_0x4b9753(0xc5));const _0x5c2ed6=Array[_0x4b9753(0xcd)](_0x516778[_0x4b9753(0xd7)])?_0x516778[_0x4b9753(0xd7)]:[],_0x3ebcd5=new Set(_0x5c2ed6['map'](_0x261960=>_0x261960[_0x4b9753(0xd3)]?.[_0x4b9753(0xcf)]())),_0x14b584=_0x516778[_0x4b9753(0xad)]?.[_0x4b9753(0xae)]||_0x516778[_0x4b9753(0xae)]||_0x2aa31f;_0x4bd49b[_0x4b9753(0xb2)+_0x14b584]={'code':_0x2aa31f,'tableName':_0x14b584,'fieldCount':_0x3ebcd5['size'],'fields':Array[_0x4b9753(0xa9)](_0x3ebcd5)};}_0x4bee8b['length']>0x0&&(_0x4bd49b[_0x4b9753(0xd8)]=_0x4bee8b);}return{'ok':_0x434e48[_0x4b9753(0xba)],'data':_0x4bd49b,'message':_0x434e48['message']};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x1e0e25=a134_0x3934;(function(_0x52e77b,_0x4cbea5){const _0x4064c9=a134_0x3934,_0xb753b2=_0x52e77b();while(!![]){try{const _0x3d9a56=parseInt(_0x4064c9(0x194))/0x1*(-parseInt(_0x4064c9(0x17a))/0x2)+parseInt(_0x4064c9(0x19d))/0x3*(-parseInt(_0x4064c9(0x180))/0x4)+parseInt(_0x4064c9(0x192))/0x5*(-parseInt(_0x4064c9(0x1a1))/0x6)+-parseInt(_0x4064c9(0x19f))/0x7+-parseInt(_0x4064c9(0x197))/0x8+-parseInt(_0x4064c9(0x188))/0x9+parseInt(_0x4064c9(0x189))/0xa*(parseInt(_0x4064c9(0x19c))/0xb);if(_0x3d9a56===_0x4cbea5)break;else _0xb753b2['push'](_0xb753b2['shift']());}catch(_0x23a2a8){_0xb753b2['push'](_0xb753b2['shift']());}}}(a134_0x5892,0x1d8f4));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_0x1e0e25(0x193),'accessKey',a134_0x1e0e25(0x17f),a134_0x1e0e25(0x18b),a134_0x1e0e25(0x18d)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a134_0x1e0e25(0x184),'env','locale',a134_0x1e0e25(0x18b),a134_0x1e0e25(0x193),a134_0x1e0e25(0x198),'apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x1a7002){const _0xecf7a5=a134_0x1e0e25;return[..._0x1a7002][_0xecf7a5(0x18a)](',\x20');}function a134_0x5892(){const _0x2e7c88=['Default\x20page\x20size','appcode','map','en-US','Target\x20environment','1071396PiPjuU','82030aHkpjE','join','format','Auth\x20cookie','riskLevel','defaultApp','Locale','Risk\x20level','has','61055aStrqe','cookie','101855smunBI','toLowerCase','keys','1720816ezjTgu','accessKey','env','zh-CN','Access\x20key','1342jBRShz','16152pDLVqJ','inherit','482804DpzZMb','trim','60SMFZAP','apiDir','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','string','4MQHnkP','apps','app','length','defaultFormat','locale','112RgcTjR','API\x20directory\x20path','pageSize'];a134_0x5892=function(){return _0x2e7c88;};return a134_0x5892();}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x46abd6){const _0x535efe=a134_0x1e0e25;return TOP_LEVEL_CONFIG_KEYS[_0x535efe(0x191)](_0x46abd6);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a134_0x1e0e25(0x199),'apiDir':a134_0x1e0e25(0x1a2),'cookie':a134_0x1e0e25(0x193),'accessKey':a134_0x1e0e25(0x198),'defaultFormat':'format','pageSize':a134_0x1e0e25(0x182),'riskLevel':a134_0x1e0e25(0x18d),'locale':a134_0x1e0e25(0x17f)};export function getAppProfileFlagDefs(){const _0x130735=a134_0x1e0e25;return[{'name':_0x130735(0x199),'type':'string','description':_0x130735(0x187),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x130735(0x1a2),'type':_0x130735(0x179),'description':_0x130735(0x181)},{'name':_0x130735(0x193),'type':'string','description':_0x130735(0x18c),'hidden':!![]},{'name':_0x130735(0x198),'type':_0x130735(0x179),'description':_0x130735(0x19b),'hidden':!![]},{'name':_0x130735(0x17e),'type':_0x130735(0x179),'description':_0x130735(0x178),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x130735(0x182),'type':'number','description':_0x130735(0x183)},{'name':_0x130735(0x18d),'type':_0x130735(0x179),'description':_0x130735(0x190),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x130735(0x17f),'type':_0x130735(0x179),'description':_0x130735(0x18f)}];}function a134_0x3934(_0x5cc68c,_0x5ed000){_0x5cc68c=_0x5cc68c-0x178;const _0x58929f=a134_0x5892();let _0x393463=_0x58929f[_0x5cc68c];return _0x393463;}export function collectAppProfileOverrides(_0x314da){const _0x2005f7=a134_0x1e0e25,_0x261d25={};for(const [_0x235a36,_0x3196b0]of Object['entries'](APP_PROFILE_FLAG_KEY_MAP)){const _0x3419f9=_0x314da(_0x235a36);if(!_0x3419f9)continue;_0x261d25[_0x3196b0]=_0x3196b0===_0x2005f7(0x182)?Number(_0x3419f9):_0x3419f9;}return _0x261d25;}export function buildAppProfileListFields(_0x453da7){const _0x5e7d1e=a134_0x1e0e25;return{'env':_0x453da7[_0x5e7d1e(0x199)]??null,'apiDir':_0x453da7[_0x5e7d1e(0x1a2)]??null,'hasCookie':!!_0x453da7['cookie'],'hasAccessKey':!!_0x453da7[_0x5e7d1e(0x198)],'format':_0x453da7[_0x5e7d1e(0x18b)]??null,'pageSize':_0x453da7['pageSize']??null,'riskLevel':_0x453da7[_0x5e7d1e(0x18d)]??null,'locale':_0x453da7[_0x5e7d1e(0x17f)]??null};}export function buildAppDoctorFields(_0x2b0b15,_0x414b65){const _0x4a72a5=a134_0x1e0e25;return{'env':{'value':_0x2b0b15[_0x4a72a5(0x199)]||_0x414b65[_0x4a72a5(0x199)],'source':_0x2b0b15[_0x4a72a5(0x199)]?_0x4a72a5(0x17c):_0x4a72a5(0x19e)},'apiDir':{'value':_0x2b0b15[_0x4a72a5(0x1a2)]||_0x414b65[_0x4a72a5(0x1a2)],'source':_0x2b0b15[_0x4a72a5(0x1a2)]?'app':_0x4a72a5(0x19e)},'cookie':{'value':_0x2b0b15[_0x4a72a5(0x193)]||_0x414b65[_0x4a72a5(0x193)],'source':_0x2b0b15[_0x4a72a5(0x193)]?'app':_0x4a72a5(0x19e)},'accessKey':{'value':_0x2b0b15[_0x4a72a5(0x198)]||_0x414b65['accessKey'],'source':_0x2b0b15['accessKey']?_0x4a72a5(0x17c):_0x4a72a5(0x19e)}};}export function buildCanonicalAppConfig(_0x1eb2e7,_0x51c667){const _0x24f869=a134_0x1e0e25,_0x559b4e=_0x1eb2e7[_0x24f869(0x185)](_0x5f136d=>String(_0x5f136d||'')[_0x24f869(0x1a0)]())['filter'](Boolean);if(_0x559b4e['length']===0x0)return{};const _0x5a15f4={};for(const _0x28c110 of _0x559b4e){_0x5a15f4[_0x28c110]=_0x51c667?{'appcode':_0x28c110,'env':_0x51c667}:{'appcode':_0x28c110};}return{'apps':_0x5a15f4,'defaultApp':_0x559b4e[0x0]};}export function buildCanonicalProjectConfig(_0x66b728,_0x2c7b59){const _0x3cfc3f=a134_0x1e0e25,{appCodes:appCodes=[],env:_0x17d3ba,metadata:_0x3a452c}=_0x2c7b59,_0x5ae7c3={..._0x66b728,..._0x3a452c||{}};delete _0x5ae7c3[_0x3cfc3f(0x184)],delete _0x5ae7c3[_0x3cfc3f(0x17c)];if(_0x17d3ba)_0x5ae7c3[_0x3cfc3f(0x199)]=_0x17d3ba;else!_0x5ae7c3[_0x3cfc3f(0x199)]&&(_0x5ae7c3[_0x3cfc3f(0x199)]=DEFAULT_CONFIG_VALUES['env']);const _0x28b01d=buildCanonicalAppConfig(appCodes,_0x5ae7c3['env']);return Object[_0x3cfc3f(0x196)](_0x28b01d)[_0x3cfc3f(0x17d)]>0x0&&(_0x5ae7c3[_0x3cfc3f(0x17b)]=_0x28b01d[_0x3cfc3f(0x17b)],_0x5ae7c3[_0x3cfc3f(0x18e)]=_0x28b01d['defaultApp']),_0x5ae7c3;}const LOCALE_MAP={'zh':a134_0x1e0e25(0x19a),'zh-cn':a134_0x1e0e25(0x19a),'zh_cn':a134_0x1e0e25(0x19a),'en':a134_0x1e0e25(0x186),'en-us':'en-US','en_us':a134_0x1e0e25(0x186)};export function normalizeLocale(_0x173e7d){const _0x2d9591=a134_0x1e0e25;if(!_0x173e7d)return null;return LOCALE_MAP[_0x173e7d[_0x2d9591(0x195)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a135_0x5ae5(){const _0x18232e=['3BZLcHt','115269fcnFmj','3477444aHTVMd','11IyBrrL','1642622UQYSAm','1659870MQHEur','1981haWTQt','28jBHTdS','54865cYFfXk','2437857OxDVSm','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','20000abOlOU'];a135_0x5ae5=function(){return _0x18232e;};return a135_0x5ae5();}const a135_0x1bc4d2=a135_0x20ba;(function(_0x8e0684,_0x48b81e){const _0x24ab06=a135_0x20ba,_0x763b62=_0x8e0684();while(!![]){try{const _0x561ab1=-parseInt(_0x24ab06(0x1a9))/0x1+-parseInt(_0x24ab06(0x1ac))/0x2*(-parseInt(_0x24ab06(0x1a8))/0x3)+parseInt(_0x24ab06(0x1af))/0x4*(parseInt(_0x24ab06(0x1a4))/0x5)+parseInt(_0x24ab06(0x1aa))/0x6+-parseInt(_0x24ab06(0x1ae))/0x7*(parseInt(_0x24ab06(0x1a7))/0x8)+-parseInt(_0x24ab06(0x1a5))/0x9+-parseInt(_0x24ab06(0x1ad))/0xa*(-parseInt(_0x24ab06(0x1ab))/0xb);if(_0x561ab1===_0x48b81e)break;else _0x763b62['push'](_0x763b62['shift']());}catch(_0x195bf4){_0x763b62['push'](_0x763b62['shift']());}}}(a135_0x5ae5,0x86499));function a135_0x20ba(_0x1d1dff,_0x717b5f){_0x1d1dff=_0x1d1dff-0x1a4;const _0x5ae542=a135_0x5ae5();let _0x20bae3=_0x5ae542[_0x1d1dff];return _0x20bae3;}export const CLI_VERSION_POLICY_URL=a135_0x1bc4d2(0x1a6);
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a136_0x535486=a136_0x102c;(function(_0x566156,_0x4320cd){const _0x13ac7f=a136_0x102c,_0x10602f=_0x566156();while(!![]){try{const _0x43cf57=-parseInt(_0x13ac7f(0x176))/0x1+-parseInt(_0x13ac7f(0x17e))/0x2+-parseInt(_0x13ac7f(0x177))/0x3*(parseInt(_0x13ac7f(0x155))/0x4)+-parseInt(_0x13ac7f(0x175))/0x5+parseInt(_0x13ac7f(0x18c))/0x6+parseInt(_0x13ac7f(0x171))/0x7*(-parseInt(_0x13ac7f(0x183))/0x8)+parseInt(_0x13ac7f(0x14f))/0x9;if(_0x43cf57===_0x4320cd)break;else _0x10602f['push'](_0x10602f['shift']());}catch(_0x5040f9){_0x10602f['push'](_0x10602f['shift']());}}}(a136_0x565c,0xd4ed3));export const CLI_BIN_NAME=a136_0x535486(0x154);export const CLI_DISPLAY_NAME=a136_0x535486(0x196);export const NPM_PACKAGE_NAME=a136_0x535486(0x188);export const GLOBAL_FLAGS=[{'name':'appcode','meowKey':a136_0x535486(0x197),'type':a136_0x535486(0x15b),'description':a136_0x535486(0x165),'hint':a136_0x535486(0x18e)},{'name':a136_0x535486(0x13f),'meowKey':a136_0x535486(0x13f),'type':a136_0x535486(0x15b),'description':a136_0x535486(0x191),'hint':'<name>'},{'name':'env','meowKey':a136_0x535486(0x158),'type':a136_0x535486(0x15b),'description':'Environment','hint':'production\x20|\x20daily'},{'name':a136_0x535486(0x189),'meowKey':a136_0x535486(0x189),'type':a136_0x535486(0x15b),'description':a136_0x535486(0x153),'hint':a136_0x535486(0x186)},{'name':'jq','meowKey':'jq','type':a136_0x535486(0x15b),'description':'Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','hint':'<expr>'},{'name':a136_0x535486(0x199),'meowKey':a136_0x535486(0x18f),'type':a136_0x535486(0x14e),'description':a136_0x535486(0x190)},{'name':'yes','meowKey':'yes','type':a136_0x535486(0x14e),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a136_0x535486(0x19d),'meowKey':a136_0x535486(0x178),'type':'boolean','description':a136_0x535486(0x140)},{'name':a136_0x535486(0x14a),'meowKey':'global','type':a136_0x535486(0x14e),'description':a136_0x535486(0x19a)},{'name':a136_0x535486(0x18b),'meowKey':a136_0x535486(0x18b),'type':'boolean','description':'Use\x20project\x20config\x20scope'},{'name':'ci','meowKey':'ci','type':a136_0x535486(0x14e),'description':'Alias\x20for\x20--non-interactive','hidden':!![]},{'name':a136_0x535486(0x143),'meowKey':a136_0x535486(0x143),'type':a136_0x535486(0x14e),'description':a136_0x535486(0x160)},{'name':'name','meowKey':a136_0x535486(0x174),'type':a136_0x535486(0x15b),'description':a136_0x535486(0x173),'hidden':!![]},{'name':'title','meowKey':'title','type':a136_0x535486(0x15b),'description':a136_0x535486(0x184),'hidden':!![]},{'name':a136_0x535486(0x172),'meowKey':'clear','type':a136_0x535486(0x14e),'description':'Clear','hidden':!![]},{'name':a136_0x535486(0x17a),'meowKey':a136_0x535486(0x17a),'type':a136_0x535486(0x14e),'description':a136_0x535486(0x15a),'hidden':!![]},{'name':'output','meowKey':a136_0x535486(0x16e),'type':a136_0x535486(0x15b),'description':'Output\x20path','hidden':!![]},{'name':a136_0x535486(0x146),'meowKey':a136_0x535486(0x146),'type':a136_0x535486(0x15b),'description':'JSON\x20params','hidden':!![]},{'name':'datasetcode','meowKey':a136_0x535486(0x159),'type':a136_0x535486(0x15b),'description':a136_0x535486(0x16b),'hidden':!![]},{'name':a136_0x535486(0x19b),'meowKey':'all','type':a136_0x535486(0x14e),'description':'Apply\x20to\x20all','hidden':!![]},{'name':a136_0x535486(0x18a),'meowKey':a136_0x535486(0x162),'type':'boolean','description':a136_0x535486(0x157),'hidden':!![]},{'name':'id','meowKey':'id','type':a136_0x535486(0x15b),'description':a136_0x535486(0x17f),'hidden':!![]},{'name':a136_0x535486(0x156),'meowKey':a136_0x535486(0x156),'type':a136_0x535486(0x15b),'description':'Type\x20filter','hidden':!![]},{'name':'file','meowKey':a136_0x535486(0x15d),'type':a136_0x535486(0x15b),'description':a136_0x535486(0x17d),'hidden':!![]},{'name':a136_0x535486(0x19e),'meowKey':'sqlcode','type':a136_0x535486(0x15b),'description':a136_0x535486(0x142),'hidden':!![]},{'name':a136_0x535486(0x151),'meowKey':'sqlName','type':a136_0x535486(0x15b),'description':a136_0x535486(0x161),'hidden':!![]},{'name':a136_0x535486(0x14c),'meowKey':'sqlname','type':a136_0x535486(0x15b),'description':a136_0x535486(0x161),'hidden':!![]},{'name':a136_0x535486(0x168),'meowKey':a136_0x535486(0x19c),'type':a136_0x535486(0x15b),'description':'DB\x20ID','hidden':!![]},{'name':a136_0x535486(0x147),'meowKey':a136_0x535486(0x147),'type':'string','description':a136_0x535486(0x148),'hidden':!![]},{'name':'description','meowKey':'description','type':a136_0x535486(0x15b),'description':a136_0x535486(0x195),'hidden':!![]},{'name':a136_0x535486(0x16c),'meowKey':a136_0x535486(0x16d),'type':a136_0x535486(0x15b),'description':a136_0x535486(0x17c),'hidden':!![]},{'name':a136_0x535486(0x13c),'meowKey':a136_0x535486(0x13c),'type':a136_0x535486(0x15b),'description':'Page\x20number','hidden':!![]},{'name':a136_0x535486(0x15f),'meowKey':a136_0x535486(0x15f),'type':'string','description':a136_0x535486(0x192),'hidden':!![]},{'name':'keyword','meowKey':a136_0x535486(0x141),'type':a136_0x535486(0x15b),'description':a136_0x535486(0x17b),'hidden':!![]},{'name':a136_0x535486(0x14d),'meowKey':a136_0x535486(0x14d),'type':a136_0x535486(0x15b),'description':a136_0x535486(0x198),'hidden':!![]},{'name':'sql','meowKey':a136_0x535486(0x149),'type':a136_0x535486(0x15b),'description':a136_0x535486(0x169),'hidden':!![]},{'name':a136_0x535486(0x163),'meowKey':a136_0x535486(0x163),'type':'string','description':a136_0x535486(0x150),'hidden':!![]},{'name':a136_0x535486(0x180),'meowKey':a136_0x535486(0x180),'type':'string','description':a136_0x535486(0x193),'hidden':!![]},{'name':a136_0x535486(0x16a),'meowKey':a136_0x535486(0x16a),'type':'string','description':'Target\x20path','hidden':!![]},{'name':a136_0x535486(0x13e),'meowKey':a136_0x535486(0x179),'type':a136_0x535486(0x14e),'description':'Skip\x20import\x20generation','hidden':!![]},{'name':a136_0x535486(0x194),'meowKey':'key','type':a136_0x535486(0x15b),'description':a136_0x535486(0x185),'hidden':!![]},{'name':a136_0x535486(0x182),'meowKey':a136_0x535486(0x182),'type':a136_0x535486(0x15b),'description':a136_0x535486(0x16f),'hidden':!![]},{'name':a136_0x535486(0x144),'meowKey':a136_0x535486(0x144),'type':a136_0x535486(0x14e),'description':a136_0x535486(0x187),'hidden':!![]},{'name':a136_0x535486(0x13b),'meowKey':a136_0x535486(0x13b),'type':a136_0x535486(0x14e),'description':a136_0x535486(0x15c),'hidden':!![]},{'name':'remote','meowKey':a136_0x535486(0x15e),'type':a136_0x535486(0x14e),'description':a136_0x535486(0x14b),'hidden':!![]},{'name':'verbose','meowKey':a136_0x535486(0x166),'type':a136_0x535486(0x14e),'description':a136_0x535486(0x13d),'hidden':!![]},{'name':'expected-count','meowKey':a136_0x535486(0x152),'type':a136_0x535486(0x15b),'description':a136_0x535486(0x145),'hidden':!![]},{'name':'operation-type','meowKey':a136_0x535486(0x18d),'type':'string','description':a136_0x535486(0x193),'hidden':!![]},{'name':a136_0x535486(0x170),'meowKey':a136_0x535486(0x167),'type':a136_0x535486(0x15b),'description':'Function\x20node','hidden':!![]}];function a136_0x102c(_0x5ea573,_0x305ff7){_0x5ea573=_0x5ea573-0x13b;const _0x565cf8=a136_0x565c();let _0x102c2b=_0x565cf8[_0x5ea573];return _0x102c2b;}function a136_0x565c(){const _0x2b7a27=['function-node','1207325kbgTuE','clear','Name','name','1060340gwicNE','1257858CjXBSs','1983xnLIEU','nonInteractive','skipImports','watch','Keyword\x20filter','Description\x20file','File\x20path','1977316vIRWwT','Record\x20ID','operation','meowKey','value','40ipecvG','Title','Config\x20key','json\x20|\x20pretty\x20|\x20compress','Force\x20overwrite','@lovrabet/rabetbase-cli','format','enable-bff-save','project','7345350bbhkOZ','operationType','<code>','dryRun','Preview\x20operation\x20without\x20executing','Select\x20app\x20profile\x20by\x20name','Page\x20size','Operation\x20type','key','Description','Rabetbase\x20CLI','appcode','Code\x20filter','dry-run','Use\x20global\x20config\x20scope','all','dbId','non-interactive','sqlcode','confirm','page','Verbose\x20output','skip-imports','app','Force\x20non-interactive\x20mode\x20(CI)','keyword','SQL\x20code','help','force','Expected\x20affected\x20count','params','dbid','DB\x20ID','sql','global','Use\x20remote','sqlname','code','boolean','35566092kjeIOe','Schemas','sql-name','expectedCount','Output\x20format','rabetbase','5948shuAny','type','Enable\x20BFF\x20save','env','datasetcode','Watch\x20mode','string','Confirm\x20destructive\x20action','file','remote','pagesize','Show\x20help','SQL\x20name','enableBffSave','schemas','map','Override\x20appcode','verbose','functionNode','db-id','SQL\x20string','target','Dataset\x20code','description-file','descriptionFile','output','Config\x20value'];a136_0x565c=function(){return _0x2b7a27;};return a136_0x565c();}export const PIPELINE_FLAG_NAMES=new Set([a136_0x535486(0x197),'app',a136_0x535486(0x158),a136_0x535486(0x189),'jq','dry-run','yes',a136_0x535486(0x19d),'ci']);export function buildMeowFlags(){const _0x158bef=a136_0x535486;return Object['fromEntries'](GLOBAL_FLAGS[_0x158bef(0x164)](_0x494aea=>[_0x494aea[_0x158bef(0x181)],{'type':_0x494aea[_0x158bef(0x156)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a137_0xfa9f(){const _0x4943bc=['compress','11158dpRsBH','5926990sjKURG','61023xQOoDN','3856KMaMjl','20785391zIlHFP','production','363KMtZbF','6ULkvep','9200268lOUqAK','160DGoMGt','3198yKxHrL','high-risk-write','728865vuKjEB'];a137_0xfa9f=function(){return _0x4943bc;};return a137_0xfa9f();}function a137_0x40f6(_0x3f69d9,_0x5e3a26){_0x3f69d9=_0x3f69d9-0xd0;const _0xfa9f6f=a137_0xfa9f();let _0x40f63e=_0xfa9f6f[_0x3f69d9];return _0x40f63e;}const a137_0x385fa4=a137_0x40f6;(function(_0x238742,_0x3691a3){const _0x4cbd71=a137_0x40f6,_0x26f381=_0x238742();while(!![]){try{const _0x546507=-parseInt(_0x4cbd71(0xd0))/0x1*(parseInt(_0x4cbd71(0xd4))/0x2)+-parseInt(_0x4cbd71(0xda))/0x3*(parseInt(_0x4cbd71(0xd3))/0x4)+parseInt(_0x4cbd71(0xd6))/0x5*(-parseInt(_0x4cbd71(0xd1))/0x6)+-parseInt(_0x4cbd71(0xd8))/0x7*(-parseInt(_0x4cbd71(0xdb))/0x8)+-parseInt(_0x4cbd71(0xd2))/0x9+parseInt(_0x4cbd71(0xd9))/0xa+parseInt(_0x4cbd71(0xdc))/0xb;if(_0x546507===_0x3691a3)break;else _0x26f381['push'](_0x26f381['shift']());}catch(_0x233b74){_0x26f381['push'](_0x26f381['shift']());}}}(a137_0xfa9f,0xa8166));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a137_0x385fa4(0xdd),'format':a137_0x385fa4(0xd7),'locale':'en-US','riskLevel':a137_0x385fa4(0xd5),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a137_0x385fa4(0xd7);
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a138_0x141212=a138_0x2cb6;(function(_0x11cca2,_0x401714){const _0x55766e=a138_0x2cb6,_0x2c9106=_0x11cca2();while(!![]){try{const _0x1553a2=parseInt(_0x55766e(0x16b))/0x1+-parseInt(_0x55766e(0x172))/0x2*(-parseInt(_0x55766e(0x17e))/0x3)+parseInt(_0x55766e(0x16e))/0x4*(parseInt(_0x55766e(0x174))/0x5)+parseInt(_0x55766e(0x16c))/0x6*(-parseInt(_0x55766e(0x175))/0x7)+-parseInt(_0x55766e(0x16f))/0x8*(-parseInt(_0x55766e(0x179))/0x9)+parseInt(_0x55766e(0x17f))/0xa*(-parseInt(_0x55766e(0x17c))/0xb)+parseInt(_0x55766e(0x180))/0xc*(-parseInt(_0x55766e(0x170))/0xd);if(_0x1553a2===_0x401714)break;else _0x2c9106['push'](_0x2c9106['shift']());}catch(_0x29dc7a){_0x2c9106['push'](_0x2c9106['shift']());}}}(a138_0x56a2,0xf35d8));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a138_0x56a2(){const _0x8c814=['36dRXCjJ','https://api.lovrabet.com','https://user.lovrabet.com','952410txEBEF','1582068WOgcgv','/web-app/app/','120408UWnnrR','224IcrKqS','10021895kLFrsK','trim','688242uTSekz','https://daily.lovrabet.com','325NAAoPs','14RnxcnE','runtimeDomain','userDomain','/app/','446868hZzefL','apiDomain','https://user-daily.lovrabet.com','11506CioZEw','https://daily-api.lovrabet.com','9NKNKxi','14290dvBwxf'];a138_0x56a2=function(){return _0x8c814;};return a138_0x56a2();}export function initDomains(_0x2c2653){const _0x5a2c1b=a138_0x2cb6;customApiDomain=_0x2c2653?.[_0x5a2c1b(0x17a)],customUserDomain=_0x2c2653?.[_0x5a2c1b(0x177)],customRuntimeDomain=_0x2c2653?.[_0x5a2c1b(0x176)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a138_0x141212(0x16a):a138_0x141212(0x17b));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a138_0x141212(0x169):a138_0x141212(0x17d));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?'https://runtime.lovrabet.com':'https://daily-runtime.lovrabet.com');export const getAppDomain=()=>isProduction(getEnv())?'https://app.lovrabet.com':a138_0x141212(0x173);function a138_0x2cb6(_0x19bf5c,_0x26e30d){_0x19bf5c=_0x19bf5c-0x169;const _0x56a20d=a138_0x56a2();let _0x2cb6c3=_0x56a20d[_0x19bf5c];return _0x2cb6c3;}export const getAppBaseUrl=_0x59bdfe=>{const _0x130ce9=a138_0x141212,_0x115a20=encodeURIComponent(_0x59bdfe[_0x130ce9(0x171)]());return isProduction(getEnv())?getAppDomain()+_0x130ce9(0x178)+_0x115a20:getAppDomain()+_0x130ce9(0x16d)+_0x115a20;};
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a139_0x140906=a139_0x4427;(function(_0x54421c,_0x2c3739){const _0x1c5a06=a139_0x4427,_0x38832b=_0x54421c();while(!![]){try{const _0x2ab782=-parseInt(_0x1c5a06(0xa6))/0x1+parseInt(_0x1c5a06(0xb1))/0x2*(-parseInt(_0x1c5a06(0xa8))/0x3)+parseInt(_0x1c5a06(0xb2))/0x4*(parseInt(_0x1c5a06(0xac))/0x5)+-parseInt(_0x1c5a06(0xa9))/0x6+-parseInt(_0x1c5a06(0xa5))/0x7+parseInt(_0x1c5a06(0xa7))/0x8*(-parseInt(_0x1c5a06(0xab))/0x9)+parseInt(_0x1c5a06(0xa4))/0xa;if(_0x2ab782===_0x2c3739)break;else _0x38832b['push'](_0x38832b['shift']());}catch(_0x29b87e){_0x38832b['push'](_0x38832b['shift']());}}}(a139_0x59e1,0x8b599));export const RABETBASE_ENV_VALUES=['production',a139_0x140906(0xaa)];function a139_0x4427(_0x5cc636,_0x413e0b){_0x5cc636=_0x5cc636-0xa4;const _0x59e1d2=a139_0x59e1();let _0x44271f=_0x59e1d2[_0x5cc636];return _0x44271f;}export function normalizeEnv(_0x570aca){const _0x1826a4=a139_0x140906;return _0x570aca===_0x1826a4(0xad)?_0x1826a4(0xae):_0x570aca;}export function isProduction(_0x1daba0){const _0x27c06a=a139_0x140906;return normalizeEnv(_0x1daba0)===_0x27c06a(0xae);}export function isDaily(_0x15d91e){return normalizeEnv(_0x15d91e)==='daily';}export function isDev(_0x478a93){const _0x2f1cf8=a139_0x140906,_0x528dea=normalizeEnv(_0x478a93);return _0x528dea===_0x2f1cf8(0xb0)||_0x528dea===_0x2f1cf8(0xaf);}function a139_0x59e1(){const _0x1673a6=['development','158DKwUgU','4iJlHjI','15494300PUMqhu','1973188tDSyKu','889786lXeSSm','8loLeyN','1401gibuxw','1035714jsCCpw','daily','4585068iiTLal','4559905zbxDqi','online','production','dev'];a139_0x59e1=function(){return _0x1673a6;};return a139_0x59e1();}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a139_0x140906(0xae));export function getEnv(){return env;}export function initEnv(_0x30cf16){env=normalizeEnv(_0x30cf16);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a140_0x49268b=a140_0x1c60;function a140_0x1c60(_0x1aaf68,_0x124fe3){_0x1aaf68=_0x1aaf68-0xe7;const _0x27b9c0=a140_0x27b9();let _0x1c6017=_0x27b9c0[_0x1aaf68];return _0x1c6017;}(function(_0x152aaf,_0x147483){const _0x455334=a140_0x1c60,_0x3afe99=_0x152aaf();while(!![]){try{const _0x541849=parseInt(_0x455334(0xea))/0x1+parseInt(_0x455334(0xe9))/0x2+-parseInt(_0x455334(0xed))/0x3+-parseInt(_0x455334(0xec))/0x4*(-parseInt(_0x455334(0xef))/0x5)+parseInt(_0x455334(0xf1))/0x6*(-parseInt(_0x455334(0xe8))/0x7)+parseInt(_0x455334(0xe7))/0x8+-parseInt(_0x455334(0xeb))/0x9;if(_0x541849===_0x147483)break;else _0x3afe99['push'](_0x3afe99['shift']());}catch(_0x52bbf0){_0x3afe99['push'](_0x3afe99['shift']());}}}(a140_0x27b9,0x7f7cb));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a140_0x49268b(0xf0),a140_0x49268b(0xee),'compress'];function a140_0x27b9(){const _0xdcae60=['7xgJQuV','486652NyoGcF','768529giywgp','8117001biipVK','4VEEfJv','599781ZiDCeo','pretty','4269305FvQRQL','json','2119806EBRFdy','892704jIWeam'];a140_0x27b9=function(){return _0xdcae60;};return a140_0x27b9();}
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a141_0xe550(){const _0x4b112d=['685790vAOjuA','8888bfXaFI','1257770LhEubt','22baFeOF','7512310rsQIPd','7252011kzNXnD','19227IHMWqg','76sQFMYD','2878936ncAxpo','676SqYJYZ','66cHpNgc','./src/api'];a141_0xe550=function(){return _0x4b112d;};return a141_0xe550();}function a141_0x2c6a(_0x43f9a9,_0x1a7718){_0x43f9a9=_0x43f9a9-0x81;const _0xe55062=a141_0xe550();let _0x2c6a3c=_0xe55062[_0x43f9a9];return _0x2c6a3c;}const a141_0x59565d=a141_0x2c6a;(function(_0x56f4ca,_0x5ebe96){const _0x3c406e=a141_0x2c6a,_0x5b291c=_0x56f4ca();while(!![]){try{const _0x59bcd3=parseInt(_0x3c406e(0x82))/0x1*(parseInt(_0x3c406e(0x88))/0x2)+-parseInt(_0x3c406e(0x81))/0x3*(parseInt(_0x3c406e(0x84))/0x4)+-parseInt(_0x3c406e(0x89))/0x5+-parseInt(_0x3c406e(0x85))/0x6*(parseInt(_0x3c406e(0x87))/0x7)+parseInt(_0x3c406e(0x83))/0x8+parseInt(_0x3c406e(0x8c))/0x9+-parseInt(_0x3c406e(0x8b))/0xa*(-parseInt(_0x3c406e(0x8a))/0xb);if(_0x59bcd3===_0x5ebe96)break;else _0x5b291c['push'](_0x5b291c['shift']());}catch(_0x2ad53e){_0x5b291c['push'](_0x5b291c['shift']());}}}(a141_0xe550,0x90e63));export const DEFAULT_API_DIR=a141_0x59565d(0x86);
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a142_0x4676f2=a142_0x4850;(function(_0x2b7c0d,_0x2c4827){const _0x39a032=a142_0x4850,_0x209bd1=_0x2b7c0d();while(!![]){try{const _0x2670dd=parseInt(_0x39a032(0x132))/0x1*(parseInt(_0x39a032(0x12c))/0x2)+-parseInt(_0x39a032(0x12b))/0x3+parseInt(_0x39a032(0x131))/0x4*(-parseInt(_0x39a032(0x12e))/0x5)+-parseInt(_0x39a032(0x136))/0x6*(-parseInt(_0x39a032(0x133))/0x7)+parseInt(_0x39a032(0x137))/0x8*(-parseInt(_0x39a032(0x12f))/0x9)+parseInt(_0x39a032(0x130))/0xa+-parseInt(_0x39a032(0x135))/0xb*(-parseInt(_0x39a032(0x12a))/0xc);if(_0x2670dd===_0x2c4827)break;else _0x209bd1['push'](_0x209bd1['shift']());}catch(_0x5c327f){_0x209bd1['push'](_0x209bd1['shift']());}}}(a142_0xcb6d,0x4d913));function a142_0xcb6d(){const _0x4ece1a=['1272DdfTzy','8Rowpvk','13848izYPhd','915585sSeyot','21418aBfvwA','write','2965yTCYht','3765186cOkTPZ','2926570fVbxoQ','1832dMCNDr','29gZbTXu','12229SKhEjm','read','3234WNmZEL'];a142_0xcb6d=function(){return _0x4ece1a;};return a142_0xcb6d();}function a142_0x4850(_0x5ee1a0,_0x20043b){_0x5ee1a0=_0x5ee1a0-0x12a;const _0xcb6dcf=a142_0xcb6d();let _0x485036=_0xcb6dcf[_0x5ee1a0];return _0x485036;}export const RISK_LEVEL_VALUES=[a142_0x4676f2(0x134),a142_0x4676f2(0x12d),'high-risk-write'];
|