@lovrabet/rabetbase-cli 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) 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 -1
  48. package/lib/commands/data/getOne.js +1 -1
  49. package/lib/commands/data/index.js +1 -1
  50. package/lib/commands/data/shared.js +1 -1
  51. package/lib/commands/dataset/capability.js +1 -1
  52. package/lib/commands/dataset/delete.js +1 -1
  53. package/lib/commands/dataset/detail.js +1 -1
  54. package/lib/commands/dataset/extend-update.js +1 -1
  55. package/lib/commands/dataset/field-update.js +1 -1
  56. package/lib/commands/dataset/index.js +1 -1
  57. package/lib/commands/dataset/list.js +1 -1
  58. package/lib/commands/dataset/operations.js +1 -1
  59. package/lib/commands/dataset/relation-create.js +1 -1
  60. package/lib/commands/dataset/relation-delete.js +1 -1
  61. package/lib/commands/dataset/relation-shared.js +1 -1
  62. package/lib/commands/dataset/relation-update.js +1 -1
  63. package/lib/commands/dataset/relations.js +1 -1
  64. package/lib/commands/dataset/rename.js +1 -1
  65. package/lib/commands/db/analyze-cancel.js +1 -1
  66. package/lib/commands/db/analyze-start.js +1 -1
  67. package/lib/commands/db/analyze-status.js +1 -1
  68. package/lib/commands/db/create.js +1 -1
  69. package/lib/commands/db/delete.js +1 -1
  70. package/lib/commands/db/detail.js +1 -1
  71. package/lib/commands/db/diff.js +1 -1
  72. package/lib/commands/db/index.js +1 -1
  73. package/lib/commands/db/list.js +1 -1
  74. package/lib/commands/db/shared.js +1 -1
  75. package/lib/commands/db/tables.js +1 -1
  76. package/lib/commands/db/test.js +1 -1
  77. package/lib/commands/db/update.js +1 -1
  78. package/lib/commands/doctor.js +1 -1
  79. package/lib/commands/init/index.js +1 -1
  80. package/lib/commands/issue/index.js +1 -1
  81. package/lib/commands/issue/nudge.js +1 -1
  82. package/lib/commands/issue/report.js +1 -1
  83. package/lib/commands/issue/shared.js +1 -1
  84. package/lib/commands/logs/index.js +1 -1
  85. package/lib/commands/menu/index.js +1 -1
  86. package/lib/commands/menu/shared/compare-table.js +1 -1
  87. package/lib/commands/menu/shared/index.js +1 -1
  88. package/lib/commands/menu/shared/inquirer.js +1 -1
  89. package/lib/commands/menu/shared/local-pages.js +1 -1
  90. package/lib/commands/menu/shared/logic.js +1 -1
  91. package/lib/commands/menu/shared/service.js +1 -1
  92. package/lib/commands/menu/shared/sync-core.js +1 -1
  93. package/lib/commands/menu/shared/update-core.js +1 -1
  94. package/lib/commands/menu/shared/valid-url.js +1 -1
  95. package/lib/commands/menu/sync.js +1 -1
  96. package/lib/commands/menu/update.js +1 -1
  97. package/lib/commands/page/generate-start.js +1 -1
  98. package/lib/commands/page/generate-status.js +1 -1
  99. package/lib/commands/page/index.js +1 -1
  100. package/lib/commands/page/pull.js +1 -1
  101. package/lib/commands/page/push.js +1 -1
  102. package/lib/commands/page/relation-audit.js +1 -1
  103. package/lib/commands/page/shared.js +1 -1
  104. package/lib/commands/page/standard-page-status.js +1 -1
  105. package/lib/commands/page/sync.js +1 -1
  106. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  107. package/lib/commands/project/create/format-elapsed.js +1 -1
  108. package/lib/commands/project/create/main.js +1 -1
  109. package/lib/commands/project/create/non-interactive.js +1 -1
  110. package/lib/commands/project/create/project-template-path.js +1 -1
  111. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  112. package/lib/commands/project/create/use-format-code.js +1 -1
  113. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  114. package/lib/commands/project/index.js +1 -1
  115. package/lib/commands/project/init.js +1 -1
  116. package/lib/commands/project/upgrade.js +1 -1
  117. package/lib/commands/registry.js +1 -1
  118. package/lib/commands/run/index.js +1 -1
  119. package/lib/commands/schema.js +1 -1
  120. package/lib/commands/skill/index.js +1 -1
  121. package/lib/commands/sql/create.js +1 -1
  122. package/lib/commands/sql/delete.js +1 -1
  123. package/lib/commands/sql/detail.js +1 -1
  124. package/lib/commands/sql/exec.js +1 -1
  125. package/lib/commands/sql/index.js +1 -1
  126. package/lib/commands/sql/list.js +1 -1
  127. package/lib/commands/sql/pull.js +1 -1
  128. package/lib/commands/sql/push.js +1 -1
  129. package/lib/commands/sql/save.js +1 -1
  130. package/lib/commands/sql/shared.js +1 -1
  131. package/lib/commands/sql/status.js +1 -1
  132. package/lib/commands/sql/validate.js +1 -1
  133. package/lib/config/schema.js +1 -1
  134. package/lib/constant/cdn.js +1 -1
  135. package/lib/constant/cli.js +1 -1
  136. package/lib/constant/defaults.js +1 -1
  137. package/lib/constant/domain.js +1 -1
  138. package/lib/constant/env.js +1 -1
  139. package/lib/constant/output.js +1 -1
  140. package/lib/constant/paths.js +1 -1
  141. package/lib/constant/risk.js +1 -1
  142. package/lib/context.js +1 -1
  143. package/lib/core/alias-resolver.js +1 -1
  144. package/lib/core/api-client.js +1 -1
  145. package/lib/core/bff/config.js +1 -1
  146. package/lib/core/bff/file-system.js +1 -1
  147. package/lib/core/bff/hash.js +1 -1
  148. package/lib/core/bff/lock.js +1 -1
  149. package/lib/core/bff/utils.js +1 -1
  150. package/lib/core/db-resolver.js +1 -1
  151. package/lib/core/page/file-system.js +1 -1
  152. package/lib/core/page/hash.js +1 -1
  153. package/lib/core/page/lock.js +1 -1
  154. package/lib/core/sql-sync/config.js +1 -1
  155. package/lib/core/sql-sync/file-system.js +1 -1
  156. package/lib/core/sql-sync/hash.js +1 -1
  157. package/lib/core/sql-sync/lock.js +1 -1
  158. package/lib/core/sql-sync/utils.js +1 -1
  159. package/lib/core/sql-validator.js +1 -1
  160. package/lib/errors.js +1 -1
  161. package/lib/framework/build-all-flags.js +1 -1
  162. package/lib/framework/flags.js +1 -1
  163. package/lib/framework/help.js +1 -1
  164. package/lib/framework/index.js +1 -1
  165. package/lib/framework/output.js +1 -1
  166. package/lib/framework/response.js +1 -1
  167. package/lib/framework/runner-alias.js +1 -1
  168. package/lib/framework/runner.js +1 -1
  169. package/lib/framework/schema-export.js +1 -1
  170. package/lib/framework/types.js +1 -1
  171. package/lib/generated/build-info.js +1 -1
  172. package/lib/help.js +1 -1
  173. package/lib/skills/main.js +1 -1
  174. package/lib/skills/npx-skills-add.js +1 -1
  175. package/lib/telemetry/cli-command-trace.js +1 -1
  176. package/lib/telemetry/cli-help-trace.js +1 -1
  177. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  178. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  179. package/lib/telemetry/send-cli-trace-log.js +1 -1
  180. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  181. package/lib/utils/ai_config.js +1 -1
  182. package/lib/utils/apply-jq-filter.js +1 -1
  183. package/lib/utils/cdn-config.js +1 -1
  184. package/lib/utils/check-sdk-version.js +1 -1
  185. package/lib/utils/cli-version-check.js +1 -1
  186. package/lib/utils/cli-version-policy.js +1 -1
  187. package/lib/utils/config.js +1 -1
  188. package/lib/utils/copy-directory.js +1 -1
  189. package/lib/utils/entity-with-id.js +1 -1
  190. package/lib/utils/file-utils.js +1 -1
  191. package/lib/utils/guides-cdn.js +1 -1
  192. package/lib/utils/http-client.js +1 -1
  193. package/lib/utils/is-non-interactive.js +1 -1
  194. package/lib/utils/logger.js +1 -1
  195. package/lib/utils/params.js +1 -1
  196. package/lib/utils/platform.js +1 -1
  197. package/lib/utils/rules-cdn.js +1 -1
  198. package/lib/utils/sleep.js +1 -1
  199. package/lib/utils/template-replacer.js +1 -1
  200. package/lib/utils/update-notice.js +1 -1
  201. package/lib/utils/version.js +1 -1
  202. package/lib/utils/with-active-cookie.js +1 -1
  203. package/lib/utils/write-cli-side-channel.js +1 -1
  204. package/package.json +1 -1
