@lovrabet/rabetbase-cli 2.1.4 → 2.1.6-beta.0

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.
Files changed (189) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/create.js +1 -1
  28. package/lib/commands/bff/delete.js +1 -1
  29. package/lib/commands/bff/detail.js +1 -1
  30. package/lib/commands/bff/index.js +1 -1
  31. package/lib/commands/bff/list.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/data/filter.js +1 -0
  48. package/lib/commands/data/getOne.js +1 -0
  49. package/lib/commands/data/index.js +1 -0
  50. package/lib/commands/data/shared.js +1 -0
  51. package/lib/commands/dataset/detail.js +1 -1
  52. package/lib/commands/dataset/index.js +1 -1
  53. package/lib/commands/dataset/links.js +1 -1
  54. package/lib/commands/dataset/list.js +1 -1
  55. package/lib/commands/dataset/operations.js +1 -1
  56. package/lib/commands/db/analyze-cancel.js +1 -1
  57. package/lib/commands/db/analyze-start.js +1 -1
  58. package/lib/commands/db/analyze-status.js +1 -1
  59. package/lib/commands/db/create.js +1 -1
  60. package/lib/commands/db/delete.js +1 -1
  61. package/lib/commands/db/detail.js +1 -1
  62. package/lib/commands/db/diff.js +1 -1
  63. package/lib/commands/db/index.js +1 -1
  64. package/lib/commands/db/list.js +1 -1
  65. package/lib/commands/db/shared.js +1 -1
  66. package/lib/commands/db/tables.js +1 -1
  67. package/lib/commands/db/test.js +1 -1
  68. package/lib/commands/db/update.js +1 -1
  69. package/lib/commands/doctor.js +1 -1
  70. package/lib/commands/init/index.js +1 -1
  71. package/lib/commands/logs/index.js +1 -1
  72. package/lib/commands/menu/index.js +1 -1
  73. package/lib/commands/menu/shared/compare-table.js +1 -1
  74. package/lib/commands/menu/shared/index.js +1 -1
  75. package/lib/commands/menu/shared/inquirer.js +1 -1
  76. package/lib/commands/menu/shared/local-pages.js +1 -1
  77. package/lib/commands/menu/shared/logic.js +1 -1
  78. package/lib/commands/menu/shared/service.js +1 -1
  79. package/lib/commands/menu/shared/sync-core.js +1 -1
  80. package/lib/commands/menu/shared/update-core.js +1 -1
  81. package/lib/commands/menu/shared/valid-url.js +1 -1
  82. package/lib/commands/menu/sync.js +1 -1
  83. package/lib/commands/menu/update.js +1 -1
  84. package/lib/commands/page/generate-start.js +1 -1
  85. package/lib/commands/page/generate-status.js +1 -1
  86. package/lib/commands/page/index.js +1 -1
  87. package/lib/commands/page/pull.js +1 -1
  88. package/lib/commands/page/push.js +1 -1
  89. package/lib/commands/page/shared.js +1 -1
  90. package/lib/commands/page/standard-page-status.js +1 -1
  91. package/lib/commands/page/sync.js +1 -1
  92. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  93. package/lib/commands/project/create/format-elapsed.js +1 -1
  94. package/lib/commands/project/create/main.js +1 -1
  95. package/lib/commands/project/create/non-interactive.js +1 -1
  96. package/lib/commands/project/create/project-template-path.js +1 -1
  97. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  98. package/lib/commands/project/create/use-format-code.js +1 -1
  99. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  100. package/lib/commands/project/index.js +1 -1
  101. package/lib/commands/project/init.js +1 -1
  102. package/lib/commands/project/upgrade.js +1 -1
  103. package/lib/commands/registry.js +1 -1
  104. package/lib/commands/run/index.js +1 -1
  105. package/lib/commands/schema.js +1 -1
  106. package/lib/commands/skill/index.js +1 -1
  107. package/lib/commands/sql/create.js +1 -1
  108. package/lib/commands/sql/delete.js +1 -1
  109. package/lib/commands/sql/detail.js +1 -1
  110. package/lib/commands/sql/exec.js +1 -1
  111. package/lib/commands/sql/index.js +1 -1
  112. package/lib/commands/sql/list.js +1 -1
  113. package/lib/commands/sql/pull.js +1 -1
  114. package/lib/commands/sql/push.js +1 -1
  115. package/lib/commands/sql/save.js +1 -1
  116. package/lib/commands/sql/shared.js +1 -1
  117. package/lib/commands/sql/status.js +1 -1
  118. package/lib/commands/sql/validate.js +1 -1
  119. package/lib/config/schema.js +1 -1
  120. package/lib/constant/cdn.js +1 -1
  121. package/lib/constant/cli.js +1 -1
  122. package/lib/constant/defaults.js +1 -1
  123. package/lib/constant/domain.js +1 -1
  124. package/lib/constant/env.js +1 -1
  125. package/lib/constant/output.js +1 -1
  126. package/lib/constant/paths.js +1 -1
  127. package/lib/constant/risk.js +1 -1
  128. package/lib/context.js +1 -1
  129. package/lib/core/alias-resolver.js +1 -1
  130. package/lib/core/api-client.js +1 -1
  131. package/lib/core/bff/config.js +1 -1
  132. package/lib/core/bff/file-system.js +1 -1
  133. package/lib/core/bff/hash.js +1 -1
  134. package/lib/core/bff/lock.js +1 -1
  135. package/lib/core/bff/utils.js +1 -1
  136. package/lib/core/db-resolver.js +1 -1
  137. package/lib/core/page/file-system.js +1 -1
  138. package/lib/core/page/hash.js +1 -1
  139. package/lib/core/page/lock.js +1 -1
  140. package/lib/core/sql-sync/config.js +1 -1
  141. package/lib/core/sql-sync/file-system.js +1 -1
  142. package/lib/core/sql-sync/hash.js +1 -1
  143. package/lib/core/sql-sync/lock.js +1 -1
  144. package/lib/core/sql-sync/utils.js +1 -1
  145. package/lib/core/sql-validator.js +1 -1
  146. package/lib/errors.js +1 -1
  147. package/lib/framework/build-all-flags.js +1 -1
  148. package/lib/framework/flags.js +1 -1
  149. package/lib/framework/help.js +1 -1
  150. package/lib/framework/index.js +1 -1
  151. package/lib/framework/output.js +1 -1
  152. package/lib/framework/response.js +1 -1
  153. package/lib/framework/runner-alias.js +1 -1
  154. package/lib/framework/runner.js +1 -1
  155. package/lib/framework/schema-export.js +1 -1
  156. package/lib/framework/types.js +1 -1
  157. package/lib/generated/build-info.js +1 -1
  158. package/lib/help.js +1 -1
  159. package/lib/skills/main.js +1 -1
  160. package/lib/skills/npx-skills-add.js +1 -1
  161. package/lib/telemetry/cli-command-trace.js +1 -1
  162. package/lib/telemetry/cli-help-trace.js +1 -1
  163. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  164. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  165. package/lib/telemetry/send-cli-trace-log.js +1 -1
  166. package/lib/utils/ai_config.js +1 -1
  167. package/lib/utils/apply-jq-filter.js +1 -1
  168. package/lib/utils/cdn-config.js +1 -1
  169. package/lib/utils/check-sdk-version.js +1 -1
  170. package/lib/utils/cli-version-check.js +1 -1
  171. package/lib/utils/cli-version-policy.js +1 -1
  172. package/lib/utils/config.js +1 -1
  173. package/lib/utils/copy-directory.js +1 -1
  174. package/lib/utils/entity-with-id.js +1 -1
  175. package/lib/utils/file-utils.js +1 -1
  176. package/lib/utils/guides-cdn.js +1 -1
  177. package/lib/utils/http-client.js +1 -1
  178. package/lib/utils/is-non-interactive.js +1 -1
  179. package/lib/utils/logger.js +1 -1
  180. package/lib/utils/params.js +1 -0
  181. package/lib/utils/platform.js +1 -1
  182. package/lib/utils/rules-cdn.js +1 -1
  183. package/lib/utils/sleep.js +1 -1
  184. package/lib/utils/template-replacer.js +1 -1
  185. package/lib/utils/version.js +1 -1
  186. package/lib/utils/with-active-cookie.js +1 -1
  187. package/lib/utils/write-cli-side-channel.js +1 -1
  188. package/package.json +4 -4
  189. package/templates/skill/SKILL.md.tpl +1 -1
