@lovrabet/rabetbase-cli 2.1.2 → 2.1.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 (187) 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 -0
  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/dataset/detail.js +1 -1
  48. package/lib/commands/dataset/index.js +1 -1
  49. package/lib/commands/dataset/links.js +1 -1
  50. package/lib/commands/dataset/list.js +1 -1
  51. package/lib/commands/dataset/operations.js +1 -1
  52. package/lib/commands/db/analyze-cancel.js +1 -1
  53. package/lib/commands/db/analyze-start.js +1 -1
  54. package/lib/commands/db/analyze-status.js +1 -1
  55. package/lib/commands/db/create.js +1 -1
  56. package/lib/commands/db/delete.js +1 -1
  57. package/lib/commands/db/detail.js +1 -1
  58. package/lib/commands/db/diff.js +1 -1
  59. package/lib/commands/db/index.js +1 -1
  60. package/lib/commands/db/list.js +1 -1
  61. package/lib/commands/db/shared.js +1 -1
  62. package/lib/commands/db/tables.js +1 -1
  63. package/lib/commands/db/test.js +1 -1
  64. package/lib/commands/db/update.js +1 -1
  65. package/lib/commands/doctor.js +1 -1
  66. package/lib/commands/init/index.js +1 -1
  67. package/lib/commands/logs/index.js +1 -1
  68. package/lib/commands/menu/index.js +1 -1
  69. package/lib/commands/menu/shared/compare-table.js +1 -1
  70. package/lib/commands/menu/shared/index.js +1 -1
  71. package/lib/commands/menu/shared/inquirer.js +1 -1
  72. package/lib/commands/menu/shared/local-pages.js +1 -1
  73. package/lib/commands/menu/shared/logic.js +1 -1
  74. package/lib/commands/menu/shared/service.js +1 -1
  75. package/lib/commands/menu/shared/sync-core.js +1 -1
  76. package/lib/commands/menu/shared/update-core.js +1 -1
  77. package/lib/commands/menu/shared/valid-url.js +1 -1
  78. package/lib/commands/menu/sync.js +1 -1
  79. package/lib/commands/menu/update.js +1 -1
  80. package/lib/commands/page/generate-start.js +1 -0
  81. package/lib/commands/page/generate-status.js +1 -0
  82. package/lib/commands/page/index.js +1 -0
  83. package/lib/commands/page/pull.js +1 -0
  84. package/lib/commands/page/push.js +1 -0
  85. package/lib/commands/page/shared.js +1 -0
  86. package/lib/commands/page/standard-page-status.js +1 -0
  87. package/lib/commands/page/sync.js +1 -0
  88. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  89. package/lib/commands/project/create/format-elapsed.js +1 -1
  90. package/lib/commands/project/create/main.js +1 -1
  91. package/lib/commands/project/create/non-interactive.js +1 -1
  92. package/lib/commands/project/create/project-template-path.js +1 -1
  93. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  94. package/lib/commands/project/create/use-format-code.js +1 -1
  95. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  96. package/lib/commands/project/index.js +1 -1
  97. package/lib/commands/project/init.js +1 -1
  98. package/lib/commands/project/upgrade.js +1 -1
  99. package/lib/commands/registry.js +1 -1
  100. package/lib/commands/run/index.js +1 -1
  101. package/lib/commands/schema.js +1 -1
  102. package/lib/commands/skill/index.js +1 -1
  103. package/lib/commands/sql/create.js +1 -0
  104. package/lib/commands/sql/delete.js +1 -0
  105. package/lib/commands/sql/detail.js +1 -1
  106. package/lib/commands/sql/exec.js +1 -1
  107. package/lib/commands/sql/index.js +1 -1
  108. package/lib/commands/sql/list.js +1 -1
  109. package/lib/commands/sql/pull.js +1 -1
  110. package/lib/commands/sql/push.js +1 -0
  111. package/lib/commands/sql/save.js +1 -1
  112. package/lib/commands/sql/shared.js +1 -1
  113. package/lib/commands/sql/status.js +1 -0
  114. package/lib/commands/sql/validate.js +1 -1
  115. package/lib/config/schema.js +1 -1
  116. package/lib/constant/cdn.js +1 -0
  117. package/lib/constant/cli.js +1 -1
  118. package/lib/constant/defaults.js +1 -1
  119. package/lib/constant/domain.js +1 -1
  120. package/lib/constant/env.js +1 -1
  121. package/lib/constant/output.js +1 -1
  122. package/lib/constant/paths.js +1 -1
  123. package/lib/constant/risk.js +1 -1
  124. package/lib/context.js +1 -1
  125. package/lib/core/alias-resolver.js +1 -1
  126. package/lib/core/api-client.js +1 -1
  127. package/lib/core/bff/config.js +1 -1
  128. package/lib/core/bff/file-system.js +1 -1
  129. package/lib/core/bff/hash.js +1 -1
  130. package/lib/core/bff/lock.js +1 -1
  131. package/lib/core/bff/utils.js +1 -1
  132. package/lib/core/db-resolver.js +1 -1
  133. package/lib/core/page/file-system.js +1 -0
  134. package/lib/core/page/hash.js +1 -0
  135. package/lib/core/page/lock.js +1 -0
  136. package/lib/core/page/types.js +1 -0
  137. package/lib/core/sql-sync/config.js +1 -0
  138. package/lib/core/sql-sync/file-system.js +1 -0
  139. package/lib/core/sql-sync/hash.js +1 -0
  140. package/lib/core/sql-sync/lock.js +1 -0
  141. package/lib/core/sql-sync/types.js +1 -0
  142. package/lib/core/sql-sync/utils.js +1 -0
  143. package/lib/core/sql-validator.js +1 -1
  144. package/lib/errors.js +1 -1
  145. package/lib/framework/build-all-flags.js +1 -1
  146. package/lib/framework/flags.js +1 -1
  147. package/lib/framework/help.js +1 -1
  148. package/lib/framework/index.js +1 -1
  149. package/lib/framework/output.js +1 -1
  150. package/lib/framework/response.js +1 -1
  151. package/lib/framework/runner-alias.js +1 -1
  152. package/lib/framework/runner.js +1 -1
  153. package/lib/framework/schema-export.js +1 -1
  154. package/lib/framework/types.js +1 -1
  155. package/lib/generated/build-info.js +1 -1
  156. package/lib/help.js +1 -1
  157. package/lib/skills/main.js +1 -1
  158. package/lib/skills/npx-skills-add.js +1 -1
  159. package/lib/telemetry/cli-command-trace.js +1 -1
  160. package/lib/telemetry/cli-help-trace.js +1 -1
  161. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  162. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  163. package/lib/telemetry/send-cli-trace-log.js +1 -1
  164. package/lib/utils/ai_config.js +1 -1
  165. package/lib/utils/apply-jq-filter.js +1 -1
  166. package/lib/utils/cdn-config.js +1 -1
  167. package/lib/utils/check-sdk-version.js +1 -1
  168. package/lib/utils/cli-version-check.js +1 -1
  169. package/lib/utils/cli-version-policy.js +1 -0
  170. package/lib/utils/config.js +1 -1
  171. package/lib/utils/copy-directory.js +1 -1
  172. package/lib/utils/entity-with-id.js +1 -1
  173. package/lib/utils/file-utils.js +1 -1
  174. package/lib/utils/guides-cdn.js +1 -1
  175. package/lib/utils/http-client.js +1 -1
  176. package/lib/utils/is-non-interactive.js +1 -1
  177. package/lib/utils/logger.js +1 -1
  178. package/lib/utils/platform.js +1 -1
  179. package/lib/utils/rules-cdn.js +1 -1
  180. package/lib/utils/sleep.js +1 -1
  181. package/lib/utils/template-replacer.js +1 -1
  182. package/lib/utils/version.js +1 -1
  183. package/lib/utils/with-active-cookie.js +1 -1
  184. package/lib/utils/write-cli-side-channel.js +1 -1
  185. package/package.json +3 -2
  186. package/templates/skill/SKILL.md.tpl +1 -1
  187. package/lib/commands/bff/new.js +0 -1
