@lovrabet/rabetbase-cli 2.1.6-beta.0 → 2.1.6
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/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x49ec50,_0x198316){const _0x4629f7=a111_0x31c8,_0x34ab0a=_0x49ec50();while(!![]){try{const _0x16b6be=-parseInt(_0x4629f7(0x16f))/0x1+-parseInt(_0x4629f7(0x171))/0x2+-parseInt(_0x4629f7(0x172))/0x3+parseInt(_0x4629f7(0x173))/0x4*(-parseInt(_0x4629f7(0x16e))/0x5)+parseInt(_0x4629f7(0x174))/0x6+-parseInt(_0x4629f7(0x175))/0x7+parseInt(_0x4629f7(0x170))/0x8;if(_0x16b6be===_0x198316)break;else _0x34ab0a['push'](_0x34ab0a['shift']());}catch(_0x2fa52c){_0x34ab0a['push'](_0x34ab0a['shift']());}}}(a111_0x23f1,0xebc92));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';function a111_0x31c8(_0x53c789,_0x5250e6){_0x53c789=_0x53c789-0x16e;const _0x23f1aa=a111_0x23f1();let _0x31c89c=_0x23f1aa[_0x53c789];return _0x31c89c;}function a111_0x23f1(){const _0x1e9fbb=['4DLwSzn','2526066eKEuEK','6856766fiLMCa','3070460BNFXuP','913469sWwbrW','33970112EdAqJe','1330312KnsHfC','1587726KhQTYa'];a111_0x23f1=function(){return _0x1e9fbb;};return a111_0x23f1();}import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a112_0x2c6624=a112_0x4c20;(function(_0xa114a3,_0x424cb1){const _0x4f3049=a112_0x4c20,_0x20aeea=_0xa114a3();while(!![]){try{const _0x1e624b=-parseInt(_0x4f3049(0x1cc))/0x1*(-parseInt(_0x4f3049(0x1ce))/0x2)+parseInt(_0x4f3049(0x1ba))/0x3*(-parseInt(_0x4f3049(0x1c0))/0x4)+-parseInt(_0x4f3049(0x1ca))/0x5+-parseInt(_0x4f3049(0x1c7))/0x6+parseInt(_0x4f3049(0x1cf))/0x7+-parseInt(_0x4f3049(0x1c6))/0x8+parseInt(_0x4f3049(0x1c1))/0x9;if(_0x1e624b===_0x424cb1)break;else _0x20aeea['push'](_0x20aeea['shift']());}catch(_0x1f0f4a){_0x20aeea['push'](_0x20aeea['shift']());}}}(a112_0x35eb,0x2f5cc));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a112_0x4c20(_0x3e7561,_0x254a4d){_0x3e7561=_0x3e7561-0x1b7;const _0x35ebc5=a112_0x35eb();let _0x4c20d9=_0x35ebc5[_0x3e7561];return _0x4c20d9;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':a112_0x2c6624(0x1c9),'description':'List\x20custom\x20SQL\x20queries','risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a112_0x2c6624(0x1c5),'type':a112_0x2c6624(0x1b9),'description':a112_0x2c6624(0x1cd)},{'name':'page','type':a112_0x2c6624(0x1c3),'description':a112_0x2c6624(0x1d4),'default':0x1},{'name':a112_0x2c6624(0x1cb),'type':'number','description':a112_0x2c6624(0x1b7)},{'name':'verbose','type':'boolean','description':a112_0x2c6624(0x1bb)}],async 'execute'(_0x4c79cd){const _0x205cf2=a112_0x2c6624,_0x15d94a=await listSqlQueries(_0x4c79cd['appCode'],{'sqlCode':_0x4c79cd[_0x205cf2(0x1bc)](_0x205cf2(0x1c2))||undefined,'sqlName':_0x4c79cd['str']('name')||undefined,'currentPage':_0x4c79cd[_0x205cf2(0x1b8)](_0x205cf2(0x1d0)),'pageSize':_0x4c79cd[_0x205cf2(0x1b8)]('pagesize',0x32)}),_0x4b4997=_0x4c79cd['bool'](_0x205cf2(0x1c4)),_0x390dd7=_0x15d94a['tableData']??[],_0x516561=_0x15d94a['paging']?.['totalCount']??_0x390dd7[_0x205cf2(0x1d3)];let _0x5f0166;return _0x4b4997?_0x5f0166=_0x390dd7:_0x5f0166=await Promise[_0x205cf2(0x1d5)](_0x390dd7['map'](async _0x36a9f1=>{const _0x5d985c=_0x205cf2;let _0x55d6f4;try{_0x55d6f4=_0x36a9f1['dbId']?await getDbName(_0x4c79cd['appCode'],_0x36a9f1[_0x5d985c(0x1c8)]):undefined;}catch{}return{'sqlCode':_0x36a9f1[_0x5d985c(0x1d6)],'sqlName':_0x36a9f1[_0x5d985c(0x1be)],'description':_0x36a9f1[_0x5d985c(0x1bd)]??'','db':_0x55d6f4?_0x55d6f4+'\x20('+_0x36a9f1[_0x5d985c(0x1c8)]+')':_0x36a9f1[_0x5d985c(0x1c8)]??''};})),{'ok':!![],'data':_0x5f0166,'message':_0x390dd7[_0x205cf2(0x1d3)]===0x0?_0x205cf2(0x1d2):_0x205cf2(0x1d1)+_0x390dd7['length']+_0x205cf2(0x1bf)+_0x516561+').'};}};function a112_0x35eb(){const _0x30d70f=['1603464dNtwwd','198828hNkGPm','dbId','list','823615ummnug','pagesize','85543zjYHlr','Filter\x20by\x20SQL\x20name','2aEFubw','2187948Mccjmf','page','Found\x20','No\x20custom\x20SQL\x20queries\x20found.','length','Page\x20number','all','sqlCode','Page\x20size','num','string','62919iNkKvU','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','str','description','sqlName','\x20SQL\x20queries\x20(total:\x20','20maHuCh','2691432ShycLp','sqlcode','number','verbose','name'];a112_0x35eb=function(){return _0x30d70f;};return a112_0x35eb();}
|
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a113_0x237711=a113_0xd167;(function(_0x35522c,_0x2932f8){const _0x586ea2=a113_0xd167,_0x93a7b=_0x35522c();while(!![]){try{const _0xa77809=-parseInt(_0x586ea2(0xc5))/0x1+-parseInt(_0x586ea2(0xb4))/0x2+parseInt(_0x586ea2(0xbb))/0x3+parseInt(_0x586ea2(0xb6))/0x4*(-parseInt(_0x586ea2(0x9c))/0x5)+-parseInt(_0x586ea2(0x95))/0x6*(-parseInt(_0x586ea2(0xa1))/0x7)+parseInt(_0x586ea2(0x90))/0x8*(-parseInt(_0x586ea2(0xbd))/0x9)+parseInt(_0x586ea2(0xb0))/0xa;if(_0xa77809===_0x2932f8)break;else _0x93a7b['push'](_0x93a7b['shift']());}catch(_0x155186){_0x93a7b['push'](_0x93a7b['shift']());}}}(a113_0x4f45,0x46726));import{readFile,rm,writeFile}from'node:fs/promises';function a113_0xd167(_0x2af9e7,_0x4e6094){_0x2af9e7=_0x2af9e7-0x8d;const _0x4f45f5=a113_0x4f45();let _0xd167f1=_0x4f45f5[_0x2af9e7];return _0xd167f1;}import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';function a113_0x4f45(){const _0x30dcdb=['36rybEfA','name','length','paging','sql','Would\x20pull\x20','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlCode','562992arcpGZ','lockFilePath','path','sqlName','totalCount','replace','629704DfhjFK','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','conflict','pull','\x20written,\x20','984lAwkDv','sqlContent','\x20failed','\x20SQL\x20file(s)\x20into\x20','mybatisXml','filter','push','2295kFsSiZ','catch','dbId','lastSync','Filter\x20by\x20SQL\x20display\x20name','7147UljkyZ','sqlRoot','test','skipped','force','Force\x20overwrite\x20local\x20unsynced\x20changes','utf8','str','write','appCode','message','join','sqlRootDir','nonInteractive','tableData','15497590LJHwUd','toISOString','description','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','536290JNsBsL','split','4916iTHkJV','sqls','Force\x20pull\x20cancelled.','bool','apps','844341hUfjwQ','unchanged'];a113_0x4f45=function(){return _0x30dcdb;};return a113_0x4f45();}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(_0x1e883f,_0xc2f10c){const _0x24cec0=a113_0xd167,_0x5b6215=[];let _0x21cd1e=0x1;while(!![]){const _0x428d51=await listSqlQueries(_0x1e883f,{'currentPage':_0x21cd1e,'pageSize':PAGE_SIZE,'sqlCode':_0xc2f10c['sqlCode'],'sqlName':_0xc2f10c[_0x24cec0(0x8d)]}),_0x481364=_0x428d51[_0x24cec0(0xaf)]??[];_0x5b6215[_0x24cec0(0x9b)](..._0x481364);if(_0x481364['length']===0x0)break;const _0x3436c4=_0x428d51[_0x24cec0(0xc0)]?.[_0x24cec0(0x8e)];if(_0x3436c4!=null?_0x5b6215[_0x24cec0(0xbf)]>=_0x3436c4:_0x481364[_0x24cec0(0xbf)]<PAGE_SIZE)break;_0x21cd1e++;}return _0x5b6215;}async function ensureSqlContent(_0x4d824d){const _0x2a97bf=a113_0xd167;if(_0x4d824d[_0x2a97bf(0x96)]!=null&&String(_0x4d824d['sqlContent'])[_0x2a97bf(0xbf)]>0x0)return _0x4d824d;return getSqlQueryDetail(_0x4d824d[_0x2a97bf(0xc4)]);}export const sqlPull={'service':'sql','command':a113_0x237711(0x93),'description':a113_0x237711(0xc3),'risk':a113_0x237711(0xa9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a113_0x237711(0xbe),'type':'string','description':a113_0x237711(0xa0)},{'name':a113_0x237711(0xa5),'type':'boolean','description':a113_0x237711(0xa6)}],async 'dryRun'(_0x2d4752){const _0x4a490d=a113_0x237711,_0x31ec78=loadSqlProjectConfig(_0x2d4752[_0x4a490d(0xaa)]),_0x13c7da=await readSqlLockFile(_0x31ec78[_0x4a490d(0xc6)]),{appLock:_0x50b9b3}=ensureSqlLockScope(_0x13c7da??createEmptySqlLock(),_0x31ec78[_0x4a490d(0xaa)],_0x31ec78['sqlRoot'],_0x4a490d(0x93)),_0x26b482=await fetchAllSqlQueries(_0x2d4752[_0x4a490d(0xaa)],{'sqlCode':_0x2d4752[_0x4a490d(0xa8)]('sqlcode')||undefined,'sqlName':_0x2d4752[_0x4a490d(0xa8)](_0x4a490d(0xbe))||undefined}),_0x595304=[];for(const _0x55a47f of _0x26b482){const _0x3bf05b=await ensureSqlContent(_0x55a47f),_0x20396e=ensureRemoteSqlContent(_0x3bf05b),_0x2a9732=detectModeFromSql(_0x3bf05b),_0x22feb3=_0x3bf05b[_0x4a490d(0x9e)]?await getDbName(_0x2d4752['appCode'],Number(_0x3bf05b[_0x4a490d(0x9e)]))[_0x4a490d(0x9d)](()=>undefined):undefined,_0x53bce1=buildLocalSqlFileContent({'sqlCode':_0x3bf05b[_0x4a490d(0xc4)],'sqlName':_0x3bf05b[_0x4a490d(0x8d)],'dbId':_0x3bf05b[_0x4a490d(0x9e)]},_0x20396e,{'dbName':_0x22feb3,'mode':_0x2a9732,'syncedAt':new Date()[_0x4a490d(0xb1)](),'description':_0x3bf05b['description']}),_0x17d04d=buildSqlLockEntry(_0x3bf05b,_0x20396e,'',{'dbName':_0x22feb3}),_0xf84928=resolveLocalSqlFilePath(_0x31ec78,_0x3bf05b[_0x4a490d(0xc4)],_0x17d04d);let _0x2be09f='would_pull',_0x532c80;if(await fileExists(_0xf84928)){const _0x11e64e=await readFile(_0xf84928,_0x4a490d(0xa7));isEquivalentPulledSqlFile(_0x11e64e,_0x53bce1,_0x2a9732)?(_0x2be09f=_0x4a490d(0xa4),_0x532c80='unchanged'):(_0x2be09f=_0x4a490d(0x92),_0x532c80=_0x4a490d(0xb3));}_0x595304[_0x4a490d(0x9b)]({'sqlCode':_0x3bf05b[_0x4a490d(0xc4)],'sqlName':_0x3bf05b[_0x4a490d(0x8d)],'filePath':_0xf84928,'status':_0x2be09f,'reason':_0x532c80});}return{'method':'POST','url':_0x4a490d(0x91),'body':{'appCode':_0x2d4752['appCode'],'sqlCode':_0x2d4752[_0x4a490d(0xa8)]('sqlcode')||null,'sqlName':_0x2d4752['str']('name')||null,'files':_0x595304},'description':_0x4a490d(0xc2)+_0x595304[_0x4a490d(0xbf)]+_0x4a490d(0x98)+_0x31ec78[_0x4a490d(0xad)]};},async 'execute'(_0x31b16f){const _0x141bf9=a113_0x237711,_0x2ab250=loadSqlProjectConfig(_0x31b16f[_0x141bf9(0xaa)]),_0x5abfe1=await readSqlLockFile(_0x2ab250['lockFilePath']),{lockData:_0x219fce,appLock:_0x483e50}=ensureSqlLockScope(_0x5abfe1??createEmptySqlLock(),_0x2ab250[_0x141bf9(0xaa)],_0x2ab250[_0x141bf9(0xa2)],_0x141bf9(0x93)),_0x14638d=_0x31b16f[_0x141bf9(0xb9)]('force'),_0x3377ce=await fetchAllSqlQueries(_0x31b16f[_0x141bf9(0xaa)],{'sqlCode':_0x31b16f[_0x141bf9(0xa8)]('sqlcode')||undefined,'sqlName':_0x31b16f['str'](_0x141bf9(0xbe))||undefined});if(_0x3377ce[_0x141bf9(0xbf)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0xa6ed8d=[],_0x57483b=[];for(const _0x247b3e of _0x3377ce){try{_0xa6ed8d[_0x141bf9(0x9b)](await ensureSqlContent(_0x247b3e));}catch(_0x5c6ed0){_0x57483b['push']({'sqlCode':_0x247b3e[_0x141bf9(0xc4)],'error':_0x5c6ed0 instanceof Error?_0x5c6ed0[_0x141bf9(0xab)]:String(_0x5c6ed0)});}}if(_0x14638d&&!_0x31b16f[_0x141bf9(0xae)]){let _0x2a7883=![];for(const _0x148c82 of _0xa6ed8d){const _0x1d0f7e=detectModeFromSql(_0x148c82),_0x102fa5=_0x148c82[_0x141bf9(0x9e)]?await getDbName(_0x31b16f[_0x141bf9(0xaa)],Number(_0x148c82['dbId']))[_0x141bf9(0x9d)](()=>undefined):undefined,_0x5054b2=buildLocalSqlFileContent({'sqlCode':_0x148c82['sqlCode'],'sqlName':_0x148c82['sqlName'],'dbId':_0x148c82['dbId']},ensureRemoteSqlContent(_0x148c82),{'dbName':_0x102fa5,'mode':_0x1d0f7e,'syncedAt':new Date()[_0x141bf9(0xb1)](),'description':_0x148c82['description']}),_0x5473c3=resolveLocalSqlFilePath(_0x2ab250,_0x148c82['sqlCode'],buildSqlLockEntry(_0x148c82,ensureRemoteSqlContent(_0x148c82),'',{'dbName':_0x102fa5}));if(await fileExists(_0x5473c3)){const _0x5e3088=await readFile(_0x5473c3,_0x141bf9(0xa7));if(!isEquivalentPulledSqlFile(_0x5e3088,_0x5054b2,_0x1d0f7e)){_0x2a7883=!![];break;}}}if(_0x2a7883){const _0x42238b=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x42238b)throw CliErrors['cancelled'](_0x141bf9(0xb8));}}const _0x3442ee=cloneSqlLockData(_0x219fce),_0x5f447e=_0x3442ee[_0x141bf9(0xba)][_0x2ab250['appCode']],_0x34308e=[],_0x1c0361=[];for(const _0x9afa51 of _0xa6ed8d){const _0x3eafe1=_0x5f447e[_0x141bf9(0xb7)][_0x9afa51[_0x141bf9(0xc4)]],_0x392ce7=ensureRemoteSqlContent(_0x9afa51),_0x23b832=detectModeFromSql(_0x9afa51),_0x144f1a=_0x9afa51[_0x141bf9(0x9e)]?await getDbName(_0x31b16f[_0x141bf9(0xaa)],Number(_0x9afa51[_0x141bf9(0x9e)]))[_0x141bf9(0x9d)](()=>undefined):undefined,_0x287189=buildLocalSqlFileContent({'sqlCode':_0x9afa51['sqlCode'],'sqlName':_0x9afa51[_0x141bf9(0x8d)],'dbId':_0x9afa51[_0x141bf9(0x9e)]},_0x392ce7,{'dbName':_0x144f1a,'mode':_0x23b832,'syncedAt':new Date()[_0x141bf9(0xb1)](),'description':_0x9afa51[_0x141bf9(0xb2)]}),_0x33ce94=buildSqlLockEntry(_0x9afa51,_0x392ce7,computeSqlContentHash(_0x287189),{'dbName':_0x144f1a}),_0xda196=_0x33ce94[_0x141bf9(0xc7)],_0x248fe1=join(_0x2ab250['sqlRootDir'],_0xda196);try{if(await fileExists(_0x248fe1)){const _0x4f0343=await readFile(_0x248fe1,_0x141bf9(0xa7));if(isEquivalentPulledSqlFile(_0x4f0343,_0x287189,_0x23b832)){_0x1c0361[_0x141bf9(0x9b)]({'sqlCode':_0x9afa51[_0x141bf9(0xc4)],'reason':_0x141bf9(0xbc)}),_0x5f447e[_0x141bf9(0xb7)][_0x9afa51[_0x141bf9(0xc4)]]={..._0x33ce94,'hash':computeSqlContentHash(_0x4f0343),'path':_0xda196};continue;}if(!_0x14638d){_0x1c0361[_0x141bf9(0x9b)]({'sqlCode':_0x9afa51['sqlCode'],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x543fea=_0x3eafe1?.[_0x141bf9(0xc7)]?join(_0x2ab250[_0x141bf9(0xad)],_0x3eafe1[_0x141bf9(0xc7)]):undefined;_0x543fea&&_0x543fea!==_0x248fe1&&await fileExists(_0x543fea)&&await rm(_0x543fea,{'force':!![]}),await ensureParentDirectory(_0x248fe1),await writeFile(_0x248fe1,_0x287189,_0x141bf9(0xa7)),_0x5f447e[_0x141bf9(0xb7)][_0x9afa51[_0x141bf9(0xc4)]]={..._0x33ce94,'path':_0xda196},_0x34308e[_0x141bf9(0x9b)]({'sqlCode':_0x9afa51[_0x141bf9(0xc4)],'filePath':_0x248fe1});}catch(_0x4f3c2e){_0x57483b[_0x141bf9(0x9b)]({'sqlCode':_0x9afa51[_0x141bf9(0xc4)],'error':_0x4f3c2e instanceof Error?_0x4f3c2e[_0x141bf9(0xab)]:String(_0x4f3c2e)});}}return _0x5f447e[_0x141bf9(0x9f)]=new Date()['toISOString'](),await writeSqlLockFile(_0x2ab250[_0x141bf9(0xc6)],_0x3442ee),{'ok':_0x57483b['length']===0x0,'data':{'pulled':_0x34308e,'skipped':_0x1c0361,'failed':_0x57483b},'message':'Pull\x20complete:\x20'+_0x34308e['length']+_0x141bf9(0x94)+_0x1c0361[_0x141bf9(0xbf)]+'\x20skipped,\x20'+_0x57483b[_0x141bf9(0xbf)]+_0x141bf9(0x97)};}};function detectModeFromSql(_0x53fa27){const _0x488988=a113_0x237711,_0x223b2c=ensureRemoteSqlContent(_0x53fa27),_0x21257e=stripLocalSqlMetadata(_0x223b2c,_0x488988(0x99))['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x488988(0xa3)](_0x21257e))return _0x488988(0x99);return _0x488988(0xc1);}function isEquivalentPulledSqlFile(_0x30e85b,_0x3b27bc,_0x5ee305){return normalizePullComparableContent(_0x30e85b,_0x5ee305)===normalizePullComparableContent(_0x3b27bc,_0x5ee305);}function normalizePullComparableContent(_0x2254bd,_0x239d9a){const _0x302058=a113_0x237711,_0x2955e2=_0x2254bd[_0x302058(0x8f)](/\r\n/g,'\x0a')[_0x302058(0xb5)]('\x0a'),_0x159b95=_0x2955e2[_0x302058(0x9a)](_0x234b3d=>!isSyncedAtMetadataLine(_0x234b3d,_0x239d9a));return _0x159b95[_0x302058(0xac)]('\x0a');}function isSyncedAtMetadataLine(_0x4f1932,_0x5563f0){const _0x6abf0c=a113_0x237711;if(_0x5563f0===_0x6abf0c(0x99))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x4f1932);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x6abf0c(0xa3)](_0x4f1932);}
|
|
1
|
+
const a113_0x1cf11c=a113_0x5330;(function(_0x23a7c4,_0x5d51de){const _0xba1654=a113_0x5330,_0x522069=_0x23a7c4();while(!![]){try{const _0x4a076=-parseInt(_0xba1654(0xe9))/0x1*(-parseInt(_0xba1654(0xf0))/0x2)+-parseInt(_0xba1654(0x113))/0x3*(parseInt(_0xba1654(0xd9))/0x4)+parseInt(_0xba1654(0xea))/0x5*(-parseInt(_0xba1654(0xe7))/0x6)+-parseInt(_0xba1654(0xdf))/0x7+-parseInt(_0xba1654(0xe8))/0x8*(-parseInt(_0xba1654(0xf9))/0x9)+-parseInt(_0xba1654(0x107))/0xa*(parseInt(_0xba1654(0x10d))/0xb)+parseInt(_0xba1654(0xed))/0xc;if(_0x4a076===_0x5d51de)break;else _0x522069['push'](_0x522069['shift']());}catch(_0x33537d){_0x522069['push'](_0x522069['shift']());}}}(a113_0x1376,0xb5909));function a113_0x1376(){const _0x150923=['filter','skipped','write','name','appCode','bool','description','6MBukoS','65232jtLbQG','125mppoRz','3723605yEfKsn','unchanged','test','32104236FThzRD','path','lastSync','11420vBCUfv','Pull\x20complete:\x20','toISOString','mybatisXml','message','length','Force\x20overwrite\x20local\x20unsynced\x20changes','paging','Would\x20pull\x20','567UpFEoA','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','lockFilePath','sqlContent','sqlName','\x20skipped,\x20','Filter\x20by\x20SQL\x20display\x20name','sqlRootDir','\x20failed','sql','str','sqlcode','force','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','110gaxUvo','catch','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','POST','\x20written,\x20','tableData','680471lqxTAo','nonInteractive','sqls','sqlCode','sqlRoot','utf8','312891PaGbmx','string','No\x20remote\x20SQL\x20queries\x20matched.','replace','join','push','44PGatgg','conflict','boolean','dbId','pull','local\x20differs\x20from\x20remote','4106599HwluCr'];a113_0x1376=function(){return _0x150923;};return a113_0x1376();}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(_0x1e4127,_0x1a74ec){const _0x3cb3d3=a113_0x5330,_0x583309=[];let _0x10bd70=0x1;while(!![]){const _0x25ce9c=await listSqlQueries(_0x1e4127,{'currentPage':_0x10bd70,'pageSize':PAGE_SIZE,'sqlCode':_0x1a74ec[_0x3cb3d3(0x110)],'sqlName':_0x1a74ec['sqlName']}),_0x398979=_0x25ce9c[_0x3cb3d3(0x10c)]??[];_0x583309[_0x3cb3d3(0xd8)](..._0x398979);if(_0x398979[_0x3cb3d3(0xf5)]===0x0)break;const _0x436c01=_0x25ce9c[_0x3cb3d3(0xf7)]?.['totalCount'];if(_0x436c01!=null?_0x583309[_0x3cb3d3(0xf5)]>=_0x436c01:_0x398979[_0x3cb3d3(0xf5)]<PAGE_SIZE)break;_0x10bd70++;}return _0x583309;}async function ensureSqlContent(_0x5e4bb5){const _0x1a5bb9=a113_0x5330;if(_0x5e4bb5[_0x1a5bb9(0xfc)]!=null&&String(_0x5e4bb5['sqlContent'])['length']>0x0)return _0x5e4bb5;return getSqlQueryDetail(_0x5e4bb5[_0x1a5bb9(0x110)]);}export const sqlPull={'service':'sql','command':a113_0x1cf11c(0xdd),'description':a113_0x1cf11c(0xfa),'risk':a113_0x1cf11c(0xe2),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a113_0x1cf11c(0xe3),'type':a113_0x1cf11c(0x114),'description':a113_0x1cf11c(0xff)},{'name':a113_0x1cf11c(0x105),'type':a113_0x1cf11c(0xdb),'description':a113_0x1cf11c(0xf6)}],async 'dryRun'(_0x13874f){const _0x3a0b60=a113_0x1cf11c,_0x1a7fb0=loadSqlProjectConfig(_0x13874f[_0x3a0b60(0xe4)]),_0x3408a9=await readSqlLockFile(_0x1a7fb0[_0x3a0b60(0xfb)]),{appLock:_0x35b949}=ensureSqlLockScope(_0x3408a9??createEmptySqlLock(),_0x1a7fb0['appCode'],_0x1a7fb0['sqlRoot'],'pull'),_0x9fe2eb=await fetchAllSqlQueries(_0x13874f[_0x3a0b60(0xe4)],{'sqlCode':_0x13874f[_0x3a0b60(0x103)]('sqlcode')||undefined,'sqlName':_0x13874f[_0x3a0b60(0x103)](_0x3a0b60(0xe3))||undefined}),_0x16bb60=[];for(const _0x1f76bb of _0x9fe2eb){const _0x392cd1=await ensureSqlContent(_0x1f76bb),_0x4c8fa4=ensureRemoteSqlContent(_0x392cd1),_0x31b79c=detectModeFromSql(_0x392cd1),_0x2673c9=_0x392cd1[_0x3a0b60(0xdc)]?await getDbName(_0x13874f[_0x3a0b60(0xe4)],Number(_0x392cd1['dbId']))[_0x3a0b60(0x108)](()=>undefined):undefined,_0x289e2d=buildLocalSqlFileContent({'sqlCode':_0x392cd1['sqlCode'],'sqlName':_0x392cd1[_0x3a0b60(0xfd)],'dbId':_0x392cd1[_0x3a0b60(0xdc)]},_0x4c8fa4,{'dbName':_0x2673c9,'mode':_0x31b79c,'syncedAt':new Date()[_0x3a0b60(0xf2)](),'description':_0x392cd1[_0x3a0b60(0xe6)]}),_0x23afb5=buildSqlLockEntry(_0x392cd1,_0x4c8fa4,'',{'dbName':_0x2673c9}),_0x951126=resolveLocalSqlFilePath(_0x1a7fb0,_0x392cd1[_0x3a0b60(0x110)],_0x23afb5);let _0x30cc18='would_pull',_0x29f25e;if(await fileExists(_0x951126)){const _0x339b56=await readFile(_0x951126,_0x3a0b60(0x112));isEquivalentPulledSqlFile(_0x339b56,_0x289e2d,_0x31b79c)?(_0x30cc18=_0x3a0b60(0xe1),_0x29f25e=_0x3a0b60(0xeb)):(_0x30cc18=_0x3a0b60(0xda),_0x29f25e='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)');}_0x16bb60[_0x3a0b60(0xd8)]({'sqlCode':_0x392cd1['sqlCode'],'sqlName':_0x392cd1['sqlName'],'filePath':_0x951126,'status':_0x30cc18,'reason':_0x29f25e});}return{'method':_0x3a0b60(0x10a),'url':_0x3a0b60(0x109),'body':{'appCode':_0x13874f['appCode'],'sqlCode':_0x13874f[_0x3a0b60(0x103)](_0x3a0b60(0x104))||null,'sqlName':_0x13874f['str'](_0x3a0b60(0xe3))||null,'files':_0x16bb60},'description':_0x3a0b60(0xf8)+_0x16bb60[_0x3a0b60(0xf5)]+'\x20SQL\x20file(s)\x20into\x20'+_0x1a7fb0[_0x3a0b60(0x100)]};},async 'execute'(_0x316a51){const _0x9c0a08=a113_0x1cf11c,_0x6e37ce=loadSqlProjectConfig(_0x316a51[_0x9c0a08(0xe4)]),_0x4f3a25=await readSqlLockFile(_0x6e37ce[_0x9c0a08(0xfb)]),{lockData:_0x2c2bad,appLock:_0x4d1bbc}=ensureSqlLockScope(_0x4f3a25??createEmptySqlLock(),_0x6e37ce[_0x9c0a08(0xe4)],_0x6e37ce[_0x9c0a08(0x111)],_0x9c0a08(0xdd)),_0x1e406e=_0x316a51[_0x9c0a08(0xe5)](_0x9c0a08(0x105)),_0x31e06e=await fetchAllSqlQueries(_0x316a51[_0x9c0a08(0xe4)],{'sqlCode':_0x316a51[_0x9c0a08(0x103)](_0x9c0a08(0x104))||undefined,'sqlName':_0x316a51[_0x9c0a08(0x103)]('name')||undefined});if(_0x31e06e[_0x9c0a08(0xf5)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x9c0a08(0x115)};const _0x52148a=[],_0x306c1e=[];for(const _0x117375 of _0x31e06e){try{_0x52148a[_0x9c0a08(0xd8)](await ensureSqlContent(_0x117375));}catch(_0x1a6487){_0x306c1e[_0x9c0a08(0xd8)]({'sqlCode':_0x117375[_0x9c0a08(0x110)],'error':_0x1a6487 instanceof Error?_0x1a6487[_0x9c0a08(0xf4)]:String(_0x1a6487)});}}if(_0x1e406e&&!_0x316a51[_0x9c0a08(0x10e)]){let _0x3ff22f=![];for(const _0x12ed1e of _0x52148a){const _0xe1b03f=detectModeFromSql(_0x12ed1e),_0x275fa5=_0x12ed1e[_0x9c0a08(0xdc)]?await getDbName(_0x316a51['appCode'],Number(_0x12ed1e['dbId']))[_0x9c0a08(0x108)](()=>undefined):undefined,_0x193a9c=buildLocalSqlFileContent({'sqlCode':_0x12ed1e['sqlCode'],'sqlName':_0x12ed1e[_0x9c0a08(0xfd)],'dbId':_0x12ed1e[_0x9c0a08(0xdc)]},ensureRemoteSqlContent(_0x12ed1e),{'dbName':_0x275fa5,'mode':_0xe1b03f,'syncedAt':new Date()[_0x9c0a08(0xf2)](),'description':_0x12ed1e[_0x9c0a08(0xe6)]}),_0x481fda=resolveLocalSqlFilePath(_0x6e37ce,_0x12ed1e[_0x9c0a08(0x110)],buildSqlLockEntry(_0x12ed1e,ensureRemoteSqlContent(_0x12ed1e),'',{'dbName':_0x275fa5}));if(await fileExists(_0x481fda)){const _0x50cd47=await readFile(_0x481fda,'utf8');if(!isEquivalentPulledSqlFile(_0x50cd47,_0x193a9c,_0xe1b03f)){_0x3ff22f=!![];break;}}}if(_0x3ff22f){const _0x4b2cba=await confirmForceOverwrite(_0x9c0a08(0x106));if(!_0x4b2cba)throw CliErrors['cancelled']('Force\x20pull\x20cancelled.');}}const _0x59a28c=cloneSqlLockData(_0x2c2bad),_0x9b09b0=_0x59a28c['apps'][_0x6e37ce['appCode']],_0x1176df=[],_0x24f404=[];for(const _0x42f7df of _0x52148a){const _0x597e22=_0x9b09b0[_0x9c0a08(0x10f)][_0x42f7df[_0x9c0a08(0x110)]],_0x483370=ensureRemoteSqlContent(_0x42f7df),_0x208c03=detectModeFromSql(_0x42f7df),_0x4dd589=_0x42f7df[_0x9c0a08(0xdc)]?await getDbName(_0x316a51[_0x9c0a08(0xe4)],Number(_0x42f7df['dbId']))[_0x9c0a08(0x108)](()=>undefined):undefined,_0x5d3e31=buildLocalSqlFileContent({'sqlCode':_0x42f7df[_0x9c0a08(0x110)],'sqlName':_0x42f7df[_0x9c0a08(0xfd)],'dbId':_0x42f7df[_0x9c0a08(0xdc)]},_0x483370,{'dbName':_0x4dd589,'mode':_0x208c03,'syncedAt':new Date()['toISOString'](),'description':_0x42f7df['description']}),_0x40cdeb=buildSqlLockEntry(_0x42f7df,_0x483370,computeSqlContentHash(_0x5d3e31),{'dbName':_0x4dd589}),_0xcdf2a1=_0x40cdeb[_0x9c0a08(0xee)],_0x753eea=join(_0x6e37ce['sqlRootDir'],_0xcdf2a1);try{if(await fileExists(_0x753eea)){const _0x21dcca=await readFile(_0x753eea,'utf8');if(isEquivalentPulledSqlFile(_0x21dcca,_0x5d3e31,_0x208c03)){_0x24f404['push']({'sqlCode':_0x42f7df[_0x9c0a08(0x110)],'reason':_0x9c0a08(0xeb)}),_0x9b09b0[_0x9c0a08(0x10f)][_0x42f7df['sqlCode']]={..._0x40cdeb,'hash':computeSqlContentHash(_0x21dcca),'path':_0xcdf2a1};continue;}if(!_0x1e406e){_0x24f404['push']({'sqlCode':_0x42f7df[_0x9c0a08(0x110)],'reason':_0x9c0a08(0xde)});continue;}}const _0x3622eb=_0x597e22?.[_0x9c0a08(0xee)]?join(_0x6e37ce[_0x9c0a08(0x100)],_0x597e22[_0x9c0a08(0xee)]):undefined;_0x3622eb&&_0x3622eb!==_0x753eea&&await fileExists(_0x3622eb)&&await rm(_0x3622eb,{'force':!![]}),await ensureParentDirectory(_0x753eea),await writeFile(_0x753eea,_0x5d3e31,_0x9c0a08(0x112)),_0x9b09b0[_0x9c0a08(0x10f)][_0x42f7df[_0x9c0a08(0x110)]]={..._0x40cdeb,'path':_0xcdf2a1},_0x1176df[_0x9c0a08(0xd8)]({'sqlCode':_0x42f7df[_0x9c0a08(0x110)],'filePath':_0x753eea});}catch(_0x43c82a){_0x306c1e['push']({'sqlCode':_0x42f7df[_0x9c0a08(0x110)],'error':_0x43c82a instanceof Error?_0x43c82a[_0x9c0a08(0xf4)]:String(_0x43c82a)});}}return _0x9b09b0[_0x9c0a08(0xef)]=new Date()[_0x9c0a08(0xf2)](),await writeSqlLockFile(_0x6e37ce[_0x9c0a08(0xfb)],_0x59a28c),{'ok':_0x306c1e[_0x9c0a08(0xf5)]===0x0,'data':{'pulled':_0x1176df,'skipped':_0x24f404,'failed':_0x306c1e},'message':_0x9c0a08(0xf1)+_0x1176df[_0x9c0a08(0xf5)]+_0x9c0a08(0x10b)+_0x24f404[_0x9c0a08(0xf5)]+_0x9c0a08(0xfe)+_0x306c1e[_0x9c0a08(0xf5)]+_0x9c0a08(0x101)};}};function detectModeFromSql(_0x2e6a9e){const _0xbb0826=a113_0x1cf11c,_0x4ddd9f=ensureRemoteSqlContent(_0x2e6a9e),_0x284bb4=stripLocalSqlMetadata(_0x4ddd9f,_0xbb0826(0xf3))['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0xbb0826(0xec)](_0x284bb4))return _0xbb0826(0xf3);return _0xbb0826(0x102);}function isEquivalentPulledSqlFile(_0x383418,_0x488c44,_0x35513b){return normalizePullComparableContent(_0x383418,_0x35513b)===normalizePullComparableContent(_0x488c44,_0x35513b);}function normalizePullComparableContent(_0x1e2416,_0x9e6759){const _0x6ffc27=a113_0x1cf11c,_0x474d1a=_0x1e2416[_0x6ffc27(0xd6)](/\r\n/g,'\x0a')['split']('\x0a'),_0x1344e0=_0x474d1a[_0x6ffc27(0xe0)](_0xa61ed=>!isSyncedAtMetadataLine(_0xa61ed,_0x9e6759));return _0x1344e0[_0x6ffc27(0xd7)]('\x0a');}function a113_0x5330(_0x59a9d2,_0x35e7c4){_0x59a9d2=_0x59a9d2-0xd6;const _0x137638=a113_0x1376();let _0x533057=_0x137638[_0x59a9d2];return _0x533057;}function isSyncedAtMetadataLine(_0xe37525,_0x26f000){const _0x23469b=a113_0x1cf11c;if(_0x26f000==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x23469b(0xec)](_0xe37525);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x23469b(0xec)](_0xe37525);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a114_0x222851=a114_0x3886;(function(_0x2cce32,_0x589a73){const _0x19c501=a114_0x3886,_0x2dbdd9=_0x2cce32();while(!![]){try{const _0x163811=parseInt(_0x19c501(0xa7))/0x1*(parseInt(_0x19c501(0xa6))/0x2)+parseInt(_0x19c501(0xa8))/0x3+parseInt(_0x19c501(0x8b))/0x4+-parseInt(_0x19c501(0x87))/0x5*(parseInt(_0x19c501(0x91))/0x6)+parseInt(_0x19c501(0xad))/0x7+parseInt(_0x19c501(0x90))/0x8+-parseInt(_0x19c501(0xa4))/0x9;if(_0x163811===_0x589a73)break;else _0x2dbdd9['push'](_0x2dbdd9['shift']());}catch(_0x50c034){_0x2dbdd9['push'](_0x2dbdd9['shift']());}}}(a114_0x5632,0x33704));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';function a114_0x5632(){const _0x380914=['550800EdSdLx','POST','sqlCode','\x20failed','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','1504790kIRSao','sqlcode','sqlName','Push\x20local\x20SQL\x20files\x20to\x20remote','appCode','toISOString','\x22\x20for\x20sqlCode\x20','/smartapi/custom/updateUserCustomSql','isFinite','path','bool','entries','mode','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','sqlConfig','lockFilePath','projectRoot','has','sqlRoot','catch','\x20pushed,\x20','No\x20local\x20SQL\x20files\x20found.','dbDirectory','Push\x20complete:\x20','relativePath','sqls','Local\x20SQL\x20not\x20found:\x20','Local\x20directory\x20\x22','join','450hjEJXx','version','utf8','validation','1450960eVeqsd','replace','remoteId','exec','\x20skipped,\x20','3075864CrjrZA','750LrVwUa','boolean','sqlRootDir','map','Would\x20push\x20','filePath','set','push','force','high-risk-write','unchanged','filter','\x20SQL\x20file(s)','dbName','dbId','sql','length','trashDir','get','11486196myMrUh','hash','37094FNWPma','19XWuNlm'];a114_0x5632=function(){return _0x380914;};return a114_0x5632();}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';function a114_0x3886(_0x257883,_0x2ccd93){_0x257883=_0x257883-0x74;const _0x56324f=a114_0x5632();let _0x388647=_0x56324f[_0x257883];return _0x388647;}async function getTargetSqlQueries(_0x27c7e5,_0x4bd2da,_0x1e4990){const _0x18c583=a114_0x3886,_0x240fcd=await scanLocalSqlQueries(_0x27c7e5),_0x234359=new Map();for(const _0x372652 of _0x240fcd){if(_0x1e4990&&_0x372652[_0x18c583(0xaa)]!==_0x1e4990)continue;const _0x52ba74=_0x234359[_0x18c583(0xa3)](_0x372652[_0x18c583(0xaa)])??[];_0x52ba74['push'](_0x372652),_0x234359[_0x18c583(0x97)](_0x372652[_0x18c583(0xaa)],_0x52ba74);}if(_0x1e4990&&!_0x234359[_0x18c583(0x7b)](_0x1e4990))throw CliErrors['validation'](_0x18c583(0x84)+_0x1e4990);const _0x30651c=[];for(const [_0x347d0e,_0x5b3884]of _0x234359[_0x18c583(0x75)]()){if(_0x5b3884[_0x18c583(0xa1)]===0x1){_0x30651c[_0x18c583(0x98)](_0x5b3884[0x0]);continue;}const _0x27cc7e=_0x4bd2da[_0x18c583(0x83)][_0x347d0e],_0x4279fa=_0x27cc7e?.['path'],_0x8b67d0=_0x4279fa?_0x5b3884[_0x18c583(0x9c)](_0x301f91=>_0x301f91[_0x18c583(0x82)]!==_0x4279fa):_0x5b3884;if(_0x27cc7e&&_0x8b67d0['length']===0x1){_0x30651c[_0x18c583(0x98)](_0x8b67d0[0x0]);continue;}throw CliErrors[_0x18c583(0x8a)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x347d0e+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x30651c;}export const sqlPush={'service':a114_0x222851(0xa0),'command':a114_0x222851(0x98),'description':a114_0x222851(0xb0),'risk':a114_0x222851(0x9a),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a114_0x222851(0x99),'type':a114_0x222851(0x92),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x216d3d){const _0x4fd5bb=a114_0x222851,_0x53a0f7=loadSqlProjectConfig(_0x216d3d[_0x4fd5bb(0xb1)]),_0x5f2a89=await readSqlLockFile(_0x53a0f7[_0x4fd5bb(0x79)]),{appLock:_0x58092c}=ensureSqlLockScope(_0x5f2a89??createEmptySqlLock(),_0x216d3d[_0x4fd5bb(0xb1)],_0x53a0f7[_0x4fd5bb(0x7c)],'push'),_0x1eda40=await getTargetSqlQueries(_0x53a0f7,_0x58092c,_0x216d3d['str'](_0x4fd5bb(0xae))||undefined),_0x2fa5de=[];for(const _0x8aa49a of _0x1eda40){const _0x597677=await computeSqlFileHash(_0x8aa49a[_0x4fd5bb(0x96)]),_0x277ab0=_0x58092c['sqls'][_0x8aa49a[_0x4fd5bb(0xaa)]],_0x3e9717=!!_0x277ab0&&(_0x277ab0[_0x4fd5bb(0xb6)]!==_0x8aa49a[_0x4fd5bb(0x82)]||!!_0x8aa49a[_0x4fd5bb(0xaf)]&&_0x277ab0[_0x4fd5bb(0xaf)]!==_0x8aa49a[_0x4fd5bb(0xaf)]);if(!_0x216d3d[_0x4fd5bb(0x74)](_0x4fd5bb(0x99))&&_0x277ab0&&_0x277ab0[_0x4fd5bb(0xa5)]===_0x597677&&!_0x3e9717)continue;_0x2fa5de['push'](_0x8aa49a[_0x4fd5bb(0xaa)]);}return{'method':_0x4fd5bb(0xa9),'url':_0x4fd5bb(0xb4),'body':{'sqlCodes':_0x2fa5de,'appCode':_0x216d3d[_0x4fd5bb(0xb1)]},'description':_0x4fd5bb(0x95)+_0x2fa5de['length']+_0x4fd5bb(0x9d)};},async 'execute'(_0x2691f6){const _0x4dbb73=a114_0x222851,_0x2ece94=loadSqlProjectConfig(_0x2691f6[_0x4dbb73(0xb1)]),_0x69a5e8=await readSqlLockFile(_0x2ece94[_0x4dbb73(0x79)]),{lockData:_0x29d57f,appLock:_0x152272}=ensureSqlLockScope(_0x69a5e8??createEmptySqlLock(),_0x2691f6['appCode'],_0x2ece94[_0x4dbb73(0x7c)],_0x4dbb73(0x98)),_0x462a07=await getTargetSqlQueries(_0x2ece94,_0x152272,_0x2691f6['str'](_0x4dbb73(0xae))||undefined);if(_0x462a07[_0x4dbb73(0xa1)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x4dbb73(0x7f)};const _0x3575d6=[],_0x1c04c1=[],_0x1b0c83=[];for(const _0x5e270f of _0x462a07){const _0x10b764=_0x152272[_0x4dbb73(0x83)][_0x5e270f['sqlCode']];if(!_0x10b764){_0x1b0c83[_0x4dbb73(0x98)]({'sqlCode':_0x5e270f[_0x4dbb73(0xaa)],'error':_0x4dbb73(0x77)});continue;}try{const _0x542ad0=await computeSqlFileHash(_0x5e270f[_0x4dbb73(0x96)]),_0x45ad30=_0x10b764[_0x4dbb73(0xb6)]!==_0x5e270f[_0x4dbb73(0x82)]||!!_0x5e270f['sqlName']&&_0x10b764[_0x4dbb73(0xaf)]!==_0x5e270f[_0x4dbb73(0xaf)];if(!_0x2691f6[_0x4dbb73(0x74)](_0x4dbb73(0x99))&&_0x10b764[_0x4dbb73(0xa5)]===_0x542ad0&&!_0x45ad30){_0x1c04c1[_0x4dbb73(0x98)]({'sqlCode':_0x5e270f[_0x4dbb73(0xaa)],'reason':_0x4dbb73(0x9b)});continue;}if(_0x10b764[_0x4dbb73(0x88)]==null){_0x1b0c83['push']({'sqlCode':_0x5e270f['sqlCode'],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x4dc323=await readFile(_0x5e270f[_0x4dbb73(0x96)],_0x4dbb73(0x89)),_0x445fbf=stripLocalSqlMetadata(_0x4dc323,_0x5e270f[_0x4dbb73(0x76)]),_0x43aa29=_0x5e270f[_0x4dbb73(0xaf)]||_0x10b764[_0x4dbb73(0xaf)],_0x193548=await resolveTargetDbBinding(_0x2691f6[_0x4dbb73(0xb1)],_0x5e270f,_0x10b764),_0x210f9d=await updateSqlQuery({'id':_0x10b764['remoteId'],'appCode':_0x2691f6[_0x4dbb73(0xb1)],'sqlCode':_0x5e270f['sqlCode'],'sqlName':_0x43aa29,'dbId':_0x193548['dbId'],'version':_0x10b764[_0x4dbb73(0x88)],'sqlContent':_0x445fbf,'sqlConfig':_0x10b764[_0x4dbb73(0x78)]??undefined}),_0x53ef2=_0x210f9d[_0x4dbb73(0x9f)]?await getDbName(_0x2691f6[_0x4dbb73(0xb1)],Number(_0x210f9d[_0x4dbb73(0x9f)]))[_0x4dbb73(0x7d)](()=>_0x193548[_0x4dbb73(0x9e)]):_0x193548[_0x4dbb73(0x9e)];_0x152272[_0x4dbb73(0x83)][_0x5e270f[_0x4dbb73(0xaa)]]={...buildSqlLockEntry(_0x210f9d,_0x445fbf,_0x542ad0,{'dbName':_0x53ef2}),'path':_0x5e270f['relativePath'],'mode':_0x10b764['mode']},await archivePreviousSqlFileIfNeeded(_0x2ece94,_0x10b764[_0x4dbb73(0xb6)],_0x5e270f[_0x4dbb73(0x82)]),_0x3575d6[_0x4dbb73(0x98)]({'sqlCode':_0x5e270f[_0x4dbb73(0xaa)],'remoteId':_0x10b764[_0x4dbb73(0x8d)]});}catch(_0x2a2cbe){_0x1b0c83['push']({'sqlCode':_0x5e270f[_0x4dbb73(0xaa)],'error':_0x2a2cbe instanceof Error?_0x2a2cbe['message']:String(_0x2a2cbe)});}}return _0x152272['lastSync']=new Date()[_0x4dbb73(0xb2)](),await writeSqlLockFile(_0x2ece94[_0x4dbb73(0x79)],_0x29d57f),{'ok':_0x1b0c83[_0x4dbb73(0xa1)]===0x0,'data':{'pushed':_0x3575d6,'skipped':_0x1c04c1,'failed':_0x1b0c83},'message':_0x4dbb73(0x81)+_0x3575d6[_0x4dbb73(0xa1)]+_0x4dbb73(0x7e)+_0x1c04c1[_0x4dbb73(0xa1)]+_0x4dbb73(0x8f)+_0x1b0c83[_0x4dbb73(0xa1)]+_0x4dbb73(0xab)};}};async function archivePreviousSqlFileIfNeeded(_0x4c1c72,_0x4986bc,_0x3acac6){const _0x498ff5=a114_0x222851;if(!_0x4986bc||_0x4986bc===_0x3acac6)return;const _0x5980d5=join(_0x4c1c72[_0x498ff5(0x93)],_0x4986bc);if(!await fileExists(_0x5980d5))return;const _0x3d31c5=await moveToTrash(_0x4c1c72[_0x498ff5(0x7a)],_0x4c1c72[_0x498ff5(0xa2)],_0x5980d5);await cleanupEmptyDirectories(dirname(_0x5980d5),_0x4c1c72['sqlRootDir']),void _0x3d31c5;}async function moveToTrash(_0x38fd13,_0x52b868,_0x50d785){const _0x251012=a114_0x222851,_0x410596=new Date()['toISOString']()[_0x251012(0x8c)](/[:.]/g,'-'),_0x2ad52c=relative(_0x38fd13,_0x50d785),_0x53c800=join(_0x52b868,_0x410596,_0x2ad52c);return await mkdir(dirname(_0x53c800),{'recursive':!![]}),await rename(_0x50d785,_0x53c800),_0x53c800;}async function cleanupEmptyDirectories(_0x2fedb8,_0x380f52){const _0x2ea7e8=a114_0x222851;let _0xf1a4e=resolve(_0x2fedb8);const _0x333c2e=resolve(_0x380f52);while(_0xf1a4e['startsWith'](''+_0x333c2e+sep)||_0xf1a4e===_0x333c2e){if(_0xf1a4e===_0x333c2e)return;try{const _0x44441f=await readdir(_0xf1a4e);if(_0x44441f[_0x2ea7e8(0xa1)]>0x0)return;await rmdir(_0xf1a4e);}catch{return;}_0xf1a4e=dirname(_0xf1a4e);}}async function resolveTargetDbBinding(_0x111fac,_0x35ae22,_0x2b5146){const _0x50e864=a114_0x222851,_0x34dd89=_0x35ae22[_0x50e864(0x80)];if(!_0x34dd89)return{'dbId':_0x2b5146['dbId'],'dbName':_0x2b5146[_0x50e864(0x9e)]};const _0x59da8f=buildDbDirectoryName(_0x2b5146['dbName'],_0x2b5146[_0x50e864(0x9f)]);if(_0x34dd89===_0x59da8f)return{'dbId':_0x2b5146['dbId'],'dbName':_0x2b5146[_0x50e864(0x9e)]};const _0x14d05d=parseExplicitDbDirectory(_0x34dd89);if(_0x14d05d!=null)return{'dbId':_0x14d05d,'dbName':await getDbName(_0x111fac,_0x14d05d)[_0x50e864(0x7d)](()=>undefined)};const _0x299c86=await listDatabases(_0x111fac),_0x345814=_0x299c86[_0x50e864(0x9c)](_0x5f456b=>buildDbDirectoryName(_0x5f456b[_0x50e864(0x9e)],_0x5f456b[_0x50e864(0x9f)])===_0x34dd89);if(_0x345814[_0x50e864(0xa1)]===0x1)return{'dbId':_0x345814[0x0][_0x50e864(0x9f)],'dbName':_0x345814[0x0][_0x50e864(0x9e)]};if(_0x345814[_0x50e864(0xa1)]===0x0)throw CliErrors[_0x50e864(0x8a)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x34dd89+_0x50e864(0xb3)+_0x35ae22['sqlCode']+'.');const _0x689d7f=_0x345814[_0x50e864(0x94)](_0x33bddd=>_0x33bddd[_0x50e864(0x9e)]+'\x20('+_0x33bddd[_0x50e864(0x9f)]+')')[_0x50e864(0x86)](',\x20');throw CliErrors[_0x50e864(0x8a)](_0x50e864(0x85)+_0x34dd89+_0x50e864(0xac)+_0x35ae22['sqlCode']+':\x20'+_0x689d7f);}function parseExplicitDbDirectory(_0x2e0e00){const _0x261865=a114_0x222851,_0xd344d7=/^db-(\d+)$/[_0x261865(0x8e)](_0x2e0e00);if(!_0xd344d7)return null;const _0x300057=Number(_0xd344d7[0x1]);return Number[_0x261865(0xb5)](_0x300057)&&_0x300057>0x0?_0x300057:null;}
|
|
1
|
+
const a114_0x3784ff=a114_0x11fa;(function(_0x10e803,_0x4f91b8){const _0x34ba39=a114_0x11fa,_0x1f8d5e=_0x10e803();while(!![]){try{const _0x326d4b=-parseInt(_0x34ba39(0x128))/0x1+-parseInt(_0x34ba39(0x14d))/0x2*(-parseInt(_0x34ba39(0x167))/0x3)+parseInt(_0x34ba39(0x149))/0x4+parseInt(_0x34ba39(0x12f))/0x5+parseInt(_0x34ba39(0x147))/0x6*(-parseInt(_0x34ba39(0x12d))/0x7)+parseInt(_0x34ba39(0x165))/0x8+parseInt(_0x34ba39(0x14e))/0x9*(-parseInt(_0x34ba39(0x159))/0xa);if(_0x326d4b===_0x4f91b8)break;else _0x1f8d5e['push'](_0x1f8d5e['shift']());}catch(_0x180f81){_0x1f8d5e['push'](_0x1f8d5e['shift']());}}}(a114_0x3bd9,0x256ef));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';function a114_0x3bd9(){const _0x113a91=['push','Local\x20SQL\x20not\x20found:\x20','utf8','str','remoteId','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','sqlRootDir','1362918VlVfAZ','join','1114980yZtifc','bool','lockFilePath','Local\x20directory\x20\x22','2gGCqnV','3618891yjzxEG','No\x20local\x20SQL\x20files\x20found.','force','path','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','validation','Push\x20complete:\x20','lastSync','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','get','version','10bYuVEo','has','sql','toISOString','unchanged','/smartapi/custom/updateUserCustomSql','replace','set','No\x20database\x20matches\x20local\x20directory\x20\x22','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','dbDirectory','sqlRoot','2019984pGoJEE','map','141159lLJLFs','entries','filePath','74142NQytMI','\x20skipped,\x20','sqlCode','dbId','boolean','7KDgnjY','length','1392125oDaOma','startsWith','projectRoot','POST','isFinite','mode','relativePath','filter','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','message','catch','dbName','\x20failed','Push\x20local\x20SQL\x20files\x20to\x20remote','appCode','sqlName','sqls'];a114_0x3bd9=function(){return _0x113a91;};return a114_0x3bd9();}async function getTargetSqlQueries(_0x6bac02,_0x255ee4,_0x59109c){const _0x5ecc73=a114_0x11fa,_0x4d8b38=await scanLocalSqlQueries(_0x6bac02),_0x366a55=new Map();for(const _0x103a1e of _0x4d8b38){if(_0x59109c&&_0x103a1e[_0x5ecc73(0x12a)]!==_0x59109c)continue;const _0x1ec6a2=_0x366a55[_0x5ecc73(0x157)](_0x103a1e[_0x5ecc73(0x12a)])??[];_0x1ec6a2['push'](_0x103a1e),_0x366a55[_0x5ecc73(0x160)](_0x103a1e[_0x5ecc73(0x12a)],_0x1ec6a2);}if(_0x59109c&&!_0x366a55[_0x5ecc73(0x15a)](_0x59109c))throw CliErrors[_0x5ecc73(0x153)](_0x5ecc73(0x141)+_0x59109c);const _0x342b0f=[];for(const [_0x4073c0,_0x1598f2]of _0x366a55[_0x5ecc73(0x168)]()){if(_0x1598f2['length']===0x1){_0x342b0f['push'](_0x1598f2[0x0]);continue;}const _0x31c4b3=_0x255ee4[_0x5ecc73(0x13f)][_0x4073c0],_0x2be22d=_0x31c4b3?.[_0x5ecc73(0x151)],_0x5e6add=_0x2be22d?_0x1598f2['filter'](_0x2d0f7a=>_0x2d0f7a[_0x5ecc73(0x135)]!==_0x2be22d):_0x1598f2;if(_0x31c4b3&&_0x5e6add[_0x5ecc73(0x12e)]===0x1){_0x342b0f[_0x5ecc73(0x140)](_0x5e6add[0x0]);continue;}throw CliErrors['validation'](_0x5ecc73(0x137)+_0x4073c0+_0x5ecc73(0x152));}return _0x342b0f;}export const sqlPush={'service':a114_0x3784ff(0x15b),'command':a114_0x3784ff(0x140),'description':a114_0x3784ff(0x13c),'risk':'high-risk-write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a114_0x3784ff(0x150),'type':a114_0x3784ff(0x12c),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0xae24e2){const _0x54520d=a114_0x3784ff,_0x2eb805=loadSqlProjectConfig(_0xae24e2['appCode']),_0x374620=await readSqlLockFile(_0x2eb805['lockFilePath']),{appLock:_0x22f2ca}=ensureSqlLockScope(_0x374620??createEmptySqlLock(),_0xae24e2[_0x54520d(0x13d)],_0x2eb805[_0x54520d(0x164)],'push'),_0x176ae7=await getTargetSqlQueries(_0x2eb805,_0x22f2ca,_0xae24e2[_0x54520d(0x143)]('sqlcode')||undefined),_0x650949=[];for(const _0x5e8ff5 of _0x176ae7){const _0x54f815=await computeSqlFileHash(_0x5e8ff5[_0x54520d(0x127)]),_0x59ef96=_0x22f2ca[_0x54520d(0x13f)][_0x5e8ff5['sqlCode']],_0x18e0d6=!!_0x59ef96&&(_0x59ef96['path']!==_0x5e8ff5['relativePath']||!!_0x5e8ff5[_0x54520d(0x13e)]&&_0x59ef96[_0x54520d(0x13e)]!==_0x5e8ff5[_0x54520d(0x13e)]);if(!_0xae24e2[_0x54520d(0x14a)]('force')&&_0x59ef96&&_0x59ef96['hash']===_0x54f815&&!_0x18e0d6)continue;_0x650949[_0x54520d(0x140)](_0x5e8ff5[_0x54520d(0x12a)]);}return{'method':_0x54520d(0x132),'url':_0x54520d(0x15e),'body':{'sqlCodes':_0x650949,'appCode':_0xae24e2[_0x54520d(0x13d)]},'description':'Would\x20push\x20'+_0x650949[_0x54520d(0x12e)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x55eb12){const _0x23110b=a114_0x3784ff,_0x2d4210=loadSqlProjectConfig(_0x55eb12[_0x23110b(0x13d)]),_0x8d3261=await readSqlLockFile(_0x2d4210[_0x23110b(0x14b)]),{lockData:_0x24f8ee,appLock:_0x24cba2}=ensureSqlLockScope(_0x8d3261??createEmptySqlLock(),_0x55eb12[_0x23110b(0x13d)],_0x2d4210[_0x23110b(0x164)],_0x23110b(0x140)),_0x17fd20=await getTargetSqlQueries(_0x2d4210,_0x24cba2,_0x55eb12[_0x23110b(0x143)]('sqlcode')||undefined);if(_0x17fd20['length']===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x23110b(0x14f)};const _0x460f67=[],_0x5c092e=[],_0x2f3fb3=[];for(const _0x4d2200 of _0x17fd20){const _0x408959=_0x24cba2[_0x23110b(0x13f)][_0x4d2200[_0x23110b(0x12a)]];if(!_0x408959){_0x2f3fb3[_0x23110b(0x140)]({'sqlCode':_0x4d2200[_0x23110b(0x12a)],'error':_0x23110b(0x145)});continue;}try{const _0x46bf55=await computeSqlFileHash(_0x4d2200[_0x23110b(0x127)]),_0x3ba9d4=_0x408959['path']!==_0x4d2200[_0x23110b(0x135)]||!!_0x4d2200[_0x23110b(0x13e)]&&_0x408959[_0x23110b(0x13e)]!==_0x4d2200['sqlName'];if(!_0x55eb12['bool'](_0x23110b(0x150))&&_0x408959['hash']===_0x46bf55&&!_0x3ba9d4){_0x5c092e['push']({'sqlCode':_0x4d2200['sqlCode'],'reason':_0x23110b(0x15d)});continue;}if(_0x408959['version']==null){_0x2f3fb3[_0x23110b(0x140)]({'sqlCode':_0x4d2200[_0x23110b(0x12a)],'error':_0x23110b(0x156)});continue;}const _0x2f8639=await readFile(_0x4d2200[_0x23110b(0x127)],_0x23110b(0x142)),_0x15907b=stripLocalSqlMetadata(_0x2f8639,_0x4d2200[_0x23110b(0x134)]),_0x47c682=_0x4d2200[_0x23110b(0x13e)]||_0x408959['sqlName'],_0x48e898=await resolveTargetDbBinding(_0x55eb12[_0x23110b(0x13d)],_0x4d2200,_0x408959),_0x113c06=await updateSqlQuery({'id':_0x408959[_0x23110b(0x144)],'appCode':_0x55eb12[_0x23110b(0x13d)],'sqlCode':_0x4d2200['sqlCode'],'sqlName':_0x47c682,'dbId':_0x48e898[_0x23110b(0x12b)],'version':_0x408959[_0x23110b(0x158)],'sqlContent':_0x15907b,'sqlConfig':_0x408959['sqlConfig']??undefined}),_0x946e9e=_0x113c06[_0x23110b(0x12b)]?await getDbName(_0x55eb12[_0x23110b(0x13d)],Number(_0x113c06['dbId']))[_0x23110b(0x139)](()=>_0x48e898[_0x23110b(0x13a)]):_0x48e898[_0x23110b(0x13a)];_0x24cba2[_0x23110b(0x13f)][_0x4d2200[_0x23110b(0x12a)]]={...buildSqlLockEntry(_0x113c06,_0x15907b,_0x46bf55,{'dbName':_0x946e9e}),'path':_0x4d2200['relativePath'],'mode':_0x408959[_0x23110b(0x134)]},await archivePreviousSqlFileIfNeeded(_0x2d4210,_0x408959[_0x23110b(0x151)],_0x4d2200[_0x23110b(0x135)]),_0x460f67[_0x23110b(0x140)]({'sqlCode':_0x4d2200[_0x23110b(0x12a)],'remoteId':_0x408959[_0x23110b(0x144)]});}catch(_0x1ac4fe){_0x2f3fb3[_0x23110b(0x140)]({'sqlCode':_0x4d2200[_0x23110b(0x12a)],'error':_0x1ac4fe instanceof Error?_0x1ac4fe[_0x23110b(0x138)]:String(_0x1ac4fe)});}}return _0x24cba2[_0x23110b(0x155)]=new Date()['toISOString'](),await writeSqlLockFile(_0x2d4210[_0x23110b(0x14b)],_0x24f8ee),{'ok':_0x2f3fb3[_0x23110b(0x12e)]===0x0,'data':{'pushed':_0x460f67,'skipped':_0x5c092e,'failed':_0x2f3fb3},'message':_0x23110b(0x154)+_0x460f67['length']+'\x20pushed,\x20'+_0x5c092e[_0x23110b(0x12e)]+_0x23110b(0x129)+_0x2f3fb3[_0x23110b(0x12e)]+_0x23110b(0x13b)};}};async function archivePreviousSqlFileIfNeeded(_0x5a804b,_0x376b9f,_0x578da5){const _0x270851=a114_0x3784ff;if(!_0x376b9f||_0x376b9f===_0x578da5)return;const _0x880b75=join(_0x5a804b[_0x270851(0x146)],_0x376b9f);if(!await fileExists(_0x880b75))return;const _0x4ff63a=await moveToTrash(_0x5a804b[_0x270851(0x131)],_0x5a804b['trashDir'],_0x880b75);await cleanupEmptyDirectories(dirname(_0x880b75),_0x5a804b[_0x270851(0x146)]),void _0x4ff63a;}async function moveToTrash(_0x5f1891,_0x356532,_0x35490e){const _0x41d57a=a114_0x3784ff,_0x136a27=new Date()[_0x41d57a(0x15c)]()[_0x41d57a(0x15f)](/[:.]/g,'-'),_0x3d7b5c=relative(_0x5f1891,_0x35490e),_0x3bba32=join(_0x356532,_0x136a27,_0x3d7b5c);return await mkdir(dirname(_0x3bba32),{'recursive':!![]}),await rename(_0x35490e,_0x3bba32),_0x3bba32;}async function cleanupEmptyDirectories(_0x3207f5,_0xc6b403){const _0x3b35d5=a114_0x3784ff;let _0x56a227=resolve(_0x3207f5);const _0x17ee94=resolve(_0xc6b403);while(_0x56a227[_0x3b35d5(0x130)](''+_0x17ee94+sep)||_0x56a227===_0x17ee94){if(_0x56a227===_0x17ee94)return;try{const _0x4464f4=await readdir(_0x56a227);if(_0x4464f4[_0x3b35d5(0x12e)]>0x0)return;await rmdir(_0x56a227);}catch{return;}_0x56a227=dirname(_0x56a227);}}async function resolveTargetDbBinding(_0xb10ac5,_0x162174,_0x30a04b){const _0x29656e=a114_0x3784ff,_0x1e7140=_0x162174[_0x29656e(0x163)];if(!_0x1e7140)return{'dbId':_0x30a04b[_0x29656e(0x12b)],'dbName':_0x30a04b[_0x29656e(0x13a)]};const _0x44fbbb=buildDbDirectoryName(_0x30a04b[_0x29656e(0x13a)],_0x30a04b['dbId']);if(_0x1e7140===_0x44fbbb)return{'dbId':_0x30a04b[_0x29656e(0x12b)],'dbName':_0x30a04b[_0x29656e(0x13a)]};const _0x349938=parseExplicitDbDirectory(_0x1e7140);if(_0x349938!=null)return{'dbId':_0x349938,'dbName':await getDbName(_0xb10ac5,_0x349938)[_0x29656e(0x139)](()=>undefined)};const _0x386971=await listDatabases(_0xb10ac5),_0x81d062=_0x386971[_0x29656e(0x136)](_0x1411e1=>buildDbDirectoryName(_0x1411e1[_0x29656e(0x13a)],_0x1411e1['dbId'])===_0x1e7140);if(_0x81d062['length']===0x1)return{'dbId':_0x81d062[0x0][_0x29656e(0x12b)],'dbName':_0x81d062[0x0]['dbName']};if(_0x81d062[_0x29656e(0x12e)]===0x0)throw CliErrors['validation'](_0x29656e(0x161)+_0x1e7140+'\x22\x20for\x20sqlCode\x20'+_0x162174[_0x29656e(0x12a)]+'.');const _0x414b1c=_0x81d062[_0x29656e(0x166)](_0x436130=>_0x436130['dbName']+'\x20('+_0x436130['dbId']+')')[_0x29656e(0x148)](',\x20');throw CliErrors['validation'](_0x29656e(0x14c)+_0x1e7140+_0x29656e(0x162)+_0x162174[_0x29656e(0x12a)]+':\x20'+_0x414b1c);}function a114_0x11fa(_0x4f5324,_0x4e920e){_0x4f5324=_0x4f5324-0x127;const _0x3bd906=a114_0x3bd9();let _0x11fabb=_0x3bd906[_0x4f5324];return _0x11fabb;}function parseExplicitDbDirectory(_0x3a2ec0){const _0x50f71d=a114_0x3784ff,_0x523c29=/^db-(\d+)$/['exec'](_0x3a2ec0);if(!_0x523c29)return null;const _0x7f8b08=Number(_0x523c29[0x1]);return Number[_0x50f71d(0x133)](_0x7f8b08)&&_0x7f8b08>0x0?_0x7f8b08:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a115_0x376874=a115_0x5880;(function(_0x2cb953,_0x4b1c62){const _0x5e51cb=a115_0x5880,_0x2ca7ed=_0x2cb953();while(!![]){try{const _0x136003=parseInt(_0x5e51cb(0x1e3))/0x1+-parseInt(_0x5e51cb(0x1d1))/0x2*(-parseInt(_0x5e51cb(0x1d4))/0x3)+-parseInt(_0x5e51cb(0x1d7))/0x4*(parseInt(_0x5e51cb(0x1da))/0x5)+-parseInt(_0x5e51cb(0x1e1))/0x6*(parseInt(_0x5e51cb(0x1df))/0x7)+-parseInt(_0x5e51cb(0x1e0))/0x8+parseInt(_0x5e51cb(0x1d5))/0x9*(-parseInt(_0x5e51cb(0x1de))/0xa)+-parseInt(_0x5e51cb(0x1e2))/0xb*(-parseInt(_0x5e51cb(0x1d3))/0xc);if(_0x136003===_0x4b1c62)break;else _0x2ca7ed['push'](_0x2ca7ed['shift']());}catch(_0x19ba3a){_0x2ca7ed['push'](_0x2ca7ed['shift']());}}}(a115_0x1fd8,0x4cfe3));function a115_0x1fd8(){const _0x2af5a7=['Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','2iAQsYK','join','77124FKcpOB','1681635PnDRYG','108NCzsmn','write','852qSUGzq','save','string','7815EdknLj','SQL\x20query\x20display\x20name','validation','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','20090ZTxHAY','575169lVjiIX','4767344tvzRUn','18IRqxfY','1199rxLtLt','253721BwOSXQ','description','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','sqlname'];a115_0x1fd8=function(){return _0x2af5a7;};return a115_0x1fd8();}import{CliErrors}from'../../errors.js';function a115_0x5880(_0x3175ad,_0xb6f26){_0x3175ad=_0x3175ad-0x1cd;const _0x1fd8d3=a115_0x1fd8();let _0x588013=_0x1fd8d3[_0x3175ad];return _0x588013;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a115_0x376874(0x1ce),'Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','Update\x20existing\x20SQL\x20by\x20editing\x20the\x20synced\x20file\x20under\x20`.rabetbase/sql/<appCode>/<dbName|db-<id>>/`\x20and\x20then\x20running\x20`rabetbase\x20sql\x20push\x20--sqlcode\x20<code>\x20--yes`.'][a115_0x376874(0x1d2)]('\x0a');export const sqlSave={'service':'sql','command':a115_0x376874(0x1d8),'description':a115_0x376874(0x1d0),'risk':a115_0x376874(0x1d6),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'file','type':a115_0x376874(0x1d9),'required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':a115_0x376874(0x1cf),'type':a115_0x376874(0x1d9),'description':a115_0x376874(0x1db)},{'name':'db','type':a115_0x376874(0x1d9),'description':a115_0x376874(0x1dd)},{'name':a115_0x376874(0x1cd),'type':a115_0x376874(0x1d9),'description':'Query\x20description'}],async 'validate'(){const _0x26f9c1=a115_0x376874;throw CliErrors[_0x26f9c1(0x1dc)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x53c0ca=a115_0x376874;throw CliErrors[_0x53c0ca(0x1dc)](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x41c10d,_0x534c0a){const _0x5851f7=a116_0x4d1a,_0xa8799d=_0x41c10d();while(!![]){try{const _0x26b732=-parseInt(_0x5851f7(0x203))/0x1*(-parseInt(_0x5851f7(0x205))/0x2)+-parseInt(_0x5851f7(0x1ec))/0x3+parseInt(_0x5851f7(0x1fc))/0x4+parseInt(_0x5851f7(0x1e1))/0x5+parseInt(_0x5851f7(0x1e7))/0x6*(-parseInt(_0x5851f7(0x20a))/0x7)+parseInt(_0x5851f7(0x206))/0x8*(parseInt(_0x5851f7(0x1ee))/0x9)+-parseInt(_0x5851f7(0x1e2))/0xa*(parseInt(_0x5851f7(0x1f0))/0xb);if(_0x26b732===_0x534c0a)break;else _0xa8799d['push'](_0xa8799d['shift']());}catch(_0x591ad6){_0xa8799d['push'](_0xa8799d['shift']());}}}(a116_0x428d,0xc4cbf));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x3cf1e4,_0x156b51,_0x71c608,_0xa1602e){const _0x358d0a=a116_0x4d1a,_0x1d6faa=detectSqlMode(_0x156b51);return{'path':buildSqlRelativePath(_0x3cf1e4['sqlCode'],_0x3cf1e4[_0x358d0a(0x1ed)],_0xa1602e?.[_0x358d0a(0x1e6)],_0x1d6faa,_0x3cf1e4[_0x358d0a(0x1ff)]),'hash':_0x71c608,'remoteId':_0x3cf1e4['id'],'version':_0x3cf1e4[_0x358d0a(0x1f9)],'dbId':Number(_0x3cf1e4['dbId']),'dbName':_0xa1602e?.[_0x358d0a(0x1e6)],'sqlName':_0x3cf1e4[_0x358d0a(0x1ed)],'sqlConfig':_0x3cf1e4['sqlConfig']??undefined,'mode':_0x1d6faa};}function a116_0x428d(){const _0x373dcc=['553cAAAWD','sqls','toLowerCase','7373505FpwxoV','10KbLMUg','mode','split','push','dbName','40362MEsJiF','apps','--\x20@lovrabet.','question','trim','1298343PBfQkg','sqlName','20322pogXFB','includes','4956963NlucDv','length','syncedAt','\x20-->','endsWith','trimStart','<!--\x20@lovrabet.','sqlRoot','close','version','stdin','lastSync','76032lPuEma','fromEntries','filter','dbId','replace','yes','sqlCode','329809BJcTmB','entries','2jFGxsC','1408zsJoTp','join','mybatisXml','description'];a116_0x428d=function(){return _0x373dcc;};return a116_0x428d();}function a116_0x4d1a(_0x3539da,_0x257f78){_0x3539da=_0x3539da-0x1e1;const _0x428d5b=a116_0x428d();let _0x4d1a0d=_0x428d5b[_0x3539da];return _0x4d1a0d;}export function cloneSqlLockData(_0x568492){const _0x330277=a116_0x4d1a;return{'apps':Object[_0x330277(0x1fd)](Object[_0x330277(0x204)](_0x568492[_0x330277(0x1e8)])['map'](([_0x4abcfb,_0x224e2b])=>[_0x4abcfb,{'sqlRoot':_0x224e2b[_0x330277(0x1f7)],'lastSync':_0x224e2b[_0x330277(0x1fb)],'sqls':{..._0x224e2b[_0x330277(0x20b)]}}]))};}export function ensureRemoteSqlContent(_0xb7cf0f){return _0xb7cf0f['sqlContent']??'';}export function buildLocalSqlFileContent(_0x498988,_0x14e2fc,_0x533b9e){const _0x47963c=a116_0x4d1a,_0xd95a81=_0x533b9e?.['mode']??detectSqlMode(_0x14e2fc),_0x4e397c=stripLocalSqlMetadata(_0x14e2fc,_0xd95a81)['trim'](),_0x1ebe51=[...buildMetadataHeaderLines({'sqlCode':_0x498988[_0x47963c(0x202)],'sqlName':_0x498988[_0x47963c(0x1ed)],'dbId':_0x498988[_0x47963c(0x1ff)],'dbName':_0x533b9e?.[_0x47963c(0x1e6)],'mode':_0xd95a81,'syncedAt':_0x533b9e?.['syncedAt'],'description':_0x533b9e?.[_0x47963c(0x209)]},_0xd95a81),'',_0x4e397c],_0x303fd2=_0x1ebe51[_0x47963c(0x207)]('\x0a');return _0x303fd2[_0x47963c(0x1f4)]('\x0a')?_0x303fd2:_0x303fd2+'\x0a';}export function stripLocalSqlMetadata(_0x3d18e2,_0x12e55c){const _0x28693e=a116_0x4d1a,_0x5de045=_0x3d18e2[_0x28693e(0x200)](/\r\n/g,'\x0a')[_0x28693e(0x1e4)]('\x0a'),_0xb598e3=[];let _0x4b9b55=0x0;if(_0x12e55c===_0x28693e(0x208))while(_0x4b9b55<_0x5de045['length']){const _0x4e2ea9=_0x5de045[_0x4b9b55]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x4e2ea9)){_0x4b9b55++;continue;}if(_0x4e2ea9[_0x28693e(0x1eb)]()===''&&_0x4b9b55>0x0){_0x4b9b55++;continue;}break;}else while(_0x4b9b55<_0x5de045[_0x28693e(0x1f1)]){const _0x3e3e77=_0x5de045[_0x4b9b55]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x3e3e77)){_0x4b9b55++;continue;}if(_0x3e3e77['trim']()===''&&_0x4b9b55>0x0){_0x4b9b55++;continue;}break;}for(;_0x4b9b55<_0x5de045[_0x28693e(0x1f1)];_0x4b9b55++){_0xb598e3[_0x28693e(0x1e5)](_0x5de045[_0x4b9b55]);}return _0xb598e3[_0x28693e(0x207)]('\x0a')[_0x28693e(0x1f5)]();}export function resolveSqlMode(_0x441467,_0x3a5723){const _0x35d198=a116_0x4d1a;if(_0x3a5723?.[_0x35d198(0x1e3)])return _0x3a5723['mode'];return detectSqlMode(_0x441467);}export function resolveSqlFileName(_0x3f44c4,_0x172e8c,_0x53bf4d){const _0x569ea8=a116_0x4d1a;if(_0x53bf4d?.['path'])return _0x53bf4d['path'];if(_0x53bf4d?.[_0x569ea8(0x1ed)]||_0x53bf4d?.[_0x569ea8(0x1e6)])return buildSqlRelativePath(_0x3f44c4,_0x53bf4d?.[_0x569ea8(0x1ed)],_0x53bf4d?.[_0x569ea8(0x1e6)],resolveSqlMode(_0x172e8c,_0x53bf4d),_0x53bf4d?.[_0x569ea8(0x1ff)]);return buildDefaultSqlFileName(_0x3f44c4,resolveSqlMode(_0x172e8c,_0x53bf4d));}export function resolveSqlLocalDir(_0x537bc8,_0x496c19){return join(_0x537bc8,SQL_LOCAL_REL_DIR,_0x496c19);}export async function confirmForceOverwrite(_0x54c064){const _0x296da8=a116_0x4d1a,_0x19a172=createInterface({'input':process[_0x296da8(0x1fa)],'output':process['stderr']}),_0x332803=await new Promise(_0x4f4e66=>{const _0x12ea44=_0x296da8;_0x19a172[_0x12ea44(0x1ea)](_0x54c064+'\x20[y/N]\x20',_0x4f4e66);});return _0x19a172[_0x296da8(0x1f8)](),['y',_0x296da8(0x201)][_0x296da8(0x1ef)](_0x332803['trim']()[_0x296da8(0x20c)]());}export function findSqlLockScope(_0x3265ce,_0xeb3b7c){return _0x3265ce['apps'][_0xeb3b7c];}function buildMetadataHeaderLines(_0x31032c,_0x5a95ee){const _0x12bf68=a116_0x4d1a,_0xd71bea=[[_0x12bf68(0x202),_0x31032c['sqlCode']],[_0x12bf68(0x1ed),_0x31032c[_0x12bf68(0x1ed)]],['dbId',_0x31032c[_0x12bf68(0x1ff)]],[_0x12bf68(0x1e6),_0x31032c['dbName']],[_0x12bf68(0x1e3),_0x31032c[_0x12bf68(0x1e3)]],[_0x12bf68(0x1f2),_0x31032c[_0x12bf68(0x1f2)]],['description',_0x31032c[_0x12bf68(0x209)]]];if(_0x5a95ee==='mybatisXml')return _0xd71bea[_0x12bf68(0x1fe)](([,_0x3ae0b1])=>_0x3ae0b1!==undefined&&_0x3ae0b1!==null&&String(_0x3ae0b1)[_0x12bf68(0x1eb)]()!=='')['map'](([_0x3da9d9,_0x598ea2])=>_0x12bf68(0x1f6)+_0x3da9d9+':\x20'+String(_0x598ea2)+_0x12bf68(0x1f3));return _0xd71bea['filter'](([,_0x4fa139])=>_0x4fa139!==undefined&&_0x4fa139!==null&&String(_0x4fa139)[_0x12bf68(0x1eb)]()!=='')['map'](([_0x2327ab,_0x25542b])=>_0x12bf68(0x1e9)+_0x2327ab+':\x20'+String(_0x25542b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a117_0xea72ab=a117_0x34dd;(function(_0x37c28b,_0x42e73d){const _0x53eef4=a117_0x34dd,_0xc99cc0=_0x37c28b();while(!![]){try{const _0x34af01=parseInt(_0x53eef4(0x1a8))/0x1+parseInt(_0x53eef4(0x19d))/0x2*(parseInt(_0x53eef4(0x1b5))/0x3)+parseInt(_0x53eef4(0x1ac))/0x4+parseInt(_0x53eef4(0x1ab))/0x5+-parseInt(_0x53eef4(0x192))/0x6*(parseInt(_0x53eef4(0x194))/0x7)+parseInt(_0x53eef4(0x1a9))/0x8*(parseInt(_0x53eef4(0x1a1))/0x9)+parseInt(_0x53eef4(0x195))/0xa*(-parseInt(_0x53eef4(0x1a3))/0xb);if(_0x34af01===_0x42e73d)break;else _0xc99cc0['push'](_0xc99cc0['shift']());}catch(_0x20db55){_0xc99cc0['push'](_0xc99cc0['shift']());}}}(a117_0x213d,0x4ccfe));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a117_0x213d(){const _0x4c6937=['\x20added,\x20','status','54926rJDJUA','filePath','\x20missing,\x20','remote','18gbNjPs','push','4345zsiTqX','lockKey','map','paging','appCode','312943iXGAxV','878208gLdGnn','keys','2454785mbZPVO','1585752dGmFFm','hash','sqlCode','has','sql','totalCount','path','boolean','tableData','9XFzSGo','bool','sqls','6mOiuGr','\x20remote-only','1157779wnZpnE','25880QaYsQP','\x20unchanged','All\x20SQL\x20queries\x20are\x20in\x20sync.','sqlName','\x20modified,\x20','length'];a117_0x213d=function(){return _0x4c6937;};return a117_0x213d();}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x2890d7){const _0x501a92=a117_0x34dd,_0x4812f6=[];let _0x10ca18=0x1;while(!![]){const _0x387306=await listSqlQueries(_0x2890d7,{'currentPage':_0x10ca18,'pageSize':PAGE_SIZE}),_0x316513=_0x387306[_0x501a92(0x1b4)]??[];_0x4812f6[_0x501a92(0x1a2)](..._0x316513[_0x501a92(0x1a5)](_0x29c76e=>_0x29c76e[_0x501a92(0x1ae)]));if(_0x316513[_0x501a92(0x19a)]===0x0)break;const _0x5145eb=_0x387306[_0x501a92(0x1a6)]?.[_0x501a92(0x1b1)];if(_0x5145eb!=null?_0x4812f6[_0x501a92(0x19a)]>=_0x5145eb:_0x316513[_0x501a92(0x19a)]<PAGE_SIZE)break;_0x10ca18++;}return _0x4812f6;}function a117_0x34dd(_0x27d389,_0xfda5f1){_0x27d389=_0x27d389-0x192;const _0x213d0d=a117_0x213d();let _0x34ddef=_0x213d0d[_0x27d389];return _0x34ddef;}export const sqlStatus={'service':a117_0xea72ab(0x1b0),'command':a117_0xea72ab(0x19c),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':'read','flags':[{'name':'remote','type':a117_0xea72ab(0x1b3),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x397177){const _0x77bb92=a117_0xea72ab,_0x597de1=loadSqlProjectConfig(_0x397177[_0x77bb92(0x1a7)]),_0x2f36a0=await readSqlLockFile(_0x597de1['lockFilePath']),{appLock:_0x415e8d}=ensureSqlLockScope(_0x2f36a0??createEmptySqlLock(),_0x597de1[_0x77bb92(0x1a7)],_0x597de1['sqlRoot'],_0x77bb92(0x19c)),_0x533e8e=await scanLocalSqlQueries(_0x597de1),_0x3eb122=[],_0x30d592=[],_0x11a94c=[],_0x102d72=[],_0x157dbe=new Set(_0x533e8e[_0x77bb92(0x1a5)](_0x4d9bd6=>_0x4d9bd6[_0x77bb92(0x1a4)]));for(const _0x70c00a of _0x533e8e){const _0x1c6b2f=await computeSqlFileHash(_0x70c00a[_0x77bb92(0x19e)]),_0x43a8b6=_0x415e8d[_0x77bb92(0x1b7)][_0x70c00a[_0x77bb92(0x1a4)]],_0x340928=!!_0x43a8b6&&_0x43a8b6[_0x77bb92(0x1b2)]!==_0x70c00a['relativePath'],_0x3c20f1=!!_0x43a8b6&&!!_0x70c00a['sqlName']&&_0x43a8b6[_0x77bb92(0x198)]!==_0x70c00a[_0x77bb92(0x198)];if(!_0x43a8b6)_0x3eb122[_0x77bb92(0x1a2)](_0x70c00a['lockKey']);else _0x43a8b6[_0x77bb92(0x1ad)]!==_0x1c6b2f||_0x340928||_0x3c20f1?_0x30d592['push'](_0x70c00a[_0x77bb92(0x1a4)]):_0x11a94c['push'](_0x70c00a[_0x77bb92(0x1a4)]);}for(const _0x2d8171 of Object[_0x77bb92(0x1aa)](_0x415e8d[_0x77bb92(0x1b7)])){!_0x157dbe['has'](_0x2d8171)&&_0x102d72[_0x77bb92(0x1a2)](_0x2d8171);}const _0x508a9c=[];if(_0x397177[_0x77bb92(0x1b6)](_0x77bb92(0x1a0))){const _0x6a92d3=await fetchAllSqlCodes(_0x397177['appCode']);for(const _0x465d1a of _0x6a92d3){!_0x157dbe[_0x77bb92(0x1af)](_0x465d1a)&&!_0x415e8d[_0x77bb92(0x1b7)][_0x465d1a]&&_0x508a9c['push'](_0x465d1a);}}const _0x152514=_0x3eb122[_0x77bb92(0x19a)]===0x0&&_0x30d592[_0x77bb92(0x19a)]===0x0&&_0x102d72[_0x77bb92(0x19a)]===0x0&&_0x508a9c[_0x77bb92(0x19a)]===0x0;return{'ok':!![],'data':{'added':_0x3eb122,'modified':_0x30d592,'missing':_0x102d72,'unchanged':_0x11a94c,'remoteOnly':_0x508a9c},'message':_0x152514?_0x77bb92(0x197):_0x3eb122[_0x77bb92(0x19a)]+_0x77bb92(0x19b)+_0x30d592[_0x77bb92(0x19a)]+_0x77bb92(0x199)+_0x102d72[_0x77bb92(0x19a)]+_0x77bb92(0x19f)+_0x11a94c[_0x77bb92(0x19a)]+_0x77bb92(0x196)+(_0x508a9c[_0x77bb92(0x19a)]>0x0?',\x20'+_0x508a9c['length']+_0x77bb92(0x193):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a118_0xee8931=a118_0x4b60;function a118_0x4b60(_0x49e3e2,_0x2b784b){_0x49e3e2=_0x49e3e2-0x7c;const _0x3873c9=a118_0x3873();let _0x4b60fa=_0x3873c9[_0x49e3e2];return _0x4b60fa;}(function(_0x285585,_0x365715){const _0x421c50=a118_0x4b60,_0x195c57=_0x285585();while(!![]){try{const _0x575eb1=-parseInt(_0x421c50(0x8a))/0x1+parseInt(_0x421c50(0xa1))/0x2+-parseInt(_0x421c50(0x7e))/0x3*(-parseInt(_0x421c50(0x8b))/0x4)+-parseInt(_0x421c50(0x94))/0x5*(-parseInt(_0x421c50(0x95))/0x6)+parseInt(_0x421c50(0x82))/0x7+-parseInt(_0x421c50(0x9e))/0x8+-parseInt(_0x421c50(0x97))/0x9;if(_0x575eb1===_0x365715)break;else _0x195c57['push'](_0x195c57['shift']());}catch(_0xeed143){_0x195c57['push'](_0x195c57['shift']());}}}(a118_0x3873,0x63eda));import{readFileSync,existsSync}from'node:fs';function a118_0x3873(){const _0xb0790f=['split','reason','toLowerCase','flagMissing','trim','6075560vCFDGr','utf-8','validation','563668lOqVBR','validate','Table\x20\x22','push','string','parameters','240153TeiKxp','tableName','read','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','5609324NEgCIW','length','dbtableConfig','valid','sqlType','fields','schemas','isDangerous','168577QpUpuo','28kCcKoX','str','sql','message','name','isSelectOnly','cwd','file','map','5biXjif','518244dLtrzI','tables','3533121QZvuEK','Provide\x20--file\x20or\x20--sql'];a118_0x3873=function(){return _0xb0790f;};return a118_0x3873();}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a118_0xee8931(0x8d),'command':a118_0xee8931(0xa2),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a118_0xee8931(0x80),'flags':[{'name':a118_0xee8931(0x92),'type':a118_0xee8931(0x7c),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a118_0xee8931(0x8d),'type':'string','description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a118_0xee8931(0x88),'type':a118_0xee8931(0x7c),'description':a118_0xee8931(0x81)}],async 'execute'(_0x222dd5){const _0x496f00=a118_0xee8931,_0x5ea004=_0x222dd5[_0x496f00(0x8c)](_0x496f00(0x92)),_0xff892d=_0x222dd5[_0x496f00(0x8c)]('sql');if(!_0x5ea004&&!_0xff892d)throw CliErrors[_0x496f00(0x9c)]('file',_0x496f00(0x98));let _0x3d2ba6;if(_0x5ea004){const _0x5448c5=resolve(process[_0x496f00(0x91)](),_0x5ea004);if(!existsSync(_0x5448c5))throw CliErrors[_0x496f00(0xa0)]('File\x20not\x20found:\x20'+_0x5448c5);_0x3d2ba6=readFileSync(_0x5448c5,_0x496f00(0x9f));}else _0x3d2ba6=_0xff892d;const _0x4948=validateSql(_0x3d2ba6),_0x55db8f={'valid':_0x4948[_0x496f00(0x85)],'sqlType':_0x4948['sqlType']['type'],'isSelectOnly':_0x4948[_0x496f00(0x86)][_0x496f00(0x90)],'isDangerous':_0x4948['sqlType'][_0x496f00(0x89)],'tables':_0x4948[_0x496f00(0x96)],'parameters':_0x4948[_0x496f00(0x7d)],'message':_0x4948[_0x496f00(0x8e)]};_0x4948['sqlType']['reason']&&(_0x55db8f[_0x496f00(0x9a)]=_0x4948[_0x496f00(0x86)][_0x496f00(0x9a)]);const _0x42f5ec=_0x222dd5[_0x496f00(0x8c)](_0x496f00(0x88));if(_0x42f5ec&&_0x4948['valid']){const _0x4363fd=_0x42f5ec[_0x496f00(0x99)](',')[_0x496f00(0x93)](_0x175d1f=>_0x175d1f[_0x496f00(0x9d)]())['filter'](Boolean),_0x26c19c=[],_0x39720b=await listDatasets(_0x222dd5['appCode']),_0x20ebb1=new Map(_0x39720b[_0x496f00(0x93)](_0x4b3c03=>[_0x4b3c03[_0x496f00(0x84)]?.[_0x496f00(0x7f)]?.[_0x496f00(0x9b)](),_0x4b3c03]));for(const _0x171ba2 of _0x4948['tables']){const _0x2d664d=_0x20ebb1['get'](_0x171ba2[_0x496f00(0x9b)]());!_0x2d664d&&_0x26c19c[_0x496f00(0xa4)](_0x496f00(0xa3)+_0x171ba2+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0xf9bb35 of _0x4363fd){try{const _0x51e1c4=await getDatasetDetail(_0xf9bb35),_0x18549e=Array['isArray'](_0x51e1c4[_0x496f00(0x87)])?_0x51e1c4[_0x496f00(0x87)]:[],_0x44f8db=new Set(_0x18549e[_0x496f00(0x93)](_0x5855f1=>_0x5855f1[_0x496f00(0x8f)]?.['toLowerCase']())),_0x4f4c80=_0x51e1c4['dbtableConfig']?.[_0x496f00(0x7f)]||_0x51e1c4[_0x496f00(0x7f)]||_0xf9bb35;_0x55db8f['schema:'+_0x4f4c80]={'code':_0xf9bb35,'tableName':_0x4f4c80,'fieldCount':_0x44f8db['size'],'fields':Array['from'](_0x44f8db)};}catch{_0x26c19c['push']('Dataset\x20\x22'+_0xf9bb35+'\x22\x20not\x20found\x20or\x20not\x20accessible');}}_0x26c19c[_0x496f00(0x83)]>0x0&&(_0x55db8f['schemaWarnings']=_0x26c19c);}return{'ok':_0x4948[_0x496f00(0x85)],'data':_0x55db8f,'message':_0x4948[_0x496f00(0x8e)]};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a119_0x353550=a119_0x3bd7;(function(_0x18ba3d,_0x3b9908){const _0x2d232d=a119_0x3bd7,_0x1f5376=_0x18ba3d();while(!![]){try{const _0x178986=parseInt(_0x2d232d(0xc9))/0x1*(-parseInt(_0x2d232d(0xea))/0x2)+parseInt(_0x2d232d(0xc2))/0x3+parseInt(_0x2d232d(0xd9))/0x4+parseInt(_0x2d232d(0xd2))/0x5*(parseInt(_0x2d232d(0xc7))/0x6)+-parseInt(_0x2d232d(0xc4))/0x7*(-parseInt(_0x2d232d(0xd7))/0x8)+parseInt(_0x2d232d(0xde))/0x9*(parseInt(_0x2d232d(0xc8))/0xa)+-parseInt(_0x2d232d(0xc1))/0xb;if(_0x178986===_0x3b9908)break;else _0x1f5376['push'](_0x1f5376['shift']());}catch(_0x4d4a9a){_0x1f5376['push'](_0x1f5376['shift']());}}}(a119_0x4de2,0xd65b4));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=[a119_0x353550(0xe7),a119_0x353550(0xdc),a119_0x353550(0xcb),a119_0x353550(0xd5),a119_0x353550(0xc3)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a119_0x353550(0xcc),a119_0x353550(0xd6),'locale',a119_0x353550(0xd5),a119_0x353550(0xe7),a119_0x353550(0xdc),a119_0x353550(0xe6)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x5a61ac){const _0x593ac0=a119_0x353550;return[..._0x5a61ac][_0x593ac0(0xe2)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x5b2a47){const _0x2daf3a=a119_0x353550;return TOP_LEVEL_CONFIG_KEYS[_0x2daf3a(0xe0)](_0x5b2a47);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':'env','apiDir':a119_0x353550(0xe6),'cookie':'cookie','accessKey':a119_0x353550(0xdc),'defaultFormat':'format','pageSize':'pageSize','riskLevel':a119_0x353550(0xc3),'locale':a119_0x353550(0xcb)};function a119_0x4de2(){const _0x2c7845=['env','72NLPEoZ','Default\x20page\x20size','2544800bRjRTR','en-US','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','accessKey','entries','321426hVHNPU','length','has','number','join','filter','inherit','app','apiDir','cookie','defaultApp','apps','2AljcwO','defaultFormat','24934635mvdzCK','1497132pDrXDV','riskLevel','1241555KMDPNf','Locale','Access\x20key','1356MEZGqg','120IDfavJ','819416mVnObf','Auth\x20cookie','locale','appcode','zh-CN','string','Risk\x20level','pageSize','toLowerCase','17790yCMTTV','trim','keys','format'];a119_0x4de2=function(){return _0x2c7845;};return a119_0x4de2();}function a119_0x3bd7(_0x44b015,_0x2181b2){_0x44b015=_0x44b015-0xc0;const _0x4de2e7=a119_0x4de2();let _0x3bd7c5=_0x4de2e7[_0x44b015];return _0x3bd7c5;}export function getAppProfileFlagDefs(){const _0x4cbdc0=a119_0x353550;return[{'name':_0x4cbdc0(0xd6),'type':'string','description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0x4cbdc0(0xe6),'type':_0x4cbdc0(0xce),'description':'API\x20directory\x20path'},{'name':_0x4cbdc0(0xe7),'type':_0x4cbdc0(0xce),'description':_0x4cbdc0(0xca),'hidden':!![]},{'name':'accessKey','type':_0x4cbdc0(0xce),'description':_0x4cbdc0(0xc6),'hidden':!![]},{'name':_0x4cbdc0(0xc0),'type':'string','description':_0x4cbdc0(0xdb),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x4cbdc0(0xd0),'type':_0x4cbdc0(0xe1),'description':_0x4cbdc0(0xd8)},{'name':_0x4cbdc0(0xc3),'type':'string','description':_0x4cbdc0(0xcf),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':_0x4cbdc0(0xce),'description':_0x4cbdc0(0xc5)}];}export function collectAppProfileOverrides(_0x13c106){const _0x215477=a119_0x353550,_0x1ddcad={};for(const [_0x3ba30c,_0x3f2521]of Object[_0x215477(0xdd)](APP_PROFILE_FLAG_KEY_MAP)){const _0x13c588=_0x13c106(_0x3ba30c);if(!_0x13c588)continue;_0x1ddcad[_0x3f2521]=_0x3f2521===_0x215477(0xd0)?Number(_0x13c588):_0x13c588;}return _0x1ddcad;}export function buildAppProfileListFields(_0x515bb1){const _0x4da0fc=a119_0x353550;return{'env':_0x515bb1[_0x4da0fc(0xd6)]??null,'apiDir':_0x515bb1[_0x4da0fc(0xe6)]??null,'hasCookie':!!_0x515bb1[_0x4da0fc(0xe7)],'hasAccessKey':!!_0x515bb1[_0x4da0fc(0xdc)],'format':_0x515bb1[_0x4da0fc(0xd5)]??null,'pageSize':_0x515bb1[_0x4da0fc(0xd0)]??null,'riskLevel':_0x515bb1[_0x4da0fc(0xc3)]??null,'locale':_0x515bb1[_0x4da0fc(0xcb)]??null};}export function buildAppDoctorFields(_0x442391,_0x4e7455){const _0x50cb66=a119_0x353550;return{'env':{'value':_0x442391[_0x50cb66(0xd6)]||_0x4e7455[_0x50cb66(0xd6)],'source':_0x442391[_0x50cb66(0xd6)]?_0x50cb66(0xe5):_0x50cb66(0xe4)},'apiDir':{'value':_0x442391[_0x50cb66(0xe6)]||_0x4e7455['apiDir'],'source':_0x442391[_0x50cb66(0xe6)]?_0x50cb66(0xe5):'inherit'},'cookie':{'value':_0x442391['cookie']||_0x4e7455['cookie'],'source':_0x442391['cookie']?'app':'inherit'},'accessKey':{'value':_0x442391['accessKey']||_0x4e7455[_0x50cb66(0xdc)],'source':_0x442391[_0x50cb66(0xdc)]?_0x50cb66(0xe5):_0x50cb66(0xe4)}};}export function buildCanonicalAppConfig(_0x1a8764,_0x417d2a){const _0x2e9b33=a119_0x353550,_0x2db2fd=_0x1a8764['map'](_0x592d72=>String(_0x592d72||'')[_0x2e9b33(0xd3)]())[_0x2e9b33(0xe3)](Boolean);if(_0x2db2fd[_0x2e9b33(0xdf)]===0x0)return{};const _0x39fbc4={};for(const _0x5beb84 of _0x2db2fd){_0x39fbc4[_0x5beb84]=_0x417d2a?{'appcode':_0x5beb84,'env':_0x417d2a}:{'appcode':_0x5beb84};}return{'apps':_0x39fbc4,'defaultApp':_0x2db2fd[0x0]};}export function buildCanonicalProjectConfig(_0x1c85a4,_0x3fc67a){const _0x226155=a119_0x353550,{appCodes:appCodes=[],env:_0x4d014f,metadata:_0x4b2e5e}=_0x3fc67a,_0x1d6292={..._0x1c85a4,..._0x4b2e5e||{}};delete _0x1d6292[_0x226155(0xcc)],delete _0x1d6292['app'];if(_0x4d014f)_0x1d6292['env']=_0x4d014f;else!_0x1d6292['env']&&(_0x1d6292[_0x226155(0xd6)]=DEFAULT_CONFIG_VALUES[_0x226155(0xd6)]);const _0x2f826c=buildCanonicalAppConfig(appCodes,_0x1d6292[_0x226155(0xd6)]);return Object[_0x226155(0xd4)](_0x2f826c)['length']>0x0&&(_0x1d6292[_0x226155(0xe9)]=_0x2f826c[_0x226155(0xe9)],_0x1d6292[_0x226155(0xe8)]=_0x2f826c[_0x226155(0xe8)]),_0x1d6292;}const LOCALE_MAP={'zh':a119_0x353550(0xcd),'zh-cn':'zh-CN','zh_cn':'zh-CN','en':a119_0x353550(0xda),'en-us':a119_0x353550(0xda),'en_us':a119_0x353550(0xda)};export function normalizeLocale(_0x280fe1){const _0xeb824f=a119_0x353550;if(!_0x280fe1)return null;return LOCALE_MAP[_0x280fe1[_0xeb824f(0xd1)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a120_0x4e0995=a120_0x4c94;(function(_0xc1f8e0,_0x437812){const _0x2421af=a120_0x4c94,_0x241b32=_0xc1f8e0();while(!![]){try{const _0x45d5d7=parseInt(_0x2421af(0xf5))/0x1+-parseInt(_0x2421af(0xf3))/0x2*(-parseInt(_0x2421af(0xed))/0x3)+-parseInt(_0x2421af(0xf2))/0x4+parseInt(_0x2421af(0xf4))/0x5+-parseInt(_0x2421af(0xf0))/0x6+parseInt(_0x2421af(0xef))/0x7+parseInt(_0x2421af(0xee))/0x8;if(_0x45d5d7===_0x437812)break;else _0x241b32['push'](_0x241b32['shift']());}catch(_0x538e3d){_0x241b32['push'](_0x241b32['shift']());}}}(a120_0x3e17,0xc6f1e));function a120_0x4c94(_0x121055,_0x229dd1){_0x121055=_0x121055-0xed;const _0x3e171e=a120_0x3e17();let _0x4c943f=_0x3e171e[_0x121055];return _0x4c943f;}export const CLI_VERSION_POLICY_URL=a120_0x4e0995(0xf1);function a120_0x3e17(){const _0x1a8205=['225040yUiZal','6EKnszW','34800XZQjqn','674779ArcKKX','2409714DwSOTW','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','5304268pKXJzr','984224wIHABQ','6162765TVSGgp'];a120_0x3e17=function(){return _0x1a8205;};return a120_0x3e17();}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a121_0x275e73=a121_0x3ef5;(function(_0xd9f6af,_0x4106d9){const _0x5600d5=a121_0x3ef5,_0x5388a1=_0xd9f6af();while(!![]){try{const _0x4022b6=-parseInt(_0x5600d5(0x238))/0x1*(parseInt(_0x5600d5(0x1f4))/0x2)+-parseInt(_0x5600d5(0x1f8))/0x3+parseInt(_0x5600d5(0x221))/0x4+-parseInt(_0x5600d5(0x1f5))/0x5+-parseInt(_0x5600d5(0x20c))/0x6*(-parseInt(_0x5600d5(0x247))/0x7)+parseInt(_0x5600d5(0x1ee))/0x8*(parseInt(_0x5600d5(0x204))/0x9)+parseInt(_0x5600d5(0x22e))/0xa*(-parseInt(_0x5600d5(0x242))/0xb);if(_0x4022b6===_0x4106d9)break;else _0x5388a1['push'](_0x5388a1['shift']());}catch(_0x3923b4){_0x5388a1['push'](_0x5388a1['shift']());}}}(a121_0x17eb,0x861f2));export const CLI_BIN_NAME=a121_0x275e73(0x216);export const CLI_DISPLAY_NAME=a121_0x275e73(0x21b);export const NPM_PACKAGE_NAME=a121_0x275e73(0x21e);export const GLOBAL_FLAGS=[{'name':a121_0x275e73(0x23c),'meowKey':a121_0x275e73(0x23c),'type':a121_0x275e73(0x228),'description':a121_0x275e73(0x22b),'hint':a121_0x275e73(0x239)},{'name':a121_0x275e73(0x1fa),'meowKey':a121_0x275e73(0x1fa),'type':'string','description':a121_0x275e73(0x203),'hint':a121_0x275e73(0x23b)},{'name':a121_0x275e73(0x211),'meowKey':a121_0x275e73(0x211),'type':a121_0x275e73(0x228),'description':a121_0x275e73(0x1f3),'hint':a121_0x275e73(0x222)},{'name':a121_0x275e73(0x246),'meowKey':a121_0x275e73(0x246),'type':a121_0x275e73(0x228),'description':'Output\x20format','hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':'string','description':a121_0x275e73(0x235),'hint':a121_0x275e73(0x21f)},{'name':a121_0x275e73(0x1f1),'meowKey':a121_0x275e73(0x1ec),'type':a121_0x275e73(0x226),'description':'Preview\x20operation\x20without\x20executing'},{'name':'yes','meowKey':a121_0x275e73(0x201),'type':a121_0x275e73(0x226),'description':a121_0x275e73(0x20d)},{'name':a121_0x275e73(0x233),'meowKey':a121_0x275e73(0x212),'type':a121_0x275e73(0x226),'description':a121_0x275e73(0x231)},{'name':'global','meowKey':a121_0x275e73(0x1ef),'type':a121_0x275e73(0x226),'description':'Use\x20global\x20config\x20scope'},{'name':a121_0x275e73(0x20e),'meowKey':a121_0x275e73(0x20e),'type':a121_0x275e73(0x226),'description':a121_0x275e73(0x1e9)},{'name':'ci','meowKey':'ci','type':a121_0x275e73(0x226),'description':a121_0x275e73(0x1f9),'hidden':!![]},{'name':a121_0x275e73(0x22d),'meowKey':a121_0x275e73(0x22d),'type':a121_0x275e73(0x226),'description':'Show\x20help'},{'name':a121_0x275e73(0x21d),'meowKey':'name','type':'string','description':a121_0x275e73(0x209),'hidden':!![]},{'name':'clear','meowKey':'clear','type':a121_0x275e73(0x226),'description':'Clear','hidden':!![]},{'name':'watch','meowKey':a121_0x275e73(0x232),'type':a121_0x275e73(0x226),'description':a121_0x275e73(0x202),'hidden':!![]},{'name':a121_0x275e73(0x23d),'meowKey':a121_0x275e73(0x23d),'type':a121_0x275e73(0x228),'description':'Output\x20path','hidden':!![]},{'name':a121_0x275e73(0x1fd),'meowKey':a121_0x275e73(0x1fd),'type':a121_0x275e73(0x228),'description':'JSON\x20params','hidden':!![]},{'name':'datasetcode','meowKey':'datasetcode','type':'string','description':'Dataset\x20code','hidden':!![]},{'name':a121_0x275e73(0x1f6),'meowKey':'all','type':'boolean','description':a121_0x275e73(0x1f0),'hidden':!![]},{'name':a121_0x275e73(0x20f),'meowKey':a121_0x275e73(0x1fe),'type':a121_0x275e73(0x226),'description':'Enable\x20BFF\x20save','hidden':!![]},{'name':'id','meowKey':'id','type':a121_0x275e73(0x228),'description':'Record\x20ID','hidden':!![]},{'name':a121_0x275e73(0x210),'meowKey':'type','type':a121_0x275e73(0x228),'description':a121_0x275e73(0x225),'hidden':!![]},{'name':a121_0x275e73(0x229),'meowKey':a121_0x275e73(0x229),'type':a121_0x275e73(0x228),'description':a121_0x275e73(0x1f7),'hidden':!![]},{'name':a121_0x275e73(0x1f2),'meowKey':a121_0x275e73(0x1f2),'type':a121_0x275e73(0x228),'description':a121_0x275e73(0x23f),'hidden':!![]},{'name':a121_0x275e73(0x1fc),'meowKey':a121_0x275e73(0x241),'type':'string','description':a121_0x275e73(0x227),'hidden':!![]},{'name':a121_0x275e73(0x1ed),'meowKey':a121_0x275e73(0x1ed),'type':a121_0x275e73(0x228),'description':a121_0x275e73(0x227),'hidden':!![]},{'name':'db-id','meowKey':a121_0x275e73(0x22a),'type':a121_0x275e73(0x228),'description':a121_0x275e73(0x22f),'hidden':!![]},{'name':a121_0x275e73(0x217),'meowKey':'dbid','type':a121_0x275e73(0x228),'description':'DB\x20ID','hidden':!![]},{'name':a121_0x275e73(0x220),'meowKey':a121_0x275e73(0x220),'type':a121_0x275e73(0x228),'description':'Description','hidden':!![]},{'name':'page','meowKey':a121_0x275e73(0x213),'type':a121_0x275e73(0x228),'description':a121_0x275e73(0x218),'hidden':!![]},{'name':'pagesize','meowKey':'pagesize','type':a121_0x275e73(0x228),'description':a121_0x275e73(0x245),'hidden':!![]},{'name':'keyword','meowKey':a121_0x275e73(0x22c),'type':'string','description':a121_0x275e73(0x224),'hidden':!![]},{'name':a121_0x275e73(0x230),'meowKey':a121_0x275e73(0x230),'type':a121_0x275e73(0x228),'description':'Code\x20filter','hidden':!![]},{'name':'sql','meowKey':a121_0x275e73(0x219),'type':a121_0x275e73(0x228),'description':'SQL\x20string','hidden':!![]},{'name':a121_0x275e73(0x223),'meowKey':a121_0x275e73(0x223),'type':a121_0x275e73(0x228),'description':a121_0x275e73(0x200),'hidden':!![]},{'name':'operation','meowKey':a121_0x275e73(0x244),'type':a121_0x275e73(0x228),'description':'Operation\x20type','hidden':!![]},{'name':'target','meowKey':a121_0x275e73(0x237),'type':a121_0x275e73(0x228),'description':a121_0x275e73(0x208),'hidden':!![]},{'name':a121_0x275e73(0x248),'meowKey':a121_0x275e73(0x20b),'type':a121_0x275e73(0x226),'description':a121_0x275e73(0x1eb),'hidden':!![]},{'name':a121_0x275e73(0x1ff),'meowKey':a121_0x275e73(0x1ff),'type':a121_0x275e73(0x228),'description':a121_0x275e73(0x23e),'hidden':!![]},{'name':a121_0x275e73(0x1fb),'meowKey':a121_0x275e73(0x1fb),'type':a121_0x275e73(0x228),'description':a121_0x275e73(0x240),'hidden':!![]},{'name':a121_0x275e73(0x207),'meowKey':a121_0x275e73(0x207),'type':a121_0x275e73(0x226),'description':a121_0x275e73(0x215),'hidden':!![]},{'name':a121_0x275e73(0x21c),'meowKey':a121_0x275e73(0x21c),'type':a121_0x275e73(0x226),'description':'Use\x20remote','hidden':!![]},{'name':'verbose','meowKey':a121_0x275e73(0x236),'type':a121_0x275e73(0x226),'description':a121_0x275e73(0x206),'hidden':!![]},{'name':a121_0x275e73(0x234),'meowKey':a121_0x275e73(0x1ea),'type':a121_0x275e73(0x228),'description':a121_0x275e73(0x243),'hidden':!![]},{'name':a121_0x275e73(0x205),'meowKey':a121_0x275e73(0x23a),'type':'string','description':a121_0x275e73(0x21a),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set(['appcode','app','env','format','jq',a121_0x275e73(0x1f1),a121_0x275e73(0x201),'non-interactive','ci']);function a121_0x3ef5(_0x309356,_0x2530f6){_0x309356=_0x309356-0x1e8;const _0x17eb73=a121_0x17eb();let _0x3ef55f=_0x17eb73[_0x309356];return _0x3ef55f;}export function buildMeowFlags(){const _0x17a4a7=a121_0x275e73;return Object[_0x17a4a7(0x20a)](GLOBAL_FLAGS[_0x17a4a7(0x214)](_0x19e4b9=>[_0x19e4b9[_0x17a4a7(0x1e8)],{'type':_0x19e4b9[_0x17a4a7(0x210)]}]));}function a121_0x17eb(){const _0x49854e=['Rabetbase\x20CLI','remote','name','@lovrabet/rabetbase-cli','<expr>','description','682504fQuZHn','production\x20|\x20daily','schemas','Keyword\x20filter','Type\x20filter','boolean','SQL\x20name','string','file','dbId','Override\x20appcode','keyword','help','170HKkiCr','DB\x20ID','code','Force\x20non-interactive\x20mode\x20(CI)','watch','non-interactive','operation-type','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','verbose','target','12WlkdDY','<code>','functionNode','<name>','appcode','output','Config\x20key','SQL\x20code','Config\x20value','sqlName','159445gLfAGH','Operation\x20type','operation','Page\x20size','format','1950809SxeIbN','skip-imports','meowKey','Use\x20project\x20config\x20scope','operationType','Skip\x20import\x20generation','dryRun','sqlname','256qbLrpN','global','Apply\x20to\x20all','dry-run','sqlcode','Environment','96242BqDITa','963115tYORIA','all','File\x20path','1024137ftoful','Alias\x20for\x20--non-interactive','app','value','sql-name','params','enableBffSave','key','Schemas','yes','Watch\x20mode','Select\x20app\x20profile\x20by\x20name','253278ovuWvl','function-node','Verbose\x20output','force','Target\x20path','Name','fromEntries','skipImports','18hiOUKW','Skip\x20confirmation\x20for\x20high-risk\x20writes','project','enable-bff-save','type','env','nonInteractive','page','map','Force\x20overwrite','rabetbase','dbid','Page\x20number','sql','Function\x20node'];a121_0x17eb=function(){return _0x49854e;};return a121_0x17eb();}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a122_0x3ba0d6=a122_0x518e;(function(_0x21e8cd,_0x13bed2){const _0x64060f=a122_0x518e,_0x24d093=_0x21e8cd();while(!![]){try{const _0x3170ce=-parseInt(_0x64060f(0x1e7))/0x1*(parseInt(_0x64060f(0x1ea))/0x2)+parseInt(_0x64060f(0x1eb))/0x3+-parseInt(_0x64060f(0x1e5))/0x4+parseInt(_0x64060f(0x1e3))/0x5+parseInt(_0x64060f(0x1ee))/0x6+-parseInt(_0x64060f(0x1e2))/0x7*(parseInt(_0x64060f(0x1e9))/0x8)+-parseInt(_0x64060f(0x1e8))/0x9*(-parseInt(_0x64060f(0x1e6))/0xa);if(_0x3170ce===_0x13bed2)break;else _0x24d093['push'](_0x24d093['shift']());}catch(_0x546c46){_0x24d093['push'](_0x24d093['shift']());}}}(a122_0x4693,0xde45d));function a122_0x4693(){const _0x2946ce=['4kZNeAc','3386151OqwKRI','en-US','production','4996344TMdXue','compress','819BMJDzR','603075OqYxuI','high-risk-write','6187960KaHlRR','150TvVXGF','677397VEVKaw','1676142yuVIPi','72712yButTO'];a122_0x4693=function(){return _0x2946ce;};return a122_0x4693();}import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a122_0x3ba0d6(0x1ed),'format':'compress','locale':a122_0x3ba0d6(0x1ec),'riskLevel':a122_0x3ba0d6(0x1e4),'apiDir':DEFAULT_API_DIR};function a122_0x518e(_0x18e4ff,_0x2101dd){_0x18e4ff=_0x18e4ff-0x1e1;const _0x46939a=a122_0x4693();let _0x518e29=_0x46939a[_0x18e4ff];return _0x518e29;}export const DEFAULT_COMMAND_OUTPUT_FORMAT=a122_0x3ba0d6(0x1e1);
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a123_0x5edf56=a123_0x4afc;(function(_0x14af5e,_0x165020){const _0x1d7ad9=a123_0x4afc,_0x316bf9=_0x14af5e();while(!![]){try{const _0x309262=-parseInt(_0x1d7ad9(0x1cf))/0x1+parseInt(_0x1d7ad9(0x1d8))/0x2*(-parseInt(_0x1d7ad9(0x1d1))/0x3)+-parseInt(_0x1d7ad9(0x1d4))/0x4+-parseInt(_0x1d7ad9(0x1cb))/0x5+-parseInt(_0x1d7ad9(0x1d0))/0x6+parseInt(_0x1d7ad9(0x1d2))/0x7*(-parseInt(_0x1d7ad9(0x1d3))/0x8)+parseInt(_0x1d7ad9(0x1d5))/0x9;if(_0x309262===_0x165020)break;else _0x316bf9['push'](_0x316bf9['shift']());}catch(_0x3856f7){_0x316bf9['push'](_0x316bf9['shift']());}}}(a123_0x1e5a,0xcf9b8));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a123_0x4afc(_0x2fb5ef,_0xbffa18){_0x2fb5ef=_0x2fb5ef-0x1ca;const _0x1e5a68=a123_0x1e5a();let _0x4afc96=_0x1e5a68[_0x2fb5ef];return _0x4afc96;}export function initDomains(_0x33b520){const _0x4842f3=a123_0x4afc;customApiDomain=_0x33b520?.[_0x4842f3(0x1cc)],customUserDomain=_0x33b520?.[_0x4842f3(0x1cd)],customRuntimeDomain=_0x33b520?.[_0x4842f3(0x1ce)];}function a123_0x1e5a(){const _0x58d77b=['16TnEspr','1650416AXzUXm','47015649KkBQJQ','https://user-daily.lovrabet.com','https://runtime.lovrabet.com','44524hoWxuf','https://daily-api.lovrabet.com','https://daily-runtime.lovrabet.com','97350dZhfPt','apiDomain','userDomain','runtimeDomain','1625241oXuqCB','1967556sDTmvV','192OnxfZX','1972572XALXmj'];a123_0x1e5a=function(){return _0x58d77b;};return a123_0x1e5a();}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a123_0x5edf56(0x1d6));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':a123_0x5edf56(0x1d9));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a123_0x5edf56(0x1d7):a123_0x5edf56(0x1ca));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a124_0xd60d(_0x9cc83b,_0xace786){_0x9cc83b=_0x9cc83b-0x187;const _0x55712e=a124_0x5571();let _0xd60daa=_0x55712e[_0x9cc83b];return _0xd60daa;}const a124_0x39810e=a124_0xd60d;function a124_0x5571(){const _0x3a59b6=['online','192087QacEkp','3NgzElp','2464794QqzsKl','231mTGVJt','production','development','108458sSRree','1289470adCoWI','1449948ZQbOLb','9KBoCJb','1242988BBIQRK','6673488gGMQmz','5oktIcw','daily'];a124_0x5571=function(){return _0x3a59b6;};return a124_0x5571();}(function(_0x1668ee,_0x33fa33){const _0x37196b=a124_0xd60d,_0x3ee2a5=_0x1668ee();while(!![]){try{const _0x336dbb=-parseInt(_0x37196b(0x18f))/0x1+-parseInt(_0x37196b(0x18b))/0x2+-parseInt(_0x37196b(0x18a))/0x3*(-parseInt(_0x37196b(0x193))/0x4)+parseInt(_0x37196b(0x195))/0x5*(-parseInt(_0x37196b(0x191))/0x6)+parseInt(_0x37196b(0x189))/0x7+-parseInt(_0x37196b(0x194))/0x8*(parseInt(_0x37196b(0x192))/0x9)+parseInt(_0x37196b(0x190))/0xa*(parseInt(_0x37196b(0x18c))/0xb);if(_0x336dbb===_0x33fa33)break;else _0x3ee2a5['push'](_0x3ee2a5['shift']());}catch(_0x473471){_0x3ee2a5['push'](_0x3ee2a5['shift']());}}}(a124_0x5571,0x99a80));export const RABETBASE_ENV_VALUES=[a124_0x39810e(0x18d),a124_0x39810e(0x187)];export function normalizeEnv(_0x5dbef6){const _0x21fe90=a124_0x39810e;return _0x5dbef6===_0x21fe90(0x188)?_0x21fe90(0x18d):_0x5dbef6;}export function isProduction(_0x416445){const _0x544b04=a124_0x39810e;return normalizeEnv(_0x416445)===_0x544b04(0x18d);}export function isDaily(_0x5a00de){const _0x2b0e5c=a124_0x39810e;return normalizeEnv(_0x5a00de)===_0x2b0e5c(0x187);}export function isDev(_0x11416b){const _0x1f84ad=a124_0x39810e,_0x22def4=normalizeEnv(_0x11416b);return _0x22def4===_0x1f84ad(0x18e)||_0x22def4==='dev';}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a124_0x39810e(0x18d));export function getEnv(){return env;}export function initEnv(_0x464bcd){env=normalizeEnv(_0x464bcd);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a125_0x3da1c0=a125_0x3204;function a125_0x90d2(){const _0x1a1ff1=['compress','2284961rtBSSD','10ONpzTM','52JoiUSe','pretty','json','7486204EUCJeR','170634slIqlz','22120qcfmpi','82092Meppkv','242907HKzKkC','846loWLci','8uiWLHK','267186frWHhA'];a125_0x90d2=function(){return _0x1a1ff1;};return a125_0x90d2();}(function(_0x5d3f74,_0x7b7b58){const _0x550e6b=a125_0x3204,_0x2e1caf=_0x5d3f74();while(!![]){try{const _0x36b2a5=parseInt(_0x550e6b(0xf9))/0x1+parseInt(_0x550e6b(0xfc))/0x2+-parseInt(_0x550e6b(0xf8))/0x3*(-parseInt(_0x550e6b(0x100))/0x4)+-parseInt(_0x550e6b(0xff))/0x5*(-parseInt(_0x550e6b(0xf6))/0x6)+parseInt(_0x550e6b(0xfe))/0x7*(parseInt(_0x550e6b(0xfb))/0x8)+parseInt(_0x550e6b(0xfa))/0x9*(-parseInt(_0x550e6b(0xf7))/0xa)+-parseInt(_0x550e6b(0xf5))/0xb;if(_0x36b2a5===_0x7b7b58)break;else _0x2e1caf['push'](_0x2e1caf['shift']());}catch(_0x320ed2){_0x2e1caf['push'](_0x2e1caf['shift']());}}}(a125_0x90d2,0x376e1));function a125_0x3204(_0x181cb6,_0x40d2dd){_0x181cb6=_0x181cb6-0xf5;const _0x90d245=a125_0x90d2();let _0x320462=_0x90d245[_0x181cb6];return _0x320462;}export const RABETBASE_OUTPUT_FORMAT_VALUES=[a125_0x3da1c0(0x102),a125_0x3da1c0(0x101),a125_0x3da1c0(0xfd)];
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a126_0x402bc2=a126_0x57d9;function a126_0x57d9(_0x177ddf,_0x58135d){_0x177ddf=_0x177ddf-0x1b8;const _0x4cc6fd=a126_0x4cc6();let _0x57d94b=_0x4cc6fd[_0x177ddf];return _0x57d94b;}(function(_0xad9ea2,_0x156b8e){const _0x57d231=a126_0x57d9,_0x5e9ad7=_0xad9ea2();while(!![]){try{const _0x42882b=-parseInt(_0x57d231(0x1b8))/0x1+-parseInt(_0x57d231(0x1ba))/0x2*(parseInt(_0x57d231(0x1bc))/0x3)+parseInt(_0x57d231(0x1bd))/0x4+parseInt(_0x57d231(0x1bf))/0x5+parseInt(_0x57d231(0x1b9))/0x6+parseInt(_0x57d231(0x1bb))/0x7+-parseInt(_0x57d231(0x1be))/0x8;if(_0x42882b===_0x156b8e)break;else _0x5e9ad7['push'](_0x5e9ad7['shift']());}catch(_0x272578){_0x5e9ad7['push'](_0x5e9ad7['shift']());}}}(a126_0x4cc6,0x4ad45));export const DEFAULT_API_DIR=a126_0x402bc2(0x1c0);function a126_0x4cc6(){const _0x1b06ae=['740232ohnuYi','5289656NivfLI','2620930giIKau','./src/api','524462cjrgSw','3230490GfFkRV','2jMUevY','3710266LOycXN','856581FsEHMc'];a126_0x4cc6=function(){return _0x1b06ae;};return a126_0x4cc6();}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x3dbe09=a127_0x35fd;(function(_0x190a6d,_0x7e6ba9){const _0x3f3d15=a127_0x35fd,_0x44a25d=_0x190a6d();while(!![]){try{const _0x28fc46=-parseInt(_0x3f3d15(0x182))/0x1*(parseInt(_0x3f3d15(0x17c))/0x2)+-parseInt(_0x3f3d15(0x17b))/0x3*(parseInt(_0x3f3d15(0x181))/0x4)+-parseInt(_0x3f3d15(0x183))/0x5+parseInt(_0x3f3d15(0x184))/0x6+parseInt(_0x3f3d15(0x17f))/0x7*(parseInt(_0x3f3d15(0x180))/0x8)+-parseInt(_0x3f3d15(0x185))/0x9+parseInt(_0x3f3d15(0x17d))/0xa;if(_0x28fc46===_0x7e6ba9)break;else _0x44a25d['push'](_0x44a25d['shift']());}catch(_0x120876){_0x44a25d['push'](_0x44a25d['shift']());}}}(a127_0x5357,0xe3a1b));function a127_0x35fd(_0x3a61a7,_0x31a216){_0x3a61a7=_0x3a61a7-0x17b;const _0x5357c0=a127_0x5357();let _0x35fda2=_0x5357c0[_0x3a61a7];return _0x35fda2;}function a127_0x5357(){const _0x46e46e=['14083650xYfNZm','8733bmnuLQ','4566MyWbbH','27678820ssnbFs','high-risk-write','2610517BJmmAd','24AxfzVk','556PXdROV','249OlGpUv','2287145BalzaC','246474PSxtou'];a127_0x5357=function(){return _0x46e46e;};return a127_0x5357();}export const RISK_LEVEL_VALUES=['read','write',a127_0x3dbe09(0x17e)];
|