@lovrabet/rabetbase-cli 2.3.14 → 2.3.15-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) 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/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/capability.js +1 -1
  63. package/lib/commands/dataset/delete.js +1 -1
  64. package/lib/commands/dataset/detail.js +1 -1
  65. package/lib/commands/dataset/extend-update.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/db/analysis-batching.js +1 -1
  80. package/lib/commands/db/analyze-batch-plan.js +1 -1
  81. package/lib/commands/db/analyze-cancel.js +1 -1
  82. package/lib/commands/db/analyze-start.js +1 -1
  83. package/lib/commands/db/analyze-status.js +1 -1
  84. package/lib/commands/db/create.js +1 -1
  85. package/lib/commands/db/delete.js +1 -1
  86. package/lib/commands/db/detail.js +1 -1
  87. package/lib/commands/db/diff.js +1 -1
  88. package/lib/commands/db/index.js +1 -1
  89. package/lib/commands/db/list.js +1 -1
  90. package/lib/commands/db/shared.js +1 -1
  91. package/lib/commands/db/tables.js +1 -1
  92. package/lib/commands/db/test.js +1 -1
  93. package/lib/commands/db/update.js +1 -1
  94. package/lib/commands/doctor.js +1 -1
  95. package/lib/commands/file/index.js +1 -1
  96. package/lib/commands/init/index.js +1 -1
  97. package/lib/commands/issue/index.js +1 -1
  98. package/lib/commands/issue/nudge.js +1 -1
  99. package/lib/commands/issue/report.js +1 -1
  100. package/lib/commands/issue/shared.js +1 -1
  101. package/lib/commands/logs/index.js +1 -1
  102. package/lib/commands/menu/asset-update.js +1 -1
  103. package/lib/commands/menu/delete.js +1 -1
  104. package/lib/commands/menu/external-link-create.js +1 -1
  105. package/lib/commands/menu/external-link-update.js +1 -1
  106. package/lib/commands/menu/group-create.js +1 -1
  107. package/lib/commands/menu/group-update.js +1 -1
  108. package/lib/commands/menu/index.js +1 -1
  109. package/lib/commands/menu/list.js +1 -1
  110. package/lib/commands/menu/move.js +1 -1
  111. package/lib/commands/menu/regroup-start.js +1 -1
  112. package/lib/commands/menu/rename.js +1 -0
  113. package/lib/commands/menu/shared/compare-table.js +1 -1
  114. package/lib/commands/menu/shared/delete-plan.js +1 -1
  115. package/lib/commands/menu/shared/facts.js +1 -1
  116. package/lib/commands/menu/shared/index.js +1 -1
  117. package/lib/commands/menu/shared/inquirer.js +1 -1
  118. package/lib/commands/menu/shared/local-pages.js +1 -1
  119. package/lib/commands/menu/shared/logic.js +1 -1
  120. package/lib/commands/menu/shared/mutations.js +1 -1
  121. package/lib/commands/menu/shared/service.js +1 -1
  122. package/lib/commands/menu/shared/sync-core.js +1 -1
  123. package/lib/commands/menu/shared/update-core.js +1 -1
  124. package/lib/commands/menu/shared/valid-url.js +1 -1
  125. package/lib/commands/menu/sync.js +1 -1
  126. package/lib/commands/notification/config-list.js +1 -1
  127. package/lib/commands/notification/index.js +1 -1
  128. package/lib/commands/ocr/index.js +1 -1
  129. package/lib/commands/page/generate-start.js +1 -1
  130. package/lib/commands/page/generate-status.js +1 -1
  131. package/lib/commands/page/index.js +1 -1
  132. package/lib/commands/page/pull.js +1 -1
  133. package/lib/commands/page/push.js +1 -1
  134. package/lib/commands/page/relation-audit.js +1 -1
  135. package/lib/commands/page/restore.js +1 -1
  136. package/lib/commands/page/shared.js +1 -1
  137. package/lib/commands/page/standard-page-status.js +1 -1
  138. package/lib/commands/page/sync.js +1 -1
  139. package/lib/commands/permit/index.js +1 -1
  140. package/lib/commands/permit/page-get.js +1 -1
  141. package/lib/commands/permit/page-set.js +1 -1
  142. package/lib/commands/permit/role-apis-set.js +1 -1
  143. package/lib/commands/permit/role-menus-set.js +1 -1
  144. package/lib/commands/permit/role-menus.js +1 -1
  145. package/lib/commands/permit/shared.js +1 -1
  146. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  147. package/lib/commands/project/create/format-elapsed.js +1 -1
  148. package/lib/commands/project/create/main.js +1 -1
  149. package/lib/commands/project/create/non-interactive.js +1 -1
  150. package/lib/commands/project/create/project-template-path.js +1 -1
  151. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  152. package/lib/commands/project/create/use-format-code.js +1 -1
  153. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  154. package/lib/commands/project/index.js +1 -1
  155. package/lib/commands/project/init.js +1 -1
  156. package/lib/commands/project/upgrade.js +1 -1
  157. package/lib/commands/registry.js +1 -1
  158. package/lib/commands/role/create.js +1 -1
  159. package/lib/commands/role/delete.js +1 -1
  160. package/lib/commands/role/detail.js +1 -1
  161. package/lib/commands/role/index.js +1 -1
  162. package/lib/commands/role/list.js +1 -1
  163. package/lib/commands/role/shared.js +1 -1
  164. package/lib/commands/role/update.js +1 -1
  165. package/lib/commands/role/user-add.js +1 -1
  166. package/lib/commands/role/user-remove.js +1 -1
  167. package/lib/commands/role/user-resolve.js +1 -1
  168. package/lib/commands/run/index.js +1 -1
  169. package/lib/commands/schema.js +1 -1
  170. package/lib/commands/sql/create.js +1 -1
  171. package/lib/commands/sql/delete.js +1 -1
  172. package/lib/commands/sql/detail.js +1 -1
  173. package/lib/commands/sql/exec.js +1 -1
  174. package/lib/commands/sql/index.js +1 -1
  175. package/lib/commands/sql/list.js +1 -1
  176. package/lib/commands/sql/pull.js +1 -1
  177. package/lib/commands/sql/push.js +1 -1
  178. package/lib/commands/sql/save.js +1 -1
  179. package/lib/commands/sql/shared.js +1 -1
  180. package/lib/commands/sql/status.js +1 -1
  181. package/lib/commands/sql/validate.js +1 -1
  182. package/lib/commands/task/index.js +1 -1
  183. package/lib/commands/task/status.js +1 -1
  184. package/lib/commands/workspace/add.js +1 -1
  185. package/lib/commands/workspace/index.js +1 -1
  186. package/lib/commands/workspace/remove.js +1 -1
  187. package/lib/config/schema.js +1 -1
  188. package/lib/constant/cdn.js +1 -1
  189. package/lib/constant/cli.js +1 -1
  190. package/lib/constant/defaults.js +1 -1
  191. package/lib/constant/domain.js +1 -1
  192. package/lib/constant/env.js +1 -1
  193. package/lib/constant/output.js +1 -1
  194. package/lib/constant/paths.js +1 -1
  195. package/lib/constant/risk.js +1 -1
  196. package/lib/context/app-resolver.js +1 -1
  197. package/lib/context/auth-resolver.js +1 -1
  198. package/lib/context/config-loader.js +1 -1
  199. package/lib/context.js +1 -1
  200. package/lib/core/alias-resolver.js +1 -1
  201. package/lib/core/api-client.js +1 -1
  202. package/lib/core/bff/config.js +1 -1
  203. package/lib/core/bff/file-system.js +1 -1
  204. package/lib/core/bff/hash.js +1 -1
  205. package/lib/core/bff/lock.js +1 -1
  206. package/lib/core/bff/utils.js +1 -1
  207. package/lib/core/db-resolver.js +1 -1
  208. package/lib/core/page/file-system.js +1 -1
  209. package/lib/core/page/hash.js +1 -1
  210. package/lib/core/page/lock.js +1 -1
  211. package/lib/core/sql-index-auditor.js +1 -1
  212. package/lib/core/sql-sync/config.js +1 -1
  213. package/lib/core/sql-sync/file-system.js +1 -1
  214. package/lib/core/sql-sync/hash.js +1 -1
  215. package/lib/core/sql-sync/lock.js +1 -1
  216. package/lib/core/sql-sync/utils.js +1 -1
  217. package/lib/core/sql-validator.js +1 -1
  218. package/lib/errors.js +1 -1
  219. package/lib/framework/build-all-flags.js +1 -1
  220. package/lib/framework/error-output.js +1 -1
  221. package/lib/framework/explicit-yes.js +1 -1
  222. package/lib/framework/flags.js +1 -1
  223. package/lib/framework/help.js +1 -1
  224. package/lib/framework/index.js +1 -1
  225. package/lib/framework/output.js +1 -1
  226. package/lib/framework/response.js +1 -1
  227. package/lib/framework/runner-alias.js +1 -1
  228. package/lib/framework/runner.js +1 -1
  229. package/lib/framework/schema-export.js +1 -1
  230. package/lib/framework/types.js +1 -1
  231. package/lib/generated/build-info.js +1 -1
  232. package/lib/help.js +1 -1
  233. package/lib/skills/main.js +1 -1
  234. package/lib/skills/npx-skills-add.js +1 -1
  235. package/lib/telemetry/cli-command-trace.js +1 -1
  236. package/lib/telemetry/cli-help-trace.js +1 -1
  237. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  238. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  239. package/lib/telemetry/send-cli-trace-log.js +1 -1
  240. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  241. package/lib/utils/ai_config.js +1 -1
  242. package/lib/utils/apply-jq-filter.js +1 -1
  243. package/lib/utils/cdn-config.js +1 -1
  244. package/lib/utils/check-sdk-version.js +1 -1
  245. package/lib/utils/cli-version-check.js +1 -1
  246. package/lib/utils/cli-version-policy.js +1 -1
  247. package/lib/utils/config.js +1 -1
  248. package/lib/utils/copy-directory.js +1 -1
  249. package/lib/utils/entity-with-id.js +1 -1
  250. package/lib/utils/file-utils.js +1 -1
  251. package/lib/utils/guides-cdn.js +1 -1
  252. package/lib/utils/http-client.js +1 -1
  253. package/lib/utils/is-non-interactive.js +1 -1
  254. package/lib/utils/logger.js +1 -1
  255. package/lib/utils/params.js +1 -1
  256. package/lib/utils/platform.js +1 -1
  257. package/lib/utils/rules-cdn.js +1 -1
  258. package/lib/utils/sleep.js +1 -1
  259. package/lib/utils/template-replacer.js +1 -1
  260. package/lib/utils/update-notice.js +1 -1
  261. package/lib/utils/version.js +1 -1
  262. package/lib/utils/with-active-cookie.js +1 -1
  263. package/lib/utils/write-cli-side-channel.js +1 -1
  264. package/package.json +1 -1
