@lovrabet/rabetbase-cli 2.5.10-beta.2 → 2.5.10-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (384) hide show
  1. package/README.md +10 -0
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/api-group.js +1 -1
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.js +1 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/api/legacy-api-file.js +1 -1
  8. package/lib/api/model-registry-file.js +1 -1
  9. package/lib/api/model-registry-scaffold.js +1 -1
  10. package/lib/api/model-source.js +1 -1
  11. package/lib/auth/auth-server-ui.js +1 -1
  12. package/lib/auth/auth-server.js +1 -1
  13. package/lib/auth/constant.js +1 -1
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.d.ts +2 -2
  16. package/lib/auth/get-session-user.js +1 -1
  17. package/lib/auth/is-session-valid.js +1 -1
  18. package/lib/auth/login-success-html.js +1 -1
  19. package/lib/auth/logout.js +1 -1
  20. package/lib/cli-flags.js +1 -1
  21. package/lib/cli.js +1 -1
  22. package/lib/commands/api/generate.js +1 -1
  23. package/lib/commands/api/index.js +1 -1
  24. package/lib/commands/api/list.js +1 -1
  25. package/lib/commands/api/pull.js +1 -1
  26. package/lib/commands/api/shared.js +1 -1
  27. package/lib/commands/app/detail.js +1 -1
  28. package/lib/commands/app/index.js +1 -1
  29. package/lib/commands/app/list.js +1 -1
  30. package/lib/commands/app/members-list.js +1 -1
  31. package/lib/commands/app/remote-directory.js +1 -1
  32. package/lib/commands/app/shared.js +1 -1
  33. package/lib/commands/app-config/delete.js +1 -1
  34. package/lib/commands/app-config/get.js +1 -1
  35. package/lib/commands/app-config/index.js +1 -1
  36. package/lib/commands/app-config/list.js +1 -1
  37. package/lib/commands/app-config/set.js +1 -1
  38. package/lib/commands/app-config/shared.js +1 -1
  39. package/lib/commands/auth/index.js +1 -1
  40. package/lib/commands/bff/create.js +1 -1
  41. package/lib/commands/bff/delete.js +1 -1
  42. package/lib/commands/bff/detail.js +1 -1
  43. package/lib/commands/bff/index.js +1 -1
  44. package/lib/commands/bff/list.js +1 -1
  45. package/lib/commands/bff/logs.js +1 -1
  46. package/lib/commands/bff/pull.js +1 -1
  47. package/lib/commands/bff/push.js +1 -1
  48. package/lib/commands/bff/status.js +1 -1
  49. package/lib/commands/cli-skill/index.js +1 -1
  50. package/lib/commands/cli-update.js +1 -1
  51. package/lib/commands/codegen/index.js +1 -1
  52. package/lib/commands/codegen/sdk.js +1 -1
  53. package/lib/commands/codegen/sql.js +1 -1
  54. package/lib/commands/common/app-registry.js +1 -1
  55. package/lib/commands/common/app-selector.js +1 -1
  56. package/lib/commands/common/async-task.js +1 -1
  57. package/lib/commands/common/dry-run.js +1 -1
  58. package/lib/commands/common/flags.js +1 -1
  59. package/lib/commands/common/local-file.js +1 -1
  60. package/lib/commands/common/validate.js +1 -1
  61. package/lib/commands/config/delete.js +1 -1
  62. package/lib/commands/config/get.js +1 -1
  63. package/lib/commands/config/index.js +1 -1
  64. package/lib/commands/config/init.js +1 -1
  65. package/lib/commands/config/list.js +1 -1
  66. package/lib/commands/config/set.js +1 -1
  67. package/lib/commands/config/shared.js +1 -1
  68. package/lib/commands/dataset/batch-design.js +1 -1
  69. package/lib/commands/dataset/business-group-update.js +1 -1
  70. package/lib/commands/dataset/business-groups.js +1 -1
  71. package/lib/commands/dataset/capability.js +1 -1
  72. package/lib/commands/dataset/cross-relation-create.js +1 -1
  73. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  74. package/lib/commands/dataset/cross-relation-list.js +1 -1
  75. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  76. package/lib/commands/dataset/cross-relation-update.js +1 -1
  77. package/lib/commands/dataset/delete.js +1 -1
  78. package/lib/commands/dataset/design-context.js +1 -1
  79. package/lib/commands/dataset/design-start.js +1 -1
  80. package/lib/commands/dataset/design-status.js +1 -1
  81. package/lib/commands/dataset/design-sync-retry.js +1 -1
  82. package/lib/commands/dataset/design-sync-status.js +1 -1
  83. package/lib/commands/dataset/design-validate.js +1 -1
  84. package/lib/commands/dataset/detail.js +1 -1
  85. package/lib/commands/dataset/extend-update.js +1 -1
  86. package/lib/commands/dataset/field-restore.js +1 -1
  87. package/lib/commands/dataset/field-update.js +1 -1
  88. package/lib/commands/dataset/generate.js +1 -1
  89. package/lib/commands/dataset/index.js +1 -1
  90. package/lib/commands/dataset/list.js +1 -1
  91. package/lib/commands/dataset/operations.js +1 -1
  92. package/lib/commands/dataset/relation-audit.js +1 -1
  93. package/lib/commands/dataset/relation-create.js +1 -1
  94. package/lib/commands/dataset/relation-delete.js +1 -1
  95. package/lib/commands/dataset/relation-shared.js +1 -1
  96. package/lib/commands/dataset/relation-update.js +1 -1
  97. package/lib/commands/dataset/relations.js +1 -1
  98. package/lib/commands/dataset/rename.js +1 -1
  99. package/lib/commands/dataset/restore.js +1 -1
  100. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  101. package/lib/commands/db/analysis-batching.js +1 -1
  102. package/lib/commands/db/analyze-batch-plan.js +1 -1
  103. package/lib/commands/db/analyze-cancel.js +1 -1
  104. package/lib/commands/db/analyze-start.js +1 -1
  105. package/lib/commands/db/analyze-status.js +1 -1
  106. package/lib/commands/db/create.js +1 -1
  107. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  109. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  110. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  111. package/lib/commands/db/delete.js +1 -1
  112. package/lib/commands/db/detail.js +1 -1
  113. package/lib/commands/db/diff-refresh-start.js +1 -1
  114. package/lib/commands/db/diff-refresh-status.js +1 -1
  115. package/lib/commands/db/diff.js +1 -1
  116. package/lib/commands/db/index.js +1 -1
  117. package/lib/commands/db/list.js +1 -1
  118. package/lib/commands/db/shared.js +1 -1
  119. package/lib/commands/db/table-diff-shared.js +1 -1
  120. package/lib/commands/db/tables.js +1 -1
  121. package/lib/commands/db/test.js +1 -1
  122. package/lib/commands/db/update.js +1 -1
  123. package/lib/commands/deployment/index.js +1 -1
  124. package/lib/commands/deployment/sync-all.js +1 -1
  125. package/lib/commands/deployment/sync-jobs.js +1 -1
  126. package/lib/commands/deployment/sync-status.js +1 -1
  127. package/lib/commands/doctor.js +1 -1
  128. package/lib/commands/file/index.js +1 -1
  129. package/lib/commands/flow/create.js +1 -1
  130. package/lib/commands/flow/detail.js +1 -1
  131. package/lib/commands/flow/index.js +1 -1
  132. package/lib/commands/flow/list.js +1 -1
  133. package/lib/commands/flow/page-list.js +1 -1
  134. package/lib/commands/flow/publish.js +1 -1
  135. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  136. package/lib/commands/flow/runtime-role-list.js +1 -1
  137. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  138. package/lib/commands/flow/runtime-user-search.js +1 -1
  139. package/lib/commands/flow/shared.js +1 -1
  140. package/lib/commands/flow/update.js +1 -1
  141. package/lib/commands/flow/validate.js +1 -1
  142. package/lib/commands/instant-api-policy/current.js +1 -1
  143. package/lib/commands/instant-api-policy/index.js +1 -1
  144. package/lib/commands/instant-api-policy/init.js +1 -1
  145. package/lib/commands/instant-api-policy/publish.js +1 -1
  146. package/lib/commands/instant-api-policy/pull.js +1 -1
  147. package/lib/commands/instant-api-policy/revision.js +1 -1
  148. package/lib/commands/instant-api-policy/revisions.js +1 -1
  149. package/lib/commands/instant-api-policy/rollback.js +1 -1
  150. package/lib/commands/instant-api-policy/shared.js +1 -1
  151. package/lib/commands/instant-api-policy/validate.js +1 -1
  152. package/lib/commands/issue/context.d.ts +3 -0
  153. package/lib/commands/issue/context.js +1 -0
  154. package/lib/commands/issue/index.js +1 -1
  155. package/lib/commands/issue/nudge.js +1 -1
  156. package/lib/commands/issue/report.js +1 -1
  157. package/lib/commands/kb/create.js +1 -1
  158. package/lib/commands/kb/delete.js +1 -1
  159. package/lib/commands/kb/detail.js +1 -1
  160. package/lib/commands/kb/index.js +1 -1
  161. package/lib/commands/kb/list.js +1 -1
  162. package/lib/commands/kb/search.js +1 -1
  163. package/lib/commands/kb/shared.js +1 -1
  164. package/lib/commands/kb/update.js +1 -1
  165. package/lib/commands/logs/index.js +1 -1
  166. package/lib/commands/menu/asset-update.js +1 -1
  167. package/lib/commands/menu/delete.js +1 -1
  168. package/lib/commands/menu/external-link-create.js +1 -1
  169. package/lib/commands/menu/external-link-update.js +1 -1
  170. package/lib/commands/menu/group-create.js +1 -1
  171. package/lib/commands/menu/group-update.js +1 -1
  172. package/lib/commands/menu/index.js +1 -1
  173. package/lib/commands/menu/list.js +1 -1
  174. package/lib/commands/menu/move.js +1 -1
  175. package/lib/commands/menu/regroup-start.js +1 -1
  176. package/lib/commands/menu/rename.js +1 -1
  177. package/lib/commands/menu/shared/compare-table.js +1 -1
  178. package/lib/commands/menu/shared/delete-plan.js +1 -1
  179. package/lib/commands/menu/shared/facts.js +1 -1
  180. package/lib/commands/menu/shared/index.js +1 -1
  181. package/lib/commands/menu/shared/inquirer.js +1 -1
  182. package/lib/commands/menu/shared/local-pages.js +1 -1
  183. package/lib/commands/menu/shared/logic.js +1 -1
  184. package/lib/commands/menu/shared/mutations.js +1 -1
  185. package/lib/commands/menu/shared/path.js +1 -1
  186. package/lib/commands/menu/shared/service.js +1 -1
  187. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  188. package/lib/commands/menu/shared/sync-core.js +1 -1
  189. package/lib/commands/menu/shared/update-core.js +1 -1
  190. package/lib/commands/menu/shared/valid-url.js +1 -1
  191. package/lib/commands/menu/subapp-assets-status.js +1 -1
  192. package/lib/commands/menu/subapp-assets-update.js +1 -1
  193. package/lib/commands/menu/sync.js +1 -1
  194. package/lib/commands/menu/visibility-update.js +1 -1
  195. package/lib/commands/notification/config-create.js +1 -1
  196. package/lib/commands/notification/config-delete.js +1 -1
  197. package/lib/commands/notification/config-list.js +1 -1
  198. package/lib/commands/notification/config-update.js +1 -1
  199. package/lib/commands/notification/index.js +1 -1
  200. package/lib/commands/notification/shared.js +1 -1
  201. package/lib/commands/ocr/index.js +1 -1
  202. package/lib/commands/page/create.js +1 -1
  203. package/lib/commands/page/custom/detail.js +1 -1
  204. package/lib/commands/page/custom/list.js +1 -1
  205. package/lib/commands/page/custom/publish.js +1 -1
  206. package/lib/commands/page/custom/shared.js +1 -1
  207. package/lib/commands/page/custom/syntax.js +1 -1
  208. package/lib/commands/page/custom/update.js +1 -1
  209. package/lib/commands/page/data-list-status.js +1 -1
  210. package/lib/commands/page/generate-start.js +1 -1
  211. package/lib/commands/page/generate-status.js +1 -1
  212. package/lib/commands/page/index.js +1 -1
  213. package/lib/commands/page/pull.js +1 -1
  214. package/lib/commands/page/push.js +1 -1
  215. package/lib/commands/page/relation-audit.js +1 -1
  216. package/lib/commands/page/restore.js +1 -1
  217. package/lib/commands/page/shared.js +1 -1
  218. package/lib/commands/page/sync.js +1 -1
  219. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  220. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  221. package/lib/commands/project/create/format-elapsed.js +1 -1
  222. package/lib/commands/project/create/main.js +1 -1
  223. package/lib/commands/project/create/materialize-project-template.js +1 -1
  224. package/lib/commands/project/create/project-name.js +1 -1
  225. package/lib/commands/project/create/project-template-archive.js +1 -1
  226. package/lib/commands/project/create/project-template-path.js +1 -1
  227. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  228. package/lib/commands/project/create/use-format-code.js +1 -1
  229. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  230. package/lib/commands/project/domain-routing-sync.js +1 -1
  231. package/lib/commands/project/index.js +1 -1
  232. package/lib/commands/project/upgrade.js +1 -1
  233. package/lib/commands/registry.js +1 -1
  234. package/lib/commands/role/delete.js +1 -1
  235. package/lib/commands/role/detail.js +1 -1
  236. package/lib/commands/role/index.js +1 -1
  237. package/lib/commands/role/list.js +1 -1
  238. package/lib/commands/role/shared.js +1 -1
  239. package/lib/commands/role/update.js +1 -1
  240. package/lib/commands/role/user-add.js +1 -1
  241. package/lib/commands/role/user-remove.js +1 -1
  242. package/lib/commands/role/user-resolve.js +1 -1
  243. package/lib/commands/rule/get.js +1 -1
  244. package/lib/commands/rule/index.js +1 -1
  245. package/lib/commands/rule/list.js +1 -1
  246. package/lib/commands/rule/set.js +1 -1
  247. package/lib/commands/rule/shared.js +1 -1
  248. package/lib/commands/run/index.js +1 -1
  249. package/lib/commands/schema.js +1 -1
  250. package/lib/commands/sql/create.js +1 -1
  251. package/lib/commands/sql/delete.js +1 -1
  252. package/lib/commands/sql/detail.js +1 -1
  253. package/lib/commands/sql/exec.js +1 -1
  254. package/lib/commands/sql/index.js +1 -1
  255. package/lib/commands/sql/list.js +1 -1
  256. package/lib/commands/sql/pull.js +1 -1
  257. package/lib/commands/sql/push.js +1 -1
  258. package/lib/commands/sql/shared.js +1 -1
  259. package/lib/commands/sql/status.js +1 -1
  260. package/lib/commands/sql/validate.js +1 -1
  261. package/lib/commands/task/index.js +1 -1
  262. package/lib/commands/task/status.js +1 -1
  263. package/lib/commands/tenant/index.js +1 -1
  264. package/lib/commands/tenant/members-list.js +1 -1
  265. package/lib/commands/tenant/shared.js +1 -1
  266. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  267. package/lib/commands/user-account/feishu-bind.js +1 -1
  268. package/lib/commands/user-account/index.js +1 -1
  269. package/lib/commands/workspace/add.js +1 -1
  270. package/lib/commands/workspace/index.js +1 -1
  271. package/lib/commands/workspace/remove.js +1 -1
  272. package/lib/config/domain-config.js +1 -1
  273. package/lib/config/project-domain-routing.js +1 -1
  274. package/lib/config/region-config.js +1 -1
  275. package/lib/config/schema.js +1 -1
  276. package/lib/constant/cdn.js +1 -1
  277. package/lib/constant/cli.js +1 -1
  278. package/lib/constant/defaults.js +1 -1
  279. package/lib/constant/domain.js +1 -1
  280. package/lib/constant/env.js +1 -1
  281. package/lib/constant/output.js +1 -1
  282. package/lib/constant/paths.js +1 -1
  283. package/lib/constant/region.js +1 -1
  284. package/lib/constant/risk.js +1 -1
  285. package/lib/constant/routing-profile.js +1 -1
  286. package/lib/context/app-resolver.js +1 -1
  287. package/lib/context/auth-resolver.js +1 -1
  288. package/lib/context/config-loader.js +1 -1
  289. package/lib/context.js +1 -1
  290. package/lib/core/alias-resolver.js +1 -1
  291. package/lib/core/api-client.js +1 -1
  292. package/lib/core/bff/config.js +1 -1
  293. package/lib/core/bff/file-system.js +1 -1
  294. package/lib/core/bff/hash.js +1 -1
  295. package/lib/core/bff/hook-directory.js +1 -1
  296. package/lib/core/bff/lock.js +1 -1
  297. package/lib/core/bff/utils.js +1 -1
  298. package/lib/core/cross-db-analysis.js +1 -1
  299. package/lib/core/cross-db-relation.js +1 -1
  300. package/lib/core/db-resolver.js +1 -1
  301. package/lib/core/flow-config.js +1 -1
  302. package/lib/core/instant-api-policy/config.js +1 -1
  303. package/lib/core/instant-api-policy/endpoints.js +1 -1
  304. package/lib/core/kb-management-client.js +1 -1
  305. package/lib/core/kb-search-client.js +1 -1
  306. package/lib/core/page/file-system.js +1 -1
  307. package/lib/core/page/hash.js +1 -1
  308. package/lib/core/page/lock.js +1 -1
  309. package/lib/core/page/lr-smart-jsx.js +1 -1
  310. package/lib/core/sql-index-auditor.js +1 -1
  311. package/lib/core/sql-sync/config.js +1 -1
  312. package/lib/core/sql-sync/file-system.js +1 -1
  313. package/lib/core/sql-sync/hash.js +1 -1
  314. package/lib/core/sql-sync/lock.js +1 -1
  315. package/lib/core/sql-sync/utils.js +1 -1
  316. package/lib/core/sql-validator.js +1 -1
  317. package/lib/errors.js +1 -1
  318. package/lib/framework/build-all-flags.js +1 -1
  319. package/lib/framework/error-output.js +1 -1
  320. package/lib/framework/explicit-yes.js +1 -1
  321. package/lib/framework/flags.js +1 -1
  322. package/lib/framework/help.js +1 -1
  323. package/lib/framework/index.js +1 -1
  324. package/lib/framework/output.js +1 -1
  325. package/lib/framework/response.js +1 -1
  326. package/lib/framework/runner-alias.js +1 -1
  327. package/lib/framework/runner.js +1 -1
  328. package/lib/framework/schema-export.js +1 -1
  329. package/lib/framework/supported-flags.js +1 -1
  330. package/lib/framework/types.js +1 -1
  331. package/lib/generated/build-info.d.ts +4 -4
  332. package/lib/generated/build-info.js +1 -1
  333. package/lib/generated/official-routing.js +1 -1
  334. package/lib/generated/routing-contract.js +1 -1
  335. package/lib/help.js +1 -1
  336. package/lib/postinstall.js +1 -1
  337. package/lib/runtime/confirmation.js +1 -1
  338. package/lib/runtime/event.js +1 -1
  339. package/lib/runtime/index.js +1 -1
  340. package/lib/runtime/queue.js +1 -1
  341. package/lib/runtime/resolve.js +1 -1
  342. package/lib/services/dataset-design/checkpoint.js +1 -1
  343. package/lib/services/dataset-design/commands.js +1 -1
  344. package/lib/services/dataset-design/contract.js +1 -1
  345. package/lib/skills/builtin-skill.js +1 -1
  346. package/lib/skills/main.js +1 -1
  347. package/lib/skills/npx-skills-add.js +1 -1
  348. package/lib/skills/skill-presence.js +1 -1
  349. package/lib/telemetry/cli-command-trace.js +1 -1
  350. package/lib/telemetry/cli-help-trace.js +1 -1
  351. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  352. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  353. package/lib/telemetry/send-cli-trace-log.js +1 -1
  354. package/lib/utils/ai_config.js +1 -1
  355. package/lib/utils/apply-jq-filter.js +1 -1
  356. package/lib/utils/cdn-config.js +1 -1
  357. package/lib/utils/check-sdk-version.js +1 -1
  358. package/lib/utils/cli-version-check.js +1 -1
  359. package/lib/utils/cli-version-policy.js +1 -1
  360. package/lib/utils/config.js +1 -1
  361. package/lib/utils/entity-with-id.js +1 -1
  362. package/lib/utils/file-utils.js +1 -1
  363. package/lib/utils/guides-cdn.js +1 -1
  364. package/lib/utils/http-client.js +1 -1
  365. package/lib/utils/is-non-interactive.js +1 -1
  366. package/lib/utils/logger.js +1 -1
  367. package/lib/utils/params.js +1 -1
  368. package/lib/utils/platform.js +1 -1
  369. package/lib/utils/sleep.js +1 -1
  370. package/lib/utils/template-replacer.js +1 -1
  371. package/lib/utils/update-notice.js +1 -1
  372. package/lib/utils/version.js +1 -1
  373. package/lib/utils/with-active-cookie.js +1 -1
  374. package/lib/utils/write-cli-side-channel.js +1 -1
  375. package/package.json +2 -2
  376. package/skills/rabetbase/SKILL.md +2 -2
  377. package/skills/rabetbase/references/rabetbase-issue-report.md +4 -1
  378. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  379. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  380. package/skills/rabetbase.manifest.json +3 -3
  381. package/lib/commands/issue/shared.d.ts +0 -32
  382. package/lib/commands/issue/shared.js +0 -1
  383. package/lib/telemetry/send-platform-issue-collect-log.d.ts +0 -26
  384. package/lib/telemetry/send-platform-issue-collect-log.js +0 -1
