@lovrabet/rabetbase-cli 2.3.7-beta.1 → 2.3.7-beta.3

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 (243) 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/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.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-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -0
  79. package/lib/commands/db/analyze-batch-plan.js +1 -0
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.js +1 -1
  87. package/lib/commands/db/index.js +1 -1
  88. package/lib/commands/db/list.js +1 -1
  89. package/lib/commands/db/shared.js +1 -1
  90. package/lib/commands/db/tables.js +1 -1
  91. package/lib/commands/db/test.js +1 -1
  92. package/lib/commands/db/update.js +1 -1
  93. package/lib/commands/doctor.js +1 -1
  94. package/lib/commands/file/index.js +1 -1
  95. package/lib/commands/init/index.js +1 -1
  96. package/lib/commands/issue/index.js +1 -1
  97. package/lib/commands/issue/nudge.js +1 -1
  98. package/lib/commands/issue/report.js +1 -1
  99. package/lib/commands/issue/shared.js +1 -1
  100. package/lib/commands/logs/index.js +1 -1
  101. package/lib/commands/menu/index.js +1 -1
  102. package/lib/commands/menu/list.js +1 -1
  103. package/lib/commands/menu/shared/compare-table.js +1 -1
  104. package/lib/commands/menu/shared/index.js +1 -1
  105. package/lib/commands/menu/shared/inquirer.js +1 -1
  106. package/lib/commands/menu/shared/local-pages.js +1 -1
  107. package/lib/commands/menu/shared/logic.js +1 -1
  108. package/lib/commands/menu/shared/service.js +1 -1
  109. package/lib/commands/menu/shared/sync-core.js +1 -1
  110. package/lib/commands/menu/shared/update-core.js +1 -1
  111. package/lib/commands/menu/shared/valid-url.js +1 -1
  112. package/lib/commands/menu/sync.js +1 -1
  113. package/lib/commands/menu/update.js +1 -1
  114. package/lib/commands/page/generate-start.js +1 -1
  115. package/lib/commands/page/generate-status.js +1 -1
  116. package/lib/commands/page/index.js +1 -1
  117. package/lib/commands/page/pull.js +1 -1
  118. package/lib/commands/page/push.js +1 -1
  119. package/lib/commands/page/relation-audit.js +1 -1
  120. package/lib/commands/page/shared.js +1 -1
  121. package/lib/commands/page/standard-page-status.js +1 -1
  122. package/lib/commands/page/sync.js +1 -1
  123. package/lib/commands/permit/index.js +1 -1
  124. package/lib/commands/permit/page-get.js +1 -1
  125. package/lib/commands/permit/page-set.js +1 -1
  126. package/lib/commands/permit/role-apis-set.js +1 -1
  127. package/lib/commands/permit/role-menus-set.js +1 -1
  128. package/lib/commands/permit/role-menus.js +1 -1
  129. package/lib/commands/permit/shared.js +1 -1
  130. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  131. package/lib/commands/project/create/format-elapsed.js +1 -1
  132. package/lib/commands/project/create/main.js +1 -1
  133. package/lib/commands/project/create/non-interactive.js +1 -1
  134. package/lib/commands/project/create/project-template-path.js +1 -1
  135. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  136. package/lib/commands/project/create/use-format-code.js +1 -1
  137. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  138. package/lib/commands/project/index.js +1 -1
  139. package/lib/commands/project/init.js +1 -1
  140. package/lib/commands/project/upgrade.js +1 -1
  141. package/lib/commands/registry.js +1 -1
  142. package/lib/commands/role/create.js +1 -1
  143. package/lib/commands/role/delete.js +1 -1
  144. package/lib/commands/role/detail.js +1 -1
  145. package/lib/commands/role/index.js +1 -1
  146. package/lib/commands/role/list.js +1 -1
  147. package/lib/commands/role/shared.js +1 -1
  148. package/lib/commands/role/update.js +1 -1
  149. package/lib/commands/role/user-add.js +1 -1
  150. package/lib/commands/role/user-remove.js +1 -1
  151. package/lib/commands/role/user-resolve.js +1 -1
  152. package/lib/commands/run/index.js +1 -1
  153. package/lib/commands/schema.js +1 -1
  154. package/lib/commands/sql/create.js +1 -1
  155. package/lib/commands/sql/delete.js +1 -1
  156. package/lib/commands/sql/detail.js +1 -1
  157. package/lib/commands/sql/exec.js +1 -1
  158. package/lib/commands/sql/index.js +1 -1
  159. package/lib/commands/sql/list.js +1 -1
  160. package/lib/commands/sql/pull.js +1 -1
  161. package/lib/commands/sql/push.js +1 -1
  162. package/lib/commands/sql/save.js +1 -1
  163. package/lib/commands/sql/shared.js +1 -1
  164. package/lib/commands/sql/status.js +1 -1
  165. package/lib/commands/sql/validate.js +1 -1
  166. package/lib/commands/workspace/add.js +1 -1
  167. package/lib/commands/workspace/index.js +1 -1
  168. package/lib/commands/workspace/remove.js +1 -1
  169. package/lib/config/schema.js +1 -1
  170. package/lib/constant/cdn.js +1 -1
  171. package/lib/constant/cli.js +1 -1
  172. package/lib/constant/defaults.js +1 -1
  173. package/lib/constant/domain.js +1 -1
  174. package/lib/constant/env.js +1 -1
  175. package/lib/constant/output.js +1 -1
  176. package/lib/constant/paths.js +1 -1
  177. package/lib/constant/risk.js +1 -1
  178. package/lib/context/app-resolver.js +1 -1
  179. package/lib/context/auth-resolver.js +1 -1
  180. package/lib/context/config-loader.js +1 -1
  181. package/lib/context.js +1 -1
  182. package/lib/core/alias-resolver.js +1 -1
  183. package/lib/core/api-client.js +1 -1
  184. package/lib/core/bff/config.js +1 -1
  185. package/lib/core/bff/file-system.js +1 -1
  186. package/lib/core/bff/hash.js +1 -1
  187. package/lib/core/bff/lock.js +1 -1
  188. package/lib/core/bff/utils.js +1 -1
  189. package/lib/core/db-resolver.js +1 -1
  190. package/lib/core/page/file-system.js +1 -1
  191. package/lib/core/page/hash.js +1 -1
  192. package/lib/core/page/lock.js +1 -1
  193. package/lib/core/sql-sync/config.js +1 -1
  194. package/lib/core/sql-sync/file-system.js +1 -1
  195. package/lib/core/sql-sync/hash.js +1 -1
  196. package/lib/core/sql-sync/lock.js +1 -1
  197. package/lib/core/sql-sync/utils.js +1 -1
  198. package/lib/core/sql-validator.js +1 -1
  199. package/lib/errors.js +1 -1
  200. package/lib/framework/build-all-flags.js +1 -1
  201. package/lib/framework/flags.js +1 -1
  202. package/lib/framework/help.js +1 -1
  203. package/lib/framework/index.js +1 -1
  204. package/lib/framework/output.js +1 -1
  205. package/lib/framework/response.js +1 -1
  206. package/lib/framework/runner-alias.js +1 -1
  207. package/lib/framework/runner.js +1 -1
  208. package/lib/framework/schema-export.js +1 -1
  209. package/lib/framework/types.js +1 -1
  210. package/lib/generated/build-info.js +1 -1
  211. package/lib/help.js +1 -1
  212. package/lib/skills/main.js +1 -1
  213. package/lib/skills/npx-skills-add.js +1 -1
  214. package/lib/telemetry/cli-command-trace.js +1 -1
  215. package/lib/telemetry/cli-help-trace.js +1 -1
  216. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  217. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  218. package/lib/telemetry/send-cli-trace-log.js +1 -1
  219. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  220. package/lib/utils/ai_config.js +1 -1
  221. package/lib/utils/apply-jq-filter.js +1 -1
  222. package/lib/utils/cdn-config.js +1 -1
  223. package/lib/utils/check-sdk-version.js +1 -1
  224. package/lib/utils/cli-version-check.js +1 -1
  225. package/lib/utils/cli-version-policy.js +1 -1
  226. package/lib/utils/config.js +1 -1
  227. package/lib/utils/copy-directory.js +1 -1
  228. package/lib/utils/entity-with-id.js +1 -1
  229. package/lib/utils/file-utils.js +1 -1
  230. package/lib/utils/guides-cdn.js +1 -1
  231. package/lib/utils/http-client.js +1 -1
  232. package/lib/utils/is-non-interactive.js +1 -1
  233. package/lib/utils/logger.js +1 -1
  234. package/lib/utils/params.js +1 -1
  235. package/lib/utils/platform.js +1 -1
  236. package/lib/utils/rules-cdn.js +1 -1
  237. package/lib/utils/sleep.js +1 -1
  238. package/lib/utils/template-replacer.js +1 -1
  239. package/lib/utils/update-notice.js +1 -1
  240. package/lib/utils/version.js +1 -1
  241. package/lib/utils/with-active-cookie.js +1 -1
  242. package/lib/utils/write-cli-side-channel.js +1 -1
  243. package/package.json +1 -1
