@lovrabet/rabetbase-cli 2.2.0-beta.1 → 2.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a127_0x59095a=a127_0x59ea;(function(_0x43e946,_0x24e600){const _0x4667f2=a127_0x59ea,_0x23b888=_0x43e946();while(!![]){try{const _0x5ebe7b=parseInt(_0x4667f2(0xb7))/0x1*(parseInt(_0x4667f2(0xc1))/0x2)+-parseInt(_0x4667f2(0x99))/0x3*(-parseInt(_0x4667f2(0xa0))/0x4)+-parseInt(_0x4667f2(0x98))/0x5+-parseInt(_0x4667f2(0x95))/0x6+-parseInt(_0x4667f2(0xa4))/0x7+parseInt(_0x4667f2(0xc4))/0x8+parseInt(_0x4667f2(0xbb))/0x9;if(_0x5ebe7b===_0x24e600)break;else _0x23b888['push'](_0x23b888['shift']());}catch(_0x5a71b5){_0x23b888['push'](_0x23b888['shift']());}}}(a127_0x315b,0xdabd3));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';function a127_0x59ea(_0x569cee,_0x4476be){_0x569cee=_0x569cee-0x94;const _0x315b0b=a127_0x315b();let _0x59eae1=_0x315b0b[_0x569cee];return _0x59eae1;}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(_0x1e042e,_0x5bb34c){const _0x2b17fe=a127_0x59ea,_0x95eaef=[];let _0x50e6a3=0x1;while(!![]){const _0x32da6f=await listSqlQueries(_0x1e042e,{'currentPage':_0x50e6a3,'pageSize':PAGE_SIZE,'sqlCode':_0x5bb34c[_0x2b17fe(0x96)],'sqlName':_0x5bb34c['sqlName']}),_0x4e5850=_0x32da6f['tableData']??[];_0x95eaef[_0x2b17fe(0xc8)](..._0x4e5850);if(_0x4e5850[_0x2b17fe(0x9e)]===0x0)break;const _0x5254f9=_0x32da6f[_0x2b17fe(0xae)]?.[_0x2b17fe(0xa1)];if(_0x5254f9!=null?_0x95eaef[_0x2b17fe(0x9e)]>=_0x5254f9:_0x4e5850[_0x2b17fe(0x9e)]<PAGE_SIZE)break;_0x50e6a3++;}return _0x95eaef;}async function ensureSqlContent(_0x5b3bc8){const _0x3c8156=a127_0x59ea;if(_0x5b3bc8[_0x3c8156(0xc3)]!=null&&String(_0x5b3bc8[_0x3c8156(0xc3)])[_0x3c8156(0x9e)]>0x0)return _0x5b3bc8;return getSqlQueryDetail(_0x5b3bc8[_0x3c8156(0x96)]);}export const sqlPull={'service':a127_0x59095a(0xa5),'command':a127_0x59095a(0xac),'description':a127_0x59095a(0xc7),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a127_0x59095a(0xa6),'type':a127_0x59095a(0xab),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a127_0x59095a(0x94),'type':a127_0x59095a(0xca),'description':a127_0x59095a(0xa3)}],async 'dryRun'(_0x162c72){const _0xbb0a8=a127_0x59095a,_0x1974cc=loadSqlProjectConfig(_0x162c72[_0xbb0a8(0xcb)]),_0x1ec4cc=await readSqlLockFile(_0x1974cc[_0xbb0a8(0x9a)]),{appLock:_0x3ed5c1}=ensureSqlLockScope(_0x1ec4cc??createEmptySqlLock(),_0x1974cc[_0xbb0a8(0xcb)],_0x1974cc['sqlRoot'],_0xbb0a8(0xac)),_0x2856ea=await fetchAllSqlQueries(_0x162c72['appCode'],{'sqlCode':_0x162c72[_0xbb0a8(0xad)](_0xbb0a8(0xb5))||undefined,'sqlName':_0x162c72['str'](_0xbb0a8(0xa6))||undefined}),_0x26116a=[];for(const _0x3454a7 of _0x2856ea){const _0x5cf991=await ensureSqlContent(_0x3454a7),_0x2dca5e=ensureRemoteSqlContent(_0x5cf991),_0x3eef35=detectModeFromSql(_0x5cf991),_0x71980=_0x5cf991[_0xbb0a8(0x97)]?await getDbName(_0x162c72[_0xbb0a8(0xcb)],Number(_0x5cf991[_0xbb0a8(0x97)]))[_0xbb0a8(0xc2)](()=>undefined):undefined,_0x2a3f1b=buildLocalSqlFileContent({'sqlCode':_0x5cf991[_0xbb0a8(0x96)],'sqlName':_0x5cf991[_0xbb0a8(0xb6)],'dbId':_0x5cf991[_0xbb0a8(0x97)]},_0x2dca5e,{'dbName':_0x71980,'mode':_0x3eef35,'syncedAt':new Date()[_0xbb0a8(0x9f)](),'description':_0x5cf991['description']}),_0x1f22c8=buildSqlLockEntry(_0x5cf991,_0x2dca5e,'',{'dbName':_0x71980}),_0x46d0e5=resolveLocalSqlFilePath(_0x1974cc,_0x5cf991[_0xbb0a8(0x96)],_0x1f22c8);let _0x455b56='would_pull',_0x560bbf;if(await fileExists(_0x46d0e5)){const _0x4c0bd6=await readFile(_0x46d0e5,_0xbb0a8(0xba));isEquivalentPulledSqlFile(_0x4c0bd6,_0x2a3f1b,_0x3eef35)?(_0x455b56=_0xbb0a8(0xaa),_0x560bbf=_0xbb0a8(0xcd)):(_0x455b56=_0xbb0a8(0xb0),_0x560bbf='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)');}_0x26116a[_0xbb0a8(0xc8)]({'sqlCode':_0x5cf991[_0xbb0a8(0x96)],'sqlName':_0x5cf991[_0xbb0a8(0xb6)],'filePath':_0x46d0e5,'status':_0x455b56,'reason':_0x560bbf});}return{'method':_0xbb0a8(0xa2),'url':_0xbb0a8(0xb2),'body':{'appCode':_0x162c72[_0xbb0a8(0xcb)],'sqlCode':_0x162c72[_0xbb0a8(0xad)](_0xbb0a8(0xb5))||null,'sqlName':_0x162c72['str'](_0xbb0a8(0xa6))||null,'files':_0x26116a},'description':_0xbb0a8(0xb9)+_0x26116a[_0xbb0a8(0x9e)]+_0xbb0a8(0xa9)+_0x1974cc['sqlRootDir']};},async 'execute'(_0x2f192e){const _0x5b82d5=a127_0x59095a,_0x29abbc=loadSqlProjectConfig(_0x2f192e[_0x5b82d5(0xcb)]),_0x4208d6=await readSqlLockFile(_0x29abbc['lockFilePath']),{lockData:_0x3408a8,appLock:_0x302939}=ensureSqlLockScope(_0x4208d6??createEmptySqlLock(),_0x29abbc['appCode'],_0x29abbc[_0x5b82d5(0x9c)],_0x5b82d5(0xac)),_0x20903a=_0x2f192e['bool']('force'),_0x5e0c03=await fetchAllSqlQueries(_0x2f192e[_0x5b82d5(0xcb)],{'sqlCode':_0x2f192e['str']('sqlcode')||undefined,'sqlName':_0x2f192e[_0x5b82d5(0xad)](_0x5b82d5(0xa6))||undefined});if(_0x5e0c03[_0x5b82d5(0x9e)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x5b82d5(0xb8)};const _0x4bcc54=[],_0x1742e4=[];for(const _0x38b5c1 of _0x5e0c03){try{_0x4bcc54[_0x5b82d5(0xc8)](await ensureSqlContent(_0x38b5c1));}catch(_0x1d1e91){_0x1742e4['push']({'sqlCode':_0x38b5c1[_0x5b82d5(0x96)],'error':_0x1d1e91 instanceof Error?_0x1d1e91[_0x5b82d5(0x9b)]:String(_0x1d1e91)});}}if(_0x20903a&&!_0x2f192e[_0x5b82d5(0xc6)]){let _0x4ac106=![];for(const _0x2818aa of _0x4bcc54){const _0x15c4bd=detectModeFromSql(_0x2818aa),_0x3f7de4=_0x2818aa[_0x5b82d5(0x97)]?await getDbName(_0x2f192e[_0x5b82d5(0xcb)],Number(_0x2818aa[_0x5b82d5(0x97)]))[_0x5b82d5(0xc2)](()=>undefined):undefined,_0x4d9794=buildLocalSqlFileContent({'sqlCode':_0x2818aa[_0x5b82d5(0x96)],'sqlName':_0x2818aa['sqlName'],'dbId':_0x2818aa['dbId']},ensureRemoteSqlContent(_0x2818aa),{'dbName':_0x3f7de4,'mode':_0x15c4bd,'syncedAt':new Date()[_0x5b82d5(0x9f)](),'description':_0x2818aa['description']}),_0x73deef=resolveLocalSqlFilePath(_0x29abbc,_0x2818aa[_0x5b82d5(0x96)],buildSqlLockEntry(_0x2818aa,ensureRemoteSqlContent(_0x2818aa),'',{'dbName':_0x3f7de4}));if(await fileExists(_0x73deef)){const _0x579935=await readFile(_0x73deef,'utf8');if(!isEquivalentPulledSqlFile(_0x579935,_0x4d9794,_0x15c4bd)){_0x4ac106=!![];break;}}}if(_0x4ac106){const _0x401e6f=await confirmForceOverwrite(_0x5b82d5(0xaf));if(!_0x401e6f)throw CliErrors['cancelled'](_0x5b82d5(0xa7));}}const _0x44ae6b=cloneSqlLockData(_0x3408a8),_0xe0b35d=_0x44ae6b[_0x5b82d5(0xc5)][_0x29abbc[_0x5b82d5(0xcb)]],_0x201ab2=[],_0x5ae448=[];for(const _0x1b256c of _0x4bcc54){const _0x12c570=_0xe0b35d[_0x5b82d5(0x9d)][_0x1b256c[_0x5b82d5(0x96)]],_0x1ba3fb=ensureRemoteSqlContent(_0x1b256c),_0x4a5b78=detectModeFromSql(_0x1b256c),_0x24e44c=_0x1b256c[_0x5b82d5(0x97)]?await getDbName(_0x2f192e[_0x5b82d5(0xcb)],Number(_0x1b256c['dbId']))[_0x5b82d5(0xc2)](()=>undefined):undefined,_0x1781ce=buildLocalSqlFileContent({'sqlCode':_0x1b256c['sqlCode'],'sqlName':_0x1b256c['sqlName'],'dbId':_0x1b256c[_0x5b82d5(0x97)]},_0x1ba3fb,{'dbName':_0x24e44c,'mode':_0x4a5b78,'syncedAt':new Date()['toISOString'](),'description':_0x1b256c[_0x5b82d5(0xc9)]}),_0x57e7d3=buildSqlLockEntry(_0x1b256c,_0x1ba3fb,computeSqlContentHash(_0x1781ce),{'dbName':_0x24e44c}),_0x3b3ccd=_0x57e7d3[_0x5b82d5(0xb1)],_0x191aac=join(_0x29abbc['sqlRootDir'],_0x3b3ccd);try{if(await fileExists(_0x191aac)){const _0x375900=await readFile(_0x191aac,_0x5b82d5(0xba));if(isEquivalentPulledSqlFile(_0x375900,_0x1781ce,_0x4a5b78)){_0x5ae448[_0x5b82d5(0xc8)]({'sqlCode':_0x1b256c[_0x5b82d5(0x96)],'reason':_0x5b82d5(0xcd)}),_0xe0b35d[_0x5b82d5(0x9d)][_0x1b256c['sqlCode']]={..._0x57e7d3,'hash':computeSqlContentHash(_0x375900),'path':_0x3b3ccd};continue;}if(!_0x20903a){_0x5ae448[_0x5b82d5(0xc8)]({'sqlCode':_0x1b256c['sqlCode'],'reason':_0x5b82d5(0xb3)});continue;}}const _0x23d3a9=_0x12c570?.[_0x5b82d5(0xb1)]?join(_0x29abbc['sqlRootDir'],_0x12c570[_0x5b82d5(0xb1)]):undefined;_0x23d3a9&&_0x23d3a9!==_0x191aac&&await fileExists(_0x23d3a9)&&await rm(_0x23d3a9,{'force':!![]}),await ensureParentDirectory(_0x191aac),await writeFile(_0x191aac,_0x1781ce,_0x5b82d5(0xba)),_0xe0b35d[_0x5b82d5(0x9d)][_0x1b256c[_0x5b82d5(0x96)]]={..._0x57e7d3,'path':_0x3b3ccd},_0x201ab2[_0x5b82d5(0xc8)]({'sqlCode':_0x1b256c['sqlCode'],'filePath':_0x191aac});}catch(_0x19bd20){_0x1742e4[_0x5b82d5(0xc8)]({'sqlCode':_0x1b256c[_0x5b82d5(0x96)],'error':_0x19bd20 instanceof Error?_0x19bd20['message']:String(_0x19bd20)});}}return _0xe0b35d['lastSync']=new Date()[_0x5b82d5(0x9f)](),await writeSqlLockFile(_0x29abbc[_0x5b82d5(0x9a)],_0x44ae6b),{'ok':_0x1742e4['length']===0x0,'data':{'pulled':_0x201ab2,'skipped':_0x5ae448,'failed':_0x1742e4},'message':'Pull\x20complete:\x20'+_0x201ab2[_0x5b82d5(0x9e)]+_0x5b82d5(0xbe)+_0x5ae448[_0x5b82d5(0x9e)]+'\x20skipped,\x20'+_0x1742e4[_0x5b82d5(0x9e)]+_0x5b82d5(0xcc)};}};function detectModeFromSql(_0x5f0ce4){const _0x3d091c=a127_0x59095a,_0x301969=ensureRemoteSqlContent(_0x5f0ce4),_0x513726=stripLocalSqlMetadata(_0x301969,_0x3d091c(0xb4))['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x3d091c(0xbc)](_0x513726))return _0x3d091c(0xb4);return _0x3d091c(0xa5);}function a127_0x315b(){const _0x3c16f8=['test','split','\x20written,\x20','filter','join','52504fpxGYh','catch','sqlContent','3269872ftRwIC','apps','nonInteractive','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','push','description','boolean','appCode','\x20failed','unchanged','force','2075574WjpeuG','sqlCode','dbId','6624770paYFFi','794001CYGTFF','lockFilePath','message','sqlRoot','sqls','length','toISOString','20OeuePm','totalCount','POST','Force\x20overwrite\x20local\x20unsynced\x20changes','5673857lKxbNS','sql','name','Force\x20pull\x20cancelled.','replace','\x20SQL\x20file(s)\x20into\x20','skipped','string','pull','str','paging','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','conflict','path','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','local\x20differs\x20from\x20remote','mybatisXml','sqlcode','sqlName','41uZpKhS','No\x20remote\x20SQL\x20queries\x20matched.','Would\x20pull\x20','utf8','5120892KKbDcB'];a127_0x315b=function(){return _0x3c16f8;};return a127_0x315b();}function isEquivalentPulledSqlFile(_0x142ba1,_0x17546c,_0x2d51c7){return normalizePullComparableContent(_0x142ba1,_0x2d51c7)===normalizePullComparableContent(_0x17546c,_0x2d51c7);}function normalizePullComparableContent(_0x2ad8e3,_0x124a2e){const _0x259878=a127_0x59095a,_0x191c2b=_0x2ad8e3[_0x259878(0xa8)](/\r\n/g,'\x0a')[_0x259878(0xbd)]('\x0a'),_0x43b221=_0x191c2b[_0x259878(0xbf)](_0x400610=>!isSyncedAtMetadataLine(_0x400610,_0x124a2e));return _0x43b221[_0x259878(0xc0)]('\x0a');}function isSyncedAtMetadataLine(_0x233739,_0x4e3149){const _0x4add92=a127_0x59095a;if(_0x4e3149===_0x4add92(0xb4))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x4add92(0xbc)](_0x233739);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x4add92(0xbc)](_0x233739);}
|
|
1
|
+
const a127_0xbf3202=a127_0xb046;(function(_0x26b5e1,_0x396338){const _0x708164=a127_0xb046,_0x14aa14=_0x26b5e1();while(!![]){try{const _0x2d0bd1=parseInt(_0x708164(0x1cc))/0x1+-parseInt(_0x708164(0x1c6))/0x2*(parseInt(_0x708164(0x1b3))/0x3)+-parseInt(_0x708164(0x1b2))/0x4+-parseInt(_0x708164(0x1cb))/0x5*(-parseInt(_0x708164(0x1d9))/0x6)+-parseInt(_0x708164(0x1d8))/0x7+parseInt(_0x708164(0x1c5))/0x8+parseInt(_0x708164(0x1af))/0x9*(parseInt(_0x708164(0x1a3))/0xa);if(_0x2d0bd1===_0x396338)break;else _0x14aa14['push'](_0x14aa14['shift']());}catch(_0x54944d){_0x14aa14['push'](_0x14aa14['shift']());}}}(a127_0x1b48,0xc5043));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';function a127_0xb046(_0x181326,_0x3ce9ad){_0x181326=_0x181326-0x1a3;const _0x1b48b1=a127_0x1b48();let _0xb04690=_0x1b48b1[_0x181326];return _0xb04690;}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(_0x3b7097,_0x13751a){const _0x2f3564=a127_0xb046,_0xdc457f=[];let _0x39e816=0x1;while(!![]){const _0xa1d3ca=await listSqlQueries(_0x3b7097,{'currentPage':_0x39e816,'pageSize':PAGE_SIZE,'sqlCode':_0x13751a[_0x2f3564(0x1ba)],'sqlName':_0x13751a[_0x2f3564(0x1cd)]}),_0x2fec2f=_0xa1d3ca[_0x2f3564(0x1da)]??[];_0xdc457f[_0x2f3564(0x1b8)](..._0x2fec2f);if(_0x2fec2f['length']===0x0)break;const _0x4108a4=_0xa1d3ca[_0x2f3564(0x1ae)]?.[_0x2f3564(0x1ac)];if(_0x4108a4!=null?_0xdc457f[_0x2f3564(0x1a9)]>=_0x4108a4:_0x2fec2f['length']<PAGE_SIZE)break;_0x39e816++;}return _0xdc457f;}async function ensureSqlContent(_0x15146a){const _0x5490b8=a127_0xb046;if(_0x15146a[_0x5490b8(0x1a6)]!=null&&String(_0x15146a[_0x5490b8(0x1a6)])[_0x5490b8(0x1a9)]>0x0)return _0x15146a;return getSqlQueryDetail(_0x15146a['sqlCode']);}function a127_0x1b48(){const _0x2c1e72=['length','sqlRoot','Would\x20pull\x20','totalCount','nonInteractive','paging','224559uwdFqN','split','boolean','1905852MEJKiI','9qTRUNX','dbId','catch','string','pull','push','write','sqlCode','sqlRootDir','No\x20remote\x20SQL\x20queries\x20matched.','message','appCode','join','toISOString','local\x20differs\x20from\x20remote','skipped','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','\x20failed','3395968aWgKys','764806dPzzQe','sqls','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','utf8','apps','5KZGxUk','71747ivFFaE','sqlName','mybatisXml','name','test','bool','path','conflict','sql','\x20skipped,\x20','lastSync','sqlcode','7649481Gyiiyb','7983138jUibLv','tableData','str','lockFilePath','Pull\x20complete:\x20','force','680FiGyTb','\x20written,\x20','description','sqlContent','would_pull','POST'];a127_0x1b48=function(){return _0x2c1e72;};return a127_0x1b48();}export const sqlPull={'service':a127_0xbf3202(0x1d4),'command':a127_0xbf3202(0x1b7),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a127_0xbf3202(0x1b9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a127_0xbf3202(0x1cf),'type':a127_0xbf3202(0x1b6),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':'force','type':a127_0xbf3202(0x1b1),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x37f05c){const _0xc34539=a127_0xbf3202,_0x3b140a=loadSqlProjectConfig(_0x37f05c['appCode']),_0x18e685=await readSqlLockFile(_0x3b140a[_0xc34539(0x1dc)]),{appLock:_0x33404b}=ensureSqlLockScope(_0x18e685??createEmptySqlLock(),_0x3b140a['appCode'],_0x3b140a[_0xc34539(0x1aa)],_0xc34539(0x1b7)),_0x4114e4=await fetchAllSqlQueries(_0x37f05c['appCode'],{'sqlCode':_0x37f05c['str'](_0xc34539(0x1d7))||undefined,'sqlName':_0x37f05c['str'](_0xc34539(0x1cf))||undefined}),_0x4dd375=[];for(const _0xd45512 of _0x4114e4){const _0x10977b=await ensureSqlContent(_0xd45512),_0x12e5da=ensureRemoteSqlContent(_0x10977b),_0x36247b=detectModeFromSql(_0x10977b),_0x250453=_0x10977b['dbId']?await getDbName(_0x37f05c[_0xc34539(0x1be)],Number(_0x10977b[_0xc34539(0x1b4)]))['catch'](()=>undefined):undefined,_0x383848=buildLocalSqlFileContent({'sqlCode':_0x10977b[_0xc34539(0x1ba)],'sqlName':_0x10977b[_0xc34539(0x1cd)],'dbId':_0x10977b[_0xc34539(0x1b4)]},_0x12e5da,{'dbName':_0x250453,'mode':_0x36247b,'syncedAt':new Date()['toISOString'](),'description':_0x10977b[_0xc34539(0x1a5)]}),_0x4c548d=buildSqlLockEntry(_0x10977b,_0x12e5da,'',{'dbName':_0x250453}),_0x569861=resolveLocalSqlFilePath(_0x3b140a,_0x10977b['sqlCode'],_0x4c548d);let _0x40dca5=_0xc34539(0x1a7),_0x42d414;if(await fileExists(_0x569861)){const _0x54fda9=await readFile(_0x569861,_0xc34539(0x1c9));isEquivalentPulledSqlFile(_0x54fda9,_0x383848,_0x36247b)?(_0x40dca5=_0xc34539(0x1c2),_0x42d414='unchanged'):(_0x40dca5=_0xc34539(0x1d3),_0x42d414=_0xc34539(0x1c3));}_0x4dd375['push']({'sqlCode':_0x10977b[_0xc34539(0x1ba)],'sqlName':_0x10977b[_0xc34539(0x1cd)],'filePath':_0x569861,'status':_0x40dca5,'reason':_0x42d414});}return{'method':_0xc34539(0x1a8),'url':_0xc34539(0x1c8),'body':{'appCode':_0x37f05c['appCode'],'sqlCode':_0x37f05c['str'](_0xc34539(0x1d7))||null,'sqlName':_0x37f05c[_0xc34539(0x1db)](_0xc34539(0x1cf))||null,'files':_0x4dd375},'description':_0xc34539(0x1ab)+_0x4dd375[_0xc34539(0x1a9)]+'\x20SQL\x20file(s)\x20into\x20'+_0x3b140a['sqlRootDir']};},async 'execute'(_0x104095){const _0x1c3ac7=a127_0xbf3202,_0x56e478=loadSqlProjectConfig(_0x104095['appCode']),_0x24d0f0=await readSqlLockFile(_0x56e478[_0x1c3ac7(0x1dc)]),{lockData:_0x5761bd,appLock:_0x1f313d}=ensureSqlLockScope(_0x24d0f0??createEmptySqlLock(),_0x56e478[_0x1c3ac7(0x1be)],_0x56e478[_0x1c3ac7(0x1aa)],_0x1c3ac7(0x1b7)),_0x111b86=_0x104095[_0x1c3ac7(0x1d1)](_0x1c3ac7(0x1de)),_0x34e0cd=await fetchAllSqlQueries(_0x104095[_0x1c3ac7(0x1be)],{'sqlCode':_0x104095[_0x1c3ac7(0x1db)](_0x1c3ac7(0x1d7))||undefined,'sqlName':_0x104095[_0x1c3ac7(0x1db)](_0x1c3ac7(0x1cf))||undefined});if(_0x34e0cd[_0x1c3ac7(0x1a9)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x1c3ac7(0x1bc)};const _0x3ac030=[],_0x26c34c=[];for(const _0x20a967 of _0x34e0cd){try{_0x3ac030[_0x1c3ac7(0x1b8)](await ensureSqlContent(_0x20a967));}catch(_0x4e601a){_0x26c34c[_0x1c3ac7(0x1b8)]({'sqlCode':_0x20a967[_0x1c3ac7(0x1ba)],'error':_0x4e601a instanceof Error?_0x4e601a[_0x1c3ac7(0x1bd)]:String(_0x4e601a)});}}if(_0x111b86&&!_0x104095[_0x1c3ac7(0x1ad)]){let _0x543f50=![];for(const _0x363ffc of _0x3ac030){const _0x2108e3=detectModeFromSql(_0x363ffc),_0x8352c6=_0x363ffc[_0x1c3ac7(0x1b4)]?await getDbName(_0x104095[_0x1c3ac7(0x1be)],Number(_0x363ffc[_0x1c3ac7(0x1b4)]))[_0x1c3ac7(0x1b5)](()=>undefined):undefined,_0x32c30f=buildLocalSqlFileContent({'sqlCode':_0x363ffc[_0x1c3ac7(0x1ba)],'sqlName':_0x363ffc[_0x1c3ac7(0x1cd)],'dbId':_0x363ffc[_0x1c3ac7(0x1b4)]},ensureRemoteSqlContent(_0x363ffc),{'dbName':_0x8352c6,'mode':_0x2108e3,'syncedAt':new Date()[_0x1c3ac7(0x1c0)](),'description':_0x363ffc['description']}),_0x58d13e=resolveLocalSqlFilePath(_0x56e478,_0x363ffc['sqlCode'],buildSqlLockEntry(_0x363ffc,ensureRemoteSqlContent(_0x363ffc),'',{'dbName':_0x8352c6}));if(await fileExists(_0x58d13e)){const _0x58fb59=await readFile(_0x58d13e,_0x1c3ac7(0x1c9));if(!isEquivalentPulledSqlFile(_0x58fb59,_0x32c30f,_0x2108e3)){_0x543f50=!![];break;}}}if(_0x543f50){const _0x25d120=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x25d120)throw CliErrors['cancelled']('Force\x20pull\x20cancelled.');}}const _0x46b70a=cloneSqlLockData(_0x5761bd),_0x4fea68=_0x46b70a[_0x1c3ac7(0x1ca)][_0x56e478['appCode']],_0x1d3369=[],_0x25b6fd=[];for(const _0x323a3f of _0x3ac030){const _0x2cc7fc=_0x4fea68['sqls'][_0x323a3f['sqlCode']],_0xe77c97=ensureRemoteSqlContent(_0x323a3f),_0x121822=detectModeFromSql(_0x323a3f),_0x4bfd0a=_0x323a3f['dbId']?await getDbName(_0x104095[_0x1c3ac7(0x1be)],Number(_0x323a3f[_0x1c3ac7(0x1b4)]))[_0x1c3ac7(0x1b5)](()=>undefined):undefined,_0x32b93f=buildLocalSqlFileContent({'sqlCode':_0x323a3f[_0x1c3ac7(0x1ba)],'sqlName':_0x323a3f[_0x1c3ac7(0x1cd)],'dbId':_0x323a3f['dbId']},_0xe77c97,{'dbName':_0x4bfd0a,'mode':_0x121822,'syncedAt':new Date()[_0x1c3ac7(0x1c0)](),'description':_0x323a3f[_0x1c3ac7(0x1a5)]}),_0xcaa440=buildSqlLockEntry(_0x323a3f,_0xe77c97,computeSqlContentHash(_0x32b93f),{'dbName':_0x4bfd0a}),_0x32c795=_0xcaa440[_0x1c3ac7(0x1d2)],_0x5bafd7=join(_0x56e478[_0x1c3ac7(0x1bb)],_0x32c795);try{if(await fileExists(_0x5bafd7)){const _0x623b9b=await readFile(_0x5bafd7,_0x1c3ac7(0x1c9));if(isEquivalentPulledSqlFile(_0x623b9b,_0x32b93f,_0x121822)){_0x25b6fd[_0x1c3ac7(0x1b8)]({'sqlCode':_0x323a3f[_0x1c3ac7(0x1ba)],'reason':'unchanged'}),_0x4fea68[_0x1c3ac7(0x1c7)][_0x323a3f[_0x1c3ac7(0x1ba)]]={..._0xcaa440,'hash':computeSqlContentHash(_0x623b9b),'path':_0x32c795};continue;}if(!_0x111b86){_0x25b6fd[_0x1c3ac7(0x1b8)]({'sqlCode':_0x323a3f['sqlCode'],'reason':_0x1c3ac7(0x1c1)});continue;}}const _0x4c80fa=_0x2cc7fc?.['path']?join(_0x56e478[_0x1c3ac7(0x1bb)],_0x2cc7fc[_0x1c3ac7(0x1d2)]):undefined;_0x4c80fa&&_0x4c80fa!==_0x5bafd7&&await fileExists(_0x4c80fa)&&await rm(_0x4c80fa,{'force':!![]}),await ensureParentDirectory(_0x5bafd7),await writeFile(_0x5bafd7,_0x32b93f,_0x1c3ac7(0x1c9)),_0x4fea68[_0x1c3ac7(0x1c7)][_0x323a3f[_0x1c3ac7(0x1ba)]]={..._0xcaa440,'path':_0x32c795},_0x1d3369[_0x1c3ac7(0x1b8)]({'sqlCode':_0x323a3f[_0x1c3ac7(0x1ba)],'filePath':_0x5bafd7});}catch(_0x11209a){_0x26c34c[_0x1c3ac7(0x1b8)]({'sqlCode':_0x323a3f[_0x1c3ac7(0x1ba)],'error':_0x11209a instanceof Error?_0x11209a[_0x1c3ac7(0x1bd)]:String(_0x11209a)});}}return _0x4fea68[_0x1c3ac7(0x1d6)]=new Date()[_0x1c3ac7(0x1c0)](),await writeSqlLockFile(_0x56e478[_0x1c3ac7(0x1dc)],_0x46b70a),{'ok':_0x26c34c['length']===0x0,'data':{'pulled':_0x1d3369,'skipped':_0x25b6fd,'failed':_0x26c34c},'message':_0x1c3ac7(0x1dd)+_0x1d3369[_0x1c3ac7(0x1a9)]+_0x1c3ac7(0x1a4)+_0x25b6fd[_0x1c3ac7(0x1a9)]+_0x1c3ac7(0x1d5)+_0x26c34c[_0x1c3ac7(0x1a9)]+_0x1c3ac7(0x1c4)};}};function detectModeFromSql(_0x299204){const _0x41476b=a127_0xbf3202,_0x599cb1=ensureRemoteSqlContent(_0x299204),_0xa2d123=stripLocalSqlMetadata(_0x599cb1,_0x41476b(0x1ce))['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x41476b(0x1d0)](_0xa2d123))return _0x41476b(0x1ce);return'sql';}function isEquivalentPulledSqlFile(_0x4532ff,_0x20820b,_0x19f2fe){return normalizePullComparableContent(_0x4532ff,_0x19f2fe)===normalizePullComparableContent(_0x20820b,_0x19f2fe);}function normalizePullComparableContent(_0x1ff5fc,_0x51b106){const _0x34232e=a127_0xbf3202,_0x1d5b21=_0x1ff5fc['replace'](/\r\n/g,'\x0a')[_0x34232e(0x1b0)]('\x0a'),_0xf25979=_0x1d5b21['filter'](_0x485d2e=>!isSyncedAtMetadataLine(_0x485d2e,_0x51b106));return _0xf25979[_0x34232e(0x1bf)]('\x0a');}function isSyncedAtMetadataLine(_0x1b04f6,_0x4b8fd0){const _0xed801f=a127_0xbf3202;if(_0x4b8fd0===_0xed801f(0x1ce))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0xed801f(0x1d0)](_0x1b04f6);return/^\s*--\s*@lovrabet\.syncedAt:/[_0xed801f(0x1d0)](_0x1b04f6);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a128_0x1ba9e3=a128_0x145e;(function(_0x4e84e7,_0x177a01){const _0x3e0dbb=a128_0x145e,_0x273c70=_0x4e84e7();while(!![]){try{const _0x2e3a3c=-parseInt(_0x3e0dbb(0x15e))/0x1*(-parseInt(_0x3e0dbb(0x15b))/0x2)+parseInt(_0x3e0dbb(0x162))/0x3*(parseInt(_0x3e0dbb(0x17d))/0x4)+parseInt(_0x3e0dbb(0x17c))/0x5+-parseInt(_0x3e0dbb(0x15c))/0x6*(parseInt(_0x3e0dbb(0x186))/0x7)+-parseInt(_0x3e0dbb(0x180))/0x8*(parseInt(_0x3e0dbb(0x167))/0x9)+-parseInt(_0x3e0dbb(0x18b))/0xa+parseInt(_0x3e0dbb(0x17b))/0xb*(parseInt(_0x3e0dbb(0x160))/0xc);if(_0x2e3a3c===_0x177a01)break;else _0x273c70['push'](_0x273c70['shift']());}catch(_0x2e9933){_0x273c70['push'](_0x273c70['shift']());}}}(a128_0x5103,0x6a93d));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';function a128_0x5103(){const _0x19978f=['replace','lastSync','26978CUKbln','\x22\x20for\x20sqlCode\x20','remoteId','\x20SQL\x20file(s)','lockFilePath','7056120lOxCUz','sqlCode','sqlRoot','sqlName','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','catch','Push\x20complete:\x20','filter','path','version','map','dbDirectory','sql','\x20pushed,\x20','\x20failed','sqlcode','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','4JKANyU','660zFkMJB','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','397031Xtpdtu','exec','5781576zuaFmu','No\x20local\x20SQL\x20files\x20found.','237oEUHfP','push','bool','length','sqlConfig','657RunQpM','\x20skipped,\x20','filePath','startsWith','unchanged','join','appCode','toISOString','Would\x20push\x20','sqlRootDir','message','entries','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','dbName','hash','utf8','dbId','POST','Local\x20SQL\x20not\x20found:\x20','force','11jjwjlc','3584530StlviT','8VOSFOk','sqls','validation','46776gKwiTq','set','mode','relativePath'];a128_0x5103=function(){return _0x19978f;};return a128_0x5103();}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x3fc62d,_0x5be10c,_0x4d4a2f){const _0x1212ce=a128_0x145e,_0x12b524=await scanLocalSqlQueries(_0x3fc62d),_0x4739b1=new Map();for(const _0x51c6e6 of _0x12b524){if(_0x4d4a2f&&_0x51c6e6[_0x1212ce(0x18c)]!==_0x4d4a2f)continue;const _0x2681d3=_0x4739b1['get'](_0x51c6e6[_0x1212ce(0x18c)])??[];_0x2681d3[_0x1212ce(0x163)](_0x51c6e6),_0x4739b1[_0x1212ce(0x181)](_0x51c6e6[_0x1212ce(0x18c)],_0x2681d3);}if(_0x4d4a2f&&!_0x4739b1['has'](_0x4d4a2f))throw CliErrors[_0x1212ce(0x17f)](_0x1212ce(0x179)+_0x4d4a2f);const _0x11f021=[];for(const [_0xc4da41,_0x1322cf]of _0x4739b1[_0x1212ce(0x172)]()){if(_0x1322cf[_0x1212ce(0x165)]===0x1){_0x11f021['push'](_0x1322cf[0x0]);continue;}const _0x1eb25c=_0x5be10c[_0x1212ce(0x17e)][_0xc4da41],_0x4dff02=_0x1eb25c?.['path'],_0x47c4b0=_0x4dff02?_0x1322cf[_0x1212ce(0x192)](_0x58c7b5=>_0x58c7b5[_0x1212ce(0x183)]!==_0x4dff02):_0x1322cf;if(_0x1eb25c&&_0x47c4b0[_0x1212ce(0x165)]===0x1){_0x11f021[_0x1212ce(0x163)](_0x47c4b0[0x0]);continue;}throw CliErrors['validation'](_0x1212ce(0x15d)+_0xc4da41+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x11f021;}export const sqlPush={'service':a128_0x1ba9e3(0x197),'command':a128_0x1ba9e3(0x163),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':'high-risk-write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0x1ba9e3(0x17a),'type':'boolean','description':a128_0x1ba9e3(0x173)}],async 'dryRun'(_0x461a6e){const _0x3225f8=a128_0x1ba9e3,_0x28ac9a=loadSqlProjectConfig(_0x461a6e[_0x3225f8(0x16d)]),_0x41fa7c=await readSqlLockFile(_0x28ac9a['lockFilePath']),{appLock:_0x18b212}=ensureSqlLockScope(_0x41fa7c??createEmptySqlLock(),_0x461a6e[_0x3225f8(0x16d)],_0x28ac9a['sqlRoot'],_0x3225f8(0x163)),_0x2d2c2f=await getTargetSqlQueries(_0x28ac9a,_0x18b212,_0x461a6e['str'](_0x3225f8(0x159))||undefined),_0x275eda=[];for(const _0x2576c2 of _0x2d2c2f){const _0x5564cc=await computeSqlFileHash(_0x2576c2[_0x3225f8(0x169)]),_0x3ebbae=_0x18b212[_0x3225f8(0x17e)][_0x2576c2['sqlCode']],_0x35c1db=!!_0x3ebbae&&(_0x3ebbae[_0x3225f8(0x193)]!==_0x2576c2[_0x3225f8(0x183)]||!!_0x2576c2[_0x3225f8(0x18e)]&&_0x3ebbae[_0x3225f8(0x18e)]!==_0x2576c2[_0x3225f8(0x18e)]);if(!_0x461a6e[_0x3225f8(0x164)](_0x3225f8(0x17a))&&_0x3ebbae&&_0x3ebbae[_0x3225f8(0x175)]===_0x5564cc&&!_0x35c1db)continue;_0x275eda[_0x3225f8(0x163)](_0x2576c2[_0x3225f8(0x18c)]);}return{'method':_0x3225f8(0x178),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x275eda,'appCode':_0x461a6e[_0x3225f8(0x16d)]},'description':_0x3225f8(0x16f)+_0x275eda[_0x3225f8(0x165)]+_0x3225f8(0x189)};},async 'execute'(_0x4a1570){const _0x565f24=a128_0x1ba9e3,_0x407d81=loadSqlProjectConfig(_0x4a1570[_0x565f24(0x16d)]),_0x19cf8d=await readSqlLockFile(_0x407d81['lockFilePath']),{lockData:_0x5c9412,appLock:_0x392cfe}=ensureSqlLockScope(_0x19cf8d??createEmptySqlLock(),_0x4a1570[_0x565f24(0x16d)],_0x407d81[_0x565f24(0x18d)],'push'),_0x2090ea=await getTargetSqlQueries(_0x407d81,_0x392cfe,_0x4a1570['str'](_0x565f24(0x159))||undefined);if(_0x2090ea[_0x565f24(0x165)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x565f24(0x161)};const _0x29e60f=[],_0x2fb909=[],_0x2fab0c=[];for(const _0x103aef of _0x2090ea){const _0x5e4fd4=_0x392cfe['sqls'][_0x103aef['sqlCode']];if(!_0x5e4fd4){_0x2fab0c['push']({'sqlCode':_0x103aef['sqlCode'],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x50564d=await computeSqlFileHash(_0x103aef[_0x565f24(0x169)]),_0xb44578=_0x5e4fd4[_0x565f24(0x193)]!==_0x103aef['relativePath']||!!_0x103aef[_0x565f24(0x18e)]&&_0x5e4fd4[_0x565f24(0x18e)]!==_0x103aef[_0x565f24(0x18e)];if(!_0x4a1570[_0x565f24(0x164)](_0x565f24(0x17a))&&_0x5e4fd4[_0x565f24(0x175)]===_0x50564d&&!_0xb44578){_0x2fb909[_0x565f24(0x163)]({'sqlCode':_0x103aef['sqlCode'],'reason':_0x565f24(0x16b)});continue;}if(_0x5e4fd4[_0x565f24(0x194)]==null){_0x2fab0c[_0x565f24(0x163)]({'sqlCode':_0x103aef[_0x565f24(0x18c)],'error':_0x565f24(0x18f)});continue;}const _0x23fc5c=await readFile(_0x103aef['filePath'],_0x565f24(0x176)),_0x1a5454=stripLocalSqlMetadata(_0x23fc5c,_0x103aef[_0x565f24(0x182)]),_0x15122c=_0x103aef[_0x565f24(0x18e)]||_0x5e4fd4[_0x565f24(0x18e)],_0x28cd23=await resolveTargetDbBinding(_0x4a1570[_0x565f24(0x16d)],_0x103aef,_0x5e4fd4),_0x264a39=await updateSqlQuery({'id':_0x5e4fd4[_0x565f24(0x188)],'appCode':_0x4a1570[_0x565f24(0x16d)],'sqlCode':_0x103aef[_0x565f24(0x18c)],'sqlName':_0x15122c,'dbId':_0x28cd23[_0x565f24(0x177)],'version':_0x5e4fd4['version'],'sqlContent':_0x1a5454,'sqlConfig':_0x5e4fd4[_0x565f24(0x166)]??undefined}),_0x3482fa=_0x264a39[_0x565f24(0x177)]?await getDbName(_0x4a1570[_0x565f24(0x16d)],Number(_0x264a39[_0x565f24(0x177)]))[_0x565f24(0x190)](()=>_0x28cd23[_0x565f24(0x174)]):_0x28cd23[_0x565f24(0x174)];_0x392cfe[_0x565f24(0x17e)][_0x103aef[_0x565f24(0x18c)]]={...buildSqlLockEntry(_0x264a39,_0x1a5454,_0x50564d,{'dbName':_0x3482fa}),'path':_0x103aef[_0x565f24(0x183)],'mode':_0x5e4fd4['mode']},await archivePreviousSqlFileIfNeeded(_0x407d81,_0x5e4fd4[_0x565f24(0x193)],_0x103aef['relativePath']),_0x29e60f[_0x565f24(0x163)]({'sqlCode':_0x103aef[_0x565f24(0x18c)],'remoteId':_0x5e4fd4[_0x565f24(0x188)]});}catch(_0x2ca5a8){_0x2fab0c[_0x565f24(0x163)]({'sqlCode':_0x103aef[_0x565f24(0x18c)],'error':_0x2ca5a8 instanceof Error?_0x2ca5a8[_0x565f24(0x171)]:String(_0x2ca5a8)});}}return _0x392cfe[_0x565f24(0x185)]=new Date()[_0x565f24(0x16e)](),await writeSqlLockFile(_0x407d81[_0x565f24(0x18a)],_0x5c9412),{'ok':_0x2fab0c[_0x565f24(0x165)]===0x0,'data':{'pushed':_0x29e60f,'skipped':_0x2fb909,'failed':_0x2fab0c},'message':_0x565f24(0x191)+_0x29e60f[_0x565f24(0x165)]+_0x565f24(0x157)+_0x2fb909[_0x565f24(0x165)]+_0x565f24(0x168)+_0x2fab0c[_0x565f24(0x165)]+_0x565f24(0x158)};}};async function archivePreviousSqlFileIfNeeded(_0x2bf2ac,_0x391351,_0x3e2cfb){const _0x213c30=a128_0x1ba9e3;if(!_0x391351||_0x391351===_0x3e2cfb)return;const _0x449b08=join(_0x2bf2ac[_0x213c30(0x170)],_0x391351);if(!await fileExists(_0x449b08))return;const _0x2eaf85=await moveToTrash(_0x2bf2ac['projectRoot'],_0x2bf2ac['trashDir'],_0x449b08);await cleanupEmptyDirectories(dirname(_0x449b08),_0x2bf2ac[_0x213c30(0x170)]),void _0x2eaf85;}async function moveToTrash(_0x43e9d8,_0x48770f,_0x2f613b){const _0x5ed645=a128_0x1ba9e3,_0x9b384e=new Date()[_0x5ed645(0x16e)]()[_0x5ed645(0x184)](/[:.]/g,'-'),_0x3269b8=relative(_0x43e9d8,_0x2f613b),_0x364c34=join(_0x48770f,_0x9b384e,_0x3269b8);return await mkdir(dirname(_0x364c34),{'recursive':!![]}),await rename(_0x2f613b,_0x364c34),_0x364c34;}function a128_0x145e(_0x5abce7,_0x5a0e98){_0x5abce7=_0x5abce7-0x157;const _0x51030d=a128_0x5103();let _0x145e34=_0x51030d[_0x5abce7];return _0x145e34;}async function cleanupEmptyDirectories(_0xbb2518,_0x436909){const _0x247c1a=a128_0x1ba9e3;let _0x172908=resolve(_0xbb2518);const _0x38e9fc=resolve(_0x436909);while(_0x172908[_0x247c1a(0x16a)](''+_0x38e9fc+sep)||_0x172908===_0x38e9fc){if(_0x172908===_0x38e9fc)return;try{const _0x58f65a=await readdir(_0x172908);if(_0x58f65a[_0x247c1a(0x165)]>0x0)return;await rmdir(_0x172908);}catch{return;}_0x172908=dirname(_0x172908);}}async function resolveTargetDbBinding(_0x311888,_0x3a9049,_0x726201){const _0xcdb69b=a128_0x1ba9e3,_0x196dca=_0x3a9049[_0xcdb69b(0x196)];if(!_0x196dca)return{'dbId':_0x726201['dbId'],'dbName':_0x726201[_0xcdb69b(0x174)]};const _0x424ef1=buildDbDirectoryName(_0x726201['dbName'],_0x726201['dbId']);if(_0x196dca===_0x424ef1)return{'dbId':_0x726201[_0xcdb69b(0x177)],'dbName':_0x726201['dbName']};const _0x1ca608=parseExplicitDbDirectory(_0x196dca);if(_0x1ca608!=null)return{'dbId':_0x1ca608,'dbName':await getDbName(_0x311888,_0x1ca608)[_0xcdb69b(0x190)](()=>undefined)};const _0xedc438=await listDatabases(_0x311888),_0x48fcc2=_0xedc438[_0xcdb69b(0x192)](_0x49d493=>buildDbDirectoryName(_0x49d493[_0xcdb69b(0x174)],_0x49d493[_0xcdb69b(0x177)])===_0x196dca);if(_0x48fcc2[_0xcdb69b(0x165)]===0x1)return{'dbId':_0x48fcc2[0x0][_0xcdb69b(0x177)],'dbName':_0x48fcc2[0x0][_0xcdb69b(0x174)]};if(_0x48fcc2[_0xcdb69b(0x165)]===0x0)throw CliErrors[_0xcdb69b(0x17f)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x196dca+_0xcdb69b(0x187)+_0x3a9049['sqlCode']+'.');const _0x9bd4b6=_0x48fcc2[_0xcdb69b(0x195)](_0x1118df=>_0x1118df[_0xcdb69b(0x174)]+'\x20('+_0x1118df[_0xcdb69b(0x177)]+')')[_0xcdb69b(0x16c)](',\x20');throw CliErrors[_0xcdb69b(0x17f)]('Local\x20directory\x20\x22'+_0x196dca+_0xcdb69b(0x15a)+_0x3a9049[_0xcdb69b(0x18c)]+':\x20'+_0x9bd4b6);}function parseExplicitDbDirectory(_0x3b029c){const _0x1939f9=a128_0x1ba9e3,_0x4aa22f=/^db-(\d+)$/[_0x1939f9(0x15f)](_0x3b029c);if(!_0x4aa22f)return null;const _0x1acb1a=Number(_0x4aa22f[0x1]);return Number['isFinite'](_0x1acb1a)&&_0x1acb1a>0x0?_0x1acb1a:null;}
|
|
1
|
+
const a128_0x4c1091=a128_0x41bd;(function(_0x2ef8da,_0xf68c20){const _0x5919c5=a128_0x41bd,_0x5932c1=_0x2ef8da();while(!![]){try{const _0x11f70c=parseInt(_0x5919c5(0xbd))/0x1*(parseInt(_0x5919c5(0xa9))/0x2)+-parseInt(_0x5919c5(0x90))/0x3*(parseInt(_0x5919c5(0xae))/0x4)+-parseInt(_0x5919c5(0x91))/0x5*(-parseInt(_0x5919c5(0x80))/0x6)+-parseInt(_0x5919c5(0xaf))/0x7*(parseInt(_0x5919c5(0x84))/0x8)+parseInt(_0x5919c5(0x86))/0x9+-parseInt(_0x5919c5(0xa3))/0xa*(parseInt(_0x5919c5(0xa5))/0xb)+-parseInt(_0x5919c5(0x9a))/0xc;if(_0x11f70c===_0xf68c20)break;else _0x5932c1['push'](_0x5932c1['shift']());}catch(_0x2fe085){_0x5932c1['push'](_0x5932c1['shift']());}}}(a128_0x19f3,0xf3b43));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 a128_0x41bd(_0x4268db,_0x1f2906){_0x4268db=_0x4268db-0x7e;const _0x19f355=a128_0x19f3();let _0x41bd3a=_0x19f355[_0x4268db];return _0x41bd3a;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x40475e,_0x356ddc,_0x1ae532){const _0x12257a=a128_0x41bd,_0x248dba=await scanLocalSqlQueries(_0x40475e),_0x30355a=new Map();for(const _0x2d490c of _0x248dba){if(_0x1ae532&&_0x2d490c['sqlCode']!==_0x1ae532)continue;const _0x1cd10b=_0x30355a[_0x12257a(0x95)](_0x2d490c[_0x12257a(0xa7)])??[];_0x1cd10b[_0x12257a(0xbe)](_0x2d490c),_0x30355a[_0x12257a(0x8a)](_0x2d490c[_0x12257a(0xa7)],_0x1cd10b);}if(_0x1ae532&&!_0x30355a['has'](_0x1ae532))throw CliErrors[_0x12257a(0x93)](_0x12257a(0xa0)+_0x1ae532);const _0x1de9b8=[];for(const [_0x11f4e5,_0x473681]of _0x30355a[_0x12257a(0x88)]()){if(_0x473681[_0x12257a(0x9c)]===0x1){_0x1de9b8[_0x12257a(0xbe)](_0x473681[0x0]);continue;}const _0x333cd6=_0x356ddc[_0x12257a(0xa6)][_0x11f4e5],_0x1a3718=_0x333cd6?.[_0x12257a(0x96)],_0x27c8a7=_0x1a3718?_0x473681[_0x12257a(0xa2)](_0x5bb51e=>_0x5bb51e[_0x12257a(0x92)]!==_0x1a3718):_0x473681;if(_0x333cd6&&_0x27c8a7['length']===0x1){_0x1de9b8[_0x12257a(0xbe)](_0x27c8a7[0x0]);continue;}throw CliErrors[_0x12257a(0x93)](_0x12257a(0xad)+_0x11f4e5+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x1de9b8;}export const sqlPush={'service':'sql','command':a128_0x4c1091(0xbe),'description':a128_0x4c1091(0xba),'risk':'high-risk-write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0x4c1091(0x9e),'type':a128_0x4c1091(0xac),'description':a128_0x4c1091(0x82)}],async 'dryRun'(_0x1f774f){const _0x447947=a128_0x4c1091,_0x1a36ca=loadSqlProjectConfig(_0x1f774f[_0x447947(0x94)]),_0x156337=await readSqlLockFile(_0x1a36ca[_0x447947(0xb0)]),{appLock:_0x4d4a84}=ensureSqlLockScope(_0x156337??createEmptySqlLock(),_0x1f774f[_0x447947(0x94)],_0x1a36ca[_0x447947(0x8b)],'push'),_0x23a835=await getTargetSqlQueries(_0x1a36ca,_0x4d4a84,_0x1f774f['str'](_0x447947(0x85))||undefined),_0x17a591=[];for(const _0x4ee276 of _0x23a835){const _0x1e85f6=await computeSqlFileHash(_0x4ee276[_0x447947(0x97)]),_0x27e6e3=_0x4d4a84[_0x447947(0xa6)][_0x4ee276[_0x447947(0xa7)]],_0x5b37c3=!!_0x27e6e3&&(_0x27e6e3[_0x447947(0x96)]!==_0x4ee276[_0x447947(0x92)]||!!_0x4ee276['sqlName']&&_0x27e6e3['sqlName']!==_0x4ee276[_0x447947(0xbf)]);if(!_0x1f774f['bool']('force')&&_0x27e6e3&&_0x27e6e3[_0x447947(0xaa)]===_0x1e85f6&&!_0x5b37c3)continue;_0x17a591['push'](_0x4ee276[_0x447947(0xa7)]);}return{'method':_0x447947(0x9f),'url':_0x447947(0xb3),'body':{'sqlCodes':_0x17a591,'appCode':_0x1f774f[_0x447947(0x94)]},'description':_0x447947(0x8f)+_0x17a591[_0x447947(0x9c)]+_0x447947(0x87)};},async 'execute'(_0x1e26f1){const _0x5ba83e=a128_0x4c1091,_0x383d61=loadSqlProjectConfig(_0x1e26f1['appCode']),_0x246162=await readSqlLockFile(_0x383d61['lockFilePath']),{lockData:_0x482409,appLock:_0x52f659}=ensureSqlLockScope(_0x246162??createEmptySqlLock(),_0x1e26f1['appCode'],_0x383d61['sqlRoot'],'push'),_0x5cfea2=await getTargetSqlQueries(_0x383d61,_0x52f659,_0x1e26f1[_0x5ba83e(0x9b)](_0x5ba83e(0x85))||undefined);if(_0x5cfea2[_0x5ba83e(0x9c)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x5ba83e(0x8e)};const _0x3c7c64=[],_0x380bbb=[],_0x19ca07=[];for(const _0x4a6ad2 of _0x5cfea2){const _0x1802b0=_0x52f659[_0x5ba83e(0xa6)][_0x4a6ad2[_0x5ba83e(0xa7)]];if(!_0x1802b0){_0x19ca07[_0x5ba83e(0xbe)]({'sqlCode':_0x4a6ad2[_0x5ba83e(0xa7)],'error':_0x5ba83e(0x98)});continue;}try{const _0xab269e=await computeSqlFileHash(_0x4a6ad2[_0x5ba83e(0x97)]),_0x1b329a=_0x1802b0['path']!==_0x4a6ad2['relativePath']||!!_0x4a6ad2[_0x5ba83e(0xbf)]&&_0x1802b0[_0x5ba83e(0xbf)]!==_0x4a6ad2[_0x5ba83e(0xbf)];if(!_0x1e26f1[_0x5ba83e(0x7e)]('force')&&_0x1802b0[_0x5ba83e(0xaa)]===_0xab269e&&!_0x1b329a){_0x380bbb['push']({'sqlCode':_0x4a6ad2[_0x5ba83e(0xa7)],'reason':_0x5ba83e(0xb8)});continue;}if(_0x1802b0[_0x5ba83e(0xa4)]==null){_0x19ca07[_0x5ba83e(0xbe)]({'sqlCode':_0x4a6ad2[_0x5ba83e(0xa7)],'error':_0x5ba83e(0xbc)});continue;}const _0x1a1fde=await readFile(_0x4a6ad2[_0x5ba83e(0x97)],_0x5ba83e(0xb4)),_0x2e30ea=stripLocalSqlMetadata(_0x1a1fde,_0x4a6ad2['mode']),_0x360578=_0x4a6ad2['sqlName']||_0x1802b0[_0x5ba83e(0xbf)],_0x41bc79=await resolveTargetDbBinding(_0x1e26f1[_0x5ba83e(0x94)],_0x4a6ad2,_0x1802b0),_0x500d77=await updateSqlQuery({'id':_0x1802b0['remoteId'],'appCode':_0x1e26f1[_0x5ba83e(0x94)],'sqlCode':_0x4a6ad2[_0x5ba83e(0xa7)],'sqlName':_0x360578,'dbId':_0x41bc79['dbId'],'version':_0x1802b0[_0x5ba83e(0xa4)],'sqlContent':_0x2e30ea,'sqlConfig':_0x1802b0['sqlConfig']??undefined}),_0x531180=_0x500d77[_0x5ba83e(0xab)]?await getDbName(_0x1e26f1[_0x5ba83e(0x94)],Number(_0x500d77[_0x5ba83e(0xab)]))[_0x5ba83e(0xb1)](()=>_0x41bc79[_0x5ba83e(0x8c)]):_0x41bc79[_0x5ba83e(0x8c)];_0x52f659['sqls'][_0x4a6ad2[_0x5ba83e(0xa7)]]={...buildSqlLockEntry(_0x500d77,_0x2e30ea,_0xab269e,{'dbName':_0x531180}),'path':_0x4a6ad2[_0x5ba83e(0x92)],'mode':_0x1802b0['mode']},await archivePreviousSqlFileIfNeeded(_0x383d61,_0x1802b0[_0x5ba83e(0x96)],_0x4a6ad2[_0x5ba83e(0x92)]),_0x3c7c64[_0x5ba83e(0xbe)]({'sqlCode':_0x4a6ad2[_0x5ba83e(0xa7)],'remoteId':_0x1802b0['remoteId']});}catch(_0x2bed37){_0x19ca07['push']({'sqlCode':_0x4a6ad2['sqlCode'],'error':_0x2bed37 instanceof Error?_0x2bed37['message']:String(_0x2bed37)});}}return _0x52f659[_0x5ba83e(0x81)]=new Date()[_0x5ba83e(0x89)](),await writeSqlLockFile(_0x383d61[_0x5ba83e(0xb0)],_0x482409),{'ok':_0x19ca07[_0x5ba83e(0x9c)]===0x0,'data':{'pushed':_0x3c7c64,'skipped':_0x380bbb,'failed':_0x19ca07},'message':'Push\x20complete:\x20'+_0x3c7c64[_0x5ba83e(0x9c)]+_0x5ba83e(0x7f)+_0x380bbb[_0x5ba83e(0x9c)]+_0x5ba83e(0x9d)+_0x19ca07[_0x5ba83e(0x9c)]+_0x5ba83e(0xb6)};}};async function archivePreviousSqlFileIfNeeded(_0x23e9c2,_0x1daef6,_0x2750c2){const _0x32c450=a128_0x4c1091;if(!_0x1daef6||_0x1daef6===_0x2750c2)return;const _0x166b60=join(_0x23e9c2[_0x32c450(0xbb)],_0x1daef6);if(!await fileExists(_0x166b60))return;const _0x3354a6=await moveToTrash(_0x23e9c2[_0x32c450(0xb2)],_0x23e9c2[_0x32c450(0xb5)],_0x166b60);await cleanupEmptyDirectories(dirname(_0x166b60),_0x23e9c2[_0x32c450(0xbb)]),void _0x3354a6;}async function moveToTrash(_0xf5877c,_0x39ef81,_0x5a8116){const _0x419acc=a128_0x4c1091,_0x23502c=new Date()[_0x419acc(0x89)]()[_0x419acc(0x83)](/[:.]/g,'-'),_0x4d99a5=relative(_0xf5877c,_0x5a8116),_0x31d7c8=join(_0x39ef81,_0x23502c,_0x4d99a5);return await mkdir(dirname(_0x31d7c8),{'recursive':!![]}),await rename(_0x5a8116,_0x31d7c8),_0x31d7c8;}function a128_0x19f3(){const _0x310026=['join','unchanged','startsWith','Push\x20local\x20SQL\x20files\x20to\x20remote','sqlRootDir','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','792763oaUNzX','push','sqlName','bool','\x20pushed,\x20','9765114ReOjLV','lastSync','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','replace','10352cfVkfS','sqlcode','3464874xNupPi','\x20SQL\x20file(s)','entries','toISOString','set','sqlRoot','dbName','map','No\x20local\x20SQL\x20files\x20found.','Would\x20push\x20','181623zWohhN','5hLVhqs','relativePath','validation','appCode','get','path','filePath','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','\x22\x20for\x20sqlCode\x20','196536KGrCxc','str','length','\x20skipped,\x20','force','POST','Local\x20SQL\x20not\x20found:\x20','Local\x20directory\x20\x22','filter','262970FhFFJB','version','616hLezoq','sqls','sqlCode','isFinite','2qpLGJV','hash','dbId','boolean','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','4HIBWgm','1393uNuABt','lockFilePath','catch','projectRoot','/smartapi/custom/updateUserCustomSql','utf8','trashDir','\x20failed'];a128_0x19f3=function(){return _0x310026;};return a128_0x19f3();}async function cleanupEmptyDirectories(_0x307e80,_0x3a57cd){const _0x8f56b0=a128_0x4c1091;let _0x3f6611=resolve(_0x307e80);const _0x10c6c5=resolve(_0x3a57cd);while(_0x3f6611[_0x8f56b0(0xb9)](''+_0x10c6c5+sep)||_0x3f6611===_0x10c6c5){if(_0x3f6611===_0x10c6c5)return;try{const _0x2b5dca=await readdir(_0x3f6611);if(_0x2b5dca['length']>0x0)return;await rmdir(_0x3f6611);}catch{return;}_0x3f6611=dirname(_0x3f6611);}}async function resolveTargetDbBinding(_0x42307c,_0x3d0312,_0x324375){const _0x5a9d3d=a128_0x4c1091,_0x45339a=_0x3d0312['dbDirectory'];if(!_0x45339a)return{'dbId':_0x324375[_0x5a9d3d(0xab)],'dbName':_0x324375[_0x5a9d3d(0x8c)]};const _0x590ffd=buildDbDirectoryName(_0x324375[_0x5a9d3d(0x8c)],_0x324375[_0x5a9d3d(0xab)]);if(_0x45339a===_0x590ffd)return{'dbId':_0x324375[_0x5a9d3d(0xab)],'dbName':_0x324375[_0x5a9d3d(0x8c)]};const _0xc9cbba=parseExplicitDbDirectory(_0x45339a);if(_0xc9cbba!=null)return{'dbId':_0xc9cbba,'dbName':await getDbName(_0x42307c,_0xc9cbba)[_0x5a9d3d(0xb1)](()=>undefined)};const _0x5adf05=await listDatabases(_0x42307c),_0x8eb7ec=_0x5adf05['filter'](_0x40cb8d=>buildDbDirectoryName(_0x40cb8d[_0x5a9d3d(0x8c)],_0x40cb8d[_0x5a9d3d(0xab)])===_0x45339a);if(_0x8eb7ec[_0x5a9d3d(0x9c)]===0x1)return{'dbId':_0x8eb7ec[0x0][_0x5a9d3d(0xab)],'dbName':_0x8eb7ec[0x0][_0x5a9d3d(0x8c)]};if(_0x8eb7ec[_0x5a9d3d(0x9c)]===0x0)throw CliErrors[_0x5a9d3d(0x93)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x45339a+_0x5a9d3d(0x99)+_0x3d0312[_0x5a9d3d(0xa7)]+'.');const _0x512980=_0x8eb7ec[_0x5a9d3d(0x8d)](_0x21b5b8=>_0x21b5b8[_0x5a9d3d(0x8c)]+'\x20('+_0x21b5b8[_0x5a9d3d(0xab)]+')')[_0x5a9d3d(0xb7)](',\x20');throw CliErrors[_0x5a9d3d(0x93)](_0x5a9d3d(0xa1)+_0x45339a+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x3d0312['sqlCode']+':\x20'+_0x512980);}function parseExplicitDbDirectory(_0xf00b02){const _0x12b3ec=a128_0x4c1091,_0x5933ca=/^db-(\d+)$/['exec'](_0xf00b02);if(!_0x5933ca)return null;const _0x5135e2=Number(_0x5933ca[0x1]);return Number[_0x12b3ec(0xa8)](_0x5135e2)&&_0x5135e2>0x0?_0x5135e2:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a129_0x570a58=a129_0x2635;(function(_0x5445f5,_0xd8d55a){const _0x56a097=a129_0x2635,_0x59ace4=_0x5445f5();while(!![]){try{const _0x11d7a7=parseInt(_0x56a097(0x126))/0x1+-parseInt(_0x56a097(0x129))/0x2+parseInt(_0x56a097(0x120))/0x3+parseInt(_0x56a097(0x131))/0x4+-parseInt(_0x56a097(0x125))/0x5+parseInt(_0x56a097(0x121))/0x6*(parseInt(_0x56a097(0x132))/0x7)+-parseInt(_0x56a097(0x122))/0x8;if(_0x11d7a7===_0xd8d55a)break;else _0x59ace4['push'](_0x59ace4['shift']());}catch(_0x38fd4f){_0x59ace4['push'](_0x59ace4['shift']());}}}(a129_0x4ccb,0xd47c9));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a129_0x570a58(0x12c),a129_0x570a58(0x124),a129_0x570a58(0x12b)]['join']('\x0a');function a129_0x2635(_0x129b1d,_0x1100e5){_0x129b1d=_0x129b1d-0x11e;const _0x4ccbfd=a129_0x4ccb();let _0x263501=_0x4ccbfd[_0x129b1d];return _0x263501;}function a129_0x4ccb(){const _0x173ae6=['SQL\x20query\x20display\x20name','2536366XBgeHh','sqlname','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`.','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','Query\x20description','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','sql','2819304JyBEzA','7RvvhyK','string','Path\x20to\x20the\x20SQL\x20file','save','4238718iSVLhy','5892006pmqDYt','12107312srnnqg','description','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','4019005VHQcUS','1356010JvvwYs','write'];a129_0x4ccb=function(){return _0x173ae6;};return a129_0x4ccb();}export const sqlSave={'service':a129_0x570a58(0x130),'command':a129_0x570a58(0x11f),'description':a129_0x570a58(0x12f),'risk':a129_0x570a58(0x127),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'file','type':a129_0x570a58(0x133),'required':!![],'description':a129_0x570a58(0x11e)},SQLCODE_FLAG_OPTIONAL,{'name':a129_0x570a58(0x12a),'type':a129_0x570a58(0x133),'description':a129_0x570a58(0x128)},{'name':'db','type':a129_0x570a58(0x133),'description':a129_0x570a58(0x12e)},{'name':a129_0x570a58(0x123),'type':a129_0x570a58(0x133),'description':a129_0x570a58(0x12d)}],async 'validate'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a130_0x44e0cf=a130_0x5b7b;function a130_0x5b7b(_0x2b3e5a,_0x27fdfd){_0x2b3e5a=_0x2b3e5a-0x105;const _0x41fd60=a130_0x41fd();let _0x5b7b7d=_0x41fd60[_0x2b3e5a];return _0x5b7b7d;}(function(_0x44ab42,_0x58a255){const _0x3d6d9c=a130_0x5b7b,_0x178d31=_0x44ab42();while(!![]){try{const _0x42b474=parseInt(_0x3d6d9c(0x120))/0x1+-parseInt(_0x3d6d9c(0x119))/0x2*(parseInt(_0x3d6d9c(0x12a))/0x3)+parseInt(_0x3d6d9c(0x10b))/0x4*(-parseInt(_0x3d6d9c(0x105))/0x5)+parseInt(_0x3d6d9c(0x12e))/0x6*(parseInt(_0x3d6d9c(0x116))/0x7)+parseInt(_0x3d6d9c(0x109))/0x8+-parseInt(_0x3d6d9c(0x113))/0x9+parseInt(_0x3d6d9c(0x118))/0xa*(parseInt(_0x3d6d9c(0x127))/0xb);if(_0x42b474===_0x58a255)break;else _0x178d31['push'](_0x178d31['shift']());}catch(_0x24453d){_0x178d31['push'](_0x178d31['shift']());}}}(a130_0x41fd,0xbe5f1));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=a130_0x44e0cf(0x11d);export function buildSqlLockEntry(_0xf63823,_0x11ba27,_0x1a14c8,_0xa876f8){const _0x2e7962=a130_0x44e0cf,_0x525d84=detectSqlMode(_0x11ba27);return{'path':buildSqlRelativePath(_0xf63823[_0x2e7962(0x10c)],_0xf63823[_0x2e7962(0x129)],_0xa876f8?.[_0x2e7962(0x10a)],_0x525d84,_0xf63823[_0x2e7962(0x117)]),'hash':_0x1a14c8,'remoteId':_0xf63823['id'],'version':_0xf63823['version'],'dbId':Number(_0xf63823[_0x2e7962(0x117)]),'dbName':_0xa876f8?.[_0x2e7962(0x10a)],'sqlName':_0xf63823[_0x2e7962(0x129)],'sqlConfig':_0xf63823[_0x2e7962(0x12d)]??undefined,'mode':_0x525d84};}function a130_0x41fd(){const _0x37f978=['sqlConfig','12708NqYylr','path','stdin','close','trimStart','test','toLowerCase','77045ibCurj','yes','sqlContent','replace','11253352sATHui','dbName','272mDDboV','sqlCode','entries','lastSync','question','trim','push','mode','4046346Diywea','map','description','3871lBoGkG','dbId','20QbgKBn','173732ypsgjv','fromEntries','--\x20@lovrabet.','\x20-->','.rabetbase/sql','sqlRoot','join','31774rPNNFi','\x20[y/N]\x20','mybatisXml','stderr','syncedAt','apps','length','4382004JeucIp','includes','sqlName','39AuWxRd','sqls','split'];a130_0x41fd=function(){return _0x37f978;};return a130_0x41fd();}export function cloneSqlLockData(_0x18b6f3){const _0x4b9d98=a130_0x44e0cf;return{'apps':Object[_0x4b9d98(0x11a)](Object[_0x4b9d98(0x10d)](_0x18b6f3[_0x4b9d98(0x125)])[_0x4b9d98(0x114)](([_0x20e1d9,_0x6f7629])=>[_0x20e1d9,{'sqlRoot':_0x6f7629[_0x4b9d98(0x11e)],'lastSync':_0x6f7629[_0x4b9d98(0x10e)],'sqls':{..._0x6f7629[_0x4b9d98(0x12b)]}}]))};}export function ensureRemoteSqlContent(_0x441127){const _0x2cee4c=a130_0x44e0cf;return _0x441127[_0x2cee4c(0x107)]??'';}export function buildLocalSqlFileContent(_0x85dede,_0x2bc45b,_0x65300d){const _0x327ad=a130_0x44e0cf,_0x1d800d=_0x65300d?.['mode']??detectSqlMode(_0x2bc45b),_0x50f5be=stripLocalSqlMetadata(_0x2bc45b,_0x1d800d)[_0x327ad(0x110)](),_0x250313=[...buildMetadataHeaderLines({'sqlCode':_0x85dede[_0x327ad(0x10c)],'sqlName':_0x85dede['sqlName'],'dbId':_0x85dede['dbId'],'dbName':_0x65300d?.[_0x327ad(0x10a)],'mode':_0x1d800d,'syncedAt':_0x65300d?.[_0x327ad(0x124)],'description':_0x65300d?.[_0x327ad(0x115)]},_0x1d800d),'',_0x50f5be],_0x22dfb6=_0x250313[_0x327ad(0x11f)]('\x0a');return _0x22dfb6['endsWith']('\x0a')?_0x22dfb6:_0x22dfb6+'\x0a';}export function stripLocalSqlMetadata(_0x576358,_0x1df689){const _0x3d2601=a130_0x44e0cf,_0x3f8fb6=_0x576358[_0x3d2601(0x108)](/\r\n/g,'\x0a')[_0x3d2601(0x12c)]('\x0a'),_0x1b176e=[];let _0x289be5=0x0;if(_0x1df689===_0x3d2601(0x122))while(_0x289be5<_0x3f8fb6[_0x3d2601(0x126)]){const _0x298864=_0x3f8fb6[_0x289be5]??'';if(/^\s*<!--\s*@lovrabet\./[_0x3d2601(0x133)](_0x298864)){_0x289be5++;continue;}if(_0x298864['trim']()===''&&_0x289be5>0x0){_0x289be5++;continue;}break;}else while(_0x289be5<_0x3f8fb6[_0x3d2601(0x126)]){const _0x43ad00=_0x3f8fb6[_0x289be5]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x43ad00)){_0x289be5++;continue;}if(_0x43ad00[_0x3d2601(0x110)]()===''&&_0x289be5>0x0){_0x289be5++;continue;}break;}for(;_0x289be5<_0x3f8fb6[_0x3d2601(0x126)];_0x289be5++){_0x1b176e[_0x3d2601(0x111)](_0x3f8fb6[_0x289be5]);}return _0x1b176e[_0x3d2601(0x11f)]('\x0a')[_0x3d2601(0x132)]();}export function resolveSqlMode(_0x289238,_0x100884){const _0x1a756a=a130_0x44e0cf;if(_0x100884?.[_0x1a756a(0x112)])return _0x100884['mode'];return detectSqlMode(_0x289238);}export function resolveSqlFileName(_0x1ed50c,_0x1d75f8,_0x374a40){const _0x49e291=a130_0x44e0cf;if(_0x374a40?.[_0x49e291(0x12f)])return _0x374a40[_0x49e291(0x12f)];if(_0x374a40?.[_0x49e291(0x129)]||_0x374a40?.[_0x49e291(0x10a)])return buildSqlRelativePath(_0x1ed50c,_0x374a40?.[_0x49e291(0x129)],_0x374a40?.[_0x49e291(0x10a)],resolveSqlMode(_0x1d75f8,_0x374a40),_0x374a40?.['dbId']);return buildDefaultSqlFileName(_0x1ed50c,resolveSqlMode(_0x1d75f8,_0x374a40));}export function resolveSqlLocalDir(_0x932ebd,_0x3f25f3){return join(_0x932ebd,SQL_LOCAL_REL_DIR,_0x3f25f3);}export async function confirmForceOverwrite(_0x3851f7){const _0x990972=a130_0x44e0cf,_0x500631=createInterface({'input':process[_0x990972(0x130)],'output':process[_0x990972(0x123)]}),_0x3aa1db=await new Promise(_0x532182=>{const _0x1753ba=_0x990972;_0x500631[_0x1753ba(0x10f)](_0x3851f7+_0x1753ba(0x121),_0x532182);});return _0x500631[_0x990972(0x131)](),['y',_0x990972(0x106)][_0x990972(0x128)](_0x3aa1db[_0x990972(0x110)]()[_0x990972(0x134)]());}export function findSqlLockScope(_0x565b75,_0x37a382){return _0x565b75['apps'][_0x37a382];}function buildMetadataHeaderLines(_0x4a548d,_0x23fcf4){const _0x10882a=a130_0x44e0cf,_0x5c9350=[[_0x10882a(0x10c),_0x4a548d[_0x10882a(0x10c)]],[_0x10882a(0x129),_0x4a548d[_0x10882a(0x129)]],['dbId',_0x4a548d[_0x10882a(0x117)]],['dbName',_0x4a548d[_0x10882a(0x10a)]],[_0x10882a(0x112),_0x4a548d[_0x10882a(0x112)]],['syncedAt',_0x4a548d[_0x10882a(0x124)]],[_0x10882a(0x115),_0x4a548d[_0x10882a(0x115)]]];if(_0x23fcf4===_0x10882a(0x122))return _0x5c9350['filter'](([,_0x1fd514])=>_0x1fd514!==undefined&&_0x1fd514!==null&&String(_0x1fd514)['trim']()!=='')[_0x10882a(0x114)](([_0x1298f4,_0x590c27])=>'<!--\x20@lovrabet.'+_0x1298f4+':\x20'+String(_0x590c27)+_0x10882a(0x11c));return _0x5c9350['filter'](([,_0x47b695])=>_0x47b695!==undefined&&_0x47b695!==null&&String(_0x47b695)[_0x10882a(0x110)]()!=='')[_0x10882a(0x114)](([_0x457d61,_0x2cfb76])=>_0x10882a(0x11b)+_0x457d61+':\x20'+String(_0x2cfb76));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a131_0x35c0(_0x4986aa,_0xdd254a){_0x4986aa=_0x4986aa-0x15f;const _0x208ed7=a131_0x208e();let _0x35c042=_0x208ed7[_0x4986aa];return _0x35c042;}const a131_0x604dab=a131_0x35c0;(function(_0x4a8722,_0x3c4445){const _0xe3821d=a131_0x35c0,_0x58ccfa=_0x4a8722();while(!![]){try{const _0x474a6e=-parseInt(_0xe3821d(0x183))/0x1+-parseInt(_0xe3821d(0x16e))/0x2+-parseInt(_0xe3821d(0x174))/0x3*(parseInt(_0xe3821d(0x169))/0x4)+parseInt(_0xe3821d(0x161))/0x5+-parseInt(_0xe3821d(0x17c))/0x6*(parseInt(_0xe3821d(0x17a))/0x7)+parseInt(_0xe3821d(0x16d))/0x8*(parseInt(_0xe3821d(0x17f))/0x9)+parseInt(_0xe3821d(0x16c))/0xa;if(_0x474a6e===_0x3c4445)break;else _0x58ccfa['push'](_0x58ccfa['shift']());}catch(_0x196929){_0x58ccfa['push'](_0x58ccfa['shift']());}}}(a131_0x208e,0x42929));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x2e77c6){const _0xf48e56=a131_0x35c0,_0x1fb95f=[];let _0x31c038=0x1;while(!![]){const _0x469f86=await listSqlQueries(_0x2e77c6,{'currentPage':_0x31c038,'pageSize':PAGE_SIZE}),_0x3058aa=_0x469f86[_0xf48e56(0x184)]??[];_0x1fb95f[_0xf48e56(0x180)](..._0x3058aa[_0xf48e56(0x15f)](_0x131351=>_0x131351[_0xf48e56(0x17d)]));if(_0x3058aa[_0xf48e56(0x16a)]===0x0)break;const _0x2dc552=_0x469f86['paging']?.[_0xf48e56(0x170)];if(_0x2dc552!=null?_0x1fb95f['length']>=_0x2dc552:_0x3058aa[_0xf48e56(0x16a)]<PAGE_SIZE)break;_0x31c038++;}return _0x1fb95f;}export const sqlStatus={'service':'sql','command':a131_0x604dab(0x175),'description':a131_0x604dab(0x17e),'risk':a131_0x604dab(0x177),'flags':[{'name':a131_0x604dab(0x17b),'type':a131_0x604dab(0x181),'description':a131_0x604dab(0x165)}],async 'execute'(_0x226f4d){const _0x4f874d=a131_0x604dab,_0x2b45cc=loadSqlProjectConfig(_0x226f4d[_0x4f874d(0x182)]),_0x53e594=await readSqlLockFile(_0x2b45cc[_0x4f874d(0x168)]),{appLock:_0x55968b}=ensureSqlLockScope(_0x53e594??createEmptySqlLock(),_0x2b45cc[_0x4f874d(0x182)],_0x2b45cc[_0x4f874d(0x179)],'status'),_0x22d9f7=await scanLocalSqlQueries(_0x2b45cc),_0x3b3c24=[],_0x282962=[],_0x33188e=[],_0x183167=[],_0x1fb6c9=new Set(_0x22d9f7[_0x4f874d(0x15f)](_0x44e7dd=>_0x44e7dd[_0x4f874d(0x16b)]));for(const _0x36bd73 of _0x22d9f7){const _0x8a8993=await computeSqlFileHash(_0x36bd73[_0x4f874d(0x171)]),_0x5ae2d4=_0x55968b[_0x4f874d(0x162)][_0x36bd73[_0x4f874d(0x16b)]],_0x4a7031=!!_0x5ae2d4&&_0x5ae2d4[_0x4f874d(0x167)]!==_0x36bd73[_0x4f874d(0x164)],_0x3caaf4=!!_0x5ae2d4&&!!_0x36bd73[_0x4f874d(0x176)]&&_0x5ae2d4[_0x4f874d(0x176)]!==_0x36bd73['sqlName'];if(!_0x5ae2d4)_0x3b3c24[_0x4f874d(0x180)](_0x36bd73['lockKey']);else _0x5ae2d4[_0x4f874d(0x172)]!==_0x8a8993||_0x4a7031||_0x3caaf4?_0x282962[_0x4f874d(0x180)](_0x36bd73['lockKey']):_0x33188e['push'](_0x36bd73[_0x4f874d(0x16b)]);}for(const _0x5e40a9 of Object[_0x4f874d(0x163)](_0x55968b[_0x4f874d(0x162)])){!_0x1fb6c9[_0x4f874d(0x166)](_0x5e40a9)&&_0x183167[_0x4f874d(0x180)](_0x5e40a9);}const _0x5e62d5=[];if(_0x226f4d[_0x4f874d(0x16f)]('remote')){const _0x156989=await fetchAllSqlCodes(_0x226f4d[_0x4f874d(0x182)]);for(const _0x5c22b8 of _0x156989){!_0x1fb6c9[_0x4f874d(0x166)](_0x5c22b8)&&!_0x55968b[_0x4f874d(0x162)][_0x5c22b8]&&_0x5e62d5[_0x4f874d(0x180)](_0x5c22b8);}}const _0x39a897=_0x3b3c24[_0x4f874d(0x16a)]===0x0&&_0x282962[_0x4f874d(0x16a)]===0x0&&_0x183167[_0x4f874d(0x16a)]===0x0&&_0x5e62d5['length']===0x0;return{'ok':!![],'data':{'added':_0x3b3c24,'modified':_0x282962,'missing':_0x183167,'unchanged':_0x33188e,'remoteOnly':_0x5e62d5},'message':_0x39a897?_0x4f874d(0x178):_0x3b3c24[_0x4f874d(0x16a)]+_0x4f874d(0x160)+_0x282962[_0x4f874d(0x16a)]+_0x4f874d(0x173)+_0x183167[_0x4f874d(0x16a)]+'\x20missing,\x20'+_0x33188e['length']+'\x20unchanged'+(_0x5e62d5[_0x4f874d(0x16a)]>0x0?',\x20'+_0x5e62d5['length']+'\x20remote-only':'')};}};function a131_0x208e(){const _0x361746=['\x20modified,\x20','225FPYLFv','status','sqlName','read','All\x20SQL\x20queries\x20are\x20in\x20sync.','sqlRoot','2008489iostjA','remote','6bnjHQT','sqlCode','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','502974RmiTvl','push','boolean','appCode','51946erjVIR','tableData','map','\x20added,\x20','1263865jDbEss','sqls','keys','relativePath','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','has','path','lockFilePath','708UnwDdw','length','lockKey','6187290lbWOLt','24UJgJDT','828662JMzeeo','bool','totalCount','filePath','hash'];a131_0x208e=function(){return _0x361746;};return a131_0x208e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0x2b57ee=a132_0x5511;(function(_0x1a36f7,_0xe6018b){const _0x318800=a132_0x5511,_0x25bd19=_0x1a36f7();while(!![]){try{const _0x3f2754=-parseInt(_0x318800(0x127))/0x1*(-parseInt(_0x318800(0x12d))/0x2)+parseInt(_0x318800(0x113))/0x3*(parseInt(_0x318800(0x126))/0x4)+-parseInt(_0x318800(0x139))/0x5*(parseInt(_0x318800(0x125))/0x6)+parseInt(_0x318800(0x115))/0x7*(parseInt(_0x318800(0x110))/0x8)+-parseInt(_0x318800(0x11c))/0x9*(parseInt(_0x318800(0x114))/0xa)+-parseInt(_0x318800(0x112))/0xb*(parseInt(_0x318800(0x132))/0xc)+-parseInt(_0x318800(0x133))/0xd;if(_0x3f2754===_0xe6018b)break;else _0x25bd19['push'](_0x25bd19['shift']());}catch(_0x121dcc){_0x25bd19['push'](_0x25bd19['shift']());}}}(a132_0xddf4,0x5c32b));import{readFileSync,existsSync}from'node:fs';function a132_0x5511(_0x471eaf,_0x12df2f){_0x471eaf=_0x471eaf-0x10e;const _0xddf4a6=a132_0xddf4();let _0x5511a7=_0xddf4a6[_0x471eaf];return _0x5511a7;}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';function a132_0xddf4(){const _0x10a496=['isSelectOnly','5llfKvK','schemas','validate','string','isArray','get','message','792ZjjRqV','map','385737SJhbtI','3SqchCj','10IfMEsl','35826mIUqFr','file','SQL\x20schema\x20validation','length','type','schema:','str','1872441ZzlkYE','valid','sqlType','read','validation','name','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','Provide\x20--file\x20or\x20--sql','reason','1085304oMPNFR','1710404MOswYU','148639NZCbcq','tables','from','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','cwd','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','10UnXmBG','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','size','tableName','toLowerCase','72USLzBV','9106500VFsWBg','dbtableConfig','utf-8','sql','fields'];a132_0xddf4=function(){return _0x10a496;};return a132_0xddf4();}import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a132_0x2b57ee(0x136),'command':a132_0x2b57ee(0x13b),'description':a132_0x2b57ee(0x12c),'risk':a132_0x2b57ee(0x11f),'flags':[{'name':a132_0x2b57ee(0x116),'type':a132_0x2b57ee(0x13c),'description':a132_0x2b57ee(0x122)},{'name':a132_0x2b57ee(0x136),'type':a132_0x2b57ee(0x13c),'description':a132_0x2b57ee(0x12a)},{'name':a132_0x2b57ee(0x13a),'type':'string','description':a132_0x2b57ee(0x12e)}],async 'execute'(_0x45ab3b){const _0x36a660=a132_0x2b57ee,_0x26ada7=_0x45ab3b[_0x36a660(0x11b)](_0x36a660(0x116)),_0x28c06a=_0x45ab3b[_0x36a660(0x11b)](_0x36a660(0x136));if(!_0x26ada7&&!_0x28c06a)throw CliErrors['flagMissing']('file',_0x36a660(0x123));let _0xcbb0e9;if(_0x26ada7){const _0xbeb0c=resolve(process[_0x36a660(0x12b)](),_0x26ada7);if(!existsSync(_0xbeb0c))throw CliErrors[_0x36a660(0x120)]('File\x20not\x20found:\x20'+_0xbeb0c);_0xcbb0e9=readFileSync(_0xbeb0c,_0x36a660(0x135));}else _0xcbb0e9=_0x28c06a;const _0x1d8582=validateSql(_0xcbb0e9),_0x1da968={'valid':_0x1d8582['valid'],'sqlType':_0x1d8582[_0x36a660(0x11e)][_0x36a660(0x119)],'isSelectOnly':_0x1d8582['sqlType'][_0x36a660(0x138)],'isDangerous':_0x1d8582[_0x36a660(0x11e)]['isDangerous'],'tables':_0x1d8582[_0x36a660(0x128)],'parameters':_0x1d8582['parameters'],'message':_0x1d8582['message']};_0x1d8582[_0x36a660(0x11e)][_0x36a660(0x124)]&&(_0x1da968[_0x36a660(0x124)]=_0x1d8582['sqlType']['reason']);const _0x13674b=_0x45ab3b[_0x36a660(0x11b)](_0x36a660(0x13a));if(_0x13674b&&_0x1d8582[_0x36a660(0x11d)]){const _0x4ca182=_0x13674b['split'](',')[_0x36a660(0x111)](_0x184f0e=>_0x184f0e['trim']())['filter'](Boolean),_0x486b8f=[],_0x5f2923=filterDbTableBackedDatasets(await listDatasets(_0x45ab3b['appCode'])),_0xd58e2d=new Map(_0x5f2923['map'](_0x112e89=>[_0x112e89[_0x36a660(0x134)]?.[_0x36a660(0x130)]?.[_0x36a660(0x131)](),_0x112e89]));for(const _0x1586c8 of _0x1d8582['tables']){const _0x32bdc6=_0xd58e2d[_0x36a660(0x10e)](_0x1586c8[_0x36a660(0x131)]());!_0x32bdc6&&_0x486b8f['push']('Table\x20\x22'+_0x1586c8+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x14fc48 of _0x4ca182){let _0x224ca4;try{_0x224ca4=await getDatasetDetail(_0x14fc48);}catch{_0x486b8f['push']('Dataset\x20\x22'+_0x14fc48+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0x224ca4,_0x36a660(0x117));const _0x2a6b5d=Array[_0x36a660(0x13d)](_0x224ca4[_0x36a660(0x137)])?_0x224ca4[_0x36a660(0x137)]:[],_0x13c1a6=new Set(_0x2a6b5d[_0x36a660(0x111)](_0x57afba=>_0x57afba[_0x36a660(0x121)]?.['toLowerCase']())),_0x5f4fc9=_0x224ca4[_0x36a660(0x134)]?.[_0x36a660(0x130)]||_0x224ca4[_0x36a660(0x130)]||_0x14fc48;_0x1da968[_0x36a660(0x11a)+_0x5f4fc9]={'code':_0x14fc48,'tableName':_0x5f4fc9,'fieldCount':_0x13c1a6[_0x36a660(0x12f)],'fields':Array[_0x36a660(0x129)](_0x13c1a6)};}_0x486b8f[_0x36a660(0x118)]>0x0&&(_0x1da968['schemaWarnings']=_0x486b8f);}return{'ok':_0x1d8582['valid'],'data':_0x1da968,'message':_0x1d8582[_0x36a660(0x10f)]};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a133_0x3e7800=a133_0x2fe4;(function(_0x2cd8b5,_0x8c7fd3){const _0xc73057=a133_0x2fe4,_0x43d637=_0x2cd8b5();while(!![]){try{const _0x40068b=parseInt(_0xc73057(0xcd))/0x1+parseInt(_0xc73057(0xed))/0x2+-parseInt(_0xc73057(0xe7))/0x3+parseInt(_0xc73057(0xd6))/0x4*(parseInt(_0xc73057(0xd2))/0x5)+parseInt(_0xc73057(0xd3))/0x6*(-parseInt(_0xc73057(0xf2))/0x7)+parseInt(_0xc73057(0xe2))/0x8+-parseInt(_0xc73057(0xe6))/0x9*(parseInt(_0xc73057(0xd1))/0xa);if(_0x40068b===_0x8c7fd3)break;else _0x43d637['push'](_0x43d637['shift']());}catch(_0xf78a9){_0x43d637['push'](_0x43d637['shift']());}}}(a133_0x1772,0x685e1));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a133_0x2fe4(_0x88c80a,_0x887030){_0x88c80a=_0x88c80a-0xcb;const _0x177271=a133_0x1772();let _0x2fe4ec=_0x177271[_0x88c80a];return _0x2fe4ec;}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=[a133_0x3e7800(0xcc),a133_0x3e7800(0xce),a133_0x3e7800(0xe3),a133_0x3e7800(0xef),'riskLevel'];export const TOP_LEVEL_CONFIG_KEYS=new Set([a133_0x3e7800(0xdf),a133_0x3e7800(0xcf),a133_0x3e7800(0xe3),a133_0x3e7800(0xef),a133_0x3e7800(0xcc),a133_0x3e7800(0xce),a133_0x3e7800(0xd0)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x55580f){const _0x1e5efe=a133_0x3e7800;return[..._0x55580f][_0x1e5efe(0xd7)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x390e04){return TOP_LEVEL_CONFIG_KEYS['has'](_0x390e04);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x4b925a=a133_0x3e7800;return _0x4b925a(0xd9)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a133_0x3e7800(0xcf),'apiDir':a133_0x3e7800(0xd0),'cookie':a133_0x3e7800(0xcc),'accessKey':a133_0x3e7800(0xce),'defaultFormat':a133_0x3e7800(0xef),'pageSize':a133_0x3e7800(0xe1),'riskLevel':a133_0x3e7800(0xf3),'locale':a133_0x3e7800(0xe3)};function a133_0x1772(){const _0x474af6=['640071kaRzFO','1276788lVsGnY','defaultApp','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','length','Default\x20page\x20size','keys','889956SJncAD','Access\x20key','format','apps','zh-CN','4886NvnUmq','riskLevel','number','filter','cookie','776185iteqvX','accessKey','env','apiDir','140GIdUWK','15UoTzRD','1782LjgEzb','Target\x20environment','en-US','883996tDTSvx','join','app','Config\x20key\x20(','string','map','Auth\x20cookie','entries','API\x20directory\x20path','appcode','defaultFormat','pageSize','1375176eDLazG','locale','inherit','toLowerCase'];a133_0x1772=function(){return _0x474af6;};return a133_0x1772();}export function getAppProfileFlagDefs(){const _0x5ac594=a133_0x3e7800;return[{'name':_0x5ac594(0xcf),'type':_0x5ac594(0xda),'description':_0x5ac594(0xd4),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x5ac594(0xd0),'type':_0x5ac594(0xda),'description':_0x5ac594(0xde)},{'name':'cookie','type':_0x5ac594(0xda),'description':_0x5ac594(0xdc),'hidden':!![]},{'name':'accessKey','type':'string','description':_0x5ac594(0xee),'hidden':!![]},{'name':_0x5ac594(0xe0),'type':_0x5ac594(0xda),'description':_0x5ac594(0xe9),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x5ac594(0xe1),'type':_0x5ac594(0xf4),'description':_0x5ac594(0xeb)},{'name':_0x5ac594(0xf3),'type':_0x5ac594(0xda),'description':'Risk\x20level','enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':'string','description':'Locale'}];}export function collectAppProfileOverrides(_0x242d4a){const _0x307618=a133_0x3e7800,_0x12d074={};for(const [_0x192a0b,_0x131424]of Object[_0x307618(0xdd)](APP_PROFILE_FLAG_KEY_MAP)){const _0x3f52fc=_0x242d4a(_0x192a0b);if(!_0x3f52fc)continue;_0x12d074[_0x131424]=_0x131424===_0x307618(0xe1)?Number(_0x3f52fc):_0x3f52fc;}return _0x12d074;}export function buildAppProfileListFields(_0x305a22){const _0x2f542c=a133_0x3e7800;return{'env':_0x305a22[_0x2f542c(0xcf)]??null,'apiDir':_0x305a22[_0x2f542c(0xd0)]??null,'hasCookie':!!_0x305a22['cookie'],'hasAccessKey':!!_0x305a22[_0x2f542c(0xce)],'format':_0x305a22[_0x2f542c(0xef)]??null,'pageSize':_0x305a22[_0x2f542c(0xe1)]??null,'riskLevel':_0x305a22[_0x2f542c(0xf3)]??null,'locale':_0x305a22[_0x2f542c(0xe3)]??null};}export function buildAppDoctorFields(_0x3bc705,_0x1a67ca){const _0x25f27e=a133_0x3e7800;return{'env':{'value':_0x3bc705[_0x25f27e(0xcf)]||_0x1a67ca[_0x25f27e(0xcf)],'source':_0x3bc705[_0x25f27e(0xcf)]?_0x25f27e(0xd8):_0x25f27e(0xe4)},'apiDir':{'value':_0x3bc705['apiDir']||_0x1a67ca['apiDir'],'source':_0x3bc705[_0x25f27e(0xd0)]?_0x25f27e(0xd8):_0x25f27e(0xe4)},'cookie':{'value':_0x3bc705[_0x25f27e(0xcc)]||_0x1a67ca['cookie'],'source':_0x3bc705['cookie']?_0x25f27e(0xd8):'inherit'},'accessKey':{'value':_0x3bc705['accessKey']||_0x1a67ca['accessKey'],'source':_0x3bc705[_0x25f27e(0xce)]?_0x25f27e(0xd8):'inherit'}};}export function buildCanonicalAppConfig(_0x1d3730,_0x20dcb8){const _0xd438b3=a133_0x3e7800,_0x595640=_0x1d3730[_0xd438b3(0xdb)](_0x21de2c=>String(_0x21de2c||'')['trim']())[_0xd438b3(0xcb)](Boolean);if(_0x595640[_0xd438b3(0xea)]===0x0)return{};const _0x133047={};for(const _0x26d5a5 of _0x595640){_0x133047[_0x26d5a5]=_0x20dcb8?{'appcode':_0x26d5a5,'env':_0x20dcb8}:{'appcode':_0x26d5a5};}return{'apps':_0x133047,'defaultApp':_0x595640[0x0]};}export function buildCanonicalProjectConfig(_0x3a8ef2,_0x5bf007){const _0x436089=a133_0x3e7800,{appCodes:appCodes=[],env:_0x2ee173,metadata:_0x320f44}=_0x5bf007,_0x660733={..._0x3a8ef2,..._0x320f44||{}};delete _0x660733['appcode'],delete _0x660733['app'];if(_0x2ee173)_0x660733['env']=_0x2ee173;else!_0x660733[_0x436089(0xcf)]&&(_0x660733[_0x436089(0xcf)]=DEFAULT_CONFIG_VALUES[_0x436089(0xcf)]);const _0x31c4c9=buildCanonicalAppConfig(appCodes,_0x660733[_0x436089(0xcf)]);return Object[_0x436089(0xec)](_0x31c4c9)['length']>0x0&&(_0x660733[_0x436089(0xf0)]=_0x31c4c9['apps'],_0x660733['defaultApp']=_0x31c4c9[_0x436089(0xe8)]),_0x660733;}const LOCALE_MAP={'zh':a133_0x3e7800(0xf1),'zh-cn':a133_0x3e7800(0xf1),'zh_cn':a133_0x3e7800(0xf1),'en':a133_0x3e7800(0xd5),'en-us':a133_0x3e7800(0xd5),'en_us':a133_0x3e7800(0xd5)};export function normalizeLocale(_0x2e82ca){const _0x5f36c4=a133_0x3e7800;if(!_0x2e82ca)return null;return LOCALE_MAP[_0x2e82ca[_0x5f36c4(0xe5)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x5ce3aa=a134_0x3575;function a134_0x3575(_0x455501,_0x350e31){_0x455501=_0x455501-0x6d;const _0x441f7f=a134_0x441f();let _0x357534=_0x441f7f[_0x455501];return _0x357534;}(function(_0x4d79da,_0x52cfc8){const _0x45a627=a134_0x3575,_0x4ee5aa=_0x4d79da();while(!![]){try{const _0x178902=-parseInt(_0x45a627(0x75))/0x1+parseInt(_0x45a627(0x74))/0x2+-parseInt(_0x45a627(0x6f))/0x3*(parseInt(_0x45a627(0x70))/0x4)+-parseInt(_0x45a627(0x71))/0x5+-parseInt(_0x45a627(0x72))/0x6+parseInt(_0x45a627(0x6e))/0x7+parseInt(_0x45a627(0x6d))/0x8;if(_0x178902===_0x52cfc8)break;else _0x4ee5aa['push'](_0x4ee5aa['shift']());}catch(_0x599429){_0x4ee5aa['push'](_0x4ee5aa['shift']());}}}(a134_0x441f,0x8be69));export const CLI_VERSION_POLICY_URL=a134_0x5ce3aa(0x73);function a134_0x441f(){const _0x2932af=['https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','2186112VyOiII','360695zGPioK','12506488mEoSNY','2838241OoDUJH','46377hgUSno','196xHqBwk','2636850aMIVTa','5059446bPLzZF'];a134_0x441f=function(){return _0x2932af;};return a134_0x441f();}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a135_0x5ac52c=a135_0x2398;function a135_0x1932(){const _0x113a2f=['sqlName','params','2887687FktDzK','env','162fIYbcA','appcode','Schemas','dry-run','rabetbase','2389922oOYKQA','sql','Expected\x20affected\x20count','Preview\x20operation\x20without\x20executing','functionNode','Code\x20filter','description','Config\x20key','description-file','Alias\x20for\x20--non-interactive','533xslVkz','pagesize','7655RCQpJa','operationType','Use\x20remote','Config\x20value','app','value','sqlcode','Output\x20path','enableBffSave','string','Output\x20format','global','descriptionFile','Force\x20overwrite','36BgyqKR','Environment','watch','Description','Function\x20node','10diUezJ','operation','Operation\x20type','meowKey','clear','sql-name','SQL\x20name','Verbose\x20output','json\x20|\x20pretty\x20|\x20compress','verbose','sqlname','Watch\x20mode','Confirm\x20destructive\x20action','1MNbrVJ','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','331064sTZkyZ','enable-bff-save','page','db-id','DB\x20ID','Type\x20filter','Page\x20number','yes','<name>','764628YsGKub','dryRun','all','Page\x20size','Use\x20global\x20config\x20scope','code','Dataset\x20code','keyword','Keyword\x20filter','816277axKnJl','nonInteractive','schemas','function-node','dbid','Clear','key','boolean','file','type','File\x20path','non-interactive','Name','remote','help','Target\x20path','Override\x20appcode','Show\x20help','expected-count','Skip\x20import\x20generation','format','title','target','3684uLimls','expectedCount','Apply\x20to\x20all','Force\x20non-interactive\x20mode\x20(CI)','dbId','project','1323498JqdyIP','skipImports','Rabetbase\x20CLI','skip-imports','SQL\x20string','SQL\x20code','confirm','Skip\x20confirmation\x20for\x20high-risk\x20writes'];a135_0x1932=function(){return _0x113a2f;};return a135_0x1932();}(function(_0x4756d1,_0x54cc2d){const _0x4c41d6=a135_0x2398,_0x2cd91a=_0x4756d1();while(!![]){try{const _0x367e86=parseInt(_0x4c41d6(0x9b))/0x1*(-parseInt(_0x4c41d6(0x6f))/0x2)+parseInt(_0x4c41d6(0xcc))/0x3+parseInt(_0x4c41d6(0xc6))/0x4*(-parseInt(_0x4c41d6(0x7b))/0x5)+parseInt(_0x4c41d6(0x89))/0x6*(-parseInt(_0x4c41d6(0xaf))/0x7)+-parseInt(_0x4c41d6(0x9d))/0x8*(-parseInt(_0x4c41d6(0xd8))/0x9)+parseInt(_0x4c41d6(0x8e))/0xa*(parseInt(_0x4c41d6(0xd6))/0xb)+parseInt(_0x4c41d6(0xa6))/0xc*(parseInt(_0x4c41d6(0x79))/0xd);if(_0x367e86===_0x54cc2d)break;else _0x2cd91a['push'](_0x2cd91a['shift']());}catch(_0x4ef6da){_0x2cd91a['push'](_0x2cd91a['shift']());}}}(a135_0x1932,0xb8a9a));export const CLI_BIN_NAME=a135_0x5ac52c(0x6e);export const CLI_DISPLAY_NAME=a135_0x5ac52c(0xce);export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';function a135_0x2398(_0x249bd2,_0x57e4c1){_0x249bd2=_0x249bd2-0x6b;const _0x193298=a135_0x1932();let _0x239897=_0x193298[_0x249bd2];return _0x239897;}export const GLOBAL_FLAGS=[{'name':a135_0x5ac52c(0x6b),'meowKey':a135_0x5ac52c(0x6b),'type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0xbf),'hint':'<code>'},{'name':a135_0x5ac52c(0x7f),'meowKey':a135_0x5ac52c(0x7f),'type':a135_0x5ac52c(0x84),'description':'Select\x20app\x20profile\x20by\x20name','hint':a135_0x5ac52c(0xa5)},{'name':a135_0x5ac52c(0xd7),'meowKey':'env','type':'string','description':a135_0x5ac52c(0x8a),'hint':'production\x20|\x20daily'},{'name':'format','meowKey':a135_0x5ac52c(0xc3),'type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0x85),'hint':a135_0x5ac52c(0x96)},{'name':'jq','meowKey':'jq','type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0x9c),'hint':'<expr>'},{'name':a135_0x5ac52c(0x6d),'meowKey':a135_0x5ac52c(0xa7),'type':'boolean','description':a135_0x5ac52c(0x72)},{'name':a135_0x5ac52c(0xa4),'meowKey':a135_0x5ac52c(0xa4),'type':a135_0x5ac52c(0xb6),'description':a135_0x5ac52c(0xd3)},{'name':a135_0x5ac52c(0xba),'meowKey':a135_0x5ac52c(0xb0),'type':a135_0x5ac52c(0xb6),'description':a135_0x5ac52c(0xc9)},{'name':a135_0x5ac52c(0x86),'meowKey':a135_0x5ac52c(0x86),'type':a135_0x5ac52c(0xb6),'description':a135_0x5ac52c(0xaa)},{'name':'project','meowKey':a135_0x5ac52c(0xcb),'type':a135_0x5ac52c(0xb6),'description':'Use\x20project\x20config\x20scope'},{'name':'ci','meowKey':'ci','type':a135_0x5ac52c(0xb6),'description':a135_0x5ac52c(0x78),'hidden':!![]},{'name':a135_0x5ac52c(0xbd),'meowKey':a135_0x5ac52c(0xbd),'type':a135_0x5ac52c(0xb6),'description':a135_0x5ac52c(0xc0)},{'name':'name','meowKey':'name','type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0xbb),'hidden':!![]},{'name':'title','meowKey':a135_0x5ac52c(0xc4),'type':a135_0x5ac52c(0x84),'description':'Title','hidden':!![]},{'name':a135_0x5ac52c(0x92),'meowKey':a135_0x5ac52c(0x92),'type':a135_0x5ac52c(0xb6),'description':a135_0x5ac52c(0xb4),'hidden':!![]},{'name':a135_0x5ac52c(0x8b),'meowKey':a135_0x5ac52c(0x8b),'type':'boolean','description':a135_0x5ac52c(0x99),'hidden':!![]},{'name':'output','meowKey':'output','type':'string','description':a135_0x5ac52c(0x82),'hidden':!![]},{'name':a135_0x5ac52c(0xd5),'meowKey':a135_0x5ac52c(0xd5),'type':a135_0x5ac52c(0x84),'description':'JSON\x20params','hidden':!![]},{'name':'datasetcode','meowKey':'datasetcode','type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0xac),'hidden':!![]},{'name':a135_0x5ac52c(0xa8),'meowKey':a135_0x5ac52c(0xa8),'type':a135_0x5ac52c(0xb6),'description':a135_0x5ac52c(0xc8),'hidden':!![]},{'name':a135_0x5ac52c(0x9e),'meowKey':a135_0x5ac52c(0x83),'type':'boolean','description':'Enable\x20BFF\x20save','hidden':!![]},{'name':'id','meowKey':'id','type':a135_0x5ac52c(0x84),'description':'Record\x20ID','hidden':!![]},{'name':a135_0x5ac52c(0xb8),'meowKey':a135_0x5ac52c(0xb8),'type':'string','description':a135_0x5ac52c(0xa2),'hidden':!![]},{'name':a135_0x5ac52c(0xb7),'meowKey':a135_0x5ac52c(0xb7),'type':'string','description':a135_0x5ac52c(0xb9),'hidden':!![]},{'name':a135_0x5ac52c(0x81),'meowKey':'sqlcode','type':'string','description':a135_0x5ac52c(0xd1),'hidden':!![]},{'name':a135_0x5ac52c(0x93),'meowKey':a135_0x5ac52c(0xd4),'type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0x94),'hidden':!![]},{'name':a135_0x5ac52c(0x98),'meowKey':a135_0x5ac52c(0x98),'type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0x94),'hidden':!![]},{'name':a135_0x5ac52c(0xa0),'meowKey':a135_0x5ac52c(0xca),'type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0xa1),'hidden':!![]},{'name':a135_0x5ac52c(0xb3),'meowKey':a135_0x5ac52c(0xb3),'type':a135_0x5ac52c(0x84),'description':'DB\x20ID','hidden':!![]},{'name':a135_0x5ac52c(0x75),'meowKey':'description','type':'string','description':a135_0x5ac52c(0x8c),'hidden':!![]},{'name':a135_0x5ac52c(0x77),'meowKey':a135_0x5ac52c(0x87),'type':a135_0x5ac52c(0x84),'description':'Description\x20file','hidden':!![]},{'name':a135_0x5ac52c(0x9f),'meowKey':'page','type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0xa3),'hidden':!![]},{'name':a135_0x5ac52c(0x7a),'meowKey':a135_0x5ac52c(0x7a),'type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0xa9),'hidden':!![]},{'name':a135_0x5ac52c(0xad),'meowKey':'keyword','type':'string','description':a135_0x5ac52c(0xae),'hidden':!![]},{'name':a135_0x5ac52c(0xab),'meowKey':a135_0x5ac52c(0xab),'type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0x74),'hidden':!![]},{'name':a135_0x5ac52c(0x70),'meowKey':'sql','type':'string','description':a135_0x5ac52c(0xd0),'hidden':!![]},{'name':'schemas','meowKey':a135_0x5ac52c(0xb1),'type':'string','description':a135_0x5ac52c(0x6c),'hidden':!![]},{'name':a135_0x5ac52c(0x8f),'meowKey':'operation','type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0x90),'hidden':!![]},{'name':a135_0x5ac52c(0xc5),'meowKey':a135_0x5ac52c(0xc5),'type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0xbe),'hidden':!![]},{'name':a135_0x5ac52c(0xcf),'meowKey':a135_0x5ac52c(0xcd),'type':a135_0x5ac52c(0xb6),'description':a135_0x5ac52c(0xc2),'hidden':!![]},{'name':'key','meowKey':a135_0x5ac52c(0xb5),'type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0x76),'hidden':!![]},{'name':a135_0x5ac52c(0x80),'meowKey':a135_0x5ac52c(0x80),'type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0x7e),'hidden':!![]},{'name':'force','meowKey':'force','type':a135_0x5ac52c(0xb6),'description':a135_0x5ac52c(0x88),'hidden':!![]},{'name':a135_0x5ac52c(0xd2),'meowKey':a135_0x5ac52c(0xd2),'type':'boolean','description':a135_0x5ac52c(0x9a),'hidden':!![]},{'name':a135_0x5ac52c(0xbc),'meowKey':a135_0x5ac52c(0xbc),'type':'boolean','description':a135_0x5ac52c(0x7d),'hidden':!![]},{'name':a135_0x5ac52c(0x97),'meowKey':a135_0x5ac52c(0x97),'type':a135_0x5ac52c(0xb6),'description':a135_0x5ac52c(0x95),'hidden':!![]},{'name':a135_0x5ac52c(0xc1),'meowKey':a135_0x5ac52c(0xc7),'type':'string','description':a135_0x5ac52c(0x71),'hidden':!![]},{'name':'operation-type','meowKey':a135_0x5ac52c(0x7c),'type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0x90),'hidden':!![]},{'name':a135_0x5ac52c(0xb2),'meowKey':a135_0x5ac52c(0x73),'type':a135_0x5ac52c(0x84),'description':a135_0x5ac52c(0x8d),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a135_0x5ac52c(0x6b),'app',a135_0x5ac52c(0xd7),'format','jq','dry-run',a135_0x5ac52c(0xa4),a135_0x5ac52c(0xba),'ci']);export function buildMeowFlags(){const _0xab8eea=a135_0x5ac52c;return Object['fromEntries'](GLOBAL_FLAGS['map'](_0xbc4905=>[_0xbc4905[_0xab8eea(0x91)],{'type':_0xbc4905['type']}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a136_0xe938cc=a136_0x4829;(function(_0x1be400,_0x280168){const _0x4ede63=a136_0x4829,_0x1ac901=_0x1be400();while(!![]){try{const _0x2f23de=-parseInt(_0x4ede63(0x1f6))/0x1*(parseInt(_0x4ede63(0x1fd))/0x2)+parseInt(_0x4ede63(0x1f9))/0x3*(parseInt(_0x4ede63(0x1f7))/0x4)+parseInt(_0x4ede63(0x1fe))/0x5+-parseInt(_0x4ede63(0x1f8))/0x6*(-parseInt(_0x4ede63(0x200))/0x7)+-parseInt(_0x4ede63(0x1fa))/0x8+parseInt(_0x4ede63(0x201))/0x9*(parseInt(_0x4ede63(0x1fc))/0xa)+-parseInt(_0x4ede63(0x1f5))/0xb;if(_0x2f23de===_0x280168)break;else _0x1ac901['push'](_0x1ac901['shift']());}catch(_0x3e7484){_0x1ac901['push'](_0x1ac901['shift']());}}}(a136_0x8c95,0x806c3));function a136_0x4829(_0x567d39,_0x1f8e81){_0x567d39=_0x567d39-0x1f4;const _0x8c955f=a136_0x8c95();let _0x4829d5=_0x8c955f[_0x567d39];return _0x4829d5;}import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a136_0xe938cc(0x1ff),'format':'compress','locale':a136_0xe938cc(0x202),'riskLevel':a136_0xe938cc(0x1f4),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a136_0xe938cc(0x1fb);function a136_0x8c95(){const _0x12b2a7=['27zraZjf','en-US','high-risk-write','11020790nOlOEG','1715TiAiJK','3675948RTASjB','2999742YEQtVE','3NvpSDJ','5039120WcZxAQ','compress','900710LPZMtB','498tIiyLW','4478385mlwtAt','production','7ogjpEU'];a136_0x8c95=function(){return _0x12b2a7;};return a136_0x8c95();}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a137_0x40da(_0x15f117,_0x363c16){_0x15f117=_0x15f117-0x1c6;const _0x435991=a137_0x4359();let _0x40da86=_0x435991[_0x15f117];return _0x40da86;}const a137_0x48231c=a137_0x40da;(function(_0x54abfb,_0x586946){const _0x28d347=a137_0x40da,_0x21fed0=_0x54abfb();while(!![]){try{const _0x1cd594=parseInt(_0x28d347(0x1d3))/0x1*(parseInt(_0x28d347(0x1cc))/0x2)+-parseInt(_0x28d347(0x1c6))/0x3*(parseInt(_0x28d347(0x1d1))/0x4)+parseInt(_0x28d347(0x1d2))/0x5+-parseInt(_0x28d347(0x1ca))/0x6+parseInt(_0x28d347(0x1d5))/0x7+parseInt(_0x28d347(0x1ce))/0x8*(-parseInt(_0x28d347(0x1c8))/0x9)+parseInt(_0x28d347(0x1cf))/0xa;if(_0x1cd594===_0x586946)break;else _0x21fed0['push'](_0x21fed0['shift']());}catch(_0x193166){_0x21fed0['push'](_0x21fed0['shift']());}}}(a137_0x4359,0xd6359));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a137_0x4359(){const _0x5e7889=['https://runtime.lovrabet.com','824qzTiSy','16384980odiwEq','https://user.lovrabet.com','4ujKLsw','4095240tsowUT','13NhpJxC','runtimeDomain','1254463DYUqhM','https://api.lovrabet.com','655797NRgAsw','https://daily-api.lovrabet.com','148194LsMmMo','apiDomain','824400IPJkIs','https://daily-runtime.lovrabet.com','45022vynIeW'];a137_0x4359=function(){return _0x5e7889;};return a137_0x4359();}export function initDomains(_0x4122c9){const _0x6a081e=a137_0x40da;customApiDomain=_0x4122c9?.[_0x6a081e(0x1c9)],customUserDomain=_0x4122c9?.['userDomain'],customRuntimeDomain=_0x4122c9?.[_0x6a081e(0x1d4)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a137_0x48231c(0x1d0):'https://user-daily.lovrabet.com');export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a137_0x48231c(0x1d6):a137_0x48231c(0x1c7));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a137_0x48231c(0x1cd):a137_0x48231c(0x1cb));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a138_0x32f2(){const _0x2ee7aa=['5070392VzaCEX','4sFGxEg','1058356KbIpQa','4270338AuMRGt','1433817eRkNnI','1795470CItEqB','10SnZqiU','daily','development','production','579645eOcjRj','18PlIqvu','42318970pnictx'];a138_0x32f2=function(){return _0x2ee7aa;};return a138_0x32f2();}const a138_0x4c6f10=a138_0x3b40;(function(_0x3cdc90,_0x2733d1){const _0x18876a=a138_0x3b40,_0x50d5ec=_0x3cdc90();while(!![]){try{const _0x4643b6=parseInt(_0x18876a(0x8a))/0x1+parseInt(_0x18876a(0x80))/0x2+-parseInt(_0x18876a(0x85))/0x3*(-parseInt(_0x18876a(0x89))/0x4)+-parseInt(_0x18876a(0x81))/0x5*(-parseInt(_0x18876a(0x8b))/0x6)+parseInt(_0x18876a(0x7f))/0x7+parseInt(_0x18876a(0x88))/0x8*(parseInt(_0x18876a(0x86))/0x9)+-parseInt(_0x18876a(0x87))/0xa;if(_0x4643b6===_0x2733d1)break;else _0x50d5ec['push'](_0x50d5ec['shift']());}catch(_0x3888d3){_0x50d5ec['push'](_0x50d5ec['shift']());}}}(a138_0x32f2,0xc68e4));export const RABETBASE_ENV_VALUES=[a138_0x4c6f10(0x84),a138_0x4c6f10(0x82)];export function normalizeEnv(_0x510f65){return _0x510f65==='online'?'production':_0x510f65;}function a138_0x3b40(_0x3a364a,_0x5dabcf){_0x3a364a=_0x3a364a-0x7f;const _0x32f231=a138_0x32f2();let _0x3b40ef=_0x32f231[_0x3a364a];return _0x3b40ef;}export function isProduction(_0x2ce82b){const _0x3faf3e=a138_0x4c6f10;return normalizeEnv(_0x2ce82b)===_0x3faf3e(0x84);}export function isDaily(_0x51a61a){const _0xca1f6d=a138_0x4c6f10;return normalizeEnv(_0x51a61a)===_0xca1f6d(0x82);}export function isDev(_0x1ab3fd){const _0x3accbb=a138_0x4c6f10,_0x120405=normalizeEnv(_0x1ab3fd);return _0x120405===_0x3accbb(0x83)||_0x120405==='dev';}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||'production');export function getEnv(){return env;}export function initEnv(_0x554ddc){env=normalizeEnv(_0x554ddc);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a139_0x1f5ea2=a139_0x403e;function a139_0x403e(_0x4642f5,_0x32694d){_0x4642f5=_0x4642f5-0xe2;const _0x4eb0e0=a139_0x4eb0();let _0x403e48=_0x4eb0e0[_0x4642f5];return _0x403e48;}function a139_0x4eb0(){const _0x15d1d3=['10otvfuP','compress','984564KvPOFs','2252934UVREYK','1xUUYVB','json','6DblqgK','2583435pGrzeo','3KjPOUu','pretty','1564978ysgQPg','2836493aUoSTZ','2100156JMUMPL','5671296ZVPkir'];a139_0x4eb0=function(){return _0x15d1d3;};return a139_0x4eb0();}(function(_0x12b94e,_0x55454e){const _0x21f653=a139_0x403e,_0xd9c2f5=_0x12b94e();while(!![]){try{const _0x4feb7b=-parseInt(_0x21f653(0xea))/0x1*(-parseInt(_0x21f653(0xe2))/0x2)+parseInt(_0x21f653(0xee))/0x3*(-parseInt(_0x21f653(0xe4))/0x4)+-parseInt(_0x21f653(0xed))/0x5*(-parseInt(_0x21f653(0xec))/0x6)+-parseInt(_0x21f653(0xe8))/0x7+-parseInt(_0x21f653(0xe5))/0x8+-parseInt(_0x21f653(0xe9))/0x9*(-parseInt(_0x21f653(0xe6))/0xa)+parseInt(_0x21f653(0xe3))/0xb;if(_0x4feb7b===_0x55454e)break;else _0xd9c2f5['push'](_0xd9c2f5['shift']());}catch(_0x355194){_0xd9c2f5['push'](_0xd9c2f5['shift']());}}}(a139_0x4eb0,0x69a7a));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a139_0x1f5ea2(0xeb),a139_0x1f5ea2(0xef),a139_0x1f5ea2(0xe7)];
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a140_0x46c5de=a140_0x5834;(function(_0x488b37,_0x2e892c){const _0x49ec02=a140_0x5834,_0x57b487=_0x488b37();while(!![]){try{const _0x378131=parseInt(_0x49ec02(0x134))/0x1*(parseInt(_0x49ec02(0x13c))/0x2)+-parseInt(_0x49ec02(0x139))/0x3+parseInt(_0x49ec02(0x136))/0x4+parseInt(_0x49ec02(0x137))/0x5*(-parseInt(_0x49ec02(0x138))/0x6)+parseInt(_0x49ec02(0x13b))/0x7+-parseInt(_0x49ec02(0x135))/0x8+parseInt(_0x49ec02(0x133))/0x9;if(_0x378131===_0x2e892c)break;else _0x57b487['push'](_0x57b487['shift']());}catch(_0x1f0183){_0x57b487['push'](_0x57b487['shift']());}}}(a140_0x4e4c,0xb28bf));export const DEFAULT_API_DIR=a140_0x46c5de(0x13a);function a140_0x5834(_0x104cd9,_0x3e8269){_0x104cd9=_0x104cd9-0x133;const _0x4e4cac=a140_0x4e4c();let _0x58347b=_0x4e4cac[_0x104cd9];return _0x58347b;}function a140_0x4e4c(){const _0x50351f=['1504456tVkdVA','5gyIJSa','6108288insrxw','1088559bgxkPw','./src/api','7516649qdSEOP','155398xNcVUd','14273361huoNSJ','6XrTYnz','11118528erGILz'];a140_0x4e4c=function(){return _0x50351f;};return a140_0x4e4c();}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a141_0x2bfff6=a141_0x3faf;(function(_0x2a7b35,_0x40e42e){const _0x399a2d=a141_0x3faf,_0x4d2baa=_0x2a7b35();while(!![]){try{const _0x3595e0=-parseInt(_0x399a2d(0xf3))/0x1+-parseInt(_0x399a2d(0xef))/0x2*(parseInt(_0x399a2d(0xfa))/0x3)+parseInt(_0x399a2d(0xf6))/0x4*(-parseInt(_0x399a2d(0xf5))/0x5)+parseInt(_0x399a2d(0xf1))/0x6+-parseInt(_0x399a2d(0xf8))/0x7+-parseInt(_0x399a2d(0xf4))/0x8+-parseInt(_0x399a2d(0xf7))/0x9*(-parseInt(_0x399a2d(0xf2))/0xa);if(_0x3595e0===_0x40e42e)break;else _0x4d2baa['push'](_0x4d2baa['shift']());}catch(_0x323cc7){_0x4d2baa['push'](_0x4d2baa['shift']());}}}(a141_0x2ca8,0x8c896));export const RISK_LEVEL_VALUES=[a141_0x2bfff6(0xf0),'write',a141_0x2bfff6(0xf9)];function a141_0x3faf(_0x17b7cb,_0x564cd4){_0x17b7cb=_0x17b7cb-0xef;const _0x2ca892=a141_0x2ca8();let _0x3faf8f=_0x2ca892[_0x17b7cb];return _0x3faf8f;}function a141_0x2ca8(){const _0x979084=['591ebVtle','402HtOfob','read','3443124KNGHRe','10229060IwVgVQ','535944zvTLZf','33928QGEDeS','5GgiNDr','2648316LrESQw','18CjeFYV','5615169VzwAjk','high-risk-write'];a141_0x2ca8=function(){return _0x979084;};return a141_0x2ca8();}
|