@@ -1 +1 @@
1
- const a109_0x5336ba=a109_0x4158;(function(_0x484228,_0x16d372){const _0x5a62b3=a109_0x4158,_0x155950=_0x484228();while(!![]){try{const _0x2e11e8=-parseInt(_0x5a62b3(0x1f5))/0x1*(parseInt(_0x5a62b3(0x1d2))/0x2)+-parseInt(_0x5a62b3(0x1e1))/0x3+parseInt(_0x5a62b3(0x1fa))/0x4+-parseInt(_0x5a62b3(0x1d9))/0x5*(-parseInt(_0x5a62b3(0x1d4))/0x6)+-parseInt(_0x5a62b3(0x1e6))/0x7+parseInt(_0x5a62b3(0x1e0))/0x8+parseInt(_0x5a62b3(0x1fc))/0x9;if(_0x2e11e8===_0x16d372)break;else _0x155950['push'](_0x155950['shift']());}catch(_0x5cbe96){_0x155950['push'](_0x155950['shift']());}}}(a109_0x3ecf,0x54360));function a109_0x4158(_0x135330,_0x21fb5b){_0x135330=_0x135330-0x1cc;const _0x3ecfc1=a109_0x3ecf();let _0x415853=_0x3ecfc1[_0x135330];return _0x415853;}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';function a109_0x3ecf(){const _0x3d0bc8=['apps','sqls','sqlCode','test','sqlName','lockFilePath','length','would_pull','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlcode','lastSync','2SjJsio','Filter\x20by\x20SQL\x20display\x20name','366FpglXm','POST','message','cancelled','sqlRoot','14435luaWBS','str','\x20SQL\x20file(s)\x20into\x20','\x20skipped,\x20','\x20failed','boolean','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','3110224bRxOvk','752526tuQwIJ','sqlContent','sqlRootDir','path','force','4735626DCMvCy','replace','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','nonInteractive','appCode','utf8','push','toISOString','Force\x20overwrite\x20local\x20unsynced\x20changes','conflict','Pull\x20complete:\x20','filter','paging','local\x20differs\x20from\x20remote','description','134659dpAJGX','No\x20remote\x20SQL\x20queries\x20matched.','catch','pull','Force\x20pull\x20cancelled.','230884hPJFGy','Would\x20pull\x20','7059069RWHqBs','mybatisXml','name','trimStart','dbId','split','tableData','unchanged'];a109_0x3ecf=function(){return _0x3d0bc8;};return a109_0x3ecf();}import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x40af3b,_0x3c7d67){const _0x175be8=a109_0x4158,_0x5af59c=[];let _0x2e9ad3=0x1;while(!![]){const _0xca8ab3=await listSqlQueries(_0x40af3b,{'currentPage':_0x2e9ad3,'pageSize':PAGE_SIZE,'sqlCode':_0x3c7d67['sqlCode'],'sqlName':_0x3c7d67[_0x175be8(0x208)]}),_0x573cbb=_0xca8ab3[_0x175be8(0x202)]??[];_0x5af59c['push'](..._0x573cbb);if(_0x573cbb[_0x175be8(0x1cd)]===0x0)break;const _0x15f8ae=_0xca8ab3[_0x175be8(0x1f2)]?.['totalCount'];if(_0x15f8ae!=null?_0x5af59c['length']>=_0x15f8ae:_0x573cbb[_0x175be8(0x1cd)]<PAGE_SIZE)break;_0x2e9ad3++;}return _0x5af59c;}async function ensureSqlContent(_0x4f1743){const _0x474db7=a109_0x4158;if(_0x4f1743['sqlContent']!=null&&String(_0x4f1743[_0x474db7(0x1e2)])[_0x474db7(0x1cd)]>0x0)return _0x4f1743;return getSqlQueryDetail(_0x4f1743['sqlCode']);}export const sqlPull={'service':'sql','command':'pull','description':a109_0x5336ba(0x1cf),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a109_0x5336ba(0x1fe),'type':'string','description':a109_0x5336ba(0x1d3)},{'name':a109_0x5336ba(0x1e5),'type':a109_0x5336ba(0x1de),'description':a109_0x5336ba(0x1ee)}],async 'dryRun'(_0x1e937b){const _0x5299d7=a109_0x5336ba,_0xa04e25=loadSqlProjectConfig(_0x1e937b['appCode']),_0x56cabb=await readSqlLockFile(_0xa04e25[_0x5299d7(0x1cc)]),{appLock:_0x2ee1d6}=ensureSqlLockScope(_0x56cabb??createEmptySqlLock(),_0xa04e25[_0x5299d7(0x1ea)],_0xa04e25[_0x5299d7(0x1d8)],'pull'),_0x476b40=await fetchAllSqlQueries(_0x1e937b[_0x5299d7(0x1ea)],{'sqlCode':_0x1e937b['str'](_0x5299d7(0x1d0))||undefined,'sqlName':_0x1e937b[_0x5299d7(0x1da)](_0x5299d7(0x1fe))||undefined}),_0x5e97f6=[];for(const _0x2bb48f of _0x476b40){const _0x265d37=await ensureSqlContent(_0x2bb48f),_0x59a756=ensureRemoteSqlContent(_0x265d37),_0x1f3371=detectModeFromSql(_0x265d37),_0x51830b=_0x265d37[_0x5299d7(0x200)]?await getDbName(_0x1e937b['appCode'],Number(_0x265d37['dbId']))[_0x5299d7(0x1f7)](()=>undefined):undefined,_0x53d851=buildLocalSqlFileContent({'sqlCode':_0x265d37['sqlCode'],'sqlName':_0x265d37[_0x5299d7(0x208)],'dbId':_0x265d37[_0x5299d7(0x200)]},_0x59a756,{'dbName':_0x51830b,'mode':_0x1f3371,'syncedAt':new Date()[_0x5299d7(0x1ed)](),'description':_0x265d37['description']}),_0x120487=buildSqlLockEntry(_0x265d37,_0x59a756,'',{'dbName':_0x51830b}),_0x1d0d18=resolveLocalSqlFilePath(_0xa04e25,_0x265d37[_0x5299d7(0x206)],_0x120487);let _0x4017d9=_0x5299d7(0x1ce),_0x3ad6ac;if(await fileExists(_0x1d0d18)){const _0x217eef=await readFile(_0x1d0d18,_0x5299d7(0x1eb));isEquivalentPulledSqlFile(_0x217eef,_0x53d851,_0x1f3371)?(_0x4017d9='skipped',_0x3ad6ac=_0x5299d7(0x203)):(_0x4017d9=_0x5299d7(0x1ef),_0x3ad6ac=_0x5299d7(0x1df));}_0x5e97f6[_0x5299d7(0x1ec)]({'sqlCode':_0x265d37['sqlCode'],'sqlName':_0x265d37[_0x5299d7(0x208)],'filePath':_0x1d0d18,'status':_0x4017d9,'reason':_0x3ad6ac});}return{'method':_0x5299d7(0x1d5),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x1e937b[_0x5299d7(0x1ea)],'sqlCode':_0x1e937b[_0x5299d7(0x1da)](_0x5299d7(0x1d0))||null,'sqlName':_0x1e937b[_0x5299d7(0x1da)]('name')||null,'files':_0x5e97f6},'description':_0x5299d7(0x1fb)+_0x5e97f6[_0x5299d7(0x1cd)]+_0x5299d7(0x1db)+_0xa04e25['sqlRootDir']};},async 'execute'(_0x3d17e4){const _0x18693c=a109_0x5336ba,_0x15caf1=loadSqlProjectConfig(_0x3d17e4['appCode']),_0x251c04=await readSqlLockFile(_0x15caf1[_0x18693c(0x1cc)]),{lockData:_0x523e81,appLock:_0x4d478f}=ensureSqlLockScope(_0x251c04??createEmptySqlLock(),_0x15caf1[_0x18693c(0x1ea)],_0x15caf1[_0x18693c(0x1d8)],_0x18693c(0x1f8)),_0x41e9f6=_0x3d17e4['bool'](_0x18693c(0x1e5)),_0x1dfba0=await fetchAllSqlQueries(_0x3d17e4['appCode'],{'sqlCode':_0x3d17e4[_0x18693c(0x1da)](_0x18693c(0x1d0))||undefined,'sqlName':_0x3d17e4['str']('name')||undefined});if(_0x1dfba0[_0x18693c(0x1cd)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x18693c(0x1f6)};const _0x252f62=[],_0x569afb=[];for(const _0x30db65 of _0x1dfba0){try{_0x252f62[_0x18693c(0x1ec)](await ensureSqlContent(_0x30db65));}catch(_0x523a2f){_0x569afb[_0x18693c(0x1ec)]({'sqlCode':_0x30db65[_0x18693c(0x206)],'error':_0x523a2f instanceof Error?_0x523a2f['message']:String(_0x523a2f)});}}if(_0x41e9f6&&!_0x3d17e4[_0x18693c(0x1e9)]){let _0x1686c0=![];for(const _0x3219ff of _0x252f62){const _0x5aa7eb=detectModeFromSql(_0x3219ff),_0x2f367a=_0x3219ff['dbId']?await getDbName(_0x3d17e4[_0x18693c(0x1ea)],Number(_0x3219ff[_0x18693c(0x200)]))[_0x18693c(0x1f7)](()=>undefined):undefined,_0x29cb00=buildLocalSqlFileContent({'sqlCode':_0x3219ff['sqlCode'],'sqlName':_0x3219ff[_0x18693c(0x208)],'dbId':_0x3219ff['dbId']},ensureRemoteSqlContent(_0x3219ff),{'dbName':_0x2f367a,'mode':_0x5aa7eb,'syncedAt':new Date()[_0x18693c(0x1ed)](),'description':_0x3219ff[_0x18693c(0x1f4)]}),_0x5297fb=resolveLocalSqlFilePath(_0x15caf1,_0x3219ff[_0x18693c(0x206)],buildSqlLockEntry(_0x3219ff,ensureRemoteSqlContent(_0x3219ff),'',{'dbName':_0x2f367a}));if(await fileExists(_0x5297fb)){const _0x541b13=await readFile(_0x5297fb,_0x18693c(0x1eb));if(!isEquivalentPulledSqlFile(_0x541b13,_0x29cb00,_0x5aa7eb)){_0x1686c0=!![];break;}}}if(_0x1686c0){const _0x1ae506=await confirmForceOverwrite(_0x18693c(0x1e8));if(!_0x1ae506)throw CliErrors[_0x18693c(0x1d7)](_0x18693c(0x1f9));}}const _0x23b476=cloneSqlLockData(_0x523e81),_0x5a0e8c=_0x23b476[_0x18693c(0x204)][_0x15caf1[_0x18693c(0x1ea)]],_0x2f8450=[],_0x37c070=[];for(const _0x474b50 of _0x252f62){const _0x34050a=_0x5a0e8c[_0x18693c(0x205)][_0x474b50[_0x18693c(0x206)]],_0x27bf30=ensureRemoteSqlContent(_0x474b50),_0x40ae7b=detectModeFromSql(_0x474b50),_0x3b8f76=_0x474b50[_0x18693c(0x200)]?await getDbName(_0x3d17e4['appCode'],Number(_0x474b50[_0x18693c(0x200)]))['catch'](()=>undefined):undefined,_0x1bda48=buildLocalSqlFileContent({'sqlCode':_0x474b50[_0x18693c(0x206)],'sqlName':_0x474b50[_0x18693c(0x208)],'dbId':_0x474b50[_0x18693c(0x200)]},_0x27bf30,{'dbName':_0x3b8f76,'mode':_0x40ae7b,'syncedAt':new Date()[_0x18693c(0x1ed)](),'description':_0x474b50[_0x18693c(0x1f4)]}),_0x3b2b9e=buildSqlLockEntry(_0x474b50,_0x27bf30,computeSqlContentHash(_0x1bda48),{'dbName':_0x3b8f76}),_0x2fa2e0=_0x3b2b9e[_0x18693c(0x1e4)],_0x3b5394=join(_0x15caf1[_0x18693c(0x1e3)],_0x2fa2e0);try{if(await fileExists(_0x3b5394)){const _0x40b59f=await readFile(_0x3b5394,_0x18693c(0x1eb));if(isEquivalentPulledSqlFile(_0x40b59f,_0x1bda48,_0x40ae7b)){_0x37c070[_0x18693c(0x1ec)]({'sqlCode':_0x474b50[_0x18693c(0x206)],'reason':_0x18693c(0x203)}),_0x5a0e8c[_0x18693c(0x205)][_0x474b50[_0x18693c(0x206)]]={..._0x3b2b9e,'hash':computeSqlContentHash(_0x40b59f),'path':_0x2fa2e0};continue;}if(!_0x41e9f6){_0x37c070[_0x18693c(0x1ec)]({'sqlCode':_0x474b50[_0x18693c(0x206)],'reason':_0x18693c(0x1f3)});continue;}}const _0x3e9878=_0x34050a?.[_0x18693c(0x1e4)]?join(_0x15caf1[_0x18693c(0x1e3)],_0x34050a[_0x18693c(0x1e4)]):undefined;_0x3e9878&&_0x3e9878!==_0x3b5394&&await fileExists(_0x3e9878)&&await rm(_0x3e9878,{'force':!![]}),await ensureParentDirectory(_0x3b5394),await writeFile(_0x3b5394,_0x1bda48,'utf8'),_0x5a0e8c['sqls'][_0x474b50[_0x18693c(0x206)]]={..._0x3b2b9e,'path':_0x2fa2e0},_0x2f8450[_0x18693c(0x1ec)]({'sqlCode':_0x474b50[_0x18693c(0x206)],'filePath':_0x3b5394});}catch(_0x4db164){_0x569afb[_0x18693c(0x1ec)]({'sqlCode':_0x474b50[_0x18693c(0x206)],'error':_0x4db164 instanceof Error?_0x4db164[_0x18693c(0x1d6)]:String(_0x4db164)});}}return _0x5a0e8c[_0x18693c(0x1d1)]=new Date()[_0x18693c(0x1ed)](),await writeSqlLockFile(_0x15caf1[_0x18693c(0x1cc)],_0x23b476),{'ok':_0x569afb[_0x18693c(0x1cd)]===0x0,'data':{'pulled':_0x2f8450,'skipped':_0x37c070,'failed':_0x569afb},'message':_0x18693c(0x1f0)+_0x2f8450[_0x18693c(0x1cd)]+'\x20written,\x20'+_0x37c070['length']+_0x18693c(0x1dc)+_0x569afb[_0x18693c(0x1cd)]+_0x18693c(0x1dd)};}};function detectModeFromSql(_0x55fc7a){const _0x56bc38=a109_0x5336ba,_0x5c5865=ensureRemoteSqlContent(_0x55fc7a),_0x143a02=stripLocalSqlMetadata(_0x5c5865,_0x56bc38(0x1fd))[_0x56bc38(0x1ff)]();if(/^<(select|insert|update|delete)\b/i[_0x56bc38(0x207)](_0x143a02))return _0x56bc38(0x1fd);return'sql';}function isEquivalentPulledSqlFile(_0x2f0c64,_0x11b32c,_0xfe78e8){return normalizePullComparableContent(_0x2f0c64,_0xfe78e8)===normalizePullComparableContent(_0x11b32c,_0xfe78e8);}function normalizePullComparableContent(_0xfd56fd,_0x1dbb25){const _0xe3293f=a109_0x5336ba,_0x34171b=_0xfd56fd[_0xe3293f(0x1e7)](/\r\n/g,'\x0a')[_0xe3293f(0x201)]('\x0a'),_0x3a893b=_0x34171b[_0xe3293f(0x1f1)](_0xade286=>!isSyncedAtMetadataLine(_0xade286,_0x1dbb25));return _0x3a893b['join']('\x0a');}function isSyncedAtMetadataLine(_0xfc25aa,_0x21f76e){const _0x6c287b=a109_0x5336ba;if(_0x21f76e===_0x6c287b(0x1fd))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x6c287b(0x207)](_0xfc25aa);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x6c287b(0x207)](_0xfc25aa);}
1
+ const a113_0x237711=a113_0xd167;(function(_0x35522c,_0x2932f8){const _0x586ea2=a113_0xd167,_0x93a7b=_0x35522c();while(!![]){try{const _0xa77809=-parseInt(_0x586ea2(0xc5))/0x1+-parseInt(_0x586ea2(0xb4))/0x2+parseInt(_0x586ea2(0xbb))/0x3+parseInt(_0x586ea2(0xb6))/0x4*(-parseInt(_0x586ea2(0x9c))/0x5)+-parseInt(_0x586ea2(0x95))/0x6*(-parseInt(_0x586ea2(0xa1))/0x7)+parseInt(_0x586ea2(0x90))/0x8*(-parseInt(_0x586ea2(0xbd))/0x9)+parseInt(_0x586ea2(0xb0))/0xa;if(_0xa77809===_0x2932f8)break;else _0x93a7b['push'](_0x93a7b['shift']());}catch(_0x155186){_0x93a7b['push'](_0x93a7b['shift']());}}}(a113_0x4f45,0x46726));import{readFile,rm,writeFile}from'node:fs/promises';function a113_0xd167(_0x2af9e7,_0x4e6094){_0x2af9e7=_0x2af9e7-0x8d;const _0x4f45f5=a113_0x4f45();let _0xd167f1=_0x4f45f5[_0x2af9e7];return _0xd167f1;}import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';function a113_0x4f45(){const _0x30dcdb=['36rybEfA','name','length','paging','sql','Would\x20pull\x20','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlCode','562992arcpGZ','lockFilePath','path','sqlName','totalCount','replace','629704DfhjFK','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','conflict','pull','\x20written,\x20','984lAwkDv','sqlContent','\x20failed','\x20SQL\x20file(s)\x20into\x20','mybatisXml','filter','push','2295kFsSiZ','catch','dbId','lastSync','Filter\x20by\x20SQL\x20display\x20name','7147UljkyZ','sqlRoot','test','skipped','force','Force\x20overwrite\x20local\x20unsynced\x20changes','utf8','str','write','appCode','message','join','sqlRootDir','nonInteractive','tableData','15497590LJHwUd','toISOString','description','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','536290JNsBsL','split','4916iTHkJV','sqls','Force\x20pull\x20cancelled.','bool','apps','844341hUfjwQ','unchanged'];a113_0x4f45=function(){return _0x30dcdb;};return a113_0x4f45();}import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x1e883f,_0xc2f10c){const _0x24cec0=a113_0xd167,_0x5b6215=[];let _0x21cd1e=0x1;while(!![]){const _0x428d51=await listSqlQueries(_0x1e883f,{'currentPage':_0x21cd1e,'pageSize':PAGE_SIZE,'sqlCode':_0xc2f10c['sqlCode'],'sqlName':_0xc2f10c[_0x24cec0(0x8d)]}),_0x481364=_0x428d51[_0x24cec0(0xaf)]??[];_0x5b6215[_0x24cec0(0x9b)](..._0x481364);if(_0x481364['length']===0x0)break;const _0x3436c4=_0x428d51[_0x24cec0(0xc0)]?.[_0x24cec0(0x8e)];if(_0x3436c4!=null?_0x5b6215[_0x24cec0(0xbf)]>=_0x3436c4:_0x481364[_0x24cec0(0xbf)]<PAGE_SIZE)break;_0x21cd1e++;}return _0x5b6215;}async function ensureSqlContent(_0x4d824d){const _0x2a97bf=a113_0xd167;if(_0x4d824d[_0x2a97bf(0x96)]!=null&&String(_0x4d824d['sqlContent'])[_0x2a97bf(0xbf)]>0x0)return _0x4d824d;return getSqlQueryDetail(_0x4d824d[_0x2a97bf(0xc4)]);}export const sqlPull={'service':'sql','command':a113_0x237711(0x93),'description':a113_0x237711(0xc3),'risk':a113_0x237711(0xa9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a113_0x237711(0xbe),'type':'string','description':a113_0x237711(0xa0)},{'name':a113_0x237711(0xa5),'type':'boolean','description':a113_0x237711(0xa6)}],async 'dryRun'(_0x2d4752){const _0x4a490d=a113_0x237711,_0x31ec78=loadSqlProjectConfig(_0x2d4752[_0x4a490d(0xaa)]),_0x13c7da=await readSqlLockFile(_0x31ec78[_0x4a490d(0xc6)]),{appLock:_0x50b9b3}=ensureSqlLockScope(_0x13c7da??createEmptySqlLock(),_0x31ec78[_0x4a490d(0xaa)],_0x31ec78['sqlRoot'],_0x4a490d(0x93)),_0x26b482=await fetchAllSqlQueries(_0x2d4752[_0x4a490d(0xaa)],{'sqlCode':_0x2d4752[_0x4a490d(0xa8)]('sqlcode')||undefined,'sqlName':_0x2d4752[_0x4a490d(0xa8)](_0x4a490d(0xbe))||undefined}),_0x595304=[];for(const _0x55a47f of _0x26b482){const _0x3bf05b=await ensureSqlContent(_0x55a47f),_0x20396e=ensureRemoteSqlContent(_0x3bf05b),_0x2a9732=detectModeFromSql(_0x3bf05b),_0x22feb3=_0x3bf05b[_0x4a490d(0x9e)]?await getDbName(_0x2d4752['appCode'],Number(_0x3bf05b[_0x4a490d(0x9e)]))[_0x4a490d(0x9d)](()=>undefined):undefined,_0x53bce1=buildLocalSqlFileContent({'sqlCode':_0x3bf05b[_0x4a490d(0xc4)],'sqlName':_0x3bf05b[_0x4a490d(0x8d)],'dbId':_0x3bf05b[_0x4a490d(0x9e)]},_0x20396e,{'dbName':_0x22feb3,'mode':_0x2a9732,'syncedAt':new Date()[_0x4a490d(0xb1)](),'description':_0x3bf05b['description']}),_0x17d04d=buildSqlLockEntry(_0x3bf05b,_0x20396e,'',{'dbName':_0x22feb3}),_0xf84928=resolveLocalSqlFilePath(_0x31ec78,_0x3bf05b[_0x4a490d(0xc4)],_0x17d04d);let _0x2be09f='would_pull',_0x532c80;if(await fileExists(_0xf84928)){const _0x11e64e=await readFile(_0xf84928,_0x4a490d(0xa7));isEquivalentPulledSqlFile(_0x11e64e,_0x53bce1,_0x2a9732)?(_0x2be09f=_0x4a490d(0xa4),_0x532c80='unchanged'):(_0x2be09f=_0x4a490d(0x92),_0x532c80=_0x4a490d(0xb3));}_0x595304[_0x4a490d(0x9b)]({'sqlCode':_0x3bf05b[_0x4a490d(0xc4)],'sqlName':_0x3bf05b[_0x4a490d(0x8d)],'filePath':_0xf84928,'status':_0x2be09f,'reason':_0x532c80});}return{'method':'POST','url':_0x4a490d(0x91),'body':{'appCode':_0x2d4752['appCode'],'sqlCode':_0x2d4752[_0x4a490d(0xa8)]('sqlcode')||null,'sqlName':_0x2d4752['str']('name')||null,'files':_0x595304},'description':_0x4a490d(0xc2)+_0x595304[_0x4a490d(0xbf)]+_0x4a490d(0x98)+_0x31ec78[_0x4a490d(0xad)]};},async 'execute'(_0x31b16f){const _0x141bf9=a113_0x237711,_0x2ab250=loadSqlProjectConfig(_0x31b16f[_0x141bf9(0xaa)]),_0x5abfe1=await readSqlLockFile(_0x2ab250['lockFilePath']),{lockData:_0x219fce,appLock:_0x483e50}=ensureSqlLockScope(_0x5abfe1??createEmptySqlLock(),_0x2ab250[_0x141bf9(0xaa)],_0x2ab250[_0x141bf9(0xa2)],_0x141bf9(0x93)),_0x14638d=_0x31b16f[_0x141bf9(0xb9)]('force'),_0x3377ce=await fetchAllSqlQueries(_0x31b16f[_0x141bf9(0xaa)],{'sqlCode':_0x31b16f[_0x141bf9(0xa8)]('sqlcode')||undefined,'sqlName':_0x31b16f['str'](_0x141bf9(0xbe))||undefined});if(_0x3377ce[_0x141bf9(0xbf)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0xa6ed8d=[],_0x57483b=[];for(const _0x247b3e of _0x3377ce){try{_0xa6ed8d[_0x141bf9(0x9b)](await ensureSqlContent(_0x247b3e));}catch(_0x5c6ed0){_0x57483b['push']({'sqlCode':_0x247b3e[_0x141bf9(0xc4)],'error':_0x5c6ed0 instanceof Error?_0x5c6ed0[_0x141bf9(0xab)]:String(_0x5c6ed0)});}}if(_0x14638d&&!_0x31b16f[_0x141bf9(0xae)]){let _0x2a7883=![];for(const _0x148c82 of _0xa6ed8d){const _0x1d0f7e=detectModeFromSql(_0x148c82),_0x102fa5=_0x148c82[_0x141bf9(0x9e)]?await getDbName(_0x31b16f[_0x141bf9(0xaa)],Number(_0x148c82['dbId']))[_0x141bf9(0x9d)](()=>undefined):undefined,_0x5054b2=buildLocalSqlFileContent({'sqlCode':_0x148c82['sqlCode'],'sqlName':_0x148c82['sqlName'],'dbId':_0x148c82['dbId']},ensureRemoteSqlContent(_0x148c82),{'dbName':_0x102fa5,'mode':_0x1d0f7e,'syncedAt':new Date()[_0x141bf9(0xb1)](),'description':_0x148c82['description']}),_0x5473c3=resolveLocalSqlFilePath(_0x2ab250,_0x148c82['sqlCode'],buildSqlLockEntry(_0x148c82,ensureRemoteSqlContent(_0x148c82),'',{'dbName':_0x102fa5}));if(await fileExists(_0x5473c3)){const _0x5e3088=await readFile(_0x5473c3,_0x141bf9(0xa7));if(!isEquivalentPulledSqlFile(_0x5e3088,_0x5054b2,_0x1d0f7e)){_0x2a7883=!![];break;}}}if(_0x2a7883){const _0x42238b=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x42238b)throw CliErrors['cancelled'](_0x141bf9(0xb8));}}const _0x3442ee=cloneSqlLockData(_0x219fce),_0x5f447e=_0x3442ee[_0x141bf9(0xba)][_0x2ab250['appCode']],_0x34308e=[],_0x1c0361=[];for(const _0x9afa51 of _0xa6ed8d){const _0x3eafe1=_0x5f447e[_0x141bf9(0xb7)][_0x9afa51[_0x141bf9(0xc4)]],_0x392ce7=ensureRemoteSqlContent(_0x9afa51),_0x23b832=detectModeFromSql(_0x9afa51),_0x144f1a=_0x9afa51[_0x141bf9(0x9e)]?await getDbName(_0x31b16f[_0x141bf9(0xaa)],Number(_0x9afa51[_0x141bf9(0x9e)]))[_0x141bf9(0x9d)](()=>undefined):undefined,_0x287189=buildLocalSqlFileContent({'sqlCode':_0x9afa51['sqlCode'],'sqlName':_0x9afa51[_0x141bf9(0x8d)],'dbId':_0x9afa51[_0x141bf9(0x9e)]},_0x392ce7,{'dbName':_0x144f1a,'mode':_0x23b832,'syncedAt':new Date()[_0x141bf9(0xb1)](),'description':_0x9afa51[_0x141bf9(0xb2)]}),_0x33ce94=buildSqlLockEntry(_0x9afa51,_0x392ce7,computeSqlContentHash(_0x287189),{'dbName':_0x144f1a}),_0xda196=_0x33ce94[_0x141bf9(0xc7)],_0x248fe1=join(_0x2ab250['sqlRootDir'],_0xda196);try{if(await fileExists(_0x248fe1)){const _0x4f0343=await readFile(_0x248fe1,_0x141bf9(0xa7));if(isEquivalentPulledSqlFile(_0x4f0343,_0x287189,_0x23b832)){_0x1c0361[_0x141bf9(0x9b)]({'sqlCode':_0x9afa51[_0x141bf9(0xc4)],'reason':_0x141bf9(0xbc)}),_0x5f447e[_0x141bf9(0xb7)][_0x9afa51[_0x141bf9(0xc4)]]={..._0x33ce94,'hash':computeSqlContentHash(_0x4f0343),'path':_0xda196};continue;}if(!_0x14638d){_0x1c0361[_0x141bf9(0x9b)]({'sqlCode':_0x9afa51['sqlCode'],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x543fea=_0x3eafe1?.[_0x141bf9(0xc7)]?join(_0x2ab250[_0x141bf9(0xad)],_0x3eafe1[_0x141bf9(0xc7)]):undefined;_0x543fea&&_0x543fea!==_0x248fe1&&await fileExists(_0x543fea)&&await rm(_0x543fea,{'force':!![]}),await ensureParentDirectory(_0x248fe1),await writeFile(_0x248fe1,_0x287189,_0x141bf9(0xa7)),_0x5f447e[_0x141bf9(0xb7)][_0x9afa51[_0x141bf9(0xc4)]]={..._0x33ce94,'path':_0xda196},_0x34308e[_0x141bf9(0x9b)]({'sqlCode':_0x9afa51[_0x141bf9(0xc4)],'filePath':_0x248fe1});}catch(_0x4f3c2e){_0x57483b[_0x141bf9(0x9b)]({'sqlCode':_0x9afa51[_0x141bf9(0xc4)],'error':_0x4f3c2e instanceof Error?_0x4f3c2e[_0x141bf9(0xab)]:String(_0x4f3c2e)});}}return _0x5f447e[_0x141bf9(0x9f)]=new Date()['toISOString'](),await writeSqlLockFile(_0x2ab250[_0x141bf9(0xc6)],_0x3442ee),{'ok':_0x57483b['length']===0x0,'data':{'pulled':_0x34308e,'skipped':_0x1c0361,'failed':_0x57483b},'message':'Pull\x20complete:\x20'+_0x34308e['length']+_0x141bf9(0x94)+_0x1c0361[_0x141bf9(0xbf)]+'\x20skipped,\x20'+_0x57483b[_0x141bf9(0xbf)]+_0x141bf9(0x97)};}};function detectModeFromSql(_0x53fa27){const _0x488988=a113_0x237711,_0x223b2c=ensureRemoteSqlContent(_0x53fa27),_0x21257e=stripLocalSqlMetadata(_0x223b2c,_0x488988(0x99))['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x488988(0xa3)](_0x21257e))return _0x488988(0x99);return _0x488988(0xc1);}function isEquivalentPulledSqlFile(_0x30e85b,_0x3b27bc,_0x5ee305){return normalizePullComparableContent(_0x30e85b,_0x5ee305)===normalizePullComparableContent(_0x3b27bc,_0x5ee305);}function normalizePullComparableContent(_0x2254bd,_0x239d9a){const _0x302058=a113_0x237711,_0x2955e2=_0x2254bd[_0x302058(0x8f)](/\r\n/g,'\x0a')[_0x302058(0xb5)]('\x0a'),_0x159b95=_0x2955e2[_0x302058(0x9a)](_0x234b3d=>!isSyncedAtMetadataLine(_0x234b3d,_0x239d9a));return _0x159b95[_0x302058(0xac)]('\x0a');}function isSyncedAtMetadataLine(_0x4f1932,_0x5563f0){const _0x6abf0c=a113_0x237711;if(_0x5563f0===_0x6abf0c(0x99))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x4f1932);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x6abf0c(0xa3)](_0x4f1932);}
@@ -1 +1 @@
1
- const a110_0x2401b4=a110_0x1a57;(function(_0x2114c7,_0x5ef0e4){const _0x44e718=a110_0x1a57,_0x3df06d=_0x2114c7();while(!![]){try{const _0x1bd1b6=parseInt(_0x44e718(0x14d))/0x1*(parseInt(_0x44e718(0x150))/0x2)+parseInt(_0x44e718(0x13a))/0x3*(-parseInt(_0x44e718(0x172))/0x4)+parseInt(_0x44e718(0x146))/0x5*(parseInt(_0x44e718(0x167))/0x6)+-parseInt(_0x44e718(0x153))/0x7+-parseInt(_0x44e718(0x161))/0x8*(-parseInt(_0x44e718(0x142))/0x9)+-parseInt(_0x44e718(0x163))/0xa*(-parseInt(_0x44e718(0x14e))/0xb)+-parseInt(_0x44e718(0x140))/0xc;if(_0x1bd1b6===_0x5ef0e4)break;else _0x3df06d['push'](_0x3df06d['shift']());}catch(_0x312ae7){_0x3df06d['push'](_0x3df06d['shift']());}}}(a110_0x3920,0x3f3f4));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 a110_0x3920(){const _0x333151=['No\x20local\x20SQL\x20files\x20found.','validation','push','6973356biqqjk','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','180AWysvd','join','dbName','sqlRoot','5zdbyEi','exec','Would\x20push\x20','toISOString','get','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','catch','59zTQWBe','1786147qPjBDb','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','548TaSRex','str','/smartapi/custom/updateUserCustomSql','888048AGTPtT','startsWith','boolean','POST','path','filter','has','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','hash','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','filePath','projectRoot','remoteId','sqlName','92632lgUJkA','appCode','30AMisdW','sqlCode','Local\x20directory\x20\x22','Local\x20SQL\x20not\x20found:\x20','2246274QJmLeV','Push\x20complete:\x20','set','bool','relativePath','map','length','lockFilePath','force','sqlcode','sqlConfig','4gXXiEM','trashDir','dbId','sqlRootDir','\x20failed','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','\x20pushed,\x20','sql','isFinite','high-risk-write','426657fGQUNm','replace','sqls'];a110_0x3920=function(){return _0x333151;};return a110_0x3920();}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(_0x372616,_0x27c514,_0x11ee81){const _0x39622b=a110_0x1a57,_0x393bec=await scanLocalSqlQueries(_0x372616),_0x1e9e90=new Map();for(const _0x15c9a0 of _0x393bec){if(_0x11ee81&&_0x15c9a0[_0x39622b(0x164)]!==_0x11ee81)continue;const _0x1f64b5=_0x1e9e90[_0x39622b(0x14a)](_0x15c9a0[_0x39622b(0x164)])??[];_0x1f64b5[_0x39622b(0x13f)](_0x15c9a0),_0x1e9e90[_0x39622b(0x169)](_0x15c9a0[_0x39622b(0x164)],_0x1f64b5);}if(_0x11ee81&&!_0x1e9e90[_0x39622b(0x159)](_0x11ee81))throw CliErrors[_0x39622b(0x13e)](_0x39622b(0x166)+_0x11ee81);const _0x58f619=[];for(const [_0x216374,_0x28ca32]of _0x1e9e90['entries']()){if(_0x28ca32[_0x39622b(0x16d)]===0x1){_0x58f619['push'](_0x28ca32[0x0]);continue;}const _0xb78b80=_0x27c514[_0x39622b(0x13c)][_0x216374],_0x4dde5c=_0xb78b80?.['path'],_0x19b1be=_0x4dde5c?_0x28ca32['filter'](_0x4c0c49=>_0x4c0c49[_0x39622b(0x16b)]!==_0x4dde5c):_0x28ca32;if(_0xb78b80&&_0x19b1be[_0x39622b(0x16d)]===0x1){_0x58f619[_0x39622b(0x13f)](_0x19b1be[0x0]);continue;}throw CliErrors[_0x39622b(0x13e)](_0x39622b(0x14b)+_0x216374+_0x39622b(0x141));}return _0x58f619;}export const sqlPush={'service':a110_0x2401b4(0x137),'command':'push','description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a110_0x2401b4(0x139),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a110_0x2401b4(0x16f),'type':a110_0x2401b4(0x155),'description':a110_0x2401b4(0x15c)}],async 'dryRun'(_0x1f6ec0){const _0x344d1d=a110_0x2401b4,_0x4910e3=loadSqlProjectConfig(_0x1f6ec0[_0x344d1d(0x162)]),_0x42b486=await readSqlLockFile(_0x4910e3[_0x344d1d(0x16e)]),{appLock:_0x4d83d4}=ensureSqlLockScope(_0x42b486??createEmptySqlLock(),_0x1f6ec0[_0x344d1d(0x162)],_0x4910e3[_0x344d1d(0x145)],_0x344d1d(0x13f)),_0x4046c2=await getTargetSqlQueries(_0x4910e3,_0x4d83d4,_0x1f6ec0[_0x344d1d(0x151)](_0x344d1d(0x170))||undefined),_0x4c31bf=[];for(const _0x364c24 of _0x4046c2){const _0x1c7bb3=await computeSqlFileHash(_0x364c24['filePath']),_0x495b55=_0x4d83d4[_0x344d1d(0x13c)][_0x364c24[_0x344d1d(0x164)]],_0x5eada9=!!_0x495b55&&(_0x495b55[_0x344d1d(0x157)]!==_0x364c24[_0x344d1d(0x16b)]||!!_0x364c24[_0x344d1d(0x160)]&&_0x495b55[_0x344d1d(0x160)]!==_0x364c24[_0x344d1d(0x160)]);if(!_0x1f6ec0['bool'](_0x344d1d(0x16f))&&_0x495b55&&_0x495b55[_0x344d1d(0x15b)]===_0x1c7bb3&&!_0x5eada9)continue;_0x4c31bf[_0x344d1d(0x13f)](_0x364c24[_0x344d1d(0x164)]);}return{'method':_0x344d1d(0x156),'url':_0x344d1d(0x152),'body':{'sqlCodes':_0x4c31bf,'appCode':_0x1f6ec0[_0x344d1d(0x162)]},'description':_0x344d1d(0x148)+_0x4c31bf[_0x344d1d(0x16d)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x2d8950){const _0xcb49b2=a110_0x2401b4,_0x391711=loadSqlProjectConfig(_0x2d8950[_0xcb49b2(0x162)]),_0x3e1319=await readSqlLockFile(_0x391711['lockFilePath']),{lockData:_0x58e776,appLock:_0x347a06}=ensureSqlLockScope(_0x3e1319??createEmptySqlLock(),_0x2d8950[_0xcb49b2(0x162)],_0x391711[_0xcb49b2(0x145)],_0xcb49b2(0x13f)),_0x188c62=await getTargetSqlQueries(_0x391711,_0x347a06,_0x2d8950[_0xcb49b2(0x151)]('sqlcode')||undefined);if(_0x188c62[_0xcb49b2(0x16d)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xcb49b2(0x13d)};const _0x3556ac=[],_0x52123f=[],_0x3d34a9=[];for(const _0x3fa9d4 of _0x188c62){const _0x2b20ed=_0x347a06[_0xcb49b2(0x13c)][_0x3fa9d4['sqlCode']];if(!_0x2b20ed){_0x3d34a9['push']({'sqlCode':_0x3fa9d4[_0xcb49b2(0x164)],'error':_0xcb49b2(0x14f)});continue;}try{const _0x3cc619=await computeSqlFileHash(_0x3fa9d4[_0xcb49b2(0x15d)]),_0x4a7ef3=_0x2b20ed[_0xcb49b2(0x157)]!==_0x3fa9d4[_0xcb49b2(0x16b)]||!!_0x3fa9d4[_0xcb49b2(0x160)]&&_0x2b20ed['sqlName']!==_0x3fa9d4['sqlName'];if(!_0x2d8950[_0xcb49b2(0x16a)]('force')&&_0x2b20ed[_0xcb49b2(0x15b)]===_0x3cc619&&!_0x4a7ef3){_0x52123f[_0xcb49b2(0x13f)]({'sqlCode':_0x3fa9d4[_0xcb49b2(0x164)],'reason':'unchanged'});continue;}if(_0x2b20ed['version']==null){_0x3d34a9[_0xcb49b2(0x13f)]({'sqlCode':_0x3fa9d4[_0xcb49b2(0x164)],'error':_0xcb49b2(0x15a)});continue;}const _0x155144=await readFile(_0x3fa9d4[_0xcb49b2(0x15d)],'utf8'),_0x5f4c7c=stripLocalSqlMetadata(_0x155144,_0x3fa9d4['mode']),_0x255b85=_0x3fa9d4[_0xcb49b2(0x160)]||_0x2b20ed[_0xcb49b2(0x160)],_0x422758=await resolveTargetDbBinding(_0x2d8950[_0xcb49b2(0x162)],_0x3fa9d4,_0x2b20ed),_0x7ac178=await updateSqlQuery({'id':_0x2b20ed[_0xcb49b2(0x15f)],'appCode':_0x2d8950[_0xcb49b2(0x162)],'sqlCode':_0x3fa9d4[_0xcb49b2(0x164)],'sqlName':_0x255b85,'dbId':_0x422758[_0xcb49b2(0x174)],'version':_0x2b20ed['version'],'sqlContent':_0x5f4c7c,'sqlConfig':_0x2b20ed[_0xcb49b2(0x171)]??undefined}),_0x3fd82e=_0x7ac178[_0xcb49b2(0x174)]?await getDbName(_0x2d8950[_0xcb49b2(0x162)],Number(_0x7ac178['dbId']))[_0xcb49b2(0x14c)](()=>_0x422758[_0xcb49b2(0x144)]):_0x422758[_0xcb49b2(0x144)];_0x347a06[_0xcb49b2(0x13c)][_0x3fa9d4[_0xcb49b2(0x164)]]={...buildSqlLockEntry(_0x7ac178,_0x5f4c7c,_0x3cc619,{'dbName':_0x3fd82e}),'path':_0x3fa9d4[_0xcb49b2(0x16b)],'mode':_0x2b20ed['mode']},await archivePreviousSqlFileIfNeeded(_0x391711,_0x2b20ed[_0xcb49b2(0x157)],_0x3fa9d4[_0xcb49b2(0x16b)]),_0x3556ac['push']({'sqlCode':_0x3fa9d4[_0xcb49b2(0x164)],'remoteId':_0x2b20ed[_0xcb49b2(0x15f)]});}catch(_0x39149a){_0x3d34a9[_0xcb49b2(0x13f)]({'sqlCode':_0x3fa9d4['sqlCode'],'error':_0x39149a instanceof Error?_0x39149a['message']:String(_0x39149a)});}}return _0x347a06['lastSync']=new Date()[_0xcb49b2(0x149)](),await writeSqlLockFile(_0x391711[_0xcb49b2(0x16e)],_0x58e776),{'ok':_0x3d34a9['length']===0x0,'data':{'pushed':_0x3556ac,'skipped':_0x52123f,'failed':_0x3d34a9},'message':_0xcb49b2(0x168)+_0x3556ac[_0xcb49b2(0x16d)]+_0xcb49b2(0x136)+_0x52123f['length']+'\x20skipped,\x20'+_0x3d34a9[_0xcb49b2(0x16d)]+_0xcb49b2(0x176)};}};async function archivePreviousSqlFileIfNeeded(_0x1f2d59,_0x35ca3c,_0x45cc9d){const _0x15d57c=a110_0x2401b4;if(!_0x35ca3c||_0x35ca3c===_0x45cc9d)return;const _0x27cbcb=join(_0x1f2d59[_0x15d57c(0x175)],_0x35ca3c);if(!await fileExists(_0x27cbcb))return;const _0x42d422=await moveToTrash(_0x1f2d59[_0x15d57c(0x15e)],_0x1f2d59[_0x15d57c(0x173)],_0x27cbcb);await cleanupEmptyDirectories(dirname(_0x27cbcb),_0x1f2d59[_0x15d57c(0x175)]),void _0x42d422;}async function moveToTrash(_0x474459,_0x3ecc40,_0x186118){const _0x3c0f56=a110_0x2401b4,_0x1c0e98=new Date()[_0x3c0f56(0x149)]()[_0x3c0f56(0x13b)](/[:.]/g,'-'),_0x50f561=relative(_0x474459,_0x186118),_0x8603a6=join(_0x3ecc40,_0x1c0e98,_0x50f561);return await mkdir(dirname(_0x8603a6),{'recursive':!![]}),await rename(_0x186118,_0x8603a6),_0x8603a6;}async function cleanupEmptyDirectories(_0x53a373,_0x21a6b6){const _0x181516=a110_0x2401b4;let _0x1b7c88=resolve(_0x53a373);const _0x41d6db=resolve(_0x21a6b6);while(_0x1b7c88[_0x181516(0x154)](''+_0x41d6db+sep)||_0x1b7c88===_0x41d6db){if(_0x1b7c88===_0x41d6db)return;try{const _0x30dacb=await readdir(_0x1b7c88);if(_0x30dacb[_0x181516(0x16d)]>0x0)return;await rmdir(_0x1b7c88);}catch{return;}_0x1b7c88=dirname(_0x1b7c88);}}function a110_0x1a57(_0x3222a7,_0x49e2c3){_0x3222a7=_0x3222a7-0x135;const _0x39203a=a110_0x3920();let _0x1a573e=_0x39203a[_0x3222a7];return _0x1a573e;}async function resolveTargetDbBinding(_0x3671ff,_0x40d837,_0x13e4a1){const _0x38558a=a110_0x2401b4,_0x7fc01c=_0x40d837['dbDirectory'];if(!_0x7fc01c)return{'dbId':_0x13e4a1[_0x38558a(0x174)],'dbName':_0x13e4a1[_0x38558a(0x144)]};const _0x468c0e=buildDbDirectoryName(_0x13e4a1[_0x38558a(0x144)],_0x13e4a1[_0x38558a(0x174)]);if(_0x7fc01c===_0x468c0e)return{'dbId':_0x13e4a1[_0x38558a(0x174)],'dbName':_0x13e4a1[_0x38558a(0x144)]};const _0x277f1a=parseExplicitDbDirectory(_0x7fc01c);if(_0x277f1a!=null)return{'dbId':_0x277f1a,'dbName':await getDbName(_0x3671ff,_0x277f1a)[_0x38558a(0x14c)](()=>undefined)};const _0x9411d4=await listDatabases(_0x3671ff),_0x347b8b=_0x9411d4[_0x38558a(0x158)](_0x11747c=>buildDbDirectoryName(_0x11747c[_0x38558a(0x144)],_0x11747c[_0x38558a(0x174)])===_0x7fc01c);if(_0x347b8b[_0x38558a(0x16d)]===0x1)return{'dbId':_0x347b8b[0x0][_0x38558a(0x174)],'dbName':_0x347b8b[0x0]['dbName']};if(_0x347b8b[_0x38558a(0x16d)]===0x0)throw CliErrors[_0x38558a(0x13e)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x7fc01c+'\x22\x20for\x20sqlCode\x20'+_0x40d837[_0x38558a(0x164)]+'.');const _0x4bdaa5=_0x347b8b[_0x38558a(0x16c)](_0x16e69c=>_0x16e69c[_0x38558a(0x144)]+'\x20('+_0x16e69c[_0x38558a(0x174)]+')')[_0x38558a(0x143)](',\x20');throw CliErrors[_0x38558a(0x13e)](_0x38558a(0x165)+_0x7fc01c+_0x38558a(0x135)+_0x40d837['sqlCode']+':\x20'+_0x4bdaa5);}function parseExplicitDbDirectory(_0x1553ed){const _0x2bede1=a110_0x2401b4,_0x34566c=/^db-(\d+)$/[_0x2bede1(0x147)](_0x1553ed);if(!_0x34566c)return null;const _0x5ed136=Number(_0x34566c[0x1]);return Number[_0x2bede1(0x138)](_0x5ed136)&&_0x5ed136>0x0?_0x5ed136:null;}
1
+ const a114_0x222851=a114_0x3886;(function(_0x2cce32,_0x589a73){const _0x19c501=a114_0x3886,_0x2dbdd9=_0x2cce32();while(!![]){try{const _0x163811=parseInt(_0x19c501(0xa7))/0x1*(parseInt(_0x19c501(0xa6))/0x2)+parseInt(_0x19c501(0xa8))/0x3+parseInt(_0x19c501(0x8b))/0x4+-parseInt(_0x19c501(0x87))/0x5*(parseInt(_0x19c501(0x91))/0x6)+parseInt(_0x19c501(0xad))/0x7+parseInt(_0x19c501(0x90))/0x8+-parseInt(_0x19c501(0xa4))/0x9;if(_0x163811===_0x589a73)break;else _0x2dbdd9['push'](_0x2dbdd9['shift']());}catch(_0x50c034){_0x2dbdd9['push'](_0x2dbdd9['shift']());}}}(a114_0x5632,0x33704));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';function a114_0x5632(){const _0x380914=['550800EdSdLx','POST','sqlCode','\x20failed','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','1504790kIRSao','sqlcode','sqlName','Push\x20local\x20SQL\x20files\x20to\x20remote','appCode','toISOString','\x22\x20for\x20sqlCode\x20','/smartapi/custom/updateUserCustomSql','isFinite','path','bool','entries','mode','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','sqlConfig','lockFilePath','projectRoot','has','sqlRoot','catch','\x20pushed,\x20','No\x20local\x20SQL\x20files\x20found.','dbDirectory','Push\x20complete:\x20','relativePath','sqls','Local\x20SQL\x20not\x20found:\x20','Local\x20directory\x20\x22','join','450hjEJXx','version','utf8','validation','1450960eVeqsd','replace','remoteId','exec','\x20skipped,\x20','3075864CrjrZA','750LrVwUa','boolean','sqlRootDir','map','Would\x20push\x20','filePath','set','push','force','high-risk-write','unchanged','filter','\x20SQL\x20file(s)','dbName','dbId','sql','length','trashDir','get','11486196myMrUh','hash','37094FNWPma','19XWuNlm'];a114_0x5632=function(){return _0x380914;};return a114_0x5632();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';function a114_0x3886(_0x257883,_0x2ccd93){_0x257883=_0x257883-0x74;const _0x56324f=a114_0x5632();let _0x388647=_0x56324f[_0x257883];return _0x388647;}async function getTargetSqlQueries(_0x27c7e5,_0x4bd2da,_0x1e4990){const _0x18c583=a114_0x3886,_0x240fcd=await scanLocalSqlQueries(_0x27c7e5),_0x234359=new Map();for(const _0x372652 of _0x240fcd){if(_0x1e4990&&_0x372652[_0x18c583(0xaa)]!==_0x1e4990)continue;const _0x52ba74=_0x234359[_0x18c583(0xa3)](_0x372652[_0x18c583(0xaa)])??[];_0x52ba74['push'](_0x372652),_0x234359[_0x18c583(0x97)](_0x372652[_0x18c583(0xaa)],_0x52ba74);}if(_0x1e4990&&!_0x234359[_0x18c583(0x7b)](_0x1e4990))throw CliErrors['validation'](_0x18c583(0x84)+_0x1e4990);const _0x30651c=[];for(const [_0x347d0e,_0x5b3884]of _0x234359[_0x18c583(0x75)]()){if(_0x5b3884[_0x18c583(0xa1)]===0x1){_0x30651c[_0x18c583(0x98)](_0x5b3884[0x0]);continue;}const _0x27cc7e=_0x4bd2da[_0x18c583(0x83)][_0x347d0e],_0x4279fa=_0x27cc7e?.['path'],_0x8b67d0=_0x4279fa?_0x5b3884[_0x18c583(0x9c)](_0x301f91=>_0x301f91[_0x18c583(0x82)]!==_0x4279fa):_0x5b3884;if(_0x27cc7e&&_0x8b67d0['length']===0x1){_0x30651c[_0x18c583(0x98)](_0x8b67d0[0x0]);continue;}throw CliErrors[_0x18c583(0x8a)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x347d0e+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x30651c;}export const sqlPush={'service':a114_0x222851(0xa0),'command':a114_0x222851(0x98),'description':a114_0x222851(0xb0),'risk':a114_0x222851(0x9a),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a114_0x222851(0x99),'type':a114_0x222851(0x92),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x216d3d){const _0x4fd5bb=a114_0x222851,_0x53a0f7=loadSqlProjectConfig(_0x216d3d[_0x4fd5bb(0xb1)]),_0x5f2a89=await readSqlLockFile(_0x53a0f7[_0x4fd5bb(0x79)]),{appLock:_0x58092c}=ensureSqlLockScope(_0x5f2a89??createEmptySqlLock(),_0x216d3d[_0x4fd5bb(0xb1)],_0x53a0f7[_0x4fd5bb(0x7c)],'push'),_0x1eda40=await getTargetSqlQueries(_0x53a0f7,_0x58092c,_0x216d3d['str'](_0x4fd5bb(0xae))||undefined),_0x2fa5de=[];for(const _0x8aa49a of _0x1eda40){const _0x597677=await computeSqlFileHash(_0x8aa49a[_0x4fd5bb(0x96)]),_0x277ab0=_0x58092c['sqls'][_0x8aa49a[_0x4fd5bb(0xaa)]],_0x3e9717=!!_0x277ab0&&(_0x277ab0[_0x4fd5bb(0xb6)]!==_0x8aa49a[_0x4fd5bb(0x82)]||!!_0x8aa49a[_0x4fd5bb(0xaf)]&&_0x277ab0[_0x4fd5bb(0xaf)]!==_0x8aa49a[_0x4fd5bb(0xaf)]);if(!_0x216d3d[_0x4fd5bb(0x74)](_0x4fd5bb(0x99))&&_0x277ab0&&_0x277ab0[_0x4fd5bb(0xa5)]===_0x597677&&!_0x3e9717)continue;_0x2fa5de['push'](_0x8aa49a[_0x4fd5bb(0xaa)]);}return{'method':_0x4fd5bb(0xa9),'url':_0x4fd5bb(0xb4),'body':{'sqlCodes':_0x2fa5de,'appCode':_0x216d3d[_0x4fd5bb(0xb1)]},'description':_0x4fd5bb(0x95)+_0x2fa5de['length']+_0x4fd5bb(0x9d)};},async 'execute'(_0x2691f6){const _0x4dbb73=a114_0x222851,_0x2ece94=loadSqlProjectConfig(_0x2691f6[_0x4dbb73(0xb1)]),_0x69a5e8=await readSqlLockFile(_0x2ece94[_0x4dbb73(0x79)]),{lockData:_0x29d57f,appLock:_0x152272}=ensureSqlLockScope(_0x69a5e8??createEmptySqlLock(),_0x2691f6['appCode'],_0x2ece94[_0x4dbb73(0x7c)],_0x4dbb73(0x98)),_0x462a07=await getTargetSqlQueries(_0x2ece94,_0x152272,_0x2691f6['str'](_0x4dbb73(0xae))||undefined);if(_0x462a07[_0x4dbb73(0xa1)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x4dbb73(0x7f)};const _0x3575d6=[],_0x1c04c1=[],_0x1b0c83=[];for(const _0x5e270f of _0x462a07){const _0x10b764=_0x152272[_0x4dbb73(0x83)][_0x5e270f['sqlCode']];if(!_0x10b764){_0x1b0c83[_0x4dbb73(0x98)]({'sqlCode':_0x5e270f[_0x4dbb73(0xaa)],'error':_0x4dbb73(0x77)});continue;}try{const _0x542ad0=await computeSqlFileHash(_0x5e270f[_0x4dbb73(0x96)]),_0x45ad30=_0x10b764[_0x4dbb73(0xb6)]!==_0x5e270f[_0x4dbb73(0x82)]||!!_0x5e270f['sqlName']&&_0x10b764[_0x4dbb73(0xaf)]!==_0x5e270f[_0x4dbb73(0xaf)];if(!_0x2691f6[_0x4dbb73(0x74)](_0x4dbb73(0x99))&&_0x10b764[_0x4dbb73(0xa5)]===_0x542ad0&&!_0x45ad30){_0x1c04c1[_0x4dbb73(0x98)]({'sqlCode':_0x5e270f[_0x4dbb73(0xaa)],'reason':_0x4dbb73(0x9b)});continue;}if(_0x10b764[_0x4dbb73(0x88)]==null){_0x1b0c83['push']({'sqlCode':_0x5e270f['sqlCode'],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x4dc323=await readFile(_0x5e270f[_0x4dbb73(0x96)],_0x4dbb73(0x89)),_0x445fbf=stripLocalSqlMetadata(_0x4dc323,_0x5e270f[_0x4dbb73(0x76)]),_0x43aa29=_0x5e270f[_0x4dbb73(0xaf)]||_0x10b764[_0x4dbb73(0xaf)],_0x193548=await resolveTargetDbBinding(_0x2691f6[_0x4dbb73(0xb1)],_0x5e270f,_0x10b764),_0x210f9d=await updateSqlQuery({'id':_0x10b764['remoteId'],'appCode':_0x2691f6[_0x4dbb73(0xb1)],'sqlCode':_0x5e270f['sqlCode'],'sqlName':_0x43aa29,'dbId':_0x193548['dbId'],'version':_0x10b764[_0x4dbb73(0x88)],'sqlContent':_0x445fbf,'sqlConfig':_0x10b764[_0x4dbb73(0x78)]??undefined}),_0x53ef2=_0x210f9d[_0x4dbb73(0x9f)]?await getDbName(_0x2691f6[_0x4dbb73(0xb1)],Number(_0x210f9d[_0x4dbb73(0x9f)]))[_0x4dbb73(0x7d)](()=>_0x193548[_0x4dbb73(0x9e)]):_0x193548[_0x4dbb73(0x9e)];_0x152272[_0x4dbb73(0x83)][_0x5e270f[_0x4dbb73(0xaa)]]={...buildSqlLockEntry(_0x210f9d,_0x445fbf,_0x542ad0,{'dbName':_0x53ef2}),'path':_0x5e270f['relativePath'],'mode':_0x10b764['mode']},await archivePreviousSqlFileIfNeeded(_0x2ece94,_0x10b764[_0x4dbb73(0xb6)],_0x5e270f[_0x4dbb73(0x82)]),_0x3575d6[_0x4dbb73(0x98)]({'sqlCode':_0x5e270f[_0x4dbb73(0xaa)],'remoteId':_0x10b764[_0x4dbb73(0x8d)]});}catch(_0x2a2cbe){_0x1b0c83['push']({'sqlCode':_0x5e270f[_0x4dbb73(0xaa)],'error':_0x2a2cbe instanceof Error?_0x2a2cbe['message']:String(_0x2a2cbe)});}}return _0x152272['lastSync']=new Date()[_0x4dbb73(0xb2)](),await writeSqlLockFile(_0x2ece94[_0x4dbb73(0x79)],_0x29d57f),{'ok':_0x1b0c83[_0x4dbb73(0xa1)]===0x0,'data':{'pushed':_0x3575d6,'skipped':_0x1c04c1,'failed':_0x1b0c83},'message':_0x4dbb73(0x81)+_0x3575d6[_0x4dbb73(0xa1)]+_0x4dbb73(0x7e)+_0x1c04c1[_0x4dbb73(0xa1)]+_0x4dbb73(0x8f)+_0x1b0c83[_0x4dbb73(0xa1)]+_0x4dbb73(0xab)};}};async function archivePreviousSqlFileIfNeeded(_0x4c1c72,_0x4986bc,_0x3acac6){const _0x498ff5=a114_0x222851;if(!_0x4986bc||_0x4986bc===_0x3acac6)return;const _0x5980d5=join(_0x4c1c72[_0x498ff5(0x93)],_0x4986bc);if(!await fileExists(_0x5980d5))return;const _0x3d31c5=await moveToTrash(_0x4c1c72[_0x498ff5(0x7a)],_0x4c1c72[_0x498ff5(0xa2)],_0x5980d5);await cleanupEmptyDirectories(dirname(_0x5980d5),_0x4c1c72['sqlRootDir']),void _0x3d31c5;}async function moveToTrash(_0x38fd13,_0x52b868,_0x50d785){const _0x251012=a114_0x222851,_0x410596=new Date()['toISOString']()[_0x251012(0x8c)](/[:.]/g,'-'),_0x2ad52c=relative(_0x38fd13,_0x50d785),_0x53c800=join(_0x52b868,_0x410596,_0x2ad52c);return await mkdir(dirname(_0x53c800),{'recursive':!![]}),await rename(_0x50d785,_0x53c800),_0x53c800;}async function cleanupEmptyDirectories(_0x2fedb8,_0x380f52){const _0x2ea7e8=a114_0x222851;let _0xf1a4e=resolve(_0x2fedb8);const _0x333c2e=resolve(_0x380f52);while(_0xf1a4e['startsWith'](''+_0x333c2e+sep)||_0xf1a4e===_0x333c2e){if(_0xf1a4e===_0x333c2e)return;try{const _0x44441f=await readdir(_0xf1a4e);if(_0x44441f[_0x2ea7e8(0xa1)]>0x0)return;await rmdir(_0xf1a4e);}catch{return;}_0xf1a4e=dirname(_0xf1a4e);}}async function resolveTargetDbBinding(_0x111fac,_0x35ae22,_0x2b5146){const _0x50e864=a114_0x222851,_0x34dd89=_0x35ae22[_0x50e864(0x80)];if(!_0x34dd89)return{'dbId':_0x2b5146['dbId'],'dbName':_0x2b5146[_0x50e864(0x9e)]};const _0x59da8f=buildDbDirectoryName(_0x2b5146['dbName'],_0x2b5146[_0x50e864(0x9f)]);if(_0x34dd89===_0x59da8f)return{'dbId':_0x2b5146['dbId'],'dbName':_0x2b5146[_0x50e864(0x9e)]};const _0x14d05d=parseExplicitDbDirectory(_0x34dd89);if(_0x14d05d!=null)return{'dbId':_0x14d05d,'dbName':await getDbName(_0x111fac,_0x14d05d)[_0x50e864(0x7d)](()=>undefined)};const _0x299c86=await listDatabases(_0x111fac),_0x345814=_0x299c86[_0x50e864(0x9c)](_0x5f456b=>buildDbDirectoryName(_0x5f456b[_0x50e864(0x9e)],_0x5f456b[_0x50e864(0x9f)])===_0x34dd89);if(_0x345814[_0x50e864(0xa1)]===0x1)return{'dbId':_0x345814[0x0][_0x50e864(0x9f)],'dbName':_0x345814[0x0][_0x50e864(0x9e)]};if(_0x345814[_0x50e864(0xa1)]===0x0)throw CliErrors[_0x50e864(0x8a)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x34dd89+_0x50e864(0xb3)+_0x35ae22['sqlCode']+'.');const _0x689d7f=_0x345814[_0x50e864(0x94)](_0x33bddd=>_0x33bddd[_0x50e864(0x9e)]+'\x20('+_0x33bddd[_0x50e864(0x9f)]+')')[_0x50e864(0x86)](',\x20');throw CliErrors[_0x50e864(0x8a)](_0x50e864(0x85)+_0x34dd89+_0x50e864(0xac)+_0x35ae22['sqlCode']+':\x20'+_0x689d7f);}function parseExplicitDbDirectory(_0x2e0e00){const _0x261865=a114_0x222851,_0xd344d7=/^db-(\d+)$/[_0x261865(0x8e)](_0x2e0e00);if(!_0xd344d7)return null;const _0x300057=Number(_0xd344d7[0x1]);return Number[_0x261865(0xb5)](_0x300057)&&_0x300057>0x0?_0x300057:null;}
@@ -1 +1 @@
1
- const a111_0x726744=a111_0x374f;function a111_0x2dec(){const _0x3ec8bb=['208326QovJMn','join','sql','validation','725238muhwmf','description','919110NGoqbB','540932QTRtom','1890110PWFjEm','Query\x20description','file','string','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`.','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','sqlname','SQL\x20query\x20display\x20name','2341232fuuCvk','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','14JSiSHC','18290UDhGTz'];a111_0x2dec=function(){return _0x3ec8bb;};return a111_0x2dec();}(function(_0x2de33e,_0x2dc726){const _0x4d4caf=a111_0x374f,_0x35cbd0=_0x2de33e();while(!![]){try{const _0x39bc7c=parseInt(_0x4d4caf(0x1ad))/0x1+parseInt(_0x4d4caf(0x1b2))/0x2+-parseInt(_0x4d4caf(0x1ae))/0x3+-parseInt(_0x4d4caf(0x1a0))/0x4+-parseInt(_0x4d4caf(0x1a1))/0x5+-parseInt(_0x4d4caf(0x1b4))/0x6+-parseInt(_0x4d4caf(0x1ac))/0x7*(-parseInt(_0x4d4caf(0x1a9))/0x8);if(_0x39bc7c===_0x2dc726)break;else _0x35cbd0['push'](_0x35cbd0['shift']());}catch(_0xd8256c){_0x35cbd0['push'](_0x35cbd0['shift']());}}}(a111_0x2dec,0x383bf));import{CliErrors}from'../../errors.js';function a111_0x374f(_0x54324f,_0x90f94e){_0x54324f=_0x54324f-0x1a0;const _0x2decfc=a111_0x2dec();let _0x374ff5=_0x2decfc[_0x54324f];return _0x374ff5;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a111_0x726744(0x1aa),a111_0x726744(0x1ab),a111_0x726744(0x1a5)][a111_0x726744(0x1af)]('\x0a');export const sqlSave={'service':a111_0x726744(0x1b0),'command':'save','description':a111_0x726744(0x1a6),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a111_0x726744(0x1a3),'type':'string','required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':a111_0x726744(0x1a7),'type':'string','description':a111_0x726744(0x1a8)},{'name':'db','type':a111_0x726744(0x1a4),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':a111_0x726744(0x1b3),'type':a111_0x726744(0x1a4),'description':a111_0x726744(0x1a2)}],async 'validate'(){const _0x226762=a111_0x726744;throw CliErrors[_0x226762(0x1b1)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x3bfe5b=a111_0x726744;throw CliErrors[_0x3bfe5b(0x1b1)](SQL_SAVE_DEPRECATED_HINT);}};
1
+ const a115_0x3bdbbe=a115_0x9a8d;function a115_0x9a8d(_0x56a2b7,_0x530772){_0x56a2b7=_0x56a2b7-0x1d9;const _0x286404=a115_0x2864();let _0x9a8d15=_0x286404[_0x56a2b7];return _0x9a8d15;}(function(_0x1de5a4,_0x53dd58){const _0x12337f=a115_0x9a8d,_0x47ab93=_0x1de5a4();while(!![]){try{const _0x6cd7cb=-parseInt(_0x12337f(0x1eb))/0x1*(parseInt(_0x12337f(0x1e4))/0x2)+-parseInt(_0x12337f(0x1e5))/0x3+-parseInt(_0x12337f(0x1e6))/0x4*(parseInt(_0x12337f(0x1ed))/0x5)+parseInt(_0x12337f(0x1db))/0x6+parseInt(_0x12337f(0x1df))/0x7+parseInt(_0x12337f(0x1e3))/0x8+-parseInt(_0x12337f(0x1d9))/0x9*(parseInt(_0x12337f(0x1e9))/0xa);if(_0x6cd7cb===_0x53dd58)break;else _0x47ab93['push'](_0x47ab93['shift']());}catch(_0x1d218a){_0x47ab93['push'](_0x47ab93['shift']());}}}(a115_0x2864,0xa0022));import{CliErrors}from'../../errors.js';function a115_0x2864(){const _0x4dca22=['203wsDoRf','file','65paDADr','2782161MhaNKQ','validation','3592656mXEcEt','save','sqlname','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','2801288NPKMms','description','Path\x20to\x20the\x20SQL\x20file','Query\x20description','7409864OqtyUb','2496nMrAyO','991056VnNxFc','115992WHfBSf','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`.','string','10COhAHx','SQL\x20query\x20display\x20name'];a115_0x2864=function(){return _0x4dca22;};return a115_0x2864();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=['`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.',a115_0x3bdbbe(0x1de),a115_0x3bdbbe(0x1e7)]['join']('\x0a');export const sqlSave={'service':'sql','command':a115_0x3bdbbe(0x1dc),'description':'Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a115_0x3bdbbe(0x1ec),'type':a115_0x3bdbbe(0x1e8),'required':!![],'description':a115_0x3bdbbe(0x1e1)},SQLCODE_FLAG_OPTIONAL,{'name':a115_0x3bdbbe(0x1dd),'type':'string','description':a115_0x3bdbbe(0x1ea)},{'name':'db','type':a115_0x3bdbbe(0x1e8),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':a115_0x3bdbbe(0x1e0),'type':a115_0x3bdbbe(0x1e8),'description':a115_0x3bdbbe(0x1e2)}],async 'validate'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x14f0d1=a115_0x3bdbbe;throw CliErrors[_0x14f0d1(0x1da)](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- const a112_0x1b317b=a112_0x27af;(function(_0x2026b8,_0x291d6e){const _0x18969d=a112_0x27af,_0x380120=_0x2026b8();while(!![]){try{const _0x2d5ad3=parseInt(_0x18969d(0x202))/0x1+-parseInt(_0x18969d(0x1ff))/0x2*(-parseInt(_0x18969d(0x20b))/0x3)+-parseInt(_0x18969d(0x20d))/0x4+parseInt(_0x18969d(0x1f1))/0x5+parseInt(_0x18969d(0x1fb))/0x6*(parseInt(_0x18969d(0x1f7))/0x7)+-parseInt(_0x18969d(0x1f3))/0x8*(-parseInt(_0x18969d(0x210))/0x9)+-parseInt(_0x18969d(0x1f6))/0xa;if(_0x2d5ad3===_0x291d6e)break;else _0x380120['push'](_0x380120['shift']());}catch(_0x136030){_0x380120['push'](_0x380120['shift']());}}}(a112_0x16b2,0xaee2d));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=a112_0x1b317b(0x20f);export function buildSqlLockEntry(_0x20ea00,_0x42c54d,_0x5d2b1b,_0x55ee2e){const _0x5be269=a112_0x1b317b,_0x154908=detectSqlMode(_0x42c54d);return{'path':buildSqlRelativePath(_0x20ea00['sqlCode'],_0x20ea00[_0x5be269(0x1fa)],_0x55ee2e?.[_0x5be269(0x20e)],_0x154908,_0x20ea00[_0x5be269(0x217)]),'hash':_0x5d2b1b,'remoteId':_0x20ea00['id'],'version':_0x20ea00[_0x5be269(0x1f5)],'dbId':Number(_0x20ea00[_0x5be269(0x217)]),'dbName':_0x55ee2e?.['dbName'],'sqlName':_0x20ea00[_0x5be269(0x1fa)],'sqlConfig':_0x20ea00[_0x5be269(0x1f4)]??undefined,'mode':_0x154908};}export function cloneSqlLockData(_0x49a05c){const _0x5a09e4=a112_0x1b317b;return{'apps':Object['fromEntries'](Object[_0x5a09e4(0x211)](_0x49a05c[_0x5a09e4(0x20c)])[_0x5a09e4(0x200)](([_0x11e7c9,_0x3b8898])=>[_0x11e7c9,{'sqlRoot':_0x3b8898[_0x5a09e4(0x201)],'lastSync':_0x3b8898[_0x5a09e4(0x20a)],'sqls':{..._0x3b8898[_0x5a09e4(0x214)]}}]))};}function a112_0x16b2(){const _0x3e5d7d=['mode','description','\x20-->','mybatisXml','question','endsWith','lastSync','849XLvddX','apps','3344548jobxta','dbName','.rabetbase/sql','17199RgcZfG','entries','syncedAt','\x20[y/N]\x20','sqls','path','filter','dbId','<!--\x20@lovrabet.','2216680TrokGy','trim','112wvAtvV','sqlConfig','version','15497960zgaNTL','7742XFVpMP','join','stderr','sqlName','4542ChbNRV','--\x20@lovrabet.','length','test','7926Bbzejt','map','sqlRoot','673405bAbloH','sqlCode'];a112_0x16b2=function(){return _0x3e5d7d;};return a112_0x16b2();}export function ensureRemoteSqlContent(_0x3c6347){return _0x3c6347['sqlContent']??'';}export function buildLocalSqlFileContent(_0x58d99c,_0x4e0d4d,_0x554eba){const _0x47d481=a112_0x1b317b,_0x29f5eb=_0x554eba?.[_0x47d481(0x204)]??detectSqlMode(_0x4e0d4d),_0xcb664a=stripLocalSqlMetadata(_0x4e0d4d,_0x29f5eb)['trim'](),_0x3e5b9c=[...buildMetadataHeaderLines({'sqlCode':_0x58d99c[_0x47d481(0x203)],'sqlName':_0x58d99c[_0x47d481(0x1fa)],'dbId':_0x58d99c[_0x47d481(0x217)],'dbName':_0x554eba?.[_0x47d481(0x20e)],'mode':_0x29f5eb,'syncedAt':_0x554eba?.[_0x47d481(0x212)],'description':_0x554eba?.[_0x47d481(0x205)]},_0x29f5eb),'',_0xcb664a],_0x368891=_0x3e5b9c['join']('\x0a');return _0x368891[_0x47d481(0x209)]('\x0a')?_0x368891:_0x368891+'\x0a';}function a112_0x27af(_0x1ae070,_0x98893a){_0x1ae070=_0x1ae070-0x1f1;const _0x16b203=a112_0x16b2();let _0x27afdb=_0x16b203[_0x1ae070];return _0x27afdb;}export function stripLocalSqlMetadata(_0x56faf6,_0x4049ed){const _0x5181f0=a112_0x1b317b,_0x267161=_0x56faf6['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x535a8e=[];let _0x1536b2=0x0;if(_0x4049ed===_0x5181f0(0x207))while(_0x1536b2<_0x267161[_0x5181f0(0x1fd)]){const _0x1f38c0=_0x267161[_0x1536b2]??'';if(/^\s*<!--\s*@lovrabet\./[_0x5181f0(0x1fe)](_0x1f38c0)){_0x1536b2++;continue;}if(_0x1f38c0[_0x5181f0(0x1f2)]()===''&&_0x1536b2>0x0){_0x1536b2++;continue;}break;}else while(_0x1536b2<_0x267161['length']){const _0x4844bc=_0x267161[_0x1536b2]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x4844bc)){_0x1536b2++;continue;}if(_0x4844bc[_0x5181f0(0x1f2)]()===''&&_0x1536b2>0x0){_0x1536b2++;continue;}break;}for(;_0x1536b2<_0x267161['length'];_0x1536b2++){_0x535a8e['push'](_0x267161[_0x1536b2]);}return _0x535a8e[_0x5181f0(0x1f8)]('\x0a')['trimStart']();}export function resolveSqlMode(_0x5193e8,_0x3e4834){const _0x34a2a6=a112_0x1b317b;if(_0x3e4834?.[_0x34a2a6(0x204)])return _0x3e4834[_0x34a2a6(0x204)];return detectSqlMode(_0x5193e8);}export function resolveSqlFileName(_0x3e72a6,_0x3e4b73,_0x1e2072){const _0x3866e6=a112_0x1b317b;if(_0x1e2072?.['path'])return _0x1e2072[_0x3866e6(0x215)];if(_0x1e2072?.['sqlName']||_0x1e2072?.[_0x3866e6(0x20e)])return buildSqlRelativePath(_0x3e72a6,_0x1e2072?.[_0x3866e6(0x1fa)],_0x1e2072?.[_0x3866e6(0x20e)],resolveSqlMode(_0x3e4b73,_0x1e2072),_0x1e2072?.['dbId']);return buildDefaultSqlFileName(_0x3e72a6,resolveSqlMode(_0x3e4b73,_0x1e2072));}export function resolveSqlLocalDir(_0x27e1ea,_0x361ac8){return join(_0x27e1ea,SQL_LOCAL_REL_DIR,_0x361ac8);}export async function confirmForceOverwrite(_0x19f7f8){const _0x11fd02=a112_0x1b317b,_0x31127f=createInterface({'input':process['stdin'],'output':process[_0x11fd02(0x1f9)]}),_0x109307=await new Promise(_0x5ba257=>{const _0x36e180=_0x11fd02;_0x31127f[_0x36e180(0x208)](_0x19f7f8+_0x36e180(0x213),_0x5ba257);});return _0x31127f['close'](),['y','yes']['includes'](_0x109307[_0x11fd02(0x1f2)]()['toLowerCase']());}export function findSqlLockScope(_0x14e655,_0x4f607a){const _0x155a69=a112_0x1b317b;return _0x14e655[_0x155a69(0x20c)][_0x4f607a];}function buildMetadataHeaderLines(_0x10a2b9,_0x23e050){const _0x20e83e=a112_0x1b317b,_0x35a053=[[_0x20e83e(0x203),_0x10a2b9['sqlCode']],['sqlName',_0x10a2b9[_0x20e83e(0x1fa)]],[_0x20e83e(0x217),_0x10a2b9[_0x20e83e(0x217)]],['dbName',_0x10a2b9['dbName']],[_0x20e83e(0x204),_0x10a2b9['mode']],[_0x20e83e(0x212),_0x10a2b9['syncedAt']],[_0x20e83e(0x205),_0x10a2b9['description']]];if(_0x23e050===_0x20e83e(0x207))return _0x35a053[_0x20e83e(0x216)](([,_0x5b6bb4])=>_0x5b6bb4!==undefined&&_0x5b6bb4!==null&&String(_0x5b6bb4)[_0x20e83e(0x1f2)]()!=='')[_0x20e83e(0x200)](([_0x2e2478,_0x3dcc66])=>_0x20e83e(0x218)+_0x2e2478+':\x20'+String(_0x3dcc66)+_0x20e83e(0x206));return _0x35a053[_0x20e83e(0x216)](([,_0x3bacad])=>_0x3bacad!==undefined&&_0x3bacad!==null&&String(_0x3bacad)['trim']()!=='')['map'](([_0x1c0883,_0x55366a])=>_0x20e83e(0x1fc)+_0x1c0883+':\x20'+String(_0x55366a));}
1
+ const a116_0x4ab52=a116_0x27ee;(function(_0x172937,_0xbc3b58){const _0x561439=a116_0x27ee,_0x38b12a=_0x172937();while(!![]){try{const _0x3ebbea=-parseInt(_0x561439(0x1ba))/0x1*(-parseInt(_0x561439(0x1ca))/0x2)+-parseInt(_0x561439(0x1db))/0x3+-parseInt(_0x561439(0x1c4))/0x4*(-parseInt(_0x561439(0x1dd))/0x5)+parseInt(_0x561439(0x1cf))/0x6+-parseInt(_0x561439(0x1d1))/0x7+-parseInt(_0x561439(0x1cc))/0x8*(parseInt(_0x561439(0x1bf))/0x9)+-parseInt(_0x561439(0x1cd))/0xa*(-parseInt(_0x561439(0x1d9))/0xb);if(_0x3ebbea===_0xbc3b58)break;else _0x38b12a['push'](_0x38b12a['shift']());}catch(_0x3f6b81){_0x38b12a['push'](_0x38b12a['shift']());}}}(a116_0x52fb,0x6ecbb));import{createInterface}from'node:readline';function a116_0x27ee(_0x1cf98e,_0x1c2338){_0x1cf98e=_0x1cf98e-0x1af;const _0x52fb32=a116_0x52fb();let _0x27ee87=_0x52fb32[_0x1cf98e];return _0x27ee87;}import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a116_0x4ab52(0x1b6);export function buildSqlLockEntry(_0x22c0d9,_0x342d89,_0x2005e1,_0x18aa9f){const _0x5177af=a116_0x4ab52,_0x10f9d4=detectSqlMode(_0x342d89);return{'path':buildSqlRelativePath(_0x22c0d9['sqlCode'],_0x22c0d9[_0x5177af(0x1c8)],_0x18aa9f?.[_0x5177af(0x1d0)],_0x10f9d4,_0x22c0d9[_0x5177af(0x1af)]),'hash':_0x2005e1,'remoteId':_0x22c0d9['id'],'version':_0x22c0d9[_0x5177af(0x1bb)],'dbId':Number(_0x22c0d9[_0x5177af(0x1af)]),'dbName':_0x18aa9f?.['dbName'],'sqlName':_0x22c0d9[_0x5177af(0x1c8)],'sqlConfig':_0x22c0d9[_0x5177af(0x1c5)]??undefined,'mode':_0x10f9d4};}export function cloneSqlLockData(_0x51dcee){const _0x1a7d2a=a116_0x4ab52;return{'apps':Object[_0x1a7d2a(0x1c0)](Object[_0x1a7d2a(0x1be)](_0x51dcee[_0x1a7d2a(0x1d2)])[_0x1a7d2a(0x1b2)](([_0xc16ce4,_0x2633f8])=>[_0xc16ce4,{'sqlRoot':_0x2633f8[_0x1a7d2a(0x1b4)],'lastSync':_0x2633f8[_0x1a7d2a(0x1c6)],'sqls':{..._0x2633f8[_0x1a7d2a(0x1d3)]}}]))};}export function ensureRemoteSqlContent(_0x1d81c3){const _0x462683=a116_0x4ab52;return _0x1d81c3[_0x462683(0x1d5)]??'';}export function buildLocalSqlFileContent(_0x1320b9,_0x5af3bf,_0xa7de65){const _0x1e0edf=a116_0x4ab52,_0x56ed3f=_0xa7de65?.['mode']??detectSqlMode(_0x5af3bf),_0xfd8b50=stripLocalSqlMetadata(_0x5af3bf,_0x56ed3f)[_0x1e0edf(0x1d8)](),_0x2eff15=[...buildMetadataHeaderLines({'sqlCode':_0x1320b9['sqlCode'],'sqlName':_0x1320b9[_0x1e0edf(0x1c8)],'dbId':_0x1320b9[_0x1e0edf(0x1af)],'dbName':_0xa7de65?.['dbName'],'mode':_0x56ed3f,'syncedAt':_0xa7de65?.[_0x1e0edf(0x1cb)],'description':_0xa7de65?.['description']},_0x56ed3f),'',_0xfd8b50],_0x52bc08=_0x2eff15[_0x1e0edf(0x1de)]('\x0a');return _0x52bc08['endsWith']('\x0a')?_0x52bc08:_0x52bc08+'\x0a';}export function stripLocalSqlMetadata(_0x338266,_0x52efb7){const _0x5c2c46=a116_0x4ab52,_0x1f38b3=_0x338266[_0x5c2c46(0x1b5)](/\r\n/g,'\x0a')[_0x5c2c46(0x1b0)]('\x0a'),_0x508759=[];let _0x272f5a=0x0;if(_0x52efb7===_0x5c2c46(0x1da))while(_0x272f5a<_0x1f38b3[_0x5c2c46(0x1b3)]){const _0x287b20=_0x1f38b3[_0x272f5a]??'';if(/^\s*<!--\s*@lovrabet\./[_0x5c2c46(0x1b8)](_0x287b20)){_0x272f5a++;continue;}if(_0x287b20['trim']()===''&&_0x272f5a>0x0){_0x272f5a++;continue;}break;}else while(_0x272f5a<_0x1f38b3[_0x5c2c46(0x1b3)]){const _0xf72e27=_0x1f38b3[_0x272f5a]??'';if(/^\s*--\s*@lovrabet\./[_0x5c2c46(0x1b8)](_0xf72e27)){_0x272f5a++;continue;}if(_0xf72e27[_0x5c2c46(0x1d8)]()===''&&_0x272f5a>0x0){_0x272f5a++;continue;}break;}for(;_0x272f5a<_0x1f38b3['length'];_0x272f5a++){_0x508759[_0x5c2c46(0x1c9)](_0x1f38b3[_0x272f5a]);}return _0x508759[_0x5c2c46(0x1de)]('\x0a')['trimStart']();}export function resolveSqlMode(_0x1a8ae0,_0x3a5903){const _0x2a5421=a116_0x4ab52;if(_0x3a5903?.[_0x2a5421(0x1bd)])return _0x3a5903[_0x2a5421(0x1bd)];return detectSqlMode(_0x1a8ae0);}export function resolveSqlFileName(_0x17e8d8,_0x27465d,_0x36d43b){const _0x193141=a116_0x4ab52;if(_0x36d43b?.[_0x193141(0x1ce)])return _0x36d43b['path'];if(_0x36d43b?.[_0x193141(0x1c8)]||_0x36d43b?.[_0x193141(0x1d0)])return buildSqlRelativePath(_0x17e8d8,_0x36d43b?.[_0x193141(0x1c8)],_0x36d43b?.[_0x193141(0x1d0)],resolveSqlMode(_0x27465d,_0x36d43b),_0x36d43b?.[_0x193141(0x1af)]);return buildDefaultSqlFileName(_0x17e8d8,resolveSqlMode(_0x27465d,_0x36d43b));}export function resolveSqlLocalDir(_0x4a481b,_0x47f71a){return join(_0x4a481b,SQL_LOCAL_REL_DIR,_0x47f71a);}export async function confirmForceOverwrite(_0x202a4b){const _0xd2fb07=a116_0x4ab52,_0x4390cf=createInterface({'input':process[_0xd2fb07(0x1c3)],'output':process['stderr']}),_0x57be3c=await new Promise(_0x2e890b=>{const _0x21d19b=_0xd2fb07;_0x4390cf[_0x21d19b(0x1d7)](_0x202a4b+_0x21d19b(0x1c2),_0x2e890b);});return _0x4390cf[_0xd2fb07(0x1c7)](),['y',_0xd2fb07(0x1c1)][_0xd2fb07(0x1dc)](_0x57be3c['trim']()[_0xd2fb07(0x1bc)]());}export function findSqlLockScope(_0x1ba1c1,_0xc3ece8){return _0x1ba1c1['apps'][_0xc3ece8];}function a116_0x52fb(){const _0x2342d6=['\x20-->','map','length','sqlRoot','replace','.rabetbase/sql','sqlCode','test','--\x20@lovrabet.','1KUGzlW','version','toLowerCase','mode','entries','247977Aldgfl','fromEntries','yes','\x20[y/N]\x20','stdin','15116tmCbru','sqlConfig','lastSync','close','sqlName','push','930590scAPIf','syncedAt','232vQDhuG','142150jRBPcR','path','3603522MLdCiw','dbName','2440746KxWJwc','apps','sqls','<!--\x20@lovrabet.','sqlContent','filter','question','trim','880iEsKsV','mybatisXml','2065395sjJObl','includes','115tjRZuo','join','dbId','split'];a116_0x52fb=function(){return _0x2342d6;};return a116_0x52fb();}function buildMetadataHeaderLines(_0x35d3a6,_0x5dfb19){const _0x5a2e3d=a116_0x4ab52,_0x58432d=[[_0x5a2e3d(0x1b7),_0x35d3a6[_0x5a2e3d(0x1b7)]],['sqlName',_0x35d3a6[_0x5a2e3d(0x1c8)]],[_0x5a2e3d(0x1af),_0x35d3a6[_0x5a2e3d(0x1af)]],['dbName',_0x35d3a6[_0x5a2e3d(0x1d0)]],[_0x5a2e3d(0x1bd),_0x35d3a6['mode']],[_0x5a2e3d(0x1cb),_0x35d3a6['syncedAt']],['description',_0x35d3a6['description']]];if(_0x5dfb19==='mybatisXml')return _0x58432d[_0x5a2e3d(0x1d6)](([,_0x4e019c])=>_0x4e019c!==undefined&&_0x4e019c!==null&&String(_0x4e019c)[_0x5a2e3d(0x1d8)]()!=='')[_0x5a2e3d(0x1b2)](([_0x58121a,_0x12d5fe])=>_0x5a2e3d(0x1d4)+_0x58121a+':\x20'+String(_0x12d5fe)+_0x5a2e3d(0x1b1));return _0x58432d[_0x5a2e3d(0x1d6)](([,_0x4b5432])=>_0x4b5432!==undefined&&_0x4b5432!==null&&String(_0x4b5432)[_0x5a2e3d(0x1d8)]()!=='')[_0x5a2e3d(0x1b2)](([_0x5425d0,_0x49599e])=>_0x5a2e3d(0x1b9)+_0x5425d0+':\x20'+String(_0x49599e));}
@@ -1 +1 @@
1
- function a113_0x3d92(){const _0x3f5fd5=['filePath','sql','144GZovSk','paging','\x20missing,\x20','push','lockKey','map','21434bebbWm','381307NMjmBv','sqlName','sqls','\x20remote-only','lockFilePath','60922WUyzZN','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','1542825plcvtj','bool','5723800IaKAOu','length','\x20added,\x20','appCode','63pvNOWH','All\x20SQL\x20queries\x20are\x20in\x20sync.','tableData','587430XxdnbZ','sqlRoot','has','18KPSCHG','status','keys','totalCount','boolean','560668MPHAjm'];a113_0x3d92=function(){return _0x3f5fd5;};return a113_0x3d92();}const a113_0x6b86b0=a113_0x7036;(function(_0x462488,_0x27b468){const _0x9bcb3=a113_0x7036,_0x3ba0b8=_0x462488();while(!![]){try{const _0x54efb8=parseInt(_0x9bcb3(0x152))/0x1+parseInt(_0x9bcb3(0x157))/0x2*(parseInt(_0x9bcb3(0x15f))/0x3)+parseInt(_0x9bcb3(0x16a))/0x4+-parseInt(_0x9bcb3(0x162))/0x5*(parseInt(_0x9bcb3(0x165))/0x6)+parseInt(_0x9bcb3(0x151))/0x7*(-parseInt(_0x9bcb3(0x16d))/0x8)+parseInt(_0x9bcb3(0x159))/0x9+-parseInt(_0x9bcb3(0x15b))/0xa;if(_0x54efb8===_0x27b468)break;else _0x3ba0b8['push'](_0x3ba0b8['shift']());}catch(_0x4c205f){_0x3ba0b8['push'](_0x3ba0b8['shift']());}}}(a113_0x3d92,0x56172));function a113_0x7036(_0x20a7cf,_0x5266a9){_0x20a7cf=_0x20a7cf-0x14f;const _0x3d92db=a113_0x3d92();let _0x70363=_0x3d92db[_0x20a7cf];return _0x70363;}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(_0x2f5927){const _0x4da038=a113_0x7036,_0x2ece9e=[];let _0x599626=0x1;while(!![]){const _0x26fe24=await listSqlQueries(_0x2f5927,{'currentPage':_0x599626,'pageSize':PAGE_SIZE}),_0x4fb258=_0x26fe24[_0x4da038(0x161)]??[];_0x2ece9e['push'](..._0x4fb258[_0x4da038(0x150)](_0x556157=>_0x556157['sqlCode']));if(_0x4fb258[_0x4da038(0x15c)]===0x0)break;const _0x4dbfb0=_0x26fe24[_0x4da038(0x16e)]?.[_0x4da038(0x168)];if(_0x4dbfb0!=null?_0x2ece9e[_0x4da038(0x15c)]>=_0x4dbfb0:_0x4fb258[_0x4da038(0x15c)]<PAGE_SIZE)break;_0x599626++;}return _0x2ece9e;}export const sqlStatus={'service':a113_0x6b86b0(0x16c),'command':a113_0x6b86b0(0x166),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':'read','flags':[{'name':'remote','type':a113_0x6b86b0(0x169),'description':a113_0x6b86b0(0x158)}],async 'execute'(_0x4b3ff8){const _0x31856a=a113_0x6b86b0,_0xb8b12=loadSqlProjectConfig(_0x4b3ff8[_0x31856a(0x15e)]),_0x57ad25=await readSqlLockFile(_0xb8b12[_0x31856a(0x156)]),{appLock:_0x5c68e3}=ensureSqlLockScope(_0x57ad25??createEmptySqlLock(),_0xb8b12['appCode'],_0xb8b12[_0x31856a(0x163)],_0x31856a(0x166)),_0x5e9816=await scanLocalSqlQueries(_0xb8b12),_0x518e26=[],_0x330b1b=[],_0x167187=[],_0x106cfc=[],_0x74dafb=new Set(_0x5e9816[_0x31856a(0x150)](_0x53e3fe=>_0x53e3fe[_0x31856a(0x14f)]));for(const _0x3a9395 of _0x5e9816){const _0x45a689=await computeSqlFileHash(_0x3a9395[_0x31856a(0x16b)]),_0xd6e489=_0x5c68e3[_0x31856a(0x154)][_0x3a9395[_0x31856a(0x14f)]],_0x431ac5=!!_0xd6e489&&_0xd6e489['path']!==_0x3a9395['relativePath'],_0x2c7938=!!_0xd6e489&&!!_0x3a9395['sqlName']&&_0xd6e489[_0x31856a(0x153)]!==_0x3a9395[_0x31856a(0x153)];if(!_0xd6e489)_0x518e26[_0x31856a(0x170)](_0x3a9395[_0x31856a(0x14f)]);else _0xd6e489['hash']!==_0x45a689||_0x431ac5||_0x2c7938?_0x330b1b[_0x31856a(0x170)](_0x3a9395[_0x31856a(0x14f)]):_0x167187['push'](_0x3a9395['lockKey']);}for(const _0x1274c2 of Object[_0x31856a(0x167)](_0x5c68e3['sqls'])){!_0x74dafb['has'](_0x1274c2)&&_0x106cfc[_0x31856a(0x170)](_0x1274c2);}const _0x5a4a6e=[];if(_0x4b3ff8[_0x31856a(0x15a)]('remote')){const _0x1067c0=await fetchAllSqlCodes(_0x4b3ff8[_0x31856a(0x15e)]);for(const _0x51855b of _0x1067c0){!_0x74dafb[_0x31856a(0x164)](_0x51855b)&&!_0x5c68e3['sqls'][_0x51855b]&&_0x5a4a6e[_0x31856a(0x170)](_0x51855b);}}const _0x441069=_0x518e26[_0x31856a(0x15c)]===0x0&&_0x330b1b[_0x31856a(0x15c)]===0x0&&_0x106cfc['length']===0x0&&_0x5a4a6e['length']===0x0;return{'ok':!![],'data':{'added':_0x518e26,'modified':_0x330b1b,'missing':_0x106cfc,'unchanged':_0x167187,'remoteOnly':_0x5a4a6e},'message':_0x441069?_0x31856a(0x160):_0x518e26[_0x31856a(0x15c)]+_0x31856a(0x15d)+_0x330b1b[_0x31856a(0x15c)]+'\x20modified,\x20'+_0x106cfc['length']+_0x31856a(0x16f)+_0x167187['length']+'\x20unchanged'+(_0x5a4a6e[_0x31856a(0x15c)]>0x0?',\x20'+_0x5a4a6e[_0x31856a(0x15c)]+_0x31856a(0x155):'')};}};
1
+ const a117_0xff249c=a117_0xb61f;(function(_0x303a7f,_0x107ed8){const _0x4841e7=a117_0xb61f,_0x2f79ec=_0x303a7f();while(!![]){try{const _0x60d5e=-parseInt(_0x4841e7(0x159))/0x1+parseInt(_0x4841e7(0x151))/0x2*(-parseInt(_0x4841e7(0x14b))/0x3)+-parseInt(_0x4841e7(0x165))/0x4+parseInt(_0x4841e7(0x162))/0x5*(-parseInt(_0x4841e7(0x149))/0x6)+-parseInt(_0x4841e7(0x16a))/0x7+-parseInt(_0x4841e7(0x168))/0x8+parseInt(_0x4841e7(0x15c))/0x9*(parseInt(_0x4841e7(0x148))/0xa);if(_0x60d5e===_0x107ed8)break;else _0x2f79ec['push'](_0x2f79ec['shift']());}catch(_0x1c6bb8){_0x2f79ec['push'](_0x2f79ec['shift']());}}}(a117_0x99ec,0x6e3d8));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a117_0x99ec(){const _0x238904=['Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','sqls','totalCount','2690140wKZhaO','52410iOxGcd','length','24HKXHnL','appCode','\x20modified,\x20','\x20remote-only','sqlName','lockFilePath','161912XsExqL','map','hash','paging','\x20missing,\x20','All\x20SQL\x20queries\x20are\x20in\x20sync.','sqlCode','keys','118640eNqqbX','push','\x20added,\x20','81JbiakK','path','boolean','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','lockKey','sqlRoot','5UUhUEW','\x20unchanged','status','747980SVwZNo','has','sql','3318784cwpsSc','bool','4149012nFugJH'];a117_0x99ec=function(){return _0x238904;};return a117_0x99ec();}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';function a117_0xb61f(_0xed7648,_0x41e2db){_0xed7648=_0xed7648-0x147;const _0x99ec42=a117_0x99ec();let _0xb61fdd=_0x99ec42[_0xed7648];return _0xb61fdd;}const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x1f4394){const _0x407566=a117_0xb61f,_0x388823=[];let _0x492025=0x1;while(!![]){const _0x25c414=await listSqlQueries(_0x1f4394,{'currentPage':_0x492025,'pageSize':PAGE_SIZE}),_0x52f748=_0x25c414['tableData']??[];_0x388823[_0x407566(0x15a)](..._0x52f748[_0x407566(0x152)](_0x341412=>_0x341412[_0x407566(0x157)]));if(_0x52f748['length']===0x0)break;const _0x1ca024=_0x25c414[_0x407566(0x154)]?.[_0x407566(0x147)];if(_0x1ca024!=null?_0x388823['length']>=_0x1ca024:_0x52f748[_0x407566(0x14a)]<PAGE_SIZE)break;_0x492025++;}return _0x388823;}export const sqlStatus={'service':a117_0xff249c(0x167),'command':a117_0xff249c(0x164),'description':a117_0xff249c(0x15f),'risk':'read','flags':[{'name':'remote','type':a117_0xff249c(0x15e),'description':a117_0xff249c(0x16b)}],async 'execute'(_0x4390fb){const _0x227bdc=a117_0xff249c,_0x1a4809=loadSqlProjectConfig(_0x4390fb['appCode']),_0x37a964=await readSqlLockFile(_0x1a4809[_0x227bdc(0x150)]),{appLock:_0x2d2f11}=ensureSqlLockScope(_0x37a964??createEmptySqlLock(),_0x1a4809[_0x227bdc(0x14c)],_0x1a4809[_0x227bdc(0x161)],_0x227bdc(0x164)),_0x142eeb=await scanLocalSqlQueries(_0x1a4809),_0x14dadb=[],_0x3a11ad=[],_0x36e2c2=[],_0x9f5c23=[],_0x4b6b4d=new Set(_0x142eeb[_0x227bdc(0x152)](_0x25dfc8=>_0x25dfc8[_0x227bdc(0x160)]));for(const _0x5a12a5 of _0x142eeb){const _0x14b316=await computeSqlFileHash(_0x5a12a5['filePath']),_0x4b1dba=_0x2d2f11[_0x227bdc(0x16c)][_0x5a12a5[_0x227bdc(0x160)]],_0x24ada2=!!_0x4b1dba&&_0x4b1dba[_0x227bdc(0x15d)]!==_0x5a12a5['relativePath'],_0x44f1ea=!!_0x4b1dba&&!!_0x5a12a5['sqlName']&&_0x4b1dba[_0x227bdc(0x14f)]!==_0x5a12a5['sqlName'];if(!_0x4b1dba)_0x14dadb[_0x227bdc(0x15a)](_0x5a12a5[_0x227bdc(0x160)]);else _0x4b1dba[_0x227bdc(0x153)]!==_0x14b316||_0x24ada2||_0x44f1ea?_0x3a11ad['push'](_0x5a12a5[_0x227bdc(0x160)]):_0x36e2c2['push'](_0x5a12a5[_0x227bdc(0x160)]);}for(const _0x6f9c72 of Object[_0x227bdc(0x158)](_0x2d2f11['sqls'])){!_0x4b6b4d['has'](_0x6f9c72)&&_0x9f5c23['push'](_0x6f9c72);}const _0x32d9b8=[];if(_0x4390fb[_0x227bdc(0x169)]('remote')){const _0x2d8e27=await fetchAllSqlCodes(_0x4390fb['appCode']);for(const _0x50ecf0 of _0x2d8e27){!_0x4b6b4d[_0x227bdc(0x166)](_0x50ecf0)&&!_0x2d2f11['sqls'][_0x50ecf0]&&_0x32d9b8[_0x227bdc(0x15a)](_0x50ecf0);}}const _0x2b91ba=_0x14dadb[_0x227bdc(0x14a)]===0x0&&_0x3a11ad['length']===0x0&&_0x9f5c23[_0x227bdc(0x14a)]===0x0&&_0x32d9b8['length']===0x0;return{'ok':!![],'data':{'added':_0x14dadb,'modified':_0x3a11ad,'missing':_0x9f5c23,'unchanged':_0x36e2c2,'remoteOnly':_0x32d9b8},'message':_0x2b91ba?_0x227bdc(0x156):_0x14dadb[_0x227bdc(0x14a)]+_0x227bdc(0x15b)+_0x3a11ad['length']+_0x227bdc(0x14d)+_0x9f5c23['length']+_0x227bdc(0x155)+_0x36e2c2[_0x227bdc(0x14a)]+_0x227bdc(0x163)+(_0x32d9b8[_0x227bdc(0x14a)]>0x0?',\x20'+_0x32d9b8[_0x227bdc(0x14a)]+_0x227bdc(0x14e):'')};}};
@@ -1 +1 @@
1
- const a114_0x22a98b=a114_0x5022;(function(_0x2da23b,_0x1715f7){const _0x44df76=a114_0x5022,_0x3a5658=_0x2da23b();while(!![]){try{const _0x50b7db=-parseInt(_0x44df76(0x12e))/0x1+-parseInt(_0x44df76(0x14d))/0x2+-parseInt(_0x44df76(0x14e))/0x3+-parseInt(_0x44df76(0x157))/0x4*(-parseInt(_0x44df76(0x13c))/0x5)+-parseInt(_0x44df76(0x14f))/0x6+parseInt(_0x44df76(0x15e))/0x7*(parseInt(_0x44df76(0x154))/0x8)+-parseInt(_0x44df76(0x137))/0x9*(-parseInt(_0x44df76(0x147))/0xa);if(_0x50b7db===_0x1715f7)break;else _0x3a5658['push'](_0x3a5658['shift']());}catch(_0x498b90){_0x3a5658['push'](_0x3a5658['shift']());}}}(a114_0x3d58,0xd503e));function a114_0x3d58(){const _0x524341=['from','438392SDsEsq','\x22\x20not\x20found\x20in\x20any\x20dataset','string','268rcpTGJ','get','map','str','tables','read','schemaWarnings','77HXTIfN','reason','Table\x20\x22','117359lIoKeO','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','size','length','isSelectOnly','split','cwd','trim','toLowerCase','20429181tSYKCM','appCode','type','utf-8','isDangerous','91265dmnepy','filter','name','\x22\x20not\x20found\x20or\x20not\x20accessible','validate','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','fields','isArray','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','valid','schema:','10DMnTqB','Provide\x20--file\x20or\x20--sql','file','sql','sqlType','push','3226540EtOXWs','59739hGwsaK','8835582MtDKsm','parameters','validation','File\x20not\x20found:\x20'];a114_0x3d58=function(){return _0x524341;};return a114_0x3d58();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a114_0x5022(_0x26c6d2,_0x55a365){_0x26c6d2=_0x26c6d2-0x12c;const _0x3d5839=a114_0x3d58();let _0x5022d1=_0x3d5839[_0x26c6d2];return _0x5022d1;}import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a114_0x22a98b(0x14a),'command':a114_0x22a98b(0x140),'description':a114_0x22a98b(0x144),'risk':a114_0x22a98b(0x15c),'flags':[{'name':a114_0x22a98b(0x149),'type':'string','description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':'sql','type':a114_0x22a98b(0x156),'description':a114_0x22a98b(0x12f)},{'name':'schemas','type':a114_0x22a98b(0x156),'description':a114_0x22a98b(0x141)}],async 'execute'(_0x2a6812){const _0x268593=a114_0x22a98b,_0x2c8ef1=_0x2a6812['str'](_0x268593(0x149)),_0x3e9343=_0x2a6812[_0x268593(0x15a)]('sql');if(!_0x2c8ef1&&!_0x3e9343)throw CliErrors['flagMissing']('file',_0x268593(0x148));let _0x154e5d;if(_0x2c8ef1){const _0x44d5cf=resolve(process[_0x268593(0x134)](),_0x2c8ef1);if(!existsSync(_0x44d5cf))throw CliErrors[_0x268593(0x151)](_0x268593(0x152)+_0x44d5cf);_0x154e5d=readFileSync(_0x44d5cf,_0x268593(0x13a));}else _0x154e5d=_0x3e9343;const _0x3701e1=validateSql(_0x154e5d),_0x55e0cb={'valid':_0x3701e1[_0x268593(0x145)],'sqlType':_0x3701e1[_0x268593(0x14b)][_0x268593(0x139)],'isSelectOnly':_0x3701e1[_0x268593(0x14b)][_0x268593(0x132)],'isDangerous':_0x3701e1[_0x268593(0x14b)][_0x268593(0x13b)],'tables':_0x3701e1[_0x268593(0x15b)],'parameters':_0x3701e1[_0x268593(0x150)],'message':_0x3701e1['message']};_0x3701e1['sqlType'][_0x268593(0x12c)]&&(_0x55e0cb[_0x268593(0x12c)]=_0x3701e1['sqlType'][_0x268593(0x12c)]);const _0x238875=_0x2a6812[_0x268593(0x15a)]('schemas');if(_0x238875&&_0x3701e1[_0x268593(0x145)]){const _0x26e2fc=_0x238875[_0x268593(0x133)](',')[_0x268593(0x159)](_0x35b625=>_0x35b625[_0x268593(0x135)]())[_0x268593(0x13d)](Boolean),_0x565192=[],_0xd8cd9c=await listDatasets(_0x2a6812[_0x268593(0x138)]),_0x5bb0da=new Map(_0xd8cd9c['map'](_0x363fbe=>[_0x363fbe['dbtableConfig']?.['tableName']?.['toLowerCase'](),_0x363fbe]));for(const _0x1b74a5 of _0x3701e1[_0x268593(0x15b)]){const _0x417eeb=_0x5bb0da[_0x268593(0x158)](_0x1b74a5[_0x268593(0x136)]());!_0x417eeb&&_0x565192[_0x268593(0x14c)](_0x268593(0x12d)+_0x1b74a5+_0x268593(0x155));}for(const _0x5e61e6 of _0x26e2fc){try{const _0x30fdf4=await getDatasetDetail(_0x5e61e6),_0x4d5887=Array[_0x268593(0x143)](_0x30fdf4[_0x268593(0x142)])?_0x30fdf4[_0x268593(0x142)]:[],_0xae4d9c=new Set(_0x4d5887[_0x268593(0x159)](_0x1a03df=>_0x1a03df[_0x268593(0x13e)]?.[_0x268593(0x136)]())),_0x251fd4=_0x30fdf4['dbtableConfig']?.['tableName']||_0x30fdf4['tableName']||_0x5e61e6;_0x55e0cb[_0x268593(0x146)+_0x251fd4]={'code':_0x5e61e6,'tableName':_0x251fd4,'fieldCount':_0xae4d9c[_0x268593(0x130)],'fields':Array[_0x268593(0x153)](_0xae4d9c)};}catch{_0x565192[_0x268593(0x14c)]('Dataset\x20\x22'+_0x5e61e6+_0x268593(0x13f));}}_0x565192[_0x268593(0x131)]>0x0&&(_0x55e0cb[_0x268593(0x15d)]=_0x565192);}return{'ok':_0x3701e1[_0x268593(0x145)],'data':_0x55e0cb,'message':_0x3701e1['message']};}};
1
+ function a118_0xe49d(_0x1bd2bb,_0x4d47b9){_0x1bd2bb=_0x1bd2bb-0x1ed;const _0x28d293=a118_0x28d2();let _0xe49db1=_0x28d293[_0x1bd2bb];return _0xe49db1;}const a118_0x10d927=a118_0xe49d;(function(_0x11d319,_0x1d1cc1){const _0x31894d=a118_0xe49d,_0x36d20f=_0x11d319();while(!![]){try{const _0x114797=-parseInt(_0x31894d(0x1f8))/0x1*(-parseInt(_0x31894d(0x1f6))/0x2)+-parseInt(_0x31894d(0x1fd))/0x3*(-parseInt(_0x31894d(0x1f4))/0x4)+-parseInt(_0x31894d(0x1f0))/0x5*(parseInt(_0x31894d(0x205))/0x6)+-parseInt(_0x31894d(0x1fa))/0x7*(parseInt(_0x31894d(0x1f2))/0x8)+-parseInt(_0x31894d(0x1ef))/0x9*(-parseInt(_0x31894d(0x219))/0xa)+parseInt(_0x31894d(0x203))/0xb*(parseInt(_0x31894d(0x206))/0xc)+-parseInt(_0x31894d(0x208))/0xd;if(_0x114797===_0x1d1cc1)break;else _0x36d20f['push'](_0x36d20f['shift']());}catch(_0x48b484){_0x36d20f['push'](_0x36d20f['shift']());}}}(a118_0x28d2,0xc8eae));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a118_0x10d927(0x20a),'command':a118_0x10d927(0x21b),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a118_0x10d927(0x21a),'flags':[{'name':a118_0x10d927(0x1ff),'type':'string','description':a118_0x10d927(0x1f5)},{'name':a118_0x10d927(0x20a),'type':a118_0x10d927(0x215),'description':a118_0x10d927(0x214)},{'name':a118_0x10d927(0x1f9),'type':'string','description':a118_0x10d927(0x21d)}],async 'execute'(_0x38102f){const _0x19e933=a118_0x10d927,_0x46d369=_0x38102f[_0x19e933(0x210)]('file'),_0x30a445=_0x38102f[_0x19e933(0x210)](_0x19e933(0x20a));if(!_0x46d369&&!_0x30a445)throw CliErrors[_0x19e933(0x1fe)](_0x19e933(0x1ff),'Provide\x20--file\x20or\x20--sql');let _0x3aeec3;if(_0x46d369){const _0x5e34fc=resolve(process[_0x19e933(0x204)](),_0x46d369);if(!existsSync(_0x5e34fc))throw CliErrors[_0x19e933(0x218)]('File\x20not\x20found:\x20'+_0x5e34fc);_0x3aeec3=readFileSync(_0x5e34fc,_0x19e933(0x201));}else _0x3aeec3=_0x30a445;const _0x231f97=validateSql(_0x3aeec3),_0x3c014d={'valid':_0x231f97[_0x19e933(0x221)],'sqlType':_0x231f97[_0x19e933(0x217)][_0x19e933(0x216)],'isSelectOnly':_0x231f97['sqlType']['isSelectOnly'],'isDangerous':_0x231f97[_0x19e933(0x217)]['isDangerous'],'tables':_0x231f97[_0x19e933(0x20c)],'parameters':_0x231f97['parameters'],'message':_0x231f97[_0x19e933(0x220)]};_0x231f97[_0x19e933(0x217)]['reason']&&(_0x3c014d['reason']=_0x231f97['sqlType']['reason']);const _0x4fd3ca=_0x38102f[_0x19e933(0x210)](_0x19e933(0x1f9));if(_0x4fd3ca&&_0x231f97['valid']){const _0x4cddcf=_0x4fd3ca[_0x19e933(0x200)](',')[_0x19e933(0x207)](_0x35d096=>_0x35d096[_0x19e933(0x213)]())[_0x19e933(0x1f1)](Boolean),_0x470e31=[],_0x572431=await listDatasets(_0x38102f[_0x19e933(0x1fc)]),_0xaba588=new Map(_0x572431[_0x19e933(0x207)](_0x236e7f=>[_0x236e7f[_0x19e933(0x1ee)]?.['tableName']?.['toLowerCase'](),_0x236e7f]));for(const _0x305e9b of _0x231f97[_0x19e933(0x20c)]){const _0x8547e8=_0xaba588[_0x19e933(0x212)](_0x305e9b[_0x19e933(0x20e)]());!_0x8547e8&&_0x470e31['push'](_0x19e933(0x20b)+_0x305e9b+_0x19e933(0x1f3));}for(const _0x2556cc of _0x4cddcf){try{const _0x275975=await getDatasetDetail(_0x2556cc),_0x23418f=Array[_0x19e933(0x209)](_0x275975[_0x19e933(0x1ed)])?_0x275975[_0x19e933(0x1ed)]:[],_0x5f0e8c=new Set(_0x23418f[_0x19e933(0x207)](_0x4aa6b9=>_0x4aa6b9[_0x19e933(0x1f7)]?.[_0x19e933(0x20e)]())),_0x25e80b=_0x275975[_0x19e933(0x1ee)]?.[_0x19e933(0x1fb)]||_0x275975['tableName']||_0x2556cc;_0x3c014d[_0x19e933(0x21f)+_0x25e80b]={'code':_0x2556cc,'tableName':_0x25e80b,'fieldCount':_0x5f0e8c[_0x19e933(0x202)],'fields':Array[_0x19e933(0x20d)](_0x5f0e8c)};}catch{_0x470e31[_0x19e933(0x20f)](_0x19e933(0x21e)+_0x2556cc+_0x19e933(0x211));}}_0x470e31['length']>0x0&&(_0x3c014d[_0x19e933(0x21c)]=_0x470e31);}return{'ok':_0x231f97[_0x19e933(0x221)],'data':_0x3c014d,'message':_0x231f97['message']};}};function a118_0x28d2(){const _0x28be2a=['map','26722397ERKusl','isArray','sql','Table\x20\x22','tables','from','toLowerCase','push','str','\x22\x20not\x20found\x20or\x20not\x20accessible','get','trim','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','string','type','sqlType','validation','510ZJGMwo','read','validate','schemaWarnings','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','Dataset\x20\x22','schema:','message','valid','fields','dbtableConfig','228573dWMjuk','496130HMlEeM','filter','64dhJWEv','\x22\x20not\x20found\x20in\x20any\x20dataset','2847896nmeKYW','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','1720218kWqaFz','name','1UFFRWU','schemas','855911WTyYgc','tableName','appCode','6peLAkq','flagMissing','file','split','utf-8','size','11QOMAha','cwd','12CWYBqJ','5710308NAXgKM'];a118_0x28d2=function(){return _0x28be2a;};return a118_0x28d2();}
@@ -1 +1 @@
1
- const a115_0x230d46=a115_0x290c;(function(_0x4faf33,_0x194846){const _0x21a62d=a115_0x290c,_0x583a5b=_0x4faf33();while(!![]){try{const _0x11209e=parseInt(_0x21a62d(0x8f))/0x1+parseInt(_0x21a62d(0x8b))/0x2*(-parseInt(_0x21a62d(0x79))/0x3)+parseInt(_0x21a62d(0x8c))/0x4*(parseInt(_0x21a62d(0x7d))/0x5)+parseInt(_0x21a62d(0x7c))/0x6+-parseInt(_0x21a62d(0x94))/0x7*(parseInt(_0x21a62d(0x8d))/0x8)+-parseInt(_0x21a62d(0x93))/0x9+parseInt(_0x21a62d(0x7e))/0xa*(parseInt(_0x21a62d(0x89))/0xb);if(_0x11209e===_0x194846)break;else _0x583a5b['push'](_0x583a5b['shift']());}catch(_0xc5797f){_0x583a5b['push'](_0x583a5b['shift']());}}}(a115_0x5380,0xc5746));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a115_0x230d46(0x97),'accessKey',a115_0x230d46(0x92),a115_0x230d46(0x75),a115_0x230d46(0x7b)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a115_0x230d46(0x8a),a115_0x230d46(0x98),a115_0x230d46(0x92),'format',a115_0x230d46(0x97),'accessKey','apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x53439a){const _0x2e575c=a115_0x230d46;return[..._0x53439a][_0x2e575c(0x77)](',\x20');}function a115_0x5380(){const _0x448fd4=['format','Risk\x20level','join','inherit','1313820YKSdQF','zh-CN','riskLevel','4636620XRoCsh','741485oZGnIS','5990zpcrtG','Default\x20page\x20size','app','defaultFormat','string','entries','length','apiDir','defaultApp','Target\x20environment','keys','40799tWHlng','appcode','6LXHTKA','4JcJXku','643456IbbSTi','map','570146BECMFw','API\x20directory\x20path','en-US','locale','9969462UbTCeI','42TWxCBa','toLowerCase','apps','cookie','env','pageSize','trim','accessKey','Auth\x20cookie'];a115_0x5380=function(){return _0x448fd4;};return a115_0x5380();}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x397793){return TOP_LEVEL_CONFIG_KEYS['has'](_0x397793);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}function a115_0x290c(_0x50862e,_0x265cfa){_0x50862e=_0x50862e-0x74;const _0x53803b=a115_0x5380();let _0x290cd4=_0x53803b[_0x50862e];return _0x290cd4;}export const APP_PROFILE_FLAG_KEY_MAP={'env':a115_0x230d46(0x98),'apiDir':a115_0x230d46(0x85),'cookie':a115_0x230d46(0x97),'accessKey':a115_0x230d46(0x9b),'defaultFormat':a115_0x230d46(0x75),'pageSize':'pageSize','riskLevel':a115_0x230d46(0x7b),'locale':a115_0x230d46(0x92)};export function getAppProfileFlagDefs(){const _0x3c2a3e=a115_0x230d46;return[{'name':_0x3c2a3e(0x98),'type':_0x3c2a3e(0x82),'description':_0x3c2a3e(0x87),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x3c2a3e(0x85),'type':_0x3c2a3e(0x82),'description':_0x3c2a3e(0x90)},{'name':_0x3c2a3e(0x97),'type':_0x3c2a3e(0x82),'description':_0x3c2a3e(0x74),'hidden':!![]},{'name':_0x3c2a3e(0x9b),'type':_0x3c2a3e(0x82),'description':'Access\x20key','hidden':!![]},{'name':_0x3c2a3e(0x81),'type':_0x3c2a3e(0x82),'description':'Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x3c2a3e(0x99),'type':'number','description':_0x3c2a3e(0x7f)},{'name':_0x3c2a3e(0x7b),'type':_0x3c2a3e(0x82),'description':_0x3c2a3e(0x76),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x3c2a3e(0x92),'type':_0x3c2a3e(0x82),'description':'Locale'}];}export function collectAppProfileOverrides(_0x30f206){const _0x22dde4=a115_0x230d46,_0x13083b={};for(const [_0x286a6c,_0x3d5716]of Object[_0x22dde4(0x83)](APP_PROFILE_FLAG_KEY_MAP)){const _0xa448b=_0x30f206(_0x286a6c);if(!_0xa448b)continue;_0x13083b[_0x3d5716]=_0x3d5716==='pageSize'?Number(_0xa448b):_0xa448b;}return _0x13083b;}export function buildAppProfileListFields(_0x4aa14a){const _0xa78148=a115_0x230d46;return{'env':_0x4aa14a[_0xa78148(0x98)]??null,'apiDir':_0x4aa14a[_0xa78148(0x85)]??null,'hasCookie':!!_0x4aa14a[_0xa78148(0x97)],'hasAccessKey':!!_0x4aa14a[_0xa78148(0x9b)],'format':_0x4aa14a['format']??null,'pageSize':_0x4aa14a[_0xa78148(0x99)]??null,'riskLevel':_0x4aa14a[_0xa78148(0x7b)]??null,'locale':_0x4aa14a[_0xa78148(0x92)]??null};}export function buildAppDoctorFields(_0x2bd01c,_0x293b1b){const _0x2076f9=a115_0x230d46;return{'env':{'value':_0x2bd01c[_0x2076f9(0x98)]||_0x293b1b['env'],'source':_0x2bd01c[_0x2076f9(0x98)]?_0x2076f9(0x80):'inherit'},'apiDir':{'value':_0x2bd01c[_0x2076f9(0x85)]||_0x293b1b[_0x2076f9(0x85)],'source':_0x2bd01c[_0x2076f9(0x85)]?'app':_0x2076f9(0x78)},'cookie':{'value':_0x2bd01c[_0x2076f9(0x97)]||_0x293b1b[_0x2076f9(0x97)],'source':_0x2bd01c[_0x2076f9(0x97)]?_0x2076f9(0x80):_0x2076f9(0x78)},'accessKey':{'value':_0x2bd01c[_0x2076f9(0x9b)]||_0x293b1b[_0x2076f9(0x9b)],'source':_0x2bd01c[_0x2076f9(0x9b)]?_0x2076f9(0x80):_0x2076f9(0x78)}};}export function buildCanonicalAppConfig(_0x3588ad,_0x64f6c6){const _0x43cbf3=a115_0x230d46,_0x1feae6=_0x3588ad[_0x43cbf3(0x8e)](_0x3b18db=>String(_0x3b18db||'')[_0x43cbf3(0x9a)]())['filter'](Boolean);if(_0x1feae6[_0x43cbf3(0x84)]===0x0)return{};const _0x2fbedc={};for(const _0x2f59bd of _0x1feae6){_0x2fbedc[_0x2f59bd]=_0x64f6c6?{'appcode':_0x2f59bd,'env':_0x64f6c6}:{'appcode':_0x2f59bd};}return{'apps':_0x2fbedc,'defaultApp':_0x1feae6[0x0]};}export function buildCanonicalProjectConfig(_0x227e42,_0x1fb6f3){const _0x17c285=a115_0x230d46,{appCodes:appCodes=[],env:_0x4360c7,metadata:_0x369371}=_0x1fb6f3,_0x1727e8={..._0x227e42,..._0x369371||{}};delete _0x1727e8[_0x17c285(0x8a)],delete _0x1727e8[_0x17c285(0x80)];if(_0x4360c7)_0x1727e8[_0x17c285(0x98)]=_0x4360c7;else!_0x1727e8['env']&&(_0x1727e8[_0x17c285(0x98)]=DEFAULT_CONFIG_VALUES[_0x17c285(0x98)]);const _0x251ab5=buildCanonicalAppConfig(appCodes,_0x1727e8[_0x17c285(0x98)]);return Object[_0x17c285(0x88)](_0x251ab5)[_0x17c285(0x84)]>0x0&&(_0x1727e8[_0x17c285(0x96)]=_0x251ab5['apps'],_0x1727e8[_0x17c285(0x86)]=_0x251ab5['defaultApp']),_0x1727e8;}const LOCALE_MAP={'zh':a115_0x230d46(0x7a),'zh-cn':a115_0x230d46(0x7a),'zh_cn':a115_0x230d46(0x7a),'en':a115_0x230d46(0x91),'en-us':a115_0x230d46(0x91),'en_us':a115_0x230d46(0x91)};export function normalizeLocale(_0x1726cb){const _0x325f33=a115_0x230d46;if(!_0x1726cb)return null;return LOCALE_MAP[_0x1726cb[_0x325f33(0x95)]()]??null;}
1
+ const a119_0xdf9bf2=a119_0xdc56;(function(_0x562e36,_0x4b50c7){const _0x257776=a119_0xdc56,_0x1dac84=_0x562e36();while(!![]){try{const _0x13e8bc=parseInt(_0x257776(0x17c))/0x1*(parseInt(_0x257776(0x18f))/0x2)+-parseInt(_0x257776(0x183))/0x3+parseInt(_0x257776(0x19a))/0x4*(parseInt(_0x257776(0x188))/0x5)+-parseInt(_0x257776(0x17b))/0x6*(parseInt(_0x257776(0x18e))/0x7)+parseInt(_0x257776(0x19c))/0x8*(-parseInt(_0x257776(0x194))/0x9)+parseInt(_0x257776(0x18d))/0xa*(parseInt(_0x257776(0x17f))/0xb)+parseInt(_0x257776(0x1a3))/0xc*(parseInt(_0x257776(0x193))/0xd);if(_0x13e8bc===_0x4b50c7)break;else _0x1dac84['push'](_0x1dac84['shift']());}catch(_0xb1e0dc){_0x1dac84['push'](_0x1dac84['shift']());}}}(a119_0x262e,0xe1655));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a119_0xdf9bf2(0x17d),a119_0xdf9bf2(0x182),a119_0xdf9bf2(0x17a),'format',a119_0xdf9bf2(0x1a5)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a119_0xdf9bf2(0x184),a119_0xdf9bf2(0x185),a119_0xdf9bf2(0x17a),a119_0xdf9bf2(0x178),a119_0xdf9bf2(0x17d),'accessKey',a119_0xdf9bf2(0x1a4)]);function a119_0x262e(){const _0x5dd53b=['defaultApp','pageSize','Auth\x20cookie','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','trim','app','156LtespS','apiDir','riskLevel','API\x20directory\x20path','format','length','locale','24bNXtJH','5gAqcnQ','cookie','join','22fQSnTn','defaultFormat','number','accessKey','619734dbfqsH','appcode','env','zh-CN','Target\x20environment','5189860UNhyOF','Locale','entries','map','Risk\x20level','4098740WKEqPB','3134775FyQYSV','695432qKVWpP','keys','Config\x20key\x20(','string','153777xxmTfi','27FVfWIx','inherit','has','apps','en-US','toLowerCase','4tqPDOK','filter','2210608qLUvIw'];a119_0x262e=function(){return _0x5dd53b;};return a119_0x262e();}export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x56bc09){const _0x105e75=a119_0xdf9bf2;return[..._0x56bc09][_0x105e75(0x17e)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x3e7cb2){const _0x5bc097=a119_0xdf9bf2;return TOP_LEVEL_CONFIG_KEYS[_0x5bc097(0x196)](_0x3e7cb2);}function a119_0xdc56(_0x1151b9,_0x520926){_0x1151b9=_0x1151b9-0x178;const _0x262ebb=a119_0x262e();let _0xdc5670=_0x262ebb[_0x1151b9];return _0xdc5670;}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x16c1cf=a119_0xdf9bf2;return _0x16c1cf(0x191)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a119_0xdf9bf2(0x185),'apiDir':a119_0xdf9bf2(0x1a4),'cookie':'cookie','accessKey':'accessKey','defaultFormat':a119_0xdf9bf2(0x178),'pageSize':a119_0xdf9bf2(0x19e),'riskLevel':'riskLevel','locale':a119_0xdf9bf2(0x17a)};export function getAppProfileFlagDefs(){const _0x250a77=a119_0xdf9bf2;return[{'name':_0x250a77(0x185),'type':'string','description':_0x250a77(0x187),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x250a77(0x1a4),'type':_0x250a77(0x192),'description':_0x250a77(0x1a6)},{'name':_0x250a77(0x17d),'type':_0x250a77(0x192),'description':_0x250a77(0x19f),'hidden':!![]},{'name':'accessKey','type':'string','description':'Access\x20key','hidden':!![]},{'name':_0x250a77(0x180),'type':_0x250a77(0x192),'description':_0x250a77(0x1a0),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x250a77(0x181),'description':'Default\x20page\x20size'},{'name':_0x250a77(0x1a5),'type':'string','description':_0x250a77(0x18c),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x250a77(0x17a),'type':'string','description':_0x250a77(0x189)}];}export function collectAppProfileOverrides(_0x120706){const _0x5e86b0=a119_0xdf9bf2,_0x132123={};for(const [_0x3dbda9,_0xa9151b]of Object[_0x5e86b0(0x18a)](APP_PROFILE_FLAG_KEY_MAP)){const _0x2667a9=_0x120706(_0x3dbda9);if(!_0x2667a9)continue;_0x132123[_0xa9151b]=_0xa9151b===_0x5e86b0(0x19e)?Number(_0x2667a9):_0x2667a9;}return _0x132123;}export function buildAppProfileListFields(_0x39389b){const _0x1e0a94=a119_0xdf9bf2;return{'env':_0x39389b[_0x1e0a94(0x185)]??null,'apiDir':_0x39389b[_0x1e0a94(0x1a4)]??null,'hasCookie':!!_0x39389b['cookie'],'hasAccessKey':!!_0x39389b[_0x1e0a94(0x182)],'format':_0x39389b['format']??null,'pageSize':_0x39389b[_0x1e0a94(0x19e)]??null,'riskLevel':_0x39389b['riskLevel']??null,'locale':_0x39389b['locale']??null};}export function buildAppDoctorFields(_0x5b7475,_0x4483af){const _0x574d3b=a119_0xdf9bf2;return{'env':{'value':_0x5b7475[_0x574d3b(0x185)]||_0x4483af['env'],'source':_0x5b7475['env']?'app':'inherit'},'apiDir':{'value':_0x5b7475[_0x574d3b(0x1a4)]||_0x4483af['apiDir'],'source':_0x5b7475[_0x574d3b(0x1a4)]?_0x574d3b(0x1a2):_0x574d3b(0x195)},'cookie':{'value':_0x5b7475['cookie']||_0x4483af['cookie'],'source':_0x5b7475[_0x574d3b(0x17d)]?_0x574d3b(0x1a2):_0x574d3b(0x195)},'accessKey':{'value':_0x5b7475['accessKey']||_0x4483af['accessKey'],'source':_0x5b7475[_0x574d3b(0x182)]?_0x574d3b(0x1a2):_0x574d3b(0x195)}};}export function buildCanonicalAppConfig(_0x23f13e,_0x4cde3c){const _0x46dae6=a119_0xdf9bf2,_0x4e4e49=_0x23f13e[_0x46dae6(0x18b)](_0x492967=>String(_0x492967||'')[_0x46dae6(0x1a1)]())[_0x46dae6(0x19b)](Boolean);if(_0x4e4e49[_0x46dae6(0x179)]===0x0)return{};const _0xd7870c={};for(const _0x3c7bc0 of _0x4e4e49){_0xd7870c[_0x3c7bc0]=_0x4cde3c?{'appcode':_0x3c7bc0,'env':_0x4cde3c}:{'appcode':_0x3c7bc0};}return{'apps':_0xd7870c,'defaultApp':_0x4e4e49[0x0]};}export function buildCanonicalProjectConfig(_0x45473b,_0x26d592){const _0x4ed7ee=a119_0xdf9bf2,{appCodes:appCodes=[],env:_0x315104,metadata:_0x9afef6}=_0x26d592,_0x421d33={..._0x45473b,..._0x9afef6||{}};delete _0x421d33[_0x4ed7ee(0x184)],delete _0x421d33['app'];if(_0x315104)_0x421d33['env']=_0x315104;else!_0x421d33[_0x4ed7ee(0x185)]&&(_0x421d33[_0x4ed7ee(0x185)]=DEFAULT_CONFIG_VALUES['env']);const _0x5df218=buildCanonicalAppConfig(appCodes,_0x421d33[_0x4ed7ee(0x185)]);return Object[_0x4ed7ee(0x190)](_0x5df218)[_0x4ed7ee(0x179)]>0x0&&(_0x421d33[_0x4ed7ee(0x197)]=_0x5df218['apps'],_0x421d33[_0x4ed7ee(0x19d)]=_0x5df218[_0x4ed7ee(0x19d)]),_0x421d33;}const LOCALE_MAP={'zh':a119_0xdf9bf2(0x186),'zh-cn':a119_0xdf9bf2(0x186),'zh_cn':'zh-CN','en':a119_0xdf9bf2(0x198),'en-us':'en-US','en_us':'en-US'};export function normalizeLocale(_0x2cb5ac){const _0x33a99a=a119_0xdf9bf2;if(!_0x2cb5ac)return null;return LOCALE_MAP[_0x2cb5ac[_0x33a99a(0x199)]()]??null;}
@@ -1 +1 @@
1
- function a116_0x28ee(_0xce2cdf,_0x3b1d46){_0xce2cdf=_0xce2cdf-0x1d8;const _0x4e3548=a116_0x4e35();let _0x28ee78=_0x4e3548[_0xce2cdf];return _0x28ee78;}const a116_0x4c55e0=a116_0x28ee;(function(_0xe6eb80,_0x397b01){const _0x1776ea=a116_0x28ee,_0x41bb4d=_0xe6eb80();while(!![]){try{const _0x19b2d4=parseInt(_0x1776ea(0x1de))/0x1*(parseInt(_0x1776ea(0x1db))/0x2)+-parseInt(_0x1776ea(0x1d9))/0x3+parseInt(_0x1776ea(0x1df))/0x4*(parseInt(_0x1776ea(0x1d8))/0x5)+-parseInt(_0x1776ea(0x1da))/0x6+parseInt(_0x1776ea(0x1e2))/0x7+parseInt(_0x1776ea(0x1dc))/0x8*(parseInt(_0x1776ea(0x1e1))/0x9)+parseInt(_0x1776ea(0x1dd))/0xa;if(_0x19b2d4===_0x397b01)break;else _0x41bb4d['push'](_0x41bb4d['shift']());}catch(_0x3b749a){_0x41bb4d['push'](_0x41bb4d['shift']());}}}(a116_0x4e35,0xdbacb));function a116_0x4e35(){const _0x5c6a4b=['1FAghCx','4wrMmwE','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','2133rPThcv','855764eWNenB','708095HgqNgr','4061637OsfeHw','5167824harKKG','2419534qbBNaa','25168lYWwFw','8957300DokVdb'];a116_0x4e35=function(){return _0x5c6a4b;};return a116_0x4e35();}export const CLI_VERSION_POLICY_URL=a116_0x4c55e0(0x1e0);
1
+ const a120_0x2a485a=a120_0x2b27;(function(_0x47f382,_0x455655){const _0x332521=a120_0x2b27,_0x25409b=_0x47f382();while(!![]){try{const _0x3197bb=parseInt(_0x332521(0x16e))/0x1+-parseInt(_0x332521(0x170))/0x2+parseInt(_0x332521(0x16a))/0x3*(parseInt(_0x332521(0x168))/0x4)+parseInt(_0x332521(0x16f))/0x5+parseInt(_0x332521(0x16d))/0x6*(-parseInt(_0x332521(0x166))/0x7)+parseInt(_0x332521(0x16c))/0x8*(-parseInt(_0x332521(0x16b))/0x9)+-parseInt(_0x332521(0x169))/0xa*(-parseInt(_0x332521(0x165))/0xb);if(_0x3197bb===_0x455655)break;else _0x25409b['push'](_0x25409b['shift']());}catch(_0x166b7e){_0x25409b['push'](_0x25409b['shift']());}}}(a120_0x38ac,0xd2858));function a120_0x2b27(_0x1797b0,_0x51b772){_0x1797b0=_0x1797b0-0x165;const _0x38ac2e=a120_0x38ac();let _0x2b27be=_0x38ac2e[_0x1797b0];return _0x2b27be;}export const CLI_VERSION_POLICY_URL=a120_0x2a485a(0x167);function a120_0x38ac(){const _0x222bf6=['2688DJFzyC','42IPmOZV','9825CkaHMO','7723460vpEbsl','3401886nuyYbk','339295CiBTTx','87941wAFcwt','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','121852weDxTf','390kuskBa','12mrTuzQ','6111ZZUciP'];a120_0x38ac=function(){return _0x222bf6;};return a120_0x38ac();}
@@ -1 +1 @@
1
- function a117_0xfad4(){const _0x1e3002=['JSON\x20params','7914ZBHTYA','force','string','Environment','6847137vvHOoT','SQL\x20string','10601510iaGkCz','key','sql','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','schemas','global','Clear','Use\x20global\x20config\x20scope','datasetcode','Function\x20node','json\x20|\x20pretty\x20|\x20compress','name','Watch\x20mode','help','dbid','559068dfodql','all','clear','Keyword\x20filter','653xIqtGw','nonInteractive','Rabetbase\x20CLI','project','Type\x20filter','Preview\x20operation\x20without\x20executing','Name','production\x20|\x20daily','functionNode','Dataset\x20code','meowKey','Force\x20overwrite','Config\x20value','<code>','value','SQL\x20name','dry-run','remote','3182088LKflzQ','target','appcode','Override\x20appcode','Code\x20filter','format','code','Schemas','229901xibnPT','type','map','pagesize','2282oKOcou','operation','boolean','watch','Use\x20remote','enableBffSave','skipImports','page','sqlname','db-id','function-node','description','Show\x20help','DB\x20ID','Output\x20path','Use\x20project\x20config\x20scope','app','sqlName','rabetbase','Enable\x20BFF\x20save','keyword','Config\x20key','112TRxgqR','verbose','non-interactive','fromEntries','Page\x20size','Operation\x20type','yes','env','skip-imports','output','100QdHhxA','sqlcode','file','File\x20path','params','Page\x20number'];a117_0xfad4=function(){return _0x1e3002;};return a117_0xfad4();}const a117_0x5592f1=a117_0x715c;(function(_0x27fd3e,_0x2fdd49){const _0x48e1ce=a117_0x715c,_0x51d03d=_0x27fd3e();while(!![]){try{const _0x5b50cf=-parseInt(_0x48e1ce(0x13d))/0x1*(parseInt(_0x48e1ce(0xfd))/0x2)+-parseInt(_0x48e1ce(0x139))/0x3+parseInt(_0x48e1ce(0xf1))/0x4+-parseInt(_0x48e1ce(0x11d))/0x5*(parseInt(_0x48e1ce(0x124))/0x6)+parseInt(_0x48e1ce(0xf9))/0x7*(parseInt(_0x48e1ce(0x113))/0x8)+-parseInt(_0x48e1ce(0x128))/0x9+parseInt(_0x48e1ce(0x12a))/0xa;if(_0x5b50cf===_0x2fdd49)break;else _0x51d03d['push'](_0x51d03d['shift']());}catch(_0x2fd69b){_0x51d03d['push'](_0x51d03d['shift']());}}}(a117_0xfad4,0x91b89));export const CLI_BIN_NAME=a117_0x5592f1(0x10f);export const CLI_DISPLAY_NAME=a117_0x5592f1(0x13f);export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';export const GLOBAL_FLAGS=[{'name':a117_0x5592f1(0xf3),'meowKey':'appcode','type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0xf4),'hint':a117_0x5592f1(0x14a)},{'name':a117_0x5592f1(0x10d),'meowKey':a117_0x5592f1(0x10d),'type':a117_0x5592f1(0x126),'description':'Select\x20app\x20profile\x20by\x20name','hint':'<name>'},{'name':'env','meowKey':a117_0x5592f1(0x11a),'type':'string','description':a117_0x5592f1(0x127),'hint':a117_0x5592f1(0x144)},{'name':'format','meowKey':a117_0x5592f1(0xf6),'type':a117_0x5592f1(0x126),'description':'Output\x20format','hint':a117_0x5592f1(0x134)},{'name':'jq','meowKey':'jq','type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x12d),'hint':'<expr>'},{'name':a117_0x5592f1(0x14d),'meowKey':'dryRun','type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x142)},{'name':a117_0x5592f1(0x119),'meowKey':a117_0x5592f1(0x119),'type':a117_0x5592f1(0xff),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a117_0x5592f1(0x115),'meowKey':a117_0x5592f1(0x13e),'type':'boolean','description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':'global','meowKey':a117_0x5592f1(0x12f),'type':'boolean','description':a117_0x5592f1(0x131)},{'name':a117_0x5592f1(0x140),'meowKey':a117_0x5592f1(0x140),'type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x10c)},{'name':'ci','meowKey':'ci','type':a117_0x5592f1(0xff),'description':'Alias\x20for\x20--non-interactive','hidden':!![]},{'name':a117_0x5592f1(0x137),'meowKey':'help','type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x109)},{'name':a117_0x5592f1(0x135),'meowKey':a117_0x5592f1(0x135),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x143),'hidden':!![]},{'name':a117_0x5592f1(0x13b),'meowKey':a117_0x5592f1(0x13b),'type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x130),'hidden':!![]},{'name':a117_0x5592f1(0x100),'meowKey':a117_0x5592f1(0x100),'type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x136),'hidden':!![]},{'name':a117_0x5592f1(0x11c),'meowKey':a117_0x5592f1(0x11c),'type':'string','description':a117_0x5592f1(0x10b),'hidden':!![]},{'name':a117_0x5592f1(0x121),'meowKey':a117_0x5592f1(0x121),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x123),'hidden':!![]},{'name':a117_0x5592f1(0x132),'meowKey':a117_0x5592f1(0x132),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x146),'hidden':!![]},{'name':'all','meowKey':a117_0x5592f1(0x13a),'type':a117_0x5592f1(0xff),'description':'Apply\x20to\x20all','hidden':!![]},{'name':'enable-bff-save','meowKey':a117_0x5592f1(0x102),'type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x110),'hidden':!![]},{'name':'id','meowKey':'id','type':a117_0x5592f1(0x126),'description':'Record\x20ID','hidden':!![]},{'name':a117_0x5592f1(0xfa),'meowKey':'type','type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x141),'hidden':!![]},{'name':'file','meowKey':a117_0x5592f1(0x11f),'type':'string','description':a117_0x5592f1(0x120),'hidden':!![]},{'name':a117_0x5592f1(0x11e),'meowKey':a117_0x5592f1(0x11e),'type':a117_0x5592f1(0x126),'description':'SQL\x20code','hidden':!![]},{'name':'sql-name','meowKey':a117_0x5592f1(0x10e),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x14c),'hidden':!![]},{'name':a117_0x5592f1(0x105),'meowKey':'sqlname','type':'string','description':a117_0x5592f1(0x14c),'hidden':!![]},{'name':a117_0x5592f1(0x106),'meowKey':'dbId','type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x10a),'hidden':!![]},{'name':'dbid','meowKey':a117_0x5592f1(0x138),'type':'string','description':a117_0x5592f1(0x10a),'hidden':!![]},{'name':a117_0x5592f1(0x108),'meowKey':a117_0x5592f1(0x108),'type':a117_0x5592f1(0x126),'description':'Description','hidden':!![]},{'name':a117_0x5592f1(0x104),'meowKey':a117_0x5592f1(0x104),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x122),'hidden':!![]},{'name':a117_0x5592f1(0xfc),'meowKey':a117_0x5592f1(0xfc),'type':'string','description':a117_0x5592f1(0x117),'hidden':!![]},{'name':'keyword','meowKey':a117_0x5592f1(0x111),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x13c),'hidden':!![]},{'name':a117_0x5592f1(0xf7),'meowKey':a117_0x5592f1(0xf7),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0xf5),'hidden':!![]},{'name':'sql','meowKey':a117_0x5592f1(0x12c),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x129),'hidden':!![]},{'name':a117_0x5592f1(0x12e),'meowKey':'schemas','type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0xf8),'hidden':!![]},{'name':a117_0x5592f1(0xfe),'meowKey':a117_0x5592f1(0xfe),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x118),'hidden':!![]},{'name':a117_0x5592f1(0xf2),'meowKey':a117_0x5592f1(0xf2),'type':a117_0x5592f1(0x126),'description':'Target\x20path','hidden':!![]},{'name':a117_0x5592f1(0x11b),'meowKey':a117_0x5592f1(0x103),'type':a117_0x5592f1(0xff),'description':'Skip\x20import\x20generation','hidden':!![]},{'name':a117_0x5592f1(0x12b),'meowKey':'key','type':'string','description':a117_0x5592f1(0x112),'hidden':!![]},{'name':a117_0x5592f1(0x14b),'meowKey':a117_0x5592f1(0x14b),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x149),'hidden':!![]},{'name':a117_0x5592f1(0x125),'meowKey':a117_0x5592f1(0x125),'type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x148),'hidden':!![]},{'name':a117_0x5592f1(0x14e),'meowKey':a117_0x5592f1(0x14e),'type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x101),'hidden':!![]},{'name':a117_0x5592f1(0x114),'meowKey':a117_0x5592f1(0x114),'type':a117_0x5592f1(0xff),'description':'Verbose\x20output','hidden':!![]},{'name':'operation-type','meowKey':'operationType','type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x118),'hidden':!![]},{'name':a117_0x5592f1(0x107),'meowKey':a117_0x5592f1(0x145),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x133),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set(['appcode','app',a117_0x5592f1(0x11a),a117_0x5592f1(0xf6),'jq',a117_0x5592f1(0x14d),a117_0x5592f1(0x119),a117_0x5592f1(0x115),'ci']);function a117_0x715c(_0x45db22,_0x5527ff){_0x45db22=_0x45db22-0xf1;const _0xfad401=a117_0xfad4();let _0x715c7d=_0xfad401[_0x45db22];return _0x715c7d;}export function buildMeowFlags(){const _0x1b2cdf=a117_0x5592f1;return Object[_0x1b2cdf(0x116)](GLOBAL_FLAGS[_0x1b2cdf(0xfb)](_0x5b57c9=>[_0x5b57c9[_0x1b2cdf(0x147)],{'type':_0x5b57c9[_0x1b2cdf(0xfa)]}]));}
1
+ const a121_0xb7575d=a121_0x19a4;function a121_0x19a4(_0x4ef958,_0x5b930e){_0x4ef958=_0x4ef958-0x8c;const _0x2c4ba3=a121_0x2c4b();let _0x19a480=_0x2c4ba3[_0x4ef958];return _0x19a480;}function a121_0x2c4b(){const _0x5deeb8=['boolean','operation','code','type','verbose','DB\x20ID','rabetbase','Name','name','<expr>','@lovrabet/rabetbase-cli','watch','json\x20|\x20pretty\x20|\x20compress','3771MTpdNV','skipImports','11957OiLFPG','datasetcode','Schemas','Override\x20appcode','Operation\x20type','sqlname','keyword','appcode','functionNode','target','skip-imports','120ObDNYf','1805765FVrvnz','2049257YFCNzX','pagesize','6thLrBW','page','function-node','Verbose\x20output','yes','operationType','Target\x20path','sql','Record\x20ID','enableBffSave','SQL\x20name','Use\x20global\x20config\x20scope','Use\x20project\x20config\x20scope','Preview\x20operation\x20without\x20executing','Skip\x20import\x20generation','Environment','Apply\x20to\x20all','string','432680lxRIvu','production\x20|\x20daily','value','project','file','Alias\x20for\x20--non-interactive','env','SQL\x20string','Output\x20format','<name>','dbid','Page\x20size','Type\x20filter','db-id','Watch\x20mode','757qVRaMN','key','JSON\x20params','dryRun','description','1008bWcRSr','fromEntries','all','params','Use\x20remote','app','Rabetbase\x20CLI','dbId','force','sqlcode','clear','remote','schemas','121590WCHKBs','Code\x20filter','nonInteractive','Enable\x20BFF\x20save','Force\x20overwrite','802YvhnTX','map','<code>','Page\x20number','format','Output\x20path','sqlName','dry-run','global','output'];a121_0x2c4b=function(){return _0x5deeb8;};return a121_0x2c4b();}(function(_0x474b67,_0x1ec907){const _0x3c6d9d=a121_0x19a4,_0x40cec7=_0x474b67();while(!![]){try{const _0x4ba331=parseInt(_0x3c6d9d(0xdb))/0x1*(parseInt(_0x3c6d9d(0x92))/0x2)+parseInt(_0x3c6d9d(0xba))/0x3*(-parseInt(_0x3c6d9d(0xcc))/0x4)+parseInt(_0x3c6d9d(0xb7))/0x5+-parseInt(_0x3c6d9d(0x8d))/0x6+-parseInt(_0x3c6d9d(0xb8))/0x7+-parseInt(_0x3c6d9d(0xe0))/0x8*(-parseInt(_0x3c6d9d(0xa9))/0x9)+parseInt(_0x3c6d9d(0xb6))/0xa*(parseInt(_0x3c6d9d(0xab))/0xb);if(_0x4ba331===_0x1ec907)break;else _0x40cec7['push'](_0x40cec7['shift']());}catch(_0x344d06){_0x40cec7['push'](_0x40cec7['shift']());}}}(a121_0x2c4b,0x311e8));export const CLI_BIN_NAME=a121_0xb7575d(0xa2);export const CLI_DISPLAY_NAME=a121_0xb7575d(0xe6);export const NPM_PACKAGE_NAME=a121_0xb7575d(0xa6);export const GLOBAL_FLAGS=[{'name':a121_0xb7575d(0xb2),'meowKey':a121_0xb7575d(0xb2),'type':a121_0xb7575d(0xcb),'description':a121_0xb7575d(0xae),'hint':a121_0xb7575d(0x94)},{'name':'app','meowKey':a121_0xb7575d(0xe5),'type':'string','description':'Select\x20app\x20profile\x20by\x20name','hint':a121_0xb7575d(0xd5)},{'name':a121_0xb7575d(0xd2),'meowKey':a121_0xb7575d(0xd2),'type':a121_0xb7575d(0xcb),'description':a121_0xb7575d(0xc9),'hint':a121_0xb7575d(0xcd)},{'name':'format','meowKey':a121_0xb7575d(0x96),'type':a121_0xb7575d(0xcb),'description':a121_0xb7575d(0xd4),'hint':a121_0xb7575d(0xa8)},{'name':'jq','meowKey':'jq','type':a121_0xb7575d(0xcb),'description':'Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','hint':a121_0xb7575d(0xa5)},{'name':a121_0xb7575d(0x99),'meowKey':a121_0xb7575d(0xde),'type':'boolean','description':a121_0xb7575d(0xc7)},{'name':a121_0xb7575d(0xbe),'meowKey':a121_0xb7575d(0xbe),'type':'boolean','description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':'non-interactive','meowKey':a121_0xb7575d(0x8f),'type':'boolean','description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':'global','meowKey':a121_0xb7575d(0x9a),'type':'boolean','description':a121_0xb7575d(0xc5)},{'name':a121_0xb7575d(0xcf),'meowKey':a121_0xb7575d(0xcf),'type':a121_0xb7575d(0x9c),'description':a121_0xb7575d(0xc6)},{'name':'ci','meowKey':'ci','type':'boolean','description':a121_0xb7575d(0xd1),'hidden':!![]},{'name':'help','meowKey':'help','type':a121_0xb7575d(0x9c),'description':'Show\x20help'},{'name':'name','meowKey':a121_0xb7575d(0xa4),'type':'string','description':a121_0xb7575d(0xa3),'hidden':!![]},{'name':a121_0xb7575d(0xea),'meowKey':a121_0xb7575d(0xea),'type':a121_0xb7575d(0x9c),'description':'Clear','hidden':!![]},{'name':a121_0xb7575d(0xa7),'meowKey':'watch','type':'boolean','description':a121_0xb7575d(0xda),'hidden':!![]},{'name':a121_0xb7575d(0x9b),'meowKey':a121_0xb7575d(0x9b),'type':a121_0xb7575d(0xcb),'description':a121_0xb7575d(0x97),'hidden':!![]},{'name':a121_0xb7575d(0xe3),'meowKey':'params','type':'string','description':a121_0xb7575d(0xdd),'hidden':!![]},{'name':a121_0xb7575d(0xac),'meowKey':a121_0xb7575d(0xac),'type':'string','description':'Dataset\x20code','hidden':!![]},{'name':'all','meowKey':a121_0xb7575d(0xe2),'type':a121_0xb7575d(0x9c),'description':a121_0xb7575d(0xca),'hidden':!![]},{'name':'enable-bff-save','meowKey':a121_0xb7575d(0xc3),'type':'boolean','description':a121_0xb7575d(0x90),'hidden':!![]},{'name':'id','meowKey':'id','type':a121_0xb7575d(0xcb),'description':a121_0xb7575d(0xc2),'hidden':!![]},{'name':a121_0xb7575d(0x9f),'meowKey':a121_0xb7575d(0x9f),'type':a121_0xb7575d(0xcb),'description':a121_0xb7575d(0xd8),'hidden':!![]},{'name':a121_0xb7575d(0xd0),'meowKey':a121_0xb7575d(0xd0),'type':a121_0xb7575d(0xcb),'description':'File\x20path','hidden':!![]},{'name':a121_0xb7575d(0xe9),'meowKey':a121_0xb7575d(0xe9),'type':a121_0xb7575d(0xcb),'description':'SQL\x20code','hidden':!![]},{'name':'sql-name','meowKey':a121_0xb7575d(0x98),'type':a121_0xb7575d(0xcb),'description':'SQL\x20name','hidden':!![]},{'name':a121_0xb7575d(0xb0),'meowKey':a121_0xb7575d(0xb0),'type':a121_0xb7575d(0xcb),'description':a121_0xb7575d(0xc4),'hidden':!![]},{'name':a121_0xb7575d(0xd9),'meowKey':a121_0xb7575d(0xe7),'type':a121_0xb7575d(0xcb),'description':a121_0xb7575d(0xa1),'hidden':!![]},{'name':a121_0xb7575d(0xd6),'meowKey':a121_0xb7575d(0xd6),'type':'string','description':a121_0xb7575d(0xa1),'hidden':!![]},{'name':a121_0xb7575d(0xdf),'meowKey':'description','type':a121_0xb7575d(0xcb),'description':'Description','hidden':!![]},{'name':a121_0xb7575d(0xbb),'meowKey':a121_0xb7575d(0xbb),'type':a121_0xb7575d(0xcb),'description':a121_0xb7575d(0x95),'hidden':!![]},{'name':a121_0xb7575d(0xb9),'meowKey':'pagesize','type':a121_0xb7575d(0xcb),'description':a121_0xb7575d(0xd7),'hidden':!![]},{'name':'keyword','meowKey':a121_0xb7575d(0xb1),'type':a121_0xb7575d(0xcb),'description':'Keyword\x20filter','hidden':!![]},{'name':'code','meowKey':a121_0xb7575d(0x9e),'type':'string','description':a121_0xb7575d(0x8e),'hidden':!![]},{'name':'sql','meowKey':a121_0xb7575d(0xc1),'type':'string','description':a121_0xb7575d(0xd3),'hidden':!![]},{'name':a121_0xb7575d(0x8c),'meowKey':a121_0xb7575d(0x8c),'type':a121_0xb7575d(0xcb),'description':a121_0xb7575d(0xad),'hidden':!![]},{'name':a121_0xb7575d(0x9d),'meowKey':a121_0xb7575d(0x9d),'type':'string','description':a121_0xb7575d(0xaf),'hidden':!![]},{'name':a121_0xb7575d(0xb4),'meowKey':'target','type':a121_0xb7575d(0xcb),'description':a121_0xb7575d(0xc0),'hidden':!![]},{'name':a121_0xb7575d(0xb5),'meowKey':a121_0xb7575d(0xaa),'type':a121_0xb7575d(0x9c),'description':a121_0xb7575d(0xc8),'hidden':!![]},{'name':'key','meowKey':a121_0xb7575d(0xdc),'type':a121_0xb7575d(0xcb),'description':'Config\x20key','hidden':!![]},{'name':a121_0xb7575d(0xce),'meowKey':'value','type':a121_0xb7575d(0xcb),'description':'Config\x20value','hidden':!![]},{'name':a121_0xb7575d(0xe8),'meowKey':a121_0xb7575d(0xe8),'type':a121_0xb7575d(0x9c),'description':a121_0xb7575d(0x91),'hidden':!![]},{'name':a121_0xb7575d(0xeb),'meowKey':a121_0xb7575d(0xeb),'type':a121_0xb7575d(0x9c),'description':a121_0xb7575d(0xe4),'hidden':!![]},{'name':a121_0xb7575d(0xa0),'meowKey':'verbose','type':a121_0xb7575d(0x9c),'description':a121_0xb7575d(0xbd),'hidden':!![]},{'name':'operation-type','meowKey':a121_0xb7575d(0xbf),'type':'string','description':a121_0xb7575d(0xaf),'hidden':!![]},{'name':a121_0xb7575d(0xbc),'meowKey':a121_0xb7575d(0xb3),'type':a121_0xb7575d(0xcb),'description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a121_0xb7575d(0xb2),'app',a121_0xb7575d(0xd2),a121_0xb7575d(0x96),'jq',a121_0xb7575d(0x99),a121_0xb7575d(0xbe),'non-interactive','ci']);export function buildMeowFlags(){const _0x34466b=a121_0xb7575d;return Object[_0x34466b(0xe1)](GLOBAL_FLAGS[_0x34466b(0x93)](_0x447b=>[_0x447b['meowKey'],{'type':_0x447b[_0x34466b(0x9f)]}]));}
@@ -1 +1 @@
1
- function a118_0x4134(){const _0x544855=['compress','872886dGjiVU','9751IChSot','en-US','371264KIQwnT','970352FDmTfD','956590bXetFW','11033892uxkcxY','2PXUqaQ','537930CJItUY','3272FSexlU','production','high-risk-write'];a118_0x4134=function(){return _0x544855;};return a118_0x4134();}function a118_0x38cc(_0x343671,_0x10cadb){_0x343671=_0x343671-0x10c;const _0x4134b2=a118_0x4134();let _0x38cc19=_0x4134b2[_0x343671];return _0x38cc19;}const a118_0xdb38ea=a118_0x38cc;(function(_0x2d7ef2,_0x158b91){const _0x39fd6d=a118_0x38cc,_0xd9e9b5=_0x2d7ef2();while(!![]){try{const _0x464231=parseInt(_0x39fd6d(0x10f))/0x1*(parseInt(_0x39fd6d(0x113))/0x2)+parseInt(_0x39fd6d(0x10c))/0x3+parseInt(_0x39fd6d(0x110))/0x4+parseInt(_0x39fd6d(0x111))/0x5+-parseInt(_0x39fd6d(0x114))/0x6+-parseInt(_0x39fd6d(0x10d))/0x7*(-parseInt(_0x39fd6d(0x115))/0x8)+-parseInt(_0x39fd6d(0x112))/0x9;if(_0x464231===_0x158b91)break;else _0xd9e9b5['push'](_0xd9e9b5['shift']());}catch(_0x423b9f){_0xd9e9b5['push'](_0xd9e9b5['shift']());}}}(a118_0x4134,0x55812));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a118_0xdb38ea(0x116),'format':a118_0xdb38ea(0x118),'locale':a118_0xdb38ea(0x10e),'riskLevel':a118_0xdb38ea(0x117),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a118_0xdb38ea(0x118);
1
+ function a122_0x5f40(){const _0x4e453f=['en-US','compress','3154680tegWLq','production','high-risk-write','104XNTHQA','1802976etdCRh','128580hIldRG','415919vAQvIo','307918Zyzlmh','2109435LnGTZG','1298934bTbgyp'];a122_0x5f40=function(){return _0x4e453f;};return a122_0x5f40();}const a122_0x2d5fc1=a122_0x4379;function a122_0x4379(_0x573fb0,_0x353942){_0x573fb0=_0x573fb0-0x1a5;const _0x5f40a9=a122_0x5f40();let _0x4379af=_0x5f40a9[_0x573fb0];return _0x4379af;}(function(_0x428247,_0x9c5527){const _0x40b2aa=a122_0x4379,_0x1b625b=_0x428247();while(!![]){try{const _0xbc5829=parseInt(_0x40b2aa(0x1ae))/0x1+-parseInt(_0x40b2aa(0x1b0))/0x2+parseInt(_0x40b2aa(0x1af))/0x3+parseInt(_0x40b2aa(0x1ab))/0x4+parseInt(_0x40b2aa(0x1a7))/0x5+-parseInt(_0x40b2aa(0x1ac))/0x6+-parseInt(_0x40b2aa(0x1ad))/0x7*(parseInt(_0x40b2aa(0x1aa))/0x8);if(_0xbc5829===_0x9c5527)break;else _0x1b625b['push'](_0x1b625b['shift']());}catch(_0xe07046){_0x1b625b['push'](_0x1b625b['shift']());}}}(a122_0x5f40,0x9e8d1));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a122_0x2d5fc1(0x1a8),'format':a122_0x2d5fc1(0x1a6),'locale':a122_0x2d5fc1(0x1a5),'riskLevel':a122_0x2d5fc1(0x1a9),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a122_0x2d5fc1(0x1a6);
@@ -1 +1 @@
1
- function a119_0x2f07(_0x498c01,_0xf7717c){_0x498c01=_0x498c01-0x166;const _0x2d5500=a119_0x2d55();let _0x2f0771=_0x2d5500[_0x498c01];return _0x2f0771;}const a119_0x31744e=a119_0x2f07;(function(_0x4f0b35,_0x2e487d){const _0x295ab6=a119_0x2f07,_0x4c47e6=_0x4f0b35();while(!![]){try{const _0x1e2c20=-parseInt(_0x295ab6(0x16a))/0x1*(parseInt(_0x295ab6(0x167))/0x2)+parseInt(_0x295ab6(0x16e))/0x3*(parseInt(_0x295ab6(0x171))/0x4)+parseInt(_0x295ab6(0x16c))/0x5*(parseInt(_0x295ab6(0x169))/0x6)+parseInt(_0x295ab6(0x166))/0x7+-parseInt(_0x295ab6(0x16f))/0x8+parseInt(_0x295ab6(0x16b))/0x9+parseInt(_0x295ab6(0x168))/0xa*(-parseInt(_0x295ab6(0x16d))/0xb);if(_0x1e2c20===_0x2e487d)break;else _0x4c47e6['push'](_0x4c47e6['shift']());}catch(_0x4f33dc){_0x4c47e6['push'](_0x4c47e6['shift']());}}}(a119_0x2d55,0x53fb9));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a119_0x2d55(){const _0xf411ae=['6055587gfRfHt','247780KJUYXc','1364xsXUVM','3zbSwlz','2396560XBMkXv','https://daily-api.lovrabet.com','2461996iDoWuH','https://daily-runtime.lovrabet.com','https://runtime.lovrabet.com','4036179vEyERO','100072TkNaLn','82280pYxUPK','12lDLuQb','6LbaNYA'];a119_0x2d55=function(){return _0xf411ae;};return a119_0x2d55();}export function initDomains(_0x240427){customApiDomain=_0x240427?.['apiDomain'],customUserDomain=_0x240427?.['userDomain'],customRuntimeDomain=_0x240427?.['runtimeDomain'];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':'https://user-daily.lovrabet.com');export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':a119_0x31744e(0x170));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a119_0x31744e(0x173):a119_0x31744e(0x172));
1
+ const a123_0x1abe74=a123_0x5763;(function(_0x234ed0,_0x18d794){const _0x7f915c=a123_0x5763,_0x5a3544=_0x234ed0();while(!![]){try{const _0x2cefbd=-parseInt(_0x7f915c(0x77))/0x1+parseInt(_0x7f915c(0x72))/0x2+parseInt(_0x7f915c(0x76))/0x3*(parseInt(_0x7f915c(0x6f))/0x4)+parseInt(_0x7f915c(0x74))/0x5*(parseInt(_0x7f915c(0x69))/0x6)+-parseInt(_0x7f915c(0x75))/0x7*(parseInt(_0x7f915c(0x6e))/0x8)+-parseInt(_0x7f915c(0x70))/0x9*(parseInt(_0x7f915c(0x6a))/0xa)+parseInt(_0x7f915c(0x6b))/0xb*(-parseInt(_0x7f915c(0x73))/0xc);if(_0x2cefbd===_0x18d794)break;else _0x5a3544['push'](_0x5a3544['shift']());}catch(_0x58ccf6){_0x5a3544['push'](_0x5a3544['shift']());}}}(a123_0x5466,0x6408b));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a123_0x5763(_0x3711db,_0x391456){_0x3711db=_0x3711db-0x68;const _0x546632=a123_0x5466();let _0x5763fc=_0x546632[_0x3711db];return _0x5763fc;}function a123_0x5466(){const _0x298270=['1465494CmpTTk','70HmqWdl','55qVWiea','https://daily-api.lovrabet.com','userDomain','1736sKIVJi','8pDMlJN','121041ZqEOYN','https://user-daily.lovrabet.com','1284032pwPCzs','409272IsKubL','10pzBGuN','25403oQLQzL','938796sbGjbR','294473ZhlVpY','runtimeDomain'];a123_0x5466=function(){return _0x298270;};return a123_0x5466();}export function initDomains(_0x2742bb){const _0x43569c=a123_0x5763;customApiDomain=_0x2742bb?.['apiDomain'],customUserDomain=_0x2742bb?.[_0x43569c(0x6d)],customRuntimeDomain=_0x2742bb?.[_0x43569c(0x68)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a123_0x1abe74(0x71));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':a123_0x1abe74(0x6c));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?'https://runtime.lovrabet.com':'https://daily-runtime.lovrabet.com');
@@ -1 +1 @@
1
- function a120_0x411c(_0x35f108,_0x584394){_0x35f108=_0x35f108-0x17a;const _0x1431cd=a120_0x1431();let _0x411ce2=_0x1431cd[_0x35f108];return _0x411ce2;}const a120_0x18f944=a120_0x411c;(function(_0x2d4fc2,_0x28336b){const _0x3907e8=a120_0x411c,_0xdc8491=_0x2d4fc2();while(!![]){try{const _0x3c1a5d=-parseInt(_0x3907e8(0x17b))/0x1+parseInt(_0x3907e8(0x188))/0x2*(parseInt(_0x3907e8(0x187))/0x3)+parseInt(_0x3907e8(0x17f))/0x4+-parseInt(_0x3907e8(0x182))/0x5*(parseInt(_0x3907e8(0x184))/0x6)+parseInt(_0x3907e8(0x183))/0x7*(-parseInt(_0x3907e8(0x181))/0x8)+parseInt(_0x3907e8(0x17a))/0x9+-parseInt(_0x3907e8(0x17c))/0xa;if(_0x3c1a5d===_0x28336b)break;else _0xdc8491['push'](_0xdc8491['shift']());}catch(_0x37fa40){_0xdc8491['push'](_0xdc8491['shift']());}}}(a120_0x1431,0x4f998));export const RABETBASE_ENV_VALUES=['production','daily'];export function normalizeEnv(_0x36b417){const _0x1cec5a=a120_0x411c;return _0x36b417===_0x1cec5a(0x185)?_0x1cec5a(0x17d):_0x36b417;}function a120_0x1431(){const _0x2fb471=['52764xGOPnk','online','development','1442187BGxmbx','2kMoVRm','3566277xIhvEU','416077AYUurj','269050dHFmXb','production','dev','434148TJpHUn','daily','465640BQueXs','90tIbYdw','7OlnHbI'];a120_0x1431=function(){return _0x2fb471;};return a120_0x1431();}export function isProduction(_0x4e7c88){const _0x2bef82=a120_0x411c;return normalizeEnv(_0x4e7c88)===_0x2bef82(0x17d);}export function isDaily(_0x3a8f1c){const _0x3ecaed=a120_0x411c;return normalizeEnv(_0x3a8f1c)===_0x3ecaed(0x180);}export function isDev(_0xf5b0ed){const _0x4db6a0=a120_0x411c,_0xc1f13e=normalizeEnv(_0xf5b0ed);return _0xc1f13e===_0x4db6a0(0x186)||_0xc1f13e===_0x4db6a0(0x17e);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a120_0x18f944(0x17d));export function getEnv(){return env;}export function initEnv(_0x225993){env=normalizeEnv(_0x225993);}
1
+ const a124_0x55a7e8=a124_0x5bab;(function(_0x43397c,_0x508898){const _0xa4722d=a124_0x5bab,_0x55e104=_0x43397c();while(!![]){try{const _0x299097=-parseInt(_0xa4722d(0xd3))/0x1*(-parseInt(_0xa4722d(0xd2))/0x2)+-parseInt(_0xa4722d(0xd0))/0x3*(-parseInt(_0xa4722d(0xd4))/0x4)+-parseInt(_0xa4722d(0xdc))/0x5*(-parseInt(_0xa4722d(0xcd))/0x6)+-parseInt(_0xa4722d(0xdb))/0x7*(parseInt(_0xa4722d(0xd6))/0x8)+parseInt(_0xa4722d(0xd8))/0x9+parseInt(_0xa4722d(0xda))/0xa*(parseInt(_0xa4722d(0xd9))/0xb)+parseInt(_0xa4722d(0xcc))/0xc*(-parseInt(_0xa4722d(0xd7))/0xd);if(_0x299097===_0x508898)break;else _0x55e104['push'](_0x55e104['shift']());}catch(_0x524370){_0x55e104['push'](_0x55e104['shift']());}}}(a124_0x408c,0xd83f3));function a124_0x5bab(_0xc9ee2f,_0x10aadb){_0xc9ee2f=_0xc9ee2f-0xcc;const _0x408c46=a124_0x408c();let _0x5bab6d=_0x408c46[_0xc9ee2f];return _0x5bab6d;}export const RABETBASE_ENV_VALUES=[a124_0x55a7e8(0xd5),a124_0x55a7e8(0xce)];export function normalizeEnv(_0x72cd39){const _0xacac5a=a124_0x55a7e8;return _0x72cd39===_0xacac5a(0xd1)?_0xacac5a(0xd5):_0x72cd39;}export function isProduction(_0x2416ca){const _0x5db0f4=a124_0x55a7e8;return normalizeEnv(_0x2416ca)===_0x5db0f4(0xd5);}export function isDaily(_0x5d7dc1){const _0x4632d0=a124_0x55a7e8;return normalizeEnv(_0x5d7dc1)===_0x4632d0(0xce);}export function isDev(_0x352c63){const _0x34ac6a=a124_0x55a7e8,_0x1ea022=normalizeEnv(_0x352c63);return _0x1ea022==='development'||_0x1ea022===_0x34ac6a(0xcf);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||'production');function a124_0x408c(){const _0x3095af=['40xFiuXq','288588vVVJsx','448596AeMfVS','daily','dev','6JFviwA','online','483694PPFziY','1eMnnkg','1951968vqBoML','production','552oIQtFO','1742vvDAso','15569208KAuwQC','253szYiqI','388390UfdLNY','33565GTHRzW'];a124_0x408c=function(){return _0x3095af;};return a124_0x408c();}export function getEnv(){return env;}export function initEnv(_0x131773){env=normalizeEnv(_0x131773);}
@@ -1 +1 @@
1
- const a121_0x209622=a121_0x50f7;(function(_0x1e9c20,_0x137846){const _0x547270=a121_0x50f7,_0x4d1ac0=_0x1e9c20();while(!![]){try{const _0x30ffca=-parseInt(_0x547270(0x17f))/0x1*(-parseInt(_0x547270(0x181))/0x2)+-parseInt(_0x547270(0x180))/0x3*(parseInt(_0x547270(0x186))/0x4)+parseInt(_0x547270(0x184))/0x5+parseInt(_0x547270(0x17a))/0x6+-parseInt(_0x547270(0x182))/0x7*(parseInt(_0x547270(0x183))/0x8)+parseInt(_0x547270(0x17d))/0x9+-parseInt(_0x547270(0x17b))/0xa;if(_0x30ffca===_0x137846)break;else _0x4d1ac0['push'](_0x4d1ac0['shift']());}catch(_0x1bbc96){_0x4d1ac0['push'](_0x4d1ac0['shift']());}}}(a121_0x197a,0xbd89f));function a121_0x50f7(_0x5f373d,_0x2c53e5){_0x5f373d=_0x5f373d-0x17a;const _0x197a9b=a121_0x197a();let _0x50f768=_0x197a9b[_0x5f373d];return _0x50f768;}export const RABETBASE_OUTPUT_FORMAT_VALUES=[a121_0x209622(0x185),a121_0x209622(0x17e),a121_0x209622(0x17c)];function a121_0x197a(){const _0x26b87b=['10656684TzAdcL','pretty','1wxWHvz','186GUaAAU','2491858SpqDkd','119vJXwNa','171128vXfeGd','4983335DhTNDv','json','65724SsolYE','3120678TyepUP','17880650bIyRfB','compress'];a121_0x197a=function(){return _0x26b87b;};return a121_0x197a();}
1
+ const a125_0x2e0033=a125_0x28d6;function a125_0x2116(){const _0x5e2de1=['pretty','json','10kQhtLa','14ndvzAB','1436500TazFGH','1161333aPtote','142164ZQgoGG','958908HlJRfI','12860456qLcJeA','2847650JdqZte','43832TxCFpo','640fxbxxr','456YEKJKl','3KupAxr'];a125_0x2116=function(){return _0x5e2de1;};return a125_0x2116();}function a125_0x28d6(_0x17f0c1,_0x15f9e8){_0x17f0c1=_0x17f0c1-0xc3;const _0x211637=a125_0x2116();let _0x28d67c=_0x211637[_0x17f0c1];return _0x28d67c;}(function(_0x4a31c5,_0xb99608){const _0x35743b=a125_0x28d6,_0x42b942=_0x4a31c5();while(!![]){try{const _0x3d338a=-parseInt(_0x35743b(0xc5))/0x1+-parseInt(_0x35743b(0xca))/0x2*(-parseInt(_0x35743b(0xce))/0x3)+-parseInt(_0x35743b(0xcb))/0x4*(parseInt(_0x35743b(0xcc))/0x5)+-parseInt(_0x35743b(0xc8))/0x6*(-parseInt(_0x35743b(0xc4))/0x7)+parseInt(_0x35743b(0xc9))/0x8+-parseInt(_0x35743b(0xc6))/0x9*(parseInt(_0x35743b(0xc3))/0xa)+-parseInt(_0x35743b(0xc7))/0xb*(-parseInt(_0x35743b(0xcd))/0xc);if(_0x3d338a===_0xb99608)break;else _0x42b942['push'](_0x42b942['shift']());}catch(_0x274f97){_0x42b942['push'](_0x42b942['shift']());}}}(a125_0x2116,0xd55f1));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a125_0x2e0033(0xd0),a125_0x2e0033(0xcf),'compress'];
@@ -1 +1 @@
1
- const a122_0x106e55=a122_0x5d10;function a122_0x4c7d(){const _0x2794e2=['3114668wTFfxq','./src/api','7464904SwsILG','114946KjWMPw','22JqudFH','13731300iBeufF','41379080SqjpSF','3yGlphy','146796NWgWNB','8073800aanjfI','40QvKAbd'];a122_0x4c7d=function(){return _0x2794e2;};return a122_0x4c7d();}function a122_0x5d10(_0x618854,_0x413bc6){_0x618854=_0x618854-0xdb;const _0x4c7dc8=a122_0x4c7d();let _0x5d1056=_0x4c7dc8[_0x618854];return _0x5d1056;}(function(_0x2bb1ac,_0x2d2029){const _0x399cd7=a122_0x5d10,_0x2d484f=_0x2bb1ac();while(!![]){try{const _0x5b1ee4=parseInt(_0x399cd7(0xe5))/0x1*(parseInt(_0x399cd7(0xdb))/0x2)+parseInt(_0x399cd7(0xde))/0x3*(-parseInt(_0x399cd7(0xe2))/0x4)+-parseInt(_0x399cd7(0xe1))/0x5*(parseInt(_0x399cd7(0xdf))/0x6)+-parseInt(_0x399cd7(0xe0))/0x7+-parseInt(_0x399cd7(0xe4))/0x8+-parseInt(_0x399cd7(0xdc))/0x9+parseInt(_0x399cd7(0xdd))/0xa;if(_0x5b1ee4===_0x2d2029)break;else _0x2d484f['push'](_0x2d484f['shift']());}catch(_0x3870a3){_0x2d484f['push'](_0x2d484f['shift']());}}}(a122_0x4c7d,0xc725a));export const DEFAULT_API_DIR=a122_0x106e55(0xe3);
1
+ function a126_0x1372(_0xe3c63d,_0x2ea1ea){_0xe3c63d=_0xe3c63d-0xc6;const _0x3576e0=a126_0x3576();let _0x1372de=_0x3576e0[_0xe3c63d];return _0x1372de;}const a126_0x348318=a126_0x1372;function a126_0x3576(){const _0x38cb18=['944983kukxqJ','./src/api','64nUkUlF','11345040HHJfQN','2VzUWZt','38647ogJbuE','1204208kslqMY','6877215KyFlfn','2533701MTxCQS','8099532jprCcR'];a126_0x3576=function(){return _0x38cb18;};return a126_0x3576();}(function(_0x39c00c,_0x1fcc26){const _0x11c34c=a126_0x1372,_0x4f49cd=_0x39c00c();while(!![]){try{const _0x28caf7=parseInt(_0x11c34c(0xc6))/0x1*(parseInt(_0x11c34c(0xca))/0x2)+parseInt(_0x11c34c(0xce))/0x3+parseInt(_0x11c34c(0xcc))/0x4+-parseInt(_0x11c34c(0xcd))/0x5+parseInt(_0x11c34c(0xcf))/0x6+-parseInt(_0x11c34c(0xcb))/0x7*(parseInt(_0x11c34c(0xc8))/0x8)+-parseInt(_0x11c34c(0xc9))/0x9;if(_0x28caf7===_0x1fcc26)break;else _0x4f49cd['push'](_0x4f49cd['shift']());}catch(_0x5961f9){_0x4f49cd['push'](_0x4f49cd['shift']());}}}(a126_0x3576,0xb9a21));export const DEFAULT_API_DIR=a126_0x348318(0xc7);
@@ -1 +1 @@
1
- function a123_0x4d79(_0x4e387e,_0x30b3cf){_0x4e387e=_0x4e387e-0xc7;const _0x2b9818=a123_0x2b98();let _0x4d7934=_0x2b9818[_0x4e387e];return _0x4d7934;}const a123_0x55f0ee=a123_0x4d79;function a123_0x2b98(){const _0x37a883=['902tGrOOt','208524PAizyk','42ssFprM','high-risk-write','2725790ZqQwuD','756843dpkEnS','69396MGfwdw','22959oONzvp','8WAIerK','14MmWtzi','read','40qNUGxs','3721620UIxkKo','308192NcFTze'];a123_0x2b98=function(){return _0x37a883;};return a123_0x2b98();}(function(_0x66d6c8,_0x51c15e){const _0x16ce07=a123_0x4d79,_0x9f06ed=_0x66d6c8();while(!![]){try{const _0x3a2c02=parseInt(_0x16ce07(0xd1))/0x1+-parseInt(_0x16ce07(0xd2))/0x2*(parseInt(_0x16ce07(0xce))/0x3)+-parseInt(_0x16ce07(0xd4))/0x4*(-parseInt(_0x16ce07(0xd0))/0x5)+parseInt(_0x16ce07(0xca))/0x6+parseInt(_0x16ce07(0xc7))/0x7*(parseInt(_0x16ce07(0xcb))/0x8)+-parseInt(_0x16ce07(0xd3))/0x9*(parseInt(_0x16ce07(0xc9))/0xa)+parseInt(_0x16ce07(0xcc))/0xb*(-parseInt(_0x16ce07(0xcd))/0xc);if(_0x3a2c02===_0x51c15e)break;else _0x9f06ed['push'](_0x9f06ed['shift']());}catch(_0x3f5074){_0x9f06ed['push'](_0x9f06ed['shift']());}}}(a123_0x2b98,0x983e3));export const RISK_LEVEL_VALUES=[a123_0x55f0ee(0xc8),'write',a123_0x55f0ee(0xcf)];
1
+ const a127_0x296583=a127_0x37d0;function a127_0x37d0(_0x504477,_0x439024){_0x504477=_0x504477-0x17b;const _0x1a1f4d=a127_0x1a1f();let _0x37d08a=_0x1a1f4d[_0x504477];return _0x37d08a;}(function(_0x12fcbf,_0x5dd594){const _0x340112=a127_0x37d0,_0x42a136=_0x12fcbf();while(!![]){try{const _0x21f9bd=-parseInt(_0x340112(0x180))/0x1+-parseInt(_0x340112(0x17c))/0x2+parseInt(_0x340112(0x184))/0x3+-parseInt(_0x340112(0x17e))/0x4+-parseInt(_0x340112(0x182))/0x5*(parseInt(_0x340112(0x17b))/0x6)+-parseInt(_0x340112(0x185))/0x7+parseInt(_0x340112(0x17f))/0x8;if(_0x21f9bd===_0x5dd594)break;else _0x42a136['push'](_0x42a136['shift']());}catch(_0x39a54e){_0x42a136['push'](_0x42a136['shift']());}}}(a127_0x1a1f,0xcc09f));function a127_0x1a1f(){const _0x325632=['high-risk-write','3371795iMCmbm','read','3075627DNaYlF','182336FIEzyw','6OMxGct','2856284MzLkwL','write','3191948ZeZWRD','30813912EsBUGp','1114669YigQne'];a127_0x1a1f=function(){return _0x325632;};return a127_0x1a1f();}export const RISK_LEVEL_VALUES=[a127_0x296583(0x183),a127_0x296583(0x17d),a127_0x296583(0x181)];