@lovrabet/rabetbase-cli 2.2.4-beta.3 → 2.2.4-beta.4
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 +2 -2
- package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +1 -1
- package/templates/rules/lovrabet_rules.mdc.tpl +3 -1
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a128_0xdc55a8=a128_0x3c50;(function(_0x49cc98,_0x51cb0d){const _0x547994=a128_0x3c50,_0x91244e=_0x49cc98();while(!![]){try{const _0x260741=-parseInt(_0x547994(0x209))/0x1*(parseInt(_0x547994(0x20d))/0x2)+-parseInt(_0x547994(0x224))/0x3*(-parseInt(_0x547994(0x226))/0x4)+parseInt(_0x547994(0x1fc))/0x5*(parseInt(_0x547994(0x201))/0x6)+parseInt(_0x547994(0x230))/0x7*(-parseInt(_0x547994(0x216))/0x8)+-parseInt(_0x547994(0x208))/0x9+parseInt(_0x547994(0x22e))/0xa*(parseInt(_0x547994(0x200))/0xb)+parseInt(_0x547994(0x225))/0xc;if(_0x260741===_0x51cb0d)break;else _0x91244e['push'](_0x91244e['shift']());}catch(_0x5d2d8c){_0x91244e['push'](_0x91244e['shift']());}}}(a128_0x536a,0xa3b43));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';function a128_0x3c50(_0x51f5a9,_0x34af0e){_0x51f5a9=_0x51f5a9-0x1f2;const _0x536ae2=a128_0x536a();let _0x3c5016=_0x536ae2[_0x51f5a9];return _0x3c5016;}import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';function a128_0x536a(){const _0x47b2b7=['Pull\x20complete:\x20','sqlContent','\x20SQL\x20file(s)\x20into\x20','apps','lockFilePath','boolean','Force\x20overwrite\x20local\x20unsynced\x20changes','local\x20differs\x20from\x20remote','sqls','Would\x20pull\x20','sqlcode','2115ooDpSN','28461852qMDXNs','2316NCEoZI','str','\x20failed','catch','filter','conflict','sql','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','10byNNkC','unchanged','478457qIacFa','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','write','would_pull','paging','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','cancelled','\x20skipped,\x20','force','tableData','replace','dbId','35AMMsAX','pull','toISOString','\x20written,\x20','2978679VgKTeX','103494ovIWKN','test','sqlCode','length','name','push','trimStart','846567MTzLef','1WDAEUP','description','utf8','path','2216570NtebZV','message','appCode','sqlName','POST','string','No\x20remote\x20SQL\x20queries\x20matched.','nonInteractive','mybatisXml','152oxEitD','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','sqlRootDir'];a128_0x536a=function(){return _0x47b2b7;};return a128_0x536a();}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(_0x3b2c79,_0x36a631){const _0x4e0ee8=a128_0x3c50,_0x1f4b04=[];let _0x58ba42=0x1;while(!![]){const _0x31c398=await listSqlQueries(_0x3b2c79,{'currentPage':_0x58ba42,'pageSize':PAGE_SIZE,'sqlCode':_0x36a631['sqlCode'],'sqlName':_0x36a631['sqlName']}),_0x19b1b3=_0x31c398[_0x4e0ee8(0x1f9)]??[];_0x1f4b04['push'](..._0x19b1b3);if(_0x19b1b3[_0x4e0ee8(0x204)]===0x0)break;const _0x54ed4a=_0x31c398[_0x4e0ee8(0x1f4)]?.['totalCount'];if(_0x54ed4a!=null?_0x1f4b04[_0x4e0ee8(0x204)]>=_0x54ed4a:_0x19b1b3[_0x4e0ee8(0x204)]<PAGE_SIZE)break;_0x58ba42++;}return _0x1f4b04;}async function ensureSqlContent(_0x20fc0f){const _0x179954=a128_0x3c50;if(_0x20fc0f['sqlContent']!=null&&String(_0x20fc0f[_0x179954(0x21a)])['length']>0x0)return _0x20fc0f;return getSqlQueryDetail(_0x20fc0f[_0x179954(0x203)]);}export const sqlPull={'service':a128_0xdc55a8(0x22c),'command':a128_0xdc55a8(0x1fd),'description':a128_0xdc55a8(0x231),'risk':a128_0xdc55a8(0x1f2),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0xdc55a8(0x205),'type':a128_0xdc55a8(0x212),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a128_0xdc55a8(0x1f8),'type':a128_0xdc55a8(0x21e),'description':a128_0xdc55a8(0x21f)}],async 'dryRun'(_0x2a2b6b){const _0x282b4c=a128_0xdc55a8,_0x4a89c1=loadSqlProjectConfig(_0x2a2b6b[_0x282b4c(0x20f)]),_0x153dc4=await readSqlLockFile(_0x4a89c1[_0x282b4c(0x21d)]),{appLock:_0x3f6866}=ensureSqlLockScope(_0x153dc4??createEmptySqlLock(),_0x4a89c1[_0x282b4c(0x20f)],_0x4a89c1['sqlRoot'],_0x282b4c(0x1fd)),_0x2ff4e9=await fetchAllSqlQueries(_0x2a2b6b['appCode'],{'sqlCode':_0x2a2b6b[_0x282b4c(0x227)](_0x282b4c(0x223))||undefined,'sqlName':_0x2a2b6b[_0x282b4c(0x227)]('name')||undefined}),_0x14ced9=[];for(const _0x1b3018 of _0x2ff4e9){const _0x16e209=await ensureSqlContent(_0x1b3018),_0x515223=ensureRemoteSqlContent(_0x16e209),_0x4165a7=detectModeFromSql(_0x16e209),_0x598c02=_0x16e209['dbId']?await getDbName(_0x2a2b6b[_0x282b4c(0x20f)],Number(_0x16e209[_0x282b4c(0x1fb)]))[_0x282b4c(0x229)](()=>undefined):undefined,_0x3900f1=buildLocalSqlFileContent({'sqlCode':_0x16e209[_0x282b4c(0x203)],'sqlName':_0x16e209[_0x282b4c(0x210)],'dbId':_0x16e209[_0x282b4c(0x1fb)]},_0x515223,{'dbName':_0x598c02,'mode':_0x4165a7,'syncedAt':new Date()[_0x282b4c(0x1fe)](),'description':_0x16e209[_0x282b4c(0x20a)]}),_0x4322f1=buildSqlLockEntry(_0x16e209,_0x515223,'',{'dbName':_0x598c02}),_0x51cda8=resolveLocalSqlFilePath(_0x4a89c1,_0x16e209[_0x282b4c(0x203)],_0x4322f1);let _0x42fea1=_0x282b4c(0x1f3),_0x38e1dc;if(await fileExists(_0x51cda8)){const _0xf3ecac=await readFile(_0x51cda8,'utf8');isEquivalentPulledSqlFile(_0xf3ecac,_0x3900f1,_0x4165a7)?(_0x42fea1='skipped',_0x38e1dc=_0x282b4c(0x22f)):(_0x42fea1=_0x282b4c(0x22b),_0x38e1dc=_0x282b4c(0x1f5));}_0x14ced9[_0x282b4c(0x206)]({'sqlCode':_0x16e209[_0x282b4c(0x203)],'sqlName':_0x16e209['sqlName'],'filePath':_0x51cda8,'status':_0x42fea1,'reason':_0x38e1dc});}return{'method':_0x282b4c(0x211),'url':_0x282b4c(0x22d),'body':{'appCode':_0x2a2b6b[_0x282b4c(0x20f)],'sqlCode':_0x2a2b6b[_0x282b4c(0x227)]('sqlcode')||null,'sqlName':_0x2a2b6b[_0x282b4c(0x227)](_0x282b4c(0x205))||null,'files':_0x14ced9},'description':_0x282b4c(0x222)+_0x14ced9['length']+_0x282b4c(0x21b)+_0x4a89c1[_0x282b4c(0x218)]};},async 'execute'(_0x2b7c0a){const _0x244437=a128_0xdc55a8,_0x4ece51=loadSqlProjectConfig(_0x2b7c0a[_0x244437(0x20f)]),_0x47a307=await readSqlLockFile(_0x4ece51['lockFilePath']),{lockData:_0x158a5c,appLock:_0x48499b}=ensureSqlLockScope(_0x47a307??createEmptySqlLock(),_0x4ece51['appCode'],_0x4ece51['sqlRoot'],'pull'),_0xd4fe46=_0x2b7c0a['bool'](_0x244437(0x1f8)),_0x19d12a=await fetchAllSqlQueries(_0x2b7c0a[_0x244437(0x20f)],{'sqlCode':_0x2b7c0a['str'](_0x244437(0x223))||undefined,'sqlName':_0x2b7c0a[_0x244437(0x227)]('name')||undefined});if(_0x19d12a[_0x244437(0x204)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x244437(0x213)};const _0x2b4394=[],_0x39de19=[];for(const _0x42568d of _0x19d12a){try{_0x2b4394[_0x244437(0x206)](await ensureSqlContent(_0x42568d));}catch(_0x51c598){_0x39de19[_0x244437(0x206)]({'sqlCode':_0x42568d['sqlCode'],'error':_0x51c598 instanceof Error?_0x51c598[_0x244437(0x20e)]:String(_0x51c598)});}}if(_0xd4fe46&&!_0x2b7c0a[_0x244437(0x214)]){let _0xadcdb=![];for(const _0x156ef7 of _0x2b4394){const _0x17fb84=detectModeFromSql(_0x156ef7),_0x32a80f=_0x156ef7[_0x244437(0x1fb)]?await getDbName(_0x2b7c0a[_0x244437(0x20f)],Number(_0x156ef7[_0x244437(0x1fb)]))[_0x244437(0x229)](()=>undefined):undefined,_0x8396bb=buildLocalSqlFileContent({'sqlCode':_0x156ef7[_0x244437(0x203)],'sqlName':_0x156ef7[_0x244437(0x210)],'dbId':_0x156ef7['dbId']},ensureRemoteSqlContent(_0x156ef7),{'dbName':_0x32a80f,'mode':_0x17fb84,'syncedAt':new Date()['toISOString'](),'description':_0x156ef7['description']}),_0x4583f5=resolveLocalSqlFilePath(_0x4ece51,_0x156ef7[_0x244437(0x203)],buildSqlLockEntry(_0x156ef7,ensureRemoteSqlContent(_0x156ef7),'',{'dbName':_0x32a80f}));if(await fileExists(_0x4583f5)){const _0xf5fea9=await readFile(_0x4583f5,'utf8');if(!isEquivalentPulledSqlFile(_0xf5fea9,_0x8396bb,_0x17fb84)){_0xadcdb=!![];break;}}}if(_0xadcdb){const _0x1daa94=await confirmForceOverwrite(_0x244437(0x217));if(!_0x1daa94)throw CliErrors[_0x244437(0x1f6)]('Force\x20pull\x20cancelled.');}}const _0x315bf7=cloneSqlLockData(_0x158a5c),_0x1439c1=_0x315bf7[_0x244437(0x21c)][_0x4ece51['appCode']],_0x433d11=[],_0x322fd1=[];for(const _0x2f18fb of _0x2b4394){const _0x43e897=_0x1439c1[_0x244437(0x221)][_0x2f18fb[_0x244437(0x203)]],_0x6eb510=ensureRemoteSqlContent(_0x2f18fb),_0x14ac49=detectModeFromSql(_0x2f18fb),_0x377eee=_0x2f18fb[_0x244437(0x1fb)]?await getDbName(_0x2b7c0a['appCode'],Number(_0x2f18fb[_0x244437(0x1fb)]))[_0x244437(0x229)](()=>undefined):undefined,_0x58f44e=buildLocalSqlFileContent({'sqlCode':_0x2f18fb['sqlCode'],'sqlName':_0x2f18fb[_0x244437(0x210)],'dbId':_0x2f18fb[_0x244437(0x1fb)]},_0x6eb510,{'dbName':_0x377eee,'mode':_0x14ac49,'syncedAt':new Date()['toISOString'](),'description':_0x2f18fb[_0x244437(0x20a)]}),_0x124126=buildSqlLockEntry(_0x2f18fb,_0x6eb510,computeSqlContentHash(_0x58f44e),{'dbName':_0x377eee}),_0x30036b=_0x124126[_0x244437(0x20c)],_0x334bde=join(_0x4ece51[_0x244437(0x218)],_0x30036b);try{if(await fileExists(_0x334bde)){const _0x1af5d7=await readFile(_0x334bde,_0x244437(0x20b));if(isEquivalentPulledSqlFile(_0x1af5d7,_0x58f44e,_0x14ac49)){_0x322fd1[_0x244437(0x206)]({'sqlCode':_0x2f18fb[_0x244437(0x203)],'reason':_0x244437(0x22f)}),_0x1439c1[_0x244437(0x221)][_0x2f18fb[_0x244437(0x203)]]={..._0x124126,'hash':computeSqlContentHash(_0x1af5d7),'path':_0x30036b};continue;}if(!_0xd4fe46){_0x322fd1['push']({'sqlCode':_0x2f18fb[_0x244437(0x203)],'reason':_0x244437(0x220)});continue;}}const _0x3ae186=_0x43e897?.[_0x244437(0x20c)]?join(_0x4ece51[_0x244437(0x218)],_0x43e897[_0x244437(0x20c)]):undefined;_0x3ae186&&_0x3ae186!==_0x334bde&&await fileExists(_0x3ae186)&&await rm(_0x3ae186,{'force':!![]}),await ensureParentDirectory(_0x334bde),await writeFile(_0x334bde,_0x58f44e,_0x244437(0x20b)),_0x1439c1[_0x244437(0x221)][_0x2f18fb[_0x244437(0x203)]]={..._0x124126,'path':_0x30036b},_0x433d11[_0x244437(0x206)]({'sqlCode':_0x2f18fb[_0x244437(0x203)],'filePath':_0x334bde});}catch(_0x4713eb){_0x39de19[_0x244437(0x206)]({'sqlCode':_0x2f18fb[_0x244437(0x203)],'error':_0x4713eb instanceof Error?_0x4713eb[_0x244437(0x20e)]:String(_0x4713eb)});}}return _0x1439c1['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x4ece51[_0x244437(0x21d)],_0x315bf7),{'ok':_0x39de19[_0x244437(0x204)]===0x0,'data':{'pulled':_0x433d11,'skipped':_0x322fd1,'failed':_0x39de19},'message':_0x244437(0x219)+_0x433d11[_0x244437(0x204)]+_0x244437(0x1ff)+_0x322fd1['length']+_0x244437(0x1f7)+_0x39de19[_0x244437(0x204)]+_0x244437(0x228)};}};function detectModeFromSql(_0x2b389a){const _0x25db43=a128_0xdc55a8,_0x483801=ensureRemoteSqlContent(_0x2b389a),_0x3a507b=stripLocalSqlMetadata(_0x483801,_0x25db43(0x215))[_0x25db43(0x207)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x3a507b))return _0x25db43(0x215);return _0x25db43(0x22c);}function isEquivalentPulledSqlFile(_0x3746b2,_0x26ebf6,_0x13b9c1){return normalizePullComparableContent(_0x3746b2,_0x13b9c1)===normalizePullComparableContent(_0x26ebf6,_0x13b9c1);}function normalizePullComparableContent(_0x39219d,_0x2841a3){const _0x4d1641=a128_0xdc55a8,_0x2d2c7f=_0x39219d[_0x4d1641(0x1fa)](/\r\n/g,'\x0a')['split']('\x0a'),_0x410008=_0x2d2c7f[_0x4d1641(0x22a)](_0x3be8bb=>!isSyncedAtMetadataLine(_0x3be8bb,_0x2841a3));return _0x410008['join']('\x0a');}function isSyncedAtMetadataLine(_0x4e6a94,_0xafcf69){const _0x314aee=a128_0xdc55a8;if(_0xafcf69===_0x314aee(0x215))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x314aee(0x202)](_0x4e6a94);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x314aee(0x202)](_0x4e6a94);}
|
|
1
|
+
function a128_0x4279(_0x3b4079,_0xab6774){_0x3b4079=_0x3b4079-0x80;const _0xef5f1f=a128_0xef5f();let _0x42790a=_0xef5f1f[_0x3b4079];return _0x42790a;}const a128_0x441d12=a128_0x4279;function a128_0xef5f(){const _0x3b8591=['catch','nonInteractive','\x20written,\x20','message','\x20SQL\x20file(s)\x20into\x20','push','split','conflict','name','4046610IzmHtY','sqlName','2170050dgofhB','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','dbId','695616qyWdRj','unchanged','342531dgKqmF','length','toISOString','1489785VtphwD','pull','apps','\x20failed','mybatisXml','boolean','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','force','Force\x20overwrite\x20local\x20unsynced\x20changes','sqlRoot','test','replace','4366852OFENGq','skipped','Force\x20pull\x20cancelled.','Filter\x20by\x20SQL\x20display\x20name','path','join','sql','4UpMJnU','sqls','appCode','5AJgQTB','8OhgToK','string','str','POST','write','description','lockFilePath','utf8','373497VdFvKw','27lXmgWy','sqlRootDir','lastSync','local\x20differs\x20from\x20remote','No\x20remote\x20SQL\x20queries\x20matched.','sqlCode','would_pull','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlcode','filter'];a128_0xef5f=function(){return _0x3b8591;};return a128_0xef5f();}(function(_0x542164,_0x3ca987){const _0x5a19dc=a128_0x4279,_0x7dcb50=_0x542164();while(!![]){try{const _0x20e76b=-parseInt(_0x5a19dc(0xae))/0x1*(-parseInt(_0x5a19dc(0x87))/0x2)+parseInt(_0x5a19dc(0x93))/0x3*(-parseInt(_0x5a19dc(0x8b))/0x4)+-parseInt(_0x5a19dc(0x8a))/0x5*(-parseInt(_0x5a19dc(0xa7))/0x6)+-parseInt(_0x5a19dc(0x80))/0x7+-parseInt(_0x5a19dc(0xac))/0x8*(-parseInt(_0x5a19dc(0x94))/0x9)+-parseInt(_0x5a19dc(0xa9))/0xa+-parseInt(_0x5a19dc(0xb1))/0xb;if(_0x20e76b===_0x3ca987)break;else _0x7dcb50['push'](_0x7dcb50['shift']());}catch(_0x18720b){_0x7dcb50['push'](_0x7dcb50['shift']());}}}(a128_0xef5f,0x60747));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x2cbee8,_0xa05a23){const _0x3851a9=a128_0x4279,_0x2fd8ec=[];let _0x2a5c3b=0x1;while(!![]){const _0x57ae9c=await listSqlQueries(_0x2cbee8,{'currentPage':_0x2a5c3b,'pageSize':PAGE_SIZE,'sqlCode':_0xa05a23[_0x3851a9(0x99)],'sqlName':_0xa05a23['sqlName']}),_0x57376c=_0x57ae9c['tableData']??[];_0x2fd8ec[_0x3851a9(0xa3)](..._0x57376c);if(_0x57376c[_0x3851a9(0xaf)]===0x0)break;const _0x4d7797=_0x57ae9c['paging']?.['totalCount'];if(_0x4d7797!=null?_0x2fd8ec['length']>=_0x4d7797:_0x57376c[_0x3851a9(0xaf)]<PAGE_SIZE)break;_0x2a5c3b++;}return _0x2fd8ec;}async function ensureSqlContent(_0x46ae41){const _0x4abdae=a128_0x4279;if(_0x46ae41['sqlContent']!=null&&String(_0x46ae41['sqlContent'])[_0x4abdae(0xaf)]>0x0)return _0x46ae41;return getSqlQueryDetail(_0x46ae41['sqlCode']);}export const sqlPull={'service':'sql','command':a128_0x441d12(0xb2),'description':a128_0x441d12(0x9b),'risk':a128_0x441d12(0x8f),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0x441d12(0xa6),'type':a128_0x441d12(0x8c),'description':a128_0x441d12(0x83)},{'name':a128_0x441d12(0xb8),'type':a128_0x441d12(0xb6),'description':a128_0x441d12(0xb9)}],async 'dryRun'(_0x4f20b5){const _0x4ce122=a128_0x441d12,_0x15e227=loadSqlProjectConfig(_0x4f20b5['appCode']),_0xf9f114=await readSqlLockFile(_0x15e227['lockFilePath']),{appLock:_0x375d59}=ensureSqlLockScope(_0xf9f114??createEmptySqlLock(),_0x15e227[_0x4ce122(0x89)],_0x15e227[_0x4ce122(0xba)],_0x4ce122(0xb2)),_0x21f461=await fetchAllSqlQueries(_0x4f20b5[_0x4ce122(0x89)],{'sqlCode':_0x4f20b5['str'](_0x4ce122(0x9c))||undefined,'sqlName':_0x4f20b5[_0x4ce122(0x8d)](_0x4ce122(0xa6))||undefined}),_0x2e4568=[];for(const _0x1fe39a of _0x21f461){const _0x33c4a1=await ensureSqlContent(_0x1fe39a),_0x1a8543=ensureRemoteSqlContent(_0x33c4a1),_0x6325d2=detectModeFromSql(_0x33c4a1),_0xf6a89f=_0x33c4a1[_0x4ce122(0xab)]?await getDbName(_0x4f20b5[_0x4ce122(0x89)],Number(_0x33c4a1['dbId']))[_0x4ce122(0x9e)](()=>undefined):undefined,_0x219b75=buildLocalSqlFileContent({'sqlCode':_0x33c4a1[_0x4ce122(0x99)],'sqlName':_0x33c4a1[_0x4ce122(0xa8)],'dbId':_0x33c4a1[_0x4ce122(0xab)]},_0x1a8543,{'dbName':_0xf6a89f,'mode':_0x6325d2,'syncedAt':new Date()[_0x4ce122(0xb0)](),'description':_0x33c4a1[_0x4ce122(0x90)]}),_0x1734ef=buildSqlLockEntry(_0x33c4a1,_0x1a8543,'',{'dbName':_0xf6a89f}),_0xf5fd14=resolveLocalSqlFilePath(_0x15e227,_0x33c4a1[_0x4ce122(0x99)],_0x1734ef);let _0x1b6946=_0x4ce122(0x9a),_0x1fe5bd;if(await fileExists(_0xf5fd14)){const _0x5014eb=await readFile(_0xf5fd14,_0x4ce122(0x92));isEquivalentPulledSqlFile(_0x5014eb,_0x219b75,_0x6325d2)?(_0x1b6946=_0x4ce122(0x81),_0x1fe5bd=_0x4ce122(0xad)):(_0x1b6946=_0x4ce122(0xa5),_0x1fe5bd=_0x4ce122(0xaa));}_0x2e4568['push']({'sqlCode':_0x33c4a1[_0x4ce122(0x99)],'sqlName':_0x33c4a1[_0x4ce122(0xa8)],'filePath':_0xf5fd14,'status':_0x1b6946,'reason':_0x1fe5bd});}return{'method':_0x4ce122(0x8e),'url':_0x4ce122(0xb7),'body':{'appCode':_0x4f20b5[_0x4ce122(0x89)],'sqlCode':_0x4f20b5[_0x4ce122(0x8d)](_0x4ce122(0x9c))||null,'sqlName':_0x4f20b5['str']('name')||null,'files':_0x2e4568},'description':'Would\x20pull\x20'+_0x2e4568['length']+_0x4ce122(0xa2)+_0x15e227[_0x4ce122(0x95)]};},async 'execute'(_0x5d2fd1){const _0x53522f=a128_0x441d12,_0x702dd0=loadSqlProjectConfig(_0x5d2fd1[_0x53522f(0x89)]),_0x491bfa=await readSqlLockFile(_0x702dd0[_0x53522f(0x91)]),{lockData:_0x313632,appLock:_0x9e7b9a}=ensureSqlLockScope(_0x491bfa??createEmptySqlLock(),_0x702dd0[_0x53522f(0x89)],_0x702dd0[_0x53522f(0xba)],_0x53522f(0xb2)),_0x35ffc3=_0x5d2fd1['bool'](_0x53522f(0xb8)),_0x54115c=await fetchAllSqlQueries(_0x5d2fd1[_0x53522f(0x89)],{'sqlCode':_0x5d2fd1[_0x53522f(0x8d)](_0x53522f(0x9c))||undefined,'sqlName':_0x5d2fd1[_0x53522f(0x8d)](_0x53522f(0xa6))||undefined});if(_0x54115c[_0x53522f(0xaf)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x53522f(0x98)};const _0x41da6c=[],_0xfc339f=[];for(const _0x1c5217 of _0x54115c){try{_0x41da6c[_0x53522f(0xa3)](await ensureSqlContent(_0x1c5217));}catch(_0x355bdd){_0xfc339f[_0x53522f(0xa3)]({'sqlCode':_0x1c5217[_0x53522f(0x99)],'error':_0x355bdd instanceof Error?_0x355bdd[_0x53522f(0xa1)]:String(_0x355bdd)});}}if(_0x35ffc3&&!_0x5d2fd1[_0x53522f(0x9f)]){let _0x1daa23=![];for(const _0x1dd56d of _0x41da6c){const _0x522eb8=detectModeFromSql(_0x1dd56d),_0x3b83fb=_0x1dd56d['dbId']?await getDbName(_0x5d2fd1['appCode'],Number(_0x1dd56d[_0x53522f(0xab)]))[_0x53522f(0x9e)](()=>undefined):undefined,_0xb2c263=buildLocalSqlFileContent({'sqlCode':_0x1dd56d[_0x53522f(0x99)],'sqlName':_0x1dd56d[_0x53522f(0xa8)],'dbId':_0x1dd56d['dbId']},ensureRemoteSqlContent(_0x1dd56d),{'dbName':_0x3b83fb,'mode':_0x522eb8,'syncedAt':new Date()['toISOString'](),'description':_0x1dd56d['description']}),_0xb29569=resolveLocalSqlFilePath(_0x702dd0,_0x1dd56d[_0x53522f(0x99)],buildSqlLockEntry(_0x1dd56d,ensureRemoteSqlContent(_0x1dd56d),'',{'dbName':_0x3b83fb}));if(await fileExists(_0xb29569)){const _0x243b42=await readFile(_0xb29569,_0x53522f(0x92));if(!isEquivalentPulledSqlFile(_0x243b42,_0xb2c263,_0x522eb8)){_0x1daa23=!![];break;}}}if(_0x1daa23){const _0x4fdb74=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x4fdb74)throw CliErrors['cancelled'](_0x53522f(0x82));}}const _0xdd64ce=cloneSqlLockData(_0x313632),_0x3aecf4=_0xdd64ce[_0x53522f(0xb3)][_0x702dd0[_0x53522f(0x89)]],_0x67eed7=[],_0x29ef4e=[];for(const _0x5e1f5b of _0x41da6c){const _0x47b743=_0x3aecf4['sqls'][_0x5e1f5b[_0x53522f(0x99)]],_0x323de9=ensureRemoteSqlContent(_0x5e1f5b),_0x4b1eb6=detectModeFromSql(_0x5e1f5b),_0x22a984=_0x5e1f5b[_0x53522f(0xab)]?await getDbName(_0x5d2fd1[_0x53522f(0x89)],Number(_0x5e1f5b[_0x53522f(0xab)]))[_0x53522f(0x9e)](()=>undefined):undefined,_0x108eca=buildLocalSqlFileContent({'sqlCode':_0x5e1f5b[_0x53522f(0x99)],'sqlName':_0x5e1f5b['sqlName'],'dbId':_0x5e1f5b[_0x53522f(0xab)]},_0x323de9,{'dbName':_0x22a984,'mode':_0x4b1eb6,'syncedAt':new Date()[_0x53522f(0xb0)](),'description':_0x5e1f5b[_0x53522f(0x90)]}),_0x43e550=buildSqlLockEntry(_0x5e1f5b,_0x323de9,computeSqlContentHash(_0x108eca),{'dbName':_0x22a984}),_0x133071=_0x43e550['path'],_0x45b4a9=join(_0x702dd0['sqlRootDir'],_0x133071);try{if(await fileExists(_0x45b4a9)){const _0x513bc7=await readFile(_0x45b4a9,_0x53522f(0x92));if(isEquivalentPulledSqlFile(_0x513bc7,_0x108eca,_0x4b1eb6)){_0x29ef4e[_0x53522f(0xa3)]({'sqlCode':_0x5e1f5b['sqlCode'],'reason':'unchanged'}),_0x3aecf4[_0x53522f(0x88)][_0x5e1f5b[_0x53522f(0x99)]]={..._0x43e550,'hash':computeSqlContentHash(_0x513bc7),'path':_0x133071};continue;}if(!_0x35ffc3){_0x29ef4e[_0x53522f(0xa3)]({'sqlCode':_0x5e1f5b['sqlCode'],'reason':_0x53522f(0x97)});continue;}}const _0x2cc351=_0x47b743?.[_0x53522f(0x84)]?join(_0x702dd0[_0x53522f(0x95)],_0x47b743[_0x53522f(0x84)]):undefined;_0x2cc351&&_0x2cc351!==_0x45b4a9&&await fileExists(_0x2cc351)&&await rm(_0x2cc351,{'force':!![]}),await ensureParentDirectory(_0x45b4a9),await writeFile(_0x45b4a9,_0x108eca,_0x53522f(0x92)),_0x3aecf4[_0x53522f(0x88)][_0x5e1f5b['sqlCode']]={..._0x43e550,'path':_0x133071},_0x67eed7[_0x53522f(0xa3)]({'sqlCode':_0x5e1f5b['sqlCode'],'filePath':_0x45b4a9});}catch(_0x23c7f5){_0xfc339f[_0x53522f(0xa3)]({'sqlCode':_0x5e1f5b[_0x53522f(0x99)],'error':_0x23c7f5 instanceof Error?_0x23c7f5[_0x53522f(0xa1)]:String(_0x23c7f5)});}}return _0x3aecf4[_0x53522f(0x96)]=new Date()[_0x53522f(0xb0)](),await writeSqlLockFile(_0x702dd0['lockFilePath'],_0xdd64ce),{'ok':_0xfc339f['length']===0x0,'data':{'pulled':_0x67eed7,'skipped':_0x29ef4e,'failed':_0xfc339f},'message':'Pull\x20complete:\x20'+_0x67eed7[_0x53522f(0xaf)]+_0x53522f(0xa0)+_0x29ef4e['length']+'\x20skipped,\x20'+_0xfc339f[_0x53522f(0xaf)]+_0x53522f(0xb4)};}};function detectModeFromSql(_0x369098){const _0x4a1a2d=a128_0x441d12,_0x1fb84b=ensureRemoteSqlContent(_0x369098),_0x1275be=stripLocalSqlMetadata(_0x1fb84b,'mybatisXml')['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x4a1a2d(0xbb)](_0x1275be))return _0x4a1a2d(0xb5);return _0x4a1a2d(0x86);}function isEquivalentPulledSqlFile(_0x3769ab,_0x9a2677,_0x5abc9c){return normalizePullComparableContent(_0x3769ab,_0x5abc9c)===normalizePullComparableContent(_0x9a2677,_0x5abc9c);}function normalizePullComparableContent(_0x5e5b9a,_0x17a93d){const _0x3e7794=a128_0x441d12,_0xb0d3f1=_0x5e5b9a[_0x3e7794(0xbc)](/\r\n/g,'\x0a')[_0x3e7794(0xa4)]('\x0a'),_0x488f03=_0xb0d3f1[_0x3e7794(0x9d)](_0x35eb81=>!isSyncedAtMetadataLine(_0x35eb81,_0x17a93d));return _0x488f03[_0x3e7794(0x85)]('\x0a');}function isSyncedAtMetadataLine(_0x24d38b,_0x1f194b){const _0x595d4f=a128_0x441d12;if(_0x1f194b===_0x595d4f(0xb5))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x595d4f(0xbb)](_0x24d38b);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x24d38b);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a129_0x4a4dc8=a129_0x57c1;(function(_0x362b97,_0x46f2ea){const _0x53cfdd=a129_0x57c1,_0x10d611=_0x362b97();while(!![]){try{const _0xab6f01=parseInt(_0x53cfdd(0x11f))/0x1*(parseInt(_0x53cfdd(0x105))/0x2)+parseInt(_0x53cfdd(0x113))/0x3+parseInt(_0x53cfdd(0x131))/0x4*(-parseInt(_0x53cfdd(0x141))/0x5)+parseInt(_0x53cfdd(0x10a))/0x6*(parseInt(_0x53cfdd(0x134))/0x7)+-parseInt(_0x53cfdd(0x140))/0x8*(parseInt(_0x53cfdd(0x130))/0x9)+parseInt(_0x53cfdd(0x11d))/0xa+-parseInt(_0x53cfdd(0x11e))/0xb*(parseInt(_0x53cfdd(0x10d))/0xc);if(_0xab6f01===_0x46f2ea)break;else _0x10d611['push'](_0x10d611['shift']());}catch(_0x53a072){_0x10d611['push'](_0x10d611['shift']());}}}(a129_0x3279,0x2db63));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x4bd7e6,_0xee16b,_0x1b7494){const _0x21f780=a129_0x57c1,_0x296b38=await scanLocalSqlQueries(_0x4bd7e6),_0x3ff6b8=new Map();for(const _0x3eeb95 of _0x296b38){if(_0x1b7494&&_0x3eeb95[_0x21f780(0x115)]!==_0x1b7494)continue;const _0x576c94=_0x3ff6b8[_0x21f780(0x11a)](_0x3eeb95[_0x21f780(0x115)])??[];_0x576c94[_0x21f780(0x11b)](_0x3eeb95),_0x3ff6b8['set'](_0x3eeb95['sqlCode'],_0x576c94);}if(_0x1b7494&&!_0x3ff6b8[_0x21f780(0x13f)](_0x1b7494))throw CliErrors[_0x21f780(0x129)](_0x21f780(0x142)+_0x1b7494);const _0x2a604a=[];for(const [_0x5ab814,_0x4fa619]of _0x3ff6b8[_0x21f780(0x128)]()){if(_0x4fa619[_0x21f780(0x117)]===0x1){_0x2a604a['push'](_0x4fa619[0x0]);continue;}const _0x2b41b3=_0xee16b[_0x21f780(0x12f)][_0x5ab814],_0x9265bd=_0x2b41b3?.[_0x21f780(0x107)],_0x5f1e58=_0x9265bd?_0x4fa619['filter'](_0x572870=>_0x572870[_0x21f780(0x106)]!==_0x9265bd):_0x4fa619;if(_0x2b41b3&&_0x5f1e58[_0x21f780(0x117)]===0x1){_0x2a604a[_0x21f780(0x11b)](_0x5f1e58[0x0]);continue;}throw CliErrors[_0x21f780(0x129)](_0x21f780(0x10b)+_0x5ab814+_0x21f780(0x138));}return _0x2a604a;}function a129_0x57c1(_0x1e0b5a,_0x42b369){_0x1e0b5a=_0x1e0b5a-0x103;const _0x3279c9=a129_0x3279();let _0x57c1cb=_0x3279c9[_0x1e0b5a];return _0x57c1cb;}export const sqlPush={'service':a129_0x4a4dc8(0x10e),'command':a129_0x4a4dc8(0x11b),'description':a129_0x4a4dc8(0x135),'risk':a129_0x4a4dc8(0x13c),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a129_0x4a4dc8(0x12a),'type':a129_0x4a4dc8(0x112),'description':a129_0x4a4dc8(0x12e)}],async 'dryRun'(_0x1e87dd){const _0x12aa54=a129_0x4a4dc8,_0x72082e=loadSqlProjectConfig(_0x1e87dd[_0x12aa54(0x124)]),_0x329ab8=await readSqlLockFile(_0x72082e[_0x12aa54(0x126)]),{appLock:_0x1f27ad}=ensureSqlLockScope(_0x329ab8??createEmptySqlLock(),_0x1e87dd['appCode'],_0x72082e['sqlRoot'],_0x12aa54(0x11b)),_0x505428=await getTargetSqlQueries(_0x72082e,_0x1f27ad,_0x1e87dd[_0x12aa54(0x125)]('sqlcode')||undefined),_0x31c9f9=[];for(const _0x3115e5 of _0x505428){const _0x1d219c=await computeSqlFileHash(_0x3115e5[_0x12aa54(0x119)]),_0x2422a0=_0x1f27ad[_0x12aa54(0x12f)][_0x3115e5[_0x12aa54(0x115)]],_0x398373=!!_0x2422a0&&(_0x2422a0[_0x12aa54(0x107)]!==_0x3115e5[_0x12aa54(0x106)]||!!_0x3115e5['sqlName']&&_0x2422a0[_0x12aa54(0x109)]!==_0x3115e5[_0x12aa54(0x109)]);if(!_0x1e87dd[_0x12aa54(0x110)](_0x12aa54(0x12a))&&_0x2422a0&&_0x2422a0[_0x12aa54(0x123)]===_0x1d219c&&!_0x398373)continue;_0x31c9f9[_0x12aa54(0x11b)](_0x3115e5[_0x12aa54(0x115)]);}return{'method':_0x12aa54(0x104),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x31c9f9,'appCode':_0x1e87dd[_0x12aa54(0x124)]},'description':_0x12aa54(0x13d)+_0x31c9f9[_0x12aa54(0x117)]+_0x12aa54(0x144)};},async 'execute'(_0x209359){const _0x4933da=a129_0x4a4dc8,_0x4cd1a0=loadSqlProjectConfig(_0x209359[_0x4933da(0x124)]),_0x3a5f83=await readSqlLockFile(_0x4cd1a0[_0x4933da(0x126)]),{lockData:_0x44349b,appLock:_0x5f41d4}=ensureSqlLockScope(_0x3a5f83??createEmptySqlLock(),_0x209359['appCode'],_0x4cd1a0['sqlRoot'],_0x4933da(0x11b)),_0x3ba563=await getTargetSqlQueries(_0x4cd1a0,_0x5f41d4,_0x209359[_0x4933da(0x125)](_0x4933da(0x13e))||undefined);if(_0x3ba563[_0x4933da(0x117)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x3d56ac=[],_0x51d611=[],_0x71952f=[];for(const _0x20cdf0 of _0x3ba563){const _0x177c93=_0x5f41d4[_0x4933da(0x12f)][_0x20cdf0['sqlCode']];if(!_0x177c93){_0x71952f[_0x4933da(0x11b)]({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x1a1c8e=await computeSqlFileHash(_0x20cdf0[_0x4933da(0x119)]),_0x47c081=_0x177c93[_0x4933da(0x107)]!==_0x20cdf0['relativePath']||!!_0x20cdf0['sqlName']&&_0x177c93[_0x4933da(0x109)]!==_0x20cdf0[_0x4933da(0x109)];if(!_0x209359[_0x4933da(0x110)]('force')&&_0x177c93[_0x4933da(0x123)]===_0x1a1c8e&&!_0x47c081){_0x51d611['push']({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'reason':_0x4933da(0x122)});continue;}if(_0x177c93[_0x4933da(0x111)]==null){_0x71952f[_0x4933da(0x11b)]({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'error':_0x4933da(0x137)});continue;}const _0x3cd5d3=await readFile(_0x20cdf0[_0x4933da(0x119)],'utf8'),_0xa1398a=stripLocalSqlMetadata(_0x3cd5d3,_0x20cdf0['mode']),_0x9534f=_0x20cdf0['sqlName']||_0x177c93[_0x4933da(0x109)],_0x337406=await resolveTargetDbBinding(_0x209359[_0x4933da(0x124)],_0x20cdf0,_0x177c93),_0x5944a2=await updateSqlQuery({'id':_0x177c93[_0x4933da(0x108)],'appCode':_0x209359[_0x4933da(0x124)],'sqlCode':_0x20cdf0[_0x4933da(0x115)],'sqlName':_0x9534f,'dbId':_0x337406[_0x4933da(0x10c)],'version':_0x177c93[_0x4933da(0x111)],'sqlContent':_0xa1398a,'sqlConfig':_0x177c93[_0x4933da(0x11c)]??undefined}),_0x106a1b=_0x5944a2[_0x4933da(0x10c)]?await getDbName(_0x209359['appCode'],Number(_0x5944a2['dbId']))[_0x4933da(0x103)](()=>_0x337406['dbName']):_0x337406[_0x4933da(0x133)];_0x5f41d4[_0x4933da(0x12f)][_0x20cdf0[_0x4933da(0x115)]]={...buildSqlLockEntry(_0x5944a2,_0xa1398a,_0x1a1c8e,{'dbName':_0x106a1b}),'path':_0x20cdf0['relativePath'],'mode':_0x177c93['mode']},await archivePreviousSqlFileIfNeeded(_0x4cd1a0,_0x177c93[_0x4933da(0x107)],_0x20cdf0[_0x4933da(0x106)]),_0x3d56ac['push']({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'remoteId':_0x177c93[_0x4933da(0x108)]});}catch(_0x37874d){_0x71952f[_0x4933da(0x11b)]({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'error':_0x37874d instanceof Error?_0x37874d['message']:String(_0x37874d)});}}return _0x5f41d4[_0x4933da(0x143)]=new Date()[_0x4933da(0x127)](),await writeSqlLockFile(_0x4cd1a0[_0x4933da(0x126)],_0x44349b),{'ok':_0x71952f[_0x4933da(0x117)]===0x0,'data':{'pushed':_0x3d56ac,'skipped':_0x51d611,'failed':_0x71952f},'message':'Push\x20complete:\x20'+_0x3d56ac[_0x4933da(0x117)]+_0x4933da(0x13a)+_0x51d611['length']+_0x4933da(0x12b)+_0x71952f[_0x4933da(0x117)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x584449,_0x41b9cf,_0x3abad5){const _0x4b4f96=a129_0x4a4dc8;if(!_0x41b9cf||_0x41b9cf===_0x3abad5)return;const _0x26e636=join(_0x584449[_0x4b4f96(0x136)],_0x41b9cf);if(!await fileExists(_0x26e636))return;const _0x13faf1=await moveToTrash(_0x584449[_0x4b4f96(0x10f)],_0x584449['trashDir'],_0x26e636);await cleanupEmptyDirectories(dirname(_0x26e636),_0x584449[_0x4b4f96(0x136)]),void _0x13faf1;}async function moveToTrash(_0x577e29,_0x47f4f1,_0x15815d){const _0xce056a=a129_0x4a4dc8,_0x2aefbf=new Date()[_0xce056a(0x127)]()[_0xce056a(0x12d)](/[:.]/g,'-'),_0x1c48e5=relative(_0x577e29,_0x15815d),_0x56f712=join(_0x47f4f1,_0x2aefbf,_0x1c48e5);return await mkdir(dirname(_0x56f712),{'recursive':!![]}),await rename(_0x15815d,_0x56f712),_0x56f712;}async function cleanupEmptyDirectories(_0x49cbe6,_0x37ba7e){const _0x2a6aef=a129_0x4a4dc8;let _0x54d4be=resolve(_0x49cbe6);const _0x5a4617=resolve(_0x37ba7e);while(_0x54d4be['startsWith'](''+_0x5a4617+sep)||_0x54d4be===_0x5a4617){if(_0x54d4be===_0x5a4617)return;try{const _0xc0ce00=await readdir(_0x54d4be);if(_0xc0ce00[_0x2a6aef(0x117)]>0x0)return;await rmdir(_0x54d4be);}catch{return;}_0x54d4be=dirname(_0x54d4be);}}function a129_0x3279(){const _0xcd02a2=['Local\x20SQL\x20not\x20found:\x20','lastSync','\x20SQL\x20file(s)','catch','POST','2rRiOTt','relativePath','path','remoteId','sqlName','252RTptJH','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','dbId','1968Kivowl','sql','projectRoot','bool','version','boolean','385233gVuaDo','filter','sqlCode','dbDirectory','length','map','filePath','get','push','sqlConfig','2434330jTqqjh','17699JmTqRi','319433FLNGgD','Local\x20directory\x20\x22','join','unchanged','hash','appCode','str','lockFilePath','toISOString','entries','validation','force','\x20skipped,\x20','\x22\x20for\x20sqlCode\x20','replace','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','sqls','3573OZreCv','546008zzItQs','exec','dbName','40817ieGByb','Push\x20local\x20SQL\x20files\x20to\x20remote','sqlRootDir','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','\x20pushed,\x20','No\x20database\x20matches\x20local\x20directory\x20\x22','high-risk-write','Would\x20push\x20','sqlcode','has','7024oDbiNe','5FsOYsA'];a129_0x3279=function(){return _0xcd02a2;};return a129_0x3279();}async function resolveTargetDbBinding(_0x137bd9,_0x2e0c18,_0x3eb998){const _0x30acd4=a129_0x4a4dc8,_0xc1bc91=_0x2e0c18[_0x30acd4(0x116)];if(!_0xc1bc91)return{'dbId':_0x3eb998[_0x30acd4(0x10c)],'dbName':_0x3eb998[_0x30acd4(0x133)]};const _0x20d776=buildDbDirectoryName(_0x3eb998['dbName'],_0x3eb998[_0x30acd4(0x10c)]);if(_0xc1bc91===_0x20d776)return{'dbId':_0x3eb998[_0x30acd4(0x10c)],'dbName':_0x3eb998['dbName']};const _0x304b02=parseExplicitDbDirectory(_0xc1bc91);if(_0x304b02!=null)return{'dbId':_0x304b02,'dbName':await getDbName(_0x137bd9,_0x304b02)[_0x30acd4(0x103)](()=>undefined)};const _0x72c761=await listDatabases(_0x137bd9),_0x273be6=_0x72c761[_0x30acd4(0x114)](_0x5e7901=>buildDbDirectoryName(_0x5e7901[_0x30acd4(0x133)],_0x5e7901['dbId'])===_0xc1bc91);if(_0x273be6[_0x30acd4(0x117)]===0x1)return{'dbId':_0x273be6[0x0][_0x30acd4(0x10c)],'dbName':_0x273be6[0x0][_0x30acd4(0x133)]};if(_0x273be6[_0x30acd4(0x117)]===0x0)throw CliErrors[_0x30acd4(0x129)](_0x30acd4(0x13b)+_0xc1bc91+_0x30acd4(0x12c)+_0x2e0c18[_0x30acd4(0x115)]+'.');const _0x35438a=_0x273be6[_0x30acd4(0x118)](_0xf8b37c=>_0xf8b37c[_0x30acd4(0x133)]+'\x20('+_0xf8b37c['dbId']+')')[_0x30acd4(0x121)](',\x20');throw CliErrors[_0x30acd4(0x129)](_0x30acd4(0x120)+_0xc1bc91+_0x30acd4(0x139)+_0x2e0c18['sqlCode']+':\x20'+_0x35438a);}function parseExplicitDbDirectory(_0x166ec1){const _0x2b681e=a129_0x4a4dc8,_0x52221e=/^db-(\d+)$/[_0x2b681e(0x132)](_0x166ec1);if(!_0x52221e)return null;const _0x1948c2=Number(_0x52221e[0x1]);return Number['isFinite'](_0x1948c2)&&_0x1948c2>0x0?_0x1948c2:null;}
|
|
1
|
+
const a129_0x5c1252=a129_0x12e4;(function(_0x1bac51,_0x2f73da){const _0x3ddd33=a129_0x12e4,_0x53ed96=_0x1bac51();while(!![]){try{const _0xeb6d2=parseInt(_0x3ddd33(0x1a4))/0x1*(-parseInt(_0x3ddd33(0x1b7))/0x2)+-parseInt(_0x3ddd33(0x197))/0x3+-parseInt(_0x3ddd33(0x1ad))/0x4+-parseInt(_0x3ddd33(0x1d0))/0x5*(parseInt(_0x3ddd33(0x196))/0x6)+parseInt(_0x3ddd33(0x1c8))/0x7*(-parseInt(_0x3ddd33(0x1c2))/0x8)+-parseInt(_0x3ddd33(0x1c6))/0x9+parseInt(_0x3ddd33(0x1ce))/0xa;if(_0xeb6d2===_0x2f73da)break;else _0x53ed96['push'](_0x53ed96['shift']());}catch(_0x4b5f0b){_0x53ed96['push'](_0x53ed96['shift']());}}}(a129_0x2e77,0x26783));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0xdd8533,_0x975d80,_0x499635){const _0x457623=a129_0x12e4,_0x55b5cd=await scanLocalSqlQueries(_0xdd8533),_0x160f47=new Map();for(const _0x26b840 of _0x55b5cd){if(_0x499635&&_0x26b840['sqlCode']!==_0x499635)continue;const _0x57b39a=_0x160f47[_0x457623(0x1a0)](_0x26b840['sqlCode'])??[];_0x57b39a[_0x457623(0x1ae)](_0x26b840),_0x160f47[_0x457623(0x190)](_0x26b840[_0x457623(0x1ab)],_0x57b39a);}if(_0x499635&&!_0x160f47[_0x457623(0x18e)](_0x499635))throw CliErrors[_0x457623(0x1b0)](_0x457623(0x1a3)+_0x499635);const _0x4daff0=[];for(const [_0x134c6c,_0x1fbe87]of _0x160f47[_0x457623(0x1aa)]()){if(_0x1fbe87[_0x457623(0x1cf)]===0x1){_0x4daff0[_0x457623(0x1ae)](_0x1fbe87[0x0]);continue;}const _0x2d6a40=_0x975d80[_0x457623(0x18c)][_0x134c6c],_0x521d3a=_0x2d6a40?.[_0x457623(0x19f)],_0x15530a=_0x521d3a?_0x1fbe87[_0x457623(0x1a1)](_0x591c95=>_0x591c95[_0x457623(0x1ca)]!==_0x521d3a):_0x1fbe87;if(_0x2d6a40&&_0x15530a[_0x457623(0x1cf)]===0x1){_0x4daff0['push'](_0x15530a[0x0]);continue;}throw CliErrors[_0x457623(0x1b0)](_0x457623(0x1b2)+_0x134c6c+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x4daff0;}export const sqlPush={'service':a129_0x5c1252(0x1c9),'command':a129_0x5c1252(0x1ae),'description':a129_0x5c1252(0x1d1),'risk':a129_0x5c1252(0x1af),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a129_0x5c1252(0x1bb),'type':a129_0x5c1252(0x19c),'description':a129_0x5c1252(0x1b6)}],async 'dryRun'(_0x1741c8){const _0x588da6=a129_0x5c1252,_0x455862=loadSqlProjectConfig(_0x1741c8['appCode']),_0x232eab=await readSqlLockFile(_0x455862[_0x588da6(0x1cc)]),{appLock:_0x21bad8}=ensureSqlLockScope(_0x232eab??createEmptySqlLock(),_0x1741c8[_0x588da6(0x18a)],_0x455862[_0x588da6(0x1c7)],_0x588da6(0x1ae)),_0x36137f=await getTargetSqlQueries(_0x455862,_0x21bad8,_0x1741c8[_0x588da6(0x189)](_0x588da6(0x1b1))||undefined),_0x51d82e=[];for(const _0x454ee6 of _0x36137f){const _0x3d86cc=await computeSqlFileHash(_0x454ee6[_0x588da6(0x198)]),_0x1694a0=_0x21bad8[_0x588da6(0x18c)][_0x454ee6[_0x588da6(0x1ab)]],_0x424e1f=!!_0x1694a0&&(_0x1694a0[_0x588da6(0x19f)]!==_0x454ee6[_0x588da6(0x1ca)]||!!_0x454ee6[_0x588da6(0x1b9)]&&_0x1694a0[_0x588da6(0x1b9)]!==_0x454ee6[_0x588da6(0x1b9)]);if(!_0x1741c8[_0x588da6(0x1b4)](_0x588da6(0x1bb))&&_0x1694a0&&_0x1694a0[_0x588da6(0x194)]===_0x3d86cc&&!_0x424e1f)continue;_0x51d82e[_0x588da6(0x1ae)](_0x454ee6['sqlCode']);}return{'method':_0x588da6(0x1bc),'url':_0x588da6(0x1a9),'body':{'sqlCodes':_0x51d82e,'appCode':_0x1741c8['appCode']},'description':_0x588da6(0x1bf)+_0x51d82e[_0x588da6(0x1cf)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x4ab478){const _0xb5e8cc=a129_0x5c1252,_0x2fec91=loadSqlProjectConfig(_0x4ab478[_0xb5e8cc(0x18a)]),_0x21f3b7=await readSqlLockFile(_0x2fec91[_0xb5e8cc(0x1cc)]),{lockData:_0x1781c9,appLock:_0xbe3ad4}=ensureSqlLockScope(_0x21f3b7??createEmptySqlLock(),_0x4ab478[_0xb5e8cc(0x18a)],_0x2fec91[_0xb5e8cc(0x1c7)],_0xb5e8cc(0x1ae)),_0x4cd6c3=await getTargetSqlQueries(_0x2fec91,_0xbe3ad4,_0x4ab478[_0xb5e8cc(0x189)](_0xb5e8cc(0x1b1))||undefined);if(_0x4cd6c3[_0xb5e8cc(0x1cf)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xb5e8cc(0x1c0)};const _0x57e800=[],_0x2e4265=[],_0x5115ca=[];for(const _0x2b432f of _0x4cd6c3){const _0xab24bd=_0xbe3ad4['sqls'][_0x2b432f['sqlCode']];if(!_0xab24bd){_0x5115ca[_0xb5e8cc(0x1ae)]({'sqlCode':_0x2b432f[_0xb5e8cc(0x1ab)],'error':_0xb5e8cc(0x1be)});continue;}try{const _0x181ae1=await computeSqlFileHash(_0x2b432f[_0xb5e8cc(0x198)]),_0x2395fd=_0xab24bd[_0xb5e8cc(0x19f)]!==_0x2b432f[_0xb5e8cc(0x1ca)]||!!_0x2b432f[_0xb5e8cc(0x1b9)]&&_0xab24bd[_0xb5e8cc(0x1b9)]!==_0x2b432f[_0xb5e8cc(0x1b9)];if(!_0x4ab478[_0xb5e8cc(0x1b4)](_0xb5e8cc(0x1bb))&&_0xab24bd[_0xb5e8cc(0x194)]===_0x181ae1&&!_0x2395fd){_0x2e4265[_0xb5e8cc(0x1ae)]({'sqlCode':_0x2b432f[_0xb5e8cc(0x1ab)],'reason':_0xb5e8cc(0x1b3)});continue;}if(_0xab24bd[_0xb5e8cc(0x19e)]==null){_0x5115ca[_0xb5e8cc(0x1ae)]({'sqlCode':_0x2b432f[_0xb5e8cc(0x1ab)],'error':_0xb5e8cc(0x193)});continue;}const _0x1f781a=await readFile(_0x2b432f[_0xb5e8cc(0x198)],_0xb5e8cc(0x1a5)),_0x59b621=stripLocalSqlMetadata(_0x1f781a,_0x2b432f[_0xb5e8cc(0x1b8)]),_0x24ea21=_0x2b432f[_0xb5e8cc(0x1b9)]||_0xab24bd['sqlName'],_0xe6e18b=await resolveTargetDbBinding(_0x4ab478['appCode'],_0x2b432f,_0xab24bd),_0x332261=await updateSqlQuery({'id':_0xab24bd[_0xb5e8cc(0x18b)],'appCode':_0x4ab478[_0xb5e8cc(0x18a)],'sqlCode':_0x2b432f['sqlCode'],'sqlName':_0x24ea21,'dbId':_0xe6e18b[_0xb5e8cc(0x1ba)],'version':_0xab24bd[_0xb5e8cc(0x19e)],'sqlContent':_0x59b621,'sqlConfig':_0xab24bd[_0xb5e8cc(0x1c1)]??undefined}),_0x499c40=_0x332261['dbId']?await getDbName(_0x4ab478[_0xb5e8cc(0x18a)],Number(_0x332261['dbId']))[_0xb5e8cc(0x1ac)](()=>_0xe6e18b[_0xb5e8cc(0x191)]):_0xe6e18b[_0xb5e8cc(0x191)];_0xbe3ad4[_0xb5e8cc(0x18c)][_0x2b432f[_0xb5e8cc(0x1ab)]]={...buildSqlLockEntry(_0x332261,_0x59b621,_0x181ae1,{'dbName':_0x499c40}),'path':_0x2b432f[_0xb5e8cc(0x1ca)],'mode':_0xab24bd['mode']},await archivePreviousSqlFileIfNeeded(_0x2fec91,_0xab24bd['path'],_0x2b432f[_0xb5e8cc(0x1ca)]),_0x57e800[_0xb5e8cc(0x1ae)]({'sqlCode':_0x2b432f[_0xb5e8cc(0x1ab)],'remoteId':_0xab24bd['remoteId']});}catch(_0x221a17){_0x5115ca[_0xb5e8cc(0x1ae)]({'sqlCode':_0x2b432f[_0xb5e8cc(0x1ab)],'error':_0x221a17 instanceof Error?_0x221a17[_0xb5e8cc(0x1a7)]:String(_0x221a17)});}}return _0xbe3ad4[_0xb5e8cc(0x199)]=new Date()[_0xb5e8cc(0x1cd)](),await writeSqlLockFile(_0x2fec91['lockFilePath'],_0x1781c9),{'ok':_0x5115ca[_0xb5e8cc(0x1cf)]===0x0,'data':{'pushed':_0x57e800,'skipped':_0x2e4265,'failed':_0x5115ca},'message':_0xb5e8cc(0x1a6)+_0x57e800['length']+'\x20pushed,\x20'+_0x2e4265[_0xb5e8cc(0x1cf)]+'\x20skipped,\x20'+_0x5115ca['length']+_0xb5e8cc(0x19b)};}};async function archivePreviousSqlFileIfNeeded(_0x5d2de2,_0x4ea180,_0x558a80){const _0x30f551=a129_0x5c1252;if(!_0x4ea180||_0x4ea180===_0x558a80)return;const _0x281f5e=join(_0x5d2de2[_0x30f551(0x18d)],_0x4ea180);if(!await fileExists(_0x281f5e))return;const _0x1cdf25=await moveToTrash(_0x5d2de2[_0x30f551(0x1a2)],_0x5d2de2[_0x30f551(0x1b5)],_0x281f5e);await cleanupEmptyDirectories(dirname(_0x281f5e),_0x5d2de2['sqlRootDir']),void _0x1cdf25;}async function moveToTrash(_0x47a974,_0x15d16c,_0x506062){const _0x2a82e3=a129_0x5c1252,_0x393785=new Date()['toISOString']()[_0x2a82e3(0x1cb)](/[:.]/g,'-'),_0x58beee=relative(_0x47a974,_0x506062),_0x51dc86=join(_0x15d16c,_0x393785,_0x58beee);return await mkdir(dirname(_0x51dc86),{'recursive':!![]}),await rename(_0x506062,_0x51dc86),_0x51dc86;}async function cleanupEmptyDirectories(_0x214ed4,_0x2a0f8e){const _0x12a9f3=a129_0x5c1252;let _0x48566a=resolve(_0x214ed4);const _0x56435f=resolve(_0x2a0f8e);while(_0x48566a[_0x12a9f3(0x1bd)](''+_0x56435f+sep)||_0x48566a===_0x56435f){if(_0x48566a===_0x56435f)return;try{const _0x1b8c26=await readdir(_0x48566a);if(_0x1b8c26[_0x12a9f3(0x1cf)]>0x0)return;await rmdir(_0x48566a);}catch{return;}_0x48566a=dirname(_0x48566a);}}async function resolveTargetDbBinding(_0x1d4d9b,_0x8ac4ad,_0x4d181a){const _0x1b3840=a129_0x5c1252,_0x596387=_0x8ac4ad[_0x1b3840(0x1c5)];if(!_0x596387)return{'dbId':_0x4d181a['dbId'],'dbName':_0x4d181a[_0x1b3840(0x191)]};const _0xda734=buildDbDirectoryName(_0x4d181a[_0x1b3840(0x191)],_0x4d181a[_0x1b3840(0x1ba)]);if(_0x596387===_0xda734)return{'dbId':_0x4d181a[_0x1b3840(0x1ba)],'dbName':_0x4d181a[_0x1b3840(0x191)]};const _0x596eec=parseExplicitDbDirectory(_0x596387);if(_0x596eec!=null)return{'dbId':_0x596eec,'dbName':await getDbName(_0x1d4d9b,_0x596eec)[_0x1b3840(0x1ac)](()=>undefined)};const _0x5dea56=await listDatabases(_0x1d4d9b),_0x23e84c=_0x5dea56[_0x1b3840(0x1a1)](_0x2b1a9f=>buildDbDirectoryName(_0x2b1a9f[_0x1b3840(0x191)],_0x2b1a9f[_0x1b3840(0x1ba)])===_0x596387);if(_0x23e84c[_0x1b3840(0x1cf)]===0x1)return{'dbId':_0x23e84c[0x0][_0x1b3840(0x1ba)],'dbName':_0x23e84c[0x0]['dbName']};if(_0x23e84c[_0x1b3840(0x1cf)]===0x0)throw CliErrors[_0x1b3840(0x1b0)](_0x1b3840(0x1c4)+_0x596387+_0x1b3840(0x1c3)+_0x8ac4ad[_0x1b3840(0x1ab)]+'.');const _0x4064bf=_0x23e84c[_0x1b3840(0x19d)](_0x5a58db=>_0x5a58db[_0x1b3840(0x191)]+'\x20('+_0x5a58db[_0x1b3840(0x1ba)]+')')[_0x1b3840(0x19a)](',\x20');throw CliErrors[_0x1b3840(0x1b0)](_0x1b3840(0x18f)+_0x596387+_0x1b3840(0x192)+_0x8ac4ad[_0x1b3840(0x1ab)]+':\x20'+_0x4064bf);}function a129_0x2e77(){const _0x58a808=['unchanged','bool','trashDir','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','101526povHHS','mode','sqlName','dbId','force','POST','startsWith','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','Would\x20push\x20','No\x20local\x20SQL\x20files\x20found.','sqlConfig','8QBRMmq','\x22\x20for\x20sqlCode\x20','No\x20database\x20matches\x20local\x20directory\x20\x22','dbDirectory','1036359pYXuUe','sqlRoot','164017lgTROI','sql','relativePath','replace','lockFilePath','toISOString','6028290zBcEsO','length','51215PtiXLS','Push\x20local\x20SQL\x20files\x20to\x20remote','str','appCode','remoteId','sqls','sqlRootDir','has','Local\x20directory\x20\x22','set','dbName','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','hash','isFinite','12zlaeUt','141549RZUUFj','filePath','lastSync','join','\x20failed','boolean','map','version','path','get','filter','projectRoot','Local\x20SQL\x20not\x20found:\x20','3jPFPfU','utf8','Push\x20complete:\x20','message','exec','/smartapi/custom/updateUserCustomSql','entries','sqlCode','catch','346872ZOthxJ','push','high-risk-write','validation','sqlcode','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'];a129_0x2e77=function(){return _0x58a808;};return a129_0x2e77();}function a129_0x12e4(_0x2947cd,_0x5d99e4){_0x2947cd=_0x2947cd-0x189;const _0x2e77ed=a129_0x2e77();let _0x12e48a=_0x2e77ed[_0x2947cd];return _0x12e48a;}function parseExplicitDbDirectory(_0x597bda){const _0x321d7e=a129_0x5c1252,_0x3c1eb0=/^db-(\d+)$/[_0x321d7e(0x1a8)](_0x597bda);if(!_0x3c1eb0)return null;const _0xfb6bb0=Number(_0x3c1eb0[0x1]);return Number[_0x321d7e(0x195)](_0xfb6bb0)&&_0xfb6bb0>0x0?_0xfb6bb0:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a130_0x470860=a130_0x3dfd;(function(_0x3144b4,_0xe18012){const _0x18d559=a130_0x3dfd,_0x27feb9=_0x3144b4();while(!![]){try{const _0x47d267=-parseInt(_0x18d559(0x18a))/0x1+parseInt(_0x18d559(0x185))/0x2+-parseInt(_0x18d559(0x182))/0x3*(parseInt(_0x18d559(0x184))/0x4)+-parseInt(_0x18d559(0x18d))/0x5*(-parseInt(_0x18d559(0x186))/0x6)+-parseInt(_0x18d559(0x18e))/0x7+parseInt(_0x18d559(0x195))/0x8+parseInt(_0x18d559(0x183))/0x9;if(_0x47d267===_0xe18012)break;else _0x27feb9['push'](_0x27feb9['shift']());}catch(_0x2c7447){_0x27feb9['push'](_0x27feb9['shift']());}}}(a130_0xbd63,0xe1fa4));import{CliErrors}from'../../errors.js';function a130_0xbd63(){const _0xebb1fa=['sql','10jlBiWc','10750257SRciEq','string','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','join','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','Query\x20description','validation','120968SVqWLP','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','2199NFcjuw','38276424EMgLLe','6196KMZGbD','1202048OmEkGC','1527624VKKtMF','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','Path\x20to\x20the\x20SQL\x20file','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`.','1781517zPkcTu','description'];a130_0xbd63=function(){return _0xebb1fa;};return a130_0xbd63();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a130_0x3dfd(_0x4da1b2,_0x3e0580){_0x4da1b2=_0x4da1b2-0x182;const _0xbd6398=a130_0xbd63();let _0x3dfde8=_0xbd6398[_0x4da1b2];return _0x3dfde8;}const SQL_SAVE_DEPRECATED_HINT=[a130_0x470860(0x190),a130_0x470860(0x196),a130_0x470860(0x189)][a130_0x470860(0x191)]('\x0a');export const sqlSave={'service':a130_0x470860(0x18c),'command':'save','description':a130_0x470860(0x192),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'file','type':a130_0x470860(0x18f),'required':!![],'description':a130_0x470860(0x188)},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':'string','description':'SQL\x20query\x20display\x20name'},{'name':'db','type':'string','description':a130_0x470860(0x187)},{'name':a130_0x470860(0x18b),'type':'string','description':a130_0x470860(0x193)}],async 'validate'(){const _0x58038d=a130_0x470860;throw CliErrors[_0x58038d(0x194)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a131_0x7d01(){const _0x3178b8=['21JNKQaR','syncedAt','<!--\x20@lovrabet.','apps','.rabetbase/sql','dbId','yes','115hLlvsp','sqlContent','test','32911kMJSBZ','push','29106636mBPcry','1686vKVZQv','toLowerCase','stdin','filter','stderr','sqlRoot','mybatisXml','path','mode','--\x20@lovrabet.','13UvYurR','map','version','lastSync','\x20-->','trimStart','sqlConfig','3703077HPxedH','join','125082blVZlk','includes','length','sqlCode','description','sqlName','dbName','3124iwOebC','3156530NRttSC','33EoYZhi','replace','split','close','36YLASzu','2114936vAwYqJ','trim','endsWith'];a131_0x7d01=function(){return _0x3178b8;};return a131_0x7d01();}const a131_0x56d521=a131_0x22ab;(function(_0xe6379f,_0x4e55bf){const _0x3d95cb=a131_0x22ab,_0x4e16d4=_0xe6379f();while(!![]){try{const _0x355bc7=-parseInt(_0x3d95cb(0x177))/0x1*(parseInt(_0x3d95cb(0x169))/0x2)+-parseInt(_0x3d95cb(0x17a))/0x3*(-parseInt(_0x3d95cb(0x163))/0x4)+-parseInt(_0x3d95cb(0x174))/0x5*(-parseInt(_0x3d95cb(0x15c))/0x6)+-parseInt(_0x3d95cb(0x16d))/0x7*(parseInt(_0x3d95cb(0x16a))/0x8)+-parseInt(_0x3d95cb(0x15a))/0x9+-parseInt(_0x3d95cb(0x164))/0xa*(parseInt(_0x3d95cb(0x165))/0xb)+parseInt(_0x3d95cb(0x179))/0xc*(parseInt(_0x3d95cb(0x153))/0xd);if(_0x355bc7===_0x4e55bf)break;else _0x4e16d4['push'](_0x4e16d4['shift']());}catch(_0x17228b){_0x4e16d4['push'](_0x4e16d4['shift']());}}}(a131_0x7d01,0x927ed));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_0x56d521(0x171);export function buildSqlLockEntry(_0x375998,_0x2b1b9c,_0x16ef85,_0x567332){const _0x2cfbdf=a131_0x56d521,_0x20d78e=detectSqlMode(_0x2b1b9c);return{'path':buildSqlRelativePath(_0x375998[_0x2cfbdf(0x15f)],_0x375998[_0x2cfbdf(0x161)],_0x567332?.[_0x2cfbdf(0x162)],_0x20d78e,_0x375998[_0x2cfbdf(0x172)]),'hash':_0x16ef85,'remoteId':_0x375998['id'],'version':_0x375998[_0x2cfbdf(0x155)],'dbId':Number(_0x375998[_0x2cfbdf(0x172)]),'dbName':_0x567332?.[_0x2cfbdf(0x162)],'sqlName':_0x375998['sqlName'],'sqlConfig':_0x375998[_0x2cfbdf(0x159)]??undefined,'mode':_0x20d78e};}export function cloneSqlLockData(_0xbf7ebf){const _0x3b85e0=a131_0x56d521;return{'apps':Object['fromEntries'](Object['entries'](_0xbf7ebf[_0x3b85e0(0x170)])[_0x3b85e0(0x154)](([_0x597e1d,_0x3d75bb])=>[_0x597e1d,{'sqlRoot':_0x3d75bb[_0x3b85e0(0x17f)],'lastSync':_0x3d75bb[_0x3b85e0(0x156)],'sqls':{..._0x3d75bb['sqls']}}]))};}export function ensureRemoteSqlContent(_0x3c5a42){const _0x5b681b=a131_0x56d521;return _0x3c5a42[_0x5b681b(0x175)]??'';}export function buildLocalSqlFileContent(_0x2bfc1a,_0x552ff3,_0x33948c){const _0x7cbc26=a131_0x56d521,_0x1228f4=_0x33948c?.[_0x7cbc26(0x151)]??detectSqlMode(_0x552ff3),_0x4a3176=stripLocalSqlMetadata(_0x552ff3,_0x1228f4)[_0x7cbc26(0x16b)](),_0x2d26fb=[...buildMetadataHeaderLines({'sqlCode':_0x2bfc1a['sqlCode'],'sqlName':_0x2bfc1a[_0x7cbc26(0x161)],'dbId':_0x2bfc1a[_0x7cbc26(0x172)],'dbName':_0x33948c?.[_0x7cbc26(0x162)],'mode':_0x1228f4,'syncedAt':_0x33948c?.[_0x7cbc26(0x16e)],'description':_0x33948c?.[_0x7cbc26(0x160)]},_0x1228f4),'',_0x4a3176],_0x4e0c57=_0x2d26fb[_0x7cbc26(0x15b)]('\x0a');return _0x4e0c57[_0x7cbc26(0x16c)]('\x0a')?_0x4e0c57:_0x4e0c57+'\x0a';}export function stripLocalSqlMetadata(_0x1da4b4,_0x194752){const _0x4f49a2=a131_0x56d521,_0x4b0fab=_0x1da4b4[_0x4f49a2(0x166)](/\r\n/g,'\x0a')[_0x4f49a2(0x167)]('\x0a'),_0x82a832=[];let _0x54bed8=0x0;if(_0x194752===_0x4f49a2(0x180))while(_0x54bed8<_0x4b0fab[_0x4f49a2(0x15e)]){const _0x1f97d7=_0x4b0fab[_0x54bed8]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x1f97d7)){_0x54bed8++;continue;}if(_0x1f97d7[_0x4f49a2(0x16b)]()===''&&_0x54bed8>0x0){_0x54bed8++;continue;}break;}else while(_0x54bed8<_0x4b0fab[_0x4f49a2(0x15e)]){const _0x137b37=_0x4b0fab[_0x54bed8]??'';if(/^\s*--\s*@lovrabet\./[_0x4f49a2(0x176)](_0x137b37)){_0x54bed8++;continue;}if(_0x137b37[_0x4f49a2(0x16b)]()===''&&_0x54bed8>0x0){_0x54bed8++;continue;}break;}for(;_0x54bed8<_0x4b0fab[_0x4f49a2(0x15e)];_0x54bed8++){_0x82a832[_0x4f49a2(0x178)](_0x4b0fab[_0x54bed8]);}return _0x82a832[_0x4f49a2(0x15b)]('\x0a')[_0x4f49a2(0x158)]();}export function resolveSqlMode(_0x410887,_0x74c804){const _0x1201b0=a131_0x56d521;if(_0x74c804?.['mode'])return _0x74c804[_0x1201b0(0x151)];return detectSqlMode(_0x410887);}export function resolveSqlFileName(_0x56051d,_0xfcf3cb,_0x22220b){const _0x572543=a131_0x56d521;if(_0x22220b?.[_0x572543(0x150)])return _0x22220b[_0x572543(0x150)];if(_0x22220b?.[_0x572543(0x161)]||_0x22220b?.['dbName'])return buildSqlRelativePath(_0x56051d,_0x22220b?.[_0x572543(0x161)],_0x22220b?.['dbName'],resolveSqlMode(_0xfcf3cb,_0x22220b),_0x22220b?.[_0x572543(0x172)]);return buildDefaultSqlFileName(_0x56051d,resolveSqlMode(_0xfcf3cb,_0x22220b));}export function resolveSqlLocalDir(_0x5c5d32,_0x3da1c7){return join(_0x5c5d32,SQL_LOCAL_REL_DIR,_0x3da1c7);}function a131_0x22ab(_0x3bb8ee,_0x16f462){_0x3bb8ee=_0x3bb8ee-0x150;const _0x7d01f2=a131_0x7d01();let _0x22abc1=_0x7d01f2[_0x3bb8ee];return _0x22abc1;}export async function confirmForceOverwrite(_0x34aae5){const _0x4da06f=a131_0x56d521,_0x3f9ac3=createInterface({'input':process[_0x4da06f(0x17c)],'output':process[_0x4da06f(0x17e)]}),_0x30d950=await new Promise(_0x385202=>{_0x3f9ac3['question'](_0x34aae5+'\x20[y/N]\x20',_0x385202);});return _0x3f9ac3[_0x4da06f(0x168)](),['y',_0x4da06f(0x173)][_0x4da06f(0x15d)](_0x30d950['trim']()[_0x4da06f(0x17b)]());}export function findSqlLockScope(_0x20573c,_0x5456d6){const _0x59590a=a131_0x56d521;return _0x20573c[_0x59590a(0x170)][_0x5456d6];}function buildMetadataHeaderLines(_0x460d2c,_0xce4e2f){const _0x586a17=a131_0x56d521,_0x248126=[[_0x586a17(0x15f),_0x460d2c[_0x586a17(0x15f)]],[_0x586a17(0x161),_0x460d2c[_0x586a17(0x161)]],[_0x586a17(0x172),_0x460d2c['dbId']],[_0x586a17(0x162),_0x460d2c[_0x586a17(0x162)]],[_0x586a17(0x151),_0x460d2c['mode']],[_0x586a17(0x16e),_0x460d2c['syncedAt']],[_0x586a17(0x160),_0x460d2c[_0x586a17(0x160)]]];if(_0xce4e2f===_0x586a17(0x180))return _0x248126[_0x586a17(0x17d)](([,_0xeb80fc])=>_0xeb80fc!==undefined&&_0xeb80fc!==null&&String(_0xeb80fc)[_0x586a17(0x16b)]()!=='')[_0x586a17(0x154)](([_0x35fb9d,_0x30aedb])=>_0x586a17(0x16f)+_0x35fb9d+':\x20'+String(_0x30aedb)+_0x586a17(0x157));return _0x248126['filter'](([,_0xa9698d])=>_0xa9698d!==undefined&&_0xa9698d!==null&&String(_0xa9698d)['trim']()!=='')[_0x586a17(0x154)](([_0x259af4,_0x360f9f])=>_0x586a17(0x152)+_0x259af4+':\x20'+String(_0x360f9f));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0x5864c9=a132_0x4d63;(function(_0x47d3a4,_0xc69c7e){const _0xb4988=a132_0x4d63,_0x44bd0d=_0x47d3a4();while(!![]){try{const _0x573a95=-parseInt(_0xb4988(0x1de))/0x1*(parseInt(_0xb4988(0x1e7))/0x2)+-parseInt(_0xb4988(0x1e9))/0x3+parseInt(_0xb4988(0x1d3))/0x4*(-parseInt(_0xb4988(0x1ea))/0x5)+-parseInt(_0xb4988(0x1e2))/0x6+-parseInt(_0xb4988(0x1f2))/0x7+-parseInt(_0xb4988(0x1d8))/0x8+parseInt(_0xb4988(0x1d9))/0x9;if(_0x573a95===_0xc69c7e)break;else _0x44bd0d['push'](_0x44bd0d['shift']());}catch(_0x531325){_0x44bd0d['push'](_0x44bd0d['shift']());}}}(a132_0x1cd9,0x2916d));function a132_0x4d63(_0x11ebee,_0x4238c1){_0x11ebee=_0x11ebee-0x1cf;const _0x1cd9ce=a132_0x1cd9();let _0x4d63de=_0x1cd9ce[_0x11ebee];return _0x4d63de;}import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a132_0x1cd9(){const _0x12495d=['\x20missing,\x20','1849120KfHXwD','7129836iRqxMN','All\x20SQL\x20queries\x20are\x20in\x20sync.','read','filePath','has','2082eSZVQB','sqls','push','keys','683364AKzTka','bool','lockFilePath','lockKey','\x20unchanged','4qvzsKs','remote','185199IJbzlK','274095idxYFp','sqlName','\x20added,\x20','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','sqlCode','relativePath','length','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','1107071GBoQpM','totalCount','sql','appCode','sqlRoot','4SrZpNP','paging','hash','tableData'];a132_0x1cd9=function(){return _0x12495d;};return a132_0x1cd9();}async function fetchAllSqlCodes(_0x24c581){const _0x5dc622=a132_0x4d63,_0x38804b=[];let _0x2cd9cc=0x1;while(!![]){const _0x5bb82a=await listSqlQueries(_0x24c581,{'currentPage':_0x2cd9cc,'pageSize':PAGE_SIZE}),_0x21e8be=_0x5bb82a[_0x5dc622(0x1d6)]??[];_0x38804b['push'](..._0x21e8be['map'](_0x797f97=>_0x797f97[_0x5dc622(0x1ee)]));if(_0x21e8be[_0x5dc622(0x1f0)]===0x0)break;const _0x336096=_0x5bb82a[_0x5dc622(0x1d4)]?.[_0x5dc622(0x1cf)];if(_0x336096!=null?_0x38804b['length']>=_0x336096:_0x21e8be[_0x5dc622(0x1f0)]<PAGE_SIZE)break;_0x2cd9cc++;}return _0x38804b;}export const sqlStatus={'service':a132_0x5864c9(0x1d0),'command':'status','description':a132_0x5864c9(0x1ed),'risk':a132_0x5864c9(0x1db),'flags':[{'name':a132_0x5864c9(0x1e8),'type':'boolean','description':a132_0x5864c9(0x1f1)}],async 'execute'(_0x17a351){const _0x1c893e=a132_0x5864c9,_0x462465=loadSqlProjectConfig(_0x17a351[_0x1c893e(0x1d1)]),_0x38a864=await readSqlLockFile(_0x462465[_0x1c893e(0x1e4)]),{appLock:_0x5c794a}=ensureSqlLockScope(_0x38a864??createEmptySqlLock(),_0x462465[_0x1c893e(0x1d1)],_0x462465[_0x1c893e(0x1d2)],'status'),_0x2d285a=await scanLocalSqlQueries(_0x462465),_0x20982d=[],_0x5e1cc3=[],_0x35ea37=[],_0xd3ff71=[],_0x5237ac=new Set(_0x2d285a['map'](_0x42befd=>_0x42befd[_0x1c893e(0x1e5)]));for(const _0x3d2fe5 of _0x2d285a){const _0x3e8f6d=await computeSqlFileHash(_0x3d2fe5[_0x1c893e(0x1dc)]),_0x378bde=_0x5c794a[_0x1c893e(0x1df)][_0x3d2fe5[_0x1c893e(0x1e5)]],_0x3f562d=!!_0x378bde&&_0x378bde['path']!==_0x3d2fe5[_0x1c893e(0x1ef)],_0x580c62=!!_0x378bde&&!!_0x3d2fe5['sqlName']&&_0x378bde['sqlName']!==_0x3d2fe5[_0x1c893e(0x1eb)];if(!_0x378bde)_0x20982d[_0x1c893e(0x1e0)](_0x3d2fe5[_0x1c893e(0x1e5)]);else _0x378bde[_0x1c893e(0x1d5)]!==_0x3e8f6d||_0x3f562d||_0x580c62?_0x5e1cc3[_0x1c893e(0x1e0)](_0x3d2fe5[_0x1c893e(0x1e5)]):_0x35ea37[_0x1c893e(0x1e0)](_0x3d2fe5[_0x1c893e(0x1e5)]);}for(const _0x56557c of Object[_0x1c893e(0x1e1)](_0x5c794a['sqls'])){!_0x5237ac[_0x1c893e(0x1dd)](_0x56557c)&&_0xd3ff71[_0x1c893e(0x1e0)](_0x56557c);}const _0xdb530e=[];if(_0x17a351[_0x1c893e(0x1e3)](_0x1c893e(0x1e8))){const _0x122021=await fetchAllSqlCodes(_0x17a351[_0x1c893e(0x1d1)]);for(const _0x5280a1 of _0x122021){!_0x5237ac[_0x1c893e(0x1dd)](_0x5280a1)&&!_0x5c794a[_0x1c893e(0x1df)][_0x5280a1]&&_0xdb530e[_0x1c893e(0x1e0)](_0x5280a1);}}const _0x5082a3=_0x20982d[_0x1c893e(0x1f0)]===0x0&&_0x5e1cc3[_0x1c893e(0x1f0)]===0x0&&_0xd3ff71[_0x1c893e(0x1f0)]===0x0&&_0xdb530e[_0x1c893e(0x1f0)]===0x0;return{'ok':!![],'data':{'added':_0x20982d,'modified':_0x5e1cc3,'missing':_0xd3ff71,'unchanged':_0x35ea37,'remoteOnly':_0xdb530e},'message':_0x5082a3?_0x1c893e(0x1da):_0x20982d[_0x1c893e(0x1f0)]+_0x1c893e(0x1ec)+_0x5e1cc3[_0x1c893e(0x1f0)]+'\x20modified,\x20'+_0xd3ff71[_0x1c893e(0x1f0)]+_0x1c893e(0x1d7)+_0x35ea37[_0x1c893e(0x1f0)]+_0x1c893e(0x1e6)+(_0xdb530e[_0x1c893e(0x1f0)]>0x0?',\x20'+_0xdb530e[_0x1c893e(0x1f0)]+'\x20remote-only':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a133_0x55c566=a133_0x1c9d;(function(_0x4e5251,_0x38e347){const _0x695ffc=a133_0x1c9d,_0x3150e0=_0x4e5251();while(!![]){try{const _0x408d0f=parseInt(_0x695ffc(0x174))/0x1*(parseInt(_0x695ffc(0x178))/0x2)+parseInt(_0x695ffc(0x172))/0x3*(-parseInt(_0x695ffc(0x185))/0x4)+parseInt(_0x695ffc(0x17e))/0x5*(-parseInt(_0x695ffc(0x19a))/0x6)+-parseInt(_0x695ffc(0x182))/0x7*(-parseInt(_0x695ffc(0x179))/0x8)+-parseInt(_0x695ffc(0x18e))/0x9*(-parseInt(_0x695ffc(0x193))/0xa)+-parseInt(_0x695ffc(0x18d))/0xb*(parseInt(_0x695ffc(0x19b))/0xc)+-parseInt(_0x695ffc(0x18f))/0xd*(-parseInt(_0x695ffc(0x1a5))/0xe);if(_0x408d0f===_0x38e347)break;else _0x3150e0['push'](_0x3150e0['shift']());}catch(_0xdbbef1){_0x3150e0['push'](_0x3150e0['shift']());}}}(a133_0x5ac4,0x36462));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a133_0x5ac4(){const _0x33fc99=['isDangerous','\x22\x20not\x20found\x20or\x20not\x20accessible','490DFpLuz','map','string','validation','Dataset\x20\x22','dbtableConfig','isSelectOnly','98436OrchvN','480duMBSM','sql','tables','size','tableName','schemas','Table\x20\x22','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','validate','trim','490hTnFLA','get','Provide\x20--file\x20or\x20--sql','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','appCode','schemaWarnings','fields','5361PKuVsf','str','9364TeytMP','flagMissing','filter','valid','94DmKdoj','779696pMXbJl','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','sqlType','SQL\x20schema\x20validation','5WapziF','schema:','push','utf-8','7gjQzmZ','read','parameters','740uYDGcp','split','\x22\x20not\x20found\x20in\x20any\x20dataset','cwd','toLowerCase','isArray','file','reason','109450UJqzvU','11997mhPpQY','135356ttynBN','type'];a133_0x5ac4=function(){return _0x33fc99;};return a133_0x5ac4();}function a133_0x1c9d(_0x3decb1,_0x5d911a){_0x3decb1=_0x3decb1-0x16c;const _0x5ac43b=a133_0x5ac4();let _0x1c9d94=_0x5ac43b[_0x3decb1];return _0x1c9d94;}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_0x55c566(0x19c),'command':a133_0x55c566(0x1a3),'description':a133_0x55c566(0x1a2),'risk':a133_0x55c566(0x183),'flags':[{'name':'file','type':a133_0x55c566(0x195),'description':a133_0x55c566(0x17a)},{'name':'sql','type':'string','description':a133_0x55c566(0x16e)},{'name':a133_0x55c566(0x1a0),'type':'string','description':a133_0x55c566(0x17b)}],async 'execute'(_0x57a65a){const _0x398379=a133_0x55c566,_0x19dd1f=_0x57a65a[_0x398379(0x173)](_0x398379(0x18b)),_0x2a28a1=_0x57a65a[_0x398379(0x173)](_0x398379(0x19c));if(!_0x19dd1f&&!_0x2a28a1)throw CliErrors[_0x398379(0x175)](_0x398379(0x18b),_0x398379(0x16d));let _0x15a5cc;if(_0x19dd1f){const _0x536c8d=resolve(process[_0x398379(0x188)](),_0x19dd1f);if(!existsSync(_0x536c8d))throw CliErrors[_0x398379(0x196)]('File\x20not\x20found:\x20'+_0x536c8d);_0x15a5cc=readFileSync(_0x536c8d,_0x398379(0x181));}else _0x15a5cc=_0x2a28a1;const _0x4dd14f=validateSql(_0x15a5cc),_0x3fe611={'valid':_0x4dd14f[_0x398379(0x177)],'sqlType':_0x4dd14f[_0x398379(0x17c)][_0x398379(0x190)],'isSelectOnly':_0x4dd14f['sqlType'][_0x398379(0x199)],'isDangerous':_0x4dd14f[_0x398379(0x17c)][_0x398379(0x191)],'tables':_0x4dd14f[_0x398379(0x19d)],'parameters':_0x4dd14f[_0x398379(0x184)],'message':_0x4dd14f['message']};_0x4dd14f['sqlType']['reason']&&(_0x3fe611[_0x398379(0x18c)]=_0x4dd14f['sqlType']['reason']);const _0x2250b9=_0x57a65a[_0x398379(0x173)](_0x398379(0x1a0));if(_0x2250b9&&_0x4dd14f[_0x398379(0x177)]){const _0x52fdd1=_0x2250b9[_0x398379(0x186)](',')[_0x398379(0x194)](_0x4e92af=>_0x4e92af[_0x398379(0x1a4)]())[_0x398379(0x176)](Boolean),_0x5a5a7f=[],_0x44d130=filterDbTableBackedDatasets(await listDatasets(_0x57a65a[_0x398379(0x16f)])),_0x57dfd3=new Map(_0x44d130[_0x398379(0x194)](_0x58e7ed=>[_0x58e7ed['dbtableConfig']?.[_0x398379(0x19f)]?.[_0x398379(0x189)](),_0x58e7ed]));for(const _0x2313c9 of _0x4dd14f[_0x398379(0x19d)]){const _0x4cb073=_0x57dfd3[_0x398379(0x16c)](_0x2313c9['toLowerCase']());!_0x4cb073&&_0x5a5a7f[_0x398379(0x180)](_0x398379(0x1a1)+_0x2313c9+_0x398379(0x187));}for(const _0x241846 of _0x52fdd1){let _0x28aeef;try{_0x28aeef=await getDatasetDetail(_0x241846);}catch{_0x5a5a7f[_0x398379(0x180)](_0x398379(0x197)+_0x241846+_0x398379(0x192));continue;}assertDatasetIsDbTableBacked(_0x28aeef,_0x398379(0x17d));const _0x125392=Array[_0x398379(0x18a)](_0x28aeef['fields'])?_0x28aeef[_0x398379(0x171)]:[],_0x2cd226=new Set(_0x125392[_0x398379(0x194)](_0x4b1f95=>_0x4b1f95['name']?.[_0x398379(0x189)]())),_0x239329=_0x28aeef[_0x398379(0x198)]?.[_0x398379(0x19f)]||_0x28aeef[_0x398379(0x19f)]||_0x241846;_0x3fe611[_0x398379(0x17f)+_0x239329]={'code':_0x241846,'tableName':_0x239329,'fieldCount':_0x2cd226[_0x398379(0x19e)],'fields':Array['from'](_0x2cd226)};}_0x5a5a7f['length']>0x0&&(_0x3fe611[_0x398379(0x170)]=_0x5a5a7f);}return{'ok':_0x4dd14f[_0x398379(0x177)],'data':_0x3fe611,'message':_0x4dd14f['message']};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a134_0x28a1(){const _0x2e0564=['12290930zFkomG','en-US','string','Locale','zh-CN','cookie','1510598CSMHfZ','accessKey','3606JvStGg','Risk\x20level','env','defaultApp','toLowerCase','format','pageSize','entries','app','Default\x20page\x20size','length','12xqJgMi','Access\x20key','appcode','116466dGOcNO','Target\x20environment','8912zUUkjR','363015TGLGUu','2502vYyoGJ','inherit','7NUrCfM','trim','keys','map','apiDir','1419445kQWywt','locale','apps','Auth\x20cookie','has','riskLevel'];a134_0x28a1=function(){return _0x2e0564;};return a134_0x28a1();}function a134_0x3259(_0x28dce7,_0x36d1bf){_0x28dce7=_0x28dce7-0x1da;const _0x28a166=a134_0x28a1();let _0x32594b=_0x28a166[_0x28dce7];return _0x32594b;}const a134_0x4d3cf9=a134_0x3259;(function(_0x14fb67,_0x5aeaa0){const _0x160cfb=a134_0x3259,_0x514df7=_0x14fb67();while(!![]){try{const _0x2c837d=-parseInt(_0x160cfb(0x1e0))/0x1+parseInt(_0x160cfb(0x1f7))/0x2+-parseInt(_0x160cfb(0x1e3))/0x3+-parseInt(_0x160cfb(0x1dd))/0x4*(-parseInt(_0x160cfb(0x1eb))/0x5)+parseInt(_0x160cfb(0x1f9))/0x6*(parseInt(_0x160cfb(0x1e6))/0x7)+-parseInt(_0x160cfb(0x1e2))/0x8*(-parseInt(_0x160cfb(0x1e4))/0x9)+-parseInt(_0x160cfb(0x1f1))/0xa;if(_0x2c837d===_0x5aeaa0)break;else _0x514df7['push'](_0x514df7['shift']());}catch(_0x56aff4){_0x514df7['push'](_0x514df7['shift']());}}}(a134_0x28a1,0x6e087));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_0x4d3cf9(0x1f6),'accessKey',a134_0x4d3cf9(0x1ec),a134_0x4d3cf9(0x1fe),a134_0x4d3cf9(0x1f0)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a134_0x4d3cf9(0x1df),'env','locale','format',a134_0x4d3cf9(0x1f6),a134_0x4d3cf9(0x1f8),a134_0x4d3cf9(0x1ea)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x1595f9){return[..._0x1595f9]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x149324){const _0x44a9d8=a134_0x4d3cf9;return TOP_LEVEL_CONFIG_KEYS[_0x44a9d8(0x1ef)](_0x149324);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a134_0x4d3cf9(0x1fb),'apiDir':a134_0x4d3cf9(0x1ea),'cookie':'cookie','accessKey':a134_0x4d3cf9(0x1f8),'defaultFormat':a134_0x4d3cf9(0x1fe),'pageSize':a134_0x4d3cf9(0x1ff),'riskLevel':'riskLevel','locale':a134_0x4d3cf9(0x1ec)};export function getAppProfileFlagDefs(){const _0x212d85=a134_0x4d3cf9;return[{'name':_0x212d85(0x1fb),'type':_0x212d85(0x1f3),'description':_0x212d85(0x1e1),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x212d85(0x1ea),'type':_0x212d85(0x1f3),'description':'API\x20directory\x20path'},{'name':_0x212d85(0x1f6),'type':'string','description':_0x212d85(0x1ee),'hidden':!![]},{'name':_0x212d85(0x1f8),'type':_0x212d85(0x1f3),'description':_0x212d85(0x1de),'hidden':!![]},{'name':'defaultFormat','type':_0x212d85(0x1f3),'description':'Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':'number','description':_0x212d85(0x1db)},{'name':_0x212d85(0x1f0),'type':'string','description':_0x212d85(0x1fa),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x212d85(0x1ec),'type':_0x212d85(0x1f3),'description':_0x212d85(0x1f4)}];}export function collectAppProfileOverrides(_0x409b15){const _0x22b9c9=a134_0x4d3cf9,_0x2fe706={};for(const [_0x480bb3,_0x430771]of Object[_0x22b9c9(0x200)](APP_PROFILE_FLAG_KEY_MAP)){const _0xcbe191=_0x409b15(_0x480bb3);if(!_0xcbe191)continue;_0x2fe706[_0x430771]=_0x430771===_0x22b9c9(0x1ff)?Number(_0xcbe191):_0xcbe191;}return _0x2fe706;}export function buildAppProfileListFields(_0x1514fe){const _0x1f0973=a134_0x4d3cf9;return{'env':_0x1514fe[_0x1f0973(0x1fb)]??null,'apiDir':_0x1514fe[_0x1f0973(0x1ea)]??null,'hasCookie':!!_0x1514fe['cookie'],'hasAccessKey':!!_0x1514fe[_0x1f0973(0x1f8)],'format':_0x1514fe[_0x1f0973(0x1fe)]??null,'pageSize':_0x1514fe[_0x1f0973(0x1ff)]??null,'riskLevel':_0x1514fe[_0x1f0973(0x1f0)]??null,'locale':_0x1514fe[_0x1f0973(0x1ec)]??null};}export function buildAppDoctorFields(_0x39c609,_0x41e96c){const _0x514b3b=a134_0x4d3cf9;return{'env':{'value':_0x39c609[_0x514b3b(0x1fb)]||_0x41e96c[_0x514b3b(0x1fb)],'source':_0x39c609['env']?_0x514b3b(0x1da):_0x514b3b(0x1e5)},'apiDir':{'value':_0x39c609['apiDir']||_0x41e96c[_0x514b3b(0x1ea)],'source':_0x39c609[_0x514b3b(0x1ea)]?_0x514b3b(0x1da):'inherit'},'cookie':{'value':_0x39c609['cookie']||_0x41e96c[_0x514b3b(0x1f6)],'source':_0x39c609[_0x514b3b(0x1f6)]?'app':'inherit'},'accessKey':{'value':_0x39c609[_0x514b3b(0x1f8)]||_0x41e96c['accessKey'],'source':_0x39c609['accessKey']?_0x514b3b(0x1da):_0x514b3b(0x1e5)}};}export function buildCanonicalAppConfig(_0x22c7e8,_0x1350d0){const _0x28e056=a134_0x4d3cf9,_0x57e57e=_0x22c7e8[_0x28e056(0x1e9)](_0x4cac9e=>String(_0x4cac9e||'')[_0x28e056(0x1e7)]())['filter'](Boolean);if(_0x57e57e[_0x28e056(0x1dc)]===0x0)return{};const _0x1e7737={};for(const _0x48f76a of _0x57e57e){_0x1e7737[_0x48f76a]=_0x1350d0?{'appcode':_0x48f76a,'env':_0x1350d0}:{'appcode':_0x48f76a};}return{'apps':_0x1e7737,'defaultApp':_0x57e57e[0x0]};}export function buildCanonicalProjectConfig(_0x5b4bc1,_0x411d0b){const _0x4731d9=a134_0x4d3cf9,{appCodes:appCodes=[],env:_0x156b5c,metadata:_0x535ba7}=_0x411d0b,_0x313161={..._0x5b4bc1,..._0x535ba7||{}};delete _0x313161['appcode'],delete _0x313161['app'];if(_0x156b5c)_0x313161[_0x4731d9(0x1fb)]=_0x156b5c;else!_0x313161[_0x4731d9(0x1fb)]&&(_0x313161['env']=DEFAULT_CONFIG_VALUES[_0x4731d9(0x1fb)]);const _0x113f82=buildCanonicalAppConfig(appCodes,_0x313161['env']);return Object[_0x4731d9(0x1e8)](_0x113f82)['length']>0x0&&(_0x313161['apps']=_0x113f82[_0x4731d9(0x1ed)],_0x313161[_0x4731d9(0x1fc)]=_0x113f82['defaultApp']),_0x313161;}const LOCALE_MAP={'zh':a134_0x4d3cf9(0x1f5),'zh-cn':a134_0x4d3cf9(0x1f5),'zh_cn':a134_0x4d3cf9(0x1f5),'en':a134_0x4d3cf9(0x1f2),'en-us':a134_0x4d3cf9(0x1f2),'en_us':'en-US'};export function normalizeLocale(_0x2fd8bd){const _0x32a50e=a134_0x4d3cf9;if(!_0x2fd8bd)return null;return LOCALE_MAP[_0x2fd8bd[_0x32a50e(0x1fd)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a135_0x6ea6(_0x2499eb,_0x59868f){_0x2499eb=_0x2499eb-0x118;const _0x12d9d8=a135_0x12d9();let _0x6ea613=_0x12d9d8[_0x2499eb];return _0x6ea613;}function a135_0x12d9(){const _0x639d01=['11008jXLNAa','979670KOydVj','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','122193DxDsZr','158244GmsSUz','649644ykqGgR','78SqMjTt','1173123hMSSZd','72TgtBBZ','67991ulcYtS','121ZJLQKI','5ZVRRdP','2VLJzek'];a135_0x12d9=function(){return _0x639d01;};return a135_0x12d9();}const a135_0x1f47e3=a135_0x6ea6;(function(_0x4a3671,_0xf720e){const _0x5bae67=a135_0x6ea6,_0x3697cc=_0x4a3671();while(!![]){try{const _0x4d2def=-parseInt(_0x5bae67(0x11f))/0x1*(-parseInt(_0x5bae67(0x11b))/0x2)+parseInt(_0x5bae67(0x122))/0x3*(parseInt(_0x5bae67(0x11c))/0x4)+-parseInt(_0x5bae67(0x11a))/0x5*(-parseInt(_0x5bae67(0x121))/0x6)+parseInt(_0x5bae67(0x118))/0x7*(-parseInt(_0x5bae67(0x124))/0x8)+parseInt(_0x5bae67(0x123))/0x9+-parseInt(_0x5bae67(0x11d))/0xa+-parseInt(_0x5bae67(0x119))/0xb*(parseInt(_0x5bae67(0x120))/0xc);if(_0x4d2def===_0xf720e)break;else _0x3697cc['push'](_0x3697cc['shift']());}catch(_0x46db5c){_0x3697cc['push'](_0x3697cc['shift']());}}}(a135_0x12d9,0x18e25));export const CLI_VERSION_POLICY_URL=a135_0x1f47e3(0x11e);
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a136_0x3dc4(){const _0x5f2120=['Select\x20app\x20profile\x20by\x20name','Alias\x20for\x20--non-interactive','project','Enable\x20BFF\x20save','Environment','Use\x20project\x20config\x20scope','Operation\x20type','Use\x20remote','clear','360812TRRMYk','file','code','sqlname','yes','type','skipImports','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Show\x20help','description','all','6MTfbMR','expected-count','title','Title','map','meowKey','datasetcode','43974756wVXxvM','<expr>','env','descriptionFile','dry-run','non-interactive','Output\x20format','sqlcode','Description\x20file','Target\x20path','Force\x20non-interactive\x20mode\x20(CI)','remote','output','SQL\x20string','1421245VKdZpp','Keyword\x20filter','string','app','SQL\x20code','<code>','dbId','function-node','SQL\x20name','<name>','Description','production\x20|\x20daily','20fVYMaZ','value','Record\x20ID','confirm','rabetbase','Skip\x20import\x20generation','name','645446xdKPCV','global','Preview\x20operation\x20without\x20executing','50rwqQeu','db-id','dbid','6wPLBOX','operation','appcode','16641JQgnnG','skip-imports','5720jFZQPF','Config\x20key','Use\x20global\x20config\x20scope','verbose','Code\x20filter','7417781SKdeBp','boolean','help','Verbose\x20output','dryRun','params','target','expectedCount','fromEntries','keyword','366388EyUjVt','Config\x20value','@lovrabet/rabetbase-cli','Override\x20appcode','format','schemas','Apply\x20to\x20all','DB\x20ID','watch','nonInteractive','File\x20path','json\x20|\x20pretty\x20|\x20compress','operation-type','Force\x20overwrite','force','key','Skip\x20confirmation\x20for\x20high-risk\x20writes','page','sqlName','pagesize','Confirm\x20destructive\x20action'];a136_0x3dc4=function(){return _0x5f2120;};return a136_0x3dc4();}const a136_0x5876e3=a136_0x5b84;(function(_0x522504,_0x42af83){const _0x592eac=a136_0x5b84,_0x4f0c1d=_0x522504();while(!![]){try{const _0xc81598=-parseInt(_0x592eac(0x20a))/0x1+parseInt(_0x592eac(0x1d7))/0x2*(-parseInt(_0x592eac(0x1e2))/0x3)+-parseInt(_0x592eac(0x203))/0x4*(parseInt(_0x592eac(0x1f7))/0x5)+parseInt(_0x592eac(0x210))/0x6*(parseInt(_0x592eac(0x21a))/0x7)+parseInt(_0x592eac(0x215))/0x8*(-parseInt(_0x592eac(0x213))/0x9)+-parseInt(_0x592eac(0x20d))/0xa*(parseInt(_0x592eac(0x224))/0xb)+parseInt(_0x592eac(0x1e9))/0xc;if(_0xc81598===_0x42af83)break;else _0x4f0c1d['push'](_0x4f0c1d['shift']());}catch(_0x4fe4de){_0x4f0c1d['push'](_0x4f0c1d['shift']());}}}(a136_0x3dc4,0xc54e8));export const CLI_BIN_NAME=a136_0x5876e3(0x207);export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';function a136_0x5b84(_0x1cc365,_0xbc4eba){_0x1cc365=_0x1cc365-0x1ba;const _0x3dc48f=a136_0x3dc4();let _0x5b8497=_0x3dc48f[_0x1cc365];return _0x5b8497;}export const NPM_PACKAGE_NAME=a136_0x5876e3(0x1bb);export const GLOBAL_FLAGS=[{'name':a136_0x5876e3(0x212),'meowKey':'appcode','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1bc),'hint':a136_0x5876e3(0x1fc)},{'name':'app','meowKey':'app','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1ce),'hint':a136_0x5876e3(0x200)},{'name':a136_0x5876e3(0x1eb),'meowKey':a136_0x5876e3(0x1eb),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1d2),'hint':a136_0x5876e3(0x202)},{'name':a136_0x5876e3(0x1bd),'meowKey':a136_0x5876e3(0x1bd),'type':'string','description':a136_0x5876e3(0x1ef),'hint':a136_0x5876e3(0x1c4)},{'name':'jq','meowKey':'jq','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1de),'hint':a136_0x5876e3(0x1ea)},{'name':a136_0x5876e3(0x1ed),'meowKey':a136_0x5876e3(0x21e),'type':'boolean','description':a136_0x5876e3(0x20c)},{'name':a136_0x5876e3(0x1db),'meowKey':a136_0x5876e3(0x1db),'type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1c9)},{'name':a136_0x5876e3(0x1ee),'meowKey':a136_0x5876e3(0x1c2),'type':'boolean','description':a136_0x5876e3(0x1f3)},{'name':a136_0x5876e3(0x20b),'meowKey':a136_0x5876e3(0x20b),'type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x217)},{'name':a136_0x5876e3(0x1d0),'meowKey':a136_0x5876e3(0x1d0),'type':'boolean','description':a136_0x5876e3(0x1d3)},{'name':'ci','meowKey':'ci','type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1cf),'hidden':!![]},{'name':a136_0x5876e3(0x21c),'meowKey':a136_0x5876e3(0x21c),'type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1df)},{'name':a136_0x5876e3(0x209),'meowKey':a136_0x5876e3(0x209),'type':a136_0x5876e3(0x1f9),'description':'Name','hidden':!![]},{'name':a136_0x5876e3(0x1e4),'meowKey':'title','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1e5),'hidden':!![]},{'name':a136_0x5876e3(0x1d6),'meowKey':a136_0x5876e3(0x1d6),'type':'boolean','description':'Clear','hidden':!![]},{'name':a136_0x5876e3(0x1c1),'meowKey':a136_0x5876e3(0x1c1),'type':'boolean','description':'Watch\x20mode','hidden':!![]},{'name':a136_0x5876e3(0x1f5),'meowKey':a136_0x5876e3(0x1f5),'type':a136_0x5876e3(0x1f9),'description':'Output\x20path','hidden':!![]},{'name':'params','meowKey':a136_0x5876e3(0x21f),'type':a136_0x5876e3(0x1f9),'description':'JSON\x20params','hidden':!![]},{'name':'datasetcode','meowKey':a136_0x5876e3(0x1e8),'type':a136_0x5876e3(0x1f9),'description':'Dataset\x20code','hidden':!![]},{'name':a136_0x5876e3(0x1e1),'meowKey':a136_0x5876e3(0x1e1),'type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1bf),'hidden':!![]},{'name':'enable-bff-save','meowKey':'enableBffSave','type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1d1),'hidden':!![]},{'name':'id','meowKey':'id','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x205),'hidden':!![]},{'name':a136_0x5876e3(0x1dc),'meowKey':'type','type':a136_0x5876e3(0x1f9),'description':'Type\x20filter','hidden':!![]},{'name':a136_0x5876e3(0x1d8),'meowKey':a136_0x5876e3(0x1d8),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1c3),'hidden':!![]},{'name':'sqlcode','meowKey':a136_0x5876e3(0x1f0),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1fb),'hidden':!![]},{'name':'sql-name','meowKey':a136_0x5876e3(0x1cb),'type':a136_0x5876e3(0x1f9),'description':'SQL\x20name','hidden':!![]},{'name':a136_0x5876e3(0x1da),'meowKey':a136_0x5876e3(0x1da),'type':'string','description':a136_0x5876e3(0x1ff),'hidden':!![]},{'name':a136_0x5876e3(0x20e),'meowKey':a136_0x5876e3(0x1fd),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1c0),'hidden':!![]},{'name':a136_0x5876e3(0x20f),'meowKey':a136_0x5876e3(0x20f),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1c0),'hidden':!![]},{'name':a136_0x5876e3(0x1e0),'meowKey':a136_0x5876e3(0x1e0),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x201),'hidden':!![]},{'name':'description-file','meowKey':a136_0x5876e3(0x1ec),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1f1),'hidden':!![]},{'name':'page','meowKey':a136_0x5876e3(0x1ca),'type':'string','description':'Page\x20number','hidden':!![]},{'name':a136_0x5876e3(0x1cc),'meowKey':a136_0x5876e3(0x1cc),'type':a136_0x5876e3(0x1f9),'description':'Page\x20size','hidden':!![]},{'name':a136_0x5876e3(0x223),'meowKey':a136_0x5876e3(0x223),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1f8),'hidden':!![]},{'name':a136_0x5876e3(0x1d9),'meowKey':'code','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x219),'hidden':!![]},{'name':'sql','meowKey':'sql','type':'string','description':a136_0x5876e3(0x1f6),'hidden':!![]},{'name':'schemas','meowKey':a136_0x5876e3(0x1be),'type':a136_0x5876e3(0x1f9),'description':'Schemas','hidden':!![]},{'name':a136_0x5876e3(0x211),'meowKey':'operation','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1d4),'hidden':!![]},{'name':a136_0x5876e3(0x220),'meowKey':a136_0x5876e3(0x220),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1f2),'hidden':!![]},{'name':a136_0x5876e3(0x214),'meowKey':a136_0x5876e3(0x1dd),'type':'boolean','description':a136_0x5876e3(0x208),'hidden':!![]},{'name':a136_0x5876e3(0x1c8),'meowKey':a136_0x5876e3(0x1c8),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x216),'hidden':!![]},{'name':a136_0x5876e3(0x204),'meowKey':a136_0x5876e3(0x204),'type':'string','description':a136_0x5876e3(0x1ba),'hidden':!![]},{'name':a136_0x5876e3(0x1c7),'meowKey':a136_0x5876e3(0x1c7),'type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1c6),'hidden':!![]},{'name':'confirm','meowKey':a136_0x5876e3(0x206),'type':'boolean','description':a136_0x5876e3(0x1cd),'hidden':!![]},{'name':'remote','meowKey':a136_0x5876e3(0x1f4),'type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1d5),'hidden':!![]},{'name':a136_0x5876e3(0x218),'meowKey':'verbose','type':'boolean','description':a136_0x5876e3(0x21d),'hidden':!![]},{'name':a136_0x5876e3(0x1e3),'meowKey':a136_0x5876e3(0x221),'type':a136_0x5876e3(0x1f9),'description':'Expected\x20affected\x20count','hidden':!![]},{'name':a136_0x5876e3(0x1c5),'meowKey':'operationType','type':'string','description':a136_0x5876e3(0x1d4),'hidden':!![]},{'name':a136_0x5876e3(0x1fe),'meowKey':'functionNode','type':'string','description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a136_0x5876e3(0x212),a136_0x5876e3(0x1fa),a136_0x5876e3(0x1eb),a136_0x5876e3(0x1bd),'jq',a136_0x5876e3(0x1ed),a136_0x5876e3(0x1db),a136_0x5876e3(0x1ee),'ci']);export function buildMeowFlags(){const _0x43367b=a136_0x5876e3;return Object[_0x43367b(0x222)](GLOBAL_FLAGS[_0x43367b(0x1e6)](_0x29412f=>[_0x29412f[_0x43367b(0x1e7)],{'type':_0x29412f[_0x43367b(0x1dc)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a137_0x5cbb41=a137_0xd427;function a137_0xd427(_0x3a595a,_0x1bfcae){_0x3a595a=_0x3a595a-0xcf;const _0x24bbdd=a137_0x24bb();let _0xd4277a=_0x24bbdd[_0x3a595a];return _0xd4277a;}function a137_0x24bb(){const _0x53c8c1=['production','13088LXkALw','330XBhVKV','1787mRwgcF','307014qNISTH','9YymgFg','695egVfRD','14WNYnoT','2246409pSlycZ','en-US','high-risk-write','6111220feYXjO','13356RFcMam','1177912iyKTFI'];a137_0x24bb=function(){return _0x53c8c1;};return a137_0x24bb();}(function(_0x112e81,_0x18abdc){const _0x1e49d8=a137_0xd427,_0x2fd12d=_0x112e81();while(!![]){try{const _0x30930c=parseInt(_0x1e49d8(0xd3))/0x1*(-parseInt(_0x1e49d8(0xd7))/0x2)+parseInt(_0x1e49d8(0xd4))/0x3+parseInt(_0x1e49d8(0xd1))/0x4*(parseInt(_0x1e49d8(0xd6))/0x5)+parseInt(_0x1e49d8(0xd2))/0x6*(parseInt(_0x1e49d8(0xdc))/0x7)+parseInt(_0x1e49d8(0xcf))/0x8+-parseInt(_0x1e49d8(0xd5))/0x9*(parseInt(_0x1e49d8(0xdb))/0xa)+parseInt(_0x1e49d8(0xd8))/0xb;if(_0x30930c===_0x18abdc)break;else _0x2fd12d['push'](_0x2fd12d['shift']());}catch(_0x28d023){_0x2fd12d['push'](_0x2fd12d['shift']());}}}(a137_0x24bb,0x5f319));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a137_0x5cbb41(0xd0),'format':'compress','locale':a137_0x5cbb41(0xd9),'riskLevel':a137_0x5cbb41(0xda),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT='compress';
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a138_0x36b6(_0x393a3e,_0xfd0555){_0x393a3e=_0x393a3e-0xe6;const _0x5ccc79=a138_0x5ccc();let _0x36b606=_0x5ccc79[_0x393a3e];return _0x36b606;}function a138_0x5ccc(){const _0x56d404=['userDomain','12401165zeyDNR','2781ePwPwr','1186ETuJRS','4psAQCw','runtimeDomain','https://daily-runtime.lovrabet.com','https://app.lovrabet.com','https://api.lovrabet.com','/app/','https://runtime.lovrabet.com','apiDomain','4784195czaEiF','trim','7406580BJkRJc','1134vGtngQ','164630zezZsm','https://user-daily.lovrabet.com','420679yODuGc','6794328nlEtQl'];a138_0x5ccc=function(){return _0x56d404;};return a138_0x5ccc();}const a138_0x22959d=a138_0x36b6;(function(_0x3b1052,_0x303c4e){const _0x2ee2e4=a138_0x36b6,_0x7d7adc=_0x3b1052();while(!![]){try{const _0x24ced9=parseInt(_0x2ee2e4(0xf5))/0x1+parseInt(_0x2ee2e4(0xe6))/0x2*(parseInt(_0x2ee2e4(0xf2))/0x3)+parseInt(_0x2ee2e4(0xe7))/0x4*(-parseInt(_0x2ee2e4(0xef))/0x5)+-parseInt(_0x2ee2e4(0xf1))/0x6+-parseInt(_0x2ee2e4(0xf8))/0x7+-parseInt(_0x2ee2e4(0xf6))/0x8+parseInt(_0x2ee2e4(0xf9))/0x9*(parseInt(_0x2ee2e4(0xf3))/0xa);if(_0x24ced9===_0x303c4e)break;else _0x7d7adc['push'](_0x7d7adc['shift']());}catch(_0x173d31){_0x7d7adc['push'](_0x7d7adc['shift']());}}}(a138_0x5ccc,0xe08c1));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x3c8dba){const _0x549a81=a138_0x36b6;customApiDomain=_0x3c8dba?.[_0x549a81(0xee)],customUserDomain=_0x3c8dba?.[_0x549a81(0xf7)],customRuntimeDomain=_0x3c8dba?.[_0x549a81(0xe8)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a138_0x22959d(0xf4));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a138_0x22959d(0xeb):'https://daily-api.lovrabet.com');export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a138_0x22959d(0xed):a138_0x22959d(0xe9));export const getAppDomain=()=>isProduction(getEnv())?a138_0x22959d(0xea):'https://daily.lovrabet.com';export const getAppBaseUrl=_0x5c5684=>{const _0xa55e6b=a138_0x22959d,_0x142531=encodeURIComponent(_0x5c5684[_0xa55e6b(0xf0)]());return isProduction(getEnv())?getAppDomain()+_0xa55e6b(0xec)+_0x142531:getAppDomain()+'/web-app/app/'+_0x142531;};
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a139_0x2589(_0x1f3444,_0x3e0520){_0x1f3444=_0x1f3444-0xe4;const _0x26666e=a139_0x2666();let _0x2589f3=_0x26666e[_0x1f3444];return _0x2589f3;}const a139_0x185d1f=a139_0x2589;(function(_0x4ffc34,_0x473b63){const _0x5efc4b=a139_0x2589,_0x329908=_0x4ffc34();while(!![]){try{const _0x3072fc=parseInt(_0x5efc4b(0xeb))/0x1*(-parseInt(_0x5efc4b(0xef))/0x2)+-parseInt(_0x5efc4b(0xf0))/0x3*(-parseInt(_0x5efc4b(0xea))/0x4)+-parseInt(_0x5efc4b(0xee))/0x5+parseInt(_0x5efc4b(0xf3))/0x6*(parseInt(_0x5efc4b(0xe8))/0x7)+-parseInt(_0x5efc4b(0xe9))/0x8*(parseInt(_0x5efc4b(0xf2))/0x9)+-parseInt(_0x5efc4b(0xe6))/0xa*(parseInt(_0x5efc4b(0xe7))/0xb)+parseInt(_0x5efc4b(0xec))/0xc;if(_0x3072fc===_0x473b63)break;else _0x329908['push'](_0x329908['shift']());}catch(_0x3644e8){_0x329908['push'](_0x329908['shift']());}}}(a139_0x2666,0xd9223));export const RABETBASE_ENV_VALUES=['production',a139_0x185d1f(0xe4)];export function normalizeEnv(_0x5baa7e){const _0x49ee78=a139_0x185d1f;return _0x5baa7e==='online'?_0x49ee78(0xf1):_0x5baa7e;}export function isProduction(_0x61bf60){const _0x1a7f45=a139_0x185d1f;return normalizeEnv(_0x61bf60)===_0x1a7f45(0xf1);}export function isDaily(_0x44d6ea){const _0xa35651=a139_0x185d1f;return normalizeEnv(_0x44d6ea)===_0xa35651(0xe4);}function a139_0x2666(){const _0x3bda2f=['6124940JtRkyL','11dHXfrq','7sgsAbQ','4471496hRnfew','5808524meAFXS','112657bhFHen','13487892NtkHGK','dev','5205410eGCIBr','16NnBgga','3aFDVyF','production','9ItCiCZ','8562156oTygjw','daily','development'];a139_0x2666=function(){return _0x3bda2f;};return a139_0x2666();}export function isDev(_0x462dfd){const _0xc29c52=a139_0x185d1f,_0x595ce0=normalizeEnv(_0x462dfd);return _0x595ce0===_0xc29c52(0xe5)||_0x595ce0===_0xc29c52(0xed);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a139_0x185d1f(0xf1));export function getEnv(){return env;}export function initEnv(_0x40b149){env=normalizeEnv(_0x40b149);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a140_0x4e5b(){const _0x21944d=['1367076mIWUsv','468006GMkTua','json','3206380QbGJPf','2mnBRnM','1365411zHwmPZ','1211812YSSFMd','compress','1625136lhcfqK','313124dnzxkc'];a140_0x4e5b=function(){return _0x21944d;};return a140_0x4e5b();}const a140_0x5efc3b=a140_0x2fda;function a140_0x2fda(_0x3972f4,_0xc46618){_0x3972f4=_0x3972f4-0x1ac;const _0x4e5b34=a140_0x4e5b();let _0x2fda0e=_0x4e5b34[_0x3972f4];return _0x2fda0e;}(function(_0x47f929,_0x3fdf84){const _0x1da8db=a140_0x2fda,_0x29553f=_0x47f929();while(!![]){try{const _0x9aae9c=parseInt(_0x1da8db(0x1b3))/0x1+-parseInt(_0x1da8db(0x1ae))/0x2*(-parseInt(_0x1da8db(0x1af))/0x3)+parseInt(_0x1da8db(0x1b4))/0x4+-parseInt(_0x1da8db(0x1ad))/0x5+-parseInt(_0x1da8db(0x1b5))/0x6+parseInt(_0x1da8db(0x1b0))/0x7+-parseInt(_0x1da8db(0x1b2))/0x8;if(_0x9aae9c===_0x3fdf84)break;else _0x29553f['push'](_0x29553f['shift']());}catch(_0x443d6d){_0x29553f['push'](_0x29553f['shift']());}}}(a140_0x4e5b,0x58117));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a140_0x5efc3b(0x1ac),'pretty',a140_0x5efc3b(0x1b1)];
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a141_0x3dfb53=a141_0x1443;(function(_0x5bdfc8,_0x4d98e5){const _0x28ff10=a141_0x1443,_0x3483eb=_0x5bdfc8();while(!![]){try{const _0x5d348e=-parseInt(_0x28ff10(0x153))/0x1+parseInt(_0x28ff10(0x158))/0x2+parseInt(_0x28ff10(0x152))/0x3+-parseInt(_0x28ff10(0x159))/0x4*(-parseInt(_0x28ff10(0x157))/0x5)+-parseInt(_0x28ff10(0x156))/0x6+-parseInt(_0x28ff10(0x155))/0x7+parseInt(_0x28ff10(0x154))/0x8;if(_0x5d348e===_0x4d98e5)break;else _0x3483eb['push'](_0x3483eb['shift']());}catch(_0x350fb0){_0x3483eb['push'](_0x3483eb['shift']());}}}(a141_0x46b5,0xea39f));export const DEFAULT_API_DIR=a141_0x3dfb53(0x151);function a141_0x1443(_0xcd3215,_0x1c5329){_0xcd3215=_0xcd3215-0x151;const _0x46b520=a141_0x46b5();let _0x1443d1=_0x46b520[_0xcd3215];return _0x1443d1;}function a141_0x46b5(){const _0x37b28f=['4474694vhnmmU','6842394EZVLIY','35wPlBfG','590970VGXkCO','183856oJwfGg','./src/api','598773cIyheF','1126336LSMNJC','24388352CyqJXQ'];a141_0x46b5=function(){return _0x37b28f;};return a141_0x46b5();}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xf385a2,_0x17db3d){const _0x171230=a142_0x3762,_0x2a258f=_0xf385a2();while(!![]){try{const _0x341fa7=parseInt(_0x171230(0x125))/0x1*(parseInt(_0x171230(0x126))/0x2)+parseInt(_0x171230(0x130))/0x3*(-parseInt(_0x171230(0x12b))/0x4)+-parseInt(_0x171230(0x12e))/0x5*(parseInt(_0x171230(0x129))/0x6)+-parseInt(_0x171230(0x12a))/0x7*(parseInt(_0x171230(0x127))/0x8)+-parseInt(_0x171230(0x12c))/0x9*(parseInt(_0x171230(0x128))/0xa)+-parseInt(_0x171230(0x12f))/0xb*(-parseInt(_0x171230(0x124))/0xc)+-parseInt(_0x171230(0x131))/0xd*(-parseInt(_0x171230(0x12d))/0xe);if(_0x341fa7===_0x17db3d)break;else _0x2a258f['push'](_0x2a258f['shift']());}catch(_0x4fb298){_0x2a258f['push'](_0x2a258f['shift']());}}}(a142_0x13c9,0xbefa8));function a142_0x3762(_0x1bc44a,_0x1ccd34){_0x1bc44a=_0x1bc44a-0x124;const _0x13c929=a142_0x13c9();let _0x376251=_0x13c929[_0x1bc44a];return _0x376251;}function a142_0x13c9(){const _0x3ac6ce=['40UiWnEP','1360271lDVkKj','501369ZLIolK','123773ujGvMe','12qizrno','1338167xWKbAo','2SbCpck','7136IBExDF','60PULjqQ','715794vftfoO','10234uBWYAc','12ZMLYcI','207162mBaWdn','3262HVvheG'];a142_0x13c9=function(){return _0x3ac6ce;};return a142_0x13c9();}export const RISK_LEVEL_VALUES=['read','write','high-risk-write'];
|