@@ -1 +1 @@
1
- function a154_0x5994(){const _0x120ae3=['dbId','561fcwXeS','description','471260TvpyLo','99KECOzq','2tuclxV','446285OjLERf','appCode','1355094NAMFHU','51vJoKXp','43596lJwMYv','sql','boolean','bool','Return\x20full\x20raw\x20SQL\x20query\x20object','sqlName','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','37192WkRZbx','sqlContent','str','verbose','44540lqwVSz','detail','read','125658fTqJMx'];a154_0x5994=function(){return _0x120ae3;};return a154_0x5994();}function a154_0x51b4(_0x349450,_0x248b1d){_0x349450=_0x349450-0x9c;const _0x599477=a154_0x5994();let _0x51b4b1=_0x599477[_0x349450];return _0x51b4b1;}const a154_0x1c6087=a154_0x51b4;(function(_0x4baaae,_0x195d20){const _0xa31a86=a154_0x51b4,_0xfaff4f=_0x4baaae();while(!![]){try{const _0x42531a=-parseInt(_0xa31a86(0xa9))/0x1*(-parseInt(_0xa31a86(0xaf))/0x2)+parseInt(_0xa31a86(0xb3))/0x3*(-parseInt(_0xa31a86(0xb4))/0x4)+parseInt(_0xa31a86(0xad))/0x5+parseInt(_0xa31a86(0xb2))/0x6+parseInt(_0xa31a86(0xb0))/0x7+-parseInt(_0xa31a86(0xa2))/0x8*(-parseInt(_0xa31a86(0xae))/0x9)+-parseInt(_0xa31a86(0xa6))/0xa*(parseInt(_0xa31a86(0xab))/0xb);if(_0x42531a===_0x195d20)break;else _0xfaff4f['push'](_0xfaff4f['shift']());}catch(_0x3318e4){_0xfaff4f['push'](_0xfaff4f['shift']());}}}(a154_0x5994,0x242f8));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a154_0x1c6087(0x9c),'command':a154_0x1c6087(0xa7),'description':a154_0x1c6087(0xa1),'risk':a154_0x1c6087(0xa8),'flags':[SQLCODE_FLAG,{'name':a154_0x1c6087(0xa5),'type':a154_0x1c6087(0x9d),'description':a154_0x1c6087(0x9f)}],async 'execute'(_0x5c0df2){const _0x4b11ff=a154_0x1c6087,_0x59ced6=await getSqlQueryInfo(_0x5c0df2['appCode'],_0x5c0df2[_0x4b11ff(0xa4)]('sqlcode')),_0x3dd360=_0x5c0df2[_0x4b11ff(0x9e)]('verbose');if(_0x3dd360)return{'ok':!![],'data':_0x59ced6};const _0x147963=_0x59ced6[_0x4b11ff(0xaa)]?await getDbName(_0x5c0df2[_0x4b11ff(0xb1)],_0x59ced6[_0x4b11ff(0xaa)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x59ced6['sqlCode'],'sqlName':_0x59ced6[_0x4b11ff(0xa0)],'db':_0x147963?_0x147963+'\x20('+_0x59ced6[_0x4b11ff(0xaa)]+')':_0x59ced6[_0x4b11ff(0xaa)]??'','description':_0x59ced6[_0x4b11ff(0xac)]??'','sqlContent':_0x59ced6[_0x4b11ff(0xa3)]??''}};}};
1
+ function a156_0x2dd8(_0x31847a,_0x4eaa8a){_0x31847a=_0x31847a-0xeb;const _0x6e7b=a156_0x6e7b();let _0x2dd8f0=_0x6e7b[_0x31847a];return _0x2dd8f0;}const a156_0x321b9b=a156_0x2dd8;function a156_0x6e7b(){const _0x4ac191=['sqlcode','sqlCode','6gaOblP','8736539cNKsft','bool','5958603csWnba','966116kWoJhd','detail','appCode','4511416AyTLkq','dbId','Return\x20full\x20raw\x20SQL\x20query\x20object','3034465RmHhDI','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','boolean','472113vdOIlv','read','verbose','3981600LeOKBv','12vaQEHC','2LjsQCx'];a156_0x6e7b=function(){return _0x4ac191;};return a156_0x6e7b();}(function(_0x7f2bc8,_0x17e85e){const _0x3bf83e=a156_0x2dd8,_0x2c1692=_0x7f2bc8();while(!![]){try{const _0x4935c1=parseInt(_0x3bf83e(0xfa))/0x1*(parseInt(_0x3bf83e(0xec))/0x2)+parseInt(_0x3bf83e(0xf5))/0x3*(-parseInt(_0x3bf83e(0xf9))/0x4)+parseInt(_0x3bf83e(0xf2))/0x5+parseInt(_0x3bf83e(0xfd))/0x6*(-parseInt(_0x3bf83e(0xfe))/0x7)+parseInt(_0x3bf83e(0xef))/0x8+parseInt(_0x3bf83e(0xeb))/0x9+-parseInt(_0x3bf83e(0xf8))/0xa;if(_0x4935c1===_0x17e85e)break;else _0x2c1692['push'](_0x2c1692['shift']());}catch(_0x2309b5){_0x2c1692['push'](_0x2c1692['shift']());}}}(a156_0x6e7b,0xa62cd));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a156_0x321b9b(0xed),'description':a156_0x321b9b(0xf3),'risk':a156_0x321b9b(0xf6),'flags':[SQLCODE_FLAG,{'name':a156_0x321b9b(0xf7),'type':a156_0x321b9b(0xf4),'description':a156_0x321b9b(0xf1)}],async 'execute'(_0x117bd2){const _0x1bf492=a156_0x321b9b,_0xfde96c=await getSqlQueryInfo(_0x117bd2[_0x1bf492(0xee)],_0x117bd2['str'](_0x1bf492(0xfb))),_0x2906ca=_0x117bd2[_0x1bf492(0xff)](_0x1bf492(0xf7));if(_0x2906ca)return{'ok':!![],'data':_0xfde96c};const _0x2f51b5=_0xfde96c[_0x1bf492(0xf0)]?await getDbName(_0x117bd2['appCode'],_0xfde96c['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0xfde96c[_0x1bf492(0xfc)],'sqlName':_0xfde96c['sqlName'],'db':_0x2f51b5?_0x2f51b5+'\x20('+_0xfde96c[_0x1bf492(0xf0)]+')':_0xfde96c['dbId']??'','description':_0xfde96c['description']??'','sqlContent':_0xfde96c['sqlContent']??''}};}};
@@ -1 +1 @@
1
- const a155_0x3b039b=a155_0xae3d;function a155_0x4dfc(){const _0x72d51a=['\x20row(s)\x20in\x20','length','now','params','951720zLgEbA','Returned\x20','15551739lroUgl','appCode','str','isArray','execResult','2639832MgHUtW','string','2784816XKsbpA','sqlcode','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','sql','3282cTklQC','exec','1016PrQCZG','286580DXTJDY','execError','SQL\x20execution\x20failed','read','973638gMtbJI','7RCdoWK'];a155_0x4dfc=function(){return _0x72d51a;};return a155_0x4dfc();}(function(_0x72071f,_0x39ad0e){const _0x1bbe15=a155_0xae3d,_0x32cf4d=_0x72071f();while(!![]){try{const _0x1a260a=-parseInt(_0x1bbe15(0x8f))/0x1+-parseInt(_0x1bbe15(0x93))/0x2+-parseInt(_0x1bbe15(0xa6))/0x3*(-parseInt(_0x1bbe15(0x8e))/0x4)+-parseInt(_0x1bbe15(0x99))/0x5+-parseInt(_0x1bbe15(0xa2))/0x6+parseInt(_0x1bbe15(0x94))/0x7*(-parseInt(_0x1bbe15(0xa0))/0x8)+parseInt(_0x1bbe15(0x9b))/0x9;if(_0x1a260a===_0x39ad0e)break;else _0x32cf4d['push'](_0x32cf4d['shift']());}catch(_0x48a150){_0x32cf4d['push'](_0x32cf4d['shift']());}}}(a155_0x4dfc,0x3c8b5));function a155_0xae3d(_0x37dc95,_0x3f9b45){_0x37dc95=_0x37dc95-0x8e;const _0x4dfc79=a155_0x4dfc();let _0xae3d16=_0x4dfc79[_0x37dc95];return _0xae3d16;}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a155_0x3b039b(0xa5),'command':a155_0x3b039b(0xa7),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a155_0x3b039b(0x92),'flags':[SQLCODE_FLAG,{'name':a155_0x3b039b(0x98),'type':a155_0x3b039b(0xa1),'description':a155_0x3b039b(0xa4)}],async 'execute'(_0x317856){const _0x52f03c=a155_0x3b039b,_0x5ada1c=parseJsonParams(_0x317856[_0x52f03c(0x9d)](_0x52f03c(0x98))),_0x11d3bc=Date['now'](),_0x660790=await executeSql(_0x317856[_0x52f03c(0x9c)],_0x317856[_0x52f03c(0x9d)](_0x52f03c(0xa3)),_0x5ada1c),_0x49638f=Date[_0x52f03c(0x97)]()-_0x11d3bc,_0x12dbc2=_0x660790?.[_0x52f03c(0x9f)]??_0x660790,_0x59c0e3=_0x660790?.['execSuccess']??!![];if(!_0x59c0e3)return{'ok':![],'data':{'error':_0x660790?.[_0x52f03c(0x90)]||_0x52f03c(0x91),'elapsed':_0x49638f},'message':'SQL\x20execution\x20failed'};const _0x16967e=Array[_0x52f03c(0x9e)](_0x12dbc2)?_0x12dbc2:[];return{'ok':!![],'data':{'rows':_0x16967e,'rowCount':_0x16967e[_0x52f03c(0x96)],'elapsed':_0x49638f},'message':_0x52f03c(0x9a)+_0x16967e[_0x52f03c(0x96)]+_0x52f03c(0x95)+_0x49638f+'ms'};}};
1
+ function a157_0x34b5(_0x1c89ae,_0x43bd18){_0x1c89ae=_0x1c89ae-0x115;const _0x588a1f=a157_0x588a();let _0x34b531=_0x588a1f[_0x1c89ae];return _0x34b531;}const a157_0x4b99e4=a157_0x34b5;function a157_0x588a(){const _0x2ba749=['sql','14117949OZecQX','length','params','205mbzsOx','5394tJLlaN','3QIFYyR','1735168LOKRbx','11626818SdwxjE','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','3295yBAxep','execSuccess','Returned\x20','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','10567472ztSobK','26138920GPKQDB','SQL\x20execution\x20failed','str','now','isArray','execResult','read','execError','11338rzlsnx','sqlcode','exec'];a157_0x588a=function(){return _0x2ba749;};return a157_0x588a();}(function(_0x5ef81f,_0x381c19){const _0x40cc14=a157_0x34b5,_0x202ebb=_0x5ef81f();while(!![]){try{const _0x371db0=-parseInt(_0x40cc14(0x11d))/0x1*(-parseInt(_0x40cc14(0x116))/0x2)+-parseInt(_0x40cc14(0x11f))/0x3*(-parseInt(_0x40cc14(0x120))/0x4)+-parseInt(_0x40cc14(0x123))/0x5*(-parseInt(_0x40cc14(0x11e))/0x6)+parseInt(_0x40cc14(0x121))/0x7+parseInt(_0x40cc14(0x127))/0x8+-parseInt(_0x40cc14(0x11a))/0x9+-parseInt(_0x40cc14(0x128))/0xa;if(_0x371db0===_0x381c19)break;else _0x202ebb['push'](_0x202ebb['shift']());}catch(_0x2cb0dc){_0x202ebb['push'](_0x202ebb['shift']());}}}(a157_0x588a,0xf1255));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a157_0x4b99e4(0x119),'command':a157_0x4b99e4(0x118),'description':a157_0x4b99e4(0x126),'risk':a157_0x4b99e4(0x12e),'flags':[SQLCODE_FLAG,{'name':a157_0x4b99e4(0x11c),'type':'string','description':a157_0x4b99e4(0x122)}],async 'execute'(_0xb80be8){const _0x4fb4c0=a157_0x4b99e4,_0x4ab098=parseJsonParams(_0xb80be8[_0x4fb4c0(0x12a)](_0x4fb4c0(0x11c))),_0x440516=Date['now'](),_0x565a2b=await executeSql(_0xb80be8['appCode'],_0xb80be8['str'](_0x4fb4c0(0x117)),_0x4ab098),_0x2458b7=Date[_0x4fb4c0(0x12b)]()-_0x440516,_0x5f538b=_0x565a2b?.[_0x4fb4c0(0x12d)]??_0x565a2b,_0x454218=_0x565a2b?.[_0x4fb4c0(0x124)]??!![];if(!_0x454218)return{'ok':![],'data':{'error':_0x565a2b?.[_0x4fb4c0(0x115)]||_0x4fb4c0(0x129),'elapsed':_0x2458b7},'message':_0x4fb4c0(0x129)};const _0x40ecdd=Array[_0x4fb4c0(0x12c)](_0x5f538b)?_0x5f538b:[];return{'ok':!![],'data':{'rows':_0x40ecdd,'rowCount':_0x40ecdd[_0x4fb4c0(0x11b)],'elapsed':_0x2458b7},'message':_0x4fb4c0(0x125)+_0x40ecdd[_0x4fb4c0(0x11b)]+'\x20row(s)\x20in\x20'+_0x2458b7+'ms'};}};
@@ -1 +1 @@
1
- (function(_0xd0808a,_0x412fb8){const _0x1c3e9d=a156_0x4a5a,_0x20294e=_0xd0808a();while(!![]){try{const _0x320c1f=-parseInt(_0x1c3e9d(0x135))/0x1+-parseInt(_0x1c3e9d(0x134))/0x2*(parseInt(_0x1c3e9d(0x139))/0x3)+parseInt(_0x1c3e9d(0x137))/0x4*(-parseInt(_0x1c3e9d(0x13b))/0x5)+-parseInt(_0x1c3e9d(0x133))/0x6+parseInt(_0x1c3e9d(0x138))/0x7+parseInt(_0x1c3e9d(0x136))/0x8+parseInt(_0x1c3e9d(0x13a))/0x9;if(_0x320c1f===_0x412fb8)break;else _0x20294e['push'](_0x20294e['shift']());}catch(_0x586cd3){_0x20294e['push'](_0x20294e['shift']());}}}(a156_0x395a,0x4a97c));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a156_0x395a(){const _0x5d909d=['120996aAevXi','1273307wrARUj','3ByfItH','13201101ePOTtU','90sLEJGE','2122854jftDKZ','990922mXQdkd','508694FeHubl','4474304GjgzxU'];a156_0x395a=function(){return _0x5d909d;};return a156_0x395a();}import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';function a156_0x4a5a(_0x9f16cd,_0xdf393e){_0x9f16cd=_0x9f16cd-0x133;const _0x395ac0=a156_0x395a();let _0x4a5ae7=_0x395ac0[_0x9f16cd];return _0x4a5ae7;}import{sqlPull}from'../../commands/sql/pull.js';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
+ (function(_0x900a59,_0x471632){const _0x3bc484=a158_0x480c,_0x337520=_0x900a59();while(!![]){try{const _0x38fcf3=parseInt(_0x3bc484(0xe3))/0x1+-parseInt(_0x3bc484(0xe4))/0x2+parseInt(_0x3bc484(0xe7))/0x3+-parseInt(_0x3bc484(0xe6))/0x4+-parseInt(_0x3bc484(0xea))/0x5+parseInt(_0x3bc484(0xe8))/0x6*(parseInt(_0x3bc484(0xe5))/0x7)+-parseInt(_0x3bc484(0xeb))/0x8*(-parseInt(_0x3bc484(0xe9))/0x9);if(_0x38fcf3===_0x471632)break;else _0x337520['push'](_0x337520['shift']());}catch(_0x4a80b0){_0x337520['push'](_0x337520['shift']());}}}(a158_0x3148,0xc30d3));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 a158_0x480c(_0x2636d1,_0x1abcc2){_0x2636d1=_0x2636d1-0xe3;const _0x3148c2=a158_0x3148();let _0x480cc2=_0x3148c2[_0x2636d1];return _0x480cc2;}import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';function a158_0x3148(){const _0x4fe5be=['6360550RpzDUH','6184sRgeBf','1532922QRAAbm','1224828jgvZVA','705691fbQbjz','5769152XrUbtA','141027DJEwTX','6jKhset','28467MfupvS'];a158_0x3148=function(){return _0x4fe5be;};return a158_0x3148();}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a157_0x41cdfa=a157_0xc896;function a157_0xc896(_0xf0d3e6,_0xa2ca1e){_0xf0d3e6=_0xf0d3e6-0xfd;const _0x5c3930=a157_0x5c39();let _0xc89616=_0x5c3930[_0xf0d3e6];return _0xc89616;}(function(_0x30aff2,_0x29a417){const _0x9cd89b=a157_0xc896,_0x1afc47=_0x30aff2();while(!![]){try{const _0x2c8edf=parseInt(_0x9cd89b(0x116))/0x1*(-parseInt(_0x9cd89b(0x11d))/0x2)+-parseInt(_0x9cd89b(0x115))/0x3*(parseInt(_0x9cd89b(0x102))/0x4)+-parseInt(_0x9cd89b(0x106))/0x5*(parseInt(_0x9cd89b(0x112))/0x6)+-parseInt(_0x9cd89b(0x11a))/0x7+parseInt(_0x9cd89b(0x10b))/0x8+-parseInt(_0x9cd89b(0x107))/0x9+parseInt(_0x9cd89b(0xfe))/0xa;if(_0x2c8edf===_0x29a417)break;else _0x1afc47['push'](_0x1afc47['shift']());}catch(_0x158102){_0x1afc47['push'](_0x1afc47['shift']());}}}(a157_0x5c39,0x8765f));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':a157_0x41cdfa(0x117),'command':a157_0x41cdfa(0x110),'description':a157_0x41cdfa(0x111),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a157_0x41cdfa(0x101),'description':a157_0x41cdfa(0x109)},{'name':a157_0x41cdfa(0x113),'type':'number','description':a157_0x41cdfa(0x108),'default':0x1},{'name':'pagesize','type':a157_0x41cdfa(0x10e),'description':'Page\x20size'},{'name':a157_0x41cdfa(0x10a),'type':'boolean','description':a157_0x41cdfa(0x11b)}],async 'execute'(_0x4ba977){const _0x3e4cb8=a157_0x41cdfa,_0xe0ef35=await listSqlQueries(_0x4ba977[_0x3e4cb8(0x10f)],{'sqlCode':_0x4ba977[_0x3e4cb8(0x104)](_0x3e4cb8(0x118))||undefined,'sqlName':_0x4ba977['str'](_0x3e4cb8(0x10c))||undefined,'currentPage':_0x4ba977['num'](_0x3e4cb8(0x113)),'pageSize':_0x4ba977[_0x3e4cb8(0x10d)](_0x3e4cb8(0x11e),0x32)}),_0x3bef07=_0x4ba977[_0x3e4cb8(0xfd)](_0x3e4cb8(0x10a)),_0x4e0cce=_0xe0ef35['tableData']??[],_0x24b7df=_0xe0ef35[_0x3e4cb8(0x119)]?.['totalCount']??_0x4e0cce[_0x3e4cb8(0x11f)];let _0x2a8863;return _0x3bef07?_0x2a8863=_0x4e0cce:_0x2a8863=await Promise[_0x3e4cb8(0x114)](_0x4e0cce[_0x3e4cb8(0x121)](async _0x4a5df6=>{const _0x42a51a=_0x3e4cb8;let _0x526ddd;try{_0x526ddd=_0x4a5df6[_0x42a51a(0x120)]?await getDbName(_0x4ba977[_0x42a51a(0x10f)],_0x4a5df6[_0x42a51a(0x120)]):undefined;}catch{}return{'sqlCode':_0x4a5df6[_0x42a51a(0x122)],'sqlName':_0x4a5df6[_0x42a51a(0x103)],'description':_0x4a5df6[_0x42a51a(0x11c)]??'','db':_0x526ddd?_0x526ddd+'\x20('+_0x4a5df6['dbId']+')':_0x4a5df6[_0x42a51a(0x120)]??''};})),{'ok':!![],'data':_0x2a8863,'message':_0x4e0cce[_0x3e4cb8(0x11f)]===0x0?_0x3e4cb8(0x105):_0x3e4cb8(0xff)+_0x4e0cce[_0x3e4cb8(0x11f)]+_0x3e4cb8(0x100)+_0x24b7df+').'};}};function a157_0x5c39(){const _0x295153=['167015TFJKSR','7366500KpnFGd','Page\x20number','Filter\x20by\x20SQL\x20name','verbose','138144RTrsIU','name','num','number','appCode','list','List\x20custom\x20SQL\x20queries','198sIyPuL','page','all','231327NjGnKo','1SKIoSg','sql','sqlcode','paging','5584439PXgBKN','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','description','2210966VMCQVg','pagesize','length','dbId','map','sqlCode','bool','52095810ecHGyz','Found\x20','\x20SQL\x20queries\x20(total:\x20','string','44HFhRFA','sqlName','str','No\x20custom\x20SQL\x20queries\x20found.'];a157_0x5c39=function(){return _0x295153;};return a157_0x5c39();}
1
+ const a159_0x203d62=a159_0x1fce;(function(_0x582410,_0x17df07){const _0x1aa812=a159_0x1fce,_0x3cf03d=_0x582410();while(!![]){try{const _0x7c4035=-parseInt(_0x1aa812(0x14a))/0x1*(parseInt(_0x1aa812(0x131))/0x2)+-parseInt(_0x1aa812(0x132))/0x3*(-parseInt(_0x1aa812(0x13e))/0x4)+-parseInt(_0x1aa812(0x12a))/0x5+parseInt(_0x1aa812(0x12e))/0x6*(-parseInt(_0x1aa812(0x140))/0x7)+parseInt(_0x1aa812(0x126))/0x8*(-parseInt(_0x1aa812(0x147))/0x9)+-parseInt(_0x1aa812(0x13a))/0xa+parseInt(_0x1aa812(0x142))/0xb;if(_0x7c4035===_0x17df07)break;else _0x3cf03d['push'](_0x3cf03d['shift']());}catch(_0x4037ef){_0x3cf03d['push'](_0x3cf03d['shift']());}}}(a159_0x14a9,0x33d25));function a159_0x14a9(){const _0x5d7070=['str','sql','appCode','Found\x20','898060oBjwwB','boolean','Filter\x20by\x20SQL\x20name','pagesize','44bIIyZf','map','1603sKPxxy','tableData','8203250xcxOMO','List\x20custom\x20SQL\x20queries','name','string','bool','9ISTcyo','page','No\x20custom\x20SQL\x20queries\x20found.','16787pgOeKF','597832bjDqdE','sqlcode','list','num','1475320SMEyLl','Page\x20number','dbId','totalCount','3900JoEKmo','read','Page\x20size','10CQNrML','43335dPCpMQ','paging','length','sqlCode'];a159_0x14a9=function(){return _0x5d7070;};return a159_0x14a9();}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a159_0x1fce(_0x1829fb,_0x1d89c4){_0x1829fb=_0x1829fb-0x126;const _0x14a971=a159_0x14a9();let _0x1fce67=_0x14a971[_0x1829fb];return _0x1fce67;}export const sqlList={'service':a159_0x203d62(0x137),'command':a159_0x203d62(0x128),'description':a159_0x203d62(0x143),'risk':a159_0x203d62(0x12f),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a159_0x203d62(0x144),'type':a159_0x203d62(0x145),'description':a159_0x203d62(0x13c)},{'name':a159_0x203d62(0x148),'type':'number','description':a159_0x203d62(0x12b),'default':0x1},{'name':a159_0x203d62(0x13d),'type':'number','description':a159_0x203d62(0x130)},{'name':'verbose','type':a159_0x203d62(0x13b),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x25480b){const _0x3229d0=a159_0x203d62,_0x1e8cd7=await listSqlQueries(_0x25480b[_0x3229d0(0x138)],{'sqlCode':_0x25480b['str'](_0x3229d0(0x127))||undefined,'sqlName':_0x25480b[_0x3229d0(0x136)](_0x3229d0(0x144))||undefined,'currentPage':_0x25480b[_0x3229d0(0x129)](_0x3229d0(0x148)),'pageSize':_0x25480b[_0x3229d0(0x129)]('pagesize',0x32)}),_0x5b5ecc=_0x25480b[_0x3229d0(0x146)]('verbose'),_0x3b115e=_0x1e8cd7[_0x3229d0(0x141)]??[],_0x4326fb=_0x1e8cd7[_0x3229d0(0x133)]?.[_0x3229d0(0x12d)]??_0x3b115e[_0x3229d0(0x134)];let _0x434ef5;return _0x5b5ecc?_0x434ef5=_0x3b115e:_0x434ef5=await Promise['all'](_0x3b115e[_0x3229d0(0x13f)](async _0x15708a=>{const _0x192e65=_0x3229d0;let _0x56d280;try{_0x56d280=_0x15708a['dbId']?await getDbName(_0x25480b[_0x192e65(0x138)],_0x15708a[_0x192e65(0x12c)]):undefined;}catch{}return{'sqlCode':_0x15708a[_0x192e65(0x135)],'sqlName':_0x15708a['sqlName'],'description':_0x15708a['description']??'','db':_0x56d280?_0x56d280+'\x20('+_0x15708a['dbId']+')':_0x15708a['dbId']??''};})),{'ok':!![],'data':_0x434ef5,'message':_0x3b115e[_0x3229d0(0x134)]===0x0?_0x3229d0(0x149):_0x3229d0(0x139)+_0x3b115e[_0x3229d0(0x134)]+'\x20SQL\x20queries\x20(total:\x20'+_0x4326fb+').'};}};
@@ -1 +1 @@
1
- const a158_0x36f9dc=a158_0x5ff6;(function(_0x5eaee1,_0x3f1d0e){const _0x31747d=a158_0x5ff6,_0x45321b=_0x5eaee1();while(!![]){try{const _0x412cbd=-parseInt(_0x31747d(0xaf))/0x1*(-parseInt(_0x31747d(0xe2))/0x2)+-parseInt(_0x31747d(0xaa))/0x3*(-parseInt(_0x31747d(0xad))/0x4)+-parseInt(_0x31747d(0xba))/0x5*(parseInt(_0x31747d(0xab))/0x6)+parseInt(_0x31747d(0xcb))/0x7*(-parseInt(_0x31747d(0xde))/0x8)+-parseInt(_0x31747d(0xd9))/0x9*(-parseInt(_0x31747d(0xdc))/0xa)+-parseInt(_0x31747d(0xe5))/0xb*(parseInt(_0x31747d(0xe3))/0xc)+-parseInt(_0x31747d(0xd3))/0xd*(-parseInt(_0x31747d(0xd5))/0xe);if(_0x412cbd===_0x3f1d0e)break;else _0x45321b['push'](_0x45321b['shift']());}catch(_0x833faf){_0x45321b['push'](_0x45321b['shift']());}}}(a158_0x2550,0x41220));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';function a158_0x2550(){const _0x465858=['local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','bool','nonInteractive','217365xawggd','description','utf8','join','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','str','string','sqlcode','replace','tableData','toISOString','path','sqlName','sqlCode','appCode','filter','\x20written,\x20','1862VFiMKk','lastSync','apps','unchanged','trimStart','cancelled','message','catch','6929JKvDBF','test','14434VJQPUC','No\x20remote\x20SQL\x20queries\x20matched.','conflict','sql','69453UmfXgY','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','push','110RnRqFF','lockFilePath','9560QtoUsm','sqlRoot','sqlContent','sqls','1908EzBbjQ','78612JrrCJf','split','649ICMPeJ','pull','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','write','Force\x20overwrite\x20local\x20unsynced\x20changes','501eClkbt','66FrImgp','dbId','11568KVQxrz','Filter\x20by\x20SQL\x20display\x20name','348nPKHFs','length','mybatisXml','Pull\x20complete:\x20','name','force','local\x20differs\x20from\x20remote','Force\x20pull\x20cancelled.'];a158_0x2550=function(){return _0x465858;};return a158_0x2550();}import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';function a158_0x5ff6(_0x11aaae,_0x484bf1){_0x11aaae=_0x11aaae-0xa9;const _0x2550a5=a158_0x2550();let _0x5ff666=_0x2550a5[_0x11aaae];return _0x5ff666;}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(_0x4c5f0c,_0x246bde){const _0x21333c=a158_0x5ff6,_0x59dd9d=[];let _0x4a46cc=0x1;while(!![]){const _0x3f0fc2=await listSqlQueries(_0x4c5f0c,{'currentPage':_0x4a46cc,'pageSize':PAGE_SIZE,'sqlCode':_0x246bde['sqlCode'],'sqlName':_0x246bde['sqlName']}),_0x31004d=_0x3f0fc2[_0x21333c(0xc3)]??[];_0x59dd9d[_0x21333c(0xdb)](..._0x31004d);if(_0x31004d[_0x21333c(0xb0)]===0x0)break;const _0x3a5317=_0x3f0fc2['paging']?.['totalCount'];if(_0x3a5317!=null?_0x59dd9d['length']>=_0x3a5317:_0x31004d['length']<PAGE_SIZE)break;_0x4a46cc++;}return _0x59dd9d;}async function ensureSqlContent(_0x461d85){const _0x3b70c3=a158_0x5ff6;if(_0x461d85['sqlContent']!=null&&String(_0x461d85[_0x3b70c3(0xe0)])[_0x3b70c3(0xb0)]>0x0)return _0x461d85;return getSqlQueryDetail(_0x461d85[_0x3b70c3(0xc7)]);}export const sqlPull={'service':a158_0x36f9dc(0xd8),'command':'pull','description':a158_0x36f9dc(0xbe),'risk':a158_0x36f9dc(0xe8),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a158_0x36f9dc(0xb3),'type':a158_0x36f9dc(0xc0),'description':a158_0x36f9dc(0xae)},{'name':a158_0x36f9dc(0xb4),'type':'boolean','description':a158_0x36f9dc(0xa9)}],async 'dryRun'(_0x30b7e0){const _0x45c60b=a158_0x36f9dc,_0x25cce7=loadSqlProjectConfig(_0x30b7e0['appCode']),_0x3c5983=await readSqlLockFile(_0x25cce7[_0x45c60b(0xdd)]),{appLock:_0x359c9c}=ensureSqlLockScope(_0x3c5983??createEmptySqlLock(),_0x25cce7[_0x45c60b(0xc8)],_0x25cce7[_0x45c60b(0xdf)],_0x45c60b(0xe6)),_0x596f31=await fetchAllSqlQueries(_0x30b7e0[_0x45c60b(0xc8)],{'sqlCode':_0x30b7e0[_0x45c60b(0xbf)](_0x45c60b(0xc1))||undefined,'sqlName':_0x30b7e0['str'](_0x45c60b(0xb3))||undefined}),_0x295d25=[];for(const _0x3df544 of _0x596f31){const _0x2740bc=await ensureSqlContent(_0x3df544),_0x371c60=ensureRemoteSqlContent(_0x2740bc),_0x53bdce=detectModeFromSql(_0x2740bc),_0x4424e0=_0x2740bc[_0x45c60b(0xac)]?await getDbName(_0x30b7e0[_0x45c60b(0xc8)],Number(_0x2740bc['dbId']))[_0x45c60b(0xd2)](()=>undefined):undefined,_0x4618a8=buildLocalSqlFileContent({'sqlCode':_0x2740bc[_0x45c60b(0xc7)],'sqlName':_0x2740bc[_0x45c60b(0xc6)],'dbId':_0x2740bc[_0x45c60b(0xac)]},_0x371c60,{'dbName':_0x4424e0,'mode':_0x53bdce,'syncedAt':new Date()[_0x45c60b(0xc4)](),'description':_0x2740bc[_0x45c60b(0xbb)]}),_0x4ff6f6=buildSqlLockEntry(_0x2740bc,_0x371c60,'',{'dbName':_0x4424e0}),_0x429e10=resolveLocalSqlFilePath(_0x25cce7,_0x2740bc[_0x45c60b(0xc7)],_0x4ff6f6);let _0x263988='would_pull',_0x51093a;if(await fileExists(_0x429e10)){const _0x4a9d3c=await readFile(_0x429e10,_0x45c60b(0xbc));isEquivalentPulledSqlFile(_0x4a9d3c,_0x4618a8,_0x53bdce)?(_0x263988='skipped',_0x51093a=_0x45c60b(0xce)):(_0x263988=_0x45c60b(0xd7),_0x51093a=_0x45c60b(0xb7));}_0x295d25[_0x45c60b(0xdb)]({'sqlCode':_0x2740bc[_0x45c60b(0xc7)],'sqlName':_0x2740bc[_0x45c60b(0xc6)],'filePath':_0x429e10,'status':_0x263988,'reason':_0x51093a});}return{'method':'POST','url':_0x45c60b(0xda),'body':{'appCode':_0x30b7e0[_0x45c60b(0xc8)],'sqlCode':_0x30b7e0[_0x45c60b(0xbf)](_0x45c60b(0xc1))||null,'sqlName':_0x30b7e0[_0x45c60b(0xbf)](_0x45c60b(0xb3))||null,'files':_0x295d25},'description':'Would\x20pull\x20'+_0x295d25[_0x45c60b(0xb0)]+'\x20SQL\x20file(s)\x20into\x20'+_0x25cce7['sqlRootDir']};},async 'execute'(_0x5c0ba4){const _0x147bd2=a158_0x36f9dc,_0x278263=loadSqlProjectConfig(_0x5c0ba4[_0x147bd2(0xc8)]),_0x10b4b8=await readSqlLockFile(_0x278263[_0x147bd2(0xdd)]),{lockData:_0x4063e8,appLock:_0xea551f}=ensureSqlLockScope(_0x10b4b8??createEmptySqlLock(),_0x278263['appCode'],_0x278263['sqlRoot'],_0x147bd2(0xe6)),_0xf92904=_0x5c0ba4[_0x147bd2(0xb8)](_0x147bd2(0xb4)),_0x3e8f56=await fetchAllSqlQueries(_0x5c0ba4['appCode'],{'sqlCode':_0x5c0ba4['str'](_0x147bd2(0xc1))||undefined,'sqlName':_0x5c0ba4[_0x147bd2(0xbf)](_0x147bd2(0xb3))||undefined});if(_0x3e8f56[_0x147bd2(0xb0)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x147bd2(0xd6)};const _0x308fdb=[],_0x8d6673=[];for(const _0x24d239 of _0x3e8f56){try{_0x308fdb[_0x147bd2(0xdb)](await ensureSqlContent(_0x24d239));}catch(_0x144b2a){_0x8d6673[_0x147bd2(0xdb)]({'sqlCode':_0x24d239['sqlCode'],'error':_0x144b2a instanceof Error?_0x144b2a[_0x147bd2(0xd1)]:String(_0x144b2a)});}}if(_0xf92904&&!_0x5c0ba4[_0x147bd2(0xb9)]){let _0x3c7145=![];for(const _0x2226c6 of _0x308fdb){const _0x45c015=detectModeFromSql(_0x2226c6),_0x453304=_0x2226c6[_0x147bd2(0xac)]?await getDbName(_0x5c0ba4['appCode'],Number(_0x2226c6[_0x147bd2(0xac)]))[_0x147bd2(0xd2)](()=>undefined):undefined,_0x1ff584=buildLocalSqlFileContent({'sqlCode':_0x2226c6[_0x147bd2(0xc7)],'sqlName':_0x2226c6[_0x147bd2(0xc6)],'dbId':_0x2226c6[_0x147bd2(0xac)]},ensureRemoteSqlContent(_0x2226c6),{'dbName':_0x453304,'mode':_0x45c015,'syncedAt':new Date()[_0x147bd2(0xc4)](),'description':_0x2226c6['description']}),_0x118e1a=resolveLocalSqlFilePath(_0x278263,_0x2226c6[_0x147bd2(0xc7)],buildSqlLockEntry(_0x2226c6,ensureRemoteSqlContent(_0x2226c6),'',{'dbName':_0x453304}));if(await fileExists(_0x118e1a)){const _0x12b81e=await readFile(_0x118e1a,'utf8');if(!isEquivalentPulledSqlFile(_0x12b81e,_0x1ff584,_0x45c015)){_0x3c7145=!![];break;}}}if(_0x3c7145){const _0x11aede=await confirmForceOverwrite(_0x147bd2(0xe7));if(!_0x11aede)throw CliErrors[_0x147bd2(0xd0)](_0x147bd2(0xb6));}}const _0x4eca2a=cloneSqlLockData(_0x4063e8),_0x1605d8=_0x4eca2a[_0x147bd2(0xcd)][_0x278263[_0x147bd2(0xc8)]],_0x32e46c=[],_0x2bef38=[];for(const _0x285f57 of _0x308fdb){const _0x377a15=_0x1605d8[_0x147bd2(0xe1)][_0x285f57[_0x147bd2(0xc7)]],_0x462834=ensureRemoteSqlContent(_0x285f57),_0x4cb2da=detectModeFromSql(_0x285f57),_0x614c7d=_0x285f57['dbId']?await getDbName(_0x5c0ba4[_0x147bd2(0xc8)],Number(_0x285f57['dbId']))[_0x147bd2(0xd2)](()=>undefined):undefined,_0x52dee4=buildLocalSqlFileContent({'sqlCode':_0x285f57[_0x147bd2(0xc7)],'sqlName':_0x285f57[_0x147bd2(0xc6)],'dbId':_0x285f57[_0x147bd2(0xac)]},_0x462834,{'dbName':_0x614c7d,'mode':_0x4cb2da,'syncedAt':new Date()[_0x147bd2(0xc4)](),'description':_0x285f57[_0x147bd2(0xbb)]}),_0x117a78=buildSqlLockEntry(_0x285f57,_0x462834,computeSqlContentHash(_0x52dee4),{'dbName':_0x614c7d}),_0x250a5a=_0x117a78[_0x147bd2(0xc5)],_0x4c2771=join(_0x278263['sqlRootDir'],_0x250a5a);try{if(await fileExists(_0x4c2771)){const _0x5de895=await readFile(_0x4c2771,_0x147bd2(0xbc));if(isEquivalentPulledSqlFile(_0x5de895,_0x52dee4,_0x4cb2da)){_0x2bef38['push']({'sqlCode':_0x285f57['sqlCode'],'reason':'unchanged'}),_0x1605d8['sqls'][_0x285f57[_0x147bd2(0xc7)]]={..._0x117a78,'hash':computeSqlContentHash(_0x5de895),'path':_0x250a5a};continue;}if(!_0xf92904){_0x2bef38[_0x147bd2(0xdb)]({'sqlCode':_0x285f57['sqlCode'],'reason':_0x147bd2(0xb5)});continue;}}const _0x2cac30=_0x377a15?.[_0x147bd2(0xc5)]?join(_0x278263['sqlRootDir'],_0x377a15[_0x147bd2(0xc5)]):undefined;_0x2cac30&&_0x2cac30!==_0x4c2771&&await fileExists(_0x2cac30)&&await rm(_0x2cac30,{'force':!![]}),await ensureParentDirectory(_0x4c2771),await writeFile(_0x4c2771,_0x52dee4,_0x147bd2(0xbc)),_0x1605d8[_0x147bd2(0xe1)][_0x285f57['sqlCode']]={..._0x117a78,'path':_0x250a5a},_0x32e46c[_0x147bd2(0xdb)]({'sqlCode':_0x285f57[_0x147bd2(0xc7)],'filePath':_0x4c2771});}catch(_0x4c1acd){_0x8d6673['push']({'sqlCode':_0x285f57['sqlCode'],'error':_0x4c1acd instanceof Error?_0x4c1acd[_0x147bd2(0xd1)]:String(_0x4c1acd)});}}return _0x1605d8[_0x147bd2(0xcc)]=new Date()[_0x147bd2(0xc4)](),await writeSqlLockFile(_0x278263[_0x147bd2(0xdd)],_0x4eca2a),{'ok':_0x8d6673[_0x147bd2(0xb0)]===0x0,'data':{'pulled':_0x32e46c,'skipped':_0x2bef38,'failed':_0x8d6673},'message':_0x147bd2(0xb2)+_0x32e46c[_0x147bd2(0xb0)]+_0x147bd2(0xca)+_0x2bef38[_0x147bd2(0xb0)]+'\x20skipped,\x20'+_0x8d6673[_0x147bd2(0xb0)]+'\x20failed'};}};function detectModeFromSql(_0x331577){const _0x26867a=a158_0x36f9dc,_0x5acbc8=ensureRemoteSqlContent(_0x331577),_0x460b5a=stripLocalSqlMetadata(_0x5acbc8,_0x26867a(0xb1))[_0x26867a(0xcf)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x460b5a))return _0x26867a(0xb1);return _0x26867a(0xd8);}function isEquivalentPulledSqlFile(_0x4c75c6,_0x3b879f,_0x408c40){return normalizePullComparableContent(_0x4c75c6,_0x408c40)===normalizePullComparableContent(_0x3b879f,_0x408c40);}function normalizePullComparableContent(_0x5e4397,_0x470526){const _0x13c012=a158_0x36f9dc,_0x4d5e0b=_0x5e4397[_0x13c012(0xc2)](/\r\n/g,'\x0a')[_0x13c012(0xe4)]('\x0a'),_0xe6fce2=_0x4d5e0b[_0x13c012(0xc9)](_0x30c37e=>!isSyncedAtMetadataLine(_0x30c37e,_0x470526));return _0xe6fce2[_0x13c012(0xbd)]('\x0a');}function isSyncedAtMetadataLine(_0x212b77,_0x4c8314){const _0x44e873=a158_0x36f9dc;if(_0x4c8314===_0x44e873(0xb1))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x44e873(0xd4)](_0x212b77);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x212b77);}
1
+ const a160_0x468f71=a160_0x388d;function a160_0x388d(_0x116f08,_0x2ad546){_0x116f08=_0x116f08-0x12f;const _0x46dec1=a160_0x46de();let _0x388d33=_0x46dec1[_0x116f08];return _0x388d33;}(function(_0x26ce5e,_0x5c2ed1){const _0x5a1365=a160_0x388d,_0x145a13=_0x26ce5e();while(!![]){try{const _0x26f8a4=-parseInt(_0x5a1365(0x14d))/0x1*(-parseInt(_0x5a1365(0x158))/0x2)+-parseInt(_0x5a1365(0x13e))/0x3+parseInt(_0x5a1365(0x16b))/0x4+-parseInt(_0x5a1365(0x155))/0x5+parseInt(_0x5a1365(0x12f))/0x6+-parseInt(_0x5a1365(0x151))/0x7*(-parseInt(_0x5a1365(0x15b))/0x8)+parseInt(_0x5a1365(0x14e))/0x9*(-parseInt(_0x5a1365(0x132))/0xa);if(_0x26f8a4===_0x5c2ed1)break;else _0x145a13['push'](_0x145a13['shift']());}catch(_0x2dc1d1){_0x145a13['push'](_0x145a13['shift']());}}}(a160_0x46de,0x667dd));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x1c8d01,_0x306f4c){const _0x4b26c9=a160_0x388d,_0x2b9d78=[];let _0x27502e=0x1;while(!![]){const _0xaf744f=await listSqlQueries(_0x1c8d01,{'currentPage':_0x27502e,'pageSize':PAGE_SIZE,'sqlCode':_0x306f4c[_0x4b26c9(0x13c)],'sqlName':_0x306f4c[_0x4b26c9(0x149)]}),_0x56907c=_0xaf744f[_0x4b26c9(0x142)]??[];_0x2b9d78['push'](..._0x56907c);if(_0x56907c[_0x4b26c9(0x13d)]===0x0)break;const _0x2c8286=_0xaf744f[_0x4b26c9(0x167)]?.[_0x4b26c9(0x168)];if(_0x2c8286!=null?_0x2b9d78['length']>=_0x2c8286:_0x56907c[_0x4b26c9(0x13d)]<PAGE_SIZE)break;_0x27502e++;}return _0x2b9d78;}async function ensureSqlContent(_0x1fde8d){const _0xa0e031=a160_0x388d;if(_0x1fde8d[_0xa0e031(0x156)]!=null&&String(_0x1fde8d[_0xa0e031(0x156)])['length']>0x0)return _0x1fde8d;return getSqlQueryDetail(_0x1fde8d['sqlCode']);}export const sqlPull={'service':a160_0x468f71(0x153),'command':a160_0x468f71(0x15c),'description':a160_0x468f71(0x16d),'risk':a160_0x468f71(0x16e),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a160_0x468f71(0x14b),'type':a160_0x468f71(0x148),'description':a160_0x468f71(0x143)},{'name':'force','type':a160_0x468f71(0x15e),'description':a160_0x468f71(0x14a)}],async 'dryRun'(_0x35ef00){const _0x1e0e63=a160_0x468f71,_0x3d2aa7=loadSqlProjectConfig(_0x35ef00['appCode']),_0x42ba2b=await readSqlLockFile(_0x3d2aa7['lockFilePath']),{appLock:_0x34c327}=ensureSqlLockScope(_0x42ba2b??createEmptySqlLock(),_0x3d2aa7[_0x1e0e63(0x16a)],_0x3d2aa7['sqlRoot'],_0x1e0e63(0x15c)),_0x416e05=await fetchAllSqlQueries(_0x35ef00[_0x1e0e63(0x16a)],{'sqlCode':_0x35ef00['str'](_0x1e0e63(0x165))||undefined,'sqlName':_0x35ef00[_0x1e0e63(0x152)](_0x1e0e63(0x14b))||undefined}),_0x58a453=[];for(const _0x5d3057 of _0x416e05){const _0x4748e2=await ensureSqlContent(_0x5d3057),_0x148958=ensureRemoteSqlContent(_0x4748e2),_0x316b1c=detectModeFromSql(_0x4748e2),_0x565a09=_0x4748e2['dbId']?await getDbName(_0x35ef00[_0x1e0e63(0x16a)],Number(_0x4748e2[_0x1e0e63(0x138)]))[_0x1e0e63(0x141)](()=>undefined):undefined,_0x1ead2c=buildLocalSqlFileContent({'sqlCode':_0x4748e2[_0x1e0e63(0x13c)],'sqlName':_0x4748e2[_0x1e0e63(0x149)],'dbId':_0x4748e2[_0x1e0e63(0x138)]},_0x148958,{'dbName':_0x565a09,'mode':_0x316b1c,'syncedAt':new Date()[_0x1e0e63(0x13f)](),'description':_0x4748e2[_0x1e0e63(0x164)]}),_0x1a2983=buildSqlLockEntry(_0x4748e2,_0x148958,'',{'dbName':_0x565a09}),_0x93a7fc=resolveLocalSqlFilePath(_0x3d2aa7,_0x4748e2[_0x1e0e63(0x13c)],_0x1a2983);let _0x3cda44=_0x1e0e63(0x133),_0x197b67;if(await fileExists(_0x93a7fc)){const _0x47e4ae=await readFile(_0x93a7fc,'utf8');isEquivalentPulledSqlFile(_0x47e4ae,_0x1ead2c,_0x316b1c)?(_0x3cda44='skipped',_0x197b67=_0x1e0e63(0x144)):(_0x3cda44=_0x1e0e63(0x14c),_0x197b67=_0x1e0e63(0x145));}_0x58a453[_0x1e0e63(0x15d)]({'sqlCode':_0x4748e2['sqlCode'],'sqlName':_0x4748e2[_0x1e0e63(0x149)],'filePath':_0x93a7fc,'status':_0x3cda44,'reason':_0x197b67});}return{'method':_0x1e0e63(0x157),'url':_0x1e0e63(0x136),'body':{'appCode':_0x35ef00[_0x1e0e63(0x16a)],'sqlCode':_0x35ef00[_0x1e0e63(0x152)]('sqlcode')||null,'sqlName':_0x35ef00[_0x1e0e63(0x152)](_0x1e0e63(0x14b))||null,'files':_0x58a453},'description':'Would\x20pull\x20'+_0x58a453[_0x1e0e63(0x13d)]+'\x20SQL\x20file(s)\x20into\x20'+_0x3d2aa7[_0x1e0e63(0x13b)]};},async 'execute'(_0x18572e){const _0x52f280=a160_0x468f71,_0x3c15da=loadSqlProjectConfig(_0x18572e[_0x52f280(0x16a)]),_0x54d4b9=await readSqlLockFile(_0x3c15da[_0x52f280(0x147)]),{lockData:_0x1231d1,appLock:_0x1b6d9a}=ensureSqlLockScope(_0x54d4b9??createEmptySqlLock(),_0x3c15da['appCode'],_0x3c15da[_0x52f280(0x14f)],_0x52f280(0x15c)),_0x21fd6f=_0x18572e['bool'](_0x52f280(0x140)),_0x398712=await fetchAllSqlQueries(_0x18572e[_0x52f280(0x16a)],{'sqlCode':_0x18572e[_0x52f280(0x152)](_0x52f280(0x165))||undefined,'sqlName':_0x18572e[_0x52f280(0x152)](_0x52f280(0x14b))||undefined});if(_0x398712[_0x52f280(0x13d)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x47ee01=[],_0xa60b7f=[];for(const _0xf47fc of _0x398712){try{_0x47ee01['push'](await ensureSqlContent(_0xf47fc));}catch(_0x5201fc){_0xa60b7f[_0x52f280(0x15d)]({'sqlCode':_0xf47fc[_0x52f280(0x13c)],'error':_0x5201fc instanceof Error?_0x5201fc['message']:String(_0x5201fc)});}}if(_0x21fd6f&&!_0x18572e[_0x52f280(0x150)]){let _0x5962c1=![];for(const _0xd8b38a of _0x47ee01){const _0x4aba01=detectModeFromSql(_0xd8b38a),_0x5a8af5=_0xd8b38a[_0x52f280(0x138)]?await getDbName(_0x18572e[_0x52f280(0x16a)],Number(_0xd8b38a[_0x52f280(0x138)]))[_0x52f280(0x141)](()=>undefined):undefined,_0x45c32b=buildLocalSqlFileContent({'sqlCode':_0xd8b38a[_0x52f280(0x13c)],'sqlName':_0xd8b38a[_0x52f280(0x149)],'dbId':_0xd8b38a[_0x52f280(0x138)]},ensureRemoteSqlContent(_0xd8b38a),{'dbName':_0x5a8af5,'mode':_0x4aba01,'syncedAt':new Date()[_0x52f280(0x13f)](),'description':_0xd8b38a[_0x52f280(0x164)]}),_0x3bdc23=resolveLocalSqlFilePath(_0x3c15da,_0xd8b38a['sqlCode'],buildSqlLockEntry(_0xd8b38a,ensureRemoteSqlContent(_0xd8b38a),'',{'dbName':_0x5a8af5}));if(await fileExists(_0x3bdc23)){const _0x4101ba=await readFile(_0x3bdc23,_0x52f280(0x131));if(!isEquivalentPulledSqlFile(_0x4101ba,_0x45c32b,_0x4aba01)){_0x5962c1=!![];break;}}}if(_0x5962c1){const _0x323602=await confirmForceOverwrite(_0x52f280(0x162));if(!_0x323602)throw CliErrors[_0x52f280(0x161)](_0x52f280(0x135));}}const _0x179587=cloneSqlLockData(_0x1231d1),_0x49f5d8=_0x179587[_0x52f280(0x16c)][_0x3c15da[_0x52f280(0x16a)]],_0xf63ea9=[],_0x25bcec=[];for(const _0x10d05a of _0x47ee01){const _0x1afc71=_0x49f5d8[_0x52f280(0x166)][_0x10d05a[_0x52f280(0x13c)]],_0x5f41f2=ensureRemoteSqlContent(_0x10d05a),_0x150055=detectModeFromSql(_0x10d05a),_0x162cc6=_0x10d05a[_0x52f280(0x138)]?await getDbName(_0x18572e['appCode'],Number(_0x10d05a['dbId']))[_0x52f280(0x141)](()=>undefined):undefined,_0x2d4529=buildLocalSqlFileContent({'sqlCode':_0x10d05a['sqlCode'],'sqlName':_0x10d05a['sqlName'],'dbId':_0x10d05a[_0x52f280(0x138)]},_0x5f41f2,{'dbName':_0x162cc6,'mode':_0x150055,'syncedAt':new Date()[_0x52f280(0x13f)](),'description':_0x10d05a[_0x52f280(0x164)]}),_0x441a72=buildSqlLockEntry(_0x10d05a,_0x5f41f2,computeSqlContentHash(_0x2d4529),{'dbName':_0x162cc6}),_0x5c7bff=_0x441a72[_0x52f280(0x154)],_0x1f01a6=join(_0x3c15da[_0x52f280(0x13b)],_0x5c7bff);try{if(await fileExists(_0x1f01a6)){const _0x171fa5=await readFile(_0x1f01a6,'utf8');if(isEquivalentPulledSqlFile(_0x171fa5,_0x2d4529,_0x150055)){_0x25bcec[_0x52f280(0x15d)]({'sqlCode':_0x10d05a[_0x52f280(0x13c)],'reason':'unchanged'}),_0x49f5d8[_0x52f280(0x166)][_0x10d05a['sqlCode']]={..._0x441a72,'hash':computeSqlContentHash(_0x171fa5),'path':_0x5c7bff};continue;}if(!_0x21fd6f){_0x25bcec[_0x52f280(0x15d)]({'sqlCode':_0x10d05a[_0x52f280(0x13c)],'reason':_0x52f280(0x159)});continue;}}const _0xe9ea77=_0x1afc71?.[_0x52f280(0x154)]?join(_0x3c15da['sqlRootDir'],_0x1afc71[_0x52f280(0x154)]):undefined;_0xe9ea77&&_0xe9ea77!==_0x1f01a6&&await fileExists(_0xe9ea77)&&await rm(_0xe9ea77,{'force':!![]}),await ensureParentDirectory(_0x1f01a6),await writeFile(_0x1f01a6,_0x2d4529,_0x52f280(0x131)),_0x49f5d8[_0x52f280(0x166)][_0x10d05a[_0x52f280(0x13c)]]={..._0x441a72,'path':_0x5c7bff},_0xf63ea9[_0x52f280(0x15d)]({'sqlCode':_0x10d05a[_0x52f280(0x13c)],'filePath':_0x1f01a6});}catch(_0x7a49f0){_0xa60b7f[_0x52f280(0x15d)]({'sqlCode':_0x10d05a[_0x52f280(0x13c)],'error':_0x7a49f0 instanceof Error?_0x7a49f0[_0x52f280(0x16f)]:String(_0x7a49f0)});}}return _0x49f5d8[_0x52f280(0x130)]=new Date()[_0x52f280(0x13f)](),await writeSqlLockFile(_0x3c15da[_0x52f280(0x147)],_0x179587),{'ok':_0xa60b7f[_0x52f280(0x13d)]===0x0,'data':{'pulled':_0xf63ea9,'skipped':_0x25bcec,'failed':_0xa60b7f},'message':_0x52f280(0x137)+_0xf63ea9[_0x52f280(0x13d)]+_0x52f280(0x15f)+_0x25bcec[_0x52f280(0x13d)]+_0x52f280(0x163)+_0xa60b7f[_0x52f280(0x13d)]+_0x52f280(0x13a)};}};function a160_0x46de(){const _0x475090=['write','message','4000182bPuaoo','lastSync','utf8','33910rYjTvh','would_pull','test','Force\x20pull\x20cancelled.','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','Pull\x20complete:\x20','dbId','mybatisXml','\x20failed','sqlRootDir','sqlCode','length','1999749uJQACx','toISOString','force','catch','tableData','Filter\x20by\x20SQL\x20display\x20name','unchanged','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','trimStart','lockFilePath','string','sqlName','Force\x20overwrite\x20local\x20unsynced\x20changes','name','conflict','755rKrsej','360hTgUkR','sqlRoot','nonInteractive','14eCQuWA','str','sql','path','2713580jCVXly','sqlContent','POST','1444bpByhI','local\x20differs\x20from\x20remote','split','234464JyDPOL','pull','push','boolean','\x20written,\x20','replace','cancelled','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','\x20skipped,\x20','description','sqlcode','sqls','paging','totalCount','filter','appCode','1977284zgpUZi','apps','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/'];a160_0x46de=function(){return _0x475090;};return a160_0x46de();}function detectModeFromSql(_0x19d731){const _0x5796a4=a160_0x468f71,_0x54befe=ensureRemoteSqlContent(_0x19d731),_0x2ebd55=stripLocalSqlMetadata(_0x54befe,_0x5796a4(0x139))[_0x5796a4(0x146)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x2ebd55))return'mybatisXml';return _0x5796a4(0x153);}function isEquivalentPulledSqlFile(_0x228ffe,_0x6d7ded,_0x2b5129){return normalizePullComparableContent(_0x228ffe,_0x2b5129)===normalizePullComparableContent(_0x6d7ded,_0x2b5129);}function normalizePullComparableContent(_0x33bad6,_0x58cb5a){const _0x5ecb05=a160_0x468f71,_0x5bf37b=_0x33bad6[_0x5ecb05(0x160)](/\r\n/g,'\x0a')[_0x5ecb05(0x15a)]('\x0a'),_0x35befd=_0x5bf37b[_0x5ecb05(0x169)](_0x371c90=>!isSyncedAtMetadataLine(_0x371c90,_0x58cb5a));return _0x35befd['join']('\x0a');}function isSyncedAtMetadataLine(_0x3f529d,_0xe63565){const _0x50f012=a160_0x468f71;if(_0xe63565===_0x50f012(0x139))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x50f012(0x134)](_0x3f529d);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x3f529d);}
@@ -1 +1 @@
1
- const a159_0x307fe6=a159_0x23ec;(function(_0xe56ade,_0x4b6e20){const _0x57aaa4=a159_0x23ec,_0x26277a=_0xe56ade();while(!![]){try{const _0x4c2364=-parseInt(_0x57aaa4(0x149))/0x1+parseInt(_0x57aaa4(0x15b))/0x2*(-parseInt(_0x57aaa4(0x15d))/0x3)+-parseInt(_0x57aaa4(0x153))/0x4*(-parseInt(_0x57aaa4(0x13d))/0x5)+parseInt(_0x57aaa4(0x15a))/0x6+parseInt(_0x57aaa4(0x159))/0x7+-parseInt(_0x57aaa4(0x144))/0x8+-parseInt(_0x57aaa4(0x139))/0x9*(-parseInt(_0x57aaa4(0x134))/0xa);if(_0x4c2364===_0x4b6e20)break;else _0x26277a['push'](_0x26277a['shift']());}catch(_0x4d1775){_0x26277a['push'](_0x26277a['shift']());}}}(a159_0x2ed6,0x85ea1));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x21c330,_0x501551,_0x232be2){const _0x3566c8=a159_0x23ec,_0x2b7853=await scanLocalSqlQueries(_0x21c330),_0x150d30=new Map();for(const _0x3caf15 of _0x2b7853){if(_0x232be2&&_0x3caf15[_0x3566c8(0x16e)]!==_0x232be2)continue;const _0xa66d29=_0x150d30[_0x3566c8(0x154)](_0x3caf15[_0x3566c8(0x16e)])??[];_0xa66d29[_0x3566c8(0x130)](_0x3caf15),_0x150d30['set'](_0x3caf15[_0x3566c8(0x16e)],_0xa66d29);}if(_0x232be2&&!_0x150d30[_0x3566c8(0x14d)](_0x232be2))throw CliErrors[_0x3566c8(0x137)]('Local\x20SQL\x20not\x20found:\x20'+_0x232be2);const _0xbc996d=[];for(const [_0x575f11,_0x44f999]of _0x150d30[_0x3566c8(0x136)]()){if(_0x44f999[_0x3566c8(0x140)]===0x1){_0xbc996d['push'](_0x44f999[0x0]);continue;}const _0x3df98d=_0x501551[_0x3566c8(0x160)][_0x575f11],_0x54831d=_0x3df98d?.[_0x3566c8(0x16c)],_0x1c435b=_0x54831d?_0x44f999['filter'](_0x55003e=>_0x55003e[_0x3566c8(0x157)]!==_0x54831d):_0x44f999;if(_0x3df98d&&_0x1c435b[_0x3566c8(0x140)]===0x1){_0xbc996d[_0x3566c8(0x130)](_0x1c435b[0x0]);continue;}throw CliErrors[_0x3566c8(0x137)](_0x3566c8(0x147)+_0x575f11+_0x3566c8(0x13a));}return _0xbc996d;}export const sqlPush={'service':a159_0x307fe6(0x166),'command':a159_0x307fe6(0x130),'description':a159_0x307fe6(0x174),'risk':a159_0x307fe6(0x14a),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a159_0x307fe6(0x145),'type':a159_0x307fe6(0x135),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x5f57a2){const _0x78a3b1=a159_0x307fe6,_0x9c2212=loadSqlProjectConfig(_0x5f57a2[_0x78a3b1(0x133)]),_0x373e34=await readSqlLockFile(_0x9c2212[_0x78a3b1(0x172)]),{appLock:_0x31934c}=ensureSqlLockScope(_0x373e34??createEmptySqlLock(),_0x5f57a2[_0x78a3b1(0x133)],_0x9c2212[_0x78a3b1(0x170)],_0x78a3b1(0x130)),_0x3b3c9c=await getTargetSqlQueries(_0x9c2212,_0x31934c,_0x5f57a2[_0x78a3b1(0x148)](_0x78a3b1(0x14f))||undefined),_0x5a8032=[];for(const _0x3f8b36 of _0x3b3c9c){const _0x404f8f=await computeSqlFileHash(_0x3f8b36['filePath']),_0x191b70=_0x31934c[_0x78a3b1(0x160)][_0x3f8b36[_0x78a3b1(0x16e)]],_0x15c471=!!_0x191b70&&(_0x191b70[_0x78a3b1(0x16c)]!==_0x3f8b36['relativePath']||!!_0x3f8b36[_0x78a3b1(0x163)]&&_0x191b70[_0x78a3b1(0x163)]!==_0x3f8b36[_0x78a3b1(0x163)]);if(!_0x5f57a2['bool'](_0x78a3b1(0x145))&&_0x191b70&&_0x191b70[_0x78a3b1(0x152)]===_0x404f8f&&!_0x15c471)continue;_0x5a8032['push'](_0x3f8b36[_0x78a3b1(0x16e)]);}return{'method':_0x78a3b1(0x143),'url':_0x78a3b1(0x150),'body':{'sqlCodes':_0x5a8032,'appCode':_0x5f57a2[_0x78a3b1(0x133)]},'description':_0x78a3b1(0x164)+_0x5a8032['length']+_0x78a3b1(0x131)};},async 'execute'(_0xcded3d){const _0x358f48=a159_0x307fe6,_0x58d439=loadSqlProjectConfig(_0xcded3d[_0x358f48(0x133)]),_0x1a2480=await readSqlLockFile(_0x58d439['lockFilePath']),{lockData:_0x3ea56d,appLock:_0x2cce84}=ensureSqlLockScope(_0x1a2480??createEmptySqlLock(),_0xcded3d[_0x358f48(0x133)],_0x58d439[_0x358f48(0x170)],'push'),_0x3a0c3a=await getTargetSqlQueries(_0x58d439,_0x2cce84,_0xcded3d[_0x358f48(0x148)](_0x358f48(0x14f))||undefined);if(_0x3a0c3a[_0x358f48(0x140)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x358f48(0x162)};const _0x14fa79=[],_0x185185=[],_0x2f6e4f=[];for(const _0x16d699 of _0x3a0c3a){const _0x3b400d=_0x2cce84[_0x358f48(0x160)][_0x16d699[_0x358f48(0x16e)]];if(!_0x3b400d){_0x2f6e4f[_0x358f48(0x130)]({'sqlCode':_0x16d699[_0x358f48(0x16e)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x1e68d6=await computeSqlFileHash(_0x16d699[_0x358f48(0x161)]),_0x2d8ad1=_0x3b400d[_0x358f48(0x16c)]!==_0x16d699[_0x358f48(0x157)]||!!_0x16d699[_0x358f48(0x163)]&&_0x3b400d[_0x358f48(0x163)]!==_0x16d699['sqlName'];if(!_0xcded3d[_0x358f48(0x13e)](_0x358f48(0x145))&&_0x3b400d['hash']===_0x1e68d6&&!_0x2d8ad1){_0x185185[_0x358f48(0x130)]({'sqlCode':_0x16d699[_0x358f48(0x16e)],'reason':_0x358f48(0x13b)});continue;}if(_0x3b400d[_0x358f48(0x16a)]==null){_0x2f6e4f[_0x358f48(0x130)]({'sqlCode':_0x16d699[_0x358f48(0x16e)],'error':_0x358f48(0x14e)});continue;}const _0x4bd5e1=await readFile(_0x16d699[_0x358f48(0x161)],_0x358f48(0x151)),_0x53cb9e=stripLocalSqlMetadata(_0x4bd5e1,_0x16d699[_0x358f48(0x14c)]),_0x26411c=_0x16d699[_0x358f48(0x163)]||_0x3b400d[_0x358f48(0x163)],_0x48e559=await resolveTargetDbBinding(_0xcded3d[_0x358f48(0x133)],_0x16d699,_0x3b400d),_0x42d3fa=await updateSqlQuery({'id':_0x3b400d[_0x358f48(0x15e)],'appCode':_0xcded3d[_0x358f48(0x133)],'sqlCode':_0x16d699[_0x358f48(0x16e)],'sqlName':_0x26411c,'dbId':_0x48e559[_0x358f48(0x158)],'version':_0x3b400d[_0x358f48(0x16a)],'sqlContent':_0x53cb9e,'sqlConfig':_0x3b400d[_0x358f48(0x16f)]??undefined}),_0xed4546=_0x42d3fa[_0x358f48(0x158)]?await getDbName(_0xcded3d[_0x358f48(0x133)],Number(_0x42d3fa[_0x358f48(0x158)]))['catch'](()=>_0x48e559['dbName']):_0x48e559[_0x358f48(0x15f)];_0x2cce84[_0x358f48(0x160)][_0x16d699['sqlCode']]={...buildSqlLockEntry(_0x42d3fa,_0x53cb9e,_0x1e68d6,{'dbName':_0xed4546}),'path':_0x16d699['relativePath'],'mode':_0x3b400d[_0x358f48(0x14c)]},await archivePreviousSqlFileIfNeeded(_0x58d439,_0x3b400d[_0x358f48(0x16c)],_0x16d699[_0x358f48(0x157)]),_0x14fa79['push']({'sqlCode':_0x16d699['sqlCode'],'remoteId':_0x3b400d[_0x358f48(0x15e)]});}catch(_0x2ae0f4){_0x2f6e4f['push']({'sqlCode':_0x16d699['sqlCode'],'error':_0x2ae0f4 instanceof Error?_0x2ae0f4[_0x358f48(0x168)]:String(_0x2ae0f4)});}}return _0x2cce84[_0x358f48(0x14b)]=new Date()[_0x358f48(0x167)](),await writeSqlLockFile(_0x58d439[_0x358f48(0x172)],_0x3ea56d),{'ok':_0x2f6e4f[_0x358f48(0x140)]===0x0,'data':{'pushed':_0x14fa79,'skipped':_0x185185,'failed':_0x2f6e4f},'message':_0x358f48(0x171)+_0x14fa79[_0x358f48(0x140)]+_0x358f48(0x16b)+_0x185185[_0x358f48(0x140)]+_0x358f48(0x15c)+_0x2f6e4f[_0x358f48(0x140)]+_0x358f48(0x175)};}};function a159_0x23ec(_0x3b99f3,_0x5f071b){_0x3b99f3=_0x3b99f3-0x130;const _0x2ed62e=a159_0x2ed6();let _0x23ecc9=_0x2ed62e[_0x3b99f3];return _0x23ecc9;}async function archivePreviousSqlFileIfNeeded(_0x53b348,_0x22730b,_0x1903a7){const _0x50cdd3=a159_0x307fe6;if(!_0x22730b||_0x22730b===_0x1903a7)return;const _0x440206=join(_0x53b348['sqlRootDir'],_0x22730b);if(!await fileExists(_0x440206))return;const _0x58eb13=await moveToTrash(_0x53b348[_0x50cdd3(0x16d)],_0x53b348[_0x50cdd3(0x13c)],_0x440206);await cleanupEmptyDirectories(dirname(_0x440206),_0x53b348['sqlRootDir']),void _0x58eb13;}async function moveToTrash(_0x4d9340,_0x450aaa,_0x3e4ac3){const _0x5b28e8=a159_0x307fe6,_0xa92a3a=new Date()[_0x5b28e8(0x167)]()[_0x5b28e8(0x138)](/[:.]/g,'-'),_0x425174=relative(_0x4d9340,_0x3e4ac3),_0x4b4aba=join(_0x450aaa,_0xa92a3a,_0x425174);return await mkdir(dirname(_0x4b4aba),{'recursive':!![]}),await rename(_0x3e4ac3,_0x4b4aba),_0x4b4aba;}async function cleanupEmptyDirectories(_0x14c1af,_0x45d015){const _0x5e361c=a159_0x307fe6;let _0x38ae51=resolve(_0x14c1af);const _0x528c1f=resolve(_0x45d015);while(_0x38ae51[_0x5e361c(0x173)](''+_0x528c1f+sep)||_0x38ae51===_0x528c1f){if(_0x38ae51===_0x528c1f)return;try{const _0x29e379=await readdir(_0x38ae51);if(_0x29e379[_0x5e361c(0x140)]>0x0)return;await rmdir(_0x38ae51);}catch{return;}_0x38ae51=dirname(_0x38ae51);}}async function resolveTargetDbBinding(_0x52473e,_0x11f61e,_0x121790){const _0x119c93=a159_0x307fe6,_0x2522e3=_0x11f61e[_0x119c93(0x156)];if(!_0x2522e3)return{'dbId':_0x121790[_0x119c93(0x158)],'dbName':_0x121790['dbName']};const _0x529e1d=buildDbDirectoryName(_0x121790[_0x119c93(0x15f)],_0x121790['dbId']);if(_0x2522e3===_0x529e1d)return{'dbId':_0x121790[_0x119c93(0x158)],'dbName':_0x121790['dbName']};const _0x3d0234=parseExplicitDbDirectory(_0x2522e3);if(_0x3d0234!=null)return{'dbId':_0x3d0234,'dbName':await getDbName(_0x52473e,_0x3d0234)[_0x119c93(0x13f)](()=>undefined)};const _0x3eb38e=await listDatabases(_0x52473e),_0x100567=_0x3eb38e[_0x119c93(0x141)](_0x6b5aaa=>buildDbDirectoryName(_0x6b5aaa[_0x119c93(0x15f)],_0x6b5aaa['dbId'])===_0x2522e3);if(_0x100567[_0x119c93(0x140)]===0x1)return{'dbId':_0x100567[0x0][_0x119c93(0x158)],'dbName':_0x100567[0x0]['dbName']};if(_0x100567[_0x119c93(0x140)]===0x0)throw CliErrors[_0x119c93(0x137)](_0x119c93(0x169)+_0x2522e3+_0x119c93(0x142)+_0x11f61e['sqlCode']+'.');const _0x1b2eaf=_0x100567['map'](_0x4946f1=>_0x4946f1[_0x119c93(0x15f)]+'\x20('+_0x4946f1['dbId']+')')['join'](',\x20');throw CliErrors[_0x119c93(0x137)](_0x119c93(0x155)+_0x2522e3+_0x119c93(0x146)+_0x11f61e[_0x119c93(0x16e)]+':\x20'+_0x1b2eaf);}function parseExplicitDbDirectory(_0x57e14f){const _0x33e5c9=a159_0x307fe6,_0xbf6198=/^db-(\d+)$/[_0x33e5c9(0x132)](_0x57e14f);if(!_0xbf6198)return null;const _0x13b492=Number(_0xbf6198[0x1]);return Number[_0x33e5c9(0x165)](_0x13b492)&&_0x13b492>0x0?_0x13b492:null;}function a159_0x2ed6(){const _0x17699f=['bool','catch','length','filter','\x22\x20for\x20sqlCode\x20','POST','4405536uNiSjN','force','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','str','993498XrDYsq','high-risk-write','lastSync','mode','has','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sqlcode','/smartapi/custom/updateUserCustomSql','utf8','hash','380VMkMwb','get','Local\x20directory\x20\x22','dbDirectory','relativePath','dbId','1207094Ecimde','1165734JJPDQW','32070ESwNDU','\x20skipped,\x20','177isAOJQ','remoteId','dbName','sqls','filePath','No\x20local\x20SQL\x20files\x20found.','sqlName','Would\x20push\x20','isFinite','sql','toISOString','message','No\x20database\x20matches\x20local\x20directory\x20\x22','version','\x20pushed,\x20','path','projectRoot','sqlCode','sqlConfig','sqlRoot','Push\x20complete:\x20','lockFilePath','startsWith','Push\x20local\x20SQL\x20files\x20to\x20remote','\x20failed','push','\x20SQL\x20file(s)','exec','appCode','70ZFsCiw','boolean','entries','validation','replace','2650464tZudoY','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','unchanged','trashDir','32135gRisPz'];a159_0x2ed6=function(){return _0x17699f;};return a159_0x2ed6();}
1
+ const a161_0x13e976=a161_0x396c;function a161_0x396c(_0x51d1c2,_0x1af4da){_0x51d1c2=_0x51d1c2-0x115;const _0x4eb99e=a161_0x4eb9();let _0x396cfe=_0x4eb99e[_0x51d1c2];return _0x396cfe;}(function(_0x32ec68,_0x401e70){const _0x182304=a161_0x396c,_0x3292ec=_0x32ec68();while(!![]){try{const _0x2ab1c1=-parseInt(_0x182304(0x12e))/0x1+parseInt(_0x182304(0x155))/0x2*(-parseInt(_0x182304(0x115))/0x3)+-parseInt(_0x182304(0x119))/0x4+-parseInt(_0x182304(0x151))/0x5+parseInt(_0x182304(0x134))/0x6+parseInt(_0x182304(0x14e))/0x7+parseInt(_0x182304(0x11b))/0x8;if(_0x2ab1c1===_0x401e70)break;else _0x3292ec['push'](_0x3292ec['shift']());}catch(_0x438454){_0x3292ec['push'](_0x3292ec['shift']());}}}(a161_0x4eb9,0x811a9));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x4d2487,_0x30547d,_0x4a2b80){const _0x519dd5=a161_0x396c,_0x3f31c2=await scanLocalSqlQueries(_0x4d2487),_0x306505=new Map();for(const _0x241067 of _0x3f31c2){if(_0x4a2b80&&_0x241067[_0x519dd5(0x140)]!==_0x4a2b80)continue;const _0x2c4b60=_0x306505[_0x519dd5(0x13f)](_0x241067[_0x519dd5(0x140)])??[];_0x2c4b60[_0x519dd5(0x157)](_0x241067),_0x306505[_0x519dd5(0x13b)](_0x241067[_0x519dd5(0x140)],_0x2c4b60);}if(_0x4a2b80&&!_0x306505[_0x519dd5(0x137)](_0x4a2b80))throw CliErrors['validation'](_0x519dd5(0x147)+_0x4a2b80);const _0x811500=[];for(const [_0x506fb5,_0x430315]of _0x306505['entries']()){if(_0x430315[_0x519dd5(0x13e)]===0x1){_0x811500[_0x519dd5(0x157)](_0x430315[0x0]);continue;}const _0x114b3f=_0x30547d[_0x519dd5(0x123)][_0x506fb5],_0x220cfb=_0x114b3f?.[_0x519dd5(0x118)],_0x171f55=_0x220cfb?_0x430315[_0x519dd5(0x13c)](_0x13c6f1=>_0x13c6f1[_0x519dd5(0x142)]!==_0x220cfb):_0x430315;if(_0x114b3f&&_0x171f55['length']===0x1){_0x811500['push'](_0x171f55[0x0]);continue;}throw CliErrors[_0x519dd5(0x122)](_0x519dd5(0x131)+_0x506fb5+_0x519dd5(0x14b));}return _0x811500;}export const sqlPush={'service':a161_0x13e976(0x11c),'command':a161_0x13e976(0x157),'description':a161_0x13e976(0x11f),'risk':a161_0x13e976(0x136),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a161_0x13e976(0x124),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x7ce4a){const _0x420bed=a161_0x13e976,_0x5ab882=loadSqlProjectConfig(_0x7ce4a[_0x420bed(0x12d)]),_0x3c9e29=await readSqlLockFile(_0x5ab882['lockFilePath']),{appLock:_0x15713e}=ensureSqlLockScope(_0x3c9e29??createEmptySqlLock(),_0x7ce4a[_0x420bed(0x12d)],_0x5ab882[_0x420bed(0x143)],_0x420bed(0x157)),_0x521388=await getTargetSqlQueries(_0x5ab882,_0x15713e,_0x7ce4a[_0x420bed(0x128)](_0x420bed(0x150))||undefined),_0x511fa6=[];for(const _0x42abe0 of _0x521388){const _0x126075=await computeSqlFileHash(_0x42abe0[_0x420bed(0x125)]),_0x4f1abf=_0x15713e[_0x420bed(0x123)][_0x42abe0[_0x420bed(0x140)]],_0x4cd2e7=!!_0x4f1abf&&(_0x4f1abf[_0x420bed(0x118)]!==_0x42abe0[_0x420bed(0x142)]||!!_0x42abe0[_0x420bed(0x120)]&&_0x4f1abf[_0x420bed(0x120)]!==_0x42abe0[_0x420bed(0x120)]);if(!_0x7ce4a[_0x420bed(0x146)](_0x420bed(0x117))&&_0x4f1abf&&_0x4f1abf[_0x420bed(0x133)]===_0x126075&&!_0x4cd2e7)continue;_0x511fa6['push'](_0x42abe0[_0x420bed(0x140)]);}return{'method':_0x420bed(0x11a),'url':_0x420bed(0x11e),'body':{'sqlCodes':_0x511fa6,'appCode':_0x7ce4a['appCode']},'description':_0x420bed(0x138)+_0x511fa6[_0x420bed(0x13e)]+_0x420bed(0x149)};},async 'execute'(_0x3887bd){const _0xe8394d=a161_0x13e976,_0x11a2dc=loadSqlProjectConfig(_0x3887bd[_0xe8394d(0x12d)]),_0x552b78=await readSqlLockFile(_0x11a2dc[_0xe8394d(0x132)]),{lockData:_0x1dcc3f,appLock:_0x329194}=ensureSqlLockScope(_0x552b78??createEmptySqlLock(),_0x3887bd[_0xe8394d(0x12d)],_0x11a2dc[_0xe8394d(0x143)],_0xe8394d(0x157)),_0x232f8e=await getTargetSqlQueries(_0x11a2dc,_0x329194,_0x3887bd[_0xe8394d(0x128)](_0xe8394d(0x150))||undefined);if(_0x232f8e[_0xe8394d(0x13e)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xe8394d(0x12f)};const _0x5a8bbf=[],_0x223dab=[],_0x4406c3=[];for(const _0x262221 of _0x232f8e){const _0x4a03a1=_0x329194[_0xe8394d(0x123)][_0x262221[_0xe8394d(0x140)]];if(!_0x4a03a1){_0x4406c3['push']({'sqlCode':_0x262221[_0xe8394d(0x140)],'error':_0xe8394d(0x13a)});continue;}try{const _0x180543=await computeSqlFileHash(_0x262221[_0xe8394d(0x125)]),_0x36718a=_0x4a03a1['path']!==_0x262221[_0xe8394d(0x142)]||!!_0x262221['sqlName']&&_0x4a03a1[_0xe8394d(0x120)]!==_0x262221[_0xe8394d(0x120)];if(!_0x3887bd[_0xe8394d(0x146)](_0xe8394d(0x117))&&_0x4a03a1[_0xe8394d(0x133)]===_0x180543&&!_0x36718a){_0x223dab[_0xe8394d(0x157)]({'sqlCode':_0x262221[_0xe8394d(0x140)],'reason':_0xe8394d(0x12c)});continue;}if(_0x4a03a1['version']==null){_0x4406c3[_0xe8394d(0x157)]({'sqlCode':_0x262221['sqlCode'],'error':_0xe8394d(0x12a)});continue;}const _0x5287f0=await readFile(_0x262221[_0xe8394d(0x125)],_0xe8394d(0x129)),_0x2d8b35=stripLocalSqlMetadata(_0x5287f0,_0x262221[_0xe8394d(0x141)]),_0x295199=_0x262221[_0xe8394d(0x120)]||_0x4a03a1['sqlName'],_0x1f888c=await resolveTargetDbBinding(_0x3887bd[_0xe8394d(0x12d)],_0x262221,_0x4a03a1),_0x111247=await updateSqlQuery({'id':_0x4a03a1[_0xe8394d(0x153)],'appCode':_0x3887bd[_0xe8394d(0x12d)],'sqlCode':_0x262221[_0xe8394d(0x140)],'sqlName':_0x295199,'dbId':_0x1f888c['dbId'],'version':_0x4a03a1[_0xe8394d(0x13d)],'sqlContent':_0x2d8b35,'sqlConfig':_0x4a03a1[_0xe8394d(0x152)]??undefined}),_0x573063=_0x111247[_0xe8394d(0x11d)]?await getDbName(_0x3887bd['appCode'],Number(_0x111247[_0xe8394d(0x11d)]))['catch'](()=>_0x1f888c['dbName']):_0x1f888c['dbName'];_0x329194[_0xe8394d(0x123)][_0x262221[_0xe8394d(0x140)]]={...buildSqlLockEntry(_0x111247,_0x2d8b35,_0x180543,{'dbName':_0x573063}),'path':_0x262221['relativePath'],'mode':_0x4a03a1[_0xe8394d(0x141)]},await archivePreviousSqlFileIfNeeded(_0x11a2dc,_0x4a03a1[_0xe8394d(0x118)],_0x262221[_0xe8394d(0x142)]),_0x5a8bbf['push']({'sqlCode':_0x262221['sqlCode'],'remoteId':_0x4a03a1[_0xe8394d(0x153)]});}catch(_0x5ea935){_0x4406c3[_0xe8394d(0x157)]({'sqlCode':_0x262221[_0xe8394d(0x140)],'error':_0x5ea935 instanceof Error?_0x5ea935[_0xe8394d(0x116)]:String(_0x5ea935)});}}return _0x329194[_0xe8394d(0x12b)]=new Date()[_0xe8394d(0x144)](),await writeSqlLockFile(_0x11a2dc[_0xe8394d(0x132)],_0x1dcc3f),{'ok':_0x4406c3['length']===0x0,'data':{'pushed':_0x5a8bbf,'skipped':_0x223dab,'failed':_0x4406c3},'message':_0xe8394d(0x145)+_0x5a8bbf[_0xe8394d(0x13e)]+_0xe8394d(0x135)+_0x223dab[_0xe8394d(0x13e)]+'\x20skipped,\x20'+_0x4406c3[_0xe8394d(0x13e)]+_0xe8394d(0x148)};}};async function archivePreviousSqlFileIfNeeded(_0x4546ef,_0x3f4094,_0x4ea82c){const _0x3078a7=a161_0x13e976;if(!_0x3f4094||_0x3f4094===_0x4ea82c)return;const _0x51ef1c=join(_0x4546ef['sqlRootDir'],_0x3f4094);if(!await fileExists(_0x51ef1c))return;const _0x222822=await moveToTrash(_0x4546ef['projectRoot'],_0x4546ef[_0x3078a7(0x14d)],_0x51ef1c);await cleanupEmptyDirectories(dirname(_0x51ef1c),_0x4546ef[_0x3078a7(0x121)]),void _0x222822;}async function moveToTrash(_0x4f1601,_0x1a8079,_0x5c8a8b){const _0x4700a5=a161_0x13e976,_0x35bc04=new Date()[_0x4700a5(0x144)]()['replace'](/[:.]/g,'-'),_0x2d7bb1=relative(_0x4f1601,_0x5c8a8b),_0x32e020=join(_0x1a8079,_0x35bc04,_0x2d7bb1);return await mkdir(dirname(_0x32e020),{'recursive':!![]}),await rename(_0x5c8a8b,_0x32e020),_0x32e020;}async function cleanupEmptyDirectories(_0x51cd64,_0x282eb4){const _0x583c44=a161_0x13e976;let _0x6759fe=resolve(_0x51cd64);const _0x558385=resolve(_0x282eb4);while(_0x6759fe[_0x583c44(0x139)](''+_0x558385+sep)||_0x6759fe===_0x558385){if(_0x6759fe===_0x558385)return;try{const _0x3ff3d8=await readdir(_0x6759fe);if(_0x3ff3d8['length']>0x0)return;await rmdir(_0x6759fe);}catch{return;}_0x6759fe=dirname(_0x6759fe);}}function a161_0x4eb9(){const _0x14d99f=['catch','str','utf8','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','lastSync','unchanged','appCode','452842uAnIBG','No\x20local\x20SQL\x20files\x20found.','No\x20database\x20matches\x20local\x20directory\x20\x22','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','lockFilePath','hash','5325714Qinfnv','\x20pushed,\x20','high-risk-write','has','Would\x20push\x20','startsWith','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','set','filter','version','length','get','sqlCode','mode','relativePath','sqlRoot','toISOString','Push\x20complete:\x20','bool','Local\x20SQL\x20not\x20found:\x20','\x20failed','\x20SQL\x20file(s)','\x22\x20for\x20sqlCode\x20','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','isFinite','trashDir','3248777rzndpo','join','sqlcode','926710QBEDCG','sqlConfig','remoteId','dbName','7526BgzESH','map','push','dbDirectory','699ecGcQX','message','force','path','1789788LZqBPh','POST','9115912XcUUvd','sql','dbId','/smartapi/custom/updateUserCustomSql','Push\x20local\x20SQL\x20files\x20to\x20remote','sqlName','sqlRootDir','validation','sqls','boolean','filePath','exec'];a161_0x4eb9=function(){return _0x14d99f;};return a161_0x4eb9();}async function resolveTargetDbBinding(_0xac1150,_0x47c1b6,_0x4338e2){const _0x57f44e=a161_0x13e976,_0x248220=_0x47c1b6[_0x57f44e(0x158)];if(!_0x248220)return{'dbId':_0x4338e2[_0x57f44e(0x11d)],'dbName':_0x4338e2[_0x57f44e(0x154)]};const _0x30604=buildDbDirectoryName(_0x4338e2[_0x57f44e(0x154)],_0x4338e2['dbId']);if(_0x248220===_0x30604)return{'dbId':_0x4338e2[_0x57f44e(0x11d)],'dbName':_0x4338e2['dbName']};const _0x4de272=parseExplicitDbDirectory(_0x248220);if(_0x4de272!=null)return{'dbId':_0x4de272,'dbName':await getDbName(_0xac1150,_0x4de272)[_0x57f44e(0x127)](()=>undefined)};const _0x1c7342=await listDatabases(_0xac1150),_0xe68b49=_0x1c7342[_0x57f44e(0x13c)](_0x1e24ed=>buildDbDirectoryName(_0x1e24ed[_0x57f44e(0x154)],_0x1e24ed[_0x57f44e(0x11d)])===_0x248220);if(_0xe68b49[_0x57f44e(0x13e)]===0x1)return{'dbId':_0xe68b49[0x0][_0x57f44e(0x11d)],'dbName':_0xe68b49[0x0][_0x57f44e(0x154)]};if(_0xe68b49[_0x57f44e(0x13e)]===0x0)throw CliErrors[_0x57f44e(0x122)](_0x57f44e(0x130)+_0x248220+_0x57f44e(0x14a)+_0x47c1b6['sqlCode']+'.');const _0x17f0c4=_0xe68b49[_0x57f44e(0x156)](_0x17856f=>_0x17856f['dbName']+'\x20('+_0x17856f[_0x57f44e(0x11d)]+')')[_0x57f44e(0x14f)](',\x20');throw CliErrors[_0x57f44e(0x122)]('Local\x20directory\x20\x22'+_0x248220+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x47c1b6[_0x57f44e(0x140)]+':\x20'+_0x17f0c4);}function parseExplicitDbDirectory(_0x31e49f){const _0x4e629c=a161_0x13e976,_0x208261=/^db-(\d+)$/[_0x4e629c(0x126)](_0x31e49f);if(!_0x208261)return null;const _0x2ac872=Number(_0x208261[0x1]);return Number[_0x4e629c(0x14c)](_0x2ac872)&&_0x2ac872>0x0?_0x2ac872:null;}
@@ -1 +1 @@
1
- const a160_0x465185=a160_0x181f;(function(_0x18f98a,_0x2383c4){const _0x2c7314=a160_0x181f,_0x19d5a9=_0x18f98a();while(!![]){try{const _0x2fe10a=-parseInt(_0x2c7314(0xc8))/0x1+-parseInt(_0x2c7314(0xc9))/0x2+parseInt(_0x2c7314(0xbc))/0x3*(parseInt(_0x2c7314(0xc1))/0x4)+parseInt(_0x2c7314(0xcc))/0x5+parseInt(_0x2c7314(0xbd))/0x6*(-parseInt(_0x2c7314(0xc2))/0x7)+-parseInt(_0x2c7314(0xc3))/0x8*(-parseInt(_0x2c7314(0xc0))/0x9)+-parseInt(_0x2c7314(0xcf))/0xa;if(_0x2fe10a===_0x2383c4)break;else _0x19d5a9['push'](_0x19d5a9['shift']());}catch(_0x192003){_0x19d5a9['push'](_0x19d5a9['shift']());}}}(a160_0x1dcd,0x2ef87));import{CliErrors}from'../../errors.js';function a160_0x181f(_0x29c965,_0x459bc2){_0x29c965=_0x29c965-0xbb;const _0x1dcd1a=a160_0x1dcd();let _0x181f20=_0x1dcd1a[_0x29c965];return _0x181f20;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a160_0x465185(0xc5),a160_0x465185(0xbb),a160_0x465185(0xca)][a160_0x465185(0xbf)]('\x0a');function a160_0x1dcd(){const _0x48c676=['1348290KHxdyF','write','sqlname','799670QchhqF','file','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','383871mPaBJQ','572526DeDgBe','validation','join','36AzIBAx','12YlYKlA','21GUbVHC','389320ytuTID','save','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','Path\x20to\x20the\x20SQL\x20file','string','196227SmqSWv','186682QvuBnk','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`.','sql'];a160_0x1dcd=function(){return _0x48c676;};return a160_0x1dcd();}export const sqlSave={'service':a160_0x465185(0xcb),'command':a160_0x465185(0xc4),'description':'Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','risk':a160_0x465185(0xcd),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a160_0x465185(0xd0),'type':a160_0x465185(0xc7),'required':!![],'description':a160_0x465185(0xc6)},SQLCODE_FLAG_OPTIONAL,{'name':a160_0x465185(0xce),'type':a160_0x465185(0xc7),'description':'SQL\x20query\x20display\x20name'},{'name':'db','type':a160_0x465185(0xc7),'description':a160_0x465185(0xd1)},{'name':'description','type':a160_0x465185(0xc7),'description':'Query\x20description'}],async 'validate'(){const _0x2d4cbe=a160_0x465185;throw CliErrors[_0x2d4cbe(0xbe)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x3a843d=a160_0x465185;throw CliErrors[_0x3a843d(0xbe)](SQL_SAVE_DEPRECATED_HINT);}};
1
+ const a162_0x27ddac=a162_0x9277;function a162_0x9277(_0x5275d1,_0x3982dd){_0x5275d1=_0x5275d1-0x176;const _0x5d0bb2=a162_0x5d0b();let _0x927701=_0x5d0bb2[_0x5275d1];return _0x927701;}(function(_0x1b4ad5,_0x3a5705){const _0x54c21f=a162_0x9277,_0x18c70e=_0x1b4ad5();while(!![]){try{const _0x14fc9a=-parseInt(_0x54c21f(0x177))/0x1+parseInt(_0x54c21f(0x17f))/0x2*(-parseInt(_0x54c21f(0x184))/0x3)+-parseInt(_0x54c21f(0x176))/0x4+parseInt(_0x54c21f(0x17c))/0x5+-parseInt(_0x54c21f(0x180))/0x6*(parseInt(_0x54c21f(0x179))/0x7)+-parseInt(_0x54c21f(0x188))/0x8+-parseInt(_0x54c21f(0x186))/0x9*(-parseInt(_0x54c21f(0x17e))/0xa);if(_0x14fc9a===_0x3a5705)break;else _0x18c70e['push'](_0x18c70e['shift']());}catch(_0x21c3bd){_0x18c70e['push'](_0x18c70e['shift']());}}}(a162_0x5d0b,0x8edad));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=['`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.',a162_0x27ddac(0x178),a162_0x27ddac(0x17a)][a162_0x27ddac(0x17d)]('\x0a');function a162_0x5d0b(){const _0x51c7c3=['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`.','sqlname','2202030pEDPWG','join','300qRBFPS','1147574tvtuKr','6UJozvs','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','string','description','3uqwgan','file','662049RKXXvd','validation','5339208qYAkuB','Path\x20to\x20the\x20SQL\x20file','save','sql','110872FsQLZv','341407IXgLBT','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','3162530NnNoLw'];a162_0x5d0b=function(){return _0x51c7c3;};return a162_0x5d0b();}export const sqlSave={'service':a162_0x27ddac(0x18b),'command':a162_0x27ddac(0x18a),'description':a162_0x27ddac(0x181),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a162_0x27ddac(0x185),'type':a162_0x27ddac(0x182),'required':!![],'description':a162_0x27ddac(0x189)},SQLCODE_FLAG_OPTIONAL,{'name':a162_0x27ddac(0x17b),'type':a162_0x27ddac(0x182),'description':'SQL\x20query\x20display\x20name'},{'name':'db','type':a162_0x27ddac(0x182),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':a162_0x27ddac(0x183),'type':a162_0x27ddac(0x182),'description':'Query\x20description'}],async 'validate'(){const _0x1bc6e7=a162_0x27ddac;throw CliErrors[_0x1bc6e7(0x187)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x15ad7f=a162_0x27ddac;throw CliErrors[_0x15ad7f(0x187)](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- const a161_0x5b0a3f=a161_0x1283;(function(_0x1877da,_0x22c7f0){const _0x364af3=a161_0x1283,_0x3f5e74=_0x1877da();while(!![]){try{const _0x243138=parseInt(_0x364af3(0xcb))/0x1*(-parseInt(_0x364af3(0xc4))/0x2)+-parseInt(_0x364af3(0xc3))/0x3*(parseInt(_0x364af3(0xbe))/0x4)+parseInt(_0x364af3(0xd1))/0x5+parseInt(_0x364af3(0xcd))/0x6+-parseInt(_0x364af3(0xb5))/0x7+parseInt(_0x364af3(0xcc))/0x8*(-parseInt(_0x364af3(0xc9))/0x9)+parseInt(_0x364af3(0xaa))/0xa*(parseInt(_0x364af3(0xc0))/0xb);if(_0x243138===_0x22c7f0)break;else _0x3f5e74['push'](_0x3f5e74['shift']());}catch(_0x2a50c5){_0x3f5e74['push'](_0x3f5e74['shift']());}}}(a161_0x3827,0x88a74));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';function a161_0x1283(_0xca0b20,_0x3da5a0){_0xca0b20=_0xca0b20-0xa7;const _0x38271f=a161_0x3827();let _0x128326=_0x38271f[_0xca0b20];return _0x128326;}export const SQL_LOCAL_REL_DIR=a161_0x5b0a3f(0xb1);export function buildSqlLockEntry(_0x51a0f7,_0x5074e4,_0x1ffad0,_0x4c3a42){const _0x4db765=a161_0x5b0a3f,_0x43d497=detectSqlMode(_0x5074e4);return{'path':buildSqlRelativePath(_0x51a0f7[_0x4db765(0xbf)],_0x51a0f7['sqlName'],_0x4c3a42?.[_0x4db765(0xb3)],_0x43d497,_0x51a0f7[_0x4db765(0xb0)]),'hash':_0x1ffad0,'remoteId':_0x51a0f7['id'],'version':_0x51a0f7[_0x4db765(0xbd)],'dbId':Number(_0x51a0f7[_0x4db765(0xb0)]),'dbName':_0x4c3a42?.[_0x4db765(0xb3)],'sqlName':_0x51a0f7[_0x4db765(0xbc)],'sqlConfig':_0x51a0f7['sqlConfig']??undefined,'mode':_0x43d497};}export function cloneSqlLockData(_0x2873c8){const _0x529bf8=a161_0x5b0a3f;return{'apps':Object['fromEntries'](Object[_0x529bf8(0xb9)](_0x2873c8[_0x529bf8(0xb6)])[_0x529bf8(0xad)](([_0x52c209,_0x379630])=>[_0x52c209,{'sqlRoot':_0x379630['sqlRoot'],'lastSync':_0x379630[_0x529bf8(0xab)],'sqls':{..._0x379630[_0x529bf8(0xb7)]}}]))};}export function ensureRemoteSqlContent(_0x2f2e23){return _0x2f2e23['sqlContent']??'';}export function buildLocalSqlFileContent(_0x11276e,_0x2a9dc3,_0x597dbe){const _0x2a2ca2=a161_0x5b0a3f,_0x526273=_0x597dbe?.[_0x2a2ca2(0xb4)]??detectSqlMode(_0x2a9dc3),_0x234353=stripLocalSqlMetadata(_0x2a9dc3,_0x526273)['trim'](),_0x53ff17=[...buildMetadataHeaderLines({'sqlCode':_0x11276e[_0x2a2ca2(0xbf)],'sqlName':_0x11276e[_0x2a2ca2(0xbc)],'dbId':_0x11276e['dbId'],'dbName':_0x597dbe?.[_0x2a2ca2(0xb3)],'mode':_0x526273,'syncedAt':_0x597dbe?.[_0x2a2ca2(0xcf)],'description':_0x597dbe?.[_0x2a2ca2(0xc8)]},_0x526273),'',_0x234353],_0x306028=_0x53ff17[_0x2a2ca2(0xc6)]('\x0a');return _0x306028['endsWith']('\x0a')?_0x306028:_0x306028+'\x0a';}export function stripLocalSqlMetadata(_0x58e8da,_0x8c47c4){const _0x1e1dd1=a161_0x5b0a3f,_0x3b5ba5=_0x58e8da[_0x1e1dd1(0xc1)](/\r\n/g,'\x0a')[_0x1e1dd1(0xae)]('\x0a'),_0x1a4513=[];let _0x4a484d=0x0;if(_0x8c47c4==='mybatisXml')while(_0x4a484d<_0x3b5ba5[_0x1e1dd1(0xd0)]){const _0x927888=_0x3b5ba5[_0x4a484d]??'';if(/^\s*<!--\s*@lovrabet\./[_0x1e1dd1(0xb8)](_0x927888)){_0x4a484d++;continue;}if(_0x927888[_0x1e1dd1(0xa7)]()===''&&_0x4a484d>0x0){_0x4a484d++;continue;}break;}else while(_0x4a484d<_0x3b5ba5[_0x1e1dd1(0xd0)]){const _0x268695=_0x3b5ba5[_0x4a484d]??'';if(/^\s*--\s*@lovrabet\./[_0x1e1dd1(0xb8)](_0x268695)){_0x4a484d++;continue;}if(_0x268695[_0x1e1dd1(0xa7)]()===''&&_0x4a484d>0x0){_0x4a484d++;continue;}break;}for(;_0x4a484d<_0x3b5ba5['length'];_0x4a484d++){_0x1a4513[_0x1e1dd1(0xac)](_0x3b5ba5[_0x4a484d]);}return _0x1a4513['join']('\x0a')[_0x1e1dd1(0xc5)]();}export function resolveSqlMode(_0x198d60,_0xc9bb53){const _0x3dd8bc=a161_0x5b0a3f;if(_0xc9bb53?.[_0x3dd8bc(0xb4)])return _0xc9bb53[_0x3dd8bc(0xb4)];return detectSqlMode(_0x198d60);}function a161_0x3827(){const _0x1711c9=['trimStart','join','stderr','description','261vGyVbw','toLowerCase','2Kwhfvv','303320hWenCC','5263380cfCVCn','includes','syncedAt','length','4575930rghHaL','<!--\x20@lovrabet.','trim','path','\x20-->','13112470jVkHhr','lastSync','push','map','split','question','dbId','.rabetbase/sql','yes','dbName','mode','5991930lnrWpL','apps','sqls','test','entries','close','filter','sqlName','version','2776BInxdJ','sqlCode','11BkoUVP','replace','--\x20@lovrabet.','1941ZbLFtm','139388RnNMIB'];a161_0x3827=function(){return _0x1711c9;};return a161_0x3827();}export function resolveSqlFileName(_0x67de37,_0x22436c,_0x5a99bd){const _0x3b1350=a161_0x5b0a3f;if(_0x5a99bd?.[_0x3b1350(0xa8)])return _0x5a99bd['path'];if(_0x5a99bd?.[_0x3b1350(0xbc)]||_0x5a99bd?.[_0x3b1350(0xb3)])return buildSqlRelativePath(_0x67de37,_0x5a99bd?.['sqlName'],_0x5a99bd?.[_0x3b1350(0xb3)],resolveSqlMode(_0x22436c,_0x5a99bd),_0x5a99bd?.[_0x3b1350(0xb0)]);return buildDefaultSqlFileName(_0x67de37,resolveSqlMode(_0x22436c,_0x5a99bd));}export function resolveSqlLocalDir(_0x48592a,_0x55fd90){return join(_0x48592a,SQL_LOCAL_REL_DIR,_0x55fd90);}export async function confirmForceOverwrite(_0x163d5d){const _0x4d004b=a161_0x5b0a3f,_0x253797=createInterface({'input':process['stdin'],'output':process[_0x4d004b(0xc7)]}),_0xe5822b=await new Promise(_0x232571=>{const _0x280352=_0x4d004b;_0x253797[_0x280352(0xaf)](_0x163d5d+'\x20[y/N]\x20',_0x232571);});return _0x253797[_0x4d004b(0xba)](),['y',_0x4d004b(0xb2)][_0x4d004b(0xce)](_0xe5822b[_0x4d004b(0xa7)]()[_0x4d004b(0xca)]());}export function findSqlLockScope(_0x4776e1,_0x530c52){return _0x4776e1['apps'][_0x530c52];}function buildMetadataHeaderLines(_0x5cc80d,_0x32c04b){const _0x3e4165=a161_0x5b0a3f,_0x37ebd4=[[_0x3e4165(0xbf),_0x5cc80d[_0x3e4165(0xbf)]],[_0x3e4165(0xbc),_0x5cc80d[_0x3e4165(0xbc)]],[_0x3e4165(0xb0),_0x5cc80d[_0x3e4165(0xb0)]],[_0x3e4165(0xb3),_0x5cc80d[_0x3e4165(0xb3)]],[_0x3e4165(0xb4),_0x5cc80d[_0x3e4165(0xb4)]],[_0x3e4165(0xcf),_0x5cc80d[_0x3e4165(0xcf)]],['description',_0x5cc80d[_0x3e4165(0xc8)]]];if(_0x32c04b==='mybatisXml')return _0x37ebd4[_0x3e4165(0xbb)](([,_0x462136])=>_0x462136!==undefined&&_0x462136!==null&&String(_0x462136)['trim']()!=='')[_0x3e4165(0xad)](([_0x163239,_0x6ecf8d])=>_0x3e4165(0xd2)+_0x163239+':\x20'+String(_0x6ecf8d)+_0x3e4165(0xa9));return _0x37ebd4['filter'](([,_0x5061f3])=>_0x5061f3!==undefined&&_0x5061f3!==null&&String(_0x5061f3)['trim']()!=='')['map'](([_0x3a49b5,_0x4d89a9])=>_0x3e4165(0xc2)+_0x3a49b5+':\x20'+String(_0x4d89a9));}
1
+ const a163_0x37e93d=a163_0x3d83;(function(_0x37d41e,_0x42544c){const _0x3774b1=a163_0x3d83,_0x5b4687=_0x37d41e();while(!![]){try{const _0x411ab6=parseInt(_0x3774b1(0x1cf))/0x1*(-parseInt(_0x3774b1(0x1e3))/0x2)+-parseInt(_0x3774b1(0x1e2))/0x3+-parseInt(_0x3774b1(0x1c4))/0x4+-parseInt(_0x3774b1(0x1ea))/0x5*(-parseInt(_0x3774b1(0x1dc))/0x6)+-parseInt(_0x3774b1(0x1d8))/0x7+parseInt(_0x3774b1(0x1df))/0x8*(-parseInt(_0x3774b1(0x1c6))/0x9)+-parseInt(_0x3774b1(0x1d6))/0xa*(-parseInt(_0x3774b1(0x1d0))/0xb);if(_0x411ab6===_0x42544c)break;else _0x5b4687['push'](_0x5b4687['shift']());}catch(_0x4cfecd){_0x5b4687['push'](_0x5b4687['shift']());}}}(a163_0x1963,0xb67b4));import{createInterface}from'node:readline';function a163_0x1963(){const _0x5b609e=['1033080JeFdaf','toLowerCase','sqlName','1887591FMbYGA','710FdRRAV','syncedAt','stderr','yes','entries','lastSync','dbId','5IsjtvS','sqlRoot','endsWith','mode','trimStart','2218724zFDbEc','question','81ZHVEPz','\x20-->','map','fromEntries','sqlConfig','sqlContent','--\x20@lovrabet.','description','length','2381ARanRf','11SyJOmF','.rabetbase/sql','\x20[y/N]\x20','push','filter','<!--\x20@lovrabet.','37759900ShYTnY','sqlCode','2383101ImFlEX','join','test','dbName','3019470gVzaBo','trim','apps'];a163_0x1963=function(){return _0x5b609e;};return a163_0x1963();}import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a163_0x37e93d(0x1d1);function a163_0x3d83(_0x5a1a71,_0x3b0c65){_0x5a1a71=_0x5a1a71-0x1c0;const _0x1963a0=a163_0x1963();let _0x3d833c=_0x1963a0[_0x5a1a71];return _0x3d833c;}export function buildSqlLockEntry(_0x2aafba,_0x35e382,_0xed269f,_0x5d88fd){const _0x232ab0=a163_0x37e93d,_0x2ef2ca=detectSqlMode(_0x35e382);return{'path':buildSqlRelativePath(_0x2aafba[_0x232ab0(0x1d7)],_0x2aafba[_0x232ab0(0x1e1)],_0x5d88fd?.[_0x232ab0(0x1db)],_0x2ef2ca,_0x2aafba[_0x232ab0(0x1e9)]),'hash':_0xed269f,'remoteId':_0x2aafba['id'],'version':_0x2aafba['version'],'dbId':Number(_0x2aafba[_0x232ab0(0x1e9)]),'dbName':_0x5d88fd?.['dbName'],'sqlName':_0x2aafba[_0x232ab0(0x1e1)],'sqlConfig':_0x2aafba[_0x232ab0(0x1ca)]??undefined,'mode':_0x2ef2ca};}export function cloneSqlLockData(_0x61d583){const _0x534c90=a163_0x37e93d;return{'apps':Object[_0x534c90(0x1c9)](Object[_0x534c90(0x1e7)](_0x61d583[_0x534c90(0x1de)])[_0x534c90(0x1c8)](([_0xe55046,_0x5ed09d])=>[_0xe55046,{'sqlRoot':_0x5ed09d[_0x534c90(0x1c0)],'lastSync':_0x5ed09d[_0x534c90(0x1e8)],'sqls':{..._0x5ed09d['sqls']}}]))};}export function ensureRemoteSqlContent(_0x4e1953){const _0x112658=a163_0x37e93d;return _0x4e1953[_0x112658(0x1cb)]??'';}export function buildLocalSqlFileContent(_0x16e422,_0x4f3fa9,_0x51f9b0){const _0x362710=a163_0x37e93d,_0x4c649c=_0x51f9b0?.[_0x362710(0x1c2)]??detectSqlMode(_0x4f3fa9),_0x13d198=stripLocalSqlMetadata(_0x4f3fa9,_0x4c649c)[_0x362710(0x1dd)](),_0x30d4b1=[...buildMetadataHeaderLines({'sqlCode':_0x16e422['sqlCode'],'sqlName':_0x16e422[_0x362710(0x1e1)],'dbId':_0x16e422[_0x362710(0x1e9)],'dbName':_0x51f9b0?.['dbName'],'mode':_0x4c649c,'syncedAt':_0x51f9b0?.[_0x362710(0x1e4)],'description':_0x51f9b0?.[_0x362710(0x1cd)]},_0x4c649c),'',_0x13d198],_0x1f9c2a=_0x30d4b1[_0x362710(0x1d9)]('\x0a');return _0x1f9c2a[_0x362710(0x1c1)]('\x0a')?_0x1f9c2a:_0x1f9c2a+'\x0a';}export function stripLocalSqlMetadata(_0x4b8f1b,_0x57992c){const _0x42ae57=a163_0x37e93d,_0x707214=_0x4b8f1b['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x825bc=[];let _0x248797=0x0;if(_0x57992c==='mybatisXml')while(_0x248797<_0x707214['length']){const _0x3703d2=_0x707214[_0x248797]??'';if(/^\s*<!--\s*@lovrabet\./[_0x42ae57(0x1da)](_0x3703d2)){_0x248797++;continue;}if(_0x3703d2['trim']()===''&&_0x248797>0x0){_0x248797++;continue;}break;}else while(_0x248797<_0x707214[_0x42ae57(0x1ce)]){const _0x30083a=_0x707214[_0x248797]??'';if(/^\s*--\s*@lovrabet\./[_0x42ae57(0x1da)](_0x30083a)){_0x248797++;continue;}if(_0x30083a[_0x42ae57(0x1dd)]()===''&&_0x248797>0x0){_0x248797++;continue;}break;}for(;_0x248797<_0x707214[_0x42ae57(0x1ce)];_0x248797++){_0x825bc[_0x42ae57(0x1d3)](_0x707214[_0x248797]);}return _0x825bc[_0x42ae57(0x1d9)]('\x0a')[_0x42ae57(0x1c3)]();}export function resolveSqlMode(_0x4b6a7b,_0x28c096){const _0x1f2481=a163_0x37e93d;if(_0x28c096?.[_0x1f2481(0x1c2)])return _0x28c096[_0x1f2481(0x1c2)];return detectSqlMode(_0x4b6a7b);}export function resolveSqlFileName(_0x250987,_0x373128,_0x596f45){const _0x405a77=a163_0x37e93d;if(_0x596f45?.['path'])return _0x596f45['path'];if(_0x596f45?.[_0x405a77(0x1e1)]||_0x596f45?.[_0x405a77(0x1db)])return buildSqlRelativePath(_0x250987,_0x596f45?.['sqlName'],_0x596f45?.[_0x405a77(0x1db)],resolveSqlMode(_0x373128,_0x596f45),_0x596f45?.[_0x405a77(0x1e9)]);return buildDefaultSqlFileName(_0x250987,resolveSqlMode(_0x373128,_0x596f45));}export function resolveSqlLocalDir(_0x3ee810,_0x56b4ab){return join(_0x3ee810,SQL_LOCAL_REL_DIR,_0x56b4ab);}export async function confirmForceOverwrite(_0x1d85a3){const _0x4efb4e=a163_0x37e93d,_0x455b23=createInterface({'input':process['stdin'],'output':process[_0x4efb4e(0x1e5)]}),_0x313a5e=await new Promise(_0x315b4e=>{const _0x13be39=_0x4efb4e;_0x455b23[_0x13be39(0x1c5)](_0x1d85a3+_0x13be39(0x1d2),_0x315b4e);});return _0x455b23['close'](),['y',_0x4efb4e(0x1e6)]['includes'](_0x313a5e[_0x4efb4e(0x1dd)]()[_0x4efb4e(0x1e0)]());}export function findSqlLockScope(_0xbd5218,_0x2e8c76){const _0x36ef12=a163_0x37e93d;return _0xbd5218[_0x36ef12(0x1de)][_0x2e8c76];}function buildMetadataHeaderLines(_0x528cc6,_0x54a2c5){const _0x448277=a163_0x37e93d,_0x5e9445=[[_0x448277(0x1d7),_0x528cc6[_0x448277(0x1d7)]],[_0x448277(0x1e1),_0x528cc6['sqlName']],[_0x448277(0x1e9),_0x528cc6[_0x448277(0x1e9)]],[_0x448277(0x1db),_0x528cc6[_0x448277(0x1db)]],[_0x448277(0x1c2),_0x528cc6[_0x448277(0x1c2)]],[_0x448277(0x1e4),_0x528cc6['syncedAt']],[_0x448277(0x1cd),_0x528cc6['description']]];if(_0x54a2c5==='mybatisXml')return _0x5e9445[_0x448277(0x1d4)](([,_0x2548eb])=>_0x2548eb!==undefined&&_0x2548eb!==null&&String(_0x2548eb)['trim']()!=='')[_0x448277(0x1c8)](([_0x3dc3f6,_0x59f00b])=>_0x448277(0x1d5)+_0x3dc3f6+':\x20'+String(_0x59f00b)+_0x448277(0x1c7));return _0x5e9445['filter'](([,_0x1a16cf])=>_0x1a16cf!==undefined&&_0x1a16cf!==null&&String(_0x1a16cf)[_0x448277(0x1dd)]()!=='')[_0x448277(0x1c8)](([_0x5d189e,_0x2ef62f])=>_0x448277(0x1cc)+_0x5d189e+':\x20'+String(_0x2ef62f));}
@@ -1 +1 @@
1
- const a162_0x4efdcf=a162_0x4051;(function(_0x258571,_0xfd0977){const _0x593a42=a162_0x4051,_0x3aada4=_0x258571();while(!![]){try{const _0x465944=parseInt(_0x593a42(0x167))/0x1+parseInt(_0x593a42(0x151))/0x2*(-parseInt(_0x593a42(0x160))/0x3)+parseInt(_0x593a42(0x169))/0x4*(-parseInt(_0x593a42(0x154))/0x5)+-parseInt(_0x593a42(0x157))/0x6+parseInt(_0x593a42(0x163))/0x7*(-parseInt(_0x593a42(0x161))/0x8)+parseInt(_0x593a42(0x16e))/0x9+parseInt(_0x593a42(0x15e))/0xa;if(_0x465944===_0xfd0977)break;else _0x3aada4['push'](_0x3aada4['shift']());}catch(_0x1af080){_0x3aada4['push'](_0x3aada4['shift']());}}}(a162_0x5c02,0x84428));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a162_0x4051(_0x559a93,_0x498a0d){_0x559a93=_0x559a93-0x151;const _0x5c0246=a162_0x5c02();let _0x4051f4=_0x5c0246[_0x559a93];return _0x4051f4;}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';function a162_0x5c02(){const _0x5812f6=['appCode','sqls','paging','119195XERETE','sqlName','464qqdvoh','push','relativePath','remote','sqlCode','5740083adDJeV','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','\x20unchanged','map','2kQQpQL','\x20remote-only','totalCount','4835ruYuLu','boolean','has','710250DuEBeG','sql','read','hash','lockKey','length','sqlRoot','7632590molqLY','lockFilePath','2034429UAqVmb','111704yvzJIo','path','35wIQWfS'];a162_0x5c02=function(){return _0x5812f6;};return a162_0x5c02();}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(_0x120dea){const _0x42afee=a162_0x4051,_0xaf22f5=[];let _0x214d4c=0x1;while(!![]){const _0x3093be=await listSqlQueries(_0x120dea,{'currentPage':_0x214d4c,'pageSize':PAGE_SIZE}),_0x4d2d17=_0x3093be['tableData']??[];_0xaf22f5[_0x42afee(0x16a)](..._0x4d2d17['map'](_0x5d40f3=>_0x5d40f3[_0x42afee(0x16d)]));if(_0x4d2d17[_0x42afee(0x15c)]===0x0)break;const _0x45ab48=_0x3093be[_0x42afee(0x166)]?.[_0x42afee(0x153)];if(_0x45ab48!=null?_0xaf22f5[_0x42afee(0x15c)]>=_0x45ab48:_0x4d2d17[_0x42afee(0x15c)]<PAGE_SIZE)break;_0x214d4c++;}return _0xaf22f5;}export const sqlStatus={'service':a162_0x4efdcf(0x158),'command':'status','description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a162_0x4efdcf(0x159),'flags':[{'name':a162_0x4efdcf(0x16c),'type':a162_0x4efdcf(0x155),'description':a162_0x4efdcf(0x16f)}],async 'execute'(_0x573ea5){const _0x24716c=a162_0x4efdcf,_0x3b4ae3=loadSqlProjectConfig(_0x573ea5[_0x24716c(0x164)]),_0x20ea82=await readSqlLockFile(_0x3b4ae3[_0x24716c(0x15f)]),{appLock:_0x3a5dfa}=ensureSqlLockScope(_0x20ea82??createEmptySqlLock(),_0x3b4ae3[_0x24716c(0x164)],_0x3b4ae3[_0x24716c(0x15d)],'status'),_0x5ce4d9=await scanLocalSqlQueries(_0x3b4ae3),_0x5bb7f7=[],_0x216e07=[],_0x3163d4=[],_0x4cd0f0=[],_0x27255a=new Set(_0x5ce4d9[_0x24716c(0x171)](_0x133133=>_0x133133[_0x24716c(0x15b)]));for(const _0x15cafc of _0x5ce4d9){const _0x95b6c1=await computeSqlFileHash(_0x15cafc['filePath']),_0x2fad90=_0x3a5dfa[_0x24716c(0x165)][_0x15cafc['lockKey']],_0x3698db=!!_0x2fad90&&_0x2fad90[_0x24716c(0x162)]!==_0x15cafc[_0x24716c(0x16b)],_0x29a44a=!!_0x2fad90&&!!_0x15cafc[_0x24716c(0x168)]&&_0x2fad90[_0x24716c(0x168)]!==_0x15cafc[_0x24716c(0x168)];if(!_0x2fad90)_0x5bb7f7['push'](_0x15cafc[_0x24716c(0x15b)]);else _0x2fad90[_0x24716c(0x15a)]!==_0x95b6c1||_0x3698db||_0x29a44a?_0x216e07[_0x24716c(0x16a)](_0x15cafc[_0x24716c(0x15b)]):_0x3163d4[_0x24716c(0x16a)](_0x15cafc['lockKey']);}for(const _0x1ce96b of Object['keys'](_0x3a5dfa[_0x24716c(0x165)])){!_0x27255a[_0x24716c(0x156)](_0x1ce96b)&&_0x4cd0f0[_0x24716c(0x16a)](_0x1ce96b);}const _0x2f240d=[];if(_0x573ea5['bool'](_0x24716c(0x16c))){const _0x118585=await fetchAllSqlCodes(_0x573ea5[_0x24716c(0x164)]);for(const _0x185b49 of _0x118585){!_0x27255a[_0x24716c(0x156)](_0x185b49)&&!_0x3a5dfa['sqls'][_0x185b49]&&_0x2f240d[_0x24716c(0x16a)](_0x185b49);}}const _0x57c066=_0x5bb7f7[_0x24716c(0x15c)]===0x0&&_0x216e07[_0x24716c(0x15c)]===0x0&&_0x4cd0f0['length']===0x0&&_0x2f240d[_0x24716c(0x15c)]===0x0;return{'ok':!![],'data':{'added':_0x5bb7f7,'modified':_0x216e07,'missing':_0x4cd0f0,'unchanged':_0x3163d4,'remoteOnly':_0x2f240d},'message':_0x57c066?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x5bb7f7['length']+'\x20added,\x20'+_0x216e07[_0x24716c(0x15c)]+'\x20modified,\x20'+_0x4cd0f0[_0x24716c(0x15c)]+'\x20missing,\x20'+_0x3163d4['length']+_0x24716c(0x170)+(_0x2f240d['length']>0x0?',\x20'+_0x2f240d[_0x24716c(0x15c)]+_0x24716c(0x152):'')};}};
1
+ const a164_0x30a0cd=a164_0x1866;(function(_0x2c39a4,_0x37faa4){const _0x1d3902=a164_0x1866,_0x771428=_0x2c39a4();while(!![]){try{const _0x16691b=parseInt(_0x1d3902(0x9b))/0x1+-parseInt(_0x1d3902(0x95))/0x2*(parseInt(_0x1d3902(0x7f))/0x3)+-parseInt(_0x1d3902(0x88))/0x4+-parseInt(_0x1d3902(0x9d))/0x5+parseInt(_0x1d3902(0x94))/0x6*(-parseInt(_0x1d3902(0x9c))/0x7)+-parseInt(_0x1d3902(0x92))/0x8+parseInt(_0x1d3902(0x89))/0x9;if(_0x16691b===_0x37faa4)break;else _0x771428['push'](_0x771428['shift']());}catch(_0x394353){_0x771428['push'](_0x771428['shift']());}}}(a164_0x4583,0x9827a));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';function a164_0x1866(_0x931e96,_0x1d173e){_0x931e96=_0x931e96-0x7d;const _0x4583ff=a164_0x4583();let _0x1866a6=_0x4583ff[_0x931e96];return _0x1866a6;}const PAGE_SIZE=0x64;function a164_0x4583(){const _0x498cd5=['8855288UrQkhz','totalCount','105654iezlhE','13926OTYraO','remote','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','has','push','All\x20SQL\x20queries\x20are\x20in\x20sync.','107087dWrVDC','161oxekdy','5525145nUxVqu','map','sqlName','\x20added,\x20','18HPNahx','read','bool','filePath','status','path','sqls','sqlCode','paging','3460456mMRHYU','36359802zXkYxU','keys','length','appCode','boolean','\x20missing,\x20','lockKey','\x20modified,\x20','\x20remote-only'];a164_0x4583=function(){return _0x498cd5;};return a164_0x4583();}async function fetchAllSqlCodes(_0x399199){const _0x568304=a164_0x1866,_0x664acd=[];let _0x19da7e=0x1;while(!![]){const _0x2d1616=await listSqlQueries(_0x399199,{'currentPage':_0x19da7e,'pageSize':PAGE_SIZE}),_0x324b78=_0x2d1616['tableData']??[];_0x664acd['push'](..._0x324b78[_0x568304(0x9e)](_0x4acfb3=>_0x4acfb3[_0x568304(0x86)]));if(_0x324b78[_0x568304(0x8b)]===0x0)break;const _0x174487=_0x2d1616[_0x568304(0x87)]?.[_0x568304(0x93)];if(_0x174487!=null?_0x664acd[_0x568304(0x8b)]>=_0x174487:_0x324b78[_0x568304(0x8b)]<PAGE_SIZE)break;_0x19da7e++;}return _0x664acd;}export const sqlStatus={'service':'sql','command':a164_0x30a0cd(0x83),'description':a164_0x30a0cd(0x97),'risk':a164_0x30a0cd(0x80),'flags':[{'name':a164_0x30a0cd(0x96),'type':a164_0x30a0cd(0x8d),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x292f26){const _0x23df05=a164_0x30a0cd,_0x4ca636=loadSqlProjectConfig(_0x292f26[_0x23df05(0x8c)]),_0x270b1c=await readSqlLockFile(_0x4ca636['lockFilePath']),{appLock:_0x2bf102}=ensureSqlLockScope(_0x270b1c??createEmptySqlLock(),_0x4ca636[_0x23df05(0x8c)],_0x4ca636['sqlRoot'],_0x23df05(0x83)),_0x3705e0=await scanLocalSqlQueries(_0x4ca636),_0x4347fb=[],_0x14e48a=[],_0x5d6b95=[],_0x39da5d=[],_0x541053=new Set(_0x3705e0[_0x23df05(0x9e)](_0x3dad84=>_0x3dad84[_0x23df05(0x8f)]));for(const _0x437b1f of _0x3705e0){const _0x3ea90a=await computeSqlFileHash(_0x437b1f[_0x23df05(0x82)]),_0x4049f5=_0x2bf102[_0x23df05(0x85)][_0x437b1f[_0x23df05(0x8f)]],_0x44ee79=!!_0x4049f5&&_0x4049f5[_0x23df05(0x84)]!==_0x437b1f['relativePath'],_0x5c27c9=!!_0x4049f5&&!!_0x437b1f[_0x23df05(0x7d)]&&_0x4049f5[_0x23df05(0x7d)]!==_0x437b1f[_0x23df05(0x7d)];if(!_0x4049f5)_0x4347fb['push'](_0x437b1f['lockKey']);else _0x4049f5['hash']!==_0x3ea90a||_0x44ee79||_0x5c27c9?_0x14e48a['push'](_0x437b1f[_0x23df05(0x8f)]):_0x5d6b95[_0x23df05(0x99)](_0x437b1f['lockKey']);}for(const _0x36994e of Object[_0x23df05(0x8a)](_0x2bf102[_0x23df05(0x85)])){!_0x541053[_0x23df05(0x98)](_0x36994e)&&_0x39da5d[_0x23df05(0x99)](_0x36994e);}const _0x4d9f57=[];if(_0x292f26[_0x23df05(0x81)]('remote')){const _0xec20c1=await fetchAllSqlCodes(_0x292f26[_0x23df05(0x8c)]);for(const _0x2ab822 of _0xec20c1){!_0x541053['has'](_0x2ab822)&&!_0x2bf102[_0x23df05(0x85)][_0x2ab822]&&_0x4d9f57[_0x23df05(0x99)](_0x2ab822);}}const _0x246402=_0x4347fb['length']===0x0&&_0x14e48a['length']===0x0&&_0x39da5d[_0x23df05(0x8b)]===0x0&&_0x4d9f57[_0x23df05(0x8b)]===0x0;return{'ok':!![],'data':{'added':_0x4347fb,'modified':_0x14e48a,'missing':_0x39da5d,'unchanged':_0x5d6b95,'remoteOnly':_0x4d9f57},'message':_0x246402?_0x23df05(0x9a):_0x4347fb['length']+_0x23df05(0x7e)+_0x14e48a[_0x23df05(0x8b)]+_0x23df05(0x90)+_0x39da5d[_0x23df05(0x8b)]+_0x23df05(0x8e)+_0x5d6b95[_0x23df05(0x8b)]+'\x20unchanged'+(_0x4d9f57[_0x23df05(0x8b)]>0x0?',\x20'+_0x4d9f57[_0x23df05(0x8b)]+_0x23df05(0x91):'')};}};
@@ -1 +1 @@
1
- const a163_0x56818c=a163_0xd862;(function(_0x18e589,_0x30bd52){const _0x3a574a=a163_0xd862,_0x2118a4=_0x18e589();while(!![]){try{const _0x514e5d=-parseInt(_0x3a574a(0xf4))/0x1*(-parseInt(_0x3a574a(0xc4))/0x2)+parseInt(_0x3a574a(0xdb))/0x3*(-parseInt(_0x3a574a(0xc5))/0x4)+parseInt(_0x3a574a(0xd3))/0x5+parseInt(_0x3a574a(0xdf))/0x6+parseInt(_0x3a574a(0xf3))/0x7*(parseInt(_0x3a574a(0xcd))/0x8)+-parseInt(_0x3a574a(0xda))/0x9+parseInt(_0x3a574a(0xee))/0xa;if(_0x514e5d===_0x30bd52)break;else _0x2118a4['push'](_0x2118a4['shift']());}catch(_0x4d436a){_0x2118a4['push'](_0x2118a4['shift']());}}}(a163_0x83c2,0xe608a));function a163_0xd862(_0xdd1fce,_0x3226a9){_0xdd1fce=_0xdd1fce-0xc2;const _0x83c2f6=a163_0x83c2();let _0xd8627f=_0x83c2f6[_0xdd1fce];return _0xd8627f;}import{readFileSync,existsSync}from'node:fs';function a163_0x83c2(){const _0x482689=['trim','sqlType','7359520LWdtsE','name','cwd','split','\x22\x20not\x20found\x20in\x20any\x20dataset','20363LzVGfa','580eaKcLQ','validation','File\x20not\x20found:\x20','6452SNmMFC','316fBLTbS','get','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','Provide\x20--file\x20or\x20--sql','validate','valid','SQL\x20schema\x20validation','string','1704qgKxoq','toLowerCase','tableName','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','size','sql','1737335bNYmDw','push','isArray','reason','message','from','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','15179724xtKcAb','63255BeKsAh','schemas','flagMissing','utf-8','4322718KdFpUI','Dataset\x20\x22','str','length','map','\x22\x20not\x20found\x20or\x20not\x20accessible','isSelectOnly','file','Table\x20\x22','appCode','tables','schema:','dbtableConfig'];a163_0x83c2=function(){return _0x482689;};return a163_0x83c2();}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a163_0x56818c(0xd2),'command':a163_0x56818c(0xc9),'description':a163_0x56818c(0xd9),'risk':'read','flags':[{'name':'file','type':'string','description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a163_0x56818c(0xd2),'type':a163_0x56818c(0xcc),'description':a163_0x56818c(0xd0)},{'name':a163_0x56818c(0xdc),'type':a163_0x56818c(0xcc),'description':a163_0x56818c(0xc7)}],async 'execute'(_0x589067){const _0x2c8b91=a163_0x56818c,_0x3c5d36=_0x589067[_0x2c8b91(0xe1)](_0x2c8b91(0xe6)),_0x567508=_0x589067['str'](_0x2c8b91(0xd2));if(!_0x3c5d36&&!_0x567508)throw CliErrors[_0x2c8b91(0xdd)]('file',_0x2c8b91(0xc8));let _0x4dd74f;if(_0x3c5d36){const _0x484e18=resolve(process[_0x2c8b91(0xf0)](),_0x3c5d36);if(!existsSync(_0x484e18))throw CliErrors[_0x2c8b91(0xc2)](_0x2c8b91(0xc3)+_0x484e18);_0x4dd74f=readFileSync(_0x484e18,_0x2c8b91(0xde));}else _0x4dd74f=_0x567508;const _0x8a3990=validateSql(_0x4dd74f),_0x56b237={'valid':_0x8a3990[_0x2c8b91(0xca)],'sqlType':_0x8a3990[_0x2c8b91(0xed)]['type'],'isSelectOnly':_0x8a3990[_0x2c8b91(0xed)][_0x2c8b91(0xe5)],'isDangerous':_0x8a3990[_0x2c8b91(0xed)]['isDangerous'],'tables':_0x8a3990['tables'],'parameters':_0x8a3990['parameters'],'message':_0x8a3990[_0x2c8b91(0xd7)]};_0x8a3990[_0x2c8b91(0xed)][_0x2c8b91(0xd6)]&&(_0x56b237[_0x2c8b91(0xd6)]=_0x8a3990[_0x2c8b91(0xed)]['reason']);const _0x2ef533=_0x589067[_0x2c8b91(0xe1)](_0x2c8b91(0xdc));if(_0x2ef533&&_0x8a3990[_0x2c8b91(0xca)]){const _0x2f0a7f=_0x2ef533[_0x2c8b91(0xf1)](',')['map'](_0x5016c9=>_0x5016c9[_0x2c8b91(0xec)]())['filter'](Boolean),_0x25a02b=[],_0x2e1674=filterDbTableBackedDatasets(await listDatasets(_0x589067[_0x2c8b91(0xe8)])),_0x1f4c4e=new Map(_0x2e1674[_0x2c8b91(0xe3)](_0x26f28b=>[_0x26f28b[_0x2c8b91(0xeb)]?.[_0x2c8b91(0xcf)]?.[_0x2c8b91(0xce)](),_0x26f28b]));for(const _0xcb0aed of _0x8a3990[_0x2c8b91(0xe9)]){const _0x1e125b=_0x1f4c4e[_0x2c8b91(0xc6)](_0xcb0aed[_0x2c8b91(0xce)]());!_0x1e125b&&_0x25a02b[_0x2c8b91(0xd4)](_0x2c8b91(0xe7)+_0xcb0aed+_0x2c8b91(0xf2));}for(const _0x3b9ab5 of _0x2f0a7f){let _0xbbc00d;try{_0xbbc00d=await getDatasetDetail(_0x3b9ab5);}catch{_0x25a02b[_0x2c8b91(0xd4)](_0x2c8b91(0xe0)+_0x3b9ab5+_0x2c8b91(0xe4));continue;}assertDatasetIsDbTableBacked(_0xbbc00d,_0x2c8b91(0xcb));const _0x510cb1=Array[_0x2c8b91(0xd5)](_0xbbc00d['fields'])?_0xbbc00d['fields']:[],_0x380e18=new Set(_0x510cb1[_0x2c8b91(0xe3)](_0x3bd3ce=>_0x3bd3ce[_0x2c8b91(0xef)]?.[_0x2c8b91(0xce)]())),_0x13c51f=_0xbbc00d['dbtableConfig']?.['tableName']||_0xbbc00d[_0x2c8b91(0xcf)]||_0x3b9ab5;_0x56b237[_0x2c8b91(0xea)+_0x13c51f]={'code':_0x3b9ab5,'tableName':_0x13c51f,'fieldCount':_0x380e18[_0x2c8b91(0xd1)],'fields':Array[_0x2c8b91(0xd8)](_0x380e18)};}_0x25a02b[_0x2c8b91(0xe2)]>0x0&&(_0x56b237['schemaWarnings']=_0x25a02b);}return{'ok':_0x8a3990['valid'],'data':_0x56b237,'message':_0x8a3990[_0x2c8b91(0xd7)]};}};
1
+ const a165_0x12e265=a165_0x223c;(function(_0x3d560a,_0x405cb6){const _0x34b2bd=a165_0x223c,_0x1c97c1=_0x3d560a();while(!![]){try{const _0x2eec6b=-parseInt(_0x34b2bd(0x12a))/0x1+-parseInt(_0x34b2bd(0x12c))/0x2+-parseInt(_0x34b2bd(0x132))/0x3*(parseInt(_0x34b2bd(0x13f))/0x4)+parseInt(_0x34b2bd(0x12b))/0x5+parseInt(_0x34b2bd(0x143))/0x6*(parseInt(_0x34b2bd(0x158))/0x7)+parseInt(_0x34b2bd(0x145))/0x8+parseInt(_0x34b2bd(0x140))/0x9;if(_0x2eec6b===_0x405cb6)break;else _0x1c97c1['push'](_0x1c97c1['shift']());}catch(_0x3671d2){_0x1c97c1['push'](_0x1c97c1['shift']());}}}(a165_0x1e48,0x45ad3));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a165_0x1e48(){const _0x4b8749=['isDangerous','dbtableConfig','\x22\x20not\x20found\x20in\x20any\x20dataset','validate','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','SQL\x20schema\x20validation','tables','toLowerCase','Table\x20\x22','str','name','string','message','trim','sql','length','1026459xXgYvv','schemas','tableName','get','524724TAEsOp','1970745tYNAWV','803732hbykkt','map','isArray','filter','push','File\x20not\x20found:\x20','1292349ksOTHr','split','schemaWarnings','sqlType','valid','Provide\x20--file\x20or\x20--sql','schema:','cwd','parameters','read','file','validation','isSelectOnly','4lDpgda','6593913ewjexd','reason','utf-8','12sWqIeS','fields','1781504EWwgbd','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','type'];a165_0x1e48=function(){return _0x4b8749;};return a165_0x1e48();}function a165_0x223c(_0x6fa7b7,_0x468bb1){_0x6fa7b7=_0x6fa7b7-0x129;const _0x1e48f2=a165_0x1e48();let _0x223c7b=_0x1e48f2[_0x6fa7b7];return _0x223c7b;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a165_0x12e265(0x156),'command':a165_0x12e265(0x14b),'description':a165_0x12e265(0x14c),'risk':a165_0x12e265(0x13b),'flags':[{'name':a165_0x12e265(0x13c),'type':a165_0x12e265(0x153),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':'sql','type':a165_0x12e265(0x153),'description':a165_0x12e265(0x146)},{'name':a165_0x12e265(0x159),'type':a165_0x12e265(0x153),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x2825c6){const _0x26951e=a165_0x12e265,_0x2967e7=_0x2825c6[_0x26951e(0x151)](_0x26951e(0x13c)),_0x2b86de=_0x2825c6[_0x26951e(0x151)](_0x26951e(0x156));if(!_0x2967e7&&!_0x2b86de)throw CliErrors['flagMissing'](_0x26951e(0x13c),_0x26951e(0x137));let _0x2fbd3f;if(_0x2967e7){const _0x16b529=resolve(process[_0x26951e(0x139)](),_0x2967e7);if(!existsSync(_0x16b529))throw CliErrors[_0x26951e(0x13d)](_0x26951e(0x131)+_0x16b529);_0x2fbd3f=readFileSync(_0x16b529,_0x26951e(0x142));}else _0x2fbd3f=_0x2b86de;const _0x36077b=validateSql(_0x2fbd3f),_0x35a417={'valid':_0x36077b['valid'],'sqlType':_0x36077b[_0x26951e(0x135)][_0x26951e(0x147)],'isSelectOnly':_0x36077b[_0x26951e(0x135)][_0x26951e(0x13e)],'isDangerous':_0x36077b[_0x26951e(0x135)][_0x26951e(0x148)],'tables':_0x36077b[_0x26951e(0x14e)],'parameters':_0x36077b[_0x26951e(0x13a)],'message':_0x36077b[_0x26951e(0x154)]};_0x36077b['sqlType'][_0x26951e(0x141)]&&(_0x35a417[_0x26951e(0x141)]=_0x36077b[_0x26951e(0x135)][_0x26951e(0x141)]);const _0x1bbdee=_0x2825c6[_0x26951e(0x151)](_0x26951e(0x159));if(_0x1bbdee&&_0x36077b[_0x26951e(0x136)]){const _0x44ee0d=_0x1bbdee[_0x26951e(0x133)](',')[_0x26951e(0x12d)](_0x1a382d=>_0x1a382d[_0x26951e(0x155)]())[_0x26951e(0x12f)](Boolean),_0x366be4=[],_0x517c5e=filterDbTableBackedDatasets(await listDatasets(_0x2825c6['appCode'])),_0x4dce86=new Map(_0x517c5e['map'](_0x4c8d92=>[_0x4c8d92[_0x26951e(0x149)]?.['tableName']?.[_0x26951e(0x14f)](),_0x4c8d92]));for(const _0x201c76 of _0x36077b[_0x26951e(0x14e)]){const _0x272e57=_0x4dce86[_0x26951e(0x129)](_0x201c76[_0x26951e(0x14f)]());!_0x272e57&&_0x366be4[_0x26951e(0x130)](_0x26951e(0x150)+_0x201c76+_0x26951e(0x14a));}for(const _0x2ed298 of _0x44ee0d){let _0x9916b9;try{_0x9916b9=await getDatasetDetail(_0x2ed298);}catch{_0x366be4[_0x26951e(0x130)]('Dataset\x20\x22'+_0x2ed298+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0x9916b9,_0x26951e(0x14d));const _0x401908=Array[_0x26951e(0x12e)](_0x9916b9['fields'])?_0x9916b9[_0x26951e(0x144)]:[],_0x3c7e12=new Set(_0x401908[_0x26951e(0x12d)](_0x18a9dc=>_0x18a9dc[_0x26951e(0x152)]?.[_0x26951e(0x14f)]())),_0xb904e6=_0x9916b9['dbtableConfig']?.[_0x26951e(0x15a)]||_0x9916b9['tableName']||_0x2ed298;_0x35a417[_0x26951e(0x138)+_0xb904e6]={'code':_0x2ed298,'tableName':_0xb904e6,'fieldCount':_0x3c7e12['size'],'fields':Array['from'](_0x3c7e12)};}_0x366be4[_0x26951e(0x157)]>0x0&&(_0x35a417[_0x26951e(0x134)]=_0x366be4);}return{'ok':_0x36077b[_0x26951e(0x136)],'data':_0x35a417,'message':_0x36077b[_0x26951e(0x154)]};}};
@@ -1 +1 @@
1
- const a164_0xa24420=a164_0x41d3;function a164_0x41d3(_0x5707c8,_0x3270d3){_0x5707c8=_0x5707c8-0x6a;const _0x125f18=a164_0x125f();let _0x41d305=_0x125f18[_0x5707c8];return _0x41d305;}(function(_0x1013f3,_0x2b0c45){const _0x5a2afb=a164_0x41d3,_0x3a24ca=_0x1013f3();while(!![]){try{const _0x3796a2=-parseInt(_0x5a2afb(0x76))/0x1*(-parseInt(_0x5a2afb(0x70))/0x2)+-parseInt(_0x5a2afb(0x6d))/0x3+-parseInt(_0x5a2afb(0x74))/0x4+-parseInt(_0x5a2afb(0x6b))/0x5*(-parseInt(_0x5a2afb(0x75))/0x6)+parseInt(_0x5a2afb(0x71))/0x7*(parseInt(_0x5a2afb(0x6c))/0x8)+parseInt(_0x5a2afb(0x77))/0x9+-parseInt(_0x5a2afb(0x73))/0xa;if(_0x3796a2===_0x2b0c45)break;else _0x3a24ca['push'](_0x3a24ca['shift']());}catch(_0x2d8307){_0x3a24ca['push'](_0x3a24ca['shift']());}}}(a164_0x125f,0x6e112));function a164_0x125f(){const _0x426459=['App\x20profile\x20name','3061330LeMOfp','1775656grWwDZ','6kuoRVp','1yZfkIW','7524315EuugpY','workspace','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','897125NqTRjs','814824KQiLpB','1035435BiEwEW','add','workspace\x20add','450014pmLjAE','21sbrivP'];a164_0x125f=function(){return _0x426459;};return a164_0x125f();}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a164_0xa24420(0x78),'command':a164_0xa24420(0x6e),'description':a164_0xa24420(0x6a),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a164_0xa24420(0x72),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x571ff8=>validateAppName(_0x571ff8,a164_0xa24420(0x6f)),'execute':_0x575e16=>runAppAdd(_0x575e16,a164_0xa24420(0x6f))};
1
+ function a166_0x5d5a(_0x5a419c,_0x4e4f2f){_0x5a419c=_0x5a419c-0x1ab;const _0x1f8fbc=a166_0x1f8f();let _0x5d5a97=_0x1f8fbc[_0x5a419c];return _0x5d5a97;}function a166_0x1f8f(){const _0xf27e62=['27549zfIBiS','3612266GnyHva','workspace','2343000GFDkFE','100DjFmVb','2105420EWIcPo','workspace\x20add','1EvsGUS','12180879zRjdEn','322380vHTLlr','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','add','784298OLepCf'];a166_0x1f8f=function(){return _0xf27e62;};return a166_0x1f8f();}const a166_0x3f4573=a166_0x5d5a;(function(_0x2bad48,_0xff6027){const _0x1cb478=a166_0x5d5a,_0x2bcc6c=_0x2bad48();while(!![]){try{const _0x446d69=-parseInt(_0x1cb478(0x1b6))/0x1*(parseInt(_0x1cb478(0x1ae))/0x2)+parseInt(_0x1cb478(0x1af))/0x3*(-parseInt(_0x1cb478(0x1b3))/0x4)+parseInt(_0x1cb478(0x1b4))/0x5+-parseInt(_0x1cb478(0x1ab))/0x6+-parseInt(_0x1cb478(0x1b0))/0x7+-parseInt(_0x1cb478(0x1b2))/0x8+parseInt(_0x1cb478(0x1b7))/0x9;if(_0x446d69===_0xff6027)break;else _0x2bcc6c['push'](_0x2bcc6c['shift']());}catch(_0xc9bd9){_0x2bcc6c['push'](_0x2bcc6c['shift']());}}}(a166_0x1f8f,0x46d64));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a166_0x3f4573(0x1b1),'command':a166_0x3f4573(0x1ad),'description':a166_0x3f4573(0x1ac),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':'App\x20profile\x20name','required':!![]}],'flags':buildAppAddFlags(),'validate':_0x31a926=>validateAppName(_0x31a926,a166_0x3f4573(0x1b5)),'execute':_0x2e1275=>runAppAdd(_0x2e1275,'workspace\x20add')};
@@ -1 +1 @@
1
- const a165_0xe7d13e=a165_0x2004;(function(_0x120484,_0x448cb1){const _0x5f8a51=a165_0x2004,_0x5463f8=_0x120484();while(!![]){try{const _0x446edd=parseInt(_0x5f8a51(0x8c))/0x1*(-parseInt(_0x5f8a51(0x9c))/0x2)+-parseInt(_0x5f8a51(0x74))/0x3*(parseInt(_0x5f8a51(0xa3))/0x4)+parseInt(_0x5f8a51(0xa5))/0x5+-parseInt(_0x5f8a51(0x84))/0x6+-parseInt(_0x5f8a51(0x78))/0x7*(-parseInt(_0x5f8a51(0x79))/0x8)+-parseInt(_0x5f8a51(0x8a))/0x9*(parseInt(_0x5f8a51(0x94))/0xa)+parseInt(_0x5f8a51(0x93))/0xb*(parseInt(_0x5f8a51(0x9a))/0xc);if(_0x446edd===_0x448cb1)break;else _0x5463f8['push'](_0x5463f8['shift']());}catch(_0x18d17d){_0x5463f8['push'](_0x5463f8['shift']());}}}(a165_0x3a1e,0xb1da6));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.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';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+'\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]',SAFE_PROFILE_KEYS=[a165_0xe7d13e(0x8b),a165_0xe7d13e(0x88),a165_0xe7d13e(0x73),'format',a165_0xe7d13e(0x7a),a165_0xe7d13e(0x71),'locale'],workspaceFlags=[{'name':a165_0xe7d13e(0xa4),'type':'string','description':a165_0xe7d13e(0x8f)},{'name':a165_0xe7d13e(0x8b),'type':a165_0xe7d13e(0x99),'description':a165_0xe7d13e(0xa9)},{'name':a165_0xe7d13e(0x88),'type':a165_0xe7d13e(0x99),'description':a165_0xe7d13e(0x81),'enum':[...RABETBASE_ENV_VALUES]},{'name':a165_0xe7d13e(0x73),'type':a165_0xe7d13e(0x99),'description':a165_0xe7d13e(0x9d)},{'name':a165_0xe7d13e(0x86),'type':a165_0xe7d13e(0x99),'description':a165_0xe7d13e(0x9e),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a165_0xe7d13e(0x7a),'type':a165_0xe7d13e(0x75),'description':a165_0xe7d13e(0x8d)},{'name':a165_0xe7d13e(0x71),'type':a165_0xe7d13e(0x99),'description':a165_0xe7d13e(0x89),'enum':[...RISK_LEVEL_VALUES]},{'name':a165_0xe7d13e(0x8e),'type':a165_0xe7d13e(0x99),'description':a165_0xe7d13e(0x7e)}];function isRecord(_0x39f407){const _0x10bc33=a165_0xe7d13e;return!!_0x39f407&&typeof _0x39f407===_0x10bc33(0x72)&&!Array['isArray'](_0x39f407);}function assertValidAppcode(_0x31d543){const _0x134634=a165_0xe7d13e,{valid:_0x23df5d,message:_0x53a6f2}=validateAppcode(_0x31d543);if(!_0x23df5d)throw CliErrors[_0x134634(0xa6)]('Invalid\x20appcode:\x20'+_0x31d543,_0x53a6f2);}function a165_0x3a1e(){const _0xd5b214=['7BBIsVz','567848yATcDe','pageSize','Use\x20`','defaultApp','\x20(appcode:\x20','Locale\x20for\x20this\x20workspace\x20app\x20profile','globalConfig','\x22\x20not\x20found.','Target\x20environment','workspace','apps','3315036EcJmfi','write','defaultFormat','.\x20Credentials:\x20not\x20written.','env','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','492354brHCws','appcode','467135yKDvLC','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','locale','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','\x20workspace\x20','project','trim','77Jwvzbx','20KoXTQr','str','use','flag','initialized','string','2854068IfOtKA','keys','2gqkBSc','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','Missing\x20workspace\x20app\x20selector.','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','App\x20\x22','workspace.','4cqAqqQ','app','5228805SARmDX','validation','length','\x20--app\x20','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','updated',').\x20Config:\x20','init','join','riskLevel','object','apiDir','2772228aanSKA','number','Initialize\x20the\x20current\x20workspace\x20app\x20binding','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20'];a165_0x3a1e=function(){return _0xd5b214;};return a165_0x3a1e();}function sanitizeProfile(_0x1f937d){if(!isRecord(_0x1f937d))return{};const _0x1373f0={};for(const _0x682ee5 of SAFE_PROFILE_KEYS){if(_0x1f937d[_0x682ee5]!==undefined)_0x1373f0[_0x682ee5]=_0x1f937d[_0x682ee5];}return _0x1373f0;}function cloneProfile(_0x4c9422){return isRecord(_0x4c9422)?{..._0x4c9422}:{};}function collectWorkspaceProfileOverrides(_0x5289fe){const _0x244e6f=a165_0xe7d13e,_0x2ee520={},_0x18b963=_0x5289fe[_0x244e6f(0x95)](_0x244e6f(0x88)),_0x59e155=_0x5289fe[_0x244e6f(0x95)](_0x244e6f(0x73)),_0x341bdb=_0x5289fe[_0x244e6f(0x95)](_0x244e6f(0x86)),_0x8935a8=_0x5289fe[_0x244e6f(0x97)](_0x244e6f(0x7a)),_0x356e7d=_0x5289fe['str'](_0x244e6f(0x71)),_0x22ff91=_0x5289fe[_0x244e6f(0x95)](_0x244e6f(0x8e));if(_0x18b963)_0x2ee520[_0x244e6f(0x88)]=_0x18b963;if(_0x59e155)_0x2ee520[_0x244e6f(0x73)]=_0x59e155;if(_0x341bdb)_0x2ee520['format']=_0x341bdb;if(_0x8935a8!==undefined&&_0x8935a8!=='')_0x2ee520[_0x244e6f(0x7a)]=Number(_0x8935a8);if(_0x356e7d)_0x2ee520[_0x244e6f(0x71)]=_0x356e7d;if(_0x22ff91)_0x2ee520[_0x244e6f(0x8e)]=_0x22ff91;return _0x2ee520;}async function validateWorkspaceArgs(_0x475030){const _0x3b1ba4=a165_0xe7d13e,_0x35b3dc=_0x475030[_0x3b1ba4(0x95)](_0x3b1ba4(0xa4))['trim'](),_0x3fe132=_0x475030[_0x3b1ba4(0x95)](_0x3b1ba4(0x8b))[_0x3b1ba4(0x92)]();if(!_0x35b3dc&&!_0x3fe132)throw CliErrors['validation'](_0x3b1ba4(0x9f),_0x3b1ba4(0x7b)+CLI_BIN_NAME+_0x3b1ba4(0xa0)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x3fe132)assertValidAppcode(_0x3fe132);}function resolveKnownApps(){const _0x31e4fb=a165_0xe7d13e,{config:_0x28bfc7,layers:_0x295f57}=readRawConfigWithLayers(),_0x1dfd61=isRecord(_0x28bfc7[_0x31e4fb(0x83)])?_0x28bfc7[_0x31e4fb(0x83)]:{},_0x475d3f=isRecord(_0x295f57['globalConfig'][_0x31e4fb(0x83)])?_0x295f57[_0x31e4fb(0x7f)][_0x31e4fb(0x83)]:{};return{..._0x475d3f,..._0x1dfd61};}async function configureWorkspace(_0x59dbdd,_0x42d9a1){const _0x16e332=a165_0xe7d13e,_0x38a133=_0x59dbdd[_0x16e332(0x95)](_0x16e332(0xa4))[_0x16e332(0x92)](),_0x28833e=_0x59dbdd[_0x16e332(0x95)](_0x16e332(0x8b))[_0x16e332(0x92)](),_0x4ceede=_0x38a133||_0x28833e;if(!_0x4ceede)throw CliErrors[_0x16e332(0xa6)]('Missing\x20workspace\x20app\x20selector.',_0x16e332(0x7b)+CLI_BIN_NAME+_0x16e332(0xa0)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x28833e)assertValidAppcode(_0x28833e);const _0x440dc9=resolveWriteConfigPath(_0x16e332(0x91)),_0x27d814=readConfigFile(_0x440dc9),_0x43d5dd=resolveKnownApps(),_0x1e2266=isRecord(_0x27d814[_0x16e332(0x83)])?{..._0x27d814[_0x16e332(0x83)]}:{},_0x3ca57f=cloneProfile(_0x1e2266[_0x4ceede]),_0x3ff547=sanitizeProfile(_0x43d5dd[_0x4ceede]),_0x10751c=_0x28833e?{}:_0x3ff547,_0x46c196=_0x28833e||_0x10751c[_0x16e332(0x8b)];if(!_0x46c196){const _0x463845=Object[_0x16e332(0x9b)](_0x43d5dd),_0x43e658=_0x463845[_0x16e332(0xa7)]===0x0?_0x16e332(0x7b)+CLI_BIN_NAME+_0x16e332(0x90)+_0x42d9a1+_0x16e332(0xa8)+_0x4ceede+'\x20--appcode\x20<code>`.':_0x16e332(0x77)+_0x463845[_0x16e332(0x70)](',\x20');throw CliErrors[_0x16e332(0xa6)](_0x16e332(0xa1)+_0x4ceede+_0x16e332(0x80),_0x43e658);}assertValidAppcode(String(_0x46c196));const _0x158dce={..._0x10751c,..._0x3ca57f,'appcode':String(_0x46c196),...collectWorkspaceProfileOverrides(_0x59dbdd)};return _0x1e2266[_0x4ceede]=_0x158dce,_0x27d814[_0x16e332(0x83)]=_0x1e2266,_0x27d814[_0x16e332(0x7c)]=_0x4ceede,delete _0x27d814['appcode'],delete _0x27d814[_0x16e332(0xa4)],_0x158dce['env']&&(_0x27d814[_0x16e332(0x88)]=_0x158dce['env']),writeConfigFile(_0x440dc9,_0x27d814),{'ok':!![],'message':'Workspace\x20'+(_0x42d9a1===_0x16e332(0x6f)?_0x16e332(0x98):_0x16e332(0xaa))+':\x20'+_0x4ceede+_0x16e332(0x7d)+_0x158dce[_0x16e332(0x8b)]+_0x16e332(0xab)+_0x440dc9+_0x16e332(0x87),'data':{'operation':_0x16e332(0xa2)+_0x42d9a1,'configPath':_0x440dc9,'app':_0x4ceede,'appcode':_0x158dce['appcode'],'env':_0x158dce[_0x16e332(0x88)]??null,'credentialsWritten':![]}};}function a165_0x2004(_0x450e00,_0x17fb51){_0x450e00=_0x450e00-0x6f;const _0x3a1e27=a165_0x3a1e();let _0x2004d2=_0x3a1e27[_0x450e00];return _0x2004d2;}const workspaceInitDefinition={'service':a165_0xe7d13e(0x82),'command':'init','description':a165_0xe7d13e(0x76),'risk':a165_0xe7d13e(0x85),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x8d4ce6=>configureWorkspace(_0x8d4ce6,'init')},workspaceUseDefinition={'service':a165_0xe7d13e(0x82),'command':a165_0xe7d13e(0x96),'description':'Switch\x20the\x20current\x20workspace\x20app\x20binding','risk':a165_0xe7d13e(0x85),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x36b2d1=>configureWorkspace(_0x36b2d1,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ const a167_0x4cd2e6=a167_0x34e0;(function(_0x3b13eb,_0x5af733){const _0x2cbedb=a167_0x34e0,_0x245847=_0x3b13eb();while(!![]){try{const _0x4afba0=-parseInt(_0x2cbedb(0x1df))/0x1*(-parseInt(_0x2cbedb(0x1d6))/0x2)+parseInt(_0x2cbedb(0x200))/0x3+-parseInt(_0x2cbedb(0x1f3))/0x4*(parseInt(_0x2cbedb(0x210))/0x5)+-parseInt(_0x2cbedb(0x1ee))/0x6+-parseInt(_0x2cbedb(0x1f4))/0x7*(-parseInt(_0x2cbedb(0x1fe))/0x8)+-parseInt(_0x2cbedb(0x1e5))/0x9*(parseInt(_0x2cbedb(0x1f2))/0xa)+-parseInt(_0x2cbedb(0x1e2))/0xb*(parseInt(_0x2cbedb(0x1f5))/0xc);if(_0x4afba0===_0x5af733)break;else _0x245847['push'](_0x245847['shift']());}catch(_0x29786e){_0x245847['push'](_0x245847['shift']());}}}(a167_0x58d2,0xdaff1));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.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';function a167_0x58d2(){const _0x37b818=['\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','str','format','flag','appcode','\x20--app\x20','length','2901882WPUKVX','\x20--appcode\x20<code>`.','string','object','70210WUxDqR','1019152CeTXdG','72863wafvnf','10344bfIDbj','defaultFormat','locale','project','globalConfig','Initialize\x20the\x20current\x20workspace\x20app\x20binding','initialized','use','Use\x20`','536hHcfGE','join','4144494IGozLc','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','keys',').\x20Config:\x20','\x20workspace\x20use\x20--app\x20<name>`.','apps','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','trim','Missing\x20workspace\x20app\x20selector.','workspace','Switch\x20the\x20current\x20workspace\x20app\x20binding','riskLevel','Workspace\x20','env','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','updated','25TTHIpx','Target\x20environment','2UAihyI','Invalid\x20appcode:\x20','app','isArray','write','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','validation','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','912539JCIeDe','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','apiDir','1969uxMMak','pageSize','init','234TizCCq','.\x20Credentials:\x20not\x20written.'];a167_0x58d2=function(){return _0x37b818;};return a167_0x58d2();}import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a167_0x4cd2e6(0x1e7),SAFE_PROFILE_KEYS=['appcode',a167_0x4cd2e6(0x20d),a167_0x4cd2e6(0x1e1),a167_0x4cd2e6(0x1e9),a167_0x4cd2e6(0x1e3),a167_0x4cd2e6(0x20b),a167_0x4cd2e6(0x1f7)],workspaceFlags=[{'name':a167_0x4cd2e6(0x1d8),'type':a167_0x4cd2e6(0x1f0),'description':a167_0x4cd2e6(0x206)},{'name':a167_0x4cd2e6(0x1eb),'type':'string','description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':a167_0x4cd2e6(0x20d),'type':a167_0x4cd2e6(0x1f0),'description':a167_0x4cd2e6(0x211),'enum':[...RABETBASE_ENV_VALUES]},{'name':a167_0x4cd2e6(0x1e1),'type':'string','description':a167_0x4cd2e6(0x1db)},{'name':'defaultFormat','type':'string','description':a167_0x4cd2e6(0x1dd),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a167_0x4cd2e6(0x1e3),'type':'number','description':a167_0x4cd2e6(0x1de)},{'name':a167_0x4cd2e6(0x20b),'type':a167_0x4cd2e6(0x1f0),'description':a167_0x4cd2e6(0x201),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':'string','description':'Locale\x20for\x20this\x20workspace\x20app\x20profile'}];function a167_0x34e0(_0x308e0e,_0x26e3bf){_0x308e0e=_0x308e0e-0x1d6;const _0x58d248=a167_0x58d2();let _0x34e0cc=_0x58d248[_0x308e0e];return _0x34e0cc;}function isRecord(_0x42f02a){const _0x4c5bcc=a167_0x4cd2e6;return!!_0x42f02a&&typeof _0x42f02a===_0x4c5bcc(0x1f1)&&!Array[_0x4c5bcc(0x1d9)](_0x42f02a);}function assertValidAppcode(_0x3c5e10){const _0x5e8c05=a167_0x4cd2e6,{valid:_0x4a157a,message:_0x25bfa5}=validateAppcode(_0x3c5e10);if(!_0x4a157a)throw CliErrors['validation'](_0x5e8c05(0x1d7)+_0x3c5e10,_0x25bfa5);}function sanitizeProfile(_0x3cadab){if(!isRecord(_0x3cadab))return{};const _0x48275b={};for(const _0x2fe611 of SAFE_PROFILE_KEYS){if(_0x3cadab[_0x2fe611]!==undefined)_0x48275b[_0x2fe611]=_0x3cadab[_0x2fe611];}return _0x48275b;}function cloneProfile(_0x1e032a){return isRecord(_0x1e032a)?{..._0x1e032a}:{};}function collectWorkspaceProfileOverrides(_0x1ee6bd){const _0x49dbc6=a167_0x4cd2e6,_0x5883bc={},_0x11b486=_0x1ee6bd[_0x49dbc6(0x1e8)](_0x49dbc6(0x20d)),_0x10a4e6=_0x1ee6bd[_0x49dbc6(0x1e8)]('apiDir'),_0x1c383c=_0x1ee6bd[_0x49dbc6(0x1e8)](_0x49dbc6(0x1f6)),_0x301747=_0x1ee6bd[_0x49dbc6(0x1ea)]('pageSize'),_0x408cdc=_0x1ee6bd[_0x49dbc6(0x1e8)]('riskLevel'),_0x3d9bed=_0x1ee6bd[_0x49dbc6(0x1e8)](_0x49dbc6(0x1f7));if(_0x11b486)_0x5883bc[_0x49dbc6(0x20d)]=_0x11b486;if(_0x10a4e6)_0x5883bc['apiDir']=_0x10a4e6;if(_0x1c383c)_0x5883bc[_0x49dbc6(0x1e9)]=_0x1c383c;if(_0x301747!==undefined&&_0x301747!=='')_0x5883bc[_0x49dbc6(0x1e3)]=Number(_0x301747);if(_0x408cdc)_0x5883bc['riskLevel']=_0x408cdc;if(_0x3d9bed)_0x5883bc[_0x49dbc6(0x1f7)]=_0x3d9bed;return _0x5883bc;}async function validateWorkspaceArgs(_0x1c105d){const _0x191088=a167_0x4cd2e6,_0x506cf5=_0x1c105d[_0x191088(0x1e8)]('app')[_0x191088(0x207)](),_0x5ed580=_0x1c105d[_0x191088(0x1e8)](_0x191088(0x1eb))['trim']();if(!_0x506cf5&&!_0x5ed580)throw CliErrors['validation'](_0x191088(0x208),_0x191088(0x1fd)+CLI_BIN_NAME+_0x191088(0x1e0)+CLI_BIN_NAME+_0x191088(0x204));if(_0x5ed580)assertValidAppcode(_0x5ed580);}function resolveKnownApps(){const _0x2de669=a167_0x4cd2e6,{config:_0x4621b8,layers:_0x57fb61}=readRawConfigWithLayers(),_0x2f529a=isRecord(_0x4621b8[_0x2de669(0x205)])?_0x4621b8[_0x2de669(0x205)]:{},_0x4f285e=isRecord(_0x57fb61[_0x2de669(0x1f9)]['apps'])?_0x57fb61[_0x2de669(0x1f9)][_0x2de669(0x205)]:{};return{..._0x4f285e,..._0x2f529a};}async function configureWorkspace(_0x391920,_0xd8f10a){const _0x381682=a167_0x4cd2e6,_0x28a01b=_0x391920[_0x381682(0x1e8)](_0x381682(0x1d8))[_0x381682(0x207)](),_0x3c9e2d=_0x391920['str'](_0x381682(0x1eb))['trim'](),_0x582158=_0x28a01b||_0x3c9e2d;if(!_0x582158)throw CliErrors[_0x381682(0x1dc)](_0x381682(0x208),_0x381682(0x1fd)+CLI_BIN_NAME+_0x381682(0x1e0)+CLI_BIN_NAME+_0x381682(0x204));if(_0x3c9e2d)assertValidAppcode(_0x3c9e2d);const _0x144f3b=resolveWriteConfigPath(_0x381682(0x1f8)),_0x55b30c=readConfigFile(_0x144f3b),_0x12cdc9=resolveKnownApps(),_0xb3c19d=isRecord(_0x55b30c[_0x381682(0x205)])?{..._0x55b30c[_0x381682(0x205)]}:{},_0x2ab04d=cloneProfile(_0xb3c19d[_0x582158]),_0xa84a93=sanitizeProfile(_0x12cdc9[_0x582158]),_0x4be286=_0x3c9e2d?{}:_0xa84a93,_0x760f88=_0x3c9e2d||_0x4be286[_0x381682(0x1eb)];if(!_0x760f88){const _0x2c40b3=Object[_0x381682(0x202)](_0x12cdc9),_0x5a1d6a=_0x2c40b3[_0x381682(0x1ed)]===0x0?_0x381682(0x1fd)+CLI_BIN_NAME+'\x20workspace\x20'+_0xd8f10a+_0x381682(0x1ec)+_0x582158+_0x381682(0x1ef):_0x381682(0x20e)+_0x2c40b3[_0x381682(0x1ff)](',\x20');throw CliErrors[_0x381682(0x1dc)]('App\x20\x22'+_0x582158+'\x22\x20not\x20found.',_0x5a1d6a);}assertValidAppcode(String(_0x760f88));const _0x4c4d1a={..._0x4be286,..._0x2ab04d,'appcode':String(_0x760f88),...collectWorkspaceProfileOverrides(_0x391920)};return _0xb3c19d[_0x582158]=_0x4c4d1a,_0x55b30c[_0x381682(0x205)]=_0xb3c19d,_0x55b30c['defaultApp']=_0x582158,delete _0x55b30c[_0x381682(0x1eb)],delete _0x55b30c[_0x381682(0x1d8)],_0x4c4d1a['env']&&(_0x55b30c[_0x381682(0x20d)]=_0x4c4d1a[_0x381682(0x20d)]),writeConfigFile(_0x144f3b,_0x55b30c),{'ok':!![],'message':_0x381682(0x20c)+(_0xd8f10a===_0x381682(0x1e4)?_0x381682(0x1fb):_0x381682(0x20f))+':\x20'+_0x582158+'\x20(appcode:\x20'+_0x4c4d1a['appcode']+_0x381682(0x203)+_0x144f3b+_0x381682(0x1e6),'data':{'operation':'workspace.'+_0xd8f10a,'configPath':_0x144f3b,'app':_0x582158,'appcode':_0x4c4d1a[_0x381682(0x1eb)],'env':_0x4c4d1a[_0x381682(0x20d)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a167_0x4cd2e6(0x209),'command':a167_0x4cd2e6(0x1e4),'description':a167_0x4cd2e6(0x1fa),'risk':a167_0x4cd2e6(0x1da),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x2a142f=>configureWorkspace(_0x2a142f,a167_0x4cd2e6(0x1e4))},workspaceUseDefinition={'service':a167_0x4cd2e6(0x209),'command':a167_0x4cd2e6(0x1fc),'description':a167_0x4cd2e6(0x20a),'risk':a167_0x4cd2e6(0x1da),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0xa4a2b4=>configureWorkspace(_0xa4a2b4,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- function a166_0x29c1(_0xcd28cc,_0x11a83a){_0xcd28cc=_0xcd28cc-0x1a8;const _0x28b04a=a166_0x28b0();let _0x29c162=_0x28b04a[_0xcd28cc];return _0x29c162;}const a166_0x243e56=a166_0x29c1;(function(_0x531cee,_0xacea41){const _0x513f0a=a166_0x29c1,_0x1af1e0=_0x531cee();while(!![]){try{const _0x290d3b=parseInt(_0x513f0a(0x1a8))/0x1*(-parseInt(_0x513f0a(0x1ad))/0x2)+-parseInt(_0x513f0a(0x1ae))/0x3+parseInt(_0x513f0a(0x1b7))/0x4+parseInt(_0x513f0a(0x1af))/0x5+parseInt(_0x513f0a(0x1b8))/0x6*(parseInt(_0x513f0a(0x1b2))/0x7)+-parseInt(_0x513f0a(0x1b9))/0x8*(parseInt(_0x513f0a(0x1a9))/0x9)+parseInt(_0x513f0a(0x1b4))/0xa*(-parseInt(_0x513f0a(0x1b6))/0xb);if(_0x290d3b===_0xacea41)break;else _0x1af1e0['push'](_0x1af1e0['shift']());}catch(_0x4b0e3f){_0x1af1e0['push'](_0x1af1e0['shift']());}}}(a166_0x28b0,0x5757a));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a166_0x28b0(){const _0x5a97cb=['1215900wfdMAL','2642100DHwKUa','workspace','App\x20profile\x20name\x20to\x20remove','4984609qVSaVQ','remove','1261430IgOECX','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','22XlXfZw','2684084oWmCtH','6tJsUDF','223160DjRsaI','700923HlNnUa','63asQeqe','name','workspace\x20remove','high-risk-write','2OmYkEJ'];a166_0x28b0=function(){return _0x5a97cb;};return a166_0x28b0();}export const workspaceRemoveDefinition={'service':a166_0x243e56(0x1b0),'command':a166_0x243e56(0x1b3),'description':a166_0x243e56(0x1b5),'risk':a166_0x243e56(0x1ac),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a166_0x243e56(0x1aa),'description':a166_0x243e56(0x1b1),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x42fb37=>validateAppName(_0x42fb37,a166_0x243e56(0x1ab)),'execute':_0x58f051=>runAppRemove(_0x58f051,a166_0x243e56(0x1ab))};
1
+ function a168_0x4079(_0x7022a4,_0x4bac11){_0x7022a4=_0x7022a4-0x75;const _0x3f3a17=a168_0x3f3a();let _0x40793b=_0x3f3a17[_0x7022a4];return _0x40793b;}const a168_0x4dce3b=a168_0x4079;(function(_0x4840c8,_0xe0c50a){const _0x59f9a2=a168_0x4079,_0x231a19=_0x4840c8();while(!![]){try{const _0x3ad7ff=parseInt(_0x59f9a2(0x7e))/0x1+-parseInt(_0x59f9a2(0x83))/0x2+-parseInt(_0x59f9a2(0x76))/0x3*(-parseInt(_0x59f9a2(0x82))/0x4)+-parseInt(_0x59f9a2(0x79))/0x5+-parseInt(_0x59f9a2(0x80))/0x6*(parseInt(_0x59f9a2(0x77))/0x7)+parseInt(_0x59f9a2(0x84))/0x8+-parseInt(_0x59f9a2(0x7c))/0x9*(-parseInt(_0x59f9a2(0x7d))/0xa);if(_0x3ad7ff===_0xe0c50a)break;else _0x231a19['push'](_0x231a19['shift']());}catch(_0x1c1071){_0x231a19['push'](_0x231a19['shift']());}}}(a168_0x3f3a,0xd873a));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':'workspace','command':a168_0x4dce3b(0x7f),'description':a168_0x4dce3b(0x7a),'risk':a168_0x4dce3b(0x81),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a168_0x4dce3b(0x78),'description':a168_0x4dce3b(0x75),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x3f6d0f=>validateAppName(_0x3f6d0f,'workspace\x20remove'),'execute':_0x3e9f75=>runAppRemove(_0x3e9f75,a168_0x4dce3b(0x7b))};function a168_0x3f3a(){const _0x16412a=['workspace\x20remove','116514eVsfTR','730oozIwj','939472yVRcsL','remove','32034qEBCaI','high-risk-write','792xVOwaz','3073014YGTRJL','13216296zPTZvQ','App\x20profile\x20name\x20to\x20remove','1605BhcTWN','525BXzPAU','name','4094895ozgnlw','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)'];a168_0x3f3a=function(){return _0x16412a;};return a168_0x3f3a();}
@@ -1 +1 @@
1
- const a167_0x26cc55=a167_0x1e26;(function(_0x5ae54c,_0x1ae470){const _0x364841=a167_0x1e26,_0x3cd73a=_0x5ae54c();while(!![]){try{const _0x3f1be0=parseInt(_0x364841(0x1be))/0x1+parseInt(_0x364841(0x1ce))/0x2*(-parseInt(_0x364841(0x1d4))/0x3)+-parseInt(_0x364841(0x1d6))/0x4*(-parseInt(_0x364841(0x1cf))/0x5)+-parseInt(_0x364841(0x1d3))/0x6*(-parseInt(_0x364841(0x1db))/0x7)+parseInt(_0x364841(0x1e2))/0x8+-parseInt(_0x364841(0x1dd))/0x9*(-parseInt(_0x364841(0x1c8))/0xa)+-parseInt(_0x364841(0x1c7))/0xb;if(_0x3f1be0===_0x1ae470)break;else _0x3cd73a['push'](_0x3cd73a['shift']());}catch(_0x3d8add){_0x3cd73a['push'](_0x3cd73a['shift']());}}}(a167_0x37e4,0xe5f20));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=[a167_0x26cc55(0x1cc),a167_0x26cc55(0x1ca),a167_0x26cc55(0x1d7),'format',a167_0x26cc55(0x1d2)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a167_0x26cc55(0x1df),a167_0x26cc55(0x1c3),a167_0x26cc55(0x1d7),'format','cookie',a167_0x26cc55(0x1ca),'apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x14dded){const _0x2296f1=a167_0x26cc55;return[..._0x14dded][_0x2296f1(0x1d1)](',\x20');}function a167_0x37e4(){const _0x91c52a=['Default\x20page\x20size','Access\x20key','35pASywO','inherit','6307731FMFuhC','length','appcode','Locale','apps','11944648cdLsVk','app','en-US','filter','string','entries','Risk\x20level','571329TBYnJC','defaultApp','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','number','apiDir','env','format','Auth\x20cookie','defaultFormat','27980546cUvHrv','20BVpdcI','trim','accessKey','zh-CN','cookie','Target\x20environment','2DYMaYv','6945kLYSKG','pageSize','join','riskLevel','207324eEeTlB','5056269LxpRrL','map','4412XXWXed','locale','toLowerCase'];a167_0x37e4=function(){return _0x91c52a;};return a167_0x37e4();}function a167_0x1e26(_0x166562,_0x32b25b){_0x166562=_0x166562-0x1bb;const _0x37e426=a167_0x37e4();let _0x1e26b0=_0x37e426[_0x166562];return _0x1e26b0;}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x2e83b0){return TOP_LEVEL_CONFIG_KEYS['has'](_0x2e83b0);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':'env','apiDir':a167_0x26cc55(0x1c2),'cookie':a167_0x26cc55(0x1cc),'accessKey':a167_0x26cc55(0x1ca),'defaultFormat':a167_0x26cc55(0x1c4),'pageSize':a167_0x26cc55(0x1d0),'riskLevel':'riskLevel','locale':a167_0x26cc55(0x1d7)};export function getAppProfileFlagDefs(){const _0x146505=a167_0x26cc55;return[{'name':_0x146505(0x1c3),'type':_0x146505(0x1bb),'description':_0x146505(0x1cd),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x146505(0x1c2),'type':_0x146505(0x1bb),'description':'API\x20directory\x20path'},{'name':'cookie','type':_0x146505(0x1bb),'description':_0x146505(0x1c5),'hidden':!![]},{'name':_0x146505(0x1ca),'type':_0x146505(0x1bb),'description':_0x146505(0x1da),'hidden':!![]},{'name':_0x146505(0x1c6),'type':'string','description':_0x146505(0x1c0),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x146505(0x1c1),'description':_0x146505(0x1d9)},{'name':'riskLevel','type':_0x146505(0x1bb),'description':_0x146505(0x1bd),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x146505(0x1d7),'type':'string','description':_0x146505(0x1e0)}];}export function collectAppProfileOverrides(_0x84e37c){const _0x3b8185=a167_0x26cc55,_0x20d15b={};for(const [_0x3ef571,_0x3ed377]of Object[_0x3b8185(0x1bc)](APP_PROFILE_FLAG_KEY_MAP)){const _0x3a0be7=_0x84e37c(_0x3ef571);if(!_0x3a0be7)continue;_0x20d15b[_0x3ed377]=_0x3ed377===_0x3b8185(0x1d0)?Number(_0x3a0be7):_0x3a0be7;}return _0x20d15b;}export function buildAppProfileListFields(_0x1f66e6){const _0x5817a2=a167_0x26cc55;return{'env':_0x1f66e6[_0x5817a2(0x1c3)]??null,'apiDir':_0x1f66e6[_0x5817a2(0x1c2)]??null,'hasCookie':!!_0x1f66e6[_0x5817a2(0x1cc)],'hasAccessKey':!!_0x1f66e6['accessKey'],'format':_0x1f66e6[_0x5817a2(0x1c4)]??null,'pageSize':_0x1f66e6['pageSize']??null,'riskLevel':_0x1f66e6[_0x5817a2(0x1d2)]??null,'locale':_0x1f66e6['locale']??null};}export function buildAppDoctorFields(_0x4be2ee,_0x5713ec){const _0x1a9006=a167_0x26cc55;return{'env':{'value':_0x4be2ee[_0x1a9006(0x1c3)]||_0x5713ec['env'],'source':_0x4be2ee['env']?_0x1a9006(0x1e3):_0x1a9006(0x1dc)},'apiDir':{'value':_0x4be2ee[_0x1a9006(0x1c2)]||_0x5713ec[_0x1a9006(0x1c2)],'source':_0x4be2ee[_0x1a9006(0x1c2)]?'app':_0x1a9006(0x1dc)},'cookie':{'value':_0x4be2ee['cookie']||_0x5713ec[_0x1a9006(0x1cc)],'source':_0x4be2ee[_0x1a9006(0x1cc)]?_0x1a9006(0x1e3):'inherit'},'accessKey':{'value':_0x4be2ee[_0x1a9006(0x1ca)]||_0x5713ec[_0x1a9006(0x1ca)],'source':_0x4be2ee[_0x1a9006(0x1ca)]?_0x1a9006(0x1e3):'inherit'}};}export function buildCanonicalAppConfig(_0x4c3fa6,_0x29a09a){const _0x85698d=a167_0x26cc55,_0x348d14=_0x4c3fa6[_0x85698d(0x1d5)](_0x5543d9=>String(_0x5543d9||'')[_0x85698d(0x1c9)]())[_0x85698d(0x1e5)](Boolean);if(_0x348d14[_0x85698d(0x1de)]===0x0)return{};const _0x5df17e={};for(const _0x265f5c of _0x348d14){_0x5df17e[_0x265f5c]=_0x29a09a?{'appcode':_0x265f5c,'env':_0x29a09a}:{'appcode':_0x265f5c};}return{'apps':_0x5df17e,'defaultApp':_0x348d14[0x0]};}export function buildCanonicalProjectConfig(_0x3317a6,_0x67bf29){const _0x1235ec=a167_0x26cc55,{appCodes:appCodes=[],env:_0x298a7f,metadata:_0x4163ae}=_0x67bf29,_0x280422={..._0x3317a6,..._0x4163ae||{}};delete _0x280422[_0x1235ec(0x1df)],delete _0x280422['app'];if(_0x298a7f)_0x280422['env']=_0x298a7f;else!_0x280422[_0x1235ec(0x1c3)]&&(_0x280422[_0x1235ec(0x1c3)]=DEFAULT_CONFIG_VALUES[_0x1235ec(0x1c3)]);const _0x27e5c1=buildCanonicalAppConfig(appCodes,_0x280422[_0x1235ec(0x1c3)]);return Object['keys'](_0x27e5c1)[_0x1235ec(0x1de)]>0x0&&(_0x280422['apps']=_0x27e5c1[_0x1235ec(0x1e1)],_0x280422[_0x1235ec(0x1bf)]=_0x27e5c1[_0x1235ec(0x1bf)]),_0x280422;}const LOCALE_MAP={'zh':a167_0x26cc55(0x1cb),'zh-cn':'zh-CN','zh_cn':'zh-CN','en':a167_0x26cc55(0x1e4),'en-us':'en-US','en_us':a167_0x26cc55(0x1e4)};export function normalizeLocale(_0x2046fb){const _0x379df2=a167_0x26cc55;if(!_0x2046fb)return null;return LOCALE_MAP[_0x2046fb[_0x379df2(0x1d8)]()]??null;}
1
+ const a169_0x324d85=a169_0x300e;(function(_0x4b4537,_0x516bf7){const _0x346677=a169_0x300e,_0x201a3c=_0x4b4537();while(!![]){try{const _0x409bbf=-parseInt(_0x346677(0x14c))/0x1*(-parseInt(_0x346677(0x15b))/0x2)+-parseInt(_0x346677(0x14b))/0x3+parseInt(_0x346677(0x152))/0x4*(parseInt(_0x346677(0x145))/0x5)+parseInt(_0x346677(0x159))/0x6+-parseInt(_0x346677(0x158))/0x7*(-parseInt(_0x346677(0x157))/0x8)+-parseInt(_0x346677(0x14f))/0x9*(-parseInt(_0x346677(0x141))/0xa)+parseInt(_0x346677(0x151))/0xb*(-parseInt(_0x346677(0x14e))/0xc);if(_0x409bbf===_0x516bf7)break;else _0x201a3c['push'](_0x201a3c['shift']());}catch(_0x414968){_0x201a3c['push'](_0x201a3c['shift']());}}}(a169_0x27b9,0x6f43e));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';function a169_0x27b9(){const _0x117246=['format','pageSize','number','filter','trim','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','defaultFormat','Risk\x20level','map','cookie','2869540MyVtMZ','length','has','entries','915xIeQKu','apiDir','string','Locale','appcode','env','1829577wUgAXo','8IDmdvx','zh-CN','4161396SZKVuK','9LiChRv','apps','55jyDBJV','15316AjGoaW','accessKey','defaultApp','Auth\x20cookie','Default\x20page\x20size','72EnNUTk','589365qlPPzt','3425976CRJRfa','riskLevel','120776eXoPxH','API\x20directory\x20path','inherit','en-US','app','locale','Access\x20key'];a169_0x27b9=function(){return _0x117246;};return a169_0x27b9();}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=[a169_0x324d85(0x140),a169_0x324d85(0x153),a169_0x324d85(0x135),'format',a169_0x324d85(0x15a)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a169_0x324d85(0x149),a169_0x324d85(0x14a),a169_0x324d85(0x135),a169_0x324d85(0x137),a169_0x324d85(0x140),a169_0x324d85(0x153),a169_0x324d85(0x146)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x5ef5a7){return[..._0x5ef5a7]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x3fac13){const _0x281021=a169_0x324d85;return TOP_LEVEL_CONFIG_KEYS[_0x281021(0x143)](_0x3fac13);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a169_0x324d85(0x14a),'apiDir':a169_0x324d85(0x146),'cookie':a169_0x324d85(0x140),'accessKey':'accessKey','defaultFormat':a169_0x324d85(0x137),'pageSize':a169_0x324d85(0x138),'riskLevel':'riskLevel','locale':a169_0x324d85(0x135)};export function getAppProfileFlagDefs(){const _0xde9679=a169_0x324d85;return[{'name':_0xde9679(0x14a),'type':_0xde9679(0x147),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0xde9679(0x146),'type':_0xde9679(0x147),'description':_0xde9679(0x15c)},{'name':_0xde9679(0x140),'type':_0xde9679(0x147),'description':_0xde9679(0x155),'hidden':!![]},{'name':_0xde9679(0x153),'type':_0xde9679(0x147),'description':_0xde9679(0x136),'hidden':!![]},{'name':_0xde9679(0x13d),'type':_0xde9679(0x147),'description':_0xde9679(0x13c),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0xde9679(0x138),'type':_0xde9679(0x139),'description':_0xde9679(0x156)},{'name':_0xde9679(0x15a),'type':_0xde9679(0x147),'description':_0xde9679(0x13e),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':_0xde9679(0x147),'description':_0xde9679(0x148)}];}export function collectAppProfileOverrides(_0x4cb7e0){const _0x96ee5d=a169_0x324d85,_0x7fcb6d={};for(const [_0x9ee015,_0x17d858]of Object[_0x96ee5d(0x144)](APP_PROFILE_FLAG_KEY_MAP)){const _0x524bba=_0x4cb7e0(_0x9ee015);if(!_0x524bba)continue;_0x7fcb6d[_0x17d858]=_0x17d858==='pageSize'?Number(_0x524bba):_0x524bba;}return _0x7fcb6d;}export function buildAppProfileListFields(_0x3aa739){const _0x423012=a169_0x324d85;return{'env':_0x3aa739['env']??null,'apiDir':_0x3aa739[_0x423012(0x146)]??null,'hasCookie':!!_0x3aa739[_0x423012(0x140)],'hasAccessKey':!!_0x3aa739[_0x423012(0x153)],'format':_0x3aa739[_0x423012(0x137)]??null,'pageSize':_0x3aa739[_0x423012(0x138)]??null,'riskLevel':_0x3aa739[_0x423012(0x15a)]??null,'locale':_0x3aa739['locale']??null};}export function buildAppDoctorFields(_0x14278e,_0x586da1){const _0x49c6b3=a169_0x324d85;return{'env':{'value':_0x14278e[_0x49c6b3(0x14a)]||_0x586da1[_0x49c6b3(0x14a)],'source':_0x14278e[_0x49c6b3(0x14a)]?_0x49c6b3(0x15f):_0x49c6b3(0x15d)},'apiDir':{'value':_0x14278e[_0x49c6b3(0x146)]||_0x586da1[_0x49c6b3(0x146)],'source':_0x14278e['apiDir']?_0x49c6b3(0x15f):'inherit'},'cookie':{'value':_0x14278e[_0x49c6b3(0x140)]||_0x586da1[_0x49c6b3(0x140)],'source':_0x14278e[_0x49c6b3(0x140)]?'app':_0x49c6b3(0x15d)},'accessKey':{'value':_0x14278e[_0x49c6b3(0x153)]||_0x586da1[_0x49c6b3(0x153)],'source':_0x14278e[_0x49c6b3(0x153)]?_0x49c6b3(0x15f):_0x49c6b3(0x15d)}};}export function buildCanonicalAppConfig(_0x16e65b,_0xdbfad1){const _0x26f0bd=a169_0x324d85,_0x3e6674=_0x16e65b[_0x26f0bd(0x13f)](_0x4a40a4=>String(_0x4a40a4||'')[_0x26f0bd(0x13b)]())[_0x26f0bd(0x13a)](Boolean);if(_0x3e6674[_0x26f0bd(0x142)]===0x0)return{};const _0x30cebb={};for(const _0xc18efc of _0x3e6674){_0x30cebb[_0xc18efc]=_0xdbfad1?{'appcode':_0xc18efc,'env':_0xdbfad1}:{'appcode':_0xc18efc};}return{'apps':_0x30cebb,'defaultApp':_0x3e6674[0x0]};}export function buildCanonicalProjectConfig(_0x371c55,_0x4f6adb){const _0x3694dd=a169_0x324d85,{appCodes:appCodes=[],env:_0x44c4c9,metadata:_0x5adcab}=_0x4f6adb,_0x38da93={..._0x371c55,..._0x5adcab||{}};delete _0x38da93['appcode'],delete _0x38da93[_0x3694dd(0x15f)];if(_0x44c4c9)_0x38da93[_0x3694dd(0x14a)]=_0x44c4c9;else!_0x38da93['env']&&(_0x38da93[_0x3694dd(0x14a)]=DEFAULT_CONFIG_VALUES[_0x3694dd(0x14a)]);const _0x3bc9d5=buildCanonicalAppConfig(appCodes,_0x38da93[_0x3694dd(0x14a)]);return Object['keys'](_0x3bc9d5)[_0x3694dd(0x142)]>0x0&&(_0x38da93[_0x3694dd(0x150)]=_0x3bc9d5[_0x3694dd(0x150)],_0x38da93[_0x3694dd(0x154)]=_0x3bc9d5[_0x3694dd(0x154)]),_0x38da93;}const LOCALE_MAP={'zh':a169_0x324d85(0x14d),'zh-cn':'zh-CN','zh_cn':'zh-CN','en':a169_0x324d85(0x15e),'en-us':'en-US','en_us':a169_0x324d85(0x15e)};function a169_0x300e(_0x1ec621,_0x47e6a4){_0x1ec621=_0x1ec621-0x135;const _0x27b97b=a169_0x27b9();let _0x300ee3=_0x27b97b[_0x1ec621];return _0x300ee3;}export function normalizeLocale(_0x4f7b3c){if(!_0x4f7b3c)return null;return LOCALE_MAP[_0x4f7b3c['toLowerCase']()]??null;}
@@ -1 +1 @@
1
- const a168_0x4fe555=a168_0x43ae;function a168_0x43ae(_0x2817c4,_0x2af72c){_0x2817c4=_0x2817c4-0xce;const _0x10db27=a168_0x10db();let _0x43aeee=_0x10db27[_0x2817c4];return _0x43aeee;}function a168_0x10db(){const _0x33d19d=['391634iyBrvo','4053709MHIIOS','23211RnlHIb','2833520DWhSqg','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','75318lQKsdk','1DARGPI','1576YbUNnC','179223hcobby','392LJheTb','8NtygnA','225125LatSyh'];a168_0x10db=function(){return _0x33d19d;};return a168_0x10db();}(function(_0x366f99,_0x1aeb06){const _0x84a567=a168_0x43ae,_0x487d1=_0x366f99();while(!![]){try{const _0x3ae719=-parseInt(_0x84a567(0xd3))/0x1*(parseInt(_0x84a567(0xd9))/0x2)+-parseInt(_0x84a567(0xd5))/0x3*(-parseInt(_0x84a567(0xd7))/0x4)+parseInt(_0x84a567(0xd8))/0x5+-parseInt(_0x84a567(0xd2))/0x6*(parseInt(_0x84a567(0xd6))/0x7)+parseInt(_0x84a567(0xd4))/0x8*(parseInt(_0x84a567(0xcf))/0x9)+parseInt(_0x84a567(0xd0))/0xa+parseInt(_0x84a567(0xce))/0xb;if(_0x3ae719===_0x1aeb06)break;else _0x487d1['push'](_0x487d1['shift']());}catch(_0xd2c942){_0x487d1['push'](_0x487d1['shift']());}}}(a168_0x10db,0x67eb8));export const CLI_VERSION_POLICY_URL=a168_0x4fe555(0xd1);
1
+ (function(_0x2fda86,_0x22e2e1){const _0x4b6c90=a170_0x55a0,_0x383f31=_0x2fda86();while(!![]){try{const _0x20b492=-parseInt(_0x4b6c90(0xb9))/0x1+-parseInt(_0x4b6c90(0xbf))/0x2*(parseInt(_0x4b6c90(0xbe))/0x3)+-parseInt(_0x4b6c90(0xc2))/0x4+parseInt(_0x4b6c90(0xc0))/0x5+parseInt(_0x4b6c90(0xbd))/0x6+-parseInt(_0x4b6c90(0xc1))/0x7*(parseInt(_0x4b6c90(0xbc))/0x8)+-parseInt(_0x4b6c90(0xbb))/0x9*(-parseInt(_0x4b6c90(0xba))/0xa);if(_0x20b492===_0x22e2e1)break;else _0x383f31['push'](_0x383f31['shift']());}catch(_0x35a42b){_0x383f31['push'](_0x383f31['shift']());}}}(a170_0x42e4,0x281a2));export const CLI_VERSION_POLICY_URL='https://g.lovrabet.com/dist/rabetbase-cli/config/index.json';function a170_0x55a0(_0x26209d,_0x338ba6){_0x26209d=_0x26209d-0xb9;const _0x42e4aa=a170_0x42e4();let _0x55a076=_0x42e4aa[_0x26209d];return _0x55a076;}function a170_0x42e4(){const _0x4e6185=['13533cWKOoJ','142XNgENQ','71080qtuHbR','14Pdyian','277964glkSqk','145279IVafHJ','8628820PUiLCB','9NLSxdn','1101496fcbSsm','585510uOaUfa'];a170_0x42e4=function(){return _0x4e6185;};return a170_0x42e4();}