@lovrabet/rabetbase-cli 2.3.15-beta.1 → 2.3.15

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_0x2515f0=a172_0x34d2;(function(_0xa96769,_0x1ebe04){const _0x549f6d=a172_0x34d2,_0x1d79de=_0xa96769();while(!![]){try{const _0x51c4b1=-parseInt(_0x549f6d(0x126))/0x1*(parseInt(_0x549f6d(0x120))/0x2)+-parseInt(_0x549f6d(0x124))/0x3*(-parseInt(_0x549f6d(0x125))/0x4)+-parseInt(_0x549f6d(0x129))/0x5*(-parseInt(_0x549f6d(0x12c))/0x6)+parseInt(_0x549f6d(0x127))/0x7*(-parseInt(_0x549f6d(0x12d))/0x8)+parseInt(_0x549f6d(0x117))/0x9+-parseInt(_0x549f6d(0x12b))/0xa*(-parseInt(_0x549f6d(0x118))/0xb)+-parseInt(_0x549f6d(0x12a))/0xc;if(_0x51c4b1===_0x1ebe04)break;else _0x1d79de['push'](_0x1d79de['shift']());}catch(_0x2dc315){_0x1d79de['push'](_0x1d79de['shift']());}}}(a172_0x3ea1,0xd70d3));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a172_0x34d2(_0x5a900a,_0x3250c2){_0x5a900a=_0x5a900a-0x114;const _0x3ea102=a172_0x3ea1();let _0x34d2b9=_0x3ea102[_0x5a900a];return _0x34d2b9;}import{parseJsonParams}from'../../utils/params.js';function a172_0x3ea1(){const _0xeccf38=['1512156oiYaoB','13wCnvDV','511yQSaoN','sqlcode','6629390SaxmXw','25153752rLUYIo','14605720CbRJAQ','6ZQmVxw','40088IevzcE','length','read','\x20row(s)\x20in\x20','Returned\x20','execSuccess','str','2222442VyNMuN','11YdWBLU','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','params','exec','SQL\x20execution\x20failed','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','isArray','appCode','10558GOlktU','execResult','string','now','3YqjjxV'];a172_0x3ea1=function(){return _0xeccf38;};return a172_0x3ea1();}export const sqlExec={'service':'sql','command':a172_0x2515f0(0x11b),'description':a172_0x2515f0(0x11d),'risk':a172_0x2515f0(0x12f),'flags':[SQLCODE_FLAG,{'name':a172_0x2515f0(0x11a),'type':a172_0x2515f0(0x122),'description':a172_0x2515f0(0x119)}],async 'execute'(_0x14a9c6){const _0x58400d=a172_0x2515f0,_0x15204d=parseJsonParams(_0x14a9c6[_0x58400d(0x116)](_0x58400d(0x11a))),_0x348f7b=Date['now'](),_0xd9e31=await executeSql(_0x14a9c6[_0x58400d(0x11f)],_0x14a9c6[_0x58400d(0x116)](_0x58400d(0x128)),_0x15204d),_0x3cb84f=Date[_0x58400d(0x123)]()-_0x348f7b,_0x1136c7=_0xd9e31?.[_0x58400d(0x121)]??_0xd9e31,_0x2dd70c=_0xd9e31?.[_0x58400d(0x115)]??!![];if(!_0x2dd70c)return{'ok':![],'data':{'error':_0xd9e31?.['execError']||_0x58400d(0x11c),'elapsed':_0x3cb84f},'message':'SQL\x20execution\x20failed'};const _0x48854c=Array[_0x58400d(0x11e)](_0x1136c7)?_0x1136c7:[];return{'ok':!![],'data':{'rows':_0x48854c,'rowCount':_0x48854c[_0x58400d(0x12e)],'elapsed':_0x3cb84f},'message':_0x58400d(0x114)+_0x48854c[_0x58400d(0x12e)]+_0x58400d(0x130)+_0x3cb84f+'ms'};}};
1
+ const a173_0x5a1f8b=a173_0x4f20;(function(_0x422aea,_0x4ee3d2){const _0xa102fb=a173_0x4f20,_0x33c1f0=_0x422aea();while(!![]){try{const _0x579957=parseInt(_0xa102fb(0xb9))/0x1*(-parseInt(_0xa102fb(0xba))/0x2)+parseInt(_0xa102fb(0xc4))/0x3*(-parseInt(_0xa102fb(0xbe))/0x4)+parseInt(_0xa102fb(0xb8))/0x5*(-parseInt(_0xa102fb(0xc2))/0x6)+-parseInt(_0xa102fb(0xc0))/0x7+-parseInt(_0xa102fb(0xb1))/0x8*(-parseInt(_0xa102fb(0xc3))/0x9)+parseInt(_0xa102fb(0xab))/0xa*(parseInt(_0xa102fb(0xbb))/0xb)+parseInt(_0xa102fb(0xc1))/0xc;if(_0x579957===_0x4ee3d2)break;else _0x33c1f0['push'](_0x33c1f0['shift']());}catch(_0x4eab4b){_0x33c1f0['push'](_0x33c1f0['shift']());}}}(a173_0x52e1,0xf285a));function a173_0x52e1(){const _0x20f0d9=['\x20row(s)\x20in\x20','read','20yEjzsz','66GaClyl','1230yqWcoz','15689938HensaE','sqlcode','isArray','8JFDoOT','sql','8171079bJgdjT','38519148TAsxvN','2618496DqEjzR','942579iolLOo','1662435cyIoFc','execSuccess','10nErRvF','params','Returned\x20','now','appCode','length','32ytYagR','SQL\x20execution\x20failed','execResult','str','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'];a173_0x52e1=function(){return _0x20f0d9;};return a173_0x52e1();}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a173_0x4f20(_0x101056,_0x4a5d71){_0x101056=_0x101056-0xaa;const _0x52e164=a173_0x52e1();let _0x4f209a=_0x52e164[_0x101056];return _0x4f209a;}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a173_0x5a1f8b(0xbf),'command':'exec','description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a173_0x5a1f8b(0xb7),'flags':[SQLCODE_FLAG,{'name':a173_0x5a1f8b(0xac),'type':'string','description':a173_0x5a1f8b(0xb5)}],async 'execute'(_0x59aa8b){const _0xb15ab5=a173_0x5a1f8b,_0x1ca466=parseJsonParams(_0x59aa8b[_0xb15ab5(0xb4)](_0xb15ab5(0xac))),_0x496f84=Date['now'](),_0x16ecf4=await executeSql(_0x59aa8b[_0xb15ab5(0xaf)],_0x59aa8b['str'](_0xb15ab5(0xbc)),_0x1ca466),_0x2e68f5=Date[_0xb15ab5(0xae)]()-_0x496f84,_0x533b23=_0x16ecf4?.[_0xb15ab5(0xb3)]??_0x16ecf4,_0x400a6c=_0x16ecf4?.[_0xb15ab5(0xaa)]??!![];if(!_0x400a6c)return{'ok':![],'data':{'error':_0x16ecf4?.['execError']||_0xb15ab5(0xb2),'elapsed':_0x2e68f5},'message':_0xb15ab5(0xb2)};const _0x40ec6f=Array[_0xb15ab5(0xbd)](_0x533b23)?_0x533b23:[];return{'ok':!![],'data':{'rows':_0x40ec6f,'rowCount':_0x40ec6f[_0xb15ab5(0xb0)],'elapsed':_0x2e68f5},'message':_0xb15ab5(0xad)+_0x40ec6f[_0xb15ab5(0xb0)]+_0xb15ab5(0xb6)+_0x2e68f5+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x344957,_0xca5409){const _0x51aab1=a173_0x4b19,_0x431082=_0x344957();while(!![]){try{const _0x86ea6f=parseInt(_0x51aab1(0x144))/0x1+parseInt(_0x51aab1(0x146))/0x2+parseInt(_0x51aab1(0x142))/0x3*(parseInt(_0x51aab1(0x145))/0x4)+parseInt(_0x51aab1(0x143))/0x5*(-parseInt(_0x51aab1(0x141))/0x6)+parseInt(_0x51aab1(0x149))/0x7+-parseInt(_0x51aab1(0x148))/0x8+parseInt(_0x51aab1(0x147))/0x9*(parseInt(_0x51aab1(0x14a))/0xa);if(_0x86ea6f===_0xca5409)break;else _0x431082['push'](_0x431082['shift']());}catch(_0x4689a8){_0x431082['push'](_0x431082['shift']());}}}(a173_0x47b8,0x76bcc));function a173_0x4b19(_0x948dd1,_0x378041){_0x948dd1=_0x948dd1-0x141;const _0x47b842=a173_0x47b8();let _0x4b19ed=_0x47b842[_0x948dd1];return _0x4b19ed;}import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a173_0x47b8(){const _0x28b891=['16BAnkLu','994978FnLnaG','9dLfUsr','6307824iStKYC','518525OBJPYO','3177740nlCClh','333588lEwHIb','394881LLeLOG','65iFGhOo','581754JcrUYQ'];a173_0x47b8=function(){return _0x28b891;};return a173_0x47b8();}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(_0x3ac828,_0x48f789){const _0x3351ae=a174_0x21b1,_0x915b28=_0x3ac828();while(!![]){try{const _0x5c0eb1=parseInt(_0x3351ae(0x146))/0x1+-parseInt(_0x3351ae(0x13f))/0x2+-parseInt(_0x3351ae(0x145))/0x3+-parseInt(_0x3351ae(0x144))/0x4*(parseInt(_0x3351ae(0x140))/0x5)+parseInt(_0x3351ae(0x148))/0x6+-parseInt(_0x3351ae(0x143))/0x7*(parseInt(_0x3351ae(0x142))/0x8)+-parseInt(_0x3351ae(0x141))/0x9*(-parseInt(_0x3351ae(0x147))/0xa);if(_0x5c0eb1===_0x48f789)break;else _0x915b28['push'](_0x915b28['shift']());}catch(_0x4a3d76){_0x915b28['push'](_0x915b28['shift']());}}}(a174_0x16a2,0x33c62));function a174_0x16a2(){const _0x4e8f2b=['2447670boBgey','209480kKDhrM','5dXNlCW','110961EopedD','17880WloEYe','616yvMTBm','1113788MzNmJe','76158QHKtgm','323071QGYuKW','70LaGNCa'];a174_0x16a2=function(){return _0x4e8f2b;};return a174_0x16a2();}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';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';function a174_0x21b1(_0x4ab504,_0xd0467){_0x4ab504=_0x4ab504-0x13f;const _0x16a291=a174_0x16a2();let _0x21b1c1=_0x16a291[_0x4ab504];return _0x21b1c1;}import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a174_0x255824=a174_0xc803;function a174_0xc803(_0x4de91e,_0x121149){_0x4de91e=_0x4de91e-0xb1;const _0x420c48=a174_0x420c();let _0xc803ac=_0x420c48[_0x4de91e];return _0xc803ac;}(function(_0xe124a0,_0x5ce0a6){const _0xf2f34f=a174_0xc803,_0x81c9b7=_0xe124a0();while(!![]){try{const _0x1f8166=parseInt(_0xf2f34f(0xc8))/0x1*(-parseInt(_0xf2f34f(0xd1))/0x2)+-parseInt(_0xf2f34f(0xb2))/0x3*(-parseInt(_0xf2f34f(0xd2))/0x4)+-parseInt(_0xf2f34f(0xb5))/0x5+-parseInt(_0xf2f34f(0xcd))/0x6+parseInt(_0xf2f34f(0xc6))/0x7+-parseInt(_0xf2f34f(0xd3))/0x8+parseInt(_0xf2f34f(0xc4))/0x9*(parseInt(_0xf2f34f(0xb6))/0xa);if(_0x1f8166===_0x5ce0a6)break;else _0x81c9b7['push'](_0x81c9b7['shift']());}catch(_0x560610){_0x81c9b7['push'](_0x81c9b7['shift']());}}}(a174_0x420c,0x9e1e7));import{listSqlQueries}from'../../core/api-client.js';function a174_0x420c(){const _0x3fb3e1=['page','sql','list','boolean','bool','sqlCode','num','sqlName','dbId','2045646Paovxq','map','1744988dIzxZc','sqlcode','1gmfEKr','pagesize','\x20SQL\x20queries\x20(total:\x20','totalCount','appCode','3801120hDurIz','length','Page\x20size','Found\x20','336968XXaLgn','8oorqOP','9846104SrZCzK','verbose','read','648006sxYPyh','number','Filter\x20by\x20SQL\x20name','2505500ThkVxm','110sEXHEj','str','name','List\x20custom\x20SQL\x20queries','No\x20custom\x20SQL\x20queries\x20found.'];a174_0x420c=function(){return _0x3fb3e1;};return a174_0x420c();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a174_0x255824(0xbc),'command':a174_0x255824(0xbd),'description':a174_0x255824(0xb9),'risk':a174_0x255824(0xb1),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a174_0x255824(0xb8),'type':'string','description':a174_0x255824(0xb4)},{'name':a174_0x255824(0xbb),'type':a174_0x255824(0xb3),'description':'Page\x20number','default':0x1},{'name':a174_0x255824(0xc9),'type':'number','description':a174_0x255824(0xcf)},{'name':'verbose','type':a174_0x255824(0xbe),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x1a96f5){const _0x3dd87e=a174_0x255824,_0x212676=await listSqlQueries(_0x1a96f5[_0x3dd87e(0xcc)],{'sqlCode':_0x1a96f5['str'](_0x3dd87e(0xc7))||undefined,'sqlName':_0x1a96f5[_0x3dd87e(0xb7)]('name')||undefined,'currentPage':_0x1a96f5[_0x3dd87e(0xc1)](_0x3dd87e(0xbb)),'pageSize':_0x1a96f5['num'](_0x3dd87e(0xc9),0x32)}),_0x335e93=_0x1a96f5[_0x3dd87e(0xbf)](_0x3dd87e(0xd4)),_0x4187d3=_0x212676['tableData']??[],_0x330c19=_0x212676['paging']?.[_0x3dd87e(0xcb)]??_0x4187d3[_0x3dd87e(0xce)];let _0x4fc09f;return _0x335e93?_0x4fc09f=_0x4187d3:_0x4fc09f=await Promise['all'](_0x4187d3[_0x3dd87e(0xc5)](async _0xba6259=>{const _0x27e3d3=_0x3dd87e;let _0x3175bb;try{_0x3175bb=_0xba6259[_0x27e3d3(0xc3)]?await getDbName(_0x1a96f5[_0x27e3d3(0xcc)],_0xba6259[_0x27e3d3(0xc3)]):undefined;}catch{}return{'sqlCode':_0xba6259[_0x27e3d3(0xc0)],'sqlName':_0xba6259[_0x27e3d3(0xc2)],'description':_0xba6259['description']??'','db':_0x3175bb?_0x3175bb+'\x20('+_0xba6259['dbId']+')':_0xba6259[_0x27e3d3(0xc3)]??''};})),{'ok':!![],'data':_0x4fc09f,'message':_0x4187d3['length']===0x0?_0x3dd87e(0xba):_0x3dd87e(0xd0)+_0x4187d3['length']+_0x3dd87e(0xca)+_0x330c19+').'};}};
1
+ function a175_0x267e(_0x842fd6,_0x17d860){_0x842fd6=_0x842fd6-0xba;const _0x1c2d92=a175_0x1c2d();let _0x267ec7=_0x1c2d92[_0x842fd6];return _0x267ec7;}const a175_0x3ee43d=a175_0x267e;(function(_0x464a9c,_0x53b475){const _0x460fcd=a175_0x267e,_0x18ec2c=_0x464a9c();while(!![]){try{const _0x4a75e3=-parseInt(_0x460fcd(0xca))/0x1*(parseInt(_0x460fcd(0xcd))/0x2)+-parseInt(_0x460fcd(0xd6))/0x3*(-parseInt(_0x460fcd(0xba))/0x4)+parseInt(_0x460fcd(0xc1))/0x5+-parseInt(_0x460fcd(0xc8))/0x6+-parseInt(_0x460fcd(0xc2))/0x7+parseInt(_0x460fcd(0xc7))/0x8+parseInt(_0x460fcd(0xc0))/0x9;if(_0x4a75e3===_0x53b475)break;else _0x18ec2c['push'](_0x18ec2c['shift']());}catch(_0x3dcece){_0x18ec2c['push'](_0x18ec2c['shift']());}}}(a175_0x1c2d,0x5fb62));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':a175_0x3ee43d(0xd9),'description':a175_0x3ee43d(0xcb),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a175_0x3ee43d(0xdb),'type':a175_0x3ee43d(0xd2),'description':'Filter\x20by\x20SQL\x20name'},{'name':a175_0x3ee43d(0xc4),'type':a175_0x3ee43d(0xd0),'description':a175_0x3ee43d(0xce),'default':0x1},{'name':'pagesize','type':'number','description':a175_0x3ee43d(0xc3)},{'name':'verbose','type':'boolean','description':a175_0x3ee43d(0xcf)}],async 'execute'(_0x1387bb){const _0x202fc2=a175_0x3ee43d,_0x28770f=await listSqlQueries(_0x1387bb[_0x202fc2(0xd8)],{'sqlCode':_0x1387bb[_0x202fc2(0xc6)](_0x202fc2(0xd7))||undefined,'sqlName':_0x1387bb[_0x202fc2(0xc6)](_0x202fc2(0xdb))||undefined,'currentPage':_0x1387bb['num'](_0x202fc2(0xc4)),'pageSize':_0x1387bb[_0x202fc2(0xc5)](_0x202fc2(0xc9),0x32)}),_0x2b594c=_0x1387bb[_0x202fc2(0xbd)](_0x202fc2(0xd3)),_0x1c74c4=_0x28770f['tableData']??[],_0x5e5370=_0x28770f[_0x202fc2(0xbc)]?.[_0x202fc2(0xda)]??_0x1c74c4[_0x202fc2(0xdc)];let _0x1dffd7;return _0x2b594c?_0x1dffd7=_0x1c74c4:_0x1dffd7=await Promise[_0x202fc2(0xcc)](_0x1c74c4[_0x202fc2(0xbe)](async _0x3c0e57=>{const _0x3053a8=_0x202fc2;let _0x2eb2c3;try{_0x2eb2c3=_0x3c0e57[_0x3053a8(0xbb)]?await getDbName(_0x1387bb[_0x3053a8(0xd8)],_0x3c0e57[_0x3053a8(0xbb)]):undefined;}catch{}return{'sqlCode':_0x3c0e57[_0x3053a8(0xd5)],'sqlName':_0x3c0e57[_0x3053a8(0xd1)],'description':_0x3c0e57[_0x3053a8(0xbf)]??'','db':_0x2eb2c3?_0x2eb2c3+'\x20('+_0x3c0e57[_0x3053a8(0xbb)]+')':_0x3c0e57[_0x3053a8(0xbb)]??''};})),{'ok':!![],'data':_0x1dffd7,'message':_0x1c74c4[_0x202fc2(0xdc)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x202fc2(0xd4)+_0x1c74c4[_0x202fc2(0xdc)]+'\x20SQL\x20queries\x20(total:\x20'+_0x5e5370+').'};}};function a175_0x1c2d(){const _0xf807c2=['string','verbose','Found\x20','sqlCode','1701186Mjtmny','sqlcode','appCode','list','totalCount','name','length','4VBFFyH','dbId','paging','bool','map','description','4344336AVZfmx','537170Xejhew','3227245JdUnIg','Page\x20size','page','num','str','3066560aHTkLN','620634Lqvaal','pagesize','2BOfhZU','List\x20custom\x20SQL\x20queries','all','584012kAHIVh','Page\x20number','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','number','sqlName'];a175_0x1c2d=function(){return _0xf807c2;};return a175_0x1c2d();}
@@ -1 +1 @@
1
- const a175_0x46eef8=a175_0x26d4;(function(_0x5cd3aa,_0x4ebd3f){const _0x3972c1=a175_0x26d4,_0x5ae150=_0x5cd3aa();while(!![]){try{const _0x3f1b99=parseInt(_0x3972c1(0x1ff))/0x1*(parseInt(_0x3972c1(0x1f7))/0x2)+parseInt(_0x3972c1(0x202))/0x3+-parseInt(_0x3972c1(0x223))/0x4*(-parseInt(_0x3972c1(0x1f2))/0x5)+parseInt(_0x3972c1(0x22e))/0x6+-parseInt(_0x3972c1(0x22c))/0x7*(-parseInt(_0x3972c1(0x1fe))/0x8)+parseInt(_0x3972c1(0x227))/0x9+-parseInt(_0x3972c1(0x229))/0xa;if(_0x3f1b99===_0x4ebd3f)break;else _0x5ae150['push'](_0x5ae150['shift']());}catch(_0x3fbd44){_0x5ae150['push'](_0x5ae150['shift']());}}}(a175_0x1003,0x73057));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x10cd9a,_0x29afdd){const _0x9d9b6=a175_0x26d4,_0x193084=[];let _0x7e4b7e=0x1;while(!![]){const _0x49ba29=await listSqlQueries(_0x10cd9a,{'currentPage':_0x7e4b7e,'pageSize':PAGE_SIZE,'sqlCode':_0x29afdd[_0x9d9b6(0x211)],'sqlName':_0x29afdd[_0x9d9b6(0x1f3)]}),_0x5dd0c3=_0x49ba29[_0x9d9b6(0x208)]??[];_0x193084['push'](..._0x5dd0c3);if(_0x5dd0c3[_0x9d9b6(0x1fb)]===0x0)break;const _0x58f967=_0x49ba29[_0x9d9b6(0x224)]?.[_0x9d9b6(0x20d)];if(_0x58f967!=null?_0x193084[_0x9d9b6(0x1fb)]>=_0x58f967:_0x5dd0c3[_0x9d9b6(0x1fb)]<PAGE_SIZE)break;_0x7e4b7e++;}return _0x193084;}async function ensureSqlContent(_0x5ddd91){const _0x2415aa=a175_0x26d4;if(_0x5ddd91[_0x2415aa(0x218)]!=null&&String(_0x5ddd91[_0x2415aa(0x218)])['length']>0x0)return _0x5ddd91;return getSqlQueryDetail(_0x5ddd91['sqlCode']);}export const sqlPull={'service':a175_0x46eef8(0x1f5),'command':'pull','description':a175_0x46eef8(0x22f),'risk':a175_0x46eef8(0x206),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a175_0x46eef8(0x217),'type':a175_0x46eef8(0x222),'description':a175_0x46eef8(0x20b)},{'name':a175_0x46eef8(0x205),'type':a175_0x46eef8(0x21d),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x52a697){const _0xd70f81=a175_0x46eef8,_0x11dc18=loadSqlProjectConfig(_0x52a697[_0xd70f81(0x221)]),_0xeb9830=await readSqlLockFile(_0x11dc18[_0xd70f81(0x200)]),{appLock:_0x4777e0}=ensureSqlLockScope(_0xeb9830??createEmptySqlLock(),_0x11dc18['appCode'],_0x11dc18[_0xd70f81(0x204)],'pull'),_0x13c016=await fetchAllSqlQueries(_0x52a697[_0xd70f81(0x221)],{'sqlCode':_0x52a697[_0xd70f81(0x21e)]('sqlcode')||undefined,'sqlName':_0x52a697[_0xd70f81(0x21e)]('name')||undefined}),_0x27c97e=[];for(const _0x5d8308 of _0x13c016){const _0xba5457=await ensureSqlContent(_0x5d8308),_0x1e41e7=ensureRemoteSqlContent(_0xba5457),_0x3b26ad=detectModeFromSql(_0xba5457),_0x135b62=_0xba5457[_0xd70f81(0x1f8)]?await getDbName(_0x52a697[_0xd70f81(0x221)],Number(_0xba5457[_0xd70f81(0x1f8)]))[_0xd70f81(0x21c)](()=>undefined):undefined,_0x3a5ef8=buildLocalSqlFileContent({'sqlCode':_0xba5457[_0xd70f81(0x211)],'sqlName':_0xba5457[_0xd70f81(0x1f3)],'dbId':_0xba5457['dbId']},_0x1e41e7,{'dbName':_0x135b62,'mode':_0x3b26ad,'syncedAt':new Date()['toISOString'](),'description':_0xba5457['description']}),_0x468ca7=buildSqlLockEntry(_0xba5457,_0x1e41e7,'',{'dbName':_0x135b62}),_0x123de2=resolveLocalSqlFilePath(_0x11dc18,_0xba5457[_0xd70f81(0x211)],_0x468ca7);let _0x573870='would_pull',_0x57446b;if(await fileExists(_0x123de2)){const _0x3435e7=await readFile(_0x123de2,_0xd70f81(0x22b));isEquivalentPulledSqlFile(_0x3435e7,_0x3a5ef8,_0x3b26ad)?(_0x573870=_0xd70f81(0x230),_0x57446b=_0xd70f81(0x1fd)):(_0x573870=_0xd70f81(0x212),_0x57446b=_0xd70f81(0x210));}_0x27c97e[_0xd70f81(0x21b)]({'sqlCode':_0xba5457['sqlCode'],'sqlName':_0xba5457[_0xd70f81(0x1f3)],'filePath':_0x123de2,'status':_0x573870,'reason':_0x57446b});}return{'method':'POST','url':_0xd70f81(0x21f),'body':{'appCode':_0x52a697[_0xd70f81(0x221)],'sqlCode':_0x52a697[_0xd70f81(0x21e)](_0xd70f81(0x20a))||null,'sqlName':_0x52a697[_0xd70f81(0x21e)](_0xd70f81(0x217))||null,'files':_0x27c97e},'description':_0xd70f81(0x1f9)+_0x27c97e[_0xd70f81(0x1fb)]+'\x20SQL\x20file(s)\x20into\x20'+_0x11dc18[_0xd70f81(0x220)]};},async 'execute'(_0x4d2efa){const _0xe3e0e8=a175_0x46eef8,_0x4d08d0=loadSqlProjectConfig(_0x4d2efa[_0xe3e0e8(0x221)]),_0x51afe8=await readSqlLockFile(_0x4d08d0[_0xe3e0e8(0x200)]),{lockData:_0x58f94a,appLock:_0x4a4d5e}=ensureSqlLockScope(_0x51afe8??createEmptySqlLock(),_0x4d08d0[_0xe3e0e8(0x221)],_0x4d08d0[_0xe3e0e8(0x204)],'pull'),_0x19d822=_0x4d2efa[_0xe3e0e8(0x219)](_0xe3e0e8(0x205)),_0x3795bc=await fetchAllSqlQueries(_0x4d2efa[_0xe3e0e8(0x221)],{'sqlCode':_0x4d2efa[_0xe3e0e8(0x21e)](_0xe3e0e8(0x20a))||undefined,'sqlName':_0x4d2efa[_0xe3e0e8(0x21e)]('name')||undefined});if(_0x3795bc[_0xe3e0e8(0x1fb)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0xe3e0e8(0x226)};const _0x254f49=[],_0x34ae4a=[];for(const _0x59d323 of _0x3795bc){try{_0x254f49['push'](await ensureSqlContent(_0x59d323));}catch(_0x18a886){_0x34ae4a[_0xe3e0e8(0x21b)]({'sqlCode':_0x59d323['sqlCode'],'error':_0x18a886 instanceof Error?_0x18a886[_0xe3e0e8(0x213)]:String(_0x18a886)});}}if(_0x19d822&&!_0x4d2efa[_0xe3e0e8(0x20e)]){let _0x233abf=![];for(const _0x25e9b3 of _0x254f49){const _0x1c853e=detectModeFromSql(_0x25e9b3),_0x23ccc8=_0x25e9b3[_0xe3e0e8(0x1f8)]?await getDbName(_0x4d2efa['appCode'],Number(_0x25e9b3[_0xe3e0e8(0x1f8)]))[_0xe3e0e8(0x21c)](()=>undefined):undefined,_0x4084d5=buildLocalSqlFileContent({'sqlCode':_0x25e9b3[_0xe3e0e8(0x211)],'sqlName':_0x25e9b3[_0xe3e0e8(0x1f3)],'dbId':_0x25e9b3[_0xe3e0e8(0x1f8)]},ensureRemoteSqlContent(_0x25e9b3),{'dbName':_0x23ccc8,'mode':_0x1c853e,'syncedAt':new Date()['toISOString'](),'description':_0x25e9b3['description']}),_0x56c7c5=resolveLocalSqlFilePath(_0x4d08d0,_0x25e9b3['sqlCode'],buildSqlLockEntry(_0x25e9b3,ensureRemoteSqlContent(_0x25e9b3),'',{'dbName':_0x23ccc8}));if(await fileExists(_0x56c7c5)){const _0x2969c9=await readFile(_0x56c7c5,_0xe3e0e8(0x22b));if(!isEquivalentPulledSqlFile(_0x2969c9,_0x4084d5,_0x1c853e)){_0x233abf=!![];break;}}}if(_0x233abf){const _0x72ed3e=await confirmForceOverwrite(_0xe3e0e8(0x20f));if(!_0x72ed3e)throw CliErrors['cancelled'](_0xe3e0e8(0x214));}}const _0x49e663=cloneSqlLockData(_0x58f94a),_0x533b36=_0x49e663[_0xe3e0e8(0x22a)][_0x4d08d0[_0xe3e0e8(0x221)]],_0x871cb1=[],_0x4f506f=[];for(const _0x2d467a of _0x254f49){const _0xc8f1e4=_0x533b36[_0xe3e0e8(0x1fc)][_0x2d467a[_0xe3e0e8(0x211)]],_0x35a0e5=ensureRemoteSqlContent(_0x2d467a),_0x4b0970=detectModeFromSql(_0x2d467a),_0x50ffb8=_0x2d467a[_0xe3e0e8(0x1f8)]?await getDbName(_0x4d2efa[_0xe3e0e8(0x221)],Number(_0x2d467a[_0xe3e0e8(0x1f8)]))[_0xe3e0e8(0x21c)](()=>undefined):undefined,_0x5b95ac=buildLocalSqlFileContent({'sqlCode':_0x2d467a[_0xe3e0e8(0x211)],'sqlName':_0x2d467a['sqlName'],'dbId':_0x2d467a[_0xe3e0e8(0x1f8)]},_0x35a0e5,{'dbName':_0x50ffb8,'mode':_0x4b0970,'syncedAt':new Date()[_0xe3e0e8(0x1f4)](),'description':_0x2d467a[_0xe3e0e8(0x22d)]}),_0x557e12=buildSqlLockEntry(_0x2d467a,_0x35a0e5,computeSqlContentHash(_0x5b95ac),{'dbName':_0x50ffb8}),_0x477a2f=_0x557e12[_0xe3e0e8(0x21a)],_0x1d633e=join(_0x4d08d0[_0xe3e0e8(0x220)],_0x477a2f);try{if(await fileExists(_0x1d633e)){const _0x28827a=await readFile(_0x1d633e,_0xe3e0e8(0x22b));if(isEquivalentPulledSqlFile(_0x28827a,_0x5b95ac,_0x4b0970)){_0x4f506f[_0xe3e0e8(0x21b)]({'sqlCode':_0x2d467a['sqlCode'],'reason':'unchanged'}),_0x533b36[_0xe3e0e8(0x1fc)][_0x2d467a['sqlCode']]={..._0x557e12,'hash':computeSqlContentHash(_0x28827a),'path':_0x477a2f};continue;}if(!_0x19d822){_0x4f506f[_0xe3e0e8(0x21b)]({'sqlCode':_0x2d467a['sqlCode'],'reason':_0xe3e0e8(0x228)});continue;}}const _0x10741f=_0xc8f1e4?.[_0xe3e0e8(0x21a)]?join(_0x4d08d0[_0xe3e0e8(0x220)],_0xc8f1e4[_0xe3e0e8(0x21a)]):undefined;_0x10741f&&_0x10741f!==_0x1d633e&&await fileExists(_0x10741f)&&await rm(_0x10741f,{'force':!![]}),await ensureParentDirectory(_0x1d633e),await writeFile(_0x1d633e,_0x5b95ac,'utf8'),_0x533b36[_0xe3e0e8(0x1fc)][_0x2d467a[_0xe3e0e8(0x211)]]={..._0x557e12,'path':_0x477a2f},_0x871cb1[_0xe3e0e8(0x21b)]({'sqlCode':_0x2d467a[_0xe3e0e8(0x211)],'filePath':_0x1d633e});}catch(_0x264350){_0x34ae4a['push']({'sqlCode':_0x2d467a[_0xe3e0e8(0x211)],'error':_0x264350 instanceof Error?_0x264350[_0xe3e0e8(0x213)]:String(_0x264350)});}}return _0x533b36[_0xe3e0e8(0x1f6)]=new Date()['toISOString'](),await writeSqlLockFile(_0x4d08d0['lockFilePath'],_0x49e663),{'ok':_0x34ae4a[_0xe3e0e8(0x1fb)]===0x0,'data':{'pulled':_0x871cb1,'skipped':_0x4f506f,'failed':_0x34ae4a},'message':_0xe3e0e8(0x207)+_0x871cb1[_0xe3e0e8(0x1fb)]+'\x20written,\x20'+_0x4f506f[_0xe3e0e8(0x1fb)]+_0xe3e0e8(0x203)+_0x34ae4a[_0xe3e0e8(0x1fb)]+_0xe3e0e8(0x225)};}};function a175_0x1003(){const _0x34f150=['\x20skipped,\x20','sqlRoot','force','write','Pull\x20complete:\x20','tableData','replace','sqlcode','Filter\x20by\x20SQL\x20display\x20name','mybatisXml','totalCount','nonInteractive','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sqlCode','conflict','message','Force\x20pull\x20cancelled.','trimStart','split','name','sqlContent','bool','path','push','catch','boolean','str','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqlRootDir','appCode','string','28leFZUW','paging','\x20failed','No\x20remote\x20SQL\x20queries\x20matched.','791127wyLXUs','local\x20differs\x20from\x20remote','23513940bljjXB','apps','utf8','7qntdlA','description','5501316OmBqca','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','skipped','425775cedYri','sqlName','toISOString','sql','lastSync','424898bGTuga','dbId','Would\x20pull\x20','test','length','sqls','unchanged','5632072saHHOy','1HiQkuB','lockFilePath','join','915567zmXHPG'];a175_0x1003=function(){return _0x34f150;};return a175_0x1003();}function detectModeFromSql(_0x34dc18){const _0x35fc22=a175_0x46eef8,_0x5b941b=ensureRemoteSqlContent(_0x34dc18),_0x352373=stripLocalSqlMetadata(_0x5b941b,_0x35fc22(0x20c))[_0x35fc22(0x215)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x352373))return _0x35fc22(0x20c);return _0x35fc22(0x1f5);}function isEquivalentPulledSqlFile(_0x1e5186,_0x26f45f,_0x4f3c6b){return normalizePullComparableContent(_0x1e5186,_0x4f3c6b)===normalizePullComparableContent(_0x26f45f,_0x4f3c6b);}function a175_0x26d4(_0x1fbf0e,_0x3a2dd8){_0x1fbf0e=_0x1fbf0e-0x1f2;const _0x10035b=a175_0x1003();let _0x26d45a=_0x10035b[_0x1fbf0e];return _0x26d45a;}function normalizePullComparableContent(_0x35bcc,_0x4aeace){const _0x2c86cd=a175_0x46eef8,_0xcf6b78=_0x35bcc[_0x2c86cd(0x209)](/\r\n/g,'\x0a')[_0x2c86cd(0x216)]('\x0a'),_0x2375d8=_0xcf6b78['filter'](_0x1544ac=>!isSyncedAtMetadataLine(_0x1544ac,_0x4aeace));return _0x2375d8[_0x2c86cd(0x201)]('\x0a');}function isSyncedAtMetadataLine(_0xd5664f,_0x13b6c2){const _0x2ad93e=a175_0x46eef8;if(_0x13b6c2===_0x2ad93e(0x20c))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0xd5664f);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x2ad93e(0x1fa)](_0xd5664f);}
1
+ const a176_0x3c2e27=a176_0x4f17;(function(_0x5ef697,_0x413325){const _0x32f187=a176_0x4f17,_0x13c3bc=_0x5ef697();while(!![]){try{const _0x3c3db8=parseInt(_0x32f187(0x19c))/0x1+parseInt(_0x32f187(0x1a8))/0x2*(-parseInt(_0x32f187(0x1b3))/0x3)+parseInt(_0x32f187(0x1aa))/0x4*(-parseInt(_0x32f187(0x18e))/0x5)+parseInt(_0x32f187(0x188))/0x6+parseInt(_0x32f187(0x1ae))/0x7+parseInt(_0x32f187(0x191))/0x8+-parseInt(_0x32f187(0x185))/0x9*(parseInt(_0x32f187(0x1a0))/0xa);if(_0x3c3db8===_0x413325)break;else _0x13c3bc['push'](_0x13c3bc['shift']());}catch(_0x5ef0ff){_0x13c3bc['push'](_0x13c3bc['shift']());}}}(a176_0x4333,0x1a693));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';function a176_0x4f17(_0x499b18,_0x338b16){_0x499b18=_0x499b18-0x181;const _0x43337d=a176_0x4333();let _0x4f178a=_0x43337d[_0x499b18];return _0x4f178a;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a176_0x4333(){const _0x514bab=['string','887936WmHgMy','mybatisXml','description','name','message','force','test','dbId','trimStart','\x20SQL\x20file(s)\x20into\x20','totalCount','8897ADoNgt','No\x20remote\x20SQL\x20queries\x20matched.','pull','write','458580VBgEAV','conflict','utf8','appCode','sqls','local\x20differs\x20from\x20remote','sqlName','unchanged','25094uSmxnh','Would\x20pull\x20','108952ZkAXSx','str','catch','toISOString','1444114NzYZaj','bool','\x20written,\x20','sql','Force\x20pull\x20cancelled.','33LHcyQd','nonInteractive','filter','sqlContent','tableData','Pull\x20complete:\x20','sqlRoot','join','sqlRootDir','push','Force\x20overwrite\x20local\x20unsynced\x20changes','Filter\x20by\x20SQL\x20display\x20name','\x20skipped,\x20','lockFilePath','POST','18sehsBk','paging','length','560610CphRtE','sqlCode','sqlcode','boolean','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','15xmdnYX','path'];a176_0x4333=function(){return _0x514bab;};return a176_0x4333();}import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x335447,_0x436c7b){const _0x4a8c44=a176_0x4f17,_0x26f264=[];let _0x4a6d1c=0x1;while(!![]){const _0x2e01b4=await listSqlQueries(_0x335447,{'currentPage':_0x4a6d1c,'pageSize':PAGE_SIZE,'sqlCode':_0x436c7b[_0x4a8c44(0x189)],'sqlName':_0x436c7b[_0x4a8c44(0x1a6)]}),_0x38d7fc=_0x2e01b4[_0x4a8c44(0x1b7)]??[];_0x26f264[_0x4a8c44(0x1bc)](..._0x38d7fc);if(_0x38d7fc[_0x4a8c44(0x187)]===0x0)break;const _0x5e7da6=_0x2e01b4[_0x4a8c44(0x186)]?.[_0x4a8c44(0x19b)];if(_0x5e7da6!=null?_0x26f264['length']>=_0x5e7da6:_0x38d7fc[_0x4a8c44(0x187)]<PAGE_SIZE)break;_0x4a6d1c++;}return _0x26f264;}async function ensureSqlContent(_0x460ab8){const _0x281c02=a176_0x4f17;if(_0x460ab8[_0x281c02(0x1b6)]!=null&&String(_0x460ab8['sqlContent'])[_0x281c02(0x187)]>0x0)return _0x460ab8;return getSqlQueryDetail(_0x460ab8[_0x281c02(0x189)]);}export const sqlPull={'service':a176_0x3c2e27(0x1b1),'command':a176_0x3c2e27(0x19e),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a176_0x3c2e27(0x19f),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a176_0x3c2e27(0x194),'type':a176_0x3c2e27(0x190),'description':a176_0x3c2e27(0x181)},{'name':a176_0x3c2e27(0x196),'type':a176_0x3c2e27(0x18b),'description':a176_0x3c2e27(0x1bd)}],async 'dryRun'(_0x45b08a){const _0x1c11c1=a176_0x3c2e27,_0x44a286=loadSqlProjectConfig(_0x45b08a[_0x1c11c1(0x1a3)]),_0x18ab45=await readSqlLockFile(_0x44a286[_0x1c11c1(0x183)]),{appLock:_0x274e2a}=ensureSqlLockScope(_0x18ab45??createEmptySqlLock(),_0x44a286['appCode'],_0x44a286['sqlRoot'],_0x1c11c1(0x19e)),_0x260082=await fetchAllSqlQueries(_0x45b08a[_0x1c11c1(0x1a3)],{'sqlCode':_0x45b08a['str'](_0x1c11c1(0x18a))||undefined,'sqlName':_0x45b08a['str'](_0x1c11c1(0x194))||undefined}),_0x114881=[];for(const _0x221e42 of _0x260082){const _0x1d25ab=await ensureSqlContent(_0x221e42),_0x431128=ensureRemoteSqlContent(_0x1d25ab),_0x74a5c5=detectModeFromSql(_0x1d25ab),_0x51c757=_0x1d25ab[_0x1c11c1(0x198)]?await getDbName(_0x45b08a[_0x1c11c1(0x1a3)],Number(_0x1d25ab[_0x1c11c1(0x198)]))[_0x1c11c1(0x1ac)](()=>undefined):undefined,_0x3f5546=buildLocalSqlFileContent({'sqlCode':_0x1d25ab[_0x1c11c1(0x189)],'sqlName':_0x1d25ab[_0x1c11c1(0x1a6)],'dbId':_0x1d25ab[_0x1c11c1(0x198)]},_0x431128,{'dbName':_0x51c757,'mode':_0x74a5c5,'syncedAt':new Date()[_0x1c11c1(0x1ad)](),'description':_0x1d25ab[_0x1c11c1(0x193)]}),_0x55ab45=buildSqlLockEntry(_0x1d25ab,_0x431128,'',{'dbName':_0x51c757}),_0x2c78e8=resolveLocalSqlFilePath(_0x44a286,_0x1d25ab['sqlCode'],_0x55ab45);let _0x35d6ba='would_pull',_0x489a52;if(await fileExists(_0x2c78e8)){const _0x4c28ae=await readFile(_0x2c78e8,_0x1c11c1(0x1a2));isEquivalentPulledSqlFile(_0x4c28ae,_0x3f5546,_0x74a5c5)?(_0x35d6ba='skipped',_0x489a52='unchanged'):(_0x35d6ba=_0x1c11c1(0x1a1),_0x489a52=_0x1c11c1(0x18d));}_0x114881[_0x1c11c1(0x1bc)]({'sqlCode':_0x1d25ab[_0x1c11c1(0x189)],'sqlName':_0x1d25ab[_0x1c11c1(0x1a6)],'filePath':_0x2c78e8,'status':_0x35d6ba,'reason':_0x489a52});}return{'method':_0x1c11c1(0x184),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x45b08a[_0x1c11c1(0x1a3)],'sqlCode':_0x45b08a[_0x1c11c1(0x1ab)](_0x1c11c1(0x18a))||null,'sqlName':_0x45b08a[_0x1c11c1(0x1ab)](_0x1c11c1(0x194))||null,'files':_0x114881},'description':_0x1c11c1(0x1a9)+_0x114881[_0x1c11c1(0x187)]+_0x1c11c1(0x19a)+_0x44a286[_0x1c11c1(0x1bb)]};},async 'execute'(_0x1dc846){const _0x3ffb8f=a176_0x3c2e27,_0x382162=loadSqlProjectConfig(_0x1dc846[_0x3ffb8f(0x1a3)]),_0x23ae56=await readSqlLockFile(_0x382162[_0x3ffb8f(0x183)]),{lockData:_0x522dc5,appLock:_0x170303}=ensureSqlLockScope(_0x23ae56??createEmptySqlLock(),_0x382162[_0x3ffb8f(0x1a3)],_0x382162[_0x3ffb8f(0x1b9)],_0x3ffb8f(0x19e)),_0xdef228=_0x1dc846[_0x3ffb8f(0x1af)]('force'),_0x906e22=await fetchAllSqlQueries(_0x1dc846[_0x3ffb8f(0x1a3)],{'sqlCode':_0x1dc846[_0x3ffb8f(0x1ab)]('sqlcode')||undefined,'sqlName':_0x1dc846[_0x3ffb8f(0x1ab)](_0x3ffb8f(0x194))||undefined});if(_0x906e22[_0x3ffb8f(0x187)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x3ffb8f(0x19d)};const _0x5ae3ae=[],_0x2eefd4=[];for(const _0x398937 of _0x906e22){try{_0x5ae3ae['push'](await ensureSqlContent(_0x398937));}catch(_0x4f8886){_0x2eefd4['push']({'sqlCode':_0x398937[_0x3ffb8f(0x189)],'error':_0x4f8886 instanceof Error?_0x4f8886['message']:String(_0x4f8886)});}}if(_0xdef228&&!_0x1dc846[_0x3ffb8f(0x1b4)]){let _0x1e270d=![];for(const _0xd97b54 of _0x5ae3ae){const _0x39c9fe=detectModeFromSql(_0xd97b54),_0x131611=_0xd97b54[_0x3ffb8f(0x198)]?await getDbName(_0x1dc846[_0x3ffb8f(0x1a3)],Number(_0xd97b54[_0x3ffb8f(0x198)]))['catch'](()=>undefined):undefined,_0x27f136=buildLocalSqlFileContent({'sqlCode':_0xd97b54[_0x3ffb8f(0x189)],'sqlName':_0xd97b54[_0x3ffb8f(0x1a6)],'dbId':_0xd97b54['dbId']},ensureRemoteSqlContent(_0xd97b54),{'dbName':_0x131611,'mode':_0x39c9fe,'syncedAt':new Date()[_0x3ffb8f(0x1ad)](),'description':_0xd97b54[_0x3ffb8f(0x193)]}),_0x2a9ab3=resolveLocalSqlFilePath(_0x382162,_0xd97b54[_0x3ffb8f(0x189)],buildSqlLockEntry(_0xd97b54,ensureRemoteSqlContent(_0xd97b54),'',{'dbName':_0x131611}));if(await fileExists(_0x2a9ab3)){const _0x30f988=await readFile(_0x2a9ab3,_0x3ffb8f(0x1a2));if(!isEquivalentPulledSqlFile(_0x30f988,_0x27f136,_0x39c9fe)){_0x1e270d=!![];break;}}}if(_0x1e270d){const _0x7b07cc=await confirmForceOverwrite(_0x3ffb8f(0x18c));if(!_0x7b07cc)throw CliErrors['cancelled'](_0x3ffb8f(0x1b2));}}const _0x5dd235=cloneSqlLockData(_0x522dc5),_0x1874ab=_0x5dd235['apps'][_0x382162[_0x3ffb8f(0x1a3)]],_0x596075=[],_0x5a0568=[];for(const _0x3ec058 of _0x5ae3ae){const _0x52d333=_0x1874ab['sqls'][_0x3ec058[_0x3ffb8f(0x189)]],_0x4f3292=ensureRemoteSqlContent(_0x3ec058),_0x50f1d5=detectModeFromSql(_0x3ec058),_0x169b81=_0x3ec058[_0x3ffb8f(0x198)]?await getDbName(_0x1dc846[_0x3ffb8f(0x1a3)],Number(_0x3ec058[_0x3ffb8f(0x198)]))[_0x3ffb8f(0x1ac)](()=>undefined):undefined,_0x589d99=buildLocalSqlFileContent({'sqlCode':_0x3ec058['sqlCode'],'sqlName':_0x3ec058['sqlName'],'dbId':_0x3ec058['dbId']},_0x4f3292,{'dbName':_0x169b81,'mode':_0x50f1d5,'syncedAt':new Date()[_0x3ffb8f(0x1ad)](),'description':_0x3ec058['description']}),_0xcc9ee9=buildSqlLockEntry(_0x3ec058,_0x4f3292,computeSqlContentHash(_0x589d99),{'dbName':_0x169b81}),_0x15efdf=_0xcc9ee9[_0x3ffb8f(0x18f)],_0x35b4ed=join(_0x382162[_0x3ffb8f(0x1bb)],_0x15efdf);try{if(await fileExists(_0x35b4ed)){const _0x279f33=await readFile(_0x35b4ed,_0x3ffb8f(0x1a2));if(isEquivalentPulledSqlFile(_0x279f33,_0x589d99,_0x50f1d5)){_0x5a0568[_0x3ffb8f(0x1bc)]({'sqlCode':_0x3ec058[_0x3ffb8f(0x189)],'reason':_0x3ffb8f(0x1a7)}),_0x1874ab[_0x3ffb8f(0x1a4)][_0x3ec058['sqlCode']]={..._0xcc9ee9,'hash':computeSqlContentHash(_0x279f33),'path':_0x15efdf};continue;}if(!_0xdef228){_0x5a0568[_0x3ffb8f(0x1bc)]({'sqlCode':_0x3ec058[_0x3ffb8f(0x189)],'reason':_0x3ffb8f(0x1a5)});continue;}}const _0x21aa0e=_0x52d333?.[_0x3ffb8f(0x18f)]?join(_0x382162['sqlRootDir'],_0x52d333[_0x3ffb8f(0x18f)]):undefined;_0x21aa0e&&_0x21aa0e!==_0x35b4ed&&await fileExists(_0x21aa0e)&&await rm(_0x21aa0e,{'force':!![]}),await ensureParentDirectory(_0x35b4ed),await writeFile(_0x35b4ed,_0x589d99,_0x3ffb8f(0x1a2)),_0x1874ab['sqls'][_0x3ec058['sqlCode']]={..._0xcc9ee9,'path':_0x15efdf},_0x596075[_0x3ffb8f(0x1bc)]({'sqlCode':_0x3ec058[_0x3ffb8f(0x189)],'filePath':_0x35b4ed});}catch(_0x21855a){_0x2eefd4['push']({'sqlCode':_0x3ec058[_0x3ffb8f(0x189)],'error':_0x21855a instanceof Error?_0x21855a[_0x3ffb8f(0x195)]:String(_0x21855a)});}}return _0x1874ab['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x382162[_0x3ffb8f(0x183)],_0x5dd235),{'ok':_0x2eefd4[_0x3ffb8f(0x187)]===0x0,'data':{'pulled':_0x596075,'skipped':_0x5a0568,'failed':_0x2eefd4},'message':_0x3ffb8f(0x1b8)+_0x596075['length']+_0x3ffb8f(0x1b0)+_0x5a0568[_0x3ffb8f(0x187)]+_0x3ffb8f(0x182)+_0x2eefd4[_0x3ffb8f(0x187)]+'\x20failed'};}};function detectModeFromSql(_0xaee7fd){const _0xf0038e=a176_0x3c2e27,_0x5636c5=ensureRemoteSqlContent(_0xaee7fd),_0xd11f52=stripLocalSqlMetadata(_0x5636c5,_0xf0038e(0x192))[_0xf0038e(0x199)]();if(/^<(select|insert|update|delete)\b/i[_0xf0038e(0x197)](_0xd11f52))return _0xf0038e(0x192);return _0xf0038e(0x1b1);}function isEquivalentPulledSqlFile(_0x200024,_0x19f7e8,_0x7e08c7){return normalizePullComparableContent(_0x200024,_0x7e08c7)===normalizePullComparableContent(_0x19f7e8,_0x7e08c7);}function normalizePullComparableContent(_0x4ed8f7,_0x1136d1){const _0xe715b3=a176_0x3c2e27,_0x3fa5da=_0x4ed8f7['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x3a3a1b=_0x3fa5da[_0xe715b3(0x1b5)](_0x166797=>!isSyncedAtMetadataLine(_0x166797,_0x1136d1));return _0x3a3a1b[_0xe715b3(0x1ba)]('\x0a');}function isSyncedAtMetadataLine(_0x3f5600,_0xbce9f6){const _0x29fc97=a176_0x3c2e27;if(_0xbce9f6===_0x29fc97(0x192))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x3f5600);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x29fc97(0x197)](_0x3f5600);}
@@ -1 +1 @@
1
- const a176_0x34404f=a176_0x4f09;(function(_0x4d41f7,_0x1cc348){const _0x532d39=a176_0x4f09,_0x10dca0=_0x4d41f7();while(!![]){try{const _0x4acc7a=parseInt(_0x532d39(0x14f))/0x1+-parseInt(_0x532d39(0x164))/0x2*(parseInt(_0x532d39(0x157))/0x3)+-parseInt(_0x532d39(0x148))/0x4*(-parseInt(_0x532d39(0x147))/0x5)+parseInt(_0x532d39(0x183))/0x6+parseInt(_0x532d39(0x149))/0x7+parseInt(_0x532d39(0x175))/0x8*(-parseInt(_0x532d39(0x185))/0x9)+-parseInt(_0x532d39(0x182))/0xa*(parseInt(_0x532d39(0x16a))/0xb);if(_0x4acc7a===_0x1cc348)break;else _0x10dca0['push'](_0x10dca0['shift']());}catch(_0x217247){_0x10dca0['push'](_0x10dca0['shift']());}}}(a176_0x3fd7,0x3e2a6));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';function a176_0x4f09(_0x4e020c,_0x1e7c02){_0x4e020c=_0x4e020c-0x144;const _0x3fd78d=a176_0x3fd7();let _0x4f097e=_0x3fd78d[_0x4e020c];return _0x4f097e;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';function a176_0x3fd7(){const _0x49ee4d=['61587TPOQpr','sqlRoot','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','remoteId','85YIonLl','11932znpadW','636692BnHNZa','isFinite','lockFilePath','No\x20local\x20SQL\x20files\x20found.','filePath','sqlcode','246854jqImYj','mode','trashDir','dbId','\x20SQL\x20file(s)','Would\x20push\x20','push','relativePath','6VRbtUh','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','sqls','boolean','bool','exec','validation','Push\x20complete:\x20','force','set','path','sql','unchanged','143508rTYZWE','appCode','dbName','str','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','Push\x20local\x20SQL\x20files\x20to\x20remote','361680PHkJJT','hash','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','version','sqlConfig','utf8','has','join','sqlRootDir','sqlName','startsWith','496LNxTpQ','lastSync','filter','entries','/smartapi/custom/updateUserCustomSql','Local\x20directory\x20\x22','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','catch','message','sqlCode','replace','length','map','10lzafWt','2800578whiLvG','\x20skipped,\x20'];a176_0x3fd7=function(){return _0x49ee4d;};return a176_0x3fd7();}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x4a36df,_0x34f4aa,_0x48f674){const _0x49b234=a176_0x4f09,_0x37af29=await scanLocalSqlQueries(_0x4a36df),_0x46bac6=new Map();for(const _0x51a043 of _0x37af29){if(_0x48f674&&_0x51a043['sqlCode']!==_0x48f674)continue;const _0x4fa177=_0x46bac6['get'](_0x51a043['sqlCode'])??[];_0x4fa177[_0x49b234(0x155)](_0x51a043),_0x46bac6[_0x49b234(0x160)](_0x51a043['sqlCode'],_0x4fa177);}if(_0x48f674&&!_0x46bac6[_0x49b234(0x170)](_0x48f674))throw CliErrors[_0x49b234(0x15d)]('Local\x20SQL\x20not\x20found:\x20'+_0x48f674);const _0x29b96f=[];for(const [_0x46c1d6,_0x8827af]of _0x46bac6[_0x49b234(0x178)]()){if(_0x8827af[_0x49b234(0x180)]===0x1){_0x29b96f['push'](_0x8827af[0x0]);continue;}const _0x1faa4a=_0x34f4aa[_0x49b234(0x159)][_0x46c1d6],_0x7ab372=_0x1faa4a?.[_0x49b234(0x161)],_0x18e426=_0x7ab372?_0x8827af[_0x49b234(0x177)](_0x403ac4=>_0x403ac4[_0x49b234(0x156)]!==_0x7ab372):_0x8827af;if(_0x1faa4a&&_0x18e426[_0x49b234(0x180)]===0x1){_0x29b96f[_0x49b234(0x155)](_0x18e426[0x0]);continue;}throw CliErrors[_0x49b234(0x15d)](_0x49b234(0x168)+_0x46c1d6+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x29b96f;}export const sqlPush={'service':a176_0x34404f(0x162),'command':a176_0x34404f(0x155),'description':a176_0x34404f(0x169),'risk':'high-risk-write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a176_0x34404f(0x15f),'type':a176_0x34404f(0x15a),'description':a176_0x34404f(0x158)}],async 'dryRun'(_0x5842b0){const _0x3cde6d=a176_0x34404f,_0x9f56a3=loadSqlProjectConfig(_0x5842b0[_0x3cde6d(0x165)]),_0x3b4283=await readSqlLockFile(_0x9f56a3['lockFilePath']),{appLock:_0x146c8a}=ensureSqlLockScope(_0x3b4283??createEmptySqlLock(),_0x5842b0['appCode'],_0x9f56a3[_0x3cde6d(0x144)],_0x3cde6d(0x155)),_0x1d6126=await getTargetSqlQueries(_0x9f56a3,_0x146c8a,_0x5842b0[_0x3cde6d(0x167)]('sqlcode')||undefined),_0x596054=[];for(const _0xb76020 of _0x1d6126){const _0x562513=await computeSqlFileHash(_0xb76020[_0x3cde6d(0x14d)]),_0x51e937=_0x146c8a[_0x3cde6d(0x159)][_0xb76020[_0x3cde6d(0x17e)]],_0x1f81fd=!!_0x51e937&&(_0x51e937[_0x3cde6d(0x161)]!==_0xb76020[_0x3cde6d(0x156)]||!!_0xb76020[_0x3cde6d(0x173)]&&_0x51e937[_0x3cde6d(0x173)]!==_0xb76020[_0x3cde6d(0x173)]);if(!_0x5842b0[_0x3cde6d(0x15b)](_0x3cde6d(0x15f))&&_0x51e937&&_0x51e937['hash']===_0x562513&&!_0x1f81fd)continue;_0x596054['push'](_0xb76020[_0x3cde6d(0x17e)]);}return{'method':'POST','url':_0x3cde6d(0x179),'body':{'sqlCodes':_0x596054,'appCode':_0x5842b0[_0x3cde6d(0x165)]},'description':_0x3cde6d(0x154)+_0x596054['length']+_0x3cde6d(0x153)};},async 'execute'(_0x5d9c72){const _0x3fcf13=a176_0x34404f,_0xda5cc8=loadSqlProjectConfig(_0x5d9c72[_0x3fcf13(0x165)]),_0x472b71=await readSqlLockFile(_0xda5cc8['lockFilePath']),{lockData:_0x59f037,appLock:_0x10ced8}=ensureSqlLockScope(_0x472b71??createEmptySqlLock(),_0x5d9c72[_0x3fcf13(0x165)],_0xda5cc8['sqlRoot'],_0x3fcf13(0x155)),_0x15edba=await getTargetSqlQueries(_0xda5cc8,_0x10ced8,_0x5d9c72[_0x3fcf13(0x167)](_0x3fcf13(0x14e))||undefined);if(_0x15edba[_0x3fcf13(0x180)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x3fcf13(0x14c)};const _0x54eb35=[],_0x1738be=[],_0x185005=[];for(const _0x496e3c of _0x15edba){const _0x4911fb=_0x10ced8[_0x3fcf13(0x159)][_0x496e3c[_0x3fcf13(0x17e)]];if(!_0x4911fb){_0x185005[_0x3fcf13(0x155)]({'sqlCode':_0x496e3c[_0x3fcf13(0x17e)],'error':_0x3fcf13(0x145)});continue;}try{const _0x536e4b=await computeSqlFileHash(_0x496e3c[_0x3fcf13(0x14d)]),_0x337054=_0x4911fb['path']!==_0x496e3c[_0x3fcf13(0x156)]||!!_0x496e3c[_0x3fcf13(0x173)]&&_0x4911fb[_0x3fcf13(0x173)]!==_0x496e3c[_0x3fcf13(0x173)];if(!_0x5d9c72[_0x3fcf13(0x15b)](_0x3fcf13(0x15f))&&_0x4911fb[_0x3fcf13(0x16b)]===_0x536e4b&&!_0x337054){_0x1738be[_0x3fcf13(0x155)]({'sqlCode':_0x496e3c[_0x3fcf13(0x17e)],'reason':_0x3fcf13(0x163)});continue;}if(_0x4911fb['version']==null){_0x185005[_0x3fcf13(0x155)]({'sqlCode':_0x496e3c['sqlCode'],'error':_0x3fcf13(0x16c)});continue;}const _0x23b352=await readFile(_0x496e3c[_0x3fcf13(0x14d)],_0x3fcf13(0x16f)),_0x47dcac=stripLocalSqlMetadata(_0x23b352,_0x496e3c['mode']),_0x4dc4e3=_0x496e3c['sqlName']||_0x4911fb[_0x3fcf13(0x173)],_0x4e2b50=await resolveTargetDbBinding(_0x5d9c72[_0x3fcf13(0x165)],_0x496e3c,_0x4911fb),_0x2402a8=await updateSqlQuery({'id':_0x4911fb[_0x3fcf13(0x146)],'appCode':_0x5d9c72[_0x3fcf13(0x165)],'sqlCode':_0x496e3c['sqlCode'],'sqlName':_0x4dc4e3,'dbId':_0x4e2b50[_0x3fcf13(0x152)],'version':_0x4911fb[_0x3fcf13(0x16d)],'sqlContent':_0x47dcac,'sqlConfig':_0x4911fb[_0x3fcf13(0x16e)]??undefined}),_0x373984=_0x2402a8[_0x3fcf13(0x152)]?await getDbName(_0x5d9c72[_0x3fcf13(0x165)],Number(_0x2402a8[_0x3fcf13(0x152)]))['catch'](()=>_0x4e2b50[_0x3fcf13(0x166)]):_0x4e2b50['dbName'];_0x10ced8[_0x3fcf13(0x159)][_0x496e3c[_0x3fcf13(0x17e)]]={...buildSqlLockEntry(_0x2402a8,_0x47dcac,_0x536e4b,{'dbName':_0x373984}),'path':_0x496e3c[_0x3fcf13(0x156)],'mode':_0x4911fb[_0x3fcf13(0x150)]},await archivePreviousSqlFileIfNeeded(_0xda5cc8,_0x4911fb['path'],_0x496e3c['relativePath']),_0x54eb35[_0x3fcf13(0x155)]({'sqlCode':_0x496e3c['sqlCode'],'remoteId':_0x4911fb[_0x3fcf13(0x146)]});}catch(_0x1fbc7c){_0x185005['push']({'sqlCode':_0x496e3c[_0x3fcf13(0x17e)],'error':_0x1fbc7c instanceof Error?_0x1fbc7c[_0x3fcf13(0x17d)]:String(_0x1fbc7c)});}}return _0x10ced8[_0x3fcf13(0x176)]=new Date()['toISOString'](),await writeSqlLockFile(_0xda5cc8[_0x3fcf13(0x14b)],_0x59f037),{'ok':_0x185005[_0x3fcf13(0x180)]===0x0,'data':{'pushed':_0x54eb35,'skipped':_0x1738be,'failed':_0x185005},'message':_0x3fcf13(0x15e)+_0x54eb35[_0x3fcf13(0x180)]+'\x20pushed,\x20'+_0x1738be[_0x3fcf13(0x180)]+_0x3fcf13(0x184)+_0x185005[_0x3fcf13(0x180)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x379fe2,_0x5f0845,_0x37b4f0){const _0x3eb492=a176_0x34404f;if(!_0x5f0845||_0x5f0845===_0x37b4f0)return;const _0x1ad543=join(_0x379fe2['sqlRootDir'],_0x5f0845);if(!await fileExists(_0x1ad543))return;const _0x27d07c=await moveToTrash(_0x379fe2['projectRoot'],_0x379fe2[_0x3eb492(0x151)],_0x1ad543);await cleanupEmptyDirectories(dirname(_0x1ad543),_0x379fe2[_0x3eb492(0x172)]),void _0x27d07c;}async function moveToTrash(_0x957c49,_0x40bd99,_0x22f87e){const _0x1ecbc3=a176_0x34404f,_0x3fff24=new Date()['toISOString']()[_0x1ecbc3(0x17f)](/[:.]/g,'-'),_0x5b9b24=relative(_0x957c49,_0x22f87e),_0x11dd43=join(_0x40bd99,_0x3fff24,_0x5b9b24);return await mkdir(dirname(_0x11dd43),{'recursive':!![]}),await rename(_0x22f87e,_0x11dd43),_0x11dd43;}async function cleanupEmptyDirectories(_0x125f16,_0x516dbd){const _0x2831e8=a176_0x34404f;let _0x24236a=resolve(_0x125f16);const _0x342a89=resolve(_0x516dbd);while(_0x24236a[_0x2831e8(0x174)](''+_0x342a89+sep)||_0x24236a===_0x342a89){if(_0x24236a===_0x342a89)return;try{const _0xe8c8b5=await readdir(_0x24236a);if(_0xe8c8b5[_0x2831e8(0x180)]>0x0)return;await rmdir(_0x24236a);}catch{return;}_0x24236a=dirname(_0x24236a);}}async function resolveTargetDbBinding(_0xe9a658,_0x1ed5ea,_0x426e2d){const _0x3ce4fa=a176_0x34404f,_0x23af5d=_0x1ed5ea['dbDirectory'];if(!_0x23af5d)return{'dbId':_0x426e2d[_0x3ce4fa(0x152)],'dbName':_0x426e2d[_0x3ce4fa(0x166)]};const _0x4208d9=buildDbDirectoryName(_0x426e2d['dbName'],_0x426e2d['dbId']);if(_0x23af5d===_0x4208d9)return{'dbId':_0x426e2d[_0x3ce4fa(0x152)],'dbName':_0x426e2d[_0x3ce4fa(0x166)]};const _0x1da198=parseExplicitDbDirectory(_0x23af5d);if(_0x1da198!=null)return{'dbId':_0x1da198,'dbName':await getDbName(_0xe9a658,_0x1da198)[_0x3ce4fa(0x17c)](()=>undefined)};const _0x2aea3c=await listDatabases(_0xe9a658),_0x4de116=_0x2aea3c['filter'](_0x540373=>buildDbDirectoryName(_0x540373[_0x3ce4fa(0x166)],_0x540373[_0x3ce4fa(0x152)])===_0x23af5d);if(_0x4de116[_0x3ce4fa(0x180)]===0x1)return{'dbId':_0x4de116[0x0]['dbId'],'dbName':_0x4de116[0x0][_0x3ce4fa(0x166)]};if(_0x4de116[_0x3ce4fa(0x180)]===0x0)throw CliErrors['validation']('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x23af5d+'\x22\x20for\x20sqlCode\x20'+_0x1ed5ea['sqlCode']+'.');const _0x27d4cc=_0x4de116[_0x3ce4fa(0x181)](_0x33799f=>_0x33799f[_0x3ce4fa(0x166)]+'\x20('+_0x33799f[_0x3ce4fa(0x152)]+')')[_0x3ce4fa(0x171)](',\x20');throw CliErrors['validation'](_0x3ce4fa(0x17a)+_0x23af5d+_0x3ce4fa(0x17b)+_0x1ed5ea[_0x3ce4fa(0x17e)]+':\x20'+_0x27d4cc);}function parseExplicitDbDirectory(_0x210b3d){const _0x50d27b=a176_0x34404f,_0xef8691=/^db-(\d+)$/[_0x50d27b(0x15c)](_0x210b3d);if(!_0xef8691)return null;const _0x943557=Number(_0xef8691[0x1]);return Number[_0x50d27b(0x14a)](_0x943557)&&_0x943557>0x0?_0x943557:null;}
1
+ const a177_0x44466a=a177_0x5eef;(function(_0x1e2690,_0x4455d1){const _0x53d366=a177_0x5eef,_0x149689=_0x1e2690();while(!![]){try{const _0x28ae3b=parseInt(_0x53d366(0x17d))/0x1+parseInt(_0x53d366(0x1a7))/0x2+-parseInt(_0x53d366(0x199))/0x3*(-parseInt(_0x53d366(0x189))/0x4)+-parseInt(_0x53d366(0x19d))/0x5*(parseInt(_0x53d366(0x18d))/0x6)+-parseInt(_0x53d366(0x1ae))/0x7+-parseInt(_0x53d366(0x187))/0x8+-parseInt(_0x53d366(0x1b3))/0x9;if(_0x28ae3b===_0x4455d1)break;else _0x149689['push'](_0x149689['shift']());}catch(_0x33d7d6){_0x149689['push'](_0x149689['shift']());}}}(a177_0x3083,0x30f71));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a177_0x5eef(_0x473bf6,_0x3f56af){_0x473bf6=_0x473bf6-0x179;const _0x308331=a177_0x3083();let _0x5eef2e=_0x308331[_0x473bf6];return _0x5eef2e;}import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';function a177_0x3083(){const _0x60b8fc=['relativePath','version','330696ydHILk','boolean','\x22\x20for\x20sqlCode\x20','sqlcode','dbDirectory','toISOString','Push\x20local\x20SQL\x20files\x20to\x20remote','1175804nVfJTK','sqlRoot','dbName','projectRoot','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','2108556gqbvoq','sqlCode','\x20SQL\x20file(s)','sqlConfig','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','No\x20local\x20SQL\x20files\x20found.','331407tGhzdN','Local\x20SQL\x20not\x20found:\x20','catch','path','sqlName','replace','dbId','message','\x20failed','sql','2115472GColHs','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','297892lIrBHA','join','appCode','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','534aOEkeu','length','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','hash','No\x20database\x20matches\x20local\x20directory\x20\x22','mode','utf8','push','map','has','filter','\x20pushed,\x20','15QFgDcG','force','unchanged','sqls','105QRFXLz','exec','filePath','validation','set','startsWith','sqlRootDir','remoteId'];a177_0x3083=function(){return _0x60b8fc;};return a177_0x3083();}import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x2b10e6,_0xfa4e5f,_0x364297){const _0x34dd54=a177_0x5eef,_0x599509=await scanLocalSqlQueries(_0x2b10e6),_0x420aa1=new Map();for(const _0x411a53 of _0x599509){if(_0x364297&&_0x411a53[_0x34dd54(0x1b4)]!==_0x364297)continue;const _0x40c1b5=_0x420aa1['get'](_0x411a53[_0x34dd54(0x1b4)])??[];_0x40c1b5[_0x34dd54(0x194)](_0x411a53),_0x420aa1[_0x34dd54(0x1a1)](_0x411a53['sqlCode'],_0x40c1b5);}if(_0x364297&&!_0x420aa1[_0x34dd54(0x196)](_0x364297))throw CliErrors['validation'](_0x34dd54(0x17e)+_0x364297);const _0x349f4f=[];for(const [_0x36915c,_0x335a7a]of _0x420aa1['entries']()){if(_0x335a7a[_0x34dd54(0x18e)]===0x1){_0x349f4f['push'](_0x335a7a[0x0]);continue;}const _0x1e6b10=_0xfa4e5f[_0x34dd54(0x19c)][_0x36915c],_0x1b610e=_0x1e6b10?.[_0x34dd54(0x180)],_0x5b6fea=_0x1b610e?_0x335a7a['filter'](_0x4c28ca=>_0x4c28ca[_0x34dd54(0x1a5)]!==_0x1b610e):_0x335a7a;if(_0x1e6b10&&_0x5b6fea[_0x34dd54(0x18e)]===0x1){_0x349f4f[_0x34dd54(0x194)](_0x5b6fea[0x0]);continue;}throw CliErrors[_0x34dd54(0x1a0)](_0x34dd54(0x188)+_0x36915c+_0x34dd54(0x18c));}return _0x349f4f;}export const sqlPush={'service':a177_0x44466a(0x186),'command':a177_0x44466a(0x194),'description':a177_0x44466a(0x1ad),'risk':'high-risk-write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a177_0x44466a(0x19a),'type':a177_0x44466a(0x1a8),'description':a177_0x44466a(0x18f)}],async 'dryRun'(_0x5d733e){const _0x58cbe1=a177_0x44466a,_0x37890c=loadSqlProjectConfig(_0x5d733e['appCode']),_0x412b54=await readSqlLockFile(_0x37890c['lockFilePath']),{appLock:_0x55467d}=ensureSqlLockScope(_0x412b54??createEmptySqlLock(),_0x5d733e[_0x58cbe1(0x18b)],_0x37890c[_0x58cbe1(0x1af)],'push'),_0x38ea24=await getTargetSqlQueries(_0x37890c,_0x55467d,_0x5d733e['str'](_0x58cbe1(0x1aa))||undefined),_0x36b66e=[];for(const _0x9d270f of _0x38ea24){const _0xa00ffb=await computeSqlFileHash(_0x9d270f[_0x58cbe1(0x19f)]),_0x17f971=_0x55467d[_0x58cbe1(0x19c)][_0x9d270f['sqlCode']],_0x15bd15=!!_0x17f971&&(_0x17f971['path']!==_0x9d270f[_0x58cbe1(0x1a5)]||!!_0x9d270f[_0x58cbe1(0x181)]&&_0x17f971[_0x58cbe1(0x181)]!==_0x9d270f[_0x58cbe1(0x181)]);if(!_0x5d733e['bool'](_0x58cbe1(0x19a))&&_0x17f971&&_0x17f971[_0x58cbe1(0x190)]===_0xa00ffb&&!_0x15bd15)continue;_0x36b66e[_0x58cbe1(0x194)](_0x9d270f['sqlCode']);}return{'method':'POST','url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x36b66e,'appCode':_0x5d733e[_0x58cbe1(0x18b)]},'description':'Would\x20push\x20'+_0x36b66e['length']+_0x58cbe1(0x179)};},async 'execute'(_0x1fa592){const _0x402ae7=a177_0x44466a,_0xbeb829=loadSqlProjectConfig(_0x1fa592[_0x402ae7(0x18b)]),_0xffe08f=await readSqlLockFile(_0xbeb829['lockFilePath']),{lockData:_0x4712db,appLock:_0x5d25b2}=ensureSqlLockScope(_0xffe08f??createEmptySqlLock(),_0x1fa592['appCode'],_0xbeb829[_0x402ae7(0x1af)],_0x402ae7(0x194)),_0x411a40=await getTargetSqlQueries(_0xbeb829,_0x5d25b2,_0x1fa592['str'](_0x402ae7(0x1aa))||undefined);if(_0x411a40[_0x402ae7(0x18e)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x402ae7(0x17c)};const _0x271868=[],_0x5177a6=[],_0x120ff9=[];for(const _0x1cde17 of _0x411a40){const _0x5c8cb6=_0x5d25b2[_0x402ae7(0x19c)][_0x1cde17['sqlCode']];if(!_0x5c8cb6){_0x120ff9['push']({'sqlCode':_0x1cde17[_0x402ae7(0x1b4)],'error':_0x402ae7(0x1b2)});continue;}try{const _0x4212c7=await computeSqlFileHash(_0x1cde17[_0x402ae7(0x19f)]),_0x83cb35=_0x5c8cb6[_0x402ae7(0x180)]!==_0x1cde17[_0x402ae7(0x1a5)]||!!_0x1cde17['sqlName']&&_0x5c8cb6[_0x402ae7(0x181)]!==_0x1cde17[_0x402ae7(0x181)];if(!_0x1fa592['bool'](_0x402ae7(0x19a))&&_0x5c8cb6[_0x402ae7(0x190)]===_0x4212c7&&!_0x83cb35){_0x5177a6[_0x402ae7(0x194)]({'sqlCode':_0x1cde17[_0x402ae7(0x1b4)],'reason':_0x402ae7(0x19b)});continue;}if(_0x5c8cb6[_0x402ae7(0x1a6)]==null){_0x120ff9[_0x402ae7(0x194)]({'sqlCode':_0x1cde17[_0x402ae7(0x1b4)],'error':_0x402ae7(0x17b)});continue;}const _0x206d86=await readFile(_0x1cde17[_0x402ae7(0x19f)],_0x402ae7(0x193)),_0x14f958=stripLocalSqlMetadata(_0x206d86,_0x1cde17[_0x402ae7(0x192)]),_0x409e1c=_0x1cde17[_0x402ae7(0x181)]||_0x5c8cb6[_0x402ae7(0x181)],_0x49fe3f=await resolveTargetDbBinding(_0x1fa592[_0x402ae7(0x18b)],_0x1cde17,_0x5c8cb6),_0x2e1ff9=await updateSqlQuery({'id':_0x5c8cb6[_0x402ae7(0x1a4)],'appCode':_0x1fa592[_0x402ae7(0x18b)],'sqlCode':_0x1cde17[_0x402ae7(0x1b4)],'sqlName':_0x409e1c,'dbId':_0x49fe3f[_0x402ae7(0x183)],'version':_0x5c8cb6[_0x402ae7(0x1a6)],'sqlContent':_0x14f958,'sqlConfig':_0x5c8cb6[_0x402ae7(0x17a)]??undefined}),_0x367913=_0x2e1ff9[_0x402ae7(0x183)]?await getDbName(_0x1fa592[_0x402ae7(0x18b)],Number(_0x2e1ff9[_0x402ae7(0x183)]))[_0x402ae7(0x17f)](()=>_0x49fe3f[_0x402ae7(0x1b0)]):_0x49fe3f[_0x402ae7(0x1b0)];_0x5d25b2[_0x402ae7(0x19c)][_0x1cde17['sqlCode']]={...buildSqlLockEntry(_0x2e1ff9,_0x14f958,_0x4212c7,{'dbName':_0x367913}),'path':_0x1cde17['relativePath'],'mode':_0x5c8cb6['mode']},await archivePreviousSqlFileIfNeeded(_0xbeb829,_0x5c8cb6['path'],_0x1cde17[_0x402ae7(0x1a5)]),_0x271868['push']({'sqlCode':_0x1cde17[_0x402ae7(0x1b4)],'remoteId':_0x5c8cb6['remoteId']});}catch(_0x457fec){_0x120ff9[_0x402ae7(0x194)]({'sqlCode':_0x1cde17['sqlCode'],'error':_0x457fec instanceof Error?_0x457fec[_0x402ae7(0x184)]:String(_0x457fec)});}}return _0x5d25b2['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0xbeb829['lockFilePath'],_0x4712db),{'ok':_0x120ff9['length']===0x0,'data':{'pushed':_0x271868,'skipped':_0x5177a6,'failed':_0x120ff9},'message':'Push\x20complete:\x20'+_0x271868[_0x402ae7(0x18e)]+_0x402ae7(0x198)+_0x5177a6['length']+'\x20skipped,\x20'+_0x120ff9['length']+_0x402ae7(0x185)};}};async function archivePreviousSqlFileIfNeeded(_0x2ee7eb,_0xa577bd,_0x3cde76){const _0x2fc753=a177_0x44466a;if(!_0xa577bd||_0xa577bd===_0x3cde76)return;const _0x17843e=join(_0x2ee7eb['sqlRootDir'],_0xa577bd);if(!await fileExists(_0x17843e))return;const _0x4dd00f=await moveToTrash(_0x2ee7eb[_0x2fc753(0x1b1)],_0x2ee7eb['trashDir'],_0x17843e);await cleanupEmptyDirectories(dirname(_0x17843e),_0x2ee7eb[_0x2fc753(0x1a3)]),void _0x4dd00f;}async function moveToTrash(_0x568977,_0x291f3a,_0x49a051){const _0x48911b=a177_0x44466a,_0xcc28c7=new Date()[_0x48911b(0x1ac)]()[_0x48911b(0x182)](/[:.]/g,'-'),_0x1c5b8b=relative(_0x568977,_0x49a051),_0x3cc007=join(_0x291f3a,_0xcc28c7,_0x1c5b8b);return await mkdir(dirname(_0x3cc007),{'recursive':!![]}),await rename(_0x49a051,_0x3cc007),_0x3cc007;}async function cleanupEmptyDirectories(_0x5ef314,_0x168da1){const _0xc91aaf=a177_0x44466a;let _0x1697c8=resolve(_0x5ef314);const _0x1e285c=resolve(_0x168da1);while(_0x1697c8[_0xc91aaf(0x1a2)](''+_0x1e285c+sep)||_0x1697c8===_0x1e285c){if(_0x1697c8===_0x1e285c)return;try{const _0x26648d=await readdir(_0x1697c8);if(_0x26648d[_0xc91aaf(0x18e)]>0x0)return;await rmdir(_0x1697c8);}catch{return;}_0x1697c8=dirname(_0x1697c8);}}async function resolveTargetDbBinding(_0xe5a241,_0x5ae420,_0x4d1fa0){const _0x486c5c=a177_0x44466a,_0x551d6f=_0x5ae420[_0x486c5c(0x1ab)];if(!_0x551d6f)return{'dbId':_0x4d1fa0[_0x486c5c(0x183)],'dbName':_0x4d1fa0[_0x486c5c(0x1b0)]};const _0x5967d5=buildDbDirectoryName(_0x4d1fa0[_0x486c5c(0x1b0)],_0x4d1fa0['dbId']);if(_0x551d6f===_0x5967d5)return{'dbId':_0x4d1fa0['dbId'],'dbName':_0x4d1fa0[_0x486c5c(0x1b0)]};const _0x1f0046=parseExplicitDbDirectory(_0x551d6f);if(_0x1f0046!=null)return{'dbId':_0x1f0046,'dbName':await getDbName(_0xe5a241,_0x1f0046)['catch'](()=>undefined)};const _0x4de14a=await listDatabases(_0xe5a241),_0x2b37db=_0x4de14a[_0x486c5c(0x197)](_0x4db486=>buildDbDirectoryName(_0x4db486['dbName'],_0x4db486[_0x486c5c(0x183)])===_0x551d6f);if(_0x2b37db[_0x486c5c(0x18e)]===0x1)return{'dbId':_0x2b37db[0x0][_0x486c5c(0x183)],'dbName':_0x2b37db[0x0][_0x486c5c(0x1b0)]};if(_0x2b37db['length']===0x0)throw CliErrors[_0x486c5c(0x1a0)](_0x486c5c(0x191)+_0x551d6f+_0x486c5c(0x1a9)+_0x5ae420['sqlCode']+'.');const _0x59297c=_0x2b37db[_0x486c5c(0x195)](_0x2f7802=>_0x2f7802[_0x486c5c(0x1b0)]+'\x20('+_0x2f7802['dbId']+')')[_0x486c5c(0x18a)](',\x20');throw CliErrors[_0x486c5c(0x1a0)]('Local\x20directory\x20\x22'+_0x551d6f+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x5ae420['sqlCode']+':\x20'+_0x59297c);}function parseExplicitDbDirectory(_0x5d8b3c){const _0x5d52a2=a177_0x44466a,_0x3c49a9=/^db-(\d+)$/[_0x5d52a2(0x19e)](_0x5d8b3c);if(!_0x3c49a9)return null;const _0x159452=Number(_0x3c49a9[0x1]);return Number['isFinite'](_0x159452)&&_0x159452>0x0?_0x159452:null;}
@@ -1 +1 @@
1
- function a177_0x3745(_0x5ef9b5,_0x1bdb66){_0x5ef9b5=_0x5ef9b5-0xcc;const _0x53fb45=a177_0x53fb();let _0x374593=_0x53fb45[_0x5ef9b5];return _0x374593;}const a177_0x1f5209=a177_0x3745;(function(_0x278b09,_0x2710b3){const _0x56a121=a177_0x3745,_0x57c7e7=_0x278b09();while(!![]){try{const _0x1fb6af=-parseInt(_0x56a121(0xd9))/0x1+parseInt(_0x56a121(0xdc))/0x2+parseInt(_0x56a121(0xde))/0x3*(parseInt(_0x56a121(0xd6))/0x4)+parseInt(_0x56a121(0xdd))/0x5*(parseInt(_0x56a121(0xd2))/0x6)+-parseInt(_0x56a121(0xcf))/0x7+-parseInt(_0x56a121(0xe1))/0x8*(-parseInt(_0x56a121(0xda))/0x9)+-parseInt(_0x56a121(0xcd))/0xa*(parseInt(_0x56a121(0xcc))/0xb);if(_0x1fb6af===_0x2710b3)break;else _0x57c7e7['push'](_0x57c7e7['shift']());}catch(_0x1e129c){_0x57c7e7['push'](_0x57c7e7['shift']());}}}(a177_0x53fb,0x97fca));function a177_0x53fb(){const _0x1cbfc3=['string','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','Query\x20description','86788uovGng','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','Path\x20to\x20the\x20SQL\x20file','639513kGtGDB','36fGtNLM','save','341258PvmxWc','5261230GYBnRK','84UJkwfc','file','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`.','836536qkEgBx','write','sqlname','validation','1045lmVASZ','47030fZZPUn','SQL\x20query\x20display\x20name','3778761DRiShv','sql','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','6nMjDTQ'];a177_0x53fb=function(){return _0x1cbfc3;};return a177_0x53fb();}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a177_0x1f5209(0xd1),a177_0x1f5209(0xd7),a177_0x1f5209(0xe0)]['join']('\x0a');export const sqlSave={'service':a177_0x1f5209(0xd0),'command':a177_0x1f5209(0xdb),'description':'Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','risk':a177_0x1f5209(0xe2),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a177_0x1f5209(0xdf),'type':a177_0x1f5209(0xd3),'required':!![],'description':a177_0x1f5209(0xd8)},SQLCODE_FLAG_OPTIONAL,{'name':a177_0x1f5209(0xe3),'type':a177_0x1f5209(0xd3),'description':a177_0x1f5209(0xce)},{'name':'db','type':a177_0x1f5209(0xd3),'description':a177_0x1f5209(0xd4)},{'name':'description','type':a177_0x1f5209(0xd3),'description':a177_0x1f5209(0xd5)}],async 'validate'(){const _0x3eb405=a177_0x1f5209;throw CliErrors[_0x3eb405(0xe4)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x433c38=a177_0x1f5209;throw CliErrors[_0x433c38(0xe4)](SQL_SAVE_DEPRECATED_HINT);}};
1
+ const a178_0x424f65=a178_0x365e;(function(_0x4dc063,_0xe5d824){const _0x3db889=a178_0x365e,_0x4c863e=_0x4dc063();while(!![]){try{const _0x3179fc=-parseInt(_0x3db889(0x1d9))/0x1*(-parseInt(_0x3db889(0x1d3))/0x2)+-parseInt(_0x3db889(0x1dd))/0x3*(-parseInt(_0x3db889(0x1d0))/0x4)+parseInt(_0x3db889(0x1e0))/0x5*(-parseInt(_0x3db889(0x1d7))/0x6)+-parseInt(_0x3db889(0x1dc))/0x7*(parseInt(_0x3db889(0x1d2))/0x8)+parseInt(_0x3db889(0x1df))/0x9+parseInt(_0x3db889(0x1d6))/0xa*(-parseInt(_0x3db889(0x1d8))/0xb)+parseInt(_0x3db889(0x1d4))/0xc;if(_0x3179fc===_0xe5d824)break;else _0x4c863e['push'](_0x4c863e['shift']());}catch(_0x2f4874){_0x4c863e['push'](_0x4c863e['shift']());}}}(a178_0x25c8,0x50c69));import{CliErrors}from'../../errors.js';function a178_0x365e(_0x25839a,_0x4f34a2){_0x25839a=_0x25839a-0x1ca;const _0x25c858=a178_0x25c8();let _0x365e49=_0x25c858[_0x25839a];return _0x365e49;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a178_0x25c8(){const _0x397d26=['12xlTIWg','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`.','40nOyjAP','7080UFgsHa','7981596hyBSai','validation','1790ZjCfSS','6WPugsN','36619ApOiUg','1WlsmnN','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','string','870121opZaGU','410853jZhCRf','sqlname','5188230dvCLmN','538665wZQlSZ','Query\x20description','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','Path\x20to\x20the\x20SQL\x20file','save','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update'];a178_0x25c8=function(){return _0x397d26;};return a178_0x25c8();}const SQL_SAVE_DEPRECATED_HINT=[a178_0x424f65(0x1cc),a178_0x424f65(0x1cb),a178_0x424f65(0x1d1)]['join']('\x0a');export const sqlSave={'service':'sql','command':a178_0x424f65(0x1ce),'description':a178_0x424f65(0x1cf),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'file','type':'string','required':!![],'description':a178_0x424f65(0x1cd)},SQLCODE_FLAG_OPTIONAL,{'name':a178_0x424f65(0x1de),'type':a178_0x424f65(0x1db),'description':'SQL\x20query\x20display\x20name'},{'name':'db','type':'string','description':a178_0x424f65(0x1da)},{'name':'description','type':a178_0x424f65(0x1db),'description':a178_0x424f65(0x1ca)}],async 'validate'(){const _0x3d86c3=a178_0x424f65;throw CliErrors[_0x3d86c3(0x1d5)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x1a370c=a178_0x424f65;throw CliErrors[_0x1a370c(0x1d5)](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- const a178_0x558815=a178_0xaaf8;(function(_0x4ba46,_0x3ddfff){const _0x1342c3=a178_0xaaf8,_0x208f2d=_0x4ba46();while(!![]){try{const _0x49c46a=parseInt(_0x1342c3(0x19f))/0x1*(-parseInt(_0x1342c3(0x195))/0x2)+-parseInt(_0x1342c3(0x192))/0x3*(parseInt(_0x1342c3(0x19d))/0x4)+parseInt(_0x1342c3(0x19a))/0x5*(parseInt(_0x1342c3(0x199))/0x6)+-parseInt(_0x1342c3(0x1b1))/0x7*(-parseInt(_0x1342c3(0x1a7))/0x8)+parseInt(_0x1342c3(0x1ac))/0x9+parseInt(_0x1342c3(0x18c))/0xa+-parseInt(_0x1342c3(0x18b))/0xb;if(_0x49c46a===_0x3ddfff)break;else _0x208f2d['push'](_0x208f2d['shift']());}catch(_0x2b691e){_0x208f2d['push'](_0x208f2d['shift']());}}}(a178_0x3b2b,0x5c813));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';function a178_0xaaf8(_0x92b42b,_0x474207){_0x92b42b=_0x92b42b-0x18b;const _0x3b2b57=a178_0x3b2b();let _0xaaf8be=_0x3b2b57[_0x92b42b];return _0xaaf8be;}export const SQL_LOCAL_REL_DIR=a178_0x558815(0x1ad);export function buildSqlLockEntry(_0x2eb13e,_0x2e3457,_0xc5c5c9,_0x5be135){const _0x5da681=a178_0x558815,_0x4cc6bb=detectSqlMode(_0x2e3457);return{'path':buildSqlRelativePath(_0x2eb13e['sqlCode'],_0x2eb13e[_0x5da681(0x18e)],_0x5be135?.[_0x5da681(0x1af)],_0x4cc6bb,_0x2eb13e['dbId']),'hash':_0xc5c5c9,'remoteId':_0x2eb13e['id'],'version':_0x2eb13e['version'],'dbId':Number(_0x2eb13e[_0x5da681(0x1b2)]),'dbName':_0x5be135?.['dbName'],'sqlName':_0x2eb13e[_0x5da681(0x18e)],'sqlConfig':_0x2eb13e[_0x5da681(0x1b5)]??undefined,'mode':_0x4cc6bb};}export function cloneSqlLockData(_0x43859b){const _0x32d4a3=a178_0x558815;return{'apps':Object['fromEntries'](Object[_0x32d4a3(0x1a1)](_0x43859b[_0x32d4a3(0x1a0)])[_0x32d4a3(0x1a5)](([_0x1d1b73,_0x2db63a])=>[_0x1d1b73,{'sqlRoot':_0x2db63a[_0x32d4a3(0x1a3)],'lastSync':_0x2db63a['lastSync'],'sqls':{..._0x2db63a[_0x32d4a3(0x194)]}}]))};}export function ensureRemoteSqlContent(_0x2ab097){return _0x2ab097['sqlContent']??'';}export function buildLocalSqlFileContent(_0x50c177,_0x1e6ec6,_0x575ac7){const _0x3303fa=a178_0x558815,_0x202834=_0x575ac7?.[_0x3303fa(0x1a6)]??detectSqlMode(_0x1e6ec6),_0x434b6e=stripLocalSqlMetadata(_0x1e6ec6,_0x202834)[_0x3303fa(0x1a4)](),_0x320513=[...buildMetadataHeaderLines({'sqlCode':_0x50c177[_0x3303fa(0x19b)],'sqlName':_0x50c177[_0x3303fa(0x18e)],'dbId':_0x50c177['dbId'],'dbName':_0x575ac7?.['dbName'],'mode':_0x202834,'syncedAt':_0x575ac7?.['syncedAt'],'description':_0x575ac7?.[_0x3303fa(0x1ab)]},_0x202834),'',_0x434b6e],_0x33dadc=_0x320513[_0x3303fa(0x197)]('\x0a');return _0x33dadc['endsWith']('\x0a')?_0x33dadc:_0x33dadc+'\x0a';}function a178_0x3b2b(){const _0x5aa9f9=['mode','56bakaCe','path','\x20-->','stderr','description','6530571fFLrtm','.rabetbase/sql','includes','dbName','close','476994pmetUd','dbId','trimStart','length','sqlConfig','10482846GAqfHB','7133940EGvfqa','replace','sqlName','test','syncedAt','filter','309UweWsZ','yes','sqls','1520DioVkt','question','join','stdin','6TmozzZ','1945145KXCgUd','sqlCode','push','11908AUZvpE','mybatisXml','877gRruDT','apps','entries','toLowerCase','sqlRoot','trim','map'];a178_0x3b2b=function(){return _0x5aa9f9;};return a178_0x3b2b();}export function stripLocalSqlMetadata(_0x9344d0,_0x33af85){const _0x517e58=a178_0x558815,_0x21f01e=_0x9344d0[_0x517e58(0x18d)](/\r\n/g,'\x0a')['split']('\x0a'),_0x530f96=[];let _0x9c0281=0x0;if(_0x33af85===_0x517e58(0x19e))while(_0x9c0281<_0x21f01e[_0x517e58(0x1b4)]){const _0x41fae6=_0x21f01e[_0x9c0281]??'';if(/^\s*<!--\s*@lovrabet\./[_0x517e58(0x18f)](_0x41fae6)){_0x9c0281++;continue;}if(_0x41fae6[_0x517e58(0x1a4)]()===''&&_0x9c0281>0x0){_0x9c0281++;continue;}break;}else while(_0x9c0281<_0x21f01e[_0x517e58(0x1b4)]){const _0x2ec5bf=_0x21f01e[_0x9c0281]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x2ec5bf)){_0x9c0281++;continue;}if(_0x2ec5bf[_0x517e58(0x1a4)]()===''&&_0x9c0281>0x0){_0x9c0281++;continue;}break;}for(;_0x9c0281<_0x21f01e['length'];_0x9c0281++){_0x530f96[_0x517e58(0x19c)](_0x21f01e[_0x9c0281]);}return _0x530f96['join']('\x0a')[_0x517e58(0x1b3)]();}export function resolveSqlMode(_0x5465e5,_0x535af8){const _0x5de07d=a178_0x558815;if(_0x535af8?.[_0x5de07d(0x1a6)])return _0x535af8['mode'];return detectSqlMode(_0x5465e5);}export function resolveSqlFileName(_0x5f54ee,_0x45d634,_0x1b79c3){const _0x4fdbd6=a178_0x558815;if(_0x1b79c3?.[_0x4fdbd6(0x1a8)])return _0x1b79c3[_0x4fdbd6(0x1a8)];if(_0x1b79c3?.[_0x4fdbd6(0x18e)]||_0x1b79c3?.[_0x4fdbd6(0x1af)])return buildSqlRelativePath(_0x5f54ee,_0x1b79c3?.[_0x4fdbd6(0x18e)],_0x1b79c3?.[_0x4fdbd6(0x1af)],resolveSqlMode(_0x45d634,_0x1b79c3),_0x1b79c3?.[_0x4fdbd6(0x1b2)]);return buildDefaultSqlFileName(_0x5f54ee,resolveSqlMode(_0x45d634,_0x1b79c3));}export function resolveSqlLocalDir(_0x19ec77,_0x38affc){return join(_0x19ec77,SQL_LOCAL_REL_DIR,_0x38affc);}export async function confirmForceOverwrite(_0x2c05a9){const _0x52865b=a178_0x558815,_0x241831=createInterface({'input':process[_0x52865b(0x198)],'output':process[_0x52865b(0x1aa)]}),_0x545b4f=await new Promise(_0x1f6f6a=>{const _0x532ba0=_0x52865b;_0x241831[_0x532ba0(0x196)](_0x2c05a9+'\x20[y/N]\x20',_0x1f6f6a);});return _0x241831[_0x52865b(0x1b0)](),['y',_0x52865b(0x193)][_0x52865b(0x1ae)](_0x545b4f[_0x52865b(0x1a4)]()[_0x52865b(0x1a2)]());}export function findSqlLockScope(_0x25ed04,_0x1137ee){const _0x2d7e28=a178_0x558815;return _0x25ed04[_0x2d7e28(0x1a0)][_0x1137ee];}function buildMetadataHeaderLines(_0x57cc07,_0x1d5697){const _0x24c3cd=a178_0x558815,_0x269700=[['sqlCode',_0x57cc07[_0x24c3cd(0x19b)]],[_0x24c3cd(0x18e),_0x57cc07[_0x24c3cd(0x18e)]],['dbId',_0x57cc07[_0x24c3cd(0x1b2)]],[_0x24c3cd(0x1af),_0x57cc07[_0x24c3cd(0x1af)]],['mode',_0x57cc07[_0x24c3cd(0x1a6)]],[_0x24c3cd(0x190),_0x57cc07[_0x24c3cd(0x190)]],['description',_0x57cc07[_0x24c3cd(0x1ab)]]];if(_0x1d5697===_0x24c3cd(0x19e))return _0x269700[_0x24c3cd(0x191)](([,_0x5b8333])=>_0x5b8333!==undefined&&_0x5b8333!==null&&String(_0x5b8333)['trim']()!=='')['map'](([_0x3efcc9,_0x20479f])=>'<!--\x20@lovrabet.'+_0x3efcc9+':\x20'+String(_0x20479f)+_0x24c3cd(0x1a9));return _0x269700[_0x24c3cd(0x191)](([,_0x3baf3f])=>_0x3baf3f!==undefined&&_0x3baf3f!==null&&String(_0x3baf3f)[_0x24c3cd(0x1a4)]()!=='')[_0x24c3cd(0x1a5)](([_0x48dbf8,_0x13bcd0])=>'--\x20@lovrabet.'+_0x48dbf8+':\x20'+String(_0x13bcd0));}
1
+ const a179_0x2ec01c=a179_0x4881;(function(_0x105271,_0x4c001f){const _0x4f158a=a179_0x4881,_0x4c5470=_0x105271();while(!![]){try{const _0x17f4aa=parseInt(_0x4f158a(0x174))/0x1+parseInt(_0x4f158a(0x182))/0x2+parseInt(_0x4f158a(0x17b))/0x3*(-parseInt(_0x4f158a(0x190))/0x4)+parseInt(_0x4f158a(0x175))/0x5*(parseInt(_0x4f158a(0x16f))/0x6)+-parseInt(_0x4f158a(0x183))/0x7*(-parseInt(_0x4f158a(0x194))/0x8)+parseInt(_0x4f158a(0x177))/0x9+parseInt(_0x4f158a(0x169))/0xa*(-parseInt(_0x4f158a(0x195))/0xb);if(_0x17f4aa===_0x4c001f)break;else _0x4c5470['push'](_0x4c5470['shift']());}catch(_0x58f9f3){_0x4c5470['push'](_0x4c5470['shift']());}}}(a179_0x406c,0xd6d35));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=a179_0x2ec01c(0x18a);export function buildSqlLockEntry(_0x962f29,_0xe33208,_0x3e5dc2,_0x59625b){const _0xe0e1f4=a179_0x2ec01c,_0x2894fe=detectSqlMode(_0xe33208);return{'path':buildSqlRelativePath(_0x962f29['sqlCode'],_0x962f29['sqlName'],_0x59625b?.[_0xe0e1f4(0x18d)],_0x2894fe,_0x962f29['dbId']),'hash':_0x3e5dc2,'remoteId':_0x962f29['id'],'version':_0x962f29[_0xe0e1f4(0x18c)],'dbId':Number(_0x962f29[_0xe0e1f4(0x178)]),'dbName':_0x59625b?.[_0xe0e1f4(0x18d)],'sqlName':_0x962f29[_0xe0e1f4(0x184)],'sqlConfig':_0x962f29['sqlConfig']??undefined,'mode':_0x2894fe};}function a179_0x406c(){const _0x5763dd=['990198QboOrt','dbId','sqls','join','147RSVqap','filter','stderr','apps','test','trim','syncedAt','986428qnwUyg','7kjrVIr','sqlName','sqlCode','fromEntries','split','entries','description','.rabetbase/sql','mode','version','dbName','sqlRoot','trimStart','96688Ahacua','length','close','question','11520176eIEjMJ','66hYUaDO','toLowerCase','endsWith','3164810mrInMx','<!--\x20@lovrabet.','mybatisXml','yes','stdin','lastSync','24Qxyfia','map','path','\x20-->','replace','1127029ZrmQSg','991190zoypmS','sqlContent'];a179_0x406c=function(){return _0x5763dd;};return a179_0x406c();}export function cloneSqlLockData(_0x444631){const _0x1bea1b=a179_0x2ec01c;return{'apps':Object[_0x1bea1b(0x186)](Object[_0x1bea1b(0x188)](_0x444631['apps'])[_0x1bea1b(0x170)](([_0x472d88,_0x52799c])=>[_0x472d88,{'sqlRoot':_0x52799c[_0x1bea1b(0x18e)],'lastSync':_0x52799c[_0x1bea1b(0x16e)],'sqls':{..._0x52799c[_0x1bea1b(0x179)]}}]))};}export function ensureRemoteSqlContent(_0x1e23b4){const _0x57f5c8=a179_0x2ec01c;return _0x1e23b4[_0x57f5c8(0x176)]??'';}export function buildLocalSqlFileContent(_0x24639f,_0x2808ae,_0x7c33ea){const _0x62b700=a179_0x2ec01c,_0x8fa226=_0x7c33ea?.[_0x62b700(0x18b)]??detectSqlMode(_0x2808ae),_0x12d634=stripLocalSqlMetadata(_0x2808ae,_0x8fa226)[_0x62b700(0x180)](),_0x4ae56d=[...buildMetadataHeaderLines({'sqlCode':_0x24639f[_0x62b700(0x185)],'sqlName':_0x24639f[_0x62b700(0x184)],'dbId':_0x24639f[_0x62b700(0x178)],'dbName':_0x7c33ea?.[_0x62b700(0x18d)],'mode':_0x8fa226,'syncedAt':_0x7c33ea?.[_0x62b700(0x181)],'description':_0x7c33ea?.[_0x62b700(0x189)]},_0x8fa226),'',_0x12d634],_0x337b49=_0x4ae56d[_0x62b700(0x17a)]('\x0a');return _0x337b49[_0x62b700(0x168)]('\x0a')?_0x337b49:_0x337b49+'\x0a';}export function stripLocalSqlMetadata(_0x2ea4a2,_0x1b775a){const _0x199eca=a179_0x2ec01c,_0x3486d5=_0x2ea4a2[_0x199eca(0x173)](/\r\n/g,'\x0a')[_0x199eca(0x187)]('\x0a'),_0x278549=[];let _0x5e268c=0x0;if(_0x1b775a===_0x199eca(0x16b))while(_0x5e268c<_0x3486d5[_0x199eca(0x191)]){const _0x3768c0=_0x3486d5[_0x5e268c]??'';if(/^\s*<!--\s*@lovrabet\./[_0x199eca(0x17f)](_0x3768c0)){_0x5e268c++;continue;}if(_0x3768c0['trim']()===''&&_0x5e268c>0x0){_0x5e268c++;continue;}break;}else while(_0x5e268c<_0x3486d5[_0x199eca(0x191)]){const _0x49c8c8=_0x3486d5[_0x5e268c]??'';if(/^\s*--\s*@lovrabet\./[_0x199eca(0x17f)](_0x49c8c8)){_0x5e268c++;continue;}if(_0x49c8c8[_0x199eca(0x180)]()===''&&_0x5e268c>0x0){_0x5e268c++;continue;}break;}for(;_0x5e268c<_0x3486d5['length'];_0x5e268c++){_0x278549['push'](_0x3486d5[_0x5e268c]);}return _0x278549[_0x199eca(0x17a)]('\x0a')[_0x199eca(0x18f)]();}export function resolveSqlMode(_0x37717b,_0x1f2864){const _0x1fb0e3=a179_0x2ec01c;if(_0x1f2864?.[_0x1fb0e3(0x18b)])return _0x1f2864[_0x1fb0e3(0x18b)];return detectSqlMode(_0x37717b);}export function resolveSqlFileName(_0x567dde,_0x55790f,_0x6915fe){const _0x1a6d13=a179_0x2ec01c;if(_0x6915fe?.[_0x1a6d13(0x171)])return _0x6915fe[_0x1a6d13(0x171)];if(_0x6915fe?.[_0x1a6d13(0x184)]||_0x6915fe?.[_0x1a6d13(0x18d)])return buildSqlRelativePath(_0x567dde,_0x6915fe?.[_0x1a6d13(0x184)],_0x6915fe?.['dbName'],resolveSqlMode(_0x55790f,_0x6915fe),_0x6915fe?.[_0x1a6d13(0x178)]);return buildDefaultSqlFileName(_0x567dde,resolveSqlMode(_0x55790f,_0x6915fe));}export function resolveSqlLocalDir(_0x2cc73e,_0x5ec47f){return join(_0x2cc73e,SQL_LOCAL_REL_DIR,_0x5ec47f);}export async function confirmForceOverwrite(_0xe898c2){const _0x13cf31=a179_0x2ec01c,_0x492dbd=createInterface({'input':process[_0x13cf31(0x16d)],'output':process[_0x13cf31(0x17d)]}),_0x48b395=await new Promise(_0x4c1ea=>{const _0x242903=_0x13cf31;_0x492dbd[_0x242903(0x193)](_0xe898c2+'\x20[y/N]\x20',_0x4c1ea);});return _0x492dbd[_0x13cf31(0x192)](),['y',_0x13cf31(0x16c)]['includes'](_0x48b395['trim']()[_0x13cf31(0x167)]());}export function findSqlLockScope(_0x5f3aac,_0x1091fb){const _0x36d5be=a179_0x2ec01c;return _0x5f3aac[_0x36d5be(0x17e)][_0x1091fb];}function a179_0x4881(_0x40d595,_0x45ffc6){_0x40d595=_0x40d595-0x167;const _0x406ca2=a179_0x406c();let _0x4881eb=_0x406ca2[_0x40d595];return _0x4881eb;}function buildMetadataHeaderLines(_0x2f50e5,_0x4dc543){const _0x5800b3=a179_0x2ec01c,_0x1ec598=[[_0x5800b3(0x185),_0x2f50e5[_0x5800b3(0x185)]],[_0x5800b3(0x184),_0x2f50e5[_0x5800b3(0x184)]],['dbId',_0x2f50e5[_0x5800b3(0x178)]],[_0x5800b3(0x18d),_0x2f50e5[_0x5800b3(0x18d)]],[_0x5800b3(0x18b),_0x2f50e5[_0x5800b3(0x18b)]],[_0x5800b3(0x181),_0x2f50e5['syncedAt']],[_0x5800b3(0x189),_0x2f50e5['description']]];if(_0x4dc543===_0x5800b3(0x16b))return _0x1ec598[_0x5800b3(0x17c)](([,_0x4de893])=>_0x4de893!==undefined&&_0x4de893!==null&&String(_0x4de893)['trim']()!=='')[_0x5800b3(0x170)](([_0xf3f70d,_0x264e05])=>_0x5800b3(0x16a)+_0xf3f70d+':\x20'+String(_0x264e05)+_0x5800b3(0x172));return _0x1ec598[_0x5800b3(0x17c)](([,_0x4f3b62])=>_0x4f3b62!==undefined&&_0x4f3b62!==null&&String(_0x4f3b62)['trim']()!=='')['map'](([_0x454860,_0x6a6454])=>'--\x20@lovrabet.'+_0x454860+':\x20'+String(_0x6a6454));}
@@ -1 +1 @@
1
- const a179_0x379b0f=a179_0xd16c;function a179_0xd16c(_0x2bf438,_0x2d1126){_0x2bf438=_0x2bf438-0xbe;const _0x40768b=a179_0x4076();let _0xd16ca6=_0x40768b[_0x2bf438];return _0xd16ca6;}(function(_0x79a793,_0x318ab6){const _0x59d793=a179_0xd16c,_0x3afb17=_0x79a793();while(!![]){try{const _0x180419=-parseInt(_0x59d793(0xc0))/0x1*(-parseInt(_0x59d793(0xc7))/0x2)+parseInt(_0x59d793(0xcf))/0x3+-parseInt(_0x59d793(0xcc))/0x4+parseInt(_0x59d793(0xd7))/0x5*(-parseInt(_0x59d793(0xc6))/0x6)+-parseInt(_0x59d793(0xc8))/0x7+-parseInt(_0x59d793(0xcb))/0x8+parseInt(_0x59d793(0xd2))/0x9;if(_0x180419===_0x318ab6)break;else _0x3afb17['push'](_0x3afb17['shift']());}catch(_0x4479d4){_0x3afb17['push'](_0x3afb17['shift']());}}}(a179_0x4076,0x9619c));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';function a179_0x4076(){const _0x426ace=['map','sqlRoot','18430209kOFVVf','totalCount','boolean','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','All\x20SQL\x20queries\x20are\x20in\x20sync.','556805SdvfBt','\x20missing,\x20','keys','status','lockFilePath','sqls','path','length','\x20remote-only','appCode','filePath','\x20modified,\x20','paging','tableData','relativePath','bool','1JzHayf','push','sqlName','lockKey','hash','\x20added,\x20','18hXtqqV','1990004kRbJej','4743830oZAJeg','has','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','6127760YZJdBi','4521864pfjodd','\x20unchanged','read','1440654FYEvHI'];a179_0x4076=function(){return _0x426ace;};return a179_0x4076();}const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x4801de){const _0x5ce012=a179_0xd16c,_0x22eb3c=[];let _0x4e7544=0x1;while(!![]){const _0x26b1f6=await listSqlQueries(_0x4801de,{'currentPage':_0x4e7544,'pageSize':PAGE_SIZE}),_0xeff654=_0x26b1f6[_0x5ce012(0xe4)]??[];_0x22eb3c[_0x5ce012(0xc1)](..._0xeff654[_0x5ce012(0xd0)](_0x37c213=>_0x37c213['sqlCode']));if(_0xeff654[_0x5ce012(0xde)]===0x0)break;const _0x49af1a=_0x26b1f6[_0x5ce012(0xe3)]?.[_0x5ce012(0xd3)];if(_0x49af1a!=null?_0x22eb3c[_0x5ce012(0xde)]>=_0x49af1a:_0xeff654[_0x5ce012(0xde)]<PAGE_SIZE)break;_0x4e7544++;}return _0x22eb3c;}export const sqlStatus={'service':'sql','command':a179_0x379b0f(0xda),'description':a179_0x379b0f(0xd5),'risk':a179_0x379b0f(0xce),'flags':[{'name':'remote','type':a179_0x379b0f(0xd4),'description':a179_0x379b0f(0xca)}],async 'execute'(_0x3dc2d7){const _0xdfba20=a179_0x379b0f,_0xee2510=loadSqlProjectConfig(_0x3dc2d7['appCode']),_0x176c08=await readSqlLockFile(_0xee2510[_0xdfba20(0xdb)]),{appLock:_0x27c35b}=ensureSqlLockScope(_0x176c08??createEmptySqlLock(),_0xee2510[_0xdfba20(0xe0)],_0xee2510[_0xdfba20(0xd1)],_0xdfba20(0xda)),_0x853794=await scanLocalSqlQueries(_0xee2510),_0x1829de=[],_0x67ff0c=[],_0x75d0e9=[],_0x292f74=[],_0x18ceb1=new Set(_0x853794['map'](_0x5985ad=>_0x5985ad[_0xdfba20(0xc3)]));for(const _0x44ff88 of _0x853794){const _0x2f6446=await computeSqlFileHash(_0x44ff88[_0xdfba20(0xe1)]),_0x4ccd29=_0x27c35b[_0xdfba20(0xdc)][_0x44ff88[_0xdfba20(0xc3)]],_0x3a86dd=!!_0x4ccd29&&_0x4ccd29[_0xdfba20(0xdd)]!==_0x44ff88[_0xdfba20(0xbe)],_0x3564f1=!!_0x4ccd29&&!!_0x44ff88[_0xdfba20(0xc2)]&&_0x4ccd29[_0xdfba20(0xc2)]!==_0x44ff88[_0xdfba20(0xc2)];if(!_0x4ccd29)_0x1829de[_0xdfba20(0xc1)](_0x44ff88[_0xdfba20(0xc3)]);else _0x4ccd29[_0xdfba20(0xc4)]!==_0x2f6446||_0x3a86dd||_0x3564f1?_0x67ff0c['push'](_0x44ff88['lockKey']):_0x75d0e9[_0xdfba20(0xc1)](_0x44ff88[_0xdfba20(0xc3)]);}for(const _0x46b613 of Object[_0xdfba20(0xd9)](_0x27c35b['sqls'])){!_0x18ceb1[_0xdfba20(0xc9)](_0x46b613)&&_0x292f74[_0xdfba20(0xc1)](_0x46b613);}const _0x44f9d1=[];if(_0x3dc2d7[_0xdfba20(0xbf)]('remote')){const _0xa90297=await fetchAllSqlCodes(_0x3dc2d7['appCode']);for(const _0x405429 of _0xa90297){!_0x18ceb1[_0xdfba20(0xc9)](_0x405429)&&!_0x27c35b['sqls'][_0x405429]&&_0x44f9d1['push'](_0x405429);}}const _0xe62fba=_0x1829de['length']===0x0&&_0x67ff0c[_0xdfba20(0xde)]===0x0&&_0x292f74[_0xdfba20(0xde)]===0x0&&_0x44f9d1[_0xdfba20(0xde)]===0x0;return{'ok':!![],'data':{'added':_0x1829de,'modified':_0x67ff0c,'missing':_0x292f74,'unchanged':_0x75d0e9,'remoteOnly':_0x44f9d1},'message':_0xe62fba?_0xdfba20(0xd6):_0x1829de['length']+_0xdfba20(0xc5)+_0x67ff0c[_0xdfba20(0xde)]+_0xdfba20(0xe2)+_0x292f74['length']+_0xdfba20(0xd8)+_0x75d0e9[_0xdfba20(0xde)]+_0xdfba20(0xcd)+(_0x44f9d1[_0xdfba20(0xde)]>0x0?',\x20'+_0x44f9d1[_0xdfba20(0xde)]+_0xdfba20(0xdf):'')};}};
1
+ function a180_0x281a(){const _0x17bfab=['12080TqZppm','status','paging','sql','has','805dUmNTS','keys','\x20missing,\x20','sqlName','sqlCode','relativePath','push','10490HTzzah','appCode','length','574249NWjXsk','4RFqWcP','remote','map','\x20remote-only','1836882LzzlzC','boolean','lockKey','331490UIejiW','2cbrInw','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','sqls','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','sqlRoot','2196303SdpVIv','bool','\x20added,\x20','read','tableData','118593jZxdMM','\x20unchanged','18106hPSnRO','totalCount','path'];a180_0x281a=function(){return _0x17bfab;};return a180_0x281a();}const a180_0x247759=a180_0x5a8f;(function(_0x338817,_0x2dc045){const _0x254f6d=a180_0x5a8f,_0x4a56b7=_0x338817();while(!![]){try{const _0x5d61ee=-parseInt(_0x254f6d(0x112))/0x1+parseInt(_0x254f6d(0x11b))/0x2*(-parseInt(_0x254f6d(0xf9))/0x3)+parseInt(_0x254f6d(0x113))/0x4*(parseInt(_0x254f6d(0x11a))/0x5)+-parseInt(_0x254f6d(0x117))/0x6+parseInt(_0x254f6d(0x108))/0x7*(parseInt(_0x254f6d(0x103))/0x8)+parseInt(_0x254f6d(0xfe))/0x9+parseInt(_0x254f6d(0x10f))/0xa*(parseInt(_0x254f6d(0x100))/0xb);if(_0x5d61ee===_0x2dc045)break;else _0x4a56b7['push'](_0x4a56b7['shift']());}catch(_0x487d49){_0x4a56b7['push'](_0x4a56b7['shift']());}}}(a180_0x281a,0x59ab2));import{listSqlQueries}from'../../core/api-client.js';function a180_0x5a8f(_0x49a2f4,_0x1b195b){_0x49a2f4=_0x49a2f4-0xf6;const _0x281adf=a180_0x281a();let _0x5a8f06=_0x281adf[_0x49a2f4];return _0x5a8f06;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x19c596){const _0x2bd336=a180_0x5a8f,_0x4f157e=[];let _0x1470b1=0x1;while(!![]){const _0x1be39f=await listSqlQueries(_0x19c596,{'currentPage':_0x1470b1,'pageSize':PAGE_SIZE}),_0x5d929d=_0x1be39f[_0x2bd336(0xfd)]??[];_0x4f157e['push'](..._0x5d929d['map'](_0x2df89c=>_0x2df89c[_0x2bd336(0x10c)]));if(_0x5d929d['length']===0x0)break;const _0x206fa7=_0x1be39f[_0x2bd336(0x105)]?.[_0x2bd336(0x101)];if(_0x206fa7!=null?_0x4f157e[_0x2bd336(0x111)]>=_0x206fa7:_0x5d929d[_0x2bd336(0x111)]<PAGE_SIZE)break;_0x1470b1++;}return _0x4f157e;}export const sqlStatus={'service':a180_0x247759(0x106),'command':a180_0x247759(0x104),'description':a180_0x247759(0xf7),'risk':a180_0x247759(0xfc),'flags':[{'name':a180_0x247759(0x114),'type':a180_0x247759(0x118),'description':a180_0x247759(0x11c)}],async 'execute'(_0x536091){const _0x1cc470=a180_0x247759,_0x3253d7=loadSqlProjectConfig(_0x536091[_0x1cc470(0x110)]),_0x2ccdf0=await readSqlLockFile(_0x3253d7['lockFilePath']),{appLock:_0x5c67ec}=ensureSqlLockScope(_0x2ccdf0??createEmptySqlLock(),_0x3253d7[_0x1cc470(0x110)],_0x3253d7[_0x1cc470(0xf8)],_0x1cc470(0x104)),_0x104b3b=await scanLocalSqlQueries(_0x3253d7),_0x3d422d=[],_0x3d89e3=[],_0x3ad76a=[],_0x12a0aa=[],_0x2a92dc=new Set(_0x104b3b[_0x1cc470(0x115)](_0x18ebcf=>_0x18ebcf[_0x1cc470(0x119)]));for(const _0x45dbe1 of _0x104b3b){const _0x331db3=await computeSqlFileHash(_0x45dbe1['filePath']),_0x4e882e=_0x5c67ec['sqls'][_0x45dbe1['lockKey']],_0x131058=!!_0x4e882e&&_0x4e882e[_0x1cc470(0x102)]!==_0x45dbe1[_0x1cc470(0x10d)],_0x535d9d=!!_0x4e882e&&!!_0x45dbe1[_0x1cc470(0x10b)]&&_0x4e882e[_0x1cc470(0x10b)]!==_0x45dbe1[_0x1cc470(0x10b)];if(!_0x4e882e)_0x3d422d[_0x1cc470(0x10e)](_0x45dbe1[_0x1cc470(0x119)]);else _0x4e882e['hash']!==_0x331db3||_0x131058||_0x535d9d?_0x3d89e3['push'](_0x45dbe1['lockKey']):_0x3ad76a['push'](_0x45dbe1[_0x1cc470(0x119)]);}for(const _0x25667d of Object[_0x1cc470(0x109)](_0x5c67ec[_0x1cc470(0xf6)])){!_0x2a92dc[_0x1cc470(0x107)](_0x25667d)&&_0x12a0aa[_0x1cc470(0x10e)](_0x25667d);}const _0x23d12c=[];if(_0x536091[_0x1cc470(0xfa)]('remote')){const _0x452fe7=await fetchAllSqlCodes(_0x536091[_0x1cc470(0x110)]);for(const _0x16c79f of _0x452fe7){!_0x2a92dc[_0x1cc470(0x107)](_0x16c79f)&&!_0x5c67ec[_0x1cc470(0xf6)][_0x16c79f]&&_0x23d12c[_0x1cc470(0x10e)](_0x16c79f);}}const _0x3807c8=_0x3d422d['length']===0x0&&_0x3d89e3[_0x1cc470(0x111)]===0x0&&_0x12a0aa[_0x1cc470(0x111)]===0x0&&_0x23d12c[_0x1cc470(0x111)]===0x0;return{'ok':!![],'data':{'added':_0x3d422d,'modified':_0x3d89e3,'missing':_0x12a0aa,'unchanged':_0x3ad76a,'remoteOnly':_0x23d12c},'message':_0x3807c8?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x3d422d[_0x1cc470(0x111)]+_0x1cc470(0xfb)+_0x3d89e3[_0x1cc470(0x111)]+'\x20modified,\x20'+_0x12a0aa['length']+_0x1cc470(0x10a)+_0x3ad76a[_0x1cc470(0x111)]+_0x1cc470(0xff)+(_0x23d12c[_0x1cc470(0x111)]>0x0?',\x20'+_0x23d12c[_0x1cc470(0x111)]+_0x1cc470(0x116):'')};}};
@@ -1 +1 @@
1
- const a180_0x298a70=a180_0x37bd;(function(_0x45d89a,_0x910d92){const _0x185570=a180_0x37bd,_0x1f8942=_0x45d89a();while(!![]){try{const _0xe19854=-parseInt(_0x185570(0xc9))/0x1*(-parseInt(_0x185570(0xd8))/0x2)+-parseInt(_0x185570(0xf5))/0x3+parseInt(_0x185570(0xe2))/0x4*(parseInt(_0x185570(0xeb))/0x5)+parseInt(_0x185570(0xf6))/0x6*(-parseInt(_0x185570(0xf1))/0x7)+-parseInt(_0x185570(0xea))/0x8*(parseInt(_0x185570(0xd5))/0x9)+parseInt(_0x185570(0xf2))/0xa+-parseInt(_0x185570(0xe0))/0xb;if(_0xe19854===_0x910d92)break;else _0x1f8942['push'](_0x1f8942['shift']());}catch(_0x53837f){_0x1f8942['push'](_0x1f8942['shift']());}}}(a180_0x6345,0xe35ef));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a180_0x37bd(_0x2de38a,_0x4da0e8){_0x2de38a=_0x2de38a-0xbc;const _0x6345b5=a180_0x6345();let _0x37bdec=_0x6345b5[_0x2de38a];return _0x37bdec;}function a180_0x6345(){const _0x357893=['pkField','length','from','Dataset\x20\x22','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','type','schemaWarnings','tables','string','23FKXVUl','sql','isSelectOnly','validation','map','dbtableConfig','\x22\x20not\x20found\x20in\x20any\x20dataset','schema:','indexName','fields','cwd','valid','34911czpBRD','parameters','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','68794zkkTCq','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','reason','Table\x20\x22','schemas','tableName','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','appCode','3861693dSHFTA','isArray','4ZahqxN','toLowerCase','find','index_type','message','size','utf-8','columns','2024AZbfsK','9068165RTSXFE','filter','read','--check-indexes\x20requires\x20--schemas.','SQL\x20schema\x20validation','validate','273Hppubb','16252390ZEPgJA','str','flagMissing','2283543CPMYXv','185394oHbYrx','unshift','split','dataset','push','File\x20not\x20found:\x20','indexes','file','sqlType','get','isDangerous','Provide\x20--file\x20or\x20--sql','name','index_columns','trim'];a180_0x6345=function(){return _0x357893;};return a180_0x6345();}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':a180_0x298a70(0xca),'command':a180_0x298a70(0xf0),'description':a180_0x298a70(0xc4),'risk':a180_0x298a70(0xed),'flags':[{'name':a180_0x298a70(0xfd),'type':a180_0x298a70(0xc8),'description':a180_0x298a70(0xd7)},{'name':a180_0x298a70(0xca),'type':a180_0x298a70(0xc8),'description':a180_0x298a70(0xd9)},{'name':a180_0x298a70(0xdc),'type':a180_0x298a70(0xc8),'description':a180_0x298a70(0xde)},{'name':'check-indexes','type':'boolean','description':'Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata'}],async 'execute'(_0xdca971){const _0x583d35=a180_0x298a70,_0x890794=_0xdca971[_0x583d35(0xf3)](_0x583d35(0xfd)),_0xbfbae9=_0xdca971[_0x583d35(0xf3)](_0x583d35(0xca)),_0x63ae17=_0xdca971[_0x583d35(0xf3)](_0x583d35(0xdc)),_0xf87917=_0xdca971['bool']('check-indexes');if(!_0x890794&&!_0xbfbae9)throw CliErrors[_0x583d35(0xf4)](_0x583d35(0xfd),_0x583d35(0xbc));if(_0xf87917&&!_0x63ae17)throw CliErrors['validation'](_0x583d35(0xee));let _0x2a0554;if(_0x890794){const _0x541d1c=resolve(process[_0x583d35(0xd3)](),_0x890794);if(!existsSync(_0x541d1c))throw CliErrors[_0x583d35(0xcc)](_0x583d35(0xfb)+_0x541d1c);_0x2a0554=readFileSync(_0x541d1c,_0x583d35(0xe8));}else _0x2a0554=_0xbfbae9;const _0x1990a7=validateSql(_0x2a0554),_0xbbefc9={'valid':_0x1990a7[_0x583d35(0xd4)],'sqlType':_0x1990a7['sqlType'][_0x583d35(0xc5)],'isSelectOnly':_0x1990a7[_0x583d35(0xfe)][_0x583d35(0xcb)],'isDangerous':_0x1990a7[_0x583d35(0xfe)][_0x583d35(0x100)],'tables':_0x1990a7['tables'],'parameters':_0x1990a7[_0x583d35(0xd6)],'message':_0x1990a7[_0x583d35(0xe6)]};_0x1990a7[_0x583d35(0xfe)][_0x583d35(0xda)]&&(_0xbbefc9['reason']=_0x1990a7['sqlType']['reason']);if(_0x63ae17&&_0x1990a7[_0x583d35(0xd4)]){const _0x5f425a=_0x63ae17[_0x583d35(0xf8)](',')[_0x583d35(0xcd)](_0x8df41=>_0x8df41[_0x583d35(0xbf)]())['filter'](Boolean),_0x4fddb8=[],_0x210dcb=[],_0x1b7496=filterDbTableBackedDatasets(await listDatasets(_0xdca971[_0x583d35(0xdf)])),_0x3f635d=new Map(_0x1b7496[_0x583d35(0xcd)](_0x1ba5eb=>[_0x1ba5eb[_0x583d35(0xce)]?.['tableName']?.['toLowerCase'](),_0x1ba5eb]));for(const _0x59d8df of _0x1990a7[_0x583d35(0xc7)]){const _0x1bbb43=_0x3f635d[_0x583d35(0xff)](_0x59d8df[_0x583d35(0xe3)]());!_0x1bbb43&&_0x4fddb8[_0x583d35(0xfa)](_0x583d35(0xdb)+_0x59d8df+_0x583d35(0xcf));}for(const _0x178e6b of _0x5f425a){let _0x42f2c8;try{_0x42f2c8=await getDatasetDetail(_0x178e6b);}catch{_0x4fddb8[_0x583d35(0xfa)](_0x583d35(0xc3)+_0x178e6b+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0x42f2c8,_0x583d35(0xef));const _0x27b54c=Array[_0x583d35(0xe1)](_0x42f2c8['fields'])?_0x42f2c8[_0x583d35(0xd2)]:[],_0x118f67=new Set(_0x27b54c[_0x583d35(0xcd)](_0x2d54f8=>_0x2d54f8['name']?.[_0x583d35(0xe3)]())),_0x45e5c2=_0x42f2c8[_0x583d35(0xce)]?.[_0x583d35(0xdd)]||_0x42f2c8[_0x583d35(0xdd)]||_0x178e6b;_0xbbefc9[_0x583d35(0xd0)+_0x45e5c2]={'code':_0x178e6b,'tableName':_0x45e5c2,'fieldCount':_0x118f67[_0x583d35(0xe7)],'fields':Array[_0x583d35(0xc2)](_0x118f67)};if(_0xf87917){const _0x38cf4b=normalizeDatasetIndexes(_0x42f2c8);_0x210dcb[_0x583d35(0xfa)]({'tableName':_0x45e5c2,..._0x38cf4b});}}_0x4fddb8[_0x583d35(0xc1)]>0x0&&(_0xbbefc9[_0x583d35(0xc6)]=_0x4fddb8),_0xf87917&&(_0xbbefc9['joinAudit']=auditSqlJoinIndexes(_0x2a0554,_0x210dcb));}return{'ok':_0x1990a7[_0x583d35(0xd4)],'data':_0xbbefc9,'message':_0x1990a7['message']};}};function normalizeDatasetIndexes(_0x35cf30){const _0x57b965=a180_0x298a70,_0x44ae57=Array[_0x57b965(0xe1)](_0x35cf30?.['dataset']?.[_0x57b965(0xfc)])?_0x35cf30[_0x57b965(0xf9)]['indexes']:Array['isArray'](_0x35cf30?.[_0x57b965(0xfc)])?_0x35cf30[_0x57b965(0xfc)]:[],_0x4ba35c=_0x44ae57['flatMap'](_0x4098cb=>{const _0x2c486e=_0x57b965,_0x208bbd=Array[_0x2c486e(0xe1)](_0x4098cb?.[_0x2c486e(0xbe)])?_0x4098cb[_0x2c486e(0xbe)]:Array[_0x2c486e(0xe1)](_0x4098cb?.['columnNames'])?_0x4098cb['columnNames']:Array[_0x2c486e(0xe1)](_0x4098cb?.[_0x2c486e(0xe9)])?_0x4098cb[_0x2c486e(0xe9)]:[],_0x35a973=_0x208bbd[_0x2c486e(0xec)](_0x12d63c=>typeof _0x12d63c===_0x2c486e(0xc8))[_0x2c486e(0xcd)](_0x232e91=>_0x232e91[_0x2c486e(0xbf)]())[_0x2c486e(0xec)](Boolean);if(_0x35a973[_0x2c486e(0xc1)]===0x0)return[];const _0x46a188=[_0x4098cb?.[_0x2c486e(0xd1)],_0x4098cb?.['index_name'],_0x4098cb?.[_0x2c486e(0xbd)]][_0x2c486e(0xe4)](_0x435485=>typeof _0x435485===_0x2c486e(0xc8)&&_0x435485[_0x2c486e(0xbf)]()),_0x3b1665=[_0x4098cb?.[_0x2c486e(0xe5)],_0x4098cb?.[_0x2c486e(0xc5)]][_0x2c486e(0xe4)](_0x5a26eb=>typeof _0x5a26eb==='string'&&_0x5a26eb[_0x2c486e(0xbf)]());return[{..._0x46a188?{'name':_0x46a188[_0x2c486e(0xbf)]()}:{},..._0x3b1665?{'type':_0x3b1665['trim']()}:{},'columns':_0x35a973}];}),_0x284748=[..._0x4ba35c],_0x2298b3=typeof _0x35cf30?.[_0x57b965(0xce)]?.[_0x57b965(0xc0)]===_0x57b965(0xc8)?_0x35cf30[_0x57b965(0xce)][_0x57b965(0xc0)][_0x57b965(0xf8)](',')[_0x57b965(0xcd)](_0x4aab45=>_0x4aab45[_0x57b965(0xbf)]())[_0x57b965(0xec)](Boolean):[];return _0x2298b3['length']>0x0&&_0x284748[_0x57b965(0xf7)]({'type':'primary','columns':_0x2298b3}),{'indexes':_0x284748,'metadataAvailable':_0x4ba35c[_0x57b965(0xc1)]>0x0};}
1
+ const a181_0x4a50cf=a181_0x1920;(function(_0x37a84f,_0x14ef2d){const _0x53682c=a181_0x1920,_0xb87618=_0x37a84f();while(!![]){try{const _0x1fa0d3=-parseInt(_0x53682c(0x1e3))/0x1*(-parseInt(_0x53682c(0x1e9))/0x2)+parseInt(_0x53682c(0x1cb))/0x3+-parseInt(_0x53682c(0x1e1))/0x4*(parseInt(_0x53682c(0x1d3))/0x5)+parseInt(_0x53682c(0x1eb))/0x6+-parseInt(_0x53682c(0x200))/0x7*(parseInt(_0x53682c(0x1f3))/0x8)+parseInt(_0x53682c(0x1c2))/0x9+parseInt(_0x53682c(0x1c4))/0xa*(-parseInt(_0x53682c(0x1da))/0xb);if(_0x1fa0d3===_0x14ef2d)break;else _0xb87618['push'](_0xb87618['shift']());}catch(_0x5ec402){_0xb87618['push'](_0xb87618['shift']());}}}(a181_0x5acf,0xa6e7e));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a181_0x5acf(){const _0x195ed7=['map','sql','tableName','joinAudit','cwd','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','File\x20not\x20found:\x20','8982057ScgetZ','index_columns','appCode','flagMissing','validation','reason','length','boolean','7252758euePpx','toLowerCase','10ZGxnCW','str','name','primary','tables','\x22\x20not\x20found\x20in\x20any\x20dataset','dataset','1464123SXZKRX','read','trim','valid','pkField','utf-8','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','check-indexes','140NFuBwb','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','file','dbtableConfig','split','index_type','schema:','10068729BRDHzO','validate','Provide\x20--file\x20or\x20--sql','bool','indexes','SQL\x20schema\x20validation','sqlType','9304jMpnrg','parameters','466171BjEOaI','push','Table\x20\x22','flatMap','--check-indexes\x20requires\x20--schemas.','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','2EkvXDt','string','7123140fHDnWi','fields','columnNames','isSelectOnly','\x22\x20not\x20found\x20or\x20not\x20accessible','schemaWarnings','isArray','schemas','8dKUfRO','find','filter','type','unshift','columns'];a181_0x5acf=function(){return _0x195ed7;};return a181_0x5acf();}import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a181_0x1920(_0x4f6e46,_0x35541d){_0x4f6e46=_0x4f6e46-0x1bc;const _0x5acfa9=a181_0x5acf();let _0x1920a2=_0x5acfa9[_0x4f6e46];return _0x1920a2;}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a181_0x4a50cf(0x1fa),'command':a181_0x4a50cf(0x1db),'description':a181_0x4a50cf(0x1e8),'risk':a181_0x4a50cf(0x1cc),'flags':[{'name':a181_0x4a50cf(0x1d5),'type':a181_0x4a50cf(0x1ea),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a181_0x4a50cf(0x1fa),'type':'string','description':a181_0x4a50cf(0x1d1)},{'name':a181_0x4a50cf(0x1f2),'type':a181_0x4a50cf(0x1ea),'description':a181_0x4a50cf(0x1d4)},{'name':'check-indexes','type':a181_0x4a50cf(0x1c1),'description':a181_0x4a50cf(0x1fe)}],async 'execute'(_0x2538a0){const _0x5b6f55=a181_0x4a50cf,_0x48dd89=_0x2538a0[_0x5b6f55(0x1c5)](_0x5b6f55(0x1d5)),_0x4b722c=_0x2538a0['str'](_0x5b6f55(0x1fa)),_0x3de422=_0x2538a0[_0x5b6f55(0x1c5)](_0x5b6f55(0x1f2)),_0x5ccc85=_0x2538a0[_0x5b6f55(0x1dd)](_0x5b6f55(0x1d2));if(!_0x48dd89&&!_0x4b722c)throw CliErrors[_0x5b6f55(0x1bd)](_0x5b6f55(0x1d5),_0x5b6f55(0x1dc));if(_0x5ccc85&&!_0x3de422)throw CliErrors['validation'](_0x5b6f55(0x1e7));let _0x2a6f25;if(_0x48dd89){const _0x1faadd=resolve(process[_0x5b6f55(0x1fd)](),_0x48dd89);if(!existsSync(_0x1faadd))throw CliErrors[_0x5b6f55(0x1be)](_0x5b6f55(0x1ff)+_0x1faadd);_0x2a6f25=readFileSync(_0x1faadd,_0x5b6f55(0x1d0));}else _0x2a6f25=_0x4b722c;const _0xaa079f=validateSql(_0x2a6f25),_0x47010d={'valid':_0xaa079f[_0x5b6f55(0x1ce)],'sqlType':_0xaa079f[_0x5b6f55(0x1e0)][_0x5b6f55(0x1f6)],'isSelectOnly':_0xaa079f[_0x5b6f55(0x1e0)][_0x5b6f55(0x1ee)],'isDangerous':_0xaa079f[_0x5b6f55(0x1e0)]['isDangerous'],'tables':_0xaa079f[_0x5b6f55(0x1c8)],'parameters':_0xaa079f[_0x5b6f55(0x1e2)],'message':_0xaa079f['message']};_0xaa079f['sqlType'][_0x5b6f55(0x1bf)]&&(_0x47010d[_0x5b6f55(0x1bf)]=_0xaa079f[_0x5b6f55(0x1e0)][_0x5b6f55(0x1bf)]);if(_0x3de422&&_0xaa079f[_0x5b6f55(0x1ce)]){const _0x1d4b2d=_0x3de422['split'](',')[_0x5b6f55(0x1f9)](_0x408105=>_0x408105[_0x5b6f55(0x1cd)]())[_0x5b6f55(0x1f5)](Boolean),_0x3f10e4=[],_0x46bb28=[],_0x246038=filterDbTableBackedDatasets(await listDatasets(_0x2538a0[_0x5b6f55(0x1bc)])),_0x3ac533=new Map(_0x246038[_0x5b6f55(0x1f9)](_0x5b176d=>[_0x5b176d[_0x5b6f55(0x1d6)]?.[_0x5b6f55(0x1fb)]?.[_0x5b6f55(0x1c3)](),_0x5b176d]));for(const _0x2001d8 of _0xaa079f[_0x5b6f55(0x1c8)]){const _0x202af9=_0x3ac533['get'](_0x2001d8[_0x5b6f55(0x1c3)]());!_0x202af9&&_0x3f10e4[_0x5b6f55(0x1e4)](_0x5b6f55(0x1e5)+_0x2001d8+_0x5b6f55(0x1c9));}for(const _0x9c2d18 of _0x1d4b2d){let _0x5a8b7b;try{_0x5a8b7b=await getDatasetDetail(_0x9c2d18);}catch{_0x3f10e4[_0x5b6f55(0x1e4)]('Dataset\x20\x22'+_0x9c2d18+_0x5b6f55(0x1ef));continue;}assertDatasetIsDbTableBacked(_0x5a8b7b,_0x5b6f55(0x1df));const _0x16adce=Array['isArray'](_0x5a8b7b[_0x5b6f55(0x1ec)])?_0x5a8b7b[_0x5b6f55(0x1ec)]:[],_0x4e392f=new Set(_0x16adce[_0x5b6f55(0x1f9)](_0x54ab40=>_0x54ab40[_0x5b6f55(0x1c6)]?.[_0x5b6f55(0x1c3)]())),_0x1440d9=_0x5a8b7b[_0x5b6f55(0x1d6)]?.[_0x5b6f55(0x1fb)]||_0x5a8b7b[_0x5b6f55(0x1fb)]||_0x9c2d18;_0x47010d[_0x5b6f55(0x1d9)+_0x1440d9]={'code':_0x9c2d18,'tableName':_0x1440d9,'fieldCount':_0x4e392f['size'],'fields':Array['from'](_0x4e392f)};if(_0x5ccc85){const _0x30b59e=normalizeDatasetIndexes(_0x5a8b7b);_0x46bb28[_0x5b6f55(0x1e4)]({'tableName':_0x1440d9,..._0x30b59e});}}_0x3f10e4[_0x5b6f55(0x1c0)]>0x0&&(_0x47010d[_0x5b6f55(0x1f0)]=_0x3f10e4),_0x5ccc85&&(_0x47010d[_0x5b6f55(0x1fc)]=auditSqlJoinIndexes(_0x2a6f25,_0x46bb28));}return{'ok':_0xaa079f['valid'],'data':_0x47010d,'message':_0xaa079f['message']};}};function normalizeDatasetIndexes(_0x5cdec7){const _0x414113=a181_0x4a50cf,_0x1596e0=Array[_0x414113(0x1f1)](_0x5cdec7?.[_0x414113(0x1ca)]?.[_0x414113(0x1de)])?_0x5cdec7[_0x414113(0x1ca)][_0x414113(0x1de)]:Array['isArray'](_0x5cdec7?.[_0x414113(0x1de)])?_0x5cdec7['indexes']:[],_0x29e3ef=_0x1596e0[_0x414113(0x1e6)](_0x29c0fb=>{const _0xcc637e=_0x414113,_0x669925=Array[_0xcc637e(0x1f1)](_0x29c0fb?.['index_columns'])?_0x29c0fb[_0xcc637e(0x201)]:Array[_0xcc637e(0x1f1)](_0x29c0fb?.[_0xcc637e(0x1ed)])?_0x29c0fb[_0xcc637e(0x1ed)]:Array[_0xcc637e(0x1f1)](_0x29c0fb?.[_0xcc637e(0x1f8)])?_0x29c0fb[_0xcc637e(0x1f8)]:[],_0x130518=_0x669925[_0xcc637e(0x1f5)](_0x25b9d6=>typeof _0x25b9d6===_0xcc637e(0x1ea))[_0xcc637e(0x1f9)](_0x179bb5=>_0x179bb5[_0xcc637e(0x1cd)]())[_0xcc637e(0x1f5)](Boolean);if(_0x130518['length']===0x0)return[];const _0x22f2e0=[_0x29c0fb?.['indexName'],_0x29c0fb?.['index_name'],_0x29c0fb?.[_0xcc637e(0x1c6)]][_0xcc637e(0x1f4)](_0x439c23=>typeof _0x439c23===_0xcc637e(0x1ea)&&_0x439c23[_0xcc637e(0x1cd)]()),_0x53d396=[_0x29c0fb?.[_0xcc637e(0x1d8)],_0x29c0fb?.[_0xcc637e(0x1f6)]]['find'](_0x37bebb=>typeof _0x37bebb===_0xcc637e(0x1ea)&&_0x37bebb['trim']());return[{..._0x22f2e0?{'name':_0x22f2e0[_0xcc637e(0x1cd)]()}:{},..._0x53d396?{'type':_0x53d396[_0xcc637e(0x1cd)]()}:{},'columns':_0x130518}];}),_0x2cb583=[..._0x29e3ef],_0x5a738b=typeof _0x5cdec7?.['dbtableConfig']?.[_0x414113(0x1cf)]===_0x414113(0x1ea)?_0x5cdec7['dbtableConfig'][_0x414113(0x1cf)][_0x414113(0x1d7)](',')['map'](_0xa74597=>_0xa74597['trim']())[_0x414113(0x1f5)](Boolean):[];return _0x5a738b[_0x414113(0x1c0)]>0x0&&_0x2cb583[_0x414113(0x1f7)]({'type':_0x414113(0x1c7),'columns':_0x5a738b}),{'indexes':_0x2cb583,'metadataAvailable':_0x29e3ef[_0x414113(0x1c0)]>0x0};}
@@ -1 +1 @@
1
- (function(_0x46499a,_0x5efbd5){const _0x339b36=a181_0x5b86,_0x307c48=_0x46499a();while(!![]){try{const _0x153277=parseInt(_0x339b36(0x1c9))/0x1*(-parseInt(_0x339b36(0x1d4))/0x2)+-parseInt(_0x339b36(0x1ce))/0x3*(parseInt(_0x339b36(0x1d1))/0x4)+-parseInt(_0x339b36(0x1d0))/0x5*(parseInt(_0x339b36(0x1cf))/0x6)+-parseInt(_0x339b36(0x1d3))/0x7+parseInt(_0x339b36(0x1cc))/0x8*(parseInt(_0x339b36(0x1ca))/0x9)+parseInt(_0x339b36(0x1cb))/0xa*(-parseInt(_0x339b36(0x1cd))/0xb)+parseInt(_0x339b36(0x1d2))/0xc;if(_0x153277===_0x5efbd5)break;else _0x307c48['push'](_0x307c48['shift']());}catch(_0x40f301){_0x307c48['push'](_0x307c48['shift']());}}}(a181_0x257a,0x5b104));import{taskStatus}from'../../commands/task/status.js';function a181_0x257a(){const _0x3fe12e=['2258770RZtJWN','2187784jxTFDM','11EzPfak','90159QSWbIL','12yyYfyB','231705olvRQh','28jFYSqZ','16416912mVQPLe','2076480jPPHdY','2158JQiALB','664Mzlamr','18WuaJHf'];a181_0x257a=function(){return _0x3fe12e;};return a181_0x257a();}function a181_0x5b86(_0x1756a7,_0x2bd710){_0x1756a7=_0x1756a7-0x1c9;const _0x257ace=a181_0x257a();let _0x5b8607=_0x257ace[_0x1756a7];return _0x5b8607;}export const taskDefinitions=[taskStatus];
1
+ (function(_0x3da21e,_0x28b358){const _0x5d2f6a=a182_0x46ea,_0x1e0db8=_0x3da21e();while(!![]){try{const _0x479cba=parseInt(_0x5d2f6a(0xdd))/0x1+parseInt(_0x5d2f6a(0xda))/0x2+-parseInt(_0x5d2f6a(0xd5))/0x3+parseInt(_0x5d2f6a(0xdb))/0x4+-parseInt(_0x5d2f6a(0xd9))/0x5*(-parseInt(_0x5d2f6a(0xdc))/0x6)+parseInt(_0x5d2f6a(0xd6))/0x7+-parseInt(_0x5d2f6a(0xd7))/0x8*(parseInt(_0x5d2f6a(0xd8))/0x9);if(_0x479cba===_0x28b358)break;else _0x1e0db8['push'](_0x1e0db8['shift']());}catch(_0xe1eb3d){_0x1e0db8['push'](_0x1e0db8['shift']());}}}(a182_0x5ade,0xa3f86));import{taskStatus}from'../../commands/task/status.js';function a182_0x46ea(_0x528449,_0x3f1c48){_0x528449=_0x528449-0xd5;const _0x5ade4c=a182_0x5ade();let _0x46eac7=_0x5ade4c[_0x528449];return _0x46eac7;}function a182_0x5ade(){const _0x286829=['94082vSXLNx','2196600OqoDMl','3272668WWwIFC','601416EPtvPh','270IAkmwV','13185iZmpSg','1428828KvqHYf','4226804oMxftJ','3018pnmpEy'];a182_0x5ade=function(){return _0x286829;};return a182_0x5ade();}export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- const a182_0x416758=a182_0xc70c;(function(_0x2c5c80,_0x20370e){const _0x3a7c42=a182_0xc70c,_0x2e1bfa=_0x2c5c80();while(!![]){try{const _0x56aa28=-parseInt(_0x3a7c42(0xed))/0x1+parseInt(_0x3a7c42(0xe0))/0x2+parseInt(_0x3a7c42(0xe7))/0x3*(parseInt(_0x3a7c42(0xdb))/0x4)+parseInt(_0x3a7c42(0xe5))/0x5+-parseInt(_0x3a7c42(0xde))/0x6+-parseInt(_0x3a7c42(0xeb))/0x7+parseInt(_0x3a7c42(0xdf))/0x8*(parseInt(_0x3a7c42(0xd9))/0x9);if(_0x56aa28===_0x20370e)break;else _0x2e1bfa['push'](_0x2e1bfa['shift']());}catch(_0x1e6b10){_0x2e1bfa['push'](_0x2e1bfa['shift']());}}}(a182_0x30e2,0xc9f98));function a182_0xc70c(_0x5c7b2b,_0x23d3da){_0x5c7b2b=_0x5c7b2b-0xd6;const _0x30e22f=a182_0x30e2();let _0xc70cb9=_0x30e22f[_0x5c7b2b];return _0xc70cb9;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':a182_0x416758(0xe4),'command':a182_0x416758(0xe1),'description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':a182_0x416758(0xe6),'defaultOutputFormat':'compress','structuredErrors':!![],'flags':[{'name':a182_0x416758(0xd6),'type':a182_0x416758(0xd8),'required':!![],'description':'Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4a2a70){const _0x17a494=a182_0x416758;if(!_0x4a2a70['str'](_0x17a494(0xd6))[_0x17a494(0xe9)]())throw CliErrors[_0x17a494(0xea)](_0x17a494(0xd6));},async 'execute'(_0x2dbabf){const _0x58f262=a182_0x416758,_0x52fe78=_0x2dbabf[_0x58f262(0xdc)](_0x58f262(0xd6))[_0x58f262(0xe9)](),_0x1c92c7=normalizeAsyncTask(await getAsyncTaskStatus(_0x52fe78,_0x2dbabf[_0x58f262(0xec)],_0x2dbabf[_0x58f262(0xdd)]));if(_0x1c92c7[_0x58f262(0xe8)]!==_0x52fe78)throw CliErrors[_0x58f262(0xd7)](_0x58f262(0xe3)+_0x52fe78+_0x58f262(0xe2)+_0x1c92c7[_0x58f262(0xe8)]+'.');const _0x170a0b=buildAsyncTaskStatusCommand(_0x1c92c7[_0x58f262(0xe8)],_0x2dbabf['appCode']);return{'ok':!![],'message':asyncTaskMessage(_0x1c92c7),'data':{'appCode':_0x2dbabf[_0x58f262(0xec)],..._0x1c92c7,'query':_0x1c92c7[_0x58f262(0xda)]?null:{'command':_0x170a0b}}};}};function a182_0x30e2(){const _0xeb0cd1=[',\x20received\x20','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','task','4003080tAAEIw','read','3SDLizQ','taskId','trim','flagMissing','4829097YNaAMB','appCode','1449923NVSUZG','task-id','apiError','string','36xocdVY','isTerminal','1073588rnzcMY','str','cookie','2590050whrQlS','3156176AilSYS','1503312krePBY','status'];a182_0x30e2=function(){return _0xeb0cd1;};return a182_0x30e2();}
1
+ const a183_0x20535d=a183_0x6a80;(function(_0x5e8a5a,_0x2c0334){const _0xe7747d=a183_0x6a80,_0x37fa4e=_0x5e8a5a();while(!![]){try{const _0xa042b8=parseInt(_0xe7747d(0x186))/0x1+-parseInt(_0xe7747d(0x18c))/0x2*(parseInt(_0xe7747d(0x18b))/0x3)+parseInt(_0xe7747d(0x199))/0x4+parseInt(_0xe7747d(0x195))/0x5*(parseInt(_0xe7747d(0x19c))/0x6)+parseInt(_0xe7747d(0x19b))/0x7*(parseInt(_0xe7747d(0x18a))/0x8)+-parseInt(_0xe7747d(0x198))/0x9+-parseInt(_0xe7747d(0x18e))/0xa;if(_0xa042b8===_0x2c0334)break;else _0x37fa4e['push'](_0x37fa4e['shift']());}catch(_0x17a271){_0x37fa4e['push'](_0x37fa4e['shift']());}}}(a183_0x2e14,0xb028a));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a183_0x2e14(){const _0x97e3d5=['7qWtHtO','3552852zCLRFW','apiError','task','934130rPCKsS','taskId','task-id','isTerminal','10287696yDcLvn','450090iPDkmT','2nvMOuS','read','24472250UbIYMC','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','appCode',',\x20received\x20','trim','flagMissing','string','10ObnDWO','str','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','3976488TdJwaI','1425028uofXKU','cookie'];a183_0x2e14=function(){return _0x97e3d5;};return a183_0x2e14();}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a183_0x6a80(_0x200192,_0x3b18c5){_0x200192=_0x200192-0x184;const _0x2e1407=a183_0x2e14();let _0x6a8095=_0x2e1407[_0x200192];return _0x6a8095;}export const taskStatus={'service':a183_0x20535d(0x185),'command':'status','description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':a183_0x20535d(0x18d),'defaultOutputFormat':'compress','structuredErrors':!![],'flags':[{'name':a183_0x20535d(0x188),'type':a183_0x20535d(0x194),'required':!![],'description':a183_0x20535d(0x18f)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4696a0){const _0x551982=a183_0x20535d;if(!_0x4696a0['str']('task-id')[_0x551982(0x192)]())throw CliErrors[_0x551982(0x193)](_0x551982(0x188));},async 'execute'(_0x1c12ee){const _0x28e1af=a183_0x20535d,_0x101b12=_0x1c12ee[_0x28e1af(0x196)]('task-id')[_0x28e1af(0x192)](),_0x436517=normalizeAsyncTask(await getAsyncTaskStatus(_0x101b12,_0x1c12ee[_0x28e1af(0x190)],_0x1c12ee[_0x28e1af(0x19a)]));if(_0x436517[_0x28e1af(0x187)]!==_0x101b12)throw CliErrors[_0x28e1af(0x184)](_0x28e1af(0x197)+_0x101b12+_0x28e1af(0x191)+_0x436517[_0x28e1af(0x187)]+'.');const _0x53f49a=buildAsyncTaskStatusCommand(_0x436517[_0x28e1af(0x187)],_0x1c12ee[_0x28e1af(0x190)]);return{'ok':!![],'message':asyncTaskMessage(_0x436517),'data':{'appCode':_0x1c12ee[_0x28e1af(0x190)],..._0x436517,'query':_0x436517[_0x28e1af(0x189)]?null:{'command':_0x53f49a}}};}};
@@ -1 +1 @@
1
- function a183_0x2460(_0x31d006,_0x58656a){_0x31d006=_0x31d006-0x16c;const _0x4c7cc9=a183_0x4c7c();let _0x246036=_0x4c7cc9[_0x31d006];return _0x246036;}function a183_0x4c7c(){const _0x30ab70=['1956460QlsbPu','2329833kGGsaX','2yXuDgn','6878367ySOBxa','6913740uzJQol','12145jbqgOt','520KXUKNf','add','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','1195742ZPLCJg','workspace\x20add','App\x20profile\x20name','name','510512advYHK'];a183_0x4c7c=function(){return _0x30ab70;};return a183_0x4c7c();}const a183_0x5f376e=a183_0x2460;(function(_0x1fda13,_0x4916a4){const _0x4ce751=a183_0x2460,_0x249cee=_0x1fda13();while(!![]){try{const _0xd2e045=parseInt(_0x4ce751(0x16c))/0x1*(parseInt(_0x4ce751(0x173))/0x2)+-parseInt(_0x4ce751(0x172))/0x3+parseInt(_0x4ce751(0x170))/0x4+-parseInt(_0x4ce751(0x171))/0x5+parseInt(_0x4ce751(0x175))/0x6+-parseInt(_0x4ce751(0x176))/0x7*(-parseInt(_0x4ce751(0x177))/0x8)+-parseInt(_0x4ce751(0x174))/0x9;if(_0xd2e045===_0x4916a4)break;else _0x249cee['push'](_0x249cee['shift']());}catch(_0x2b91da){_0x249cee['push'](_0x249cee['shift']());}}}(a183_0x4c7c,0xa038d));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':'workspace','command':a183_0x5f376e(0x178),'description':a183_0x5f376e(0x179),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a183_0x5f376e(0x16f),'description':a183_0x5f376e(0x16e),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x1476bd=>validateAppName(_0x1476bd,a183_0x5f376e(0x16d)),'execute':_0x11f576=>runAppAdd(_0x11f576,a183_0x5f376e(0x16d))};
1
+ const a184_0x4388f2=a184_0x505c;(function(_0x8ab59f,_0x1f1c15){const _0x3401db=a184_0x505c,_0x4c1cc2=_0x8ab59f();while(!![]){try{const _0x49a570=parseInt(_0x3401db(0x1af))/0x1*(-parseInt(_0x3401db(0x1b4))/0x2)+-parseInt(_0x3401db(0x1b8))/0x3+parseInt(_0x3401db(0x1b3))/0x4*(-parseInt(_0x3401db(0x1b2))/0x5)+-parseInt(_0x3401db(0x1b0))/0x6+-parseInt(_0x3401db(0x1b1))/0x7+parseInt(_0x3401db(0x1ad))/0x8+-parseInt(_0x3401db(0x1b5))/0x9*(-parseInt(_0x3401db(0x1b6))/0xa);if(_0x49a570===_0x1f1c15)break;else _0x4c1cc2['push'](_0x4c1cc2['shift']());}catch(_0x9cb4ae){_0x4c1cc2['push'](_0x4c1cc2['shift']());}}}(a184_0x1892,0xa508e));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a184_0x505c(_0x2613ee,_0x299954){_0x2613ee=_0x2613ee-0x1ac;const _0x189290=a184_0x1892();let _0x505c76=_0x189290[_0x2613ee];return _0x505c76;}export const workspaceAddDefinition={'service':'workspace','command':'add','description':a184_0x4388f2(0x1b7),'risk':a184_0x4388f2(0x1b9),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a184_0x4388f2(0x1ac),'description':a184_0x4388f2(0x1ba),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0xe13baf=>validateAppName(_0xe13baf,a184_0x4388f2(0x1ae)),'execute':_0x13767d=>runAppAdd(_0x13767d,a184_0x4388f2(0x1ae))};function a184_0x1892(){const _0x30ec7e=['4745384WRtiYk','35RZCNwz','24116WtPrUx','70320hubfDV','867591enQCdb','170OZbBxS','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','2401617sZANvk','write','App\x20profile\x20name','name','10509864JHtLXS','workspace\x20add','1LhBMaO','4324320tmuvLO'];a184_0x1892=function(){return _0x30ec7e;};return a184_0x1892();}
@@ -1 +1 @@
1
- const a184_0xd8dca9=a184_0x3f2d;(function(_0x21daca,_0x548fb2){const _0x3e9631=a184_0x3f2d,_0x34a683=_0x21daca();while(!![]){try{const _0x28b186=parseInt(_0x3e9631(0xfb))/0x1+parseInt(_0x3e9631(0xfd))/0x2*(parseInt(_0x3e9631(0x107))/0x3)+parseInt(_0x3e9631(0xfc))/0x4*(parseInt(_0x3e9631(0x102))/0x5)+-parseInt(_0x3e9631(0x11d))/0x6+parseInt(_0x3e9631(0xef))/0x7+parseInt(_0x3e9631(0x10a))/0x8*(-parseInt(_0x3e9631(0xf3))/0x9)+-parseInt(_0x3e9631(0xf0))/0xa;if(_0x28b186===_0x548fb2)break;else _0x34a683['push'](_0x34a683['shift']());}catch(_0x129b87){_0x34a683['push'](_0x34a683['shift']());}}}(a184_0x3b9f,0xc6cbc));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';function a184_0x3f2d(_0x2ac886,_0x4ac2a4){_0x2ac886=_0x2ac886-0xef;const _0x3b9f4c=a184_0x3b9f();let _0x3f2da2=_0x3b9f4c[_0x2ac886];return _0x3f2da2;}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+a184_0xd8dca9(0x121),SAFE_PROFILE_KEYS=[a184_0xd8dca9(0x110),a184_0xd8dca9(0x103),a184_0xd8dca9(0x10b),'format',a184_0xd8dca9(0xfa),'riskLevel',a184_0xd8dca9(0x11f)],workspaceFlags=[{'name':a184_0xd8dca9(0x11c),'type':a184_0xd8dca9(0x117),'description':a184_0xd8dca9(0xf5)},{'name':a184_0xd8dca9(0x110),'type':'string','description':a184_0xd8dca9(0x105)},{'name':a184_0xd8dca9(0x103),'type':a184_0xd8dca9(0x117),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':a184_0xd8dca9(0x10b),'type':a184_0xd8dca9(0x117),'description':a184_0xd8dca9(0x113)},{'name':a184_0xd8dca9(0x120),'type':a184_0xd8dca9(0x117),'description':'Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a184_0xd8dca9(0xfa),'type':a184_0xd8dca9(0xff),'description':a184_0xd8dca9(0x118)},{'name':a184_0xd8dca9(0x100),'type':a184_0xd8dca9(0x117),'description':a184_0xd8dca9(0x11b),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':a184_0xd8dca9(0x117),'description':a184_0xd8dca9(0xf8)}];function isRecord(_0x2e3566){const _0x15f423=a184_0xd8dca9;return!!_0x2e3566&&typeof _0x2e3566===_0x15f423(0x123)&&!Array['isArray'](_0x2e3566);}function assertValidAppcode(_0x10b400){const _0x325e13=a184_0xd8dca9,{valid:_0x6c64a4,message:_0x4e23d6}=validateAppcode(_0x10b400);if(!_0x6c64a4)throw CliErrors[_0x325e13(0xf9)](_0x325e13(0x10c)+_0x10b400,_0x4e23d6);}function sanitizeProfile(_0x4b1d87){if(!isRecord(_0x4b1d87))return{};const _0x513498={};for(const _0x482ee6 of SAFE_PROFILE_KEYS){if(_0x4b1d87[_0x482ee6]!==undefined)_0x513498[_0x482ee6]=_0x4b1d87[_0x482ee6];}return _0x513498;}function cloneProfile(_0x4106f9){return isRecord(_0x4106f9)?{..._0x4106f9}:{};}function collectWorkspaceProfileOverrides(_0x5ebe48){const _0x66e314=a184_0xd8dca9,_0x473a5a={},_0x5c24a9=_0x5ebe48['str'](_0x66e314(0x103)),_0x39cdb3=_0x5ebe48[_0x66e314(0xf7)](_0x66e314(0x10b)),_0x525225=_0x5ebe48[_0x66e314(0xf7)](_0x66e314(0x120)),_0x3c33a0=_0x5ebe48[_0x66e314(0x119)](_0x66e314(0xfa)),_0x1daab4=_0x5ebe48['str'](_0x66e314(0x100)),_0x41d74e=_0x5ebe48[_0x66e314(0xf7)](_0x66e314(0x11f));if(_0x5c24a9)_0x473a5a[_0x66e314(0x103)]=_0x5c24a9;if(_0x39cdb3)_0x473a5a[_0x66e314(0x10b)]=_0x39cdb3;if(_0x525225)_0x473a5a[_0x66e314(0x112)]=_0x525225;if(_0x3c33a0!==undefined&&_0x3c33a0!=='')_0x473a5a[_0x66e314(0xfa)]=Number(_0x3c33a0);if(_0x1daab4)_0x473a5a[_0x66e314(0x100)]=_0x1daab4;if(_0x41d74e)_0x473a5a[_0x66e314(0x11f)]=_0x41d74e;return _0x473a5a;}async function validateWorkspaceArgs(_0x5587d5){const _0xb8c818=a184_0xd8dca9,_0x5c6eac=_0x5587d5[_0xb8c818(0xf7)](_0xb8c818(0x11c))[_0xb8c818(0x114)](),_0x49b1e7=_0x5587d5[_0xb8c818(0xf7)]('appcode')[_0xb8c818(0x114)]();if(!_0x5c6eac&&!_0x49b1e7)throw CliErrors[_0xb8c818(0xf9)](_0xb8c818(0x126),_0xb8c818(0x115)+CLI_BIN_NAME+_0xb8c818(0x124)+CLI_BIN_NAME+_0xb8c818(0xf4));if(_0x49b1e7)assertValidAppcode(_0x49b1e7);}function resolveKnownApps(){const _0x444ed0=a184_0xd8dca9,{config:_0x46d2b1,layers:_0x5bfa8f}=readRawConfigWithLayers(),_0x3b8ecd=isRecord(_0x46d2b1[_0x444ed0(0x10e)])?_0x46d2b1[_0x444ed0(0x10e)]:{},_0x107c87=isRecord(_0x5bfa8f['globalConfig'][_0x444ed0(0x10e)])?_0x5bfa8f['globalConfig']['apps']:{};return{..._0x107c87,..._0x3b8ecd};}async function configureWorkspace(_0x1f7166,_0x2c7341){const _0x33967f=a184_0xd8dca9,_0x5723b4=_0x1f7166[_0x33967f(0xf7)](_0x33967f(0x11c))[_0x33967f(0x114)](),_0x23ea3d=_0x1f7166[_0x33967f(0xf7)]('appcode')[_0x33967f(0x114)](),_0x21f435=_0x5723b4||_0x23ea3d;if(!_0x21f435)throw CliErrors[_0x33967f(0xf9)](_0x33967f(0x126),_0x33967f(0x115)+CLI_BIN_NAME+_0x33967f(0x124)+CLI_BIN_NAME+_0x33967f(0xf4));if(_0x23ea3d)assertValidAppcode(_0x23ea3d);const _0x510455=resolveWriteConfigPath(_0x33967f(0x101)),_0xc582d0=readConfigFile(_0x510455),_0x58df72=resolveKnownApps(),_0x4a0f56=isRecord(_0xc582d0[_0x33967f(0x10e)])?{..._0xc582d0['apps']}:{},_0x4f49fc=cloneProfile(_0x4a0f56[_0x21f435]),_0x41aa90=sanitizeProfile(_0x58df72[_0x21f435]),_0x4759fa=_0x23ea3d?{}:_0x41aa90,_0x4f4153=_0x23ea3d||_0x4759fa[_0x33967f(0x110)];if(!_0x4f4153){const _0x35d81b=Object[_0x33967f(0x125)](_0x58df72),_0x4c801f=_0x35d81b[_0x33967f(0x109)]===0x0?_0x33967f(0x115)+CLI_BIN_NAME+_0x33967f(0x111)+_0x2c7341+_0x33967f(0x11a)+_0x21f435+_0x33967f(0x127):_0x33967f(0x116)+_0x35d81b[_0x33967f(0xf2)](',\x20');throw CliErrors[_0x33967f(0xf9)](_0x33967f(0x10d)+_0x21f435+_0x33967f(0x104),_0x4c801f);}assertValidAppcode(String(_0x4f4153));const _0x162346={..._0x4759fa,..._0x4f49fc,'appcode':String(_0x4f4153),...collectWorkspaceProfileOverrides(_0x1f7166)};return _0x4a0f56[_0x21f435]=_0x162346,_0xc582d0['apps']=_0x4a0f56,_0xc582d0[_0x33967f(0x106)]=_0x21f435,delete _0xc582d0[_0x33967f(0x110)],delete _0xc582d0[_0x33967f(0x11c)],_0x162346[_0x33967f(0x103)]&&(_0xc582d0['env']=_0x162346[_0x33967f(0x103)]),writeConfigFile(_0x510455,_0xc582d0),{'ok':!![],'message':_0x33967f(0x108)+(_0x2c7341==='init'?'initialized':'updated')+':\x20'+_0x21f435+_0x33967f(0xfe)+_0x162346[_0x33967f(0x110)]+_0x33967f(0x10f)+_0x510455+_0x33967f(0xf1),'data':{'operation':'workspace.'+_0x2c7341,'configPath':_0x510455,'app':_0x21f435,'appcode':_0x162346[_0x33967f(0x110)],'env':_0x162346[_0x33967f(0x103)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':'workspace','command':a184_0xd8dca9(0x128),'description':'Initialize\x20the\x20current\x20workspace\x20app\x20binding','risk':a184_0xd8dca9(0xf6),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x681078=>configureWorkspace(_0x681078,'init')},workspaceUseDefinition={'service':'workspace','command':a184_0xd8dca9(0x122),'description':a184_0xd8dca9(0x11e),'risk':a184_0xd8dca9(0xf6),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x97e9f1=>configureWorkspace(_0x97e9f1,a184_0xd8dca9(0x122))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];function a184_0x3b9f(){const _0x42192b=['use','object','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','keys','Missing\x20workspace\x20app\x20selector.','\x20--appcode\x20<code>`.','init','9699144TQSrOC','8816610tYnRSo','.\x20Credentials:\x20not\x20written.','join','9SCVkQD','\x20workspace\x20use\x20--app\x20<name>`.','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','write','str','Locale\x20for\x20this\x20workspace\x20app\x20profile','validation','pageSize','28864TcYPzB','4cusXzr','44spsyxo','\x20(appcode:\x20','number','riskLevel','project','5609260SiAyAq','env','\x22\x20not\x20found.','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','defaultApp','123183aJCzPr','Workspace\x20','length','7713976izdByW','apiDir','Invalid\x20appcode:\x20','App\x20\x22','apps',').\x20Config:\x20','appcode','\x20workspace\x20','format','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','trim','Use\x20`','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','string','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','flag','\x20--app\x20','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','app','4676844JUllOG','Switch\x20the\x20current\x20workspace\x20app\x20binding','locale','defaultFormat','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]'];a184_0x3b9f=function(){return _0x42192b;};return a184_0x3b9f();}export{WORKSPACE_USAGE};
1
+ const a185_0x57e65f=a185_0x1f9d;(function(_0x537416,_0x2df960){const _0x7c48f5=a185_0x1f9d,_0x5c6c78=_0x537416();while(!![]){try{const _0x1d14d5=parseInt(_0x7c48f5(0x1ed))/0x1+parseInt(_0x7c48f5(0x1bf))/0x2*(parseInt(_0x7c48f5(0x1ef))/0x3)+-parseInt(_0x7c48f5(0x1c3))/0x4*(-parseInt(_0x7c48f5(0x1eb))/0x5)+parseInt(_0x7c48f5(0x1c4))/0x6*(-parseInt(_0x7c48f5(0x1d2))/0x7)+-parseInt(_0x7c48f5(0x1f2))/0x8*(parseInt(_0x7c48f5(0x1d1))/0x9)+parseInt(_0x7c48f5(0x1be))/0xa+-parseInt(_0x7c48f5(0x1dc))/0xb;if(_0x1d14d5===_0x2df960)break;else _0x5c6c78['push'](_0x5c6c78['shift']());}catch(_0x472640){_0x5c6c78['push'](_0x5c6c78['shift']());}}}(a185_0x53cf,0xabcb8));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_0x57e65f(0x1d9),SAFE_PROFILE_KEYS=[a185_0x57e65f(0x1d3),a185_0x57e65f(0x1bb),'apiDir',a185_0x57e65f(0x1d7),a185_0x57e65f(0x1e9),a185_0x57e65f(0x1db),a185_0x57e65f(0x1ea)],workspaceFlags=[{'name':a185_0x57e65f(0x1e4),'type':a185_0x57e65f(0x1cf),'description':a185_0x57e65f(0x1e0)},{'name':a185_0x57e65f(0x1d3),'type':a185_0x57e65f(0x1cf),'description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':a185_0x57e65f(0x1bb),'type':'string','description':a185_0x57e65f(0x1c5),'enum':[...RABETBASE_ENV_VALUES]},{'name':a185_0x57e65f(0x1df),'type':'string','description':a185_0x57e65f(0x1cc)},{'name':'defaultFormat','type':a185_0x57e65f(0x1cf),'description':a185_0x57e65f(0x1c6),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a185_0x57e65f(0x1e9),'type':a185_0x57e65f(0x1e7),'description':a185_0x57e65f(0x1bc)},{'name':'riskLevel','type':a185_0x57e65f(0x1cf),'description':a185_0x57e65f(0x1e2),'enum':[...RISK_LEVEL_VALUES]},{'name':a185_0x57e65f(0x1ea),'type':a185_0x57e65f(0x1cf),'description':a185_0x57e65f(0x1dd)}];function isRecord(_0x423fca){const _0x132ede=a185_0x57e65f;return!!_0x423fca&&typeof _0x423fca==='object'&&!Array[_0x132ede(0x1da)](_0x423fca);}function assertValidAppcode(_0x539c35){const _0x46dcfa=a185_0x57e65f,{valid:_0x493bf4,message:_0x4cde44}=validateAppcode(_0x539c35);if(!_0x493bf4)throw CliErrors[_0x46dcfa(0x1b9)](_0x46dcfa(0x1b7)+_0x539c35,_0x4cde44);}function sanitizeProfile(_0x35f7f3){if(!isRecord(_0x35f7f3))return{};const _0x478b7d={};for(const _0x2eb97c of SAFE_PROFILE_KEYS){if(_0x35f7f3[_0x2eb97c]!==undefined)_0x478b7d[_0x2eb97c]=_0x35f7f3[_0x2eb97c];}return _0x478b7d;}function cloneProfile(_0x2baaac){return isRecord(_0x2baaac)?{..._0x2baaac}:{};}function collectWorkspaceProfileOverrides(_0x3844ed){const _0x3911b0=a185_0x57e65f,_0x311805={},_0x18f202=_0x3844ed[_0x3911b0(0x1ec)]('env'),_0x312b1c=_0x3844ed[_0x3911b0(0x1ec)]('apiDir'),_0x3620ae=_0x3844ed[_0x3911b0(0x1ec)]('defaultFormat'),_0xe99056=_0x3844ed[_0x3911b0(0x1c1)](_0x3911b0(0x1e9)),_0xd70d6e=_0x3844ed[_0x3911b0(0x1ec)](_0x3911b0(0x1db)),_0x4cb797=_0x3844ed[_0x3911b0(0x1ec)](_0x3911b0(0x1ea));if(_0x18f202)_0x311805['env']=_0x18f202;if(_0x312b1c)_0x311805[_0x3911b0(0x1df)]=_0x312b1c;if(_0x3620ae)_0x311805[_0x3911b0(0x1d7)]=_0x3620ae;if(_0xe99056!==undefined&&_0xe99056!=='')_0x311805[_0x3911b0(0x1e9)]=Number(_0xe99056);if(_0xd70d6e)_0x311805[_0x3911b0(0x1db)]=_0xd70d6e;if(_0x4cb797)_0x311805[_0x3911b0(0x1ea)]=_0x4cb797;return _0x311805;}async function validateWorkspaceArgs(_0x1390c8){const _0x2951b4=a185_0x57e65f,_0x1cb4ea=_0x1390c8[_0x2951b4(0x1ec)](_0x2951b4(0x1e4))[_0x2951b4(0x1cd)](),_0x5828bf=_0x1390c8['str'](_0x2951b4(0x1d3))['trim']();if(!_0x1cb4ea&&!_0x5828bf)throw CliErrors[_0x2951b4(0x1b9)](_0x2951b4(0x1b6),_0x2951b4(0x1f1)+CLI_BIN_NAME+_0x2951b4(0x1ce)+CLI_BIN_NAME+_0x2951b4(0x1c0));if(_0x5828bf)assertValidAppcode(_0x5828bf);}function resolveKnownApps(){const _0x2bf6e0=a185_0x57e65f,{config:_0x28fe4b,layers:_0x412610}=readRawConfigWithLayers(),_0x584186=isRecord(_0x28fe4b[_0x2bf6e0(0x1c7)])?_0x28fe4b[_0x2bf6e0(0x1c7)]:{},_0x5e0168=isRecord(_0x412610['globalConfig']['apps'])?_0x412610['globalConfig'][_0x2bf6e0(0x1c7)]:{};return{..._0x5e0168,..._0x584186};}async function configureWorkspace(_0x26f311,_0x45fec0){const _0x2ee0ce=a185_0x57e65f,_0x4c549a=_0x26f311[_0x2ee0ce(0x1ec)](_0x2ee0ce(0x1e4))[_0x2ee0ce(0x1cd)](),_0x6eb439=_0x26f311[_0x2ee0ce(0x1ec)](_0x2ee0ce(0x1d3))[_0x2ee0ce(0x1cd)](),_0xba10a1=_0x4c549a||_0x6eb439;if(!_0xba10a1)throw CliErrors['validation'](_0x2ee0ce(0x1b6),'Use\x20`'+CLI_BIN_NAME+_0x2ee0ce(0x1ce)+CLI_BIN_NAME+_0x2ee0ce(0x1c0));if(_0x6eb439)assertValidAppcode(_0x6eb439);const _0x2acc7c=resolveWriteConfigPath(_0x2ee0ce(0x1c8)),_0x24fe2d=readConfigFile(_0x2acc7c),_0x5de587=resolveKnownApps(),_0x3788ad=isRecord(_0x24fe2d[_0x2ee0ce(0x1c7)])?{..._0x24fe2d['apps']}:{},_0x1a321f=cloneProfile(_0x3788ad[_0xba10a1]),_0x478e0e=sanitizeProfile(_0x5de587[_0xba10a1]),_0x3f4285=_0x6eb439?{}:_0x478e0e,_0x1821aa=_0x6eb439||_0x3f4285[_0x2ee0ce(0x1d3)];if(!_0x1821aa){const _0x3768c8=Object['keys'](_0x5de587),_0x492bf6=_0x3768c8[_0x2ee0ce(0x1ee)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x2ee0ce(0x1b8)+_0x45fec0+_0x2ee0ce(0x1e8)+_0xba10a1+_0x2ee0ce(0x1de):_0x2ee0ce(0x1e1)+_0x3768c8[_0x2ee0ce(0x1c2)](',\x20');throw CliErrors[_0x2ee0ce(0x1b9)](_0x2ee0ce(0x1d0)+_0xba10a1+_0x2ee0ce(0x1d6),_0x492bf6);}assertValidAppcode(String(_0x1821aa));const _0x485ab7={..._0x3f4285,..._0x1a321f,'appcode':String(_0x1821aa),...collectWorkspaceProfileOverrides(_0x26f311)};return _0x3788ad[_0xba10a1]=_0x485ab7,_0x24fe2d[_0x2ee0ce(0x1c7)]=_0x3788ad,_0x24fe2d[_0x2ee0ce(0x1c9)]=_0xba10a1,delete _0x24fe2d[_0x2ee0ce(0x1d3)],delete _0x24fe2d[_0x2ee0ce(0x1e4)],_0x485ab7[_0x2ee0ce(0x1bb)]&&(_0x24fe2d[_0x2ee0ce(0x1bb)]=_0x485ab7[_0x2ee0ce(0x1bb)]),writeConfigFile(_0x2acc7c,_0x24fe2d),{'ok':!![],'message':_0x2ee0ce(0x1d5)+(_0x45fec0===_0x2ee0ce(0x1e5)?'initialized':'updated')+':\x20'+_0xba10a1+_0x2ee0ce(0x1e6)+_0x485ab7['appcode']+_0x2ee0ce(0x1d4)+_0x2acc7c+_0x2ee0ce(0x1d8),'data':{'operation':_0x2ee0ce(0x1e3)+_0x45fec0,'configPath':_0x2acc7c,'app':_0xba10a1,'appcode':_0x485ab7[_0x2ee0ce(0x1d3)],'env':_0x485ab7[_0x2ee0ce(0x1bb)]??null,'credentialsWritten':![]}};}function a185_0x53cf(){const _0x1aed82=['env','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','write','12401530jHVbpo','60AtRReC','\x20workspace\x20use\x20--app\x20<name>`.','flag','join','2471496pUPike','6IQxPab','Target\x20environment','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','apps','project','defaultApp','workspace','use','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','trim','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','string','App\x20\x22','36ZAFLjH','6120058qfOTvw','appcode',').\x20Config:\x20','Workspace\x20','\x22\x20not\x20found.','format','.\x20Credentials:\x20not\x20written.','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','isArray','riskLevel','27648357pexSGE','Locale\x20for\x20this\x20workspace\x20app\x20profile','\x20--appcode\x20<code>`.','apiDir','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','workspace.','app','init','\x20(appcode:\x20','number','\x20--app\x20','pageSize','locale','10zTuJLS','str','889754teAnqO','length','88347tdzejp','Switch\x20the\x20current\x20workspace\x20app\x20binding','Use\x20`','315344icWTpl','Missing\x20workspace\x20app\x20selector.','Invalid\x20appcode:\x20','\x20workspace\x20','validation','Initialize\x20the\x20current\x20workspace\x20app\x20binding'];a185_0x53cf=function(){return _0x1aed82;};return a185_0x53cf();}const workspaceInitDefinition={'service':a185_0x57e65f(0x1ca),'command':a185_0x57e65f(0x1e5),'description':a185_0x57e65f(0x1ba),'risk':a185_0x57e65f(0x1bd),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0xe5b4da=>configureWorkspace(_0xe5b4da,a185_0x57e65f(0x1e5))},workspaceUseDefinition={'service':a185_0x57e65f(0x1ca),'command':a185_0x57e65f(0x1cb),'description':a185_0x57e65f(0x1f0),'risk':a185_0x57e65f(0x1bd),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x299c8a=>configureWorkspace(_0x299c8a,a185_0x57e65f(0x1cb))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];function a185_0x1f9d(_0x317ee4,_0x3c282d){_0x317ee4=_0x317ee4-0x1b6;const _0x53cf14=a185_0x53cf();let _0x1f9d98=_0x53cf14[_0x317ee4];return _0x1f9d98;}export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- const a185_0x11063d=a185_0x9a40;function a185_0x4d25(){const _0x4ac206=['30fzjMWe','56PfCBJJ','high-risk-write','remove','workspace','2297168xBKASf','2669579eCenCL','441324ZPHdKY','1275039ZzJGwb','name','162755IDgZyC','4564044atFMol','100DbPwLe','317168vscfTW','workspace\x20remove','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','App\x20profile\x20name\x20to\x20remove','4UmDClr'];a185_0x4d25=function(){return _0x4ac206;};return a185_0x4d25();}(function(_0x4f9cd5,_0x4aefe8){const _0x3ca19c=a185_0x9a40,_0x14ee92=_0x4f9cd5();while(!![]){try{const _0x5b21c8=-parseInt(_0x3ca19c(0x11d))/0x1+-parseInt(_0x3ca19c(0x11b))/0x2+-parseInt(_0x3ca19c(0x11e))/0x3*(-parseInt(_0x3ca19c(0x115))/0x4)+parseInt(_0x3ca19c(0x120))/0x5*(parseInt(_0x3ca19c(0x116))/0x6)+parseInt(_0x3ca19c(0x117))/0x7*(-parseInt(_0x3ca19c(0x111))/0x8)+-parseInt(_0x3ca19c(0x121))/0x9+-parseInt(_0x3ca19c(0x110))/0xa*(-parseInt(_0x3ca19c(0x11c))/0xb);if(_0x5b21c8===_0x4aefe8)break;else _0x14ee92['push'](_0x14ee92['shift']());}catch(_0x370898){_0x14ee92['push'](_0x14ee92['shift']());}}}(a185_0x4d25,0x92992));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a185_0x9a40(_0x2247d1,_0x5df2ae){_0x2247d1=_0x2247d1-0x110;const _0x4d2575=a185_0x4d25();let _0x9a4062=_0x4d2575[_0x2247d1];return _0x9a4062;}export const workspaceRemoveDefinition={'service':a185_0x11063d(0x11a),'command':a185_0x11063d(0x119),'description':a185_0x11063d(0x113),'risk':a185_0x11063d(0x118),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a185_0x11063d(0x11f),'description':a185_0x11063d(0x114),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x586de8=>validateAppName(_0x586de8,a185_0x11063d(0x112)),'execute':_0x3a7a53=>runAppRemove(_0x3a7a53,a185_0x11063d(0x112))};
1
+ const a186_0x43d28e=a186_0xe712;function a186_0x5032(){const _0x1ea7c4=['636evIHAe','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','2956720HABxFT','591UhefZB','remove','9hRZVAW','name','App\x20profile\x20name\x20to\x20remove','1077175mOPEVu','11972zaZLWU','81utXRGl','39823YfQctj','4032760ekvten','10236NPjhft','21510346VwRZdi','workspace\x20remove','high-risk-write'];a186_0x5032=function(){return _0x1ea7c4;};return a186_0x5032();}(function(_0x1320f9,_0x17a599){const _0x2c93cc=a186_0xe712,_0x342c57=_0x1320f9();while(!![]){try{const _0x3b7da4=parseInt(_0x2c93cc(0xb9))/0x1*(parseInt(_0x2c93cc(0xb8))/0x2)+-parseInt(_0x2c93cc(0xb2))/0x3*(parseInt(_0x2c93cc(0xbc))/0x4)+-parseInt(_0x2c93cc(0xb7))/0x5+-parseInt(_0x2c93cc(0xc0))/0x6*(parseInt(_0x2c93cc(0xba))/0x7)+parseInt(_0x2c93cc(0xbb))/0x8*(-parseInt(_0x2c93cc(0xb4))/0x9)+-parseInt(_0x2c93cc(0xb1))/0xa+parseInt(_0x2c93cc(0xbd))/0xb;if(_0x3b7da4===_0x17a599)break;else _0x342c57['push'](_0x342c57['shift']());}catch(_0x59749b){_0x342c57['push'](_0x342c57['shift']());}}}(a186_0x5032,0x4da29));function a186_0xe712(_0x4898bb,_0x1d7ae8){_0x4898bb=_0x4898bb-0xb0;const _0x503201=a186_0x5032();let _0xe7125c=_0x503201[_0x4898bb];return _0xe7125c;}import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':'workspace','command':a186_0x43d28e(0xb3),'description':a186_0x43d28e(0xb0),'risk':a186_0x43d28e(0xbf),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a186_0x43d28e(0xb5),'description':a186_0x43d28e(0xb6),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x3c635e=>validateAppName(_0x3c635e,a186_0x43d28e(0xbe)),'execute':_0xc5d5cd=>runAppRemove(_0xc5d5cd,a186_0x43d28e(0xbe))};