@lovrabet/rabetbase-cli 2.4.7-beta.2 → 2.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.d.ts +13 -3
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.d.ts +7 -0
  6. package/lib/api/generate-sdk-config-file.js +1 -0
  7. package/lib/auth/auth-server-ui.js +1 -1
  8. package/lib/auth/auth-server.js +1 -1
  9. package/lib/auth/constant.js +1 -1
  10. package/lib/auth/get-cookie.js +1 -1
  11. package/lib/auth/get-session-user.js +1 -1
  12. package/lib/auth/is-session-valid.js +1 -1
  13. package/lib/auth/login-success-html.js +1 -1
  14. package/lib/auth/logout.js +1 -1
  15. package/lib/cli-flags.js +1 -1
  16. package/lib/cli.js +1 -1
  17. package/lib/commands/api/generate.js +1 -1
  18. package/lib/commands/api/index.js +1 -1
  19. package/lib/commands/api/list.js +1 -1
  20. package/lib/commands/api/pull.js +1 -1
  21. package/lib/commands/api/shared.js +1 -1
  22. package/lib/commands/app/index.js +1 -1
  23. package/lib/commands/app/list.js +1 -1
  24. package/lib/commands/app/members-list.js +1 -1
  25. package/lib/commands/app/remote-directory.js +1 -1
  26. package/lib/commands/app/shared.d.ts +2 -5
  27. package/lib/commands/app/shared.js +1 -1
  28. package/lib/commands/app-config/delete.js +1 -1
  29. package/lib/commands/app-config/get.js +1 -1
  30. package/lib/commands/app-config/index.js +1 -1
  31. package/lib/commands/app-config/list.js +1 -1
  32. package/lib/commands/app-config/set.js +1 -1
  33. package/lib/commands/app-config/shared.js +1 -1
  34. package/lib/commands/auth/index.js +1 -1
  35. package/lib/commands/bff/create.js +1 -1
  36. package/lib/commands/bff/delete.js +1 -1
  37. package/lib/commands/bff/detail.js +1 -1
  38. package/lib/commands/bff/index.js +1 -1
  39. package/lib/commands/bff/list.js +1 -1
  40. package/lib/commands/bff/pull.js +1 -1
  41. package/lib/commands/bff/push.js +1 -1
  42. package/lib/commands/bff/status.js +1 -1
  43. package/lib/commands/cli-skill/index.js +1 -1
  44. package/lib/commands/cli-update.js +1 -1
  45. package/lib/commands/codegen/index.js +1 -1
  46. package/lib/commands/codegen/sdk.js +1 -1
  47. package/lib/commands/codegen/sql.js +1 -1
  48. package/lib/commands/common/app-registry.js +1 -1
  49. package/lib/commands/common/app-selector.js +1 -1
  50. package/lib/commands/common/async-task.js +1 -1
  51. package/lib/commands/common/dry-run.js +1 -1
  52. package/lib/commands/common/flags.js +1 -1
  53. package/lib/commands/common/local-file.js +1 -1
  54. package/lib/commands/common/validate.js +1 -1
  55. package/lib/commands/config/delete.d.ts +5 -0
  56. package/lib/commands/config/delete.js +1 -0
  57. package/lib/commands/config/get.js +1 -1
  58. package/lib/commands/config/index.js +1 -1
  59. package/lib/commands/config/init.d.ts +12 -0
  60. package/lib/commands/config/init.js +1 -0
  61. package/lib/commands/config/list.js +1 -1
  62. package/lib/commands/config/set.js +1 -1
  63. package/lib/commands/config/shared.js +1 -1
  64. package/lib/commands/dataset/business-group-update.js +1 -1
  65. package/lib/commands/dataset/business-groups.js +1 -1
  66. package/lib/commands/dataset/capability.js +1 -1
  67. package/lib/commands/dataset/delete.js +1 -1
  68. package/lib/commands/dataset/detail.js +1 -1
  69. package/lib/commands/dataset/extend-update.js +1 -1
  70. package/lib/commands/dataset/field-update.js +1 -1
  71. package/lib/commands/dataset/generate.js +1 -1
  72. package/lib/commands/dataset/index.js +1 -1
  73. package/lib/commands/dataset/list.js +1 -1
  74. package/lib/commands/dataset/operations.js +1 -1
  75. package/lib/commands/dataset/relation-audit.js +1 -1
  76. package/lib/commands/dataset/relation-create.js +1 -1
  77. package/lib/commands/dataset/relation-delete.js +1 -1
  78. package/lib/commands/dataset/relation-shared.js +1 -1
  79. package/lib/commands/dataset/relation-update.js +1 -1
  80. package/lib/commands/dataset/relations.js +1 -1
  81. package/lib/commands/dataset/rename.js +1 -1
  82. package/lib/commands/dataset/restore.js +1 -1
  83. package/lib/commands/db/analysis-batching.js +1 -1
  84. package/lib/commands/db/analyze-batch-plan.js +1 -1
  85. package/lib/commands/db/analyze-cancel.js +1 -1
  86. package/lib/commands/db/analyze-start.js +1 -1
  87. package/lib/commands/db/analyze-status.js +1 -1
  88. package/lib/commands/db/create.js +1 -1
  89. package/lib/commands/db/delete.js +1 -1
  90. package/lib/commands/db/detail.js +1 -1
  91. package/lib/commands/db/diff-refresh-start.js +1 -1
  92. package/lib/commands/db/diff-refresh-status.js +1 -1
  93. package/lib/commands/db/diff.js +1 -1
  94. package/lib/commands/db/index.js +1 -1
  95. package/lib/commands/db/list.js +1 -1
  96. package/lib/commands/db/shared.js +1 -1
  97. package/lib/commands/db/tables.js +1 -1
  98. package/lib/commands/db/test.js +1 -1
  99. package/lib/commands/db/update.js +1 -1
  100. package/lib/commands/doctor.js +1 -1
  101. package/lib/commands/file/index.js +1 -1
  102. package/lib/commands/issue/index.js +1 -1
  103. package/lib/commands/issue/nudge.js +1 -1
  104. package/lib/commands/issue/report.js +1 -1
  105. package/lib/commands/issue/shared.js +1 -1
  106. package/lib/commands/kb/create.js +1 -1
  107. package/lib/commands/kb/delete.js +1 -1
  108. package/lib/commands/kb/detail.js +1 -1
  109. package/lib/commands/kb/index.js +1 -1
  110. package/lib/commands/kb/list.js +1 -1
  111. package/lib/commands/kb/search.js +1 -1
  112. package/lib/commands/kb/shared.js +1 -1
  113. package/lib/commands/kb/update.js +1 -1
  114. package/lib/commands/logs/index.js +1 -1
  115. package/lib/commands/menu/asset-update.js +1 -1
  116. package/lib/commands/menu/delete.js +1 -1
  117. package/lib/commands/menu/external-link-create.js +1 -1
  118. package/lib/commands/menu/external-link-update.js +1 -1
  119. package/lib/commands/menu/group-create.js +1 -1
  120. package/lib/commands/menu/group-update.js +1 -1
  121. package/lib/commands/menu/index.js +1 -1
  122. package/lib/commands/menu/list.js +1 -1
  123. package/lib/commands/menu/move.js +1 -1
  124. package/lib/commands/menu/regroup-start.js +1 -1
  125. package/lib/commands/menu/rename.js +1 -1
  126. package/lib/commands/menu/shared/compare-table.js +1 -1
  127. package/lib/commands/menu/shared/delete-plan.js +1 -1
  128. package/lib/commands/menu/shared/facts.js +1 -1
  129. package/lib/commands/menu/shared/index.js +1 -1
  130. package/lib/commands/menu/shared/inquirer.js +1 -1
  131. package/lib/commands/menu/shared/local-pages.js +1 -1
  132. package/lib/commands/menu/shared/logic.js +1 -1
  133. package/lib/commands/menu/shared/mutations.js +1 -1
  134. package/lib/commands/menu/shared/service.js +1 -1
  135. package/lib/commands/menu/shared/sync-core.js +1 -1
  136. package/lib/commands/menu/shared/update-core.js +1 -1
  137. package/lib/commands/menu/shared/valid-url.js +1 -1
  138. package/lib/commands/menu/sync.js +1 -1
  139. package/lib/commands/menu/visibility-update.js +1 -1
  140. package/lib/commands/notification/config-create.js +1 -1
  141. package/lib/commands/notification/config-delete.js +1 -1
  142. package/lib/commands/notification/config-list.js +1 -1
  143. package/lib/commands/notification/config-update.js +1 -1
  144. package/lib/commands/notification/index.js +1 -1
  145. package/lib/commands/notification/shared.js +1 -1
  146. package/lib/commands/ocr/index.js +1 -1
  147. package/lib/commands/page/create.js +1 -1
  148. package/lib/commands/page/custom/detail.js +1 -1
  149. package/lib/commands/page/custom/list.js +1 -1
  150. package/lib/commands/page/custom/publish.js +1 -1
  151. package/lib/commands/page/custom/shared.js +1 -1
  152. package/lib/commands/page/custom/syntax.js +1 -1
  153. package/lib/commands/page/custom/template.js +1 -1
  154. package/lib/commands/page/custom/update.js +1 -1
  155. package/lib/commands/page/data-list-status.js +1 -1
  156. package/lib/commands/page/generate-start.js +1 -1
  157. package/lib/commands/page/generate-status.js +1 -1
  158. package/lib/commands/page/index.js +1 -1
  159. package/lib/commands/page/pull.js +1 -1
  160. package/lib/commands/page/push.js +1 -1
  161. package/lib/commands/page/relation-audit.js +1 -1
  162. package/lib/commands/page/restore.js +1 -1
  163. package/lib/commands/page/shared.js +1 -1
  164. package/lib/commands/page/sync.js +1 -1
  165. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  166. package/lib/commands/project/create/format-elapsed.js +1 -1
  167. package/lib/commands/project/create/main.d.ts +1 -0
  168. package/lib/commands/project/create/main.js +1 -1
  169. package/lib/commands/project/create/materialize-project-template.d.ts +6 -2
  170. package/lib/commands/project/create/materialize-project-template.js +1 -1
  171. package/lib/commands/project/create/project-name.js +1 -1
  172. package/lib/commands/project/create/project-template-archive.js +1 -1
  173. package/lib/commands/project/create/project-template-path.js +1 -1
  174. package/lib/commands/project/create/use-copy-project-template.d.ts +1 -1
  175. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  176. package/lib/commands/project/create/use-format-code.js +1 -1
  177. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  178. package/lib/commands/project/index.js +1 -1
  179. package/lib/commands/project/upgrade.js +1 -1
  180. package/lib/commands/registry.d.ts +2 -2
  181. package/lib/commands/registry.js +1 -1
  182. package/lib/commands/role/delete.js +1 -1
  183. package/lib/commands/role/detail.js +1 -1
  184. package/lib/commands/role/index.js +1 -1
  185. package/lib/commands/role/list.js +1 -1
  186. package/lib/commands/role/shared.d.ts +1 -1
  187. package/lib/commands/role/shared.js +1 -1
  188. package/lib/commands/role/update.js +1 -1
  189. package/lib/commands/role/user-add.js +1 -1
  190. package/lib/commands/role/user-remove.js +1 -1
  191. package/lib/commands/role/user-resolve.js +1 -1
  192. package/lib/commands/run/index.js +1 -1
  193. package/lib/commands/schema.js +1 -1
  194. package/lib/commands/sql/create.js +1 -1
  195. package/lib/commands/sql/delete.js +1 -1
  196. package/lib/commands/sql/detail.js +1 -1
  197. package/lib/commands/sql/exec.js +1 -1
  198. package/lib/commands/sql/index.js +1 -1
  199. package/lib/commands/sql/list.js +1 -1
  200. package/lib/commands/sql/pull.js +1 -1
  201. package/lib/commands/sql/push.js +1 -1
  202. package/lib/commands/sql/shared.js +1 -1
  203. package/lib/commands/sql/status.js +1 -1
  204. package/lib/commands/sql/validate.js +1 -1
  205. package/lib/commands/task/index.js +1 -1
  206. package/lib/commands/task/status.js +1 -1
  207. package/lib/commands/tenant/index.js +1 -1
  208. package/lib/commands/tenant/members-list.js +1 -1
  209. package/lib/commands/tenant/shared.js +1 -1
  210. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  211. package/lib/commands/user-account/index.js +1 -1
  212. package/lib/commands/workspace/add.js +1 -1
  213. package/lib/commands/workspace/index.js +1 -1
  214. package/lib/commands/workspace/remove.js +1 -1
  215. package/lib/config/domain-config.d.ts +10 -0
  216. package/lib/config/domain-config.js +1 -0
  217. package/lib/config/schema.d.ts +3 -1
  218. package/lib/config/schema.js +1 -1
  219. package/lib/constant/cdn.js +1 -1
  220. package/lib/constant/cli.js +1 -1
  221. package/lib/constant/defaults.js +1 -1
  222. package/lib/constant/domain.d.ts +23 -1
  223. package/lib/constant/domain.js +1 -1
  224. package/lib/constant/env.js +1 -1
  225. package/lib/constant/output.js +1 -1
  226. package/lib/constant/paths.js +1 -1
  227. package/lib/constant/region.d.ts +9 -0
  228. package/lib/constant/region.js +1 -0
  229. package/lib/constant/risk.js +1 -1
  230. package/lib/context/app-resolver.js +1 -1
  231. package/lib/context/auth-resolver.js +1 -1
  232. package/lib/context/config-loader.d.ts +4 -6
  233. package/lib/context/config-loader.js +1 -1
  234. package/lib/context.d.ts +2 -2
  235. package/lib/context.js +1 -1
  236. package/lib/core/alias-resolver.js +1 -1
  237. package/lib/core/api-client.d.ts +2 -0
  238. package/lib/core/api-client.js +1 -1
  239. package/lib/core/bff/config.js +1 -1
  240. package/lib/core/bff/file-system.js +1 -1
  241. package/lib/core/bff/hash.js +1 -1
  242. package/lib/core/bff/lock.js +1 -1
  243. package/lib/core/bff/utils.js +1 -1
  244. package/lib/core/db-resolver.js +1 -1
  245. package/lib/core/page/file-system.js +1 -1
  246. package/lib/core/page/hash.js +1 -1
  247. package/lib/core/page/lock.js +1 -1
  248. package/lib/core/sql-index-auditor.js +1 -1
  249. package/lib/core/sql-sync/config.js +1 -1
  250. package/lib/core/sql-sync/file-system.js +1 -1
  251. package/lib/core/sql-sync/hash.js +1 -1
  252. package/lib/core/sql-sync/lock.js +1 -1
  253. package/lib/core/sql-sync/utils.js +1 -1
  254. package/lib/core/sql-validator.js +1 -1
  255. package/lib/errors.d.ts +11 -1
  256. package/lib/errors.js +1 -1
  257. package/lib/framework/build-all-flags.js +1 -1
  258. package/lib/framework/error-output.js +1 -1
  259. package/lib/framework/explicit-yes.js +1 -1
  260. package/lib/framework/flags.js +1 -1
  261. package/lib/framework/help.d.ts +2 -2
  262. package/lib/framework/help.js +1 -1
  263. package/lib/framework/index.js +1 -1
  264. package/lib/framework/output.js +1 -1
  265. package/lib/framework/response.js +1 -1
  266. package/lib/framework/runner-alias.js +1 -1
  267. package/lib/framework/runner.js +1 -1
  268. package/lib/framework/schema-export.js +1 -1
  269. package/lib/framework/types.js +1 -1
  270. package/lib/generated/build-info.d.ts +4 -4
  271. package/lib/generated/build-info.js +1 -1
  272. package/lib/help.js +1 -1
  273. package/lib/postinstall.js +1 -1
  274. package/lib/runtime/confirmation.js +1 -1
  275. package/lib/runtime/event.js +1 -1
  276. package/lib/runtime/index.js +1 -1
  277. package/lib/runtime/queue.js +1 -1
  278. package/lib/runtime/resolve.js +1 -1
  279. package/lib/skills/builtin-skill.js +1 -1
  280. package/lib/skills/main.js +1 -1
  281. package/lib/skills/npx-skills-add.js +1 -1
  282. package/lib/skills/skill-presence.js +1 -1
  283. package/lib/telemetry/cli-command-trace.js +1 -1
  284. package/lib/telemetry/cli-help-trace.js +1 -1
  285. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  286. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  287. package/lib/telemetry/send-cli-trace-log.js +1 -1
  288. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  289. package/lib/types/index.d.ts +28 -0
  290. package/lib/utils/ai_config.d.ts +1 -2
  291. package/lib/utils/ai_config.js +1 -1
  292. package/lib/utils/apply-jq-filter.js +1 -1
  293. package/lib/utils/cdn-config.js +1 -1
  294. package/lib/utils/check-sdk-version.js +1 -1
  295. package/lib/utils/cli-version-check.js +1 -1
  296. package/lib/utils/cli-version-policy.js +1 -1
  297. package/lib/utils/config.js +1 -1
  298. package/lib/utils/entity-with-id.js +1 -1
  299. package/lib/utils/file-utils.js +1 -1
  300. package/lib/utils/guides-cdn.js +1 -1
  301. package/lib/utils/http-client.js +1 -1
  302. package/lib/utils/is-non-interactive.js +1 -1
  303. package/lib/utils/logger.js +1 -1
  304. package/lib/utils/params.js +1 -1
  305. package/lib/utils/platform.js +1 -1
  306. package/lib/utils/sleep.js +1 -1
  307. package/lib/utils/template-replacer.js +1 -1
  308. package/lib/utils/update-notice.js +1 -1
  309. package/lib/utils/version.js +1 -1
  310. package/lib/utils/with-active-cookie.js +1 -1
  311. package/lib/utils/write-cli-side-channel.js +1 -1
  312. package/package.json +1 -3
  313. package/skills/rabetbase/SKILL.md +33 -28
  314. package/skills/rabetbase/guides/backend-function.md +41 -12
  315. package/skills/rabetbase/guides/bff-creation-workflow.md +6 -4
  316. package/skills/rabetbase/guides/custom-page-workflow.md +1 -1
  317. package/skills/rabetbase/guides/data-api-guidelines.md +8 -8
  318. package/skills/rabetbase/guides/database-connection-workflow.md +8 -16
  319. package/skills/rabetbase/guides/menu-anomaly-manual-cleanup.md +1 -6
  320. package/skills/rabetbase/guides/sdk-client-generation.md +146 -0
  321. package/skills/rabetbase/guides/sql-creation-workflow.md +1 -1
  322. package/skills/rabetbase/guides/troubleshooting.md +1 -1
  323. package/skills/rabetbase/guides/typescript-sdk.md +46 -10
  324. package/skills/rabetbase/references/rabetbase-api-list.md +4 -4
  325. package/skills/rabetbase/references/rabetbase-api-pull.md +44 -29
  326. package/skills/rabetbase/references/rabetbase-app-list.md +2 -2
  327. package/skills/rabetbase/references/rabetbase-auth-login.md +4 -2
  328. package/skills/rabetbase/references/rabetbase-bff-push.md +3 -1
  329. package/skills/rabetbase/references/rabetbase-codegen-sql.md +3 -1
  330. package/skills/rabetbase/references/rabetbase-config.md +75 -30
  331. package/skills/rabetbase/references/rabetbase-dataset-detail.md +1 -1
  332. package/skills/rabetbase/references/rabetbase-db-analyze.md +3 -3
  333. package/skills/rabetbase/references/rabetbase-db-detail.md +2 -2
  334. package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +4 -4
  335. package/skills/rabetbase/references/rabetbase-db-diff.md +6 -9
  336. package/skills/rabetbase/references/rabetbase-doctor.md +1 -1
  337. package/skills/rabetbase/references/rabetbase-init.md +57 -51
  338. package/skills/rabetbase/references/rabetbase-kb.md +2 -0
  339. package/skills/rabetbase/references/rabetbase-page-create.md +1 -1
  340. package/skills/rabetbase/references/rabetbase-page-custom-detail.md +3 -3
  341. package/skills/rabetbase/references/rabetbase-page-custom-list.md +2 -2
  342. package/skills/rabetbase/references/rabetbase-project-create.md +12 -3
  343. package/skills/rabetbase/references/rabetbase-project-upgrade.md +2 -2
  344. package/skills/rabetbase/references/rabetbase-role-user-resolve.md +2 -2
  345. package/skills/rabetbase/references/rabetbase-user-account.md +1 -1
  346. package/skills/rabetbase/references/rabetbase-workspace.md +6 -6
  347. package/skills/rabetbase.manifest.json +4 -3
  348. package/templates/README.md +17 -28
  349. package/templates/generate-api/api.ts.tpl +3 -3
  350. package/templates/generate-api/client.ts.tpl +10 -37
  351. package/lib/commands/data/filter.d.ts +0 -7
  352. package/lib/commands/data/filter.js +0 -1
  353. package/lib/commands/data/getOne.d.ts +0 -7
  354. package/lib/commands/data/getOne.js +0 -1
  355. package/lib/commands/data/index.d.ts +0 -8
  356. package/lib/commands/data/index.js +0 -1
  357. package/lib/commands/data/shared.d.ts +0 -33
  358. package/lib/commands/data/shared.js +0 -1
  359. package/lib/commands/init/index.d.ts +0 -11
  360. package/lib/commands/init/index.js +0 -1
  361. package/lib/utils/rules-cdn.d.ts +0 -38
  362. package/lib/utils/rules-cdn.js +0 -1
  363. package/templates/rules/lovrabet_rules.mdc.tpl +0 -893
  364. package/templates/skill/SKILL.md.tpl +0 -120
