@lovrabet/rabetbase-cli 2.5.5-beta.3 → 2.5.6-beta.1

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 (375) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/api-group.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.js +1 -1
  6. package/lib/api/legacy-api-file.js +1 -1
  7. package/lib/api/model-registry-file.js +1 -1
  8. package/lib/api/model-registry-scaffold.js +1 -1
  9. package/lib/api/model-source.js +1 -1
  10. package/lib/auth/auth-server-ui.js +1 -1
  11. package/lib/auth/auth-server.js +1 -1
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.js +1 -1
  14. package/lib/auth/get-session-user.js +1 -1
  15. package/lib/auth/is-session-valid.js +1 -1
  16. package/lib/auth/login-success-html.js +1 -1
  17. package/lib/auth/logout.js +1 -1
  18. package/lib/cli-flags.js +1 -1
  19. package/lib/cli.js +1 -1
  20. package/lib/commands/api/generate.js +1 -1
  21. package/lib/commands/api/index.js +1 -1
  22. package/lib/commands/api/list.js +1 -1
  23. package/lib/commands/api/pull.js +1 -1
  24. package/lib/commands/api/shared.js +1 -1
  25. package/lib/commands/app/detail.js +1 -1
  26. package/lib/commands/app/index.js +1 -1
  27. package/lib/commands/app/list.js +1 -1
  28. package/lib/commands/app/members-list.js +1 -1
  29. package/lib/commands/app/remote-directory.js +1 -1
  30. package/lib/commands/app/shared.js +1 -1
  31. package/lib/commands/app-config/delete.js +1 -1
  32. package/lib/commands/app-config/get.js +1 -1
  33. package/lib/commands/app-config/index.js +1 -1
  34. package/lib/commands/app-config/list.js +1 -1
  35. package/lib/commands/app-config/set.js +1 -1
  36. package/lib/commands/app-config/shared.js +1 -1
  37. package/lib/commands/auth/index.js +1 -1
  38. package/lib/commands/bff/create.js +1 -1
  39. package/lib/commands/bff/delete.js +1 -1
  40. package/lib/commands/bff/detail.js +1 -1
  41. package/lib/commands/bff/index.js +1 -1
  42. package/lib/commands/bff/list.js +1 -1
  43. package/lib/commands/bff/logs.js +1 -1
  44. package/lib/commands/bff/pull.js +1 -1
  45. package/lib/commands/bff/push.js +1 -1
  46. package/lib/commands/bff/status.js +1 -1
  47. package/lib/commands/cli-skill/index.js +1 -1
  48. package/lib/commands/cli-update.js +1 -1
  49. package/lib/commands/codegen/index.js +1 -1
  50. package/lib/commands/codegen/sdk.js +1 -1
  51. package/lib/commands/codegen/sql.js +1 -1
  52. package/lib/commands/common/app-registry.js +1 -1
  53. package/lib/commands/common/app-selector.js +1 -1
  54. package/lib/commands/common/async-task.js +1 -1
  55. package/lib/commands/common/dry-run.js +1 -1
  56. package/lib/commands/common/flags.js +1 -1
  57. package/lib/commands/common/local-file.js +1 -1
  58. package/lib/commands/common/validate.js +1 -1
  59. package/lib/commands/config/delete.js +1 -1
  60. package/lib/commands/config/get.js +1 -1
  61. package/lib/commands/config/index.js +1 -1
  62. package/lib/commands/config/init.js +1 -1
  63. package/lib/commands/config/list.js +1 -1
  64. package/lib/commands/config/set.js +1 -1
  65. package/lib/commands/config/shared.js +1 -1
  66. package/lib/commands/dataset/batch-design.js +1 -1
  67. package/lib/commands/dataset/business-group-update.js +1 -1
  68. package/lib/commands/dataset/business-groups.js +1 -1
  69. package/lib/commands/dataset/capability.js +1 -1
  70. package/lib/commands/dataset/cross-relation-create.js +1 -1
  71. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  72. package/lib/commands/dataset/cross-relation-list.js +1 -1
  73. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  74. package/lib/commands/dataset/cross-relation-update.js +1 -1
  75. package/lib/commands/dataset/delete.js +1 -1
  76. package/lib/commands/dataset/detail.js +1 -1
  77. package/lib/commands/dataset/extend-update.js +1 -1
  78. package/lib/commands/dataset/field-restore.js +1 -1
  79. package/lib/commands/dataset/field-update.js +1 -1
  80. package/lib/commands/dataset/generate.js +1 -1
  81. package/lib/commands/dataset/index.js +1 -1
  82. package/lib/commands/dataset/list.js +1 -1
  83. package/lib/commands/dataset/operations.js +1 -1
  84. package/lib/commands/dataset/relation-audit.js +1 -1
  85. package/lib/commands/dataset/relation-create.js +1 -1
  86. package/lib/commands/dataset/relation-delete.js +1 -1
  87. package/lib/commands/dataset/relation-shared.js +1 -1
  88. package/lib/commands/dataset/relation-update.js +1 -1
  89. package/lib/commands/dataset/relations.js +1 -1
  90. package/lib/commands/dataset/rename.js +1 -1
  91. package/lib/commands/dataset/restore.js +1 -1
  92. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  93. package/lib/commands/db/analysis-batching.js +1 -1
  94. package/lib/commands/db/analyze-batch-plan.js +1 -1
  95. package/lib/commands/db/analyze-cancel.js +1 -1
  96. package/lib/commands/db/analyze-start.js +1 -1
  97. package/lib/commands/db/analyze-status.js +1 -1
  98. package/lib/commands/db/create.js +1 -1
  99. package/lib/commands/db/cross-db-analysis-shared.d.ts +40 -0
  100. package/lib/commands/db/cross-db-analysis-shared.js +1 -0
  101. package/lib/commands/db/cross-db-analyze-latest.d.ts +2 -0
  102. package/lib/commands/db/cross-db-analyze-latest.js +1 -0
  103. package/lib/commands/db/cross-db-analyze-start.d.ts +2 -0
  104. package/lib/commands/db/cross-db-analyze-start.js +1 -0
  105. package/lib/commands/db/cross-db-analyze-status.d.ts +2 -0
  106. package/lib/commands/db/cross-db-analyze-status.js +1 -0
  107. package/lib/commands/db/delete.js +1 -1
  108. package/lib/commands/db/detail.js +1 -1
  109. package/lib/commands/db/diff-refresh-start.js +1 -1
  110. package/lib/commands/db/diff-refresh-status.js +1 -1
  111. package/lib/commands/db/diff.js +1 -1
  112. package/lib/commands/db/index.js +1 -1
  113. package/lib/commands/db/list.js +1 -1
  114. package/lib/commands/db/shared.js +1 -1
  115. package/lib/commands/db/table-diff-shared.js +1 -1
  116. package/lib/commands/db/tables.js +1 -1
  117. package/lib/commands/db/test.js +1 -1
  118. package/lib/commands/db/update.js +1 -1
  119. package/lib/commands/deployment/index.js +1 -1
  120. package/lib/commands/deployment/sync-all.js +1 -1
  121. package/lib/commands/deployment/sync-jobs.js +1 -1
  122. package/lib/commands/deployment/sync-status.js +1 -1
  123. package/lib/commands/doctor.js +1 -1
  124. package/lib/commands/file/index.js +1 -1
  125. package/lib/commands/flow/create.js +1 -1
  126. package/lib/commands/flow/detail.js +1 -1
  127. package/lib/commands/flow/index.js +1 -1
  128. package/lib/commands/flow/list.js +1 -1
  129. package/lib/commands/flow/publish.js +1 -1
  130. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  131. package/lib/commands/flow/runtime-role-list.js +1 -1
  132. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  133. package/lib/commands/flow/runtime-user-search.js +1 -1
  134. package/lib/commands/flow/shared.js +1 -1
  135. package/lib/commands/flow/update.js +1 -1
  136. package/lib/commands/flow/validate.js +1 -1
  137. package/lib/commands/instant-api-policy/current.js +1 -1
  138. package/lib/commands/instant-api-policy/index.js +1 -1
  139. package/lib/commands/instant-api-policy/init.js +1 -1
  140. package/lib/commands/instant-api-policy/publish.js +1 -1
  141. package/lib/commands/instant-api-policy/pull.js +1 -1
  142. package/lib/commands/instant-api-policy/revision.js +1 -1
  143. package/lib/commands/instant-api-policy/revisions.js +1 -1
  144. package/lib/commands/instant-api-policy/rollback.js +1 -1
  145. package/lib/commands/instant-api-policy/shared.js +1 -1
  146. package/lib/commands/instant-api-policy/validate.js +1 -1
  147. package/lib/commands/issue/index.js +1 -1
  148. package/lib/commands/issue/nudge.js +1 -1
  149. package/lib/commands/issue/report.js +1 -1
  150. package/lib/commands/issue/shared.js +1 -1
  151. package/lib/commands/kb/create.js +1 -1
  152. package/lib/commands/kb/delete.js +1 -1
  153. package/lib/commands/kb/detail.js +1 -1
  154. package/lib/commands/kb/index.js +1 -1
  155. package/lib/commands/kb/list.js +1 -1
  156. package/lib/commands/kb/search.js +1 -1
  157. package/lib/commands/kb/shared.js +1 -1
  158. package/lib/commands/kb/update.js +1 -1
  159. package/lib/commands/logs/index.js +1 -1
  160. package/lib/commands/menu/asset-update.js +1 -1
  161. package/lib/commands/menu/delete.js +1 -1
  162. package/lib/commands/menu/external-link-create.js +1 -1
  163. package/lib/commands/menu/external-link-update.js +1 -1
  164. package/lib/commands/menu/group-create.js +1 -1
  165. package/lib/commands/menu/group-update.js +1 -1
  166. package/lib/commands/menu/index.js +1 -1
  167. package/lib/commands/menu/list.js +1 -1
  168. package/lib/commands/menu/move.js +1 -1
  169. package/lib/commands/menu/regroup-start.js +1 -1
  170. package/lib/commands/menu/rename.js +1 -1
  171. package/lib/commands/menu/shared/compare-table.js +1 -1
  172. package/lib/commands/menu/shared/delete-plan.js +1 -1
  173. package/lib/commands/menu/shared/facts.js +1 -1
  174. package/lib/commands/menu/shared/index.js +1 -1
  175. package/lib/commands/menu/shared/inquirer.js +1 -1
  176. package/lib/commands/menu/shared/local-pages.js +1 -1
  177. package/lib/commands/menu/shared/logic.js +1 -1
  178. package/lib/commands/menu/shared/mutations.js +1 -1
  179. package/lib/commands/menu/shared/path.js +1 -1
  180. package/lib/commands/menu/shared/service.js +1 -1
  181. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  182. package/lib/commands/menu/shared/sync-core.js +1 -1
  183. package/lib/commands/menu/shared/update-core.js +1 -1
  184. package/lib/commands/menu/shared/valid-url.js +1 -1
  185. package/lib/commands/menu/subapp-assets-status.js +1 -1
  186. package/lib/commands/menu/subapp-assets-update.js +1 -1
  187. package/lib/commands/menu/sync.js +1 -1
  188. package/lib/commands/menu/visibility-update.js +1 -1
  189. package/lib/commands/notification/config-create.js +1 -1
  190. package/lib/commands/notification/config-delete.js +1 -1
  191. package/lib/commands/notification/config-list.js +1 -1
  192. package/lib/commands/notification/config-update.js +1 -1
  193. package/lib/commands/notification/index.js +1 -1
  194. package/lib/commands/notification/shared.js +1 -1
  195. package/lib/commands/ocr/index.js +1 -1
  196. package/lib/commands/page/create.js +1 -1
  197. package/lib/commands/page/custom/detail.js +1 -1
  198. package/lib/commands/page/custom/list.js +1 -1
  199. package/lib/commands/page/custom/publish.js +1 -1
  200. package/lib/commands/page/custom/shared.js +1 -1
  201. package/lib/commands/page/custom/syntax.js +1 -1
  202. package/lib/commands/page/custom/update.js +1 -1
  203. package/lib/commands/page/data-list-status.js +1 -1
  204. package/lib/commands/page/generate-start.js +1 -1
  205. package/lib/commands/page/generate-status.js +1 -1
  206. package/lib/commands/page/index.js +1 -1
  207. package/lib/commands/page/pull.js +1 -1
  208. package/lib/commands/page/push.js +1 -1
  209. package/lib/commands/page/relation-audit.js +1 -1
  210. package/lib/commands/page/restore.js +1 -1
  211. package/lib/commands/page/shared.js +1 -1
  212. package/lib/commands/page/sync.js +1 -1
  213. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  214. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  215. package/lib/commands/project/create/format-elapsed.js +1 -1
  216. package/lib/commands/project/create/main.js +1 -1
  217. package/lib/commands/project/create/materialize-project-template.js +1 -1
  218. package/lib/commands/project/create/project-name.js +1 -1
  219. package/lib/commands/project/create/project-template-archive.js +1 -1
  220. package/lib/commands/project/create/project-template-path.js +1 -1
  221. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  222. package/lib/commands/project/create/use-format-code.js +1 -1
  223. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  224. package/lib/commands/project/domain-routing-sync.js +1 -1
  225. package/lib/commands/project/index.js +1 -1
  226. package/lib/commands/project/upgrade.js +1 -1
  227. package/lib/commands/registry.js +1 -1
  228. package/lib/commands/role/delete.js +1 -1
  229. package/lib/commands/role/detail.js +1 -1
  230. package/lib/commands/role/index.js +1 -1
  231. package/lib/commands/role/list.js +1 -1
  232. package/lib/commands/role/shared.js +1 -1
  233. package/lib/commands/role/update.js +1 -1
  234. package/lib/commands/role/user-add.js +1 -1
  235. package/lib/commands/role/user-remove.js +1 -1
  236. package/lib/commands/role/user-resolve.js +1 -1
  237. package/lib/commands/rule/get.js +1 -1
  238. package/lib/commands/rule/index.js +1 -1
  239. package/lib/commands/rule/list.js +1 -1
  240. package/lib/commands/rule/set.js +1 -1
  241. package/lib/commands/rule/shared.js +1 -1
  242. package/lib/commands/run/index.js +1 -1
  243. package/lib/commands/schema.js +1 -1
  244. package/lib/commands/sql/create.js +1 -1
  245. package/lib/commands/sql/delete.js +1 -1
  246. package/lib/commands/sql/detail.js +1 -1
  247. package/lib/commands/sql/exec.js +1 -1
  248. package/lib/commands/sql/index.js +1 -1
  249. package/lib/commands/sql/list.js +1 -1
  250. package/lib/commands/sql/pull.js +1 -1
  251. package/lib/commands/sql/push.js +1 -1
  252. package/lib/commands/sql/shared.js +1 -1
  253. package/lib/commands/sql/status.js +1 -1
  254. package/lib/commands/sql/validate.js +1 -1
  255. package/lib/commands/task/index.js +1 -1
  256. package/lib/commands/task/status.js +1 -1
  257. package/lib/commands/tenant/index.js +1 -1
  258. package/lib/commands/tenant/members-list.js +1 -1
  259. package/lib/commands/tenant/shared.js +1 -1
  260. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  261. package/lib/commands/user-account/feishu-bind.js +1 -1
  262. package/lib/commands/user-account/index.js +1 -1
  263. package/lib/commands/workspace/add.js +1 -1
  264. package/lib/commands/workspace/index.js +1 -1
  265. package/lib/commands/workspace/remove.js +1 -1
  266. package/lib/config/domain-config.js +1 -1
  267. package/lib/config/project-domain-routing.js +1 -1
  268. package/lib/config/region-config.js +1 -1
  269. package/lib/config/schema.js +1 -1
  270. package/lib/constant/cdn.js +1 -1
  271. package/lib/constant/cli.js +1 -1
  272. package/lib/constant/defaults.js +1 -1
  273. package/lib/constant/domain.js +1 -1
  274. package/lib/constant/env.js +1 -1
  275. package/lib/constant/output.js +1 -1
  276. package/lib/constant/paths.js +1 -1
  277. package/lib/constant/region.js +1 -1
  278. package/lib/constant/risk.js +1 -1
  279. package/lib/constant/routing-profile.js +1 -1
  280. package/lib/context/app-resolver.js +1 -1
  281. package/lib/context/auth-resolver.js +1 -1
  282. package/lib/context/config-loader.js +1 -1
  283. package/lib/context.js +1 -1
  284. package/lib/core/alias-resolver.js +1 -1
  285. package/lib/core/api-client.d.ts +7 -0
  286. package/lib/core/api-client.js +1 -1
  287. package/lib/core/bff/config.js +1 -1
  288. package/lib/core/bff/file-system.js +1 -1
  289. package/lib/core/bff/hash.js +1 -1
  290. package/lib/core/bff/hook-directory.js +1 -1
  291. package/lib/core/bff/lock.js +1 -1
  292. package/lib/core/bff/utils.js +1 -1
  293. package/lib/core/cross-db-analysis.d.ts +17 -0
  294. package/lib/core/cross-db-analysis.js +1 -0
  295. package/lib/core/cross-db-relation.js +1 -1
  296. package/lib/core/db-resolver.js +1 -1
  297. package/lib/core/flow-config.js +1 -1
  298. package/lib/core/instant-api-policy/config.js +1 -1
  299. package/lib/core/kb-search-client.js +1 -1
  300. package/lib/core/page/file-system.js +1 -1
  301. package/lib/core/page/hash.js +1 -1
  302. package/lib/core/page/lock.js +1 -1
  303. package/lib/core/page/lr-smart-jsx.js +1 -1
  304. package/lib/core/sql-index-auditor.js +1 -1
  305. package/lib/core/sql-sync/config.js +1 -1
  306. package/lib/core/sql-sync/file-system.js +1 -1
  307. package/lib/core/sql-sync/hash.js +1 -1
  308. package/lib/core/sql-sync/lock.js +1 -1
  309. package/lib/core/sql-sync/utils.js +1 -1
  310. package/lib/core/sql-validator.js +1 -1
  311. package/lib/errors.js +1 -1
  312. package/lib/framework/build-all-flags.js +1 -1
  313. package/lib/framework/error-output.js +1 -1
  314. package/lib/framework/explicit-yes.js +1 -1
  315. package/lib/framework/flags.js +1 -1
  316. package/lib/framework/help.js +1 -1
  317. package/lib/framework/index.js +1 -1
  318. package/lib/framework/output.js +1 -1
  319. package/lib/framework/response.js +1 -1
  320. package/lib/framework/runner-alias.js +1 -1
  321. package/lib/framework/runner.js +1 -1
  322. package/lib/framework/schema-export.js +1 -1
  323. package/lib/framework/supported-flags.js +1 -1
  324. package/lib/framework/types.js +1 -1
  325. package/lib/generated/build-info.d.ts +4 -4
  326. package/lib/generated/build-info.js +1 -1
  327. package/lib/generated/official-routing.js +1 -1
  328. package/lib/generated/routing-contract.js +1 -1
  329. package/lib/help.js +1 -1
  330. package/lib/postinstall.js +1 -1
  331. package/lib/runtime/confirmation.js +1 -1
  332. package/lib/runtime/event.js +1 -1
  333. package/lib/runtime/index.js +1 -1
  334. package/lib/runtime/queue.js +1 -1
  335. package/lib/runtime/resolve.js +1 -1
  336. package/lib/skills/builtin-skill.js +1 -1
  337. package/lib/skills/main.js +1 -1
  338. package/lib/skills/npx-skills-add.js +1 -1
  339. package/lib/skills/skill-presence.js +1 -1
  340. package/lib/telemetry/cli-command-trace.js +1 -1
  341. package/lib/telemetry/cli-help-trace.js +1 -1
  342. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  343. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  344. package/lib/telemetry/send-cli-trace-log.js +1 -1
  345. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  346. package/lib/utils/ai_config.js +1 -1
  347. package/lib/utils/apply-jq-filter.js +1 -1
  348. package/lib/utils/cdn-config.js +1 -1
  349. package/lib/utils/check-sdk-version.js +1 -1
  350. package/lib/utils/cli-version-check.js +1 -1
  351. package/lib/utils/cli-version-policy.js +1 -1
  352. package/lib/utils/config.js +1 -1
  353. package/lib/utils/entity-with-id.js +1 -1
  354. package/lib/utils/file-utils.js +1 -1
  355. package/lib/utils/guides-cdn.js +1 -1
  356. package/lib/utils/http-client.js +1 -1
  357. package/lib/utils/is-non-interactive.js +1 -1
  358. package/lib/utils/logger.js +1 -1
  359. package/lib/utils/params.js +1 -1
  360. package/lib/utils/platform.js +1 -1
  361. package/lib/utils/sleep.js +1 -1
  362. package/lib/utils/template-replacer.js +1 -1
  363. package/lib/utils/update-notice.js +1 -1
  364. package/lib/utils/version.js +1 -1
  365. package/lib/utils/with-active-cookie.js +1 -1
  366. package/lib/utils/write-cli-side-channel.js +1 -1
  367. package/package.json +1 -1
  368. package/skills/rabetbase/SKILL.md +6 -4
  369. package/skills/rabetbase/guides/database-connection-workflow.md +12 -3
  370. package/skills/rabetbase/guides/independent-deployment.md +10 -2
  371. package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +2 -0
  372. package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -0
  373. package/skills/rabetbase/references/rabetbase-db-cross-analyze.md +78 -0
  374. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  375. package/skills/rabetbase.manifest.json +4 -3
