@lovrabet/rabetbase-cli 2.2.4-beta.3 → 2.2.4-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) 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/list.js +1 -1
  87. package/lib/commands/menu/shared/compare-table.js +1 -1
  88. package/lib/commands/menu/shared/index.js +1 -1
  89. package/lib/commands/menu/shared/inquirer.js +1 -1
  90. package/lib/commands/menu/shared/local-pages.js +1 -1
  91. package/lib/commands/menu/shared/logic.js +1 -1
  92. package/lib/commands/menu/shared/service.js +1 -1
  93. package/lib/commands/menu/shared/sync-core.js +1 -1
  94. package/lib/commands/menu/shared/update-core.js +1 -1
  95. package/lib/commands/menu/shared/valid-url.js +1 -1
  96. package/lib/commands/menu/sync.js +1 -1
  97. package/lib/commands/menu/update.js +1 -1
  98. package/lib/commands/page/generate-start.js +1 -1
  99. package/lib/commands/page/generate-status.js +1 -1
  100. package/lib/commands/page/index.js +1 -1
  101. package/lib/commands/page/pull.js +1 -1
  102. package/lib/commands/page/push.js +1 -1
  103. package/lib/commands/page/relation-audit.js +1 -1
  104. package/lib/commands/page/shared.js +1 -1
  105. package/lib/commands/page/standard-page-status.js +1 -1
  106. package/lib/commands/page/sync.js +1 -1
  107. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  108. package/lib/commands/project/create/format-elapsed.js +1 -1
  109. package/lib/commands/project/create/main.js +1 -1
  110. package/lib/commands/project/create/non-interactive.js +1 -1
  111. package/lib/commands/project/create/project-template-path.js +1 -1
  112. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  113. package/lib/commands/project/create/use-format-code.js +1 -1
  114. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  115. package/lib/commands/project/index.js +1 -1
  116. package/lib/commands/project/init.js +1 -1
  117. package/lib/commands/project/upgrade.js +1 -1
  118. package/lib/commands/registry.js +1 -1
  119. package/lib/commands/run/index.js +1 -1
  120. package/lib/commands/schema.js +1 -1
  121. package/lib/commands/skill/index.js +1 -1
  122. package/lib/commands/sql/create.js +1 -1
  123. package/lib/commands/sql/delete.js +1 -1
  124. package/lib/commands/sql/detail.js +1 -1
  125. package/lib/commands/sql/exec.js +1 -1
  126. package/lib/commands/sql/index.js +1 -1
  127. package/lib/commands/sql/list.js +1 -1
  128. package/lib/commands/sql/pull.js +1 -1
  129. package/lib/commands/sql/push.js +1 -1
  130. package/lib/commands/sql/save.js +1 -1
  131. package/lib/commands/sql/shared.js +1 -1
  132. package/lib/commands/sql/status.js +1 -1
  133. package/lib/commands/sql/validate.js +1 -1
  134. package/lib/config/schema.js +1 -1
  135. package/lib/constant/cdn.js +1 -1
  136. package/lib/constant/cli.js +1 -1
  137. package/lib/constant/defaults.js +1 -1
  138. package/lib/constant/domain.js +1 -1
  139. package/lib/constant/env.js +1 -1
  140. package/lib/constant/output.js +1 -1
  141. package/lib/constant/paths.js +1 -1
  142. package/lib/constant/risk.js +1 -1
  143. package/lib/context.js +1 -1
  144. package/lib/core/alias-resolver.js +1 -1
  145. package/lib/core/api-client.js +1 -1
  146. package/lib/core/bff/config.js +1 -1
  147. package/lib/core/bff/file-system.js +1 -1
  148. package/lib/core/bff/hash.js +1 -1
  149. package/lib/core/bff/lock.js +1 -1
  150. package/lib/core/bff/utils.js +1 -1
  151. package/lib/core/db-resolver.js +1 -1
  152. package/lib/core/page/file-system.js +1 -1
  153. package/lib/core/page/hash.js +1 -1
  154. package/lib/core/page/lock.js +1 -1
  155. package/lib/core/sql-sync/config.js +1 -1
  156. package/lib/core/sql-sync/file-system.js +1 -1
  157. package/lib/core/sql-sync/hash.js +1 -1
  158. package/lib/core/sql-sync/lock.js +1 -1
  159. package/lib/core/sql-sync/utils.js +1 -1
  160. package/lib/core/sql-validator.js +1 -1
  161. package/lib/errors.js +1 -1
  162. package/lib/framework/build-all-flags.js +1 -1
  163. package/lib/framework/flags.js +1 -1
  164. package/lib/framework/help.js +1 -1
  165. package/lib/framework/index.js +1 -1
  166. package/lib/framework/output.js +1 -1
  167. package/lib/framework/response.js +1 -1
  168. package/lib/framework/runner-alias.js +1 -1
  169. package/lib/framework/runner.js +1 -1
  170. package/lib/framework/schema-export.js +1 -1
  171. package/lib/framework/types.js +1 -1
  172. package/lib/generated/build-info.js +1 -1
  173. package/lib/help.js +1 -1
  174. package/lib/skills/main.js +1 -1
  175. package/lib/skills/npx-skills-add.js +1 -1
  176. package/lib/telemetry/cli-command-trace.js +1 -1
  177. package/lib/telemetry/cli-help-trace.js +1 -1
  178. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  179. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  180. package/lib/telemetry/send-cli-trace-log.js +1 -1
  181. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  182. package/lib/utils/ai_config.js +1 -1
  183. package/lib/utils/apply-jq-filter.js +1 -1
  184. package/lib/utils/cdn-config.js +1 -1
  185. package/lib/utils/check-sdk-version.js +1 -1
  186. package/lib/utils/cli-version-check.js +1 -1
  187. package/lib/utils/cli-version-policy.js +1 -1
  188. package/lib/utils/config.js +1 -1
  189. package/lib/utils/copy-directory.js +1 -1
  190. package/lib/utils/entity-with-id.js +1 -1
  191. package/lib/utils/file-utils.js +1 -1
  192. package/lib/utils/guides-cdn.js +1 -1
  193. package/lib/utils/http-client.js +1 -1
  194. package/lib/utils/is-non-interactive.js +1 -1
  195. package/lib/utils/logger.js +1 -1
  196. package/lib/utils/params.js +1 -1
  197. package/lib/utils/platform.js +1 -1
  198. package/lib/utils/rules-cdn.js +1 -1
  199. package/lib/utils/sleep.js +1 -1
  200. package/lib/utils/template-replacer.js +1 -1
  201. package/lib/utils/update-notice.js +1 -1
  202. package/lib/utils/version.js +1 -1
  203. package/lib/utils/with-active-cookie.js +1 -1
  204. package/lib/utils/write-cli-side-channel.js +1 -1
  205. package/package.json +2 -2
  206. package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +1 -1
  207. package/templates/rules/lovrabet_rules.mdc.tpl +3 -1
