@lovrabet/rabetbase-cli 2.4.3 → 2.4.4-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 (381) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/members-list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app-config/delete.js +1 -1
  25. package/lib/commands/app-config/get.js +1 -1
  26. package/lib/commands/app-config/index.js +1 -1
  27. package/lib/commands/app-config/list.js +1 -1
  28. package/lib/commands/app-config/set.js +1 -1
  29. package/lib/commands/app-config/shared.js +1 -1
  30. package/lib/commands/auth/index.js +1 -1
  31. package/lib/commands/bff/create.js +1 -1
  32. package/lib/commands/bff/delete.js +1 -1
  33. package/lib/commands/bff/detail.js +1 -1
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/bff/list.js +1 -1
  36. package/lib/commands/bff/pull.js +1 -1
  37. package/lib/commands/bff/push.js +1 -1
  38. package/lib/commands/bff/status.js +1 -1
  39. package/lib/commands/cli-skill/index.js +1 -1
  40. package/lib/commands/cli-update.js +1 -1
  41. package/lib/commands/codegen/index.js +1 -1
  42. package/lib/commands/codegen/sdk.js +1 -1
  43. package/lib/commands/codegen/sql.js +1 -1
  44. package/lib/commands/common/app-registry.js +1 -1
  45. package/lib/commands/common/app-selector.js +1 -1
  46. package/lib/commands/common/async-task.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff-refresh-start.d.ts +2 -0
  87. package/lib/commands/db/diff-refresh-start.js +1 -0
  88. package/lib/commands/db/diff-refresh-status.d.ts +2 -0
  89. package/lib/commands/db/diff-refresh-status.js +1 -0
  90. package/lib/commands/db/diff.js +1 -1
  91. package/lib/commands/db/index.js +1 -1
  92. package/lib/commands/db/list.js +1 -1
  93. package/lib/commands/db/shared.js +1 -1
  94. package/lib/commands/db/tables.js +1 -1
  95. package/lib/commands/db/test.js +1 -1
  96. package/lib/commands/db/update.js +1 -1
  97. package/lib/commands/doctor.js +1 -1
  98. package/lib/commands/file/index.js +1 -1
  99. package/lib/commands/init/index.js +1 -1
  100. package/lib/commands/issue/index.js +1 -1
  101. package/lib/commands/issue/nudge.js +1 -1
  102. package/lib/commands/issue/report.js +1 -1
  103. package/lib/commands/issue/shared.js +1 -1
  104. package/lib/commands/kb/create.js +1 -1
  105. package/lib/commands/kb/delete.js +1 -1
  106. package/lib/commands/kb/detail.js +1 -1
  107. package/lib/commands/kb/index.js +1 -1
  108. package/lib/commands/kb/list.js +1 -1
  109. package/lib/commands/kb/shared.js +1 -1
  110. package/lib/commands/kb/update.js +1 -1
  111. package/lib/commands/logs/index.js +1 -1
  112. package/lib/commands/menu/asset-update.js +1 -1
  113. package/lib/commands/menu/delete.js +1 -1
  114. package/lib/commands/menu/external-link-create.js +1 -1
  115. package/lib/commands/menu/external-link-update.js +1 -1
  116. package/lib/commands/menu/group-create.js +1 -1
  117. package/lib/commands/menu/group-update.js +1 -1
  118. package/lib/commands/menu/index.js +1 -1
  119. package/lib/commands/menu/list.js +1 -1
  120. package/lib/commands/menu/move.js +1 -1
  121. package/lib/commands/menu/regroup-start.js +1 -1
  122. package/lib/commands/menu/rename.js +1 -1
  123. package/lib/commands/menu/shared/compare-table.js +1 -1
  124. package/lib/commands/menu/shared/delete-plan.js +1 -1
  125. package/lib/commands/menu/shared/facts.js +1 -1
  126. package/lib/commands/menu/shared/index.js +1 -1
  127. package/lib/commands/menu/shared/inquirer.js +1 -1
  128. package/lib/commands/menu/shared/local-pages.js +1 -1
  129. package/lib/commands/menu/shared/logic.js +1 -1
  130. package/lib/commands/menu/shared/mutations.js +1 -1
  131. package/lib/commands/menu/shared/service.js +1 -1
  132. package/lib/commands/menu/shared/sync-core.js +1 -1
  133. package/lib/commands/menu/shared/update-core.js +1 -1
  134. package/lib/commands/menu/shared/valid-url.js +1 -1
  135. package/lib/commands/menu/sync.js +1 -1
  136. package/lib/commands/notification/config-create.d.ts +2 -0
  137. package/lib/commands/notification/config-create.js +1 -0
  138. package/lib/commands/notification/config-delete.d.ts +2 -0
  139. package/lib/commands/notification/config-delete.js +1 -0
  140. package/lib/commands/notification/config-list.js +1 -1
  141. package/lib/commands/notification/config-update.d.ts +2 -0
  142. package/lib/commands/notification/config-update.js +1 -0
  143. package/lib/commands/notification/index.js +1 -1
  144. package/lib/commands/notification/shared.d.ts +97 -0
  145. package/lib/commands/notification/shared.js +1 -0
  146. package/lib/commands/ocr/index.js +1 -1
  147. package/lib/commands/page/generate-start.js +1 -1
  148. package/lib/commands/page/generate-status.js +1 -1
  149. package/lib/commands/page/index.js +1 -1
  150. package/lib/commands/page/pull.js +1 -1
  151. package/lib/commands/page/push.js +1 -1
  152. package/lib/commands/page/react/create.js +1 -1
  153. package/lib/commands/page/react/detail.js +1 -1
  154. package/lib/commands/page/react/list.js +1 -1
  155. package/lib/commands/page/react/publish.js +1 -1
  156. package/lib/commands/page/react/shared.js +1 -1
  157. package/lib/commands/page/react/syntax.js +1 -1
  158. package/lib/commands/page/react/template.js +1 -1
  159. package/lib/commands/page/react/update.js +1 -1
  160. package/lib/commands/page/relation-audit.js +1 -1
  161. package/lib/commands/page/restore.js +1 -1
  162. package/lib/commands/page/shared.js +1 -1
  163. package/lib/commands/page/standard-page-status.js +1 -1
  164. package/lib/commands/page/sync.js +1 -1
  165. package/lib/commands/permit/index.js +1 -1
  166. package/lib/commands/permit/page-get.js +1 -1
  167. package/lib/commands/permit/page-set.js +1 -1
  168. package/lib/commands/permit/role-apis-set.js +1 -1
  169. package/lib/commands/permit/role-menus-set.js +1 -1
  170. package/lib/commands/permit/role-menus.js +1 -1
  171. package/lib/commands/permit/shared.js +1 -1
  172. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  173. package/lib/commands/project/create/format-elapsed.js +1 -1
  174. package/lib/commands/project/create/main.d.ts +1 -0
  175. package/lib/commands/project/create/main.js +1 -1
  176. package/lib/commands/project/create/materialize-project-template.d.ts +11 -0
  177. package/lib/commands/project/create/materialize-project-template.js +1 -0
  178. package/lib/commands/project/create/project-name.d.ts +2 -0
  179. package/lib/commands/project/create/project-name.js +1 -0
  180. package/lib/commands/project/create/project-template-archive.d.ts +6 -0
  181. package/lib/commands/project/create/project-template-archive.js +1 -0
  182. package/lib/commands/project/create/project-template-path.d.ts +1 -3
  183. package/lib/commands/project/create/project-template-path.js +1 -1
  184. package/lib/commands/project/create/use-copy-project-template.d.ts +2 -1
  185. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  186. package/lib/commands/project/create/use-format-code.js +1 -1
  187. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  188. package/lib/commands/project/index.js +1 -1
  189. package/lib/commands/project/upgrade.js +1 -1
  190. package/lib/commands/registry.js +1 -1
  191. package/lib/commands/role/create.js +1 -1
  192. package/lib/commands/role/delete.js +1 -1
  193. package/lib/commands/role/detail.js +1 -1
  194. package/lib/commands/role/index.js +1 -1
  195. package/lib/commands/role/list.js +1 -1
  196. package/lib/commands/role/shared.js +1 -1
  197. package/lib/commands/role/update.js +1 -1
  198. package/lib/commands/role/user-add.js +1 -1
  199. package/lib/commands/role/user-remove.js +1 -1
  200. package/lib/commands/role/user-resolve.js +1 -1
  201. package/lib/commands/run/index.js +1 -1
  202. package/lib/commands/schema.js +1 -1
  203. package/lib/commands/sql/create.js +1 -1
  204. package/lib/commands/sql/delete.js +1 -1
  205. package/lib/commands/sql/detail.js +1 -1
  206. package/lib/commands/sql/exec.js +1 -1
  207. package/lib/commands/sql/index.js +1 -1
  208. package/lib/commands/sql/list.js +1 -1
  209. package/lib/commands/sql/pull.js +1 -1
  210. package/lib/commands/sql/push.js +1 -1
  211. package/lib/commands/sql/shared.js +1 -1
  212. package/lib/commands/sql/status.js +1 -1
  213. package/lib/commands/sql/validate.js +1 -1
  214. package/lib/commands/task/index.js +1 -1
  215. package/lib/commands/task/status.js +1 -1
  216. package/lib/commands/tenant/index.js +1 -1
  217. package/lib/commands/tenant/members-list.js +1 -1
  218. package/lib/commands/tenant/shared.js +1 -1
  219. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  220. package/lib/commands/user-account/index.js +1 -1
  221. package/lib/commands/workspace/add.js +1 -1
  222. package/lib/commands/workspace/index.js +1 -1
  223. package/lib/commands/workspace/remove.js +1 -1
  224. package/lib/config/schema.js +1 -1
  225. package/lib/constant/cdn.d.ts +2 -0
  226. package/lib/constant/cdn.js +1 -1
  227. package/lib/constant/cli.js +1 -1
  228. package/lib/constant/defaults.js +1 -1
  229. package/lib/constant/domain.js +1 -1
  230. package/lib/constant/env.js +1 -1
  231. package/lib/constant/output.js +1 -1
  232. package/lib/constant/paths.js +1 -1
  233. package/lib/constant/risk.js +1 -1
  234. package/lib/context/app-resolver.js +1 -1
  235. package/lib/context/auth-resolver.js +1 -1
  236. package/lib/context/config-loader.js +1 -1
  237. package/lib/context.d.ts +1 -1
  238. package/lib/context.js +1 -1
  239. package/lib/core/alias-resolver.js +1 -1
  240. package/lib/core/api-client.d.ts +29 -2
  241. package/lib/core/api-client.js +1 -1
  242. package/lib/core/bff/config.js +1 -1
  243. package/lib/core/bff/file-system.js +1 -1
  244. package/lib/core/bff/hash.js +1 -1
  245. package/lib/core/bff/lock.js +1 -1
  246. package/lib/core/bff/utils.js +1 -1
  247. package/lib/core/db-resolver.js +1 -1
  248. package/lib/core/page/file-system.js +1 -1
  249. package/lib/core/page/hash.js +1 -1
  250. package/lib/core/page/lock.js +1 -1
  251. package/lib/core/sql-index-auditor.js +1 -1
  252. package/lib/core/sql-sync/config.js +1 -1
  253. package/lib/core/sql-sync/file-system.js +1 -1
  254. package/lib/core/sql-sync/hash.js +1 -1
  255. package/lib/core/sql-sync/lock.js +1 -1
  256. package/lib/core/sql-sync/utils.js +1 -1
  257. package/lib/core/sql-validator.js +1 -1
  258. package/lib/errors.js +1 -1
  259. package/lib/framework/build-all-flags.js +1 -1
  260. package/lib/framework/error-output.js +1 -1
  261. package/lib/framework/explicit-yes.js +1 -1
  262. package/lib/framework/flags.js +1 -1
  263. package/lib/framework/help.js +1 -1
  264. package/lib/framework/index.js +1 -1
  265. package/lib/framework/output.js +1 -1
  266. package/lib/framework/response.js +1 -1
  267. package/lib/framework/runner-alias.js +1 -1
  268. package/lib/framework/runner.js +1 -1
  269. package/lib/framework/schema-export.js +1 -1
  270. package/lib/framework/types.js +1 -1
  271. package/lib/generated/build-info.d.ts +4 -4
  272. package/lib/generated/build-info.js +1 -1
  273. package/lib/help.js +1 -1
  274. package/lib/postinstall.js +1 -1
  275. package/lib/runtime/confirmation.js +1 -1
  276. package/lib/runtime/event.js +1 -1
  277. package/lib/runtime/index.js +1 -1
  278. package/lib/runtime/queue.js +1 -1
  279. package/lib/runtime/resolve.js +1 -1
  280. package/lib/skills/builtin-skill.js +1 -1
  281. package/lib/skills/main.js +1 -1
  282. package/lib/skills/npx-skills-add.js +1 -1
  283. package/lib/skills/skill-presence.js +1 -1
  284. package/lib/telemetry/cli-command-trace.js +1 -1
  285. package/lib/telemetry/cli-help-trace.js +1 -1
  286. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  287. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  288. package/lib/telemetry/send-cli-trace-log.js +1 -1
  289. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  290. package/lib/utils/ai_config.js +1 -1
  291. package/lib/utils/apply-jq-filter.js +1 -1
  292. package/lib/utils/cdn-config.js +1 -1
  293. package/lib/utils/check-sdk-version.js +1 -1
  294. package/lib/utils/cli-version-check.js +1 -1
  295. package/lib/utils/cli-version-policy.d.ts +13 -0
  296. package/lib/utils/cli-version-policy.js +1 -1
  297. package/lib/utils/config.js +1 -1
  298. package/lib/utils/entity-with-id.js +1 -1
  299. package/lib/utils/file-utils.js +1 -1
  300. package/lib/utils/guides-cdn.js +1 -1
  301. package/lib/utils/http-client.js +1 -1
  302. package/lib/utils/is-non-interactive.js +1 -1
  303. package/lib/utils/logger.js +1 -1
  304. package/lib/utils/params.js +1 -1
  305. package/lib/utils/platform.js +1 -1
  306. package/lib/utils/rules-cdn.js +1 -1
  307. package/lib/utils/sleep.js +1 -1
  308. package/lib/utils/template-replacer.js +1 -1
  309. package/lib/utils/update-notice.js +1 -1
  310. package/lib/utils/version.js +1 -1
  311. package/lib/utils/with-active-cookie.js +1 -1
  312. package/lib/utils/write-cli-side-channel.js +1 -1
  313. package/package.json +9 -4
  314. package/skills/rabetbase/SKILL.md +33 -22
  315. package/skills/rabetbase/guides/backend-function.md +5 -3
  316. package/skills/rabetbase/guides/bff-creation-workflow.md +2 -2
  317. package/skills/rabetbase/guides/conflict-detection.md +2 -2
  318. package/skills/rabetbase/guides/database-connection-workflow.md +39 -5
  319. package/skills/rabetbase/guides/react-custom-page-workflow.md +16 -4
  320. package/skills/rabetbase/guides/sql-creation-workflow.md +4 -2
  321. package/skills/rabetbase/guides/sql-mybatis.md +2 -2
  322. package/skills/rabetbase/knowledge/page-schema/YtPage.md +3 -37
  323. package/skills/rabetbase/knowledge/react-page/generation-standards.md +14 -3
  324. package/skills/rabetbase/references/rabetbase-app-config.md +2 -2
  325. package/skills/rabetbase/references/rabetbase-bff-push.md +4 -5
  326. package/skills/rabetbase/references/rabetbase-bff-save.md +3 -3
  327. package/skills/rabetbase/references/rabetbase-config.md +2 -2
  328. package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -2
  329. package/skills/rabetbase/references/rabetbase-db-detail.md +3 -0
  330. package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +53 -0
  331. package/skills/rabetbase/references/rabetbase-db-diff.md +40 -21
  332. package/skills/rabetbase/references/rabetbase-db-list.md +1 -1
  333. package/skills/rabetbase/references/rabetbase-kb.md +5 -3
  334. package/skills/rabetbase/references/rabetbase-menu-asset-update.md +9 -10
  335. package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +1 -3
  336. package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +2 -3
  337. package/skills/rabetbase/references/rabetbase-notification-config-list.md +2 -2
  338. package/skills/rabetbase/references/rabetbase-notification-config-mutations.md +56 -0
  339. package/skills/rabetbase/references/rabetbase-page-react-detail.md +1 -1
  340. package/skills/rabetbase/references/rabetbase-page-react-list.md +1 -1
  341. package/skills/rabetbase/references/rabetbase-page-react-publish.md +2 -2
  342. package/skills/rabetbase/references/rabetbase-project-create.md +3 -0
  343. package/skills/rabetbase/references/rabetbase-run.md +1 -1
  344. package/skills/rabetbase/references/rabetbase-sql-create.md +1 -1
  345. package/skills/rabetbase/references/rabetbase-sql-push.md +3 -4
  346. package/skills/rabetbase/references/rabetbase-user-account.md +0 -1
  347. package/skills/rabetbase.manifest.json +5 -5
  348. package/templates/README.md +14 -2
  349. package/lib/commands/project/create/non-interactive.d.ts +0 -9
  350. package/lib/commands/project/create/non-interactive.js +0 -1
  351. package/lib/utils/copy-directory.d.ts +0 -1
  352. package/lib/utils/copy-directory.js +0 -1
  353. package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +0 -291
  354. package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +0 -223
  355. package/templates/projects/sub-app-react-demo/.prettierrc +0 -1
  356. package/templates/projects/sub-app-react-demo/CHANGELOG.md +0 -67
  357. package/templates/projects/sub-app-react-demo/README.md +0 -246
  358. package/templates/projects/sub-app-react-demo/docs/quick-start.md +0 -245
  359. package/templates/projects/sub-app-react-demo/index.html +0 -27
  360. package/templates/projects/sub-app-react-demo/package.json +0 -34
  361. package/templates/projects/sub-app-react-demo/public/logo.svg +0 -1
  362. package/templates/projects/sub-app-react-demo/public/vite.svg +0 -1
  363. package/templates/projects/sub-app-react-demo/src/api/api.ts +0 -26
  364. package/templates/projects/sub-app-react-demo/src/api/client.ts +0 -32
  365. package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +0 -28
  366. package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +0 -55
  367. package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +0 -308
  368. package/templates/projects/sub-app-react-demo/src/main.tsx +0 -52
  369. package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +0 -570
  370. package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +0 -531
  371. package/templates/projects/sub-app-react-demo/src/pages/index.module.css +0 -500
  372. package/templates/projects/sub-app-react-demo/src/pages/index.tsx +0 -641
  373. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +0 -536
  374. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +0 -295
  375. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +0 -242
  376. package/templates/projects/sub-app-react-demo/src/router/index.tsx +0 -30
  377. package/templates/projects/sub-app-react-demo/src/style.css +0 -108
  378. package/templates/projects/sub-app-react-demo/src/utils/api.ts +0 -12
  379. package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +0 -2
  380. package/templates/projects/sub-app-react-demo/tsconfig.json +0 -26
  381. package/templates/projects/sub-app-react-demo/vite.config.ts +0 -111