@@ -1 +1 @@
1
- function a239_0x5d61(){const _0x37420f=['sqlcode','now','execError','Returned\x20','execResult','appCode','SQL\x20execution\x20failed','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','\x20row(s)\x20in\x20','317114zGHoVx','494584RHcFRU','564181QextHM','61972rAcfIh','2540826IciZGq','2916870HMzJdQ','57490AqBxvt','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','exec','str','isArray','string','123vfVeVl','36GOrBvm','params','length','2ipLTGQ','sql','read'];a239_0x5d61=function(){return _0x37420f;};return a239_0x5d61();}const a239_0x5078ff=a239_0x53ab;function a239_0x53ab(_0x41422e,_0x23f745){_0x41422e=_0x41422e-0x1d0;const _0x5d61bf=a239_0x5d61();let _0x53ab96=_0x5d61bf[_0x41422e];return _0x53ab96;}(function(_0x47b7f8,_0x1d93c9){const _0x3f8bcc=a239_0x53ab,_0x2d09dc=_0x47b7f8();while(!![]){try{const _0x47b0b0=-parseInt(_0x3f8bcc(0x1e7))/0x1*(-parseInt(_0x3f8bcc(0x1d9))/0x2)+-parseInt(_0x3f8bcc(0x1d5))/0x3*(-parseInt(_0x3f8bcc(0x1e8))/0x4)+-parseInt(_0x3f8bcc(0x1ea))/0x5+-parseInt(_0x3f8bcc(0x1e9))/0x6+parseInt(_0x3f8bcc(0x1e5))/0x7+parseInt(_0x3f8bcc(0x1e6))/0x8+-parseInt(_0x3f8bcc(0x1d6))/0x9*(-parseInt(_0x3f8bcc(0x1eb))/0xa);if(_0x47b0b0===_0x1d93c9)break;else _0x2d09dc['push'](_0x2d09dc['shift']());}catch(_0x18130f){_0x2d09dc['push'](_0x2d09dc['shift']());}}}(a239_0x5d61,0x4ec6e));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':a239_0x5078ff(0x1da),'command':a239_0x5078ff(0x1d1),'description':a239_0x5078ff(0x1e3),'risk':a239_0x5078ff(0x1db),'flags':[SQLCODE_FLAG,{'name':a239_0x5078ff(0x1d7),'type':a239_0x5078ff(0x1d4),'description':a239_0x5078ff(0x1d0)}],async 'execute'(_0xffef19){const _0x42127b=a239_0x5078ff,_0x469e91=parseJsonParams(_0xffef19[_0x42127b(0x1d2)]('params')),_0x5d33e3=Date[_0x42127b(0x1dd)](),_0x2c4dac=await executeSql(_0xffef19[_0x42127b(0x1e1)],_0xffef19[_0x42127b(0x1d2)](_0x42127b(0x1dc)),_0x469e91),_0x2195f8=Date[_0x42127b(0x1dd)]()-_0x5d33e3,_0x371d96=_0x2c4dac?.[_0x42127b(0x1e0)]??_0x2c4dac,_0x2bfc1d=_0x2c4dac?.['execSuccess']??!![];if(!_0x2bfc1d)return{'ok':![],'data':{'error':_0x2c4dac?.[_0x42127b(0x1de)]||_0x42127b(0x1e2),'elapsed':_0x2195f8},'message':_0x42127b(0x1e2)};const _0x394fd0=Array[_0x42127b(0x1d3)](_0x371d96)?_0x371d96:[];return{'ok':!![],'data':{'rows':_0x394fd0,'rowCount':_0x394fd0[_0x42127b(0x1d8)],'elapsed':_0x2195f8},'message':_0x42127b(0x1df)+_0x394fd0[_0x42127b(0x1d8)]+_0x42127b(0x1e4)+_0x2195f8+'ms'};}};
1
+ function a243_0x125e(){const _0x1d2a07=['158444GdoUWn','40IlpTvC','sqlcode','params','67720qMNrzi','SQL\x20execution\x20failed','exec','1016568veeaTQ','Returned\x20','68190SOwtZA','18361123asQgNM','read','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','413BSyQbW','now','str','string','sql','3211048BiIRnC','\x20row(s)\x20in\x20','appCode','isArray','172DpRCkh','2pmQdVo','execError','length','execSuccess','1866642BaPoaq'];a243_0x125e=function(){return _0x1d2a07;};return a243_0x125e();}const a243_0x4ebd12=a243_0x1656;(function(_0x3e1742,_0x41783b){const _0x2bcea2=a243_0x1656,_0x5e7bf4=_0x3e1742();while(!![]){try{const _0x352c67=-parseInt(_0x2bcea2(0x100))/0x1*(-parseInt(_0x2bcea2(0xfb))/0x2)+parseInt(_0x2bcea2(0xff))/0x3+parseInt(_0x2bcea2(0xfa))/0x4*(parseInt(_0x2bcea2(0x104))/0x5)+-parseInt(_0x2bcea2(0x109))/0x6*(-parseInt(_0x2bcea2(0xf1))/0x7)+-parseInt(_0x2bcea2(0xf6))/0x8+-parseInt(_0x2bcea2(0x107))/0x9*(-parseInt(_0x2bcea2(0x101))/0xa)+-parseInt(_0x2bcea2(0x10a))/0xb;if(_0x352c67===_0x41783b)break;else _0x5e7bf4['push'](_0x5e7bf4['shift']());}catch(_0x161f04){_0x5e7bf4['push'](_0x5e7bf4['shift']());}}}(a243_0x125e,0x65463));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a243_0x1656(_0x15c457,_0x3ddedc){_0x15c457=_0x15c457-0xf0;const _0x125eab=a243_0x125e();let _0x1656e5=_0x125eab[_0x15c457];return _0x1656e5;}export const sqlExec={'service':a243_0x4ebd12(0xf5),'command':a243_0x4ebd12(0x106),'description':a243_0x4ebd12(0x10c),'risk':a243_0x4ebd12(0x10b),'flags':[SQLCODE_FLAG,{'name':a243_0x4ebd12(0x103),'type':a243_0x4ebd12(0xf4),'description':a243_0x4ebd12(0xf0)}],async 'execute'(_0x2363e9){const _0x4f92f8=a243_0x4ebd12,_0x2ad1cc=parseJsonParams(_0x2363e9[_0x4f92f8(0xf3)]('params')),_0x569b8d=Date[_0x4f92f8(0xf2)](),_0x1921bc=await executeSql(_0x2363e9[_0x4f92f8(0xf8)],_0x2363e9[_0x4f92f8(0xf3)](_0x4f92f8(0x102)),_0x2ad1cc),_0x1b72b5=Date[_0x4f92f8(0xf2)]()-_0x569b8d,_0x3958d5=_0x1921bc?.['execResult']??_0x1921bc,_0x51e111=_0x1921bc?.[_0x4f92f8(0xfe)]??!![];if(!_0x51e111)return{'ok':![],'data':{'error':_0x1921bc?.[_0x4f92f8(0xfc)]||'SQL\x20execution\x20failed','elapsed':_0x1b72b5},'message':_0x4f92f8(0x105)};const _0x1d65db=Array[_0x4f92f8(0xf9)](_0x3958d5)?_0x3958d5:[];return{'ok':!![],'data':{'rows':_0x1d65db,'rowCount':_0x1d65db[_0x4f92f8(0xfd)],'elapsed':_0x1b72b5},'message':_0x4f92f8(0x108)+_0x1d65db[_0x4f92f8(0xfd)]+_0x4f92f8(0xf7)+_0x1b72b5+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x3d6d51,_0x4fd53f){const _0x1c7300=a240_0x463c,_0x530c5a=_0x3d6d51();while(!![]){try{const _0x249e00=-parseInt(_0x1c7300(0x131))/0x1+-parseInt(_0x1c7300(0x130))/0x2+parseInt(_0x1c7300(0x12b))/0x3+parseInt(_0x1c7300(0x12c))/0x4*(-parseInt(_0x1c7300(0x133))/0x5)+-parseInt(_0x1c7300(0x12d))/0x6*(-parseInt(_0x1c7300(0x132))/0x7)+parseInt(_0x1c7300(0x12f))/0x8+parseInt(_0x1c7300(0x12e))/0x9;if(_0x249e00===_0x4fd53f)break;else _0x530c5a['push'](_0x530c5a['shift']());}catch(_0x37fe06){_0x530c5a['push'](_0x530c5a['shift']());}}}(a240_0x2e26,0xdd482));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a240_0x463c(_0x4c8d7c,_0x523f04){_0x4c8d7c=_0x4c8d7c-0x12b;const _0x2e2623=a240_0x2e26();let _0x463c9a=_0x2e2623[_0x4c8d7c];return _0x463c9a;}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';function a240_0x2e26(){const _0x3c8acb=['4752204qCCuzP','25588MLDfEu','174HJqfJY','7637643ayqNwK','105320QhoAUI','1010244PJvzLK','869393NMlriV','72898sXmDIO','365wnOrdB'];a240_0x2e26=function(){return _0x3c8acb;};return a240_0x2e26();}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 a244_0x455e(){const _0x3e3da2=['277203AMrHhk','417547yaSphS','220018vYnhWT','45nNQrpM','5UXpdnn','4tuDFNI','442145yzSYpV','1032108sTJZEH','324UUXeLo','10mJlQhy','298904qiINzF','12vtqOyn','770052BrBzZA'];a244_0x455e=function(){return _0x3e3da2;};return a244_0x455e();}(function(_0x6a3c62,_0x165a60){const _0x37e342=a244_0x5d8a,_0x2b3ded=_0x6a3c62();while(!![]){try{const _0x3f5a4e=parseInt(_0x37e342(0x1b0))/0x1+-parseInt(_0x37e342(0x1a6))/0x2*(-parseInt(_0x37e342(0x1ae))/0x3)+-parseInt(_0x37e342(0x1ad))/0x4*(-parseInt(_0x37e342(0x1a5))/0x5)+-parseInt(_0x37e342(0x1ac))/0x6*(-parseInt(_0x37e342(0x1a8))/0x7)+parseInt(_0x37e342(0x1ab))/0x8*(parseInt(_0x37e342(0x1b1))/0x9)+-parseInt(_0x37e342(0x1aa))/0xa*(parseInt(_0x37e342(0x1a7))/0xb)+parseInt(_0x37e342(0x1a9))/0xc*(-parseInt(_0x37e342(0x1af))/0xd);if(_0x3f5a4e===_0x165a60)break;else _0x2b3ded['push'](_0x2b3ded['shift']());}catch(_0x26f62c){_0x2b3ded['push'](_0x2b3ded['shift']());}}}(a244_0x455e,0x29e6c));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';function a244_0x5d8a(_0xe00117,_0x417ffc){_0xe00117=_0xe00117-0x1a5;const _0x455ece=a244_0x455e();let _0x5d8a6b=_0x455ece[_0xe00117];return _0x5d8a6b;}import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a241_0x143786=a241_0x1969;function a241_0x32ed(){const _0xd8b471=['4213844cEmhxo','List\x20custom\x20SQL\x20queries','str','dbId','sqlCode','string','44xnFbUr','3snqjny','bool','\x20SQL\x20queries\x20(total:\x20','4933ydiKSi','boolean','page','sqlName','list','number','1044730ivThIC','112878xOfiND','474qzzhHN','9WhCPvP','verbose','totalCount','225QpxLMe','name','tableData','description','length','num','Filter\x20by\x20SQL\x20name','2949608syKgbP','Page\x20size','pagesize','622716fvBMOP','appCode','731213tWFZHO','read'];a241_0x32ed=function(){return _0xd8b471;};return a241_0x32ed();}function a241_0x1969(_0xd330c6,_0x33900e){_0xd330c6=_0xd330c6-0x149;const _0x32eda8=a241_0x32ed();let _0x1969fa=_0x32eda8[_0xd330c6];return _0x1969fa;}(function(_0x35a520,_0x24f6b3){const _0x3f7202=a241_0x1969,_0xffdf4=_0x35a520();while(!![]){try{const _0x443c12=parseInt(_0x3f7202(0x164))/0x1*(parseInt(_0x3f7202(0x16c))/0x2)+parseInt(_0x3f7202(0x161))/0x3*(-parseInt(_0x3f7202(0x15a))/0x4)+parseInt(_0x3f7202(0x14c))/0x5*(parseInt(_0x3f7202(0x16b))/0x6)+parseInt(_0x3f7202(0x158))/0x7+-parseInt(_0x3f7202(0x153))/0x8+parseInt(_0x3f7202(0x149))/0x9*(parseInt(_0x3f7202(0x16a))/0xa)+parseInt(_0x3f7202(0x160))/0xb*(-parseInt(_0x3f7202(0x156))/0xc);if(_0x443c12===_0x24f6b3)break;else _0xffdf4['push'](_0xffdf4['shift']());}catch(_0x35ea46){_0xffdf4['push'](_0xffdf4['shift']());}}}(a241_0x32ed,0x913d8));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':a241_0x143786(0x168),'description':a241_0x143786(0x15b),'risk':a241_0x143786(0x159),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a241_0x143786(0x14d),'type':a241_0x143786(0x15f),'description':a241_0x143786(0x152)},{'name':a241_0x143786(0x166),'type':a241_0x143786(0x169),'description':'Page\x20number','default':0x1},{'name':a241_0x143786(0x155),'type':'number','description':a241_0x143786(0x154)},{'name':a241_0x143786(0x14a),'type':a241_0x143786(0x165),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x4982ad){const _0x384ccc=a241_0x143786,_0x23e572=await listSqlQueries(_0x4982ad[_0x384ccc(0x157)],{'sqlCode':_0x4982ad[_0x384ccc(0x15c)]('sqlcode')||undefined,'sqlName':_0x4982ad[_0x384ccc(0x15c)]('name')||undefined,'currentPage':_0x4982ad[_0x384ccc(0x151)](_0x384ccc(0x166)),'pageSize':_0x4982ad[_0x384ccc(0x151)](_0x384ccc(0x155),0x32)}),_0x5222ca=_0x4982ad[_0x384ccc(0x162)](_0x384ccc(0x14a)),_0x2b070f=_0x23e572[_0x384ccc(0x14e)]??[],_0x400764=_0x23e572['paging']?.[_0x384ccc(0x14b)]??_0x2b070f[_0x384ccc(0x150)];let _0x5a2283;return _0x5222ca?_0x5a2283=_0x2b070f:_0x5a2283=await Promise['all'](_0x2b070f['map'](async _0x484398=>{const _0x4160b9=_0x384ccc;let _0x5bc28a;try{_0x5bc28a=_0x484398[_0x4160b9(0x15d)]?await getDbName(_0x4982ad[_0x4160b9(0x157)],_0x484398['dbId']):undefined;}catch{}return{'sqlCode':_0x484398[_0x4160b9(0x15e)],'sqlName':_0x484398[_0x4160b9(0x167)],'description':_0x484398[_0x4160b9(0x14f)]??'','db':_0x5bc28a?_0x5bc28a+'\x20('+_0x484398[_0x4160b9(0x15d)]+')':_0x484398[_0x4160b9(0x15d)]??''};})),{'ok':!![],'data':_0x5a2283,'message':_0x2b070f[_0x384ccc(0x150)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x2b070f[_0x384ccc(0x150)]+_0x384ccc(0x163)+_0x400764+').'};}};
1
+ const a245_0x2fd589=a245_0x298a;(function(_0x38ce79,_0x267b6a){const _0x25d100=a245_0x298a,_0x1ad738=_0x38ce79();while(!![]){try{const _0x2fbe1c=parseInt(_0x25d100(0xaf))/0x1*(parseInt(_0x25d100(0xb0))/0x2)+-parseInt(_0x25d100(0xa4))/0x3+-parseInt(_0x25d100(0xc0))/0x4*(-parseInt(_0x25d100(0xab))/0x5)+parseInt(_0x25d100(0xbc))/0x6+-parseInt(_0x25d100(0x99))/0x7*(parseInt(_0x25d100(0xbe))/0x8)+-parseInt(_0x25d100(0xad))/0x9*(parseInt(_0x25d100(0xa8))/0xa)+-parseInt(_0x25d100(0xc1))/0xb*(-parseInt(_0x25d100(0xb4))/0xc);if(_0x2fbe1c===_0x267b6a)break;else _0x1ad738['push'](_0x1ad738['shift']());}catch(_0x37c265){_0x1ad738['push'](_0x1ad738['shift']());}}}(a245_0x5ad1,0x22aaa));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a245_0x5ad1(){const _0x5253e3=['Page\x20size','length','sqlName','List\x20custom\x20SQL\x20queries','sqlcode','all','Filter\x20by\x20SQL\x20name','verbose','444834XptUom','boolean','Found\x20','page','10MWSvAL','name','read','36965pNvTii','list','1795779QSqVRl','dbId','750eNsOtN','296bYfrdm','paging','tableData','bool','36BjOXSX','str','pagesize','No\x20custom\x20SQL\x20queries\x20found.','appCode','Page\x20number','totalCount','sqlCode','400542oRcxRX','\x20SQL\x20queries\x20(total:\x20','134472KjxFdv','number','124SQtwYA','1289959mQadje','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','112GFaNvz','description','num'];a245_0x5ad1=function(){return _0x5253e3;};return a245_0x5ad1();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a245_0x298a(_0x56b805,_0x49f3a0){_0x56b805=_0x56b805-0x98;const _0x5ad198=a245_0x5ad1();let _0x298a88=_0x5ad198[_0x56b805];return _0x298a88;}export const sqlList={'service':'sql','command':a245_0x2fd589(0xac),'description':a245_0x2fd589(0x9f),'risk':a245_0x2fd589(0xaa),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a245_0x2fd589(0xa9),'type':'string','description':a245_0x2fd589(0xa2)},{'name':a245_0x2fd589(0xa7),'type':'number','description':a245_0x2fd589(0xb9),'default':0x1},{'name':a245_0x2fd589(0xb6),'type':a245_0x2fd589(0xbf),'description':a245_0x2fd589(0x9c)},{'name':'verbose','type':a245_0x2fd589(0xa5),'description':a245_0x2fd589(0x98)}],async 'execute'(_0x28f906){const _0x311111=a245_0x2fd589,_0x1be2b4=await listSqlQueries(_0x28f906['appCode'],{'sqlCode':_0x28f906[_0x311111(0xb5)](_0x311111(0xa0))||undefined,'sqlName':_0x28f906[_0x311111(0xb5)](_0x311111(0xa9))||undefined,'currentPage':_0x28f906[_0x311111(0x9b)]('page'),'pageSize':_0x28f906[_0x311111(0x9b)]('pagesize',0x32)}),_0x452bd6=_0x28f906[_0x311111(0xb3)](_0x311111(0xa3)),_0x1ab444=_0x1be2b4[_0x311111(0xb2)]??[],_0x5855c0=_0x1be2b4[_0x311111(0xb1)]?.[_0x311111(0xba)]??_0x1ab444['length'];let _0x2ac2d1;return _0x452bd6?_0x2ac2d1=_0x1ab444:_0x2ac2d1=await Promise[_0x311111(0xa1)](_0x1ab444['map'](async _0x3e66bf=>{const _0x593c42=_0x311111;let _0x3a0972;try{_0x3a0972=_0x3e66bf[_0x593c42(0xae)]?await getDbName(_0x28f906[_0x593c42(0xb8)],_0x3e66bf['dbId']):undefined;}catch{}return{'sqlCode':_0x3e66bf[_0x593c42(0xbb)],'sqlName':_0x3e66bf[_0x593c42(0x9e)],'description':_0x3e66bf[_0x593c42(0x9a)]??'','db':_0x3a0972?_0x3a0972+'\x20('+_0x3e66bf[_0x593c42(0xae)]+')':_0x3e66bf[_0x593c42(0xae)]??''};})),{'ok':!![],'data':_0x2ac2d1,'message':_0x1ab444[_0x311111(0x9d)]===0x0?_0x311111(0xb7):_0x311111(0xa6)+_0x1ab444[_0x311111(0x9d)]+_0x311111(0xbd)+_0x5855c0+').'};}};
@@ -1 +1 @@
1
- const a242_0x5521f9=a242_0x2f02;(function(_0x18e9ae,_0x4f9cac){const _0x2f498c=a242_0x2f02,_0x1bab5b=_0x18e9ae();while(!![]){try{const _0x103ffb=-parseInt(_0x2f498c(0x1bd))/0x1+-parseInt(_0x2f498c(0x1b5))/0x2+parseInt(_0x2f498c(0x1c3))/0x3+-parseInt(_0x2f498c(0x185))/0x4+-parseInt(_0x2f498c(0x1b0))/0x5+-parseInt(_0x2f498c(0x188))/0x6*(-parseInt(_0x2f498c(0x1a3))/0x7)+parseInt(_0x2f498c(0x18c))/0x8;if(_0x103ffb===_0x4f9cac)break;else _0x1bab5b['push'](_0x1bab5b['shift']());}catch(_0x48f1aa){_0x1bab5b['push'](_0x1bab5b['shift']());}}}(a242_0x23b2,0x964a3));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{detectSqlMode}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;function a242_0x23b2(){const _0x15403b=['paging','Filter\x20by\x20SQL\x20display\x20name','apps','endsWith','toLowerCase','path','sqlName','\x20skipped,\x20','1954224VTxdxf','some','POST','910668WApRUW','sqlRoot','trim','sqlCode','7288304UnHexn','sqlContent','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','Force\x20overwrite\x20local\x20unsynced\x20changes','replace','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','tableData','read','test','totalCount','content','isCanonical','would_pull','filter','boolean','lastSync','push','appCode','sql','force','description','sqlRootDir','35XRnjyG','Pull\x20complete:\x20','unchanged','map','mybatisXml','pull','\x20written,\x20','filePath','cancelled','length','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','skipped','dbId','839705XuVymG','message','file','lockFilePath','nonInteractive','1471414MXraxW','hash','equivalent','all','name','find','sqls','toISOString','826537eEKzwC','utf8','join','\x20failed','sqlcode','conflict','3493200SMXYCD','mode','str'];a242_0x23b2=function(){return _0x15403b;};return a242_0x23b2();}async function fetchAllSqlQueries(_0x23bcc9,_0x43ced8){const _0x2fb091=a242_0x2f02,_0x30c4c9=[];let _0x3f200d=0x1;while(!![]){const _0x36bb8b=await listSqlQueries(_0x23bcc9,{'currentPage':_0x3f200d,'pageSize':PAGE_SIZE,'sqlCode':_0x43ced8[_0x2fb091(0x18b)],'sqlName':_0x43ced8[_0x2fb091(0x183)]}),_0x5aa797=_0x36bb8b[_0x2fb091(0x193)]??[];_0x30c4c9['push'](..._0x5aa797);if(_0x5aa797[_0x2fb091(0x1ac)]===0x0)break;const _0x5ec7c8=_0x36bb8b[_0x2fb091(0x1c6)]?.[_0x2fb091(0x196)];if(_0x5ec7c8!=null?_0x30c4c9[_0x2fb091(0x1ac)]>=_0x5ec7c8:_0x5aa797['length']<PAGE_SIZE)break;_0x3f200d++;}return _0x30c4c9;}async function ensureSqlContent(_0x12a33f){const _0x95a131=a242_0x2f02;if(_0x12a33f[_0x95a131(0x18d)]!=null&&String(_0x12a33f[_0x95a131(0x18d)])[_0x95a131(0x1ac)]>0x0)return _0x12a33f;return getSqlQueryDetail(_0x12a33f[_0x95a131(0x18b)]);}export const sqlPull={'service':a242_0x5521f9(0x19f),'command':a242_0x5521f9(0x1a8),'description':a242_0x5521f9(0x1ad),'risk':a242_0x5521f9(0x194),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a242_0x5521f9(0x1b9),'type':'string','description':a242_0x5521f9(0x1c7)},{'name':a242_0x5521f9(0x1a0),'type':a242_0x5521f9(0x19b),'description':a242_0x5521f9(0x190)}],async 'dryRun'(_0x4a55b0){const _0x13da3f=a242_0x5521f9,_0x110655=loadSqlProjectConfig(_0x4a55b0[_0x13da3f(0x19e)]),_0x2091ce=await readSqlLockFile(_0x110655[_0x13da3f(0x1b3)]),{appLock:_0x5ceed8}=ensureSqlLockScope(_0x2091ce??createEmptySqlLock(),_0x110655[_0x13da3f(0x19e)],_0x110655['sqlRoot'],_0x13da3f(0x1a8)),_0x551cee=await fetchAllSqlQueries(_0x4a55b0[_0x13da3f(0x19e)],{'sqlCode':_0x4a55b0[_0x13da3f(0x1c5)](_0x13da3f(0x1c1))||undefined,'sqlName':_0x4a55b0[_0x13da3f(0x1c5)]('name')||undefined}),_0x5697f4=[];for(const _0x7b1a1a of _0x551cee){const _0x2377b6=await ensureSqlContent(_0x7b1a1a),_0x4dcee7=ensureRemoteSqlContent(_0x2377b6),_0x38ee9a=detectSqlMode(_0x4dcee7),_0x12965e=_0x2377b6[_0x13da3f(0x1af)]?await getDbName(_0x4a55b0['appCode'],Number(_0x2377b6[_0x13da3f(0x1af)]))['catch'](()=>undefined):undefined,_0x11d38f=buildLocalSqlFileContent({'sqlCode':_0x2377b6[_0x13da3f(0x18b)],'sqlName':_0x2377b6[_0x13da3f(0x183)],'dbId':_0x2377b6[_0x13da3f(0x1af)]},_0x4dcee7,{'dbName':_0x12965e,'mode':_0x38ee9a,'syncedAt':new Date()[_0x13da3f(0x1bc)](),'description':_0x2377b6[_0x13da3f(0x1a1)]}),_0x31e012=buildSqlLockEntry(_0x2377b6,_0x4dcee7,'',{'dbName':_0x12965e}),_0x2fd890=resolveLocalSqlFilePath(_0x110655,_0x2377b6[_0x13da3f(0x18b)],_0x31e012);let _0xf01603=_0x13da3f(0x199),_0x3013b8;const _0x30851a=await findExistingSqlFiles(_0x110655,_0x2fd890,_0x38ee9a,_0x5ceed8[_0x13da3f(0x1bb)][_0x2377b6['sqlCode']]);if(_0x30851a[_0x13da3f(0x1ac)]>0x0){const _0x13f387=await compareExistingSqlFiles(_0x30851a,_0x11d38f,_0x38ee9a);if(_0x13f387[_0x13da3f(0x186)](({equivalent:_0x3cfffd})=>!_0x3cfffd))_0xf01603=_0x13da3f(0x1c2),_0x3013b8=_0x13da3f(0x18e);else _0x13f387[_0x13da3f(0x1ac)]===0x1&&_0x13f387[0x0]?.[_0x13da3f(0x1b2)][_0x13da3f(0x198)]&&(_0xf01603=_0x13da3f(0x1ae),_0x3013b8=_0x13da3f(0x1a5));}_0x5697f4[_0x13da3f(0x19d)]({'sqlCode':_0x2377b6[_0x13da3f(0x18b)],'sqlName':_0x2377b6[_0x13da3f(0x183)],'filePath':_0x2fd890,'status':_0xf01603,'reason':_0x3013b8});}return{'method':_0x13da3f(0x187),'url':_0x13da3f(0x18f),'body':{'appCode':_0x4a55b0[_0x13da3f(0x19e)],'sqlCode':_0x4a55b0[_0x13da3f(0x1c5)](_0x13da3f(0x1c1))||null,'sqlName':_0x4a55b0['str'](_0x13da3f(0x1b9))||null,'files':_0x5697f4},'description':'Would\x20pull\x20'+_0x5697f4['length']+'\x20SQL\x20file(s)\x20into\x20'+_0x110655['sqlRootDir']};},async 'execute'(_0x21dcac){const _0x204973=a242_0x5521f9,_0x44878a=loadSqlProjectConfig(_0x21dcac['appCode']),_0xb8cfb=await readSqlLockFile(_0x44878a['lockFilePath']),{lockData:_0x4949ff,appLock:_0x547801}=ensureSqlLockScope(_0xb8cfb??createEmptySqlLock(),_0x44878a['appCode'],_0x44878a[_0x204973(0x189)],_0x204973(0x1a8)),_0x2b5609=_0x21dcac['bool'](_0x204973(0x1a0)),_0x4564e7=await fetchAllSqlQueries(_0x21dcac['appCode'],{'sqlCode':_0x21dcac[_0x204973(0x1c5)](_0x204973(0x1c1))||undefined,'sqlName':_0x21dcac[_0x204973(0x1c5)](_0x204973(0x1b9))||undefined});if(_0x4564e7[_0x204973(0x1ac)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x2b9e26=[],_0x396b44=[];for(const _0x1a5338 of _0x4564e7){try{_0x2b9e26[_0x204973(0x19d)](await ensureSqlContent(_0x1a5338));}catch(_0x57d734){_0x396b44['push']({'sqlCode':_0x1a5338[_0x204973(0x18b)],'error':_0x57d734 instanceof Error?_0x57d734['message']:String(_0x57d734)});}}if(_0x2b5609&&!_0x21dcac[_0x204973(0x1b4)]){let _0x20b904=![];for(const _0x11fbb4 of _0x2b9e26){const _0x319bae=detectSqlMode(ensureRemoteSqlContent(_0x11fbb4)),_0x420532=_0x11fbb4[_0x204973(0x1af)]?await getDbName(_0x21dcac['appCode'],Number(_0x11fbb4['dbId']))['catch'](()=>undefined):undefined,_0x57330f=buildLocalSqlFileContent({'sqlCode':_0x11fbb4['sqlCode'],'sqlName':_0x11fbb4[_0x204973(0x183)],'dbId':_0x11fbb4[_0x204973(0x1af)]},ensureRemoteSqlContent(_0x11fbb4),{'dbName':_0x420532,'mode':_0x319bae,'syncedAt':new Date()['toISOString'](),'description':_0x11fbb4[_0x204973(0x1a1)]}),_0x3e9697=resolveLocalSqlFilePath(_0x44878a,_0x11fbb4[_0x204973(0x18b)],buildSqlLockEntry(_0x11fbb4,ensureRemoteSqlContent(_0x11fbb4),'',{'dbName':_0x420532})),_0x285a4b=await findExistingSqlFiles(_0x44878a,_0x3e9697,_0x319bae,_0x547801[_0x204973(0x1bb)][_0x11fbb4[_0x204973(0x18b)]]),_0x8386e3=await compareExistingSqlFiles(_0x285a4b,_0x57330f,_0x319bae);if(_0x8386e3[_0x204973(0x186)](({equivalent:_0x42f1c8})=>!_0x42f1c8)){_0x20b904=!![];break;}}if(_0x20b904){const _0x1f43ce=await confirmForceOverwrite(_0x204973(0x192));if(!_0x1f43ce)throw CliErrors[_0x204973(0x1ab)]('Force\x20pull\x20cancelled.');}}const _0x1c6ec8=cloneSqlLockData(_0x4949ff),_0xd15ef8=_0x1c6ec8[_0x204973(0x1c8)][_0x44878a[_0x204973(0x19e)]],_0x501e92=[],_0x2aa60d=[];for(const _0x4331c0 of _0x2b9e26){const _0xcd9185=_0xd15ef8[_0x204973(0x1bb)][_0x4331c0[_0x204973(0x18b)]],_0x34484c=ensureRemoteSqlContent(_0x4331c0),_0x7469b8=detectSqlMode(_0x34484c),_0x3e9234=_0x4331c0[_0x204973(0x1af)]?await getDbName(_0x21dcac['appCode'],Number(_0x4331c0[_0x204973(0x1af)]))['catch'](()=>undefined):undefined,_0x56161b=buildLocalSqlFileContent({'sqlCode':_0x4331c0['sqlCode'],'sqlName':_0x4331c0[_0x204973(0x183)],'dbId':_0x4331c0['dbId']},_0x34484c,{'dbName':_0x3e9234,'mode':_0x7469b8,'syncedAt':new Date()[_0x204973(0x1bc)](),'description':_0x4331c0[_0x204973(0x1a1)]}),_0x4c0df2=buildSqlLockEntry(_0x4331c0,_0x34484c,computeSqlContentHash(_0x56161b),{'dbName':_0x3e9234}),_0x36f4cb=_0x4c0df2[_0x204973(0x182)],_0x381b34=join(_0x44878a[_0x204973(0x1a2)],_0x36f4cb);try{const _0x113529=await findExistingSqlFiles(_0x44878a,_0x381b34,_0x7469b8,_0xcd9185),_0x587d0f=await compareExistingSqlFiles(_0x113529,_0x56161b,_0x7469b8);if(!_0x2b5609&&_0x587d0f['some'](({equivalent:_0x9d5da1})=>!_0x9d5da1)){_0x2aa60d[_0x204973(0x19d)]({'sqlCode':_0x4331c0[_0x204973(0x18b)],'reason':'local\x20differs\x20from\x20remote'});continue;}const _0x206d37=_0x587d0f[_0x204973(0x1ba)](({file:_0x324997})=>_0x324997[_0x204973(0x198)]),_0x279c69=_0x587d0f['find'](({file:_0x12ecef})=>!_0x12ecef[_0x204973(0x198)]);if(_0x206d37?.[_0x204973(0x1b7)]&&!_0x279c69){_0x2aa60d[_0x204973(0x19d)]({'sqlCode':_0x4331c0['sqlCode'],'reason':_0x204973(0x1a5)}),_0xd15ef8[_0x204973(0x1bb)][_0x4331c0[_0x204973(0x18b)]]={..._0x4c0df2,'hash':computeSqlContentHash(_0x206d37[_0x204973(0x197)]),'path':_0x36f4cb};continue;}!_0x206d37?.[_0x204973(0x1b7)]&&(await ensureParentDirectory(_0x381b34),await writeFile(_0x381b34,_0x56161b,_0x204973(0x1be))),_0x279c69&&await rm(_0x279c69[_0x204973(0x1b2)][_0x204973(0x1aa)],{'force':!![]}),_0xd15ef8['sqls'][_0x4331c0[_0x204973(0x18b)]]={..._0x4c0df2,'hash':_0x206d37?.[_0x204973(0x1b7)]?computeSqlContentHash(_0x206d37['content']):_0x4c0df2[_0x204973(0x1b6)],'path':_0x36f4cb},_0x501e92['push']({'sqlCode':_0x4331c0[_0x204973(0x18b)],'filePath':_0x381b34});}catch(_0x35872d){_0x396b44[_0x204973(0x19d)]({'sqlCode':_0x4331c0[_0x204973(0x18b)],'error':_0x35872d instanceof Error?_0x35872d[_0x204973(0x1b1)]:String(_0x35872d)});}}return _0xd15ef8[_0x204973(0x19c)]=new Date()[_0x204973(0x1bc)](),await writeSqlLockFile(_0x44878a[_0x204973(0x1b3)],_0x1c6ec8),{'ok':_0x396b44[_0x204973(0x1ac)]===0x0,'data':{'pulled':_0x501e92,'skipped':_0x2aa60d,'failed':_0x396b44},'message':_0x204973(0x1a4)+_0x501e92[_0x204973(0x1ac)]+_0x204973(0x1a9)+_0x2aa60d[_0x204973(0x1ac)]+_0x204973(0x184)+_0x396b44[_0x204973(0x1ac)]+_0x204973(0x1c0)};}};function isEquivalentPulledSqlFile(_0x171c85,_0x2a89d7,_0x20fe08,_0x5e3006){if(_0x20fe08!==_0x5e3006)return normalizePulledSqlBody(_0x171c85,_0x20fe08)===normalizePulledSqlBody(_0x2a89d7,_0x5e3006);return normalizePullComparableContent(_0x171c85,_0x20fe08)===normalizePullComparableContent(_0x2a89d7,_0x5e3006);}async function findExistingSqlFiles(_0x419370,_0x1704e1,_0x44e5bc,_0x4b4022){const _0x20ff7e=a242_0x5521f9,_0x34f91d=[];await fileExists(_0x1704e1)&&_0x34f91d[_0x20ff7e(0x19d)]({'filePath':_0x1704e1,'mode':_0x44e5bc,'isCanonical':!![]});if(!_0x4b4022?.['path'])return _0x34f91d;const _0x786326=join(_0x419370[_0x20ff7e(0x1a2)],_0x4b4022[_0x20ff7e(0x182)]);if(_0x786326===_0x1704e1)return _0x34f91d;return await fileExists(_0x786326)&&_0x34f91d[_0x20ff7e(0x19d)]({'filePath':_0x786326,'mode':_0x4b4022[_0x20ff7e(0x1c4)]??modeFromFilePath(_0x786326),'isCanonical':![]}),_0x34f91d;}async function compareExistingSqlFiles(_0x3ae75d,_0x5ed55e,_0x20cdcc){const _0x40f0ab=a242_0x5521f9;return Promise[_0x40f0ab(0x1b8)](_0x3ae75d[_0x40f0ab(0x1a6)](async _0xdadf80=>{const _0x30957e=_0x40f0ab,_0x35a8a8=await readFile(_0xdadf80['filePath'],_0x30957e(0x1be));return{'file':_0xdadf80,'content':_0x35a8a8,'equivalent':isEquivalentPulledSqlFile(_0x35a8a8,_0x5ed55e,_0xdadf80[_0x30957e(0x1c4)],_0x20cdcc)};}));}function modeFromFilePath(_0x488340){const _0x3a6cf3=a242_0x5521f9;return _0x488340[_0x3a6cf3(0x1ca)]()[_0x3a6cf3(0x1c9)]('.xml')?_0x3a6cf3(0x1a7):_0x3a6cf3(0x19f);}function normalizePulledSqlBody(_0x5e0962,_0x4128f0){const _0x5ce773=a242_0x5521f9;return stripLocalSqlMetadata(_0x5e0962,_0x4128f0)[_0x5ce773(0x191)](/\r\n/g,'\x0a')[_0x5ce773(0x18a)]();}function normalizePullComparableContent(_0x5a22bc,_0x3cae2a){const _0x24f4a3=a242_0x5521f9,_0x1b7076=_0x5a22bc['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x3cb9d6=_0x1b7076[_0x24f4a3(0x19a)](_0xd8ceb4=>!isSyncedAtMetadataLine(_0xd8ceb4,_0x3cae2a));return _0x3cb9d6[_0x24f4a3(0x1bf)]('\x0a');}function a242_0x2f02(_0x1b8229,_0x33e1cb){_0x1b8229=_0x1b8229-0x182;const _0x23b233=a242_0x23b2();let _0x2f02c9=_0x23b233[_0x1b8229];return _0x2f02c9;}function isSyncedAtMetadataLine(_0x172111,_0x210085){const _0x16da6a=a242_0x5521f9;if(_0x210085==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x16da6a(0x195)](_0x172111);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x172111);}
1
+ const a246_0x46dcea=a246_0x3a6a;(function(_0x5e1686,_0x1b07de){const _0x56b6f6=a246_0x3a6a,_0x1a2dc7=_0x5e1686();while(!![]){try{const _0x558e8d=parseInt(_0x56b6f6(0xc7))/0x1+-parseInt(_0x56b6f6(0xd5))/0x2+-parseInt(_0x56b6f6(0xb4))/0x3+parseInt(_0x56b6f6(0xf4))/0x4*(parseInt(_0x56b6f6(0xd0))/0x5)+parseInt(_0x56b6f6(0xdc))/0x6*(-parseInt(_0x56b6f6(0xbe))/0x7)+parseInt(_0x56b6f6(0xd4))/0x8*(parseInt(_0x56b6f6(0xf5))/0x9)+parseInt(_0x56b6f6(0xd3))/0xa;if(_0x558e8d===_0x1b07de)break;else _0x1a2dc7['push'](_0x1a2dc7['shift']());}catch(_0x4a720e){_0x1a2dc7['push'](_0x1a2dc7['shift']());}}}(a246_0x4610,0xbc91f));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';function a246_0x3a6a(_0x48b1a1,_0x40c63a){_0x48b1a1=_0x48b1a1-0xb3;const _0x4610b2=a246_0x4610();let _0x3a6a73=_0x4610b2[_0x48b1a1];return _0x3a6a73;}import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{detectSqlMode}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x1a2fbb,_0x354bb8){const _0x1e40a2=a246_0x3a6a,_0x4a800f=[];let _0x326f54=0x1;while(!![]){const _0x251d69=await listSqlQueries(_0x1a2fbb,{'currentPage':_0x326f54,'pageSize':PAGE_SIZE,'sqlCode':_0x354bb8['sqlCode'],'sqlName':_0x354bb8[_0x1e40a2(0xe4)]}),_0x3d5a4a=_0x251d69[_0x1e40a2(0xc3)]??[];_0x4a800f[_0x1e40a2(0xff)](..._0x3d5a4a);if(_0x3d5a4a[_0x1e40a2(0xed)]===0x0)break;const _0x2f127c=_0x251d69[_0x1e40a2(0xbb)]?.[_0x1e40a2(0xf3)];if(_0x2f127c!=null?_0x4a800f[_0x1e40a2(0xed)]>=_0x2f127c:_0x3d5a4a[_0x1e40a2(0xed)]<PAGE_SIZE)break;_0x326f54++;}return _0x4a800f;}async function ensureSqlContent(_0x285f09){const _0x3a876e=a246_0x3a6a;if(_0x285f09['sqlContent']!=null&&String(_0x285f09[_0x3a876e(0x100)])[_0x3a876e(0xed)]>0x0)return _0x285f09;return getSqlQueryDetail(_0x285f09[_0x3a876e(0xc1)]);}export const sqlPull={'service':a246_0x46dcea(0xcc),'command':a246_0x46dcea(0xe0),'description':a246_0x46dcea(0xef),'risk':a246_0x46dcea(0xfb),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a246_0x46dcea(0x101),'type':a246_0x46dcea(0xd2),'description':a246_0x46dcea(0xec)},{'name':a246_0x46dcea(0xe3),'type':a246_0x46dcea(0xfa),'description':a246_0x46dcea(0xb7)}],async 'dryRun'(_0x4f1da3){const _0x370a60=a246_0x46dcea,_0x38cee7=loadSqlProjectConfig(_0x4f1da3[_0x370a60(0xcd)]),_0x1f599e=await readSqlLockFile(_0x38cee7[_0x370a60(0xce)]),{appLock:_0x1cc48d}=ensureSqlLockScope(_0x1f599e??createEmptySqlLock(),_0x38cee7['appCode'],_0x38cee7['sqlRoot'],_0x370a60(0xe0)),_0x25750b=await fetchAllSqlQueries(_0x4f1da3[_0x370a60(0xcd)],{'sqlCode':_0x4f1da3[_0x370a60(0xc5)]('sqlcode')||undefined,'sqlName':_0x4f1da3[_0x370a60(0xc5)](_0x370a60(0x101))||undefined}),_0x26d65d=[];for(const _0xd2ec70 of _0x25750b){const _0x27ce08=await ensureSqlContent(_0xd2ec70),_0x13b1f9=ensureRemoteSqlContent(_0x27ce08),_0x24cfe9=detectSqlMode(_0x13b1f9),_0x295dd5=_0x27ce08[_0x370a60(0xfd)]?await getDbName(_0x4f1da3[_0x370a60(0xcd)],Number(_0x27ce08[_0x370a60(0xfd)]))[_0x370a60(0xc8)](()=>undefined):undefined,_0x27575e=buildLocalSqlFileContent({'sqlCode':_0x27ce08[_0x370a60(0xc1)],'sqlName':_0x27ce08[_0x370a60(0xe4)],'dbId':_0x27ce08['dbId']},_0x13b1f9,{'dbName':_0x295dd5,'mode':_0x24cfe9,'syncedAt':new Date()[_0x370a60(0xd7)](),'description':_0x27ce08[_0x370a60(0xcb)]}),_0x388c3c=buildSqlLockEntry(_0x27ce08,_0x13b1f9,'',{'dbName':_0x295dd5}),_0x5c6d89=resolveLocalSqlFilePath(_0x38cee7,_0x27ce08[_0x370a60(0xc1)],_0x388c3c);let _0x1609fb=_0x370a60(0xde),_0xd275c1;const _0x2bd716=await findExistingSqlFiles(_0x38cee7,_0x5c6d89,_0x24cfe9,_0x1cc48d['sqls'][_0x27ce08[_0x370a60(0xc1)]]);if(_0x2bd716['length']>0x0){const _0x335438=await compareExistingSqlFiles(_0x2bd716,_0x27575e,_0x24cfe9);if(_0x335438[_0x370a60(0xd9)](({equivalent:_0x5533bc})=>!_0x5533bc))_0x1609fb=_0x370a60(0xc2),_0xd275c1=_0x370a60(0xdb);else _0x335438[_0x370a60(0xed)]===0x1&&_0x335438[0x0]?.['file'][_0x370a60(0xe9)]&&(_0x1609fb='skipped',_0xd275c1=_0x370a60(0xba));}_0x26d65d[_0x370a60(0xff)]({'sqlCode':_0x27ce08[_0x370a60(0xc1)],'sqlName':_0x27ce08[_0x370a60(0xe4)],'filePath':_0x5c6d89,'status':_0x1609fb,'reason':_0xd275c1});}return{'method':_0x370a60(0xf7),'url':_0x370a60(0xf8),'body':{'appCode':_0x4f1da3[_0x370a60(0xcd)],'sqlCode':_0x4f1da3[_0x370a60(0xc5)](_0x370a60(0xe1))||null,'sqlName':_0x4f1da3[_0x370a60(0xc5)](_0x370a60(0x101))||null,'files':_0x26d65d},'description':_0x370a60(0xb5)+_0x26d65d[_0x370a60(0xed)]+_0x370a60(0xbf)+_0x38cee7[_0x370a60(0xbd)]};},async 'execute'(_0x5063bc){const _0x3ab690=a246_0x46dcea,_0x2b8a2a=loadSqlProjectConfig(_0x5063bc[_0x3ab690(0xcd)]),_0x2e8320=await readSqlLockFile(_0x2b8a2a[_0x3ab690(0xce)]),{lockData:_0x367d94,appLock:_0x1e5029}=ensureSqlLockScope(_0x2e8320??createEmptySqlLock(),_0x2b8a2a[_0x3ab690(0xcd)],_0x2b8a2a['sqlRoot'],_0x3ab690(0xe0)),_0x38b6d8=_0x5063bc[_0x3ab690(0xb3)](_0x3ab690(0xe3)),_0x373306=await fetchAllSqlQueries(_0x5063bc[_0x3ab690(0xcd)],{'sqlCode':_0x5063bc[_0x3ab690(0xc5)](_0x3ab690(0xe1))||undefined,'sqlName':_0x5063bc[_0x3ab690(0xc5)](_0x3ab690(0x101))||undefined});if(_0x373306['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x3ab690(0xda)};const _0x55a834=[],_0x265942=[];for(const _0x53b9e2 of _0x373306){try{_0x55a834[_0x3ab690(0xff)](await ensureSqlContent(_0x53b9e2));}catch(_0x2a4ff9){_0x265942[_0x3ab690(0xff)]({'sqlCode':_0x53b9e2[_0x3ab690(0xc1)],'error':_0x2a4ff9 instanceof Error?_0x2a4ff9[_0x3ab690(0xf0)]:String(_0x2a4ff9)});}}if(_0x38b6d8&&!_0x5063bc[_0x3ab690(0xeb)]){let _0x19117a=![];for(const _0x2646e4 of _0x55a834){const _0x403736=detectSqlMode(ensureRemoteSqlContent(_0x2646e4)),_0x2855ae=_0x2646e4[_0x3ab690(0xfd)]?await getDbName(_0x5063bc[_0x3ab690(0xcd)],Number(_0x2646e4[_0x3ab690(0xfd)]))[_0x3ab690(0xc8)](()=>undefined):undefined,_0x4c25c0=buildLocalSqlFileContent({'sqlCode':_0x2646e4[_0x3ab690(0xc1)],'sqlName':_0x2646e4[_0x3ab690(0xe4)],'dbId':_0x2646e4[_0x3ab690(0xfd)]},ensureRemoteSqlContent(_0x2646e4),{'dbName':_0x2855ae,'mode':_0x403736,'syncedAt':new Date()[_0x3ab690(0xd7)](),'description':_0x2646e4['description']}),_0x337f07=resolveLocalSqlFilePath(_0x2b8a2a,_0x2646e4[_0x3ab690(0xc1)],buildSqlLockEntry(_0x2646e4,ensureRemoteSqlContent(_0x2646e4),'',{'dbName':_0x2855ae})),_0x3c3c3a=await findExistingSqlFiles(_0x2b8a2a,_0x337f07,_0x403736,_0x1e5029[_0x3ab690(0xc9)][_0x2646e4[_0x3ab690(0xc1)]]),_0x158a25=await compareExistingSqlFiles(_0x3c3c3a,_0x4c25c0,_0x403736);if(_0x158a25['some'](({equivalent:_0xdc190c})=>!_0xdc190c)){_0x19117a=!![];break;}}if(_0x19117a){const _0x395361=await confirmForceOverwrite(_0x3ab690(0xd8));if(!_0x395361)throw CliErrors[_0x3ab690(0xd6)](_0x3ab690(0xf6));}}const _0x4a39c4=cloneSqlLockData(_0x367d94),_0x171eb7=_0x4a39c4[_0x3ab690(0xb9)][_0x2b8a2a[_0x3ab690(0xcd)]],_0x4de8b8=[],_0x50ee86=[];for(const _0x4944e1 of _0x55a834){const _0x36d64e=_0x171eb7['sqls'][_0x4944e1['sqlCode']],_0x487bc7=ensureRemoteSqlContent(_0x4944e1),_0x598492=detectSqlMode(_0x487bc7),_0x499100=_0x4944e1[_0x3ab690(0xfd)]?await getDbName(_0x5063bc[_0x3ab690(0xcd)],Number(_0x4944e1[_0x3ab690(0xfd)]))[_0x3ab690(0xc8)](()=>undefined):undefined,_0x1375d7=buildLocalSqlFileContent({'sqlCode':_0x4944e1[_0x3ab690(0xc1)],'sqlName':_0x4944e1[_0x3ab690(0xe4)],'dbId':_0x4944e1[_0x3ab690(0xfd)]},_0x487bc7,{'dbName':_0x499100,'mode':_0x598492,'syncedAt':new Date()[_0x3ab690(0xd7)](),'description':_0x4944e1[_0x3ab690(0xcb)]}),_0x2d4af1=buildSqlLockEntry(_0x4944e1,_0x487bc7,computeSqlContentHash(_0x1375d7),{'dbName':_0x499100}),_0x5bd5c6=_0x2d4af1[_0x3ab690(0xd1)],_0x5a8d34=join(_0x2b8a2a[_0x3ab690(0xbd)],_0x5bd5c6);try{const _0x32c2e0=await findExistingSqlFiles(_0x2b8a2a,_0x5a8d34,_0x598492,_0x36d64e),_0x4da76a=await compareExistingSqlFiles(_0x32c2e0,_0x1375d7,_0x598492);if(!_0x38b6d8&&_0x4da76a[_0x3ab690(0xd9)](({equivalent:_0xe72b9f})=>!_0xe72b9f)){_0x50ee86[_0x3ab690(0xff)]({'sqlCode':_0x4944e1[_0x3ab690(0xc1)],'reason':_0x3ab690(0xe7)});continue;}const _0x4872dc=_0x4da76a[_0x3ab690(0xe2)](({file:_0x2712ac})=>_0x2712ac[_0x3ab690(0xe9)]),_0x40c278=_0x4da76a[_0x3ab690(0xe2)](({file:_0x5cf39f})=>!_0x5cf39f[_0x3ab690(0xe9)]);if(_0x4872dc?.[_0x3ab690(0xb6)]&&!_0x40c278){_0x50ee86[_0x3ab690(0xff)]({'sqlCode':_0x4944e1[_0x3ab690(0xc1)],'reason':_0x3ab690(0xba)}),_0x171eb7['sqls'][_0x4944e1[_0x3ab690(0xc1)]]={..._0x2d4af1,'hash':computeSqlContentHash(_0x4872dc[_0x3ab690(0xca)]),'path':_0x5bd5c6};continue;}!_0x4872dc?.['equivalent']&&(await ensureParentDirectory(_0x5a8d34),await writeFile(_0x5a8d34,_0x1375d7,_0x3ab690(0xdd))),_0x40c278&&await rm(_0x40c278['file'][_0x3ab690(0xc0)],{'force':!![]}),_0x171eb7[_0x3ab690(0xc9)][_0x4944e1[_0x3ab690(0xc1)]]={..._0x2d4af1,'hash':_0x4872dc?.[_0x3ab690(0xb6)]?computeSqlContentHash(_0x4872dc['content']):_0x2d4af1['hash'],'path':_0x5bd5c6},_0x4de8b8[_0x3ab690(0xff)]({'sqlCode':_0x4944e1[_0x3ab690(0xc1)],'filePath':_0x5a8d34});}catch(_0x18b51d){_0x265942[_0x3ab690(0xff)]({'sqlCode':_0x4944e1[_0x3ab690(0xc1)],'error':_0x18b51d instanceof Error?_0x18b51d[_0x3ab690(0xf0)]:String(_0x18b51d)});}}return _0x171eb7[_0x3ab690(0xf9)]=new Date()[_0x3ab690(0xd7)](),await writeSqlLockFile(_0x2b8a2a[_0x3ab690(0xce)],_0x4a39c4),{'ok':_0x265942[_0x3ab690(0xed)]===0x0,'data':{'pulled':_0x4de8b8,'skipped':_0x50ee86,'failed':_0x265942},'message':_0x3ab690(0xbc)+_0x4de8b8[_0x3ab690(0xed)]+_0x3ab690(0x102)+_0x50ee86['length']+_0x3ab690(0xdf)+_0x265942[_0x3ab690(0xed)]+_0x3ab690(0xf2)};}};function isEquivalentPulledSqlFile(_0x43cea9,_0x256feb,_0xfed297,_0x300eef){if(_0xfed297!==_0x300eef)return normalizePulledSqlBody(_0x43cea9,_0xfed297)===normalizePulledSqlBody(_0x256feb,_0x300eef);return normalizePullComparableContent(_0x43cea9,_0xfed297)===normalizePullComparableContent(_0x256feb,_0x300eef);}async function findExistingSqlFiles(_0x97ce14,_0xa4cd48,_0x489c95,_0x56e1cc){const _0x46eb67=a246_0x46dcea,_0x4f22a9=[];await fileExists(_0xa4cd48)&&_0x4f22a9['push']({'filePath':_0xa4cd48,'mode':_0x489c95,'isCanonical':!![]});if(!_0x56e1cc?.[_0x46eb67(0xd1)])return _0x4f22a9;const _0x208929=join(_0x97ce14[_0x46eb67(0xbd)],_0x56e1cc[_0x46eb67(0xd1)]);if(_0x208929===_0xa4cd48)return _0x4f22a9;return await fileExists(_0x208929)&&_0x4f22a9[_0x46eb67(0xff)]({'filePath':_0x208929,'mode':_0x56e1cc['mode']??modeFromFilePath(_0x208929),'isCanonical':![]}),_0x4f22a9;}async function compareExistingSqlFiles(_0x412a83,_0x232ead,_0xdc56c7){const _0x5854ea=a246_0x46dcea;return Promise[_0x5854ea(0xea)](_0x412a83[_0x5854ea(0xc6)](async _0x235816=>{const _0x331799=_0x5854ea,_0x56df7d=await readFile(_0x235816[_0x331799(0xc0)],_0x331799(0xdd));return{'file':_0x235816,'content':_0x56df7d,'equivalent':isEquivalentPulledSqlFile(_0x56df7d,_0x232ead,_0x235816[_0x331799(0xc4)],_0xdc56c7)};}));}function modeFromFilePath(_0x3e43ac){const _0x43b13a=a246_0x46dcea;return _0x3e43ac[_0x43b13a(0xf1)]()['endsWith'](_0x43b13a(0xcf))?_0x43b13a(0xe8):'sql';}function normalizePulledSqlBody(_0x71d1bf,_0x1dd7d4){const _0x26951b=a246_0x46dcea;return stripLocalSqlMetadata(_0x71d1bf,_0x1dd7d4)[_0x26951b(0xee)](/\r\n/g,'\x0a')[_0x26951b(0xb8)]();}function normalizePullComparableContent(_0x47b9c7,_0x4bcdca){const _0x5ce3f6=a246_0x46dcea,_0x1e55f1=_0x47b9c7[_0x5ce3f6(0xee)](/\r\n/g,'\x0a')[_0x5ce3f6(0xfe)]('\x0a'),_0x2302ba=_0x1e55f1[_0x5ce3f6(0xe6)](_0x9745cf=>!isSyncedAtMetadataLine(_0x9745cf,_0x4bcdca));return _0x2302ba[_0x5ce3f6(0xe5)]('\x0a');}function isSyncedAtMetadataLine(_0x448720,_0x40bf4e){const _0x304261=a246_0x46dcea;if(_0x40bf4e==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x304261(0xfc)](_0x448720);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x304261(0xfc)](_0x448720);}function a246_0x4610(){const _0x2c9c3f=['catch','sqls','content','description','sql','appCode','lockFilePath','.xml','5MMHgOY','path','string','13245860nDuotU','72VLDBrW','1177836PJCnan','cancelled','toISOString','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','some','No\x20remote\x20SQL\x20queries\x20matched.','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','257274jYmraW','utf8','would_pull','\x20skipped,\x20','pull','sqlcode','find','force','sqlName','join','filter','local\x20differs\x20from\x20remote','mybatisXml','isCanonical','all','nonInteractive','Filter\x20by\x20SQL\x20display\x20name','length','replace','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','message','toLowerCase','\x20failed','totalCount','596384ZmCBot','67653ipgefd','Force\x20pull\x20cancelled.','POST','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','lastSync','boolean','read','test','dbId','split','push','sqlContent','name','\x20written,\x20','bool','430419ejHtzr','Would\x20pull\x20','equivalent','Force\x20overwrite\x20local\x20unsynced\x20changes','trim','apps','unchanged','paging','Pull\x20complete:\x20','sqlRootDir','168bFbFBm','\x20SQL\x20file(s)\x20into\x20','filePath','sqlCode','conflict','tableData','mode','str','map','992535CHnWJO'];a246_0x4610=function(){return _0x2c9c3f;};return a246_0x4610();}
@@ -1 +1 @@
1
- const a243_0x11a8fa=a243_0x1f13;(function(_0x4f3c31,_0x2598fa){const _0x2187e4=a243_0x1f13,_0x30440e=_0x4f3c31();while(!![]){try{const _0x47606f=parseInt(_0x2187e4(0x167))/0x1+-parseInt(_0x2187e4(0x16a))/0x2*(-parseInt(_0x2187e4(0x149))/0x3)+parseInt(_0x2187e4(0x163))/0x4*(-parseInt(_0x2187e4(0x151))/0x5)+-parseInt(_0x2187e4(0x146))/0x6*(parseInt(_0x2187e4(0x137))/0x7)+parseInt(_0x2187e4(0x15d))/0x8+-parseInt(_0x2187e4(0x14c))/0x9*(-parseInt(_0x2187e4(0x160))/0xa)+parseInt(_0x2187e4(0x162))/0xb*(-parseInt(_0x2187e4(0x16d))/0xc);if(_0x47606f===_0x2598fa)break;else _0x30440e['push'](_0x30440e['shift']());}catch(_0x394961){_0x30440e['push'](_0x30440e['shift']());}}}(a243_0x555f,0x8f5fd));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 readSqlUploadContent(_0x208ca8){const _0xab583c=a243_0x1f13,_0x47d576=stripLocalSqlMetadata(await readFile(_0x208ca8[_0xab583c(0x141)],_0xab583c(0x139)),_0x208ca8[_0xab583c(0x156)]);if(!_0x47d576[_0xab583c(0x142)]())throw CliErrors[_0xab583c(0x170)](_0x208ca8[_0xab583c(0x159)]+_0xab583c(0x147));return _0x47d576;}async function getTargetSqlQueries(_0x1df4b1,_0x28dceb,_0x45da15){const _0x4aa277=a243_0x1f13,_0x3166b0=await scanLocalSqlQueries(_0x1df4b1),_0x5b296f=new Map();for(const _0x2b3e63 of _0x3166b0){if(_0x45da15&&_0x2b3e63['sqlCode']!==_0x45da15)continue;const _0xec91f0=_0x5b296f[_0x4aa277(0x12f)](_0x2b3e63[_0x4aa277(0x159)])??[];_0xec91f0[_0x4aa277(0x134)](_0x2b3e63),_0x5b296f[_0x4aa277(0x15b)](_0x2b3e63['sqlCode'],_0xec91f0);}if(_0x45da15&&!_0x5b296f[_0x4aa277(0x148)](_0x45da15))throw CliErrors[_0x4aa277(0x170)](_0x4aa277(0x133)+_0x45da15);const _0x32cbe0=[];for(const [_0x20490e,_0x135fc5]of _0x5b296f[_0x4aa277(0x12c)]()){if(_0x135fc5[_0x4aa277(0x175)]===0x1){_0x32cbe0['push'](_0x135fc5[0x0]);continue;}const _0xb0ea57=_0x28dceb['sqls'][_0x20490e],_0x228e4e=_0xb0ea57?.[_0x4aa277(0x152)],_0xd8071=_0x228e4e?_0x135fc5[_0x4aa277(0x143)](_0x5956e7=>_0x5956e7[_0x4aa277(0x13c)]!==_0x228e4e):_0x135fc5;if(_0xb0ea57&&_0xd8071[_0x4aa277(0x175)]===0x1){_0x32cbe0[_0x4aa277(0x134)](_0xd8071[0x0]);continue;}throw CliErrors[_0x4aa277(0x170)](_0x4aa277(0x12e)+_0x20490e+_0x4aa277(0x171));}return _0x32cbe0;}export const sqlPush={'service':a243_0x11a8fa(0x13f),'command':a243_0x11a8fa(0x134),'description':a243_0x11a8fa(0x14a),'risk':a243_0x11a8fa(0x13b),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a243_0x11a8fa(0x164),'description':a243_0x11a8fa(0x16c)}],async 'dryRun'(_0x4957a7){const _0x5b7836=a243_0x11a8fa,_0x5bac7b=loadSqlProjectConfig(_0x4957a7[_0x5b7836(0x169)]),_0xc3934c=await readSqlLockFile(_0x5bac7b['lockFilePath']),{appLock:_0x13265f}=ensureSqlLockScope(_0xc3934c??createEmptySqlLock(),_0x4957a7['appCode'],_0x5bac7b[_0x5b7836(0x166)],_0x5b7836(0x134)),_0x598474=await getTargetSqlQueries(_0x5bac7b,_0x13265f,_0x4957a7[_0x5b7836(0x153)](_0x5b7836(0x15c))||undefined),_0x1aef33=[];for(const _0x3a8b31 of _0x598474){const _0x54c1e6=await computeSqlFileHash(_0x3a8b31[_0x5b7836(0x141)]),_0x17a20a=_0x13265f[_0x5b7836(0x154)][_0x3a8b31[_0x5b7836(0x159)]],_0x289632=!!_0x17a20a&&(_0x17a20a[_0x5b7836(0x152)]!==_0x3a8b31[_0x5b7836(0x13c)]||!!_0x3a8b31['sqlName']&&_0x17a20a['sqlName']!==_0x3a8b31[_0x5b7836(0x168)]||_0x17a20a[_0x5b7836(0x156)]!==_0x3a8b31['mode']);if(!_0x4957a7['bool']('force')&&_0x17a20a&&_0x17a20a['hash']===_0x54c1e6&&!_0x289632)continue;if(!_0x17a20a)throw CliErrors[_0x5b7836(0x170)](_0x3a8b31[_0x5b7836(0x159)]+_0x5b7836(0x12a));if(_0x17a20a[_0x5b7836(0x135)]==null)throw CliErrors[_0x5b7836(0x170)](_0x3a8b31['sqlCode']+_0x5b7836(0x136));await resolveTargetDbBinding(_0x4957a7[_0x5b7836(0x169)],_0x3a8b31,_0x17a20a),await readSqlUploadContent(_0x3a8b31),_0x1aef33[_0x5b7836(0x134)](_0x3a8b31['sqlCode']);}return{'method':_0x5b7836(0x128),'url':_0x5b7836(0x158),'body':{'sqlCodes':_0x1aef33,'appCode':_0x4957a7[_0x5b7836(0x169)]},'description':_0x5b7836(0x14d)+_0x1aef33['length']+_0x5b7836(0x145)};},async 'execute'(_0x356a6b){const _0x301aa5=a243_0x11a8fa,_0x3e1f4b=loadSqlProjectConfig(_0x356a6b['appCode']),_0x1e187e=await readSqlLockFile(_0x3e1f4b[_0x301aa5(0x130)]),{lockData:_0x224c81,appLock:_0x1ed351}=ensureSqlLockScope(_0x1e187e??createEmptySqlLock(),_0x356a6b[_0x301aa5(0x169)],_0x3e1f4b[_0x301aa5(0x166)],_0x301aa5(0x134)),_0x39ba72=await getTargetSqlQueries(_0x3e1f4b,_0x1ed351,_0x356a6b[_0x301aa5(0x153)](_0x301aa5(0x15c))||undefined);if(_0x39ba72[_0x301aa5(0x175)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x2da981=[],_0x3716f3=[],_0x3fa0e8=[];let _0x52866e=![];for(const _0xe4b8b0 of _0x39ba72){const _0xd6c492=_0x1ed351['sqls'][_0xe4b8b0[_0x301aa5(0x159)]];if(!_0xd6c492){_0x3fa0e8[_0x301aa5(0x134)]({'sqlCode':_0xe4b8b0[_0x301aa5(0x159)],'error':_0x301aa5(0x12b)});continue;}try{const _0xd89caa=await computeSqlFileHash(_0xe4b8b0['filePath']),_0x5b40a4=_0xd6c492['path']!==_0xe4b8b0[_0x301aa5(0x13c)]||!!_0xe4b8b0[_0x301aa5(0x168)]&&_0xd6c492[_0x301aa5(0x168)]!==_0xe4b8b0[_0x301aa5(0x168)]||_0xd6c492[_0x301aa5(0x156)]!==_0xe4b8b0['mode'];if(!_0x356a6b[_0x301aa5(0x140)](_0x301aa5(0x16f))&&_0xd6c492['hash']===_0xd89caa&&!_0x5b40a4){_0x3716f3[_0x301aa5(0x134)]({'sqlCode':_0xe4b8b0[_0x301aa5(0x159)],'reason':_0x301aa5(0x13a)});continue;}if(_0xd6c492[_0x301aa5(0x135)]==null){_0x3fa0e8['push']({'sqlCode':_0xe4b8b0[_0x301aa5(0x159)],'error':_0x301aa5(0x138)});continue;}const _0x16da3f=_0xe4b8b0[_0x301aa5(0x168)]||_0xd6c492[_0x301aa5(0x168)],_0x327903=await resolveTargetDbBinding(_0x356a6b['appCode'],_0xe4b8b0,_0xd6c492),_0x2ced9f=await readSqlUploadContent(_0xe4b8b0),_0x1d4877=await updateSqlQuery({'id':_0xd6c492[_0x301aa5(0x16b)],'appCode':_0x356a6b['appCode'],'sqlCode':_0xe4b8b0[_0x301aa5(0x159)],'sqlName':_0x16da3f,'dbId':_0x327903['dbId'],'version':_0xd6c492[_0x301aa5(0x135)],'sqlContent':_0x2ced9f,'sqlConfig':_0xd6c492[_0x301aa5(0x16e)]??undefined}),_0x5ecc7f=_0x1d4877[_0x301aa5(0x172)]?await getDbName(_0x356a6b[_0x301aa5(0x169)],Number(_0x1d4877[_0x301aa5(0x172)]))[_0x301aa5(0x174)](()=>_0x327903[_0x301aa5(0x131)]):_0x327903[_0x301aa5(0x131)];_0x1ed351['sqls'][_0xe4b8b0[_0x301aa5(0x159)]]={...buildSqlLockEntry(_0x1d4877,_0x2ced9f,_0xd89caa,{'dbName':_0x5ecc7f}),'path':_0xe4b8b0['relativePath'],'mode':_0xe4b8b0['mode']},_0x52866e=!![],await archivePreviousSqlFileIfNeeded(_0x3e1f4b,_0xd6c492[_0x301aa5(0x152)],_0xe4b8b0[_0x301aa5(0x13c)]),_0x2da981[_0x301aa5(0x134)]({'sqlCode':_0xe4b8b0[_0x301aa5(0x159)],'remoteId':_0xd6c492[_0x301aa5(0x16b)]});}catch(_0x32a0a1){_0x3fa0e8[_0x301aa5(0x134)]({'sqlCode':_0xe4b8b0[_0x301aa5(0x159)],'error':_0x32a0a1 instanceof Error?_0x32a0a1[_0x301aa5(0x12d)]:String(_0x32a0a1)});}}(_0x52866e||_0x3fa0e8[_0x301aa5(0x175)]===0x0)&&(_0x1ed351[_0x301aa5(0x14e)]=new Date()[_0x301aa5(0x15f)](),await writeSqlLockFile(_0x3e1f4b[_0x301aa5(0x130)],_0x224c81));const _0x324546=_0x3fa0e8['length']===0x0;return{'ok':_0x324546,'data':{'pushed':_0x2da981,'skipped':_0x3716f3,'failed':_0x3fa0e8},'message':_0x301aa5(0x13e)+_0x2da981[_0x301aa5(0x175)]+'\x20pushed,\x20'+_0x3716f3['length']+_0x301aa5(0x150)+_0x3fa0e8[_0x301aa5(0x175)]+_0x301aa5(0x144)};}};async function archivePreviousSqlFileIfNeeded(_0x146c17,_0x384121,_0x392b7a){const _0x4c4be6=a243_0x11a8fa;if(!_0x384121||_0x384121===_0x392b7a)return;const _0x480be7=join(_0x146c17[_0x4c4be6(0x14b)],_0x384121);if(!await fileExists(_0x480be7))return;const _0x2b851e=await moveToTrash(_0x146c17['projectRoot'],_0x146c17[_0x4c4be6(0x173)],_0x480be7);await cleanupEmptyDirectories(dirname(_0x480be7),_0x146c17['sqlRootDir']),void _0x2b851e;}function a243_0x555f(){const _0x42eacc=['has','3GRNLdi','Push\x20local\x20SQL\x20files\x20to\x20remote','sqlRootDir','9OdgWqO','Would\x20push\x20','lastSync','No\x20database\x20matches\x20local\x20directory\x20\x22','\x20skipped,\x20','2879285OJPdUs','path','str','sqls','startsWith','mode','replace','/smartapi/custom/updateUserCustomSql','sqlCode','Local\x20directory\x20\x22','set','sqlcode','5732232PFLXye','\x22\x20for\x20sqlCode\x20','toISOString','4068580TJSQRj','dbDirectory','7415089eNyTWC','8lRLGfu','boolean','isFinite','sqlRoot','938138cMDiao','sqlName','appCode','1890046GTQZHF','remoteId','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','12IyAuht','sqlConfig','force','validation','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','dbId','trashDir','catch','length','POST','join',':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','entries','message','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','get','lockFilePath','dbName','exec','Local\x20SQL\x20not\x20found:\x20','push','version',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','296737HbGcOI','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','utf8','unchanged','write','relativePath','map','Push\x20complete:\x20','sql','bool','filePath','trim','filter','\x20failed','\x20SQL\x20file(s)','84codYhH',':\x20SQL\x20content\x20is\x20empty.'];a243_0x555f=function(){return _0x42eacc;};return a243_0x555f();}async function moveToTrash(_0x56c723,_0x590123,_0x12f475){const _0x348305=a243_0x11a8fa,_0x57fee1=new Date()['toISOString']()[_0x348305(0x157)](/[:.]/g,'-'),_0x43067b=relative(_0x56c723,_0x12f475),_0x4a685d=join(_0x590123,_0x57fee1,_0x43067b);return await mkdir(dirname(_0x4a685d),{'recursive':!![]}),await rename(_0x12f475,_0x4a685d),_0x4a685d;}async function cleanupEmptyDirectories(_0x45b0ec,_0x3527dc){const _0x5f318c=a243_0x11a8fa;let _0x56f701=resolve(_0x45b0ec);const _0x48e01a=resolve(_0x3527dc);while(_0x56f701[_0x5f318c(0x155)](''+_0x48e01a+sep)||_0x56f701===_0x48e01a){if(_0x56f701===_0x48e01a)return;try{const _0x950732=await readdir(_0x56f701);if(_0x950732[_0x5f318c(0x175)]>0x0)return;await rmdir(_0x56f701);}catch{return;}_0x56f701=dirname(_0x56f701);}}async function resolveTargetDbBinding(_0x5ae419,_0xa24a86,_0x3791fd){const _0x569dd3=a243_0x11a8fa,_0x492a56=_0xa24a86[_0x569dd3(0x161)];if(!_0x492a56)return{'dbId':_0x3791fd[_0x569dd3(0x172)],'dbName':_0x3791fd[_0x569dd3(0x131)]};const _0x30012f=buildDbDirectoryName(_0x3791fd[_0x569dd3(0x131)],_0x3791fd[_0x569dd3(0x172)]);if(_0x492a56===_0x30012f)return{'dbId':_0x3791fd[_0x569dd3(0x172)],'dbName':_0x3791fd[_0x569dd3(0x131)]};const _0x403a61=parseExplicitDbDirectory(_0x492a56);if(_0x403a61!=null)return{'dbId':_0x403a61,'dbName':await getDbName(_0x5ae419,_0x403a61)['catch'](()=>undefined)};const _0xcce656=await listDatabases(_0x5ae419),_0xc6cc20=_0xcce656['filter'](_0x1b3e13=>buildDbDirectoryName(_0x1b3e13[_0x569dd3(0x131)],_0x1b3e13['dbId'])===_0x492a56);if(_0xc6cc20['length']===0x1)return{'dbId':_0xc6cc20[0x0][_0x569dd3(0x172)],'dbName':_0xc6cc20[0x0][_0x569dd3(0x131)]};if(_0xc6cc20[_0x569dd3(0x175)]===0x0)throw CliErrors[_0x569dd3(0x170)](_0x569dd3(0x14f)+_0x492a56+_0x569dd3(0x15e)+_0xa24a86['sqlCode']+'.');const _0x4514c0=_0xc6cc20[_0x569dd3(0x13d)](_0x1656b6=>_0x1656b6[_0x569dd3(0x131)]+'\x20('+_0x1656b6[_0x569dd3(0x172)]+')')[_0x569dd3(0x129)](',\x20');throw CliErrors[_0x569dd3(0x170)](_0x569dd3(0x15a)+_0x492a56+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0xa24a86[_0x569dd3(0x159)]+':\x20'+_0x4514c0);}function a243_0x1f13(_0x45223e,_0x1902d1){_0x45223e=_0x45223e-0x128;const _0x555f2b=a243_0x555f();let _0x1f1366=_0x555f2b[_0x45223e];return _0x1f1366;}function parseExplicitDbDirectory(_0x3a3c64){const _0x59b4d5=a243_0x11a8fa,_0x4d1915=/^db-(\d+)$/[_0x59b4d5(0x132)](_0x3a3c64);if(!_0x4d1915)return null;const _0x52f3e8=Number(_0x4d1915[0x1]);return Number[_0x59b4d5(0x165)](_0x52f3e8)&&_0x52f3e8>0x0?_0x52f3e8:null;}
1
+ const a247_0x3e21a1=a247_0x3fd7;(function(_0x347df9,_0x4165f9){const _0x206468=a247_0x3fd7,_0x4ac99d=_0x347df9();while(!![]){try{const _0x331369=parseInt(_0x206468(0x20c))/0x1+parseInt(_0x206468(0x1eb))/0x2*(parseInt(_0x206468(0x1e2))/0x3)+parseInt(_0x206468(0x1d8))/0x4*(-parseInt(_0x206468(0x1e8))/0x5)+parseInt(_0x206468(0x1f4))/0x6*(parseInt(_0x206468(0x1fa))/0x7)+parseInt(_0x206468(0x1ea))/0x8*(parseInt(_0x206468(0x1d0))/0x9)+parseInt(_0x206468(0x203))/0xa*(parseInt(_0x206468(0x1ca))/0xb)+-parseInt(_0x206468(0x20d))/0xc*(parseInt(_0x206468(0x1e7))/0xd);if(_0x331369===_0x4165f9)break;else _0x4ac99d['push'](_0x4ac99d['shift']());}catch(_0xaf4425){_0x4ac99d['push'](_0x4ac99d['shift']());}}}(a247_0x4436,0x63311));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';function a247_0x4436(){const _0x174aa9=['write','appCode','1533904boZoMZ','remoteId','sqlRoot','filter','dbName','\x20skipped,\x20','push','version','get','projectRoot','15WzgmUq','sql','relativePath','trim','force','316381YwDixR','5aIedgn','\x22\x20for\x20sqlCode\x20','5864pBigzp','62998RiLvGm','sqlName','startsWith','bool','sqlCode','str','dbId','\x20pushed,\x20','No\x20local\x20SQL\x20files\x20found.','339468jIfCAB','sqlRootDir','Local\x20directory\x20\x22','validation','\x20SQL\x20file(s)','lastSync','63qqULEv','utf8','\x20failed','replace','boolean','hash','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','Push\x20complete:\x20','mode','150oTVDDa',':\x20SQL\x20content\x20is\x20empty.','Would\x20push\x20','sqls','unchanged','toISOString','sqlcode','length','Push\x20local\x20SQL\x20files\x20to\x20remote','330811TILBzl','372ldQlmK','catch','1529pSiUcb','map','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','/smartapi/custom/updateUserCustomSql','lockFilePath','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','6687eAdmJu',':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','Local\x20SQL\x20not\x20found:\x20','path','message','filePath'];a247_0x4436=function(){return _0x174aa9;};return a247_0x4436();}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';function a247_0x3fd7(_0x1a564f,_0x2beaa1){_0x1a564f=_0x1a564f-0x1ca;const _0x4436a8=a247_0x4436();let _0x3fd7d4=_0x4436a8[_0x1a564f];return _0x3fd7d4;}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function readSqlUploadContent(_0x2dfa66){const _0x2fe421=a247_0x3fd7,_0x193472=stripLocalSqlMetadata(await readFile(_0x2dfa66[_0x2fe421(0x1d5)],_0x2fe421(0x1fb)),_0x2dfa66[_0x2fe421(0x202)]);if(!_0x193472[_0x2fe421(0x1e5)]())throw CliErrors[_0x2fe421(0x1f7)](_0x2dfa66[_0x2fe421(0x1ef)]+_0x2fe421(0x204));return _0x193472;}async function getTargetSqlQueries(_0x24eb76,_0x1434da,_0x164ce2){const _0x4fa9b0=a247_0x3fd7,_0x205a8e=await scanLocalSqlQueries(_0x24eb76),_0x3a2a6a=new Map();for(const _0x391222 of _0x205a8e){if(_0x164ce2&&_0x391222[_0x4fa9b0(0x1ef)]!==_0x164ce2)continue;const _0x376e92=_0x3a2a6a[_0x4fa9b0(0x1e0)](_0x391222['sqlCode'])??[];_0x376e92[_0x4fa9b0(0x1de)](_0x391222),_0x3a2a6a['set'](_0x391222[_0x4fa9b0(0x1ef)],_0x376e92);}if(_0x164ce2&&!_0x3a2a6a['has'](_0x164ce2))throw CliErrors[_0x4fa9b0(0x1f7)](_0x4fa9b0(0x1d2)+_0x164ce2);const _0x43d7c2=[];for(const [_0xb4989,_0x14c43f]of _0x3a2a6a['entries']()){if(_0x14c43f[_0x4fa9b0(0x20a)]===0x1){_0x43d7c2[_0x4fa9b0(0x1de)](_0x14c43f[0x0]);continue;}const _0x4fec58=_0x1434da[_0x4fa9b0(0x206)][_0xb4989],_0x42d67e=_0x4fec58?.[_0x4fa9b0(0x1d3)],_0x4d1833=_0x42d67e?_0x14c43f[_0x4fa9b0(0x1db)](_0x5b1507=>_0x5b1507[_0x4fa9b0(0x1e4)]!==_0x42d67e):_0x14c43f;if(_0x4fec58&&_0x4d1833['length']===0x1){_0x43d7c2[_0x4fa9b0(0x1de)](_0x4d1833[0x0]);continue;}throw CliErrors[_0x4fa9b0(0x1f7)](_0x4fa9b0(0x1cf)+_0xb4989+_0x4fa9b0(0x1cc));}return _0x43d7c2;}export const sqlPush={'service':a247_0x3e21a1(0x1e3),'command':a247_0x3e21a1(0x1de),'description':a247_0x3e21a1(0x20b),'risk':a247_0x3e21a1(0x1d6),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a247_0x3e21a1(0x1e6),'type':a247_0x3e21a1(0x1fe),'description':a247_0x3e21a1(0x200)}],async 'dryRun'(_0x1b1cf1){const _0x1c65d1=a247_0x3e21a1,_0x360301=loadSqlProjectConfig(_0x1b1cf1[_0x1c65d1(0x1d7)]),_0x4218c7=await readSqlLockFile(_0x360301['lockFilePath']),{appLock:_0x217329}=ensureSqlLockScope(_0x4218c7??createEmptySqlLock(),_0x1b1cf1[_0x1c65d1(0x1d7)],_0x360301[_0x1c65d1(0x1da)],_0x1c65d1(0x1de)),_0x57404c=await getTargetSqlQueries(_0x360301,_0x217329,_0x1b1cf1[_0x1c65d1(0x1f0)](_0x1c65d1(0x209))||undefined),_0x2d308c=[];for(const _0x5f4f3f of _0x57404c){const _0x50ad16=await computeSqlFileHash(_0x5f4f3f[_0x1c65d1(0x1d5)]),_0x5a9782=_0x217329[_0x1c65d1(0x206)][_0x5f4f3f[_0x1c65d1(0x1ef)]],_0x58ac30=!!_0x5a9782&&(_0x5a9782[_0x1c65d1(0x1d3)]!==_0x5f4f3f[_0x1c65d1(0x1e4)]||!!_0x5f4f3f['sqlName']&&_0x5a9782[_0x1c65d1(0x1ec)]!==_0x5f4f3f[_0x1c65d1(0x1ec)]||_0x5a9782[_0x1c65d1(0x202)]!==_0x5f4f3f[_0x1c65d1(0x202)]);if(!_0x1b1cf1[_0x1c65d1(0x1ee)](_0x1c65d1(0x1e6))&&_0x5a9782&&_0x5a9782['hash']===_0x50ad16&&!_0x58ac30)continue;if(!_0x5a9782)throw CliErrors[_0x1c65d1(0x1f7)](_0x5f4f3f[_0x1c65d1(0x1ef)]+_0x1c65d1(0x1d1));if(_0x5a9782['version']==null)throw CliErrors[_0x1c65d1(0x1f7)](_0x5f4f3f[_0x1c65d1(0x1ef)]+':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.');await resolveTargetDbBinding(_0x1b1cf1[_0x1c65d1(0x1d7)],_0x5f4f3f,_0x5a9782),await readSqlUploadContent(_0x5f4f3f),_0x2d308c[_0x1c65d1(0x1de)](_0x5f4f3f[_0x1c65d1(0x1ef)]);}return{'method':'POST','url':_0x1c65d1(0x1cd),'body':{'sqlCodes':_0x2d308c,'appCode':_0x1b1cf1[_0x1c65d1(0x1d7)]},'description':_0x1c65d1(0x205)+_0x2d308c['length']+_0x1c65d1(0x1f8)};},async 'execute'(_0x385b1d){const _0x197f8a=a247_0x3e21a1,_0x498c1e=loadSqlProjectConfig(_0x385b1d[_0x197f8a(0x1d7)]),_0x20dae3=await readSqlLockFile(_0x498c1e[_0x197f8a(0x1ce)]),{lockData:_0x567cb9,appLock:_0x2f32c3}=ensureSqlLockScope(_0x20dae3??createEmptySqlLock(),_0x385b1d['appCode'],_0x498c1e[_0x197f8a(0x1da)],_0x197f8a(0x1de)),_0x4b6c88=await getTargetSqlQueries(_0x498c1e,_0x2f32c3,_0x385b1d['str'](_0x197f8a(0x209))||undefined);if(_0x4b6c88[_0x197f8a(0x20a)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x197f8a(0x1f3)};const _0x28278c=[],_0xb88f33=[],_0x51faa6=[];let _0x320614=![];for(const _0x476234 of _0x4b6c88){const _0x45fc03=_0x2f32c3[_0x197f8a(0x206)][_0x476234['sqlCode']];if(!_0x45fc03){_0x51faa6[_0x197f8a(0x1de)]({'sqlCode':_0x476234[_0x197f8a(0x1ef)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x22f7e9=await computeSqlFileHash(_0x476234[_0x197f8a(0x1d5)]),_0x5a5619=_0x45fc03[_0x197f8a(0x1d3)]!==_0x476234[_0x197f8a(0x1e4)]||!!_0x476234[_0x197f8a(0x1ec)]&&_0x45fc03[_0x197f8a(0x1ec)]!==_0x476234['sqlName']||_0x45fc03[_0x197f8a(0x202)]!==_0x476234[_0x197f8a(0x202)];if(!_0x385b1d[_0x197f8a(0x1ee)](_0x197f8a(0x1e6))&&_0x45fc03[_0x197f8a(0x1ff)]===_0x22f7e9&&!_0x5a5619){_0xb88f33['push']({'sqlCode':_0x476234[_0x197f8a(0x1ef)],'reason':_0x197f8a(0x207)});continue;}if(_0x45fc03[_0x197f8a(0x1df)]==null){_0x51faa6['push']({'sqlCode':_0x476234[_0x197f8a(0x1ef)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x147618=_0x476234[_0x197f8a(0x1ec)]||_0x45fc03['sqlName'],_0x2b08af=await resolveTargetDbBinding(_0x385b1d['appCode'],_0x476234,_0x45fc03),_0x1de568=await readSqlUploadContent(_0x476234),_0x19e551=await updateSqlQuery({'id':_0x45fc03[_0x197f8a(0x1d9)],'appCode':_0x385b1d[_0x197f8a(0x1d7)],'sqlCode':_0x476234['sqlCode'],'sqlName':_0x147618,'dbId':_0x2b08af[_0x197f8a(0x1f1)],'version':_0x45fc03['version'],'sqlContent':_0x1de568,'sqlConfig':_0x45fc03['sqlConfig']??undefined}),_0xf95e35=_0x19e551['dbId']?await getDbName(_0x385b1d[_0x197f8a(0x1d7)],Number(_0x19e551['dbId']))['catch'](()=>_0x2b08af[_0x197f8a(0x1dc)]):_0x2b08af[_0x197f8a(0x1dc)];_0x2f32c3['sqls'][_0x476234[_0x197f8a(0x1ef)]]={...buildSqlLockEntry(_0x19e551,_0x1de568,_0x22f7e9,{'dbName':_0xf95e35}),'path':_0x476234[_0x197f8a(0x1e4)],'mode':_0x476234['mode']},_0x320614=!![],await archivePreviousSqlFileIfNeeded(_0x498c1e,_0x45fc03[_0x197f8a(0x1d3)],_0x476234['relativePath']),_0x28278c[_0x197f8a(0x1de)]({'sqlCode':_0x476234[_0x197f8a(0x1ef)],'remoteId':_0x45fc03[_0x197f8a(0x1d9)]});}catch(_0x5a64b9){_0x51faa6[_0x197f8a(0x1de)]({'sqlCode':_0x476234[_0x197f8a(0x1ef)],'error':_0x5a64b9 instanceof Error?_0x5a64b9[_0x197f8a(0x1d4)]:String(_0x5a64b9)});}}(_0x320614||_0x51faa6[_0x197f8a(0x20a)]===0x0)&&(_0x2f32c3[_0x197f8a(0x1f9)]=new Date()[_0x197f8a(0x208)](),await writeSqlLockFile(_0x498c1e[_0x197f8a(0x1ce)],_0x567cb9));const _0x56411c=_0x51faa6[_0x197f8a(0x20a)]===0x0;return{'ok':_0x56411c,'data':{'pushed':_0x28278c,'skipped':_0xb88f33,'failed':_0x51faa6},'message':_0x197f8a(0x201)+_0x28278c[_0x197f8a(0x20a)]+_0x197f8a(0x1f2)+_0xb88f33[_0x197f8a(0x20a)]+_0x197f8a(0x1dd)+_0x51faa6['length']+_0x197f8a(0x1fc)};}};async function archivePreviousSqlFileIfNeeded(_0x3f3303,_0x19bf07,_0xb111dd){const _0x9cc997=a247_0x3e21a1;if(!_0x19bf07||_0x19bf07===_0xb111dd)return;const _0x510569=join(_0x3f3303[_0x9cc997(0x1f5)],_0x19bf07);if(!await fileExists(_0x510569))return;const _0x109742=await moveToTrash(_0x3f3303[_0x9cc997(0x1e1)],_0x3f3303['trashDir'],_0x510569);await cleanupEmptyDirectories(dirname(_0x510569),_0x3f3303[_0x9cc997(0x1f5)]),void _0x109742;}async function moveToTrash(_0x29343f,_0x57a1eb,_0x553275){const _0x52c802=a247_0x3e21a1,_0x3bfe1a=new Date()[_0x52c802(0x208)]()[_0x52c802(0x1fd)](/[:.]/g,'-'),_0xf74a59=relative(_0x29343f,_0x553275),_0x491b3b=join(_0x57a1eb,_0x3bfe1a,_0xf74a59);return await mkdir(dirname(_0x491b3b),{'recursive':!![]}),await rename(_0x553275,_0x491b3b),_0x491b3b;}async function cleanupEmptyDirectories(_0x3af366,_0x5e4dd0){const _0x273fcb=a247_0x3e21a1;let _0x304da8=resolve(_0x3af366);const _0x24d2bf=resolve(_0x5e4dd0);while(_0x304da8[_0x273fcb(0x1ed)](''+_0x24d2bf+sep)||_0x304da8===_0x24d2bf){if(_0x304da8===_0x24d2bf)return;try{const _0x3e0e3f=await readdir(_0x304da8);if(_0x3e0e3f[_0x273fcb(0x20a)]>0x0)return;await rmdir(_0x304da8);}catch{return;}_0x304da8=dirname(_0x304da8);}}async function resolveTargetDbBinding(_0xc88c05,_0x405e74,_0x11c3d1){const _0x3a84ac=a247_0x3e21a1,_0x51453a=_0x405e74['dbDirectory'];if(!_0x51453a)return{'dbId':_0x11c3d1[_0x3a84ac(0x1f1)],'dbName':_0x11c3d1['dbName']};const _0x4ff406=buildDbDirectoryName(_0x11c3d1['dbName'],_0x11c3d1[_0x3a84ac(0x1f1)]);if(_0x51453a===_0x4ff406)return{'dbId':_0x11c3d1[_0x3a84ac(0x1f1)],'dbName':_0x11c3d1[_0x3a84ac(0x1dc)]};const _0x3949ba=parseExplicitDbDirectory(_0x51453a);if(_0x3949ba!=null)return{'dbId':_0x3949ba,'dbName':await getDbName(_0xc88c05,_0x3949ba)[_0x3a84ac(0x20e)](()=>undefined)};const _0x2ec529=await listDatabases(_0xc88c05),_0x5e750c=_0x2ec529['filter'](_0x5d4450=>buildDbDirectoryName(_0x5d4450[_0x3a84ac(0x1dc)],_0x5d4450[_0x3a84ac(0x1f1)])===_0x51453a);if(_0x5e750c[_0x3a84ac(0x20a)]===0x1)return{'dbId':_0x5e750c[0x0][_0x3a84ac(0x1f1)],'dbName':_0x5e750c[0x0][_0x3a84ac(0x1dc)]};if(_0x5e750c[_0x3a84ac(0x20a)]===0x0)throw CliErrors['validation']('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x51453a+_0x3a84ac(0x1e9)+_0x405e74[_0x3a84ac(0x1ef)]+'.');const _0x11c076=_0x5e750c[_0x3a84ac(0x1cb)](_0x4f3d59=>_0x4f3d59[_0x3a84ac(0x1dc)]+'\x20('+_0x4f3d59[_0x3a84ac(0x1f1)]+')')['join'](',\x20');throw CliErrors['validation'](_0x3a84ac(0x1f6)+_0x51453a+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x405e74[_0x3a84ac(0x1ef)]+':\x20'+_0x11c076);}function parseExplicitDbDirectory(_0x1c195e){const _0x553a61=/^db-(\d+)$/['exec'](_0x1c195e);if(!_0x553a61)return null;const _0x22a764=Number(_0x553a61[0x1]);return Number['isFinite'](_0x22a764)&&_0x22a764>0x0?_0x22a764:null;}
@@ -1 +1 @@
1
- const a244_0x34df82=a244_0x52f6;(function(_0xfb1b9c,_0x2a6eb8){const _0xa39f86=a244_0x52f6,_0x344a29=_0xfb1b9c();while(!![]){try{const _0x16ee1d=-parseInt(_0xa39f86(0x1a9))/0x1*(parseInt(_0xa39f86(0x19d))/0x2)+-parseInt(_0xa39f86(0x1b1))/0x3+-parseInt(_0xa39f86(0x19a))/0x4*(parseInt(_0xa39f86(0x1c7))/0x5)+parseInt(_0xa39f86(0x1b5))/0x6+-parseInt(_0xa39f86(0x1b9))/0x7*(-parseInt(_0xa39f86(0x1ac))/0x8)+-parseInt(_0xa39f86(0x1a0))/0x9*(parseInt(_0xa39f86(0x1bf))/0xa)+parseInt(_0xa39f86(0x1a1))/0xb;if(_0x16ee1d===_0x2a6eb8)break;else _0x344a29['push'](_0x344a29['shift']());}catch(_0xabfa95){_0x344a29['push'](_0x344a29['shift']());}}}(a244_0x27fc,0x37610));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=a244_0x34df82(0x1b8);export function buildSqlLockEntry(_0x2ce84a,_0x2bdc9b,_0x2f8d91,_0x449f5d){const _0x2782f6=a244_0x34df82,_0x43fd05=detectSqlMode(_0x2bdc9b);return{'path':buildSqlRelativePath(_0x2ce84a['sqlCode'],_0x2ce84a['sqlName'],_0x449f5d?.[_0x2782f6(0x19c)],_0x43fd05,_0x2ce84a['dbId']),'hash':_0x2f8d91,'remoteId':_0x2ce84a['id'],'version':_0x2ce84a[_0x2782f6(0x1a3)],'dbId':Number(_0x2ce84a['dbId']),'dbName':_0x449f5d?.[_0x2782f6(0x19c)],'sqlName':_0x2ce84a['sqlName'],'sqlConfig':_0x2ce84a[_0x2782f6(0x1b3)]??undefined,'mode':_0x43fd05};}export function cloneSqlLockData(_0x1a4cbc){const _0x2bc0ca=a244_0x34df82;return{'apps':Object[_0x2bc0ca(0x1c0)](Object[_0x2bc0ca(0x1bc)](_0x1a4cbc['apps'])[_0x2bc0ca(0x1c4)](([_0x29c9bc,_0x482b13])=>[_0x29c9bc,{'sqlRoot':_0x482b13['sqlRoot'],'lastSync':_0x482b13[_0x2bc0ca(0x1ae)],'sqls':{..._0x482b13['sqls']}}]))};}export function ensureRemoteSqlContent(_0x3e19bf){const _0x3c70c1=a244_0x34df82;return _0x3e19bf[_0x3c70c1(0x1bd)]??'';}export function buildLocalSqlFileContent(_0x43c64f,_0x3c3b7b,_0x5135c7){const _0x489875=a244_0x34df82,_0x1c510b=_0x5135c7?.['mode']??detectSqlMode(_0x3c3b7b),_0x366d3c=stripLocalSqlMetadata(_0x3c3b7b,_0x1c510b)[_0x489875(0x1a7)](),_0x323b9e=buildMetadataHeaderLines({'sqlCode':_0x43c64f['sqlCode'],'sqlName':_0x43c64f['sqlName'],'dbId':_0x43c64f['dbId'],'dbName':_0x5135c7?.[_0x489875(0x19c)],'mode':_0x1c510b,'syncedAt':_0x5135c7?.['syncedAt'],'description':_0x5135c7?.[_0x489875(0x1c5)]},_0x1c510b),_0xd38c0e=_0x1c510b===_0x489875(0x19b)?splitXmlDeclaration(_0x366d3c):{'body':_0x366d3c},_0x121b0b=[..._0xd38c0e[_0x489875(0x1a6)]?[_0xd38c0e[_0x489875(0x1a6)]]:[],..._0x323b9e,'',_0xd38c0e['body'][_0x489875(0x1af)]()],_0x256891=_0x121b0b[_0x489875(0x1c2)]('\x0a');return _0x256891[_0x489875(0x1b6)]('\x0a')?_0x256891:_0x256891+'\x0a';}export function stripLocalSqlMetadata(_0x168b3d,_0x284bde){const _0x391313=a244_0x34df82;if(_0x284bde===_0x391313(0x19b)){const {declaration:_0x3db8c4,body:_0x2cc5ff}=splitXmlDeclaration(_0x168b3d[_0x391313(0x1c6)](/\r\n/g,'\x0a')),_0x527ad6=stripLeadingMetadataLines(_0x2cc5ff,/^\s*<!--\s*@lovrabet\./);return _0x3db8c4?''+_0x3db8c4+(_0x527ad6?'\x0a'+_0x527ad6:''):_0x527ad6;}return stripLeadingMetadataLines(_0x168b3d[_0x391313(0x1c6)](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0x49d589,_0x2d028d){const _0x5bc723=a244_0x34df82;if(_0x2d028d?.[_0x5bc723(0x1b2)])return _0x2d028d[_0x5bc723(0x1b2)];return detectSqlMode(_0x49d589);}export function resolveSqlFileName(_0x1ff2c7,_0x18d197,_0x390a51){const _0x3ccb08=a244_0x34df82;if(_0x390a51?.['path'])return _0x390a51[_0x3ccb08(0x1bb)];if(_0x390a51?.[_0x3ccb08(0x19e)]||_0x390a51?.[_0x3ccb08(0x19c)])return buildSqlRelativePath(_0x1ff2c7,_0x390a51?.[_0x3ccb08(0x19e)],_0x390a51?.[_0x3ccb08(0x19c)],resolveSqlMode(_0x18d197,_0x390a51),_0x390a51?.['dbId']);return buildDefaultSqlFileName(_0x1ff2c7,resolveSqlMode(_0x18d197,_0x390a51));}export function resolveSqlLocalDir(_0x3c21c5,_0x5dc0ef){return join(_0x3c21c5,SQL_LOCAL_REL_DIR,_0x5dc0ef);}export async function confirmForceOverwrite(_0x333000){const _0x55576a=a244_0x34df82,_0x3ff00a=createInterface({'input':process[_0x55576a(0x1a5)],'output':process[_0x55576a(0x1ab)]}),_0x2b9994=await new Promise(_0xa9b111=>{const _0x211647=_0x55576a;_0x3ff00a['question'](_0x333000+_0x211647(0x1a4),_0xa9b111);});return _0x3ff00a['close'](),['y',_0x55576a(0x1a8)][_0x55576a(0x1ad)](_0x2b9994['trim']()[_0x55576a(0x1b7)]());}export function findSqlLockScope(_0x2565d0,_0x164e00){return _0x2565d0['apps'][_0x164e00];}function a244_0x27fc(){const _0x1ad891=['join','syncedAt','map','description','replace','13470kvwUvN','--\x20@lovrabet.','84JrErsu','mybatisXml','dbName','302lntCoS','sqlName','\x20-->','9XZqSMb','9727586XkEZvZ','filter','version','\x20[y/N]\x20','stdin','declaration','trim','yes','1957zNhazt','sqlCode','stderr','16BZqEVk','includes','lastSync','trimStart','split','1101363hwHcCV','mode','sqlConfig','slice','562218GImzyj','endsWith','toLowerCase','.rabetbase/sql','1207059qnivRk','length','path','entries','sqlContent','test','3768690YimheK','fromEntries','dbId'];a244_0x27fc=function(){return _0x1ad891;};return a244_0x27fc();}function buildMetadataHeaderLines(_0x4cd96c,_0x1de703){const _0x3b8e89=a244_0x34df82,_0x1ffaf2=[[_0x3b8e89(0x1aa),_0x4cd96c[_0x3b8e89(0x1aa)]],[_0x3b8e89(0x19e),_0x4cd96c[_0x3b8e89(0x19e)]],[_0x3b8e89(0x1c1),_0x4cd96c[_0x3b8e89(0x1c1)]],[_0x3b8e89(0x19c),_0x4cd96c['dbName']],[_0x3b8e89(0x1b2),_0x4cd96c[_0x3b8e89(0x1b2)]],[_0x3b8e89(0x1c3),_0x4cd96c['syncedAt']],['description',_0x4cd96c[_0x3b8e89(0x1c5)]]];if(_0x1de703===_0x3b8e89(0x19b))return _0x1ffaf2[_0x3b8e89(0x1a2)](([,_0x526ffb])=>_0x526ffb!==undefined&&_0x526ffb!==null&&String(_0x526ffb)[_0x3b8e89(0x1a7)]()!=='')[_0x3b8e89(0x1c4)](([_0x299b52,_0x503f2f])=>'<!--\x20@lovrabet.'+_0x299b52+':\x20'+String(_0x503f2f)+_0x3b8e89(0x19f));return _0x1ffaf2['filter'](([,_0x55d41a])=>_0x55d41a!==undefined&&_0x55d41a!==null&&String(_0x55d41a)[_0x3b8e89(0x1a7)]()!=='')[_0x3b8e89(0x1c4)](([_0x4d8e4d,_0x438aca])=>_0x3b8e89(0x199)+_0x4d8e4d+':\x20'+String(_0x438aca));}function splitXmlDeclaration(_0x442c58){const _0x160500=a244_0x34df82,_0x56a823=_0x442c58[_0x160500(0x1af)](),_0x95b9=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i['exec'](_0x56a823);if(!_0x95b9)return{'body':_0x442c58};return{'declaration':_0x95b9[0x0],'body':_0x56a823[_0x160500(0x1b4)](_0x95b9[0x0][_0x160500(0x1ba)])};}function a244_0x52f6(_0x257429,_0x561327){_0x257429=_0x257429-0x199;const _0x27fc08=a244_0x27fc();let _0x52f694=_0x27fc08[_0x257429];return _0x52f694;}function stripLeadingMetadataLines(_0x5d361e,_0x17b58e){const _0x3660f1=a244_0x34df82,_0x39bdad=_0x5d361e[_0x3660f1(0x1b0)]('\x0a');let _0x181878=0x0;while(_0x181878<_0x39bdad[_0x3660f1(0x1ba)]){const _0x37bacb=_0x39bdad[_0x181878]??'';if(_0x17b58e[_0x3660f1(0x1be)](_0x37bacb)||_0x37bacb[_0x3660f1(0x1a7)]()===''){_0x181878++;continue;}break;}return _0x39bdad[_0x3660f1(0x1b4)](_0x181878)['join']('\x0a')[_0x3660f1(0x1af)]();}
1
+ (function(_0x2b09bd,_0x1b888e){const _0x5be431=a248_0x10cb,_0x1731cb=_0x2b09bd();while(!![]){try{const _0x58b3c1=parseInt(_0x5be431(0x94))/0x1*(parseInt(_0x5be431(0x82))/0x2)+-parseInt(_0x5be431(0x97))/0x3*(-parseInt(_0x5be431(0x99))/0x4)+parseInt(_0x5be431(0x89))/0x5*(-parseInt(_0x5be431(0x98))/0x6)+-parseInt(_0x5be431(0x8b))/0x7+-parseInt(_0x5be431(0x8f))/0x8*(parseInt(_0x5be431(0x9e))/0x9)+-parseInt(_0x5be431(0xa6))/0xa+-parseInt(_0x5be431(0xa5))/0xb*(-parseInt(_0x5be431(0x84))/0xc);if(_0x58b3c1===_0x1b888e)break;else _0x1731cb['push'](_0x1731cb['shift']());}catch(_0x5093e0){_0x1731cb['push'](_0x1731cb['shift']());}}}(a248_0x30e9,0x26ee6));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x3b5474,_0x13de12,_0x44135d,_0x5f2c57){const _0x3d50b7=a248_0x10cb,_0x4ad9a4=detectSqlMode(_0x13de12);return{'path':buildSqlRelativePath(_0x3b5474[_0x3d50b7(0xa8)],_0x3b5474['sqlName'],_0x5f2c57?.[_0x3d50b7(0xae)],_0x4ad9a4,_0x3b5474[_0x3d50b7(0x9b)]),'hash':_0x44135d,'remoteId':_0x3b5474['id'],'version':_0x3b5474['version'],'dbId':Number(_0x3b5474[_0x3d50b7(0x9b)]),'dbName':_0x5f2c57?.[_0x3d50b7(0xae)],'sqlName':_0x3b5474[_0x3d50b7(0x86)],'sqlConfig':_0x3b5474[_0x3d50b7(0x90)]??undefined,'mode':_0x4ad9a4};}function a248_0x10cb(_0x52372a,_0x3806a1){_0x52372a=_0x52372a-0x80;const _0x30e9f8=a248_0x30e9();let _0x10cb72=_0x30e9f8[_0x52372a];return _0x10cb72;}export function cloneSqlLockData(_0x33cdab){const _0x1df95d=a248_0x10cb;return{'apps':Object['fromEntries'](Object[_0x1df95d(0x8a)](_0x33cdab['apps'])['map'](([_0x4dccb5,_0x25d466])=>[_0x4dccb5,{'sqlRoot':_0x25d466[_0x1df95d(0xa3)],'lastSync':_0x25d466['lastSync'],'sqls':{..._0x25d466[_0x1df95d(0xa7)]}}]))};}export function ensureRemoteSqlContent(_0x3e881a){const _0x21adb8=a248_0x10cb;return _0x3e881a[_0x21adb8(0x87)]??'';}export function buildLocalSqlFileContent(_0xed6a17,_0x25c9ad,_0x4c10a2){const _0x44cfa4=a248_0x10cb,_0x60daa4=_0x4c10a2?.[_0x44cfa4(0xab)]??detectSqlMode(_0x25c9ad),_0x499238=stripLocalSqlMetadata(_0x25c9ad,_0x60daa4)[_0x44cfa4(0x80)](),_0x4139ee=buildMetadataHeaderLines({'sqlCode':_0xed6a17[_0x44cfa4(0xa8)],'sqlName':_0xed6a17[_0x44cfa4(0x86)],'dbId':_0xed6a17[_0x44cfa4(0x9b)],'dbName':_0x4c10a2?.['dbName'],'mode':_0x60daa4,'syncedAt':_0x4c10a2?.[_0x44cfa4(0x8e)],'description':_0x4c10a2?.[_0x44cfa4(0xaa)]},_0x60daa4),_0x5ec557=_0x60daa4===_0x44cfa4(0xa4)?splitXmlDeclaration(_0x499238):{'body':_0x499238},_0x352181=[..._0x5ec557[_0x44cfa4(0x9c)]?[_0x5ec557[_0x44cfa4(0x9c)]]:[],..._0x4139ee,'',_0x5ec557[_0x44cfa4(0x92)][_0x44cfa4(0x8c)]()],_0x5540c6=_0x352181[_0x44cfa4(0xa1)]('\x0a');return _0x5540c6[_0x44cfa4(0x93)]('\x0a')?_0x5540c6:_0x5540c6+'\x0a';}export function stripLocalSqlMetadata(_0x2b7f17,_0x396fb0){const _0x25fbbe=a248_0x10cb;if(_0x396fb0==='mybatisXml'){const {declaration:_0x5a8954,body:_0x2b4b15}=splitXmlDeclaration(_0x2b7f17[_0x25fbbe(0x81)](/\r\n/g,'\x0a')),_0x11b1ab=stripLeadingMetadataLines(_0x2b4b15,/^\s*<!--\s*@lovrabet\./);return _0x5a8954?''+_0x5a8954+(_0x11b1ab?'\x0a'+_0x11b1ab:''):_0x11b1ab;}return stripLeadingMetadataLines(_0x2b7f17['replace'](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0x5817ce,_0x34b5cd){const _0x2cf047=a248_0x10cb;if(_0x34b5cd?.[_0x2cf047(0xab)])return _0x34b5cd[_0x2cf047(0xab)];return detectSqlMode(_0x5817ce);}export function resolveSqlFileName(_0x52453b,_0x578173,_0x196ddc){const _0x3b23a5=a248_0x10cb;if(_0x196ddc?.['path'])return _0x196ddc[_0x3b23a5(0x8d)];if(_0x196ddc?.[_0x3b23a5(0x86)]||_0x196ddc?.['dbName'])return buildSqlRelativePath(_0x52453b,_0x196ddc?.[_0x3b23a5(0x86)],_0x196ddc?.[_0x3b23a5(0xae)],resolveSqlMode(_0x578173,_0x196ddc),_0x196ddc?.['dbId']);return buildDefaultSqlFileName(_0x52453b,resolveSqlMode(_0x578173,_0x196ddc));}export function resolveSqlLocalDir(_0x2b61be,_0x4580be){return join(_0x2b61be,SQL_LOCAL_REL_DIR,_0x4580be);}export async function confirmForceOverwrite(_0xb29607){const _0x3e5978=a248_0x10cb,_0x2d1277=createInterface({'input':process[_0x3e5978(0x96)],'output':process['stderr']}),_0x2bc2b3=await new Promise(_0x3241d5=>{const _0x446a6a=_0x3e5978;_0x2d1277[_0x446a6a(0xa0)](_0xb29607+_0x446a6a(0xad),_0x3241d5);});return _0x2d1277[_0x3e5978(0x9f)](),['y',_0x3e5978(0x85)]['includes'](_0x2bc2b3[_0x3e5978(0x80)]()[_0x3e5978(0x88)]());}export function findSqlLockScope(_0x3df649,_0x9d6236){const _0x42f2af=a248_0x10cb;return _0x3df649[_0x42f2af(0x91)][_0x9d6236];}function a248_0x30e9(){const _0x1881ef=['declaration','length','4482iHDkwq','close','question','join','slice','sqlRoot','mybatisXml','22583ZGktuf','1890670ncqJtx','sqls','sqlCode','filter','description','mode','map','\x20[y/N]\x20','dbName','trim','replace','438586ASCiZv','exec','996HoBmIT','yes','sqlName','sqlContent','toLowerCase','235vNUFqw','entries','14553ViwBFz','trimStart','path','syncedAt','72SYnixN','sqlConfig','apps','body','endsWith','1hkcths','<!--\x20@lovrabet.','stdin','3MsLWcY','30234PHbSSb','808924TgwBVS','\x20-->','dbId'];a248_0x30e9=function(){return _0x1881ef;};return a248_0x30e9();}function buildMetadataHeaderLines(_0xf20858,_0x107643){const _0x305e8a=a248_0x10cb,_0x49a79a=[[_0x305e8a(0xa8),_0xf20858[_0x305e8a(0xa8)]],['sqlName',_0xf20858['sqlName']],[_0x305e8a(0x9b),_0xf20858['dbId']],[_0x305e8a(0xae),_0xf20858['dbName']],['mode',_0xf20858[_0x305e8a(0xab)]],[_0x305e8a(0x8e),_0xf20858[_0x305e8a(0x8e)]],['description',_0xf20858[_0x305e8a(0xaa)]]];if(_0x107643===_0x305e8a(0xa4))return _0x49a79a['filter'](([,_0x2c8f41])=>_0x2c8f41!==undefined&&_0x2c8f41!==null&&String(_0x2c8f41)['trim']()!=='')[_0x305e8a(0xac)](([_0x4c8206,_0x4c652d])=>_0x305e8a(0x95)+_0x4c8206+':\x20'+String(_0x4c652d)+_0x305e8a(0x9a));return _0x49a79a[_0x305e8a(0xa9)](([,_0xdf43a5])=>_0xdf43a5!==undefined&&_0xdf43a5!==null&&String(_0xdf43a5)[_0x305e8a(0x80)]()!=='')[_0x305e8a(0xac)](([_0x10796a,_0x2ecef7])=>'--\x20@lovrabet.'+_0x10796a+':\x20'+String(_0x2ecef7));}function splitXmlDeclaration(_0x3eb386){const _0x3ad8cb=a248_0x10cb,_0x27959f=_0x3eb386[_0x3ad8cb(0x8c)](),_0x59d22d=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i[_0x3ad8cb(0x83)](_0x27959f);if(!_0x59d22d)return{'body':_0x3eb386};return{'declaration':_0x59d22d[0x0],'body':_0x27959f[_0x3ad8cb(0xa2)](_0x59d22d[0x0][_0x3ad8cb(0x9d)])};}function stripLeadingMetadataLines(_0x2445bc,_0x13e814){const _0x28fe51=a248_0x10cb,_0x57d22b=_0x2445bc['split']('\x0a');let _0x161908=0x0;while(_0x161908<_0x57d22b[_0x28fe51(0x9d)]){const _0x1c5c5a=_0x57d22b[_0x161908]??'';if(_0x13e814['test'](_0x1c5c5a)||_0x1c5c5a[_0x28fe51(0x80)]()===''){_0x161908++;continue;}break;}return _0x57d22b[_0x28fe51(0xa2)](_0x161908)[_0x28fe51(0xa1)]('\x0a')[_0x28fe51(0x8c)]();}
@@ -1 +1 @@
1
- const a245_0x5a08af=a245_0x2056;function a245_0x279f(){const _0x1740c7=['relativePath','181673LKVTNO','43356VQjpRz','\x20modified,\x20','has','boolean','lockKey','lockFilePath','1848450FYzYuG','paging','sqlName','map','76764bwinUx','sql','155HwzSqd','read','16CDwexo','sqls','tableData','\x20added,\x20','\x20remote-only','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','2325372BzGCqG','totalCount','filePath','All\x20SQL\x20queries\x20are\x20in\x20sync.','length','3160HYhTuA','bool','status','546417KAziOg','appCode','426InaOOT','\x20missing,\x20','push','sqlRoot','remote'];a245_0x279f=function(){return _0x1740c7;};return a245_0x279f();}(function(_0x224c5a,_0x4d8f5f){const _0x3704da=a245_0x2056,_0x2af60b=_0x224c5a();while(!![]){try{const _0x32d732=parseInt(_0x3704da(0x1fd))/0x1+-parseInt(_0x3704da(0x1e3))/0x2+-parseInt(_0x3704da(0x1f7))/0x3*(parseInt(_0x3704da(0x1f2))/0x4)+-parseInt(_0x3704da(0x1e5))/0x5*(parseInt(_0x3704da(0x1fe))/0x6)+parseInt(_0x3704da(0x1ed))/0x7+parseInt(_0x3704da(0x1e7))/0x8*(-parseInt(_0x3704da(0x1f5))/0x9)+parseInt(_0x3704da(0x204))/0xa;if(_0x32d732===_0x4d8f5f)break;else _0x2af60b['push'](_0x2af60b['shift']());}catch(_0x476544){_0x2af60b['push'](_0x2af60b['shift']());}}}(a245_0x279f,0x317e0));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a245_0x2056(_0x3f0851,_0x2a0eb9){_0x3f0851=_0x3f0851-0x1e3;const _0x279f32=a245_0x279f();let _0x205691=_0x279f32[_0x3f0851];return _0x205691;}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(_0x1393d4){const _0x3be216=a245_0x2056,_0x55bf3b=[];let _0x260a00=0x1;while(!![]){const _0x4f83f4=await listSqlQueries(_0x1393d4,{'currentPage':_0x260a00,'pageSize':PAGE_SIZE}),_0x530fef=_0x4f83f4[_0x3be216(0x1e9)]??[];_0x55bf3b[_0x3be216(0x1f9)](..._0x530fef[_0x3be216(0x207)](_0x31b399=>_0x31b399['sqlCode']));if(_0x530fef[_0x3be216(0x1f1)]===0x0)break;const _0x84750e=_0x4f83f4[_0x3be216(0x205)]?.[_0x3be216(0x1ee)];if(_0x84750e!=null?_0x55bf3b[_0x3be216(0x1f1)]>=_0x84750e:_0x530fef['length']<PAGE_SIZE)break;_0x260a00++;}return _0x55bf3b;}export const sqlStatus={'service':a245_0x5a08af(0x1e4),'command':a245_0x5a08af(0x1f4),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a245_0x5a08af(0x1e6),'flags':[{'name':a245_0x5a08af(0x1fb),'type':a245_0x5a08af(0x201),'description':a245_0x5a08af(0x1ec)}],async 'execute'(_0x68b3d3){const _0x2fa968=a245_0x5a08af,_0x3b3472=loadSqlProjectConfig(_0x68b3d3[_0x2fa968(0x1f6)]),_0x1fda41=await readSqlLockFile(_0x3b3472[_0x2fa968(0x203)]),{appLock:_0x3cbd9c}=ensureSqlLockScope(_0x1fda41??createEmptySqlLock(),_0x3b3472[_0x2fa968(0x1f6)],_0x3b3472[_0x2fa968(0x1fa)],_0x2fa968(0x1f4)),_0x3168e6=await scanLocalSqlQueries(_0x3b3472),_0x4e9573=[],_0xa601a0=[],_0x5f6ef6=[],_0x1fe958=[],_0x1c2dc4=new Set(_0x3168e6[_0x2fa968(0x207)](_0x3c06d0=>_0x3c06d0[_0x2fa968(0x202)]));for(const _0x33497b of _0x3168e6){const _0x38fea5=await computeSqlFileHash(_0x33497b[_0x2fa968(0x1ef)]),_0x43cf5b=_0x3cbd9c['sqls'][_0x33497b[_0x2fa968(0x202)]],_0xbe8e7c=!!_0x43cf5b&&_0x43cf5b['path']!==_0x33497b[_0x2fa968(0x1fc)],_0x174961=!!_0x43cf5b&&!!_0x33497b[_0x2fa968(0x206)]&&_0x43cf5b[_0x2fa968(0x206)]!==_0x33497b[_0x2fa968(0x206)];if(!_0x43cf5b)_0x4e9573[_0x2fa968(0x1f9)](_0x33497b['lockKey']);else _0x43cf5b['hash']!==_0x38fea5||_0xbe8e7c||_0x174961?_0xa601a0[_0x2fa968(0x1f9)](_0x33497b['lockKey']):_0x5f6ef6['push'](_0x33497b[_0x2fa968(0x202)]);}for(const _0x8f0c60 of Object['keys'](_0x3cbd9c['sqls'])){!_0x1c2dc4[_0x2fa968(0x200)](_0x8f0c60)&&_0x1fe958['push'](_0x8f0c60);}const _0x2e8ac5=[];if(_0x68b3d3[_0x2fa968(0x1f3)](_0x2fa968(0x1fb))){const _0x390a88=await fetchAllSqlCodes(_0x68b3d3[_0x2fa968(0x1f6)]);for(const _0x341f92 of _0x390a88){!_0x1c2dc4[_0x2fa968(0x200)](_0x341f92)&&!_0x3cbd9c[_0x2fa968(0x1e8)][_0x341f92]&&_0x2e8ac5[_0x2fa968(0x1f9)](_0x341f92);}}const _0x5ac1c1=_0x4e9573[_0x2fa968(0x1f1)]===0x0&&_0xa601a0[_0x2fa968(0x1f1)]===0x0&&_0x1fe958['length']===0x0&&_0x2e8ac5['length']===0x0;return{'ok':!![],'data':{'added':_0x4e9573,'modified':_0xa601a0,'missing':_0x1fe958,'unchanged':_0x5f6ef6,'remoteOnly':_0x2e8ac5},'message':_0x5ac1c1?_0x2fa968(0x1f0):_0x4e9573[_0x2fa968(0x1f1)]+_0x2fa968(0x1ea)+_0xa601a0[_0x2fa968(0x1f1)]+_0x2fa968(0x1ff)+_0x1fe958[_0x2fa968(0x1f1)]+_0x2fa968(0x1f8)+_0x5f6ef6[_0x2fa968(0x1f1)]+'\x20unchanged'+(_0x2e8ac5[_0x2fa968(0x1f1)]>0x0?',\x20'+_0x2e8ac5['length']+_0x2fa968(0x1eb):'')};}};
1
+ const a249_0x94d34c=a249_0x4d07;(function(_0x55d5a1,_0x18bda1){const _0xa373f0=a249_0x4d07,_0x2d441a=_0x55d5a1();while(!![]){try{const _0x503f59=-parseInt(_0xa373f0(0x192))/0x1*(-parseInt(_0xa373f0(0x1ab))/0x2)+-parseInt(_0xa373f0(0x1a9))/0x3+parseInt(_0xa373f0(0x19a))/0x4*(parseInt(_0xa373f0(0x1a2))/0x5)+parseInt(_0xa373f0(0x1a1))/0x6+-parseInt(_0xa373f0(0x199))/0x7+-parseInt(_0xa373f0(0x19b))/0x8+parseInt(_0xa373f0(0x1a0))/0x9;if(_0x503f59===_0x18bda1)break;else _0x2d441a['push'](_0x2d441a['shift']());}catch(_0xbcc2a2){_0x2d441a['push'](_0x2d441a['shift']());}}}(a249_0xa3ec,0x87c67));function a249_0xa3ec(){const _0x3719de=['9947484nJZifr','5669916MXjWrd','1370BBuEOL','sqls','\x20missing,\x20','status','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','boolean','lockFilePath','2905344qwFCVY','remote','2AjUiFC','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','map','push','path','sql','\x20unchanged','tableData','sqlRoot','All\x20SQL\x20queries\x20are\x20in\x20sync.','\x20remote-only','keys','\x20modified,\x20','relativePath','156201tgBXSq','length','read','lockKey','totalCount','\x20added,\x20','sqlName','3397023RvebfS','4896VMurfY','4255736WSYNcR','hash','filePath','sqlCode','has'];a249_0xa3ec=function(){return _0x3719de;};return a249_0xa3ec();}import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';function a249_0x4d07(_0xd6c7eb,_0x52727b){_0xd6c7eb=_0xd6c7eb-0x187;const _0xa3ec42=a249_0xa3ec();let _0x4d07fc=_0xa3ec42[_0xd6c7eb];return _0x4d07fc;}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(_0x22c0df){const _0x59f708=a249_0x4d07,_0x13e8de=[];let _0xe7770d=0x1;while(!![]){const _0x21689c=await listSqlQueries(_0x22c0df,{'currentPage':_0xe7770d,'pageSize':PAGE_SIZE}),_0x5560de=_0x21689c[_0x59f708(0x18b)]??[];_0x13e8de[_0x59f708(0x187)](..._0x5560de[_0x59f708(0x1ad)](_0x572cf7=>_0x572cf7[_0x59f708(0x19e)]));if(_0x5560de['length']===0x0)break;const _0x32cd69=_0x21689c['paging']?.[_0x59f708(0x196)];if(_0x32cd69!=null?_0x13e8de[_0x59f708(0x193)]>=_0x32cd69:_0x5560de[_0x59f708(0x193)]<PAGE_SIZE)break;_0xe7770d++;}return _0x13e8de;}export const sqlStatus={'service':a249_0x94d34c(0x189),'command':'status','description':a249_0x94d34c(0x1a6),'risk':a249_0x94d34c(0x194),'flags':[{'name':a249_0x94d34c(0x1aa),'type':a249_0x94d34c(0x1a7),'description':a249_0x94d34c(0x1ac)}],async 'execute'(_0x49bea0){const _0x3a0130=a249_0x94d34c,_0x226771=loadSqlProjectConfig(_0x49bea0['appCode']),_0x1af69a=await readSqlLockFile(_0x226771[_0x3a0130(0x1a8)]),{appLock:_0x154b13}=ensureSqlLockScope(_0x1af69a??createEmptySqlLock(),_0x226771['appCode'],_0x226771[_0x3a0130(0x18c)],_0x3a0130(0x1a5)),_0x3f2542=await scanLocalSqlQueries(_0x226771),_0x3d7a0a=[],_0x3c057a=[],_0x395f75=[],_0x2b90f9=[],_0x773d5b=new Set(_0x3f2542[_0x3a0130(0x1ad)](_0x3d0342=>_0x3d0342['lockKey']));for(const _0x21263b of _0x3f2542){const _0x28e7e9=await computeSqlFileHash(_0x21263b[_0x3a0130(0x19d)]),_0x4fdfbe=_0x154b13[_0x3a0130(0x1a3)][_0x21263b[_0x3a0130(0x195)]],_0x18de74=!!_0x4fdfbe&&_0x4fdfbe[_0x3a0130(0x188)]!==_0x21263b[_0x3a0130(0x191)],_0x23c88c=!!_0x4fdfbe&&!!_0x21263b[_0x3a0130(0x198)]&&_0x4fdfbe[_0x3a0130(0x198)]!==_0x21263b[_0x3a0130(0x198)];if(!_0x4fdfbe)_0x3d7a0a[_0x3a0130(0x187)](_0x21263b['lockKey']);else _0x4fdfbe[_0x3a0130(0x19c)]!==_0x28e7e9||_0x18de74||_0x23c88c?_0x3c057a[_0x3a0130(0x187)](_0x21263b[_0x3a0130(0x195)]):_0x395f75[_0x3a0130(0x187)](_0x21263b[_0x3a0130(0x195)]);}for(const _0x2c32ff of Object[_0x3a0130(0x18f)](_0x154b13['sqls'])){!_0x773d5b[_0x3a0130(0x19f)](_0x2c32ff)&&_0x2b90f9[_0x3a0130(0x187)](_0x2c32ff);}const _0x3efe53=[];if(_0x49bea0['bool']('remote')){const _0x39806c=await fetchAllSqlCodes(_0x49bea0['appCode']);for(const _0x527306 of _0x39806c){!_0x773d5b[_0x3a0130(0x19f)](_0x527306)&&!_0x154b13[_0x3a0130(0x1a3)][_0x527306]&&_0x3efe53['push'](_0x527306);}}const _0x4b3dc5=_0x3d7a0a[_0x3a0130(0x193)]===0x0&&_0x3c057a[_0x3a0130(0x193)]===0x0&&_0x2b90f9[_0x3a0130(0x193)]===0x0&&_0x3efe53[_0x3a0130(0x193)]===0x0;return{'ok':!![],'data':{'added':_0x3d7a0a,'modified':_0x3c057a,'missing':_0x2b90f9,'unchanged':_0x395f75,'remoteOnly':_0x3efe53},'message':_0x4b3dc5?_0x3a0130(0x18d):_0x3d7a0a['length']+_0x3a0130(0x197)+_0x3c057a[_0x3a0130(0x193)]+_0x3a0130(0x190)+_0x2b90f9[_0x3a0130(0x193)]+_0x3a0130(0x1a4)+_0x395f75[_0x3a0130(0x193)]+_0x3a0130(0x18a)+(_0x3efe53[_0x3a0130(0x193)]>0x0?',\x20'+_0x3efe53[_0x3a0130(0x193)]+_0x3a0130(0x18e):'')};}};
@@ -1 +1 @@
1
- const a246_0x8d4bae=a246_0x35a0;function a246_0x35a0(_0x598690,_0x27e619){_0x598690=_0x598690-0x1a7;const _0x1459e5=a246_0x1459();let _0x35a0cb=_0x1459e5[_0x598690];return _0x35a0cb;}(function(_0x574b99,_0x3b6cba){const _0x3ce26a=a246_0x35a0,_0x3e9ecd=_0x574b99();while(!![]){try{const _0x4b172f=parseInt(_0x3ce26a(0x1e4))/0x1*(parseInt(_0x3ce26a(0x1d1))/0x2)+-parseInt(_0x3ce26a(0x1c1))/0x3+parseInt(_0x3ce26a(0x1cd))/0x4*(-parseInt(_0x3ce26a(0x1b9))/0x5)+-parseInt(_0x3ce26a(0x1d5))/0x6+-parseInt(_0x3ce26a(0x1ce))/0x7*(-parseInt(_0x3ce26a(0x1d8))/0x8)+-parseInt(_0x3ce26a(0x1b8))/0x9+-parseInt(_0x3ce26a(0x1c8))/0xa*(-parseInt(_0x3ce26a(0x1b1))/0xb);if(_0x4b172f===_0x3b6cba)break;else _0x3e9ecd['push'](_0x3e9ecd['shift']());}catch(_0x59bf5f){_0x3e9ecd['push'](_0x3e9ecd['shift']());}}}(a246_0x1459,0xd5933));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a246_0x1459(){const _0x42bd2a=['read','4633191LagQqL','isSelectOnly','indexes','flagMissing','filter','\x22\x20not\x20found\x20or\x20not\x20accessible','flatMap','20pkRIrF','sqlType','columnNames','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','indexName','8XjotCY','4351137HaNrTm','validate','reason','382jnoJPX','str','dbtableConfig','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','7738020VxNzuR','schema:','primary','8HmtoKH','valid','Provide\x20--file\x20or\x20--sql','push','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','SQL\x20schema\x20validation','index_columns','--check-indexes\x20requires\x20--schemas.','toLowerCase','schemas','split','find','7001ombvXD','schemaWarnings','tables','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','type','message','index_type','map','validation','index_name','isDangerous','string','trim','length','get','file','from','cwd','13598475emZmbL','isArray','boolean','unshift','sql','Dataset\x20\x22','dataset','1770732CtWEJi','1314035uenLRG','check-indexes','name','tableName','parameters','columns','\x22\x20not\x20found\x20in\x20any\x20dataset'];a246_0x1459=function(){return _0x42bd2a;};return a246_0x1459();}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':'sql','command':a246_0x8d4bae(0x1cf),'description':a246_0x8d4bae(0x1d4),'risk':a246_0x8d4bae(0x1c0),'flags':[{'name':a246_0x8d4bae(0x1ae),'type':a246_0x8d4bae(0x1aa),'description':a246_0x8d4bae(0x1dc)},{'name':a246_0x8d4bae(0x1b5),'type':a246_0x8d4bae(0x1aa),'description':a246_0x8d4bae(0x1e7)},{'name':a246_0x8d4bae(0x1e1),'type':a246_0x8d4bae(0x1aa),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a246_0x8d4bae(0x1ba),'type':a246_0x8d4bae(0x1b3),'description':a246_0x8d4bae(0x1cb)}],async 'execute'(_0x32ca5e){const _0x173e4c=a246_0x8d4bae,_0x52fe18=_0x32ca5e[_0x173e4c(0x1d2)](_0x173e4c(0x1ae)),_0x1de4b8=_0x32ca5e[_0x173e4c(0x1d2)](_0x173e4c(0x1b5)),_0x580174=_0x32ca5e[_0x173e4c(0x1d2)](_0x173e4c(0x1e1)),_0x47185f=_0x32ca5e['bool'](_0x173e4c(0x1ba));if(!_0x52fe18&&!_0x1de4b8)throw CliErrors[_0x173e4c(0x1c4)](_0x173e4c(0x1ae),_0x173e4c(0x1da));if(_0x47185f&&!_0x580174)throw CliErrors['validation'](_0x173e4c(0x1df));let _0x10c09c;if(_0x52fe18){const _0x8be814=resolve(process[_0x173e4c(0x1b0)](),_0x52fe18);if(!existsSync(_0x8be814))throw CliErrors[_0x173e4c(0x1a7)]('File\x20not\x20found:\x20'+_0x8be814);_0x10c09c=readFileSync(_0x8be814,'utf-8');}else _0x10c09c=_0x1de4b8;const _0x4e5f24=validateSql(_0x10c09c),_0x5aee0e={'valid':_0x4e5f24[_0x173e4c(0x1d9)],'sqlType':_0x4e5f24['sqlType'][_0x173e4c(0x1e8)],'isSelectOnly':_0x4e5f24[_0x173e4c(0x1c9)][_0x173e4c(0x1c2)],'isLockingRead':_0x4e5f24[_0x173e4c(0x1c9)]['isLockingRead']??![],'isDangerous':_0x4e5f24['sqlType'][_0x173e4c(0x1a9)],'tables':_0x4e5f24[_0x173e4c(0x1e6)],'parameters':_0x4e5f24[_0x173e4c(0x1bd)],'message':_0x4e5f24[_0x173e4c(0x1e9)]};_0x4e5f24[_0x173e4c(0x1c9)]['reason']&&(_0x5aee0e[_0x173e4c(0x1d0)]=_0x4e5f24['sqlType']['reason']);if(_0x580174&&_0x4e5f24[_0x173e4c(0x1d9)]){const _0xe3c11c=_0x580174[_0x173e4c(0x1e2)](',')[_0x173e4c(0x1eb)](_0x1fe9dc=>_0x1fe9dc[_0x173e4c(0x1ab)]())[_0x173e4c(0x1c5)](Boolean),_0x434489=[],_0x34c203=[],_0x2a5611=filterDbTableBackedDatasets(await listDatasets(_0x32ca5e['appCode'])),_0x51ef00=new Map(_0x2a5611[_0x173e4c(0x1eb)](_0x4801c0=>[_0x4801c0[_0x173e4c(0x1d3)]?.[_0x173e4c(0x1bc)]?.[_0x173e4c(0x1e0)](),_0x4801c0]));for(const _0x35f235 of _0x4e5f24[_0x173e4c(0x1e6)]){const _0x1831f5=_0x51ef00[_0x173e4c(0x1ad)](_0x35f235[_0x173e4c(0x1e0)]());!_0x1831f5&&_0x434489[_0x173e4c(0x1db)]('Table\x20\x22'+_0x35f235+_0x173e4c(0x1bf));}for(const _0x5b749d of _0xe3c11c){let _0x3f3359;try{_0x3f3359=await getDatasetDetail(_0x5b749d);}catch{_0x434489[_0x173e4c(0x1db)](_0x173e4c(0x1b6)+_0x5b749d+_0x173e4c(0x1c6));continue;}assertDatasetIsDbTableBacked(_0x3f3359,_0x173e4c(0x1dd));const _0x8c9ae2=Array['isArray'](_0x3f3359['fields'])?_0x3f3359['fields']:[],_0x2aaa2f=new Set(_0x8c9ae2['map'](_0x3e7342=>_0x3e7342[_0x173e4c(0x1bb)]?.['toLowerCase']())),_0x231028=_0x3f3359[_0x173e4c(0x1d3)]?.['tableName']||_0x3f3359[_0x173e4c(0x1bc)]||_0x5b749d;_0x5aee0e[_0x173e4c(0x1d6)+_0x231028]={'code':_0x5b749d,'tableName':_0x231028,'fieldCount':_0x2aaa2f['size'],'fields':Array[_0x173e4c(0x1af)](_0x2aaa2f)};if(_0x47185f){const _0x261816=normalizeDatasetIndexes(_0x3f3359);_0x34c203['push']({'tableName':_0x231028,..._0x261816});}}_0x434489[_0x173e4c(0x1ac)]>0x0&&(_0x5aee0e[_0x173e4c(0x1e5)]=_0x434489),_0x47185f&&(_0x5aee0e['joinAudit']=auditSqlJoinIndexes(_0x10c09c,_0x34c203));}return{'ok':_0x4e5f24[_0x173e4c(0x1d9)],'data':_0x5aee0e,'message':_0x4e5f24['message']};}};function normalizeDatasetIndexes(_0x3934f4){const _0x1bf1e4=a246_0x8d4bae,_0x54796e=Array[_0x1bf1e4(0x1b2)](_0x3934f4?.[_0x1bf1e4(0x1b7)]?.[_0x1bf1e4(0x1c3)])?_0x3934f4['dataset'][_0x1bf1e4(0x1c3)]:Array['isArray'](_0x3934f4?.['indexes'])?_0x3934f4['indexes']:[],_0x517cf4=_0x54796e[_0x1bf1e4(0x1c7)](_0x314245=>{const _0x4fadb9=_0x1bf1e4,_0x1924f0=Array[_0x4fadb9(0x1b2)](_0x314245?.[_0x4fadb9(0x1de)])?_0x314245[_0x4fadb9(0x1de)]:Array[_0x4fadb9(0x1b2)](_0x314245?.[_0x4fadb9(0x1ca)])?_0x314245[_0x4fadb9(0x1ca)]:Array[_0x4fadb9(0x1b2)](_0x314245?.[_0x4fadb9(0x1be)])?_0x314245[_0x4fadb9(0x1be)]:[],_0x111258=_0x1924f0[_0x4fadb9(0x1c5)](_0x2411ea=>typeof _0x2411ea===_0x4fadb9(0x1aa))['map'](_0x56846f=>_0x56846f[_0x4fadb9(0x1ab)]())[_0x4fadb9(0x1c5)](Boolean);if(_0x111258['length']===0x0)return[];const _0x2c0ca3=[_0x314245?.[_0x4fadb9(0x1cc)],_0x314245?.[_0x4fadb9(0x1a8)],_0x314245?.[_0x4fadb9(0x1bb)]][_0x4fadb9(0x1e3)](_0x5952ff=>typeof _0x5952ff==='string'&&_0x5952ff[_0x4fadb9(0x1ab)]()),_0x1917ce=[_0x314245?.[_0x4fadb9(0x1ea)],_0x314245?.[_0x4fadb9(0x1e8)]]['find'](_0x3af4c2=>typeof _0x3af4c2===_0x4fadb9(0x1aa)&&_0x3af4c2[_0x4fadb9(0x1ab)]());return[{..._0x2c0ca3?{'name':_0x2c0ca3['trim']()}:{},..._0x1917ce?{'type':_0x1917ce[_0x4fadb9(0x1ab)]()}:{},'columns':_0x111258}];}),_0x3c5280=[..._0x517cf4],_0x32edb4=typeof _0x3934f4?.[_0x1bf1e4(0x1d3)]?.['pkField']===_0x1bf1e4(0x1aa)?_0x3934f4[_0x1bf1e4(0x1d3)]['pkField'][_0x1bf1e4(0x1e2)](',')[_0x1bf1e4(0x1eb)](_0x28cbd1=>_0x28cbd1[_0x1bf1e4(0x1ab)]())[_0x1bf1e4(0x1c5)](Boolean):[];return _0x32edb4[_0x1bf1e4(0x1ac)]>0x0&&_0x3c5280[_0x1bf1e4(0x1b4)]({'type':_0x1bf1e4(0x1d7),'columns':_0x32edb4}),{'indexes':_0x3c5280,'metadataAvailable':_0x517cf4[_0x1bf1e4(0x1ac)]>0x0};}
1
+ const a250_0x1bfc40=a250_0x3422;function a250_0x3422(_0x394226,_0xa91c6c){_0x394226=_0x394226-0x6a;const _0x1158e5=a250_0x1158();let _0x3422a5=_0x1158e5[_0x394226];return _0x3422a5;}(function(_0x2e4fe3,_0x6a65ef){const _0x3fe6fc=a250_0x3422,_0x260a50=_0x2e4fe3();while(!![]){try{const _0x388851=-parseInt(_0x3fe6fc(0xa8))/0x1+parseInt(_0x3fe6fc(0x75))/0x2*(-parseInt(_0x3fe6fc(0x97))/0x3)+parseInt(_0x3fe6fc(0x90))/0x4+parseInt(_0x3fe6fc(0x9b))/0x5+parseInt(_0x3fe6fc(0x72))/0x6+parseInt(_0x3fe6fc(0x8a))/0x7*(parseInt(_0x3fe6fc(0x71))/0x8)+parseInt(_0x3fe6fc(0x84))/0x9;if(_0x388851===_0x6a65ef)break;else _0x260a50['push'](_0x260a50['shift']());}catch(_0x3878d3){_0x260a50['push'](_0x260a50['shift']());}}}(a250_0x1158,0x2d592));function a250_0x1158(){const _0x2b2750=['utf-8','1953488gYepJE','318600MDVFJb','tables','schemaWarnings','11366MBJYWp','check-indexes','dbtableConfig','validation','index_columns','schemas','push','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','split','fields','find','--check-indexes\x20requires\x20--schemas.','sql','valid','index_type','1395414YvgTGd','message','filter','joinAudit','Table\x20\x22','columns','7uEfpRs','sqlType','file','unshift','validate','parameters','358632IWsjzs','tableName','size','schema:','str','indexName','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','132OCoTxq','dataset','columnNames','map','364030bsckHB','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','toLowerCase','pkField','isArray','\x22\x20not\x20found\x20or\x20not\x20accessible','type','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','SQL\x20schema\x20validation','length','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','isSelectOnly','trim','178998rDhqML','name','primary','indexes','string','reason','flatMap','boolean','Dataset\x20\x22','isLockingRead'];a250_0x1158=function(){return _0x2b2750;};return a250_0x1158();}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':a250_0x1bfc40(0x81),'command':a250_0x1bfc40(0x8e),'description':a250_0x1bfc40(0x7c),'risk':'read','flags':[{'name':'file','type':a250_0x1bfc40(0x6a),'description':a250_0x1bfc40(0x96)},{'name':a250_0x1bfc40(0x81),'type':'string','description':a250_0x1bfc40(0xa5)},{'name':a250_0x1bfc40(0x7a),'type':a250_0x1bfc40(0x6a),'description':a250_0x1bfc40(0xa2)},{'name':a250_0x1bfc40(0x76),'type':a250_0x1bfc40(0x6d),'description':a250_0x1bfc40(0x9c)}],async 'execute'(_0x550623){const _0x3b4ec3=a250_0x1bfc40,_0x41ff0c=_0x550623[_0x3b4ec3(0x94)](_0x3b4ec3(0x8c)),_0x55002c=_0x550623[_0x3b4ec3(0x94)](_0x3b4ec3(0x81)),_0xd0c4d1=_0x550623['str'](_0x3b4ec3(0x7a)),_0x27066c=_0x550623['bool'](_0x3b4ec3(0x76));if(!_0x41ff0c&&!_0x55002c)throw CliErrors['flagMissing']('file','Provide\x20--file\x20or\x20--sql');if(_0x27066c&&!_0xd0c4d1)throw CliErrors[_0x3b4ec3(0x78)](_0x3b4ec3(0x80));let _0x167518;if(_0x41ff0c){const _0x70cd=resolve(process['cwd'](),_0x41ff0c);if(!existsSync(_0x70cd))throw CliErrors[_0x3b4ec3(0x78)]('File\x20not\x20found:\x20'+_0x70cd);_0x167518=readFileSync(_0x70cd,_0x3b4ec3(0x70));}else _0x167518=_0x55002c;const _0x2f3912=validateSql(_0x167518),_0x3df70b={'valid':_0x2f3912[_0x3b4ec3(0x82)],'sqlType':_0x2f3912[_0x3b4ec3(0x8b)][_0x3b4ec3(0xa1)],'isSelectOnly':_0x2f3912[_0x3b4ec3(0x8b)][_0x3b4ec3(0xa6)],'isLockingRead':_0x2f3912[_0x3b4ec3(0x8b)][_0x3b4ec3(0x6f)]??![],'isDangerous':_0x2f3912['sqlType']['isDangerous'],'tables':_0x2f3912['tables'],'parameters':_0x2f3912[_0x3b4ec3(0x8f)],'message':_0x2f3912[_0x3b4ec3(0x85)]};_0x2f3912[_0x3b4ec3(0x8b)][_0x3b4ec3(0x6b)]&&(_0x3df70b['reason']=_0x2f3912[_0x3b4ec3(0x8b)][_0x3b4ec3(0x6b)]);if(_0xd0c4d1&&_0x2f3912[_0x3b4ec3(0x82)]){const _0x10f441=_0xd0c4d1['split'](',')['map'](_0x4aee66=>_0x4aee66['trim']())[_0x3b4ec3(0x86)](Boolean),_0x2205b8=[],_0x201175=[],_0x334379=filterDbTableBackedDatasets(await listDatasets(_0x550623['appCode'])),_0x575fe9=new Map(_0x334379[_0x3b4ec3(0x9a)](_0x474c88=>[_0x474c88[_0x3b4ec3(0x77)]?.[_0x3b4ec3(0x91)]?.[_0x3b4ec3(0x9d)](),_0x474c88]));for(const _0x59ee32 of _0x2f3912[_0x3b4ec3(0x73)]){const _0x349986=_0x575fe9['get'](_0x59ee32[_0x3b4ec3(0x9d)]());!_0x349986&&_0x2205b8[_0x3b4ec3(0x7b)](_0x3b4ec3(0x88)+_0x59ee32+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x1b98d2 of _0x10f441){let _0x162e67;try{_0x162e67=await getDatasetDetail(_0x1b98d2);}catch{_0x2205b8[_0x3b4ec3(0x7b)](_0x3b4ec3(0x6e)+_0x1b98d2+_0x3b4ec3(0xa0));continue;}assertDatasetIsDbTableBacked(_0x162e67,_0x3b4ec3(0xa3));const _0x207b7a=Array[_0x3b4ec3(0x9f)](_0x162e67[_0x3b4ec3(0x7e)])?_0x162e67[_0x3b4ec3(0x7e)]:[],_0x76410c=new Set(_0x207b7a[_0x3b4ec3(0x9a)](_0x32963d=>_0x32963d[_0x3b4ec3(0xa9)]?.['toLowerCase']())),_0x194b1c=_0x162e67['dbtableConfig']?.[_0x3b4ec3(0x91)]||_0x162e67[_0x3b4ec3(0x91)]||_0x1b98d2;_0x3df70b[_0x3b4ec3(0x93)+_0x194b1c]={'code':_0x1b98d2,'tableName':_0x194b1c,'fieldCount':_0x76410c[_0x3b4ec3(0x92)],'fields':Array['from'](_0x76410c)};if(_0x27066c){const _0x368c08=normalizeDatasetIndexes(_0x162e67);_0x201175[_0x3b4ec3(0x7b)]({'tableName':_0x194b1c,..._0x368c08});}}_0x2205b8['length']>0x0&&(_0x3df70b[_0x3b4ec3(0x74)]=_0x2205b8),_0x27066c&&(_0x3df70b[_0x3b4ec3(0x87)]=auditSqlJoinIndexes(_0x167518,_0x201175));}return{'ok':_0x2f3912[_0x3b4ec3(0x82)],'data':_0x3df70b,'message':_0x2f3912[_0x3b4ec3(0x85)]};}};function normalizeDatasetIndexes(_0x9f2170){const _0x576a5d=a250_0x1bfc40,_0x3b6609=Array[_0x576a5d(0x9f)](_0x9f2170?.[_0x576a5d(0x98)]?.[_0x576a5d(0xab)])?_0x9f2170['dataset'][_0x576a5d(0xab)]:Array[_0x576a5d(0x9f)](_0x9f2170?.[_0x576a5d(0xab)])?_0x9f2170[_0x576a5d(0xab)]:[],_0x4aee50=_0x3b6609[_0x576a5d(0x6c)](_0x4687f1=>{const _0x3b58a9=_0x576a5d,_0x509088=Array[_0x3b58a9(0x9f)](_0x4687f1?.[_0x3b58a9(0x79)])?_0x4687f1[_0x3b58a9(0x79)]:Array[_0x3b58a9(0x9f)](_0x4687f1?.[_0x3b58a9(0x99)])?_0x4687f1['columnNames']:Array[_0x3b58a9(0x9f)](_0x4687f1?.['columns'])?_0x4687f1[_0x3b58a9(0x89)]:[],_0x414ce9=_0x509088[_0x3b58a9(0x86)](_0x4cb87a=>typeof _0x4cb87a==='string')[_0x3b58a9(0x9a)](_0x454389=>_0x454389[_0x3b58a9(0xa7)]())[_0x3b58a9(0x86)](Boolean);if(_0x414ce9[_0x3b58a9(0xa4)]===0x0)return[];const _0x9bc339=[_0x4687f1?.[_0x3b58a9(0x95)],_0x4687f1?.['index_name'],_0x4687f1?.[_0x3b58a9(0xa9)]][_0x3b58a9(0x7f)](_0x16734f=>typeof _0x16734f===_0x3b58a9(0x6a)&&_0x16734f['trim']()),_0x5d23c8=[_0x4687f1?.[_0x3b58a9(0x83)],_0x4687f1?.[_0x3b58a9(0xa1)]][_0x3b58a9(0x7f)](_0x23e8cc=>typeof _0x23e8cc===_0x3b58a9(0x6a)&&_0x23e8cc['trim']());return[{..._0x9bc339?{'name':_0x9bc339[_0x3b58a9(0xa7)]()}:{},..._0x5d23c8?{'type':_0x5d23c8['trim']()}:{},'columns':_0x414ce9}];}),_0x5798b5=[..._0x4aee50],_0x1e64d7=typeof _0x9f2170?.[_0x576a5d(0x77)]?.['pkField']===_0x576a5d(0x6a)?_0x9f2170[_0x576a5d(0x77)][_0x576a5d(0x9e)][_0x576a5d(0x7d)](',')['map'](_0x20e18d=>_0x20e18d['trim']())['filter'](Boolean):[];return _0x1e64d7[_0x576a5d(0xa4)]>0x0&&_0x5798b5[_0x576a5d(0x8d)]({'type':_0x576a5d(0xaa),'columns':_0x1e64d7}),{'indexes':_0x5798b5,'metadataAvailable':_0x4aee50['length']>0x0};}
@@ -1 +1 @@
1
- function a247_0x49fc(){const _0x279b11=['13cGOAaF','640629XMBmsS','1137997gELQxr','687804wLjqQB','18718AImQTV','267942RCIARq','5jDnZci','2400WgyLvb','5183620nrQuWq','42jxKzRE','732evetOx','8rMFktK','9TkGmth'];a247_0x49fc=function(){return _0x279b11;};return a247_0x49fc();}function a247_0x10f7(_0x35859b,_0x547a03){_0x35859b=_0x35859b-0x16d;const _0x49fcb4=a247_0x49fc();let _0x10f780=_0x49fcb4[_0x35859b];return _0x10f780;}(function(_0x1ebfee,_0x14624e){const _0x422089=a247_0x10f7,_0x473996=_0x1ebfee();while(!![]){try{const _0x49baca=parseInt(_0x422089(0x176))/0x1*(-parseInt(_0x422089(0x16e))/0x2)+parseInt(_0x422089(0x16f))/0x3*(parseInt(_0x422089(0x179))/0x4)+parseInt(_0x422089(0x178))/0x5*(-parseInt(_0x422089(0x177))/0x6)+parseInt(_0x422089(0x174))/0x7*(parseInt(_0x422089(0x170))/0x8)+-parseInt(_0x422089(0x171))/0x9*(-parseInt(_0x422089(0x16d))/0xa)+-parseInt(_0x422089(0x173))/0xb+-parseInt(_0x422089(0x175))/0xc*(parseInt(_0x422089(0x172))/0xd);if(_0x49baca===_0x14624e)break;else _0x473996['push'](_0x473996['shift']());}catch(_0x2e91c6){_0x473996['push'](_0x473996['shift']());}}}(a247_0x49fc,0x42e7a));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
1
+ (function(_0x1ce5b8,_0x258cbc){const _0x5e8436=a251_0x4406,_0x1a8236=_0x1ce5b8();while(!![]){try{const _0x5ba1da=-parseInt(_0x5e8436(0x81))/0x1*(-parseInt(_0x5e8436(0x76))/0x2)+parseInt(_0x5e8436(0x7e))/0x3*(-parseInt(_0x5e8436(0x79))/0x4)+-parseInt(_0x5e8436(0x7c))/0x5*(-parseInt(_0x5e8436(0x7a))/0x6)+-parseInt(_0x5e8436(0x77))/0x7*(parseInt(_0x5e8436(0x7b))/0x8)+parseInt(_0x5e8436(0x78))/0x9*(parseInt(_0x5e8436(0x80))/0xa)+parseInt(_0x5e8436(0x7d))/0xb+-parseInt(_0x5e8436(0x7f))/0xc;if(_0x5ba1da===_0x258cbc)break;else _0x1a8236['push'](_0x1a8236['shift']());}catch(_0x3b7047){_0x1a8236['push'](_0x1a8236['shift']());}}}(a251_0x3eca,0xbd532));function a251_0x4406(_0x336bbb,_0x5261ab){_0x336bbb=_0x336bbb-0x76;const _0x3eca40=a251_0x3eca();let _0x440678=_0x3eca40[_0x336bbb];return _0x440678;}import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];function a251_0x3eca(){const _0x432249=['25039164UhDxvH','10kCqskJ','1joBelp','2114034dJwYQK','7XaUghY','6312051tAFPMU','80VwMSIW','24NDqOCu','2008504GovXWO','882860yZMUjg','10812010cCZFfr','50163oSsEYD'];a251_0x3eca=function(){return _0x432249;};return a251_0x3eca();}
@@ -1 +1 @@
1
- function a248_0x27e2(_0x54e92d,_0x1a54c2){_0x54e92d=_0x54e92d-0x140;const _0x2680d7=a248_0x2680();let _0x27e258=_0x2680d7[_0x54e92d];return _0x27e258;}const a248_0x5a6198=a248_0x27e2;(function(_0x34d231,_0x3ca7e1){const _0x474d7d=a248_0x27e2,_0x1aceca=_0x34d231();while(!![]){try{const _0x404b8e=parseInt(_0x474d7d(0x143))/0x1*(parseInt(_0x474d7d(0x152))/0x2)+parseInt(_0x474d7d(0x141))/0x3*(-parseInt(_0x474d7d(0x144))/0x4)+parseInt(_0x474d7d(0x156))/0x5+-parseInt(_0x474d7d(0x14a))/0x6+parseInt(_0x474d7d(0x14d))/0x7*(parseInt(_0x474d7d(0x145))/0x8)+-parseInt(_0x474d7d(0x147))/0x9+parseInt(_0x474d7d(0x149))/0xa;if(_0x404b8e===_0x3ca7e1)break;else _0x1aceca['push'](_0x1aceca['shift']());}catch(_0x2b03cd){_0x1aceca['push'](_0x1aceca['shift']());}}}(a248_0x2680,0xd40e6));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':'task','command':'status','description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':a248_0x5a6198(0x148),'defaultOutputFormat':'compress','structuredErrors':!![],'flags':[{'name':a248_0x5a6198(0x14f),'type':a248_0x5a6198(0x157),'required':!![],'description':a248_0x5a6198(0x150)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x25c4fb){const _0x2b3e53=a248_0x5a6198;if(!_0x25c4fb[_0x2b3e53(0x153)](_0x2b3e53(0x14f))['trim']())throw CliErrors[_0x2b3e53(0x14b)](_0x2b3e53(0x14f));},async 'execute'(_0x1d13ac){const _0x3ca69c=a248_0x5a6198,_0x15f4c0=_0x1d13ac[_0x3ca69c(0x153)](_0x3ca69c(0x14f))[_0x3ca69c(0x146)](),_0x2a5ea8=normalizeAsyncTask(await getAsyncTaskStatus(_0x15f4c0,_0x1d13ac[_0x3ca69c(0x14e)],_0x1d13ac[_0x3ca69c(0x142)]));if(_0x2a5ea8[_0x3ca69c(0x151)]!==_0x15f4c0)throw CliErrors[_0x3ca69c(0x140)](_0x3ca69c(0x14c)+_0x15f4c0+_0x3ca69c(0x155)+_0x2a5ea8[_0x3ca69c(0x151)]+'.');const _0x440484=buildAsyncTaskStatusCommand(_0x2a5ea8[_0x3ca69c(0x151)],_0x1d13ac[_0x3ca69c(0x14e)]);return{'ok':!![],'message':asyncTaskMessage(_0x2a5ea8),'data':{'appCode':_0x1d13ac['appCode'],..._0x2a5ea8,'query':_0x2a5ea8[_0x3ca69c(0x154)]?null:{'command':_0x440484}}};}};function a248_0x2680(){const _0x18d2a7=['1582770ofJxdN','string','apiError','2635614yykQDN','cookie','2ATtoFU','4oBxWsC','5106808TcHfYU','trim','10383786ZfWvqR','read','214010fyzgnL','1567590DejdjH','flagMissing','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','14AZyGOM','appCode','task-id','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','taskId','1547482eLLpCW','str','isTerminal',',\x20received\x20'];a248_0x2680=function(){return _0x18d2a7;};return a248_0x2680();}
1
+ const a252_0x3a081b=a252_0x51bd;(function(_0x4e3416,_0xae6be6){const _0x1e28fb=a252_0x51bd,_0x3ea74b=_0x4e3416();while(!![]){try{const _0x6a3cec=-parseInt(_0x1e28fb(0x151))/0x1+parseInt(_0x1e28fb(0x15b))/0x2+-parseInt(_0x1e28fb(0x147))/0x3*(parseInt(_0x1e28fb(0x157))/0x4)+parseInt(_0x1e28fb(0x159))/0x5*(parseInt(_0x1e28fb(0x15e))/0x6)+parseInt(_0x1e28fb(0x14f))/0x7+parseInt(_0x1e28fb(0x14b))/0x8*(-parseInt(_0x1e28fb(0x152))/0x9)+parseInt(_0x1e28fb(0x15a))/0xa;if(_0x6a3cec===_0xae6be6)break;else _0x3ea74b['push'](_0x3ea74b['shift']());}catch(_0x26b048){_0x3ea74b['push'](_0x3ea74b['shift']());}}}(a252_0x1b09,0xab2fc));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';function a252_0x51bd(_0x2a753c,_0x14c78c){_0x2a753c=_0x2a753c-0x147;const _0x1b09a7=a252_0x1b09();let _0x51bd0c=_0x1b09a7[_0x2a753c];return _0x51bd0c;}import{CliErrors}from'../../errors.js';function a252_0x1b09(){const _0x5f5c29=['apiError','string','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','1220fymMer','task','25SmIkBZ','14687290NoFEVd','1773100xlIpAc','cookie','isTerminal','1471656vEMneS','10731YHMKuF','appCode','trim','str','454808yeJUqz','read','task-id','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','71288vdiPUO','taskId','1231168MCNMlG','90FiJeTH'];a252_0x1b09=function(){return _0x5f5c29;};return a252_0x1b09();}export const taskStatus={'service':a252_0x3a081b(0x158),'command':'status','description':a252_0x3a081b(0x156),'risk':a252_0x3a081b(0x14c),'defaultOutputFormat':'compress','structuredErrors':!![],'flags':[{'name':a252_0x3a081b(0x14d),'type':a252_0x3a081b(0x154),'required':!![],'description':a252_0x3a081b(0x14e)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2c6ff5){const _0x2cfbb7=a252_0x3a081b;if(!_0x2c6ff5[_0x2cfbb7(0x14a)](_0x2cfbb7(0x14d))[_0x2cfbb7(0x149)]())throw CliErrors['flagMissing'](_0x2cfbb7(0x14d));},async 'execute'(_0x104e98){const _0x1b9010=a252_0x3a081b,_0x2e50dc=_0x104e98[_0x1b9010(0x14a)](_0x1b9010(0x14d))['trim'](),_0x841cee=normalizeAsyncTask(await getAsyncTaskStatus(_0x2e50dc,_0x104e98[_0x1b9010(0x148)],_0x104e98[_0x1b9010(0x15c)]));if(_0x841cee[_0x1b9010(0x150)]!==_0x2e50dc)throw CliErrors[_0x1b9010(0x153)](_0x1b9010(0x155)+_0x2e50dc+',\x20received\x20'+_0x841cee['taskId']+'.');const _0xe57881=buildAsyncTaskStatusCommand(_0x841cee[_0x1b9010(0x150)],_0x104e98[_0x1b9010(0x148)]);return{'ok':!![],'message':asyncTaskMessage(_0x841cee),'data':{'appCode':_0x104e98[_0x1b9010(0x148)],..._0x841cee,'query':_0x841cee[_0x1b9010(0x15d)]?null:{'command':_0xe57881}}};}};
@@ -1 +1 @@
1
- (function(_0x42d63b,_0x5e158e){const _0x373b2b=a249_0x3654,_0x5a71cc=_0x42d63b();while(!![]){try{const _0x8b9cf6=-parseInt(_0x373b2b(0x10f))/0x1*(parseInt(_0x373b2b(0x110))/0x2)+parseInt(_0x373b2b(0x114))/0x3+parseInt(_0x373b2b(0x10d))/0x4+parseInt(_0x373b2b(0x10b))/0x5+parseInt(_0x373b2b(0x10c))/0x6+-parseInt(_0x373b2b(0x112))/0x7*(-parseInt(_0x373b2b(0x111))/0x8)+parseInt(_0x373b2b(0x113))/0x9*(-parseInt(_0x373b2b(0x10e))/0xa);if(_0x8b9cf6===_0x5e158e)break;else _0x5a71cc['push'](_0x5a71cc['shift']());}catch(_0x120b2b){_0x5a71cc['push'](_0x5a71cc['shift']());}}}(a249_0x4683,0xe8274));function a249_0x3654(_0x2af9f2,_0x2eae32){_0x2af9f2=_0x2af9f2-0x10b;const _0x46834a=a249_0x4683();let _0x3654f6=_0x46834a[_0x2af9f2];return _0x3654f6;}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a249_0x4683(){const _0x50a773=['5374128pbNIBB','266360pmFtOl','305936TaMUNw','10xjWjyZ','3212528RzETer','14FzJZse','693vmNsuW','215919FDyRaU','6655215jhSral','5891232ewLYUd'];a249_0x4683=function(){return _0x50a773;};return a249_0x4683();}export const tenantDefinitions=[tenantMembersListDefinition];
1
+ (function(_0x15745f,_0x1b09d7){const _0x8b9d6f=a253_0x5323,_0x505a63=_0x15745f();while(!![]){try{const _0x440d9c=-parseInt(_0x8b9d6f(0xc1))/0x1*(-parseInt(_0x8b9d6f(0xba))/0x2)+parseInt(_0x8b9d6f(0xbe))/0x3+parseInt(_0x8b9d6f(0xbd))/0x4*(parseInt(_0x8b9d6f(0xbf))/0x5)+parseInt(_0x8b9d6f(0xbc))/0x6+parseInt(_0x8b9d6f(0xc2))/0x7+parseInt(_0x8b9d6f(0xc0))/0x8+-parseInt(_0x8b9d6f(0xb9))/0x9*(parseInt(_0x8b9d6f(0xbb))/0xa);if(_0x440d9c===_0x1b09d7)break;else _0x505a63['push'](_0x505a63['shift']());}catch(_0x27c07a){_0x505a63['push'](_0x505a63['shift']());}}}(a253_0x2b94,0x2a700));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a253_0x5323(_0x47cc49,_0x2bb5cb){_0x47cc49=_0x47cc49-0xb9;const _0x2b9426=a253_0x2b94();let _0x532389=_0x2b9426[_0x47cc49];return _0x532389;}function a253_0x2b94(){const _0x4f3f85=['27411tfoGhW','1124347xHANTy','18DWLlPl','10vJNFPD','5151730lizCuu','1856538rvgEHh','685004rkihRE','635370PtywtW','5CYlwpy','1712240akZPHm'];a253_0x2b94=function(){return _0x4f3f85;};return a253_0x2b94();}export const tenantDefinitions=[tenantMembersListDefinition];
@@ -1 +1 @@
1
- const a250_0x1701ea=a250_0x36d6;(function(_0x5d081e,_0x57432a){const _0x32be3f=a250_0x36d6,_0x2d10b9=_0x5d081e();while(!![]){try{const _0x49f7d2=-parseInt(_0x32be3f(0xd2))/0x1*(parseInt(_0x32be3f(0xc7))/0x2)+-parseInt(_0x32be3f(0xc2))/0x3*(-parseInt(_0x32be3f(0xd0))/0x4)+-parseInt(_0x32be3f(0xcd))/0x5+-parseInt(_0x32be3f(0xc9))/0x6+parseInt(_0x32be3f(0xd4))/0x7+parseInt(_0x32be3f(0xbe))/0x8*(parseInt(_0x32be3f(0xcf))/0x9)+-parseInt(_0x32be3f(0xc6))/0xa*(-parseInt(_0x32be3f(0xd3))/0xb);if(_0x49f7d2===_0x57432a)break;else _0x2d10b9['push'](_0x2d10b9['shift']());}catch(_0xd29e42){_0x2d10b9['push'](_0x2d10b9['shift']());}}}(a250_0x2ffa,0xe8b1e));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a250_0x36d6(_0x176419,_0x1d43d8){_0x176419=_0x176419-0xbd;const _0x2ffac4=a250_0x2ffa();let _0x36d69c=_0x2ffac4[_0x176419];return _0x36d69c;}import{CliErrors}from'../../errors.js';function a250_0x2ffa(){const _0x3596be=['9878568chJWPu','Exact\x20tenant\x20code','tenant','tenant-code','6036345DVOkAb','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','10539UQgQHN','4OjNxGL','flagMissing','3PRfYsz','44132gzoExo','3641967dXnmBy','Pass\x20--tenant-code\x20<code>.','Found\x20','10536jvNZzV','members-list','\x20tenant\x20member(s)','str','4509666wyarLY','trim','length','read','4570oKfrNY','1061586lwaqdp','string'];a250_0x2ffa=function(){return _0x3596be;};return a250_0x2ffa();}import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a250_0x1701ea(0xcb),'command':a250_0x1701ea(0xbf),'description':a250_0x1701ea(0xce),'risk':a250_0x1701ea(0xc5),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'tenant-code','type':a250_0x1701ea(0xc8),'required':!![],'description':a250_0x1701ea(0xca)}],async 'validate'(_0x3c21d0){const _0x172b6e=a250_0x1701ea;if(!_0x3c21d0[_0x172b6e(0xc1)](_0x172b6e(0xcc))[_0x172b6e(0xc3)]())throw CliErrors[_0x172b6e(0xd1)]('tenant-code',_0x172b6e(0xd5));},async 'execute'(_0x4cbbfa){const _0x152a50=a250_0x1701ea,_0x24dd13=_0x4cbbfa['str'](_0x152a50(0xcc))[_0x152a50(0xc3)](),_0x537f54=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x24dd13,_0x537f54);const _0xeb063e=projectTenantMembers(await listTenantDirectoryMembers(_0x24dd13));return{'ok':!![],'data':{'tenantCode':_0x24dd13,'items':_0xeb063e,'totalCount':_0xeb063e[_0x152a50(0xc4)]},'message':_0x152a50(0xbd)+_0xeb063e[_0x152a50(0xc4)]+_0x152a50(0xc0)};}};
1
+ const a254_0x93d997=a254_0x3098;(function(_0x3ff282,_0x4c9fff){const _0x4db546=a254_0x3098,_0x1288d4=_0x3ff282();while(!![]){try{const _0xa3b600=parseInt(_0x4db546(0x179))/0x1*(-parseInt(_0x4db546(0x186))/0x2)+-parseInt(_0x4db546(0x16f))/0x3*(-parseInt(_0x4db546(0x170))/0x4)+-parseInt(_0x4db546(0x17b))/0x5+-parseInt(_0x4db546(0x174))/0x6*(-parseInt(_0x4db546(0x181))/0x7)+-parseInt(_0x4db546(0x176))/0x8*(-parseInt(_0x4db546(0x182))/0x9)+-parseInt(_0x4db546(0x184))/0xa*(-parseInt(_0x4db546(0x171))/0xb)+-parseInt(_0x4db546(0x183))/0xc;if(_0xa3b600===_0x4c9fff)break;else _0x1288d4['push'](_0x1288d4['shift']());}catch(_0x2344ff){_0x1288d4['push'](_0x1288d4['shift']());}}}(a254_0x4f16,0x9c773));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a254_0x3098(_0x36bb26,_0x1fe11c){_0x36bb26=_0x36bb26-0x16f;const _0x4f161c=a254_0x4f16();let _0x3098ac=_0x4f161c[_0x36bb26];return _0x3098ac;}function a254_0x4f16(){const _0x437f15=['List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','60882WGxdbM','flagMissing','8aDNxhr','trim','tenant-code','2oiNske','str','2313905ltnSsi','tenant','members-list','length','Found\x20','\x20tenant\x20member(s)','462zTfcKV','10041795odUwNw','15316032BWJRqP','140VaPJCx','read','815092qmQCOL','string','15CkdOVU','1019908jVVkaP','105875NOHwjJ','Pass\x20--tenant-code\x20<code>.'];a254_0x4f16=function(){return _0x437f15;};return a254_0x4f16();}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a254_0x93d997(0x17c),'command':a254_0x93d997(0x17d),'description':a254_0x93d997(0x173),'risk':a254_0x93d997(0x185),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'tenant-code','type':a254_0x93d997(0x187),'required':!![],'description':'Exact\x20tenant\x20code'}],async 'validate'(_0x2c88ee){const _0x5962bd=a254_0x93d997;if(!_0x2c88ee[_0x5962bd(0x17a)]('tenant-code')[_0x5962bd(0x177)]())throw CliErrors[_0x5962bd(0x175)]('tenant-code',_0x5962bd(0x172));},async 'execute'(_0x2d0450){const _0x1d4897=a254_0x93d997,_0x55842c=_0x2d0450['str'](_0x1d4897(0x178))['trim'](),_0x4ada18=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x55842c,_0x4ada18);const _0x2696e6=projectTenantMembers(await listTenantDirectoryMembers(_0x55842c));return{'ok':!![],'data':{'tenantCode':_0x55842c,'items':_0x2696e6,'totalCount':_0x2696e6[_0x1d4897(0x17e)]},'message':_0x1d4897(0x17f)+_0x2696e6[_0x1d4897(0x17e)]+_0x1d4897(0x180)};}};
@@ -1 +1 @@
1
- (function(_0x542820,_0xf35acf){const _0x526f41=a251_0x3274,_0x3c8eb=_0x542820();while(!![]){try{const _0xd8d33b=parseInt(_0x526f41(0x12e))/0x1*(-parseInt(_0x526f41(0x124))/0x2)+-parseInt(_0x526f41(0x13b))/0x3+parseInt(_0x526f41(0x125))/0x4*(-parseInt(_0x526f41(0x131))/0x5)+-parseInt(_0x526f41(0x129))/0x6*(parseInt(_0x526f41(0x132))/0x7)+-parseInt(_0x526f41(0x123))/0x8*(parseInt(_0x526f41(0x135))/0x9)+parseInt(_0x526f41(0x12b))/0xa+-parseInt(_0x526f41(0x137))/0xb*(-parseInt(_0x526f41(0x134))/0xc);if(_0xd8d33b===_0xf35acf)break;else _0x3c8eb['push'](_0x3c8eb['shift']());}catch(_0x511659){_0x3c8eb['push'](_0x3c8eb['shift']());}}}(a251_0x3290,0x3128f));import{CliErrors}from'../../errors.js';function textOrNull(_0x3a0198){const _0x24fe59=a251_0x3274,_0x155f0d=_0x3a0198?.[_0x24fe59(0x122)]();return _0x155f0d?_0x155f0d:null;}function a251_0x3274(_0x19bd8f,_0x3366d5){_0x19bd8f=_0x19bd8f-0x121;const _0x329083=a251_0x3290();let _0x32740c=_0x329083[_0x19bd8f];return _0x32740c;}export function projectTenantMembers(_0x41a066){const _0x4eaa2f=a251_0x3274,_0x1c6d98=new Map();for(const _0x3594df of _0x41a066){const _0x32c9d3=Number(_0x3594df['userId']);if(!Number[_0x4eaa2f(0x138)](_0x32c9d3)||_0x32c9d3<=0x0)continue;const _0x28ae70={'userId':_0x32c9d3,'username':textOrNull(_0x3594df[_0x4eaa2f(0x130)]),'displayName':textOrNull(_0x3594df[_0x4eaa2f(0x121)]),'role':_0x3594df['adminFlag']===!![]?_0x4eaa2f(0x13c):_0x4eaa2f(0x136),'status':textOrNull(_0x3594df[_0x4eaa2f(0x12a)])},_0x20600b=_0x1c6d98[_0x4eaa2f(0x133)](_0x32c9d3);if(!_0x20600b){_0x1c6d98[_0x4eaa2f(0x127)](_0x32c9d3,_0x28ae70);continue;}_0x20600b[_0x4eaa2f(0x130)]??=_0x28ae70[_0x4eaa2f(0x130)],_0x20600b[_0x4eaa2f(0x12d)]??=_0x28ae70[_0x4eaa2f(0x12d)],_0x20600b[_0x4eaa2f(0x12a)]??=_0x28ae70[_0x4eaa2f(0x12a)];if(_0x28ae70[_0x4eaa2f(0x13a)]===_0x4eaa2f(0x13c))_0x20600b[_0x4eaa2f(0x13a)]=_0x4eaa2f(0x13c);}return[..._0x1c6d98['values']()][_0x4eaa2f(0x12f)]((_0x3cf8b5,_0x44d549)=>_0x3cf8b5[_0x4eaa2f(0x128)]-_0x44d549[_0x4eaa2f(0x128)]);}export function assertTenantAccessible(_0x2fa2e3,_0x6b88fc){const _0x5bc004=a251_0x3274;if(_0x6b88fc['some'](_0x1d6a4c=>_0x1d6a4c[_0x5bc004(0x139)]===_0x2fa2e3))return;throw CliErrors['validation'](_0x5bc004(0x12c)+_0x2fa2e3+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.',_0x5bc004(0x126));}function a251_0x3290(){const _0x39f714=['set','userId','216QWkyas','status','55100vPfeDT','Tenant\x20\x22','displayName','2pAdFYE','sort','username','38835maQDwm','21357flCryb','get','5868wScZdK','864yAgUEG','MEMBER','21197jLyARS','isFinite','tenantCode','role','369969pRhvUD','ADMIN','nickname','trim','31816OfbBuT','92668uDQBGy','20CYtEcq','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.'];a251_0x3290=function(){return _0x39f714;};return a251_0x3290();}
1
+ (function(_0x45690,_0x5e8f7b){const _0x100916=a255_0x2540,_0x42cea4=_0x45690();while(!![]){try{const _0x45d775=-parseInt(_0x100916(0x11a))/0x1+-parseInt(_0x100916(0x11c))/0x2*(-parseInt(_0x100916(0x115))/0x3)+parseInt(_0x100916(0x110))/0x4*(-parseInt(_0x100916(0x120))/0x5)+parseInt(_0x100916(0x10f))/0x6*(-parseInt(_0x100916(0x11b))/0x7)+-parseInt(_0x100916(0x10b))/0x8*(parseInt(_0x100916(0x11f))/0x9)+parseInt(_0x100916(0x113))/0xa*(-parseInt(_0x100916(0x112))/0xb)+parseInt(_0x100916(0x121))/0xc;if(_0x45d775===_0x5e8f7b)break;else _0x42cea4['push'](_0x42cea4['shift']());}catch(_0x47e58b){_0x42cea4['push'](_0x42cea4['shift']());}}}(a255_0xe853,0x50a11));function a255_0x2540(_0x299206,_0x30a8f0){_0x299206=_0x299206-0x109;const _0xe8537e=a255_0xe853();let _0x2540ac=_0xe8537e[_0x299206];return _0x2540ac;}import{CliErrors}from'../../errors.js';function textOrNull(_0x4cb4c5){const _0x3de176=a255_0x2540,_0x1e15d5=_0x4cb4c5?.[_0x3de176(0x123)]();return _0x1e15d5?_0x1e15d5:null;}export function projectTenantMembers(_0x4a4f2b){const _0x4215a3=a255_0x2540,_0x495b73=new Map();for(const _0x2f922e of _0x4a4f2b){const _0x315599=Number(_0x2f922e[_0x4215a3(0x119)]);if(!Number['isFinite'](_0x315599)||_0x315599<=0x0)continue;const _0x5b7192={'userId':_0x315599,'username':textOrNull(_0x2f922e[_0x4215a3(0x122)]),'displayName':textOrNull(_0x2f922e[_0x4215a3(0x10a)]),'role':_0x2f922e[_0x4215a3(0x114)]===!![]?_0x4215a3(0x116):_0x4215a3(0x118),'status':textOrNull(_0x2f922e[_0x4215a3(0x109)])},_0x1aff23=_0x495b73['get'](_0x315599);if(!_0x1aff23){_0x495b73[_0x4215a3(0x11d)](_0x315599,_0x5b7192);continue;}_0x1aff23[_0x4215a3(0x122)]??=_0x5b7192[_0x4215a3(0x122)],_0x1aff23[_0x4215a3(0x117)]??=_0x5b7192[_0x4215a3(0x117)],_0x1aff23['status']??=_0x5b7192[_0x4215a3(0x109)];if(_0x5b7192[_0x4215a3(0x10e)]===_0x4215a3(0x116))_0x1aff23[_0x4215a3(0x10e)]='ADMIN';}return[..._0x495b73[_0x4215a3(0x11e)]()]['sort']((_0x18d519,_0x2b59b9)=>_0x18d519[_0x4215a3(0x119)]-_0x2b59b9[_0x4215a3(0x119)]);}export function assertTenantAccessible(_0x155c7d,_0x2b370d){const _0x5a89e8=a255_0x2540;if(_0x2b370d['some'](_0x2f6554=>_0x2f6554[_0x5a89e8(0x10c)]===_0x155c7d))return;throw CliErrors['validation'](_0x5a89e8(0x111)+_0x155c7d+_0x5a89e8(0x10d),'Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}function a255_0xe853(){const _0x2e5adb=['Tenant\x20\x22','34562iHskfq','460dWxFrk','adminFlag','171VjHnIl','ADMIN','displayName','MEMBER','userId','255994ZqPCJU','119wIZYMd','21042azsWTr','set','values','12258gwfgfA','15gYcema','11366136cZlELx','username','trim','status','nickname','528caqqos','tenantCode','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','role','34044oxoCKl','839656biROxs'];a255_0xe853=function(){return _0x2e5adb;};return a255_0xe853();}
@@ -1 +1 @@
1
- const a252_0x5d76eb=a252_0x1423;(function(_0x1f52f5,_0x5c6467){const _0x518f19=a252_0x1423,_0x3194e5=_0x1f52f5();while(!![]){try{const _0x2931ef=parseInt(_0x518f19(0x1ab))/0x1+parseInt(_0x518f19(0x1a7))/0x2+-parseInt(_0x518f19(0x1a0))/0x3*(-parseInt(_0x518f19(0x1a6))/0x4)+parseInt(_0x518f19(0x19e))/0x5*(-parseInt(_0x518f19(0x1a8))/0x6)+parseInt(_0x518f19(0x19f))/0x7*(-parseInt(_0x518f19(0x1a9))/0x8)+parseInt(_0x518f19(0x198))/0x9+parseInt(_0x518f19(0x1a2))/0xa*(-parseInt(_0x518f19(0x197))/0xb);if(_0x2931ef===_0x5c6467)break;else _0x3194e5['push'](_0x3194e5['shift']());}catch(_0x20bd33){_0x3194e5['push'](_0x3194e5['shift']());}}}(a252_0x14b5,0xa54cb));function a252_0x1423(_0x32a548,_0x20b411){_0x32a548=_0x32a548-0x194;const _0x14b592=a252_0x14b5();let _0x14234a=_0x14b592[_0x32a548];return _0x14234a;}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=a252_0x5d76eb(0x196),CURRENT_BINDING_WARNING=a252_0x5d76eb(0x19c);function readDingTalkUserId(_0x859fb7){const _0x370c5e=a252_0x5d76eb,_0x2742f0=_0x859fb7[_0x370c5e(0x1ac)](_0x370c5e(0x1a5))[_0x370c5e(0x1a3)]();if(!_0x2742f0)throw CliErrors[_0x370c5e(0x19d)](_0x370c5e(0x195),'Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.');return _0x2742f0;}function buildBindingData(_0x55f3b6,_0x216798){return{'operation':'bind','selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x55f3b6},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x55f3b6,'bound':!![]},'dryRun':_0x216798,'backend':{'method':'POST','path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}function a252_0x14b5(){const _0x5d6fba=['328101nGuVyU','str','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','apiError','--ding-talk-user-id\x20cannot\x20be\x20empty.','dingtalk','33aJqKOI','11600820jNsxUr','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','string','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','validation','4618085XEAaRB','2078601waUgFm','3RxbDuN','user-account','260980kVLkzF','trim','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','ding-talk-user-id','3881896ZpZmWU','558390CBmFpF','6RgBIEj','32SmClsq','POST'];a252_0x14b5=function(){return _0x5d6fba;};return a252_0x14b5();}export const dingTalkSandboxBind={'service':a252_0x5d76eb(0x1a1),'command':'dingding-sandbox-bind','description':'Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','risk':'write','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a252_0x5d76eb(0x1a5),'type':a252_0x5d76eb(0x19b),'required':!![],'description':a252_0x5d76eb(0x199)}],async 'validate'(_0x3e31ef){readDingTalkUserId(_0x3e31ef);},async 'dryRun'(_0x4e1f3c){const _0x4bc517=a252_0x5d76eb,_0x2cbe7a=readDingTalkUserId(_0x4e1f3c);return asDryRunResult(buildBindingData(_0x2cbe7a,!![]),{'method':_0x4bc517(0x1aa),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x4b5d77){const _0x340168=a252_0x5d76eb,_0x4c1d7a=readDingTalkUserId(_0x4b5d77),_0x3015f3=await bindDingTalkSandboxAccount(_0x4c1d7a);if(_0x3015f3!==!![])throw CliErrors[_0x340168(0x194)](_0x340168(0x1ad),_0x340168(0x19a));return{'ok':!![],'data':buildBindingData(_0x4c1d7a,![]),'message':_0x340168(0x1a4)};}};
1
+ function a256_0x5beb(){const _0x219510=['user-account','5327136jPRdoj','--ding-talk-user-id\x20cannot\x20be\x20empty.','bind','20JLHgsu','dingtalk','str','POST','ding-talk-user-id','25552XRjDVK','string','1484bHwtTW','trim','apiError','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','414072YbfKFt','914715nzjQvT','write','1325137BJOFDC','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','15oQMoWT','6509547prXata','130gtSUDE','277642QdmuED','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','validation','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.'];a256_0x5beb=function(){return _0x219510;};return a256_0x5beb();}const a256_0x112aec=a256_0x1c7b;(function(_0x6f9f,_0x3979b1){const _0x25a6fd=a256_0x1c7b,_0x28c8ab=_0x6f9f();while(!![]){try{const _0x225ba1=-parseInt(_0x25a6fd(0xd3))/0x1+-parseInt(_0x25a6fd(0xdb))/0x2*(-parseInt(_0x25a6fd(0xd8))/0x3)+parseInt(_0x25a6fd(0xe3))/0x4*(parseInt(_0x25a6fd(0xd4))/0x5)+-parseInt(_0x25a6fd(0xe0))/0x6+parseInt(_0x25a6fd(0xcf))/0x7*(-parseInt(_0x25a6fd(0xcd))/0x8)+-parseInt(_0x25a6fd(0xd9))/0x9+parseInt(_0x25a6fd(0xda))/0xa*(parseInt(_0x25a6fd(0xd6))/0xb);if(_0x225ba1===_0x3979b1)break;else _0x28c8ab['push'](_0x28c8ab['shift']());}catch(_0x5e1660){_0x28c8ab['push'](_0x28c8ab['shift']());}}}(a256_0x5beb,0x735e8));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=a256_0x112aec(0xe4),CURRENT_BINDING_WARNING=a256_0x112aec(0xde);function readDingTalkUserId(_0x2cde6a){const _0x4726d3=a256_0x112aec,_0x2d4052=_0x2cde6a[_0x4726d3(0xe5)]('ding-talk-user-id')[_0x4726d3(0xd0)]();if(!_0x2d4052)throw CliErrors[_0x4726d3(0xdd)](_0x4726d3(0xe1),_0x4726d3(0xd2));return _0x2d4052;}function a256_0x1c7b(_0x576a1f,_0x536202){_0x576a1f=_0x576a1f-0xcc;const _0x5beb4c=a256_0x5beb();let _0x1c7b38=_0x5beb4c[_0x576a1f];return _0x1c7b38;}function buildBindingData(_0x5eabf7,_0x3f4c1a){const _0x29ed33=a256_0x112aec;return{'operation':_0x29ed33(0xe2),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x5eabf7},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x5eabf7,'bound':!![]},'dryRun':_0x3f4c1a,'backend':{'method':_0x29ed33(0xe6),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a256_0x112aec(0xdf),'command':'dingding-sandbox-bind','description':a256_0x112aec(0xd7),'risk':a256_0x112aec(0xd5),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a256_0x112aec(0xcc),'type':a256_0x112aec(0xce),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0x5aea98){readDingTalkUserId(_0x5aea98);},async 'dryRun'(_0x3a72a4){const _0x23a13b=a256_0x112aec,_0x360c97=readDingTalkUserId(_0x3a72a4);return asDryRunResult(buildBindingData(_0x360c97,!![]),{'method':_0x23a13b(0xe6),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x7ce3ee){const _0x42d6c0=a256_0x112aec,_0x4b4636=readDingTalkUserId(_0x7ce3ee),_0x2982af=await bindDingTalkSandboxAccount(_0x4b4636);if(_0x2982af!==!![])throw CliErrors[_0x42d6c0(0xd1)](_0x42d6c0(0xdc),'Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.');return{'ok':!![],'data':buildBindingData(_0x4b4636,![]),'message':'Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'};}};
@@ -1 +1 @@
1
- function a253_0x3a2e(_0x5517b9,_0x416500){_0x5517b9=_0x5517b9-0xf9;const _0x53988f=a253_0x5398();let _0x3a2e10=_0x53988f[_0x5517b9];return _0x3a2e10;}const a253_0x184311=a253_0x3a2e;(function(_0x181d74,_0x2f31b6){const _0x5e12df=a253_0x3a2e,_0x350b93=_0x181d74();while(!![]){try{const _0x5de6bd=-parseInt(_0x5e12df(0x10a))/0x1+parseInt(_0x5e12df(0x10d))/0x2+parseInt(_0x5e12df(0xfd))/0x3+-parseInt(_0x5e12df(0x10f))/0x4+-parseInt(_0x5e12df(0x102))/0x5+parseInt(_0x5e12df(0x104))/0x6*(-parseInt(_0x5e12df(0x108))/0x7)+parseInt(_0x5e12df(0x110))/0x8*(parseInt(_0x5e12df(0xff))/0x9);if(_0x5de6bd===_0x2f31b6)break;else _0x350b93['push'](_0x350b93['shift']());}catch(_0x2aa6d4){_0x350b93['push'](_0x350b93['shift']());}}}(a253_0x5398,0x34961));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindFeishuAccount,FEISHU_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a253_0x184311(0x111),CURRENT_BINDING_WARNING=a253_0x184311(0x100);function readUnionId(_0x3bff97){const _0x532427=a253_0x184311,_0x8abe4=_0x3bff97[_0x532427(0xfa)](_0x532427(0x10b))[_0x532427(0xfe)]();if(!/^on_[A-Za-z0-9_-]+$/[_0x532427(0x105)](_0x8abe4))throw CliErrors['validation'](_0x532427(0x107),_0x532427(0x109));return _0x8abe4;}function buildBindingData(_0x5ba263,_0x448ad8){const _0x1cc06b=a253_0x184311;return{'operation':_0x1cc06b(0x112),'selector':{'providerId':PROVIDER_ID,'unionId':_0x5ba263},'before':null,'after':{'providerId':PROVIDER_ID,'unionId':_0x5ba263,'bound':!![]},'dryRun':_0x448ad8,'backend':{'method':_0x1cc06b(0x103),'path':FEISHU_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const feishuBind={'service':a253_0x184311(0x10c),'command':a253_0x184311(0xfc),'description':a253_0x184311(0x101),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a253_0x184311(0x10b),'type':a253_0x184311(0x113),'required':!![],'description':a253_0x184311(0x106)}],async 'validate'(_0x1a39ab){readUnionId(_0x1a39ab);},async 'dryRun'(_0x535db4){const _0x1aaca7=a253_0x184311,_0xe95680=readUnionId(_0x535db4);return asDryRunResult(buildBindingData(_0xe95680,!![]),{'method':_0x1aaca7(0x103),'url':FEISHU_BIND_PATH});},async 'execute'(_0x4cc819){const _0x3cdb26=a253_0x184311,_0x5f0727=readUnionId(_0x4cc819),_0x10df70=await bindFeishuAccount(_0x5f0727);if(_0x10df70!==!![])throw CliErrors['apiError'](_0x3cdb26(0xfb),_0x3cdb26(0x10e));return{'ok':!![],'data':buildBindingData(_0x5f0727,![]),'message':_0x3cdb26(0xf9)};}};function a253_0x5398(){const _0x161ceb=['union-id','user-account','111772fUXzsm','Verify\x20the\x20current\x20binding\x20through\x20the\x20platform\x20before\x20explicitly\x20retrying;\x20do\x20not\x20automatically\x20retry.','488544VCfXdU','8216DFZCPr','feishu','bind','string','Bound\x20current\x20user\x20to\x20Feishu\x20account.','str','Feishu\x20account\x20binding\x20was\x20not\x20confirmed.','feishu-bind','237252MYBPQX','trim','7443pRDfgr','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20Feishu\x20account','81545rKlTSJ','POST','90FqKWhA','test','Feishu\x20union_id\x20for\x20the\x20configured\x20Feishu\x20application\x20developer','--union-id\x20must\x20match\x20on_\x20followed\x20by\x20letters,\x20digits,\x20underscores,\x20or\x20hyphens.','103215DOboWq','Pass\x20a\x20Feishu\x20union\x20id\x20such\x20as\x20on_example_001.','409286AJNiRn'];a253_0x5398=function(){return _0x161ceb;};return a253_0x5398();}
1
+ const a257_0x7b7cb8=a257_0x5c66;(function(_0x3d4945,_0x16ad14){const _0x16ddb2=a257_0x5c66,_0x2da6d9=_0x3d4945();while(!![]){try{const _0x1a689c=parseInt(_0x16ddb2(0x1e1))/0x1*(-parseInt(_0x16ddb2(0x1da))/0x2)+parseInt(_0x16ddb2(0x1d3))/0x3*(-parseInt(_0x16ddb2(0x1e0))/0x4)+parseInt(_0x16ddb2(0x1df))/0x5*(-parseInt(_0x16ddb2(0x1d9))/0x6)+parseInt(_0x16ddb2(0x1d2))/0x7*(-parseInt(_0x16ddb2(0x1cc))/0x8)+parseInt(_0x16ddb2(0x1e2))/0x9+parseInt(_0x16ddb2(0x1ce))/0xa+parseInt(_0x16ddb2(0x1ca))/0xb;if(_0x1a689c===_0x16ad14)break;else _0x2da6d9['push'](_0x2da6d9['shift']());}catch(_0x4838f8){_0x2da6d9['push'](_0x2da6d9['shift']());}}}(a257_0x193c,0x516ad));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindFeishuAccount,FEISHU_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a257_0x193c(){const _0x38f382=['4318340JfxckD','Bound\x20current\x20user\x20to\x20Feishu\x20account.','write','test','434PRonlc','433971STMZLa','Pass\x20a\x20Feishu\x20union\x20id\x20such\x20as\x20on_example_001.','user-account','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20Feishu\x20account','str','validation','6Noddtz','2tYgeEf','feishu','string','Verify\x20the\x20current\x20binding\x20through\x20the\x20platform\x20before\x20explicitly\x20retrying;\x20do\x20not\x20automatically\x20retry.','POST','2927465CElNHB','4wjBAwq','221099oyDwHr','5923179CPtLIN','trim','7410227GjXOml','feishu-bind','61792HwnpQb','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.'];a257_0x193c=function(){return _0x38f382;};return a257_0x193c();}function a257_0x5c66(_0x401229,_0x1d4d4b){_0x401229=_0x401229-0x1c9;const _0x193c3e=a257_0x193c();let _0x5c66a8=_0x193c3e[_0x401229];return _0x5c66a8;}const PROVIDER_ID=a257_0x7b7cb8(0x1db),CURRENT_BINDING_WARNING=a257_0x7b7cb8(0x1cd);function readUnionId(_0x414ff5){const _0x44b4b2=a257_0x7b7cb8,_0x2174ba=_0x414ff5[_0x44b4b2(0x1d7)]('union-id')[_0x44b4b2(0x1c9)]();if(!/^on_[A-Za-z0-9_-]+$/[_0x44b4b2(0x1d1)](_0x2174ba))throw CliErrors[_0x44b4b2(0x1d8)]('--union-id\x20must\x20match\x20on_\x20followed\x20by\x20letters,\x20digits,\x20underscores,\x20or\x20hyphens.',_0x44b4b2(0x1d4));return _0x2174ba;}function buildBindingData(_0x44621a,_0x1da121){const _0x2bf73b=a257_0x7b7cb8;return{'operation':'bind','selector':{'providerId':PROVIDER_ID,'unionId':_0x44621a},'before':null,'after':{'providerId':PROVIDER_ID,'unionId':_0x44621a,'bound':!![]},'dryRun':_0x1da121,'backend':{'method':_0x2bf73b(0x1de),'path':FEISHU_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const feishuBind={'service':a257_0x7b7cb8(0x1d5),'command':a257_0x7b7cb8(0x1cb),'description':a257_0x7b7cb8(0x1d6),'risk':a257_0x7b7cb8(0x1d0),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'union-id','type':a257_0x7b7cb8(0x1dc),'required':!![],'description':'Feishu\x20union_id\x20for\x20the\x20configured\x20Feishu\x20application\x20developer'}],async 'validate'(_0x10a375){readUnionId(_0x10a375);},async 'dryRun'(_0x5eaac1){const _0x213e28=a257_0x7b7cb8,_0x2406ac=readUnionId(_0x5eaac1);return asDryRunResult(buildBindingData(_0x2406ac,!![]),{'method':_0x213e28(0x1de),'url':FEISHU_BIND_PATH});},async 'execute'(_0x1130f5){const _0x2550fc=a257_0x7b7cb8,_0x4e80c8=readUnionId(_0x1130f5),_0x1d3bcb=await bindFeishuAccount(_0x4e80c8);if(_0x1d3bcb!==!![])throw CliErrors['apiError']('Feishu\x20account\x20binding\x20was\x20not\x20confirmed.',_0x2550fc(0x1dd));return{'ok':!![],'data':buildBindingData(_0x4e80c8,![]),'message':_0x2550fc(0x1cf)};}};
@@ -1 +1 @@
1
- function a254_0xadc4(_0x1f7f5f,_0x45f9af){_0x1f7f5f=_0x1f7f5f-0x1ba;const _0x5cf9b1=a254_0x5cf9();let _0xadc4bd=_0x5cf9b1[_0x1f7f5f];return _0xadc4bd;}(function(_0x468200,_0x4bda3c){const _0x481658=a254_0xadc4,_0x44be7d=_0x468200();while(!![]){try{const _0x2b4da4=parseInt(_0x481658(0x1bf))/0x1+parseInt(_0x481658(0x1c3))/0x2*(parseInt(_0x481658(0x1c2))/0x3)+-parseInt(_0x481658(0x1bd))/0x4+parseInt(_0x481658(0x1ba))/0x5*(-parseInt(_0x481658(0x1c0))/0x6)+parseInt(_0x481658(0x1bb))/0x7+-parseInt(_0x481658(0x1bc))/0x8+-parseInt(_0x481658(0x1c1))/0x9*(-parseInt(_0x481658(0x1be))/0xa);if(_0x2b4da4===_0x4bda3c)break;else _0x44be7d['push'](_0x44be7d['shift']());}catch(_0x2993eb){_0x44be7d['push'](_0x44be7d['shift']());}}}(a254_0x5cf9,0x8f81c));function a254_0x5cf9(){const _0x2cf55e=['45QaINKR','6319341lSePwI','6250960KMLzMd','2406544BsQmar','10jkEjcS','165366kQzxNS','148398ZVMsQf','9051363BkISEj','119571zGAodR','6QRSqsF'];a254_0x5cf9=function(){return _0x2cf55e;};return a254_0x5cf9();}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';import{feishuBind}from'../../commands/user-account/feishu-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind,feishuBind];
1
+ function a258_0x4cd4(_0x293319,_0x3c7c9b){_0x293319=_0x293319-0x164;const _0x526b6b=a258_0x526b();let _0x4cd44c=_0x526b6b[_0x293319];return _0x4cd44c;}(function(_0x5e05d7,_0x3d9a0f){const _0x536402=a258_0x4cd4,_0x229ff5=_0x5e05d7();while(!![]){try{const _0x562232=-parseInt(_0x536402(0x16e))/0x1*(parseInt(_0x536402(0x16f))/0x2)+parseInt(_0x536402(0x166))/0x3+-parseInt(_0x536402(0x16b))/0x4*(parseInt(_0x536402(0x168))/0x5)+parseInt(_0x536402(0x169))/0x6*(-parseInt(_0x536402(0x165))/0x7)+-parseInt(_0x536402(0x16a))/0x8+parseInt(_0x536402(0x16c))/0x9*(parseInt(_0x536402(0x16d))/0xa)+parseInt(_0x536402(0x164))/0xb*(parseInt(_0x536402(0x167))/0xc);if(_0x562232===_0x3d9a0f)break;else _0x229ff5['push'](_0x229ff5['shift']());}catch(_0x915a02){_0x229ff5['push'](_0x229ff5['shift']());}}}(a258_0x526b,0xf248e));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';import{feishuBind}from'../../commands/user-account/feishu-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind,feishuBind];function a258_0x526b(){const _0x50f709=['1604064RScJWY','12KbPqen','9896275Fauhmh','252aygTKw','3759552DXgzfK','4cBoXAc','27lvNJqy','3133010GZNBtf','1268405hVWwzF','2VcRoBq','53973425oGiCMB','278544uHkSjV'];a258_0x526b=function(){return _0x50f709;};return a258_0x526b();}