@lovrabet/rabetbase-cli 2.5.3-beta.1 → 2.5.3-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/api/generate-sdk-config-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/logs.d.ts +7 -0
  38. package/lib/commands/bff/logs.js +1 -0
  39. package/lib/commands/bff/pull.js +1 -1
  40. package/lib/commands/bff/push.js +1 -1
  41. package/lib/commands/bff/status.js +1 -1
  42. package/lib/commands/cli-skill/index.js +1 -1
  43. package/lib/commands/cli-update.js +1 -1
  44. package/lib/commands/codegen/index.js +1 -1
  45. package/lib/commands/codegen/sdk.js +1 -1
  46. package/lib/commands/codegen/sql.js +1 -1
  47. package/lib/commands/common/app-registry.js +1 -1
  48. package/lib/commands/common/app-selector.js +1 -1
  49. package/lib/commands/common/async-task.js +1 -1
  50. package/lib/commands/common/dry-run.js +1 -1
  51. package/lib/commands/common/flags.js +1 -1
  52. package/lib/commands/common/local-file.js +1 -1
  53. package/lib/commands/common/validate.js +1 -1
  54. package/lib/commands/config/delete.js +1 -1
  55. package/lib/commands/config/get.js +1 -1
  56. package/lib/commands/config/index.js +1 -1
  57. package/lib/commands/config/init.js +1 -1
  58. package/lib/commands/config/list.js +1 -1
  59. package/lib/commands/config/set.js +1 -1
  60. package/lib/commands/config/shared.js +1 -1
  61. package/lib/commands/dataset/batch-design.d.ts +21 -0
  62. package/lib/commands/dataset/batch-design.js +1 -0
  63. package/lib/commands/dataset/business-group-update.js +1 -1
  64. package/lib/commands/dataset/business-groups.js +1 -1
  65. package/lib/commands/dataset/capability.js +1 -1
  66. package/lib/commands/dataset/delete.js +1 -1
  67. package/lib/commands/dataset/detail.js +1 -1
  68. package/lib/commands/dataset/extend-update.js +1 -1
  69. package/lib/commands/dataset/field-restore.js +1 -1
  70. package/lib/commands/dataset/field-update.js +1 -1
  71. package/lib/commands/dataset/generate.js +1 -1
  72. package/lib/commands/dataset/index.js +1 -1
  73. package/lib/commands/dataset/list.js +1 -1
  74. package/lib/commands/dataset/operations.js +1 -1
  75. package/lib/commands/dataset/relation-audit.js +1 -1
  76. package/lib/commands/dataset/relation-create.js +1 -1
  77. package/lib/commands/dataset/relation-delete.js +1 -1
  78. package/lib/commands/dataset/relation-shared.js +1 -1
  79. package/lib/commands/dataset/relation-update.js +1 -1
  80. package/lib/commands/dataset/relations.js +1 -1
  81. package/lib/commands/dataset/rename.js +1 -1
  82. package/lib/commands/dataset/restore.js +1 -1
  83. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  84. package/lib/commands/db/analysis-batching.js +1 -1
  85. package/lib/commands/db/analyze-batch-plan.js +1 -1
  86. package/lib/commands/db/analyze-cancel.js +1 -1
  87. package/lib/commands/db/analyze-start.js +1 -1
  88. package/lib/commands/db/analyze-status.js +1 -1
  89. package/lib/commands/db/create.js +1 -1
  90. package/lib/commands/db/delete.js +1 -1
  91. package/lib/commands/db/detail.js +1 -1
  92. package/lib/commands/db/diff-refresh-start.js +1 -1
  93. package/lib/commands/db/diff-refresh-status.js +1 -1
  94. package/lib/commands/db/diff.js +1 -1
  95. package/lib/commands/db/index.js +1 -1
  96. package/lib/commands/db/list.js +1 -1
  97. package/lib/commands/db/shared.js +1 -1
  98. package/lib/commands/db/table-diff-shared.js +1 -1
  99. package/lib/commands/db/tables.js +1 -1
  100. package/lib/commands/db/test.js +1 -1
  101. package/lib/commands/db/update.js +1 -1
  102. package/lib/commands/deployment/index.js +1 -1
  103. package/lib/commands/deployment/sync-all.js +1 -1
  104. package/lib/commands/deployment/sync-jobs.js +1 -1
  105. package/lib/commands/deployment/sync-status.js +1 -1
  106. package/lib/commands/doctor.js +1 -1
  107. package/lib/commands/file/index.js +1 -1
  108. package/lib/commands/flow/create.d.ts +2 -0
  109. package/lib/commands/flow/create.js +1 -0
  110. package/lib/commands/flow/detail.d.ts +2 -0
  111. package/lib/commands/flow/detail.js +1 -0
  112. package/lib/commands/flow/index.d.ts +3 -0
  113. package/lib/commands/flow/index.js +1 -0
  114. package/lib/commands/flow/list.d.ts +2 -0
  115. package/lib/commands/flow/list.js +1 -0
  116. package/lib/commands/flow/publish.d.ts +2 -0
  117. package/lib/commands/flow/publish.js +1 -0
  118. package/lib/commands/flow/runtime-resources-shared.d.ts +40 -0
  119. package/lib/commands/flow/runtime-resources-shared.js +1 -0
  120. package/lib/commands/flow/runtime-role-list.d.ts +2 -0
  121. package/lib/commands/flow/runtime-role-list.js +1 -0
  122. package/lib/commands/flow/runtime-role-user-list.d.ts +2 -0
  123. package/lib/commands/flow/runtime-role-user-list.js +1 -0
  124. package/lib/commands/flow/runtime-user-search.d.ts +2 -0
  125. package/lib/commands/flow/runtime-user-search.js +1 -0
  126. package/lib/commands/flow/shared.d.ts +41 -0
  127. package/lib/commands/flow/shared.js +1 -0
  128. package/lib/commands/flow/update.d.ts +2 -0
  129. package/lib/commands/flow/update.js +1 -0
  130. package/lib/commands/flow/validate.d.ts +3 -0
  131. package/lib/commands/flow/validate.js +1 -0
  132. package/lib/commands/instant-api-policy/current.js +1 -1
  133. package/lib/commands/instant-api-policy/index.js +1 -1
  134. package/lib/commands/instant-api-policy/init.js +1 -1
  135. package/lib/commands/instant-api-policy/publish.js +1 -1
  136. package/lib/commands/instant-api-policy/pull.js +1 -1
  137. package/lib/commands/instant-api-policy/revision.js +1 -1
  138. package/lib/commands/instant-api-policy/revisions.js +1 -1
  139. package/lib/commands/instant-api-policy/rollback.js +1 -1
  140. package/lib/commands/instant-api-policy/shared.js +1 -1
  141. package/lib/commands/instant-api-policy/validate.js +1 -1
  142. package/lib/commands/issue/index.js +1 -1
  143. package/lib/commands/issue/nudge.js +1 -1
  144. package/lib/commands/issue/report.js +1 -1
  145. package/lib/commands/issue/shared.js +1 -1
  146. package/lib/commands/kb/create.js +1 -1
  147. package/lib/commands/kb/delete.js +1 -1
  148. package/lib/commands/kb/detail.js +1 -1
  149. package/lib/commands/kb/index.js +1 -1
  150. package/lib/commands/kb/list.js +1 -1
  151. package/lib/commands/kb/search.js +1 -1
  152. package/lib/commands/kb/shared.js +1 -1
  153. package/lib/commands/kb/update.js +1 -1
  154. package/lib/commands/logs/index.js +1 -1
  155. package/lib/commands/menu/asset-update.js +1 -1
  156. package/lib/commands/menu/delete.js +1 -1
  157. package/lib/commands/menu/external-link-create.js +1 -1
  158. package/lib/commands/menu/external-link-update.js +1 -1
  159. package/lib/commands/menu/group-create.js +1 -1
  160. package/lib/commands/menu/group-update.js +1 -1
  161. package/lib/commands/menu/index.js +1 -1
  162. package/lib/commands/menu/list.js +1 -1
  163. package/lib/commands/menu/move.js +1 -1
  164. package/lib/commands/menu/regroup-start.js +1 -1
  165. package/lib/commands/menu/rename.js +1 -1
  166. package/lib/commands/menu/shared/compare-table.js +1 -1
  167. package/lib/commands/menu/shared/delete-plan.js +1 -1
  168. package/lib/commands/menu/shared/facts.js +1 -1
  169. package/lib/commands/menu/shared/index.js +1 -1
  170. package/lib/commands/menu/shared/inquirer.js +1 -1
  171. package/lib/commands/menu/shared/local-pages.js +1 -1
  172. package/lib/commands/menu/shared/logic.js +1 -1
  173. package/lib/commands/menu/shared/mutations.js +1 -1
  174. package/lib/commands/menu/shared/service.js +1 -1
  175. package/lib/commands/menu/shared/sync-core.js +1 -1
  176. package/lib/commands/menu/shared/update-core.js +1 -1
  177. package/lib/commands/menu/shared/valid-url.js +1 -1
  178. package/lib/commands/menu/sync.js +1 -1
  179. package/lib/commands/menu/visibility-update.js +1 -1
  180. package/lib/commands/notification/config-create.js +1 -1
  181. package/lib/commands/notification/config-delete.js +1 -1
  182. package/lib/commands/notification/config-list.js +1 -1
  183. package/lib/commands/notification/config-update.js +1 -1
  184. package/lib/commands/notification/index.js +1 -1
  185. package/lib/commands/notification/shared.js +1 -1
  186. package/lib/commands/ocr/index.js +1 -1
  187. package/lib/commands/page/create.js +1 -1
  188. package/lib/commands/page/custom/detail.js +1 -1
  189. package/lib/commands/page/custom/list.js +1 -1
  190. package/lib/commands/page/custom/publish.js +1 -1
  191. package/lib/commands/page/custom/shared.js +1 -1
  192. package/lib/commands/page/custom/syntax.js +1 -1
  193. package/lib/commands/page/custom/update.js +1 -1
  194. package/lib/commands/page/data-list-status.js +1 -1
  195. package/lib/commands/page/generate-start.js +1 -1
  196. package/lib/commands/page/generate-status.js +1 -1
  197. package/lib/commands/page/index.js +1 -1
  198. package/lib/commands/page/pull.js +1 -1
  199. package/lib/commands/page/push.js +1 -1
  200. package/lib/commands/page/relation-audit.js +1 -1
  201. package/lib/commands/page/restore.js +1 -1
  202. package/lib/commands/page/shared.js +1 -1
  203. package/lib/commands/page/sync.js +1 -1
  204. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  205. package/lib/commands/project/create/format-elapsed.js +1 -1
  206. package/lib/commands/project/create/main.js +1 -1
  207. package/lib/commands/project/create/materialize-project-template.js +1 -1
  208. package/lib/commands/project/create/project-name.js +1 -1
  209. package/lib/commands/project/create/project-template-archive.js +1 -1
  210. package/lib/commands/project/create/project-template-path.js +1 -1
  211. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  212. package/lib/commands/project/create/use-format-code.js +1 -1
  213. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  214. package/lib/commands/project/domain-routing-sync.js +1 -1
  215. package/lib/commands/project/index.js +1 -1
  216. package/lib/commands/project/upgrade.js +1 -1
  217. package/lib/commands/registry.js +1 -1
  218. package/lib/commands/role/delete.js +1 -1
  219. package/lib/commands/role/detail.js +1 -1
  220. package/lib/commands/role/index.js +1 -1
  221. package/lib/commands/role/list.js +1 -1
  222. package/lib/commands/role/shared.js +1 -1
  223. package/lib/commands/role/update.js +1 -1
  224. package/lib/commands/role/user-add.js +1 -1
  225. package/lib/commands/role/user-remove.js +1 -1
  226. package/lib/commands/role/user-resolve.js +1 -1
  227. package/lib/commands/rule/get.js +1 -1
  228. package/lib/commands/rule/index.js +1 -1
  229. package/lib/commands/rule/list.js +1 -1
  230. package/lib/commands/rule/set.js +1 -1
  231. package/lib/commands/rule/shared.js +1 -1
  232. package/lib/commands/run/index.js +1 -1
  233. package/lib/commands/schema.js +1 -1
  234. package/lib/commands/sql/create.js +1 -1
  235. package/lib/commands/sql/delete.js +1 -1
  236. package/lib/commands/sql/detail.js +1 -1
  237. package/lib/commands/sql/exec.js +1 -1
  238. package/lib/commands/sql/index.js +1 -1
  239. package/lib/commands/sql/list.js +1 -1
  240. package/lib/commands/sql/pull.js +1 -1
  241. package/lib/commands/sql/push.js +1 -1
  242. package/lib/commands/sql/shared.js +1 -1
  243. package/lib/commands/sql/status.js +1 -1
  244. package/lib/commands/sql/validate.js +1 -1
  245. package/lib/commands/task/index.js +1 -1
  246. package/lib/commands/task/status.js +1 -1
  247. package/lib/commands/tenant/index.js +1 -1
  248. package/lib/commands/tenant/members-list.js +1 -1
  249. package/lib/commands/tenant/shared.js +1 -1
  250. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  251. package/lib/commands/user-account/index.js +1 -1
  252. package/lib/commands/workspace/add.js +1 -1
  253. package/lib/commands/workspace/index.js +1 -1
  254. package/lib/commands/workspace/remove.js +1 -1
  255. package/lib/config/domain-config.js +1 -1
  256. package/lib/config/project-domain-routing.js +1 -1
  257. package/lib/config/region-config.js +1 -1
  258. package/lib/config/schema.js +1 -1
  259. package/lib/constant/cdn.js +1 -1
  260. package/lib/constant/cli.js +1 -1
  261. package/lib/constant/defaults.js +1 -1
  262. package/lib/constant/domain.js +1 -1
  263. package/lib/constant/env.js +1 -1
  264. package/lib/constant/output.js +1 -1
  265. package/lib/constant/paths.js +1 -1
  266. package/lib/constant/region.js +1 -1
  267. package/lib/constant/risk.js +1 -1
  268. package/lib/constant/routing-profile.js +1 -1
  269. package/lib/context/app-resolver.js +1 -1
  270. package/lib/context/auth-resolver.js +1 -1
  271. package/lib/context/config-loader.js +1 -1
  272. package/lib/context.js +1 -1
  273. package/lib/core/alias-resolver.js +1 -1
  274. package/lib/core/api-client.d.ts +170 -1
  275. package/lib/core/api-client.js +1 -1
  276. package/lib/core/bff/config.js +1 -1
  277. package/lib/core/bff/file-system.js +1 -1
  278. package/lib/core/bff/hash.js +1 -1
  279. package/lib/core/bff/hook-directory.d.ts +55 -0
  280. package/lib/core/bff/hook-directory.js +1 -0
  281. package/lib/core/bff/lock.js +1 -1
  282. package/lib/core/bff/types.d.ts +15 -0
  283. package/lib/core/bff/utils.js +1 -1
  284. package/lib/core/db-resolver.js +1 -1
  285. package/lib/core/flow-config.d.ts +628 -0
  286. package/lib/core/flow-config.js +1 -0
  287. package/lib/core/instant-api-policy/config.js +1 -1
  288. package/lib/core/kb-search-client.js +1 -1
  289. package/lib/core/page/file-system.js +1 -1
  290. package/lib/core/page/hash.js +1 -1
  291. package/lib/core/page/lock.js +1 -1
  292. package/lib/core/page/lr-smart-jsx.js +1 -1
  293. package/lib/core/sql-index-auditor.js +1 -1
  294. package/lib/core/sql-sync/config.js +1 -1
  295. package/lib/core/sql-sync/file-system.js +1 -1
  296. package/lib/core/sql-sync/hash.js +1 -1
  297. package/lib/core/sql-sync/lock.js +1 -1
  298. package/lib/core/sql-sync/utils.js +1 -1
  299. package/lib/core/sql-validator.js +1 -1
  300. package/lib/errors.js +1 -1
  301. package/lib/framework/build-all-flags.js +1 -1
  302. package/lib/framework/error-output.js +1 -1
  303. package/lib/framework/explicit-yes.js +1 -1
  304. package/lib/framework/flags.js +1 -1
  305. package/lib/framework/help.js +1 -1
  306. package/lib/framework/index.js +1 -1
  307. package/lib/framework/output.js +1 -1
  308. package/lib/framework/response.js +1 -1
  309. package/lib/framework/runner-alias.js +1 -1
  310. package/lib/framework/runner.js +1 -1
  311. package/lib/framework/schema-export.js +1 -1
  312. package/lib/framework/supported-flags.js +1 -1
  313. package/lib/framework/types.js +1 -1
  314. package/lib/generated/build-info.d.ts +4 -4
  315. package/lib/generated/build-info.js +1 -1
  316. package/lib/generated/official-routing.js +1 -1
  317. package/lib/generated/routing-contract.js +1 -1
  318. package/lib/help.js +1 -1
  319. package/lib/postinstall.js +1 -1
  320. package/lib/runtime/confirmation.js +1 -1
  321. package/lib/runtime/event.js +1 -1
  322. package/lib/runtime/index.js +1 -1
  323. package/lib/runtime/queue.js +1 -1
  324. package/lib/runtime/resolve.js +1 -1
  325. package/lib/skills/builtin-skill.js +1 -1
  326. package/lib/skills/main.js +1 -1
  327. package/lib/skills/npx-skills-add.js +1 -1
  328. package/lib/skills/skill-presence.js +1 -1
  329. package/lib/telemetry/cli-command-trace.js +1 -1
  330. package/lib/telemetry/cli-help-trace.js +1 -1
  331. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  332. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  333. package/lib/telemetry/send-cli-trace-log.js +1 -1
  334. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  335. package/lib/utils/ai_config.js +1 -1
  336. package/lib/utils/apply-jq-filter.js +1 -1
  337. package/lib/utils/cdn-config.js +1 -1
  338. package/lib/utils/check-sdk-version.js +1 -1
  339. package/lib/utils/cli-version-check.js +1 -1
  340. package/lib/utils/cli-version-policy.js +1 -1
  341. package/lib/utils/config.js +1 -1
  342. package/lib/utils/entity-with-id.js +1 -1
  343. package/lib/utils/file-utils.js +1 -1
  344. package/lib/utils/guides-cdn.js +1 -1
  345. package/lib/utils/http-client.js +1 -1
  346. package/lib/utils/is-non-interactive.js +1 -1
  347. package/lib/utils/logger.js +1 -1
  348. package/lib/utils/params.js +1 -1
  349. package/lib/utils/platform.js +1 -1
  350. package/lib/utils/sleep.js +1 -1
  351. package/lib/utils/template-replacer.js +1 -1
  352. package/lib/utils/update-notice.js +1 -1
  353. package/lib/utils/version.js +1 -1
  354. package/lib/utils/with-active-cookie.js +1 -1
  355. package/lib/utils/write-cli-side-channel.js +1 -1
  356. package/package.json +1 -1
  357. package/skills/rabetbase/SKILL.md +22 -4
  358. package/skills/rabetbase/guides/approval-flow-development-workflow.md +137 -0
  359. package/skills/rabetbase/guides/backend-function.md +19 -9
  360. package/skills/rabetbase/guides/bff-creation-workflow.md +10 -1
  361. package/skills/rabetbase/guides/conflict-detection.md +2 -0
  362. package/skills/rabetbase/guides/sdk-client-generation.md +1 -0
  363. package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +290 -0
  364. package/skills/rabetbase/references/rabetbase-bff-create.md +1 -1
  365. package/skills/rabetbase/references/rabetbase-bff-logs.md +47 -0
  366. package/skills/rabetbase/references/rabetbase-bff-pull.md +7 -3
  367. package/skills/rabetbase/references/rabetbase-bff-push.md +10 -2
  368. package/skills/rabetbase/references/rabetbase-dataset-generate.md +52 -2
  369. package/skills/rabetbase/references/rabetbase-flow-commands.md +86 -0
  370. package/skills/rabetbase/references/rabetbase-flow-resources.md +83 -0
  371. package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +25 -0
  372. package/skills/rabetbase/references/rabetbase-instant-api-policy.md +103 -11
  373. package/skills/rabetbase/references/rabetbase-notification-config-list.md +17 -0
  374. package/skills/rabetbase.manifest.json +9 -3