@@ -1 +1 @@
1
- const a172_0x38c5fb=a172_0x4b7a;(function(_0x30f750,_0x18c848){const _0xd3eed=a172_0x4b7a,_0xc2a186=_0x30f750();while(!![]){try{const _0x48bd50=-parseInt(_0xd3eed(0x135))/0x1+-parseInt(_0xd3eed(0x136))/0x2+-parseInt(_0xd3eed(0x139))/0x3*(parseInt(_0xd3eed(0x147))/0x4)+parseInt(_0xd3eed(0x149))/0x5*(parseInt(_0xd3eed(0x13b))/0x6)+-parseInt(_0xd3eed(0x148))/0x7+-parseInt(_0xd3eed(0x144))/0x8*(-parseInt(_0xd3eed(0x14b))/0x9)+parseInt(_0xd3eed(0x13d))/0xa*(parseInt(_0xd3eed(0x134))/0xb);if(_0x48bd50===_0x18c848)break;else _0xc2a186['push'](_0xc2a186['shift']());}catch(_0x39da58){_0xc2a186['push'](_0xc2a186['shift']());}}}(a172_0x4f4f,0xc1d9e));import{executeSql}from'../../core/api-client.js';function a172_0x4b7a(_0x2b201c,_0x307c0e){_0x2b201c=_0x2b201c-0x132;const _0x4f4f3b=a172_0x4f4f();let _0x4b7a7f=_0x4f4f3b[_0x2b201c];return _0x4b7a7f;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a172_0x4f4f(){const _0x5d80a2=['26644519oPTDbp','899805MCJLHQ','1596556TFXyVv','execError','sql','95022mHqSBY','SQL\x20execution\x20failed','6zlQNSf','read','10UmJKXk','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','str','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','now','execSuccess','string','3433448FRnxjo','sqlcode','\x20row(s)\x20in\x20','72xYGFSB','9442048GDqzPl','7798415ZlbyqU','length','9LSoAbT','appCode','execResult','params','Returned\x20'];a172_0x4f4f=function(){return _0x5d80a2;};return a172_0x4f4f();}export const sqlExec={'service':a172_0x38c5fb(0x138),'command':'exec','description':a172_0x38c5fb(0x13e),'risk':a172_0x38c5fb(0x13c),'flags':[SQLCODE_FLAG,{'name':a172_0x38c5fb(0x132),'type':a172_0x38c5fb(0x143),'description':a172_0x38c5fb(0x140)}],async 'execute'(_0x231c47){const _0x1e2284=a172_0x38c5fb,_0x1ae8e4=parseJsonParams(_0x231c47[_0x1e2284(0x13f)](_0x1e2284(0x132))),_0x5c56e7=Date[_0x1e2284(0x141)](),_0x3e42b6=await executeSql(_0x231c47[_0x1e2284(0x14c)],_0x231c47['str'](_0x1e2284(0x145)),_0x1ae8e4),_0x3fbd6e=Date[_0x1e2284(0x141)]()-_0x5c56e7,_0x520521=_0x3e42b6?.[_0x1e2284(0x14d)]??_0x3e42b6,_0x208dcf=_0x3e42b6?.[_0x1e2284(0x142)]??!![];if(!_0x208dcf)return{'ok':![],'data':{'error':_0x3e42b6?.[_0x1e2284(0x137)]||'SQL\x20execution\x20failed','elapsed':_0x3fbd6e},'message':_0x1e2284(0x13a)};const _0x45e733=Array['isArray'](_0x520521)?_0x520521:[];return{'ok':!![],'data':{'rows':_0x45e733,'rowCount':_0x45e733[_0x1e2284(0x14a)],'elapsed':_0x3fbd6e},'message':_0x1e2284(0x133)+_0x45e733[_0x1e2284(0x14a)]+_0x1e2284(0x146)+_0x3fbd6e+'ms'};}};
1
+ const a173_0x2f5841=a173_0x1ec8;(function(_0x1ba0f9,_0x200ad5){const _0x5762a7=a173_0x1ec8,_0x3997d6=_0x1ba0f9();while(!![]){try{const _0x4039ed=-parseInt(_0x5762a7(0xe1))/0x1+-parseInt(_0x5762a7(0xe7))/0x2+-parseInt(_0x5762a7(0xdc))/0x3+parseInt(_0x5762a7(0xe9))/0x4*(parseInt(_0x5762a7(0xe5))/0x5)+-parseInt(_0x5762a7(0xe4))/0x6+-parseInt(_0x5762a7(0xda))/0x7*(parseInt(_0x5762a7(0xf1))/0x8)+parseInt(_0x5762a7(0xea))/0x9;if(_0x4039ed===_0x200ad5)break;else _0x3997d6['push'](_0x3997d6['shift']());}catch(_0x4dc7aa){_0x3997d6['push'](_0x3997d6['shift']());}}}(a173_0x1cb7,0x5d5a1));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a173_0x1ec8(_0xe5aa7e,_0x237499){_0xe5aa7e=_0xe5aa7e-0xda;const _0x1cb74f=a173_0x1cb7();let _0x1ec8da=_0x1cb74f[_0xe5aa7e];return _0x1ec8da;}function a173_0x1cb7(){const _0x321311=['3294120CfsIxr','10VxzZPk','execResult','454264ASAdTf','length','247716kFtLIi','19585593DoNerz','str','now','execError','read','sql','\x20row(s)\x20in\x20','8yPBSyR','2016511cMrwWl','execSuccess','802653MVdcZG','appCode','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','isArray','exec','585890QonjkT','sqlcode','params'];a173_0x1cb7=function(){return _0x321311;};return a173_0x1cb7();}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a173_0x2f5841(0xef),'command':a173_0x2f5841(0xe0),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a173_0x2f5841(0xee),'flags':[SQLCODE_FLAG,{'name':a173_0x2f5841(0xe3),'type':'string','description':a173_0x2f5841(0xde)}],async 'execute'(_0x10c379){const _0x2a4d0e=a173_0x2f5841,_0x558a37=parseJsonParams(_0x10c379[_0x2a4d0e(0xeb)](_0x2a4d0e(0xe3))),_0x16561d=Date[_0x2a4d0e(0xec)](),_0x50f7a3=await executeSql(_0x10c379[_0x2a4d0e(0xdd)],_0x10c379[_0x2a4d0e(0xeb)](_0x2a4d0e(0xe2)),_0x558a37),_0x3f2ad3=Date['now']()-_0x16561d,_0x2d5c88=_0x50f7a3?.[_0x2a4d0e(0xe6)]??_0x50f7a3,_0x51afed=_0x50f7a3?.[_0x2a4d0e(0xdb)]??!![];if(!_0x51afed)return{'ok':![],'data':{'error':_0x50f7a3?.[_0x2a4d0e(0xed)]||'SQL\x20execution\x20failed','elapsed':_0x3f2ad3},'message':'SQL\x20execution\x20failed'};const _0x3a1b63=Array[_0x2a4d0e(0xdf)](_0x2d5c88)?_0x2d5c88:[];return{'ok':!![],'data':{'rows':_0x3a1b63,'rowCount':_0x3a1b63[_0x2a4d0e(0xe8)],'elapsed':_0x3f2ad3},'message':'Returned\x20'+_0x3a1b63['length']+_0x2a4d0e(0xf0)+_0x3f2ad3+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x48f89b,_0x215389){const _0x3fe1b3=a173_0x457c,_0x5c3e09=_0x48f89b();while(!![]){try{const _0x39ae03=-parseInt(_0x3fe1b3(0x17f))/0x1*(-parseInt(_0x3fe1b3(0x17d))/0x2)+parseInt(_0x3fe1b3(0x17b))/0x3*(-parseInt(_0x3fe1b3(0x17e))/0x4)+parseInt(_0x3fe1b3(0x179))/0x5+parseInt(_0x3fe1b3(0x180))/0x6+parseInt(_0x3fe1b3(0x17c))/0x7*(parseInt(_0x3fe1b3(0x182))/0x8)+-parseInt(_0x3fe1b3(0x17a))/0x9+-parseInt(_0x3fe1b3(0x181))/0xa;if(_0x39ae03===_0x215389)break;else _0x5c3e09['push'](_0x5c3e09['shift']());}catch(_0x13f3f8){_0x5c3e09['push'](_0x5c3e09['shift']());}}}(a173_0x3781,0xd3582));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a173_0x3781(){const _0x17bf20=['6769953lMAvpQ','4038gTVvxQ','2758TIqGfI','9412vqxnYR','1244fZnIsr','305NqrOTb','76494nmelHz','8675020eogwjh','6592EcQobM','5656280dMYFVN'];a173_0x3781=function(){return _0x17bf20;};return a173_0x3781();}function a173_0x457c(_0x1bbf00,_0x4e7e09){_0x1bbf00=_0x1bbf00-0x179;const _0x378147=a173_0x3781();let _0x457cff=_0x378147[_0x1bbf00];return _0x457cff;}import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';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(_0x38c1b1,_0x440b9f){const _0x4bcdab=a174_0x3219,_0x3a2acb=_0x38c1b1();while(!![]){try{const _0x23b36a=parseInt(_0x4bcdab(0x1df))/0x1*(parseInt(_0x4bcdab(0x1d7))/0x2)+-parseInt(_0x4bcdab(0x1dc))/0x3*(parseInt(_0x4bcdab(0x1db))/0x4)+parseInt(_0x4bcdab(0x1dd))/0x5*(parseInt(_0x4bcdab(0x1de))/0x6)+-parseInt(_0x4bcdab(0x1e2))/0x7*(-parseInt(_0x4bcdab(0x1e1))/0x8)+-parseInt(_0x4bcdab(0x1d9))/0x9+-parseInt(_0x4bcdab(0x1d8))/0xa*(-parseInt(_0x4bcdab(0x1da))/0xb)+-parseInt(_0x4bcdab(0x1e0))/0xc;if(_0x23b36a===_0x440b9f)break;else _0x3a2acb['push'](_0x3a2acb['shift']());}catch(_0x18e960){_0x3a2acb['push'](_0x3a2acb['shift']());}}}(a174_0x5953,0x58332));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';import{sqlPull}from'../../commands/sql/pull.js';function a174_0x5953(){const _0x1dffd8=['4dLlLbX','392556oCtFNn','185wOaDWK','35844qLDNRP','117dyQNJd','11875080EQNMME','16dVETFE','2081947xyTzdm','5010hzzeyf','39820bLGRtR','766683FxTABt','1265CQAvqd'];a174_0x5953=function(){return _0x1dffd8;};return a174_0x5953();}import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';function a174_0x3219(_0xda8ba5,_0x3d184b){_0xda8ba5=_0xda8ba5-0x1d7;const _0x59532b=a174_0x5953();let _0x321952=_0x59532b[_0xda8ba5];return _0x321952;}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- function a174_0x1022(){const _0x1fb5c1=['tableData','606677smepBE','appCode','745998NjLGaz','read','length','page','2051608tqtdya','boolean','4817029ZYQQsc','975955uhMLHh','string','2GLfjAk','bool','sqlName','num','description','dbId','sqlCode','paging','15279870nNrwZI','12GajyUX','str','4219956mehkTG','pagesize','List\x20custom\x20SQL\x20queries','all','sql','totalCount','Page\x20size','sqlcode','number','Filter\x20by\x20SQL\x20name','Page\x20number','6hBdpuq','name'];a174_0x1022=function(){return _0x1fb5c1;};return a174_0x1022();}const a174_0x301e5c=a174_0x32ba;function a174_0x32ba(_0x45aa9a,_0x1e0e1d){_0x45aa9a=_0x45aa9a-0x186;const _0x10226f=a174_0x1022();let _0x32baf8=_0x10226f[_0x45aa9a];return _0x32baf8;}(function(_0x1b9c3f,_0x451f60){const _0x993cd2=a174_0x32ba,_0x506b94=_0x1b9c3f();while(!![]){try{const _0x381900=-parseInt(_0x993cd2(0x186))/0x1+parseInt(_0x993cd2(0x191))/0x2*(-parseInt(_0x993cd2(0x188))/0x3)+-parseInt(_0x993cd2(0x19a))/0x4*(-parseInt(_0x993cd2(0x18f))/0x5)+parseInt(_0x993cd2(0x1a7))/0x6*(-parseInt(_0x993cd2(0x18e))/0x7)+parseInt(_0x993cd2(0x18c))/0x8+-parseInt(_0x993cd2(0x19c))/0x9+parseInt(_0x993cd2(0x199))/0xa;if(_0x381900===_0x451f60)break;else _0x506b94['push'](_0x506b94['shift']());}catch(_0x10a2fd){_0x506b94['push'](_0x506b94['shift']());}}}(a174_0x1022,0x57505));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':a174_0x301e5c(0x1a0),'command':'list','description':a174_0x301e5c(0x19e),'risk':a174_0x301e5c(0x189),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a174_0x301e5c(0x1a8),'type':a174_0x301e5c(0x190),'description':a174_0x301e5c(0x1a5)},{'name':a174_0x301e5c(0x18b),'type':a174_0x301e5c(0x1a4),'description':a174_0x301e5c(0x1a6),'default':0x1},{'name':a174_0x301e5c(0x19d),'type':a174_0x301e5c(0x1a4),'description':a174_0x301e5c(0x1a2)},{'name':'verbose','type':a174_0x301e5c(0x18d),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x3f95fa){const _0x67e7a2=a174_0x301e5c,_0x25a3f8=await listSqlQueries(_0x3f95fa[_0x67e7a2(0x187)],{'sqlCode':_0x3f95fa[_0x67e7a2(0x19b)](_0x67e7a2(0x1a3))||undefined,'sqlName':_0x3f95fa['str']('name')||undefined,'currentPage':_0x3f95fa[_0x67e7a2(0x194)](_0x67e7a2(0x18b)),'pageSize':_0x3f95fa['num'](_0x67e7a2(0x19d),0x32)}),_0x2a741a=_0x3f95fa[_0x67e7a2(0x192)]('verbose'),_0x5d6e2c=_0x25a3f8[_0x67e7a2(0x1a9)]??[],_0x4ec37e=_0x25a3f8[_0x67e7a2(0x198)]?.[_0x67e7a2(0x1a1)]??_0x5d6e2c[_0x67e7a2(0x18a)];let _0x1fde1a;return _0x2a741a?_0x1fde1a=_0x5d6e2c:_0x1fde1a=await Promise[_0x67e7a2(0x19f)](_0x5d6e2c['map'](async _0x170f57=>{const _0x4c74b0=_0x67e7a2;let _0x2151fb;try{_0x2151fb=_0x170f57[_0x4c74b0(0x196)]?await getDbName(_0x3f95fa[_0x4c74b0(0x187)],_0x170f57[_0x4c74b0(0x196)]):undefined;}catch{}return{'sqlCode':_0x170f57[_0x4c74b0(0x197)],'sqlName':_0x170f57[_0x4c74b0(0x193)],'description':_0x170f57[_0x4c74b0(0x195)]??'','db':_0x2151fb?_0x2151fb+'\x20('+_0x170f57[_0x4c74b0(0x196)]+')':_0x170f57['dbId']??''};})),{'ok':!![],'data':_0x1fde1a,'message':_0x5d6e2c[_0x67e7a2(0x18a)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x5d6e2c[_0x67e7a2(0x18a)]+'\x20SQL\x20queries\x20(total:\x20'+_0x4ec37e+').'};}};
1
+ function a175_0x2a29(_0x6f5b72,_0x48c74a){_0x6f5b72=_0x6f5b72-0xcc;const _0x1c0555=a175_0x1c05();let _0x2a299e=_0x1c0555[_0x6f5b72];return _0x2a299e;}const a175_0x16cad4=a175_0x2a29;function a175_0x1c05(){const _0x4b6852=['bool','568572upzjiw','Found\x20','10CgHkZk','128IhkDMs','No\x20custom\x20SQL\x20queries\x20found.','sqlcode','463836hvzKSD','boolean','all','328372yxbCfy','number','pagesize','sqlCode','string','length','22054Uodfxa','sql','appCode','Filter\x20by\x20SQL\x20name','Page\x20number','7zZPHYG','dbId','map','page','verbose','read','num','27693AqRTsO','77046KYlGNy','paging','Page\x20size','\x20SQL\x20queries\x20(total:\x20','str','1AiifaP','name','348705yDYCfB','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','description'];a175_0x1c05=function(){return _0x4b6852;};return a175_0x1c05();}(function(_0x543209,_0x2e6d8e){const _0x46c576=a175_0x2a29,_0x308129=_0x543209();while(!![]){try{const _0x402560=parseInt(_0x46c576(0xf1))/0x1*(parseInt(_0x46c576(0xdf))/0x2)+parseInt(_0x46c576(0xec))/0x3+parseInt(_0x46c576(0xd0))/0x4+-parseInt(_0x46c576(0xcc))/0x5+parseInt(_0x46c576(0xd6))/0x6*(-parseInt(_0x46c576(0xe4))/0x7)+-parseInt(_0x46c576(0xd3))/0x8*(-parseInt(_0x46c576(0xeb))/0x9)+-parseInt(_0x46c576(0xd2))/0xa*(-parseInt(_0x46c576(0xd9))/0xb);if(_0x402560===_0x2e6d8e)break;else _0x308129['push'](_0x308129['shift']());}catch(_0x2b9ec2){_0x308129['push'](_0x308129['shift']());}}}(a175_0x1c05,0x1b129));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':a175_0x16cad4(0xe0),'command':'list','description':'List\x20custom\x20SQL\x20queries','risk':a175_0x16cad4(0xe9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a175_0x16cad4(0xf2),'type':a175_0x16cad4(0xdd),'description':a175_0x16cad4(0xe2)},{'name':a175_0x16cad4(0xe7),'type':'number','description':a175_0x16cad4(0xe3),'default':0x1},{'name':a175_0x16cad4(0xdb),'type':a175_0x16cad4(0xda),'description':a175_0x16cad4(0xee)},{'name':a175_0x16cad4(0xe8),'type':a175_0x16cad4(0xd7),'description':a175_0x16cad4(0xcd)}],async 'execute'(_0x1aecf7){const _0x3ac529=a175_0x16cad4,_0x56039a=await listSqlQueries(_0x1aecf7['appCode'],{'sqlCode':_0x1aecf7[_0x3ac529(0xf0)](_0x3ac529(0xd5))||undefined,'sqlName':_0x1aecf7['str']('name')||undefined,'currentPage':_0x1aecf7[_0x3ac529(0xea)](_0x3ac529(0xe7)),'pageSize':_0x1aecf7['num'](_0x3ac529(0xdb),0x32)}),_0x6baa56=_0x1aecf7[_0x3ac529(0xcf)](_0x3ac529(0xe8)),_0x3c9768=_0x56039a['tableData']??[],_0x2c95e6=_0x56039a[_0x3ac529(0xed)]?.['totalCount']??_0x3c9768[_0x3ac529(0xde)];let _0x51f608;return _0x6baa56?_0x51f608=_0x3c9768:_0x51f608=await Promise[_0x3ac529(0xd8)](_0x3c9768[_0x3ac529(0xe6)](async _0x5e1064=>{const _0x2547cf=_0x3ac529;let _0x37789c;try{_0x37789c=_0x5e1064['dbId']?await getDbName(_0x1aecf7[_0x2547cf(0xe1)],_0x5e1064['dbId']):undefined;}catch{}return{'sqlCode':_0x5e1064[_0x2547cf(0xdc)],'sqlName':_0x5e1064['sqlName'],'description':_0x5e1064[_0x2547cf(0xce)]??'','db':_0x37789c?_0x37789c+'\x20('+_0x5e1064[_0x2547cf(0xe5)]+')':_0x5e1064['dbId']??''};})),{'ok':!![],'data':_0x51f608,'message':_0x3c9768['length']===0x0?_0x3ac529(0xd4):_0x3ac529(0xd1)+_0x3c9768[_0x3ac529(0xde)]+_0x3ac529(0xef)+_0x2c95e6+').'};}};
@@ -1 +1 @@
1
- const a175_0x5c0b10=a175_0x1283;(function(_0x5532e7,_0x84a1cd){const _0x526418=a175_0x1283,_0x324f7e=_0x5532e7();while(!![]){try{const _0x3df6e4=parseInt(_0x526418(0xf3))/0x1*(-parseInt(_0x526418(0x112))/0x2)+-parseInt(_0x526418(0xf7))/0x3+-parseInt(_0x526418(0x127))/0x4*(parseInt(_0x526418(0xeb))/0x5)+parseInt(_0x526418(0xf6))/0x6+parseInt(_0x526418(0x128))/0x7*(parseInt(_0x526418(0x122))/0x8)+parseInt(_0x526418(0x120))/0x9*(-parseInt(_0x526418(0xfd))/0xa)+parseInt(_0x526418(0x104))/0xb;if(_0x3df6e4===_0x84a1cd)break;else _0x324f7e['push'](_0x324f7e['shift']());}catch(_0x4719ca){_0x324f7e['push'](_0x324f7e['shift']());}}}(a175_0x338a,0x7bac1));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';function a175_0x1283(_0x20a4cb,_0xcab31b){_0x20a4cb=_0x20a4cb-0xeb;const _0x338a73=a175_0x338a();let _0x128365=_0x338a73[_0x20a4cb];return _0x128365;}function a175_0x338a(){const _0xb6d3cc=['description','length','Pull\x20complete:\x20','split','local\x20differs\x20from\x20remote','appCode','Filter\x20by\x20SQL\x20display\x20name','703146UzcyBD','boolean','paging','\x20SQL\x20file(s)\x20into\x20','apps','totalCount','conflict','sqls','filter','mybatisXml','force','sqlCode','sqlContent','utf8','99YBIwDl','test','8CdsCPj','str','No\x20remote\x20SQL\x20queries\x20matched.','nonInteractive','lastSync','320hkktEJ','2103423dfaRbw','28010WZWKRJ','skipped','dbId','Would\x20pull\x20','sqlRootDir','cancelled','\x20skipped,\x20','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','2boEOdt','message','toISOString','2132910tfTPzg','2552235uyqlxo','unchanged','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','\x20written,\x20','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','sql','255160zVkJrC','join','lockFilePath','push','catch','sqlcode','name','23466454oBdmbT','string','Force\x20pull\x20cancelled.','path','bool','tableData','sqlName'];a175_0x338a=function(){return _0xb6d3cc;};return a175_0x338a();}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(_0x4db385,_0x4ef990){const _0xd73da2=a175_0x1283,_0x3e0e6e=[];let _0x44f58a=0x1;while(!![]){const _0x5291b1=await listSqlQueries(_0x4db385,{'currentPage':_0x44f58a,'pageSize':PAGE_SIZE,'sqlCode':_0x4ef990[_0xd73da2(0x11d)],'sqlName':_0x4ef990[_0xd73da2(0x10a)]}),_0x2cddf3=_0x5291b1[_0xd73da2(0x109)]??[];_0x3e0e6e['push'](..._0x2cddf3);if(_0x2cddf3[_0xd73da2(0x10c)]===0x0)break;const _0x10ae12=_0x5291b1[_0xd73da2(0x114)]?.[_0xd73da2(0x117)];if(_0x10ae12!=null?_0x3e0e6e['length']>=_0x10ae12:_0x2cddf3[_0xd73da2(0x10c)]<PAGE_SIZE)break;_0x44f58a++;}return _0x3e0e6e;}async function ensureSqlContent(_0xe32b0b){const _0x162b70=a175_0x1283;if(_0xe32b0b[_0x162b70(0x11e)]!=null&&String(_0xe32b0b['sqlContent'])[_0x162b70(0x10c)]>0x0)return _0xe32b0b;return getSqlQueryDetail(_0xe32b0b[_0x162b70(0x11d)]);}export const sqlPull={'service':a175_0x5c0b10(0xfc),'command':'pull','description':a175_0x5c0b10(0xf2),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a175_0x5c0b10(0x103),'type':a175_0x5c0b10(0x105),'description':a175_0x5c0b10(0x111)},{'name':a175_0x5c0b10(0x11c),'type':a175_0x5c0b10(0x113),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0xeec843){const _0x40feed=a175_0x5c0b10,_0x1082d0=loadSqlProjectConfig(_0xeec843[_0x40feed(0x110)]),_0x19b0fe=await readSqlLockFile(_0x1082d0[_0x40feed(0xff)]),{appLock:_0x4312b3}=ensureSqlLockScope(_0x19b0fe??createEmptySqlLock(),_0x1082d0['appCode'],_0x1082d0['sqlRoot'],'pull'),_0x1183a1=await fetchAllSqlQueries(_0xeec843[_0x40feed(0x110)],{'sqlCode':_0xeec843[_0x40feed(0x123)](_0x40feed(0x102))||undefined,'sqlName':_0xeec843['str'](_0x40feed(0x103))||undefined}),_0x44887c=[];for(const _0x24dc82 of _0x1183a1){const _0x51a2f1=await ensureSqlContent(_0x24dc82),_0x44a1e4=ensureRemoteSqlContent(_0x51a2f1),_0x91f493=detectModeFromSql(_0x51a2f1),_0x793a7=_0x51a2f1[_0x40feed(0xed)]?await getDbName(_0xeec843[_0x40feed(0x110)],Number(_0x51a2f1[_0x40feed(0xed)]))[_0x40feed(0x101)](()=>undefined):undefined,_0x583803=buildLocalSqlFileContent({'sqlCode':_0x51a2f1['sqlCode'],'sqlName':_0x51a2f1[_0x40feed(0x10a)],'dbId':_0x51a2f1[_0x40feed(0xed)]},_0x44a1e4,{'dbName':_0x793a7,'mode':_0x91f493,'syncedAt':new Date()[_0x40feed(0xf5)](),'description':_0x51a2f1[_0x40feed(0x10b)]}),_0x281501=buildSqlLockEntry(_0x51a2f1,_0x44a1e4,'',{'dbName':_0x793a7}),_0x5be078=resolveLocalSqlFilePath(_0x1082d0,_0x51a2f1[_0x40feed(0x11d)],_0x281501);let _0x4c4a56='would_pull',_0x56bda4;if(await fileExists(_0x5be078)){const _0x1e8b44=await readFile(_0x5be078,'utf8');isEquivalentPulledSqlFile(_0x1e8b44,_0x583803,_0x91f493)?(_0x4c4a56=_0x40feed(0xec),_0x56bda4=_0x40feed(0xf8)):(_0x4c4a56=_0x40feed(0x118),_0x56bda4=_0x40feed(0xf9));}_0x44887c[_0x40feed(0x100)]({'sqlCode':_0x51a2f1['sqlCode'],'sqlName':_0x51a2f1[_0x40feed(0x10a)],'filePath':_0x5be078,'status':_0x4c4a56,'reason':_0x56bda4});}return{'method':'POST','url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0xeec843[_0x40feed(0x110)],'sqlCode':_0xeec843[_0x40feed(0x123)](_0x40feed(0x102))||null,'sqlName':_0xeec843[_0x40feed(0x123)](_0x40feed(0x103))||null,'files':_0x44887c},'description':_0x40feed(0xee)+_0x44887c['length']+_0x40feed(0x115)+_0x1082d0['sqlRootDir']};},async 'execute'(_0x1ff1d0){const _0x1bdd0c=a175_0x5c0b10,_0x15784c=loadSqlProjectConfig(_0x1ff1d0[_0x1bdd0c(0x110)]),_0x44c1af=await readSqlLockFile(_0x15784c[_0x1bdd0c(0xff)]),{lockData:_0x5b7790,appLock:_0x472984}=ensureSqlLockScope(_0x44c1af??createEmptySqlLock(),_0x15784c[_0x1bdd0c(0x110)],_0x15784c['sqlRoot'],'pull'),_0x23e534=_0x1ff1d0[_0x1bdd0c(0x108)](_0x1bdd0c(0x11c)),_0x2a3e28=await fetchAllSqlQueries(_0x1ff1d0[_0x1bdd0c(0x110)],{'sqlCode':_0x1ff1d0[_0x1bdd0c(0x123)](_0x1bdd0c(0x102))||undefined,'sqlName':_0x1ff1d0[_0x1bdd0c(0x123)](_0x1bdd0c(0x103))||undefined});if(_0x2a3e28[_0x1bdd0c(0x10c)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x1bdd0c(0x124)};const _0x3eec4e=[],_0xd5f6aa=[];for(const _0x3d5958 of _0x2a3e28){try{_0x3eec4e[_0x1bdd0c(0x100)](await ensureSqlContent(_0x3d5958));}catch(_0x106153){_0xd5f6aa[_0x1bdd0c(0x100)]({'sqlCode':_0x3d5958[_0x1bdd0c(0x11d)],'error':_0x106153 instanceof Error?_0x106153['message']:String(_0x106153)});}}if(_0x23e534&&!_0x1ff1d0[_0x1bdd0c(0x125)]){let _0x2fc35c=![];for(const _0x3db350 of _0x3eec4e){const _0x4a9449=detectModeFromSql(_0x3db350),_0x44c01c=_0x3db350[_0x1bdd0c(0xed)]?await getDbName(_0x1ff1d0[_0x1bdd0c(0x110)],Number(_0x3db350[_0x1bdd0c(0xed)]))[_0x1bdd0c(0x101)](()=>undefined):undefined,_0x23a0b7=buildLocalSqlFileContent({'sqlCode':_0x3db350[_0x1bdd0c(0x11d)],'sqlName':_0x3db350[_0x1bdd0c(0x10a)],'dbId':_0x3db350['dbId']},ensureRemoteSqlContent(_0x3db350),{'dbName':_0x44c01c,'mode':_0x4a9449,'syncedAt':new Date()[_0x1bdd0c(0xf5)](),'description':_0x3db350['description']}),_0x68e232=resolveLocalSqlFilePath(_0x15784c,_0x3db350['sqlCode'],buildSqlLockEntry(_0x3db350,ensureRemoteSqlContent(_0x3db350),'',{'dbName':_0x44c01c}));if(await fileExists(_0x68e232)){const _0x8810ec=await readFile(_0x68e232,_0x1bdd0c(0x11f));if(!isEquivalentPulledSqlFile(_0x8810ec,_0x23a0b7,_0x4a9449)){_0x2fc35c=!![];break;}}}if(_0x2fc35c){const _0x480994=await confirmForceOverwrite(_0x1bdd0c(0xfb));if(!_0x480994)throw CliErrors[_0x1bdd0c(0xf0)](_0x1bdd0c(0x106));}}const _0x5e83d2=cloneSqlLockData(_0x5b7790),_0x1be192=_0x5e83d2[_0x1bdd0c(0x116)][_0x15784c['appCode']],_0x2e35a8=[],_0x4842a1=[];for(const _0x51668a of _0x3eec4e){const _0x56701b=_0x1be192['sqls'][_0x51668a[_0x1bdd0c(0x11d)]],_0x26d4b8=ensureRemoteSqlContent(_0x51668a),_0x31439f=detectModeFromSql(_0x51668a),_0x4aa7a7=_0x51668a['dbId']?await getDbName(_0x1ff1d0[_0x1bdd0c(0x110)],Number(_0x51668a[_0x1bdd0c(0xed)]))[_0x1bdd0c(0x101)](()=>undefined):undefined,_0x5b8f83=buildLocalSqlFileContent({'sqlCode':_0x51668a[_0x1bdd0c(0x11d)],'sqlName':_0x51668a[_0x1bdd0c(0x10a)],'dbId':_0x51668a['dbId']},_0x26d4b8,{'dbName':_0x4aa7a7,'mode':_0x31439f,'syncedAt':new Date()['toISOString'](),'description':_0x51668a['description']}),_0x19a3da=buildSqlLockEntry(_0x51668a,_0x26d4b8,computeSqlContentHash(_0x5b8f83),{'dbName':_0x4aa7a7}),_0xa14dfe=_0x19a3da[_0x1bdd0c(0x107)],_0x21f153=join(_0x15784c[_0x1bdd0c(0xef)],_0xa14dfe);try{if(await fileExists(_0x21f153)){const _0x3a1e2d=await readFile(_0x21f153,'utf8');if(isEquivalentPulledSqlFile(_0x3a1e2d,_0x5b8f83,_0x31439f)){_0x4842a1[_0x1bdd0c(0x100)]({'sqlCode':_0x51668a['sqlCode'],'reason':'unchanged'}),_0x1be192[_0x1bdd0c(0x119)][_0x51668a[_0x1bdd0c(0x11d)]]={..._0x19a3da,'hash':computeSqlContentHash(_0x3a1e2d),'path':_0xa14dfe};continue;}if(!_0x23e534){_0x4842a1[_0x1bdd0c(0x100)]({'sqlCode':_0x51668a[_0x1bdd0c(0x11d)],'reason':_0x1bdd0c(0x10f)});continue;}}const _0x22adaa=_0x56701b?.[_0x1bdd0c(0x107)]?join(_0x15784c[_0x1bdd0c(0xef)],_0x56701b[_0x1bdd0c(0x107)]):undefined;_0x22adaa&&_0x22adaa!==_0x21f153&&await fileExists(_0x22adaa)&&await rm(_0x22adaa,{'force':!![]}),await ensureParentDirectory(_0x21f153),await writeFile(_0x21f153,_0x5b8f83,_0x1bdd0c(0x11f)),_0x1be192[_0x1bdd0c(0x119)][_0x51668a[_0x1bdd0c(0x11d)]]={..._0x19a3da,'path':_0xa14dfe},_0x2e35a8['push']({'sqlCode':_0x51668a['sqlCode'],'filePath':_0x21f153});}catch(_0x36d9de){_0xd5f6aa[_0x1bdd0c(0x100)]({'sqlCode':_0x51668a['sqlCode'],'error':_0x36d9de instanceof Error?_0x36d9de[_0x1bdd0c(0xf4)]:String(_0x36d9de)});}}return _0x1be192[_0x1bdd0c(0x126)]=new Date()['toISOString'](),await writeSqlLockFile(_0x15784c['lockFilePath'],_0x5e83d2),{'ok':_0xd5f6aa[_0x1bdd0c(0x10c)]===0x0,'data':{'pulled':_0x2e35a8,'skipped':_0x4842a1,'failed':_0xd5f6aa},'message':_0x1bdd0c(0x10d)+_0x2e35a8[_0x1bdd0c(0x10c)]+_0x1bdd0c(0xfa)+_0x4842a1[_0x1bdd0c(0x10c)]+_0x1bdd0c(0xf1)+_0xd5f6aa[_0x1bdd0c(0x10c)]+'\x20failed'};}};function detectModeFromSql(_0x2d0ffd){const _0x3dbc9f=a175_0x5c0b10,_0x136cbf=ensureRemoteSqlContent(_0x2d0ffd),_0x56fe60=stripLocalSqlMetadata(_0x136cbf,'mybatisXml')['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x3dbc9f(0x121)](_0x56fe60))return _0x3dbc9f(0x11b);return _0x3dbc9f(0xfc);}function isEquivalentPulledSqlFile(_0x27bb11,_0x1ffcea,_0x47b95e){return normalizePullComparableContent(_0x27bb11,_0x47b95e)===normalizePullComparableContent(_0x1ffcea,_0x47b95e);}function normalizePullComparableContent(_0x27a438,_0x51de48){const _0x5eea73=a175_0x5c0b10,_0x125674=_0x27a438['replace'](/\r\n/g,'\x0a')[_0x5eea73(0x10e)]('\x0a'),_0x326207=_0x125674[_0x5eea73(0x11a)](_0x3b67dc=>!isSyncedAtMetadataLine(_0x3b67dc,_0x51de48));return _0x326207[_0x5eea73(0xfe)]('\x0a');}function isSyncedAtMetadataLine(_0x304878,_0xf38e1a){const _0x51e5a9=a175_0x5c0b10;if(_0xf38e1a===_0x51e5a9(0x11b))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x51e5a9(0x121)](_0x304878);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x51e5a9(0x121)](_0x304878);}
1
+ const a176_0x2f54b9=a176_0x5852;(function(_0x1cde32,_0x43e159){const _0x44c50a=a176_0x5852,_0x5c9ce6=_0x1cde32();while(!![]){try{const _0x2b368f=-parseInt(_0x44c50a(0x168))/0x1+-parseInt(_0x44c50a(0x147))/0x2*(parseInt(_0x44c50a(0x165))/0x3)+-parseInt(_0x44c50a(0x174))/0x4*(-parseInt(_0x44c50a(0x167))/0x5)+-parseInt(_0x44c50a(0x173))/0x6*(-parseInt(_0x44c50a(0x171))/0x7)+-parseInt(_0x44c50a(0x14f))/0x8+-parseInt(_0x44c50a(0x153))/0x9*(-parseInt(_0x44c50a(0x157))/0xa)+parseInt(_0x44c50a(0x149))/0xb;if(_0x2b368f===_0x43e159)break;else _0x5c9ce6['push'](_0x5c9ce6['shift']());}catch(_0x37e0a8){_0x5c9ce6['push'](_0x5c9ce6['shift']());}}}(a176_0x46e0,0xda4a2));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';function a176_0x5852(_0x37be70,_0x596aa4){_0x37be70=_0x37be70-0x13b;const _0x46e020=a176_0x46e0();let _0x5852b7=_0x46e020[_0x37be70];return _0x5852b7;}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';function a176_0x46e0(){const _0x28f5be=['split','appCode','\x20SQL\x20file(s)\x20into\x20','description','unchanged','58MyLDsB','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','8410303wsvNiT','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','POST','Force\x20pull\x20cancelled.','str','test','1277960uuTlbI','bool','No\x20remote\x20SQL\x20queries\x20matched.','mybatisXml','36XHRKsh','sqlRoot','totalCount','Filter\x20by\x20SQL\x20display\x20name','2123340ZrFWku','force','sqlContent','length','lockFilePath','sqlRootDir','toISOString','utf8','sqlcode','path','sqls','pull','paging','catch','170673DRpmcQ','apps','5ALpjHx','195527zPEMob','write','name','tableData','lastSync','dbId','sqlName','replace','string','3724GNzhQs','trimStart','11046naFmdg','1223616BWMqte','Pull\x20complete:\x20','\x20failed','push','Force\x20overwrite\x20local\x20unsynced\x20changes','sqlCode','message','cancelled','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sql'];a176_0x46e0=function(){return _0x28f5be;};return a176_0x46e0();}const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x1d82ea,_0x5a0a26){const _0x48d45a=a176_0x5852,_0x2ad502=[];let _0x237f43=0x1;while(!![]){const _0x3be9f0=await listSqlQueries(_0x1d82ea,{'currentPage':_0x237f43,'pageSize':PAGE_SIZE,'sqlCode':_0x5a0a26[_0x48d45a(0x13d)],'sqlName':_0x5a0a26[_0x48d45a(0x16e)]}),_0x170dbb=_0x3be9f0[_0x48d45a(0x16b)]??[];_0x2ad502['push'](..._0x170dbb);if(_0x170dbb['length']===0x0)break;const _0x4f98ae=_0x3be9f0[_0x48d45a(0x163)]?.[_0x48d45a(0x155)];if(_0x4f98ae!=null?_0x2ad502['length']>=_0x4f98ae:_0x170dbb[_0x48d45a(0x15a)]<PAGE_SIZE)break;_0x237f43++;}return _0x2ad502;}async function ensureSqlContent(_0x44118f){const _0x1b259a=a176_0x5852;if(_0x44118f[_0x1b259a(0x159)]!=null&&String(_0x44118f['sqlContent'])[_0x1b259a(0x15a)]>0x0)return _0x44118f;return getSqlQueryDetail(_0x44118f['sqlCode']);}export const sqlPull={'service':a176_0x2f54b9(0x141),'command':a176_0x2f54b9(0x162),'description':a176_0x2f54b9(0x148),'risk':a176_0x2f54b9(0x169),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a176_0x2f54b9(0x16a),'type':a176_0x2f54b9(0x170),'description':a176_0x2f54b9(0x156)},{'name':a176_0x2f54b9(0x158),'type':'boolean','description':a176_0x2f54b9(0x13c)}],async 'dryRun'(_0x503e2e){const _0x435655=a176_0x2f54b9,_0x1509c5=loadSqlProjectConfig(_0x503e2e[_0x435655(0x143)]),_0x2f1b13=await readSqlLockFile(_0x1509c5[_0x435655(0x15b)]),{appLock:_0x168f0b}=ensureSqlLockScope(_0x2f1b13??createEmptySqlLock(),_0x1509c5[_0x435655(0x143)],_0x1509c5['sqlRoot'],_0x435655(0x162)),_0x267e65=await fetchAllSqlQueries(_0x503e2e['appCode'],{'sqlCode':_0x503e2e['str']('sqlcode')||undefined,'sqlName':_0x503e2e[_0x435655(0x14d)]('name')||undefined}),_0x265c12=[];for(const _0x174255 of _0x267e65){const _0x27cfb4=await ensureSqlContent(_0x174255),_0x5b27e0=ensureRemoteSqlContent(_0x27cfb4),_0x24ec06=detectModeFromSql(_0x27cfb4),_0x184dbd=_0x27cfb4[_0x435655(0x16d)]?await getDbName(_0x503e2e[_0x435655(0x143)],Number(_0x27cfb4[_0x435655(0x16d)]))[_0x435655(0x164)](()=>undefined):undefined,_0x21d160=buildLocalSqlFileContent({'sqlCode':_0x27cfb4[_0x435655(0x13d)],'sqlName':_0x27cfb4['sqlName'],'dbId':_0x27cfb4['dbId']},_0x5b27e0,{'dbName':_0x184dbd,'mode':_0x24ec06,'syncedAt':new Date()[_0x435655(0x15d)](),'description':_0x27cfb4[_0x435655(0x145)]}),_0x4d012c=buildSqlLockEntry(_0x27cfb4,_0x5b27e0,'',{'dbName':_0x184dbd}),_0x2902f9=resolveLocalSqlFilePath(_0x1509c5,_0x27cfb4[_0x435655(0x13d)],_0x4d012c);let _0x4d6d73='would_pull',_0x572b56;if(await fileExists(_0x2902f9)){const _0x1daa4f=await readFile(_0x2902f9,'utf8');isEquivalentPulledSqlFile(_0x1daa4f,_0x21d160,_0x24ec06)?(_0x4d6d73='skipped',_0x572b56='unchanged'):(_0x4d6d73='conflict',_0x572b56=_0x435655(0x140));}_0x265c12[_0x435655(0x13b)]({'sqlCode':_0x27cfb4[_0x435655(0x13d)],'sqlName':_0x27cfb4[_0x435655(0x16e)],'filePath':_0x2902f9,'status':_0x4d6d73,'reason':_0x572b56});}return{'method':_0x435655(0x14b),'url':_0x435655(0x14a),'body':{'appCode':_0x503e2e[_0x435655(0x143)],'sqlCode':_0x503e2e[_0x435655(0x14d)](_0x435655(0x15f))||null,'sqlName':_0x503e2e[_0x435655(0x14d)](_0x435655(0x16a))||null,'files':_0x265c12},'description':'Would\x20pull\x20'+_0x265c12[_0x435655(0x15a)]+_0x435655(0x144)+_0x1509c5[_0x435655(0x15c)]};},async 'execute'(_0x4d928c){const _0x34443f=a176_0x2f54b9,_0x3dea2e=loadSqlProjectConfig(_0x4d928c[_0x34443f(0x143)]),_0x341232=await readSqlLockFile(_0x3dea2e[_0x34443f(0x15b)]),{lockData:_0x1c8bff,appLock:_0x5cd14e}=ensureSqlLockScope(_0x341232??createEmptySqlLock(),_0x3dea2e[_0x34443f(0x143)],_0x3dea2e[_0x34443f(0x154)],_0x34443f(0x162)),_0x1f78ea=_0x4d928c[_0x34443f(0x150)]('force'),_0x19b2eb=await fetchAllSqlQueries(_0x4d928c[_0x34443f(0x143)],{'sqlCode':_0x4d928c[_0x34443f(0x14d)](_0x34443f(0x15f))||undefined,'sqlName':_0x4d928c[_0x34443f(0x14d)](_0x34443f(0x16a))||undefined});if(_0x19b2eb[_0x34443f(0x15a)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x34443f(0x151)};const _0x290bb8=[],_0x3a0161=[];for(const _0xa7116e of _0x19b2eb){try{_0x290bb8[_0x34443f(0x13b)](await ensureSqlContent(_0xa7116e));}catch(_0xdec0e3){_0x3a0161['push']({'sqlCode':_0xa7116e[_0x34443f(0x13d)],'error':_0xdec0e3 instanceof Error?_0xdec0e3[_0x34443f(0x13e)]:String(_0xdec0e3)});}}if(_0x1f78ea&&!_0x4d928c['nonInteractive']){let _0x3185db=![];for(const _0x53acb4 of _0x290bb8){const _0x3bb733=detectModeFromSql(_0x53acb4),_0x4f5261=_0x53acb4[_0x34443f(0x16d)]?await getDbName(_0x4d928c[_0x34443f(0x143)],Number(_0x53acb4[_0x34443f(0x16d)]))[_0x34443f(0x164)](()=>undefined):undefined,_0x45ae34=buildLocalSqlFileContent({'sqlCode':_0x53acb4[_0x34443f(0x13d)],'sqlName':_0x53acb4[_0x34443f(0x16e)],'dbId':_0x53acb4['dbId']},ensureRemoteSqlContent(_0x53acb4),{'dbName':_0x4f5261,'mode':_0x3bb733,'syncedAt':new Date()[_0x34443f(0x15d)](),'description':_0x53acb4[_0x34443f(0x145)]}),_0x5ebd29=resolveLocalSqlFilePath(_0x3dea2e,_0x53acb4[_0x34443f(0x13d)],buildSqlLockEntry(_0x53acb4,ensureRemoteSqlContent(_0x53acb4),'',{'dbName':_0x4f5261}));if(await fileExists(_0x5ebd29)){const _0x5c6080=await readFile(_0x5ebd29,_0x34443f(0x15e));if(!isEquivalentPulledSqlFile(_0x5c6080,_0x45ae34,_0x3bb733)){_0x3185db=!![];break;}}}if(_0x3185db){const _0x4e8e09=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x4e8e09)throw CliErrors[_0x34443f(0x13f)](_0x34443f(0x14c));}}const _0x228273=cloneSqlLockData(_0x1c8bff),_0x2be0ee=_0x228273[_0x34443f(0x166)][_0x3dea2e['appCode']],_0x5e8a8f=[],_0x2666be=[];for(const _0x104d21 of _0x290bb8){const _0x5d136f=_0x2be0ee['sqls'][_0x104d21[_0x34443f(0x13d)]],_0x166cb1=ensureRemoteSqlContent(_0x104d21),_0x3be0b1=detectModeFromSql(_0x104d21),_0x1ac2a0=_0x104d21[_0x34443f(0x16d)]?await getDbName(_0x4d928c[_0x34443f(0x143)],Number(_0x104d21[_0x34443f(0x16d)]))['catch'](()=>undefined):undefined,_0x50278d=buildLocalSqlFileContent({'sqlCode':_0x104d21['sqlCode'],'sqlName':_0x104d21['sqlName'],'dbId':_0x104d21[_0x34443f(0x16d)]},_0x166cb1,{'dbName':_0x1ac2a0,'mode':_0x3be0b1,'syncedAt':new Date()['toISOString'](),'description':_0x104d21[_0x34443f(0x145)]}),_0x40525e=buildSqlLockEntry(_0x104d21,_0x166cb1,computeSqlContentHash(_0x50278d),{'dbName':_0x1ac2a0}),_0x5bb207=_0x40525e['path'],_0x197643=join(_0x3dea2e['sqlRootDir'],_0x5bb207);try{if(await fileExists(_0x197643)){const _0x31c5a8=await readFile(_0x197643,_0x34443f(0x15e));if(isEquivalentPulledSqlFile(_0x31c5a8,_0x50278d,_0x3be0b1)){_0x2666be[_0x34443f(0x13b)]({'sqlCode':_0x104d21[_0x34443f(0x13d)],'reason':_0x34443f(0x146)}),_0x2be0ee[_0x34443f(0x161)][_0x104d21[_0x34443f(0x13d)]]={..._0x40525e,'hash':computeSqlContentHash(_0x31c5a8),'path':_0x5bb207};continue;}if(!_0x1f78ea){_0x2666be[_0x34443f(0x13b)]({'sqlCode':_0x104d21[_0x34443f(0x13d)],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x58e272=_0x5d136f?.[_0x34443f(0x160)]?join(_0x3dea2e[_0x34443f(0x15c)],_0x5d136f[_0x34443f(0x160)]):undefined;_0x58e272&&_0x58e272!==_0x197643&&await fileExists(_0x58e272)&&await rm(_0x58e272,{'force':!![]}),await ensureParentDirectory(_0x197643),await writeFile(_0x197643,_0x50278d,_0x34443f(0x15e)),_0x2be0ee[_0x34443f(0x161)][_0x104d21['sqlCode']]={..._0x40525e,'path':_0x5bb207},_0x5e8a8f[_0x34443f(0x13b)]({'sqlCode':_0x104d21['sqlCode'],'filePath':_0x197643});}catch(_0xb820ff){_0x3a0161[_0x34443f(0x13b)]({'sqlCode':_0x104d21[_0x34443f(0x13d)],'error':_0xb820ff instanceof Error?_0xb820ff[_0x34443f(0x13e)]:String(_0xb820ff)});}}return _0x2be0ee[_0x34443f(0x16c)]=new Date()[_0x34443f(0x15d)](),await writeSqlLockFile(_0x3dea2e['lockFilePath'],_0x228273),{'ok':_0x3a0161[_0x34443f(0x15a)]===0x0,'data':{'pulled':_0x5e8a8f,'skipped':_0x2666be,'failed':_0x3a0161},'message':_0x34443f(0x175)+_0x5e8a8f['length']+'\x20written,\x20'+_0x2666be[_0x34443f(0x15a)]+'\x20skipped,\x20'+_0x3a0161[_0x34443f(0x15a)]+_0x34443f(0x176)};}};function detectModeFromSql(_0x363ca6){const _0x10520d=a176_0x2f54b9,_0xe63b5a=ensureRemoteSqlContent(_0x363ca6),_0x23e8b1=stripLocalSqlMetadata(_0xe63b5a,_0x10520d(0x152))[_0x10520d(0x172)]();if(/^<(select|insert|update|delete)\b/i[_0x10520d(0x14e)](_0x23e8b1))return _0x10520d(0x152);return'sql';}function isEquivalentPulledSqlFile(_0x3c69ec,_0x404c73,_0xef6a4b){return normalizePullComparableContent(_0x3c69ec,_0xef6a4b)===normalizePullComparableContent(_0x404c73,_0xef6a4b);}function normalizePullComparableContent(_0x45adac,_0x356616){const _0x56e9e3=a176_0x2f54b9,_0x47cbcb=_0x45adac[_0x56e9e3(0x16f)](/\r\n/g,'\x0a')[_0x56e9e3(0x142)]('\x0a'),_0x5dbe74=_0x47cbcb['filter'](_0xbe51e4=>!isSyncedAtMetadataLine(_0xbe51e4,_0x356616));return _0x5dbe74['join']('\x0a');}function isSyncedAtMetadataLine(_0x2c143f,_0x5a7c42){const _0x392dcf=a176_0x2f54b9;if(_0x5a7c42==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x392dcf(0x14e)](_0x2c143f);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x2c143f);}
@@ -1 +1 @@
1
- const a176_0x2db0bc=a176_0x26e1;(function(_0x908a49,_0x960252){const _0x2b9eac=a176_0x26e1,_0x4bc2d0=_0x908a49();while(!![]){try{const _0x259ca5=-parseInt(_0x2b9eac(0xe5))/0x1+parseInt(_0x2b9eac(0xf9))/0x2*(-parseInt(_0x2b9eac(0xf6))/0x3)+-parseInt(_0x2b9eac(0xf4))/0x4*(-parseInt(_0x2b9eac(0x102))/0x5)+parseInt(_0x2b9eac(0xed))/0x6*(-parseInt(_0x2b9eac(0xe3))/0x7)+-parseInt(_0x2b9eac(0x10e))/0x8+parseInt(_0x2b9eac(0xf1))/0x9*(parseInt(_0x2b9eac(0x112))/0xa)+-parseInt(_0x2b9eac(0xeb))/0xb*(-parseInt(_0x2b9eac(0xff))/0xc);if(_0x259ca5===_0x960252)break;else _0x4bc2d0['push'](_0x4bc2d0['shift']());}catch(_0x1d28ae){_0x4bc2d0['push'](_0x4bc2d0['shift']());}}}(a176_0x4bb8,0x50a00));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';function a176_0x26e1(_0x2d2276,_0x1756b9){_0x2d2276=_0x2d2276-0xdd;const _0x4bb80b=a176_0x4bb8();let _0x26e1be=_0x4bb80b[_0x2d2276];return _0x26e1be;}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x5b096d,_0x3400a0,_0x3755d8){const _0x1352a1=a176_0x26e1,_0x20bb0a=await scanLocalSqlQueries(_0x5b096d),_0x4d5310=new Map();for(const _0x50b693 of _0x20bb0a){if(_0x3755d8&&_0x50b693[_0x1352a1(0xee)]!==_0x3755d8)continue;const _0xd799ee=_0x4d5310[_0x1352a1(0xde)](_0x50b693[_0x1352a1(0xee)])??[];_0xd799ee['push'](_0x50b693),_0x4d5310[_0x1352a1(0x11c)](_0x50b693[_0x1352a1(0xee)],_0xd799ee);}if(_0x3755d8&&!_0x4d5310[_0x1352a1(0xea)](_0x3755d8))throw CliErrors[_0x1352a1(0x114)](_0x1352a1(0x119)+_0x3755d8);const _0x4086ce=[];for(const [_0x14c973,_0x2b2981]of _0x4d5310[_0x1352a1(0x10d)]()){if(_0x2b2981[_0x1352a1(0x107)]===0x1){_0x4086ce[_0x1352a1(0x106)](_0x2b2981[0x0]);continue;}const _0x30d222=_0x3400a0['sqls'][_0x14c973],_0x5b3230=_0x30d222?.[_0x1352a1(0xf8)],_0x45d184=_0x5b3230?_0x2b2981[_0x1352a1(0xdd)](_0x3bad10=>_0x3bad10[_0x1352a1(0xfe)]!==_0x5b3230):_0x2b2981;if(_0x30d222&&_0x45d184[_0x1352a1(0x107)]===0x1){_0x4086ce['push'](_0x45d184[0x0]);continue;}throw CliErrors[_0x1352a1(0x114)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x14c973+_0x1352a1(0x11e));}return _0x4086ce;}export const sqlPush={'service':'sql','command':a176_0x2db0bc(0x106),'description':a176_0x2db0bc(0xef),'risk':a176_0x2db0bc(0x120),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a176_0x2db0bc(0x11a),'type':a176_0x2db0bc(0x100),'description':a176_0x2db0bc(0x108)}],async 'dryRun'(_0x46374d){const _0x382eb4=a176_0x2db0bc,_0x160056=loadSqlProjectConfig(_0x46374d[_0x382eb4(0xf7)]),_0xc98bf=await readSqlLockFile(_0x160056['lockFilePath']),{appLock:_0x5ef940}=ensureSqlLockScope(_0xc98bf??createEmptySqlLock(),_0x46374d[_0x382eb4(0xf7)],_0x160056['sqlRoot'],'push'),_0x33489f=await getTargetSqlQueries(_0x160056,_0x5ef940,_0x46374d[_0x382eb4(0xe9)](_0x382eb4(0x101))||undefined),_0x4bd9b9=[];for(const _0x25673b of _0x33489f){const _0x5eb5f2=await computeSqlFileHash(_0x25673b[_0x382eb4(0x109)]),_0x11644f=_0x5ef940['sqls'][_0x25673b['sqlCode']],_0x3385a1=!!_0x11644f&&(_0x11644f[_0x382eb4(0xf8)]!==_0x25673b[_0x382eb4(0xfe)]||!!_0x25673b[_0x382eb4(0x117)]&&_0x11644f[_0x382eb4(0x117)]!==_0x25673b['sqlName']);if(!_0x46374d['bool'](_0x382eb4(0x11a))&&_0x11644f&&_0x11644f[_0x382eb4(0x10a)]===_0x5eb5f2&&!_0x3385a1)continue;_0x4bd9b9[_0x382eb4(0x106)](_0x25673b[_0x382eb4(0xee)]);}return{'method':'POST','url':_0x382eb4(0xe7),'body':{'sqlCodes':_0x4bd9b9,'appCode':_0x46374d[_0x382eb4(0xf7)]},'description':'Would\x20push\x20'+_0x4bd9b9['length']+_0x382eb4(0x10c)};},async 'execute'(_0x1d747d){const _0x2ad211=a176_0x2db0bc,_0x1d23f6=loadSqlProjectConfig(_0x1d747d[_0x2ad211(0xf7)]),_0x4b09d9=await readSqlLockFile(_0x1d23f6['lockFilePath']),{lockData:_0x4ee694,appLock:_0x607f1a}=ensureSqlLockScope(_0x4b09d9??createEmptySqlLock(),_0x1d747d[_0x2ad211(0xf7)],_0x1d23f6[_0x2ad211(0xe1)],_0x2ad211(0x106)),_0x18b6b4=await getTargetSqlQueries(_0x1d23f6,_0x607f1a,_0x1d747d[_0x2ad211(0xe9)](_0x2ad211(0x101))||undefined);if(_0x18b6b4[_0x2ad211(0x107)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x2ad211(0x11f)};const _0x5753ac=[],_0x5722d8=[],_0x5be53c=[];for(const _0x1e9fce of _0x18b6b4){const _0x3a8be2=_0x607f1a['sqls'][_0x1e9fce[_0x2ad211(0xee)]];if(!_0x3a8be2){_0x5be53c[_0x2ad211(0x106)]({'sqlCode':_0x1e9fce[_0x2ad211(0xee)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x326fa1=await computeSqlFileHash(_0x1e9fce[_0x2ad211(0x109)]),_0x3227f6=_0x3a8be2['path']!==_0x1e9fce[_0x2ad211(0xfe)]||!!_0x1e9fce['sqlName']&&_0x3a8be2[_0x2ad211(0x117)]!==_0x1e9fce[_0x2ad211(0x117)];if(!_0x1d747d[_0x2ad211(0xdf)](_0x2ad211(0x11a))&&_0x3a8be2[_0x2ad211(0x10a)]===_0x326fa1&&!_0x3227f6){_0x5722d8[_0x2ad211(0x106)]({'sqlCode':_0x1e9fce['sqlCode'],'reason':_0x2ad211(0x118)});continue;}if(_0x3a8be2[_0x2ad211(0x111)]==null){_0x5be53c['push']({'sqlCode':_0x1e9fce[_0x2ad211(0xee)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x961c19=await readFile(_0x1e9fce[_0x2ad211(0x109)],_0x2ad211(0x103)),_0x2345fa=stripLocalSqlMetadata(_0x961c19,_0x1e9fce[_0x2ad211(0x115)]),_0x54d528=_0x1e9fce['sqlName']||_0x3a8be2[_0x2ad211(0x117)],_0x4e198a=await resolveTargetDbBinding(_0x1d747d[_0x2ad211(0xf7)],_0x1e9fce,_0x3a8be2),_0x39789a=await updateSqlQuery({'id':_0x3a8be2['remoteId'],'appCode':_0x1d747d[_0x2ad211(0xf7)],'sqlCode':_0x1e9fce[_0x2ad211(0xee)],'sqlName':_0x54d528,'dbId':_0x4e198a[_0x2ad211(0xf3)],'version':_0x3a8be2[_0x2ad211(0x111)],'sqlContent':_0x2345fa,'sqlConfig':_0x3a8be2[_0x2ad211(0xfd)]??undefined}),_0x3437b7=_0x39789a[_0x2ad211(0xf3)]?await getDbName(_0x1d747d[_0x2ad211(0xf7)],Number(_0x39789a[_0x2ad211(0xf3)]))[_0x2ad211(0xf0)](()=>_0x4e198a[_0x2ad211(0xfb)]):_0x4e198a[_0x2ad211(0xfb)];_0x607f1a[_0x2ad211(0x10b)][_0x1e9fce['sqlCode']]={...buildSqlLockEntry(_0x39789a,_0x2345fa,_0x326fa1,{'dbName':_0x3437b7}),'path':_0x1e9fce[_0x2ad211(0xfe)],'mode':_0x3a8be2[_0x2ad211(0x115)]},await archivePreviousSqlFileIfNeeded(_0x1d23f6,_0x3a8be2[_0x2ad211(0xf8)],_0x1e9fce['relativePath']),_0x5753ac['push']({'sqlCode':_0x1e9fce['sqlCode'],'remoteId':_0x3a8be2[_0x2ad211(0x116)]});}catch(_0x6e3c4f){_0x5be53c[_0x2ad211(0x106)]({'sqlCode':_0x1e9fce[_0x2ad211(0xee)],'error':_0x6e3c4f instanceof Error?_0x6e3c4f[_0x2ad211(0xe6)]:String(_0x6e3c4f)});}}return _0x607f1a[_0x2ad211(0x11b)]=new Date()['toISOString'](),await writeSqlLockFile(_0x1d23f6[_0x2ad211(0x105)],_0x4ee694),{'ok':_0x5be53c[_0x2ad211(0x107)]===0x0,'data':{'pushed':_0x5753ac,'skipped':_0x5722d8,'failed':_0x5be53c},'message':_0x2ad211(0xf2)+_0x5753ac[_0x2ad211(0x107)]+'\x20pushed,\x20'+_0x5722d8[_0x2ad211(0x107)]+_0x2ad211(0x113)+_0x5be53c[_0x2ad211(0x107)]+_0x2ad211(0xf5)};}};function a176_0x4bb8(){const _0x210b50=['path','2282BKPxss','join','dbName','projectRoot','sqlConfig','relativePath','51252iYXigS','boolean','sqlcode','1135tLQANu','utf8','isFinite','lockFilePath','push','length','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','filePath','hash','sqls','\x20SQL\x20file(s)','entries','2097920DXfphM','exec','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','version','911560NDUSjC','\x20skipped,\x20','validation','mode','remoteId','sqlName','unchanged','Local\x20SQL\x20not\x20found:\x20','force','lastSync','set','No\x20database\x20matches\x20local\x20directory\x20\x22','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','No\x20local\x20SQL\x20files\x20found.','high-risk-write','filter','get','bool','replace','sqlRoot','map','7QCUmLQ','trashDir','593252UGrhFQ','message','/smartapi/custom/updateUserCustomSql','sqlRootDir','str','has','2167LSVwEg','Local\x20directory\x20\x22','1530294ILeqds','sqlCode','Push\x20local\x20SQL\x20files\x20to\x20remote','catch','63yllaQU','Push\x20complete:\x20','dbId','8808WzJOKa','\x20failed','1416tBJTYE','appCode'];a176_0x4bb8=function(){return _0x210b50;};return a176_0x4bb8();}async function archivePreviousSqlFileIfNeeded(_0x418873,_0x111e15,_0x3ca672){const _0x56647f=a176_0x2db0bc;if(!_0x111e15||_0x111e15===_0x3ca672)return;const _0xda3c23=join(_0x418873['sqlRootDir'],_0x111e15);if(!await fileExists(_0xda3c23))return;const _0x3c4259=await moveToTrash(_0x418873[_0x56647f(0xfc)],_0x418873[_0x56647f(0xe4)],_0xda3c23);await cleanupEmptyDirectories(dirname(_0xda3c23),_0x418873[_0x56647f(0xe8)]),void _0x3c4259;}async function moveToTrash(_0x46f759,_0x11e721,_0x163843){const _0x4cf627=a176_0x2db0bc,_0x320902=new Date()['toISOString']()[_0x4cf627(0xe0)](/[:.]/g,'-'),_0x1db5d7=relative(_0x46f759,_0x163843),_0x2a8639=join(_0x11e721,_0x320902,_0x1db5d7);return await mkdir(dirname(_0x2a8639),{'recursive':!![]}),await rename(_0x163843,_0x2a8639),_0x2a8639;}async function cleanupEmptyDirectories(_0x45f551,_0x51e220){const _0x122b37=a176_0x2db0bc;let _0x125083=resolve(_0x45f551);const _0x2648c2=resolve(_0x51e220);while(_0x125083['startsWith'](''+_0x2648c2+sep)||_0x125083===_0x2648c2){if(_0x125083===_0x2648c2)return;try{const _0xcaef0f=await readdir(_0x125083);if(_0xcaef0f[_0x122b37(0x107)]>0x0)return;await rmdir(_0x125083);}catch{return;}_0x125083=dirname(_0x125083);}}async function resolveTargetDbBinding(_0x68ae57,_0x14c8a1,_0x4f0f90){const _0x45ab89=a176_0x2db0bc,_0x500c80=_0x14c8a1['dbDirectory'];if(!_0x500c80)return{'dbId':_0x4f0f90[_0x45ab89(0xf3)],'dbName':_0x4f0f90[_0x45ab89(0xfb)]};const _0x2dcd71=buildDbDirectoryName(_0x4f0f90[_0x45ab89(0xfb)],_0x4f0f90[_0x45ab89(0xf3)]);if(_0x500c80===_0x2dcd71)return{'dbId':_0x4f0f90[_0x45ab89(0xf3)],'dbName':_0x4f0f90[_0x45ab89(0xfb)]};const _0x2e9d05=parseExplicitDbDirectory(_0x500c80);if(_0x2e9d05!=null)return{'dbId':_0x2e9d05,'dbName':await getDbName(_0x68ae57,_0x2e9d05)[_0x45ab89(0xf0)](()=>undefined)};const _0x268b0b=await listDatabases(_0x68ae57),_0x5b1cb0=_0x268b0b[_0x45ab89(0xdd)](_0x31f2c5=>buildDbDirectoryName(_0x31f2c5[_0x45ab89(0xfb)],_0x31f2c5[_0x45ab89(0xf3)])===_0x500c80);if(_0x5b1cb0[_0x45ab89(0x107)]===0x1)return{'dbId':_0x5b1cb0[0x0][_0x45ab89(0xf3)],'dbName':_0x5b1cb0[0x0][_0x45ab89(0xfb)]};if(_0x5b1cb0[_0x45ab89(0x107)]===0x0)throw CliErrors[_0x45ab89(0x114)](_0x45ab89(0x11d)+_0x500c80+'\x22\x20for\x20sqlCode\x20'+_0x14c8a1[_0x45ab89(0xee)]+'.');const _0x1b5ce9=_0x5b1cb0[_0x45ab89(0xe2)](_0x3d13f5=>_0x3d13f5[_0x45ab89(0xfb)]+'\x20('+_0x3d13f5[_0x45ab89(0xf3)]+')')[_0x45ab89(0xfa)](',\x20');throw CliErrors[_0x45ab89(0x114)](_0x45ab89(0xec)+_0x500c80+_0x45ab89(0x110)+_0x14c8a1['sqlCode']+':\x20'+_0x1b5ce9);}function parseExplicitDbDirectory(_0x593b1d){const _0x183de9=a176_0x2db0bc,_0x757e10=/^db-(\d+)$/[_0x183de9(0x10f)](_0x593b1d);if(!_0x757e10)return null;const _0x135d5b=Number(_0x757e10[0x1]);return Number[_0x183de9(0x104)](_0x135d5b)&&_0x135d5b>0x0?_0x135d5b:null;}
1
+ const a177_0x16cc7b=a177_0x1b71;(function(_0x192c95,_0x588b85){const _0x297b33=a177_0x1b71,_0x325a21=_0x192c95();while(!![]){try{const _0x54c69b=-parseInt(_0x297b33(0x18c))/0x1*(parseInt(_0x297b33(0x188))/0x2)+parseInt(_0x297b33(0x181))/0x3*(parseInt(_0x297b33(0x18e))/0x4)+-parseInt(_0x297b33(0x187))/0x5+parseInt(_0x297b33(0x1aa))/0x6+parseInt(_0x297b33(0x18a))/0x7*(-parseInt(_0x297b33(0x1bd))/0x8)+parseInt(_0x297b33(0x1be))/0x9+parseInt(_0x297b33(0x1b3))/0xa*(-parseInt(_0x297b33(0x185))/0xb);if(_0x54c69b===_0x588b85)break;else _0x325a21['push'](_0x325a21['shift']());}catch(_0x32f151){_0x325a21['push'](_0x325a21['shift']());}}}(a177_0x196f,0x90e3e));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';function a177_0x1b71(_0x5c461c,_0x323ecb){_0x5c461c=_0x5c461c-0x17d;const _0x196f58=a177_0x196f();let _0x1b7118=_0x196f58[_0x5c461c];return _0x1b7118;}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x14a5f2,_0x304fe9,_0x372126){const _0x12f85b=a177_0x1b71,_0x47a205=await scanLocalSqlQueries(_0x14a5f2),_0x28a9fc=new Map();for(const _0x63ca64 of _0x47a205){if(_0x372126&&_0x63ca64[_0x12f85b(0x183)]!==_0x372126)continue;const _0xe71bb0=_0x28a9fc[_0x12f85b(0x17e)](_0x63ca64[_0x12f85b(0x183)])??[];_0xe71bb0[_0x12f85b(0x1b6)](_0x63ca64),_0x28a9fc[_0x12f85b(0x17f)](_0x63ca64[_0x12f85b(0x183)],_0xe71bb0);}if(_0x372126&&!_0x28a9fc[_0x12f85b(0x180)](_0x372126))throw CliErrors['validation'](_0x12f85b(0x19f)+_0x372126);const _0x1d0445=[];for(const [_0xf77b8a,_0x4628da]of _0x28a9fc[_0x12f85b(0x1bc)]()){if(_0x4628da[_0x12f85b(0x1a6)]===0x1){_0x1d0445[_0x12f85b(0x1b6)](_0x4628da[0x0]);continue;}const _0xcfa773=_0x304fe9[_0x12f85b(0x1c1)][_0xf77b8a],_0x42353f=_0xcfa773?.[_0x12f85b(0x19b)],_0x369360=_0x42353f?_0x4628da[_0x12f85b(0x1b5)](_0x4ca03b=>_0x4ca03b['relativePath']!==_0x42353f):_0x4628da;if(_0xcfa773&&_0x369360[_0x12f85b(0x1a6)]===0x1){_0x1d0445[_0x12f85b(0x1b6)](_0x369360[0x0]);continue;}throw CliErrors[_0x12f85b(0x1b1)](_0x12f85b(0x184)+_0xf77b8a+_0x12f85b(0x18b));}return _0x1d0445;}export const sqlPush={'service':'sql','command':'push','description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a177_0x16cc7b(0x195),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a177_0x16cc7b(0x18d),'type':a177_0x16cc7b(0x1b2),'description':a177_0x16cc7b(0x1a8)}],async 'dryRun'(_0x27b7f0){const _0x5de01d=a177_0x16cc7b,_0xbe9497=loadSqlProjectConfig(_0x27b7f0[_0x5de01d(0x186)]),_0x21e1c1=await readSqlLockFile(_0xbe9497[_0x5de01d(0x1ad)]),{appLock:_0x3ae1eb}=ensureSqlLockScope(_0x21e1c1??createEmptySqlLock(),_0x27b7f0[_0x5de01d(0x186)],_0xbe9497[_0x5de01d(0x1af)],'push'),_0x3469c3=await getTargetSqlQueries(_0xbe9497,_0x3ae1eb,_0x27b7f0['str'](_0x5de01d(0x190))||undefined),_0xac091b=[];for(const _0x4d2f96 of _0x3469c3){const _0x40a828=await computeSqlFileHash(_0x4d2f96[_0x5de01d(0x1a7)]),_0x532fb5=_0x3ae1eb[_0x5de01d(0x1c1)][_0x4d2f96[_0x5de01d(0x183)]],_0x373bba=!!_0x532fb5&&(_0x532fb5[_0x5de01d(0x19b)]!==_0x4d2f96[_0x5de01d(0x1ac)]||!!_0x4d2f96['sqlName']&&_0x532fb5[_0x5de01d(0x199)]!==_0x4d2f96[_0x5de01d(0x199)]);if(!_0x27b7f0[_0x5de01d(0x194)]('force')&&_0x532fb5&&_0x532fb5[_0x5de01d(0x1b8)]===_0x40a828&&!_0x373bba)continue;_0xac091b[_0x5de01d(0x1b6)](_0x4d2f96['sqlCode']);}return{'method':_0x5de01d(0x1b4),'url':_0x5de01d(0x1a4),'body':{'sqlCodes':_0xac091b,'appCode':_0x27b7f0[_0x5de01d(0x186)]},'description':_0x5de01d(0x189)+_0xac091b[_0x5de01d(0x1a6)]+_0x5de01d(0x17d)};},async 'execute'(_0x9052c7){const _0x7e8377=a177_0x16cc7b,_0x39c4bd=loadSqlProjectConfig(_0x9052c7[_0x7e8377(0x186)]),_0x292178=await readSqlLockFile(_0x39c4bd[_0x7e8377(0x1ad)]),{lockData:_0x4e6409,appLock:_0x599480}=ensureSqlLockScope(_0x292178??createEmptySqlLock(),_0x9052c7[_0x7e8377(0x186)],_0x39c4bd[_0x7e8377(0x1af)],_0x7e8377(0x1b6)),_0x46fca6=await getTargetSqlQueries(_0x39c4bd,_0x599480,_0x9052c7['str'](_0x7e8377(0x190))||undefined);if(_0x46fca6[_0x7e8377(0x1a6)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x7e8377(0x1a1)};const _0x7768ef=[],_0x142f72=[],_0x3da50f=[];for(const _0x3841b9 of _0x46fca6){const _0x1e76e0=_0x599480[_0x7e8377(0x1c1)][_0x3841b9[_0x7e8377(0x183)]];if(!_0x1e76e0){_0x3da50f[_0x7e8377(0x1b6)]({'sqlCode':_0x3841b9[_0x7e8377(0x183)],'error':_0x7e8377(0x1ba)});continue;}try{const _0x54b6c9=await computeSqlFileHash(_0x3841b9[_0x7e8377(0x1a7)]),_0x440636=_0x1e76e0['path']!==_0x3841b9[_0x7e8377(0x1ac)]||!!_0x3841b9[_0x7e8377(0x199)]&&_0x1e76e0[_0x7e8377(0x199)]!==_0x3841b9['sqlName'];if(!_0x9052c7[_0x7e8377(0x194)]('force')&&_0x1e76e0[_0x7e8377(0x1b8)]===_0x54b6c9&&!_0x440636){_0x142f72[_0x7e8377(0x1b6)]({'sqlCode':_0x3841b9[_0x7e8377(0x183)],'reason':'unchanged'});continue;}if(_0x1e76e0[_0x7e8377(0x196)]==null){_0x3da50f[_0x7e8377(0x1b6)]({'sqlCode':_0x3841b9[_0x7e8377(0x183)],'error':_0x7e8377(0x1a9)});continue;}const _0x59b8c7=await readFile(_0x3841b9['filePath'],_0x7e8377(0x182)),_0x40021d=stripLocalSqlMetadata(_0x59b8c7,_0x3841b9[_0x7e8377(0x1b0)]),_0xb8efbc=_0x3841b9[_0x7e8377(0x199)]||_0x1e76e0[_0x7e8377(0x199)],_0x1f3190=await resolveTargetDbBinding(_0x9052c7[_0x7e8377(0x186)],_0x3841b9,_0x1e76e0),_0x130742=await updateSqlQuery({'id':_0x1e76e0['remoteId'],'appCode':_0x9052c7[_0x7e8377(0x186)],'sqlCode':_0x3841b9[_0x7e8377(0x183)],'sqlName':_0xb8efbc,'dbId':_0x1f3190['dbId'],'version':_0x1e76e0[_0x7e8377(0x196)],'sqlContent':_0x40021d,'sqlConfig':_0x1e76e0['sqlConfig']??undefined}),_0x2e65dc=_0x130742[_0x7e8377(0x198)]?await getDbName(_0x9052c7[_0x7e8377(0x186)],Number(_0x130742[_0x7e8377(0x198)]))[_0x7e8377(0x1c0)](()=>_0x1f3190[_0x7e8377(0x1b7)]):_0x1f3190[_0x7e8377(0x1b7)];_0x599480[_0x7e8377(0x1c1)][_0x3841b9['sqlCode']]={...buildSqlLockEntry(_0x130742,_0x40021d,_0x54b6c9,{'dbName':_0x2e65dc}),'path':_0x3841b9['relativePath'],'mode':_0x1e76e0[_0x7e8377(0x1b0)]},await archivePreviousSqlFileIfNeeded(_0x39c4bd,_0x1e76e0['path'],_0x3841b9[_0x7e8377(0x1ac)]),_0x7768ef[_0x7e8377(0x1b6)]({'sqlCode':_0x3841b9[_0x7e8377(0x183)],'remoteId':_0x1e76e0[_0x7e8377(0x19e)]});}catch(_0x572123){_0x3da50f[_0x7e8377(0x1b6)]({'sqlCode':_0x3841b9[_0x7e8377(0x183)],'error':_0x572123 instanceof Error?_0x572123[_0x7e8377(0x1ab)]:String(_0x572123)});}}return _0x599480[_0x7e8377(0x1ae)]=new Date()[_0x7e8377(0x18f)](),await writeSqlLockFile(_0x39c4bd[_0x7e8377(0x1ad)],_0x4e6409),{'ok':_0x3da50f['length']===0x0,'data':{'pushed':_0x7768ef,'skipped':_0x142f72,'failed':_0x3da50f},'message':_0x7e8377(0x19a)+_0x7768ef[_0x7e8377(0x1a6)]+_0x7e8377(0x19d)+_0x142f72['length']+_0x7e8377(0x1a5)+_0x3da50f[_0x7e8377(0x1a6)]+_0x7e8377(0x1a2)};}};async function archivePreviousSqlFileIfNeeded(_0x43aabb,_0x5ecd73,_0x1be57b){const _0x2a5f3e=a177_0x16cc7b;if(!_0x5ecd73||_0x5ecd73===_0x1be57b)return;const _0x22c109=join(_0x43aabb[_0x2a5f3e(0x192)],_0x5ecd73);if(!await fileExists(_0x22c109))return;const _0x21441e=await moveToTrash(_0x43aabb[_0x2a5f3e(0x1b9)],_0x43aabb['trashDir'],_0x22c109);await cleanupEmptyDirectories(dirname(_0x22c109),_0x43aabb[_0x2a5f3e(0x192)]),void _0x21441e;}function a177_0x196f(){const _0x1c11a1=['replace','dbId','sqlName','Push\x20complete:\x20','path','startsWith','\x20pushed,\x20','remoteId','Local\x20SQL\x20not\x20found:\x20','No\x20database\x20matches\x20local\x20directory\x20\x22','No\x20local\x20SQL\x20files\x20found.','\x20failed','\x22\x20for\x20sqlCode\x20','/smartapi/custom/updateUserCustomSql','\x20skipped,\x20','length','filePath','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','6998016ZUBhYw','message','relativePath','lockFilePath','lastSync','sqlRoot','mode','validation','boolean','7353090OptyXP','POST','filter','push','dbName','hash','projectRoot','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','map','entries','28400ViHIsQ','336159fjlXvC','join','catch','sqls','\x20SQL\x20file(s)','get','set','has','930GJSyWG','utf8','sqlCode','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','11AEnnsQ','appCode','1897395VVRXvf','13754ONnNjr','Would\x20push\x20','140unzwOf','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','67ApvGOU','force','13372myCiXC','toISOString','sqlcode','Local\x20directory\x20\x22','sqlRootDir','isFinite','bool','high-risk-write','version'];a177_0x196f=function(){return _0x1c11a1;};return a177_0x196f();}async function moveToTrash(_0x2d3760,_0x237f2a,_0x30d902){const _0x1f2f84=a177_0x16cc7b,_0x3c6178=new Date()['toISOString']()[_0x1f2f84(0x197)](/[:.]/g,'-'),_0x439c83=relative(_0x2d3760,_0x30d902),_0x215d36=join(_0x237f2a,_0x3c6178,_0x439c83);return await mkdir(dirname(_0x215d36),{'recursive':!![]}),await rename(_0x30d902,_0x215d36),_0x215d36;}async function cleanupEmptyDirectories(_0x5b83a3,_0x458460){const _0x2bed2e=a177_0x16cc7b;let _0x3e89f0=resolve(_0x5b83a3);const _0x15b247=resolve(_0x458460);while(_0x3e89f0[_0x2bed2e(0x19c)](''+_0x15b247+sep)||_0x3e89f0===_0x15b247){if(_0x3e89f0===_0x15b247)return;try{const _0x2221dc=await readdir(_0x3e89f0);if(_0x2221dc[_0x2bed2e(0x1a6)]>0x0)return;await rmdir(_0x3e89f0);}catch{return;}_0x3e89f0=dirname(_0x3e89f0);}}async function resolveTargetDbBinding(_0x113a7c,_0x3f51e3,_0x5a6e2b){const _0x2a7b4e=a177_0x16cc7b,_0x55a3a0=_0x3f51e3['dbDirectory'];if(!_0x55a3a0)return{'dbId':_0x5a6e2b[_0x2a7b4e(0x198)],'dbName':_0x5a6e2b['dbName']};const _0x230684=buildDbDirectoryName(_0x5a6e2b['dbName'],_0x5a6e2b[_0x2a7b4e(0x198)]);if(_0x55a3a0===_0x230684)return{'dbId':_0x5a6e2b['dbId'],'dbName':_0x5a6e2b[_0x2a7b4e(0x1b7)]};const _0x5800f0=parseExplicitDbDirectory(_0x55a3a0);if(_0x5800f0!=null)return{'dbId':_0x5800f0,'dbName':await getDbName(_0x113a7c,_0x5800f0)[_0x2a7b4e(0x1c0)](()=>undefined)};const _0x5960b2=await listDatabases(_0x113a7c),_0xe5b878=_0x5960b2[_0x2a7b4e(0x1b5)](_0x4c810b=>buildDbDirectoryName(_0x4c810b[_0x2a7b4e(0x1b7)],_0x4c810b[_0x2a7b4e(0x198)])===_0x55a3a0);if(_0xe5b878[_0x2a7b4e(0x1a6)]===0x1)return{'dbId':_0xe5b878[0x0][_0x2a7b4e(0x198)],'dbName':_0xe5b878[0x0][_0x2a7b4e(0x1b7)]};if(_0xe5b878[_0x2a7b4e(0x1a6)]===0x0)throw CliErrors[_0x2a7b4e(0x1b1)](_0x2a7b4e(0x1a0)+_0x55a3a0+_0x2a7b4e(0x1a3)+_0x3f51e3['sqlCode']+'.');const _0x286e43=_0xe5b878[_0x2a7b4e(0x1bb)](_0x2c3fc6=>_0x2c3fc6[_0x2a7b4e(0x1b7)]+'\x20('+_0x2c3fc6['dbId']+')')[_0x2a7b4e(0x1bf)](',\x20');throw CliErrors[_0x2a7b4e(0x1b1)](_0x2a7b4e(0x191)+_0x55a3a0+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x3f51e3[_0x2a7b4e(0x183)]+':\x20'+_0x286e43);}function parseExplicitDbDirectory(_0x1ea97a){const _0x3991c6=a177_0x16cc7b,_0x7f8871=/^db-(\d+)$/['exec'](_0x1ea97a);if(!_0x7f8871)return null;const _0x2c7649=Number(_0x7f8871[0x1]);return Number[_0x3991c6(0x193)](_0x2c7649)&&_0x2c7649>0x0?_0x2c7649:null;}
@@ -1 +1 @@
1
- const a177_0x21420f=a177_0x4b30;(function(_0x222b48,_0x4902d6){const _0xe9eb34=a177_0x4b30,_0xd7bfb1=_0x222b48();while(!![]){try{const _0x8d33aa=-parseInt(_0xe9eb34(0x15a))/0x1+parseInt(_0xe9eb34(0x155))/0x2*(-parseInt(_0xe9eb34(0x163))/0x3)+-parseInt(_0xe9eb34(0x168))/0x4*(parseInt(_0xe9eb34(0x167))/0x5)+-parseInt(_0xe9eb34(0x15c))/0x6*(-parseInt(_0xe9eb34(0x157))/0x7)+-parseInt(_0xe9eb34(0x161))/0x8*(parseInt(_0xe9eb34(0x15e))/0x9)+parseInt(_0xe9eb34(0x15b))/0xa*(parseInt(_0xe9eb34(0x16d))/0xb)+parseInt(_0xe9eb34(0x15f))/0xc;if(_0x8d33aa===_0x4902d6)break;else _0xd7bfb1['push'](_0xd7bfb1['shift']());}catch(_0x3a8980){_0xd7bfb1['push'](_0xd7bfb1['shift']());}}}(a177_0x4232,0xc7a1c));import{CliErrors}from'../../errors.js';function a177_0x4b30(_0x2716e2,_0x2b49ae){_0x2716e2=_0x2716e2-0x155;const _0x4232e3=a177_0x4232();let _0x4b30db=_0x4232e3[_0x2716e2];return _0x4b30db;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a177_0x21420f(0x158),a177_0x21420f(0x160),'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`.'][a177_0x21420f(0x16a)]('\x0a');export const sqlSave={'service':a177_0x21420f(0x165),'command':'save','description':a177_0x21420f(0x156),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a177_0x21420f(0x169),'type':a177_0x21420f(0x15d),'required':!![],'description':a177_0x21420f(0x162)},SQLCODE_FLAG_OPTIONAL,{'name':a177_0x21420f(0x159),'type':a177_0x21420f(0x15d),'description':a177_0x21420f(0x16c)},{'name':'db','type':a177_0x21420f(0x15d),'description':a177_0x21420f(0x164)},{'name':'description','type':a177_0x21420f(0x15d),'description':a177_0x21420f(0x16b)}],async 'validate'(){const _0x345c5f=a177_0x21420f;throw CliErrors[_0x345c5f(0x166)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x3e6302=a177_0x21420f;throw CliErrors[_0x3e6302(0x166)](SQL_SAVE_DEPRECATED_HINT);}};function a177_0x4232(){const _0x45c4bf=['`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','sqlname','373007lMphpv','120AzJwSX','6esvTSy','string','4400883HssvVz','12921336qoFcTt','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','8ZDHosp','Path\x20to\x20the\x20SQL\x20file','427827nTjFrD','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','sql','validation','10RUFLKP','1960776NGHDzE','file','join','Query\x20description','SQL\x20query\x20display\x20name','1138852vwVLRH','18pQdtAE','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','11370751qBqXRM'];a177_0x4232=function(){return _0x45c4bf;};return a177_0x4232();}
1
+ function a178_0x362c(){const _0x1b17f5=['Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','1588413NXWsaK','Query\x20description','write','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','file','2660lNjzJo','9ipWwhK','11142490oSmKRf','save','description','string','sql','8410296JMgQOH','839Enqrlt','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','validation','SQL\x20query\x20display\x20name','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`.','26928BBVhpI','21541949RelSCQ','3122upNdAh','1581700bVjcMC','5HNMqes'];a178_0x362c=function(){return _0x1b17f5;};return a178_0x362c();}const a178_0x21ccad=a178_0x3780;(function(_0x26edae,_0x25d142){const _0x4b7aa7=a178_0x3780,_0x27416a=_0x26edae();while(!![]){try{const _0x20a7b3=parseInt(_0x4b7aa7(0x12e))/0x1*(parseInt(_0x4b7aa7(0x135))/0x2)+parseInt(_0x4b7aa7(0x13a))/0x3+-parseInt(_0x4b7aa7(0x136))/0x4+parseInt(_0x4b7aa7(0x137))/0x5*(parseInt(_0x4b7aa7(0x12d))/0x6)+parseInt(_0x4b7aa7(0x13f))/0x7*(-parseInt(_0x4b7aa7(0x133))/0x8)+parseInt(_0x4b7aa7(0x127))/0x9*(parseInt(_0x4b7aa7(0x128))/0xa)+-parseInt(_0x4b7aa7(0x134))/0xb;if(_0x20a7b3===_0x25d142)break;else _0x27416a['push'](_0x27416a['shift']());}catch(_0xe23ff5){_0x27416a['push'](_0x27416a['shift']());}}}(a178_0x362c,0xb054b));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a178_0x21ccad(0x13d),a178_0x21ccad(0x138),a178_0x21ccad(0x132)]['join']('\x0a');function a178_0x3780(_0x161d8b,_0x4b7e04){_0x161d8b=_0x161d8b-0x127;const _0x362cbd=a178_0x362c();let _0x3780dd=_0x362cbd[_0x161d8b];return _0x3780dd;}export const sqlSave={'service':a178_0x21ccad(0x12c),'command':a178_0x21ccad(0x129),'description':a178_0x21ccad(0x139),'risk':a178_0x21ccad(0x13c),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a178_0x21ccad(0x13e),'type':a178_0x21ccad(0x12b),'required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':a178_0x21ccad(0x12b),'description':a178_0x21ccad(0x131)},{'name':'db','type':a178_0x21ccad(0x12b),'description':a178_0x21ccad(0x12f)},{'name':a178_0x21ccad(0x12a),'type':'string','description':a178_0x21ccad(0x13b)}],async 'validate'(){const _0xf22cec=a178_0x21ccad;throw CliErrors[_0xf22cec(0x130)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x27f39a=a178_0x21ccad;throw CliErrors[_0x27f39a(0x130)](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- (function(_0x35c731,_0x2c6ac3){const _0xf75eb8=a178_0xf1c8,_0xc32d7=_0x35c731();while(!![]){try{const _0x432f1e=parseInt(_0xf75eb8(0x1cd))/0x1*(parseInt(_0xf75eb8(0x1d7))/0x2)+-parseInt(_0xf75eb8(0x1e8))/0x3*(parseInt(_0xf75eb8(0x1cc))/0x4)+-parseInt(_0xf75eb8(0x1e5))/0x5*(-parseInt(_0xf75eb8(0x1d5))/0x6)+-parseInt(_0xf75eb8(0x1ea))/0x7*(parseInt(_0xf75eb8(0x1f4))/0x8)+parseInt(_0xf75eb8(0x1cb))/0x9+-parseInt(_0xf75eb8(0x1f1))/0xa+-parseInt(_0xf75eb8(0x1de))/0xb*(parseInt(_0xf75eb8(0x1dc))/0xc);if(_0x432f1e===_0x2c6ac3)break;else _0xc32d7['push'](_0xc32d7['shift']());}catch(_0xbee27){_0xc32d7['push'](_0xc32d7['shift']());}}}(a178_0x5892,0x49123));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x2d6bba,_0x27ddd6,_0x553eee,_0x4714f2){const _0x3dab09=a178_0xf1c8,_0x2f853f=detectSqlMode(_0x27ddd6);return{'path':buildSqlRelativePath(_0x2d6bba[_0x3dab09(0x1d1)],_0x2d6bba[_0x3dab09(0x1df)],_0x4714f2?.['dbName'],_0x2f853f,_0x2d6bba[_0x3dab09(0x1f8)]),'hash':_0x553eee,'remoteId':_0x2d6bba['id'],'version':_0x2d6bba[_0x3dab09(0x1e3)],'dbId':Number(_0x2d6bba['dbId']),'dbName':_0x4714f2?.['dbName'],'sqlName':_0x2d6bba[_0x3dab09(0x1df)],'sqlConfig':_0x2d6bba['sqlConfig']??undefined,'mode':_0x2f853f};}export function cloneSqlLockData(_0x5e788f){const _0x17c77a=a178_0xf1c8;return{'apps':Object[_0x17c77a(0x1dd)](Object['entries'](_0x5e788f['apps'])[_0x17c77a(0x1e4)](([_0x4b1336,_0xde45dc])=>[_0x4b1336,{'sqlRoot':_0xde45dc[_0x17c77a(0x1e2)],'lastSync':_0xde45dc[_0x17c77a(0x1ed)],'sqls':{..._0xde45dc['sqls']}}]))};}function a178_0x5892(){const _0x2fdb48=['stdin','test','filter','4002540yYRddu','mode','sqlContent','144zRkgCS','trim','yes','question','dbId','close','2646360lMIHDW','40slHYoW','1OmgKpy','description','stderr','\x20-->','sqlCode','split','syncedAt','join','23808ZsVhrD','dbName','513496BBSjFG','<!--\x20@lovrabet.','endsWith','apps','trimStart','36UQPSKr','fromEntries','909689LJJjms','sqlName','path','push','sqlRoot','version','map','645WEtndM','replace','\x20[y/N]\x20','3669MlwEsz','toLowerCase','39970auajHz','length','mybatisXml','lastSync'];a178_0x5892=function(){return _0x2fdb48;};return a178_0x5892();}export function ensureRemoteSqlContent(_0xb6aecd){const _0x1343f8=a178_0xf1c8;return _0xb6aecd[_0x1343f8(0x1f3)]??'';}export function buildLocalSqlFileContent(_0xc35269,_0x456f38,_0x519291){const _0x4d0fad=a178_0xf1c8,_0x2188f4=_0x519291?.['mode']??detectSqlMode(_0x456f38),_0x2f4278=stripLocalSqlMetadata(_0x456f38,_0x2188f4)[_0x4d0fad(0x1f5)](),_0x34f9e5=[...buildMetadataHeaderLines({'sqlCode':_0xc35269[_0x4d0fad(0x1d1)],'sqlName':_0xc35269[_0x4d0fad(0x1df)],'dbId':_0xc35269[_0x4d0fad(0x1f8)],'dbName':_0x519291?.[_0x4d0fad(0x1d6)],'mode':_0x2188f4,'syncedAt':_0x519291?.[_0x4d0fad(0x1d3)],'description':_0x519291?.[_0x4d0fad(0x1ce)]},_0x2188f4),'',_0x2f4278],_0x5f2633=_0x34f9e5['join']('\x0a');return _0x5f2633[_0x4d0fad(0x1d9)]('\x0a')?_0x5f2633:_0x5f2633+'\x0a';}export function stripLocalSqlMetadata(_0x2e7f42,_0x18c37a){const _0x7d5655=a178_0xf1c8,_0x32013d=_0x2e7f42[_0x7d5655(0x1e6)](/\r\n/g,'\x0a')[_0x7d5655(0x1d2)]('\x0a'),_0x1241af=[];let _0x28257e=0x0;if(_0x18c37a===_0x7d5655(0x1ec))while(_0x28257e<_0x32013d[_0x7d5655(0x1eb)]){const _0x3ee249=_0x32013d[_0x28257e]??'';if(/^\s*<!--\s*@lovrabet\./[_0x7d5655(0x1ef)](_0x3ee249)){_0x28257e++;continue;}if(_0x3ee249[_0x7d5655(0x1f5)]()===''&&_0x28257e>0x0){_0x28257e++;continue;}break;}else while(_0x28257e<_0x32013d[_0x7d5655(0x1eb)]){const _0x1576c4=_0x32013d[_0x28257e]??'';if(/^\s*--\s*@lovrabet\./[_0x7d5655(0x1ef)](_0x1576c4)){_0x28257e++;continue;}if(_0x1576c4[_0x7d5655(0x1f5)]()===''&&_0x28257e>0x0){_0x28257e++;continue;}break;}for(;_0x28257e<_0x32013d['length'];_0x28257e++){_0x1241af[_0x7d5655(0x1e1)](_0x32013d[_0x28257e]);}return _0x1241af[_0x7d5655(0x1d4)]('\x0a')[_0x7d5655(0x1db)]();}export function resolveSqlMode(_0xc81e9a,_0x53df6d){const _0x455d66=a178_0xf1c8;if(_0x53df6d?.[_0x455d66(0x1f2)])return _0x53df6d[_0x455d66(0x1f2)];return detectSqlMode(_0xc81e9a);}export function resolveSqlFileName(_0x5e1032,_0x21f214,_0x186b47){const _0x5827d5=a178_0xf1c8;if(_0x186b47?.[_0x5827d5(0x1e0)])return _0x186b47['path'];if(_0x186b47?.[_0x5827d5(0x1df)]||_0x186b47?.[_0x5827d5(0x1d6)])return buildSqlRelativePath(_0x5e1032,_0x186b47?.['sqlName'],_0x186b47?.['dbName'],resolveSqlMode(_0x21f214,_0x186b47),_0x186b47?.[_0x5827d5(0x1f8)]);return buildDefaultSqlFileName(_0x5e1032,resolveSqlMode(_0x21f214,_0x186b47));}export function resolveSqlLocalDir(_0xd73223,_0x54c144){return join(_0xd73223,SQL_LOCAL_REL_DIR,_0x54c144);}export async function confirmForceOverwrite(_0x3ab351){const _0x229d4c=a178_0xf1c8,_0x3888e4=createInterface({'input':process[_0x229d4c(0x1ee)],'output':process[_0x229d4c(0x1cf)]}),_0x5e5a14=await new Promise(_0x46307a=>{const _0x162cb9=_0x229d4c;_0x3888e4[_0x162cb9(0x1f7)](_0x3ab351+_0x162cb9(0x1e7),_0x46307a);});return _0x3888e4[_0x229d4c(0x1ca)](),['y',_0x229d4c(0x1f6)]['includes'](_0x5e5a14['trim']()[_0x229d4c(0x1e9)]());}export function findSqlLockScope(_0x4f3850,_0x11202b){const _0x578c60=a178_0xf1c8;return _0x4f3850[_0x578c60(0x1da)][_0x11202b];}function a178_0xf1c8(_0x921dc3,_0x3f417c){_0x921dc3=_0x921dc3-0x1ca;const _0x5892b7=a178_0x5892();let _0xf1c87b=_0x5892b7[_0x921dc3];return _0xf1c87b;}function buildMetadataHeaderLines(_0x33de3b,_0x5a577b){const _0x4f863d=a178_0xf1c8,_0x182a39=[[_0x4f863d(0x1d1),_0x33de3b[_0x4f863d(0x1d1)]],['sqlName',_0x33de3b[_0x4f863d(0x1df)]],[_0x4f863d(0x1f8),_0x33de3b[_0x4f863d(0x1f8)]],[_0x4f863d(0x1d6),_0x33de3b['dbName']],[_0x4f863d(0x1f2),_0x33de3b['mode']],[_0x4f863d(0x1d3),_0x33de3b['syncedAt']],[_0x4f863d(0x1ce),_0x33de3b[_0x4f863d(0x1ce)]]];if(_0x5a577b==='mybatisXml')return _0x182a39[_0x4f863d(0x1f0)](([,_0x9eb5ef])=>_0x9eb5ef!==undefined&&_0x9eb5ef!==null&&String(_0x9eb5ef)['trim']()!=='')[_0x4f863d(0x1e4)](([_0x50d3c9,_0x53185c])=>_0x4f863d(0x1d8)+_0x50d3c9+':\x20'+String(_0x53185c)+_0x4f863d(0x1d0));return _0x182a39['filter'](([,_0x4778ae])=>_0x4778ae!==undefined&&_0x4778ae!==null&&String(_0x4778ae)['trim']()!=='')['map'](([_0x30b1f9,_0x3a53fa])=>'--\x20@lovrabet.'+_0x30b1f9+':\x20'+String(_0x3a53fa));}
1
+ (function(_0x1abe96,_0x35f6da){const _0x71ac57=a179_0x44a9,_0x2aba6f=_0x1abe96();while(!![]){try{const _0xfe66fb=-parseInt(_0x71ac57(0xb9))/0x1+parseInt(_0x71ac57(0xa8))/0x2*(parseInt(_0x71ac57(0xb5))/0x3)+-parseInt(_0x71ac57(0xb3))/0x4+parseInt(_0x71ac57(0xa4))/0x5+-parseInt(_0x71ac57(0xb1))/0x6+parseInt(_0x71ac57(0xc1))/0x7*(-parseInt(_0x71ac57(0xaf))/0x8)+-parseInt(_0x71ac57(0xb2))/0x9*(-parseInt(_0x71ac57(0xa5))/0xa);if(_0xfe66fb===_0x35f6da)break;else _0x2aba6f['push'](_0x2aba6f['shift']());}catch(_0x13b998){_0x2aba6f['push'](_0x2aba6f['shift']());}}}(a179_0x4efb,0x3f540));import{createInterface}from'node:readline';import{join}from'node:path';function a179_0x4efb(){const _0x23e7d6=['sqlConfig','toLowerCase','test','\x20-->','lastSync','map','trimStart','question','stdin','yes','sqlRoot','dbId','897025xuSZkF','9530cMuGoo','close','syncedAt','269678LxJjhK','split','mybatisXml','mode','sqlName','length','filter','720PLuegY','join','2820180hPShXA','10269BaxDaR','1173608RYrAXK','version','3SzgyeT','replace','description','trim','310573arinWZ','endsWith','sqlCode','includes','\x20[y/N]\x20','path','stderr','dbName','5306CEtxeP'];a179_0x4efb=function(){return _0x23e7d6;};return a179_0x4efb();}import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';function a179_0x44a9(_0x241193,_0x52b407){_0x241193=_0x241193-0xa4;const _0x4efb03=a179_0x4efb();let _0x44a959=_0x4efb03[_0x241193];return _0x44a959;}export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x4c6d0f,_0x193e8b,_0x30bcac,_0x4c5633){const _0x1ca8ac=a179_0x44a9,_0x16b7ce=detectSqlMode(_0x193e8b);return{'path':buildSqlRelativePath(_0x4c6d0f[_0x1ca8ac(0xbb)],_0x4c6d0f['sqlName'],_0x4c5633?.['dbName'],_0x16b7ce,_0x4c6d0f[_0x1ca8ac(0xcd)]),'hash':_0x30bcac,'remoteId':_0x4c6d0f['id'],'version':_0x4c6d0f[_0x1ca8ac(0xb4)],'dbId':Number(_0x4c6d0f[_0x1ca8ac(0xcd)]),'dbName':_0x4c5633?.[_0x1ca8ac(0xc0)],'sqlName':_0x4c6d0f[_0x1ca8ac(0xac)],'sqlConfig':_0x4c6d0f[_0x1ca8ac(0xc2)]??undefined,'mode':_0x16b7ce};}export function cloneSqlLockData(_0x40ac0d){const _0x1bfc02=a179_0x44a9;return{'apps':Object['fromEntries'](Object['entries'](_0x40ac0d['apps'])[_0x1bfc02(0xc7)](([_0x3c3314,_0x3d2a78])=>[_0x3c3314,{'sqlRoot':_0x3d2a78[_0x1bfc02(0xcc)],'lastSync':_0x3d2a78[_0x1bfc02(0xc6)],'sqls':{..._0x3d2a78['sqls']}}]))};}export function ensureRemoteSqlContent(_0x549524){return _0x549524['sqlContent']??'';}export function buildLocalSqlFileContent(_0x240aef,_0x194852,_0x218c6b){const _0x3eb9a2=a179_0x44a9,_0xd24ecd=_0x218c6b?.['mode']??detectSqlMode(_0x194852),_0x3a2897=stripLocalSqlMetadata(_0x194852,_0xd24ecd)[_0x3eb9a2(0xb8)](),_0x5aff38=[...buildMetadataHeaderLines({'sqlCode':_0x240aef['sqlCode'],'sqlName':_0x240aef[_0x3eb9a2(0xac)],'dbId':_0x240aef[_0x3eb9a2(0xcd)],'dbName':_0x218c6b?.[_0x3eb9a2(0xc0)],'mode':_0xd24ecd,'syncedAt':_0x218c6b?.[_0x3eb9a2(0xa7)],'description':_0x218c6b?.[_0x3eb9a2(0xb7)]},_0xd24ecd),'',_0x3a2897],_0x42efc5=_0x5aff38[_0x3eb9a2(0xb0)]('\x0a');return _0x42efc5[_0x3eb9a2(0xba)]('\x0a')?_0x42efc5:_0x42efc5+'\x0a';}export function stripLocalSqlMetadata(_0x2253ca,_0x4de9a1){const _0x250b42=a179_0x44a9,_0xe0fd9e=_0x2253ca[_0x250b42(0xb6)](/\r\n/g,'\x0a')[_0x250b42(0xa9)]('\x0a'),_0x521b14=[];let _0x5e6eb0=0x0;if(_0x4de9a1===_0x250b42(0xaa))while(_0x5e6eb0<_0xe0fd9e[_0x250b42(0xad)]){const _0x1a376c=_0xe0fd9e[_0x5e6eb0]??'';if(/^\s*<!--\s*@lovrabet\./[_0x250b42(0xc4)](_0x1a376c)){_0x5e6eb0++;continue;}if(_0x1a376c[_0x250b42(0xb8)]()===''&&_0x5e6eb0>0x0){_0x5e6eb0++;continue;}break;}else while(_0x5e6eb0<_0xe0fd9e[_0x250b42(0xad)]){const _0x3a9b05=_0xe0fd9e[_0x5e6eb0]??'';if(/^\s*--\s*@lovrabet\./[_0x250b42(0xc4)](_0x3a9b05)){_0x5e6eb0++;continue;}if(_0x3a9b05[_0x250b42(0xb8)]()===''&&_0x5e6eb0>0x0){_0x5e6eb0++;continue;}break;}for(;_0x5e6eb0<_0xe0fd9e[_0x250b42(0xad)];_0x5e6eb0++){_0x521b14['push'](_0xe0fd9e[_0x5e6eb0]);}return _0x521b14[_0x250b42(0xb0)]('\x0a')[_0x250b42(0xc8)]();}export function resolveSqlMode(_0x41ef4b,_0x209b12){const _0x263302=a179_0x44a9;if(_0x209b12?.['mode'])return _0x209b12[_0x263302(0xab)];return detectSqlMode(_0x41ef4b);}export function resolveSqlFileName(_0x5dcc2b,_0x9d6333,_0x10afc0){const _0x1a9691=a179_0x44a9;if(_0x10afc0?.[_0x1a9691(0xbe)])return _0x10afc0['path'];if(_0x10afc0?.[_0x1a9691(0xac)]||_0x10afc0?.[_0x1a9691(0xc0)])return buildSqlRelativePath(_0x5dcc2b,_0x10afc0?.['sqlName'],_0x10afc0?.[_0x1a9691(0xc0)],resolveSqlMode(_0x9d6333,_0x10afc0),_0x10afc0?.[_0x1a9691(0xcd)]);return buildDefaultSqlFileName(_0x5dcc2b,resolveSqlMode(_0x9d6333,_0x10afc0));}export function resolveSqlLocalDir(_0x176ba7,_0x52c350){return join(_0x176ba7,SQL_LOCAL_REL_DIR,_0x52c350);}export async function confirmForceOverwrite(_0x4a143c){const _0x18727f=a179_0x44a9,_0x35c9bf=createInterface({'input':process[_0x18727f(0xca)],'output':process[_0x18727f(0xbf)]}),_0x44e3bb=await new Promise(_0x2ab878=>{const _0x7adfd1=_0x18727f;_0x35c9bf[_0x7adfd1(0xc9)](_0x4a143c+_0x7adfd1(0xbd),_0x2ab878);});return _0x35c9bf[_0x18727f(0xa6)](),['y',_0x18727f(0xcb)][_0x18727f(0xbc)](_0x44e3bb['trim']()[_0x18727f(0xc3)]());}export function findSqlLockScope(_0x117ae3,_0x5148ee){return _0x117ae3['apps'][_0x5148ee];}function buildMetadataHeaderLines(_0x48d98b,_0x2a75fc){const _0x1566a0=a179_0x44a9,_0x2c96c5=[[_0x1566a0(0xbb),_0x48d98b[_0x1566a0(0xbb)]],[_0x1566a0(0xac),_0x48d98b['sqlName']],[_0x1566a0(0xcd),_0x48d98b[_0x1566a0(0xcd)]],[_0x1566a0(0xc0),_0x48d98b[_0x1566a0(0xc0)]],[_0x1566a0(0xab),_0x48d98b[_0x1566a0(0xab)]],[_0x1566a0(0xa7),_0x48d98b['syncedAt']],['description',_0x48d98b[_0x1566a0(0xb7)]]];if(_0x2a75fc===_0x1566a0(0xaa))return _0x2c96c5['filter'](([,_0x4d3fe9])=>_0x4d3fe9!==undefined&&_0x4d3fe9!==null&&String(_0x4d3fe9)['trim']()!=='')[_0x1566a0(0xc7)](([_0x3b6131,_0x38cbff])=>'<!--\x20@lovrabet.'+_0x3b6131+':\x20'+String(_0x38cbff)+_0x1566a0(0xc5));return _0x2c96c5[_0x1566a0(0xae)](([,_0x1911cc])=>_0x1911cc!==undefined&&_0x1911cc!==null&&String(_0x1911cc)[_0x1566a0(0xb8)]()!=='')[_0x1566a0(0xc7)](([_0x5116b1,_0x4b5566])=>'--\x20@lovrabet.'+_0x5116b1+':\x20'+String(_0x4b5566));}
@@ -1 +1 @@
1
- function a179_0x2b5d(){const _0xfc2862=['remote','\x20missing,\x20','status','6GEFCXM','1231775TGLbsA','6387835cKnckb','totalCount','sqlName','3972315NqrZCH','tableData','keys','sqls','boolean','hash','lockFilePath','lockKey','appCode','read','sqlRoot','sql','map','1423076YJNdmZ','1621420yQubRK','push','sqlCode','has','path','length','\x20unchanged','28827712UQynFV','paging','\x20added,\x20','4556755hIOuue'];a179_0x2b5d=function(){return _0xfc2862;};return a179_0x2b5d();}const a179_0x34c744=a179_0x5c75;(function(_0x4d08b2,_0x2f21e1){const _0x4f77d2=a179_0x5c75,_0x25c194=_0x4d08b2();while(!![]){try{const _0x231ef3=-parseInt(_0x4f77d2(0x14d))/0x1+parseInt(_0x4f77d2(0x15f))/0x2+-parseInt(_0x4f77d2(0x151))/0x3+-parseInt(_0x4f77d2(0x15e))/0x4+-parseInt(_0x4f77d2(0x14e))/0x5*(parseInt(_0x4f77d2(0x14c))/0x6)+parseInt(_0x4f77d2(0x148))/0x7+parseInt(_0x4f77d2(0x145))/0x8;if(_0x231ef3===_0x2f21e1)break;else _0x25c194['push'](_0x25c194['shift']());}catch(_0x82d8ed){_0x25c194['push'](_0x25c194['shift']());}}}(a179_0x2b5d,0xd5d93));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a179_0x5c75(_0x58d538,_0x5860b0){_0x58d538=_0x58d538-0x140;const _0x2b5d29=a179_0x2b5d();let _0x5c7535=_0x2b5d29[_0x58d538];return _0x5c7535;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x5064ea){const _0x3a08ee=a179_0x5c75,_0x4a59ef=[];let _0x5b404b=0x1;while(!![]){const _0x3edf91=await listSqlQueries(_0x5064ea,{'currentPage':_0x5b404b,'pageSize':PAGE_SIZE}),_0x4f0ca2=_0x3edf91[_0x3a08ee(0x152)]??[];_0x4a59ef[_0x3a08ee(0x160)](..._0x4f0ca2['map'](_0x47d777=>_0x47d777[_0x3a08ee(0x140)]));if(_0x4f0ca2[_0x3a08ee(0x143)]===0x0)break;const _0x3c4851=_0x3edf91[_0x3a08ee(0x146)]?.[_0x3a08ee(0x14f)];if(_0x3c4851!=null?_0x4a59ef[_0x3a08ee(0x143)]>=_0x3c4851:_0x4f0ca2[_0x3a08ee(0x143)]<PAGE_SIZE)break;_0x5b404b++;}return _0x4a59ef;}export const sqlStatus={'service':a179_0x34c744(0x15c),'command':a179_0x34c744(0x14b),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a179_0x34c744(0x15a),'flags':[{'name':a179_0x34c744(0x149),'type':a179_0x34c744(0x155),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x538d3d){const _0x40b3d0=a179_0x34c744,_0x49f1a7=loadSqlProjectConfig(_0x538d3d['appCode']),_0x251b71=await readSqlLockFile(_0x49f1a7[_0x40b3d0(0x157)]),{appLock:_0x1949b2}=ensureSqlLockScope(_0x251b71??createEmptySqlLock(),_0x49f1a7[_0x40b3d0(0x159)],_0x49f1a7[_0x40b3d0(0x15b)],_0x40b3d0(0x14b)),_0x2c389a=await scanLocalSqlQueries(_0x49f1a7),_0x5b36e6=[],_0x293f71=[],_0x37f7a4=[],_0x57ef43=[],_0x511d64=new Set(_0x2c389a[_0x40b3d0(0x15d)](_0x5c009a=>_0x5c009a[_0x40b3d0(0x158)]));for(const _0x2053cd of _0x2c389a){const _0x8076b6=await computeSqlFileHash(_0x2053cd['filePath']),_0x4cc691=_0x1949b2[_0x40b3d0(0x154)][_0x2053cd[_0x40b3d0(0x158)]],_0x4935a4=!!_0x4cc691&&_0x4cc691[_0x40b3d0(0x142)]!==_0x2053cd['relativePath'],_0x4a0316=!!_0x4cc691&&!!_0x2053cd[_0x40b3d0(0x150)]&&_0x4cc691[_0x40b3d0(0x150)]!==_0x2053cd[_0x40b3d0(0x150)];if(!_0x4cc691)_0x5b36e6[_0x40b3d0(0x160)](_0x2053cd[_0x40b3d0(0x158)]);else _0x4cc691[_0x40b3d0(0x156)]!==_0x8076b6||_0x4935a4||_0x4a0316?_0x293f71[_0x40b3d0(0x160)](_0x2053cd['lockKey']):_0x37f7a4['push'](_0x2053cd['lockKey']);}for(const _0x4dbf65 of Object[_0x40b3d0(0x153)](_0x1949b2['sqls'])){!_0x511d64['has'](_0x4dbf65)&&_0x57ef43[_0x40b3d0(0x160)](_0x4dbf65);}const _0x568f18=[];if(_0x538d3d['bool'](_0x40b3d0(0x149))){const _0x2c0d42=await fetchAllSqlCodes(_0x538d3d['appCode']);for(const _0x1f73d2 of _0x2c0d42){!_0x511d64[_0x40b3d0(0x141)](_0x1f73d2)&&!_0x1949b2[_0x40b3d0(0x154)][_0x1f73d2]&&_0x568f18[_0x40b3d0(0x160)](_0x1f73d2);}}const _0x35df43=_0x5b36e6[_0x40b3d0(0x143)]===0x0&&_0x293f71[_0x40b3d0(0x143)]===0x0&&_0x57ef43[_0x40b3d0(0x143)]===0x0&&_0x568f18['length']===0x0;return{'ok':!![],'data':{'added':_0x5b36e6,'modified':_0x293f71,'missing':_0x57ef43,'unchanged':_0x37f7a4,'remoteOnly':_0x568f18},'message':_0x35df43?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x5b36e6['length']+_0x40b3d0(0x147)+_0x293f71[_0x40b3d0(0x143)]+'\x20modified,\x20'+_0x57ef43[_0x40b3d0(0x143)]+_0x40b3d0(0x14a)+_0x37f7a4['length']+_0x40b3d0(0x144)+(_0x568f18[_0x40b3d0(0x143)]>0x0?',\x20'+_0x568f18[_0x40b3d0(0x143)]+'\x20remote-only':'')};}};
1
+ const a180_0x1cb147=a180_0x3c63;(function(_0x2d113e,_0x4996ba){const _0x283400=a180_0x3c63,_0xcca602=_0x2d113e();while(!![]){try{const _0x2186ff=-parseInt(_0x283400(0x1a1))/0x1+parseInt(_0x283400(0x1a4))/0x2+-parseInt(_0x283400(0x1a6))/0x3+-parseInt(_0x283400(0x1b4))/0x4+-parseInt(_0x283400(0x1bb))/0x5+-parseInt(_0x283400(0x1a0))/0x6*(-parseInt(_0x283400(0x1b5))/0x7)+parseInt(_0x283400(0x1ac))/0x8;if(_0x2186ff===_0x4996ba)break;else _0xcca602['push'](_0xcca602['shift']());}catch(_0x198b51){_0xcca602['push'](_0xcca602['shift']());}}}(a180_0x2c67,0xd041e));import{listSqlQueries}from'../../core/api-client.js';function a180_0x2c67(){const _0xc3a499=['hash','bool','\x20remote-only','keys','All\x20SQL\x20queries\x20are\x20in\x20sync.','\x20modified,\x20','2110974qCdqcu','1083285OVlkMI','length','path','416334afkRfc','lockKey','2115363ZdjHRr','\x20unchanged','tableData','sqlName','sqlRoot','status','32280392rCzaIe','appCode','lockFilePath','push','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','relativePath','remote','has','4327892WMMNuN','7eIbGOQ','filePath','sql','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','boolean','\x20missing,\x20','4358220bVWuoe','map','read'];a180_0x2c67=function(){return _0xc3a499;};return a180_0x2c67();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a180_0x3c63(_0x25760f,_0x5a8c40){_0x25760f=_0x25760f-0x19b;const _0x2c671e=a180_0x2c67();let _0x3c63d2=_0x2c671e[_0x25760f];return _0x3c63d2;}async function fetchAllSqlCodes(_0x29d106){const _0x1219d7=a180_0x3c63,_0x202701=[];let _0x5a3a2e=0x1;while(!![]){const _0x27ac2d=await listSqlQueries(_0x29d106,{'currentPage':_0x5a3a2e,'pageSize':PAGE_SIZE}),_0x1b8bcb=_0x27ac2d[_0x1219d7(0x1a8)]??[];_0x202701[_0x1219d7(0x1af)](..._0x1b8bcb[_0x1219d7(0x1bc)](_0x943b53=>_0x943b53['sqlCode']));if(_0x1b8bcb[_0x1219d7(0x1a2)]===0x0)break;const _0x51a1db=_0x27ac2d['paging']?.['totalCount'];if(_0x51a1db!=null?_0x202701[_0x1219d7(0x1a2)]>=_0x51a1db:_0x1b8bcb[_0x1219d7(0x1a2)]<PAGE_SIZE)break;_0x5a3a2e++;}return _0x202701;}export const sqlStatus={'service':a180_0x1cb147(0x1b7),'command':a180_0x1cb147(0x1ab),'description':a180_0x1cb147(0x1b0),'risk':a180_0x1cb147(0x1bd),'flags':[{'name':a180_0x1cb147(0x1b2),'type':a180_0x1cb147(0x1b9),'description':a180_0x1cb147(0x1b8)}],async 'execute'(_0x31413c){const _0x17d3a2=a180_0x1cb147,_0xc3ba1c=loadSqlProjectConfig(_0x31413c['appCode']),_0x14d4bd=await readSqlLockFile(_0xc3ba1c[_0x17d3a2(0x1ae)]),{appLock:_0x1e8674}=ensureSqlLockScope(_0x14d4bd??createEmptySqlLock(),_0xc3ba1c[_0x17d3a2(0x1ad)],_0xc3ba1c[_0x17d3a2(0x1aa)],_0x17d3a2(0x1ab)),_0x366ef7=await scanLocalSqlQueries(_0xc3ba1c),_0x5c95d1=[],_0x17ad81=[],_0xfd577=[],_0x342c86=[],_0x129e4e=new Set(_0x366ef7[_0x17d3a2(0x1bc)](_0x525688=>_0x525688[_0x17d3a2(0x1a5)]));for(const _0x52dde7 of _0x366ef7){const _0x41b056=await computeSqlFileHash(_0x52dde7[_0x17d3a2(0x1b6)]),_0x3517b4=_0x1e8674['sqls'][_0x52dde7[_0x17d3a2(0x1a5)]],_0x3c3bb2=!!_0x3517b4&&_0x3517b4[_0x17d3a2(0x1a3)]!==_0x52dde7[_0x17d3a2(0x1b1)],_0x4f3ec3=!!_0x3517b4&&!!_0x52dde7[_0x17d3a2(0x1a9)]&&_0x3517b4[_0x17d3a2(0x1a9)]!==_0x52dde7[_0x17d3a2(0x1a9)];if(!_0x3517b4)_0x5c95d1[_0x17d3a2(0x1af)](_0x52dde7['lockKey']);else _0x3517b4[_0x17d3a2(0x1be)]!==_0x41b056||_0x3c3bb2||_0x4f3ec3?_0x17ad81[_0x17d3a2(0x1af)](_0x52dde7['lockKey']):_0xfd577[_0x17d3a2(0x1af)](_0x52dde7[_0x17d3a2(0x1a5)]);}for(const _0x5e50b2 of Object[_0x17d3a2(0x19d)](_0x1e8674['sqls'])){!_0x129e4e['has'](_0x5e50b2)&&_0x342c86[_0x17d3a2(0x1af)](_0x5e50b2);}const _0x3a51cf=[];if(_0x31413c[_0x17d3a2(0x19b)](_0x17d3a2(0x1b2))){const _0x39bb2e=await fetchAllSqlCodes(_0x31413c[_0x17d3a2(0x1ad)]);for(const _0x5bd99b of _0x39bb2e){!_0x129e4e[_0x17d3a2(0x1b3)](_0x5bd99b)&&!_0x1e8674['sqls'][_0x5bd99b]&&_0x3a51cf[_0x17d3a2(0x1af)](_0x5bd99b);}}const _0x5f3470=_0x5c95d1[_0x17d3a2(0x1a2)]===0x0&&_0x17ad81[_0x17d3a2(0x1a2)]===0x0&&_0x342c86[_0x17d3a2(0x1a2)]===0x0&&_0x3a51cf[_0x17d3a2(0x1a2)]===0x0;return{'ok':!![],'data':{'added':_0x5c95d1,'modified':_0x17ad81,'missing':_0x342c86,'unchanged':_0xfd577,'remoteOnly':_0x3a51cf},'message':_0x5f3470?_0x17d3a2(0x19e):_0x5c95d1[_0x17d3a2(0x1a2)]+'\x20added,\x20'+_0x17ad81[_0x17d3a2(0x1a2)]+_0x17d3a2(0x19f)+_0x342c86['length']+_0x17d3a2(0x1ba)+_0xfd577[_0x17d3a2(0x1a2)]+_0x17d3a2(0x1a7)+(_0x3a51cf[_0x17d3a2(0x1a2)]>0x0?',\x20'+_0x3a51cf[_0x17d3a2(0x1a2)]+_0x17d3a2(0x19c):'')};}};
@@ -1 +1 @@
1
- const a180_0x23fc54=a180_0x22c9;(function(_0x272e9a,_0x266b81){const _0x3cccc8=a180_0x22c9,_0xdedf65=_0x272e9a();while(!![]){try{const _0x3e4508=-parseInt(_0x3cccc8(0xfa))/0x1*(parseInt(_0x3cccc8(0x10e))/0x2)+parseInt(_0x3cccc8(0xfb))/0x3*(parseInt(_0x3cccc8(0xe3))/0x4)+-parseInt(_0x3cccc8(0x109))/0x5+parseInt(_0x3cccc8(0x116))/0x6+-parseInt(_0x3cccc8(0x114))/0x7*(parseInt(_0x3cccc8(0x102))/0x8)+-parseInt(_0x3cccc8(0x10a))/0x9+parseInt(_0x3cccc8(0x110))/0xa;if(_0x3e4508===_0x266b81)break;else _0xdedf65['push'](_0xdedf65['shift']());}catch(_0x1e4094){_0xdedf65['push'](_0xdedf65['shift']());}}}(a180_0x50f0,0x8ea06));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a180_0x22c9(_0x73c46c,_0x196319){_0x73c46c=_0x73c46c-0xe1;const _0x50f009=a180_0x50f0();let _0x22c9f0=_0x50f009[_0x73c46c];return _0x22c9f0;}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a180_0x23fc54(0x100),'command':a180_0x23fc54(0xe5),'description':a180_0x23fc54(0x11a),'risk':a180_0x23fc54(0x105),'flags':[{'name':'file','type':a180_0x23fc54(0x123),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':'sql','type':a180_0x23fc54(0x123),'description':a180_0x23fc54(0xff)},{'name':a180_0x23fc54(0xfc),'type':'string','description':a180_0x23fc54(0x112)},{'name':a180_0x23fc54(0xe6),'type':a180_0x23fc54(0xe1),'description':'Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata'}],async 'execute'(_0x20ba6c){const _0x4fe917=a180_0x23fc54,_0x42b1fb=_0x20ba6c[_0x4fe917(0x125)](_0x4fe917(0x11e)),_0x3c702d=_0x20ba6c['str'](_0x4fe917(0x100)),_0x4dfa56=_0x20ba6c[_0x4fe917(0x125)](_0x4fe917(0xfc)),_0x35512f=_0x20ba6c[_0x4fe917(0xee)]('check-indexes');if(!_0x42b1fb&&!_0x3c702d)throw CliErrors[_0x4fe917(0x122)]('file',_0x4fe917(0xeb));if(_0x35512f&&!_0x4dfa56)throw CliErrors[_0x4fe917(0xf2)](_0x4fe917(0xf4));let _0x3ca634;if(_0x42b1fb){const _0x58f19a=resolve(process[_0x4fe917(0xf7)](),_0x42b1fb);if(!existsSync(_0x58f19a))throw CliErrors[_0x4fe917(0xf2)](_0x4fe917(0x117)+_0x58f19a);_0x3ca634=readFileSync(_0x58f19a,_0x4fe917(0x121));}else _0x3ca634=_0x3c702d;const _0x5dce59=validateSql(_0x3ca634),_0x5e268d={'valid':_0x5dce59['valid'],'sqlType':_0x5dce59[_0x4fe917(0x104)][_0x4fe917(0x11f)],'isSelectOnly':_0x5dce59[_0x4fe917(0x104)]['isSelectOnly'],'isDangerous':_0x5dce59[_0x4fe917(0x104)][_0x4fe917(0x118)],'tables':_0x5dce59[_0x4fe917(0xe8)],'parameters':_0x5dce59[_0x4fe917(0x119)],'message':_0x5dce59[_0x4fe917(0x107)]};_0x5dce59[_0x4fe917(0x104)][_0x4fe917(0xe7)]&&(_0x5e268d['reason']=_0x5dce59[_0x4fe917(0x104)][_0x4fe917(0xe7)]);if(_0x4dfa56&&_0x5dce59[_0x4fe917(0xfd)]){const _0x46e4b9=_0x4dfa56[_0x4fe917(0xf1)](',')['map'](_0x58e67=>_0x58e67['trim']())[_0x4fe917(0xf8)](Boolean),_0x35375b=[],_0x1c48f1=[],_0x16e47a=filterDbTableBackedDatasets(await listDatasets(_0x20ba6c[_0x4fe917(0x11c)])),_0xf39ff1=new Map(_0x16e47a[_0x4fe917(0x106)](_0x35e51b=>[_0x35e51b[_0x4fe917(0xf5)]?.['tableName']?.[_0x4fe917(0x101)](),_0x35e51b]));for(const _0x8c767a of _0x5dce59['tables']){const _0x4b9556=_0xf39ff1[_0x4fe917(0x10c)](_0x8c767a[_0x4fe917(0x101)]());!_0x4b9556&&_0x35375b[_0x4fe917(0xf3)]('Table\x20\x22'+_0x8c767a+_0x4fe917(0xf0));}for(const _0x11c690 of _0x46e4b9){let _0x4dfbb6;try{_0x4dfbb6=await getDatasetDetail(_0x11c690);}catch{_0x35375b['push'](_0x4fe917(0x103)+_0x11c690+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0x4dfbb6,_0x4fe917(0x120));const _0x378b8d=Array[_0x4fe917(0xfe)](_0x4dfbb6[_0x4fe917(0xed)])?_0x4dfbb6[_0x4fe917(0xed)]:[],_0x1ac448=new Set(_0x378b8d[_0x4fe917(0x106)](_0x4572be=>_0x4572be[_0x4fe917(0x10f)]?.[_0x4fe917(0x101)]())),_0x79e9c=_0x4dfbb6[_0x4fe917(0xf5)]?.[_0x4fe917(0x115)]||_0x4dfbb6[_0x4fe917(0x115)]||_0x11c690;_0x5e268d['schema:'+_0x79e9c]={'code':_0x11c690,'tableName':_0x79e9c,'fieldCount':_0x1ac448[_0x4fe917(0xe2)],'fields':Array[_0x4fe917(0xe9)](_0x1ac448)};if(_0x35512f){const _0x64b384=normalizeDatasetIndexes(_0x4dfbb6);_0x1c48f1['push']({'tableName':_0x79e9c,..._0x64b384});}}_0x35375b[_0x4fe917(0xef)]>0x0&&(_0x5e268d['schemaWarnings']=_0x35375b),_0x35512f&&(_0x5e268d[_0x4fe917(0xec)]=auditSqlJoinIndexes(_0x3ca634,_0x1c48f1));}return{'ok':_0x5dce59[_0x4fe917(0xfd)],'data':_0x5e268d,'message':_0x5dce59['message']};}};function a180_0x50f0(){const _0x36c499=['file','type','SQL\x20schema\x20validation','utf-8','flagMissing','string','trim','str','find','boolean','size','20316hnieaQ','primary','validate','check-indexes','reason','tables','from','indexes','Provide\x20--file\x20or\x20--sql','joinAudit','fields','bool','length','\x22\x20not\x20found\x20in\x20any\x20dataset','split','validation','push','--check-indexes\x20requires\x20--schemas.','dbtableConfig','index_columns','cwd','filter','dataset','222886eiZWAX','669CEEODt','schemas','valid','isArray','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','sql','toLowerCase','139976gAlFWs','Dataset\x20\x22','sqlType','read','map','message','flatMap','977770pNREGL','10233414UkGUFM','columnNames','get','columns','2uVmFQd','name','9988930IZgZPd','index_type','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','pkField','168qjncXq','tableName','2568612MOIAGF','File\x20not\x20found:\x20','isDangerous','parameters','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','index_name','appCode','indexName'];a180_0x50f0=function(){return _0x36c499;};return a180_0x50f0();}function normalizeDatasetIndexes(_0x26877d){const _0xdc29b3=a180_0x23fc54,_0x42e24c=Array[_0xdc29b3(0xfe)](_0x26877d?.[_0xdc29b3(0xf9)]?.[_0xdc29b3(0xea)])?_0x26877d[_0xdc29b3(0xf9)][_0xdc29b3(0xea)]:Array[_0xdc29b3(0xfe)](_0x26877d?.[_0xdc29b3(0xea)])?_0x26877d['indexes']:[],_0x19d5eb=_0x42e24c[_0xdc29b3(0x108)](_0x1a745c=>{const _0x406432=_0xdc29b3,_0x8416f8=Array['isArray'](_0x1a745c?.[_0x406432(0xf6)])?_0x1a745c[_0x406432(0xf6)]:Array[_0x406432(0xfe)](_0x1a745c?.[_0x406432(0x10b)])?_0x1a745c[_0x406432(0x10b)]:Array[_0x406432(0xfe)](_0x1a745c?.[_0x406432(0x10d)])?_0x1a745c[_0x406432(0x10d)]:[],_0x36395d=_0x8416f8[_0x406432(0xf8)](_0x551f4c=>typeof _0x551f4c===_0x406432(0x123))['map'](_0x1c661d=>_0x1c661d[_0x406432(0x124)]())[_0x406432(0xf8)](Boolean);if(_0x36395d[_0x406432(0xef)]===0x0)return[];const _0x15a6e3=[_0x1a745c?.[_0x406432(0x11d)],_0x1a745c?.[_0x406432(0x11b)],_0x1a745c?.[_0x406432(0x10f)]][_0x406432(0x126)](_0x5caed6=>typeof _0x5caed6===_0x406432(0x123)&&_0x5caed6[_0x406432(0x124)]()),_0x245936=[_0x1a745c?.[_0x406432(0x111)],_0x1a745c?.[_0x406432(0x11f)]][_0x406432(0x126)](_0xfe275b=>typeof _0xfe275b==='string'&&_0xfe275b[_0x406432(0x124)]());return[{..._0x15a6e3?{'name':_0x15a6e3[_0x406432(0x124)]()}:{},..._0x245936?{'type':_0x245936[_0x406432(0x124)]()}:{},'columns':_0x36395d}];}),_0x2412ce=[..._0x19d5eb],_0x204f5e=typeof _0x26877d?.[_0xdc29b3(0xf5)]?.[_0xdc29b3(0x113)]===_0xdc29b3(0x123)?_0x26877d['dbtableConfig'][_0xdc29b3(0x113)][_0xdc29b3(0xf1)](',')['map'](_0x4e5e49=>_0x4e5e49['trim']())[_0xdc29b3(0xf8)](Boolean):[];return _0x204f5e[_0xdc29b3(0xef)]>0x0&&_0x2412ce['unshift']({'type':_0xdc29b3(0xe4),'columns':_0x204f5e}),{'indexes':_0x2412ce,'metadataAvailable':_0x19d5eb[_0xdc29b3(0xef)]>0x0};}
1
+ const a181_0x309f13=a181_0x4ec5;(function(_0x3d32ea,_0x1a28c5){const _0x4d1281=a181_0x4ec5,_0x8ae6bf=_0x3d32ea();while(!![]){try{const _0x4c0beb=parseInt(_0x4d1281(0x178))/0x1*(parseInt(_0x4d1281(0x154))/0x2)+parseInt(_0x4d1281(0x175))/0x3*(parseInt(_0x4d1281(0x139))/0x4)+parseInt(_0x4d1281(0x174))/0x5+-parseInt(_0x4d1281(0x146))/0x6+parseInt(_0x4d1281(0x161))/0x7+parseInt(_0x4d1281(0x165))/0x8*(parseInt(_0x4d1281(0x172))/0x9)+-parseInt(_0x4d1281(0x149))/0xa*(parseInt(_0x4d1281(0x151))/0xb);if(_0x4c0beb===_0x1a28c5)break;else _0x8ae6bf['push'](_0x8ae6bf['shift']());}catch(_0x62ed9a){_0x8ae6bf['push'](_0x8ae6bf['shift']());}}}(a181_0x5292,0x85269));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.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':a181_0x309f13(0x147),'command':'validate','description':a181_0x309f13(0x16c),'risk':'read','flags':[{'name':a181_0x309f13(0x145),'type':'string','description':a181_0x309f13(0x143)},{'name':'sql','type':a181_0x309f13(0x152),'description':a181_0x309f13(0x148)},{'name':a181_0x309f13(0x16d),'type':a181_0x309f13(0x152),'description':a181_0x309f13(0x16f)},{'name':a181_0x309f13(0x16e),'type':a181_0x309f13(0x169),'description':a181_0x309f13(0x137)}],async 'execute'(_0x5d4373){const _0x49f3fc=a181_0x309f13,_0x35b581=_0x5d4373[_0x49f3fc(0x166)](_0x49f3fc(0x145)),_0x53102d=_0x5d4373[_0x49f3fc(0x166)](_0x49f3fc(0x147)),_0x241858=_0x5d4373[_0x49f3fc(0x166)](_0x49f3fc(0x16d)),_0x15e759=_0x5d4373['bool']('check-indexes');if(!_0x35b581&&!_0x53102d)throw CliErrors[_0x49f3fc(0x15d)](_0x49f3fc(0x145),_0x49f3fc(0x142));if(_0x15e759&&!_0x241858)throw CliErrors['validation'](_0x49f3fc(0x14f));let _0x17074c;if(_0x35b581){const _0x2c7053=resolve(process[_0x49f3fc(0x13b)](),_0x35b581);if(!existsSync(_0x2c7053))throw CliErrors[_0x49f3fc(0x14b)](_0x49f3fc(0x17a)+_0x2c7053);_0x17074c=readFileSync(_0x2c7053,_0x49f3fc(0x16b));}else _0x17074c=_0x53102d;const _0x40fc02=validateSql(_0x17074c),_0x4b1e84={'valid':_0x40fc02['valid'],'sqlType':_0x40fc02['sqlType'][_0x49f3fc(0x144)],'isSelectOnly':_0x40fc02['sqlType'][_0x49f3fc(0x173)],'isDangerous':_0x40fc02[_0x49f3fc(0x15e)][_0x49f3fc(0x160)],'tables':_0x40fc02[_0x49f3fc(0x136)],'parameters':_0x40fc02[_0x49f3fc(0x164)],'message':_0x40fc02['message']};_0x40fc02[_0x49f3fc(0x15e)][_0x49f3fc(0x168)]&&(_0x4b1e84[_0x49f3fc(0x168)]=_0x40fc02[_0x49f3fc(0x15e)]['reason']);if(_0x241858&&_0x40fc02[_0x49f3fc(0x159)]){const _0x525922=_0x241858['split'](',')[_0x49f3fc(0x138)](_0x7735a7=>_0x7735a7[_0x49f3fc(0x14e)]())[_0x49f3fc(0x171)](Boolean),_0x3a4dc3=[],_0x4c5a7a=[],_0x4ebd27=filterDbTableBackedDatasets(await listDatasets(_0x5d4373[_0x49f3fc(0x14c)])),_0x396f38=new Map(_0x4ebd27[_0x49f3fc(0x138)](_0x3f0f78=>[_0x3f0f78[_0x49f3fc(0x153)]?.[_0x49f3fc(0x14a)]?.[_0x49f3fc(0x13f)](),_0x3f0f78]));for(const _0xc5b56d of _0x40fc02['tables']){const _0x105222=_0x396f38[_0x49f3fc(0x13d)](_0xc5b56d['toLowerCase']());!_0x105222&&_0x3a4dc3[_0x49f3fc(0x170)](_0x49f3fc(0x14d)+_0xc5b56d+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x2072de of _0x525922){let _0x2b6e3f;try{_0x2b6e3f=await getDatasetDetail(_0x2072de);}catch{_0x3a4dc3['push'](_0x49f3fc(0x17b)+_0x2072de+_0x49f3fc(0x155));continue;}assertDatasetIsDbTableBacked(_0x2b6e3f,_0x49f3fc(0x176));const _0x519d19=Array[_0x49f3fc(0x167)](_0x2b6e3f[_0x49f3fc(0x157)])?_0x2b6e3f[_0x49f3fc(0x157)]:[],_0xb1eb05=new Set(_0x519d19['map'](_0x49aa22=>_0x49aa22[_0x49f3fc(0x15c)]?.[_0x49f3fc(0x13f)]())),_0x12c3e9=_0x2b6e3f['dbtableConfig']?.['tableName']||_0x2b6e3f[_0x49f3fc(0x14a)]||_0x2072de;_0x4b1e84[_0x49f3fc(0x13c)+_0x12c3e9]={'code':_0x2072de,'tableName':_0x12c3e9,'fieldCount':_0xb1eb05[_0x49f3fc(0x156)],'fields':Array['from'](_0xb1eb05)};if(_0x15e759){const _0x2ff6ab=normalizeDatasetIndexes(_0x2b6e3f);_0x4c5a7a[_0x49f3fc(0x170)]({'tableName':_0x12c3e9,..._0x2ff6ab});}}_0x3a4dc3[_0x49f3fc(0x15b)]>0x0&&(_0x4b1e84[_0x49f3fc(0x163)]=_0x3a4dc3),_0x15e759&&(_0x4b1e84[_0x49f3fc(0x16a)]=auditSqlJoinIndexes(_0x17074c,_0x4c5a7a));}return{'ok':_0x40fc02['valid'],'data':_0x4b1e84,'message':_0x40fc02['message']};}};function a181_0x4ec5(_0x4893a9,_0x2d10e4){_0x4893a9=_0x4893a9-0x136;const _0x529241=a181_0x5292();let _0x4ec5a4=_0x529241[_0x4893a9];return _0x4ec5a4;}function a181_0x5292(){const _0x20faa2=['get','index_name','toLowerCase','unshift','flatMap','Provide\x20--file\x20or\x20--sql','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','type','file','6003096vtOqVc','sql','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','3645490xYxGmy','tableName','validation','appCode','Table\x20\x22','trim','--check-indexes\x20requires\x20--schemas.','index_columns','55rdmByD','string','dbtableConfig','10tLIRRR','\x22\x20not\x20found\x20or\x20not\x20accessible','size','fields','columns','valid','indexName','length','name','flagMissing','sqlType','pkField','isDangerous','6641355fhZLJv','columnNames','schemaWarnings','parameters','1032GzPyVz','str','isArray','reason','boolean','joinAudit','utf-8','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','schemas','check-indexes','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','push','filter','26379DiIwpR','isSelectOnly','3322770bwlSAp','407082ulGQxa','SQL\x20schema\x20validation','dataset','85474SHeRhB','find','File\x20not\x20found:\x20','Dataset\x20\x22','tables','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','map','28saorUR','indexes','cwd','schema:'];a181_0x5292=function(){return _0x20faa2;};return a181_0x5292();}function normalizeDatasetIndexes(_0x5a0173){const _0x5b1a10=a181_0x309f13,_0x3472ea=Array['isArray'](_0x5a0173?.[_0x5b1a10(0x177)]?.['indexes'])?_0x5a0173[_0x5b1a10(0x177)][_0x5b1a10(0x13a)]:Array['isArray'](_0x5a0173?.[_0x5b1a10(0x13a)])?_0x5a0173[_0x5b1a10(0x13a)]:[],_0x3de94a=_0x3472ea[_0x5b1a10(0x141)](_0x26c253=>{const _0xf6dbc3=_0x5b1a10,_0x5b4877=Array[_0xf6dbc3(0x167)](_0x26c253?.[_0xf6dbc3(0x150)])?_0x26c253[_0xf6dbc3(0x150)]:Array[_0xf6dbc3(0x167)](_0x26c253?.[_0xf6dbc3(0x162)])?_0x26c253[_0xf6dbc3(0x162)]:Array[_0xf6dbc3(0x167)](_0x26c253?.[_0xf6dbc3(0x158)])?_0x26c253[_0xf6dbc3(0x158)]:[],_0x2ed0c9=_0x5b4877['filter'](_0x3d2f36=>typeof _0x3d2f36===_0xf6dbc3(0x152))[_0xf6dbc3(0x138)](_0x1c3602=>_0x1c3602[_0xf6dbc3(0x14e)]())[_0xf6dbc3(0x171)](Boolean);if(_0x2ed0c9[_0xf6dbc3(0x15b)]===0x0)return[];const _0x321ac6=[_0x26c253?.[_0xf6dbc3(0x15a)],_0x26c253?.[_0xf6dbc3(0x13e)],_0x26c253?.[_0xf6dbc3(0x15c)]][_0xf6dbc3(0x179)](_0x4d85d6=>typeof _0x4d85d6===_0xf6dbc3(0x152)&&_0x4d85d6[_0xf6dbc3(0x14e)]()),_0x4f8edb=[_0x26c253?.['index_type'],_0x26c253?.['type']][_0xf6dbc3(0x179)](_0x50a5d1=>typeof _0x50a5d1===_0xf6dbc3(0x152)&&_0x50a5d1[_0xf6dbc3(0x14e)]());return[{..._0x321ac6?{'name':_0x321ac6[_0xf6dbc3(0x14e)]()}:{},..._0x4f8edb?{'type':_0x4f8edb[_0xf6dbc3(0x14e)]()}:{},'columns':_0x2ed0c9}];}),_0xcd5a49=[..._0x3de94a],_0x4c262f=typeof _0x5a0173?.['dbtableConfig']?.[_0x5b1a10(0x15f)]===_0x5b1a10(0x152)?_0x5a0173[_0x5b1a10(0x153)]['pkField']['split'](',')['map'](_0x5cc6b4=>_0x5cc6b4[_0x5b1a10(0x14e)]())[_0x5b1a10(0x171)](Boolean):[];return _0x4c262f[_0x5b1a10(0x15b)]>0x0&&_0xcd5a49[_0x5b1a10(0x140)]({'type':'primary','columns':_0x4c262f}),{'indexes':_0xcd5a49,'metadataAvailable':_0x3de94a['length']>0x0};}
@@ -1 +1 @@
1
- (function(_0x15ed5a,_0x505844){const _0x9d5968=a181_0x30d2,_0x5c1a75=_0x15ed5a();while(!![]){try{const _0x17bc77=parseInt(_0x9d5968(0xa1))/0x1*(-parseInt(_0x9d5968(0xa4))/0x2)+parseInt(_0x9d5968(0xa5))/0x3+parseInt(_0x9d5968(0xa8))/0x4*(-parseInt(_0x9d5968(0xa2))/0x5)+-parseInt(_0x9d5968(0xa3))/0x6*(-parseInt(_0x9d5968(0xa6))/0x7)+parseInt(_0x9d5968(0xa7))/0x8+parseInt(_0x9d5968(0xa0))/0x9*(-parseInt(_0x9d5968(0xa9))/0xa)+-parseInt(_0x9d5968(0xaa))/0xb*(-parseInt(_0x9d5968(0x9f))/0xc);if(_0x17bc77===_0x505844)break;else _0x5c1a75['push'](_0x5c1a75['shift']());}catch(_0x4e8922){_0x5c1a75['push'](_0x5c1a75['shift']());}}}(a181_0xb949,0xbf9d3));import{taskStatus}from'../../commands/task/status.js';function a181_0xb949(){const _0x39b202=['6355zGXpyF','176880uukhfg','1021070NPqAgJ','1216338zuxwOt','140AbxIyq','6490400jKPbcb','4404fibjmg','3099160HVINxe','22QjIKum','12112668DXlDGM','18cCHXdI','2QrGXNE'];a181_0xb949=function(){return _0x39b202;};return a181_0xb949();}function a181_0x30d2(_0x461aa4,_0x24ed24){_0x461aa4=_0x461aa4-0x9f;const _0xb9499f=a181_0xb949();let _0x30d284=_0xb9499f[_0x461aa4];return _0x30d284;}export const taskDefinitions=[taskStatus];
1
+ (function(_0x5a2d2b,_0x2cbe36){const _0x92b84c=a182_0x3491,_0x47a5d8=_0x5a2d2b();while(!![]){try{const _0x3ce3b=parseInt(_0x92b84c(0x1dc))/0x1*(parseInt(_0x92b84c(0x1e0))/0x2)+-parseInt(_0x92b84c(0x1e2))/0x3*(parseInt(_0x92b84c(0x1e3))/0x4)+-parseInt(_0x92b84c(0x1d9))/0x5*(parseInt(_0x92b84c(0x1da))/0x6)+parseInt(_0x92b84c(0x1db))/0x7*(-parseInt(_0x92b84c(0x1e5))/0x8)+-parseInt(_0x92b84c(0x1dd))/0x9*(parseInt(_0x92b84c(0x1e6))/0xa)+-parseInt(_0x92b84c(0x1de))/0xb*(-parseInt(_0x92b84c(0x1e4))/0xc)+-parseInt(_0x92b84c(0x1df))/0xd*(-parseInt(_0x92b84c(0x1e1))/0xe);if(_0x3ce3b===_0x2cbe36)break;else _0x47a5d8['push'](_0x47a5d8['shift']());}catch(_0x2fa868){_0x47a5d8['push'](_0x47a5d8['shift']());}}}(a182_0x2692,0x91fe9));function a182_0x3491(_0x5cd4ea,_0x5caeff){_0x5cd4ea=_0x5cd4ea-0x1d9;const _0x269203=a182_0x2692();let _0x3491ca=_0x269203[_0x5cd4ea];return _0x3491ca;}import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];function a182_0x2692(){const _0x3e4f57=['7OQHNQM','17oihIHE','9utmYKD','110lnIQQd','2193061WmcAUh','84174nPQUcu','252cjEgoT','2793954bKdgaL','4MwrMWJ','108672YySvPY','8346328WpttoU','8883670IlLgbO','230dvfDTK','49776LpZkTF'];a182_0x2692=function(){return _0x3e4f57;};return a182_0x2692();}
@@ -1 +1 @@
1
- const a182_0x3e1938=a182_0x3510;(function(_0xdd2f65,_0x3dc77e){const _0x5a4264=a182_0x3510,_0x1082ba=_0xdd2f65();while(!![]){try{const _0x4a4421=-parseInt(_0x5a4264(0x86))/0x1*(parseInt(_0x5a4264(0x90))/0x2)+parseInt(_0x5a4264(0x8c))/0x3*(-parseInt(_0x5a4264(0x89))/0x4)+parseInt(_0x5a4264(0x8b))/0x5+-parseInt(_0x5a4264(0x8f))/0x6+-parseInt(_0x5a4264(0x82))/0x7*(parseInt(_0x5a4264(0x8a))/0x8)+-parseInt(_0x5a4264(0x81))/0x9*(-parseInt(_0x5a4264(0x85))/0xa)+parseInt(_0x5a4264(0x96))/0xb;if(_0x4a4421===_0x3dc77e)break;else _0x1082ba['push'](_0x1082ba['shift']());}catch(_0x1cb138){_0x1082ba['push'](_0x1082ba['shift']());}}}(a182_0x2ec3,0xef265));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a182_0x2ec3(){const _0x58d23c=['6222152fwGuSG','88RFSolg','1624590sFEMJi','3qgttbx',',\x20received\x20','flagMissing','4114302KDXmzN','2QJEMaU','compress','task','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','task-id','string','35195171NLJujQ','isTerminal','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','cookie','str','4642047fStUdc','366583HbrKjc','taskId','appCode','10qgFLGS','243391FcNoxP','status','read'];a182_0x2ec3=function(){return _0x58d23c;};return a182_0x2ec3();}import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a182_0x3510(_0xe5ace4,_0x338ae1){_0xe5ace4=_0xe5ace4-0x7f;const _0x2ec3b7=a182_0x2ec3();let _0x351010=_0x2ec3b7[_0xe5ace4];return _0x351010;}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':a182_0x3e1938(0x92),'command':a182_0x3e1938(0x87),'description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':a182_0x3e1938(0x88),'defaultOutputFormat':a182_0x3e1938(0x91),'structuredErrors':!![],'flags':[{'name':'task-id','type':a182_0x3e1938(0x95),'required':!![],'description':a182_0x3e1938(0x98)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2daf40){const _0x53caa6=a182_0x3e1938;if(!_0x2daf40[_0x53caa6(0x80)](_0x53caa6(0x94))['trim']())throw CliErrors[_0x53caa6(0x8e)](_0x53caa6(0x94));},async 'execute'(_0x30c4f2){const _0x3f6d93=a182_0x3e1938,_0x268351=_0x30c4f2[_0x3f6d93(0x80)](_0x3f6d93(0x94))['trim'](),_0x264cf5=normalizeAsyncTask(await getAsyncTaskStatus(_0x268351,_0x30c4f2[_0x3f6d93(0x84)],_0x30c4f2[_0x3f6d93(0x7f)]));if(_0x264cf5[_0x3f6d93(0x83)]!==_0x268351)throw CliErrors['apiError'](_0x3f6d93(0x93)+_0x268351+_0x3f6d93(0x8d)+_0x264cf5[_0x3f6d93(0x83)]+'.');const _0x1d4301=buildAsyncTaskStatusCommand(_0x264cf5[_0x3f6d93(0x83)],_0x30c4f2[_0x3f6d93(0x84)]);return{'ok':!![],'message':asyncTaskMessage(_0x264cf5),'data':{'appCode':_0x30c4f2[_0x3f6d93(0x84)],..._0x264cf5,'query':_0x264cf5[_0x3f6d93(0x97)]?null:{'command':_0x1d4301}}};}};
1
+ const a183_0x443961=a183_0xb92f;(function(_0x476b05,_0x55a604){const _0x44ec2a=a183_0xb92f,_0x91a233=_0x476b05();while(!![]){try{const _0xee52ff=parseInt(_0x44ec2a(0x17f))/0x1*(parseInt(_0x44ec2a(0x177))/0x2)+-parseInt(_0x44ec2a(0x176))/0x3+parseInt(_0x44ec2a(0x16c))/0x4+-parseInt(_0x44ec2a(0x17b))/0x5*(parseInt(_0x44ec2a(0x169))/0x6)+-parseInt(_0x44ec2a(0x17c))/0x7+parseInt(_0x44ec2a(0x17a))/0x8+parseInt(_0x44ec2a(0x16d))/0x9*(parseInt(_0x44ec2a(0x17d))/0xa);if(_0xee52ff===_0x55a604)break;else _0x91a233['push'](_0x91a233['shift']());}catch(_0x29895e){_0x91a233['push'](_0x91a233['shift']());}}}(a183_0x2b96,0x72293));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a183_0x2b96(){const _0x129451=['read','task',',\x20received\x20','appCode','trim','str','task-id','1844067zrNaXG','86hkmjdc','cookie','flagMissing','1982504YELdEA','5WbrICn','2776305KdGrAO','150mzjbIX','compress','10942PdChAh','status','string','apiError','taskId','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','3734202JUmRoD','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','isTerminal','1127160ZRSYLp','660699KVZLxX','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command'];a183_0x2b96=function(){return _0x129451;};return a183_0x2b96();}function a183_0xb92f(_0x287b18,_0x4dd519){_0x287b18=_0x287b18-0x169;const _0x2b96de=a183_0x2b96();let _0xb92f27=_0x2b96de[_0x287b18];return _0xb92f27;}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':a183_0x443961(0x170),'command':a183_0x443961(0x180),'description':a183_0x443961(0x184),'risk':a183_0x443961(0x16f),'defaultOutputFormat':a183_0x443961(0x17e),'structuredErrors':!![],'flags':[{'name':a183_0x443961(0x175),'type':a183_0x443961(0x181),'required':!![],'description':a183_0x443961(0x16e)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x21c0c6){const _0x4a6c12=a183_0x443961;if(!_0x21c0c6[_0x4a6c12(0x174)](_0x4a6c12(0x175))[_0x4a6c12(0x173)]())throw CliErrors[_0x4a6c12(0x179)](_0x4a6c12(0x175));},async 'execute'(_0x3270f4){const _0x375c4a=a183_0x443961,_0x5a0cc6=_0x3270f4[_0x375c4a(0x174)]('task-id')[_0x375c4a(0x173)](),_0x4c03cc=normalizeAsyncTask(await getAsyncTaskStatus(_0x5a0cc6,_0x3270f4['appCode'],_0x3270f4[_0x375c4a(0x178)]));if(_0x4c03cc[_0x375c4a(0x183)]!==_0x5a0cc6)throw CliErrors[_0x375c4a(0x182)](_0x375c4a(0x16a)+_0x5a0cc6+_0x375c4a(0x171)+_0x4c03cc[_0x375c4a(0x183)]+'.');const _0x8b0246=buildAsyncTaskStatusCommand(_0x4c03cc[_0x375c4a(0x183)],_0x3270f4[_0x375c4a(0x172)]);return{'ok':!![],'message':asyncTaskMessage(_0x4c03cc),'data':{'appCode':_0x3270f4['appCode'],..._0x4c03cc,'query':_0x4c03cc[_0x375c4a(0x16b)]?null:{'command':_0x8b0246}}};}};
@@ -1 +1 @@
1
- const a183_0x1dc2fa=a183_0x4df3;(function(_0x4bc582,_0xfc296f){const _0x385123=a183_0x4df3,_0x14b4ab=_0x4bc582();while(!![]){try{const _0x496859=-parseInt(_0x385123(0x156))/0x1+-parseInt(_0x385123(0x14c))/0x2+-parseInt(_0x385123(0x157))/0x3+parseInt(_0x385123(0x153))/0x4*(parseInt(_0x385123(0x14b))/0x5)+-parseInt(_0x385123(0x155))/0x6*(parseInt(_0x385123(0x150))/0x7)+-parseInt(_0x385123(0x152))/0x8+-parseInt(_0x385123(0x14d))/0x9*(-parseInt(_0x385123(0x14f))/0xa);if(_0x496859===_0xfc296f)break;else _0x14b4ab['push'](_0x14b4ab['shift']());}catch(_0x56862e){_0x14b4ab['push'](_0x14b4ab['shift']());}}}(a183_0x1227,0x2c89c));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a183_0x4df3(_0x4f8dee,_0x553e09){_0x4f8dee=_0x4f8dee-0x14a;const _0x122703=a183_0x1227();let _0x4df31f=_0x122703[_0x4f8dee];return _0x4df31f;}export const workspaceAddDefinition={'service':a183_0x1dc2fa(0x158),'command':a183_0x1dc2fa(0x151),'description':a183_0x1dc2fa(0x154),'risk':a183_0x1dc2fa(0x159),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a183_0x1dc2fa(0x14a),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x125f61=>validateAppName(_0x125f61,a183_0x1dc2fa(0x14e)),'execute':_0x5a146f=>runAppAdd(_0x5a146f,a183_0x1dc2fa(0x14e))};function a183_0x1227(){const _0x28e9bc=['App\x20profile\x20name','1495sQrMLT','589416UANcfp','450ArwXRv','workspace\x20add','131430RLYmOx','21vbjEWd','add','6120ULLwnh','1348RERYpe','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','73266JyaOsG','84043Qzmbzc','478008QAHFOW','workspace','write'];a183_0x1227=function(){return _0x28e9bc;};return a183_0x1227();}
1
+ const a184_0x344f5d=a184_0x2f9b;function a184_0x2f9b(_0x3be3dc,_0x54ebf2){_0x3be3dc=_0x3be3dc-0x89;const _0x5881b0=a184_0x5881();let _0x2f9b66=_0x5881b0[_0x3be3dc];return _0x2f9b66;}function a184_0x5881(){const _0x498e15=['add','workspace\x20add','91WblLbS','395JJwrHs','1FwAYUq','518510goxiIz','292dmSZgd','9TvarOn','1189226gniSmr','7601664eqArmw','6383223ohJmUf','32646CyIOkh','5733EwUVhP','write','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','12632QOsvfk'];a184_0x5881=function(){return _0x498e15;};return a184_0x5881();}(function(_0x37fc3f,_0x1634fb){const _0x2ad3aa=a184_0x2f9b,_0x2b29fa=_0x37fc3f();while(!![]){try{const _0xb690bb=-parseInt(_0x2ad3aa(0x98))/0x1*(-parseInt(_0x2ad3aa(0x8c))/0x2)+-parseInt(_0x2ad3aa(0x90))/0x3*(-parseInt(_0x2ad3aa(0x8a))/0x4)+parseInt(_0x2ad3aa(0x97))/0x5*(-parseInt(_0x2ad3aa(0x8f))/0x6)+-parseInt(_0x2ad3aa(0x96))/0x7*(-parseInt(_0x2ad3aa(0x93))/0x8)+parseInt(_0x2ad3aa(0x8b))/0x9*(parseInt(_0x2ad3aa(0x89))/0xa)+parseInt(_0x2ad3aa(0x8e))/0xb+-parseInt(_0x2ad3aa(0x8d))/0xc;if(_0xb690bb===_0x1634fb)break;else _0x2b29fa['push'](_0x2b29fa['shift']());}catch(_0x170f4a){_0x2b29fa['push'](_0x2b29fa['shift']());}}}(a184_0x5881,0x4ef94));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':'workspace','command':a184_0x344f5d(0x94),'description':a184_0x344f5d(0x92),'risk':a184_0x344f5d(0x91),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':'App\x20profile\x20name','required':!![]}],'flags':buildAppAddFlags(),'validate':_0x110488=>validateAppName(_0x110488,a184_0x344f5d(0x95)),'execute':_0x1124fd=>runAppAdd(_0x1124fd,'workspace\x20add')};
@@ -1 +1 @@
1
- const a184_0x51823d=a184_0x251b;(function(_0x16a6ad,_0x555fe7){const _0x5879f1=a184_0x251b,_0x338491=_0x16a6ad();while(!![]){try{const _0x199c1c=-parseInt(_0x5879f1(0xc4))/0x1*(parseInt(_0x5879f1(0xcd))/0x2)+-parseInt(_0x5879f1(0xc2))/0x3*(parseInt(_0x5879f1(0xd9))/0x4)+-parseInt(_0x5879f1(0xf3))/0x5+-parseInt(_0x5879f1(0xd7))/0x6*(-parseInt(_0x5879f1(0xd6))/0x7)+parseInt(_0x5879f1(0xe4))/0x8*(parseInt(_0x5879f1(0xda))/0x9)+parseInt(_0x5879f1(0xe1))/0xa+parseInt(_0x5879f1(0xe9))/0xb*(parseInt(_0x5879f1(0xdc))/0xc);if(_0x199c1c===_0x555fe7)break;else _0x338491['push'](_0x338491['shift']());}catch(_0x34bfd5){_0x338491['push'](_0x338491['shift']());}}}(a184_0x2f86,0x4f526));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';function a184_0x2f86(){const _0x21332f=['pageSize','riskLevel','12752mdMjec','App\x20\x22','workspace','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','defaultApp','66VYkdVD','env','locale','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','\x20workspace\x20use\x20--app\x20<name>`.','flag','appcode','.\x20Credentials:\x20not\x20written.','write','\x22\x20not\x20found.','1467070XoyIBv','str','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','format','join','string','Target\x20environment','apps','48FGqyZt','validation','6wGemFA','Use\x20`','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','use','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','app','\x20(appcode:\x20','workspace.','isArray','90450dIjReD','length','Missing\x20workspace\x20app\x20selector.','\x20--appcode\x20<code>`.','keys',').\x20Config:\x20','init','number','object','229901wxfSmg','24lEFFZI','\x20workspace\x20','59704AJyUxQ','3474hujzAT','Locale\x20for\x20this\x20workspace\x20app\x20profile','46908CNmhma','trim','\x20--app\x20','defaultFormat','Workspace\x20','3583720ziPaUS'];a184_0x2f86=function(){return _0x21332f;};return a184_0x2f86();}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+a184_0x51823d(0xe7),SAFE_PROFILE_KEYS=[a184_0x51823d(0xef),a184_0x51823d(0xea),'apiDir',a184_0x51823d(0xf7),a184_0x51823d(0xe2),a184_0x51823d(0xe3),a184_0x51823d(0xeb)],workspaceFlags=[{'name':a184_0x51823d(0xc9),'type':'string','description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':a184_0x51823d(0xef),'type':'string','description':a184_0x51823d(0xf5)},{'name':a184_0x51823d(0xea),'type':a184_0x51823d(0xbf),'description':a184_0x51823d(0xc0),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':'string','description':a184_0x51823d(0xc8)},{'name':'defaultFormat','type':a184_0x51823d(0xbf),'description':'Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a184_0x51823d(0xe2),'type':a184_0x51823d(0xd4),'description':a184_0x51823d(0xf6)},{'name':a184_0x51823d(0xe3),'type':a184_0x51823d(0xbf),'description':'Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RISK_LEVEL_VALUES]},{'name':a184_0x51823d(0xeb),'type':a184_0x51823d(0xbf),'description':a184_0x51823d(0xdb)}];function isRecord(_0x2ccbe4){const _0x4cf789=a184_0x51823d;return!!_0x2ccbe4&&typeof _0x2ccbe4===_0x4cf789(0xd5)&&!Array[_0x4cf789(0xcc)](_0x2ccbe4);}function assertValidAppcode(_0x27f76a){const _0x5a90bf=a184_0x51823d,{valid:_0x172aaf,message:_0x5890}=validateAppcode(_0x27f76a);if(!_0x172aaf)throw CliErrors[_0x5a90bf(0xc3)]('Invalid\x20appcode:\x20'+_0x27f76a,_0x5890);}function sanitizeProfile(_0x35d5a2){if(!isRecord(_0x35d5a2))return{};const _0x212981={};for(const _0x4fc9a6 of SAFE_PROFILE_KEYS){if(_0x35d5a2[_0x4fc9a6]!==undefined)_0x212981[_0x4fc9a6]=_0x35d5a2[_0x4fc9a6];}return _0x212981;}function cloneProfile(_0x1eee44){return isRecord(_0x1eee44)?{..._0x1eee44}:{};}function collectWorkspaceProfileOverrides(_0x3a20d6){const _0x22f415=a184_0x51823d,_0x1a8c1d={},_0x59ee06=_0x3a20d6['str'](_0x22f415(0xea)),_0x1130f7=_0x3a20d6['str']('apiDir'),_0x4b9b6b=_0x3a20d6['str'](_0x22f415(0xdf)),_0x28ec15=_0x3a20d6[_0x22f415(0xee)](_0x22f415(0xe2)),_0x2c812c=_0x3a20d6[_0x22f415(0xf4)]('riskLevel'),_0x4300d8=_0x3a20d6[_0x22f415(0xf4)](_0x22f415(0xeb));if(_0x59ee06)_0x1a8c1d[_0x22f415(0xea)]=_0x59ee06;if(_0x1130f7)_0x1a8c1d['apiDir']=_0x1130f7;if(_0x4b9b6b)_0x1a8c1d[_0x22f415(0xf7)]=_0x4b9b6b;if(_0x28ec15!==undefined&&_0x28ec15!=='')_0x1a8c1d[_0x22f415(0xe2)]=Number(_0x28ec15);if(_0x2c812c)_0x1a8c1d[_0x22f415(0xe3)]=_0x2c812c;if(_0x4300d8)_0x1a8c1d[_0x22f415(0xeb)]=_0x4300d8;return _0x1a8c1d;}async function validateWorkspaceArgs(_0x23bf72){const _0xd39a5f=a184_0x51823d,_0x48dc57=_0x23bf72['str']('app')[_0xd39a5f(0xdd)](),_0x178215=_0x23bf72['str'](_0xd39a5f(0xef))[_0xd39a5f(0xdd)]();if(!_0x48dc57&&!_0x178215)throw CliErrors[_0xd39a5f(0xc3)](_0xd39a5f(0xcf),_0xd39a5f(0xc5)+CLI_BIN_NAME+_0xd39a5f(0xc6)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x178215)assertValidAppcode(_0x178215);}function resolveKnownApps(){const _0x1827d8=a184_0x51823d,{config:_0x326bc5,layers:_0xf9e1ea}=readRawConfigWithLayers(),_0x40e340=isRecord(_0x326bc5[_0x1827d8(0xc1)])?_0x326bc5[_0x1827d8(0xc1)]:{},_0x35005f=isRecord(_0xf9e1ea['globalConfig'][_0x1827d8(0xc1)])?_0xf9e1ea['globalConfig'][_0x1827d8(0xc1)]:{};return{..._0x35005f,..._0x40e340};}async function configureWorkspace(_0x4bdee3,_0x291c3f){const _0x4a1ae5=a184_0x51823d,_0x3c8743=_0x4bdee3[_0x4a1ae5(0xf4)](_0x4a1ae5(0xc9))[_0x4a1ae5(0xdd)](),_0x28dd3b=_0x4bdee3[_0x4a1ae5(0xf4)](_0x4a1ae5(0xef))[_0x4a1ae5(0xdd)](),_0x4cfee6=_0x3c8743||_0x28dd3b;if(!_0x4cfee6)throw CliErrors[_0x4a1ae5(0xc3)]('Missing\x20workspace\x20app\x20selector.','Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x4a1ae5(0xed));if(_0x28dd3b)assertValidAppcode(_0x28dd3b);const _0x23423e=resolveWriteConfigPath('project'),_0x2460c9=readConfigFile(_0x23423e),_0x404c1b=resolveKnownApps(),_0x593270=isRecord(_0x2460c9[_0x4a1ae5(0xc1)])?{..._0x2460c9[_0x4a1ae5(0xc1)]}:{},_0x36173d=cloneProfile(_0x593270[_0x4cfee6]),_0x5d4a30=sanitizeProfile(_0x404c1b[_0x4cfee6]),_0x18ecae=_0x28dd3b?{}:_0x5d4a30,_0xfad9cd=_0x28dd3b||_0x18ecae['appcode'];if(!_0xfad9cd){const _0x29f458=Object[_0x4a1ae5(0xd1)](_0x404c1b),_0x53b04f=_0x29f458[_0x4a1ae5(0xce)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x4a1ae5(0xd8)+_0x291c3f+_0x4a1ae5(0xde)+_0x4cfee6+_0x4a1ae5(0xd0):_0x4a1ae5(0xec)+_0x29f458[_0x4a1ae5(0xbe)](',\x20');throw CliErrors['validation'](_0x4a1ae5(0xe5)+_0x4cfee6+_0x4a1ae5(0xf2),_0x53b04f);}assertValidAppcode(String(_0xfad9cd));const _0x19fa09={..._0x18ecae,..._0x36173d,'appcode':String(_0xfad9cd),...collectWorkspaceProfileOverrides(_0x4bdee3)};return _0x593270[_0x4cfee6]=_0x19fa09,_0x2460c9['apps']=_0x593270,_0x2460c9[_0x4a1ae5(0xe8)]=_0x4cfee6,delete _0x2460c9[_0x4a1ae5(0xef)],delete _0x2460c9[_0x4a1ae5(0xc9)],_0x19fa09[_0x4a1ae5(0xea)]&&(_0x2460c9[_0x4a1ae5(0xea)]=_0x19fa09['env']),writeConfigFile(_0x23423e,_0x2460c9),{'ok':!![],'message':_0x4a1ae5(0xe0)+(_0x291c3f===_0x4a1ae5(0xd3)?'initialized':'updated')+':\x20'+_0x4cfee6+_0x4a1ae5(0xca)+_0x19fa09[_0x4a1ae5(0xef)]+_0x4a1ae5(0xd2)+_0x23423e+_0x4a1ae5(0xf0),'data':{'operation':_0x4a1ae5(0xcb)+_0x291c3f,'configPath':_0x23423e,'app':_0x4cfee6,'appcode':_0x19fa09[_0x4a1ae5(0xef)],'env':_0x19fa09[_0x4a1ae5(0xea)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a184_0x51823d(0xe6),'command':a184_0x51823d(0xd3),'description':'Initialize\x20the\x20current\x20workspace\x20app\x20binding','risk':a184_0x51823d(0xf1),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x515e52=>configureWorkspace(_0x515e52,a184_0x51823d(0xd3))},workspaceUseDefinition={'service':a184_0x51823d(0xe6),'command':a184_0x51823d(0xc7),'description':'Switch\x20the\x20current\x20workspace\x20app\x20binding','risk':a184_0x51823d(0xf1),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0xb25d5f=>configureWorkspace(_0xb25d5f,a184_0x51823d(0xc7))};function a184_0x251b(_0x949b60,_0x38c023){_0x949b60=_0x949b60-0xbe;const _0x2f86fb=a184_0x2f86();let _0x251ba1=_0x2f86fb[_0x949b60];return _0x251ba1;}export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ const a185_0x17faa9=a185_0x3123;(function(_0x23c22d,_0x2e7a7d){const _0x4ef892=a185_0x3123,_0x29768c=_0x23c22d();while(!![]){try{const _0x3a7b6b=parseInt(_0x4ef892(0xe3))/0x1+parseInt(_0x4ef892(0xfa))/0x2*(-parseInt(_0x4ef892(0x102))/0x3)+parseInt(_0x4ef892(0xf8))/0x4+parseInt(_0x4ef892(0xf6))/0x5*(-parseInt(_0x4ef892(0xea))/0x6)+parseInt(_0x4ef892(0xfb))/0x7*(-parseInt(_0x4ef892(0x110))/0x8)+-parseInt(_0x4ef892(0xe9))/0x9*(parseInt(_0x4ef892(0xf4))/0xa)+parseInt(_0x4ef892(0x115))/0xb*(parseInt(_0x4ef892(0xf2))/0xc);if(_0x3a7b6b===_0x2e7a7d)break;else _0x29768c['push'](_0x29768c['shift']());}catch(_0x273fe0){_0x29768c['push'](_0x29768c['shift']());}}}(a185_0x3660,0x4a965));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+a185_0x17faa9(0x113),SAFE_PROFILE_KEYS=['appcode',a185_0x17faa9(0x10d),'apiDir',a185_0x17faa9(0x107),a185_0x17faa9(0xed),a185_0x17faa9(0x101),a185_0x17faa9(0xe6)],workspaceFlags=[{'name':'app','type':a185_0x17faa9(0xef),'description':a185_0x17faa9(0x10b)},{'name':'appcode','type':a185_0x17faa9(0xef),'description':a185_0x17faa9(0xe5)},{'name':'env','type':a185_0x17faa9(0xef),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':a185_0x17faa9(0xee),'type':a185_0x17faa9(0xef),'description':a185_0x17faa9(0xfe)},{'name':a185_0x17faa9(0x11b),'type':a185_0x17faa9(0xef),'description':a185_0x17faa9(0x10a),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':'number','description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':'riskLevel','type':a185_0x17faa9(0xef),'description':a185_0x17faa9(0xe8),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':a185_0x17faa9(0xef),'description':a185_0x17faa9(0xe7)}];function a185_0x3123(_0x2dd26a,_0x846acd){_0x2dd26a=_0x2dd26a-0xe3;const _0x3660af=a185_0x3660();let _0x312356=_0x3660af[_0x2dd26a];return _0x312356;}function isRecord(_0x53945d){const _0x29f0ea=a185_0x17faa9;return!!_0x53945d&&typeof _0x53945d===_0x29f0ea(0x11c)&&!Array['isArray'](_0x53945d);}function a185_0x3660(){const _0x357aa8=['1043VhUGvk','\x20workspace\x20','workspace.','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','\x20--appcode\x20<code>`.','project','riskLevel','3chBpzX','workspace','length','app','.\x20Credentials:\x20not\x20written.','format','write',').\x20Config:\x20','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','\x20workspace\x20use\x20--app\x20<name>`.','env','\x20--app\x20','Missing\x20workspace\x20app\x20selector.','13720ZFjSAZ','trim','\x22\x20not\x20found.','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','Use\x20`','6589YTAfro','validation','apps','initialized','globalConfig','defaultApp','defaultFormat','object','208872NfJPLg','str','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','locale','Locale\x20for\x20this\x20workspace\x20app\x20profile','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','171twxOWU','30kXCDIz','Switch\x20the\x20current\x20workspace\x20app\x20binding','\x20(appcode:\x20','pageSize','apiDir','string','appcode','Invalid\x20appcode:\x20','18708fNyYHt','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','225070frserp','use','58245cAtlbq','init','1857472cCwAth','keys','1120318gdMdhY'];a185_0x3660=function(){return _0x357aa8;};return a185_0x3660();}function assertValidAppcode(_0x3f5184){const _0x4f5105=a185_0x17faa9,{valid:_0x345b35,message:_0x10488e}=validateAppcode(_0x3f5184);if(!_0x345b35)throw CliErrors[_0x4f5105(0x116)](_0x4f5105(0xf1)+_0x3f5184,_0x10488e);}function sanitizeProfile(_0x7c1756){if(!isRecord(_0x7c1756))return{};const _0x2631a4={};for(const _0x1aa981 of SAFE_PROFILE_KEYS){if(_0x7c1756[_0x1aa981]!==undefined)_0x2631a4[_0x1aa981]=_0x7c1756[_0x1aa981];}return _0x2631a4;}function cloneProfile(_0x298c62){return isRecord(_0x298c62)?{..._0x298c62}:{};}function collectWorkspaceProfileOverrides(_0x2043bb){const _0x30a784=a185_0x17faa9,_0x41865b={},_0x333ebb=_0x2043bb[_0x30a784(0xe4)](_0x30a784(0x10d)),_0xf73f0a=_0x2043bb[_0x30a784(0xe4)](_0x30a784(0xee)),_0x500e2e=_0x2043bb['str'](_0x30a784(0x11b)),_0xbabd42=_0x2043bb['flag'](_0x30a784(0xed)),_0x5c44f4=_0x2043bb['str']('riskLevel'),_0x37131f=_0x2043bb[_0x30a784(0xe4)](_0x30a784(0xe6));if(_0x333ebb)_0x41865b[_0x30a784(0x10d)]=_0x333ebb;if(_0xf73f0a)_0x41865b[_0x30a784(0xee)]=_0xf73f0a;if(_0x500e2e)_0x41865b[_0x30a784(0x107)]=_0x500e2e;if(_0xbabd42!==undefined&&_0xbabd42!=='')_0x41865b[_0x30a784(0xed)]=Number(_0xbabd42);if(_0x5c44f4)_0x41865b[_0x30a784(0x101)]=_0x5c44f4;if(_0x37131f)_0x41865b[_0x30a784(0xe6)]=_0x37131f;return _0x41865b;}async function validateWorkspaceArgs(_0x15583c){const _0x3a02df=a185_0x17faa9,_0x355d43=_0x15583c['str'](_0x3a02df(0x105))['trim'](),_0x4223c8=_0x15583c[_0x3a02df(0xe4)](_0x3a02df(0xf0))[_0x3a02df(0x111)]();if(!_0x355d43&&!_0x4223c8)throw CliErrors[_0x3a02df(0x116)](_0x3a02df(0x10f),_0x3a02df(0x114)+CLI_BIN_NAME+_0x3a02df(0xf3)+CLI_BIN_NAME+_0x3a02df(0x10c));if(_0x4223c8)assertValidAppcode(_0x4223c8);}function resolveKnownApps(){const _0x5fff7f=a185_0x17faa9,{config:_0x531616,layers:_0x3af07c}=readRawConfigWithLayers(),_0xfd23cb=isRecord(_0x531616['apps'])?_0x531616[_0x5fff7f(0x117)]:{},_0x3101d6=isRecord(_0x3af07c[_0x5fff7f(0x119)][_0x5fff7f(0x117)])?_0x3af07c[_0x5fff7f(0x119)]['apps']:{};return{..._0x3101d6,..._0xfd23cb};}async function configureWorkspace(_0x29bffe,_0x3756a2){const _0x11b1ce=a185_0x17faa9,_0x385ef6=_0x29bffe[_0x11b1ce(0xe4)](_0x11b1ce(0x105))[_0x11b1ce(0x111)](),_0x147378=_0x29bffe[_0x11b1ce(0xe4)](_0x11b1ce(0xf0))[_0x11b1ce(0x111)](),_0x318820=_0x385ef6||_0x147378;if(!_0x318820)throw CliErrors[_0x11b1ce(0x116)](_0x11b1ce(0x10f),_0x11b1ce(0x114)+CLI_BIN_NAME+_0x11b1ce(0xf3)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x147378)assertValidAppcode(_0x147378);const _0x2b7309=resolveWriteConfigPath(_0x11b1ce(0x100)),_0x199dbf=readConfigFile(_0x2b7309),_0x43613a=resolveKnownApps(),_0x11e99f=isRecord(_0x199dbf[_0x11b1ce(0x117)])?{..._0x199dbf[_0x11b1ce(0x117)]}:{},_0x1ec031=cloneProfile(_0x11e99f[_0x318820]),_0x51b9fe=sanitizeProfile(_0x43613a[_0x318820]),_0x4e9a1b=_0x147378?{}:_0x51b9fe,_0x36c399=_0x147378||_0x4e9a1b[_0x11b1ce(0xf0)];if(!_0x36c399){const _0x165050=Object[_0x11b1ce(0xf9)](_0x43613a),_0x20813a=_0x165050[_0x11b1ce(0x104)]===0x0?_0x11b1ce(0x114)+CLI_BIN_NAME+_0x11b1ce(0xfc)+_0x3756a2+_0x11b1ce(0x10e)+_0x318820+_0x11b1ce(0xff):'Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20'+_0x165050['join'](',\x20');throw CliErrors['validation']('App\x20\x22'+_0x318820+_0x11b1ce(0x112),_0x20813a);}assertValidAppcode(String(_0x36c399));const _0x2ef2f7={..._0x4e9a1b,..._0x1ec031,'appcode':String(_0x36c399),...collectWorkspaceProfileOverrides(_0x29bffe)};return _0x11e99f[_0x318820]=_0x2ef2f7,_0x199dbf[_0x11b1ce(0x117)]=_0x11e99f,_0x199dbf[_0x11b1ce(0x11a)]=_0x318820,delete _0x199dbf[_0x11b1ce(0xf0)],delete _0x199dbf[_0x11b1ce(0x105)],_0x2ef2f7['env']&&(_0x199dbf['env']=_0x2ef2f7[_0x11b1ce(0x10d)]),writeConfigFile(_0x2b7309,_0x199dbf),{'ok':!![],'message':'Workspace\x20'+(_0x3756a2==='init'?_0x11b1ce(0x118):'updated')+':\x20'+_0x318820+_0x11b1ce(0xec)+_0x2ef2f7[_0x11b1ce(0xf0)]+_0x11b1ce(0x109)+_0x2b7309+_0x11b1ce(0x106),'data':{'operation':_0x11b1ce(0xfd)+_0x3756a2,'configPath':_0x2b7309,'app':_0x318820,'appcode':_0x2ef2f7[_0x11b1ce(0xf0)],'env':_0x2ef2f7[_0x11b1ce(0x10d)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a185_0x17faa9(0x103),'command':a185_0x17faa9(0xf7),'description':'Initialize\x20the\x20current\x20workspace\x20app\x20binding','risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x4cce39=>configureWorkspace(_0x4cce39,'init')},workspaceUseDefinition={'service':a185_0x17faa9(0x103),'command':a185_0x17faa9(0xf5),'description':a185_0x17faa9(0xeb),'risk':a185_0x17faa9(0x108),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x10f43d=>configureWorkspace(_0x10f43d,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- const a185_0x18fd4f=a185_0x56da;(function(_0x1f32d2,_0x569c25){const _0x73e2f8=a185_0x56da,_0x5c452b=_0x1f32d2();while(!![]){try{const _0x213e86=parseInt(_0x73e2f8(0x16b))/0x1*(-parseInt(_0x73e2f8(0x165))/0x2)+parseInt(_0x73e2f8(0x16f))/0x3*(-parseInt(_0x73e2f8(0x168))/0x4)+-parseInt(_0x73e2f8(0x16c))/0x5*(-parseInt(_0x73e2f8(0x164))/0x6)+-parseInt(_0x73e2f8(0x16d))/0x7+-parseInt(_0x73e2f8(0x16e))/0x8*(parseInt(_0x73e2f8(0x175))/0x9)+-parseInt(_0x73e2f8(0x173))/0xa+-parseInt(_0x73e2f8(0x16a))/0xb*(-parseInt(_0x73e2f8(0x171))/0xc);if(_0x213e86===_0x569c25)break;else _0x5c452b['push'](_0x5c452b['shift']());}catch(_0x3bed4b){_0x5c452b['push'](_0x5c452b['shift']());}}}(a185_0x4e41,0x70619));function a185_0x56da(_0x579d28,_0xfba3ec){_0x579d28=_0x579d28-0x164;const _0x4e4178=a185_0x4e41();let _0x56da38=_0x4e4178[_0x579d28];return _0x56da38;}import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a185_0x4e41(){const _0xd82d43=['high-risk-write','remove','385776EHbdwX','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','6127xJobzg','1IKXeXS','193805XDqAxO','5096252FxvpMl','40QkaGJw','21OWXxRs','workspace','32688wdTbYm','App\x20profile\x20name\x20to\x20remove','714510ZSKGmG','workspace\x20remove','554994xaGxaa','138zswVbd','331066wcyNrw'];a185_0x4e41=function(){return _0xd82d43;};return a185_0x4e41();}export const workspaceRemoveDefinition={'service':a185_0x18fd4f(0x170),'command':a185_0x18fd4f(0x167),'description':a185_0x18fd4f(0x169),'risk':a185_0x18fd4f(0x166),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a185_0x18fd4f(0x172),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x40508a=>validateAppName(_0x40508a,'workspace\x20remove'),'execute':_0x41e618=>runAppRemove(_0x41e618,a185_0x18fd4f(0x174))};
1
+ const a186_0x5beca5=a186_0x481f;(function(_0x166ddc,_0x427299){const _0x44809b=a186_0x481f,_0x1b9c52=_0x166ddc();while(!![]){try{const _0x42ce18=-parseInt(_0x44809b(0x78))/0x1*(parseInt(_0x44809b(0x74))/0x2)+parseInt(_0x44809b(0x76))/0x3+-parseInt(_0x44809b(0x75))/0x4*(parseInt(_0x44809b(0x7b))/0x5)+parseInt(_0x44809b(0x80))/0x6+parseInt(_0x44809b(0x7a))/0x7+parseInt(_0x44809b(0x7d))/0x8+-parseInt(_0x44809b(0x79))/0x9;if(_0x42ce18===_0x427299)break;else _0x1b9c52['push'](_0x1b9c52['shift']());}catch(_0x3df782){_0x1b9c52['push'](_0x1b9c52['shift']());}}}(a186_0x4144,0xe9161));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a186_0x481f(_0x17a679,_0x4a0a33){_0x17a679=_0x17a679-0x74;const _0x41446e=a186_0x4144();let _0x481f07=_0x41446e[_0x17a679];return _0x481f07;}export const workspaceRemoveDefinition={'service':a186_0x5beca5(0x82),'command':a186_0x5beca5(0x81),'description':'Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','risk':a186_0x5beca5(0x7c),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a186_0x5beca5(0x77),'description':a186_0x5beca5(0x7e),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x2f8c4e=>validateAppName(_0x2f8c4e,a186_0x5beca5(0x7f)),'execute':_0x1aabb6=>runAppRemove(_0x1aabb6,'workspace\x20remove')};function a186_0x4144(){const _0x4373a1=['8683150wtmFyS','26695GHjDEf','high-risk-write','14687936rCXHmt','App\x20profile\x20name\x20to\x20remove','workspace\x20remove','3012624FdLiCe','remove','workspace','1210HGLGpJ','172ImhqSw','4122894AXSuZg','name','498psLMzw','31205304wAjKHy'];a186_0x4144=function(){return _0x4373a1;};return a186_0x4144();}