@@ -1 +1 @@
1
- const a128_0xdc55a8=a128_0x3c50;(function(_0x49cc98,_0x51cb0d){const _0x547994=a128_0x3c50,_0x91244e=_0x49cc98();while(!![]){try{const _0x260741=-parseInt(_0x547994(0x209))/0x1*(parseInt(_0x547994(0x20d))/0x2)+-parseInt(_0x547994(0x224))/0x3*(-parseInt(_0x547994(0x226))/0x4)+parseInt(_0x547994(0x1fc))/0x5*(parseInt(_0x547994(0x201))/0x6)+parseInt(_0x547994(0x230))/0x7*(-parseInt(_0x547994(0x216))/0x8)+-parseInt(_0x547994(0x208))/0x9+parseInt(_0x547994(0x22e))/0xa*(parseInt(_0x547994(0x200))/0xb)+parseInt(_0x547994(0x225))/0xc;if(_0x260741===_0x51cb0d)break;else _0x91244e['push'](_0x91244e['shift']());}catch(_0x5d2d8c){_0x91244e['push'](_0x91244e['shift']());}}}(a128_0x536a,0xa3b43));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';function a128_0x3c50(_0x51f5a9,_0x34af0e){_0x51f5a9=_0x51f5a9-0x1f2;const _0x536ae2=a128_0x536a();let _0x3c5016=_0x536ae2[_0x51f5a9];return _0x3c5016;}import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';function a128_0x536a(){const _0x47b2b7=['Pull\x20complete:\x20','sqlContent','\x20SQL\x20file(s)\x20into\x20','apps','lockFilePath','boolean','Force\x20overwrite\x20local\x20unsynced\x20changes','local\x20differs\x20from\x20remote','sqls','Would\x20pull\x20','sqlcode','2115ooDpSN','28461852qMDXNs','2316NCEoZI','str','\x20failed','catch','filter','conflict','sql','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','10byNNkC','unchanged','478457qIacFa','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','write','would_pull','paging','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','cancelled','\x20skipped,\x20','force','tableData','replace','dbId','35AMMsAX','pull','toISOString','\x20written,\x20','2978679VgKTeX','103494ovIWKN','test','sqlCode','length','name','push','trimStart','846567MTzLef','1WDAEUP','description','utf8','path','2216570NtebZV','message','appCode','sqlName','POST','string','No\x20remote\x20SQL\x20queries\x20matched.','nonInteractive','mybatisXml','152oxEitD','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','sqlRootDir'];a128_0x536a=function(){return _0x47b2b7;};return a128_0x536a();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x3b2c79,_0x36a631){const _0x4e0ee8=a128_0x3c50,_0x1f4b04=[];let _0x58ba42=0x1;while(!![]){const _0x31c398=await listSqlQueries(_0x3b2c79,{'currentPage':_0x58ba42,'pageSize':PAGE_SIZE,'sqlCode':_0x36a631['sqlCode'],'sqlName':_0x36a631['sqlName']}),_0x19b1b3=_0x31c398[_0x4e0ee8(0x1f9)]??[];_0x1f4b04['push'](..._0x19b1b3);if(_0x19b1b3[_0x4e0ee8(0x204)]===0x0)break;const _0x54ed4a=_0x31c398[_0x4e0ee8(0x1f4)]?.['totalCount'];if(_0x54ed4a!=null?_0x1f4b04[_0x4e0ee8(0x204)]>=_0x54ed4a:_0x19b1b3[_0x4e0ee8(0x204)]<PAGE_SIZE)break;_0x58ba42++;}return _0x1f4b04;}async function ensureSqlContent(_0x20fc0f){const _0x179954=a128_0x3c50;if(_0x20fc0f['sqlContent']!=null&&String(_0x20fc0f[_0x179954(0x21a)])['length']>0x0)return _0x20fc0f;return getSqlQueryDetail(_0x20fc0f[_0x179954(0x203)]);}export const sqlPull={'service':a128_0xdc55a8(0x22c),'command':a128_0xdc55a8(0x1fd),'description':a128_0xdc55a8(0x231),'risk':a128_0xdc55a8(0x1f2),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0xdc55a8(0x205),'type':a128_0xdc55a8(0x212),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a128_0xdc55a8(0x1f8),'type':a128_0xdc55a8(0x21e),'description':a128_0xdc55a8(0x21f)}],async 'dryRun'(_0x2a2b6b){const _0x282b4c=a128_0xdc55a8,_0x4a89c1=loadSqlProjectConfig(_0x2a2b6b[_0x282b4c(0x20f)]),_0x153dc4=await readSqlLockFile(_0x4a89c1[_0x282b4c(0x21d)]),{appLock:_0x3f6866}=ensureSqlLockScope(_0x153dc4??createEmptySqlLock(),_0x4a89c1[_0x282b4c(0x20f)],_0x4a89c1['sqlRoot'],_0x282b4c(0x1fd)),_0x2ff4e9=await fetchAllSqlQueries(_0x2a2b6b['appCode'],{'sqlCode':_0x2a2b6b[_0x282b4c(0x227)](_0x282b4c(0x223))||undefined,'sqlName':_0x2a2b6b[_0x282b4c(0x227)]('name')||undefined}),_0x14ced9=[];for(const _0x1b3018 of _0x2ff4e9){const _0x16e209=await ensureSqlContent(_0x1b3018),_0x515223=ensureRemoteSqlContent(_0x16e209),_0x4165a7=detectModeFromSql(_0x16e209),_0x598c02=_0x16e209['dbId']?await getDbName(_0x2a2b6b[_0x282b4c(0x20f)],Number(_0x16e209[_0x282b4c(0x1fb)]))[_0x282b4c(0x229)](()=>undefined):undefined,_0x3900f1=buildLocalSqlFileContent({'sqlCode':_0x16e209[_0x282b4c(0x203)],'sqlName':_0x16e209[_0x282b4c(0x210)],'dbId':_0x16e209[_0x282b4c(0x1fb)]},_0x515223,{'dbName':_0x598c02,'mode':_0x4165a7,'syncedAt':new Date()[_0x282b4c(0x1fe)](),'description':_0x16e209[_0x282b4c(0x20a)]}),_0x4322f1=buildSqlLockEntry(_0x16e209,_0x515223,'',{'dbName':_0x598c02}),_0x51cda8=resolveLocalSqlFilePath(_0x4a89c1,_0x16e209[_0x282b4c(0x203)],_0x4322f1);let _0x42fea1=_0x282b4c(0x1f3),_0x38e1dc;if(await fileExists(_0x51cda8)){const _0xf3ecac=await readFile(_0x51cda8,'utf8');isEquivalentPulledSqlFile(_0xf3ecac,_0x3900f1,_0x4165a7)?(_0x42fea1='skipped',_0x38e1dc=_0x282b4c(0x22f)):(_0x42fea1=_0x282b4c(0x22b),_0x38e1dc=_0x282b4c(0x1f5));}_0x14ced9[_0x282b4c(0x206)]({'sqlCode':_0x16e209[_0x282b4c(0x203)],'sqlName':_0x16e209['sqlName'],'filePath':_0x51cda8,'status':_0x42fea1,'reason':_0x38e1dc});}return{'method':_0x282b4c(0x211),'url':_0x282b4c(0x22d),'body':{'appCode':_0x2a2b6b[_0x282b4c(0x20f)],'sqlCode':_0x2a2b6b[_0x282b4c(0x227)]('sqlcode')||null,'sqlName':_0x2a2b6b[_0x282b4c(0x227)](_0x282b4c(0x205))||null,'files':_0x14ced9},'description':_0x282b4c(0x222)+_0x14ced9['length']+_0x282b4c(0x21b)+_0x4a89c1[_0x282b4c(0x218)]};},async 'execute'(_0x2b7c0a){const _0x244437=a128_0xdc55a8,_0x4ece51=loadSqlProjectConfig(_0x2b7c0a[_0x244437(0x20f)]),_0x47a307=await readSqlLockFile(_0x4ece51['lockFilePath']),{lockData:_0x158a5c,appLock:_0x48499b}=ensureSqlLockScope(_0x47a307??createEmptySqlLock(),_0x4ece51['appCode'],_0x4ece51['sqlRoot'],'pull'),_0xd4fe46=_0x2b7c0a['bool'](_0x244437(0x1f8)),_0x19d12a=await fetchAllSqlQueries(_0x2b7c0a[_0x244437(0x20f)],{'sqlCode':_0x2b7c0a['str'](_0x244437(0x223))||undefined,'sqlName':_0x2b7c0a[_0x244437(0x227)]('name')||undefined});if(_0x19d12a[_0x244437(0x204)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x244437(0x213)};const _0x2b4394=[],_0x39de19=[];for(const _0x42568d of _0x19d12a){try{_0x2b4394[_0x244437(0x206)](await ensureSqlContent(_0x42568d));}catch(_0x51c598){_0x39de19[_0x244437(0x206)]({'sqlCode':_0x42568d['sqlCode'],'error':_0x51c598 instanceof Error?_0x51c598[_0x244437(0x20e)]:String(_0x51c598)});}}if(_0xd4fe46&&!_0x2b7c0a[_0x244437(0x214)]){let _0xadcdb=![];for(const _0x156ef7 of _0x2b4394){const _0x17fb84=detectModeFromSql(_0x156ef7),_0x32a80f=_0x156ef7[_0x244437(0x1fb)]?await getDbName(_0x2b7c0a[_0x244437(0x20f)],Number(_0x156ef7[_0x244437(0x1fb)]))[_0x244437(0x229)](()=>undefined):undefined,_0x8396bb=buildLocalSqlFileContent({'sqlCode':_0x156ef7[_0x244437(0x203)],'sqlName':_0x156ef7[_0x244437(0x210)],'dbId':_0x156ef7['dbId']},ensureRemoteSqlContent(_0x156ef7),{'dbName':_0x32a80f,'mode':_0x17fb84,'syncedAt':new Date()['toISOString'](),'description':_0x156ef7['description']}),_0x4583f5=resolveLocalSqlFilePath(_0x4ece51,_0x156ef7[_0x244437(0x203)],buildSqlLockEntry(_0x156ef7,ensureRemoteSqlContent(_0x156ef7),'',{'dbName':_0x32a80f}));if(await fileExists(_0x4583f5)){const _0xf5fea9=await readFile(_0x4583f5,'utf8');if(!isEquivalentPulledSqlFile(_0xf5fea9,_0x8396bb,_0x17fb84)){_0xadcdb=!![];break;}}}if(_0xadcdb){const _0x1daa94=await confirmForceOverwrite(_0x244437(0x217));if(!_0x1daa94)throw CliErrors[_0x244437(0x1f6)]('Force\x20pull\x20cancelled.');}}const _0x315bf7=cloneSqlLockData(_0x158a5c),_0x1439c1=_0x315bf7[_0x244437(0x21c)][_0x4ece51['appCode']],_0x433d11=[],_0x322fd1=[];for(const _0x2f18fb of _0x2b4394){const _0x43e897=_0x1439c1[_0x244437(0x221)][_0x2f18fb[_0x244437(0x203)]],_0x6eb510=ensureRemoteSqlContent(_0x2f18fb),_0x14ac49=detectModeFromSql(_0x2f18fb),_0x377eee=_0x2f18fb[_0x244437(0x1fb)]?await getDbName(_0x2b7c0a['appCode'],Number(_0x2f18fb[_0x244437(0x1fb)]))[_0x244437(0x229)](()=>undefined):undefined,_0x58f44e=buildLocalSqlFileContent({'sqlCode':_0x2f18fb['sqlCode'],'sqlName':_0x2f18fb[_0x244437(0x210)],'dbId':_0x2f18fb[_0x244437(0x1fb)]},_0x6eb510,{'dbName':_0x377eee,'mode':_0x14ac49,'syncedAt':new Date()['toISOString'](),'description':_0x2f18fb[_0x244437(0x20a)]}),_0x124126=buildSqlLockEntry(_0x2f18fb,_0x6eb510,computeSqlContentHash(_0x58f44e),{'dbName':_0x377eee}),_0x30036b=_0x124126[_0x244437(0x20c)],_0x334bde=join(_0x4ece51[_0x244437(0x218)],_0x30036b);try{if(await fileExists(_0x334bde)){const _0x1af5d7=await readFile(_0x334bde,_0x244437(0x20b));if(isEquivalentPulledSqlFile(_0x1af5d7,_0x58f44e,_0x14ac49)){_0x322fd1[_0x244437(0x206)]({'sqlCode':_0x2f18fb[_0x244437(0x203)],'reason':_0x244437(0x22f)}),_0x1439c1[_0x244437(0x221)][_0x2f18fb[_0x244437(0x203)]]={..._0x124126,'hash':computeSqlContentHash(_0x1af5d7),'path':_0x30036b};continue;}if(!_0xd4fe46){_0x322fd1['push']({'sqlCode':_0x2f18fb[_0x244437(0x203)],'reason':_0x244437(0x220)});continue;}}const _0x3ae186=_0x43e897?.[_0x244437(0x20c)]?join(_0x4ece51[_0x244437(0x218)],_0x43e897[_0x244437(0x20c)]):undefined;_0x3ae186&&_0x3ae186!==_0x334bde&&await fileExists(_0x3ae186)&&await rm(_0x3ae186,{'force':!![]}),await ensureParentDirectory(_0x334bde),await writeFile(_0x334bde,_0x58f44e,_0x244437(0x20b)),_0x1439c1[_0x244437(0x221)][_0x2f18fb[_0x244437(0x203)]]={..._0x124126,'path':_0x30036b},_0x433d11[_0x244437(0x206)]({'sqlCode':_0x2f18fb[_0x244437(0x203)],'filePath':_0x334bde});}catch(_0x4713eb){_0x39de19[_0x244437(0x206)]({'sqlCode':_0x2f18fb[_0x244437(0x203)],'error':_0x4713eb instanceof Error?_0x4713eb[_0x244437(0x20e)]:String(_0x4713eb)});}}return _0x1439c1['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x4ece51[_0x244437(0x21d)],_0x315bf7),{'ok':_0x39de19[_0x244437(0x204)]===0x0,'data':{'pulled':_0x433d11,'skipped':_0x322fd1,'failed':_0x39de19},'message':_0x244437(0x219)+_0x433d11[_0x244437(0x204)]+_0x244437(0x1ff)+_0x322fd1['length']+_0x244437(0x1f7)+_0x39de19[_0x244437(0x204)]+_0x244437(0x228)};}};function detectModeFromSql(_0x2b389a){const _0x25db43=a128_0xdc55a8,_0x483801=ensureRemoteSqlContent(_0x2b389a),_0x3a507b=stripLocalSqlMetadata(_0x483801,_0x25db43(0x215))[_0x25db43(0x207)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x3a507b))return _0x25db43(0x215);return _0x25db43(0x22c);}function isEquivalentPulledSqlFile(_0x3746b2,_0x26ebf6,_0x13b9c1){return normalizePullComparableContent(_0x3746b2,_0x13b9c1)===normalizePullComparableContent(_0x26ebf6,_0x13b9c1);}function normalizePullComparableContent(_0x39219d,_0x2841a3){const _0x4d1641=a128_0xdc55a8,_0x2d2c7f=_0x39219d[_0x4d1641(0x1fa)](/\r\n/g,'\x0a')['split']('\x0a'),_0x410008=_0x2d2c7f[_0x4d1641(0x22a)](_0x3be8bb=>!isSyncedAtMetadataLine(_0x3be8bb,_0x2841a3));return _0x410008['join']('\x0a');}function isSyncedAtMetadataLine(_0x4e6a94,_0xafcf69){const _0x314aee=a128_0xdc55a8;if(_0xafcf69===_0x314aee(0x215))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x314aee(0x202)](_0x4e6a94);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x314aee(0x202)](_0x4e6a94);}
1
+ function a128_0x4279(_0x3b4079,_0xab6774){_0x3b4079=_0x3b4079-0x80;const _0xef5f1f=a128_0xef5f();let _0x42790a=_0xef5f1f[_0x3b4079];return _0x42790a;}const a128_0x441d12=a128_0x4279;function a128_0xef5f(){const _0x3b8591=['catch','nonInteractive','\x20written,\x20','message','\x20SQL\x20file(s)\x20into\x20','push','split','conflict','name','4046610IzmHtY','sqlName','2170050dgofhB','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','dbId','695616qyWdRj','unchanged','342531dgKqmF','length','toISOString','1489785VtphwD','pull','apps','\x20failed','mybatisXml','boolean','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','force','Force\x20overwrite\x20local\x20unsynced\x20changes','sqlRoot','test','replace','4366852OFENGq','skipped','Force\x20pull\x20cancelled.','Filter\x20by\x20SQL\x20display\x20name','path','join','sql','4UpMJnU','sqls','appCode','5AJgQTB','8OhgToK','string','str','POST','write','description','lockFilePath','utf8','373497VdFvKw','27lXmgWy','sqlRootDir','lastSync','local\x20differs\x20from\x20remote','No\x20remote\x20SQL\x20queries\x20matched.','sqlCode','would_pull','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlcode','filter'];a128_0xef5f=function(){return _0x3b8591;};return a128_0xef5f();}(function(_0x542164,_0x3ca987){const _0x5a19dc=a128_0x4279,_0x7dcb50=_0x542164();while(!![]){try{const _0x20e76b=-parseInt(_0x5a19dc(0xae))/0x1*(-parseInt(_0x5a19dc(0x87))/0x2)+parseInt(_0x5a19dc(0x93))/0x3*(-parseInt(_0x5a19dc(0x8b))/0x4)+-parseInt(_0x5a19dc(0x8a))/0x5*(-parseInt(_0x5a19dc(0xa7))/0x6)+-parseInt(_0x5a19dc(0x80))/0x7+-parseInt(_0x5a19dc(0xac))/0x8*(-parseInt(_0x5a19dc(0x94))/0x9)+-parseInt(_0x5a19dc(0xa9))/0xa+-parseInt(_0x5a19dc(0xb1))/0xb;if(_0x20e76b===_0x3ca987)break;else _0x7dcb50['push'](_0x7dcb50['shift']());}catch(_0x18720b){_0x7dcb50['push'](_0x7dcb50['shift']());}}}(a128_0xef5f,0x60747));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x2cbee8,_0xa05a23){const _0x3851a9=a128_0x4279,_0x2fd8ec=[];let _0x2a5c3b=0x1;while(!![]){const _0x57ae9c=await listSqlQueries(_0x2cbee8,{'currentPage':_0x2a5c3b,'pageSize':PAGE_SIZE,'sqlCode':_0xa05a23[_0x3851a9(0x99)],'sqlName':_0xa05a23['sqlName']}),_0x57376c=_0x57ae9c['tableData']??[];_0x2fd8ec[_0x3851a9(0xa3)](..._0x57376c);if(_0x57376c[_0x3851a9(0xaf)]===0x0)break;const _0x4d7797=_0x57ae9c['paging']?.['totalCount'];if(_0x4d7797!=null?_0x2fd8ec['length']>=_0x4d7797:_0x57376c[_0x3851a9(0xaf)]<PAGE_SIZE)break;_0x2a5c3b++;}return _0x2fd8ec;}async function ensureSqlContent(_0x46ae41){const _0x4abdae=a128_0x4279;if(_0x46ae41['sqlContent']!=null&&String(_0x46ae41['sqlContent'])[_0x4abdae(0xaf)]>0x0)return _0x46ae41;return getSqlQueryDetail(_0x46ae41['sqlCode']);}export const sqlPull={'service':'sql','command':a128_0x441d12(0xb2),'description':a128_0x441d12(0x9b),'risk':a128_0x441d12(0x8f),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a128_0x441d12(0xa6),'type':a128_0x441d12(0x8c),'description':a128_0x441d12(0x83)},{'name':a128_0x441d12(0xb8),'type':a128_0x441d12(0xb6),'description':a128_0x441d12(0xb9)}],async 'dryRun'(_0x4f20b5){const _0x4ce122=a128_0x441d12,_0x15e227=loadSqlProjectConfig(_0x4f20b5['appCode']),_0xf9f114=await readSqlLockFile(_0x15e227['lockFilePath']),{appLock:_0x375d59}=ensureSqlLockScope(_0xf9f114??createEmptySqlLock(),_0x15e227[_0x4ce122(0x89)],_0x15e227[_0x4ce122(0xba)],_0x4ce122(0xb2)),_0x21f461=await fetchAllSqlQueries(_0x4f20b5[_0x4ce122(0x89)],{'sqlCode':_0x4f20b5['str'](_0x4ce122(0x9c))||undefined,'sqlName':_0x4f20b5[_0x4ce122(0x8d)](_0x4ce122(0xa6))||undefined}),_0x2e4568=[];for(const _0x1fe39a of _0x21f461){const _0x33c4a1=await ensureSqlContent(_0x1fe39a),_0x1a8543=ensureRemoteSqlContent(_0x33c4a1),_0x6325d2=detectModeFromSql(_0x33c4a1),_0xf6a89f=_0x33c4a1[_0x4ce122(0xab)]?await getDbName(_0x4f20b5[_0x4ce122(0x89)],Number(_0x33c4a1['dbId']))[_0x4ce122(0x9e)](()=>undefined):undefined,_0x219b75=buildLocalSqlFileContent({'sqlCode':_0x33c4a1[_0x4ce122(0x99)],'sqlName':_0x33c4a1[_0x4ce122(0xa8)],'dbId':_0x33c4a1[_0x4ce122(0xab)]},_0x1a8543,{'dbName':_0xf6a89f,'mode':_0x6325d2,'syncedAt':new Date()[_0x4ce122(0xb0)](),'description':_0x33c4a1[_0x4ce122(0x90)]}),_0x1734ef=buildSqlLockEntry(_0x33c4a1,_0x1a8543,'',{'dbName':_0xf6a89f}),_0xf5fd14=resolveLocalSqlFilePath(_0x15e227,_0x33c4a1[_0x4ce122(0x99)],_0x1734ef);let _0x1b6946=_0x4ce122(0x9a),_0x1fe5bd;if(await fileExists(_0xf5fd14)){const _0x5014eb=await readFile(_0xf5fd14,_0x4ce122(0x92));isEquivalentPulledSqlFile(_0x5014eb,_0x219b75,_0x6325d2)?(_0x1b6946=_0x4ce122(0x81),_0x1fe5bd=_0x4ce122(0xad)):(_0x1b6946=_0x4ce122(0xa5),_0x1fe5bd=_0x4ce122(0xaa));}_0x2e4568['push']({'sqlCode':_0x33c4a1[_0x4ce122(0x99)],'sqlName':_0x33c4a1[_0x4ce122(0xa8)],'filePath':_0xf5fd14,'status':_0x1b6946,'reason':_0x1fe5bd});}return{'method':_0x4ce122(0x8e),'url':_0x4ce122(0xb7),'body':{'appCode':_0x4f20b5[_0x4ce122(0x89)],'sqlCode':_0x4f20b5[_0x4ce122(0x8d)](_0x4ce122(0x9c))||null,'sqlName':_0x4f20b5['str']('name')||null,'files':_0x2e4568},'description':'Would\x20pull\x20'+_0x2e4568['length']+_0x4ce122(0xa2)+_0x15e227[_0x4ce122(0x95)]};},async 'execute'(_0x5d2fd1){const _0x53522f=a128_0x441d12,_0x702dd0=loadSqlProjectConfig(_0x5d2fd1[_0x53522f(0x89)]),_0x491bfa=await readSqlLockFile(_0x702dd0[_0x53522f(0x91)]),{lockData:_0x313632,appLock:_0x9e7b9a}=ensureSqlLockScope(_0x491bfa??createEmptySqlLock(),_0x702dd0[_0x53522f(0x89)],_0x702dd0[_0x53522f(0xba)],_0x53522f(0xb2)),_0x35ffc3=_0x5d2fd1['bool'](_0x53522f(0xb8)),_0x54115c=await fetchAllSqlQueries(_0x5d2fd1[_0x53522f(0x89)],{'sqlCode':_0x5d2fd1[_0x53522f(0x8d)](_0x53522f(0x9c))||undefined,'sqlName':_0x5d2fd1[_0x53522f(0x8d)](_0x53522f(0xa6))||undefined});if(_0x54115c[_0x53522f(0xaf)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x53522f(0x98)};const _0x41da6c=[],_0xfc339f=[];for(const _0x1c5217 of _0x54115c){try{_0x41da6c[_0x53522f(0xa3)](await ensureSqlContent(_0x1c5217));}catch(_0x355bdd){_0xfc339f[_0x53522f(0xa3)]({'sqlCode':_0x1c5217[_0x53522f(0x99)],'error':_0x355bdd instanceof Error?_0x355bdd[_0x53522f(0xa1)]:String(_0x355bdd)});}}if(_0x35ffc3&&!_0x5d2fd1[_0x53522f(0x9f)]){let _0x1daa23=![];for(const _0x1dd56d of _0x41da6c){const _0x522eb8=detectModeFromSql(_0x1dd56d),_0x3b83fb=_0x1dd56d['dbId']?await getDbName(_0x5d2fd1['appCode'],Number(_0x1dd56d[_0x53522f(0xab)]))[_0x53522f(0x9e)](()=>undefined):undefined,_0xb2c263=buildLocalSqlFileContent({'sqlCode':_0x1dd56d[_0x53522f(0x99)],'sqlName':_0x1dd56d[_0x53522f(0xa8)],'dbId':_0x1dd56d['dbId']},ensureRemoteSqlContent(_0x1dd56d),{'dbName':_0x3b83fb,'mode':_0x522eb8,'syncedAt':new Date()['toISOString'](),'description':_0x1dd56d['description']}),_0xb29569=resolveLocalSqlFilePath(_0x702dd0,_0x1dd56d[_0x53522f(0x99)],buildSqlLockEntry(_0x1dd56d,ensureRemoteSqlContent(_0x1dd56d),'',{'dbName':_0x3b83fb}));if(await fileExists(_0xb29569)){const _0x243b42=await readFile(_0xb29569,_0x53522f(0x92));if(!isEquivalentPulledSqlFile(_0x243b42,_0xb2c263,_0x522eb8)){_0x1daa23=!![];break;}}}if(_0x1daa23){const _0x4fdb74=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x4fdb74)throw CliErrors['cancelled'](_0x53522f(0x82));}}const _0xdd64ce=cloneSqlLockData(_0x313632),_0x3aecf4=_0xdd64ce[_0x53522f(0xb3)][_0x702dd0[_0x53522f(0x89)]],_0x67eed7=[],_0x29ef4e=[];for(const _0x5e1f5b of _0x41da6c){const _0x47b743=_0x3aecf4['sqls'][_0x5e1f5b[_0x53522f(0x99)]],_0x323de9=ensureRemoteSqlContent(_0x5e1f5b),_0x4b1eb6=detectModeFromSql(_0x5e1f5b),_0x22a984=_0x5e1f5b[_0x53522f(0xab)]?await getDbName(_0x5d2fd1[_0x53522f(0x89)],Number(_0x5e1f5b[_0x53522f(0xab)]))[_0x53522f(0x9e)](()=>undefined):undefined,_0x108eca=buildLocalSqlFileContent({'sqlCode':_0x5e1f5b[_0x53522f(0x99)],'sqlName':_0x5e1f5b['sqlName'],'dbId':_0x5e1f5b[_0x53522f(0xab)]},_0x323de9,{'dbName':_0x22a984,'mode':_0x4b1eb6,'syncedAt':new Date()[_0x53522f(0xb0)](),'description':_0x5e1f5b[_0x53522f(0x90)]}),_0x43e550=buildSqlLockEntry(_0x5e1f5b,_0x323de9,computeSqlContentHash(_0x108eca),{'dbName':_0x22a984}),_0x133071=_0x43e550['path'],_0x45b4a9=join(_0x702dd0['sqlRootDir'],_0x133071);try{if(await fileExists(_0x45b4a9)){const _0x513bc7=await readFile(_0x45b4a9,_0x53522f(0x92));if(isEquivalentPulledSqlFile(_0x513bc7,_0x108eca,_0x4b1eb6)){_0x29ef4e[_0x53522f(0xa3)]({'sqlCode':_0x5e1f5b['sqlCode'],'reason':'unchanged'}),_0x3aecf4[_0x53522f(0x88)][_0x5e1f5b[_0x53522f(0x99)]]={..._0x43e550,'hash':computeSqlContentHash(_0x513bc7),'path':_0x133071};continue;}if(!_0x35ffc3){_0x29ef4e[_0x53522f(0xa3)]({'sqlCode':_0x5e1f5b['sqlCode'],'reason':_0x53522f(0x97)});continue;}}const _0x2cc351=_0x47b743?.[_0x53522f(0x84)]?join(_0x702dd0[_0x53522f(0x95)],_0x47b743[_0x53522f(0x84)]):undefined;_0x2cc351&&_0x2cc351!==_0x45b4a9&&await fileExists(_0x2cc351)&&await rm(_0x2cc351,{'force':!![]}),await ensureParentDirectory(_0x45b4a9),await writeFile(_0x45b4a9,_0x108eca,_0x53522f(0x92)),_0x3aecf4[_0x53522f(0x88)][_0x5e1f5b['sqlCode']]={..._0x43e550,'path':_0x133071},_0x67eed7[_0x53522f(0xa3)]({'sqlCode':_0x5e1f5b['sqlCode'],'filePath':_0x45b4a9});}catch(_0x23c7f5){_0xfc339f[_0x53522f(0xa3)]({'sqlCode':_0x5e1f5b[_0x53522f(0x99)],'error':_0x23c7f5 instanceof Error?_0x23c7f5[_0x53522f(0xa1)]:String(_0x23c7f5)});}}return _0x3aecf4[_0x53522f(0x96)]=new Date()[_0x53522f(0xb0)](),await writeSqlLockFile(_0x702dd0['lockFilePath'],_0xdd64ce),{'ok':_0xfc339f['length']===0x0,'data':{'pulled':_0x67eed7,'skipped':_0x29ef4e,'failed':_0xfc339f},'message':'Pull\x20complete:\x20'+_0x67eed7[_0x53522f(0xaf)]+_0x53522f(0xa0)+_0x29ef4e['length']+'\x20skipped,\x20'+_0xfc339f[_0x53522f(0xaf)]+_0x53522f(0xb4)};}};function detectModeFromSql(_0x369098){const _0x4a1a2d=a128_0x441d12,_0x1fb84b=ensureRemoteSqlContent(_0x369098),_0x1275be=stripLocalSqlMetadata(_0x1fb84b,'mybatisXml')['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x4a1a2d(0xbb)](_0x1275be))return _0x4a1a2d(0xb5);return _0x4a1a2d(0x86);}function isEquivalentPulledSqlFile(_0x3769ab,_0x9a2677,_0x5abc9c){return normalizePullComparableContent(_0x3769ab,_0x5abc9c)===normalizePullComparableContent(_0x9a2677,_0x5abc9c);}function normalizePullComparableContent(_0x5e5b9a,_0x17a93d){const _0x3e7794=a128_0x441d12,_0xb0d3f1=_0x5e5b9a[_0x3e7794(0xbc)](/\r\n/g,'\x0a')[_0x3e7794(0xa4)]('\x0a'),_0x488f03=_0xb0d3f1[_0x3e7794(0x9d)](_0x35eb81=>!isSyncedAtMetadataLine(_0x35eb81,_0x17a93d));return _0x488f03[_0x3e7794(0x85)]('\x0a');}function isSyncedAtMetadataLine(_0x24d38b,_0x1f194b){const _0x595d4f=a128_0x441d12;if(_0x1f194b===_0x595d4f(0xb5))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x595d4f(0xbb)](_0x24d38b);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x24d38b);}
@@ -1 +1 @@
1
- const a129_0x4a4dc8=a129_0x57c1;(function(_0x362b97,_0x46f2ea){const _0x53cfdd=a129_0x57c1,_0x10d611=_0x362b97();while(!![]){try{const _0xab6f01=parseInt(_0x53cfdd(0x11f))/0x1*(parseInt(_0x53cfdd(0x105))/0x2)+parseInt(_0x53cfdd(0x113))/0x3+parseInt(_0x53cfdd(0x131))/0x4*(-parseInt(_0x53cfdd(0x141))/0x5)+parseInt(_0x53cfdd(0x10a))/0x6*(parseInt(_0x53cfdd(0x134))/0x7)+-parseInt(_0x53cfdd(0x140))/0x8*(parseInt(_0x53cfdd(0x130))/0x9)+parseInt(_0x53cfdd(0x11d))/0xa+-parseInt(_0x53cfdd(0x11e))/0xb*(parseInt(_0x53cfdd(0x10d))/0xc);if(_0xab6f01===_0x46f2ea)break;else _0x10d611['push'](_0x10d611['shift']());}catch(_0x53a072){_0x10d611['push'](_0x10d611['shift']());}}}(a129_0x3279,0x2db63));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x4bd7e6,_0xee16b,_0x1b7494){const _0x21f780=a129_0x57c1,_0x296b38=await scanLocalSqlQueries(_0x4bd7e6),_0x3ff6b8=new Map();for(const _0x3eeb95 of _0x296b38){if(_0x1b7494&&_0x3eeb95[_0x21f780(0x115)]!==_0x1b7494)continue;const _0x576c94=_0x3ff6b8[_0x21f780(0x11a)](_0x3eeb95[_0x21f780(0x115)])??[];_0x576c94[_0x21f780(0x11b)](_0x3eeb95),_0x3ff6b8['set'](_0x3eeb95['sqlCode'],_0x576c94);}if(_0x1b7494&&!_0x3ff6b8[_0x21f780(0x13f)](_0x1b7494))throw CliErrors[_0x21f780(0x129)](_0x21f780(0x142)+_0x1b7494);const _0x2a604a=[];for(const [_0x5ab814,_0x4fa619]of _0x3ff6b8[_0x21f780(0x128)]()){if(_0x4fa619[_0x21f780(0x117)]===0x1){_0x2a604a['push'](_0x4fa619[0x0]);continue;}const _0x2b41b3=_0xee16b[_0x21f780(0x12f)][_0x5ab814],_0x9265bd=_0x2b41b3?.[_0x21f780(0x107)],_0x5f1e58=_0x9265bd?_0x4fa619['filter'](_0x572870=>_0x572870[_0x21f780(0x106)]!==_0x9265bd):_0x4fa619;if(_0x2b41b3&&_0x5f1e58[_0x21f780(0x117)]===0x1){_0x2a604a[_0x21f780(0x11b)](_0x5f1e58[0x0]);continue;}throw CliErrors[_0x21f780(0x129)](_0x21f780(0x10b)+_0x5ab814+_0x21f780(0x138));}return _0x2a604a;}function a129_0x57c1(_0x1e0b5a,_0x42b369){_0x1e0b5a=_0x1e0b5a-0x103;const _0x3279c9=a129_0x3279();let _0x57c1cb=_0x3279c9[_0x1e0b5a];return _0x57c1cb;}export const sqlPush={'service':a129_0x4a4dc8(0x10e),'command':a129_0x4a4dc8(0x11b),'description':a129_0x4a4dc8(0x135),'risk':a129_0x4a4dc8(0x13c),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a129_0x4a4dc8(0x12a),'type':a129_0x4a4dc8(0x112),'description':a129_0x4a4dc8(0x12e)}],async 'dryRun'(_0x1e87dd){const _0x12aa54=a129_0x4a4dc8,_0x72082e=loadSqlProjectConfig(_0x1e87dd[_0x12aa54(0x124)]),_0x329ab8=await readSqlLockFile(_0x72082e[_0x12aa54(0x126)]),{appLock:_0x1f27ad}=ensureSqlLockScope(_0x329ab8??createEmptySqlLock(),_0x1e87dd['appCode'],_0x72082e['sqlRoot'],_0x12aa54(0x11b)),_0x505428=await getTargetSqlQueries(_0x72082e,_0x1f27ad,_0x1e87dd[_0x12aa54(0x125)]('sqlcode')||undefined),_0x31c9f9=[];for(const _0x3115e5 of _0x505428){const _0x1d219c=await computeSqlFileHash(_0x3115e5[_0x12aa54(0x119)]),_0x2422a0=_0x1f27ad[_0x12aa54(0x12f)][_0x3115e5[_0x12aa54(0x115)]],_0x398373=!!_0x2422a0&&(_0x2422a0[_0x12aa54(0x107)]!==_0x3115e5[_0x12aa54(0x106)]||!!_0x3115e5['sqlName']&&_0x2422a0[_0x12aa54(0x109)]!==_0x3115e5[_0x12aa54(0x109)]);if(!_0x1e87dd[_0x12aa54(0x110)](_0x12aa54(0x12a))&&_0x2422a0&&_0x2422a0[_0x12aa54(0x123)]===_0x1d219c&&!_0x398373)continue;_0x31c9f9[_0x12aa54(0x11b)](_0x3115e5[_0x12aa54(0x115)]);}return{'method':_0x12aa54(0x104),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x31c9f9,'appCode':_0x1e87dd[_0x12aa54(0x124)]},'description':_0x12aa54(0x13d)+_0x31c9f9[_0x12aa54(0x117)]+_0x12aa54(0x144)};},async 'execute'(_0x209359){const _0x4933da=a129_0x4a4dc8,_0x4cd1a0=loadSqlProjectConfig(_0x209359[_0x4933da(0x124)]),_0x3a5f83=await readSqlLockFile(_0x4cd1a0[_0x4933da(0x126)]),{lockData:_0x44349b,appLock:_0x5f41d4}=ensureSqlLockScope(_0x3a5f83??createEmptySqlLock(),_0x209359['appCode'],_0x4cd1a0['sqlRoot'],_0x4933da(0x11b)),_0x3ba563=await getTargetSqlQueries(_0x4cd1a0,_0x5f41d4,_0x209359[_0x4933da(0x125)](_0x4933da(0x13e))||undefined);if(_0x3ba563[_0x4933da(0x117)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x3d56ac=[],_0x51d611=[],_0x71952f=[];for(const _0x20cdf0 of _0x3ba563){const _0x177c93=_0x5f41d4[_0x4933da(0x12f)][_0x20cdf0['sqlCode']];if(!_0x177c93){_0x71952f[_0x4933da(0x11b)]({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x1a1c8e=await computeSqlFileHash(_0x20cdf0[_0x4933da(0x119)]),_0x47c081=_0x177c93[_0x4933da(0x107)]!==_0x20cdf0['relativePath']||!!_0x20cdf0['sqlName']&&_0x177c93[_0x4933da(0x109)]!==_0x20cdf0[_0x4933da(0x109)];if(!_0x209359[_0x4933da(0x110)]('force')&&_0x177c93[_0x4933da(0x123)]===_0x1a1c8e&&!_0x47c081){_0x51d611['push']({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'reason':_0x4933da(0x122)});continue;}if(_0x177c93[_0x4933da(0x111)]==null){_0x71952f[_0x4933da(0x11b)]({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'error':_0x4933da(0x137)});continue;}const _0x3cd5d3=await readFile(_0x20cdf0[_0x4933da(0x119)],'utf8'),_0xa1398a=stripLocalSqlMetadata(_0x3cd5d3,_0x20cdf0['mode']),_0x9534f=_0x20cdf0['sqlName']||_0x177c93[_0x4933da(0x109)],_0x337406=await resolveTargetDbBinding(_0x209359[_0x4933da(0x124)],_0x20cdf0,_0x177c93),_0x5944a2=await updateSqlQuery({'id':_0x177c93[_0x4933da(0x108)],'appCode':_0x209359[_0x4933da(0x124)],'sqlCode':_0x20cdf0[_0x4933da(0x115)],'sqlName':_0x9534f,'dbId':_0x337406[_0x4933da(0x10c)],'version':_0x177c93[_0x4933da(0x111)],'sqlContent':_0xa1398a,'sqlConfig':_0x177c93[_0x4933da(0x11c)]??undefined}),_0x106a1b=_0x5944a2[_0x4933da(0x10c)]?await getDbName(_0x209359['appCode'],Number(_0x5944a2['dbId']))[_0x4933da(0x103)](()=>_0x337406['dbName']):_0x337406[_0x4933da(0x133)];_0x5f41d4[_0x4933da(0x12f)][_0x20cdf0[_0x4933da(0x115)]]={...buildSqlLockEntry(_0x5944a2,_0xa1398a,_0x1a1c8e,{'dbName':_0x106a1b}),'path':_0x20cdf0['relativePath'],'mode':_0x177c93['mode']},await archivePreviousSqlFileIfNeeded(_0x4cd1a0,_0x177c93[_0x4933da(0x107)],_0x20cdf0[_0x4933da(0x106)]),_0x3d56ac['push']({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'remoteId':_0x177c93[_0x4933da(0x108)]});}catch(_0x37874d){_0x71952f[_0x4933da(0x11b)]({'sqlCode':_0x20cdf0[_0x4933da(0x115)],'error':_0x37874d instanceof Error?_0x37874d['message']:String(_0x37874d)});}}return _0x5f41d4[_0x4933da(0x143)]=new Date()[_0x4933da(0x127)](),await writeSqlLockFile(_0x4cd1a0[_0x4933da(0x126)],_0x44349b),{'ok':_0x71952f[_0x4933da(0x117)]===0x0,'data':{'pushed':_0x3d56ac,'skipped':_0x51d611,'failed':_0x71952f},'message':'Push\x20complete:\x20'+_0x3d56ac[_0x4933da(0x117)]+_0x4933da(0x13a)+_0x51d611['length']+_0x4933da(0x12b)+_0x71952f[_0x4933da(0x117)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x584449,_0x41b9cf,_0x3abad5){const _0x4b4f96=a129_0x4a4dc8;if(!_0x41b9cf||_0x41b9cf===_0x3abad5)return;const _0x26e636=join(_0x584449[_0x4b4f96(0x136)],_0x41b9cf);if(!await fileExists(_0x26e636))return;const _0x13faf1=await moveToTrash(_0x584449[_0x4b4f96(0x10f)],_0x584449['trashDir'],_0x26e636);await cleanupEmptyDirectories(dirname(_0x26e636),_0x584449[_0x4b4f96(0x136)]),void _0x13faf1;}async function moveToTrash(_0x577e29,_0x47f4f1,_0x15815d){const _0xce056a=a129_0x4a4dc8,_0x2aefbf=new Date()[_0xce056a(0x127)]()[_0xce056a(0x12d)](/[:.]/g,'-'),_0x1c48e5=relative(_0x577e29,_0x15815d),_0x56f712=join(_0x47f4f1,_0x2aefbf,_0x1c48e5);return await mkdir(dirname(_0x56f712),{'recursive':!![]}),await rename(_0x15815d,_0x56f712),_0x56f712;}async function cleanupEmptyDirectories(_0x49cbe6,_0x37ba7e){const _0x2a6aef=a129_0x4a4dc8;let _0x54d4be=resolve(_0x49cbe6);const _0x5a4617=resolve(_0x37ba7e);while(_0x54d4be['startsWith'](''+_0x5a4617+sep)||_0x54d4be===_0x5a4617){if(_0x54d4be===_0x5a4617)return;try{const _0xc0ce00=await readdir(_0x54d4be);if(_0xc0ce00[_0x2a6aef(0x117)]>0x0)return;await rmdir(_0x54d4be);}catch{return;}_0x54d4be=dirname(_0x54d4be);}}function a129_0x3279(){const _0xcd02a2=['Local\x20SQL\x20not\x20found:\x20','lastSync','\x20SQL\x20file(s)','catch','POST','2rRiOTt','relativePath','path','remoteId','sqlName','252RTptJH','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','dbId','1968Kivowl','sql','projectRoot','bool','version','boolean','385233gVuaDo','filter','sqlCode','dbDirectory','length','map','filePath','get','push','sqlConfig','2434330jTqqjh','17699JmTqRi','319433FLNGgD','Local\x20directory\x20\x22','join','unchanged','hash','appCode','str','lockFilePath','toISOString','entries','validation','force','\x20skipped,\x20','\x22\x20for\x20sqlCode\x20','replace','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','sqls','3573OZreCv','546008zzItQs','exec','dbName','40817ieGByb','Push\x20local\x20SQL\x20files\x20to\x20remote','sqlRootDir','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','\x20pushed,\x20','No\x20database\x20matches\x20local\x20directory\x20\x22','high-risk-write','Would\x20push\x20','sqlcode','has','7024oDbiNe','5FsOYsA'];a129_0x3279=function(){return _0xcd02a2;};return a129_0x3279();}async function resolveTargetDbBinding(_0x137bd9,_0x2e0c18,_0x3eb998){const _0x30acd4=a129_0x4a4dc8,_0xc1bc91=_0x2e0c18[_0x30acd4(0x116)];if(!_0xc1bc91)return{'dbId':_0x3eb998[_0x30acd4(0x10c)],'dbName':_0x3eb998[_0x30acd4(0x133)]};const _0x20d776=buildDbDirectoryName(_0x3eb998['dbName'],_0x3eb998[_0x30acd4(0x10c)]);if(_0xc1bc91===_0x20d776)return{'dbId':_0x3eb998[_0x30acd4(0x10c)],'dbName':_0x3eb998['dbName']};const _0x304b02=parseExplicitDbDirectory(_0xc1bc91);if(_0x304b02!=null)return{'dbId':_0x304b02,'dbName':await getDbName(_0x137bd9,_0x304b02)[_0x30acd4(0x103)](()=>undefined)};const _0x72c761=await listDatabases(_0x137bd9),_0x273be6=_0x72c761[_0x30acd4(0x114)](_0x5e7901=>buildDbDirectoryName(_0x5e7901[_0x30acd4(0x133)],_0x5e7901['dbId'])===_0xc1bc91);if(_0x273be6[_0x30acd4(0x117)]===0x1)return{'dbId':_0x273be6[0x0][_0x30acd4(0x10c)],'dbName':_0x273be6[0x0][_0x30acd4(0x133)]};if(_0x273be6[_0x30acd4(0x117)]===0x0)throw CliErrors[_0x30acd4(0x129)](_0x30acd4(0x13b)+_0xc1bc91+_0x30acd4(0x12c)+_0x2e0c18[_0x30acd4(0x115)]+'.');const _0x35438a=_0x273be6[_0x30acd4(0x118)](_0xf8b37c=>_0xf8b37c[_0x30acd4(0x133)]+'\x20('+_0xf8b37c['dbId']+')')[_0x30acd4(0x121)](',\x20');throw CliErrors[_0x30acd4(0x129)](_0x30acd4(0x120)+_0xc1bc91+_0x30acd4(0x139)+_0x2e0c18['sqlCode']+':\x20'+_0x35438a);}function parseExplicitDbDirectory(_0x166ec1){const _0x2b681e=a129_0x4a4dc8,_0x52221e=/^db-(\d+)$/[_0x2b681e(0x132)](_0x166ec1);if(!_0x52221e)return null;const _0x1948c2=Number(_0x52221e[0x1]);return Number['isFinite'](_0x1948c2)&&_0x1948c2>0x0?_0x1948c2:null;}
1
+ const a129_0x5c1252=a129_0x12e4;(function(_0x1bac51,_0x2f73da){const _0x3ddd33=a129_0x12e4,_0x53ed96=_0x1bac51();while(!![]){try{const _0xeb6d2=parseInt(_0x3ddd33(0x1a4))/0x1*(-parseInt(_0x3ddd33(0x1b7))/0x2)+-parseInt(_0x3ddd33(0x197))/0x3+-parseInt(_0x3ddd33(0x1ad))/0x4+-parseInt(_0x3ddd33(0x1d0))/0x5*(parseInt(_0x3ddd33(0x196))/0x6)+parseInt(_0x3ddd33(0x1c8))/0x7*(-parseInt(_0x3ddd33(0x1c2))/0x8)+-parseInt(_0x3ddd33(0x1c6))/0x9+parseInt(_0x3ddd33(0x1ce))/0xa;if(_0xeb6d2===_0x2f73da)break;else _0x53ed96['push'](_0x53ed96['shift']());}catch(_0x4b5f0b){_0x53ed96['push'](_0x53ed96['shift']());}}}(a129_0x2e77,0x26783));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0xdd8533,_0x975d80,_0x499635){const _0x457623=a129_0x12e4,_0x55b5cd=await scanLocalSqlQueries(_0xdd8533),_0x160f47=new Map();for(const _0x26b840 of _0x55b5cd){if(_0x499635&&_0x26b840['sqlCode']!==_0x499635)continue;const _0x57b39a=_0x160f47[_0x457623(0x1a0)](_0x26b840['sqlCode'])??[];_0x57b39a[_0x457623(0x1ae)](_0x26b840),_0x160f47[_0x457623(0x190)](_0x26b840[_0x457623(0x1ab)],_0x57b39a);}if(_0x499635&&!_0x160f47[_0x457623(0x18e)](_0x499635))throw CliErrors[_0x457623(0x1b0)](_0x457623(0x1a3)+_0x499635);const _0x4daff0=[];for(const [_0x134c6c,_0x1fbe87]of _0x160f47[_0x457623(0x1aa)]()){if(_0x1fbe87[_0x457623(0x1cf)]===0x1){_0x4daff0[_0x457623(0x1ae)](_0x1fbe87[0x0]);continue;}const _0x2d6a40=_0x975d80[_0x457623(0x18c)][_0x134c6c],_0x521d3a=_0x2d6a40?.[_0x457623(0x19f)],_0x15530a=_0x521d3a?_0x1fbe87[_0x457623(0x1a1)](_0x591c95=>_0x591c95[_0x457623(0x1ca)]!==_0x521d3a):_0x1fbe87;if(_0x2d6a40&&_0x15530a[_0x457623(0x1cf)]===0x1){_0x4daff0['push'](_0x15530a[0x0]);continue;}throw CliErrors[_0x457623(0x1b0)](_0x457623(0x1b2)+_0x134c6c+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x4daff0;}export const sqlPush={'service':a129_0x5c1252(0x1c9),'command':a129_0x5c1252(0x1ae),'description':a129_0x5c1252(0x1d1),'risk':a129_0x5c1252(0x1af),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a129_0x5c1252(0x1bb),'type':a129_0x5c1252(0x19c),'description':a129_0x5c1252(0x1b6)}],async 'dryRun'(_0x1741c8){const _0x588da6=a129_0x5c1252,_0x455862=loadSqlProjectConfig(_0x1741c8['appCode']),_0x232eab=await readSqlLockFile(_0x455862[_0x588da6(0x1cc)]),{appLock:_0x21bad8}=ensureSqlLockScope(_0x232eab??createEmptySqlLock(),_0x1741c8[_0x588da6(0x18a)],_0x455862[_0x588da6(0x1c7)],_0x588da6(0x1ae)),_0x36137f=await getTargetSqlQueries(_0x455862,_0x21bad8,_0x1741c8[_0x588da6(0x189)](_0x588da6(0x1b1))||undefined),_0x51d82e=[];for(const _0x454ee6 of _0x36137f){const _0x3d86cc=await computeSqlFileHash(_0x454ee6[_0x588da6(0x198)]),_0x1694a0=_0x21bad8[_0x588da6(0x18c)][_0x454ee6[_0x588da6(0x1ab)]],_0x424e1f=!!_0x1694a0&&(_0x1694a0[_0x588da6(0x19f)]!==_0x454ee6[_0x588da6(0x1ca)]||!!_0x454ee6[_0x588da6(0x1b9)]&&_0x1694a0[_0x588da6(0x1b9)]!==_0x454ee6[_0x588da6(0x1b9)]);if(!_0x1741c8[_0x588da6(0x1b4)](_0x588da6(0x1bb))&&_0x1694a0&&_0x1694a0[_0x588da6(0x194)]===_0x3d86cc&&!_0x424e1f)continue;_0x51d82e[_0x588da6(0x1ae)](_0x454ee6['sqlCode']);}return{'method':_0x588da6(0x1bc),'url':_0x588da6(0x1a9),'body':{'sqlCodes':_0x51d82e,'appCode':_0x1741c8['appCode']},'description':_0x588da6(0x1bf)+_0x51d82e[_0x588da6(0x1cf)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x4ab478){const _0xb5e8cc=a129_0x5c1252,_0x2fec91=loadSqlProjectConfig(_0x4ab478[_0xb5e8cc(0x18a)]),_0x21f3b7=await readSqlLockFile(_0x2fec91[_0xb5e8cc(0x1cc)]),{lockData:_0x1781c9,appLock:_0xbe3ad4}=ensureSqlLockScope(_0x21f3b7??createEmptySqlLock(),_0x4ab478[_0xb5e8cc(0x18a)],_0x2fec91[_0xb5e8cc(0x1c7)],_0xb5e8cc(0x1ae)),_0x4cd6c3=await getTargetSqlQueries(_0x2fec91,_0xbe3ad4,_0x4ab478[_0xb5e8cc(0x189)](_0xb5e8cc(0x1b1))||undefined);if(_0x4cd6c3[_0xb5e8cc(0x1cf)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xb5e8cc(0x1c0)};const _0x57e800=[],_0x2e4265=[],_0x5115ca=[];for(const _0x2b432f of _0x4cd6c3){const _0xab24bd=_0xbe3ad4['sqls'][_0x2b432f['sqlCode']];if(!_0xab24bd){_0x5115ca[_0xb5e8cc(0x1ae)]({'sqlCode':_0x2b432f[_0xb5e8cc(0x1ab)],'error':_0xb5e8cc(0x1be)});continue;}try{const _0x181ae1=await computeSqlFileHash(_0x2b432f[_0xb5e8cc(0x198)]),_0x2395fd=_0xab24bd[_0xb5e8cc(0x19f)]!==_0x2b432f[_0xb5e8cc(0x1ca)]||!!_0x2b432f[_0xb5e8cc(0x1b9)]&&_0xab24bd[_0xb5e8cc(0x1b9)]!==_0x2b432f[_0xb5e8cc(0x1b9)];if(!_0x4ab478[_0xb5e8cc(0x1b4)](_0xb5e8cc(0x1bb))&&_0xab24bd[_0xb5e8cc(0x194)]===_0x181ae1&&!_0x2395fd){_0x2e4265[_0xb5e8cc(0x1ae)]({'sqlCode':_0x2b432f[_0xb5e8cc(0x1ab)],'reason':_0xb5e8cc(0x1b3)});continue;}if(_0xab24bd[_0xb5e8cc(0x19e)]==null){_0x5115ca[_0xb5e8cc(0x1ae)]({'sqlCode':_0x2b432f[_0xb5e8cc(0x1ab)],'error':_0xb5e8cc(0x193)});continue;}const _0x1f781a=await readFile(_0x2b432f[_0xb5e8cc(0x198)],_0xb5e8cc(0x1a5)),_0x59b621=stripLocalSqlMetadata(_0x1f781a,_0x2b432f[_0xb5e8cc(0x1b8)]),_0x24ea21=_0x2b432f[_0xb5e8cc(0x1b9)]||_0xab24bd['sqlName'],_0xe6e18b=await resolveTargetDbBinding(_0x4ab478['appCode'],_0x2b432f,_0xab24bd),_0x332261=await updateSqlQuery({'id':_0xab24bd[_0xb5e8cc(0x18b)],'appCode':_0x4ab478[_0xb5e8cc(0x18a)],'sqlCode':_0x2b432f['sqlCode'],'sqlName':_0x24ea21,'dbId':_0xe6e18b[_0xb5e8cc(0x1ba)],'version':_0xab24bd[_0xb5e8cc(0x19e)],'sqlContent':_0x59b621,'sqlConfig':_0xab24bd[_0xb5e8cc(0x1c1)]??undefined}),_0x499c40=_0x332261['dbId']?await getDbName(_0x4ab478[_0xb5e8cc(0x18a)],Number(_0x332261['dbId']))[_0xb5e8cc(0x1ac)](()=>_0xe6e18b[_0xb5e8cc(0x191)]):_0xe6e18b[_0xb5e8cc(0x191)];_0xbe3ad4[_0xb5e8cc(0x18c)][_0x2b432f[_0xb5e8cc(0x1ab)]]={...buildSqlLockEntry(_0x332261,_0x59b621,_0x181ae1,{'dbName':_0x499c40}),'path':_0x2b432f[_0xb5e8cc(0x1ca)],'mode':_0xab24bd['mode']},await archivePreviousSqlFileIfNeeded(_0x2fec91,_0xab24bd['path'],_0x2b432f[_0xb5e8cc(0x1ca)]),_0x57e800[_0xb5e8cc(0x1ae)]({'sqlCode':_0x2b432f[_0xb5e8cc(0x1ab)],'remoteId':_0xab24bd['remoteId']});}catch(_0x221a17){_0x5115ca[_0xb5e8cc(0x1ae)]({'sqlCode':_0x2b432f[_0xb5e8cc(0x1ab)],'error':_0x221a17 instanceof Error?_0x221a17[_0xb5e8cc(0x1a7)]:String(_0x221a17)});}}return _0xbe3ad4[_0xb5e8cc(0x199)]=new Date()[_0xb5e8cc(0x1cd)](),await writeSqlLockFile(_0x2fec91['lockFilePath'],_0x1781c9),{'ok':_0x5115ca[_0xb5e8cc(0x1cf)]===0x0,'data':{'pushed':_0x57e800,'skipped':_0x2e4265,'failed':_0x5115ca},'message':_0xb5e8cc(0x1a6)+_0x57e800['length']+'\x20pushed,\x20'+_0x2e4265[_0xb5e8cc(0x1cf)]+'\x20skipped,\x20'+_0x5115ca['length']+_0xb5e8cc(0x19b)};}};async function archivePreviousSqlFileIfNeeded(_0x5d2de2,_0x4ea180,_0x558a80){const _0x30f551=a129_0x5c1252;if(!_0x4ea180||_0x4ea180===_0x558a80)return;const _0x281f5e=join(_0x5d2de2[_0x30f551(0x18d)],_0x4ea180);if(!await fileExists(_0x281f5e))return;const _0x1cdf25=await moveToTrash(_0x5d2de2[_0x30f551(0x1a2)],_0x5d2de2[_0x30f551(0x1b5)],_0x281f5e);await cleanupEmptyDirectories(dirname(_0x281f5e),_0x5d2de2['sqlRootDir']),void _0x1cdf25;}async function moveToTrash(_0x47a974,_0x15d16c,_0x506062){const _0x2a82e3=a129_0x5c1252,_0x393785=new Date()['toISOString']()[_0x2a82e3(0x1cb)](/[:.]/g,'-'),_0x58beee=relative(_0x47a974,_0x506062),_0x51dc86=join(_0x15d16c,_0x393785,_0x58beee);return await mkdir(dirname(_0x51dc86),{'recursive':!![]}),await rename(_0x506062,_0x51dc86),_0x51dc86;}async function cleanupEmptyDirectories(_0x214ed4,_0x2a0f8e){const _0x12a9f3=a129_0x5c1252;let _0x48566a=resolve(_0x214ed4);const _0x56435f=resolve(_0x2a0f8e);while(_0x48566a[_0x12a9f3(0x1bd)](''+_0x56435f+sep)||_0x48566a===_0x56435f){if(_0x48566a===_0x56435f)return;try{const _0x1b8c26=await readdir(_0x48566a);if(_0x1b8c26[_0x12a9f3(0x1cf)]>0x0)return;await rmdir(_0x48566a);}catch{return;}_0x48566a=dirname(_0x48566a);}}async function resolveTargetDbBinding(_0x1d4d9b,_0x8ac4ad,_0x4d181a){const _0x1b3840=a129_0x5c1252,_0x596387=_0x8ac4ad[_0x1b3840(0x1c5)];if(!_0x596387)return{'dbId':_0x4d181a['dbId'],'dbName':_0x4d181a[_0x1b3840(0x191)]};const _0xda734=buildDbDirectoryName(_0x4d181a[_0x1b3840(0x191)],_0x4d181a[_0x1b3840(0x1ba)]);if(_0x596387===_0xda734)return{'dbId':_0x4d181a[_0x1b3840(0x1ba)],'dbName':_0x4d181a[_0x1b3840(0x191)]};const _0x596eec=parseExplicitDbDirectory(_0x596387);if(_0x596eec!=null)return{'dbId':_0x596eec,'dbName':await getDbName(_0x1d4d9b,_0x596eec)[_0x1b3840(0x1ac)](()=>undefined)};const _0x5dea56=await listDatabases(_0x1d4d9b),_0x23e84c=_0x5dea56[_0x1b3840(0x1a1)](_0x2b1a9f=>buildDbDirectoryName(_0x2b1a9f[_0x1b3840(0x191)],_0x2b1a9f[_0x1b3840(0x1ba)])===_0x596387);if(_0x23e84c[_0x1b3840(0x1cf)]===0x1)return{'dbId':_0x23e84c[0x0][_0x1b3840(0x1ba)],'dbName':_0x23e84c[0x0]['dbName']};if(_0x23e84c[_0x1b3840(0x1cf)]===0x0)throw CliErrors[_0x1b3840(0x1b0)](_0x1b3840(0x1c4)+_0x596387+_0x1b3840(0x1c3)+_0x8ac4ad[_0x1b3840(0x1ab)]+'.');const _0x4064bf=_0x23e84c[_0x1b3840(0x19d)](_0x5a58db=>_0x5a58db[_0x1b3840(0x191)]+'\x20('+_0x5a58db[_0x1b3840(0x1ba)]+')')[_0x1b3840(0x19a)](',\x20');throw CliErrors[_0x1b3840(0x1b0)](_0x1b3840(0x18f)+_0x596387+_0x1b3840(0x192)+_0x8ac4ad[_0x1b3840(0x1ab)]+':\x20'+_0x4064bf);}function a129_0x2e77(){const _0x58a808=['unchanged','bool','trashDir','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','101526povHHS','mode','sqlName','dbId','force','POST','startsWith','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','Would\x20push\x20','No\x20local\x20SQL\x20files\x20found.','sqlConfig','8QBRMmq','\x22\x20for\x20sqlCode\x20','No\x20database\x20matches\x20local\x20directory\x20\x22','dbDirectory','1036359pYXuUe','sqlRoot','164017lgTROI','sql','relativePath','replace','lockFilePath','toISOString','6028290zBcEsO','length','51215PtiXLS','Push\x20local\x20SQL\x20files\x20to\x20remote','str','appCode','remoteId','sqls','sqlRootDir','has','Local\x20directory\x20\x22','set','dbName','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','hash','isFinite','12zlaeUt','141549RZUUFj','filePath','lastSync','join','\x20failed','boolean','map','version','path','get','filter','projectRoot','Local\x20SQL\x20not\x20found:\x20','3jPFPfU','utf8','Push\x20complete:\x20','message','exec','/smartapi/custom/updateUserCustomSql','entries','sqlCode','catch','346872ZOthxJ','push','high-risk-write','validation','sqlcode','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'];a129_0x2e77=function(){return _0x58a808;};return a129_0x2e77();}function a129_0x12e4(_0x2947cd,_0x5d99e4){_0x2947cd=_0x2947cd-0x189;const _0x2e77ed=a129_0x2e77();let _0x12e48a=_0x2e77ed[_0x2947cd];return _0x12e48a;}function parseExplicitDbDirectory(_0x597bda){const _0x321d7e=a129_0x5c1252,_0x3c1eb0=/^db-(\d+)$/[_0x321d7e(0x1a8)](_0x597bda);if(!_0x3c1eb0)return null;const _0xfb6bb0=Number(_0x3c1eb0[0x1]);return Number[_0x321d7e(0x195)](_0xfb6bb0)&&_0xfb6bb0>0x0?_0xfb6bb0:null;}
@@ -1 +1 @@
1
- function a130_0x58b9(){const _0x59b6a7=['3KfwAJf','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`.','887845KqOVTi','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','save','7440370BKQFVi','6RXAZwy','string','file','1880UTIQPe','1128762fciOuA','1439972uAmRAa','3593800UGyTSb','Query\x20description','Path\x20to\x20the\x20SQL\x20file','523811ETacVH','validation','SQL\x20query\x20display\x20name','16650zbYLWJ','sql','sqlname','write'];a130_0x58b9=function(){return _0x59b6a7;};return a130_0x58b9();}const a130_0x3b6da3=a130_0x50f8;(function(_0x4433dc,_0x37fa95){const _0x1d0096=a130_0x50f8,_0x3ec50f=_0x4433dc();while(!![]){try{const _0xa19456=-parseInt(_0x1d0096(0x6a))/0x1+parseInt(_0x1d0096(0x7b))/0x2+-parseInt(_0x1d0096(0x71))/0x3*(-parseInt(_0x1d0096(0x7c))/0x4)+-parseInt(_0x1d0096(0x73))/0x5*(-parseInt(_0x1d0096(0x77))/0x6)+-parseInt(_0x1d0096(0x67))/0x7+-parseInt(_0x1d0096(0x7a))/0x8*(parseInt(_0x1d0096(0x6d))/0x9)+parseInt(_0x1d0096(0x76))/0xa;if(_0xa19456===_0x37fa95)break;else _0x3ec50f['push'](_0x3ec50f['shift']());}catch(_0x5ddbb4){_0x3ec50f['push'](_0x3ec50f['shift']());}}}(a130_0x58b9,0x5b503));function a130_0x50f8(_0x37ca7a,_0x1fe3be){_0x37ca7a=_0x37ca7a-0x67;const _0x58b980=a130_0x58b9();let _0x50f8f2=_0x58b980[_0x37ca7a];return _0x50f8f2;}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.','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.',a130_0x3b6da3(0x72)]['join']('\x0a');export const sqlSave={'service':a130_0x3b6da3(0x6e),'command':a130_0x3b6da3(0x75),'description':a130_0x3b6da3(0x74),'risk':a130_0x3b6da3(0x70),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a130_0x3b6da3(0x79),'type':a130_0x3b6da3(0x78),'required':!![],'description':a130_0x3b6da3(0x69)},SQLCODE_FLAG_OPTIONAL,{'name':a130_0x3b6da3(0x6f),'type':a130_0x3b6da3(0x78),'description':a130_0x3b6da3(0x6c)},{'name':'db','type':'string','description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':'description','type':'string','description':a130_0x3b6da3(0x68)}],async 'validate'(){const _0x1669e8=a130_0x3b6da3;throw CliErrors[_0x1669e8(0x6b)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);}};
1
+ const a130_0x470860=a130_0x3dfd;(function(_0x3144b4,_0xe18012){const _0x18d559=a130_0x3dfd,_0x27feb9=_0x3144b4();while(!![]){try{const _0x47d267=-parseInt(_0x18d559(0x18a))/0x1+parseInt(_0x18d559(0x185))/0x2+-parseInt(_0x18d559(0x182))/0x3*(parseInt(_0x18d559(0x184))/0x4)+-parseInt(_0x18d559(0x18d))/0x5*(-parseInt(_0x18d559(0x186))/0x6)+-parseInt(_0x18d559(0x18e))/0x7+parseInt(_0x18d559(0x195))/0x8+parseInt(_0x18d559(0x183))/0x9;if(_0x47d267===_0xe18012)break;else _0x27feb9['push'](_0x27feb9['shift']());}catch(_0x2c7447){_0x27feb9['push'](_0x27feb9['shift']());}}}(a130_0xbd63,0xe1fa4));import{CliErrors}from'../../errors.js';function a130_0xbd63(){const _0xebb1fa=['sql','10jlBiWc','10750257SRciEq','string','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','join','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','Query\x20description','validation','120968SVqWLP','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','2199NFcjuw','38276424EMgLLe','6196KMZGbD','1202048OmEkGC','1527624VKKtMF','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','Path\x20to\x20the\x20SQL\x20file','Update\x20existing\x20SQL\x20by\x20editing\x20the\x20synced\x20file\x20under\x20`.rabetbase/sql/<appCode>/<dbName|db-<id>>/`\x20and\x20then\x20running\x20`rabetbase\x20sql\x20push\x20--sqlcode\x20<code>\x20--yes`.','1781517zPkcTu','description'];a130_0xbd63=function(){return _0xebb1fa;};return a130_0xbd63();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a130_0x3dfd(_0x4da1b2,_0x3e0580){_0x4da1b2=_0x4da1b2-0x182;const _0xbd6398=a130_0xbd63();let _0x3dfde8=_0xbd6398[_0x4da1b2];return _0x3dfde8;}const SQL_SAVE_DEPRECATED_HINT=[a130_0x470860(0x190),a130_0x470860(0x196),a130_0x470860(0x189)][a130_0x470860(0x191)]('\x0a');export const sqlSave={'service':a130_0x470860(0x18c),'command':'save','description':a130_0x470860(0x192),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'file','type':a130_0x470860(0x18f),'required':!![],'description':a130_0x470860(0x188)},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':'string','description':'SQL\x20query\x20display\x20name'},{'name':'db','type':'string','description':a130_0x470860(0x187)},{'name':a130_0x470860(0x18b),'type':'string','description':a130_0x470860(0x193)}],async 'validate'(){const _0x58038d=a130_0x470860;throw CliErrors[_0x58038d(0x194)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- const a131_0x45dd75=a131_0x410c;(function(_0x10104a,_0x20681c){const _0x4c2a1f=a131_0x410c,_0x54f2ab=_0x10104a();while(!![]){try{const _0x47543e=parseInt(_0x4c2a1f(0x113))/0x1+-parseInt(_0x4c2a1f(0xf8))/0x2*(-parseInt(_0x4c2a1f(0x105))/0x3)+parseInt(_0x4c2a1f(0xed))/0x4+parseInt(_0x4c2a1f(0x10a))/0x5+-parseInt(_0x4c2a1f(0x110))/0x6*(parseInt(_0x4c2a1f(0x111))/0x7)+-parseInt(_0x4c2a1f(0xf7))/0x8*(-parseInt(_0x4c2a1f(0xf4))/0x9)+parseInt(_0x4c2a1f(0xf6))/0xa*(-parseInt(_0x4c2a1f(0x103))/0xb);if(_0x47543e===_0x20681c)break;else _0x54f2ab['push'](_0x54f2ab['shift']());}catch(_0x2150e3){_0x54f2ab['push'](_0x54f2ab['shift']());}}}(a131_0x20f3,0x5cbdc));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a131_0x45dd75(0x107);export function buildSqlLockEntry(_0x2a4fbd,_0x11894c,_0x401bb3,_0x17c85e){const _0x1d1481=a131_0x45dd75,_0x2bdfe0=detectSqlMode(_0x11894c);return{'path':buildSqlRelativePath(_0x2a4fbd[_0x1d1481(0x10b)],_0x2a4fbd[_0x1d1481(0x115)],_0x17c85e?.['dbName'],_0x2bdfe0,_0x2a4fbd[_0x1d1481(0x112)]),'hash':_0x401bb3,'remoteId':_0x2a4fbd['id'],'version':_0x2a4fbd[_0x1d1481(0x114)],'dbId':Number(_0x2a4fbd[_0x1d1481(0x112)]),'dbName':_0x17c85e?.[_0x1d1481(0x100)],'sqlName':_0x2a4fbd[_0x1d1481(0x115)],'sqlConfig':_0x2a4fbd['sqlConfig']??undefined,'mode':_0x2bdfe0};}export function cloneSqlLockData(_0x4b5dbc){const _0x4d5150=a131_0x45dd75;return{'apps':Object[_0x4d5150(0x106)](Object[_0x4d5150(0xf5)](_0x4b5dbc['apps'])['map'](([_0x2ebfd5,_0x564506])=>[_0x2ebfd5,{'sqlRoot':_0x564506[_0x4d5150(0x10c)],'lastSync':_0x564506['lastSync'],'sqls':{..._0x564506['sqls']}}]))};}export function ensureRemoteSqlContent(_0x4f105f){return _0x4f105f['sqlContent']??'';}function a131_0x410c(_0x23c1de,_0x4498f5){_0x23c1de=_0x23c1de-0xec;const _0x20f3ec=a131_0x20f3();let _0x410c15=_0x20f3ec[_0x23c1de];return _0x410c15;}export function buildLocalSqlFileContent(_0x1a7e4d,_0xb6d33f,_0x3c21d6){const _0x469450=a131_0x45dd75,_0x3470ef=_0x3c21d6?.[_0x469450(0xfe)]??detectSqlMode(_0xb6d33f),_0x21e272=stripLocalSqlMetadata(_0xb6d33f,_0x3470ef)[_0x469450(0xf2)](),_0x262090=[...buildMetadataHeaderLines({'sqlCode':_0x1a7e4d[_0x469450(0x10b)],'sqlName':_0x1a7e4d[_0x469450(0x115)],'dbId':_0x1a7e4d[_0x469450(0x112)],'dbName':_0x3c21d6?.[_0x469450(0x100)],'mode':_0x3470ef,'syncedAt':_0x3c21d6?.[_0x469450(0x102)],'description':_0x3c21d6?.[_0x469450(0x10f)]},_0x3470ef),'',_0x21e272],_0x28b67d=_0x262090[_0x469450(0xf0)]('\x0a');return _0x28b67d[_0x469450(0xf3)]('\x0a')?_0x28b67d:_0x28b67d+'\x0a';}export function stripLocalSqlMetadata(_0x43c008,_0x3608e4){const _0x48362c=a131_0x45dd75,_0x35b7a7=_0x43c008[_0x48362c(0x10e)](/\r\n/g,'\x0a')['split']('\x0a'),_0x13b6ca=[];let _0x1ff3ab=0x0;if(_0x3608e4===_0x48362c(0xfb))while(_0x1ff3ab<_0x35b7a7[_0x48362c(0x104)]){const _0x4902a3=_0x35b7a7[_0x1ff3ab]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x4902a3)){_0x1ff3ab++;continue;}if(_0x4902a3[_0x48362c(0xf2)]()===''&&_0x1ff3ab>0x0){_0x1ff3ab++;continue;}break;}else while(_0x1ff3ab<_0x35b7a7[_0x48362c(0x104)]){const _0x306329=_0x35b7a7[_0x1ff3ab]??'';if(/^\s*--\s*@lovrabet\./[_0x48362c(0xf1)](_0x306329)){_0x1ff3ab++;continue;}if(_0x306329['trim']()===''&&_0x1ff3ab>0x0){_0x1ff3ab++;continue;}break;}for(;_0x1ff3ab<_0x35b7a7[_0x48362c(0x104)];_0x1ff3ab++){_0x13b6ca['push'](_0x35b7a7[_0x1ff3ab]);}return _0x13b6ca[_0x48362c(0xf0)]('\x0a')[_0x48362c(0xfd)]();}export function resolveSqlMode(_0x5c5aef,_0x10008b){const _0x552870=a131_0x45dd75;if(_0x10008b?.[_0x552870(0xfe)])return _0x10008b['mode'];return detectSqlMode(_0x5c5aef);}export function resolveSqlFileName(_0x3e86e3,_0x4b9538,_0x4e27bd){const _0x480b15=a131_0x45dd75;if(_0x4e27bd?.[_0x480b15(0xef)])return _0x4e27bd[_0x480b15(0xef)];if(_0x4e27bd?.[_0x480b15(0x115)]||_0x4e27bd?.[_0x480b15(0x100)])return buildSqlRelativePath(_0x3e86e3,_0x4e27bd?.[_0x480b15(0x115)],_0x4e27bd?.[_0x480b15(0x100)],resolveSqlMode(_0x4b9538,_0x4e27bd),_0x4e27bd?.[_0x480b15(0x112)]);return buildDefaultSqlFileName(_0x3e86e3,resolveSqlMode(_0x4b9538,_0x4e27bd));}export function resolveSqlLocalDir(_0x2066d6,_0xa5653f){return join(_0x2066d6,SQL_LOCAL_REL_DIR,_0xa5653f);}export async function confirmForceOverwrite(_0x5043d0){const _0x53f1af=a131_0x45dd75,_0x37737b=createInterface({'input':process[_0x53f1af(0xec)],'output':process['stderr']}),_0x1451d4=await new Promise(_0x562a9b=>{const _0x4a0268=_0x53f1af;_0x37737b[_0x4a0268(0xfa)](_0x5043d0+'\x20[y/N]\x20',_0x562a9b);});return _0x37737b[_0x53f1af(0xee)](),['y',_0x53f1af(0x108)][_0x53f1af(0x101)](_0x1451d4[_0x53f1af(0xf2)]()['toLowerCase']());}export function findSqlLockScope(_0x363b40,_0x5c1734){const _0x129959=a131_0x45dd75;return _0x363b40[_0x129959(0x10d)][_0x5c1734];}function buildMetadataHeaderLines(_0x43c76b,_0x5cf0d3){const _0x26f0dc=a131_0x45dd75,_0x3da29e=[['sqlCode',_0x43c76b[_0x26f0dc(0x10b)]],[_0x26f0dc(0x115),_0x43c76b[_0x26f0dc(0x115)]],[_0x26f0dc(0x112),_0x43c76b[_0x26f0dc(0x112)]],[_0x26f0dc(0x100),_0x43c76b[_0x26f0dc(0x100)]],['mode',_0x43c76b[_0x26f0dc(0xfe)]],[_0x26f0dc(0x102),_0x43c76b['syncedAt']],['description',_0x43c76b[_0x26f0dc(0x10f)]]];if(_0x5cf0d3===_0x26f0dc(0xfb))return _0x3da29e[_0x26f0dc(0xfc)](([,_0x6c5183])=>_0x6c5183!==undefined&&_0x6c5183!==null&&String(_0x6c5183)['trim']()!=='')[_0x26f0dc(0x109)](([_0x10a817,_0xbf7430])=>_0x26f0dc(0xff)+_0x10a817+':\x20'+String(_0xbf7430)+_0x26f0dc(0xf9));return _0x3da29e[_0x26f0dc(0xfc)](([,_0x4f9b0b])=>_0x4f9b0b!==undefined&&_0x4f9b0b!==null&&String(_0x4f9b0b)[_0x26f0dc(0xf2)]()!=='')[_0x26f0dc(0x109)](([_0x33f64d,_0x577504])=>'--\x20@lovrabet.'+_0x33f64d+':\x20'+String(_0x577504));}function a131_0x20f3(){const _0x584bb0=['apps','replace','description','84qcejLu','194999FahVqy','dbId','126217QRoyzU','version','sqlName','stdin','1167364oZNwTu','close','path','join','test','trim','endsWith','9tFrGwm','entries','920HqgsGD','5407880lmJuMz','2zjkvio','\x20-->','question','mybatisXml','filter','trimStart','mode','<!--\x20@lovrabet.','dbName','includes','syncedAt','91003gnvIMt','length','415092XnXJnJ','fromEntries','.rabetbase/sql','yes','map','1492875zOLUxi','sqlCode','sqlRoot'];a131_0x20f3=function(){return _0x584bb0;};return a131_0x20f3();}
1
+ function a131_0x7d01(){const _0x3178b8=['21JNKQaR','syncedAt','<!--\x20@lovrabet.','apps','.rabetbase/sql','dbId','yes','115hLlvsp','sqlContent','test','32911kMJSBZ','push','29106636mBPcry','1686vKVZQv','toLowerCase','stdin','filter','stderr','sqlRoot','mybatisXml','path','mode','--\x20@lovrabet.','13UvYurR','map','version','lastSync','\x20-->','trimStart','sqlConfig','3703077HPxedH','join','125082blVZlk','includes','length','sqlCode','description','sqlName','dbName','3124iwOebC','3156530NRttSC','33EoYZhi','replace','split','close','36YLASzu','2114936vAwYqJ','trim','endsWith'];a131_0x7d01=function(){return _0x3178b8;};return a131_0x7d01();}const a131_0x56d521=a131_0x22ab;(function(_0xe6379f,_0x4e55bf){const _0x3d95cb=a131_0x22ab,_0x4e16d4=_0xe6379f();while(!![]){try{const _0x355bc7=-parseInt(_0x3d95cb(0x177))/0x1*(parseInt(_0x3d95cb(0x169))/0x2)+-parseInt(_0x3d95cb(0x17a))/0x3*(-parseInt(_0x3d95cb(0x163))/0x4)+-parseInt(_0x3d95cb(0x174))/0x5*(-parseInt(_0x3d95cb(0x15c))/0x6)+-parseInt(_0x3d95cb(0x16d))/0x7*(parseInt(_0x3d95cb(0x16a))/0x8)+-parseInt(_0x3d95cb(0x15a))/0x9+-parseInt(_0x3d95cb(0x164))/0xa*(parseInt(_0x3d95cb(0x165))/0xb)+parseInt(_0x3d95cb(0x179))/0xc*(parseInt(_0x3d95cb(0x153))/0xd);if(_0x355bc7===_0x4e55bf)break;else _0x4e16d4['push'](_0x4e16d4['shift']());}catch(_0x17228b){_0x4e16d4['push'](_0x4e16d4['shift']());}}}(a131_0x7d01,0x927ed));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a131_0x56d521(0x171);export function buildSqlLockEntry(_0x375998,_0x2b1b9c,_0x16ef85,_0x567332){const _0x2cfbdf=a131_0x56d521,_0x20d78e=detectSqlMode(_0x2b1b9c);return{'path':buildSqlRelativePath(_0x375998[_0x2cfbdf(0x15f)],_0x375998[_0x2cfbdf(0x161)],_0x567332?.[_0x2cfbdf(0x162)],_0x20d78e,_0x375998[_0x2cfbdf(0x172)]),'hash':_0x16ef85,'remoteId':_0x375998['id'],'version':_0x375998[_0x2cfbdf(0x155)],'dbId':Number(_0x375998[_0x2cfbdf(0x172)]),'dbName':_0x567332?.[_0x2cfbdf(0x162)],'sqlName':_0x375998['sqlName'],'sqlConfig':_0x375998[_0x2cfbdf(0x159)]??undefined,'mode':_0x20d78e};}export function cloneSqlLockData(_0xbf7ebf){const _0x3b85e0=a131_0x56d521;return{'apps':Object['fromEntries'](Object['entries'](_0xbf7ebf[_0x3b85e0(0x170)])[_0x3b85e0(0x154)](([_0x597e1d,_0x3d75bb])=>[_0x597e1d,{'sqlRoot':_0x3d75bb[_0x3b85e0(0x17f)],'lastSync':_0x3d75bb[_0x3b85e0(0x156)],'sqls':{..._0x3d75bb['sqls']}}]))};}export function ensureRemoteSqlContent(_0x3c5a42){const _0x5b681b=a131_0x56d521;return _0x3c5a42[_0x5b681b(0x175)]??'';}export function buildLocalSqlFileContent(_0x2bfc1a,_0x552ff3,_0x33948c){const _0x7cbc26=a131_0x56d521,_0x1228f4=_0x33948c?.[_0x7cbc26(0x151)]??detectSqlMode(_0x552ff3),_0x4a3176=stripLocalSqlMetadata(_0x552ff3,_0x1228f4)[_0x7cbc26(0x16b)](),_0x2d26fb=[...buildMetadataHeaderLines({'sqlCode':_0x2bfc1a['sqlCode'],'sqlName':_0x2bfc1a[_0x7cbc26(0x161)],'dbId':_0x2bfc1a[_0x7cbc26(0x172)],'dbName':_0x33948c?.[_0x7cbc26(0x162)],'mode':_0x1228f4,'syncedAt':_0x33948c?.[_0x7cbc26(0x16e)],'description':_0x33948c?.[_0x7cbc26(0x160)]},_0x1228f4),'',_0x4a3176],_0x4e0c57=_0x2d26fb[_0x7cbc26(0x15b)]('\x0a');return _0x4e0c57[_0x7cbc26(0x16c)]('\x0a')?_0x4e0c57:_0x4e0c57+'\x0a';}export function stripLocalSqlMetadata(_0x1da4b4,_0x194752){const _0x4f49a2=a131_0x56d521,_0x4b0fab=_0x1da4b4[_0x4f49a2(0x166)](/\r\n/g,'\x0a')[_0x4f49a2(0x167)]('\x0a'),_0x82a832=[];let _0x54bed8=0x0;if(_0x194752===_0x4f49a2(0x180))while(_0x54bed8<_0x4b0fab[_0x4f49a2(0x15e)]){const _0x1f97d7=_0x4b0fab[_0x54bed8]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x1f97d7)){_0x54bed8++;continue;}if(_0x1f97d7[_0x4f49a2(0x16b)]()===''&&_0x54bed8>0x0){_0x54bed8++;continue;}break;}else while(_0x54bed8<_0x4b0fab[_0x4f49a2(0x15e)]){const _0x137b37=_0x4b0fab[_0x54bed8]??'';if(/^\s*--\s*@lovrabet\./[_0x4f49a2(0x176)](_0x137b37)){_0x54bed8++;continue;}if(_0x137b37[_0x4f49a2(0x16b)]()===''&&_0x54bed8>0x0){_0x54bed8++;continue;}break;}for(;_0x54bed8<_0x4b0fab[_0x4f49a2(0x15e)];_0x54bed8++){_0x82a832[_0x4f49a2(0x178)](_0x4b0fab[_0x54bed8]);}return _0x82a832[_0x4f49a2(0x15b)]('\x0a')[_0x4f49a2(0x158)]();}export function resolveSqlMode(_0x410887,_0x74c804){const _0x1201b0=a131_0x56d521;if(_0x74c804?.['mode'])return _0x74c804[_0x1201b0(0x151)];return detectSqlMode(_0x410887);}export function resolveSqlFileName(_0x56051d,_0xfcf3cb,_0x22220b){const _0x572543=a131_0x56d521;if(_0x22220b?.[_0x572543(0x150)])return _0x22220b[_0x572543(0x150)];if(_0x22220b?.[_0x572543(0x161)]||_0x22220b?.['dbName'])return buildSqlRelativePath(_0x56051d,_0x22220b?.[_0x572543(0x161)],_0x22220b?.['dbName'],resolveSqlMode(_0xfcf3cb,_0x22220b),_0x22220b?.[_0x572543(0x172)]);return buildDefaultSqlFileName(_0x56051d,resolveSqlMode(_0xfcf3cb,_0x22220b));}export function resolveSqlLocalDir(_0x5c5d32,_0x3da1c7){return join(_0x5c5d32,SQL_LOCAL_REL_DIR,_0x3da1c7);}function a131_0x22ab(_0x3bb8ee,_0x16f462){_0x3bb8ee=_0x3bb8ee-0x150;const _0x7d01f2=a131_0x7d01();let _0x22abc1=_0x7d01f2[_0x3bb8ee];return _0x22abc1;}export async function confirmForceOverwrite(_0x34aae5){const _0x4da06f=a131_0x56d521,_0x3f9ac3=createInterface({'input':process[_0x4da06f(0x17c)],'output':process[_0x4da06f(0x17e)]}),_0x30d950=await new Promise(_0x385202=>{_0x3f9ac3['question'](_0x34aae5+'\x20[y/N]\x20',_0x385202);});return _0x3f9ac3[_0x4da06f(0x168)](),['y',_0x4da06f(0x173)][_0x4da06f(0x15d)](_0x30d950['trim']()[_0x4da06f(0x17b)]());}export function findSqlLockScope(_0x20573c,_0x5456d6){const _0x59590a=a131_0x56d521;return _0x20573c[_0x59590a(0x170)][_0x5456d6];}function buildMetadataHeaderLines(_0x460d2c,_0xce4e2f){const _0x586a17=a131_0x56d521,_0x248126=[[_0x586a17(0x15f),_0x460d2c[_0x586a17(0x15f)]],[_0x586a17(0x161),_0x460d2c[_0x586a17(0x161)]],[_0x586a17(0x172),_0x460d2c['dbId']],[_0x586a17(0x162),_0x460d2c[_0x586a17(0x162)]],[_0x586a17(0x151),_0x460d2c['mode']],[_0x586a17(0x16e),_0x460d2c['syncedAt']],[_0x586a17(0x160),_0x460d2c[_0x586a17(0x160)]]];if(_0xce4e2f===_0x586a17(0x180))return _0x248126[_0x586a17(0x17d)](([,_0xeb80fc])=>_0xeb80fc!==undefined&&_0xeb80fc!==null&&String(_0xeb80fc)[_0x586a17(0x16b)]()!=='')[_0x586a17(0x154)](([_0x35fb9d,_0x30aedb])=>_0x586a17(0x16f)+_0x35fb9d+':\x20'+String(_0x30aedb)+_0x586a17(0x157));return _0x248126['filter'](([,_0xa9698d])=>_0xa9698d!==undefined&&_0xa9698d!==null&&String(_0xa9698d)['trim']()!=='')[_0x586a17(0x154)](([_0x259af4,_0x360f9f])=>_0x586a17(0x152)+_0x259af4+':\x20'+String(_0x360f9f));}
@@ -1 +1 @@
1
- const a132_0x4ed412=a132_0x2ade;(function(_0x4bdc38,_0x1dc4f7){const _0x2c981f=a132_0x2ade,_0x1671ca=_0x4bdc38();while(!![]){try{const _0x409436=-parseInt(_0x2c981f(0x1b0))/0x1+parseInt(_0x2c981f(0x1a8))/0x2*(-parseInt(_0x2c981f(0x1a0))/0x3)+-parseInt(_0x2c981f(0x1aa))/0x4*(-parseInt(_0x2c981f(0x1ba))/0x5)+-parseInt(_0x2c981f(0x1b2))/0x6+parseInt(_0x2c981f(0x1ad))/0x7*(-parseInt(_0x2c981f(0x1c1))/0x8)+-parseInt(_0x2c981f(0x1b9))/0x9*(-parseInt(_0x2c981f(0x1a5))/0xa)+-parseInt(_0x2c981f(0x1b5))/0xb*(-parseInt(_0x2c981f(0x1b1))/0xc);if(_0x409436===_0x1dc4f7)break;else _0x1671ca['push'](_0x1671ca['shift']());}catch(_0x599079){_0x1671ca['push'](_0x1671ca['shift']());}}}(a132_0x5d7a,0xc41f0));function a132_0x5d7a(){const _0x3fbca4=['4654524eXHRwy','\x20added,\x20','paging','5254469MNEnHK','boolean','map','lockFilePath','27kTpoZt','10AnHVIo','remote','read','status','keys','hash','sqlName','3056pYKWwY','relativePath','has','bool','totalCount','path','push','tableData','sqls','\x20modified,\x20','63DdcAQi','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','\x20remote-only','sqlRoot','350690MNLrqT','sqlCode','\x20missing,\x20','67118SIkUFL','sql','1859024oRxlUz','lockKey','appCode','896pBcmOE','\x20unchanged','length','135055XteDdO','36Olpinv'];a132_0x5d7a=function(){return _0x3fbca4;};return a132_0x5d7a();}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 a132_0x2ade(_0x6c3c98,_0x5f4253){_0x6c3c98=_0x6c3c98-0x198;const _0x5d7ad4=a132_0x5d7a();let _0x2ade2c=_0x5d7ad4[_0x6c3c98];return _0x2ade2c;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x19fbab){const _0x12da17=a132_0x2ade,_0x58f21e=[];let _0x132cda=0x1;while(!![]){const _0x1c9d3c=await listSqlQueries(_0x19fbab,{'currentPage':_0x132cda,'pageSize':PAGE_SIZE}),_0x2d5cb3=_0x1c9d3c[_0x12da17(0x19d)]??[];_0x58f21e['push'](..._0x2d5cb3[_0x12da17(0x1b7)](_0x436db5=>_0x436db5[_0x12da17(0x1a6)]));if(_0x2d5cb3[_0x12da17(0x1af)]===0x0)break;const _0x306bb3=_0x1c9d3c[_0x12da17(0x1b4)]?.[_0x12da17(0x19a)];if(_0x306bb3!=null?_0x58f21e[_0x12da17(0x1af)]>=_0x306bb3:_0x2d5cb3[_0x12da17(0x1af)]<PAGE_SIZE)break;_0x132cda++;}return _0x58f21e;}export const sqlStatus={'service':a132_0x4ed412(0x1a9),'command':a132_0x4ed412(0x1bd),'description':a132_0x4ed412(0x1a2),'risk':a132_0x4ed412(0x1bc),'flags':[{'name':a132_0x4ed412(0x1bb),'type':a132_0x4ed412(0x1b6),'description':a132_0x4ed412(0x1a1)}],async 'execute'(_0x37518c){const _0x3195db=a132_0x4ed412,_0x5afc5b=loadSqlProjectConfig(_0x37518c['appCode']),_0x32e011=await readSqlLockFile(_0x5afc5b[_0x3195db(0x1b8)]),{appLock:_0x3b9590}=ensureSqlLockScope(_0x32e011??createEmptySqlLock(),_0x5afc5b[_0x3195db(0x1ac)],_0x5afc5b[_0x3195db(0x1a4)],_0x3195db(0x1bd)),_0x13b2c9=await scanLocalSqlQueries(_0x5afc5b),_0x1a7b4a=[],_0x212eee=[],_0x5d4a87=[],_0x59c5a2=[],_0x2f9522=new Set(_0x13b2c9['map'](_0x4b69dc=>_0x4b69dc[_0x3195db(0x1ab)]));for(const _0x33b0aa of _0x13b2c9){const _0x259270=await computeSqlFileHash(_0x33b0aa['filePath']),_0x40baf8=_0x3b9590['sqls'][_0x33b0aa[_0x3195db(0x1ab)]],_0x224dd1=!!_0x40baf8&&_0x40baf8[_0x3195db(0x19b)]!==_0x33b0aa[_0x3195db(0x1c2)],_0x5459a1=!!_0x40baf8&&!!_0x33b0aa[_0x3195db(0x1c0)]&&_0x40baf8[_0x3195db(0x1c0)]!==_0x33b0aa[_0x3195db(0x1c0)];if(!_0x40baf8)_0x1a7b4a[_0x3195db(0x19c)](_0x33b0aa[_0x3195db(0x1ab)]);else _0x40baf8[_0x3195db(0x1bf)]!==_0x259270||_0x224dd1||_0x5459a1?_0x212eee[_0x3195db(0x19c)](_0x33b0aa[_0x3195db(0x1ab)]):_0x5d4a87[_0x3195db(0x19c)](_0x33b0aa[_0x3195db(0x1ab)]);}for(const _0x753f6b of Object[_0x3195db(0x1be)](_0x3b9590['sqls'])){!_0x2f9522[_0x3195db(0x198)](_0x753f6b)&&_0x59c5a2[_0x3195db(0x19c)](_0x753f6b);}const _0x5d895d=[];if(_0x37518c[_0x3195db(0x199)]('remote')){const _0x51996f=await fetchAllSqlCodes(_0x37518c[_0x3195db(0x1ac)]);for(const _0x4c35af of _0x51996f){!_0x2f9522[_0x3195db(0x198)](_0x4c35af)&&!_0x3b9590[_0x3195db(0x19e)][_0x4c35af]&&_0x5d895d[_0x3195db(0x19c)](_0x4c35af);}}const _0x328fdf=_0x1a7b4a[_0x3195db(0x1af)]===0x0&&_0x212eee['length']===0x0&&_0x59c5a2[_0x3195db(0x1af)]===0x0&&_0x5d895d[_0x3195db(0x1af)]===0x0;return{'ok':!![],'data':{'added':_0x1a7b4a,'modified':_0x212eee,'missing':_0x59c5a2,'unchanged':_0x5d4a87,'remoteOnly':_0x5d895d},'message':_0x328fdf?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x1a7b4a[_0x3195db(0x1af)]+_0x3195db(0x1b3)+_0x212eee[_0x3195db(0x1af)]+_0x3195db(0x19f)+_0x59c5a2['length']+_0x3195db(0x1a7)+_0x5d4a87[_0x3195db(0x1af)]+_0x3195db(0x1ae)+(_0x5d895d[_0x3195db(0x1af)]>0x0?',\x20'+_0x5d895d['length']+_0x3195db(0x1a3):'')};}};
1
+ const a132_0x5864c9=a132_0x4d63;(function(_0x47d3a4,_0xc69c7e){const _0xb4988=a132_0x4d63,_0x44bd0d=_0x47d3a4();while(!![]){try{const _0x573a95=-parseInt(_0xb4988(0x1de))/0x1*(parseInt(_0xb4988(0x1e7))/0x2)+-parseInt(_0xb4988(0x1e9))/0x3+parseInt(_0xb4988(0x1d3))/0x4*(-parseInt(_0xb4988(0x1ea))/0x5)+-parseInt(_0xb4988(0x1e2))/0x6+-parseInt(_0xb4988(0x1f2))/0x7+-parseInt(_0xb4988(0x1d8))/0x8+parseInt(_0xb4988(0x1d9))/0x9;if(_0x573a95===_0xc69c7e)break;else _0x44bd0d['push'](_0x44bd0d['shift']());}catch(_0x531325){_0x44bd0d['push'](_0x44bd0d['shift']());}}}(a132_0x1cd9,0x2916d));function a132_0x4d63(_0x11ebee,_0x4238c1){_0x11ebee=_0x11ebee-0x1cf;const _0x1cd9ce=a132_0x1cd9();let _0x4d63de=_0x1cd9ce[_0x11ebee];return _0x4d63de;}import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a132_0x1cd9(){const _0x12495d=['\x20missing,\x20','1849120KfHXwD','7129836iRqxMN','All\x20SQL\x20queries\x20are\x20in\x20sync.','read','filePath','has','2082eSZVQB','sqls','push','keys','683364AKzTka','bool','lockFilePath','lockKey','\x20unchanged','4qvzsKs','remote','185199IJbzlK','274095idxYFp','sqlName','\x20added,\x20','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','sqlCode','relativePath','length','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','1107071GBoQpM','totalCount','sql','appCode','sqlRoot','4SrZpNP','paging','hash','tableData'];a132_0x1cd9=function(){return _0x12495d;};return a132_0x1cd9();}async function fetchAllSqlCodes(_0x24c581){const _0x5dc622=a132_0x4d63,_0x38804b=[];let _0x2cd9cc=0x1;while(!![]){const _0x5bb82a=await listSqlQueries(_0x24c581,{'currentPage':_0x2cd9cc,'pageSize':PAGE_SIZE}),_0x21e8be=_0x5bb82a[_0x5dc622(0x1d6)]??[];_0x38804b['push'](..._0x21e8be['map'](_0x797f97=>_0x797f97[_0x5dc622(0x1ee)]));if(_0x21e8be[_0x5dc622(0x1f0)]===0x0)break;const _0x336096=_0x5bb82a[_0x5dc622(0x1d4)]?.[_0x5dc622(0x1cf)];if(_0x336096!=null?_0x38804b['length']>=_0x336096:_0x21e8be[_0x5dc622(0x1f0)]<PAGE_SIZE)break;_0x2cd9cc++;}return _0x38804b;}export const sqlStatus={'service':a132_0x5864c9(0x1d0),'command':'status','description':a132_0x5864c9(0x1ed),'risk':a132_0x5864c9(0x1db),'flags':[{'name':a132_0x5864c9(0x1e8),'type':'boolean','description':a132_0x5864c9(0x1f1)}],async 'execute'(_0x17a351){const _0x1c893e=a132_0x5864c9,_0x462465=loadSqlProjectConfig(_0x17a351[_0x1c893e(0x1d1)]),_0x38a864=await readSqlLockFile(_0x462465[_0x1c893e(0x1e4)]),{appLock:_0x5c794a}=ensureSqlLockScope(_0x38a864??createEmptySqlLock(),_0x462465[_0x1c893e(0x1d1)],_0x462465[_0x1c893e(0x1d2)],'status'),_0x2d285a=await scanLocalSqlQueries(_0x462465),_0x20982d=[],_0x5e1cc3=[],_0x35ea37=[],_0xd3ff71=[],_0x5237ac=new Set(_0x2d285a['map'](_0x42befd=>_0x42befd[_0x1c893e(0x1e5)]));for(const _0x3d2fe5 of _0x2d285a){const _0x3e8f6d=await computeSqlFileHash(_0x3d2fe5[_0x1c893e(0x1dc)]),_0x378bde=_0x5c794a[_0x1c893e(0x1df)][_0x3d2fe5[_0x1c893e(0x1e5)]],_0x3f562d=!!_0x378bde&&_0x378bde['path']!==_0x3d2fe5[_0x1c893e(0x1ef)],_0x580c62=!!_0x378bde&&!!_0x3d2fe5['sqlName']&&_0x378bde['sqlName']!==_0x3d2fe5[_0x1c893e(0x1eb)];if(!_0x378bde)_0x20982d[_0x1c893e(0x1e0)](_0x3d2fe5[_0x1c893e(0x1e5)]);else _0x378bde[_0x1c893e(0x1d5)]!==_0x3e8f6d||_0x3f562d||_0x580c62?_0x5e1cc3[_0x1c893e(0x1e0)](_0x3d2fe5[_0x1c893e(0x1e5)]):_0x35ea37[_0x1c893e(0x1e0)](_0x3d2fe5[_0x1c893e(0x1e5)]);}for(const _0x56557c of Object[_0x1c893e(0x1e1)](_0x5c794a['sqls'])){!_0x5237ac[_0x1c893e(0x1dd)](_0x56557c)&&_0xd3ff71[_0x1c893e(0x1e0)](_0x56557c);}const _0xdb530e=[];if(_0x17a351[_0x1c893e(0x1e3)](_0x1c893e(0x1e8))){const _0x122021=await fetchAllSqlCodes(_0x17a351[_0x1c893e(0x1d1)]);for(const _0x5280a1 of _0x122021){!_0x5237ac[_0x1c893e(0x1dd)](_0x5280a1)&&!_0x5c794a[_0x1c893e(0x1df)][_0x5280a1]&&_0xdb530e[_0x1c893e(0x1e0)](_0x5280a1);}}const _0x5082a3=_0x20982d[_0x1c893e(0x1f0)]===0x0&&_0x5e1cc3[_0x1c893e(0x1f0)]===0x0&&_0xd3ff71[_0x1c893e(0x1f0)]===0x0&&_0xdb530e[_0x1c893e(0x1f0)]===0x0;return{'ok':!![],'data':{'added':_0x20982d,'modified':_0x5e1cc3,'missing':_0xd3ff71,'unchanged':_0x35ea37,'remoteOnly':_0xdb530e},'message':_0x5082a3?_0x1c893e(0x1da):_0x20982d[_0x1c893e(0x1f0)]+_0x1c893e(0x1ec)+_0x5e1cc3[_0x1c893e(0x1f0)]+'\x20modified,\x20'+_0xd3ff71[_0x1c893e(0x1f0)]+_0x1c893e(0x1d7)+_0x35ea37[_0x1c893e(0x1f0)]+_0x1c893e(0x1e6)+(_0xdb530e[_0x1c893e(0x1f0)]>0x0?',\x20'+_0xdb530e[_0x1c893e(0x1f0)]+'\x20remote-only':'')};}};
@@ -1 +1 @@
1
- const a133_0x1701fd=a133_0x68d8;(function(_0x2a4ec3,_0x4bded2){const _0x38ac9f=a133_0x68d8,_0x4bb6b0=_0x2a4ec3();while(!![]){try{const _0x47c287=-parseInt(_0x38ac9f(0x17f))/0x1*(-parseInt(_0x38ac9f(0x198))/0x2)+parseInt(_0x38ac9f(0x17a))/0x3+-parseInt(_0x38ac9f(0x1a0))/0x4+parseInt(_0x38ac9f(0x190))/0x5+parseInt(_0x38ac9f(0x180))/0x6+-parseInt(_0x38ac9f(0x192))/0x7+-parseInt(_0x38ac9f(0x193))/0x8*(parseInt(_0x38ac9f(0x183))/0x9);if(_0x47c287===_0x4bded2)break;else _0x4bb6b0['push'](_0x4bb6b0['shift']());}catch(_0xd1b855){_0x4bb6b0['push'](_0x4bb6b0['shift']());}}}(a133_0x3e62,0x5e6d7));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a133_0x68d8(_0x20a30d,_0x3848bb){_0x20a30d=_0x20a30d-0x17a;const _0x3e6206=a133_0x3e62();let _0x68d84b=_0x3e6206[_0x20a30d];return _0x68d84b;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';function a133_0x3e62(){const _0xee7fa=['valid','length','from','Provide\x20--file\x20or\x20--sql','trim','fields','reason','utf-8','validation','2661480nCynPT','Table\x20\x22','4876543PUDyOd','16jrLuKj','push','split','isDangerous','cwd','6CFVmUE','size','tables','appCode','flagMissing','schemaWarnings','SQL\x20schema\x20validation','toLowerCase','2283616rZjQbk','string','validate','schemas','filter','Dataset\x20\x22','tableName','sqlType','dbtableConfig','str','file','2241195BdXevt','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','get','message','216450ZqwEOp','757338nUJtSL','map','File\x20not\x20found:\x20','1802727xgKOWO','sql','type','isArray'];a133_0x3e62=function(){return _0xee7fa;};return a133_0x3e62();}export const sqlValidate={'service':a133_0x1701fd(0x184),'command':a133_0x1701fd(0x1a2),'description':a133_0x1701fd(0x17c),'risk':'read','flags':[{'name':a133_0x1701fd(0x1aa),'type':a133_0x1701fd(0x1a1),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a133_0x1701fd(0x184),'type':a133_0x1701fd(0x1a1),'description':a133_0x1701fd(0x17b)},{'name':a133_0x1701fd(0x1a3),'type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0xe5f604){const _0x4d65bc=a133_0x1701fd,_0x2cc82c=_0xe5f604[_0x4d65bc(0x1a9)](_0x4d65bc(0x1aa)),_0x2d480a=_0xe5f604[_0x4d65bc(0x1a9)](_0x4d65bc(0x184));if(!_0x2cc82c&&!_0x2d480a)throw CliErrors[_0x4d65bc(0x19c)]('file',_0x4d65bc(0x18a));let _0x5a0a42;if(_0x2cc82c){const _0x207b56=resolve(process[_0x4d65bc(0x197)](),_0x2cc82c);if(!existsSync(_0x207b56))throw CliErrors[_0x4d65bc(0x18f)](_0x4d65bc(0x182)+_0x207b56);_0x5a0a42=readFileSync(_0x207b56,_0x4d65bc(0x18e));}else _0x5a0a42=_0x2d480a;const _0xbbb99e=validateSql(_0x5a0a42),_0x490273={'valid':_0xbbb99e[_0x4d65bc(0x187)],'sqlType':_0xbbb99e['sqlType'][_0x4d65bc(0x185)],'isSelectOnly':_0xbbb99e[_0x4d65bc(0x1a7)]['isSelectOnly'],'isDangerous':_0xbbb99e[_0x4d65bc(0x1a7)][_0x4d65bc(0x196)],'tables':_0xbbb99e[_0x4d65bc(0x19a)],'parameters':_0xbbb99e['parameters'],'message':_0xbbb99e[_0x4d65bc(0x17e)]};_0xbbb99e[_0x4d65bc(0x1a7)]['reason']&&(_0x490273['reason']=_0xbbb99e[_0x4d65bc(0x1a7)][_0x4d65bc(0x18d)]);const _0x5058c1=_0xe5f604[_0x4d65bc(0x1a9)](_0x4d65bc(0x1a3));if(_0x5058c1&&_0xbbb99e[_0x4d65bc(0x187)]){const _0x138030=_0x5058c1[_0x4d65bc(0x195)](',')[_0x4d65bc(0x181)](_0x411170=>_0x411170[_0x4d65bc(0x18b)]())[_0x4d65bc(0x1a4)](Boolean),_0x3ec4c3=[],_0x7e2f65=filterDbTableBackedDatasets(await listDatasets(_0xe5f604[_0x4d65bc(0x19b)])),_0x175707=new Map(_0x7e2f65[_0x4d65bc(0x181)](_0x236506=>[_0x236506[_0x4d65bc(0x1a8)]?.[_0x4d65bc(0x1a6)]?.['toLowerCase'](),_0x236506]));for(const _0x3af3e5 of _0xbbb99e[_0x4d65bc(0x19a)]){const _0x400108=_0x175707[_0x4d65bc(0x17d)](_0x3af3e5[_0x4d65bc(0x19f)]());!_0x400108&&_0x3ec4c3[_0x4d65bc(0x194)](_0x4d65bc(0x191)+_0x3af3e5+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x1036fb of _0x138030){let _0x323bbd;try{_0x323bbd=await getDatasetDetail(_0x1036fb);}catch{_0x3ec4c3[_0x4d65bc(0x194)](_0x4d65bc(0x1a5)+_0x1036fb+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0x323bbd,_0x4d65bc(0x19e));const _0x1ca0fd=Array[_0x4d65bc(0x186)](_0x323bbd[_0x4d65bc(0x18c)])?_0x323bbd[_0x4d65bc(0x18c)]:[],_0x188af7=new Set(_0x1ca0fd[_0x4d65bc(0x181)](_0xcfc5ac=>_0xcfc5ac['name']?.['toLowerCase']())),_0x225299=_0x323bbd[_0x4d65bc(0x1a8)]?.[_0x4d65bc(0x1a6)]||_0x323bbd[_0x4d65bc(0x1a6)]||_0x1036fb;_0x490273['schema:'+_0x225299]={'code':_0x1036fb,'tableName':_0x225299,'fieldCount':_0x188af7[_0x4d65bc(0x199)],'fields':Array[_0x4d65bc(0x189)](_0x188af7)};}_0x3ec4c3[_0x4d65bc(0x188)]>0x0&&(_0x490273[_0x4d65bc(0x19d)]=_0x3ec4c3);}return{'ok':_0xbbb99e[_0x4d65bc(0x187)],'data':_0x490273,'message':_0xbbb99e[_0x4d65bc(0x17e)]};}};
1
+ const a133_0x55c566=a133_0x1c9d;(function(_0x4e5251,_0x38e347){const _0x695ffc=a133_0x1c9d,_0x3150e0=_0x4e5251();while(!![]){try{const _0x408d0f=parseInt(_0x695ffc(0x174))/0x1*(parseInt(_0x695ffc(0x178))/0x2)+parseInt(_0x695ffc(0x172))/0x3*(-parseInt(_0x695ffc(0x185))/0x4)+parseInt(_0x695ffc(0x17e))/0x5*(-parseInt(_0x695ffc(0x19a))/0x6)+-parseInt(_0x695ffc(0x182))/0x7*(-parseInt(_0x695ffc(0x179))/0x8)+-parseInt(_0x695ffc(0x18e))/0x9*(-parseInt(_0x695ffc(0x193))/0xa)+-parseInt(_0x695ffc(0x18d))/0xb*(parseInt(_0x695ffc(0x19b))/0xc)+-parseInt(_0x695ffc(0x18f))/0xd*(-parseInt(_0x695ffc(0x1a5))/0xe);if(_0x408d0f===_0x38e347)break;else _0x3150e0['push'](_0x3150e0['shift']());}catch(_0xdbbef1){_0x3150e0['push'](_0x3150e0['shift']());}}}(a133_0x5ac4,0x36462));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a133_0x5ac4(){const _0x33fc99=['isDangerous','\x22\x20not\x20found\x20or\x20not\x20accessible','490DFpLuz','map','string','validation','Dataset\x20\x22','dbtableConfig','isSelectOnly','98436OrchvN','480duMBSM','sql','tables','size','tableName','schemas','Table\x20\x22','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','validate','trim','490hTnFLA','get','Provide\x20--file\x20or\x20--sql','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','appCode','schemaWarnings','fields','5361PKuVsf','str','9364TeytMP','flagMissing','filter','valid','94DmKdoj','779696pMXbJl','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','sqlType','SQL\x20schema\x20validation','5WapziF','schema:','push','utf-8','7gjQzmZ','read','parameters','740uYDGcp','split','\x22\x20not\x20found\x20in\x20any\x20dataset','cwd','toLowerCase','isArray','file','reason','109450UJqzvU','11997mhPpQY','135356ttynBN','type'];a133_0x5ac4=function(){return _0x33fc99;};return a133_0x5ac4();}function a133_0x1c9d(_0x3decb1,_0x5d911a){_0x3decb1=_0x3decb1-0x16c;const _0x5ac43b=a133_0x5ac4();let _0x1c9d94=_0x5ac43b[_0x3decb1];return _0x1c9d94;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a133_0x55c566(0x19c),'command':a133_0x55c566(0x1a3),'description':a133_0x55c566(0x1a2),'risk':a133_0x55c566(0x183),'flags':[{'name':'file','type':a133_0x55c566(0x195),'description':a133_0x55c566(0x17a)},{'name':'sql','type':'string','description':a133_0x55c566(0x16e)},{'name':a133_0x55c566(0x1a0),'type':'string','description':a133_0x55c566(0x17b)}],async 'execute'(_0x57a65a){const _0x398379=a133_0x55c566,_0x19dd1f=_0x57a65a[_0x398379(0x173)](_0x398379(0x18b)),_0x2a28a1=_0x57a65a[_0x398379(0x173)](_0x398379(0x19c));if(!_0x19dd1f&&!_0x2a28a1)throw CliErrors[_0x398379(0x175)](_0x398379(0x18b),_0x398379(0x16d));let _0x15a5cc;if(_0x19dd1f){const _0x536c8d=resolve(process[_0x398379(0x188)](),_0x19dd1f);if(!existsSync(_0x536c8d))throw CliErrors[_0x398379(0x196)]('File\x20not\x20found:\x20'+_0x536c8d);_0x15a5cc=readFileSync(_0x536c8d,_0x398379(0x181));}else _0x15a5cc=_0x2a28a1;const _0x4dd14f=validateSql(_0x15a5cc),_0x3fe611={'valid':_0x4dd14f[_0x398379(0x177)],'sqlType':_0x4dd14f[_0x398379(0x17c)][_0x398379(0x190)],'isSelectOnly':_0x4dd14f['sqlType'][_0x398379(0x199)],'isDangerous':_0x4dd14f[_0x398379(0x17c)][_0x398379(0x191)],'tables':_0x4dd14f[_0x398379(0x19d)],'parameters':_0x4dd14f[_0x398379(0x184)],'message':_0x4dd14f['message']};_0x4dd14f['sqlType']['reason']&&(_0x3fe611[_0x398379(0x18c)]=_0x4dd14f['sqlType']['reason']);const _0x2250b9=_0x57a65a[_0x398379(0x173)](_0x398379(0x1a0));if(_0x2250b9&&_0x4dd14f[_0x398379(0x177)]){const _0x52fdd1=_0x2250b9[_0x398379(0x186)](',')[_0x398379(0x194)](_0x4e92af=>_0x4e92af[_0x398379(0x1a4)]())[_0x398379(0x176)](Boolean),_0x5a5a7f=[],_0x44d130=filterDbTableBackedDatasets(await listDatasets(_0x57a65a[_0x398379(0x16f)])),_0x57dfd3=new Map(_0x44d130[_0x398379(0x194)](_0x58e7ed=>[_0x58e7ed['dbtableConfig']?.[_0x398379(0x19f)]?.[_0x398379(0x189)](),_0x58e7ed]));for(const _0x2313c9 of _0x4dd14f[_0x398379(0x19d)]){const _0x4cb073=_0x57dfd3[_0x398379(0x16c)](_0x2313c9['toLowerCase']());!_0x4cb073&&_0x5a5a7f[_0x398379(0x180)](_0x398379(0x1a1)+_0x2313c9+_0x398379(0x187));}for(const _0x241846 of _0x52fdd1){let _0x28aeef;try{_0x28aeef=await getDatasetDetail(_0x241846);}catch{_0x5a5a7f[_0x398379(0x180)](_0x398379(0x197)+_0x241846+_0x398379(0x192));continue;}assertDatasetIsDbTableBacked(_0x28aeef,_0x398379(0x17d));const _0x125392=Array[_0x398379(0x18a)](_0x28aeef['fields'])?_0x28aeef[_0x398379(0x171)]:[],_0x2cd226=new Set(_0x125392[_0x398379(0x194)](_0x4b1f95=>_0x4b1f95['name']?.[_0x398379(0x189)]())),_0x239329=_0x28aeef[_0x398379(0x198)]?.[_0x398379(0x19f)]||_0x28aeef[_0x398379(0x19f)]||_0x241846;_0x3fe611[_0x398379(0x17f)+_0x239329]={'code':_0x241846,'tableName':_0x239329,'fieldCount':_0x2cd226[_0x398379(0x19e)],'fields':Array['from'](_0x2cd226)};}_0x5a5a7f['length']>0x0&&(_0x3fe611[_0x398379(0x170)]=_0x5a5a7f);}return{'ok':_0x4dd14f[_0x398379(0x177)],'data':_0x3fe611,'message':_0x4dd14f['message']};}};
@@ -1 +1 @@
1
- const a134_0x3ce4d5=a134_0x465d;(function(_0x595389,_0x414695){const _0x480c89=a134_0x465d,_0x379779=_0x595389();while(!![]){try{const _0x4a86b5=-parseInt(_0x480c89(0xbf))/0x1*(parseInt(_0x480c89(0xa2))/0x2)+parseInt(_0x480c89(0xb0))/0x3*(parseInt(_0x480c89(0xa6))/0x4)+parseInt(_0x480c89(0xaf))/0x5+-parseInt(_0x480c89(0xb4))/0x6*(-parseInt(_0x480c89(0xc4))/0x7)+-parseInt(_0x480c89(0xbb))/0x8*(-parseInt(_0x480c89(0xab))/0x9)+parseInt(_0x480c89(0xa5))/0xa*(parseInt(_0x480c89(0xc2))/0xb)+-parseInt(_0x480c89(0xa3))/0xc;if(_0x4a86b5===_0x414695)break;else _0x379779['push'](_0x379779['shift']());}catch(_0x3f30a2){_0x379779['push'](_0x379779['shift']());}}}(a134_0x46aa,0x717dd));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',a134_0x3ce4d5(0xb8),a134_0x3ce4d5(0xa0),a134_0x3ce4d5(0xac),a134_0x3ce4d5(0xb7)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a134_0x3ce4d5(0xbd),'env',a134_0x3ce4d5(0xa0),a134_0x3ce4d5(0xac),'cookie',a134_0x3ce4d5(0xb8),a134_0x3ce4d5(0xc0)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x49b4a4){return[..._0x49b4a4]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x41b3c9){const _0x14e97c=a134_0x3ce4d5;return TOP_LEVEL_CONFIG_KEYS[_0x14e97c(0xa7)](_0x41b3c9);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a134_0x3ce4d5(0xba),'apiDir':'apiDir','cookie':a134_0x3ce4d5(0xc1),'accessKey':a134_0x3ce4d5(0xb8),'defaultFormat':a134_0x3ce4d5(0xac),'pageSize':a134_0x3ce4d5(0xbc),'riskLevel':a134_0x3ce4d5(0xb7),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x58ad88=a134_0x3ce4d5;return[{'name':_0x58ad88(0xba),'type':_0x58ad88(0xad),'description':_0x58ad88(0xbe),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x58ad88(0xc0),'type':_0x58ad88(0xad),'description':_0x58ad88(0x9f)},{'name':_0x58ad88(0xc1),'type':'string','description':_0x58ad88(0xb5),'hidden':!![]},{'name':'accessKey','type':_0x58ad88(0xad),'description':'Access\x20key','hidden':!![]},{'name':'defaultFormat','type':_0x58ad88(0xad),'description':_0x58ad88(0xa9),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x58ad88(0xb9),'description':_0x58ad88(0xa4)},{'name':'riskLevel','type':'string','description':_0x58ad88(0xc5),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':_0x58ad88(0xad),'description':_0x58ad88(0xa8)}];}export function collectAppProfileOverrides(_0x349a8d){const _0x17ae53=a134_0x3ce4d5,_0x2416d9={};for(const [_0x54ad4e,_0x303a8c]of Object[_0x17ae53(0xc7)](APP_PROFILE_FLAG_KEY_MAP)){const _0x4992aa=_0x349a8d(_0x54ad4e);if(!_0x4992aa)continue;_0x2416d9[_0x303a8c]=_0x303a8c===_0x17ae53(0xbc)?Number(_0x4992aa):_0x4992aa;}return _0x2416d9;}function a134_0x465d(_0x1bf94c,_0x5e8727){_0x1bf94c=_0x1bf94c-0x9f;const _0x46aab0=a134_0x46aa();let _0x465ddf=_0x46aab0[_0x1bf94c];return _0x465ddf;}export function buildAppProfileListFields(_0x32e92e){const _0xd6c303=a134_0x3ce4d5;return{'env':_0x32e92e[_0xd6c303(0xba)]??null,'apiDir':_0x32e92e[_0xd6c303(0xc0)]??null,'hasCookie':!!_0x32e92e[_0xd6c303(0xc1)],'hasAccessKey':!!_0x32e92e['accessKey'],'format':_0x32e92e['format']??null,'pageSize':_0x32e92e[_0xd6c303(0xbc)]??null,'riskLevel':_0x32e92e[_0xd6c303(0xb7)]??null,'locale':_0x32e92e[_0xd6c303(0xa0)]??null};}export function buildAppDoctorFields(_0x2c9e96,_0x2a7ecf){const _0x49a893=a134_0x3ce4d5;return{'env':{'value':_0x2c9e96[_0x49a893(0xba)]||_0x2a7ecf[_0x49a893(0xba)],'source':_0x2c9e96[_0x49a893(0xba)]?'app':'inherit'},'apiDir':{'value':_0x2c9e96[_0x49a893(0xc0)]||_0x2a7ecf[_0x49a893(0xc0)],'source':_0x2c9e96[_0x49a893(0xc0)]?_0x49a893(0xb6):'inherit'},'cookie':{'value':_0x2c9e96[_0x49a893(0xc1)]||_0x2a7ecf[_0x49a893(0xc1)],'source':_0x2c9e96[_0x49a893(0xc1)]?_0x49a893(0xb6):_0x49a893(0xb1)},'accessKey':{'value':_0x2c9e96[_0x49a893(0xb8)]||_0x2a7ecf[_0x49a893(0xb8)],'source':_0x2c9e96[_0x49a893(0xb8)]?'app':'inherit'}};}function a134_0x46aa(){const _0x5259a9=['cookie','2177659NexmNq','filter','5873ZynsWZ','Risk\x20level','map','entries','API\x20directory\x20path','locale','defaultApp','4768AWlQtS','5791764gsbvtV','Default\x20page\x20size','10JVNWpf','4Pzwdzp','has','Locale','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','keys','113193YyudWj','format','string','apps','3753225IivKkn','130908WCHUWA','inherit','toLowerCase','trim','954NfaGhR','Auth\x20cookie','app','riskLevel','accessKey','number','env','8rOazeJ','pageSize','appcode','Target\x20environment','80xGLBra','apiDir'];a134_0x46aa=function(){return _0x5259a9;};return a134_0x46aa();}export function buildCanonicalAppConfig(_0x459d85,_0x5b453e){const _0x342a92=a134_0x3ce4d5,_0x52455d=_0x459d85[_0x342a92(0xc6)](_0x1eee54=>String(_0x1eee54||'')[_0x342a92(0xb3)]())[_0x342a92(0xc3)](Boolean);if(_0x52455d['length']===0x0)return{};const _0x1228e3={};for(const _0x55fe78 of _0x52455d){_0x1228e3[_0x55fe78]=_0x5b453e?{'appcode':_0x55fe78,'env':_0x5b453e}:{'appcode':_0x55fe78};}return{'apps':_0x1228e3,'defaultApp':_0x52455d[0x0]};}export function buildCanonicalProjectConfig(_0x51666c,_0xddaf81){const _0x3a04f7=a134_0x3ce4d5,{appCodes:appCodes=[],env:_0x25d312,metadata:_0x569403}=_0xddaf81,_0x598960={..._0x51666c,..._0x569403||{}};delete _0x598960[_0x3a04f7(0xbd)],delete _0x598960[_0x3a04f7(0xb6)];if(_0x25d312)_0x598960[_0x3a04f7(0xba)]=_0x25d312;else!_0x598960['env']&&(_0x598960[_0x3a04f7(0xba)]=DEFAULT_CONFIG_VALUES[_0x3a04f7(0xba)]);const _0x3a14b4=buildCanonicalAppConfig(appCodes,_0x598960[_0x3a04f7(0xba)]);return Object[_0x3a04f7(0xaa)](_0x3a14b4)['length']>0x0&&(_0x598960[_0x3a04f7(0xae)]=_0x3a14b4['apps'],_0x598960[_0x3a04f7(0xa1)]=_0x3a14b4[_0x3a04f7(0xa1)]),_0x598960;}const LOCALE_MAP={'zh':'zh-CN','zh-cn':'zh-CN','zh_cn':'zh-CN','en':'en-US','en-us':'en-US','en_us':'en-US'};export function normalizeLocale(_0x2468f9){const _0xc1f633=a134_0x3ce4d5;if(!_0x2468f9)return null;return LOCALE_MAP[_0x2468f9[_0xc1f633(0xb2)]()]??null;}
1
+ function a134_0x28a1(){const _0x2e0564=['12290930zFkomG','en-US','string','Locale','zh-CN','cookie','1510598CSMHfZ','accessKey','3606JvStGg','Risk\x20level','env','defaultApp','toLowerCase','format','pageSize','entries','app','Default\x20page\x20size','length','12xqJgMi','Access\x20key','appcode','116466dGOcNO','Target\x20environment','8912zUUkjR','363015TGLGUu','2502vYyoGJ','inherit','7NUrCfM','trim','keys','map','apiDir','1419445kQWywt','locale','apps','Auth\x20cookie','has','riskLevel'];a134_0x28a1=function(){return _0x2e0564;};return a134_0x28a1();}function a134_0x3259(_0x28dce7,_0x36d1bf){_0x28dce7=_0x28dce7-0x1da;const _0x28a166=a134_0x28a1();let _0x32594b=_0x28a166[_0x28dce7];return _0x32594b;}const a134_0x4d3cf9=a134_0x3259;(function(_0x14fb67,_0x5aeaa0){const _0x160cfb=a134_0x3259,_0x514df7=_0x14fb67();while(!![]){try{const _0x2c837d=-parseInt(_0x160cfb(0x1e0))/0x1+parseInt(_0x160cfb(0x1f7))/0x2+-parseInt(_0x160cfb(0x1e3))/0x3+-parseInt(_0x160cfb(0x1dd))/0x4*(-parseInt(_0x160cfb(0x1eb))/0x5)+parseInt(_0x160cfb(0x1f9))/0x6*(parseInt(_0x160cfb(0x1e6))/0x7)+-parseInt(_0x160cfb(0x1e2))/0x8*(-parseInt(_0x160cfb(0x1e4))/0x9)+-parseInt(_0x160cfb(0x1f1))/0xa;if(_0x2c837d===_0x5aeaa0)break;else _0x514df7['push'](_0x514df7['shift']());}catch(_0x56aff4){_0x514df7['push'](_0x514df7['shift']());}}}(a134_0x28a1,0x6e087));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a134_0x4d3cf9(0x1f6),'accessKey',a134_0x4d3cf9(0x1ec),a134_0x4d3cf9(0x1fe),a134_0x4d3cf9(0x1f0)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a134_0x4d3cf9(0x1df),'env','locale','format',a134_0x4d3cf9(0x1f6),a134_0x4d3cf9(0x1f8),a134_0x4d3cf9(0x1ea)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x1595f9){return[..._0x1595f9]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x149324){const _0x44a9d8=a134_0x4d3cf9;return TOP_LEVEL_CONFIG_KEYS[_0x44a9d8(0x1ef)](_0x149324);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a134_0x4d3cf9(0x1fb),'apiDir':a134_0x4d3cf9(0x1ea),'cookie':'cookie','accessKey':a134_0x4d3cf9(0x1f8),'defaultFormat':a134_0x4d3cf9(0x1fe),'pageSize':a134_0x4d3cf9(0x1ff),'riskLevel':'riskLevel','locale':a134_0x4d3cf9(0x1ec)};export function getAppProfileFlagDefs(){const _0x212d85=a134_0x4d3cf9;return[{'name':_0x212d85(0x1fb),'type':_0x212d85(0x1f3),'description':_0x212d85(0x1e1),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x212d85(0x1ea),'type':_0x212d85(0x1f3),'description':'API\x20directory\x20path'},{'name':_0x212d85(0x1f6),'type':'string','description':_0x212d85(0x1ee),'hidden':!![]},{'name':_0x212d85(0x1f8),'type':_0x212d85(0x1f3),'description':_0x212d85(0x1de),'hidden':!![]},{'name':'defaultFormat','type':_0x212d85(0x1f3),'description':'Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':'number','description':_0x212d85(0x1db)},{'name':_0x212d85(0x1f0),'type':'string','description':_0x212d85(0x1fa),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x212d85(0x1ec),'type':_0x212d85(0x1f3),'description':_0x212d85(0x1f4)}];}export function collectAppProfileOverrides(_0x409b15){const _0x22b9c9=a134_0x4d3cf9,_0x2fe706={};for(const [_0x480bb3,_0x430771]of Object[_0x22b9c9(0x200)](APP_PROFILE_FLAG_KEY_MAP)){const _0xcbe191=_0x409b15(_0x480bb3);if(!_0xcbe191)continue;_0x2fe706[_0x430771]=_0x430771===_0x22b9c9(0x1ff)?Number(_0xcbe191):_0xcbe191;}return _0x2fe706;}export function buildAppProfileListFields(_0x1514fe){const _0x1f0973=a134_0x4d3cf9;return{'env':_0x1514fe[_0x1f0973(0x1fb)]??null,'apiDir':_0x1514fe[_0x1f0973(0x1ea)]??null,'hasCookie':!!_0x1514fe['cookie'],'hasAccessKey':!!_0x1514fe[_0x1f0973(0x1f8)],'format':_0x1514fe[_0x1f0973(0x1fe)]??null,'pageSize':_0x1514fe[_0x1f0973(0x1ff)]??null,'riskLevel':_0x1514fe[_0x1f0973(0x1f0)]??null,'locale':_0x1514fe[_0x1f0973(0x1ec)]??null};}export function buildAppDoctorFields(_0x39c609,_0x41e96c){const _0x514b3b=a134_0x4d3cf9;return{'env':{'value':_0x39c609[_0x514b3b(0x1fb)]||_0x41e96c[_0x514b3b(0x1fb)],'source':_0x39c609['env']?_0x514b3b(0x1da):_0x514b3b(0x1e5)},'apiDir':{'value':_0x39c609['apiDir']||_0x41e96c[_0x514b3b(0x1ea)],'source':_0x39c609[_0x514b3b(0x1ea)]?_0x514b3b(0x1da):'inherit'},'cookie':{'value':_0x39c609['cookie']||_0x41e96c[_0x514b3b(0x1f6)],'source':_0x39c609[_0x514b3b(0x1f6)]?'app':'inherit'},'accessKey':{'value':_0x39c609[_0x514b3b(0x1f8)]||_0x41e96c['accessKey'],'source':_0x39c609['accessKey']?_0x514b3b(0x1da):_0x514b3b(0x1e5)}};}export function buildCanonicalAppConfig(_0x22c7e8,_0x1350d0){const _0x28e056=a134_0x4d3cf9,_0x57e57e=_0x22c7e8[_0x28e056(0x1e9)](_0x4cac9e=>String(_0x4cac9e||'')[_0x28e056(0x1e7)]())['filter'](Boolean);if(_0x57e57e[_0x28e056(0x1dc)]===0x0)return{};const _0x1e7737={};for(const _0x48f76a of _0x57e57e){_0x1e7737[_0x48f76a]=_0x1350d0?{'appcode':_0x48f76a,'env':_0x1350d0}:{'appcode':_0x48f76a};}return{'apps':_0x1e7737,'defaultApp':_0x57e57e[0x0]};}export function buildCanonicalProjectConfig(_0x5b4bc1,_0x411d0b){const _0x4731d9=a134_0x4d3cf9,{appCodes:appCodes=[],env:_0x156b5c,metadata:_0x535ba7}=_0x411d0b,_0x313161={..._0x5b4bc1,..._0x535ba7||{}};delete _0x313161['appcode'],delete _0x313161['app'];if(_0x156b5c)_0x313161[_0x4731d9(0x1fb)]=_0x156b5c;else!_0x313161[_0x4731d9(0x1fb)]&&(_0x313161['env']=DEFAULT_CONFIG_VALUES[_0x4731d9(0x1fb)]);const _0x113f82=buildCanonicalAppConfig(appCodes,_0x313161['env']);return Object[_0x4731d9(0x1e8)](_0x113f82)['length']>0x0&&(_0x313161['apps']=_0x113f82[_0x4731d9(0x1ed)],_0x313161[_0x4731d9(0x1fc)]=_0x113f82['defaultApp']),_0x313161;}const LOCALE_MAP={'zh':a134_0x4d3cf9(0x1f5),'zh-cn':a134_0x4d3cf9(0x1f5),'zh_cn':a134_0x4d3cf9(0x1f5),'en':a134_0x4d3cf9(0x1f2),'en-us':a134_0x4d3cf9(0x1f2),'en_us':'en-US'};export function normalizeLocale(_0x2fd8bd){const _0x32a50e=a134_0x4d3cf9;if(!_0x2fd8bd)return null;return LOCALE_MAP[_0x2fd8bd[_0x32a50e(0x1fd)]()]??null;}
@@ -1 +1 @@
1
- const a135_0x272670=a135_0x432c;(function(_0x4a0629,_0x3a971f){const _0x9bba8c=a135_0x432c,_0x2a75dd=_0x4a0629();while(!![]){try{const _0x529a0b=parseInt(_0x9bba8c(0xf3))/0x1*(parseInt(_0x9bba8c(0xec))/0x2)+parseInt(_0x9bba8c(0xee))/0x3*(-parseInt(_0x9bba8c(0xf4))/0x4)+parseInt(_0x9bba8c(0xea))/0x5*(parseInt(_0x9bba8c(0xef))/0x6)+parseInt(_0x9bba8c(0xed))/0x7+parseInt(_0x9bba8c(0xf0))/0x8+-parseInt(_0x9bba8c(0xf1))/0x9+-parseInt(_0x9bba8c(0xf2))/0xa*(parseInt(_0x9bba8c(0xe9))/0xb);if(_0x529a0b===_0x3a971f)break;else _0x2a75dd['push'](_0x2a75dd['shift']());}catch(_0x3c4ca2){_0x2a75dd['push'](_0x2a75dd['shift']());}}}(a135_0x44f0,0xdc1be));function a135_0x432c(_0x2d4d10,_0xbb6ce8){_0x2d4d10=_0x2d4d10-0xe9;const _0x44f0cc=a135_0x44f0();let _0x432cd9=_0x44f0cc[_0x2d4d10];return _0x432cd9;}function a135_0x44f0(){const _0x8c9338=['https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','74026elzMqs','4857202chQJwo','606GvAvjf','27588sjYPkA','8524712dOlQRe','5618799ypXTaT','8285450Tpvfok','21dfhyJl','24916eTUhrR','11tsIKcR','1170ANpHUU'];a135_0x44f0=function(){return _0x8c9338;};return a135_0x44f0();}export const CLI_VERSION_POLICY_URL=a135_0x272670(0xeb);
1
+ function a135_0x6ea6(_0x2499eb,_0x59868f){_0x2499eb=_0x2499eb-0x118;const _0x12d9d8=a135_0x12d9();let _0x6ea613=_0x12d9d8[_0x2499eb];return _0x6ea613;}function a135_0x12d9(){const _0x639d01=['11008jXLNAa','979670KOydVj','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','122193DxDsZr','158244GmsSUz','649644ykqGgR','78SqMjTt','1173123hMSSZd','72TgtBBZ','67991ulcYtS','121ZJLQKI','5ZVRRdP','2VLJzek'];a135_0x12d9=function(){return _0x639d01;};return a135_0x12d9();}const a135_0x1f47e3=a135_0x6ea6;(function(_0x4a3671,_0xf720e){const _0x5bae67=a135_0x6ea6,_0x3697cc=_0x4a3671();while(!![]){try{const _0x4d2def=-parseInt(_0x5bae67(0x11f))/0x1*(-parseInt(_0x5bae67(0x11b))/0x2)+parseInt(_0x5bae67(0x122))/0x3*(parseInt(_0x5bae67(0x11c))/0x4)+-parseInt(_0x5bae67(0x11a))/0x5*(-parseInt(_0x5bae67(0x121))/0x6)+parseInt(_0x5bae67(0x118))/0x7*(-parseInt(_0x5bae67(0x124))/0x8)+parseInt(_0x5bae67(0x123))/0x9+-parseInt(_0x5bae67(0x11d))/0xa+-parseInt(_0x5bae67(0x119))/0xb*(parseInt(_0x5bae67(0x120))/0xc);if(_0x4d2def===_0xf720e)break;else _0x3697cc['push'](_0x3697cc['shift']());}catch(_0x46db5c){_0x3697cc['push'](_0x3697cc['shift']());}}}(a135_0x12d9,0x18e25));export const CLI_VERSION_POLICY_URL=a135_0x1f47e3(0x11e);
@@ -1 +1 @@
1
- const a136_0x3a5096=a136_0x1b52;(function(_0x2d91c6,_0x3b5078){const _0x5244f1=a136_0x1b52,_0x30822f=_0x2d91c6();while(!![]){try{const _0x461258=-parseInt(_0x5244f1(0x173))/0x1*(-parseInt(_0x5244f1(0x11f))/0x2)+parseInt(_0x5244f1(0x125))/0x3*(parseInt(_0x5244f1(0x14e))/0x4)+-parseInt(_0x5244f1(0x129))/0x5*(parseInt(_0x5244f1(0x167))/0x6)+-parseInt(_0x5244f1(0x13a))/0x7*(-parseInt(_0x5244f1(0x126))/0x8)+-parseInt(_0x5244f1(0x12b))/0x9+parseInt(_0x5244f1(0x136))/0xa+-parseInt(_0x5244f1(0x117))/0xb;if(_0x461258===_0x3b5078)break;else _0x30822f['push'](_0x30822f['shift']());}catch(_0x31a3b8){_0x30822f['push'](_0x30822f['shift']());}}}(a136_0x238f,0x624fa));export const CLI_BIN_NAME=a136_0x3a5096(0x166);export const CLI_DISPLAY_NAME=a136_0x3a5096(0x11e);export const NPM_PACKAGE_NAME=a136_0x3a5096(0x11c);function a136_0x238f(){const _0x8f7b92=['non-interactive','watch','db-id','Target\x20path','DB\x20ID','help','Environment','pagesize','sqlcode','appcode','value','format','3314839bGEeAh','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','enable-bff-save','dry-run','Description','@lovrabet/rabetbase-cli','Skip\x20confirmation\x20for\x20high-risk\x20writes','Rabetbase\x20CLI','2WQffQg','operationType','enableBffSave','Preview\x20operation\x20without\x20executing','meowKey','yes','15WOupfs','3236248WrUZGm','Page\x20number','Title','25LQlUlD','nonInteractive','6775191WSGQYZ','Expected\x20affected\x20count','map','title','Alias\x20for\x20--non-interactive','force','string','Keyword\x20filter','Use\x20remote','boolean','Type\x20filter','7101130KaZgdu','Dataset\x20code','Output\x20format','datasetcode','7tjizvy','Enable\x20BFF\x20save','sqlName','SQL\x20name','Force\x20overwrite','project','clear','remote','target','type','expectedCount','name','Verbose\x20output','description','Use\x20project\x20config\x20scope','expected-count','code','functionNode','Record\x20ID','Show\x20help','91828txaaIV','app','dryRun','Config\x20key','Watch\x20mode','Override\x20appcode','dbid','sql','schemas','Clear','<expr>','key','SQL\x20code','verbose','operation','JSON\x20params','Schemas','Config\x20value','env','Name','descriptionFile','Confirm\x20destructive\x20action','sqlname','description-file','rabetbase','579318ErkFou','dbId','json\x20|\x20pretty\x20|\x20compress','fromEntries','Apply\x20to\x20all','all','page','<name>','SQL\x20string','File\x20path','Page\x20size','output','710166enNFdr','confirm'];a136_0x238f=function(){return _0x8f7b92;};return a136_0x238f();}function a136_0x1b52(_0x41b7f5,_0x33dc64){_0x41b7f5=_0x41b7f5-0x10f;const _0x238f79=a136_0x238f();let _0x1b523a=_0x238f79[_0x41b7f5];return _0x1b523a;}export const GLOBAL_FLAGS=[{'name':a136_0x3a5096(0x114),'meowKey':'appcode','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x153),'hint':'<code>'},{'name':'app','meowKey':a136_0x3a5096(0x14f),'type':a136_0x3a5096(0x131),'description':'Select\x20app\x20profile\x20by\x20name','hint':a136_0x3a5096(0x16e)},{'name':a136_0x3a5096(0x160),'meowKey':a136_0x3a5096(0x160),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x111),'hint':'production\x20|\x20daily'},{'name':a136_0x3a5096(0x116),'meowKey':a136_0x3a5096(0x116),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x138),'hint':a136_0x3a5096(0x169)},{'name':'jq','meowKey':'jq','type':'string','description':a136_0x3a5096(0x118),'hint':a136_0x3a5096(0x158)},{'name':a136_0x3a5096(0x11a),'meowKey':a136_0x3a5096(0x150),'type':'boolean','description':a136_0x3a5096(0x122)},{'name':'yes','meowKey':'yes','type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x11d)},{'name':a136_0x3a5096(0x175),'meowKey':a136_0x3a5096(0x12a),'type':a136_0x3a5096(0x134),'description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':'global','meowKey':'global','type':a136_0x3a5096(0x134),'description':'Use\x20global\x20config\x20scope'},{'name':a136_0x3a5096(0x13f),'meowKey':'project','type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x148)},{'name':'ci','meowKey':'ci','type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x12f),'hidden':!![]},{'name':a136_0x3a5096(0x110),'meowKey':a136_0x3a5096(0x110),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x14d)},{'name':a136_0x3a5096(0x145),'meowKey':a136_0x3a5096(0x145),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x161),'hidden':!![]},{'name':a136_0x3a5096(0x12e),'meowKey':a136_0x3a5096(0x12e),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x128),'hidden':!![]},{'name':a136_0x3a5096(0x140),'meowKey':a136_0x3a5096(0x140),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x157),'hidden':!![]},{'name':'watch','meowKey':a136_0x3a5096(0x176),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x152),'hidden':!![]},{'name':a136_0x3a5096(0x172),'meowKey':'output','type':'string','description':'Output\x20path','hidden':!![]},{'name':'params','meowKey':'params','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x15d),'hidden':!![]},{'name':a136_0x3a5096(0x139),'meowKey':a136_0x3a5096(0x139),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x137),'hidden':!![]},{'name':a136_0x3a5096(0x16c),'meowKey':a136_0x3a5096(0x16c),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x16b),'hidden':!![]},{'name':a136_0x3a5096(0x119),'meowKey':a136_0x3a5096(0x121),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x13b),'hidden':!![]},{'name':'id','meowKey':'id','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x14c),'hidden':!![]},{'name':a136_0x3a5096(0x143),'meowKey':a136_0x3a5096(0x143),'type':'string','description':a136_0x3a5096(0x135),'hidden':!![]},{'name':'file','meowKey':'file','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x170),'hidden':!![]},{'name':a136_0x3a5096(0x113),'meowKey':a136_0x3a5096(0x113),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x15a),'hidden':!![]},{'name':'sql-name','meowKey':a136_0x3a5096(0x13c),'type':'string','description':a136_0x3a5096(0x13d),'hidden':!![]},{'name':'sqlname','meowKey':a136_0x3a5096(0x164),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x13d),'hidden':!![]},{'name':a136_0x3a5096(0x177),'meowKey':a136_0x3a5096(0x168),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x10f),'hidden':!![]},{'name':a136_0x3a5096(0x154),'meowKey':'dbid','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x10f),'hidden':!![]},{'name':a136_0x3a5096(0x147),'meowKey':'description','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x11b),'hidden':!![]},{'name':a136_0x3a5096(0x165),'meowKey':a136_0x3a5096(0x162),'type':a136_0x3a5096(0x131),'description':'Description\x20file','hidden':!![]},{'name':a136_0x3a5096(0x16d),'meowKey':a136_0x3a5096(0x16d),'type':'string','description':a136_0x3a5096(0x127),'hidden':!![]},{'name':a136_0x3a5096(0x112),'meowKey':a136_0x3a5096(0x112),'type':'string','description':a136_0x3a5096(0x171),'hidden':!![]},{'name':'keyword','meowKey':'keyword','type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x132),'hidden':!![]},{'name':a136_0x3a5096(0x14a),'meowKey':a136_0x3a5096(0x14a),'type':'string','description':'Code\x20filter','hidden':!![]},{'name':a136_0x3a5096(0x155),'meowKey':a136_0x3a5096(0x155),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x16f),'hidden':!![]},{'name':'schemas','meowKey':a136_0x3a5096(0x156),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x15e),'hidden':!![]},{'name':a136_0x3a5096(0x15c),'meowKey':a136_0x3a5096(0x15c),'type':'string','description':'Operation\x20type','hidden':!![]},{'name':a136_0x3a5096(0x142),'meowKey':'target','type':'string','description':a136_0x3a5096(0x178),'hidden':!![]},{'name':'skip-imports','meowKey':'skipImports','type':a136_0x3a5096(0x134),'description':'Skip\x20import\x20generation','hidden':!![]},{'name':a136_0x3a5096(0x159),'meowKey':a136_0x3a5096(0x159),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x151),'hidden':!![]},{'name':a136_0x3a5096(0x115),'meowKey':a136_0x3a5096(0x115),'type':'string','description':a136_0x3a5096(0x15f),'hidden':!![]},{'name':'force','meowKey':a136_0x3a5096(0x130),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x13e),'hidden':!![]},{'name':a136_0x3a5096(0x174),'meowKey':a136_0x3a5096(0x174),'type':'boolean','description':a136_0x3a5096(0x163),'hidden':!![]},{'name':a136_0x3a5096(0x141),'meowKey':a136_0x3a5096(0x141),'type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x133),'hidden':!![]},{'name':a136_0x3a5096(0x15b),'meowKey':'verbose','type':a136_0x3a5096(0x134),'description':a136_0x3a5096(0x146),'hidden':!![]},{'name':a136_0x3a5096(0x149),'meowKey':a136_0x3a5096(0x144),'type':a136_0x3a5096(0x131),'description':a136_0x3a5096(0x12c),'hidden':!![]},{'name':'operation-type','meowKey':a136_0x3a5096(0x120),'type':a136_0x3a5096(0x131),'description':'Operation\x20type','hidden':!![]},{'name':'function-node','meowKey':a136_0x3a5096(0x14b),'type':a136_0x3a5096(0x131),'description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a136_0x3a5096(0x114),'app',a136_0x3a5096(0x160),a136_0x3a5096(0x116),'jq',a136_0x3a5096(0x11a),a136_0x3a5096(0x124),a136_0x3a5096(0x175),'ci']);export function buildMeowFlags(){const _0x758373=a136_0x3a5096;return Object[_0x758373(0x16a)](GLOBAL_FLAGS[_0x758373(0x12d)](_0x8587c7=>[_0x8587c7[_0x758373(0x123)],{'type':_0x8587c7[_0x758373(0x143)]}]));}
1
+ function a136_0x3dc4(){const _0x5f2120=['Select\x20app\x20profile\x20by\x20name','Alias\x20for\x20--non-interactive','project','Enable\x20BFF\x20save','Environment','Use\x20project\x20config\x20scope','Operation\x20type','Use\x20remote','clear','360812TRRMYk','file','code','sqlname','yes','type','skipImports','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Show\x20help','description','all','6MTfbMR','expected-count','title','Title','map','meowKey','datasetcode','43974756wVXxvM','<expr>','env','descriptionFile','dry-run','non-interactive','Output\x20format','sqlcode','Description\x20file','Target\x20path','Force\x20non-interactive\x20mode\x20(CI)','remote','output','SQL\x20string','1421245VKdZpp','Keyword\x20filter','string','app','SQL\x20code','<code>','dbId','function-node','SQL\x20name','<name>','Description','production\x20|\x20daily','20fVYMaZ','value','Record\x20ID','confirm','rabetbase','Skip\x20import\x20generation','name','645446xdKPCV','global','Preview\x20operation\x20without\x20executing','50rwqQeu','db-id','dbid','6wPLBOX','operation','appcode','16641JQgnnG','skip-imports','5720jFZQPF','Config\x20key','Use\x20global\x20config\x20scope','verbose','Code\x20filter','7417781SKdeBp','boolean','help','Verbose\x20output','dryRun','params','target','expectedCount','fromEntries','keyword','366388EyUjVt','Config\x20value','@lovrabet/rabetbase-cli','Override\x20appcode','format','schemas','Apply\x20to\x20all','DB\x20ID','watch','nonInteractive','File\x20path','json\x20|\x20pretty\x20|\x20compress','operation-type','Force\x20overwrite','force','key','Skip\x20confirmation\x20for\x20high-risk\x20writes','page','sqlName','pagesize','Confirm\x20destructive\x20action'];a136_0x3dc4=function(){return _0x5f2120;};return a136_0x3dc4();}const a136_0x5876e3=a136_0x5b84;(function(_0x522504,_0x42af83){const _0x592eac=a136_0x5b84,_0x4f0c1d=_0x522504();while(!![]){try{const _0xc81598=-parseInt(_0x592eac(0x20a))/0x1+parseInt(_0x592eac(0x1d7))/0x2*(-parseInt(_0x592eac(0x1e2))/0x3)+-parseInt(_0x592eac(0x203))/0x4*(parseInt(_0x592eac(0x1f7))/0x5)+parseInt(_0x592eac(0x210))/0x6*(parseInt(_0x592eac(0x21a))/0x7)+parseInt(_0x592eac(0x215))/0x8*(-parseInt(_0x592eac(0x213))/0x9)+-parseInt(_0x592eac(0x20d))/0xa*(parseInt(_0x592eac(0x224))/0xb)+parseInt(_0x592eac(0x1e9))/0xc;if(_0xc81598===_0x42af83)break;else _0x4f0c1d['push'](_0x4f0c1d['shift']());}catch(_0x4fe4de){_0x4f0c1d['push'](_0x4f0c1d['shift']());}}}(a136_0x3dc4,0xc54e8));export const CLI_BIN_NAME=a136_0x5876e3(0x207);export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';function a136_0x5b84(_0x1cc365,_0xbc4eba){_0x1cc365=_0x1cc365-0x1ba;const _0x3dc48f=a136_0x3dc4();let _0x5b8497=_0x3dc48f[_0x1cc365];return _0x5b8497;}export const NPM_PACKAGE_NAME=a136_0x5876e3(0x1bb);export const GLOBAL_FLAGS=[{'name':a136_0x5876e3(0x212),'meowKey':'appcode','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1bc),'hint':a136_0x5876e3(0x1fc)},{'name':'app','meowKey':'app','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1ce),'hint':a136_0x5876e3(0x200)},{'name':a136_0x5876e3(0x1eb),'meowKey':a136_0x5876e3(0x1eb),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1d2),'hint':a136_0x5876e3(0x202)},{'name':a136_0x5876e3(0x1bd),'meowKey':a136_0x5876e3(0x1bd),'type':'string','description':a136_0x5876e3(0x1ef),'hint':a136_0x5876e3(0x1c4)},{'name':'jq','meowKey':'jq','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1de),'hint':a136_0x5876e3(0x1ea)},{'name':a136_0x5876e3(0x1ed),'meowKey':a136_0x5876e3(0x21e),'type':'boolean','description':a136_0x5876e3(0x20c)},{'name':a136_0x5876e3(0x1db),'meowKey':a136_0x5876e3(0x1db),'type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1c9)},{'name':a136_0x5876e3(0x1ee),'meowKey':a136_0x5876e3(0x1c2),'type':'boolean','description':a136_0x5876e3(0x1f3)},{'name':a136_0x5876e3(0x20b),'meowKey':a136_0x5876e3(0x20b),'type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x217)},{'name':a136_0x5876e3(0x1d0),'meowKey':a136_0x5876e3(0x1d0),'type':'boolean','description':a136_0x5876e3(0x1d3)},{'name':'ci','meowKey':'ci','type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1cf),'hidden':!![]},{'name':a136_0x5876e3(0x21c),'meowKey':a136_0x5876e3(0x21c),'type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1df)},{'name':a136_0x5876e3(0x209),'meowKey':a136_0x5876e3(0x209),'type':a136_0x5876e3(0x1f9),'description':'Name','hidden':!![]},{'name':a136_0x5876e3(0x1e4),'meowKey':'title','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1e5),'hidden':!![]},{'name':a136_0x5876e3(0x1d6),'meowKey':a136_0x5876e3(0x1d6),'type':'boolean','description':'Clear','hidden':!![]},{'name':a136_0x5876e3(0x1c1),'meowKey':a136_0x5876e3(0x1c1),'type':'boolean','description':'Watch\x20mode','hidden':!![]},{'name':a136_0x5876e3(0x1f5),'meowKey':a136_0x5876e3(0x1f5),'type':a136_0x5876e3(0x1f9),'description':'Output\x20path','hidden':!![]},{'name':'params','meowKey':a136_0x5876e3(0x21f),'type':a136_0x5876e3(0x1f9),'description':'JSON\x20params','hidden':!![]},{'name':'datasetcode','meowKey':a136_0x5876e3(0x1e8),'type':a136_0x5876e3(0x1f9),'description':'Dataset\x20code','hidden':!![]},{'name':a136_0x5876e3(0x1e1),'meowKey':a136_0x5876e3(0x1e1),'type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1bf),'hidden':!![]},{'name':'enable-bff-save','meowKey':'enableBffSave','type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1d1),'hidden':!![]},{'name':'id','meowKey':'id','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x205),'hidden':!![]},{'name':a136_0x5876e3(0x1dc),'meowKey':'type','type':a136_0x5876e3(0x1f9),'description':'Type\x20filter','hidden':!![]},{'name':a136_0x5876e3(0x1d8),'meowKey':a136_0x5876e3(0x1d8),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1c3),'hidden':!![]},{'name':'sqlcode','meowKey':a136_0x5876e3(0x1f0),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1fb),'hidden':!![]},{'name':'sql-name','meowKey':a136_0x5876e3(0x1cb),'type':a136_0x5876e3(0x1f9),'description':'SQL\x20name','hidden':!![]},{'name':a136_0x5876e3(0x1da),'meowKey':a136_0x5876e3(0x1da),'type':'string','description':a136_0x5876e3(0x1ff),'hidden':!![]},{'name':a136_0x5876e3(0x20e),'meowKey':a136_0x5876e3(0x1fd),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1c0),'hidden':!![]},{'name':a136_0x5876e3(0x20f),'meowKey':a136_0x5876e3(0x20f),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1c0),'hidden':!![]},{'name':a136_0x5876e3(0x1e0),'meowKey':a136_0x5876e3(0x1e0),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x201),'hidden':!![]},{'name':'description-file','meowKey':a136_0x5876e3(0x1ec),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1f1),'hidden':!![]},{'name':'page','meowKey':a136_0x5876e3(0x1ca),'type':'string','description':'Page\x20number','hidden':!![]},{'name':a136_0x5876e3(0x1cc),'meowKey':a136_0x5876e3(0x1cc),'type':a136_0x5876e3(0x1f9),'description':'Page\x20size','hidden':!![]},{'name':a136_0x5876e3(0x223),'meowKey':a136_0x5876e3(0x223),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1f8),'hidden':!![]},{'name':a136_0x5876e3(0x1d9),'meowKey':'code','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x219),'hidden':!![]},{'name':'sql','meowKey':'sql','type':'string','description':a136_0x5876e3(0x1f6),'hidden':!![]},{'name':'schemas','meowKey':a136_0x5876e3(0x1be),'type':a136_0x5876e3(0x1f9),'description':'Schemas','hidden':!![]},{'name':a136_0x5876e3(0x211),'meowKey':'operation','type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1d4),'hidden':!![]},{'name':a136_0x5876e3(0x220),'meowKey':a136_0x5876e3(0x220),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x1f2),'hidden':!![]},{'name':a136_0x5876e3(0x214),'meowKey':a136_0x5876e3(0x1dd),'type':'boolean','description':a136_0x5876e3(0x208),'hidden':!![]},{'name':a136_0x5876e3(0x1c8),'meowKey':a136_0x5876e3(0x1c8),'type':a136_0x5876e3(0x1f9),'description':a136_0x5876e3(0x216),'hidden':!![]},{'name':a136_0x5876e3(0x204),'meowKey':a136_0x5876e3(0x204),'type':'string','description':a136_0x5876e3(0x1ba),'hidden':!![]},{'name':a136_0x5876e3(0x1c7),'meowKey':a136_0x5876e3(0x1c7),'type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1c6),'hidden':!![]},{'name':'confirm','meowKey':a136_0x5876e3(0x206),'type':'boolean','description':a136_0x5876e3(0x1cd),'hidden':!![]},{'name':'remote','meowKey':a136_0x5876e3(0x1f4),'type':a136_0x5876e3(0x21b),'description':a136_0x5876e3(0x1d5),'hidden':!![]},{'name':a136_0x5876e3(0x218),'meowKey':'verbose','type':'boolean','description':a136_0x5876e3(0x21d),'hidden':!![]},{'name':a136_0x5876e3(0x1e3),'meowKey':a136_0x5876e3(0x221),'type':a136_0x5876e3(0x1f9),'description':'Expected\x20affected\x20count','hidden':!![]},{'name':a136_0x5876e3(0x1c5),'meowKey':'operationType','type':'string','description':a136_0x5876e3(0x1d4),'hidden':!![]},{'name':a136_0x5876e3(0x1fe),'meowKey':'functionNode','type':'string','description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a136_0x5876e3(0x212),a136_0x5876e3(0x1fa),a136_0x5876e3(0x1eb),a136_0x5876e3(0x1bd),'jq',a136_0x5876e3(0x1ed),a136_0x5876e3(0x1db),a136_0x5876e3(0x1ee),'ci']);export function buildMeowFlags(){const _0x43367b=a136_0x5876e3;return Object[_0x43367b(0x222)](GLOBAL_FLAGS[_0x43367b(0x1e6)](_0x29412f=>[_0x29412f[_0x43367b(0x1e7)],{'type':_0x29412f[_0x43367b(0x1dc)]}]));}
@@ -1 +1 @@
1
- function a137_0x2f93(){const _0x39d698=['production','high-risk-write','46432MGCgVA','292621ZWsstJ','124228wNxIrl','227066BNUJGa','compress','555828GppjqV','907660UfslfH','36dbYkSV','en-US','3uhIkVa','364002sWhdEa'];a137_0x2f93=function(){return _0x39d698;};return a137_0x2f93();}const a137_0x10258d=a137_0x43f6;(function(_0x3727b5,_0x410720){const _0x4983c5=a137_0x43f6,_0x2823eb=_0x3727b5();while(!![]){try{const _0x5779ab=-parseInt(_0x4983c5(0xf0))/0x1+-parseInt(_0x4983c5(0xf4))/0x2*(-parseInt(_0x4983c5(0xeb))/0x3)+parseInt(_0x4983c5(0xf1))/0x4+parseInt(_0x4983c5(0xf5))/0x5+parseInt(_0x4983c5(0xec))/0x6+-parseInt(_0x4983c5(0xf2))/0x7+-parseInt(_0x4983c5(0xef))/0x8*(parseInt(_0x4983c5(0xf6))/0x9);if(_0x5779ab===_0x410720)break;else _0x2823eb['push'](_0x2823eb['shift']());}catch(_0x29555c){_0x2823eb['push'](_0x2823eb['shift']());}}}(a137_0x2f93,0x3188f));function a137_0x43f6(_0xee446e,_0x4ccc9c){_0xee446e=_0xee446e-0xea;const _0x2f93e6=a137_0x2f93();let _0x43f663=_0x2f93e6[_0xee446e];return _0x43f663;}import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a137_0x10258d(0xed),'format':a137_0x10258d(0xf3),'locale':a137_0x10258d(0xea),'riskLevel':a137_0x10258d(0xee),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a137_0x10258d(0xf3);
1
+ const a137_0x5cbb41=a137_0xd427;function a137_0xd427(_0x3a595a,_0x1bfcae){_0x3a595a=_0x3a595a-0xcf;const _0x24bbdd=a137_0x24bb();let _0xd4277a=_0x24bbdd[_0x3a595a];return _0xd4277a;}function a137_0x24bb(){const _0x53c8c1=['production','13088LXkALw','330XBhVKV','1787mRwgcF','307014qNISTH','9YymgFg','695egVfRD','14WNYnoT','2246409pSlycZ','en-US','high-risk-write','6111220feYXjO','13356RFcMam','1177912iyKTFI'];a137_0x24bb=function(){return _0x53c8c1;};return a137_0x24bb();}(function(_0x112e81,_0x18abdc){const _0x1e49d8=a137_0xd427,_0x2fd12d=_0x112e81();while(!![]){try{const _0x30930c=parseInt(_0x1e49d8(0xd3))/0x1*(-parseInt(_0x1e49d8(0xd7))/0x2)+parseInt(_0x1e49d8(0xd4))/0x3+parseInt(_0x1e49d8(0xd1))/0x4*(parseInt(_0x1e49d8(0xd6))/0x5)+parseInt(_0x1e49d8(0xd2))/0x6*(parseInt(_0x1e49d8(0xdc))/0x7)+parseInt(_0x1e49d8(0xcf))/0x8+-parseInt(_0x1e49d8(0xd5))/0x9*(parseInt(_0x1e49d8(0xdb))/0xa)+parseInt(_0x1e49d8(0xd8))/0xb;if(_0x30930c===_0x18abdc)break;else _0x2fd12d['push'](_0x2fd12d['shift']());}catch(_0x28d023){_0x2fd12d['push'](_0x2fd12d['shift']());}}}(a137_0x24bb,0x5f319));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a137_0x5cbb41(0xd0),'format':'compress','locale':a137_0x5cbb41(0xd9),'riskLevel':a137_0x5cbb41(0xda),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT='compress';
@@ -1 +1 @@
1
- const a138_0x375f3a=a138_0x2b98;(function(_0x2c7720,_0x5a1ea3){const _0x499668=a138_0x2b98,_0x1b4f64=_0x2c7720();while(!![]){try{const _0x48ae02=parseInt(_0x499668(0x158))/0x1*(parseInt(_0x499668(0x15b))/0x2)+-parseInt(_0x499668(0x14a))/0x3*(parseInt(_0x499668(0x15a))/0x4)+-parseInt(_0x499668(0x14c))/0x5*(parseInt(_0x499668(0x162))/0x6)+parseInt(_0x499668(0x14f))/0x7*(-parseInt(_0x499668(0x156))/0x8)+parseInt(_0x499668(0x155))/0x9*(-parseInt(_0x499668(0x15d))/0xa)+-parseInt(_0x499668(0x14e))/0xb+parseInt(_0x499668(0x151))/0xc*(parseInt(_0x499668(0x161))/0xd);if(_0x48ae02===_0x5a1ea3)break;else _0x1b4f64['push'](_0x1b4f64['shift']());}catch(_0x59e16d){_0x1b4f64['push'](_0x1b4f64['shift']());}}}(a138_0x2e14,0x5ac93));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a138_0x2b98(_0x16c43a,_0x612c65){_0x16c43a=_0x16c43a-0x14a;const _0x2e145e=a138_0x2e14();let _0x2b98d9=_0x2e145e[_0x16c43a];return _0x2b98d9;}export function initDomains(_0x564db5){const _0x5279d6=a138_0x2b98;customApiDomain=_0x564db5?.[_0x5279d6(0x159)],customUserDomain=_0x564db5?.[_0x5279d6(0x150)],customRuntimeDomain=_0x564db5?.[_0x5279d6(0x15f)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a138_0x375f3a(0x157));function a138_0x2e14(){const _0x411c72=['1119DMBhNj','/web-app/app/','70yeTcEH','https://daily.lovrabet.com','2590060rRjLbd','6699yGWkck','userDomain','72bMBoqt','https://daily-runtime.lovrabet.com','https://api.lovrabet.com','/app/','9paQywd','3304EQbqQT','https://user-daily.lovrabet.com','155546WuFLPu','apiDomain','4588mzygcf','4GbCocJ','https://runtime.lovrabet.com','4279490PyMFTK','https://daily-api.lovrabet.com','runtimeDomain','trim','4555057sRJRfn','237894ORqmCw'];a138_0x2e14=function(){return _0x411c72;};return a138_0x2e14();}export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a138_0x375f3a(0x153):a138_0x375f3a(0x15e));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a138_0x375f3a(0x15c):a138_0x375f3a(0x152));export const getAppDomain=()=>isProduction(getEnv())?'https://app.lovrabet.com':a138_0x375f3a(0x14d);export const getAppBaseUrl=_0x121189=>{const _0x2ed78d=a138_0x375f3a,_0x22a4b6=encodeURIComponent(_0x121189[_0x2ed78d(0x160)]());return isProduction(getEnv())?getAppDomain()+_0x2ed78d(0x154)+_0x22a4b6:getAppDomain()+_0x2ed78d(0x14b)+_0x22a4b6;};
1
+ function a138_0x36b6(_0x393a3e,_0xfd0555){_0x393a3e=_0x393a3e-0xe6;const _0x5ccc79=a138_0x5ccc();let _0x36b606=_0x5ccc79[_0x393a3e];return _0x36b606;}function a138_0x5ccc(){const _0x56d404=['userDomain','12401165zeyDNR','2781ePwPwr','1186ETuJRS','4psAQCw','runtimeDomain','https://daily-runtime.lovrabet.com','https://app.lovrabet.com','https://api.lovrabet.com','/app/','https://runtime.lovrabet.com','apiDomain','4784195czaEiF','trim','7406580BJkRJc','1134vGtngQ','164630zezZsm','https://user-daily.lovrabet.com','420679yODuGc','6794328nlEtQl'];a138_0x5ccc=function(){return _0x56d404;};return a138_0x5ccc();}const a138_0x22959d=a138_0x36b6;(function(_0x3b1052,_0x303c4e){const _0x2ee2e4=a138_0x36b6,_0x7d7adc=_0x3b1052();while(!![]){try{const _0x24ced9=parseInt(_0x2ee2e4(0xf5))/0x1+parseInt(_0x2ee2e4(0xe6))/0x2*(parseInt(_0x2ee2e4(0xf2))/0x3)+parseInt(_0x2ee2e4(0xe7))/0x4*(-parseInt(_0x2ee2e4(0xef))/0x5)+-parseInt(_0x2ee2e4(0xf1))/0x6+-parseInt(_0x2ee2e4(0xf8))/0x7+-parseInt(_0x2ee2e4(0xf6))/0x8+parseInt(_0x2ee2e4(0xf9))/0x9*(parseInt(_0x2ee2e4(0xf3))/0xa);if(_0x24ced9===_0x303c4e)break;else _0x7d7adc['push'](_0x7d7adc['shift']());}catch(_0x173d31){_0x7d7adc['push'](_0x7d7adc['shift']());}}}(a138_0x5ccc,0xe08c1));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x3c8dba){const _0x549a81=a138_0x36b6;customApiDomain=_0x3c8dba?.[_0x549a81(0xee)],customUserDomain=_0x3c8dba?.[_0x549a81(0xf7)],customRuntimeDomain=_0x3c8dba?.[_0x549a81(0xe8)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a138_0x22959d(0xf4));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a138_0x22959d(0xeb):'https://daily-api.lovrabet.com');export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a138_0x22959d(0xed):a138_0x22959d(0xe9));export const getAppDomain=()=>isProduction(getEnv())?a138_0x22959d(0xea):'https://daily.lovrabet.com';export const getAppBaseUrl=_0x5c5684=>{const _0xa55e6b=a138_0x22959d,_0x142531=encodeURIComponent(_0x5c5684[_0xa55e6b(0xf0)]());return isProduction(getEnv())?getAppDomain()+_0xa55e6b(0xec)+_0x142531:getAppDomain()+'/web-app/app/'+_0x142531;};
@@ -1 +1 @@
1
- const a139_0x15845f=a139_0x5516;(function(_0x233849,_0x1ae42b){const _0x1d3659=a139_0x5516,_0x21bf1a=_0x233849();while(!![]){try{const _0x35ccc8=-parseInt(_0x1d3659(0x175))/0x1*(-parseInt(_0x1d3659(0x17d))/0x2)+parseInt(_0x1d3659(0x17e))/0x3+-parseInt(_0x1d3659(0x173))/0x4*(-parseInt(_0x1d3659(0x176))/0x5)+-parseInt(_0x1d3659(0x174))/0x6+-parseInt(_0x1d3659(0x178))/0x7*(-parseInt(_0x1d3659(0x172))/0x8)+parseInt(_0x1d3659(0x17a))/0x9*(-parseInt(_0x1d3659(0x17c))/0xa)+parseInt(_0x1d3659(0x180))/0xb*(-parseInt(_0x1d3659(0x179))/0xc);if(_0x35ccc8===_0x1ae42b)break;else _0x21bf1a['push'](_0x21bf1a['shift']());}catch(_0x113eb3){_0x21bf1a['push'](_0x21bf1a['shift']());}}}(a139_0x233f,0x6f6d1));function a139_0x5516(_0x1a4036,_0x2766a3){_0x1a4036=_0x1a4036-0x172;const _0x233f29=a139_0x233f();let _0x55169a=_0x233f29[_0x1a4036];return _0x55169a;}export const RABETBASE_ENV_VALUES=[a139_0x15845f(0x17f),a139_0x15845f(0x177)];export function normalizeEnv(_0x562508){const _0x57c724=a139_0x15845f;return _0x562508===_0x57c724(0x17b)?_0x57c724(0x17f):_0x562508;}export function isProduction(_0x31ddd0){const _0x3db968=a139_0x15845f;return normalizeEnv(_0x31ddd0)===_0x3db968(0x17f);}export function isDaily(_0x504a6a){const _0x5cbc52=a139_0x15845f;return normalizeEnv(_0x504a6a)===_0x5cbc52(0x177);}export function isDev(_0xefc3f3){const _0x43c192=normalizeEnv(_0xefc3f3);return _0x43c192==='development'||_0x43c192==='dev';}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||'production');export function getEnv(){return env;}export function initEnv(_0x216429){env=normalizeEnv(_0x216429);}function a139_0x233f(){const _0x5577d7=['8LmoRzt','1852592PBKPed','2931342Yfvgja','362wWTChd','5EEyGWW','daily','5493271GAepvA','1754436TAlrau','423VTEvIt','online','166510sFRoym','3918BehcNy','188706uOMqGP','production','22GToFKn'];a139_0x233f=function(){return _0x5577d7;};return a139_0x233f();}
1
+ function a139_0x2589(_0x1f3444,_0x3e0520){_0x1f3444=_0x1f3444-0xe4;const _0x26666e=a139_0x2666();let _0x2589f3=_0x26666e[_0x1f3444];return _0x2589f3;}const a139_0x185d1f=a139_0x2589;(function(_0x4ffc34,_0x473b63){const _0x5efc4b=a139_0x2589,_0x329908=_0x4ffc34();while(!![]){try{const _0x3072fc=parseInt(_0x5efc4b(0xeb))/0x1*(-parseInt(_0x5efc4b(0xef))/0x2)+-parseInt(_0x5efc4b(0xf0))/0x3*(-parseInt(_0x5efc4b(0xea))/0x4)+-parseInt(_0x5efc4b(0xee))/0x5+parseInt(_0x5efc4b(0xf3))/0x6*(parseInt(_0x5efc4b(0xe8))/0x7)+-parseInt(_0x5efc4b(0xe9))/0x8*(parseInt(_0x5efc4b(0xf2))/0x9)+-parseInt(_0x5efc4b(0xe6))/0xa*(parseInt(_0x5efc4b(0xe7))/0xb)+parseInt(_0x5efc4b(0xec))/0xc;if(_0x3072fc===_0x473b63)break;else _0x329908['push'](_0x329908['shift']());}catch(_0x3644e8){_0x329908['push'](_0x329908['shift']());}}}(a139_0x2666,0xd9223));export const RABETBASE_ENV_VALUES=['production',a139_0x185d1f(0xe4)];export function normalizeEnv(_0x5baa7e){const _0x49ee78=a139_0x185d1f;return _0x5baa7e==='online'?_0x49ee78(0xf1):_0x5baa7e;}export function isProduction(_0x61bf60){const _0x1a7f45=a139_0x185d1f;return normalizeEnv(_0x61bf60)===_0x1a7f45(0xf1);}export function isDaily(_0x44d6ea){const _0xa35651=a139_0x185d1f;return normalizeEnv(_0x44d6ea)===_0xa35651(0xe4);}function a139_0x2666(){const _0x3bda2f=['6124940JtRkyL','11dHXfrq','7sgsAbQ','4471496hRnfew','5808524meAFXS','112657bhFHen','13487892NtkHGK','dev','5205410eGCIBr','16NnBgga','3aFDVyF','production','9ItCiCZ','8562156oTygjw','daily','development'];a139_0x2666=function(){return _0x3bda2f;};return a139_0x2666();}export function isDev(_0x462dfd){const _0xc29c52=a139_0x185d1f,_0x595ce0=normalizeEnv(_0x462dfd);return _0x595ce0===_0xc29c52(0xe5)||_0x595ce0===_0xc29c52(0xed);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a139_0x185d1f(0xf1));export function getEnv(){return env;}export function initEnv(_0x40b149){env=normalizeEnv(_0x40b149);}
@@ -1 +1 @@
1
- function a140_0x1e77(_0x2c39d7,_0x111a49){_0x2c39d7=_0x2c39d7-0xf7;const _0x36f9b2=a140_0x36f9();let _0x1e7788=_0x36f9b2[_0x2c39d7];return _0x1e7788;}const a140_0x3dd3c1=a140_0x1e77;function a140_0x36f9(){const _0x4303b4=['53806hIRBjW','8JFYWdy','16vNwBgY','2118776pKlAhl','compress','4266773RFrAJE','15gfUvFw','12519scuHgA','399260NMWREw','2319399HnUiNg','pretty','4596wLCIgP','3LlOrmH','33edOxpH','906474HqGivB'];a140_0x36f9=function(){return _0x4303b4;};return a140_0x36f9();}(function(_0x129459,_0x530189){const _0x58f340=a140_0x1e77,_0x11b042=_0x129459();while(!![]){try{const _0x34635b=-parseInt(_0x58f340(0x103))/0x1*(parseInt(_0x58f340(0x105))/0x2)+-parseInt(_0x58f340(0x100))/0x3*(parseInt(_0x58f340(0xf7))/0x4)+-parseInt(_0x58f340(0xfa))/0x5*(-parseInt(_0x58f340(0x102))/0x6)+parseInt(_0x58f340(0xf9))/0x7+parseInt(_0x58f340(0x104))/0x8*(-parseInt(_0x58f340(0xfd))/0x9)+-parseInt(_0x58f340(0xfc))/0xa*(-parseInt(_0x58f340(0x101))/0xb)+parseInt(_0x58f340(0xff))/0xc*(parseInt(_0x58f340(0xfb))/0xd);if(_0x34635b===_0x530189)break;else _0x11b042['push'](_0x11b042['shift']());}catch(_0x3ec214){_0x11b042['push'](_0x11b042['shift']());}}}(a140_0x36f9,0x516da));export const RABETBASE_OUTPUT_FORMAT_VALUES=['json',a140_0x3dd3c1(0xfe),a140_0x3dd3c1(0xf8)];
1
+ function a140_0x4e5b(){const _0x21944d=['1367076mIWUsv','468006GMkTua','json','3206380QbGJPf','2mnBRnM','1365411zHwmPZ','1211812YSSFMd','compress','1625136lhcfqK','313124dnzxkc'];a140_0x4e5b=function(){return _0x21944d;};return a140_0x4e5b();}const a140_0x5efc3b=a140_0x2fda;function a140_0x2fda(_0x3972f4,_0xc46618){_0x3972f4=_0x3972f4-0x1ac;const _0x4e5b34=a140_0x4e5b();let _0x2fda0e=_0x4e5b34[_0x3972f4];return _0x2fda0e;}(function(_0x47f929,_0x3fdf84){const _0x1da8db=a140_0x2fda,_0x29553f=_0x47f929();while(!![]){try{const _0x9aae9c=parseInt(_0x1da8db(0x1b3))/0x1+-parseInt(_0x1da8db(0x1ae))/0x2*(-parseInt(_0x1da8db(0x1af))/0x3)+parseInt(_0x1da8db(0x1b4))/0x4+-parseInt(_0x1da8db(0x1ad))/0x5+-parseInt(_0x1da8db(0x1b5))/0x6+parseInt(_0x1da8db(0x1b0))/0x7+-parseInt(_0x1da8db(0x1b2))/0x8;if(_0x9aae9c===_0x3fdf84)break;else _0x29553f['push'](_0x29553f['shift']());}catch(_0x443d6d){_0x29553f['push'](_0x29553f['shift']());}}}(a140_0x4e5b,0x58117));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a140_0x5efc3b(0x1ac),'pretty',a140_0x5efc3b(0x1b1)];
@@ -1 +1 @@
1
- const a141_0x580441=a141_0x5d2d;function a141_0x5d2d(_0x45feab,_0x16015e){_0x45feab=_0x45feab-0x19f;const _0x190599=a141_0x1905();let _0x5d2dfc=_0x190599[_0x45feab];return _0x5d2dfc;}(function(_0x3dcef4,_0x3a23eb){const _0x4fb707=a141_0x5d2d,_0xe01221=_0x3dcef4();while(!![]){try{const _0x2ba53b=-parseInt(_0x4fb707(0x1aa))/0x1*(-parseInt(_0x4fb707(0x1a4))/0x2)+parseInt(_0x4fb707(0x1a8))/0x3+-parseInt(_0x4fb707(0x1a0))/0x4+-parseInt(_0x4fb707(0x1a2))/0x5*(-parseInt(_0x4fb707(0x19f))/0x6)+parseInt(_0x4fb707(0x1a1))/0x7*(-parseInt(_0x4fb707(0x1a5))/0x8)+parseInt(_0x4fb707(0x1a9))/0x9+parseInt(_0x4fb707(0x1a7))/0xa*(parseInt(_0x4fb707(0x1a3))/0xb);if(_0x2ba53b===_0x3a23eb)break;else _0xe01221['push'](_0xe01221['shift']());}catch(_0x4eb881){_0xe01221['push'](_0xe01221['shift']());}}}(a141_0x1905,0x77ed6));function a141_0x1905(){const _0x2a7b2e=['8120160JJpqfT','1ypdSLO','222LyplDU','3652268cYyFRp','12908WSSFfH','14590MFcjNZ','11AsZTPr','1084226PvASZf','3144PoohLf','./src/api','1682230SJdugP','1225317APkSAh'];a141_0x1905=function(){return _0x2a7b2e;};return a141_0x1905();}export const DEFAULT_API_DIR=a141_0x580441(0x1a6);
1
+ const a141_0x3dfb53=a141_0x1443;(function(_0x5bdfc8,_0x4d98e5){const _0x28ff10=a141_0x1443,_0x3483eb=_0x5bdfc8();while(!![]){try{const _0x5d348e=-parseInt(_0x28ff10(0x153))/0x1+parseInt(_0x28ff10(0x158))/0x2+parseInt(_0x28ff10(0x152))/0x3+-parseInt(_0x28ff10(0x159))/0x4*(-parseInt(_0x28ff10(0x157))/0x5)+-parseInt(_0x28ff10(0x156))/0x6+-parseInt(_0x28ff10(0x155))/0x7+parseInt(_0x28ff10(0x154))/0x8;if(_0x5d348e===_0x4d98e5)break;else _0x3483eb['push'](_0x3483eb['shift']());}catch(_0x350fb0){_0x3483eb['push'](_0x3483eb['shift']());}}}(a141_0x46b5,0xea39f));export const DEFAULT_API_DIR=a141_0x3dfb53(0x151);function a141_0x1443(_0xcd3215,_0x1c5329){_0xcd3215=_0xcd3215-0x151;const _0x46b520=a141_0x46b5();let _0x1443d1=_0x46b520[_0xcd3215];return _0x1443d1;}function a141_0x46b5(){const _0x37b28f=['4474694vhnmmU','6842394EZVLIY','35wPlBfG','590970VGXkCO','183856oJwfGg','./src/api','598773cIyheF','1126336LSMNJC','24388352CyqJXQ'];a141_0x46b5=function(){return _0x37b28f;};return a141_0x46b5();}
@@ -1 +1 @@
1
- const a142_0x3fac10=a142_0x5188;function a142_0x5188(_0x505c2e,_0x2823ba){_0x505c2e=_0x505c2e-0x84;const _0x78f816=a142_0x78f8();let _0x51882d=_0x78f816[_0x505c2e];return _0x51882d;}(function(_0x58d02f,_0x1c89a7){const _0x2cdcd6=a142_0x5188,_0x1a5fa2=_0x58d02f();while(!![]){try{const _0x4a095d=parseInt(_0x2cdcd6(0x8d))/0x1*(-parseInt(_0x2cdcd6(0x8c))/0x2)+-parseInt(_0x2cdcd6(0x85))/0x3+parseInt(_0x2cdcd6(0x8a))/0x4+-parseInt(_0x2cdcd6(0x87))/0x5*(parseInt(_0x2cdcd6(0x84))/0x6)+parseInt(_0x2cdcd6(0x8b))/0x7+parseInt(_0x2cdcd6(0x88))/0x8+parseInt(_0x2cdcd6(0x89))/0x9;if(_0x4a095d===_0x1c89a7)break;else _0x1a5fa2['push'](_0x1a5fa2['shift']());}catch(_0x7163e3){_0x1a5fa2['push'](_0x1a5fa2['shift']());}}}(a142_0x78f8,0x3534e));export const RISK_LEVEL_VALUES=[a142_0x3fac10(0x86),'write','high-risk-write'];function a142_0x78f8(){const _0x5014b9=['2326dbjJBq','115OagFfm','54uCbXlf','581127GlouEF','read','95305TsecSy','1164296OvznaW','1408437ktnnFN','1178424kReryE','842107NXvgbo'];a142_0x78f8=function(){return _0x5014b9;};return a142_0x78f8();}
1
+ (function(_0xf385a2,_0x17db3d){const _0x171230=a142_0x3762,_0x2a258f=_0xf385a2();while(!![]){try{const _0x341fa7=parseInt(_0x171230(0x125))/0x1*(parseInt(_0x171230(0x126))/0x2)+parseInt(_0x171230(0x130))/0x3*(-parseInt(_0x171230(0x12b))/0x4)+-parseInt(_0x171230(0x12e))/0x5*(parseInt(_0x171230(0x129))/0x6)+-parseInt(_0x171230(0x12a))/0x7*(parseInt(_0x171230(0x127))/0x8)+-parseInt(_0x171230(0x12c))/0x9*(parseInt(_0x171230(0x128))/0xa)+-parseInt(_0x171230(0x12f))/0xb*(-parseInt(_0x171230(0x124))/0xc)+-parseInt(_0x171230(0x131))/0xd*(-parseInt(_0x171230(0x12d))/0xe);if(_0x341fa7===_0x17db3d)break;else _0x2a258f['push'](_0x2a258f['shift']());}catch(_0x4fb298){_0x2a258f['push'](_0x2a258f['shift']());}}}(a142_0x13c9,0xbefa8));function a142_0x3762(_0x1bc44a,_0x1ccd34){_0x1bc44a=_0x1bc44a-0x124;const _0x13c929=a142_0x13c9();let _0x376251=_0x13c929[_0x1bc44a];return _0x376251;}function a142_0x13c9(){const _0x3ac6ce=['40UiWnEP','1360271lDVkKj','501369ZLIolK','123773ujGvMe','12qizrno','1338167xWKbAo','2SbCpck','7136IBExDF','60PULjqQ','715794vftfoO','10234uBWYAc','12ZMLYcI','207162mBaWdn','3262HVvheG'];a142_0x13c9=function(){return _0x3ac6ce;};return a142_0x13c9();}export const RISK_LEVEL_VALUES=['read','write','high-risk-write'];