@lovrabet/rabetbase-cli 2.3.16-beta.7 → 2.4.1-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 (435) hide show
  1. package/README.md +4 -10
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/capability.js +1 -1
  63. package/lib/commands/dataset/delete.js +1 -1
  64. package/lib/commands/dataset/detail.js +1 -1
  65. package/lib/commands/dataset/extend-update.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/db/analysis-batching.js +1 -1
  80. package/lib/commands/db/analyze-batch-plan.js +1 -1
  81. package/lib/commands/db/analyze-cancel.js +1 -1
  82. package/lib/commands/db/analyze-start.js +1 -1
  83. package/lib/commands/db/analyze-status.js +1 -1
  84. package/lib/commands/db/create.js +1 -1
  85. package/lib/commands/db/delete.js +1 -1
  86. package/lib/commands/db/detail.js +1 -1
  87. package/lib/commands/db/diff.js +1 -1
  88. package/lib/commands/db/index.js +1 -1
  89. package/lib/commands/db/list.js +1 -1
  90. package/lib/commands/db/shared.js +1 -1
  91. package/lib/commands/db/tables.js +1 -1
  92. package/lib/commands/db/test.js +1 -1
  93. package/lib/commands/db/update.js +1 -1
  94. package/lib/commands/doctor.js +1 -1
  95. package/lib/commands/file/index.js +1 -1
  96. package/lib/commands/init/index.js +1 -1
  97. package/lib/commands/issue/index.js +1 -1
  98. package/lib/commands/issue/nudge.js +1 -1
  99. package/lib/commands/issue/report.js +1 -1
  100. package/lib/commands/issue/shared.js +1 -1
  101. package/lib/commands/kb/create.js +1 -1
  102. package/lib/commands/kb/delete.js +1 -1
  103. package/lib/commands/kb/detail.js +1 -1
  104. package/lib/commands/kb/index.js +1 -1
  105. package/lib/commands/kb/list.js +1 -1
  106. package/lib/commands/kb/shared.js +1 -1
  107. package/lib/commands/kb/update.js +1 -1
  108. package/lib/commands/logs/index.js +1 -1
  109. package/lib/commands/menu/asset-update.js +1 -1
  110. package/lib/commands/menu/delete.js +1 -1
  111. package/lib/commands/menu/external-link-create.js +1 -1
  112. package/lib/commands/menu/external-link-update.js +1 -1
  113. package/lib/commands/menu/group-create.js +1 -1
  114. package/lib/commands/menu/group-update.js +1 -1
  115. package/lib/commands/menu/index.js +1 -1
  116. package/lib/commands/menu/list.js +1 -1
  117. package/lib/commands/menu/move.js +1 -1
  118. package/lib/commands/menu/regroup-start.js +1 -1
  119. package/lib/commands/menu/rename.js +1 -1
  120. package/lib/commands/menu/shared/compare-table.js +1 -1
  121. package/lib/commands/menu/shared/delete-plan.js +1 -1
  122. package/lib/commands/menu/shared/facts.js +1 -1
  123. package/lib/commands/menu/shared/index.js +1 -1
  124. package/lib/commands/menu/shared/inquirer.js +1 -1
  125. package/lib/commands/menu/shared/local-pages.js +1 -1
  126. package/lib/commands/menu/shared/logic.js +1 -1
  127. package/lib/commands/menu/shared/mutations.js +1 -1
  128. package/lib/commands/menu/shared/service.js +1 -1
  129. package/lib/commands/menu/shared/sync-core.js +1 -1
  130. package/lib/commands/menu/shared/update-core.js +1 -1
  131. package/lib/commands/menu/shared/valid-url.js +1 -1
  132. package/lib/commands/menu/sync.js +1 -1
  133. package/lib/commands/notification/config-list.js +1 -1
  134. package/lib/commands/notification/index.js +1 -1
  135. package/lib/commands/ocr/index.js +1 -1
  136. package/lib/commands/page/generate-start.js +1 -1
  137. package/lib/commands/page/generate-status.js +1 -1
  138. package/lib/commands/page/index.js +1 -1
  139. package/lib/commands/page/pull.js +1 -1
  140. package/lib/commands/page/push.js +1 -1
  141. package/lib/commands/page/react/create.d.ts +2 -0
  142. package/lib/commands/page/react/create.js +1 -0
  143. package/lib/commands/page/react/detail.d.ts +2 -0
  144. package/lib/commands/page/react/detail.js +1 -0
  145. package/lib/commands/page/react/list.d.ts +2 -0
  146. package/lib/commands/page/react/list.js +1 -0
  147. package/lib/commands/page/react/publish.d.ts +2 -0
  148. package/lib/commands/page/react/publish.js +1 -0
  149. package/lib/commands/page/react/shared.d.ts +78 -0
  150. package/lib/commands/page/react/shared.js +1 -0
  151. package/lib/commands/page/react/syntax.d.ts +18 -0
  152. package/lib/commands/page/react/syntax.js +1 -0
  153. package/lib/commands/page/react/template.d.ts +8 -0
  154. package/lib/commands/page/react/template.js +1 -0
  155. package/lib/commands/page/react/update.d.ts +2 -0
  156. package/lib/commands/page/react/update.js +1 -0
  157. package/lib/commands/page/relation-audit.js +1 -1
  158. package/lib/commands/page/restore.js +1 -1
  159. package/lib/commands/page/shared.d.ts +1 -0
  160. package/lib/commands/page/shared.js +1 -1
  161. package/lib/commands/page/standard-page-status.js +1 -1
  162. package/lib/commands/page/sync.js +1 -1
  163. package/lib/commands/permit/index.js +1 -1
  164. package/lib/commands/permit/page-get.js +1 -1
  165. package/lib/commands/permit/page-set.js +1 -1
  166. package/lib/commands/permit/role-apis-set.js +1 -1
  167. package/lib/commands/permit/role-menus-set.js +1 -1
  168. package/lib/commands/permit/role-menus.js +1 -1
  169. package/lib/commands/permit/shared.js +1 -1
  170. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  171. package/lib/commands/project/create/format-elapsed.js +1 -1
  172. package/lib/commands/project/create/main.js +1 -1
  173. package/lib/commands/project/create/non-interactive.js +1 -1
  174. package/lib/commands/project/create/project-template-path.js +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.js +1 -1
  181. package/lib/commands/role/create.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.js +1 -1
  187. package/lib/commands/role/update.js +1 -1
  188. package/lib/commands/role/user-add.js +1 -1
  189. package/lib/commands/role/user-remove.js +1 -1
  190. package/lib/commands/role/user-resolve.js +1 -1
  191. package/lib/commands/run/index.js +1 -1
  192. package/lib/commands/schema.js +1 -1
  193. package/lib/commands/sql/create.js +1 -1
  194. package/lib/commands/sql/delete.js +1 -1
  195. package/lib/commands/sql/detail.js +1 -1
  196. package/lib/commands/sql/exec.js +1 -1
  197. package/lib/commands/sql/index.js +1 -1
  198. package/lib/commands/sql/list.js +1 -1
  199. package/lib/commands/sql/pull.js +1 -1
  200. package/lib/commands/sql/push.js +1 -1
  201. package/lib/commands/sql/shared.js +1 -1
  202. package/lib/commands/sql/status.js +1 -1
  203. package/lib/commands/sql/validate.js +1 -1
  204. package/lib/commands/task/index.js +1 -1
  205. package/lib/commands/task/status.js +1 -1
  206. package/lib/commands/tenant/index.js +1 -1
  207. package/lib/commands/tenant/members-list.js +1 -1
  208. package/lib/commands/tenant/shared.js +1 -1
  209. package/lib/commands/user-account/dingding-sandbox-bind.d.ts +2 -0
  210. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -0
  211. package/lib/commands/user-account/index.d.ts +2 -0
  212. package/lib/commands/user-account/index.js +1 -0
  213. package/lib/commands/workspace/add.js +1 -1
  214. package/lib/commands/workspace/index.js +1 -1
  215. package/lib/commands/workspace/remove.js +1 -1
  216. package/lib/config/schema.js +1 -1
  217. package/lib/constant/cdn.js +1 -1
  218. package/lib/constant/cli.js +1 -1
  219. package/lib/constant/defaults.js +1 -1
  220. package/lib/constant/domain.js +1 -1
  221. package/lib/constant/env.js +1 -1
  222. package/lib/constant/output.js +1 -1
  223. package/lib/constant/paths.js +1 -1
  224. package/lib/constant/risk.js +1 -1
  225. package/lib/context/app-resolver.js +1 -1
  226. package/lib/context/auth-resolver.js +1 -1
  227. package/lib/context/config-loader.js +1 -1
  228. package/lib/context.js +1 -1
  229. package/lib/core/alias-resolver.js +1 -1
  230. package/lib/core/api-client.d.ts +117 -0
  231. package/lib/core/api-client.js +1 -1
  232. package/lib/core/bff/config.js +1 -1
  233. package/lib/core/bff/file-system.js +1 -1
  234. package/lib/core/bff/hash.js +1 -1
  235. package/lib/core/bff/lock.js +1 -1
  236. package/lib/core/bff/utils.js +1 -1
  237. package/lib/core/db-resolver.js +1 -1
  238. package/lib/core/page/file-system.js +1 -1
  239. package/lib/core/page/hash.js +1 -1
  240. package/lib/core/page/lock.js +1 -1
  241. package/lib/core/sql-index-auditor.js +1 -1
  242. package/lib/core/sql-sync/config.js +1 -1
  243. package/lib/core/sql-sync/file-system.js +1 -1
  244. package/lib/core/sql-sync/hash.js +1 -1
  245. package/lib/core/sql-sync/lock.js +1 -1
  246. package/lib/core/sql-sync/utils.js +1 -1
  247. package/lib/core/sql-validator.js +1 -1
  248. package/lib/errors.js +1 -1
  249. package/lib/framework/build-all-flags.js +1 -1
  250. package/lib/framework/error-output.js +1 -1
  251. package/lib/framework/explicit-yes.js +1 -1
  252. package/lib/framework/flags.js +1 -1
  253. package/lib/framework/help.js +1 -1
  254. package/lib/framework/index.js +1 -1
  255. package/lib/framework/output.js +1 -1
  256. package/lib/framework/response.js +1 -1
  257. package/lib/framework/runner-alias.js +1 -1
  258. package/lib/framework/runner.js +1 -1
  259. package/lib/framework/schema-export.js +1 -1
  260. package/lib/framework/types.js +1 -1
  261. package/lib/generated/build-info.d.ts +4 -4
  262. package/lib/generated/build-info.js +1 -1
  263. package/lib/help.js +1 -1
  264. package/lib/postinstall.d.ts +3 -0
  265. package/lib/postinstall.js +1 -0
  266. package/lib/runtime/confirmation.js +1 -1
  267. package/lib/runtime/event.js +1 -1
  268. package/lib/runtime/index.js +1 -1
  269. package/lib/runtime/queue.js +1 -1
  270. package/lib/runtime/resolve.js +1 -1
  271. package/lib/skills/builtin-skill.d.ts +37 -0
  272. package/lib/skills/builtin-skill.js +1 -0
  273. package/lib/skills/main.js +1 -1
  274. package/lib/skills/npx-skills-add.d.ts +4 -2
  275. package/lib/skills/npx-skills-add.js +1 -1
  276. package/lib/skills/skill-presence.js +1 -1
  277. package/lib/telemetry/cli-command-trace.js +1 -1
  278. package/lib/telemetry/cli-help-trace.js +1 -1
  279. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  280. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  281. package/lib/telemetry/send-cli-trace-log.js +1 -1
  282. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  283. package/lib/utils/ai_config.js +1 -1
  284. package/lib/utils/apply-jq-filter.js +1 -1
  285. package/lib/utils/cdn-config.js +1 -1
  286. package/lib/utils/check-sdk-version.js +1 -1
  287. package/lib/utils/cli-version-check.js +1 -1
  288. package/lib/utils/cli-version-policy.js +1 -1
  289. package/lib/utils/config.js +1 -1
  290. package/lib/utils/copy-directory.js +1 -1
  291. package/lib/utils/entity-with-id.js +1 -1
  292. package/lib/utils/file-utils.js +1 -1
  293. package/lib/utils/guides-cdn.js +1 -1
  294. package/lib/utils/http-client.js +1 -1
  295. package/lib/utils/is-non-interactive.js +1 -1
  296. package/lib/utils/logger.js +1 -1
  297. package/lib/utils/params.js +1 -1
  298. package/lib/utils/platform.js +1 -1
  299. package/lib/utils/rules-cdn.js +1 -1
  300. package/lib/utils/sleep.js +1 -1
  301. package/lib/utils/template-replacer.js +1 -1
  302. package/lib/utils/update-notice.js +1 -1
  303. package/lib/utils/version.js +1 -1
  304. package/lib/utils/with-active-cookie.js +1 -1
  305. package/lib/utils/write-cli-side-channel.js +1 -1
  306. package/package.json +9 -3
  307. package/scripts/postinstall.mjs +24 -0
  308. package/skills/rabetbase/SKILL.md +493 -0
  309. package/skills/rabetbase/guides/backend-function.md +835 -0
  310. package/skills/rabetbase/guides/best-practices.md +137 -0
  311. package/skills/rabetbase/guides/bff-creation-workflow.md +148 -0
  312. package/skills/rabetbase/guides/conflict-detection.md +119 -0
  313. package/skills/rabetbase/guides/data-api-guidelines.md +414 -0
  314. package/skills/rabetbase/guides/database-connection-workflow.md +169 -0
  315. package/skills/rabetbase/guides/frontend-development.md +179 -0
  316. package/skills/rabetbase/guides/legacy-application-blueprint-workflow.md +495 -0
  317. package/skills/rabetbase/guides/menu-anomaly-manual-cleanup.md +137 -0
  318. package/skills/rabetbase/guides/page-development-workflow.md +187 -0
  319. package/skills/rabetbase/guides/react-custom-page-workflow.md +184 -0
  320. package/skills/rabetbase/guides/role-permit-workflow.md +127 -0
  321. package/skills/rabetbase/guides/sql-creation-workflow.md +173 -0
  322. package/skills/rabetbase/guides/sql-mybatis.md +126 -0
  323. package/skills/rabetbase/guides/troubleshooting.md +67 -0
  324. package/skills/rabetbase/guides/typescript-sdk.md +227 -0
  325. package/skills/rabetbase/knowledge/page-schema/LrSmartCreate.md +367 -0
  326. package/skills/rabetbase/knowledge/page-schema/LrSmartDetail.md +153 -0
  327. package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +291 -0
  328. package/skills/rabetbase/knowledge/page-schema/LrSmartFilter.md +478 -0
  329. package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +119 -0
  330. package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +223 -0
  331. package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +632 -0
  332. package/skills/rabetbase/knowledge/page-schema/YtPage.md +172 -0
  333. package/skills/rabetbase/knowledge/page-schema/dataset-relations.md +126 -0
  334. package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +232 -0
  335. package/skills/rabetbase/knowledge/page-schema/field-components.md +312 -0
  336. package/skills/rabetbase/knowledge/page-schema/syntax-reference.md +278 -0
  337. package/skills/rabetbase/knowledge/react-page/components.md +225 -0
  338. package/skills/rabetbase/knowledge/react-page/generation-standards.md +385 -0
  339. package/skills/rabetbase/references/rabetbase-api-list.md +58 -0
  340. package/skills/rabetbase/references/rabetbase-api-pull.md +82 -0
  341. package/skills/rabetbase/references/rabetbase-app-config.md +95 -0
  342. package/skills/rabetbase/references/rabetbase-app-list.md +79 -0
  343. package/skills/rabetbase/references/rabetbase-app-members-list.md +64 -0
  344. package/skills/rabetbase/references/rabetbase-auth-login.md +53 -0
  345. package/skills/rabetbase/references/rabetbase-auth-logout.md +29 -0
  346. package/skills/rabetbase/references/rabetbase-bff-create.md +59 -0
  347. package/skills/rabetbase/references/rabetbase-bff-delete.md +42 -0
  348. package/skills/rabetbase/references/rabetbase-bff-detail.md +38 -0
  349. package/skills/rabetbase/references/rabetbase-bff-list.md +61 -0
  350. package/skills/rabetbase/references/rabetbase-bff-pull.md +42 -0
  351. package/skills/rabetbase/references/rabetbase-bff-push.md +65 -0
  352. package/skills/rabetbase/references/rabetbase-bff-save.md +63 -0
  353. package/skills/rabetbase/references/rabetbase-bff-status.md +37 -0
  354. package/skills/rabetbase/references/rabetbase-cli-skill-install.md +42 -0
  355. package/skills/rabetbase/references/rabetbase-codegen-sdk.md +35 -0
  356. package/skills/rabetbase/references/rabetbase-codegen-sql.md +33 -0
  357. package/skills/rabetbase/references/rabetbase-config.md +296 -0
  358. package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +84 -0
  359. package/skills/rabetbase/references/rabetbase-dataset-delete.md +54 -0
  360. package/skills/rabetbase/references/rabetbase-dataset-detail.md +106 -0
  361. package/skills/rabetbase/references/rabetbase-dataset-extend-update.md +70 -0
  362. package/skills/rabetbase/references/rabetbase-dataset-field-update.md +117 -0
  363. package/skills/rabetbase/references/rabetbase-dataset-generate.md +206 -0
  364. package/skills/rabetbase/references/rabetbase-dataset-list.md +42 -0
  365. package/skills/rabetbase/references/rabetbase-dataset-operations.md +34 -0
  366. package/skills/rabetbase/references/rabetbase-dataset-relation-audit.md +63 -0
  367. package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +141 -0
  368. package/skills/rabetbase/references/rabetbase-dataset-relations.md +71 -0
  369. package/skills/rabetbase/references/rabetbase-dataset-rename.md +107 -0
  370. package/skills/rabetbase/references/rabetbase-dataset-restore.md +54 -0
  371. package/skills/rabetbase/references/rabetbase-db-analyze.md +135 -0
  372. package/skills/rabetbase/references/rabetbase-db-create.md +54 -0
  373. package/skills/rabetbase/references/rabetbase-db-delete.md +26 -0
  374. package/skills/rabetbase/references/rabetbase-db-detail.md +27 -0
  375. package/skills/rabetbase/references/rabetbase-db-diff.md +57 -0
  376. package/skills/rabetbase/references/rabetbase-db-list.md +37 -0
  377. package/skills/rabetbase/references/rabetbase-db-tables.md +25 -0
  378. package/skills/rabetbase/references/rabetbase-db-test.md +29 -0
  379. package/skills/rabetbase/references/rabetbase-db-update.md +29 -0
  380. package/skills/rabetbase/references/rabetbase-doctor.md +62 -0
  381. package/skills/rabetbase/references/rabetbase-file.md +35 -0
  382. package/skills/rabetbase/references/rabetbase-init.md +70 -0
  383. package/skills/rabetbase/references/rabetbase-issue-report.md +132 -0
  384. package/skills/rabetbase/references/rabetbase-kb.md +62 -0
  385. package/skills/rabetbase/references/rabetbase-menu-asset-update.md +135 -0
  386. package/skills/rabetbase/references/rabetbase-menu-delete.md +54 -0
  387. package/skills/rabetbase/references/rabetbase-menu-external-link-create.md +63 -0
  388. package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +74 -0
  389. package/skills/rabetbase/references/rabetbase-menu-group-create.md +33 -0
  390. package/skills/rabetbase/references/rabetbase-menu-group-update.md +38 -0
  391. package/skills/rabetbase/references/rabetbase-menu-list.md +144 -0
  392. package/skills/rabetbase/references/rabetbase-menu-move.md +54 -0
  393. package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +45 -0
  394. package/skills/rabetbase/references/rabetbase-menu-rename.md +48 -0
  395. package/skills/rabetbase/references/rabetbase-menu-sync.md +60 -0
  396. package/skills/rabetbase/references/rabetbase-notification-config-list.md +80 -0
  397. package/skills/rabetbase/references/rabetbase-ocr.md +86 -0
  398. package/skills/rabetbase/references/rabetbase-page-generate-start.md +32 -0
  399. package/skills/rabetbase/references/rabetbase-page-generate-status.md +32 -0
  400. package/skills/rabetbase/references/rabetbase-page-pull.md +47 -0
  401. package/skills/rabetbase/references/rabetbase-page-push.md +45 -0
  402. package/skills/rabetbase/references/rabetbase-page-react-create.md +29 -0
  403. package/skills/rabetbase/references/rabetbase-page-react-detail.md +26 -0
  404. package/skills/rabetbase/references/rabetbase-page-react-list.md +23 -0
  405. package/skills/rabetbase/references/rabetbase-page-react-publish.md +23 -0
  406. package/skills/rabetbase/references/rabetbase-page-react-update.md +24 -0
  407. package/skills/rabetbase/references/rabetbase-page-relation-binding.md +72 -0
  408. package/skills/rabetbase/references/rabetbase-page-restore.md +45 -0
  409. package/skills/rabetbase/references/rabetbase-page-sync.md +36 -0
  410. package/skills/rabetbase/references/rabetbase-permit-page-set.md +69 -0
  411. package/skills/rabetbase/references/rabetbase-permit-role-apis-set.md +53 -0
  412. package/skills/rabetbase/references/rabetbase-permit-role-menus-set.md +57 -0
  413. package/skills/rabetbase/references/rabetbase-project-create.md +46 -0
  414. package/skills/rabetbase/references/rabetbase-project-upgrade.md +57 -0
  415. package/skills/rabetbase/references/rabetbase-role-list.md +68 -0
  416. package/skills/rabetbase/references/rabetbase-role-user-add.md +54 -0
  417. package/skills/rabetbase/references/rabetbase-role-user-resolve.md +27 -0
  418. package/skills/rabetbase/references/rabetbase-run.md +53 -0
  419. package/skills/rabetbase/references/rabetbase-schema.md +22 -0
  420. package/skills/rabetbase/references/rabetbase-sql-create.md +41 -0
  421. package/skills/rabetbase/references/rabetbase-sql-delete.md +37 -0
  422. package/skills/rabetbase/references/rabetbase-sql-detail.md +32 -0
  423. package/skills/rabetbase/references/rabetbase-sql-exec.md +34 -0
  424. package/skills/rabetbase/references/rabetbase-sql-list.md +54 -0
  425. package/skills/rabetbase/references/rabetbase-sql-pull.md +54 -0
  426. package/skills/rabetbase/references/rabetbase-sql-push.md +46 -0
  427. package/skills/rabetbase/references/rabetbase-sql-status.md +39 -0
  428. package/skills/rabetbase/references/rabetbase-sql-validate.md +73 -0
  429. package/skills/rabetbase/references/rabetbase-standard-page-status.md +31 -0
  430. package/skills/rabetbase/references/rabetbase-task-status.md +40 -0
  431. package/skills/rabetbase/references/rabetbase-tenant-members-list.md +69 -0
  432. package/skills/rabetbase/references/rabetbase-update.md +56 -0
  433. package/skills/rabetbase/references/rabetbase-user-account.md +45 -0
  434. package/skills/rabetbase/references/rabetbase-workspace.md +60 -0
  435. package/skills/rabetbase.manifest.json +137 -0