@@ -1 +1 @@
1
- const a207_0x2805e8=a207_0x2b08;(function(_0x35937e,_0x3c14fa){const _0x41ae34=a207_0x2b08,_0x1bef8e=_0x35937e();while(!![]){try{const _0x3b4b49=parseInt(_0x41ae34(0x1a5))/0x1+-parseInt(_0x41ae34(0x1b9))/0x2+-parseInt(_0x41ae34(0x1bb))/0x3*(parseInt(_0x41ae34(0x1b2))/0x4)+parseInt(_0x41ae34(0x1ae))/0x5+parseInt(_0x41ae34(0x1c1))/0x6*(-parseInt(_0x41ae34(0x19e))/0x7)+-parseInt(_0x41ae34(0x1ac))/0x8*(parseInt(_0x41ae34(0x19f))/0x9)+-parseInt(_0x41ae34(0x19d))/0xa*(-parseInt(_0x41ae34(0x1bf))/0xb);if(_0x3b4b49===_0x3c14fa)break;else _0x1bef8e['push'](_0x1bef8e['shift']());}catch(_0x225ccb){_0x1bef8e['push'](_0x1bef8e['shift']());}}}(a207_0x5e9b,0xdfd46));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a207_0x5e9b(){const _0x188eb7=['sqlcode','fromEntries','8WIoNDq','lockFilePath','5682005QWKpMq','sqlRootDir','toISOString','str','772UupHeS','sqls','validation','\x20(local\x20file\x20moved\x20to\x20trash)','Would\x20delete\x20SQL\x20','sqlRoot','SQL\x20lock\x20file\x20not\x20found.','1355176eIZJQa','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','10065XNwLcG','entries','Deleted\x20','trashedTo','11oBgfGW','replace','42YwpAxn','24590110KLXLwU','659722bkVyaO','9598851UPcdaf','POST','length','delete','trashDir','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','372758VKaDUN','filter','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','remoteId','appCode'];a207_0x5e9b=function(){return _0x188eb7;};return a207_0x5e9b();}import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';function a207_0x2b08(_0x24841e,_0x207c84){_0x24841e=_0x24841e-0x19d;const _0x5e9b02=a207_0x5e9b();let _0x2b0845=_0x5e9b02[_0x24841e];return _0x2b0845;}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':a207_0x2805e8(0x1a2),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x2939f3){const _0x9e3eb0=a207_0x2805e8,_0x7be055=loadSqlProjectConfig(_0x2939f3[_0x9e3eb0(0x1a9)]),_0x3df3c1=await readSqlLockFile(_0x7be055[_0x9e3eb0(0x1ad)]);if(!_0x3df3c1)throw CliErrors[_0x9e3eb0(0x1b4)](_0x9e3eb0(0x1a4));},async 'dryRun'(_0xe5a63b){const _0xb7bc84=a207_0x2805e8,_0x461e03=loadSqlProjectConfig(_0xe5a63b[_0xb7bc84(0x1a9)]),_0x291e1f=await readSqlLockFile(_0x461e03[_0xb7bc84(0x1ad)]);if(!_0x291e1f)throw CliErrors[_0xb7bc84(0x1b4)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x23fab8}=ensureSqlLockScope(_0x291e1f,_0xe5a63b[_0xb7bc84(0x1a9)],_0x461e03[_0xb7bc84(0x1b7)],_0xb7bc84(0x1a2)),_0x1dd1db=_0xe5a63b[_0xb7bc84(0x1b1)]('sqlcode'),_0x334256=_0x23fab8[_0xb7bc84(0x1b3)][_0x1dd1db];if(!_0x334256)throw CliErrors[_0xb7bc84(0x1b4)](_0xb7bc84(0x1a7)+_0x1dd1db+'\x22.');return{'method':_0xb7bc84(0x1a0),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x1dd1db,'id':_0x334256[_0xb7bc84(0x1a8)],'localPath':resolveLocalSqlFilePath(_0x461e03,_0x1dd1db,_0x334256)},'description':_0xb7bc84(0x1b6)+_0x1dd1db+_0xb7bc84(0x1ba)+_0x461e03['trashDir']};},async 'execute'(_0x28dcc8){const _0x2e1bc8=a207_0x2805e8,_0x31cbcf=loadSqlProjectConfig(_0x28dcc8[_0x2e1bc8(0x1a9)]),_0x1bed23=await readSqlLockFile(_0x31cbcf[_0x2e1bc8(0x1ad)]);if(!_0x1bed23)throw CliErrors['validation'](_0x2e1bc8(0x1b8));const {lockData:_0xda5772,appLock:_0x1edbca}=ensureSqlLockScope(_0x1bed23,_0x28dcc8[_0x2e1bc8(0x1a9)],_0x31cbcf['sqlRoot'],_0x2e1bc8(0x1a2)),_0x42fbd5=_0x28dcc8[_0x2e1bc8(0x1b1)](_0x2e1bc8(0x1aa)),_0x44787e=_0x1edbca['sqls'][_0x42fbd5];if(!_0x44787e)throw CliErrors[_0x2e1bc8(0x1b4)](_0x2e1bc8(0x1a7)+_0x42fbd5+'\x22.');await deleteSqlQuery({'id':_0x44787e[_0x2e1bc8(0x1a8)],'sqlCode':_0x42fbd5}),_0x1edbca['sqls']=Object[_0x2e1bc8(0x1ab)](Object[_0x2e1bc8(0x1bc)](_0x1edbca['sqls'])[_0x2e1bc8(0x1a6)](([_0x157c8d])=>_0x157c8d!==_0x42fbd5)),_0x1edbca['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x31cbcf['lockFilePath'],_0xda5772);const _0x3d9e04=resolveLocalSqlFilePath(_0x31cbcf,_0x42fbd5,_0x44787e);let _0x1e9822;await fileExists(_0x3d9e04)&&(_0x1e9822=await moveToTrash(_0x31cbcf['projectRoot'],_0x31cbcf[_0x2e1bc8(0x1a3)],_0x3d9e04),await cleanupEmptyDirectories(dirname(_0x3d9e04),_0x31cbcf[_0x2e1bc8(0x1af)]));const _0x27bc2b={'deleted':_0x42fbd5,'remoteId':_0x44787e[_0x2e1bc8(0x1a8)]};if(_0x1e9822)_0x27bc2b[_0x2e1bc8(0x1be)]=_0x1e9822;return{'ok':!![],'data':_0x27bc2b,'message':_0x2e1bc8(0x1bd)+_0x42fbd5+(_0x1e9822?_0x2e1bc8(0x1b5):'')};}};async function moveToTrash(_0x5c9732,_0x426c65,_0x9cfc73){const _0x88eac1=a207_0x2805e8,_0x3762a7=new Date()[_0x88eac1(0x1b0)]()[_0x88eac1(0x1c0)](/[:.]/g,'-'),_0x2cf4d0=relative(_0x5c9732,_0x9cfc73),_0x276a9f=join(_0x426c65,_0x3762a7,_0x2cf4d0);return await mkdir(dirname(_0x276a9f),{'recursive':!![]}),await rename(_0x9cfc73,_0x276a9f),_0x276a9f;}async function cleanupEmptyDirectories(_0x23593c,_0x584513){const _0x4dfbd7=a207_0x2805e8;let _0x58f6e3=resolve(_0x23593c);const _0x21588d=resolve(_0x584513);while(_0x58f6e3['startsWith'](''+_0x21588d+sep)||_0x58f6e3===_0x21588d){if(_0x58f6e3===_0x21588d)return;try{const _0xb97260=await readdir(_0x58f6e3);if(_0xb97260[_0x4dfbd7(0x1a1)]>0x0)return;await rmdir(_0x58f6e3);}catch{return;}_0x58f6e3=dirname(_0x58f6e3);}}
1
+ const a221_0xaec108=a221_0x381b;(function(_0x100ebf,_0x3d790a){const _0x45c74b=a221_0x381b,_0x11c969=_0x100ebf();while(!![]){try{const _0xb13e07=parseInt(_0x45c74b(0xd3))/0x1+-parseInt(_0x45c74b(0xdf))/0x2*(parseInt(_0x45c74b(0xd5))/0x3)+-parseInt(_0x45c74b(0xe2))/0x4*(-parseInt(_0x45c74b(0xdb))/0x5)+-parseInt(_0x45c74b(0xec))/0x6+-parseInt(_0x45c74b(0xe9))/0x7+-parseInt(_0x45c74b(0xe6))/0x8+parseInt(_0x45c74b(0xe1))/0x9;if(_0xb13e07===_0x3d790a)break;else _0x11c969['push'](_0x11c969['shift']());}catch(_0x2afae1){_0x11c969['push'](_0x11c969['shift']());}}}(a221_0x2b35,0xa1285));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';function a221_0x381b(_0xbbb326,_0xeb9d38){_0xbbb326=_0xbbb326-0xc9;const _0x2b3500=a221_0x2b35();let _0x381b02=_0x2b3500[_0xbbb326];return _0x381b02;}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':a221_0xaec108(0xd1),'command':a221_0xaec108(0xcd),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a221_0xaec108(0xd4),'flags':[SQLCODE_FLAG],async 'validate'(_0x10e616){const _0x343306=a221_0xaec108,_0xc9ba9d=loadSqlProjectConfig(_0x10e616[_0x343306(0xda)]),_0x4d38d3=await readSqlLockFile(_0xc9ba9d[_0x343306(0xde)]);if(!_0x4d38d3)throw CliErrors['validation']('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x530380){const _0x5a8a3f=a221_0xaec108,_0x32ad56=loadSqlProjectConfig(_0x530380['appCode']),_0x416706=await readSqlLockFile(_0x32ad56[_0x5a8a3f(0xde)]);if(!_0x416706)throw CliErrors['validation'](_0x5a8a3f(0xcf));const {appLock:_0xc3a1a8}=ensureSqlLockScope(_0x416706,_0x530380[_0x5a8a3f(0xda)],_0x32ad56[_0x5a8a3f(0xcc)],_0x5a8a3f(0xcd)),_0x533de3=_0x530380[_0x5a8a3f(0xe7)](_0x5a8a3f(0xe5)),_0x23c74d=_0xc3a1a8['sqls'][_0x533de3];if(!_0x23c74d)throw CliErrors[_0x5a8a3f(0xdc)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x533de3+'\x22.');return{'method':_0x5a8a3f(0xea),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x533de3,'id':_0x23c74d[_0x5a8a3f(0xd6)],'localPath':resolveLocalSqlFilePath(_0x32ad56,_0x533de3,_0x23c74d)},'description':_0x5a8a3f(0xca)+_0x533de3+_0x5a8a3f(0xe4)+_0x32ad56[_0x5a8a3f(0xe0)]};},async 'execute'(_0x268d51){const _0x5a34c5=a221_0xaec108,_0xe9bb71=loadSqlProjectConfig(_0x268d51[_0x5a34c5(0xda)]),_0x4f6875=await readSqlLockFile(_0xe9bb71[_0x5a34c5(0xde)]);if(!_0x4f6875)throw CliErrors[_0x5a34c5(0xdc)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x283b73,appLock:_0x355d41}=ensureSqlLockScope(_0x4f6875,_0x268d51[_0x5a34c5(0xda)],_0xe9bb71[_0x5a34c5(0xcc)],'delete'),_0xe0865c=_0x268d51[_0x5a34c5(0xe7)](_0x5a34c5(0xe5)),_0x3caf4f=_0x355d41[_0x5a34c5(0xd7)][_0xe0865c];if(!_0x3caf4f)throw CliErrors[_0x5a34c5(0xdc)](_0x5a34c5(0xeb)+_0xe0865c+'\x22.');await deleteSqlQuery({'id':_0x3caf4f['remoteId'],'sqlCode':_0xe0865c}),_0x355d41['sqls']=Object[_0x5a34c5(0xdd)](Object[_0x5a34c5(0xe8)](_0x355d41[_0x5a34c5(0xd7)])[_0x5a34c5(0xd9)](([_0x157603])=>_0x157603!==_0xe0865c)),_0x355d41['lastSync']=new Date()[_0x5a34c5(0xd0)](),await writeSqlLockFile(_0xe9bb71[_0x5a34c5(0xde)],_0x283b73);const _0x3b1bda=resolveLocalSqlFilePath(_0xe9bb71,_0xe0865c,_0x3caf4f);let _0x3d9da0;await fileExists(_0x3b1bda)&&(_0x3d9da0=await moveToTrash(_0xe9bb71[_0x5a34c5(0xd2)],_0xe9bb71[_0x5a34c5(0xe0)],_0x3b1bda),await cleanupEmptyDirectories(dirname(_0x3b1bda),_0xe9bb71[_0x5a34c5(0xce)]));const _0x502733={'deleted':_0xe0865c,'remoteId':_0x3caf4f['remoteId']};if(_0x3d9da0)_0x502733[_0x5a34c5(0xd8)]=_0x3d9da0;return{'ok':!![],'data':_0x502733,'message':_0x5a34c5(0xcb)+_0xe0865c+(_0x3d9da0?_0x5a34c5(0xc9):'')};}};async function moveToTrash(_0x44bc29,_0xb33de,_0x1f8a41){const _0x5b7c99=a221_0xaec108,_0x66299e=new Date()[_0x5b7c99(0xd0)]()[_0x5b7c99(0xe3)](/[:.]/g,'-'),_0x38a37a=relative(_0x44bc29,_0x1f8a41),_0x253a36=join(_0xb33de,_0x66299e,_0x38a37a);return await mkdir(dirname(_0x253a36),{'recursive':!![]}),await rename(_0x1f8a41,_0x253a36),_0x253a36;}function a221_0x2b35(){const _0x334823=['SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','toISOString','sql','projectRoot','318462aFIfJm','high-risk-write','15XgRLRJ','remoteId','sqls','trashedTo','filter','appCode','955TkUPUt','validation','fromEntries','lockFilePath','506362ciUWzE','trashDir','28708749SYesxR','2964KRyDEk','replace','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','sqlcode','7313624HZHDYu','str','entries','2937998EORKDb','POST','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','2339586hVClQc','\x20(local\x20file\x20moved\x20to\x20trash)','Would\x20delete\x20SQL\x20','Deleted\x20','sqlRoot','delete','sqlRootDir'];a221_0x2b35=function(){return _0x334823;};return a221_0x2b35();}async function cleanupEmptyDirectories(_0x3aa97a,_0x42e711){let _0x4fd876=resolve(_0x3aa97a);const _0x24286f=resolve(_0x42e711);while(_0x4fd876['startsWith'](''+_0x24286f+sep)||_0x4fd876===_0x24286f){if(_0x4fd876===_0x24286f)return;try{const _0xfaabf6=await readdir(_0x4fd876);if(_0xfaabf6['length']>0x0)return;await rmdir(_0x4fd876);}catch{return;}_0x4fd876=dirname(_0x4fd876);}}
@@ -1 +1 @@
1
- function a208_0x51a4(){const _0x4e47cc=['str','76559BoEjdD','12VSVuAl','399530lUZWwi','193372vSJPzq','99pLnXdl','66kBbChL','dbId','707640upGvUI','27YTXbIp','826768CCkkUT','318424KsnbaX','appCode','bool','2334050QazWjw','Return\x20full\x20raw\x20SQL\x20query\x20object','description','verbose','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode'];a208_0x51a4=function(){return _0x4e47cc;};return a208_0x51a4();}const a208_0x359cf0=a208_0x6e40;(function(_0x38bb7d,_0x35be9b){const _0x7a28bd=a208_0x6e40,_0x1cb8a3=_0x38bb7d();while(!![]){try{const _0x5257b8=parseInt(_0x7a28bd(0x10d))/0x1+parseInt(_0x7a28bd(0x119))/0x2*(parseInt(_0x7a28bd(0x117))/0x3)+parseInt(_0x7a28bd(0x10a))/0x4+-parseInt(_0x7a28bd(0x110))/0x5+-parseInt(_0x7a28bd(0x108))/0x6*(parseInt(_0x7a28bd(0x116))/0x7)+-parseInt(_0x7a28bd(0x10c))/0x8*(-parseInt(_0x7a28bd(0x10b))/0x9)+-parseInt(_0x7a28bd(0x118))/0xa*(parseInt(_0x7a28bd(0x11a))/0xb);if(_0x5257b8===_0x35be9b)break;else _0x1cb8a3['push'](_0x1cb8a3['shift']());}catch(_0x3b7ea6){_0x1cb8a3['push'](_0x1cb8a3['shift']());}}}(a208_0x51a4,0x3beae));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a208_0x6e40(_0x2ccb6e,_0x1d34d5){_0x2ccb6e=_0x2ccb6e-0x108;const _0x51a4d9=a208_0x51a4();let _0x6e407a=_0x51a4d9[_0x2ccb6e];return _0x6e407a;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':'detail','description':a208_0x359cf0(0x114),'risk':'read','flags':[SQLCODE_FLAG,{'name':a208_0x359cf0(0x113),'type':'boolean','description':a208_0x359cf0(0x111)}],async 'execute'(_0x2eafcb){const _0x51c9c7=a208_0x359cf0,_0x399f82=await getSqlQueryInfo(_0x2eafcb[_0x51c9c7(0x10e)],_0x2eafcb[_0x51c9c7(0x115)]('sqlcode')),_0x3864bc=_0x2eafcb[_0x51c9c7(0x10f)]('verbose');if(_0x3864bc)return{'ok':!![],'data':_0x399f82};const _0x59667a=_0x399f82[_0x51c9c7(0x109)]?await getDbName(_0x2eafcb['appCode'],_0x399f82[_0x51c9c7(0x109)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x399f82['sqlCode'],'sqlName':_0x399f82['sqlName'],'db':_0x59667a?_0x59667a+'\x20('+_0x399f82[_0x51c9c7(0x109)]+')':_0x399f82[_0x51c9c7(0x109)]??'','description':_0x399f82[_0x51c9c7(0x112)]??'','sqlContent':_0x399f82['sqlContent']??''}};}};
1
+ const a222_0x4f0b52=a222_0x447c;(function(_0x340912,_0x3eb730){const _0x3b345d=a222_0x447c,_0x2abe65=_0x340912();while(!![]){try{const _0x43e67e=parseInt(_0x3b345d(0x1c1))/0x1+-parseInt(_0x3b345d(0x1d4))/0x2*(-parseInt(_0x3b345d(0x1cc))/0x3)+-parseInt(_0x3b345d(0x1c7))/0x4*(parseInt(_0x3b345d(0x1d0))/0x5)+-parseInt(_0x3b345d(0x1c4))/0x6+-parseInt(_0x3b345d(0x1c8))/0x7*(parseInt(_0x3b345d(0x1d1))/0x8)+parseInt(_0x3b345d(0x1cf))/0x9*(parseInt(_0x3b345d(0x1c5))/0xa)+parseInt(_0x3b345d(0x1ce))/0xb;if(_0x43e67e===_0x3eb730)break;else _0x2abe65['push'](_0x2abe65['shift']());}catch(_0x1b1773){_0x2abe65['push'](_0x2abe65['shift']());}}}(a222_0x8455,0xb3ead));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a222_0x447c(_0x3d64d1,_0x2e248b){_0x3d64d1=_0x3d64d1-0x1c0;const _0x84551=a222_0x8455();let _0x447c41=_0x84551[_0x3d64d1];return _0x447c41;}function a222_0x8455(){const _0x34935b=['11821623psooqB','81pCKTpa','14225PVAdyC','32CAXWpx','sqlcode','description','232534IosBQO','sqlName','appCode','833914kivLGQ','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','verbose','5021340NXczVw','319040UDcYzF','sql','1796SksAmd','277158FvtBwD','sqlCode','Return\x20full\x20raw\x20SQL\x20query\x20object','read','21XoLeSG','dbId'];a222_0x8455=function(){return _0x34935b;};return a222_0x8455();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a222_0x4f0b52(0x1c6),'command':'detail','description':a222_0x4f0b52(0x1c2),'risk':a222_0x4f0b52(0x1cb),'flags':[SQLCODE_FLAG,{'name':a222_0x4f0b52(0x1c3),'type':'boolean','description':a222_0x4f0b52(0x1ca)}],async 'execute'(_0x9e72c0){const _0x445fa8=a222_0x4f0b52,_0x1d3345=await getSqlQueryInfo(_0x9e72c0[_0x445fa8(0x1c0)],_0x9e72c0['str'](_0x445fa8(0x1d2))),_0x1e9afc=_0x9e72c0['bool']('verbose');if(_0x1e9afc)return{'ok':!![],'data':_0x1d3345};const _0x506dda=_0x1d3345[_0x445fa8(0x1cd)]?await getDbName(_0x9e72c0[_0x445fa8(0x1c0)],_0x1d3345['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x1d3345[_0x445fa8(0x1c9)],'sqlName':_0x1d3345[_0x445fa8(0x1d5)],'db':_0x506dda?_0x506dda+'\x20('+_0x1d3345[_0x445fa8(0x1cd)]+')':_0x1d3345[_0x445fa8(0x1cd)]??'','description':_0x1d3345[_0x445fa8(0x1d3)]??'','sqlContent':_0x1d3345['sqlContent']??''}};}};
@@ -1 +1 @@
1
- const a209_0x50cf5e=a209_0x4979;function a209_0x1ab4(){const _0x5c5096=['appCode','now','2768700EGUOAQ','read','SQL\x20execution\x20failed','sqlcode','\x20row(s)\x20in\x20','176StkHbz','7dlHAVF','exec','params','262952DYMLSv','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','287631fzjzbd','execSuccess','Returned\x20','string','execError','str','682DDpvIx','execResult','66320RovpKb','234160rlkzYl','450753uoODyv','335eWujpZ','8910496sJlnyy','isArray','length','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'];a209_0x1ab4=function(){return _0x5c5096;};return a209_0x1ab4();}(function(_0x3459f9,_0x25d4c6){const _0x1182e7=a209_0x4979,_0x4e7513=_0x3459f9();while(!![]){try{const _0x3b2956=-parseInt(_0x1182e7(0xa6))/0x1*(-parseInt(_0x1182e7(0xa9))/0x2)+-parseInt(_0x1182e7(0xb5))/0x3+parseInt(_0x1182e7(0xb3))/0x4*(-parseInt(_0x1182e7(0xb6))/0x5)+parseInt(_0x1182e7(0xbd))/0x6+parseInt(_0x1182e7(0xb7))/0x7+parseInt(_0x1182e7(0xa5))/0x8*(parseInt(_0x1182e7(0xab))/0x9)+parseInt(_0x1182e7(0xb4))/0xa*(-parseInt(_0x1182e7(0xb1))/0xb);if(_0x3b2956===_0x25d4c6)break;else _0x4e7513['push'](_0x4e7513['shift']());}catch(_0x354c1f){_0x4e7513['push'](_0x4e7513['shift']());}}}(a209_0x1ab4,0x9d729));function a209_0x4979(_0x35a267,_0x4a1ab2){_0x35a267=_0x35a267-0xa1;const _0x1ab4b0=a209_0x1ab4();let _0x49791c=_0x1ab4b0[_0x35a267];return _0x49791c;}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':a209_0x50cf5e(0xa7),'description':a209_0x50cf5e(0xaa),'risk':a209_0x50cf5e(0xa1),'flags':[SQLCODE_FLAG,{'name':a209_0x50cf5e(0xa8),'type':a209_0x50cf5e(0xae),'description':a209_0x50cf5e(0xba)}],async 'execute'(_0x36e3a2){const _0x58b62b=a209_0x50cf5e,_0x47557b=parseJsonParams(_0x36e3a2['str'](_0x58b62b(0xa8))),_0x59e9fa=Date[_0x58b62b(0xbc)](),_0x1354b4=await executeSql(_0x36e3a2[_0x58b62b(0xbb)],_0x36e3a2[_0x58b62b(0xb0)](_0x58b62b(0xa3)),_0x47557b),_0x9755a2=Date[_0x58b62b(0xbc)]()-_0x59e9fa,_0x560e9f=_0x1354b4?.[_0x58b62b(0xb2)]??_0x1354b4,_0x1bcd80=_0x1354b4?.[_0x58b62b(0xac)]??!![];if(!_0x1bcd80)return{'ok':![],'data':{'error':_0x1354b4?.[_0x58b62b(0xaf)]||_0x58b62b(0xa2),'elapsed':_0x9755a2},'message':_0x58b62b(0xa2)};const _0x17442f=Array[_0x58b62b(0xb8)](_0x560e9f)?_0x560e9f:[];return{'ok':!![],'data':{'rows':_0x17442f,'rowCount':_0x17442f[_0x58b62b(0xb9)],'elapsed':_0x9755a2},'message':_0x58b62b(0xad)+_0x17442f[_0x58b62b(0xb9)]+_0x58b62b(0xa4)+_0x9755a2+'ms'};}};
1
+ const a223_0x2bc08b=a223_0x10ae;(function(_0x5b600e,_0x5decf0){const _0x241a91=a223_0x10ae,_0x5bf4d0=_0x5b600e();while(!![]){try{const _0xe4151d=-parseInt(_0x241a91(0x124))/0x1+-parseInt(_0x241a91(0x11a))/0x2+-parseInt(_0x241a91(0x126))/0x3+-parseInt(_0x241a91(0x127))/0x4+-parseInt(_0x241a91(0x11e))/0x5*(parseInt(_0x241a91(0x120))/0x6)+-parseInt(_0x241a91(0x112))/0x7*(parseInt(_0x241a91(0x116))/0x8)+parseInt(_0x241a91(0x115))/0x9;if(_0xe4151d===_0x5decf0)break;else _0x5bf4d0['push'](_0x5bf4d0['shift']());}catch(_0x869a17){_0x5bf4d0['push'](_0x5bf4d0['shift']());}}}(a223_0x5ab6,0x618b0));import{executeSql}from'../../core/api-client.js';function a223_0x5ab6(){const _0x299799=['string','153520QiLSlJ','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','appCode','execResult','355AMXZLo','now','38196lPyBZV','sql','length','isArray','646831IkUeds','SQL\x20execution\x20failed','412374Csanrr','89836NtmRjX','56OqYyuq','params','str','16624638qNAtXT','112152JqdsNc','read','execSuccess'];a223_0x5ab6=function(){return _0x299799;};return a223_0x5ab6();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a223_0x10ae(_0x2462db,_0x1c51f7){_0x2462db=_0x2462db-0x112;const _0x5ab6d3=a223_0x5ab6();let _0x10aea5=_0x5ab6d3[_0x2462db];return _0x10aea5;}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a223_0x2bc08b(0x121),'command':'exec','description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a223_0x2bc08b(0x117),'flags':[SQLCODE_FLAG,{'name':a223_0x2bc08b(0x113),'type':a223_0x2bc08b(0x119),'description':a223_0x2bc08b(0x11b)}],async 'execute'(_0x51a1ff){const _0x253bd2=a223_0x2bc08b,_0x596808=parseJsonParams(_0x51a1ff[_0x253bd2(0x114)](_0x253bd2(0x113))),_0x4e4c54=Date[_0x253bd2(0x11f)](),_0x2457e4=await executeSql(_0x51a1ff[_0x253bd2(0x11c)],_0x51a1ff[_0x253bd2(0x114)]('sqlcode'),_0x596808),_0x538f79=Date[_0x253bd2(0x11f)]()-_0x4e4c54,_0xfd6448=_0x2457e4?.[_0x253bd2(0x11d)]??_0x2457e4,_0x1cdd73=_0x2457e4?.[_0x253bd2(0x118)]??!![];if(!_0x1cdd73)return{'ok':![],'data':{'error':_0x2457e4?.['execError']||_0x253bd2(0x125),'elapsed':_0x538f79},'message':_0x253bd2(0x125)};const _0x5a61d5=Array[_0x253bd2(0x123)](_0xfd6448)?_0xfd6448:[];return{'ok':!![],'data':{'rows':_0x5a61d5,'rowCount':_0x5a61d5[_0x253bd2(0x122)],'elapsed':_0x538f79},'message':'Returned\x20'+_0x5a61d5[_0x253bd2(0x122)]+'\x20row(s)\x20in\x20'+_0x538f79+'ms'};}};
@@ -1 +1 @@
1
- (function(_0xce280c,_0x43101c){const _0x1f2839=a210_0x90cb,_0x2f1f5a=_0xce280c();while(!![]){try{const _0x5a96d8=parseInt(_0x1f2839(0x170))/0x1*(-parseInt(_0x1f2839(0x174))/0x2)+-parseInt(_0x1f2839(0x16f))/0x3+-parseInt(_0x1f2839(0x16d))/0x4+parseInt(_0x1f2839(0x172))/0x5*(-parseInt(_0x1f2839(0x173))/0x6)+parseInt(_0x1f2839(0x16e))/0x7*(parseInt(_0x1f2839(0x16c))/0x8)+parseInt(_0x1f2839(0x175))/0x9*(-parseInt(_0x1f2839(0x171))/0xa)+parseInt(_0x1f2839(0x176))/0xb;if(_0x5a96d8===_0x43101c)break;else _0x2f1f5a['push'](_0x2f1f5a['shift']());}catch(_0x125c1e){_0x2f1f5a['push'](_0x2f1f5a['shift']());}}}(a210_0x1d8b,0x501cd));import{sqlList}from'../../commands/sql/list.js';function a210_0x1d8b(){const _0xa58486=['30947TTlUvJ','1731168FZkcXD','103YimDRd','50yyoCRl','504805kGYrEv','30HYfSKz','2522oiNQwq','202437UWlPDA','18050109iENAXd','336RHltMs','697004ySCbbP'];a210_0x1d8b=function(){return _0xa58486;};return a210_0x1d8b();}function a210_0x90cb(_0x5612c3,_0x4c71ec){_0x5612c3=_0x5612c3-0x16c;const _0x1d8b6b=a210_0x1d8b();let _0x90cbd8=_0x1d8b6b[_0x5612c3];return _0x90cbd8;}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';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(_0x4d0bed,_0xc22b5b){const _0xc8a2be=a224_0xedcc,_0x163d89=_0x4d0bed();while(!![]){try{const _0x20740f=-parseInt(_0xc8a2be(0x87))/0x1*(-parseInt(_0xc8a2be(0x86))/0x2)+-parseInt(_0xc8a2be(0x7f))/0x3+-parseInt(_0xc8a2be(0x80))/0x4*(-parseInt(_0xc8a2be(0x83))/0x5)+-parseInt(_0xc8a2be(0x88))/0x6+-parseInt(_0xc8a2be(0x85))/0x7+-parseInt(_0xc8a2be(0x84))/0x8*(parseInt(_0xc8a2be(0x82))/0x9)+-parseInt(_0xc8a2be(0x81))/0xa*(-parseInt(_0xc8a2be(0x89))/0xb);if(_0x20740f===_0xc22b5b)break;else _0x163d89['push'](_0x163d89['shift']());}catch(_0x2ee4a0){_0x163d89['push'](_0x163d89['shift']());}}}(a224_0x2a27,0x423b0));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a224_0xedcc(_0x50c95e,_0x5aaf0b){_0x50c95e=_0x50c95e-0x7f;const _0x2a275a=a224_0x2a27();let _0xedccbc=_0x2a275a[_0x50c95e];return _0xedccbc;}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';function a224_0x2a27(){const _0x3136f7=['2433466KzQHsp','2334rsLhuu','73nbfYcN','2761188XUbhxU','22RyaViw','261576DlVlgm','8PtnpRw','4284580EWYMxT','318753NwSSDK','826130yDvruu','24gDwfDC'];a224_0x2a27=function(){return _0x3136f7;};return a224_0x2a27();}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- function a211_0x57e3(_0x4c07c9,_0x707d29){_0x4c07c9=_0x4c07c9-0x1c0;const _0x2b7cf0=a211_0x2b7c();let _0x57e31a=_0x2b7cf0[_0x4c07c9];return _0x57e31a;}function a211_0x2b7c(){const _0x553959=['3sYvmFR','bool','dbId','68190QacANr','paging','3197200ytCYEw','pagesize','3147725mqaQlp','appCode','read','3478744ETqPxR','882587xpJsvr','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','979gfNBTK','tableData','name','number','str','page','boolean','List\x20custom\x20SQL\x20queries','totalCount','\x20SQL\x20queries\x20(total:\x20','sql','sqlcode','string','907118wSRFok','Page\x20number','Filter\x20by\x20SQL\x20name','107210LSYGNh','sqlCode','map','sqlName','469oIcIIW','Page\x20size','18mGaOLb','length','description'];a211_0x2b7c=function(){return _0x553959;};return a211_0x2b7c();}const a211_0x4557f2=a211_0x57e3;(function(_0x2e4cf0,_0x13284b){const _0x513cb2=a211_0x57e3,_0x91d9a5=_0x2e4cf0();while(!![]){try{const _0x1cfe97=-parseInt(_0x513cb2(0x1e5))/0x1+-parseInt(_0x513cb2(0x1ce))/0x2*(-parseInt(_0x513cb2(0x1da))/0x3)+parseInt(_0x513cb2(0x1e4))/0x4+parseInt(_0x513cb2(0x1e1))/0x5+parseInt(_0x513cb2(0x1dd))/0x6*(-parseInt(_0x513cb2(0x1d5))/0x7)+parseInt(_0x513cb2(0x1df))/0x8*(-parseInt(_0x513cb2(0x1d7))/0x9)+parseInt(_0x513cb2(0x1d1))/0xa*(parseInt(_0x513cb2(0x1c1))/0xb);if(_0x1cfe97===_0x13284b)break;else _0x91d9a5['push'](_0x91d9a5['shift']());}catch(_0x5389cf){_0x91d9a5['push'](_0x91d9a5['shift']());}}}(a211_0x2b7c,0x71301));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a211_0x4557f2(0x1cb),'command':'list','description':a211_0x4557f2(0x1c8),'risk':a211_0x4557f2(0x1e3),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a211_0x4557f2(0x1c3),'type':a211_0x4557f2(0x1cd),'description':a211_0x4557f2(0x1d0)},{'name':'page','type':a211_0x4557f2(0x1c4),'description':a211_0x4557f2(0x1cf),'default':0x1},{'name':a211_0x4557f2(0x1e0),'type':a211_0x4557f2(0x1c4),'description':a211_0x4557f2(0x1d6)},{'name':'verbose','type':a211_0x4557f2(0x1c7),'description':a211_0x4557f2(0x1c0)}],async 'execute'(_0x135019){const _0x4fa5be=a211_0x4557f2,_0x425bcc=await listSqlQueries(_0x135019[_0x4fa5be(0x1e2)],{'sqlCode':_0x135019[_0x4fa5be(0x1c5)](_0x4fa5be(0x1cc))||undefined,'sqlName':_0x135019[_0x4fa5be(0x1c5)](_0x4fa5be(0x1c3))||undefined,'currentPage':_0x135019['num'](_0x4fa5be(0x1c6)),'pageSize':_0x135019['num'](_0x4fa5be(0x1e0),0x32)}),_0x45cf0a=_0x135019[_0x4fa5be(0x1db)]('verbose'),_0x38dc5c=_0x425bcc[_0x4fa5be(0x1c2)]??[],_0x5d884a=_0x425bcc[_0x4fa5be(0x1de)]?.[_0x4fa5be(0x1c9)]??_0x38dc5c[_0x4fa5be(0x1d8)];let _0x41b68d;return _0x45cf0a?_0x41b68d=_0x38dc5c:_0x41b68d=await Promise['all'](_0x38dc5c[_0x4fa5be(0x1d3)](async _0x3aa3c4=>{const _0x3b11e0=_0x4fa5be;let _0xb1e639;try{_0xb1e639=_0x3aa3c4['dbId']?await getDbName(_0x135019['appCode'],_0x3aa3c4[_0x3b11e0(0x1dc)]):undefined;}catch{}return{'sqlCode':_0x3aa3c4[_0x3b11e0(0x1d2)],'sqlName':_0x3aa3c4[_0x3b11e0(0x1d4)],'description':_0x3aa3c4[_0x3b11e0(0x1d9)]??'','db':_0xb1e639?_0xb1e639+'\x20('+_0x3aa3c4[_0x3b11e0(0x1dc)]+')':_0x3aa3c4[_0x3b11e0(0x1dc)]??''};})),{'ok':!![],'data':_0x41b68d,'message':_0x38dc5c[_0x4fa5be(0x1d8)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x38dc5c['length']+_0x4fa5be(0x1ca)+_0x5d884a+').'};}};
1
+ const a225_0x52779c=a225_0x48a7;function a225_0x1f21(){const _0x2349ec=['paging','2192KlBKuw','13704400ocgbgs','pagesize','sqlcode','176844AWPkcd','list','appCode','str','name','string','bool','boolean','sqlName','1589535JtuVPo','read','verbose','No\x20custom\x20SQL\x20queries\x20found.','sqlCode','tableData','List\x20custom\x20SQL\x20queries','12327KKQIGO','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','all','sql','Found\x20','number','dbId','map','245OkoOyF','\x20SQL\x20queries\x20(total:\x20','length','1261196ueqmII','Filter\x20by\x20SQL\x20name','1180NrOEWC','totalCount','65418wcOOxV','45063Qytnio','page','description'];a225_0x1f21=function(){return _0x2349ec;};return a225_0x1f21();}(function(_0xa30ce2,_0xe42670){const _0x201b5a=a225_0x48a7,_0x5450b8=_0xa30ce2();while(!![]){try{const _0x57c888=parseInt(_0x201b5a(0x15f))/0x1+-parseInt(_0x201b5a(0x17a))/0x2+parseInt(_0x201b5a(0x16f))/0x3*(parseInt(_0x201b5a(0x17c))/0x4)+-parseInt(_0x201b5a(0x168))/0x5+-parseInt(_0x201b5a(0x17e))/0x6*(-parseInt(_0x201b5a(0x177))/0x7)+parseInt(_0x201b5a(0x15b))/0x8*(-parseInt(_0x201b5a(0x157))/0x9)+parseInt(_0x201b5a(0x15c))/0xa;if(_0x57c888===_0xe42670)break;else _0x5450b8['push'](_0x5450b8['shift']());}catch(_0x211ab3){_0x5450b8['push'](_0x5450b8['shift']());}}}(a225_0x1f21,0xc858d));import{listSqlQueries}from'../../core/api-client.js';function a225_0x48a7(_0x44200a,_0x4190c0){_0x44200a=_0x44200a-0x157;const _0x1f2124=a225_0x1f21();let _0x48a7cf=_0x1f2124[_0x44200a];return _0x48a7cf;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a225_0x52779c(0x172),'command':a225_0x52779c(0x160),'description':a225_0x52779c(0x16e),'risk':a225_0x52779c(0x169),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a225_0x52779c(0x164),'description':a225_0x52779c(0x17b)},{'name':a225_0x52779c(0x158),'type':a225_0x52779c(0x174),'description':'Page\x20number','default':0x1},{'name':a225_0x52779c(0x15d),'type':a225_0x52779c(0x174),'description':'Page\x20size'},{'name':a225_0x52779c(0x16a),'type':a225_0x52779c(0x166),'description':a225_0x52779c(0x170)}],async 'execute'(_0x2a0298){const _0x168947=a225_0x52779c,_0x317c16=await listSqlQueries(_0x2a0298['appCode'],{'sqlCode':_0x2a0298[_0x168947(0x162)](_0x168947(0x15e))||undefined,'sqlName':_0x2a0298[_0x168947(0x162)](_0x168947(0x163))||undefined,'currentPage':_0x2a0298['num']('page'),'pageSize':_0x2a0298['num']('pagesize',0x32)}),_0x2b3973=_0x2a0298[_0x168947(0x165)](_0x168947(0x16a)),_0x457252=_0x317c16[_0x168947(0x16d)]??[],_0x35a841=_0x317c16[_0x168947(0x15a)]?.[_0x168947(0x17d)]??_0x457252[_0x168947(0x179)];let _0x33e110;return _0x2b3973?_0x33e110=_0x457252:_0x33e110=await Promise[_0x168947(0x171)](_0x457252[_0x168947(0x176)](async _0x27097e=>{const _0x632257=_0x168947;let _0x48b466;try{_0x48b466=_0x27097e[_0x632257(0x175)]?await getDbName(_0x2a0298[_0x632257(0x161)],_0x27097e[_0x632257(0x175)]):undefined;}catch{}return{'sqlCode':_0x27097e[_0x632257(0x16c)],'sqlName':_0x27097e[_0x632257(0x167)],'description':_0x27097e[_0x632257(0x159)]??'','db':_0x48b466?_0x48b466+'\x20('+_0x27097e['dbId']+')':_0x27097e[_0x632257(0x175)]??''};})),{'ok':!![],'data':_0x33e110,'message':_0x457252[_0x168947(0x179)]===0x0?_0x168947(0x16b):_0x168947(0x173)+_0x457252[_0x168947(0x179)]+_0x168947(0x178)+_0x35a841+').'};}};
@@ -1 +1 @@
1
- const a212_0x4ecddd=a212_0x44ae;(function(_0x20b2a5,_0x592fe6){const _0x55ac03=a212_0x44ae,_0x140f97=_0x20b2a5();while(!![]){try{const _0x5befc5=-parseInt(_0x55ac03(0x1c5))/0x1+parseInt(_0x55ac03(0x1a8))/0x2*(-parseInt(_0x55ac03(0x197))/0x3)+parseInt(_0x55ac03(0x1b7))/0x4*(parseInt(_0x55ac03(0x1af))/0x5)+parseInt(_0x55ac03(0x1be))/0x6*(parseInt(_0x55ac03(0x1a5))/0x7)+parseInt(_0x55ac03(0x199))/0x8+parseInt(_0x55ac03(0x1a6))/0x9+-parseInt(_0x55ac03(0x1c6))/0xa*(-parseInt(_0x55ac03(0x1b0))/0xb);if(_0x5befc5===_0x592fe6)break;else _0x140f97['push'](_0x140f97['shift']());}catch(_0x5940ab){_0x140f97['push'](_0x140f97['shift']());}}}(a212_0x56e2,0x89d1b));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';function a212_0x56e2(){const _0x1e9ff8=['string','name','bool','11435stkqRX','13376OARLYn','test','str','Pull\x20complete:\x20','Filter\x20by\x20SQL\x20display\x20name','push','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','580utOaHJ','filter','sqlcode','boolean','\x20skipped,\x20','toISOString','pull','1479522DvNDJt','paging','trimStart','mybatisXml','sqlCode','Would\x20pull\x20','catch','812852lGufFW','880BSitqz','replace','length','totalCount','lockFilePath','sql','sqls','POST','local\x20differs\x20from\x20remote','tableData','appCode','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','force','join','\x20failed','3bdjOyx','sqlName','2582304JognXd','lastSync','skipped','utf8','dbId','path','nonInteractive','unchanged','sqlRoot','\x20SQL\x20file(s)\x20into\x20','would_pull','description','7VDFLau','3750003vaESTE','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','94612HfjtyH','cancelled','sqlContent','sqlRootDir'];a212_0x56e2=function(){return _0x1e9ff8;};return a212_0x56e2();}const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x190acd,_0x20fbbc){const _0x54249d=a212_0x44ae,_0x509cbd=[];let _0x3bf5dd=0x1;while(!![]){const _0x3488c6=await listSqlQueries(_0x190acd,{'currentPage':_0x3bf5dd,'pageSize':PAGE_SIZE,'sqlCode':_0x20fbbc[_0x54249d(0x1c2)],'sqlName':_0x20fbbc[_0x54249d(0x198)]}),_0x561d2c=_0x3488c6[_0x54249d(0x1cf)]??[];_0x509cbd[_0x54249d(0x1b5)](..._0x561d2c);if(_0x561d2c[_0x54249d(0x1c8)]===0x0)break;const _0x97d588=_0x3488c6[_0x54249d(0x1bf)]?.[_0x54249d(0x1c9)];if(_0x97d588!=null?_0x509cbd[_0x54249d(0x1c8)]>=_0x97d588:_0x561d2c[_0x54249d(0x1c8)]<PAGE_SIZE)break;_0x3bf5dd++;}return _0x509cbd;}async function ensureSqlContent(_0x187ee3){const _0x32ac69=a212_0x44ae;if(_0x187ee3[_0x32ac69(0x1aa)]!=null&&String(_0x187ee3['sqlContent'])['length']>0x0)return _0x187ee3;return getSqlQueryDetail(_0x187ee3[_0x32ac69(0x1c2)]);}export const sqlPull={'service':a212_0x4ecddd(0x1cb),'command':a212_0x4ecddd(0x1bd),'description':a212_0x4ecddd(0x1a7),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a212_0x4ecddd(0x1ac),'description':a212_0x4ecddd(0x1b4)},{'name':'force','type':a212_0x4ecddd(0x1ba),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x311e00){const _0x136296=a212_0x4ecddd,_0x59cd3a=loadSqlProjectConfig(_0x311e00[_0x136296(0x1d0)]),_0x3fb7bd=await readSqlLockFile(_0x59cd3a[_0x136296(0x1ca)]),{appLock:_0xe02317}=ensureSqlLockScope(_0x3fb7bd??createEmptySqlLock(),_0x59cd3a[_0x136296(0x1d0)],_0x59cd3a[_0x136296(0x1a1)],_0x136296(0x1bd)),_0xcee0ee=await fetchAllSqlQueries(_0x311e00[_0x136296(0x1d0)],{'sqlCode':_0x311e00[_0x136296(0x1b2)](_0x136296(0x1b9))||undefined,'sqlName':_0x311e00['str'](_0x136296(0x1ad))||undefined}),_0x4fa8ca=[];for(const _0x4c0df5 of _0xcee0ee){const _0x4bb91d=await ensureSqlContent(_0x4c0df5),_0x3409ce=ensureRemoteSqlContent(_0x4bb91d),_0x445686=detectModeFromSql(_0x4bb91d),_0x3d82ae=_0x4bb91d[_0x136296(0x19d)]?await getDbName(_0x311e00[_0x136296(0x1d0)],Number(_0x4bb91d[_0x136296(0x19d)]))[_0x136296(0x1c4)](()=>undefined):undefined,_0x50ee20=buildLocalSqlFileContent({'sqlCode':_0x4bb91d[_0x136296(0x1c2)],'sqlName':_0x4bb91d[_0x136296(0x198)],'dbId':_0x4bb91d['dbId']},_0x3409ce,{'dbName':_0x3d82ae,'mode':_0x445686,'syncedAt':new Date()[_0x136296(0x1bc)](),'description':_0x4bb91d[_0x136296(0x1a4)]}),_0x472490=buildSqlLockEntry(_0x4bb91d,_0x3409ce,'',{'dbName':_0x3d82ae}),_0x2e7687=resolveLocalSqlFilePath(_0x59cd3a,_0x4bb91d[_0x136296(0x1c2)],_0x472490);let _0x38a430=_0x136296(0x1a3),_0x3e0b62;if(await fileExists(_0x2e7687)){const _0x44555c=await readFile(_0x2e7687,_0x136296(0x19c));isEquivalentPulledSqlFile(_0x44555c,_0x50ee20,_0x445686)?(_0x38a430=_0x136296(0x19b),_0x3e0b62=_0x136296(0x1a0)):(_0x38a430='conflict',_0x3e0b62=_0x136296(0x1d1));}_0x4fa8ca[_0x136296(0x1b5)]({'sqlCode':_0x4bb91d[_0x136296(0x1c2)],'sqlName':_0x4bb91d['sqlName'],'filePath':_0x2e7687,'status':_0x38a430,'reason':_0x3e0b62});}return{'method':_0x136296(0x1cd),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x311e00[_0x136296(0x1d0)],'sqlCode':_0x311e00[_0x136296(0x1b2)](_0x136296(0x1b9))||null,'sqlName':_0x311e00[_0x136296(0x1b2)](_0x136296(0x1ad))||null,'files':_0x4fa8ca},'description':_0x136296(0x1c3)+_0x4fa8ca[_0x136296(0x1c8)]+_0x136296(0x1a2)+_0x59cd3a[_0x136296(0x1ab)]};},async 'execute'(_0x5a1998){const _0x1d7975=a212_0x4ecddd,_0x3a4f6c=loadSqlProjectConfig(_0x5a1998[_0x1d7975(0x1d0)]),_0x35a612=await readSqlLockFile(_0x3a4f6c[_0x1d7975(0x1ca)]),{lockData:_0x28e050,appLock:_0x53a53e}=ensureSqlLockScope(_0x35a612??createEmptySqlLock(),_0x3a4f6c['appCode'],_0x3a4f6c[_0x1d7975(0x1a1)],'pull'),_0x1a088c=_0x5a1998[_0x1d7975(0x1ae)](_0x1d7975(0x1d2)),_0x37f021=await fetchAllSqlQueries(_0x5a1998[_0x1d7975(0x1d0)],{'sqlCode':_0x5a1998[_0x1d7975(0x1b2)](_0x1d7975(0x1b9))||undefined,'sqlName':_0x5a1998[_0x1d7975(0x1b2)](_0x1d7975(0x1ad))||undefined});if(_0x37f021[_0x1d7975(0x1c8)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x54f0e1=[],_0x4c692f=[];for(const _0x2ecf6a of _0x37f021){try{_0x54f0e1[_0x1d7975(0x1b5)](await ensureSqlContent(_0x2ecf6a));}catch(_0x1c8246){_0x4c692f[_0x1d7975(0x1b5)]({'sqlCode':_0x2ecf6a[_0x1d7975(0x1c2)],'error':_0x1c8246 instanceof Error?_0x1c8246['message']:String(_0x1c8246)});}}if(_0x1a088c&&!_0x5a1998[_0x1d7975(0x19f)]){let _0x21bb85=![];for(const _0x4b2bad of _0x54f0e1){const _0xa06b17=detectModeFromSql(_0x4b2bad),_0x3a64bd=_0x4b2bad[_0x1d7975(0x19d)]?await getDbName(_0x5a1998['appCode'],Number(_0x4b2bad[_0x1d7975(0x19d)]))[_0x1d7975(0x1c4)](()=>undefined):undefined,_0x39d49a=buildLocalSqlFileContent({'sqlCode':_0x4b2bad['sqlCode'],'sqlName':_0x4b2bad[_0x1d7975(0x198)],'dbId':_0x4b2bad[_0x1d7975(0x19d)]},ensureRemoteSqlContent(_0x4b2bad),{'dbName':_0x3a64bd,'mode':_0xa06b17,'syncedAt':new Date()[_0x1d7975(0x1bc)](),'description':_0x4b2bad[_0x1d7975(0x1a4)]}),_0x45c87d=resolveLocalSqlFilePath(_0x3a4f6c,_0x4b2bad[_0x1d7975(0x1c2)],buildSqlLockEntry(_0x4b2bad,ensureRemoteSqlContent(_0x4b2bad),'',{'dbName':_0x3a64bd}));if(await fileExists(_0x45c87d)){const _0x1da928=await readFile(_0x45c87d,_0x1d7975(0x19c));if(!isEquivalentPulledSqlFile(_0x1da928,_0x39d49a,_0xa06b17)){_0x21bb85=!![];break;}}}if(_0x21bb85){const _0x172926=await confirmForceOverwrite(_0x1d7975(0x1b6));if(!_0x172926)throw CliErrors[_0x1d7975(0x1a9)]('Force\x20pull\x20cancelled.');}}const _0x3bcd87=cloneSqlLockData(_0x28e050),_0x96faaf=_0x3bcd87['apps'][_0x3a4f6c['appCode']],_0x1132dd=[],_0x4589a5=[];for(const _0xe25923 of _0x54f0e1){const _0xa173fe=_0x96faaf[_0x1d7975(0x1cc)][_0xe25923[_0x1d7975(0x1c2)]],_0x39612c=ensureRemoteSqlContent(_0xe25923),_0x5b03b3=detectModeFromSql(_0xe25923),_0x3d43a5=_0xe25923[_0x1d7975(0x19d)]?await getDbName(_0x5a1998[_0x1d7975(0x1d0)],Number(_0xe25923[_0x1d7975(0x19d)]))[_0x1d7975(0x1c4)](()=>undefined):undefined,_0x16c9e2=buildLocalSqlFileContent({'sqlCode':_0xe25923[_0x1d7975(0x1c2)],'sqlName':_0xe25923[_0x1d7975(0x198)],'dbId':_0xe25923[_0x1d7975(0x19d)]},_0x39612c,{'dbName':_0x3d43a5,'mode':_0x5b03b3,'syncedAt':new Date()[_0x1d7975(0x1bc)](),'description':_0xe25923['description']}),_0x3bd402=buildSqlLockEntry(_0xe25923,_0x39612c,computeSqlContentHash(_0x16c9e2),{'dbName':_0x3d43a5}),_0x18603a=_0x3bd402[_0x1d7975(0x19e)],_0x2d8e40=join(_0x3a4f6c[_0x1d7975(0x1ab)],_0x18603a);try{if(await fileExists(_0x2d8e40)){const _0x349cee=await readFile(_0x2d8e40,'utf8');if(isEquivalentPulledSqlFile(_0x349cee,_0x16c9e2,_0x5b03b3)){_0x4589a5[_0x1d7975(0x1b5)]({'sqlCode':_0xe25923['sqlCode'],'reason':_0x1d7975(0x1a0)}),_0x96faaf[_0x1d7975(0x1cc)][_0xe25923['sqlCode']]={..._0x3bd402,'hash':computeSqlContentHash(_0x349cee),'path':_0x18603a};continue;}if(!_0x1a088c){_0x4589a5[_0x1d7975(0x1b5)]({'sqlCode':_0xe25923['sqlCode'],'reason':_0x1d7975(0x1ce)});continue;}}const _0x118971=_0xa173fe?.[_0x1d7975(0x19e)]?join(_0x3a4f6c[_0x1d7975(0x1ab)],_0xa173fe[_0x1d7975(0x19e)]):undefined;_0x118971&&_0x118971!==_0x2d8e40&&await fileExists(_0x118971)&&await rm(_0x118971,{'force':!![]}),await ensureParentDirectory(_0x2d8e40),await writeFile(_0x2d8e40,_0x16c9e2,_0x1d7975(0x19c)),_0x96faaf['sqls'][_0xe25923[_0x1d7975(0x1c2)]]={..._0x3bd402,'path':_0x18603a},_0x1132dd[_0x1d7975(0x1b5)]({'sqlCode':_0xe25923[_0x1d7975(0x1c2)],'filePath':_0x2d8e40});}catch(_0x21d0e3){_0x4c692f[_0x1d7975(0x1b5)]({'sqlCode':_0xe25923[_0x1d7975(0x1c2)],'error':_0x21d0e3 instanceof Error?_0x21d0e3['message']:String(_0x21d0e3)});}}return _0x96faaf[_0x1d7975(0x19a)]=new Date()[_0x1d7975(0x1bc)](),await writeSqlLockFile(_0x3a4f6c['lockFilePath'],_0x3bcd87),{'ok':_0x4c692f['length']===0x0,'data':{'pulled':_0x1132dd,'skipped':_0x4589a5,'failed':_0x4c692f},'message':_0x1d7975(0x1b3)+_0x1132dd['length']+'\x20written,\x20'+_0x4589a5['length']+_0x1d7975(0x1bb)+_0x4c692f['length']+_0x1d7975(0x196)};}};function detectModeFromSql(_0x503a8b){const _0x280874=a212_0x4ecddd,_0x580395=ensureRemoteSqlContent(_0x503a8b),_0x4dbb32=stripLocalSqlMetadata(_0x580395,_0x280874(0x1c1))[_0x280874(0x1c0)]();if(/^<(select|insert|update|delete)\b/i[_0x280874(0x1b1)](_0x4dbb32))return _0x280874(0x1c1);return _0x280874(0x1cb);}function isEquivalentPulledSqlFile(_0x1d5f76,_0x5a3df8,_0x96a540){return normalizePullComparableContent(_0x1d5f76,_0x96a540)===normalizePullComparableContent(_0x5a3df8,_0x96a540);}function a212_0x44ae(_0x1192d0,_0xd4bfbe){_0x1192d0=_0x1192d0-0x195;const _0x56e22f=a212_0x56e2();let _0x44ae6e=_0x56e22f[_0x1192d0];return _0x44ae6e;}function normalizePullComparableContent(_0x266a75,_0x8a35d0){const _0x2b077b=a212_0x4ecddd,_0x5151b1=_0x266a75[_0x2b077b(0x1c7)](/\r\n/g,'\x0a')['split']('\x0a'),_0x417e0d=_0x5151b1[_0x2b077b(0x1b8)](_0x1c4fed=>!isSyncedAtMetadataLine(_0x1c4fed,_0x8a35d0));return _0x417e0d[_0x2b077b(0x195)]('\x0a');}function isSyncedAtMetadataLine(_0xb27144,_0x24b4e0){const _0x5ed7c8=a212_0x4ecddd;if(_0x24b4e0===_0x5ed7c8(0x1c1))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x5ed7c8(0x1b1)](_0xb27144);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0xb27144);}
1
+ const a226_0x28bb34=a226_0x1b12;(function(_0x4808e1,_0x25550e){const _0x2b5948=a226_0x1b12,_0xec9362=_0x4808e1();while(!![]){try{const _0x297b18=-parseInt(_0x2b5948(0xa1))/0x1*(-parseInt(_0x2b5948(0xa0))/0x2)+-parseInt(_0x2b5948(0xb8))/0x3*(-parseInt(_0x2b5948(0x8c))/0x4)+parseInt(_0x2b5948(0xba))/0x5*(parseInt(_0x2b5948(0x9a))/0x6)+-parseInt(_0x2b5948(0x98))/0x7+parseInt(_0x2b5948(0xb0))/0x8+-parseInt(_0x2b5948(0x89))/0x9*(-parseInt(_0x2b5948(0x9b))/0xa)+-parseInt(_0x2b5948(0x92))/0xb;if(_0x297b18===_0x25550e)break;else _0xec9362['push'](_0xec9362['shift']());}catch(_0x443a2d){_0xec9362['push'](_0xec9362['shift']());}}}(a226_0x5a47,0x380e6));function a226_0x5a47(){const _0x56d870=['513060STDZMl','force','push','sqlcode','sqlName','2RAWSDN','429062PQytNz','Pull\x20complete:\x20','\x20skipped,\x20','catch','sqlCode','str','POST','cancelled','sqlRootDir','message','paging','boolean','toISOString','tableData','\x20failed','2866760GwBNPK','appCode','would_pull','sql','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','read','pull','name','3iEojXl','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','185sAUZwp','No\x20remote\x20SQL\x20queries\x20matched.','length','replace','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','mybatisXml','path','test','local\x20differs\x20from\x20remote','skipped','utf8','lockFilePath','unchanged','dbId','36qtVqmi','sqlRoot','description','398540mAIJtR','string','lastSync','Would\x20pull\x20','sqls','\x20written,\x20','7742867cWZSCN','Force\x20overwrite\x20local\x20unsynced\x20changes','Filter\x20by\x20SQL\x20display\x20name','Force\x20pull\x20cancelled.','split','nonInteractive','1218826DivkZG','filter','2490VJMiPv'];a226_0x5a47=function(){return _0x56d870;};return a226_0x5a47();}import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0xcd500b,_0x3e689f){const _0x34e048=a226_0x1b12,_0x2b2d72=[];let _0x1c5add=0x1;while(!![]){const _0x1995f0=await listSqlQueries(_0xcd500b,{'currentPage':_0x1c5add,'pageSize':PAGE_SIZE,'sqlCode':_0x3e689f[_0x34e048(0xa5)],'sqlName':_0x3e689f['sqlName']}),_0x3d348a=_0x1995f0[_0x34e048(0xae)]??[];_0x2b2d72[_0x34e048(0x9d)](..._0x3d348a);if(_0x3d348a[_0x34e048(0xbc)]===0x0)break;const _0x3e48a5=_0x1995f0[_0x34e048(0xab)]?.['totalCount'];if(_0x3e48a5!=null?_0x2b2d72[_0x34e048(0xbc)]>=_0x3e48a5:_0x3d348a[_0x34e048(0xbc)]<PAGE_SIZE)break;_0x1c5add++;}return _0x2b2d72;}async function ensureSqlContent(_0x24a13f){const _0x50d6bd=a226_0x1b12;if(_0x24a13f['sqlContent']!=null&&String(_0x24a13f['sqlContent'])[_0x50d6bd(0xbc)]>0x0)return _0x24a13f;return getSqlQueryDetail(_0x24a13f['sqlCode']);}export const sqlPull={'service':a226_0x28bb34(0xb3),'command':'pull','description':a226_0x28bb34(0xb9),'risk':a226_0x28bb34(0xb5),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a226_0x28bb34(0x8d),'description':a226_0x28bb34(0x94)},{'name':a226_0x28bb34(0x9c),'type':a226_0x28bb34(0xac),'description':a226_0x28bb34(0x93)}],async 'dryRun'(_0x5cd8ed){const _0x4a0e10=a226_0x28bb34,_0x445693=loadSqlProjectConfig(_0x5cd8ed[_0x4a0e10(0xb1)]),_0x4edd82=await readSqlLockFile(_0x445693['lockFilePath']),{appLock:_0x25f6ca}=ensureSqlLockScope(_0x4edd82??createEmptySqlLock(),_0x445693[_0x4a0e10(0xb1)],_0x445693[_0x4a0e10(0x8a)],'pull'),_0x1382f9=await fetchAllSqlQueries(_0x5cd8ed['appCode'],{'sqlCode':_0x5cd8ed[_0x4a0e10(0xa6)](_0x4a0e10(0x9e))||undefined,'sqlName':_0x5cd8ed[_0x4a0e10(0xa6)](_0x4a0e10(0xb7))||undefined}),_0x5d9926=[];for(const _0x515c14 of _0x1382f9){const _0x22f9e5=await ensureSqlContent(_0x515c14),_0x5a3281=ensureRemoteSqlContent(_0x22f9e5),_0x20ca55=detectModeFromSql(_0x22f9e5),_0x598f9b=_0x22f9e5[_0x4a0e10(0x88)]?await getDbName(_0x5cd8ed[_0x4a0e10(0xb1)],Number(_0x22f9e5[_0x4a0e10(0x88)]))[_0x4a0e10(0xa4)](()=>undefined):undefined,_0x1515cd=buildLocalSqlFileContent({'sqlCode':_0x22f9e5[_0x4a0e10(0xa5)],'sqlName':_0x22f9e5[_0x4a0e10(0x9f)],'dbId':_0x22f9e5[_0x4a0e10(0x88)]},_0x5a3281,{'dbName':_0x598f9b,'mode':_0x20ca55,'syncedAt':new Date()[_0x4a0e10(0xad)](),'description':_0x22f9e5[_0x4a0e10(0x8b)]}),_0x229a7f=buildSqlLockEntry(_0x22f9e5,_0x5a3281,'',{'dbName':_0x598f9b}),_0x5c1f05=resolveLocalSqlFilePath(_0x445693,_0x22f9e5[_0x4a0e10(0xa5)],_0x229a7f);let _0x21d2ef=_0x4a0e10(0xb2),_0x32a211;if(await fileExists(_0x5c1f05)){const _0x9467c2=await readFile(_0x5c1f05,_0x4a0e10(0x85));isEquivalentPulledSqlFile(_0x9467c2,_0x1515cd,_0x20ca55)?(_0x21d2ef=_0x4a0e10(0x84),_0x32a211=_0x4a0e10(0x87)):(_0x21d2ef='conflict',_0x32a211=_0x4a0e10(0x7f));}_0x5d9926['push']({'sqlCode':_0x22f9e5['sqlCode'],'sqlName':_0x22f9e5[_0x4a0e10(0x9f)],'filePath':_0x5c1f05,'status':_0x21d2ef,'reason':_0x32a211});}return{'method':_0x4a0e10(0xa7),'url':_0x4a0e10(0xb4),'body':{'appCode':_0x5cd8ed[_0x4a0e10(0xb1)],'sqlCode':_0x5cd8ed[_0x4a0e10(0xa6)]('sqlcode')||null,'sqlName':_0x5cd8ed[_0x4a0e10(0xa6)]('name')||null,'files':_0x5d9926},'description':_0x4a0e10(0x8f)+_0x5d9926[_0x4a0e10(0xbc)]+'\x20SQL\x20file(s)\x20into\x20'+_0x445693[_0x4a0e10(0xa9)]};},async 'execute'(_0x35f092){const _0x255a93=a226_0x28bb34,_0x21588b=loadSqlProjectConfig(_0x35f092[_0x255a93(0xb1)]),_0x2eb344=await readSqlLockFile(_0x21588b[_0x255a93(0x86)]),{lockData:_0x2b7d19,appLock:_0x1ae898}=ensureSqlLockScope(_0x2eb344??createEmptySqlLock(),_0x21588b[_0x255a93(0xb1)],_0x21588b['sqlRoot'],_0x255a93(0xb6)),_0x1013bf=_0x35f092['bool']('force'),_0x230900=await fetchAllSqlQueries(_0x35f092[_0x255a93(0xb1)],{'sqlCode':_0x35f092[_0x255a93(0xa6)]('sqlcode')||undefined,'sqlName':_0x35f092[_0x255a93(0xa6)](_0x255a93(0xb7))||undefined});if(_0x230900['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x255a93(0xbb)};const _0x5519dc=[],_0x3bc892=[];for(const _0x2b41d1 of _0x230900){try{_0x5519dc['push'](await ensureSqlContent(_0x2b41d1));}catch(_0xa59fbb){_0x3bc892[_0x255a93(0x9d)]({'sqlCode':_0x2b41d1[_0x255a93(0xa5)],'error':_0xa59fbb instanceof Error?_0xa59fbb[_0x255a93(0xaa)]:String(_0xa59fbb)});}}if(_0x1013bf&&!_0x35f092[_0x255a93(0x97)]){let _0x34e2d9=![];for(const _0x387508 of _0x5519dc){const _0x4ad24d=detectModeFromSql(_0x387508),_0x35fe91=_0x387508[_0x255a93(0x88)]?await getDbName(_0x35f092[_0x255a93(0xb1)],Number(_0x387508[_0x255a93(0x88)]))[_0x255a93(0xa4)](()=>undefined):undefined,_0x5854c0=buildLocalSqlFileContent({'sqlCode':_0x387508[_0x255a93(0xa5)],'sqlName':_0x387508['sqlName'],'dbId':_0x387508['dbId']},ensureRemoteSqlContent(_0x387508),{'dbName':_0x35fe91,'mode':_0x4ad24d,'syncedAt':new Date()[_0x255a93(0xad)](),'description':_0x387508[_0x255a93(0x8b)]}),_0x43a46f=resolveLocalSqlFilePath(_0x21588b,_0x387508['sqlCode'],buildSqlLockEntry(_0x387508,ensureRemoteSqlContent(_0x387508),'',{'dbName':_0x35fe91}));if(await fileExists(_0x43a46f)){const _0x188d49=await readFile(_0x43a46f,_0x255a93(0x85));if(!isEquivalentPulledSqlFile(_0x188d49,_0x5854c0,_0x4ad24d)){_0x34e2d9=!![];break;}}}if(_0x34e2d9){const _0x28a311=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x28a311)throw CliErrors[_0x255a93(0xa8)](_0x255a93(0x95));}}const _0x78d826=cloneSqlLockData(_0x2b7d19),_0x53c04f=_0x78d826['apps'][_0x21588b['appCode']],_0x5259cb=[],_0x291ea6=[];for(const _0xfcd9a9 of _0x5519dc){const _0x702443=_0x53c04f['sqls'][_0xfcd9a9[_0x255a93(0xa5)]],_0x492f1a=ensureRemoteSqlContent(_0xfcd9a9),_0x3e040b=detectModeFromSql(_0xfcd9a9),_0x3b1fa8=_0xfcd9a9[_0x255a93(0x88)]?await getDbName(_0x35f092['appCode'],Number(_0xfcd9a9[_0x255a93(0x88)]))[_0x255a93(0xa4)](()=>undefined):undefined,_0x326d7b=buildLocalSqlFileContent({'sqlCode':_0xfcd9a9[_0x255a93(0xa5)],'sqlName':_0xfcd9a9[_0x255a93(0x9f)],'dbId':_0xfcd9a9[_0x255a93(0x88)]},_0x492f1a,{'dbName':_0x3b1fa8,'mode':_0x3e040b,'syncedAt':new Date()[_0x255a93(0xad)](),'description':_0xfcd9a9[_0x255a93(0x8b)]}),_0x31d269=buildSqlLockEntry(_0xfcd9a9,_0x492f1a,computeSqlContentHash(_0x326d7b),{'dbName':_0x3b1fa8}),_0x2565ec=_0x31d269[_0x255a93(0x81)],_0x1a9aa1=join(_0x21588b[_0x255a93(0xa9)],_0x2565ec);try{if(await fileExists(_0x1a9aa1)){const _0x24e92a=await readFile(_0x1a9aa1,_0x255a93(0x85));if(isEquivalentPulledSqlFile(_0x24e92a,_0x326d7b,_0x3e040b)){_0x291ea6['push']({'sqlCode':_0xfcd9a9['sqlCode'],'reason':_0x255a93(0x87)}),_0x53c04f[_0x255a93(0x90)][_0xfcd9a9['sqlCode']]={..._0x31d269,'hash':computeSqlContentHash(_0x24e92a),'path':_0x2565ec};continue;}if(!_0x1013bf){_0x291ea6[_0x255a93(0x9d)]({'sqlCode':_0xfcd9a9[_0x255a93(0xa5)],'reason':_0x255a93(0x83)});continue;}}const _0x18ad23=_0x702443?.[_0x255a93(0x81)]?join(_0x21588b[_0x255a93(0xa9)],_0x702443[_0x255a93(0x81)]):undefined;_0x18ad23&&_0x18ad23!==_0x1a9aa1&&await fileExists(_0x18ad23)&&await rm(_0x18ad23,{'force':!![]}),await ensureParentDirectory(_0x1a9aa1),await writeFile(_0x1a9aa1,_0x326d7b,_0x255a93(0x85)),_0x53c04f['sqls'][_0xfcd9a9[_0x255a93(0xa5)]]={..._0x31d269,'path':_0x2565ec},_0x5259cb[_0x255a93(0x9d)]({'sqlCode':_0xfcd9a9[_0x255a93(0xa5)],'filePath':_0x1a9aa1});}catch(_0x253792){_0x3bc892['push']({'sqlCode':_0xfcd9a9[_0x255a93(0xa5)],'error':_0x253792 instanceof Error?_0x253792[_0x255a93(0xaa)]:String(_0x253792)});}}return _0x53c04f[_0x255a93(0x8e)]=new Date()[_0x255a93(0xad)](),await writeSqlLockFile(_0x21588b[_0x255a93(0x86)],_0x78d826),{'ok':_0x3bc892[_0x255a93(0xbc)]===0x0,'data':{'pulled':_0x5259cb,'skipped':_0x291ea6,'failed':_0x3bc892},'message':_0x255a93(0xa2)+_0x5259cb[_0x255a93(0xbc)]+_0x255a93(0x91)+_0x291ea6['length']+_0x255a93(0xa3)+_0x3bc892[_0x255a93(0xbc)]+_0x255a93(0xaf)};}};function detectModeFromSql(_0x327746){const _0x51d0b9=a226_0x28bb34,_0x121efd=ensureRemoteSqlContent(_0x327746),_0x5d5dc6=stripLocalSqlMetadata(_0x121efd,_0x51d0b9(0x80))['trimStart']();if(/^<(select|insert|update|delete)\b/i['test'](_0x5d5dc6))return _0x51d0b9(0x80);return _0x51d0b9(0xb3);}function a226_0x1b12(_0x1b181c,_0x1ce365){_0x1b181c=_0x1b181c-0x7e;const _0x5a47a7=a226_0x5a47();let _0x1b121a=_0x5a47a7[_0x1b181c];return _0x1b121a;}function isEquivalentPulledSqlFile(_0xdeaa6d,_0x5167ea,_0x5dced7){return normalizePullComparableContent(_0xdeaa6d,_0x5dced7)===normalizePullComparableContent(_0x5167ea,_0x5dced7);}function normalizePullComparableContent(_0x347559,_0x2caa5e){const _0x2ae761=a226_0x28bb34,_0x7fe1c8=_0x347559[_0x2ae761(0x7e)](/\r\n/g,'\x0a')[_0x2ae761(0x96)]('\x0a'),_0x44bac1=_0x7fe1c8[_0x2ae761(0x99)](_0x44a112=>!isSyncedAtMetadataLine(_0x44a112,_0x2caa5e));return _0x44bac1['join']('\x0a');}function isSyncedAtMetadataLine(_0x5ca201,_0x4f4836){const _0x1abe96=a226_0x28bb34;if(_0x4f4836==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x1abe96(0x82)](_0x5ca201);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x1abe96(0x82)](_0x5ca201);}
@@ -1 +1 @@
1
- const a213_0x1718bb=a213_0x4948;(function(_0x4fac46,_0x511c42){const _0x15b8a9=a213_0x4948,_0x98892e=_0x4fac46();while(!![]){try{const _0x5ac995=-parseInt(_0x15b8a9(0xdd))/0x1*(parseInt(_0x15b8a9(0xcf))/0x2)+parseInt(_0x15b8a9(0xb5))/0x3*(-parseInt(_0x15b8a9(0xac))/0x4)+-parseInt(_0x15b8a9(0xdc))/0x5*(-parseInt(_0x15b8a9(0xce))/0x6)+-parseInt(_0x15b8a9(0xb2))/0x7*(parseInt(_0x15b8a9(0xeb))/0x8)+parseInt(_0x15b8a9(0xe8))/0x9+parseInt(_0x15b8a9(0xd1))/0xa*(parseInt(_0x15b8a9(0xd2))/0xb)+parseInt(_0x15b8a9(0xc3))/0xc*(parseInt(_0x15b8a9(0xae))/0xd);if(_0x5ac995===_0x511c42)break;else _0x98892e['push'](_0x98892e['shift']());}catch(_0x22296c){_0x98892e['push'](_0x98892e['shift']());}}}(a213_0x1fdb,0x482a6));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 a213_0x4948(_0x59642c,_0x564a5a){_0x59642c=_0x59642c-0xab;const _0x1fdbc4=a213_0x1fdb();let _0x4948c7=_0x1fdbc4[_0x59642c];return _0x4948c7;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x86396,_0x161b8f,_0x2da1df){const _0x287cac=a213_0x4948,_0x5a06e4=await scanLocalSqlQueries(_0x86396),_0x36c084=new Map();for(const _0x195073 of _0x5a06e4){if(_0x2da1df&&_0x195073[_0x287cac(0xb7)]!==_0x2da1df)continue;const _0xe244e7=_0x36c084[_0x287cac(0xe7)](_0x195073[_0x287cac(0xb7)])??[];_0xe244e7[_0x287cac(0xd9)](_0x195073),_0x36c084[_0x287cac(0xd5)](_0x195073[_0x287cac(0xb7)],_0xe244e7);}if(_0x2da1df&&!_0x36c084[_0x287cac(0xe3)](_0x2da1df))throw CliErrors[_0x287cac(0xc0)](_0x287cac(0xc6)+_0x2da1df);const _0x1d6af4=[];for(const [_0x4a45e8,_0x478192]of _0x36c084[_0x287cac(0xb1)]()){if(_0x478192[_0x287cac(0xbf)]===0x1){_0x1d6af4[_0x287cac(0xd9)](_0x478192[0x0]);continue;}const _0x27bbe1=_0x161b8f[_0x287cac(0xd8)][_0x4a45e8],_0x420e21=_0x27bbe1?.[_0x287cac(0xe0)],_0x14bb19=_0x420e21?_0x478192[_0x287cac(0xc4)](_0xf022b6=>_0xf022b6[_0x287cac(0xba)]!==_0x420e21):_0x478192;if(_0x27bbe1&&_0x14bb19[_0x287cac(0xbf)]===0x1){_0x1d6af4[_0x287cac(0xd9)](_0x14bb19[0x0]);continue;}throw CliErrors[_0x287cac(0xc0)](_0x287cac(0xcd)+_0x4a45e8+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x1d6af4;}export const sqlPush={'service':a213_0x1718bb(0xd3),'command':a213_0x1718bb(0xd9),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a213_0x1718bb(0xe5),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a213_0x1718bb(0xc7),'type':'boolean','description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x5bf561){const _0x137d17=a213_0x1718bb,_0x13da32=loadSqlProjectConfig(_0x5bf561[_0x137d17(0xd4)]),_0x57cc3a=await readSqlLockFile(_0x13da32['lockFilePath']),{appLock:_0x228947}=ensureSqlLockScope(_0x57cc3a??createEmptySqlLock(),_0x5bf561[_0x137d17(0xd4)],_0x13da32[_0x137d17(0xcb)],_0x137d17(0xd9)),_0x435fa8=await getTargetSqlQueries(_0x13da32,_0x228947,_0x5bf561[_0x137d17(0xee)](_0x137d17(0xb6))||undefined),_0x40ce94=[];for(const _0x25a718 of _0x435fa8){const _0x26de85=await computeSqlFileHash(_0x25a718[_0x137d17(0xec)]),_0x42e991=_0x228947['sqls'][_0x25a718[_0x137d17(0xb7)]],_0x37ea75=!!_0x42e991&&(_0x42e991[_0x137d17(0xe0)]!==_0x25a718['relativePath']||!!_0x25a718['sqlName']&&_0x42e991[_0x137d17(0xe4)]!==_0x25a718['sqlName']);if(!_0x5bf561[_0x137d17(0xd6)]('force')&&_0x42e991&&_0x42e991['hash']===_0x26de85&&!_0x37ea75)continue;_0x40ce94[_0x137d17(0xd9)](_0x25a718[_0x137d17(0xb7)]);}return{'method':'POST','url':_0x137d17(0xc5),'body':{'sqlCodes':_0x40ce94,'appCode':_0x5bf561[_0x137d17(0xd4)]},'description':_0x137d17(0xe1)+_0x40ce94['length']+_0x137d17(0xc2)};},async 'execute'(_0x3b5b1e){const _0xe81cdc=a213_0x1718bb,_0x3451e7=loadSqlProjectConfig(_0x3b5b1e[_0xe81cdc(0xd4)]),_0x24f8ac=await readSqlLockFile(_0x3451e7[_0xe81cdc(0xca)]),{lockData:_0x242a64,appLock:_0x9cbb60}=ensureSqlLockScope(_0x24f8ac??createEmptySqlLock(),_0x3b5b1e['appCode'],_0x3451e7[_0xe81cdc(0xcb)],_0xe81cdc(0xd9)),_0x3f2387=await getTargetSqlQueries(_0x3451e7,_0x9cbb60,_0x3b5b1e[_0xe81cdc(0xee)](_0xe81cdc(0xb6))||undefined);if(_0x3f2387[_0xe81cdc(0xbf)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x3aa878=[],_0x134492=[],_0x4dce2f=[];for(const _0x5709a0 of _0x3f2387){const _0x40f053=_0x9cbb60[_0xe81cdc(0xd8)][_0x5709a0['sqlCode']];if(!_0x40f053){_0x4dce2f[_0xe81cdc(0xd9)]({'sqlCode':_0x5709a0[_0xe81cdc(0xb7)],'error':_0xe81cdc(0xbd)});continue;}try{const _0x425dc9=await computeSqlFileHash(_0x5709a0[_0xe81cdc(0xec)]),_0x181ce8=_0x40f053['path']!==_0x5709a0[_0xe81cdc(0xba)]||!!_0x5709a0[_0xe81cdc(0xe4)]&&_0x40f053[_0xe81cdc(0xe4)]!==_0x5709a0[_0xe81cdc(0xe4)];if(!_0x3b5b1e[_0xe81cdc(0xd6)](_0xe81cdc(0xc7))&&_0x40f053[_0xe81cdc(0xaf)]===_0x425dc9&&!_0x181ce8){_0x134492[_0xe81cdc(0xd9)]({'sqlCode':_0x5709a0[_0xe81cdc(0xb7)],'reason':_0xe81cdc(0xbe)});continue;}if(_0x40f053['version']==null){_0x4dce2f[_0xe81cdc(0xd9)]({'sqlCode':_0x5709a0[_0xe81cdc(0xb7)],'error':_0xe81cdc(0xd7)});continue;}const _0x5a706b=await readFile(_0x5709a0[_0xe81cdc(0xec)],'utf8'),_0x11cb0c=stripLocalSqlMetadata(_0x5a706b,_0x5709a0['mode']),_0x279fd8=_0x5709a0['sqlName']||_0x40f053[_0xe81cdc(0xe4)],_0x58c849=await resolveTargetDbBinding(_0x3b5b1e[_0xe81cdc(0xd4)],_0x5709a0,_0x40f053),_0x20cc13=await updateSqlQuery({'id':_0x40f053[_0xe81cdc(0xdf)],'appCode':_0x3b5b1e[_0xe81cdc(0xd4)],'sqlCode':_0x5709a0[_0xe81cdc(0xb7)],'sqlName':_0x279fd8,'dbId':_0x58c849['dbId'],'version':_0x40f053[_0xe81cdc(0xb9)],'sqlContent':_0x11cb0c,'sqlConfig':_0x40f053['sqlConfig']??undefined}),_0x1decc4=_0x20cc13[_0xe81cdc(0xbb)]?await getDbName(_0x3b5b1e[_0xe81cdc(0xd4)],Number(_0x20cc13[_0xe81cdc(0xbb)]))[_0xe81cdc(0xb3)](()=>_0x58c849[_0xe81cdc(0xe2)]):_0x58c849[_0xe81cdc(0xe2)];_0x9cbb60[_0xe81cdc(0xd8)][_0x5709a0['sqlCode']]={...buildSqlLockEntry(_0x20cc13,_0x11cb0c,_0x425dc9,{'dbName':_0x1decc4}),'path':_0x5709a0[_0xe81cdc(0xba)],'mode':_0x40f053[_0xe81cdc(0xe6)]},await archivePreviousSqlFileIfNeeded(_0x3451e7,_0x40f053[_0xe81cdc(0xe0)],_0x5709a0[_0xe81cdc(0xba)]),_0x3aa878[_0xe81cdc(0xd9)]({'sqlCode':_0x5709a0['sqlCode'],'remoteId':_0x40f053[_0xe81cdc(0xdf)]});}catch(_0x53270a){_0x4dce2f[_0xe81cdc(0xd9)]({'sqlCode':_0x5709a0[_0xe81cdc(0xb7)],'error':_0x53270a instanceof Error?_0x53270a['message']:String(_0x53270a)});}}_0x9cbb60[_0xe81cdc(0xb4)]=new Date()[_0xe81cdc(0xda)](),await writeSqlLockFile(_0x3451e7[_0xe81cdc(0xca)],_0x242a64);const _0x5e1bd1=_0x4dce2f[_0xe81cdc(0xbf)]===0x0;return{'ok':_0x5e1bd1,'data':{'pushed':_0x3aa878,'skipped':_0x134492,'failed':_0x4dce2f},'message':_0xe81cdc(0xc9)+_0x3aa878[_0xe81cdc(0xbf)]+_0xe81cdc(0xed)+_0x134492[_0xe81cdc(0xbf)]+_0xe81cdc(0xcc)+_0x4dce2f[_0xe81cdc(0xbf)]+_0xe81cdc(0xc1)};}};async function archivePreviousSqlFileIfNeeded(_0x1ccd96,_0xed159a,_0x2a481a){const _0x18f7f0=a213_0x1718bb;if(!_0xed159a||_0xed159a===_0x2a481a)return;const _0x1f8c6a=join(_0x1ccd96[_0x18f7f0(0xad)],_0xed159a);if(!await fileExists(_0x1f8c6a))return;const _0x24521c=await moveToTrash(_0x1ccd96[_0x18f7f0(0xdb)],_0x1ccd96[_0x18f7f0(0xe9)],_0x1f8c6a);await cleanupEmptyDirectories(dirname(_0x1f8c6a),_0x1ccd96[_0x18f7f0(0xad)]),void _0x24521c;}function a213_0x1fdb(){const _0x801744=['version','relativePath','dbId','No\x20database\x20matches\x20local\x20directory\x20\x22','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','unchanged','length','validation','\x20failed','\x20SQL\x20file(s)','24evAkcx','filter','/smartapi/custom/updateUserCustomSql','Local\x20SQL\x20not\x20found:\x20','force','\x22\x20for\x20sqlCode\x20','Push\x20complete:\x20','lockFilePath','sqlRoot','\x20skipped,\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','2211504qjqHxt','2jYygBw','isFinite','970mspKIy','62414QcGxUl','sql','appCode','set','bool','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sqls','push','toISOString','projectRoot','5PhAZUp','361770rdLwrU','replace','remoteId','path','Would\x20push\x20','dbName','has','sqlName','write','mode','get','2857950NOwvPU','trashDir','startsWith','8HjtaHK','filePath','\x20pushed,\x20','str','Local\x20directory\x20\x22','2107828CfMhcx','sqlRootDir','491543AibYiH','hash','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','entries','894719xeyzjW','catch','lastSync','3ZyUJme','sqlcode','sqlCode','exec'];a213_0x1fdb=function(){return _0x801744;};return a213_0x1fdb();}async function moveToTrash(_0x4323b0,_0x458e57,_0x445d5a){const _0x5ac8f9=a213_0x1718bb,_0x4cf50b=new Date()[_0x5ac8f9(0xda)]()[_0x5ac8f9(0xde)](/[:.]/g,'-'),_0x1f0cd1=relative(_0x4323b0,_0x445d5a),_0x5c75e7=join(_0x458e57,_0x4cf50b,_0x1f0cd1);return await mkdir(dirname(_0x5c75e7),{'recursive':!![]}),await rename(_0x445d5a,_0x5c75e7),_0x5c75e7;}async function cleanupEmptyDirectories(_0x3b3e46,_0x5957ee){const _0x293071=a213_0x1718bb;let _0x26bc3d=resolve(_0x3b3e46);const _0x3ead71=resolve(_0x5957ee);while(_0x26bc3d[_0x293071(0xea)](''+_0x3ead71+sep)||_0x26bc3d===_0x3ead71){if(_0x26bc3d===_0x3ead71)return;try{const _0x3edb77=await readdir(_0x26bc3d);if(_0x3edb77[_0x293071(0xbf)]>0x0)return;await rmdir(_0x26bc3d);}catch{return;}_0x26bc3d=dirname(_0x26bc3d);}}async function resolveTargetDbBinding(_0x28a99d,_0x53c9b2,_0x266adc){const _0x306c7a=a213_0x1718bb,_0x4d3e99=_0x53c9b2['dbDirectory'];if(!_0x4d3e99)return{'dbId':_0x266adc[_0x306c7a(0xbb)],'dbName':_0x266adc[_0x306c7a(0xe2)]};const _0x4de44c=buildDbDirectoryName(_0x266adc[_0x306c7a(0xe2)],_0x266adc[_0x306c7a(0xbb)]);if(_0x4d3e99===_0x4de44c)return{'dbId':_0x266adc[_0x306c7a(0xbb)],'dbName':_0x266adc[_0x306c7a(0xe2)]};const _0x2c4ee8=parseExplicitDbDirectory(_0x4d3e99);if(_0x2c4ee8!=null)return{'dbId':_0x2c4ee8,'dbName':await getDbName(_0x28a99d,_0x2c4ee8)[_0x306c7a(0xb3)](()=>undefined)};const _0x5a424e=await listDatabases(_0x28a99d),_0x5634b0=_0x5a424e[_0x306c7a(0xc4)](_0x54dea2=>buildDbDirectoryName(_0x54dea2[_0x306c7a(0xe2)],_0x54dea2[_0x306c7a(0xbb)])===_0x4d3e99);if(_0x5634b0[_0x306c7a(0xbf)]===0x1)return{'dbId':_0x5634b0[0x0][_0x306c7a(0xbb)],'dbName':_0x5634b0[0x0]['dbName']};if(_0x5634b0[_0x306c7a(0xbf)]===0x0)throw CliErrors[_0x306c7a(0xc0)](_0x306c7a(0xbc)+_0x4d3e99+_0x306c7a(0xc8)+_0x53c9b2[_0x306c7a(0xb7)]+'.');const _0x2ce4d1=_0x5634b0['map'](_0x3a4c21=>_0x3a4c21[_0x306c7a(0xe2)]+'\x20('+_0x3a4c21[_0x306c7a(0xbb)]+')')['join'](',\x20');throw CliErrors[_0x306c7a(0xc0)](_0x306c7a(0xab)+_0x4d3e99+_0x306c7a(0xb0)+_0x53c9b2[_0x306c7a(0xb7)]+':\x20'+_0x2ce4d1);}function parseExplicitDbDirectory(_0x382070){const _0x5eae42=a213_0x1718bb,_0x2ffe15=/^db-(\d+)$/[_0x5eae42(0xb8)](_0x382070);if(!_0x2ffe15)return null;const _0x20df91=Number(_0x2ffe15[0x1]);return Number[_0x5eae42(0xd0)](_0x20df91)&&_0x20df91>0x0?_0x20df91:null;}
1
+ const a227_0x596368=a227_0x3094;(function(_0x3d0703,_0x3aa844){const _0x45e595=a227_0x3094,_0x942296=_0x3d0703();while(!![]){try{const _0xf8370b=parseInt(_0x45e595(0x1f0))/0x1*(parseInt(_0x45e595(0x1e1))/0x2)+parseInt(_0x45e595(0x1e3))/0x3+-parseInt(_0x45e595(0x1dd))/0x4+parseInt(_0x45e595(0x1d9))/0x5*(-parseInt(_0x45e595(0x1d7))/0x6)+-parseInt(_0x45e595(0x1f2))/0x7*(-parseInt(_0x45e595(0x1de))/0x8)+parseInt(_0x45e595(0x1d2))/0x9*(-parseInt(_0x45e595(0x1f5))/0xa)+-parseInt(_0x45e595(0x1dc))/0xb;if(_0xf8370b===_0x3aa844)break;else _0x942296['push'](_0x942296['shift']());}catch(_0x9b6be9){_0x942296['push'](_0x942296['shift']());}}}(a227_0x1e86,0xdc891));function a227_0x3094(_0xde04f4,_0x156c05){_0xde04f4=_0xde04f4-0x1c8;const _0x1e862c=a227_0x1e86();let _0x309464=_0x1e862c[_0xde04f4];return _0x309464;}import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x437de4,_0x54245e,_0x1fdca5){const _0x2c4399=a227_0x3094,_0x866b31=await scanLocalSqlQueries(_0x437de4),_0x2b3f23=new Map();for(const _0x4e9b09 of _0x866b31){if(_0x1fdca5&&_0x4e9b09[_0x2c4399(0x1e2)]!==_0x1fdca5)continue;const _0x12888a=_0x2b3f23['get'](_0x4e9b09['sqlCode'])??[];_0x12888a[_0x2c4399(0x1e5)](_0x4e9b09),_0x2b3f23['set'](_0x4e9b09[_0x2c4399(0x1e2)],_0x12888a);}if(_0x1fdca5&&!_0x2b3f23['has'](_0x1fdca5))throw CliErrors['validation'](_0x2c4399(0x1e6)+_0x1fdca5);const _0x49e369=[];for(const [_0x583d33,_0x19beb0]of _0x2b3f23[_0x2c4399(0x1ff)]()){if(_0x19beb0[_0x2c4399(0x1db)]===0x1){_0x49e369[_0x2c4399(0x1e5)](_0x19beb0[0x0]);continue;}const _0x163d56=_0x54245e[_0x2c4399(0x1d5)][_0x583d33],_0x993040=_0x163d56?.[_0x2c4399(0x1eb)],_0x5cc56f=_0x993040?_0x19beb0['filter'](_0xd4e863=>_0xd4e863[_0x2c4399(0x1f4)]!==_0x993040):_0x19beb0;if(_0x163d56&&_0x5cc56f['length']===0x1){_0x49e369[_0x2c4399(0x1e5)](_0x5cc56f[0x0]);continue;}throw CliErrors[_0x2c4399(0x1f7)](_0x2c4399(0x1cb)+_0x583d33+_0x2c4399(0x1fc));}return _0x49e369;}export const sqlPush={'service':a227_0x596368(0x1e7),'command':a227_0x596368(0x1e5),'description':a227_0x596368(0x1cf),'risk':a227_0x596368(0x1cd),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a227_0x596368(0x1ce),'type':'boolean','description':a227_0x596368(0x1e8)}],async 'dryRun'(_0x512745){const _0x15e241=a227_0x596368,_0x24810e=loadSqlProjectConfig(_0x512745[_0x15e241(0x1d0)]),_0x409587=await readSqlLockFile(_0x24810e[_0x15e241(0x1df)]),{appLock:_0x11af14}=ensureSqlLockScope(_0x409587??createEmptySqlLock(),_0x512745[_0x15e241(0x1d0)],_0x24810e[_0x15e241(0x201)],_0x15e241(0x1e5)),_0x117482=await getTargetSqlQueries(_0x24810e,_0x11af14,_0x512745['str'](_0x15e241(0x1ee))||undefined),_0x54b4cc=[];for(const _0x50ad95 of _0x117482){const _0x3c5597=await computeSqlFileHash(_0x50ad95[_0x15e241(0x1d3)]),_0x46078e=_0x11af14[_0x15e241(0x1d5)][_0x50ad95['sqlCode']],_0x2e5741=!!_0x46078e&&(_0x46078e[_0x15e241(0x1eb)]!==_0x50ad95[_0x15e241(0x1f4)]||!!_0x50ad95[_0x15e241(0x1c9)]&&_0x46078e[_0x15e241(0x1c9)]!==_0x50ad95[_0x15e241(0x1c9)]);if(!_0x512745[_0x15e241(0x1ec)](_0x15e241(0x1ce))&&_0x46078e&&_0x46078e['hash']===_0x3c5597&&!_0x2e5741)continue;_0x54b4cc[_0x15e241(0x1e5)](_0x50ad95[_0x15e241(0x1e2)]);}return{'method':'POST','url':_0x15e241(0x1f3),'body':{'sqlCodes':_0x54b4cc,'appCode':_0x512745[_0x15e241(0x1d0)]},'description':'Would\x20push\x20'+_0x54b4cc[_0x15e241(0x1db)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x3820d1){const _0x437228=a227_0x596368,_0x12e85f=loadSqlProjectConfig(_0x3820d1['appCode']),_0x5c2b48=await readSqlLockFile(_0x12e85f[_0x437228(0x1df)]),{lockData:_0x2a9210,appLock:_0x5b6b83}=ensureSqlLockScope(_0x5c2b48??createEmptySqlLock(),_0x3820d1[_0x437228(0x1d0)],_0x12e85f['sqlRoot'],_0x437228(0x1e5)),_0x414510=await getTargetSqlQueries(_0x12e85f,_0x5b6b83,_0x3820d1[_0x437228(0x1cc)]('sqlcode')||undefined);if(_0x414510[_0x437228(0x1db)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x217cf3=[],_0x24300c=[],_0x1ecfe2=[];for(const _0xdf2e9f of _0x414510){const _0x3acfae=_0x5b6b83['sqls'][_0xdf2e9f[_0x437228(0x1e2)]];if(!_0x3acfae){_0x1ecfe2[_0x437228(0x1e5)]({'sqlCode':_0xdf2e9f[_0x437228(0x1e2)],'error':_0x437228(0x1d4)});continue;}try{const _0x3340e9=await computeSqlFileHash(_0xdf2e9f[_0x437228(0x1d3)]),_0x12bdc=_0x3acfae[_0x437228(0x1eb)]!==_0xdf2e9f['relativePath']||!!_0xdf2e9f['sqlName']&&_0x3acfae[_0x437228(0x1c9)]!==_0xdf2e9f['sqlName'];if(!_0x3820d1[_0x437228(0x1ec)]('force')&&_0x3acfae[_0x437228(0x1fd)]===_0x3340e9&&!_0x12bdc){_0x24300c[_0x437228(0x1e5)]({'sqlCode':_0xdf2e9f[_0x437228(0x1e2)],'reason':_0x437228(0x1fb)});continue;}if(_0x3acfae['version']==null){_0x1ecfe2[_0x437228(0x1e5)]({'sqlCode':_0xdf2e9f[_0x437228(0x1e2)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x2611c5=await readFile(_0xdf2e9f['filePath'],_0x437228(0x203)),_0x5dc164=stripLocalSqlMetadata(_0x2611c5,_0xdf2e9f[_0x437228(0x1e0)]),_0x3eb98b=_0xdf2e9f[_0x437228(0x1c9)]||_0x3acfae[_0x437228(0x1c9)],_0x3cb177=await resolveTargetDbBinding(_0x3820d1[_0x437228(0x1d0)],_0xdf2e9f,_0x3acfae),_0x5a6679=await updateSqlQuery({'id':_0x3acfae[_0x437228(0x1d8)],'appCode':_0x3820d1[_0x437228(0x1d0)],'sqlCode':_0xdf2e9f['sqlCode'],'sqlName':_0x3eb98b,'dbId':_0x3cb177['dbId'],'version':_0x3acfae['version'],'sqlContent':_0x5dc164,'sqlConfig':_0x3acfae['sqlConfig']??undefined}),_0x153e0f=_0x5a6679[_0x437228(0x1e9)]?await getDbName(_0x3820d1[_0x437228(0x1d0)],Number(_0x5a6679[_0x437228(0x1e9)]))[_0x437228(0x1da)](()=>_0x3cb177[_0x437228(0x1ef)]):_0x3cb177[_0x437228(0x1ef)];_0x5b6b83['sqls'][_0xdf2e9f[_0x437228(0x1e2)]]={...buildSqlLockEntry(_0x5a6679,_0x5dc164,_0x3340e9,{'dbName':_0x153e0f}),'path':_0xdf2e9f[_0x437228(0x1f4)],'mode':_0x3acfae[_0x437228(0x1e0)]},await archivePreviousSqlFileIfNeeded(_0x12e85f,_0x3acfae['path'],_0xdf2e9f[_0x437228(0x1f4)]),_0x217cf3[_0x437228(0x1e5)]({'sqlCode':_0xdf2e9f[_0x437228(0x1e2)],'remoteId':_0x3acfae[_0x437228(0x1d8)]});}catch(_0x2dfbd0){_0x1ecfe2['push']({'sqlCode':_0xdf2e9f['sqlCode'],'error':_0x2dfbd0 instanceof Error?_0x2dfbd0[_0x437228(0x1f6)]:String(_0x2dfbd0)});}}_0x5b6b83['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x12e85f[_0x437228(0x1df)],_0x2a9210);const _0x372c41=_0x1ecfe2['length']===0x0;return{'ok':_0x372c41,'data':{'pushed':_0x217cf3,'skipped':_0x24300c,'failed':_0x1ecfe2},'message':_0x437228(0x1ed)+_0x217cf3[_0x437228(0x1db)]+_0x437228(0x1f8)+_0x24300c[_0x437228(0x1db)]+'\x20skipped,\x20'+_0x1ecfe2['length']+_0x437228(0x1ea)};}};async function archivePreviousSqlFileIfNeeded(_0x105727,_0x553184,_0x2176af){const _0x40766e=a227_0x596368;if(!_0x553184||_0x553184===_0x2176af)return;const _0x18431f=join(_0x105727[_0x40766e(0x1f9)],_0x553184);if(!await fileExists(_0x18431f))return;const _0x3b3518=await moveToTrash(_0x105727['projectRoot'],_0x105727['trashDir'],_0x18431f);await cleanupEmptyDirectories(dirname(_0x18431f),_0x105727[_0x40766e(0x1f9)]),void _0x3b3518;}async function moveToTrash(_0x4a89a9,_0x1a22f2,_0x4be8bb){const _0x1bc4bc=a227_0x596368,_0x351278=new Date()[_0x1bc4bc(0x1fe)]()[_0x1bc4bc(0x1d1)](/[:.]/g,'-'),_0x2480b0=relative(_0x4a89a9,_0x4be8bb),_0x458f22=join(_0x1a22f2,_0x351278,_0x2480b0);return await mkdir(dirname(_0x458f22),{'recursive':!![]}),await rename(_0x4be8bb,_0x458f22),_0x458f22;}function a227_0x1e86(){const _0x211839=['sqlRootDir','\x22\x20for\x20sqlCode\x20','unchanged','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','hash','toISOString','entries','Local\x20directory\x20\x22','sqlRoot','join','utf8','exec','sqlName','dbDirectory','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','str','write','force','Push\x20local\x20SQL\x20files\x20to\x20remote','appCode','replace','18nMlyQH','filePath','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','sqls','filter','1716wcYhOe','remoteId','8210ITCQFh','catch','length','13982122aYmrfA','2662500AjjUln','6808scgeyu','lockFilePath','mode','82670KTrOaQ','sqlCode','4610985yEVtBi','isFinite','push','Local\x20SQL\x20not\x20found:\x20','sql','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','dbId','\x20failed','path','bool','Push\x20complete:\x20','sqlcode','dbName','24SZiZBY','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','9247tRAmEg','/smartapi/custom/updateUserCustomSql','relativePath','1717770BjrVCs','message','validation','\x20pushed,\x20'];a227_0x1e86=function(){return _0x211839;};return a227_0x1e86();}async function cleanupEmptyDirectories(_0x16739d,_0x43bb7e){let _0x2d150d=resolve(_0x16739d);const _0x5c5852=resolve(_0x43bb7e);while(_0x2d150d['startsWith'](''+_0x5c5852+sep)||_0x2d150d===_0x5c5852){if(_0x2d150d===_0x5c5852)return;try{const _0x428c98=await readdir(_0x2d150d);if(_0x428c98['length']>0x0)return;await rmdir(_0x2d150d);}catch{return;}_0x2d150d=dirname(_0x2d150d);}}async function resolveTargetDbBinding(_0xbb566b,_0x2730ad,_0x52fe83){const _0x2209ab=a227_0x596368,_0x4fcd10=_0x2730ad[_0x2209ab(0x1ca)];if(!_0x4fcd10)return{'dbId':_0x52fe83[_0x2209ab(0x1e9)],'dbName':_0x52fe83['dbName']};const _0x148199=buildDbDirectoryName(_0x52fe83[_0x2209ab(0x1ef)],_0x52fe83['dbId']);if(_0x4fcd10===_0x148199)return{'dbId':_0x52fe83['dbId'],'dbName':_0x52fe83[_0x2209ab(0x1ef)]};const _0x441648=parseExplicitDbDirectory(_0x4fcd10);if(_0x441648!=null)return{'dbId':_0x441648,'dbName':await getDbName(_0xbb566b,_0x441648)[_0x2209ab(0x1da)](()=>undefined)};const _0x47f85c=await listDatabases(_0xbb566b),_0x37142c=_0x47f85c[_0x2209ab(0x1d6)](_0xa3a404=>buildDbDirectoryName(_0xa3a404['dbName'],_0xa3a404[_0x2209ab(0x1e9)])===_0x4fcd10);if(_0x37142c[_0x2209ab(0x1db)]===0x1)return{'dbId':_0x37142c[0x0][_0x2209ab(0x1e9)],'dbName':_0x37142c[0x0][_0x2209ab(0x1ef)]};if(_0x37142c['length']===0x0)throw CliErrors[_0x2209ab(0x1f7)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x4fcd10+_0x2209ab(0x1fa)+_0x2730ad[_0x2209ab(0x1e2)]+'.');const _0x38d418=_0x37142c['map'](_0x39ba54=>_0x39ba54[_0x2209ab(0x1ef)]+'\x20('+_0x39ba54[_0x2209ab(0x1e9)]+')')[_0x2209ab(0x202)](',\x20');throw CliErrors['validation'](_0x2209ab(0x200)+_0x4fcd10+_0x2209ab(0x1f1)+_0x2730ad['sqlCode']+':\x20'+_0x38d418);}function parseExplicitDbDirectory(_0x31ec37){const _0xc73cc8=a227_0x596368,_0xcba9e4=/^db-(\d+)$/[_0xc73cc8(0x1c8)](_0x31ec37);if(!_0xcba9e4)return null;const _0x203b5e=Number(_0xcba9e4[0x1]);return Number[_0xc73cc8(0x1e4)](_0x203b5e)&&_0x203b5e>0x0?_0x203b5e:null;}
@@ -1 +1 @@
1
- const a214_0x34a22e=a214_0x28e4;(function(_0xd2dc53,_0x1af156){const _0x3f05bd=a214_0x28e4,_0xc5b278=_0xd2dc53();while(!![]){try{const _0x287e1e=parseInt(_0x3f05bd(0x8a))/0x1+parseInt(_0x3f05bd(0x80))/0x2*(parseInt(_0x3f05bd(0x8e))/0x3)+parseInt(_0x3f05bd(0x76))/0x4*(parseInt(_0x3f05bd(0x7e))/0x5)+parseInt(_0x3f05bd(0x73))/0x6*(parseInt(_0x3f05bd(0x77))/0x7)+parseInt(_0x3f05bd(0x96))/0x8+parseInt(_0x3f05bd(0x83))/0x9*(-parseInt(_0x3f05bd(0x90))/0xa)+-parseInt(_0x3f05bd(0x74))/0xb*(parseInt(_0x3f05bd(0x8b))/0xc);if(_0x287e1e===_0x1af156)break;else _0xc5b278['push'](_0xc5b278['shift']());}catch(_0x392816){_0xc5b278['push'](_0xc5b278['shift']());}}}(a214_0x3a9d,0x9dd26));function a214_0x3a9d(){const _0x418bd4=['join','description','question','dbName','version','450757mNazmW','192180qZHYZq','apps','dbId','282UMNHGW','trim','421340PWEgdN','length','path','filter','toLowerCase','sqlName','1439432XbcPXO','close','sqls','map','includes','split','sqlCode','2123412Aewtsd','979AgnUKb','replace','92pwFwHf','7zBfvSp','lastSync','mybatisXml','mode','endsWith','trimStart','test','188885zBbUYH','entries','18092AGVJDK','--\x20@lovrabet.','\x20[y/N]\x20','135ihbFOi','.rabetbase/sql'];a214_0x3a9d=function(){return _0x418bd4;};return a214_0x3a9d();}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=a214_0x34a22e(0x84);export function buildSqlLockEntry(_0x493de1,_0x46d849,_0x9f3db8,_0x3a2d35){const _0x1a8944=a214_0x34a22e,_0x16c8f8=detectSqlMode(_0x46d849);return{'path':buildSqlRelativePath(_0x493de1['sqlCode'],_0x493de1[_0x1a8944(0x95)],_0x3a2d35?.[_0x1a8944(0x88)],_0x16c8f8,_0x493de1['dbId']),'hash':_0x9f3db8,'remoteId':_0x493de1['id'],'version':_0x493de1[_0x1a8944(0x89)],'dbId':Number(_0x493de1[_0x1a8944(0x8d)]),'dbName':_0x3a2d35?.[_0x1a8944(0x88)],'sqlName':_0x493de1[_0x1a8944(0x95)],'sqlConfig':_0x493de1['sqlConfig']??undefined,'mode':_0x16c8f8};}export function cloneSqlLockData(_0x333fd9){const _0x1d9f79=a214_0x34a22e;return{'apps':Object['fromEntries'](Object[_0x1d9f79(0x7f)](_0x333fd9[_0x1d9f79(0x8c)])[_0x1d9f79(0x6f)](([_0x57ddf8,_0x139e5d])=>[_0x57ddf8,{'sqlRoot':_0x139e5d['sqlRoot'],'lastSync':_0x139e5d[_0x1d9f79(0x78)],'sqls':{..._0x139e5d[_0x1d9f79(0x6e)]}}]))};}export function ensureRemoteSqlContent(_0x3a7729){return _0x3a7729['sqlContent']??'';}export function buildLocalSqlFileContent(_0x23ae55,_0x1b8abd,_0x29d375){const _0x314422=a214_0x34a22e,_0x4f74ba=_0x29d375?.[_0x314422(0x7a)]??detectSqlMode(_0x1b8abd),_0xcf72a5=stripLocalSqlMetadata(_0x1b8abd,_0x4f74ba)[_0x314422(0x8f)](),_0x33af9f=[...buildMetadataHeaderLines({'sqlCode':_0x23ae55[_0x314422(0x72)],'sqlName':_0x23ae55[_0x314422(0x95)],'dbId':_0x23ae55['dbId'],'dbName':_0x29d375?.[_0x314422(0x88)],'mode':_0x4f74ba,'syncedAt':_0x29d375?.['syncedAt'],'description':_0x29d375?.[_0x314422(0x86)]},_0x4f74ba),'',_0xcf72a5],_0x39aa04=_0x33af9f['join']('\x0a');return _0x39aa04[_0x314422(0x7b)]('\x0a')?_0x39aa04:_0x39aa04+'\x0a';}function a214_0x28e4(_0x1045af,_0x175a22){_0x1045af=_0x1045af-0x6d;const _0x3a9d48=a214_0x3a9d();let _0x28e47c=_0x3a9d48[_0x1045af];return _0x28e47c;}export function stripLocalSqlMetadata(_0x4b7394,_0xca3218){const _0x1c36ef=a214_0x34a22e,_0xbb8fe6=_0x4b7394[_0x1c36ef(0x75)](/\r\n/g,'\x0a')[_0x1c36ef(0x71)]('\x0a'),_0x5521fa=[];let _0x262244=0x0;if(_0xca3218===_0x1c36ef(0x79))while(_0x262244<_0xbb8fe6[_0x1c36ef(0x91)]){const _0x42f32d=_0xbb8fe6[_0x262244]??'';if(/^\s*<!--\s*@lovrabet\./[_0x1c36ef(0x7d)](_0x42f32d)){_0x262244++;continue;}if(_0x42f32d['trim']()===''&&_0x262244>0x0){_0x262244++;continue;}break;}else while(_0x262244<_0xbb8fe6['length']){const _0x5aec64=_0xbb8fe6[_0x262244]??'';if(/^\s*--\s*@lovrabet\./[_0x1c36ef(0x7d)](_0x5aec64)){_0x262244++;continue;}if(_0x5aec64['trim']()===''&&_0x262244>0x0){_0x262244++;continue;}break;}for(;_0x262244<_0xbb8fe6[_0x1c36ef(0x91)];_0x262244++){_0x5521fa['push'](_0xbb8fe6[_0x262244]);}return _0x5521fa[_0x1c36ef(0x85)]('\x0a')[_0x1c36ef(0x7c)]();}export function resolveSqlMode(_0x1d5f93,_0x1ea8ae){const _0x29ab96=a214_0x34a22e;if(_0x1ea8ae?.[_0x29ab96(0x7a)])return _0x1ea8ae[_0x29ab96(0x7a)];return detectSqlMode(_0x1d5f93);}export function resolveSqlFileName(_0x2f557e,_0x5c5d6a,_0x7bc1db){const _0x2cd3dd=a214_0x34a22e;if(_0x7bc1db?.[_0x2cd3dd(0x92)])return _0x7bc1db[_0x2cd3dd(0x92)];if(_0x7bc1db?.['sqlName']||_0x7bc1db?.[_0x2cd3dd(0x88)])return buildSqlRelativePath(_0x2f557e,_0x7bc1db?.[_0x2cd3dd(0x95)],_0x7bc1db?.[_0x2cd3dd(0x88)],resolveSqlMode(_0x5c5d6a,_0x7bc1db),_0x7bc1db?.[_0x2cd3dd(0x8d)]);return buildDefaultSqlFileName(_0x2f557e,resolveSqlMode(_0x5c5d6a,_0x7bc1db));}export function resolveSqlLocalDir(_0x1b03d4,_0x10da76){return join(_0x1b03d4,SQL_LOCAL_REL_DIR,_0x10da76);}export async function confirmForceOverwrite(_0x13d00f){const _0x11e43e=a214_0x34a22e,_0x12cb7a=createInterface({'input':process['stdin'],'output':process['stderr']}),_0x18f3ad=await new Promise(_0xebdae2=>{const _0x2fa8ba=a214_0x28e4;_0x12cb7a[_0x2fa8ba(0x87)](_0x13d00f+_0x2fa8ba(0x82),_0xebdae2);});return _0x12cb7a[_0x11e43e(0x6d)](),['y','yes'][_0x11e43e(0x70)](_0x18f3ad[_0x11e43e(0x8f)]()[_0x11e43e(0x94)]());}export function findSqlLockScope(_0x1aa20e,_0x134467){const _0x47115b=a214_0x34a22e;return _0x1aa20e[_0x47115b(0x8c)][_0x134467];}function buildMetadataHeaderLines(_0x46fe52,_0x1b31c8){const _0x439d9c=a214_0x34a22e,_0x3d3ac4=[[_0x439d9c(0x72),_0x46fe52[_0x439d9c(0x72)]],['sqlName',_0x46fe52['sqlName']],[_0x439d9c(0x8d),_0x46fe52['dbId']],[_0x439d9c(0x88),_0x46fe52[_0x439d9c(0x88)]],[_0x439d9c(0x7a),_0x46fe52[_0x439d9c(0x7a)]],['syncedAt',_0x46fe52['syncedAt']],['description',_0x46fe52[_0x439d9c(0x86)]]];if(_0x1b31c8===_0x439d9c(0x79))return _0x3d3ac4[_0x439d9c(0x93)](([,_0x27885a])=>_0x27885a!==undefined&&_0x27885a!==null&&String(_0x27885a)['trim']()!=='')['map'](([_0x54f2a2,_0x1242bd])=>'<!--\x20@lovrabet.'+_0x54f2a2+':\x20'+String(_0x1242bd)+'\x20-->');return _0x3d3ac4['filter'](([,_0x185847])=>_0x185847!==undefined&&_0x185847!==null&&String(_0x185847)[_0x439d9c(0x8f)]()!=='')[_0x439d9c(0x6f)](([_0xf67b99,_0x1d0409])=>_0x439d9c(0x81)+_0xf67b99+':\x20'+String(_0x1d0409));}
1
+ const a228_0x5a5eb8=a228_0x4a05;(function(_0x2fb6d2,_0x2ca37a){const _0x22b1bc=a228_0x4a05,_0x12194f=_0x2fb6d2();while(!![]){try{const _0x1040ce=parseInt(_0x22b1bc(0x11f))/0x1*(-parseInt(_0x22b1bc(0x128))/0x2)+-parseInt(_0x22b1bc(0x114))/0x3*(parseInt(_0x22b1bc(0x12b))/0x4)+-parseInt(_0x22b1bc(0x132))/0x5+parseInt(_0x22b1bc(0x12a))/0x6+parseInt(_0x22b1bc(0x13c))/0x7*(-parseInt(_0x22b1bc(0x113))/0x8)+-parseInt(_0x22b1bc(0x11d))/0x9*(-parseInt(_0x22b1bc(0x117))/0xa)+-parseInt(_0x22b1bc(0x10f))/0xb*(-parseInt(_0x22b1bc(0x125))/0xc);if(_0x1040ce===_0x2ca37a)break;else _0x12194f['push'](_0x12194f['shift']());}catch(_0x277674){_0x12194f['push'](_0x12194f['shift']());}}}(a228_0x52f9,0x596df));import{createInterface}from'node:readline';import{join}from'node:path';function a228_0x4a05(_0x46a081,_0x849a5f){_0x46a081=_0x46a081-0x10f;const _0x52f90b=a228_0x52f9();let _0x4a0578=_0x52f90b[_0x46a081];return _0x4a0578;}import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a228_0x5a5eb8(0x110);export function buildSqlLockEntry(_0x3a5632,_0x58b657,_0x2ee2dc,_0x553c1e){const _0x328fe9=a228_0x5a5eb8,_0x505303=detectSqlMode(_0x58b657);return{'path':buildSqlRelativePath(_0x3a5632[_0x328fe9(0x127)],_0x3a5632['sqlName'],_0x553c1e?.[_0x328fe9(0x119)],_0x505303,_0x3a5632[_0x328fe9(0x126)]),'hash':_0x2ee2dc,'remoteId':_0x3a5632['id'],'version':_0x3a5632['version'],'dbId':Number(_0x3a5632[_0x328fe9(0x126)]),'dbName':_0x553c1e?.[_0x328fe9(0x119)],'sqlName':_0x3a5632['sqlName'],'sqlConfig':_0x3a5632[_0x328fe9(0x122)]??undefined,'mode':_0x505303};}export function cloneSqlLockData(_0x3782be){const _0x857f88=a228_0x5a5eb8;return{'apps':Object[_0x857f88(0x133)](Object['entries'](_0x3782be[_0x857f88(0x120)])[_0x857f88(0x116)](([_0x44c466,_0x1b6587])=>[_0x44c466,{'sqlRoot':_0x1b6587[_0x857f88(0x115)],'lastSync':_0x1b6587[_0x857f88(0x11b)],'sqls':{..._0x1b6587['sqls']}}]))};}export function ensureRemoteSqlContent(_0x3ecfb0){const _0x13f137=a228_0x5a5eb8;return _0x3ecfb0[_0x13f137(0x135)]??'';}export function buildLocalSqlFileContent(_0x3c56e6,_0x5cf6ce,_0x270fa0){const _0x2164a1=a228_0x5a5eb8,_0x44eb10=_0x270fa0?.[_0x2164a1(0x118)]??detectSqlMode(_0x5cf6ce),_0x377cef=stripLocalSqlMetadata(_0x5cf6ce,_0x44eb10)['trim'](),_0x1040b5=[...buildMetadataHeaderLines({'sqlCode':_0x3c56e6['sqlCode'],'sqlName':_0x3c56e6['sqlName'],'dbId':_0x3c56e6['dbId'],'dbName':_0x270fa0?.[_0x2164a1(0x119)],'mode':_0x44eb10,'syncedAt':_0x270fa0?.['syncedAt'],'description':_0x270fa0?.['description']},_0x44eb10),'',_0x377cef],_0xcec008=_0x1040b5[_0x2164a1(0x112)]('\x0a');return _0xcec008[_0x2164a1(0x12f)]('\x0a')?_0xcec008:_0xcec008+'\x0a';}export function stripLocalSqlMetadata(_0x18f59a,_0x133fae){const _0x4acd3f=a228_0x5a5eb8,_0x249615=_0x18f59a[_0x4acd3f(0x12d)](/\r\n/g,'\x0a')[_0x4acd3f(0x130)]('\x0a'),_0x2c9d89=[];let _0x29a45b=0x0;if(_0x133fae===_0x4acd3f(0x11c))while(_0x29a45b<_0x249615[_0x4acd3f(0x129)]){const _0x320cbe=_0x249615[_0x29a45b]??'';if(/^\s*<!--\s*@lovrabet\./[_0x4acd3f(0x124)](_0x320cbe)){_0x29a45b++;continue;}if(_0x320cbe[_0x4acd3f(0x136)]()===''&&_0x29a45b>0x0){_0x29a45b++;continue;}break;}else while(_0x29a45b<_0x249615['length']){const _0x309c6d=_0x249615[_0x29a45b]??'';if(/^\s*--\s*@lovrabet\./[_0x4acd3f(0x124)](_0x309c6d)){_0x29a45b++;continue;}if(_0x309c6d[_0x4acd3f(0x136)]()===''&&_0x29a45b>0x0){_0x29a45b++;continue;}break;}for(;_0x29a45b<_0x249615[_0x4acd3f(0x129)];_0x29a45b++){_0x2c9d89[_0x4acd3f(0x138)](_0x249615[_0x29a45b]);}return _0x2c9d89[_0x4acd3f(0x112)]('\x0a')['trimStart']();}export function resolveSqlMode(_0x54446f,_0x3713a9){const _0x3c966f=a228_0x5a5eb8;if(_0x3713a9?.[_0x3c966f(0x118)])return _0x3713a9[_0x3c966f(0x118)];return detectSqlMode(_0x54446f);}function a228_0x52f9(){const _0x4f1031=['lastSync','mybatisXml','15894uYanqA','stderr','1pfspGi','apps','includes','sqlConfig','filter','test','72oXTnkf','dbId','sqlCode','1443458mAAgck','length','1676472FIyuLi','203652wvGCWD','\x20[y/N]\x20','replace','syncedAt','endsWith','split','<!--\x20@lovrabet.','1210375LrdMBe','fromEntries','close','sqlContent','trim','toLowerCase','push','stdin','path','description','7BIpwgt','1818366yKqMxC','.rabetbase/sql','--\x20@lovrabet.','join','1417784gxNRid','12svskzC','sqlRoot','map','2490hvfNlv','mode','dbName','sqlName'];a228_0x52f9=function(){return _0x4f1031;};return a228_0x52f9();}export function resolveSqlFileName(_0xdfb5d0,_0x11d94e,_0x1ecb3c){const _0x2fac3a=a228_0x5a5eb8;if(_0x1ecb3c?.['path'])return _0x1ecb3c[_0x2fac3a(0x13a)];if(_0x1ecb3c?.[_0x2fac3a(0x11a)]||_0x1ecb3c?.[_0x2fac3a(0x119)])return buildSqlRelativePath(_0xdfb5d0,_0x1ecb3c?.[_0x2fac3a(0x11a)],_0x1ecb3c?.[_0x2fac3a(0x119)],resolveSqlMode(_0x11d94e,_0x1ecb3c),_0x1ecb3c?.[_0x2fac3a(0x126)]);return buildDefaultSqlFileName(_0xdfb5d0,resolveSqlMode(_0x11d94e,_0x1ecb3c));}export function resolveSqlLocalDir(_0x2566d2,_0x2db98d){return join(_0x2566d2,SQL_LOCAL_REL_DIR,_0x2db98d);}export async function confirmForceOverwrite(_0x5248a0){const _0x3009fe=a228_0x5a5eb8,_0x497075=createInterface({'input':process[_0x3009fe(0x139)],'output':process[_0x3009fe(0x11e)]}),_0x558ca3=await new Promise(_0x5217d9=>{const _0x25b1a6=_0x3009fe;_0x497075['question'](_0x5248a0+_0x25b1a6(0x12c),_0x5217d9);});return _0x497075[_0x3009fe(0x134)](),['y','yes'][_0x3009fe(0x121)](_0x558ca3[_0x3009fe(0x136)]()[_0x3009fe(0x137)]());}export function findSqlLockScope(_0x5499b1,_0x55529f){const _0x2e7063=a228_0x5a5eb8;return _0x5499b1[_0x2e7063(0x120)][_0x55529f];}function buildMetadataHeaderLines(_0x50f075,_0x969327){const _0x4db961=a228_0x5a5eb8,_0x4dca21=[[_0x4db961(0x127),_0x50f075[_0x4db961(0x127)]],[_0x4db961(0x11a),_0x50f075[_0x4db961(0x11a)]],[_0x4db961(0x126),_0x50f075['dbId']],[_0x4db961(0x119),_0x50f075[_0x4db961(0x119)]],[_0x4db961(0x118),_0x50f075[_0x4db961(0x118)]],['syncedAt',_0x50f075[_0x4db961(0x12e)]],[_0x4db961(0x13b),_0x50f075[_0x4db961(0x13b)]]];if(_0x969327===_0x4db961(0x11c))return _0x4dca21[_0x4db961(0x123)](([,_0x3d4ea1])=>_0x3d4ea1!==undefined&&_0x3d4ea1!==null&&String(_0x3d4ea1)[_0x4db961(0x136)]()!=='')[_0x4db961(0x116)](([_0x1c59cf,_0x8341fa])=>_0x4db961(0x131)+_0x1c59cf+':\x20'+String(_0x8341fa)+'\x20-->');return _0x4dca21[_0x4db961(0x123)](([,_0x3743b2])=>_0x3743b2!==undefined&&_0x3743b2!==null&&String(_0x3743b2)[_0x4db961(0x136)]()!=='')[_0x4db961(0x116)](([_0x134acb,_0x3b1efd])=>_0x4db961(0x111)+_0x134acb+':\x20'+String(_0x3b1efd));}
@@ -1 +1 @@
1
- const a215_0x255533=a215_0x15a4;function a215_0x15a4(_0x5c3296,_0x4b733e){_0x5c3296=_0x5c3296-0x1d1;const _0x1b193f=a215_0x1b19();let _0x15a422=_0x1b193f[_0x5c3296];return _0x15a422;}(function(_0x53e824,_0x32109a){const _0x1dc62f=a215_0x15a4,_0x50fbd2=_0x53e824();while(!![]){try{const _0x3aa149=parseInt(_0x1dc62f(0x1e1))/0x1*(parseInt(_0x1dc62f(0x1e6))/0x2)+-parseInt(_0x1dc62f(0x1d4))/0x3+parseInt(_0x1dc62f(0x1ed))/0x4+-parseInt(_0x1dc62f(0x1d5))/0x5*(-parseInt(_0x1dc62f(0x1e8))/0x6)+parseInt(_0x1dc62f(0x1f4))/0x7+-parseInt(_0x1dc62f(0x1ec))/0x8+-parseInt(_0x1dc62f(0x1f1))/0x9*(parseInt(_0x1dc62f(0x1e4))/0xa);if(_0x3aa149===_0x32109a)break;else _0x50fbd2['push'](_0x50fbd2['shift']());}catch(_0x55909c){_0x50fbd2['push'](_0x50fbd2['shift']());}}}(a215_0x1b19,0x28cde));function a215_0x1b19(){const _0x572ea2=['boolean','33618jnHBAh','lockFilePath','has','push','2667240akmsVY','913792slTBqp','path','sqls','map','81vtIrfi','lockKey','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','1166872yCGsDL','All\x20SQL\x20queries\x20are\x20in\x20sync.','\x20added,\x20','keys','43443iTxTMb','165SbjPYz','hash','relativePath','remote','\x20unchanged','totalCount','sqlCode','filePath','sqlName','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','\x20remote-only','tableData','81974aWBvQb','length','appCode','163330tUMLUP','status','2JadHdE'];a215_0x1b19=function(){return _0x572ea2;};return a215_0x1b19();}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(_0x169468){const _0x574830=a215_0x15a4,_0xfbf881=[];let _0x256634=0x1;while(!![]){const _0x74a35b=await listSqlQueries(_0x169468,{'currentPage':_0x256634,'pageSize':PAGE_SIZE}),_0x4dc16d=_0x74a35b[_0x574830(0x1e0)]??[];_0xfbf881['push'](..._0x4dc16d[_0x574830(0x1f0)](_0x200fc6=>_0x200fc6[_0x574830(0x1db)]));if(_0x4dc16d[_0x574830(0x1e2)]===0x0)break;const _0x192dbc=_0x74a35b['paging']?.[_0x574830(0x1da)];if(_0x192dbc!=null?_0xfbf881[_0x574830(0x1e2)]>=_0x192dbc:_0x4dc16d[_0x574830(0x1e2)]<PAGE_SIZE)break;_0x256634++;}return _0xfbf881;}export const sqlStatus={'service':'sql','command':a215_0x255533(0x1e5),'description':a215_0x255533(0x1f3),'risk':'read','flags':[{'name':'remote','type':a215_0x255533(0x1e7),'description':a215_0x255533(0x1de)}],async 'execute'(_0x5b977){const _0x3919cb=a215_0x255533,_0x46d933=loadSqlProjectConfig(_0x5b977['appCode']),_0x3adb4f=await readSqlLockFile(_0x46d933[_0x3919cb(0x1e9)]),{appLock:_0x1cdfa8}=ensureSqlLockScope(_0x3adb4f??createEmptySqlLock(),_0x46d933['appCode'],_0x46d933['sqlRoot'],'status'),_0x4b7ca0=await scanLocalSqlQueries(_0x46d933),_0x253b9a=[],_0x20acfb=[],_0x261a8f=[],_0x4418e0=[],_0x11e8a2=new Set(_0x4b7ca0['map'](_0x182ed5=>_0x182ed5[_0x3919cb(0x1f2)]));for(const _0x3c38a3 of _0x4b7ca0){const _0x34bb0b=await computeSqlFileHash(_0x3c38a3[_0x3919cb(0x1dc)]),_0x22770e=_0x1cdfa8['sqls'][_0x3c38a3[_0x3919cb(0x1f2)]],_0x50dfa7=!!_0x22770e&&_0x22770e[_0x3919cb(0x1ee)]!==_0x3c38a3[_0x3919cb(0x1d7)],_0x235d95=!!_0x22770e&&!!_0x3c38a3[_0x3919cb(0x1dd)]&&_0x22770e['sqlName']!==_0x3c38a3[_0x3919cb(0x1dd)];if(!_0x22770e)_0x253b9a[_0x3919cb(0x1eb)](_0x3c38a3[_0x3919cb(0x1f2)]);else _0x22770e[_0x3919cb(0x1d6)]!==_0x34bb0b||_0x50dfa7||_0x235d95?_0x20acfb['push'](_0x3c38a3[_0x3919cb(0x1f2)]):_0x261a8f[_0x3919cb(0x1eb)](_0x3c38a3[_0x3919cb(0x1f2)]);}for(const _0x4cb7fa of Object[_0x3919cb(0x1d3)](_0x1cdfa8[_0x3919cb(0x1ef)])){!_0x11e8a2[_0x3919cb(0x1ea)](_0x4cb7fa)&&_0x4418e0['push'](_0x4cb7fa);}const _0x2fb03c=[];if(_0x5b977['bool'](_0x3919cb(0x1d8))){const _0x532267=await fetchAllSqlCodes(_0x5b977[_0x3919cb(0x1e3)]);for(const _0x555d71 of _0x532267){!_0x11e8a2[_0x3919cb(0x1ea)](_0x555d71)&&!_0x1cdfa8['sqls'][_0x555d71]&&_0x2fb03c['push'](_0x555d71);}}const _0x25c839=_0x253b9a[_0x3919cb(0x1e2)]===0x0&&_0x20acfb['length']===0x0&&_0x4418e0[_0x3919cb(0x1e2)]===0x0&&_0x2fb03c['length']===0x0;return{'ok':!![],'data':{'added':_0x253b9a,'modified':_0x20acfb,'missing':_0x4418e0,'unchanged':_0x261a8f,'remoteOnly':_0x2fb03c},'message':_0x25c839?_0x3919cb(0x1d1):_0x253b9a[_0x3919cb(0x1e2)]+_0x3919cb(0x1d2)+_0x20acfb[_0x3919cb(0x1e2)]+'\x20modified,\x20'+_0x4418e0[_0x3919cb(0x1e2)]+'\x20missing,\x20'+_0x261a8f[_0x3919cb(0x1e2)]+_0x3919cb(0x1d9)+(_0x2fb03c[_0x3919cb(0x1e2)]>0x0?',\x20'+_0x2fb03c[_0x3919cb(0x1e2)]+_0x3919cb(0x1df):'')};}};
1
+ const a229_0x709696=a229_0x57ec;(function(_0x172136,_0x4c8434){const _0x1558e3=a229_0x57ec,_0x1854c2=_0x172136();while(!![]){try{const _0x1a081f=-parseInt(_0x1558e3(0x1c2))/0x1+-parseInt(_0x1558e3(0x1a2))/0x2*(-parseInt(_0x1558e3(0x1a5))/0x3)+parseInt(_0x1558e3(0x1af))/0x4+-parseInt(_0x1558e3(0x1ba))/0x5+-parseInt(_0x1558e3(0x1bf))/0x6+parseInt(_0x1558e3(0x1b0))/0x7+parseInt(_0x1558e3(0x1ae))/0x8;if(_0x1a081f===_0x4c8434)break;else _0x1854c2['push'](_0x1854c2['shift']());}catch(_0x5dccc5){_0x1854c2['push'](_0x1854c2['shift']());}}}(a229_0x1b55,0x90a8e));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(_0x449a88){const _0x57ee46=a229_0x57ec,_0x16f28a=[];let _0xae86f0=0x1;while(!![]){const _0x176ff9=await listSqlQueries(_0x449a88,{'currentPage':_0xae86f0,'pageSize':PAGE_SIZE}),_0x9ab28b=_0x176ff9[_0x57ee46(0x1ac)]??[];_0x16f28a[_0x57ee46(0x1b3)](..._0x9ab28b['map'](_0x362f96=>_0x362f96[_0x57ee46(0x1c0)]));if(_0x9ab28b[_0x57ee46(0x1b4)]===0x0)break;const _0x269091=_0x176ff9['paging']?.[_0x57ee46(0x1bd)];if(_0x269091!=null?_0x16f28a[_0x57ee46(0x1b4)]>=_0x269091:_0x9ab28b[_0x57ee46(0x1b4)]<PAGE_SIZE)break;_0xae86f0++;}return _0x16f28a;}export const sqlStatus={'service':a229_0x709696(0x1c5),'command':'status','description':a229_0x709696(0x1bc),'risk':a229_0x709696(0x1a9),'flags':[{'name':a229_0x709696(0x1a6),'type':a229_0x709696(0x1a4),'description':a229_0x709696(0x1c3)}],async 'execute'(_0x12ab77){const _0x5d3d5e=a229_0x709696,_0x1a486a=loadSqlProjectConfig(_0x12ab77[_0x5d3d5e(0x1b7)]),_0x348de3=await readSqlLockFile(_0x1a486a[_0x5d3d5e(0x1b9)]),{appLock:_0xe744bb}=ensureSqlLockScope(_0x348de3??createEmptySqlLock(),_0x1a486a[_0x5d3d5e(0x1b7)],_0x1a486a[_0x5d3d5e(0x1bb)],_0x5d3d5e(0x1c6)),_0x1b5050=await scanLocalSqlQueries(_0x1a486a),_0x2d159c=[],_0x42b3a5=[],_0x58c2ea=[],_0x314520=[],_0x4b21b6=new Set(_0x1b5050[_0x5d3d5e(0x1aa)](_0x468acd=>_0x468acd[_0x5d3d5e(0x1ad)]));for(const _0x32c4c5 of _0x1b5050){const _0x2b8330=await computeSqlFileHash(_0x32c4c5['filePath']),_0x19d3ad=_0xe744bb[_0x5d3d5e(0x1b6)][_0x32c4c5[_0x5d3d5e(0x1ad)]],_0x1597ac=!!_0x19d3ad&&_0x19d3ad[_0x5d3d5e(0x1b8)]!==_0x32c4c5[_0x5d3d5e(0x1be)],_0x4803c5=!!_0x19d3ad&&!!_0x32c4c5['sqlName']&&_0x19d3ad[_0x5d3d5e(0x1b2)]!==_0x32c4c5[_0x5d3d5e(0x1b2)];if(!_0x19d3ad)_0x2d159c[_0x5d3d5e(0x1b3)](_0x32c4c5[_0x5d3d5e(0x1ad)]);else _0x19d3ad[_0x5d3d5e(0x1c4)]!==_0x2b8330||_0x1597ac||_0x4803c5?_0x42b3a5['push'](_0x32c4c5[_0x5d3d5e(0x1ad)]):_0x58c2ea['push'](_0x32c4c5[_0x5d3d5e(0x1ad)]);}for(const _0x905695 of Object[_0x5d3d5e(0x1a8)](_0xe744bb['sqls'])){!_0x4b21b6[_0x5d3d5e(0x1c1)](_0x905695)&&_0x314520['push'](_0x905695);}const _0x4aef6a=[];if(_0x12ab77[_0x5d3d5e(0x1ab)]('remote')){const _0x2db740=await fetchAllSqlCodes(_0x12ab77[_0x5d3d5e(0x1b7)]);for(const _0xb3a5ba of _0x2db740){!_0x4b21b6['has'](_0xb3a5ba)&&!_0xe744bb[_0x5d3d5e(0x1b6)][_0xb3a5ba]&&_0x4aef6a[_0x5d3d5e(0x1b3)](_0xb3a5ba);}}const _0x4becac=_0x2d159c[_0x5d3d5e(0x1b4)]===0x0&&_0x42b3a5['length']===0x0&&_0x314520['length']===0x0&&_0x4aef6a['length']===0x0;return{'ok':!![],'data':{'added':_0x2d159c,'modified':_0x42b3a5,'missing':_0x314520,'unchanged':_0x58c2ea,'remoteOnly':_0x4aef6a},'message':_0x4becac?_0x5d3d5e(0x1b5):_0x2d159c[_0x5d3d5e(0x1b4)]+_0x5d3d5e(0x1b1)+_0x42b3a5[_0x5d3d5e(0x1b4)]+'\x20modified,\x20'+_0x314520[_0x5d3d5e(0x1b4)]+_0x5d3d5e(0x1a7)+_0x58c2ea[_0x5d3d5e(0x1b4)]+_0x5d3d5e(0x1a3)+(_0x4aef6a[_0x5d3d5e(0x1b4)]>0x0?',\x20'+_0x4aef6a['length']+'\x20remote-only':'')};}};function a229_0x57ec(_0x1152a3,_0x552464){_0x1152a3=_0x1152a3-0x1a2;const _0x1b5561=a229_0x1b55();let _0x57ec09=_0x1b5561[_0x1152a3];return _0x57ec09;}function a229_0x1b55(){const _0x35f2c6=['6lHoCGm','remote','\x20missing,\x20','keys','read','map','bool','tableData','lockKey','3878064NGnAIP','359548TOrGYD','1352582UbxNny','\x20added,\x20','sqlName','push','length','All\x20SQL\x20queries\x20are\x20in\x20sync.','sqls','appCode','path','lockFilePath','1576970gLdjgt','sqlRoot','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','totalCount','relativePath','1224624bWKXhC','sqlCode','has','275831ldTKox','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','hash','sql','status','619984JiIIcv','\x20unchanged','boolean'];a229_0x1b55=function(){return _0x35f2c6;};return a229_0x1b55();}
@@ -1 +1 @@
1
- const a216_0x4ff32a=a216_0x250d;function a216_0x250d(_0x1b16ed,_0x2582ff){_0x1b16ed=_0x1b16ed-0x6d;const _0x391c1b=a216_0x391c();let _0x250d14=_0x391c1b[_0x1b16ed];return _0x250d14;}(function(_0x248243,_0x2ecc70){const _0x7025b2=a216_0x250d,_0x32cc1b=_0x248243();while(!![]){try{const _0xbd4c80=parseInt(_0x7025b2(0x92))/0x1*(parseInt(_0x7025b2(0x97))/0x2)+parseInt(_0x7025b2(0x72))/0x3*(-parseInt(_0x7025b2(0x6d))/0x4)+-parseInt(_0x7025b2(0x78))/0x5*(-parseInt(_0x7025b2(0x6f))/0x6)+parseInt(_0x7025b2(0xa9))/0x7+parseInt(_0x7025b2(0x83))/0x8*(-parseInt(_0x7025b2(0x86))/0x9)+parseInt(_0x7025b2(0x8a))/0xa*(parseInt(_0x7025b2(0x7b))/0xb)+parseInt(_0x7025b2(0x90))/0xc*(parseInt(_0x7025b2(0xab))/0xd);if(_0xbd4c80===_0x2ecc70)break;else _0x32cc1b['push'](_0x32cc1b['shift']());}catch(_0x5de944){_0x32cc1b['push'](_0x32cc1b['shift']());}}}(a216_0x391c,0x3078c));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';function a216_0x391c(){const _0x363a3a=['bool','validation','trim','660JNpllx','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','\x22\x20not\x20found\x20in\x20any\x20dataset','type','read','valid','11844vZbgIf','columns','111811QibuHE','Dataset\x20\x22','sqlType','validate','dbtableConfig','2GQFymq','isArray','filter','dataset','name','find','columnNames','parameters','toLowerCase','check-indexes','indexName','fields','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','push','tableName','flatMap','indexes','tables','368809GAoOwF','str','4745EuAzWd','--check-indexes\x20requires\x20--schemas.','flagMissing','split','get','unshift','reason','appCode','357288Wuxpdy','pkField','269538wKmJAa','index_name','sql','9eoQBpU','from','Table\x20\x22','string','message','size','5TRKLnp','length','Provide\x20--file\x20or\x20--sql','46673BNZtXF','utf-8','schema:','\x22\x20not\x20found\x20or\x20not\x20accessible','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','isDangerous','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','file','54744NJjNWM','isSelectOnly','map','504lDzGFm'];a216_0x391c=function(){return _0x363a3a;};return a216_0x391c();}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':a216_0x4ff32a(0x71),'command':a216_0x4ff32a(0x95),'description':a216_0x4ff32a(0xa3),'risk':a216_0x4ff32a(0x8e),'flags':[{'name':a216_0x4ff32a(0x82),'type':a216_0x4ff32a(0x75),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a216_0x4ff32a(0x71),'type':a216_0x4ff32a(0x75),'description':a216_0x4ff32a(0x7f)},{'name':'schemas','type':'string','description':a216_0x4ff32a(0x8b)},{'name':a216_0x4ff32a(0xa0),'type':'boolean','description':a216_0x4ff32a(0x81)}],async 'execute'(_0xe82334){const _0x215afb=a216_0x4ff32a,_0x1c6d6b=_0xe82334[_0x215afb(0xaa)]('file'),_0x290d86=_0xe82334[_0x215afb(0xaa)](_0x215afb(0x71)),_0x1bb209=_0xe82334[_0x215afb(0xaa)]('schemas'),_0x576759=_0xe82334[_0x215afb(0x87)]('check-indexes');if(!_0x1c6d6b&&!_0x290d86)throw CliErrors[_0x215afb(0xad)]('file',_0x215afb(0x7a));if(_0x576759&&!_0x1bb209)throw CliErrors['validation'](_0x215afb(0xac));let _0x264901;if(_0x1c6d6b){const _0x3f4bfb=resolve(process['cwd'](),_0x1c6d6b);if(!existsSync(_0x3f4bfb))throw CliErrors[_0x215afb(0x88)]('File\x20not\x20found:\x20'+_0x3f4bfb);_0x264901=readFileSync(_0x3f4bfb,_0x215afb(0x7c));}else _0x264901=_0x290d86;const _0x92ac9e=validateSql(_0x264901),_0x46e684={'valid':_0x92ac9e[_0x215afb(0x8f)],'sqlType':_0x92ac9e[_0x215afb(0x94)][_0x215afb(0x8d)],'isSelectOnly':_0x92ac9e[_0x215afb(0x94)][_0x215afb(0x84)],'isDangerous':_0x92ac9e['sqlType'][_0x215afb(0x80)],'tables':_0x92ac9e[_0x215afb(0xa8)],'parameters':_0x92ac9e[_0x215afb(0x9e)],'message':_0x92ac9e[_0x215afb(0x76)]};_0x92ac9e[_0x215afb(0x94)][_0x215afb(0xb1)]&&(_0x46e684[_0x215afb(0xb1)]=_0x92ac9e[_0x215afb(0x94)][_0x215afb(0xb1)]);if(_0x1bb209&&_0x92ac9e[_0x215afb(0x8f)]){const _0x54bed3=_0x1bb209[_0x215afb(0xae)](',')[_0x215afb(0x85)](_0x113dad=>_0x113dad[_0x215afb(0x89)]())[_0x215afb(0x99)](Boolean),_0x1897b6=[],_0x3ee826=[],_0xc83c1f=filterDbTableBackedDatasets(await listDatasets(_0xe82334[_0x215afb(0xb2)])),_0x242fee=new Map(_0xc83c1f[_0x215afb(0x85)](_0x479649=>[_0x479649['dbtableConfig']?.['tableName']?.[_0x215afb(0x9f)](),_0x479649]));for(const _0x28e9ba of _0x92ac9e[_0x215afb(0xa8)]){const _0x475ab8=_0x242fee[_0x215afb(0xaf)](_0x28e9ba[_0x215afb(0x9f)]());!_0x475ab8&&_0x1897b6[_0x215afb(0xa4)](_0x215afb(0x74)+_0x28e9ba+_0x215afb(0x8c));}for(const _0x139093 of _0x54bed3){let _0x16e825;try{_0x16e825=await getDatasetDetail(_0x139093);}catch{_0x1897b6[_0x215afb(0xa4)](_0x215afb(0x93)+_0x139093+_0x215afb(0x7e));continue;}assertDatasetIsDbTableBacked(_0x16e825,'SQL\x20schema\x20validation');const _0xd2f3fc=Array[_0x215afb(0x98)](_0x16e825[_0x215afb(0xa2)])?_0x16e825[_0x215afb(0xa2)]:[],_0x1d6560=new Set(_0xd2f3fc['map'](_0x483336=>_0x483336[_0x215afb(0x9b)]?.[_0x215afb(0x9f)]())),_0x7620b9=_0x16e825[_0x215afb(0x96)]?.[_0x215afb(0xa5)]||_0x16e825['tableName']||_0x139093;_0x46e684[_0x215afb(0x7d)+_0x7620b9]={'code':_0x139093,'tableName':_0x7620b9,'fieldCount':_0x1d6560[_0x215afb(0x77)],'fields':Array[_0x215afb(0x73)](_0x1d6560)};if(_0x576759){const _0x258e3c=normalizeDatasetIndexes(_0x16e825);_0x3ee826[_0x215afb(0xa4)]({'tableName':_0x7620b9,..._0x258e3c});}}_0x1897b6[_0x215afb(0x79)]>0x0&&(_0x46e684['schemaWarnings']=_0x1897b6),_0x576759&&(_0x46e684['joinAudit']=auditSqlJoinIndexes(_0x264901,_0x3ee826));}return{'ok':_0x92ac9e[_0x215afb(0x8f)],'data':_0x46e684,'message':_0x92ac9e[_0x215afb(0x76)]};}};function normalizeDatasetIndexes(_0x226184){const _0x9928c8=a216_0x4ff32a,_0x11274e=Array[_0x9928c8(0x98)](_0x226184?.[_0x9928c8(0x9a)]?.['indexes'])?_0x226184[_0x9928c8(0x9a)][_0x9928c8(0xa7)]:Array[_0x9928c8(0x98)](_0x226184?.[_0x9928c8(0xa7)])?_0x226184[_0x9928c8(0xa7)]:[],_0x2a10de=_0x11274e[_0x9928c8(0xa6)](_0x24cf14=>{const _0x5845b6=_0x9928c8,_0x14d714=Array[_0x5845b6(0x98)](_0x24cf14?.['index_columns'])?_0x24cf14['index_columns']:Array[_0x5845b6(0x98)](_0x24cf14?.['columnNames'])?_0x24cf14[_0x5845b6(0x9d)]:Array[_0x5845b6(0x98)](_0x24cf14?.[_0x5845b6(0x91)])?_0x24cf14['columns']:[],_0x2f4c1e=_0x14d714[_0x5845b6(0x99)](_0x47c60a=>typeof _0x47c60a===_0x5845b6(0x75))[_0x5845b6(0x85)](_0x377d36=>_0x377d36['trim']())[_0x5845b6(0x99)](Boolean);if(_0x2f4c1e[_0x5845b6(0x79)]===0x0)return[];const _0x441ce2=[_0x24cf14?.[_0x5845b6(0xa1)],_0x24cf14?.[_0x5845b6(0x70)],_0x24cf14?.['name']][_0x5845b6(0x9c)](_0x203825=>typeof _0x203825===_0x5845b6(0x75)&&_0x203825[_0x5845b6(0x89)]()),_0xce7956=[_0x24cf14?.['index_type'],_0x24cf14?.[_0x5845b6(0x8d)]][_0x5845b6(0x9c)](_0x4f3d96=>typeof _0x4f3d96===_0x5845b6(0x75)&&_0x4f3d96['trim']());return[{..._0x441ce2?{'name':_0x441ce2[_0x5845b6(0x89)]()}:{},..._0xce7956?{'type':_0xce7956[_0x5845b6(0x89)]()}:{},'columns':_0x2f4c1e}];}),_0x130940=[..._0x2a10de],_0x31d7cc=typeof _0x226184?.[_0x9928c8(0x96)]?.[_0x9928c8(0x6e)]===_0x9928c8(0x75)?_0x226184['dbtableConfig'][_0x9928c8(0x6e)][_0x9928c8(0xae)](',')[_0x9928c8(0x85)](_0x2271d5=>_0x2271d5[_0x9928c8(0x89)]())[_0x9928c8(0x99)](Boolean):[];return _0x31d7cc[_0x9928c8(0x79)]>0x0&&_0x130940[_0x9928c8(0xb0)]({'type':'primary','columns':_0x31d7cc}),{'indexes':_0x130940,'metadataAvailable':_0x2a10de[_0x9928c8(0x79)]>0x0};}
1
+ const a230_0x5b385f=a230_0x3f2b;function a230_0x23a4(){const _0x8599bd=['boolean','isArray','appCode','\x22\x20not\x20found\x20in\x20any\x20dataset','schemas','joinAudit','SQL\x20schema\x20validation','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','cwd','1272412JBSiOJ','flagMissing','indexes','columns','length','primary','Table\x20\x22','columnNames','2166203MWEHFN','--check-indexes\x20requires\x20--schemas.','693MLdZdW','check-indexes','3370437YOQonY','index_type','message','3lAOSei','type','split','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','validation','push','tableName','file','66845goObaK','size','fields','name','string','utf-8','500086AEiLfs','flatMap','78TNCXrO','find','24HfxlxV','indexName','index_name','trim','from','valid','dbtableConfig','parameters','get','6792170bjRfiB','read','index_columns','\x22\x20not\x20found\x20or\x20not\x20accessible','reason','sql','tables','pkField','str','2FpotRI','toLowerCase','Dataset\x20\x22','schemaWarnings','filter','sqlType','schema:','map','dataset','File\x20not\x20found:\x20','50624QiTLRI','10kIXbCa'];a230_0x23a4=function(){return _0x8599bd;};return a230_0x23a4();}(function(_0x26849b,_0x34a225){const _0x2c0b20=a230_0x3f2b,_0x2a30e1=_0x26849b();while(!![]){try{const _0xa03922=parseInt(_0x2c0b20(0x1fc))/0x1*(-parseInt(_0x2c0b20(0x1c9))/0x2)+-parseInt(_0x2c0b20(0x1ed))/0x3*(-parseInt(_0x2c0b20(0x1de))/0x4)+-parseInt(_0x2c0b20(0x1f6))/0x5*(parseInt(_0x2c0b20(0x1b5))/0x6)+-parseInt(_0x2c0b20(0x1e8))/0x7*(-parseInt(_0x2c0b20(0x1d3))/0x8)+parseInt(_0x2c0b20(0x1ea))/0x9+parseInt(_0x2c0b20(0x1d4))/0xa*(-parseInt(_0x2c0b20(0x1c0))/0xb)+-parseInt(_0x2c0b20(0x1b7))/0xc*(-parseInt(_0x2c0b20(0x1e6))/0xd);if(_0xa03922===_0x34a225)break;else _0x2a30e1['push'](_0x2a30e1['shift']());}catch(_0x437309){_0x2a30e1['push'](_0x2a30e1['shift']());}}}(a230_0x23a4,0x58211));function a230_0x3f2b(_0x3a38fe,_0x2d5239){_0x3a38fe=_0x3a38fe-0x1b4;const _0x23a43e=a230_0x23a4();let _0x3f2b01=_0x23a43e[_0x3a38fe];return _0x3f2b01;}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a230_0x5b385f(0x1c5),'command':'validate','description':a230_0x5b385f(0x1f1),'risk':a230_0x5b385f(0x1c1),'flags':[{'name':a230_0x5b385f(0x1f5),'type':a230_0x5b385f(0x1fa),'description':a230_0x5b385f(0x1f0)},{'name':a230_0x5b385f(0x1c5),'type':a230_0x5b385f(0x1fa),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a230_0x5b385f(0x1d9),'type':a230_0x5b385f(0x1fa),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':'check-indexes','type':a230_0x5b385f(0x1d5),'description':a230_0x5b385f(0x1dc)}],async 'execute'(_0x260c52){const _0x1ba085=a230_0x5b385f,_0x69d100=_0x260c52[_0x1ba085(0x1c8)](_0x1ba085(0x1f5)),_0xaea014=_0x260c52[_0x1ba085(0x1c8)](_0x1ba085(0x1c5)),_0x4dc237=_0x260c52[_0x1ba085(0x1c8)](_0x1ba085(0x1d9)),_0x478489=_0x260c52['bool'](_0x1ba085(0x1e9));if(!_0x69d100&&!_0xaea014)throw CliErrors[_0x1ba085(0x1df)](_0x1ba085(0x1f5),'Provide\x20--file\x20or\x20--sql');if(_0x478489&&!_0x4dc237)throw CliErrors[_0x1ba085(0x1f2)](_0x1ba085(0x1e7));let _0x2718fc;if(_0x69d100){const _0x44ae8e=resolve(process[_0x1ba085(0x1dd)](),_0x69d100);if(!existsSync(_0x44ae8e))throw CliErrors[_0x1ba085(0x1f2)](_0x1ba085(0x1d2)+_0x44ae8e);_0x2718fc=readFileSync(_0x44ae8e,_0x1ba085(0x1fb));}else _0x2718fc=_0xaea014;const _0x1ee882=validateSql(_0x2718fc),_0x164d94={'valid':_0x1ee882['valid'],'sqlType':_0x1ee882[_0x1ba085(0x1ce)][_0x1ba085(0x1ee)],'isSelectOnly':_0x1ee882[_0x1ba085(0x1ce)]['isSelectOnly'],'isDangerous':_0x1ee882[_0x1ba085(0x1ce)]['isDangerous'],'tables':_0x1ee882[_0x1ba085(0x1c6)],'parameters':_0x1ee882[_0x1ba085(0x1be)],'message':_0x1ee882[_0x1ba085(0x1ec)]};_0x1ee882[_0x1ba085(0x1ce)][_0x1ba085(0x1c4)]&&(_0x164d94['reason']=_0x1ee882[_0x1ba085(0x1ce)][_0x1ba085(0x1c4)]);if(_0x4dc237&&_0x1ee882[_0x1ba085(0x1bc)]){const _0x13be8e=_0x4dc237['split'](',')[_0x1ba085(0x1d0)](_0x3634d6=>_0x3634d6[_0x1ba085(0x1ba)]())['filter'](Boolean),_0xf5b163=[],_0x1a5b23=[],_0x2cb1c=filterDbTableBackedDatasets(await listDatasets(_0x260c52[_0x1ba085(0x1d7)])),_0x30740e=new Map(_0x2cb1c['map'](_0x3e8585=>[_0x3e8585['dbtableConfig']?.['tableName']?.[_0x1ba085(0x1ca)](),_0x3e8585]));for(const _0x7c37ea of _0x1ee882[_0x1ba085(0x1c6)]){const _0x395449=_0x30740e[_0x1ba085(0x1bf)](_0x7c37ea[_0x1ba085(0x1ca)]());!_0x395449&&_0xf5b163['push'](_0x1ba085(0x1e4)+_0x7c37ea+_0x1ba085(0x1d8));}for(const _0x1974f7 of _0x13be8e){let _0x525853;try{_0x525853=await getDatasetDetail(_0x1974f7);}catch{_0xf5b163['push'](_0x1ba085(0x1cb)+_0x1974f7+_0x1ba085(0x1c3));continue;}assertDatasetIsDbTableBacked(_0x525853,_0x1ba085(0x1db));const _0x1a02c3=Array[_0x1ba085(0x1d6)](_0x525853['fields'])?_0x525853[_0x1ba085(0x1f8)]:[],_0x1b2ef7=new Set(_0x1a02c3[_0x1ba085(0x1d0)](_0x5cb83f=>_0x5cb83f[_0x1ba085(0x1f9)]?.['toLowerCase']())),_0x228ca4=_0x525853[_0x1ba085(0x1bd)]?.[_0x1ba085(0x1f4)]||_0x525853[_0x1ba085(0x1f4)]||_0x1974f7;_0x164d94[_0x1ba085(0x1cf)+_0x228ca4]={'code':_0x1974f7,'tableName':_0x228ca4,'fieldCount':_0x1b2ef7[_0x1ba085(0x1f7)],'fields':Array[_0x1ba085(0x1bb)](_0x1b2ef7)};if(_0x478489){const _0x2bed5b=normalizeDatasetIndexes(_0x525853);_0x1a5b23[_0x1ba085(0x1f3)]({'tableName':_0x228ca4,..._0x2bed5b});}}_0xf5b163[_0x1ba085(0x1e2)]>0x0&&(_0x164d94[_0x1ba085(0x1cc)]=_0xf5b163),_0x478489&&(_0x164d94[_0x1ba085(0x1da)]=auditSqlJoinIndexes(_0x2718fc,_0x1a5b23));}return{'ok':_0x1ee882[_0x1ba085(0x1bc)],'data':_0x164d94,'message':_0x1ee882[_0x1ba085(0x1ec)]};}};function normalizeDatasetIndexes(_0x1fb421){const _0x51d8a8=a230_0x5b385f,_0x1d14b8=Array[_0x51d8a8(0x1d6)](_0x1fb421?.[_0x51d8a8(0x1d1)]?.[_0x51d8a8(0x1e0)])?_0x1fb421['dataset'][_0x51d8a8(0x1e0)]:Array[_0x51d8a8(0x1d6)](_0x1fb421?.['indexes'])?_0x1fb421[_0x51d8a8(0x1e0)]:[],_0x19a0a6=_0x1d14b8[_0x51d8a8(0x1b4)](_0x1f96eb=>{const _0x91ae49=_0x51d8a8,_0x11cb12=Array['isArray'](_0x1f96eb?.[_0x91ae49(0x1c2)])?_0x1f96eb[_0x91ae49(0x1c2)]:Array[_0x91ae49(0x1d6)](_0x1f96eb?.[_0x91ae49(0x1e5)])?_0x1f96eb[_0x91ae49(0x1e5)]:Array[_0x91ae49(0x1d6)](_0x1f96eb?.[_0x91ae49(0x1e1)])?_0x1f96eb['columns']:[],_0x4ee5c6=_0x11cb12[_0x91ae49(0x1cd)](_0x375d5d=>typeof _0x375d5d===_0x91ae49(0x1fa))['map'](_0x621b0a=>_0x621b0a[_0x91ae49(0x1ba)]())[_0x91ae49(0x1cd)](Boolean);if(_0x4ee5c6[_0x91ae49(0x1e2)]===0x0)return[];const _0x4c8668=[_0x1f96eb?.[_0x91ae49(0x1b8)],_0x1f96eb?.[_0x91ae49(0x1b9)],_0x1f96eb?.[_0x91ae49(0x1f9)]][_0x91ae49(0x1b6)](_0x50339c=>typeof _0x50339c===_0x91ae49(0x1fa)&&_0x50339c[_0x91ae49(0x1ba)]()),_0x21b709=[_0x1f96eb?.[_0x91ae49(0x1eb)],_0x1f96eb?.[_0x91ae49(0x1ee)]][_0x91ae49(0x1b6)](_0x1fc416=>typeof _0x1fc416===_0x91ae49(0x1fa)&&_0x1fc416[_0x91ae49(0x1ba)]());return[{..._0x4c8668?{'name':_0x4c8668[_0x91ae49(0x1ba)]()}:{},..._0x21b709?{'type':_0x21b709[_0x91ae49(0x1ba)]()}:{},'columns':_0x4ee5c6}];}),_0x53d3be=[..._0x19a0a6],_0x47fe49=typeof _0x1fb421?.[_0x51d8a8(0x1bd)]?.[_0x51d8a8(0x1c7)]==='string'?_0x1fb421[_0x51d8a8(0x1bd)][_0x51d8a8(0x1c7)][_0x51d8a8(0x1ef)](',')[_0x51d8a8(0x1d0)](_0x4de991=>_0x4de991[_0x51d8a8(0x1ba)]())[_0x51d8a8(0x1cd)](Boolean):[];return _0x47fe49[_0x51d8a8(0x1e2)]>0x0&&_0x53d3be['unshift']({'type':_0x51d8a8(0x1e3),'columns':_0x47fe49}),{'indexes':_0x53d3be,'metadataAvailable':_0x19a0a6[_0x51d8a8(0x1e2)]>0x0};}
@@ -1 +1 @@
1
- (function(_0x1ad525,_0x183560){const _0x1d9020=a217_0x5500,_0x4f2075=_0x1ad525();while(!![]){try{const _0x28553c=parseInt(_0x1d9020(0x10b))/0x1+parseInt(_0x1d9020(0x10d))/0x2+-parseInt(_0x1d9020(0x112))/0x3+-parseInt(_0x1d9020(0x113))/0x4+-parseInt(_0x1d9020(0x10f))/0x5*(parseInt(_0x1d9020(0x10c))/0x6)+-parseInt(_0x1d9020(0x10e))/0x7+-parseInt(_0x1d9020(0x110))/0x8*(-parseInt(_0x1d9020(0x111))/0x9);if(_0x28553c===_0x183560)break;else _0x4f2075['push'](_0x4f2075['shift']());}catch(_0x4641a2){_0x4f2075['push'](_0x4f2075['shift']());}}}(a217_0x3252,0x1fb08));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];function a217_0x5500(_0x535a96,_0x560409){_0x535a96=_0x535a96-0x10b;const _0x32525d=a217_0x3252();let _0x55007a=_0x32525d[_0x535a96];return _0x55007a;}function a217_0x3252(){const _0x22b0f2=['1334522TcoyMA','5riQKpf','4014272ShMBbh','9pvEbSH','476676Ihumfi','722444efvqxd','49816Tqgzgx','341826meYTsn','330640TAuvxr'];a217_0x3252=function(){return _0x22b0f2;};return a217_0x3252();}
1
+ function a231_0x240c(_0x11c4e0,_0xafcfde){_0x11c4e0=_0x11c4e0-0x193;const _0x40e349=a231_0x40e3();let _0x240c53=_0x40e349[_0x11c4e0];return _0x240c53;}(function(_0x457dc4,_0x1c24f6){const _0x2c1690=a231_0x240c,_0x2380b6=_0x457dc4();while(!![]){try{const _0x2b8fad=parseInt(_0x2c1690(0x19a))/0x1+parseInt(_0x2c1690(0x198))/0x2+-parseInt(_0x2c1690(0x197))/0x3*(-parseInt(_0x2c1690(0x196))/0x4)+-parseInt(_0x2c1690(0x199))/0x5*(-parseInt(_0x2c1690(0x195))/0x6)+parseInt(_0x2c1690(0x19b))/0x7+parseInt(_0x2c1690(0x194))/0x8+-parseInt(_0x2c1690(0x193))/0x9;if(_0x2b8fad===_0x1c24f6)break;else _0x2380b6['push'](_0x2380b6['shift']());}catch(_0x1903eb){_0x2380b6['push'](_0x2380b6['shift']());}}}(a231_0x40e3,0x8bd27));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];function a231_0x40e3(){const _0x2a3a0b=['1639674XILPZL','780812BemieG','6pAtrtH','122032zshKOe','15ufOQbU','494464RESRkw','5959569IjzGuC','26712972ORSavk','7389832pdAuAu'];a231_0x40e3=function(){return _0x2a3a0b;};return a231_0x40e3();}
@@ -1 +1 @@
1
- const a218_0x1ad049=a218_0x7e26;function a218_0x7e26(_0x403449,_0x17514e){_0x403449=_0x403449-0xfc;const _0xbc8bcd=a218_0xbc8b();let _0x7e26b0=_0xbc8bcd[_0x403449];return _0x7e26b0;}(function(_0x32c42c,_0x428528){const _0x164ff6=a218_0x7e26,_0x4a01c1=_0x32c42c();while(!![]){try{const _0x48e1ef=-parseInt(_0x164ff6(0x10a))/0x1*(-parseInt(_0x164ff6(0x105))/0x2)+-parseInt(_0x164ff6(0x109))/0x3*(parseInt(_0x164ff6(0x116))/0x4)+parseInt(_0x164ff6(0x114))/0x5*(-parseInt(_0x164ff6(0x10c))/0x6)+-parseInt(_0x164ff6(0xfd))/0x7*(parseInt(_0x164ff6(0x115))/0x8)+parseInt(_0x164ff6(0x10d))/0x9*(-parseInt(_0x164ff6(0x100))/0xa)+parseInt(_0x164ff6(0x106))/0xb*(-parseInt(_0x164ff6(0x10b))/0xc)+-parseInt(_0x164ff6(0x117))/0xd*(-parseInt(_0x164ff6(0x113))/0xe);if(_0x48e1ef===_0x428528)break;else _0x4a01c1['push'](_0x4a01c1['shift']());}catch(_0x6454a6){_0x4a01c1['push'](_0x4a01c1['shift']());}}}(a218_0xbc8b,0x50553));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a218_0xbc8b(){const _0x4236cc=['Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','112238KrNbeB','305100wZuGZJ','40wacQHM','2504BMkrvg','1599WLhkzS','taskId','483273JvrLoY','status','trim','161360hdKRDh','string','flagMissing','isTerminal','apiError','361668MpoYNz','11PbgNbn','task-id','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','1878sLFwxh','3kJNMOm','4430244dKJUKg','6ICHDEf','18kkCiwX','str','appCode','compress'];a218_0xbc8b=function(){return _0x4236cc;};return a218_0xbc8b();}export const taskStatus={'service':'task','command':a218_0x1ad049(0xfe),'description':a218_0x1ad049(0x108),'risk':'read','defaultOutputFormat':a218_0x1ad049(0x110),'structuredErrors':!![],'flags':[{'name':'task-id','type':a218_0x1ad049(0x101),'required':!![],'description':a218_0x1ad049(0x112)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1b0fff){const _0x2e5bb2=a218_0x1ad049;if(!_0x1b0fff[_0x2e5bb2(0x10e)](_0x2e5bb2(0x107))[_0x2e5bb2(0xff)]())throw CliErrors[_0x2e5bb2(0x102)](_0x2e5bb2(0x107));},async 'execute'(_0x546699){const _0x3a65e8=a218_0x1ad049,_0x52f38f=_0x546699[_0x3a65e8(0x10e)](_0x3a65e8(0x107))[_0x3a65e8(0xff)](),_0x278cf8=normalizeAsyncTask(await getAsyncTaskStatus(_0x52f38f,_0x546699[_0x3a65e8(0x10f)],_0x546699['cookie']));if(_0x278cf8[_0x3a65e8(0xfc)]!==_0x52f38f)throw CliErrors[_0x3a65e8(0x104)](_0x3a65e8(0x111)+_0x52f38f+',\x20received\x20'+_0x278cf8['taskId']+'.');const _0x140472=buildAsyncTaskStatusCommand(_0x278cf8[_0x3a65e8(0xfc)],_0x546699['appCode']);return{'ok':!![],'message':asyncTaskMessage(_0x278cf8),'data':{'appCode':_0x546699[_0x3a65e8(0x10f)],..._0x278cf8,'query':_0x278cf8[_0x3a65e8(0x103)]?null:{'command':_0x140472}}};}};
1
+ function a232_0x469c(_0x69f09b,_0x5c17e2){_0x69f09b=_0x69f09b-0x9c;const _0x4e2d9c=a232_0x4e2d();let _0x469cd1=_0x4e2d9c[_0x69f09b];return _0x469cd1;}function a232_0x4e2d(){const _0x567d54=['flagMissing','status','3032888oSrMMQ','2896DetPjn','1227516xGNhXz','894876PjVXXa','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','taskId','trim','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','apiError',',\x20received\x20','str','254zscSrQ','3966GywLhz','string','17808BinszL','task-id','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','16928442BzqGUM','363175zzNFEq','appCode','task'];a232_0x4e2d=function(){return _0x567d54;};return a232_0x4e2d();}const a232_0x3c6c87=a232_0x469c;(function(_0x5d7133,_0x417332){const _0xc34e6f=a232_0x469c,_0x5c7be1=_0x5d7133();while(!![]){try{const _0x5bc336=parseInt(_0xc34e6f(0xab))/0x1+-parseInt(_0xc34e6f(0x9c))/0x2*(-parseInt(_0xc34e6f(0x9d))/0x3)+parseInt(_0xc34e6f(0xa8))/0x4+-parseInt(_0xc34e6f(0xa3))/0x5+-parseInt(_0xc34e6f(0xaa))/0x6+parseInt(_0xc34e6f(0x9f))/0x7*(parseInt(_0xc34e6f(0xa9))/0x8)+-parseInt(_0xc34e6f(0xa2))/0x9;if(_0x5bc336===_0x417332)break;else _0x5c7be1['push'](_0x5c7be1['shift']());}catch(_0x2edeb9){_0x5c7be1['push'](_0x5c7be1['shift']());}}}(a232_0x4e2d,0x8e851));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':a232_0x3c6c87(0xa5),'command':a232_0x3c6c87(0xa7),'description':a232_0x3c6c87(0xaf),'risk':'read','defaultOutputFormat':'compress','structuredErrors':!![],'flags':[{'name':a232_0x3c6c87(0xa0),'type':a232_0x3c6c87(0x9e),'required':!![],'description':a232_0x3c6c87(0xa1)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x434002){const _0x40c365=a232_0x3c6c87;if(!_0x434002[_0x40c365(0xb2)](_0x40c365(0xa0))['trim']())throw CliErrors[_0x40c365(0xa6)](_0x40c365(0xa0));},async 'execute'(_0x826aba){const _0x890181=a232_0x3c6c87,_0x49b142=_0x826aba[_0x890181(0xb2)](_0x890181(0xa0))[_0x890181(0xae)](),_0x303086=normalizeAsyncTask(await getAsyncTaskStatus(_0x49b142,_0x826aba[_0x890181(0xa4)],_0x826aba['cookie']));if(_0x303086[_0x890181(0xad)]!==_0x49b142)throw CliErrors[_0x890181(0xb0)](_0x890181(0xac)+_0x49b142+_0x890181(0xb1)+_0x303086[_0x890181(0xad)]+'.');const _0x461682=buildAsyncTaskStatusCommand(_0x303086[_0x890181(0xad)],_0x826aba[_0x890181(0xa4)]);return{'ok':!![],'message':asyncTaskMessage(_0x303086),'data':{'appCode':_0x826aba[_0x890181(0xa4)],..._0x303086,'query':_0x303086['isTerminal']?null:{'command':_0x461682}}};}};
@@ -1 +1 @@
1
- function a219_0x3118(){const _0x3333f7=['11FuOOZx','750651aOsqwy','2913ItkvxH','2360430pQZVGr','5702988tFvsOf','4muXeUs','1174435IEEMyp','138RxFwME','308HvYhbp','8fwTzki','36048dZdpcO','1580733xQPSMC'];a219_0x3118=function(){return _0x3333f7;};return a219_0x3118();}(function(_0x3c6d8e,_0x16c66b){const _0x136700=a219_0x4f21,_0x2b8c3a=_0x3c6d8e();while(!![]){try{const _0x4ee0ad=parseInt(_0x136700(0x14e))/0x1*(-parseInt(_0x136700(0x147))/0x2)+parseInt(_0x136700(0x14d))/0x3*(parseInt(_0x136700(0x145))/0x4)+-parseInt(_0x136700(0x146))/0x5+parseInt(_0x136700(0x14a))/0x6*(parseInt(_0x136700(0x148))/0x7)+parseInt(_0x136700(0x149))/0x8*(-parseInt(_0x136700(0x14b))/0x9)+-parseInt(_0x136700(0x14f))/0xa*(parseInt(_0x136700(0x14c))/0xb)+parseInt(_0x136700(0x144))/0xc;if(_0x4ee0ad===_0x16c66b)break;else _0x2b8c3a['push'](_0x2b8c3a['shift']());}catch(_0x100f03){_0x2b8c3a['push'](_0x2b8c3a['shift']());}}}(a219_0x3118,0x22bae));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a219_0x4f21(_0x4e28b2,_0x48c19d){_0x4e28b2=_0x4e28b2-0x144;const _0x3118d8=a219_0x3118();let _0x4f21b3=_0x3118d8[_0x4e28b2];return _0x4f21b3;}export const tenantDefinitions=[tenantMembersListDefinition];
1
+ (function(_0x55c600,_0x3fe815){const _0x2bcdda=a233_0x1cfc,_0x2fe5df=_0x55c600();while(!![]){try{const _0x393fae=parseInt(_0x2bcdda(0x1e5))/0x1+-parseInt(_0x2bcdda(0x1dc))/0x2*(parseInt(_0x2bcdda(0x1e0))/0x3)+-parseInt(_0x2bcdda(0x1e2))/0x4*(-parseInt(_0x2bcdda(0x1e6))/0x5)+parseInt(_0x2bcdda(0x1e1))/0x6*(-parseInt(_0x2bcdda(0x1df))/0x7)+parseInt(_0x2bcdda(0x1e4))/0x8*(parseInt(_0x2bcdda(0x1de))/0x9)+-parseInt(_0x2bcdda(0x1dd))/0xa+parseInt(_0x2bcdda(0x1e3))/0xb;if(_0x393fae===_0x3fe815)break;else _0x2fe5df['push'](_0x2fe5df['shift']());}catch(_0x3abdce){_0x2fe5df['push'](_0x2fe5df['shift']());}}}(a233_0x80f5,0xa307f));function a233_0x1cfc(_0xe916f8,_0x3cb3d7){_0xe916f8=_0xe916f8-0x1dc;const _0x80f52d=a233_0x80f5();let _0x1cfcdb=_0x80f52d[_0xe916f8];return _0x1cfcdb;}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];function a233_0x80f5(){const _0x2741f4=['147VwJdXA','135858bsmpVb','260220MxveaM','2680kyNJZv','19957707eXDZLo','104hnpMkq','549009fGAcdg','7610LyaGmi','42zNukkI','11485440TivoFo','204237NMMAjr'];a233_0x80f5=function(){return _0x2741f4;};return a233_0x80f5();}
@@ -1 +1 @@
1
- function a220_0x5dad(){const _0x5a7be7=['Exact\x20tenant\x20code','length','1196ZczyUf','16kKoGMt','501083NyWwzh','36358BSDDlD','190qrQiAt','591806Fgvmbr','read','tenant','205735CwXoTd','str','trim','3489QcXXnD','\x20tenant\x20member(s)','flagMissing','members-list','288NeNIvl','2127525MlsCNI','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','Pass\x20--tenant-code\x20<code>.','tenant-code','Found\x20','1386963nXIWeF'];a220_0x5dad=function(){return _0x5a7be7;};return a220_0x5dad();}const a220_0x220cce=a220_0x5597;(function(_0xe3424,_0x420d08){const _0x28236f=a220_0x5597,_0x31f2de=_0xe3424();while(!![]){try{const _0x3d8204=-parseInt(_0x28236f(0x100))/0x1+parseInt(_0x28236f(0xfd))/0x2+parseInt(_0x28236f(0x103))/0x3*(-parseInt(_0x28236f(0xf8))/0x4)+-parseInt(_0x28236f(0x108))/0x5+-parseInt(_0x28236f(0x107))/0x6*(parseInt(_0x28236f(0xfb))/0x7)+parseInt(_0x28236f(0xf9))/0x8*(parseInt(_0x28236f(0xf5))/0x9)+-parseInt(_0x28236f(0xfc))/0xa*(-parseInt(_0x28236f(0xfa))/0xb);if(_0x3d8204===_0x420d08)break;else _0x31f2de['push'](_0x31f2de['shift']());}catch(_0x464c14){_0x31f2de['push'](_0x31f2de['shift']());}}}(a220_0x5dad,0x3aeb7));function a220_0x5597(_0x546f2d,_0xca27b3){_0x546f2d=_0x546f2d-0xf2;const _0x5dadda=a220_0x5dad();let _0x55974b=_0x5dadda[_0x546f2d];return _0x55974b;}import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a220_0x220cce(0xff),'command':a220_0x220cce(0x106),'description':a220_0x220cce(0x109),'risk':a220_0x220cce(0xfe),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a220_0x220cce(0xf3),'type':'string','required':!![],'description':a220_0x220cce(0xf6)}],async 'validate'(_0x38bf16){const _0x46cd1d=a220_0x220cce;if(!_0x38bf16[_0x46cd1d(0x101)](_0x46cd1d(0xf3))['trim']())throw CliErrors[_0x46cd1d(0x105)](_0x46cd1d(0xf3),_0x46cd1d(0xf2));},async 'execute'(_0x554496){const _0x235fd9=a220_0x220cce,_0x95ced=_0x554496[_0x235fd9(0x101)]('tenant-code')[_0x235fd9(0x102)](),_0x269f5c=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x95ced,_0x269f5c);const _0x411662=projectTenantMembers(await listTenantDirectoryMembers(_0x95ced));return{'ok':!![],'data':{'tenantCode':_0x95ced,'items':_0x411662,'totalCount':_0x411662[_0x235fd9(0xf7)]},'message':_0x235fd9(0xf4)+_0x411662[_0x235fd9(0xf7)]+_0x235fd9(0x104)};}};
1
+ const a234_0x1c68c2=a234_0x40c1;(function(_0x3b12e8,_0x57c5b6){const _0x4954fc=a234_0x40c1,_0x520dda=_0x3b12e8();while(!![]){try{const _0x3cb523=parseInt(_0x4954fc(0xa4))/0x1+parseInt(_0x4954fc(0x94))/0x2*(parseInt(_0x4954fc(0xa1))/0x3)+parseInt(_0x4954fc(0x9a))/0x4+parseInt(_0x4954fc(0x95))/0x5*(-parseInt(_0x4954fc(0xa8))/0x6)+-parseInt(_0x4954fc(0x9e))/0x7*(parseInt(_0x4954fc(0xa0))/0x8)+-parseInt(_0x4954fc(0x96))/0x9+parseInt(_0x4954fc(0xa6))/0xa;if(_0x3cb523===_0x57c5b6)break;else _0x520dda['push'](_0x520dda['shift']());}catch(_0x121d73){_0x520dda['push'](_0x520dda['shift']());}}}(a234_0x2166,0x8ebc7));function a234_0x40c1(_0x320b81,_0x1a765a){_0x320b81=_0x320b81-0x93;const _0x2166f1=a234_0x2166();let _0x40c163=_0x2166f1[_0x320b81];return _0x40c163;}import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a234_0x2166(){const _0x5cfc69=['string','flagMissing','Found\x20','3206756xnGVcS','str','members-list','Exact\x20tenant\x20code','7hYNGoK','trim','1805032ytznMt','78513PITuFi','\x20tenant\x20member(s)','read','355898XAtOlx','Pass\x20--tenant-code\x20<code>.','10958980lJilaq','length','3180444RDlArA','tenant-code','tenant','8qymZpd','5ZGCBZN','9160371jwMcBh'];a234_0x2166=function(){return _0x5cfc69;};return a234_0x2166();}import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a234_0x1c68c2(0x93),'command':a234_0x1c68c2(0x9c),'description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':a234_0x1c68c2(0xa3),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a234_0x1c68c2(0xa9),'type':a234_0x1c68c2(0x97),'required':!![],'description':a234_0x1c68c2(0x9d)}],async 'validate'(_0x3b6d57){const _0xf7a754=a234_0x1c68c2;if(!_0x3b6d57[_0xf7a754(0x9b)](_0xf7a754(0xa9))[_0xf7a754(0x9f)]())throw CliErrors[_0xf7a754(0x98)](_0xf7a754(0xa9),_0xf7a754(0xa5));},async 'execute'(_0x2af82f){const _0x3c9f1a=a234_0x1c68c2,_0x23f37a=_0x2af82f['str'](_0x3c9f1a(0xa9))[_0x3c9f1a(0x9f)](),_0x32d1ef=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x23f37a,_0x32d1ef);const _0x617b60=projectTenantMembers(await listTenantDirectoryMembers(_0x23f37a));return{'ok':!![],'data':{'tenantCode':_0x23f37a,'items':_0x617b60,'totalCount':_0x617b60[_0x3c9f1a(0xa7)]},'message':_0x3c9f1a(0x99)+_0x617b60[_0x3c9f1a(0xa7)]+_0x3c9f1a(0xa2)};}};
@@ -1 +1 @@
1
- (function(_0x371c5d,_0x5350b5){const _0x562487=a221_0xdc69,_0x409eb9=_0x371c5d();while(!![]){try{const _0x1c226f=parseInt(_0x562487(0x136))/0x1+parseInt(_0x562487(0x13f))/0x2*(-parseInt(_0x562487(0x12e))/0x3)+-parseInt(_0x562487(0x144))/0x4*(-parseInt(_0x562487(0x131))/0x5)+parseInt(_0x562487(0x13b))/0x6+parseInt(_0x562487(0x149))/0x7+parseInt(_0x562487(0x147))/0x8*(parseInt(_0x562487(0x13e))/0x9)+parseInt(_0x562487(0x137))/0xa*(-parseInt(_0x562487(0x13a))/0xb);if(_0x1c226f===_0x5350b5)break;else _0x409eb9['push'](_0x409eb9['shift']());}catch(_0x96e2e1){_0x409eb9['push'](_0x409eb9['shift']());}}}(a221_0x2a9e,0x2f7c3));function a221_0x2a9e(){const _0x52bdb6=['ADMIN','status','1749yYUxoS','sort','adminFlag','35aRfCQP','Tenant\x20\x22','userId','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','displayName','336608fJIWiQ','510BvaVgs','tenantCode','values','111991dgXqym','799686ipWyAg','isFinite','trim','9iqzNir','652LfPlTQ','role','nickname','validation','set','133412fqZrvd','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','username','872232REOayL','some','639793LxARVA'];a221_0x2a9e=function(){return _0x52bdb6;};return a221_0x2a9e();}function a221_0xdc69(_0x5320fb,_0x1e8141){_0x5320fb=_0x5320fb-0x12c;const _0x2a9e34=a221_0x2a9e();let _0xdc69c0=_0x2a9e34[_0x5320fb];return _0xdc69c0;}import{CliErrors}from'../../errors.js';function textOrNull(_0x296b59){const _0xba809e=a221_0xdc69,_0x1db228=_0x296b59?.[_0xba809e(0x13d)]();return _0x1db228?_0x1db228:null;}export function projectTenantMembers(_0x17fa34){const _0x348bce=a221_0xdc69,_0x38f1bf=new Map();for(const _0x3a9df0 of _0x17fa34){const _0x5cbe42=Number(_0x3a9df0[_0x348bce(0x133)]);if(!Number[_0x348bce(0x13c)](_0x5cbe42)||_0x5cbe42<=0x0)continue;const _0x19f2da={'userId':_0x5cbe42,'username':textOrNull(_0x3a9df0[_0x348bce(0x146)]),'displayName':textOrNull(_0x3a9df0[_0x348bce(0x141)]),'role':_0x3a9df0[_0x348bce(0x130)]===!![]?'ADMIN':'MEMBER','status':textOrNull(_0x3a9df0[_0x348bce(0x12d)])},_0x4ac9ec=_0x38f1bf['get'](_0x5cbe42);if(!_0x4ac9ec){_0x38f1bf[_0x348bce(0x143)](_0x5cbe42,_0x19f2da);continue;}_0x4ac9ec[_0x348bce(0x146)]??=_0x19f2da[_0x348bce(0x146)],_0x4ac9ec['displayName']??=_0x19f2da[_0x348bce(0x135)],_0x4ac9ec[_0x348bce(0x12d)]??=_0x19f2da[_0x348bce(0x12d)];if(_0x19f2da[_0x348bce(0x140)]===_0x348bce(0x12c))_0x4ac9ec[_0x348bce(0x140)]='ADMIN';}return[..._0x38f1bf[_0x348bce(0x139)]()][_0x348bce(0x12f)]((_0x30a22b,_0x1fad7f)=>_0x30a22b[_0x348bce(0x133)]-_0x1fad7f['userId']);}export function assertTenantAccessible(_0x3fb6e6,_0x34bd11){const _0x1971b2=a221_0xdc69;if(_0x34bd11[_0x1971b2(0x148)](_0x4a0143=>_0x4a0143[_0x1971b2(0x138)]===_0x3fb6e6))return;throw CliErrors[_0x1971b2(0x142)](_0x1971b2(0x132)+_0x3fb6e6+_0x1971b2(0x145),_0x1971b2(0x134));}
1
+ function a235_0x3c43(){const _0xb23f69=['36603900vRvNpx','nickname','30kuIFLQ','MEMBER','userId','validation','sort','1846831XLxtmf','role','434818dmunzy','values','1160706ukdvUg','81eZBDHy','get','adminFlag','844696YICldW','displayName','ADMIN','isFinite','status','username','5792095xhvJcl','Tenant\x20\x22','4eumACS','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','4yJQzcQ','49370uQvkzi','some','363RtNgNL','set','trim'];a235_0x3c43=function(){return _0xb23f69;};return a235_0x3c43();}function a235_0x11ff(_0x1e6268,_0x44494b){_0x1e6268=_0x1e6268-0x179;const _0x3c4348=a235_0x3c43();let _0x11ffb6=_0x3c4348[_0x1e6268];return _0x11ffb6;}(function(_0x301501,_0x5783e5){const _0x4275a8=a235_0x11ff,_0x5b1280=_0x301501();while(!![]){try{const _0x49360f=-parseInt(_0x4275a8(0x181))/0x1*(-parseInt(_0x4275a8(0x190))/0x2)+-parseInt(_0x4275a8(0x192))/0x3+-parseInt(_0x4275a8(0x17f))/0x4*(-parseInt(_0x4275a8(0x17d))/0x5)+parseInt(_0x4275a8(0x189))/0x6*(parseInt(_0x4275a8(0x18e))/0x7)+-parseInt(_0x4275a8(0x196))/0x8*(-parseInt(_0x4275a8(0x193))/0x9)+-parseInt(_0x4275a8(0x182))/0xa*(parseInt(_0x4275a8(0x184))/0xb)+-parseInt(_0x4275a8(0x187))/0xc;if(_0x49360f===_0x5783e5)break;else _0x5b1280['push'](_0x5b1280['shift']());}catch(_0x4cb7a0){_0x5b1280['push'](_0x5b1280['shift']());}}}(a235_0x3c43,0xaa40b));import{CliErrors}from'../../errors.js';function textOrNull(_0x4dd0bc){const _0xea068b=a235_0x11ff,_0x7409fa=_0x4dd0bc?.[_0xea068b(0x186)]();return _0x7409fa?_0x7409fa:null;}export function projectTenantMembers(_0x3e9be3){const _0x150f4a=a235_0x11ff,_0x20697b=new Map();for(const _0x125f55 of _0x3e9be3){const _0x372051=Number(_0x125f55[_0x150f4a(0x18b)]);if(!Number[_0x150f4a(0x17a)](_0x372051)||_0x372051<=0x0)continue;const _0x55bd7a={'userId':_0x372051,'username':textOrNull(_0x125f55[_0x150f4a(0x17c)]),'displayName':textOrNull(_0x125f55[_0x150f4a(0x188)]),'role':_0x125f55[_0x150f4a(0x195)]===!![]?_0x150f4a(0x179):_0x150f4a(0x18a),'status':textOrNull(_0x125f55[_0x150f4a(0x17b)])},_0x32d534=_0x20697b[_0x150f4a(0x194)](_0x372051);if(!_0x32d534){_0x20697b[_0x150f4a(0x185)](_0x372051,_0x55bd7a);continue;}_0x32d534[_0x150f4a(0x17c)]??=_0x55bd7a[_0x150f4a(0x17c)],_0x32d534[_0x150f4a(0x197)]??=_0x55bd7a['displayName'],_0x32d534[_0x150f4a(0x17b)]??=_0x55bd7a[_0x150f4a(0x17b)];if(_0x55bd7a[_0x150f4a(0x18f)]==='ADMIN')_0x32d534['role']='ADMIN';}return[..._0x20697b[_0x150f4a(0x191)]()][_0x150f4a(0x18d)]((_0x98028f,_0x2d8080)=>_0x98028f['userId']-_0x2d8080[_0x150f4a(0x18b)]);}export function assertTenantAccessible(_0x71c386,_0x5c0152){const _0x4c06f0=a235_0x11ff;if(_0x5c0152[_0x4c06f0(0x183)](_0x191c96=>_0x191c96['tenantCode']===_0x71c386))return;throw CliErrors[_0x4c06f0(0x18c)](_0x4c06f0(0x17e)+_0x71c386+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.',_0x4c06f0(0x180));}
@@ -1 +1 @@
1
- const a222_0xb52d8=a222_0x583d;function a222_0x583d(_0x270747,_0x4d6ccd){_0x270747=_0x270747-0x78;const _0xc8a9e7=a222_0xc8a9();let _0x583d29=_0xc8a9e7[_0x270747];return _0x583d29;}function a222_0xc8a9(){const _0x333ca3=['1278968mJpsTs','dingtalk','bind','49SSXqIh','user-account','string','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','32pFPqoW','5fdqpws','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','5360580KHGbYB','write','1169464uQgUlO','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','POST','trim','validation','60NitRDO','48010WUKbVg','ding-talk-user-id','26098127TdKwpS','241578sRrsbP','4793874BRwXlJ','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','str','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','apiError'];a222_0xc8a9=function(){return _0x333ca3;};return a222_0xc8a9();}(function(_0x21efad,_0x31700c){const _0x28329a=a222_0x583d,_0x5d2391=_0x21efad();while(!![]){try{const _0x2b86e6=-parseInt(_0x28329a(0x7d))/0x1*(parseInt(_0x28329a(0x8e))/0x2)+parseInt(_0x28329a(0x81))/0x3+-parseInt(_0x28329a(0x87))/0x4*(parseInt(_0x28329a(0x8f))/0x5)+-parseInt(_0x28329a(0x91))/0x6+parseInt(_0x28329a(0x8a))/0x7*(-parseInt(_0x28329a(0x93))/0x8)+-parseInt(_0x28329a(0x80))/0x9*(parseInt(_0x28329a(0x7c))/0xa)+parseInt(_0x28329a(0x7f))/0xb;if(_0x2b86e6===_0x31700c)break;else _0x5d2391['push'](_0x5d2391['shift']());}catch(_0x287b5b){_0x5d2391['push'](_0x5d2391['shift']());}}}(a222_0xc8a9,0xc47f2));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a222_0xb52d8(0x88),CURRENT_BINDING_WARNING=a222_0xb52d8(0x90);function readDingTalkUserId(_0xcab41f){const _0x2d429f=a222_0xb52d8,_0x2352a1=_0xcab41f[_0x2d429f(0x84)](_0x2d429f(0x7e))[_0x2d429f(0x7a)]();if(!_0x2352a1)throw CliErrors[_0x2d429f(0x7b)]('--ding-talk-user-id\x20cannot\x20be\x20empty.',_0x2d429f(0x78));return _0x2352a1;}function buildBindingData(_0x170302,_0x58b46e){const _0x5a59a2=a222_0xb52d8;return{'operation':_0x5a59a2(0x89),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x170302},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x170302,'bound':!![]},'dryRun':_0x58b46e,'backend':{'method':_0x5a59a2(0x79),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a222_0xb52d8(0x8b),'command':'dingding-sandbox-bind','description':a222_0xb52d8(0x8d),'risk':a222_0xb52d8(0x92),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a222_0xb52d8(0x7e),'type':a222_0xb52d8(0x8c),'required':!![],'description':a222_0xb52d8(0x83)}],async 'validate'(_0x5c6b7b){readDingTalkUserId(_0x5c6b7b);},async 'dryRun'(_0x54fe83){const _0x5df6fd=a222_0xb52d8,_0xff1cbc=readDingTalkUserId(_0x54fe83);return asDryRunResult(buildBindingData(_0xff1cbc,!![]),{'method':_0x5df6fd(0x79),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x2988bf){const _0x270422=a222_0xb52d8,_0x4e9d24=readDingTalkUserId(_0x2988bf),_0x46c798=await bindDingTalkSandboxAccount(_0x4e9d24);if(_0x46c798!==!![])throw CliErrors[_0x270422(0x86)]('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x270422(0x82));return{'ok':!![],'data':buildBindingData(_0x4e9d24,![]),'message':_0x270422(0x85)};}};
1
+ function a236_0x147a(_0x34d5ae,_0x83d7ee){_0x34d5ae=_0x34d5ae-0x18a;const _0x15f8b1=a236_0x15f8();let _0x147a00=_0x15f8b1[_0x34d5ae];return _0x147a00;}const a236_0x506043=a236_0x147a;(function(_0x323f0e,_0x36bd07){const _0x16dc68=a236_0x147a,_0x3fba17=_0x323f0e();while(!![]){try{const _0x260654=parseInt(_0x16dc68(0x19b))/0x1+parseInt(_0x16dc68(0x19f))/0x2+parseInt(_0x16dc68(0x18b))/0x3*(parseInt(_0x16dc68(0x198))/0x4)+parseInt(_0x16dc68(0x19a))/0x5+-parseInt(_0x16dc68(0x192))/0x6+parseInt(_0x16dc68(0x195))/0x7+-parseInt(_0x16dc68(0x18a))/0x8;if(_0x260654===_0x36bd07)break;else _0x3fba17['push'](_0x3fba17['shift']());}catch(_0x915157){_0x3fba17['push'](_0x3fba17['shift']());}}}(a236_0x15f8,0x6f360));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';function a236_0x15f8(){const _0x2c37ac=['158962umZlgA','21760jwuKTi','141lydZaZ','validation','apiError','--ding-talk-user-id\x20cannot\x20be\x20empty.','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','ding-talk-user-id','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','2371944qeFXjk','str','POST','1123983cigDhd','string','bind','41284CiEtpB','dingding-sandbox-bind','370970denQwQ','54233gelqQT','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','trim','write'];a236_0x15f8=function(){return _0x2c37ac;};return a236_0x15f8();}import{CliErrors}from'../../errors.js';const PROVIDER_ID='dingtalk',CURRENT_BINDING_WARNING=a236_0x506043(0x19c);function readDingTalkUserId(_0x4de5f7){const _0xce9513=a236_0x506043,_0x2cc73a=_0x4de5f7[_0xce9513(0x193)](_0xce9513(0x190))[_0xce9513(0x19d)]();if(!_0x2cc73a)throw CliErrors[_0xce9513(0x18c)](_0xce9513(0x18e),'Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.');return _0x2cc73a;}function buildBindingData(_0x3e328b,_0x41c96e){const _0x181ecc=a236_0x506043;return{'operation':_0x181ecc(0x197),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x3e328b},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x3e328b,'bound':!![]},'dryRun':_0x41c96e,'backend':{'method':_0x181ecc(0x194),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':'user-account','command':a236_0x506043(0x199),'description':a236_0x506043(0x191),'risk':a236_0x506043(0x19e),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a236_0x506043(0x190),'type':a236_0x506043(0x196),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0x2a2a34){readDingTalkUserId(_0x2a2a34);},async 'dryRun'(_0x5d8ba9){const _0x57d958=readDingTalkUserId(_0x5d8ba9);return asDryRunResult(buildBindingData(_0x57d958,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x3752bc){const _0x141375=a236_0x506043,_0x39bbb5=readDingTalkUserId(_0x3752bc),_0x348aea=await bindDingTalkSandboxAccount(_0x39bbb5);if(_0x348aea!==!![])throw CliErrors[_0x141375(0x18d)]('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x141375(0x18f));return{'ok':!![],'data':buildBindingData(_0x39bbb5,![]),'message':'Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'};}};