@@ -1 +1 @@
1
- function a248_0x3f08(_0x3d1981,_0x44e38d){_0x3d1981=_0x3d1981-0x1e0;const _0x50158e=a248_0x5015();let _0x3f08e7=_0x50158e[_0x3d1981];return _0x3f08e7;}const a248_0x23367a=a248_0x3f08;(function(_0x39d03e,_0x34cbde){const _0x1a0f53=a248_0x3f08,_0xd27eb4=_0x39d03e();while(!![]){try{const _0x566546=-parseInt(_0x1a0f53(0x1e5))/0x1*(-parseInt(_0x1a0f53(0x206))/0x2)+-parseInt(_0x1a0f53(0x1f2))/0x3*(-parseInt(_0x1a0f53(0x1f8))/0x4)+-parseInt(_0x1a0f53(0x1e1))/0x5+-parseInt(_0x1a0f53(0x1fe))/0x6*(-parseInt(_0x1a0f53(0x1ed))/0x7)+-parseInt(_0x1a0f53(0x1f7))/0x8*(parseInt(_0x1a0f53(0x200))/0x9)+parseInt(_0x1a0f53(0x1fd))/0xa*(-parseInt(_0x1a0f53(0x1ea))/0xb)+parseInt(_0x1a0f53(0x1fb))/0xc*(parseInt(_0x1a0f53(0x1ec))/0xd);if(_0x566546===_0x34cbde)break;else _0xd27eb4['push'](_0xd27eb4['shift']());}catch(_0xeefcd7){_0xd27eb4['push'](_0xd27eb4['shift']());}}}(a248_0x5015,0xace7c));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a248_0x5015(){const _0x46e0a4=['sql','trashDir','filter','POST','2JVWztW','\x20(local\x20file\x20moved\x20to\x20trash)','sqlRootDir','6389070ldzSPe','remoteId','startsWith','fromEntries','976835mUPXwZ','sqls','validation','str','delete','209kTAnyl','/smartapi/custom/deleteUserCustomSql','1443ZeDgoS','7281239YkEzuJ','Deleted\x20','sqlRoot','trashedTo','lockFilePath','3396syUALK','high-risk-write','toISOString','sqlcode','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','24iqMKJS','2696MzrQrg','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','replace','103296NEfish','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','190370IKsMTL','6PCOHQW','appCode','4163193nQyKoc','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'];a248_0x5015=function(){return _0x46e0a4;};return a248_0x5015();}import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a248_0x23367a(0x202),'command':a248_0x23367a(0x1e9),'description':a248_0x23367a(0x1fc),'risk':a248_0x23367a(0x1f3),'flags':[SQLCODE_FLAG],async 'validate'(_0x266044){const _0x3a0f46=a248_0x23367a,_0x326c79=loadSqlProjectConfig(_0x266044[_0x3a0f46(0x1ff)]),_0xa6057d=await readSqlLockFile(_0x326c79['lockFilePath']);if(!_0xa6057d)throw CliErrors['validation'](_0x3a0f46(0x1f9));},async 'dryRun'(_0x43e329){const _0x571cd8=a248_0x23367a,_0xa4360f=loadSqlProjectConfig(_0x43e329[_0x571cd8(0x1ff)]),_0x1a211e=await readSqlLockFile(_0xa4360f[_0x571cd8(0x1f1)]);if(!_0x1a211e)throw CliErrors[_0x571cd8(0x1e7)](_0x571cd8(0x1f9));const {appLock:_0x89f98a}=ensureSqlLockScope(_0x1a211e,_0x43e329[_0x571cd8(0x1ff)],_0xa4360f[_0x571cd8(0x1ef)],_0x571cd8(0x1e9)),_0x203ce6=_0x43e329[_0x571cd8(0x1e8)](_0x571cd8(0x1f5)),_0x327b40=_0x89f98a[_0x571cd8(0x1e6)][_0x203ce6];if(!_0x327b40)throw CliErrors[_0x571cd8(0x1e7)](_0x571cd8(0x1f6)+_0x203ce6+'\x22.');return{'method':_0x571cd8(0x205),'url':_0x571cd8(0x1eb),'body':{'sqlCode':_0x203ce6,'id':_0x327b40[_0x571cd8(0x1e2)],'localPath':resolveLocalSqlFilePath(_0xa4360f,_0x203ce6,_0x327b40)},'description':'Would\x20delete\x20SQL\x20'+_0x203ce6+_0x571cd8(0x201)+_0xa4360f[_0x571cd8(0x203)]};},async 'execute'(_0x273468){const _0x177e59=a248_0x23367a,_0x24addb=loadSqlProjectConfig(_0x273468[_0x177e59(0x1ff)]),_0x28aecb=await readSqlLockFile(_0x24addb[_0x177e59(0x1f1)]);if(!_0x28aecb)throw CliErrors[_0x177e59(0x1e7)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x5d25ea,appLock:_0xfdc02c}=ensureSqlLockScope(_0x28aecb,_0x273468['appCode'],_0x24addb[_0x177e59(0x1ef)],'delete'),_0x3f6207=_0x273468[_0x177e59(0x1e8)]('sqlcode'),_0x2f54b4=_0xfdc02c[_0x177e59(0x1e6)][_0x3f6207];if(!_0x2f54b4)throw CliErrors['validation'](_0x177e59(0x1f6)+_0x3f6207+'\x22.');await deleteSqlQuery({'id':_0x2f54b4[_0x177e59(0x1e2)],'sqlCode':_0x3f6207}),_0xfdc02c[_0x177e59(0x1e6)]=Object[_0x177e59(0x1e4)](Object['entries'](_0xfdc02c['sqls'])[_0x177e59(0x204)](([_0x9a50cc])=>_0x9a50cc!==_0x3f6207)),_0xfdc02c['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x24addb[_0x177e59(0x1f1)],_0x5d25ea);const _0x282358=resolveLocalSqlFilePath(_0x24addb,_0x3f6207,_0x2f54b4);let _0x75e26b;await fileExists(_0x282358)&&(_0x75e26b=await moveToTrash(_0x24addb['projectRoot'],_0x24addb[_0x177e59(0x203)],_0x282358),await cleanupEmptyDirectories(dirname(_0x282358),_0x24addb[_0x177e59(0x1e0)]));const _0x3c29ca={'deleted':_0x3f6207,'remoteId':_0x2f54b4[_0x177e59(0x1e2)]};if(_0x75e26b)_0x3c29ca[_0x177e59(0x1f0)]=_0x75e26b;return{'ok':!![],'data':_0x3c29ca,'message':_0x177e59(0x1ee)+_0x3f6207+(_0x75e26b?_0x177e59(0x207):'')};}};async function moveToTrash(_0x3392f6,_0x37b614,_0x45e879){const _0x230e8a=a248_0x23367a,_0x246874=new Date()[_0x230e8a(0x1f4)]()[_0x230e8a(0x1fa)](/[:.]/g,'-'),_0xe52698=relative(_0x3392f6,_0x45e879),_0x1e79d9=join(_0x37b614,_0x246874,_0xe52698);return await mkdir(dirname(_0x1e79d9),{'recursive':!![]}),await rename(_0x45e879,_0x1e79d9),_0x1e79d9;}async function cleanupEmptyDirectories(_0x98b143,_0x2d7a27){const _0x25a7f8=a248_0x23367a;let _0x323fb1=resolve(_0x98b143);const _0x31bd9b=resolve(_0x2d7a27);while(_0x323fb1[_0x25a7f8(0x1e3)](''+_0x31bd9b+sep)||_0x323fb1===_0x31bd9b){if(_0x323fb1===_0x31bd9b)return;try{const _0x127c56=await readdir(_0x323fb1);if(_0x127c56['length']>0x0)return;await rmdir(_0x323fb1);}catch{return;}_0x323fb1=dirname(_0x323fb1);}}
1
+ const a248_0x3e17ad=a248_0x46dc;(function(_0x4e578f,_0xd187f7){const _0x45991e=a248_0x46dc,_0x4450a4=_0x4e578f();while(!![]){try{const _0x431283=parseInt(_0x45991e(0x187))/0x1*(parseInt(_0x45991e(0x19b))/0x2)+-parseInt(_0x45991e(0x18f))/0x3+-parseInt(_0x45991e(0x191))/0x4+-parseInt(_0x45991e(0x192))/0x5*(parseInt(_0x45991e(0x199))/0x6)+-parseInt(_0x45991e(0x176))/0x7*(parseInt(_0x45991e(0x181))/0x8)+parseInt(_0x45991e(0x182))/0x9*(-parseInt(_0x45991e(0x19a))/0xa)+parseInt(_0x45991e(0x183))/0xb*(parseInt(_0x45991e(0x18a))/0xc);if(_0x431283===_0xd187f7)break;else _0x4450a4['push'](_0x4450a4['shift']());}catch(_0x503fa3){_0x4450a4['push'](_0x4450a4['shift']());}}}(a248_0x1900,0x364f3));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':a248_0x3e17ad(0x17e),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a248_0x3e17ad(0x178),'flags':[SQLCODE_FLAG],async 'validate'(_0x37fb5b){const _0x14f740=a248_0x3e17ad,_0x16d612=loadSqlProjectConfig(_0x37fb5b[_0x14f740(0x18d)]),_0x1be8d7=await readSqlLockFile(_0x16d612[_0x14f740(0x177)]);if(!_0x1be8d7)throw CliErrors[_0x14f740(0x17f)](_0x14f740(0x175));},async 'dryRun'(_0x3fad43){const _0x2a3d83=a248_0x3e17ad,_0x316602=loadSqlProjectConfig(_0x3fad43[_0x2a3d83(0x18d)]),_0xdd83ef=await readSqlLockFile(_0x316602[_0x2a3d83(0x177)]);if(!_0xdd83ef)throw CliErrors[_0x2a3d83(0x17f)](_0x2a3d83(0x175));const {appLock:_0x27a740}=ensureSqlLockScope(_0xdd83ef,_0x3fad43[_0x2a3d83(0x18d)],_0x316602['sqlRoot'],_0x2a3d83(0x17e)),_0x4930d2=_0x3fad43[_0x2a3d83(0x17d)](_0x2a3d83(0x190)),_0x41b62f=_0x27a740[_0x2a3d83(0x194)][_0x4930d2];if(!_0x41b62f)throw CliErrors[_0x2a3d83(0x17f)](_0x2a3d83(0x196)+_0x4930d2+'\x22.');return{'method':_0x2a3d83(0x17b),'url':_0x2a3d83(0x179),'body':{'sqlCode':_0x4930d2,'id':_0x41b62f[_0x2a3d83(0x193)],'localPath':resolveLocalSqlFilePath(_0x316602,_0x4930d2,_0x41b62f)},'description':_0x2a3d83(0x18c)+_0x4930d2+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x316602[_0x2a3d83(0x184)]};},async 'execute'(_0x5a7be3){const _0x506de5=a248_0x3e17ad,_0x51eba1=loadSqlProjectConfig(_0x5a7be3[_0x506de5(0x18d)]),_0x1655c3=await readSqlLockFile(_0x51eba1[_0x506de5(0x177)]);if(!_0x1655c3)throw CliErrors[_0x506de5(0x17f)](_0x506de5(0x197));const {lockData:_0x1aa23c,appLock:_0x3635ce}=ensureSqlLockScope(_0x1655c3,_0x5a7be3[_0x506de5(0x18d)],_0x51eba1[_0x506de5(0x17a)],_0x506de5(0x17e)),_0x2739f4=_0x5a7be3['str'](_0x506de5(0x190)),_0x39e5c6=_0x3635ce[_0x506de5(0x194)][_0x2739f4];if(!_0x39e5c6)throw CliErrors[_0x506de5(0x17f)](_0x506de5(0x196)+_0x2739f4+'\x22.');await deleteSqlQuery({'id':_0x39e5c6[_0x506de5(0x193)],'sqlCode':_0x2739f4}),_0x3635ce[_0x506de5(0x194)]=Object[_0x506de5(0x189)](Object['entries'](_0x3635ce[_0x506de5(0x194)])[_0x506de5(0x180)](([_0x4a29aa])=>_0x4a29aa!==_0x2739f4)),_0x3635ce[_0x506de5(0x18e)]=new Date()[_0x506de5(0x17c)](),await writeSqlLockFile(_0x51eba1['lockFilePath'],_0x1aa23c);const _0x2c24ed=resolveLocalSqlFilePath(_0x51eba1,_0x2739f4,_0x39e5c6);let _0x4fdcaa;await fileExists(_0x2c24ed)&&(_0x4fdcaa=await moveToTrash(_0x51eba1[_0x506de5(0x185)],_0x51eba1[_0x506de5(0x184)],_0x2c24ed),await cleanupEmptyDirectories(dirname(_0x2c24ed),_0x51eba1[_0x506de5(0x18b)]));const _0x5bb2bd={'deleted':_0x2739f4,'remoteId':_0x39e5c6['remoteId']};if(_0x4fdcaa)_0x5bb2bd[_0x506de5(0x188)]=_0x4fdcaa;return{'ok':!![],'data':_0x5bb2bd,'message':_0x506de5(0x198)+_0x2739f4+(_0x4fdcaa?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function a248_0x46dc(_0x1bd0d3,_0x40fb53){_0x1bd0d3=_0x1bd0d3-0x175;const _0x1900a0=a248_0x1900();let _0x46dcda=_0x1900a0[_0x1bd0d3];return _0x46dcda;}function a248_0x1900(){const _0x44113e=['trashDir','projectRoot','replace','21xCrWBY','trashedTo','fromEntries','12XNKUCj','sqlRootDir','Would\x20delete\x20SQL\x20','appCode','lastSync','756150NoUJId','sqlcode','461908AkJvAb','3115eUnJuQ','remoteId','sqls','length','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','SQL\x20lock\x20file\x20not\x20found.','Deleted\x20','2226rsafkZ','10nLsjfS','34250JxJNZV','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','28SiWXiu','lockFilePath','high-risk-write','/smartapi/custom/deleteUserCustomSql','sqlRoot','POST','toISOString','str','delete','validation','filter','653928RemxGO','1184823deFHWU','10121067dzEUcV'];a248_0x1900=function(){return _0x44113e;};return a248_0x1900();}async function moveToTrash(_0x456c81,_0x47d42,_0x5311aa){const _0x133b54=a248_0x3e17ad,_0x51baf1=new Date()['toISOString']()[_0x133b54(0x186)](/[:.]/g,'-'),_0x563e96=relative(_0x456c81,_0x5311aa),_0x2a5ffa=join(_0x47d42,_0x51baf1,_0x563e96);return await mkdir(dirname(_0x2a5ffa),{'recursive':!![]}),await rename(_0x5311aa,_0x2a5ffa),_0x2a5ffa;}async function cleanupEmptyDirectories(_0x4a4f0d,_0x1572e5){const _0x10ea41=a248_0x3e17ad;let _0x39b7d1=resolve(_0x4a4f0d);const _0x563d35=resolve(_0x1572e5);while(_0x39b7d1['startsWith'](''+_0x563d35+sep)||_0x39b7d1===_0x563d35){if(_0x39b7d1===_0x563d35)return;try{const _0x5556d0=await readdir(_0x39b7d1);if(_0x5556d0[_0x10ea41(0x195)]>0x0)return;await rmdir(_0x39b7d1);}catch{return;}_0x39b7d1=dirname(_0x39b7d1);}}
@@ -1 +1 @@
1
- const a249_0x23c1d4=a249_0x39b9;(function(_0xfea188,_0x2526e6){const _0x499fe6=a249_0x39b9,_0x168ae9=_0xfea188();while(!![]){try{const _0x1834dd=parseInt(_0x499fe6(0x11f))/0x1*(parseInt(_0x499fe6(0x12e))/0x2)+-parseInt(_0x499fe6(0x127))/0x3+parseInt(_0x499fe6(0x134))/0x4+parseInt(_0x499fe6(0x125))/0x5*(-parseInt(_0x499fe6(0x126))/0x6)+-parseInt(_0x499fe6(0x133))/0x7*(-parseInt(_0x499fe6(0x128))/0x8)+parseInt(_0x499fe6(0x130))/0x9*(parseInt(_0x499fe6(0x12b))/0xa)+-parseInt(_0x499fe6(0x120))/0xb*(parseInt(_0x499fe6(0x12f))/0xc);if(_0x1834dd===_0x2526e6)break;else _0x168ae9['push'](_0x168ae9['shift']());}catch(_0x5a759b){_0x168ae9['push'](_0x168ae9['shift']());}}}(a249_0x404c,0x6bc29));import{getSqlQueryInfo}from'../../core/api-client.js';function a249_0x39b9(_0x38df35,_0x3e353c){_0x38df35=_0x38df35-0x11c;const _0x404c20=a249_0x404c();let _0x39b91e=_0x404c20[_0x38df35];return _0x39b91e;}function a249_0x404c(){const _0x8526e7=['2926mqRRbw','sqlContent','detail','str','Return\x20full\x20raw\x20SQL\x20query\x20object','610835HQADKp','18pOSUBf','2439249tBOtml','3167624BNqpem','verbose','appCode','30qgdSTB','read','dbId','459588UXVqjC','23544hlhDTa','2374047RbJNFc','sqlCode','bool','7xugZCa','1983884nfnAcc','description','sqlName','boolean','2BqODVd'];a249_0x404c=function(){return _0x8526e7;};return a249_0x404c();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a249_0x23c1d4(0x122),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a249_0x23c1d4(0x12c),'flags':[SQLCODE_FLAG,{'name':a249_0x23c1d4(0x129),'type':a249_0x23c1d4(0x11e),'description':a249_0x23c1d4(0x124)}],async 'execute'(_0x3071f5){const _0x1da494=a249_0x23c1d4,_0x405482=await getSqlQueryInfo(_0x3071f5[_0x1da494(0x12a)],_0x3071f5[_0x1da494(0x123)]('sqlcode')),_0x4b60e8=_0x3071f5[_0x1da494(0x132)](_0x1da494(0x129));if(_0x4b60e8)return{'ok':!![],'data':_0x405482};const _0x50836a=_0x405482[_0x1da494(0x12d)]?await getDbName(_0x3071f5[_0x1da494(0x12a)],_0x405482[_0x1da494(0x12d)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x405482[_0x1da494(0x131)],'sqlName':_0x405482[_0x1da494(0x11d)],'db':_0x50836a?_0x50836a+'\x20('+_0x405482[_0x1da494(0x12d)]+')':_0x405482['dbId']??'','description':_0x405482[_0x1da494(0x11c)]??'','sqlContent':_0x405482[_0x1da494(0x121)]??''}};}};
1
+ const a249_0x275c11=a249_0x8d5f;(function(_0x41667d,_0x31412f){const _0x5cea19=a249_0x8d5f,_0x4de49a=_0x41667d();while(!![]){try{const _0x132cba=-parseInt(_0x5cea19(0x124))/0x1+-parseInt(_0x5cea19(0x11f))/0x2*(-parseInt(_0x5cea19(0x12a))/0x3)+-parseInt(_0x5cea19(0x127))/0x4*(-parseInt(_0x5cea19(0x12c))/0x5)+-parseInt(_0x5cea19(0x125))/0x6+-parseInt(_0x5cea19(0x12b))/0x7+parseInt(_0x5cea19(0x131))/0x8+-parseInt(_0x5cea19(0x126))/0x9;if(_0x132cba===_0x31412f)break;else _0x4de49a['push'](_0x4de49a['shift']());}catch(_0x2563eb){_0x4de49a['push'](_0x4de49a['shift']());}}}(a249_0xf3ff,0xa73d9));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a249_0x275c11(0x123),'command':'detail','description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':'read','flags':[SQLCODE_FLAG,{'name':a249_0x275c11(0x128),'type':a249_0x275c11(0x11e),'description':a249_0x275c11(0x12d)}],async 'execute'(_0x2427b5){const _0x5dc767=a249_0x275c11,_0x3cfba4=await getSqlQueryInfo(_0x2427b5['appCode'],_0x2427b5[_0x5dc767(0x122)]('sqlcode')),_0x406283=_0x2427b5[_0x5dc767(0x129)](_0x5dc767(0x128));if(_0x406283)return{'ok':!![],'data':_0x3cfba4};const _0x177096=_0x3cfba4['dbId']?await getDbName(_0x2427b5[_0x5dc767(0x120)],_0x3cfba4[_0x5dc767(0x12e)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x3cfba4[_0x5dc767(0x130)],'sqlName':_0x3cfba4['sqlName'],'db':_0x177096?_0x177096+'\x20('+_0x3cfba4[_0x5dc767(0x12e)]+')':_0x3cfba4['dbId']??'','description':_0x3cfba4[_0x5dc767(0x12f)]??'','sqlContent':_0x3cfba4[_0x5dc767(0x121)]??''}};}};function a249_0x8d5f(_0x242ba9,_0x10b6d5){_0x242ba9=_0x242ba9-0x11e;const _0xf3ff5d=a249_0xf3ff();let _0x8d5f4e=_0xf3ff5d[_0x242ba9];return _0x8d5f4e;}function a249_0xf3ff(){const _0x2c08bd=['appCode','sqlContent','str','sql','65192JUiLLO','1302228lJRKLz','7219026zCsSma','621872sjRhXN','verbose','bool','822828yTcpFT','1135652obNxgU','40XOBteJ','Return\x20full\x20raw\x20SQL\x20query\x20object','dbId','description','sqlCode','1114408LTHfcH','boolean','4FRYgeQ'];a249_0xf3ff=function(){return _0x2c08bd;};return a249_0xf3ff();}
@@ -1 +1 @@
1
- const a250_0x34d37a=a250_0x1e69;(function(_0x569cf6,_0x5b5e52){const _0x444f8e=a250_0x1e69,_0x4ee82c=_0x569cf6();while(!![]){try{const _0x156bb7=parseInt(_0x444f8e(0x192))/0x1+parseInt(_0x444f8e(0x190))/0x2*(-parseInt(_0x444f8e(0x186))/0x3)+-parseInt(_0x444f8e(0x18f))/0x4+parseInt(_0x444f8e(0x188))/0x5*(parseInt(_0x444f8e(0x18d))/0x6)+parseInt(_0x444f8e(0x187))/0x7+parseInt(_0x444f8e(0x181))/0x8+-parseInt(_0x444f8e(0x191))/0x9;if(_0x156bb7===_0x5b5e52)break;else _0x4ee82c['push'](_0x4ee82c['shift']());}catch(_0x2d9832){_0x4ee82c['push'](_0x4ee82c['shift']());}}}(a250_0x898d,0x48519));import{executeSql}from'../../core/api-client.js';function a250_0x1e69(_0x3b231c,_0x111cde){_0x3b231c=_0x3b231c-0x17e;const _0x898da6=a250_0x898d();let _0x1e69f0=_0x898da6[_0x3b231c];return _0x1e69f0;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':a250_0x34d37a(0x184),'description':a250_0x34d37a(0x18e),'risk':a250_0x34d37a(0x18a),'flags':[SQLCODE_FLAG,{'name':a250_0x34d37a(0x182),'type':a250_0x34d37a(0x194),'description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x1b5f13){const _0xe53273=a250_0x34d37a,_0x4fa643=parseJsonParams(_0x1b5f13['str']('params')),_0x2c4301=Date[_0xe53273(0x185)](),_0x25a6fd=await executeSql(_0x1b5f13[_0xe53273(0x17f)],_0x1b5f13[_0xe53273(0x189)](_0xe53273(0x196)),_0x4fa643),_0x854149=Date['now']()-_0x2c4301,_0x4627a9=_0x25a6fd?.[_0xe53273(0x180)]??_0x25a6fd,_0x2cd467=_0x25a6fd?.[_0xe53273(0x193)]??!![];if(!_0x2cd467)return{'ok':![],'data':{'error':_0x25a6fd?.[_0xe53273(0x195)]||'SQL\x20execution\x20failed','elapsed':_0x854149},'message':'SQL\x20execution\x20failed'};const _0x4671fa=Array[_0xe53273(0x18c)](_0x4627a9)?_0x4627a9:[];return{'ok':!![],'data':{'rows':_0x4671fa,'rowCount':_0x4671fa[_0xe53273(0x17e)],'elapsed':_0x854149},'message':_0xe53273(0x183)+_0x4671fa[_0xe53273(0x17e)]+_0xe53273(0x18b)+_0x854149+'ms'};}};function a250_0x898d(){const _0x4c8dd2=['read','\x20row(s)\x20in\x20','isArray','2394KLDhVt','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','478756fiqTQi','14162tfBrGX','4108716WvimQU','295469awdgdV','execSuccess','string','execError','sqlcode','length','appCode','execResult','1441736PMCbUk','params','Returned\x20','exec','now','120kTuDbi','3005884eAcsFj','3140iGKcbW','str'];a250_0x898d=function(){return _0x4c8dd2;};return a250_0x898d();}
1
+ const a250_0x4527e6=a250_0x2bf7;(function(_0x4e0de0,_0x57df09){const _0x8ea83c=a250_0x2bf7,_0x2f5432=_0x4e0de0();while(!![]){try{const _0x3345ac=-parseInt(_0x8ea83c(0x110))/0x1+-parseInt(_0x8ea83c(0x107))/0x2+-parseInt(_0x8ea83c(0x101))/0x3+parseInt(_0x8ea83c(0x100))/0x4+parseInt(_0x8ea83c(0x103))/0x5*(-parseInt(_0x8ea83c(0x105))/0x6)+-parseInt(_0x8ea83c(0x108))/0x7*(parseInt(_0x8ea83c(0xf9))/0x8)+parseInt(_0x8ea83c(0x113))/0x9*(parseInt(_0x8ea83c(0x109))/0xa);if(_0x3345ac===_0x57df09)break;else _0x2f5432['push'](_0x2f5432['shift']());}catch(_0x2b34b4){_0x2f5432['push'](_0x2f5432['shift']());}}}(a250_0x3ceb,0xe2ab7));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a250_0x2bf7(_0x4303b5,_0x325f23){_0x4303b5=_0x4303b5-0xf9;const _0x3ceb65=a250_0x3ceb();let _0x2bf7cb=_0x3ceb65[_0x4303b5];return _0x2bf7cb;}function a250_0x3ceb(){const _0x5a8c7e=['17289QMOgOd','208VDQmDP','Returned\x20','execResult','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','execError','str','4529912LanuYx','4750233JHgxlj','read','715865vrkcAW','exec','18NNhWTH','length','1949892Xtfzuo','475965QSLkxG','25720pdhHwe','\x20row(s)\x20in\x20','string','SQL\x20execution\x20failed','now','sql','isArray','389105eGfBjt','params','execSuccess'];a250_0x3ceb=function(){return _0x5a8c7e;};return a250_0x3ceb();}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a250_0x4527e6(0x10e),'command':a250_0x4527e6(0x104),'description':a250_0x4527e6(0xfc),'risk':a250_0x4527e6(0x102),'flags':[SQLCODE_FLAG,{'name':a250_0x4527e6(0x111),'type':a250_0x4527e6(0x10b),'description':a250_0x4527e6(0xfd)}],async 'execute'(_0x5874ca){const _0xa1b8f0=a250_0x4527e6,_0x19a634=parseJsonParams(_0x5874ca[_0xa1b8f0(0xff)](_0xa1b8f0(0x111))),_0x2142d3=Date[_0xa1b8f0(0x10d)](),_0x4d1e86=await executeSql(_0x5874ca['appCode'],_0x5874ca[_0xa1b8f0(0xff)]('sqlcode'),_0x19a634),_0x14973d=Date[_0xa1b8f0(0x10d)]()-_0x2142d3,_0x194728=_0x4d1e86?.[_0xa1b8f0(0xfb)]??_0x4d1e86,_0x21ede4=_0x4d1e86?.[_0xa1b8f0(0x112)]??!![];if(!_0x21ede4)return{'ok':![],'data':{'error':_0x4d1e86?.[_0xa1b8f0(0xfe)]||_0xa1b8f0(0x10c),'elapsed':_0x14973d},'message':_0xa1b8f0(0x10c)};const _0x273c77=Array[_0xa1b8f0(0x10f)](_0x194728)?_0x194728:[];return{'ok':!![],'data':{'rows':_0x273c77,'rowCount':_0x273c77[_0xa1b8f0(0x106)],'elapsed':_0x14973d},'message':_0xa1b8f0(0xfa)+_0x273c77[_0xa1b8f0(0x106)]+_0xa1b8f0(0x10a)+_0x14973d+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x230fb,_0x22a97b){const _0x187ba0=a251_0x5b3d,_0xe644d7=_0x230fb();while(!![]){try{const _0x18907f=parseInt(_0x187ba0(0x14e))/0x1*(-parseInt(_0x187ba0(0x14d))/0x2)+-parseInt(_0x187ba0(0x14b))/0x3*(-parseInt(_0x187ba0(0x149))/0x4)+parseInt(_0x187ba0(0x147))/0x5+parseInt(_0x187ba0(0x14f))/0x6*(-parseInt(_0x187ba0(0x150))/0x7)+parseInt(_0x187ba0(0x148))/0x8+parseInt(_0x187ba0(0x14a))/0x9+-parseInt(_0x187ba0(0x14c))/0xa;if(_0x18907f===_0x22a97b)break;else _0xe644d7['push'](_0xe644d7['shift']());}catch(_0x230d2b){_0xe644d7['push'](_0xe644d7['shift']());}}}(a251_0x2cb0,0x3da9d));import{sqlList}from'../../commands/sql/list.js';function a251_0x5b3d(_0x463e77,_0x1e39ff){_0x463e77=_0x463e77-0x147;const _0x2cb0c8=a251_0x2cb0();let _0x5b3ddf=_0x2cb0c8[_0x463e77];return _0x5b3ddf;}import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';function a251_0x2cb0(){const _0x354835=['78825GkAMrm','2328790OPGBoL','626RmfPYo','811msQyWx','12162yPgrJe','1372twwoKs','2443425vTgCzv','345632MicKUk','72XAoQpi','1185732HPdXEh'];a251_0x2cb0=function(){return _0x354835;};return a251_0x2cb0();}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,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0xc64f0f,_0x1f5815){const _0x311af6=a251_0x12bc,_0x2fa11b=_0xc64f0f();while(!![]){try{const _0x54d0d4=parseInt(_0x311af6(0x1a3))/0x1*(-parseInt(_0x311af6(0x1a1))/0x2)+-parseInt(_0x311af6(0x1a4))/0x3+parseInt(_0x311af6(0x1a5))/0x4+parseInt(_0x311af6(0x19f))/0x5*(parseInt(_0x311af6(0x1a0))/0x6)+parseInt(_0x311af6(0x1a7))/0x7*(-parseInt(_0x311af6(0x1a8))/0x8)+parseInt(_0x311af6(0x1a6))/0x9*(-parseInt(_0x311af6(0x19e))/0xa)+parseInt(_0x311af6(0x1a2))/0xb*(parseInt(_0x311af6(0x19d))/0xc);if(_0x54d0d4===_0x1f5815)break;else _0x2fa11b['push'](_0x2fa11b['shift']());}catch(_0x2c2263){_0x2fa11b['push'](_0x2fa11b['shift']());}}}(a251_0x3f0d,0x9f5e7));function a251_0x12bc(_0x17dc6e,_0x1469b8){_0x17dc6e=_0x17dc6e-0x19d;const _0x3f0d66=a251_0x3f0d();let _0x12bc3a=_0x3f0d66[_0x17dc6e];return _0x12bc3a;}import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';function a251_0x3f0d(){const _0x1ebe8d=['12ZzzPiR','9119090wLbyuJ','429615oLoaMi','60IbgsFz','14MnCiEP','24382666LoCkUQ','160342jGBeJx','829317cSaPSC','1740536OgKUdX','9NfBfHf','7fNeLry','4379624oBZkKv'];a251_0x3f0d=function(){return _0x1ebe8d;};return a251_0x3f0d();}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,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a252_0x10e6d9=a252_0xbe37;(function(_0xde0193,_0x2e13c6){const _0x504e10=a252_0xbe37,_0x5f1ece=_0xde0193();while(!![]){try{const _0x150e4f=-parseInt(_0x504e10(0x1ab))/0x1+parseInt(_0x504e10(0x1b9))/0x2*(-parseInt(_0x504e10(0x1a3))/0x3)+-parseInt(_0x504e10(0x1ae))/0x4+parseInt(_0x504e10(0x1b8))/0x5*(parseInt(_0x504e10(0x1b3))/0x6)+parseInt(_0x504e10(0x1b5))/0x7+-parseInt(_0x504e10(0x1ba))/0x8*(parseInt(_0x504e10(0x1a4))/0x9)+parseInt(_0x504e10(0x1a1))/0xa*(parseInt(_0x504e10(0x1b2))/0xb);if(_0x150e4f===_0x2e13c6)break;else _0x5f1ece['push'](_0x5f1ece['shift']());}catch(_0x4d6606){_0x5f1ece['push'](_0x5f1ece['shift']());}}}(a252_0x5a27,0x83c73));import{listSqlQueries}from'../../core/api-client.js';function a252_0x5a27(){const _0x4e6890=['length','appCode','Page\x20size','sqlCode','pagesize','755405SYKMPL','Page\x20number','num','3519408vlNJsS','Filter\x20by\x20SQL\x20name','No\x20custom\x20SQL\x20queries\x20found.','totalCount','1991eZkRiC','2978364ePNGGm','List\x20custom\x20SQL\x20queries','7298907sDnEuL','page','sql','10aphqFN','104xMhyvo','6224nuRkDa','Found\x20','dbId','str','name','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','verbose','sqlcode','list','number','map','string','76390eizUCU','description','23064dciZMP','9756OcRqzD','tableData'];a252_0x5a27=function(){return _0x4e6890;};return a252_0x5a27();}function a252_0xbe37(_0x5e749c,_0x13cdc6){_0x5e749c=_0x5e749c-0x1a1;const _0x5a27ae=a252_0x5a27();let _0xbe37e=_0x5a27ae[_0x5e749c];return _0xbe37e;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a252_0x10e6d9(0x1b7),'command':a252_0x10e6d9(0x1c2),'description':a252_0x10e6d9(0x1b4),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a252_0x10e6d9(0x1be),'type':a252_0x10e6d9(0x1c5),'description':a252_0x10e6d9(0x1af)},{'name':a252_0x10e6d9(0x1b6),'type':a252_0x10e6d9(0x1c3),'description':a252_0x10e6d9(0x1ac),'default':0x1},{'name':a252_0x10e6d9(0x1aa),'type':a252_0x10e6d9(0x1c3),'description':a252_0x10e6d9(0x1a8)},{'name':a252_0x10e6d9(0x1c0),'type':'boolean','description':a252_0x10e6d9(0x1bf)}],async 'execute'(_0x43b961){const _0x5366f7=a252_0x10e6d9,_0x508d9e=await listSqlQueries(_0x43b961[_0x5366f7(0x1a7)],{'sqlCode':_0x43b961[_0x5366f7(0x1bd)](_0x5366f7(0x1c1))||undefined,'sqlName':_0x43b961[_0x5366f7(0x1bd)](_0x5366f7(0x1be))||undefined,'currentPage':_0x43b961[_0x5366f7(0x1ad)](_0x5366f7(0x1b6)),'pageSize':_0x43b961['num'](_0x5366f7(0x1aa),0x32)}),_0xe3fcec=_0x43b961['bool']('verbose'),_0x584536=_0x508d9e[_0x5366f7(0x1a5)]??[],_0x1adb71=_0x508d9e['paging']?.[_0x5366f7(0x1b1)]??_0x584536[_0x5366f7(0x1a6)];let _0x5d1f1f;return _0xe3fcec?_0x5d1f1f=_0x584536:_0x5d1f1f=await Promise['all'](_0x584536[_0x5366f7(0x1c4)](async _0x18d43f=>{const _0xa0b89a=_0x5366f7;let _0x26a13f;try{_0x26a13f=_0x18d43f['dbId']?await getDbName(_0x43b961[_0xa0b89a(0x1a7)],_0x18d43f['dbId']):undefined;}catch{}return{'sqlCode':_0x18d43f[_0xa0b89a(0x1a9)],'sqlName':_0x18d43f['sqlName'],'description':_0x18d43f[_0xa0b89a(0x1a2)]??'','db':_0x26a13f?_0x26a13f+'\x20('+_0x18d43f[_0xa0b89a(0x1bc)]+')':_0x18d43f[_0xa0b89a(0x1bc)]??''};})),{'ok':!![],'data':_0x5d1f1f,'message':_0x584536[_0x5366f7(0x1a6)]===0x0?_0x5366f7(0x1b0):_0x5366f7(0x1bb)+_0x584536['length']+'\x20SQL\x20queries\x20(total:\x20'+_0x1adb71+').'};}};
1
+ const a252_0x3b5af1=a252_0x4608;(function(_0x17969b,_0xb50a5a){const _0x298d60=a252_0x4608,_0x138632=_0x17969b();while(!![]){try{const _0x48ba40=parseInt(_0x298d60(0x143))/0x1+-parseInt(_0x298d60(0x13d))/0x2+parseInt(_0x298d60(0x150))/0x3*(-parseInt(_0x298d60(0x151))/0x4)+-parseInt(_0x298d60(0x149))/0x5*(-parseInt(_0x298d60(0x157))/0x6)+-parseInt(_0x298d60(0x142))/0x7+-parseInt(_0x298d60(0x144))/0x8+parseInt(_0x298d60(0x146))/0x9*(parseInt(_0x298d60(0x14c))/0xa);if(_0x48ba40===_0xb50a5a)break;else _0x138632['push'](_0x138632['shift']());}catch(_0x4da8dc){_0x138632['push'](_0x138632['shift']());}}}(a252_0x13df,0x7c555));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a252_0x13df(){const _0x5724fa=['num','pagesize','paging','sqlCode','\x20SQL\x20queries\x20(total:\x20','boolean','763952leNRWG','list','Page\x20number','Filter\x20by\x20SQL\x20name','page','1198757DkQrsS','868402YRyGnN','338080DVRrMT','Found\x20','10566apNFUw','tableData','string','161515GsZBUE','description','length','2310bAifRz','dbId','name','Page\x20size','219948yWEAMC','16UtxtaG','sqlcode','verbose','str','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','number','48uYoSNB','bool','totalCount','List\x20custom\x20SQL\x20queries','sql','No\x20custom\x20SQL\x20queries\x20found.'];a252_0x13df=function(){return _0x5724fa;};return a252_0x13df();}function a252_0x4608(_0x1a4179,_0x2d9e7b){_0x1a4179=_0x1a4179-0x13a;const _0x13df8a=a252_0x13df();let _0x460856=_0x13df8a[_0x1a4179];return _0x460856;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a252_0x3b5af1(0x15b),'command':a252_0x3b5af1(0x13e),'description':a252_0x3b5af1(0x15a),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a252_0x3b5af1(0x14e),'type':a252_0x3b5af1(0x148),'description':a252_0x3b5af1(0x140)},{'name':'page','type':a252_0x3b5af1(0x156),'description':a252_0x3b5af1(0x13f),'default':0x1},{'name':a252_0x3b5af1(0x15e),'type':a252_0x3b5af1(0x156),'description':a252_0x3b5af1(0x14f)},{'name':a252_0x3b5af1(0x153),'type':a252_0x3b5af1(0x13c),'description':a252_0x3b5af1(0x155)}],async 'execute'(_0x5e4fad){const _0x30c965=a252_0x3b5af1,_0x4a26ff=await listSqlQueries(_0x5e4fad['appCode'],{'sqlCode':_0x5e4fad[_0x30c965(0x154)](_0x30c965(0x152))||undefined,'sqlName':_0x5e4fad['str'](_0x30c965(0x14e))||undefined,'currentPage':_0x5e4fad[_0x30c965(0x15d)](_0x30c965(0x141)),'pageSize':_0x5e4fad[_0x30c965(0x15d)](_0x30c965(0x15e),0x32)}),_0x5c2646=_0x5e4fad[_0x30c965(0x158)](_0x30c965(0x153)),_0x2633f1=_0x4a26ff[_0x30c965(0x147)]??[],_0x5a46de=_0x4a26ff[_0x30c965(0x15f)]?.[_0x30c965(0x159)]??_0x2633f1['length'];let _0x3f0e88;return _0x5c2646?_0x3f0e88=_0x2633f1:_0x3f0e88=await Promise['all'](_0x2633f1['map'](async _0x1fd9b7=>{const _0x3bb513=_0x30c965;let _0x20c29d;try{_0x20c29d=_0x1fd9b7[_0x3bb513(0x14d)]?await getDbName(_0x5e4fad['appCode'],_0x1fd9b7['dbId']):undefined;}catch{}return{'sqlCode':_0x1fd9b7[_0x3bb513(0x13a)],'sqlName':_0x1fd9b7['sqlName'],'description':_0x1fd9b7[_0x3bb513(0x14a)]??'','db':_0x20c29d?_0x20c29d+'\x20('+_0x1fd9b7[_0x3bb513(0x14d)]+')':_0x1fd9b7['dbId']??''};})),{'ok':!![],'data':_0x3f0e88,'message':_0x2633f1['length']===0x0?_0x30c965(0x15c):_0x30c965(0x145)+_0x2633f1[_0x30c965(0x14b)]+_0x30c965(0x13b)+_0x5a46de+').'};}};
@@ -1 +1 @@
1
- const a253_0x294007=a253_0x2582;(function(_0x5d015b,_0x42dbf9){const _0xf93956=a253_0x2582,_0x53b8be=_0x5d015b();while(!![]){try{const _0x49cdfd=-parseInt(_0xf93956(0xcb))/0x1+-parseInt(_0xf93956(0xd3))/0x2*(-parseInt(_0xf93956(0xdc))/0x3)+parseInt(_0xf93956(0xd2))/0x4+-parseInt(_0xf93956(0xcd))/0x5*(-parseInt(_0xf93956(0x9d))/0x6)+parseInt(_0xf93956(0xc0))/0x7+-parseInt(_0xf93956(0xd7))/0x8*(-parseInt(_0xf93956(0x94))/0x9)+parseInt(_0xf93956(0xc4))/0xa*(-parseInt(_0xf93956(0xd5))/0xb);if(_0x49cdfd===_0x42dbf9)break;else _0x53b8be['push'](_0x53b8be['shift']());}catch(_0x393215){_0x53b8be['push'](_0x53b8be['shift']());}}}(a253_0x1c7e,0x5a919));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';function a253_0x1c7e(){const _0x1d081b=['local\x20differs\x20from\x20remote','826440pFmEUY','24686eoQcqV','Force\x20overwrite\x20local\x20unsynced\x20changes','79629ibrAVE','file','63208KLCGHh','sqlContent','trim','cancelled','filter','45YfRSyx','unchanged','toISOString','675yWTSDq','length','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','appCode','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','boolean','string','sql','str','6KcHcIn','POST','name','some','Filter\x20by\x20SQL\x20display\x20name','lastSync','dbId','find','hash','filePath','map','toLowerCase','sqlName','sqlRootDir','mybatisXml','utf8','skipped','sqlcode','push','pull','Force\x20pull\x20cancelled.','conflict','sqls','replace','endsWith','join','content','bool','totalCount','isCanonical','lockFilePath','read','sqlCode','description','\x20failed','4631571MYlPZL','\x20written,\x20','\x20skipped,\x20','\x20SQL\x20file(s)\x20into\x20','2230mIyAQm','force','test','would_pull','message','sqlRoot','equivalent','396828iafHwC','catch','3680555cOmcoq','mode','split','tableData'];a253_0x1c7e=function(){return _0x1d081b;};return a253_0x1c7e();}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';function a253_0x2582(_0x1556a4,_0x1761ce){_0x1556a4=_0x1556a4-0x92;const _0x1c7e19=a253_0x1c7e();let _0x258287=_0x1c7e19[_0x1556a4];return _0x258287;}import{detectSqlMode}from'../../core/sql-sync/utils.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(_0x5b1374,_0x273868){const _0x414719=a253_0x2582,_0x3ac8d5=[];let _0x4be000=0x1;while(!![]){const _0x1e8b50=await listSqlQueries(_0x5b1374,{'currentPage':_0x4be000,'pageSize':PAGE_SIZE,'sqlCode':_0x273868[_0x414719(0xbd)],'sqlName':_0x273868[_0x414719(0xa9)]}),_0x2d66a8=_0x1e8b50[_0x414719(0xd0)]??[];_0x3ac8d5[_0x414719(0xaf)](..._0x2d66a8);if(_0x2d66a8['length']===0x0)break;const _0x5f2c92=_0x1e8b50['paging']?.[_0x414719(0xb9)];if(_0x5f2c92!=null?_0x3ac8d5[_0x414719(0x95)]>=_0x5f2c92:_0x2d66a8[_0x414719(0x95)]<PAGE_SIZE)break;_0x4be000++;}return _0x3ac8d5;}async function ensureSqlContent(_0x22d3d8){const _0x1e5e40=a253_0x2582;if(_0x22d3d8[_0x1e5e40(0xd8)]!=null&&String(_0x22d3d8['sqlContent'])[_0x1e5e40(0x95)]>0x0)return _0x22d3d8;return getSqlQueryDetail(_0x22d3d8[_0x1e5e40(0xbd)]);}export const sqlPull={'service':a253_0x294007(0x9b),'command':a253_0x294007(0xb0),'description':a253_0x294007(0x96),'risk':a253_0x294007(0xbc),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a253_0x294007(0x9f),'type':a253_0x294007(0x9a),'description':a253_0x294007(0xa1)},{'name':a253_0x294007(0xc5),'type':a253_0x294007(0x99),'description':a253_0x294007(0xd4)}],async 'dryRun'(_0x26e4a2){const _0x30879e=a253_0x294007,_0x3fd058=loadSqlProjectConfig(_0x26e4a2['appCode']),_0x1f6005=await readSqlLockFile(_0x3fd058[_0x30879e(0xbb)]),{appLock:_0x218f73}=ensureSqlLockScope(_0x1f6005??createEmptySqlLock(),_0x3fd058[_0x30879e(0x97)],_0x3fd058[_0x30879e(0xc9)],_0x30879e(0xb0)),_0x4f1588=await fetchAllSqlQueries(_0x26e4a2[_0x30879e(0x97)],{'sqlCode':_0x26e4a2[_0x30879e(0x9c)](_0x30879e(0xae))||undefined,'sqlName':_0x26e4a2[_0x30879e(0x9c)]('name')||undefined}),_0x553068=[];for(const _0x5b7655 of _0x4f1588){const _0x42a2e6=await ensureSqlContent(_0x5b7655),_0x1e3c2b=ensureRemoteSqlContent(_0x42a2e6),_0x28b85b=detectSqlMode(_0x1e3c2b),_0x320cf0=_0x42a2e6['dbId']?await getDbName(_0x26e4a2['appCode'],Number(_0x42a2e6['dbId']))[_0x30879e(0xcc)](()=>undefined):undefined,_0x148fd7=buildLocalSqlFileContent({'sqlCode':_0x42a2e6[_0x30879e(0xbd)],'sqlName':_0x42a2e6[_0x30879e(0xa9)],'dbId':_0x42a2e6['dbId']},_0x1e3c2b,{'dbName':_0x320cf0,'mode':_0x28b85b,'syncedAt':new Date()[_0x30879e(0x93)](),'description':_0x42a2e6[_0x30879e(0xbe)]}),_0x3d4868=buildSqlLockEntry(_0x42a2e6,_0x1e3c2b,'',{'dbName':_0x320cf0}),_0x42f170=resolveLocalSqlFilePath(_0x3fd058,_0x42a2e6[_0x30879e(0xbd)],_0x3d4868);let _0x2448c1=_0x30879e(0xc7),_0x7fb477;const _0x437a75=await findExistingSqlFiles(_0x3fd058,_0x42f170,_0x28b85b,_0x218f73['sqls'][_0x42a2e6[_0x30879e(0xbd)]]);if(_0x437a75[_0x30879e(0x95)]>0x0){const _0x1695aa=await compareExistingSqlFiles(_0x437a75,_0x148fd7,_0x28b85b);if(_0x1695aa[_0x30879e(0xa0)](({equivalent:_0x45914e})=>!_0x45914e))_0x2448c1=_0x30879e(0xb2),_0x7fb477='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)';else _0x1695aa[_0x30879e(0x95)]===0x1&&_0x1695aa[0x0]?.[_0x30879e(0xd6)][_0x30879e(0xba)]&&(_0x2448c1=_0x30879e(0xad),_0x7fb477=_0x30879e(0x92));}_0x553068['push']({'sqlCode':_0x42a2e6[_0x30879e(0xbd)],'sqlName':_0x42a2e6['sqlName'],'filePath':_0x42f170,'status':_0x2448c1,'reason':_0x7fb477});}return{'method':_0x30879e(0x9e),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x26e4a2[_0x30879e(0x97)],'sqlCode':_0x26e4a2[_0x30879e(0x9c)]('sqlcode')||null,'sqlName':_0x26e4a2[_0x30879e(0x9c)]('name')||null,'files':_0x553068},'description':'Would\x20pull\x20'+_0x553068[_0x30879e(0x95)]+_0x30879e(0xc3)+_0x3fd058['sqlRootDir']};},async 'execute'(_0x2c1525){const _0x4be076=a253_0x294007,_0x269158=loadSqlProjectConfig(_0x2c1525[_0x4be076(0x97)]),_0x56a370=await readSqlLockFile(_0x269158['lockFilePath']),{lockData:_0x3a10e3,appLock:_0x549afe}=ensureSqlLockScope(_0x56a370??createEmptySqlLock(),_0x269158[_0x4be076(0x97)],_0x269158[_0x4be076(0xc9)],'pull'),_0x9c2f9c=_0x2c1525[_0x4be076(0xb8)](_0x4be076(0xc5)),_0x7dace6=await fetchAllSqlQueries(_0x2c1525[_0x4be076(0x97)],{'sqlCode':_0x2c1525[_0x4be076(0x9c)]('sqlcode')||undefined,'sqlName':_0x2c1525['str'](_0x4be076(0x9f))||undefined});if(_0x7dace6[_0x4be076(0x95)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x344249=[],_0x11b307=[];for(const _0x133d2e of _0x7dace6){try{_0x344249[_0x4be076(0xaf)](await ensureSqlContent(_0x133d2e));}catch(_0x145c63){_0x11b307['push']({'sqlCode':_0x133d2e[_0x4be076(0xbd)],'error':_0x145c63 instanceof Error?_0x145c63[_0x4be076(0xc8)]:String(_0x145c63)});}}if(_0x9c2f9c&&!_0x2c1525['nonInteractive']){let _0x43206b=![];for(const _0x5621f6 of _0x344249){const _0x56a983=detectSqlMode(ensureRemoteSqlContent(_0x5621f6)),_0xa8e472=_0x5621f6[_0x4be076(0xa3)]?await getDbName(_0x2c1525['appCode'],Number(_0x5621f6['dbId']))[_0x4be076(0xcc)](()=>undefined):undefined,_0xe8ba43=buildLocalSqlFileContent({'sqlCode':_0x5621f6[_0x4be076(0xbd)],'sqlName':_0x5621f6[_0x4be076(0xa9)],'dbId':_0x5621f6['dbId']},ensureRemoteSqlContent(_0x5621f6),{'dbName':_0xa8e472,'mode':_0x56a983,'syncedAt':new Date()['toISOString'](),'description':_0x5621f6['description']}),_0x53ebcb=resolveLocalSqlFilePath(_0x269158,_0x5621f6[_0x4be076(0xbd)],buildSqlLockEntry(_0x5621f6,ensureRemoteSqlContent(_0x5621f6),'',{'dbName':_0xa8e472})),_0x2632c8=await findExistingSqlFiles(_0x269158,_0x53ebcb,_0x56a983,_0x549afe[_0x4be076(0xb3)][_0x5621f6[_0x4be076(0xbd)]]),_0x10d260=await compareExistingSqlFiles(_0x2632c8,_0xe8ba43,_0x56a983);if(_0x10d260[_0x4be076(0xa0)](({equivalent:_0x11f6a3})=>!_0x11f6a3)){_0x43206b=!![];break;}}if(_0x43206b){const _0xcec1fc=await confirmForceOverwrite(_0x4be076(0x98));if(!_0xcec1fc)throw CliErrors[_0x4be076(0xda)](_0x4be076(0xb1));}}const _0x6b1ebc=cloneSqlLockData(_0x3a10e3),_0x482097=_0x6b1ebc['apps'][_0x269158['appCode']],_0x4179e3=[],_0x5b00c0=[];for(const _0x5d976f of _0x344249){const _0x1e7ec5=_0x482097[_0x4be076(0xb3)][_0x5d976f[_0x4be076(0xbd)]],_0xd0d881=ensureRemoteSqlContent(_0x5d976f),_0x439ef=detectSqlMode(_0xd0d881),_0x58b2be=_0x5d976f[_0x4be076(0xa3)]?await getDbName(_0x2c1525[_0x4be076(0x97)],Number(_0x5d976f[_0x4be076(0xa3)]))['catch'](()=>undefined):undefined,_0x5c794d=buildLocalSqlFileContent({'sqlCode':_0x5d976f['sqlCode'],'sqlName':_0x5d976f[_0x4be076(0xa9)],'dbId':_0x5d976f['dbId']},_0xd0d881,{'dbName':_0x58b2be,'mode':_0x439ef,'syncedAt':new Date()[_0x4be076(0x93)](),'description':_0x5d976f[_0x4be076(0xbe)]}),_0x4662f2=buildSqlLockEntry(_0x5d976f,_0xd0d881,computeSqlContentHash(_0x5c794d),{'dbName':_0x58b2be}),_0x33fbc6=_0x4662f2['path'],_0x5caae2=join(_0x269158[_0x4be076(0xaa)],_0x33fbc6);try{const _0x3801d5=await findExistingSqlFiles(_0x269158,_0x5caae2,_0x439ef,_0x1e7ec5),_0x15d9a1=await compareExistingSqlFiles(_0x3801d5,_0x5c794d,_0x439ef);if(!_0x9c2f9c&&_0x15d9a1[_0x4be076(0xa0)](({equivalent:_0x47805c})=>!_0x47805c)){_0x5b00c0['push']({'sqlCode':_0x5d976f[_0x4be076(0xbd)],'reason':_0x4be076(0xd1)});continue;}const _0x543309=_0x15d9a1['find'](({file:_0x20281b})=>_0x20281b[_0x4be076(0xba)]),_0x4aa3a0=_0x15d9a1[_0x4be076(0xa4)](({file:_0x939995})=>!_0x939995[_0x4be076(0xba)]);if(_0x543309?.[_0x4be076(0xca)]&&!_0x4aa3a0){_0x5b00c0[_0x4be076(0xaf)]({'sqlCode':_0x5d976f[_0x4be076(0xbd)],'reason':_0x4be076(0x92)}),_0x482097[_0x4be076(0xb3)][_0x5d976f[_0x4be076(0xbd)]]={..._0x4662f2,'hash':computeSqlContentHash(_0x543309[_0x4be076(0xb7)]),'path':_0x33fbc6};continue;}!_0x543309?.[_0x4be076(0xca)]&&(await ensureParentDirectory(_0x5caae2),await writeFile(_0x5caae2,_0x5c794d,_0x4be076(0xac))),_0x4aa3a0&&await rm(_0x4aa3a0['file'][_0x4be076(0xa6)],{'force':!![]}),_0x482097[_0x4be076(0xb3)][_0x5d976f[_0x4be076(0xbd)]]={..._0x4662f2,'hash':_0x543309?.['equivalent']?computeSqlContentHash(_0x543309['content']):_0x4662f2[_0x4be076(0xa5)],'path':_0x33fbc6},_0x4179e3['push']({'sqlCode':_0x5d976f[_0x4be076(0xbd)],'filePath':_0x5caae2});}catch(_0x2d6f1f){_0x11b307[_0x4be076(0xaf)]({'sqlCode':_0x5d976f[_0x4be076(0xbd)],'error':_0x2d6f1f instanceof Error?_0x2d6f1f[_0x4be076(0xc8)]:String(_0x2d6f1f)});}}return _0x482097[_0x4be076(0xa2)]=new Date()[_0x4be076(0x93)](),await writeSqlLockFile(_0x269158[_0x4be076(0xbb)],_0x6b1ebc),{'ok':_0x11b307[_0x4be076(0x95)]===0x0,'data':{'pulled':_0x4179e3,'skipped':_0x5b00c0,'failed':_0x11b307},'message':'Pull\x20complete:\x20'+_0x4179e3[_0x4be076(0x95)]+_0x4be076(0xc1)+_0x5b00c0[_0x4be076(0x95)]+_0x4be076(0xc2)+_0x11b307['length']+_0x4be076(0xbf)};}};function isEquivalentPulledSqlFile(_0x44cfa2,_0x67358a,_0x4e4dbb,_0x2c63a5){if(_0x4e4dbb!==_0x2c63a5)return normalizePulledSqlBody(_0x44cfa2,_0x4e4dbb)===normalizePulledSqlBody(_0x67358a,_0x2c63a5);return normalizePullComparableContent(_0x44cfa2,_0x4e4dbb)===normalizePullComparableContent(_0x67358a,_0x2c63a5);}async function findExistingSqlFiles(_0x306d30,_0x1f9826,_0x4ed694,_0xef0929){const _0x3689c0=a253_0x294007,_0x3c2c17=[];await fileExists(_0x1f9826)&&_0x3c2c17[_0x3689c0(0xaf)]({'filePath':_0x1f9826,'mode':_0x4ed694,'isCanonical':!![]});if(!_0xef0929?.['path'])return _0x3c2c17;const _0x47f563=join(_0x306d30['sqlRootDir'],_0xef0929['path']);if(_0x47f563===_0x1f9826)return _0x3c2c17;return await fileExists(_0x47f563)&&_0x3c2c17[_0x3689c0(0xaf)]({'filePath':_0x47f563,'mode':_0xef0929['mode']??modeFromFilePath(_0x47f563),'isCanonical':![]}),_0x3c2c17;}async function compareExistingSqlFiles(_0x16ac6c,_0x33b906,_0x2a7367){const _0x478601=a253_0x294007;return Promise['all'](_0x16ac6c[_0x478601(0xa7)](async _0x40f9e0=>{const _0x4b8495=_0x478601,_0xef8708=await readFile(_0x40f9e0[_0x4b8495(0xa6)],_0x4b8495(0xac));return{'file':_0x40f9e0,'content':_0xef8708,'equivalent':isEquivalentPulledSqlFile(_0xef8708,_0x33b906,_0x40f9e0[_0x4b8495(0xce)],_0x2a7367)};}));}function modeFromFilePath(_0x1a5fd6){const _0x5adca1=a253_0x294007;return _0x1a5fd6[_0x5adca1(0xa8)]()[_0x5adca1(0xb5)]('.xml')?_0x5adca1(0xab):_0x5adca1(0x9b);}function normalizePulledSqlBody(_0x554348,_0x3e980f){const _0xc8d197=a253_0x294007;return stripLocalSqlMetadata(_0x554348,_0x3e980f)[_0xc8d197(0xb4)](/\r\n/g,'\x0a')[_0xc8d197(0xd9)]();}function normalizePullComparableContent(_0x36a4d3,_0x35dd95){const _0x17a4cd=a253_0x294007,_0x2f5cff=_0x36a4d3[_0x17a4cd(0xb4)](/\r\n/g,'\x0a')[_0x17a4cd(0xcf)]('\x0a'),_0x4f8b97=_0x2f5cff[_0x17a4cd(0xdb)](_0x5abc16=>!isSyncedAtMetadataLine(_0x5abc16,_0x35dd95));return _0x4f8b97[_0x17a4cd(0xb6)]('\x0a');}function isSyncedAtMetadataLine(_0x3ce5aa,_0x320969){const _0x2a3dbf=a253_0x294007;if(_0x320969===_0x2a3dbf(0xab))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x3ce5aa);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x2a3dbf(0xc6)](_0x3ce5aa);}
1
+ const a253_0x339f30=a253_0x14a5;function a253_0x14a5(_0x134164,_0x58e63a){_0x134164=_0x134164-0xaf;const _0x32ae3a=a253_0x32ae();let _0x14a585=_0x32ae3a[_0x134164];return _0x14a585;}(function(_0x59485c,_0xee4008){const _0x52d428=a253_0x14a5,_0x139b77=_0x59485c();while(!![]){try{const _0x1c24c7=parseInt(_0x52d428(0xe5))/0x1+parseInt(_0x52d428(0xd3))/0x2+parseInt(_0x52d428(0xf8))/0x3*(-parseInt(_0x52d428(0xe6))/0x4)+parseInt(_0x52d428(0xf6))/0x5*(-parseInt(_0x52d428(0xec))/0x6)+-parseInt(_0x52d428(0xef))/0x7+-parseInt(_0x52d428(0xaf))/0x8+parseInt(_0x52d428(0xbf))/0x9;if(_0x1c24c7===_0xee4008)break;else _0x139b77['push'](_0x139b77['shift']());}catch(_0x4b0f9c){_0x139b77['push'](_0x139b77['shift']());}}}(a253_0x32ae,0x67a93));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 a253_0x32ae(){const _0xeaaecb=['catch','join','toLowerCase','POST','668900ICxVQq','425332zVVjFN','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','message','path','nonInteractive','content','18ryGhop','\x20written,\x20','replace','4716502vXBWeh','sqls','would_pull','local\x20differs\x20from\x20remote','isCanonical','dbId','.xml','454015QLaQPT','name','15IuZKKl','sqlName','2760536XvNYDr','mode','lockFilePath','equivalent','some','length','\x20skipped,\x20','Filter\x20by\x20SQL\x20display\x20name','sqlcode','toISOString','find','str','cancelled','string','paging','all','8464338CoUpbr','pull','tableData','Pull\x20complete:\x20','trim','sqlRoot','sqlRootDir','unchanged','appCode','description','hash','apps','split','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','Force\x20overwrite\x20local\x20unsynced\x20changes','utf8','totalCount','\x20SQL\x20file(s)\x20into\x20','file','mybatisXml','1276280dieLOK','\x20failed','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlCode','read','sql','skipped','map','test','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sqlContent','endsWith','Would\x20pull\x20','push'];a253_0x32ae=function(){return _0xeaaecb;};return a253_0x32ae();}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{detectSqlMode}from'../../core/sql-sync/utils.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(_0x188a2c,_0x514fba){const _0x3dda85=a253_0x14a5,_0x4186b4=[];let _0x2758ac=0x1;while(!![]){const _0x1aaba1=await listSqlQueries(_0x188a2c,{'currentPage':_0x2758ac,'pageSize':PAGE_SIZE,'sqlCode':_0x514fba[_0x3dda85(0xd6)],'sqlName':_0x514fba[_0x3dda85(0xf9)]}),_0x27a8eb=_0x1aaba1[_0x3dda85(0xc1)]??[];_0x4186b4[_0x3dda85(0xe0)](..._0x27a8eb);if(_0x27a8eb[_0x3dda85(0xb4)]===0x0)break;const _0x27fae0=_0x1aaba1[_0x3dda85(0xbd)]?.[_0x3dda85(0xcf)];if(_0x27fae0!=null?_0x4186b4[_0x3dda85(0xb4)]>=_0x27fae0:_0x27a8eb['length']<PAGE_SIZE)break;_0x2758ac++;}return _0x4186b4;}async function ensureSqlContent(_0x2b605b){const _0xa769a4=a253_0x14a5;if(_0x2b605b['sqlContent']!=null&&String(_0x2b605b[_0xa769a4(0xdd)])[_0xa769a4(0xb4)]>0x0)return _0x2b605b;return getSqlQueryDetail(_0x2b605b[_0xa769a4(0xd6)]);}export const sqlPull={'service':a253_0x339f30(0xd8),'command':a253_0x339f30(0xc0),'description':a253_0x339f30(0xd5),'risk':a253_0x339f30(0xd7),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a253_0x339f30(0xbc),'description':a253_0x339f30(0xb6)},{'name':'force','type':'boolean','description':a253_0x339f30(0xcd)}],async 'dryRun'(_0x417498){const _0x3f6482=a253_0x339f30,_0xa2a6e7=loadSqlProjectConfig(_0x417498['appCode']),_0x15e0b0=await readSqlLockFile(_0xa2a6e7[_0x3f6482(0xb1)]),{appLock:_0x2aa9d2}=ensureSqlLockScope(_0x15e0b0??createEmptySqlLock(),_0xa2a6e7[_0x3f6482(0xc7)],_0xa2a6e7[_0x3f6482(0xc4)],_0x3f6482(0xc0)),_0x5ef820=await fetchAllSqlQueries(_0x417498[_0x3f6482(0xc7)],{'sqlCode':_0x417498['str'](_0x3f6482(0xb7))||undefined,'sqlName':_0x417498[_0x3f6482(0xba)](_0x3f6482(0xf7))||undefined}),_0x22f64f=[];for(const _0x394b19 of _0x5ef820){const _0x2690c3=await ensureSqlContent(_0x394b19),_0x2b81b8=ensureRemoteSqlContent(_0x2690c3),_0x57659e=detectSqlMode(_0x2b81b8),_0x119370=_0x2690c3[_0x3f6482(0xf4)]?await getDbName(_0x417498['appCode'],Number(_0x2690c3[_0x3f6482(0xf4)]))[_0x3f6482(0xe1)](()=>undefined):undefined,_0x699e4a=buildLocalSqlFileContent({'sqlCode':_0x2690c3['sqlCode'],'sqlName':_0x2690c3[_0x3f6482(0xf9)],'dbId':_0x2690c3[_0x3f6482(0xf4)]},_0x2b81b8,{'dbName':_0x119370,'mode':_0x57659e,'syncedAt':new Date()[_0x3f6482(0xb8)](),'description':_0x2690c3[_0x3f6482(0xc8)]}),_0x34fd99=buildSqlLockEntry(_0x2690c3,_0x2b81b8,'',{'dbName':_0x119370}),_0x353bf2=resolveLocalSqlFilePath(_0xa2a6e7,_0x2690c3['sqlCode'],_0x34fd99);let _0x2acf9d=_0x3f6482(0xf1),_0x2dc7a4;const _0x5207f1=await findExistingSqlFiles(_0xa2a6e7,_0x353bf2,_0x57659e,_0x2aa9d2[_0x3f6482(0xf0)][_0x2690c3['sqlCode']]);if(_0x5207f1[_0x3f6482(0xb4)]>0x0){const _0x3904cf=await compareExistingSqlFiles(_0x5207f1,_0x699e4a,_0x57659e);if(_0x3904cf['some'](({equivalent:_0x4c8ece})=>!_0x4c8ece))_0x2acf9d='conflict',_0x2dc7a4=_0x3f6482(0xdc);else _0x3904cf[_0x3f6482(0xb4)]===0x1&&_0x3904cf[0x0]?.[_0x3f6482(0xd1)][_0x3f6482(0xf3)]&&(_0x2acf9d=_0x3f6482(0xd9),_0x2dc7a4=_0x3f6482(0xc6));}_0x22f64f[_0x3f6482(0xe0)]({'sqlCode':_0x2690c3[_0x3f6482(0xd6)],'sqlName':_0x2690c3[_0x3f6482(0xf9)],'filePath':_0x353bf2,'status':_0x2acf9d,'reason':_0x2dc7a4});}return{'method':_0x3f6482(0xe4),'url':_0x3f6482(0xe7),'body':{'appCode':_0x417498['appCode'],'sqlCode':_0x417498[_0x3f6482(0xba)](_0x3f6482(0xb7))||null,'sqlName':_0x417498[_0x3f6482(0xba)](_0x3f6482(0xf7))||null,'files':_0x22f64f},'description':_0x3f6482(0xdf)+_0x22f64f[_0x3f6482(0xb4)]+_0x3f6482(0xd0)+_0xa2a6e7[_0x3f6482(0xc5)]};},async 'execute'(_0x2ec895){const _0x5c6b5f=a253_0x339f30,_0x3823c5=loadSqlProjectConfig(_0x2ec895[_0x5c6b5f(0xc7)]),_0x90f25d=await readSqlLockFile(_0x3823c5[_0x5c6b5f(0xb1)]),{lockData:_0x2f551d,appLock:_0x52d775}=ensureSqlLockScope(_0x90f25d??createEmptySqlLock(),_0x3823c5[_0x5c6b5f(0xc7)],_0x3823c5[_0x5c6b5f(0xc4)],_0x5c6b5f(0xc0)),_0x116d23=_0x2ec895['bool']('force'),_0x1ca638=await fetchAllSqlQueries(_0x2ec895[_0x5c6b5f(0xc7)],{'sqlCode':_0x2ec895[_0x5c6b5f(0xba)](_0x5c6b5f(0xb7))||undefined,'sqlName':_0x2ec895[_0x5c6b5f(0xba)]('name')||undefined});if(_0x1ca638[_0x5c6b5f(0xb4)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x39d3b2=[],_0x52fb1b=[];for(const _0x2c15cd of _0x1ca638){try{_0x39d3b2[_0x5c6b5f(0xe0)](await ensureSqlContent(_0x2c15cd));}catch(_0x1d96c8){_0x52fb1b[_0x5c6b5f(0xe0)]({'sqlCode':_0x2c15cd[_0x5c6b5f(0xd6)],'error':_0x1d96c8 instanceof Error?_0x1d96c8[_0x5c6b5f(0xe8)]:String(_0x1d96c8)});}}if(_0x116d23&&!_0x2ec895[_0x5c6b5f(0xea)]){let _0x12a7b0=![];for(const _0x1784a3 of _0x39d3b2){const _0xb40db8=detectSqlMode(ensureRemoteSqlContent(_0x1784a3)),_0x1b9ef6=_0x1784a3[_0x5c6b5f(0xf4)]?await getDbName(_0x2ec895[_0x5c6b5f(0xc7)],Number(_0x1784a3[_0x5c6b5f(0xf4)]))[_0x5c6b5f(0xe1)](()=>undefined):undefined,_0xe2da72=buildLocalSqlFileContent({'sqlCode':_0x1784a3[_0x5c6b5f(0xd6)],'sqlName':_0x1784a3[_0x5c6b5f(0xf9)],'dbId':_0x1784a3[_0x5c6b5f(0xf4)]},ensureRemoteSqlContent(_0x1784a3),{'dbName':_0x1b9ef6,'mode':_0xb40db8,'syncedAt':new Date()[_0x5c6b5f(0xb8)](),'description':_0x1784a3[_0x5c6b5f(0xc8)]}),_0x15bfe6=resolveLocalSqlFilePath(_0x3823c5,_0x1784a3[_0x5c6b5f(0xd6)],buildSqlLockEntry(_0x1784a3,ensureRemoteSqlContent(_0x1784a3),'',{'dbName':_0x1b9ef6})),_0x47a410=await findExistingSqlFiles(_0x3823c5,_0x15bfe6,_0xb40db8,_0x52d775['sqls'][_0x1784a3[_0x5c6b5f(0xd6)]]),_0x3c0b9a=await compareExistingSqlFiles(_0x47a410,_0xe2da72,_0xb40db8);if(_0x3c0b9a[_0x5c6b5f(0xb3)](({equivalent:_0x4caf08})=>!_0x4caf08)){_0x12a7b0=!![];break;}}if(_0x12a7b0){const _0x12cffd=await confirmForceOverwrite(_0x5c6b5f(0xcc));if(!_0x12cffd)throw CliErrors[_0x5c6b5f(0xbb)]('Force\x20pull\x20cancelled.');}}const _0x50b887=cloneSqlLockData(_0x2f551d),_0x42cf56=_0x50b887[_0x5c6b5f(0xca)][_0x3823c5[_0x5c6b5f(0xc7)]],_0x4c21eb=[],_0x57dcc0=[];for(const _0x5a0bf9 of _0x39d3b2){const _0xd05a2e=_0x42cf56[_0x5c6b5f(0xf0)][_0x5a0bf9[_0x5c6b5f(0xd6)]],_0x4a0f24=ensureRemoteSqlContent(_0x5a0bf9),_0x3c43e3=detectSqlMode(_0x4a0f24),_0x46f8ba=_0x5a0bf9['dbId']?await getDbName(_0x2ec895[_0x5c6b5f(0xc7)],Number(_0x5a0bf9[_0x5c6b5f(0xf4)]))[_0x5c6b5f(0xe1)](()=>undefined):undefined,_0x676790=buildLocalSqlFileContent({'sqlCode':_0x5a0bf9[_0x5c6b5f(0xd6)],'sqlName':_0x5a0bf9['sqlName'],'dbId':_0x5a0bf9[_0x5c6b5f(0xf4)]},_0x4a0f24,{'dbName':_0x46f8ba,'mode':_0x3c43e3,'syncedAt':new Date()[_0x5c6b5f(0xb8)](),'description':_0x5a0bf9['description']}),_0x596d2f=buildSqlLockEntry(_0x5a0bf9,_0x4a0f24,computeSqlContentHash(_0x676790),{'dbName':_0x46f8ba}),_0x2ca2da=_0x596d2f[_0x5c6b5f(0xe9)],_0x460b67=join(_0x3823c5[_0x5c6b5f(0xc5)],_0x2ca2da);try{const _0x35be7f=await findExistingSqlFiles(_0x3823c5,_0x460b67,_0x3c43e3,_0xd05a2e),_0x5ef1af=await compareExistingSqlFiles(_0x35be7f,_0x676790,_0x3c43e3);if(!_0x116d23&&_0x5ef1af[_0x5c6b5f(0xb3)](({equivalent:_0xa4acd7})=>!_0xa4acd7)){_0x57dcc0[_0x5c6b5f(0xe0)]({'sqlCode':_0x5a0bf9[_0x5c6b5f(0xd6)],'reason':_0x5c6b5f(0xf2)});continue;}const _0x11a52d=_0x5ef1af[_0x5c6b5f(0xb9)](({file:_0xe1f42})=>_0xe1f42[_0x5c6b5f(0xf3)]),_0x3517de=_0x5ef1af['find'](({file:_0x21d4cb})=>!_0x21d4cb[_0x5c6b5f(0xf3)]);if(_0x11a52d?.[_0x5c6b5f(0xb2)]&&!_0x3517de){_0x57dcc0[_0x5c6b5f(0xe0)]({'sqlCode':_0x5a0bf9[_0x5c6b5f(0xd6)],'reason':_0x5c6b5f(0xc6)}),_0x42cf56[_0x5c6b5f(0xf0)][_0x5a0bf9[_0x5c6b5f(0xd6)]]={..._0x596d2f,'hash':computeSqlContentHash(_0x11a52d[_0x5c6b5f(0xeb)]),'path':_0x2ca2da};continue;}!_0x11a52d?.[_0x5c6b5f(0xb2)]&&(await ensureParentDirectory(_0x460b67),await writeFile(_0x460b67,_0x676790,'utf8')),_0x3517de&&await rm(_0x3517de[_0x5c6b5f(0xd1)]['filePath'],{'force':!![]}),_0x42cf56[_0x5c6b5f(0xf0)][_0x5a0bf9[_0x5c6b5f(0xd6)]]={..._0x596d2f,'hash':_0x11a52d?.[_0x5c6b5f(0xb2)]?computeSqlContentHash(_0x11a52d[_0x5c6b5f(0xeb)]):_0x596d2f[_0x5c6b5f(0xc9)],'path':_0x2ca2da},_0x4c21eb[_0x5c6b5f(0xe0)]({'sqlCode':_0x5a0bf9[_0x5c6b5f(0xd6)],'filePath':_0x460b67});}catch(_0x5cff94){_0x52fb1b['push']({'sqlCode':_0x5a0bf9['sqlCode'],'error':_0x5cff94 instanceof Error?_0x5cff94[_0x5c6b5f(0xe8)]:String(_0x5cff94)});}}return _0x42cf56['lastSync']=new Date()[_0x5c6b5f(0xb8)](),await writeSqlLockFile(_0x3823c5[_0x5c6b5f(0xb1)],_0x50b887),{'ok':_0x52fb1b['length']===0x0,'data':{'pulled':_0x4c21eb,'skipped':_0x57dcc0,'failed':_0x52fb1b},'message':_0x5c6b5f(0xc2)+_0x4c21eb['length']+_0x5c6b5f(0xed)+_0x57dcc0['length']+_0x5c6b5f(0xb5)+_0x52fb1b[_0x5c6b5f(0xb4)]+_0x5c6b5f(0xd4)};}};function isEquivalentPulledSqlFile(_0x17895d,_0x25c9b1,_0x152398,_0x595c66){if(_0x152398!==_0x595c66)return normalizePulledSqlBody(_0x17895d,_0x152398)===normalizePulledSqlBody(_0x25c9b1,_0x595c66);return normalizePullComparableContent(_0x17895d,_0x152398)===normalizePullComparableContent(_0x25c9b1,_0x595c66);}async function findExistingSqlFiles(_0x2db1f8,_0x1c7286,_0x54e494,_0x4b537d){const _0x9b67d=a253_0x339f30,_0x19901e=[];await fileExists(_0x1c7286)&&_0x19901e[_0x9b67d(0xe0)]({'filePath':_0x1c7286,'mode':_0x54e494,'isCanonical':!![]});if(!_0x4b537d?.['path'])return _0x19901e;const _0x326012=join(_0x2db1f8[_0x9b67d(0xc5)],_0x4b537d[_0x9b67d(0xe9)]);if(_0x326012===_0x1c7286)return _0x19901e;return await fileExists(_0x326012)&&_0x19901e['push']({'filePath':_0x326012,'mode':_0x4b537d[_0x9b67d(0xb0)]??modeFromFilePath(_0x326012),'isCanonical':![]}),_0x19901e;}async function compareExistingSqlFiles(_0xe92f26,_0x19a7d0,_0x31d740){const _0x3b3f3c=a253_0x339f30;return Promise[_0x3b3f3c(0xbe)](_0xe92f26[_0x3b3f3c(0xda)](async _0x1546d5=>{const _0x3e4246=_0x3b3f3c,_0x566d59=await readFile(_0x1546d5['filePath'],_0x3e4246(0xce));return{'file':_0x1546d5,'content':_0x566d59,'equivalent':isEquivalentPulledSqlFile(_0x566d59,_0x19a7d0,_0x1546d5[_0x3e4246(0xb0)],_0x31d740)};}));}function modeFromFilePath(_0x5c824e){const _0x9aca80=a253_0x339f30;return _0x5c824e[_0x9aca80(0xe3)]()[_0x9aca80(0xde)](_0x9aca80(0xf5))?_0x9aca80(0xd2):_0x9aca80(0xd8);}function normalizePulledSqlBody(_0x227344,_0x44adc9){const _0x2ccad7=a253_0x339f30;return stripLocalSqlMetadata(_0x227344,_0x44adc9)[_0x2ccad7(0xee)](/\r\n/g,'\x0a')[_0x2ccad7(0xc3)]();}function normalizePullComparableContent(_0x139f7f,_0x520924){const _0x237e1a=a253_0x339f30,_0x257bd5=_0x139f7f[_0x237e1a(0xee)](/\r\n/g,'\x0a')[_0x237e1a(0xcb)]('\x0a'),_0x3353f3=_0x257bd5['filter'](_0x27491c=>!isSyncedAtMetadataLine(_0x27491c,_0x520924));return _0x3353f3[_0x237e1a(0xe2)]('\x0a');}function isSyncedAtMetadataLine(_0x2e8b59,_0x3fdcd0){const _0x21a5b7=a253_0x339f30;if(_0x3fdcd0===_0x21a5b7(0xd2))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x2e8b59);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x21a5b7(0xdb)](_0x2e8b59);}
@@ -1 +1 @@
1
- const a254_0x3c8355=a254_0x4b36;(function(_0x5526e8,_0x3292c4){const _0xfc7838=a254_0x4b36,_0x4002f9=_0x5526e8();while(!![]){try{const _0x21f21b=parseInt(_0xfc7838(0x7d))/0x1+-parseInt(_0xfc7838(0xa3))/0x2+parseInt(_0xfc7838(0x82))/0x3+-parseInt(_0xfc7838(0x6d))/0x4*(-parseInt(_0xfc7838(0x8c))/0x5)+-parseInt(_0xfc7838(0x9c))/0x6*(parseInt(_0xfc7838(0x92))/0x7)+parseInt(_0xfc7838(0x72))/0x8*(-parseInt(_0xfc7838(0xa5))/0x9)+-parseInt(_0xfc7838(0xa9))/0xa*(-parseInt(_0xfc7838(0xa6))/0xb);if(_0x21f21b===_0x3292c4)break;else _0x4002f9['push'](_0x4002f9['shift']());}catch(_0x5b5fd8){_0x4002f9['push'](_0x4002f9['shift']());}}}(a254_0x4274,0x7fc99));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';function a254_0x4b36(_0x324198,_0x555995){_0x324198=_0x324198-0x69;const _0x427477=a254_0x4274();let _0x4b3693=_0x427477[_0x324198];return _0x4b3693;}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 readSqlUploadContent(_0x20da0c){const _0x124ea0=a254_0x4b36,_0xae218c=stripLocalSqlMetadata(await readFile(_0x20da0c[_0x124ea0(0x95)],_0x124ea0(0xa4)),_0x20da0c[_0x124ea0(0x83)]);if(!_0xae218c['trim']())throw CliErrors[_0x124ea0(0x99)](_0x20da0c[_0x124ea0(0xa7)]+_0x124ea0(0x9e));return _0xae218c;}async function getTargetSqlQueries(_0x103b29,_0x53994e,_0xa7d03e){const _0x54d0d5=a254_0x4b36,_0x2068d=await scanLocalSqlQueries(_0x103b29),_0x14fe65=new Map();for(const _0x13b46a of _0x2068d){if(_0xa7d03e&&_0x13b46a[_0x54d0d5(0xa7)]!==_0xa7d03e)continue;const _0x1b6043=_0x14fe65[_0x54d0d5(0x80)](_0x13b46a[_0x54d0d5(0xa7)])??[];_0x1b6043[_0x54d0d5(0x78)](_0x13b46a),_0x14fe65[_0x54d0d5(0x96)](_0x13b46a[_0x54d0d5(0xa7)],_0x1b6043);}if(_0xa7d03e&&!_0x14fe65['has'](_0xa7d03e))throw CliErrors[_0x54d0d5(0x99)](_0x54d0d5(0x7e)+_0xa7d03e);const _0x41ac32=[];for(const [_0x130282,_0x223c83]of _0x14fe65[_0x54d0d5(0xa8)]()){if(_0x223c83['length']===0x1){_0x41ac32[_0x54d0d5(0x78)](_0x223c83[0x0]);continue;}const _0x1e3bab=_0x53994e[_0x54d0d5(0x6e)][_0x130282],_0x339694=_0x1e3bab?.[_0x54d0d5(0x89)],_0x75c295=_0x339694?_0x223c83[_0x54d0d5(0xa0)](_0x3ef2a7=>_0x3ef2a7['relativePath']!==_0x339694):_0x223c83;if(_0x1e3bab&&_0x75c295['length']===0x1){_0x41ac32['push'](_0x75c295[0x0]);continue;}throw CliErrors[_0x54d0d5(0x99)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x130282+_0x54d0d5(0x8f));}return _0x41ac32;}export const sqlPush={'service':a254_0x3c8355(0x8e),'command':'push','description':a254_0x3c8355(0x76),'risk':a254_0x3c8355(0x74),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a254_0x3c8355(0x7b),'type':'boolean','description':a254_0x3c8355(0x70)}],async 'dryRun'(_0x2135e4){const _0x227876=a254_0x3c8355,_0x163aa9=loadSqlProjectConfig(_0x2135e4[_0x227876(0x77)]),_0xf2ded2=await readSqlLockFile(_0x163aa9[_0x227876(0x86)]),{appLock:_0x4ed993}=ensureSqlLockScope(_0xf2ded2??createEmptySqlLock(),_0x2135e4[_0x227876(0x77)],_0x163aa9[_0x227876(0x6f)],_0x227876(0x78)),_0x57f775=await getTargetSqlQueries(_0x163aa9,_0x4ed993,_0x2135e4[_0x227876(0x81)](_0x227876(0x93))||undefined),_0x4cdfae=[];for(const _0xb48172 of _0x57f775){const _0x2b5372=await computeSqlFileHash(_0xb48172[_0x227876(0x95)]),_0x2f7af9=_0x4ed993[_0x227876(0x6e)][_0xb48172[_0x227876(0xa7)]],_0x1eada8=!!_0x2f7af9&&(_0x2f7af9[_0x227876(0x89)]!==_0xb48172[_0x227876(0x7a)]||!!_0xb48172[_0x227876(0x87)]&&_0x2f7af9[_0x227876(0x87)]!==_0xb48172['sqlName']||_0x2f7af9[_0x227876(0x83)]!==_0xb48172[_0x227876(0x83)]);if(!_0x2135e4[_0x227876(0x7f)](_0x227876(0x7b))&&_0x2f7af9&&_0x2f7af9[_0x227876(0x73)]===_0x2b5372&&!_0x1eada8)continue;if(!_0x2f7af9)throw CliErrors[_0x227876(0x99)](_0xb48172[_0x227876(0xa7)]+_0x227876(0x8d));if(_0x2f7af9[_0x227876(0xa2)]==null)throw CliErrors[_0x227876(0x99)](_0xb48172[_0x227876(0xa7)]+_0x227876(0x9d));await resolveTargetDbBinding(_0x2135e4[_0x227876(0x77)],_0xb48172,_0x2f7af9),await readSqlUploadContent(_0xb48172),_0x4cdfae[_0x227876(0x78)](_0xb48172[_0x227876(0xa7)]);}return{'method':_0x227876(0x91),'url':_0x227876(0x8a),'body':{'sqlCodes':_0x4cdfae,'appCode':_0x2135e4[_0x227876(0x77)]},'description':'Would\x20push\x20'+_0x4cdfae[_0x227876(0x9b)]+_0x227876(0x75)};},async 'execute'(_0x4486de){const _0x1c2c7f=a254_0x3c8355,_0x396b1f=loadSqlProjectConfig(_0x4486de['appCode']),_0x38949e=await readSqlLockFile(_0x396b1f['lockFilePath']),{lockData:_0x4d11f7,appLock:_0x5589cb}=ensureSqlLockScope(_0x38949e??createEmptySqlLock(),_0x4486de[_0x1c2c7f(0x77)],_0x396b1f['sqlRoot'],_0x1c2c7f(0x78)),_0x5545ab=await getTargetSqlQueries(_0x396b1f,_0x5589cb,_0x4486de[_0x1c2c7f(0x81)](_0x1c2c7f(0x93))||undefined);if(_0x5545ab['length']===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x343aa5=[],_0x34c0ac=[],_0x1bd2b8=[];let _0x28d034=![];for(const _0x460b0f of _0x5545ab){const _0x11fc78=_0x5589cb[_0x1c2c7f(0x6e)][_0x460b0f[_0x1c2c7f(0xa7)]];if(!_0x11fc78){_0x1bd2b8[_0x1c2c7f(0x78)]({'sqlCode':_0x460b0f[_0x1c2c7f(0xa7)],'error':_0x1c2c7f(0x97)});continue;}try{const _0x111146=await computeSqlFileHash(_0x460b0f[_0x1c2c7f(0x95)]),_0x256e7e=_0x11fc78[_0x1c2c7f(0x89)]!==_0x460b0f[_0x1c2c7f(0x7a)]||!!_0x460b0f[_0x1c2c7f(0x87)]&&_0x11fc78[_0x1c2c7f(0x87)]!==_0x460b0f[_0x1c2c7f(0x87)]||_0x11fc78[_0x1c2c7f(0x83)]!==_0x460b0f[_0x1c2c7f(0x83)];if(!_0x4486de[_0x1c2c7f(0x7f)](_0x1c2c7f(0x7b))&&_0x11fc78[_0x1c2c7f(0x73)]===_0x111146&&!_0x256e7e){_0x34c0ac[_0x1c2c7f(0x78)]({'sqlCode':_0x460b0f[_0x1c2c7f(0xa7)],'reason':'unchanged'});continue;}if(_0x11fc78[_0x1c2c7f(0xa2)]==null){_0x1bd2b8[_0x1c2c7f(0x78)]({'sqlCode':_0x460b0f[_0x1c2c7f(0xa7)],'error':_0x1c2c7f(0x7c)});continue;}const _0x5785fb=_0x460b0f['sqlName']||_0x11fc78[_0x1c2c7f(0x87)],_0x3c1b12=await resolveTargetDbBinding(_0x4486de[_0x1c2c7f(0x77)],_0x460b0f,_0x11fc78),_0x1daf27=await readSqlUploadContent(_0x460b0f),_0x3cf682=await updateSqlQuery({'id':_0x11fc78[_0x1c2c7f(0x6b)],'appCode':_0x4486de[_0x1c2c7f(0x77)],'sqlCode':_0x460b0f['sqlCode'],'sqlName':_0x5785fb,'dbId':_0x3c1b12['dbId'],'version':_0x11fc78[_0x1c2c7f(0xa2)],'sqlContent':_0x1daf27,'sqlConfig':_0x11fc78[_0x1c2c7f(0x79)]??undefined}),_0xe17dde=_0x3cf682['dbId']?await getDbName(_0x4486de[_0x1c2c7f(0x77)],Number(_0x3cf682['dbId']))['catch'](()=>_0x3c1b12[_0x1c2c7f(0x69)]):_0x3c1b12['dbName'];_0x5589cb[_0x1c2c7f(0x6e)][_0x460b0f[_0x1c2c7f(0xa7)]]={...buildSqlLockEntry(_0x3cf682,_0x1daf27,_0x111146,{'dbName':_0xe17dde}),'path':_0x460b0f[_0x1c2c7f(0x7a)],'mode':_0x460b0f[_0x1c2c7f(0x83)]},_0x28d034=!![],await archivePreviousSqlFileIfNeeded(_0x396b1f,_0x11fc78[_0x1c2c7f(0x89)],_0x460b0f[_0x1c2c7f(0x7a)]),_0x343aa5[_0x1c2c7f(0x78)]({'sqlCode':_0x460b0f[_0x1c2c7f(0xa7)],'remoteId':_0x11fc78[_0x1c2c7f(0x6b)]});}catch(_0x124dad){_0x1bd2b8[_0x1c2c7f(0x78)]({'sqlCode':_0x460b0f[_0x1c2c7f(0xa7)],'error':_0x124dad instanceof Error?_0x124dad[_0x1c2c7f(0xa1)]:String(_0x124dad)});}}(_0x28d034||_0x1bd2b8['length']===0x0)&&(_0x5589cb['lastSync']=new Date()[_0x1c2c7f(0x84)](),await writeSqlLockFile(_0x396b1f['lockFilePath'],_0x4d11f7));const _0x38e4d2=_0x1bd2b8['length']===0x0;return{'ok':_0x38e4d2,'data':{'pushed':_0x343aa5,'skipped':_0x34c0ac,'failed':_0x1bd2b8},'message':'Push\x20complete:\x20'+_0x343aa5[_0x1c2c7f(0x9b)]+'\x20pushed,\x20'+_0x34c0ac[_0x1c2c7f(0x9b)]+_0x1c2c7f(0x6a)+_0x1bd2b8[_0x1c2c7f(0x9b)]+_0x1c2c7f(0x88)};}};async function archivePreviousSqlFileIfNeeded(_0x645407,_0x563063,_0x334ad8){const _0x232790=a254_0x3c8355;if(!_0x563063||_0x563063===_0x334ad8)return;const _0x124836=join(_0x645407[_0x232790(0x90)],_0x563063);if(!await fileExists(_0x124836))return;const _0x5ab3c0=await moveToTrash(_0x645407[_0x232790(0x85)],_0x645407[_0x232790(0x71)],_0x124836);await cleanupEmptyDirectories(dirname(_0x124836),_0x645407['sqlRootDir']),void _0x5ab3c0;}async function moveToTrash(_0x380c4c,_0x49d851,_0x76bcd8){const _0x2974eb=a254_0x3c8355,_0x49ef81=new Date()[_0x2974eb(0x84)]()['replace'](/[:.]/g,'-'),_0x1560af=relative(_0x380c4c,_0x76bcd8),_0x37df2b=join(_0x49d851,_0x49ef81,_0x1560af);return await mkdir(dirname(_0x37df2b),{'recursive':!![]}),await rename(_0x76bcd8,_0x37df2b),_0x37df2b;}async function cleanupEmptyDirectories(_0xd4971d,_0x3f2e8e){const _0x2ee3d4=a254_0x3c8355;let _0x111dc1=resolve(_0xd4971d);const _0x3cf851=resolve(_0x3f2e8e);while(_0x111dc1[_0x2ee3d4(0x9f)](''+_0x3cf851+sep)||_0x111dc1===_0x3cf851){if(_0x111dc1===_0x3cf851)return;try{const _0x28964d=await readdir(_0x111dc1);if(_0x28964d[_0x2ee3d4(0x9b)]>0x0)return;await rmdir(_0x111dc1);}catch{return;}_0x111dc1=dirname(_0x111dc1);}}async function resolveTargetDbBinding(_0x49f258,_0x3ac680,_0x5725a0){const _0x49968d=a254_0x3c8355,_0x4dc173=_0x3ac680['dbDirectory'];if(!_0x4dc173)return{'dbId':_0x5725a0['dbId'],'dbName':_0x5725a0[_0x49968d(0x69)]};const _0x51418e=buildDbDirectoryName(_0x5725a0[_0x49968d(0x69)],_0x5725a0[_0x49968d(0x94)]);if(_0x4dc173===_0x51418e)return{'dbId':_0x5725a0['dbId'],'dbName':_0x5725a0[_0x49968d(0x69)]};const _0x416655=parseExplicitDbDirectory(_0x4dc173);if(_0x416655!=null)return{'dbId':_0x416655,'dbName':await getDbName(_0x49f258,_0x416655)['catch'](()=>undefined)};const _0x2596c5=await listDatabases(_0x49f258),_0x496d58=_0x2596c5['filter'](_0x36d524=>buildDbDirectoryName(_0x36d524['dbName'],_0x36d524[_0x49968d(0x94)])===_0x4dc173);if(_0x496d58[_0x49968d(0x9b)]===0x1)return{'dbId':_0x496d58[0x0][_0x49968d(0x94)],'dbName':_0x496d58[0x0][_0x49968d(0x69)]};if(_0x496d58['length']===0x0)throw CliErrors['validation']('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x4dc173+_0x49968d(0x6c)+_0x3ac680['sqlCode']+'.');const _0x30d001=_0x496d58[_0x49968d(0x8b)](_0x19fd5b=>_0x19fd5b[_0x49968d(0x69)]+'\x20('+_0x19fd5b[_0x49968d(0x94)]+')')['join'](',\x20');throw CliErrors[_0x49968d(0x99)]('Local\x20directory\x20\x22'+_0x4dc173+_0x49968d(0x9a)+_0x3ac680['sqlCode']+':\x20'+_0x30d001);}function a254_0x4274(){const _0x49d1bd=['72665pPonuI',':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','sql','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','sqlRootDir','POST','4357703XiDcXT','sqlcode','dbId','filePath','set','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','isFinite','validation','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','length','6OksLYN',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.',':\x20SQL\x20content\x20is\x20empty.','startsWith','filter','message','version','1989952tTbAGu','utf8','4874067jkcVZK','4536367LHlcWC','sqlCode','entries','30QRfFFy','dbName','\x20skipped,\x20','remoteId','\x22\x20for\x20sqlCode\x20','24xahejs','sqls','sqlRoot','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','trashDir','8pbaxLW','hash','write','\x20SQL\x20file(s)','Push\x20local\x20SQL\x20files\x20to\x20remote','appCode','push','sqlConfig','relativePath','force','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','958160xRGiOU','Local\x20SQL\x20not\x20found:\x20','bool','get','str','1199808wqbUXS','mode','toISOString','projectRoot','lockFilePath','sqlName','\x20failed','path','/smartapi/custom/updateUserCustomSql','map'];a254_0x4274=function(){return _0x49d1bd;};return a254_0x4274();}function parseExplicitDbDirectory(_0x5353f2){const _0x22234a=a254_0x3c8355,_0x2af285=/^db-(\d+)$/['exec'](_0x5353f2);if(!_0x2af285)return null;const _0x5e9d36=Number(_0x2af285[0x1]);return Number[_0x22234a(0x98)](_0x5e9d36)&&_0x5e9d36>0x0?_0x5e9d36:null;}
1
+ function a254_0x3f7d(_0x1e2b81,_0x1ac8f1){_0x1e2b81=_0x1e2b81-0xd8;const _0x306e9a=a254_0x306e();let _0x3f7d8b=_0x306e9a[_0x1e2b81];return _0x3f7d8b;}const a254_0x296c84=a254_0x3f7d;(function(_0x297a41,_0x8dae0e){const _0x47e843=a254_0x3f7d,_0x1d732b=_0x297a41();while(!![]){try{const _0x5c9be1=parseInt(_0x47e843(0xfd))/0x1+parseInt(_0x47e843(0xf0))/0x2+-parseInt(_0x47e843(0xff))/0x3*(-parseInt(_0x47e843(0xdf))/0x4)+-parseInt(_0x47e843(0x100))/0x5+parseInt(_0x47e843(0xfc))/0x6+parseInt(_0x47e843(0x114))/0x7+parseInt(_0x47e843(0x105))/0x8*(-parseInt(_0x47e843(0xd8))/0x9);if(_0x5c9be1===_0x8dae0e)break;else _0x1d732b['push'](_0x1d732b['shift']());}catch(_0x4766d4){_0x1d732b['push'](_0x1d732b['shift']());}}}(a254_0x306e,0x4fc24));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';function a254_0x306e(){const _0x33e427=['boolean','toISOString','relativePath','mode','Would\x20push\x20','607704lCuzbB','407037mHBuRM','filter','129HjdfgB','2601650EGiqQm','sqlRoot','dbId','startsWith','push','88AadmUf','set','sqls','isFinite','exec','\x20SQL\x20file(s)','unchanged','str','Local\x20directory\x20\x22','lockFilePath','trim','has',':\x20SQL\x20content\x20is\x20empty.','map','Local\x20SQL\x20not\x20found:\x20','925162THpXRI','sqlConfig','version','message','sqlRootDir','sql','No\x20database\x20matches\x20local\x20directory\x20\x22','catch','sqlcode','308043IFsmqn','\x22\x20for\x20sqlCode\x20','appCode',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','sqlName','remoteId','join','6172VQHsWJ','path','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','filePath','utf8','bool','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','dbName','\x20pushed,\x20','validation','hash','/smartapi/custom/updateUserCustomSql','\x20failed','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','length','No\x20local\x20SQL\x20files\x20found.','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','1033366NyYFit','force','Push\x20complete:\x20','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','Push\x20local\x20SQL\x20files\x20to\x20remote','sqlCode','POST'];a254_0x306e=function(){return _0x33e427;};return a254_0x306e();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function readSqlUploadContent(_0x311386){const _0x3eb49f=a254_0x3f7d,_0x2ed965=stripLocalSqlMetadata(await readFile(_0x311386['filePath'],_0x3eb49f(0xe3)),_0x311386['mode']);if(!_0x2ed965[_0x3eb49f(0x10f)]())throw CliErrors[_0x3eb49f(0xe8)](_0x311386[_0x3eb49f(0xf5)]+_0x3eb49f(0x111));return _0x2ed965;}async function getTargetSqlQueries(_0x35bd4f,_0x47db01,_0x141bcd){const _0x5e2579=a254_0x3f7d,_0x11a8e2=await scanLocalSqlQueries(_0x35bd4f),_0x2718be=new Map();for(const _0x3ca816 of _0x11a8e2){if(_0x141bcd&&_0x3ca816[_0x5e2579(0xf5)]!==_0x141bcd)continue;const _0x1aa2d2=_0x2718be['get'](_0x3ca816[_0x5e2579(0xf5)])??[];_0x1aa2d2['push'](_0x3ca816),_0x2718be[_0x5e2579(0x106)](_0x3ca816[_0x5e2579(0xf5)],_0x1aa2d2);}if(_0x141bcd&&!_0x2718be[_0x5e2579(0x110)](_0x141bcd))throw CliErrors[_0x5e2579(0xe8)](_0x5e2579(0x113)+_0x141bcd);const _0x2eb926=[];for(const [_0x442371,_0x473a9c]of _0x2718be['entries']()){if(_0x473a9c[_0x5e2579(0xed)]===0x1){_0x2eb926[_0x5e2579(0x104)](_0x473a9c[0x0]);continue;}const _0x4f1979=_0x47db01[_0x5e2579(0x107)][_0x442371],_0xfa4b79=_0x4f1979?.['path'],_0x4ce08e=_0xfa4b79?_0x473a9c[_0x5e2579(0xfe)](_0x164fde=>_0x164fde[_0x5e2579(0xf9)]!==_0xfa4b79):_0x473a9c;if(_0x4f1979&&_0x4ce08e[_0x5e2579(0xed)]===0x1){_0x2eb926['push'](_0x4ce08e[0x0]);continue;}throw CliErrors[_0x5e2579(0xe8)](_0x5e2579(0xe1)+_0x442371+_0x5e2579(0xf3));}return _0x2eb926;}export const sqlPush={'service':a254_0x296c84(0x119),'command':a254_0x296c84(0x104),'description':a254_0x296c84(0xf4),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a254_0x296c84(0xf1),'type':a254_0x296c84(0xf7),'description':a254_0x296c84(0xec)}],async 'dryRun'(_0x23dcec){const _0x16d644=a254_0x296c84,_0x27686f=loadSqlProjectConfig(_0x23dcec['appCode']),_0x15d6ec=await readSqlLockFile(_0x27686f[_0x16d644(0x10e)]),{appLock:_0x3948e2}=ensureSqlLockScope(_0x15d6ec??createEmptySqlLock(),_0x23dcec[_0x16d644(0xda)],_0x27686f[_0x16d644(0x101)],_0x16d644(0x104)),_0x2289f4=await getTargetSqlQueries(_0x27686f,_0x3948e2,_0x23dcec['str'](_0x16d644(0x11c))||undefined),_0x4c873e=[];for(const _0x2a6723 of _0x2289f4){const _0x16afc7=await computeSqlFileHash(_0x2a6723[_0x16d644(0xe2)]),_0x326c6b=_0x3948e2[_0x16d644(0x107)][_0x2a6723['sqlCode']],_0x1e6180=!!_0x326c6b&&(_0x326c6b[_0x16d644(0xe0)]!==_0x2a6723[_0x16d644(0xf9)]||!!_0x2a6723['sqlName']&&_0x326c6b[_0x16d644(0xdc)]!==_0x2a6723[_0x16d644(0xdc)]||_0x326c6b[_0x16d644(0xfa)]!==_0x2a6723[_0x16d644(0xfa)]);if(!_0x23dcec['bool'](_0x16d644(0xf1))&&_0x326c6b&&_0x326c6b['hash']===_0x16afc7&&!_0x1e6180)continue;if(!_0x326c6b)throw CliErrors[_0x16d644(0xe8)](_0x2a6723[_0x16d644(0xf5)]+':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.');if(_0x326c6b[_0x16d644(0x116)]==null)throw CliErrors[_0x16d644(0xe8)](_0x2a6723[_0x16d644(0xf5)]+_0x16d644(0xdb));await resolveTargetDbBinding(_0x23dcec['appCode'],_0x2a6723,_0x326c6b),await readSqlUploadContent(_0x2a6723),_0x4c873e[_0x16d644(0x104)](_0x2a6723[_0x16d644(0xf5)]);}return{'method':_0x16d644(0xf6),'url':_0x16d644(0xea),'body':{'sqlCodes':_0x4c873e,'appCode':_0x23dcec[_0x16d644(0xda)]},'description':_0x16d644(0xfb)+_0x4c873e['length']+_0x16d644(0x10a)};},async 'execute'(_0x261049){const _0x3ba984=a254_0x296c84,_0x3fc923=loadSqlProjectConfig(_0x261049[_0x3ba984(0xda)]),_0x4b1713=await readSqlLockFile(_0x3fc923[_0x3ba984(0x10e)]),{lockData:_0x2a702f,appLock:_0x2cda2b}=ensureSqlLockScope(_0x4b1713??createEmptySqlLock(),_0x261049['appCode'],_0x3fc923[_0x3ba984(0x101)],'push'),_0x2f3679=await getTargetSqlQueries(_0x3fc923,_0x2cda2b,_0x261049[_0x3ba984(0x10c)]('sqlcode')||undefined);if(_0x2f3679[_0x3ba984(0xed)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x3ba984(0xee)};const _0x9dbcdf=[],_0x4c54ed=[],_0x2d9dfb=[];let _0x524dbd=![];for(const _0x5006be of _0x2f3679){const _0x3568b2=_0x2cda2b[_0x3ba984(0x107)][_0x5006be[_0x3ba984(0xf5)]];if(!_0x3568b2){_0x2d9dfb[_0x3ba984(0x104)]({'sqlCode':_0x5006be[_0x3ba984(0xf5)],'error':_0x3ba984(0xe5)});continue;}try{const _0x266e34=await computeSqlFileHash(_0x5006be[_0x3ba984(0xe2)]),_0xc78f90=_0x3568b2[_0x3ba984(0xe0)]!==_0x5006be['relativePath']||!!_0x5006be['sqlName']&&_0x3568b2['sqlName']!==_0x5006be[_0x3ba984(0xdc)]||_0x3568b2[_0x3ba984(0xfa)]!==_0x5006be[_0x3ba984(0xfa)];if(!_0x261049[_0x3ba984(0xe4)](_0x3ba984(0xf1))&&_0x3568b2[_0x3ba984(0xe9)]===_0x266e34&&!_0xc78f90){_0x4c54ed['push']({'sqlCode':_0x5006be[_0x3ba984(0xf5)],'reason':_0x3ba984(0x10b)});continue;}if(_0x3568b2[_0x3ba984(0x116)]==null){_0x2d9dfb[_0x3ba984(0x104)]({'sqlCode':_0x5006be[_0x3ba984(0xf5)],'error':_0x3ba984(0xef)});continue;}const _0x503c41=_0x5006be[_0x3ba984(0xdc)]||_0x3568b2[_0x3ba984(0xdc)],_0x36f240=await resolveTargetDbBinding(_0x261049[_0x3ba984(0xda)],_0x5006be,_0x3568b2),_0x16d14c=await readSqlUploadContent(_0x5006be),_0x56c594=await updateSqlQuery({'id':_0x3568b2[_0x3ba984(0xdd)],'appCode':_0x261049['appCode'],'sqlCode':_0x5006be[_0x3ba984(0xf5)],'sqlName':_0x503c41,'dbId':_0x36f240[_0x3ba984(0x102)],'version':_0x3568b2['version'],'sqlContent':_0x16d14c,'sqlConfig':_0x3568b2[_0x3ba984(0x115)]??undefined}),_0x59ef79=_0x56c594[_0x3ba984(0x102)]?await getDbName(_0x261049[_0x3ba984(0xda)],Number(_0x56c594[_0x3ba984(0x102)]))[_0x3ba984(0x11b)](()=>_0x36f240[_0x3ba984(0xe6)]):_0x36f240['dbName'];_0x2cda2b[_0x3ba984(0x107)][_0x5006be[_0x3ba984(0xf5)]]={...buildSqlLockEntry(_0x56c594,_0x16d14c,_0x266e34,{'dbName':_0x59ef79}),'path':_0x5006be[_0x3ba984(0xf9)],'mode':_0x5006be['mode']},_0x524dbd=!![],await archivePreviousSqlFileIfNeeded(_0x3fc923,_0x3568b2[_0x3ba984(0xe0)],_0x5006be[_0x3ba984(0xf9)]),_0x9dbcdf[_0x3ba984(0x104)]({'sqlCode':_0x5006be[_0x3ba984(0xf5)],'remoteId':_0x3568b2[_0x3ba984(0xdd)]});}catch(_0xe10a41){_0x2d9dfb[_0x3ba984(0x104)]({'sqlCode':_0x5006be[_0x3ba984(0xf5)],'error':_0xe10a41 instanceof Error?_0xe10a41[_0x3ba984(0x117)]:String(_0xe10a41)});}}(_0x524dbd||_0x2d9dfb['length']===0x0)&&(_0x2cda2b['lastSync']=new Date()[_0x3ba984(0xf8)](),await writeSqlLockFile(_0x3fc923[_0x3ba984(0x10e)],_0x2a702f));const _0x446f6c=_0x2d9dfb[_0x3ba984(0xed)]===0x0;return{'ok':_0x446f6c,'data':{'pushed':_0x9dbcdf,'skipped':_0x4c54ed,'failed':_0x2d9dfb},'message':_0x3ba984(0xf2)+_0x9dbcdf['length']+_0x3ba984(0xe7)+_0x4c54ed['length']+'\x20skipped,\x20'+_0x2d9dfb['length']+_0x3ba984(0xeb)};}};async function archivePreviousSqlFileIfNeeded(_0x462492,_0x3119fa,_0x3b2c37){const _0x768ab=a254_0x296c84;if(!_0x3119fa||_0x3119fa===_0x3b2c37)return;const _0x3c6340=join(_0x462492[_0x768ab(0x118)],_0x3119fa);if(!await fileExists(_0x3c6340))return;const _0x722b48=await moveToTrash(_0x462492['projectRoot'],_0x462492['trashDir'],_0x3c6340);await cleanupEmptyDirectories(dirname(_0x3c6340),_0x462492[_0x768ab(0x118)]),void _0x722b48;}async function moveToTrash(_0x2a9841,_0x36b72c,_0x4011c1){const _0x32dfd1=a254_0x296c84,_0x57f805=new Date()[_0x32dfd1(0xf8)]()['replace'](/[:.]/g,'-'),_0x21d630=relative(_0x2a9841,_0x4011c1),_0x2283fa=join(_0x36b72c,_0x57f805,_0x21d630);return await mkdir(dirname(_0x2283fa),{'recursive':!![]}),await rename(_0x4011c1,_0x2283fa),_0x2283fa;}async function cleanupEmptyDirectories(_0x4f99c8,_0x4c6262){const _0x478fe1=a254_0x296c84;let _0x3d27e3=resolve(_0x4f99c8);const _0x2ed88a=resolve(_0x4c6262);while(_0x3d27e3[_0x478fe1(0x103)](''+_0x2ed88a+sep)||_0x3d27e3===_0x2ed88a){if(_0x3d27e3===_0x2ed88a)return;try{const _0x4c8ee1=await readdir(_0x3d27e3);if(_0x4c8ee1['length']>0x0)return;await rmdir(_0x3d27e3);}catch{return;}_0x3d27e3=dirname(_0x3d27e3);}}async function resolveTargetDbBinding(_0x116430,_0x20a085,_0xe3c15b){const _0x297bc4=a254_0x296c84,_0x53f46f=_0x20a085['dbDirectory'];if(!_0x53f46f)return{'dbId':_0xe3c15b[_0x297bc4(0x102)],'dbName':_0xe3c15b[_0x297bc4(0xe6)]};const _0x4c0e6e=buildDbDirectoryName(_0xe3c15b['dbName'],_0xe3c15b[_0x297bc4(0x102)]);if(_0x53f46f===_0x4c0e6e)return{'dbId':_0xe3c15b['dbId'],'dbName':_0xe3c15b[_0x297bc4(0xe6)]};const _0x45528d=parseExplicitDbDirectory(_0x53f46f);if(_0x45528d!=null)return{'dbId':_0x45528d,'dbName':await getDbName(_0x116430,_0x45528d)[_0x297bc4(0x11b)](()=>undefined)};const _0x1d40c4=await listDatabases(_0x116430),_0x53d95f=_0x1d40c4[_0x297bc4(0xfe)](_0x52b22e=>buildDbDirectoryName(_0x52b22e[_0x297bc4(0xe6)],_0x52b22e['dbId'])===_0x53f46f);if(_0x53d95f['length']===0x1)return{'dbId':_0x53d95f[0x0][_0x297bc4(0x102)],'dbName':_0x53d95f[0x0][_0x297bc4(0xe6)]};if(_0x53d95f[_0x297bc4(0xed)]===0x0)throw CliErrors[_0x297bc4(0xe8)](_0x297bc4(0x11a)+_0x53f46f+_0x297bc4(0xd9)+_0x20a085[_0x297bc4(0xf5)]+'.');const _0x513f9d=_0x53d95f[_0x297bc4(0x112)](_0x187fc4=>_0x187fc4[_0x297bc4(0xe6)]+'\x20('+_0x187fc4['dbId']+')')[_0x297bc4(0xde)](',\x20');throw CliErrors['validation'](_0x297bc4(0x10d)+_0x53f46f+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x20a085[_0x297bc4(0xf5)]+':\x20'+_0x513f9d);}function parseExplicitDbDirectory(_0x256702){const _0x4d69ae=a254_0x296c84,_0x3428ae=/^db-(\d+)$/[_0x4d69ae(0x109)](_0x256702);if(!_0x3428ae)return null;const _0x53db8d=Number(_0x3428ae[0x1]);return Number[_0x4d69ae(0x108)](_0x53db8d)&&_0x53db8d>0x0?_0x53db8d:null;}
@@ -1 +1 @@
1
- function a255_0x55a3(){const _0x39e586=['1561qKFDoW','501PofYAN','\x20-->','sqlConfig','mode','endsWith','\x20[y/N]\x20','5DLOssH','map','26548203gzUfbc','<!--\x20@lovrabet.','sqlRoot','question','version','dbName','test','sqls','split','trimStart','includes','.rabetbase/sql','4446800HkXoso','yes','slice','trim','declaration','stdin','close','exec','13134tNGtUU','711385eUcBbg','replace','syncedAt','sqlContent','path','apps','18JQvyWk','mybatisXml','body','stderr','dbId','description','sqlCode','length','filter','sqlName','7544eDTBNI','toLowerCase','4815250GQBuYf','102308gvqxOB','fromEntries'];a255_0x55a3=function(){return _0x39e586;};return a255_0x55a3();}const a255_0x2595ad=a255_0x3df5;(function(_0x41545a,_0x15d737){const _0x164f3c=a255_0x3df5,_0x51bc0b=_0x41545a();while(!![]){try{const _0x5e05e8=parseInt(_0x164f3c(0xb1))/0x1+-parseInt(_0x164f3c(0xc1))/0x2*(parseInt(_0x164f3c(0xc7))/0x3)+parseInt(_0x164f3c(0xc4))/0x4*(parseInt(_0x164f3c(0x9a))/0x5)+-parseInt(_0x164f3c(0xb0))/0x6*(parseInt(_0x164f3c(0xc6))/0x7)+-parseInt(_0x164f3c(0xa8))/0x8+parseInt(_0x164f3c(0xb7))/0x9*(-parseInt(_0x164f3c(0xc3))/0xa)+parseInt(_0x164f3c(0x9c))/0xb;if(_0x5e05e8===_0x15d737)break;else _0x51bc0b['push'](_0x51bc0b['shift']());}catch(_0x49ff5a){_0x51bc0b['push'](_0x51bc0b['shift']());}}}(a255_0x55a3,0x7d5b8));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=a255_0x2595ad(0xa7);export function buildSqlLockEntry(_0x99e5e6,_0x34cb65,_0x5ba4ff,_0x2ce0e8){const _0x3e4c95=a255_0x2595ad,_0x353c54=detectSqlMode(_0x34cb65);return{'path':buildSqlRelativePath(_0x99e5e6['sqlCode'],_0x99e5e6['sqlName'],_0x2ce0e8?.['dbName'],_0x353c54,_0x99e5e6[_0x3e4c95(0xbb)]),'hash':_0x5ba4ff,'remoteId':_0x99e5e6['id'],'version':_0x99e5e6[_0x3e4c95(0xa0)],'dbId':Number(_0x99e5e6[_0x3e4c95(0xbb)]),'dbName':_0x2ce0e8?.[_0x3e4c95(0xa1)],'sqlName':_0x99e5e6[_0x3e4c95(0xc0)],'sqlConfig':_0x99e5e6[_0x3e4c95(0xc9)]??undefined,'mode':_0x353c54};}export function cloneSqlLockData(_0x4adb41){const _0x3bb00e=a255_0x2595ad;return{'apps':Object[_0x3bb00e(0xc5)](Object['entries'](_0x4adb41[_0x3bb00e(0xb6)])[_0x3bb00e(0x9b)](([_0x35e466,_0x17d29e])=>[_0x35e466,{'sqlRoot':_0x17d29e[_0x3bb00e(0x9e)],'lastSync':_0x17d29e['lastSync'],'sqls':{..._0x17d29e[_0x3bb00e(0xa3)]}}]))};}export function ensureRemoteSqlContent(_0x294453){const _0x11d211=a255_0x2595ad;return _0x294453[_0x11d211(0xb4)]??'';}export function buildLocalSqlFileContent(_0x41d569,_0x2a8578,_0xe04a55){const _0x2dbdf4=a255_0x2595ad,_0x57687c=_0xe04a55?.['mode']??detectSqlMode(_0x2a8578),_0x4cb027=stripLocalSqlMetadata(_0x2a8578,_0x57687c)['trim'](),_0x4cc707=buildMetadataHeaderLines({'sqlCode':_0x41d569[_0x2dbdf4(0xbd)],'sqlName':_0x41d569[_0x2dbdf4(0xc0)],'dbId':_0x41d569[_0x2dbdf4(0xbb)],'dbName':_0xe04a55?.[_0x2dbdf4(0xa1)],'mode':_0x57687c,'syncedAt':_0xe04a55?.[_0x2dbdf4(0xb3)],'description':_0xe04a55?.[_0x2dbdf4(0xbc)]},_0x57687c),_0x3f172c=_0x57687c===_0x2dbdf4(0xb8)?splitXmlDeclaration(_0x4cb027):{'body':_0x4cb027},_0x4519f5=[..._0x3f172c[_0x2dbdf4(0xac)]?[_0x3f172c[_0x2dbdf4(0xac)]]:[],..._0x4cc707,'',_0x3f172c[_0x2dbdf4(0xb9)][_0x2dbdf4(0xa5)]()],_0x4a007e=_0x4519f5['join']('\x0a');return _0x4a007e[_0x2dbdf4(0x98)]('\x0a')?_0x4a007e:_0x4a007e+'\x0a';}export function stripLocalSqlMetadata(_0x5a5bca,_0x4502d0){const _0x4bdce5=a255_0x2595ad;if(_0x4502d0===_0x4bdce5(0xb8)){const {declaration:_0x5b5dae,body:_0x4c3d25}=splitXmlDeclaration(_0x5a5bca[_0x4bdce5(0xb2)](/\r\n/g,'\x0a')),_0x184f4a=stripLeadingMetadataLines(_0x4c3d25,/^\s*<!--\s*@lovrabet\./);return _0x5b5dae?''+_0x5b5dae+(_0x184f4a?'\x0a'+_0x184f4a:''):_0x184f4a;}return stripLeadingMetadataLines(_0x5a5bca[_0x4bdce5(0xb2)](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0x20fa86,_0x1ccda8){const _0x5db044=a255_0x2595ad;if(_0x1ccda8?.[_0x5db044(0xca)])return _0x1ccda8['mode'];return detectSqlMode(_0x20fa86);}export function resolveSqlFileName(_0x4e8577,_0x5ee547,_0x56882b){const _0x5c0fd6=a255_0x2595ad;if(_0x56882b?.[_0x5c0fd6(0xb5)])return _0x56882b[_0x5c0fd6(0xb5)];if(_0x56882b?.[_0x5c0fd6(0xc0)]||_0x56882b?.[_0x5c0fd6(0xa1)])return buildSqlRelativePath(_0x4e8577,_0x56882b?.['sqlName'],_0x56882b?.[_0x5c0fd6(0xa1)],resolveSqlMode(_0x5ee547,_0x56882b),_0x56882b?.[_0x5c0fd6(0xbb)]);return buildDefaultSqlFileName(_0x4e8577,resolveSqlMode(_0x5ee547,_0x56882b));}function a255_0x3df5(_0x464896,_0x102e13){_0x464896=_0x464896-0x98;const _0x55a37b=a255_0x55a3();let _0x3df5c1=_0x55a37b[_0x464896];return _0x3df5c1;}export function resolveSqlLocalDir(_0x4ddd34,_0x13a500){return join(_0x4ddd34,SQL_LOCAL_REL_DIR,_0x13a500);}export async function confirmForceOverwrite(_0x3cce4f){const _0x2e9af4=a255_0x2595ad,_0x1f856d=createInterface({'input':process[_0x2e9af4(0xad)],'output':process[_0x2e9af4(0xba)]}),_0x1a3889=await new Promise(_0x5986bd=>{const _0x3ed97f=_0x2e9af4;_0x1f856d[_0x3ed97f(0x9f)](_0x3cce4f+_0x3ed97f(0x99),_0x5986bd);});return _0x1f856d[_0x2e9af4(0xae)](),['y',_0x2e9af4(0xa9)][_0x2e9af4(0xa6)](_0x1a3889[_0x2e9af4(0xab)]()[_0x2e9af4(0xc2)]());}export function findSqlLockScope(_0x36a0fd,_0x58e2d9){const _0x2155de=a255_0x2595ad;return _0x36a0fd[_0x2155de(0xb6)][_0x58e2d9];}function buildMetadataHeaderLines(_0x718204,_0x4d7fae){const _0x1f600f=a255_0x2595ad,_0x1f3b70=[[_0x1f600f(0xbd),_0x718204[_0x1f600f(0xbd)]],[_0x1f600f(0xc0),_0x718204['sqlName']],[_0x1f600f(0xbb),_0x718204[_0x1f600f(0xbb)]],[_0x1f600f(0xa1),_0x718204['dbName']],[_0x1f600f(0xca),_0x718204['mode']],[_0x1f600f(0xb3),_0x718204['syncedAt']],[_0x1f600f(0xbc),_0x718204[_0x1f600f(0xbc)]]];if(_0x4d7fae===_0x1f600f(0xb8))return _0x1f3b70['filter'](([,_0x4b4ed9])=>_0x4b4ed9!==undefined&&_0x4b4ed9!==null&&String(_0x4b4ed9)[_0x1f600f(0xab)]()!=='')[_0x1f600f(0x9b)](([_0x43317a,_0x316a10])=>_0x1f600f(0x9d)+_0x43317a+':\x20'+String(_0x316a10)+_0x1f600f(0xc8));return _0x1f3b70[_0x1f600f(0xbf)](([,_0x18d408])=>_0x18d408!==undefined&&_0x18d408!==null&&String(_0x18d408)[_0x1f600f(0xab)]()!=='')[_0x1f600f(0x9b)](([_0x457aec,_0x53ab80])=>'--\x20@lovrabet.'+_0x457aec+':\x20'+String(_0x53ab80));}function splitXmlDeclaration(_0x4b8598){const _0x36cb6c=a255_0x2595ad,_0x2fcb22=_0x4b8598['trimStart'](),_0x34701c=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i[_0x36cb6c(0xaf)](_0x2fcb22);if(!_0x34701c)return{'body':_0x4b8598};return{'declaration':_0x34701c[0x0],'body':_0x2fcb22[_0x36cb6c(0xaa)](_0x34701c[0x0][_0x36cb6c(0xbe)])};}function stripLeadingMetadataLines(_0x55cdbd,_0x1d59c){const _0x67c29c=a255_0x2595ad,_0x11ed82=_0x55cdbd[_0x67c29c(0xa4)]('\x0a');let _0x1885da=0x0;while(_0x1885da<_0x11ed82[_0x67c29c(0xbe)]){const _0x281488=_0x11ed82[_0x1885da]??'';if(_0x1d59c[_0x67c29c(0xa2)](_0x281488)||_0x281488[_0x67c29c(0xab)]()===''){_0x1885da++;continue;}break;}return _0x11ed82[_0x67c29c(0xaa)](_0x1885da)['join']('\x0a')[_0x67c29c(0xa5)]();}
1
+ const a255_0x25aca2=a255_0x4a77;(function(_0x2b0b47,_0x48bcf1){const _0x3db9f3=a255_0x4a77,_0x590598=_0x2b0b47();while(!![]){try{const _0x46d25f=-parseInt(_0x3db9f3(0x1b2))/0x1+-parseInt(_0x3db9f3(0x192))/0x2+-parseInt(_0x3db9f3(0x1bb))/0x3*(-parseInt(_0x3db9f3(0x1b1))/0x4)+-parseInt(_0x3db9f3(0x193))/0x5+-parseInt(_0x3db9f3(0x19e))/0x6*(parseInt(_0x3db9f3(0x1ba))/0x7)+-parseInt(_0x3db9f3(0x1a1))/0x8*(-parseInt(_0x3db9f3(0x1b5))/0x9)+-parseInt(_0x3db9f3(0x1c1))/0xa*(-parseInt(_0x3db9f3(0x198))/0xb);if(_0x46d25f===_0x48bcf1)break;else _0x590598['push'](_0x590598['shift']());}catch(_0x548112){_0x590598['push'](_0x590598['shift']());}}}(a255_0x59c1,0x9bd1b));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=a255_0x25aca2(0x1a4);function a255_0x59c1(){const _0x9b0c3f=['endsWith','dbId','close','question','syncedAt','slice','sqlCode','exec','92hCpIQb','1117608qtiWGw','trimStart','description','72QEGDCj','split','\x20-->','<!--\x20@lovrabet.','trim','1295007TWaovO','89277sJgWgs','mybatisXml','stdin','entries','includes','mode','10890HGJwer','map','1188736tBLyKT','1382460IbRPZM','body','filter','path','fromEntries','19723Labtrx','\x20[y/N]\x20','lastSync','--\x20@lovrabet.','join','dbName','18EhmFpr','length','declaration','544672CylKDj','sqlContent','apps','.rabetbase/sql','sqls','toLowerCase','stderr','sqlName'];a255_0x59c1=function(){return _0x9b0c3f;};return a255_0x59c1();}export function buildSqlLockEntry(_0x54280e,_0xb913c8,_0x17987b,_0x283872){const _0xa52f2c=a255_0x25aca2,_0x336bea=detectSqlMode(_0xb913c8);return{'path':buildSqlRelativePath(_0x54280e[_0xa52f2c(0x1af)],_0x54280e[_0xa52f2c(0x1a8)],_0x283872?.['dbName'],_0x336bea,_0x54280e[_0xa52f2c(0x1aa)]),'hash':_0x17987b,'remoteId':_0x54280e['id'],'version':_0x54280e['version'],'dbId':Number(_0x54280e[_0xa52f2c(0x1aa)]),'dbName':_0x283872?.[_0xa52f2c(0x19d)],'sqlName':_0x54280e['sqlName'],'sqlConfig':_0x54280e['sqlConfig']??undefined,'mode':_0x336bea};}export function cloneSqlLockData(_0x1e93c0){const _0x326fa0=a255_0x25aca2;return{'apps':Object[_0x326fa0(0x197)](Object[_0x326fa0(0x1be)](_0x1e93c0['apps'])['map'](([_0xdc9eb3,_0x2ccd49])=>[_0xdc9eb3,{'sqlRoot':_0x2ccd49['sqlRoot'],'lastSync':_0x2ccd49[_0x326fa0(0x19a)],'sqls':{..._0x2ccd49[_0x326fa0(0x1a5)]}}]))};}export function ensureRemoteSqlContent(_0x428415){const _0x395041=a255_0x25aca2;return _0x428415[_0x395041(0x1a2)]??'';}export function buildLocalSqlFileContent(_0x27b12e,_0xa7d470,_0x1559df){const _0x5670b5=a255_0x25aca2,_0x4b7862=_0x1559df?.[_0x5670b5(0x1c0)]??detectSqlMode(_0xa7d470),_0x4390a3=stripLocalSqlMetadata(_0xa7d470,_0x4b7862)[_0x5670b5(0x1b9)](),_0x3175ea=buildMetadataHeaderLines({'sqlCode':_0x27b12e[_0x5670b5(0x1af)],'sqlName':_0x27b12e[_0x5670b5(0x1a8)],'dbId':_0x27b12e[_0x5670b5(0x1aa)],'dbName':_0x1559df?.['dbName'],'mode':_0x4b7862,'syncedAt':_0x1559df?.[_0x5670b5(0x1ad)],'description':_0x1559df?.[_0x5670b5(0x1b4)]},_0x4b7862),_0x5d0837=_0x4b7862==='mybatisXml'?splitXmlDeclaration(_0x4390a3):{'body':_0x4390a3},_0x2729c8=[..._0x5d0837['declaration']?[_0x5d0837[_0x5670b5(0x1a0)]]:[],..._0x3175ea,'',_0x5d0837[_0x5670b5(0x194)][_0x5670b5(0x1b3)]()],_0x1e2924=_0x2729c8[_0x5670b5(0x19c)]('\x0a');return _0x1e2924[_0x5670b5(0x1a9)]('\x0a')?_0x1e2924:_0x1e2924+'\x0a';}export function stripLocalSqlMetadata(_0xe381e8,_0x92e5fd){if(_0x92e5fd==='mybatisXml'){const {declaration:_0x1f9bd3,body:_0x3b267d}=splitXmlDeclaration(_0xe381e8['replace'](/\r\n/g,'\x0a')),_0x3af8cc=stripLeadingMetadataLines(_0x3b267d,/^\s*<!--\s*@lovrabet\./);return _0x1f9bd3?''+_0x1f9bd3+(_0x3af8cc?'\x0a'+_0x3af8cc:''):_0x3af8cc;}return stripLeadingMetadataLines(_0xe381e8['replace'](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0x3be495,_0x438c66){const _0x3a5072=a255_0x25aca2;if(_0x438c66?.[_0x3a5072(0x1c0)])return _0x438c66[_0x3a5072(0x1c0)];return detectSqlMode(_0x3be495);}export function resolveSqlFileName(_0x568839,_0x3feec2,_0x1199f5){const _0x314c7f=a255_0x25aca2;if(_0x1199f5?.[_0x314c7f(0x196)])return _0x1199f5[_0x314c7f(0x196)];if(_0x1199f5?.[_0x314c7f(0x1a8)]||_0x1199f5?.[_0x314c7f(0x19d)])return buildSqlRelativePath(_0x568839,_0x1199f5?.[_0x314c7f(0x1a8)],_0x1199f5?.['dbName'],resolveSqlMode(_0x3feec2,_0x1199f5),_0x1199f5?.['dbId']);return buildDefaultSqlFileName(_0x568839,resolveSqlMode(_0x3feec2,_0x1199f5));}export function resolveSqlLocalDir(_0x1185c3,_0x26bf65){return join(_0x1185c3,SQL_LOCAL_REL_DIR,_0x26bf65);}export async function confirmForceOverwrite(_0xa7f06c){const _0x5e1a54=a255_0x25aca2,_0x4e6790=createInterface({'input':process[_0x5e1a54(0x1bd)],'output':process[_0x5e1a54(0x1a7)]}),_0x620f01=await new Promise(_0x46de9d=>{const _0x20bcc0=_0x5e1a54;_0x4e6790[_0x20bcc0(0x1ac)](_0xa7f06c+_0x20bcc0(0x199),_0x46de9d);});return _0x4e6790[_0x5e1a54(0x1ab)](),['y','yes'][_0x5e1a54(0x1bf)](_0x620f01[_0x5e1a54(0x1b9)]()[_0x5e1a54(0x1a6)]());}export function findSqlLockScope(_0x544ef4,_0x1b1a33){const _0x4936e4=a255_0x25aca2;return _0x544ef4[_0x4936e4(0x1a3)][_0x1b1a33];}function a255_0x4a77(_0x5aa6ce,_0x50ce5c){_0x5aa6ce=_0x5aa6ce-0x191;const _0x59c181=a255_0x59c1();let _0x4a7704=_0x59c181[_0x5aa6ce];return _0x4a7704;}function buildMetadataHeaderLines(_0x22ad7a,_0xe916ca){const _0x32d73e=a255_0x25aca2,_0x355a08=[['sqlCode',_0x22ad7a[_0x32d73e(0x1af)]],[_0x32d73e(0x1a8),_0x22ad7a[_0x32d73e(0x1a8)]],[_0x32d73e(0x1aa),_0x22ad7a[_0x32d73e(0x1aa)]],[_0x32d73e(0x19d),_0x22ad7a[_0x32d73e(0x19d)]],[_0x32d73e(0x1c0),_0x22ad7a[_0x32d73e(0x1c0)]],[_0x32d73e(0x1ad),_0x22ad7a[_0x32d73e(0x1ad)]],[_0x32d73e(0x1b4),_0x22ad7a[_0x32d73e(0x1b4)]]];if(_0xe916ca===_0x32d73e(0x1bc))return _0x355a08[_0x32d73e(0x195)](([,_0x268765])=>_0x268765!==undefined&&_0x268765!==null&&String(_0x268765)['trim']()!=='')['map'](([_0x333e0a,_0x57346d])=>_0x32d73e(0x1b8)+_0x333e0a+':\x20'+String(_0x57346d)+_0x32d73e(0x1b7));return _0x355a08[_0x32d73e(0x195)](([,_0x6acebf])=>_0x6acebf!==undefined&&_0x6acebf!==null&&String(_0x6acebf)[_0x32d73e(0x1b9)]()!=='')[_0x32d73e(0x191)](([_0x32fbd3,_0x31bdae])=>_0x32d73e(0x19b)+_0x32fbd3+':\x20'+String(_0x31bdae));}function splitXmlDeclaration(_0x5e42d9){const _0x32e3a=a255_0x25aca2,_0x164104=_0x5e42d9[_0x32e3a(0x1b3)](),_0x283a06=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i[_0x32e3a(0x1b0)](_0x164104);if(!_0x283a06)return{'body':_0x5e42d9};return{'declaration':_0x283a06[0x0],'body':_0x164104[_0x32e3a(0x1ae)](_0x283a06[0x0][_0x32e3a(0x19f)])};}function stripLeadingMetadataLines(_0x35e89f,_0x4ee40c){const _0x2605f1=a255_0x25aca2,_0x101f7a=_0x35e89f[_0x2605f1(0x1b6)]('\x0a');let _0x31b238=0x0;while(_0x31b238<_0x101f7a['length']){const _0xc4da46=_0x101f7a[_0x31b238]??'';if(_0x4ee40c['test'](_0xc4da46)||_0xc4da46[_0x2605f1(0x1b9)]()===''){_0x31b238++;continue;}break;}return _0x101f7a['slice'](_0x31b238)[_0x2605f1(0x19c)]('\x0a')[_0x2605f1(0x1b3)]();}
@@ -1 +1 @@
1
- const a256_0x4f54e3=a256_0x35f2;function a256_0x4974(){const _0x1eac89=['Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','push','\x20added,\x20','sqlRoot','31727509hDuNMP','tableData','925TBmdbJ','sqlCode','length','\x20unchanged','sqlName','sqls','lockFilePath','boolean','15182rNbhSC','bool','paging','\x20missing,\x20','42580bKerhu','status','6192564uRLNKs','\x20modified,\x20','1304vPrYGY','has','1696788KKvGNj','10lyqlAs','remote','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','relativePath','\x20remote-only','totalCount','sql','appCode','lockKey','2910187wNSsBQ','hash','152boCaOw','path','map','100773QrSYun','keys'];a256_0x4974=function(){return _0x1eac89;};return a256_0x4974();}(function(_0x5cc01b,_0x4b089a){const _0x2fc327=a256_0x35f2,_0x38c586=_0x5cc01b();while(!![]){try{const _0x31842d=-parseInt(_0x2fc327(0x96))/0x1*(parseInt(_0x2fc327(0xa9))/0x2)+parseInt(_0x2fc327(0xb3))/0x3+parseInt(_0x2fc327(0xad))/0x4*(parseInt(_0x2fc327(0xa1))/0x5)+-parseInt(_0x2fc327(0xaf))/0x6+-parseInt(_0x2fc327(0xbd))/0x7+-parseInt(_0x2fc327(0xb1))/0x8*(parseInt(_0x2fc327(0x99))/0x9)+-parseInt(_0x2fc327(0xb4))/0xa*(-parseInt(_0x2fc327(0x9f))/0xb);if(_0x31842d===_0x4b089a)break;else _0x38c586['push'](_0x38c586['shift']());}catch(_0x536442){_0x38c586['push'](_0x38c586['shift']());}}}(a256_0x4974,0xf24ce));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a256_0x35f2(_0x147763,_0x5dc36d){_0x147763=_0x147763-0x95;const _0x49740e=a256_0x4974();let _0x35f296=_0x49740e[_0x147763];return _0x35f296;}async function fetchAllSqlCodes(_0x8f6390){const _0x15d163=a256_0x35f2,_0x50bc5b=[];let _0xafe2c5=0x1;while(!![]){const _0x2fb1ae=await listSqlQueries(_0x8f6390,{'currentPage':_0xafe2c5,'pageSize':PAGE_SIZE}),_0x2b3f10=_0x2fb1ae[_0x15d163(0xa0)]??[];_0x50bc5b[_0x15d163(0x9c)](..._0x2b3f10['map'](_0x292c7b=>_0x292c7b[_0x15d163(0xa2)]));if(_0x2b3f10[_0x15d163(0xa3)]===0x0)break;const _0x186917=_0x2fb1ae[_0x15d163(0xab)]?.[_0x15d163(0xb9)];if(_0x186917!=null?_0x50bc5b[_0x15d163(0xa3)]>=_0x186917:_0x2b3f10[_0x15d163(0xa3)]<PAGE_SIZE)break;_0xafe2c5++;}return _0x50bc5b;}export const sqlStatus={'service':a256_0x4f54e3(0xba),'command':a256_0x4f54e3(0xae),'description':a256_0x4f54e3(0xb6),'risk':'read','flags':[{'name':'remote','type':a256_0x4f54e3(0xa8),'description':a256_0x4f54e3(0x9b)}],async 'execute'(_0x627532){const _0x4d53c8=a256_0x4f54e3,_0x326c08=loadSqlProjectConfig(_0x627532[_0x4d53c8(0xbb)]),_0x5bf1c4=await readSqlLockFile(_0x326c08[_0x4d53c8(0xa7)]),{appLock:_0x32e018}=ensureSqlLockScope(_0x5bf1c4??createEmptySqlLock(),_0x326c08[_0x4d53c8(0xbb)],_0x326c08[_0x4d53c8(0x9e)],'status'),_0x2773b4=await scanLocalSqlQueries(_0x326c08),_0x2084d1=[],_0x23ec32=[],_0x3dd0d3=[],_0x125b22=[],_0x5de75e=new Set(_0x2773b4[_0x4d53c8(0x98)](_0x58857d=>_0x58857d['lockKey']));for(const _0x8bf61 of _0x2773b4){const _0x28c474=await computeSqlFileHash(_0x8bf61['filePath']),_0x4804cc=_0x32e018[_0x4d53c8(0xa6)][_0x8bf61[_0x4d53c8(0xbc)]],_0x51b066=!!_0x4804cc&&_0x4804cc[_0x4d53c8(0x97)]!==_0x8bf61[_0x4d53c8(0xb7)],_0x14b01a=!!_0x4804cc&&!!_0x8bf61[_0x4d53c8(0xa5)]&&_0x4804cc[_0x4d53c8(0xa5)]!==_0x8bf61[_0x4d53c8(0xa5)];if(!_0x4804cc)_0x2084d1[_0x4d53c8(0x9c)](_0x8bf61['lockKey']);else _0x4804cc[_0x4d53c8(0x95)]!==_0x28c474||_0x51b066||_0x14b01a?_0x23ec32[_0x4d53c8(0x9c)](_0x8bf61['lockKey']):_0x3dd0d3[_0x4d53c8(0x9c)](_0x8bf61[_0x4d53c8(0xbc)]);}for(const _0x5b79b8 of Object[_0x4d53c8(0x9a)](_0x32e018[_0x4d53c8(0xa6)])){!_0x5de75e[_0x4d53c8(0xb2)](_0x5b79b8)&&_0x125b22[_0x4d53c8(0x9c)](_0x5b79b8);}const _0x2d7958=[];if(_0x627532[_0x4d53c8(0xaa)](_0x4d53c8(0xb5))){const _0x5a8207=await fetchAllSqlCodes(_0x627532['appCode']);for(const _0xa92c81 of _0x5a8207){!_0x5de75e['has'](_0xa92c81)&&!_0x32e018[_0x4d53c8(0xa6)][_0xa92c81]&&_0x2d7958[_0x4d53c8(0x9c)](_0xa92c81);}}const _0x1c672a=_0x2084d1['length']===0x0&&_0x23ec32[_0x4d53c8(0xa3)]===0x0&&_0x125b22['length']===0x0&&_0x2d7958['length']===0x0;return{'ok':!![],'data':{'added':_0x2084d1,'modified':_0x23ec32,'missing':_0x125b22,'unchanged':_0x3dd0d3,'remoteOnly':_0x2d7958},'message':_0x1c672a?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x2084d1['length']+_0x4d53c8(0x9d)+_0x23ec32[_0x4d53c8(0xa3)]+_0x4d53c8(0xb0)+_0x125b22[_0x4d53c8(0xa3)]+_0x4d53c8(0xac)+_0x3dd0d3[_0x4d53c8(0xa3)]+_0x4d53c8(0xa4)+(_0x2d7958[_0x4d53c8(0xa3)]>0x0?',\x20'+_0x2d7958[_0x4d53c8(0xa3)]+_0x4d53c8(0xb8):'')};}};
1
+ const a256_0x36a5dc=a256_0xecb3;function a256_0xecb3(_0x5afff8,_0x396ee1){_0x5afff8=_0x5afff8-0x15d;const _0x3f3b07=a256_0x3f3b();let _0xecb395=_0x3f3b07[_0x5afff8];return _0xecb395;}function a256_0x3f3b(){const _0x2abf19=['sqlCode','\x20remote-only','sqls','\x20modified,\x20','path','lockFilePath','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','sqlRoot','\x20added,\x20','\x20missing,\x20','484461wnlxeT','has','5230uEylcv','hash','paging','8bHWTMz','remote','1222508QXphDN','sqlName','boolean','status','filePath','push','3313212ejIwBO','20oVdakI','All\x20SQL\x20queries\x20are\x20in\x20sync.','sql','905372tFpqJN','50571ypqhyA','length','relativePath','read','\x20unchanged','appCode','map','totalCount','1529NcidRe','lockKey','tableData','5SNAZGH','187369klGbRn','bool'];a256_0x3f3b=function(){return _0x2abf19;};return a256_0x3f3b();}(function(_0x84452d,_0x1c9559){const _0x3594c3=a256_0xecb3,_0x4c16b4=_0x84452d();while(!![]){try{const _0x3f8093=-parseInt(_0x3594c3(0x16a))/0x1+-parseInt(_0x3594c3(0x184))/0x2*(-parseInt(_0x3594c3(0x15e))/0x3)+-parseInt(_0x3594c3(0x15d))/0x4+-parseInt(_0x3594c3(0x169))/0x5*(-parseInt(_0x3594c3(0x183))/0x6)+parseInt(_0x3594c3(0x17d))/0x7+-parseInt(_0x3594c3(0x17b))/0x8*(parseInt(_0x3594c3(0x176))/0x9)+parseInt(_0x3594c3(0x178))/0xa*(-parseInt(_0x3594c3(0x166))/0xb);if(_0x3f8093===_0x1c9559)break;else _0x4c16b4['push'](_0x4c16b4['shift']());}catch(_0xf16c03){_0x4c16b4['push'](_0x4c16b4['shift']());}}}(a256_0x3f3b,0x56b6a));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x35e47c){const _0x2d0b86=a256_0xecb3,_0x37627f=[];let _0x203838=0x1;while(!![]){const _0x1c0000=await listSqlQueries(_0x35e47c,{'currentPage':_0x203838,'pageSize':PAGE_SIZE}),_0x1323a2=_0x1c0000[_0x2d0b86(0x168)]??[];_0x37627f[_0x2d0b86(0x182)](..._0x1323a2[_0x2d0b86(0x164)](_0x4a93e9=>_0x4a93e9[_0x2d0b86(0x16c)]));if(_0x1323a2[_0x2d0b86(0x15f)]===0x0)break;const _0x23efe6=_0x1c0000[_0x2d0b86(0x17a)]?.[_0x2d0b86(0x165)];if(_0x23efe6!=null?_0x37627f[_0x2d0b86(0x15f)]>=_0x23efe6:_0x1323a2[_0x2d0b86(0x15f)]<PAGE_SIZE)break;_0x203838++;}return _0x37627f;}export const sqlStatus={'service':a256_0x36a5dc(0x186),'command':a256_0x36a5dc(0x180),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a256_0x36a5dc(0x161),'flags':[{'name':a256_0x36a5dc(0x17c),'type':a256_0x36a5dc(0x17f),'description':a256_0x36a5dc(0x172)}],async 'execute'(_0x4544a1){const _0x1819b2=a256_0x36a5dc,_0x5ea95e=loadSqlProjectConfig(_0x4544a1[_0x1819b2(0x163)]),_0x2cbfaf=await readSqlLockFile(_0x5ea95e[_0x1819b2(0x171)]),{appLock:_0x24cd74}=ensureSqlLockScope(_0x2cbfaf??createEmptySqlLock(),_0x5ea95e[_0x1819b2(0x163)],_0x5ea95e[_0x1819b2(0x173)],_0x1819b2(0x180)),_0x53ec40=await scanLocalSqlQueries(_0x5ea95e),_0x554b0f=[],_0x2f52ba=[],_0x1036a2=[],_0x2e42e5=[],_0x3f9af1=new Set(_0x53ec40['map'](_0x2d06e3=>_0x2d06e3['lockKey']));for(const _0x3e1109 of _0x53ec40){const _0x411d22=await computeSqlFileHash(_0x3e1109[_0x1819b2(0x181)]),_0x12413e=_0x24cd74[_0x1819b2(0x16e)][_0x3e1109[_0x1819b2(0x167)]],_0x24e0ac=!!_0x12413e&&_0x12413e[_0x1819b2(0x170)]!==_0x3e1109[_0x1819b2(0x160)],_0x19e62e=!!_0x12413e&&!!_0x3e1109['sqlName']&&_0x12413e['sqlName']!==_0x3e1109[_0x1819b2(0x17e)];if(!_0x12413e)_0x554b0f[_0x1819b2(0x182)](_0x3e1109[_0x1819b2(0x167)]);else _0x12413e[_0x1819b2(0x179)]!==_0x411d22||_0x24e0ac||_0x19e62e?_0x2f52ba[_0x1819b2(0x182)](_0x3e1109[_0x1819b2(0x167)]):_0x1036a2['push'](_0x3e1109[_0x1819b2(0x167)]);}for(const _0x54b114 of Object['keys'](_0x24cd74[_0x1819b2(0x16e)])){!_0x3f9af1['has'](_0x54b114)&&_0x2e42e5['push'](_0x54b114);}const _0x501a82=[];if(_0x4544a1[_0x1819b2(0x16b)](_0x1819b2(0x17c))){const _0x4ce385=await fetchAllSqlCodes(_0x4544a1[_0x1819b2(0x163)]);for(const _0x24b8c9 of _0x4ce385){!_0x3f9af1[_0x1819b2(0x177)](_0x24b8c9)&&!_0x24cd74[_0x1819b2(0x16e)][_0x24b8c9]&&_0x501a82[_0x1819b2(0x182)](_0x24b8c9);}}const _0x5ce957=_0x554b0f['length']===0x0&&_0x2f52ba[_0x1819b2(0x15f)]===0x0&&_0x2e42e5['length']===0x0&&_0x501a82[_0x1819b2(0x15f)]===0x0;return{'ok':!![],'data':{'added':_0x554b0f,'modified':_0x2f52ba,'missing':_0x2e42e5,'unchanged':_0x1036a2,'remoteOnly':_0x501a82},'message':_0x5ce957?_0x1819b2(0x185):_0x554b0f['length']+_0x1819b2(0x174)+_0x2f52ba[_0x1819b2(0x15f)]+_0x1819b2(0x16f)+_0x2e42e5[_0x1819b2(0x15f)]+_0x1819b2(0x175)+_0x1036a2['length']+_0x1819b2(0x162)+(_0x501a82['length']>0x0?',\x20'+_0x501a82[_0x1819b2(0x15f)]+_0x1819b2(0x16d):'')};}};
@@ -1 +1 @@
1
- function a257_0x4e2b(_0x513cf3,_0x59627d){_0x513cf3=_0x513cf3-0x1a5;const _0x1a8685=a257_0x1a86();let _0x4e2b76=_0x1a8685[_0x513cf3];return _0x4e2b76;}const a257_0x77014f=a257_0x4e2b;(function(_0x2b0851,_0x1dc8ca){const _0x2dd8f3=a257_0x4e2b,_0x4ece91=_0x2b0851();while(!![]){try{const _0x5255f2=-parseInt(_0x2dd8f3(0x1c1))/0x1+-parseInt(_0x2dd8f3(0x1b8))/0x2+parseInt(_0x2dd8f3(0x1e4))/0x3*(parseInt(_0x2dd8f3(0x1d6))/0x4)+parseInt(_0x2dd8f3(0x1d5))/0x5+parseInt(_0x2dd8f3(0x1ac))/0x6+-parseInt(_0x2dd8f3(0x1df))/0x7*(parseInt(_0x2dd8f3(0x1ce))/0x8)+parseInt(_0x2dd8f3(0x1b3))/0x9;if(_0x5255f2===_0x1dc8ca)break;else _0x4ece91['push'](_0x4ece91['shift']());}catch(_0x542bd0){_0x4ece91['push'](_0x4ece91['shift']());}}}(a257_0x1a86,0x39333));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a257_0x1a86(){const _0x213cb1=['2674026IdHyEN','columns','Provide\x20--file\x20or\x20--sql','unshift','tables','\x22\x20not\x20found\x20in\x20any\x20dataset','columnNames','1885014lzHigW','parameters','filter','indexName','isDangerous','333372vYLvtR','dataset','push','message','validation','schemaWarnings','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','appCode','size','383679QjDFWw','file','flagMissing','split','index_columns','indexes','boolean','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','isSelectOnly','cwd','length','read','joinAudit','1384CputBe','valid','check-indexes','File\x20not\x20found:\x20','\x22\x20not\x20found\x20or\x20not\x20accessible','find','trim','772115XcOOZd','1960GCZPWA','from','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','get','dbtableConfig','fields','tableName','bool','isArray','14826OXNCQG','schema:','index_name','reason','Dataset\x20\x22','2091XWqDsG','schemas','primary','type','name','sql','validate','string','str','pkField','toLowerCase','SQL\x20schema\x20validation','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','utf-8','Table\x20\x22','sqlType','map'];a257_0x1a86=function(){return _0x213cb1;};return a257_0x1a86();}import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a257_0x77014f(0x1e9),'command':a257_0x77014f(0x1ea),'description':a257_0x77014f(0x1d8),'risk':a257_0x77014f(0x1cc),'flags':[{'name':'file','type':a257_0x77014f(0x1eb),'description':a257_0x77014f(0x1a7)},{'name':a257_0x77014f(0x1e9),'type':'string','description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a257_0x77014f(0x1e5),'type':a257_0x77014f(0x1eb),'description':a257_0x77014f(0x1be)},{'name':a257_0x77014f(0x1d0),'type':a257_0x77014f(0x1c7),'description':a257_0x77014f(0x1c8)}],async 'execute'(_0x351697){const _0xba78=a257_0x77014f,_0x1d8f87=_0x351697[_0xba78(0x1ec)](_0xba78(0x1c2)),_0x31693a=_0x351697['str']('sql'),_0x33ee97=_0x351697[_0xba78(0x1ec)](_0xba78(0x1e5)),_0x2a17fe=_0x351697[_0xba78(0x1dd)](_0xba78(0x1d0));if(!_0x1d8f87&&!_0x31693a)throw CliErrors[_0xba78(0x1c3)](_0xba78(0x1c2),_0xba78(0x1ae));if(_0x2a17fe&&!_0x33ee97)throw CliErrors[_0xba78(0x1bc)]('--check-indexes\x20requires\x20--schemas.');let _0x21fa01;if(_0x1d8f87){const _0x5932b=resolve(process[_0xba78(0x1ca)](),_0x1d8f87);if(!existsSync(_0x5932b))throw CliErrors[_0xba78(0x1bc)](_0xba78(0x1d1)+_0x5932b);_0x21fa01=readFileSync(_0x5932b,_0xba78(0x1a8));}else _0x21fa01=_0x31693a;const _0x1c4282=validateSql(_0x21fa01),_0x3f8d2f={'valid':_0x1c4282[_0xba78(0x1cf)],'sqlType':_0x1c4282[_0xba78(0x1aa)][_0xba78(0x1e7)],'isSelectOnly':_0x1c4282[_0xba78(0x1aa)][_0xba78(0x1c9)],'isLockingRead':_0x1c4282[_0xba78(0x1aa)]['isLockingRead']??![],'isDangerous':_0x1c4282[_0xba78(0x1aa)][_0xba78(0x1b7)],'tables':_0x1c4282[_0xba78(0x1b0)],'parameters':_0x1c4282[_0xba78(0x1b4)],'message':_0x1c4282[_0xba78(0x1bb)]};_0x1c4282[_0xba78(0x1aa)][_0xba78(0x1e2)]&&(_0x3f8d2f[_0xba78(0x1e2)]=_0x1c4282['sqlType'][_0xba78(0x1e2)]);if(_0x33ee97&&_0x1c4282[_0xba78(0x1cf)]){const _0x4db132=_0x33ee97[_0xba78(0x1c4)](',')[_0xba78(0x1ab)](_0x2cc24a=>_0x2cc24a['trim']())[_0xba78(0x1b5)](Boolean),_0x24443a=[],_0x24266f=[],_0x283ed2=filterDbTableBackedDatasets(await listDatasets(_0x351697[_0xba78(0x1bf)])),_0x46cfcc=new Map(_0x283ed2[_0xba78(0x1ab)](_0x3cc87b=>[_0x3cc87b[_0xba78(0x1da)]?.[_0xba78(0x1dc)]?.['toLowerCase'](),_0x3cc87b]));for(const _0x532498 of _0x1c4282[_0xba78(0x1b0)]){const _0x1711be=_0x46cfcc[_0xba78(0x1d9)](_0x532498[_0xba78(0x1a5)]());!_0x1711be&&_0x24443a[_0xba78(0x1ba)](_0xba78(0x1a9)+_0x532498+_0xba78(0x1b1));}for(const _0x5d2a68 of _0x4db132){let _0x433a70;try{_0x433a70=await getDatasetDetail(_0x5d2a68);}catch{_0x24443a[_0xba78(0x1ba)](_0xba78(0x1e3)+_0x5d2a68+_0xba78(0x1d2));continue;}assertDatasetIsDbTableBacked(_0x433a70,_0xba78(0x1a6));const _0x50e708=Array[_0xba78(0x1de)](_0x433a70[_0xba78(0x1db)])?_0x433a70[_0xba78(0x1db)]:[],_0x3fba69=new Set(_0x50e708['map'](_0xca439b=>_0xca439b[_0xba78(0x1e8)]?.[_0xba78(0x1a5)]())),_0x2fc9a2=_0x433a70[_0xba78(0x1da)]?.[_0xba78(0x1dc)]||_0x433a70['tableName']||_0x5d2a68;_0x3f8d2f[_0xba78(0x1e0)+_0x2fc9a2]={'code':_0x5d2a68,'tableName':_0x2fc9a2,'fieldCount':_0x3fba69[_0xba78(0x1c0)],'fields':Array[_0xba78(0x1d7)](_0x3fba69)};if(_0x2a17fe){const _0x34dac5=normalizeDatasetIndexes(_0x433a70);_0x24266f[_0xba78(0x1ba)]({'tableName':_0x2fc9a2,..._0x34dac5});}}_0x24443a[_0xba78(0x1cb)]>0x0&&(_0x3f8d2f[_0xba78(0x1bd)]=_0x24443a),_0x2a17fe&&(_0x3f8d2f[_0xba78(0x1cd)]=auditSqlJoinIndexes(_0x21fa01,_0x24266f));}return{'ok':_0x1c4282[_0xba78(0x1cf)],'data':_0x3f8d2f,'message':_0x1c4282[_0xba78(0x1bb)]};}};function normalizeDatasetIndexes(_0x10a41d){const _0x375975=a257_0x77014f,_0x3677a6=Array[_0x375975(0x1de)](_0x10a41d?.[_0x375975(0x1b9)]?.['indexes'])?_0x10a41d[_0x375975(0x1b9)][_0x375975(0x1c6)]:Array['isArray'](_0x10a41d?.[_0x375975(0x1c6)])?_0x10a41d[_0x375975(0x1c6)]:[],_0x2af47d=_0x3677a6['flatMap'](_0x4ad4e4=>{const _0x4072b4=_0x375975,_0x30375a=Array[_0x4072b4(0x1de)](_0x4ad4e4?.[_0x4072b4(0x1c5)])?_0x4ad4e4[_0x4072b4(0x1c5)]:Array[_0x4072b4(0x1de)](_0x4ad4e4?.['columnNames'])?_0x4ad4e4[_0x4072b4(0x1b2)]:Array['isArray'](_0x4ad4e4?.[_0x4072b4(0x1ad)])?_0x4ad4e4[_0x4072b4(0x1ad)]:[],_0x570622=_0x30375a['filter'](_0x3f3481=>typeof _0x3f3481===_0x4072b4(0x1eb))['map'](_0x54692a=>_0x54692a['trim']())[_0x4072b4(0x1b5)](Boolean);if(_0x570622[_0x4072b4(0x1cb)]===0x0)return[];const _0x2edcb6=[_0x4ad4e4?.[_0x4072b4(0x1b6)],_0x4ad4e4?.[_0x4072b4(0x1e1)],_0x4ad4e4?.[_0x4072b4(0x1e8)]][_0x4072b4(0x1d3)](_0x3d9174=>typeof _0x3d9174===_0x4072b4(0x1eb)&&_0x3d9174['trim']()),_0x565154=[_0x4ad4e4?.['index_type'],_0x4ad4e4?.[_0x4072b4(0x1e7)]][_0x4072b4(0x1d3)](_0x1c2c1b=>typeof _0x1c2c1b==='string'&&_0x1c2c1b[_0x4072b4(0x1d4)]());return[{..._0x2edcb6?{'name':_0x2edcb6[_0x4072b4(0x1d4)]()}:{},..._0x565154?{'type':_0x565154[_0x4072b4(0x1d4)]()}:{},'columns':_0x570622}];}),_0xc3cb2e=[..._0x2af47d],_0x431beb=typeof _0x10a41d?.[_0x375975(0x1da)]?.[_0x375975(0x1ed)]===_0x375975(0x1eb)?_0x10a41d[_0x375975(0x1da)][_0x375975(0x1ed)][_0x375975(0x1c4)](',')[_0x375975(0x1ab)](_0x4e1476=>_0x4e1476['trim']())[_0x375975(0x1b5)](Boolean):[];return _0x431beb[_0x375975(0x1cb)]>0x0&&_0xc3cb2e[_0x375975(0x1af)]({'type':_0x375975(0x1e6),'columns':_0x431beb}),{'indexes':_0xc3cb2e,'metadataAvailable':_0x2af47d['length']>0x0};}
1
+ const a257_0x5a9c1c=a257_0x130a;(function(_0x4b4759,_0x8784d5){const _0x47abc2=a257_0x130a,_0x5577dc=_0x4b4759();while(!![]){try{const _0x1814ff=-parseInt(_0x47abc2(0xac))/0x1*(-parseInt(_0x47abc2(0x9d))/0x2)+parseInt(_0x47abc2(0xbb))/0x3+-parseInt(_0x47abc2(0xa4))/0x4+-parseInt(_0x47abc2(0x89))/0x5+parseInt(_0x47abc2(0x9f))/0x6+-parseInt(_0x47abc2(0xa3))/0x7*(-parseInt(_0x47abc2(0xa8))/0x8)+-parseInt(_0x47abc2(0xbe))/0x9;if(_0x1814ff===_0x8784d5)break;else _0x5577dc['push'](_0x5577dc['shift']());}catch(_0x571f21){_0x5577dc['push'](_0x5577dc['shift']());}}}(a257_0x3436,0x7438a));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a257_0x3436(){const _0x39282d=['8646327eXqeWM','name','SQL\x20schema\x20validation','isArray','\x22\x20not\x20found\x20or\x20not\x20accessible','sql','cwd','appCode','length','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','validate','valid','fields','1000955PpeNbl','isLockingRead','dbtableConfig','reason','parameters','dataset','push','from','Provide\x20--file\x20or\x20--sql','columns','filter','tableName','indexes','message','check-indexes','sqlType','get','read','Table\x20\x22','pkField','96218qPNjJQ','bool','5352918Sjvjlv','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','type','utf-8','336HvYSWs','3118844NaXLll','\x22\x20not\x20found\x20in\x20any\x20dataset','file','map','142768iZLIyc','split','find','primary','7YWNoRw','unshift','validation','schemas','string','index_columns','schemaWarnings','isDangerous','tables','toLowerCase','trim','File\x20not\x20found:\x20','isSelectOnly','boolean','columnNames','993369zvTNBF','joinAudit','str'];a257_0x3436=function(){return _0x39282d;};return a257_0x3436();}import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a257_0x5a9c1c(0x81),'command':a257_0x5a9c1c(0x86),'description':a257_0x5a9c1c(0xa0),'risk':a257_0x5a9c1c(0x9a),'flags':[{'name':'file','type':a257_0x5a9c1c(0xb0),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a257_0x5a9c1c(0x81),'type':a257_0x5a9c1c(0xb0),'description':a257_0x5a9c1c(0x85)},{'name':a257_0x5a9c1c(0xaf),'type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a257_0x5a9c1c(0x97),'type':a257_0x5a9c1c(0xb9),'description':'Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata'}],async 'execute'(_0x4cfc18){const _0x24d80a=a257_0x5a9c1c,_0x4dda90=_0x4cfc18[_0x24d80a(0xbd)](_0x24d80a(0xa6)),_0xbcfd60=_0x4cfc18[_0x24d80a(0xbd)]('sql'),_0xb1b665=_0x4cfc18['str']('schemas'),_0x2c168f=_0x4cfc18[_0x24d80a(0x9e)]('check-indexes');if(!_0x4dda90&&!_0xbcfd60)throw CliErrors['flagMissing'](_0x24d80a(0xa6),_0x24d80a(0x91));if(_0x2c168f&&!_0xb1b665)throw CliErrors[_0x24d80a(0xae)]('--check-indexes\x20requires\x20--schemas.');let _0x27d1e3;if(_0x4dda90){const _0x342714=resolve(process[_0x24d80a(0x82)](),_0x4dda90);if(!existsSync(_0x342714))throw CliErrors[_0x24d80a(0xae)](_0x24d80a(0xb7)+_0x342714);_0x27d1e3=readFileSync(_0x342714,_0x24d80a(0xa2));}else _0x27d1e3=_0xbcfd60;const _0xd55729=validateSql(_0x27d1e3),_0x5b35a3={'valid':_0xd55729['valid'],'sqlType':_0xd55729['sqlType'][_0x24d80a(0xa1)],'isSelectOnly':_0xd55729[_0x24d80a(0x98)][_0x24d80a(0xb8)],'isLockingRead':_0xd55729[_0x24d80a(0x98)][_0x24d80a(0x8a)]??![],'isDangerous':_0xd55729[_0x24d80a(0x98)][_0x24d80a(0xb3)],'tables':_0xd55729[_0x24d80a(0xb4)],'parameters':_0xd55729[_0x24d80a(0x8d)],'message':_0xd55729[_0x24d80a(0x96)]};_0xd55729[_0x24d80a(0x98)]['reason']&&(_0x5b35a3[_0x24d80a(0x8c)]=_0xd55729[_0x24d80a(0x98)][_0x24d80a(0x8c)]);if(_0xb1b665&&_0xd55729['valid']){const _0x484055=_0xb1b665[_0x24d80a(0xa9)](',')[_0x24d80a(0xa7)](_0x4bbdd2=>_0x4bbdd2['trim']())[_0x24d80a(0x93)](Boolean),_0x2f2cb5=[],_0x451149=[],_0x582462=filterDbTableBackedDatasets(await listDatasets(_0x4cfc18[_0x24d80a(0x83)])),_0x1cbfe5=new Map(_0x582462[_0x24d80a(0xa7)](_0x18e91a=>[_0x18e91a[_0x24d80a(0x8b)]?.['tableName']?.[_0x24d80a(0xb5)](),_0x18e91a]));for(const _0x8aef6 of _0xd55729['tables']){const _0x778543=_0x1cbfe5[_0x24d80a(0x99)](_0x8aef6[_0x24d80a(0xb5)]());!_0x778543&&_0x2f2cb5[_0x24d80a(0x8f)](_0x24d80a(0x9b)+_0x8aef6+_0x24d80a(0xa5));}for(const _0x237d5a of _0x484055){let _0x54f2e5;try{_0x54f2e5=await getDatasetDetail(_0x237d5a);}catch{_0x2f2cb5[_0x24d80a(0x8f)]('Dataset\x20\x22'+_0x237d5a+_0x24d80a(0x80));continue;}assertDatasetIsDbTableBacked(_0x54f2e5,_0x24d80a(0xc0));const _0x498648=Array[_0x24d80a(0x7f)](_0x54f2e5['fields'])?_0x54f2e5[_0x24d80a(0x88)]:[],_0x2c0d3d=new Set(_0x498648[_0x24d80a(0xa7)](_0x6d5a1a=>_0x6d5a1a[_0x24d80a(0xbf)]?.[_0x24d80a(0xb5)]())),_0x1b0284=_0x54f2e5[_0x24d80a(0x8b)]?.['tableName']||_0x54f2e5[_0x24d80a(0x94)]||_0x237d5a;_0x5b35a3['schema:'+_0x1b0284]={'code':_0x237d5a,'tableName':_0x1b0284,'fieldCount':_0x2c0d3d['size'],'fields':Array[_0x24d80a(0x90)](_0x2c0d3d)};if(_0x2c168f){const _0x4b4e1a=normalizeDatasetIndexes(_0x54f2e5);_0x451149['push']({'tableName':_0x1b0284,..._0x4b4e1a});}}_0x2f2cb5[_0x24d80a(0x84)]>0x0&&(_0x5b35a3[_0x24d80a(0xb2)]=_0x2f2cb5),_0x2c168f&&(_0x5b35a3[_0x24d80a(0xbc)]=auditSqlJoinIndexes(_0x27d1e3,_0x451149));}return{'ok':_0xd55729[_0x24d80a(0x87)],'data':_0x5b35a3,'message':_0xd55729[_0x24d80a(0x96)]};}};function a257_0x130a(_0x2ba076,_0xbd393d){_0x2ba076=_0x2ba076-0x7f;const _0x3436cf=a257_0x3436();let _0x130a83=_0x3436cf[_0x2ba076];return _0x130a83;}function normalizeDatasetIndexes(_0x372d55){const _0x189eed=a257_0x5a9c1c,_0x37c6c3=Array[_0x189eed(0x7f)](_0x372d55?.['dataset']?.[_0x189eed(0x95)])?_0x372d55[_0x189eed(0x8e)][_0x189eed(0x95)]:Array[_0x189eed(0x7f)](_0x372d55?.[_0x189eed(0x95)])?_0x372d55['indexes']:[],_0x18fbd4=_0x37c6c3['flatMap'](_0x1aa87e=>{const _0x4addeb=_0x189eed,_0x7c23f6=Array['isArray'](_0x1aa87e?.['index_columns'])?_0x1aa87e[_0x4addeb(0xb1)]:Array[_0x4addeb(0x7f)](_0x1aa87e?.['columnNames'])?_0x1aa87e[_0x4addeb(0xba)]:Array[_0x4addeb(0x7f)](_0x1aa87e?.[_0x4addeb(0x92)])?_0x1aa87e['columns']:[],_0x10cba0=_0x7c23f6[_0x4addeb(0x93)](_0x5b1b23=>typeof _0x5b1b23===_0x4addeb(0xb0))['map'](_0x15180e=>_0x15180e['trim']())[_0x4addeb(0x93)](Boolean);if(_0x10cba0['length']===0x0)return[];const _0x420e55=[_0x1aa87e?.['indexName'],_0x1aa87e?.['index_name'],_0x1aa87e?.['name']][_0x4addeb(0xaa)](_0x36d432=>typeof _0x36d432===_0x4addeb(0xb0)&&_0x36d432[_0x4addeb(0xb6)]()),_0xe0b690=[_0x1aa87e?.['index_type'],_0x1aa87e?.[_0x4addeb(0xa1)]]['find'](_0x5b334f=>typeof _0x5b334f===_0x4addeb(0xb0)&&_0x5b334f['trim']());return[{..._0x420e55?{'name':_0x420e55[_0x4addeb(0xb6)]()}:{},..._0xe0b690?{'type':_0xe0b690['trim']()}:{},'columns':_0x10cba0}];}),_0x27694d=[..._0x18fbd4],_0x26e042=typeof _0x372d55?.[_0x189eed(0x8b)]?.[_0x189eed(0x9c)]===_0x189eed(0xb0)?_0x372d55[_0x189eed(0x8b)]['pkField']['split'](',')['map'](_0x4cae73=>_0x4cae73[_0x189eed(0xb6)]())[_0x189eed(0x93)](Boolean):[];return _0x26e042[_0x189eed(0x84)]>0x0&&_0x27694d[_0x189eed(0xad)]({'type':_0x189eed(0xab),'columns':_0x26e042}),{'indexes':_0x27694d,'metadataAvailable':_0x18fbd4['length']>0x0};}
@@ -1 +1 @@
1
- (function(_0x245d1a,_0x2e0f78){const _0x4d1204=a258_0x5305,_0x18c56f=_0x245d1a();while(!![]){try{const _0x12b378=parseInt(_0x4d1204(0x195))/0x1+parseInt(_0x4d1204(0x19b))/0x2+parseInt(_0x4d1204(0x193))/0x3+parseInt(_0x4d1204(0x196))/0x4+-parseInt(_0x4d1204(0x198))/0x5*(-parseInt(_0x4d1204(0x194))/0x6)+parseInt(_0x4d1204(0x192))/0x7*(parseInt(_0x4d1204(0x199))/0x8)+parseInt(_0x4d1204(0x197))/0x9*(-parseInt(_0x4d1204(0x19a))/0xa);if(_0x12b378===_0x2e0f78)break;else _0x18c56f['push'](_0x18c56f['shift']());}catch(_0x43be2f){_0x18c56f['push'](_0x18c56f['shift']());}}}(a258_0x4d56,0x9a9fb));import{taskStatus}from'../../commands/task/status.js';function a258_0x5305(_0x530a05,_0x56567d){_0x530a05=_0x530a05-0x192;const _0x4d5690=a258_0x4d56();let _0x530520=_0x4d5690[_0x530a05];return _0x530520;}export const taskDefinitions=[taskStatus];function a258_0x4d56(){const _0xb32169=['591177rwujzp','164860jaFXhT','9236637ufNqNA','105PkIHzd','2562776VBOxDB','10yUvgpD','1112262aWWDzk','7GztKso','362259qPdtOd','8574tBbYDB'];a258_0x4d56=function(){return _0xb32169;};return a258_0x4d56();}
1
+ function a258_0x27d6(_0x4d5c08,_0x2954fa){_0x4d5c08=_0x4d5c08-0x137;const _0x21b9db=a258_0x21b9();let _0x27d607=_0x21b9db[_0x4d5c08];return _0x27d607;}(function(_0x344711,_0x2f3c63){const _0x3acbdd=a258_0x27d6,_0x19c223=_0x344711();while(!![]){try{const _0x30503c=-parseInt(_0x3acbdd(0x139))/0x1*(parseInt(_0x3acbdd(0x13f))/0x2)+-parseInt(_0x3acbdd(0x13a))/0x3+parseInt(_0x3acbdd(0x138))/0x4+-parseInt(_0x3acbdd(0x137))/0x5*(parseInt(_0x3acbdd(0x13e))/0x6)+parseInt(_0x3acbdd(0x13d))/0x7*(-parseInt(_0x3acbdd(0x141))/0x8)+parseInt(_0x3acbdd(0x13c))/0x9*(-parseInt(_0x3acbdd(0x13b))/0xa)+parseInt(_0x3acbdd(0x140))/0xb;if(_0x30503c===_0x2f3c63)break;else _0x19c223['push'](_0x19c223['shift']());}catch(_0x5452e1){_0x19c223['push'](_0x19c223['shift']());}}}(a258_0x21b9,0x62dfd));function a258_0x21b9(){const _0x25bede=['497020LyRfLq','27HjJtyv','3036411fOTSaa','138Zfmzlw','2HWeBQj','16928769xnMBBm','8ffCLPC','94805vDgzQe','1636832xrWjRj','66701CILiyW','1372545BlbTaz'];a258_0x21b9=function(){return _0x25bede;};return a258_0x21b9();}import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- const a259_0xd79f85=a259_0x3fce;function a259_0x8ee1(){const _0x40d194=['status','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','task-id','2490435yMkuxF','5823636ecLgGO','934372tlCEWw','2634940rvnXuS','read','compress','trim','20034QZlrXL','str','appCode','4oCkzLh','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','158696ELHyBA','147bWVfPH','331032HddlIw','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','cookie',',\x20received\x20','taskId','string','flagMissing'];a259_0x8ee1=function(){return _0x40d194;};return a259_0x8ee1();}(function(_0x4da6f7,_0x3be31c){const _0x1b9836=a259_0x3fce,_0x235a49=_0x4da6f7();while(!![]){try{const _0x804493=-parseInt(_0x1b9836(0x83))/0x1+parseInt(_0x1b9836(0x8b))/0x2*(-parseInt(_0x1b9836(0x88))/0x3)+parseInt(_0x1b9836(0x8f))/0x4+parseInt(_0x1b9836(0x84))/0x5+parseInt(_0x1b9836(0x82))/0x6+-parseInt(_0x1b9836(0x8e))/0x7*(parseInt(_0x1b9836(0x8d))/0x8)+parseInt(_0x1b9836(0x81))/0x9;if(_0x804493===_0x3be31c)break;else _0x235a49['push'](_0x235a49['shift']());}catch(_0xfcf048){_0x235a49['push'](_0x235a49['shift']());}}}(a259_0x8ee1,0x784da));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a259_0x3fce(_0x4a53f5,_0x580833){_0x4a53f5=_0x4a53f5-0x7d;const _0x8ee12c=a259_0x8ee1();let _0x3fcece=_0x8ee12c[_0x4a53f5];return _0x3fcece;}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':'task','command':a259_0xd79f85(0x7e),'description':a259_0xd79f85(0x7f),'risk':a259_0xd79f85(0x85),'defaultOutputFormat':a259_0xd79f85(0x86),'structuredErrors':!![],'flags':[{'name':a259_0xd79f85(0x80),'type':a259_0xd79f85(0x94),'required':!![],'description':a259_0xd79f85(0x8c)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4d89ca){const _0x3c7a2a=a259_0xd79f85;if(!_0x4d89ca[_0x3c7a2a(0x89)](_0x3c7a2a(0x80))[_0x3c7a2a(0x87)]())throw CliErrors[_0x3c7a2a(0x7d)](_0x3c7a2a(0x80));},async 'execute'(_0x48db1c){const _0xcdbe1b=a259_0xd79f85,_0x326c47=_0x48db1c[_0xcdbe1b(0x89)](_0xcdbe1b(0x80))[_0xcdbe1b(0x87)](),_0x582667=normalizeAsyncTask(await getAsyncTaskStatus(_0x326c47,_0x48db1c['appCode'],_0x48db1c[_0xcdbe1b(0x91)]));if(_0x582667[_0xcdbe1b(0x93)]!==_0x326c47)throw CliErrors['apiError'](_0xcdbe1b(0x90)+_0x326c47+_0xcdbe1b(0x92)+_0x582667[_0xcdbe1b(0x93)]+'.');const _0x3f34ed=buildAsyncTaskStatusCommand(_0x582667[_0xcdbe1b(0x93)],_0x48db1c[_0xcdbe1b(0x8a)]);return{'ok':!![],'message':asyncTaskMessage(_0x582667),'data':{'appCode':_0x48db1c[_0xcdbe1b(0x8a)],..._0x582667,'query':_0x582667['isTerminal']?null:{'command':_0x3f34ed}}};}};
1
+ const a259_0x1fb328=a259_0x438a;(function(_0x2da43a,_0x387fa2){const _0x518e49=a259_0x438a,_0x2b1434=_0x2da43a();while(!![]){try{const _0x25a8bf=-parseInt(_0x518e49(0xe5))/0x1*(-parseInt(_0x518e49(0xd8))/0x2)+parseInt(_0x518e49(0xe1))/0x3*(parseInt(_0x518e49(0xde))/0x4)+-parseInt(_0x518e49(0xe7))/0x5+parseInt(_0x518e49(0xdd))/0x6+-parseInt(_0x518e49(0xeb))/0x7+-parseInt(_0x518e49(0xd9))/0x8+parseInt(_0x518e49(0xe2))/0x9;if(_0x25a8bf===_0x387fa2)break;else _0x2b1434['push'](_0x2b1434['shift']());}catch(_0x2c2702){_0x2b1434['push'](_0x2b1434['shift']());}}}(a259_0x3061,0x5c2d5));function a259_0x438a(_0x19d819,_0x1a3db1){_0x19d819=_0x19d819-0xd5;const _0x306117=a259_0x3061();let _0x438ada=_0x306117[_0x19d819];return _0x438ada;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a259_0x3061(){const _0x132a51=['isTerminal','read','2499732GZWOvr','26104fJmACc','task','str','57nsNvVH','6999057vfOHUk',',\x20received\x20','compress','1264dxFJgO','trim','2652260dzdVLD','task-id','appCode','cookie','3323698MoRZmy','string','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','status','436kezQBJ','1688144urUTBL','taskId'];a259_0x3061=function(){return _0x132a51;};return a259_0x3061();}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':a259_0x1fb328(0xdf),'command':a259_0x1fb328(0xd7),'description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':a259_0x1fb328(0xdc),'defaultOutputFormat':a259_0x1fb328(0xe4),'structuredErrors':!![],'flags':[{'name':a259_0x1fb328(0xe8),'type':a259_0x1fb328(0xd5),'required':!![],'description':a259_0x1fb328(0xd6)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x36ff61){const _0xa7a53d=a259_0x1fb328;if(!_0x36ff61['str'](_0xa7a53d(0xe8))['trim']())throw CliErrors['flagMissing'](_0xa7a53d(0xe8));},async 'execute'(_0x3f7119){const _0x10e0f6=a259_0x1fb328,_0x1bdb45=_0x3f7119[_0x10e0f6(0xe0)](_0x10e0f6(0xe8))[_0x10e0f6(0xe6)](),_0x41fa41=normalizeAsyncTask(await getAsyncTaskStatus(_0x1bdb45,_0x3f7119[_0x10e0f6(0xe9)],_0x3f7119[_0x10e0f6(0xea)]));if(_0x41fa41[_0x10e0f6(0xda)]!==_0x1bdb45)throw CliErrors['apiError']('Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20'+_0x1bdb45+_0x10e0f6(0xe3)+_0x41fa41['taskId']+'.');const _0x308d98=buildAsyncTaskStatusCommand(_0x41fa41['taskId'],_0x3f7119[_0x10e0f6(0xe9)]);return{'ok':!![],'message':asyncTaskMessage(_0x41fa41),'data':{'appCode':_0x3f7119[_0x10e0f6(0xe9)],..._0x41fa41,'query':_0x41fa41[_0x10e0f6(0xdb)]?null:{'command':_0x308d98}}};}};
@@ -1 +1 @@
1
- (function(_0x1a784f,_0x275002){const _0x5bf93a=a260_0x4bb4,_0x59cfad=_0x1a784f();while(!![]){try{const _0x3d0894=parseInt(_0x5bf93a(0x76))/0x1+-parseInt(_0x5bf93a(0x70))/0x2+parseInt(_0x5bf93a(0x6d))/0x3*(parseInt(_0x5bf93a(0x73))/0x4)+parseInt(_0x5bf93a(0x6e))/0x5*(-parseInt(_0x5bf93a(0x74))/0x6)+-parseInt(_0x5bf93a(0x6f))/0x7*(parseInt(_0x5bf93a(0x72))/0x8)+parseInt(_0x5bf93a(0x6c))/0x9+parseInt(_0x5bf93a(0x75))/0xa*(-parseInt(_0x5bf93a(0x71))/0xb);if(_0x3d0894===_0x275002)break;else _0x59cfad['push'](_0x59cfad['shift']());}catch(_0x22944e){_0x59cfad['push'](_0x59cfad['shift']());}}}(a260_0x4c5b,0x66ca7));function a260_0x4bb4(_0x25622b,_0x3fd8f2){_0x25622b=_0x25622b-0x6c;const _0x4c5b4a=a260_0x4c5b();let _0x4bb441=_0x4c5b4a[_0x25622b];return _0x4bb441;}function a260_0x4c5b(){const _0x48f209=['102392Artyqb','1206GyHOrJ','16070aSxAqb','370536YFhmDu','6810930UKYgJD','75GyiuZM','15735pehDcY','14140evSQvl','119582ZkCtWl','231ynhBBb','2456WRfzej'];a260_0x4c5b=function(){return _0x48f209;};return a260_0x4c5b();}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];
1
+ function a260_0x2d0e(_0x15feed,_0x2d0e34){_0x15feed=_0x15feed-0x105;const _0x4cd2b7=a260_0x4cd2();let _0x2d0e2d=_0x4cd2b7[_0x15feed];return _0x2d0e2d;}(function(_0x187ec4,_0x869d7b){const _0x1d2694=a260_0x2d0e,_0x562ec3=_0x187ec4();while(!![]){try{const _0x19fec6=parseInt(_0x1d2694(0x105))/0x1+parseInt(_0x1d2694(0x10b))/0x2+-parseInt(_0x1d2694(0x10a))/0x3+parseInt(_0x1d2694(0x10c))/0x4*(-parseInt(_0x1d2694(0x109))/0x5)+parseInt(_0x1d2694(0x10d))/0x6*(parseInt(_0x1d2694(0x108))/0x7)+parseInt(_0x1d2694(0x107))/0x8+parseInt(_0x1d2694(0x106))/0x9*(-parseInt(_0x1d2694(0x10e))/0xa);if(_0x19fec6===_0x869d7b)break;else _0x562ec3['push'](_0x562ec3['shift']());}catch(_0x3e78f8){_0x562ec3['push'](_0x562ec3['shift']());}}}(a260_0x4cd2,0x1d94c));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a260_0x4cd2(){const _0x15178a=['511248QIWxEv','152854frSFOK','4QWysFX','216pMgNsE','60rGMPSN','2489tIzWuK','128394SwFUqY','850584exrElN','45409AXxYVv','207975efOXcH'];a260_0x4cd2=function(){return _0x15178a;};return a260_0x4cd2();}export const tenantDefinitions=[tenantMembersListDefinition];
@@ -1 +1 @@
1
- const a261_0x2deb63=a261_0x5dd9;(function(_0x70fe1,_0x131016){const _0x32b3cd=a261_0x5dd9,_0xb4f0c8=_0x70fe1();while(!![]){try{const _0x380fb3=-parseInt(_0x32b3cd(0xcf))/0x1+-parseInt(_0x32b3cd(0xd6))/0x2+-parseInt(_0x32b3cd(0xcd))/0x3+parseInt(_0x32b3cd(0xdb))/0x4*(-parseInt(_0x32b3cd(0xe1))/0x5)+parseInt(_0x32b3cd(0xdf))/0x6+parseInt(_0x32b3cd(0xd5))/0x7+parseInt(_0x32b3cd(0xd3))/0x8;if(_0x380fb3===_0x131016)break;else _0xb4f0c8['push'](_0xb4f0c8['shift']());}catch(_0x52efb6){_0xb4f0c8['push'](_0xb4f0c8['shift']());}}}(a261_0x1946,0x20c81));function a261_0x5dd9(_0x455e82,_0x17ede7){_0x455e82=_0x455e82-0xcd;const _0x1946fa=a261_0x1946();let _0x5dd98a=_0x1946fa[_0x455e82];return _0x5dd98a;}import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a261_0x1946(){const _0x19652d=['Exact\x20tenant\x20code','string','tenant-code','2526272VzzKZz','members-list','489132ZAFKsV','17782FrkItW','\x20tenant\x20member(s)','read','Pass\x20--tenant-code\x20<code>.','trim','850812CtqrdV','length','flagMissing','tenant','1321698bSRBjo','Found\x20','5LznFQa','116487OCoRjy','str','211247xiCnYk'];a261_0x1946=function(){return _0x19652d;};return a261_0x1946();}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a261_0x2deb63(0xde),'command':a261_0x2deb63(0xd4),'description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':a261_0x2deb63(0xd8),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a261_0x2deb63(0xd2),'type':a261_0x2deb63(0xd1),'required':!![],'description':a261_0x2deb63(0xd0)}],async 'validate'(_0x2c8c05){const _0x56fd51=a261_0x2deb63;if(!_0x2c8c05[_0x56fd51(0xce)]('tenant-code')[_0x56fd51(0xda)]())throw CliErrors[_0x56fd51(0xdd)](_0x56fd51(0xd2),_0x56fd51(0xd9));},async 'execute'(_0x2e8ccb){const _0xbdb94d=a261_0x2deb63,_0x2480cc=_0x2e8ccb[_0xbdb94d(0xce)](_0xbdb94d(0xd2))[_0xbdb94d(0xda)](),_0x30aa15=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x2480cc,_0x30aa15);const _0xc72c38=projectTenantMembers(await listTenantDirectoryMembers(_0x2480cc));return{'ok':!![],'data':{'tenantCode':_0x2480cc,'items':_0xc72c38,'totalCount':_0xc72c38[_0xbdb94d(0xdc)]},'message':_0xbdb94d(0xe0)+_0xc72c38[_0xbdb94d(0xdc)]+_0xbdb94d(0xd7)};}};
1
+ const a261_0x13e2ae=a261_0x1e6c;(function(_0x5418ea,_0x54572e){const _0x50ad7b=a261_0x1e6c,_0x53509a=_0x5418ea();while(!![]){try{const _0x263fea=parseInt(_0x50ad7b(0x166))/0x1+parseInt(_0x50ad7b(0x154))/0x2+-parseInt(_0x50ad7b(0x155))/0x3*(parseInt(_0x50ad7b(0x15e))/0x4)+parseInt(_0x50ad7b(0x158))/0x5+-parseInt(_0x50ad7b(0x167))/0x6*(-parseInt(_0x50ad7b(0x161))/0x7)+parseInt(_0x50ad7b(0x160))/0x8*(-parseInt(_0x50ad7b(0x162))/0x9)+-parseInt(_0x50ad7b(0x16b))/0xa*(-parseInt(_0x50ad7b(0x15d))/0xb);if(_0x263fea===_0x54572e)break;else _0x53509a['push'](_0x53509a['shift']());}catch(_0x55dd0d){_0x53509a['push'](_0x53509a['shift']());}}}(a261_0x1452,0x4692f));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a261_0x1452(){const _0xfa745=['flagMissing','str','283571KixIZp','1654266wXKXeS','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','tenant-code','string','13210MlvDsz','\x20tenant\x20member(s)','354344limuCu','129pWFXBt','trim','tenant','372715NSmmBm','Exact\x20tenant\x20code','Pass\x20--tenant-code\x20<code>.','length','read','55osmMeP','31856QOygEB','Found\x20','40JNhKNa','14pYNpsu','831222ohymrk','members-list'];a261_0x1452=function(){return _0xfa745;};return a261_0x1452();}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';function a261_0x1e6c(_0x114914,_0x170c0d){_0x114914=_0x114914-0x153;const _0x14522c=a261_0x1452();let _0x1e6c05=_0x14522c[_0x114914];return _0x1e6c05;}export const tenantMembersListDefinition={'service':a261_0x13e2ae(0x157),'command':a261_0x13e2ae(0x163),'description':a261_0x13e2ae(0x168),'risk':a261_0x13e2ae(0x15c),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a261_0x13e2ae(0x169),'type':a261_0x13e2ae(0x16a),'required':!![],'description':a261_0x13e2ae(0x159)}],async 'validate'(_0x2f3840){const _0x3c9197=a261_0x13e2ae;if(!_0x2f3840[_0x3c9197(0x165)](_0x3c9197(0x169))[_0x3c9197(0x156)]())throw CliErrors[_0x3c9197(0x164)]('tenant-code',_0x3c9197(0x15a));},async 'execute'(_0x5463a9){const _0xa94a25=a261_0x13e2ae,_0x20475e=_0x5463a9[_0xa94a25(0x165)](_0xa94a25(0x169))[_0xa94a25(0x156)](),_0x38cd33=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x20475e,_0x38cd33);const _0x393e06=projectTenantMembers(await listTenantDirectoryMembers(_0x20475e));return{'ok':!![],'data':{'tenantCode':_0x20475e,'items':_0x393e06,'totalCount':_0x393e06[_0xa94a25(0x15b)]},'message':_0xa94a25(0x15f)+_0x393e06['length']+_0xa94a25(0x153)};}};
@@ -1 +1 @@
1
- function a262_0x9d7b(){const _0xcd0dda=['status','3633Dvqeyf','get','username','44NAedpH','Tenant\x20\x22','488lLVhLd','15112740wsoknZ','values','5SYkKim','some','nickname','tenantCode','userId','14755310HYrzcw','3978512FJKHTs','adminFlag','ADMIN','displayName','1394874JFkoJo','sort','3edwqRJ','set','152757cSDgvb','role','6330NuQyds','1425844poSIwa'];a262_0x9d7b=function(){return _0xcd0dda;};return a262_0x9d7b();}(function(_0x3f6cce,_0x263ebf){const _0x1876a6=a262_0x3255,_0x57583f=_0x3f6cce();while(!![]){try{const _0x3af4b2=-parseInt(_0x1876a6(0x137))/0x1+parseInt(_0x1876a6(0x13e))/0x2*(-parseInt(_0x1876a6(0x139))/0x3)+-parseInt(_0x1876a6(0x14e))/0x4*(-parseInt(_0x1876a6(0x148))/0x5)+-parseInt(_0x1876a6(0x13d))/0x6*(parseInt(_0x1876a6(0x140))/0x7)+-parseInt(_0x1876a6(0x145))/0x8*(parseInt(_0x1876a6(0x13b))/0x9)+-parseInt(_0x1876a6(0x14d))/0xa+parseInt(_0x1876a6(0x143))/0xb*(parseInt(_0x1876a6(0x146))/0xc);if(_0x3af4b2===_0x263ebf)break;else _0x57583f['push'](_0x57583f['shift']());}catch(_0x23882b){_0x57583f['push'](_0x57583f['shift']());}}}(a262_0x9d7b,0xd36bf));import{CliErrors}from'../../errors.js';function a262_0x3255(_0x15773c,_0x5ae96e){_0x15773c=_0x15773c-0x134;const _0x9d7b0=a262_0x9d7b();let _0x32556f=_0x9d7b0[_0x15773c];return _0x32556f;}function textOrNull(_0x5c26e5){const _0x2faaa1=_0x5c26e5?.['trim']();return _0x2faaa1?_0x2faaa1:null;}export function projectTenantMembers(_0x15325a){const _0x14a0ab=a262_0x3255,_0x4139b8=new Map();for(const _0xfbd29b of _0x15325a){const _0x3d723b=Number(_0xfbd29b[_0x14a0ab(0x14c)]);if(!Number['isFinite'](_0x3d723b)||_0x3d723b<=0x0)continue;const _0x8cdf78={'userId':_0x3d723b,'username':textOrNull(_0xfbd29b[_0x14a0ab(0x142)]),'displayName':textOrNull(_0xfbd29b[_0x14a0ab(0x14a)]),'role':_0xfbd29b[_0x14a0ab(0x134)]===!![]?_0x14a0ab(0x135):'MEMBER','status':textOrNull(_0xfbd29b[_0x14a0ab(0x13f)])},_0xf0d5b7=_0x4139b8[_0x14a0ab(0x141)](_0x3d723b);if(!_0xf0d5b7){_0x4139b8[_0x14a0ab(0x13a)](_0x3d723b,_0x8cdf78);continue;}_0xf0d5b7[_0x14a0ab(0x142)]??=_0x8cdf78['username'],_0xf0d5b7[_0x14a0ab(0x136)]??=_0x8cdf78['displayName'],_0xf0d5b7[_0x14a0ab(0x13f)]??=_0x8cdf78[_0x14a0ab(0x13f)];if(_0x8cdf78[_0x14a0ab(0x13c)]==='ADMIN')_0xf0d5b7[_0x14a0ab(0x13c)]='ADMIN';}return[..._0x4139b8[_0x14a0ab(0x147)]()][_0x14a0ab(0x138)]((_0x4b84a9,_0x52cce9)=>_0x4b84a9[_0x14a0ab(0x14c)]-_0x52cce9[_0x14a0ab(0x14c)]);}export function assertTenantAccessible(_0x3d3427,_0x4beea6){const _0x59fedc=a262_0x3255;if(_0x4beea6[_0x59fedc(0x149)](_0x2a31c1=>_0x2a31c1[_0x59fedc(0x14b)]===_0x3d3427))return;throw CliErrors['validation'](_0x59fedc(0x144)+_0x3d3427+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}
1
+ function a262_0x2cef(){const _0xb93fef=['13101oZRWUX','55MUxFuP','values','nickname','trim','role','176232bBmDTO','7cMCMkc','ADMIN','displayName','784456XaZfsu','sort','126270eTGOtX','userId','9dyTcmK','get','adminFlag','24237tXNJQu','1800504QDFVEp','52FwpjxN','username','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','335285jNXObc','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','tenantCode','status'];a262_0x2cef=function(){return _0xb93fef;};return a262_0x2cef();}function a262_0x546b(_0x8facf7,_0xa268cd){_0x8facf7=_0x8facf7-0xd4;const _0x2cefe4=a262_0x2cef();let _0x546b71=_0x2cefe4[_0x8facf7];return _0x546b71;}(function(_0x4b14bf,_0x3c8f54){const _0x5b7f7c=a262_0x546b,_0x31fee0=_0x4b14bf();while(!![]){try{const _0x45cdc6=-parseInt(_0x5b7f7c(0xed))/0x1+parseInt(_0x5b7f7c(0xe6))/0x2*(parseInt(_0x5b7f7c(0xe4))/0x3)+parseInt(_0x5b7f7c(0xdd))/0x4+parseInt(_0x5b7f7c(0xe9))/0x5+parseInt(_0x5b7f7c(0xd9))/0x6*(-parseInt(_0x5b7f7c(0xda))/0x7)+-parseInt(_0x5b7f7c(0xe5))/0x8*(parseInt(_0x5b7f7c(0xe1))/0x9)+-parseInt(_0x5b7f7c(0xdf))/0xa*(parseInt(_0x5b7f7c(0xd4))/0xb);if(_0x45cdc6===_0x3c8f54)break;else _0x31fee0['push'](_0x31fee0['shift']());}catch(_0x126a76){_0x31fee0['push'](_0x31fee0['shift']());}}}(a262_0x2cef,0x22cda));import{CliErrors}from'../../errors.js';function textOrNull(_0x2945b8){const _0x1c15cb=a262_0x546b,_0x138d08=_0x2945b8?.[_0x1c15cb(0xd7)]();return _0x138d08?_0x138d08:null;}export function projectTenantMembers(_0x2461e2){const _0x371ff1=a262_0x546b,_0x4c476b=new Map();for(const _0x3a6082 of _0x2461e2){const _0x202cf8=Number(_0x3a6082[_0x371ff1(0xe0)]);if(!Number['isFinite'](_0x202cf8)||_0x202cf8<=0x0)continue;const _0x376f04={'userId':_0x202cf8,'username':textOrNull(_0x3a6082['username']),'displayName':textOrNull(_0x3a6082[_0x371ff1(0xd6)]),'role':_0x3a6082[_0x371ff1(0xe3)]===!![]?_0x371ff1(0xdb):'MEMBER','status':textOrNull(_0x3a6082[_0x371ff1(0xec)])},_0x32d11f=_0x4c476b[_0x371ff1(0xe2)](_0x202cf8);if(!_0x32d11f){_0x4c476b['set'](_0x202cf8,_0x376f04);continue;}_0x32d11f[_0x371ff1(0xe7)]??=_0x376f04[_0x371ff1(0xe7)],_0x32d11f['displayName']??=_0x376f04[_0x371ff1(0xdc)],_0x32d11f[_0x371ff1(0xec)]??=_0x376f04['status'];if(_0x376f04[_0x371ff1(0xd8)]===_0x371ff1(0xdb))_0x32d11f['role']=_0x371ff1(0xdb);}return[..._0x4c476b[_0x371ff1(0xd5)]()][_0x371ff1(0xde)]((_0x46fa0b,_0x96b0c1)=>_0x46fa0b[_0x371ff1(0xe0)]-_0x96b0c1[_0x371ff1(0xe0)]);}export function assertTenantAccessible(_0x179d9c,_0x15e6b0){const _0x231d52=a262_0x546b;if(_0x15e6b0['some'](_0xeebf90=>_0xeebf90[_0x231d52(0xeb)]===_0x179d9c))return;throw CliErrors['validation']('Tenant\x20\x22'+_0x179d9c+_0x231d52(0xea),_0x231d52(0xe8));}