@@ -1 +1 @@
1
- const a189_0x2255b6=a189_0x25c7;function a189_0x25c7(_0x253e5a,_0x2d1e07){_0x253e5a=_0x253e5a-0x80;const _0x1f98b8=a189_0x1f98();let _0x25c7be=_0x1f98b8[_0x253e5a];return _0x25c7be;}(function(_0x1402fc,_0x2c2c82){const _0x58272c=a189_0x25c7,_0x97b4e1=_0x1402fc();while(!![]){try{const _0x2083bf=parseInt(_0x58272c(0x80))/0x1+-parseInt(_0x58272c(0x97))/0x2*(-parseInt(_0x58272c(0x84))/0x3)+-parseInt(_0x58272c(0x8d))/0x4*(parseInt(_0x58272c(0x83))/0x5)+-parseInt(_0x58272c(0x8c))/0x6+-parseInt(_0x58272c(0x90))/0x7+parseInt(_0x58272c(0x8f))/0x8+parseInt(_0x58272c(0x82))/0x9;if(_0x2083bf===_0x2c2c82)break;else _0x97b4e1['push'](_0x97b4e1['shift']());}catch(_0xbab3ac){_0x97b4e1['push'](_0x97b4e1['shift']());}}}(a189_0x1f98,0x3d9b7));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a189_0x1f98(){const _0x41bb7b=['12HldQak','length','sqlcode','447556owkpqW','SQL\x20execution\x20failed','2191761VwcOBR','297355INDYqm','2169jFdhJa','execSuccess','\x20row(s)\x20in\x20','now','params','read','execError','string','2896260UjzCaB','20GxkZdB','Returned\x20','3310064aJGQnQ','537411KZCVYj','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','str','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','isArray','exec','appCode'];a189_0x1f98=function(){return _0x41bb7b;};return a189_0x1f98();}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':a189_0x2255b6(0x95),'description':a189_0x2255b6(0x91),'risk':a189_0x2255b6(0x89),'flags':[SQLCODE_FLAG,{'name':a189_0x2255b6(0x88),'type':a189_0x2255b6(0x8b),'description':a189_0x2255b6(0x93)}],async 'execute'(_0x3df07b){const _0x1560ea=a189_0x2255b6,_0x451427=parseJsonParams(_0x3df07b[_0x1560ea(0x92)](_0x1560ea(0x88))),_0x438f43=Date[_0x1560ea(0x87)](),_0x1d1878=await executeSql(_0x3df07b[_0x1560ea(0x96)],_0x3df07b[_0x1560ea(0x92)](_0x1560ea(0x99)),_0x451427),_0x11ab2a=Date[_0x1560ea(0x87)]()-_0x438f43,_0x3c22c2=_0x1d1878?.['execResult']??_0x1d1878,_0x19824f=_0x1d1878?.[_0x1560ea(0x85)]??!![];if(!_0x19824f)return{'ok':![],'data':{'error':_0x1d1878?.[_0x1560ea(0x8a)]||_0x1560ea(0x81),'elapsed':_0x11ab2a},'message':_0x1560ea(0x81)};const _0x377130=Array[_0x1560ea(0x94)](_0x3c22c2)?_0x3c22c2:[];return{'ok':!![],'data':{'rows':_0x377130,'rowCount':_0x377130['length'],'elapsed':_0x11ab2a},'message':_0x1560ea(0x8e)+_0x377130[_0x1560ea(0x98)]+_0x1560ea(0x86)+_0x11ab2a+'ms'};}};
1
+ const a187_0xacc429=a187_0x4676;(function(_0x42b908,_0x1adbdc){const _0x24e064=a187_0x4676,_0x308c2e=_0x42b908();while(!![]){try{const _0x24b56f=parseInt(_0x24e064(0x1a5))/0x1+parseInt(_0x24e064(0x19f))/0x2*(-parseInt(_0x24e064(0x1a8))/0x3)+-parseInt(_0x24e064(0x1a6))/0x4*(-parseInt(_0x24e064(0x1aa))/0x5)+-parseInt(_0x24e064(0x19b))/0x6+parseInt(_0x24e064(0x19a))/0x7*(parseInt(_0x24e064(0x1a4))/0x8)+parseInt(_0x24e064(0x196))/0x9*(parseInt(_0x24e064(0x1af))/0xa)+parseInt(_0x24e064(0x1b2))/0xb*(parseInt(_0x24e064(0x1b1))/0xc);if(_0x24b56f===_0x1adbdc)break;else _0x308c2e['push'](_0x308c2e['shift']());}catch(_0x151e71){_0x308c2e['push'](_0x308c2e['shift']());}}}(a187_0xd885,0x775b9));function a187_0xd885(){const _0x2a847f=['string','3429XPYENZ','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','Returned\x20','isArray','7woioJs','1974090pkRSvN','read','str','appCode','207412SNZDZI','sqlcode','length','now','execSuccess','3747320patPxC','316909cKcLyP','1591924slYCko','execError','27saLNtV','\x20row(s)\x20in\x20','5tAQdsX','params','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','SQL\x20execution\x20failed','sql','1220bDEMSx','exec','12PUZRaQ','5736181hGpAlf'];a187_0xd885=function(){return _0x2a847f;};return a187_0xd885();}function a187_0x4676(_0xd2e100,_0x31137c){_0xd2e100=_0xd2e100-0x195;const _0xd885b7=a187_0xd885();let _0x467633=_0xd885b7[_0xd2e100];return _0x467633;}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a187_0xacc429(0x1ae),'command':a187_0xacc429(0x1b0),'description':a187_0xacc429(0x197),'risk':a187_0xacc429(0x19c),'flags':[SQLCODE_FLAG,{'name':a187_0xacc429(0x1ab),'type':a187_0xacc429(0x195),'description':a187_0xacc429(0x1ac)}],async 'execute'(_0x422bf7){const _0x237b25=a187_0xacc429,_0x531da9=parseJsonParams(_0x422bf7[_0x237b25(0x19d)](_0x237b25(0x1ab))),_0xd16805=Date[_0x237b25(0x1a2)](),_0x2c4a7b=await executeSql(_0x422bf7[_0x237b25(0x19e)],_0x422bf7['str'](_0x237b25(0x1a0)),_0x531da9),_0x2dc1a8=Date[_0x237b25(0x1a2)]()-_0xd16805,_0x3d3173=_0x2c4a7b?.['execResult']??_0x2c4a7b,_0x352bdd=_0x2c4a7b?.[_0x237b25(0x1a3)]??!![];if(!_0x352bdd)return{'ok':![],'data':{'error':_0x2c4a7b?.[_0x237b25(0x1a7)]||_0x237b25(0x1ad),'elapsed':_0x2dc1a8},'message':_0x237b25(0x1ad)};const _0x15f577=Array[_0x237b25(0x199)](_0x3d3173)?_0x3d3173:[];return{'ok':!![],'data':{'rows':_0x15f577,'rowCount':_0x15f577[_0x237b25(0x1a1)],'elapsed':_0x2dc1a8},'message':_0x237b25(0x198)+_0x15f577['length']+_0x237b25(0x1a9)+_0x2dc1a8+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x484ced,_0x5c5ea0){const _0x15e712=a190_0x1f49,_0x39321c=_0x484ced();while(!![]){try{const _0x50906f=parseInt(_0x15e712(0x7e))/0x1*(parseInt(_0x15e712(0x7a))/0x2)+-parseInt(_0x15e712(0x81))/0x3+parseInt(_0x15e712(0x80))/0x4+-parseInt(_0x15e712(0x7f))/0x5+-parseInt(_0x15e712(0x7b))/0x6*(-parseInt(_0x15e712(0x82))/0x7)+-parseInt(_0x15e712(0x7c))/0x8*(-parseInt(_0x15e712(0x83))/0x9)+parseInt(_0x15e712(0x84))/0xa*(-parseInt(_0x15e712(0x7d))/0xb);if(_0x50906f===_0x5c5ea0)break;else _0x39321c['push'](_0x39321c['shift']());}catch(_0x3b6bba){_0x39321c['push'](_0x39321c['shift']());}}}(a190_0x594a,0x92462));import{sqlList}from'../../commands/sql/list.js';function a190_0x1f49(_0x129af8,_0x160786){_0x129af8=_0x129af8-0x7a;const _0x594a11=a190_0x594a();let _0x1f49b5=_0x594a11[_0x129af8];return _0x1f49b5;}import{sqlDetail}from'../../commands/sql/detail.js';function a190_0x594a(){const _0x92d19f=['239091sEwwUm','3016085rdZtRv','1289748BPTJrg','1680939gkFyHJ','1967BSKENI','9zXedVB','800VqfvIu','4RfPlvH','15864rKymcH','7391720qOtZqp','96921OYJPur'];a190_0x594a=function(){return _0x92d19f;};return a190_0x594a();}import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x1865a9,_0x285e83){const _0x28a8f4=a188_0x38dc,_0x2d4916=_0x1865a9();while(!![]){try{const _0x15d4e9=-parseInt(_0x28a8f4(0x147))/0x1*(-parseInt(_0x28a8f4(0x146))/0x2)+-parseInt(_0x28a8f4(0x149))/0x3*(parseInt(_0x28a8f4(0x145))/0x4)+parseInt(_0x28a8f4(0x14a))/0x5+parseInt(_0x28a8f4(0x142))/0x6+parseInt(_0x28a8f4(0x143))/0x7+-parseInt(_0x28a8f4(0x144))/0x8+parseInt(_0x28a8f4(0x148))/0x9;if(_0x15d4e9===_0x285e83)break;else _0x2d4916['push'](_0x2d4916['shift']());}catch(_0x564215){_0x2d4916['push'](_0x2d4916['shift']());}}}(a188_0xab37,0x39494));function a188_0xab37(){const _0x3badab=['32631LUjvrb','747710uEcSLE','18978ulpImM','2574831FHLbNw','3262160zUDtfs','84wmIMvC','6UdjYSo','105559MyKYbs','302544XFomCq'];a188_0xab37=function(){return _0x3badab;};return a188_0xab37();}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 a188_0x38dc(_0x4971e2,_0x5b63b4){_0x4971e2=_0x4971e2-0x142;const _0xab3736=a188_0xab37();let _0x38dca2=_0xab3736[_0x4971e2];return _0x38dca2;}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 a191_0x328210=a191_0x569f;(function(_0x504579,_0x3e9a5a){const _0xed6aca=a191_0x569f,_0x2426a6=_0x504579();while(!![]){try{const _0x5b6869=parseInt(_0xed6aca(0xa4))/0x1*(-parseInt(_0xed6aca(0xa3))/0x2)+parseInt(_0xed6aca(0x8c))/0x3+-parseInt(_0xed6aca(0x8f))/0x4*(parseInt(_0xed6aca(0x8e))/0x5)+-parseInt(_0xed6aca(0xa0))/0x6*(parseInt(_0xed6aca(0x9f))/0x7)+-parseInt(_0xed6aca(0xa1))/0x8+parseInt(_0xed6aca(0xac))/0x9+-parseInt(_0xed6aca(0x97))/0xa*(-parseInt(_0xed6aca(0xa5))/0xb);if(_0x5b6869===_0x3e9a5a)break;else _0x2426a6['push'](_0x2426a6['shift']());}catch(_0x58fdf7){_0x2426a6['push'](_0x2426a6['shift']());}}}(a191_0x4e69,0x89658));function a191_0x4e69(){const _0x169b5a=['32548FWjTRl','pagesize','totalCount','name','string','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','description','num','10dyAKPD','map','dbId','sqlName','boolean','page','appCode','all','287EiTsqJ','140040lwqkai','5424760YYuYtH','Page\x20size','8NpcLgj','262583aUFeHy','34139611WYHnRx','\x20SQL\x20queries\x20(total:\x20','Page\x20number','sql','tableData','list','bool','8396730LrYjik','paging','number','length','verbose','No\x20custom\x20SQL\x20queries\x20found.','sqlCode','637269bZxvWt','read','615LaOaqE'];a191_0x4e69=function(){return _0x169b5a;};return a191_0x4e69();}import{listSqlQueries}from'../../core/api-client.js';function a191_0x569f(_0x13f486,_0x4aa343){_0x13f486=_0x13f486-0x8b;const _0x4e6976=a191_0x4e69();let _0x569f54=_0x4e6976[_0x13f486];return _0x569f54;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a191_0x328210(0xa8),'command':a191_0x328210(0xaa),'description':'List\x20custom\x20SQL\x20queries','risk':a191_0x328210(0x8d),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a191_0x328210(0x92),'type':a191_0x328210(0x93),'description':'Filter\x20by\x20SQL\x20name'},{'name':a191_0x328210(0x9c),'type':a191_0x328210(0xae),'description':a191_0x328210(0xa7),'default':0x1},{'name':a191_0x328210(0x90),'type':a191_0x328210(0xae),'description':a191_0x328210(0xa2)},{'name':a191_0x328210(0xb0),'type':a191_0x328210(0x9b),'description':a191_0x328210(0x94)}],async 'execute'(_0x2d5738){const _0x3f25f5=a191_0x328210,_0xaaa87=await listSqlQueries(_0x2d5738[_0x3f25f5(0x9d)],{'sqlCode':_0x2d5738['str']('sqlcode')||undefined,'sqlName':_0x2d5738['str'](_0x3f25f5(0x92))||undefined,'currentPage':_0x2d5738[_0x3f25f5(0x96)](_0x3f25f5(0x9c)),'pageSize':_0x2d5738[_0x3f25f5(0x96)](_0x3f25f5(0x90),0x32)}),_0x6645db=_0x2d5738[_0x3f25f5(0xab)](_0x3f25f5(0xb0)),_0x212f8c=_0xaaa87[_0x3f25f5(0xa9)]??[],_0x592ace=_0xaaa87[_0x3f25f5(0xad)]?.[_0x3f25f5(0x91)]??_0x212f8c[_0x3f25f5(0xaf)];let _0x4a6266;return _0x6645db?_0x4a6266=_0x212f8c:_0x4a6266=await Promise[_0x3f25f5(0x9e)](_0x212f8c[_0x3f25f5(0x98)](async _0x5c83a4=>{const _0x54d0df=_0x3f25f5;let _0x327844;try{_0x327844=_0x5c83a4['dbId']?await getDbName(_0x2d5738['appCode'],_0x5c83a4[_0x54d0df(0x99)]):undefined;}catch{}return{'sqlCode':_0x5c83a4[_0x54d0df(0x8b)],'sqlName':_0x5c83a4[_0x54d0df(0x9a)],'description':_0x5c83a4[_0x54d0df(0x95)]??'','db':_0x327844?_0x327844+'\x20('+_0x5c83a4[_0x54d0df(0x99)]+')':_0x5c83a4[_0x54d0df(0x99)]??''};})),{'ok':!![],'data':_0x4a6266,'message':_0x212f8c[_0x3f25f5(0xaf)]===0x0?_0x3f25f5(0xb1):'Found\x20'+_0x212f8c['length']+_0x3f25f5(0xa6)+_0x592ace+').'};}};
1
+ const a189_0x4f3790=a189_0x2c0b;(function(_0x23f651,_0x7cebc4){const _0x23ef5f=a189_0x2c0b,_0x12faaa=_0x23f651();while(!![]){try{const _0x2368e7=-parseInt(_0x23ef5f(0xc2))/0x1*(parseInt(_0x23ef5f(0xbd))/0x2)+parseInt(_0x23ef5f(0xdb))/0x3*(-parseInt(_0x23ef5f(0xcc))/0x4)+parseInt(_0x23ef5f(0xd3))/0x5+parseInt(_0x23ef5f(0xda))/0x6+-parseInt(_0x23ef5f(0xd1))/0x7*(-parseInt(_0x23ef5f(0xbf))/0x8)+-parseInt(_0x23ef5f(0xce))/0x9*(-parseInt(_0x23ef5f(0xd6))/0xa)+-parseInt(_0x23ef5f(0xc1))/0xb;if(_0x2368e7===_0x7cebc4)break;else _0x12faaa['push'](_0x12faaa['shift']());}catch(_0x3c2681){_0x12faaa['push'](_0x12faaa['shift']());}}}(a189_0x1908,0x23efb));import{listSqlQueries}from'../../core/api-client.js';function a189_0x2c0b(_0xcb02eb,_0x4d900b){_0xcb02eb=_0xcb02eb-0xbc;const _0x190871=a189_0x1908();let _0x2c0bd8=_0x190871[_0xcb02eb];return _0x2c0bd8;}function a189_0x1908(){const _0x4b6b7=['Page\x20number','num','\x20SQL\x20queries\x20(total:\x20','634rJaYzD','length','8cmuyrq','sqlName','3264272LpDjHq','329XmRyxy','appCode','all','totalCount','boolean','map','List\x20custom\x20SQL\x20queries','No\x20custom\x20SQL\x20queries\x20found.','dbId','sqlCode','6080sCPXgZ','Page\x20size','207HFrkCo','str','tableData','488964ZqgNdM','pagesize','549770FwJSIS','Found\x20','Filter\x20by\x20SQL\x20name','114690iyHdMZ','read','sqlcode','string','1594602WXABeY','318ZxGCgJ','name','page','verbose','bool','paging'];a189_0x1908=function(){return _0x4b6b7;};return a189_0x1908();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':'list','description':a189_0x4f3790(0xc8),'risk':a189_0x4f3790(0xd7),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a189_0x4f3790(0xdc),'type':a189_0x4f3790(0xd9),'description':a189_0x4f3790(0xd5)},{'name':'page','type':'number','description':a189_0x4f3790(0xe1),'default':0x1},{'name':a189_0x4f3790(0xd2),'type':'number','description':a189_0x4f3790(0xcd)},{'name':a189_0x4f3790(0xde),'type':a189_0x4f3790(0xc6),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x4d0d69){const _0x32e65d=a189_0x4f3790,_0x39229d=await listSqlQueries(_0x4d0d69[_0x32e65d(0xc3)],{'sqlCode':_0x4d0d69[_0x32e65d(0xcf)](_0x32e65d(0xd8))||undefined,'sqlName':_0x4d0d69['str'](_0x32e65d(0xdc))||undefined,'currentPage':_0x4d0d69['num'](_0x32e65d(0xdd)),'pageSize':_0x4d0d69[_0x32e65d(0xe2)](_0x32e65d(0xd2),0x32)}),_0x4bf1c1=_0x4d0d69[_0x32e65d(0xdf)](_0x32e65d(0xde)),_0x1c3f68=_0x39229d[_0x32e65d(0xd0)]??[],_0x2ba7d4=_0x39229d[_0x32e65d(0xe0)]?.[_0x32e65d(0xc5)]??_0x1c3f68['length'];let _0x34309b;return _0x4bf1c1?_0x34309b=_0x1c3f68:_0x34309b=await Promise[_0x32e65d(0xc4)](_0x1c3f68[_0x32e65d(0xc7)](async _0x275c4a=>{const _0x4a3d4f=_0x32e65d;let _0x4779ff;try{_0x4779ff=_0x275c4a[_0x4a3d4f(0xca)]?await getDbName(_0x4d0d69[_0x4a3d4f(0xc3)],_0x275c4a[_0x4a3d4f(0xca)]):undefined;}catch{}return{'sqlCode':_0x275c4a[_0x4a3d4f(0xcb)],'sqlName':_0x275c4a[_0x4a3d4f(0xc0)],'description':_0x275c4a['description']??'','db':_0x4779ff?_0x4779ff+'\x20('+_0x275c4a['dbId']+')':_0x275c4a[_0x4a3d4f(0xca)]??''};})),{'ok':!![],'data':_0x34309b,'message':_0x1c3f68[_0x32e65d(0xbe)]===0x0?_0x32e65d(0xc9):_0x32e65d(0xd4)+_0x1c3f68[_0x32e65d(0xbe)]+_0x32e65d(0xbc)+_0x2ba7d4+').'};}};
@@ -1 +1 @@
1
- const a192_0x1dddcb=a192_0x4e3c;(function(_0x316028,_0x3aff87){const _0x50f2f0=a192_0x4e3c,_0x5de189=_0x316028();while(!![]){try{const _0x3ab260=parseInt(_0x50f2f0(0xf1))/0x1*(-parseInt(_0x50f2f0(0x116))/0x2)+-parseInt(_0x50f2f0(0x101))/0x3+-parseInt(_0x50f2f0(0xef))/0x4*(parseInt(_0x50f2f0(0xed))/0x5)+parseInt(_0x50f2f0(0xf4))/0x6+-parseInt(_0x50f2f0(0x11f))/0x7+parseInt(_0x50f2f0(0x10f))/0x8+parseInt(_0x50f2f0(0xfb))/0x9;if(_0x3ab260===_0x3aff87)break;else _0x5de189['push'](_0x5de189['shift']());}catch(_0x1891b6){_0x5de189['push'](_0x5de189['shift']());}}}(a192_0x4ba5,0xecb1f));function a192_0x4ba5(){const _0x1da3cc=['3550408vDYzCr','description','would_pull','sqlRoot','cancelled','boolean','Force\x20pull\x20cancelled.','2fImlZK','trimStart','pull','local\x20differs\x20from\x20remote','split','name','toISOString','\x20failed','skipped','12090344nyLlDY','Filter\x20by\x20SQL\x20display\x20name','sqlName','\x20SQL\x20file(s)\x20into\x20','push','appCode','sqlCode','lastSync','sqlContent','read','\x20skipped,\x20','5988045YDDxHt','str','4PtVdCv','mybatisXml','422314PBzrLE','path','sql','6158442PEIyoQ','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','Force\x20overwrite\x20local\x20unsynced\x20changes','length','join','Would\x20pull\x20','utf8','30224637wwvtWH','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','conflict','unchanged','sqlRootDir','1535649XIAWMt','bool','test','Pull\x20complete:\x20','message','totalCount','sqls','catch','dbId','nonInteractive','lockFilePath','sqlcode','\x20written,\x20','filter'];a192_0x4ba5=function(){return _0x1da3cc;};return a192_0x4ba5();}import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;function a192_0x4e3c(_0x406bfa,_0x1537df){_0x406bfa=_0x406bfa-0xe4;const _0x4ba5a9=a192_0x4ba5();let _0x4e3cca=_0x4ba5a9[_0x406bfa];return _0x4e3cca;}async function fetchAllSqlQueries(_0x999ed1,_0x47f71f){const _0x4f13ed=a192_0x4e3c,_0x3a9c1f=[];let _0x4dff49=0x1;while(!![]){const _0x4f8a4c=await listSqlQueries(_0x999ed1,{'currentPage':_0x4dff49,'pageSize':PAGE_SIZE,'sqlCode':_0x47f71f[_0x4f13ed(0xe8)],'sqlName':_0x47f71f[_0x4f13ed(0xe4)]}),_0x3f004a=_0x4f8a4c['tableData']??[];_0x3a9c1f['push'](..._0x3f004a);if(_0x3f004a['length']===0x0)break;const _0x132ec7=_0x4f8a4c['paging']?.[_0x4f13ed(0x106)];if(_0x132ec7!=null?_0x3a9c1f[_0x4f13ed(0xf7)]>=_0x132ec7:_0x3f004a[_0x4f13ed(0xf7)]<PAGE_SIZE)break;_0x4dff49++;}return _0x3a9c1f;}async function ensureSqlContent(_0x505253){const _0x149e19=a192_0x4e3c;if(_0x505253[_0x149e19(0xea)]!=null&&String(_0x505253[_0x149e19(0xea)])[_0x149e19(0xf7)]>0x0)return _0x505253;return getSqlQueryDetail(_0x505253['sqlCode']);}export const sqlPull={'service':a192_0x1dddcb(0xf3),'command':a192_0x1dddcb(0x118),'description':a192_0x1dddcb(0xfc),'risk':a192_0x1dddcb(0xeb),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a192_0x1dddcb(0x11b),'type':'string','description':a192_0x1dddcb(0x120)},{'name':'force','type':a192_0x1dddcb(0x114),'description':a192_0x1dddcb(0xf6)}],async 'dryRun'(_0x431178){const _0x1d72e9=a192_0x1dddcb,_0x47e735=loadSqlProjectConfig(_0x431178[_0x1d72e9(0xe7)]),_0x464908=await readSqlLockFile(_0x47e735[_0x1d72e9(0x10b)]),{appLock:_0x4dca2e}=ensureSqlLockScope(_0x464908??createEmptySqlLock(),_0x47e735[_0x1d72e9(0xe7)],_0x47e735[_0x1d72e9(0x112)],_0x1d72e9(0x118)),_0x1b1fea=await fetchAllSqlQueries(_0x431178[_0x1d72e9(0xe7)],{'sqlCode':_0x431178[_0x1d72e9(0xee)](_0x1d72e9(0x10c))||undefined,'sqlName':_0x431178['str'](_0x1d72e9(0x11b))||undefined}),_0x32188a=[];for(const _0xfa77b5 of _0x1b1fea){const _0x134179=await ensureSqlContent(_0xfa77b5),_0x505591=ensureRemoteSqlContent(_0x134179),_0x5780eb=detectModeFromSql(_0x134179),_0x2bb13f=_0x134179['dbId']?await getDbName(_0x431178[_0x1d72e9(0xe7)],Number(_0x134179['dbId']))[_0x1d72e9(0x108)](()=>undefined):undefined,_0x281fed=buildLocalSqlFileContent({'sqlCode':_0x134179[_0x1d72e9(0xe8)],'sqlName':_0x134179['sqlName'],'dbId':_0x134179[_0x1d72e9(0x109)]},_0x505591,{'dbName':_0x2bb13f,'mode':_0x5780eb,'syncedAt':new Date()[_0x1d72e9(0x11c)](),'description':_0x134179[_0x1d72e9(0x110)]}),_0x54bebe=buildSqlLockEntry(_0x134179,_0x505591,'',{'dbName':_0x2bb13f}),_0x59af08=resolveLocalSqlFilePath(_0x47e735,_0x134179['sqlCode'],_0x54bebe);let _0x4a8c4d=_0x1d72e9(0x111),_0x227ef4;if(await fileExists(_0x59af08)){const _0x8d4e40=await readFile(_0x59af08,_0x1d72e9(0xfa));isEquivalentPulledSqlFile(_0x8d4e40,_0x281fed,_0x5780eb)?(_0x4a8c4d=_0x1d72e9(0x11e),_0x227ef4=_0x1d72e9(0xff)):(_0x4a8c4d=_0x1d72e9(0xfe),_0x227ef4=_0x1d72e9(0xf5));}_0x32188a['push']({'sqlCode':_0x134179[_0x1d72e9(0xe8)],'sqlName':_0x134179[_0x1d72e9(0xe4)],'filePath':_0x59af08,'status':_0x4a8c4d,'reason':_0x227ef4});}return{'method':'POST','url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x431178['appCode'],'sqlCode':_0x431178[_0x1d72e9(0xee)]('sqlcode')||null,'sqlName':_0x431178[_0x1d72e9(0xee)](_0x1d72e9(0x11b))||null,'files':_0x32188a},'description':_0x1d72e9(0xf9)+_0x32188a[_0x1d72e9(0xf7)]+_0x1d72e9(0xe5)+_0x47e735['sqlRootDir']};},async 'execute'(_0x22c1af){const _0x228767=a192_0x1dddcb,_0x535aea=loadSqlProjectConfig(_0x22c1af[_0x228767(0xe7)]),_0x2315e5=await readSqlLockFile(_0x535aea[_0x228767(0x10b)]),{lockData:_0x1acb4d,appLock:_0x2c7b56}=ensureSqlLockScope(_0x2315e5??createEmptySqlLock(),_0x535aea['appCode'],_0x535aea[_0x228767(0x112)],_0x228767(0x118)),_0x1a4a50=_0x22c1af[_0x228767(0x102)]('force'),_0x233038=await fetchAllSqlQueries(_0x22c1af[_0x228767(0xe7)],{'sqlCode':_0x22c1af[_0x228767(0xee)](_0x228767(0x10c))||undefined,'sqlName':_0x22c1af['str']('name')||undefined});if(_0x233038['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x387a98=[],_0x3aa425=[];for(const _0x4815bd of _0x233038){try{_0x387a98[_0x228767(0xe6)](await ensureSqlContent(_0x4815bd));}catch(_0x531d72){_0x3aa425[_0x228767(0xe6)]({'sqlCode':_0x4815bd['sqlCode'],'error':_0x531d72 instanceof Error?_0x531d72['message']:String(_0x531d72)});}}if(_0x1a4a50&&!_0x22c1af[_0x228767(0x10a)]){let _0x434a2f=![];for(const _0x43cc64 of _0x387a98){const _0x431514=detectModeFromSql(_0x43cc64),_0x58bdd7=_0x43cc64[_0x228767(0x109)]?await getDbName(_0x22c1af['appCode'],Number(_0x43cc64[_0x228767(0x109)]))[_0x228767(0x108)](()=>undefined):undefined,_0x479491=buildLocalSqlFileContent({'sqlCode':_0x43cc64[_0x228767(0xe8)],'sqlName':_0x43cc64[_0x228767(0xe4)],'dbId':_0x43cc64[_0x228767(0x109)]},ensureRemoteSqlContent(_0x43cc64),{'dbName':_0x58bdd7,'mode':_0x431514,'syncedAt':new Date()[_0x228767(0x11c)](),'description':_0x43cc64['description']}),_0x514ffa=resolveLocalSqlFilePath(_0x535aea,_0x43cc64[_0x228767(0xe8)],buildSqlLockEntry(_0x43cc64,ensureRemoteSqlContent(_0x43cc64),'',{'dbName':_0x58bdd7}));if(await fileExists(_0x514ffa)){const _0x1e3d54=await readFile(_0x514ffa,_0x228767(0xfa));if(!isEquivalentPulledSqlFile(_0x1e3d54,_0x479491,_0x431514)){_0x434a2f=!![];break;}}}if(_0x434a2f){const _0x2e505c=await confirmForceOverwrite(_0x228767(0xfd));if(!_0x2e505c)throw CliErrors[_0x228767(0x113)](_0x228767(0x115));}}const _0x4681c4=cloneSqlLockData(_0x1acb4d),_0x12f29f=_0x4681c4['apps'][_0x535aea['appCode']],_0x4efa00=[],_0x43658b=[];for(const _0x5ba5e1 of _0x387a98){const _0x167c66=_0x12f29f['sqls'][_0x5ba5e1['sqlCode']],_0x32b179=ensureRemoteSqlContent(_0x5ba5e1),_0x568086=detectModeFromSql(_0x5ba5e1),_0x5309a2=_0x5ba5e1[_0x228767(0x109)]?await getDbName(_0x22c1af[_0x228767(0xe7)],Number(_0x5ba5e1[_0x228767(0x109)]))[_0x228767(0x108)](()=>undefined):undefined,_0x4c1960=buildLocalSqlFileContent({'sqlCode':_0x5ba5e1['sqlCode'],'sqlName':_0x5ba5e1[_0x228767(0xe4)],'dbId':_0x5ba5e1[_0x228767(0x109)]},_0x32b179,{'dbName':_0x5309a2,'mode':_0x568086,'syncedAt':new Date()[_0x228767(0x11c)](),'description':_0x5ba5e1[_0x228767(0x110)]}),_0x19e7bc=buildSqlLockEntry(_0x5ba5e1,_0x32b179,computeSqlContentHash(_0x4c1960),{'dbName':_0x5309a2}),_0x1e2eca=_0x19e7bc[_0x228767(0xf2)],_0x3435e0=join(_0x535aea[_0x228767(0x100)],_0x1e2eca);try{if(await fileExists(_0x3435e0)){const _0x4006a1=await readFile(_0x3435e0,_0x228767(0xfa));if(isEquivalentPulledSqlFile(_0x4006a1,_0x4c1960,_0x568086)){_0x43658b[_0x228767(0xe6)]({'sqlCode':_0x5ba5e1['sqlCode'],'reason':_0x228767(0xff)}),_0x12f29f[_0x228767(0x107)][_0x5ba5e1[_0x228767(0xe8)]]={..._0x19e7bc,'hash':computeSqlContentHash(_0x4006a1),'path':_0x1e2eca};continue;}if(!_0x1a4a50){_0x43658b[_0x228767(0xe6)]({'sqlCode':_0x5ba5e1['sqlCode'],'reason':_0x228767(0x119)});continue;}}const _0x68c85c=_0x167c66?.[_0x228767(0xf2)]?join(_0x535aea[_0x228767(0x100)],_0x167c66[_0x228767(0xf2)]):undefined;_0x68c85c&&_0x68c85c!==_0x3435e0&&await fileExists(_0x68c85c)&&await rm(_0x68c85c,{'force':!![]}),await ensureParentDirectory(_0x3435e0),await writeFile(_0x3435e0,_0x4c1960,_0x228767(0xfa)),_0x12f29f[_0x228767(0x107)][_0x5ba5e1[_0x228767(0xe8)]]={..._0x19e7bc,'path':_0x1e2eca},_0x4efa00['push']({'sqlCode':_0x5ba5e1[_0x228767(0xe8)],'filePath':_0x3435e0});}catch(_0x1c7323){_0x3aa425[_0x228767(0xe6)]({'sqlCode':_0x5ba5e1[_0x228767(0xe8)],'error':_0x1c7323 instanceof Error?_0x1c7323[_0x228767(0x105)]:String(_0x1c7323)});}}return _0x12f29f[_0x228767(0xe9)]=new Date()[_0x228767(0x11c)](),await writeSqlLockFile(_0x535aea[_0x228767(0x10b)],_0x4681c4),{'ok':_0x3aa425[_0x228767(0xf7)]===0x0,'data':{'pulled':_0x4efa00,'skipped':_0x43658b,'failed':_0x3aa425},'message':_0x228767(0x104)+_0x4efa00[_0x228767(0xf7)]+_0x228767(0x10d)+_0x43658b[_0x228767(0xf7)]+_0x228767(0xec)+_0x3aa425[_0x228767(0xf7)]+_0x228767(0x11d)};}};function detectModeFromSql(_0x5b6604){const _0xdb7adb=a192_0x1dddcb,_0x5c3238=ensureRemoteSqlContent(_0x5b6604),_0x55ac6a=stripLocalSqlMetadata(_0x5c3238,_0xdb7adb(0xf0))[_0xdb7adb(0x117)]();if(/^<(select|insert|update|delete)\b/i[_0xdb7adb(0x103)](_0x55ac6a))return _0xdb7adb(0xf0);return _0xdb7adb(0xf3);}function isEquivalentPulledSqlFile(_0x2c7e07,_0x4b4a5a,_0x343599){return normalizePullComparableContent(_0x2c7e07,_0x343599)===normalizePullComparableContent(_0x4b4a5a,_0x343599);}function normalizePullComparableContent(_0x5d4b12,_0x21b2f4){const _0xb1caa0=a192_0x1dddcb,_0x24495e=_0x5d4b12['replace'](/\r\n/g,'\x0a')[_0xb1caa0(0x11a)]('\x0a'),_0x51e479=_0x24495e[_0xb1caa0(0x10e)](_0x37a3f1=>!isSyncedAtMetadataLine(_0x37a3f1,_0x21b2f4));return _0x51e479[_0xb1caa0(0xf8)]('\x0a');}function isSyncedAtMetadataLine(_0x18f557,_0x2c5d85){const _0x352b84=a192_0x1dddcb;if(_0x2c5d85===_0x352b84(0xf0))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x352b84(0x103)](_0x18f557);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x352b84(0x103)](_0x18f557);}
1
+ const a190_0x2813b0=a190_0xc3cd;(function(_0x21daad,_0x4ffd02){const _0x4f181e=a190_0xc3cd,_0x29e582=_0x21daad();while(!![]){try{const _0x2bd483=parseInt(_0x4f181e(0x181))/0x1*(parseInt(_0x4f181e(0x177))/0x2)+-parseInt(_0x4f181e(0x167))/0x3*(-parseInt(_0x4f181e(0x192))/0x4)+parseInt(_0x4f181e(0x18f))/0x5*(-parseInt(_0x4f181e(0x175))/0x6)+-parseInt(_0x4f181e(0x190))/0x7+-parseInt(_0x4f181e(0x17d))/0x8+parseInt(_0x4f181e(0x194))/0x9+-parseInt(_0x4f181e(0x182))/0xa*(parseInt(_0x4f181e(0x172))/0xb);if(_0x2bd483===_0x4ffd02)break;else _0x29e582['push'](_0x29e582['shift']());}catch(_0x274208){_0x29e582['push'](_0x29e582['shift']());}}}(a190_0x5541,0x8a5d7));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;function a190_0xc3cd(_0x4f9fb1,_0x3c92bd){_0x4f9fb1=_0x4f9fb1-0x161;const _0x554158=a190_0x5541();let _0xc3cde1=_0x554158[_0x4f9fb1];return _0xc3cde1;}async function fetchAllSqlQueries(_0x3d1a3c,_0x1f5831){const _0x322970=a190_0xc3cd,_0x3dfa44=[];let _0x591bf2=0x1;while(!![]){const _0x3e0abf=await listSqlQueries(_0x3d1a3c,{'currentPage':_0x591bf2,'pageSize':PAGE_SIZE,'sqlCode':_0x1f5831['sqlCode'],'sqlName':_0x1f5831[_0x322970(0x161)]}),_0x12cc9d=_0x3e0abf[_0x322970(0x18e)]??[];_0x3dfa44['push'](..._0x12cc9d);if(_0x12cc9d[_0x322970(0x17f)]===0x0)break;const _0x218829=_0x3e0abf[_0x322970(0x196)]?.['totalCount'];if(_0x218829!=null?_0x3dfa44[_0x322970(0x17f)]>=_0x218829:_0x12cc9d[_0x322970(0x17f)]<PAGE_SIZE)break;_0x591bf2++;}return _0x3dfa44;}function a190_0x5541(){const _0xb4cbe=['\x20failed','would_pull','492696OulldB','unchanged','length','description','25PXknTc','7880fMXGty','nonInteractive','sqlContent','dbId','POST','path','force','str','test','cancelled','boolean','Force\x20pull\x20cancelled.','tableData','5DlLHPG','1565326PhiKZx','\x20written,\x20','10228OenwAP','replace','7889202WIdLFT','name','paging','trimStart','toISOString','message','sqlCode','mybatisXml','sqlName','push','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sqlRootDir','sqlRoot','sqls','687itCcHo','\x20SQL\x20file(s)\x20into\x20','lockFilePath','conflict','lastSync','split','sqlcode','pull','Pull\x20complete:\x20','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','local\x20differs\x20from\x20remote','7645wdicJM','filter','appCode','878988xZfYge','No\x20remote\x20SQL\x20queries\x20matched.','6718vAaoUH','apps','catch','utf8'];a190_0x5541=function(){return _0xb4cbe;};return a190_0x5541();}async function ensureSqlContent(_0x13313a){const _0x554fd4=a190_0xc3cd;if(_0x13313a[_0x554fd4(0x184)]!=null&&String(_0x13313a[_0x554fd4(0x184)])[_0x554fd4(0x17f)]>0x0)return _0x13313a;return getSqlQueryDetail(_0x13313a['sqlCode']);}export const sqlPull={'service':'sql','command':a190_0x2813b0(0x16e),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':'string','description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a190_0x2813b0(0x188),'type':a190_0x2813b0(0x18c),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x5b5b64){const _0x663c22=a190_0x2813b0,_0x14a1c1=loadSqlProjectConfig(_0x5b5b64[_0x663c22(0x174)]),_0x241efb=await readSqlLockFile(_0x14a1c1[_0x663c22(0x169)]),{appLock:_0x3b48f0}=ensureSqlLockScope(_0x241efb??createEmptySqlLock(),_0x14a1c1[_0x663c22(0x174)],_0x14a1c1[_0x663c22(0x165)],_0x663c22(0x16e)),_0x371720=await fetchAllSqlQueries(_0x5b5b64[_0x663c22(0x174)],{'sqlCode':_0x5b5b64[_0x663c22(0x189)](_0x663c22(0x16d))||undefined,'sqlName':_0x5b5b64[_0x663c22(0x189)](_0x663c22(0x195))||undefined}),_0x259737=[];for(const _0x23fc81 of _0x371720){const _0x1aeb64=await ensureSqlContent(_0x23fc81),_0x1928f6=ensureRemoteSqlContent(_0x1aeb64),_0x1d7ce5=detectModeFromSql(_0x1aeb64),_0x1e0eb7=_0x1aeb64['dbId']?await getDbName(_0x5b5b64[_0x663c22(0x174)],Number(_0x1aeb64['dbId']))[_0x663c22(0x179)](()=>undefined):undefined,_0x3a1038=buildLocalSqlFileContent({'sqlCode':_0x1aeb64[_0x663c22(0x19a)],'sqlName':_0x1aeb64[_0x663c22(0x161)],'dbId':_0x1aeb64[_0x663c22(0x185)]},_0x1928f6,{'dbName':_0x1e0eb7,'mode':_0x1d7ce5,'syncedAt':new Date()[_0x663c22(0x198)](),'description':_0x1aeb64[_0x663c22(0x180)]}),_0x25df72=buildSqlLockEntry(_0x1aeb64,_0x1928f6,'',{'dbName':_0x1e0eb7}),_0x1b2da3=resolveLocalSqlFilePath(_0x14a1c1,_0x1aeb64[_0x663c22(0x19a)],_0x25df72);let _0xd959d3=_0x663c22(0x17c),_0x489b2a;if(await fileExists(_0x1b2da3)){const _0x55c570=await readFile(_0x1b2da3,_0x663c22(0x17a));isEquivalentPulledSqlFile(_0x55c570,_0x3a1038,_0x1d7ce5)?(_0xd959d3='skipped',_0x489b2a=_0x663c22(0x17e)):(_0xd959d3=_0x663c22(0x16a),_0x489b2a=_0x663c22(0x163));}_0x259737[_0x663c22(0x162)]({'sqlCode':_0x1aeb64[_0x663c22(0x19a)],'sqlName':_0x1aeb64[_0x663c22(0x161)],'filePath':_0x1b2da3,'status':_0xd959d3,'reason':_0x489b2a});}return{'method':_0x663c22(0x186),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x5b5b64['appCode'],'sqlCode':_0x5b5b64[_0x663c22(0x189)](_0x663c22(0x16d))||null,'sqlName':_0x5b5b64[_0x663c22(0x189)](_0x663c22(0x195))||null,'files':_0x259737},'description':'Would\x20pull\x20'+_0x259737[_0x663c22(0x17f)]+_0x663c22(0x168)+_0x14a1c1[_0x663c22(0x164)]};},async 'execute'(_0x27f8f7){const _0xb3fafc=a190_0x2813b0,_0x4f948c=loadSqlProjectConfig(_0x27f8f7['appCode']),_0x594b3b=await readSqlLockFile(_0x4f948c[_0xb3fafc(0x169)]),{lockData:_0x52d0cf,appLock:_0x2c28b7}=ensureSqlLockScope(_0x594b3b??createEmptySqlLock(),_0x4f948c['appCode'],_0x4f948c[_0xb3fafc(0x165)],'pull'),_0x31c155=_0x27f8f7['bool']('force'),_0x362032=await fetchAllSqlQueries(_0x27f8f7[_0xb3fafc(0x174)],{'sqlCode':_0x27f8f7[_0xb3fafc(0x189)](_0xb3fafc(0x16d))||undefined,'sqlName':_0x27f8f7[_0xb3fafc(0x189)]('name')||undefined});if(_0x362032[_0xb3fafc(0x17f)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0xb3fafc(0x176)};const _0x5cb672=[],_0x236e41=[];for(const _0x56c8f8 of _0x362032){try{_0x5cb672[_0xb3fafc(0x162)](await ensureSqlContent(_0x56c8f8));}catch(_0x371b32){_0x236e41[_0xb3fafc(0x162)]({'sqlCode':_0x56c8f8[_0xb3fafc(0x19a)],'error':_0x371b32 instanceof Error?_0x371b32[_0xb3fafc(0x199)]:String(_0x371b32)});}}if(_0x31c155&&!_0x27f8f7[_0xb3fafc(0x183)]){let _0x4d2140=![];for(const _0x482c37 of _0x5cb672){const _0x10f6de=detectModeFromSql(_0x482c37),_0x36117=_0x482c37['dbId']?await getDbName(_0x27f8f7[_0xb3fafc(0x174)],Number(_0x482c37['dbId']))[_0xb3fafc(0x179)](()=>undefined):undefined,_0x4f9b94=buildLocalSqlFileContent({'sqlCode':_0x482c37[_0xb3fafc(0x19a)],'sqlName':_0x482c37[_0xb3fafc(0x161)],'dbId':_0x482c37[_0xb3fafc(0x185)]},ensureRemoteSqlContent(_0x482c37),{'dbName':_0x36117,'mode':_0x10f6de,'syncedAt':new Date()[_0xb3fafc(0x198)](),'description':_0x482c37[_0xb3fafc(0x180)]}),_0x3961db=resolveLocalSqlFilePath(_0x4f948c,_0x482c37['sqlCode'],buildSqlLockEntry(_0x482c37,ensureRemoteSqlContent(_0x482c37),'',{'dbName':_0x36117}));if(await fileExists(_0x3961db)){const _0x246302=await readFile(_0x3961db,_0xb3fafc(0x17a));if(!isEquivalentPulledSqlFile(_0x246302,_0x4f9b94,_0x10f6de)){_0x4d2140=!![];break;}}}if(_0x4d2140){const _0x1de220=await confirmForceOverwrite(_0xb3fafc(0x170));if(!_0x1de220)throw CliErrors[_0xb3fafc(0x18b)](_0xb3fafc(0x18d));}}const _0x290619=cloneSqlLockData(_0x52d0cf),_0x117cf7=_0x290619[_0xb3fafc(0x178)][_0x4f948c[_0xb3fafc(0x174)]],_0x20baa5=[],_0x28103d=[];for(const _0xa50f48 of _0x5cb672){const _0x340242=_0x117cf7[_0xb3fafc(0x166)][_0xa50f48[_0xb3fafc(0x19a)]],_0x51048f=ensureRemoteSqlContent(_0xa50f48),_0x5e7eae=detectModeFromSql(_0xa50f48),_0x455393=_0xa50f48[_0xb3fafc(0x185)]?await getDbName(_0x27f8f7[_0xb3fafc(0x174)],Number(_0xa50f48[_0xb3fafc(0x185)]))[_0xb3fafc(0x179)](()=>undefined):undefined,_0x496cc8=buildLocalSqlFileContent({'sqlCode':_0xa50f48[_0xb3fafc(0x19a)],'sqlName':_0xa50f48[_0xb3fafc(0x161)],'dbId':_0xa50f48[_0xb3fafc(0x185)]},_0x51048f,{'dbName':_0x455393,'mode':_0x5e7eae,'syncedAt':new Date()[_0xb3fafc(0x198)](),'description':_0xa50f48['description']}),_0x1680c2=buildSqlLockEntry(_0xa50f48,_0x51048f,computeSqlContentHash(_0x496cc8),{'dbName':_0x455393}),_0x3d6c2d=_0x1680c2['path'],_0x4d8d4c=join(_0x4f948c[_0xb3fafc(0x164)],_0x3d6c2d);try{if(await fileExists(_0x4d8d4c)){const _0x3ee297=await readFile(_0x4d8d4c,_0xb3fafc(0x17a));if(isEquivalentPulledSqlFile(_0x3ee297,_0x496cc8,_0x5e7eae)){_0x28103d[_0xb3fafc(0x162)]({'sqlCode':_0xa50f48['sqlCode'],'reason':_0xb3fafc(0x17e)}),_0x117cf7[_0xb3fafc(0x166)][_0xa50f48[_0xb3fafc(0x19a)]]={..._0x1680c2,'hash':computeSqlContentHash(_0x3ee297),'path':_0x3d6c2d};continue;}if(!_0x31c155){_0x28103d[_0xb3fafc(0x162)]({'sqlCode':_0xa50f48[_0xb3fafc(0x19a)],'reason':_0xb3fafc(0x171)});continue;}}const _0x518c15=_0x340242?.[_0xb3fafc(0x187)]?join(_0x4f948c['sqlRootDir'],_0x340242[_0xb3fafc(0x187)]):undefined;_0x518c15&&_0x518c15!==_0x4d8d4c&&await fileExists(_0x518c15)&&await rm(_0x518c15,{'force':!![]}),await ensureParentDirectory(_0x4d8d4c),await writeFile(_0x4d8d4c,_0x496cc8,_0xb3fafc(0x17a)),_0x117cf7[_0xb3fafc(0x166)][_0xa50f48[_0xb3fafc(0x19a)]]={..._0x1680c2,'path':_0x3d6c2d},_0x20baa5[_0xb3fafc(0x162)]({'sqlCode':_0xa50f48[_0xb3fafc(0x19a)],'filePath':_0x4d8d4c});}catch(_0x31ab20){_0x236e41[_0xb3fafc(0x162)]({'sqlCode':_0xa50f48['sqlCode'],'error':_0x31ab20 instanceof Error?_0x31ab20[_0xb3fafc(0x199)]:String(_0x31ab20)});}}return _0x117cf7[_0xb3fafc(0x16b)]=new Date()['toISOString'](),await writeSqlLockFile(_0x4f948c[_0xb3fafc(0x169)],_0x290619),{'ok':_0x236e41[_0xb3fafc(0x17f)]===0x0,'data':{'pulled':_0x20baa5,'skipped':_0x28103d,'failed':_0x236e41},'message':_0xb3fafc(0x16f)+_0x20baa5[_0xb3fafc(0x17f)]+_0xb3fafc(0x191)+_0x28103d['length']+'\x20skipped,\x20'+_0x236e41['length']+_0xb3fafc(0x17b)};}};function detectModeFromSql(_0x2f7ffa){const _0x320a28=a190_0x2813b0,_0xb73da3=ensureRemoteSqlContent(_0x2f7ffa),_0x4cea23=stripLocalSqlMetadata(_0xb73da3,_0x320a28(0x19b))[_0x320a28(0x197)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x4cea23))return _0x320a28(0x19b);return'sql';}function isEquivalentPulledSqlFile(_0x24f5b9,_0x4ffed1,_0x222214){return normalizePullComparableContent(_0x24f5b9,_0x222214)===normalizePullComparableContent(_0x4ffed1,_0x222214);}function normalizePullComparableContent(_0x3aa39f,_0x101176){const _0x464643=a190_0x2813b0,_0x22ce69=_0x3aa39f[_0x464643(0x193)](/\r\n/g,'\x0a')[_0x464643(0x16c)]('\x0a'),_0x22bd55=_0x22ce69[_0x464643(0x173)](_0x4203e1=>!isSyncedAtMetadataLine(_0x4203e1,_0x101176));return _0x22bd55['join']('\x0a');}function isSyncedAtMetadataLine(_0x1489cc,_0xc1c30e){const _0x3ae4f5=a190_0x2813b0;if(_0xc1c30e===_0x3ae4f5(0x19b))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x3ae4f5(0x18a)](_0x1489cc);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x1489cc);}
@@ -1 +1 @@
1
- const a193_0x31e9d3=a193_0x5f44;(function(_0xedad1a,_0x34914b){const _0x2bcaea=a193_0x5f44,_0x2252fe=_0xedad1a();while(!![]){try{const _0xfcfa44=parseInt(_0x2bcaea(0x9e))/0x1+-parseInt(_0x2bcaea(0x9a))/0x2*(-parseInt(_0x2bcaea(0x9b))/0x3)+-parseInt(_0x2bcaea(0x86))/0x4+-parseInt(_0x2bcaea(0x8b))/0x5*(parseInt(_0x2bcaea(0xb3))/0x6)+parseInt(_0x2bcaea(0x90))/0x7+-parseInt(_0x2bcaea(0x8c))/0x8+parseInt(_0x2bcaea(0xa9))/0x9;if(_0xfcfa44===_0x34914b)break;else _0x2252fe['push'](_0x2252fe['shift']());}catch(_0x3643d1){_0x2252fe['push'](_0x2252fe['shift']());}}}(a193_0x170a,0x40bee));function a193_0x5f44(_0x38082b,_0x1dee3d){_0x38082b=_0x38082b-0x7e;const _0x170aa1=a193_0x170a();let _0x5f443d=_0x170aa1[_0x38082b];return _0x5f443d;}import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';function a193_0x170a(){const _0x56fd1a=['isFinite','\x20failed','filter','entries','filePath','762fOPFNa','join','version','\x20SQL\x20file(s)','has','sqlcode','mode','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','trashDir','map','utf8','path','appCode','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','catch','push','\x20skipped,\x20','659676EYkOrN','POST','toISOString','sql','force','14040yhKyXp','1708688actTGi','\x20pushed,\x20','No\x20database\x20matches\x20local\x20directory\x20\x22','sqlName','1468019WoucEX','sqlRoot','sqls','validation','dbId','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','set','relativePath','dbName','sqlConfig','32618wSfOht','48KATekO','bool','Local\x20SQL\x20not\x20found:\x20','290506UZsJIN','remoteId','replace','dbDirectory','str','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','lockFilePath','message','length','projectRoot','sqlCode','2152368RrNrJx','hash','get','write','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'];a193_0x170a=function(){return _0x56fd1a;};return a193_0x170a();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x1db961,_0x397966,_0x3143bb){const _0x2ef3c8=a193_0x5f44,_0x597323=await scanLocalSqlQueries(_0x1db961),_0xe33e71=new Map();for(const _0x557d9d of _0x597323){if(_0x3143bb&&_0x557d9d[_0x2ef3c8(0xa8)]!==_0x3143bb)continue;const _0x4c4718=_0xe33e71[_0x2ef3c8(0xab)](_0x557d9d[_0x2ef3c8(0xa8)])??[];_0x4c4718['push'](_0x557d9d),_0xe33e71[_0x2ef3c8(0x96)](_0x557d9d[_0x2ef3c8(0xa8)],_0x4c4718);}if(_0x3143bb&&!_0xe33e71[_0x2ef3c8(0xb7)](_0x3143bb))throw CliErrors[_0x2ef3c8(0x93)](_0x2ef3c8(0x9d)+_0x3143bb);const _0x45081c=[];for(const [_0x5abab3,_0x51367b]of _0xe33e71[_0x2ef3c8(0xb1)]()){if(_0x51367b[_0x2ef3c8(0xa6)]===0x1){_0x45081c[_0x2ef3c8(0x84)](_0x51367b[0x0]);continue;}const _0x174758=_0x397966[_0x2ef3c8(0x92)][_0x5abab3],_0x2d86f0=_0x174758?.[_0x2ef3c8(0x80)],_0x3a9334=_0x2d86f0?_0x51367b[_0x2ef3c8(0xb0)](_0x5d8b55=>_0x5d8b55[_0x2ef3c8(0x97)]!==_0x2d86f0):_0x51367b;if(_0x174758&&_0x3a9334[_0x2ef3c8(0xa6)]===0x1){_0x45081c['push'](_0x3a9334[0x0]);continue;}throw CliErrors[_0x2ef3c8(0x93)](_0x2ef3c8(0xba)+_0x5abab3+_0x2ef3c8(0x95));}return _0x45081c;}export const sqlPush={'service':a193_0x31e9d3(0x89),'command':'push','description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a193_0x31e9d3(0xac),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':'boolean','description':a193_0x31e9d3(0xa3)}],async 'dryRun'(_0x9c7900){const _0x91edd8=a193_0x31e9d3,_0xf742b0=loadSqlProjectConfig(_0x9c7900['appCode']),_0x526ba1=await readSqlLockFile(_0xf742b0[_0x91edd8(0xa4)]),{appLock:_0x3ca7b3}=ensureSqlLockScope(_0x526ba1??createEmptySqlLock(),_0x9c7900[_0x91edd8(0x81)],_0xf742b0[_0x91edd8(0x91)],_0x91edd8(0x84)),_0x296d34=await getTargetSqlQueries(_0xf742b0,_0x3ca7b3,_0x9c7900[_0x91edd8(0xa2)](_0x91edd8(0xb8))||undefined),_0x2a24f1=[];for(const _0x43fe4e of _0x296d34){const _0x5d3973=await computeSqlFileHash(_0x43fe4e[_0x91edd8(0xb2)]),_0x3deb71=_0x3ca7b3[_0x91edd8(0x92)][_0x43fe4e[_0x91edd8(0xa8)]],_0x1a78f3=!!_0x3deb71&&(_0x3deb71[_0x91edd8(0x80)]!==_0x43fe4e[_0x91edd8(0x97)]||!!_0x43fe4e['sqlName']&&_0x3deb71[_0x91edd8(0x8f)]!==_0x43fe4e['sqlName']);if(!_0x9c7900['bool'](_0x91edd8(0x8a))&&_0x3deb71&&_0x3deb71['hash']===_0x5d3973&&!_0x1a78f3)continue;_0x2a24f1[_0x91edd8(0x84)](_0x43fe4e[_0x91edd8(0xa8)]);}return{'method':_0x91edd8(0x87),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x2a24f1,'appCode':_0x9c7900[_0x91edd8(0x81)]},'description':'Would\x20push\x20'+_0x2a24f1[_0x91edd8(0xa6)]+_0x91edd8(0xb6)};},async 'execute'(_0x20b5a1){const _0x28a331=a193_0x31e9d3,_0xfdd34e=loadSqlProjectConfig(_0x20b5a1[_0x28a331(0x81)]),_0x47f22b=await readSqlLockFile(_0xfdd34e[_0x28a331(0xa4)]),{lockData:_0x3ecb7c,appLock:_0x506608}=ensureSqlLockScope(_0x47f22b??createEmptySqlLock(),_0x20b5a1[_0x28a331(0x81)],_0xfdd34e[_0x28a331(0x91)],'push'),_0x1c771f=await getTargetSqlQueries(_0xfdd34e,_0x506608,_0x20b5a1[_0x28a331(0xa2)](_0x28a331(0xb8))||undefined);if(_0x1c771f[_0x28a331(0xa6)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x3153a8=[],_0x49a3d8=[],_0x26bbe8=[];for(const _0x535815 of _0x1c771f){const _0x1bfa9b=_0x506608['sqls'][_0x535815[_0x28a331(0xa8)]];if(!_0x1bfa9b){_0x26bbe8[_0x28a331(0x84)]({'sqlCode':_0x535815[_0x28a331(0xa8)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x5a39d1=await computeSqlFileHash(_0x535815[_0x28a331(0xb2)]),_0x27f6b8=_0x1bfa9b['path']!==_0x535815[_0x28a331(0x97)]||!!_0x535815['sqlName']&&_0x1bfa9b[_0x28a331(0x8f)]!==_0x535815['sqlName'];if(!_0x20b5a1[_0x28a331(0x9c)](_0x28a331(0x8a))&&_0x1bfa9b[_0x28a331(0xaa)]===_0x5a39d1&&!_0x27f6b8){_0x49a3d8[_0x28a331(0x84)]({'sqlCode':_0x535815[_0x28a331(0xa8)],'reason':'unchanged'});continue;}if(_0x1bfa9b[_0x28a331(0xb5)]==null){_0x26bbe8[_0x28a331(0x84)]({'sqlCode':_0x535815[_0x28a331(0xa8)],'error':_0x28a331(0xad)});continue;}const _0x3f1275=await readFile(_0x535815[_0x28a331(0xb2)],_0x28a331(0x7f)),_0x5ab461=stripLocalSqlMetadata(_0x3f1275,_0x535815[_0x28a331(0xb9)]),_0x57bf2a=_0x535815[_0x28a331(0x8f)]||_0x1bfa9b[_0x28a331(0x8f)],_0x3994b5=await resolveTargetDbBinding(_0x20b5a1['appCode'],_0x535815,_0x1bfa9b),_0x457f1b=await updateSqlQuery({'id':_0x1bfa9b['remoteId'],'appCode':_0x20b5a1[_0x28a331(0x81)],'sqlCode':_0x535815['sqlCode'],'sqlName':_0x57bf2a,'dbId':_0x3994b5[_0x28a331(0x94)],'version':_0x1bfa9b['version'],'sqlContent':_0x5ab461,'sqlConfig':_0x1bfa9b[_0x28a331(0x99)]??undefined}),_0x6e0fa8=_0x457f1b[_0x28a331(0x94)]?await getDbName(_0x20b5a1[_0x28a331(0x81)],Number(_0x457f1b[_0x28a331(0x94)]))[_0x28a331(0x83)](()=>_0x3994b5[_0x28a331(0x98)]):_0x3994b5[_0x28a331(0x98)];_0x506608[_0x28a331(0x92)][_0x535815[_0x28a331(0xa8)]]={...buildSqlLockEntry(_0x457f1b,_0x5ab461,_0x5a39d1,{'dbName':_0x6e0fa8}),'path':_0x535815[_0x28a331(0x97)],'mode':_0x1bfa9b[_0x28a331(0xb9)]},await archivePreviousSqlFileIfNeeded(_0xfdd34e,_0x1bfa9b[_0x28a331(0x80)],_0x535815['relativePath']),_0x3153a8[_0x28a331(0x84)]({'sqlCode':_0x535815[_0x28a331(0xa8)],'remoteId':_0x1bfa9b[_0x28a331(0x9f)]});}catch(_0x38efb9){_0x26bbe8[_0x28a331(0x84)]({'sqlCode':_0x535815[_0x28a331(0xa8)],'error':_0x38efb9 instanceof Error?_0x38efb9[_0x28a331(0xa5)]:String(_0x38efb9)});}}return _0x506608['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0xfdd34e[_0x28a331(0xa4)],_0x3ecb7c),{'ok':_0x26bbe8[_0x28a331(0xa6)]===0x0,'data':{'pushed':_0x3153a8,'skipped':_0x49a3d8,'failed':_0x26bbe8},'message':'Push\x20complete:\x20'+_0x3153a8['length']+_0x28a331(0x8d)+_0x49a3d8[_0x28a331(0xa6)]+_0x28a331(0x85)+_0x26bbe8['length']+_0x28a331(0xaf)};}};async function archivePreviousSqlFileIfNeeded(_0x37dce6,_0x1d2e2d,_0x1b9a60){const _0x4677c5=a193_0x31e9d3;if(!_0x1d2e2d||_0x1d2e2d===_0x1b9a60)return;const _0xcae0ab=join(_0x37dce6['sqlRootDir'],_0x1d2e2d);if(!await fileExists(_0xcae0ab))return;const _0x182b88=await moveToTrash(_0x37dce6[_0x4677c5(0xa7)],_0x37dce6[_0x4677c5(0xbb)],_0xcae0ab);await cleanupEmptyDirectories(dirname(_0xcae0ab),_0x37dce6['sqlRootDir']),void _0x182b88;}async function moveToTrash(_0x13694b,_0xb12022,_0x209fa8){const _0x4535c6=a193_0x31e9d3,_0x56d4b7=new Date()[_0x4535c6(0x88)]()[_0x4535c6(0xa0)](/[:.]/g,'-'),_0x19cad8=relative(_0x13694b,_0x209fa8),_0x25931c=join(_0xb12022,_0x56d4b7,_0x19cad8);return await mkdir(dirname(_0x25931c),{'recursive':!![]}),await rename(_0x209fa8,_0x25931c),_0x25931c;}async function cleanupEmptyDirectories(_0x349ddb,_0x58afd1){const _0x1c63c3=a193_0x31e9d3;let _0x30f88a=resolve(_0x349ddb);const _0x2ce004=resolve(_0x58afd1);while(_0x30f88a['startsWith'](''+_0x2ce004+sep)||_0x30f88a===_0x2ce004){if(_0x30f88a===_0x2ce004)return;try{const _0x2486c0=await readdir(_0x30f88a);if(_0x2486c0[_0x1c63c3(0xa6)]>0x0)return;await rmdir(_0x30f88a);}catch{return;}_0x30f88a=dirname(_0x30f88a);}}async function resolveTargetDbBinding(_0x287467,_0x237703,_0x2a4eda){const _0x562327=a193_0x31e9d3,_0x2bf75c=_0x237703[_0x562327(0xa1)];if(!_0x2bf75c)return{'dbId':_0x2a4eda[_0x562327(0x94)],'dbName':_0x2a4eda[_0x562327(0x98)]};const _0x574157=buildDbDirectoryName(_0x2a4eda[_0x562327(0x98)],_0x2a4eda['dbId']);if(_0x2bf75c===_0x574157)return{'dbId':_0x2a4eda['dbId'],'dbName':_0x2a4eda[_0x562327(0x98)]};const _0x137ba6=parseExplicitDbDirectory(_0x2bf75c);if(_0x137ba6!=null)return{'dbId':_0x137ba6,'dbName':await getDbName(_0x287467,_0x137ba6)[_0x562327(0x83)](()=>undefined)};const _0x35cdeb=await listDatabases(_0x287467),_0x58a5a1=_0x35cdeb[_0x562327(0xb0)](_0x46c99a=>buildDbDirectoryName(_0x46c99a[_0x562327(0x98)],_0x46c99a[_0x562327(0x94)])===_0x2bf75c);if(_0x58a5a1[_0x562327(0xa6)]===0x1)return{'dbId':_0x58a5a1[0x0][_0x562327(0x94)],'dbName':_0x58a5a1[0x0][_0x562327(0x98)]};if(_0x58a5a1[_0x562327(0xa6)]===0x0)throw CliErrors[_0x562327(0x93)](_0x562327(0x8e)+_0x2bf75c+'\x22\x20for\x20sqlCode\x20'+_0x237703[_0x562327(0xa8)]+'.');const _0x177e0a=_0x58a5a1[_0x562327(0x7e)](_0x5a2fab=>_0x5a2fab[_0x562327(0x98)]+'\x20('+_0x5a2fab[_0x562327(0x94)]+')')[_0x562327(0xb4)](',\x20');throw CliErrors[_0x562327(0x93)]('Local\x20directory\x20\x22'+_0x2bf75c+_0x562327(0x82)+_0x237703['sqlCode']+':\x20'+_0x177e0a);}function parseExplicitDbDirectory(_0x3be40c){const _0xd525ca=a193_0x31e9d3,_0x368507=/^db-(\d+)$/['exec'](_0x3be40c);if(!_0x368507)return null;const _0x4a67d9=Number(_0x368507[0x1]);return Number[_0xd525ca(0xae)](_0x4a67d9)&&_0x4a67d9>0x0?_0x4a67d9:null;}
1
+ const a191_0x5a8010=a191_0x42ed;function a191_0x294d(){const _0x398215=['POST','dbId','130888KMfWnl','projectRoot','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','sql','sqlRootDir','catch','map','hash','\x20skipped,\x20','No\x20database\x20matches\x20local\x20directory\x20\x22','3060747lwQLkk','sqlConfig','exec','force','entries','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','message','mode','Would\x20push\x20','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','bool','sqlName','\x22\x20for\x20sqlCode\x20','sqls','6ncDzPr','sqlCode','\x20SQL\x20file(s)','875545XoZCAq','590358NLGAYS','130542jqGNhc','length','\x20pushed,\x20','path','140ULdolh','1423590rukMhg','Push\x20local\x20SQL\x20files\x20to\x20remote','write','set','appCode','10gulmDQ','join','validation','dbDirectory','trashDir','toISOString','relativePath','startsWith','filePath','sqlcode','remoteId','has','3353708byONfw','push','220kxVUpj','filter','version','Local\x20SQL\x20not\x20found:\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','dbName'];a191_0x294d=function(){return _0x398215;};return a191_0x294d();}(function(_0x478955,_0x2e9e9c){const _0x2aab05=a191_0x42ed,_0x4126ad=_0x478955();while(!![]){try{const _0x521ad3=parseInt(_0x2aab05(0x14f))/0x1+-parseInt(_0x2aab05(0x11c))/0x2*(-parseInt(_0x2aab05(0x14e))/0x3)+parseInt(_0x2aab05(0x128))/0x4+parseInt(_0x2aab05(0x154))/0x5*(-parseInt(_0x2aab05(0x14a))/0x6)+-parseInt(_0x2aab05(0x153))/0x7*(-parseInt(_0x2aab05(0x132))/0x8)+parseInt(_0x2aab05(0x13c))/0x9+parseInt(_0x2aab05(0x12a))/0xa*(-parseInt(_0x2aab05(0x14d))/0xb);if(_0x521ad3===_0x2e9e9c)break;else _0x4126ad['push'](_0x4126ad['shift']());}catch(_0x34bd9c){_0x4126ad['push'](_0x4126ad['shift']());}}}(a191_0x294d,0x8eaca));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';function a191_0x42ed(_0x25ad8a,_0x9a480f){_0x25ad8a=_0x25ad8a-0x118;const _0x294d7e=a191_0x294d();let _0x42eddc=_0x294d7e[_0x25ad8a];return _0x42eddc;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x270af4,_0x502c4f,_0x227180){const _0x56a384=a191_0x42ed,_0x239139=await scanLocalSqlQueries(_0x270af4),_0xfd1e2a=new Map();for(const _0x4c470a of _0x239139){if(_0x227180&&_0x4c470a['sqlCode']!==_0x227180)continue;const _0x2d034b=_0xfd1e2a['get'](_0x4c470a[_0x56a384(0x14b)])??[];_0x2d034b['push'](_0x4c470a),_0xfd1e2a[_0x56a384(0x11a)](_0x4c470a[_0x56a384(0x14b)],_0x2d034b);}if(_0x227180&&!_0xfd1e2a[_0x56a384(0x127)](_0x227180))throw CliErrors[_0x56a384(0x11e)](_0x56a384(0x12d)+_0x227180);const _0x172faa=[];for(const [_0x15b9dd,_0x262cdc]of _0xfd1e2a[_0x56a384(0x140)]()){if(_0x262cdc[_0x56a384(0x150)]===0x1){_0x172faa[_0x56a384(0x129)](_0x262cdc[0x0]);continue;}const _0x35ada4=_0x502c4f['sqls'][_0x15b9dd],_0x2286d2=_0x35ada4?.[_0x56a384(0x152)],_0xdcf926=_0x2286d2?_0x262cdc[_0x56a384(0x12b)](_0x593f12=>_0x593f12[_0x56a384(0x122)]!==_0x2286d2):_0x262cdc;if(_0x35ada4&&_0xdcf926[_0x56a384(0x150)]===0x1){_0x172faa['push'](_0xdcf926[0x0]);continue;}throw CliErrors['validation'](_0x56a384(0x12e)+_0x15b9dd+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x172faa;}export const sqlPush={'service':a191_0x5a8010(0x135),'command':a191_0x5a8010(0x129),'description':a191_0x5a8010(0x118),'risk':a191_0x5a8010(0x119),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a191_0x5a8010(0x13f),'type':'boolean','description':a191_0x5a8010(0x134)}],async 'dryRun'(_0x29fac8){const _0x19e010=a191_0x5a8010,_0x4ec45a=loadSqlProjectConfig(_0x29fac8['appCode']),_0x24b425=await readSqlLockFile(_0x4ec45a['lockFilePath']),{appLock:_0x2d8048}=ensureSqlLockScope(_0x24b425??createEmptySqlLock(),_0x29fac8[_0x19e010(0x11b)],_0x4ec45a['sqlRoot'],_0x19e010(0x129)),_0x3aa893=await getTargetSqlQueries(_0x4ec45a,_0x2d8048,_0x29fac8['str'](_0x19e010(0x125))||undefined),_0x2d92b2=[];for(const _0x49f676 of _0x3aa893){const _0x3d1ddb=await computeSqlFileHash(_0x49f676[_0x19e010(0x124)]),_0x7fa329=_0x2d8048[_0x19e010(0x149)][_0x49f676[_0x19e010(0x14b)]],_0xa40dc2=!!_0x7fa329&&(_0x7fa329[_0x19e010(0x152)]!==_0x49f676[_0x19e010(0x122)]||!!_0x49f676[_0x19e010(0x147)]&&_0x7fa329[_0x19e010(0x147)]!==_0x49f676['sqlName']);if(!_0x29fac8[_0x19e010(0x146)](_0x19e010(0x13f))&&_0x7fa329&&_0x7fa329[_0x19e010(0x139)]===_0x3d1ddb&&!_0xa40dc2)continue;_0x2d92b2[_0x19e010(0x129)](_0x49f676[_0x19e010(0x14b)]);}return{'method':_0x19e010(0x130),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x2d92b2,'appCode':_0x29fac8[_0x19e010(0x11b)]},'description':_0x19e010(0x144)+_0x2d92b2[_0x19e010(0x150)]+_0x19e010(0x14c)};},async 'execute'(_0x48a30f){const _0xadf265=a191_0x5a8010,_0x21d4f8=loadSqlProjectConfig(_0x48a30f[_0xadf265(0x11b)]),_0x557bd8=await readSqlLockFile(_0x21d4f8['lockFilePath']),{lockData:_0x5be615,appLock:_0x234e5f}=ensureSqlLockScope(_0x557bd8??createEmptySqlLock(),_0x48a30f[_0xadf265(0x11b)],_0x21d4f8['sqlRoot'],_0xadf265(0x129)),_0x3a77da=await getTargetSqlQueries(_0x21d4f8,_0x234e5f,_0x48a30f['str'](_0xadf265(0x125))||undefined);if(_0x3a77da[_0xadf265(0x150)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x5b0b7f=[],_0x40f334=[],_0x335fdc=[];for(const _0x850870 of _0x3a77da){const _0x5dace5=_0x234e5f[_0xadf265(0x149)][_0x850870[_0xadf265(0x14b)]];if(!_0x5dace5){_0x335fdc[_0xadf265(0x129)]({'sqlCode':_0x850870[_0xadf265(0x14b)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x251101=await computeSqlFileHash(_0x850870[_0xadf265(0x124)]),_0x138fdf=_0x5dace5[_0xadf265(0x152)]!==_0x850870[_0xadf265(0x122)]||!!_0x850870['sqlName']&&_0x5dace5[_0xadf265(0x147)]!==_0x850870[_0xadf265(0x147)];if(!_0x48a30f[_0xadf265(0x146)]('force')&&_0x5dace5[_0xadf265(0x139)]===_0x251101&&!_0x138fdf){_0x40f334[_0xadf265(0x129)]({'sqlCode':_0x850870[_0xadf265(0x14b)],'reason':'unchanged'});continue;}if(_0x5dace5[_0xadf265(0x12c)]==null){_0x335fdc['push']({'sqlCode':_0x850870[_0xadf265(0x14b)],'error':_0xadf265(0x145)});continue;}const _0x50967d=await readFile(_0x850870[_0xadf265(0x124)],'utf8'),_0x44675a=stripLocalSqlMetadata(_0x50967d,_0x850870[_0xadf265(0x143)]),_0x1eb1dc=_0x850870[_0xadf265(0x147)]||_0x5dace5[_0xadf265(0x147)],_0x167f56=await resolveTargetDbBinding(_0x48a30f[_0xadf265(0x11b)],_0x850870,_0x5dace5),_0x4fdc87=await updateSqlQuery({'id':_0x5dace5[_0xadf265(0x126)],'appCode':_0x48a30f[_0xadf265(0x11b)],'sqlCode':_0x850870['sqlCode'],'sqlName':_0x1eb1dc,'dbId':_0x167f56['dbId'],'version':_0x5dace5[_0xadf265(0x12c)],'sqlContent':_0x44675a,'sqlConfig':_0x5dace5[_0xadf265(0x13d)]??undefined}),_0x5432a8=_0x4fdc87[_0xadf265(0x131)]?await getDbName(_0x48a30f[_0xadf265(0x11b)],Number(_0x4fdc87[_0xadf265(0x131)]))[_0xadf265(0x137)](()=>_0x167f56[_0xadf265(0x12f)]):_0x167f56['dbName'];_0x234e5f['sqls'][_0x850870['sqlCode']]={...buildSqlLockEntry(_0x4fdc87,_0x44675a,_0x251101,{'dbName':_0x5432a8}),'path':_0x850870[_0xadf265(0x122)],'mode':_0x5dace5[_0xadf265(0x143)]},await archivePreviousSqlFileIfNeeded(_0x21d4f8,_0x5dace5[_0xadf265(0x152)],_0x850870[_0xadf265(0x122)]),_0x5b0b7f['push']({'sqlCode':_0x850870[_0xadf265(0x14b)],'remoteId':_0x5dace5[_0xadf265(0x126)]});}catch(_0x24365e){_0x335fdc[_0xadf265(0x129)]({'sqlCode':_0x850870['sqlCode'],'error':_0x24365e instanceof Error?_0x24365e[_0xadf265(0x142)]:String(_0x24365e)});}}return _0x234e5f['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x21d4f8['lockFilePath'],_0x5be615),{'ok':_0x335fdc[_0xadf265(0x150)]===0x0,'data':{'pushed':_0x5b0b7f,'skipped':_0x40f334,'failed':_0x335fdc},'message':'Push\x20complete:\x20'+_0x5b0b7f[_0xadf265(0x150)]+_0xadf265(0x151)+_0x40f334[_0xadf265(0x150)]+_0xadf265(0x13a)+_0x335fdc[_0xadf265(0x150)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x3cda6d,_0x3adf90,_0x31519b){const _0x42fdd7=a191_0x5a8010;if(!_0x3adf90||_0x3adf90===_0x31519b)return;const _0x2a5122=join(_0x3cda6d['sqlRootDir'],_0x3adf90);if(!await fileExists(_0x2a5122))return;const _0x53da09=await moveToTrash(_0x3cda6d[_0x42fdd7(0x133)],_0x3cda6d[_0x42fdd7(0x120)],_0x2a5122);await cleanupEmptyDirectories(dirname(_0x2a5122),_0x3cda6d[_0x42fdd7(0x136)]),void _0x53da09;}async function moveToTrash(_0x47a725,_0x575d8f,_0xe7f43b){const _0x5edfb0=a191_0x5a8010,_0x364d20=new Date()[_0x5edfb0(0x121)]()['replace'](/[:.]/g,'-'),_0x210cca=relative(_0x47a725,_0xe7f43b),_0x3c7714=join(_0x575d8f,_0x364d20,_0x210cca);return await mkdir(dirname(_0x3c7714),{'recursive':!![]}),await rename(_0xe7f43b,_0x3c7714),_0x3c7714;}async function cleanupEmptyDirectories(_0xb2799f,_0x13af3d){const _0x380f60=a191_0x5a8010;let _0xfe8b4c=resolve(_0xb2799f);const _0x58266e=resolve(_0x13af3d);while(_0xfe8b4c[_0x380f60(0x123)](''+_0x58266e+sep)||_0xfe8b4c===_0x58266e){if(_0xfe8b4c===_0x58266e)return;try{const _0x1cf692=await readdir(_0xfe8b4c);if(_0x1cf692['length']>0x0)return;await rmdir(_0xfe8b4c);}catch{return;}_0xfe8b4c=dirname(_0xfe8b4c);}}async function resolveTargetDbBinding(_0x46c7b3,_0x44f9b6,_0x1c299e){const _0x5588fc=a191_0x5a8010,_0xf5bcf7=_0x44f9b6[_0x5588fc(0x11f)];if(!_0xf5bcf7)return{'dbId':_0x1c299e['dbId'],'dbName':_0x1c299e[_0x5588fc(0x12f)]};const _0x6ea123=buildDbDirectoryName(_0x1c299e[_0x5588fc(0x12f)],_0x1c299e[_0x5588fc(0x131)]);if(_0xf5bcf7===_0x6ea123)return{'dbId':_0x1c299e[_0x5588fc(0x131)],'dbName':_0x1c299e[_0x5588fc(0x12f)]};const _0x8f48b2=parseExplicitDbDirectory(_0xf5bcf7);if(_0x8f48b2!=null)return{'dbId':_0x8f48b2,'dbName':await getDbName(_0x46c7b3,_0x8f48b2)[_0x5588fc(0x137)](()=>undefined)};const _0x32fd22=await listDatabases(_0x46c7b3),_0x2b9a88=_0x32fd22[_0x5588fc(0x12b)](_0x200aef=>buildDbDirectoryName(_0x200aef[_0x5588fc(0x12f)],_0x200aef[_0x5588fc(0x131)])===_0xf5bcf7);if(_0x2b9a88[_0x5588fc(0x150)]===0x1)return{'dbId':_0x2b9a88[0x0][_0x5588fc(0x131)],'dbName':_0x2b9a88[0x0][_0x5588fc(0x12f)]};if(_0x2b9a88['length']===0x0)throw CliErrors['validation'](_0x5588fc(0x13b)+_0xf5bcf7+_0x5588fc(0x148)+_0x44f9b6['sqlCode']+'.');const _0x397663=_0x2b9a88[_0x5588fc(0x138)](_0x4595a9=>_0x4595a9[_0x5588fc(0x12f)]+'\x20('+_0x4595a9[_0x5588fc(0x131)]+')')[_0x5588fc(0x11d)](',\x20');throw CliErrors['validation']('Local\x20directory\x20\x22'+_0xf5bcf7+_0x5588fc(0x141)+_0x44f9b6['sqlCode']+':\x20'+_0x397663);}function parseExplicitDbDirectory(_0x1beb18){const _0x2d9dd3=a191_0x5a8010,_0xf0a9c1=/^db-(\d+)$/[_0x2d9dd3(0x13e)](_0x1beb18);if(!_0xf0a9c1)return null;const _0x2ca598=Number(_0xf0a9c1[0x1]);return Number['isFinite'](_0x2ca598)&&_0x2ca598>0x0?_0x2ca598:null;}
@@ -1 +1 @@
1
- const a194_0x27b2d2=a194_0x58cc;(function(_0x4c43bc,_0x245688){const _0x22feb0=a194_0x58cc,_0x5e1787=_0x4c43bc();while(!![]){try{const _0x179eb7=-parseInt(_0x22feb0(0x178))/0x1+-parseInt(_0x22feb0(0x177))/0x2+parseInt(_0x22feb0(0x17e))/0x3*(parseInt(_0x22feb0(0x1a0))/0x4)+parseInt(_0x22feb0(0x180))/0x5+parseInt(_0x22feb0(0x18a))/0x6*(-parseInt(_0x22feb0(0x176))/0x7)+parseInt(_0x22feb0(0x17b))/0x8+-parseInt(_0x22feb0(0x18c))/0x9*(parseInt(_0x22feb0(0x19f))/0xa);if(_0x179eb7===_0x245688)break;else _0x5e1787['push'](_0x5e1787['shift']());}catch(_0xf61d39){_0x5e1787['push'](_0x5e1787['shift']());}}}(a194_0x47e9,0x2eb63));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=a194_0x27b2d2(0x185);export function buildSqlLockEntry(_0x273410,_0x40edd6,_0x471cb0,_0x4dbcce){const _0x234f76=a194_0x27b2d2,_0xc52c5e=detectSqlMode(_0x40edd6);return{'path':buildSqlRelativePath(_0x273410['sqlCode'],_0x273410[_0x234f76(0x17f)],_0x4dbcce?.[_0x234f76(0x18e)],_0xc52c5e,_0x273410[_0x234f76(0x193)]),'hash':_0x471cb0,'remoteId':_0x273410['id'],'version':_0x273410['version'],'dbId':Number(_0x273410['dbId']),'dbName':_0x4dbcce?.[_0x234f76(0x18e)],'sqlName':_0x273410['sqlName'],'sqlConfig':_0x273410[_0x234f76(0x187)]??undefined,'mode':_0xc52c5e};}export function cloneSqlLockData(_0x45d259){const _0x21921b=a194_0x27b2d2;return{'apps':Object[_0x21921b(0x179)](Object[_0x21921b(0x194)](_0x45d259[_0x21921b(0x190)])[_0x21921b(0x19a)](([_0x47552d,_0x1aa687])=>[_0x47552d,{'sqlRoot':_0x1aa687['sqlRoot'],'lastSync':_0x1aa687[_0x21921b(0x17c)],'sqls':{..._0x1aa687['sqls']}}]))};}export function ensureRemoteSqlContent(_0x4013d4){const _0x47d2f7=a194_0x27b2d2;return _0x4013d4[_0x47d2f7(0x19e)]??'';}export function buildLocalSqlFileContent(_0x2670a3,_0xa04ee2,_0x40a8a3){const _0x19f45c=a194_0x27b2d2,_0xcbd097=_0x40a8a3?.[_0x19f45c(0x186)]??detectSqlMode(_0xa04ee2),_0x39b0a4=stripLocalSqlMetadata(_0xa04ee2,_0xcbd097)['trim'](),_0x563ef5=[...buildMetadataHeaderLines({'sqlCode':_0x2670a3['sqlCode'],'sqlName':_0x2670a3[_0x19f45c(0x17f)],'dbId':_0x2670a3['dbId'],'dbName':_0x40a8a3?.[_0x19f45c(0x18e)],'mode':_0xcbd097,'syncedAt':_0x40a8a3?.[_0x19f45c(0x188)],'description':_0x40a8a3?.[_0x19f45c(0x181)]},_0xcbd097),'',_0x39b0a4],_0x30c39c=_0x563ef5[_0x19f45c(0x19c)]('\x0a');return _0x30c39c[_0x19f45c(0x18b)]('\x0a')?_0x30c39c:_0x30c39c+'\x0a';}export function stripLocalSqlMetadata(_0x41468f,_0x54b75f){const _0x408668=a194_0x27b2d2,_0x5acffa=_0x41468f[_0x408668(0x18f)](/\r\n/g,'\x0a')[_0x408668(0x191)]('\x0a'),_0x178b35=[];let _0x77c65=0x0;if(_0x54b75f===_0x408668(0x182))while(_0x77c65<_0x5acffa[_0x408668(0x184)]){const _0x202fbd=_0x5acffa[_0x77c65]??'';if(/^\s*<!--\s*@lovrabet\./[_0x408668(0x197)](_0x202fbd)){_0x77c65++;continue;}if(_0x202fbd[_0x408668(0x1a1)]()===''&&_0x77c65>0x0){_0x77c65++;continue;}break;}else while(_0x77c65<_0x5acffa[_0x408668(0x184)]){const _0xb43ff1=_0x5acffa[_0x77c65]??'';if(/^\s*--\s*@lovrabet\./['test'](_0xb43ff1)){_0x77c65++;continue;}if(_0xb43ff1[_0x408668(0x1a1)]()===''&&_0x77c65>0x0){_0x77c65++;continue;}break;}for(;_0x77c65<_0x5acffa[_0x408668(0x184)];_0x77c65++){_0x178b35[_0x408668(0x19d)](_0x5acffa[_0x77c65]);}return _0x178b35[_0x408668(0x19c)]('\x0a')[_0x408668(0x198)]();}export function resolveSqlMode(_0x4961ef,_0x51ebb0){const _0x3128d3=a194_0x27b2d2;if(_0x51ebb0?.[_0x3128d3(0x186)])return _0x51ebb0[_0x3128d3(0x186)];return detectSqlMode(_0x4961ef);}export function resolveSqlFileName(_0x16bc18,_0x48b32e,_0x7b18b0){const _0x4c4663=a194_0x27b2d2;if(_0x7b18b0?.['path'])return _0x7b18b0[_0x4c4663(0x199)];if(_0x7b18b0?.[_0x4c4663(0x17f)]||_0x7b18b0?.[_0x4c4663(0x18e)])return buildSqlRelativePath(_0x16bc18,_0x7b18b0?.[_0x4c4663(0x17f)],_0x7b18b0?.[_0x4c4663(0x18e)],resolveSqlMode(_0x48b32e,_0x7b18b0),_0x7b18b0?.[_0x4c4663(0x193)]);return buildDefaultSqlFileName(_0x16bc18,resolveSqlMode(_0x48b32e,_0x7b18b0));}function a194_0x47e9(){const _0x2aa07b=['description','mybatisXml','stdin','length','.rabetbase/sql','mode','sqlConfig','syncedAt','sqlCode','1781154GMelqA','endsWith','18xHMfMn','includes','dbName','replace','apps','split','yes','dbId','entries','--\x20@lovrabet.','\x20-->','test','trimStart','path','map','toLowerCase','join','push','sqlContent','1167980YWPNGI','18576uCDqen','trim','7kuVSgc','115042cUTAgU','197554wemxND','fromEntries','filter','3035064tspwou','lastSync','\x20[y/N]\x20','195bEoQMr','sqlName','1478090ZAVKKS'];a194_0x47e9=function(){return _0x2aa07b;};return a194_0x47e9();}export function resolveSqlLocalDir(_0x37c178,_0x5f0be7){return join(_0x37c178,SQL_LOCAL_REL_DIR,_0x5f0be7);}export async function confirmForceOverwrite(_0x122eeb){const _0x2ccbdf=a194_0x27b2d2,_0x3ce5a1=createInterface({'input':process[_0x2ccbdf(0x183)],'output':process['stderr']}),_0x3049df=await new Promise(_0x210095=>{const _0x48a959=_0x2ccbdf;_0x3ce5a1['question'](_0x122eeb+_0x48a959(0x17d),_0x210095);});return _0x3ce5a1['close'](),['y',_0x2ccbdf(0x192)][_0x2ccbdf(0x18d)](_0x3049df['trim']()[_0x2ccbdf(0x19b)]());}function a194_0x58cc(_0x6bae81,_0x272a61){_0x6bae81=_0x6bae81-0x176;const _0x47e965=a194_0x47e9();let _0x58cca3=_0x47e965[_0x6bae81];return _0x58cca3;}export function findSqlLockScope(_0x420304,_0x2da468){const _0x2ed244=a194_0x27b2d2;return _0x420304[_0x2ed244(0x190)][_0x2da468];}function buildMetadataHeaderLines(_0x2a6ff6,_0x32aa24){const _0x4af264=a194_0x27b2d2,_0x37e4bf=[[_0x4af264(0x189),_0x2a6ff6['sqlCode']],['sqlName',_0x2a6ff6[_0x4af264(0x17f)]],[_0x4af264(0x193),_0x2a6ff6['dbId']],[_0x4af264(0x18e),_0x2a6ff6[_0x4af264(0x18e)]],['mode',_0x2a6ff6[_0x4af264(0x186)]],[_0x4af264(0x188),_0x2a6ff6['syncedAt']],[_0x4af264(0x181),_0x2a6ff6['description']]];if(_0x32aa24==='mybatisXml')return _0x37e4bf[_0x4af264(0x17a)](([,_0x44f96a])=>_0x44f96a!==undefined&&_0x44f96a!==null&&String(_0x44f96a)[_0x4af264(0x1a1)]()!=='')[_0x4af264(0x19a)](([_0x2e9beb,_0x52f0a5])=>'<!--\x20@lovrabet.'+_0x2e9beb+':\x20'+String(_0x52f0a5)+_0x4af264(0x196));return _0x37e4bf[_0x4af264(0x17a)](([,_0x3cc5c4])=>_0x3cc5c4!==undefined&&_0x3cc5c4!==null&&String(_0x3cc5c4)[_0x4af264(0x1a1)]()!=='')['map'](([_0x3c28e9,_0x3c78f8])=>_0x4af264(0x195)+_0x3c28e9+':\x20'+String(_0x3c78f8));}
1
+ const a192_0x127128=a192_0x34ef;(function(_0x359453,_0x2437eb){const _0x55b676=a192_0x34ef,_0x275574=_0x359453();while(!![]){try{const _0x541b65=-parseInt(_0x55b676(0x151))/0x1+parseInt(_0x55b676(0x152))/0x2*(parseInt(_0x55b676(0x14d))/0x3)+-parseInt(_0x55b676(0x16d))/0x4+parseInt(_0x55b676(0x153))/0x5+-parseInt(_0x55b676(0x166))/0x6+-parseInt(_0x55b676(0x15d))/0x7*(-parseInt(_0x55b676(0x165))/0x8)+parseInt(_0x55b676(0x158))/0x9;if(_0x541b65===_0x2437eb)break;else _0x275574['push'](_0x275574['shift']());}catch(_0x2cc111){_0x275574['push'](_0x275574['shift']());}}}(a192_0x3357,0x1d1b7));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=a192_0x127128(0x14b);export function buildSqlLockEntry(_0x51ba05,_0x16a3f6,_0x480254,_0x12494e){const _0x59ce00=a192_0x127128,_0x5a889f=detectSqlMode(_0x16a3f6);return{'path':buildSqlRelativePath(_0x51ba05[_0x59ce00(0x15c)],_0x51ba05[_0x59ce00(0x159)],_0x12494e?.[_0x59ce00(0x161)],_0x5a889f,_0x51ba05['dbId']),'hash':_0x480254,'remoteId':_0x51ba05['id'],'version':_0x51ba05['version'],'dbId':Number(_0x51ba05['dbId']),'dbName':_0x12494e?.[_0x59ce00(0x161)],'sqlName':_0x51ba05['sqlName'],'sqlConfig':_0x51ba05[_0x59ce00(0x160)]??undefined,'mode':_0x5a889f};}function a192_0x34ef(_0x4cb715,_0x49a02a){_0x4cb715=_0x4cb715-0x147;const _0x33576e=a192_0x3357();let _0x34ef44=_0x33576e[_0x4cb715];return _0x34ef44;}export function cloneSqlLockData(_0x211482){const _0x47d613=a192_0x127128;return{'apps':Object[_0x47d613(0x150)](Object[_0x47d613(0x147)](_0x211482[_0x47d613(0x148)])[_0x47d613(0x167)](([_0x5de194,_0x583582])=>[_0x5de194,{'sqlRoot':_0x583582[_0x47d613(0x14e)],'lastSync':_0x583582[_0x47d613(0x170)],'sqls':{..._0x583582['sqls']}}]))};}export function ensureRemoteSqlContent(_0x1ca88f){const _0x4e5161=a192_0x127128;return _0x1ca88f[_0x4e5161(0x162)]??'';}export function buildLocalSqlFileContent(_0x24eb9b,_0x220aba,_0x27e77f){const _0x42f909=a192_0x127128,_0x539b93=_0x27e77f?.[_0x42f909(0x154)]??detectSqlMode(_0x220aba),_0x28cf6e=stripLocalSqlMetadata(_0x220aba,_0x539b93)['trim'](),_0x19a8f0=[...buildMetadataHeaderLines({'sqlCode':_0x24eb9b[_0x42f909(0x15c)],'sqlName':_0x24eb9b['sqlName'],'dbId':_0x24eb9b['dbId'],'dbName':_0x27e77f?.[_0x42f909(0x161)],'mode':_0x539b93,'syncedAt':_0x27e77f?.[_0x42f909(0x16e)],'description':_0x27e77f?.[_0x42f909(0x15f)]},_0x539b93),'',_0x28cf6e],_0x2d2427=_0x19a8f0[_0x42f909(0x14f)]('\x0a');return _0x2d2427[_0x42f909(0x15a)]('\x0a')?_0x2d2427:_0x2d2427+'\x0a';}export function stripLocalSqlMetadata(_0x5d9868,_0x30dd4a){const _0x198fd7=a192_0x127128,_0x510456=_0x5d9868['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x3de52e=[];let _0x599384=0x0;if(_0x30dd4a===_0x198fd7(0x163))while(_0x599384<_0x510456[_0x198fd7(0x171)]){const _0x5445d4=_0x510456[_0x599384]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x5445d4)){_0x599384++;continue;}if(_0x5445d4[_0x198fd7(0x168)]()===''&&_0x599384>0x0){_0x599384++;continue;}break;}else while(_0x599384<_0x510456[_0x198fd7(0x171)]){const _0x324fa1=_0x510456[_0x599384]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x324fa1)){_0x599384++;continue;}if(_0x324fa1[_0x198fd7(0x168)]()===''&&_0x599384>0x0){_0x599384++;continue;}break;}for(;_0x599384<_0x510456[_0x198fd7(0x171)];_0x599384++){_0x3de52e['push'](_0x510456[_0x599384]);}return _0x3de52e['join']('\x0a')[_0x198fd7(0x16b)]();}export function resolveSqlMode(_0x2ec725,_0x26a5cf){const _0x142b18=a192_0x127128;if(_0x26a5cf?.[_0x142b18(0x154)])return _0x26a5cf[_0x142b18(0x154)];return detectSqlMode(_0x2ec725);}export function resolveSqlFileName(_0x2da964,_0x12303c,_0x21882f){const _0xee0b38=a192_0x127128;if(_0x21882f?.[_0xee0b38(0x14c)])return _0x21882f[_0xee0b38(0x14c)];if(_0x21882f?.[_0xee0b38(0x159)]||_0x21882f?.[_0xee0b38(0x161)])return buildSqlRelativePath(_0x2da964,_0x21882f?.[_0xee0b38(0x159)],_0x21882f?.[_0xee0b38(0x161)],resolveSqlMode(_0x12303c,_0x21882f),_0x21882f?.['dbId']);return buildDefaultSqlFileName(_0x2da964,resolveSqlMode(_0x12303c,_0x21882f));}export function resolveSqlLocalDir(_0x2113d3,_0x5a8ea2){return join(_0x2113d3,SQL_LOCAL_REL_DIR,_0x5a8ea2);}export async function confirmForceOverwrite(_0x45e8ef){const _0x18afe8=a192_0x127128,_0x3fe035=createInterface({'input':process[_0x18afe8(0x15b)],'output':process[_0x18afe8(0x16a)]}),_0x145922=await new Promise(_0x135c17=>{const _0x58e557=_0x18afe8;_0x3fe035[_0x58e557(0x16f)](_0x45e8ef+'\x20[y/N]\x20',_0x135c17);});return _0x3fe035[_0x18afe8(0x155)](),['y',_0x18afe8(0x14a)][_0x18afe8(0x169)](_0x145922[_0x18afe8(0x168)]()[_0x18afe8(0x157)]());}export function findSqlLockScope(_0x182c44,_0x5b2bfc){const _0x5a372a=a192_0x127128;return _0x182c44[_0x5a372a(0x148)][_0x5b2bfc];}function buildMetadataHeaderLines(_0x486074,_0x448be7){const _0x46fefa=a192_0x127128,_0x3b24ed=[[_0x46fefa(0x15c),_0x486074[_0x46fefa(0x15c)]],[_0x46fefa(0x159),_0x486074['sqlName']],[_0x46fefa(0x16c),_0x486074[_0x46fefa(0x16c)]],[_0x46fefa(0x161),_0x486074['dbName']],['mode',_0x486074['mode']],[_0x46fefa(0x16e),_0x486074['syncedAt']],[_0x46fefa(0x15f),_0x486074[_0x46fefa(0x15f)]]];if(_0x448be7===_0x46fefa(0x163))return _0x3b24ed[_0x46fefa(0x149)](([,_0x649cfe])=>_0x649cfe!==undefined&&_0x649cfe!==null&&String(_0x649cfe)['trim']()!=='')[_0x46fefa(0x167)](([_0x51c75f,_0x581231])=>_0x46fefa(0x156)+_0x51c75f+':\x20'+String(_0x581231)+_0x46fefa(0x15e));return _0x3b24ed[_0x46fefa(0x149)](([,_0x4b2553])=>_0x4b2553!==undefined&&_0x4b2553!==null&&String(_0x4b2553)['trim']()!=='')[_0x46fefa(0x167)](([_0xefad1b,_0x1f6cad])=>_0x46fefa(0x164)+_0xefad1b+':\x20'+String(_0x1f6cad));}function a192_0x3357(){const _0xd81569=['718839ZJHVvG','sqlName','endsWith','stdin','sqlCode','3983fvHlKS','\x20-->','description','sqlConfig','dbName','sqlContent','mybatisXml','--\x20@lovrabet.','3344LnQSbT','626820HmZnKx','map','trim','includes','stderr','trimStart','dbId','333548KXNFCj','syncedAt','question','lastSync','length','entries','apps','filter','yes','.rabetbase/sql','path','99369WRoWlJ','sqlRoot','join','fromEntries','110840udokBS','4kpmjnf','169805qAAcnP','mode','close','<!--\x20@lovrabet.','toLowerCase'];a192_0x3357=function(){return _0xd81569;};return a192_0x3357();}
@@ -1 +1 @@
1
- function a195_0x406a(){const _0x44a39c=['map','142860cHaNTc','3753068IdaJck','lockFilePath','sqls','2kElwgX','keys','lockKey','read','\x20remote-only','8EUwunx','9PZqBAM','totalCount','length','relativePath','hash','sql','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','80863cElJSv','\x20unchanged','push','31092DGZOAC','1768yRTOJL','6959570RxhyjM','sqlRoot','55XzbGiD','74766jxIoSv','status','appCode','boolean','\x20missing,\x20','remote','sqlCode','sqlName','416647kILTOb','40tcdNap','tableData','has','\x20modified,\x20','bool'];a195_0x406a=function(){return _0x44a39c;};return a195_0x406a();}const a195_0x40c0c2=a195_0x7945;function a195_0x7945(_0x4efb92,_0x4cc06b){_0x4efb92=_0x4efb92-0x1a0;const _0x406a89=a195_0x406a();let _0x794534=_0x406a89[_0x4efb92];return _0x794534;}(function(_0x280a5f,_0xc561c5){const _0xa148b1=a195_0x7945,_0x4a6964=_0x280a5f();while(!![]){try{const _0x3ad2db=-parseInt(_0xa148b1(0x1c1))/0x1*(-parseInt(_0xa148b1(0x1b4))/0x2)+parseInt(_0xa148b1(0x1a1))/0x3*(-parseInt(_0xa148b1(0x1aa))/0x4)+parseInt(_0xa148b1(0x1a0))/0x5*(parseInt(_0xa148b1(0x1c4))/0x6)+-parseInt(_0xa148b1(0x1a9))/0x7*(parseInt(_0xa148b1(0x1b9))/0x8)+-parseInt(_0xa148b1(0x1ba))/0x9*(parseInt(_0xa148b1(0x1c6))/0xa)+-parseInt(_0xa148b1(0x1b1))/0xb+-parseInt(_0xa148b1(0x1b0))/0xc*(-parseInt(_0xa148b1(0x1c5))/0xd);if(_0x3ad2db===_0xc561c5)break;else _0x4a6964['push'](_0x4a6964['shift']());}catch(_0x4026b4){_0x4a6964['push'](_0x4a6964['shift']());}}}(a195_0x406a,0x645b3));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(_0x22572f){const _0x48d8e8=a195_0x7945,_0x48e5f0=[];let _0x49d0f8=0x1;while(!![]){const _0x45d13e=await listSqlQueries(_0x22572f,{'currentPage':_0x49d0f8,'pageSize':PAGE_SIZE}),_0x150144=_0x45d13e[_0x48d8e8(0x1ab)]??[];_0x48e5f0[_0x48d8e8(0x1c3)](..._0x150144['map'](_0x1721ae=>_0x1721ae[_0x48d8e8(0x1a7)]));if(_0x150144['length']===0x0)break;const _0x533fa0=_0x45d13e['paging']?.[_0x48d8e8(0x1bb)];if(_0x533fa0!=null?_0x48e5f0['length']>=_0x533fa0:_0x150144[_0x48d8e8(0x1bc)]<PAGE_SIZE)break;_0x49d0f8++;}return _0x48e5f0;}export const sqlStatus={'service':a195_0x40c0c2(0x1bf),'command':a195_0x40c0c2(0x1a2),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a195_0x40c0c2(0x1b7),'flags':[{'name':a195_0x40c0c2(0x1a6),'type':a195_0x40c0c2(0x1a4),'description':a195_0x40c0c2(0x1c0)}],async 'execute'(_0x1fe003){const _0x53e8da=a195_0x40c0c2,_0x6f1506=loadSqlProjectConfig(_0x1fe003[_0x53e8da(0x1a3)]),_0x5a655c=await readSqlLockFile(_0x6f1506[_0x53e8da(0x1b2)]),{appLock:_0x3370d3}=ensureSqlLockScope(_0x5a655c??createEmptySqlLock(),_0x6f1506[_0x53e8da(0x1a3)],_0x6f1506[_0x53e8da(0x1c7)],_0x53e8da(0x1a2)),_0x3762fa=await scanLocalSqlQueries(_0x6f1506),_0x288bf8=[],_0xc4ce57=[],_0xead54=[],_0x1f6d5e=[],_0xf42dbe=new Set(_0x3762fa[_0x53e8da(0x1af)](_0x25ea58=>_0x25ea58[_0x53e8da(0x1b6)]));for(const _0x26909a of _0x3762fa){const _0x38ca9c=await computeSqlFileHash(_0x26909a['filePath']),_0x538037=_0x3370d3[_0x53e8da(0x1b3)][_0x26909a[_0x53e8da(0x1b6)]],_0x308a93=!!_0x538037&&_0x538037['path']!==_0x26909a[_0x53e8da(0x1bd)],_0x18cfe8=!!_0x538037&&!!_0x26909a[_0x53e8da(0x1a8)]&&_0x538037[_0x53e8da(0x1a8)]!==_0x26909a[_0x53e8da(0x1a8)];if(!_0x538037)_0x288bf8[_0x53e8da(0x1c3)](_0x26909a[_0x53e8da(0x1b6)]);else _0x538037[_0x53e8da(0x1be)]!==_0x38ca9c||_0x308a93||_0x18cfe8?_0xc4ce57[_0x53e8da(0x1c3)](_0x26909a[_0x53e8da(0x1b6)]):_0xead54[_0x53e8da(0x1c3)](_0x26909a[_0x53e8da(0x1b6)]);}for(const _0x157026 of Object[_0x53e8da(0x1b5)](_0x3370d3['sqls'])){!_0xf42dbe[_0x53e8da(0x1ac)](_0x157026)&&_0x1f6d5e[_0x53e8da(0x1c3)](_0x157026);}const _0x453b49=[];if(_0x1fe003[_0x53e8da(0x1ae)](_0x53e8da(0x1a6))){const _0x1a55cd=await fetchAllSqlCodes(_0x1fe003[_0x53e8da(0x1a3)]);for(const _0x4c48d8 of _0x1a55cd){!_0xf42dbe[_0x53e8da(0x1ac)](_0x4c48d8)&&!_0x3370d3[_0x53e8da(0x1b3)][_0x4c48d8]&&_0x453b49[_0x53e8da(0x1c3)](_0x4c48d8);}}const _0x3026d7=_0x288bf8[_0x53e8da(0x1bc)]===0x0&&_0xc4ce57[_0x53e8da(0x1bc)]===0x0&&_0x1f6d5e[_0x53e8da(0x1bc)]===0x0&&_0x453b49[_0x53e8da(0x1bc)]===0x0;return{'ok':!![],'data':{'added':_0x288bf8,'modified':_0xc4ce57,'missing':_0x1f6d5e,'unchanged':_0xead54,'remoteOnly':_0x453b49},'message':_0x3026d7?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x288bf8[_0x53e8da(0x1bc)]+'\x20added,\x20'+_0xc4ce57['length']+_0x53e8da(0x1ad)+_0x1f6d5e[_0x53e8da(0x1bc)]+_0x53e8da(0x1a5)+_0xead54[_0x53e8da(0x1bc)]+_0x53e8da(0x1c2)+(_0x453b49[_0x53e8da(0x1bc)]>0x0?',\x20'+_0x453b49[_0x53e8da(0x1bc)]+_0x53e8da(0x1b8):'')};}};
1
+ const a193_0x1a8e4f=a193_0x9ba0;(function(_0x2fee2c,_0x1025f2){const _0x23e433=a193_0x9ba0,_0x1a5c2a=_0x2fee2c();while(!![]){try{const _0x256e45=-parseInt(_0x23e433(0x143))/0x1*(-parseInt(_0x23e433(0x137))/0x2)+parseInt(_0x23e433(0x147))/0x3*(parseInt(_0x23e433(0x134))/0x4)+-parseInt(_0x23e433(0x13b))/0x5*(parseInt(_0x23e433(0x146))/0x6)+parseInt(_0x23e433(0x14f))/0x7+-parseInt(_0x23e433(0x12d))/0x8+parseInt(_0x23e433(0x139))/0x9*(parseInt(_0x23e433(0x136))/0xa)+-parseInt(_0x23e433(0x140))/0xb;if(_0x256e45===_0x1025f2)break;else _0x1a5c2a['push'](_0x1a5c2a['shift']());}catch(_0x376bb9){_0x1a5c2a['push'](_0x1a5c2a['shift']());}}}(a193_0x46f4,0x659ed));import{listSqlQueries}from'../../core/api-client.js';function a193_0x46f4(){const _0x4b04fb=['Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','13JBeZAF','keys','tableData','6JSpqYc','1532631FSOezK','hash','path','sqlName','filePath','lockKey','sqls','bool','5378898xxAxNU','status','boolean','\x20added,\x20','sql','5497712RUCCkY','lockFilePath','map','sqlRoot','\x20unchanged','sqlCode','appCode','4ggSoqr','remote','1327370pCYcXV','41578HHaNWQ','push','27EYOsdh','length','4152415fbujiK','relativePath','\x20missing,\x20','All\x20SQL\x20queries\x20are\x20in\x20sync.','\x20modified,\x20','152075Uibtnp','has'];a193_0x46f4=function(){return _0x4b04fb;};return a193_0x46f4();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a193_0x9ba0(_0x50bcf5,_0x546358){_0x50bcf5=_0x50bcf5-0x12b;const _0x46f45a=a193_0x46f4();let _0x9ba050=_0x46f45a[_0x50bcf5];return _0x9ba050;}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(_0x58a5c4){const _0x1db0f7=a193_0x9ba0,_0x360ae2=[];let _0x440735=0x1;while(!![]){const _0x471770=await listSqlQueries(_0x58a5c4,{'currentPage':_0x440735,'pageSize':PAGE_SIZE}),_0x2fa1be=_0x471770[_0x1db0f7(0x145)]??[];_0x360ae2[_0x1db0f7(0x138)](..._0x2fa1be[_0x1db0f7(0x12f)](_0x5ba464=>_0x5ba464[_0x1db0f7(0x132)]));if(_0x2fa1be['length']===0x0)break;const _0x148d8b=_0x471770['paging']?.['totalCount'];if(_0x148d8b!=null?_0x360ae2[_0x1db0f7(0x13a)]>=_0x148d8b:_0x2fa1be['length']<PAGE_SIZE)break;_0x440735++;}return _0x360ae2;}export const sqlStatus={'service':a193_0x1a8e4f(0x12c),'command':a193_0x1a8e4f(0x150),'description':a193_0x1a8e4f(0x142),'risk':'read','flags':[{'name':a193_0x1a8e4f(0x135),'type':a193_0x1a8e4f(0x151),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x25897c){const _0x220091=a193_0x1a8e4f,_0x22bfff=loadSqlProjectConfig(_0x25897c['appCode']),_0x154237=await readSqlLockFile(_0x22bfff[_0x220091(0x12e)]),{appLock:_0x583ebd}=ensureSqlLockScope(_0x154237??createEmptySqlLock(),_0x22bfff['appCode'],_0x22bfff[_0x220091(0x130)],_0x220091(0x150)),_0x2326b7=await scanLocalSqlQueries(_0x22bfff),_0x1d6257=[],_0x40f3d1=[],_0x1c66a8=[],_0x427267=[],_0x59954a=new Set(_0x2326b7[_0x220091(0x12f)](_0x2a466f=>_0x2a466f[_0x220091(0x14c)]));for(const _0x122060 of _0x2326b7){const _0x46ae85=await computeSqlFileHash(_0x122060[_0x220091(0x14b)]),_0x44a091=_0x583ebd[_0x220091(0x14d)][_0x122060[_0x220091(0x14c)]],_0x231e12=!!_0x44a091&&_0x44a091[_0x220091(0x149)]!==_0x122060[_0x220091(0x13c)],_0x56ee93=!!_0x44a091&&!!_0x122060[_0x220091(0x14a)]&&_0x44a091['sqlName']!==_0x122060[_0x220091(0x14a)];if(!_0x44a091)_0x1d6257['push'](_0x122060[_0x220091(0x14c)]);else _0x44a091[_0x220091(0x148)]!==_0x46ae85||_0x231e12||_0x56ee93?_0x40f3d1[_0x220091(0x138)](_0x122060[_0x220091(0x14c)]):_0x1c66a8[_0x220091(0x138)](_0x122060[_0x220091(0x14c)]);}for(const _0xec54fd of Object[_0x220091(0x144)](_0x583ebd[_0x220091(0x14d)])){!_0x59954a[_0x220091(0x141)](_0xec54fd)&&_0x427267[_0x220091(0x138)](_0xec54fd);}const _0x13a4c4=[];if(_0x25897c[_0x220091(0x14e)](_0x220091(0x135))){const _0x4fc627=await fetchAllSqlCodes(_0x25897c[_0x220091(0x133)]);for(const _0x17729a of _0x4fc627){!_0x59954a['has'](_0x17729a)&&!_0x583ebd[_0x220091(0x14d)][_0x17729a]&&_0x13a4c4[_0x220091(0x138)](_0x17729a);}}const _0x213e24=_0x1d6257['length']===0x0&&_0x40f3d1['length']===0x0&&_0x427267['length']===0x0&&_0x13a4c4['length']===0x0;return{'ok':!![],'data':{'added':_0x1d6257,'modified':_0x40f3d1,'missing':_0x427267,'unchanged':_0x1c66a8,'remoteOnly':_0x13a4c4},'message':_0x213e24?_0x220091(0x13e):_0x1d6257[_0x220091(0x13a)]+_0x220091(0x12b)+_0x40f3d1[_0x220091(0x13a)]+_0x220091(0x13f)+_0x427267[_0x220091(0x13a)]+_0x220091(0x13d)+_0x1c66a8[_0x220091(0x13a)]+_0x220091(0x131)+(_0x13a4c4[_0x220091(0x13a)]>0x0?',\x20'+_0x13a4c4[_0x220091(0x13a)]+'\x20remote-only':'')};}};
@@ -1 +1 @@
1
- function a196_0x218a(){const _0x4f775c=['Provide\x20--file\x20or\x20--sql','sqlType','22xkuRie','cwd','8705920ZZhRxv','flagMissing','trim','5Yehipc','5326659mqEnHa','length','\x22\x20not\x20found\x20in\x20any\x20dataset','8cQufKm','check-indexes','flatMap','push','schema:','columnNames','--check-indexes\x20requires\x20--schemas.','indexes','isDangerous','from','index_columns','message','tables','schemas','valid','index_type','split','Table\x20\x22','indexName','pkField','schemaWarnings','sql','read','579493aasjyl','str','utf-8','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','map','find','parameters','reason','toLowerCase','62115ZYSefC','validate','joinAudit','fields','index_name','3978864fyZtCU','type','string','2748216kbdgIU','file','columns','primary','tableName','isArray','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','\x22\x20not\x20found\x20or\x20not\x20accessible','4980612OPkLYZ','Dataset\x20\x22','filter','unshift','dbtableConfig','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','name','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','validation','SQL\x20schema\x20validation','dataset'];a196_0x218a=function(){return _0x4f775c;};return a196_0x218a();}const a196_0x243ba2=a196_0x55c2;(function(_0x23a0f6,_0x51b829){const _0x4eb910=a196_0x55c2,_0x49ae76=_0x23a0f6();while(!![]){try{const _0x477538=parseInt(_0x4eb910(0x1eb))/0x1+-parseInt(_0x4eb910(0x211))/0x2*(-parseInt(_0x4eb910(0x1f4))/0x3)+parseInt(_0x4eb910(0x1fc))/0x4+parseInt(_0x4eb910(0x1d0))/0x5*(-parseInt(_0x4eb910(0x1f9))/0x6)+-parseInt(_0x4eb910(0x204))/0x7+parseInt(_0x4eb910(0x1d4))/0x8*(-parseInt(_0x4eb910(0x1d1))/0x9)+parseInt(_0x4eb910(0x1cd))/0xa;if(_0x477538===_0x51b829)break;else _0x49ae76['push'](_0x49ae76['shift']());}catch(_0x359dd4){_0x49ae76['push'](_0x49ae76['shift']());}}}(a196_0x218a,0x6142f));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a196_0x55c2(_0x44baf7,_0x2af3e5){_0x44baf7=_0x44baf7-0x1cc;const _0x218ae2=a196_0x218a();let _0x55c25b=_0x218ae2[_0x44baf7];return _0x55c25b;}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':a196_0x243ba2(0x1e9),'command':a196_0x243ba2(0x1f5),'description':a196_0x243ba2(0x209),'risk':a196_0x243ba2(0x1ea),'flags':[{'name':a196_0x243ba2(0x1fd),'type':a196_0x243ba2(0x1fb),'description':a196_0x243ba2(0x1ee)},{'name':a196_0x243ba2(0x1e9),'type':a196_0x243ba2(0x1fb),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':'schemas','type':'string','description':a196_0x243ba2(0x20b)},{'name':'check-indexes','type':'boolean','description':a196_0x243ba2(0x202)}],async 'execute'(_0x481abd){const _0x1ddd32=a196_0x243ba2,_0x52fc87=_0x481abd[_0x1ddd32(0x1ec)](_0x1ddd32(0x1fd)),_0x55ae0b=_0x481abd[_0x1ddd32(0x1ec)](_0x1ddd32(0x1e9)),_0x183681=_0x481abd[_0x1ddd32(0x1ec)](_0x1ddd32(0x1e1)),_0x583eda=_0x481abd['bool'](_0x1ddd32(0x1d5));if(!_0x52fc87&&!_0x55ae0b)throw CliErrors[_0x1ddd32(0x1ce)](_0x1ddd32(0x1fd),_0x1ddd32(0x20f));if(_0x583eda&&!_0x183681)throw CliErrors[_0x1ddd32(0x20c)](_0x1ddd32(0x1da));let _0xf7d83;if(_0x52fc87){const _0x249b0d=resolve(process[_0x1ddd32(0x1cc)](),_0x52fc87);if(!existsSync(_0x249b0d))throw CliErrors[_0x1ddd32(0x20c)]('File\x20not\x20found:\x20'+_0x249b0d);_0xf7d83=readFileSync(_0x249b0d,_0x1ddd32(0x1ed));}else _0xf7d83=_0x55ae0b;const _0xcb4a40=validateSql(_0xf7d83),_0x1f9e36={'valid':_0xcb4a40[_0x1ddd32(0x1e2)],'sqlType':_0xcb4a40[_0x1ddd32(0x210)][_0x1ddd32(0x1fa)],'isSelectOnly':_0xcb4a40[_0x1ddd32(0x210)]['isSelectOnly'],'isDangerous':_0xcb4a40[_0x1ddd32(0x210)][_0x1ddd32(0x1dc)],'tables':_0xcb4a40['tables'],'parameters':_0xcb4a40[_0x1ddd32(0x1f1)],'message':_0xcb4a40[_0x1ddd32(0x1df)]};_0xcb4a40[_0x1ddd32(0x210)][_0x1ddd32(0x1f2)]&&(_0x1f9e36[_0x1ddd32(0x1f2)]=_0xcb4a40[_0x1ddd32(0x210)][_0x1ddd32(0x1f2)]);if(_0x183681&&_0xcb4a40[_0x1ddd32(0x1e2)]){const _0x708b6c=_0x183681[_0x1ddd32(0x1e4)](',')[_0x1ddd32(0x1ef)](_0xd7029c=>_0xd7029c['trim']())['filter'](Boolean),_0x28c1ed=[],_0x8fd972=[],_0x1c39e6=filterDbTableBackedDatasets(await listDatasets(_0x481abd['appCode'])),_0x47ce77=new Map(_0x1c39e6[_0x1ddd32(0x1ef)](_0x5af94c=>[_0x5af94c[_0x1ddd32(0x208)]?.[_0x1ddd32(0x200)]?.[_0x1ddd32(0x1f3)](),_0x5af94c]));for(const _0x56eb37 of _0xcb4a40[_0x1ddd32(0x1e0)]){const _0x3aecc6=_0x47ce77['get'](_0x56eb37[_0x1ddd32(0x1f3)]());!_0x3aecc6&&_0x28c1ed[_0x1ddd32(0x1d7)](_0x1ddd32(0x1e5)+_0x56eb37+_0x1ddd32(0x1d3));}for(const _0x49912e of _0x708b6c){let _0x250022;try{_0x250022=await getDatasetDetail(_0x49912e);}catch{_0x28c1ed[_0x1ddd32(0x1d7)](_0x1ddd32(0x205)+_0x49912e+_0x1ddd32(0x203));continue;}assertDatasetIsDbTableBacked(_0x250022,_0x1ddd32(0x20d));const _0x1acc0e=Array['isArray'](_0x250022[_0x1ddd32(0x1f7)])?_0x250022[_0x1ddd32(0x1f7)]:[],_0x2feec9=new Set(_0x1acc0e['map'](_0x1fd9d4=>_0x1fd9d4[_0x1ddd32(0x20a)]?.[_0x1ddd32(0x1f3)]())),_0xdbc042=_0x250022['dbtableConfig']?.['tableName']||_0x250022[_0x1ddd32(0x200)]||_0x49912e;_0x1f9e36[_0x1ddd32(0x1d8)+_0xdbc042]={'code':_0x49912e,'tableName':_0xdbc042,'fieldCount':_0x2feec9['size'],'fields':Array[_0x1ddd32(0x1dd)](_0x2feec9)};if(_0x583eda){const _0x5ab889=normalizeDatasetIndexes(_0x250022);_0x8fd972[_0x1ddd32(0x1d7)]({'tableName':_0xdbc042,..._0x5ab889});}}_0x28c1ed['length']>0x0&&(_0x1f9e36[_0x1ddd32(0x1e8)]=_0x28c1ed),_0x583eda&&(_0x1f9e36[_0x1ddd32(0x1f6)]=auditSqlJoinIndexes(_0xf7d83,_0x8fd972));}return{'ok':_0xcb4a40[_0x1ddd32(0x1e2)],'data':_0x1f9e36,'message':_0xcb4a40[_0x1ddd32(0x1df)]};}};function normalizeDatasetIndexes(_0x73b4c){const _0x1e3e10=a196_0x243ba2,_0x2e69c2=Array[_0x1e3e10(0x201)](_0x73b4c?.[_0x1e3e10(0x20e)]?.[_0x1e3e10(0x1db)])?_0x73b4c[_0x1e3e10(0x20e)][_0x1e3e10(0x1db)]:Array[_0x1e3e10(0x201)](_0x73b4c?.[_0x1e3e10(0x1db)])?_0x73b4c[_0x1e3e10(0x1db)]:[],_0x4b527a=_0x2e69c2[_0x1e3e10(0x1d6)](_0x136b50=>{const _0x281aad=_0x1e3e10,_0x25e7c2=Array[_0x281aad(0x201)](_0x136b50?.['index_columns'])?_0x136b50[_0x281aad(0x1de)]:Array[_0x281aad(0x201)](_0x136b50?.[_0x281aad(0x1d9)])?_0x136b50[_0x281aad(0x1d9)]:Array[_0x281aad(0x201)](_0x136b50?.['columns'])?_0x136b50[_0x281aad(0x1fe)]:[],_0xd7f011=_0x25e7c2['filter'](_0x4f3207=>typeof _0x4f3207==='string')[_0x281aad(0x1ef)](_0x521c74=>_0x521c74[_0x281aad(0x1cf)]())[_0x281aad(0x206)](Boolean);if(_0xd7f011[_0x281aad(0x1d2)]===0x0)return[];const _0x399e4e=[_0x136b50?.[_0x281aad(0x1e6)],_0x136b50?.[_0x281aad(0x1f8)],_0x136b50?.['name']][_0x281aad(0x1f0)](_0x48a3a7=>typeof _0x48a3a7===_0x281aad(0x1fb)&&_0x48a3a7[_0x281aad(0x1cf)]()),_0xbd95e5=[_0x136b50?.[_0x281aad(0x1e3)],_0x136b50?.[_0x281aad(0x1fa)]][_0x281aad(0x1f0)](_0x19dbf0=>typeof _0x19dbf0===_0x281aad(0x1fb)&&_0x19dbf0[_0x281aad(0x1cf)]());return[{..._0x399e4e?{'name':_0x399e4e['trim']()}:{},..._0xbd95e5?{'type':_0xbd95e5['trim']()}:{},'columns':_0xd7f011}];}),_0x295e70=[..._0x4b527a],_0x245be3=typeof _0x73b4c?.[_0x1e3e10(0x208)]?.[_0x1e3e10(0x1e7)]===_0x1e3e10(0x1fb)?_0x73b4c[_0x1e3e10(0x208)][_0x1e3e10(0x1e7)][_0x1e3e10(0x1e4)](',')['map'](_0x3ed0e5=>_0x3ed0e5[_0x1e3e10(0x1cf)]())[_0x1e3e10(0x206)](Boolean):[];return _0x245be3[_0x1e3e10(0x1d2)]>0x0&&_0x295e70[_0x1e3e10(0x207)]({'type':_0x1e3e10(0x1ff),'columns':_0x245be3}),{'indexes':_0x295e70,'metadataAvailable':_0x4b527a[_0x1e3e10(0x1d2)]>0x0};}
1
+ function a194_0x6334(){const _0x2157e3=['schema:','read','SQL\x20schema\x20validation','Dataset\x20\x22','isArray','valid','map','sql','indexes','527887CmfpTV','sqlType','filter','dataset','tableName','toLowerCase','11936uJZtYx','str','flagMissing','dbtableConfig','fields','primary','columnNames','6RFZTKK','pkField','appCode','bool','validation','Provide\x20--file\x20or\x20--sql','11kfjTXN','tables','message','parameters','schemas','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','index_columns','80076MYNVbz','file','check-indexes','trim','name','string','get','isSelectOnly','type','\x22\x20not\x20found\x20in\x20any\x20dataset','size','2304VHBtHU','length','push','columns','reason','isDangerous','validate','File\x20not\x20found:\x20','utf-8','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','3656030ktqXlR','boolean','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','schemaWarnings','4022950uuIJcP','10MedgPG','cwd','3REguWD','30739344VjYLjd','find','671084wNxHhd','\x22\x20not\x20found\x20or\x20not\x20accessible','from','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','indexName'];a194_0x6334=function(){return _0x2157e3;};return a194_0x6334();}const a194_0x2799c2=a194_0x38b3;(function(_0x550f8c,_0x925851){const _0x1ca9c7=a194_0x38b3,_0x9c1911=_0x550f8c();while(!![]){try{const _0x178988=-parseInt(_0x1ca9c7(0x1e1))/0x1+-parseInt(_0x1ca9c7(0x1d3))/0x2*(parseInt(_0x1ca9c7(0x1d0))/0x3)+-parseInt(_0x1ca9c7(0x1fb))/0x4*(-parseInt(_0x1ca9c7(0x1ce))/0x5)+parseInt(_0x1ca9c7(0x1ee))/0x6*(-parseInt(_0x1ca9c7(0x1c9))/0x7)+parseInt(_0x1ca9c7(0x1e7))/0x8*(-parseInt(_0x1ca9c7(0x206))/0x9)+-parseInt(_0x1ca9c7(0x1cd))/0xa*(parseInt(_0x1ca9c7(0x1f4))/0xb)+parseInt(_0x1ca9c7(0x1d1))/0xc;if(_0x178988===_0x925851)break;else _0x9c1911['push'](_0x9c1911['shift']());}catch(_0x352d80){_0x9c1911['push'](_0x9c1911['shift']());}}}(a194_0x6334,0x69644));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a194_0x38b3(_0x6236e9,_0x2174f9){_0x6236e9=_0x6236e9-0x1c4;const _0x6334a7=a194_0x6334();let _0x38b303=_0x6334a7[_0x6236e9];return _0x38b303;}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a194_0x2799c2(0x1df),'command':a194_0x2799c2(0x1c4),'description':a194_0x2799c2(0x1f9),'risk':a194_0x2799c2(0x1d9),'flags':[{'name':'file','type':'string','description':a194_0x2799c2(0x1d6)},{'name':a194_0x2799c2(0x1df),'type':a194_0x2799c2(0x200),'description':a194_0x2799c2(0x1c7)},{'name':'schemas','type':a194_0x2799c2(0x200),'description':a194_0x2799c2(0x1cb)},{'name':a194_0x2799c2(0x1fd),'type':a194_0x2799c2(0x1ca),'description':a194_0x2799c2(0x1c8)}],async 'execute'(_0x44282){const _0x518a60=a194_0x2799c2,_0x1a170c=_0x44282[_0x518a60(0x1e8)](_0x518a60(0x1fc)),_0x5c76cc=_0x44282[_0x518a60(0x1e8)](_0x518a60(0x1df)),_0x27e17d=_0x44282[_0x518a60(0x1e8)](_0x518a60(0x1f8)),_0x5010e6=_0x44282[_0x518a60(0x1f1)](_0x518a60(0x1fd));if(!_0x1a170c&&!_0x5c76cc)throw CliErrors[_0x518a60(0x1e9)](_0x518a60(0x1fc),_0x518a60(0x1f3));if(_0x5010e6&&!_0x27e17d)throw CliErrors[_0x518a60(0x1f2)]('--check-indexes\x20requires\x20--schemas.');let _0x17f30b;if(_0x1a170c){const _0x526591=resolve(process[_0x518a60(0x1cf)](),_0x1a170c);if(!existsSync(_0x526591))throw CliErrors[_0x518a60(0x1f2)](_0x518a60(0x1c5)+_0x526591);_0x17f30b=readFileSync(_0x526591,_0x518a60(0x1c6));}else _0x17f30b=_0x5c76cc;const _0x15ae52=validateSql(_0x17f30b),_0x313914={'valid':_0x15ae52[_0x518a60(0x1dd)],'sqlType':_0x15ae52[_0x518a60(0x1e2)][_0x518a60(0x203)],'isSelectOnly':_0x15ae52[_0x518a60(0x1e2)][_0x518a60(0x202)],'isDangerous':_0x15ae52[_0x518a60(0x1e2)][_0x518a60(0x20b)],'tables':_0x15ae52[_0x518a60(0x1f5)],'parameters':_0x15ae52[_0x518a60(0x1f7)],'message':_0x15ae52[_0x518a60(0x1f6)]};_0x15ae52[_0x518a60(0x1e2)][_0x518a60(0x20a)]&&(_0x313914[_0x518a60(0x20a)]=_0x15ae52['sqlType'][_0x518a60(0x20a)]);if(_0x27e17d&&_0x15ae52['valid']){const _0x188c06=_0x27e17d['split'](',')[_0x518a60(0x1de)](_0xd2e389=>_0xd2e389[_0x518a60(0x1fe)]())[_0x518a60(0x1e3)](Boolean),_0x39e4ad=[],_0x391a13=[],_0x545b0b=filterDbTableBackedDatasets(await listDatasets(_0x44282[_0x518a60(0x1f0)])),_0x189563=new Map(_0x545b0b[_0x518a60(0x1de)](_0x3a8fb7=>[_0x3a8fb7[_0x518a60(0x1ea)]?.[_0x518a60(0x1e5)]?.['toLowerCase'](),_0x3a8fb7]));for(const _0xd56a7d of _0x15ae52[_0x518a60(0x1f5)]){const _0x206209=_0x189563[_0x518a60(0x201)](_0xd56a7d[_0x518a60(0x1e6)]());!_0x206209&&_0x39e4ad[_0x518a60(0x208)]('Table\x20\x22'+_0xd56a7d+_0x518a60(0x204));}for(const _0x1d4f25 of _0x188c06){let _0x50602e;try{_0x50602e=await getDatasetDetail(_0x1d4f25);}catch{_0x39e4ad[_0x518a60(0x208)](_0x518a60(0x1db)+_0x1d4f25+_0x518a60(0x1d4));continue;}assertDatasetIsDbTableBacked(_0x50602e,_0x518a60(0x1da));const _0x1e2e91=Array[_0x518a60(0x1dc)](_0x50602e[_0x518a60(0x1eb)])?_0x50602e[_0x518a60(0x1eb)]:[],_0x4c06ce=new Set(_0x1e2e91[_0x518a60(0x1de)](_0x29c4c6=>_0x29c4c6[_0x518a60(0x1ff)]?.[_0x518a60(0x1e6)]())),_0xd36611=_0x50602e[_0x518a60(0x1ea)]?.[_0x518a60(0x1e5)]||_0x50602e[_0x518a60(0x1e5)]||_0x1d4f25;_0x313914[_0x518a60(0x1d8)+_0xd36611]={'code':_0x1d4f25,'tableName':_0xd36611,'fieldCount':_0x4c06ce[_0x518a60(0x205)],'fields':Array[_0x518a60(0x1d5)](_0x4c06ce)};if(_0x5010e6){const _0x558e1b=normalizeDatasetIndexes(_0x50602e);_0x391a13[_0x518a60(0x208)]({'tableName':_0xd36611,..._0x558e1b});}}_0x39e4ad[_0x518a60(0x207)]>0x0&&(_0x313914[_0x518a60(0x1cc)]=_0x39e4ad),_0x5010e6&&(_0x313914['joinAudit']=auditSqlJoinIndexes(_0x17f30b,_0x391a13));}return{'ok':_0x15ae52[_0x518a60(0x1dd)],'data':_0x313914,'message':_0x15ae52[_0x518a60(0x1f6)]};}};function normalizeDatasetIndexes(_0x5b88ce){const _0x23c0ea=a194_0x2799c2,_0x21659b=Array['isArray'](_0x5b88ce?.[_0x23c0ea(0x1e4)]?.['indexes'])?_0x5b88ce[_0x23c0ea(0x1e4)][_0x23c0ea(0x1e0)]:Array[_0x23c0ea(0x1dc)](_0x5b88ce?.[_0x23c0ea(0x1e0)])?_0x5b88ce[_0x23c0ea(0x1e0)]:[],_0x1ca799=_0x21659b['flatMap'](_0x310ee0=>{const _0x54df56=_0x23c0ea,_0x4eaf77=Array[_0x54df56(0x1dc)](_0x310ee0?.[_0x54df56(0x1fa)])?_0x310ee0['index_columns']:Array[_0x54df56(0x1dc)](_0x310ee0?.[_0x54df56(0x1ed)])?_0x310ee0[_0x54df56(0x1ed)]:Array[_0x54df56(0x1dc)](_0x310ee0?.[_0x54df56(0x209)])?_0x310ee0[_0x54df56(0x209)]:[],_0x2c2ecf=_0x4eaf77[_0x54df56(0x1e3)](_0xc0ebce=>typeof _0xc0ebce===_0x54df56(0x200))['map'](_0xd6eb92=>_0xd6eb92[_0x54df56(0x1fe)]())[_0x54df56(0x1e3)](Boolean);if(_0x2c2ecf[_0x54df56(0x207)]===0x0)return[];const _0x357aef=[_0x310ee0?.[_0x54df56(0x1d7)],_0x310ee0?.['index_name'],_0x310ee0?.[_0x54df56(0x1ff)]][_0x54df56(0x1d2)](_0x2f93fb=>typeof _0x2f93fb===_0x54df56(0x200)&&_0x2f93fb['trim']()),_0x1314b6=[_0x310ee0?.['index_type'],_0x310ee0?.[_0x54df56(0x203)]][_0x54df56(0x1d2)](_0x126697=>typeof _0x126697===_0x54df56(0x200)&&_0x126697[_0x54df56(0x1fe)]());return[{..._0x357aef?{'name':_0x357aef['trim']()}:{},..._0x1314b6?{'type':_0x1314b6[_0x54df56(0x1fe)]()}:{},'columns':_0x2c2ecf}];}),_0x1c675e=[..._0x1ca799],_0x49cdc6=typeof _0x5b88ce?.[_0x23c0ea(0x1ea)]?.['pkField']===_0x23c0ea(0x200)?_0x5b88ce[_0x23c0ea(0x1ea)][_0x23c0ea(0x1ef)]['split'](',')[_0x23c0ea(0x1de)](_0x8c28b6=>_0x8c28b6[_0x23c0ea(0x1fe)]())[_0x23c0ea(0x1e3)](Boolean):[];return _0x49cdc6[_0x23c0ea(0x207)]>0x0&&_0x1c675e['unshift']({'type':_0x23c0ea(0x1ec),'columns':_0x49cdc6}),{'indexes':_0x1c675e,'metadataAvailable':_0x1ca799[_0x23c0ea(0x207)]>0x0};}
@@ -1 +1 @@
1
- (function(_0x573dbd,_0x4652ce){const _0x36195b=a197_0x1dc0,_0x4df951=_0x573dbd();while(!![]){try{const _0x286f0d=parseInt(_0x36195b(0x189))/0x1*(-parseInt(_0x36195b(0x18c))/0x2)+-parseInt(_0x36195b(0x191))/0x3*(-parseInt(_0x36195b(0x18b))/0x4)+-parseInt(_0x36195b(0x192))/0x5+-parseInt(_0x36195b(0x18d))/0x6+-parseInt(_0x36195b(0x190))/0x7*(-parseInt(_0x36195b(0x193))/0x8)+parseInt(_0x36195b(0x18e))/0x9*(-parseInt(_0x36195b(0x18a))/0xa)+parseInt(_0x36195b(0x18f))/0xb;if(_0x286f0d===_0x4652ce)break;else _0x4df951['push'](_0x4df951['shift']());}catch(_0x1c8a59){_0x4df951['push'](_0x4df951['shift']());}}}(a197_0x218b,0xd0785));function a197_0x218b(){const _0x33bc98=['2411142VhHoNK','5528922vnHznA','18IbVTim','19022344gRBUzF','4312eDowaQ','2943027AmWWQZ','3619920bDgxnt','13152ghAGYP','1eHbCuk','90410FliHdL','4oNYmZb'];a197_0x218b=function(){return _0x33bc98;};return a197_0x218b();}import{taskStatus}from'../../commands/task/status.js';function a197_0x1dc0(_0x30b781,_0x2b2aa4){_0x30b781=_0x30b781-0x189;const _0x218bfd=a197_0x218b();let _0x1dc0fb=_0x218bfd[_0x30b781];return _0x1dc0fb;}export const taskDefinitions=[taskStatus];
1
+ function a195_0x3844(){const _0x22f9d2=['3876687ceZrcd','5567709HrfEXg','50WcgVak','212547MimvRf','16WaUjoF','431004ANMRvQ','45tdZLaF','2210104cHUVIJ','145041GKUhKB','238362MbgADt'];a195_0x3844=function(){return _0x22f9d2;};return a195_0x3844();}function a195_0x56e4(_0x22d3e4,_0x109f27){_0x22d3e4=_0x22d3e4-0x107;const _0x3844e0=a195_0x3844();let _0x56e4dd=_0x3844e0[_0x22d3e4];return _0x56e4dd;}(function(_0x228840,_0x4dc507){const _0x32ab2c=a195_0x56e4,_0x3f268b=_0x228840();while(!![]){try{const _0x231c42=-parseInt(_0x32ab2c(0x10c))/0x1+parseInt(_0x32ab2c(0x109))/0x2+-parseInt(_0x32ab2c(0x107))/0x3*(parseInt(_0x32ab2c(0x108))/0x4)+parseInt(_0x32ab2c(0x10a))/0x5*(-parseInt(_0x32ab2c(0x10d))/0x6)+-parseInt(_0x32ab2c(0x10f))/0x7+-parseInt(_0x32ab2c(0x10b))/0x8+parseInt(_0x32ab2c(0x10e))/0x9*(parseInt(_0x32ab2c(0x110))/0xa);if(_0x231c42===_0x4dc507)break;else _0x3f268b['push'](_0x3f268b['shift']());}catch(_0x26c8fc){_0x3f268b['push'](_0x3f268b['shift']());}}}(a195_0x3844,0x7ce63));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- const a198_0x3a0bef=a198_0x4537;(function(_0x335338,_0x36163a){const _0x4fc10e=a198_0x4537,_0x24dce3=_0x335338();while(!![]){try{const _0x58f2dc=parseInt(_0x4fc10e(0x1cc))/0x1*(parseInt(_0x4fc10e(0x1d2))/0x2)+parseInt(_0x4fc10e(0x1d4))/0x3*(parseInt(_0x4fc10e(0x1d3))/0x4)+parseInt(_0x4fc10e(0x1c4))/0x5*(-parseInt(_0x4fc10e(0x1c7))/0x6)+-parseInt(_0x4fc10e(0x1d8))/0x7*(parseInt(_0x4fc10e(0x1ca))/0x8)+-parseInt(_0x4fc10e(0x1c2))/0x9+parseInt(_0x4fc10e(0x1c8))/0xa+-parseInt(_0x4fc10e(0x1db))/0xb;if(_0x58f2dc===_0x36163a)break;else _0x24dce3['push'](_0x24dce3['shift']());}catch(_0x38f6be){_0x24dce3['push'](_0x24dce3['shift']());}}}(a198_0x4088,0x36739));function a198_0x4537(_0x599c16,_0x2081eb){_0x599c16=_0x599c16-0x1c2;const _0x4088b6=a198_0x4088();let _0x453725=_0x4088b6[_0x599c16];return _0x453725;}function a198_0x4088(){const _0x3b361f=['apiError',',\x20received\x20','7DYFzji','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','flagMissing','1202113aJgYmE','cookie','190890wScVzY','isTerminal','253885vBfnQz','read','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','12DGIUsa','3132150cXvjaE','trim','1755016CqhuAl','string','1526ARiWDh','compress','task-id','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','taskId','appCode','34VKjFAb','268240jBUoOf','15wwcprw','str'];a198_0x4088=function(){return _0x3b361f;};return a198_0x4088();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':'task','command':'status','description':a198_0x3a0bef(0x1d9),'risk':a198_0x3a0bef(0x1c5),'defaultOutputFormat':a198_0x3a0bef(0x1cd),'structuredErrors':!![],'flags':[{'name':'task-id','type':a198_0x3a0bef(0x1cb),'required':!![],'description':a198_0x3a0bef(0x1cf)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0xa587c5){const _0x4bbbb8=a198_0x3a0bef;if(!_0xa587c5['str'](_0x4bbbb8(0x1ce))[_0x4bbbb8(0x1c9)]())throw CliErrors[_0x4bbbb8(0x1da)](_0x4bbbb8(0x1ce));},async 'execute'(_0x330692){const _0x43f453=a198_0x3a0bef,_0x287247=_0x330692[_0x43f453(0x1d5)](_0x43f453(0x1ce))[_0x43f453(0x1c9)](),_0x12cce8=normalizeAsyncTask(await getAsyncTaskStatus(_0x287247,_0x330692[_0x43f453(0x1d1)],_0x330692[_0x43f453(0x1dc)]));if(_0x12cce8['taskId']!==_0x287247)throw CliErrors[_0x43f453(0x1d6)](_0x43f453(0x1c6)+_0x287247+_0x43f453(0x1d7)+_0x12cce8[_0x43f453(0x1d0)]+'.');const _0x56d5c7=buildAsyncTaskStatusCommand(_0x12cce8[_0x43f453(0x1d0)],_0x330692[_0x43f453(0x1d1)]);return{'ok':!![],'message':asyncTaskMessage(_0x12cce8),'data':{'appCode':_0x330692[_0x43f453(0x1d1)],..._0x12cce8,'query':_0x12cce8[_0x43f453(0x1c3)]?null:{'command':_0x56d5c7}}};}};
1
+ function a196_0x8477(_0x2ef8e4,_0x4bd6f8){_0x2ef8e4=_0x2ef8e4-0x108;const _0x6625e3=a196_0x6625();let _0x8477aa=_0x6625e3[_0x2ef8e4];return _0x8477aa;}const a196_0x5e3ede=a196_0x8477;function a196_0x6625(){const _0x36f88c=[',\x20received\x20','1035374curIkH','compress','read','task-id','taskId','string','2819889BOscsC','isTerminal','10424226ZkcQhs','4tbHOTz','2VzboXQ','task','status','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','appCode','6904528owDBdr','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','69155xntsHt','flagMissing','33522363BfYbvs','trim','cookie','str','556066CLRMjl'];a196_0x6625=function(){return _0x36f88c;};return a196_0x6625();}(function(_0x54b8b4,_0x187458){const _0x24b41f=a196_0x8477,_0xa73ea7=_0x54b8b4();while(!![]){try{const _0x43dbab=-parseInt(_0x24b41f(0x11d))/0x1*(parseInt(_0x24b41f(0x10e))/0x2)+-parseInt(_0x24b41f(0x10a))/0x3*(parseInt(_0x24b41f(0x10d))/0x4)+-parseInt(_0x24b41f(0x115))/0x5+-parseInt(_0x24b41f(0x10c))/0x6+parseInt(_0x24b41f(0x11b))/0x7+parseInt(_0x24b41f(0x113))/0x8+parseInt(_0x24b41f(0x117))/0x9;if(_0x43dbab===_0x187458)break;else _0xa73ea7['push'](_0xa73ea7['shift']());}catch(_0xf1aa76){_0xa73ea7['push'](_0xa73ea7['shift']());}}}(a196_0x6625,0xe5a80));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':a196_0x5e3ede(0x10f),'command':a196_0x5e3ede(0x110),'description':a196_0x5e3ede(0x114),'risk':a196_0x5e3ede(0x11f),'defaultOutputFormat':a196_0x5e3ede(0x11e),'structuredErrors':!![],'flags':[{'name':'task-id','type':a196_0x5e3ede(0x109),'required':!![],'description':'Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x6f88c3){const _0x452835=a196_0x5e3ede;if(!_0x6f88c3['str']('task-id')[_0x452835(0x118)]())throw CliErrors[_0x452835(0x116)](_0x452835(0x120));},async 'execute'(_0x1da533){const _0x64519=a196_0x5e3ede,_0x5f442a=_0x1da533[_0x64519(0x11a)](_0x64519(0x120))[_0x64519(0x118)](),_0x45d662=normalizeAsyncTask(await getAsyncTaskStatus(_0x5f442a,_0x1da533['appCode'],_0x1da533[_0x64519(0x119)]));if(_0x45d662[_0x64519(0x108)]!==_0x5f442a)throw CliErrors['apiError'](_0x64519(0x111)+_0x5f442a+_0x64519(0x11c)+_0x45d662[_0x64519(0x108)]+'.');const _0x31072d=buildAsyncTaskStatusCommand(_0x45d662[_0x64519(0x108)],_0x1da533[_0x64519(0x112)]);return{'ok':!![],'message':asyncTaskMessage(_0x45d662),'data':{'appCode':_0x1da533[_0x64519(0x112)],..._0x45d662,'query':_0x45d662[_0x64519(0x10b)]?null:{'command':_0x31072d}}};}};
@@ -1 +1 @@
1
- (function(_0x1dbf3b,_0x41d86a){const _0x23ab84=a199_0x1993,_0x2c9064=_0x1dbf3b();while(!![]){try{const _0x341b5e=parseInt(_0x23ab84(0x1d2))/0x1*(-parseInt(_0x23ab84(0x1cd))/0x2)+-parseInt(_0x23ab84(0x1d5))/0x3*(parseInt(_0x23ab84(0x1cc))/0x4)+-parseInt(_0x23ab84(0x1d1))/0x5*(parseInt(_0x23ab84(0x1d3))/0x6)+parseInt(_0x23ab84(0x1d6))/0x7+-parseInt(_0x23ab84(0x1ce))/0x8*(parseInt(_0x23ab84(0x1cf))/0x9)+-parseInt(_0x23ab84(0x1d7))/0xa*(-parseInt(_0x23ab84(0x1d4))/0xb)+parseInt(_0x23ab84(0x1d0))/0xc;if(_0x341b5e===_0x41d86a)break;else _0x2c9064['push'](_0x2c9064['shift']());}catch(_0xee8c07){_0x2c9064['push'](_0x2c9064['shift']());}}}(a199_0x4c27,0xee340));function a199_0x1993(_0x13aab4,_0x52c253){_0x13aab4=_0x13aab4-0x1cc;const _0x4c27fb=a199_0x4c27();let _0x199323=_0x4c27fb[_0x13aab4];return _0x199323;}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];function a199_0x4c27(){const _0x21590b=['10KagEjf','12qrHcmN','1222264TUQPKQ','40rEqYBp','647415aylLsu','25921140EOOZnV','5dpbjdi','1MaMLCI','7381548gQKfbI','12451824kILZyl','1279617TcdMUx','8149981uiLwfb'];a199_0x4c27=function(){return _0x21590b;};return a199_0x4c27();}
1
+ (function(_0x51c577,_0x364637){const _0x5c03d1=a197_0x25b3,_0x1ad78e=_0x51c577();while(!![]){try{const _0x5f37de=-parseInt(_0x5c03d1(0xf0))/0x1*(-parseInt(_0x5c03d1(0xec))/0x2)+-parseInt(_0x5c03d1(0xf3))/0x3*(parseInt(_0x5c03d1(0xef))/0x4)+parseInt(_0x5c03d1(0xed))/0x5*(-parseInt(_0x5c03d1(0xe8))/0x6)+parseInt(_0x5c03d1(0xe9))/0x7*(parseInt(_0x5c03d1(0xf1))/0x8)+-parseInt(_0x5c03d1(0xf2))/0x9*(-parseInt(_0x5c03d1(0xea))/0xa)+-parseInt(_0x5c03d1(0xeb))/0xb+parseInt(_0x5c03d1(0xee))/0xc;if(_0x5f37de===_0x364637)break;else _0x1ad78e['push'](_0x1ad78e['shift']());}catch(_0x5808ef){_0x1ad78e['push'](_0x1ad78e['shift']());}}}(a197_0x305d,0x51a36));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a197_0x25b3(_0x5eac83,_0x2cdbde){_0x5eac83=_0x5eac83-0xe8;const _0x305d0d=a197_0x305d();let _0x25b375=_0x305d0d[_0x5eac83];return _0x25b375;}function a197_0x305d(){const _0x15a9fb=['229930qjNXDG','3611289FWAuKs','717254GqZddE','485ygRxjK','5090748fEGcsG','11828XFffpF','1BPTNLM','8JYlzHn','18OHJRra','225yBBKUL','16866hXkuOm','2298023NGtyLX'];a197_0x305d=function(){return _0x15a9fb;};return a197_0x305d();}export const tenantDefinitions=[tenantMembersListDefinition];
@@ -1 +1 @@
1
- const a200_0x51f787=a200_0x4f8d;function a200_0x5827(){const _0x537166=['read','3168095PhFvyK','length','flagMissing','5111825tONrld','Found\x20','2wHVzHP','506736AKODNd','2878264LvyZwd','3848994TzUchN','members-list','36VFfynW','Pass\x20--tenant-code\x20<code>.','trim','str','Exact\x20tenant\x20code','297496BJGkEK','3887368jEnvko','tenant','tenant-code'];a200_0x5827=function(){return _0x537166;};return a200_0x5827();}(function(_0xa9ba2c,_0x55416c){const _0x5c86ce=a200_0x4f8d,_0x3c8c66=_0xa9ba2c();while(!![]){try{const _0x4dffb1=-parseInt(_0x5c86ce(0xc5))/0x1*(parseInt(_0x5c86ce(0xbb))/0x2)+parseInt(_0x5c86ce(0xb4))/0x3+-parseInt(_0x5c86ce(0xb3))/0x4+-parseInt(_0x5c86ce(0xc3))/0x5+parseInt(_0x5c86ce(0xb2))/0x6+-parseInt(_0x5c86ce(0xc0))/0x7+-parseInt(_0x5c86ce(0xbc))/0x8*(-parseInt(_0x5c86ce(0xb6))/0x9);if(_0x4dffb1===_0x55416c)break;else _0x3c8c66['push'](_0x3c8c66['shift']());}catch(_0x215b16){_0x3c8c66['push'](_0x3c8c66['shift']());}}}(a200_0x5827,0xc7fb6));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a200_0x4f8d(_0xe8066f,_0x394c8c){_0xe8066f=_0xe8066f-0xb2;const _0x58279e=a200_0x5827();let _0x4f8d40=_0x58279e[_0xe8066f];return _0x4f8d40;}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a200_0x51f787(0xbd),'command':a200_0x51f787(0xb5),'description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':a200_0x51f787(0xbf),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a200_0x51f787(0xbe),'type':'string','required':!![],'description':a200_0x51f787(0xba)}],async 'validate'(_0x53d2ee){const _0x196e54=a200_0x51f787;if(!_0x53d2ee[_0x196e54(0xb9)](_0x196e54(0xbe))[_0x196e54(0xb8)]())throw CliErrors[_0x196e54(0xc2)](_0x196e54(0xbe),_0x196e54(0xb7));},async 'execute'(_0x1d4b24){const _0x132cf5=a200_0x51f787,_0x2e2ec4=_0x1d4b24[_0x132cf5(0xb9)](_0x132cf5(0xbe))[_0x132cf5(0xb8)](),_0x4fcb82=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x2e2ec4,_0x4fcb82);const _0x2c510a=projectTenantMembers(await listTenantDirectoryMembers(_0x2e2ec4));return{'ok':!![],'data':{'tenantCode':_0x2e2ec4,'items':_0x2c510a,'totalCount':_0x2c510a['length']},'message':_0x132cf5(0xc4)+_0x2c510a[_0x132cf5(0xc1)]+'\x20tenant\x20member(s)'};}};
1
+ const a198_0x638183=a198_0x1267;function a198_0x351f(){const _0x465b6b=['2007mwTsnD','Found\x20','1595ykaKAI','186484LIHEIg','members-list','tenant','length','str','15496awClTM','78010hXNPfC','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','6ZzSUVP','174DFDpVf','Exact\x20tenant\x20code','Pass\x20--tenant-code\x20<code>.','trim','3676064IDXayL','329638XiTEaw','1709105Dlsfpn','8948EDSzjC','tenant-code','flagMissing'];a198_0x351f=function(){return _0x465b6b;};return a198_0x351f();}function a198_0x1267(_0x112f2c,_0x402a7b){_0x112f2c=_0x112f2c-0x156;const _0x351fc1=a198_0x351f();let _0x1267e4=_0x351fc1[_0x112f2c];return _0x1267e4;}(function(_0x5818f8,_0x1212a4){const _0x503ba0=a198_0x1267,_0x347a49=_0x5818f8();while(!![]){try{const _0x526ca3=parseInt(_0x503ba0(0x161))/0x1+parseInt(_0x503ba0(0x159))/0x2+parseInt(_0x503ba0(0x16a))/0x3*(parseInt(_0x503ba0(0x15b))/0x4)+-parseInt(_0x503ba0(0x15a))/0x5*(parseInt(_0x503ba0(0x169))/0x6)+-parseInt(_0x503ba0(0x158))/0x7+parseInt(_0x503ba0(0x166))/0x8*(-parseInt(_0x503ba0(0x15e))/0x9)+parseInt(_0x503ba0(0x167))/0xa*(parseInt(_0x503ba0(0x160))/0xb);if(_0x526ca3===_0x1212a4)break;else _0x347a49['push'](_0x347a49['shift']());}catch(_0x2c53ae){_0x347a49['push'](_0x347a49['shift']());}}}(a198_0x351f,0x4c7b6));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a198_0x638183(0x163),'command':a198_0x638183(0x162),'description':a198_0x638183(0x168),'risk':'read','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'tenant-code','type':'string','required':!![],'description':a198_0x638183(0x16b)}],async 'validate'(_0x2fd80d){const _0x12922f=a198_0x638183;if(!_0x2fd80d[_0x12922f(0x165)](_0x12922f(0x15c))['trim']())throw CliErrors[_0x12922f(0x15d)](_0x12922f(0x15c),_0x12922f(0x156));},async 'execute'(_0x15fcfb){const _0x3ac5f7=a198_0x638183,_0x1d1da6=_0x15fcfb['str'](_0x3ac5f7(0x15c))[_0x3ac5f7(0x157)](),_0x50f5aa=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x1d1da6,_0x50f5aa);const _0x2a39d4=projectTenantMembers(await listTenantDirectoryMembers(_0x1d1da6));return{'ok':!![],'data':{'tenantCode':_0x1d1da6,'items':_0x2a39d4,'totalCount':_0x2a39d4[_0x3ac5f7(0x164)]},'message':_0x3ac5f7(0x15f)+_0x2a39d4[_0x3ac5f7(0x164)]+'\x20tenant\x20member(s)'};}};
@@ -1 +1 @@
1
- (function(_0x4687f4,_0x5b732f){const _0x2cd1ae=a201_0x68ff,_0x273a32=_0x4687f4();while(!![]){try{const _0x35b63f=parseInt(_0x2cd1ae(0x11f))/0x1+parseInt(_0x2cd1ae(0x124))/0x2*(-parseInt(_0x2cd1ae(0x112))/0x3)+parseInt(_0x2cd1ae(0x10d))/0x4*(parseInt(_0x2cd1ae(0x118))/0x5)+parseInt(_0x2cd1ae(0x10f))/0x6+-parseInt(_0x2cd1ae(0x119))/0x7+-parseInt(_0x2cd1ae(0x116))/0x8+parseInt(_0x2cd1ae(0x11e))/0x9;if(_0x35b63f===_0x5b732f)break;else _0x273a32['push'](_0x273a32['shift']());}catch(_0x399bf4){_0x273a32['push'](_0x273a32['shift']());}}}(a201_0x1e91,0x42d81));import{CliErrors}from'../../errors.js';function textOrNull(_0x3f17c4){const _0x5ace83=a201_0x68ff,_0x314d9e=_0x3f17c4?.[_0x5ace83(0x11b)]();return _0x314d9e?_0x314d9e:null;}function a201_0x68ff(_0x291d34,_0x308f44){_0x291d34=_0x291d34-0x10c;const _0x1e910d=a201_0x1e91();let _0x68ff4c=_0x1e910d[_0x291d34];return _0x68ff4c;}export function projectTenantMembers(_0x7da1e6){const _0x51ba45=a201_0x68ff,_0x344d25=new Map();for(const _0x1263ec of _0x7da1e6){const _0x1dbceb=Number(_0x1263ec[_0x51ba45(0x114)]);if(!Number[_0x51ba45(0x10e)](_0x1dbceb)||_0x1dbceb<=0x0)continue;const _0x383ae3={'userId':_0x1dbceb,'username':textOrNull(_0x1263ec[_0x51ba45(0x11d)]),'displayName':textOrNull(_0x1263ec['nickname']),'role':_0x1263ec[_0x51ba45(0x11a)]===!![]?'ADMIN':'MEMBER','status':textOrNull(_0x1263ec[_0x51ba45(0x123)])},_0x10ca49=_0x344d25[_0x51ba45(0x117)](_0x1dbceb);if(!_0x10ca49){_0x344d25[_0x51ba45(0x110)](_0x1dbceb,_0x383ae3);continue;}_0x10ca49[_0x51ba45(0x11d)]??=_0x383ae3[_0x51ba45(0x11d)],_0x10ca49[_0x51ba45(0x120)]??=_0x383ae3[_0x51ba45(0x120)],_0x10ca49['status']??=_0x383ae3[_0x51ba45(0x123)];if(_0x383ae3[_0x51ba45(0x113)]==='ADMIN')_0x10ca49[_0x51ba45(0x113)]='ADMIN';}return[..._0x344d25[_0x51ba45(0x11c)]()][_0x51ba45(0x125)]((_0x104b1d,_0x273c4b)=>_0x104b1d['userId']-_0x273c4b[_0x51ba45(0x114)]);}function a201_0x1e91(){const _0x55d827=['1467fZbihu','role','userId','validation','1843984PlMsZD','get','21955umhTHi','3751349ugUVKP','adminFlag','trim','values','username','11381526JzwycC','6363pwVuhH','displayName','some','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','status','1934IfATmv','sort','Tenant\x20\x22','44VrUtzK','isFinite','1162698znxxzh','set','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.'];a201_0x1e91=function(){return _0x55d827;};return a201_0x1e91();}export function assertTenantAccessible(_0x4a1f15,_0x2c3cdc){const _0x478772=a201_0x68ff;if(_0x2c3cdc[_0x478772(0x121)](_0x95fd47=>_0x95fd47['tenantCode']===_0x4a1f15))return;throw CliErrors[_0x478772(0x115)](_0x478772(0x10c)+_0x4a1f15+_0x478772(0x122),_0x478772(0x111));}
1
+ (function(_0x3bac62,_0x1a5f0a){const _0x5c9d31=a199_0x4953,_0x58ecf4=_0x3bac62();while(!![]){try{const _0x5ceae4=-parseInt(_0x5c9d31(0xe4))/0x1*(-parseInt(_0x5c9d31(0xea))/0x2)+parseInt(_0x5c9d31(0xef))/0x3*(-parseInt(_0x5c9d31(0xf1))/0x4)+parseInt(_0x5c9d31(0xed))/0x5+parseInt(_0x5c9d31(0xec))/0x6+parseInt(_0x5c9d31(0xe6))/0x7+parseInt(_0x5c9d31(0xf2))/0x8+-parseInt(_0x5c9d31(0xdd))/0x9;if(_0x5ceae4===_0x1a5f0a)break;else _0x58ecf4['push'](_0x58ecf4['shift']());}catch(_0x891a44){_0x58ecf4['push'](_0x58ecf4['shift']());}}}(a199_0x20a7,0x9dd5d));import{CliErrors}from'../../errors.js';function textOrNull(_0x2789ed){const _0x42dac8=a199_0x4953,_0x5f345d=_0x2789ed?.[_0x42dac8(0xf3)]();return _0x5f345d?_0x5f345d:null;}function a199_0x20a7(){const _0x193de4=['tenantCode','3874275DdOrDi','userId','sort','some','nickname','validation','username','371097uNQcyp','Tenant\x20\x22','2298688FrsFML','adminFlag','isFinite','set','4KkObFk','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','188916YCcsBl','16760ggEqbH','role','9VpiIeh','values','998372mHtDFB','5762648EQASUx','trim','MEMBER','ADMIN','status'];a199_0x20a7=function(){return _0x193de4;};return a199_0x20a7();}function a199_0x4953(_0x1efea7,_0x5e7771){_0x1efea7=_0x1efea7-0xda;const _0x20a7de=a199_0x20a7();let _0x495365=_0x20a7de[_0x1efea7];return _0x495365;}export function projectTenantMembers(_0x2bba2b){const _0x4c8cd8=a199_0x4953,_0x120b3d=new Map();for(const _0x4c3791 of _0x2bba2b){const _0x344f8d=Number(_0x4c3791['userId']);if(!Number[_0x4c8cd8(0xe8)](_0x344f8d)||_0x344f8d<=0x0)continue;const _0x52cbdc={'userId':_0x344f8d,'username':textOrNull(_0x4c3791[_0x4c8cd8(0xe3)]),'displayName':textOrNull(_0x4c3791[_0x4c8cd8(0xe1)]),'role':_0x4c3791[_0x4c8cd8(0xe7)]===!![]?_0x4c8cd8(0xda):_0x4c8cd8(0xf4),'status':textOrNull(_0x4c3791['status'])},_0x51a438=_0x120b3d['get'](_0x344f8d);if(!_0x51a438){_0x120b3d[_0x4c8cd8(0xe9)](_0x344f8d,_0x52cbdc);continue;}_0x51a438[_0x4c8cd8(0xe3)]??=_0x52cbdc[_0x4c8cd8(0xe3)],_0x51a438['displayName']??=_0x52cbdc['displayName'],_0x51a438[_0x4c8cd8(0xdb)]??=_0x52cbdc[_0x4c8cd8(0xdb)];if(_0x52cbdc[_0x4c8cd8(0xee)]===_0x4c8cd8(0xda))_0x51a438[_0x4c8cd8(0xee)]=_0x4c8cd8(0xda);}return[..._0x120b3d[_0x4c8cd8(0xf0)]()][_0x4c8cd8(0xdf)]((_0x15e15a,_0x4709e0)=>_0x15e15a[_0x4c8cd8(0xde)]-_0x4709e0['userId']);}export function assertTenantAccessible(_0x2d0eab,_0xb6cbe7){const _0x2f7286=a199_0x4953;if(_0xb6cbe7[_0x2f7286(0xe0)](_0x1f33df=>_0x1f33df[_0x2f7286(0xdc)]===_0x2d0eab))return;throw CliErrors[_0x2f7286(0xe2)](_0x2f7286(0xe5)+_0x2d0eab+_0x2f7286(0xeb),'Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}
@@ -1 +1 @@
1
- const a202_0x40a42f=a202_0x17d9;(function(_0x39cdbd,_0x14edd8){const _0x191dc3=a202_0x17d9,_0x1fa2b7=_0x39cdbd();while(!![]){try{const _0x3d0c26=-parseInt(_0x191dc3(0x1e5))/0x1*(-parseInt(_0x191dc3(0x1df))/0x2)+parseInt(_0x191dc3(0x1e2))/0x3+parseInt(_0x191dc3(0x1db))/0x4*(-parseInt(_0x191dc3(0x1e0))/0x5)+parseInt(_0x191dc3(0x1d7))/0x6+parseInt(_0x191dc3(0x1dd))/0x7*(parseInt(_0x191dc3(0x1d6))/0x8)+-parseInt(_0x191dc3(0x1e6))/0x9*(-parseInt(_0x191dc3(0x1d3))/0xa)+parseInt(_0x191dc3(0x1d8))/0xb*(-parseInt(_0x191dc3(0x1da))/0xc);if(_0x3d0c26===_0x14edd8)break;else _0x1fa2b7['push'](_0x1fa2b7['shift']());}catch(_0x5c6702){_0x1fa2b7['push'](_0x1fa2b7['shift']());}}}(a202_0x2d8c,0x2e7b6));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=a202_0x40a42f(0x1d0),CURRENT_BINDING_WARNING='The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.';function readDingTalkUserId(_0x491771){const _0xbcfa29=a202_0x40a42f,_0x370785=_0x491771[_0xbcfa29(0x1ce)](_0xbcfa29(0x1d4))[_0xbcfa29(0x1d5)]();if(!_0x370785)throw CliErrors[_0xbcfa29(0x1d9)]('--ding-talk-user-id\x20cannot\x20be\x20empty.',_0xbcfa29(0x1cf));return _0x370785;}function a202_0x17d9(_0x5ac183,_0x5af8c3){_0x5ac183=_0x5ac183-0x1cd;const _0x2d8c8e=a202_0x2d8c();let _0x17d9f8=_0x2d8c8e[_0x5ac183];return _0x17d9f8;}function buildBindingData(_0x387553,_0x1a8839){const _0xdb1762=a202_0x40a42f;return{'operation':_0xdb1762(0x1dc),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x387553},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x387553,'bound':!![]},'dryRun':_0x1a8839,'backend':{'method':_0xdb1762(0x1d1),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}function a202_0x2d8c(){const _0x1b74ef=['str','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','dingding-sandbox','POST','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','44930TazDqq','ding-talk-user-id','trim','8696xpWPNY','1338726eRlBQG','11dVLqQY','validation','12659388iZNEOw','919784jSUPIo','bind','2135NAHEUz','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','715054mqovYT','5nsjfyM','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','570549UCKNwS','user-account','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','1dJHooB','747wbwISD','string'];a202_0x2d8c=function(){return _0x1b74ef;};return a202_0x2d8c();}export const dingTalkSandboxBind={'service':a202_0x40a42f(0x1e3),'command':'dingding-sandbox-bind','description':a202_0x40a42f(0x1e1),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a202_0x40a42f(0x1d4),'type':a202_0x40a42f(0x1cd),'required':!![],'description':a202_0x40a42f(0x1e4)}],async 'validate'(_0x506801){readDingTalkUserId(_0x506801);},async 'dryRun'(_0x5481a3){const _0x141d78=a202_0x40a42f,_0x4be8a6=readDingTalkUserId(_0x5481a3);return asDryRunResult(buildBindingData(_0x4be8a6,!![]),{'method':_0x141d78(0x1d1),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0xdba1bd){const _0xb3b456=a202_0x40a42f,_0x47c131=readDingTalkUserId(_0xdba1bd),_0x80054e=await bindDingTalkSandboxAccount(_0x47c131);if(_0x80054e!==!![])throw CliErrors['apiError'](_0xb3b456(0x1d2),'Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.');return{'ok':!![],'data':buildBindingData(_0x47c131,![]),'message':_0xb3b456(0x1de)};}};
1
+ function a200_0x2b14(){const _0x1da8f2=['DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','81983JYBtol','ding-talk-user-id','POST','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','1042KqHRBq','1490bKLFxT','trim','write','7499754iMTQPV','--ding-talk-user-id\x20cannot\x20be\x20empty.','2985088PINadh','dingding-sandbox-bind','147MOQXxY','validation','1146QzQwrL','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','282148UZTCly','2548776QOlYrr','95IeKGWw','208596kBfYxV','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','user-account','apiError','dingtalk'];a200_0x2b14=function(){return _0x1da8f2;};return a200_0x2b14();}const a200_0x3f4f1b=a200_0x22de;(function(_0x45dc4d,_0x29cd24){const _0x2d651e=a200_0x22de,_0x51e9e7=_0x45dc4d();while(!![]){try{const _0x4c80d1=-parseInt(_0x2d651e(0x1c6))/0x1*(-parseInt(_0x2d651e(0x1d8))/0x2)+parseInt(_0x2d651e(0x1cb))/0x3+parseInt(_0x2d651e(0x1ca))/0x4*(-parseInt(_0x2d651e(0x1cc))/0x5)+-parseInt(_0x2d651e(0x1cd))/0x6*(-parseInt(_0x2d651e(0x1e0))/0x7)+-parseInt(_0x2d651e(0x1de))/0x8+-parseInt(_0x2d651e(0x1dc))/0x9+parseInt(_0x2d651e(0x1d9))/0xa*(parseInt(_0x2d651e(0x1d4))/0xb);if(_0x4c80d1===_0x29cd24)break;else _0x51e9e7['push'](_0x51e9e7['shift']());}catch(_0x1ef313){_0x51e9e7['push'](_0x51e9e7['shift']());}}}(a200_0x2b14,0xb4cf4));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=a200_0x3f4f1b(0x1d1),CURRENT_BINDING_WARNING=a200_0x3f4f1b(0x1d7);function readDingTalkUserId(_0x503c28){const _0x4a501c=a200_0x3f4f1b,_0x208afb=_0x503c28['str'](_0x4a501c(0x1d5))[_0x4a501c(0x1da)]();if(!_0x208afb)throw CliErrors[_0x4a501c(0x1e1)](_0x4a501c(0x1dd),_0x4a501c(0x1c8));return _0x208afb;}function buildBindingData(_0x2e13a9,_0x1c221f){const _0x4cf5fe=a200_0x3f4f1b;return{'operation':'bind','selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x2e13a9},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x2e13a9,'bound':!![]},'dryRun':_0x1c221f,'backend':{'method':_0x4cf5fe(0x1d6),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}function a200_0x22de(_0x42ab54,_0x3cbc77){_0x42ab54=_0x42ab54-0x1c6;const _0x2b14d8=a200_0x2b14();let _0x22de30=_0x2b14d8[_0x42ab54];return _0x22de30;}export const dingTalkSandboxBind={'service':a200_0x3f4f1b(0x1cf),'command':a200_0x3f4f1b(0x1df),'description':a200_0x3f4f1b(0x1c9),'risk':a200_0x3f4f1b(0x1db),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'ding-talk-user-id','type':'string','required':!![],'description':a200_0x3f4f1b(0x1d3)}],async 'validate'(_0x3eeb9c){readDingTalkUserId(_0x3eeb9c);},async 'dryRun'(_0x28bb07){const _0x369030=a200_0x3f4f1b,_0x51da0d=readDingTalkUserId(_0x28bb07);return asDryRunResult(buildBindingData(_0x51da0d,!![]),{'method':_0x369030(0x1d6),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x185d8a){const _0x31f466=a200_0x3f4f1b,_0x1c9665=readDingTalkUserId(_0x185d8a),_0x2653c6=await bindDingTalkSandboxAccount(_0x1c9665);if(_0x2653c6!==!![])throw CliErrors[_0x31f466(0x1d0)](_0x31f466(0x1d2),_0x31f466(0x1c7));return{'ok':!![],'data':buildBindingData(_0x1c9665,![]),'message':_0x31f466(0x1ce)};}};
@@ -1 +1 @@
1
- function a203_0x5e4b(_0x5bed56,_0xec9e8d){_0x5bed56=_0x5bed56-0x1d1;const _0x55b206=a203_0x55b2();let _0x5e4b3b=_0x55b206[_0x5bed56];return _0x5e4b3b;}function a203_0x55b2(){const _0x27acbf=['228618gMUEZn','202095JoYloy','35192Fnsxfc','45cfingk','6445DOUYcJ','145192XTYMzE','6nbUBUO','343560CwYJjO','632PHHGZS','754019wvlDdP'];a203_0x55b2=function(){return _0x27acbf;};return a203_0x55b2();}(function(_0x12a7a7,_0x2c2e37){const _0x4fef9a=a203_0x5e4b,_0x1992f3=_0x12a7a7();while(!![]){try{const _0x43c90c=parseInt(_0x4fef9a(0x1d5))/0x1+parseInt(_0x4fef9a(0x1d3))/0x2+-parseInt(_0x4fef9a(0x1d4))/0x3+parseInt(_0x4fef9a(0x1d1))/0x4*(-parseInt(_0x4fef9a(0x1d7))/0x5)+parseInt(_0x4fef9a(0x1d9))/0x6*(parseInt(_0x4fef9a(0x1d2))/0x7)+parseInt(_0x4fef9a(0x1d8))/0x8*(parseInt(_0x4fef9a(0x1d6))/0x9)+parseInt(_0x4fef9a(0x1da))/0xa;if(_0x43c90c===_0x2c2e37)break;else _0x1992f3['push'](_0x1992f3['shift']());}catch(_0x5e0058){_0x1992f3['push'](_0x1992f3['shift']());}}}(a203_0x55b2,0x1b2bc));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind];
1
+ (function(_0x246734,_0x5915e0){const _0x1fa7ca=a201_0x4f77,_0xda965a=_0x246734();while(!![]){try{const _0x5db8da=-parseInt(_0x1fa7ca(0x1e3))/0x1+parseInt(_0x1fa7ca(0x1df))/0x2*(parseInt(_0x1fa7ca(0x1e0))/0x3)+parseInt(_0x1fa7ca(0x1e1))/0x4*(parseInt(_0x1fa7ca(0x1e5))/0x5)+parseInt(_0x1fa7ca(0x1e6))/0x6+parseInt(_0x1fa7ca(0x1e7))/0x7+parseInt(_0x1fa7ca(0x1e2))/0x8+-parseInt(_0x1fa7ca(0x1e4))/0x9;if(_0x5db8da===_0x5915e0)break;else _0xda965a['push'](_0xda965a['shift']());}catch(_0x5b74a4){_0xda965a['push'](_0xda965a['shift']());}}}(a201_0x47a5,0x3fc57));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a201_0x47a5(){const _0x2bd8c6=['184971etwtht','6887502nrVLof','891875ELnjZM','1485114BjOwnF','182896yrxYJS','341102wKMCVL','6HfzuyO','4rGfQXK','3346656xVAomV'];a201_0x47a5=function(){return _0x2bd8c6;};return a201_0x47a5();}function a201_0x4f77(_0x2c2c20,_0x40de80){_0x2c2c20=_0x2c2c20-0x1df;const _0x47a516=a201_0x47a5();let _0x4f7755=_0x47a516[_0x2c2c20];return _0x4f7755;}export const userAccountDefinitions=[dingTalkSandboxBind];
@@ -1 +1 @@
1
- const a204_0x7879c7=a204_0x429e;(function(_0x43fefe,_0x22f08a){const _0x3b3212=a204_0x429e,_0x482145=_0x43fefe();while(!![]){try{const _0x249258=-parseInt(_0x3b3212(0x7a))/0x1+-parseInt(_0x3b3212(0x83))/0x2*(parseInt(_0x3b3212(0x7d))/0x3)+-parseInt(_0x3b3212(0x81))/0x4*(-parseInt(_0x3b3212(0x80))/0x5)+-parseInt(_0x3b3212(0x7f))/0x6+parseInt(_0x3b3212(0x84))/0x7*(parseInt(_0x3b3212(0x82))/0x8)+-parseInt(_0x3b3212(0x7c))/0x9*(parseInt(_0x3b3212(0x89))/0xa)+parseInt(_0x3b3212(0x86))/0xb*(parseInt(_0x3b3212(0x85))/0xc);if(_0x249258===_0x22f08a)break;else _0x482145['push'](_0x482145['shift']());}catch(_0x27362c){_0x482145['push'](_0x482145['shift']());}}}(a204_0x51a3,0xafe36));function a204_0x51a3(){const _0xd16d33=['1048458HtpcJu','30BcQwXj','734028wtKNWO','112GcdSCi','2Irdwcd','554890YkpwOR','48qpQgbN','894267wCtFya','workspace\x20add','add','3375290mOHzzj','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','write','326413HYNpHr','App\x20profile\x20name','27qIvxnY','905487RVZpPC','workspace'];a204_0x51a3=function(){return _0xd16d33;};return a204_0x51a3();}function a204_0x429e(_0x551ef6,_0x3ef381){_0x551ef6=_0x551ef6-0x78;const _0x51a395=a204_0x51a3();let _0x429e91=_0x51a395[_0x551ef6];return _0x429e91;}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a204_0x7879c7(0x7e),'command':a204_0x7879c7(0x88),'description':a204_0x7879c7(0x78),'risk':a204_0x7879c7(0x79),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a204_0x7879c7(0x7b),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x410717=>validateAppName(_0x410717,a204_0x7879c7(0x87)),'execute':_0x4fc195=>runAppAdd(_0x4fc195,'workspace\x20add')};
1
+ function a202_0x181b(_0x103f20,_0x10b2d9){_0x103f20=_0x103f20-0x140;const _0x196127=a202_0x1961();let _0x181b74=_0x196127[_0x103f20];return _0x181b74;}const a202_0x4ed65c=a202_0x181b;(function(_0x195024,_0x31d826){const _0x4b93c4=a202_0x181b,_0x372047=_0x195024();while(!![]){try{const _0x4d4f70=-parseInt(_0x4b93c4(0x148))/0x1+-parseInt(_0x4b93c4(0x142))/0x2+parseInt(_0x4b93c4(0x145))/0x3*(-parseInt(_0x4b93c4(0x149))/0x4)+-parseInt(_0x4b93c4(0x140))/0x5*(parseInt(_0x4b93c4(0x14d))/0x6)+parseInt(_0x4b93c4(0x14a))/0x7+-parseInt(_0x4b93c4(0x143))/0x8*(-parseInt(_0x4b93c4(0x144))/0x9)+parseInt(_0x4b93c4(0x141))/0xa;if(_0x4d4f70===_0x31d826)break;else _0x372047['push'](_0x372047['shift']());}catch(_0x4b37e4){_0x372047['push'](_0x372047['shift']());}}}(a202_0x1961,0x23854));function a202_0x1961(){const _0x59c9b1=['App\x20profile\x20name','5HtrCty','6049890OJPNLq','285266pjImBl','2104uVvYgQ','3384aCOUAI','1032lTmPVs','name','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','124171gebZcO','3148qwTxSU','1849323NXHUXy','workspace\x20add','write','1710252uyByLt'];a202_0x1961=function(){return _0x59c9b1;};return a202_0x1961();}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':'workspace','command':'add','description':a202_0x4ed65c(0x147),'risk':a202_0x4ed65c(0x14c),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a202_0x4ed65c(0x146),'description':a202_0x4ed65c(0x14e),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x266ff3=>validateAppName(_0x266ff3,'workspace\x20add'),'execute':_0x1f1867=>runAppAdd(_0x1f1867,a202_0x4ed65c(0x14b))};