@@ -1 +1 @@
1
- const a180_0x58971a=a180_0x47e5;(function(_0xbec79d,_0x4ee988){const _0x301537=a180_0x47e5,_0x7ef4d9=_0xbec79d();while(!![]){try{const _0x453b73=parseInt(_0x301537(0x1e3))/0x1+parseInt(_0x301537(0x1cc))/0x2+parseInt(_0x301537(0x1d7))/0x3*(-parseInt(_0x301537(0x1ca))/0x4)+parseInt(_0x301537(0x1e6))/0x5*(parseInt(_0x301537(0x1eb))/0x6)+parseInt(_0x301537(0x1d1))/0x7*(parseInt(_0x301537(0x1e0))/0x8)+-parseInt(_0x301537(0x1d2))/0x9*(parseInt(_0x301537(0x1cd))/0xa)+-parseInt(_0x301537(0x1dd))/0xb*(parseInt(_0x301537(0x1cb))/0xc);if(_0x453b73===_0x4ee988)break;else _0x7ef4d9['push'](_0x7ef4d9['shift']());}catch(_0x18b00e){_0x7ef4d9['push'](_0x7ef4d9['shift']());}}}(a180_0x2bc8,0x9596d));import{listSqlQueries}from'../../core/api-client.js';function a180_0x47e5(_0x57cac1,_0x16b4c1){_0x57cac1=_0x57cac1-0x1c8;const _0x2bc8f2=a180_0x2bc8();let _0x47e5da=_0x2bc8f2[_0x57cac1];return _0x47e5da;}function a180_0x2bc8(){const _0x3a0c5d=['verbose','309617NUDivS','description','sqlcode','9408392pSodkl','name','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','57447tldhYk','page','\x20SQL\x20queries\x20(total:\x20','2498570wIAshu','Page\x20size','read','paging','Filter\x20by\x20SQL\x20name','6ibjRdB','pagesize','No\x20custom\x20SQL\x20queries\x20found.','totalCount','appCode','number','List\x20custom\x20SQL\x20queries','116DowaDL','144pcNqzq','497334uAOyWH','1668190IRkStn','length','sqlName','Page\x20number','7ARRMXN','9BBHEnq','list','sqlCode','all','dbId','89439ynTkgp','num','map','str','tableData'];a180_0x2bc8=function(){return _0x3a0c5d;};return a180_0x2bc8();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':a180_0x58971a(0x1d3),'description':a180_0x58971a(0x1c9),'risk':a180_0x58971a(0x1e8),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a180_0x58971a(0x1e1),'type':'string','description':a180_0x58971a(0x1ea)},{'name':a180_0x58971a(0x1e4),'type':'number','description':a180_0x58971a(0x1d0),'default':0x1},{'name':a180_0x58971a(0x1ec),'type':a180_0x58971a(0x1c8),'description':a180_0x58971a(0x1e7)},{'name':a180_0x58971a(0x1dc),'type':'boolean','description':a180_0x58971a(0x1e2)}],async 'execute'(_0x1c1fa5){const _0x2231cf=a180_0x58971a,_0xc5db84=await listSqlQueries(_0x1c1fa5[_0x2231cf(0x1ef)],{'sqlCode':_0x1c1fa5[_0x2231cf(0x1da)](_0x2231cf(0x1df))||undefined,'sqlName':_0x1c1fa5[_0x2231cf(0x1da)](_0x2231cf(0x1e1))||undefined,'currentPage':_0x1c1fa5['num']('page'),'pageSize':_0x1c1fa5[_0x2231cf(0x1d8)](_0x2231cf(0x1ec),0x32)}),_0x4f56a1=_0x1c1fa5['bool'](_0x2231cf(0x1dc)),_0x2c91fe=_0xc5db84[_0x2231cf(0x1db)]??[],_0x1e5e7e=_0xc5db84[_0x2231cf(0x1e9)]?.[_0x2231cf(0x1ee)]??_0x2c91fe['length'];let _0x43ff6e;return _0x4f56a1?_0x43ff6e=_0x2c91fe:_0x43ff6e=await Promise[_0x2231cf(0x1d5)](_0x2c91fe[_0x2231cf(0x1d9)](async _0x1c4fe8=>{const _0x444766=_0x2231cf;let _0x302348;try{_0x302348=_0x1c4fe8['dbId']?await getDbName(_0x1c1fa5[_0x444766(0x1ef)],_0x1c4fe8['dbId']):undefined;}catch{}return{'sqlCode':_0x1c4fe8[_0x444766(0x1d4)],'sqlName':_0x1c4fe8[_0x444766(0x1cf)],'description':_0x1c4fe8[_0x444766(0x1de)]??'','db':_0x302348?_0x302348+'\x20('+_0x1c4fe8['dbId']+')':_0x1c4fe8[_0x444766(0x1d6)]??''};})),{'ok':!![],'data':_0x43ff6e,'message':_0x2c91fe[_0x2231cf(0x1ce)]===0x0?_0x2231cf(0x1ed):'Found\x20'+_0x2c91fe[_0x2231cf(0x1ce)]+_0x2231cf(0x1e5)+_0x1e5e7e+').'};}};
1
+ const a188_0x4a957d=a188_0x97b4;function a188_0x3d4a(){const _0x277528=['3687992WljeZD','12jlMnRg','24kMoeVy','name','Found\x20','40jrmxrF','Filter\x20by\x20SQL\x20name','304Rdpbqu','description','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','totalCount','length','Page\x20number','sqlcode','129510ABLeBE','appCode','\x20SQL\x20queries\x20(total:\x20','10052003dqWsWO','Page\x20size','paging','sql','page','bool','List\x20custom\x20SQL\x20queries','125370bsbgSl','18qlTcHO','num','boolean','604GVvtBw','266283LSgRUi','sqlName','48PwoayT','read','number','str','pagesize','all','tableData','sqlCode','dbId','235598wUAubi'];a188_0x3d4a=function(){return _0x277528;};return a188_0x3d4a();}(function(_0x47568f,_0x38e9ba){const _0x3ca403=a188_0x97b4,_0x2c1f3e=_0x47568f();while(!![]){try{const _0x31adf3=parseInt(_0x3ca403(0x1ae))/0x1*(parseInt(_0x3ca403(0x1c3))/0x2)+parseInt(_0x3ca403(0x1b5))/0x3*(parseInt(_0x3ca403(0x1a9))/0x4)+parseInt(_0x3ca403(0x1bf))/0x5*(-parseInt(_0x3ca403(0x1c0))/0x6)+-parseInt(_0x3ca403(0x1a7))/0x7+parseInt(_0x3ca403(0x1c6))/0x8*(parseInt(_0x3ca403(0x1c4))/0x9)+-parseInt(_0x3ca403(0x1ac))/0xa*(-parseInt(_0x3ca403(0x1a6))/0xb)+parseInt(_0x3ca403(0x1a8))/0xc*(parseInt(_0x3ca403(0x1b8))/0xd);if(_0x31adf3===_0x38e9ba)break;else _0x2c1f3e['push'](_0x2c1f3e['shift']());}catch(_0x2348bd){_0x2c1f3e['push'](_0x2c1f3e['shift']());}}}(a188_0x3d4a,0xbfb17));import{listSqlQueries}from'../../core/api-client.js';function a188_0x97b4(_0x119260,_0x1a996a){_0x119260=_0x119260-0x1a1;const _0x3d4a0d=a188_0x3d4a();let _0x97b42f=_0x3d4a0d[_0x119260];return _0x97b42f;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a188_0x4a957d(0x1bb),'command':'list','description':a188_0x4a957d(0x1be),'risk':a188_0x4a957d(0x1c7),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a188_0x4a957d(0x1aa),'type':'string','description':a188_0x4a957d(0x1ad)},{'name':a188_0x4a957d(0x1bc),'type':a188_0x4a957d(0x1c8),'description':a188_0x4a957d(0x1b3),'default':0x1},{'name':a188_0x4a957d(0x1a1),'type':'number','description':a188_0x4a957d(0x1b9)},{'name':'verbose','type':a188_0x4a957d(0x1c2),'description':a188_0x4a957d(0x1b0)}],async 'execute'(_0xc9d8be){const _0x626bbb=a188_0x4a957d,_0x39c754=await listSqlQueries(_0xc9d8be['appCode'],{'sqlCode':_0xc9d8be['str'](_0x626bbb(0x1b4))||undefined,'sqlName':_0xc9d8be[_0x626bbb(0x1c9)](_0x626bbb(0x1aa))||undefined,'currentPage':_0xc9d8be['num'](_0x626bbb(0x1bc)),'pageSize':_0xc9d8be[_0x626bbb(0x1c1)](_0x626bbb(0x1a1),0x32)}),_0x462244=_0xc9d8be[_0x626bbb(0x1bd)]('verbose'),_0x74ed76=_0x39c754[_0x626bbb(0x1a3)]??[],_0xfb7783=_0x39c754[_0x626bbb(0x1ba)]?.[_0x626bbb(0x1b1)]??_0x74ed76[_0x626bbb(0x1b2)];let _0x5c3d6b;return _0x462244?_0x5c3d6b=_0x74ed76:_0x5c3d6b=await Promise[_0x626bbb(0x1a2)](_0x74ed76['map'](async _0x5a9e3d=>{const _0x567643=_0x626bbb;let _0x1fd0cf;try{_0x1fd0cf=_0x5a9e3d[_0x567643(0x1a5)]?await getDbName(_0xc9d8be[_0x567643(0x1b6)],_0x5a9e3d[_0x567643(0x1a5)]):undefined;}catch{}return{'sqlCode':_0x5a9e3d[_0x567643(0x1a4)],'sqlName':_0x5a9e3d[_0x567643(0x1c5)],'description':_0x5a9e3d[_0x567643(0x1af)]??'','db':_0x1fd0cf?_0x1fd0cf+'\x20('+_0x5a9e3d[_0x567643(0x1a5)]+')':_0x5a9e3d[_0x567643(0x1a5)]??''};})),{'ok':!![],'data':_0x5c3d6b,'message':_0x74ed76[_0x626bbb(0x1b2)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x626bbb(0x1ab)+_0x74ed76[_0x626bbb(0x1b2)]+_0x626bbb(0x1b7)+_0xfb7783+').'};}};
@@ -1 +1 @@
1
- const a181_0x350241=a181_0x20d7;(function(_0x43923f,_0x109345){const _0x23686f=a181_0x20d7,_0x209184=_0x43923f();while(!![]){try{const _0x16a044=parseInt(_0x23686f(0x169))/0x1+parseInt(_0x23686f(0x16e))/0x2*(parseInt(_0x23686f(0x1a3))/0x3)+parseInt(_0x23686f(0x19f))/0x4*(parseInt(_0x23686f(0x1a9))/0x5)+-parseInt(_0x23686f(0x177))/0x6+-parseInt(_0x23686f(0x186))/0x7+-parseInt(_0x23686f(0x185))/0x8+parseInt(_0x23686f(0x196))/0x9;if(_0x16a044===_0x109345)break;else _0x209184['push'](_0x209184['shift']());}catch(_0x3f3571){_0x209184['push'](_0x209184['shift']());}}}(a181_0x2248,0x4d823));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';function a181_0x20d7(_0x424603,_0x4a6a5c){_0x424603=_0x424603-0x169;const _0x2248aa=a181_0x2248();let _0x20d7a3=_0x2248aa[_0x424603];return _0x20d7a3;}import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a181_0x2248(){const _0x554a49=['catch','dbId','2912337YwPKPG','name','lockFilePath','bool','\x20failed','push','filter','would_pull','apps','176SAyZWl','Force\x20overwrite\x20local\x20unsynced\x20changes','paging','Would\x20pull\x20','42PxwiVR','appCode','cancelled','\x20skipped,\x20','toISOString','sqlcode','54355FdlIGj','replace','38865cxZpCh','unchanged','boolean','sqlRootDir','sql','27934JuEJUh','force','Filter\x20by\x20SQL\x20display\x20name','str','sqlContent','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqlCode','sqlRoot','skipped','650598ACMaBj','trimStart','message','test','pull','description','\x20written,\x20','local\x20differs\x20from\x20remote','lastSync','sqls','join','mybatisXml','read','conflict','4680288HodGxl','177632RNQyfS','split','\x20SQL\x20file(s)\x20into\x20','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','totalCount','path','Force\x20pull\x20cancelled.','length','sqlName','nonInteractive','utf8','tableData','Pull\x20complete:\x20','POST'];a181_0x2248=function(){return _0x554a49;};return a181_0x2248();}import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x572c91,_0x3b69d9){const _0x3cd0fc=a181_0x20d7,_0x278e04=[];let _0x2402ab=0x1;while(!![]){const _0x26aaf8=await listSqlQueries(_0x572c91,{'currentPage':_0x2402ab,'pageSize':PAGE_SIZE,'sqlCode':_0x3b69d9[_0x3cd0fc(0x174)],'sqlName':_0x3b69d9[_0x3cd0fc(0x18e)]}),_0xe03fb8=_0x26aaf8[_0x3cd0fc(0x191)]??[];_0x278e04[_0x3cd0fc(0x19b)](..._0xe03fb8);if(_0xe03fb8[_0x3cd0fc(0x18d)]===0x0)break;const _0x23e123=_0x26aaf8[_0x3cd0fc(0x1a1)]?.[_0x3cd0fc(0x18a)];if(_0x23e123!=null?_0x278e04[_0x3cd0fc(0x18d)]>=_0x23e123:_0xe03fb8[_0x3cd0fc(0x18d)]<PAGE_SIZE)break;_0x2402ab++;}return _0x278e04;}async function ensureSqlContent(_0x4a4353){const _0x2e825=a181_0x20d7;if(_0x4a4353['sqlContent']!=null&&String(_0x4a4353[_0x2e825(0x172)])[_0x2e825(0x18d)]>0x0)return _0x4a4353;return getSqlQueryDetail(_0x4a4353[_0x2e825(0x174)]);}export const sqlPull={'service':a181_0x350241(0x16d),'command':'pull','description':a181_0x350241(0x189),'risk':a181_0x350241(0x183),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':'string','description':a181_0x350241(0x170)},{'name':a181_0x350241(0x16f),'type':a181_0x350241(0x16b),'description':a181_0x350241(0x1a0)}],async 'dryRun'(_0x2ce7c5){const _0x50cc36=a181_0x350241,_0xc667d7=loadSqlProjectConfig(_0x2ce7c5[_0x50cc36(0x1a4)]),_0x2a4d4d=await readSqlLockFile(_0xc667d7[_0x50cc36(0x198)]),{appLock:_0x42aabc}=ensureSqlLockScope(_0x2a4d4d??createEmptySqlLock(),_0xc667d7['appCode'],_0xc667d7[_0x50cc36(0x175)],_0x50cc36(0x17b)),_0x4fc4d8=await fetchAllSqlQueries(_0x2ce7c5[_0x50cc36(0x1a4)],{'sqlCode':_0x2ce7c5[_0x50cc36(0x171)](_0x50cc36(0x1a8))||undefined,'sqlName':_0x2ce7c5[_0x50cc36(0x171)](_0x50cc36(0x197))||undefined}),_0x2692b7=[];for(const _0x40c004 of _0x4fc4d8){const _0x36abc0=await ensureSqlContent(_0x40c004),_0x10b7f4=ensureRemoteSqlContent(_0x36abc0),_0x1f7544=detectModeFromSql(_0x36abc0),_0x229fae=_0x36abc0[_0x50cc36(0x195)]?await getDbName(_0x2ce7c5[_0x50cc36(0x1a4)],Number(_0x36abc0['dbId']))['catch'](()=>undefined):undefined,_0x2fbd51=buildLocalSqlFileContent({'sqlCode':_0x36abc0[_0x50cc36(0x174)],'sqlName':_0x36abc0[_0x50cc36(0x18e)],'dbId':_0x36abc0['dbId']},_0x10b7f4,{'dbName':_0x229fae,'mode':_0x1f7544,'syncedAt':new Date()[_0x50cc36(0x1a7)](),'description':_0x36abc0[_0x50cc36(0x17c)]}),_0x21c5c4=buildSqlLockEntry(_0x36abc0,_0x10b7f4,'',{'dbName':_0x229fae}),_0x3c104b=resolveLocalSqlFilePath(_0xc667d7,_0x36abc0[_0x50cc36(0x174)],_0x21c5c4);let _0xd63fe4=_0x50cc36(0x19d),_0x1c8cc3;if(await fileExists(_0x3c104b)){const _0x3c8ca8=await readFile(_0x3c104b,'utf8');isEquivalentPulledSqlFile(_0x3c8ca8,_0x2fbd51,_0x1f7544)?(_0xd63fe4=_0x50cc36(0x176),_0x1c8cc3=_0x50cc36(0x16a)):(_0xd63fe4=_0x50cc36(0x184),_0x1c8cc3='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)');}_0x2692b7[_0x50cc36(0x19b)]({'sqlCode':_0x36abc0[_0x50cc36(0x174)],'sqlName':_0x36abc0['sqlName'],'filePath':_0x3c104b,'status':_0xd63fe4,'reason':_0x1c8cc3});}return{'method':_0x50cc36(0x193),'url':_0x50cc36(0x173),'body':{'appCode':_0x2ce7c5['appCode'],'sqlCode':_0x2ce7c5['str'](_0x50cc36(0x1a8))||null,'sqlName':_0x2ce7c5[_0x50cc36(0x171)](_0x50cc36(0x197))||null,'files':_0x2692b7},'description':_0x50cc36(0x1a2)+_0x2692b7['length']+_0x50cc36(0x188)+_0xc667d7[_0x50cc36(0x16c)]};},async 'execute'(_0x22d063){const _0xef5083=a181_0x350241,_0xd0aa4c=loadSqlProjectConfig(_0x22d063[_0xef5083(0x1a4)]),_0x384f70=await readSqlLockFile(_0xd0aa4c[_0xef5083(0x198)]),{lockData:_0x4527bb,appLock:_0x14c9d9}=ensureSqlLockScope(_0x384f70??createEmptySqlLock(),_0xd0aa4c['appCode'],_0xd0aa4c['sqlRoot'],_0xef5083(0x17b)),_0xbe6a0a=_0x22d063[_0xef5083(0x199)](_0xef5083(0x16f)),_0xb95303=await fetchAllSqlQueries(_0x22d063[_0xef5083(0x1a4)],{'sqlCode':_0x22d063[_0xef5083(0x171)](_0xef5083(0x1a8))||undefined,'sqlName':_0x22d063[_0xef5083(0x171)](_0xef5083(0x197))||undefined});if(_0xb95303[_0xef5083(0x18d)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x5da1bb=[],_0x506e00=[];for(const _0x506b8e of _0xb95303){try{_0x5da1bb[_0xef5083(0x19b)](await ensureSqlContent(_0x506b8e));}catch(_0x252349){_0x506e00['push']({'sqlCode':_0x506b8e[_0xef5083(0x174)],'error':_0x252349 instanceof Error?_0x252349[_0xef5083(0x179)]:String(_0x252349)});}}if(_0xbe6a0a&&!_0x22d063[_0xef5083(0x18f)]){let _0x56cf46=![];for(const _0x1455dc of _0x5da1bb){const _0x754d94=detectModeFromSql(_0x1455dc),_0x341536=_0x1455dc[_0xef5083(0x195)]?await getDbName(_0x22d063[_0xef5083(0x1a4)],Number(_0x1455dc['dbId']))[_0xef5083(0x194)](()=>undefined):undefined,_0x2792e7=buildLocalSqlFileContent({'sqlCode':_0x1455dc['sqlCode'],'sqlName':_0x1455dc[_0xef5083(0x18e)],'dbId':_0x1455dc[_0xef5083(0x195)]},ensureRemoteSqlContent(_0x1455dc),{'dbName':_0x341536,'mode':_0x754d94,'syncedAt':new Date()[_0xef5083(0x1a7)](),'description':_0x1455dc[_0xef5083(0x17c)]}),_0x129e4f=resolveLocalSqlFilePath(_0xd0aa4c,_0x1455dc['sqlCode'],buildSqlLockEntry(_0x1455dc,ensureRemoteSqlContent(_0x1455dc),'',{'dbName':_0x341536}));if(await fileExists(_0x129e4f)){const _0x3ce5ec=await readFile(_0x129e4f,_0xef5083(0x190));if(!isEquivalentPulledSqlFile(_0x3ce5ec,_0x2792e7,_0x754d94)){_0x56cf46=!![];break;}}}if(_0x56cf46){const _0x157909=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x157909)throw CliErrors[_0xef5083(0x1a5)](_0xef5083(0x18c));}}const _0x52ed9f=cloneSqlLockData(_0x4527bb),_0x92ca1=_0x52ed9f[_0xef5083(0x19e)][_0xd0aa4c[_0xef5083(0x1a4)]],_0x5d48c4=[],_0x485d74=[];for(const _0x1ca332 of _0x5da1bb){const _0x51598b=_0x92ca1[_0xef5083(0x180)][_0x1ca332[_0xef5083(0x174)]],_0x4ec5c5=ensureRemoteSqlContent(_0x1ca332),_0xb601eb=detectModeFromSql(_0x1ca332),_0x261645=_0x1ca332['dbId']?await getDbName(_0x22d063[_0xef5083(0x1a4)],Number(_0x1ca332[_0xef5083(0x195)]))['catch'](()=>undefined):undefined,_0x268362=buildLocalSqlFileContent({'sqlCode':_0x1ca332[_0xef5083(0x174)],'sqlName':_0x1ca332[_0xef5083(0x18e)],'dbId':_0x1ca332[_0xef5083(0x195)]},_0x4ec5c5,{'dbName':_0x261645,'mode':_0xb601eb,'syncedAt':new Date()['toISOString'](),'description':_0x1ca332[_0xef5083(0x17c)]}),_0x18b676=buildSqlLockEntry(_0x1ca332,_0x4ec5c5,computeSqlContentHash(_0x268362),{'dbName':_0x261645}),_0x526c50=_0x18b676[_0xef5083(0x18b)],_0x1cbda7=join(_0xd0aa4c[_0xef5083(0x16c)],_0x526c50);try{if(await fileExists(_0x1cbda7)){const _0x466cc2=await readFile(_0x1cbda7,_0xef5083(0x190));if(isEquivalentPulledSqlFile(_0x466cc2,_0x268362,_0xb601eb)){_0x485d74[_0xef5083(0x19b)]({'sqlCode':_0x1ca332['sqlCode'],'reason':_0xef5083(0x16a)}),_0x92ca1['sqls'][_0x1ca332[_0xef5083(0x174)]]={..._0x18b676,'hash':computeSqlContentHash(_0x466cc2),'path':_0x526c50};continue;}if(!_0xbe6a0a){_0x485d74[_0xef5083(0x19b)]({'sqlCode':_0x1ca332[_0xef5083(0x174)],'reason':_0xef5083(0x17e)});continue;}}const _0x1fe176=_0x51598b?.[_0xef5083(0x18b)]?join(_0xd0aa4c['sqlRootDir'],_0x51598b[_0xef5083(0x18b)]):undefined;_0x1fe176&&_0x1fe176!==_0x1cbda7&&await fileExists(_0x1fe176)&&await rm(_0x1fe176,{'force':!![]}),await ensureParentDirectory(_0x1cbda7),await writeFile(_0x1cbda7,_0x268362,_0xef5083(0x190)),_0x92ca1[_0xef5083(0x180)][_0x1ca332[_0xef5083(0x174)]]={..._0x18b676,'path':_0x526c50},_0x5d48c4['push']({'sqlCode':_0x1ca332[_0xef5083(0x174)],'filePath':_0x1cbda7});}catch(_0x3f2b95){_0x506e00[_0xef5083(0x19b)]({'sqlCode':_0x1ca332[_0xef5083(0x174)],'error':_0x3f2b95 instanceof Error?_0x3f2b95[_0xef5083(0x179)]:String(_0x3f2b95)});}}return _0x92ca1[_0xef5083(0x17f)]=new Date()['toISOString'](),await writeSqlLockFile(_0xd0aa4c[_0xef5083(0x198)],_0x52ed9f),{'ok':_0x506e00[_0xef5083(0x18d)]===0x0,'data':{'pulled':_0x5d48c4,'skipped':_0x485d74,'failed':_0x506e00},'message':_0xef5083(0x192)+_0x5d48c4[_0xef5083(0x18d)]+_0xef5083(0x17d)+_0x485d74[_0xef5083(0x18d)]+_0xef5083(0x1a6)+_0x506e00['length']+_0xef5083(0x19a)};}};function detectModeFromSql(_0x520cdb){const _0x3b3dc9=a181_0x350241,_0x5d678e=ensureRemoteSqlContent(_0x520cdb),_0x5f57cb=stripLocalSqlMetadata(_0x5d678e,_0x3b3dc9(0x182))[_0x3b3dc9(0x178)]();if(/^<(select|insert|update|delete)\b/i[_0x3b3dc9(0x17a)](_0x5f57cb))return _0x3b3dc9(0x182);return'sql';}function isEquivalentPulledSqlFile(_0x3d7d4f,_0x3c5b95,_0x508762){return normalizePullComparableContent(_0x3d7d4f,_0x508762)===normalizePullComparableContent(_0x3c5b95,_0x508762);}function normalizePullComparableContent(_0x3050c4,_0x40820b){const _0x1c7390=a181_0x350241,_0x49461e=_0x3050c4[_0x1c7390(0x1aa)](/\r\n/g,'\x0a')[_0x1c7390(0x187)]('\x0a'),_0x590ae5=_0x49461e[_0x1c7390(0x19c)](_0x11b34e=>!isSyncedAtMetadataLine(_0x11b34e,_0x40820b));return _0x590ae5[_0x1c7390(0x181)]('\x0a');}function isSyncedAtMetadataLine(_0x59fafa,_0x3beb75){const _0x17dff3=a181_0x350241;if(_0x3beb75===_0x17dff3(0x182))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x59fafa);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x59fafa);}
1
+ const a189_0x2d5f98=a189_0x38d1;(function(_0x5e71f8,_0x3c761e){const _0x1822cb=a189_0x38d1,_0x55e7e0=_0x5e71f8();while(!![]){try{const _0x1eb95b=-parseInt(_0x1822cb(0x179))/0x1*(parseInt(_0x1822cb(0x17b))/0x2)+parseInt(_0x1822cb(0x15a))/0x3*(parseInt(_0x1822cb(0x18f))/0x4)+-parseInt(_0x1822cb(0x191))/0x5*(parseInt(_0x1822cb(0x17f))/0x6)+parseInt(_0x1822cb(0x158))/0x7*(parseInt(_0x1822cb(0x192))/0x8)+parseInt(_0x1822cb(0x16f))/0x9*(-parseInt(_0x1822cb(0x168))/0xa)+-parseInt(_0x1822cb(0x163))/0xb+-parseInt(_0x1822cb(0x17e))/0xc*(-parseInt(_0x1822cb(0x162))/0xd);if(_0x1eb95b===_0x3c761e)break;else _0x55e7e0['push'](_0x55e7e0['shift']());}catch(_0x357a06){_0x55e7e0['push'](_0x55e7e0['shift']());}}}(a189_0x4ee7,0x949e2));import{readFile,rm,writeFile}from'node:fs/promises';function a189_0x38d1(_0x597f83,_0x50891e){_0x597f83=_0x597f83-0x153;const _0x4ee7c1=a189_0x4ee7();let _0x38d1d8=_0x4ee7c1[_0x597f83];return _0x38d1d8;}import{join}from'node:path';function a189_0x4ee7(){const _0x4d9098=['7ssXhhF','conflict','5046jAcnze','test','toISOString','boolean','sqlcode','Filter\x20by\x20SQL\x20display\x20name','sqls','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','25129EwGOiv','5045458jnHSro','sqlName','catch','utf8','dbId','956870PqVHNy','nonInteractive','\x20written,\x20','description','Force\x20pull\x20cancelled.','unchanged','str','45CTxNzv','message','\x20SQL\x20file(s)\x20into\x20','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','pull','push','name','split','\x20failed','sqlRoot','78522fDcqsG','replace','20qpfxmf','lockFilePath','POST','5760BVhziP','42gDNjhW','sqlCode','trimStart','sqlContent','Pull\x20complete:\x20','path','string','paging','sqlRootDir','would_pull','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','length','sql','skipped','Force\x20overwrite\x20local\x20unsynced\x20changes','filter','2764NttxTE','mybatisXml','534130bjHcmx','7910008qFQwnU','appCode','cancelled','bool','force','No\x20remote\x20SQL\x20queries\x20matched.','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.'];a189_0x4ee7=function(){return _0x4d9098;};return a189_0x4ee7();}import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x36cf71,_0x4acb0a){const _0x1f6635=a189_0x38d1,_0x2f694d=[];let _0x357071=0x1;while(!![]){const _0x56af98=await listSqlQueries(_0x36cf71,{'currentPage':_0x357071,'pageSize':PAGE_SIZE,'sqlCode':_0x4acb0a[_0x1f6635(0x180)],'sqlName':_0x4acb0a[_0x1f6635(0x164)]}),_0xc2861f=_0x56af98['tableData']??[];_0x2f694d[_0x1f6635(0x174)](..._0xc2861f);if(_0xc2861f['length']===0x0)break;const _0x4d6171=_0x56af98[_0x1f6635(0x186)]?.['totalCount'];if(_0x4d6171!=null?_0x2f694d['length']>=_0x4d6171:_0xc2861f['length']<PAGE_SIZE)break;_0x357071++;}return _0x2f694d;}async function ensureSqlContent(_0x4b5b54){const _0x517853=a189_0x38d1;if(_0x4b5b54[_0x517853(0x182)]!=null&&String(_0x4b5b54[_0x517853(0x182)])['length']>0x0)return _0x4b5b54;return getSqlQueryDetail(_0x4b5b54[_0x517853(0x180)]);}export const sqlPull={'service':'sql','command':a189_0x2d5f98(0x173),'description':a189_0x2d5f98(0x172),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a189_0x2d5f98(0x175),'type':a189_0x2d5f98(0x185),'description':a189_0x2d5f98(0x15f)},{'name':a189_0x2d5f98(0x155),'type':a189_0x2d5f98(0x15d),'description':a189_0x2d5f98(0x18d)}],async 'dryRun'(_0xa7053c){const _0x295c36=a189_0x2d5f98,_0x57556f=loadSqlProjectConfig(_0xa7053c[_0x295c36(0x193)]),_0xeda08e=await readSqlLockFile(_0x57556f[_0x295c36(0x17c)]),{appLock:_0x4a300f}=ensureSqlLockScope(_0xeda08e??createEmptySqlLock(),_0x57556f['appCode'],_0x57556f[_0x295c36(0x178)],_0x295c36(0x173)),_0x471900=await fetchAllSqlQueries(_0xa7053c['appCode'],{'sqlCode':_0xa7053c[_0x295c36(0x16e)](_0x295c36(0x15e))||undefined,'sqlName':_0xa7053c[_0x295c36(0x16e)](_0x295c36(0x175))||undefined}),_0x173589=[];for(const _0x199aa9 of _0x471900){const _0x26a4b9=await ensureSqlContent(_0x199aa9),_0x116add=ensureRemoteSqlContent(_0x26a4b9),_0x22ee05=detectModeFromSql(_0x26a4b9),_0x2b3c15=_0x26a4b9[_0x295c36(0x167)]?await getDbName(_0xa7053c[_0x295c36(0x193)],Number(_0x26a4b9['dbId']))[_0x295c36(0x165)](()=>undefined):undefined,_0x4534ac=buildLocalSqlFileContent({'sqlCode':_0x26a4b9[_0x295c36(0x180)],'sqlName':_0x26a4b9[_0x295c36(0x164)],'dbId':_0x26a4b9[_0x295c36(0x167)]},_0x116add,{'dbName':_0x2b3c15,'mode':_0x22ee05,'syncedAt':new Date()[_0x295c36(0x15c)](),'description':_0x26a4b9[_0x295c36(0x16b)]}),_0x43d492=buildSqlLockEntry(_0x26a4b9,_0x116add,'',{'dbName':_0x2b3c15}),_0x11376b=resolveLocalSqlFilePath(_0x57556f,_0x26a4b9['sqlCode'],_0x43d492);let _0x57ab86=_0x295c36(0x188),_0x57bae6;if(await fileExists(_0x11376b)){const _0x2607e8=await readFile(_0x11376b,_0x295c36(0x166));isEquivalentPulledSqlFile(_0x2607e8,_0x4534ac,_0x22ee05)?(_0x57ab86=_0x295c36(0x18c),_0x57bae6=_0x295c36(0x16d)):(_0x57ab86=_0x295c36(0x159),_0x57bae6=_0x295c36(0x161));}_0x173589['push']({'sqlCode':_0x26a4b9['sqlCode'],'sqlName':_0x26a4b9['sqlName'],'filePath':_0x11376b,'status':_0x57ab86,'reason':_0x57bae6});}return{'method':_0x295c36(0x17d),'url':_0x295c36(0x189),'body':{'appCode':_0xa7053c[_0x295c36(0x193)],'sqlCode':_0xa7053c['str'](_0x295c36(0x15e))||null,'sqlName':_0xa7053c[_0x295c36(0x16e)](_0x295c36(0x175))||null,'files':_0x173589},'description':'Would\x20pull\x20'+_0x173589[_0x295c36(0x18a)]+_0x295c36(0x171)+_0x57556f[_0x295c36(0x187)]};},async 'execute'(_0x181621){const _0x1c746a=a189_0x2d5f98,_0x5f30c6=loadSqlProjectConfig(_0x181621[_0x1c746a(0x193)]),_0x3ada8e=await readSqlLockFile(_0x5f30c6['lockFilePath']),{lockData:_0x47cd08,appLock:_0xd3033d}=ensureSqlLockScope(_0x3ada8e??createEmptySqlLock(),_0x5f30c6[_0x1c746a(0x193)],_0x5f30c6['sqlRoot'],_0x1c746a(0x173)),_0x431f9d=_0x181621[_0x1c746a(0x154)](_0x1c746a(0x155)),_0x202a51=await fetchAllSqlQueries(_0x181621[_0x1c746a(0x193)],{'sqlCode':_0x181621['str'](_0x1c746a(0x15e))||undefined,'sqlName':_0x181621['str'](_0x1c746a(0x175))||undefined});if(_0x202a51['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x1c746a(0x156)};const _0x1dffd3=[],_0x4bb1f0=[];for(const _0x4ceee8 of _0x202a51){try{_0x1dffd3['push'](await ensureSqlContent(_0x4ceee8));}catch(_0x2841f4){_0x4bb1f0[_0x1c746a(0x174)]({'sqlCode':_0x4ceee8[_0x1c746a(0x180)],'error':_0x2841f4 instanceof Error?_0x2841f4['message']:String(_0x2841f4)});}}if(_0x431f9d&&!_0x181621[_0x1c746a(0x169)]){let _0x49906a=![];for(const _0x1098b5 of _0x1dffd3){const _0x55f700=detectModeFromSql(_0x1098b5),_0x5e16b7=_0x1098b5[_0x1c746a(0x167)]?await getDbName(_0x181621[_0x1c746a(0x193)],Number(_0x1098b5[_0x1c746a(0x167)]))[_0x1c746a(0x165)](()=>undefined):undefined,_0x32f561=buildLocalSqlFileContent({'sqlCode':_0x1098b5[_0x1c746a(0x180)],'sqlName':_0x1098b5['sqlName'],'dbId':_0x1098b5[_0x1c746a(0x167)]},ensureRemoteSqlContent(_0x1098b5),{'dbName':_0x5e16b7,'mode':_0x55f700,'syncedAt':new Date()[_0x1c746a(0x15c)](),'description':_0x1098b5[_0x1c746a(0x16b)]}),_0x1eb99c=resolveLocalSqlFilePath(_0x5f30c6,_0x1098b5[_0x1c746a(0x180)],buildSqlLockEntry(_0x1098b5,ensureRemoteSqlContent(_0x1098b5),'',{'dbName':_0x5e16b7}));if(await fileExists(_0x1eb99c)){const _0x246d3f=await readFile(_0x1eb99c,'utf8');if(!isEquivalentPulledSqlFile(_0x246d3f,_0x32f561,_0x55f700)){_0x49906a=!![];break;}}}if(_0x49906a){const _0x56a06f=await confirmForceOverwrite(_0x1c746a(0x157));if(!_0x56a06f)throw CliErrors[_0x1c746a(0x153)](_0x1c746a(0x16c));}}const _0x30c7ce=cloneSqlLockData(_0x47cd08),_0x378e99=_0x30c7ce['apps'][_0x5f30c6[_0x1c746a(0x193)]],_0xf2ba11=[],_0x362cba=[];for(const _0x3dfaea of _0x1dffd3){const _0x57e00a=_0x378e99['sqls'][_0x3dfaea[_0x1c746a(0x180)]],_0x4aa01a=ensureRemoteSqlContent(_0x3dfaea),_0x35fa3e=detectModeFromSql(_0x3dfaea),_0x41c87b=_0x3dfaea[_0x1c746a(0x167)]?await getDbName(_0x181621['appCode'],Number(_0x3dfaea['dbId']))['catch'](()=>undefined):undefined,_0x3a14d7=buildLocalSqlFileContent({'sqlCode':_0x3dfaea[_0x1c746a(0x180)],'sqlName':_0x3dfaea[_0x1c746a(0x164)],'dbId':_0x3dfaea[_0x1c746a(0x167)]},_0x4aa01a,{'dbName':_0x41c87b,'mode':_0x35fa3e,'syncedAt':new Date()[_0x1c746a(0x15c)](),'description':_0x3dfaea[_0x1c746a(0x16b)]}),_0x365f62=buildSqlLockEntry(_0x3dfaea,_0x4aa01a,computeSqlContentHash(_0x3a14d7),{'dbName':_0x41c87b}),_0x20a762=_0x365f62['path'],_0x4e8af6=join(_0x5f30c6[_0x1c746a(0x187)],_0x20a762);try{if(await fileExists(_0x4e8af6)){const _0xda69b6=await readFile(_0x4e8af6,'utf8');if(isEquivalentPulledSqlFile(_0xda69b6,_0x3a14d7,_0x35fa3e)){_0x362cba[_0x1c746a(0x174)]({'sqlCode':_0x3dfaea[_0x1c746a(0x180)],'reason':_0x1c746a(0x16d)}),_0x378e99[_0x1c746a(0x160)][_0x3dfaea[_0x1c746a(0x180)]]={..._0x365f62,'hash':computeSqlContentHash(_0xda69b6),'path':_0x20a762};continue;}if(!_0x431f9d){_0x362cba[_0x1c746a(0x174)]({'sqlCode':_0x3dfaea['sqlCode'],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x1b45ed=_0x57e00a?.[_0x1c746a(0x184)]?join(_0x5f30c6[_0x1c746a(0x187)],_0x57e00a[_0x1c746a(0x184)]):undefined;_0x1b45ed&&_0x1b45ed!==_0x4e8af6&&await fileExists(_0x1b45ed)&&await rm(_0x1b45ed,{'force':!![]}),await ensureParentDirectory(_0x4e8af6),await writeFile(_0x4e8af6,_0x3a14d7,_0x1c746a(0x166)),_0x378e99[_0x1c746a(0x160)][_0x3dfaea[_0x1c746a(0x180)]]={..._0x365f62,'path':_0x20a762},_0xf2ba11[_0x1c746a(0x174)]({'sqlCode':_0x3dfaea[_0x1c746a(0x180)],'filePath':_0x4e8af6});}catch(_0x3c45f8){_0x4bb1f0[_0x1c746a(0x174)]({'sqlCode':_0x3dfaea[_0x1c746a(0x180)],'error':_0x3c45f8 instanceof Error?_0x3c45f8[_0x1c746a(0x170)]:String(_0x3c45f8)});}}return _0x378e99['lastSync']=new Date()[_0x1c746a(0x15c)](),await writeSqlLockFile(_0x5f30c6[_0x1c746a(0x17c)],_0x30c7ce),{'ok':_0x4bb1f0['length']===0x0,'data':{'pulled':_0xf2ba11,'skipped':_0x362cba,'failed':_0x4bb1f0},'message':_0x1c746a(0x183)+_0xf2ba11['length']+_0x1c746a(0x16a)+_0x362cba['length']+'\x20skipped,\x20'+_0x4bb1f0['length']+_0x1c746a(0x177)};}};function detectModeFromSql(_0x54eb9d){const _0x4327b7=a189_0x2d5f98,_0x565bd1=ensureRemoteSqlContent(_0x54eb9d),_0x26888d=stripLocalSqlMetadata(_0x565bd1,_0x4327b7(0x190))[_0x4327b7(0x181)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x26888d))return _0x4327b7(0x190);return _0x4327b7(0x18b);}function isEquivalentPulledSqlFile(_0x112a1d,_0x393278,_0x38f3a1){return normalizePullComparableContent(_0x112a1d,_0x38f3a1)===normalizePullComparableContent(_0x393278,_0x38f3a1);}function normalizePullComparableContent(_0x22ea52,_0x44ccab){const _0x12fd9b=a189_0x2d5f98,_0x7998ad=_0x22ea52[_0x12fd9b(0x17a)](/\r\n/g,'\x0a')[_0x12fd9b(0x176)]('\x0a'),_0x593a12=_0x7998ad[_0x12fd9b(0x18e)](_0x3c6b22=>!isSyncedAtMetadataLine(_0x3c6b22,_0x44ccab));return _0x593a12['join']('\x0a');}function isSyncedAtMetadataLine(_0x23bdb9,_0x37eac7){const _0x5da92b=a189_0x2d5f98;if(_0x37eac7===_0x5da92b(0x190))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x23bdb9);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x5da92b(0x15b)](_0x23bdb9);}
@@ -1 +1 @@
1
- const a182_0x565ba6=a182_0x5cba;(function(_0x4c319c,_0x2e7a8b){const _0x2bee=a182_0x5cba,_0xf769a7=_0x4c319c();while(!![]){try{const _0xb4219f=-parseInt(_0x2bee(0x18b))/0x1+-parseInt(_0x2bee(0x177))/0x2*(-parseInt(_0x2bee(0x181))/0x3)+-parseInt(_0x2bee(0x16f))/0x4+-parseInt(_0x2bee(0x16e))/0x5+parseInt(_0x2bee(0x186))/0x6+-parseInt(_0x2bee(0x167))/0x7*(parseInt(_0x2bee(0x188))/0x8)+parseInt(_0x2bee(0x166))/0x9;if(_0xb4219f===_0x2e7a8b)break;else _0xf769a7['push'](_0xf769a7['shift']());}catch(_0x5c61dc){_0xf769a7['push'](_0xf769a7['shift']());}}}(a182_0x133f,0x50265));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a182_0x133f(){const _0x2da317=['sqlcode','get','dbId','entries','lastSync','str','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','join','projectRoot','validation','exec','message','dbDirectory','Local\x20SQL\x20not\x20found:\x20','sqlRootDir','toISOString','\x22\x20for\x20sqlCode\x20','8872272TNbkyX','4517177gUFBVP','POST','/smartapi/custom/updateUserCustomSql','path','remoteId','sqls','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','1988605kJogHz','53444dqnXnF','mode','No\x20local\x20SQL\x20files\x20found.','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','sqlConfig','dbName','\x20pushed,\x20','high-risk-write','132ZpXLYx','force','\x20SQL\x20file(s)','utf8','catch','appCode','map','hash','relativePath','No\x20database\x20matches\x20local\x20directory\x20\x22','17196pDWNkp','startsWith','filePath','length','lockFilePath','3876870MMNiTp','push','8EcBUrU','bool','sqlName','625579smbfaj','Push\x20complete:\x20','filter','sqlCode','sqlRoot','has','version'];a182_0x133f=function(){return _0x2da317;};return a182_0x133f();}import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';function a182_0x5cba(_0x58aa12,_0x390e33){_0x58aa12=_0x58aa12-0x14f;const _0x133f9d=a182_0x133f();let _0x5cba04=_0x133f9d[_0x58aa12];return _0x5cba04;}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x4eb44f,_0x354245,_0x1d2b2a){const _0x3e3771=a182_0x5cba,_0x8ae037=await scanLocalSqlQueries(_0x4eb44f),_0x7e0891=new Map();for(const _0xf8ae66 of _0x8ae037){if(_0x1d2b2a&&_0xf8ae66[_0x3e3771(0x151)]!==_0x1d2b2a)continue;const _0x4ae5aa=_0x7e0891[_0x3e3771(0x156)](_0xf8ae66[_0x3e3771(0x151)])??[];_0x4ae5aa[_0x3e3771(0x187)](_0xf8ae66),_0x7e0891['set'](_0xf8ae66[_0x3e3771(0x151)],_0x4ae5aa);}if(_0x1d2b2a&&!_0x7e0891[_0x3e3771(0x153)](_0x1d2b2a))throw CliErrors[_0x3e3771(0x15e)](_0x3e3771(0x162)+_0x1d2b2a);const _0x555070=[];for(const [_0x4ab87f,_0x4efbed]of _0x7e0891[_0x3e3771(0x158)]()){if(_0x4efbed[_0x3e3771(0x184)]===0x1){_0x555070['push'](_0x4efbed[0x0]);continue;}const _0x3184a3=_0x354245['sqls'][_0x4ab87f],_0x4f6955=_0x3184a3?.[_0x3e3771(0x16a)],_0x45fcf9=_0x4f6955?_0x4efbed[_0x3e3771(0x150)](_0x2264b2=>_0x2264b2['relativePath']!==_0x4f6955):_0x4efbed;if(_0x3184a3&&_0x45fcf9['length']===0x1){_0x555070[_0x3e3771(0x187)](_0x45fcf9[0x0]);continue;}throw CliErrors[_0x3e3771(0x15e)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x4ab87f+_0x3e3771(0x15b));}return _0x555070;}export const sqlPush={'service':'sql','command':'push','description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a182_0x565ba6(0x176),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a182_0x565ba6(0x178),'type':'boolean','description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x47ecf2){const _0x5dd1c0=a182_0x565ba6,_0x181bca=loadSqlProjectConfig(_0x47ecf2[_0x5dd1c0(0x17c)]),_0x4b2880=await readSqlLockFile(_0x181bca[_0x5dd1c0(0x185)]),{appLock:_0x2591ad}=ensureSqlLockScope(_0x4b2880??createEmptySqlLock(),_0x47ecf2[_0x5dd1c0(0x17c)],_0x181bca['sqlRoot'],'push'),_0x569ebb=await getTargetSqlQueries(_0x181bca,_0x2591ad,_0x47ecf2[_0x5dd1c0(0x15a)](_0x5dd1c0(0x155))||undefined),_0x17451a=[];for(const _0x2c9c77 of _0x569ebb){const _0x51d25b=await computeSqlFileHash(_0x2c9c77[_0x5dd1c0(0x183)]),_0x1002c6=_0x2591ad['sqls'][_0x2c9c77['sqlCode']],_0x5407ad=!!_0x1002c6&&(_0x1002c6['path']!==_0x2c9c77[_0x5dd1c0(0x17f)]||!!_0x2c9c77[_0x5dd1c0(0x18a)]&&_0x1002c6[_0x5dd1c0(0x18a)]!==_0x2c9c77[_0x5dd1c0(0x18a)]);if(!_0x47ecf2[_0x5dd1c0(0x189)](_0x5dd1c0(0x178))&&_0x1002c6&&_0x1002c6[_0x5dd1c0(0x17e)]===_0x51d25b&&!_0x5407ad)continue;_0x17451a[_0x5dd1c0(0x187)](_0x2c9c77[_0x5dd1c0(0x151)]);}return{'method':_0x5dd1c0(0x168),'url':_0x5dd1c0(0x169),'body':{'sqlCodes':_0x17451a,'appCode':_0x47ecf2['appCode']},'description':'Would\x20push\x20'+_0x17451a[_0x5dd1c0(0x184)]+_0x5dd1c0(0x179)};},async 'execute'(_0x2a2800){const _0x596eb2=a182_0x565ba6,_0x11b011=loadSqlProjectConfig(_0x2a2800[_0x596eb2(0x17c)]),_0x497273=await readSqlLockFile(_0x11b011[_0x596eb2(0x185)]),{lockData:_0x150d02,appLock:_0x27456c}=ensureSqlLockScope(_0x497273??createEmptySqlLock(),_0x2a2800[_0x596eb2(0x17c)],_0x11b011[_0x596eb2(0x152)],_0x596eb2(0x187)),_0x2add6d=await getTargetSqlQueries(_0x11b011,_0x27456c,_0x2a2800[_0x596eb2(0x15a)]('sqlcode')||undefined);if(_0x2add6d['length']===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x596eb2(0x171)};const _0x4bc016=[],_0x41f378=[],_0x874b41=[];for(const _0x523d88 of _0x2add6d){const _0x4d26e4=_0x27456c[_0x596eb2(0x16c)][_0x523d88[_0x596eb2(0x151)]];if(!_0x4d26e4){_0x874b41[_0x596eb2(0x187)]({'sqlCode':_0x523d88[_0x596eb2(0x151)],'error':_0x596eb2(0x16d)});continue;}try{const _0xb81e1a=await computeSqlFileHash(_0x523d88['filePath']),_0x133167=_0x4d26e4[_0x596eb2(0x16a)]!==_0x523d88['relativePath']||!!_0x523d88['sqlName']&&_0x4d26e4['sqlName']!==_0x523d88[_0x596eb2(0x18a)];if(!_0x2a2800[_0x596eb2(0x189)](_0x596eb2(0x178))&&_0x4d26e4[_0x596eb2(0x17e)]===_0xb81e1a&&!_0x133167){_0x41f378[_0x596eb2(0x187)]({'sqlCode':_0x523d88[_0x596eb2(0x151)],'reason':'unchanged'});continue;}if(_0x4d26e4[_0x596eb2(0x154)]==null){_0x874b41[_0x596eb2(0x187)]({'sqlCode':_0x523d88[_0x596eb2(0x151)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0xaa865e=await readFile(_0x523d88[_0x596eb2(0x183)],_0x596eb2(0x17a)),_0x5627=stripLocalSqlMetadata(_0xaa865e,_0x523d88['mode']),_0x36cf32=_0x523d88['sqlName']||_0x4d26e4['sqlName'],_0x327d38=await resolveTargetDbBinding(_0x2a2800['appCode'],_0x523d88,_0x4d26e4),_0x2c8d5c=await updateSqlQuery({'id':_0x4d26e4[_0x596eb2(0x16b)],'appCode':_0x2a2800[_0x596eb2(0x17c)],'sqlCode':_0x523d88[_0x596eb2(0x151)],'sqlName':_0x36cf32,'dbId':_0x327d38[_0x596eb2(0x157)],'version':_0x4d26e4[_0x596eb2(0x154)],'sqlContent':_0x5627,'sqlConfig':_0x4d26e4[_0x596eb2(0x173)]??undefined}),_0x44ca08=_0x2c8d5c[_0x596eb2(0x157)]?await getDbName(_0x2a2800[_0x596eb2(0x17c)],Number(_0x2c8d5c[_0x596eb2(0x157)]))[_0x596eb2(0x17b)](()=>_0x327d38[_0x596eb2(0x174)]):_0x327d38[_0x596eb2(0x174)];_0x27456c['sqls'][_0x523d88[_0x596eb2(0x151)]]={...buildSqlLockEntry(_0x2c8d5c,_0x5627,_0xb81e1a,{'dbName':_0x44ca08}),'path':_0x523d88['relativePath'],'mode':_0x4d26e4[_0x596eb2(0x170)]},await archivePreviousSqlFileIfNeeded(_0x11b011,_0x4d26e4[_0x596eb2(0x16a)],_0x523d88[_0x596eb2(0x17f)]),_0x4bc016[_0x596eb2(0x187)]({'sqlCode':_0x523d88[_0x596eb2(0x151)],'remoteId':_0x4d26e4[_0x596eb2(0x16b)]});}catch(_0x29d825){_0x874b41['push']({'sqlCode':_0x523d88[_0x596eb2(0x151)],'error':_0x29d825 instanceof Error?_0x29d825[_0x596eb2(0x160)]:String(_0x29d825)});}}return _0x27456c[_0x596eb2(0x159)]=new Date()[_0x596eb2(0x164)](),await writeSqlLockFile(_0x11b011[_0x596eb2(0x185)],_0x150d02),{'ok':_0x874b41['length']===0x0,'data':{'pushed':_0x4bc016,'skipped':_0x41f378,'failed':_0x874b41},'message':_0x596eb2(0x14f)+_0x4bc016[_0x596eb2(0x184)]+_0x596eb2(0x175)+_0x41f378['length']+'\x20skipped,\x20'+_0x874b41[_0x596eb2(0x184)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x3fee9b,_0x1bd074,_0x44937d){const _0x13708e=a182_0x565ba6;if(!_0x1bd074||_0x1bd074===_0x44937d)return;const _0x13402e=join(_0x3fee9b['sqlRootDir'],_0x1bd074);if(!await fileExists(_0x13402e))return;const _0xa5d9ae=await moveToTrash(_0x3fee9b[_0x13708e(0x15d)],_0x3fee9b['trashDir'],_0x13402e);await cleanupEmptyDirectories(dirname(_0x13402e),_0x3fee9b[_0x13708e(0x163)]),void _0xa5d9ae;}async function moveToTrash(_0x526ee5,_0x3f43a4,_0x1ecf36){const _0xf7aaef=a182_0x565ba6,_0xdf92cd=new Date()[_0xf7aaef(0x164)]()['replace'](/[:.]/g,'-'),_0x470dc7=relative(_0x526ee5,_0x1ecf36),_0x4096a3=join(_0x3f43a4,_0xdf92cd,_0x470dc7);return await mkdir(dirname(_0x4096a3),{'recursive':!![]}),await rename(_0x1ecf36,_0x4096a3),_0x4096a3;}async function cleanupEmptyDirectories(_0x1bce0f,_0x46b3b4){const _0x3171a3=a182_0x565ba6;let _0x4e366f=resolve(_0x1bce0f);const _0x1a299f=resolve(_0x46b3b4);while(_0x4e366f[_0x3171a3(0x182)](''+_0x1a299f+sep)||_0x4e366f===_0x1a299f){if(_0x4e366f===_0x1a299f)return;try{const _0x57955e=await readdir(_0x4e366f);if(_0x57955e[_0x3171a3(0x184)]>0x0)return;await rmdir(_0x4e366f);}catch{return;}_0x4e366f=dirname(_0x4e366f);}}async function resolveTargetDbBinding(_0x339ea9,_0x41d3d1,_0xca9d14){const _0x24fa40=a182_0x565ba6,_0x84b498=_0x41d3d1[_0x24fa40(0x161)];if(!_0x84b498)return{'dbId':_0xca9d14[_0x24fa40(0x157)],'dbName':_0xca9d14['dbName']};const _0x2031c4=buildDbDirectoryName(_0xca9d14['dbName'],_0xca9d14[_0x24fa40(0x157)]);if(_0x84b498===_0x2031c4)return{'dbId':_0xca9d14[_0x24fa40(0x157)],'dbName':_0xca9d14['dbName']};const _0x482188=parseExplicitDbDirectory(_0x84b498);if(_0x482188!=null)return{'dbId':_0x482188,'dbName':await getDbName(_0x339ea9,_0x482188)[_0x24fa40(0x17b)](()=>undefined)};const _0x31722c=await listDatabases(_0x339ea9),_0x32951b=_0x31722c['filter'](_0x3f02da=>buildDbDirectoryName(_0x3f02da[_0x24fa40(0x174)],_0x3f02da[_0x24fa40(0x157)])===_0x84b498);if(_0x32951b['length']===0x1)return{'dbId':_0x32951b[0x0]['dbId'],'dbName':_0x32951b[0x0][_0x24fa40(0x174)]};if(_0x32951b['length']===0x0)throw CliErrors[_0x24fa40(0x15e)](_0x24fa40(0x180)+_0x84b498+_0x24fa40(0x165)+_0x41d3d1[_0x24fa40(0x151)]+'.');const _0x5b3150=_0x32951b[_0x24fa40(0x17d)](_0x50ecea=>_0x50ecea[_0x24fa40(0x174)]+'\x20('+_0x50ecea['dbId']+')')[_0x24fa40(0x15c)](',\x20');throw CliErrors[_0x24fa40(0x15e)]('Local\x20directory\x20\x22'+_0x84b498+_0x24fa40(0x172)+_0x41d3d1[_0x24fa40(0x151)]+':\x20'+_0x5b3150);}function parseExplicitDbDirectory(_0x1c800e){const _0x34645b=a182_0x565ba6,_0x12c0e4=/^db-(\d+)$/[_0x34645b(0x15f)](_0x1c800e);if(!_0x12c0e4)return null;const _0x4b1375=Number(_0x12c0e4[0x1]);return Number['isFinite'](_0x4b1375)&&_0x4b1375>0x0?_0x4b1375:null;}
1
+ const a190_0x1bb135=a190_0x2b71;(function(_0x245ed6,_0x54f779){const _0x406589=a190_0x2b71,_0x4d503e=_0x245ed6();while(!![]){try{const _0x347af3=-parseInt(_0x406589(0xac))/0x1+-parseInt(_0x406589(0x89))/0x2*(-parseInt(_0x406589(0x9e))/0x3)+-parseInt(_0x406589(0x79))/0x4*(-parseInt(_0x406589(0x82))/0x5)+-parseInt(_0x406589(0x91))/0x6+parseInt(_0x406589(0x9c))/0x7*(-parseInt(_0x406589(0x93))/0x8)+parseInt(_0x406589(0x94))/0x9*(-parseInt(_0x406589(0xa1))/0xa)+-parseInt(_0x406589(0x72))/0xb*(-parseInt(_0x406589(0xb2))/0xc);if(_0x347af3===_0x54f779)break;else _0x4d503e['push'](_0x4d503e['shift']());}catch(_0x5e8739){_0x4d503e['push'](_0x4d503e['shift']());}}}(a190_0x1c77,0x36834));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';function a190_0x1c77(){const _0x290448=['appCode','5cWjeNC','toISOString','\x20SQL\x20file(s)','sqlRootDir','sqlConfig','sqlcode','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','2IDNoZW','relativePath','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sqlRoot','bool','filePath','Push\x20local\x20SQL\x20files\x20to\x20remote','sql','1653126VIdFkU','/smartapi/custom/updateUserCustomSql','1511216fuggZM','140949TKwHOO','map','filter','str','mode','has','boolean','Would\x20push\x20','14NYdlrV','remoteId','465783TKSMAb','version','No\x20local\x20SQL\x20files\x20found.','190DLRaoC','push','isFinite','unchanged','trashDir','path','force','POST','sqlName','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','length','386219ThfuOr','\x20skipped,\x20','utf8','dbDirectory','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','high-risk-write','5676eZzoAc','validation','replace','lockFilePath','27753dbNafd','lastSync','catch','hash','Local\x20SQL\x20not\x20found:\x20','startsWith','\x20pushed,\x20','846988rZWdge','Local\x20directory\x20\x22','\x20failed','set','sqls','dbId','dbName','sqlCode'];a190_0x1c77=function(){return _0x290448;};return a190_0x1c77();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';function a190_0x2b71(_0x5a32a,_0x4254cf){_0x5a32a=_0x5a32a-0x72;const _0x1c7755=a190_0x1c77();let _0x2b7164=_0x1c7755[_0x5a32a];return _0x2b7164;}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x5ef01d,_0x222b0e,_0x4a8fd6){const _0x4f0e30=a190_0x2b71,_0x2e2b5d=await scanLocalSqlQueries(_0x5ef01d),_0x112b05=new Map();for(const _0x3b232a of _0x2e2b5d){if(_0x4a8fd6&&_0x3b232a[_0x4f0e30(0x80)]!==_0x4a8fd6)continue;const _0x504c0f=_0x112b05['get'](_0x3b232a[_0x4f0e30(0x80)])??[];_0x504c0f[_0x4f0e30(0xa2)](_0x3b232a),_0x112b05[_0x4f0e30(0x7c)](_0x3b232a[_0x4f0e30(0x80)],_0x504c0f);}if(_0x4a8fd6&&!_0x112b05[_0x4f0e30(0x99)](_0x4a8fd6))throw CliErrors['validation'](_0x4f0e30(0x76)+_0x4a8fd6);const _0x52706f=[];for(const [_0x17d4e1,_0x2336c4]of _0x112b05['entries']()){if(_0x2336c4[_0x4f0e30(0xab)]===0x1){_0x52706f[_0x4f0e30(0xa2)](_0x2336c4[0x0]);continue;}const _0x29f2ab=_0x222b0e[_0x4f0e30(0x7d)][_0x17d4e1],_0x1978db=_0x29f2ab?.[_0x4f0e30(0xa6)],_0x67c8fa=_0x1978db?_0x2336c4[_0x4f0e30(0x96)](_0x439f5e=>_0x439f5e[_0x4f0e30(0x8a)]!==_0x1978db):_0x2336c4;if(_0x29f2ab&&_0x67c8fa[_0x4f0e30(0xab)]===0x1){_0x52706f[_0x4f0e30(0xa2)](_0x67c8fa[0x0]);continue;}throw CliErrors[_0x4f0e30(0xb3)](_0x4f0e30(0xb0)+_0x17d4e1+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x52706f;}export const sqlPush={'service':a190_0x1bb135(0x90),'command':a190_0x1bb135(0xa2),'description':a190_0x1bb135(0x8f),'risk':a190_0x1bb135(0xb1),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a190_0x1bb135(0x9a),'description':a190_0x1bb135(0xaa)}],async 'dryRun'(_0x360dc3){const _0x5701ed=a190_0x1bb135,_0x1862b1=loadSqlProjectConfig(_0x360dc3[_0x5701ed(0x81)]),_0x1dc825=await readSqlLockFile(_0x1862b1['lockFilePath']),{appLock:_0x5df814}=ensureSqlLockScope(_0x1dc825??createEmptySqlLock(),_0x360dc3[_0x5701ed(0x81)],_0x1862b1[_0x5701ed(0x8c)],_0x5701ed(0xa2)),_0x279ae6=await getTargetSqlQueries(_0x1862b1,_0x5df814,_0x360dc3[_0x5701ed(0x97)](_0x5701ed(0x87))||undefined),_0x9917b3=[];for(const _0x56c858 of _0x279ae6){const _0x121965=await computeSqlFileHash(_0x56c858[_0x5701ed(0x8e)]),_0x56bd6f=_0x5df814['sqls'][_0x56c858[_0x5701ed(0x80)]],_0x2de240=!!_0x56bd6f&&(_0x56bd6f[_0x5701ed(0xa6)]!==_0x56c858[_0x5701ed(0x8a)]||!!_0x56c858['sqlName']&&_0x56bd6f[_0x5701ed(0xa9)]!==_0x56c858[_0x5701ed(0xa9)]);if(!_0x360dc3[_0x5701ed(0x8d)](_0x5701ed(0xa7))&&_0x56bd6f&&_0x56bd6f[_0x5701ed(0x75)]===_0x121965&&!_0x2de240)continue;_0x9917b3[_0x5701ed(0xa2)](_0x56c858['sqlCode']);}return{'method':_0x5701ed(0xa8),'url':_0x5701ed(0x92),'body':{'sqlCodes':_0x9917b3,'appCode':_0x360dc3[_0x5701ed(0x81)]},'description':_0x5701ed(0x9b)+_0x9917b3['length']+_0x5701ed(0x84)};},async 'execute'(_0x2568d1){const _0x542c4a=a190_0x1bb135,_0x188270=loadSqlProjectConfig(_0x2568d1[_0x542c4a(0x81)]),_0x596655=await readSqlLockFile(_0x188270[_0x542c4a(0xb5)]),{lockData:_0x39bdca,appLock:_0xec7e8}=ensureSqlLockScope(_0x596655??createEmptySqlLock(),_0x2568d1[_0x542c4a(0x81)],_0x188270[_0x542c4a(0x8c)],'push'),_0x56ea0b=await getTargetSqlQueries(_0x188270,_0xec7e8,_0x2568d1[_0x542c4a(0x97)](_0x542c4a(0x87))||undefined);if(_0x56ea0b[_0x542c4a(0xab)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x542c4a(0xa0)};const _0x221662=[],_0x34ec37=[],_0x91f347=[];for(const _0x2ca378 of _0x56ea0b){const _0x227cb9=_0xec7e8[_0x542c4a(0x7d)][_0x2ca378[_0x542c4a(0x80)]];if(!_0x227cb9){_0x91f347['push']({'sqlCode':_0x2ca378[_0x542c4a(0x80)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x3ce002=await computeSqlFileHash(_0x2ca378[_0x542c4a(0x8e)]),_0x1aaa52=_0x227cb9['path']!==_0x2ca378[_0x542c4a(0x8a)]||!!_0x2ca378[_0x542c4a(0xa9)]&&_0x227cb9[_0x542c4a(0xa9)]!==_0x2ca378[_0x542c4a(0xa9)];if(!_0x2568d1[_0x542c4a(0x8d)](_0x542c4a(0xa7))&&_0x227cb9[_0x542c4a(0x75)]===_0x3ce002&&!_0x1aaa52){_0x34ec37['push']({'sqlCode':_0x2ca378[_0x542c4a(0x80)],'reason':_0x542c4a(0xa4)});continue;}if(_0x227cb9[_0x542c4a(0x9f)]==null){_0x91f347[_0x542c4a(0xa2)]({'sqlCode':_0x2ca378[_0x542c4a(0x80)],'error':_0x542c4a(0x8b)});continue;}const _0xc042f6=await readFile(_0x2ca378['filePath'],_0x542c4a(0xae)),_0x3d0d1b=stripLocalSqlMetadata(_0xc042f6,_0x2ca378[_0x542c4a(0x98)]),_0x80d46e=_0x2ca378[_0x542c4a(0xa9)]||_0x227cb9[_0x542c4a(0xa9)],_0x293ddf=await resolveTargetDbBinding(_0x2568d1[_0x542c4a(0x81)],_0x2ca378,_0x227cb9),_0x4604e9=await updateSqlQuery({'id':_0x227cb9[_0x542c4a(0x9d)],'appCode':_0x2568d1[_0x542c4a(0x81)],'sqlCode':_0x2ca378[_0x542c4a(0x80)],'sqlName':_0x80d46e,'dbId':_0x293ddf[_0x542c4a(0x7e)],'version':_0x227cb9[_0x542c4a(0x9f)],'sqlContent':_0x3d0d1b,'sqlConfig':_0x227cb9[_0x542c4a(0x86)]??undefined}),_0x5ea742=_0x4604e9[_0x542c4a(0x7e)]?await getDbName(_0x2568d1[_0x542c4a(0x81)],Number(_0x4604e9[_0x542c4a(0x7e)]))[_0x542c4a(0x74)](()=>_0x293ddf[_0x542c4a(0x7f)]):_0x293ddf['dbName'];_0xec7e8['sqls'][_0x2ca378[_0x542c4a(0x80)]]={...buildSqlLockEntry(_0x4604e9,_0x3d0d1b,_0x3ce002,{'dbName':_0x5ea742}),'path':_0x2ca378[_0x542c4a(0x8a)],'mode':_0x227cb9[_0x542c4a(0x98)]},await archivePreviousSqlFileIfNeeded(_0x188270,_0x227cb9[_0x542c4a(0xa6)],_0x2ca378['relativePath']),_0x221662[_0x542c4a(0xa2)]({'sqlCode':_0x2ca378['sqlCode'],'remoteId':_0x227cb9[_0x542c4a(0x9d)]});}catch(_0x147bc3){_0x91f347[_0x542c4a(0xa2)]({'sqlCode':_0x2ca378[_0x542c4a(0x80)],'error':_0x147bc3 instanceof Error?_0x147bc3['message']:String(_0x147bc3)});}}return _0xec7e8[_0x542c4a(0x73)]=new Date()[_0x542c4a(0x83)](),await writeSqlLockFile(_0x188270[_0x542c4a(0xb5)],_0x39bdca),{'ok':_0x91f347[_0x542c4a(0xab)]===0x0,'data':{'pushed':_0x221662,'skipped':_0x34ec37,'failed':_0x91f347},'message':'Push\x20complete:\x20'+_0x221662[_0x542c4a(0xab)]+_0x542c4a(0x78)+_0x34ec37[_0x542c4a(0xab)]+_0x542c4a(0xad)+_0x91f347[_0x542c4a(0xab)]+_0x542c4a(0x7b)};}};async function archivePreviousSqlFileIfNeeded(_0x37ab6d,_0x2579bf,_0x1488dc){const _0x3822f5=a190_0x1bb135;if(!_0x2579bf||_0x2579bf===_0x1488dc)return;const _0x117eb0=join(_0x37ab6d[_0x3822f5(0x85)],_0x2579bf);if(!await fileExists(_0x117eb0))return;const _0x3cec28=await moveToTrash(_0x37ab6d['projectRoot'],_0x37ab6d[_0x3822f5(0xa5)],_0x117eb0);await cleanupEmptyDirectories(dirname(_0x117eb0),_0x37ab6d['sqlRootDir']),void _0x3cec28;}async function moveToTrash(_0x54d3cf,_0x489b10,_0x574896){const _0x389e2e=a190_0x1bb135,_0x58df9e=new Date()['toISOString']()[_0x389e2e(0xb4)](/[:.]/g,'-'),_0x144cb8=relative(_0x54d3cf,_0x574896),_0xa8d56=join(_0x489b10,_0x58df9e,_0x144cb8);return await mkdir(dirname(_0xa8d56),{'recursive':!![]}),await rename(_0x574896,_0xa8d56),_0xa8d56;}async function cleanupEmptyDirectories(_0x34a382,_0x348a7a){const _0x4e2099=a190_0x1bb135;let _0x3fddcd=resolve(_0x34a382);const _0x3bd43e=resolve(_0x348a7a);while(_0x3fddcd[_0x4e2099(0x77)](''+_0x3bd43e+sep)||_0x3fddcd===_0x3bd43e){if(_0x3fddcd===_0x3bd43e)return;try{const _0x17b35e=await readdir(_0x3fddcd);if(_0x17b35e['length']>0x0)return;await rmdir(_0x3fddcd);}catch{return;}_0x3fddcd=dirname(_0x3fddcd);}}async function resolveTargetDbBinding(_0x482b97,_0x34794,_0x457587){const _0x4da4d1=a190_0x1bb135,_0x966277=_0x34794[_0x4da4d1(0xaf)];if(!_0x966277)return{'dbId':_0x457587['dbId'],'dbName':_0x457587[_0x4da4d1(0x7f)]};const _0x592f03=buildDbDirectoryName(_0x457587[_0x4da4d1(0x7f)],_0x457587[_0x4da4d1(0x7e)]);if(_0x966277===_0x592f03)return{'dbId':_0x457587['dbId'],'dbName':_0x457587['dbName']};const _0x57c1a9=parseExplicitDbDirectory(_0x966277);if(_0x57c1a9!=null)return{'dbId':_0x57c1a9,'dbName':await getDbName(_0x482b97,_0x57c1a9)[_0x4da4d1(0x74)](()=>undefined)};const _0x4d0014=await listDatabases(_0x482b97),_0x2cd826=_0x4d0014[_0x4da4d1(0x96)](_0xaa90f1=>buildDbDirectoryName(_0xaa90f1[_0x4da4d1(0x7f)],_0xaa90f1['dbId'])===_0x966277);if(_0x2cd826[_0x4da4d1(0xab)]===0x1)return{'dbId':_0x2cd826[0x0][_0x4da4d1(0x7e)],'dbName':_0x2cd826[0x0][_0x4da4d1(0x7f)]};if(_0x2cd826['length']===0x0)throw CliErrors[_0x4da4d1(0xb3)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x966277+'\x22\x20for\x20sqlCode\x20'+_0x34794['sqlCode']+'.');const _0x1e90ea=_0x2cd826[_0x4da4d1(0x95)](_0x2a27ab=>_0x2a27ab[_0x4da4d1(0x7f)]+'\x20('+_0x2a27ab[_0x4da4d1(0x7e)]+')')['join'](',\x20');throw CliErrors['validation'](_0x4da4d1(0x7a)+_0x966277+_0x4da4d1(0x88)+_0x34794['sqlCode']+':\x20'+_0x1e90ea);}function parseExplicitDbDirectory(_0x3ef908){const _0x7fb085=a190_0x1bb135,_0x338835=/^db-(\d+)$/['exec'](_0x3ef908);if(!_0x338835)return null;const _0xadb2ab=Number(_0x338835[0x1]);return Number[_0x7fb085(0xa3)](_0xadb2ab)&&_0xadb2ab>0x0?_0xadb2ab:null;}
@@ -1 +1 @@
1
- const a183_0x3f9d23=a183_0x4a7b;(function(_0x470990,_0x53a1ad){const _0x2ba535=a183_0x4a7b,_0x45a29b=_0x470990();while(!![]){try{const _0x50b3f9=parseInt(_0x2ba535(0xa9))/0x1+-parseInt(_0x2ba535(0xa1))/0x2+-parseInt(_0x2ba535(0x80))/0x3+-parseInt(_0x2ba535(0x9a))/0x4+-parseInt(_0x2ba535(0x8d))/0x5*(parseInt(_0x2ba535(0x8f))/0x6)+parseInt(_0x2ba535(0xa4))/0x7+-parseInt(_0x2ba535(0x89))/0x8*(-parseInt(_0x2ba535(0xaa))/0x9);if(_0x50b3f9===_0x53a1ad)break;else _0x45a29b['push'](_0x45a29b['shift']());}catch(_0x1569a3){_0x45a29b['push'](_0x45a29b['shift']());}}}(a183_0xd3ee,0x63062));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';function a183_0xd3ee(){const _0x4ec258=['sqls','description','endsWith','push','yes','close','2176EdNRJc','syncedAt','dbName','includes','670SAkoRw','<!--\x20@lovrabet.','29706nlJGHi','trimStart','sqlCode','sqlName','lastSync','mode','test','question','\x20[y/N]\x20','join','trim','2933484CuIfIF','path','--\x20@lovrabet.','\x20-->','dbId','filter','replace','740026GIkAaR','split','fromEntries','1991339ZnonsN','map','length','sqlConfig','.rabetbase/sql','701947UnAZDR','49122pkLVdz','895740mBVrnV','entries','version'];a183_0xd3ee=function(){return _0x4ec258;};return a183_0xd3ee();}export const SQL_LOCAL_REL_DIR=a183_0x3f9d23(0xa8);export function buildSqlLockEntry(_0x5815eb,_0x31dfaa,_0x58bec0,_0x402e9b){const _0x3cce6b=a183_0x3f9d23,_0x25f9e3=detectSqlMode(_0x31dfaa);return{'path':buildSqlRelativePath(_0x5815eb[_0x3cce6b(0x91)],_0x5815eb[_0x3cce6b(0x92)],_0x402e9b?.[_0x3cce6b(0x8b)],_0x25f9e3,_0x5815eb[_0x3cce6b(0x9e)]),'hash':_0x58bec0,'remoteId':_0x5815eb['id'],'version':_0x5815eb[_0x3cce6b(0x82)],'dbId':Number(_0x5815eb[_0x3cce6b(0x9e)]),'dbName':_0x402e9b?.['dbName'],'sqlName':_0x5815eb['sqlName'],'sqlConfig':_0x5815eb[_0x3cce6b(0xa7)]??undefined,'mode':_0x25f9e3};}export function cloneSqlLockData(_0xf7b886){const _0x3e7147=a183_0x3f9d23;return{'apps':Object[_0x3e7147(0xa3)](Object[_0x3e7147(0x81)](_0xf7b886['apps'])[_0x3e7147(0xa5)](([_0x583617,_0x3188b9])=>[_0x583617,{'sqlRoot':_0x3188b9['sqlRoot'],'lastSync':_0x3188b9[_0x3e7147(0x93)],'sqls':{..._0x3188b9[_0x3e7147(0x83)]}}]))};}export function ensureRemoteSqlContent(_0x37f222){return _0x37f222['sqlContent']??'';}export function buildLocalSqlFileContent(_0x22d93a,_0x3b2f6b,_0x3cff55){const _0x2505c6=a183_0x3f9d23,_0x20597f=_0x3cff55?.[_0x2505c6(0x94)]??detectSqlMode(_0x3b2f6b),_0x27cc6d=stripLocalSqlMetadata(_0x3b2f6b,_0x20597f)[_0x2505c6(0x99)](),_0x521f28=[...buildMetadataHeaderLines({'sqlCode':_0x22d93a[_0x2505c6(0x91)],'sqlName':_0x22d93a[_0x2505c6(0x92)],'dbId':_0x22d93a[_0x2505c6(0x9e)],'dbName':_0x3cff55?.[_0x2505c6(0x8b)],'mode':_0x20597f,'syncedAt':_0x3cff55?.[_0x2505c6(0x8a)],'description':_0x3cff55?.[_0x2505c6(0x84)]},_0x20597f),'',_0x27cc6d],_0x35bd82=_0x521f28[_0x2505c6(0x98)]('\x0a');return _0x35bd82[_0x2505c6(0x85)]('\x0a')?_0x35bd82:_0x35bd82+'\x0a';}export function stripLocalSqlMetadata(_0x186a9f,_0x437f0f){const _0x12592e=a183_0x3f9d23,_0x3a46f4=_0x186a9f[_0x12592e(0xa0)](/\r\n/g,'\x0a')[_0x12592e(0xa2)]('\x0a'),_0x3330a2=[];let _0x5b6bf6=0x0;if(_0x437f0f==='mybatisXml')while(_0x5b6bf6<_0x3a46f4[_0x12592e(0xa6)]){const _0x4715ee=_0x3a46f4[_0x5b6bf6]??'';if(/^\s*<!--\s*@lovrabet\./[_0x12592e(0x95)](_0x4715ee)){_0x5b6bf6++;continue;}if(_0x4715ee[_0x12592e(0x99)]()===''&&_0x5b6bf6>0x0){_0x5b6bf6++;continue;}break;}else while(_0x5b6bf6<_0x3a46f4[_0x12592e(0xa6)]){const _0x3c0c23=_0x3a46f4[_0x5b6bf6]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x3c0c23)){_0x5b6bf6++;continue;}if(_0x3c0c23[_0x12592e(0x99)]()===''&&_0x5b6bf6>0x0){_0x5b6bf6++;continue;}break;}for(;_0x5b6bf6<_0x3a46f4[_0x12592e(0xa6)];_0x5b6bf6++){_0x3330a2[_0x12592e(0x86)](_0x3a46f4[_0x5b6bf6]);}return _0x3330a2[_0x12592e(0x98)]('\x0a')[_0x12592e(0x90)]();}export function resolveSqlMode(_0x4b44f1,_0x236ec5){if(_0x236ec5?.['mode'])return _0x236ec5['mode'];return detectSqlMode(_0x4b44f1);}function a183_0x4a7b(_0xdbb167,_0x141d2c){_0xdbb167=_0xdbb167-0x80;const _0xd3ee52=a183_0xd3ee();let _0x4a7b8b=_0xd3ee52[_0xdbb167];return _0x4a7b8b;}export function resolveSqlFileName(_0x25ee65,_0x565da1,_0x110a09){const _0x582bb9=a183_0x3f9d23;if(_0x110a09?.[_0x582bb9(0x9b)])return _0x110a09[_0x582bb9(0x9b)];if(_0x110a09?.[_0x582bb9(0x92)]||_0x110a09?.['dbName'])return buildSqlRelativePath(_0x25ee65,_0x110a09?.[_0x582bb9(0x92)],_0x110a09?.[_0x582bb9(0x8b)],resolveSqlMode(_0x565da1,_0x110a09),_0x110a09?.[_0x582bb9(0x9e)]);return buildDefaultSqlFileName(_0x25ee65,resolveSqlMode(_0x565da1,_0x110a09));}export function resolveSqlLocalDir(_0xd53cc8,_0xa51b3b){return join(_0xd53cc8,SQL_LOCAL_REL_DIR,_0xa51b3b);}export async function confirmForceOverwrite(_0x3ea1b3){const _0x149969=a183_0x3f9d23,_0x1ec801=createInterface({'input':process['stdin'],'output':process['stderr']}),_0x191d90=await new Promise(_0x12ce96=>{const _0x4a229c=a183_0x4a7b;_0x1ec801[_0x4a229c(0x96)](_0x3ea1b3+_0x4a229c(0x97),_0x12ce96);});return _0x1ec801[_0x149969(0x88)](),['y',_0x149969(0x87)][_0x149969(0x8c)](_0x191d90[_0x149969(0x99)]()['toLowerCase']());}export function findSqlLockScope(_0x3c1096,_0x387517){return _0x3c1096['apps'][_0x387517];}function buildMetadataHeaderLines(_0x16530a,_0x21ad2d){const _0x28ebb4=a183_0x3f9d23,_0x467bef=[['sqlCode',_0x16530a['sqlCode']],[_0x28ebb4(0x92),_0x16530a[_0x28ebb4(0x92)]],[_0x28ebb4(0x9e),_0x16530a[_0x28ebb4(0x9e)]],[_0x28ebb4(0x8b),_0x16530a[_0x28ebb4(0x8b)]],['mode',_0x16530a[_0x28ebb4(0x94)]],[_0x28ebb4(0x8a),_0x16530a[_0x28ebb4(0x8a)]],[_0x28ebb4(0x84),_0x16530a[_0x28ebb4(0x84)]]];if(_0x21ad2d==='mybatisXml')return _0x467bef[_0x28ebb4(0x9f)](([,_0x12c4e8])=>_0x12c4e8!==undefined&&_0x12c4e8!==null&&String(_0x12c4e8)[_0x28ebb4(0x99)]()!=='')['map'](([_0x5b9aca,_0x6dd606])=>_0x28ebb4(0x8e)+_0x5b9aca+':\x20'+String(_0x6dd606)+_0x28ebb4(0x9d));return _0x467bef['filter'](([,_0x5eab71])=>_0x5eab71!==undefined&&_0x5eab71!==null&&String(_0x5eab71)['trim']()!=='')['map'](([_0x55c6fb,_0x4cbbeb])=>_0x28ebb4(0x9c)+_0x55c6fb+':\x20'+String(_0x4cbbeb));}
1
+ const a191_0xd8a501=a191_0x5d1d;(function(_0x13fee3,_0x2aefa8){const _0x371930=a191_0x5d1d,_0x1ecf87=_0x13fee3();while(!![]){try{const _0x36d91e=-parseInt(_0x371930(0xfe))/0x1+-parseInt(_0x371930(0x114))/0x2*(-parseInt(_0x371930(0xfc))/0x3)+-parseInt(_0x371930(0xff))/0x4+parseInt(_0x371930(0xf6))/0x5+parseInt(_0x371930(0xf0))/0x6+-parseInt(_0x371930(0x100))/0x7*(parseInt(_0x371930(0xf9))/0x8)+-parseInt(_0x371930(0xea))/0x9*(-parseInt(_0x371930(0x102))/0xa);if(_0x36d91e===_0x2aefa8)break;else _0x1ecf87['push'](_0x1ecf87['shift']());}catch(_0x41a5bf){_0x1ecf87['push'](_0x1ecf87['shift']());}}}(a191_0x6d93,0x6547d));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=a191_0xd8a501(0xee);export function buildSqlLockEntry(_0x349c65,_0x514c7f,_0x2c43ef,_0x23e39c){const _0x55aa1c=a191_0xd8a501,_0x560198=detectSqlMode(_0x514c7f);return{'path':buildSqlRelativePath(_0x349c65[_0x55aa1c(0xec)],_0x349c65[_0x55aa1c(0x10d)],_0x23e39c?.['dbName'],_0x560198,_0x349c65[_0x55aa1c(0xf3)]),'hash':_0x2c43ef,'remoteId':_0x349c65['id'],'version':_0x349c65[_0x55aa1c(0xed)],'dbId':Number(_0x349c65['dbId']),'dbName':_0x23e39c?.[_0x55aa1c(0xfa)],'sqlName':_0x349c65[_0x55aa1c(0x10d)],'sqlConfig':_0x349c65['sqlConfig']??undefined,'mode':_0x560198};}function a191_0x5d1d(_0x2844fa,_0x50ae35){_0x2844fa=_0x2844fa-0xe6;const _0x6d9345=a191_0x6d93();let _0x5d1d17=_0x6d9345[_0x2844fa];return _0x5d1d17;}export function cloneSqlLockData(_0x1d56f0){const _0x332adb=a191_0xd8a501;return{'apps':Object[_0x332adb(0x112)](Object[_0x332adb(0xf1)](_0x1d56f0['apps'])[_0x332adb(0x101)](([_0x59dee3,_0x1cdc80])=>[_0x59dee3,{'sqlRoot':_0x1cdc80[_0x332adb(0x111)],'lastSync':_0x1cdc80['lastSync'],'sqls':{..._0x1cdc80[_0x332adb(0xfb)]}}]))};}export function ensureRemoteSqlContent(_0x1aa803){const _0x5816ea=a191_0xd8a501;return _0x1aa803[_0x5816ea(0x109)]??'';}export function buildLocalSqlFileContent(_0x2ab7f4,_0x32a72c,_0x3ceac9){const _0x2282a8=a191_0xd8a501,_0x526975=_0x3ceac9?.[_0x2282a8(0xfd)]??detectSqlMode(_0x32a72c),_0x55074e=stripLocalSqlMetadata(_0x32a72c,_0x526975)[_0x2282a8(0xf2)](),_0x551cce=[...buildMetadataHeaderLines({'sqlCode':_0x2ab7f4[_0x2282a8(0xec)],'sqlName':_0x2ab7f4[_0x2282a8(0x10d)],'dbId':_0x2ab7f4['dbId'],'dbName':_0x3ceac9?.[_0x2282a8(0xfa)],'mode':_0x526975,'syncedAt':_0x3ceac9?.[_0x2282a8(0x105)],'description':_0x3ceac9?.[_0x2282a8(0xeb)]},_0x526975),'',_0x55074e],_0x1b100c=_0x551cce['join']('\x0a');return _0x1b100c[_0x2282a8(0xf5)]('\x0a')?_0x1b100c:_0x1b100c+'\x0a';}export function stripLocalSqlMetadata(_0x218bc8,_0x3333c0){const _0x5bf7b9=a191_0xd8a501,_0x5ee736=_0x218bc8[_0x5bf7b9(0x113)](/\r\n/g,'\x0a')[_0x5bf7b9(0xf4)]('\x0a'),_0x278358=[];let _0x38c324=0x0;if(_0x3333c0===_0x5bf7b9(0x104))while(_0x38c324<_0x5ee736[_0x5bf7b9(0x10e)]){const _0x4c10b8=_0x5ee736[_0x38c324]??'';if(/^\s*<!--\s*@lovrabet\./[_0x5bf7b9(0x108)](_0x4c10b8)){_0x38c324++;continue;}if(_0x4c10b8[_0x5bf7b9(0xf2)]()===''&&_0x38c324>0x0){_0x38c324++;continue;}break;}else while(_0x38c324<_0x5ee736[_0x5bf7b9(0x10e)]){const _0x3671ee=_0x5ee736[_0x38c324]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x3671ee)){_0x38c324++;continue;}if(_0x3671ee[_0x5bf7b9(0xf2)]()===''&&_0x38c324>0x0){_0x38c324++;continue;}break;}for(;_0x38c324<_0x5ee736[_0x5bf7b9(0x10e)];_0x38c324++){_0x278358['push'](_0x5ee736[_0x38c324]);}return _0x278358[_0x5bf7b9(0xe8)]('\x0a')[_0x5bf7b9(0xf7)]();}export function resolveSqlMode(_0x213570,_0x4b81c3){const _0x4ad379=a191_0xd8a501;if(_0x4b81c3?.[_0x4ad379(0xfd)])return _0x4b81c3[_0x4ad379(0xfd)];return detectSqlMode(_0x213570);}export function resolveSqlFileName(_0x4b71b7,_0x27bfce,_0x33fc93){const _0xdf2df5=a191_0xd8a501;if(_0x33fc93?.[_0xdf2df5(0xe6)])return _0x33fc93['path'];if(_0x33fc93?.[_0xdf2df5(0x10d)]||_0x33fc93?.[_0xdf2df5(0xfa)])return buildSqlRelativePath(_0x4b71b7,_0x33fc93?.[_0xdf2df5(0x10d)],_0x33fc93?.[_0xdf2df5(0xfa)],resolveSqlMode(_0x27bfce,_0x33fc93),_0x33fc93?.['dbId']);return buildDefaultSqlFileName(_0x4b71b7,resolveSqlMode(_0x27bfce,_0x33fc93));}function a191_0x6d93(){const _0xc97956=['<!--\x20@lovrabet.','close','sqlName','length','\x20-->','stderr','sqlRoot','fromEntries','replace','620DZXyWi','path','includes','join','\x20[y/N]\x20','7929eUShEm','description','sqlCode','version','.rabetbase/sql','filter','2005830cIJhTR','entries','trim','dbId','split','endsWith','557930ZZpnXn','trimStart','apps','459128VjLEhj','dbName','sqls','4974eXDwbS','mode','32231LvLCtG','2540008tCjahe','14lAbofG','map','2690NPreos','toLowerCase','mybatisXml','syncedAt','yes','stdin','test','sqlContent','question'];a191_0x6d93=function(){return _0xc97956;};return a191_0x6d93();}export function resolveSqlLocalDir(_0x4b7654,_0x8c2cc5){return join(_0x4b7654,SQL_LOCAL_REL_DIR,_0x8c2cc5);}export async function confirmForceOverwrite(_0x5700b8){const _0x426bde=a191_0xd8a501,_0xada2ba=createInterface({'input':process[_0x426bde(0x107)],'output':process[_0x426bde(0x110)]}),_0x55c2b9=await new Promise(_0x264792=>{const _0x139559=_0x426bde;_0xada2ba[_0x139559(0x10a)](_0x5700b8+_0x139559(0xe9),_0x264792);});return _0xada2ba[_0x426bde(0x10c)](),['y',_0x426bde(0x106)][_0x426bde(0xe7)](_0x55c2b9[_0x426bde(0xf2)]()[_0x426bde(0x103)]());}export function findSqlLockScope(_0x46dc9f,_0x5c6831){const _0x1d9abb=a191_0xd8a501;return _0x46dc9f[_0x1d9abb(0xf8)][_0x5c6831];}function buildMetadataHeaderLines(_0x4dab08,_0x45c244){const _0x1fa68a=a191_0xd8a501,_0x43ed8f=[[_0x1fa68a(0xec),_0x4dab08[_0x1fa68a(0xec)]],[_0x1fa68a(0x10d),_0x4dab08[_0x1fa68a(0x10d)]],[_0x1fa68a(0xf3),_0x4dab08[_0x1fa68a(0xf3)]],['dbName',_0x4dab08[_0x1fa68a(0xfa)]],[_0x1fa68a(0xfd),_0x4dab08[_0x1fa68a(0xfd)]],[_0x1fa68a(0x105),_0x4dab08['syncedAt']],[_0x1fa68a(0xeb),_0x4dab08[_0x1fa68a(0xeb)]]];if(_0x45c244===_0x1fa68a(0x104))return _0x43ed8f[_0x1fa68a(0xef)](([,_0x42de22])=>_0x42de22!==undefined&&_0x42de22!==null&&String(_0x42de22)[_0x1fa68a(0xf2)]()!=='')[_0x1fa68a(0x101)](([_0x1ec357,_0x1df5c7])=>_0x1fa68a(0x10b)+_0x1ec357+':\x20'+String(_0x1df5c7)+_0x1fa68a(0x10f));return _0x43ed8f['filter'](([,_0x5cd273])=>_0x5cd273!==undefined&&_0x5cd273!==null&&String(_0x5cd273)[_0x1fa68a(0xf2)]()!=='')[_0x1fa68a(0x101)](([_0x50ca41,_0x5d24ad])=>'--\x20@lovrabet.'+_0x50ca41+':\x20'+String(_0x5d24ad));}
@@ -1 +1 @@
1
- const a184_0x5053ce=a184_0x541a;(function(_0xf0ad48,_0x1a9b71){const _0x535fb1=a184_0x541a,_0x59c361=_0xf0ad48();while(!![]){try{const _0x5a2fef=parseInt(_0x535fb1(0x119))/0x1+parseInt(_0x535fb1(0x12a))/0x2*(-parseInt(_0x535fb1(0x11e))/0x3)+parseInt(_0x535fb1(0x11c))/0x4*(parseInt(_0x535fb1(0x130))/0x5)+-parseInt(_0x535fb1(0x133))/0x6*(-parseInt(_0x535fb1(0x128))/0x7)+-parseInt(_0x535fb1(0x115))/0x8*(parseInt(_0x535fb1(0x11a))/0x9)+-parseInt(_0x535fb1(0x125))/0xa+-parseInt(_0x535fb1(0x111))/0xb*(parseInt(_0x535fb1(0x12f))/0xc);if(_0x5a2fef===_0x1a9b71)break;else _0x59c361['push'](_0x59c361['shift']());}catch(_0x16d3ba){_0x59c361['push'](_0x59c361['shift']());}}}(a184_0xe264,0x88082));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';function a184_0xe264(){const _0x254b0c=['21969UfZGsW','path','152iSPanQ','hash','12RydakK','sql','\x20missing,\x20','status','tableData','remote','sqlCode','3101570zlLZNj','has','\x20modified,\x20','147133VRyMfV','\x20remote-only','39458pbnnqg','read','sqls','sqlRoot','length','8844ccUoER','112175dCPbYM','map','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','162VgJsNq','keys','paging','lockKey','relativePath','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','55VSJAMs','totalCount','filePath','bool','3184zrKBtR','push','sqlName','appCode','501419GyRCaZ'];a184_0xe264=function(){return _0x254b0c;};return a184_0xe264();}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';function a184_0x541a(_0x96d1c0,_0x211738){_0x96d1c0=_0x96d1c0-0x10c;const _0xe2642c=a184_0xe264();let _0x541a90=_0xe2642c[_0x96d1c0];return _0x541a90;}const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x548894){const _0x334f17=a184_0x541a,_0x54fd72=[];let _0x59b2d7=0x1;while(!![]){const _0x47323a=await listSqlQueries(_0x548894,{'currentPage':_0x59b2d7,'pageSize':PAGE_SIZE}),_0xf121c1=_0x47323a[_0x334f17(0x122)]??[];_0x54fd72[_0x334f17(0x116)](..._0xf121c1[_0x334f17(0x131)](_0x4ddbb9=>_0x4ddbb9[_0x334f17(0x124)]));if(_0xf121c1[_0x334f17(0x12e)]===0x0)break;const _0x5db315=_0x47323a[_0x334f17(0x10d)]?.[_0x334f17(0x112)];if(_0x5db315!=null?_0x54fd72[_0x334f17(0x12e)]>=_0x5db315:_0xf121c1[_0x334f17(0x12e)]<PAGE_SIZE)break;_0x59b2d7++;}return _0x54fd72;}export const sqlStatus={'service':a184_0x5053ce(0x11f),'command':a184_0x5053ce(0x121),'description':a184_0x5053ce(0x132),'risk':a184_0x5053ce(0x12b),'flags':[{'name':a184_0x5053ce(0x123),'type':'boolean','description':a184_0x5053ce(0x110)}],async 'execute'(_0x3c7cdc){const _0x1879c8=a184_0x5053ce,_0x500493=loadSqlProjectConfig(_0x3c7cdc[_0x1879c8(0x118)]),_0xa064fe=await readSqlLockFile(_0x500493['lockFilePath']),{appLock:_0x2326a7}=ensureSqlLockScope(_0xa064fe??createEmptySqlLock(),_0x500493['appCode'],_0x500493[_0x1879c8(0x12d)],_0x1879c8(0x121)),_0x7a812b=await scanLocalSqlQueries(_0x500493),_0x56d68a=[],_0x5cb44d=[],_0x3e58f2=[],_0x28ccfa=[],_0x4909df=new Set(_0x7a812b[_0x1879c8(0x131)](_0x53c49b=>_0x53c49b[_0x1879c8(0x10e)]));for(const _0x198eb5 of _0x7a812b){const _0x1927fc=await computeSqlFileHash(_0x198eb5[_0x1879c8(0x113)]),_0x3738b7=_0x2326a7[_0x1879c8(0x12c)][_0x198eb5['lockKey']],_0x4946d1=!!_0x3738b7&&_0x3738b7[_0x1879c8(0x11b)]!==_0x198eb5[_0x1879c8(0x10f)],_0x5ad89a=!!_0x3738b7&&!!_0x198eb5[_0x1879c8(0x117)]&&_0x3738b7[_0x1879c8(0x117)]!==_0x198eb5[_0x1879c8(0x117)];if(!_0x3738b7)_0x56d68a[_0x1879c8(0x116)](_0x198eb5[_0x1879c8(0x10e)]);else _0x3738b7[_0x1879c8(0x11d)]!==_0x1927fc||_0x4946d1||_0x5ad89a?_0x5cb44d[_0x1879c8(0x116)](_0x198eb5[_0x1879c8(0x10e)]):_0x3e58f2['push'](_0x198eb5[_0x1879c8(0x10e)]);}for(const _0xe7c285 of Object[_0x1879c8(0x10c)](_0x2326a7['sqls'])){!_0x4909df[_0x1879c8(0x126)](_0xe7c285)&&_0x28ccfa[_0x1879c8(0x116)](_0xe7c285);}const _0x2eb033=[];if(_0x3c7cdc[_0x1879c8(0x114)](_0x1879c8(0x123))){const _0x3c1672=await fetchAllSqlCodes(_0x3c7cdc[_0x1879c8(0x118)]);for(const _0x2f134b of _0x3c1672){!_0x4909df['has'](_0x2f134b)&&!_0x2326a7['sqls'][_0x2f134b]&&_0x2eb033[_0x1879c8(0x116)](_0x2f134b);}}const _0x2b4481=_0x56d68a['length']===0x0&&_0x5cb44d[_0x1879c8(0x12e)]===0x0&&_0x28ccfa[_0x1879c8(0x12e)]===0x0&&_0x2eb033[_0x1879c8(0x12e)]===0x0;return{'ok':!![],'data':{'added':_0x56d68a,'modified':_0x5cb44d,'missing':_0x28ccfa,'unchanged':_0x3e58f2,'remoteOnly':_0x2eb033},'message':_0x2b4481?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x56d68a[_0x1879c8(0x12e)]+'\x20added,\x20'+_0x5cb44d['length']+_0x1879c8(0x127)+_0x28ccfa[_0x1879c8(0x12e)]+_0x1879c8(0x120)+_0x3e58f2['length']+'\x20unchanged'+(_0x2eb033[_0x1879c8(0x12e)]>0x0?',\x20'+_0x2eb033[_0x1879c8(0x12e)]+_0x1879c8(0x129):'')};}};
1
+ function a192_0x32f9(){const _0x589765=['has','380kydDon','filePath','299595fHDpdi','\x20added,\x20','status','9VsQcmP','lockKey','\x20missing,\x20','totalCount','sqls','bool','\x20remote-only','sqlName','3ckipiC','784398xzlVkg','hash','map','60vBiJGq','lockFilePath','remote','5011936oIEzLA','31748160fGaatK','2299498lvdSwO','sqlCode','length','relativePath','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','push','sqlRoot','boolean','648632gJhYWK','appCode','180532CdrgIU','14MqHtYm','path','sql','keys','\x20unchanged','read'];a192_0x32f9=function(){return _0x589765;};return a192_0x32f9();}const a192_0x24fe57=a192_0x5e9d;(function(_0x389710,_0x244b4d){const _0x1920df=a192_0x5e9d,_0x53c292=_0x389710();while(!![]){try{const _0x81e93d=parseInt(_0x1920df(0x106))/0x1+-parseInt(_0x1920df(0xfe))/0x2*(parseInt(_0x1920df(0xf5))/0x3)+parseInt(_0x1920df(0xf9))/0x4*(-parseInt(_0x1920df(0xea))/0x5)+-parseInt(_0x1920df(0xf6))/0x6*(parseInt(_0x1920df(0x109))/0x7)+parseInt(_0x1920df(0xfc))/0x8*(-parseInt(_0x1920df(0xed))/0x9)+-parseInt(_0x1920df(0xe8))/0xa*(-parseInt(_0x1920df(0x108))/0xb)+parseInt(_0x1920df(0xfd))/0xc;if(_0x81e93d===_0x244b4d)break;else _0x53c292['push'](_0x53c292['shift']());}catch(_0x1b3dd9){_0x53c292['push'](_0x53c292['shift']());}}}(a192_0x32f9,0xef9e4));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';function a192_0x5e9d(_0x1e6883,_0x3c052d){_0x1e6883=_0x1e6883-0xe5;const _0x32f936=a192_0x32f9();let _0x5e9d1f=_0x32f936[_0x1e6883];return _0x5e9d1f;}const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x51c45e){const _0x1de4d0=a192_0x5e9d,_0x4d8cf7=[];let _0x4f9f2e=0x1;while(!![]){const _0x39d734=await listSqlQueries(_0x51c45e,{'currentPage':_0x4f9f2e,'pageSize':PAGE_SIZE}),_0xf7eeec=_0x39d734['tableData']??[];_0x4d8cf7[_0x1de4d0(0x103)](..._0xf7eeec['map'](_0x2e7211=>_0x2e7211[_0x1de4d0(0xff)]));if(_0xf7eeec[_0x1de4d0(0x100)]===0x0)break;const _0x18cb70=_0x39d734['paging']?.[_0x1de4d0(0xf0)];if(_0x18cb70!=null?_0x4d8cf7[_0x1de4d0(0x100)]>=_0x18cb70:_0xf7eeec['length']<PAGE_SIZE)break;_0x4f9f2e++;}return _0x4d8cf7;}export const sqlStatus={'service':a192_0x24fe57(0x10b),'command':a192_0x24fe57(0xec),'description':a192_0x24fe57(0x102),'risk':a192_0x24fe57(0xe6),'flags':[{'name':a192_0x24fe57(0xfb),'type':a192_0x24fe57(0x105),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x2c83e7){const _0x4e0bd7=a192_0x24fe57,_0x48908a=loadSqlProjectConfig(_0x2c83e7['appCode']),_0x5c3ea7=await readSqlLockFile(_0x48908a[_0x4e0bd7(0xfa)]),{appLock:_0x2a711b}=ensureSqlLockScope(_0x5c3ea7??createEmptySqlLock(),_0x48908a[_0x4e0bd7(0x107)],_0x48908a[_0x4e0bd7(0x104)],_0x4e0bd7(0xec)),_0x132d40=await scanLocalSqlQueries(_0x48908a),_0x326752=[],_0x4a8f83=[],_0x26f951=[],_0x3ae3b6=[],_0x26739a=new Set(_0x132d40[_0x4e0bd7(0xf8)](_0x3b4d13=>_0x3b4d13[_0x4e0bd7(0xee)]));for(const _0x2e8f79 of _0x132d40){const _0x583b58=await computeSqlFileHash(_0x2e8f79[_0x4e0bd7(0xe9)]),_0x4a53b8=_0x2a711b['sqls'][_0x2e8f79['lockKey']],_0x447e4e=!!_0x4a53b8&&_0x4a53b8[_0x4e0bd7(0x10a)]!==_0x2e8f79[_0x4e0bd7(0x101)],_0x140dd1=!!_0x4a53b8&&!!_0x2e8f79[_0x4e0bd7(0xf4)]&&_0x4a53b8[_0x4e0bd7(0xf4)]!==_0x2e8f79['sqlName'];if(!_0x4a53b8)_0x326752[_0x4e0bd7(0x103)](_0x2e8f79[_0x4e0bd7(0xee)]);else _0x4a53b8[_0x4e0bd7(0xf7)]!==_0x583b58||_0x447e4e||_0x140dd1?_0x4a8f83[_0x4e0bd7(0x103)](_0x2e8f79[_0x4e0bd7(0xee)]):_0x26f951[_0x4e0bd7(0x103)](_0x2e8f79[_0x4e0bd7(0xee)]);}for(const _0x419c52 of Object[_0x4e0bd7(0x10c)](_0x2a711b[_0x4e0bd7(0xf1)])){!_0x26739a[_0x4e0bd7(0xe7)](_0x419c52)&&_0x3ae3b6[_0x4e0bd7(0x103)](_0x419c52);}const _0x1f6706=[];if(_0x2c83e7[_0x4e0bd7(0xf2)](_0x4e0bd7(0xfb))){const _0xc411d1=await fetchAllSqlCodes(_0x2c83e7['appCode']);for(const _0x1d4553 of _0xc411d1){!_0x26739a['has'](_0x1d4553)&&!_0x2a711b[_0x4e0bd7(0xf1)][_0x1d4553]&&_0x1f6706['push'](_0x1d4553);}}const _0x9bef84=_0x326752[_0x4e0bd7(0x100)]===0x0&&_0x4a8f83[_0x4e0bd7(0x100)]===0x0&&_0x3ae3b6[_0x4e0bd7(0x100)]===0x0&&_0x1f6706['length']===0x0;return{'ok':!![],'data':{'added':_0x326752,'modified':_0x4a8f83,'missing':_0x3ae3b6,'unchanged':_0x26f951,'remoteOnly':_0x1f6706},'message':_0x9bef84?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x326752['length']+_0x4e0bd7(0xeb)+_0x4a8f83[_0x4e0bd7(0x100)]+'\x20modified,\x20'+_0x3ae3b6['length']+_0x4e0bd7(0xef)+_0x26f951['length']+_0x4e0bd7(0xe5)+(_0x1f6706[_0x4e0bd7(0x100)]>0x0?',\x20'+_0x1f6706[_0x4e0bd7(0x100)]+_0x4e0bd7(0xf3):'')};}};
@@ -1 +1 @@
1
- const a185_0x15f84e=a185_0x5582;(function(_0x133a9a,_0x44c4d4){const _0x131363=a185_0x5582,_0x195420=_0x133a9a();while(!![]){try{const _0x4b5506=parseInt(_0x131363(0x1af))/0x1*(-parseInt(_0x131363(0x1e1))/0x2)+parseInt(_0x131363(0x1b3))/0x3+-parseInt(_0x131363(0x1c4))/0x4+-parseInt(_0x131363(0x1db))/0x5*(parseInt(_0x131363(0x1e4))/0x6)+parseInt(_0x131363(0x1a2))/0x7+parseInt(_0x131363(0x1c0))/0x8*(parseInt(_0x131363(0x1d2))/0x9)+-parseInt(_0x131363(0x1ba))/0xa;if(_0x4b5506===_0x44c4d4)break;else _0x195420['push'](_0x195420['shift']());}catch(_0x3b9fd4){_0x195420['push'](_0x195420['shift']());}}}(a185_0x33c2,0x706a9));function a185_0x33c2(){const _0x3a125e=['map','trim','string','get','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','18XqPIvF','isArray','pkField','index_type','flatMap','primary','tables','boolean','length','15WVqvJV','push','\x22\x20not\x20found\x20or\x20not\x20accessible','indexName','utf-8','isSelectOnly','29798vErkDs','toLowerCase','reason','172206iXytpD','--check-indexes\x20requires\x20--schemas.','file','\x22\x20not\x20found\x20in\x20any\x20dataset','split','dbtableConfig','Table\x20\x22','3050621LTwoEv','columns','index_name','Dataset\x20\x22','index_columns','type','unshift','find','filter','check-indexes','dataset','isDangerous','read','3xkRbAX','SQL\x20schema\x20validation','message','fields','866448JJsegZ','valid','sql','from','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','schemas','cwd','1149570yyBQio','indexes','Provide\x20--file\x20or\x20--sql','name','sqlType','str','1246472dcIgvq','File\x20not\x20found:\x20','tableName','columnNames','1320092QJheot','schemaWarnings','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','appCode','schema:','validation','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','bool'];a185_0x33c2=function(){return _0x3a125e;};return a185_0x33c2();}function a185_0x5582(_0x2d8468,_0xb35ace){_0x2d8468=_0x2d8468-0x1a2;const _0x33c2f3=a185_0x33c2();let _0x558231=_0x33c2f3[_0x2d8468];return _0x558231;}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a185_0x15f84e(0x1b5),'command':'validate','description':a185_0x15f84e(0x1d0),'risk':a185_0x15f84e(0x1ae),'flags':[{'name':'file','type':'string','description':a185_0x15f84e(0x1ca)},{'name':'sql','type':a185_0x15f84e(0x1ce),'description':a185_0x15f84e(0x1c6)},{'name':a185_0x15f84e(0x1b8),'type':a185_0x15f84e(0x1ce),'description':a185_0x15f84e(0x1d1)},{'name':'check-indexes','type':a185_0x15f84e(0x1d9),'description':a185_0x15f84e(0x1b7)}],async 'execute'(_0x1f8150){const _0x567d3b=a185_0x15f84e,_0x35a623=_0x1f8150[_0x567d3b(0x1bf)](_0x567d3b(0x1e6)),_0x281664=_0x1f8150[_0x567d3b(0x1bf)](_0x567d3b(0x1b5)),_0x3cb552=_0x1f8150['str'](_0x567d3b(0x1b8)),_0x47f2b4=_0x1f8150[_0x567d3b(0x1cb)](_0x567d3b(0x1ab));if(!_0x35a623&&!_0x281664)throw CliErrors['flagMissing'](_0x567d3b(0x1e6),_0x567d3b(0x1bc));if(_0x47f2b4&&!_0x3cb552)throw CliErrors[_0x567d3b(0x1c9)](_0x567d3b(0x1e5));let _0x289063;if(_0x35a623){const _0xdd8cf7=resolve(process[_0x567d3b(0x1b9)](),_0x35a623);if(!existsSync(_0xdd8cf7))throw CliErrors[_0x567d3b(0x1c9)](_0x567d3b(0x1c1)+_0xdd8cf7);_0x289063=readFileSync(_0xdd8cf7,_0x567d3b(0x1df));}else _0x289063=_0x281664;const _0xe9f2df=validateSql(_0x289063),_0x5e1ba6={'valid':_0xe9f2df[_0x567d3b(0x1b4)],'sqlType':_0xe9f2df['sqlType'][_0x567d3b(0x1a7)],'isSelectOnly':_0xe9f2df[_0x567d3b(0x1be)][_0x567d3b(0x1e0)],'isDangerous':_0xe9f2df[_0x567d3b(0x1be)][_0x567d3b(0x1ad)],'tables':_0xe9f2df[_0x567d3b(0x1d8)],'parameters':_0xe9f2df['parameters'],'message':_0xe9f2df[_0x567d3b(0x1b1)]};_0xe9f2df[_0x567d3b(0x1be)][_0x567d3b(0x1e3)]&&(_0x5e1ba6[_0x567d3b(0x1e3)]=_0xe9f2df[_0x567d3b(0x1be)]['reason']);if(_0x3cb552&&_0xe9f2df[_0x567d3b(0x1b4)]){const _0x5aa84d=_0x3cb552['split'](',')[_0x567d3b(0x1cc)](_0x29af7=>_0x29af7[_0x567d3b(0x1cd)]())['filter'](Boolean),_0x47562=[],_0xadeda4=[],_0xa66547=filterDbTableBackedDatasets(await listDatasets(_0x1f8150[_0x567d3b(0x1c7)])),_0x2ae68d=new Map(_0xa66547[_0x567d3b(0x1cc)](_0x4158e2=>[_0x4158e2[_0x567d3b(0x1e9)]?.[_0x567d3b(0x1c2)]?.[_0x567d3b(0x1e2)](),_0x4158e2]));for(const _0x439dad of _0xe9f2df[_0x567d3b(0x1d8)]){const _0x3671c4=_0x2ae68d[_0x567d3b(0x1cf)](_0x439dad[_0x567d3b(0x1e2)]());!_0x3671c4&&_0x47562['push'](_0x567d3b(0x1ea)+_0x439dad+_0x567d3b(0x1e7));}for(const _0x4a326e of _0x5aa84d){let _0x4bd756;try{_0x4bd756=await getDatasetDetail(_0x4a326e);}catch{_0x47562[_0x567d3b(0x1dc)](_0x567d3b(0x1a5)+_0x4a326e+_0x567d3b(0x1dd));continue;}assertDatasetIsDbTableBacked(_0x4bd756,_0x567d3b(0x1b0));const _0xfe3994=Array['isArray'](_0x4bd756['fields'])?_0x4bd756[_0x567d3b(0x1b2)]:[],_0x319d4f=new Set(_0xfe3994[_0x567d3b(0x1cc)](_0x519c88=>_0x519c88['name']?.['toLowerCase']())),_0x8be81f=_0x4bd756[_0x567d3b(0x1e9)]?.[_0x567d3b(0x1c2)]||_0x4bd756[_0x567d3b(0x1c2)]||_0x4a326e;_0x5e1ba6[_0x567d3b(0x1c8)+_0x8be81f]={'code':_0x4a326e,'tableName':_0x8be81f,'fieldCount':_0x319d4f['size'],'fields':Array[_0x567d3b(0x1b6)](_0x319d4f)};if(_0x47f2b4){const _0x22d156=normalizeDatasetIndexes(_0x4bd756);_0xadeda4['push']({'tableName':_0x8be81f,..._0x22d156});}}_0x47562[_0x567d3b(0x1da)]>0x0&&(_0x5e1ba6[_0x567d3b(0x1c5)]=_0x47562),_0x47f2b4&&(_0x5e1ba6['joinAudit']=auditSqlJoinIndexes(_0x289063,_0xadeda4));}return{'ok':_0xe9f2df[_0x567d3b(0x1b4)],'data':_0x5e1ba6,'message':_0xe9f2df[_0x567d3b(0x1b1)]};}};function normalizeDatasetIndexes(_0x2d7370){const _0x6fd141=a185_0x15f84e,_0x1267a2=Array[_0x6fd141(0x1d3)](_0x2d7370?.[_0x6fd141(0x1ac)]?.[_0x6fd141(0x1bb)])?_0x2d7370['dataset'][_0x6fd141(0x1bb)]:Array[_0x6fd141(0x1d3)](_0x2d7370?.[_0x6fd141(0x1bb)])?_0x2d7370[_0x6fd141(0x1bb)]:[],_0x247f72=_0x1267a2[_0x6fd141(0x1d6)](_0x382d23=>{const _0x5828d1=_0x6fd141,_0x1988f8=Array['isArray'](_0x382d23?.[_0x5828d1(0x1a6)])?_0x382d23[_0x5828d1(0x1a6)]:Array[_0x5828d1(0x1d3)](_0x382d23?.['columnNames'])?_0x382d23[_0x5828d1(0x1c3)]:Array[_0x5828d1(0x1d3)](_0x382d23?.['columns'])?_0x382d23[_0x5828d1(0x1a3)]:[],_0x35956d=_0x1988f8[_0x5828d1(0x1aa)](_0x25bd0b=>typeof _0x25bd0b===_0x5828d1(0x1ce))[_0x5828d1(0x1cc)](_0x299878=>_0x299878[_0x5828d1(0x1cd)]())[_0x5828d1(0x1aa)](Boolean);if(_0x35956d[_0x5828d1(0x1da)]===0x0)return[];const _0x2f5255=[_0x382d23?.[_0x5828d1(0x1de)],_0x382d23?.[_0x5828d1(0x1a4)],_0x382d23?.[_0x5828d1(0x1bd)]][_0x5828d1(0x1a9)](_0x4a1b8f=>typeof _0x4a1b8f===_0x5828d1(0x1ce)&&_0x4a1b8f[_0x5828d1(0x1cd)]()),_0x5641d5=[_0x382d23?.[_0x5828d1(0x1d5)],_0x382d23?.[_0x5828d1(0x1a7)]][_0x5828d1(0x1a9)](_0x28cb15=>typeof _0x28cb15===_0x5828d1(0x1ce)&&_0x28cb15[_0x5828d1(0x1cd)]());return[{..._0x2f5255?{'name':_0x2f5255[_0x5828d1(0x1cd)]()}:{},..._0x5641d5?{'type':_0x5641d5[_0x5828d1(0x1cd)]()}:{},'columns':_0x35956d}];}),_0xe99bdb=[..._0x247f72],_0x4d60db=typeof _0x2d7370?.[_0x6fd141(0x1e9)]?.['pkField']==='string'?_0x2d7370[_0x6fd141(0x1e9)][_0x6fd141(0x1d4)][_0x6fd141(0x1e8)](',')[_0x6fd141(0x1cc)](_0x23d9fa=>_0x23d9fa[_0x6fd141(0x1cd)]())['filter'](Boolean):[];return _0x4d60db[_0x6fd141(0x1da)]>0x0&&_0xe99bdb[_0x6fd141(0x1a8)]({'type':_0x6fd141(0x1d7),'columns':_0x4d60db}),{'indexes':_0xe99bdb,'metadataAvailable':_0x247f72['length']>0x0};}
1
+ function a193_0x19c0(_0x5f2b21,_0x32f2b9){_0x5f2b21=_0x5f2b21-0x15e;const _0x36a80b=a193_0x36a8();let _0x19c0a5=_0x36a80b[_0x5f2b21];return _0x19c0a5;}const a193_0x3321ef=a193_0x19c0;(function(_0x11e0a8,_0x6aaba4){const _0x37e90f=a193_0x19c0,_0x38c501=_0x11e0a8();while(!![]){try{const _0x4d0231=parseInt(_0x37e90f(0x19f))/0x1+-parseInt(_0x37e90f(0x18b))/0x2*(parseInt(_0x37e90f(0x165))/0x3)+-parseInt(_0x37e90f(0x193))/0x4*(-parseInt(_0x37e90f(0x181))/0x5)+parseInt(_0x37e90f(0x18c))/0x6+-parseInt(_0x37e90f(0x171))/0x7*(-parseInt(_0x37e90f(0x19c))/0x8)+-parseInt(_0x37e90f(0x164))/0x9+-parseInt(_0x37e90f(0x180))/0xa;if(_0x4d0231===_0x6aaba4)break;else _0x38c501['push'](_0x38c501['shift']());}catch(_0x1aca85){_0x38c501['push'](_0x38c501['shift']());}}}(a193_0x36a8,0xe81d1));import{readFileSync,existsSync}from'node:fs';function a193_0x36a8(){const _0x43c87d=['isDangerous','message','dbtableConfig','sql','index_type','get','flatMap','1468107GVDctH','12303oXbHCu','read','valid','\x22\x20not\x20found\x20in\x20any\x20dataset','map','columnNames','string','\x22\x20not\x20found\x20or\x20not\x20accessible','length','validation','File\x20not\x20found:\x20','index_columns','4353370iPfnDE','check-indexes','size','find','utf-8','isArray','file','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','boolean','validate','SQL\x20schema\x20validation','dataset','from','appCode','schema:','42480580hriEbq','10zoNehh','schemas','tableName','primary','index_name','indexes','Provide\x20--file\x20or\x20--sql','Dataset\x20\x22','flagMissing','filter','184ULQPFK','7789020uxxPUI','push','type','name','str','fields','bool','2968796SlZzVR','cwd','Table\x20\x22','reason','columns','isSelectOnly','split','sqlType','trim','24cHdrUH','joinAudit','toLowerCase','1090912EIrJTu','unshift'];a193_0x36a8=function(){return _0x43c87d;};return a193_0x36a8();}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a193_0x3321ef(0x160),'command':a193_0x3321ef(0x17a),'description':a193_0x3321ef(0x178),'risk':a193_0x3321ef(0x166),'flags':[{'name':a193_0x3321ef(0x177),'type':a193_0x3321ef(0x16b),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a193_0x3321ef(0x160),'type':a193_0x3321ef(0x16b),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a193_0x3321ef(0x182),'type':a193_0x3321ef(0x16b),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':'check-indexes','type':a193_0x3321ef(0x179),'description':'Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata'}],async 'execute'(_0x2177a1){const _0x581679=a193_0x3321ef,_0x45aa22=_0x2177a1[_0x581679(0x190)]('file'),_0x3d0c84=_0x2177a1[_0x581679(0x190)](_0x581679(0x160)),_0x157781=_0x2177a1[_0x581679(0x190)](_0x581679(0x182)),_0x54a064=_0x2177a1[_0x581679(0x192)](_0x581679(0x172));if(!_0x45aa22&&!_0x3d0c84)throw CliErrors[_0x581679(0x189)](_0x581679(0x177),_0x581679(0x187));if(_0x54a064&&!_0x157781)throw CliErrors['validation']('--check-indexes\x20requires\x20--schemas.');let _0xa091d2;if(_0x45aa22){const _0x48e3a7=resolve(process[_0x581679(0x194)](),_0x45aa22);if(!existsSync(_0x48e3a7))throw CliErrors[_0x581679(0x16e)](_0x581679(0x16f)+_0x48e3a7);_0xa091d2=readFileSync(_0x48e3a7,_0x581679(0x175));}else _0xa091d2=_0x3d0c84;const _0x5ad13f=validateSql(_0xa091d2),_0xb8bccc={'valid':_0x5ad13f['valid'],'sqlType':_0x5ad13f['sqlType'][_0x581679(0x18e)],'isSelectOnly':_0x5ad13f[_0x581679(0x19a)][_0x581679(0x198)],'isDangerous':_0x5ad13f[_0x581679(0x19a)][_0x581679(0x1a1)],'tables':_0x5ad13f['tables'],'parameters':_0x5ad13f['parameters'],'message':_0x5ad13f['message']};_0x5ad13f['sqlType'][_0x581679(0x196)]&&(_0xb8bccc['reason']=_0x5ad13f[_0x581679(0x19a)][_0x581679(0x196)]);if(_0x157781&&_0x5ad13f[_0x581679(0x167)]){const _0x16d0f8=_0x157781[_0x581679(0x199)](',')[_0x581679(0x169)](_0x34bd5b=>_0x34bd5b[_0x581679(0x19b)]())[_0x581679(0x18a)](Boolean),_0x4a98c5=[],_0x15afb2=[],_0x555b98=filterDbTableBackedDatasets(await listDatasets(_0x2177a1[_0x581679(0x17e)])),_0x569330=new Map(_0x555b98[_0x581679(0x169)](_0x3ea837=>[_0x3ea837[_0x581679(0x15f)]?.['tableName']?.[_0x581679(0x19e)](),_0x3ea837]));for(const _0x20567a of _0x5ad13f['tables']){const _0x3fc66b=_0x569330[_0x581679(0x162)](_0x20567a['toLowerCase']());!_0x3fc66b&&_0x4a98c5[_0x581679(0x18d)](_0x581679(0x195)+_0x20567a+_0x581679(0x168));}for(const _0x4b5c5b of _0x16d0f8){let _0x3eb3e6;try{_0x3eb3e6=await getDatasetDetail(_0x4b5c5b);}catch{_0x4a98c5['push'](_0x581679(0x188)+_0x4b5c5b+_0x581679(0x16c));continue;}assertDatasetIsDbTableBacked(_0x3eb3e6,_0x581679(0x17b));const _0xb81937=Array[_0x581679(0x176)](_0x3eb3e6['fields'])?_0x3eb3e6[_0x581679(0x191)]:[],_0x30343f=new Set(_0xb81937['map'](_0x4502ad=>_0x4502ad[_0x581679(0x18f)]?.[_0x581679(0x19e)]())),_0x23c408=_0x3eb3e6[_0x581679(0x15f)]?.[_0x581679(0x183)]||_0x3eb3e6['tableName']||_0x4b5c5b;_0xb8bccc[_0x581679(0x17f)+_0x23c408]={'code':_0x4b5c5b,'tableName':_0x23c408,'fieldCount':_0x30343f[_0x581679(0x173)],'fields':Array[_0x581679(0x17d)](_0x30343f)};if(_0x54a064){const _0x500f3b=normalizeDatasetIndexes(_0x3eb3e6);_0x15afb2[_0x581679(0x18d)]({'tableName':_0x23c408,..._0x500f3b});}}_0x4a98c5['length']>0x0&&(_0xb8bccc['schemaWarnings']=_0x4a98c5),_0x54a064&&(_0xb8bccc[_0x581679(0x19d)]=auditSqlJoinIndexes(_0xa091d2,_0x15afb2));}return{'ok':_0x5ad13f[_0x581679(0x167)],'data':_0xb8bccc,'message':_0x5ad13f[_0x581679(0x15e)]};}};function normalizeDatasetIndexes(_0x1c65c6){const _0x257458=a193_0x3321ef,_0xb1db52=Array[_0x257458(0x176)](_0x1c65c6?.[_0x257458(0x17c)]?.[_0x257458(0x186)])?_0x1c65c6['dataset'][_0x257458(0x186)]:Array['isArray'](_0x1c65c6?.[_0x257458(0x186)])?_0x1c65c6[_0x257458(0x186)]:[],_0x223e03=_0xb1db52[_0x257458(0x163)](_0x4154fc=>{const _0x505f53=_0x257458,_0x4d381e=Array['isArray'](_0x4154fc?.[_0x505f53(0x170)])?_0x4154fc[_0x505f53(0x170)]:Array[_0x505f53(0x176)](_0x4154fc?.[_0x505f53(0x16a)])?_0x4154fc[_0x505f53(0x16a)]:Array[_0x505f53(0x176)](_0x4154fc?.[_0x505f53(0x197)])?_0x4154fc['columns']:[],_0x287b83=_0x4d381e[_0x505f53(0x18a)](_0x335ea2=>typeof _0x335ea2==='string')[_0x505f53(0x169)](_0x5dc6cf=>_0x5dc6cf['trim']())[_0x505f53(0x18a)](Boolean);if(_0x287b83[_0x505f53(0x16d)]===0x0)return[];const _0x22ff67=[_0x4154fc?.['indexName'],_0x4154fc?.[_0x505f53(0x185)],_0x4154fc?.['name']][_0x505f53(0x174)](_0x49eb76=>typeof _0x49eb76==='string'&&_0x49eb76[_0x505f53(0x19b)]()),_0x5d2617=[_0x4154fc?.[_0x505f53(0x161)],_0x4154fc?.[_0x505f53(0x18e)]][_0x505f53(0x174)](_0x531ff5=>typeof _0x531ff5===_0x505f53(0x16b)&&_0x531ff5[_0x505f53(0x19b)]());return[{..._0x22ff67?{'name':_0x22ff67[_0x505f53(0x19b)]()}:{},..._0x5d2617?{'type':_0x5d2617[_0x505f53(0x19b)]()}:{},'columns':_0x287b83}];}),_0x2bedd5=[..._0x223e03],_0xd9a80b=typeof _0x1c65c6?.['dbtableConfig']?.['pkField']===_0x257458(0x16b)?_0x1c65c6[_0x257458(0x15f)]['pkField']['split'](',')['map'](_0x53f07d=>_0x53f07d[_0x257458(0x19b)]())[_0x257458(0x18a)](Boolean):[];return _0xd9a80b[_0x257458(0x16d)]>0x0&&_0x2bedd5[_0x257458(0x1a0)]({'type':_0x257458(0x184),'columns':_0xd9a80b}),{'indexes':_0x2bedd5,'metadataAvailable':_0x223e03['length']>0x0};}
@@ -1 +1 @@
1
- (function(_0x467d67,_0x3f0d41){const _0x1ee26c=a186_0xf94b,_0x5d980c=_0x467d67();while(!![]){try{const _0x976bb8=-parseInt(_0x1ee26c(0xc9))/0x1+parseInt(_0x1ee26c(0xca))/0x2+-parseInt(_0x1ee26c(0xce))/0x3+parseInt(_0x1ee26c(0xcd))/0x4*(parseInt(_0x1ee26c(0xc7))/0x5)+-parseInt(_0x1ee26c(0xd0))/0x6*(parseInt(_0x1ee26c(0xcf))/0x7)+parseInt(_0x1ee26c(0xcc))/0x8*(-parseInt(_0x1ee26c(0xc8))/0x9)+parseInt(_0x1ee26c(0xcb))/0xa;if(_0x976bb8===_0x3f0d41)break;else _0x5d980c['push'](_0x5d980c['shift']());}catch(_0x2b3a13){_0x5d980c['push'](_0x5d980c['shift']());}}}(a186_0x2676,0x71308));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];function a186_0xf94b(_0xf38c70,_0x17e611){_0xf38c70=_0xf38c70-0xc7;const _0x267692=a186_0x2676();let _0xf94b9=_0x267692[_0xf38c70];return _0xf94b9;}function a186_0x2676(){const _0x14add2=['91vrJYMa','101778ALEejW','3863290roREEw','9nYNomk','496763cLSOtP','1722572iLXJaS','6153540moCeeC','5297696CLkvIM','4vRmEwl','1218540SgevhI'];a186_0x2676=function(){return _0x14add2;};return a186_0x2676();}
1
+ function a194_0x212c(_0x5789bb,_0x24352a){_0x5789bb=_0x5789bb-0x1ea;const _0x192776=a194_0x1927();let _0x212cba=_0x192776[_0x5789bb];return _0x212cba;}(function(_0x5d1ca7,_0x3d9e64){const _0x45e450=a194_0x212c,_0x4e2da9=_0x5d1ca7();while(!![]){try{const _0x857d35=-parseInt(_0x45e450(0x1f0))/0x1*(parseInt(_0x45e450(0x1ee))/0x2)+-parseInt(_0x45e450(0x1ec))/0x3+parseInt(_0x45e450(0x1f1))/0x4*(parseInt(_0x45e450(0x1ea))/0x5)+-parseInt(_0x45e450(0x1ef))/0x6*(parseInt(_0x45e450(0x1f3))/0x7)+parseInt(_0x45e450(0x1eb))/0x8+-parseInt(_0x45e450(0x1ed))/0x9+parseInt(_0x45e450(0x1f2))/0xa;if(_0x857d35===_0x3d9e64)break;else _0x4e2da9['push'](_0x4e2da9['shift']());}catch(_0x4266d7){_0x4e2da9['push'](_0x4e2da9['shift']());}}}(a194_0x1927,0x66ce1));import{taskStatus}from'../../commands/task/status.js';function a194_0x1927(){const _0xe45315=['5xkTTtK','733288AokgPR','44346LBJgyt','4695561uVUwIh','1396012cDnbqv','150gEYUlU','1ruPqmc','605584lBzaEb','17288740MwdsIt','88571vPHfYv'];a194_0x1927=function(){return _0xe45315;};return a194_0x1927();}export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- const a187_0x12faca=a187_0x1819;(function(_0x561c42,_0x161f67){const _0x85d657=a187_0x1819,_0x5adf08=_0x561c42();while(!![]){try{const _0x5c0d07=parseInt(_0x85d657(0x1b9))/0x1*(parseInt(_0x85d657(0x1c2))/0x2)+parseInt(_0x85d657(0x1bd))/0x3*(-parseInt(_0x85d657(0x1b0))/0x4)+parseInt(_0x85d657(0x1c0))/0x5+parseInt(_0x85d657(0x1c5))/0x6+-parseInt(_0x85d657(0x1b7))/0x7+-parseInt(_0x85d657(0x1b4))/0x8+parseInt(_0x85d657(0x1b8))/0x9*(parseInt(_0x85d657(0x1c4))/0xa);if(_0x5c0d07===_0x161f67)break;else _0x5adf08['push'](_0x5adf08['shift']());}catch(_0x1471a8){_0x5adf08['push'](_0x5adf08['shift']());}}}(a187_0x1cfb,0x94150));function a187_0x1cfb(){const _0xddda56=['Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','12xyVitv','cookie',',\x20received\x20','4338985pcWipt','apiError','724468sqZixa','trim','2280snZzeU','3582588tVrcJr','taskId','181000BagQrM','str','compress','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','1110720fANPCq','appCode','task-id','7380919KHiJaD','6066FQyeGV','1BJhkxc','flagMissing','isTerminal'];a187_0x1cfb=function(){return _0xddda56;};return a187_0x1cfb();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a187_0x1819(_0x29d5d1,_0x18e709){_0x29d5d1=_0x29d5d1-0x1b0;const _0x1cfbb9=a187_0x1cfb();let _0x1819e0=_0x1cfbb9[_0x29d5d1];return _0x1819e0;}import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':'task','command':'status','description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':'read','defaultOutputFormat':a187_0x12faca(0x1b2),'structuredErrors':!![],'flags':[{'name':a187_0x12faca(0x1b6),'type':'string','required':!![],'description':a187_0x12faca(0x1bc)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x104f8a){const _0x5067e2=a187_0x12faca;if(!_0x104f8a[_0x5067e2(0x1b1)]('task-id')[_0x5067e2(0x1c3)]())throw CliErrors[_0x5067e2(0x1ba)](_0x5067e2(0x1b6));},async 'execute'(_0x5cd6e5){const _0x258762=a187_0x12faca,_0x3ab2c9=_0x5cd6e5[_0x258762(0x1b1)](_0x258762(0x1b6))['trim'](),_0x48b209=normalizeAsyncTask(await getAsyncTaskStatus(_0x3ab2c9,_0x5cd6e5[_0x258762(0x1b5)],_0x5cd6e5[_0x258762(0x1be)]));if(_0x48b209[_0x258762(0x1c6)]!==_0x3ab2c9)throw CliErrors[_0x258762(0x1c1)](_0x258762(0x1b3)+_0x3ab2c9+_0x258762(0x1bf)+_0x48b209[_0x258762(0x1c6)]+'.');const _0x37dbfa=buildAsyncTaskStatusCommand(_0x48b209[_0x258762(0x1c6)],_0x5cd6e5['appCode']);return{'ok':!![],'message':asyncTaskMessage(_0x48b209),'data':{'appCode':_0x5cd6e5[_0x258762(0x1b5)],..._0x48b209,'query':_0x48b209[_0x258762(0x1bb)]?null:{'command':_0x37dbfa}}};}};
1
+ const a195_0x33063d=a195_0x502d;(function(_0x298d5a,_0x3b5080){const _0x346920=a195_0x502d,_0x341b6b=_0x298d5a();while(!![]){try{const _0x3a3123=-parseInt(_0x346920(0xfd))/0x1+-parseInt(_0x346920(0xeb))/0x2+-parseInt(_0x346920(0xf4))/0x3*(parseInt(_0x346920(0xf3))/0x4)+-parseInt(_0x346920(0xf6))/0x5+parseInt(_0x346920(0xe9))/0x6*(parseInt(_0x346920(0xf5))/0x7)+-parseInt(_0x346920(0xf7))/0x8+-parseInt(_0x346920(0xf0))/0x9*(-parseInt(_0x346920(0xf8))/0xa);if(_0x3a3123===_0x3b5080)break;else _0x341b6b['push'](_0x341b6b['shift']());}catch(_0x44140e){_0x341b6b['push'](_0x341b6b['shift']());}}}(a195_0xe2b0,0x43ecb));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';function a195_0x502d(_0x44a529,_0x23bf5f){_0x44a529=_0x44a529-0xe8;const _0xe2b0e1=a195_0xe2b0();let _0x502d56=_0xe2b0e1[_0x44a529];return _0x502d56;}import{CliErrors}from'../../errors.js';export const taskStatus={'service':'task','command':'status','description':a195_0x33063d(0xf2),'risk':'read','defaultOutputFormat':a195_0x33063d(0xec),'structuredErrors':!![],'flags':[{'name':'task-id','type':a195_0x33063d(0xf9),'required':!![],'description':a195_0x33063d(0xfc)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x12c558){const _0x570c50=a195_0x33063d;if(!_0x12c558[_0x570c50(0xee)](_0x570c50(0xef))['trim']())throw CliErrors[_0x570c50(0xfb)](_0x570c50(0xef));},async 'execute'(_0x27b550){const _0xf187a6=a195_0x33063d,_0x205c2c=_0x27b550['str'](_0xf187a6(0xef))['trim'](),_0x1afcac=normalizeAsyncTask(await getAsyncTaskStatus(_0x205c2c,_0x27b550[_0xf187a6(0xf1)],_0x27b550[_0xf187a6(0xea)]));if(_0x1afcac['taskId']!==_0x205c2c)throw CliErrors['apiError'](_0xf187a6(0xed)+_0x205c2c+',\x20received\x20'+_0x1afcac[_0xf187a6(0xfa)]+'.');const _0x32e9c9=buildAsyncTaskStatusCommand(_0x1afcac[_0xf187a6(0xfa)],_0x27b550[_0xf187a6(0xf1)]);return{'ok':!![],'message':asyncTaskMessage(_0x1afcac),'data':{'appCode':_0x27b550[_0xf187a6(0xf1)],..._0x1afcac,'query':_0x1afcac[_0xf187a6(0xe8)]?null:{'command':_0x32e9c9}}};}};function a195_0xe2b0(){const _0x475268=['12QeBczM','cookie','157272UKJcrq','compress','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','str','task-id','15707214WaaBlD','appCode','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','367408WVnfSw','15KZBuTV','889091naOMxS','2021605CNoPJH','4036032ADyJHG','10CoPANw','string','taskId','flagMissing','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','274332QKnTcJ','isTerminal'];a195_0xe2b0=function(){return _0x475268;};return a195_0xe2b0();}
@@ -1 +1 @@
1
- function a188_0x5f19(_0x41ac56,_0x3baa36){_0x41ac56=_0x41ac56-0x14d;const _0x2bdd20=a188_0x2bdd();let _0x5f19db=_0x2bdd20[_0x41ac56];return _0x5f19db;}(function(_0x1b2574,_0x1731aa){const _0x4046f0=a188_0x5f19,_0x18a347=_0x1b2574();while(!![]){try{const _0x3e6a01=parseInt(_0x4046f0(0x152))/0x1+-parseInt(_0x4046f0(0x151))/0x2*(-parseInt(_0x4046f0(0x157))/0x3)+-parseInt(_0x4046f0(0x14f))/0x4*(-parseInt(_0x4046f0(0x155))/0x5)+-parseInt(_0x4046f0(0x150))/0x6+-parseInt(_0x4046f0(0x14e))/0x7*(-parseInt(_0x4046f0(0x154))/0x8)+parseInt(_0x4046f0(0x14d))/0x9*(-parseInt(_0x4046f0(0x156))/0xa)+parseInt(_0x4046f0(0x153))/0xb;if(_0x3e6a01===_0x1731aa)break;else _0x18a347['push'](_0x18a347['shift']());}catch(_0x190b4f){_0x18a347['push'](_0x18a347['shift']());}}}(a188_0x2bdd,0xd1fdf));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];function a188_0x2bdd(){const _0xc6598a=['8XcIKOA','175365yxnCfW','2882530pluREI','49026mpSjGo','36sgcXiP','5689257swoDwZ','24lOxWao','9570816RmSfiT','138WIFnvV','83091buHNMj','15118367ccNVOy'];a188_0x2bdd=function(){return _0xc6598a;};return a188_0x2bdd();}
1
+ (function(_0x3c01c4,_0x5431b9){const _0x1e19ef=a196_0x21bb,_0x1b60bd=_0x3c01c4();while(!![]){try{const _0x4c0b80=parseInt(_0x1e19ef(0xfe))/0x1*(-parseInt(_0x1e19ef(0x103))/0x2)+parseInt(_0x1e19ef(0x102))/0x3+parseInt(_0x1e19ef(0x105))/0x4*(-parseInt(_0x1e19ef(0x104))/0x5)+-parseInt(_0x1e19ef(0x100))/0x6+parseInt(_0x1e19ef(0xfd))/0x7*(-parseInt(_0x1e19ef(0xff))/0x8)+-parseInt(_0x1e19ef(0xfc))/0x9+parseInt(_0x1e19ef(0x101))/0xa;if(_0x4c0b80===_0x5431b9)break;else _0x1b60bd['push'](_0x1b60bd['shift']());}catch(_0x44858d){_0x1b60bd['push'](_0x1b60bd['shift']());}}}(a196_0x42a0,0xe89f2));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];function a196_0x21bb(_0x35f3d7,_0x33f909){_0x35f3d7=_0x35f3d7-0xfc;const _0x42a0d0=a196_0x42a0();let _0x21bbde=_0x42a0d0[_0x35f3d7];return _0x21bbde;}function a196_0x42a0(){const _0x3d10e4=['12089799PFwUWh','1925urGHhF','575924Kqcbdx','14176ItAZij','2967180GGVOGY','41051500kiFPsv','4113774TpIIpj','4hHbqEn','1215JkMvLm','17228dKEUJX'];a196_0x42a0=function(){return _0x3d10e4;};return a196_0x42a0();}
@@ -1 +1 @@
1
- const a189_0x5ec09f=a189_0x5179;(function(_0x501f85,_0x420e3c){const _0x417721=a189_0x5179,_0x100753=_0x501f85();while(!![]){try{const _0x5b3530=-parseInt(_0x417721(0x18f))/0x1+parseInt(_0x417721(0x18b))/0x2+-parseInt(_0x417721(0x18e))/0x3+parseInt(_0x417721(0x187))/0x4+-parseInt(_0x417721(0x192))/0x5*(-parseInt(_0x417721(0x182))/0x6)+parseInt(_0x417721(0x18d))/0x7*(-parseInt(_0x417721(0x184))/0x8)+parseInt(_0x417721(0x188))/0x9*(-parseInt(_0x417721(0x185))/0xa);if(_0x5b3530===_0x420e3c)break;else _0x100753['push'](_0x100753['shift']());}catch(_0x47c09c){_0x100753['push'](_0x100753['shift']());}}}(a189_0x4c41,0x45714));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a189_0x4c41(){const _0xaf660d=['99wlsJwA','tenant-code','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','259112fKzhYX','Exact\x20tenant\x20code','224917hdLxUt','106212FJPaTW','70020mzXtSL','trim','length','1740090FPoHYt','str','6wftaxo','read','56hRtKeO','327830toZVjM','Found\x20','1991264GNCjIV'];a189_0x4c41=function(){return _0xaf660d;};return a189_0x4c41();}import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';function a189_0x5179(_0x84e97d,_0x5f0c46){_0x84e97d=_0x84e97d-0x182;const _0x4c41d1=a189_0x4c41();let _0x51792c=_0x4c41d1[_0x84e97d];return _0x51792c;}export const tenantMembersListDefinition={'service':'tenant','command':'members-list','description':a189_0x5ec09f(0x18a),'risk':a189_0x5ec09f(0x183),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a189_0x5ec09f(0x189),'type':'string','required':!![],'description':a189_0x5ec09f(0x18c)}],async 'validate'(_0x6b4674){const _0x132703=a189_0x5ec09f;if(!_0x6b4674[_0x132703(0x193)](_0x132703(0x189))[_0x132703(0x190)]())throw CliErrors['flagMissing'](_0x132703(0x189),'Pass\x20--tenant-code\x20<code>.');},async 'execute'(_0x38e655){const _0x1eaed6=a189_0x5ec09f,_0x179a46=_0x38e655[_0x1eaed6(0x193)](_0x1eaed6(0x189))[_0x1eaed6(0x190)](),_0xd06e74=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x179a46,_0xd06e74);const _0x5890f4=projectTenantMembers(await listTenantDirectoryMembers(_0x179a46));return{'ok':!![],'data':{'tenantCode':_0x179a46,'items':_0x5890f4,'totalCount':_0x5890f4[_0x1eaed6(0x191)]},'message':_0x1eaed6(0x186)+_0x5890f4[_0x1eaed6(0x191)]+'\x20tenant\x20member(s)'};}};
1
+ function a197_0x1a7d(_0x57e97c,_0x136941){_0x57e97c=_0x57e97c-0x1bd;const _0x2b2d74=a197_0x2b2d();let _0x1a7dd2=_0x2b2d74[_0x57e97c];return _0x1a7dd2;}const a197_0x123396=a197_0x1a7d;(function(_0x8fd2a0,_0x3b8e71){const _0x4b40c1=a197_0x1a7d,_0x126720=_0x8fd2a0();while(!![]){try{const _0xbf6c91=-parseInt(_0x4b40c1(0x1be))/0x1+-parseInt(_0x4b40c1(0x1c1))/0x2*(-parseInt(_0x4b40c1(0x1cd))/0x3)+-parseInt(_0x4b40c1(0x1cb))/0x4+parseInt(_0x4b40c1(0x1ce))/0x5+-parseInt(_0x4b40c1(0x1d0))/0x6+parseInt(_0x4b40c1(0x1c2))/0x7*(parseInt(_0x4b40c1(0x1ca))/0x8)+-parseInt(_0x4b40c1(0x1c5))/0x9*(-parseInt(_0x4b40c1(0x1c3))/0xa);if(_0xbf6c91===_0x3b8e71)break;else _0x126720['push'](_0x126720['shift']());}catch(_0x3ff2ed){_0x126720['push'](_0x126720['shift']());}}}(a197_0x2b2d,0x55f41));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a197_0x2b2d(){const _0x435abb=['length','27JEmoJx','783645TpPFMT','tenant-code','1100712HVPDVW','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','Found\x20','507994NhOAXm','\x20tenant\x20member(s)','string','85216vcByiQ','21CeTMrT','211690HodDlX','read','333sNBVDC','Exact\x20tenant\x20code','members-list','Pass\x20--tenant-code\x20<code>.','str','780008YZVINl','2289784PFcPqi'];a197_0x2b2d=function(){return _0x435abb;};return a197_0x2b2d();}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':'tenant','command':a197_0x123396(0x1c7),'description':a197_0x123396(0x1d1),'risk':a197_0x123396(0x1c4),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a197_0x123396(0x1cf),'type':a197_0x123396(0x1c0),'required':!![],'description':a197_0x123396(0x1c6)}],async 'validate'(_0x2e4278){const _0x2f08ee=a197_0x123396;if(!_0x2e4278[_0x2f08ee(0x1c9)](_0x2f08ee(0x1cf))['trim']())throw CliErrors['flagMissing'](_0x2f08ee(0x1cf),_0x2f08ee(0x1c8));},async 'execute'(_0xdf371d){const _0xf5b476=a197_0x123396,_0x5c6ee3=_0xdf371d['str']('tenant-code')['trim'](),_0x44e989=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x5c6ee3,_0x44e989);const _0x522eed=projectTenantMembers(await listTenantDirectoryMembers(_0x5c6ee3));return{'ok':!![],'data':{'tenantCode':_0x5c6ee3,'items':_0x522eed,'totalCount':_0x522eed[_0xf5b476(0x1cc)]},'message':_0xf5b476(0x1bd)+_0x522eed[_0xf5b476(0x1cc)]+_0xf5b476(0x1bf)};}};
@@ -1 +1 @@
1
- (function(_0x444913,_0x228495){const _0x889be0=a190_0xb95d,_0x565cf8=_0x444913();while(!![]){try{const _0x20f91e=-parseInt(_0x889be0(0x17f))/0x1+parseInt(_0x889be0(0x16d))/0x2*(parseInt(_0x889be0(0x170))/0x3)+-parseInt(_0x889be0(0x185))/0x4+-parseInt(_0x889be0(0x176))/0x5*(parseInt(_0x889be0(0x177))/0x6)+parseInt(_0x889be0(0x182))/0x7*(parseInt(_0x889be0(0x17d))/0x8)+parseInt(_0x889be0(0x17b))/0x9+-parseInt(_0x889be0(0x184))/0xa;if(_0x20f91e===_0x228495)break;else _0x565cf8['push'](_0x565cf8['shift']());}catch(_0x5b8d54){_0x565cf8['push'](_0x565cf8['shift']());}}}(a190_0x5cce,0x1d694));import{CliErrors}from'../../errors.js';function textOrNull(_0x525f74){const _0x400ba6=a190_0xb95d,_0x55965e=_0x525f74?.[_0x400ba6(0x183)]();return _0x55965e?_0x55965e:null;}function a190_0x5cce(){const _0x57a6e0=['isFinite','username','65IJNZju','6084nrNNHD','role','displayName','values','979911SBAxzE','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','8XFPWXv','adminFlag','11592NqstHF','ADMIN','userId','687113hbOpRn','trim','86540hNzsnz','549608HnVmUz','nickname','sort','some','10XNGRUS','set','status','50556kfRqqB','tenantCode','validation','Tenant\x20\x22'];a190_0x5cce=function(){return _0x57a6e0;};return a190_0x5cce();}function a190_0xb95d(_0x28ce4a,_0x297358){_0x28ce4a=_0x28ce4a-0x16a;const _0x5cce67=a190_0x5cce();let _0xb95dfd=_0x5cce67[_0x28ce4a];return _0xb95dfd;}export function projectTenantMembers(_0x281b10){const _0x2ee891=a190_0xb95d,_0x4205a7=new Map();for(const _0x185fc8 of _0x281b10){const _0x322d64=Number(_0x185fc8['userId']);if(!Number[_0x2ee891(0x174)](_0x322d64)||_0x322d64<=0x0)continue;const _0x53e337={'userId':_0x322d64,'username':textOrNull(_0x185fc8[_0x2ee891(0x175)]),'displayName':textOrNull(_0x185fc8[_0x2ee891(0x16a)]),'role':_0x185fc8[_0x2ee891(0x17e)]===!![]?_0x2ee891(0x180):'MEMBER','status':textOrNull(_0x185fc8[_0x2ee891(0x16f)])},_0x396ed4=_0x4205a7['get'](_0x322d64);if(!_0x396ed4){_0x4205a7[_0x2ee891(0x16e)](_0x322d64,_0x53e337);continue;}_0x396ed4[_0x2ee891(0x175)]??=_0x53e337[_0x2ee891(0x175)],_0x396ed4[_0x2ee891(0x179)]??=_0x53e337[_0x2ee891(0x179)],_0x396ed4['status']??=_0x53e337['status'];if(_0x53e337['role']===_0x2ee891(0x180))_0x396ed4[_0x2ee891(0x178)]=_0x2ee891(0x180);}return[..._0x4205a7[_0x2ee891(0x17a)]()][_0x2ee891(0x16b)]((_0x121f7d,_0x4adf79)=>_0x121f7d[_0x2ee891(0x181)]-_0x4adf79[_0x2ee891(0x181)]);}export function assertTenantAccessible(_0x27f129,_0x13b462){const _0x3b0bb9=a190_0xb95d;if(_0x13b462[_0x3b0bb9(0x16c)](_0x55d6b5=>_0x55d6b5[_0x3b0bb9(0x171)]===_0x27f129))return;throw CliErrors[_0x3b0bb9(0x172)](_0x3b0bb9(0x173)+_0x27f129+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.',_0x3b0bb9(0x17c));}
1
+ function a198_0x1fa3(_0x4d42da,_0x225ac2){_0x4d42da=_0x4d42da-0x1d6;const _0x1fd85e=a198_0x1fd8();let _0x1fa35d=_0x1fd85e[_0x4d42da];return _0x1fa35d;}(function(_0x4c961c,_0x25c8d3){const _0x9660a0=a198_0x1fa3,_0x497bee=_0x4c961c();while(!![]){try{const _0xa676a6=parseInt(_0x9660a0(0x1e8))/0x1*(-parseInt(_0x9660a0(0x1e7))/0x2)+parseInt(_0x9660a0(0x1e9))/0x3+-parseInt(_0x9660a0(0x1ed))/0x4*(-parseInt(_0x9660a0(0x1e2))/0x5)+parseInt(_0x9660a0(0x1d9))/0x6*(parseInt(_0x9660a0(0x1da))/0x7)+parseInt(_0x9660a0(0x1de))/0x8*(parseInt(_0x9660a0(0x1eb))/0x9)+-parseInt(_0x9660a0(0x1ee))/0xa*(parseInt(_0x9660a0(0x1e1))/0xb)+-parseInt(_0x9660a0(0x1e6))/0xc;if(_0xa676a6===_0x25c8d3)break;else _0x497bee['push'](_0x497bee['shift']());}catch(_0x1a9fd2){_0x497bee['push'](_0x497bee['shift']());}}}(a198_0x1fd8,0x982f5));import{CliErrors}from'../../errors.js';function textOrNull(_0x3181fe){const _0x156e74=_0x3181fe?.['trim']();return _0x156e74?_0x156e74:null;}export function projectTenantMembers(_0x4da6a9){const _0x236304=a198_0x1fa3,_0x2a6001=new Map();for(const _0x2eebc4 of _0x4da6a9){const _0x5be434=Number(_0x2eebc4[_0x236304(0x1d7)]);if(!Number['isFinite'](_0x5be434)||_0x5be434<=0x0)continue;const _0x4f6ddb={'userId':_0x5be434,'username':textOrNull(_0x2eebc4[_0x236304(0x1e5)]),'displayName':textOrNull(_0x2eebc4[_0x236304(0x1d6)]),'role':_0x2eebc4[_0x236304(0x1d8)]===!![]?_0x236304(0x1e3):'MEMBER','status':textOrNull(_0x2eebc4[_0x236304(0x1ec)])},_0x25c137=_0x2a6001[_0x236304(0x1df)](_0x5be434);if(!_0x25c137){_0x2a6001['set'](_0x5be434,_0x4f6ddb);continue;}_0x25c137[_0x236304(0x1e5)]??=_0x4f6ddb[_0x236304(0x1e5)],_0x25c137['displayName']??=_0x4f6ddb[_0x236304(0x1e4)],_0x25c137[_0x236304(0x1ec)]??=_0x4f6ddb[_0x236304(0x1ec)];if(_0x4f6ddb['role']==='ADMIN')_0x25c137[_0x236304(0x1e0)]=_0x236304(0x1e3);}return[..._0x2a6001[_0x236304(0x1ea)]()]['sort']((_0x4d4e6,_0x17e959)=>_0x4d4e6[_0x236304(0x1d7)]-_0x17e959[_0x236304(0x1d7)]);}export function assertTenantAccessible(_0x2849f0,_0x22121e){const _0x136872=a198_0x1fa3;if(_0x22121e[_0x136872(0x1dc)](_0x34e141=>_0x34e141['tenantCode']===_0x2849f0))return;throw CliErrors[_0x136872(0x1db)](_0x136872(0x1dd)+_0x2849f0+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}function a198_0x1fd8(){const _0x3be6e2=['ADMIN','displayName','username','18958284MgIDWp','173584VSENJQ','1Itbxhp','3194766xbzVmB','values','8901uRCGNC','status','32CeRUtG','10uafKXu','nickname','userId','adminFlag','2414532FGZLyL','7rlQfWq','validation','some','Tenant\x20\x22','3648fXrIkq','get','role','984742rXrxpJ','288245SmUTST'];a198_0x1fd8=function(){return _0x3be6e2;};return a198_0x1fd8();}
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const dingTalkSandboxBind: CommandDefinition;
@@ -0,0 +1 @@
1
+ const a199_0x12854f=a199_0x47a6;function a199_0x47a6(_0x608f91,_0x13b5fd){_0x608f91=_0x608f91-0x114;const _0x52d4f7=a199_0x52d4();let _0x47a6ba=_0x52d4f7[_0x608f91];return _0x47a6ba;}(function(_0x923d13,_0x395b74){const _0x599efc=a199_0x47a6,_0x48f473=_0x923d13();while(!![]){try{const _0x406f71=parseInt(_0x599efc(0x11f))/0x1+parseInt(_0x599efc(0x115))/0x2+parseInt(_0x599efc(0x11a))/0x3+parseInt(_0x599efc(0x128))/0x4*(-parseInt(_0x599efc(0x129))/0x5)+-parseInt(_0x599efc(0x116))/0x6+-parseInt(_0x599efc(0x11c))/0x7*(-parseInt(_0x599efc(0x12b))/0x8)+-parseInt(_0x599efc(0x123))/0x9;if(_0x406f71===_0x395b74)break;else _0x48f473['push'](_0x48f473['shift']());}catch(_0x1d8170){_0x48f473['push'](_0x48f473['shift']());}}}(a199_0x52d4,0x42171));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=a199_0x12854f(0x126),CURRENT_BINDING_WARNING=a199_0x12854f(0x12c);function readDingTalkUserId(_0x2b6169){const _0x4d3488=a199_0x12854f,_0x4b4848=_0x2b6169['str'](_0x4d3488(0x125))[_0x4d3488(0x118)]();if(!_0x4b4848)throw CliErrors[_0x4d3488(0x12a)]('--ding-talk-user-id\x20cannot\x20be\x20empty.',_0x4d3488(0x122));return _0x4b4848;}function buildBindingData(_0x84038e,_0x1c06f8){const _0x1126fc=a199_0x12854f;return{'operation':_0x1126fc(0x11e),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x84038e},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x84038e,'bound':!![]},'dryRun':_0x1c06f8,'backend':{'method':_0x1126fc(0x127),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a199_0x12854f(0x121),'command':'dingding-sandbox-bind','description':a199_0x12854f(0x114),'risk':a199_0x12854f(0x11d),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a199_0x12854f(0x125),'type':a199_0x12854f(0x117),'required':!![],'description':a199_0x12854f(0x119)}],async 'validate'(_0x3c120c){readDingTalkUserId(_0x3c120c);},async 'dryRun'(_0x37e9bb){const _0x55f152=a199_0x12854f,_0x24cfb8=readDingTalkUserId(_0x37e9bb);return asDryRunResult(buildBindingData(_0x24cfb8,!![]),{'method':_0x55f152(0x127),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x24fdd8){const _0x5e86ca=a199_0x12854f,_0x49a2bc=readDingTalkUserId(_0x24fdd8),_0x19f7dd=await bindDingTalkSandboxAccount(_0x49a2bc);if(_0x19f7dd!==!![])throw CliErrors[_0x5e86ca(0x124)]('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x5e86ca(0x120));return{'ok':!![],'data':buildBindingData(_0x49a2bc,![]),'message':_0x5e86ca(0x11b)};}};function a199_0x52d4(){const _0x4437d7=['Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','user-account','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','639747lQNAhm','apiError','ding-talk-user-id','dingding-sandbox','POST','356qkBtqW','25765CbOaSi','validation','67688lkwqYz','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','594120QcDNvE','3125286QcvzjC','string','trim','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','1162605PrIyhk','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','350FrQTlo','high-risk-write','bind','213641KTVfSm'];a199_0x52d4=function(){return _0x4437d7;};return a199_0x52d4();}
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const userAccountDefinitions: CommandDefinition[];
@@ -0,0 +1 @@
1
+ function a200_0x1c2b(_0x4b6e8c,_0x3efedc){_0x4b6e8c=_0x4b6e8c-0xbf;const _0x2ef7c9=a200_0x2ef7();let _0x1c2bed=_0x2ef7c9[_0x4b6e8c];return _0x1c2bed;}(function(_0x46f381,_0x26b685){const _0x1dfae3=a200_0x1c2b,_0x3181c8=_0x46f381();while(!![]){try{const _0x583b0e=-parseInt(_0x1dfae3(0xc6))/0x1*(parseInt(_0x1dfae3(0xc0))/0x2)+parseInt(_0x1dfae3(0xc3))/0x3+parseInt(_0x1dfae3(0xc4))/0x4*(-parseInt(_0x1dfae3(0xc9))/0x5)+parseInt(_0x1dfae3(0xc1))/0x6+-parseInt(_0x1dfae3(0xc5))/0x7+parseInt(_0x1dfae3(0xc7))/0x8*(parseInt(_0x1dfae3(0xbf))/0x9)+parseInt(_0x1dfae3(0xc8))/0xa*(parseInt(_0x1dfae3(0xc2))/0xb);if(_0x583b0e===_0x26b685)break;else _0x3181c8['push'](_0x3181c8['shift']());}catch(_0x22767f){_0x3181c8['push'](_0x3181c8['shift']());}}}(a200_0x2ef7,0x3c288));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a200_0x2ef7(){const _0x3bac9e=['445931qenLxR','56LfRKXU','4642590TisBLq','80260iENOHC','324333DoAGgA','2vFRYez','1600254jVMAED','22TTVobE','150327ZCDfuZ','120AhlYJN','2265872PegsuD'];a200_0x2ef7=function(){return _0x3bac9e;};return a200_0x2ef7();}export const userAccountDefinitions=[dingTalkSandboxBind];
@@ -1 +1 @@
1
- function a191_0x1d98(){const _0x525fe3=['12776nNXlAF','workspace\x20add','3102cmlDqB','1210870EjjJpp','1191065edxvZL','748446wWNYhn','App\x20profile\x20name','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','write','12alXKMu','881423kJlARt','2711303DpzDOo','add','1502TAvHdE','405eobbmA','workspace'];a191_0x1d98=function(){return _0x525fe3;};return a191_0x1d98();}const a191_0x45b325=a191_0xef98;function a191_0xef98(_0x2f2544,_0x521fe2){_0x2f2544=_0x2f2544-0xd1;const _0x1d9855=a191_0x1d98();let _0xef989e=_0x1d9855[_0x2f2544];return _0xef989e;}(function(_0x4dffe8,_0x5e1cf8){const _0x1a2caf=a191_0xef98,_0x5e7059=_0x4dffe8();while(!![]){try{const _0x3a8516=parseInt(_0x1a2caf(0xe0))/0x1+-parseInt(_0x1a2caf(0xd3))/0x2*(parseInt(_0x1a2caf(0xd8))/0x3)+-parseInt(_0x1a2caf(0xdf))/0x4*(-parseInt(_0x1a2caf(0xda))/0x5)+parseInt(_0x1a2caf(0xdb))/0x6+-parseInt(_0x1a2caf(0xd1))/0x7+-parseInt(_0x1a2caf(0xd6))/0x8*(-parseInt(_0x1a2caf(0xd4))/0x9)+-parseInt(_0x1a2caf(0xd9))/0xa;if(_0x3a8516===_0x5e1cf8)break;else _0x5e7059['push'](_0x5e7059['shift']());}catch(_0x32d6d2){_0x5e7059['push'](_0x5e7059['shift']());}}}(a191_0x1d98,0x7bf46));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a191_0x45b325(0xd5),'command':a191_0x45b325(0xd2),'description':a191_0x45b325(0xdd),'risk':a191_0x45b325(0xde),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a191_0x45b325(0xdc),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x476a72=>validateAppName(_0x476a72,a191_0x45b325(0xd7)),'execute':_0x486fbf=>runAppAdd(_0x486fbf,a191_0x45b325(0xd7))};
1
+ function a201_0x10bb(_0x575f18,_0x42d90e){_0x575f18=_0x575f18-0x7d;const _0x1653f9=a201_0x1653();let _0x10bb94=_0x1653f9[_0x575f18];return _0x10bb94;}const a201_0x5a90ec=a201_0x10bb;(function(_0x4bf2d9,_0x5ecc73){const _0x25927b=a201_0x10bb,_0x2e6a48=_0x4bf2d9();while(!![]){try{const _0x2ebf7a=-parseInt(_0x25927b(0x84))/0x1*(parseInt(_0x25927b(0x89))/0x2)+parseInt(_0x25927b(0x80))/0x3+parseInt(_0x25927b(0x8a))/0x4*(-parseInt(_0x25927b(0x81))/0x5)+parseInt(_0x25927b(0x85))/0x6+parseInt(_0x25927b(0x8b))/0x7*(parseInt(_0x25927b(0x7d))/0x8)+parseInt(_0x25927b(0x7e))/0x9*(parseInt(_0x25927b(0x87))/0xa)+-parseInt(_0x25927b(0x82))/0xb;if(_0x2ebf7a===_0x5ecc73)break;else _0x2e6a48['push'](_0x2e6a48['shift']());}catch(_0x3c782f){_0x2e6a48['push'](_0x2e6a48['shift']());}}}(a201_0x1653,0x9444d));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a201_0x1653(){const _0x104b34=['219490JGAXbt','write','2zBxHVh','2427704KZPYSh','960799SZHBVm','56kEWaJZ','378PpEBWJ','workspace\x20add','2252508GGniVQ','10LUVVbE','1547469AfisUk','add','972270zmeiAL','1803702ghBTDB','App\x20profile\x20name'];a201_0x1653=function(){return _0x104b34;};return a201_0x1653();}export const workspaceAddDefinition={'service':'workspace','command':a201_0x5a90ec(0x83),'description':'Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','risk':a201_0x5a90ec(0x88),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a201_0x5a90ec(0x86),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x21701b=>validateAppName(_0x21701b,a201_0x5a90ec(0x7f)),'execute':_0x292ec1=>runAppAdd(_0x292ec1,a201_0x5a90ec(0x7f))};
@@ -1 +1 @@
1
- const a192_0x1ac181=a192_0x3818;(function(_0x4a02ca,_0x1f2af9){const _0xe61473=a192_0x3818,_0x16bc52=_0x4a02ca();while(!![]){try{const _0x32dedd=parseInt(_0xe61473(0xf2))/0x1+-parseInt(_0xe61473(0xd5))/0x2+parseInt(_0xe61473(0xcc))/0x3*(-parseInt(_0xe61473(0xe1))/0x4)+parseInt(_0xe61473(0xf3))/0x5+parseInt(_0xe61473(0xbc))/0x6*(parseInt(_0xe61473(0xb7))/0x7)+parseInt(_0xe61473(0xe3))/0x8+-parseInt(_0xe61473(0xe5))/0x9;if(_0x32dedd===_0x1f2af9)break;else _0x16bc52['push'](_0x16bc52['shift']());}catch(_0x4492ee){_0x16bc52['push'](_0x16bc52['shift']());}}}(a192_0x3724,0xda166));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a192_0x3818(_0x167779,_0x3ec96b){_0x167779=_0x167779-0xb7;const _0x3724f7=a192_0x3724();let _0x38187a=_0x3724f7[_0x167779];return _0x38187a;}import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';function a192_0x3724(){const _0x1c76d8=['Locale\x20for\x20this\x20workspace\x20app\x20profile','\x20workspace\x20','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','string','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','format','3qcEYbi','\x20workspace\x20use\x20--app\x20<name>`.','apiDir','defaultApp','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','apps','workspace','Workspace\x20','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','1883198PYyQbA','Missing\x20workspace\x20app\x20selector.','appcode','updated','project','globalConfig','use','\x22\x20not\x20found.','env','defaultFormat','number','locale','4444276wOitnY','str','13467136NheTxA','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','14432481OGqNxq','\x20--app\x20','length','object','flag','initialized','riskLevel','write','app','App\x20\x22','Switch\x20the\x20current\x20workspace\x20app\x20binding','pageSize','trim','1365144fxnXgP','1239235pUrqpm','Use\x20`',').\x20Config:\x20','1754452LsKFdz','keys','validation','Target\x20environment','\x20--appcode\x20<code>`.','30qtbvSJ','init','.\x20Credentials:\x20not\x20written.','join','Initialize\x20the\x20current\x20workspace\x20app\x20binding','isArray','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','workspace.'];a192_0x3724=function(){return _0x1c76d8;};return a192_0x3724();}const WORKSPACE_USAGE=CLI_BIN_NAME+a192_0x1ac181(0xc6),SAFE_PROFILE_KEYS=['appcode',a192_0x1ac181(0xdd),'apiDir',a192_0x1ac181(0xcb),a192_0x1ac181(0xf0),a192_0x1ac181(0xeb),a192_0x1ac181(0xe0)],workspaceFlags=[{'name':a192_0x1ac181(0xed),'type':a192_0x1ac181(0xc8),'description':a192_0x1ac181(0xc2)},{'name':a192_0x1ac181(0xd7),'type':'string','description':a192_0x1ac181(0xca)},{'name':a192_0x1ac181(0xdd),'type':a192_0x1ac181(0xc8),'description':a192_0x1ac181(0xba),'enum':[...RABETBASE_ENV_VALUES]},{'name':a192_0x1ac181(0xce),'type':a192_0x1ac181(0xc8),'description':a192_0x1ac181(0xd4)},{'name':a192_0x1ac181(0xde),'type':a192_0x1ac181(0xc8),'description':a192_0x1ac181(0xc7),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a192_0x1ac181(0xf0),'type':a192_0x1ac181(0xdf),'description':a192_0x1ac181(0xe4)},{'name':a192_0x1ac181(0xeb),'type':a192_0x1ac181(0xc8),'description':'Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RISK_LEVEL_VALUES]},{'name':a192_0x1ac181(0xe0),'type':'string','description':a192_0x1ac181(0xc4)}];function isRecord(_0x340c77){const _0x359db9=a192_0x1ac181;return!!_0x340c77&&typeof _0x340c77===_0x359db9(0xe8)&&!Array[_0x359db9(0xc1)](_0x340c77);}function assertValidAppcode(_0xf116f1){const {valid:_0x24011a,message:_0x249658}=validateAppcode(_0xf116f1);if(!_0x24011a)throw CliErrors['validation']('Invalid\x20appcode:\x20'+_0xf116f1,_0x249658);}function sanitizeProfile(_0x354295){if(!isRecord(_0x354295))return{};const _0x2f7e73={};for(const _0x40f45b of SAFE_PROFILE_KEYS){if(_0x354295[_0x40f45b]!==undefined)_0x2f7e73[_0x40f45b]=_0x354295[_0x40f45b];}return _0x2f7e73;}function cloneProfile(_0xd07997){return isRecord(_0xd07997)?{..._0xd07997}:{};}function collectWorkspaceProfileOverrides(_0x48973d){const _0x14030e=a192_0x1ac181,_0x32d06d={},_0x2a3448=_0x48973d[_0x14030e(0xe2)](_0x14030e(0xdd)),_0xd2918=_0x48973d[_0x14030e(0xe2)](_0x14030e(0xce)),_0x490783=_0x48973d['str']('defaultFormat'),_0x1dbc0c=_0x48973d[_0x14030e(0xe9)]('pageSize'),_0x399086=_0x48973d[_0x14030e(0xe2)](_0x14030e(0xeb)),_0x48f086=_0x48973d[_0x14030e(0xe2)](_0x14030e(0xe0));if(_0x2a3448)_0x32d06d['env']=_0x2a3448;if(_0xd2918)_0x32d06d['apiDir']=_0xd2918;if(_0x490783)_0x32d06d[_0x14030e(0xcb)]=_0x490783;if(_0x1dbc0c!==undefined&&_0x1dbc0c!=='')_0x32d06d[_0x14030e(0xf0)]=Number(_0x1dbc0c);if(_0x399086)_0x32d06d[_0x14030e(0xeb)]=_0x399086;if(_0x48f086)_0x32d06d[_0x14030e(0xe0)]=_0x48f086;return _0x32d06d;}async function validateWorkspaceArgs(_0x4fb051){const _0x3b14c2=a192_0x1ac181,_0x48dbd1=_0x4fb051[_0x3b14c2(0xe2)](_0x3b14c2(0xed))[_0x3b14c2(0xf1)](),_0x32cfd9=_0x4fb051['str'](_0x3b14c2(0xd7))[_0x3b14c2(0xf1)]();if(!_0x48dbd1&&!_0x32cfd9)throw CliErrors[_0x3b14c2(0xb9)](_0x3b14c2(0xd6),_0x3b14c2(0xf4)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x3b14c2(0xcd));if(_0x32cfd9)assertValidAppcode(_0x32cfd9);}function resolveKnownApps(){const _0x2e2afc=a192_0x1ac181,{config:_0x4089aa,layers:_0x7b5c90}=readRawConfigWithLayers(),_0x3bc892=isRecord(_0x4089aa[_0x2e2afc(0xd1)])?_0x4089aa[_0x2e2afc(0xd1)]:{},_0x5e4732=isRecord(_0x7b5c90[_0x2e2afc(0xda)][_0x2e2afc(0xd1)])?_0x7b5c90[_0x2e2afc(0xda)][_0x2e2afc(0xd1)]:{};return{..._0x5e4732,..._0x3bc892};}async function configureWorkspace(_0x207925,_0x53b0f3){const _0x5b5d3a=a192_0x1ac181,_0x2b34ff=_0x207925[_0x5b5d3a(0xe2)](_0x5b5d3a(0xed))[_0x5b5d3a(0xf1)](),_0x81804f=_0x207925[_0x5b5d3a(0xe2)]('appcode')[_0x5b5d3a(0xf1)](),_0x3f272a=_0x2b34ff||_0x81804f;if(!_0x3f272a)throw CliErrors[_0x5b5d3a(0xb9)]('Missing\x20workspace\x20app\x20selector.',_0x5b5d3a(0xf4)+CLI_BIN_NAME+_0x5b5d3a(0xc9)+CLI_BIN_NAME+_0x5b5d3a(0xcd));if(_0x81804f)assertValidAppcode(_0x81804f);const _0xb54aac=resolveWriteConfigPath(_0x5b5d3a(0xd9)),_0x16b395=readConfigFile(_0xb54aac),_0x144ddc=resolveKnownApps(),_0x126a8a=isRecord(_0x16b395[_0x5b5d3a(0xd1)])?{..._0x16b395[_0x5b5d3a(0xd1)]}:{},_0x5e1bf7=cloneProfile(_0x126a8a[_0x3f272a]),_0x4aace9=sanitizeProfile(_0x144ddc[_0x3f272a]),_0x78c289=_0x81804f?{}:_0x4aace9,_0x284c6e=_0x81804f||_0x78c289[_0x5b5d3a(0xd7)];if(!_0x284c6e){const _0x1e726d=Object[_0x5b5d3a(0xb8)](_0x144ddc),_0x5d4521=_0x1e726d[_0x5b5d3a(0xe7)]===0x0?_0x5b5d3a(0xf4)+CLI_BIN_NAME+_0x5b5d3a(0xc5)+_0x53b0f3+_0x5b5d3a(0xe6)+_0x3f272a+_0x5b5d3a(0xbb):_0x5b5d3a(0xd0)+_0x1e726d[_0x5b5d3a(0xbf)](',\x20');throw CliErrors[_0x5b5d3a(0xb9)](_0x5b5d3a(0xee)+_0x3f272a+_0x5b5d3a(0xdc),_0x5d4521);}assertValidAppcode(String(_0x284c6e));const _0x593519={..._0x78c289,..._0x5e1bf7,'appcode':String(_0x284c6e),...collectWorkspaceProfileOverrides(_0x207925)};return _0x126a8a[_0x3f272a]=_0x593519,_0x16b395[_0x5b5d3a(0xd1)]=_0x126a8a,_0x16b395[_0x5b5d3a(0xcf)]=_0x3f272a,delete _0x16b395[_0x5b5d3a(0xd7)],delete _0x16b395[_0x5b5d3a(0xed)],_0x593519['env']&&(_0x16b395['env']=_0x593519[_0x5b5d3a(0xdd)]),writeConfigFile(_0xb54aac,_0x16b395),{'ok':!![],'message':_0x5b5d3a(0xd3)+(_0x53b0f3==='init'?_0x5b5d3a(0xea):_0x5b5d3a(0xd8))+':\x20'+_0x3f272a+'\x20(appcode:\x20'+_0x593519[_0x5b5d3a(0xd7)]+_0x5b5d3a(0xf5)+_0xb54aac+_0x5b5d3a(0xbe),'data':{'operation':_0x5b5d3a(0xc3)+_0x53b0f3,'configPath':_0xb54aac,'app':_0x3f272a,'appcode':_0x593519[_0x5b5d3a(0xd7)],'env':_0x593519[_0x5b5d3a(0xdd)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a192_0x1ac181(0xd2),'command':a192_0x1ac181(0xbd),'description':a192_0x1ac181(0xc0),'risk':a192_0x1ac181(0xec),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x5a588a=>configureWorkspace(_0x5a588a,a192_0x1ac181(0xbd))},workspaceUseDefinition={'service':a192_0x1ac181(0xd2),'command':a192_0x1ac181(0xdb),'description':a192_0x1ac181(0xef),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x2c34fd=>configureWorkspace(_0x2c34fd,a192_0x1ac181(0xdb))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ const a202_0x42b9ff=a202_0x2aa2;(function(_0x2d60d9,_0x33303c){const _0x3136b5=a202_0x2aa2,_0x24748e=_0x2d60d9();while(!![]){try{const _0x4532b8=-parseInt(_0x3136b5(0x154))/0x1*(-parseInt(_0x3136b5(0x15b))/0x2)+-parseInt(_0x3136b5(0x14e))/0x3+parseInt(_0x3136b5(0x14d))/0x4*(-parseInt(_0x3136b5(0x178))/0x5)+parseInt(_0x3136b5(0x165))/0x6+-parseInt(_0x3136b5(0x151))/0x7*(-parseInt(_0x3136b5(0x162))/0x8)+parseInt(_0x3136b5(0x14f))/0x9*(parseInt(_0x3136b5(0x158))/0xa)+parseInt(_0x3136b5(0x171))/0xb;if(_0x4532b8===_0x33303c)break;else _0x24748e['push'](_0x24748e['shift']());}catch(_0x2d08db){_0x24748e['push'](_0x24748e['shift']());}}}(a202_0x2194,0x94528));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';function a202_0x2aa2(_0x12d0d,_0x261a74){_0x12d0d=_0x12d0d-0x14d;const _0x219498=a202_0x2194();let _0x2aa2e5=_0x219498[_0x12d0d];return _0x2aa2e5;}import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';function a202_0x2194(){const _0x47c494=['defaultFormat','riskLevel','748AXltKi','2744130XoHqFB','9vXpobA','isArray','14XxmWQY','Use\x20`','appcode','4831JItjKB','app','length','Locale\x20for\x20this\x20workspace\x20app\x20profile','2670510SXnXrD','workspace.','\x20(appcode:\x20','58TarKSh','object','env','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','\x20workspace\x20use\x20--app\x20<name>`.','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','pageSize','2902696hRrUeG','Target\x20environment','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','3270888RelSWS','updated','trim','init','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','.\x20Credentials:\x20not\x20written.','defaultApp','number','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','str','Invalid\x20appcode:\x20','apiDir','350097gZuXdT','Missing\x20workspace\x20app\x20selector.','string','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','format','write','Switch\x20the\x20current\x20workspace\x20app\x20binding','5015yslVVY','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','keys','project','\x20workspace\x20','use','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','workspace','Initialize\x20the\x20current\x20workspace\x20app\x20binding','\x20--appcode\x20<code>`.','apps','locale','validation','join',').\x20Config:\x20'];a202_0x2194=function(){return _0x47c494;};return a202_0x2194();}import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a202_0x42b9ff(0x164),SAFE_PROFILE_KEYS=[a202_0x42b9ff(0x153),a202_0x42b9ff(0x15d),a202_0x42b9ff(0x170),a202_0x42b9ff(0x175),'pageSize',a202_0x42b9ff(0x188),a202_0x42b9ff(0x183)],workspaceFlags=[{'name':a202_0x42b9ff(0x155),'type':a202_0x42b9ff(0x173),'description':a202_0x42b9ff(0x160)},{'name':a202_0x42b9ff(0x153),'type':'string','description':a202_0x42b9ff(0x15e)},{'name':a202_0x42b9ff(0x15d),'type':a202_0x42b9ff(0x173),'description':a202_0x42b9ff(0x163),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':a202_0x42b9ff(0x173),'description':a202_0x42b9ff(0x174)},{'name':'defaultFormat','type':'string','description':'Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a202_0x42b9ff(0x161),'type':a202_0x42b9ff(0x16c),'description':a202_0x42b9ff(0x16d)},{'name':a202_0x42b9ff(0x188),'type':a202_0x42b9ff(0x173),'description':a202_0x42b9ff(0x179),'enum':[...RISK_LEVEL_VALUES]},{'name':a202_0x42b9ff(0x183),'type':a202_0x42b9ff(0x173),'description':a202_0x42b9ff(0x157)}];function isRecord(_0x327c59){const _0x52ffa6=a202_0x42b9ff;return!!_0x327c59&&typeof _0x327c59===_0x52ffa6(0x15c)&&!Array[_0x52ffa6(0x150)](_0x327c59);}function assertValidAppcode(_0x4c827c){const _0x14ee63=a202_0x42b9ff,{valid:_0x396525,message:_0x198f8f}=validateAppcode(_0x4c827c);if(!_0x396525)throw CliErrors['validation'](_0x14ee63(0x16f)+_0x4c827c,_0x198f8f);}function sanitizeProfile(_0x20b882){if(!isRecord(_0x20b882))return{};const _0x2dac5e={};for(const _0x544bfe of SAFE_PROFILE_KEYS){if(_0x20b882[_0x544bfe]!==undefined)_0x2dac5e[_0x544bfe]=_0x20b882[_0x544bfe];}return _0x2dac5e;}function cloneProfile(_0x51ea62){return isRecord(_0x51ea62)?{..._0x51ea62}:{};}function collectWorkspaceProfileOverrides(_0x50206f){const _0x2255f9=a202_0x42b9ff,_0x338956={},_0x4719ba=_0x50206f[_0x2255f9(0x16e)]('env'),_0x1ebb1b=_0x50206f['str'](_0x2255f9(0x170)),_0x441de8=_0x50206f[_0x2255f9(0x16e)](_0x2255f9(0x187)),_0x35d28b=_0x50206f['flag']('pageSize'),_0x2df464=_0x50206f['str']('riskLevel'),_0x1ffb7c=_0x50206f['str'](_0x2255f9(0x183));if(_0x4719ba)_0x338956[_0x2255f9(0x15d)]=_0x4719ba;if(_0x1ebb1b)_0x338956['apiDir']=_0x1ebb1b;if(_0x441de8)_0x338956[_0x2255f9(0x175)]=_0x441de8;if(_0x35d28b!==undefined&&_0x35d28b!=='')_0x338956[_0x2255f9(0x161)]=Number(_0x35d28b);if(_0x2df464)_0x338956['riskLevel']=_0x2df464;if(_0x1ffb7c)_0x338956['locale']=_0x1ffb7c;return _0x338956;}async function validateWorkspaceArgs(_0x46cd13){const _0x313361=a202_0x42b9ff,_0x2371c0=_0x46cd13[_0x313361(0x16e)](_0x313361(0x155))[_0x313361(0x167)](),_0xe304d8=_0x46cd13[_0x313361(0x16e)](_0x313361(0x153))[_0x313361(0x167)]();if(!_0x2371c0&&!_0xe304d8)throw CliErrors[_0x313361(0x184)](_0x313361(0x172),_0x313361(0x152)+CLI_BIN_NAME+_0x313361(0x17e)+CLI_BIN_NAME+_0x313361(0x15f));if(_0xe304d8)assertValidAppcode(_0xe304d8);}function resolveKnownApps(){const _0x4911b5=a202_0x42b9ff,{config:_0x2da54b,layers:_0x1a00b4}=readRawConfigWithLayers(),_0x4b7fe1=isRecord(_0x2da54b['apps'])?_0x2da54b[_0x4911b5(0x182)]:{},_0x28f3bc=isRecord(_0x1a00b4['globalConfig'][_0x4911b5(0x182)])?_0x1a00b4['globalConfig'][_0x4911b5(0x182)]:{};return{..._0x28f3bc,..._0x4b7fe1};}async function configureWorkspace(_0x1921ca,_0x366514){const _0x5a98e3=a202_0x42b9ff,_0x528e52=_0x1921ca[_0x5a98e3(0x16e)](_0x5a98e3(0x155))[_0x5a98e3(0x167)](),_0x45b096=_0x1921ca[_0x5a98e3(0x16e)](_0x5a98e3(0x153))['trim'](),_0x25828d=_0x528e52||_0x45b096;if(!_0x25828d)throw CliErrors[_0x5a98e3(0x184)](_0x5a98e3(0x172),_0x5a98e3(0x152)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x5a98e3(0x15f));if(_0x45b096)assertValidAppcode(_0x45b096);const _0x405e72=resolveWriteConfigPath(_0x5a98e3(0x17b)),_0x3876e7=readConfigFile(_0x405e72),_0x3d0898=resolveKnownApps(),_0x3744f0=isRecord(_0x3876e7[_0x5a98e3(0x182)])?{..._0x3876e7[_0x5a98e3(0x182)]}:{},_0x497070=cloneProfile(_0x3744f0[_0x25828d]),_0xd71ef=sanitizeProfile(_0x3d0898[_0x25828d]),_0x4369ae=_0x45b096?{}:_0xd71ef,_0x11fa8=_0x45b096||_0x4369ae['appcode'];if(!_0x11fa8){const _0x22c1da=Object[_0x5a98e3(0x17a)](_0x3d0898),_0x2b2a5a=_0x22c1da[_0x5a98e3(0x156)]===0x0?_0x5a98e3(0x152)+CLI_BIN_NAME+_0x5a98e3(0x17c)+_0x366514+'\x20--app\x20'+_0x25828d+_0x5a98e3(0x181):_0x5a98e3(0x169)+_0x22c1da[_0x5a98e3(0x185)](',\x20');throw CliErrors[_0x5a98e3(0x184)]('App\x20\x22'+_0x25828d+'\x22\x20not\x20found.',_0x2b2a5a);}assertValidAppcode(String(_0x11fa8));const _0x27c34f={..._0x4369ae,..._0x497070,'appcode':String(_0x11fa8),...collectWorkspaceProfileOverrides(_0x1921ca)};return _0x3744f0[_0x25828d]=_0x27c34f,_0x3876e7['apps']=_0x3744f0,_0x3876e7[_0x5a98e3(0x16b)]=_0x25828d,delete _0x3876e7[_0x5a98e3(0x153)],delete _0x3876e7[_0x5a98e3(0x155)],_0x27c34f[_0x5a98e3(0x15d)]&&(_0x3876e7['env']=_0x27c34f[_0x5a98e3(0x15d)]),writeConfigFile(_0x405e72,_0x3876e7),{'ok':!![],'message':'Workspace\x20'+(_0x366514==='init'?'initialized':_0x5a98e3(0x166))+':\x20'+_0x25828d+_0x5a98e3(0x15a)+_0x27c34f[_0x5a98e3(0x153)]+_0x5a98e3(0x186)+_0x405e72+_0x5a98e3(0x16a),'data':{'operation':_0x5a98e3(0x159)+_0x366514,'configPath':_0x405e72,'app':_0x25828d,'appcode':_0x27c34f['appcode'],'env':_0x27c34f['env']??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a202_0x42b9ff(0x17f),'command':'init','description':a202_0x42b9ff(0x180),'risk':a202_0x42b9ff(0x176),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x1f2742=>configureWorkspace(_0x1f2742,a202_0x42b9ff(0x168))},workspaceUseDefinition={'service':a202_0x42b9ff(0x17f),'command':a202_0x42b9ff(0x17d),'description':a202_0x42b9ff(0x177),'risk':a202_0x42b9ff(0x176),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x51a655=>configureWorkspace(_0x51a655,a202_0x42b9ff(0x17d))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- const a193_0x5eabdf=a193_0x475b;function a193_0x8e2f(){const _0x4f4a9b=['8PhYwvA','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','7ccMvIQ','name','App\x20profile\x20name\x20to\x20remove','714762xJWEnp','workspace','709364ikAHgI','183172sYzDJM','write','3225WxHTge','8630862wshRJq','1347827ZDXDyd','8516PDlWob','5423499HWUnoS','workspace\x20remove','1910zLFVba'];a193_0x8e2f=function(){return _0x4f4a9b;};return a193_0x8e2f();}(function(_0x169ba1,_0x26352d){const _0x22a8d6=a193_0x475b,_0x5ca0d7=_0x169ba1();while(!![]){try{const _0x16f1b2=parseInt(_0x22a8d6(0x13a))/0x1+-parseInt(_0x22a8d6(0x135))/0x2+parseInt(_0x22a8d6(0x133))/0x3+-parseInt(_0x22a8d6(0x13b))/0x4*(parseInt(_0x22a8d6(0x138))/0x5)+parseInt(_0x22a8d6(0x139))/0x6*(-parseInt(_0x22a8d6(0x141))/0x7)+-parseInt(_0x22a8d6(0x13f))/0x8*(parseInt(_0x22a8d6(0x13c))/0x9)+parseInt(_0x22a8d6(0x13e))/0xa*(parseInt(_0x22a8d6(0x136))/0xb);if(_0x16f1b2===_0x26352d)break;else _0x5ca0d7['push'](_0x5ca0d7['shift']());}catch(_0xb1f032){_0x5ca0d7['push'](_0x5ca0d7['shift']());}}}(a193_0x8e2f,0xf3906));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a193_0x475b(_0x3f487,_0x239014){_0x3f487=_0x3f487-0x132;const _0x8e2f9f=a193_0x8e2f();let _0x475b71=_0x8e2f9f[_0x3f487];return _0x475b71;}export const workspaceRemoveDefinition={'service':a193_0x5eabdf(0x134),'command':'remove','description':a193_0x5eabdf(0x140),'risk':a193_0x5eabdf(0x137),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a193_0x5eabdf(0x142),'description':a193_0x5eabdf(0x132),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x440713=>validateAppName(_0x440713,a193_0x5eabdf(0x13d)),'execute':_0x4de346=>runAppRemove(_0x4de346,a193_0x5eabdf(0x13d))};
1
+ function a203_0x37e7(_0x290563,_0x4246f4){_0x290563=_0x290563-0x1b1;const _0x353400=a203_0x3534();let _0x37e7d7=_0x353400[_0x290563];return _0x37e7d7;}const a203_0x1906a0=a203_0x37e7;(function(_0x15f76f,_0x1d69a2){const _0x5ca57e=a203_0x37e7,_0x594d58=_0x15f76f();while(!![]){try{const _0x5d1fd6=parseInt(_0x5ca57e(0x1b9))/0x1+parseInt(_0x5ca57e(0x1ba))/0x2+-parseInt(_0x5ca57e(0x1bc))/0x3+parseInt(_0x5ca57e(0x1b5))/0x4+parseInt(_0x5ca57e(0x1bb))/0x5+-parseInt(_0x5ca57e(0x1bd))/0x6+-parseInt(_0x5ca57e(0x1be))/0x7;if(_0x5d1fd6===_0x1d69a2)break;else _0x594d58['push'](_0x594d58['shift']());}catch(_0x3a83c3){_0x594d58['push'](_0x594d58['shift']());}}}(a203_0x3534,0xd04cb));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a203_0x1906a0(0x1b4),'command':a203_0x1906a0(0x1b1),'description':a203_0x1906a0(0x1b2),'risk':a203_0x1906a0(0x1b8),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a203_0x1906a0(0x1b7),'description':a203_0x1906a0(0x1b6),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0xf20f1a=>validateAppName(_0xf20f1a,a203_0x1906a0(0x1b3)),'execute':_0x3dd91d=>runAppRemove(_0x3dd91d,a203_0x1906a0(0x1b3))};function a203_0x3534(){const _0x4048f8=['workspace\x20remove','workspace','4001168fwRCpa','App\x20profile\x20name\x20to\x20remove','name','write','1373632Qzuxnm','46926LmpzYc','4095165sqCqKG','5009688pphJUS','2693076mPwiCd','1711381fjLngf','remove','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)'];a203_0x3534=function(){return _0x4048f8;};return a203_0x3534();}