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

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 (376) 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/design-context.js +1 -1
  77. package/lib/commands/dataset/design-start.js +1 -1
  78. package/lib/commands/dataset/design-status.js +1 -1
  79. package/lib/commands/dataset/design-sync-retry.js +1 -1
  80. package/lib/commands/dataset/design-sync-status.js +1 -1
  81. package/lib/commands/dataset/design-validate.js +1 -1
  82. package/lib/commands/dataset/detail.js +1 -1
  83. package/lib/commands/dataset/extend-update.js +1 -1
  84. package/lib/commands/dataset/field-restore.js +1 -1
  85. package/lib/commands/dataset/field-update.js +1 -1
  86. package/lib/commands/dataset/generate.js +1 -1
  87. package/lib/commands/dataset/index.js +1 -1
  88. package/lib/commands/dataset/list.js +1 -1
  89. package/lib/commands/dataset/operations.js +1 -1
  90. package/lib/commands/dataset/relation-audit.js +1 -1
  91. package/lib/commands/dataset/relation-create.js +1 -1
  92. package/lib/commands/dataset/relation-delete.js +1 -1
  93. package/lib/commands/dataset/relation-shared.js +1 -1
  94. package/lib/commands/dataset/relation-update.js +1 -1
  95. package/lib/commands/dataset/relations.js +1 -1
  96. package/lib/commands/dataset/rename.js +1 -1
  97. package/lib/commands/dataset/restore.js +1 -1
  98. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  99. package/lib/commands/db/analysis-batching.js +1 -1
  100. package/lib/commands/db/analyze-batch-plan.js +1 -1
  101. package/lib/commands/db/analyze-cancel.js +1 -1
  102. package/lib/commands/db/analyze-start.js +1 -1
  103. package/lib/commands/db/analyze-status.js +1 -1
  104. package/lib/commands/db/create.js +1 -1
  105. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  106. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  107. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  109. package/lib/commands/db/delete.js +1 -1
  110. package/lib/commands/db/detail.js +1 -1
  111. package/lib/commands/db/diff-refresh-start.js +1 -1
  112. package/lib/commands/db/diff-refresh-status.js +1 -1
  113. package/lib/commands/db/diff.js +1 -1
  114. package/lib/commands/db/index.js +1 -1
  115. package/lib/commands/db/list.js +1 -1
  116. package/lib/commands/db/shared.js +1 -1
  117. package/lib/commands/db/table-diff-shared.js +1 -1
  118. package/lib/commands/db/tables.js +1 -1
  119. package/lib/commands/db/test.js +1 -1
  120. package/lib/commands/db/update.js +1 -1
  121. package/lib/commands/deployment/index.js +1 -1
  122. package/lib/commands/deployment/sync-all.js +1 -1
  123. package/lib/commands/deployment/sync-jobs.js +1 -1
  124. package/lib/commands/deployment/sync-status.js +1 -1
  125. package/lib/commands/doctor.js +1 -1
  126. package/lib/commands/file/index.js +1 -1
  127. package/lib/commands/flow/create.js +1 -1
  128. package/lib/commands/flow/detail.js +1 -1
  129. package/lib/commands/flow/index.js +1 -1
  130. package/lib/commands/flow/list.js +1 -1
  131. package/lib/commands/flow/page-list.js +1 -1
  132. package/lib/commands/flow/publish.js +1 -1
  133. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  134. package/lib/commands/flow/runtime-role-list.js +1 -1
  135. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  136. package/lib/commands/flow/runtime-user-search.js +1 -1
  137. package/lib/commands/flow/shared.js +1 -1
  138. package/lib/commands/flow/update.js +1 -1
  139. package/lib/commands/flow/validate.js +1 -1
  140. package/lib/commands/instant-api-policy/current.js +1 -1
  141. package/lib/commands/instant-api-policy/index.js +1 -1
  142. package/lib/commands/instant-api-policy/init.js +1 -1
  143. package/lib/commands/instant-api-policy/publish.js +1 -1
  144. package/lib/commands/instant-api-policy/pull.js +1 -1
  145. package/lib/commands/instant-api-policy/revision.js +1 -1
  146. package/lib/commands/instant-api-policy/revisions.js +1 -1
  147. package/lib/commands/instant-api-policy/rollback.js +1 -1
  148. package/lib/commands/instant-api-policy/shared.js +1 -1
  149. package/lib/commands/instant-api-policy/validate.js +1 -1
  150. package/lib/commands/issue/context.js +1 -1
  151. package/lib/commands/issue/index.js +1 -1
  152. package/lib/commands/issue/nudge.js +1 -1
  153. package/lib/commands/issue/report.js +1 -1
  154. package/lib/commands/kb/create.js +1 -1
  155. package/lib/commands/kb/delete.js +1 -1
  156. package/lib/commands/kb/detail.js +1 -1
  157. package/lib/commands/kb/index.js +1 -1
  158. package/lib/commands/kb/list.js +1 -1
  159. package/lib/commands/kb/search.js +1 -1
  160. package/lib/commands/kb/shared.js +1 -1
  161. package/lib/commands/kb/update.js +1 -1
  162. package/lib/commands/logs/index.js +1 -1
  163. package/lib/commands/menu/asset-update.js +1 -1
  164. package/lib/commands/menu/delete.js +1 -1
  165. package/lib/commands/menu/external-link-create.js +1 -1
  166. package/lib/commands/menu/external-link-update.js +1 -1
  167. package/lib/commands/menu/group-create.js +1 -1
  168. package/lib/commands/menu/group-update.js +1 -1
  169. package/lib/commands/menu/index.js +1 -1
  170. package/lib/commands/menu/list.js +1 -1
  171. package/lib/commands/menu/move.js +1 -1
  172. package/lib/commands/menu/regroup-start.js +1 -1
  173. package/lib/commands/menu/rename.js +1 -1
  174. package/lib/commands/menu/shared/compare-table.js +1 -1
  175. package/lib/commands/menu/shared/delete-plan.js +1 -1
  176. package/lib/commands/menu/shared/facts.js +1 -1
  177. package/lib/commands/menu/shared/index.js +1 -1
  178. package/lib/commands/menu/shared/inquirer.js +1 -1
  179. package/lib/commands/menu/shared/local-pages.js +1 -1
  180. package/lib/commands/menu/shared/logic.js +1 -1
  181. package/lib/commands/menu/shared/mutations.js +1 -1
  182. package/lib/commands/menu/shared/path.js +1 -1
  183. package/lib/commands/menu/shared/service.js +1 -1
  184. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  185. package/lib/commands/menu/shared/sync-core.js +1 -1
  186. package/lib/commands/menu/shared/update-core.js +1 -1
  187. package/lib/commands/menu/shared/valid-url.js +1 -1
  188. package/lib/commands/menu/subapp-assets-status.js +1 -1
  189. package/lib/commands/menu/subapp-assets-update.js +1 -1
  190. package/lib/commands/menu/sync.js +1 -1
  191. package/lib/commands/menu/visibility-update.js +1 -1
  192. package/lib/commands/notification/config-create.js +1 -1
  193. package/lib/commands/notification/config-delete.js +1 -1
  194. package/lib/commands/notification/config-list.js +1 -1
  195. package/lib/commands/notification/config-update.js +1 -1
  196. package/lib/commands/notification/index.js +1 -1
  197. package/lib/commands/notification/shared.js +1 -1
  198. package/lib/commands/ocr/index.js +1 -1
  199. package/lib/commands/page/create.js +1 -1
  200. package/lib/commands/page/custom/detail.js +1 -1
  201. package/lib/commands/page/custom/list.js +1 -1
  202. package/lib/commands/page/custom/publish.js +1 -1
  203. package/lib/commands/page/custom/shared.js +1 -1
  204. package/lib/commands/page/custom/syntax.js +1 -1
  205. package/lib/commands/page/custom/update.js +1 -1
  206. package/lib/commands/page/data-list-status.js +1 -1
  207. package/lib/commands/page/generate-start.js +1 -1
  208. package/lib/commands/page/generate-status.js +1 -1
  209. package/lib/commands/page/index.js +1 -1
  210. package/lib/commands/page/pull.js +1 -1
  211. package/lib/commands/page/push.js +1 -1
  212. package/lib/commands/page/relation-audit.js +1 -1
  213. package/lib/commands/page/restore.js +1 -1
  214. package/lib/commands/page/shared.js +1 -1
  215. package/lib/commands/page/sync.js +1 -1
  216. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  217. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  218. package/lib/commands/project/create/format-elapsed.js +1 -1
  219. package/lib/commands/project/create/main.js +1 -1
  220. package/lib/commands/project/create/materialize-project-template.js +1 -1
  221. package/lib/commands/project/create/project-name.js +1 -1
  222. package/lib/commands/project/create/project-template-archive.js +1 -1
  223. package/lib/commands/project/create/project-template-path.js +1 -1
  224. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  225. package/lib/commands/project/create/use-format-code.js +1 -1
  226. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  227. package/lib/commands/project/domain-routing-sync.js +1 -1
  228. package/lib/commands/project/index.js +1 -1
  229. package/lib/commands/project/upgrade.js +1 -1
  230. package/lib/commands/registry.js +1 -1
  231. package/lib/commands/role/delete.js +1 -1
  232. package/lib/commands/role/detail.js +1 -1
  233. package/lib/commands/role/index.js +1 -1
  234. package/lib/commands/role/list.js +1 -1
  235. package/lib/commands/role/shared.js +1 -1
  236. package/lib/commands/role/update.js +1 -1
  237. package/lib/commands/role/user-add.js +1 -1
  238. package/lib/commands/role/user-remove.js +1 -1
  239. package/lib/commands/role/user-resolve.js +1 -1
  240. package/lib/commands/rule/get.js +1 -1
  241. package/lib/commands/rule/index.js +1 -1
  242. package/lib/commands/rule/list.js +1 -1
  243. package/lib/commands/rule/set.js +1 -1
  244. package/lib/commands/rule/shared.js +1 -1
  245. package/lib/commands/run/index.js +1 -1
  246. package/lib/commands/schema.js +1 -1
  247. package/lib/commands/sql/create.js +1 -1
  248. package/lib/commands/sql/delete.js +1 -1
  249. package/lib/commands/sql/detail.js +1 -1
  250. package/lib/commands/sql/exec.js +1 -1
  251. package/lib/commands/sql/index.js +1 -1
  252. package/lib/commands/sql/list.js +1 -1
  253. package/lib/commands/sql/pull.js +1 -1
  254. package/lib/commands/sql/push.js +1 -1
  255. package/lib/commands/sql/shared.js +1 -1
  256. package/lib/commands/sql/status.js +1 -1
  257. package/lib/commands/sql/validate.js +1 -1
  258. package/lib/commands/task/index.js +1 -1
  259. package/lib/commands/task/status.js +1 -1
  260. package/lib/commands/tenant/index.js +1 -1
  261. package/lib/commands/tenant/members-list.js +1 -1
  262. package/lib/commands/tenant/shared.js +1 -1
  263. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  264. package/lib/commands/user-account/feishu-bind.js +1 -1
  265. package/lib/commands/user-account/index.js +1 -1
  266. package/lib/commands/workspace/add.js +1 -1
  267. package/lib/commands/workspace/index.js +1 -1
  268. package/lib/commands/workspace/remove.js +1 -1
  269. package/lib/config/domain-config.js +1 -1
  270. package/lib/config/project-domain-routing.js +1 -1
  271. package/lib/config/region-config.js +1 -1
  272. package/lib/config/schema.js +1 -1
  273. package/lib/constant/cdn.js +1 -1
  274. package/lib/constant/cli.js +1 -1
  275. package/lib/constant/defaults.js +1 -1
  276. package/lib/constant/domain.js +1 -1
  277. package/lib/constant/env.js +1 -1
  278. package/lib/constant/output.js +1 -1
  279. package/lib/constant/paths.js +1 -1
  280. package/lib/constant/region.js +1 -1
  281. package/lib/constant/risk.js +1 -1
  282. package/lib/constant/routing-profile.js +1 -1
  283. package/lib/context/app-resolver.js +1 -1
  284. package/lib/context/auth-resolver.js +1 -1
  285. package/lib/context/config-loader.js +1 -1
  286. package/lib/context.js +1 -1
  287. package/lib/core/alias-resolver.js +1 -1
  288. package/lib/core/api-client.js +1 -1
  289. package/lib/core/bff/config.js +1 -1
  290. package/lib/core/bff/file-system.js +1 -1
  291. package/lib/core/bff/hash.js +1 -1
  292. package/lib/core/bff/hook-directory.js +1 -1
  293. package/lib/core/bff/lock.js +1 -1
  294. package/lib/core/bff/utils.js +1 -1
  295. package/lib/core/cross-db-analysis.js +1 -1
  296. package/lib/core/cross-db-relation.js +1 -1
  297. package/lib/core/db-resolver.js +1 -1
  298. package/lib/core/flow-config.js +1 -1
  299. package/lib/core/instant-api-policy/config.js +1 -1
  300. package/lib/core/instant-api-policy/endpoints.js +1 -1
  301. package/lib/core/kb-management-client.js +1 -1
  302. package/lib/core/kb-search-client.js +1 -1
  303. package/lib/core/page/file-system.js +1 -1
  304. package/lib/core/page/hash.js +1 -1
  305. package/lib/core/page/lock.js +1 -1
  306. package/lib/core/page/lr-smart-jsx.js +1 -1
  307. package/lib/core/sql-index-auditor.js +1 -1
  308. package/lib/core/sql-sync/config.js +1 -1
  309. package/lib/core/sql-sync/file-system.js +1 -1
  310. package/lib/core/sql-sync/hash.js +1 -1
  311. package/lib/core/sql-sync/lock.js +1 -1
  312. package/lib/core/sql-sync/utils.js +1 -1
  313. package/lib/core/sql-validator.js +1 -1
  314. package/lib/errors.js +1 -1
  315. package/lib/framework/build-all-flags.js +1 -1
  316. package/lib/framework/error-output.js +1 -1
  317. package/lib/framework/explicit-yes.js +1 -1
  318. package/lib/framework/flags.js +1 -1
  319. package/lib/framework/help.js +1 -1
  320. package/lib/framework/index.js +1 -1
  321. package/lib/framework/output.js +1 -1
  322. package/lib/framework/response.js +1 -1
  323. package/lib/framework/runner-alias.js +1 -1
  324. package/lib/framework/runner.js +1 -1
  325. package/lib/framework/schema-export.js +1 -1
  326. package/lib/framework/supported-flags.js +1 -1
  327. package/lib/framework/types.js +1 -1
  328. package/lib/generated/build-info.d.ts +4 -4
  329. package/lib/generated/build-info.js +1 -1
  330. package/lib/generated/official-routing.js +1 -1
  331. package/lib/generated/routing-contract.js +1 -1
  332. package/lib/help.js +1 -1
  333. package/lib/postinstall.js +1 -1
  334. package/lib/runtime/confirmation.js +1 -1
  335. package/lib/runtime/event.js +1 -1
  336. package/lib/runtime/index.js +1 -1
  337. package/lib/runtime/queue.js +1 -1
  338. package/lib/runtime/resolve.js +1 -1
  339. package/lib/services/dataset-design/checkpoint.js +1 -1
  340. package/lib/services/dataset-design/commands.js +1 -1
  341. package/lib/services/dataset-design/contract.js +1 -1
  342. package/lib/skills/builtin-skill.js +1 -1
  343. package/lib/skills/main.js +1 -1
  344. package/lib/skills/npx-skills-add.js +1 -1
  345. package/lib/skills/skill-presence.js +1 -1
  346. package/lib/telemetry/cli-command-trace.js +1 -1
  347. package/lib/telemetry/cli-help-trace.js +1 -1
  348. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  349. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  350. package/lib/telemetry/send-cli-trace-log.js +1 -1
  351. package/lib/utils/ai_config.js +1 -1
  352. package/lib/utils/apply-jq-filter.js +1 -1
  353. package/lib/utils/cdn-config.js +1 -1
  354. package/lib/utils/check-sdk-version.js +1 -1
  355. package/lib/utils/cli-version-check.js +1 -1
  356. package/lib/utils/cli-version-policy.js +1 -1
  357. package/lib/utils/config.js +1 -1
  358. package/lib/utils/entity-with-id.js +1 -1
  359. package/lib/utils/file-utils.js +1 -1
  360. package/lib/utils/guides-cdn.js +1 -1
  361. package/lib/utils/http-client.js +1 -1
  362. package/lib/utils/is-non-interactive.js +1 -1
  363. package/lib/utils/logger.js +1 -1
  364. package/lib/utils/params.js +1 -1
  365. package/lib/utils/platform.js +1 -1
  366. package/lib/utils/sleep.js +1 -1
  367. package/lib/utils/template-replacer.js +1 -1
  368. package/lib/utils/update-notice.js +1 -1
  369. package/lib/utils/version.js +1 -1
  370. package/lib/utils/with-active-cookie.js +1 -1
  371. package/lib/utils/write-cli-side-channel.js +1 -1
  372. package/package.json +1 -1
  373. package/skills/rabetbase/SKILL.md +1 -1
  374. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  375. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  376. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a250_0x41b03a=a250_0x3db1;(function(_0x71326a,_0x25111f){const _0x17e00a=a250_0x3db1,_0x3727b5=_0x71326a();while(!![]){try{const _0x51d98b=parseInt(_0x17e00a(0x18b))/0x1*(parseInt(_0x17e00a(0x188))/0x2)+-parseInt(_0x17e00a(0x187))/0x3*(-parseInt(_0x17e00a(0x175))/0x4)+-parseInt(_0x17e00a(0x17e))/0x5*(parseInt(_0x17e00a(0x18e))/0x6)+parseInt(_0x17e00a(0x17d))/0x7+-parseInt(_0x17e00a(0x176))/0x8*(parseInt(_0x17e00a(0x17c))/0x9)+-parseInt(_0x17e00a(0x174))/0xa+-parseInt(_0x17e00a(0x18a))/0xb*(parseInt(_0x17e00a(0x17b))/0xc);if(_0x51d98b===_0x25111f)break;else _0x3727b5['push'](_0x3727b5['shift']());}catch(_0x444b10){_0x3727b5['push'](_0x3727b5['shift']());}}}(a250_0x47e4,0x76177));function a250_0x47e4(){const _0x244a11=['execSuccess','sqlcode','1461250bxTczx','44vRkrbG','3648qCaBEn','SQL\x20execution\x20failed','execError','params','read','137364aGxVHM','243yhvwYg','480032LfbwiZ','2485530eyooFI','now','\x20row(s)\x20in\x20','exec','appCode','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','length','str','string','159447yuGccj','20744KltEpb','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','121FwJpXx','59YXCevj','execResult','sql','6OfPAAH'];a250_0x47e4=function(){return _0x244a11;};return a250_0x47e4();}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a250_0x3db1(_0x476865,_0x124fa9){_0x476865=_0x476865-0x173;const _0x47e42f=a250_0x47e4();let _0x3db151=_0x47e42f[_0x476865];return _0x3db151;}export const sqlExec={'service':a250_0x41b03a(0x18d),'command':a250_0x41b03a(0x181),'description':a250_0x41b03a(0x189),'risk':a250_0x41b03a(0x17a),'flags':[SQLCODE_FLAG,{'name':a250_0x41b03a(0x179),'type':a250_0x41b03a(0x186),'description':a250_0x41b03a(0x183)}],async 'execute'(_0x460c5b){const _0x47eb15=a250_0x41b03a,_0x4ff607=parseJsonParams(_0x460c5b[_0x47eb15(0x185)](_0x47eb15(0x179))),_0x111270=Date[_0x47eb15(0x17f)](),_0x15ab4b=await executeSql(_0x460c5b[_0x47eb15(0x182)],_0x460c5b[_0x47eb15(0x185)](_0x47eb15(0x173)),_0x4ff607),_0xd6a377=Date[_0x47eb15(0x17f)]()-_0x111270,_0x58d53f=_0x15ab4b?.[_0x47eb15(0x18c)]??_0x15ab4b,_0x414c7a=_0x15ab4b?.[_0x47eb15(0x18f)]??!![];if(!_0x414c7a)return{'ok':![],'data':{'error':_0x15ab4b?.[_0x47eb15(0x178)]||_0x47eb15(0x177),'elapsed':_0xd6a377},'message':_0x47eb15(0x177)};const _0x591c24=Array['isArray'](_0x58d53f)?_0x58d53f:[];return{'ok':!![],'data':{'rows':_0x591c24,'rowCount':_0x591c24['length'],'elapsed':_0xd6a377},'message':'Returned\x20'+_0x591c24[_0x47eb15(0x184)]+_0x47eb15(0x180)+_0xd6a377+'ms'};}};