@@ -1 +1 @@
1
- const a127_0x336a76=a127_0x196c;(function(_0x3a7e97,_0x2713c4){const _0x2a76a1=a127_0x196c,_0x3658e2=_0x3a7e97();while(!![]){try{const _0x17c654=parseInt(_0x2a76a1(0x218))/0x1+-parseInt(_0x2a76a1(0x1e0))/0x2*(parseInt(_0x2a76a1(0x206))/0x3)+parseInt(_0x2a76a1(0x1f6))/0x4*(parseInt(_0x2a76a1(0x1f7))/0x5)+parseInt(_0x2a76a1(0x1da))/0x6*(parseInt(_0x2a76a1(0x1f8))/0x7)+-parseInt(_0x2a76a1(0x1fd))/0x8+-parseInt(_0x2a76a1(0x1e5))/0x9*(-parseInt(_0x2a76a1(0x1dc))/0xa)+-parseInt(_0x2a76a1(0x1db))/0xb;if(_0x17c654===_0x2713c4)break;else _0x3658e2['push'](_0x3658e2['shift']());}catch(_0x58f641){_0x3658e2['push'](_0x3658e2['shift']());}}}(a127_0xe37e,0x88faa));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a127_0x196c(_0xb767e4,_0x5dbf89){_0xb767e4=_0xb767e4-0x1d9;const _0xe37e2d=a127_0xe37e();let _0x196ce1=_0xe37e2d[_0xb767e4];return _0x196ce1;}import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';function a127_0xe37e(){const _0x48e8e6=['pull','8190168HuQAIl','description','sqlRoot','sqls','sqlName','appCode','lockFilePath','sqlcode','split','124530ZGaVzN','string','dbId','cancelled','\x20written,\x20','test','str','unchanged','paging','join','POST','write','No\x20remote\x20SQL\x20queries\x20matched.','apps','\x20skipped,\x20','mybatisXml','sqlContent','sqlCode','650546jQXJHX','length','96WMbgvR','4124549cLltTk','2110JnMSsB','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','Pull\x20complete:\x20','would_pull','34JzOjIF','sql','path','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','\x20failed','13302ZenvtO','sqlRootDir','Filter\x20by\x20SQL\x20display\x20name','bool','trimStart','Would\x20pull\x20','name','local\x20differs\x20from\x20remote','\x20SQL\x20file(s)\x20into\x20','toISOString','filter','replace','push','conflict','utf8','skipped','tableData','144664KrZvMU','85IttMzX','476105jswquA','totalCount','force','catch'];a127_0xe37e=function(){return _0x48e8e6;};return a127_0xe37e();}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(_0x1d1906,_0x2e1b7f){const _0x3fb2bf=a127_0x196c,_0x1060d7=[];let _0x637ae7=0x1;while(!![]){const _0x453c2c=await listSqlQueries(_0x1d1906,{'currentPage':_0x637ae7,'pageSize':PAGE_SIZE,'sqlCode':_0x2e1b7f['sqlCode'],'sqlName':_0x2e1b7f[_0x3fb2bf(0x201)]}),_0x210a9a=_0x453c2c[_0x3fb2bf(0x1f5)]??[];_0x1060d7[_0x3fb2bf(0x1f1)](..._0x210a9a);if(_0x210a9a[_0x3fb2bf(0x1d9)]===0x0)break;const _0x1b987d=_0x453c2c[_0x3fb2bf(0x20e)]?.[_0x3fb2bf(0x1f9)];if(_0x1b987d!=null?_0x1060d7[_0x3fb2bf(0x1d9)]>=_0x1b987d:_0x210a9a[_0x3fb2bf(0x1d9)]<PAGE_SIZE)break;_0x637ae7++;}return _0x1060d7;}async function ensureSqlContent(_0x44f3af){const _0x43adf8=a127_0x196c;if(_0x44f3af[_0x43adf8(0x216)]!=null&&String(_0x44f3af[_0x43adf8(0x216)])[_0x43adf8(0x1d9)]>0x0)return _0x44f3af;return getSqlQueryDetail(_0x44f3af[_0x43adf8(0x217)]);}export const sqlPull={'service':a127_0x336a76(0x1e1),'command':a127_0x336a76(0x1fc),'description':a127_0x336a76(0x1dd),'risk':a127_0x336a76(0x211),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a127_0x336a76(0x1eb),'type':a127_0x336a76(0x207),'description':a127_0x336a76(0x1e7)},{'name':a127_0x336a76(0x1fa),'type':'boolean','description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x4dc823){const _0x5934ba=a127_0x336a76,_0x56be6b=loadSqlProjectConfig(_0x4dc823[_0x5934ba(0x202)]),_0x3da7d8=await readSqlLockFile(_0x56be6b[_0x5934ba(0x203)]),{appLock:_0x51af85}=ensureSqlLockScope(_0x3da7d8??createEmptySqlLock(),_0x56be6b[_0x5934ba(0x202)],_0x56be6b[_0x5934ba(0x1ff)],'pull'),_0x170250=await fetchAllSqlQueries(_0x4dc823[_0x5934ba(0x202)],{'sqlCode':_0x4dc823['str'](_0x5934ba(0x204))||undefined,'sqlName':_0x4dc823['str']('name')||undefined}),_0x57cc3d=[];for(const _0x268f19 of _0x170250){const _0x2538d3=await ensureSqlContent(_0x268f19),_0x11bfc5=ensureRemoteSqlContent(_0x2538d3),_0x2a489d=detectModeFromSql(_0x2538d3),_0x1a3606=_0x2538d3[_0x5934ba(0x208)]?await getDbName(_0x4dc823['appCode'],Number(_0x2538d3[_0x5934ba(0x208)]))[_0x5934ba(0x1fb)](()=>undefined):undefined,_0x84443d=buildLocalSqlFileContent({'sqlCode':_0x2538d3[_0x5934ba(0x217)],'sqlName':_0x2538d3['sqlName'],'dbId':_0x2538d3[_0x5934ba(0x208)]},_0x11bfc5,{'dbName':_0x1a3606,'mode':_0x2a489d,'syncedAt':new Date()['toISOString'](),'description':_0x2538d3[_0x5934ba(0x1fe)]}),_0x37d1f4=buildSqlLockEntry(_0x2538d3,_0x11bfc5,'',{'dbName':_0x1a3606}),_0x100773=resolveLocalSqlFilePath(_0x56be6b,_0x2538d3[_0x5934ba(0x217)],_0x37d1f4);let _0x10451c=_0x5934ba(0x1df),_0x559b81;if(await fileExists(_0x100773)){const _0x225111=await readFile(_0x100773,'utf8');isEquivalentPulledSqlFile(_0x225111,_0x84443d,_0x2a489d)?(_0x10451c=_0x5934ba(0x1f4),_0x559b81=_0x5934ba(0x20d)):(_0x10451c=_0x5934ba(0x1f2),_0x559b81=_0x5934ba(0x1e3));}_0x57cc3d[_0x5934ba(0x1f1)]({'sqlCode':_0x2538d3[_0x5934ba(0x217)],'sqlName':_0x2538d3[_0x5934ba(0x201)],'filePath':_0x100773,'status':_0x10451c,'reason':_0x559b81});}return{'method':_0x5934ba(0x210),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x4dc823['appCode'],'sqlCode':_0x4dc823['str'](_0x5934ba(0x204))||null,'sqlName':_0x4dc823['str']('name')||null,'files':_0x57cc3d},'description':_0x5934ba(0x1ea)+_0x57cc3d[_0x5934ba(0x1d9)]+_0x5934ba(0x1ed)+_0x56be6b[_0x5934ba(0x1e6)]};},async 'execute'(_0x5eca45){const _0x5d2ee3=a127_0x336a76,_0x41d2a8=loadSqlProjectConfig(_0x5eca45[_0x5d2ee3(0x202)]),_0x1cdb3f=await readSqlLockFile(_0x41d2a8[_0x5d2ee3(0x203)]),{lockData:_0x30d94e,appLock:_0x201d28}=ensureSqlLockScope(_0x1cdb3f??createEmptySqlLock(),_0x41d2a8[_0x5d2ee3(0x202)],_0x41d2a8[_0x5d2ee3(0x1ff)],'pull'),_0x4a5488=_0x5eca45[_0x5d2ee3(0x1e8)](_0x5d2ee3(0x1fa)),_0x21ffa8=await fetchAllSqlQueries(_0x5eca45[_0x5d2ee3(0x202)],{'sqlCode':_0x5eca45['str'](_0x5d2ee3(0x204))||undefined,'sqlName':_0x5eca45[_0x5d2ee3(0x20c)](_0x5d2ee3(0x1eb))||undefined});if(_0x21ffa8[_0x5d2ee3(0x1d9)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x5d2ee3(0x212)};const _0x59ad3a=[],_0x450c1c=[];for(const _0x45b5b3 of _0x21ffa8){try{_0x59ad3a[_0x5d2ee3(0x1f1)](await ensureSqlContent(_0x45b5b3));}catch(_0x3c0a41){_0x450c1c[_0x5d2ee3(0x1f1)]({'sqlCode':_0x45b5b3[_0x5d2ee3(0x217)],'error':_0x3c0a41 instanceof Error?_0x3c0a41['message']:String(_0x3c0a41)});}}if(_0x4a5488&&!_0x5eca45['nonInteractive']){let _0x20d1d9=![];for(const _0xaebded of _0x59ad3a){const _0x429e12=detectModeFromSql(_0xaebded),_0x20d7b8=_0xaebded[_0x5d2ee3(0x208)]?await getDbName(_0x5eca45[_0x5d2ee3(0x202)],Number(_0xaebded[_0x5d2ee3(0x208)]))[_0x5d2ee3(0x1fb)](()=>undefined):undefined,_0x360838=buildLocalSqlFileContent({'sqlCode':_0xaebded[_0x5d2ee3(0x217)],'sqlName':_0xaebded[_0x5d2ee3(0x201)],'dbId':_0xaebded['dbId']},ensureRemoteSqlContent(_0xaebded),{'dbName':_0x20d7b8,'mode':_0x429e12,'syncedAt':new Date()[_0x5d2ee3(0x1ee)](),'description':_0xaebded[_0x5d2ee3(0x1fe)]}),_0x5a9c2c=resolveLocalSqlFilePath(_0x41d2a8,_0xaebded[_0x5d2ee3(0x217)],buildSqlLockEntry(_0xaebded,ensureRemoteSqlContent(_0xaebded),'',{'dbName':_0x20d7b8}));if(await fileExists(_0x5a9c2c)){const _0x5f1dc1=await readFile(_0x5a9c2c,_0x5d2ee3(0x1f3));if(!isEquivalentPulledSqlFile(_0x5f1dc1,_0x360838,_0x429e12)){_0x20d1d9=!![];break;}}}if(_0x20d1d9){const _0x5984bc=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x5984bc)throw CliErrors[_0x5d2ee3(0x209)]('Force\x20pull\x20cancelled.');}}const _0x495e17=cloneSqlLockData(_0x30d94e),_0x3fd35d=_0x495e17[_0x5d2ee3(0x213)][_0x41d2a8[_0x5d2ee3(0x202)]],_0x4a6bc1=[],_0x408938=[];for(const _0x26006c of _0x59ad3a){const _0x50fb35=_0x3fd35d[_0x5d2ee3(0x200)][_0x26006c['sqlCode']],_0x49f471=ensureRemoteSqlContent(_0x26006c),_0x39729a=detectModeFromSql(_0x26006c),_0x40faa7=_0x26006c[_0x5d2ee3(0x208)]?await getDbName(_0x5eca45[_0x5d2ee3(0x202)],Number(_0x26006c['dbId']))[_0x5d2ee3(0x1fb)](()=>undefined):undefined,_0x46d55b=buildLocalSqlFileContent({'sqlCode':_0x26006c['sqlCode'],'sqlName':_0x26006c[_0x5d2ee3(0x201)],'dbId':_0x26006c['dbId']},_0x49f471,{'dbName':_0x40faa7,'mode':_0x39729a,'syncedAt':new Date()[_0x5d2ee3(0x1ee)](),'description':_0x26006c[_0x5d2ee3(0x1fe)]}),_0xe267bf=buildSqlLockEntry(_0x26006c,_0x49f471,computeSqlContentHash(_0x46d55b),{'dbName':_0x40faa7}),_0x4d17a2=_0xe267bf[_0x5d2ee3(0x1e2)],_0x1b4824=join(_0x41d2a8[_0x5d2ee3(0x1e6)],_0x4d17a2);try{if(await fileExists(_0x1b4824)){const _0x59a231=await readFile(_0x1b4824,_0x5d2ee3(0x1f3));if(isEquivalentPulledSqlFile(_0x59a231,_0x46d55b,_0x39729a)){_0x408938[_0x5d2ee3(0x1f1)]({'sqlCode':_0x26006c['sqlCode'],'reason':_0x5d2ee3(0x20d)}),_0x3fd35d[_0x5d2ee3(0x200)][_0x26006c[_0x5d2ee3(0x217)]]={..._0xe267bf,'hash':computeSqlContentHash(_0x59a231),'path':_0x4d17a2};continue;}if(!_0x4a5488){_0x408938[_0x5d2ee3(0x1f1)]({'sqlCode':_0x26006c[_0x5d2ee3(0x217)],'reason':_0x5d2ee3(0x1ec)});continue;}}const _0x51e622=_0x50fb35?.['path']?join(_0x41d2a8['sqlRootDir'],_0x50fb35['path']):undefined;_0x51e622&&_0x51e622!==_0x1b4824&&await fileExists(_0x51e622)&&await rm(_0x51e622,{'force':!![]}),await ensureParentDirectory(_0x1b4824),await writeFile(_0x1b4824,_0x46d55b,_0x5d2ee3(0x1f3)),_0x3fd35d[_0x5d2ee3(0x200)][_0x26006c[_0x5d2ee3(0x217)]]={..._0xe267bf,'path':_0x4d17a2},_0x4a6bc1[_0x5d2ee3(0x1f1)]({'sqlCode':_0x26006c[_0x5d2ee3(0x217)],'filePath':_0x1b4824});}catch(_0xb0fde1){_0x450c1c[_0x5d2ee3(0x1f1)]({'sqlCode':_0x26006c['sqlCode'],'error':_0xb0fde1 instanceof Error?_0xb0fde1['message']:String(_0xb0fde1)});}}return _0x3fd35d['lastSync']=new Date()[_0x5d2ee3(0x1ee)](),await writeSqlLockFile(_0x41d2a8[_0x5d2ee3(0x203)],_0x495e17),{'ok':_0x450c1c[_0x5d2ee3(0x1d9)]===0x0,'data':{'pulled':_0x4a6bc1,'skipped':_0x408938,'failed':_0x450c1c},'message':_0x5d2ee3(0x1de)+_0x4a6bc1[_0x5d2ee3(0x1d9)]+_0x5d2ee3(0x20a)+_0x408938[_0x5d2ee3(0x1d9)]+_0x5d2ee3(0x214)+_0x450c1c[_0x5d2ee3(0x1d9)]+_0x5d2ee3(0x1e4)};}};function detectModeFromSql(_0x12defc){const _0xc3427=a127_0x336a76,_0x50290e=ensureRemoteSqlContent(_0x12defc),_0x32245d=stripLocalSqlMetadata(_0x50290e,_0xc3427(0x215))[_0xc3427(0x1e9)]();if(/^<(select|insert|update|delete)\b/i[_0xc3427(0x20b)](_0x32245d))return _0xc3427(0x215);return _0xc3427(0x1e1);}function isEquivalentPulledSqlFile(_0x4c336a,_0xb04510,_0x37aca7){return normalizePullComparableContent(_0x4c336a,_0x37aca7)===normalizePullComparableContent(_0xb04510,_0x37aca7);}function normalizePullComparableContent(_0x5b57c2,_0x463beb){const _0x3ae753=a127_0x336a76,_0x4370d5=_0x5b57c2[_0x3ae753(0x1f0)](/\r\n/g,'\x0a')[_0x3ae753(0x205)]('\x0a'),_0x3c0e55=_0x4370d5[_0x3ae753(0x1ef)](_0x570b5e=>!isSyncedAtMetadataLine(_0x570b5e,_0x463beb));return _0x3c0e55[_0x3ae753(0x20f)]('\x0a');}function isSyncedAtMetadataLine(_0x381656,_0x383ff1){const _0x277988=a127_0x336a76;if(_0x383ff1===_0x277988(0x215))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x277988(0x20b)](_0x381656);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x277988(0x20b)](_0x381656);}
1
+ const a127_0xe2cc18=a127_0x42f3;(function(_0xa4b4d3,_0x32412e){const _0x4e892d=a127_0x42f3,_0x5ec6ac=_0xa4b4d3();while(!![]){try{const _0x1aaae3=-parseInt(_0x4e892d(0x1fd))/0x1+-parseInt(_0x4e892d(0x206))/0x2+parseInt(_0x4e892d(0x1f1))/0x3+parseInt(_0x4e892d(0x21e))/0x4+parseInt(_0x4e892d(0x224))/0x5+parseInt(_0x4e892d(0x215))/0x6+parseInt(_0x4e892d(0x213))/0x7;if(_0x1aaae3===_0x32412e)break;else _0x5ec6ac['push'](_0x5ec6ac['shift']());}catch(_0x5dcc74){_0x5ec6ac['push'](_0x5ec6ac['shift']());}}}(a127_0x1f4c,0x752d1));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 a127_0x1f4c(){const _0x436a20=['sqlContent','737964RCtkFv','force','bool','No\x20remote\x20SQL\x20queries\x20matched.','sqlCode','sql','skipped','\x20skipped,\x20','message','length','local\x20differs\x20from\x20remote','test','704659WKWHeR','would_pull','join','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','name','catch','Force\x20pull\x20cancelled.','POST','replace','1129618xQIMMd','cancelled','lockFilePath','Would\x20pull\x20','lastSync','sqlName','Force\x20overwrite\x20local\x20unsynced\x20changes','appCode','Pull\x20complete:\x20','\x20failed','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqls','sqlRoot','2902312WzsuEm','sqlcode','4071936OMWffc','sqlRootDir','dbId','filter','tableData','totalCount','str','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','pull','298548oeXufx','\x20SQL\x20file(s)\x20into\x20','unchanged','nonInteractive','mybatisXml','push','1677620jWsEVB','description','apps','path','toISOString','\x20written,\x20','utf8','split','trimStart'];a127_0x1f4c=function(){return _0x436a20;};return a127_0x1f4c();}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(_0x330500,_0x83b6df){const _0x15cb27=a127_0x42f3,_0x22121a=[];let _0x407c49=0x1;while(!![]){const _0xe75edc=await listSqlQueries(_0x330500,{'currentPage':_0x407c49,'pageSize':PAGE_SIZE,'sqlCode':_0x83b6df[_0x15cb27(0x1f5)],'sqlName':_0x83b6df[_0x15cb27(0x20b)]}),_0x246c59=_0xe75edc[_0x15cb27(0x219)]??[];_0x22121a[_0x15cb27(0x223)](..._0x246c59);if(_0x246c59[_0x15cb27(0x1fa)]===0x0)break;const _0x4bec75=_0xe75edc['paging']?.[_0x15cb27(0x21a)];if(_0x4bec75!=null?_0x22121a['length']>=_0x4bec75:_0x246c59[_0x15cb27(0x1fa)]<PAGE_SIZE)break;_0x407c49++;}return _0x22121a;}async function ensureSqlContent(_0x29378a){const _0x1291e3=a127_0x42f3;if(_0x29378a[_0x1291e3(0x1f0)]!=null&&String(_0x29378a['sqlContent'])['length']>0x0)return _0x29378a;return getSqlQueryDetail(_0x29378a[_0x1291e3(0x1f5)]);}function a127_0x42f3(_0x426698,_0x6a8332){_0x426698=_0x426698-0x1ed;const _0x1f4c98=a127_0x1f4c();let _0x42f359=_0x1f4c98[_0x426698];return _0x42f359;}export const sqlPull={'service':'sql','command':a127_0xe2cc18(0x21d),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a127_0xe2cc18(0x201),'type':'string','description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a127_0xe2cc18(0x1f2),'type':'boolean','description':a127_0xe2cc18(0x20c)}],async 'dryRun'(_0x4ef4c8){const _0x2bca9c=a127_0xe2cc18,_0x3f1535=loadSqlProjectConfig(_0x4ef4c8['appCode']),_0x255282=await readSqlLockFile(_0x3f1535[_0x2bca9c(0x208)]),{appLock:_0x549f6c}=ensureSqlLockScope(_0x255282??createEmptySqlLock(),_0x3f1535[_0x2bca9c(0x20d)],_0x3f1535[_0x2bca9c(0x212)],_0x2bca9c(0x21d)),_0x424c3a=await fetchAllSqlQueries(_0x4ef4c8[_0x2bca9c(0x20d)],{'sqlCode':_0x4ef4c8['str']('sqlcode')||undefined,'sqlName':_0x4ef4c8[_0x2bca9c(0x21b)](_0x2bca9c(0x201))||undefined}),_0x730801=[];for(const _0x2ae3f8 of _0x424c3a){const _0x537511=await ensureSqlContent(_0x2ae3f8),_0x4e2ccc=ensureRemoteSqlContent(_0x537511),_0x2d074e=detectModeFromSql(_0x537511),_0x504bb4=_0x537511[_0x2bca9c(0x217)]?await getDbName(_0x4ef4c8[_0x2bca9c(0x20d)],Number(_0x537511[_0x2bca9c(0x217)]))[_0x2bca9c(0x202)](()=>undefined):undefined,_0x23748e=buildLocalSqlFileContent({'sqlCode':_0x537511[_0x2bca9c(0x1f5)],'sqlName':_0x537511[_0x2bca9c(0x20b)],'dbId':_0x537511[_0x2bca9c(0x217)]},_0x4e2ccc,{'dbName':_0x504bb4,'mode':_0x2d074e,'syncedAt':new Date()[_0x2bca9c(0x228)](),'description':_0x537511[_0x2bca9c(0x225)]}),_0x1c309a=buildSqlLockEntry(_0x537511,_0x4e2ccc,'',{'dbName':_0x504bb4}),_0x3abac3=resolveLocalSqlFilePath(_0x3f1535,_0x537511[_0x2bca9c(0x1f5)],_0x1c309a);let _0x3a4cb4=_0x2bca9c(0x1fe),_0x21610f;if(await fileExists(_0x3abac3)){const _0x2cf709=await readFile(_0x3abac3,_0x2bca9c(0x1ed));isEquivalentPulledSqlFile(_0x2cf709,_0x23748e,_0x2d074e)?(_0x3a4cb4=_0x2bca9c(0x1f7),_0x21610f=_0x2bca9c(0x220)):(_0x3a4cb4='conflict',_0x21610f=_0x2bca9c(0x21c));}_0x730801[_0x2bca9c(0x223)]({'sqlCode':_0x537511[_0x2bca9c(0x1f5)],'sqlName':_0x537511['sqlName'],'filePath':_0x3abac3,'status':_0x3a4cb4,'reason':_0x21610f});}return{'method':_0x2bca9c(0x204),'url':_0x2bca9c(0x210),'body':{'appCode':_0x4ef4c8[_0x2bca9c(0x20d)],'sqlCode':_0x4ef4c8[_0x2bca9c(0x21b)](_0x2bca9c(0x214))||null,'sqlName':_0x4ef4c8['str']('name')||null,'files':_0x730801},'description':_0x2bca9c(0x209)+_0x730801[_0x2bca9c(0x1fa)]+_0x2bca9c(0x21f)+_0x3f1535[_0x2bca9c(0x216)]};},async 'execute'(_0x3f0f5f){const _0x3dadd5=a127_0xe2cc18,_0x403124=loadSqlProjectConfig(_0x3f0f5f[_0x3dadd5(0x20d)]),_0x55ce87=await readSqlLockFile(_0x403124[_0x3dadd5(0x208)]),{lockData:_0x4a34ec,appLock:_0x3f2af1}=ensureSqlLockScope(_0x55ce87??createEmptySqlLock(),_0x403124[_0x3dadd5(0x20d)],_0x403124['sqlRoot'],_0x3dadd5(0x21d)),_0x57bdbe=_0x3f0f5f[_0x3dadd5(0x1f3)]('force'),_0x494bf3=await fetchAllSqlQueries(_0x3f0f5f[_0x3dadd5(0x20d)],{'sqlCode':_0x3f0f5f[_0x3dadd5(0x21b)](_0x3dadd5(0x214))||undefined,'sqlName':_0x3f0f5f[_0x3dadd5(0x21b)](_0x3dadd5(0x201))||undefined});if(_0x494bf3[_0x3dadd5(0x1fa)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x3dadd5(0x1f4)};const _0x44195b=[],_0x5cab60=[];for(const _0x7954fa of _0x494bf3){try{_0x44195b[_0x3dadd5(0x223)](await ensureSqlContent(_0x7954fa));}catch(_0x2e3743){_0x5cab60[_0x3dadd5(0x223)]({'sqlCode':_0x7954fa['sqlCode'],'error':_0x2e3743 instanceof Error?_0x2e3743[_0x3dadd5(0x1f9)]:String(_0x2e3743)});}}if(_0x57bdbe&&!_0x3f0f5f[_0x3dadd5(0x221)]){let _0x10521a=![];for(const _0x145ab4 of _0x44195b){const _0x1fa79c=detectModeFromSql(_0x145ab4),_0x579cd6=_0x145ab4['dbId']?await getDbName(_0x3f0f5f[_0x3dadd5(0x20d)],Number(_0x145ab4[_0x3dadd5(0x217)]))[_0x3dadd5(0x202)](()=>undefined):undefined,_0x266cca=buildLocalSqlFileContent({'sqlCode':_0x145ab4[_0x3dadd5(0x1f5)],'sqlName':_0x145ab4['sqlName'],'dbId':_0x145ab4[_0x3dadd5(0x217)]},ensureRemoteSqlContent(_0x145ab4),{'dbName':_0x579cd6,'mode':_0x1fa79c,'syncedAt':new Date()[_0x3dadd5(0x228)](),'description':_0x145ab4['description']}),_0x44aeaa=resolveLocalSqlFilePath(_0x403124,_0x145ab4['sqlCode'],buildSqlLockEntry(_0x145ab4,ensureRemoteSqlContent(_0x145ab4),'',{'dbName':_0x579cd6}));if(await fileExists(_0x44aeaa)){const _0x3b9f0a=await readFile(_0x44aeaa,'utf8');if(!isEquivalentPulledSqlFile(_0x3b9f0a,_0x266cca,_0x1fa79c)){_0x10521a=!![];break;}}}if(_0x10521a){const _0x3eed53=await confirmForceOverwrite(_0x3dadd5(0x200));if(!_0x3eed53)throw CliErrors[_0x3dadd5(0x207)](_0x3dadd5(0x203));}}const _0x40bbcf=cloneSqlLockData(_0x4a34ec),_0xf0284f=_0x40bbcf[_0x3dadd5(0x226)][_0x403124['appCode']],_0x54e490=[],_0x1d7034=[];for(const _0x54f9fa of _0x44195b){const _0x2054bc=_0xf0284f[_0x3dadd5(0x211)][_0x54f9fa[_0x3dadd5(0x1f5)]],_0x5101ba=ensureRemoteSqlContent(_0x54f9fa),_0x4bf27e=detectModeFromSql(_0x54f9fa),_0xd3f2b6=_0x54f9fa[_0x3dadd5(0x217)]?await getDbName(_0x3f0f5f[_0x3dadd5(0x20d)],Number(_0x54f9fa[_0x3dadd5(0x217)]))[_0x3dadd5(0x202)](()=>undefined):undefined,_0x463333=buildLocalSqlFileContent({'sqlCode':_0x54f9fa['sqlCode'],'sqlName':_0x54f9fa[_0x3dadd5(0x20b)],'dbId':_0x54f9fa[_0x3dadd5(0x217)]},_0x5101ba,{'dbName':_0xd3f2b6,'mode':_0x4bf27e,'syncedAt':new Date()[_0x3dadd5(0x228)](),'description':_0x54f9fa[_0x3dadd5(0x225)]}),_0x54992c=buildSqlLockEntry(_0x54f9fa,_0x5101ba,computeSqlContentHash(_0x463333),{'dbName':_0xd3f2b6}),_0x1765bd=_0x54992c[_0x3dadd5(0x227)],_0x1702af=join(_0x403124[_0x3dadd5(0x216)],_0x1765bd);try{if(await fileExists(_0x1702af)){const _0x51ed25=await readFile(_0x1702af,_0x3dadd5(0x1ed));if(isEquivalentPulledSqlFile(_0x51ed25,_0x463333,_0x4bf27e)){_0x1d7034[_0x3dadd5(0x223)]({'sqlCode':_0x54f9fa['sqlCode'],'reason':_0x3dadd5(0x220)}),_0xf0284f[_0x3dadd5(0x211)][_0x54f9fa[_0x3dadd5(0x1f5)]]={..._0x54992c,'hash':computeSqlContentHash(_0x51ed25),'path':_0x1765bd};continue;}if(!_0x57bdbe){_0x1d7034[_0x3dadd5(0x223)]({'sqlCode':_0x54f9fa['sqlCode'],'reason':_0x3dadd5(0x1fb)});continue;}}const _0x1babb0=_0x2054bc?.[_0x3dadd5(0x227)]?join(_0x403124['sqlRootDir'],_0x2054bc[_0x3dadd5(0x227)]):undefined;_0x1babb0&&_0x1babb0!==_0x1702af&&await fileExists(_0x1babb0)&&await rm(_0x1babb0,{'force':!![]}),await ensureParentDirectory(_0x1702af),await writeFile(_0x1702af,_0x463333,_0x3dadd5(0x1ed)),_0xf0284f[_0x3dadd5(0x211)][_0x54f9fa[_0x3dadd5(0x1f5)]]={..._0x54992c,'path':_0x1765bd},_0x54e490[_0x3dadd5(0x223)]({'sqlCode':_0x54f9fa['sqlCode'],'filePath':_0x1702af});}catch(_0x4428aa){_0x5cab60[_0x3dadd5(0x223)]({'sqlCode':_0x54f9fa[_0x3dadd5(0x1f5)],'error':_0x4428aa instanceof Error?_0x4428aa['message']:String(_0x4428aa)});}}return _0xf0284f[_0x3dadd5(0x20a)]=new Date()['toISOString'](),await writeSqlLockFile(_0x403124[_0x3dadd5(0x208)],_0x40bbcf),{'ok':_0x5cab60['length']===0x0,'data':{'pulled':_0x54e490,'skipped':_0x1d7034,'failed':_0x5cab60},'message':_0x3dadd5(0x20e)+_0x54e490[_0x3dadd5(0x1fa)]+_0x3dadd5(0x229)+_0x1d7034[_0x3dadd5(0x1fa)]+_0x3dadd5(0x1f8)+_0x5cab60['length']+_0x3dadd5(0x20f)};}};function detectModeFromSql(_0x53bb82){const _0x523517=a127_0xe2cc18,_0x3b582d=ensureRemoteSqlContent(_0x53bb82),_0x3e82c7=stripLocalSqlMetadata(_0x3b582d,_0x523517(0x222))[_0x523517(0x1ef)]();if(/^<(select|insert|update|delete)\b/i[_0x523517(0x1fc)](_0x3e82c7))return _0x523517(0x222);return _0x523517(0x1f6);}function isEquivalentPulledSqlFile(_0x2d4717,_0x2f3d34,_0x564d05){return normalizePullComparableContent(_0x2d4717,_0x564d05)===normalizePullComparableContent(_0x2f3d34,_0x564d05);}function normalizePullComparableContent(_0x386069,_0x192032){const _0x24b8b5=a127_0xe2cc18,_0x1979bf=_0x386069[_0x24b8b5(0x205)](/\r\n/g,'\x0a')[_0x24b8b5(0x1ee)]('\x0a'),_0x21a05f=_0x1979bf[_0x24b8b5(0x218)](_0x38b789=>!isSyncedAtMetadataLine(_0x38b789,_0x192032));return _0x21a05f[_0x24b8b5(0x1ff)]('\x0a');}function isSyncedAtMetadataLine(_0xf92d24,_0x6d3653){const _0x438f60=a127_0xe2cc18;if(_0x6d3653===_0x438f60(0x222))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0xf92d24);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x438f60(0x1fc)](_0xf92d24);}
@@ -1 +1 @@
1
- const a128_0xdcd7a3=a128_0x1d5f;(function(_0x2263af,_0x4b2b37){const _0x4de78d=a128_0x1d5f,_0x56410f=_0x2263af();while(!![]){try{const _0x1c22d7=parseInt(_0x4de78d(0x1dd))/0x1+parseInt(_0x4de78d(0x1cb))/0x2*(-parseInt(_0x4de78d(0x1eb))/0x3)+parseInt(_0x4de78d(0x1ca))/0x4*(parseInt(_0x4de78d(0x1ee))/0x5)+parseInt(_0x4de78d(0x1c1))/0x6+parseInt(_0x4de78d(0x1b9))/0x7+parseInt(_0x4de78d(0x1d7))/0x8+-parseInt(_0x4de78d(0x1df))/0x9;if(_0x1c22d7===_0x4b2b37)break;else _0x56410f['push'](_0x56410f['shift']());}catch(_0x367bed){_0x56410f['push'](_0x56410f['shift']());}}}(a128_0x1150,0x3eb4b));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x53a00b,_0x3a3e0b,_0x2fa719){const _0x3b89de=a128_0x1d5f,_0x43d99b=await scanLocalSqlQueries(_0x53a00b),_0x5da300=new Map();for(const _0x44c34d of _0x43d99b){if(_0x2fa719&&_0x44c34d['sqlCode']!==_0x2fa719)continue;const _0x219b46=_0x5da300['get'](_0x44c34d['sqlCode'])??[];_0x219b46['push'](_0x44c34d),_0x5da300[_0x3b89de(0x1e7)](_0x44c34d['sqlCode'],_0x219b46);}if(_0x2fa719&&!_0x5da300[_0x3b89de(0x1bf)](_0x2fa719))throw CliErrors[_0x3b89de(0x1cf)](_0x3b89de(0x1d3)+_0x2fa719);const _0x32d261=[];for(const [_0x421a67,_0x63e6a0]of _0x5da300[_0x3b89de(0x1be)]()){if(_0x63e6a0[_0x3b89de(0x1c4)]===0x1){_0x32d261[_0x3b89de(0x1d2)](_0x63e6a0[0x0]);continue;}const _0x33ee58=_0x3a3e0b[_0x3b89de(0x1c6)][_0x421a67],_0xb8096f=_0x33ee58?.[_0x3b89de(0x1c9)],_0x2f8b19=_0xb8096f?_0x63e6a0[_0x3b89de(0x1c3)](_0x195de3=>_0x195de3[_0x3b89de(0x1f1)]!==_0xb8096f):_0x63e6a0;if(_0x33ee58&&_0x2f8b19[_0x3b89de(0x1c4)]===0x1){_0x32d261[_0x3b89de(0x1d2)](_0x2f8b19[0x0]);continue;}throw CliErrors[_0x3b89de(0x1cf)](_0x3b89de(0x1ea)+_0x421a67+_0x3b89de(0x1d6));}return _0x32d261;}export const sqlPush={'service':a128_0xdcd7a3(0x1e5),'command':a128_0xdcd7a3(0x1d2),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a128_0xdcd7a3(0x1e9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0xdcd7a3(0x1b6),'type':a128_0xdcd7a3(0x1e4),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x3d5bba){const _0xfc3e92=a128_0xdcd7a3,_0x86d9b=loadSqlProjectConfig(_0x3d5bba['appCode']),_0x1296e3=await readSqlLockFile(_0x86d9b[_0xfc3e92(0x1ed)]),{appLock:_0x50aaa0}=ensureSqlLockScope(_0x1296e3??createEmptySqlLock(),_0x3d5bba[_0xfc3e92(0x1ce)],_0x86d9b['sqlRoot'],_0xfc3e92(0x1d2)),_0x14a3b4=await getTargetSqlQueries(_0x86d9b,_0x50aaa0,_0x3d5bba['str'](_0xfc3e92(0x1b4))||undefined),_0x1e592c=[];for(const _0x4798f1 of _0x14a3b4){const _0xbc43e8=await computeSqlFileHash(_0x4798f1['filePath']),_0x41f230=_0x50aaa0[_0xfc3e92(0x1c6)][_0x4798f1[_0xfc3e92(0x1c0)]],_0x337948=!!_0x41f230&&(_0x41f230[_0xfc3e92(0x1c9)]!==_0x4798f1[_0xfc3e92(0x1f1)]||!!_0x4798f1[_0xfc3e92(0x1c5)]&&_0x41f230[_0xfc3e92(0x1c5)]!==_0x4798f1[_0xfc3e92(0x1c5)]);if(!_0x3d5bba['bool'](_0xfc3e92(0x1b6))&&_0x41f230&&_0x41f230[_0xfc3e92(0x1f0)]===_0xbc43e8&&!_0x337948)continue;_0x1e592c['push'](_0x4798f1['sqlCode']);}return{'method':_0xfc3e92(0x1b5),'url':_0xfc3e92(0x1cd),'body':{'sqlCodes':_0x1e592c,'appCode':_0x3d5bba[_0xfc3e92(0x1ce)]},'description':'Would\x20push\x20'+_0x1e592c[_0xfc3e92(0x1c4)]+_0xfc3e92(0x1da)};},async 'execute'(_0x5c777f){const _0xf43a8e=a128_0xdcd7a3,_0xf4403a=loadSqlProjectConfig(_0x5c777f['appCode']),_0x38a4e1=await readSqlLockFile(_0xf4403a[_0xf43a8e(0x1ed)]),{lockData:_0x148e88,appLock:_0x47de8}=ensureSqlLockScope(_0x38a4e1??createEmptySqlLock(),_0x5c777f[_0xf43a8e(0x1ce)],_0xf4403a[_0xf43a8e(0x1bd)],'push'),_0x56cb4b=await getTargetSqlQueries(_0xf4403a,_0x47de8,_0x5c777f['str'](_0xf43a8e(0x1b4))||undefined);if(_0x56cb4b[_0xf43a8e(0x1c4)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xf43a8e(0x1e1)};const _0x3e96b4=[],_0x1f4e11=[],_0x5ccaa9=[];for(const _0xf97f08 of _0x56cb4b){const _0x1fd275=_0x47de8[_0xf43a8e(0x1c6)][_0xf97f08[_0xf43a8e(0x1c0)]];if(!_0x1fd275){_0x5ccaa9['push']({'sqlCode':_0xf97f08[_0xf43a8e(0x1c0)],'error':_0xf43a8e(0x1d4)});continue;}try{const _0x576ffe=await computeSqlFileHash(_0xf97f08['filePath']),_0x100200=_0x1fd275['path']!==_0xf97f08['relativePath']||!!_0xf97f08[_0xf43a8e(0x1c5)]&&_0x1fd275[_0xf43a8e(0x1c5)]!==_0xf97f08[_0xf43a8e(0x1c5)];if(!_0x5c777f['bool'](_0xf43a8e(0x1b6))&&_0x1fd275[_0xf43a8e(0x1f0)]===_0x576ffe&&!_0x100200){_0x1f4e11[_0xf43a8e(0x1d2)]({'sqlCode':_0xf97f08[_0xf43a8e(0x1c0)],'reason':_0xf43a8e(0x1e0)});continue;}if(_0x1fd275[_0xf43a8e(0x1b3)]==null){_0x5ccaa9[_0xf43a8e(0x1d2)]({'sqlCode':_0xf97f08[_0xf43a8e(0x1c0)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x3c1a5b=await readFile(_0xf97f08[_0xf43a8e(0x1d9)],_0xf43a8e(0x1c2)),_0x333130=stripLocalSqlMetadata(_0x3c1a5b,_0xf97f08[_0xf43a8e(0x1d1)]),_0x13934f=_0xf97f08['sqlName']||_0x1fd275[_0xf43a8e(0x1c5)],_0x5385ae=await resolveTargetDbBinding(_0x5c777f[_0xf43a8e(0x1ce)],_0xf97f08,_0x1fd275),_0x292e1f=await updateSqlQuery({'id':_0x1fd275[_0xf43a8e(0x1e8)],'appCode':_0x5c777f[_0xf43a8e(0x1ce)],'sqlCode':_0xf97f08['sqlCode'],'sqlName':_0x13934f,'dbId':_0x5385ae['dbId'],'version':_0x1fd275[_0xf43a8e(0x1b3)],'sqlContent':_0x333130,'sqlConfig':_0x1fd275[_0xf43a8e(0x1d0)]??undefined}),_0x1c777c=_0x292e1f[_0xf43a8e(0x1bb)]?await getDbName(_0x5c777f[_0xf43a8e(0x1ce)],Number(_0x292e1f[_0xf43a8e(0x1bb)]))['catch'](()=>_0x5385ae[_0xf43a8e(0x1c8)]):_0x5385ae['dbName'];_0x47de8[_0xf43a8e(0x1c6)][_0xf97f08[_0xf43a8e(0x1c0)]]={...buildSqlLockEntry(_0x292e1f,_0x333130,_0x576ffe,{'dbName':_0x1c777c}),'path':_0xf97f08['relativePath'],'mode':_0x1fd275[_0xf43a8e(0x1d1)]},await archivePreviousSqlFileIfNeeded(_0xf4403a,_0x1fd275['path'],_0xf97f08[_0xf43a8e(0x1f1)]),_0x3e96b4[_0xf43a8e(0x1d2)]({'sqlCode':_0xf97f08[_0xf43a8e(0x1c0)],'remoteId':_0x1fd275[_0xf43a8e(0x1e8)]});}catch(_0x2d1c52){_0x5ccaa9[_0xf43a8e(0x1d2)]({'sqlCode':_0xf97f08[_0xf43a8e(0x1c0)],'error':_0x2d1c52 instanceof Error?_0x2d1c52['message']:String(_0x2d1c52)});}}return _0x47de8[_0xf43a8e(0x1cc)]=new Date()[_0xf43a8e(0x1e3)](),await writeSqlLockFile(_0xf4403a[_0xf43a8e(0x1ed)],_0x148e88),{'ok':_0x5ccaa9[_0xf43a8e(0x1c4)]===0x0,'data':{'pushed':_0x3e96b4,'skipped':_0x1f4e11,'failed':_0x5ccaa9},'message':_0xf43a8e(0x1ec)+_0x3e96b4[_0xf43a8e(0x1c4)]+'\x20pushed,\x20'+_0x1f4e11[_0xf43a8e(0x1c4)]+_0xf43a8e(0x1e2)+_0x5ccaa9['length']+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x41e90e,_0x413175,_0x413ffa){const _0x198cc4=a128_0xdcd7a3;if(!_0x413175||_0x413175===_0x413ffa)return;const _0x29e8ea=join(_0x41e90e[_0x198cc4(0x1dc)],_0x413175);if(!await fileExists(_0x29e8ea))return;const _0x56ea1e=await moveToTrash(_0x41e90e[_0x198cc4(0x1b8)],_0x41e90e[_0x198cc4(0x1e6)],_0x29e8ea);await cleanupEmptyDirectories(dirname(_0x29e8ea),_0x41e90e['sqlRootDir']),void _0x56ea1e;}function a128_0x1150(){const _0x42458a=['force','exec','projectRoot','1898078RUqJDW','\x22\x20for\x20sqlCode\x20','dbId','map','sqlRoot','entries','has','sqlCode','1058526tPKuZj','utf8','filter','length','sqlName','sqls','startsWith','dbName','path','9132viTOvq','73518jSfpNu','lastSync','/smartapi/custom/updateUserCustomSql','appCode','validation','sqlConfig','mode','push','Local\x20SQL\x20not\x20found:\x20','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','join','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','2496608ABkjRe','No\x20database\x20matches\x20local\x20directory\x20\x22','filePath','\x20SQL\x20file(s)','catch','sqlRootDir','168857GqRrBG','Local\x20directory\x20\x22','5603103hIkqkY','unchanged','No\x20local\x20SQL\x20files\x20found.','\x20skipped,\x20','toISOString','boolean','sql','trashDir','set','remoteId','high-risk-write','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','15nIEeOY','Push\x20complete:\x20','lockFilePath','295dwZzQI','dbDirectory','hash','relativePath','version','sqlcode','POST'];a128_0x1150=function(){return _0x42458a;};return a128_0x1150();}async function moveToTrash(_0x22e685,_0x8210ed,_0x1d2a96){const _0x4f8f7b=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x3fc6ea=relative(_0x22e685,_0x1d2a96),_0x31a256=join(_0x8210ed,_0x4f8f7b,_0x3fc6ea);return await mkdir(dirname(_0x31a256),{'recursive':!![]}),await rename(_0x1d2a96,_0x31a256),_0x31a256;}async function cleanupEmptyDirectories(_0x33f8d0,_0x51a92a){const _0x5a40c4=a128_0xdcd7a3;let _0x39c1cd=resolve(_0x33f8d0);const _0xadc77d=resolve(_0x51a92a);while(_0x39c1cd[_0x5a40c4(0x1c7)](''+_0xadc77d+sep)||_0x39c1cd===_0xadc77d){if(_0x39c1cd===_0xadc77d)return;try{const _0x1462eb=await readdir(_0x39c1cd);if(_0x1462eb[_0x5a40c4(0x1c4)]>0x0)return;await rmdir(_0x39c1cd);}catch{return;}_0x39c1cd=dirname(_0x39c1cd);}}function a128_0x1d5f(_0x17237f,_0x5a10c6){_0x17237f=_0x17237f-0x1b3;const _0x115072=a128_0x1150();let _0x1d5fd4=_0x115072[_0x17237f];return _0x1d5fd4;}async function resolveTargetDbBinding(_0x538b8f,_0x3cc471,_0x2d33a4){const _0x105fdd=a128_0xdcd7a3,_0x54d4bf=_0x3cc471[_0x105fdd(0x1ef)];if(!_0x54d4bf)return{'dbId':_0x2d33a4[_0x105fdd(0x1bb)],'dbName':_0x2d33a4[_0x105fdd(0x1c8)]};const _0x5d2c14=buildDbDirectoryName(_0x2d33a4[_0x105fdd(0x1c8)],_0x2d33a4[_0x105fdd(0x1bb)]);if(_0x54d4bf===_0x5d2c14)return{'dbId':_0x2d33a4[_0x105fdd(0x1bb)],'dbName':_0x2d33a4['dbName']};const _0x348cae=parseExplicitDbDirectory(_0x54d4bf);if(_0x348cae!=null)return{'dbId':_0x348cae,'dbName':await getDbName(_0x538b8f,_0x348cae)[_0x105fdd(0x1db)](()=>undefined)};const _0xe08f29=await listDatabases(_0x538b8f),_0x143b05=_0xe08f29[_0x105fdd(0x1c3)](_0x52ac51=>buildDbDirectoryName(_0x52ac51[_0x105fdd(0x1c8)],_0x52ac51['dbId'])===_0x54d4bf);if(_0x143b05[_0x105fdd(0x1c4)]===0x1)return{'dbId':_0x143b05[0x0][_0x105fdd(0x1bb)],'dbName':_0x143b05[0x0][_0x105fdd(0x1c8)]};if(_0x143b05[_0x105fdd(0x1c4)]===0x0)throw CliErrors[_0x105fdd(0x1cf)](_0x105fdd(0x1d8)+_0x54d4bf+_0x105fdd(0x1ba)+_0x3cc471[_0x105fdd(0x1c0)]+'.');const _0x3090aa=_0x143b05[_0x105fdd(0x1bc)](_0x1b9540=>_0x1b9540[_0x105fdd(0x1c8)]+'\x20('+_0x1b9540[_0x105fdd(0x1bb)]+')')[_0x105fdd(0x1d5)](',\x20');throw CliErrors[_0x105fdd(0x1cf)](_0x105fdd(0x1de)+_0x54d4bf+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x3cc471[_0x105fdd(0x1c0)]+':\x20'+_0x3090aa);}function parseExplicitDbDirectory(_0x24f869){const _0x23de3c=a128_0xdcd7a3,_0x11430a=/^db-(\d+)$/[_0x23de3c(0x1b7)](_0x24f869);if(!_0x11430a)return null;const _0x363e2d=Number(_0x11430a[0x1]);return Number['isFinite'](_0x363e2d)&&_0x363e2d>0x0?_0x363e2d:null;}
1
+ const a128_0x262705=a128_0x1973;(function(_0x203f9f,_0x8f7599){const _0x395a71=a128_0x1973,_0x162c60=_0x203f9f();while(!![]){try{const _0x228ca3=parseInt(_0x395a71(0x15f))/0x1*(parseInt(_0x395a71(0x15c))/0x2)+-parseInt(_0x395a71(0x174))/0x3*(-parseInt(_0x395a71(0x161))/0x4)+parseInt(_0x395a71(0x173))/0x5+parseInt(_0x395a71(0x16d))/0x6*(-parseInt(_0x395a71(0x17c))/0x7)+-parseInt(_0x395a71(0x18b))/0x8*(parseInt(_0x395a71(0x198))/0x9)+-parseInt(_0x395a71(0x168))/0xa+parseInt(_0x395a71(0x192))/0xb*(parseInt(_0x395a71(0x190))/0xc);if(_0x228ca3===_0x8f7599)break;else _0x162c60['push'](_0x162c60['shift']());}catch(_0x2d1c6e){_0x162c60['push'](_0x162c60['shift']());}}}(a128_0x3aa3,0x4a5fc));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';function a128_0x1973(_0x221a9d,_0x46df73){_0x221a9d=_0x221a9d-0x159;const _0x3aa3ce=a128_0x3aa3();let _0x197334=_0x3aa3ce[_0x221a9d];return _0x197334;}import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';function a128_0x3aa3(){const _0x2fa730=['21UxxZgQ','isFinite','mode','dbDirectory','message','sqls','path','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','7161LyJPAA','force','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','\x20failed','sqlCode','sqlcode','dbName','replace','POST','dbId','sqlName','toISOString','get','Push\x20complete:\x20','high-risk-write','112600UWtdTW','/smartapi/custom/updateUserCustomSql','set','Push\x20local\x20SQL\x20files\x20to\x20remote','sqlRoot','70020cKYuQo','\x20SQL\x20file(s)','143ORcaqQ','map','version','relativePath','trashDir','lockFilePath','45AOJhoZ','validation','bool','sql','65048MOIXLX','sqlConfig','lastSync','4lkeGqR','entries','137316RTDUDO','hash','catch','unchanged','filePath','remoteId','str','3252160JBfVkX','boolean','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','length','startsWith','1326DAdYIg','utf8','No\x20database\x20matches\x20local\x20directory\x20\x22','push','appCode','sqlRootDir','2400280OpSAhE'];a128_0x3aa3=function(){return _0x2fa730;};return a128_0x3aa3();}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(_0x2d0588,_0x39862c,_0x281467){const _0x25e845=a128_0x1973,_0x169ef5=await scanLocalSqlQueries(_0x2d0588),_0x373b5d=new Map();for(const _0x192a7a of _0x169ef5){if(_0x281467&&_0x192a7a['sqlCode']!==_0x281467)continue;const _0xd6ecd1=_0x373b5d[_0x25e845(0x188)](_0x192a7a['sqlCode'])??[];_0xd6ecd1[_0x25e845(0x170)](_0x192a7a),_0x373b5d[_0x25e845(0x18d)](_0x192a7a[_0x25e845(0x180)],_0xd6ecd1);}if(_0x281467&&!_0x373b5d['has'](_0x281467))throw CliErrors[_0x25e845(0x159)]('Local\x20SQL\x20not\x20found:\x20'+_0x281467);const _0x15b8e6=[];for(const [_0x3b387d,_0x2d2bb3]of _0x373b5d[_0x25e845(0x160)]()){if(_0x2d2bb3[_0x25e845(0x16b)]===0x1){_0x15b8e6[_0x25e845(0x170)](_0x2d2bb3[0x0]);continue;}const _0xd2e7c1=_0x39862c[_0x25e845(0x179)][_0x3b387d],_0x3d916e=_0xd2e7c1?.[_0x25e845(0x17a)],_0x2d96ee=_0x3d916e?_0x2d2bb3['filter'](_0x1b6f78=>_0x1b6f78['relativePath']!==_0x3d916e):_0x2d2bb3;if(_0xd2e7c1&&_0x2d96ee[_0x25e845(0x16b)]===0x1){_0x15b8e6[_0x25e845(0x170)](_0x2d96ee[0x0]);continue;}throw CliErrors[_0x25e845(0x159)](_0x25e845(0x17b)+_0x3b387d+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x15b8e6;}export const sqlPush={'service':a128_0x262705(0x15b),'command':'push','description':a128_0x262705(0x18e),'risk':a128_0x262705(0x18a),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a128_0x262705(0x169),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x1cd55b){const _0x42d6e3=a128_0x262705,_0x4a8e50=loadSqlProjectConfig(_0x1cd55b[_0x42d6e3(0x171)]),_0x20e76b=await readSqlLockFile(_0x4a8e50[_0x42d6e3(0x197)]),{appLock:_0x2acf13}=ensureSqlLockScope(_0x20e76b??createEmptySqlLock(),_0x1cd55b['appCode'],_0x4a8e50['sqlRoot'],_0x42d6e3(0x170)),_0x4cab0c=await getTargetSqlQueries(_0x4a8e50,_0x2acf13,_0x1cd55b['str'](_0x42d6e3(0x181))||undefined),_0x2cf9f4=[];for(const _0x431168 of _0x4cab0c){const _0x314368=await computeSqlFileHash(_0x431168[_0x42d6e3(0x165)]),_0xcc559a=_0x2acf13[_0x42d6e3(0x179)][_0x431168['sqlCode']],_0x161b08=!!_0xcc559a&&(_0xcc559a[_0x42d6e3(0x17a)]!==_0x431168[_0x42d6e3(0x195)]||!!_0x431168[_0x42d6e3(0x186)]&&_0xcc559a[_0x42d6e3(0x186)]!==_0x431168[_0x42d6e3(0x186)]);if(!_0x1cd55b[_0x42d6e3(0x15a)](_0x42d6e3(0x17d))&&_0xcc559a&&_0xcc559a['hash']===_0x314368&&!_0x161b08)continue;_0x2cf9f4[_0x42d6e3(0x170)](_0x431168[_0x42d6e3(0x180)]);}return{'method':_0x42d6e3(0x184),'url':_0x42d6e3(0x18c),'body':{'sqlCodes':_0x2cf9f4,'appCode':_0x1cd55b[_0x42d6e3(0x171)]},'description':'Would\x20push\x20'+_0x2cf9f4[_0x42d6e3(0x16b)]+_0x42d6e3(0x191)};},async 'execute'(_0x3d966f){const _0x6dee03=a128_0x262705,_0x190cde=loadSqlProjectConfig(_0x3d966f['appCode']),_0x42d52f=await readSqlLockFile(_0x190cde[_0x6dee03(0x197)]),{lockData:_0x4e8997,appLock:_0x491f2b}=ensureSqlLockScope(_0x42d52f??createEmptySqlLock(),_0x3d966f[_0x6dee03(0x171)],_0x190cde[_0x6dee03(0x18f)],_0x6dee03(0x170)),_0x29f989=await getTargetSqlQueries(_0x190cde,_0x491f2b,_0x3d966f[_0x6dee03(0x167)](_0x6dee03(0x181))||undefined);if(_0x29f989[_0x6dee03(0x16b)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x1b4ab8=[],_0x394059=[],_0x3528fe=[];for(const _0x1419b2 of _0x29f989){const _0x205566=_0x491f2b[_0x6dee03(0x179)][_0x1419b2[_0x6dee03(0x180)]];if(!_0x205566){_0x3528fe['push']({'sqlCode':_0x1419b2['sqlCode'],'error':_0x6dee03(0x16a)});continue;}try{const _0x41131a=await computeSqlFileHash(_0x1419b2['filePath']),_0x11ebb0=_0x205566[_0x6dee03(0x17a)]!==_0x1419b2['relativePath']||!!_0x1419b2[_0x6dee03(0x186)]&&_0x205566[_0x6dee03(0x186)]!==_0x1419b2[_0x6dee03(0x186)];if(!_0x3d966f[_0x6dee03(0x15a)](_0x6dee03(0x17d))&&_0x205566[_0x6dee03(0x162)]===_0x41131a&&!_0x11ebb0){_0x394059[_0x6dee03(0x170)]({'sqlCode':_0x1419b2[_0x6dee03(0x180)],'reason':_0x6dee03(0x164)});continue;}if(_0x205566['version']==null){_0x3528fe[_0x6dee03(0x170)]({'sqlCode':_0x1419b2[_0x6dee03(0x180)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x5b7e26=await readFile(_0x1419b2[_0x6dee03(0x165)],_0x6dee03(0x16e)),_0x397e06=stripLocalSqlMetadata(_0x5b7e26,_0x1419b2['mode']),_0x2e20ae=_0x1419b2[_0x6dee03(0x186)]||_0x205566[_0x6dee03(0x186)],_0x401c43=await resolveTargetDbBinding(_0x3d966f[_0x6dee03(0x171)],_0x1419b2,_0x205566),_0x5cdc37=await updateSqlQuery({'id':_0x205566['remoteId'],'appCode':_0x3d966f[_0x6dee03(0x171)],'sqlCode':_0x1419b2['sqlCode'],'sqlName':_0x2e20ae,'dbId':_0x401c43[_0x6dee03(0x185)],'version':_0x205566[_0x6dee03(0x194)],'sqlContent':_0x397e06,'sqlConfig':_0x205566[_0x6dee03(0x15d)]??undefined}),_0x46b1ee=_0x5cdc37[_0x6dee03(0x185)]?await getDbName(_0x3d966f['appCode'],Number(_0x5cdc37[_0x6dee03(0x185)]))[_0x6dee03(0x163)](()=>_0x401c43['dbName']):_0x401c43[_0x6dee03(0x182)];_0x491f2b[_0x6dee03(0x179)][_0x1419b2['sqlCode']]={...buildSqlLockEntry(_0x5cdc37,_0x397e06,_0x41131a,{'dbName':_0x46b1ee}),'path':_0x1419b2[_0x6dee03(0x195)],'mode':_0x205566[_0x6dee03(0x176)]},await archivePreviousSqlFileIfNeeded(_0x190cde,_0x205566['path'],_0x1419b2['relativePath']),_0x1b4ab8['push']({'sqlCode':_0x1419b2[_0x6dee03(0x180)],'remoteId':_0x205566[_0x6dee03(0x166)]});}catch(_0x36ed1c){_0x3528fe[_0x6dee03(0x170)]({'sqlCode':_0x1419b2[_0x6dee03(0x180)],'error':_0x36ed1c instanceof Error?_0x36ed1c[_0x6dee03(0x178)]:String(_0x36ed1c)});}}return _0x491f2b[_0x6dee03(0x15e)]=new Date()[_0x6dee03(0x187)](),await writeSqlLockFile(_0x190cde[_0x6dee03(0x197)],_0x4e8997),{'ok':_0x3528fe[_0x6dee03(0x16b)]===0x0,'data':{'pushed':_0x1b4ab8,'skipped':_0x394059,'failed':_0x3528fe},'message':_0x6dee03(0x189)+_0x1b4ab8[_0x6dee03(0x16b)]+'\x20pushed,\x20'+_0x394059['length']+'\x20skipped,\x20'+_0x3528fe[_0x6dee03(0x16b)]+_0x6dee03(0x17f)};}};async function archivePreviousSqlFileIfNeeded(_0x365d48,_0x543975,_0x3b38a9){const _0x115234=a128_0x262705;if(!_0x543975||_0x543975===_0x3b38a9)return;const _0x1fb02f=join(_0x365d48[_0x115234(0x172)],_0x543975);if(!await fileExists(_0x1fb02f))return;const _0x53c4a2=await moveToTrash(_0x365d48['projectRoot'],_0x365d48[_0x115234(0x196)],_0x1fb02f);await cleanupEmptyDirectories(dirname(_0x1fb02f),_0x365d48[_0x115234(0x172)]),void _0x53c4a2;}async function moveToTrash(_0x40970f,_0x37d057,_0x3333a2){const _0x14b5f2=a128_0x262705,_0x45b2af=new Date()['toISOString']()[_0x14b5f2(0x183)](/[:.]/g,'-'),_0x5fb3f5=relative(_0x40970f,_0x3333a2),_0x5ce63=join(_0x37d057,_0x45b2af,_0x5fb3f5);return await mkdir(dirname(_0x5ce63),{'recursive':!![]}),await rename(_0x3333a2,_0x5ce63),_0x5ce63;}async function cleanupEmptyDirectories(_0x1a0315,_0x514f50){const _0xa534a6=a128_0x262705;let _0x54b351=resolve(_0x1a0315);const _0x4ca826=resolve(_0x514f50);while(_0x54b351[_0xa534a6(0x16c)](''+_0x4ca826+sep)||_0x54b351===_0x4ca826){if(_0x54b351===_0x4ca826)return;try{const _0x1c955d=await readdir(_0x54b351);if(_0x1c955d[_0xa534a6(0x16b)]>0x0)return;await rmdir(_0x54b351);}catch{return;}_0x54b351=dirname(_0x54b351);}}async function resolveTargetDbBinding(_0x43f407,_0x24a020,_0x4fe7ef){const _0x2380df=a128_0x262705,_0x3cbc98=_0x24a020[_0x2380df(0x177)];if(!_0x3cbc98)return{'dbId':_0x4fe7ef[_0x2380df(0x185)],'dbName':_0x4fe7ef[_0x2380df(0x182)]};const _0xc42ed5=buildDbDirectoryName(_0x4fe7ef[_0x2380df(0x182)],_0x4fe7ef[_0x2380df(0x185)]);if(_0x3cbc98===_0xc42ed5)return{'dbId':_0x4fe7ef[_0x2380df(0x185)],'dbName':_0x4fe7ef[_0x2380df(0x182)]};const _0x28754d=parseExplicitDbDirectory(_0x3cbc98);if(_0x28754d!=null)return{'dbId':_0x28754d,'dbName':await getDbName(_0x43f407,_0x28754d)[_0x2380df(0x163)](()=>undefined)};const _0x44fc4b=await listDatabases(_0x43f407),_0x72135b=_0x44fc4b['filter'](_0x471efa=>buildDbDirectoryName(_0x471efa[_0x2380df(0x182)],_0x471efa[_0x2380df(0x185)])===_0x3cbc98);if(_0x72135b[_0x2380df(0x16b)]===0x1)return{'dbId':_0x72135b[0x0][_0x2380df(0x185)],'dbName':_0x72135b[0x0][_0x2380df(0x182)]};if(_0x72135b[_0x2380df(0x16b)]===0x0)throw CliErrors['validation'](_0x2380df(0x16f)+_0x3cbc98+'\x22\x20for\x20sqlCode\x20'+_0x24a020['sqlCode']+'.');const _0x229b54=_0x72135b[_0x2380df(0x193)](_0x4d26a7=>_0x4d26a7[_0x2380df(0x182)]+'\x20('+_0x4d26a7[_0x2380df(0x185)]+')')['join'](',\x20');throw CliErrors[_0x2380df(0x159)]('Local\x20directory\x20\x22'+_0x3cbc98+_0x2380df(0x17e)+_0x24a020['sqlCode']+':\x20'+_0x229b54);}function parseExplicitDbDirectory(_0x34bc40){const _0x4e1352=a128_0x262705,_0x5c2524=/^db-(\d+)$/['exec'](_0x34bc40);if(!_0x5c2524)return null;const _0x46b9c9=Number(_0x5c2524[0x1]);return Number[_0x4e1352(0x175)](_0x46b9c9)&&_0x46b9c9>0x0?_0x46b9c9:null;}
@@ -1 +1 @@
1
- function a129_0x1a42(){const _0xa9d8c1=['3774024TiZfpU','Path\x20to\x20the\x20SQL\x20file','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','661212qfwRtg','322525ybRPJo','20676IomJyv','112630RElwcV','688cTMnXv','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','sql','save','645Sskdoh','join','description','string','Query\x20description','379786yqVTqW','sqlname','693aUpWkJ','43813RxOyMB','validation','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`.','write','file'];a129_0x1a42=function(){return _0xa9d8c1;};return a129_0x1a42();}const a129_0x2a6846=a129_0x4b5c;function a129_0x4b5c(_0x584e11,_0x473122){_0x584e11=_0x584e11-0x1b0;const _0x1a42c7=a129_0x1a42();let _0x4b5c5f=_0x1a42c7[_0x584e11];return _0x4b5c5f;}(function(_0x5dd9fd,_0x3865ce){const _0x19f37c=a129_0x4b5c,_0x4de046=_0x5dd9fd();while(!![]){try{const _0x46765a=parseInt(_0x19f37c(0x1c2))/0x1+parseInt(_0x19f37c(0x1b6))/0x2+parseInt(_0x19f37c(0x1c1))/0x3+parseInt(_0x19f37c(0x1c3))/0x4*(-parseInt(_0x19f37c(0x1b1))/0x5)+parseInt(_0x19f37c(0x1be))/0x6+-parseInt(_0x19f37c(0x1b9))/0x7*(-parseInt(_0x19f37c(0x1c5))/0x8)+parseInt(_0x19f37c(0x1b8))/0x9*(-parseInt(_0x19f37c(0x1c4))/0xa);if(_0x46765a===_0x3865ce)break;else _0x4de046['push'](_0x4de046['shift']());}catch(_0x4ad957){_0x4de046['push'](_0x4de046['shift']());}}}(a129_0x1a42,0x595e0));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=['`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.',a129_0x2a6846(0x1c6),a129_0x2a6846(0x1bb)][a129_0x2a6846(0x1b2)]('\x0a');export const sqlSave={'service':a129_0x2a6846(0x1c7),'command':a129_0x2a6846(0x1b0),'description':'Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','risk':a129_0x2a6846(0x1bc),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a129_0x2a6846(0x1bd),'type':a129_0x2a6846(0x1b4),'required':!![],'description':a129_0x2a6846(0x1bf)},SQLCODE_FLAG_OPTIONAL,{'name':a129_0x2a6846(0x1b7),'type':a129_0x2a6846(0x1b4),'description':'SQL\x20query\x20display\x20name'},{'name':'db','type':'string','description':a129_0x2a6846(0x1c0)},{'name':a129_0x2a6846(0x1b3),'type':'string','description':a129_0x2a6846(0x1b5)}],async 'validate'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x500f94=a129_0x2a6846;throw CliErrors[_0x500f94(0x1ba)](SQL_SAVE_DEPRECATED_HINT);}};
1
+ function a129_0x478f(_0x2fcbc8,_0x390d87){_0x2fcbc8=_0x2fcbc8-0x121;const _0x1dd2ce=a129_0x1dd2();let _0x478f68=_0x1dd2ce[_0x2fcbc8];return _0x478f68;}const a129_0x53c54b=a129_0x478f;(function(_0xc41e56,_0x12592f){const _0x4e34ac=a129_0x478f,_0x45c4a3=_0xc41e56();while(!![]){try{const _0x4dda73=-parseInt(_0x4e34ac(0x12e))/0x1*(-parseInt(_0x4e34ac(0x126))/0x2)+parseInt(_0x4e34ac(0x128))/0x3*(parseInt(_0x4e34ac(0x123))/0x4)+-parseInt(_0x4e34ac(0x12b))/0x5*(-parseInt(_0x4e34ac(0x129))/0x6)+-parseInt(_0x4e34ac(0x127))/0x7+-parseInt(_0x4e34ac(0x136))/0x8+-parseInt(_0x4e34ac(0x130))/0x9*(-parseInt(_0x4e34ac(0x12d))/0xa)+-parseInt(_0x4e34ac(0x139))/0xb*(parseInt(_0x4e34ac(0x134))/0xc);if(_0x4dda73===_0x12592f)break;else _0x45c4a3['push'](_0x45c4a3['shift']());}catch(_0x836123){_0x45c4a3['push'](_0x45c4a3['shift']());}}}(a129_0x1dd2,0x7137d));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a129_0x53c54b(0x124),a129_0x53c54b(0x135),'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`.'][a129_0x53c54b(0x133)]('\x0a');function a129_0x1dd2(){const _0x4f0af9=['sqlname','17171wsutUD','validation','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','2570884TSrERS','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','Path\x20to\x20the\x20SQL\x20file','4306kEoinr','1857408QjBXQF','3WNhKkn','12LRukSa','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','2209030HAeHMk','write','30BiDdMq','419ahxAWy','file','764865aLfLzq','save','description','join','11808etlClP','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','3346288JsUdou','string'];a129_0x1dd2=function(){return _0x4f0af9;};return a129_0x1dd2();}export const sqlSave={'service':'sql','command':a129_0x53c54b(0x131),'description':a129_0x53c54b(0x122),'risk':a129_0x53c54b(0x12c),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a129_0x53c54b(0x12f),'type':a129_0x53c54b(0x137),'required':!![],'description':a129_0x53c54b(0x125)},SQLCODE_FLAG_OPTIONAL,{'name':a129_0x53c54b(0x138),'type':a129_0x53c54b(0x137),'description':'SQL\x20query\x20display\x20name'},{'name':'db','type':'string','description':a129_0x53c54b(0x12a)},{'name':a129_0x53c54b(0x132),'type':a129_0x53c54b(0x137),'description':'Query\x20description'}],async 'validate'(){const _0x4f30fd=a129_0x53c54b;throw CliErrors[_0x4f30fd(0x121)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x43cc35=a129_0x53c54b;throw CliErrors[_0x43cc35(0x121)](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- (function(_0x53a788,_0x548877){const _0x49f02a=a130_0x2798,_0x4c210d=_0x53a788();while(!![]){try{const _0x451698=-parseInt(_0x49f02a(0xac))/0x1+parseInt(_0x49f02a(0xbb))/0x2+-parseInt(_0x49f02a(0xae))/0x3+-parseInt(_0x49f02a(0xcb))/0x4+parseInt(_0x49f02a(0xa8))/0x5+parseInt(_0x49f02a(0xbf))/0x6+parseInt(_0x49f02a(0xb2))/0x7;if(_0x451698===_0x548877)break;else _0x4c210d['push'](_0x4c210d['shift']());}catch(_0x36029c){_0x4c210d['push'](_0x4c210d['shift']());}}}(a130_0x2cde,0x7495b));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x580e36,_0x278b00,_0x415865,_0x20015c){const _0x17cc0d=a130_0x2798,_0x22be39=detectSqlMode(_0x278b00);return{'path':buildSqlRelativePath(_0x580e36[_0x17cc0d(0xb8)],_0x580e36[_0x17cc0d(0xc0)],_0x20015c?.[_0x17cc0d(0xc5)],_0x22be39,_0x580e36['dbId']),'hash':_0x415865,'remoteId':_0x580e36['id'],'version':_0x580e36[_0x17cc0d(0xc2)],'dbId':Number(_0x580e36[_0x17cc0d(0xa6)]),'dbName':_0x20015c?.['dbName'],'sqlName':_0x580e36[_0x17cc0d(0xc0)],'sqlConfig':_0x580e36['sqlConfig']??undefined,'mode':_0x22be39};}export function cloneSqlLockData(_0x1c65ef){const _0x3d8bb1=a130_0x2798;return{'apps':Object[_0x3d8bb1(0xa7)](Object[_0x3d8bb1(0xc3)](_0x1c65ef['apps'])[_0x3d8bb1(0xc6)](([_0x49b505,_0x66636b])=>[_0x49b505,{'sqlRoot':_0x66636b[_0x3d8bb1(0xb0)],'lastSync':_0x66636b[_0x3d8bb1(0xa5)],'sqls':{..._0x66636b['sqls']}}]))};}export function ensureRemoteSqlContent(_0xa6c3db){const _0x9b366e=a130_0x2798;return _0xa6c3db[_0x9b366e(0xbc)]??'';}export function buildLocalSqlFileContent(_0x5bc09a,_0x1a2494,_0x728027){const _0x34fb4c=a130_0x2798,_0x269313=_0x728027?.[_0x34fb4c(0xc7)]??detectSqlMode(_0x1a2494),_0x46d17e=stripLocalSqlMetadata(_0x1a2494,_0x269313)[_0x34fb4c(0xb1)](),_0x5ba997=[...buildMetadataHeaderLines({'sqlCode':_0x5bc09a[_0x34fb4c(0xb8)],'sqlName':_0x5bc09a[_0x34fb4c(0xc0)],'dbId':_0x5bc09a[_0x34fb4c(0xa6)],'dbName':_0x728027?.[_0x34fb4c(0xc5)],'mode':_0x269313,'syncedAt':_0x728027?.['syncedAt'],'description':_0x728027?.[_0x34fb4c(0xca)]},_0x269313),'',_0x46d17e],_0x1bcd93=_0x5ba997[_0x34fb4c(0xc9)]('\x0a');return _0x1bcd93[_0x34fb4c(0xc1)]('\x0a')?_0x1bcd93:_0x1bcd93+'\x0a';}function a130_0x2cde(){const _0x508d79=['mybatisXml','trimStart','261082ZnOOPi','path','767637bWTClb','toLowerCase','sqlRoot','trim','396767WPkDAf','--\x20@lovrabet.','syncedAt','question','includes','stdin','sqlCode','test','replace','1694208CdgpQz','sqlContent','split','length','981822YdLlTS','sqlName','endsWith','version','entries','push','dbName','map','mode','yes','join','description','3043392TCcBlp','lastSync','dbId','fromEntries','3439590RhGzmc','stderr'];a130_0x2cde=function(){return _0x508d79;};return a130_0x2cde();}export function stripLocalSqlMetadata(_0x110a74,_0x40fd25){const _0x6ecc01=a130_0x2798,_0x14886d=_0x110a74[_0x6ecc01(0xba)](/\r\n/g,'\x0a')[_0x6ecc01(0xbd)]('\x0a'),_0x2d7fdb=[];let _0x2408f8=0x0;if(_0x40fd25===_0x6ecc01(0xaa))while(_0x2408f8<_0x14886d[_0x6ecc01(0xbe)]){const _0x52b519=_0x14886d[_0x2408f8]??'';if(/^\s*<!--\s*@lovrabet\./[_0x6ecc01(0xb9)](_0x52b519)){_0x2408f8++;continue;}if(_0x52b519[_0x6ecc01(0xb1)]()===''&&_0x2408f8>0x0){_0x2408f8++;continue;}break;}else while(_0x2408f8<_0x14886d[_0x6ecc01(0xbe)]){const _0x1ee138=_0x14886d[_0x2408f8]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x1ee138)){_0x2408f8++;continue;}if(_0x1ee138['trim']()===''&&_0x2408f8>0x0){_0x2408f8++;continue;}break;}for(;_0x2408f8<_0x14886d[_0x6ecc01(0xbe)];_0x2408f8++){_0x2d7fdb[_0x6ecc01(0xc4)](_0x14886d[_0x2408f8]);}return _0x2d7fdb[_0x6ecc01(0xc9)]('\x0a')[_0x6ecc01(0xab)]();}export function resolveSqlMode(_0x452211,_0x4a8b1e){const _0x261320=a130_0x2798;if(_0x4a8b1e?.[_0x261320(0xc7)])return _0x4a8b1e[_0x261320(0xc7)];return detectSqlMode(_0x452211);}export function resolveSqlFileName(_0x3a0f39,_0xff2855,_0x1a165e){const _0x2b561c=a130_0x2798;if(_0x1a165e?.[_0x2b561c(0xad)])return _0x1a165e['path'];if(_0x1a165e?.['sqlName']||_0x1a165e?.[_0x2b561c(0xc5)])return buildSqlRelativePath(_0x3a0f39,_0x1a165e?.['sqlName'],_0x1a165e?.[_0x2b561c(0xc5)],resolveSqlMode(_0xff2855,_0x1a165e),_0x1a165e?.['dbId']);return buildDefaultSqlFileName(_0x3a0f39,resolveSqlMode(_0xff2855,_0x1a165e));}export function resolveSqlLocalDir(_0x296ffb,_0x2c8d83){return join(_0x296ffb,SQL_LOCAL_REL_DIR,_0x2c8d83);}export async function confirmForceOverwrite(_0x7cf285){const _0x1306d9=a130_0x2798,_0x31aee5=createInterface({'input':process[_0x1306d9(0xb7)],'output':process[_0x1306d9(0xa9)]}),_0x4a12e9=await new Promise(_0x39ba58=>{const _0x3d8437=_0x1306d9;_0x31aee5[_0x3d8437(0xb5)](_0x7cf285+'\x20[y/N]\x20',_0x39ba58);});return _0x31aee5['close'](),['y',_0x1306d9(0xc8)][_0x1306d9(0xb6)](_0x4a12e9[_0x1306d9(0xb1)]()[_0x1306d9(0xaf)]());}function a130_0x2798(_0x401e54,_0x3e4d18){_0x401e54=_0x401e54-0xa5;const _0x2cde87=a130_0x2cde();let _0x2798ef=_0x2cde87[_0x401e54];return _0x2798ef;}export function findSqlLockScope(_0xdac710,_0x3adf86){return _0xdac710['apps'][_0x3adf86];}function buildMetadataHeaderLines(_0x5d6f39,_0x2fd2b0){const _0x4b182c=a130_0x2798,_0x369488=[['sqlCode',_0x5d6f39[_0x4b182c(0xb8)]],[_0x4b182c(0xc0),_0x5d6f39['sqlName']],[_0x4b182c(0xa6),_0x5d6f39[_0x4b182c(0xa6)]],['dbName',_0x5d6f39[_0x4b182c(0xc5)]],[_0x4b182c(0xc7),_0x5d6f39[_0x4b182c(0xc7)]],['syncedAt',_0x5d6f39[_0x4b182c(0xb4)]],[_0x4b182c(0xca),_0x5d6f39[_0x4b182c(0xca)]]];if(_0x2fd2b0===_0x4b182c(0xaa))return _0x369488['filter'](([,_0x5b58cc])=>_0x5b58cc!==undefined&&_0x5b58cc!==null&&String(_0x5b58cc)[_0x4b182c(0xb1)]()!=='')[_0x4b182c(0xc6)](([_0x12e3c0,_0x161bb0])=>'<!--\x20@lovrabet.'+_0x12e3c0+':\x20'+String(_0x161bb0)+'\x20-->');return _0x369488['filter'](([,_0x145ee2])=>_0x145ee2!==undefined&&_0x145ee2!==null&&String(_0x145ee2)['trim']()!=='')[_0x4b182c(0xc6)](([_0x46a954,_0x59c44d])=>_0x4b182c(0xb3)+_0x46a954+':\x20'+String(_0x59c44d));}
1
+ const a130_0x498784=a130_0x29b1;(function(_0x2c5f91,_0x320f9e){const _0x49c642=a130_0x29b1,_0x17f1af=_0x2c5f91();while(!![]){try{const _0x57f275=parseInt(_0x49c642(0x1f2))/0x1+-parseInt(_0x49c642(0x1db))/0x2+parseInt(_0x49c642(0x1e7))/0x3+-parseInt(_0x49c642(0x1d7))/0x4+-parseInt(_0x49c642(0x1e3))/0x5+-parseInt(_0x49c642(0x1d0))/0x6+parseInt(_0x49c642(0x1da))/0x7;if(_0x57f275===_0x320f9e)break;else _0x17f1af['push'](_0x17f1af['shift']());}catch(_0x17e057){_0x17f1af['push'](_0x17f1af['shift']());}}}(a130_0x5a80,0x9193c));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a130_0x498784(0x1d9);export function buildSqlLockEntry(_0x397b73,_0x1dc104,_0x238d9c,_0xf89d7b){const _0x2252e0=a130_0x498784,_0x3dbeef=detectSqlMode(_0x1dc104);return{'path':buildSqlRelativePath(_0x397b73[_0x2252e0(0x1f6)],_0x397b73['sqlName'],_0xf89d7b?.[_0x2252e0(0x1d1)],_0x3dbeef,_0x397b73[_0x2252e0(0x1df)]),'hash':_0x238d9c,'remoteId':_0x397b73['id'],'version':_0x397b73[_0x2252e0(0x1e9)],'dbId':Number(_0x397b73[_0x2252e0(0x1df)]),'dbName':_0xf89d7b?.[_0x2252e0(0x1d1)],'sqlName':_0x397b73[_0x2252e0(0x1eb)],'sqlConfig':_0x397b73[_0x2252e0(0x1e5)]??undefined,'mode':_0x3dbeef};}function a130_0x5a80(){const _0x208745=['716060tdTmvM','split','replace','entries','dbId','length','fromEntries','test','2310810YQDuod','join','sqlConfig','question','1927638FPWVnH','sqls','version','mode','sqlName','\x20-->','sqlContent','map','trim','mybatisXml','push','483277fhsZtV','sqlRoot','includes','stderr','sqlCode','lastSync','endsWith','toLowerCase','--\x20@lovrabet.','4011144qmhmVh','dbName','\x20[y/N]\x20','<!--\x20@lovrabet.','path','apps','description','3893396wcnooX','syncedAt','.rabetbase/sql','13527682mvLbMc'];a130_0x5a80=function(){return _0x208745;};return a130_0x5a80();}export function cloneSqlLockData(_0x10922a){const _0x468a91=a130_0x498784;return{'apps':Object[_0x468a91(0x1e1)](Object[_0x468a91(0x1de)](_0x10922a[_0x468a91(0x1d5)])[_0x468a91(0x1ee)](([_0x5b4544,_0x24ab51])=>[_0x5b4544,{'sqlRoot':_0x24ab51[_0x468a91(0x1f3)],'lastSync':_0x24ab51[_0x468a91(0x1cc)],'sqls':{..._0x24ab51[_0x468a91(0x1e8)]}}]))};}export function ensureRemoteSqlContent(_0xe386fc){const _0x19f310=a130_0x498784;return _0xe386fc[_0x19f310(0x1ed)]??'';}export function buildLocalSqlFileContent(_0x270392,_0x279160,_0x27bbe3){const _0x277a92=a130_0x498784,_0x32a6ae=_0x27bbe3?.[_0x277a92(0x1ea)]??detectSqlMode(_0x279160),_0x43a141=stripLocalSqlMetadata(_0x279160,_0x32a6ae)[_0x277a92(0x1ef)](),_0xd79443=[...buildMetadataHeaderLines({'sqlCode':_0x270392['sqlCode'],'sqlName':_0x270392[_0x277a92(0x1eb)],'dbId':_0x270392[_0x277a92(0x1df)],'dbName':_0x27bbe3?.[_0x277a92(0x1d1)],'mode':_0x32a6ae,'syncedAt':_0x27bbe3?.[_0x277a92(0x1d8)],'description':_0x27bbe3?.['description']},_0x32a6ae),'',_0x43a141],_0x50d641=_0xd79443[_0x277a92(0x1e4)]('\x0a');return _0x50d641[_0x277a92(0x1cd)]('\x0a')?_0x50d641:_0x50d641+'\x0a';}export function stripLocalSqlMetadata(_0x47f298,_0x43fbda){const _0x5c37b0=a130_0x498784,_0x2b0f0e=_0x47f298[_0x5c37b0(0x1dd)](/\r\n/g,'\x0a')[_0x5c37b0(0x1dc)]('\x0a'),_0x4fbcb4=[];let _0x8578a7=0x0;if(_0x43fbda===_0x5c37b0(0x1f0))while(_0x8578a7<_0x2b0f0e['length']){const _0x528483=_0x2b0f0e[_0x8578a7]??'';if(/^\s*<!--\s*@lovrabet\./[_0x5c37b0(0x1e2)](_0x528483)){_0x8578a7++;continue;}if(_0x528483[_0x5c37b0(0x1ef)]()===''&&_0x8578a7>0x0){_0x8578a7++;continue;}break;}else while(_0x8578a7<_0x2b0f0e[_0x5c37b0(0x1e0)]){const _0x42ddfe=_0x2b0f0e[_0x8578a7]??'';if(/^\s*--\s*@lovrabet\./[_0x5c37b0(0x1e2)](_0x42ddfe)){_0x8578a7++;continue;}if(_0x42ddfe['trim']()===''&&_0x8578a7>0x0){_0x8578a7++;continue;}break;}for(;_0x8578a7<_0x2b0f0e['length'];_0x8578a7++){_0x4fbcb4[_0x5c37b0(0x1f1)](_0x2b0f0e[_0x8578a7]);}return _0x4fbcb4['join']('\x0a')['trimStart']();}export function resolveSqlMode(_0x6222dd,_0x328ba9){const _0x4ccca4=a130_0x498784;if(_0x328ba9?.[_0x4ccca4(0x1ea)])return _0x328ba9[_0x4ccca4(0x1ea)];return detectSqlMode(_0x6222dd);}export function resolveSqlFileName(_0x4833e4,_0x1a998b,_0x1b988c){const _0xfd86dd=a130_0x498784;if(_0x1b988c?.[_0xfd86dd(0x1d4)])return _0x1b988c[_0xfd86dd(0x1d4)];if(_0x1b988c?.[_0xfd86dd(0x1eb)]||_0x1b988c?.[_0xfd86dd(0x1d1)])return buildSqlRelativePath(_0x4833e4,_0x1b988c?.[_0xfd86dd(0x1eb)],_0x1b988c?.[_0xfd86dd(0x1d1)],resolveSqlMode(_0x1a998b,_0x1b988c),_0x1b988c?.[_0xfd86dd(0x1df)]);return buildDefaultSqlFileName(_0x4833e4,resolveSqlMode(_0x1a998b,_0x1b988c));}export function resolveSqlLocalDir(_0x3f0b96,_0x53417c){return join(_0x3f0b96,SQL_LOCAL_REL_DIR,_0x53417c);}function a130_0x29b1(_0x181efa,_0x249ad2){_0x181efa=_0x181efa-0x1cc;const _0x5a8008=a130_0x5a80();let _0x29b1e2=_0x5a8008[_0x181efa];return _0x29b1e2;}export async function confirmForceOverwrite(_0xbb6115){const _0xc2e5b=a130_0x498784,_0x1c7dea=createInterface({'input':process['stdin'],'output':process[_0xc2e5b(0x1f5)]}),_0x4f2b6e=await new Promise(_0x43ba0c=>{const _0x104d97=_0xc2e5b;_0x1c7dea[_0x104d97(0x1e6)](_0xbb6115+_0x104d97(0x1d2),_0x43ba0c);});return _0x1c7dea['close'](),['y','yes'][_0xc2e5b(0x1f4)](_0x4f2b6e[_0xc2e5b(0x1ef)]()[_0xc2e5b(0x1ce)]());}export function findSqlLockScope(_0x5ab6de,_0x33429d){const _0x140d36=a130_0x498784;return _0x5ab6de[_0x140d36(0x1d5)][_0x33429d];}function buildMetadataHeaderLines(_0x40b8cf,_0x44bdae){const _0xd14992=a130_0x498784,_0x8e10eb=[[_0xd14992(0x1f6),_0x40b8cf[_0xd14992(0x1f6)]],[_0xd14992(0x1eb),_0x40b8cf[_0xd14992(0x1eb)]],[_0xd14992(0x1df),_0x40b8cf['dbId']],[_0xd14992(0x1d1),_0x40b8cf[_0xd14992(0x1d1)]],[_0xd14992(0x1ea),_0x40b8cf[_0xd14992(0x1ea)]],[_0xd14992(0x1d8),_0x40b8cf['syncedAt']],[_0xd14992(0x1d6),_0x40b8cf[_0xd14992(0x1d6)]]];if(_0x44bdae===_0xd14992(0x1f0))return _0x8e10eb['filter'](([,_0x1ce02d])=>_0x1ce02d!==undefined&&_0x1ce02d!==null&&String(_0x1ce02d)[_0xd14992(0x1ef)]()!=='')[_0xd14992(0x1ee)](([_0x58eeab,_0x564fd2])=>_0xd14992(0x1d3)+_0x58eeab+':\x20'+String(_0x564fd2)+_0xd14992(0x1ec));return _0x8e10eb['filter'](([,_0xe5de99])=>_0xe5de99!==undefined&&_0xe5de99!==null&&String(_0xe5de99)[_0xd14992(0x1ef)]()!=='')[_0xd14992(0x1ee)](([_0x4d1e40,_0x2411c2])=>_0xd14992(0x1cf)+_0x4d1e40+':\x20'+String(_0x2411c2));}
@@ -1 +1 @@
1
- const a131_0x1244d9=a131_0x3fa2;(function(_0x53759f,_0x29511e){const _0x477e59=a131_0x3fa2,_0x3e95d5=_0x53759f();while(!![]){try{const _0x550035=-parseInt(_0x477e59(0x1a8))/0x1*(-parseInt(_0x477e59(0x1a3))/0x2)+parseInt(_0x477e59(0x189))/0x3+-parseInt(_0x477e59(0x19e))/0x4+parseInt(_0x477e59(0x18d))/0x5+parseInt(_0x477e59(0x19c))/0x6+parseInt(_0x477e59(0x195))/0x7+-parseInt(_0x477e59(0x191))/0x8;if(_0x550035===_0x29511e)break;else _0x3e95d5['push'](_0x3e95d5['shift']());}catch(_0x2e8559){_0x3e95d5['push'](_0x3e95d5['shift']());}}}(a131_0x3775,0x535d0));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';function a131_0x3fa2(_0xe04bed,_0x41e32e){_0xe04bed=_0xe04bed-0x187;const _0x3775fd=a131_0x3775();let _0x3fa21a=_0x3775fd[_0xe04bed];return _0x3fa21a;}function a131_0x3775(){const _0x3424db=['706708zXPFMq','keys','sqlRoot','sqls','relativePath','2444raBjqg','sqlName','boolean','length','tableData','58uQXAZc','sql','\x20modified,\x20','396393VIrUeA','remote','has','totalCount','3004235PpgvMh','lockKey','bool','read','11734824HJDOaY','map','appCode','filePath','3669946CcycEr','All\x20SQL\x20queries\x20are\x20in\x20sync.','path','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','\x20unchanged','sqlCode','push','3941124IhDnrv','status'];a131_0x3775=function(){return _0x3424db;};return a131_0x3775();}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(_0x2a0d97){const _0x5f2bf0=a131_0x3fa2,_0xb4ddf3=[];let _0x6984b1=0x1;while(!![]){const _0x26dd14=await listSqlQueries(_0x2a0d97,{'currentPage':_0x6984b1,'pageSize':PAGE_SIZE}),_0x5ecfa7=_0x26dd14[_0x5f2bf0(0x1a7)]??[];_0xb4ddf3[_0x5f2bf0(0x19b)](..._0x5ecfa7[_0x5f2bf0(0x192)](_0x179a45=>_0x179a45[_0x5f2bf0(0x19a)]));if(_0x5ecfa7[_0x5f2bf0(0x1a6)]===0x0)break;const _0x4ef7e5=_0x26dd14['paging']?.[_0x5f2bf0(0x18c)];if(_0x4ef7e5!=null?_0xb4ddf3[_0x5f2bf0(0x1a6)]>=_0x4ef7e5:_0x5ecfa7[_0x5f2bf0(0x1a6)]<PAGE_SIZE)break;_0x6984b1++;}return _0xb4ddf3;}export const sqlStatus={'service':a131_0x1244d9(0x187),'command':a131_0x1244d9(0x19d),'description':a131_0x1244d9(0x198),'risk':a131_0x1244d9(0x190),'flags':[{'name':'remote','type':a131_0x1244d9(0x1a5),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x137f37){const _0x3f5390=a131_0x1244d9,_0x108217=loadSqlProjectConfig(_0x137f37[_0x3f5390(0x193)]),_0x40baf5=await readSqlLockFile(_0x108217['lockFilePath']),{appLock:_0x121862}=ensureSqlLockScope(_0x40baf5??createEmptySqlLock(),_0x108217[_0x3f5390(0x193)],_0x108217[_0x3f5390(0x1a0)],'status'),_0x1dd69c=await scanLocalSqlQueries(_0x108217),_0xfc60e9=[],_0x2988ab=[],_0x1a4e5d=[],_0xd1652=[],_0x250166=new Set(_0x1dd69c[_0x3f5390(0x192)](_0x3e801a=>_0x3e801a['lockKey']));for(const _0x3e98d2 of _0x1dd69c){const _0x2705e8=await computeSqlFileHash(_0x3e98d2[_0x3f5390(0x194)]),_0x1f167=_0x121862[_0x3f5390(0x1a1)][_0x3e98d2[_0x3f5390(0x18e)]],_0x459f7d=!!_0x1f167&&_0x1f167[_0x3f5390(0x197)]!==_0x3e98d2[_0x3f5390(0x1a2)],_0x859492=!!_0x1f167&&!!_0x3e98d2[_0x3f5390(0x1a4)]&&_0x1f167[_0x3f5390(0x1a4)]!==_0x3e98d2[_0x3f5390(0x1a4)];if(!_0x1f167)_0xfc60e9['push'](_0x3e98d2[_0x3f5390(0x18e)]);else _0x1f167['hash']!==_0x2705e8||_0x459f7d||_0x859492?_0x2988ab[_0x3f5390(0x19b)](_0x3e98d2['lockKey']):_0x1a4e5d[_0x3f5390(0x19b)](_0x3e98d2['lockKey']);}for(const _0x1e0da1 of Object[_0x3f5390(0x19f)](_0x121862[_0x3f5390(0x1a1)])){!_0x250166[_0x3f5390(0x18b)](_0x1e0da1)&&_0xd1652[_0x3f5390(0x19b)](_0x1e0da1);}const _0x4df440=[];if(_0x137f37[_0x3f5390(0x18f)](_0x3f5390(0x18a))){const _0x122af6=await fetchAllSqlCodes(_0x137f37[_0x3f5390(0x193)]);for(const _0x3ef56c of _0x122af6){!_0x250166[_0x3f5390(0x18b)](_0x3ef56c)&&!_0x121862[_0x3f5390(0x1a1)][_0x3ef56c]&&_0x4df440['push'](_0x3ef56c);}}const _0x30151e=_0xfc60e9[_0x3f5390(0x1a6)]===0x0&&_0x2988ab['length']===0x0&&_0xd1652[_0x3f5390(0x1a6)]===0x0&&_0x4df440[_0x3f5390(0x1a6)]===0x0;return{'ok':!![],'data':{'added':_0xfc60e9,'modified':_0x2988ab,'missing':_0xd1652,'unchanged':_0x1a4e5d,'remoteOnly':_0x4df440},'message':_0x30151e?_0x3f5390(0x196):_0xfc60e9[_0x3f5390(0x1a6)]+'\x20added,\x20'+_0x2988ab[_0x3f5390(0x1a6)]+_0x3f5390(0x188)+_0xd1652[_0x3f5390(0x1a6)]+'\x20missing,\x20'+_0x1a4e5d[_0x3f5390(0x1a6)]+_0x3f5390(0x199)+(_0x4df440[_0x3f5390(0x1a6)]>0x0?',\x20'+_0x4df440[_0x3f5390(0x1a6)]+'\x20remote-only':'')};}};
1
+ const a131_0x39fec8=a131_0x2e87;(function(_0xdc149,_0x332a29){const _0x5f504d=a131_0x2e87,_0x169c76=_0xdc149();while(!![]){try{const _0x148d2a=parseInt(_0x5f504d(0x13e))/0x1*(-parseInt(_0x5f504d(0x144))/0x2)+-parseInt(_0x5f504d(0x14b))/0x3*(-parseInt(_0x5f504d(0x155))/0x4)+-parseInt(_0x5f504d(0x15f))/0x5+parseInt(_0x5f504d(0x13f))/0x6*(-parseInt(_0x5f504d(0x14e))/0x7)+parseInt(_0x5f504d(0x146))/0x8*(-parseInt(_0x5f504d(0x141))/0x9)+parseInt(_0x5f504d(0x15d))/0xa*(parseInt(_0x5f504d(0x14a))/0xb)+parseInt(_0x5f504d(0x13d))/0xc;if(_0x148d2a===_0x332a29)break;else _0x169c76['push'](_0x169c76['shift']());}catch(_0x3b2bca){_0x169c76['push'](_0x169c76['shift']());}}}(a131_0x5bff,0xf041d));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';function a131_0x2e87(_0x30baed,_0x2c111f){_0x30baed=_0x30baed-0x139;const _0x5bffd5=a131_0x5bff();let _0x2e87db=_0x5bffd5[_0x30baed];return _0x2e87db;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a131_0x5bff(){const _0x1f3b90=['3824799jPlwGG','map','paging','501634qyUHIP','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','length','lockFilePath','sql','relativePath','4ecZHGJ','lockKey','status','tableData','totalCount','path','\x20missing,\x20','has','130BWWLoh','sqlName','8629645ErjtnQ','hash','\x20unchanged','\x20added,\x20','push','\x20remote-only','26070984vuSTbf','20454pySWfD','12ezXWdZ','All\x20SQL\x20queries\x20are\x20in\x20sync.','45rftAUi','appCode','boolean','50pLAnsP','keys','146904wovQOr','remote','sqlRoot','sqls','7612zWPlBt'];a131_0x5bff=function(){return _0x1f3b90;};return a131_0x5bff();}async function fetchAllSqlCodes(_0x4a2f11){const _0x162665=a131_0x2e87,_0x3c3195=[];let _0x4909f3=0x1;while(!![]){const _0x4273fa=await listSqlQueries(_0x4a2f11,{'currentPage':_0x4909f3,'pageSize':PAGE_SIZE}),_0x5905e7=_0x4273fa[_0x162665(0x158)]??[];_0x3c3195['push'](..._0x5905e7[_0x162665(0x14c)](_0x157486=>_0x157486['sqlCode']));if(_0x5905e7['length']===0x0)break;const _0x1e2d68=_0x4273fa[_0x162665(0x14d)]?.[_0x162665(0x159)];if(_0x1e2d68!=null?_0x3c3195[_0x162665(0x151)]>=_0x1e2d68:_0x5905e7[_0x162665(0x151)]<PAGE_SIZE)break;_0x4909f3++;}return _0x3c3195;}export const sqlStatus={'service':a131_0x39fec8(0x153),'command':'status','description':a131_0x39fec8(0x14f),'risk':'read','flags':[{'name':a131_0x39fec8(0x147),'type':a131_0x39fec8(0x143),'description':a131_0x39fec8(0x150)}],async 'execute'(_0x5ba92d){const _0x417906=a131_0x39fec8,_0x325e64=loadSqlProjectConfig(_0x5ba92d[_0x417906(0x142)]),_0x320428=await readSqlLockFile(_0x325e64[_0x417906(0x152)]),{appLock:_0x5b11a9}=ensureSqlLockScope(_0x320428??createEmptySqlLock(),_0x325e64['appCode'],_0x325e64[_0x417906(0x148)],_0x417906(0x157)),_0x3f887c=await scanLocalSqlQueries(_0x325e64),_0x2d02b2=[],_0xb538c3=[],_0x3e1fff=[],_0x451ffa=[],_0x417274=new Set(_0x3f887c[_0x417906(0x14c)](_0x4b5e20=>_0x4b5e20[_0x417906(0x156)]));for(const _0x17063d of _0x3f887c){const _0x2d6066=await computeSqlFileHash(_0x17063d['filePath']),_0x28a245=_0x5b11a9[_0x417906(0x149)][_0x17063d[_0x417906(0x156)]],_0x5aab99=!!_0x28a245&&_0x28a245[_0x417906(0x15a)]!==_0x17063d[_0x417906(0x154)],_0x24f090=!!_0x28a245&&!!_0x17063d[_0x417906(0x15e)]&&_0x28a245[_0x417906(0x15e)]!==_0x17063d[_0x417906(0x15e)];if(!_0x28a245)_0x2d02b2['push'](_0x17063d[_0x417906(0x156)]);else _0x28a245[_0x417906(0x160)]!==_0x2d6066||_0x5aab99||_0x24f090?_0xb538c3[_0x417906(0x13b)](_0x17063d['lockKey']):_0x3e1fff[_0x417906(0x13b)](_0x17063d[_0x417906(0x156)]);}for(const _0x4d3460 of Object[_0x417906(0x145)](_0x5b11a9[_0x417906(0x149)])){!_0x417274[_0x417906(0x15c)](_0x4d3460)&&_0x451ffa[_0x417906(0x13b)](_0x4d3460);}const _0x24b22e=[];if(_0x5ba92d['bool'](_0x417906(0x147))){const _0x11c0e1=await fetchAllSqlCodes(_0x5ba92d['appCode']);for(const _0x1da903 of _0x11c0e1){!_0x417274[_0x417906(0x15c)](_0x1da903)&&!_0x5b11a9[_0x417906(0x149)][_0x1da903]&&_0x24b22e['push'](_0x1da903);}}const _0x3a623d=_0x2d02b2['length']===0x0&&_0xb538c3['length']===0x0&&_0x451ffa[_0x417906(0x151)]===0x0&&_0x24b22e['length']===0x0;return{'ok':!![],'data':{'added':_0x2d02b2,'modified':_0xb538c3,'missing':_0x451ffa,'unchanged':_0x3e1fff,'remoteOnly':_0x24b22e},'message':_0x3a623d?_0x417906(0x140):_0x2d02b2['length']+_0x417906(0x13a)+_0xb538c3['length']+'\x20modified,\x20'+_0x451ffa[_0x417906(0x151)]+_0x417906(0x15b)+_0x3e1fff['length']+_0x417906(0x139)+(_0x24b22e[_0x417906(0x151)]>0x0?',\x20'+_0x24b22e['length']+_0x417906(0x13c):'')};}};
@@ -1 +1 @@
1
- const a132_0x23c7bb=a132_0x5300;(function(_0x4542b7,_0x161685){const _0x1788de=a132_0x5300,_0x1eb0c5=_0x4542b7();while(!![]){try{const _0x1ad938=parseInt(_0x1788de(0x1de))/0x1+-parseInt(_0x1788de(0x1da))/0x2+parseInt(_0x1788de(0x1d7))/0x3+parseInt(_0x1788de(0x1d2))/0x4+parseInt(_0x1788de(0x1e6))/0x5+-parseInt(_0x1788de(0x1e5))/0x6+-parseInt(_0x1788de(0x1cc))/0x7;if(_0x1ad938===_0x161685)break;else _0x1eb0c5['push'](_0x1eb0c5['shift']());}catch(_0x2c935b){_0x1eb0c5['push'](_0x1eb0c5['shift']());}}}(a132_0x2a47,0x1e995));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a132_0x2a47(){const _0x9c2108=['cwd','size','reason','961920CeqEbk','validate','file','trim','name','576201jfbibt','appCode','schemaWarnings','414620iYUQFA','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','Table\x20\x22','read','125059SHjioM','from','dbtableConfig','message','isArray','SQL\x20schema\x20validation','schema:','223578GIVdvU','111770NZrtYj','fields','map','isSelectOnly','toLowerCase','parameters','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','str','\x22\x20not\x20found\x20in\x20any\x20dataset','Provide\x20--file\x20or\x20--sql','sqlType','length','tableName','\x22\x20not\x20found\x20or\x20not\x20accessible','flagMissing','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','valid','get','type','sql','string','push','utf-8','tables','1470378WeBCWX','isDangerous','schemas'];a132_0x2a47=function(){return _0x9c2108;};return a132_0x2a47();}import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a132_0x5300(_0x3d2dfe,_0x1eb979){_0x3d2dfe=_0x3d2dfe-0x1bf;const _0x2a4742=a132_0x2a47();let _0x530071=_0x2a4742[_0x3d2dfe];return _0x530071;}import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a132_0x23c7bb(0x1c7),'command':a132_0x23c7bb(0x1d3),'description':a132_0x23c7bb(0x1ec),'risk':a132_0x23c7bb(0x1dd),'flags':[{'name':a132_0x23c7bb(0x1d4),'type':'string','description':a132_0x23c7bb(0x1c3)},{'name':a132_0x23c7bb(0x1c7),'type':a132_0x23c7bb(0x1c8),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':'schemas','type':a132_0x23c7bb(0x1c8),'description':a132_0x23c7bb(0x1db)}],async 'execute'(_0x50e346){const _0x53625f=a132_0x23c7bb,_0x111761=_0x50e346[_0x53625f(0x1ed)](_0x53625f(0x1d4)),_0x3a601f=_0x50e346[_0x53625f(0x1ed)]('sql');if(!_0x111761&&!_0x3a601f)throw CliErrors[_0x53625f(0x1c2)](_0x53625f(0x1d4),_0x53625f(0x1ef));let _0x59e6e6;if(_0x111761){const _0xaa151d=resolve(process[_0x53625f(0x1cf)](),_0x111761);if(!existsSync(_0xaa151d))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0xaa151d);_0x59e6e6=readFileSync(_0xaa151d,_0x53625f(0x1ca));}else _0x59e6e6=_0x3a601f;const _0x46c826=validateSql(_0x59e6e6),_0x26cb7e={'valid':_0x46c826[_0x53625f(0x1c4)],'sqlType':_0x46c826['sqlType'][_0x53625f(0x1c6)],'isSelectOnly':_0x46c826[_0x53625f(0x1f0)][_0x53625f(0x1e9)],'isDangerous':_0x46c826[_0x53625f(0x1f0)][_0x53625f(0x1cd)],'tables':_0x46c826[_0x53625f(0x1cb)],'parameters':_0x46c826[_0x53625f(0x1eb)],'message':_0x46c826[_0x53625f(0x1e1)]};_0x46c826['sqlType'][_0x53625f(0x1d1)]&&(_0x26cb7e[_0x53625f(0x1d1)]=_0x46c826[_0x53625f(0x1f0)][_0x53625f(0x1d1)]);const _0x5d3bef=_0x50e346[_0x53625f(0x1ed)](_0x53625f(0x1ce));if(_0x5d3bef&&_0x46c826[_0x53625f(0x1c4)]){const _0x5c8fdc=_0x5d3bef['split'](',')[_0x53625f(0x1e8)](_0x51727b=>_0x51727b[_0x53625f(0x1d5)]())['filter'](Boolean),_0x24178e=[],_0x6fdf78=filterDbTableBackedDatasets(await listDatasets(_0x50e346[_0x53625f(0x1d8)])),_0x4d132f=new Map(_0x6fdf78[_0x53625f(0x1e8)](_0x24f12e=>[_0x24f12e[_0x53625f(0x1e0)]?.['tableName']?.[_0x53625f(0x1ea)](),_0x24f12e]));for(const _0x3ba956 of _0x46c826[_0x53625f(0x1cb)]){const _0x3a30ba=_0x4d132f[_0x53625f(0x1c5)](_0x3ba956['toLowerCase']());!_0x3a30ba&&_0x24178e[_0x53625f(0x1c9)](_0x53625f(0x1dc)+_0x3ba956+_0x53625f(0x1ee));}for(const _0x2ab08f of _0x5c8fdc){let _0x12c5fc;try{_0x12c5fc=await getDatasetDetail(_0x2ab08f);}catch{_0x24178e[_0x53625f(0x1c9)]('Dataset\x20\x22'+_0x2ab08f+_0x53625f(0x1c1));continue;}assertDatasetIsDbTableBacked(_0x12c5fc,_0x53625f(0x1e3));const _0x35875e=Array[_0x53625f(0x1e2)](_0x12c5fc['fields'])?_0x12c5fc[_0x53625f(0x1e7)]:[],_0x13c101=new Set(_0x35875e[_0x53625f(0x1e8)](_0x2f7c0c=>_0x2f7c0c[_0x53625f(0x1d6)]?.[_0x53625f(0x1ea)]())),_0x9296e=_0x12c5fc[_0x53625f(0x1e0)]?.['tableName']||_0x12c5fc[_0x53625f(0x1c0)]||_0x2ab08f;_0x26cb7e[_0x53625f(0x1e4)+_0x9296e]={'code':_0x2ab08f,'tableName':_0x9296e,'fieldCount':_0x13c101[_0x53625f(0x1d0)],'fields':Array[_0x53625f(0x1df)](_0x13c101)};}_0x24178e[_0x53625f(0x1bf)]>0x0&&(_0x26cb7e[_0x53625f(0x1d9)]=_0x24178e);}return{'ok':_0x46c826['valid'],'data':_0x26cb7e,'message':_0x46c826['message']};}};
1
+ const a132_0x41bc94=a132_0x4bce;(function(_0x14dc42,_0x4c76bb){const _0x3f8c08=a132_0x4bce,_0x223ef6=_0x14dc42();while(!![]){try{const _0x176908=-parseInt(_0x3f8c08(0x1e6))/0x1*(-parseInt(_0x3f8c08(0x1fd))/0x2)+-parseInt(_0x3f8c08(0x1ea))/0x3+-parseInt(_0x3f8c08(0x210))/0x4*(-parseInt(_0x3f8c08(0x1f0))/0x5)+-parseInt(_0x3f8c08(0x1e4))/0x6*(parseInt(_0x3f8c08(0x20b))/0x7)+-parseInt(_0x3f8c08(0x203))/0x8+-parseInt(_0x3f8c08(0x1f2))/0x9+-parseInt(_0x3f8c08(0x1ed))/0xa*(-parseInt(_0x3f8c08(0x1e3))/0xb);if(_0x176908===_0x4c76bb)break;else _0x223ef6['push'](_0x223ef6['shift']());}catch(_0x30b250){_0x223ef6['push'](_0x223ef6['shift']());}}}(a132_0xe58b,0x4dfb6));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a132_0x4bce(_0x1c3aeb,_0x46b67a){_0x1c3aeb=_0x1c3aeb-0x1e1;const _0xe58b54=a132_0xe58b();let _0x4bce84=_0xe58b54[_0x1c3aeb];return _0x4bce84;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';function a132_0xe58b(){const _0x260ce4=['split','10pmdqjU','Table\x20\x22','utf-8','65ZXojVo','push','3738321ouHpFC','schema:','SQL\x20schema\x20validation','flagMissing','from','appCode','toLowerCase','name','trim','isArray','get','4nkCbGZ','tables','Provide\x20--file\x20or\x20--sql','reason','valid','fields','1255944RZNpLf','validate','sql','tableName','\x22\x20not\x20found\x20in\x20any\x20dataset','sqlType','File\x20not\x20found:\x20','\x22\x20not\x20found\x20or\x20not\x20accessible','1365rtlFWu','length','size','map','validation','13648bSDNTa','filter','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','dbtableConfig','message','file','14098447mVUABm','15144lMgqLZ','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','253382wpBaEV','read','str','type','1346523QIvlYe','schemas'];a132_0xe58b=function(){return _0x260ce4;};return a132_0xe58b();}export const sqlValidate={'service':'sql','command':a132_0x41bc94(0x204),'description':a132_0x41bc94(0x1e5),'risk':a132_0x41bc94(0x1e7),'flags':[{'name':a132_0x41bc94(0x1e2),'type':'string','description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':'sql','type':'string','description':a132_0x41bc94(0x212)},{'name':a132_0x41bc94(0x1eb),'type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x37f273){const _0x2095cc=a132_0x41bc94,_0x2ccd18=_0x37f273[_0x2095cc(0x1e8)]('file'),_0x3e401f=_0x37f273[_0x2095cc(0x1e8)](_0x2095cc(0x205));if(!_0x2ccd18&&!_0x3e401f)throw CliErrors[_0x2095cc(0x1f5)](_0x2095cc(0x1e2),_0x2095cc(0x1ff));let _0x18987f;if(_0x2ccd18){const _0x41d610=resolve(process['cwd'](),_0x2ccd18);if(!existsSync(_0x41d610))throw CliErrors[_0x2095cc(0x20f)](_0x2095cc(0x209)+_0x41d610);_0x18987f=readFileSync(_0x41d610,_0x2095cc(0x1ef));}else _0x18987f=_0x3e401f;const _0x48d1e1=validateSql(_0x18987f),_0x223725={'valid':_0x48d1e1['valid'],'sqlType':_0x48d1e1[_0x2095cc(0x208)][_0x2095cc(0x1e9)],'isSelectOnly':_0x48d1e1[_0x2095cc(0x208)]['isSelectOnly'],'isDangerous':_0x48d1e1[_0x2095cc(0x208)]['isDangerous'],'tables':_0x48d1e1[_0x2095cc(0x1fe)],'parameters':_0x48d1e1['parameters'],'message':_0x48d1e1['message']};_0x48d1e1[_0x2095cc(0x208)]['reason']&&(_0x223725[_0x2095cc(0x200)]=_0x48d1e1['sqlType'][_0x2095cc(0x200)]);const _0x12b55d=_0x37f273['str']('schemas');if(_0x12b55d&&_0x48d1e1[_0x2095cc(0x201)]){const _0x5eba53=_0x12b55d[_0x2095cc(0x1ec)](',')['map'](_0x413c91=>_0x413c91[_0x2095cc(0x1fa)]())[_0x2095cc(0x211)](Boolean),_0x35f4a2=[],_0x452762=filterDbTableBackedDatasets(await listDatasets(_0x37f273[_0x2095cc(0x1f7)])),_0x5b0042=new Map(_0x452762['map'](_0x36ea9a=>[_0x36ea9a['dbtableConfig']?.[_0x2095cc(0x206)]?.[_0x2095cc(0x1f8)](),_0x36ea9a]));for(const _0x44686f of _0x48d1e1[_0x2095cc(0x1fe)]){const _0x5b60bf=_0x5b0042[_0x2095cc(0x1fc)](_0x44686f[_0x2095cc(0x1f8)]());!_0x5b60bf&&_0x35f4a2[_0x2095cc(0x1f1)](_0x2095cc(0x1ee)+_0x44686f+_0x2095cc(0x207));}for(const _0x2faec8 of _0x5eba53){let _0x50e188;try{_0x50e188=await getDatasetDetail(_0x2faec8);}catch{_0x35f4a2['push']('Dataset\x20\x22'+_0x2faec8+_0x2095cc(0x20a));continue;}assertDatasetIsDbTableBacked(_0x50e188,_0x2095cc(0x1f4));const _0x25cad7=Array[_0x2095cc(0x1fb)](_0x50e188[_0x2095cc(0x202)])?_0x50e188[_0x2095cc(0x202)]:[],_0x27ba7e=new Set(_0x25cad7[_0x2095cc(0x20e)](_0x32ce2d=>_0x32ce2d[_0x2095cc(0x1f9)]?.['toLowerCase']())),_0x4b00b1=_0x50e188[_0x2095cc(0x213)]?.[_0x2095cc(0x206)]||_0x50e188[_0x2095cc(0x206)]||_0x2faec8;_0x223725[_0x2095cc(0x1f3)+_0x4b00b1]={'code':_0x2faec8,'tableName':_0x4b00b1,'fieldCount':_0x27ba7e[_0x2095cc(0x20d)],'fields':Array[_0x2095cc(0x1f6)](_0x27ba7e)};}_0x35f4a2[_0x2095cc(0x20c)]>0x0&&(_0x223725['schemaWarnings']=_0x35f4a2);}return{'ok':_0x48d1e1[_0x2095cc(0x201)],'data':_0x223725,'message':_0x48d1e1[_0x2095cc(0x1e1)]};}};
@@ -1 +1 @@
1
- const a133_0x8eb7ce=a133_0x34dd;(function(_0x38220c,_0x3aa59e){const _0x179cde=a133_0x34dd,_0x1af450=_0x38220c();while(!![]){try{const _0x3aa820=parseInt(_0x179cde(0x100))/0x1+-parseInt(_0x179cde(0x102))/0x2*(parseInt(_0x179cde(0xeb))/0x3)+-parseInt(_0x179cde(0xf8))/0x4*(-parseInt(_0x179cde(0xfe))/0x5)+parseInt(_0x179cde(0x107))/0x6*(-parseInt(_0x179cde(0xef))/0x7)+-parseInt(_0x179cde(0xfc))/0x8+parseInt(_0x179cde(0xe3))/0x9+parseInt(_0x179cde(0xe6))/0xa;if(_0x3aa820===_0x3aa59e)break;else _0x1af450['push'](_0x1af450['shift']());}catch(_0x54a6b0){_0x1af450['push'](_0x1af450['shift']());}}}(a133_0x2476,0x29c85));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';function a133_0x34dd(_0x7fdb04,_0x328fc4){_0x7fdb04=_0x7fdb04-0xe2;const _0x247672=a133_0x2476();let _0x34ddaf=_0x247672[_0x7fdb04];return _0x34ddaf;}import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a133_0x8eb7ce(0x106),a133_0x8eb7ce(0xee),a133_0x8eb7ce(0x103),a133_0x8eb7ce(0xf2),'riskLevel'];export const TOP_LEVEL_CONFIG_KEYS=new Set([a133_0x8eb7ce(0x105),a133_0x8eb7ce(0xf6),a133_0x8eb7ce(0x103),a133_0x8eb7ce(0xf2),'cookie',a133_0x8eb7ce(0xee),a133_0x8eb7ce(0xff)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x47365c){return[..._0x47365c]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x2b7609){return TOP_LEVEL_CONFIG_KEYS['has'](_0x2b7609);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x353258=a133_0x8eb7ce;return _0x353258(0xe4)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':'env','apiDir':a133_0x8eb7ce(0xff),'cookie':'cookie','accessKey':a133_0x8eb7ce(0xee),'defaultFormat':'format','pageSize':'pageSize','riskLevel':a133_0x8eb7ce(0x101),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x6c49cd=a133_0x8eb7ce;return[{'name':_0x6c49cd(0xf6),'type':_0x6c49cd(0xe8),'description':_0x6c49cd(0xfd),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x6c49cd(0xff),'type':_0x6c49cd(0xe8),'description':_0x6c49cd(0x108)},{'name':_0x6c49cd(0x106),'type':_0x6c49cd(0xe8),'description':_0x6c49cd(0xe7),'hidden':!![]},{'name':_0x6c49cd(0xee),'type':'string','description':_0x6c49cd(0xf9),'hidden':!![]},{'name':'defaultFormat','type':_0x6c49cd(0xe8),'description':'Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x6c49cd(0xe5),'type':'number','description':_0x6c49cd(0xf1)},{'name':_0x6c49cd(0x101),'type':_0x6c49cd(0xe8),'description':_0x6c49cd(0xed),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x6c49cd(0x103),'type':'string','description':_0x6c49cd(0x104)}];}export function collectAppProfileOverrides(_0x3d4789){const _0x58690e=a133_0x8eb7ce,_0x3054a8={};for(const [_0x1eba80,_0x5d5c53]of Object[_0x58690e(0xf4)](APP_PROFILE_FLAG_KEY_MAP)){const _0x50353d=_0x3d4789(_0x1eba80);if(!_0x50353d)continue;_0x3054a8[_0x5d5c53]=_0x5d5c53===_0x58690e(0xe5)?Number(_0x50353d):_0x50353d;}return _0x3054a8;}export function buildAppProfileListFields(_0x5190f1){const _0x1f235f=a133_0x8eb7ce;return{'env':_0x5190f1[_0x1f235f(0xf6)]??null,'apiDir':_0x5190f1[_0x1f235f(0xff)]??null,'hasCookie':!!_0x5190f1[_0x1f235f(0x106)],'hasAccessKey':!!_0x5190f1['accessKey'],'format':_0x5190f1['format']??null,'pageSize':_0x5190f1[_0x1f235f(0xe5)]??null,'riskLevel':_0x5190f1['riskLevel']??null,'locale':_0x5190f1['locale']??null};}export function buildAppDoctorFields(_0x399a87,_0x189e09){const _0x9b26c3=a133_0x8eb7ce;return{'env':{'value':_0x399a87[_0x9b26c3(0xf6)]||_0x189e09['env'],'source':_0x399a87[_0x9b26c3(0xf6)]?_0x9b26c3(0xfb):'inherit'},'apiDir':{'value':_0x399a87[_0x9b26c3(0xff)]||_0x189e09[_0x9b26c3(0xff)],'source':_0x399a87[_0x9b26c3(0xff)]?_0x9b26c3(0xfb):_0x9b26c3(0xf5)},'cookie':{'value':_0x399a87[_0x9b26c3(0x106)]||_0x189e09[_0x9b26c3(0x106)],'source':_0x399a87[_0x9b26c3(0x106)]?'app':_0x9b26c3(0xf5)},'accessKey':{'value':_0x399a87[_0x9b26c3(0xee)]||_0x189e09[_0x9b26c3(0xee)],'source':_0x399a87['accessKey']?'app':_0x9b26c3(0xf5)}};}function a133_0x2476(){const _0x294362=['entries','inherit','env','length','48084xviRCz','Access\x20key','filter','app','2344640KlpyiO','Target\x20environment','5kQfskT','apiDir','37232ICtecS','riskLevel','2UoFpRY','locale','Locale','appcode','cookie','513126CrJlFV','API\x20directory\x20path','apps','1448910VXOrQo','Config\x20key\x20(','pageSize','8213810YOejHy','Auth\x20cookie','string','zh-CN','keys','675957ZEonqo','defaultApp','Risk\x20level','accessKey','28IbNNUY','map','Default\x20page\x20size','format','en-US'];a133_0x2476=function(){return _0x294362;};return a133_0x2476();}export function buildCanonicalAppConfig(_0x12ed8d,_0x4f9d4f){const _0x47c8a4=a133_0x8eb7ce,_0x475512=_0x12ed8d[_0x47c8a4(0xf0)](_0x1c7e50=>String(_0x1c7e50||'')['trim']())[_0x47c8a4(0xfa)](Boolean);if(_0x475512[_0x47c8a4(0xf7)]===0x0)return{};const _0x207ce1={};for(const _0x58aee6 of _0x475512){_0x207ce1[_0x58aee6]=_0x4f9d4f?{'appcode':_0x58aee6,'env':_0x4f9d4f}:{'appcode':_0x58aee6};}return{'apps':_0x207ce1,'defaultApp':_0x475512[0x0]};}export function buildCanonicalProjectConfig(_0x498bc0,_0x42f737){const _0x113068=a133_0x8eb7ce,{appCodes:appCodes=[],env:_0x4ba1c4,metadata:_0x5d58fb}=_0x42f737,_0xb8fa3e={..._0x498bc0,..._0x5d58fb||{}};delete _0xb8fa3e[_0x113068(0x105)],delete _0xb8fa3e['app'];if(_0x4ba1c4)_0xb8fa3e[_0x113068(0xf6)]=_0x4ba1c4;else!_0xb8fa3e[_0x113068(0xf6)]&&(_0xb8fa3e[_0x113068(0xf6)]=DEFAULT_CONFIG_VALUES[_0x113068(0xf6)]);const _0x52fe65=buildCanonicalAppConfig(appCodes,_0xb8fa3e[_0x113068(0xf6)]);return Object[_0x113068(0xea)](_0x52fe65)['length']>0x0&&(_0xb8fa3e[_0x113068(0xe2)]=_0x52fe65['apps'],_0xb8fa3e['defaultApp']=_0x52fe65[_0x113068(0xec)]),_0xb8fa3e;}const LOCALE_MAP={'zh':a133_0x8eb7ce(0xe9),'zh-cn':'zh-CN','zh_cn':a133_0x8eb7ce(0xe9),'en':a133_0x8eb7ce(0xf3),'en-us':a133_0x8eb7ce(0xf3),'en_us':a133_0x8eb7ce(0xf3)};export function normalizeLocale(_0x1c9d61){if(!_0x1c9d61)return null;return LOCALE_MAP[_0x1c9d61['toLowerCase']()]??null;}
1
+ const a133_0x15e34f=a133_0x3c83;(function(_0x2f0aad,_0x2194c){const _0x12c457=a133_0x3c83,_0x8413ab=_0x2f0aad();while(!![]){try{const _0x31293d=-parseInt(_0x12c457(0x1b9))/0x1*(-parseInt(_0x12c457(0x1b7))/0x2)+parseInt(_0x12c457(0x1ae))/0x3*(-parseInt(_0x12c457(0x1bc))/0x4)+-parseInt(_0x12c457(0x19a))/0x5*(-parseInt(_0x12c457(0x1a4))/0x6)+-parseInt(_0x12c457(0x1bf))/0x7+-parseInt(_0x12c457(0x1c4))/0x8*(-parseInt(_0x12c457(0x1bd))/0x9)+parseInt(_0x12c457(0x1aa))/0xa*(-parseInt(_0x12c457(0x1c0))/0xb)+-parseInt(_0x12c457(0x1c5))/0xc*(-parseInt(_0x12c457(0x1be))/0xd);if(_0x31293d===_0x2194c)break;else _0x8413ab['push'](_0x8413ab['shift']());}catch(_0x58be47){_0x8413ab['push'](_0x8413ab['shift']());}}}(a133_0x402e,0x42f71));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=['cookie','accessKey','locale','format','riskLevel'];export const TOP_LEVEL_CONFIG_KEYS=new Set([a133_0x15e34f(0x1ba),'env',a133_0x15e34f(0x1a2),a133_0x15e34f(0x1a8),a133_0x15e34f(0x1b5),a133_0x15e34f(0x1a5),a133_0x15e34f(0x1a3)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x12279a){const _0x4bf914=a133_0x15e34f;return[..._0x12279a][_0x4bf914(0x1ad)](',\x20');}function a133_0x3c83(_0x5bc5e7,_0x3b357a){_0x5bc5e7=_0x5bc5e7-0x199;const _0x402ea8=a133_0x402e();let _0x3c8389=_0x402ea8[_0x5bc5e7];return _0x3c8389;}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x5a54fa){const _0x1d1bf8=a133_0x15e34f;return TOP_LEVEL_CONFIG_KEYS[_0x1d1bf8(0x1b6)](_0x5a54fa);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x3f3f56=a133_0x15e34f;return _0x3f3f56(0x19f)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a133_0x15e34f(0x1ab),'apiDir':a133_0x15e34f(0x1a3),'cookie':a133_0x15e34f(0x1b5),'accessKey':a133_0x15e34f(0x1a5),'defaultFormat':a133_0x15e34f(0x1a8),'pageSize':a133_0x15e34f(0x1b1),'riskLevel':'riskLevel','locale':a133_0x15e34f(0x1a2)};export function getAppProfileFlagDefs(){const _0x3d9c50=a133_0x15e34f;return[{'name':'env','type':_0x3d9c50(0x1bb),'description':_0x3d9c50(0x19d),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':_0x3d9c50(0x1bb),'description':'API\x20directory\x20path'},{'name':_0x3d9c50(0x1b5),'type':_0x3d9c50(0x1bb),'description':'Auth\x20cookie','hidden':!![]},{'name':_0x3d9c50(0x1a5),'type':_0x3d9c50(0x1bb),'description':_0x3d9c50(0x19e),'hidden':!![]},{'name':_0x3d9c50(0x1a7),'type':'string','description':_0x3d9c50(0x1a9),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x3d9c50(0x199),'description':'Default\x20page\x20size'},{'name':_0x3d9c50(0x1b8),'type':_0x3d9c50(0x1bb),'description':_0x3d9c50(0x1c3),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':_0x3d9c50(0x1bb),'description':_0x3d9c50(0x19c)}];}export function collectAppProfileOverrides(_0x112386){const _0xdcc871=a133_0x15e34f,_0x56bfef={};for(const [_0x1aef55,_0x5ba305]of Object[_0xdcc871(0x1b2)](APP_PROFILE_FLAG_KEY_MAP)){const _0x1e7ab9=_0x112386(_0x1aef55);if(!_0x1e7ab9)continue;_0x56bfef[_0x5ba305]=_0x5ba305===_0xdcc871(0x1b1)?Number(_0x1e7ab9):_0x1e7ab9;}return _0x56bfef;}export function buildAppProfileListFields(_0x2d23ea){const _0x59b48d=a133_0x15e34f;return{'env':_0x2d23ea[_0x59b48d(0x1ab)]??null,'apiDir':_0x2d23ea['apiDir']??null,'hasCookie':!!_0x2d23ea[_0x59b48d(0x1b5)],'hasAccessKey':!!_0x2d23ea[_0x59b48d(0x1a5)],'format':_0x2d23ea['format']??null,'pageSize':_0x2d23ea[_0x59b48d(0x1b1)]??null,'riskLevel':_0x2d23ea[_0x59b48d(0x1b8)]??null,'locale':_0x2d23ea[_0x59b48d(0x1a2)]??null};}export function buildAppDoctorFields(_0x5e766c,_0x4866cc){const _0x598aa1=a133_0x15e34f;return{'env':{'value':_0x5e766c[_0x598aa1(0x1ab)]||_0x4866cc[_0x598aa1(0x1ab)],'source':_0x5e766c['env']?_0x598aa1(0x1c1):'inherit'},'apiDir':{'value':_0x5e766c[_0x598aa1(0x1a3)]||_0x4866cc[_0x598aa1(0x1a3)],'source':_0x5e766c['apiDir']?_0x598aa1(0x1c1):_0x598aa1(0x1af)},'cookie':{'value':_0x5e766c['cookie']||_0x4866cc['cookie'],'source':_0x5e766c[_0x598aa1(0x1b5)]?_0x598aa1(0x1c1):'inherit'},'accessKey':{'value':_0x5e766c[_0x598aa1(0x1a5)]||_0x4866cc['accessKey'],'source':_0x5e766c[_0x598aa1(0x1a5)]?_0x598aa1(0x1c1):_0x598aa1(0x1af)}};}export function buildCanonicalAppConfig(_0x5eb711,_0x2c557f){const _0x59f6b6=a133_0x15e34f,_0x1013a7=_0x5eb711[_0x59f6b6(0x1a0)](_0x141523=>String(_0x141523||'')['trim']())[_0x59f6b6(0x1b3)](Boolean);if(_0x1013a7[_0x59f6b6(0x1b4)]===0x0)return{};const _0x51aee0={};for(const _0x682b44 of _0x1013a7){_0x51aee0[_0x682b44]=_0x2c557f?{'appcode':_0x682b44,'env':_0x2c557f}:{'appcode':_0x682b44};}return{'apps':_0x51aee0,'defaultApp':_0x1013a7[0x0]};}export function buildCanonicalProjectConfig(_0x36448e,_0x53c5a2){const _0x2e5b16=a133_0x15e34f,{appCodes:appCodes=[],env:_0x3d4e73,metadata:_0x1a99e0}=_0x53c5a2,_0x30115c={..._0x36448e,..._0x1a99e0||{}};delete _0x30115c['appcode'],delete _0x30115c[_0x2e5b16(0x1c1)];if(_0x3d4e73)_0x30115c['env']=_0x3d4e73;else!_0x30115c['env']&&(_0x30115c[_0x2e5b16(0x1ab)]=DEFAULT_CONFIG_VALUES[_0x2e5b16(0x1ab)]);const _0x390ba8=buildCanonicalAppConfig(appCodes,_0x30115c['env']);return Object[_0x2e5b16(0x1ac)](_0x390ba8)['length']>0x0&&(_0x30115c[_0x2e5b16(0x19b)]=_0x390ba8[_0x2e5b16(0x19b)],_0x30115c[_0x2e5b16(0x1c2)]=_0x390ba8[_0x2e5b16(0x1c2)]),_0x30115c;}function a133_0x402e(){const _0x38d522=['filter','length','cookie','has','187604QsjSnq','riskLevel','2FuBDfk','appcode','string','355648keznRG','156771XEfOUA','13uChxxJ','1666770nqZXxJ','3174292MNGgJT','app','defaultApp','Risk\x20level','88ORrJpt','6091812JzufrE','number','15095GOkeZq','apps','Locale','Target\x20environment','Access\x20key','Config\x20key\x20(','map','toLowerCase','locale','apiDir','6aPfTdR','accessKey','en-US','defaultFormat','format','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','10PVxMyS','env','keys','join','3FqnGXP','inherit','zh-CN','pageSize','entries'];a133_0x402e=function(){return _0x38d522;};return a133_0x402e();}const LOCALE_MAP={'zh':a133_0x15e34f(0x1b0),'zh-cn':a133_0x15e34f(0x1b0),'zh_cn':'zh-CN','en':a133_0x15e34f(0x1a6),'en-us':a133_0x15e34f(0x1a6),'en_us':a133_0x15e34f(0x1a6)};export function normalizeLocale(_0x361413){const _0x340f19=a133_0x15e34f;if(!_0x361413)return null;return LOCALE_MAP[_0x361413[_0x340f19(0x1a1)]()]??null;}
@@ -1 +1 @@
1
- function a134_0x2dc4(_0x48eb35,_0x475780){_0x48eb35=_0x48eb35-0xa3;const _0x312f42=a134_0x312f();let _0x2dc4a4=_0x312f42[_0x48eb35];return _0x2dc4a4;}function a134_0x312f(){const _0x52476b=['2810ictZZm','76268IjYsiC','227435acjMwN','1580208lOeTwr','615450vpLFYV','749favgwb','1206xIdAqf','198snWNIK','9284VHQlKu','4taxOOR','5859VFCNOH','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json'];a134_0x312f=function(){return _0x52476b;};return a134_0x312f();}const a134_0xe4f932=a134_0x2dc4;(function(_0x5c1677,_0xf2d397){const _0x22b47e=a134_0x2dc4,_0x381d81=_0x5c1677();while(!![]){try{const _0x4858ad=parseInt(_0x22b47e(0xa3))/0x1+-parseInt(_0x22b47e(0xaa))/0x2*(parseInt(_0x22b47e(0xa9))/0x3)+-parseInt(_0x22b47e(0xab))/0x4*(-parseInt(_0x22b47e(0xa4))/0x5)+-parseInt(_0x22b47e(0xa8))/0x6*(parseInt(_0x22b47e(0xa7))/0x7)+parseInt(_0x22b47e(0xa5))/0x8+-parseInt(_0x22b47e(0xac))/0x9*(-parseInt(_0x22b47e(0xae))/0xa)+parseInt(_0x22b47e(0xa6))/0xb;if(_0x4858ad===_0xf2d397)break;else _0x381d81['push'](_0x381d81['shift']());}catch(_0x46189d){_0x381d81['push'](_0x381d81['shift']());}}}(a134_0x312f,0x3838b));export const CLI_VERSION_POLICY_URL=a134_0xe4f932(0xad);
1
+ function a134_0x2b80(_0x51832b,_0x11ef30){_0x51832b=_0x51832b-0x15a;const _0x1dd06b=a134_0x1dd0();let _0x2b8018=_0x1dd06b[_0x51832b];return _0x2b8018;}function a134_0x1dd0(){const _0x552fdc=['3095128qpIZKx','6831081qmuXaV','10Obeqrr','1BNFrBP','2840319qtIxza','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','6CJoser','2938184eZfkjE','2875980fgSqAZ','16lbiRem','11582417VsMFds','3563707OwhYrR'];a134_0x1dd0=function(){return _0x552fdc;};return a134_0x1dd0();}const a134_0x19f2e7=a134_0x2b80;(function(_0x4ea6d1,_0x40e160){const _0x1b11e4=a134_0x2b80,_0x59f103=_0x4ea6d1();while(!![]){try{const _0x57657a=parseInt(_0x1b11e4(0x165))/0x1*(parseInt(_0x1b11e4(0x15d))/0x2)+-parseInt(_0x1b11e4(0x15a))/0x3+parseInt(_0x1b11e4(0x162))/0x4*(parseInt(_0x1b11e4(0x164))/0x5)+-parseInt(_0x1b11e4(0x15c))/0x6*(parseInt(_0x1b11e4(0x161))/0x7)+-parseInt(_0x1b11e4(0x15f))/0x8*(parseInt(_0x1b11e4(0x163))/0x9)+-parseInt(_0x1b11e4(0x15e))/0xa+parseInt(_0x1b11e4(0x160))/0xb;if(_0x57657a===_0x40e160)break;else _0x59f103['push'](_0x59f103['shift']());}catch(_0x14d3cb){_0x59f103['push'](_0x59f103['shift']());}}}(a134_0x1dd0,0xc54b1));export const CLI_VERSION_POLICY_URL=a134_0x19f2e7(0x15b);
@@ -1 +1 @@
1
- const a135_0x441fea=a135_0x1a84;(function(_0x46dd7e,_0x2069c3){const _0x4fbbdf=a135_0x1a84,_0x58b3ab=_0x46dd7e();while(!![]){try{const _0x28e670=-parseInt(_0x4fbbdf(0x201))/0x1+-parseInt(_0x4fbbdf(0x1e3))/0x2+-parseInt(_0x4fbbdf(0x1e1))/0x3+-parseInt(_0x4fbbdf(0x21a))/0x4+-parseInt(_0x4fbbdf(0x1ed))/0x5*(-parseInt(_0x4fbbdf(0x222))/0x6)+parseInt(_0x4fbbdf(0x205))/0x7+-parseInt(_0x4fbbdf(0x217))/0x8*(-parseInt(_0x4fbbdf(0x21f))/0x9);if(_0x28e670===_0x2069c3)break;else _0x58b3ab['push'](_0x58b3ab['shift']());}catch(_0x340f18){_0x58b3ab['push'](_0x58b3ab['shift']());}}}(a135_0x5acd,0xcdf43));export const CLI_BIN_NAME=a135_0x441fea(0x21e);function a135_0x1a84(_0x43d364,_0x37fd79){_0x43d364=_0x43d364-0x1c5;const _0x5acd98=a135_0x5acd();let _0x1a8496=_0x5acd98[_0x43d364];return _0x1a8496;}export const CLI_DISPLAY_NAME=a135_0x441fea(0x1cf);export const NPM_PACKAGE_NAME=a135_0x441fea(0x214);export const GLOBAL_FLAGS=[{'name':a135_0x441fea(0x202),'meowKey':a135_0x441fea(0x202),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x1fd),'hint':a135_0x441fea(0x1d4)},{'name':'app','meowKey':a135_0x441fea(0x1e8),'type':'string','description':'Select\x20app\x20profile\x20by\x20name','hint':'<name>'},{'name':'env','meowKey':a135_0x441fea(0x225),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x224),'hint':'production\x20|\x20daily'},{'name':a135_0x441fea(0x1fe),'meowKey':a135_0x441fea(0x1fe),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x1ce),'hint':a135_0x441fea(0x1e5)},{'name':'jq','meowKey':'jq','type':a135_0x441fea(0x1e9),'description':'Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','hint':a135_0x441fea(0x20b)},{'name':a135_0x441fea(0x200),'meowKey':a135_0x441fea(0x215),'type':a135_0x441fea(0x208),'description':a135_0x441fea(0x1f2)},{'name':a135_0x441fea(0x1da),'meowKey':a135_0x441fea(0x1da),'type':a135_0x441fea(0x208),'description':a135_0x441fea(0x216)},{'name':a135_0x441fea(0x204),'meowKey':'nonInteractive','type':a135_0x441fea(0x208),'description':a135_0x441fea(0x1d7)},{'name':'global','meowKey':a135_0x441fea(0x20c),'type':'boolean','description':'Use\x20global\x20config\x20scope'},{'name':a135_0x441fea(0x212),'meowKey':a135_0x441fea(0x212),'type':a135_0x441fea(0x208),'description':a135_0x441fea(0x1fa)},{'name':'ci','meowKey':'ci','type':'boolean','description':a135_0x441fea(0x21c),'hidden':!![]},{'name':a135_0x441fea(0x1eb),'meowKey':a135_0x441fea(0x1eb),'type':'boolean','description':a135_0x441fea(0x1f4)},{'name':'name','meowKey':a135_0x441fea(0x1f1),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x1f5),'hidden':!![]},{'name':a135_0x441fea(0x1ee),'meowKey':a135_0x441fea(0x1ee),'type':a135_0x441fea(0x1e9),'description':'Title','hidden':!![]},{'name':a135_0x441fea(0x1f0),'meowKey':a135_0x441fea(0x1f0),'type':'boolean','description':'Clear','hidden':!![]},{'name':'watch','meowKey':a135_0x441fea(0x1df),'type':'boolean','description':'Watch\x20mode','hidden':!![]},{'name':'output','meowKey':a135_0x441fea(0x1d3),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x223),'hidden':!![]},{'name':a135_0x441fea(0x21d),'meowKey':'params','type':a135_0x441fea(0x1e9),'description':'JSON\x20params','hidden':!![]},{'name':'datasetcode','meowKey':'datasetcode','type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x1e6),'hidden':!![]},{'name':a135_0x441fea(0x1cd),'meowKey':a135_0x441fea(0x1cd),'type':a135_0x441fea(0x208),'description':'Apply\x20to\x20all','hidden':!![]},{'name':'enable-bff-save','meowKey':a135_0x441fea(0x20e),'type':'boolean','description':a135_0x441fea(0x20f),'hidden':!![]},{'name':'id','meowKey':'id','type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x1fc),'hidden':!![]},{'name':a135_0x441fea(0x203),'meowKey':a135_0x441fea(0x203),'type':'string','description':a135_0x441fea(0x1e4),'hidden':!![]},{'name':'file','meowKey':a135_0x441fea(0x1d5),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x1dd),'hidden':!![]},{'name':a135_0x441fea(0x207),'meowKey':a135_0x441fea(0x207),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x1d0),'hidden':!![]},{'name':a135_0x441fea(0x20d),'meowKey':'sqlName','type':a135_0x441fea(0x1e9),'description':'SQL\x20name','hidden':!![]},{'name':'sqlname','meowKey':a135_0x441fea(0x1cb),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x1c9),'hidden':!![]},{'name':a135_0x441fea(0x1db),'meowKey':'dbId','type':'string','description':'DB\x20ID','hidden':!![]},{'name':a135_0x441fea(0x1c6),'meowKey':'dbid','type':a135_0x441fea(0x1e9),'description':'DB\x20ID','hidden':!![]},{'name':a135_0x441fea(0x210),'meowKey':a135_0x441fea(0x210),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x1d2),'hidden':!![]},{'name':'description-file','meowKey':a135_0x441fea(0x1e2),'type':a135_0x441fea(0x1e9),'description':'Description\x20file','hidden':!![]},{'name':a135_0x441fea(0x1ea),'meowKey':a135_0x441fea(0x1ea),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x221),'hidden':!![]},{'name':a135_0x441fea(0x1d6),'meowKey':a135_0x441fea(0x1d6),'type':a135_0x441fea(0x1e9),'description':'Page\x20size','hidden':!![]},{'name':a135_0x441fea(0x1f8),'meowKey':a135_0x441fea(0x1f8),'type':'string','description':a135_0x441fea(0x21b),'hidden':!![]},{'name':a135_0x441fea(0x1d1),'meowKey':'code','type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x1c8),'hidden':!![]},{'name':a135_0x441fea(0x1de),'meowKey':a135_0x441fea(0x1de),'type':'string','description':'SQL\x20string','hidden':!![]},{'name':a135_0x441fea(0x1e7),'meowKey':a135_0x441fea(0x1e7),'type':a135_0x441fea(0x1e9),'description':'Schemas','hidden':!![]},{'name':a135_0x441fea(0x1fb),'meowKey':a135_0x441fea(0x1fb),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x1c5),'hidden':!![]},{'name':'target','meowKey':a135_0x441fea(0x1d9),'type':'string','description':a135_0x441fea(0x1dc),'hidden':!![]},{'name':a135_0x441fea(0x1ca),'meowKey':a135_0x441fea(0x1c7),'type':a135_0x441fea(0x208),'description':a135_0x441fea(0x1d8),'hidden':!![]},{'name':a135_0x441fea(0x219),'meowKey':a135_0x441fea(0x219),'type':a135_0x441fea(0x1e9),'description':'Config\x20key','hidden':!![]},{'name':a135_0x441fea(0x211),'meowKey':a135_0x441fea(0x211),'type':a135_0x441fea(0x1e9),'description':'Config\x20value','hidden':!![]},{'name':a135_0x441fea(0x220),'meowKey':a135_0x441fea(0x220),'type':a135_0x441fea(0x208),'description':a135_0x441fea(0x1f9),'hidden':!![]},{'name':a135_0x441fea(0x20a),'meowKey':'confirm','type':a135_0x441fea(0x208),'description':a135_0x441fea(0x213),'hidden':!![]},{'name':a135_0x441fea(0x206),'meowKey':a135_0x441fea(0x206),'type':a135_0x441fea(0x208),'description':a135_0x441fea(0x1f3),'hidden':!![]},{'name':a135_0x441fea(0x218),'meowKey':a135_0x441fea(0x218),'type':a135_0x441fea(0x208),'description':'Verbose\x20output','hidden':!![]},{'name':a135_0x441fea(0x1f6),'meowKey':a135_0x441fea(0x1ef),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x209),'hidden':!![]},{'name':a135_0x441fea(0x1ff),'meowKey':a135_0x441fea(0x1cc),'type':a135_0x441fea(0x1e9),'description':a135_0x441fea(0x1c5),'hidden':!![]},{'name':a135_0x441fea(0x1f7),'meowKey':'functionNode','type':'string','description':'Function\x20node','hidden':!![]}];function a135_0x5acd(){const _0x52e3d4=['output','<code>','file','pagesize','Force\x20non-interactive\x20mode\x20(CI)','Skip\x20import\x20generation','target','yes','db-id','Target\x20path','File\x20path','sql','watch','meowKey','2429604bPGcVv','descriptionFile','863710rVMyll','Type\x20filter','json\x20|\x20pretty\x20|\x20compress','Dataset\x20code','schemas','app','string','page','help','map','1386985pMzCKu','title','expectedCount','clear','name','Preview\x20operation\x20without\x20executing','Use\x20remote','Show\x20help','Name','expected-count','function-node','keyword','Force\x20overwrite','Use\x20project\x20config\x20scope','operation','Record\x20ID','Override\x20appcode','format','operation-type','dry-run','1446445etpjCZ','appcode','type','non-interactive','6960807fIENkA','remote','sqlcode','boolean','Expected\x20affected\x20count','confirm','<expr>','global','sql-name','enableBffSave','Enable\x20BFF\x20save','description','value','project','Confirm\x20destructive\x20action','@lovrabet/rabetbase-cli','dryRun','Skip\x20confirmation\x20for\x20high-risk\x20writes','23458992YesojB','verbose','key','3799256OAfDvw','Keyword\x20filter','Alias\x20for\x20--non-interactive','params','rabetbase','9KBhzTJ','force','Page\x20number','12wbmInQ','Output\x20path','Environment','env','fromEntries','Operation\x20type','dbid','skipImports','Code\x20filter','SQL\x20name','skip-imports','sqlname','operationType','all','Output\x20format','Rabetbase\x20CLI','SQL\x20code','code','Description'];a135_0x5acd=function(){return _0x52e3d4;};return a135_0x5acd();}export const PIPELINE_FLAG_NAMES=new Set(['appcode','app',a135_0x441fea(0x225),a135_0x441fea(0x1fe),'jq',a135_0x441fea(0x200),a135_0x441fea(0x1da),a135_0x441fea(0x204),'ci']);export function buildMeowFlags(){const _0x2e1d7c=a135_0x441fea;return Object[_0x2e1d7c(0x226)](GLOBAL_FLAGS[_0x2e1d7c(0x1ec)](_0x14f4aa=>[_0x14f4aa[_0x2e1d7c(0x1e0)],{'type':_0x14f4aa[_0x2e1d7c(0x203)]}]));}
1
+ const a135_0x254817=a135_0x3ad3;(function(_0x343391,_0x21c514){const _0x4e1c27=a135_0x3ad3,_0x22775d=_0x343391();while(!![]){try{const _0x5a802b=parseInt(_0x4e1c27(0xc6))/0x1+-parseInt(_0x4e1c27(0xf9))/0x2*(-parseInt(_0x4e1c27(0xcb))/0x3)+parseInt(_0x4e1c27(0xa4))/0x4*(parseInt(_0x4e1c27(0xf6))/0x5)+-parseInt(_0x4e1c27(0x9f))/0x6*(parseInt(_0x4e1c27(0xc7))/0x7)+parseInt(_0x4e1c27(0xf3))/0x8+-parseInt(_0x4e1c27(0xa8))/0x9*(parseInt(_0x4e1c27(0xeb))/0xa)+parseInt(_0x4e1c27(0xc2))/0xb*(-parseInt(_0x4e1c27(0xc5))/0xc);if(_0x5a802b===_0x21c514)break;else _0x22775d['push'](_0x22775d['shift']());}catch(_0x1b1246){_0x22775d['push'](_0x22775d['shift']());}}}(a135_0x4a44,0x40ae4));export const CLI_BIN_NAME=a135_0x254817(0xa0);export const CLI_DISPLAY_NAME=a135_0x254817(0xc1);function a135_0x3ad3(_0x2401c2,_0x2273e1){_0x2401c2=_0x2401c2-0x93;const _0x4a440a=a135_0x4a44();let _0x3ad350=_0x4a440a[_0x2401c2];return _0x3ad350;}export const NPM_PACKAGE_NAME=a135_0x254817(0x100);function a135_0x4a44(){const _0x5ceeee=['<name>','sqlName','Code\x20filter','Override\x20appcode','Preview\x20operation\x20without\x20executing','description','sql','descriptionFile','Expected\x20affected\x20count','project','schemas','Operation\x20type','Skip\x20import\x20generation','sql-name','Keyword\x20filter','Show\x20help','Alias\x20for\x20--non-interactive','File\x20path','production\x20|\x20daily','skip-imports','SQL\x20code','operation','Config\x20value','DB\x20ID','file','Force\x20non-interactive\x20mode\x20(CI)','4172950FiFtSZ','Environment','dryRun','Use\x20remote','env','db-id','function-node','app','2491424vVOyBx','key','yes','1717610LtWWBg','Output\x20format','Force\x20overwrite','10CmmyOE','global','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Clear','Schemas','sqlname','JSON\x20params','@lovrabet/rabetbase-cli','<expr>','Select\x20app\x20profile\x20by\x20name','Confirm\x20destructive\x20action','confirm','Use\x20project\x20config\x20scope','non-interactive','sqlcode','operation-type','boolean','force','expected-count','clear','dbid','22314TqhQQc','rabetbase','Title','Description\x20file','output','4qkKcMt','string','fromEntries','code','9PZknQJ','Output\x20path','watch','help','Apply\x20to\x20all','SQL\x20string','params','keyword','expectedCount','functionNode','Page\x20size','target','enableBffSave','appcode','remote','Watch\x20mode','type','skipImports','nonInteractive','pagesize','page','<code>','verbose','Use\x20global\x20config\x20scope','Record\x20ID','Rabetbase\x20CLI','869VyoFPu','Enable\x20BFF\x20save','map','76152uHRwVn','188533sNclyk','21ActqRA','value','title','SQL\x20name','210741VfpqPY','Page\x20number','name','format','all','Name'];a135_0x4a44=function(){return _0x5ceeee;};return a135_0x4a44();}export const GLOBAL_FLAGS=[{'name':a135_0x254817(0xb5),'meowKey':a135_0x254817(0xb5),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xd4),'hint':a135_0x254817(0xbd)},{'name':a135_0x254817(0xf2),'meowKey':a135_0x254817(0xf2),'type':a135_0x254817(0xa5),'description':a135_0x254817(0x93),'hint':a135_0x254817(0xd1)},{'name':a135_0x254817(0xef),'meowKey':'env','type':a135_0x254817(0xa5),'description':a135_0x254817(0xec),'hint':a135_0x254817(0xe3)},{'name':a135_0x254817(0xce),'meowKey':'format','type':a135_0x254817(0xa5),'description':a135_0x254817(0xf7),'hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':a135_0x254817(0xa5),'description':a135_0x254817(0xfb),'hint':a135_0x254817(0x101)},{'name':'dry-run','meowKey':a135_0x254817(0xed),'type':'boolean','description':a135_0x254817(0xd5)},{'name':a135_0x254817(0xf5),'meowKey':'yes','type':a135_0x254817(0x9a),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a135_0x254817(0x97),'meowKey':a135_0x254817(0xba),'type':a135_0x254817(0x9a),'description':a135_0x254817(0xea)},{'name':a135_0x254817(0xfa),'meowKey':'global','type':'boolean','description':a135_0x254817(0xbf)},{'name':a135_0x254817(0xda),'meowKey':'project','type':a135_0x254817(0x9a),'description':a135_0x254817(0x96)},{'name':'ci','meowKey':'ci','type':a135_0x254817(0x9a),'description':a135_0x254817(0xe1),'hidden':!![]},{'name':'help','meowKey':a135_0x254817(0xab),'type':a135_0x254817(0x9a),'description':a135_0x254817(0xe0)},{'name':'name','meowKey':a135_0x254817(0xcd),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xd0),'hidden':!![]},{'name':'title','meowKey':a135_0x254817(0xc9),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xa1),'hidden':!![]},{'name':a135_0x254817(0x9d),'meowKey':a135_0x254817(0x9d),'type':a135_0x254817(0x9a),'description':a135_0x254817(0xfc),'hidden':!![]},{'name':a135_0x254817(0xaa),'meowKey':a135_0x254817(0xaa),'type':'boolean','description':a135_0x254817(0xb7),'hidden':!![]},{'name':a135_0x254817(0xa3),'meowKey':'output','type':a135_0x254817(0xa5),'description':a135_0x254817(0xa9),'hidden':!![]},{'name':a135_0x254817(0xae),'meowKey':a135_0x254817(0xae),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xff),'hidden':!![]},{'name':'datasetcode','meowKey':'datasetcode','type':a135_0x254817(0xa5),'description':'Dataset\x20code','hidden':!![]},{'name':a135_0x254817(0xcf),'meowKey':a135_0x254817(0xcf),'type':a135_0x254817(0x9a),'description':a135_0x254817(0xac),'hidden':!![]},{'name':'enable-bff-save','meowKey':a135_0x254817(0xb4),'type':a135_0x254817(0x9a),'description':a135_0x254817(0xc3),'hidden':!![]},{'name':'id','meowKey':'id','type':a135_0x254817(0xa5),'description':a135_0x254817(0xc0),'hidden':!![]},{'name':a135_0x254817(0xb8),'meowKey':'type','type':'string','description':'Type\x20filter','hidden':!![]},{'name':'file','meowKey':a135_0x254817(0xe9),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xe2),'hidden':!![]},{'name':a135_0x254817(0x98),'meowKey':'sqlcode','type':a135_0x254817(0xa5),'description':a135_0x254817(0xe5),'hidden':!![]},{'name':a135_0x254817(0xde),'meowKey':a135_0x254817(0xd2),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xca),'hidden':!![]},{'name':a135_0x254817(0xfe),'meowKey':a135_0x254817(0xfe),'type':a135_0x254817(0xa5),'description':'SQL\x20name','hidden':!![]},{'name':a135_0x254817(0xf0),'meowKey':'dbId','type':a135_0x254817(0xa5),'description':a135_0x254817(0xe8),'hidden':!![]},{'name':a135_0x254817(0x9e),'meowKey':a135_0x254817(0x9e),'type':a135_0x254817(0xa5),'description':'DB\x20ID','hidden':!![]},{'name':a135_0x254817(0xd6),'meowKey':a135_0x254817(0xd6),'type':a135_0x254817(0xa5),'description':'Description','hidden':!![]},{'name':'description-file','meowKey':a135_0x254817(0xd8),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xa2),'hidden':!![]},{'name':'page','meowKey':a135_0x254817(0xbc),'type':'string','description':a135_0x254817(0xcc),'hidden':!![]},{'name':a135_0x254817(0xbb),'meowKey':a135_0x254817(0xbb),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xb2),'hidden':!![]},{'name':'keyword','meowKey':a135_0x254817(0xaf),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xdf),'hidden':!![]},{'name':a135_0x254817(0xa7),'meowKey':a135_0x254817(0xa7),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xd3),'hidden':!![]},{'name':a135_0x254817(0xd7),'meowKey':a135_0x254817(0xd7),'type':'string','description':a135_0x254817(0xad),'hidden':!![]},{'name':a135_0x254817(0xdb),'meowKey':a135_0x254817(0xdb),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xfd),'hidden':!![]},{'name':'operation','meowKey':a135_0x254817(0xe6),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xdc),'hidden':!![]},{'name':a135_0x254817(0xb3),'meowKey':a135_0x254817(0xb3),'type':a135_0x254817(0xa5),'description':'Target\x20path','hidden':!![]},{'name':a135_0x254817(0xe4),'meowKey':a135_0x254817(0xb9),'type':'boolean','description':a135_0x254817(0xdd),'hidden':!![]},{'name':a135_0x254817(0xf4),'meowKey':a135_0x254817(0xf4),'type':a135_0x254817(0xa5),'description':'Config\x20key','hidden':!![]},{'name':a135_0x254817(0xc8),'meowKey':a135_0x254817(0xc8),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xe7),'hidden':!![]},{'name':a135_0x254817(0x9b),'meowKey':a135_0x254817(0x9b),'type':a135_0x254817(0x9a),'description':a135_0x254817(0xf8),'hidden':!![]},{'name':a135_0x254817(0x95),'meowKey':a135_0x254817(0x95),'type':'boolean','description':a135_0x254817(0x94),'hidden':!![]},{'name':a135_0x254817(0xb6),'meowKey':a135_0x254817(0xb6),'type':a135_0x254817(0x9a),'description':a135_0x254817(0xee),'hidden':!![]},{'name':'verbose','meowKey':a135_0x254817(0xbe),'type':a135_0x254817(0x9a),'description':'Verbose\x20output','hidden':!![]},{'name':a135_0x254817(0x9c),'meowKey':a135_0x254817(0xb0),'type':a135_0x254817(0xa5),'description':a135_0x254817(0xd9),'hidden':!![]},{'name':a135_0x254817(0x99),'meowKey':'operationType','type':a135_0x254817(0xa5),'description':a135_0x254817(0xdc),'hidden':!![]},{'name':a135_0x254817(0xf1),'meowKey':a135_0x254817(0xb1),'type':a135_0x254817(0xa5),'description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a135_0x254817(0xb5),'app',a135_0x254817(0xef),a135_0x254817(0xce),'jq','dry-run',a135_0x254817(0xf5),'non-interactive','ci']);export function buildMeowFlags(){const _0x25946c=a135_0x254817;return Object[_0x25946c(0xa6)](GLOBAL_FLAGS[_0x25946c(0xc4)](_0x24fc17=>[_0x24fc17['meowKey'],{'type':_0x24fc17[_0x25946c(0xb8)]}]));}
@@ -1 +1 @@
1
- const a136_0xea3603=a136_0x5128;function a136_0x3483(){const _0x3c08cb=['8152tAgNiH','high-risk-write','42TjTJtx','36510xLORYI','27FWTGni','4781830hSMNfS','production','904692nLObbF','compress','500877RVeino','88ASOAeP','23463PjeOXF','en-US','1sVUDhJ','372CVWTCG','1876474RoAgiC'];a136_0x3483=function(){return _0x3c08cb;};return a136_0x3483();}(function(_0x18439b,_0x1e72a5){const _0xb19841=a136_0x5128,_0x5c793d=_0x18439b();while(!![]){try{const _0x15d823=parseInt(_0xb19841(0xf5))/0x1*(-parseInt(_0xb19841(0xf7))/0x2)+parseInt(_0xb19841(0xf1))/0x3+parseInt(_0xb19841(0xf2))/0x4*(-parseInt(_0xb19841(0xfb))/0x5)+parseInt(_0xb19841(0xff))/0x6*(parseInt(_0xb19841(0xfa))/0x7)+parseInt(_0xb19841(0xf8))/0x8*(-parseInt(_0xb19841(0xfc))/0x9)+parseInt(_0xb19841(0xfd))/0xa+parseInt(_0xb19841(0xf3))/0xb*(parseInt(_0xb19841(0xf6))/0xc);if(_0x15d823===_0x1e72a5)break;else _0x5c793d['push'](_0x5c793d['shift']());}catch(_0x334a6e){_0x5c793d['push'](_0x5c793d['shift']());}}}(a136_0x3483,0x7d7e3));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a136_0xea3603(0xfe),'format':a136_0xea3603(0xf0),'locale':a136_0xea3603(0xf4),'riskLevel':a136_0xea3603(0xf9),'apiDir':DEFAULT_API_DIR};function a136_0x5128(_0x4666ab,_0x26b1ce){_0x4666ab=_0x4666ab-0xf0;const _0x34831f=a136_0x3483();let _0x5128c6=_0x34831f[_0x4666ab];return _0x5128c6;}export const DEFAULT_COMMAND_OUTPUT_FORMAT='compress';
1
+ function a136_0x358e(_0x2f87a3,_0x549581){_0x2f87a3=_0x2f87a3-0xfa;const _0x1b6085=a136_0x1b60();let _0x358e44=_0x1b6085[_0x2f87a3];return _0x358e44;}const a136_0xc2fe8d=a136_0x358e;(function(_0x5184d0,_0xbe4107){const _0x52912b=a136_0x358e,_0x3850e3=_0x5184d0();while(!![]){try{const _0x2a9595=parseInt(_0x52912b(0xfc))/0x1+-parseInt(_0x52912b(0xff))/0x2+-parseInt(_0x52912b(0xfd))/0x3+-parseInt(_0x52912b(0x102))/0x4+-parseInt(_0x52912b(0x101))/0x5+parseInt(_0x52912b(0xfa))/0x6*(parseInt(_0x52912b(0x100))/0x7)+parseInt(_0x52912b(0xfb))/0x8;if(_0x2a9595===_0xbe4107)break;else _0x3850e3['push'](_0x3850e3['shift']());}catch(_0x5f010b){_0x3850e3['push'](_0x3850e3['shift']());}}}(a136_0x1b60,0x9232d));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a136_0xc2fe8d(0xfe),'format':'compress','locale':a136_0xc2fe8d(0x104),'riskLevel':'high-risk-write','apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a136_0xc2fe8d(0x103);function a136_0x1b60(){const _0x3f36fb=['2283912RfOIeR','production','892966eEYKWq','427bYHkZu','5728150BwHJAI','2994652dvlsiC','compress','en-US','74238DZOWDj','16545632HzHHUd','877952utGyWh'];a136_0x1b60=function(){return _0x3f36fb;};return a136_0x1b60();}
@@ -1 +1 @@
1
- function a137_0x4a78(_0x5732b3,_0x1d16c4){_0x5732b3=_0x5732b3-0xb6;const _0x5aebe4=a137_0x5aeb();let _0x4a78f8=_0x5aebe4[_0x5732b3];return _0x4a78f8;}const a137_0x2c2e0c=a137_0x4a78;(function(_0x3cb9be,_0x42276f){const _0x262d5e=a137_0x4a78,_0x50c684=_0x3cb9be();while(!![]){try{const _0xda22ae=-parseInt(_0x262d5e(0xbf))/0x1+parseInt(_0x262d5e(0xc5))/0x2+-parseInt(_0x262d5e(0xb8))/0x3*(parseInt(_0x262d5e(0xc4))/0x4)+parseInt(_0x262d5e(0xba))/0x5+-parseInt(_0x262d5e(0xc3))/0x6+-parseInt(_0x262d5e(0xc1))/0x7+-parseInt(_0x262d5e(0xbb))/0x8*(-parseInt(_0x262d5e(0xbc))/0x9);if(_0xda22ae===_0x42276f)break;else _0x50c684['push'](_0x50c684['shift']());}catch(_0x2658fa){_0x50c684['push'](_0x50c684['shift']());}}}(a137_0x5aeb,0x2cff2));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x54df76){const _0x56261f=a137_0x4a78;customApiDomain=_0x54df76?.[_0x56261f(0xb7)],customUserDomain=_0x54df76?.[_0x56261f(0xb9)],customRuntimeDomain=_0x54df76?.['runtimeDomain'];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a137_0x2c2e0c(0xbd):a137_0x2c2e0c(0xc2));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a137_0x2c2e0c(0xbe):'https://daily-api.lovrabet.com');function a137_0x5aeb(){const _0x22e75a=['8aMdKfF','7118568vVrxLa','https://user.lovrabet.com','https://api.lovrabet.com','278007QxsKHI','https://daily-runtime.lovrabet.com','963326UCcGmL','https://user-daily.lovrabet.com','1692654MWWpzD','39948sFWOBH','652044HSzojg','https://runtime.lovrabet.com','apiDomain','75xSgZxP','userDomain','73705bBFmdc'];a137_0x5aeb=function(){return _0x22e75a;};return a137_0x5aeb();}export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a137_0x2c2e0c(0xb6):a137_0x2c2e0c(0xc0));
1
+ const a137_0x47b20a=a137_0x1dd5;function a137_0x5c2d(){const _0x34fd84=['657LLJSkf','12AEISyL','https://runtime.lovrabet.com','https://user.lovrabet.com','48xBLQbW','238470ZnJPtL','11612jEcjey','26990DjjFKB','931392iBjCdw','14052LtPPfY','10JrKcAj','https://user-daily.lovrabet.com','userDomain','833532qGPmGU','503986XZtxBa','https://api.lovrabet.com','902hnZjem','https://daily-api.lovrabet.com','https://daily-runtime.lovrabet.com'];a137_0x5c2d=function(){return _0x34fd84;};return a137_0x5c2d();}function a137_0x1dd5(_0x4c438b,_0x30f77a){_0x4c438b=_0x4c438b-0x1e0;const _0x5c2d1f=a137_0x5c2d();let _0x1dd504=_0x5c2d1f[_0x4c438b];return _0x1dd504;}(function(_0x4c3c96,_0x1363ef){const _0x1732b9=a137_0x1dd5,_0x4612a9=_0x4c3c96();while(!![]){try{const _0x41ca3e=parseInt(_0x1732b9(0x1ee))/0x1+parseInt(_0x1732b9(0x1ef))/0x2*(-parseInt(_0x1732b9(0x1ed))/0x3)+parseInt(_0x1732b9(0x1e3))/0x4*(parseInt(_0x1732b9(0x1e0))/0x5)+parseInt(_0x1732b9(0x1ea))/0x6*(-parseInt(_0x1732b9(0x1e4))/0x7)+-parseInt(_0x1732b9(0x1f1))/0x8+-parseInt(_0x1732b9(0x1e9))/0x9*(-parseInt(_0x1732b9(0x1f0))/0xa)+-parseInt(_0x1732b9(0x1e6))/0xb*(parseInt(_0x1732b9(0x1f2))/0xc);if(_0x41ca3e===_0x1363ef)break;else _0x4612a9['push'](_0x4612a9['shift']());}catch(_0x1d5bbe){_0x4612a9['push'](_0x4612a9['shift']());}}}(a137_0x5c2d,0x625ed));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x129282){const _0x119817=a137_0x1dd5;customApiDomain=_0x129282?.['apiDomain'],customUserDomain=_0x129282?.[_0x119817(0x1e2)],customRuntimeDomain=_0x129282?.['runtimeDomain'];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a137_0x47b20a(0x1ec):a137_0x47b20a(0x1e1));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a137_0x47b20a(0x1e5):a137_0x47b20a(0x1e7));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a137_0x47b20a(0x1eb):a137_0x47b20a(0x1e8));
@@ -1 +1 @@
1
- const a138_0x47d417=a138_0x1852;(function(_0x51d5b4,_0x31143b){const _0x34d30b=a138_0x1852,_0x3e89ec=_0x51d5b4();while(!![]){try{const _0x1b12a5=parseInt(_0x34d30b(0x171))/0x1+-parseInt(_0x34d30b(0x17a))/0x2+-parseInt(_0x34d30b(0x174))/0x3*(-parseInt(_0x34d30b(0x177))/0x4)+parseInt(_0x34d30b(0x17c))/0x5+-parseInt(_0x34d30b(0x172))/0x6+-parseInt(_0x34d30b(0x178))/0x7+-parseInt(_0x34d30b(0x17b))/0x8*(-parseInt(_0x34d30b(0x173))/0x9);if(_0x1b12a5===_0x31143b)break;else _0x3e89ec['push'](_0x3e89ec['shift']());}catch(_0x1e06de){_0x3e89ec['push'](_0x3e89ec['shift']());}}}(a138_0x1fef,0xb8993));function a138_0x1fef(){const _0x550f27=['dev','312384PDAMAY','5359296AnXXFd','10929483wMTzdu','21708MAEGcP','daily','production','636SWLwCJ','6528326NAelOL','online','1834704UhWSEQ','8QKHlDR','4110030cUbzuK'];a138_0x1fef=function(){return _0x550f27;};return a138_0x1fef();}function a138_0x1852(_0x7ef3f8,_0x737637){_0x7ef3f8=_0x7ef3f8-0x171;const _0x1fefe9=a138_0x1fef();let _0x1852f2=_0x1fefe9[_0x7ef3f8];return _0x1852f2;}export const RABETBASE_ENV_VALUES=['production',a138_0x47d417(0x175)];export function normalizeEnv(_0x49131c){const _0xc590f6=a138_0x47d417;return _0x49131c===_0xc590f6(0x179)?'production':_0x49131c;}export function isProduction(_0x22c35f){const _0xebc426=a138_0x47d417;return normalizeEnv(_0x22c35f)===_0xebc426(0x176);}export function isDaily(_0x151276){const _0x5a9345=a138_0x47d417;return normalizeEnv(_0x151276)===_0x5a9345(0x175);}export function isDev(_0x353dc7){const _0x41ff93=a138_0x47d417,_0x513938=normalizeEnv(_0x353dc7);return _0x513938==='development'||_0x513938===_0x41ff93(0x17d);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a138_0x47d417(0x176));export function getEnv(){return env;}export function initEnv(_0x409789){env=normalizeEnv(_0x409789);}
1
+ const a138_0xffca12=a138_0x3842;function a138_0x45bc(){const _0x4f49db=['production','4wtlcow','21402Mirzyy','2323272LIjBkG','810605jPDkmH','70jgjSLE','online','2260NovoMM','11dCLbnP','995376NIXIkA','19599780sQzHtQ','dev','development','254958BCXuyd','daily','76088MaJiFG','13ZqvaCV'];a138_0x45bc=function(){return _0x4f49db;};return a138_0x45bc();}(function(_0x44337c,_0x4f5e74){const _0x21c93a=a138_0x3842,_0x3f60ab=_0x44337c();while(!![]){try{const _0x1ad281=-parseInt(_0x21c93a(0x123))/0x1*(parseInt(_0x21c93a(0x122))/0x2)+-parseInt(_0x21c93a(0x127))/0x3+-parseInt(_0x21c93a(0x125))/0x4*(-parseInt(_0x21c93a(0x128))/0x5)+parseInt(_0x21c93a(0x120))/0x6*(parseInt(_0x21c93a(0x129))/0x7)+parseInt(_0x21c93a(0x11c))/0x8+parseInt(_0x21c93a(0x126))/0x9*(-parseInt(_0x21c93a(0x11a))/0xa)+-parseInt(_0x21c93a(0x11b))/0xb*(-parseInt(_0x21c93a(0x11d))/0xc);if(_0x1ad281===_0x4f5e74)break;else _0x3f60ab['push'](_0x3f60ab['shift']());}catch(_0x3c9e53){_0x3f60ab['push'](_0x3f60ab['shift']());}}}(a138_0x45bc,0x836fc));export const RABETBASE_ENV_VALUES=['production',a138_0xffca12(0x121)];export function normalizeEnv(_0x3b5d57){const _0x2f7c12=a138_0xffca12;return _0x3b5d57===_0x2f7c12(0x12a)?_0x2f7c12(0x124):_0x3b5d57;}export function isProduction(_0x24a2f7){const _0x23c4ef=a138_0xffca12;return normalizeEnv(_0x24a2f7)===_0x23c4ef(0x124);}export function isDaily(_0x116fe7){const _0x5240f0=a138_0xffca12;return normalizeEnv(_0x116fe7)===_0x5240f0(0x121);}export function isDev(_0x51c578){const _0x2bac25=a138_0xffca12,_0x3ba2c7=normalizeEnv(_0x51c578);return _0x3ba2c7===_0x2bac25(0x11f)||_0x3ba2c7===_0x2bac25(0x11e);}function a138_0x3842(_0x3161d1,_0xdb6848){_0x3161d1=_0x3161d1-0x11a;const _0x45bc96=a138_0x45bc();let _0x38421f=_0x45bc96[_0x3161d1];return _0x38421f;}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a138_0xffca12(0x124));export function getEnv(){return env;}export function initEnv(_0x57af86){env=normalizeEnv(_0x57af86);}
@@ -1 +1 @@
1
- const a139_0x43c8e3=a139_0x531a;function a139_0x531a(_0x440d2b,_0x4670c4){_0x440d2b=_0x440d2b-0x6d;const _0x3b8e0b=a139_0x3b8e();let _0x531ae0=_0x3b8e0b[_0x440d2b];return _0x531ae0;}(function(_0x4695f1,_0x35ae95){const _0x21b75b=a139_0x531a,_0x33ddf0=_0x4695f1();while(!![]){try{const _0x29ca8a=parseInt(_0x21b75b(0x71))/0x1+parseInt(_0x21b75b(0x70))/0x2+-parseInt(_0x21b75b(0x6e))/0x3*(-parseInt(_0x21b75b(0x6d))/0x4)+parseInt(_0x21b75b(0x6f))/0x5+-parseInt(_0x21b75b(0x73))/0x6+parseInt(_0x21b75b(0x78))/0x7*(-parseInt(_0x21b75b(0x76))/0x8)+-parseInt(_0x21b75b(0x74))/0x9;if(_0x29ca8a===_0x35ae95)break;else _0x33ddf0['push'](_0x33ddf0['shift']());}catch(_0xce3590){_0x33ddf0['push'](_0x33ddf0['shift']());}}}(a139_0x3b8e,0xe1acd));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a139_0x43c8e3(0x75),a139_0x43c8e3(0x77),a139_0x43c8e3(0x72)];function a139_0x3b8e(){const _0x57f3c3=['3618120UcvHvN','1776267zLsKAv','json','1864gsiiZH','pretty','13405kwQFpG','12FgUlwJ','436575JYmYRU','5367825WDmqKt','1234216stsTic','43695PVCvwn','compress'];a139_0x3b8e=function(){return _0x57f3c3;};return a139_0x3b8e();}
1
+ function a139_0x592c(_0x51abc4,_0x46f0ea){_0x51abc4=_0x51abc4-0x16b;const _0x1cfb20=a139_0x1cfb();let _0x592ceb=_0x1cfb20[_0x51abc4];return _0x592ceb;}const a139_0x5adf56=a139_0x592c;(function(_0x50f9eb,_0x405095){const _0x1eac72=a139_0x592c,_0x2dfa37=_0x50f9eb();while(!![]){try{const _0x71c282=parseInt(_0x1eac72(0x171))/0x1*(-parseInt(_0x1eac72(0x172))/0x2)+-parseInt(_0x1eac72(0x170))/0x3*(parseInt(_0x1eac72(0x16c))/0x4)+parseInt(_0x1eac72(0x16e))/0x5*(-parseInt(_0x1eac72(0x16f))/0x6)+-parseInt(_0x1eac72(0x173))/0x7+-parseInt(_0x1eac72(0x175))/0x8+-parseInt(_0x1eac72(0x176))/0x9+parseInt(_0x1eac72(0x16d))/0xa;if(_0x71c282===_0x405095)break;else _0x2dfa37['push'](_0x2dfa37['shift']());}catch(_0x2686ab){_0x2dfa37['push'](_0x2dfa37['shift']());}}}(a139_0x1cfb,0x9d419));export const RABETBASE_OUTPUT_FORMAT_VALUES=['json',a139_0x5adf56(0x174),a139_0x5adf56(0x16b)];function a139_0x1cfb(){const _0x32fe6e=['2612673dJNYEN','pretty','5583896ryzepH','4041540RubleR','compress','5008628BnKBJn','50450850sonWfR','10LWpMty','2266452aJFWST','3raxJIO','11Kkmkzo','158734HGoUFj'];a139_0x1cfb=function(){return _0x32fe6e;};return a139_0x1cfb();}
@@ -1 +1 @@
1
- function a140_0x5111(){const _0x5657d5=['7mQCvri','267dwJFcH','6396492fvwnly','13EefTvI','./src/api','941272BgtTTX','814SUtzJF','6NhObge','1273315IVrHZC','1756eEiSOf','85570AMmKwW','4157964phczlO','2126764FMOfSy','6hXUogz'];a140_0x5111=function(){return _0x5657d5;};return a140_0x5111();}const a140_0x2c4594=a140_0x235f;(function(_0x4079b0,_0x4c959c){const _0x4e4b6e=a140_0x235f,_0x4d1c5d=_0x4079b0();while(!![]){try{const _0x3ffb40=-parseInt(_0x4e4b6e(0x12d))/0x1*(-parseInt(_0x4e4b6e(0x135))/0x2)+parseInt(_0x4e4b6e(0x133))/0x3*(parseInt(_0x4e4b6e(0x12a))/0x4)+parseInt(_0x4e4b6e(0x134))/0x5*(-parseInt(_0x4e4b6e(0x12b))/0x6)+parseInt(_0x4e4b6e(0x12c))/0x7*(parseInt(_0x4e4b6e(0x131))/0x8)+-parseInt(_0x4e4b6e(0x129))/0x9+parseInt(_0x4e4b6e(0x136))/0xa*(parseInt(_0x4e4b6e(0x132))/0xb)+-parseInt(_0x4e4b6e(0x12e))/0xc*(parseInt(_0x4e4b6e(0x12f))/0xd);if(_0x3ffb40===_0x4c959c)break;else _0x4d1c5d['push'](_0x4d1c5d['shift']());}catch(_0x703079){_0x4d1c5d['push'](_0x4d1c5d['shift']());}}}(a140_0x5111,0xc3109));function a140_0x235f(_0x1df3bc,_0xb1f295){_0x1df3bc=_0x1df3bc-0x129;const _0x5111d2=a140_0x5111();let _0x235f9=_0x5111d2[_0x1df3bc];return _0x235f9;}export const DEFAULT_API_DIR=a140_0x2c4594(0x130);
1
+ const a140_0x524aa6=a140_0x896b;function a140_0x896b(_0x2d3a80,_0x101246){_0x2d3a80=_0x2d3a80-0x11c;const _0x339f18=a140_0x339f();let _0x896bf6=_0x339f18[_0x2d3a80];return _0x896bf6;}function a140_0x339f(){const _0x2aa6ef=['339928GSsFmH','8724400frplLr','./src/api','19746828sRNsDI','8700618YBeUwO','10494561CxVgky','4190637ZztAjh','3gUjJZd','40dLDwXC','763918AZbCyb'];a140_0x339f=function(){return _0x2aa6ef;};return a140_0x339f();}(function(_0x1d6035,_0x3c5b5c){const _0x55f78c=a140_0x896b,_0x2ae1e6=_0x1d6035();while(!![]){try{const _0x4fdcb8=-parseInt(_0x55f78c(0x123))/0x1*(-parseInt(_0x55f78c(0x125))/0x2)+-parseInt(_0x55f78c(0x122))/0x3+parseInt(_0x55f78c(0x11c))/0x4*(-parseInt(_0x55f78c(0x124))/0x5)+parseInt(_0x55f78c(0x120))/0x6+parseInt(_0x55f78c(0x121))/0x7+parseInt(_0x55f78c(0x11d))/0x8+-parseInt(_0x55f78c(0x11f))/0x9;if(_0x4fdcb8===_0x3c5b5c)break;else _0x2ae1e6['push'](_0x2ae1e6['shift']());}catch(_0x52c2f0){_0x2ae1e6['push'](_0x2ae1e6['shift']());}}}(a140_0x339f,0xdf5ee));export const DEFAULT_API_DIR=a140_0x524aa6(0x11e);
@@ -1 +1 @@
1
- function a141_0x4cb9(){const _0x169b9d=['118KHyhqg','1603616tFigss','3670444DECOyP','1893WNkyRP','5fWhBej','read','10789960IhWqzd','5807046MnpzkF','1162876UKRBCL','15715881bibVZg'];a141_0x4cb9=function(){return _0x169b9d;};return a141_0x4cb9();}const a141_0x2a9720=a141_0x5084;(function(_0x54ea60,_0x3ef54a){const _0x50c1be=a141_0x5084,_0x5863c3=_0x54ea60();while(!![]){try{const _0x283470=-parseInt(_0x50c1be(0x80))/0x1+parseInt(_0x50c1be(0x78))/0x2*(-parseInt(_0x50c1be(0x7b))/0x3)+parseInt(_0x50c1be(0x7a))/0x4*(parseInt(_0x50c1be(0x7c))/0x5)+parseInt(_0x50c1be(0x7f))/0x6+-parseInt(_0x50c1be(0x79))/0x7+-parseInt(_0x50c1be(0x7e))/0x8+parseInt(_0x50c1be(0x81))/0x9;if(_0x283470===_0x3ef54a)break;else _0x5863c3['push'](_0x5863c3['shift']());}catch(_0x3cfe1f){_0x5863c3['push'](_0x5863c3['shift']());}}}(a141_0x4cb9,0xd06db));function a141_0x5084(_0x414e02,_0x3e4821){_0x414e02=_0x414e02-0x78;const _0x4cb908=a141_0x4cb9();let _0x508454=_0x4cb908[_0x414e02];return _0x508454;}export const RISK_LEVEL_VALUES=[a141_0x2a9720(0x7d),'write','high-risk-write'];
1
+ function a141_0x292a(){const _0xd59e44=['146937fdpFVY','50EBipmG','1169400swALJM','6225051zdeDxQ','741858jcaBXM','4OcHDwQ','340155ORSfFB','2Jnulwn','48vGMeHH','1527003BomAra','high-risk-write','29207057CwCpIn'];a141_0x292a=function(){return _0xd59e44;};return a141_0x292a();}const a141_0x22b645=a141_0x22b7;(function(_0x4f5f82,_0x2d6c0d){const _0x4aa356=a141_0x22b7,_0x4044ee=_0x4f5f82();while(!![]){try{const _0x4597e1=-parseInt(_0x4aa356(0x198))/0x1*(-parseInt(_0x4aa356(0x19b))/0x2)+-parseInt(_0x4aa356(0x194))/0x3*(parseInt(_0x4aa356(0x199))/0x4)+parseInt(_0x4aa356(0x19a))/0x5*(parseInt(_0x4aa356(0x19c))/0x6)+parseInt(_0x4aa356(0x197))/0x7+parseInt(_0x4aa356(0x196))/0x8+parseInt(_0x4aa356(0x19d))/0x9*(parseInt(_0x4aa356(0x195))/0xa)+-parseInt(_0x4aa356(0x19f))/0xb;if(_0x4597e1===_0x2d6c0d)break;else _0x4044ee['push'](_0x4044ee['shift']());}catch(_0x3157c0){_0x4044ee['push'](_0x4044ee['shift']());}}}(a141_0x292a,0x71b4f));function a141_0x22b7(_0xccc749,_0x28c50f){_0xccc749=_0xccc749-0x194;const _0x292a78=a141_0x292a();let _0x22b7c3=_0x292a78[_0xccc749];return _0x22b7c3;}export const RISK_LEVEL_VALUES=['read','write',a141_0x22b645(0x19e)];