@@ -1 +1 @@
1
- function a220_0x50c6(_0x476a61,_0x22bdd1){_0x476a61=_0x476a61-0x1b3;const _0x53d8a1=a220_0x53d8();let _0x50c6af=_0x53d8a1[_0x476a61];return _0x50c6af;}const a220_0x568311=a220_0x50c6;(function(_0x4bd178,_0x54cf63){const _0x10669d=a220_0x50c6,_0x1629fc=_0x4bd178();while(!![]){try{const _0x4e6e5a=-parseInt(_0x10669d(0x1d4))/0x1+parseInt(_0x10669d(0x1c0))/0x2*(parseInt(_0x10669d(0x1c3))/0x3)+-parseInt(_0x10669d(0x1d2))/0x4+-parseInt(_0x10669d(0x1d7))/0x5*(-parseInt(_0x10669d(0x1d1))/0x6)+parseInt(_0x10669d(0x1c1))/0x7*(-parseInt(_0x10669d(0x1c5))/0x8)+parseInt(_0x10669d(0x1b6))/0x9*(parseInt(_0x10669d(0x1c6))/0xa)+-parseInt(_0x10669d(0x1c7))/0xb*(-parseInt(_0x10669d(0x1c4))/0xc);if(_0x4e6e5a===_0x54cf63)break;else _0x1629fc['push'](_0x1629fc['shift']());}catch(_0x4d78fa){_0x1629fc['push'](_0x1629fc['shift']());}}}(a220_0x53d8,0xb640d));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=['COMMON',a220_0x568311(0x1b7),'HOOK'];export function normalizeBffType(_0x3105b0){const _0x45313e=a220_0x568311;if(!_0x3105b0)return undefined;const _0x59e2f3=_0x3105b0['trim']()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x45313e(0x1b5)](_0x59e2f3)?_0x59e2f3:undefined;}async function scanJsFilesRecursively(_0x1defe3,_0x1d07f0){const _0x368a36=a220_0x568311,_0x2b2329=[];try{const _0x141010=await readdir(_0x1defe3,{'withFileTypes':!![]});for(const _0x9f87bc of _0x141010){const _0x91e8b6=join(_0x1defe3,_0x9f87bc[_0x368a36(0x1d0)]);if(_0x9f87bc[_0x368a36(0x1bb)]())_0x2b2329[_0x368a36(0x1cc)](...await scanJsFilesRecursively(_0x91e8b6,_0x1d07f0+'/'+_0x9f87bc['name']));else _0x9f87bc[_0x368a36(0x1ce)]()&&_0x9f87bc[_0x368a36(0x1d0)][_0x368a36(0x1b8)](_0x368a36(0x1ca))&&_0x2b2329[_0x368a36(0x1cc)]({'lockKey':_0x1d07f0+'/'+_0x9f87bc[_0x368a36(0x1d0)][_0x368a36(0x1c9)](/\.js$/,''),'filePath':_0x91e8b6});}}catch(_0x155da4){if(_0x155da4['code']!==_0x368a36(0x1d3))throw _0x155da4;}return _0x2b2329;}async function scanFlatFunctions(_0x497168,_0x2bf7a5){const _0x112c10=a220_0x568311,_0x145642=join(_0x497168['scriptsRootDir'],_0x2bf7a5),_0x295b1b=await scanJsFilesRecursively(_0x145642,_0x2bf7a5);return _0x295b1b[_0x112c10(0x1bc)](({lockKey:_0x5cd13c,filePath:_0x1bbb97})=>({'type':_0x2bf7a5,'name':_0x5cd13c['split']('/')['at'](-0x1)??'','filePath':_0x1bbb97,'lockKey':_0x5cd13c}));}async function scanHookFunctions(_0x16eb9a){const _0x440934=a220_0x568311,_0x44057b=join(_0x16eb9a['scriptsRootDir'],_0x440934(0x1d6)),_0x1511b5=[];try{const _0x381ef8=await readdir(_0x44057b,{'withFileTypes':!![]});for(const _0x2c6240 of _0x381ef8){if(!_0x2c6240['isDirectory']())continue;const _0x455a5c=_0x2c6240[_0x440934(0x1d0)],_0x3c58c5=join(_0x44057b,_0x455a5c),_0x53ecfb=await readdir(_0x3c58c5,{'withFileTypes':!![]});for(const _0x11008d of _0x53ecfb){if(!_0x11008d[_0x440934(0x1bb)]())continue;const _0x15fea5=_0x11008d[_0x440934(0x1d0)],_0x3c2e7e=join(_0x3c58c5,_0x15fea5),_0x16f858=await readdir(_0x3c2e7e,{'withFileTypes':!![]});for(const _0x26fb83 of _0x16f858){if(!_0x26fb83[_0x440934(0x1bb)]())continue;const _0x4ded89=_0x26fb83[_0x440934(0x1d0)],_0x569d6e=join(_0x3c2e7e,_0x4ded89),_0x2a97df=await readdir(_0x569d6e,{'withFileTypes':!![]});for(const _0x1fcb7f of _0x2a97df){if(!_0x1fcb7f[_0x440934(0x1ce)]()||!_0x1fcb7f['name'][_0x440934(0x1b8)](_0x440934(0x1ca)))continue;const _0x1b618f=_0x1fcb7f[_0x440934(0x1d0)][_0x440934(0x1c9)](/\.js$/,'');_0x1511b5[_0x440934(0x1cc)]({'type':_0x440934(0x1d6),'name':_0x1b618f,'filePath':join(_0x569d6e,_0x1fcb7f[_0x440934(0x1d0)]),'lockKey':'HOOK/'+_0x455a5c+'/'+_0x15fea5+'/'+_0x4ded89+'/'+_0x1b618f,'alias':_0x455a5c,'operationType':_0x15fea5,'functionNode':_0x4ded89});}}}}}catch(_0x4b5af8){if(_0x4b5af8['code']!==_0x440934(0x1d3))throw _0x4b5af8;}return _0x1511b5;}export async function scanLocalBffFunctions(_0x53a6c0,_0x36d26c){const _0x2a4591=a220_0x568311;if(_0x36d26c===_0x2a4591(0x1d8)||_0x36d26c==='ENDPOINT')return scanFlatFunctions(_0x53a6c0,_0x36d26c);if(_0x36d26c===_0x2a4591(0x1d6))return scanHookFunctions(_0x53a6c0);const [_0x59280f,_0x5d3f21,_0x2cbd77]=await Promise['all']([scanFlatFunctions(_0x53a6c0,_0x2a4591(0x1d8)),scanFlatFunctions(_0x53a6c0,_0x2a4591(0x1b7)),scanHookFunctions(_0x53a6c0)]);return[..._0x59280f,..._0x5d3f21,..._0x2cbd77];}export function resolveLocalFilePathFromLockKey(_0x24bc5e,_0x47cd5d){const _0x5e631d=a220_0x568311;return join(_0x24bc5e[_0x5e631d(0x1cb)],..._0x47cd5d[_0x5e631d(0x1c2)]('/'))+_0x5e631d(0x1ca);}function a220_0x53d8(){const _0x36172d=['6151870OfrQjR','11mBIcXB','datasetCode','replace','.js','scriptsRootDir','push','set','isFile','HOOK/','name','1679082HUhMHa','4621992OFWdfn','ENOENT','605408ijHPEM','beforeScriptId','HOOK','5dwBrjU','COMMON','functionName','operationType','get','includes','18ocftFJ','ENDPOINT','endsWith','before','afterScriptId','isDirectory','map','scriptType','alias','after','224174klfMxs','5726BssIZk','split','36Lqyvjr','11246736fRMoNb','12568mEGGUR'];a220_0x53d8=function(){return _0x36172d;};return a220_0x53d8();}export function createHookLocationMap(_0x5a7d3f){const _0x39c5fa=a220_0x568311,_0x352327=new Map();for(const _0xc1aa67 of _0x5a7d3f){_0xc1aa67[_0x39c5fa(0x1d5)]&&_0x352327[_0x39c5fa(0x1cd)](_0xc1aa67[_0x39c5fa(0x1d5)],{'datasetCode':_0xc1aa67[_0x39c5fa(0x1c8)],'operationType':snakeToCamel(_0xc1aa67[_0x39c5fa(0x1b3)]),'functionNode':_0x39c5fa(0x1b9)}),_0xc1aa67[_0x39c5fa(0x1ba)]&&_0x352327['set'](_0xc1aa67['afterScriptId'],{'datasetCode':_0xc1aa67[_0x39c5fa(0x1c8)],'operationType':snakeToCamel(_0xc1aa67['operationType']),'functionNode':_0x39c5fa(0x1bf)});}return _0x352327;}export function resolveRemoteScriptTarget(_0x9ea03c,_0x4c44c7,_0x1fc0ef,_0x46ebac,_0x2857c2){const _0x320dc6=a220_0x568311,_0x5de8d6=normalizeBffType(_0x4c44c7[_0x320dc6(0x1bd)]);if(!_0x5de8d6||!_0x4c44c7['functionName'])return null;if(_0x5de8d6===_0x320dc6(0x1d6)){const _0x2309a8=(_0x4c44c7['id']?_0x1fc0ef[_0x320dc6(0x1b4)](_0x4c44c7['id']):undefined)??findHookLocationByRemoteId(_0x46ebac,_0x4c44c7['id']);if(!_0x2309a8)return null;const _0xf60a8c=_0x2309a8[_0x320dc6(0x1be)]||_0x2857c2[_0x320dc6(0x1b4)](_0x2309a8[_0x320dc6(0x1c8)]),_0x10934a=_0xf60a8c??_0x2309a8[_0x320dc6(0x1c8)],_0x35fb56={..._0x2309a8,'alias':_0xf60a8c},_0x31cf5e=_0x320dc6(0x1cf)+_0x10934a+'/'+_0x35fb56[_0x320dc6(0x1b3)]+'/'+_0x35fb56['functionNode']+'/'+_0x4c44c7[_0x320dc6(0x1d9)];return{'lockKey':_0x31cf5e,'filePath':resolveLocalFilePathFromLockKey(_0x9ea03c,_0x31cf5e),'type':_0x320dc6(0x1d6),'hookLocation':_0x35fb56};}const _0x362423=_0x5de8d6+'/'+_0x4c44c7[_0x320dc6(0x1d9)];return{'lockKey':_0x362423,'filePath':resolveLocalFilePathFromLockKey(_0x9ea03c,_0x362423),'type':_0x5de8d6};}export async function ensureParentDirectory(_0x2123e6){await mkdir(dirname(_0x2123e6),{'recursive':!![]});}export async function fileExists(_0x78273f){try{return await access(_0x78273f,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x2a9a06){const _0x3146b1=a220_0x568311;try{const _0x23adee=await stat(_0x2a9a06);return _0x23adee[_0x3146b1(0x1bb)]();}catch{return![];}}
1
+ const a228_0x3dc8a8=a228_0x290c;(function(_0x5378e5,_0xecff00){const _0x2cd8e6=a228_0x290c,_0x2f0f13=_0x5378e5();while(!![]){try{const _0x388a40=parseInt(_0x2cd8e6(0xff))/0x1+parseInt(_0x2cd8e6(0xf5))/0x2*(-parseInt(_0x2cd8e6(0xef))/0x3)+-parseInt(_0x2cd8e6(0xfc))/0x4*(parseInt(_0x2cd8e6(0xfb))/0x5)+parseInt(_0x2cd8e6(0xee))/0x6*(parseInt(_0x2cd8e6(0x109))/0x7)+parseInt(_0x2cd8e6(0x107))/0x8*(-parseInt(_0x2cd8e6(0x105))/0x9)+-parseInt(_0x2cd8e6(0xe8))/0xa+parseInt(_0x2cd8e6(0xf0))/0xb;if(_0x388a40===_0xecff00)break;else _0x2f0f13['push'](_0x2f0f13['shift']());}catch(_0x50bb77){_0x2f0f13['push'](_0x2f0f13['shift']());}}}(a228_0x1cf9,0x216e8));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a228_0x3dc8a8(0xf4),'ENDPOINT',a228_0x3dc8a8(0xf6)];export function normalizeBffType(_0x548de2){const _0x4d86b0=a228_0x3dc8a8;if(!_0x548de2)return undefined;const _0x59a07b=_0x548de2[_0x4d86b0(0xfd)]()[_0x4d86b0(0xf1)]();return SUPPORTED_BFF_TYPES[_0x4d86b0(0x10a)](_0x59a07b)?_0x59a07b:undefined;}async function scanJsFilesRecursively(_0x43b457,_0x353e20){const _0x49a5d3=a228_0x3dc8a8,_0x14e36f=[];try{const _0x4f8f69=await readdir(_0x43b457,{'withFileTypes':!![]});for(const _0x1639f0 of _0x4f8f69){const _0x3fda06=join(_0x43b457,_0x1639f0[_0x49a5d3(0xf8)]);if(_0x1639f0[_0x49a5d3(0xfa)]())_0x14e36f[_0x49a5d3(0xfe)](...await scanJsFilesRecursively(_0x3fda06,_0x353e20+'/'+_0x1639f0[_0x49a5d3(0xf8)]));else _0x1639f0[_0x49a5d3(0xe4)]()&&_0x1639f0[_0x49a5d3(0xf8)][_0x49a5d3(0xec)](_0x49a5d3(0x102))&&_0x14e36f[_0x49a5d3(0xfe)]({'lockKey':_0x353e20+'/'+_0x1639f0['name'][_0x49a5d3(0xf2)](/\.js$/,''),'filePath':_0x3fda06});}}catch(_0x490d84){if(_0x490d84[_0x49a5d3(0x108)]!==_0x49a5d3(0x103))throw _0x490d84;}return _0x14e36f;}async function scanFlatFunctions(_0x231082,_0x47af42){const _0x468e6c=a228_0x3dc8a8,_0x3afc72=join(_0x231082['scriptsRootDir'],_0x47af42),_0x4e996a=await scanJsFilesRecursively(_0x3afc72,_0x47af42);return _0x4e996a[_0x468e6c(0xe6)](({lockKey:_0x7e3f07,filePath:_0x28f939})=>({'type':_0x47af42,'name':_0x7e3f07[_0x468e6c(0x100)]('/')['at'](-0x1)??'','filePath':_0x28f939,'lockKey':_0x7e3f07}));}async function scanHookFunctions(_0x1cebdd){const _0x37c96f=a228_0x3dc8a8,_0x2a65fd=join(_0x1cebdd[_0x37c96f(0xe9)],_0x37c96f(0xf6)),_0x597ff0=[];try{const _0x41a57c=await readdir(_0x2a65fd,{'withFileTypes':!![]});for(const _0x445e5b of _0x41a57c){if(!_0x445e5b[_0x37c96f(0xfa)]())continue;const _0x1e1395=_0x445e5b['name'],_0x20d558=join(_0x2a65fd,_0x1e1395),_0x1aa461=await readdir(_0x20d558,{'withFileTypes':!![]});for(const _0x3f31a2 of _0x1aa461){if(!_0x3f31a2[_0x37c96f(0xfa)]())continue;const _0x3bffb=_0x3f31a2['name'],_0x150bbe=join(_0x20d558,_0x3bffb),_0x48aa88=await readdir(_0x150bbe,{'withFileTypes':!![]});for(const _0x3eb54 of _0x48aa88){if(!_0x3eb54[_0x37c96f(0xfa)]())continue;const _0x2bae62=_0x3eb54['name'],_0x24c43f=join(_0x150bbe,_0x2bae62),_0x686248=await readdir(_0x24c43f,{'withFileTypes':!![]});for(const _0x428209 of _0x686248){if(!_0x428209[_0x37c96f(0xe4)]()||!_0x428209[_0x37c96f(0xf8)][_0x37c96f(0xec)]('.js'))continue;const _0x8b68f3=_0x428209[_0x37c96f(0xf8)][_0x37c96f(0xf2)](/\.js$/,'');_0x597ff0[_0x37c96f(0xfe)]({'type':_0x37c96f(0xf6),'name':_0x8b68f3,'filePath':join(_0x24c43f,_0x428209['name']),'lockKey':_0x37c96f(0xf3)+_0x1e1395+'/'+_0x3bffb+'/'+_0x2bae62+'/'+_0x8b68f3,'alias':_0x1e1395,'operationType':_0x3bffb,'functionNode':_0x2bae62});}}}}}catch(_0x23d8b9){if(_0x23d8b9['code']!==_0x37c96f(0x103))throw _0x23d8b9;}return _0x597ff0;}export async function scanLocalBffFunctions(_0xd07c,_0x5eb8f8){const _0x473ef9=a228_0x3dc8a8;if(_0x5eb8f8===_0x473ef9(0xf4)||_0x5eb8f8==='ENDPOINT')return scanFlatFunctions(_0xd07c,_0x5eb8f8);if(_0x5eb8f8===_0x473ef9(0xf6))return scanHookFunctions(_0xd07c);const [_0x3195ce,_0x38a168,_0x395d3b]=await Promise[_0x473ef9(0xed)]([scanFlatFunctions(_0xd07c,_0x473ef9(0xf4)),scanFlatFunctions(_0xd07c,_0x473ef9(0xf9)),scanHookFunctions(_0xd07c)]);return[..._0x3195ce,..._0x38a168,..._0x395d3b];}export function resolveLocalFilePathFromLockKey(_0x1fade9,_0x11c15a){const _0x1508fe=a228_0x3dc8a8;return join(_0x1fade9[_0x1508fe(0xe9)],..._0x11c15a[_0x1508fe(0x100)]('/'))+_0x1508fe(0x102);}export function createHookLocationMap(_0x39019e){const _0x42b01d=a228_0x3dc8a8,_0x1958b8=new Map();for(const _0x10ffc9 of _0x39019e){_0x10ffc9[_0x42b01d(0xea)]&&_0x1958b8[_0x42b01d(0xe5)](_0x10ffc9[_0x42b01d(0xea)],{'datasetCode':_0x10ffc9['datasetCode'],'operationType':snakeToCamel(_0x10ffc9[_0x42b01d(0x106)]),'functionNode':_0x42b01d(0x101)}),_0x10ffc9[_0x42b01d(0x10c)]&&_0x1958b8[_0x42b01d(0xe5)](_0x10ffc9[_0x42b01d(0x10c)],{'datasetCode':_0x10ffc9[_0x42b01d(0xe7)],'operationType':snakeToCamel(_0x10ffc9[_0x42b01d(0x106)]),'functionNode':_0x42b01d(0x104)});}return _0x1958b8;}export function resolveRemoteScriptTarget(_0x106e4f,_0x597d18,_0x2a7669,_0x530418,_0x42b5b0){const _0x313fa0=a228_0x3dc8a8,_0x498f35=normalizeBffType(_0x597d18['scriptType']);if(!_0x498f35||!_0x597d18[_0x313fa0(0xe3)])return null;if(_0x498f35===_0x313fa0(0xf6)){const _0x215084=(_0x597d18['id']?_0x2a7669[_0x313fa0(0xeb)](_0x597d18['id']):undefined)??findHookLocationByRemoteId(_0x530418,_0x597d18['id']);if(!_0x215084)return null;const _0x474b7c=_0x215084[_0x313fa0(0xf7)]||_0x42b5b0[_0x313fa0(0xeb)](_0x215084['datasetCode']),_0x365e5b=_0x474b7c??_0x215084['datasetCode'],_0xab4dfd={..._0x215084,'alias':_0x474b7c},_0xe348da=_0x313fa0(0xf3)+_0x365e5b+'/'+_0xab4dfd[_0x313fa0(0x106)]+'/'+_0xab4dfd['functionNode']+'/'+_0x597d18[_0x313fa0(0xe3)];return{'lockKey':_0xe348da,'filePath':resolveLocalFilePathFromLockKey(_0x106e4f,_0xe348da),'type':_0x313fa0(0xf6),'hookLocation':_0xab4dfd};}const _0x547264=_0x498f35+'/'+_0x597d18[_0x313fa0(0xe3)];return{'lockKey':_0x547264,'filePath':resolveLocalFilePathFromLockKey(_0x106e4f,_0x547264),'type':_0x498f35};}function a228_0x1cf9(){const _0x450ccb=['before','.js','ENOENT','after','139131GQfaMR','operationType','32jfWqPS','code','1708qlrgyT','includes','F_OK','afterScriptId','functionName','isFile','set','map','datasetCode','1699380trKOXE','scriptsRootDir','beforeScriptId','get','endsWith','all','276BpBZnI','39801LqZRFl','4010424KApEpq','toUpperCase','replace','HOOK/','COMMON','26rYRspt','HOOK','alias','name','ENDPOINT','isDirectory','10hTodmZ','35344TqGWFr','trim','push','183045TkoSop','split'];a228_0x1cf9=function(){return _0x450ccb;};return a228_0x1cf9();}function a228_0x290c(_0x3d868d,_0x586303){_0x3d868d=_0x3d868d-0xe3;const _0x1cf9fb=a228_0x1cf9();let _0x290c37=_0x1cf9fb[_0x3d868d];return _0x290c37;}export async function ensureParentDirectory(_0x3fb2b4){await mkdir(dirname(_0x3fb2b4),{'recursive':!![]});}export async function fileExists(_0xac80b5){const _0x1e9957=a228_0x3dc8a8;try{return await access(_0xac80b5,constants[_0x1e9957(0x10b)]),!![];}catch{return![];}}export async function directoryExists(_0x50ae34){const _0x581abf=a228_0x3dc8a8;try{const _0x4692d0=await stat(_0x50ae34);return _0x4692d0[_0x581abf(0xfa)]();}catch{return![];}}
@@ -1 +1 @@
1
- function a221_0x5317(){const _0x5dd2f7=['md5','39708sfgrpe','hex','3070GdJmeg','35781bDGnRP','83578hevYXK','update','57pMSAzx','68696mTprNW','4511350OADcWM','459bsBqKv','166264oygpJf','42924DtDvDl','1246IlGrro','digest','utf8','createHash'];a221_0x5317=function(){return _0x5dd2f7;};return a221_0x5317();}(function(_0x42e190,_0xbdbfc3){const _0x12478c=a221_0x3589,_0x43ae22=_0x42e190();while(!![]){try{const _0x331d9d=-parseInt(_0x12478c(0x1b7))/0x1+parseInt(_0x12478c(0x1b4))/0x2+parseInt(_0x12478c(0x1ba))/0x3*(-parseInt(_0x12478c(0x1bb))/0x4)+-parseInt(_0x12478c(0x1bc))/0x5+-parseInt(_0x12478c(0x1bf))/0x6*(parseInt(_0x12478c(0x1c0))/0x7)+parseInt(_0x12478c(0x1be))/0x8*(parseInt(_0x12478c(0x1bd))/0x9)+parseInt(_0x12478c(0x1b6))/0xa*(parseInt(_0x12478c(0x1b8))/0xb);if(_0x331d9d===_0xbdbfc3)break;else _0x43ae22['push'](_0x43ae22['shift']());}catch(_0xbfb765){_0x43ae22['push'](_0x43ae22['shift']());}}}(a221_0x5317,0xd586c));import{readFile}from'node:fs/promises';function a221_0x3589(_0x5ca624,_0x4890c2){_0x5ca624=_0x5ca624-0x1b2;const _0x53176c=a221_0x5317();let _0x3589fc=_0x53176c[_0x5ca624];return _0x3589fc;}import a221_0x1ee7f3 from'node:crypto';export function computeContentHash(_0x2e87be){const _0x4ff4cf=a221_0x3589;return a221_0x1ee7f3[_0x4ff4cf(0x1b2)](_0x4ff4cf(0x1b3))[_0x4ff4cf(0x1b9)](_0x2e87be)[_0x4ff4cf(0x1c1)](_0x4ff4cf(0x1b5));}export async function computeFileHash(_0x236dc9){const _0x46bc2a=a221_0x3589,_0x5a3a81=await readFile(_0x236dc9,_0x46bc2a(0x1c2));return computeContentHash(_0x5a3a81);}
1
+ function a229_0x3ee4(_0x1a077f,_0x327ac6){_0x1a077f=_0x1a077f-0x15a;const _0x483969=a229_0x4839();let _0x3ee48b=_0x483969[_0x1a077f];return _0x3ee48b;}(function(_0x4dae3f,_0x2ad933){const _0x509069=a229_0x3ee4,_0x218e88=_0x4dae3f();while(!![]){try{const _0x54ced0=parseInt(_0x509069(0x162))/0x1*(-parseInt(_0x509069(0x161))/0x2)+parseInt(_0x509069(0x15b))/0x3*(parseInt(_0x509069(0x169))/0x4)+-parseInt(_0x509069(0x15e))/0x5+-parseInt(_0x509069(0x167))/0x6*(-parseInt(_0x509069(0x168))/0x7)+-parseInt(_0x509069(0x164))/0x8+-parseInt(_0x509069(0x15a))/0x9*(-parseInt(_0x509069(0x15f))/0xa)+-parseInt(_0x509069(0x160))/0xb*(-parseInt(_0x509069(0x165))/0xc);if(_0x54ced0===_0x2ad933)break;else _0x218e88['push'](_0x218e88['shift']());}catch(_0xf1de91){_0x218e88['push'](_0x218e88['shift']());}}}(a229_0x4839,0x5bfa8));import{readFile}from'node:fs/promises';import a229_0x422375 from'node:crypto';function a229_0x4839(){const _0x315307=['30010NffUvs','11Ijwzqr','22TwMbMI','62038CjKCfy','utf8','5829552LNuqTz','16308924IWCWJD','digest','6LpjHLP','5165097CEgNeH','294740ADuwXP','hex','909WXFNQs','3NmpWwb','createHash','md5','3429390OGHeuZ'];a229_0x4839=function(){return _0x315307;};return a229_0x4839();}export function computeContentHash(_0x26f717){const _0x36f550=a229_0x3ee4;return a229_0x422375[_0x36f550(0x15c)](_0x36f550(0x15d))['update'](_0x26f717)[_0x36f550(0x166)](_0x36f550(0x16a));}export async function computeFileHash(_0xa31e0e){const _0x212c7b=a229_0x3ee4,_0x36bd1a=await readFile(_0xa31e0e,_0x212c7b(0x163));return computeContentHash(_0x36bd1a);}
@@ -1 +1 @@
1
- (function(_0x46aaae,_0x908cf7){const _0x1da1e3=a222_0x3c9c,_0x4d3f6b=_0x46aaae();while(!![]){try{const _0x333273=-parseInt(_0x1da1e3(0x153))/0x1+-parseInt(_0x1da1e3(0x15b))/0x2+-parseInt(_0x1da1e3(0x152))/0x3+-parseInt(_0x1da1e3(0x15c))/0x4+parseInt(_0x1da1e3(0x159))/0x5*(parseInt(_0x1da1e3(0x14d))/0x6)+parseInt(_0x1da1e3(0x14c))/0x7+-parseInt(_0x1da1e3(0x15a))/0x8;if(_0x333273===_0x908cf7)break;else _0x4d3f6b['push'](_0x4d3f6b['shift']());}catch(_0x19d433){_0x4d3f6b['push'](_0x4d3f6b['shift']());}}}(a222_0x3b67,0xea741));function a222_0x3c9c(_0x1b5bbb,_0xf1894b){_0x1b5bbb=_0x1b5bbb-0x148;const _0x3b67eb=a222_0x3b67();let _0x3c9ce2=_0x3b67eb[_0x1b5bbb];return _0x3c9ce2;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x5d002f,_0x4fc97f,_0x462a46,_0x4a0241){const _0x5d94c9=a222_0x3c9c,_0x980fa1={'apps':_0x5d002f[_0x5d94c9(0x154)]&&typeof _0x5d002f[_0x5d94c9(0x154)]===_0x5d94c9(0x157)?_0x5d002f[_0x5d94c9(0x154)]:{}};let _0x53f165=_0x980fa1['apps'][_0x4fc97f];if(!_0x53f165)return _0x53f165={'scriptsRoot':_0x462a46,'lastSync':'','functions':{}},_0x980fa1['apps'][_0x4fc97f]=_0x53f165,{'lockData':_0x980fa1,'appLock':_0x53f165};if(!_0x53f165[_0x5d94c9(0x151)])_0x53f165[_0x5d94c9(0x151)]=_0x462a46;else{if(_0x53f165[_0x5d94c9(0x151)]!==_0x462a46)throw new Error(_0x4a0241+_0x5d94c9(0x149)+(_0x5d94c9(0x14a)+_0x462a46+_0x5d94c9(0x158)+_0x53f165['scriptsRoot']+_0x5d94c9(0x14f))+_0x5d94c9(0x155));}return!_0x53f165[_0x5d94c9(0x14b)]&&(_0x53f165[_0x5d94c9(0x14b)]={}),!_0x53f165['lastSync']&&(_0x53f165['lastSync']=''),{'lockData':_0x980fa1,'appLock':_0x53f165};}export async function readBffLockFile(_0x714c4e){const _0x13a20a=a222_0x3c9c;try{const _0x5e84e5=await readFile(_0x714c4e,_0x13a20a(0x150)),_0x51e0a9=JSON['parse'](_0x5e84e5);return{'apps':_0x51e0a9[_0x13a20a(0x154)]&&typeof _0x51e0a9[_0x13a20a(0x154)]===_0x13a20a(0x157)?_0x51e0a9[_0x13a20a(0x154)]:{}};}catch(_0x367fdb){if(_0x367fdb[_0x13a20a(0x156)]===_0x13a20a(0x148))return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x367fdb));}}export async function writeBffLockFile(_0x21881a,_0x199321){const _0x2b40a8=a222_0x3c9c;await mkdir(dirname(_0x21881a),{'recursive':!![]}),await writeFile(_0x21881a,JSON[_0x2b40a8(0x14e)](_0x199321,null,0x2),_0x2b40a8(0x150));}function a222_0x3b67(){const _0x9a0cf=['\x22.\x20','utf8','scriptsRoot','3022680JknUJk','64846IEvBay','apps','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','code','object','\x22\x20vs\x20lock\x20\x22','2005iqCIkZ','4953904EDLpyv','327302DSnrTT','2296392tYleWZ','ENOENT',':\x20scriptsRoot\x20mismatch\x20—\x20','current\x20\x22','functions','12267017vYYQOZ','24498pcFSUB','stringify'];a222_0x3b67=function(){return _0x9a0cf;};return a222_0x3b67();}
1
+ function a230_0xee29(){const _0x54d6cc=['7dNBhoT','lastSync','ENOENT','8zFdLat','object','806931SKIWxY','stringify','135939IsOSfT','60XRSzck','5ytbMXU','\x22.\x20','utf8','functions','\x22\x20vs\x20lock\x20\x22','parse','6333400Dinuky','99591GJxMzC','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','22776897LbSFsu','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','apps',':\x20scriptsRoot\x20mismatch\x20—\x20','scriptsRoot','current\x20\x22','code','1448754AwmCMW','1189240jOnumU'];a230_0xee29=function(){return _0x54d6cc;};return a230_0xee29();}(function(_0x4e68eb,_0x49dc51){const _0x4d53f7=a230_0x2a5e,_0x2bdd6c=_0x4e68eb();while(!![]){try{const _0x378650=-parseInt(_0x4d53f7(0x175))/0x1+parseInt(_0x4d53f7(0x171))/0x2*(-parseInt(_0x4d53f7(0x163))/0x3)+-parseInt(_0x4d53f7(0x16d))/0x4+-parseInt(_0x4d53f7(0x15c))/0x5*(-parseInt(_0x4d53f7(0x16c))/0x6)+-parseInt(_0x4d53f7(0x16e))/0x7*(parseInt(_0x4d53f7(0x162))/0x8)+parseInt(_0x4d53f7(0x173))/0x9*(-parseInt(_0x4d53f7(0x15b))/0xa)+parseInt(_0x4d53f7(0x165))/0xb;if(_0x378650===_0x49dc51)break;else _0x2bdd6c['push'](_0x2bdd6c['shift']());}catch(_0x4bcfbc){_0x2bdd6c['push'](_0x2bdd6c['shift']());}}}(a230_0xee29,0x65aa4));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}function a230_0x2a5e(_0x1884e0,_0x589bbe){_0x1884e0=_0x1884e0-0x15b;const _0xee29bd=a230_0xee29();let _0x2a5e59=_0xee29bd[_0x1884e0];return _0x2a5e59;}export function ensureLockScope(_0x424dce,_0x58bc21,_0x574859,_0x1e561f){const _0x507bfa=a230_0x2a5e,_0x3deae3={'apps':_0x424dce['apps']&&typeof _0x424dce[_0x507bfa(0x167)]===_0x507bfa(0x172)?_0x424dce[_0x507bfa(0x167)]:{}};let _0x1b47d4=_0x3deae3['apps'][_0x58bc21];if(!_0x1b47d4)return _0x1b47d4={'scriptsRoot':_0x574859,'lastSync':'','functions':{}},_0x3deae3[_0x507bfa(0x167)][_0x58bc21]=_0x1b47d4,{'lockData':_0x3deae3,'appLock':_0x1b47d4};if(!_0x1b47d4[_0x507bfa(0x169)])_0x1b47d4[_0x507bfa(0x169)]=_0x574859;else{if(_0x1b47d4[_0x507bfa(0x169)]!==_0x574859)throw new Error(_0x1e561f+_0x507bfa(0x168)+(_0x507bfa(0x16a)+_0x574859+_0x507bfa(0x160)+_0x1b47d4[_0x507bfa(0x169)]+_0x507bfa(0x15d))+_0x507bfa(0x166));}return!_0x1b47d4[_0x507bfa(0x15f)]&&(_0x1b47d4[_0x507bfa(0x15f)]={}),!_0x1b47d4[_0x507bfa(0x16f)]&&(_0x1b47d4[_0x507bfa(0x16f)]=''),{'lockData':_0x3deae3,'appLock':_0x1b47d4};}export async function readBffLockFile(_0xbe66a0){const _0x1ab6af=a230_0x2a5e;try{const _0x15946b=await readFile(_0xbe66a0,_0x1ab6af(0x15e)),_0x1ed9e2=JSON[_0x1ab6af(0x161)](_0x15946b);return{'apps':_0x1ed9e2['apps']&&typeof _0x1ed9e2[_0x1ab6af(0x167)]===_0x1ab6af(0x172)?_0x1ed9e2[_0x1ab6af(0x167)]:{}};}catch(_0x323e08){if(_0x323e08[_0x1ab6af(0x16b)]===_0x1ab6af(0x170))return null;throw new Error(_0x1ab6af(0x164)+String(_0x323e08));}}export async function writeBffLockFile(_0x22ac67,_0x2ba5b7){const _0x525bb5=a230_0x2a5e;await mkdir(dirname(_0x22ac67),{'recursive':!![]}),await writeFile(_0x22ac67,JSON[_0x525bb5(0x174)](_0x2ba5b7,null,0x2),_0x525bb5(0x15e));}
@@ -1 +1 @@
1
- function a224_0x4387(){const _0xa23845=['74EWgFoa','7330IPlpyN','toUpperCase','12365667cKcBDr','before','2480UeyFDI','values','15619380VZKTAq','remoteId','test','toLowerCase','trim','operationType','2228XsEKDh','replace','8jDaLpV','27eqhhGd','82434eqdxTE','385574vdXLae','448VxHKMi','functionNode','after','15994CoWraT'];a224_0x4387=function(){return _0xa23845;};return a224_0x4387();}(function(_0x1f6d63,_0x2cb2f4){const _0x1aaff1=a224_0x264b,_0x4e4d6c=_0x1f6d63();while(!![]){try{const _0x32e400=parseInt(_0x1aaff1(0x160))/0x1+-parseInt(_0x1aaff1(0x165))/0x2*(-parseInt(_0x1aaff1(0x15e))/0x3)+-parseInt(_0x1aaff1(0x15b))/0x4*(-parseInt(_0x1aaff1(0x166))/0x5)+-parseInt(_0x1aaff1(0x15f))/0x6*(parseInt(_0x1aaff1(0x161))/0x7)+parseInt(_0x1aaff1(0x15d))/0x8*(parseInt(_0x1aaff1(0x168))/0x9)+-parseInt(_0x1aaff1(0x16a))/0xa*(-parseInt(_0x1aaff1(0x164))/0xb)+-parseInt(_0x1aaff1(0x16c))/0xc;if(_0x32e400===_0x2cb2f4)break;else _0x4e4d6c['push'](_0x4e4d6c['shift']());}catch(_0x89495d){_0x4e4d6c['push'](_0x4e4d6c['shift']());}}}(a224_0x4387,0xb8991));function a224_0x264b(_0x2948a9,_0x454d8f){_0x2948a9=_0x2948a9-0x15b;const _0x4387bd=a224_0x4387();let _0x264b71=_0x4387bd[_0x2948a9];return _0x264b71;}export function snakeToCamel(_0x3c658a){const _0x1db74b=a224_0x264b;return _0x3c658a[_0x1db74b(0x16f)]()[_0x1db74b(0x15c)](/_([a-z])/g,(_0x2a3878,_0x1f2ec5)=>_0x1f2ec5[_0x1db74b(0x167)]());}export function findHookLocationByRemoteId(_0x312175,_0x287fe4){const _0x37ed1f=a224_0x264b;if(!_0x287fe4)return undefined;for(const _0x2b86aa of Object[_0x37ed1f(0x16b)](_0x312175)){if(_0x2b86aa[_0x37ed1f(0x16d)]===_0x287fe4&&_0x2b86aa['datasetCode']&&_0x2b86aa[_0x37ed1f(0x171)]&&_0x2b86aa[_0x37ed1f(0x162)])return{'datasetCode':_0x2b86aa['datasetCode'],'operationType':_0x2b86aa[_0x37ed1f(0x171)],'functionNode':_0x2b86aa[_0x37ed1f(0x162)]};}return undefined;}export function extractScriptDescription(_0x3d55af){const _0x30e810=_0x3d55af['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x30e810?.[0x1]?.['trim']()||undefined;}export function isValidBffFunctionName(_0x4a3729){const _0x5185cd=a224_0x264b;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x5185cd(0x16e)](_0x4a3729);}export function normalizeHookFunctionNode(_0x42ff7d){const _0x1ebc2e=a224_0x264b;if(!_0x42ff7d)return undefined;const _0x48ee09=_0x42ff7d[_0x1ebc2e(0x170)]()[_0x1ebc2e(0x16f)]();if(_0x48ee09===_0x1ebc2e(0x169)||_0x48ee09===_0x1ebc2e(0x163))return _0x48ee09;return undefined;}
1
+ function a232_0x3436(){const _0x361b16=['1461KeWAzO','2599443PhccZY','remoteId','functionNode','match','operationType','896950odmFAU','test','before','replace','3928yschFi','913766CSieWD','toLowerCase','60eUlQEj','datasetCode','168haMWDy','after','1335505DtwoQL','84yEORVr','27013JiHLTS','322605hkSEWD'];a232_0x3436=function(){return _0x361b16;};return a232_0x3436();}(function(_0x49cb6b,_0x589ad6){const _0x5bd34c=a232_0x5576,_0x51d6c8=_0x49cb6b();while(!![]){try{const _0x1b2036=parseInt(_0x5bd34c(0x10e))/0x1+-parseInt(_0x5bd34c(0x113))/0x2+-parseInt(_0x5bd34c(0x11d))/0x3*(-parseInt(_0x5bd34c(0x112))/0x4)+parseInt(_0x5bd34c(0x119))/0x5+parseInt(_0x5bd34c(0x11a))/0x6*(-parseInt(_0x5bd34c(0x11b))/0x7)+-parseInt(_0x5bd34c(0x117))/0x8*(-parseInt(_0x5bd34c(0x11c))/0x9)+parseInt(_0x5bd34c(0x115))/0xa*(-parseInt(_0x5bd34c(0x109))/0xb);if(_0x1b2036===_0x589ad6)break;else _0x51d6c8['push'](_0x51d6c8['shift']());}catch(_0x29c083){_0x51d6c8['push'](_0x51d6c8['shift']());}}}(a232_0x3436,0x71d43));export function snakeToCamel(_0x142f7c){const _0x53cc2d=a232_0x5576;return _0x142f7c[_0x53cc2d(0x114)]()[_0x53cc2d(0x111)](/_([a-z])/g,(_0x544da4,_0x336bb0)=>_0x336bb0['toUpperCase']());}export function findHookLocationByRemoteId(_0xfee4cd,_0x215109){const _0x1df46c=a232_0x5576;if(!_0x215109)return undefined;for(const _0x17bbee of Object['values'](_0xfee4cd)){if(_0x17bbee[_0x1df46c(0x10a)]===_0x215109&&_0x17bbee[_0x1df46c(0x116)]&&_0x17bbee[_0x1df46c(0x10d)]&&_0x17bbee[_0x1df46c(0x10b)])return{'datasetCode':_0x17bbee[_0x1df46c(0x116)],'operationType':_0x17bbee[_0x1df46c(0x10d)],'functionNode':_0x17bbee['functionNode']};}return undefined;}function a232_0x5576(_0x1ed5b2,_0x3bbe16){_0x1ed5b2=_0x1ed5b2-0x109;const _0x343623=a232_0x3436();let _0x5576d4=_0x343623[_0x1ed5b2];return _0x5576d4;}export function extractScriptDescription(_0x573753){const _0x39625d=a232_0x5576,_0x5e7812=_0x573753[_0x39625d(0x10c)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x5e7812?.[0x1]?.['trim']()||undefined;}export function isValidBffFunctionName(_0x417383){const _0x36cde6=a232_0x5576;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x36cde6(0x10f)](_0x417383);}export function normalizeHookFunctionNode(_0x2d8571){const _0x1c0e14=a232_0x5576;if(!_0x2d8571)return undefined;const _0x554177=_0x2d8571['trim']()[_0x1c0e14(0x114)]();if(_0x554177===_0x1c0e14(0x110)||_0x554177===_0x1c0e14(0x118))return _0x554177;return undefined;}
@@ -1 +1 @@
1
- function a225_0x5a44(_0x43f59c,_0x5e1dcc){_0x43f59c=_0x43f59c-0x9a;const _0x3dcbf5=a225_0x3dcb();let _0x5a447e=_0x3dcbf5[_0x43f59c];return _0x5a447e;}(function(_0x4fd6a5,_0x30b9e9){const _0x1bea04=a225_0x5a44,_0x26f6e9=_0x4fd6a5();while(!![]){try{const _0x10bb77=parseInt(_0x1bea04(0xb7))/0x1+-parseInt(_0x1bea04(0xa4))/0x2*(-parseInt(_0x1bea04(0xb0))/0x3)+-parseInt(_0x1bea04(0x9d))/0x4+parseInt(_0x1bea04(0xa0))/0x5+parseInt(_0x1bea04(0x9b))/0x6*(-parseInt(_0x1bea04(0xaf))/0x7)+parseInt(_0x1bea04(0xa2))/0x8+-parseInt(_0x1bea04(0xb5))/0x9;if(_0x10bb77===_0x30b9e9)break;else _0x26f6e9['push'](_0x26f6e9['shift']());}catch(_0x600153){_0x26f6e9['push'](_0x26f6e9['shift']());}}}(a225_0x3dcb,0xecd98));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x2cea55){const _0x283308=a225_0x5a44;if(cache[_0x283308(0xa7)](_0x2cea55))return cache[_0x283308(0x9e)](_0x2cea55);const _0x78bac2=await listDatasets(_0x2cea55),_0x4a95f2=new Map();for(const _0xfb0435 of _0x78bac2){const _0x50c1be=_0xfb0435[_0x283308(0xa9)];_0x50c1be?.['dbId']!=null&&_0x4a95f2['set'](_0x50c1be[_0x283308(0xa8)],_0x50c1be[_0x283308(0x9c)]??_0x283308(0xb1)+_0x50c1be[_0x283308(0xa8)]);}const _0xca0a25=[..._0x4a95f2['entries']()]['map'](([_0x3d2e5e,_0x37ab72])=>({'dbId':_0x3d2e5e,'dbName':_0x37ab72}));return cache['set'](_0x2cea55,_0xca0a25),_0xca0a25;}export async function resolveDb(_0x1b7442,_0x3f6c8a){const _0x4aa4b1=a225_0x5a44,_0x2c9fdf=await listDatabases(_0x1b7442);if(_0x2c9fdf[_0x4aa4b1(0xb2)]===0x0)return{'resolved':[],'error':_0x4aa4b1(0xa6)+_0x1b7442+_0x4aa4b1(0xab)};if(!_0x3f6c8a)return{'resolved':_0x2c9fdf};const _0x187292=Number(_0x3f6c8a);if(!Number[_0x4aa4b1(0xb6)](_0x187292)){const _0x2a7d99=_0x2c9fdf[_0x4aa4b1(0xaa)](_0x340e65=>_0x340e65['dbId']===_0x187292);if(_0x2a7d99)return{'resolved':[_0x2a7d99]};}const _0x5c4568=_0x3f6c8a[_0x4aa4b1(0x9f)](),_0x47309b=_0x2c9fdf['filter'](_0x477a3f=>_0x477a3f[_0x4aa4b1(0x9c)][_0x4aa4b1(0x9f)]()['includes'](_0x5c4568));if(_0x47309b[_0x4aa4b1(0xb2)]>0x0)return{'resolved':_0x47309b};const _0x5056a4=_0x2c9fdf[_0x4aa4b1(0xa3)](_0x273552=>_0x273552[_0x4aa4b1(0x9c)]+'\x20('+_0x273552['dbId']+')')[_0x4aa4b1(0xa1)](',\x20');return{'resolved':[],'error':_0x4aa4b1(0xa5)+_0x3f6c8a+_0x4aa4b1(0xac)+_0x1b7442+_0x4aa4b1(0xb3)+_0x5056a4+_0x4aa4b1(0x9a)};}export async function resolveOneDb(_0x41228f,_0x59365f){const _0x1f2b27=a225_0x5a44,{resolved:_0x4d572f,error:_0x46994a}=await resolveDb(_0x41228f,_0x59365f);if(_0x46994a)return{'db':null,'error':_0x46994a};if(_0x4d572f[_0x1f2b27(0xb2)]===0x1)return{'db':_0x4d572f[0x0]};if(!_0x59365f){const _0x5baff1=_0x4d572f['map'](_0xf7f7ad=>_0xf7f7ad[_0x1f2b27(0x9c)]+'\x20('+_0xf7f7ad[_0x1f2b27(0xa8)]+')')[_0x1f2b27(0xa1)](',\x20');return{'db':null,'error':_0x1f2b27(0xae)+_0x5baff1};}const _0x18802f=_0x4d572f[_0x1f2b27(0xa3)](_0x1034ff=>_0x1034ff[_0x1f2b27(0x9c)]+'\x20('+_0x1034ff[_0x1f2b27(0xa8)]+')')[_0x1f2b27(0xa1)](',\x20');return{'db':null,'error':'\x22'+_0x59365f+_0x1f2b27(0xb4)+_0x18802f+_0x1f2b27(0xad)};}export async function getDbName(_0x470231,_0x2bad8d){const _0x4778b1=a225_0x5a44,_0x573d9b=await listDatabases(_0x470231);return _0x573d9b[_0x4778b1(0xaa)](_0x15bad0=>_0x15bad0[_0x4778b1(0xa8)]===_0x2bad8d)?.['dbName'];}function a225_0x3dcb(){const _0x6cf7df=['has','dbId','dbtableConfig','find','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','\x22\x20under\x20app\x20\x22','.\x20Be\x20more\x20specific.','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','30499UUqXLx','3642BzGdmn','db-','length','\x22.\x20Available:\x20','\x22\x20matches\x20multiple\x20databases:\x20','24584292MmvtyE','isNaN','1403834wWlpYQ','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','1230udWAaE','dbName','7624788yIOFIu','get','toLowerCase','8912575gCmsks','join','11600424fRHiPF','map','3072JIKMJL','No\x20database\x20matching\x20\x22','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22'];a225_0x3dcb=function(){return _0x6cf7df;};return a225_0x3dcb();}
1
+ (function(_0x168fc8,_0x468d74){const _0x4a27a5=a233_0xe59f,_0xbc3801=_0x168fc8();while(!![]){try{const _0x321766=parseInt(_0x4a27a5(0x77))/0x1+parseInt(_0x4a27a5(0x85))/0x2*(-parseInt(_0x4a27a5(0x93))/0x3)+-parseInt(_0x4a27a5(0x91))/0x4*(parseInt(_0x4a27a5(0x75))/0x5)+-parseInt(_0x4a27a5(0x82))/0x6*(parseInt(_0x4a27a5(0x87))/0x7)+parseInt(_0x4a27a5(0x80))/0x8*(-parseInt(_0x4a27a5(0x7f))/0x9)+parseInt(_0x4a27a5(0x76))/0xa*(parseInt(_0x4a27a5(0x94))/0xb)+-parseInt(_0x4a27a5(0x7c))/0xc*(-parseInt(_0x4a27a5(0x95))/0xd);if(_0x321766===_0x468d74)break;else _0xbc3801['push'](_0xbc3801['shift']());}catch(_0x481753){_0xbc3801['push'](_0xbc3801['shift']());}}}(a233_0x3beb,0x7c8c5));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x36460a){const _0x4f843b=a233_0xe59f;if(cache[_0x4f843b(0x86)](_0x36460a))return cache[_0x4f843b(0x8b)](_0x36460a);const _0x1c2e5d=await listDatasets(_0x36460a),_0x5bd2ae=new Map();for(const _0x466ddc of _0x1c2e5d){const _0x9fc71=_0x466ddc['dbtableConfig'];_0x9fc71?.['dbId']!=null&&_0x5bd2ae[_0x4f843b(0x78)](_0x9fc71[_0x4f843b(0x83)],_0x9fc71['dbName']??_0x4f843b(0x90)+_0x9fc71[_0x4f843b(0x83)]);}const _0x4f2914=[..._0x5bd2ae[_0x4f843b(0x79)]()]['map'](([_0x1d584a,_0x176e8e])=>({'dbId':_0x1d584a,'dbName':_0x176e8e}));return cache[_0x4f843b(0x78)](_0x36460a,_0x4f2914),_0x4f2914;}function a233_0x3beb(){const _0x2ff598=['db-','4irjvPB','isNaN','3JzgUVc','11PYBJyl','220883UFqrkS','4801605jREtXd','1747870szlOOs','150234GknpNQ','set','entries','dbName','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','2184nwZOFI','toLowerCase','find','9bBEWCT','4859776LKiIgP','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','799638GTIizz','dbId','includes','1612698yRDXQu','has','28piDisD','map','.\x20Be\x20more\x20specific.','length','get','join','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','\x22\x20matches\x20multiple\x20databases:\x20','\x22.\x20Available:\x20'];a233_0x3beb=function(){return _0x2ff598;};return a233_0x3beb();}export async function resolveDb(_0x4dcd1a,_0x4fa545){const _0x4479de=a233_0xe59f,_0x2f0f90=await listDatabases(_0x4dcd1a);if(_0x2f0f90[_0x4479de(0x8a)]===0x0)return{'resolved':[],'error':_0x4479de(0x7b)+_0x4dcd1a+_0x4479de(0x8d)};if(!_0x4fa545)return{'resolved':_0x2f0f90};const _0x474186=Number(_0x4fa545);if(!Number[_0x4479de(0x92)](_0x474186)){const _0x2a608f=_0x2f0f90[_0x4479de(0x7e)](_0x14d2b4=>_0x14d2b4[_0x4479de(0x83)]===_0x474186);if(_0x2a608f)return{'resolved':[_0x2a608f]};}const _0x471ef1=_0x4fa545[_0x4479de(0x7d)](),_0x19888f=_0x2f0f90['filter'](_0x3c8a37=>_0x3c8a37[_0x4479de(0x7a)][_0x4479de(0x7d)]()[_0x4479de(0x84)](_0x471ef1));if(_0x19888f[_0x4479de(0x8a)]>0x0)return{'resolved':_0x19888f};const _0x46cdd8=_0x2f0f90[_0x4479de(0x88)](_0x232a74=>_0x232a74[_0x4479de(0x7a)]+'\x20('+_0x232a74[_0x4479de(0x83)]+')')[_0x4479de(0x8c)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x4fa545+'\x22\x20under\x20app\x20\x22'+_0x4dcd1a+_0x4479de(0x8f)+_0x46cdd8+_0x4479de(0x81)};}function a233_0xe59f(_0x149e89,_0xcad2a4){_0x149e89=_0x149e89-0x75;const _0x3bebe2=a233_0x3beb();let _0xe59f11=_0x3bebe2[_0x149e89];return _0xe59f11;}export async function resolveOneDb(_0xa45283,_0x5a30a9){const _0x3a5663=a233_0xe59f,{resolved:_0x57ba0d,error:_0x32440a}=await resolveDb(_0xa45283,_0x5a30a9);if(_0x32440a)return{'db':null,'error':_0x32440a};if(_0x57ba0d[_0x3a5663(0x8a)]===0x1)return{'db':_0x57ba0d[0x0]};if(!_0x5a30a9){const _0x2eb1db=_0x57ba0d['map'](_0x223681=>_0x223681[_0x3a5663(0x7a)]+'\x20('+_0x223681[_0x3a5663(0x83)]+')')[_0x3a5663(0x8c)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x2eb1db};}const _0x1b8a99=_0x57ba0d['map'](_0x2548d7=>_0x2548d7[_0x3a5663(0x7a)]+'\x20('+_0x2548d7['dbId']+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x5a30a9+_0x3a5663(0x8e)+_0x1b8a99+_0x3a5663(0x89)};}export async function getDbName(_0xa91b78,_0x21fe4b){const _0x4c9faf=a233_0xe59f,_0x5eafa7=await listDatabases(_0xa91b78);return _0x5eafa7[_0x4c9faf(0x7e)](_0x232917=>_0x232917['dbId']===_0x21fe4b)?.[_0x4c9faf(0x7a)];}
@@ -1 +1 @@
1
- (function(_0x5763ac,_0x1f12a9){const _0x1609fc=a226_0x7d40,_0x13c498=_0x5763ac();while(!![]){try{const _0x4fa370=parseInt(_0x1609fc(0x187))/0x1+parseInt(_0x1609fc(0x182))/0x2+-parseInt(_0x1609fc(0x17e))/0x3*(parseInt(_0x1609fc(0x181))/0x4)+-parseInt(_0x1609fc(0x180))/0x5+-parseInt(_0x1609fc(0x188))/0x6*(-parseInt(_0x1609fc(0x184))/0x7)+parseInt(_0x1609fc(0x17d))/0x8*(-parseInt(_0x1609fc(0x17c))/0x9)+parseInt(_0x1609fc(0x18b))/0xa;if(_0x4fa370===_0x1f12a9)break;else _0x13c498['push'](_0x13c498['shift']());}catch(_0x3aefa1){_0x13c498['push'](_0x13c498['shift']());}}}(a226_0x1d0a,0xe20a6));function a226_0x1d0a(){const _0x112382=['13073336VjNFEq','3000999ldJMMl','toUpperCase','443760kZDtmQ','4sRCeTa','904720wirZvM','appPagesDir','2471ILWYos','.rabetbase','F_OK','1682523NpRAvl','474WovLBG','.json','page.lock.json','14863440KGQTnS','9UWzUjV'];a226_0x1d0a=function(){return _0x112382;};return a226_0x1d0a();}import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';function a226_0x7d40(_0xf706b2,_0x34c681){_0xf706b2=_0xf706b2-0x17c;const _0x1d0a53=a226_0x1d0a();let _0x7d40bd=_0x1d0a53[_0xf706b2];return _0x7d40bd;}import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x1748d3,_0x5b8cef=process['cwd']()){const _0x56a7a7=a226_0x7d40,_0x1709a6=resolve(_0x5b8cef),_0x52b898=join(_0x1709a6,_0x56a7a7(0x185),'page');return{'projectRoot':_0x1709a6,'pagesBaseDir':_0x52b898,'appPagesDir':join(_0x52b898,_0x1748d3),'lockFilePath':join(_0x1709a6,'.rabetbase',_0x56a7a7(0x18a))};}export function buildPageFileName(_0x358556,_0x56a728){const _0x528dec=a226_0x7d40;return _0x358556+'-'+String(_0x56a728)[_0x528dec(0x17f)]()+_0x528dec(0x189);}export function resolvePageFilePath(_0x197ee0,_0x4681de,_0x119752){const _0x2952d0=a226_0x7d40;return join(_0x197ee0[_0x2952d0(0x183)],buildPageFileName(_0x4681de,_0x119752));}export async function ensureParentDirectory(_0x3772a6){await mkdir(dirname(_0x3772a6),{'recursive':!![]});}export async function fileExists(_0xbdaf8){const _0x37977d=a226_0x7d40;try{return await access(_0xbdaf8,constants[_0x37977d(0x186)]),!![];}catch{return![];}}
1
+ const a234_0x9ce6c9=a234_0x3653;function a234_0x3653(_0x6126dd,_0x143d0a){_0x6126dd=_0x6126dd-0x1b4;const _0x573a30=a234_0x573a();let _0x36533a=_0x573a30[_0x6126dd];return _0x36533a;}(function(_0x36f6dd,_0x518cd5){const _0xc02ce2=a234_0x3653,_0x373186=_0x36f6dd();while(!![]){try{const _0x4f524b=parseInt(_0xc02ce2(0x1c3))/0x1*(parseInt(_0xc02ce2(0x1c1))/0x2)+-parseInt(_0xc02ce2(0x1be))/0x3+-parseInt(_0xc02ce2(0x1bb))/0x4*(-parseInt(_0xc02ce2(0x1b4))/0x5)+parseInt(_0xc02ce2(0x1c4))/0x6+-parseInt(_0xc02ce2(0x1c0))/0x7*(-parseInt(_0xc02ce2(0x1bc))/0x8)+-parseInt(_0xc02ce2(0x1b7))/0x9+parseInt(_0xc02ce2(0x1b6))/0xa*(-parseInt(_0xc02ce2(0x1b5))/0xb);if(_0x4f524b===_0x518cd5)break;else _0x373186['push'](_0x373186['shift']());}catch(_0x3f0d66){_0x373186['push'](_0x373186['shift']());}}}(a234_0x573a,0x2f4c1));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x13feb2,_0x1a2eeb=process[a234_0x9ce6c9(0x1bd)]()){const _0x2e21ad=a234_0x9ce6c9,_0x275ebf=resolve(_0x1a2eeb),_0x1774b9=join(_0x275ebf,_0x2e21ad(0x1ba),_0x2e21ad(0x1c2));return{'projectRoot':_0x275ebf,'pagesBaseDir':_0x1774b9,'appPagesDir':join(_0x1774b9,_0x13feb2),'lockFilePath':join(_0x275ebf,'.rabetbase','page.lock.json')};}export function buildPageFileName(_0x3ec4f8,_0x12e4a7){const _0x4c330d=a234_0x9ce6c9;return _0x3ec4f8+'-'+String(_0x12e4a7)[_0x4c330d(0x1bf)]()+'.json';}export function resolvePageFilePath(_0x19e308,_0x237cc1,_0x29d4f6){const _0x4b40ec=a234_0x9ce6c9;return join(_0x19e308[_0x4b40ec(0x1b9)],buildPageFileName(_0x237cc1,_0x29d4f6));}export async function ensureParentDirectory(_0x49fa5d){await mkdir(dirname(_0x49fa5d),{'recursive':!![]});}export async function fileExists(_0x4d6a6e){const _0x3466b3=a234_0x9ce6c9;try{return await access(_0x4d6a6e,constants[_0x3466b3(0x1b8)]),!![];}catch{return![];}}function a234_0x573a(){const _0x5cf4ab=['.rabetbase','960484ywxppb','46856fFakWo','cwd','351060enmhQX','toUpperCase','175fdzxSS','812wgYfcS','page','951uhcfTe','244854TOzHhx','5JcbvGc','22evfrgE','629130PQRXgW','3391974MUTDcr','F_OK','appPagesDir'];a234_0x573a=function(){return _0x5cf4ab;};return a234_0x573a();}
@@ -1 +1 @@
1
- (function(_0x467d2a,_0xfef3cb){const _0x1c02c2=a227_0x10c7,_0x15b478=_0x467d2a();while(!![]){try{const _0x1ccdfd=-parseInt(_0x1c02c2(0x14b))/0x1*(parseInt(_0x1c02c2(0x154))/0x2)+-parseInt(_0x1c02c2(0x152))/0x3+parseInt(_0x1c02c2(0x155))/0x4*(parseInt(_0x1c02c2(0x146))/0x5)+-parseInt(_0x1c02c2(0x14f))/0x6+-parseInt(_0x1c02c2(0x14e))/0x7*(-parseInt(_0x1c02c2(0x153))/0x8)+parseInt(_0x1c02c2(0x149))/0x9*(parseInt(_0x1c02c2(0x14d))/0xa)+parseInt(_0x1c02c2(0x145))/0xb;if(_0x1ccdfd===_0xfef3cb)break;else _0x15b478['push'](_0x15b478['shift']());}catch(_0x2c91ee){_0x15b478['push'](_0x15b478['shift']());}}}(a227_0x301c,0x95982));import a227_0x342e50 from'node:crypto';import{readFile}from'node:fs/promises';function a227_0x10c7(_0x184e39,_0x4bf603){_0x184e39=_0x184e39-0x145;const _0x301ca8=a227_0x301c();let _0x10c7fc=_0x301ca8[_0x184e39];return _0x10c7fc;}export function serializePageSchemaForFile(_0x28e993){const _0x13b641=a227_0x10c7;return JSON[_0x13b641(0x14a)](JSON['parse'](_0x28e993),null,0x2)+'\x0a';}function a227_0x301c(){const _0x377ca5=['40ehAydb','36110LHMEfu','1624144KAqqkq','16557277BbVDff','5KpUPxF','hex','update','23094HBfQAw','stringify','23OdxzRw','createHash','500UdfTPL','225631rCDRTl','1910586NoeINW','digest','utf8','2562822mRklDS'];a227_0x301c=function(){return _0x377ca5;};return a227_0x301c();}export function computePageContentHash(_0x3e40d4){const _0x123240=a227_0x10c7;return a227_0x342e50[_0x123240(0x14c)]('md5')[_0x123240(0x148)](_0x3e40d4)[_0x123240(0x150)](_0x123240(0x147));}export function computeSerializedSchemaHash(_0x2c4104){return computePageContentHash(serializePageSchemaForFile(_0x2c4104));}export async function computePageFileHash(_0xe25573){const _0x10c3e6=a227_0x10c7,_0x2d2ed9=await readFile(_0xe25573,_0x10c3e6(0x151));return computePageContentHash(_0x2d2ed9);}
1
+ (function(_0x3b2a7d,_0x20614a){const _0x21e97a=a235_0x8168,_0x5aea19=_0x3b2a7d();while(!![]){try{const _0x36c139=parseInt(_0x21e97a(0x11d))/0x1*(-parseInt(_0x21e97a(0x126))/0x2)+parseInt(_0x21e97a(0x11f))/0x3*(parseInt(_0x21e97a(0x11c))/0x4)+-parseInt(_0x21e97a(0x11b))/0x5+-parseInt(_0x21e97a(0x124))/0x6+parseInt(_0x21e97a(0x121))/0x7*(-parseInt(_0x21e97a(0x127))/0x8)+parseInt(_0x21e97a(0x11a))/0x9+parseInt(_0x21e97a(0x122))/0xa;if(_0x36c139===_0x20614a)break;else _0x5aea19['push'](_0x5aea19['shift']());}catch(_0x498a71){_0x5aea19['push'](_0x5aea19['shift']());}}}(a235_0x320b,0x821e5));function a235_0x8168(_0x127359,_0x933c13){_0x127359=_0x127359-0x119;const _0x320b92=a235_0x320b();let _0x816838=_0x320b92[_0x127359];return _0x816838;}function a235_0x320b(){const _0x41e58d=['158bZVcyT','64ddTKFy','createHash','6461892tAnctN','83555nBxQZF','3040jNdPfy','5079YiFdAv','hex','288ZflUxj','parse','792372egrxJQ','15433040ObwBQD','update','2866602uPldWM','utf8'];a235_0x320b=function(){return _0x41e58d;};return a235_0x320b();}import a235_0x57a801 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x121606){const _0x2f3a0f=a235_0x8168;return JSON['stringify'](JSON[_0x2f3a0f(0x120)](_0x121606),null,0x2)+'\x0a';}export function computePageContentHash(_0x4ae2e5){const _0xb5b2f8=a235_0x8168;return a235_0x57a801[_0xb5b2f8(0x119)]('md5')[_0xb5b2f8(0x123)](_0x4ae2e5)['digest'](_0xb5b2f8(0x11e));}export function computeSerializedSchemaHash(_0x35e4ef){return computePageContentHash(serializePageSchemaForFile(_0x35e4ef));}export async function computePageFileHash(_0x57a1ca){const _0x3b814c=a235_0x8168,_0x4ca28f=await readFile(_0x57a1ca,_0x3b814c(0x125));return computePageContentHash(_0x4ca28f);}
@@ -1 +1 @@
1
- (function(_0x34e4c2,_0x4fd529){const _0x5aa9ac=a228_0x55f6,_0x48a975=_0x34e4c2();while(!![]){try{const _0x221cfa=-parseInt(_0x5aa9ac(0x12b))/0x1+parseInt(_0x5aa9ac(0x132))/0x2+parseInt(_0x5aa9ac(0x137))/0x3+-parseInt(_0x5aa9ac(0x131))/0x4+parseInt(_0x5aa9ac(0x12c))/0x5+parseInt(_0x5aa9ac(0x135))/0x6+-parseInt(_0x5aa9ac(0x12d))/0x7;if(_0x221cfa===_0x4fd529)break;else _0x48a975['push'](_0x48a975['shift']());}catch(_0x4002ad){_0x48a975['push'](_0x48a975['shift']());}}}(a228_0x2804,0xb063d));import{mkdir,readFile,writeFile}from'node:fs/promises';function a228_0x55f6(_0x3c24cc,_0x3100e5){_0x3c24cc=_0x3c24cc-0x127;const _0x280402=a228_0x2804();let _0x55f602=_0x280402[_0x3c24cc];return _0x55f602;}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x15344b,_0x178ea0){const _0x453dc9=a228_0x55f6,_0x50866f={'apps':_0x15344b[_0x453dc9(0x128)]&&typeof _0x15344b[_0x453dc9(0x128)]==='object'?_0x15344b[_0x453dc9(0x128)]:{}};let _0x3889a0=_0x50866f[_0x453dc9(0x128)][_0x178ea0];if(!_0x3889a0)return _0x3889a0={'lastSync':'','pages':{}},_0x50866f[_0x453dc9(0x128)][_0x178ea0]=_0x3889a0,{'lockData':_0x50866f,'appLock':_0x3889a0};return!_0x3889a0[_0x453dc9(0x127)]&&(_0x3889a0[_0x453dc9(0x127)]=''),(!_0x3889a0['pages']||typeof _0x3889a0[_0x453dc9(0x134)]!=='object')&&(_0x3889a0[_0x453dc9(0x134)]={}),{'lockData':_0x50866f,'appLock':_0x3889a0};}export async function readPageLockFile(_0x7314c1){const _0x451fcf=a228_0x55f6;try{const _0x436133=await readFile(_0x7314c1,'utf8'),_0x5da39a=JSON[_0x451fcf(0x12f)](_0x436133);return{'apps':_0x5da39a[_0x451fcf(0x128)]&&typeof _0x5da39a['apps']===_0x451fcf(0x130)?_0x5da39a[_0x451fcf(0x128)]:{}};}catch(_0x2dd49b){if(_0x2dd49b[_0x451fcf(0x136)]===_0x451fcf(0x12a))return null;throw new Error(_0x451fcf(0x12e)+String(_0x2dd49b));}}function a228_0x2804(){const _0x4d2d74=['2125062ToQQSu','utf8','pages','5772288jKhMff','code','2405736ktveSY','lastSync','apps','stringify','ENOENT','153195PWkNni','6560500WheegU','21240303CYnocd','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','parse','object','914296ZswnTP'];a228_0x2804=function(){return _0x4d2d74;};return a228_0x2804();}export async function writePageLockFile(_0x355c79,_0x2e4ea1){const _0x1afe02=a228_0x55f6;await mkdir(dirname(_0x355c79),{'recursive':!![]}),await writeFile(_0x355c79,JSON[_0x1afe02(0x129)](_0x2e4ea1,null,0x2),_0x1afe02(0x133));}
1
+ (function(_0x4eabce,_0x1f6f39){const _0x7f55e2=a236_0x2129,_0x42a62e=_0x4eabce();while(!![]){try{const _0x498daf=-parseInt(_0x7f55e2(0xf0))/0x1+parseInt(_0x7f55e2(0xf2))/0x2*(parseInt(_0x7f55e2(0xe8))/0x3)+parseInt(_0x7f55e2(0xe5))/0x4*(-parseInt(_0x7f55e2(0xf3))/0x5)+parseInt(_0x7f55e2(0xe7))/0x6*(parseInt(_0x7f55e2(0xec))/0x7)+-parseInt(_0x7f55e2(0xf5))/0x8*(-parseInt(_0x7f55e2(0xe6))/0x9)+parseInt(_0x7f55e2(0xe3))/0xa*(-parseInt(_0x7f55e2(0xe1))/0xb)+-parseInt(_0x7f55e2(0xf1))/0xc*(-parseInt(_0x7f55e2(0xe0))/0xd);if(_0x498daf===_0x1f6f39)break;else _0x42a62e['push'](_0x42a62e['shift']());}catch(_0x5c45b){_0x42a62e['push'](_0x42a62e['shift']());}}}(a236_0xbe36,0x5908d));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a236_0x2129(_0x4406cd,_0x41271d){_0x4406cd=_0x4406cd-0xe0;const _0xbe3681=a236_0xbe36();let _0x212972=_0xbe3681[_0x4406cd];return _0x212972;}export function ensurePageLockScope(_0x32b179,_0x55f074){const _0x12147d=a236_0x2129,_0x14d222={'apps':_0x32b179[_0x12147d(0xf4)]&&typeof _0x32b179[_0x12147d(0xf4)]===_0x12147d(0xef)?_0x32b179['apps']:{}};let _0x4f5247=_0x14d222[_0x12147d(0xf4)][_0x55f074];if(!_0x4f5247)return _0x4f5247={'lastSync':'','pages':{}},_0x14d222[_0x12147d(0xf4)][_0x55f074]=_0x4f5247,{'lockData':_0x14d222,'appLock':_0x4f5247};return!_0x4f5247[_0x12147d(0xeb)]&&(_0x4f5247[_0x12147d(0xeb)]=''),(!_0x4f5247[_0x12147d(0xed)]||typeof _0x4f5247[_0x12147d(0xed)]!==_0x12147d(0xef))&&(_0x4f5247[_0x12147d(0xed)]={}),{'lockData':_0x14d222,'appLock':_0x4f5247};}function a236_0xbe36(){const _0x2a85df=['562475GzsAfb','398832lwLWBX','2fbbPGg','25TXLLei','apps','16216OcdFdf','273racXMk','7777lCbVef','parse','2060qgPfYD','utf8','429016lpnqJQ','2160METjki','78QthTXW','359826ANauZa','code','ENOENT','lastSync','164066Tqhhsn','pages','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','object'];a236_0xbe36=function(){return _0x2a85df;};return a236_0xbe36();}export async function readPageLockFile(_0x2c84e0){const _0x181a9d=a236_0x2129;try{const _0x20fc7c=await readFile(_0x2c84e0,_0x181a9d(0xe4)),_0xeb34a7=JSON[_0x181a9d(0xe2)](_0x20fc7c);return{'apps':_0xeb34a7['apps']&&typeof _0xeb34a7[_0x181a9d(0xf4)]===_0x181a9d(0xef)?_0xeb34a7[_0x181a9d(0xf4)]:{}};}catch(_0x4f82cb){if(_0x4f82cb[_0x181a9d(0xe9)]===_0x181a9d(0xea))return null;throw new Error(_0x181a9d(0xee)+String(_0x4f82cb));}}export async function writePageLockFile(_0x2506a7,_0x36e128){const _0x21e323=a236_0x2129;await mkdir(dirname(_0x2506a7),{'recursive':!![]}),await writeFile(_0x2506a7,JSON['stringify'](_0x36e128,null,0x2),_0x21e323(0xe4));}
@@ -1 +1 @@
1
- function a230_0x36d5(){const _0x139b59=['5173405NKnFTY','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','2143984BnyisK','JOIN_PREDICATE_UNSUPPORTED','48dAYDaR','INNER','max','3583953pcGdau','containsUnresolvedInclude','unsupportedReason','indexes','includes','trim','indexOf','matchedPrefix','__sq__','where','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','exec','some','slice','split','sql','toUpperCase','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','natural','reduce','1768062SfuefK','unknown','error','tableName','add','replace','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','startsWith','from','right','30XBBtcr','\x5cs*\x5c.\x5cs*[\x5cw$]+','warning','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','columns','push','cross','21ExMTzB','124lxSvkB','left','position','replaceAll','endsWith','min','table','JOIN_INDEX_NOT_USABLE','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','length','\x5c$&','141720WKPjBJ','test','16138859JQkkfy','map','filter','unavailable','alias','matchAll','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','inner','join','10531daMvUk','INDEX_METADATA_UNAVAILABLE','index','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','search','full','has','metadataAvailable','using'];a230_0x36d5=function(){return _0x139b59;};return a230_0x36d5();}(function(_0x52cf5e,_0x4bda8c){const _0x33a7b8=a230_0x1319,_0x240c4e=_0x52cf5e();while(!![]){try{const _0x25bf58=parseInt(_0x33a7b8(0x193))/0x1*(parseInt(_0x33a7b8(0x1ca))/0x2)+-parseInt(_0x33a7b8(0x1a1))/0x3*(parseInt(_0x33a7b8(0x187))/0x4)+-parseInt(_0x33a7b8(0x19d))/0x5+-parseInt(_0x33a7b8(0x1b8))/0x6+parseInt(_0x33a7b8(0x1c9))/0x7*(-parseInt(_0x33a7b8(0x19f))/0x8)+parseInt(_0x33a7b8(0x1a4))/0x9*(parseInt(_0x33a7b8(0x1c2))/0xa)+parseInt(_0x33a7b8(0x189))/0xb;if(_0x25bf58===_0x4bda8c)break;else _0x240c4e['push'](_0x240c4e['shift']());}catch(_0xf91c1f){_0x240c4e['push'](_0x240c4e['shift']());}}}(a230_0x36d5,0x9606e));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x398caf,_0x7db7b7){const _0x365b7c=a230_0x1319,_0x28448e=[],_0x1b4973=normalizeSqlForStaticAnalysis(_0x398caf),_0x144ae2=(_0x1b4973[_0x365b7c(0x1ba)]?[]:extractJoinFacts(_0x1b4973[_0x365b7c(0x1b3)]))[_0x365b7c(0x18a)](_0x4c8bee=>{const _0x35463c=_0x365b7c;if(_0x4c8bee['unsupportedPredicate']||_0x4c8bee[_0x35463c(0x1c6)]['length']===0x0)return _0x28448e[_0x35463c(0x1c7)]({'code':_0x35463c(0x1a0),'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee[_0x35463c(0x18d)],'columns':_0x4c8bee[_0x35463c(0x1c6)],'reason':_0x4c8bee[_0x35463c(0x1a6)]??_0x35463c(0x196)}),{'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee['alias'],'columns':_0x4c8bee[_0x35463c(0x1c6)],'status':'unavailable'};const _0xf4ab4d=resolveTableMetadata(_0x7db7b7,_0x4c8bee['table']),_0x3fa8eb=(_0xf4ab4d?.['indexes']??[])[_0x35463c(0x18a)](_0x77ac08=>({'index':_0x77ac08,'matchedPrefix':findEqualityPrefix(_0x77ac08[_0x35463c(0x1c6)],_0x4c8bee[_0x35463c(0x1c6)])}))[_0x35463c(0x18b)](_0x379f1a=>_0x379f1a['matchedPrefix'][_0x35463c(0x1d4)]>0x0),_0x4d12bb=_0x3fa8eb[_0x35463c(0x1b7)]((_0x16a03d,_0xf7b7ce)=>!_0x16a03d||_0xf7b7ce[_0x35463c(0x1ab)][_0x35463c(0x1d4)]>_0x16a03d[_0x35463c(0x1ab)][_0x35463c(0x1d4)]?_0xf7b7ce:_0x16a03d,_0x3fa8eb[0x0]);if(_0x4d12bb)return{'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee[_0x35463c(0x18d)],'columns':_0x4c8bee[_0x35463c(0x1c6)],'status':'covered','matchedIndex':{..._0x4d12bb[_0x35463c(0x195)],'matchedPrefix':_0x4d12bb[_0x35463c(0x1ab)]}};const _0x47fc1e=_0xf4ab4d?.[_0x35463c(0x1a7)]['filter'](_0x598d48=>_0x598d48[_0x35463c(0x1c6)][_0x35463c(0x1b0)](_0x426f41=>_0x4c8bee[_0x35463c(0x1c6)][_0x35463c(0x1b0)](_0x14f557=>columnNamesMatch(_0x426f41,_0x14f557))))??[];if(_0x47fc1e[_0x35463c(0x1d4)]>0x0)return _0x28448e[_0x35463c(0x1c7)]({'code':_0x35463c(0x1d1),'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee[_0x35463c(0x18d)],'columns':_0x4c8bee[_0x35463c(0x1c6)],'reason':_0x35463c(0x19e)}),{'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee[_0x35463c(0x18d)],'columns':_0x4c8bee[_0x35463c(0x1c6)],'status':_0x35463c(0x1c4),'candidateIndexes':_0x47fc1e};if(_0xf4ab4d&&_0xf4ab4d[_0x35463c(0x19b)]!==![]&&_0xf4ab4d[_0x35463c(0x1a7)][_0x35463c(0x1d4)]>0x0&&_0x4c8bee[_0x35463c(0x1c6)][_0x35463c(0x1d4)]>0x0)return _0x28448e[_0x35463c(0x1c7)]({'code':'JOIN_INDEX_MISSING','table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee['alias'],'columns':_0x4c8bee['columns'],'reason':_0x35463c(0x190)}),{'table':_0x4c8bee['table'],'alias':_0x4c8bee[_0x35463c(0x18d)],'columns':_0x4c8bee[_0x35463c(0x1c6)],'status':_0x35463c(0x1c4)};return _0x28448e[_0x35463c(0x1c7)]({'code':_0x35463c(0x194),'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee['alias'],'columns':_0x4c8bee[_0x35463c(0x1c6)],'reason':_0xf4ab4d?_0x35463c(0x1ae):_0x35463c(0x197)}),{'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee[_0x35463c(0x18d)],'columns':_0x4c8bee[_0x35463c(0x1c6)],'status':_0x35463c(0x18c)};});return{'checked':_0x144ae2[_0x365b7c(0x1d4)]>0x0,'joins':_0x144ae2,'warnings':_0x28448e};}function extractJoinFacts(_0x47f7cb){const _0x37aa8a=a230_0x1319,_0x2dd0a4=maskNestedQueries(stripSqlNoise(_0x47f7cb)),_0x14cd43=maskQuotedIdentifiers(_0x2dd0a4),_0x3828bd=[],_0x2fb3af=new Set(),_0x2998ba=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x3b04d5 of _0x2dd0a4[_0x37aa8a(0x18e)](_0x2998ba)){const _0x3f77b7=_0x3b04d5[_0x37aa8a(0x195)]??0x0,_0x15d986=_0x3b04d5[0x0][_0x37aa8a(0x198)](/\bJOIN\b/i),_0x2674ce=_0x3f77b7+Math['max'](0x0,_0x15d986);if(!/^JOIN\b/i[_0x37aa8a(0x188)](_0x14cd43[_0x37aa8a(0x1b1)](_0x2674ce)))continue;_0x2fb3af[_0x37aa8a(0x1bc)](_0x2674ce);const _0x274729=normalizeIdentifier(_0x3b04d5[0x1]||_0x37aa8a(0x1a2)),_0x317192=normalizeIdentifier(_0x3b04d5[0x2]??''),_0x371b84=normalizeIdentifier(_0x3b04d5[0x3]||_0x317192[_0x37aa8a(0x1b2)]('.')['at'](-0x1)||_0x317192),_0x36f263=[],_0x57a292=_0x317192===_0x37aa8a(0x1ac);let _0x152b10=_0x274729===_0x37aa8a(0x1c1)||_0x274729==='full'||_0x57a292,_0x34d1bb=_0x152b10?_0x57a292?_0x37aa8a(0x1d3):_0x274729[_0x37aa8a(0x1b4)]()+_0x37aa8a(0x1b5):undefined;const _0x3c25e7=stripOuterParentheses(_0x3b04d5[0x4]??''),_0x2a84d8=_0x3c25e7[_0x37aa8a(0x1a8)](MYBATIS_DYNAMIC_START_MARKER)||_0x3c25e7[_0x37aa8a(0x1a8)](MYBATIS_DYNAMIC_END_MARKER),_0x1eeee4=_0x3c25e7['includes'](MYBATIS_INCLUDE_MARKER);_0x2a84d8&&(_0x152b10=!![],_0x34d1bb??=_0x37aa8a(0x1c5));_0x1eeee4&&(_0x152b10=!![],_0x34d1bb??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x4f0e64=_0x3c25e7[_0x37aa8a(0x1cd)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x37aa8a(0x1cd)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x37aa8a(0x1cd)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x4f0e64,'OR')&&(_0x152b10=!![],_0x34d1bb??=_0x37aa8a(0x1be));for(const _0x59c09c of splitTopLevelAnd(_0x4f0e64)){const _0xe622cd=stripOuterParentheses(_0x59c09c);if(hasTopLevelKeyword(_0xe622cd,'OR')){_0x152b10=!![],_0x34d1bb??=_0x37aa8a(0x1be);continue;}const _0x1cd227=splitEquality(_0xe622cd);if(!_0x1cd227){containsColumnReference(_0x59c09c,_0x371b84)&&(_0x152b10=!![]);continue;}const _0x2fcc92=parseDirectColumnReference(_0x1cd227[0x0],_0x371b84),_0x4942b7=parseDirectColumnReference(_0x1cd227[0x1],_0x371b84),_0x2eab0f=containsColumnReference(_0x1cd227[0x0],_0x371b84),_0x3fe752=containsColumnReference(_0x1cd227[0x1],_0x371b84),_0x224d1a=_0x2fcc92&&!_0x3fe752?_0x2fcc92:_0x4942b7&&!_0x2eab0f?_0x4942b7:null;if(_0x224d1a&&!_0x36f263[_0x37aa8a(0x1a8)](_0x224d1a))_0x36f263[_0x37aa8a(0x1c7)](_0x224d1a);else!_0x224d1a&&containsColumnReference(_0x59c09c,_0x371b84)&&(_0x152b10=!![]);}_0x3828bd[_0x37aa8a(0x1c7)]({'table':_0x317192,'alias':_0x371b84,'columns':_0x36f263,'unsupportedPredicate':_0x152b10,'unsupportedReason':_0x34d1bb,'containsUnresolvedInclude':_0x1eeee4,'position':_0x2674ce});}for(const _0x1d0fec of _0x14cd43['matchAll'](/\bJOIN\b/gi)){const _0x1496c0=_0x1d0fec[_0x37aa8a(0x195)]??0x0;if(_0x2fb3af[_0x37aa8a(0x19a)](_0x1496c0))continue;const _0xe071e2=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x37aa8a(0x1af)](_0x2dd0a4[_0x37aa8a(0x1b1)](_0x1496c0+_0x1d0fec[0x0][_0x37aa8a(0x1d4)])),_0x55ba61=normalizeIdentifier(_0xe071e2?.[0x1]||_0x37aa8a(0x1b9)),_0x208312=normalizeIdentifier(_0xe071e2?.[0x2]||''),_0xda7885=isSqlClauseKeyword(_0x208312)?_0x55ba61['split']('.')['at'](-0x1)||_0x55ba61:_0x208312||_0x55ba61[_0x37aa8a(0x1b2)]('.')['at'](-0x1)||_0x55ba61;_0x3828bd[_0x37aa8a(0x1c7)]({'table':_0x55ba61,'alias':_0xda7885,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x37aa8a(0x18f),'position':_0x1496c0});}const _0x471c4a=_0x14cd43[_0x37aa8a(0x1aa)](MYBATIS_INCLUDE_MARKER);return _0x471c4a>=0x0&&!_0x3828bd['some'](_0x1cd6ab=>_0x1cd6ab[_0x37aa8a(0x1a5)])&&_0x3828bd[_0x37aa8a(0x1c7)]({'table':'unknown','alias':_0x37aa8a(0x1b9),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x37aa8a(0x1d2),'containsUnresolvedInclude':!![],'position':_0x471c4a}),_0x3828bd['sort']((_0x26fe29,_0x2b5bbd)=>_0x26fe29[_0x37aa8a(0x1cc)]-_0x2b5bbd[_0x37aa8a(0x1cc)]);}function stripSqlNoise(_0x357f08){const _0x5e7bbf=a230_0x1319,_0x3cbc9b=Array[_0x5e7bbf(0x1c0)](_0x357f08),_0x3c6dd1=(_0x5778c9,_0x12a938)=>{for(let _0x3f2fc3=_0x5778c9;_0x3f2fc3<_0x12a938;_0x3f2fc3+=0x1){_0x3cbc9b[_0x3f2fc3]!=='\x0a'&&_0x3cbc9b[_0x3f2fc3]!=='\x0d'&&(_0x3cbc9b[_0x3f2fc3]='\x20');}};for(let _0xc15429=0x0;_0xc15429<_0x3cbc9b[_0x5e7bbf(0x1d4)];_0xc15429+=0x1){const _0x5722e1=_0x3cbc9b[_0xc15429],_0x2842f1=_0x3cbc9b[_0xc15429+0x1];if(_0x5722e1==='\x27'||_0x5722e1==='\x22'||_0x5722e1==='`'){const _0x13cf15=_0x5722e1,_0x5a73cf=_0xc15429;_0xc15429+=0x1;while(_0xc15429<_0x3cbc9b[_0x5e7bbf(0x1d4)]){if(_0x3cbc9b[_0xc15429]==='\x5c'&&_0xc15429+0x1<_0x3cbc9b[_0x5e7bbf(0x1d4)]){_0xc15429+=0x2;continue;}if(_0x3cbc9b[_0xc15429]!==_0x13cf15){_0xc15429+=0x1;continue;}if(_0x3cbc9b[_0xc15429+0x1]===_0x13cf15){_0xc15429+=0x2;continue;}break;}if(_0x13cf15==='\x27')_0x3c6dd1(_0x5a73cf,Math['min'](_0xc15429+0x1,_0x3cbc9b['length']));continue;}if(_0x5722e1==='-'&&_0x2842f1==='-'){const _0xfbbb1f=_0xc15429;while(_0xc15429<_0x3cbc9b['length']&&_0x3cbc9b[_0xc15429]!=='\x0a')_0xc15429+=0x1;_0x3c6dd1(_0xfbbb1f,_0xc15429);continue;}if(_0x5722e1==='/'&&_0x2842f1==='*'){const _0x99b05a=_0xc15429;_0xc15429+=0x2;while(_0xc15429<_0x3cbc9b[_0x5e7bbf(0x1d4)]&&!(_0x3cbc9b[_0xc15429]==='*'&&_0x3cbc9b[_0xc15429+0x1]==='/')){_0xc15429+=0x1;}_0xc15429=Math['min'](_0xc15429+0x1,_0x3cbc9b[_0x5e7bbf(0x1d4)]-0x1),_0x3c6dd1(_0x99b05a,_0xc15429+0x1);continue;}if(_0x5722e1==='#'&&_0x2842f1!=='{'){const _0x430ca0=_0xc15429;while(_0xc15429<_0x3cbc9b[_0x5e7bbf(0x1d4)]&&_0x3cbc9b[_0xc15429]!=='\x0a')_0xc15429+=0x1;_0x3c6dd1(_0x430ca0,_0xc15429);continue;}if((_0x5722e1==='#'||_0x5722e1==='$')&&_0x2842f1==='{'){const _0x10927b=_0xc15429;_0xc15429+=0x2;while(_0xc15429<_0x3cbc9b[_0x5e7bbf(0x1d4)]&&_0x3cbc9b[_0xc15429]!=='}')_0xc15429+=0x1;_0x3c6dd1(_0x10927b,Math[_0x5e7bbf(0x1cf)](_0xc15429+0x1,_0x3cbc9b['length']));}}return _0x3cbc9b[_0x5e7bbf(0x192)]('');}function maskQuotedIdentifiers(_0x1786ba){const _0x4107ff=a230_0x1319,_0x57964b=Array['from'](_0x1786ba);for(let _0x434ea3=0x0;_0x434ea3<_0x57964b['length'];_0x434ea3+=0x1){const _0x3b0351=_0x57964b[_0x434ea3];if(_0x3b0351!=='\x22'&&_0x3b0351!=='`')continue;_0x434ea3+=0x1;while(_0x434ea3<_0x57964b[_0x4107ff(0x1d4)]){if(_0x57964b[_0x434ea3]===_0x3b0351){if(_0x57964b[_0x434ea3+0x1]===_0x3b0351){_0x57964b[_0x434ea3]='\x20',_0x57964b[_0x434ea3+0x1]='\x20',_0x434ea3+=0x2;continue;}break;}_0x57964b[_0x434ea3]='\x20',_0x434ea3+=0x1;}}return _0x57964b[_0x4107ff(0x192)]('');}function maskNestedQueries(_0x341f41){const _0x39d427=a230_0x1319,_0xcf0dd5=Array['from'](_0x341f41);for(let _0x44b8f5=0x0;_0x44b8f5<_0xcf0dd5[_0x39d427(0x1d4)];_0x44b8f5+=0x1){if(_0xcf0dd5[_0x44b8f5]!=='(')continue;const _0x194fb2=_0x341f41[_0x39d427(0x1b1)](_0x44b8f5+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x39d427(0x188)](_0x194fb2))continue;let _0x2e1aec=0x1,_0x2f04f0=_0x44b8f5+0x1;for(;_0x2f04f0<_0xcf0dd5[_0x39d427(0x1d4)]&&_0x2e1aec>0x0;_0x2f04f0+=0x1){if(_0xcf0dd5[_0x2f04f0]==='(')_0x2e1aec+=0x1;if(_0xcf0dd5[_0x2f04f0]===')')_0x2e1aec-=0x1;}if(_0x2e1aec!==0x0)continue;for(let _0x3880ea=_0x44b8f5;_0x3880ea<_0x2f04f0;_0x3880ea+=0x1){_0xcf0dd5[_0x3880ea]='\x20';}const _0x30ff74=_0x39d427(0x1ac);for(let _0x438eb9=0x0;_0x438eb9<_0x30ff74[_0x39d427(0x1d4)]&&_0x44b8f5+_0x438eb9<_0x2f04f0;_0x438eb9+=0x1){_0xcf0dd5[_0x44b8f5+_0x438eb9]=_0x30ff74[_0x438eb9];}_0x44b8f5=_0x2f04f0-0x1;}return _0xcf0dd5[_0x39d427(0x192)]('');}function splitTopLevelAnd(_0x11e31e){const _0x36bd53=a230_0x1319,_0x42cc41=[];let _0x5f2a2f=0x0,_0x51ff7d=0x0;for(let _0x7586f=0x0;_0x7586f<_0x11e31e[_0x36bd53(0x1d4)];_0x7586f+=0x1){const _0x5231ab=_0x11e31e[_0x7586f];if(_0x5231ab==='(')_0x5f2a2f+=0x1;if(_0x5231ab===')')_0x5f2a2f=Math[_0x36bd53(0x1a3)](0x0,_0x5f2a2f-0x1);_0x5f2a2f===0x0&&_0x11e31e[_0x36bd53(0x1b1)](_0x7586f)['match'](/^AND\b/i)&&(_0x7586f===0x0||/\s/[_0x36bd53(0x188)](_0x11e31e[_0x7586f-0x1]??''))&&(_0x42cc41[_0x36bd53(0x1c7)](_0x11e31e[_0x36bd53(0x1b1)](_0x51ff7d,_0x7586f)[_0x36bd53(0x1a9)]()),_0x7586f+=0x2,_0x51ff7d=_0x7586f+0x1);}const _0x4dc861=_0x11e31e[_0x36bd53(0x1b1)](_0x51ff7d)[_0x36bd53(0x1a9)]();if(_0x4dc861)_0x42cc41[_0x36bd53(0x1c7)](_0x4dc861);return _0x42cc41;}function hasTopLevelKeyword(_0x516ed5,_0x23187a){const _0x10dc51=a230_0x1319;let _0x2dbd24=0x0;for(let _0x8038f1=0x0;_0x8038f1<_0x516ed5[_0x10dc51(0x1d4)];_0x8038f1+=0x1){const _0x5f07c3=_0x516ed5[_0x8038f1];if(_0x5f07c3==='(')_0x2dbd24+=0x1;if(_0x5f07c3===')')_0x2dbd24=Math[_0x10dc51(0x1a3)](0x0,_0x2dbd24-0x1);if(_0x2dbd24!==0x0)continue;const _0x599bb4=_0x516ed5[_0x10dc51(0x1b1)](_0x8038f1,_0x8038f1+_0x23187a[_0x10dc51(0x1d4)]),_0x463cd0=_0x516ed5[_0x8038f1-0x1]??'\x20',_0x3672b2=_0x516ed5[_0x8038f1+_0x23187a[_0x10dc51(0x1d4)]]??'\x20';if(_0x599bb4[_0x10dc51(0x1b4)]()===_0x23187a['toUpperCase']()&&!/[\w$]/['test'](_0x463cd0)&&!/[\w$]/[_0x10dc51(0x188)](_0x3672b2))return!![];}return![];}function splitEquality(_0x257e4b){const _0x3f8d0b=a230_0x1319,_0x5950b4=stripOuterParentheses(_0x257e4b);let _0x560d2e=0x0,_0x23777d;for(let _0xe2af50=0x0;_0xe2af50<_0x5950b4['length'];_0xe2af50+=0x1){const _0x449a5a=_0x5950b4[_0xe2af50];if(_0x449a5a==='(')_0x560d2e+=0x1;if(_0x449a5a===')')_0x560d2e=Math['max'](0x0,_0x560d2e-0x1);const _0x3e248c=_0x5950b4[_0xe2af50-0x1]??'',_0x35ae3c=_0x5950b4[_0xe2af50+0x1]??'';if(_0x449a5a==='='&&_0x560d2e===0x0&&!/[!<>=:]/[_0x3f8d0b(0x188)](_0x3e248c)&&_0x35ae3c!=='='){if(_0x23777d!==undefined)return null;_0x23777d=_0xe2af50;}}return _0x23777d===undefined?null:[_0x5950b4[_0x3f8d0b(0x1b1)](0x0,_0x23777d)[_0x3f8d0b(0x1a9)](),_0x5950b4['slice'](_0x23777d+0x1)[_0x3f8d0b(0x1a9)]()];}function parseDirectColumnReference(_0x324a58,_0x5aa107){const _0x4998b6=a230_0x1319,_0x6168e3=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x4998b6(0x1af)](stripOuterParentheses(_0x324a58));if(!_0x6168e3)return null;if(normalizeIdentifier(_0x6168e3[0x1]??'')!==normalizeIdentifier(_0x5aa107))return null;return normalizeIdentifier(_0x6168e3[0x2]??'');}function containsColumnReference(_0x3ce9c1,_0x3e2efd){const _0x95d0eb=a230_0x1319,_0x2386f9=_0x3ce9c1[_0x95d0eb(0x1bd)](/[`"]/g,''),_0x5c733e=_0x3e2efd[_0x95d0eb(0x1bd)](/[.*+?^${}()|[\]\\]/g,_0x95d0eb(0x1d5));return new RegExp('(?:^|[^\x5cw$])'+_0x5c733e+_0x95d0eb(0x1c3),'i')[_0x95d0eb(0x188)](_0x2386f9);}function findEqualityPrefix(_0x2f18ca,_0x7c8ee1){const _0x2f0914=a230_0x1319,_0x158d72=new Set(_0x7c8ee1[_0x2f0914(0x18a)](normalizeIdentifier)),_0x2abec5=[];for(const _0x5899e1 of _0x2f18ca){if(!_0x158d72[_0x2f0914(0x19a)](normalizeIdentifier(_0x5899e1)))break;_0x2abec5['push'](_0x5899e1);}return _0x2abec5;}function a230_0x1319(_0x211f83,_0x3ba531){_0x211f83=_0x211f83-0x187;const _0x36d5cc=a230_0x36d5();let _0x1319ab=_0x36d5cc[_0x211f83];return _0x1319ab;}function resolveTableMetadata(_0x53fadd,_0x2fc9){const _0x4fe61b=a230_0x1319,_0x31618f=normalizeIdentifier(_0x2fc9),_0x1d92d4=_0x53fadd[_0x4fe61b(0x18b)](_0x577ac5=>normalizeIdentifier(_0x577ac5[_0x4fe61b(0x1bb)])===_0x31618f);if(_0x1d92d4['length']===0x1)return _0x1d92d4[0x0];const _0x3522e6=_0x31618f[_0x4fe61b(0x1a8)]('.'),_0x5d7c02=_0x31618f['split']('.')['at'](-0x1),_0x4db1de=_0x53fadd[_0x4fe61b(0x18b)](_0x258eeb=>{const _0x1bf7d9=_0x4fe61b,_0x4466a2=normalizeIdentifier(_0x258eeb['tableName']);if(_0x3522e6&&_0x4466a2[_0x1bf7d9(0x1a8)]('.'))return![];return _0x4466a2[_0x1bf7d9(0x1b2)]('.')['at'](-0x1)===_0x5d7c02;});return _0x4db1de[_0x4fe61b(0x1d4)]===0x1?_0x4db1de[0x0]:undefined;}function columnNamesMatch(_0x370d7b,_0x5c576f){return normalizeIdentifier(_0x370d7b)===normalizeIdentifier(_0x5c576f);}function normalizeIdentifier(_0x1c0829){const _0x433af1=a230_0x1319;return _0x1c0829['replace'](/[`"]/g,'')[_0x433af1(0x1a9)]()['toLowerCase']();}function isSqlClauseKeyword(_0x411fa5){const _0xaeb426=a230_0x1319;return new Set(['on',_0xaeb426(0x19c),_0xaeb426(0x1ad),'join',_0xaeb426(0x191),_0xaeb426(0x1cb),_0xaeb426(0x1c1),_0xaeb426(0x199),_0xaeb426(0x1c8),_0xaeb426(0x1b6)])[_0xaeb426(0x19a)](_0x411fa5);}function stripOuterParentheses(_0x4a1a7c){const _0x155bad=a230_0x1319;let _0x996e1f=_0x4a1a7c['trim']();while(_0x996e1f[_0x155bad(0x1bf)]('(')&&_0x996e1f[_0x155bad(0x1ce)](')')){let _0x5712fc=0x0,_0x30385d=!![];for(let _0x2d2236=0x0;_0x2d2236<_0x996e1f[_0x155bad(0x1d4)];_0x2d2236+=0x1){if(_0x996e1f[_0x2d2236]==='(')_0x5712fc+=0x1;if(_0x996e1f[_0x2d2236]===')')_0x5712fc-=0x1;if(_0x5712fc===0x0&&_0x2d2236<_0x996e1f[_0x155bad(0x1d4)]-0x1){_0x30385d=![];break;}}if(!_0x30385d||_0x5712fc!==0x0)break;_0x996e1f=_0x996e1f[_0x155bad(0x1b1)](0x1,-0x1)[_0x155bad(0x1a9)]();}return _0x996e1f;}
1
+ (function(_0x3ea064,_0x4f8425){const _0x3ef49a=a238_0x2169,_0x469745=_0x3ea064();while(!![]){try{const _0xa8a03d=parseInt(_0x3ef49a(0xb3))/0x1+parseInt(_0x3ef49a(0xd4))/0x2+-parseInt(_0x3ef49a(0xaa))/0x3*(parseInt(_0x3ef49a(0xbf))/0x4)+-parseInt(_0x3ef49a(0xce))/0x5+parseInt(_0x3ef49a(0xd7))/0x6*(-parseInt(_0x3ef49a(0xd6))/0x7)+-parseInt(_0x3ef49a(0xbe))/0x8+parseInt(_0x3ef49a(0xc9))/0x9;if(_0xa8a03d===_0x4f8425)break;else _0x469745['push'](_0x469745['shift']());}catch(_0x3309e1){_0x469745['push'](_0x469745['shift']());}}}(a238_0x2a33,0x39e31));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x53d590,_0x24d1b3){const _0x4b0849=a238_0x2169,_0x27dd1f=[],_0x32327c=normalizeSqlForStaticAnalysis(_0x53d590),_0x4f8526=(_0x32327c[_0x4b0849(0xd8)]?[]:extractJoinFacts(_0x32327c[_0x4b0849(0xa8)]))[_0x4b0849(0x99)](_0x1e5cc6=>{const _0x2400ea=_0x4b0849;if(_0x1e5cc6['unsupportedPredicate']||_0x1e5cc6[_0x2400ea(0xca)]['length']===0x0)return _0x27dd1f[_0x2400ea(0xc5)]({'code':_0x2400ea(0xc2),'table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6['alias'],'columns':_0x1e5cc6[_0x2400ea(0xca)],'reason':_0x1e5cc6[_0x2400ea(0xb2)]??_0x2400ea(0x9a)}),{'table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6[_0x2400ea(0xca)],'status':'unavailable'};const _0x226b1d=resolveTableMetadata(_0x24d1b3,_0x1e5cc6[_0x2400ea(0xc1)]),_0x37e944=(_0x226b1d?.['indexes']??[])['map'](_0x24b91a=>({'index':_0x24b91a,'matchedPrefix':findEqualityPrefix(_0x24b91a[_0x2400ea(0xca)],_0x1e5cc6[_0x2400ea(0xca)])}))[_0x2400ea(0xab)](_0x34c433=>_0x34c433[_0x2400ea(0xc0)][_0x2400ea(0xd3)]>0x0),_0x530e0e=_0x37e944['reduce']((_0x35e4e0,_0x29ff64)=>!_0x35e4e0||_0x29ff64[_0x2400ea(0xc0)][_0x2400ea(0xd3)]>_0x35e4e0[_0x2400ea(0xc0)][_0x2400ea(0xd3)]?_0x29ff64:_0x35e4e0,_0x37e944[0x0]);if(_0x530e0e)return{'table':_0x1e5cc6['table'],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6['columns'],'status':'covered','matchedIndex':{..._0x530e0e[_0x2400ea(0x9f)],'matchedPrefix':_0x530e0e['matchedPrefix']}};const _0x1e4cc2=_0x226b1d?.[_0x2400ea(0xbd)][_0x2400ea(0xab)](_0x4e8e92=>_0x4e8e92[_0x2400ea(0xca)]['some'](_0xfae7b4=>_0x1e5cc6[_0x2400ea(0xca)][_0x2400ea(0xd2)](_0x2902e8=>columnNamesMatch(_0xfae7b4,_0x2902e8))))??[];if(_0x1e4cc2[_0x2400ea(0xd3)]>0x0)return _0x27dd1f['push']({'code':_0x2400ea(0xa1),'table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6[_0x2400ea(0xca)],'reason':_0x2400ea(0xb5)}),{'table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6['alias'],'columns':_0x1e5cc6[_0x2400ea(0xca)],'status':_0x2400ea(0xcc),'candidateIndexes':_0x1e4cc2};if(_0x226b1d&&_0x226b1d[_0x2400ea(0x9b)]!==![]&&_0x226b1d[_0x2400ea(0xbd)][_0x2400ea(0xd3)]>0x0&&_0x1e5cc6[_0x2400ea(0xca)][_0x2400ea(0xd3)]>0x0)return _0x27dd1f[_0x2400ea(0xc5)]({'code':'JOIN_INDEX_MISSING','table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6['columns'],'reason':_0x2400ea(0xb4)}),{'table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6[_0x2400ea(0xca)],'status':_0x2400ea(0xcc)};return _0x27dd1f['push']({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x1e5cc6['table'],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6[_0x2400ea(0xca)],'reason':_0x226b1d?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6[_0x2400ea(0xca)],'status':_0x2400ea(0xba)};});return{'checked':_0x4f8526['length']>0x0,'joins':_0x4f8526,'warnings':_0x27dd1f};}function a238_0x2a33(){const _0x3a8bbd=['slice','warning','containsUnresolvedInclude','1934130OIAhGR','inner','cross','max','some','length','540978kqdmhk','sort','1233715BQLLku','12wkXhqR','error','test','full','alias','map','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','metadataAvailable','right','search','unknown','index','tableName','JOIN_INDEX_NOT_USABLE','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','__sq__','trim','matchAll','min','replaceAll','sql','includes','1668ZjNrMe','filter','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','split','position','(?:^|[^\x5cw$])','replace','endsWith','unsupportedReason','148633eHGqdh','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','has','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','indexOf','startsWith','unavailable','join','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','indexes','798584zurCvq','280MOhRbC','matchedPrefix','table','JOIN_PREDICATE_UNSUPPORTED','toLowerCase','exec','push','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','toUpperCase','match','6264378hoHHKm','columns'];a238_0x2a33=function(){return _0x3a8bbd;};return a238_0x2a33();}function extractJoinFacts(_0x1f6326){const _0x4ec1ab=a238_0x2169,_0x4413a9=maskNestedQueries(stripSqlNoise(_0x1f6326)),_0x4b565a=maskQuotedIdentifiers(_0x4413a9),_0x278634=[],_0x21a670=new Set(),_0x2217d3=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x2c9b03 of _0x4413a9[_0x4ec1ab(0xa5)](_0x2217d3)){const _0x29129b=_0x2c9b03[_0x4ec1ab(0x9f)]??0x0,_0x300590=_0x2c9b03[0x0][_0x4ec1ab(0x9d)](/\bJOIN\b/i),_0x22ca36=_0x29129b+Math[_0x4ec1ab(0xd1)](0x0,_0x300590);if(!/^JOIN\b/i[_0x4ec1ab(0xd9)](_0x4b565a[_0x4ec1ab(0xcb)](_0x22ca36)))continue;_0x21a670['add'](_0x22ca36);const _0x3527cd=normalizeIdentifier(_0x2c9b03[0x1]||'INNER'),_0x53274d=normalizeIdentifier(_0x2c9b03[0x2]??''),_0x7c3cc6=normalizeIdentifier(_0x2c9b03[0x3]||_0x53274d[_0x4ec1ab(0xad)]('.')['at'](-0x1)||_0x53274d),_0x1d85d5=[],_0xfe0296=_0x53274d===_0x4ec1ab(0xa3);let _0xcd50bc=_0x3527cd===_0x4ec1ab(0x9c)||_0x3527cd===_0x4ec1ab(0xda)||_0xfe0296,_0x189091=_0xcd50bc?_0xfe0296?_0x4ec1ab(0xa2):_0x3527cd[_0x4ec1ab(0xc7)]()+_0x4ec1ab(0xb7):undefined;const _0x9cfdc7=stripOuterParentheses(_0x2c9b03[0x4]??''),_0x408161=_0x9cfdc7[_0x4ec1ab(0xa9)](MYBATIS_DYNAMIC_START_MARKER)||_0x9cfdc7[_0x4ec1ab(0xa9)](MYBATIS_DYNAMIC_END_MARKER),_0x1d02cd=_0x9cfdc7[_0x4ec1ab(0xa9)](MYBATIS_INCLUDE_MARKER);_0x408161&&(_0xcd50bc=!![],_0x189091??=_0x4ec1ab(0xbc));_0x1d02cd&&(_0xcd50bc=!![],_0x189091??=_0x4ec1ab(0xac));const _0x1fc48d=_0x9cfdc7[_0x4ec1ab(0xa7)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x4ec1ab(0xa7)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x1fc48d,'OR')&&(_0xcd50bc=!![],_0x189091??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x4a8b4 of splitTopLevelAnd(_0x1fc48d)){const _0x5c1db8=stripOuterParentheses(_0x4a8b4);if(hasTopLevelKeyword(_0x5c1db8,'OR')){_0xcd50bc=!![],_0x189091??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x25261a=splitEquality(_0x5c1db8);if(!_0x25261a){containsColumnReference(_0x4a8b4,_0x7c3cc6)&&(_0xcd50bc=!![]);continue;}const _0x1728dc=parseDirectColumnReference(_0x25261a[0x0],_0x7c3cc6),_0x4631a8=parseDirectColumnReference(_0x25261a[0x1],_0x7c3cc6),_0x4c26ef=containsColumnReference(_0x25261a[0x0],_0x7c3cc6),_0x4e079e=containsColumnReference(_0x25261a[0x1],_0x7c3cc6),_0x175136=_0x1728dc&&!_0x4e079e?_0x1728dc:_0x4631a8&&!_0x4c26ef?_0x4631a8:null;if(_0x175136&&!_0x1d85d5['includes'](_0x175136))_0x1d85d5[_0x4ec1ab(0xc5)](_0x175136);else!_0x175136&&containsColumnReference(_0x4a8b4,_0x7c3cc6)&&(_0xcd50bc=!![]);}_0x278634[_0x4ec1ab(0xc5)]({'table':_0x53274d,'alias':_0x7c3cc6,'columns':_0x1d85d5,'unsupportedPredicate':_0xcd50bc,'unsupportedReason':_0x189091,'containsUnresolvedInclude':_0x1d02cd,'position':_0x22ca36});}for(const _0x5cad2a of _0x4b565a[_0x4ec1ab(0xa5)](/\bJOIN\b/gi)){const _0x1d3c00=_0x5cad2a[_0x4ec1ab(0x9f)]??0x0;if(_0x21a670[_0x4ec1ab(0xb6)](_0x1d3c00))continue;const _0x1d509f=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x4ec1ab(0xc4)](_0x4413a9['slice'](_0x1d3c00+_0x5cad2a[0x0][_0x4ec1ab(0xd3)])),_0x283327=normalizeIdentifier(_0x1d509f?.[0x1]||_0x4ec1ab(0x9e)),_0x43133f=normalizeIdentifier(_0x1d509f?.[0x2]||''),_0x47750c=isSqlClauseKeyword(_0x43133f)?_0x283327['split']('.')['at'](-0x1)||_0x283327:_0x43133f||_0x283327[_0x4ec1ab(0xad)]('.')['at'](-0x1)||_0x283327;_0x278634[_0x4ec1ab(0xc5)]({'table':_0x283327,'alias':_0x47750c,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x4ec1ab(0xc6),'position':_0x1d3c00});}const _0x23c12f=_0x4b565a[_0x4ec1ab(0xb8)](MYBATIS_INCLUDE_MARKER);return _0x23c12f>=0x0&&!_0x278634[_0x4ec1ab(0xd2)](_0x47e7a5=>_0x47e7a5[_0x4ec1ab(0xcd)])&&_0x278634[_0x4ec1ab(0xc5)]({'table':'unknown','alias':_0x4ec1ab(0x9e),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','containsUnresolvedInclude':!![],'position':_0x23c12f}),_0x278634[_0x4ec1ab(0xd5)]((_0x19b34c,_0x1beb8b)=>_0x19b34c[_0x4ec1ab(0xae)]-_0x1beb8b[_0x4ec1ab(0xae)]);}function a238_0x2169(_0x5555c9,_0x3d2174){_0x5555c9=_0x5555c9-0x98;const _0x2a33a5=a238_0x2a33();let _0x2169f6=_0x2a33a5[_0x5555c9];return _0x2169f6;}function stripSqlNoise(_0x151241){const _0x56f131=a238_0x2169,_0x69cbda=Array['from'](_0x151241),_0x4ff56b=(_0x2de271,_0x4e36c9)=>{for(let _0x3acdd1=_0x2de271;_0x3acdd1<_0x4e36c9;_0x3acdd1+=0x1){_0x69cbda[_0x3acdd1]!=='\x0a'&&_0x69cbda[_0x3acdd1]!=='\x0d'&&(_0x69cbda[_0x3acdd1]='\x20');}};for(let _0x589de9=0x0;_0x589de9<_0x69cbda[_0x56f131(0xd3)];_0x589de9+=0x1){const _0x55ffc5=_0x69cbda[_0x589de9],_0x4db37e=_0x69cbda[_0x589de9+0x1];if(_0x55ffc5==='\x27'||_0x55ffc5==='\x22'||_0x55ffc5==='`'){const _0x498a4e=_0x55ffc5,_0x291b38=_0x589de9;_0x589de9+=0x1;while(_0x589de9<_0x69cbda[_0x56f131(0xd3)]){if(_0x69cbda[_0x589de9]==='\x5c'&&_0x589de9+0x1<_0x69cbda[_0x56f131(0xd3)]){_0x589de9+=0x2;continue;}if(_0x69cbda[_0x589de9]!==_0x498a4e){_0x589de9+=0x1;continue;}if(_0x69cbda[_0x589de9+0x1]===_0x498a4e){_0x589de9+=0x2;continue;}break;}if(_0x498a4e==='\x27')_0x4ff56b(_0x291b38,Math[_0x56f131(0xa6)](_0x589de9+0x1,_0x69cbda[_0x56f131(0xd3)]));continue;}if(_0x55ffc5==='-'&&_0x4db37e==='-'){const _0x4fb78f=_0x589de9;while(_0x589de9<_0x69cbda[_0x56f131(0xd3)]&&_0x69cbda[_0x589de9]!=='\x0a')_0x589de9+=0x1;_0x4ff56b(_0x4fb78f,_0x589de9);continue;}if(_0x55ffc5==='/'&&_0x4db37e==='*'){const _0x47178f=_0x589de9;_0x589de9+=0x2;while(_0x589de9<_0x69cbda['length']&&!(_0x69cbda[_0x589de9]==='*'&&_0x69cbda[_0x589de9+0x1]==='/')){_0x589de9+=0x1;}_0x589de9=Math['min'](_0x589de9+0x1,_0x69cbda[_0x56f131(0xd3)]-0x1),_0x4ff56b(_0x47178f,_0x589de9+0x1);continue;}if(_0x55ffc5==='#'&&_0x4db37e!=='{'){const _0x23df2c=_0x589de9;while(_0x589de9<_0x69cbda[_0x56f131(0xd3)]&&_0x69cbda[_0x589de9]!=='\x0a')_0x589de9+=0x1;_0x4ff56b(_0x23df2c,_0x589de9);continue;}if((_0x55ffc5==='#'||_0x55ffc5==='$')&&_0x4db37e==='{'){const _0x3193d7=_0x589de9;_0x589de9+=0x2;while(_0x589de9<_0x69cbda[_0x56f131(0xd3)]&&_0x69cbda[_0x589de9]!=='}')_0x589de9+=0x1;_0x4ff56b(_0x3193d7,Math[_0x56f131(0xa6)](_0x589de9+0x1,_0x69cbda[_0x56f131(0xd3)]));}}return _0x69cbda[_0x56f131(0xbb)]('');}function maskQuotedIdentifiers(_0x1e9ea2){const _0x337469=a238_0x2169,_0x3ee0cc=Array['from'](_0x1e9ea2);for(let _0x16d223=0x0;_0x16d223<_0x3ee0cc[_0x337469(0xd3)];_0x16d223+=0x1){const _0x1437c6=_0x3ee0cc[_0x16d223];if(_0x1437c6!=='\x22'&&_0x1437c6!=='`')continue;_0x16d223+=0x1;while(_0x16d223<_0x3ee0cc['length']){if(_0x3ee0cc[_0x16d223]===_0x1437c6){if(_0x3ee0cc[_0x16d223+0x1]===_0x1437c6){_0x3ee0cc[_0x16d223]='\x20',_0x3ee0cc[_0x16d223+0x1]='\x20',_0x16d223+=0x2;continue;}break;}_0x3ee0cc[_0x16d223]='\x20',_0x16d223+=0x1;}}return _0x3ee0cc[_0x337469(0xbb)]('');}function maskNestedQueries(_0x5edc83){const _0x329e20=a238_0x2169,_0x1aab93=Array['from'](_0x5edc83);for(let _0x20f275=0x0;_0x20f275<_0x1aab93[_0x329e20(0xd3)];_0x20f275+=0x1){if(_0x1aab93[_0x20f275]!=='(')continue;const _0x577898=_0x5edc83['slice'](_0x20f275+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x329e20(0xd9)](_0x577898))continue;let _0x21567b=0x1,_0xda3fe8=_0x20f275+0x1;for(;_0xda3fe8<_0x1aab93['length']&&_0x21567b>0x0;_0xda3fe8+=0x1){if(_0x1aab93[_0xda3fe8]==='(')_0x21567b+=0x1;if(_0x1aab93[_0xda3fe8]===')')_0x21567b-=0x1;}if(_0x21567b!==0x0)continue;for(let _0xedef72=_0x20f275;_0xedef72<_0xda3fe8;_0xedef72+=0x1){_0x1aab93[_0xedef72]='\x20';}const _0x492940='__sq__';for(let _0x36bee4=0x0;_0x36bee4<_0x492940[_0x329e20(0xd3)]&&_0x20f275+_0x36bee4<_0xda3fe8;_0x36bee4+=0x1){_0x1aab93[_0x20f275+_0x36bee4]=_0x492940[_0x36bee4];}_0x20f275=_0xda3fe8-0x1;}return _0x1aab93[_0x329e20(0xbb)]('');}function splitTopLevelAnd(_0x23d48d){const _0x57899d=a238_0x2169,_0x17caef=[];let _0x15c8c5=0x0,_0x1355f7=0x0;for(let _0x1c1769=0x0;_0x1c1769<_0x23d48d[_0x57899d(0xd3)];_0x1c1769+=0x1){const _0x2cb45a=_0x23d48d[_0x1c1769];if(_0x2cb45a==='(')_0x15c8c5+=0x1;if(_0x2cb45a===')')_0x15c8c5=Math[_0x57899d(0xd1)](0x0,_0x15c8c5-0x1);_0x15c8c5===0x0&&_0x23d48d[_0x57899d(0xcb)](_0x1c1769)[_0x57899d(0xc8)](/^AND\b/i)&&(_0x1c1769===0x0||/\s/['test'](_0x23d48d[_0x1c1769-0x1]??''))&&(_0x17caef[_0x57899d(0xc5)](_0x23d48d[_0x57899d(0xcb)](_0x1355f7,_0x1c1769)[_0x57899d(0xa4)]()),_0x1c1769+=0x2,_0x1355f7=_0x1c1769+0x1);}const _0x4ecf37=_0x23d48d[_0x57899d(0xcb)](_0x1355f7)['trim']();if(_0x4ecf37)_0x17caef[_0x57899d(0xc5)](_0x4ecf37);return _0x17caef;}function hasTopLevelKeyword(_0x459356,_0x4bb1fd){const _0x5997ba=a238_0x2169;let _0x3aca8b=0x0;for(let _0x2491a1=0x0;_0x2491a1<_0x459356[_0x5997ba(0xd3)];_0x2491a1+=0x1){const _0xbd5610=_0x459356[_0x2491a1];if(_0xbd5610==='(')_0x3aca8b+=0x1;if(_0xbd5610===')')_0x3aca8b=Math[_0x5997ba(0xd1)](0x0,_0x3aca8b-0x1);if(_0x3aca8b!==0x0)continue;const _0x47b578=_0x459356[_0x5997ba(0xcb)](_0x2491a1,_0x2491a1+_0x4bb1fd[_0x5997ba(0xd3)]),_0x1188d0=_0x459356[_0x2491a1-0x1]??'\x20',_0x387e3f=_0x459356[_0x2491a1+_0x4bb1fd[_0x5997ba(0xd3)]]??'\x20';if(_0x47b578[_0x5997ba(0xc7)]()===_0x4bb1fd[_0x5997ba(0xc7)]()&&!/[\w$]/[_0x5997ba(0xd9)](_0x1188d0)&&!/[\w$]/[_0x5997ba(0xd9)](_0x387e3f))return!![];}return![];}function splitEquality(_0x433999){const _0xe7e93b=a238_0x2169,_0x196d90=stripOuterParentheses(_0x433999);let _0x995405=0x0,_0x5a47ef;for(let _0x383541=0x0;_0x383541<_0x196d90[_0xe7e93b(0xd3)];_0x383541+=0x1){const _0x5939ea=_0x196d90[_0x383541];if(_0x5939ea==='(')_0x995405+=0x1;if(_0x5939ea===')')_0x995405=Math[_0xe7e93b(0xd1)](0x0,_0x995405-0x1);const _0x4347b2=_0x196d90[_0x383541-0x1]??'',_0x4aaf7c=_0x196d90[_0x383541+0x1]??'';if(_0x5939ea==='='&&_0x995405===0x0&&!/[!<>=:]/['test'](_0x4347b2)&&_0x4aaf7c!=='='){if(_0x5a47ef!==undefined)return null;_0x5a47ef=_0x383541;}}return _0x5a47ef===undefined?null:[_0x196d90[_0xe7e93b(0xcb)](0x0,_0x5a47ef)['trim'](),_0x196d90['slice'](_0x5a47ef+0x1)[_0xe7e93b(0xa4)]()];}function parseDirectColumnReference(_0x9ab840,_0x1a1d6f){const _0x19e18c=a238_0x2169,_0xe5d3d5=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x19e18c(0xc4)](stripOuterParentheses(_0x9ab840));if(!_0xe5d3d5)return null;if(normalizeIdentifier(_0xe5d3d5[0x1]??'')!==normalizeIdentifier(_0x1a1d6f))return null;return normalizeIdentifier(_0xe5d3d5[0x2]??'');}function containsColumnReference(_0x33f093,_0x3e41a3){const _0x17f9b1=a238_0x2169,_0x33df0d=_0x33f093[_0x17f9b1(0xb0)](/[`"]/g,''),_0x3536c4=_0x3e41a3[_0x17f9b1(0xb0)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x17f9b1(0xaf)+_0x3536c4+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')['test'](_0x33df0d);}function findEqualityPrefix(_0x2e6925,_0x39420d){const _0x4f5a98=a238_0x2169,_0x2ed832=new Set(_0x39420d[_0x4f5a98(0x99)](normalizeIdentifier)),_0x1d6a77=[];for(const _0x2b8db0 of _0x2e6925){if(!_0x2ed832['has'](normalizeIdentifier(_0x2b8db0)))break;_0x1d6a77[_0x4f5a98(0xc5)](_0x2b8db0);}return _0x1d6a77;}function resolveTableMetadata(_0x3916c5,_0x76a587){const _0x341ecf=a238_0x2169,_0x4dfb17=normalizeIdentifier(_0x76a587),_0x3d6347=_0x3916c5[_0x341ecf(0xab)](_0x45c127=>normalizeIdentifier(_0x45c127['tableName'])===_0x4dfb17);if(_0x3d6347[_0x341ecf(0xd3)]===0x1)return _0x3d6347[0x0];const _0xcfcee5=_0x4dfb17[_0x341ecf(0xa9)]('.'),_0x4690af=_0x4dfb17['split']('.')['at'](-0x1),_0x1dcc91=_0x3916c5['filter'](_0x56b362=>{const _0x8ac88b=_0x341ecf,_0xda96cf=normalizeIdentifier(_0x56b362[_0x8ac88b(0xa0)]);if(_0xcfcee5&&_0xda96cf[_0x8ac88b(0xa9)]('.'))return![];return _0xda96cf[_0x8ac88b(0xad)]('.')['at'](-0x1)===_0x4690af;});return _0x1dcc91['length']===0x1?_0x1dcc91[0x0]:undefined;}function columnNamesMatch(_0x24a35f,_0x44113e){return normalizeIdentifier(_0x24a35f)===normalizeIdentifier(_0x44113e);}function normalizeIdentifier(_0x997ccc){const _0x565577=a238_0x2169;return _0x997ccc[_0x565577(0xb0)](/[`"]/g,'')[_0x565577(0xa4)]()[_0x565577(0xc3)]();}function isSqlClauseKeyword(_0x4b60ec){const _0x50e1ec=a238_0x2169;return new Set(['on','using','where',_0x50e1ec(0xbb),_0x50e1ec(0xcf),'left','right',_0x50e1ec(0xda),_0x50e1ec(0xd0),'natural'])[_0x50e1ec(0xb6)](_0x4b60ec);}function stripOuterParentheses(_0x230b17){const _0x5ecd50=a238_0x2169;let _0xe1e79c=_0x230b17['trim']();while(_0xe1e79c[_0x5ecd50(0xb9)]('(')&&_0xe1e79c[_0x5ecd50(0xb1)](')')){let _0x1269c4=0x0,_0x47d5e1=!![];for(let _0x4cc5a1=0x0;_0x4cc5a1<_0xe1e79c[_0x5ecd50(0xd3)];_0x4cc5a1+=0x1){if(_0xe1e79c[_0x4cc5a1]==='(')_0x1269c4+=0x1;if(_0xe1e79c[_0x4cc5a1]===')')_0x1269c4-=0x1;if(_0x1269c4===0x0&&_0x4cc5a1<_0xe1e79c[_0x5ecd50(0xd3)]-0x1){_0x47d5e1=![];break;}}if(!_0x47d5e1||_0x1269c4!==0x0)break;_0xe1e79c=_0xe1e79c[_0x5ecd50(0xcb)](0x1,-0x1)[_0x5ecd50(0xa4)]();}return _0xe1e79c;}
@@ -1 +1 @@
1
- const a231_0x889da=a231_0x52b1;(function(_0x28738f,_0x18fa1f){const _0x56db16=a231_0x52b1,_0xeccded=_0x28738f();while(!![]){try{const _0x2efef2=-parseInt(_0x56db16(0x1c2))/0x1+-parseInt(_0x56db16(0x1b9))/0x2*(-parseInt(_0x56db16(0x1c0))/0x3)+-parseInt(_0x56db16(0x1c4))/0x4*(-parseInt(_0x56db16(0x1be))/0x5)+-parseInt(_0x56db16(0x1c3))/0x6*(-parseInt(_0x56db16(0x1b8))/0x7)+-parseInt(_0x56db16(0x1c1))/0x8*(-parseInt(_0x56db16(0x1ba))/0x9)+parseInt(_0x56db16(0x1bc))/0xa*(parseInt(_0x56db16(0x1bf))/0xb)+parseInt(_0x56db16(0x1bd))/0xc*(-parseInt(_0x56db16(0x1bb))/0xd);if(_0x2efef2===_0x18fa1f)break;else _0xeccded['push'](_0xeccded['shift']());}catch(_0x464ff8){_0xeccded['push'](_0xeccded['shift']());}}}(a231_0x2f83,0x215a5));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a231_0x52b1(_0x40bc71,_0x5147a2){_0x40bc71=_0x40bc71-0x1b7;const _0x2f83ab=a231_0x2f83();let _0x52b1a8=_0x2f83ab[_0x40bc71];return _0x52b1a8;}const DOT_DIR=a231_0x889da(0x1b7),LOCK_FILE_NAME='sql.lock.json',TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x194dfb,_0x52396f){const _0x152ade=a231_0x889da,_0x2d28bc=resolve(_0x52396f??findProjectRootDirectory()),_0x95dccf=DOT_DIR+_0x152ade(0x1c6),_0x4243f0=_0x95dccf+'/'+_0x194dfb;return{'projectRoot':_0x2d28bc,'appCode':_0x194dfb,'sqlWorkspaceRoot':_0x95dccf,'sqlRoot':_0x4243f0,'sqlRootDir':resolve(_0x2d28bc,DOT_DIR,_0x152ade(0x1c5),_0x194dfb),'lockFilePath':resolve(_0x2d28bc,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2d28bc,DOT_DIR,TRASH_DIR_NAME)};}function a231_0x2f83(){const _0x423616=['12kFvnmp','sql','/sql','.rabetbase','364EcJOnp','50614jRdrVp','488601BurdUN','5287230XtrBln','20JfSRNJ','12VNlBfN','424745wuaQKv','605209HlMlMr','6VFJSWI','8LKuTDn','33637kLuvey','12366wOpCuC'];a231_0x2f83=function(){return _0x423616;};return a231_0x2f83();}
1
+ function a239_0x11ae(_0x15c881,_0x3c9b81){_0x15c881=_0x15c881-0x105;const _0xa13fd0=a239_0xa13f();let _0x11aeca=_0xa13fd0[_0x15c881];return _0x11aeca;}const a239_0x33b3ad=a239_0x11ae;(function(_0x2c9a8a,_0x299582){const _0x2981a8=a239_0x11ae,_0x8ea52a=_0x2c9a8a();while(!![]){try{const _0x8f6b82=-parseInt(_0x2981a8(0x111))/0x1*(parseInt(_0x2981a8(0x107))/0x2)+-parseInt(_0x2981a8(0x10b))/0x3+-parseInt(_0x2981a8(0x105))/0x4*(parseInt(_0x2981a8(0x10e))/0x5)+-parseInt(_0x2981a8(0x108))/0x6*(-parseInt(_0x2981a8(0x10f))/0x7)+parseInt(_0x2981a8(0x106))/0x8*(parseInt(_0x2981a8(0x10d))/0x9)+parseInt(_0x2981a8(0x113))/0xa*(parseInt(_0x2981a8(0x109))/0xb)+parseInt(_0x2981a8(0x10a))/0xc;if(_0x8f6b82===_0x299582)break;else _0x8ea52a['push'](_0x8ea52a['shift']());}catch(_0x13acec){_0x8ea52a['push'](_0x8ea52a['shift']());}}}(a239_0xa13f,0xc113b));function a239_0xa13f(){const _0xaef9fd=['sql-trash','117kzdwen','5705DgGofG','1799wPOOSD','sql.lock.json','3nDCigk','/sql','190GalxBG','2044Xkbyum','152584fURMSR','981382xiTYjq','19086YduBCT','900823SiYMjv','8718996KYUCUd','1506147zpRxoV'];a239_0xa13f=function(){return _0xaef9fd;};return a239_0xa13f();}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a239_0x33b3ad(0x110),TRASH_DIR_NAME=a239_0x33b3ad(0x10c);export function loadSqlProjectConfig(_0x26d641,_0x3755a1){const _0x1ed86d=a239_0x33b3ad,_0x4c8aa4=resolve(_0x3755a1??findProjectRootDirectory()),_0x3c2bbc=DOT_DIR+_0x1ed86d(0x112),_0x5a5ee2=_0x3c2bbc+'/'+_0x26d641;return{'projectRoot':_0x4c8aa4,'appCode':_0x26d641,'sqlWorkspaceRoot':_0x3c2bbc,'sqlRoot':_0x5a5ee2,'sqlRootDir':resolve(_0x4c8aa4,DOT_DIR,'sql',_0x26d641),'lockFilePath':resolve(_0x4c8aa4,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4c8aa4,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x9c390e,_0x346a42){const _0x212a2b=a232_0x172b,_0x47bb2d=_0x9c390e();while(!![]){try{const _0x526141=-parseInt(_0x212a2b(0x101))/0x1+parseInt(_0x212a2b(0x104))/0x2+-parseInt(_0x212a2b(0x10a))/0x3*(-parseInt(_0x212a2b(0x100))/0x4)+parseInt(_0x212a2b(0x10e))/0x5+-parseInt(_0x212a2b(0x113))/0x6*(-parseInt(_0x212a2b(0x109))/0x7)+-parseInt(_0x212a2b(0x119))/0x8*(parseInt(_0x212a2b(0x114))/0x9)+-parseInt(_0x212a2b(0x102))/0xa*(-parseInt(_0x212a2b(0x11a))/0xb);if(_0x526141===_0x346a42)break;else _0x47bb2d['push'](_0x47bb2d['shift']());}catch(_0x5be8c5){_0x47bb2d['push'](_0x47bb2d['shift']());}}}(a232_0x32c0,0x49804));import{readdir,stat}from'node:fs/promises';function a232_0x172b(_0x178b1e,_0x311076){_0x178b1e=_0x178b1e-0x100;const _0x32c0ae=a232_0x32c0();let _0x172be0=_0x32c0ae[_0x178b1e];return _0x172be0;}import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x2bb8bd){const _0x5eba7d=a232_0x172b;if(_0x2bb8bd===_0x5eba7d(0x108))return _0x5eba7d(0x111);if(_0x2bb8bd===_0x5eba7d(0x11b))return _0x5eba7d(0x117);return undefined;}async function scanSqlFilesRecursively(_0x1be275,_0x1d2e96){const _0x5146f9=a232_0x172b,_0x59fda7=[];try{const _0x1a68a8=await readdir(_0x1be275,{'withFileTypes':!![]});for(const _0x4be38f of _0x1a68a8){const _0x21cf19=join(_0x1be275,_0x4be38f[_0x5146f9(0x11e)]);if(_0x4be38f[_0x5146f9(0x10b)]()){_0x59fda7['push'](...await scanSqlFilesRecursively(_0x21cf19,_0x1d2e96));continue;}if(!_0x4be38f[_0x5146f9(0x106)]())continue;const _0x3adc1c=extname(_0x4be38f[_0x5146f9(0x11e)])['toLowerCase'](),_0x3986b5=extensionToMode(_0x3adc1c);if(!_0x3986b5)continue;const _0x3f991d=relative(_0x1d2e96,_0x21cf19)[_0x5146f9(0x10c)](/\\/g,'/'),_0x569c84=_0x3f991d[_0x5146f9(0x116)]('/')[_0x5146f9(0x105)](Boolean),_0x50e4e7=parseSqlPath(_0x569c84,_0x4be38f[_0x5146f9(0x11e)],_0x3adc1c);if(!_0x50e4e7)continue;_0x59fda7['push']({'sqlCode':_0x50e4e7[_0x5146f9(0x107)],'sqlName':_0x50e4e7[_0x5146f9(0x11f)],'dbDirectory':_0x569c84[0x0],'filePath':_0x21cf19,'relativePath':_0x3f991d,'lockKey':_0x50e4e7['sqlCode'],'mode':_0x3986b5});}}catch(_0x1efea6){if(_0x1efea6[_0x5146f9(0x110)]!==_0x5146f9(0x112))throw _0x1efea6;}return _0x59fda7;}export async function scanLocalSqlQueries(_0x1428aa){const _0x34c499=a232_0x172b;return scanSqlFilesRecursively(_0x1428aa[_0x34c499(0x115)],_0x1428aa['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x2b9f81,_0x226162,_0x1bdbf2){const _0x13d8b7=a232_0x172b,_0xe4e019=_0x1bdbf2?.[_0x13d8b7(0x120)]||(_0x1bdbf2?.['sqlName']||_0x1bdbf2?.[_0x13d8b7(0x118)]?buildSqlRelativePath(_0x226162,_0x1bdbf2?.[_0x13d8b7(0x11f)],_0x1bdbf2?.[_0x13d8b7(0x118)],_0x1bdbf2?.[_0x13d8b7(0x10f)]||'sql',_0x1bdbf2?.[_0x13d8b7(0x11d)]):buildDefaultSqlFileName(_0x226162,_0x1bdbf2?.[_0x13d8b7(0x10f)]||_0x13d8b7(0x111)));return join(_0x2b9f81[_0x13d8b7(0x115)],_0xe4e019);}export async function directoryExists(_0x443b3f){try{const _0x2698ca=await stat(_0x443b3f);return _0x2698ca['isDirectory']();}catch{return![];}}function parseSqlPath(_0x28c992,_0xaf2c0d,_0xfb7ef){const _0x5f3a78=a232_0x172b,_0x3e6709=_0xaf2c0d[_0x5f3a78(0x103)](0x0,-_0xfb7ef['length']);if(_0x28c992[_0x5f3a78(0x11c)]<0x2)return null;const _0x1d7f3f=_0x3e6709['indexOf']('_');if(_0x1d7f3f<=0x0||_0x1d7f3f>=_0x3e6709[_0x5f3a78(0x11c)]-0x1)return null;const _0x4b03bc=_0x3e6709[_0x5f3a78(0x103)](0x0,_0x1d7f3f);if(!isLikelySqlCode(_0x4b03bc))return null;return{'sqlCode':_0x4b03bc,'sqlName':_0x3e6709[_0x5f3a78(0x103)](_0x1d7f3f+0x1)};}function isLikelySqlCode(_0x45c447){const _0x3209f4=a232_0x172b;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x3209f4(0x10d)](_0x45c447);}function a232_0x32c0(){const _0x613fbe=['246708MqtHvI','88620iffrsf','isDirectory','replace','test','783540uAILBR','mode','code','sql','ENOENT','6FVISdg','9xgwFNG','sqlRootDir','split','mybatisXml','dbName','2032616QtqruI','451CLhZfj','.xml','length','dbId','name','sqlName','path','44vLnvyz','262111BqVmgh','47410ZBOktw','slice','211950NnBOfD','filter','isFile','sqlCode','.sql'];a232_0x32c0=function(){return _0x613fbe;};return a232_0x32c0();}
1
+ (function(_0x359810,_0x4beee1){const _0x1c8135=a240_0x5a94,_0x429d97=_0x359810();while(!![]){try{const _0x3bcf68=parseInt(_0x1c8135(0x101))/0x1+parseInt(_0x1c8135(0x113))/0x2+-parseInt(_0x1c8135(0x103))/0x3*(parseInt(_0x1c8135(0x10d))/0x4)+-parseInt(_0x1c8135(0x10f))/0x5+parseInt(_0x1c8135(0x100))/0x6+parseInt(_0x1c8135(0x10b))/0x7+-parseInt(_0x1c8135(0x110))/0x8*(parseInt(_0x1c8135(0x106))/0x9);if(_0x3bcf68===_0x4beee1)break;else _0x429d97['push'](_0x429d97['shift']());}catch(_0x27a5b6){_0x429d97['push'](_0x429d97['shift']());}}}(a240_0x5496,0x869ff));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x49df7f){const _0x4870f6=a240_0x5a94;if(_0x49df7f==='.sql')return _0x4870f6(0x104);if(_0x49df7f===_0x4870f6(0xf8))return _0x4870f6(0xff);return undefined;}function a240_0x5496(){const _0x30198d=['mybatisXml','5494926auCOBG','870420mMKTFt','path','691791DCzmNS','sql','toLowerCase','657WdGkgn','sqlRootDir','isDirectory','mode','split','1571157Nfqtji','isFile','12ZCjNiQ','dbName','5195790xfjVNw','23176IJmDib','length','code','966322iOPomR','name','.xml','sqlCode','sqlName','dbId','push','slice','replace'];a240_0x5496=function(){return _0x30198d;};return a240_0x5496();}async function scanSqlFilesRecursively(_0x5054e4,_0xacc760){const _0x2fe3f9=a240_0x5a94,_0x3a3080=[];try{const _0x36235f=await readdir(_0x5054e4,{'withFileTypes':!![]});for(const _0x5278de of _0x36235f){const _0x400320=join(_0x5054e4,_0x5278de['name']);if(_0x5278de[_0x2fe3f9(0x108)]()){_0x3a3080[_0x2fe3f9(0xfc)](...await scanSqlFilesRecursively(_0x400320,_0xacc760));continue;}if(!_0x5278de[_0x2fe3f9(0x10c)]())continue;const _0x4393fa=extname(_0x5278de[_0x2fe3f9(0xf7)])[_0x2fe3f9(0x105)](),_0x5abbff=extensionToMode(_0x4393fa);if(!_0x5abbff)continue;const _0x5a89db=relative(_0xacc760,_0x400320)[_0x2fe3f9(0xfe)](/\\/g,'/'),_0xc7ac4a=_0x5a89db[_0x2fe3f9(0x10a)]('/')['filter'](Boolean),_0x251009=parseSqlPath(_0xc7ac4a,_0x5278de['name'],_0x4393fa);if(!_0x251009)continue;_0x3a3080[_0x2fe3f9(0xfc)]({'sqlCode':_0x251009[_0x2fe3f9(0xf9)],'sqlName':_0x251009['sqlName'],'dbDirectory':_0xc7ac4a[0x0],'filePath':_0x400320,'relativePath':_0x5a89db,'lockKey':_0x251009[_0x2fe3f9(0xf9)],'mode':_0x5abbff});}}catch(_0x362f07){if(_0x362f07[_0x2fe3f9(0x112)]!=='ENOENT')throw _0x362f07;}return _0x3a3080;}export async function scanLocalSqlQueries(_0x3ca299){const _0x88a964=a240_0x5a94;return scanSqlFilesRecursively(_0x3ca299[_0x88a964(0x107)],_0x3ca299[_0x88a964(0x107)]);}export function resolveLocalSqlFilePath(_0xbe2da0,_0x1e879b,_0x49dd8){const _0x170ce4=a240_0x5a94,_0x4a2acc=_0x49dd8?.[_0x170ce4(0x102)]||(_0x49dd8?.[_0x170ce4(0xfa)]||_0x49dd8?.[_0x170ce4(0x10e)]?buildSqlRelativePath(_0x1e879b,_0x49dd8?.[_0x170ce4(0xfa)],_0x49dd8?.['dbName'],_0x49dd8?.[_0x170ce4(0x109)]||_0x170ce4(0x104),_0x49dd8?.[_0x170ce4(0xfb)]):buildDefaultSqlFileName(_0x1e879b,_0x49dd8?.[_0x170ce4(0x109)]||_0x170ce4(0x104)));return join(_0xbe2da0['sqlRootDir'],_0x4a2acc);}export async function directoryExists(_0x1153b3){const _0x116ee7=a240_0x5a94;try{const _0x342fbd=await stat(_0x1153b3);return _0x342fbd[_0x116ee7(0x108)]();}catch{return![];}}function parseSqlPath(_0x2c8ff0,_0x2840f2,_0x4fec76){const _0xa04e7=a240_0x5a94,_0x3b4918=_0x2840f2[_0xa04e7(0xfd)](0x0,-_0x4fec76[_0xa04e7(0x111)]);if(_0x2c8ff0[_0xa04e7(0x111)]<0x2)return null;const _0x3ec18f=_0x3b4918['indexOf']('_');if(_0x3ec18f<=0x0||_0x3ec18f>=_0x3b4918[_0xa04e7(0x111)]-0x1)return null;const _0x2adc27=_0x3b4918[_0xa04e7(0xfd)](0x0,_0x3ec18f);if(!isLikelySqlCode(_0x2adc27))return null;return{'sqlCode':_0x2adc27,'sqlName':_0x3b4918[_0xa04e7(0xfd)](_0x3ec18f+0x1)};}function a240_0x5a94(_0x750dd6,_0x4ebaf3){_0x750dd6=_0x750dd6-0xf7;const _0x549603=a240_0x5496();let _0x5a946d=_0x549603[_0x750dd6];return _0x5a946d;}function isLikelySqlCode(_0x19e2a4){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0x19e2a4);}
@@ -1 +1 @@
1
- (function(_0x2194b4,_0x1d27d8){const _0x1bc41d=a233_0x59f7,_0xc05ca8=_0x2194b4();while(!![]){try{const _0x2f4ad4=parseInt(_0x1bc41d(0x1cc))/0x1*(parseInt(_0x1bc41d(0x1cb))/0x2)+parseInt(_0x1bc41d(0x1d6))/0x3*(-parseInt(_0x1bc41d(0x1d2))/0x4)+parseInt(_0x1bc41d(0x1d4))/0x5+parseInt(_0x1bc41d(0x1d3))/0x6*(-parseInt(_0x1bc41d(0x1d1))/0x7)+-parseInt(_0x1bc41d(0x1cf))/0x8+-parseInt(_0x1bc41d(0x1d7))/0x9*(parseInt(_0x1bc41d(0x1c9))/0xa)+parseInt(_0x1bc41d(0x1cd))/0xb;if(_0x2f4ad4===_0x1d27d8)break;else _0xc05ca8['push'](_0xc05ca8['shift']());}catch(_0x2675b2){_0xc05ca8['push'](_0xc05ca8['shift']());}}}(a233_0xbf0a,0x84332));import{readFile}from'node:fs/promises';import a233_0x40edd8 from'node:crypto';function a233_0x59f7(_0x1c1814,_0x2640f5){_0x1c1814=_0x1c1814-0x1c9;const _0xbf0a=a233_0xbf0a();let _0x59f7eb=_0xbf0a[_0x1c1814];return _0x59f7eb;}export function computeSqlContentHash(_0x3e4ecf){const _0x19020a=a233_0x59f7;return a233_0x40edd8['createHash'](_0x19020a(0x1ca))[_0x19020a(0x1ce)](_0x3e4ecf)[_0x19020a(0x1d5)](_0x19020a(0x1d0));}function a233_0xbf0a(){const _0x4b363c=['36lfqKcs','646790RYbwBP','md5','136130yFzPyG','3Olsqdy','12183985ciDkXD','update','1417992wedCRR','hex','873964moikGg','1312FISgNI','42tABGhs','4349425kHnZUQ','digest','3021AiVFsS'];a233_0xbf0a=function(){return _0x4b363c;};return a233_0xbf0a();}export async function computeSqlFileHash(_0x2701e0){const _0x232ba2=await readFile(_0x2701e0,'utf8');return computeSqlContentHash(_0x232ba2);}
1
+ (function(_0x3c836e,_0x287aac){const _0x289a3b=a241_0x5ce3,_0x354db9=_0x3c836e();while(!![]){try{const _0x1dcc00=-parseInt(_0x289a3b(0xea))/0x1*(parseInt(_0x289a3b(0xf3))/0x2)+parseInt(_0x289a3b(0xec))/0x3+-parseInt(_0x289a3b(0xf0))/0x4+-parseInt(_0x289a3b(0xf5))/0x5+parseInt(_0x289a3b(0xf2))/0x6+-parseInt(_0x289a3b(0xf1))/0x7*(parseInt(_0x289a3b(0xe8))/0x8)+parseInt(_0x289a3b(0xed))/0x9;if(_0x1dcc00===_0x287aac)break;else _0x354db9['push'](_0x354db9['shift']());}catch(_0x48d85d){_0x354db9['push'](_0x354db9['shift']());}}}(a241_0x5ae9,0xca91c));import{readFile}from'node:fs/promises';import a241_0x484e8b from'node:crypto';function a241_0x5ae9(){const _0x381c68=['2460900NSTaoZ','917QfToXX','2442936LxeviN','14980Zduiwf','utf8','7621060NTcEaw','52776fnjTWm','digest','19swRIqc','hex','4713075EVNvhY','17977473xuQtwY','createHash','md5'];a241_0x5ae9=function(){return _0x381c68;};return a241_0x5ae9();}function a241_0x5ce3(_0x9d92f1,_0x5800eb){_0x9d92f1=_0x9d92f1-0xe8;const _0x5ae93a=a241_0x5ae9();let _0x5ce346=_0x5ae93a[_0x9d92f1];return _0x5ce346;}export function computeSqlContentHash(_0x57fed6){const _0x2a1bf8=a241_0x5ce3;return a241_0x484e8b[_0x2a1bf8(0xee)](_0x2a1bf8(0xef))['update'](_0x57fed6)[_0x2a1bf8(0xe9)](_0x2a1bf8(0xeb));}export async function computeSqlFileHash(_0x45cab7){const _0x551368=a241_0x5ce3,_0x25ca99=await readFile(_0x45cab7,_0x551368(0xf4));return computeSqlContentHash(_0x25ca99);}
@@ -1 +1 @@
1
- (function(_0x442ab4,_0x2a46fc){const _0x1693b6=a234_0x35c4,_0x24ede4=_0x442ab4();while(!![]){try{const _0x193270=-parseInt(_0x1693b6(0x104))/0x1*(-parseInt(_0x1693b6(0x10c))/0x2)+-parseInt(_0x1693b6(0x105))/0x3*(-parseInt(_0x1693b6(0xf9))/0x4)+-parseInt(_0x1693b6(0x102))/0x5*(-parseInt(_0x1693b6(0xff))/0x6)+parseInt(_0x1693b6(0x10e))/0x7*(-parseInt(_0x1693b6(0x10b))/0x8)+parseInt(_0x1693b6(0x103))/0x9+-parseInt(_0x1693b6(0x109))/0xa*(parseInt(_0x1693b6(0x10f))/0xb)+-parseInt(_0x1693b6(0xfa))/0xc*(-parseInt(_0x1693b6(0x100))/0xd);if(_0x193270===_0x2a46fc)break;else _0x24ede4['push'](_0x24ede4['shift']());}catch(_0x2f004c){_0x24ede4['push'](_0x24ede4['shift']());}}}(a234_0x1136,0x2ab0d));function a234_0x35c4(_0x2201e9,_0x40e95f){_0x2201e9=_0x2201e9-0xf6;const _0x1136bf=a234_0x1136();let _0x35c47f=_0x1136bf[_0x2201e9];return _0x35c47f;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a234_0x1136(){const _0x3d31cf=['20YvNwCc','890037Aarciq','10771awzrvW','1917awgALw','\x22\x20vs\x20lock\x20\x22','sqlRoot','stringify','2260020QTbTDT','\x22.\x20','2824pSTIGF','14DxzEQy','apps','5313bMgtMC','11qxXrOk','utf8','sqls','ENOENT','44xXwyiY','2818164TCLUEC','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','parse','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','lastSync','378936FOtwzA','13JjUHNm',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'];a234_0x1136=function(){return _0x3d31cf;};return a234_0x1136();}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x2fbb17,_0x4ae151,_0x473d89,_0x406e9a){const _0xea7f42=a234_0x35c4,_0xf3d862=_0x2fbb17??createEmptySqlLock();let _0x5711ec=_0xf3d862[_0xea7f42(0x10d)][_0x4ae151];if(!_0x5711ec)return _0x5711ec={'sqlRoot':_0x473d89,'lastSync':'','sqls':{}},_0xf3d862['apps'][_0x4ae151]=_0x5711ec,{'lockData':_0xf3d862,'appLock':_0x5711ec};if(!_0x5711ec['sqlRoot'])_0x5711ec[_0xea7f42(0x107)]=_0x473d89;else{if(_0x5711ec[_0xea7f42(0x107)]!==_0x473d89)throw new Error(_0x406e9a+_0xea7f42(0x101)+_0x473d89+_0xea7f42(0x106)+_0x5711ec['sqlRoot']+_0xea7f42(0x10a)+_0xea7f42(0xfb));}return!_0x5711ec['sqls']&&(_0x5711ec[_0xea7f42(0xf7)]={}),!_0x5711ec['lastSync']&&(_0x5711ec[_0xea7f42(0xfe)]=''),{'lockData':_0xf3d862,'appLock':_0x5711ec};}export async function readSqlLockFile(_0x4af6d7){const _0x814529=a234_0x35c4;try{const _0x5b1f38=await readFile(_0x4af6d7,_0x814529(0xf6));return JSON[_0x814529(0xfc)](_0x5b1f38);}catch(_0xbf9202){if(_0xbf9202['code']===_0x814529(0xf8))return null;throw new Error(_0x814529(0xfd)+String(_0xbf9202));}}export async function writeSqlLockFile(_0x2b0af9,_0x2d1365){const _0x56766e=a234_0x35c4;await mkdir(dirname(_0x2b0af9),{'recursive':!![]}),await writeFile(_0x2b0af9,JSON[_0x56766e(0x108)](_0x2d1365,null,0x2),_0x56766e(0xf6));}
1
+ (function(_0x2b153c,_0xa6d986){const _0x257677=a242_0x3784,_0x690b57=_0x2b153c();while(!![]){try{const _0x5dadf1=parseInt(_0x257677(0x12a))/0x1+-parseInt(_0x257677(0x12b))/0x2+parseInt(_0x257677(0x131))/0x3*(-parseInt(_0x257677(0x134))/0x4)+-parseInt(_0x257677(0x132))/0x5+parseInt(_0x257677(0x128))/0x6+parseInt(_0x257677(0x12f))/0x7+parseInt(_0x257677(0x12c))/0x8*(parseInt(_0x257677(0x12e))/0x9);if(_0x5dadf1===_0xa6d986)break;else _0x690b57['push'](_0x690b57['shift']());}catch(_0x4e4481){_0x690b57['push'](_0x690b57['shift']());}}}(a242_0x3469,0xb53e2));import{mkdir,readFile,writeFile}from'node:fs/promises';function a242_0x3784(_0x5d36e6,_0x10a0e0){_0x5d36e6=_0x5d36e6-0x120;const _0x34691a=a242_0x3469();let _0x378469=_0x34691a[_0x5d36e6];return _0x378469;}import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x12fe64,_0x446d92,_0x5a2d66,_0x50f722){const _0x2f2875=a242_0x3784,_0x2a919d=_0x12fe64??createEmptySqlLock();let _0x44a3e7=_0x2a919d[_0x2f2875(0x123)][_0x446d92];if(!_0x44a3e7)return _0x44a3e7={'sqlRoot':_0x5a2d66,'lastSync':'','sqls':{}},_0x2a919d[_0x2f2875(0x123)][_0x446d92]=_0x44a3e7,{'lockData':_0x2a919d,'appLock':_0x44a3e7};if(!_0x44a3e7[_0x2f2875(0x129)])_0x44a3e7[_0x2f2875(0x129)]=_0x5a2d66;else{if(_0x44a3e7[_0x2f2875(0x129)]!==_0x5a2d66)throw new Error(_0x50f722+_0x2f2875(0x130)+_0x5a2d66+_0x2f2875(0x127)+_0x44a3e7[_0x2f2875(0x129)]+_0x2f2875(0x12d)+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x44a3e7[_0x2f2875(0x124)]&&(_0x44a3e7[_0x2f2875(0x124)]={}),!_0x44a3e7['lastSync']&&(_0x44a3e7[_0x2f2875(0x133)]=''),{'lockData':_0x2a919d,'appLock':_0x44a3e7};}export async function readSqlLockFile(_0x3005a3){const _0x32590b=a242_0x3784;try{const _0x3f624e=await readFile(_0x3005a3,_0x32590b(0x121));return JSON[_0x32590b(0x125)](_0x3f624e);}catch(_0x5057a3){if(_0x5057a3['code']===_0x32590b(0x126))return null;throw new Error(_0x32590b(0x122)+String(_0x5057a3));}}function a242_0x3469(){const _0x57d882=['ENOENT','\x22\x20vs\x20lock\x20\x22','3224616LtusTb','sqlRoot','300410nAKeyY','1784656McpBMW','1753312RWtUoD','\x22.\x20','99QNcZTW','2864183fTjjsi',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','41766gDtWuH','7400815llLfza','lastSync','156DdoMdf','stringify','utf8','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','apps','sqls','parse'];a242_0x3469=function(){return _0x57d882;};return a242_0x3469();}export async function writeSqlLockFile(_0x305702,_0x3d3589){const _0x4208e8=a242_0x3784;await mkdir(dirname(_0x305702),{'recursive':!![]}),await writeFile(_0x305702,JSON[_0x4208e8(0x120)](_0x3d3589,null,0x2),_0x4208e8(0x121));}
@@ -1 +1 @@
1
- (function(_0x46459,_0x4488fe){const _0x32248f=a236_0x1620,_0x160695=_0x46459();while(!![]){try{const _0x3a1899=-parseInt(_0x32248f(0x141))/0x1+-parseInt(_0x32248f(0x13f))/0x2*(parseInt(_0x32248f(0x13e))/0x3)+parseInt(_0x32248f(0x13c))/0x4*(parseInt(_0x32248f(0x134))/0x5)+-parseInt(_0x32248f(0x13b))/0x6+-parseInt(_0x32248f(0x133))/0x7+-parseInt(_0x32248f(0x138))/0x8*(parseInt(_0x32248f(0x137))/0x9)+parseInt(_0x32248f(0x13a))/0xa;if(_0x3a1899===_0x4488fe)break;else _0x160695['push'](_0x160695['shift']());}catch(_0x23a3a0){_0x160695['push'](_0x160695['shift']());}}}(a236_0xbb83,0xd81e6));export function detectSqlMode(_0x1ec450){const _0x53ccff=a236_0x1620,_0x3c0c4d=_0x1ec450['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x53ccff(0x132)](_0x3c0c4d))return _0x53ccff(0x13d);return'sql';}export function getSqlFileExtension(_0x5f5be8){const _0x1a7995=a236_0x1620;return _0x5f5be8===_0x1a7995(0x13d)?'.xml':_0x1a7995(0x139);}function a236_0x1620(_0x46ed93,_0x3d45cb){_0x46ed93=_0x46ed93-0x130;const _0xbb83da=a236_0xbb83();let _0x1620c4=_0xbb83da[_0x46ed93];return _0x1620c4;}function a236_0xbb83(){const _0x1a1fe5=['4HLdIUH','mybatisXml','3jZzyWj','1768846rCCSEt','db-','950204zyxGqs','unknown-db','replace','test','8933855RqnOLF','6617790OzGESQ','trim','unknown-sql','783JsfFsC','106456UQrfNU','.sql','44214510dpTJjv','3547116SsfKgg'];a236_0xbb83=function(){return _0x1a1fe5;};return a236_0xbb83();}export function buildDefaultSqlFileName(_0x37d4a4,_0x1b269a){return''+_0x37d4a4+getSqlFileExtension(_0x1b269a);}export function sanitizeSqlPathSegment(_0x471a9d,_0x4057fe){const _0x38a0f8=a236_0x1620,_0x25c3f8=String(_0x471a9d??'')[_0x38a0f8(0x135)](),_0x3f1914=_0x25c3f8[_0x38a0f8(0x131)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x38a0f8(0x131)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x38a0f8(0x131)](/^\.+/,'')[_0x38a0f8(0x131)](/\.+$/,'')[_0x38a0f8(0x131)](/^-+/,'')[_0x38a0f8(0x131)](/-+$/,'');return _0x3f1914||_0x4057fe;}export function buildDbDirectoryName(_0x1e8a30,_0x1c2a0b){const _0x452857=a236_0x1620;return sanitizeSqlPathSegment(_0x1e8a30,_0x1c2a0b!=null?_0x452857(0x140)+_0x1c2a0b:_0x452857(0x130));}export function buildSqlRelativePath(_0x3a4120,_0x46724e,_0x59c33f,_0x508f08,_0x1ab9d1){const _0x488e43=a236_0x1620,_0x41cb36=buildDbDirectoryName(_0x59c33f,_0x1ab9d1),_0x56daab=sanitizeSqlPathSegment(_0x3a4120,_0x488e43(0x136)),_0x1e0819=sanitizeSqlPathSegment(_0x46724e,_0x56daab);return _0x41cb36+'/'+_0x56daab+'_'+_0x1e0819+getSqlFileExtension(_0x508f08);}
1
+ (function(_0x4b6c0b,_0x2b0326){const _0x2f44a4=a244_0xa131,_0x147729=_0x4b6c0b();while(!![]){try{const _0x150387=parseInt(_0x2f44a4(0x18e))/0x1+parseInt(_0x2f44a4(0x190))/0x2*(-parseInt(_0x2f44a4(0x18c))/0x3)+-parseInt(_0x2f44a4(0x18d))/0x4+parseInt(_0x2f44a4(0x188))/0x5+parseInt(_0x2f44a4(0x192))/0x6*(-parseInt(_0x2f44a4(0x187))/0x7)+parseInt(_0x2f44a4(0x183))/0x8*(parseInt(_0x2f44a4(0x193))/0x9)+parseInt(_0x2f44a4(0x194))/0xa;if(_0x150387===_0x2b0326)break;else _0x147729['push'](_0x147729['shift']());}catch(_0x5175b0){_0x147729['push'](_0x147729['shift']());}}}(a244_0x10d0,0x73f11));export function detectSqlMode(_0x5a32f6){const _0x2b7672=a244_0xa131,_0x56751e=_0x5a32f6[_0x2b7672(0x186)]();if(/^<(select|insert|update|delete)\b/i[_0x2b7672(0x18f)](_0x56751e))return _0x2b7672(0x191);return _0x2b7672(0x195);}function a244_0xa131(_0x1751ff,_0x59eaf9){_0x1751ff=_0x1751ff-0x183;const _0x10d012=a244_0x10d0();let _0xa1312a=_0x10d012[_0x1751ff];return _0xa1312a;}export function getSqlFileExtension(_0xadde02){const _0x1a7826=a244_0xa131;return _0xadde02===_0x1a7826(0x191)?_0x1a7826(0x196):_0x1a7826(0x18a);}export function buildDefaultSqlFileName(_0xa4909b,_0x19fa5c){return''+_0xa4909b+getSqlFileExtension(_0x19fa5c);}export function sanitizeSqlPathSegment(_0x513519,_0x32d74c){const _0x2eec64=a244_0xa131,_0x2ecd84=String(_0x513519??'')[_0x2eec64(0x185)](),_0x3280ed=_0x2ecd84[_0x2eec64(0x184)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x2eec64(0x184)](/\s+/g,'-')[_0x2eec64(0x184)](/-+/g,'-')['replace'](/^\.+/,'')[_0x2eec64(0x184)](/\.+$/,'')['replace'](/^-+/,'')[_0x2eec64(0x184)](/-+$/,'');return _0x3280ed||_0x32d74c;}function a244_0x10d0(){const _0x5abd16=['13538290UrYlHH','sql','.xml','unknown-sql','8yTUjFP','replace','trim','trimStart','147oEeADp','3227680ZKoctV','db-','.sql','unknown-db','2281602ZdUEgi','3438420bIarNL','398142FnZcPb','test','2VAcOth','mybatisXml','123408laGzxh','1165113fPXsCS'];a244_0x10d0=function(){return _0x5abd16;};return a244_0x10d0();}export function buildDbDirectoryName(_0x467136,_0x3f72ad){const _0x58ecd0=a244_0xa131;return sanitizeSqlPathSegment(_0x467136,_0x3f72ad!=null?_0x58ecd0(0x189)+_0x3f72ad:_0x58ecd0(0x18b));}export function buildSqlRelativePath(_0x4be788,_0x540bc4,_0x58d248,_0x280d9d,_0x506bc6){const _0x2b6833=a244_0xa131,_0x42442c=buildDbDirectoryName(_0x58d248,_0x506bc6),_0x322b73=sanitizeSqlPathSegment(_0x4be788,_0x2b6833(0x197)),_0xd1c93a=sanitizeSqlPathSegment(_0x540bc4,_0x322b73);return _0x42442c+'/'+_0x322b73+'_'+_0xd1c93a+getSqlFileExtension(_0x280d9d);}
@@ -1 +1 @@
1
- const a237_0x4bf4a2=a237_0x516e;(function(_0x1d0741,_0x5260cc){const _0x14624f=a237_0x516e,_0x1ba4fe=_0x1d0741();while(!![]){try{const _0x16c4b5=-parseInt(_0x14624f(0x102))/0x1+parseInt(_0x14624f(0xeb))/0x2+-parseInt(_0x14624f(0x11e))/0x3*(parseInt(_0x14624f(0xd8))/0x4)+parseInt(_0x14624f(0x100))/0x5+-parseInt(_0x14624f(0x109))/0x6*(parseInt(_0x14624f(0x10f))/0x7)+-parseInt(_0x14624f(0xfb))/0x8+parseInt(_0x14624f(0x10e))/0x9;if(_0x16c4b5===_0x5260cc)break;else _0x1ba4fe['push'](_0x1ba4fe['shift']());}catch(_0x34b9ef){_0x1ba4fe['push'](_0x1ba4fe['shift']());}}}(a237_0x1c29,0xe23b5));const MYBATIS_OUTER_TAGS=new Map([[a237_0x4bf4a2(0x103),a237_0x4bf4a2(0xcb)],[a237_0x4bf4a2(0xef),a237_0x4bf4a2(0xca)],[a237_0x4bf4a2(0xfa),a237_0x4bf4a2(0xfc)],[a237_0x4bf4a2(0x107),a237_0x4bf4a2(0xfd)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if','where',a237_0x4bf4a2(0x108),a237_0x4bf4a2(0xc5),a237_0x4bf4a2(0xfe),'otherwise',a237_0x4bf4a2(0xd5),a237_0x4bf4a2(0x10a),'bind','include','property']),MYBATIS_BRANCH_TAGS=new Set(['if',a237_0x4bf4a2(0x108),a237_0x4bf4a2(0xc5),a237_0x4bf4a2(0xfe),a237_0x4bf4a2(0x10d)]);export const MYBATIS_DYNAMIC_START_MARKER=a237_0x4bf4a2(0xf7);export const MYBATIS_DYNAMIC_END_MARKER=a237_0x4bf4a2(0x101);export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT=a237_0x4bf4a2(0xf5),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a237_0x4bf4a2(0xdd)+[...MYBATIS_OUTER_TAGS[a237_0x4bf4a2(0xf9)]()][a237_0x4bf4a2(0xce)]('|')+')\x5cb','i');export function normalizeSqlForStaticAnalysis(_0x4f6fb8){const _0x3e1847=a237_0x4bf4a2,_0x501678=typeof _0x4f6fb8===_0x3e1847(0xc9)?_0x4f6fb8:'';if(!startsWithMybatisStatementWrapper(_0x501678))return{'sql':_0x501678,'mode':_0x3e1847(0xf2)};let _0x49582b=0x0,_0x419d08='',_0x30e271,_0x4a2a8a=![],_0xa6567d=![];const _0x3a193b=[];while(_0x49582b<_0x501678[_0x3e1847(0x105)]){if(_0x501678[_0x3e1847(0xf4)](_0x3e1847(0x113),_0x49582b)){const _0x503ea3=_0x501678[_0x3e1847(0xcc)](_0x3e1847(0x118),_0x49582b+0x4);if(_0x503ea3<0x0)return invalidMybatisSource('Unterminated\x20XML\x20comment.');_0x419d08+='\x20',_0x49582b=_0x503ea3+0x3;continue;}if(_0x501678[_0x3e1847(0xf4)](_0x3e1847(0x11d),_0x49582b)){if(!_0x4a2a8a||_0xa6567d)return invalidMybatisSource('CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');const _0x2f9303=_0x501678[_0x3e1847(0xcc)](_0x3e1847(0xf0),_0x49582b+0x9);if(_0x2f9303<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x419d08+=_0x501678[_0x3e1847(0x11b)](_0x49582b+0x9,_0x2f9303),_0x49582b=_0x2f9303+0x3;continue;}if(_0x501678[_0x3e1847(0xf4)]('<?',_0x49582b)){if(_0x4a2a8a)return invalidMybatisSource('XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.');const _0x3df472=_0x501678[_0x3e1847(0xcc)]('?>',_0x49582b+0x2);if(_0x3df472<0x0)return invalidMybatisSource('Unterminated\x20XML\x20declaration.');_0x419d08+='\x20',_0x49582b=_0x3df472+0x2;continue;}if(_0x501678[_0x49582b]!=='<'){const _0x474827=_0x501678['indexOf']('<',_0x49582b),_0xe6f4cc=_0x474827<0x0?_0x501678[_0x3e1847(0x105)]:_0x474827,_0x5f1d31=_0x501678['slice'](_0x49582b,_0xe6f4cc);if((!_0x4a2a8a||_0xa6567d)&&_0x5f1d31[_0x3e1847(0xd5)]())return invalidMybatisSource(_0x3e1847(0xe1));if(_0x4a2a8a&&!_0xa6567d){const _0x5c26b0=decodeXmlEntities(_0x5f1d31);if(_0x5c26b0===null)return invalidMybatisSource('Invalid\x20XML\x20entity\x20reference.');_0x419d08+=_0x5c26b0;}else _0x419d08+='\x20';_0x49582b=_0xe6f4cc;continue;}const _0x413b46=findXmlTagEnd(_0x501678,_0x49582b);if(_0x413b46<0x0)return invalidMybatisSource(_0x3e1847(0xda));const _0x9d4cf4=_0x501678['slice'](_0x49582b,_0x413b46+0x1),_0xc078e9=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/['exec'](_0x9d4cf4);if(!_0xc078e9)return invalidMybatisSource(_0x3e1847(0xdb));const _0x518244=_0xc078e9[0x1]==='/',_0x415625=_0xc078e9[0x2]??'',_0x6ef606=_0x415625['toLowerCase'](),_0x1bcbae=_0xc078e9[0x3]??'',_0x2b432d=_0xc078e9[0x4]==='/',_0x45ead7=MYBATIS_OUTER_TAGS[_0x3e1847(0xf6)](_0x6ef606);if(!_0x45ead7&&!MYBATIS_DYNAMIC_TAGS[_0x3e1847(0xff)](_0x6ef606))return invalidMybatisSource(_0x3e1847(0x115)+_0x6ef606+'>.');if(!_0x45ead7&&_0x415625!==_0x6ef606)return invalidMybatisSource(_0x3e1847(0xcd)+_0x415625+'>.');if(_0x518244){if(_0x1bcbae[_0x3e1847(0xd5)]()||_0x2b432d)return invalidMybatisSource(_0x3e1847(0xf3)+_0x415625+'>.');const _0x11d6e4=_0x3a193b['at'](-0x1);if(!_0x11d6e4||(_0x11d6e4[_0x3e1847(0xd3)]?_0x11d6e4['tagName']!==_0x6ef606:_0x11d6e4[_0x3e1847(0xd2)]!==_0x415625))return invalidMybatisSource(_0x3e1847(0x11a)+_0x415625+'>.');_0x3a193b[_0x3e1847(0xe5)]();if(_0x11d6e4[_0x3e1847(0xd3)])_0xa6567d=!![];_0x419d08+=MYBATIS_BRANCH_TAGS[_0x3e1847(0xff)](_0x6ef606)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x1bcbae))return invalidMybatisSource(_0x3e1847(0x104)+_0x415625+'>.');if(_0x6ef606===_0x3e1847(0xd4)&&(!_0x2b432d||_0x3a193b['at'](-0x1)?.[_0x3e1847(0xd1)]!==_0x3e1847(0xe6)))return invalidMybatisSource(_0x3e1847(0xc7));if(_0x45ead7){if(_0x4a2a8a||_0x3a193b[_0x3e1847(0x105)]>0x0)return invalidMybatisSource(_0x3e1847(0xde));_0x4a2a8a=!![],_0xa6567d=_0x2b432d,_0x30e271=_0x45ead7;}else{if(!_0x4a2a8a||_0xa6567d)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<'+_0x415625+'>.');}_0x419d08+=_0x6ef606===_0x3e1847(0xd9)?_0x3e1847(0xc6):_0x6ef606===_0x3e1847(0x10a)?_0x3e1847(0x106):_0x6ef606==='include'?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x3e1847(0xff)](_0x6ef606)&&!_0x2b432d?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x2b432d&&_0x3a193b[_0x3e1847(0x114)]({'rawName':_0x415625,'tagName':_0x6ef606,'outer':!!_0x45ead7});}_0x49582b=_0x413b46+0x1;}if(_0x3a193b[_0x3e1847(0x105)]>0x0)return invalidMybatisSource(_0x3e1847(0x119)+_0x3a193b['at'](-0x1)?.['rawName']+'>.');if(!_0x4a2a8a||!_0xa6567d)return invalidMybatisSource('MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.');return{'sql':_0x419d08[_0x3e1847(0xd5)](),'mode':'mybatisXml',..._0x30e271?{'statementType':_0x30e271}:{}};}function hasWellFormedXmlAttributes(_0xec673a){const _0x48f774=a237_0x4bf4a2;let _0x561b0c=0x0;const _0x3eba4f=new Set();while(_0x561b0c<_0xec673a[_0x48f774(0x105)]){while(_0x561b0c<_0xec673a[_0x48f774(0x105)]&&/\s/['test'](_0xec673a[_0x561b0c]??''))_0x561b0c+=0x1;if(_0x561b0c>=_0xec673a[_0x48f774(0x105)])return!![];const _0x2aef2b=/^[A-Za-z_:][\w:.-]*/[_0x48f774(0xc4)](_0xec673a[_0x48f774(0x11b)](_0x561b0c)),_0x11886d=_0x2aef2b?.[0x0];if(!_0x11886d||_0x3eba4f[_0x48f774(0xff)](_0x11886d))return![];_0x3eba4f[_0x48f774(0xe3)](_0x11886d),_0x561b0c+=_0x11886d['length'];while(_0x561b0c<_0xec673a['length']&&/\s/[_0x48f774(0xd6)](_0xec673a[_0x561b0c]??''))_0x561b0c+=0x1;if(_0xec673a[_0x561b0c]!=='=')return![];_0x561b0c+=0x1;while(_0x561b0c<_0xec673a[_0x48f774(0x105)]&&/\s/[_0x48f774(0xd6)](_0xec673a[_0x561b0c]??''))_0x561b0c+=0x1;const _0x232924=_0xec673a[_0x561b0c];if(_0x232924!=='\x22'&&_0x232924!=='\x27')return![];_0x561b0c+=0x1;const _0x1daaf7=_0xec673a[_0x48f774(0xcc)](_0x232924,_0x561b0c);if(_0x1daaf7<0x0)return![];if(decodeXmlEntities(_0xec673a['slice'](_0x561b0c,_0x1daaf7))===null)return![];_0x561b0c=_0x1daaf7+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x347b00){const _0x46386e=a237_0x4bf4a2;let _0x29cbd6=0x0;const _0x52ef8e=()=>{const _0x2b9ae2=a237_0x516e;while(_0x29cbd6<_0x347b00[_0x2b9ae2(0x105)]&&/\s/['test'](_0x347b00[_0x29cbd6]??''))_0x29cbd6+=0x1;};_0x52ef8e();while(_0x29cbd6<_0x347b00[_0x46386e(0x105)]){if(_0x347b00[_0x46386e(0xf4)](_0x46386e(0x113),_0x29cbd6)){const _0x53937b=_0x347b00[_0x46386e(0xcc)](_0x46386e(0x118),_0x29cbd6+0x4);if(_0x53937b<0x0)return!![];_0x29cbd6=_0x53937b+0x3,_0x52ef8e();continue;}if(_0x347b00[_0x46386e(0xf4)]('<?',_0x29cbd6)){const _0x42b380=_0x347b00[_0x46386e(0xcc)]('?>',_0x29cbd6+0x2);if(_0x42b380<0x0)return!![];_0x29cbd6=_0x42b380+0x2,_0x52ef8e();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN['test'](_0x347b00[_0x46386e(0x11b)](_0x29cbd6));}function invalidMybatisSource(_0x4372f4){const _0x2529b5=a237_0x4bf4a2;return{'sql':'','mode':_0x2529b5(0xc8),'error':_0x4372f4};}function findXmlTagEnd(_0x366b29,_0x16b53f){const _0x44b077=a237_0x4bf4a2;let _0x5e27d7;for(let _0x3bca66=_0x16b53f+0x1;_0x3bca66<_0x366b29[_0x44b077(0x105)];_0x3bca66+=0x1){const _0x10799b=_0x366b29[_0x3bca66];if(_0x5e27d7){if(_0x10799b===_0x5e27d7)_0x5e27d7=undefined;continue;}if(_0x10799b==='\x22'||_0x10799b==='\x27'){_0x5e27d7=_0x10799b;continue;}if(_0x10799b==='>')return _0x3bca66;}return-0x1;}function decodeXmlEntities(_0x5c2fea){const _0x43257e=a237_0x4bf4a2;let _0x40c317=![];const _0x30287a=_0x5c2fea[_0x43257e(0xe0)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x4b43e0=>{const _0x5f4423=_0x43257e;if(_0x4b43e0==='&lt;')return'<';if(_0x4b43e0===_0x5f4423(0x11c))return'>';if(_0x4b43e0===_0x5f4423(0x10c))return'\x22';if(_0x4b43e0===_0x5f4423(0xc3))return'\x27';if(_0x4b43e0===_0x5f4423(0xdf))return'&';const _0x2c3d5d=/^&#(?:x([0-9a-f]+)|([0-9]+));$/['exec'](_0x4b43e0);if(_0x2c3d5d){const _0x40661f=_0x2c3d5d[0x1],_0x33a1d0=_0x2c3d5d[0x2],_0x400d48=Number['parseInt'](_0x40661f??_0x33a1d0??'',_0x40661f?0x10:0xa);if(isValidXmlCharacter(_0x400d48))return String['fromCodePoint'](_0x400d48);}return _0x40c317=!![],'';});return _0x40c317?null:_0x30287a;}function isValidXmlCharacter(_0x527ad5){return _0x527ad5===0x9||_0x527ad5===0xa||_0x527ad5===0xd||_0x527ad5>=0x20&&_0x527ad5<=0xd7ff||_0x527ad5>=0xe000&&_0x527ad5<=0xfffd||_0x527ad5>=0x10000&&_0x527ad5<=0x10ffff;}export function detectSqlType(_0x3636fe){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x3636fe));}function detectNormalizedSqlType(_0x3aee3a){const _0x32c730=a237_0x4bf4a2;if(_0x3aee3a[_0x32c730(0x11f)])return{'type':_0x32c730(0xd7),'isSelectOnly':![],'isDangerous':![],'reason':_0x3aee3a[_0x32c730(0x11f)]};if(!_0x3aee3a[_0x32c730(0xf2)][_0x32c730(0xd5)]())return{'type':_0x32c730(0xd7),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x5bbc91=stripStaticAnalysisMarkers(_0x3aee3a[_0x32c730(0xf2)])['replace'](/#\{[^}]*\}/g,'?')[_0x32c730(0xe0)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x32c730(0xe0)](/\/\*[\s\S]*?\*\//g,'')['trim'](),_0x53e1f3=_0x5bbc91[_0x32c730(0xe2)]('\x0a');let _0xa3106a='';for(const _0xe6816d of _0x53e1f3){const _0x1b93f7=_0xe6816d[_0x32c730(0xd5)]();if(!_0x1b93f7||_0x1b93f7['startsWith']('--')||_0x1b93f7['startsWith']('/*'))continue;_0xa3106a=_0x1b93f7;break;}const _0x5f13ae=_0xa3106a[_0x32c730(0xe4)](),_0x47f3a9=_0x3aee3a['statementType'],_0x29afea=maskSqlTextForBlockedKeywordScan(_0x5bbc91),_0x1d3fce=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x32c730(0xd6)](_0x29afea);if(_0x47f3a9===_0x32c730(0xcb)||!_0x47f3a9&&(_0x5f13ae[_0x32c730(0xf4)](_0x32c730(0xcb))||_0x5f13ae[_0x32c730(0xf4)](_0x32c730(0xe9)))){const _0x13719e=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x32c730(0xd6)](_0x5bbc91);return{'type':_0x32c730(0xcb),'isSelectOnly':!_0x13719e,'isDangerous':_0x13719e,'reason':_0x13719e?_0x32c730(0xd0):undefined};}if(_0x47f3a9===_0x32c730(0xca)||!_0x47f3a9&&_0x5f13ae[_0x32c730(0xf4)](_0x32c730(0xca)))return{'type':'INSERT','isSelectOnly':![],'isDangerous':_0x1d3fce,'reason':_0x1d3fce?_0x32c730(0xf8):undefined};if(_0x47f3a9===_0x32c730(0xfc)||!_0x47f3a9&&_0x5f13ae[_0x32c730(0xf4)](_0x32c730(0xfc)))return{'type':_0x32c730(0xfc),'isSelectOnly':![],'isDangerous':_0x1d3fce,'reason':_0x1d3fce?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x47f3a9==='DELETE'||!_0x47f3a9&&_0x5f13ae['startsWith'](_0x32c730(0xfd)))return{'type':'DELETE','isSelectOnly':![],'isDangerous':!![],'reason':_0x32c730(0x112)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x32c730(0xd6)](_0x5f13ae))return{'type':_0x32c730(0x10b),'isSelectOnly':![],'isDangerous':!![],'reason':_0x32c730(0xf1)};return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x5a3c86){const _0x5ad04a=a237_0x4bf4a2;return _0x5a3c86['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x5ad04a(0xe7)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x5e623c){const _0x140586=a237_0x4bf4a2;return _0x5e623c[_0x140586(0xe0)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x140586(0xe0)](/"(?:""|\\.|[^"])*"/g,'\x20')['replace'](/`(?:``|\\.|[^`])*`/g,'\x20')['replace'](/--.*$/gm,'\x20')[_0x140586(0xe0)](/#.*$/gm,'\x20')[_0x140586(0xe0)](/\/\*[\s\S]*?\*\//g,'\x20');}function a237_0x1c29(){const _0x291d7d=['match','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','<!--','push','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','unknown\x20table(s)','\x20with\x20parameters:\x20','-->','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','slice','&gt;','<![CDATA[','686373qFqLoS','error','&apos;','exec','choose','\x20WHERE\x20','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','mybatisXml','string','INSERT','SELECT','indexOf','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','join','type','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','tagName','rawName','outer','property','trim','test','UNKNOWN','8oWquDq','where','Unterminated\x20MyBatis\x20XML\x20tag.','Invalid\x20MyBatis\x20XML\x20tag.','from','^<\x5cs*(?:','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','&amp;','replace','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','split','add','toUpperCase','pop','include','replaceAll','matchAll','WITH','Unable\x20to\x20detect\x20SQL\x20type.\x20','264652BCSpjJ','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','reason','isDangerous','insert',']]>','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','sql','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','startsWith','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','get','__RABETBASE_MYBATIS_DYNAMIC_START__','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','keys','update','11417616VRoSNm','UPDATE','DELETE','when','has','7224750LOzPqG','__RABETBASE_MYBATIS_DYNAMIC_END__','1648023VRREuy','select','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','length','\x20SET\x20','delete','foreach','114eOwNcF','set','DDL','&quot;','otherwise','31465620cZPtTd','226212tDjGKx','includes'];a237_0x1c29=function(){return _0x291d7d;};return a237_0x1c29();}function extractTables(_0x2bd71f){const _0x113df2=a237_0x4bf4a2,_0x1c9c1a=_0x2bd71f[_0x113df2(0xe0)](/#\{[^}]*\}/g,'?')[_0x113df2(0xe0)](/\$\{[^}]*\}/g,'?')[_0x113df2(0xe0)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')[_0x113df2(0xe0)](/\/\*[\s\S]*?\*\//g,''),_0x27b5b6=[],_0x3552a9=_0x1c9c1a[_0x113df2(0x111)](/FROM\s+([^\s,)(]+)/i);addTable(_0x27b5b6,_0x3552a9?.[0x1]);for(const _0xbc22a8 of _0x1c9c1a[_0x113df2(0xe8)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x27b5b6,_0xbc22a8[0x1]);}const _0x50c1a6=_0x1c9c1a[_0x113df2(0x111)](/INTO\s+([^\s(]+)/i);addTable(_0x27b5b6,_0x50c1a6?.[0x1]);const _0x5b1c4e=_0x1c9c1a[_0x113df2(0x111)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x27b5b6,_0x5b1c4e?.[0x1]),_0x27b5b6;}function a237_0x516e(_0x9aeeda,_0x1bcf8e){_0x9aeeda=_0x9aeeda-0xc3;const _0x1c2954=a237_0x1c29();let _0x516e19=_0x1c2954[_0x9aeeda];return _0x516e19;}function addTable(_0x369d12,_0x5d7302){const _0x115c71=a237_0x4bf4a2,_0x5ec1a2=_0x5d7302?.[_0x115c71(0xe0)](/[`"]/g,'');_0x5ec1a2&&_0x5ec1a2!==UNRESOLVED_SQL_FRAGMENT&&!_0x369d12[_0x115c71(0x110)](_0x5ec1a2)&&_0x369d12[_0x115c71(0x114)](_0x5ec1a2);}function extractParameters(_0x51c861){const _0x8eff03=a237_0x4bf4a2,_0x470ce0=new Set();for(const _0x568674 of _0x51c861[_0x8eff03(0xe8)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x568674[0x1])_0x470ce0['add'](_0x568674[0x1]);}return Array[_0x8eff03(0xdc)](_0x470ce0);}export function validateSql(_0x47f224){const _0x5bbf3d=a237_0x4bf4a2,_0x5cd3d0=normalizeSqlForStaticAnalysis(_0x47f224),_0x34f4bd=detectNormalizedSqlType(_0x5cd3d0),_0x21b6cf=stripStaticAnalysisMarkers(_0x5cd3d0[_0x5bbf3d(0xf2)]),_0x3f54cc=_0x5cd3d0['error']?[]:extractTables(_0x21b6cf),_0x4220eb=_0x5cd3d0[_0x5bbf3d(0x11f)]?[]:extractParameters(_0x21b6cf);if(_0x34f4bd[_0x5bbf3d(0xee)])return{'valid':![],'sqlType':_0x34f4bd,'tables':_0x3f54cc,'parameters':_0x4220eb,'message':_0x34f4bd[_0x5bbf3d(0xed)]||_0x34f4bd['type']+_0x5bbf3d(0xec)};if(_0x34f4bd['type']===_0x5bbf3d(0xd7))return{'valid':![],'sqlType':_0x34f4bd,'tables':_0x3f54cc,'parameters':_0x4220eb,'message':_0x5cd3d0['error']?_0x5bbf3d(0xea)+_0x5cd3d0[_0x5bbf3d(0x11f)]:'Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'};return{'valid':!![],'sqlType':_0x34f4bd,'tables':_0x3f54cc,'parameters':_0x4220eb,'message':_0x34f4bd[_0x5bbf3d(0xcf)]+'\x20query\x20targeting\x20'+(_0x3f54cc[_0x5bbf3d(0x105)]?_0x3f54cc[_0x5bbf3d(0xce)](',\x20'):_0x5bbf3d(0x116))+(_0x4220eb['length']?_0x5bbf3d(0x117)+_0x4220eb[_0x5bbf3d(0xce)](',\x20'):'')};}
1
+ const a245_0xb0bce7=a245_0x20e2;(function(_0x183541,_0x1aa795){const _0x3d8247=a245_0x20e2,_0x17e939=_0x183541();while(!![]){try{const _0x4516d5=-parseInt(_0x3d8247(0x156))/0x1+parseInt(_0x3d8247(0x17a))/0x2+parseInt(_0x3d8247(0x15a))/0x3*(parseInt(_0x3d8247(0x149))/0x4)+parseInt(_0x3d8247(0x145))/0x5+-parseInt(_0x3d8247(0x160))/0x6+parseInt(_0x3d8247(0x17b))/0x7*(parseInt(_0x3d8247(0x146))/0x8)+-parseInt(_0x3d8247(0x153))/0x9*(-parseInt(_0x3d8247(0x191))/0xa);if(_0x4516d5===_0x1aa795)break;else _0x17e939['push'](_0x17e939['shift']());}catch(_0x559f90){_0x17e939['push'](_0x17e939['shift']());}}}(a245_0x2860,0xac60a));const MYBATIS_OUTER_TAGS=new Map([[a245_0xb0bce7(0x180),a245_0xb0bce7(0x164)],[a245_0xb0bce7(0x142),'INSERT'],['update',a245_0xb0bce7(0x157)],['delete',a245_0xb0bce7(0x168)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a245_0xb0bce7(0x198),'foreach','choose',a245_0xb0bce7(0x15d),a245_0xb0bce7(0x17f),'trim',a245_0xb0bce7(0x143),a245_0xb0bce7(0x182),a245_0xb0bce7(0x17c),a245_0xb0bce7(0x155)]),MYBATIS_BRANCH_TAGS=new Set(['if',a245_0xb0bce7(0x177),a245_0xb0bce7(0x181),'when',a245_0xb0bce7(0x17f)]);export const MYBATIS_DYNAMIC_START_MARKER=a245_0xb0bce7(0x18b);export const MYBATIS_DYNAMIC_END_MARKER='__RABETBASE_MYBATIS_DYNAMIC_END__';function a245_0x20e2(_0x21a10a,_0x504881){_0x21a10a=_0x21a10a-0x141;const _0x2860ab=a245_0x2860();let _0x20e2d8=_0x2860ab[_0x21a10a];return _0x20e2d8;}export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT=a245_0xb0bce7(0x176),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a245_0xb0bce7(0x18a)+[...MYBATIS_OUTER_TAGS[a245_0xb0bce7(0x14f)]()][a245_0xb0bce7(0x172)]('|')+')\x5cb','i');export function normalizeSqlForStaticAnalysis(_0x1e4dd9){const _0x39e61b=a245_0xb0bce7,_0x243cb0=typeof _0x1e4dd9===_0x39e61b(0x163)?_0x1e4dd9:'';if(!startsWithMybatisStatementWrapper(_0x243cb0))return{'sql':_0x243cb0,'mode':'sql'};let _0x24cbec=0x0,_0x415c41='',_0x1aadee,_0x4aa199=![],_0x522506=![];const _0x373199=[];while(_0x24cbec<_0x243cb0['length']){if(_0x243cb0[_0x39e61b(0x170)](_0x39e61b(0x19d),_0x24cbec)){const _0x3a14e3=_0x243cb0[_0x39e61b(0x16c)](_0x39e61b(0x16d),_0x24cbec+0x4);if(_0x3a14e3<0x0)return invalidMybatisSource(_0x39e61b(0x14a));_0x415c41+='\x20',_0x24cbec=_0x3a14e3+0x3;continue;}if(_0x243cb0[_0x39e61b(0x170)](_0x39e61b(0x166),_0x24cbec)){if(!_0x4aa199||_0x522506)return invalidMybatisSource(_0x39e61b(0x152));const _0x2f25b2=_0x243cb0[_0x39e61b(0x16c)](_0x39e61b(0x184),_0x24cbec+0x9);if(_0x2f25b2<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x415c41+=_0x243cb0[_0x39e61b(0x183)](_0x24cbec+0x9,_0x2f25b2),_0x24cbec=_0x2f25b2+0x3;continue;}if(_0x243cb0[_0x39e61b(0x170)]('<?',_0x24cbec)){if(_0x4aa199)return invalidMybatisSource(_0x39e61b(0x14e));const _0x2b8eac=_0x243cb0[_0x39e61b(0x16c)]('?>',_0x24cbec+0x2);if(_0x2b8eac<0x0)return invalidMybatisSource(_0x39e61b(0x19b));_0x415c41+='\x20',_0x24cbec=_0x2b8eac+0x2;continue;}if(_0x243cb0[_0x24cbec]!=='<'){const _0x44bd56=_0x243cb0[_0x39e61b(0x16c)]('<',_0x24cbec),_0x3b5154=_0x44bd56<0x0?_0x243cb0['length']:_0x44bd56,_0x347da8=_0x243cb0[_0x39e61b(0x183)](_0x24cbec,_0x3b5154);if((!_0x4aa199||_0x522506)&&_0x347da8[_0x39e61b(0x141)]())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x4aa199&&!_0x522506){const _0x5a48f6=decodeXmlEntities(_0x347da8);if(_0x5a48f6===null)return invalidMybatisSource(_0x39e61b(0x18d));_0x415c41+=_0x5a48f6;}else _0x415c41+='\x20';_0x24cbec=_0x3b5154;continue;}const _0x1e4e56=findXmlTagEnd(_0x243cb0,_0x24cbec);if(_0x1e4e56<0x0)return invalidMybatisSource(_0x39e61b(0x15e));const _0x7c1168=_0x243cb0[_0x39e61b(0x183)](_0x24cbec,_0x1e4e56+0x1),_0x1842bb=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x39e61b(0x175)](_0x7c1168);if(!_0x1842bb)return invalidMybatisSource(_0x39e61b(0x194));const _0xfd02c0=_0x1842bb[0x1]==='/',_0xb1ddd0=_0x1842bb[0x2]??'',_0x3790d3=_0xb1ddd0[_0x39e61b(0x14b)](),_0x42be3e=_0x1842bb[0x3]??'',_0x184b45=_0x1842bb[0x4]==='/',_0x16f5b8=MYBATIS_OUTER_TAGS[_0x39e61b(0x165)](_0x3790d3);if(!_0x16f5b8&&!MYBATIS_DYNAMIC_TAGS[_0x39e61b(0x192)](_0x3790d3))return invalidMybatisSource(_0x39e61b(0x18e)+_0x3790d3+'>.');if(!_0x16f5b8&&_0xb1ddd0!==_0x3790d3)return invalidMybatisSource(_0x39e61b(0x16a)+_0xb1ddd0+'>.');if(_0xfd02c0){if(_0x42be3e['trim']()||_0x184b45)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0xb1ddd0+'>.');const _0x421a03=_0x373199['at'](-0x1);if(!_0x421a03||(_0x421a03[_0x39e61b(0x18c)]?_0x421a03['tagName']!==_0x3790d3:_0x421a03['rawName']!==_0xb1ddd0))return invalidMybatisSource(_0x39e61b(0x19c)+_0xb1ddd0+'>.');_0x373199['pop']();if(_0x421a03[_0x39e61b(0x18c)])_0x522506=!![];_0x415c41+=MYBATIS_BRANCH_TAGS[_0x39e61b(0x192)](_0x3790d3)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x42be3e))return invalidMybatisSource(_0x39e61b(0x193)+_0xb1ddd0+'>.');if(_0x3790d3===_0x39e61b(0x155)&&(!_0x184b45||_0x373199['at'](-0x1)?.['tagName']!=='include'))return invalidMybatisSource(_0x39e61b(0x14c));if(_0x16f5b8){if(_0x4aa199||_0x373199['length']>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x4aa199=!![],_0x522506=_0x184b45,_0x1aadee=_0x16f5b8;}else{if(!_0x4aa199||_0x522506)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<'+_0xb1ddd0+'>.');}_0x415c41+=_0x3790d3===_0x39e61b(0x198)?_0x39e61b(0x14d):_0x3790d3===_0x39e61b(0x143)?_0x39e61b(0x15b):_0x3790d3===_0x39e61b(0x17c)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x39e61b(0x192)](_0x3790d3)&&!_0x184b45?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x184b45&&_0x373199[_0x39e61b(0x189)]({'rawName':_0xb1ddd0,'tagName':_0x3790d3,'outer':!!_0x16f5b8});}_0x24cbec=_0x1e4e56+0x1;}if(_0x373199[_0x39e61b(0x178)]>0x0)return invalidMybatisSource(_0x39e61b(0x161)+_0x373199['at'](-0x1)?.[_0x39e61b(0x18f)]+'>.');if(!_0x4aa199||!_0x522506)return invalidMybatisSource('MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.');return{'sql':_0x415c41[_0x39e61b(0x141)](),'mode':_0x39e61b(0x196),..._0x1aadee?{'statementType':_0x1aadee}:{}};}function hasWellFormedXmlAttributes(_0x4dddb2){const _0x4efc10=a245_0xb0bce7;let _0x2142fa=0x0;const _0xc52330=new Set();while(_0x2142fa<_0x4dddb2[_0x4efc10(0x178)]){while(_0x2142fa<_0x4dddb2[_0x4efc10(0x178)]&&/\s/[_0x4efc10(0x190)](_0x4dddb2[_0x2142fa]??''))_0x2142fa+=0x1;if(_0x2142fa>=_0x4dddb2['length'])return!![];const _0x126e7f=/^[A-Za-z_:][\w:.-]*/[_0x4efc10(0x175)](_0x4dddb2[_0x4efc10(0x183)](_0x2142fa)),_0x59c726=_0x126e7f?.[0x0];if(!_0x59c726||_0xc52330[_0x4efc10(0x192)](_0x59c726))return![];_0xc52330[_0x4efc10(0x188)](_0x59c726),_0x2142fa+=_0x59c726['length'];while(_0x2142fa<_0x4dddb2[_0x4efc10(0x178)]&&/\s/['test'](_0x4dddb2[_0x2142fa]??''))_0x2142fa+=0x1;if(_0x4dddb2[_0x2142fa]!=='=')return![];_0x2142fa+=0x1;while(_0x2142fa<_0x4dddb2[_0x4efc10(0x178)]&&/\s/[_0x4efc10(0x190)](_0x4dddb2[_0x2142fa]??''))_0x2142fa+=0x1;const _0x5371f1=_0x4dddb2[_0x2142fa];if(_0x5371f1!=='\x22'&&_0x5371f1!=='\x27')return![];_0x2142fa+=0x1;const _0x1c39dc=_0x4dddb2[_0x4efc10(0x16c)](_0x5371f1,_0x2142fa);if(_0x1c39dc<0x0)return![];if(decodeXmlEntities(_0x4dddb2[_0x4efc10(0x183)](_0x2142fa,_0x1c39dc))===null)return![];_0x2142fa=_0x1c39dc+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x55df47){const _0x4c5347=a245_0xb0bce7;let _0x828687=0x0;const _0x2988c7=()=>{while(_0x828687<_0x55df47['length']&&/\s/['test'](_0x55df47[_0x828687]??''))_0x828687+=0x1;};_0x2988c7();while(_0x828687<_0x55df47[_0x4c5347(0x178)]){if(_0x55df47[_0x4c5347(0x170)](_0x4c5347(0x19d),_0x828687)){const _0x3dfd14=_0x55df47[_0x4c5347(0x16c)](_0x4c5347(0x16d),_0x828687+0x4);if(_0x3dfd14<0x0)return!![];_0x828687=_0x3dfd14+0x3,_0x2988c7();continue;}if(_0x55df47[_0x4c5347(0x170)]('<?',_0x828687)){const _0xdb257c=_0x55df47[_0x4c5347(0x16c)]('?>',_0x828687+0x2);if(_0xdb257c<0x0)return!![];_0x828687=_0xdb257c+0x2,_0x2988c7();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x4c5347(0x190)](_0x55df47[_0x4c5347(0x183)](_0x828687));}function invalidMybatisSource(_0xe60576){const _0x3011b0=a245_0xb0bce7;return{'sql':'','mode':_0x3011b0(0x196),'error':_0xe60576};}function findXmlTagEnd(_0x319100,_0x10c19a){const _0x357035=a245_0xb0bce7;let _0x42d70b;for(let _0x573b2b=_0x10c19a+0x1;_0x573b2b<_0x319100[_0x357035(0x178)];_0x573b2b+=0x1){const _0x39de55=_0x319100[_0x573b2b];if(_0x42d70b){if(_0x39de55===_0x42d70b)_0x42d70b=undefined;continue;}if(_0x39de55==='\x22'||_0x39de55==='\x27'){_0x42d70b=_0x39de55;continue;}if(_0x39de55==='>')return _0x573b2b;}return-0x1;}function decodeXmlEntities(_0x1dab68){const _0x61614d=a245_0xb0bce7;let _0x4fd5eb=![];const _0x2511c7=_0x1dab68[_0x61614d(0x174)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x36fe73=>{const _0x18d76b=_0x61614d;if(_0x36fe73==='&lt;')return'<';if(_0x36fe73==='&gt;')return'>';if(_0x36fe73===_0x18d76b(0x171))return'\x22';if(_0x36fe73===_0x18d76b(0x150))return'\x27';if(_0x36fe73===_0x18d76b(0x15f))return'&';const _0x26a663=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x18d76b(0x175)](_0x36fe73);if(_0x26a663){const _0x4347f4=_0x26a663[0x1],_0x585c03=_0x26a663[0x2],_0x5c79c4=Number[_0x18d76b(0x17d)](_0x4347f4??_0x585c03??'',_0x4347f4?0x10:0xa);if(isValidXmlCharacter(_0x5c79c4))return String['fromCodePoint'](_0x5c79c4);}return _0x4fd5eb=!![],'';});return _0x4fd5eb?null:_0x2511c7;}function isValidXmlCharacter(_0x537ef2){return _0x537ef2===0x9||_0x537ef2===0xa||_0x537ef2===0xd||_0x537ef2>=0x20&&_0x537ef2<=0xd7ff||_0x537ef2>=0xe000&&_0x537ef2<=0xfffd||_0x537ef2>=0x10000&&_0x537ef2<=0x10ffff;}export function detectSqlType(_0x1e0e67){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x1e0e67));}function detectNormalizedSqlType(_0x12070c){const _0x39a056=a245_0xb0bce7;if(_0x12070c[_0x39a056(0x158)])return{'type':_0x39a056(0x16b),'isSelectOnly':![],'isDangerous':![],'reason':_0x12070c['error']};if(!_0x12070c[_0x39a056(0x151)]['trim']())return{'type':_0x39a056(0x16b),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x26137a=stripStaticAnalysisMarkers(_0x12070c[_0x39a056(0x151)])['replace'](/#\{[^}]*\}/g,'?')[_0x39a056(0x174)](/\$\{[^}]*\}/g,'?')[_0x39a056(0x174)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x39a056(0x174)](/\/\*[\s\S]*?\*\//g,'')[_0x39a056(0x141)](),_0x16c932=_0x26137a[_0x39a056(0x195)]('\x0a');let _0x5694f6='';for(const _0x2e0503 of _0x16c932){const _0x27591d=_0x2e0503[_0x39a056(0x141)]();if(!_0x27591d||_0x27591d[_0x39a056(0x170)]('--')||_0x27591d[_0x39a056(0x170)]('/*'))continue;_0x5694f6=_0x27591d;break;}const _0x4b073f=_0x5694f6[_0x39a056(0x16f)](),_0x5a5925=_0x12070c['statementType'],_0x55c8ca=maskSqlTextForBlockedKeywordScan(_0x26137a),_0x1bacd4=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i['test'](_0x55c8ca);if(_0x5a5925==='SELECT'||!_0x5a5925&&(_0x4b073f[_0x39a056(0x170)](_0x39a056(0x164))||_0x4b073f[_0x39a056(0x170)](_0x39a056(0x15c)))){const _0x2a7f39=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x39a056(0x190)](_0x26137a);return{'type':_0x39a056(0x164),'isSelectOnly':!_0x2a7f39,'isDangerous':_0x2a7f39,'reason':_0x2a7f39?_0x39a056(0x187):undefined};}if(_0x5a5925===_0x39a056(0x186)||!_0x5a5925&&_0x4b073f['startsWith'](_0x39a056(0x186)))return{'type':_0x39a056(0x186),'isSelectOnly':![],'isDangerous':_0x1bacd4,'reason':_0x1bacd4?_0x39a056(0x162):undefined};if(_0x5a5925===_0x39a056(0x157)||!_0x5a5925&&_0x4b073f['startsWith'](_0x39a056(0x157)))return{'type':_0x39a056(0x157),'isSelectOnly':![],'isDangerous':_0x1bacd4,'reason':_0x1bacd4?_0x39a056(0x162):undefined};if(_0x5a5925===_0x39a056(0x168)||!_0x5a5925&&_0x4b073f['startsWith'](_0x39a056(0x168)))return{'type':_0x39a056(0x168),'isSelectOnly':![],'isDangerous':!![],'reason':_0x39a056(0x16e)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x39a056(0x190)](_0x4b073f))return{'type':_0x39a056(0x173),'isSelectOnly':![],'isDangerous':!![],'reason':_0x39a056(0x199)};return{'type':_0x39a056(0x16b),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x3fcfb6){const _0xf60fc7=a245_0xb0bce7;return _0x3fcfb6[_0xf60fc7(0x169)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0xf60fc7(0x169)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x35680e){const _0xd24a02=a245_0xb0bce7;return _0x35680e[_0xd24a02(0x174)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0xd24a02(0x174)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0xd24a02(0x174)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0xd24a02(0x174)](/--.*$/gm,'\x20')[_0xd24a02(0x174)](/#.*$/gm,'\x20')[_0xd24a02(0x174)](/\/\*[\s\S]*?\*\//g,'\x20');}function a245_0x2860(){const _0xbe34ab=['DDL','replace','exec','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','foreach','length','\x20query\x20targeting\x20','6782TNJYkP','1540oukJJs','include','parseInt','unknown\x20table(s)','otherwise','select','choose','bind','slice',']]>','type','INSERT','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','add','push','^<\x5cs*(?:','__RABETBASE_MYBATIS_DYNAMIC_START__','outer','Invalid\x20XML\x20entity\x20reference.','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','rawName','test','4750810sSsjRN','has','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','Invalid\x20MyBatis\x20XML\x20tag.','split','mybatisXml','\x20with\x20parameters:\x20','where','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','isDangerous','Unterminated\x20XML\x20declaration.','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','<!--','trim','insert','set','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','5501155xAhdvb','3288cRKjtm','matchAll','from','8mtmbzX','Unterminated\x20XML\x20comment.','toLowerCase','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','\x20WHERE\x20','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','keys','&apos;','sql','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','9Zacjdy','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','property','223853qFzIEn','UPDATE','error','match','772041IRKdeh','\x20SET\x20','WITH','when','Unterminated\x20MyBatis\x20XML\x20tag.','&amp;','7523436NAgDOg','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','string','SELECT','get','<![CDATA[','reason','DELETE','replaceAll','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','UNKNOWN','indexOf','-->','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','toUpperCase','startsWith','&quot;','join'];a245_0x2860=function(){return _0xbe34ab;};return a245_0x2860();}function extractTables(_0x5491d3){const _0x458b43=a245_0xb0bce7,_0x53fbe5=_0x5491d3[_0x458b43(0x174)](/#\{[^}]*\}/g,'?')[_0x458b43(0x174)](/\$\{[^}]*\}/g,'?')[_0x458b43(0x174)](/'[^']*'/g,'\x27\x27')[_0x458b43(0x174)](/--.*$/gm,'')[_0x458b43(0x174)](/\/\*[\s\S]*?\*\//g,''),_0x3a3427=[],_0x1a9bea=_0x53fbe5['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0x3a3427,_0x1a9bea?.[0x1]);for(const _0x32ac3b of _0x53fbe5[_0x458b43(0x147)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x3a3427,_0x32ac3b[0x1]);}const _0x13c496=_0x53fbe5[_0x458b43(0x159)](/INTO\s+([^\s(]+)/i);addTable(_0x3a3427,_0x13c496?.[0x1]);const _0x3e60f1=_0x53fbe5[_0x458b43(0x159)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x3a3427,_0x3e60f1?.[0x1]),_0x3a3427;}function addTable(_0x26cace,_0x48b6f1){const _0x1c0dab=a245_0xb0bce7,_0x4db355=_0x48b6f1?.['replace'](/[`"]/g,'');_0x4db355&&_0x4db355!==UNRESOLVED_SQL_FRAGMENT&&!_0x26cace['includes'](_0x4db355)&&_0x26cace[_0x1c0dab(0x189)](_0x4db355);}function extractParameters(_0x3d094a){const _0x43fdec=a245_0xb0bce7,_0xe1e42d=new Set();for(const _0x49ea52 of _0x3d094a[_0x43fdec(0x147)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x49ea52[0x1])_0xe1e42d['add'](_0x49ea52[0x1]);}return Array[_0x43fdec(0x148)](_0xe1e42d);}export function validateSql(_0x3f2932){const _0x2f6114=a245_0xb0bce7,_0x4b8134=normalizeSqlForStaticAnalysis(_0x3f2932),_0x4a7893=detectNormalizedSqlType(_0x4b8134),_0x542bb9=stripStaticAnalysisMarkers(_0x4b8134['sql']),_0x31b815=_0x4b8134[_0x2f6114(0x158)]?[]:extractTables(_0x542bb9),_0x1dce48=_0x4b8134[_0x2f6114(0x158)]?[]:extractParameters(_0x542bb9);if(_0x4a7893[_0x2f6114(0x19a)])return{'valid':![],'sqlType':_0x4a7893,'tables':_0x31b815,'parameters':_0x1dce48,'message':_0x4a7893[_0x2f6114(0x167)]||_0x4a7893[_0x2f6114(0x185)]+_0x2f6114(0x154)};if(_0x4a7893[_0x2f6114(0x185)]===_0x2f6114(0x16b))return{'valid':![],'sqlType':_0x4a7893,'tables':_0x31b815,'parameters':_0x1dce48,'message':_0x4b8134[_0x2f6114(0x158)]?'Unable\x20to\x20detect\x20SQL\x20type.\x20'+_0x4b8134[_0x2f6114(0x158)]:_0x2f6114(0x144)};return{'valid':!![],'sqlType':_0x4a7893,'tables':_0x31b815,'parameters':_0x1dce48,'message':_0x4a7893[_0x2f6114(0x185)]+_0x2f6114(0x179)+(_0x31b815[_0x2f6114(0x178)]?_0x31b815[_0x2f6114(0x172)](',\x20'):_0x2f6114(0x17e))+(_0x1dce48[_0x2f6114(0x178)]?_0x2f6114(0x197)+_0x1dce48[_0x2f6114(0x172)](',\x20'):'')};}
package/lib/errors.js CHANGED
@@ -1 +1 @@
1
- function a238_0x19d8(_0x161055,_0x2d4d7c){_0x161055=_0x161055-0x1b0;const _0x30e524=a238_0x30e5();let _0x19d84a=_0x30e524[_0x161055];return _0x19d84a;}const a238_0x21e061=a238_0x19d8;(function(_0x29c237,_0x622ea7){const _0x20f0fa=a238_0x19d8,_0x4dfecc=_0x29c237();while(!![]){try{const _0x29b930=-parseInt(_0x20f0fa(0x1bf))/0x1+-parseInt(_0x20f0fa(0x1b0))/0x2*(-parseInt(_0x20f0fa(0x1bc))/0x3)+-parseInt(_0x20f0fa(0x1b2))/0x4+parseInt(_0x20f0fa(0x1b7))/0x5*(parseInt(_0x20f0fa(0x1b4))/0x6)+-parseInt(_0x20f0fa(0x1bb))/0x7*(parseInt(_0x20f0fa(0x1b9))/0x8)+parseInt(_0x20f0fa(0x1b1))/0x9+parseInt(_0x20f0fa(0x1b5))/0xa;if(_0x29b930===_0x622ea7)break;else _0x4dfecc['push'](_0x4dfecc['shift']());}catch(_0x5c8008){_0x4dfecc['push'](_0x4dfecc['shift']());}}}(a238_0x30e5,0x241e8));function a238_0x30e5(){const _0x4a67e3=['4844230qXExjX','Tip:\x20`','25ZMFWsc','\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.','8TXvwbD','\x20auth`\x20to\x20login\x20first.','1937593VwCpWD','45iLqtXo','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','251399DzdUdC','26434SXnRZp','1911546PSkXcb','1056780HdfcHe','\x0a\x20\x20\x20\x20\x20\x20\x20','54318tTqBeM'];a238_0x30e5=function(){return _0x4a67e3;};return a238_0x30e5();}import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';export{CliError};export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':'Run\x20`'+CLI_BIN_NAME+a238_0x21e061(0x1ba),'configMissingHint':['Set\x20appcode\x20via\x20`'+CLI_BIN_NAME+a238_0x21e061(0x1be),a238_0x21e061(0x1b6)+CLI_BIN_NAME+a238_0x21e061(0x1b8)]['join'](a238_0x21e061(0x1b3)),'notInProjectHint':a238_0x21e061(0x1bd)});
1
+ const a246_0x1113a0=a246_0x1f64;function a246_0x1f64(_0x3ce27c,_0xeaf62c){_0x3ce27c=_0x3ce27c-0xc1;const _0x4b8454=a246_0x4b84();let _0x1f6466=_0x4b8454[_0x3ce27c];return _0x1f6466;}(function(_0x34ef23,_0x5b0667){const _0x2f2c52=a246_0x1f64,_0x3c5016=_0x34ef23();while(!![]){try{const _0x5e8a7a=-parseInt(_0x2f2c52(0xc5))/0x1+-parseInt(_0x2f2c52(0xce))/0x2*(parseInt(_0x2f2c52(0xcb))/0x3)+-parseInt(_0x2f2c52(0xc1))/0x4+-parseInt(_0x2f2c52(0xc7))/0x5*(-parseInt(_0x2f2c52(0xc8))/0x6)+-parseInt(_0x2f2c52(0xc6))/0x7+parseInt(_0x2f2c52(0xcc))/0x8*(-parseInt(_0x2f2c52(0xc3))/0x9)+parseInt(_0x2f2c52(0xc9))/0xa;if(_0x5e8a7a===_0x5b0667)break;else _0x3c5016['push'](_0x3c5016['shift']());}catch(_0xedb581){_0x3c5016['push'](_0x3c5016['shift']());}}}(a246_0x4b84,0x57c68));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';export{CliError};function a246_0x4b84(){const _0x309a9d=['2EXaGSt','Set\x20appcode\x20via\x20`','649212DqJntD','Tip:\x20`','3042fWKNup','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','70869pQyPMA','3492951ohYzQE','609955Dgarqx','6wtbYha','16267040RUVytP','\x0a\x20\x20\x20\x20\x20\x20\x20','1531944yOwgNU','3464jsXmxK','Run\x20`'];a246_0x4b84=function(){return _0x309a9d;};return a246_0x4b84();}export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a246_0x1113a0(0xcd)+CLI_BIN_NAME+'\x20auth`\x20to\x20login\x20first.','configMissingHint':[a246_0x1113a0(0xcf)+CLI_BIN_NAME+a246_0x1113a0(0xc4),a246_0x1113a0(0xc2)+CLI_BIN_NAME+'\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.']['join'](a246_0x1113a0(0xca)),'notInProjectHint':'Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.'});
@@ -1 +1 @@
1
- (function(_0x40dbd5,_0x3268c6){const _0x13b3ab=a239_0xfb35,_0x20d910=_0x40dbd5();while(!![]){try{const _0x562f86=parseInt(_0x13b3ab(0x1b5))/0x1+-parseInt(_0x13b3ab(0x1ba))/0x2+parseInt(_0x13b3ab(0x1b9))/0x3*(-parseInt(_0x13b3ab(0x1b8))/0x4)+-parseInt(_0x13b3ab(0x1b6))/0x5*(parseInt(_0x13b3ab(0x1bd))/0x6)+parseInt(_0x13b3ab(0x1b4))/0x7+-parseInt(_0x13b3ab(0x1b7))/0x8+-parseInt(_0x13b3ab(0x1b3))/0x9*(-parseInt(_0x13b3ab(0x1bc))/0xa);if(_0x562f86===_0x3268c6)break;else _0x20d910['push'](_0x20d910['shift']());}catch(_0x3f31c2){_0x20d910['push'](_0x20d910['shift']());}}}(a239_0x1d2d,0xdd6df));function a239_0x1d2d(){const _0x403777=['18nkVLKk','9cSqLSy','8745926YEShlX','779229jzZfdm','371695rxvKCC','10353016TjgHlY','4jKbeiW','1975965tpwNkm','1743210wkNkxX','map','19257320UyeTBs'];a239_0x1d2d=function(){return _0x403777;};return a239_0x1d2d();}function a239_0xfb35(_0x258eec,_0x4d6044){_0x258eec=_0x258eec-0x1b3;const _0x1d2d6c=a239_0x1d2d();let _0xfb35e7=_0x1d2d6c[_0x258eec];return _0xfb35e7;}import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a239_0xf54895}from'@lovrabet/cli-framework';import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';export function buildAllFlags(_0x488db6){const _0x59a6f9=a239_0xfb35,_0x2c80b8=a239_0xf54895(_0x488db6,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0x488db6))return _0x2c80b8;return _0x2c80b8[_0x59a6f9(0x1bb)](_0x2a325e=>_0x2a325e['name']==='yes'?{..._0x2a325e,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0x2a325e);}
1
+ function a247_0x436f(_0x611121,_0x3bbf43){_0x611121=_0x611121-0x9b;const _0x818966=a247_0x8189();let _0x436f9e=_0x818966[_0x611121];return _0x436f9e;}(function(_0x1ca66a,_0x46101f){const _0x19d1bf=a247_0x436f,_0x1ff7ed=_0x1ca66a();while(!![]){try{const _0x2c0293=-parseInt(_0x19d1bf(0xa7))/0x1*(parseInt(_0x19d1bf(0xa3))/0x2)+parseInt(_0x19d1bf(0x9c))/0x3*(-parseInt(_0x19d1bf(0xa4))/0x4)+parseInt(_0x19d1bf(0x9e))/0x5*(-parseInt(_0x19d1bf(0x9f))/0x6)+parseInt(_0x19d1bf(0x9d))/0x7*(parseInt(_0x19d1bf(0xa6))/0x8)+-parseInt(_0x19d1bf(0xa5))/0x9+parseInt(_0x19d1bf(0xa1))/0xa+-parseInt(_0x19d1bf(0xa2))/0xb*(-parseInt(_0x19d1bf(0xa0))/0xc);if(_0x2c0293===_0x46101f)break;else _0x1ff7ed['push'](_0x1ff7ed['shift']());}catch(_0x1e26a0){_0x1ff7ed['push'](_0x1ff7ed['shift']());}}}(a247_0x8189,0x4cd58));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a247_0x186aa6}from'@lovrabet/cli-framework';function a247_0x8189(){const _0xb19b8c=['5BXRcBp','461010WxBMhD','12fpzXgB','4187390qtZsWe','8103733Zghash','264668TkepMf','1141716flTxFU','3701313ZneDjp','4168EIkUWH','4AkEjAm','map','name','3ubCUQR','6209esmEwb'];a247_0x8189=function(){return _0xb19b8c;};return a247_0x8189();}import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';export function buildAllFlags(_0x1a590d){const _0x54f3d6=a247_0x436f,_0x3ca4fc=a247_0x186aa6(_0x1a590d,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0x1a590d))return _0x3ca4fc;return _0x3ca4fc[_0x54f3d6(0xa8)](_0xec526a=>_0xec526a[_0x54f3d6(0x9b)]==='yes'?{..._0xec526a,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0xec526a);}