1
+ const a250_0x5c118a=a250_0x1680;(function(_0x3a138d,_0x3f8fb7){const _0x16f2f3=a250_0x1680,_0x9f673f=_0x3a138d();while(!![]){try{const _0x357910=parseInt(_0x16f2f3(0x121))/0x1+-parseInt(_0x16f2f3(0x119))/0x2*(parseInt(_0x16f2f3(0x10e))/0x3)+parseInt(_0x16f2f3(0x11a))/0x4*(-parseInt(_0x16f2f3(0x11f))/0x5)+parseInt(_0x16f2f3(0x10d))/0x6+-parseInt(_0x16f2f3(0x10b))/0x7+parseInt(_0x16f2f3(0x120))/0x8*(-parseInt(_0x16f2f3(0x114))/0x9)+parseInt(_0x16f2f3(0x11e))/0xa*(parseInt(_0x16f2f3(0x116))/0xb);if(_0x357910===_0x3f8fb7)break;else _0x9f673f['push'](_0x9f673f['shift']());}catch(_0x52598a){_0x9f673f['push'](_0x9f673f['shift']());}}}(a250_0x26ca,0x6c073));function a250_0x26ca(){const _0x1e69da=['207iZaAZe','string','154VruSUh','execSuccess','execResult','6VrvtKE','758644DIFCOb','SQL\x20execution\x20failed','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','sql','1256610saMcYW','15PcLqmr','183256UjYgAc','629486nJNzrU','length','Returned\x20','execError','5337584DDycTk','params','3098082KkYBzq','604248mLuqQG','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','str','isArray','now','appCode'];a250_0x26ca=function(){return _0x1e69da;};return a250_0x26ca();}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a250_0x1680(_0x5d1ce0,_0x5b6e3d){_0x5d1ce0=_0x5d1ce0-0x10a;const _0x26ca4a=a250_0x26ca();let _0x16809d=_0x26ca4a[_0x5d1ce0];return _0x16809d;}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a250_0x5c118a(0x11d),'command':'exec','description':a250_0x5c118a(0x11c),'risk':'read','flags':[SQLCODE_FLAG,{'name':a250_0x5c118a(0x10c),'type':a250_0x5c118a(0x115),'description':a250_0x5c118a(0x10f)}],async 'execute'(_0x12c850){const _0x4d9971=a250_0x5c118a,_0xa5f3f=parseJsonParams(_0x12c850[_0x4d9971(0x110)](_0x4d9971(0x10c))),_0x4c9641=Date[_0x4d9971(0x112)](),_0x44c90d=await executeSql(_0x12c850[_0x4d9971(0x113)],_0x12c850[_0x4d9971(0x110)]('sqlcode'),_0xa5f3f),_0x146bc9=Date[_0x4d9971(0x112)]()-_0x4c9641,_0x40947c=_0x44c90d?.[_0x4d9971(0x118)]??_0x44c90d,_0x9e1b43=_0x44c90d?.[_0x4d9971(0x117)]??!![];if(!_0x9e1b43)return{'ok':![],'data':{'error':_0x44c90d?.[_0x4d9971(0x10a)]||_0x4d9971(0x11b),'elapsed':_0x146bc9},'message':'SQL\x20execution\x20failed'};const _0x44fa43=Array[_0x4d9971(0x111)](_0x40947c)?_0x40947c:[];return{'ok':!![],'data':{'rows':_0x44fa43,'rowCount':_0x44fa43['length'],'elapsed':_0x146bc9},'message':_0x4d9971(0x123)+_0x44fa43[_0x4d9971(0x122)]+'\x20row(s)\x20in\x20'+_0x146bc9+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x389efc,_0xd65e49){const _0xd847dd=a251_0x2bb5,_0x1c4567=_0x389efc();while(!![]){try{const _0x1d3935=parseInt(_0xd847dd(0xf6))/0x1+parseInt(_0xd847dd(0xf1))/0x2+parseInt(_0xd847dd(0xf8))/0x3*(-parseInt(_0xd847dd(0xf3))/0x4)+parseInt(_0xd847dd(0xf4))/0x5*(parseInt(_0xd847dd(0xf2))/0x6)+parseInt(_0xd847dd(0xfa))/0x7*(-parseInt(_0xd847dd(0xf9))/0x8)+parseInt(_0xd847dd(0xf7))/0x9+-parseInt(_0xd847dd(0xf5))/0xa;if(_0x1d3935===_0xd65e49)break;else _0x1c4567['push'](_0x1c4567['shift']());}catch(_0x56a7f9){_0x1c4567['push'](_0x1c4567['shift']());}}}(a251_0x1e1e,0xeee09));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 a251_0x2bb5(_0x1a344a,_0x12a6fc){_0x1a344a=_0x1a344a-0xf1;const _0x1e1ebd=a251_0x1e1e();let _0x2bb57e=_0x1e1ebd[_0x1a344a];return _0x2bb57e;}import{sqlPush}from'../../commands/sql/push.js';function a251_0x1e1e(){const _0x52158c=['798572ZbAKcY','55rhMWOr','26332660ZsJgsh','1139514EJlVtp','12295341DlonIE','6JGxDkH','7384SvLCoq','7609tzBIve','3449124OfUSYl','427674tmVlGE'];a251_0x1e1e=function(){return _0x52158c;};return a251_0x1e1e();}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x21b148,_0x116aeb){const _0xe255e6=a251_0x4cea,_0x5747e4=_0x21b148();while(!![]){try{const _0x30ebf5=-parseInt(_0xe255e6(0xc7))/0x1+parseInt(_0xe255e6(0xc4))/0x2+-parseInt(_0xe255e6(0xc2))/0x3*(-parseInt(_0xe255e6(0xc9))/0x4)+-parseInt(_0xe255e6(0xc3))/0x5+parseInt(_0xe255e6(0xc6))/0x6+parseInt(_0xe255e6(0xc5))/0x7+-parseInt(_0xe255e6(0xc8))/0x8;if(_0x30ebf5===_0x116aeb)break;else _0x5747e4['push'](_0x5747e4['shift']());}catch(_0x2b1024){_0x5747e4['push'](_0x5747e4['shift']());}}}(a251_0x1495,0x34b84));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';function a251_0x4cea(_0x328adc,_0x1f48f8){_0x328adc=_0x328adc-0xc2;const _0x149529=a251_0x1495();let _0x4cea8e=_0x149529[_0x328adc];return _0x4cea8e;}function a251_0x1495(){const _0x51a9f7=['1168360DNSLVL','806398NHeqTM','2436798RvhQFd','1821342vxsJra','414792RhOLzK','2576672rOOlUv','526472XJAsDw','3OWhnEj'];a251_0x1495=function(){return _0x51a9f7;};return a251_0x1495();}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 +1 @@
1
- const a252_0x27d053=a252_0x2128;(function(_0x1a45d3,_0x364e2f){const _0x1a3984=a252_0x2128,_0x34cb32=_0x1a45d3();while(!![]){try{const _0x22b404=-parseInt(_0x1a3984(0xe4))/0x1+-parseInt(_0x1a3984(0xde))/0x2+parseInt(_0x1a3984(0xe9))/0x3+parseInt(_0x1a3984(0xea))/0x4+parseInt(_0x1a3984(0xdd))/0x5+-parseInt(_0x1a3984(0xd6))/0x6*(parseInt(_0x1a3984(0xdb))/0x7)+parseInt(_0x1a3984(0xd9))/0x8*(parseInt(_0x1a3984(0xda))/0x9);if(_0x22b404===_0x364e2f)break;else _0x34cb32['push'](_0x34cb32['shift']());}catch(_0x5b2752){_0x34cb32['push'](_0x34cb32['shift']());}}}(a252_0x518e,0x82054));function a252_0x518e(){const _0x1f580b=['verbose','paging','23816vBNglS','2502eFlKex','84fQDdUd','bool','3740395YjVhjd','1265544sTWUpW','sql','str','length','description','number','290830dneAIE','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','Page\x20number','\x20SQL\x20queries\x20(total:\x20','sqlName','787797JUuBMn','2565784MqOuJW','name','num','tableData','List\x20custom\x20SQL\x20queries','boolean','dbId','appCode','all','Page\x20size','read','page','list','511782OgUDah'];a252_0x518e=function(){return _0x1f580b;};return a252_0x518e();}import{listSqlQueries}from'../../core/api-client.js';function a252_0x2128(_0x4de7dc,_0x1bb072){_0x4de7dc=_0x4de7dc-0xd0;const _0x518ee8=a252_0x518e();let _0x2128c8=_0x518ee8[_0x4de7dc];return _0x2128c8;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a252_0x27d053(0xdf),'command':a252_0x27d053(0xd5),'description':a252_0x27d053(0xee),'risk':a252_0x27d053(0xd3),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a252_0x27d053(0xeb),'type':'string','description':'Filter\x20by\x20SQL\x20name'},{'name':a252_0x27d053(0xd4),'type':a252_0x27d053(0xe3),'description':a252_0x27d053(0xe6),'default':0x1},{'name':'pagesize','type':a252_0x27d053(0xe3),'description':a252_0x27d053(0xd2)},{'name':a252_0x27d053(0xd7),'type':a252_0x27d053(0xef),'description':a252_0x27d053(0xe5)}],async 'execute'(_0xcdda3e){const _0x1b71c9=a252_0x27d053,_0x454a8e=await listSqlQueries(_0xcdda3e[_0x1b71c9(0xd0)],{'sqlCode':_0xcdda3e[_0x1b71c9(0xe0)]('sqlcode')||undefined,'sqlName':_0xcdda3e[_0x1b71c9(0xe0)]('name')||undefined,'currentPage':_0xcdda3e[_0x1b71c9(0xec)](_0x1b71c9(0xd4)),'pageSize':_0xcdda3e[_0x1b71c9(0xec)]('pagesize',0x32)}),_0x416f4f=_0xcdda3e[_0x1b71c9(0xdc)](_0x1b71c9(0xd7)),_0x286756=_0x454a8e[_0x1b71c9(0xed)]??[],_0x48778a=_0x454a8e[_0x1b71c9(0xd8)]?.['totalCount']??_0x286756[_0x1b71c9(0xe1)];let _0x401cce;return _0x416f4f?_0x401cce=_0x286756:_0x401cce=await Promise[_0x1b71c9(0xd1)](_0x286756['map'](async _0x411c33=>{const _0x3f90fa=_0x1b71c9;let _0x428b71;try{_0x428b71=_0x411c33[_0x3f90fa(0xf0)]?await getDbName(_0xcdda3e['appCode'],_0x411c33[_0x3f90fa(0xf0)]):undefined;}catch{}return{'sqlCode':_0x411c33['sqlCode'],'sqlName':_0x411c33[_0x3f90fa(0xe8)],'description':_0x411c33[_0x3f90fa(0xe2)]??'','db':_0x428b71?_0x428b71+'\x20('+_0x411c33[_0x3f90fa(0xf0)]+')':_0x411c33['dbId']??''};})),{'ok':!![],'data':_0x401cce,'message':_0x286756[_0x1b71c9(0xe1)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x286756['length']+_0x1b71c9(0xe7)+_0x48778a+').'};}};
1
+ const a252_0x6f6e9b=a252_0x57d5;(function(_0x56b91e,_0x1d2517){const _0x1e9da3=a252_0x57d5,_0x5c9904=_0x56b91e();while(!![]){try{const _0x1a672a=-parseInt(_0x1e9da3(0x19d))/0x1*(parseInt(_0x1e9da3(0x19b))/0x2)+parseInt(_0x1e9da3(0x187))/0x3*(-parseInt(_0x1e9da3(0x181))/0x4)+-parseInt(_0x1e9da3(0x190))/0x5+parseInt(_0x1e9da3(0x194))/0x6+-parseInt(_0x1e9da3(0x19a))/0x7+parseInt(_0x1e9da3(0x196))/0x8*(-parseInt(_0x1e9da3(0x182))/0x9)+parseInt(_0x1e9da3(0x184))/0xa;if(_0x1a672a===_0x1d2517)break;else _0x5c9904['push'](_0x5c9904['shift']());}catch(_0x580ff4){_0x5c9904['push'](_0x5c9904['shift']());}}}(a252_0x1199,0x56bf5));import{listSqlQueries}from'../../core/api-client.js';function a252_0x57d5(_0x5033d5,_0x1e4265){_0x5033d5=_0x5033d5-0x17e;const _0x119910=a252_0x1199();let _0x57d52f=_0x119910[_0x5033d5];return _0x57d52f;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a252_0x6f6e9b(0x17e),'command':a252_0x6f6e9b(0x188),'description':a252_0x6f6e9b(0x183),'risk':a252_0x6f6e9b(0x192),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a252_0x6f6e9b(0x18f),'type':a252_0x6f6e9b(0x18b),'description':a252_0x6f6e9b(0x18c)},{'name':a252_0x6f6e9b(0x1a0),'type':a252_0x6f6e9b(0x191),'description':a252_0x6f6e9b(0x19f),'default':0x1},{'name':a252_0x6f6e9b(0x186),'type':a252_0x6f6e9b(0x191),'description':a252_0x6f6e9b(0x17f)},{'name':a252_0x6f6e9b(0x180),'type':'boolean','description':a252_0x6f6e9b(0x195)}],async 'execute'(_0x64899f){const _0x45bb92=a252_0x6f6e9b,_0xe905d1=await listSqlQueries(_0x64899f[_0x45bb92(0x197)],{'sqlCode':_0x64899f[_0x45bb92(0x18d)]('sqlcode')||undefined,'sqlName':_0x64899f[_0x45bb92(0x18d)](_0x45bb92(0x18f))||undefined,'currentPage':_0x64899f[_0x45bb92(0x193)](_0x45bb92(0x1a0)),'pageSize':_0x64899f['num'](_0x45bb92(0x186),0x32)}),_0x416be4=_0x64899f['bool'](_0x45bb92(0x180)),_0x37dd33=_0xe905d1['tableData']??[],_0x2eda27=_0xe905d1[_0x45bb92(0x198)]?.[_0x45bb92(0x189)]??_0x37dd33[_0x45bb92(0x18a)];let _0x148344;return _0x416be4?_0x148344=_0x37dd33:_0x148344=await Promise[_0x45bb92(0x199)](_0x37dd33[_0x45bb92(0x185)](async _0x3499a8=>{const _0x3993b2=_0x45bb92;let _0x1e40c7;try{_0x1e40c7=_0x3499a8[_0x3993b2(0x19c)]?await getDbName(_0x64899f[_0x3993b2(0x197)],_0x3499a8[_0x3993b2(0x19c)]):undefined;}catch{}return{'sqlCode':_0x3499a8['sqlCode'],'sqlName':_0x3499a8[_0x3993b2(0x18e)],'description':_0x3499a8[_0x3993b2(0x19e)]??'','db':_0x1e40c7?_0x1e40c7+'\x20('+_0x3499a8['dbId']+')':_0x3499a8[_0x3993b2(0x19c)]??''};})),{'ok':!![],'data':_0x148344,'message':_0x37dd33[_0x45bb92(0x18a)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x37dd33[_0x45bb92(0x18a)]+'\x20SQL\x20queries\x20(total:\x20'+_0x2eda27+').'};}};function a252_0x1199(){const _0x8162ad=['name','2013200bXbdWV','number','read','num','2048790tkWSZA','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','606304vXgGao','appCode','paging','all','2561776QgYAQC','12eCkfpB','dbId','58907dLOzaN','description','Page\x20number','page','sql','Page\x20size','verbose','204zvsUCL','45xnAGgm','List\x20custom\x20SQL\x20queries','19632340piEeVc','map','pagesize','26376eXsLzJ','list','totalCount','length','string','Filter\x20by\x20SQL\x20name','str','sqlName'];a252_0x1199=function(){return _0x8162ad;};return a252_0x1199();}
@@ -1 +1 @@
1
- const a253_0x42326f=a253_0xfdbc;(function(_0xa06f62,_0x425d35){const _0x4593e5=a253_0xfdbc,_0x411d58=_0xa06f62();while(!![]){try{const _0x130234=-parseInt(_0x4593e5(0x205))/0x1*(parseInt(_0x4593e5(0x1d0))/0x2)+-parseInt(_0x4593e5(0x1eb))/0x3+parseInt(_0x4593e5(0x1f4))/0x4*(-parseInt(_0x4593e5(0x1c4))/0x5)+-parseInt(_0x4593e5(0x1cd))/0x6*(-parseInt(_0x4593e5(0x1bf))/0x7)+parseInt(_0x4593e5(0x1e9))/0x8+-parseInt(_0x4593e5(0x1e1))/0x9+-parseInt(_0x4593e5(0x1f2))/0xa*(-parseInt(_0x4593e5(0x1ca))/0xb);if(_0x130234===_0x425d35)break;else _0x411d58['push'](_0x411d58['shift']());}catch(_0x237e64){_0x411d58['push'](_0x411d58['shift']());}}}(a253_0x2ce7,0x31238));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;async function fetchAllSqlQueries(_0x3b64e2,_0x3bdff6){const _0x2bd64e=a253_0xfdbc,_0x372f8b=[];let _0x2331f4=0x1;while(!![]){const _0x1cd815=await listSqlQueries(_0x3b64e2,{'currentPage':_0x2331f4,'pageSize':PAGE_SIZE,'sqlCode':_0x3bdff6[_0x2bd64e(0x1f0)],'sqlName':_0x3bdff6[_0x2bd64e(0x1dd)]}),_0x314e9c=_0x1cd815[_0x2bd64e(0x1c7)]??[];_0x372f8b['push'](..._0x314e9c);if(_0x314e9c[_0x2bd64e(0x1d9)]===0x0)break;const _0x2754dd=_0x1cd815[_0x2bd64e(0x1d1)]?.[_0x2bd64e(0x1d8)];if(_0x2754dd!=null?_0x372f8b[_0x2bd64e(0x1d9)]>=_0x2754dd:_0x314e9c[_0x2bd64e(0x1d9)]<PAGE_SIZE)break;_0x2331f4++;}return _0x372f8b;}async function ensureSqlContent(_0x57934f){const _0x58a96e=a253_0xfdbc;if(_0x57934f[_0x58a96e(0x1c6)]!=null&&String(_0x57934f[_0x58a96e(0x1c6)])[_0x58a96e(0x1d9)]>0x0)return _0x57934f;return getSqlQueryDetail(_0x57934f['sqlCode']);}export const sqlPull={'service':'sql','command':a253_0x42326f(0x1ed),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a253_0x42326f(0x1ef),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a253_0x42326f(0x1fd),'type':a253_0x42326f(0x1d4),'description':a253_0x42326f(0x204)},{'name':a253_0x42326f(0x1de),'type':a253_0x42326f(0x1e5),'description':a253_0x42326f(0x1cc)}],async 'dryRun'(_0x3622a2){const _0x943b0b=a253_0x42326f,_0x42143e=loadSqlProjectConfig(_0x3622a2[_0x943b0b(0x1c5)]),_0x410851=await readSqlLockFile(_0x42143e['lockFilePath']),{appLock:_0xac21e6}=ensureSqlLockScope(_0x410851??createEmptySqlLock(),_0x42143e['appCode'],_0x42143e[_0x943b0b(0x1ee)],_0x943b0b(0x1ed)),_0x581480=await fetchAllSqlQueries(_0x3622a2[_0x943b0b(0x1c5)],{'sqlCode':_0x3622a2['str'](_0x943b0b(0x1ba))||undefined,'sqlName':_0x3622a2[_0x943b0b(0x1d6)](_0x943b0b(0x1fd))||undefined}),_0x55d30b=[];for(const _0x4a212a of _0x581480){const _0x12e525=await ensureSqlContent(_0x4a212a),_0x121ec0=ensureRemoteSqlContent(_0x12e525),_0x11b7c=detectSqlMode(_0x121ec0),_0x272c22=_0x12e525[_0x943b0b(0x200)]?await getDbName(_0x3622a2[_0x943b0b(0x1c5)],Number(_0x12e525[_0x943b0b(0x200)]))[_0x943b0b(0x1ec)](()=>undefined):undefined,_0x5e3ed5=buildLocalSqlFileContent({'sqlCode':_0x12e525[_0x943b0b(0x1f0)],'sqlName':_0x12e525[_0x943b0b(0x1dd)],'dbId':_0x12e525[_0x943b0b(0x200)]},_0x121ec0,{'dbName':_0x272c22,'mode':_0x11b7c,'syncedAt':new Date()[_0x943b0b(0x1e8)](),'description':_0x12e525[_0x943b0b(0x1bc)]}),_0x11d31d=buildSqlLockEntry(_0x12e525,_0x121ec0,'',{'dbName':_0x272c22}),_0x3408b4=resolveLocalSqlFilePath(_0x42143e,_0x12e525[_0x943b0b(0x1f0)],_0x11d31d);let _0x277ca8=_0x943b0b(0x1c8),_0xe6fd1e;const _0x960ddc=await findExistingSqlFiles(_0x42143e,_0x3408b4,_0x11b7c,_0xac21e6[_0x943b0b(0x1df)][_0x12e525[_0x943b0b(0x1f0)]]);if(_0x960ddc['length']>0x0){const _0x1fe851=await compareExistingSqlFiles(_0x960ddc,_0x5e3ed5,_0x11b7c);if(_0x1fe851[_0x943b0b(0x1b9)](({equivalent:_0x3f130d})=>!_0x3f130d))_0x277ca8=_0x943b0b(0x1e3),_0xe6fd1e=_0x943b0b(0x203);else _0x1fe851[_0x943b0b(0x1d9)]===0x1&&_0x1fe851[0x0]?.['file'][_0x943b0b(0x1d7)]&&(_0x277ca8=_0x943b0b(0x1fa),_0xe6fd1e=_0x943b0b(0x1e6));}_0x55d30b[_0x943b0b(0x1ce)]({'sqlCode':_0x12e525[_0x943b0b(0x1f0)],'sqlName':_0x12e525['sqlName'],'filePath':_0x3408b4,'status':_0x277ca8,'reason':_0xe6fd1e});}return{'method':_0x943b0b(0x1ea),'url':_0x943b0b(0x1f1),'body':{'appCode':_0x3622a2[_0x943b0b(0x1c5)],'sqlCode':_0x3622a2['str'](_0x943b0b(0x1ba))||null,'sqlName':_0x3622a2[_0x943b0b(0x1d6)](_0x943b0b(0x1fd))||null,'files':_0x55d30b},'description':_0x943b0b(0x1da)+_0x55d30b[_0x943b0b(0x1d9)]+_0x943b0b(0x1cf)+_0x42143e[_0x943b0b(0x202)]};},async 'execute'(_0x5bf717){const _0x8207a9=a253_0x42326f,_0x36fdf3=loadSqlProjectConfig(_0x5bf717[_0x8207a9(0x1c5)]),_0x53c8f0=await readSqlLockFile(_0x36fdf3[_0x8207a9(0x1bb)]),{lockData:_0x44d74e,appLock:_0x323f08}=ensureSqlLockScope(_0x53c8f0??createEmptySqlLock(),_0x36fdf3['appCode'],_0x36fdf3[_0x8207a9(0x1ee)],'pull'),_0x33867a=_0x5bf717[_0x8207a9(0x1fc)](_0x8207a9(0x1de)),_0x58f8b8=await fetchAllSqlQueries(_0x5bf717['appCode'],{'sqlCode':_0x5bf717[_0x8207a9(0x1d6)](_0x8207a9(0x1ba))||undefined,'sqlName':_0x5bf717[_0x8207a9(0x1d6)](_0x8207a9(0x1fd))||undefined});if(_0x58f8b8[_0x8207a9(0x1d9)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x8207a9(0x1e7)};const _0x4d1301=[],_0x39af0f=[];for(const _0x57ab4c of _0x58f8b8){try{_0x4d1301[_0x8207a9(0x1ce)](await ensureSqlContent(_0x57ab4c));}catch(_0x1334a4){_0x39af0f['push']({'sqlCode':_0x57ab4c[_0x8207a9(0x1f0)],'error':_0x1334a4 instanceof Error?_0x1334a4['message']:String(_0x1334a4)});}}if(_0x33867a&&!_0x5bf717[_0x8207a9(0x1e0)]){let _0x30b547=![];for(const _0x4ef1b8 of _0x4d1301){const _0x4f6a6b=detectSqlMode(ensureRemoteSqlContent(_0x4ef1b8)),_0x4373b3=_0x4ef1b8[_0x8207a9(0x200)]?await getDbName(_0x5bf717[_0x8207a9(0x1c5)],Number(_0x4ef1b8[_0x8207a9(0x200)]))[_0x8207a9(0x1ec)](()=>undefined):undefined,_0x2f8b5f=buildLocalSqlFileContent({'sqlCode':_0x4ef1b8['sqlCode'],'sqlName':_0x4ef1b8['sqlName'],'dbId':_0x4ef1b8[_0x8207a9(0x200)]},ensureRemoteSqlContent(_0x4ef1b8),{'dbName':_0x4373b3,'mode':_0x4f6a6b,'syncedAt':new Date()[_0x8207a9(0x1e8)](),'description':_0x4ef1b8[_0x8207a9(0x1bc)]}),_0x209bde=resolveLocalSqlFilePath(_0x36fdf3,_0x4ef1b8['sqlCode'],buildSqlLockEntry(_0x4ef1b8,ensureRemoteSqlContent(_0x4ef1b8),'',{'dbName':_0x4373b3})),_0x5c3c7e=await findExistingSqlFiles(_0x36fdf3,_0x209bde,_0x4f6a6b,_0x323f08[_0x8207a9(0x1df)][_0x4ef1b8[_0x8207a9(0x1f0)]]),_0x2d5840=await compareExistingSqlFiles(_0x5c3c7e,_0x2f8b5f,_0x4f6a6b);if(_0x2d5840['some'](({equivalent:_0x4a150f})=>!_0x4a150f)){_0x30b547=!![];break;}}if(_0x30b547){const _0x551dd0=await confirmForceOverwrite(_0x8207a9(0x1c0));if(!_0x551dd0)throw CliErrors[_0x8207a9(0x1f3)](_0x8207a9(0x1c2));}}const _0x1fdc99=cloneSqlLockData(_0x44d74e),_0x9b5c15=_0x1fdc99[_0x8207a9(0x1dc)][_0x36fdf3[_0x8207a9(0x1c5)]],_0x452351=[],_0x14b46e=[];for(const _0x194e3d of _0x4d1301){const _0x3de197=_0x9b5c15[_0x8207a9(0x1df)][_0x194e3d[_0x8207a9(0x1f0)]],_0x5f21a4=ensureRemoteSqlContent(_0x194e3d),_0x115d2e=detectSqlMode(_0x5f21a4),_0x337ef4=_0x194e3d[_0x8207a9(0x200)]?await getDbName(_0x5bf717[_0x8207a9(0x1c5)],Number(_0x194e3d['dbId']))[_0x8207a9(0x1ec)](()=>undefined):undefined,_0x3d0974=buildLocalSqlFileContent({'sqlCode':_0x194e3d[_0x8207a9(0x1f0)],'sqlName':_0x194e3d[_0x8207a9(0x1dd)],'dbId':_0x194e3d['dbId']},_0x5f21a4,{'dbName':_0x337ef4,'mode':_0x115d2e,'syncedAt':new Date()[_0x8207a9(0x1e8)](),'description':_0x194e3d[_0x8207a9(0x1bc)]}),_0x3b6c66=buildSqlLockEntry(_0x194e3d,_0x5f21a4,computeSqlContentHash(_0x3d0974),{'dbName':_0x337ef4}),_0x2018e8=_0x3b6c66['path'],_0x29e1e6=join(_0x36fdf3[_0x8207a9(0x202)],_0x2018e8);try{const _0x39263d=await findExistingSqlFiles(_0x36fdf3,_0x29e1e6,_0x115d2e,_0x3de197),_0xa83f31=await compareExistingSqlFiles(_0x39263d,_0x3d0974,_0x115d2e);if(!_0x33867a&&_0xa83f31['some'](({equivalent:_0x1d7736})=>!_0x1d7736)){_0x14b46e[_0x8207a9(0x1ce)]({'sqlCode':_0x194e3d[_0x8207a9(0x1f0)],'reason':'local\x20differs\x20from\x20remote'});continue;}const _0x546240=_0xa83f31['find'](({file:_0x6510cc})=>_0x6510cc[_0x8207a9(0x1d7)]),_0x222911=_0xa83f31[_0x8207a9(0x1fe)](({file:_0x5721b9})=>!_0x5721b9[_0x8207a9(0x1d7)]);if(_0x546240?.[_0x8207a9(0x206)]&&!_0x222911){_0x14b46e['push']({'sqlCode':_0x194e3d['sqlCode'],'reason':'unchanged'}),_0x9b5c15[_0x8207a9(0x1df)][_0x194e3d[_0x8207a9(0x1f0)]]={..._0x3b6c66,'hash':computeSqlContentHash(_0x546240[_0x8207a9(0x1c1)]),'path':_0x2018e8};continue;}!_0x546240?.['equivalent']&&(await ensureParentDirectory(_0x29e1e6),await writeFile(_0x29e1e6,_0x3d0974,_0x8207a9(0x1d5))),_0x222911&&await rm(_0x222911[_0x8207a9(0x1db)][_0x8207a9(0x201)],{'force':!![]}),_0x9b5c15[_0x8207a9(0x1df)][_0x194e3d[_0x8207a9(0x1f0)]]={..._0x3b6c66,'hash':_0x546240?.[_0x8207a9(0x206)]?computeSqlContentHash(_0x546240[_0x8207a9(0x1c1)]):_0x3b6c66[_0x8207a9(0x1f8)],'path':_0x2018e8},_0x452351[_0x8207a9(0x1ce)]({'sqlCode':_0x194e3d[_0x8207a9(0x1f0)],'filePath':_0x29e1e6});}catch(_0x33dd53){_0x39af0f[_0x8207a9(0x1ce)]({'sqlCode':_0x194e3d[_0x8207a9(0x1f0)],'error':_0x33dd53 instanceof Error?_0x33dd53[_0x8207a9(0x1fb)]:String(_0x33dd53)});}}return _0x9b5c15['lastSync']=new Date()[_0x8207a9(0x1e8)](),await writeSqlLockFile(_0x36fdf3[_0x8207a9(0x1bb)],_0x1fdc99),{'ok':_0x39af0f[_0x8207a9(0x1d9)]===0x0,'data':{'pulled':_0x452351,'skipped':_0x14b46e,'failed':_0x39af0f},'message':'Pull\x20complete:\x20'+_0x452351[_0x8207a9(0x1d9)]+_0x8207a9(0x1e2)+_0x14b46e[_0x8207a9(0x1d9)]+_0x8207a9(0x1f5)+_0x39af0f[_0x8207a9(0x1d9)]+_0x8207a9(0x1f9)};}};function isEquivalentPulledSqlFile(_0x366d53,_0x1ed986,_0x742f95,_0x31acc1){if(_0x742f95!==_0x31acc1)return normalizePulledSqlBody(_0x366d53,_0x742f95)===normalizePulledSqlBody(_0x1ed986,_0x31acc1);return normalizePullComparableContent(_0x366d53,_0x742f95)===normalizePullComparableContent(_0x1ed986,_0x31acc1);}async function findExistingSqlFiles(_0x130a1b,_0x29b35a,_0x390bf6,_0x2b7cde){const _0x544372=a253_0x42326f,_0x15a255=[];await fileExists(_0x29b35a)&&_0x15a255[_0x544372(0x1ce)]({'filePath':_0x29b35a,'mode':_0x390bf6,'isCanonical':!![]});if(!_0x2b7cde?.[_0x544372(0x1e4)])return _0x15a255;const _0x4c460b=join(_0x130a1b[_0x544372(0x202)],_0x2b7cde['path']);if(_0x4c460b===_0x29b35a)return _0x15a255;return await fileExists(_0x4c460b)&&_0x15a255['push']({'filePath':_0x4c460b,'mode':_0x2b7cde[_0x544372(0x1be)]??modeFromFilePath(_0x4c460b),'isCanonical':![]}),_0x15a255;}function a253_0xfdbc(_0x4f8401,_0x97c7f1){_0x4f8401=_0x4f8401-0x1b9;const _0x2ce706=a253_0x2ce7();let _0xfdbcf7=_0x2ce706[_0x4f8401];return _0xfdbcf7;}async function compareExistingSqlFiles(_0x4eb718,_0x4ce404,_0x5e237f){const _0x590cb6=a253_0x42326f;return Promise['all'](_0x4eb718[_0x590cb6(0x1d3)](async _0x4e8031=>{const _0x2475cd=_0x590cb6,_0x46862c=await readFile(_0x4e8031['filePath'],_0x2475cd(0x1d5));return{'file':_0x4e8031,'content':_0x46862c,'equivalent':isEquivalentPulledSqlFile(_0x46862c,_0x4ce404,_0x4e8031[_0x2475cd(0x1be)],_0x5e237f)};}));}function a253_0x2ce7(){const _0x57d778=['bool','name','find','test','dbId','filePath','sqlRootDir','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','Filter\x20by\x20SQL\x20display\x20name','19jrYegS','equivalent','some','sqlcode','lockFilePath','description','trim','mode','1404683eEPzuj','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','content','Force\x20pull\x20cancelled.','endsWith','2955XNhTWh','appCode','sqlContent','tableData','would_pull','filter','242vHbQjP','mybatisXml','Force\x20overwrite\x20local\x20unsynced\x20changes','6JZYTem','push','\x20SQL\x20file(s)\x20into\x20','6430KBgxfC','paging','split','map','string','utf8','str','isCanonical','totalCount','length','Would\x20pull\x20','file','apps','sqlName','force','sqls','nonInteractive','285444yStxIT','\x20written,\x20','conflict','path','boolean','unchanged','No\x20remote\x20SQL\x20queries\x20matched.','toISOString','2850416OjXeMh','POST','686325XjgZzn','catch','pull','sqlRoot','read','sqlCode','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','116390vxcsuw','cancelled','1964BUKYyj','\x20skipped,\x20','toLowerCase','replace','hash','\x20failed','skipped','message'];a253_0x2ce7=function(){return _0x57d778;};return a253_0x2ce7();}function modeFromFilePath(_0x1846f6){const _0x194185=a253_0x42326f;return _0x1846f6[_0x194185(0x1f6)]()[_0x194185(0x1c3)]('.xml')?_0x194185(0x1cb):'sql';}function normalizePulledSqlBody(_0x1f740f,_0x108f9e){const _0x1121a2=a253_0x42326f;return stripLocalSqlMetadata(_0x1f740f,_0x108f9e)['replace'](/\r\n/g,'\x0a')[_0x1121a2(0x1bd)]();}function normalizePullComparableContent(_0x3b11f9,_0x32bfa6){const _0xf17d69=a253_0x42326f,_0x75b7a9=_0x3b11f9[_0xf17d69(0x1f7)](/\r\n/g,'\x0a')[_0xf17d69(0x1d2)]('\x0a'),_0x3c1996=_0x75b7a9[_0xf17d69(0x1c9)](_0x5d0215=>!isSyncedAtMetadataLine(_0x5d0215,_0x32bfa6));return _0x3c1996['join']('\x0a');}function isSyncedAtMetadataLine(_0x5c45e1,_0x520763){const _0x5af6bd=a253_0x42326f;if(_0x520763==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x5af6bd(0x1ff)](_0x5c45e1);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x5af6bd(0x1ff)](_0x5c45e1);}
1
+ function a253_0x11db(_0x47a6ed,_0x34a802){_0x47a6ed=_0x47a6ed-0x1f4;const _0x496811=a253_0x4968();let _0x11db4a=_0x496811[_0x47a6ed];return _0x11db4a;}const a253_0x183e2c=a253_0x11db;(function(_0x2364ef,_0x4fc83e){const _0x56b57b=a253_0x11db,_0x1f54ec=_0x2364ef();while(!![]){try{const _0x245956=parseInt(_0x56b57b(0x22c))/0x1+-parseInt(_0x56b57b(0x213))/0x2+-parseInt(_0x56b57b(0x230))/0x3*(parseInt(_0x56b57b(0x1fc))/0x4)+parseInt(_0x56b57b(0x20d))/0x5*(parseInt(_0x56b57b(0x200))/0x6)+-parseInt(_0x56b57b(0x203))/0x7*(-parseInt(_0x56b57b(0x214))/0x8)+-parseInt(_0x56b57b(0x21d))/0x9+parseInt(_0x56b57b(0x22b))/0xa;if(_0x245956===_0x4fc83e)break;else _0x1f54ec['push'](_0x1f54ec['shift']());}catch(_0x33eb9b){_0x1f54ec['push'](_0x1f54ec['shift']());}}}(a253_0x4968,0xbac45));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';function a253_0x4968(){const _0x7661ee=['tableData','lockFilePath','nonInteractive','13041iPIdZB','description','Filter\x20by\x20SQL\x20display\x20name','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sql','catch','some','appCode','split','\x20SQL\x20file(s)\x20into\x20','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','dbId','toLowerCase','.xml','mybatisXml','read','mode','equivalent','1340sCgCLP','sqlRootDir','apps','string','1529166zRiNjq','test','toISOString','32501bzFsZi','sqls','POST','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','Pull\x20complete:\x20','Would\x20pull\x20','sqlcode','path','push','unchanged','5bmbpwk','join','name','paging','No\x20remote\x20SQL\x20queries\x20matched.','file','1326406uLOymI','1480gkCnBn','bool','sqlName','sqlRoot','Force\x20pull\x20cancelled.','\x20skipped,\x20','conflict','isCanonical','boolean','533457rAcOHM','utf8','force','pull','message','str','local\x20differs\x20from\x20remote','length','sqlContent','trim','lastSync','map','sqlCode','find','6131720xDDWDP','1216730yJAiPZ'];a253_0x4968=function(){return _0x7661ee;};return a253_0x4968();}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;async function fetchAllSqlQueries(_0x49146e,_0x4c0174){const _0x493793=a253_0x11db,_0x81eb44=[];let _0x3f3764=0x1;while(!![]){const _0x57a3cd=await listSqlQueries(_0x49146e,{'currentPage':_0x3f3764,'pageSize':PAGE_SIZE,'sqlCode':_0x4c0174[_0x493793(0x229)],'sqlName':_0x4c0174[_0x493793(0x216)]}),_0x345957=_0x57a3cd[_0x493793(0x22d)]??[];_0x81eb44['push'](..._0x345957);if(_0x345957[_0x493793(0x224)]===0x0)break;const _0x5e8404=_0x57a3cd[_0x493793(0x210)]?.['totalCount'];if(_0x5e8404!=null?_0x81eb44[_0x493793(0x224)]>=_0x5e8404:_0x345957[_0x493793(0x224)]<PAGE_SIZE)break;_0x3f3764++;}return _0x81eb44;}async function ensureSqlContent(_0x3d5359){const _0x11cb80=a253_0x11db;if(_0x3d5359[_0x11cb80(0x225)]!=null&&String(_0x3d5359[_0x11cb80(0x225)])[_0x11cb80(0x224)]>0x0)return _0x3d5359;return getSqlQueryDetail(_0x3d5359[_0x11cb80(0x229)]);}export const sqlPull={'service':a253_0x183e2c(0x234),'command':'pull','description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a253_0x183e2c(0x1f9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a253_0x183e2c(0x20f),'type':a253_0x183e2c(0x1ff),'description':a253_0x183e2c(0x232)},{'name':a253_0x183e2c(0x21f),'type':a253_0x183e2c(0x21c),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x492d74){const _0x2ecb35=a253_0x183e2c,_0x115215=loadSqlProjectConfig(_0x492d74[_0x2ecb35(0x237)]),_0x5889d0=await readSqlLockFile(_0x115215['lockFilePath']),{appLock:_0x191c45}=ensureSqlLockScope(_0x5889d0??createEmptySqlLock(),_0x115215[_0x2ecb35(0x237)],_0x115215[_0x2ecb35(0x217)],_0x2ecb35(0x220)),_0x400b3e=await fetchAllSqlQueries(_0x492d74[_0x2ecb35(0x237)],{'sqlCode':_0x492d74[_0x2ecb35(0x222)]('sqlcode')||undefined,'sqlName':_0x492d74['str']('name')||undefined}),_0x58fe1f=[];for(const _0x4be44a of _0x400b3e){const _0x578a23=await ensureSqlContent(_0x4be44a),_0x5cde99=ensureRemoteSqlContent(_0x578a23),_0x1ef923=detectSqlMode(_0x5cde99),_0xf1c8c9=_0x578a23['dbId']?await getDbName(_0x492d74[_0x2ecb35(0x237)],Number(_0x578a23['dbId']))[_0x2ecb35(0x235)](()=>undefined):undefined,_0x473b7b=buildLocalSqlFileContent({'sqlCode':_0x578a23[_0x2ecb35(0x229)],'sqlName':_0x578a23[_0x2ecb35(0x216)],'dbId':_0x578a23[_0x2ecb35(0x1f5)]},_0x5cde99,{'dbName':_0xf1c8c9,'mode':_0x1ef923,'syncedAt':new Date()[_0x2ecb35(0x202)](),'description':_0x578a23[_0x2ecb35(0x231)]}),_0x2bede5=buildSqlLockEntry(_0x578a23,_0x5cde99,'',{'dbName':_0xf1c8c9}),_0x4715c9=resolveLocalSqlFilePath(_0x115215,_0x578a23[_0x2ecb35(0x229)],_0x2bede5);let _0x38fd7b='would_pull',_0x53e514;const _0x4e0218=await findExistingSqlFiles(_0x115215,_0x4715c9,_0x1ef923,_0x191c45[_0x2ecb35(0x204)][_0x578a23[_0x2ecb35(0x229)]]);if(_0x4e0218[_0x2ecb35(0x224)]>0x0){const _0x1c1115=await compareExistingSqlFiles(_0x4e0218,_0x473b7b,_0x1ef923);if(_0x1c1115[_0x2ecb35(0x236)](({equivalent:_0x1e8fe6})=>!_0x1e8fe6))_0x38fd7b=_0x2ecb35(0x21a),_0x53e514=_0x2ecb35(0x233);else _0x1c1115[_0x2ecb35(0x224)]===0x1&&_0x1c1115[0x0]?.['file'][_0x2ecb35(0x21b)]&&(_0x38fd7b='skipped',_0x53e514=_0x2ecb35(0x20c));}_0x58fe1f[_0x2ecb35(0x20b)]({'sqlCode':_0x578a23[_0x2ecb35(0x229)],'sqlName':_0x578a23['sqlName'],'filePath':_0x4715c9,'status':_0x38fd7b,'reason':_0x53e514});}return{'method':_0x2ecb35(0x205),'url':_0x2ecb35(0x206),'body':{'appCode':_0x492d74[_0x2ecb35(0x237)],'sqlCode':_0x492d74[_0x2ecb35(0x222)]('sqlcode')||null,'sqlName':_0x492d74['str']('name')||null,'files':_0x58fe1f},'description':_0x2ecb35(0x208)+_0x58fe1f[_0x2ecb35(0x224)]+_0x2ecb35(0x239)+_0x115215[_0x2ecb35(0x1fd)]};},async 'execute'(_0x51d328){const _0x4f1a88=a253_0x183e2c,_0x260985=loadSqlProjectConfig(_0x51d328['appCode']),_0x21b23d=await readSqlLockFile(_0x260985['lockFilePath']),{lockData:_0x3ae984,appLock:_0x214b68}=ensureSqlLockScope(_0x21b23d??createEmptySqlLock(),_0x260985['appCode'],_0x260985[_0x4f1a88(0x217)],_0x4f1a88(0x220)),_0x409e41=_0x51d328[_0x4f1a88(0x215)](_0x4f1a88(0x21f)),_0x297f7d=await fetchAllSqlQueries(_0x51d328[_0x4f1a88(0x237)],{'sqlCode':_0x51d328[_0x4f1a88(0x222)](_0x4f1a88(0x209))||undefined,'sqlName':_0x51d328[_0x4f1a88(0x222)](_0x4f1a88(0x20f))||undefined});if(_0x297f7d[_0x4f1a88(0x224)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4f1a88(0x211)};const _0x5e8f8c=[],_0x5005e2=[];for(const _0x7bcfd8 of _0x297f7d){try{_0x5e8f8c[_0x4f1a88(0x20b)](await ensureSqlContent(_0x7bcfd8));}catch(_0x142838){_0x5005e2['push']({'sqlCode':_0x7bcfd8[_0x4f1a88(0x229)],'error':_0x142838 instanceof Error?_0x142838[_0x4f1a88(0x221)]:String(_0x142838)});}}if(_0x409e41&&!_0x51d328[_0x4f1a88(0x22f)]){let _0x18d560=![];for(const _0xfeafef of _0x5e8f8c){const _0x40c32f=detectSqlMode(ensureRemoteSqlContent(_0xfeafef)),_0xe3cb64=_0xfeafef[_0x4f1a88(0x1f5)]?await getDbName(_0x51d328[_0x4f1a88(0x237)],Number(_0xfeafef[_0x4f1a88(0x1f5)]))[_0x4f1a88(0x235)](()=>undefined):undefined,_0x409149=buildLocalSqlFileContent({'sqlCode':_0xfeafef[_0x4f1a88(0x229)],'sqlName':_0xfeafef[_0x4f1a88(0x216)],'dbId':_0xfeafef[_0x4f1a88(0x1f5)]},ensureRemoteSqlContent(_0xfeafef),{'dbName':_0xe3cb64,'mode':_0x40c32f,'syncedAt':new Date()['toISOString'](),'description':_0xfeafef['description']}),_0x1b8e38=resolveLocalSqlFilePath(_0x260985,_0xfeafef['sqlCode'],buildSqlLockEntry(_0xfeafef,ensureRemoteSqlContent(_0xfeafef),'',{'dbName':_0xe3cb64})),_0x176275=await findExistingSqlFiles(_0x260985,_0x1b8e38,_0x40c32f,_0x214b68['sqls'][_0xfeafef[_0x4f1a88(0x229)]]),_0x261a51=await compareExistingSqlFiles(_0x176275,_0x409149,_0x40c32f);if(_0x261a51[_0x4f1a88(0x236)](({equivalent:_0x31f931})=>!_0x31f931)){_0x18d560=!![];break;}}if(_0x18d560){const _0x3f2684=await confirmForceOverwrite(_0x4f1a88(0x1f4));if(!_0x3f2684)throw CliErrors['cancelled'](_0x4f1a88(0x218));}}const _0x44cb85=cloneSqlLockData(_0x3ae984),_0x16decf=_0x44cb85[_0x4f1a88(0x1fe)][_0x260985[_0x4f1a88(0x237)]],_0x14191d=[],_0x4e408d=[];for(const _0x5ee85f of _0x5e8f8c){const _0x305332=_0x16decf[_0x4f1a88(0x204)][_0x5ee85f[_0x4f1a88(0x229)]],_0x56675a=ensureRemoteSqlContent(_0x5ee85f),_0x4ae890=detectSqlMode(_0x56675a),_0x58e64a=_0x5ee85f[_0x4f1a88(0x1f5)]?await getDbName(_0x51d328['appCode'],Number(_0x5ee85f[_0x4f1a88(0x1f5)]))[_0x4f1a88(0x235)](()=>undefined):undefined,_0x591418=buildLocalSqlFileContent({'sqlCode':_0x5ee85f[_0x4f1a88(0x229)],'sqlName':_0x5ee85f[_0x4f1a88(0x216)],'dbId':_0x5ee85f['dbId']},_0x56675a,{'dbName':_0x58e64a,'mode':_0x4ae890,'syncedAt':new Date()[_0x4f1a88(0x202)](),'description':_0x5ee85f[_0x4f1a88(0x231)]}),_0x2ab11e=buildSqlLockEntry(_0x5ee85f,_0x56675a,computeSqlContentHash(_0x591418),{'dbName':_0x58e64a}),_0x4efe74=_0x2ab11e[_0x4f1a88(0x20a)],_0x183f02=join(_0x260985['sqlRootDir'],_0x4efe74);try{const _0xc57284=await findExistingSqlFiles(_0x260985,_0x183f02,_0x4ae890,_0x305332),_0x2495cc=await compareExistingSqlFiles(_0xc57284,_0x591418,_0x4ae890);if(!_0x409e41&&_0x2495cc[_0x4f1a88(0x236)](({equivalent:_0xe9eb95})=>!_0xe9eb95)){_0x4e408d[_0x4f1a88(0x20b)]({'sqlCode':_0x5ee85f[_0x4f1a88(0x229)],'reason':_0x4f1a88(0x223)});continue;}const _0x55aba0=_0x2495cc[_0x4f1a88(0x22a)](({file:_0x3365c9})=>_0x3365c9['isCanonical']),_0x521649=_0x2495cc[_0x4f1a88(0x22a)](({file:_0xb364b4})=>!_0xb364b4[_0x4f1a88(0x21b)]);if(_0x55aba0?.[_0x4f1a88(0x1fb)]&&!_0x521649){_0x4e408d[_0x4f1a88(0x20b)]({'sqlCode':_0x5ee85f[_0x4f1a88(0x229)],'reason':'unchanged'}),_0x16decf[_0x4f1a88(0x204)][_0x5ee85f[_0x4f1a88(0x229)]]={..._0x2ab11e,'hash':computeSqlContentHash(_0x55aba0['content']),'path':_0x4efe74};continue;}!_0x55aba0?.[_0x4f1a88(0x1fb)]&&(await ensureParentDirectory(_0x183f02),await writeFile(_0x183f02,_0x591418,_0x4f1a88(0x21e))),_0x521649&&await rm(_0x521649[_0x4f1a88(0x212)]['filePath'],{'force':!![]}),_0x16decf['sqls'][_0x5ee85f[_0x4f1a88(0x229)]]={..._0x2ab11e,'hash':_0x55aba0?.['equivalent']?computeSqlContentHash(_0x55aba0['content']):_0x2ab11e['hash'],'path':_0x4efe74},_0x14191d[_0x4f1a88(0x20b)]({'sqlCode':_0x5ee85f['sqlCode'],'filePath':_0x183f02});}catch(_0x54c0a4){_0x5005e2['push']({'sqlCode':_0x5ee85f[_0x4f1a88(0x229)],'error':_0x54c0a4 instanceof Error?_0x54c0a4[_0x4f1a88(0x221)]:String(_0x54c0a4)});}}return _0x16decf[_0x4f1a88(0x227)]=new Date()[_0x4f1a88(0x202)](),await writeSqlLockFile(_0x260985[_0x4f1a88(0x22e)],_0x44cb85),{'ok':_0x5005e2[_0x4f1a88(0x224)]===0x0,'data':{'pulled':_0x14191d,'skipped':_0x4e408d,'failed':_0x5005e2},'message':_0x4f1a88(0x207)+_0x14191d[_0x4f1a88(0x224)]+'\x20written,\x20'+_0x4e408d[_0x4f1a88(0x224)]+_0x4f1a88(0x219)+_0x5005e2[_0x4f1a88(0x224)]+'\x20failed'};}};function isEquivalentPulledSqlFile(_0x15763d,_0x1f8ab6,_0x1321c5,_0x331f78){if(_0x1321c5!==_0x331f78)return normalizePulledSqlBody(_0x15763d,_0x1321c5)===normalizePulledSqlBody(_0x1f8ab6,_0x331f78);return normalizePullComparableContent(_0x15763d,_0x1321c5)===normalizePullComparableContent(_0x1f8ab6,_0x331f78);}async function findExistingSqlFiles(_0x215bfd,_0x2acff0,_0x496e85,_0x62feaf){const _0x459664=a253_0x183e2c,_0x1b3270=[];await fileExists(_0x2acff0)&&_0x1b3270['push']({'filePath':_0x2acff0,'mode':_0x496e85,'isCanonical':!![]});if(!_0x62feaf?.[_0x459664(0x20a)])return _0x1b3270;const _0x76debc=join(_0x215bfd['sqlRootDir'],_0x62feaf[_0x459664(0x20a)]);if(_0x76debc===_0x2acff0)return _0x1b3270;return await fileExists(_0x76debc)&&_0x1b3270[_0x459664(0x20b)]({'filePath':_0x76debc,'mode':_0x62feaf[_0x459664(0x1fa)]??modeFromFilePath(_0x76debc),'isCanonical':![]}),_0x1b3270;}async function compareExistingSqlFiles(_0x307eb7,_0x4c7355,_0x4dca27){const _0x5212a1=a253_0x183e2c;return Promise['all'](_0x307eb7[_0x5212a1(0x228)](async _0x327d57=>{const _0x24cb0e=_0x5212a1,_0x23d115=await readFile(_0x327d57['filePath'],_0x24cb0e(0x21e));return{'file':_0x327d57,'content':_0x23d115,'equivalent':isEquivalentPulledSqlFile(_0x23d115,_0x4c7355,_0x327d57['mode'],_0x4dca27)};}));}function modeFromFilePath(_0x58ea12){const _0x15558e=a253_0x183e2c;return _0x58ea12[_0x15558e(0x1f6)]()['endsWith'](_0x15558e(0x1f7))?'mybatisXml':_0x15558e(0x234);}function normalizePulledSqlBody(_0x3e6ef5,_0x1c29b8){const _0xb07a1d=a253_0x183e2c;return stripLocalSqlMetadata(_0x3e6ef5,_0x1c29b8)['replace'](/\r\n/g,'\x0a')[_0xb07a1d(0x226)]();}function normalizePullComparableContent(_0x58aa9d,_0x370b77){const _0x42dd74=a253_0x183e2c,_0x3ab5ef=_0x58aa9d['replace'](/\r\n/g,'\x0a')[_0x42dd74(0x238)]('\x0a'),_0x12daac=_0x3ab5ef['filter'](_0x45d8a5=>!isSyncedAtMetadataLine(_0x45d8a5,_0x370b77));return _0x12daac[_0x42dd74(0x20e)]('\x0a');}function isSyncedAtMetadataLine(_0x31a2b8,_0x57316c){const _0x4b80e7=a253_0x183e2c;if(_0x57316c===_0x4b80e7(0x1f8))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x31a2b8);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x4b80e7(0x201)](_0x31a2b8);}
@@ -1 +1 @@
1
- const a254_0x14a522=a254_0x2889;(function(_0x36ea08,_0x4c34b6){const _0x1c858f=a254_0x2889,_0x3186c4=_0x36ea08();while(!![]){try{const _0x5bccac=parseInt(_0x1c858f(0x21f))/0x1+parseInt(_0x1c858f(0x211))/0x2*(parseInt(_0x1c858f(0x1fe))/0x3)+-parseInt(_0x1c858f(0x215))/0x4+-parseInt(_0x1c858f(0x20c))/0x5*(-parseInt(_0x1c858f(0x209))/0x6)+parseInt(_0x1c858f(0x218))/0x7+parseInt(_0x1c858f(0x225))/0x8+-parseInt(_0x1c858f(0x224))/0x9;if(_0x5bccac===_0x4c34b6)break;else _0x3186c4['push'](_0x3186c4['shift']());}catch(_0x42d625){_0x3186c4['push'](_0x3186c4['shift']());}}}(a254_0xc998,0x18f79));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';function a254_0xc998(){const _0x2a389c=['200445sczfCL','dbName','map','utf8','force','length','appCode','64929BxgxJy','toISOString','dbId',':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','sqlcode','3242826UsLnJk','1558872zVBaaO','sqlCode','set','entries','hash','relativePath','\x20pushed,\x20','isFinite','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','sqlRootDir','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','sql','sqlName','lockFilePath','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','\x22\x20for\x20sqlCode\x20','str','path','/smartapi/custom/updateUserCustomSql','\x20failed','projectRoot','remoteId','version','join','bool','has','103389UqEGgD','sqls','\x20skipped,\x20','validation','exec','unchanged','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','Push\x20complete:\x20','sqlConfig','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','Local\x20directory\x20\x22','28116KAnHHd','POST','Push\x20local\x20SQL\x20files\x20to\x20remote','170OVsEzj','message','mode','filter','dbDirectory','6mCoqaV','filePath',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','354228Ipttod','catch','push'];a254_0xc998=function(){return _0x2a389c;};return a254_0xc998();}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(_0x59d0d3){const _0x2fd7a7=a254_0x2889,_0x4b427c=stripLocalSqlMetadata(await readFile(_0x59d0d3['filePath'],_0x2fd7a7(0x21b)),_0x59d0d3['mode']);if(!_0x4b427c['trim']())throw CliErrors['validation'](_0x59d0d3['sqlCode']+':\x20SQL\x20content\x20is\x20empty.');return _0x4b427c;}async function getTargetSqlQueries(_0x2894f1,_0xd464be,_0x445617){const _0x34a9f3=a254_0x2889,_0x4cb3d2=await scanLocalSqlQueries(_0x2894f1),_0x455d9b=new Map();for(const _0x2f78f0 of _0x4cb3d2){if(_0x445617&&_0x2f78f0[_0x34a9f3(0x226)]!==_0x445617)continue;const _0x3a3b71=_0x455d9b['get'](_0x2f78f0[_0x34a9f3(0x226)])??[];_0x3a3b71[_0x34a9f3(0x217)](_0x2f78f0),_0x455d9b[_0x34a9f3(0x227)](_0x2f78f0['sqlCode'],_0x3a3b71);}if(_0x445617&&!_0x455d9b[_0x34a9f3(0x1fd)](_0x445617))throw CliErrors[_0x34a9f3(0x201)]('Local\x20SQL\x20not\x20found:\x20'+_0x445617);const _0x4ebd3d=[];for(const [_0x26ed03,_0x1e57a6]of _0x455d9b[_0x34a9f3(0x228)]()){if(_0x1e57a6[_0x34a9f3(0x21d)]===0x1){_0x4ebd3d['push'](_0x1e57a6[0x0]);continue;}const _0x43682f=_0xd464be[_0x34a9f3(0x1ff)][_0x26ed03],_0x58f69b=_0x43682f?.['path'],_0x3a8d73=_0x58f69b?_0x1e57a6['filter'](_0x1419b3=>_0x1419b3[_0x34a9f3(0x22a)]!==_0x58f69b):_0x1e57a6;if(_0x43682f&&_0x3a8d73[_0x34a9f3(0x21d)]===0x1){_0x4ebd3d[_0x34a9f3(0x217)](_0x3a8d73[0x0]);continue;}throw CliErrors[_0x34a9f3(0x201)](_0x34a9f3(0x1ec)+_0x26ed03+_0x34a9f3(0x1ee));}return _0x4ebd3d;}export const sqlPush={'service':a254_0x14a522(0x1ef),'command':a254_0x14a522(0x217),'description':a254_0x14a522(0x20b),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a254_0x14a522(0x21c),'type':'boolean','description':a254_0x14a522(0x1f2)}],async 'dryRun'(_0x44646d){const _0x471059=a254_0x14a522,_0x32f52a=loadSqlProjectConfig(_0x44646d[_0x471059(0x21e)]),_0x245b19=await readSqlLockFile(_0x32f52a[_0x471059(0x1f1)]),{appLock:_0x3cdd63}=ensureSqlLockScope(_0x245b19??createEmptySqlLock(),_0x44646d['appCode'],_0x32f52a['sqlRoot'],_0x471059(0x217)),_0x2d9cff=await getTargetSqlQueries(_0x32f52a,_0x3cdd63,_0x44646d[_0x471059(0x1f4)]('sqlcode')||undefined),_0x4c6515=[];for(const _0x4989bc of _0x2d9cff){const _0x141010=await computeSqlFileHash(_0x4989bc[_0x471059(0x212)]),_0x1e23c2=_0x3cdd63[_0x471059(0x1ff)][_0x4989bc['sqlCode']],_0x46f4e1=!!_0x1e23c2&&(_0x1e23c2[_0x471059(0x1f5)]!==_0x4989bc[_0x471059(0x22a)]||!!_0x4989bc['sqlName']&&_0x1e23c2['sqlName']!==_0x4989bc[_0x471059(0x1f0)]||_0x1e23c2['mode']!==_0x4989bc['mode']);if(!_0x44646d[_0x471059(0x1fc)](_0x471059(0x21c))&&_0x1e23c2&&_0x1e23c2['hash']===_0x141010&&!_0x46f4e1)continue;if(!_0x1e23c2)throw CliErrors['validation'](_0x4989bc['sqlCode']+_0x471059(0x222));if(_0x1e23c2[_0x471059(0x1fa)]==null)throw CliErrors[_0x471059(0x201)](_0x4989bc[_0x471059(0x226)]+_0x471059(0x213));await resolveTargetDbBinding(_0x44646d['appCode'],_0x4989bc,_0x1e23c2),await readSqlUploadContent(_0x4989bc),_0x4c6515[_0x471059(0x217)](_0x4989bc['sqlCode']);}return{'method':_0x471059(0x20a),'url':_0x471059(0x1f6),'body':{'sqlCodes':_0x4c6515,'appCode':_0x44646d[_0x471059(0x21e)]},'description':'Would\x20push\x20'+_0x4c6515[_0x471059(0x21d)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x415d82){const _0x23fcb3=a254_0x14a522,_0x30947e=loadSqlProjectConfig(_0x415d82[_0x23fcb3(0x21e)]),_0x341238=await readSqlLockFile(_0x30947e[_0x23fcb3(0x1f1)]),{lockData:_0x5bdccc,appLock:_0x2e6e78}=ensureSqlLockScope(_0x341238??createEmptySqlLock(),_0x415d82[_0x23fcb3(0x21e)],_0x30947e['sqlRoot'],_0x23fcb3(0x217)),_0x3924f4=await getTargetSqlQueries(_0x30947e,_0x2e6e78,_0x415d82[_0x23fcb3(0x1f4)](_0x23fcb3(0x223))||undefined);if(_0x3924f4[_0x23fcb3(0x21d)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x5384b9=[],_0x2b2f25=[],_0x40969f=[];let _0x3d01f9=![];for(const _0x24b867 of _0x3924f4){const _0x4f7c4c=_0x2e6e78[_0x23fcb3(0x1ff)][_0x24b867[_0x23fcb3(0x226)]];if(!_0x4f7c4c){_0x40969f[_0x23fcb3(0x217)]({'sqlCode':_0x24b867[_0x23fcb3(0x226)],'error':_0x23fcb3(0x207)});continue;}try{const _0x13577a=await computeSqlFileHash(_0x24b867[_0x23fcb3(0x212)]),_0x8e664f=_0x4f7c4c['path']!==_0x24b867[_0x23fcb3(0x22a)]||!!_0x24b867[_0x23fcb3(0x1f0)]&&_0x4f7c4c[_0x23fcb3(0x1f0)]!==_0x24b867[_0x23fcb3(0x1f0)]||_0x4f7c4c[_0x23fcb3(0x20e)]!==_0x24b867[_0x23fcb3(0x20e)];if(!_0x415d82[_0x23fcb3(0x1fc)](_0x23fcb3(0x21c))&&_0x4f7c4c[_0x23fcb3(0x229)]===_0x13577a&&!_0x8e664f){_0x2b2f25['push']({'sqlCode':_0x24b867[_0x23fcb3(0x226)],'reason':_0x23fcb3(0x203)});continue;}if(_0x4f7c4c[_0x23fcb3(0x1fa)]==null){_0x40969f['push']({'sqlCode':_0x24b867[_0x23fcb3(0x226)],'error':_0x23fcb3(0x214)});continue;}const _0xa310ad=_0x24b867[_0x23fcb3(0x1f0)]||_0x4f7c4c[_0x23fcb3(0x1f0)],_0x161f5f=await resolveTargetDbBinding(_0x415d82['appCode'],_0x24b867,_0x4f7c4c),_0x169032=await readSqlUploadContent(_0x24b867),_0x543406=await updateSqlQuery({'id':_0x4f7c4c[_0x23fcb3(0x1f9)],'appCode':_0x415d82[_0x23fcb3(0x21e)],'sqlCode':_0x24b867[_0x23fcb3(0x226)],'sqlName':_0xa310ad,'dbId':_0x161f5f[_0x23fcb3(0x221)],'version':_0x4f7c4c[_0x23fcb3(0x1fa)],'sqlContent':_0x169032,'sqlConfig':_0x4f7c4c[_0x23fcb3(0x206)]??undefined}),_0x6243fe=_0x543406[_0x23fcb3(0x221)]?await getDbName(_0x415d82[_0x23fcb3(0x21e)],Number(_0x543406['dbId']))[_0x23fcb3(0x216)](()=>_0x161f5f['dbName']):_0x161f5f[_0x23fcb3(0x219)];_0x2e6e78['sqls'][_0x24b867['sqlCode']]={...buildSqlLockEntry(_0x543406,_0x169032,_0x13577a,{'dbName':_0x6243fe}),'path':_0x24b867[_0x23fcb3(0x22a)],'mode':_0x24b867[_0x23fcb3(0x20e)]},_0x3d01f9=!![],await archivePreviousSqlFileIfNeeded(_0x30947e,_0x4f7c4c[_0x23fcb3(0x1f5)],_0x24b867['relativePath']),_0x5384b9['push']({'sqlCode':_0x24b867[_0x23fcb3(0x226)],'remoteId':_0x4f7c4c[_0x23fcb3(0x1f9)]});}catch(_0x47960d){_0x40969f[_0x23fcb3(0x217)]({'sqlCode':_0x24b867[_0x23fcb3(0x226)],'error':_0x47960d instanceof Error?_0x47960d[_0x23fcb3(0x20d)]:String(_0x47960d)});}}(_0x3d01f9||_0x40969f[_0x23fcb3(0x21d)]===0x0)&&(_0x2e6e78['lastSync']=new Date()[_0x23fcb3(0x220)](),await writeSqlLockFile(_0x30947e[_0x23fcb3(0x1f1)],_0x5bdccc));const _0x30aebe=_0x40969f[_0x23fcb3(0x21d)]===0x0;return{'ok':_0x30aebe,'data':{'pushed':_0x5384b9,'skipped':_0x2b2f25,'failed':_0x40969f},'message':_0x23fcb3(0x205)+_0x5384b9[_0x23fcb3(0x21d)]+_0x23fcb3(0x22b)+_0x2b2f25['length']+_0x23fcb3(0x200)+_0x40969f[_0x23fcb3(0x21d)]+_0x23fcb3(0x1f7)};}};async function archivePreviousSqlFileIfNeeded(_0x9ef87f,_0x5e6ee4,_0x345232){const _0x132364=a254_0x14a522;if(!_0x5e6ee4||_0x5e6ee4===_0x345232)return;const _0x256ef1=join(_0x9ef87f[_0x132364(0x1ed)],_0x5e6ee4);if(!await fileExists(_0x256ef1))return;const _0x44220d=await moveToTrash(_0x9ef87f[_0x132364(0x1f8)],_0x9ef87f['trashDir'],_0x256ef1);await cleanupEmptyDirectories(dirname(_0x256ef1),_0x9ef87f[_0x132364(0x1ed)]),void _0x44220d;}async function moveToTrash(_0x2e4102,_0x310bad,_0x1ece01){const _0x4e49af=a254_0x14a522,_0x5c77c9=new Date()[_0x4e49af(0x220)]()['replace'](/[:.]/g,'-'),_0x32610e=relative(_0x2e4102,_0x1ece01),_0x27d881=join(_0x310bad,_0x5c77c9,_0x32610e);return await mkdir(dirname(_0x27d881),{'recursive':!![]}),await rename(_0x1ece01,_0x27d881),_0x27d881;}async function cleanupEmptyDirectories(_0x414a26,_0x565155){const _0x3c74da=a254_0x14a522;let _0x49a066=resolve(_0x414a26);const _0x3d5cd3=resolve(_0x565155);while(_0x49a066['startsWith'](''+_0x3d5cd3+sep)||_0x49a066===_0x3d5cd3){if(_0x49a066===_0x3d5cd3)return;try{const _0x18c6f9=await readdir(_0x49a066);if(_0x18c6f9[_0x3c74da(0x21d)]>0x0)return;await rmdir(_0x49a066);}catch{return;}_0x49a066=dirname(_0x49a066);}}async function resolveTargetDbBinding(_0x6e24ac,_0x5105b8,_0x23c992){const _0x3059fc=a254_0x14a522,_0x69faa7=_0x5105b8[_0x3059fc(0x210)];if(!_0x69faa7)return{'dbId':_0x23c992[_0x3059fc(0x221)],'dbName':_0x23c992[_0x3059fc(0x219)]};const _0x3ca565=buildDbDirectoryName(_0x23c992[_0x3059fc(0x219)],_0x23c992[_0x3059fc(0x221)]);if(_0x69faa7===_0x3ca565)return{'dbId':_0x23c992[_0x3059fc(0x221)],'dbName':_0x23c992[_0x3059fc(0x219)]};const _0x559370=parseExplicitDbDirectory(_0x69faa7);if(_0x559370!=null)return{'dbId':_0x559370,'dbName':await getDbName(_0x6e24ac,_0x559370)['catch'](()=>undefined)};const _0x4eeee5=await listDatabases(_0x6e24ac),_0x41c046=_0x4eeee5[_0x3059fc(0x20f)](_0x568d56=>buildDbDirectoryName(_0x568d56[_0x3059fc(0x219)],_0x568d56[_0x3059fc(0x221)])===_0x69faa7);if(_0x41c046[_0x3059fc(0x21d)]===0x1)return{'dbId':_0x41c046[0x0]['dbId'],'dbName':_0x41c046[0x0][_0x3059fc(0x219)]};if(_0x41c046[_0x3059fc(0x21d)]===0x0)throw CliErrors[_0x3059fc(0x201)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x69faa7+_0x3059fc(0x1f3)+_0x5105b8[_0x3059fc(0x226)]+'.');const _0xbfb792=_0x41c046[_0x3059fc(0x21a)](_0x109012=>_0x109012[_0x3059fc(0x219)]+'\x20('+_0x109012[_0x3059fc(0x221)]+')')[_0x3059fc(0x1fb)](',\x20');throw CliErrors[_0x3059fc(0x201)](_0x3059fc(0x208)+_0x69faa7+_0x3059fc(0x204)+_0x5105b8[_0x3059fc(0x226)]+':\x20'+_0xbfb792);}function a254_0x2889(_0x5ee617,_0x3f5da8){_0x5ee617=_0x5ee617-0x1eb;const _0xc998d2=a254_0xc998();let _0x2889ad=_0xc998d2[_0x5ee617];return _0x2889ad;}function parseExplicitDbDirectory(_0xeca043){const _0x2880e1=a254_0x14a522,_0x248192=/^db-(\d+)$/[_0x2880e1(0x202)](_0xeca043);if(!_0x248192)return null;const _0x2023b4=Number(_0x248192[0x1]);return Number[_0x2880e1(0x1eb)](_0x2023b4)&&_0x2023b4>0x0?_0x2023b4:null;}
1
+ const a254_0x1aa36f=a254_0xfafa;(function(_0x9b0b27,_0x38a43c){const _0x4ecfa7=a254_0xfafa,_0x117df7=_0x9b0b27();while(!![]){try{const _0xfc1c1f=parseInt(_0x4ecfa7(0x144))/0x1*(parseInt(_0x4ecfa7(0x135))/0x2)+parseInt(_0x4ecfa7(0x110))/0x3*(parseInt(_0x4ecfa7(0x11e))/0x4)+-parseInt(_0x4ecfa7(0x120))/0x5+parseInt(_0x4ecfa7(0x14f))/0x6+parseInt(_0x4ecfa7(0x155))/0x7*(-parseInt(_0x4ecfa7(0x118))/0x8)+parseInt(_0x4ecfa7(0x12c))/0x9+-parseInt(_0x4ecfa7(0x132))/0xa*(parseInt(_0x4ecfa7(0x10a))/0xb);if(_0xfc1c1f===_0x38a43c)break;else _0x117df7['push'](_0x117df7['shift']());}catch(_0xcb54d7){_0x117df7['push'](_0x117df7['shift']());}}}(a254_0x43b5,0x81f7c));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(_0x438af9){const _0x1c06f8=a254_0xfafa,_0x574a6c=stripLocalSqlMetadata(await readFile(_0x438af9[_0x1c06f8(0x14d)],_0x1c06f8(0x147)),_0x438af9[_0x1c06f8(0x123)]);if(!_0x574a6c[_0x1c06f8(0x13b)]())throw CliErrors['validation'](_0x438af9[_0x1c06f8(0x13c)]+':\x20SQL\x20content\x20is\x20empty.');return _0x574a6c;}async function getTargetSqlQueries(_0xff9703,_0xb401aa,_0x52640c){const _0x1928fa=a254_0xfafa,_0x511455=await scanLocalSqlQueries(_0xff9703),_0xbd522c=new Map();for(const _0x555f93 of _0x511455){if(_0x52640c&&_0x555f93[_0x1928fa(0x13c)]!==_0x52640c)continue;const _0x371cfc=_0xbd522c[_0x1928fa(0x14c)](_0x555f93[_0x1928fa(0x13c)])??[];_0x371cfc[_0x1928fa(0x10e)](_0x555f93),_0xbd522c[_0x1928fa(0x116)](_0x555f93[_0x1928fa(0x13c)],_0x371cfc);}if(_0x52640c&&!_0xbd522c['has'](_0x52640c))throw CliErrors[_0x1928fa(0x121)](_0x1928fa(0x151)+_0x52640c);const _0x4bc4c7=[];for(const [_0x5c9581,_0x2ad156]of _0xbd522c[_0x1928fa(0x119)]()){if(_0x2ad156['length']===0x1){_0x4bc4c7[_0x1928fa(0x10e)](_0x2ad156[0x0]);continue;}const _0x42ece3=_0xb401aa[_0x1928fa(0x13f)][_0x5c9581],_0x1a7c32=_0x42ece3?.[_0x1928fa(0x115)],_0x5f07ae=_0x1a7c32?_0x2ad156[_0x1928fa(0x113)](_0x26793c=>_0x26793c[_0x1928fa(0x125)]!==_0x1a7c32):_0x2ad156;if(_0x42ece3&&_0x5f07ae[_0x1928fa(0x152)]===0x1){_0x4bc4c7['push'](_0x5f07ae[0x0]);continue;}throw CliErrors[_0x1928fa(0x121)](_0x1928fa(0x112)+_0x5c9581+_0x1928fa(0x11d));}return _0x4bc4c7;}function a254_0x43b5(){const _0x109a90=['13GqtSHr','sqlName','dbDirectory','utf8','appCode','/smartapi/custom/updateUserCustomSql','force','replace','get','filePath','toISOString','3237630fDWjnc','bool','Local\x20SQL\x20not\x20found:\x20','length','\x20skipped,\x20','write','2359oAyrno','hash','121451FoDmDE','sqlcode','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','push','unchanged','27hSkblX','map','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','filter','remoteId','path','set','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','2296BCJkRJ','entries','version','sqlRoot','boolean','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','411732obFQVX','catch','2036265CfPLsn','validation',':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','mode','sqlRootDir','relativePath','sqlConfig','dbName','\x22\x20for\x20sqlCode\x20','POST','startsWith','\x20pushed,\x20','6149142asyGtS','No\x20local\x20SQL\x20files\x20found.','exec','projectRoot','join','Would\x20push\x20','1470HrkQov','lastSync','Local\x20directory\x20\x22','78478UDUcvl','dbId','Push\x20complete:\x20','str','sql',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','trim','sqlCode','Push\x20local\x20SQL\x20files\x20to\x20remote','\x20SQL\x20file(s)','sqls','lockFilePath','No\x20database\x20matches\x20local\x20directory\x20\x22','message','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'];a254_0x43b5=function(){return _0x109a90;};return a254_0x43b5();}export const sqlPush={'service':a254_0x1aa36f(0x139),'command':a254_0x1aa36f(0x10e),'description':a254_0x1aa36f(0x13d),'risk':a254_0x1aa36f(0x154),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a254_0x1aa36f(0x14a),'type':a254_0x1aa36f(0x11c),'description':a254_0x1aa36f(0x10d)}],async 'dryRun'(_0x49afb5){const _0x5be9d6=a254_0x1aa36f,_0x56563e=loadSqlProjectConfig(_0x49afb5[_0x5be9d6(0x148)]),_0x47c8e2=await readSqlLockFile(_0x56563e[_0x5be9d6(0x140)]),{appLock:_0x4db4ee}=ensureSqlLockScope(_0x47c8e2??createEmptySqlLock(),_0x49afb5['appCode'],_0x56563e[_0x5be9d6(0x11b)],_0x5be9d6(0x10e)),_0x3a85c5=await getTargetSqlQueries(_0x56563e,_0x4db4ee,_0x49afb5[_0x5be9d6(0x138)](_0x5be9d6(0x10b))||undefined),_0x285801=[];for(const _0x163d6c of _0x3a85c5){const _0x35e71e=await computeSqlFileHash(_0x163d6c[_0x5be9d6(0x14d)]),_0x3bef3d=_0x4db4ee[_0x5be9d6(0x13f)][_0x163d6c[_0x5be9d6(0x13c)]],_0x5a7ad4=!!_0x3bef3d&&(_0x3bef3d[_0x5be9d6(0x115)]!==_0x163d6c[_0x5be9d6(0x125)]||!!_0x163d6c[_0x5be9d6(0x145)]&&_0x3bef3d[_0x5be9d6(0x145)]!==_0x163d6c[_0x5be9d6(0x145)]||_0x3bef3d[_0x5be9d6(0x123)]!==_0x163d6c[_0x5be9d6(0x123)]);if(!_0x49afb5[_0x5be9d6(0x150)]('force')&&_0x3bef3d&&_0x3bef3d['hash']===_0x35e71e&&!_0x5a7ad4)continue;if(!_0x3bef3d)throw CliErrors['validation'](_0x163d6c[_0x5be9d6(0x13c)]+_0x5be9d6(0x122));if(_0x3bef3d[_0x5be9d6(0x11a)]==null)throw CliErrors[_0x5be9d6(0x121)](_0x163d6c[_0x5be9d6(0x13c)]+_0x5be9d6(0x13a));await resolveTargetDbBinding(_0x49afb5[_0x5be9d6(0x148)],_0x163d6c,_0x3bef3d),await readSqlUploadContent(_0x163d6c),_0x285801[_0x5be9d6(0x10e)](_0x163d6c['sqlCode']);}return{'method':_0x5be9d6(0x129),'url':_0x5be9d6(0x149),'body':{'sqlCodes':_0x285801,'appCode':_0x49afb5[_0x5be9d6(0x148)]},'description':_0x5be9d6(0x131)+_0x285801['length']+_0x5be9d6(0x13e)};},async 'execute'(_0x49468d){const _0x372a36=a254_0x1aa36f,_0x33bf67=loadSqlProjectConfig(_0x49468d[_0x372a36(0x148)]),_0x4f3735=await readSqlLockFile(_0x33bf67[_0x372a36(0x140)]),{lockData:_0x3ac26a,appLock:_0x2ecfa6}=ensureSqlLockScope(_0x4f3735??createEmptySqlLock(),_0x49468d[_0x372a36(0x148)],_0x33bf67[_0x372a36(0x11b)],_0x372a36(0x10e)),_0x233157=await getTargetSqlQueries(_0x33bf67,_0x2ecfa6,_0x49468d[_0x372a36(0x138)](_0x372a36(0x10b))||undefined);if(_0x233157[_0x372a36(0x152)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x372a36(0x12d)};const _0x7f999a=[],_0x30d8cf=[],_0x535b9e=[];let _0x1e4f72=![];for(const _0x6f916d of _0x233157){const _0x7c7805=_0x2ecfa6['sqls'][_0x6f916d[_0x372a36(0x13c)]];if(!_0x7c7805){_0x535b9e[_0x372a36(0x10e)]({'sqlCode':_0x6f916d[_0x372a36(0x13c)],'error':_0x372a36(0x143)});continue;}try{const _0x6bc96=await computeSqlFileHash(_0x6f916d[_0x372a36(0x14d)]),_0x6f723e=_0x7c7805[_0x372a36(0x115)]!==_0x6f916d[_0x372a36(0x125)]||!!_0x6f916d['sqlName']&&_0x7c7805[_0x372a36(0x145)]!==_0x6f916d[_0x372a36(0x145)]||_0x7c7805[_0x372a36(0x123)]!==_0x6f916d[_0x372a36(0x123)];if(!_0x49468d[_0x372a36(0x150)](_0x372a36(0x14a))&&_0x7c7805[_0x372a36(0x156)]===_0x6bc96&&!_0x6f723e){_0x30d8cf[_0x372a36(0x10e)]({'sqlCode':_0x6f916d[_0x372a36(0x13c)],'reason':_0x372a36(0x10f)});continue;}if(_0x7c7805['version']==null){_0x535b9e[_0x372a36(0x10e)]({'sqlCode':_0x6f916d[_0x372a36(0x13c)],'error':_0x372a36(0x10c)});continue;}const _0x85afe9=_0x6f916d[_0x372a36(0x145)]||_0x7c7805[_0x372a36(0x145)],_0x5204dd=await resolveTargetDbBinding(_0x49468d[_0x372a36(0x148)],_0x6f916d,_0x7c7805),_0x18e460=await readSqlUploadContent(_0x6f916d),_0x3de87f=await updateSqlQuery({'id':_0x7c7805[_0x372a36(0x114)],'appCode':_0x49468d[_0x372a36(0x148)],'sqlCode':_0x6f916d[_0x372a36(0x13c)],'sqlName':_0x85afe9,'dbId':_0x5204dd[_0x372a36(0x136)],'version':_0x7c7805[_0x372a36(0x11a)],'sqlContent':_0x18e460,'sqlConfig':_0x7c7805[_0x372a36(0x126)]??undefined}),_0xe4c9a5=_0x3de87f[_0x372a36(0x136)]?await getDbName(_0x49468d[_0x372a36(0x148)],Number(_0x3de87f[_0x372a36(0x136)]))['catch'](()=>_0x5204dd['dbName']):_0x5204dd[_0x372a36(0x127)];_0x2ecfa6[_0x372a36(0x13f)][_0x6f916d[_0x372a36(0x13c)]]={...buildSqlLockEntry(_0x3de87f,_0x18e460,_0x6bc96,{'dbName':_0xe4c9a5}),'path':_0x6f916d[_0x372a36(0x125)],'mode':_0x6f916d[_0x372a36(0x123)]},_0x1e4f72=!![],await archivePreviousSqlFileIfNeeded(_0x33bf67,_0x7c7805[_0x372a36(0x115)],_0x6f916d[_0x372a36(0x125)]),_0x7f999a[_0x372a36(0x10e)]({'sqlCode':_0x6f916d[_0x372a36(0x13c)],'remoteId':_0x7c7805['remoteId']});}catch(_0x2863a2){_0x535b9e['push']({'sqlCode':_0x6f916d[_0x372a36(0x13c)],'error':_0x2863a2 instanceof Error?_0x2863a2[_0x372a36(0x142)]:String(_0x2863a2)});}}(_0x1e4f72||_0x535b9e[_0x372a36(0x152)]===0x0)&&(_0x2ecfa6[_0x372a36(0x133)]=new Date()['toISOString'](),await writeSqlLockFile(_0x33bf67[_0x372a36(0x140)],_0x3ac26a));const _0x387acd=_0x535b9e[_0x372a36(0x152)]===0x0;return{'ok':_0x387acd,'data':{'pushed':_0x7f999a,'skipped':_0x30d8cf,'failed':_0x535b9e},'message':_0x372a36(0x137)+_0x7f999a[_0x372a36(0x152)]+_0x372a36(0x12b)+_0x30d8cf['length']+_0x372a36(0x153)+_0x535b9e[_0x372a36(0x152)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x4362a8,_0x404891,_0x426cec){const _0x51a630=a254_0x1aa36f;if(!_0x404891||_0x404891===_0x426cec)return;const _0x1bdff0=join(_0x4362a8['sqlRootDir'],_0x404891);if(!await fileExists(_0x1bdff0))return;const _0x4409e5=await moveToTrash(_0x4362a8[_0x51a630(0x12f)],_0x4362a8['trashDir'],_0x1bdff0);await cleanupEmptyDirectories(dirname(_0x1bdff0),_0x4362a8[_0x51a630(0x124)]),void _0x4409e5;}async function moveToTrash(_0x397d42,_0x4b6a22,_0xaa1d7b){const _0x4f42ca=a254_0x1aa36f,_0x32a41f=new Date()[_0x4f42ca(0x14e)]()[_0x4f42ca(0x14b)](/[:.]/g,'-'),_0x2653b8=relative(_0x397d42,_0xaa1d7b),_0x37c48a=join(_0x4b6a22,_0x32a41f,_0x2653b8);return await mkdir(dirname(_0x37c48a),{'recursive':!![]}),await rename(_0xaa1d7b,_0x37c48a),_0x37c48a;}function a254_0xfafa(_0x12ff10,_0x1fcfff){_0x12ff10=_0x12ff10-0x10a;const _0x43b52b=a254_0x43b5();let _0xfafadb=_0x43b52b[_0x12ff10];return _0xfafadb;}async function cleanupEmptyDirectories(_0x1a8e15,_0xbd57a9){const _0x639610=a254_0x1aa36f;let _0xf5d5b6=resolve(_0x1a8e15);const _0x396146=resolve(_0xbd57a9);while(_0xf5d5b6[_0x639610(0x12a)](''+_0x396146+sep)||_0xf5d5b6===_0x396146){if(_0xf5d5b6===_0x396146)return;try{const _0x41d9c5=await readdir(_0xf5d5b6);if(_0x41d9c5[_0x639610(0x152)]>0x0)return;await rmdir(_0xf5d5b6);}catch{return;}_0xf5d5b6=dirname(_0xf5d5b6);}}async function resolveTargetDbBinding(_0x2ba0ca,_0x22660c,_0x2a16e0){const _0x41c763=a254_0x1aa36f,_0x4d1b71=_0x22660c[_0x41c763(0x146)];if(!_0x4d1b71)return{'dbId':_0x2a16e0['dbId'],'dbName':_0x2a16e0[_0x41c763(0x127)]};const _0x529391=buildDbDirectoryName(_0x2a16e0['dbName'],_0x2a16e0['dbId']);if(_0x4d1b71===_0x529391)return{'dbId':_0x2a16e0[_0x41c763(0x136)],'dbName':_0x2a16e0['dbName']};const _0x47b970=parseExplicitDbDirectory(_0x4d1b71);if(_0x47b970!=null)return{'dbId':_0x47b970,'dbName':await getDbName(_0x2ba0ca,_0x47b970)[_0x41c763(0x11f)](()=>undefined)};const _0x1905d7=await listDatabases(_0x2ba0ca),_0xd85b03=_0x1905d7[_0x41c763(0x113)](_0xe61bfe=>buildDbDirectoryName(_0xe61bfe[_0x41c763(0x127)],_0xe61bfe[_0x41c763(0x136)])===_0x4d1b71);if(_0xd85b03['length']===0x1)return{'dbId':_0xd85b03[0x0][_0x41c763(0x136)],'dbName':_0xd85b03[0x0][_0x41c763(0x127)]};if(_0xd85b03[_0x41c763(0x152)]===0x0)throw CliErrors[_0x41c763(0x121)](_0x41c763(0x141)+_0x4d1b71+_0x41c763(0x128)+_0x22660c[_0x41c763(0x13c)]+'.');const _0x45a335=_0xd85b03[_0x41c763(0x111)](_0x129cf6=>_0x129cf6[_0x41c763(0x127)]+'\x20('+_0x129cf6[_0x41c763(0x136)]+')')[_0x41c763(0x130)](',\x20');throw CliErrors[_0x41c763(0x121)](_0x41c763(0x134)+_0x4d1b71+_0x41c763(0x117)+_0x22660c['sqlCode']+':\x20'+_0x45a335);}function parseExplicitDbDirectory(_0x2a93a9){const _0x19e305=a254_0x1aa36f,_0xc3606e=/^db-(\d+)$/[_0x19e305(0x12e)](_0x2a93a9);if(!_0xc3606e)return null;const _0x172b20=Number(_0xc3606e[0x1]);return Number['isFinite'](_0x172b20)&&_0x172b20>0x0?_0x172b20:null;}
@@ -1 +1 @@
1
- const a255_0x321098=a255_0x36fe;(function(_0x17bc0d,_0x2c614c){const _0x3c0b3e=a255_0x36fe,_0x9fa218=_0x17bc0d();while(!![]){try{const _0x23bead=parseInt(_0x3c0b3e(0x1ff))/0x1+-parseInt(_0x3c0b3e(0x202))/0x2*(-parseInt(_0x3c0b3e(0x20b))/0x3)+parseInt(_0x3c0b3e(0x205))/0x4+-parseInt(_0x3c0b3e(0x21a))/0x5*(parseInt(_0x3c0b3e(0x201))/0x6)+parseInt(_0x3c0b3e(0x21c))/0x7+parseInt(_0x3c0b3e(0x204))/0x8+-parseInt(_0x3c0b3e(0x213))/0x9;if(_0x23bead===_0x2c614c)break;else _0x9fa218['push'](_0x9fa218['shift']());}catch(_0x207f73){_0x9fa218['push'](_0x9fa218['shift']());}}}(a255_0x4ae3,0xdac09));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a255_0x321098(0x208);export function buildSqlLockEntry(_0x372fe9,_0x247bd2,_0x15ad1f,_0x1a8212){const _0x1cfb43=a255_0x321098,_0x2bf12b=detectSqlMode(_0x247bd2);return{'path':buildSqlRelativePath(_0x372fe9[_0x1cfb43(0x20c)],_0x372fe9['sqlName'],_0x1a8212?.[_0x1cfb43(0x1fd)],_0x2bf12b,_0x372fe9['dbId']),'hash':_0x15ad1f,'remoteId':_0x372fe9['id'],'version':_0x372fe9['version'],'dbId':Number(_0x372fe9['dbId']),'dbName':_0x1a8212?.[_0x1cfb43(0x1fd)],'sqlName':_0x372fe9[_0x1cfb43(0x206)],'sqlConfig':_0x372fe9[_0x1cfb43(0x20e)]??undefined,'mode':_0x2bf12b};}export function cloneSqlLockData(_0x495408){const _0xc58206=a255_0x321098;return{'apps':Object[_0xc58206(0x217)](Object['entries'](_0x495408[_0xc58206(0x21b)])[_0xc58206(0x1fe)](([_0x1e8ddd,_0x5e405a])=>[_0x1e8ddd,{'sqlRoot':_0x5e405a[_0xc58206(0x200)],'lastSync':_0x5e405a[_0xc58206(0x214)],'sqls':{..._0x5e405a['sqls']}}]))};}export function ensureRemoteSqlContent(_0x375c04){const _0x4579d3=a255_0x321098;return _0x375c04[_0x4579d3(0x222)]??'';}function a255_0x36fe(_0x41acd8,_0x2e7e78){_0x41acd8=_0x41acd8-0x1f3;const _0x4ae304=a255_0x4ae3();let _0x36fe74=_0x4ae304[_0x41acd8];return _0x36fe74;}export function buildLocalSqlFileContent(_0x5a68db,_0x377ead,_0x1c0bf3){const _0x306b52=a255_0x321098,_0x49bb7f=_0x1c0bf3?.[_0x306b52(0x1f9)]??detectSqlMode(_0x377ead),_0x178ab6=stripLocalSqlMetadata(_0x377ead,_0x49bb7f)[_0x306b52(0x1f3)](),_0x470b99=buildMetadataHeaderLines({'sqlCode':_0x5a68db[_0x306b52(0x20c)],'sqlName':_0x5a68db['sqlName'],'dbId':_0x5a68db[_0x306b52(0x220)],'dbName':_0x1c0bf3?.['dbName'],'mode':_0x49bb7f,'syncedAt':_0x1c0bf3?.[_0x306b52(0x216)],'description':_0x1c0bf3?.['description']},_0x49bb7f),_0x3cd5f2=_0x49bb7f===_0x306b52(0x21d)?splitXmlDeclaration(_0x178ab6):{'body':_0x178ab6},_0xec1bf7=[..._0x3cd5f2[_0x306b52(0x215)]?[_0x3cd5f2[_0x306b52(0x215)]]:[],..._0x470b99,'',_0x3cd5f2[_0x306b52(0x212)][_0x306b52(0x21e)]()],_0x112dec=_0xec1bf7[_0x306b52(0x20f)]('\x0a');return _0x112dec[_0x306b52(0x221)]('\x0a')?_0x112dec:_0x112dec+'\x0a';}export function stripLocalSqlMetadata(_0x29ef6c,_0x2844da){const _0x1ddbe7=a255_0x321098;if(_0x2844da===_0x1ddbe7(0x21d)){const {declaration:_0x31b472,body:_0x670dbe}=splitXmlDeclaration(_0x29ef6c[_0x1ddbe7(0x1f4)](/\r\n/g,'\x0a')),_0x87d0d=stripLeadingMetadataLines(_0x670dbe,/^\s*<!--\s*@lovrabet\./);return _0x31b472?''+_0x31b472+(_0x87d0d?'\x0a'+_0x87d0d:''):_0x87d0d;}return stripLeadingMetadataLines(_0x29ef6c[_0x1ddbe7(0x1f4)](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0x1766ed,_0x3a9237){const _0x6697ed=a255_0x321098;if(_0x3a9237?.[_0x6697ed(0x1f9)])return _0x3a9237['mode'];return detectSqlMode(_0x1766ed);}export function resolveSqlFileName(_0x5c6183,_0x196e82,_0x1ca84f){const _0x2d1e95=a255_0x321098;if(_0x1ca84f?.[_0x2d1e95(0x203)])return _0x1ca84f[_0x2d1e95(0x203)];if(_0x1ca84f?.[_0x2d1e95(0x206)]||_0x1ca84f?.[_0x2d1e95(0x1fd)])return buildSqlRelativePath(_0x5c6183,_0x1ca84f?.[_0x2d1e95(0x206)],_0x1ca84f?.['dbName'],resolveSqlMode(_0x196e82,_0x1ca84f),_0x1ca84f?.['dbId']);return buildDefaultSqlFileName(_0x5c6183,resolveSqlMode(_0x196e82,_0x1ca84f));}function a255_0x4ae3(){const _0xf90506=['dbName','map','694100LIBQME','sqlRoot','6jDfQlZ','1942JimaJk','path','5960032zgwTnE','5346456wXaznw','sqlName','slice','.rabetbase/sql','includes','exec','4146cQDWzO','sqlCode','split','sqlConfig','join','close','toLowerCase','body','32081814IjCPzE','lastSync','declaration','syncedAt','fromEntries','filter','\x20-->','4596395wZPNfg','apps','8836058tGrVWr','mybatisXml','trimStart','\x20[y/N]\x20','dbId','endsWith','sqlContent','<!--\x20@lovrabet.','trim','replace','length','yes','stderr','--\x20@lovrabet.','mode','description','question','test'];a255_0x4ae3=function(){return _0xf90506;};return a255_0x4ae3();}export function resolveSqlLocalDir(_0x2cbb0b,_0x3affe1){return join(_0x2cbb0b,SQL_LOCAL_REL_DIR,_0x3affe1);}export async function confirmForceOverwrite(_0x1f2f12){const _0x59b507=a255_0x321098,_0x193b4d=createInterface({'input':process['stdin'],'output':process[_0x59b507(0x1f7)]}),_0x5b9ee1=await new Promise(_0x31e583=>{const _0x5a3690=_0x59b507;_0x193b4d[_0x5a3690(0x1fb)](_0x1f2f12+_0x5a3690(0x21f),_0x31e583);});return _0x193b4d[_0x59b507(0x210)](),['y',_0x59b507(0x1f6)][_0x59b507(0x209)](_0x5b9ee1[_0x59b507(0x1f3)]()[_0x59b507(0x211)]());}export function findSqlLockScope(_0x2a9c84,_0x375606){return _0x2a9c84['apps'][_0x375606];}function buildMetadataHeaderLines(_0x5e8756,_0x24b2f2){const _0x2e185d=a255_0x321098,_0x3fd0a0=[[_0x2e185d(0x20c),_0x5e8756[_0x2e185d(0x20c)]],[_0x2e185d(0x206),_0x5e8756[_0x2e185d(0x206)]],[_0x2e185d(0x220),_0x5e8756['dbId']],['dbName',_0x5e8756['dbName']],[_0x2e185d(0x1f9),_0x5e8756['mode']],['syncedAt',_0x5e8756['syncedAt']],[_0x2e185d(0x1fa),_0x5e8756['description']]];if(_0x24b2f2===_0x2e185d(0x21d))return _0x3fd0a0[_0x2e185d(0x218)](([,_0x5a14d9])=>_0x5a14d9!==undefined&&_0x5a14d9!==null&&String(_0x5a14d9)[_0x2e185d(0x1f3)]()!=='')[_0x2e185d(0x1fe)](([_0x42ab64,_0x3e7fe4])=>_0x2e185d(0x223)+_0x42ab64+':\x20'+String(_0x3e7fe4)+_0x2e185d(0x219));return _0x3fd0a0[_0x2e185d(0x218)](([,_0x5961a9])=>_0x5961a9!==undefined&&_0x5961a9!==null&&String(_0x5961a9)['trim']()!=='')[_0x2e185d(0x1fe)](([_0x1745fd,_0xef0d36])=>_0x2e185d(0x1f8)+_0x1745fd+':\x20'+String(_0xef0d36));}function splitXmlDeclaration(_0x49abca){const _0x20cd3b=a255_0x321098,_0x2f49bc=_0x49abca[_0x20cd3b(0x21e)](),_0x3c6c15=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i[_0x20cd3b(0x20a)](_0x2f49bc);if(!_0x3c6c15)return{'body':_0x49abca};return{'declaration':_0x3c6c15[0x0],'body':_0x2f49bc[_0x20cd3b(0x207)](_0x3c6c15[0x0]['length'])};}function stripLeadingMetadataLines(_0x25c9d1,_0x321883){const _0x5a0239=a255_0x321098,_0x39d21c=_0x25c9d1[_0x5a0239(0x20d)]('\x0a');let _0x13c654=0x0;while(_0x13c654<_0x39d21c[_0x5a0239(0x1f5)]){const _0x13d11b=_0x39d21c[_0x13c654]??'';if(_0x321883[_0x5a0239(0x1fc)](_0x13d11b)||_0x13d11b[_0x5a0239(0x1f3)]()===''){_0x13c654++;continue;}break;}return _0x39d21c[_0x5a0239(0x207)](_0x13c654)['join']('\x0a')[_0x5a0239(0x21e)]();}
1
+ const a255_0x42536d=a255_0x1eab;(function(_0x372fd9,_0x3ca851){const _0x23be4c=a255_0x1eab,_0x351eed=_0x372fd9();while(!![]){try{const _0x3df850=parseInt(_0x23be4c(0x1e4))/0x1+parseInt(_0x23be4c(0x205))/0x2+-parseInt(_0x23be4c(0x1e3))/0x3+parseInt(_0x23be4c(0x207))/0x4+parseInt(_0x23be4c(0x1fa))/0x5*(parseInt(_0x23be4c(0x1f5))/0x6)+-parseInt(_0x23be4c(0x1f1))/0x7*(-parseInt(_0x23be4c(0x1ea))/0x8)+-parseInt(_0x23be4c(0x201))/0x9*(parseInt(_0x23be4c(0x1f2))/0xa);if(_0x3df850===_0x3ca851)break;else _0x351eed['push'](_0x351eed['shift']());}catch(_0x381459){_0x351eed['push'](_0x351eed['shift']());}}}(a255_0x99bf,0x93f89));function a255_0x99bf(){const _0x13199a=['sqlRoot','sqls','trimStart','1565556oXnxsB','1153902NmEdam','description','map','\x20-->','filter','path','136jkAjKM','question','declaration','\x20[y/N]\x20','stdin','split','dbId','346003iNscvW','60ZRJhEM','.rabetbase/sql','endsWith','1152hRpNiY','toLowerCase','entries','mode','trim','800lBLDUm','test','length','version','syncedAt','--\x20@lovrabet.','exec','3900177TxigyK','join','mybatisXml','lastSync','1484336WJlZMh','dbName','3843904GNoOEM','sqlConfig','sqlCode','apps','sqlName','slice'];a255_0x99bf=function(){return _0x13199a;};return a255_0x99bf();}import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a255_0x42536d(0x1f3);export function buildSqlLockEntry(_0x37ef2f,_0x4ebb15,_0x4db145,_0x521f8a){const _0x213e0e=a255_0x42536d,_0x559f21=detectSqlMode(_0x4ebb15);return{'path':buildSqlRelativePath(_0x37ef2f[_0x213e0e(0x209)],_0x37ef2f[_0x213e0e(0x1de)],_0x521f8a?.[_0x213e0e(0x206)],_0x559f21,_0x37ef2f[_0x213e0e(0x1f0)]),'hash':_0x4db145,'remoteId':_0x37ef2f['id'],'version':_0x37ef2f[_0x213e0e(0x1fd)],'dbId':Number(_0x37ef2f['dbId']),'dbName':_0x521f8a?.['dbName'],'sqlName':_0x37ef2f[_0x213e0e(0x1de)],'sqlConfig':_0x37ef2f[_0x213e0e(0x208)]??undefined,'mode':_0x559f21};}export function cloneSqlLockData(_0x5b485c){const _0x151f83=a255_0x42536d;return{'apps':Object['fromEntries'](Object[_0x151f83(0x1f7)](_0x5b485c[_0x151f83(0x20a)])[_0x151f83(0x1e6)](([_0x2d24df,_0x25860d])=>[_0x2d24df,{'sqlRoot':_0x25860d[_0x151f83(0x1e0)],'lastSync':_0x25860d[_0x151f83(0x204)],'sqls':{..._0x25860d[_0x151f83(0x1e1)]}}]))};}export function ensureRemoteSqlContent(_0x3ba24c){return _0x3ba24c['sqlContent']??'';}export function buildLocalSqlFileContent(_0x4ffa44,_0x2f8ed3,_0x12ad2d){const _0x323655=a255_0x42536d,_0x2dcf94=_0x12ad2d?.[_0x323655(0x1f8)]??detectSqlMode(_0x2f8ed3),_0x4624ab=stripLocalSqlMetadata(_0x2f8ed3,_0x2dcf94)[_0x323655(0x1f9)](),_0xeb09ff=buildMetadataHeaderLines({'sqlCode':_0x4ffa44[_0x323655(0x209)],'sqlName':_0x4ffa44[_0x323655(0x1de)],'dbId':_0x4ffa44['dbId'],'dbName':_0x12ad2d?.[_0x323655(0x206)],'mode':_0x2dcf94,'syncedAt':_0x12ad2d?.['syncedAt'],'description':_0x12ad2d?.[_0x323655(0x1e5)]},_0x2dcf94),_0x283faf=_0x2dcf94===_0x323655(0x203)?splitXmlDeclaration(_0x4624ab):{'body':_0x4624ab},_0x363890=[..._0x283faf[_0x323655(0x1ec)]?[_0x283faf['declaration']]:[],..._0xeb09ff,'',_0x283faf['body'][_0x323655(0x1e2)]()],_0x543c90=_0x363890[_0x323655(0x202)]('\x0a');return _0x543c90[_0x323655(0x1f4)]('\x0a')?_0x543c90:_0x543c90+'\x0a';}export function stripLocalSqlMetadata(_0xb436a5,_0x2c4428){const _0x1fc6d1=a255_0x42536d;if(_0x2c4428===_0x1fc6d1(0x203)){const {declaration:_0x549f7a,body:_0x41a38b}=splitXmlDeclaration(_0xb436a5['replace'](/\r\n/g,'\x0a')),_0x138b1d=stripLeadingMetadataLines(_0x41a38b,/^\s*<!--\s*@lovrabet\./);return _0x549f7a?''+_0x549f7a+(_0x138b1d?'\x0a'+_0x138b1d:''):_0x138b1d;}return stripLeadingMetadataLines(_0xb436a5['replace'](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0x2f4041,_0x17b11c){const _0x39bc2b=a255_0x42536d;if(_0x17b11c?.[_0x39bc2b(0x1f8)])return _0x17b11c[_0x39bc2b(0x1f8)];return detectSqlMode(_0x2f4041);}export function resolveSqlFileName(_0x519167,_0x45544e,_0x56b36f){const _0x191923=a255_0x42536d;if(_0x56b36f?.['path'])return _0x56b36f[_0x191923(0x1e9)];if(_0x56b36f?.[_0x191923(0x1de)]||_0x56b36f?.[_0x191923(0x206)])return buildSqlRelativePath(_0x519167,_0x56b36f?.[_0x191923(0x1de)],_0x56b36f?.['dbName'],resolveSqlMode(_0x45544e,_0x56b36f),_0x56b36f?.[_0x191923(0x1f0)]);return buildDefaultSqlFileName(_0x519167,resolveSqlMode(_0x45544e,_0x56b36f));}function a255_0x1eab(_0x3b6f5e,_0x411a6f){_0x3b6f5e=_0x3b6f5e-0x1de;const _0x99bfb8=a255_0x99bf();let _0x1eab84=_0x99bfb8[_0x3b6f5e];return _0x1eab84;}export function resolveSqlLocalDir(_0x55f94f,_0x289099){return join(_0x55f94f,SQL_LOCAL_REL_DIR,_0x289099);}export async function confirmForceOverwrite(_0x325aee){const _0x31b9b7=a255_0x42536d,_0x16436a=createInterface({'input':process[_0x31b9b7(0x1ee)],'output':process['stderr']}),_0x56738e=await new Promise(_0xec045a=>{const _0x119f09=_0x31b9b7;_0x16436a[_0x119f09(0x1eb)](_0x325aee+_0x119f09(0x1ed),_0xec045a);});return _0x16436a['close'](),['y','yes']['includes'](_0x56738e[_0x31b9b7(0x1f9)]()[_0x31b9b7(0x1f6)]());}export function findSqlLockScope(_0x4beaef,_0x1cbd36){const _0x5eaa5f=a255_0x42536d;return _0x4beaef[_0x5eaa5f(0x20a)][_0x1cbd36];}function buildMetadataHeaderLines(_0x1b1df8,_0x377e72){const _0x5643d7=a255_0x42536d,_0x2adf88=[[_0x5643d7(0x209),_0x1b1df8[_0x5643d7(0x209)]],[_0x5643d7(0x1de),_0x1b1df8['sqlName']],[_0x5643d7(0x1f0),_0x1b1df8[_0x5643d7(0x1f0)]],['dbName',_0x1b1df8[_0x5643d7(0x206)]],[_0x5643d7(0x1f8),_0x1b1df8[_0x5643d7(0x1f8)]],[_0x5643d7(0x1fe),_0x1b1df8[_0x5643d7(0x1fe)]],[_0x5643d7(0x1e5),_0x1b1df8[_0x5643d7(0x1e5)]]];if(_0x377e72===_0x5643d7(0x203))return _0x2adf88[_0x5643d7(0x1e8)](([,_0x39d67b])=>_0x39d67b!==undefined&&_0x39d67b!==null&&String(_0x39d67b)['trim']()!=='')['map'](([_0x149748,_0x50a873])=>'<!--\x20@lovrabet.'+_0x149748+':\x20'+String(_0x50a873)+_0x5643d7(0x1e7));return _0x2adf88['filter'](([,_0x44ffa8])=>_0x44ffa8!==undefined&&_0x44ffa8!==null&&String(_0x44ffa8)[_0x5643d7(0x1f9)]()!=='')[_0x5643d7(0x1e6)](([_0x529af3,_0x102127])=>_0x5643d7(0x1ff)+_0x529af3+':\x20'+String(_0x102127));}function splitXmlDeclaration(_0x4f48a2){const _0x234630=a255_0x42536d,_0x13fdcc=_0x4f48a2[_0x234630(0x1e2)](),_0x1d415c=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i[_0x234630(0x200)](_0x13fdcc);if(!_0x1d415c)return{'body':_0x4f48a2};return{'declaration':_0x1d415c[0x0],'body':_0x13fdcc['slice'](_0x1d415c[0x0][_0x234630(0x1fc)])};}function stripLeadingMetadataLines(_0x3e78cd,_0x2a735a){const _0x578fd=a255_0x42536d,_0x37011a=_0x3e78cd[_0x578fd(0x1ef)]('\x0a');let _0x228521=0x0;while(_0x228521<_0x37011a['length']){const _0x1108f7=_0x37011a[_0x228521]??'';if(_0x2a735a[_0x578fd(0x1fb)](_0x1108f7)||_0x1108f7['trim']()===''){_0x228521++;continue;}break;}return _0x37011a[_0x578fd(0x1df)](_0x228521)[_0x578fd(0x202)]('\x0a')[_0x578fd(0x1e2)]();}
@@ -1 +1 @@
1
- function a256_0x59f2(_0x1bac75,_0x3e5ae3){_0x1bac75=_0x1bac75-0xd4;const _0x585049=a256_0x5850();let _0x59f271=_0x585049[_0x1bac75];return _0x59f271;}const a256_0x388c4c=a256_0x59f2;(function(_0x975bc0,_0x1e8e8a){const _0x142f13=a256_0x59f2,_0x4396b4=_0x975bc0();while(!![]){try{const _0x5ab9ef=-parseInt(_0x142f13(0xe9))/0x1+-parseInt(_0x142f13(0xd6))/0x2*(-parseInt(_0x142f13(0xed))/0x3)+-parseInt(_0x142f13(0xe6))/0x4+-parseInt(_0x142f13(0xf7))/0x5*(parseInt(_0x142f13(0xe5))/0x6)+-parseInt(_0x142f13(0xda))/0x7*(-parseInt(_0x142f13(0xd9))/0x8)+parseInt(_0x142f13(0xec))/0x9+-parseInt(_0x142f13(0xd7))/0xa*(parseInt(_0x142f13(0xeb))/0xb);if(_0x5ab9ef===_0x1e8e8a)break;else _0x4396b4['push'](_0x4396b4['shift']());}catch(_0x17c0ab){_0x4396b4['push'](_0x4396b4['shift']());}}}(a256_0x5850,0x27901));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x43e320){const _0x33d0e3=a256_0x59f2,_0x269214=[];let _0x175af2=0x1;while(!![]){const _0x4b2d4c=await listSqlQueries(_0x43e320,{'currentPage':_0x175af2,'pageSize':PAGE_SIZE}),_0x54d2a0=_0x4b2d4c[_0x33d0e3(0xf8)]??[];_0x269214[_0x33d0e3(0xf4)](..._0x54d2a0[_0x33d0e3(0xe8)](_0x219ff7=>_0x219ff7[_0x33d0e3(0xf9)]));if(_0x54d2a0[_0x33d0e3(0xe4)]===0x0)break;const _0x1fa411=_0x4b2d4c[_0x33d0e3(0xe1)]?.[_0x33d0e3(0xdc)];if(_0x1fa411!=null?_0x269214[_0x33d0e3(0xe4)]>=_0x1fa411:_0x54d2a0['length']<PAGE_SIZE)break;_0x175af2++;}return _0x269214;}export const sqlStatus={'service':a256_0x388c4c(0xe0),'command':a256_0x388c4c(0xe3),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a256_0x388c4c(0xf6),'flags':[{'name':a256_0x388c4c(0xf1),'type':a256_0x388c4c(0xf2),'description':a256_0x388c4c(0xf0)}],async 'execute'(_0x38f862){const _0x436d11=a256_0x388c4c,_0x47d644=loadSqlProjectConfig(_0x38f862['appCode']),_0x695bac=await readSqlLockFile(_0x47d644['lockFilePath']),{appLock:_0x4e5497}=ensureSqlLockScope(_0x695bac??createEmptySqlLock(),_0x47d644['appCode'],_0x47d644[_0x436d11(0xd4)],'status'),_0x469015=await scanLocalSqlQueries(_0x47d644),_0x50a59d=[],_0x6c42cf=[],_0x43bb9b=[],_0x33c54c=[],_0x5dc66b=new Set(_0x469015[_0x436d11(0xe8)](_0x2690e1=>_0x2690e1['lockKey']));for(const _0x196e37 of _0x469015){const _0x3b4e55=await computeSqlFileHash(_0x196e37['filePath']),_0x5c0016=_0x4e5497['sqls'][_0x196e37[_0x436d11(0xee)]],_0x11b1ed=!!_0x5c0016&&_0x5c0016[_0x436d11(0xd5)]!==_0x196e37[_0x436d11(0xdd)],_0x116660=!!_0x5c0016&&!!_0x196e37[_0x436d11(0xea)]&&_0x5c0016[_0x436d11(0xea)]!==_0x196e37[_0x436d11(0xea)];if(!_0x5c0016)_0x50a59d[_0x436d11(0xf4)](_0x196e37[_0x436d11(0xee)]);else _0x5c0016['hash']!==_0x3b4e55||_0x11b1ed||_0x116660?_0x6c42cf['push'](_0x196e37[_0x436d11(0xee)]):_0x43bb9b[_0x436d11(0xf4)](_0x196e37['lockKey']);}for(const _0x3dc7b2 of Object[_0x436d11(0xe7)](_0x4e5497[_0x436d11(0xe2)])){!_0x5dc66b[_0x436d11(0xef)](_0x3dc7b2)&&_0x33c54c[_0x436d11(0xf4)](_0x3dc7b2);}const _0x3ba8ce=[];if(_0x38f862[_0x436d11(0xd8)](_0x436d11(0xf1))){const _0x4466f9=await fetchAllSqlCodes(_0x38f862[_0x436d11(0xde)]);for(const _0x256c0b of _0x4466f9){!_0x5dc66b[_0x436d11(0xef)](_0x256c0b)&&!_0x4e5497[_0x436d11(0xe2)][_0x256c0b]&&_0x3ba8ce[_0x436d11(0xf4)](_0x256c0b);}}const _0x2a8bff=_0x50a59d['length']===0x0&&_0x6c42cf['length']===0x0&&_0x33c54c[_0x436d11(0xe4)]===0x0&&_0x3ba8ce[_0x436d11(0xe4)]===0x0;return{'ok':!![],'data':{'added':_0x50a59d,'modified':_0x6c42cf,'missing':_0x33c54c,'unchanged':_0x43bb9b,'remoteOnly':_0x3ba8ce},'message':_0x2a8bff?_0x436d11(0xf3):_0x50a59d[_0x436d11(0xe4)]+'\x20added,\x20'+_0x6c42cf[_0x436d11(0xe4)]+_0x436d11(0xdb)+_0x33c54c[_0x436d11(0xe4)]+_0x436d11(0xfa)+_0x43bb9b[_0x436d11(0xe4)]+_0x436d11(0xf5)+(_0x3ba8ce['length']>0x0?',\x20'+_0x3ba8ce[_0x436d11(0xe4)]+_0x436d11(0xdf):'')};}};function a256_0x5850(){const _0x4dc13e=['lockKey','has','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','remote','boolean','All\x20SQL\x20queries\x20are\x20in\x20sync.','push','\x20unchanged','read','25GmBMWj','tableData','sqlCode','\x20missing,\x20','sqlRoot','path','38810ibAAMc','20UBSnDy','bool','1942984XtznSU','7ZddkyJ','\x20modified,\x20','totalCount','relativePath','appCode','\x20remote-only','sql','paging','sqls','status','length','72114XfrFVv','539888bIsLXQ','keys','map','204233UEBGAA','sqlName','245421BzNmBs','2394657hESaZk','15hlnmsl'];a256_0x5850=function(){return _0x4dc13e;};return a256_0x5850();}
1
+ function a256_0x546a(_0x24686d,_0xd6b47c){_0x24686d=_0x24686d-0x1a7;const _0xb040b4=a256_0xb040();let _0x546a59=_0xb040b4[_0x24686d];return _0x546a59;}const a256_0x322cd6=a256_0x546a;(function(_0x59f047,_0x8584b9){const _0x3ca4a3=a256_0x546a,_0x4b945e=_0x59f047();while(!![]){try{const _0x30c0c4=parseInt(_0x3ca4a3(0x1b4))/0x1*(parseInt(_0x3ca4a3(0x1c9))/0x2)+-parseInt(_0x3ca4a3(0x1b9))/0x3+parseInt(_0x3ca4a3(0x1bb))/0x4+-parseInt(_0x3ca4a3(0x1c7))/0x5+parseInt(_0x3ca4a3(0x1c6))/0x6*(-parseInt(_0x3ca4a3(0x1b8))/0x7)+parseInt(_0x3ca4a3(0x1bd))/0x8+parseInt(_0x3ca4a3(0x1ab))/0x9;if(_0x30c0c4===_0x8584b9)break;else _0x4b945e['push'](_0x4b945e['shift']());}catch(_0x309b14){_0x4b945e['push'](_0x4b945e['shift']());}}}(a256_0xb040,0xb90c8));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';function a256_0xb040(){const _0x13c3e7=['remote','push','filePath','read','752694sWDjAt','6707855IuQnWU','sqlName','2638cPDIcA','status','relativePath','sqls','lockFilePath','tableData','20720691WoiiiQ','hash','sqlCode','\x20missing,\x20','totalCount','has','boolean','path','sql','586Sjlbza','lockKey','\x20remote-only','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','70OmcfAl','3369552XZqAVL','map','2252736tgmLZZ','paging','6710304icqpcC','appCode','\x20modified,\x20','\x20added,\x20','length'];a256_0xb040=function(){return _0x13c3e7;};return a256_0xb040();}const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x48a5ff){const _0x22471f=a256_0x546a,_0x2adace=[];let _0x2fdaaf=0x1;while(!![]){const _0x558d34=await listSqlQueries(_0x48a5ff,{'currentPage':_0x2fdaaf,'pageSize':PAGE_SIZE}),_0x5ae58f=_0x558d34[_0x22471f(0x1aa)]??[];_0x2adace[_0x22471f(0x1c3)](..._0x5ae58f[_0x22471f(0x1ba)](_0x5b598e=>_0x5b598e[_0x22471f(0x1ad)]));if(_0x5ae58f[_0x22471f(0x1c1)]===0x0)break;const _0x34ace2=_0x558d34[_0x22471f(0x1bc)]?.[_0x22471f(0x1af)];if(_0x34ace2!=null?_0x2adace['length']>=_0x34ace2:_0x5ae58f[_0x22471f(0x1c1)]<PAGE_SIZE)break;_0x2fdaaf++;}return _0x2adace;}export const sqlStatus={'service':a256_0x322cd6(0x1b3),'command':'status','description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a256_0x322cd6(0x1c5),'flags':[{'name':a256_0x322cd6(0x1c2),'type':a256_0x322cd6(0x1b1),'description':a256_0x322cd6(0x1b7)}],async 'execute'(_0x254a88){const _0x1fbe7b=a256_0x322cd6,_0x2986cf=loadSqlProjectConfig(_0x254a88[_0x1fbe7b(0x1be)]),_0x390678=await readSqlLockFile(_0x2986cf[_0x1fbe7b(0x1a9)]),{appLock:_0x22c56b}=ensureSqlLockScope(_0x390678??createEmptySqlLock(),_0x2986cf[_0x1fbe7b(0x1be)],_0x2986cf['sqlRoot'],_0x1fbe7b(0x1ca)),_0x192fac=await scanLocalSqlQueries(_0x2986cf),_0x206001=[],_0x2c018f=[],_0x12c3e0=[],_0xe07aaa=[],_0x3d1c36=new Set(_0x192fac[_0x1fbe7b(0x1ba)](_0x4cd922=>_0x4cd922[_0x1fbe7b(0x1b5)]));for(const _0xb5c498 of _0x192fac){const _0x5ce341=await computeSqlFileHash(_0xb5c498[_0x1fbe7b(0x1c4)]),_0x17112e=_0x22c56b[_0x1fbe7b(0x1a8)][_0xb5c498[_0x1fbe7b(0x1b5)]],_0x50c489=!!_0x17112e&&_0x17112e[_0x1fbe7b(0x1b2)]!==_0xb5c498[_0x1fbe7b(0x1a7)],_0x2d7448=!!_0x17112e&&!!_0xb5c498[_0x1fbe7b(0x1c8)]&&_0x17112e[_0x1fbe7b(0x1c8)]!==_0xb5c498[_0x1fbe7b(0x1c8)];if(!_0x17112e)_0x206001['push'](_0xb5c498[_0x1fbe7b(0x1b5)]);else _0x17112e[_0x1fbe7b(0x1ac)]!==_0x5ce341||_0x50c489||_0x2d7448?_0x2c018f[_0x1fbe7b(0x1c3)](_0xb5c498[_0x1fbe7b(0x1b5)]):_0x12c3e0[_0x1fbe7b(0x1c3)](_0xb5c498[_0x1fbe7b(0x1b5)]);}for(const _0x4d8f26 of Object['keys'](_0x22c56b['sqls'])){!_0x3d1c36['has'](_0x4d8f26)&&_0xe07aaa[_0x1fbe7b(0x1c3)](_0x4d8f26);}const _0x57834f=[];if(_0x254a88['bool'](_0x1fbe7b(0x1c2))){const _0x33b816=await fetchAllSqlCodes(_0x254a88['appCode']);for(const _0x33a67c of _0x33b816){!_0x3d1c36[_0x1fbe7b(0x1b0)](_0x33a67c)&&!_0x22c56b[_0x1fbe7b(0x1a8)][_0x33a67c]&&_0x57834f[_0x1fbe7b(0x1c3)](_0x33a67c);}}const _0x127e28=_0x206001['length']===0x0&&_0x2c018f['length']===0x0&&_0xe07aaa[_0x1fbe7b(0x1c1)]===0x0&&_0x57834f['length']===0x0;return{'ok':!![],'data':{'added':_0x206001,'modified':_0x2c018f,'missing':_0xe07aaa,'unchanged':_0x12c3e0,'remoteOnly':_0x57834f},'message':_0x127e28?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x206001['length']+_0x1fbe7b(0x1c0)+_0x2c018f[_0x1fbe7b(0x1c1)]+_0x1fbe7b(0x1bf)+_0xe07aaa[_0x1fbe7b(0x1c1)]+_0x1fbe7b(0x1ae)+_0x12c3e0['length']+'\x20unchanged'+(_0x57834f[_0x1fbe7b(0x1c1)]>0x0?',\x20'+_0x57834f[_0x1fbe7b(0x1c1)]+_0x1fbe7b(0x1b6):'')};}};
@@ -1 +1 @@
1
- const a257_0xeea09c=a257_0x3d69;(function(_0x2879bb,_0x3b4ebf){const _0x5ca8c4=a257_0x3d69,_0xb2e3f3=_0x2879bb();while(!![]){try{const _0x34b7e2=-parseInt(_0x5ca8c4(0x10e))/0x1+parseInt(_0x5ca8c4(0x10a))/0x2+parseInt(_0x5ca8c4(0x102))/0x3*(parseInt(_0x5ca8c4(0x101))/0x4)+parseInt(_0x5ca8c4(0x111))/0x5+-parseInt(_0x5ca8c4(0x138))/0x6+-parseInt(_0x5ca8c4(0x12e))/0x7*(-parseInt(_0x5ca8c4(0x112))/0x8)+-parseInt(_0x5ca8c4(0x105))/0x9;if(_0x34b7e2===_0x3b4ebf)break;else _0xb2e3f3['push'](_0xb2e3f3['shift']());}catch(_0x16331b){_0xb2e3f3['push'](_0xb2e3f3['shift']());}}}(a257_0x1563,0x4dcb9));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':a257_0xeea09c(0x124),'command':a257_0xeea09c(0x121),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a257_0xeea09c(0x10c),'flags':[{'name':'file','type':a257_0xeea09c(0x106),'description':a257_0xeea09c(0x11f)},{'name':a257_0xeea09c(0x124),'type':a257_0xeea09c(0x106),'description':a257_0xeea09c(0x108)},{'name':a257_0xeea09c(0xfa),'type':'string','description':a257_0xeea09c(0xfb)},{'name':a257_0xeea09c(0x10f),'type':a257_0xeea09c(0x107),'description':'Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata'}],async 'execute'(_0x289659){const _0x27a4da=a257_0xeea09c,_0x572e2a=_0x289659['str'](_0x27a4da(0x11e)),_0x281d5e=_0x289659[_0x27a4da(0x128)](_0x27a4da(0x124)),_0x1f42a9=_0x289659[_0x27a4da(0x128)](_0x27a4da(0xfa)),_0x159b41=_0x289659[_0x27a4da(0x104)]('check-indexes');if(!_0x572e2a&&!_0x281d5e)throw CliErrors[_0x27a4da(0x127)](_0x27a4da(0x11e),_0x27a4da(0x11d));if(_0x159b41&&!_0x1f42a9)throw CliErrors[_0x27a4da(0xf6)](_0x27a4da(0x113));let _0x447104;if(_0x572e2a){const _0x4e1b98=resolve(process[_0x27a4da(0x115)](),_0x572e2a);if(!existsSync(_0x4e1b98))throw CliErrors[_0x27a4da(0xf6)](_0x27a4da(0xf7)+_0x4e1b98);_0x447104=readFileSync(_0x4e1b98,_0x27a4da(0x12f));}else _0x447104=_0x281d5e;const _0x279aee=validateSql(_0x447104),_0x53901e={'valid':_0x279aee['valid'],'sqlType':_0x279aee[_0x27a4da(0x114)][_0x27a4da(0x12b)],'isSelectOnly':_0x279aee['sqlType'][_0x27a4da(0x122)],'isLockingRead':_0x279aee['sqlType']['isLockingRead']??![],'isDangerous':_0x279aee[_0x27a4da(0x114)][_0x27a4da(0xfd)],'tables':_0x279aee[_0x27a4da(0x136)],'parameters':_0x279aee[_0x27a4da(0xff)],'message':_0x279aee[_0x27a4da(0x132)]};_0x279aee[_0x27a4da(0x114)][_0x27a4da(0x11c)]&&(_0x53901e[_0x27a4da(0x11c)]=_0x279aee[_0x27a4da(0x114)][_0x27a4da(0x11c)]);if(_0x1f42a9&&_0x279aee[_0x27a4da(0x12d)]){const _0x184036=_0x1f42a9[_0x27a4da(0x119)](',')[_0x27a4da(0x117)](_0x5d1ed3=>_0x5d1ed3[_0x27a4da(0x120)]())['filter'](Boolean),_0x214dc1=[],_0x20c3a1=[],_0x350b74=filterDbTableBackedDatasets(await listDatasets(_0x289659[_0x27a4da(0x109)])),_0x11002a=new Map(_0x350b74[_0x27a4da(0x117)](_0x1b3896=>[_0x1b3896[_0x27a4da(0x130)]?.[_0x27a4da(0x118)]?.[_0x27a4da(0xf9)](),_0x1b3896]));for(const _0x4c85f2 of _0x279aee[_0x27a4da(0x136)]){const _0x1a8eeb=_0x11002a[_0x27a4da(0x103)](_0x4c85f2[_0x27a4da(0xf9)]());!_0x1a8eeb&&_0x214dc1[_0x27a4da(0x116)](_0x27a4da(0x12c)+_0x4c85f2+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x3d1532 of _0x184036){let _0x76baf;try{_0x76baf=await getDatasetDetail(_0x3d1532);}catch{_0x214dc1['push']('Dataset\x20\x22'+_0x3d1532+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0x76baf,_0x27a4da(0xf8));const _0x3afd9c=Array['isArray'](_0x76baf['fields'])?_0x76baf['fields']:[],_0x12d129=new Set(_0x3afd9c[_0x27a4da(0x117)](_0x31ca6e=>_0x31ca6e['name']?.[_0x27a4da(0xf9)]())),_0x36a7b4=_0x76baf[_0x27a4da(0x130)]?.['tableName']||_0x76baf[_0x27a4da(0x118)]||_0x3d1532;_0x53901e[_0x27a4da(0x134)+_0x36a7b4]={'code':_0x3d1532,'tableName':_0x36a7b4,'fieldCount':_0x12d129[_0x27a4da(0xfe)],'fields':Array['from'](_0x12d129)};if(_0x159b41){const _0xa36ac7=normalizeDatasetIndexes(_0x76baf);_0x20c3a1[_0x27a4da(0x116)]({'tableName':_0x36a7b4,..._0xa36ac7});}}_0x214dc1[_0x27a4da(0x10d)]>0x0&&(_0x53901e[_0x27a4da(0x135)]=_0x214dc1),_0x159b41&&(_0x53901e[_0x27a4da(0x129)]=auditSqlJoinIndexes(_0x447104,_0x20c3a1));}return{'ok':_0x279aee[_0x27a4da(0x12d)],'data':_0x53901e,'message':_0x279aee[_0x27a4da(0x132)]};}};function a257_0x1563(){const _0xc2415e=['166011uDblMj','get','bool','8648766rCDaEd','string','boolean','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','appCode','1175534fdMhlc','index_type','read','length','329279HpEqAj','check-indexes','find','2593900bizpad','8qoLYnb','--check-indexes\x20requires\x20--schemas.','sqlType','cwd','push','map','tableName','split','unshift','columnNames','reason','Provide\x20--file\x20or\x20--sql','file','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','trim','validate','isSelectOnly','columns','sql','primary','index_columns','flagMissing','str','joinAudit','filter','type','Table\x20\x22','valid','4287843eeLbqF','utf-8','dbtableConfig','isArray','message','name','schema:','schemaWarnings','tables','indexes','2985318GVxDYc','pkField','validation','File\x20not\x20found:\x20','SQL\x20schema\x20validation','toLowerCase','schemas','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','dataset','isDangerous','size','parameters','indexName','28DzXfnI'];a257_0x1563=function(){return _0xc2415e;};return a257_0x1563();}function a257_0x3d69(_0x2ba1d6,_0x1e5f47){_0x2ba1d6=_0x2ba1d6-0xf6;const _0x1563b8=a257_0x1563();let _0x3d698b=_0x1563b8[_0x2ba1d6];return _0x3d698b;}function normalizeDatasetIndexes(_0x14b959){const _0x3fa36c=a257_0xeea09c,_0x28078e=Array[_0x3fa36c(0x131)](_0x14b959?.['dataset']?.[_0x3fa36c(0x137)])?_0x14b959[_0x3fa36c(0xfc)][_0x3fa36c(0x137)]:Array[_0x3fa36c(0x131)](_0x14b959?.[_0x3fa36c(0x137)])?_0x14b959[_0x3fa36c(0x137)]:[],_0x1989db=_0x28078e['flatMap'](_0xb99854=>{const _0x44b921=_0x3fa36c,_0x23c21b=Array[_0x44b921(0x131)](_0xb99854?.[_0x44b921(0x126)])?_0xb99854[_0x44b921(0x126)]:Array[_0x44b921(0x131)](_0xb99854?.[_0x44b921(0x11b)])?_0xb99854['columnNames']:Array[_0x44b921(0x131)](_0xb99854?.[_0x44b921(0x123)])?_0xb99854[_0x44b921(0x123)]:[],_0x6a9d51=_0x23c21b['filter'](_0x4c924b=>typeof _0x4c924b===_0x44b921(0x106))['map'](_0x3ae1b5=>_0x3ae1b5[_0x44b921(0x120)]())[_0x44b921(0x12a)](Boolean);if(_0x6a9d51['length']===0x0)return[];const _0xfa3a2c=[_0xb99854?.[_0x44b921(0x100)],_0xb99854?.['index_name'],_0xb99854?.[_0x44b921(0x133)]][_0x44b921(0x110)](_0x18f4eb=>typeof _0x18f4eb===_0x44b921(0x106)&&_0x18f4eb['trim']()),_0x370f6d=[_0xb99854?.[_0x44b921(0x10b)],_0xb99854?.['type']]['find'](_0xc9883c=>typeof _0xc9883c===_0x44b921(0x106)&&_0xc9883c[_0x44b921(0x120)]());return[{..._0xfa3a2c?{'name':_0xfa3a2c['trim']()}:{},..._0x370f6d?{'type':_0x370f6d['trim']()}:{},'columns':_0x6a9d51}];}),_0x214ae8=[..._0x1989db],_0x14c910=typeof _0x14b959?.[_0x3fa36c(0x130)]?.['pkField']===_0x3fa36c(0x106)?_0x14b959[_0x3fa36c(0x130)][_0x3fa36c(0x139)][_0x3fa36c(0x119)](',')['map'](_0x841b1d=>_0x841b1d[_0x3fa36c(0x120)]())[_0x3fa36c(0x12a)](Boolean):[];return _0x14c910[_0x3fa36c(0x10d)]>0x0&&_0x214ae8[_0x3fa36c(0x11a)]({'type':_0x3fa36c(0x125),'columns':_0x14c910}),{'indexes':_0x214ae8,'metadataAvailable':_0x1989db[_0x3fa36c(0x10d)]>0x0};}
1
+ const a257_0x531472=a257_0x2fa5;(function(_0x333868,_0x5cc30d){const _0x427847=a257_0x2fa5,_0x21ca89=_0x333868();while(!![]){try{const _0x57d38f=-parseInt(_0x427847(0xa3))/0x1+-parseInt(_0x427847(0x7a))/0x2*(parseInt(_0x427847(0xae))/0x3)+-parseInt(_0x427847(0xab))/0x4+parseInt(_0x427847(0xa1))/0x5+parseInt(_0x427847(0x82))/0x6*(parseInt(_0x427847(0x92))/0x7)+-parseInt(_0x427847(0xb6))/0x8*(-parseInt(_0x427847(0x8b))/0x9)+parseInt(_0x427847(0xb3))/0xa;if(_0x57d38f===_0x5cc30d)break;else _0x21ca89['push'](_0x21ca89['shift']());}catch(_0x16fb0b){_0x21ca89['push'](_0x21ca89['shift']());}}}(a257_0x59b2,0x91942));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':a257_0x531472(0xb8),'command':a257_0x531472(0x99),'description':a257_0x531472(0xad),'risk':a257_0x531472(0x8a),'flags':[{'name':a257_0x531472(0x7c),'type':a257_0x531472(0x9b),'description':a257_0x531472(0xac)},{'name':a257_0x531472(0xb8),'type':a257_0x531472(0x9b),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a257_0x531472(0x80),'type':'string','description':a257_0x531472(0x7e)},{'name':a257_0x531472(0x7f),'type':a257_0x531472(0x7d),'description':a257_0x531472(0xb2)}],async 'execute'(_0x224b45){const _0x5406ec=a257_0x531472,_0x1f90fa=_0x224b45['str'](_0x5406ec(0x7c)),_0x43e8fb=_0x224b45[_0x5406ec(0xa6)](_0x5406ec(0xb8)),_0x3c916a=_0x224b45[_0x5406ec(0xa6)](_0x5406ec(0x80)),_0x16eb6e=_0x224b45['bool']('check-indexes');if(!_0x1f90fa&&!_0x43e8fb)throw CliErrors[_0x5406ec(0xbe)](_0x5406ec(0x7c),_0x5406ec(0x8f));if(_0x16eb6e&&!_0x3c916a)throw CliErrors[_0x5406ec(0xa7)](_0x5406ec(0x83));let _0x2658cf;if(_0x1f90fa){const _0x17b6f7=resolve(process[_0x5406ec(0x87)](),_0x1f90fa);if(!existsSync(_0x17b6f7))throw CliErrors[_0x5406ec(0xa7)]('File\x20not\x20found:\x20'+_0x17b6f7);_0x2658cf=readFileSync(_0x17b6f7,'utf-8');}else _0x2658cf=_0x43e8fb;const _0x510ab=validateSql(_0x2658cf),_0x18e2b1={'valid':_0x510ab[_0x5406ec(0x8c)],'sqlType':_0x510ab[_0x5406ec(0x84)][_0x5406ec(0xa2)],'isSelectOnly':_0x510ab[_0x5406ec(0x84)][_0x5406ec(0xa0)],'isLockingRead':_0x510ab['sqlType'][_0x5406ec(0xaa)]??![],'isDangerous':_0x510ab[_0x5406ec(0x84)]['isDangerous'],'tables':_0x510ab[_0x5406ec(0x9c)],'parameters':_0x510ab[_0x5406ec(0xbf)],'message':_0x510ab[_0x5406ec(0x98)]};_0x510ab['sqlType']['reason']&&(_0x18e2b1[_0x5406ec(0x81)]=_0x510ab['sqlType'][_0x5406ec(0x81)]);if(_0x3c916a&&_0x510ab['valid']){const _0x1787d3=_0x3c916a[_0x5406ec(0x8e)](',')['map'](_0x53abc0=>_0x53abc0[_0x5406ec(0xa9)]())[_0x5406ec(0x89)](Boolean),_0x2b85fa=[],_0x2c0fc7=[],_0x1709ff=filterDbTableBackedDatasets(await listDatasets(_0x224b45[_0x5406ec(0x7b)])),_0x59d4a6=new Map(_0x1709ff[_0x5406ec(0xb7)](_0x51a512=>[_0x51a512[_0x5406ec(0x8d)]?.[_0x5406ec(0xb0)]?.[_0x5406ec(0x91)](),_0x51a512]));for(const _0x3897d9 of _0x510ab[_0x5406ec(0x9c)]){const _0x11122b=_0x59d4a6[_0x5406ec(0x96)](_0x3897d9[_0x5406ec(0x91)]());!_0x11122b&&_0x2b85fa['push'](_0x5406ec(0x9d)+_0x3897d9+_0x5406ec(0xb9));}for(const _0x4470e2 of _0x1787d3){let _0x12b641;try{_0x12b641=await getDatasetDetail(_0x4470e2);}catch{_0x2b85fa['push'](_0x5406ec(0xaf)+_0x4470e2+_0x5406ec(0x93));continue;}assertDatasetIsDbTableBacked(_0x12b641,'SQL\x20schema\x20validation');const _0x515eb0=Array[_0x5406ec(0xa5)](_0x12b641[_0x5406ec(0x85)])?_0x12b641[_0x5406ec(0x85)]:[],_0x22e3eb=new Set(_0x515eb0['map'](_0x25d87a=>_0x25d87a[_0x5406ec(0x9e)]?.['toLowerCase']())),_0x1c5e83=_0x12b641['dbtableConfig']?.[_0x5406ec(0xb0)]||_0x12b641[_0x5406ec(0xb0)]||_0x4470e2;_0x18e2b1['schema:'+_0x1c5e83]={'code':_0x4470e2,'tableName':_0x1c5e83,'fieldCount':_0x22e3eb[_0x5406ec(0x95)],'fields':Array[_0x5406ec(0xa4)](_0x22e3eb)};if(_0x16eb6e){const _0x12797e=normalizeDatasetIndexes(_0x12b641);_0x2c0fc7[_0x5406ec(0x9f)]({'tableName':_0x1c5e83,..._0x12797e});}}_0x2b85fa[_0x5406ec(0x90)]>0x0&&(_0x18e2b1[_0x5406ec(0xba)]=_0x2b85fa),_0x16eb6e&&(_0x18e2b1[_0x5406ec(0x94)]=auditSqlJoinIndexes(_0x2658cf,_0x2c0fc7));}return{'ok':_0x510ab[_0x5406ec(0x8c)],'data':_0x18e2b1,'message':_0x510ab[_0x5406ec(0x98)]};}};function a257_0x59b2(){const _0x3dc0a6=['isArray','str','validation','indexes','trim','isLockingRead','3590400jiFiyd','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','12DWFGBo','Dataset\x20\x22','tableName','columns','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','18680920FxNqYP','columnNames','primary','56YPZQwO','map','sql','\x22\x20not\x20found\x20in\x20any\x20dataset','schemaWarnings','find','pkField','unshift','flagMissing','parameters','440066jNCyoS','appCode','file','boolean','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','check-indexes','schemas','reason','6ilBaZw','--check-indexes\x20requires\x20--schemas.','sqlType','fields','index_name','cwd','indexName','filter','read','99315VpWsyR','valid','dbtableConfig','split','Provide\x20--file\x20or\x20--sql','length','toLowerCase','289982uSGGCq','\x22\x20not\x20found\x20or\x20not\x20accessible','joinAudit','size','get','dataset','message','validate','flatMap','string','tables','Table\x20\x22','name','push','isSelectOnly','2768560MvBpDh','type','166453MMjVkK','from'];a257_0x59b2=function(){return _0x3dc0a6;};return a257_0x59b2();}function a257_0x2fa5(_0x18ec7f,_0x322d35){_0x18ec7f=_0x18ec7f-0x7a;const _0x59b2da=a257_0x59b2();let _0x2fa548=_0x59b2da[_0x18ec7f];return _0x2fa548;}function normalizeDatasetIndexes(_0x5e4f77){const _0x27f4d0=a257_0x531472,_0x22cd5c=Array[_0x27f4d0(0xa5)](_0x5e4f77?.[_0x27f4d0(0x97)]?.['indexes'])?_0x5e4f77[_0x27f4d0(0x97)][_0x27f4d0(0xa8)]:Array[_0x27f4d0(0xa5)](_0x5e4f77?.[_0x27f4d0(0xa8)])?_0x5e4f77[_0x27f4d0(0xa8)]:[],_0x437170=_0x22cd5c[_0x27f4d0(0x9a)](_0x3bb416=>{const _0x40f4e9=_0x27f4d0,_0xa6b600=Array[_0x40f4e9(0xa5)](_0x3bb416?.['index_columns'])?_0x3bb416['index_columns']:Array[_0x40f4e9(0xa5)](_0x3bb416?.[_0x40f4e9(0xb4)])?_0x3bb416[_0x40f4e9(0xb4)]:Array[_0x40f4e9(0xa5)](_0x3bb416?.[_0x40f4e9(0xb1)])?_0x3bb416['columns']:[],_0x28fbf2=_0xa6b600[_0x40f4e9(0x89)](_0x5ba04d=>typeof _0x5ba04d===_0x40f4e9(0x9b))[_0x40f4e9(0xb7)](_0x3ee73c=>_0x3ee73c['trim']())[_0x40f4e9(0x89)](Boolean);if(_0x28fbf2[_0x40f4e9(0x90)]===0x0)return[];const _0x541076=[_0x3bb416?.[_0x40f4e9(0x88)],_0x3bb416?.[_0x40f4e9(0x86)],_0x3bb416?.[_0x40f4e9(0x9e)]][_0x40f4e9(0xbb)](_0x113da6=>typeof _0x113da6===_0x40f4e9(0x9b)&&_0x113da6['trim']()),_0x4c8156=[_0x3bb416?.['index_type'],_0x3bb416?.[_0x40f4e9(0xa2)]][_0x40f4e9(0xbb)](_0xc6dbfe=>typeof _0xc6dbfe==='string'&&_0xc6dbfe[_0x40f4e9(0xa9)]());return[{..._0x541076?{'name':_0x541076['trim']()}:{},..._0x4c8156?{'type':_0x4c8156[_0x40f4e9(0xa9)]()}:{},'columns':_0x28fbf2}];}),_0x2fd789=[..._0x437170],_0x267e8a=typeof _0x5e4f77?.['dbtableConfig']?.[_0x27f4d0(0xbc)]===_0x27f4d0(0x9b)?_0x5e4f77[_0x27f4d0(0x8d)][_0x27f4d0(0xbc)][_0x27f4d0(0x8e)](',')[_0x27f4d0(0xb7)](_0x242eaa=>_0x242eaa[_0x27f4d0(0xa9)]())[_0x27f4d0(0x89)](Boolean):[];return _0x267e8a[_0x27f4d0(0x90)]>0x0&&_0x2fd789[_0x27f4d0(0xbd)]({'type':_0x27f4d0(0xb5),'columns':_0x267e8a}),{'indexes':_0x2fd789,'metadataAvailable':_0x437170['length']>0x0};}
@@ -1 +1 @@
1
- (function(_0x47bc59,_0x388cb4){const _0x545f78=a258_0x633d,_0x155c81=_0x47bc59();while(!![]){try{const _0x49ea76=parseInt(_0x545f78(0xdf))/0x1+-parseInt(_0x545f78(0xd5))/0x2+parseInt(_0x545f78(0xdc))/0x3*(parseInt(_0x545f78(0xd4))/0x4)+parseInt(_0x545f78(0xd9))/0x5*(parseInt(_0x545f78(0xd6))/0x6)+-parseInt(_0x545f78(0xdd))/0x7*(-parseInt(_0x545f78(0xda))/0x8)+-parseInt(_0x545f78(0xdb))/0x9*(parseInt(_0x545f78(0xde))/0xa)+-parseInt(_0x545f78(0xd8))/0xb*(parseInt(_0x545f78(0xd7))/0xc);if(_0x49ea76===_0x388cb4)break;else _0x155c81['push'](_0x155c81['shift']());}catch(_0x1ff261){_0x155c81['push'](_0x155c81['shift']());}}}(a258_0x2812,0x1f649));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];function a258_0x633d(_0x53ac7b,_0x3a6f1e){_0x53ac7b=_0x53ac7b-0xd4;const _0x28129f=a258_0x2812();let _0x633d2=_0x28129f[_0x53ac7b];return _0x633d2;}function a258_0x2812(){const _0x1cc4e1=['5aTVQIW','8yAnnBV','18evJFXX','78NrtIEh','132517hFNPcB','21550EjGdqx','252854USLLPb','4192njuidN','332446yFzKxk','315258oanqzS','314748csxDfQ','22nuJKFz'];a258_0x2812=function(){return _0x1cc4e1;};return a258_0x2812();}
1
+ (function(_0x5cf6f6,_0xc5e98){const _0x5a8b3b=a258_0x3651,_0x50d6eb=_0x5cf6f6();while(!![]){try{const _0x4d3894=-parseInt(_0x5a8b3b(0x1b0))/0x1*(-parseInt(_0x5a8b3b(0x1b5))/0x2)+-parseInt(_0x5a8b3b(0x1b3))/0x3+-parseInt(_0x5a8b3b(0x1b6))/0x4*(parseInt(_0x5a8b3b(0x1ac))/0x5)+parseInt(_0x5a8b3b(0x1ad))/0x6+-parseInt(_0x5a8b3b(0x1b1))/0x7*(-parseInt(_0x5a8b3b(0x1af))/0x8)+-parseInt(_0x5a8b3b(0x1ae))/0x9*(parseInt(_0x5a8b3b(0x1b4))/0xa)+parseInt(_0x5a8b3b(0x1b2))/0xb;if(_0x4d3894===_0xc5e98)break;else _0x50d6eb['push'](_0x50d6eb['shift']());}catch(_0x1c3e75){_0x50d6eb['push'](_0x50d6eb['shift']());}}}(a258_0xaafc,0x7c65b));function a258_0x3651(_0x32a6fa,_0x192e4d){_0x32a6fa=_0x32a6fa-0x1ac;const _0xaafcbb=a258_0xaafc();let _0x365187=_0xaafcbb[_0x32a6fa];return _0x365187;}function a258_0xaafc(){const _0x2cdd16=['5476734rRYvhz','5692662TDswQx','1504PfORNl','1kJXbSL','18144PLDhVq','139084oXnHKv','1436850uXTvhL','10tNttJU','1546556YsMyEC','376672WWDJoG','30bzbMoq'];a258_0xaafc=function(){return _0x2cdd16;};return a258_0xaafc();}import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- const a259_0x4ab22b=a259_0x50d1;(function(_0x2acb16,_0xd16f3a){const _0x5a39a9=a259_0x50d1,_0x20273b=_0x2acb16();while(!![]){try{const _0x520a27=parseInt(_0x5a39a9(0x10d))/0x1*(-parseInt(_0x5a39a9(0x10e))/0x2)+-parseInt(_0x5a39a9(0x111))/0x3+parseInt(_0x5a39a9(0x11f))/0x4+parseInt(_0x5a39a9(0x110))/0x5*(parseInt(_0x5a39a9(0x11e))/0x6)+-parseInt(_0x5a39a9(0x122))/0x7+-parseInt(_0x5a39a9(0x10b))/0x8+parseInt(_0x5a39a9(0x114))/0x9;if(_0x520a27===_0xd16f3a)break;else _0x20273b['push'](_0x20273b['shift']());}catch(_0x325dd4){_0x20273b['push'](_0x20273b['shift']());}}}(a259_0x5727,0x323a8));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a259_0x50d1(_0x5dfc8e,_0x2139bb){_0x5dfc8e=_0x5dfc8e-0x10b;const _0x5727ad=a259_0x5727();let _0x50d15c=_0x5727ad[_0x5dfc8e];return _0x50d15c;}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':a259_0x4ab22b(0x112),'command':a259_0x4ab22b(0x11c),'description':a259_0x4ab22b(0x121),'risk':a259_0x4ab22b(0x11d),'defaultOutputFormat':a259_0x4ab22b(0x115),'structuredErrors':!![],'flags':[{'name':a259_0x4ab22b(0x113),'type':a259_0x4ab22b(0x10f),'required':!![],'description':a259_0x4ab22b(0x119)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2f28ab){const _0x548b31=a259_0x4ab22b;if(!_0x2f28ab[_0x548b31(0x116)](_0x548b31(0x113))[_0x548b31(0x118)]())throw CliErrors[_0x548b31(0x10c)]('task-id');},async 'execute'(_0x13bacf){const _0x5f1b81=a259_0x4ab22b,_0x48454b=_0x13bacf['str']('task-id')['trim'](),_0x2803a0=normalizeAsyncTask(await getAsyncTaskStatus(_0x48454b,_0x13bacf['appCode'],_0x13bacf['cookie']));if(_0x2803a0[_0x5f1b81(0x11a)]!==_0x48454b)throw CliErrors[_0x5f1b81(0x117)]('Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20'+_0x48454b+_0x5f1b81(0x120)+_0x2803a0[_0x5f1b81(0x11a)]+'.');const _0x173267=buildAsyncTaskStatusCommand(_0x2803a0[_0x5f1b81(0x11a)],_0x13bacf[_0x5f1b81(0x11b)]);return{'ok':!![],'message':asyncTaskMessage(_0x2803a0),'data':{'appCode':_0x13bacf[_0x5f1b81(0x11b)],..._0x2803a0,'query':_0x2803a0['isTerminal']?null:{'command':_0x173267}}};}};function a259_0x5727(){const _0x4b6f86=['Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','2211937QvcrIX','1503456hjOqoo','flagMissing','14SIElqY','11006HmrLLL','string','4465azDzxr','412620RrcOmo','task','task-id','5272812FPzJQV','compress','str','apiError','trim','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','taskId','appCode','status','read','1464peAkRa','481924RZqoKe',',\x20received\x20'];a259_0x5727=function(){return _0x4b6f86;};return a259_0x5727();}
1
+ function a259_0x1f37(){const _0x201906=['isTerminal','19615hjfggX','253oftGSE','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','471856REQTLF','448434cSOfGS','string','task',',\x20received\x20','str','528804zSwHce','261804YtXNvf','apiError','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','18IetiKK','taskId','48047UBBBiT','642payAiM','trim','4288710axBcSc','compress','56qXWOLV','task-id','flagMissing','8IVvTXg'];a259_0x1f37=function(){return _0x201906;};return a259_0x1f37();}const a259_0x2e585d=a259_0xc4c3;function a259_0xc4c3(_0x18872e,_0x5239c4){_0x18872e=_0x18872e-0x83;const _0x1f374a=a259_0x1f37();let _0xc4c348=_0x1f374a[_0x18872e];return _0xc4c348;}(function(_0x46363c,_0x276c0d){const _0x4a37c2=a259_0xc4c3,_0x1cb068=_0x46363c();while(!![]){try{const _0x4d9e8d=-parseInt(_0x4a37c2(0x86))/0x1*(-parseInt(_0x4a37c2(0x84))/0x2)+parseInt(_0x4a37c2(0x99))/0x3*(-parseInt(_0x4a37c2(0x8e))/0x4)+parseInt(_0x4a37c2(0x90))/0x5*(-parseInt(_0x4a37c2(0x87))/0x6)+parseInt(_0x4a37c2(0x93))/0x7+-parseInt(_0x4a37c2(0x8b))/0x8*(parseInt(_0x4a37c2(0x94))/0x9)+parseInt(_0x4a37c2(0x89))/0xa+parseInt(_0x4a37c2(0x91))/0xb*(parseInt(_0x4a37c2(0x9a))/0xc);if(_0x4d9e8d===_0x276c0d)break;else _0x1cb068['push'](_0x1cb068['shift']());}catch(_0x41f86c){_0x1cb068['push'](_0x1cb068['shift']());}}}(a259_0x1f37,0x4b8a6));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':a259_0x2e585d(0x96),'command':'status','description':a259_0x2e585d(0x92),'risk':'read','defaultOutputFormat':a259_0x2e585d(0x8a),'structuredErrors':!![],'flags':[{'name':a259_0x2e585d(0x8c),'type':a259_0x2e585d(0x95),'required':!![],'description':'Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x309c5e){const _0x1d1675=a259_0x2e585d;if(!_0x309c5e[_0x1d1675(0x98)]('task-id')[_0x1d1675(0x88)]())throw CliErrors[_0x1d1675(0x8d)]('task-id');},async 'execute'(_0x1534f3){const _0x930847=a259_0x2e585d,_0x597e1a=_0x1534f3[_0x930847(0x98)](_0x930847(0x8c))[_0x930847(0x88)](),_0x861009=normalizeAsyncTask(await getAsyncTaskStatus(_0x597e1a,_0x1534f3['appCode'],_0x1534f3['cookie']));if(_0x861009[_0x930847(0x85)]!==_0x597e1a)throw CliErrors[_0x930847(0x9b)](_0x930847(0x83)+_0x597e1a+_0x930847(0x97)+_0x861009[_0x930847(0x85)]+'.');const _0x3e65b8=buildAsyncTaskStatusCommand(_0x861009['taskId'],_0x1534f3['appCode']);return{'ok':!![],'message':asyncTaskMessage(_0x861009),'data':{'appCode':_0x1534f3['appCode'],..._0x861009,'query':_0x861009[_0x930847(0x8f)]?null:{'command':_0x3e65b8}}};}};
@@ -1 +1 @@
1
- (function(_0x2aeff8,_0x3b9a52){const _0x232553=a260_0x1a01,_0x2f77e0=_0x2aeff8();while(!![]){try{const _0x26488e=parseInt(_0x232553(0x87))/0x1+-parseInt(_0x232553(0x85))/0x2*(-parseInt(_0x232553(0x86))/0x3)+parseInt(_0x232553(0x8b))/0x4+parseInt(_0x232553(0x8c))/0x5+-parseInt(_0x232553(0x8a))/0x6*(parseInt(_0x232553(0x88))/0x7)+parseInt(_0x232553(0x8d))/0x8+-parseInt(_0x232553(0x89))/0x9;if(_0x26488e===_0x3b9a52)break;else _0x2f77e0['push'](_0x2f77e0['shift']());}catch(_0x22a052){_0x2f77e0['push'](_0x2f77e0['shift']());}}}(a260_0x2df8,0x31749));function a260_0x1a01(_0x1df776,_0x2cfb23){_0x1df776=_0x1df776-0x85;const _0x2df832=a260_0x2df8();let _0x1a0164=_0x2df832[_0x1df776];return _0x1a0164;}function a260_0x2df8(){const _0x2c3345=['21WmXCXD','7569882bmSdDt','409254zneLPY','1569980gQsDDm','1681420fzKFMi','1401240JOFAaR','4qRsqKh','54669liGfKn','307914sIlWZA'];a260_0x2df8=function(){return _0x2c3345;};return a260_0x2df8();}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];
1
+ (function(_0xb4e62f,_0x179371){const _0x3b6824=a260_0x1ee5,_0x2e8b49=_0xb4e62f();while(!![]){try{const _0x475832=parseInt(_0x3b6824(0x177))/0x1+-parseInt(_0x3b6824(0x175))/0x2*(-parseInt(_0x3b6824(0x17b))/0x3)+-parseInt(_0x3b6824(0x174))/0x4+parseInt(_0x3b6824(0x17a))/0x5*(parseInt(_0x3b6824(0x17d))/0x6)+parseInt(_0x3b6824(0x178))/0x7+parseInt(_0x3b6824(0x179))/0x8+parseInt(_0x3b6824(0x17c))/0x9*(-parseInt(_0x3b6824(0x176))/0xa);if(_0x475832===_0x179371)break;else _0x2e8b49['push'](_0x2e8b49['shift']());}catch(_0x56af4f){_0x2e8b49['push'](_0x2e8b49['shift']());}}}(a260_0x5507,0xdf166));function a260_0x1ee5(_0x3803d0,_0x1b100){_0x3803d0=_0x3803d0-0x174;const _0x550779=a260_0x5507();let _0x1ee58f=_0x550779[_0x3803d0];return _0x1ee58f;}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];function a260_0x5507(){const _0x2941ac=['5780873DekBXv','10758776uhlkXl','320wqPTIG','158616pXENSf','4719879SkIjHl','52188CMsRhe','2044800QzQMBj','18kCRjjQ','60EFsoXC','1368346LWlUHc'];a260_0x5507=function(){return _0x2941ac;};return a260_0x5507();}
@@ -1 +1 @@
1
- const a261_0x5159be=a261_0x5447;(function(_0x18f482,_0x45ff1b){const _0x101796=a261_0x5447,_0x4d6cba=_0x18f482();while(!![]){try{const _0x5987ea=parseInt(_0x101796(0x1eb))/0x1+-parseInt(_0x101796(0x1e9))/0x2+parseInt(_0x101796(0x1f0))/0x3+parseInt(_0x101796(0x1de))/0x4+-parseInt(_0x101796(0x1df))/0x5*(-parseInt(_0x101796(0x1e2))/0x6)+-parseInt(_0x101796(0x1e5))/0x7+-parseInt(_0x101796(0x1e4))/0x8;if(_0x5987ea===_0x45ff1b)break;else _0x4d6cba['push'](_0x4d6cba['shift']());}catch(_0xc04442){_0x4d6cba['push'](_0x4d6cba['shift']());}}}(a261_0x1603,0x5d663));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';function a261_0x5447(_0x2697ea,_0x930ded){_0x2697ea=_0x2697ea-0x1de;const _0x16037a=a261_0x1603();let _0x54477d=_0x16037a[_0x2697ea];return _0x54477d;}export const tenantMembersListDefinition={'service':a261_0x5159be(0x1e6),'command':a261_0x5159be(0x1e8),'description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':a261_0x5159be(0x1ee),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a261_0x5159be(0x1e0),'type':a261_0x5159be(0x1ec),'required':!![],'description':a261_0x5159be(0x1e7)}],async 'validate'(_0x4fe78d){const _0x4d7305=a261_0x5159be;if(!_0x4fe78d[_0x4d7305(0x1ea)](_0x4d7305(0x1e0))[_0x4d7305(0x1ef)]())throw CliErrors[_0x4d7305(0x1e1)]('tenant-code',_0x4d7305(0x1ed));},async 'execute'(_0x463b3d){const _0x1cbb3d=a261_0x5159be,_0x5748b6=_0x463b3d[_0x1cbb3d(0x1ea)](_0x1cbb3d(0x1e0))[_0x1cbb3d(0x1ef)](),_0x273a97=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x5748b6,_0x273a97);const _0x4cfb8d=projectTenantMembers(await listTenantDirectoryMembers(_0x5748b6));return{'ok':!![],'data':{'tenantCode':_0x5748b6,'items':_0x4cfb8d,'totalCount':_0x4cfb8d[_0x1cbb3d(0x1f1)]},'message':'Found\x20'+_0x4cfb8d[_0x1cbb3d(0x1f1)]+_0x1cbb3d(0x1e3)};}};function a261_0x1603(){const _0x1ab287=['flagMissing','4567668ybFghd','\x20tenant\x20member(s)','2667864ZgEHbz','4893231csJHrw','tenant','Exact\x20tenant\x20code','members-list','606774JWPcTB','str','419374tiYbaZ','string','Pass\x20--tenant-code\x20<code>.','read','trim','1355940cWSLFg','length','343336LEEeRp','5ZVKFcl','tenant-code'];a261_0x1603=function(){return _0x1ab287;};return a261_0x1603();}
1
+ const a261_0x516b7f=a261_0x12f8;function a261_0xf914(){const _0x5007ba=['1117047TGbfVo','513VkcrWI','trim','read','34560TgDOFN','76fXlKpd','16865gNiWKT','665330SRONRa','Exact\x20tenant\x20code','str','flagMissing','1477TyZOxL','Pass\x20--tenant-code\x20<code>.','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','\x20tenant\x20member(s)','tenant-code','10464CZFrZJ','Found\x20','5811832vMstNn','members-list','length','10506nGGZRe'];a261_0xf914=function(){return _0x5007ba;};return a261_0xf914();}(function(_0x2ce2f4,_0x3b7157){const _0x5c71f4=a261_0x12f8,_0x51b6b1=_0x2ce2f4();while(!![]){try{const _0x2b4304=parseInt(_0x5c71f4(0xfc))/0x1+parseInt(_0x5c71f4(0x10a))/0x2+-parseInt(_0x5c71f4(0x10b))/0x3+parseInt(_0x5c71f4(0xfa))/0x4*(parseInt(_0x5c71f4(0xfb))/0x5)+parseInt(_0x5c71f4(0x105))/0x6*(-parseInt(_0x5c71f4(0x100))/0x7)+parseInt(_0x5c71f4(0x107))/0x8+-parseInt(_0x5c71f4(0x10c))/0x9*(parseInt(_0x5c71f4(0xf9))/0xa);if(_0x2b4304===_0x3b7157)break;else _0x51b6b1['push'](_0x51b6b1['shift']());}catch(_0x5c4e50){_0x51b6b1['push'](_0x51b6b1['shift']());}}}(a261_0xf914,0x7fe30));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a261_0x12f8(_0x46a8b7,_0x3b9b41){_0x46a8b7=_0x46a8b7-0xf8;const _0xf91419=a261_0xf914();let _0x12f82f=_0xf91419[_0x46a8b7];return _0x12f82f;}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':'tenant','command':a261_0x516b7f(0x108),'description':a261_0x516b7f(0x102),'risk':a261_0x516b7f(0xf8),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a261_0x516b7f(0x104),'type':'string','required':!![],'description':a261_0x516b7f(0xfd)}],async 'validate'(_0x6fb84d){const _0x59d1fd=a261_0x516b7f;if(!_0x6fb84d[_0x59d1fd(0xfe)](_0x59d1fd(0x104))[_0x59d1fd(0x10d)]())throw CliErrors[_0x59d1fd(0xff)](_0x59d1fd(0x104),_0x59d1fd(0x101));},async 'execute'(_0x5a2cd1){const _0x1e2d3b=a261_0x516b7f,_0x5059f7=_0x5a2cd1['str'](_0x1e2d3b(0x104))['trim'](),_0x245b2d=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x5059f7,_0x245b2d);const _0x7d9b4e=projectTenantMembers(await listTenantDirectoryMembers(_0x5059f7));return{'ok':!![],'data':{'tenantCode':_0x5059f7,'items':_0x7d9b4e,'totalCount':_0x7d9b4e['length']},'message':_0x1e2d3b(0x106)+_0x7d9b4e[_0x1e2d3b(0x109)]+_0x1e2d3b(0x103)};}};
@@ -1 +1 @@
1
- (function(_0xd7d196,_0x660253){const _0x75c545=a262_0xaf97,_0x5a4ccf=_0xd7d196();while(!![]){try{const _0x684f1c=parseInt(_0x75c545(0x106))/0x1+-parseInt(_0x75c545(0x10b))/0x2*(-parseInt(_0x75c545(0xfc))/0x3)+parseInt(_0x75c545(0x10c))/0x4*(parseInt(_0x75c545(0xfe))/0x5)+-parseInt(_0x75c545(0x100))/0x6*(-parseInt(_0x75c545(0x10d))/0x7)+-parseInt(_0x75c545(0x105))/0x8+parseInt(_0x75c545(0x113))/0x9+-parseInt(_0x75c545(0x114))/0xa;if(_0x684f1c===_0x660253)break;else _0x5a4ccf['push'](_0x5a4ccf['shift']());}catch(_0x3dfc3c){_0x5a4ccf['push'](_0x5a4ccf['shift']());}}}(a262_0x1835,0xb2aad));import{CliErrors}from'../../errors.js';function textOrNull(_0x31c336){const _0x3cdbc3=a262_0xaf97,_0x457fa3=_0x31c336?.[_0x3cdbc3(0x10f)]();return _0x457fa3?_0x457fa3:null;}function a262_0x1835(){const _0x263367=['nickname','username','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','1654110aPhuZT','17363520psUald','tenantCode','ADMIN','isFinite','1142826ZkRbBp','displayName','36565zlnAKF','MEMBER','325698GjGKBI','userId','Tenant\x20\x22','role','sort','5961032IQwcrK','943268pFBWWo','validation','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','status','values','2DlJlDe','428jVLudd','119QncPXf','adminFlag','trim'];a262_0x1835=function(){return _0x263367;};return a262_0x1835();}export function projectTenantMembers(_0x4a17e6){const _0x19992b=a262_0xaf97,_0x4e0855=new Map();for(const _0x5827f3 of _0x4a17e6){const _0x2b0880=Number(_0x5827f3[_0x19992b(0x101)]);if(!Number[_0x19992b(0xfb)](_0x2b0880)||_0x2b0880<=0x0)continue;const _0x53c8b3={'userId':_0x2b0880,'username':textOrNull(_0x5827f3[_0x19992b(0x111)]),'displayName':textOrNull(_0x5827f3[_0x19992b(0x110)]),'role':_0x5827f3[_0x19992b(0x10e)]===!![]?'ADMIN':_0x19992b(0xff),'status':textOrNull(_0x5827f3['status'])},_0x4f8631=_0x4e0855['get'](_0x2b0880);if(!_0x4f8631){_0x4e0855['set'](_0x2b0880,_0x53c8b3);continue;}_0x4f8631[_0x19992b(0x111)]??=_0x53c8b3[_0x19992b(0x111)],_0x4f8631[_0x19992b(0xfd)]??=_0x53c8b3[_0x19992b(0xfd)],_0x4f8631[_0x19992b(0x109)]??=_0x53c8b3[_0x19992b(0x109)];if(_0x53c8b3[_0x19992b(0x103)]==='ADMIN')_0x4f8631[_0x19992b(0x103)]=_0x19992b(0x116);}return[..._0x4e0855[_0x19992b(0x10a)]()][_0x19992b(0x104)]((_0x519704,_0x15b3c8)=>_0x519704[_0x19992b(0x101)]-_0x15b3c8['userId']);}function a262_0xaf97(_0x3b6ab5,_0x46e4ff){_0x3b6ab5=_0x3b6ab5-0xfb;const _0x1835b9=a262_0x1835();let _0xaf9768=_0x1835b9[_0x3b6ab5];return _0xaf9768;}export function assertTenantAccessible(_0x3ee44e,_0x44a448){const _0x226ccf=a262_0xaf97;if(_0x44a448['some'](_0x309a63=>_0x309a63[_0x226ccf(0x115)]===_0x3ee44e))return;throw CliErrors[_0x226ccf(0x107)](_0x226ccf(0x102)+_0x3ee44e+_0x226ccf(0x112),_0x226ccf(0x108));}
1
+ function a262_0x3cfc(){const _0x3db19e=['42fyQfTk','2VvLKqZ','role','get','sort','adminFlag','userId','username','trim','status','ADMIN','1092913rebjfP','4HOmpDX','1960040IrbdPc','set','1444710vhpyZA','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','validation','displayName','1493013OJnwIi','299560OkInqd','values','isFinite','nickname','63chAPXJ','MEMBER','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','688950YCEOti','25032810rlSclq','tenantCode'];a262_0x3cfc=function(){return _0x3db19e;};return a262_0x3cfc();}(function(_0x411acc,_0x268592){const _0x38c8b1=a262_0x2492,_0x4fb00c=_0x411acc();while(!![]){try{const _0x5d8173=parseInt(_0x38c8b1(0x15f))/0x1+-parseInt(_0x38c8b1(0x173))/0x2*(parseInt(_0x38c8b1(0x167))/0x3)+-parseInt(_0x38c8b1(0x160))/0x4*(parseInt(_0x38c8b1(0x16f))/0x5)+parseInt(_0x38c8b1(0x163))/0x6*(-parseInt(_0x38c8b1(0x172))/0x7)+parseInt(_0x38c8b1(0x168))/0x8*(-parseInt(_0x38c8b1(0x16c))/0x9)+-parseInt(_0x38c8b1(0x161))/0xa+parseInt(_0x38c8b1(0x170))/0xb;if(_0x5d8173===_0x268592)break;else _0x4fb00c['push'](_0x4fb00c['shift']());}catch(_0x4db771){_0x4fb00c['push'](_0x4fb00c['shift']());}}}(a262_0x3cfc,0xcab7d));function a262_0x2492(_0x3284e8,_0x23a793){_0x3284e8=_0x3284e8-0x156;const _0x3cfcd1=a262_0x3cfc();let _0x24925c=_0x3cfcd1[_0x3284e8];return _0x24925c;}import{CliErrors}from'../../errors.js';function textOrNull(_0x1a24e1){const _0xd6a033=a262_0x2492,_0x2f58d0=_0x1a24e1?.[_0xd6a033(0x15c)]();return _0x2f58d0?_0x2f58d0:null;}export function projectTenantMembers(_0x32acf8){const _0x2d36ea=a262_0x2492,_0x58e9f8=new Map();for(const _0x1b9881 of _0x32acf8){const _0x3a6149=Number(_0x1b9881[_0x2d36ea(0x15a)]);if(!Number[_0x2d36ea(0x16a)](_0x3a6149)||_0x3a6149<=0x0)continue;const _0x22a53e={'userId':_0x3a6149,'username':textOrNull(_0x1b9881['username']),'displayName':textOrNull(_0x1b9881[_0x2d36ea(0x16b)]),'role':_0x1b9881[_0x2d36ea(0x159)]===!![]?'ADMIN':_0x2d36ea(0x16d),'status':textOrNull(_0x1b9881[_0x2d36ea(0x15d)])},_0xeeb780=_0x58e9f8[_0x2d36ea(0x157)](_0x3a6149);if(!_0xeeb780){_0x58e9f8[_0x2d36ea(0x162)](_0x3a6149,_0x22a53e);continue;}_0xeeb780[_0x2d36ea(0x15b)]??=_0x22a53e[_0x2d36ea(0x15b)],_0xeeb780[_0x2d36ea(0x166)]??=_0x22a53e[_0x2d36ea(0x166)],_0xeeb780[_0x2d36ea(0x15d)]??=_0x22a53e['status'];if(_0x22a53e[_0x2d36ea(0x156)]===_0x2d36ea(0x15e))_0xeeb780[_0x2d36ea(0x156)]=_0x2d36ea(0x15e);}return[..._0x58e9f8[_0x2d36ea(0x169)]()][_0x2d36ea(0x158)]((_0x23bee0,_0x5b70be)=>_0x23bee0[_0x2d36ea(0x15a)]-_0x5b70be['userId']);}export function assertTenantAccessible(_0x3d01eb,_0x162214){const _0xa9930c=a262_0x2492;if(_0x162214['some'](_0x3a5316=>_0x3a5316[_0xa9930c(0x171)]===_0x3d01eb))return;throw CliErrors[_0xa9930c(0x165)]('Tenant\x20\x22'+_0x3d01eb+_0xa9930c(0x164),_0xa9930c(0x16e));}
@@ -1 +1 @@
1
- const a263_0x3ba057=a263_0x2469;(function(_0x16eedf,_0x4b6d20){const _0x4c46a2=a263_0x2469,_0x2dfe53=_0x16eedf();while(!![]){try{const _0x387f46=parseInt(_0x4c46a2(0x11e))/0x1+parseInt(_0x4c46a2(0x115))/0x2*(-parseInt(_0x4c46a2(0x122))/0x3)+parseInt(_0x4c46a2(0x12c))/0x4*(-parseInt(_0x4c46a2(0x120))/0x5)+parseInt(_0x4c46a2(0x125))/0x6+parseInt(_0x4c46a2(0x118))/0x7*(-parseInt(_0x4c46a2(0x11f))/0x8)+-parseInt(_0x4c46a2(0x116))/0x9+-parseInt(_0x4c46a2(0x127))/0xa*(-parseInt(_0x4c46a2(0x117))/0xb);if(_0x387f46===_0x4b6d20)break;else _0x2dfe53['push'](_0x2dfe53['shift']());}catch(_0x36fa4c){_0x2dfe53['push'](_0x2dfe53['shift']());}}}(a263_0x3827,0x56e5a));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';function a263_0x2469(_0x30469b,_0x2810f9){_0x30469b=_0x30469b-0x111;const _0x382784=a263_0x3827();let _0x246954=_0x382784[_0x30469b];return _0x246954;}const PROVIDER_ID='dingtalk',CURRENT_BINDING_WARNING=a263_0x3ba057(0x128);function readDingTalkUserId(_0x13c446){const _0x1dd032=a263_0x3ba057,_0x1a9b2d=_0x13c446[_0x1dd032(0x126)](_0x1dd032(0x111))[_0x1dd032(0x112)]();if(!_0x1a9b2d)throw CliErrors[_0x1dd032(0x11b)](_0x1dd032(0x11d),_0x1dd032(0x113));return _0x1a9b2d;}function buildBindingData(_0x4d0e0a,_0x567dcf){const _0x19b9d4=a263_0x3ba057;return{'operation':_0x19b9d4(0x12a),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x4d0e0a},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x4d0e0a,'bound':!![]},'dryRun':_0x567dcf,'backend':{'method':_0x19b9d4(0x124),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a263_0x3ba057(0x114),'command':a263_0x3ba057(0x11a),'description':a263_0x3ba057(0x11c),'risk':a263_0x3ba057(0x12b),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a263_0x3ba057(0x111),'type':'string','required':!![],'description':a263_0x3ba057(0x123)}],async 'validate'(_0x16a67f){readDingTalkUserId(_0x16a67f);},async 'dryRun'(_0x29e562){const _0x4417ba=readDingTalkUserId(_0x29e562);return asDryRunResult(buildBindingData(_0x4417ba,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x5b0c4b){const _0x56299f=a263_0x3ba057,_0x54a8e5=readDingTalkUserId(_0x5b0c4b),_0x497466=await bindDingTalkSandboxAccount(_0x54a8e5);if(_0x497466!==!![])throw CliErrors['apiError'](_0x56299f(0x119),_0x56299f(0x121));return{'ok':!![],'data':buildBindingData(_0x54a8e5,![]),'message':_0x56299f(0x129)};}};function a263_0x3827(){const _0x272e51=['--ding-talk-user-id\x20cannot\x20be\x20empty.','296040byyNhj','238584WYZcKD','5FACCkA','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','6HIVpaG','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','POST','1640028hppCjF','str','5302090BNKjhe','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','bind','write','2596628clVHZC','ding-talk-user-id','trim','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','user-account','649734ocxMfw','5829246oVqlGh','44nAlfaF','91ZdDeQe','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','dingding-sandbox-bind','validation','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account'];a263_0x3827=function(){return _0x272e51;};return a263_0x3827();}
1
+ const a263_0xf47410=a263_0x1e3e;(function(_0xc8ad49,_0x5e0724){const _0x1a4591=a263_0x1e3e,_0x13a173=_0xc8ad49();while(!![]){try{const _0x740a6b=parseInt(_0x1a4591(0xde))/0x1*(parseInt(_0x1a4591(0xd8))/0x2)+-parseInt(_0x1a4591(0xda))/0x3+parseInt(_0x1a4591(0xd5))/0x4*(parseInt(_0x1a4591(0xec))/0x5)+parseInt(_0x1a4591(0xdd))/0x6*(-parseInt(_0x1a4591(0xe5))/0x7)+-parseInt(_0x1a4591(0xe0))/0x8+parseInt(_0x1a4591(0xe1))/0x9*(parseInt(_0x1a4591(0xe7))/0xa)+parseInt(_0x1a4591(0xd4))/0xb;if(_0x740a6b===_0x5e0724)break;else _0x13a173['push'](_0x13a173['shift']());}catch(_0x29e634){_0x13a173['push'](_0x13a173['shift']());}}}(a263_0x2e6b,0xdac49));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=a263_0xf47410(0xd9),CURRENT_BINDING_WARNING=a263_0xf47410(0xeb);function readDingTalkUserId(_0x50a5ea){const _0x12fb08=a263_0xf47410,_0x16ee51=_0x50a5ea[_0x12fb08(0xdf)](_0x12fb08(0xdb))['trim']();if(!_0x16ee51)throw CliErrors[_0x12fb08(0xd3)](_0x12fb08(0xe4),_0x12fb08(0xd7));return _0x16ee51;}function buildBindingData(_0x20b919,_0xb31ee0){const _0x30d191=a263_0xf47410;return{'operation':_0x30d191(0xea),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x20b919},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x20b919,'bound':!![]},'dryRun':_0xb31ee0,'backend':{'method':_0x30d191(0xe6),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}function a263_0x1e3e(_0x379c6d,_0x18cbd2){_0x379c6d=_0x379c6d-0xd3;const _0x2e6ba6=a263_0x2e6b();let _0x1e3e70=_0x2e6ba6[_0x379c6d];return _0x1e3e70;}export const dingTalkSandboxBind={'service':'user-account','command':'dingding-sandbox-bind','description':'Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','risk':a263_0xf47410(0xe2),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a263_0xf47410(0xdb),'type':a263_0xf47410(0xe3),'required':!![],'description':a263_0xf47410(0xe8)}],async 'validate'(_0x2af2c3){readDingTalkUserId(_0x2af2c3);},async 'dryRun'(_0x3aad30){const _0x5abbf0=a263_0xf47410,_0x1e28dc=readDingTalkUserId(_0x3aad30);return asDryRunResult(buildBindingData(_0x1e28dc,!![]),{'method':_0x5abbf0(0xe6),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x419771){const _0x475eb7=a263_0xf47410,_0x3bf789=readDingTalkUserId(_0x419771),_0x3bc74b=await bindDingTalkSandboxAccount(_0x3bf789);if(_0x3bc74b!==!![])throw CliErrors[_0x475eb7(0xd6)](_0x475eb7(0xdc),_0x475eb7(0xe9));return{'ok':!![],'data':buildBindingData(_0x3bf789,![]),'message':_0x475eb7(0xed)};}};function a263_0x2e6b(){const _0x665edf=['DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','bind','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','1557515autfvy','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','validation','35252052bzynmD','4oTMmjG','apiError','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','135906OPPacD','dingtalk','4640622KqjSrj','ding-talk-user-id','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','6Gmexdd','7IoqvEN','str','1939256VXMupM','9GjOGyb','write','string','--ding-talk-user-id\x20cannot\x20be\x20empty.','9337433wWKBDw','POST','273670aSokZj'];a263_0x2e6b=function(){return _0x665edf;};return a263_0x2e6b();}
@@ -1 +1 @@
1
- function a264_0x3ee5(_0x382927,_0x258cb3){_0x382927=_0x382927-0x1ad;const _0x136bd6=a264_0x136b();let _0x3ee5a1=_0x136bd6[_0x382927];return _0x3ee5a1;}const a264_0x429122=a264_0x3ee5;(function(_0x4bd3d1,_0x155382){const _0x4f57f9=a264_0x3ee5,_0x266927=_0x4bd3d1();while(!![]){try{const _0x4a9bcb=-parseInt(_0x4f57f9(0x1b4))/0x1*(-parseInt(_0x4f57f9(0x1bb))/0x2)+-parseInt(_0x4f57f9(0x1c7))/0x3*(parseInt(_0x4f57f9(0x1c2))/0x4)+-parseInt(_0x4f57f9(0x1c0))/0x5+parseInt(_0x4f57f9(0x1b2))/0x6+parseInt(_0x4f57f9(0x1b9))/0x7*(-parseInt(_0x4f57f9(0x1c4))/0x8)+-parseInt(_0x4f57f9(0x1c8))/0x9*(-parseInt(_0x4f57f9(0x1b6))/0xa)+parseInt(_0x4f57f9(0x1bf))/0xb*(parseInt(_0x4f57f9(0x1c9))/0xc);if(_0x4a9bcb===_0x155382)break;else _0x266927['push'](_0x266927['shift']());}catch(_0x83b1ab){_0x266927['push'](_0x266927['shift']());}}}(a264_0x136b,0x2d0ec));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindFeishuAccount,FEISHU_BIND_PATH}from'../../core/api-client.js';function a264_0x136b(){const _0x56c19c=['trim','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20Feishu\x20account','51nHmktH','139518RNTtUt','348vWIgKO','write','--union-id\x20must\x20match\x20on_\x20followed\x20by\x20letters,\x20digits,\x20underscores,\x20or\x20hyphens.','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','str','user-account','bind','2189958vCVCUI','union-id','1AaZaRl','Verify\x20the\x20current\x20binding\x20through\x20the\x20platform\x20before\x20explicitly\x20retrying;\x20do\x20not\x20automatically\x20retry.','170Jimley','Pass\x20a\x20Feishu\x20union\x20id\x20such\x20as\x20on_example_001.','feishu','7vEmKtv','validation','205478HapWwk','string','apiError','POST','15994waYeKs','991105HLqQHr','Bound\x20current\x20user\x20to\x20Feishu\x20account.','65376TJxXjY','feishu-bind','902456lxmmar'];a264_0x136b=function(){return _0x56c19c;};return a264_0x136b();}import{CliErrors}from'../../errors.js';const PROVIDER_ID=a264_0x429122(0x1b8),CURRENT_BINDING_WARNING=a264_0x429122(0x1ae);function readUnionId(_0x344434){const _0x5a6630=a264_0x429122,_0x3066b2=_0x344434[_0x5a6630(0x1af)]('union-id')[_0x5a6630(0x1c5)]();if(!/^on_[A-Za-z0-9_-]+$/['test'](_0x3066b2))throw CliErrors[_0x5a6630(0x1ba)](_0x5a6630(0x1ad),_0x5a6630(0x1b7));return _0x3066b2;}function buildBindingData(_0x5f2b59,_0x331852){const _0x221055=a264_0x429122;return{'operation':_0x221055(0x1b1),'selector':{'providerId':PROVIDER_ID,'unionId':_0x5f2b59},'before':null,'after':{'providerId':PROVIDER_ID,'unionId':_0x5f2b59,'bound':!![]},'dryRun':_0x331852,'backend':{'method':_0x221055(0x1be),'path':FEISHU_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const feishuBind={'service':a264_0x429122(0x1b0),'command':a264_0x429122(0x1c3),'description':a264_0x429122(0x1c6),'risk':a264_0x429122(0x1ca),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a264_0x429122(0x1b3),'type':a264_0x429122(0x1bc),'required':!![],'description':'Feishu\x20union_id\x20for\x20the\x20configured\x20Feishu\x20application\x20developer'}],async 'validate'(_0xe86b07){readUnionId(_0xe86b07);},async 'dryRun'(_0x141404){const _0x544da6=a264_0x429122,_0x429883=readUnionId(_0x141404);return asDryRunResult(buildBindingData(_0x429883,!![]),{'method':_0x544da6(0x1be),'url':FEISHU_BIND_PATH});},async 'execute'(_0x2de217){const _0x5bc886=a264_0x429122,_0x3ce2a8=readUnionId(_0x2de217),_0x1653c0=await bindFeishuAccount(_0x3ce2a8);if(_0x1653c0!==!![])throw CliErrors[_0x5bc886(0x1bd)]('Feishu\x20account\x20binding\x20was\x20not\x20confirmed.',_0x5bc886(0x1b5));return{'ok':!![],'data':buildBindingData(_0x3ce2a8,![]),'message':_0x5bc886(0x1c1)};}};
1
+ const a264_0xbc8b6c=a264_0xfc0f;(function(_0x47df00,_0x43a1d9){const _0x402008=a264_0xfc0f,_0x28a40f=_0x47df00();while(!![]){try{const _0x4abef2=-parseInt(_0x402008(0x75))/0x1+-parseInt(_0x402008(0x7b))/0x2*(-parseInt(_0x402008(0x69))/0x3)+parseInt(_0x402008(0x71))/0x4+parseInt(_0x402008(0x67))/0x5*(-parseInt(_0x402008(0x7e))/0x6)+parseInt(_0x402008(0x6d))/0x7+parseInt(_0x402008(0x73))/0x8*(-parseInt(_0x402008(0x7c))/0x9)+parseInt(_0x402008(0x6a))/0xa*(parseInt(_0x402008(0x74))/0xb);if(_0x4abef2===_0x43a1d9)break;else _0x28a40f['push'](_0x28a40f['shift']());}catch(_0x2ceb9){_0x28a40f['push'](_0x28a40f['shift']());}}}(a264_0x480e,0x3cbed));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindFeishuAccount,FEISHU_BIND_PATH}from'../../core/api-client.js';function a264_0x480e(){const _0x238d72=['string','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20Feishu\x20account','trim','49426pFxOmv','846wbRGAi','test','48IUUssL','--union-id\x20must\x20match\x20on_\x20followed\x20by\x20letters,\x20digits,\x20underscores,\x20or\x20hyphens.','126010VuGumc','Pass\x20a\x20Feishu\x20union\x20id\x20such\x20as\x20on_example_001.','33CGmUNN','2190ZEiSZy','str','write','2843645FiXhQt','validation','user-account','union-id','1318932GMWmJa','Feishu\x20account\x20binding\x20was\x20not\x20confirmed.','31576wIAQYo','12705kighjw','439309LhKFPI','Bound\x20current\x20user\x20to\x20Feishu\x20account.','POST'];a264_0x480e=function(){return _0x238d72;};return a264_0x480e();}import{CliErrors}from'../../errors.js';const PROVIDER_ID='feishu',CURRENT_BINDING_WARNING='The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.';function readUnionId(_0x3e0bd1){const _0x36e07c=a264_0xfc0f,_0x2cbc2f=_0x3e0bd1[_0x36e07c(0x6b)]('union-id')[_0x36e07c(0x7a)]();if(!/^on_[A-Za-z0-9_-]+$/[_0x36e07c(0x7d)](_0x2cbc2f))throw CliErrors[_0x36e07c(0x6e)](_0x36e07c(0x66),_0x36e07c(0x68));return _0x2cbc2f;}function buildBindingData(_0x2c3ee2,_0x3a8582){const _0x52f5f1=a264_0xfc0f;return{'operation':'bind','selector':{'providerId':PROVIDER_ID,'unionId':_0x2c3ee2},'before':null,'after':{'providerId':PROVIDER_ID,'unionId':_0x2c3ee2,'bound':!![]},'dryRun':_0x3a8582,'backend':{'method':_0x52f5f1(0x77),'path':FEISHU_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}function a264_0xfc0f(_0x54dfa7,_0x1a25da){_0x54dfa7=_0x54dfa7-0x66;const _0x480e9b=a264_0x480e();let _0xfc0f88=_0x480e9b[_0x54dfa7];return _0xfc0f88;}export const feishuBind={'service':a264_0xbc8b6c(0x6f),'command':'feishu-bind','description':a264_0xbc8b6c(0x79),'risk':a264_0xbc8b6c(0x6c),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a264_0xbc8b6c(0x70),'type':a264_0xbc8b6c(0x78),'required':!![],'description':'Feishu\x20union_id\x20for\x20the\x20configured\x20Feishu\x20application\x20developer'}],async 'validate'(_0x5e23af){readUnionId(_0x5e23af);},async 'dryRun'(_0x53ed64){const _0xe524e5=a264_0xbc8b6c,_0x1660b8=readUnionId(_0x53ed64);return asDryRunResult(buildBindingData(_0x1660b8,!![]),{'method':_0xe524e5(0x77),'url':FEISHU_BIND_PATH});},async 'execute'(_0x4f44a4){const _0x24adfe=a264_0xbc8b6c,_0x1aef5e=readUnionId(_0x4f44a4),_0x38e356=await bindFeishuAccount(_0x1aef5e);if(_0x38e356!==!![])throw CliErrors['apiError'](_0x24adfe(0x72),'Verify\x20the\x20current\x20binding\x20through\x20the\x20platform\x20before\x20explicitly\x20retrying;\x20do\x20not\x20automatically\x20retry.');return{'ok':!![],'data':buildBindingData(_0x1aef5e,![]),'message':_0x24adfe(0x76)};}};
@@ -1 +1 @@
1
- (function(_0x3baa84,_0x2b0ce1){const _0x2a12ff=a265_0x20b4,_0x1dd431=_0x3baa84();while(!![]){try{const _0x48f9e7=parseInt(_0x2a12ff(0x13e))/0x1+parseInt(_0x2a12ff(0x13d))/0x2*(parseInt(_0x2a12ff(0x141))/0x3)+parseInt(_0x2a12ff(0x13f))/0x4+-parseInt(_0x2a12ff(0x140))/0x5+parseInt(_0x2a12ff(0x144))/0x6+-parseInt(_0x2a12ff(0x143))/0x7+-parseInt(_0x2a12ff(0x142))/0x8;if(_0x48f9e7===_0x2b0ce1)break;else _0x1dd431['push'](_0x1dd431['shift']());}catch(_0x2881bc){_0x1dd431['push'](_0x1dd431['shift']());}}}(a265_0x5e36,0xf2fd0));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a265_0x20b4(_0x5a9f06,_0xb40da8){_0x5a9f06=_0x5a9f06-0x13d;const _0x5e36b3=a265_0x5e36();let _0x20b4b9=_0x5e36b3[_0x5a9f06];return _0x20b4b9;}import{feishuBind}from'../../commands/user-account/feishu-bind.js';function a265_0x5e36(){const _0x30919b=['9630342FEUXhF','470684keIalJ','1939470XmrCPV','6114236ZSpAZd','9942270tYPFEV','3XXNuZG','18029168lLxVZO','497336dDqHsi'];a265_0x5e36=function(){return _0x30919b;};return a265_0x5e36();}export const userAccountDefinitions=[dingTalkSandboxBind,feishuBind];
1
+ function a265_0x229d(_0x3e3658,_0x3dfe62){_0x3e3658=_0x3e3658-0x127;const _0x2fcc55=a265_0x2fcc();let _0x229dea=_0x2fcc55[_0x3e3658];return _0x229dea;}function a265_0x2fcc(){const _0x1ad807=['642XCeDMw','8243125EYOIDD','698116ighFGx','908049lrkJNp','27408xeLEsG','215gqCrOq','3483oUxrPZ','16130LWIIEL','7824411pmlVJM','8koThsg','270jfYVjd'];a265_0x2fcc=function(){return _0x1ad807;};return a265_0x2fcc();}(function(_0x33c663,_0x1126bb){const _0x380fb7=a265_0x229d,_0x35d7f2=_0x33c663();while(!![]){try{const _0x514332=-parseInt(_0x380fb7(0x12d))/0x1+-parseInt(_0x380fb7(0x12a))/0x2*(parseInt(_0x380fb7(0x130))/0x3)+-parseInt(_0x380fb7(0x12c))/0x4+-parseInt(_0x380fb7(0x12f))/0x5*(-parseInt(_0x380fb7(0x12e))/0x6)+-parseInt(_0x380fb7(0x127))/0x7*(-parseInt(_0x380fb7(0x128))/0x8)+-parseInt(_0x380fb7(0x129))/0x9*(parseInt(_0x380fb7(0x131))/0xa)+parseInt(_0x380fb7(0x12b))/0xb;if(_0x514332===_0x1126bb)break;else _0x35d7f2['push'](_0x35d7f2['shift']());}catch(_0x2af704){_0x35d7f2['push'](_0x35d7f2['shift']());}}}(a265_0x2fcc,0x88b33));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';import{feishuBind}from'../../commands/user-account/feishu-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind,feishuBind];