@@ -1 +1 @@
1
- const a77_0x1a3bd0=a77_0x5393;function a77_0x5393(_0x587b62,_0x66aece){_0x587b62=_0x587b62-0x178;const _0x73c642=a77_0x73c6();let _0x5393e0=_0x73c642[_0x587b62];return _0x5393e0;}(function(_0x2401ef,_0x425bea){const _0x39bc59=a77_0x5393,_0x36681c=_0x2401ef();while(!![]){try{const _0x19971c=parseInt(_0x39bc59(0x18e))/0x1+-parseInt(_0x39bc59(0x183))/0x2+parseInt(_0x39bc59(0x179))/0x3+parseInt(_0x39bc59(0x182))/0x4+-parseInt(_0x39bc59(0x18b))/0x5*(-parseInt(_0x39bc59(0x18c))/0x6)+parseInt(_0x39bc59(0x17c))/0x7+-parseInt(_0x39bc59(0x188))/0x8*(parseInt(_0x39bc59(0x18a))/0x9);if(_0x19971c===_0x425bea)break;else _0x36681c['push'](_0x36681c['shift']());}catch(_0x336d9c){_0x36681c['push'](_0x36681c['shift']());}}}(a77_0x73c6,0x20474));import{CliErrors}from'../../errors.js';function a77_0x73c6(){const _0x34ed9f=['119628mAmvAO','1865YAykpE','1452IZtlMT','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','207087CyBvEV','setLogPath','npx\x20skills\x20add\x20failed:\x20','info','pipe','cwd','lovrabet/rabetbase','391668IYiXlv','../../skills/npx-skills-add.js','write','850983SmosqO','Check\x20network\x20connectivity\x20and\x20try\x20again.','skill-install','inherit','install','\x20skill\x20installed','610276zCvBsW','49726cJguNI','Install\x20developer\x20skill\x20package','apiError','log','skill','328FTqjaE','unknown'];a77_0x73c6=function(){return _0x34ed9f;};return a77_0x73c6();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';export const skillDefinitions=[{'service':a77_0x1a3bd0(0x187),'command':a77_0x1a3bd0(0x180),'description':a77_0x1a3bd0(0x184),'risk':a77_0x1a3bd0(0x17b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5f17a0){const _0x32dc31=a77_0x1a3bd0;logger[_0x32dc31(0x18f)](process[_0x32dc31(0x193)]()),logger[_0x32dc31(0x191)](_0x32dc31(0x17e),'执行安装技能包命令(委托给\x20npx\x20skills\x20--global)');const {runNpxSkillsAddGlobal:_0x3304e4}=await import(_0x32dc31(0x17a)),_0x19d74e=_0x5f17a0['nonInteractive']?_0x32dc31(0x192):_0x32dc31(0x17f);console[_0x32dc31(0x186)]('Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...');const _0x102386=_0x3304e4(process[_0x32dc31(0x193)](),_0x32dc31(0x178),{'stdio':_0x19d74e});if(_0x102386['skipped'])console['log'](_0x32dc31(0x18d));else{if(_0x102386['ok'])console[_0x32dc31(0x186)](CLI_BIN_NAME+_0x32dc31(0x181));else throw CliErrors[_0x32dc31(0x185)](_0x32dc31(0x190)+(_0x102386['error']||_0x32dc31(0x189)),_0x32dc31(0x17d));}return{'ok':!![]};}}];
1
+ const a102_0x51cdba=a102_0x4729;(function(_0x5cde2c,_0x9027fe){const _0x30b2a4=a102_0x4729,_0x27dbac=_0x5cde2c();while(!![]){try{const _0x304a63=-parseInt(_0x30b2a4(0x177))/0x1+-parseInt(_0x30b2a4(0x179))/0x2+-parseInt(_0x30b2a4(0x185))/0x3*(-parseInt(_0x30b2a4(0x189))/0x4)+parseInt(_0x30b2a4(0x186))/0x5+parseInt(_0x30b2a4(0x181))/0x6+-parseInt(_0x30b2a4(0x170))/0x7*(parseInt(_0x30b2a4(0x183))/0x8)+parseInt(_0x30b2a4(0x17a))/0x9;if(_0x304a63===_0x9027fe)break;else _0x27dbac['push'](_0x27dbac['shift']());}catch(_0x482c95){_0x27dbac['push'](_0x27dbac['shift']());}}}(a102_0x2008,0xf2f19));function a102_0x2008(){const _0x3200f6=['log','845389uqBVip','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...','2796172aaLqur','25280208jOJgbR','npx\x20skills\x20add\x20failed:\x20','skill','nonInteractive','write','unknown','info','288726uTeQPo','skill-install','12469944gHLWbs','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','6AhTfRR','6065340ShSENJ','setLogPath','../../skills/npx-skills-add.js','1454428dXBrov','skipped','Check\x20network\x20connectivity\x20and\x20try\x20again.','7lXehFe','执行安装技能包命令(委托给\x20npx\x20skills\x20--global)','inherit','install','Install\x20developer\x20skill\x20package','cwd'];a102_0x2008=function(){return _0x3200f6;};return a102_0x2008();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';function a102_0x4729(_0x59c578,_0x56d491){_0x59c578=_0x59c578-0x170;const _0x200865=a102_0x2008();let _0x4729b4=_0x200865[_0x59c578];return _0x4729b4;}export const skillDefinitions=[{'service':a102_0x51cdba(0x17c),'command':a102_0x51cdba(0x173),'description':a102_0x51cdba(0x174),'risk':a102_0x51cdba(0x17e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1e79c5){const _0x286917=a102_0x51cdba;logger[_0x286917(0x187)](process[_0x286917(0x175)]()),logger[_0x286917(0x180)](_0x286917(0x182),_0x286917(0x171));const {runNpxSkillsAddGlobal:_0x440b98}=await import(_0x286917(0x188)),_0xb0614b=_0x1e79c5[_0x286917(0x17d)]?'pipe':_0x286917(0x172);console[_0x286917(0x176)](_0x286917(0x178));const _0x50894a=_0x440b98(process[_0x286917(0x175)](),'lovrabet/rabetbase',{'stdio':_0xb0614b});if(_0x50894a[_0x286917(0x18a)])console['log'](_0x286917(0x184));else{if(_0x50894a['ok'])console[_0x286917(0x176)](CLI_BIN_NAME+'\x20skill\x20installed');else throw CliErrors['apiError'](_0x286917(0x17b)+(_0x50894a['error']||_0x286917(0x17f)),_0x286917(0x18b));}return{'ok':!![]};}}];
@@ -0,0 +1 @@
1
+ const a103_0x14f586=a103_0x1be4;(function(_0x575320,_0x20151a){const _0x158e85=a103_0x1be4,_0x708cec=_0x575320();while(!![]){try{const _0x33b219=-parseInt(_0x158e85(0x158))/0x1*(-parseInt(_0x158e85(0x16b))/0x2)+parseInt(_0x158e85(0x14d))/0x3+parseInt(_0x158e85(0x160))/0x4*(-parseInt(_0x158e85(0x142))/0x5)+-parseInt(_0x158e85(0x159))/0x6+parseInt(_0x158e85(0x14e))/0x7+-parseInt(_0x158e85(0x145))/0x8+parseInt(_0x158e85(0x12e))/0x9;if(_0x33b219===_0x20151a)break;else _0x708cec['push'](_0x708cec['shift']());}catch(_0x461cba){_0x708cec['push'](_0x708cec['shift']());}}}(a103_0x5442,0xbebfd));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';function a103_0x5442(){const _0x93cbae=['sqls','catch','\x20\x20SELECT\x201\x20AS\x20id','create','str','2532504tlNbwD','9261063KBwIan','File\x20already\x20exists:\x20','nonInteractive','join','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','isFinite','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','请选择本地\x20SQL\x20模式:','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlCode','2131ICOOUP','230466nJzWLh','sqlRoot','SQL\x20名称不能为空','appCode','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','sql','flag','373112FMwLRU','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','string','description','适合带动态标签的\x20MyBatis\x20XML\x20SQL','utf8','high-risk-write','POST','isInteger','dbName','Target\x20database\x20ID','1252DJUKan','</select>','name','number','map','__manual__','✎\x20手动输入\x20dbId','sqlName','1435248uBuceU','请选择目标数据库:','sqlRootDir','length','toISOString','<server-generated-sqlCode>','trim','Invalid\x20database\x20selection\x20payload:\x20','SQL\x20query\x20display\x20name','普通\x20SQL(sql)','mode','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','SELECT\x201\x20AS\x20id;','/smartapi/custom/saveUserCustomSql','dbId','parse','validation','MyBatis\x20XML(mybatisXml)','Local\x20SQL\x20file\x20mode','lastSync','80MCTTGl','flagMissing','lockFilePath','10787896FLIxdY','db-id','mybatisXml'];a103_0x5442=function(){return _0x93cbae;};return a103_0x5442();}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x51f69f){const _0xc0e4b9=a103_0x1be4;if(_0x51f69f===_0xc0e4b9(0x147))return[_0xc0e4b9(0x139),_0xc0e4b9(0x14a),_0xc0e4b9(0x16c),''][_0xc0e4b9(0x151)]('\x0a');return[_0xc0e4b9(0x13a),'']['join']('\x0a');}export const sqlCreate={'service':a103_0x14f586(0x15e),'command':a103_0x14f586(0x14b),'description':a103_0x14f586(0x154),'risk':a103_0x14f586(0x166),'flags':[{'name':a103_0x14f586(0x16d),'type':a103_0x14f586(0x162),'description':a103_0x14f586(0x136)},{'name':a103_0x14f586(0x146),'type':'number','description':a103_0x14f586(0x16a)},{'name':a103_0x14f586(0x138),'type':'string','enum':[a103_0x14f586(0x15e),'mybatisXml'],'description':a103_0x14f586(0x140)}],async 'validate'(_0x127629){const _0x36c015=a103_0x14f586;if(!_0x127629['nonInteractive'])return;if(!_0x127629[_0x36c015(0x14c)](_0x36c015(0x16d))[_0x36c015(0x134)]())throw CliErrors[_0x36c015(0x143)](_0x36c015(0x16d),_0x36c015(0x152));const _0x3ca7e9=resolveProvidedDbId(_0x127629);if(typeof _0x3ca7e9!==_0x36c015(0x16e)||!Number[_0x36c015(0x153)](_0x3ca7e9)||_0x3ca7e9<=0x0)throw CliErrors['flagMissing'](_0x36c015(0x146),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x127629[_0x36c015(0x14c)]('mode')['trim']())throw CliErrors[_0x36c015(0x143)](_0x36c015(0x138),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x26e118){const _0x31057b=a103_0x14f586,_0x2c4871=loadSqlProjectConfig(_0x26e118[_0x31057b(0x15c)]),{sqlName:_0x3fd90d,dbId:_0x2fecb7,dbName:_0x16ead3,mode:_0x39b1fe}=await resolveSqlNewInputs(_0x26e118),_0x48804a=buildSqlRelativePath(_0x31057b(0x133),_0x3fd90d,_0x16ead3,_0x39b1fe,_0x2fecb7),_0x17e070=_0x2c4871[_0x31057b(0x130)]+'/'+_0x48804a;return{'method':_0x31057b(0x167),'url':_0x31057b(0x13b),'body':{'appCode':_0x26e118[_0x31057b(0x15c)],'sqlName':_0x3fd90d,'dbId':_0x2fecb7,'mode':_0x39b1fe,'localPath':_0x17e070},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x2c4871[_0x31057b(0x130)]};},async 'execute'(_0x1087a2){const _0x23fde6=a103_0x14f586,_0x3bd4da=loadSqlProjectConfig(_0x1087a2[_0x23fde6(0x15c)]),{sqlName:_0x3b762f,dbId:_0x86b7cc,dbName:_0x31288d,mode:_0x15c4bd}=await resolveSqlNewInputs(_0x1087a2),_0x2cb69a=generateSqlTemplate(_0x15c4bd),_0x31debf=await createSqlQuery({'appCode':_0x1087a2[_0x23fde6(0x15c)],'sqlName':_0x3b762f,'dbId':_0x86b7cc,'sqlContent':_0x2cb69a}),_0x589486=ensureRemoteSqlContent(_0x31debf),_0x38e62f=_0x31288d||await getDbName(_0x1087a2[_0x23fde6(0x15c)],_0x86b7cc)[_0x23fde6(0x149)](()=>undefined),_0x2fa15c=buildSqlRelativePath(_0x31debf[_0x23fde6(0x157)],_0x31debf['sqlName'],_0x38e62f,_0x15c4bd,_0x86b7cc),_0x3b2ece=_0x3bd4da['sqlRootDir']+'/'+_0x2fa15c,_0x278d29=buildLocalSqlFileContent({'sqlCode':_0x31debf[_0x23fde6(0x157)],'sqlName':_0x31debf['sqlName'],'dbId':_0x31debf[_0x23fde6(0x13c)]},_0x589486,{'dbName':_0x38e62f,'mode':_0x15c4bd,'syncedAt':new Date()[_0x23fde6(0x132)](),'description':_0x31debf[_0x23fde6(0x163)]});if(await fileExists(_0x3b2ece))throw CliErrors['validation'](_0x23fde6(0x14f)+_0x3b2ece);await ensureParentDirectory(_0x3b2ece),await writeFile(_0x3b2ece,_0x278d29,_0x23fde6(0x165));const _0x258c3e=await readSqlLockFile(_0x3bd4da['lockFilePath']),{lockData:_0x50b0f1,appLock:_0x26ee27}=ensureSqlLockScope(_0x258c3e??createEmptySqlLock(),_0x3bd4da['appCode'],_0x3bd4da[_0x23fde6(0x15a)],'new');return _0x26ee27[_0x23fde6(0x148)][_0x31debf[_0x23fde6(0x157)]]={...buildSqlLockEntry(_0x31debf,_0x589486,computeSqlContentHash(_0x278d29),{'dbName':_0x38e62f}),'path':_0x2fa15c,'mode':_0x15c4bd},_0x26ee27[_0x23fde6(0x141)]=new Date()['toISOString'](),await writeSqlLockFile(_0x3bd4da[_0x23fde6(0x144)],_0x50b0f1),{'ok':!![],'data':{'id':_0x31debf['id'],'sqlCode':_0x31debf['sqlCode'],'sqlName':_0x31debf[_0x23fde6(0x12d)],'dbId':_0x31debf[_0x23fde6(0x13c)],'path':_0x3b2ece,'mode':_0x15c4bd},'message':'Created\x20SQL\x20query\x20'+_0x31debf[_0x23fde6(0x157)]};}};async function resolveSqlNewInputs(_0x910815){const _0x399247=await resolveSqlNameInput(_0x910815),{dbId:_0x1976bb,dbName:_0x398dd8}=await resolveDbSelection(_0x910815),_0x3bc62d=await resolveSqlModeInput(_0x910815);return{'sqlName':_0x399247,'dbId':_0x1976bb,'dbName':_0x398dd8,'mode':_0x3bc62d};}function a103_0x1be4(_0x176378,_0x16fbca){_0x176378=_0x176378-0x12a;const _0x54423e=a103_0x5442();let _0x1be421=_0x54423e[_0x176378];return _0x1be421;}async function resolveSqlNameInput(_0x356eb2){const _0x60b4c9=a103_0x14f586,_0x2429d1=_0x356eb2[_0x60b4c9(0x14c)](_0x60b4c9(0x16d))[_0x60b4c9(0x134)]();if(_0x2429d1)return _0x2429d1;if(_0x356eb2[_0x60b4c9(0x150)])throw CliErrors[_0x60b4c9(0x143)](_0x60b4c9(0x16d),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':'请输入\x20SQL\x20名称:','validate':_0x156044=>_0x156044[_0x60b4c9(0x134)]()?!![]:_0x60b4c9(0x15b)}))['trim']();}async function resolveDbSelection(_0x5319e6){const _0x637736=a103_0x14f586,_0x36ca0f=resolveProvidedDbId(_0x5319e6);if(typeof _0x36ca0f===_0x637736(0x16e)&&Number[_0x637736(0x153)](_0x36ca0f)&&_0x36ca0f>0x0)return{'dbId':_0x36ca0f,'dbName':await getDbName(_0x5319e6[_0x637736(0x15c)],_0x36ca0f)[_0x637736(0x149)](()=>undefined)};if(_0x5319e6[_0x637736(0x150)])throw CliErrors['flagMissing']('db-id',_0x637736(0x15d));const _0x56fc86=await listDatabases(_0x5319e6[_0x637736(0x15c)])['catch'](()=>[]);if(_0x56fc86[_0x637736(0x131)]===0x1)return{'dbId':_0x56fc86[0x0][_0x637736(0x13c)],'dbName':_0x56fc86[0x0][_0x637736(0x169)]};if(_0x56fc86[_0x637736(0x131)]>0x1){const _0x526aec=await select({'message':_0x637736(0x12f),'choices':[..._0x56fc86[_0x637736(0x12a)](_0x2a7222=>({'name':_0x2a7222[_0x637736(0x169)]+'\x20('+_0x2a7222[_0x637736(0x13c)]+')','value':serializeDbSelection(_0x2a7222)})),{'name':_0x637736(0x12c),'value':'__manual__'}]});if(_0x526aec!==_0x637736(0x12b))return deserializeDbSelection(_0x526aec);}const _0x5ce1e9=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x137aa3=>{const _0x2a0363=_0x637736,_0x1bf1a4=_0x137aa3[_0x2a0363(0x134)]();if(!_0x1bf1a4)return'dbId\x20不能为空';const _0x3200f6=Number(_0x1bf1a4);if(!Number[_0x2a0363(0x168)](_0x3200f6)||_0x3200f6<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x5ce1e9[_0x637736(0x134)]())};}async function resolveSqlModeInput(_0x554a86){const _0x4699db=a103_0x14f586,_0x307c90=_0x554a86['str'](_0x4699db(0x138))[_0x4699db(0x134)]();if(_0x307c90===_0x4699db(0x15e)||_0x307c90==='mybatisXml')return _0x307c90;if(_0x554a86[_0x4699db(0x150)])throw CliErrors[_0x4699db(0x143)](_0x4699db(0x138),_0x4699db(0x156));return await select({'message':_0x4699db(0x155),'choices':[{'name':_0x4699db(0x137),'value':_0x4699db(0x15e),'description':_0x4699db(0x161)},{'name':_0x4699db(0x13f),'value':'mybatisXml','description':_0x4699db(0x164)}]});}function serializeDbSelection(_0xe5e909){const _0x4dcc3e=a103_0x14f586;return JSON['stringify']({'dbId':_0xe5e909[_0x4dcc3e(0x13c)],'dbName':_0xe5e909[_0x4dcc3e(0x169)]});}function deserializeDbSelection(_0x4b211b){const _0x1cc074=a103_0x14f586;try{const _0x5b2bfb=JSON[_0x1cc074(0x13d)](_0x4b211b);if(typeof _0x5b2bfb['dbId']===_0x1cc074(0x16e)&&Number[_0x1cc074(0x153)](_0x5b2bfb[_0x1cc074(0x13c)]))return{'dbId':_0x5b2bfb[_0x1cc074(0x13c)],'dbName':_0x5b2bfb[_0x1cc074(0x169)]};}catch{}throw CliErrors[_0x1cc074(0x13e)](_0x1cc074(0x135)+_0x4b211b);}function resolveProvidedDbId(_0x2abd87){const _0x1c197c=a103_0x14f586,_0x59ce47=_0x2abd87[_0x1c197c(0x15f)]('db-id');if(typeof _0x59ce47==='number'&&Number['isFinite'](_0x59ce47))return _0x59ce47;return undefined;}
@@ -0,0 +1 @@
1
+ const a104_0x55b88e=a104_0x3b52;function a104_0x1806(){const _0x13d5ba=['3089919XMovkQ','13721816cijvLm','lastSync','28cAUPmG','high-risk-write','replace','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','/smartapi/custom/deleteUserCustomSql','984481JYLccU','filter','trashDir','entries','startsWith','1374526HlTzLv','sqls','sqlcode','2554530WJEREr','fromEntries','length','validation','POST','486087UhEJvV','toISOString','delete','Deleted\x20','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','lockFilePath','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','appCode','str','2423178XoZSaZ','\x20(local\x20file\x20moved\x20to\x20trash)','remoteId','projectRoot'];a104_0x1806=function(){return _0x13d5ba;};return a104_0x1806();}(function(_0x2c30ba,_0x10e604){const _0x11f3fa=a104_0x3b52,_0x44230c=_0x2c30ba();while(!![]){try{const _0x3a8659=-parseInt(_0x11f3fa(0x1c6))/0x1+parseInt(_0x11f3fa(0x1cb))/0x2+-parseInt(_0x11f3fa(0x1d3))/0x3*(parseInt(_0x11f3fa(0x1c1))/0x4)+parseInt(_0x11f3fa(0x1ce))/0x5+-parseInt(_0x11f3fa(0x1dc))/0x6+parseInt(_0x11f3fa(0x1e0))/0x7+parseInt(_0x11f3fa(0x1bf))/0x8;if(_0x3a8659===_0x10e604)break;else _0x44230c['push'](_0x44230c['shift']());}catch(_0x1260d5){_0x44230c['push'](_0x44230c['shift']());}}}(a104_0x1806,0xcb30a));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a104_0x3b52(_0x31c618,_0x367b1e){_0x31c618=_0x31c618-0x1bf;const _0x1806b5=a104_0x1806();let _0x3b52fb=_0x1806b5[_0x31c618];return _0x3b52fb;}export const sqlDelete={'service':'sql','command':'delete','description':a104_0x55b88e(0x1d9),'risk':a104_0x55b88e(0x1c2),'flags':[SQLCODE_FLAG],async 'validate'(_0x3dcb6a){const _0x52378d=a104_0x55b88e,_0x318c92=loadSqlProjectConfig(_0x3dcb6a[_0x52378d(0x1da)]),_0x126f90=await readSqlLockFile(_0x318c92[_0x52378d(0x1d8)]);if(!_0x126f90)throw CliErrors[_0x52378d(0x1d1)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0xf75e1f){const _0x4eb907=a104_0x55b88e,_0x4edc10=loadSqlProjectConfig(_0xf75e1f[_0x4eb907(0x1da)]),_0x50fe42=await readSqlLockFile(_0x4edc10[_0x4eb907(0x1d8)]);if(!_0x50fe42)throw CliErrors[_0x4eb907(0x1d1)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x37140e}=ensureSqlLockScope(_0x50fe42,_0xf75e1f[_0x4eb907(0x1da)],_0x4edc10['sqlRoot'],_0x4eb907(0x1d5)),_0x52c1d8=_0xf75e1f[_0x4eb907(0x1db)](_0x4eb907(0x1cd)),_0x36cb51=_0x37140e['sqls'][_0x52c1d8];if(!_0x36cb51)throw CliErrors[_0x4eb907(0x1d1)](_0x4eb907(0x1c4)+_0x52c1d8+'\x22.');return{'method':_0x4eb907(0x1d2),'url':_0x4eb907(0x1c5),'body':{'sqlCode':_0x52c1d8,'id':_0x36cb51[_0x4eb907(0x1de)],'localPath':resolveLocalSqlFilePath(_0x4edc10,_0x52c1d8,_0x36cb51)},'description':'Would\x20delete\x20SQL\x20'+_0x52c1d8+_0x4eb907(0x1d7)+_0x4edc10[_0x4eb907(0x1c8)]};},async 'execute'(_0x450efb){const _0x8cab07=a104_0x55b88e,_0x352b41=loadSqlProjectConfig(_0x450efb['appCode']),_0x5c4fc2=await readSqlLockFile(_0x352b41['lockFilePath']);if(!_0x5c4fc2)throw CliErrors[_0x8cab07(0x1d1)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x1e1ca9,appLock:_0x3920b1}=ensureSqlLockScope(_0x5c4fc2,_0x450efb[_0x8cab07(0x1da)],_0x352b41['sqlRoot'],'delete'),_0x3e64ce=_0x450efb[_0x8cab07(0x1db)](_0x8cab07(0x1cd)),_0x1082b3=_0x3920b1['sqls'][_0x3e64ce];if(!_0x1082b3)throw CliErrors[_0x8cab07(0x1d1)](_0x8cab07(0x1c4)+_0x3e64ce+'\x22.');await deleteSqlQuery({'id':_0x1082b3[_0x8cab07(0x1de)],'sqlCode':_0x3e64ce}),_0x3920b1['sqls']=Object[_0x8cab07(0x1cf)](Object[_0x8cab07(0x1c9)](_0x3920b1[_0x8cab07(0x1cc)])[_0x8cab07(0x1c7)](([_0x20126c])=>_0x20126c!==_0x3e64ce)),_0x3920b1[_0x8cab07(0x1c0)]=new Date()['toISOString'](),await writeSqlLockFile(_0x352b41[_0x8cab07(0x1d8)],_0x1e1ca9);const _0x4a295e=resolveLocalSqlFilePath(_0x352b41,_0x3e64ce,_0x1082b3);let _0x1b3ecf;await fileExists(_0x4a295e)&&(_0x1b3ecf=await moveToTrash(_0x352b41[_0x8cab07(0x1df)],_0x352b41[_0x8cab07(0x1c8)],_0x4a295e),await cleanupEmptyDirectories(dirname(_0x4a295e),_0x352b41['sqlRootDir']));const _0x141baf={'deleted':_0x3e64ce,'remoteId':_0x1082b3[_0x8cab07(0x1de)]};if(_0x1b3ecf)_0x141baf['trashedTo']=_0x1b3ecf;return{'ok':!![],'data':_0x141baf,'message':_0x8cab07(0x1d6)+_0x3e64ce+(_0x1b3ecf?_0x8cab07(0x1dd):'')};}};async function moveToTrash(_0x5ba55b,_0x751e06,_0xa1514c){const _0x1bcff6=a104_0x55b88e,_0xb39463=new Date()[_0x1bcff6(0x1d4)]()[_0x1bcff6(0x1c3)](/[:.]/g,'-'),_0x18ec14=relative(_0x5ba55b,_0xa1514c),_0xfd1f33=join(_0x751e06,_0xb39463,_0x18ec14);return await mkdir(dirname(_0xfd1f33),{'recursive':!![]}),await rename(_0xa1514c,_0xfd1f33),_0xfd1f33;}async function cleanupEmptyDirectories(_0x1df4c7,_0xde825b){const _0x3f82b8=a104_0x55b88e;let _0x8f52ef=resolve(_0x1df4c7);const _0x4ef37a=resolve(_0xde825b);while(_0x8f52ef[_0x3f82b8(0x1ca)](''+_0x4ef37a+sep)||_0x8f52ef===_0x4ef37a){if(_0x8f52ef===_0x4ef37a)return;try{const _0x37e5c0=await readdir(_0x8f52ef);if(_0x37e5c0[_0x3f82b8(0x1d0)]>0x0)return;await rmdir(_0x8f52ef);}catch{return;}_0x8f52ef=dirname(_0x8f52ef);}}
@@ -1 +1 @@
1
- const a82_0x559bf7=a82_0x226f;(function(_0x320772,_0x162898){const _0x24107f=a82_0x226f,_0x303d9d=_0x320772();while(!![]){try{const _0x18b39b=parseInt(_0x24107f(0x130))/0x1*(-parseInt(_0x24107f(0x124))/0x2)+parseInt(_0x24107f(0x131))/0x3*(-parseInt(_0x24107f(0x11d))/0x4)+parseInt(_0x24107f(0x127))/0x5+parseInt(_0x24107f(0x121))/0x6*(parseInt(_0x24107f(0x11f))/0x7)+-parseInt(_0x24107f(0x126))/0x8+-parseInt(_0x24107f(0x128))/0x9+-parseInt(_0x24107f(0x12b))/0xa*(-parseInt(_0x24107f(0x12f))/0xb);if(_0x18b39b===_0x162898)break;else _0x303d9d['push'](_0x303d9d['shift']());}catch(_0x217c8a){_0x303d9d['push'](_0x303d9d['shift']());}}}(a82_0x39a0,0xf378d));function a82_0x39a0(){const _0x2ca945=['3mmPwOM','Return\x20full\x20raw\x20SQL\x20query\x20object','sqlName','sqlContent','7142332hznFMK','appCode','7469LSXPhx','sql','1164ptkVNK','detail','str','977008lAbCXD','verbose','8639872OAnWco','2155950ooVIse','12285864AHaGRD','read','description','32718760peyFai','sqlCode','dbId','sqlcode','22oocqnm','4fQljkv'];a82_0x39a0=function(){return _0x2ca945;};return a82_0x39a0();}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a82_0x226f(_0x28e3cb,_0x435b61){_0x28e3cb=_0x28e3cb-0x11a;const _0x39a096=a82_0x39a0();let _0x226f61=_0x39a096[_0x28e3cb];return _0x226f61;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a82_0x559bf7(0x120),'command':a82_0x559bf7(0x122),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a82_0x559bf7(0x129),'flags':[SQLCODE_FLAG,{'name':a82_0x559bf7(0x125),'type':'boolean','description':a82_0x559bf7(0x11a)}],async 'execute'(_0x4c583e){const _0x58a8ce=a82_0x559bf7,_0x59215b=await getSqlQueryInfo(_0x4c583e['appCode'],_0x4c583e[_0x58a8ce(0x123)](_0x58a8ce(0x12e))),_0x2d0371=_0x4c583e['bool'](_0x58a8ce(0x125));if(_0x2d0371)return{'ok':!![],'data':_0x59215b};const _0x9c1e8=_0x59215b[_0x58a8ce(0x12d)]?await getDbName(_0x4c583e[_0x58a8ce(0x11e)],_0x59215b['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x59215b[_0x58a8ce(0x12c)],'sqlName':_0x59215b[_0x58a8ce(0x11b)],'db':_0x9c1e8?_0x9c1e8+'\x20('+_0x59215b['dbId']+')':_0x59215b[_0x58a8ce(0x12d)]??'','description':_0x59215b[_0x58a8ce(0x12a)]??'','sqlContent':_0x59215b[_0x58a8ce(0x11c)]??''}};}};
1
+ function a105_0x22aa(_0x3fc022,_0x57bb56){_0x3fc022=_0x3fc022-0xc5;const _0x824401=a105_0x8244();let _0x22aaee=_0x824401[_0x3fc022];return _0x22aaee;}const a105_0x50b25b=a105_0x22aa;(function(_0x5584aa,_0x4be483){const _0x12006d=a105_0x22aa,_0x270c25=_0x5584aa();while(!![]){try{const _0x1793ab=parseInt(_0x12006d(0xcf))/0x1+-parseInt(_0x12006d(0xd7))/0x2*(parseInt(_0x12006d(0xdb))/0x3)+-parseInt(_0x12006d(0xd6))/0x4*(parseInt(_0x12006d(0xce))/0x5)+parseInt(_0x12006d(0xc7))/0x6+-parseInt(_0x12006d(0xd8))/0x7+-parseInt(_0x12006d(0xd1))/0x8*(-parseInt(_0x12006d(0xcb))/0x9)+-parseInt(_0x12006d(0xcc))/0xa;if(_0x1793ab===_0x4be483)break;else _0x270c25['push'](_0x270c25['shift']());}catch(_0x1873e7){_0x270c25['push'](_0x270c25['shift']());}}}(a105_0x8244,0x4f0b2));import{getSqlQueryInfo}from'../../core/api-client.js';function a105_0x8244(){const _0x5a1990=['sqlCode','631872RWLall','sql','dbId','str','52785lOyHCk','2745930mFbctU','appCode','720745qVvwSU','350897uFkgXD','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','872npLfJd','bool','Return\x20full\x20raw\x20SQL\x20query\x20object','sqlName','read','4xetUve','442hQbSvS','956417pENRSd','description','sqlContent','2937jzmCJk','verbose'];a105_0x8244=function(){return _0x5a1990;};return a105_0x8244();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a105_0x50b25b(0xc8),'command':'detail','description':a105_0x50b25b(0xd0),'risk':a105_0x50b25b(0xd5),'flags':[SQLCODE_FLAG,{'name':a105_0x50b25b(0xc5),'type':'boolean','description':a105_0x50b25b(0xd3)}],async 'execute'(_0x4942ec){const _0x55bf2f=a105_0x50b25b,_0x4be9b3=await getSqlQueryInfo(_0x4942ec[_0x55bf2f(0xcd)],_0x4942ec[_0x55bf2f(0xca)]('sqlcode')),_0x3f1e67=_0x4942ec[_0x55bf2f(0xd2)](_0x55bf2f(0xc5));if(_0x3f1e67)return{'ok':!![],'data':_0x4be9b3};const _0x3b9a94=_0x4be9b3['dbId']?await getDbName(_0x4942ec[_0x55bf2f(0xcd)],_0x4be9b3[_0x55bf2f(0xc9)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x4be9b3[_0x55bf2f(0xc6)],'sqlName':_0x4be9b3[_0x55bf2f(0xd4)],'db':_0x3b9a94?_0x3b9a94+'\x20('+_0x4be9b3[_0x55bf2f(0xc9)]+')':_0x4be9b3[_0x55bf2f(0xc9)]??'','description':_0x4be9b3[_0x55bf2f(0xd9)]??'','sqlContent':_0x4be9b3[_0x55bf2f(0xda)]??''}};}};
@@ -1 +1 @@
1
- function a85_0x4504(_0x39b803,_0x56ecbd){_0x39b803=_0x39b803-0x142;const _0x589cb4=a85_0x589c();let _0x45042a=_0x589cb4[_0x39b803];return _0x45042a;}const a85_0x3a372c=a85_0x4504;(function(_0x5d0880,_0x37a27e){const _0x39e5ad=a85_0x4504,_0x2cbeae=_0x5d0880();while(!![]){try{const _0x2eca30=parseInt(_0x39e5ad(0x15a))/0x1*(-parseInt(_0x39e5ad(0x14c))/0x2)+parseInt(_0x39e5ad(0x14f))/0x3+parseInt(_0x39e5ad(0x158))/0x4+parseInt(_0x39e5ad(0x144))/0x5+parseInt(_0x39e5ad(0x148))/0x6+parseInt(_0x39e5ad(0x14d))/0x7*(-parseInt(_0x39e5ad(0x151))/0x8)+-parseInt(_0x39e5ad(0x153))/0x9;if(_0x2eca30===_0x37a27e)break;else _0x2cbeae['push'](_0x2cbeae['shift']());}catch(_0x21aadf){_0x2cbeae['push'](_0x2cbeae['shift']());}}}(a85_0x589c,0xda9b5));import{executeSql}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a85_0x589c(){const _0x33b370=['sql','1900728NTkOgN','execError','appCode','length','exec','5841624HCmBjm','SQL\x20execution\x20failed','1352558yBeakZ','execSuccess','str','317745ftojok','sqlcode','params','Returned\x20','4045950rwtTaf','parse','Invalid\x20JSON\x20for\x20--params:\x20','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','2iBGBZz','103817NxkMKK','execResult','1272072lvnuzM','string','88DjJdTr'];a85_0x589c=function(){return _0x33b370;};return a85_0x589c();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlExec={'service':a85_0x3a372c(0x152),'command':a85_0x3a372c(0x157),'description':a85_0x3a372c(0x14b),'risk':'read','flags':[SQLCODE_FLAG,{'name':'params','type':a85_0x3a372c(0x150),'description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x5a21e7){const _0x2c7c95=a85_0x3a372c;let _0x51d9d5;const _0x266a79=_0x5a21e7[_0x2c7c95(0x143)](_0x2c7c95(0x146));if(_0x266a79)try{_0x51d9d5=JSON[_0x2c7c95(0x149)](_0x266a79);}catch{throw CliErrors['validation'](_0x2c7c95(0x14a)+_0x266a79);}const _0x44a0db=Date['now'](),_0x2f1d8e=await executeSql(_0x5a21e7[_0x2c7c95(0x155)],_0x5a21e7[_0x2c7c95(0x143)](_0x2c7c95(0x145)),_0x51d9d5),_0xdee8ab=Date['now']()-_0x44a0db,_0x7f89e2=_0x2f1d8e?.[_0x2c7c95(0x14e)]??_0x2f1d8e,_0x4e5366=_0x2f1d8e?.[_0x2c7c95(0x142)]??!![];if(!_0x4e5366)return{'ok':![],'data':{'error':_0x2f1d8e?.[_0x2c7c95(0x154)]||'SQL\x20execution\x20failed','elapsed':_0xdee8ab},'message':_0x2c7c95(0x159)};const _0x2263c8=Array['isArray'](_0x7f89e2)?_0x7f89e2:[];return{'ok':!![],'data':{'rows':_0x2263c8,'rowCount':_0x2263c8[_0x2c7c95(0x156)],'elapsed':_0xdee8ab},'message':_0x2c7c95(0x147)+_0x2263c8[_0x2c7c95(0x156)]+'\x20row(s)\x20in\x20'+_0xdee8ab+'ms'};}};
1
+ function a106_0xb55d(){const _0x28bbfa=['789620jcedjX','length','read','85036nkOaYc','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','1108044ynXnBw','validation','execSuccess','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','9XmLzlw','4569VABXSd','6yHTReI','params','str','SQL\x20execution\x20failed','Invalid\x20JSON\x20for\x20--params:\x20','1154510QavPHy','parse','now','6300idWkRN','184SZLiyp','10263EPFvgx','appCode','394170WwwRlr','string','8zkEgYt','sql'];a106_0xb55d=function(){return _0x28bbfa;};return a106_0xb55d();}const a106_0x4d36cf=a106_0x3b7c;(function(_0x3c2786,_0x2d1113){const _0x2dd4f0=a106_0x3b7c,_0x5640a2=_0x3c2786();while(!![]){try{const _0x44900e=-parseInt(_0x2dd4f0(0xcd))/0x1+parseInt(_0x2dd4f0(0xc3))/0x2*(parseInt(_0x2dd4f0(0xd4))/0x3)+parseInt(_0x2dd4f0(0xcf))/0x4+parseInt(_0x2dd4f0(0xda))/0x5*(parseInt(_0x2dd4f0(0xd5))/0x6)+parseInt(_0x2dd4f0(0xc6))/0x7*(parseInt(_0x2dd4f0(0xc8))/0x8)+-parseInt(_0x2dd4f0(0xd3))/0x9*(-parseInt(_0x2dd4f0(0xca))/0xa)+parseInt(_0x2dd4f0(0xc4))/0xb*(-parseInt(_0x2dd4f0(0xc2))/0xc);if(_0x44900e===_0x2d1113)break;else _0x5640a2['push'](_0x5640a2['shift']());}catch(_0x4fefa2){_0x5640a2['push'](_0x5640a2['shift']());}}}(a106_0xb55d,0x32e38));import{executeSql}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a106_0x3b7c(_0x59352c,_0x14d8fd){_0x59352c=_0x59352c-0xc1;const _0xb55d62=a106_0xb55d();let _0x3b7c26=_0xb55d62[_0x59352c];return _0x3b7c26;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlExec={'service':a106_0x4d36cf(0xc9),'command':'exec','description':a106_0x4d36cf(0xd2),'risk':a106_0x4d36cf(0xcc),'flags':[SQLCODE_FLAG,{'name':a106_0x4d36cf(0xd6),'type':a106_0x4d36cf(0xc7),'description':a106_0x4d36cf(0xce)}],async 'execute'(_0x11f18a){const _0x557535=a106_0x4d36cf;let _0x6a8d64;const _0x1129d5=_0x11f18a[_0x557535(0xd7)](_0x557535(0xd6));if(_0x1129d5)try{_0x6a8d64=JSON[_0x557535(0xdb)](_0x1129d5);}catch{throw CliErrors[_0x557535(0xd0)](_0x557535(0xd9)+_0x1129d5);}const _0x25471c=Date[_0x557535(0xc1)](),_0x261f87=await executeSql(_0x11f18a[_0x557535(0xc5)],_0x11f18a[_0x557535(0xd7)]('sqlcode'),_0x6a8d64),_0x1859f0=Date[_0x557535(0xc1)]()-_0x25471c,_0x5d4411=_0x261f87?.['execResult']??_0x261f87,_0x4a6f68=_0x261f87?.[_0x557535(0xd1)]??!![];if(!_0x4a6f68)return{'ok':![],'data':{'error':_0x261f87?.['execError']||'SQL\x20execution\x20failed','elapsed':_0x1859f0},'message':_0x557535(0xd8)};const _0x11b4e7=Array['isArray'](_0x5d4411)?_0x5d4411:[];return{'ok':!![],'data':{'rows':_0x11b4e7,'rowCount':_0x11b4e7[_0x557535(0xcb)],'elapsed':_0x1859f0},'message':'Returned\x20'+_0x11b4e7[_0x557535(0xcb)]+'\x20row(s)\x20in\x20'+_0x1859f0+'ms'};}};
@@ -1 +1 @@
1
- function a81_0x2fa6(){const _0x512120=['4548832AqrqOD','18nciqGy','8582jpatgi','10nzJDJQ','45570767WQKQlz','1818wLTFBe','1429526yMmwQW','2726709usJidD','4ssolZH','112482vVcagw','8303965SMVNBq'];a81_0x2fa6=function(){return _0x512120;};return a81_0x2fa6();}(function(_0x3ddda0,_0x17fbb2){const _0x4f4162=a81_0x10dc,_0x985a15=_0x3ddda0();while(!![]){try{const _0x2000e1=-parseInt(_0x4f4162(0x1ab))/0x1+-parseInt(_0x4f4162(0x1ae))/0x2+-parseInt(_0x4f4162(0x1ac))/0x3+-parseInt(_0x4f4162(0x1ad))/0x4*(parseInt(_0x4f4162(0x1a4))/0x5)+-parseInt(_0x4f4162(0x1aa))/0x6*(parseInt(_0x4f4162(0x1a7))/0x7)+parseInt(_0x4f4162(0x1a5))/0x8*(parseInt(_0x4f4162(0x1a6))/0x9)+-parseInt(_0x4f4162(0x1a8))/0xa*(-parseInt(_0x4f4162(0x1a9))/0xb);if(_0x2000e1===_0x17fbb2)break;else _0x985a15['push'](_0x985a15['shift']());}catch(_0x167cb2){_0x985a15['push'](_0x985a15['shift']());}}}(a81_0x2fa6,0xd0448));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';function a81_0x10dc(_0x22f665,_0x514ca4){_0x22f665=_0x22f665-0x1a4;const _0x2fa648=a81_0x2fa6();let _0x10dcae=_0x2fa648[_0x22f665];return _0x10dcae;}import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlValidate,sqlSave,sqlExec,sqlPull];
1
+ (function(_0x174132,_0xd3f9d9){const _0x271d1f=a107_0x36ad,_0x193633=_0x174132();while(!![]){try{const _0x4e6b0a=-parseInt(_0x271d1f(0x178))/0x1+parseInt(_0x271d1f(0x173))/0x2+-parseInt(_0x271d1f(0x175))/0x3*(parseInt(_0x271d1f(0x174))/0x4)+parseInt(_0x271d1f(0x171))/0x5*(-parseInt(_0x271d1f(0x177))/0x6)+parseInt(_0x271d1f(0x176))/0x7+-parseInt(_0x271d1f(0x179))/0x8*(-parseInt(_0x271d1f(0x172))/0x9)+-parseInt(_0x271d1f(0x170))/0xa;if(_0x4e6b0a===_0xd3f9d9)break;else _0x193633['push'](_0x193633['shift']());}catch(_0xb7798e){_0x193633['push'](_0x193633['shift']());}}}(a107_0x5586,0x3545e));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';function a107_0x5586(){const _0x19316a=['8eAQqbD','623550iLtMTh','162025ywJjlG','3893301qvaGuE','41974wgaSct','268IsKKfd','7566zCHvGE','2227792NvFOFA','18eydzkv','225082UlCEOz'];a107_0x5586=function(){return _0x19316a;};return a107_0x5586();}import{sqlPull}from'../../commands/sql/pull.js';function a107_0x36ad(_0xa3e831,_0x9a2e57){_0xa3e831=_0xa3e831-0x170;const _0x558657=a107_0x5586();let _0x36adff=_0x558657[_0xa3e831];return _0x36adff;}import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a80_0x4c4422=a80_0x2337;(function(_0x520419,_0x33d0b2){const _0x42a8fa=a80_0x2337,_0x1c4ef3=_0x520419();while(!![]){try{const _0x2e312f=parseInt(_0x42a8fa(0xee))/0x1+-parseInt(_0x42a8fa(0xfd))/0x2+parseInt(_0x42a8fa(0x10b))/0x3+-parseInt(_0x42a8fa(0xfe))/0x4+-parseInt(_0x42a8fa(0x104))/0x5+-parseInt(_0x42a8fa(0xf9))/0x6+-parseInt(_0x42a8fa(0x102))/0x7*(-parseInt(_0x42a8fa(0x105))/0x8);if(_0x2e312f===_0x33d0b2)break;else _0x1c4ef3['push'](_0x1c4ef3['shift']());}catch(_0x913bbf){_0x1c4ef3['push'](_0x1c4ef3['shift']());}}}(a80_0xaf99,0x74028));function a80_0xaf99(){const _0x26709c=['1120OpVxuW','appCode','3355300qCSONa','64280EfQrlK','sqlcode','map','number','sqlName','dbId','1842549YKxdeX','verbose','str','string','length','boolean','151230fwGhwd','page','paging','read','name','List\x20custom\x20SQL\x20queries','pagesize','bool','Page\x20size','all','description','2941440YcDHTX','\x20SQL\x20queries\x20(total:\x20','num','Filter\x20by\x20SQL\x20name','372052Nijhor','914044EuCeXn','Page\x20number','sqlCode','sql'];a80_0xaf99=function(){return _0x26709c;};return a80_0xaf99();}import{listSqlQueries}from'../../core/api-client.js';function a80_0x2337(_0x5e53ac,_0x1a4a9d){_0x5e53ac=_0x5e53ac-0xec;const _0xaf9938=a80_0xaf99();let _0x2337d0=_0xaf9938[_0x5e53ac];return _0x2337d0;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a80_0x4c4422(0x101),'command':'list','description':a80_0x4c4422(0xf3),'risk':a80_0x4c4422(0xf1),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a80_0x4c4422(0xf2),'type':a80_0x4c4422(0x10e),'description':a80_0x4c4422(0xfc)},{'name':a80_0x4c4422(0xef),'type':a80_0x4c4422(0x108),'description':a80_0x4c4422(0xff),'default':0x1},{'name':'pagesize','type':a80_0x4c4422(0x108),'description':a80_0x4c4422(0xf6)},{'name':a80_0x4c4422(0x10c),'type':a80_0x4c4422(0xed),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x46c6cd){const _0x5bf167=a80_0x4c4422,_0x2bd90a=await listSqlQueries(_0x46c6cd['appCode'],{'sqlCode':_0x46c6cd[_0x5bf167(0x10d)](_0x5bf167(0x106))||undefined,'sqlName':_0x46c6cd[_0x5bf167(0x10d)](_0x5bf167(0xf2))||undefined,'currentPage':_0x46c6cd[_0x5bf167(0xfb)](_0x5bf167(0xef)),'pageSize':_0x46c6cd['num'](_0x5bf167(0xf4),0x32)}),_0x573ab4=_0x46c6cd[_0x5bf167(0xf5)](_0x5bf167(0x10c)),_0x3644ba=_0x2bd90a['tableData']??[],_0x54f935=_0x2bd90a[_0x5bf167(0xf0)]?.['totalCount']??_0x3644ba[_0x5bf167(0xec)];let _0x1ff143;return _0x573ab4?_0x1ff143=_0x3644ba:_0x1ff143=await Promise[_0x5bf167(0xf7)](_0x3644ba[_0x5bf167(0x107)](async _0x39d274=>{const _0x3a2308=_0x5bf167;let _0x381872;try{_0x381872=_0x39d274['dbId']?await getDbName(_0x46c6cd[_0x3a2308(0x103)],_0x39d274[_0x3a2308(0x10a)]):undefined;}catch{}return{'sqlCode':_0x39d274[_0x3a2308(0x100)],'sqlName':_0x39d274[_0x3a2308(0x109)],'description':_0x39d274[_0x3a2308(0xf8)]??'','db':_0x381872?_0x381872+'\x20('+_0x39d274[_0x3a2308(0x10a)]+')':_0x39d274[_0x3a2308(0x10a)]??''};})),{'ok':!![],'data':_0x1ff143,'message':_0x3644ba[_0x5bf167(0xec)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x3644ba[_0x5bf167(0xec)]+_0x5bf167(0xfa)+_0x54f935+').'};}};
1
+ const a108_0x357cee=a108_0x69f7;function a108_0x69f7(_0x2017be,_0x28e094){_0x2017be=_0x2017be-0xa7;const _0x2c78d9=a108_0x2c78();let _0x69f70c=_0x2c78d9[_0x2017be];return _0x69f70c;}(function(_0x3f1a24,_0x6f72b5){const _0x1f8219=a108_0x69f7,_0x2dab6e=_0x3f1a24();while(!![]){try{const _0x4bcf7b=-parseInt(_0x1f8219(0xa9))/0x1+-parseInt(_0x1f8219(0xa7))/0x2*(parseInt(_0x1f8219(0xbf))/0x3)+parseInt(_0x1f8219(0xb1))/0x4+-parseInt(_0x1f8219(0xb8))/0x5+-parseInt(_0x1f8219(0xc5))/0x6*(-parseInt(_0x1f8219(0xaf))/0x7)+-parseInt(_0x1f8219(0xae))/0x8*(parseInt(_0x1f8219(0xac))/0x9)+parseInt(_0x1f8219(0xbc))/0xa;if(_0x4bcf7b===_0x6f72b5)break;else _0x2dab6e['push'](_0x2dab6e['shift']());}catch(_0x17eeb1){_0x2dab6e['push'](_0x2dab6e['shift']());}}}(a108_0x2c78,0xa7d37));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':a108_0x357cee(0xc2),'description':a108_0x357cee(0xb6),'risk':a108_0x357cee(0xb4),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a108_0x357cee(0xb2),'description':a108_0x357cee(0xc3)},{'name':a108_0x357cee(0xb5),'type':a108_0x357cee(0xb7),'description':'Page\x20number','default':0x1},{'name':a108_0x357cee(0xbd),'type':a108_0x357cee(0xb7),'description':a108_0x357cee(0xab)},{'name':'verbose','type':a108_0x357cee(0xc0),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x34cdc7){const _0x37a38a=a108_0x357cee,_0x40f14a=await listSqlQueries(_0x34cdc7['appCode'],{'sqlCode':_0x34cdc7[_0x37a38a(0xb3)](_0x37a38a(0xc1))||undefined,'sqlName':_0x34cdc7['str'](_0x37a38a(0xad))||undefined,'currentPage':_0x34cdc7['num'](_0x37a38a(0xb5)),'pageSize':_0x34cdc7[_0x37a38a(0xaa)](_0x37a38a(0xbd),0x32)}),_0x2a8c37=_0x34cdc7[_0x37a38a(0xc4)]('verbose'),_0x308aa7=_0x40f14a[_0x37a38a(0xc9)]??[],_0x1faaed=_0x40f14a[_0x37a38a(0xc7)]?.[_0x37a38a(0xbe)]??_0x308aa7[_0x37a38a(0xc8)];let _0x83b7d7;return _0x2a8c37?_0x83b7d7=_0x308aa7:_0x83b7d7=await Promise[_0x37a38a(0xb9)](_0x308aa7[_0x37a38a(0xb0)](async _0x419510=>{const _0x50f270=_0x37a38a;let _0x1b29bf;try{_0x1b29bf=_0x419510['dbId']?await getDbName(_0x34cdc7[_0x50f270(0xc6)],_0x419510[_0x50f270(0xbb)]):undefined;}catch{}return{'sqlCode':_0x419510[_0x50f270(0xba)],'sqlName':_0x419510['sqlName'],'description':_0x419510[_0x50f270(0xa8)]??'','db':_0x1b29bf?_0x1b29bf+'\x20('+_0x419510[_0x50f270(0xbb)]+')':_0x419510['dbId']??''};})),{'ok':!![],'data':_0x83b7d7,'message':_0x308aa7['length']===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x308aa7[_0x37a38a(0xc8)]+'\x20SQL\x20queries\x20(total:\x20'+_0x1faaed+').'};}};function a108_0x2c78(){const _0x217145=['3TyjIWI','boolean','sqlcode','list','Filter\x20by\x20SQL\x20name','bool','78sglHFz','appCode','paging','length','tableData','2267596tvyIER','description','868687idcdlD','num','Page\x20size','6849vSAihC','name','10264WBEwfM','471198RaycCT','map','4597732rloxTc','string','str','read','page','List\x20custom\x20SQL\x20queries','number','4207065cftUGA','all','sqlCode','dbId','24831610jgOJgw','pagesize','totalCount'];a108_0x2c78=function(){return _0x217145;};return a108_0x2c78();}
@@ -1 +1 @@
1
- const a79_0x36ff5c=a79_0x5406;(function(_0x5ce282,_0x3db250){const _0x3e1ac5=a79_0x5406,_0x356542=_0x5ce282();while(!![]){try{const _0x23dbde=-parseInt(_0x3e1ac5(0x201))/0x1+parseInt(_0x3e1ac5(0x1f5))/0x2*(parseInt(_0x3e1ac5(0x206))/0x3)+-parseInt(_0x3e1ac5(0x218))/0x4+-parseInt(_0x3e1ac5(0x1f9))/0x5+parseInt(_0x3e1ac5(0x20d))/0x6*(parseInt(_0x3e1ac5(0x212))/0x7)+-parseInt(_0x3e1ac5(0x1f8))/0x8+parseInt(_0x3e1ac5(0x1ed))/0x9*(parseInt(_0x3e1ac5(0x1eb))/0xa);if(_0x23dbde===_0x3db250)break;else _0x356542['push'](_0x356542['shift']());}catch(_0x2c53d1){_0x356542['push'](_0x356542['shift']());}}}(a79_0x492f,0xde946));import{createInterface}from'node:readline';function a79_0x492f(){const _0x4f40b4=['name','push','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','local\x20differs\x20from\x20remote','No\x20remote\x20SQL\x20queries\x20matched.','8dwCBFi','paging','unchanged','7383336YsWmem','7789205cICelg','message','Overwrite\x20local\x20files\x20that\x20differ\x20from\x20remote','Pull\x20remote\x20custom\x20SQL\x20queries\x20into\x20.rabetbase/sql/','\x20skipped,\x20','pull','\x20error(s)).','conflict','754359uLdauE','question','str','skipped','would_pull','1038927scIPmI','trim','yes','bool','utf8','Pull\x20failed:\x20could\x20not\x20load\x20SQL\x20content\x20(','Filter\x20by\x20SQL\x20display\x20name\x20(API\x20filter)','9732gehraH','Force\x20pull\x20cancelled.','totalCount','includes','stderr','1491bvrshC','POST','close','sqlcode','toLowerCase','nonInteractive','2079640IjhioF','Would\x20pull\x20','\x20failed','sqlCode','force','appCode','stdin','write','cancelled','610aqFLMn','length','433179smGgqq','sqlName','sql'];a79_0x492f=function(){return _0x4f40b4;};return a79_0x492f();}import{readFile,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryInfo,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{findProjectRootDirectory}from'../../context.js';function a79_0x5406(_0x492039,_0x5e2806){_0x492039=_0x492039-0x1e5;const _0x492f4d=a79_0x492f();let _0x540688=_0x492f4d[_0x492039];return _0x540688;}import{assignSqlFileNames,buildPulledSqlFileContent,resolveSqlLocalDir}from'../../commands/sql/shared.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x3955e4,_0x96bcf){const _0x455f6d=a79_0x5406,_0x5835c2=[];let _0x1f6e42=0x1;while(!![]){const _0x350895=await listSqlQueries(_0x3955e4,{'currentPage':_0x1f6e42,'pageSize':PAGE_SIZE,'sqlCode':_0x96bcf[_0x455f6d(0x1e5)],'sqlName':_0x96bcf['sqlName']}),_0x1a4b8a=_0x350895['tableData']??[];_0x5835c2[_0x455f6d(0x1f1)](..._0x1a4b8a);if(_0x1a4b8a[_0x455f6d(0x1ec)]===0x0)break;const _0x57d66a=_0x350895[_0x455f6d(0x1f6)]?.[_0x455f6d(0x20f)];if(_0x57d66a!=null?_0x5835c2[_0x455f6d(0x1ec)]>=_0x57d66a:_0x1a4b8a['length']<PAGE_SIZE)break;_0x1f6e42++;}return _0x5835c2;}async function ensureSqlContent(_0x1f8563,_0x396023){const _0xe34b1a=a79_0x5406;if(_0x396023['sqlContent']!=null&&String(_0x396023['sqlContent'])[_0xe34b1a(0x1ec)]>0x0)return _0x396023;return getSqlQueryInfo(_0x1f8563,_0x396023['sqlCode']);}export const sqlPull={'service':a79_0x36ff5c(0x1ef),'command':a79_0x36ff5c(0x1fe),'description':a79_0x36ff5c(0x1fc),'risk':a79_0x36ff5c(0x1e9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a79_0x36ff5c(0x1f0),'type':'string','description':a79_0x36ff5c(0x20c)},{'name':a79_0x36ff5c(0x1e6),'type':'boolean','description':a79_0x36ff5c(0x1fb)}],async 'dryRun'(_0x521170){const _0x4058eb=a79_0x36ff5c,_0x1f1d5f=findProjectRootDirectory(),_0x251450=resolveSqlLocalDir(_0x1f1d5f),_0x1efdf1=_0x521170['str'](_0x4058eb(0x215))||undefined,_0x2539ac=_0x521170[_0x4058eb(0x203)](_0x4058eb(0x1f0))||undefined,_0x3fb1a1=await fetchAllSqlQueries(_0x521170['appCode'],{'sqlCode':_0x1efdf1,'sqlName':_0x2539ac}),_0x53f60a=[],_0x211b71=[];for(const _0x36b9f8 of _0x3fb1a1){try{_0x53f60a['push'](await ensureSqlContent(_0x521170[_0x4058eb(0x1e7)],_0x36b9f8));}catch(_0x3ba79b){_0x211b71[_0x4058eb(0x1f1)]({'sqlCode':_0x36b9f8[_0x4058eb(0x1e5)],'error':_0x3ba79b instanceof Error?_0x3ba79b[_0x4058eb(0x1fa)]:String(_0x3ba79b)});}}const _0x507a76=assignSqlFileNames(_0x53f60a),_0xefd88f=[];for(const [_0x408371,_0x1a57d2]of _0x507a76){const _0x720aa4=join(_0x251450,_0x408371),_0x24f5c1=buildPulledSqlFileContent(_0x1a57d2);let _0x3bd590=_0x4058eb(0x205),_0x557a14;if(await fileExists(_0x720aa4)){const _0x14b8ed=await readFile(_0x720aa4,_0x4058eb(0x20a));_0x14b8ed===_0x24f5c1?(_0x3bd590=_0x4058eb(0x204),_0x557a14=_0x4058eb(0x1f7)):(_0x3bd590=_0x4058eb(0x200),_0x557a14=_0x4058eb(0x1f2));}_0xefd88f[_0x4058eb(0x1f1)]({'sqlCode':_0x1a57d2[_0x4058eb(0x1e5)],'sqlName':_0x1a57d2[_0x4058eb(0x1ee)],'filePath':_0x720aa4,'status':_0x3bd590,'reason':_0x557a14});}return{'method':_0x4058eb(0x213),'url':'/smartapi/custom/queryUserCustomSqlList','body':{'appCode':_0x521170[_0x4058eb(0x1e7)],'sqlCode':_0x1efdf1??null,'sqlName':_0x2539ac??null,'loadErrors':_0x211b71,'files':_0xefd88f},'description':_0x4058eb(0x219)+_0xefd88f['length']+'\x20SQL\x20file(s)\x20under\x20'+_0x251450};},async 'execute'(_0x2a9d66){const _0x297a4d=a79_0x36ff5c,_0x22c808=findProjectRootDirectory(),_0x58f2f5=resolveSqlLocalDir(_0x22c808),_0x4f15e7=_0x2a9d66['str'](_0x297a4d(0x215))||undefined,_0x29d6e0=_0x2a9d66['str'](_0x297a4d(0x1f0))||undefined,_0x37bfa3=_0x2a9d66[_0x297a4d(0x209)](_0x297a4d(0x1e6)),_0x502e13=await fetchAllSqlQueries(_0x2a9d66[_0x297a4d(0x1e7)],{'sqlCode':_0x4f15e7,'sqlName':_0x29d6e0});if(_0x502e13[_0x297a4d(0x1ec)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x297a4d(0x1f4)};const _0x427600=[],_0x5b6c6d=[];for(const _0x206b6b of _0x502e13){try{_0x427600[_0x297a4d(0x1f1)](await ensureSqlContent(_0x2a9d66[_0x297a4d(0x1e7)],_0x206b6b));}catch(_0x4458d8){_0x5b6c6d['push']({'sqlCode':_0x206b6b[_0x297a4d(0x1e5)],'error':_0x4458d8 instanceof Error?_0x4458d8[_0x297a4d(0x1fa)]:String(_0x4458d8)});}}if(_0x427600[_0x297a4d(0x1ec)]===0x0)return{'ok':![],'data':{'pulled':[],'skipped':[],'failed':_0x5b6c6d},'message':_0x297a4d(0x20b)+_0x5b6c6d[_0x297a4d(0x1ec)]+_0x297a4d(0x1ff)};const _0x324a57=assignSqlFileNames(_0x427600);if(_0x37bfa3&&!_0x2a9d66[_0x297a4d(0x217)]){let _0x8b0c25=![];for(const [_0x17b579,_0xcca2ce]of _0x324a57){const _0x26191d=join(_0x58f2f5,_0x17b579),_0x360ec8=buildPulledSqlFileContent(_0xcca2ce);if(await fileExists(_0x26191d)){const _0x1f4040=await readFile(_0x26191d,_0x297a4d(0x20a));if(_0x1f4040!==_0x360ec8){_0x8b0c25=!![];break;}}}if(_0x8b0c25){const _0x44a50d=await confirmForce();if(!_0x44a50d)throw CliErrors[_0x297a4d(0x1ea)](_0x297a4d(0x20e));}}const _0x165e48=[],_0x16241c=[];for(const [_0x44afc6,_0x21c8af]of _0x324a57){const _0x90ae26=join(_0x58f2f5,_0x44afc6),_0x5e9e53=buildPulledSqlFileContent(_0x21c8af);try{if(await fileExists(_0x90ae26)){const _0x45837e=await readFile(_0x90ae26,'utf8');if(_0x45837e===_0x5e9e53){_0x16241c[_0x297a4d(0x1f1)]({'sqlCode':_0x21c8af['sqlCode'],'reason':_0x297a4d(0x1f7)});continue;}if(!_0x37bfa3){_0x16241c[_0x297a4d(0x1f1)]({'sqlCode':_0x21c8af[_0x297a4d(0x1e5)],'reason':_0x297a4d(0x1f3)});continue;}}await ensureParentDirectory(_0x90ae26),await writeFile(_0x90ae26,_0x5e9e53,_0x297a4d(0x20a)),_0x165e48['push']({'sqlCode':_0x21c8af['sqlCode'],'filePath':_0x90ae26});}catch(_0x485c52){_0x5b6c6d[_0x297a4d(0x1f1)]({'sqlCode':_0x21c8af[_0x297a4d(0x1e5)],'error':_0x485c52 instanceof Error?_0x485c52[_0x297a4d(0x1fa)]:String(_0x485c52)});}}const _0x5365e1=_0x5b6c6d['length']===0x0;return{'ok':_0x5365e1,'data':{'pulled':_0x165e48,'skipped':_0x16241c,'failed':_0x5b6c6d},'message':'Pull\x20complete:\x20'+_0x165e48[_0x297a4d(0x1ec)]+'\x20written,\x20'+_0x16241c[_0x297a4d(0x1ec)]+_0x297a4d(0x1fd)+_0x5b6c6d[_0x297a4d(0x1ec)]+_0x297a4d(0x21a)};}};async function confirmForce(){const _0x233677=a79_0x36ff5c,_0xe6fe69=createInterface({'input':process[_0x233677(0x1e8)],'output':process[_0x233677(0x211)]}),_0x55cfbc=await new Promise(_0x4aae18=>{const _0x4bdb15=_0x233677;_0xe6fe69[_0x4bdb15(0x202)]('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.\x20Continue?\x20[y/N]\x20',_0x4aae18);});return _0xe6fe69[_0x233677(0x214)](),['y',_0x233677(0x208)][_0x233677(0x210)](_0x55cfbc[_0x233677(0x207)]()[_0x233677(0x216)]());}
1
+ const a109_0x5336ba=a109_0x4158;(function(_0x484228,_0x16d372){const _0x5a62b3=a109_0x4158,_0x155950=_0x484228();while(!![]){try{const _0x2e11e8=-parseInt(_0x5a62b3(0x1f5))/0x1*(parseInt(_0x5a62b3(0x1d2))/0x2)+-parseInt(_0x5a62b3(0x1e1))/0x3+parseInt(_0x5a62b3(0x1fa))/0x4+-parseInt(_0x5a62b3(0x1d9))/0x5*(-parseInt(_0x5a62b3(0x1d4))/0x6)+-parseInt(_0x5a62b3(0x1e6))/0x7+parseInt(_0x5a62b3(0x1e0))/0x8+parseInt(_0x5a62b3(0x1fc))/0x9;if(_0x2e11e8===_0x16d372)break;else _0x155950['push'](_0x155950['shift']());}catch(_0x5cbe96){_0x155950['push'](_0x155950['shift']());}}}(a109_0x3ecf,0x54360));function a109_0x4158(_0x135330,_0x21fb5b){_0x135330=_0x135330-0x1cc;const _0x3ecfc1=a109_0x3ecf();let _0x415853=_0x3ecfc1[_0x135330];return _0x415853;}import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';function a109_0x3ecf(){const _0x3d0bc8=['apps','sqls','sqlCode','test','sqlName','lockFilePath','length','would_pull','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlcode','lastSync','2SjJsio','Filter\x20by\x20SQL\x20display\x20name','366FpglXm','POST','message','cancelled','sqlRoot','14435luaWBS','str','\x20SQL\x20file(s)\x20into\x20','\x20skipped,\x20','\x20failed','boolean','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','3110224bRxOvk','752526tuQwIJ','sqlContent','sqlRootDir','path','force','4735626DCMvCy','replace','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','nonInteractive','appCode','utf8','push','toISOString','Force\x20overwrite\x20local\x20unsynced\x20changes','conflict','Pull\x20complete:\x20','filter','paging','local\x20differs\x20from\x20remote','description','134659dpAJGX','No\x20remote\x20SQL\x20queries\x20matched.','catch','pull','Force\x20pull\x20cancelled.','230884hPJFGy','Would\x20pull\x20','7059069RWHqBs','mybatisXml','name','trimStart','dbId','split','tableData','unchanged'];a109_0x3ecf=function(){return _0x3d0bc8;};return a109_0x3ecf();}import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x40af3b,_0x3c7d67){const _0x175be8=a109_0x4158,_0x5af59c=[];let _0x2e9ad3=0x1;while(!![]){const _0xca8ab3=await listSqlQueries(_0x40af3b,{'currentPage':_0x2e9ad3,'pageSize':PAGE_SIZE,'sqlCode':_0x3c7d67['sqlCode'],'sqlName':_0x3c7d67[_0x175be8(0x208)]}),_0x573cbb=_0xca8ab3[_0x175be8(0x202)]??[];_0x5af59c['push'](..._0x573cbb);if(_0x573cbb[_0x175be8(0x1cd)]===0x0)break;const _0x15f8ae=_0xca8ab3[_0x175be8(0x1f2)]?.['totalCount'];if(_0x15f8ae!=null?_0x5af59c['length']>=_0x15f8ae:_0x573cbb[_0x175be8(0x1cd)]<PAGE_SIZE)break;_0x2e9ad3++;}return _0x5af59c;}async function ensureSqlContent(_0x4f1743){const _0x474db7=a109_0x4158;if(_0x4f1743['sqlContent']!=null&&String(_0x4f1743[_0x474db7(0x1e2)])[_0x474db7(0x1cd)]>0x0)return _0x4f1743;return getSqlQueryDetail(_0x4f1743['sqlCode']);}export const sqlPull={'service':'sql','command':'pull','description':a109_0x5336ba(0x1cf),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a109_0x5336ba(0x1fe),'type':'string','description':a109_0x5336ba(0x1d3)},{'name':a109_0x5336ba(0x1e5),'type':a109_0x5336ba(0x1de),'description':a109_0x5336ba(0x1ee)}],async 'dryRun'(_0x1e937b){const _0x5299d7=a109_0x5336ba,_0xa04e25=loadSqlProjectConfig(_0x1e937b['appCode']),_0x56cabb=await readSqlLockFile(_0xa04e25[_0x5299d7(0x1cc)]),{appLock:_0x2ee1d6}=ensureSqlLockScope(_0x56cabb??createEmptySqlLock(),_0xa04e25[_0x5299d7(0x1ea)],_0xa04e25[_0x5299d7(0x1d8)],'pull'),_0x476b40=await fetchAllSqlQueries(_0x1e937b[_0x5299d7(0x1ea)],{'sqlCode':_0x1e937b['str'](_0x5299d7(0x1d0))||undefined,'sqlName':_0x1e937b[_0x5299d7(0x1da)](_0x5299d7(0x1fe))||undefined}),_0x5e97f6=[];for(const _0x2bb48f of _0x476b40){const _0x265d37=await ensureSqlContent(_0x2bb48f),_0x59a756=ensureRemoteSqlContent(_0x265d37),_0x1f3371=detectModeFromSql(_0x265d37),_0x51830b=_0x265d37[_0x5299d7(0x200)]?await getDbName(_0x1e937b['appCode'],Number(_0x265d37['dbId']))[_0x5299d7(0x1f7)](()=>undefined):undefined,_0x53d851=buildLocalSqlFileContent({'sqlCode':_0x265d37['sqlCode'],'sqlName':_0x265d37[_0x5299d7(0x208)],'dbId':_0x265d37[_0x5299d7(0x200)]},_0x59a756,{'dbName':_0x51830b,'mode':_0x1f3371,'syncedAt':new Date()[_0x5299d7(0x1ed)](),'description':_0x265d37['description']}),_0x120487=buildSqlLockEntry(_0x265d37,_0x59a756,'',{'dbName':_0x51830b}),_0x1d0d18=resolveLocalSqlFilePath(_0xa04e25,_0x265d37[_0x5299d7(0x206)],_0x120487);let _0x4017d9=_0x5299d7(0x1ce),_0x3ad6ac;if(await fileExists(_0x1d0d18)){const _0x217eef=await readFile(_0x1d0d18,_0x5299d7(0x1eb));isEquivalentPulledSqlFile(_0x217eef,_0x53d851,_0x1f3371)?(_0x4017d9='skipped',_0x3ad6ac=_0x5299d7(0x203)):(_0x4017d9=_0x5299d7(0x1ef),_0x3ad6ac=_0x5299d7(0x1df));}_0x5e97f6[_0x5299d7(0x1ec)]({'sqlCode':_0x265d37['sqlCode'],'sqlName':_0x265d37[_0x5299d7(0x208)],'filePath':_0x1d0d18,'status':_0x4017d9,'reason':_0x3ad6ac});}return{'method':_0x5299d7(0x1d5),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x1e937b[_0x5299d7(0x1ea)],'sqlCode':_0x1e937b[_0x5299d7(0x1da)](_0x5299d7(0x1d0))||null,'sqlName':_0x1e937b[_0x5299d7(0x1da)]('name')||null,'files':_0x5e97f6},'description':_0x5299d7(0x1fb)+_0x5e97f6[_0x5299d7(0x1cd)]+_0x5299d7(0x1db)+_0xa04e25['sqlRootDir']};},async 'execute'(_0x3d17e4){const _0x18693c=a109_0x5336ba,_0x15caf1=loadSqlProjectConfig(_0x3d17e4['appCode']),_0x251c04=await readSqlLockFile(_0x15caf1[_0x18693c(0x1cc)]),{lockData:_0x523e81,appLock:_0x4d478f}=ensureSqlLockScope(_0x251c04??createEmptySqlLock(),_0x15caf1[_0x18693c(0x1ea)],_0x15caf1[_0x18693c(0x1d8)],_0x18693c(0x1f8)),_0x41e9f6=_0x3d17e4['bool'](_0x18693c(0x1e5)),_0x1dfba0=await fetchAllSqlQueries(_0x3d17e4['appCode'],{'sqlCode':_0x3d17e4[_0x18693c(0x1da)](_0x18693c(0x1d0))||undefined,'sqlName':_0x3d17e4['str']('name')||undefined});if(_0x1dfba0[_0x18693c(0x1cd)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x18693c(0x1f6)};const _0x252f62=[],_0x569afb=[];for(const _0x30db65 of _0x1dfba0){try{_0x252f62[_0x18693c(0x1ec)](await ensureSqlContent(_0x30db65));}catch(_0x523a2f){_0x569afb[_0x18693c(0x1ec)]({'sqlCode':_0x30db65[_0x18693c(0x206)],'error':_0x523a2f instanceof Error?_0x523a2f['message']:String(_0x523a2f)});}}if(_0x41e9f6&&!_0x3d17e4[_0x18693c(0x1e9)]){let _0x1686c0=![];for(const _0x3219ff of _0x252f62){const _0x5aa7eb=detectModeFromSql(_0x3219ff),_0x2f367a=_0x3219ff['dbId']?await getDbName(_0x3d17e4[_0x18693c(0x1ea)],Number(_0x3219ff[_0x18693c(0x200)]))[_0x18693c(0x1f7)](()=>undefined):undefined,_0x29cb00=buildLocalSqlFileContent({'sqlCode':_0x3219ff['sqlCode'],'sqlName':_0x3219ff[_0x18693c(0x208)],'dbId':_0x3219ff['dbId']},ensureRemoteSqlContent(_0x3219ff),{'dbName':_0x2f367a,'mode':_0x5aa7eb,'syncedAt':new Date()[_0x18693c(0x1ed)](),'description':_0x3219ff[_0x18693c(0x1f4)]}),_0x5297fb=resolveLocalSqlFilePath(_0x15caf1,_0x3219ff[_0x18693c(0x206)],buildSqlLockEntry(_0x3219ff,ensureRemoteSqlContent(_0x3219ff),'',{'dbName':_0x2f367a}));if(await fileExists(_0x5297fb)){const _0x541b13=await readFile(_0x5297fb,_0x18693c(0x1eb));if(!isEquivalentPulledSqlFile(_0x541b13,_0x29cb00,_0x5aa7eb)){_0x1686c0=!![];break;}}}if(_0x1686c0){const _0x1ae506=await confirmForceOverwrite(_0x18693c(0x1e8));if(!_0x1ae506)throw CliErrors[_0x18693c(0x1d7)](_0x18693c(0x1f9));}}const _0x23b476=cloneSqlLockData(_0x523e81),_0x5a0e8c=_0x23b476[_0x18693c(0x204)][_0x15caf1[_0x18693c(0x1ea)]],_0x2f8450=[],_0x37c070=[];for(const _0x474b50 of _0x252f62){const _0x34050a=_0x5a0e8c[_0x18693c(0x205)][_0x474b50[_0x18693c(0x206)]],_0x27bf30=ensureRemoteSqlContent(_0x474b50),_0x40ae7b=detectModeFromSql(_0x474b50),_0x3b8f76=_0x474b50[_0x18693c(0x200)]?await getDbName(_0x3d17e4['appCode'],Number(_0x474b50[_0x18693c(0x200)]))['catch'](()=>undefined):undefined,_0x1bda48=buildLocalSqlFileContent({'sqlCode':_0x474b50[_0x18693c(0x206)],'sqlName':_0x474b50[_0x18693c(0x208)],'dbId':_0x474b50[_0x18693c(0x200)]},_0x27bf30,{'dbName':_0x3b8f76,'mode':_0x40ae7b,'syncedAt':new Date()[_0x18693c(0x1ed)](),'description':_0x474b50[_0x18693c(0x1f4)]}),_0x3b2b9e=buildSqlLockEntry(_0x474b50,_0x27bf30,computeSqlContentHash(_0x1bda48),{'dbName':_0x3b8f76}),_0x2fa2e0=_0x3b2b9e[_0x18693c(0x1e4)],_0x3b5394=join(_0x15caf1[_0x18693c(0x1e3)],_0x2fa2e0);try{if(await fileExists(_0x3b5394)){const _0x40b59f=await readFile(_0x3b5394,_0x18693c(0x1eb));if(isEquivalentPulledSqlFile(_0x40b59f,_0x1bda48,_0x40ae7b)){_0x37c070[_0x18693c(0x1ec)]({'sqlCode':_0x474b50[_0x18693c(0x206)],'reason':_0x18693c(0x203)}),_0x5a0e8c[_0x18693c(0x205)][_0x474b50[_0x18693c(0x206)]]={..._0x3b2b9e,'hash':computeSqlContentHash(_0x40b59f),'path':_0x2fa2e0};continue;}if(!_0x41e9f6){_0x37c070[_0x18693c(0x1ec)]({'sqlCode':_0x474b50[_0x18693c(0x206)],'reason':_0x18693c(0x1f3)});continue;}}const _0x3e9878=_0x34050a?.[_0x18693c(0x1e4)]?join(_0x15caf1[_0x18693c(0x1e3)],_0x34050a[_0x18693c(0x1e4)]):undefined;_0x3e9878&&_0x3e9878!==_0x3b5394&&await fileExists(_0x3e9878)&&await rm(_0x3e9878,{'force':!![]}),await ensureParentDirectory(_0x3b5394),await writeFile(_0x3b5394,_0x1bda48,'utf8'),_0x5a0e8c['sqls'][_0x474b50[_0x18693c(0x206)]]={..._0x3b2b9e,'path':_0x2fa2e0},_0x2f8450[_0x18693c(0x1ec)]({'sqlCode':_0x474b50[_0x18693c(0x206)],'filePath':_0x3b5394});}catch(_0x4db164){_0x569afb[_0x18693c(0x1ec)]({'sqlCode':_0x474b50[_0x18693c(0x206)],'error':_0x4db164 instanceof Error?_0x4db164[_0x18693c(0x1d6)]:String(_0x4db164)});}}return _0x5a0e8c[_0x18693c(0x1d1)]=new Date()[_0x18693c(0x1ed)](),await writeSqlLockFile(_0x15caf1[_0x18693c(0x1cc)],_0x23b476),{'ok':_0x569afb[_0x18693c(0x1cd)]===0x0,'data':{'pulled':_0x2f8450,'skipped':_0x37c070,'failed':_0x569afb},'message':_0x18693c(0x1f0)+_0x2f8450[_0x18693c(0x1cd)]+'\x20written,\x20'+_0x37c070['length']+_0x18693c(0x1dc)+_0x569afb[_0x18693c(0x1cd)]+_0x18693c(0x1dd)};}};function detectModeFromSql(_0x55fc7a){const _0x56bc38=a109_0x5336ba,_0x5c5865=ensureRemoteSqlContent(_0x55fc7a),_0x143a02=stripLocalSqlMetadata(_0x5c5865,_0x56bc38(0x1fd))[_0x56bc38(0x1ff)]();if(/^<(select|insert|update|delete)\b/i[_0x56bc38(0x207)](_0x143a02))return _0x56bc38(0x1fd);return'sql';}function isEquivalentPulledSqlFile(_0x2f0c64,_0x11b32c,_0xfe78e8){return normalizePullComparableContent(_0x2f0c64,_0xfe78e8)===normalizePullComparableContent(_0x11b32c,_0xfe78e8);}function normalizePullComparableContent(_0xfd56fd,_0x1dbb25){const _0xe3293f=a109_0x5336ba,_0x34171b=_0xfd56fd[_0xe3293f(0x1e7)](/\r\n/g,'\x0a')[_0xe3293f(0x201)]('\x0a'),_0x3a893b=_0x34171b[_0xe3293f(0x1f1)](_0xade286=>!isSyncedAtMetadataLine(_0xade286,_0x1dbb25));return _0x3a893b['join']('\x0a');}function isSyncedAtMetadataLine(_0xfc25aa,_0x21f76e){const _0x6c287b=a109_0x5336ba;if(_0x21f76e===_0x6c287b(0x1fd))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x6c287b(0x207)](_0xfc25aa);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x6c287b(0x207)](_0xfc25aa);}
@@ -0,0 +1 @@
1
+ const a110_0x2401b4=a110_0x1a57;(function(_0x2114c7,_0x5ef0e4){const _0x44e718=a110_0x1a57,_0x3df06d=_0x2114c7();while(!![]){try{const _0x1bd1b6=parseInt(_0x44e718(0x14d))/0x1*(parseInt(_0x44e718(0x150))/0x2)+parseInt(_0x44e718(0x13a))/0x3*(-parseInt(_0x44e718(0x172))/0x4)+parseInt(_0x44e718(0x146))/0x5*(parseInt(_0x44e718(0x167))/0x6)+-parseInt(_0x44e718(0x153))/0x7+-parseInt(_0x44e718(0x161))/0x8*(-parseInt(_0x44e718(0x142))/0x9)+-parseInt(_0x44e718(0x163))/0xa*(-parseInt(_0x44e718(0x14e))/0xb)+-parseInt(_0x44e718(0x140))/0xc;if(_0x1bd1b6===_0x5ef0e4)break;else _0x3df06d['push'](_0x3df06d['shift']());}catch(_0x312ae7){_0x3df06d['push'](_0x3df06d['shift']());}}}(a110_0x3920,0x3f3f4));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';function a110_0x3920(){const _0x333151=['No\x20local\x20SQL\x20files\x20found.','validation','push','6973356biqqjk','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','180AWysvd','join','dbName','sqlRoot','5zdbyEi','exec','Would\x20push\x20','toISOString','get','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','catch','59zTQWBe','1786147qPjBDb','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','548TaSRex','str','/smartapi/custom/updateUserCustomSql','888048AGTPtT','startsWith','boolean','POST','path','filter','has','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','hash','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','filePath','projectRoot','remoteId','sqlName','92632lgUJkA','appCode','30AMisdW','sqlCode','Local\x20directory\x20\x22','Local\x20SQL\x20not\x20found:\x20','2246274QJmLeV','Push\x20complete:\x20','set','bool','relativePath','map','length','lockFilePath','force','sqlcode','sqlConfig','4gXXiEM','trashDir','dbId','sqlRootDir','\x20failed','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','\x20pushed,\x20','sql','isFinite','high-risk-write','426657fGQUNm','replace','sqls'];a110_0x3920=function(){return _0x333151;};return a110_0x3920();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x372616,_0x27c514,_0x11ee81){const _0x39622b=a110_0x1a57,_0x393bec=await scanLocalSqlQueries(_0x372616),_0x1e9e90=new Map();for(const _0x15c9a0 of _0x393bec){if(_0x11ee81&&_0x15c9a0[_0x39622b(0x164)]!==_0x11ee81)continue;const _0x1f64b5=_0x1e9e90[_0x39622b(0x14a)](_0x15c9a0[_0x39622b(0x164)])??[];_0x1f64b5[_0x39622b(0x13f)](_0x15c9a0),_0x1e9e90[_0x39622b(0x169)](_0x15c9a0[_0x39622b(0x164)],_0x1f64b5);}if(_0x11ee81&&!_0x1e9e90[_0x39622b(0x159)](_0x11ee81))throw CliErrors[_0x39622b(0x13e)](_0x39622b(0x166)+_0x11ee81);const _0x58f619=[];for(const [_0x216374,_0x28ca32]of _0x1e9e90['entries']()){if(_0x28ca32[_0x39622b(0x16d)]===0x1){_0x58f619['push'](_0x28ca32[0x0]);continue;}const _0xb78b80=_0x27c514[_0x39622b(0x13c)][_0x216374],_0x4dde5c=_0xb78b80?.['path'],_0x19b1be=_0x4dde5c?_0x28ca32['filter'](_0x4c0c49=>_0x4c0c49[_0x39622b(0x16b)]!==_0x4dde5c):_0x28ca32;if(_0xb78b80&&_0x19b1be[_0x39622b(0x16d)]===0x1){_0x58f619[_0x39622b(0x13f)](_0x19b1be[0x0]);continue;}throw CliErrors[_0x39622b(0x13e)](_0x39622b(0x14b)+_0x216374+_0x39622b(0x141));}return _0x58f619;}export const sqlPush={'service':a110_0x2401b4(0x137),'command':'push','description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a110_0x2401b4(0x139),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a110_0x2401b4(0x16f),'type':a110_0x2401b4(0x155),'description':a110_0x2401b4(0x15c)}],async 'dryRun'(_0x1f6ec0){const _0x344d1d=a110_0x2401b4,_0x4910e3=loadSqlProjectConfig(_0x1f6ec0[_0x344d1d(0x162)]),_0x42b486=await readSqlLockFile(_0x4910e3[_0x344d1d(0x16e)]),{appLock:_0x4d83d4}=ensureSqlLockScope(_0x42b486??createEmptySqlLock(),_0x1f6ec0[_0x344d1d(0x162)],_0x4910e3[_0x344d1d(0x145)],_0x344d1d(0x13f)),_0x4046c2=await getTargetSqlQueries(_0x4910e3,_0x4d83d4,_0x1f6ec0[_0x344d1d(0x151)](_0x344d1d(0x170))||undefined),_0x4c31bf=[];for(const _0x364c24 of _0x4046c2){const _0x1c7bb3=await computeSqlFileHash(_0x364c24['filePath']),_0x495b55=_0x4d83d4[_0x344d1d(0x13c)][_0x364c24[_0x344d1d(0x164)]],_0x5eada9=!!_0x495b55&&(_0x495b55[_0x344d1d(0x157)]!==_0x364c24[_0x344d1d(0x16b)]||!!_0x364c24[_0x344d1d(0x160)]&&_0x495b55[_0x344d1d(0x160)]!==_0x364c24[_0x344d1d(0x160)]);if(!_0x1f6ec0['bool'](_0x344d1d(0x16f))&&_0x495b55&&_0x495b55[_0x344d1d(0x15b)]===_0x1c7bb3&&!_0x5eada9)continue;_0x4c31bf[_0x344d1d(0x13f)](_0x364c24[_0x344d1d(0x164)]);}return{'method':_0x344d1d(0x156),'url':_0x344d1d(0x152),'body':{'sqlCodes':_0x4c31bf,'appCode':_0x1f6ec0[_0x344d1d(0x162)]},'description':_0x344d1d(0x148)+_0x4c31bf[_0x344d1d(0x16d)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x2d8950){const _0xcb49b2=a110_0x2401b4,_0x391711=loadSqlProjectConfig(_0x2d8950[_0xcb49b2(0x162)]),_0x3e1319=await readSqlLockFile(_0x391711['lockFilePath']),{lockData:_0x58e776,appLock:_0x347a06}=ensureSqlLockScope(_0x3e1319??createEmptySqlLock(),_0x2d8950[_0xcb49b2(0x162)],_0x391711[_0xcb49b2(0x145)],_0xcb49b2(0x13f)),_0x188c62=await getTargetSqlQueries(_0x391711,_0x347a06,_0x2d8950[_0xcb49b2(0x151)]('sqlcode')||undefined);if(_0x188c62[_0xcb49b2(0x16d)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xcb49b2(0x13d)};const _0x3556ac=[],_0x52123f=[],_0x3d34a9=[];for(const _0x3fa9d4 of _0x188c62){const _0x2b20ed=_0x347a06[_0xcb49b2(0x13c)][_0x3fa9d4['sqlCode']];if(!_0x2b20ed){_0x3d34a9['push']({'sqlCode':_0x3fa9d4[_0xcb49b2(0x164)],'error':_0xcb49b2(0x14f)});continue;}try{const _0x3cc619=await computeSqlFileHash(_0x3fa9d4[_0xcb49b2(0x15d)]),_0x4a7ef3=_0x2b20ed[_0xcb49b2(0x157)]!==_0x3fa9d4[_0xcb49b2(0x16b)]||!!_0x3fa9d4[_0xcb49b2(0x160)]&&_0x2b20ed['sqlName']!==_0x3fa9d4['sqlName'];if(!_0x2d8950[_0xcb49b2(0x16a)]('force')&&_0x2b20ed[_0xcb49b2(0x15b)]===_0x3cc619&&!_0x4a7ef3){_0x52123f[_0xcb49b2(0x13f)]({'sqlCode':_0x3fa9d4[_0xcb49b2(0x164)],'reason':'unchanged'});continue;}if(_0x2b20ed['version']==null){_0x3d34a9[_0xcb49b2(0x13f)]({'sqlCode':_0x3fa9d4[_0xcb49b2(0x164)],'error':_0xcb49b2(0x15a)});continue;}const _0x155144=await readFile(_0x3fa9d4[_0xcb49b2(0x15d)],'utf8'),_0x5f4c7c=stripLocalSqlMetadata(_0x155144,_0x3fa9d4['mode']),_0x255b85=_0x3fa9d4[_0xcb49b2(0x160)]||_0x2b20ed[_0xcb49b2(0x160)],_0x422758=await resolveTargetDbBinding(_0x2d8950[_0xcb49b2(0x162)],_0x3fa9d4,_0x2b20ed),_0x7ac178=await updateSqlQuery({'id':_0x2b20ed[_0xcb49b2(0x15f)],'appCode':_0x2d8950[_0xcb49b2(0x162)],'sqlCode':_0x3fa9d4[_0xcb49b2(0x164)],'sqlName':_0x255b85,'dbId':_0x422758[_0xcb49b2(0x174)],'version':_0x2b20ed['version'],'sqlContent':_0x5f4c7c,'sqlConfig':_0x2b20ed[_0xcb49b2(0x171)]??undefined}),_0x3fd82e=_0x7ac178[_0xcb49b2(0x174)]?await getDbName(_0x2d8950[_0xcb49b2(0x162)],Number(_0x7ac178['dbId']))[_0xcb49b2(0x14c)](()=>_0x422758[_0xcb49b2(0x144)]):_0x422758[_0xcb49b2(0x144)];_0x347a06[_0xcb49b2(0x13c)][_0x3fa9d4[_0xcb49b2(0x164)]]={...buildSqlLockEntry(_0x7ac178,_0x5f4c7c,_0x3cc619,{'dbName':_0x3fd82e}),'path':_0x3fa9d4[_0xcb49b2(0x16b)],'mode':_0x2b20ed['mode']},await archivePreviousSqlFileIfNeeded(_0x391711,_0x2b20ed[_0xcb49b2(0x157)],_0x3fa9d4[_0xcb49b2(0x16b)]),_0x3556ac['push']({'sqlCode':_0x3fa9d4[_0xcb49b2(0x164)],'remoteId':_0x2b20ed[_0xcb49b2(0x15f)]});}catch(_0x39149a){_0x3d34a9[_0xcb49b2(0x13f)]({'sqlCode':_0x3fa9d4['sqlCode'],'error':_0x39149a instanceof Error?_0x39149a['message']:String(_0x39149a)});}}return _0x347a06['lastSync']=new Date()[_0xcb49b2(0x149)](),await writeSqlLockFile(_0x391711[_0xcb49b2(0x16e)],_0x58e776),{'ok':_0x3d34a9['length']===0x0,'data':{'pushed':_0x3556ac,'skipped':_0x52123f,'failed':_0x3d34a9},'message':_0xcb49b2(0x168)+_0x3556ac[_0xcb49b2(0x16d)]+_0xcb49b2(0x136)+_0x52123f['length']+'\x20skipped,\x20'+_0x3d34a9[_0xcb49b2(0x16d)]+_0xcb49b2(0x176)};}};async function archivePreviousSqlFileIfNeeded(_0x1f2d59,_0x35ca3c,_0x45cc9d){const _0x15d57c=a110_0x2401b4;if(!_0x35ca3c||_0x35ca3c===_0x45cc9d)return;const _0x27cbcb=join(_0x1f2d59[_0x15d57c(0x175)],_0x35ca3c);if(!await fileExists(_0x27cbcb))return;const _0x42d422=await moveToTrash(_0x1f2d59[_0x15d57c(0x15e)],_0x1f2d59[_0x15d57c(0x173)],_0x27cbcb);await cleanupEmptyDirectories(dirname(_0x27cbcb),_0x1f2d59[_0x15d57c(0x175)]),void _0x42d422;}async function moveToTrash(_0x474459,_0x3ecc40,_0x186118){const _0x3c0f56=a110_0x2401b4,_0x1c0e98=new Date()[_0x3c0f56(0x149)]()[_0x3c0f56(0x13b)](/[:.]/g,'-'),_0x50f561=relative(_0x474459,_0x186118),_0x8603a6=join(_0x3ecc40,_0x1c0e98,_0x50f561);return await mkdir(dirname(_0x8603a6),{'recursive':!![]}),await rename(_0x186118,_0x8603a6),_0x8603a6;}async function cleanupEmptyDirectories(_0x53a373,_0x21a6b6){const _0x181516=a110_0x2401b4;let _0x1b7c88=resolve(_0x53a373);const _0x41d6db=resolve(_0x21a6b6);while(_0x1b7c88[_0x181516(0x154)](''+_0x41d6db+sep)||_0x1b7c88===_0x41d6db){if(_0x1b7c88===_0x41d6db)return;try{const _0x30dacb=await readdir(_0x1b7c88);if(_0x30dacb[_0x181516(0x16d)]>0x0)return;await rmdir(_0x1b7c88);}catch{return;}_0x1b7c88=dirname(_0x1b7c88);}}function a110_0x1a57(_0x3222a7,_0x49e2c3){_0x3222a7=_0x3222a7-0x135;const _0x39203a=a110_0x3920();let _0x1a573e=_0x39203a[_0x3222a7];return _0x1a573e;}async function resolveTargetDbBinding(_0x3671ff,_0x40d837,_0x13e4a1){const _0x38558a=a110_0x2401b4,_0x7fc01c=_0x40d837['dbDirectory'];if(!_0x7fc01c)return{'dbId':_0x13e4a1[_0x38558a(0x174)],'dbName':_0x13e4a1[_0x38558a(0x144)]};const _0x468c0e=buildDbDirectoryName(_0x13e4a1[_0x38558a(0x144)],_0x13e4a1[_0x38558a(0x174)]);if(_0x7fc01c===_0x468c0e)return{'dbId':_0x13e4a1[_0x38558a(0x174)],'dbName':_0x13e4a1[_0x38558a(0x144)]};const _0x277f1a=parseExplicitDbDirectory(_0x7fc01c);if(_0x277f1a!=null)return{'dbId':_0x277f1a,'dbName':await getDbName(_0x3671ff,_0x277f1a)[_0x38558a(0x14c)](()=>undefined)};const _0x9411d4=await listDatabases(_0x3671ff),_0x347b8b=_0x9411d4[_0x38558a(0x158)](_0x11747c=>buildDbDirectoryName(_0x11747c[_0x38558a(0x144)],_0x11747c[_0x38558a(0x174)])===_0x7fc01c);if(_0x347b8b[_0x38558a(0x16d)]===0x1)return{'dbId':_0x347b8b[0x0][_0x38558a(0x174)],'dbName':_0x347b8b[0x0]['dbName']};if(_0x347b8b[_0x38558a(0x16d)]===0x0)throw CliErrors[_0x38558a(0x13e)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x7fc01c+'\x22\x20for\x20sqlCode\x20'+_0x40d837[_0x38558a(0x164)]+'.');const _0x4bdaa5=_0x347b8b[_0x38558a(0x16c)](_0x16e69c=>_0x16e69c[_0x38558a(0x144)]+'\x20('+_0x16e69c[_0x38558a(0x174)]+')')[_0x38558a(0x143)](',\x20');throw CliErrors[_0x38558a(0x13e)](_0x38558a(0x165)+_0x7fc01c+_0x38558a(0x135)+_0x40d837['sqlCode']+':\x20'+_0x4bdaa5);}function parseExplicitDbDirectory(_0x1553ed){const _0x2bede1=a110_0x2401b4,_0x34566c=/^db-(\d+)$/[_0x2bede1(0x147)](_0x1553ed);if(!_0x34566c)return null;const _0x5ed136=Number(_0x34566c[0x1]);return Number[_0x2bede1(0x138)](_0x5ed136)&&_0x5ed136>0x0?_0x5ed136:null;}
@@ -1 +1 @@
1
- function a83_0x24f3(){const _0x3d81e0=['Updated','Path\x20to\x20the\x20SQL\x20file','blocked','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','658072ZERatA','appCode','write','validation','message','none','dbName','SQL\x20query\x20description','sqlType','Validation:\x20','sqlcode','parameters','\x20chars)','sql','Save\x20SQL\x20query\x20from\x20','string','cwd','dbId','\x20successfully','tables','Type:\x20','POST','1499882cRrgTA','join','Conflict\x20detected','utf-8','3152SPblyE','str','Created','3282430oEzRxk','110430cIGees','SQL\x20query\x20display\x20name','sqlCode','sqlname','created','valid','4llBjCi','action','save','SQL\x20validation\x20failed:\x20','\x20|\x20Tables:\x20','1858251ewgsxj','file','4463870zsozZt','11823UaWLMp','/api/node-toolbox/sql/save','sqlName','9aduTYB'];a83_0x24f3=function(){return _0x3d81e0;};return a83_0x24f3();}const a83_0x465f0c=a83_0x3a87;(function(_0x1424ac,_0x1b903c){const _0x36da20=a83_0x3a87,_0x37c7b5=_0x1424ac();while(!![]){try{const _0x7ddc6f=parseInt(_0x36da20(0x19b))/0x1+-parseInt(_0x36da20(0x17d))/0x2+-parseInt(_0x36da20(0x190))/0x3+-parseInt(_0x36da20(0x18b))/0x4*(-parseInt(_0x36da20(0x192))/0x5)+-parseInt(_0x36da20(0x185))/0x6+-parseInt(_0x36da20(0x193))/0x7*(-parseInt(_0x36da20(0x181))/0x8)+-parseInt(_0x36da20(0x196))/0x9*(parseInt(_0x36da20(0x184))/0xa);if(_0x7ddc6f===_0x1b903c)break;else _0x37c7b5['push'](_0x37c7b5['shift']());}catch(_0x15b60f){_0x37c7b5['push'](_0x37c7b5['shift']());}}}(a83_0x24f3,0x7a252));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';import{validateSql}from'../../core/sql-validator.js';import{CliErrors}from'../../errors.js';function a83_0x3a87(_0x255082,_0x910b52){_0x255082=_0x255082-0x168;const _0x24f385=a83_0x24f3();let _0x3a878d=_0x24f385[_0x255082];return _0x3a878d;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlSave={'service':a83_0x465f0c(0x174),'command':a83_0x465f0c(0x18d),'description':a83_0x465f0c(0x19a),'risk':a83_0x465f0c(0x169),'flags':[{'name':a83_0x465f0c(0x191),'type':'string','required':!![],'description':a83_0x465f0c(0x198)},SQLCODE_FLAG_OPTIONAL,{'name':a83_0x465f0c(0x188),'type':a83_0x465f0c(0x176),'description':a83_0x465f0c(0x186)},{'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':a83_0x465f0c(0x16e)}],async 'validate'(_0x57aa1f){const _0x5548ab=a83_0x465f0c,_0x517732=resolve(process[_0x5548ab(0x177)](),_0x57aa1f['str'](_0x5548ab(0x191)));if(!existsSync(_0x517732))throw CliErrors[_0x5548ab(0x16a)]('File\x20not\x20found:\x20'+_0x517732);const _0x428540=readFileSync(_0x517732,_0x5548ab(0x180)),_0x18405a=validateSql(_0x428540);if(!_0x18405a[_0x5548ab(0x18a)])throw CliErrors[_0x5548ab(0x16a)](_0x5548ab(0x18e)+_0x18405a['message']);},async 'dryRun'(_0x4000fd){const _0x310762=a83_0x465f0c,_0x3aab22=resolve(process[_0x310762(0x177)](),_0x4000fd[_0x310762(0x182)](_0x310762(0x191))),_0x222a6f=readFileSync(_0x3aab22,_0x310762(0x180)),_0x451371=validateSql(_0x222a6f),_0x182d99=_0x4000fd[_0x310762(0x182)]('db')||undefined,{db:_0x293dd8,error:_0x2ad110}=await resolveOneDb(_0x4000fd[_0x310762(0x168)],_0x182d99);return{'method':_0x310762(0x17c),'url':_0x310762(0x194),'body':{'appCode':_0x4000fd[_0x310762(0x168)],'sqlContent':'('+_0x222a6f['length']+_0x310762(0x173),'sqlCode':_0x4000fd[_0x310762(0x182)](_0x310762(0x171))||undefined,'sqlName':_0x4000fd[_0x310762(0x182)]('sqlname')||undefined,'db':_0x293dd8?_0x293dd8[_0x310762(0x16d)]+'\x20('+_0x293dd8['dbId']+')':_0x2ad110},'description':[_0x310762(0x175)+_0x4000fd[_0x310762(0x182)](_0x310762(0x191)),_0x310762(0x170)+_0x451371[_0x310762(0x16b)],_0x310762(0x17b)+_0x451371[_0x310762(0x16f)]['type']+_0x310762(0x18f)+(_0x451371[_0x310762(0x17a)][_0x310762(0x17e)](',\x20')||'N/A')+'\x20|\x20Params:\x20'+(_0x451371[_0x310762(0x172)][_0x310762(0x17e)](',\x20')||_0x310762(0x16c))]['join']('\x0a')};},async 'execute'(_0x5cf53e){const _0x3f7d1f=a83_0x465f0c,_0x50c487=resolve(process[_0x3f7d1f(0x177)](),_0x5cf53e[_0x3f7d1f(0x182)](_0x3f7d1f(0x191))),_0x3382ed=readFileSync(_0x50c487,_0x3f7d1f(0x180)),_0x117597=_0x5cf53e[_0x3f7d1f(0x182)]('db')||undefined,{db:_0x21c345,error:_0x31b895}=await resolveOneDb(_0x5cf53e['appCode'],_0x117597);if(_0x31b895)throw CliErrors[_0x3f7d1f(0x16a)](_0x31b895);const _0x19e84b=await saveSqlQuery({'appCode':_0x5cf53e[_0x3f7d1f(0x168)],'sqlContent':_0x3382ed,'sqlCode':_0x5cf53e[_0x3f7d1f(0x182)](_0x3f7d1f(0x171))||undefined,'sqlName':_0x5cf53e[_0x3f7d1f(0x182)](_0x3f7d1f(0x188))||undefined,'dbId':_0x21c345[_0x3f7d1f(0x178)],'description':_0x5cf53e[_0x3f7d1f(0x182)]('description')||undefined});if(_0x19e84b[_0x3f7d1f(0x199)])return{'ok':![],'data':_0x19e84b,'message':_0x19e84b[_0x3f7d1f(0x16b)]||_0x3f7d1f(0x17f)};return{'ok':!![],'data':{'sqlCode':_0x19e84b[_0x3f7d1f(0x187)],'sqlName':_0x19e84b[_0x3f7d1f(0x195)],'action':_0x19e84b[_0x3f7d1f(0x18c)]},'message':(_0x19e84b['action']===_0x3f7d1f(0x189)?_0x3f7d1f(0x183):_0x3f7d1f(0x197))+_0x3f7d1f(0x179)+(_0x19e84b[_0x3f7d1f(0x187)]?'\x20('+_0x19e84b['sqlCode']+')':'')};}};
1
+ const a111_0x726744=a111_0x374f;function a111_0x2dec(){const _0x3ec8bb=['208326QovJMn','join','sql','validation','725238muhwmf','description','919110NGoqbB','540932QTRtom','1890110PWFjEm','Query\x20description','file','string','Update\x20existing\x20SQL\x20by\x20editing\x20the\x20synced\x20file\x20under\x20`.rabetbase/sql/<appCode>/<dbName|db-<id>>/`\x20and\x20then\x20running\x20`rabetbase\x20sql\x20push\x20--sqlcode\x20<code>\x20--yes`.','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','sqlname','SQL\x20query\x20display\x20name','2341232fuuCvk','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','14JSiSHC','18290UDhGTz'];a111_0x2dec=function(){return _0x3ec8bb;};return a111_0x2dec();}(function(_0x2de33e,_0x2dc726){const _0x4d4caf=a111_0x374f,_0x35cbd0=_0x2de33e();while(!![]){try{const _0x39bc7c=parseInt(_0x4d4caf(0x1ad))/0x1+parseInt(_0x4d4caf(0x1b2))/0x2+-parseInt(_0x4d4caf(0x1ae))/0x3+-parseInt(_0x4d4caf(0x1a0))/0x4+-parseInt(_0x4d4caf(0x1a1))/0x5+-parseInt(_0x4d4caf(0x1b4))/0x6+-parseInt(_0x4d4caf(0x1ac))/0x7*(-parseInt(_0x4d4caf(0x1a9))/0x8);if(_0x39bc7c===_0x2dc726)break;else _0x35cbd0['push'](_0x35cbd0['shift']());}catch(_0xd8256c){_0x35cbd0['push'](_0x35cbd0['shift']());}}}(a111_0x2dec,0x383bf));import{CliErrors}from'../../errors.js';function a111_0x374f(_0x54324f,_0x90f94e){_0x54324f=_0x54324f-0x1a0;const _0x2decfc=a111_0x2dec();let _0x374ff5=_0x2decfc[_0x54324f];return _0x374ff5;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a111_0x726744(0x1aa),a111_0x726744(0x1ab),a111_0x726744(0x1a5)][a111_0x726744(0x1af)]('\x0a');export const sqlSave={'service':a111_0x726744(0x1b0),'command':'save','description':a111_0x726744(0x1a6),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a111_0x726744(0x1a3),'type':'string','required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':a111_0x726744(0x1a7),'type':'string','description':a111_0x726744(0x1a8)},{'name':'db','type':a111_0x726744(0x1a4),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':a111_0x726744(0x1b3),'type':a111_0x726744(0x1a4),'description':a111_0x726744(0x1a2)}],async 'validate'(){const _0x226762=a111_0x726744;throw CliErrors[_0x226762(0x1b1)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x3bfe5b=a111_0x726744;throw CliErrors[_0x3bfe5b(0x1b1)](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- const a84_0x3d6e90=a84_0x5d62;(function(_0x345f32,_0x2f538e){const _0x52b2b9=a84_0x5d62,_0x4b1a56=_0x345f32();while(!![]){try{const _0x4533d5=-parseInt(_0x52b2b9(0x180))/0x1*(-parseInt(_0x52b2b9(0x178))/0x2)+-parseInt(_0x52b2b9(0x171))/0x3*(parseInt(_0x52b2b9(0x17e))/0x4)+parseInt(_0x52b2b9(0x185))/0x5+-parseInt(_0x52b2b9(0x16e))/0x6*(-parseInt(_0x52b2b9(0x186))/0x7)+-parseInt(_0x52b2b9(0x17b))/0x8*(parseInt(_0x52b2b9(0x17d))/0x9)+-parseInt(_0x52b2b9(0x184))/0xa+-parseInt(_0x52b2b9(0x177))/0xb;if(_0x4533d5===_0x2f538e)break;else _0x4b1a56['push'](_0x4b1a56['shift']());}catch(_0x5826a9){_0x4b1a56['push'](_0x4b1a56['shift']());}}}(a84_0x342b,0x38bb6));function a84_0x5d62(_0x5256c5,_0x50eb42){_0x5256c5=_0x5256c5-0x16e;const _0x342bc2=a84_0x342b();let _0x5d6223=_0x342bc2[_0x5256c5];return _0x5d6223;}function a84_0x342b(){const _0x31f0db=['2657208BNbqFs','sqlName','9seXzYT','163412TTGwIp','endsWith','46azcBTA','set','.rabetbase/sql','.sql','2587550olnwxt','1702930CGcMvb','698138aeHksC','trimEnd','join','24EWZqSw','trim','unknown','3yUpBLf','description','replace','sqlContent','unnamed','--\x20@lovrabet.sqlName:\x20','3356837SICVWg','18686lBSujG','has','sqlCode'];a84_0x342b=function(){return _0x31f0db;};return a84_0x342b();}import{join}from'node:path';export const SQL_LOCAL_REL_DIR=a84_0x3d6e90(0x182);export function resolveSqlLocalDir(_0x47eae4){return join(_0x47eae4,SQL_LOCAL_REL_DIR);}export function safeSqlFileBaseName(_0x574beb){const _0x199c0b=a84_0x3d6e90,_0x9b2275=_0x574beb['trim']()||'unnamed',_0x57fedf=_0x9b2275[_0x199c0b(0x173)](/[/\\?%*:|"<>]/g,'_')[_0x199c0b(0x173)](/\s+/g,'_')[_0x199c0b(0x173)](/_+/g,'_');return _0x57fedf||_0x199c0b(0x175);}export function assignSqlFileNames(_0xbbb343){const _0x2ad361=a84_0x3d6e90,_0x18827c=new Map();for(const _0x5f43d7 of _0xbbb343){const _0xe79e71=safeSqlFileBaseName(_0x5f43d7[_0x2ad361(0x17c)]??'unnamed');let _0x1edc0b=_0xe79e71+_0x2ad361(0x183);if(_0x18827c[_0x2ad361(0x179)](_0x1edc0b)){const _0x551ce0=(_0x5f43d7['sqlCode']??_0x2ad361(0x170))['replace'](/-/g,'');_0x1edc0b=_0xe79e71+'__'+_0x551ce0+_0x2ad361(0x183);}let _0x25e879=0x0,_0x4c42d0=_0x1edc0b;while(_0x18827c[_0x2ad361(0x179)](_0x4c42d0)){_0x25e879++,_0x4c42d0=_0xe79e71+'__'+_0x25e879+_0x2ad361(0x183);}_0x18827c[_0x2ad361(0x181)](_0x4c42d0,_0x5f43d7);}return _0x18827c;}export function buildPulledSqlFileContent(_0x3395c2){const _0x3caba9=a84_0x3d6e90,_0x599ef7=_0x3395c2['sqlName']??_0x3caba9(0x175),_0x3bf102=_0x3395c2[_0x3caba9(0x17a)]??'',_0x386f00=(_0x3395c2[_0x3caba9(0x172)]??'')[_0x3caba9(0x173)](/\r?\n/g,'\x20')[_0x3caba9(0x16f)](),_0x5619aa=_0x3395c2[_0x3caba9(0x174)]??'',_0x25bf0a=[_0x3caba9(0x176)+_0x599ef7,'--\x20@lovrabet.sqlCode:\x20'+_0x3bf102,'--\x20@lovrabet.description:'+(_0x386f00?'\x20'+_0x386f00:''),'',_0x5619aa[_0x3caba9(0x187)]()],_0x4c8d66=_0x25bf0a[_0x3caba9(0x188)]('\x0a');return _0x4c8d66[_0x3caba9(0x17f)]('\x0a')?_0x4c8d66:_0x4c8d66+'\x0a';}
1
+ const a112_0x1b317b=a112_0x27af;(function(_0x2026b8,_0x291d6e){const _0x18969d=a112_0x27af,_0x380120=_0x2026b8();while(!![]){try{const _0x2d5ad3=parseInt(_0x18969d(0x202))/0x1+-parseInt(_0x18969d(0x1ff))/0x2*(-parseInt(_0x18969d(0x20b))/0x3)+-parseInt(_0x18969d(0x20d))/0x4+parseInt(_0x18969d(0x1f1))/0x5+parseInt(_0x18969d(0x1fb))/0x6*(parseInt(_0x18969d(0x1f7))/0x7)+-parseInt(_0x18969d(0x1f3))/0x8*(-parseInt(_0x18969d(0x210))/0x9)+-parseInt(_0x18969d(0x1f6))/0xa;if(_0x2d5ad3===_0x291d6e)break;else _0x380120['push'](_0x380120['shift']());}catch(_0x136030){_0x380120['push'](_0x380120['shift']());}}}(a112_0x16b2,0xaee2d));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a112_0x1b317b(0x20f);export function buildSqlLockEntry(_0x20ea00,_0x42c54d,_0x5d2b1b,_0x55ee2e){const _0x5be269=a112_0x1b317b,_0x154908=detectSqlMode(_0x42c54d);return{'path':buildSqlRelativePath(_0x20ea00['sqlCode'],_0x20ea00[_0x5be269(0x1fa)],_0x55ee2e?.[_0x5be269(0x20e)],_0x154908,_0x20ea00[_0x5be269(0x217)]),'hash':_0x5d2b1b,'remoteId':_0x20ea00['id'],'version':_0x20ea00[_0x5be269(0x1f5)],'dbId':Number(_0x20ea00[_0x5be269(0x217)]),'dbName':_0x55ee2e?.['dbName'],'sqlName':_0x20ea00[_0x5be269(0x1fa)],'sqlConfig':_0x20ea00[_0x5be269(0x1f4)]??undefined,'mode':_0x154908};}export function cloneSqlLockData(_0x49a05c){const _0x5a09e4=a112_0x1b317b;return{'apps':Object['fromEntries'](Object[_0x5a09e4(0x211)](_0x49a05c[_0x5a09e4(0x20c)])[_0x5a09e4(0x200)](([_0x11e7c9,_0x3b8898])=>[_0x11e7c9,{'sqlRoot':_0x3b8898[_0x5a09e4(0x201)],'lastSync':_0x3b8898[_0x5a09e4(0x20a)],'sqls':{..._0x3b8898[_0x5a09e4(0x214)]}}]))};}function a112_0x16b2(){const _0x3e5d7d=['mode','description','\x20-->','mybatisXml','question','endsWith','lastSync','849XLvddX','apps','3344548jobxta','dbName','.rabetbase/sql','17199RgcZfG','entries','syncedAt','\x20[y/N]\x20','sqls','path','filter','dbId','<!--\x20@lovrabet.','2216680TrokGy','trim','112wvAtvV','sqlConfig','version','15497960zgaNTL','7742XFVpMP','join','stderr','sqlName','4542ChbNRV','--\x20@lovrabet.','length','test','7926Bbzejt','map','sqlRoot','673405bAbloH','sqlCode'];a112_0x16b2=function(){return _0x3e5d7d;};return a112_0x16b2();}export function ensureRemoteSqlContent(_0x3c6347){return _0x3c6347['sqlContent']??'';}export function buildLocalSqlFileContent(_0x58d99c,_0x4e0d4d,_0x554eba){const _0x47d481=a112_0x1b317b,_0x29f5eb=_0x554eba?.[_0x47d481(0x204)]??detectSqlMode(_0x4e0d4d),_0xcb664a=stripLocalSqlMetadata(_0x4e0d4d,_0x29f5eb)['trim'](),_0x3e5b9c=[...buildMetadataHeaderLines({'sqlCode':_0x58d99c[_0x47d481(0x203)],'sqlName':_0x58d99c[_0x47d481(0x1fa)],'dbId':_0x58d99c[_0x47d481(0x217)],'dbName':_0x554eba?.[_0x47d481(0x20e)],'mode':_0x29f5eb,'syncedAt':_0x554eba?.[_0x47d481(0x212)],'description':_0x554eba?.[_0x47d481(0x205)]},_0x29f5eb),'',_0xcb664a],_0x368891=_0x3e5b9c['join']('\x0a');return _0x368891[_0x47d481(0x209)]('\x0a')?_0x368891:_0x368891+'\x0a';}function a112_0x27af(_0x1ae070,_0x98893a){_0x1ae070=_0x1ae070-0x1f1;const _0x16b203=a112_0x16b2();let _0x27afdb=_0x16b203[_0x1ae070];return _0x27afdb;}export function stripLocalSqlMetadata(_0x56faf6,_0x4049ed){const _0x5181f0=a112_0x1b317b,_0x267161=_0x56faf6['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x535a8e=[];let _0x1536b2=0x0;if(_0x4049ed===_0x5181f0(0x207))while(_0x1536b2<_0x267161[_0x5181f0(0x1fd)]){const _0x1f38c0=_0x267161[_0x1536b2]??'';if(/^\s*<!--\s*@lovrabet\./[_0x5181f0(0x1fe)](_0x1f38c0)){_0x1536b2++;continue;}if(_0x1f38c0[_0x5181f0(0x1f2)]()===''&&_0x1536b2>0x0){_0x1536b2++;continue;}break;}else while(_0x1536b2<_0x267161['length']){const _0x4844bc=_0x267161[_0x1536b2]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x4844bc)){_0x1536b2++;continue;}if(_0x4844bc[_0x5181f0(0x1f2)]()===''&&_0x1536b2>0x0){_0x1536b2++;continue;}break;}for(;_0x1536b2<_0x267161['length'];_0x1536b2++){_0x535a8e['push'](_0x267161[_0x1536b2]);}return _0x535a8e[_0x5181f0(0x1f8)]('\x0a')['trimStart']();}export function resolveSqlMode(_0x5193e8,_0x3e4834){const _0x34a2a6=a112_0x1b317b;if(_0x3e4834?.[_0x34a2a6(0x204)])return _0x3e4834[_0x34a2a6(0x204)];return detectSqlMode(_0x5193e8);}export function resolveSqlFileName(_0x3e72a6,_0x3e4b73,_0x1e2072){const _0x3866e6=a112_0x1b317b;if(_0x1e2072?.['path'])return _0x1e2072[_0x3866e6(0x215)];if(_0x1e2072?.['sqlName']||_0x1e2072?.[_0x3866e6(0x20e)])return buildSqlRelativePath(_0x3e72a6,_0x1e2072?.[_0x3866e6(0x1fa)],_0x1e2072?.[_0x3866e6(0x20e)],resolveSqlMode(_0x3e4b73,_0x1e2072),_0x1e2072?.['dbId']);return buildDefaultSqlFileName(_0x3e72a6,resolveSqlMode(_0x3e4b73,_0x1e2072));}export function resolveSqlLocalDir(_0x27e1ea,_0x361ac8){return join(_0x27e1ea,SQL_LOCAL_REL_DIR,_0x361ac8);}export async function confirmForceOverwrite(_0x19f7f8){const _0x11fd02=a112_0x1b317b,_0x31127f=createInterface({'input':process['stdin'],'output':process[_0x11fd02(0x1f9)]}),_0x109307=await new Promise(_0x5ba257=>{const _0x36e180=_0x11fd02;_0x31127f[_0x36e180(0x208)](_0x19f7f8+_0x36e180(0x213),_0x5ba257);});return _0x31127f['close'](),['y','yes']['includes'](_0x109307[_0x11fd02(0x1f2)]()['toLowerCase']());}export function findSqlLockScope(_0x14e655,_0x4f607a){const _0x155a69=a112_0x1b317b;return _0x14e655[_0x155a69(0x20c)][_0x4f607a];}function buildMetadataHeaderLines(_0x10a2b9,_0x23e050){const _0x20e83e=a112_0x1b317b,_0x35a053=[[_0x20e83e(0x203),_0x10a2b9['sqlCode']],['sqlName',_0x10a2b9[_0x20e83e(0x1fa)]],[_0x20e83e(0x217),_0x10a2b9[_0x20e83e(0x217)]],['dbName',_0x10a2b9['dbName']],[_0x20e83e(0x204),_0x10a2b9['mode']],[_0x20e83e(0x212),_0x10a2b9['syncedAt']],[_0x20e83e(0x205),_0x10a2b9['description']]];if(_0x23e050===_0x20e83e(0x207))return _0x35a053[_0x20e83e(0x216)](([,_0x5b6bb4])=>_0x5b6bb4!==undefined&&_0x5b6bb4!==null&&String(_0x5b6bb4)[_0x20e83e(0x1f2)]()!=='')[_0x20e83e(0x200)](([_0x2e2478,_0x3dcc66])=>_0x20e83e(0x218)+_0x2e2478+':\x20'+String(_0x3dcc66)+_0x20e83e(0x206));return _0x35a053[_0x20e83e(0x216)](([,_0x3bacad])=>_0x3bacad!==undefined&&_0x3bacad!==null&&String(_0x3bacad)['trim']()!=='')['map'](([_0x1c0883,_0x55366a])=>_0x20e83e(0x1fc)+_0x1c0883+':\x20'+String(_0x55366a));}
@@ -0,0 +1 @@
1
+ function a113_0x3d92(){const _0x3f5fd5=['filePath','sql','144GZovSk','paging','\x20missing,\x20','push','lockKey','map','21434bebbWm','381307NMjmBv','sqlName','sqls','\x20remote-only','lockFilePath','60922WUyzZN','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','1542825plcvtj','bool','5723800IaKAOu','length','\x20added,\x20','appCode','63pvNOWH','All\x20SQL\x20queries\x20are\x20in\x20sync.','tableData','587430XxdnbZ','sqlRoot','has','18KPSCHG','status','keys','totalCount','boolean','560668MPHAjm'];a113_0x3d92=function(){return _0x3f5fd5;};return a113_0x3d92();}const a113_0x6b86b0=a113_0x7036;(function(_0x462488,_0x27b468){const _0x9bcb3=a113_0x7036,_0x3ba0b8=_0x462488();while(!![]){try{const _0x54efb8=parseInt(_0x9bcb3(0x152))/0x1+parseInt(_0x9bcb3(0x157))/0x2*(parseInt(_0x9bcb3(0x15f))/0x3)+parseInt(_0x9bcb3(0x16a))/0x4+-parseInt(_0x9bcb3(0x162))/0x5*(parseInt(_0x9bcb3(0x165))/0x6)+parseInt(_0x9bcb3(0x151))/0x7*(-parseInt(_0x9bcb3(0x16d))/0x8)+parseInt(_0x9bcb3(0x159))/0x9+-parseInt(_0x9bcb3(0x15b))/0xa;if(_0x54efb8===_0x27b468)break;else _0x3ba0b8['push'](_0x3ba0b8['shift']());}catch(_0x4c205f){_0x3ba0b8['push'](_0x3ba0b8['shift']());}}}(a113_0x3d92,0x56172));function a113_0x7036(_0x20a7cf,_0x5266a9){_0x20a7cf=_0x20a7cf-0x14f;const _0x3d92db=a113_0x3d92();let _0x70363=_0x3d92db[_0x20a7cf];return _0x70363;}import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x2f5927){const _0x4da038=a113_0x7036,_0x2ece9e=[];let _0x599626=0x1;while(!![]){const _0x26fe24=await listSqlQueries(_0x2f5927,{'currentPage':_0x599626,'pageSize':PAGE_SIZE}),_0x4fb258=_0x26fe24[_0x4da038(0x161)]??[];_0x2ece9e['push'](..._0x4fb258[_0x4da038(0x150)](_0x556157=>_0x556157['sqlCode']));if(_0x4fb258[_0x4da038(0x15c)]===0x0)break;const _0x4dbfb0=_0x26fe24[_0x4da038(0x16e)]?.[_0x4da038(0x168)];if(_0x4dbfb0!=null?_0x2ece9e[_0x4da038(0x15c)]>=_0x4dbfb0:_0x4fb258[_0x4da038(0x15c)]<PAGE_SIZE)break;_0x599626++;}return _0x2ece9e;}export const sqlStatus={'service':a113_0x6b86b0(0x16c),'command':a113_0x6b86b0(0x166),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':'read','flags':[{'name':'remote','type':a113_0x6b86b0(0x169),'description':a113_0x6b86b0(0x158)}],async 'execute'(_0x4b3ff8){const _0x31856a=a113_0x6b86b0,_0xb8b12=loadSqlProjectConfig(_0x4b3ff8[_0x31856a(0x15e)]),_0x57ad25=await readSqlLockFile(_0xb8b12[_0x31856a(0x156)]),{appLock:_0x5c68e3}=ensureSqlLockScope(_0x57ad25??createEmptySqlLock(),_0xb8b12['appCode'],_0xb8b12[_0x31856a(0x163)],_0x31856a(0x166)),_0x5e9816=await scanLocalSqlQueries(_0xb8b12),_0x518e26=[],_0x330b1b=[],_0x167187=[],_0x106cfc=[],_0x74dafb=new Set(_0x5e9816[_0x31856a(0x150)](_0x53e3fe=>_0x53e3fe[_0x31856a(0x14f)]));for(const _0x3a9395 of _0x5e9816){const _0x45a689=await computeSqlFileHash(_0x3a9395[_0x31856a(0x16b)]),_0xd6e489=_0x5c68e3[_0x31856a(0x154)][_0x3a9395[_0x31856a(0x14f)]],_0x431ac5=!!_0xd6e489&&_0xd6e489['path']!==_0x3a9395['relativePath'],_0x2c7938=!!_0xd6e489&&!!_0x3a9395['sqlName']&&_0xd6e489[_0x31856a(0x153)]!==_0x3a9395[_0x31856a(0x153)];if(!_0xd6e489)_0x518e26[_0x31856a(0x170)](_0x3a9395[_0x31856a(0x14f)]);else _0xd6e489['hash']!==_0x45a689||_0x431ac5||_0x2c7938?_0x330b1b[_0x31856a(0x170)](_0x3a9395[_0x31856a(0x14f)]):_0x167187['push'](_0x3a9395['lockKey']);}for(const _0x1274c2 of Object[_0x31856a(0x167)](_0x5c68e3['sqls'])){!_0x74dafb['has'](_0x1274c2)&&_0x106cfc[_0x31856a(0x170)](_0x1274c2);}const _0x5a4a6e=[];if(_0x4b3ff8[_0x31856a(0x15a)]('remote')){const _0x1067c0=await fetchAllSqlCodes(_0x4b3ff8[_0x31856a(0x15e)]);for(const _0x51855b of _0x1067c0){!_0x74dafb[_0x31856a(0x164)](_0x51855b)&&!_0x5c68e3['sqls'][_0x51855b]&&_0x5a4a6e[_0x31856a(0x170)](_0x51855b);}}const _0x441069=_0x518e26[_0x31856a(0x15c)]===0x0&&_0x330b1b[_0x31856a(0x15c)]===0x0&&_0x106cfc['length']===0x0&&_0x5a4a6e['length']===0x0;return{'ok':!![],'data':{'added':_0x518e26,'modified':_0x330b1b,'missing':_0x106cfc,'unchanged':_0x167187,'remoteOnly':_0x5a4a6e},'message':_0x441069?_0x31856a(0x160):_0x518e26[_0x31856a(0x15c)]+_0x31856a(0x15d)+_0x330b1b[_0x31856a(0x15c)]+'\x20modified,\x20'+_0x106cfc['length']+_0x31856a(0x16f)+_0x167187['length']+'\x20unchanged'+(_0x5a4a6e[_0x31856a(0x15c)]>0x0?',\x20'+_0x5a4a6e[_0x31856a(0x15c)]+_0x31856a(0x155):'')};}};
@@ -1 +1 @@
1
- const a78_0x241cb0=a78_0x59b0;function a78_0x409c(){const _0xd18dde=['utf-8','file','6335660CrgBjc','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','\x22\x20not\x20found\x20in\x20any\x20dataset','isSelectOnly','3001275DdDfDh','appCode','6466020RVtrqf','map','validate','string','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','fields','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','validation','3509942aCBSvm','67995050ZiMtmj','message','from','str','dbtableConfig','schemas','push','tableName','filter','trim','type','size','reason','length','flagMissing','Provide\x20--file\x20or\x20--sql','sql','3294375IZHsMh','parameters','toLowerCase','tables','File\x20not\x20found:\x20','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','valid','1vxvIMe','4323855zUryFJ','schema:','sqlType','40GIGPjH','cwd','5WcjbKU'];a78_0x409c=function(){return _0xd18dde;};return a78_0x409c();}(function(_0x2fd963,_0x162ed4){const _0x20660f=a78_0x59b0,_0x42c05f=_0x2fd963();while(!![]){try{const _0x449416=parseInt(_0x20660f(0x134))/0x1*(-parseInt(_0x20660f(0x14b))/0x2)+-parseInt(_0x20660f(0x135))/0x3+parseInt(_0x20660f(0x13d))/0x4*(-parseInt(_0x20660f(0x13a))/0x5)+parseInt(_0x20660f(0x143))/0x6+-parseInt(_0x20660f(0x12d))/0x7+parseInt(_0x20660f(0x138))/0x8*(-parseInt(_0x20660f(0x141))/0x9)+parseInt(_0x20660f(0x14c))/0xa;if(_0x449416===_0x162ed4)break;else _0x42c05f['push'](_0x42c05f['shift']());}catch(_0x54edeb){_0x42c05f['push'](_0x42c05f['shift']());}}}(a78_0x409c,0xea21c));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a78_0x59b0(_0x37753a,_0x543f95){_0x37753a=_0x37753a-0x123;const _0x409c9c=a78_0x409c();let _0x59b0ec=_0x409c9c[_0x37753a];return _0x59b0ec;}import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a78_0x241cb0(0x12c),'command':a78_0x241cb0(0x145),'description':a78_0x241cb0(0x13e),'risk':'read','flags':[{'name':a78_0x241cb0(0x13c),'type':a78_0x241cb0(0x146),'description':a78_0x241cb0(0x149)},{'name':a78_0x241cb0(0x12c),'type':'string','description':a78_0x241cb0(0x147)},{'name':'schemas','type':a78_0x241cb0(0x146),'description':a78_0x241cb0(0x132)}],async 'execute'(_0x3e0011){const _0x4f9f60=a78_0x241cb0,_0x25fa51=_0x3e0011[_0x4f9f60(0x14f)](_0x4f9f60(0x13c)),_0x22484e=_0x3e0011[_0x4f9f60(0x14f)](_0x4f9f60(0x12c));if(!_0x25fa51&&!_0x22484e)throw CliErrors[_0x4f9f60(0x12a)]('file',_0x4f9f60(0x12b));let _0x44b150;if(_0x25fa51){const _0x3befed=resolve(process[_0x4f9f60(0x139)](),_0x25fa51);if(!existsSync(_0x3befed))throw CliErrors[_0x4f9f60(0x14a)](_0x4f9f60(0x131)+_0x3befed);_0x44b150=readFileSync(_0x3befed,_0x4f9f60(0x13b));}else _0x44b150=_0x22484e;const _0x22e4bb=validateSql(_0x44b150),_0x4609e8={'valid':_0x22e4bb[_0x4f9f60(0x133)],'sqlType':_0x22e4bb[_0x4f9f60(0x137)][_0x4f9f60(0x126)],'isSelectOnly':_0x22e4bb[_0x4f9f60(0x137)][_0x4f9f60(0x140)],'isDangerous':_0x22e4bb['sqlType']['isDangerous'],'tables':_0x22e4bb[_0x4f9f60(0x130)],'parameters':_0x22e4bb[_0x4f9f60(0x12e)],'message':_0x22e4bb[_0x4f9f60(0x14d)]};_0x22e4bb[_0x4f9f60(0x137)][_0x4f9f60(0x128)]&&(_0x4609e8[_0x4f9f60(0x128)]=_0x22e4bb[_0x4f9f60(0x137)][_0x4f9f60(0x128)]);const _0x444183=_0x3e0011[_0x4f9f60(0x14f)](_0x4f9f60(0x151));if(_0x444183&&_0x22e4bb[_0x4f9f60(0x133)]){const _0x2cb7e1=_0x444183['split'](',')[_0x4f9f60(0x144)](_0x2c1aa1=>_0x2c1aa1[_0x4f9f60(0x125)]())[_0x4f9f60(0x124)](Boolean),_0x5d88ce=[],_0xbb1e8=await listDatasets(_0x3e0011[_0x4f9f60(0x142)]),_0x14efed=new Map(_0xbb1e8[_0x4f9f60(0x144)](_0x1ebbcb=>[_0x1ebbcb['dbtableConfig']?.[_0x4f9f60(0x123)]?.[_0x4f9f60(0x12f)](),_0x1ebbcb]));for(const _0x4fe4ca of _0x22e4bb[_0x4f9f60(0x130)]){const _0x6cb67b=_0x14efed['get'](_0x4fe4ca[_0x4f9f60(0x12f)]());!_0x6cb67b&&_0x5d88ce[_0x4f9f60(0x152)]('Table\x20\x22'+_0x4fe4ca+_0x4f9f60(0x13f));}for(const _0x102fbf of _0x2cb7e1){try{const _0x2fc377=await getDatasetDetail(_0x102fbf),_0x363dc2=Array['isArray'](_0x2fc377[_0x4f9f60(0x148)])?_0x2fc377[_0x4f9f60(0x148)]:[],_0x196514=new Set(_0x363dc2[_0x4f9f60(0x144)](_0x4029ec=>_0x4029ec['name']?.[_0x4f9f60(0x12f)]())),_0x372133=_0x2fc377[_0x4f9f60(0x150)]?.['tableName']||_0x2fc377[_0x4f9f60(0x123)]||_0x102fbf;_0x4609e8[_0x4f9f60(0x136)+_0x372133]={'code':_0x102fbf,'tableName':_0x372133,'fieldCount':_0x196514[_0x4f9f60(0x127)],'fields':Array[_0x4f9f60(0x14e)](_0x196514)};}catch{_0x5d88ce[_0x4f9f60(0x152)]('Dataset\x20\x22'+_0x102fbf+'\x22\x20not\x20found\x20or\x20not\x20accessible');}}_0x5d88ce[_0x4f9f60(0x129)]>0x0&&(_0x4609e8['schemaWarnings']=_0x5d88ce);}return{'ok':_0x22e4bb[_0x4f9f60(0x133)],'data':_0x4609e8,'message':_0x22e4bb['message']};}};
1
+ const a114_0x22a98b=a114_0x5022;(function(_0x2da23b,_0x1715f7){const _0x44df76=a114_0x5022,_0x3a5658=_0x2da23b();while(!![]){try{const _0x50b7db=-parseInt(_0x44df76(0x12e))/0x1+-parseInt(_0x44df76(0x14d))/0x2+-parseInt(_0x44df76(0x14e))/0x3+-parseInt(_0x44df76(0x157))/0x4*(-parseInt(_0x44df76(0x13c))/0x5)+-parseInt(_0x44df76(0x14f))/0x6+parseInt(_0x44df76(0x15e))/0x7*(parseInt(_0x44df76(0x154))/0x8)+-parseInt(_0x44df76(0x137))/0x9*(-parseInt(_0x44df76(0x147))/0xa);if(_0x50b7db===_0x1715f7)break;else _0x3a5658['push'](_0x3a5658['shift']());}catch(_0x498b90){_0x3a5658['push'](_0x3a5658['shift']());}}}(a114_0x3d58,0xd503e));function a114_0x3d58(){const _0x524341=['from','438392SDsEsq','\x22\x20not\x20found\x20in\x20any\x20dataset','string','268rcpTGJ','get','map','str','tables','read','schemaWarnings','77HXTIfN','reason','Table\x20\x22','117359lIoKeO','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','size','length','isSelectOnly','split','cwd','trim','toLowerCase','20429181tSYKCM','appCode','type','utf-8','isDangerous','91265dmnepy','filter','name','\x22\x20not\x20found\x20or\x20not\x20accessible','validate','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','fields','isArray','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','valid','schema:','10DMnTqB','Provide\x20--file\x20or\x20--sql','file','sql','sqlType','push','3226540EtOXWs','59739hGwsaK','8835582MtDKsm','parameters','validation','File\x20not\x20found:\x20'];a114_0x3d58=function(){return _0x524341;};return a114_0x3d58();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a114_0x5022(_0x26c6d2,_0x55a365){_0x26c6d2=_0x26c6d2-0x12c;const _0x3d5839=a114_0x3d58();let _0x5022d1=_0x3d5839[_0x26c6d2];return _0x5022d1;}import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a114_0x22a98b(0x14a),'command':a114_0x22a98b(0x140),'description':a114_0x22a98b(0x144),'risk':a114_0x22a98b(0x15c),'flags':[{'name':a114_0x22a98b(0x149),'type':'string','description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':'sql','type':a114_0x22a98b(0x156),'description':a114_0x22a98b(0x12f)},{'name':'schemas','type':a114_0x22a98b(0x156),'description':a114_0x22a98b(0x141)}],async 'execute'(_0x2a6812){const _0x268593=a114_0x22a98b,_0x2c8ef1=_0x2a6812['str'](_0x268593(0x149)),_0x3e9343=_0x2a6812[_0x268593(0x15a)]('sql');if(!_0x2c8ef1&&!_0x3e9343)throw CliErrors['flagMissing']('file',_0x268593(0x148));let _0x154e5d;if(_0x2c8ef1){const _0x44d5cf=resolve(process[_0x268593(0x134)](),_0x2c8ef1);if(!existsSync(_0x44d5cf))throw CliErrors[_0x268593(0x151)](_0x268593(0x152)+_0x44d5cf);_0x154e5d=readFileSync(_0x44d5cf,_0x268593(0x13a));}else _0x154e5d=_0x3e9343;const _0x3701e1=validateSql(_0x154e5d),_0x55e0cb={'valid':_0x3701e1[_0x268593(0x145)],'sqlType':_0x3701e1[_0x268593(0x14b)][_0x268593(0x139)],'isSelectOnly':_0x3701e1[_0x268593(0x14b)][_0x268593(0x132)],'isDangerous':_0x3701e1[_0x268593(0x14b)][_0x268593(0x13b)],'tables':_0x3701e1[_0x268593(0x15b)],'parameters':_0x3701e1[_0x268593(0x150)],'message':_0x3701e1['message']};_0x3701e1['sqlType'][_0x268593(0x12c)]&&(_0x55e0cb[_0x268593(0x12c)]=_0x3701e1['sqlType'][_0x268593(0x12c)]);const _0x238875=_0x2a6812[_0x268593(0x15a)]('schemas');if(_0x238875&&_0x3701e1[_0x268593(0x145)]){const _0x26e2fc=_0x238875[_0x268593(0x133)](',')[_0x268593(0x159)](_0x35b625=>_0x35b625[_0x268593(0x135)]())[_0x268593(0x13d)](Boolean),_0x565192=[],_0xd8cd9c=await listDatasets(_0x2a6812[_0x268593(0x138)]),_0x5bb0da=new Map(_0xd8cd9c['map'](_0x363fbe=>[_0x363fbe['dbtableConfig']?.['tableName']?.['toLowerCase'](),_0x363fbe]));for(const _0x1b74a5 of _0x3701e1[_0x268593(0x15b)]){const _0x417eeb=_0x5bb0da[_0x268593(0x158)](_0x1b74a5[_0x268593(0x136)]());!_0x417eeb&&_0x565192[_0x268593(0x14c)](_0x268593(0x12d)+_0x1b74a5+_0x268593(0x155));}for(const _0x5e61e6 of _0x26e2fc){try{const _0x30fdf4=await getDatasetDetail(_0x5e61e6),_0x4d5887=Array[_0x268593(0x143)](_0x30fdf4[_0x268593(0x142)])?_0x30fdf4[_0x268593(0x142)]:[],_0xae4d9c=new Set(_0x4d5887[_0x268593(0x159)](_0x1a03df=>_0x1a03df[_0x268593(0x13e)]?.[_0x268593(0x136)]())),_0x251fd4=_0x30fdf4['dbtableConfig']?.['tableName']||_0x30fdf4['tableName']||_0x5e61e6;_0x55e0cb[_0x268593(0x146)+_0x251fd4]={'code':_0x5e61e6,'tableName':_0x251fd4,'fieldCount':_0xae4d9c[_0x268593(0x130)],'fields':Array[_0x268593(0x153)](_0xae4d9c)};}catch{_0x565192[_0x268593(0x14c)]('Dataset\x20\x22'+_0x5e61e6+_0x268593(0x13f));}}_0x565192[_0x268593(0x131)]>0x0&&(_0x55e0cb[_0x268593(0x15d)]=_0x565192);}return{'ok':_0x3701e1[_0x268593(0x145)],'data':_0x55e0cb,'message':_0x3701e1['message']};}};
@@ -1 +1 @@
1
- const a34_0x2c37ab=a34_0x2e11;(function(_0x225082,_0x4137f5){const _0xe27be=a34_0x2e11,_0x27104a=_0x225082();while(!![]){try{const _0x3df40c=-parseInt(_0xe27be(0x115))/0x1+parseInt(_0xe27be(0x10f))/0x2+-parseInt(_0xe27be(0xf7))/0x3*(parseInt(_0xe27be(0x101))/0x4)+-parseInt(_0xe27be(0xf4))/0x5+-parseInt(_0xe27be(0xff))/0x6+-parseInt(_0xe27be(0xfc))/0x7+parseInt(_0xe27be(0x109))/0x8;if(_0x3df40c===_0x4137f5)break;else _0x27104a['push'](_0x27104a['shift']());}catch(_0x3e10c6){_0x27104a['push'](_0x27104a['shift']());}}}(a34_0x68e4,0xdb19a));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=[a34_0x2c37ab(0x11b),a34_0x2c37ab(0x102),a34_0x2c37ab(0x114),a34_0x2c37ab(0xfe),a34_0x2c37ab(0x105)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a34_0x2c37ab(0x119),a34_0x2c37ab(0x111),a34_0x2c37ab(0x114),a34_0x2c37ab(0xfe),a34_0x2c37ab(0x11b),a34_0x2c37ab(0x102),a34_0x2c37ab(0x11a)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x898c8c){const _0x5aaed7=a34_0x2c37ab;return[..._0x898c8c][_0x5aaed7(0x100)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x433c62){const _0x3973ec=a34_0x2c37ab;return TOP_LEVEL_CONFIG_KEYS[_0x3973ec(0x104)](_0x433c62);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x398a56=a34_0x2c37ab;return _0x398a56(0xf9)+getTopLevelConfigKeySummary()+')';}function a34_0x2e11(_0x2f5068,_0x292177){_0x2f5068=_0x2f5068-0xf4;const _0x68e465=a34_0x68e4();let _0x2e1109=_0x68e465[_0x2f5068];return _0x2e1109;}export const APP_PROFILE_FLAG_KEY_MAP={'env':a34_0x2c37ab(0x111),'apiDir':a34_0x2c37ab(0x11a),'cookie':a34_0x2c37ab(0x11b),'accessKey':'accessKey','defaultFormat':'format','pageSize':a34_0x2c37ab(0xf5),'riskLevel':'riskLevel','locale':a34_0x2c37ab(0x114)};export function getAppProfileFlagDefs(){const _0x2fb58b=a34_0x2c37ab;return[{'name':_0x2fb58b(0x111),'type':'string','description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0x2fb58b(0x11a),'type':'string','description':_0x2fb58b(0xf6)},{'name':_0x2fb58b(0x11b),'type':_0x2fb58b(0x113),'description':_0x2fb58b(0x117),'hidden':!![]},{'name':_0x2fb58b(0x102),'type':_0x2fb58b(0x113),'description':'Access\x20key','hidden':!![]},{'name':_0x2fb58b(0x110),'type':'string','description':_0x2fb58b(0x106),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x2fb58b(0x116),'description':_0x2fb58b(0x112)},{'name':_0x2fb58b(0x105),'type':_0x2fb58b(0x113),'description':_0x2fb58b(0x10a),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x2fb58b(0x114),'type':'string','description':_0x2fb58b(0x10c)}];}export function collectAppProfileOverrides(_0x21214e){const _0x3ee753=a34_0x2c37ab,_0x5d988b={};for(const [_0x2d9b1a,_0x3bdbe8]of Object['entries'](APP_PROFILE_FLAG_KEY_MAP)){const _0x410012=_0x21214e(_0x2d9b1a);if(!_0x410012)continue;_0x5d988b[_0x3bdbe8]=_0x3bdbe8===_0x3ee753(0xf5)?Number(_0x410012):_0x410012;}return _0x5d988b;}export function buildAppProfileListFields(_0x1eb13c){const _0x5da990=a34_0x2c37ab;return{'env':_0x1eb13c[_0x5da990(0x111)]??null,'apiDir':_0x1eb13c['apiDir']??null,'hasCookie':!!_0x1eb13c[_0x5da990(0x11b)],'hasAccessKey':!!_0x1eb13c[_0x5da990(0x102)],'format':_0x1eb13c[_0x5da990(0xfe)]??null,'pageSize':_0x1eb13c[_0x5da990(0xf5)]??null,'riskLevel':_0x1eb13c['riskLevel']??null,'locale':_0x1eb13c[_0x5da990(0x114)]??null};}export function buildAppDoctorFields(_0x4fb030,_0x4cdf38){const _0x567a09=a34_0x2c37ab;return{'env':{'value':_0x4fb030['env']||_0x4cdf38['env'],'source':_0x4fb030['env']?'app':_0x567a09(0xfd)},'apiDir':{'value':_0x4fb030[_0x567a09(0x11a)]||_0x4cdf38[_0x567a09(0x11a)],'source':_0x4fb030[_0x567a09(0x11a)]?'app':_0x567a09(0xfd)},'cookie':{'value':_0x4fb030['cookie']||_0x4cdf38[_0x567a09(0x11b)],'source':_0x4fb030['cookie']?_0x567a09(0x103):_0x567a09(0xfd)},'accessKey':{'value':_0x4fb030['accessKey']||_0x4cdf38['accessKey'],'source':_0x4fb030['accessKey']?'app':_0x567a09(0xfd)}};}export function buildCanonicalAppConfig(_0x1f74cc,_0x29d613){const _0x114645=a34_0x2c37ab,_0x3274f2=_0x1f74cc[_0x114645(0x118)](_0x46d64a=>String(_0x46d64a||'')[_0x114645(0xf8)]())[_0x114645(0x10d)](Boolean);if(_0x3274f2[_0x114645(0xfb)]===0x0)return{};const _0x4021fe={};for(const _0x3fe6f7 of _0x3274f2){_0x4021fe[_0x3fe6f7]=_0x29d613?{'appcode':_0x3fe6f7,'env':_0x29d613}:{'appcode':_0x3fe6f7};}return{'apps':_0x4021fe,'defaultApp':_0x3274f2[0x0]};}function a34_0x68e4(){const _0x38a007=['trim','Config\x20key\x20(','en-US','length','12371611ilkUau','inherit','format','4570974DLizds','join','8332rgOVFu','accessKey','app','has','riskLevel','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','keys','defaultApp','45210584nEONLQ','Risk\x20level','zh-CN','Locale','filter','apps','2880506QIiIdk','defaultFormat','env','Default\x20page\x20size','string','locale','1478408kKpbkR','number','Auth\x20cookie','map','appcode','apiDir','cookie','7704010JZbyMS','pageSize','API\x20directory\x20path','930OFpupa'];a34_0x68e4=function(){return _0x38a007;};return a34_0x68e4();}export function buildCanonicalProjectConfig(_0x42feeb,_0x4a9c56){const _0x1a74f0=a34_0x2c37ab,{appCodes:appCodes=[],env:_0x3be6b5,metadata:_0x55bf27}=_0x4a9c56,_0x26f876={..._0x42feeb,..._0x55bf27||{}};delete _0x26f876[_0x1a74f0(0x119)],delete _0x26f876['app'];if(_0x3be6b5)_0x26f876['env']=_0x3be6b5;else!_0x26f876[_0x1a74f0(0x111)]&&(_0x26f876['env']=DEFAULT_CONFIG_VALUES[_0x1a74f0(0x111)]);const _0x3bd986=buildCanonicalAppConfig(appCodes,_0x26f876[_0x1a74f0(0x111)]);return Object[_0x1a74f0(0x107)](_0x3bd986)[_0x1a74f0(0xfb)]>0x0&&(_0x26f876[_0x1a74f0(0x10e)]=_0x3bd986[_0x1a74f0(0x10e)],_0x26f876[_0x1a74f0(0x108)]=_0x3bd986['defaultApp']),_0x26f876;}const LOCALE_MAP={'zh':a34_0x2c37ab(0x10b),'zh-cn':a34_0x2c37ab(0x10b),'zh_cn':a34_0x2c37ab(0x10b),'en':a34_0x2c37ab(0xfa),'en-us':a34_0x2c37ab(0xfa),'en_us':a34_0x2c37ab(0xfa)};export function normalizeLocale(_0x86620){if(!_0x86620)return null;return LOCALE_MAP[_0x86620['toLowerCase']()]??null;}
1
+ const a115_0x230d46=a115_0x290c;(function(_0x4faf33,_0x194846){const _0x21a62d=a115_0x290c,_0x583a5b=_0x4faf33();while(!![]){try{const _0x11209e=parseInt(_0x21a62d(0x8f))/0x1+parseInt(_0x21a62d(0x8b))/0x2*(-parseInt(_0x21a62d(0x79))/0x3)+parseInt(_0x21a62d(0x8c))/0x4*(parseInt(_0x21a62d(0x7d))/0x5)+parseInt(_0x21a62d(0x7c))/0x6+-parseInt(_0x21a62d(0x94))/0x7*(parseInt(_0x21a62d(0x8d))/0x8)+-parseInt(_0x21a62d(0x93))/0x9+parseInt(_0x21a62d(0x7e))/0xa*(parseInt(_0x21a62d(0x89))/0xb);if(_0x11209e===_0x194846)break;else _0x583a5b['push'](_0x583a5b['shift']());}catch(_0xc5797f){_0x583a5b['push'](_0x583a5b['shift']());}}}(a115_0x5380,0xc5746));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a115_0x230d46(0x97),'accessKey',a115_0x230d46(0x92),a115_0x230d46(0x75),a115_0x230d46(0x7b)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a115_0x230d46(0x8a),a115_0x230d46(0x98),a115_0x230d46(0x92),'format',a115_0x230d46(0x97),'accessKey','apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x53439a){const _0x2e575c=a115_0x230d46;return[..._0x53439a][_0x2e575c(0x77)](',\x20');}function a115_0x5380(){const _0x448fd4=['format','Risk\x20level','join','inherit','1313820YKSdQF','zh-CN','riskLevel','4636620XRoCsh','741485oZGnIS','5990zpcrtG','Default\x20page\x20size','app','defaultFormat','string','entries','length','apiDir','defaultApp','Target\x20environment','keys','40799tWHlng','appcode','6LXHTKA','4JcJXku','643456IbbSTi','map','570146BECMFw','API\x20directory\x20path','en-US','locale','9969462UbTCeI','42TWxCBa','toLowerCase','apps','cookie','env','pageSize','trim','accessKey','Auth\x20cookie'];a115_0x5380=function(){return _0x448fd4;};return a115_0x5380();}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x397793){return TOP_LEVEL_CONFIG_KEYS['has'](_0x397793);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}function a115_0x290c(_0x50862e,_0x265cfa){_0x50862e=_0x50862e-0x74;const _0x53803b=a115_0x5380();let _0x290cd4=_0x53803b[_0x50862e];return _0x290cd4;}export const APP_PROFILE_FLAG_KEY_MAP={'env':a115_0x230d46(0x98),'apiDir':a115_0x230d46(0x85),'cookie':a115_0x230d46(0x97),'accessKey':a115_0x230d46(0x9b),'defaultFormat':a115_0x230d46(0x75),'pageSize':'pageSize','riskLevel':a115_0x230d46(0x7b),'locale':a115_0x230d46(0x92)};export function getAppProfileFlagDefs(){const _0x3c2a3e=a115_0x230d46;return[{'name':_0x3c2a3e(0x98),'type':_0x3c2a3e(0x82),'description':_0x3c2a3e(0x87),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x3c2a3e(0x85),'type':_0x3c2a3e(0x82),'description':_0x3c2a3e(0x90)},{'name':_0x3c2a3e(0x97),'type':_0x3c2a3e(0x82),'description':_0x3c2a3e(0x74),'hidden':!![]},{'name':_0x3c2a3e(0x9b),'type':_0x3c2a3e(0x82),'description':'Access\x20key','hidden':!![]},{'name':_0x3c2a3e(0x81),'type':_0x3c2a3e(0x82),'description':'Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x3c2a3e(0x99),'type':'number','description':_0x3c2a3e(0x7f)},{'name':_0x3c2a3e(0x7b),'type':_0x3c2a3e(0x82),'description':_0x3c2a3e(0x76),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x3c2a3e(0x92),'type':_0x3c2a3e(0x82),'description':'Locale'}];}export function collectAppProfileOverrides(_0x30f206){const _0x22dde4=a115_0x230d46,_0x13083b={};for(const [_0x286a6c,_0x3d5716]of Object[_0x22dde4(0x83)](APP_PROFILE_FLAG_KEY_MAP)){const _0xa448b=_0x30f206(_0x286a6c);if(!_0xa448b)continue;_0x13083b[_0x3d5716]=_0x3d5716==='pageSize'?Number(_0xa448b):_0xa448b;}return _0x13083b;}export function buildAppProfileListFields(_0x4aa14a){const _0xa78148=a115_0x230d46;return{'env':_0x4aa14a[_0xa78148(0x98)]??null,'apiDir':_0x4aa14a[_0xa78148(0x85)]??null,'hasCookie':!!_0x4aa14a[_0xa78148(0x97)],'hasAccessKey':!!_0x4aa14a[_0xa78148(0x9b)],'format':_0x4aa14a['format']??null,'pageSize':_0x4aa14a[_0xa78148(0x99)]??null,'riskLevel':_0x4aa14a[_0xa78148(0x7b)]??null,'locale':_0x4aa14a[_0xa78148(0x92)]??null};}export function buildAppDoctorFields(_0x2bd01c,_0x293b1b){const _0x2076f9=a115_0x230d46;return{'env':{'value':_0x2bd01c[_0x2076f9(0x98)]||_0x293b1b['env'],'source':_0x2bd01c[_0x2076f9(0x98)]?_0x2076f9(0x80):'inherit'},'apiDir':{'value':_0x2bd01c[_0x2076f9(0x85)]||_0x293b1b[_0x2076f9(0x85)],'source':_0x2bd01c[_0x2076f9(0x85)]?'app':_0x2076f9(0x78)},'cookie':{'value':_0x2bd01c[_0x2076f9(0x97)]||_0x293b1b[_0x2076f9(0x97)],'source':_0x2bd01c[_0x2076f9(0x97)]?_0x2076f9(0x80):_0x2076f9(0x78)},'accessKey':{'value':_0x2bd01c[_0x2076f9(0x9b)]||_0x293b1b[_0x2076f9(0x9b)],'source':_0x2bd01c[_0x2076f9(0x9b)]?_0x2076f9(0x80):_0x2076f9(0x78)}};}export function buildCanonicalAppConfig(_0x3588ad,_0x64f6c6){const _0x43cbf3=a115_0x230d46,_0x1feae6=_0x3588ad[_0x43cbf3(0x8e)](_0x3b18db=>String(_0x3b18db||'')[_0x43cbf3(0x9a)]())['filter'](Boolean);if(_0x1feae6[_0x43cbf3(0x84)]===0x0)return{};const _0x2fbedc={};for(const _0x2f59bd of _0x1feae6){_0x2fbedc[_0x2f59bd]=_0x64f6c6?{'appcode':_0x2f59bd,'env':_0x64f6c6}:{'appcode':_0x2f59bd};}return{'apps':_0x2fbedc,'defaultApp':_0x1feae6[0x0]};}export function buildCanonicalProjectConfig(_0x227e42,_0x1fb6f3){const _0x17c285=a115_0x230d46,{appCodes:appCodes=[],env:_0x4360c7,metadata:_0x369371}=_0x1fb6f3,_0x1727e8={..._0x227e42,..._0x369371||{}};delete _0x1727e8[_0x17c285(0x8a)],delete _0x1727e8[_0x17c285(0x80)];if(_0x4360c7)_0x1727e8[_0x17c285(0x98)]=_0x4360c7;else!_0x1727e8['env']&&(_0x1727e8[_0x17c285(0x98)]=DEFAULT_CONFIG_VALUES[_0x17c285(0x98)]);const _0x251ab5=buildCanonicalAppConfig(appCodes,_0x1727e8[_0x17c285(0x98)]);return Object[_0x17c285(0x88)](_0x251ab5)[_0x17c285(0x84)]>0x0&&(_0x1727e8[_0x17c285(0x96)]=_0x251ab5['apps'],_0x1727e8[_0x17c285(0x86)]=_0x251ab5['defaultApp']),_0x1727e8;}const LOCALE_MAP={'zh':a115_0x230d46(0x7a),'zh-cn':a115_0x230d46(0x7a),'zh_cn':a115_0x230d46(0x7a),'en':a115_0x230d46(0x91),'en-us':a115_0x230d46(0x91),'en_us':a115_0x230d46(0x91)};export function normalizeLocale(_0x1726cb){const _0x325f33=a115_0x230d46;if(!_0x1726cb)return null;return LOCALE_MAP[_0x1726cb[_0x325f33(0x95)]()]??null;}
@@ -0,0 +1 @@
1
+ function a116_0x28ee(_0xce2cdf,_0x3b1d46){_0xce2cdf=_0xce2cdf-0x1d8;const _0x4e3548=a116_0x4e35();let _0x28ee78=_0x4e3548[_0xce2cdf];return _0x28ee78;}const a116_0x4c55e0=a116_0x28ee;(function(_0xe6eb80,_0x397b01){const _0x1776ea=a116_0x28ee,_0x41bb4d=_0xe6eb80();while(!![]){try{const _0x19b2d4=parseInt(_0x1776ea(0x1de))/0x1*(parseInt(_0x1776ea(0x1db))/0x2)+-parseInt(_0x1776ea(0x1d9))/0x3+parseInt(_0x1776ea(0x1df))/0x4*(parseInt(_0x1776ea(0x1d8))/0x5)+-parseInt(_0x1776ea(0x1da))/0x6+parseInt(_0x1776ea(0x1e2))/0x7+parseInt(_0x1776ea(0x1dc))/0x8*(parseInt(_0x1776ea(0x1e1))/0x9)+parseInt(_0x1776ea(0x1dd))/0xa;if(_0x19b2d4===_0x397b01)break;else _0x41bb4d['push'](_0x41bb4d['shift']());}catch(_0x3b749a){_0x41bb4d['push'](_0x41bb4d['shift']());}}}(a116_0x4e35,0xdbacb));function a116_0x4e35(){const _0x5c6a4b=['1FAghCx','4wrMmwE','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','2133rPThcv','855764eWNenB','708095HgqNgr','4061637OsfeHw','5167824harKKG','2419534qbBNaa','25168lYWwFw','8957300DokVdb'];a116_0x4e35=function(){return _0x5c6a4b;};return a116_0x4e35();}export const CLI_VERSION_POLICY_URL=a116_0x4c55e0(0x1e0);
@@ -1 +1 @@
1
- const a56_0x50508a=a56_0x36fc;function a56_0xa18f(){const _0xd3963a=['schemas','Code\x20filter','code','appcode','all','Clear','62736wVRpSv','value','Schemas','Verbose\x20output','DB\x20ID','env','functionNode','4083MQQgld','Override\x20appcode','operation','Alias\x20for\x20--non-interactive','dbid','key','3300gPoiIm','production\x20|\x20daily','Use\x20project\x20config\x20scope','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','target','function-node','description','Enable\x20BFF\x20save','keyword','Output\x20format','verbose','project','@lovrabet/rabetbase-cli','Operation\x20type','Record\x20ID','Show\x20help','Page\x20size','clear','meowKey','Apply\x20to\x20all','Description','40wmXcTs','Page\x20number','22391310XOhHkt','File\x20path','JSON\x20params','force','655173vlDnkE','Config\x20key','Select\x20app\x20profile\x20by\x20name','format','dryRun','yes','page','type','734peAYSu','json\x20|\x20pretty\x20|\x20compress','5575cRYPfV','string','global','datasetcode','output','nonInteractive','6587420XLAUmt','Dataset\x20code','remote','params','4547574ZGphWX','pagesize','rabetbase','Target\x20path','SQL\x20name','<expr>','sql','file','app','non-interactive','name','Config\x20value','Skip\x20confirmation\x20for\x20high-risk\x20writes','SQL\x20code','Use\x20remote','Type\x20filter','Keyword\x20filter','watch','dry-run','Force\x20overwrite','sqlcode','skipImports','help','operation-type','boolean','operationType','Output\x20path'];a56_0xa18f=function(){return _0xd3963a;};return a56_0xa18f();}(function(_0x48b6cc,_0x333e18){const _0x61a610=a56_0x36fc,_0x3ee171=_0x48b6cc();while(!![]){try{const _0x3bd90d=parseInt(_0x61a610(0x248))/0x1+parseInt(_0x61a610(0x21b))/0x2*(parseInt(_0x61a610(0x24f))/0x3)+-parseInt(_0x61a610(0x1f8))/0x4*(parseInt(_0x61a610(0x21d))/0x5)+-parseInt(_0x61a610(0x227))/0x6+-parseInt(_0x61a610(0x223))/0x7+-parseInt(_0x61a610(0x20d))/0x8*(-parseInt(_0x61a610(0x213))/0x9)+parseInt(_0x61a610(0x20f))/0xa;if(_0x3bd90d===_0x333e18)break;else _0x3ee171['push'](_0x3ee171['shift']());}catch(_0x51f2b8){_0x3ee171['push'](_0x3ee171['shift']());}}}(a56_0xa18f,0x856ab));export const CLI_BIN_NAME=a56_0x50508a(0x229);function a56_0x36fc(_0x28fcf6,_0x3800b2){_0x28fcf6=_0x28fcf6-0x1f3;const _0xa18f27=a56_0xa18f();let _0x36fc1c=_0xa18f27[_0x28fcf6];return _0x36fc1c;}export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';export const NPM_PACKAGE_NAME=a56_0x50508a(0x204);export const GLOBAL_FLAGS=[{'name':a56_0x50508a(0x245),'meowKey':a56_0x50508a(0x245),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x1f3),'hint':'<code>'},{'name':a56_0x50508a(0x22f),'meowKey':a56_0x50508a(0x22f),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x215),'hint':'<name>'},{'name':'env','meowKey':a56_0x50508a(0x24d),'type':a56_0x50508a(0x21e),'description':'Environment','hint':a56_0x50508a(0x1f9)},{'name':a56_0x50508a(0x216),'meowKey':a56_0x50508a(0x216),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x201),'hint':a56_0x50508a(0x21c)},{'name':'jq','meowKey':'jq','type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x1fb),'hint':a56_0x50508a(0x22c)},{'name':a56_0x50508a(0x239),'meowKey':a56_0x50508a(0x217),'type':a56_0x50508a(0x23f),'description':'Preview\x20operation\x20without\x20executing'},{'name':a56_0x50508a(0x218),'meowKey':a56_0x50508a(0x218),'type':'boolean','description':a56_0x50508a(0x233)},{'name':a56_0x50508a(0x230),'meowKey':a56_0x50508a(0x222),'type':a56_0x50508a(0x23f),'description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':a56_0x50508a(0x21f),'meowKey':a56_0x50508a(0x21f),'type':'boolean','description':'Use\x20global\x20config\x20scope'},{'name':'project','meowKey':a56_0x50508a(0x203),'type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x1fa)},{'name':'ci','meowKey':'ci','type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x1f5),'hidden':!![]},{'name':a56_0x50508a(0x23d),'meowKey':a56_0x50508a(0x23d),'type':'boolean','description':a56_0x50508a(0x207)},{'name':'name','meowKey':a56_0x50508a(0x231),'type':a56_0x50508a(0x21e),'description':'Name','hidden':!![]},{'name':a56_0x50508a(0x209),'meowKey':a56_0x50508a(0x209),'type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x247),'hidden':!![]},{'name':a56_0x50508a(0x238),'meowKey':'watch','type':a56_0x50508a(0x23f),'description':'Watch\x20mode','hidden':!![]},{'name':a56_0x50508a(0x221),'meowKey':a56_0x50508a(0x221),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x241),'hidden':!![]},{'name':a56_0x50508a(0x226),'meowKey':a56_0x50508a(0x226),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x211),'hidden':!![]},{'name':a56_0x50508a(0x220),'meowKey':a56_0x50508a(0x220),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x224),'hidden':!![]},{'name':a56_0x50508a(0x246),'meowKey':a56_0x50508a(0x246),'type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x20b),'hidden':!![]},{'name':'enable-bff-save','meowKey':'enableBffSave','type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x1ff),'hidden':!![]},{'name':'id','meowKey':'id','type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x206),'hidden':!![]},{'name':'type','meowKey':a56_0x50508a(0x21a),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x236),'hidden':!![]},{'name':a56_0x50508a(0x22e),'meowKey':a56_0x50508a(0x22e),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x210),'hidden':!![]},{'name':a56_0x50508a(0x23b),'meowKey':a56_0x50508a(0x23b),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x234),'hidden':!![]},{'name':'sqlname','meowKey':'sqlname','type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x22b),'hidden':!![]},{'name':a56_0x50508a(0x1f6),'meowKey':'dbid','type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x24c),'hidden':!![]},{'name':'description','meowKey':a56_0x50508a(0x1fe),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x20c),'hidden':!![]},{'name':a56_0x50508a(0x219),'meowKey':a56_0x50508a(0x219),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x20e),'hidden':!![]},{'name':a56_0x50508a(0x228),'meowKey':a56_0x50508a(0x228),'type':'string','description':a56_0x50508a(0x208),'hidden':!![]},{'name':a56_0x50508a(0x200),'meowKey':'keyword','type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x237),'hidden':!![]},{'name':a56_0x50508a(0x244),'meowKey':'code','type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x243),'hidden':!![]},{'name':a56_0x50508a(0x22d),'meowKey':'sql','type':a56_0x50508a(0x21e),'description':'SQL\x20string','hidden':!![]},{'name':a56_0x50508a(0x242),'meowKey':a56_0x50508a(0x242),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x24a),'hidden':!![]},{'name':a56_0x50508a(0x1f4),'meowKey':a56_0x50508a(0x1f4),'type':'string','description':a56_0x50508a(0x205),'hidden':!![]},{'name':a56_0x50508a(0x1fc),'meowKey':a56_0x50508a(0x1fc),'type':'string','description':a56_0x50508a(0x22a),'hidden':!![]},{'name':'skip-imports','meowKey':a56_0x50508a(0x23c),'type':a56_0x50508a(0x23f),'description':'Skip\x20import\x20generation','hidden':!![]},{'name':a56_0x50508a(0x1f7),'meowKey':a56_0x50508a(0x1f7),'type':'string','description':a56_0x50508a(0x214),'hidden':!![]},{'name':a56_0x50508a(0x249),'meowKey':a56_0x50508a(0x249),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x232),'hidden':!![]},{'name':a56_0x50508a(0x212),'meowKey':a56_0x50508a(0x212),'type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x23a),'hidden':!![]},{'name':a56_0x50508a(0x225),'meowKey':'remote','type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x235),'hidden':!![]},{'name':a56_0x50508a(0x202),'meowKey':'verbose','type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x24b),'hidden':!![]},{'name':a56_0x50508a(0x23e),'meowKey':a56_0x50508a(0x240),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x205),'hidden':!![]},{'name':a56_0x50508a(0x1fd),'meowKey':a56_0x50508a(0x24e),'type':a56_0x50508a(0x21e),'description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a56_0x50508a(0x245),'app','env',a56_0x50508a(0x216),'jq',a56_0x50508a(0x239),a56_0x50508a(0x218),a56_0x50508a(0x230),'ci']);export function buildMeowFlags(){const _0x350186=a56_0x50508a;return Object['fromEntries'](GLOBAL_FLAGS['map'](_0x3e1bc3=>[_0x3e1bc3[_0x350186(0x20a)],{'type':_0x3e1bc3[_0x350186(0x21a)]}]));}
1
+ function a117_0xfad4(){const _0x1e3002=['JSON\x20params','7914ZBHTYA','force','string','Environment','6847137vvHOoT','SQL\x20string','10601510iaGkCz','key','sql','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','schemas','global','Clear','Use\x20global\x20config\x20scope','datasetcode','Function\x20node','json\x20|\x20pretty\x20|\x20compress','name','Watch\x20mode','help','dbid','559068dfodql','all','clear','Keyword\x20filter','653xIqtGw','nonInteractive','Rabetbase\x20CLI','project','Type\x20filter','Preview\x20operation\x20without\x20executing','Name','production\x20|\x20daily','functionNode','Dataset\x20code','meowKey','Force\x20overwrite','Config\x20value','<code>','value','SQL\x20name','dry-run','remote','3182088LKflzQ','target','appcode','Override\x20appcode','Code\x20filter','format','code','Schemas','229901xibnPT','type','map','pagesize','2282oKOcou','operation','boolean','watch','Use\x20remote','enableBffSave','skipImports','page','sqlname','db-id','function-node','description','Show\x20help','DB\x20ID','Output\x20path','Use\x20project\x20config\x20scope','app','sqlName','rabetbase','Enable\x20BFF\x20save','keyword','Config\x20key','112TRxgqR','verbose','non-interactive','fromEntries','Page\x20size','Operation\x20type','yes','env','skip-imports','output','100QdHhxA','sqlcode','file','File\x20path','params','Page\x20number'];a117_0xfad4=function(){return _0x1e3002;};return a117_0xfad4();}const a117_0x5592f1=a117_0x715c;(function(_0x27fd3e,_0x2fdd49){const _0x48e1ce=a117_0x715c,_0x51d03d=_0x27fd3e();while(!![]){try{const _0x5b50cf=-parseInt(_0x48e1ce(0x13d))/0x1*(parseInt(_0x48e1ce(0xfd))/0x2)+-parseInt(_0x48e1ce(0x139))/0x3+parseInt(_0x48e1ce(0xf1))/0x4+-parseInt(_0x48e1ce(0x11d))/0x5*(parseInt(_0x48e1ce(0x124))/0x6)+parseInt(_0x48e1ce(0xf9))/0x7*(parseInt(_0x48e1ce(0x113))/0x8)+-parseInt(_0x48e1ce(0x128))/0x9+parseInt(_0x48e1ce(0x12a))/0xa;if(_0x5b50cf===_0x2fdd49)break;else _0x51d03d['push'](_0x51d03d['shift']());}catch(_0x2fd69b){_0x51d03d['push'](_0x51d03d['shift']());}}}(a117_0xfad4,0x91b89));export const CLI_BIN_NAME=a117_0x5592f1(0x10f);export const CLI_DISPLAY_NAME=a117_0x5592f1(0x13f);export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';export const GLOBAL_FLAGS=[{'name':a117_0x5592f1(0xf3),'meowKey':'appcode','type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0xf4),'hint':a117_0x5592f1(0x14a)},{'name':a117_0x5592f1(0x10d),'meowKey':a117_0x5592f1(0x10d),'type':a117_0x5592f1(0x126),'description':'Select\x20app\x20profile\x20by\x20name','hint':'<name>'},{'name':'env','meowKey':a117_0x5592f1(0x11a),'type':'string','description':a117_0x5592f1(0x127),'hint':a117_0x5592f1(0x144)},{'name':'format','meowKey':a117_0x5592f1(0xf6),'type':a117_0x5592f1(0x126),'description':'Output\x20format','hint':a117_0x5592f1(0x134)},{'name':'jq','meowKey':'jq','type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x12d),'hint':'<expr>'},{'name':a117_0x5592f1(0x14d),'meowKey':'dryRun','type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x142)},{'name':a117_0x5592f1(0x119),'meowKey':a117_0x5592f1(0x119),'type':a117_0x5592f1(0xff),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a117_0x5592f1(0x115),'meowKey':a117_0x5592f1(0x13e),'type':'boolean','description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':'global','meowKey':a117_0x5592f1(0x12f),'type':'boolean','description':a117_0x5592f1(0x131)},{'name':a117_0x5592f1(0x140),'meowKey':a117_0x5592f1(0x140),'type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x10c)},{'name':'ci','meowKey':'ci','type':a117_0x5592f1(0xff),'description':'Alias\x20for\x20--non-interactive','hidden':!![]},{'name':a117_0x5592f1(0x137),'meowKey':'help','type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x109)},{'name':a117_0x5592f1(0x135),'meowKey':a117_0x5592f1(0x135),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x143),'hidden':!![]},{'name':a117_0x5592f1(0x13b),'meowKey':a117_0x5592f1(0x13b),'type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x130),'hidden':!![]},{'name':a117_0x5592f1(0x100),'meowKey':a117_0x5592f1(0x100),'type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x136),'hidden':!![]},{'name':a117_0x5592f1(0x11c),'meowKey':a117_0x5592f1(0x11c),'type':'string','description':a117_0x5592f1(0x10b),'hidden':!![]},{'name':a117_0x5592f1(0x121),'meowKey':a117_0x5592f1(0x121),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x123),'hidden':!![]},{'name':a117_0x5592f1(0x132),'meowKey':a117_0x5592f1(0x132),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x146),'hidden':!![]},{'name':'all','meowKey':a117_0x5592f1(0x13a),'type':a117_0x5592f1(0xff),'description':'Apply\x20to\x20all','hidden':!![]},{'name':'enable-bff-save','meowKey':a117_0x5592f1(0x102),'type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x110),'hidden':!![]},{'name':'id','meowKey':'id','type':a117_0x5592f1(0x126),'description':'Record\x20ID','hidden':!![]},{'name':a117_0x5592f1(0xfa),'meowKey':'type','type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x141),'hidden':!![]},{'name':'file','meowKey':a117_0x5592f1(0x11f),'type':'string','description':a117_0x5592f1(0x120),'hidden':!![]},{'name':a117_0x5592f1(0x11e),'meowKey':a117_0x5592f1(0x11e),'type':a117_0x5592f1(0x126),'description':'SQL\x20code','hidden':!![]},{'name':'sql-name','meowKey':a117_0x5592f1(0x10e),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x14c),'hidden':!![]},{'name':a117_0x5592f1(0x105),'meowKey':'sqlname','type':'string','description':a117_0x5592f1(0x14c),'hidden':!![]},{'name':a117_0x5592f1(0x106),'meowKey':'dbId','type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x10a),'hidden':!![]},{'name':'dbid','meowKey':a117_0x5592f1(0x138),'type':'string','description':a117_0x5592f1(0x10a),'hidden':!![]},{'name':a117_0x5592f1(0x108),'meowKey':a117_0x5592f1(0x108),'type':a117_0x5592f1(0x126),'description':'Description','hidden':!![]},{'name':a117_0x5592f1(0x104),'meowKey':a117_0x5592f1(0x104),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x122),'hidden':!![]},{'name':a117_0x5592f1(0xfc),'meowKey':a117_0x5592f1(0xfc),'type':'string','description':a117_0x5592f1(0x117),'hidden':!![]},{'name':'keyword','meowKey':a117_0x5592f1(0x111),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x13c),'hidden':!![]},{'name':a117_0x5592f1(0xf7),'meowKey':a117_0x5592f1(0xf7),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0xf5),'hidden':!![]},{'name':'sql','meowKey':a117_0x5592f1(0x12c),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x129),'hidden':!![]},{'name':a117_0x5592f1(0x12e),'meowKey':'schemas','type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0xf8),'hidden':!![]},{'name':a117_0x5592f1(0xfe),'meowKey':a117_0x5592f1(0xfe),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x118),'hidden':!![]},{'name':a117_0x5592f1(0xf2),'meowKey':a117_0x5592f1(0xf2),'type':a117_0x5592f1(0x126),'description':'Target\x20path','hidden':!![]},{'name':a117_0x5592f1(0x11b),'meowKey':a117_0x5592f1(0x103),'type':a117_0x5592f1(0xff),'description':'Skip\x20import\x20generation','hidden':!![]},{'name':a117_0x5592f1(0x12b),'meowKey':'key','type':'string','description':a117_0x5592f1(0x112),'hidden':!![]},{'name':a117_0x5592f1(0x14b),'meowKey':a117_0x5592f1(0x14b),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x149),'hidden':!![]},{'name':a117_0x5592f1(0x125),'meowKey':a117_0x5592f1(0x125),'type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x148),'hidden':!![]},{'name':a117_0x5592f1(0x14e),'meowKey':a117_0x5592f1(0x14e),'type':a117_0x5592f1(0xff),'description':a117_0x5592f1(0x101),'hidden':!![]},{'name':a117_0x5592f1(0x114),'meowKey':a117_0x5592f1(0x114),'type':a117_0x5592f1(0xff),'description':'Verbose\x20output','hidden':!![]},{'name':'operation-type','meowKey':'operationType','type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x118),'hidden':!![]},{'name':a117_0x5592f1(0x107),'meowKey':a117_0x5592f1(0x145),'type':a117_0x5592f1(0x126),'description':a117_0x5592f1(0x133),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set(['appcode','app',a117_0x5592f1(0x11a),a117_0x5592f1(0xf6),'jq',a117_0x5592f1(0x14d),a117_0x5592f1(0x119),a117_0x5592f1(0x115),'ci']);function a117_0x715c(_0x45db22,_0x5527ff){_0x45db22=_0x45db22-0xf1;const _0xfad401=a117_0xfad4();let _0x715c7d=_0xfad401[_0x45db22];return _0x715c7d;}export function buildMeowFlags(){const _0x1b2cdf=a117_0x5592f1;return Object[_0x1b2cdf(0x116)](GLOBAL_FLAGS[_0x1b2cdf(0xfb)](_0x5b57c9=>[_0x5b57c9[_0x1b2cdf(0x147)],{'type':_0x5b57c9[_0x1b2cdf(0xfa)]}]));}
@@ -1 +1 @@
1
- const a51_0x3b5075=a51_0x1de9;(function(_0xb6d619,_0x3d5111){const _0xcc4804=a51_0x1de9,_0x3a3f58=_0xb6d619();while(!![]){try{const _0x5788cc=parseInt(_0xcc4804(0x125))/0x1+-parseInt(_0xcc4804(0x128))/0x2*(-parseInt(_0xcc4804(0x126))/0x3)+-parseInt(_0xcc4804(0x127))/0x4+parseInt(_0xcc4804(0x12c))/0x5*(-parseInt(_0xcc4804(0x12b))/0x6)+parseInt(_0xcc4804(0x124))/0x7+-parseInt(_0xcc4804(0x12e))/0x8*(parseInt(_0xcc4804(0x123))/0x9)+parseInt(_0xcc4804(0x122))/0xa;if(_0x5788cc===_0x3d5111)break;else _0x3a3f58['push'](_0x3a3f58['shift']());}catch(_0x536b28){_0x3a3f58['push'](_0x3a3f58['shift']());}}}(a51_0x37e1,0xe93b3));import{DEFAULT_API_DIR}from'../constant/paths.js';function a51_0x1de9(_0x408527,_0x3cce35){_0x408527=_0x408527-0x122;const _0x37e16b=a51_0x37e1();let _0x1de993=_0x37e16b[_0x408527];return _0x1de993;}export const DEFAULT_CONFIG_VALUES={'env':'production','format':a51_0x3b5075(0x129),'locale':a51_0x3b5075(0x12d),'riskLevel':a51_0x3b5075(0x12a),'apiDir':DEFAULT_API_DIR};function a51_0x37e1(){const _0x16c136=['en-US','34248VcvXcN','9727540VRrWvQ','2169kuAAsO','6793192xbLuup','1369504qWfypT','2292QzThkW','4815348lprAAw','4486KClOgL','compress','high-risk-write','11012958TmSQCp','5VnpIiL'];a51_0x37e1=function(){return _0x16c136;};return a51_0x37e1();}export const DEFAULT_COMMAND_OUTPUT_FORMAT=a51_0x3b5075(0x129);
1
+ function a118_0x4134(){const _0x544855=['compress','872886dGjiVU','9751IChSot','en-US','371264KIQwnT','970352FDmTfD','956590bXetFW','11033892uxkcxY','2PXUqaQ','537930CJItUY','3272FSexlU','production','high-risk-write'];a118_0x4134=function(){return _0x544855;};return a118_0x4134();}function a118_0x38cc(_0x343671,_0x10cadb){_0x343671=_0x343671-0x10c;const _0x4134b2=a118_0x4134();let _0x38cc19=_0x4134b2[_0x343671];return _0x38cc19;}const a118_0xdb38ea=a118_0x38cc;(function(_0x2d7ef2,_0x158b91){const _0x39fd6d=a118_0x38cc,_0xd9e9b5=_0x2d7ef2();while(!![]){try{const _0x464231=parseInt(_0x39fd6d(0x10f))/0x1*(parseInt(_0x39fd6d(0x113))/0x2)+parseInt(_0x39fd6d(0x10c))/0x3+parseInt(_0x39fd6d(0x110))/0x4+parseInt(_0x39fd6d(0x111))/0x5+-parseInt(_0x39fd6d(0x114))/0x6+-parseInt(_0x39fd6d(0x10d))/0x7*(-parseInt(_0x39fd6d(0x115))/0x8)+-parseInt(_0x39fd6d(0x112))/0x9;if(_0x464231===_0x158b91)break;else _0xd9e9b5['push'](_0xd9e9b5['shift']());}catch(_0x423b9f){_0xd9e9b5['push'](_0xd9e9b5['shift']());}}}(a118_0x4134,0x55812));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a118_0xdb38ea(0x116),'format':a118_0xdb38ea(0x118),'locale':a118_0xdb38ea(0x10e),'riskLevel':a118_0xdb38ea(0x117),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a118_0xdb38ea(0x118);
@@ -1 +1 @@
1
- const a50_0x8dd587=a50_0x1774;function a50_0x1774(_0x59005d,_0xe5482b){_0x59005d=_0x59005d-0xf4;const _0x1e5428=a50_0x1e54();let _0x177473=_0x1e5428[_0x59005d];return _0x177473;}(function(_0x48342f,_0x50c058){const _0x394235=a50_0x1774,_0x4935eb=_0x48342f();while(!![]){try{const _0x34d4b4=parseInt(_0x394235(0x102))/0x1*(parseInt(_0x394235(0xf7))/0x2)+parseInt(_0x394235(0xf9))/0x3+-parseInt(_0x394235(0xfb))/0x4*(-parseInt(_0x394235(0xfa))/0x5)+-parseInt(_0x394235(0xff))/0x6+parseInt(_0x394235(0xf4))/0x7+parseInt(_0x394235(0xfd))/0x8*(-parseInt(_0x394235(0x101))/0x9)+-parseInt(_0x394235(0x100))/0xa;if(_0x34d4b4===_0x50c058)break;else _0x4935eb['push'](_0x4935eb['shift']());}catch(_0x53c206){_0x4935eb['push'](_0x4935eb['shift']());}}}(a50_0x1e54,0xc20cc));function a50_0x1e54(){const _0x506f30=['12813840DnPMoc','50832NyhjPx','93063LWyfcR','1902075wQXpAe','https://user.lovrabet.com','https://api.lovrabet.com','16ZgZgfF','https://runtime.lovrabet.com','4386129xBUcDd','675625jpercQ','44oMPztq','https://daily-runtime.lovrabet.com','1256qBMzVM','https://user-daily.lovrabet.com','6010194IMEovy'];a50_0x1e54=function(){return _0x506f30;};return a50_0x1e54();}import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x2a2f79){customApiDomain=_0x2a2f79?.['apiDomain'],customUserDomain=_0x2a2f79?.['userDomain'],customRuntimeDomain=_0x2a2f79?.['runtimeDomain'];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a50_0x8dd587(0xf5):a50_0x8dd587(0xfe));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a50_0x8dd587(0xf6):'https://daily-api.lovrabet.com');export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a50_0x8dd587(0xf8):a50_0x8dd587(0xfc));
1
+ function a119_0x2f07(_0x498c01,_0xf7717c){_0x498c01=_0x498c01-0x166;const _0x2d5500=a119_0x2d55();let _0x2f0771=_0x2d5500[_0x498c01];return _0x2f0771;}const a119_0x31744e=a119_0x2f07;(function(_0x4f0b35,_0x2e487d){const _0x295ab6=a119_0x2f07,_0x4c47e6=_0x4f0b35();while(!![]){try{const _0x1e2c20=-parseInt(_0x295ab6(0x16a))/0x1*(parseInt(_0x295ab6(0x167))/0x2)+parseInt(_0x295ab6(0x16e))/0x3*(parseInt(_0x295ab6(0x171))/0x4)+parseInt(_0x295ab6(0x16c))/0x5*(parseInt(_0x295ab6(0x169))/0x6)+parseInt(_0x295ab6(0x166))/0x7+-parseInt(_0x295ab6(0x16f))/0x8+parseInt(_0x295ab6(0x16b))/0x9+parseInt(_0x295ab6(0x168))/0xa*(-parseInt(_0x295ab6(0x16d))/0xb);if(_0x1e2c20===_0x2e487d)break;else _0x4c47e6['push'](_0x4c47e6['shift']());}catch(_0x4f33dc){_0x4c47e6['push'](_0x4c47e6['shift']());}}}(a119_0x2d55,0x53fb9));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a119_0x2d55(){const _0xf411ae=['6055587gfRfHt','247780KJUYXc','1364xsXUVM','3zbSwlz','2396560XBMkXv','https://daily-api.lovrabet.com','2461996iDoWuH','https://daily-runtime.lovrabet.com','https://runtime.lovrabet.com','4036179vEyERO','100072TkNaLn','82280pYxUPK','12lDLuQb','6LbaNYA'];a119_0x2d55=function(){return _0xf411ae;};return a119_0x2d55();}export function initDomains(_0x240427){customApiDomain=_0x240427?.['apiDomain'],customUserDomain=_0x240427?.['userDomain'],customRuntimeDomain=_0x240427?.['runtimeDomain'];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':'https://user-daily.lovrabet.com');export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':a119_0x31744e(0x170));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a119_0x31744e(0x173):a119_0x31744e(0x172));