@lovrabet/rabetbase-cli 2.4.5 → 2.4.6-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/README.md +3 -2
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/business-groups.js +1 -1
  63. package/lib/commands/dataset/capability.js +1 -1
  64. package/lib/commands/dataset/delete.js +1 -1
  65. package/lib/commands/dataset/detail.js +1 -1
  66. package/lib/commands/dataset/extend-update.js +1 -1
  67. package/lib/commands/dataset/field-update.js +1 -1
  68. package/lib/commands/dataset/generate.js +1 -1
  69. package/lib/commands/dataset/index.js +1 -1
  70. package/lib/commands/dataset/list.js +1 -1
  71. package/lib/commands/dataset/operations.js +1 -1
  72. package/lib/commands/dataset/relation-audit.js +1 -1
  73. package/lib/commands/dataset/relation-create.js +1 -1
  74. package/lib/commands/dataset/relation-delete.js +1 -1
  75. package/lib/commands/dataset/relation-shared.js +1 -1
  76. package/lib/commands/dataset/relation-update.js +1 -1
  77. package/lib/commands/dataset/relations.js +1 -1
  78. package/lib/commands/dataset/rename.js +1 -1
  79. package/lib/commands/dataset/restore.js +1 -1
  80. package/lib/commands/db/analysis-batching.js +1 -1
  81. package/lib/commands/db/analyze-batch-plan.js +1 -1
  82. package/lib/commands/db/analyze-cancel.js +1 -1
  83. package/lib/commands/db/analyze-start.js +1 -1
  84. package/lib/commands/db/analyze-status.js +1 -1
  85. package/lib/commands/db/create.js +1 -1
  86. package/lib/commands/db/delete.js +1 -1
  87. package/lib/commands/db/detail.js +1 -1
  88. package/lib/commands/db/diff-refresh-start.js +1 -1
  89. package/lib/commands/db/diff-refresh-status.js +1 -1
  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.js +1 -1
  137. package/lib/commands/notification/config-delete.js +1 -1
  138. package/lib/commands/notification/config-list.js +1 -1
  139. package/lib/commands/notification/config-update.js +1 -1
  140. package/lib/commands/notification/index.js +1 -1
  141. package/lib/commands/notification/shared.js +1 -1
  142. package/lib/commands/ocr/index.js +1 -1
  143. package/lib/commands/page/{standard-page-status.d.ts → create.d.ts} +1 -1
  144. package/lib/commands/page/create.js +1 -0
  145. package/lib/commands/page/{react → custom}/detail.d.ts +1 -1
  146. package/lib/commands/page/custom/detail.js +1 -0
  147. package/lib/commands/page/{react → custom}/list.d.ts +1 -1
  148. package/lib/commands/page/custom/list.js +1 -0
  149. package/lib/commands/page/{react → custom}/publish.d.ts +1 -1
  150. package/lib/commands/page/custom/publish.js +1 -0
  151. package/lib/commands/page/{react → custom}/shared.d.ts +15 -15
  152. package/lib/commands/page/custom/shared.js +1 -0
  153. package/lib/commands/page/{react → custom}/syntax.d.ts +2 -2
  154. package/lib/commands/page/custom/syntax.js +1 -0
  155. package/lib/commands/page/custom/template.js +1 -0
  156. package/lib/commands/page/{react → custom}/update.d.ts +1 -1
  157. package/lib/commands/page/custom/update.js +1 -0
  158. package/lib/commands/page/data-list-status.d.ts +2 -0
  159. package/lib/commands/page/data-list-status.js +1 -0
  160. package/lib/commands/page/generate-start.js +1 -1
  161. package/lib/commands/page/generate-status.js +1 -1
  162. package/lib/commands/page/index.js +1 -1
  163. package/lib/commands/page/pull.js +1 -1
  164. package/lib/commands/page/push.js +1 -1
  165. package/lib/commands/page/relation-audit.js +1 -1
  166. package/lib/commands/page/restore.js +1 -1
  167. package/lib/commands/page/shared.d.ts +18 -18
  168. package/lib/commands/page/shared.js +1 -1
  169. package/lib/commands/page/sync.js +1 -1
  170. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  171. package/lib/commands/project/create/format-elapsed.js +1 -1
  172. package/lib/commands/project/create/main.js +1 -1
  173. package/lib/commands/project/create/materialize-project-template.js +1 -1
  174. package/lib/commands/project/create/project-name.js +1 -1
  175. package/lib/commands/project/create/project-template-archive.js +1 -1
  176. package/lib/commands/project/create/project-template-path.js +1 -1
  177. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  178. package/lib/commands/project/create/use-format-code.js +1 -1
  179. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  180. package/lib/commands/project/index.js +1 -1
  181. package/lib/commands/project/upgrade.js +1 -1
  182. package/lib/commands/registry.js +1 -1
  183. package/lib/commands/role/delete.js +1 -1
  184. package/lib/commands/role/detail.js +1 -1
  185. package/lib/commands/role/index.js +1 -1
  186. package/lib/commands/role/list.js +1 -1
  187. package/lib/commands/role/shared.js +1 -1
  188. package/lib/commands/role/update.js +1 -1
  189. package/lib/commands/role/user-add.js +1 -1
  190. package/lib/commands/role/user-remove.js +1 -1
  191. package/lib/commands/role/user-resolve.js +1 -1
  192. package/lib/commands/run/index.js +1 -1
  193. package/lib/commands/schema.js +1 -1
  194. package/lib/commands/sql/create.js +1 -1
  195. package/lib/commands/sql/delete.js +1 -1
  196. package/lib/commands/sql/detail.js +1 -1
  197. package/lib/commands/sql/exec.js +1 -1
  198. package/lib/commands/sql/index.js +1 -1
  199. package/lib/commands/sql/list.js +1 -1
  200. package/lib/commands/sql/pull.js +1 -1
  201. package/lib/commands/sql/push.js +1 -1
  202. package/lib/commands/sql/shared.js +1 -1
  203. package/lib/commands/sql/status.js +1 -1
  204. package/lib/commands/sql/validate.js +1 -1
  205. package/lib/commands/task/index.js +1 -1
  206. package/lib/commands/task/status.js +1 -1
  207. package/lib/commands/tenant/index.js +1 -1
  208. package/lib/commands/tenant/members-list.js +1 -1
  209. package/lib/commands/tenant/shared.js +1 -1
  210. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  211. package/lib/commands/user-account/index.js +1 -1
  212. package/lib/commands/workspace/add.js +1 -1
  213. package/lib/commands/workspace/index.js +1 -1
  214. package/lib/commands/workspace/remove.js +1 -1
  215. package/lib/config/schema.js +1 -1
  216. package/lib/constant/cdn.js +1 -1
  217. package/lib/constant/cli.js +1 -1
  218. package/lib/constant/defaults.js +1 -1
  219. package/lib/constant/domain.js +1 -1
  220. package/lib/constant/env.js +1 -1
  221. package/lib/constant/output.js +1 -1
  222. package/lib/constant/paths.js +1 -1
  223. package/lib/constant/risk.js +1 -1
  224. package/lib/context/app-resolver.js +1 -1
  225. package/lib/context/auth-resolver.js +1 -1
  226. package/lib/context/config-loader.js +1 -1
  227. package/lib/context.js +1 -1
  228. package/lib/core/alias-resolver.js +1 -1
  229. package/lib/core/api-client.d.ts +43 -43
  230. package/lib/core/api-client.js +1 -1
  231. package/lib/core/bff/config.js +1 -1
  232. package/lib/core/bff/file-system.js +1 -1
  233. package/lib/core/bff/hash.js +1 -1
  234. package/lib/core/bff/lock.js +1 -1
  235. package/lib/core/bff/utils.d.ts +3 -1
  236. package/lib/core/bff/utils.js +1 -1
  237. package/lib/core/db-resolver.js +1 -1
  238. package/lib/core/page/file-system.js +1 -1
  239. package/lib/core/page/hash.js +1 -1
  240. package/lib/core/page/lock.js +1 -1
  241. package/lib/core/sql-index-auditor.js +1 -1
  242. package/lib/core/sql-sync/config.js +1 -1
  243. package/lib/core/sql-sync/file-system.js +1 -1
  244. package/lib/core/sql-sync/hash.js +1 -1
  245. package/lib/core/sql-sync/lock.js +1 -1
  246. package/lib/core/sql-sync/utils.js +1 -1
  247. package/lib/core/sql-validator.js +1 -1
  248. package/lib/errors.js +1 -1
  249. package/lib/framework/build-all-flags.js +1 -1
  250. package/lib/framework/error-output.js +1 -1
  251. package/lib/framework/explicit-yes.js +1 -1
  252. package/lib/framework/flags.js +1 -1
  253. package/lib/framework/help.js +1 -1
  254. package/lib/framework/index.js +1 -1
  255. package/lib/framework/output.js +1 -1
  256. package/lib/framework/response.js +1 -1
  257. package/lib/framework/runner-alias.js +1 -1
  258. package/lib/framework/runner.js +1 -1
  259. package/lib/framework/schema-export.js +1 -1
  260. package/lib/framework/types.js +1 -1
  261. package/lib/generated/build-info.d.ts +4 -4
  262. package/lib/generated/build-info.js +1 -1
  263. package/lib/help.js +1 -1
  264. package/lib/postinstall.js +1 -1
  265. package/lib/runtime/confirmation.js +1 -1
  266. package/lib/runtime/event.js +1 -1
  267. package/lib/runtime/index.js +1 -1
  268. package/lib/runtime/queue.js +1 -1
  269. package/lib/runtime/resolve.js +1 -1
  270. package/lib/skills/builtin-skill.js +1 -1
  271. package/lib/skills/main.js +1 -1
  272. package/lib/skills/npx-skills-add.js +1 -1
  273. package/lib/skills/skill-presence.js +1 -1
  274. package/lib/telemetry/cli-command-trace.js +1 -1
  275. package/lib/telemetry/cli-help-trace.js +1 -1
  276. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  277. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  278. package/lib/telemetry/send-cli-trace-log.js +1 -1
  279. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  280. package/lib/utils/ai_config.js +1 -1
  281. package/lib/utils/apply-jq-filter.js +1 -1
  282. package/lib/utils/cdn-config.js +1 -1
  283. package/lib/utils/check-sdk-version.js +1 -1
  284. package/lib/utils/cli-version-check.js +1 -1
  285. package/lib/utils/cli-version-policy.js +1 -1
  286. package/lib/utils/config.js +1 -1
  287. package/lib/utils/entity-with-id.js +1 -1
  288. package/lib/utils/file-utils.js +1 -1
  289. package/lib/utils/guides-cdn.js +1 -1
  290. package/lib/utils/http-client.js +1 -1
  291. package/lib/utils/is-non-interactive.js +1 -1
  292. package/lib/utils/logger.js +1 -1
  293. package/lib/utils/params.js +1 -1
  294. package/lib/utils/platform.js +1 -1
  295. package/lib/utils/rules-cdn.js +1 -1
  296. package/lib/utils/sleep.js +1 -1
  297. package/lib/utils/template-replacer.js +1 -1
  298. package/lib/utils/update-notice.js +1 -1
  299. package/lib/utils/version.js +1 -1
  300. package/lib/utils/with-active-cookie.js +1 -1
  301. package/lib/utils/write-cli-side-channel.js +1 -1
  302. package/package.json +1 -1
  303. package/skills/rabetbase/SKILL.md +34 -34
  304. package/skills/rabetbase/guides/backend-function.md +63 -18
  305. package/skills/rabetbase/guides/bff-creation-workflow.md +2 -0
  306. package/skills/rabetbase/guides/{react-custom-page-workflow.md → custom-page-workflow.md} +45 -45
  307. package/skills/rabetbase/guides/page-development-workflow.md +22 -22
  308. package/skills/rabetbase/knowledge/{react-page → custom-page}/components.md +2 -2
  309. package/skills/rabetbase/knowledge/{react-page → custom-page}/generation-standards.md +6 -6
  310. package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +6 -6
  311. package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +1 -1
  312. package/skills/rabetbase/references/rabetbase-bff-create.md +2 -0
  313. package/skills/rabetbase/references/{rabetbase-standard-page-status.md → rabetbase-data-list-status.md} +6 -6
  314. package/skills/rabetbase/references/rabetbase-dataset-generate.md +1 -1
  315. package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +1 -1
  316. package/skills/rabetbase/references/rabetbase-dataset-relations.md +1 -1
  317. package/skills/rabetbase/references/rabetbase-dataset-restore.md +1 -1
  318. package/skills/rabetbase/references/rabetbase-menu-list.md +1 -1
  319. package/skills/rabetbase/references/rabetbase-page-create.md +31 -0
  320. package/skills/rabetbase/references/{rabetbase-page-react-detail.md → rabetbase-page-custom-detail.md} +5 -5
  321. package/skills/rabetbase/references/{rabetbase-page-react-list.md → rabetbase-page-custom-list.md} +4 -4
  322. package/skills/rabetbase/references/{rabetbase-page-react-publish.md → rabetbase-page-custom-publish.md} +6 -6
  323. package/skills/rabetbase/references/{rabetbase-page-react-update.md → rabetbase-page-custom-update.md} +6 -6
  324. package/skills/rabetbase/references/rabetbase-page-generate-start.md +5 -4
  325. package/skills/rabetbase/references/rabetbase-page-generate-status.md +4 -4
  326. package/skills/rabetbase/references/rabetbase-page-pull.md +2 -2
  327. package/skills/rabetbase/references/rabetbase-page-relation-binding.md +1 -1
  328. package/skills/rabetbase/references/rabetbase-page-restore.md +7 -7
  329. package/skills/rabetbase/references/rabetbase-page-sync.md +3 -3
  330. package/skills/rabetbase.manifest.json +12 -12
  331. package/lib/commands/page/react/create.d.ts +0 -2
  332. package/lib/commands/page/react/create.js +0 -1
  333. package/lib/commands/page/react/detail.js +0 -1
  334. package/lib/commands/page/react/list.js +0 -1
  335. package/lib/commands/page/react/publish.js +0 -1
  336. package/lib/commands/page/react/shared.js +0 -1
  337. package/lib/commands/page/react/syntax.js +0 -1
  338. package/lib/commands/page/react/template.js +0 -1
  339. package/lib/commands/page/react/update.js +0 -1
  340. package/lib/commands/page/standard-page-status.js +0 -1
  341. package/skills/rabetbase/references/rabetbase-page-react-create.md +0 -29
  342. /package/lib/commands/page/{react → custom}/template.d.ts +0 -0
@@ -1 +1 @@
1
- const a221_0x203318=a221_0x1bcc;(function(_0xb39d62,_0x3ee2b0){const _0x1f8d6a=a221_0x1bcc,_0x339c14=_0xb39d62();while(!![]){try{const _0x4b67a8=parseInt(_0x1f8d6a(0x11e))/0x1+parseInt(_0x1f8d6a(0x106))/0x2*(-parseInt(_0x1f8d6a(0xfe))/0x3)+parseInt(_0x1f8d6a(0xfd))/0x4*(parseInt(_0x1f8d6a(0x115))/0x5)+parseInt(_0x1f8d6a(0x120))/0x6*(parseInt(_0x1f8d6a(0x101))/0x7)+-parseInt(_0x1f8d6a(0x124))/0x8+-parseInt(_0x1f8d6a(0xff))/0x9+-parseInt(_0x1f8d6a(0x119))/0xa;if(_0x4b67a8===_0x3ee2b0)break;else _0x339c14['push'](_0x339c14['shift']());}catch(_0x4bc2d4){_0x339c14['push'](_0x339c14['shift']());}}}(a221_0x155c,0x2cf4b));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join,resolve,sep}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a221_0x203318(0x128),'ENDPOINT',a221_0x203318(0x112)];export function normalizeBffType(_0x2da9f9){const _0x52e88b=a221_0x203318;if(!_0x2da9f9)return undefined;const _0x19ce83=_0x2da9f9['trim']()[_0x52e88b(0x10d)]();return SUPPORTED_BFF_TYPES[_0x52e88b(0x11d)](_0x19ce83)?_0x19ce83:undefined;}function a221_0x155c(){const _0x3ecd69=['code','505200PvOyeO','datasetCode','split','every','includes','226489pnsmlX','scriptsRootDir','1469406IvXDFz','before','ENOENT','startsWith','1263064czdyZK','get','replace','all','COMMON','1592MWedSR','57999JzfhDa','653103MCvolY','alias','7EXLjrH','HOOK/','functionName','push','isDirectory','34qFxisS','Unsafe\x20BFF\x20lock\x20key\x20(traversal\x20or\x20invalid\x20segment):\x20','ENDPOINT','isFile','scriptType','beforeScriptId','afterScriptId','toUpperCase','Resolved\x20BFF\x20script\x20path\x20escapes\x20scripts\x20root:\x20','operationType','after','.js','HOOK','name','functionNode','4050CPPdgM','set','endsWith'];a221_0x155c=function(){return _0x3ecd69;};return a221_0x155c();}async function scanJsFilesRecursively(_0x24c0df,_0x2dd45c){const _0x5c3233=a221_0x203318,_0x4d11c2=[];try{const _0x1ac065=await readdir(_0x24c0df,{'withFileTypes':!![]});for(const _0x5588b1 of _0x1ac065){const _0x39b33e=join(_0x24c0df,_0x5588b1[_0x5c3233(0x113)]);if(_0x5588b1[_0x5c3233(0x105)]())_0x4d11c2['push'](...await scanJsFilesRecursively(_0x39b33e,_0x2dd45c+'/'+_0x5588b1[_0x5c3233(0x113)]));else _0x5588b1['isFile']()&&_0x5588b1[_0x5c3233(0x113)][_0x5c3233(0x117)]('.js')&&_0x4d11c2[_0x5c3233(0x104)]({'lockKey':_0x2dd45c+'/'+_0x5588b1[_0x5c3233(0x113)][_0x5c3233(0x126)](/\.js$/,''),'filePath':_0x39b33e});}}catch(_0x2cc2cd){if(_0x2cc2cd[_0x5c3233(0x118)]!==_0x5c3233(0x122))throw _0x2cc2cd;}return _0x4d11c2;}async function scanFlatFunctions(_0x2b56f0,_0x12d84c){const _0x20825c=a221_0x203318,_0x56999a=join(_0x2b56f0['scriptsRootDir'],_0x12d84c),_0x99dce0=await scanJsFilesRecursively(_0x56999a,_0x12d84c);return _0x99dce0['map'](({lockKey:_0xc7f621,filePath:_0x1c3ebd})=>({'type':_0x12d84c,'name':_0xc7f621[_0x20825c(0x11b)]('/')['at'](-0x1)??'','filePath':_0x1c3ebd,'lockKey':_0xc7f621}));}async function scanHookFunctions(_0x463e83){const _0x155c26=a221_0x203318,_0x4a8448=join(_0x463e83[_0x155c26(0x11f)],_0x155c26(0x112)),_0x5bd62d=[];try{const _0x2dc84d=await readdir(_0x4a8448,{'withFileTypes':!![]});for(const _0x17f1b0 of _0x2dc84d){if(!_0x17f1b0[_0x155c26(0x105)]())continue;const _0xcdc628=_0x17f1b0[_0x155c26(0x113)],_0x4b7897=join(_0x4a8448,_0xcdc628),_0x130f54=await readdir(_0x4b7897,{'withFileTypes':!![]});for(const _0x5925ae of _0x130f54){if(!_0x5925ae[_0x155c26(0x105)]())continue;const _0x3f9fad=_0x5925ae[_0x155c26(0x113)],_0x44121b=join(_0x4b7897,_0x3f9fad),_0x5c49ed=await readdir(_0x44121b,{'withFileTypes':!![]});for(const _0x3bc473 of _0x5c49ed){if(!_0x3bc473[_0x155c26(0x105)]())continue;const _0x53398e=_0x3bc473[_0x155c26(0x113)],_0x133a82=join(_0x44121b,_0x53398e),_0x2b8ac6=await readdir(_0x133a82,{'withFileTypes':!![]});for(const _0x529c80 of _0x2b8ac6){if(!_0x529c80[_0x155c26(0x109)]()||!_0x529c80[_0x155c26(0x113)][_0x155c26(0x117)](_0x155c26(0x111)))continue;const _0x5ddd91=_0x529c80['name'][_0x155c26(0x126)](/\.js$/,'');_0x5bd62d['push']({'type':_0x155c26(0x112),'name':_0x5ddd91,'filePath':join(_0x133a82,_0x529c80[_0x155c26(0x113)]),'lockKey':'HOOK/'+_0xcdc628+'/'+_0x3f9fad+'/'+_0x53398e+'/'+_0x5ddd91,'alias':_0xcdc628,'operationType':_0x3f9fad,'functionNode':_0x53398e});}}}}}catch(_0xbd22d6){if(_0xbd22d6[_0x155c26(0x118)]!=='ENOENT')throw _0xbd22d6;}return _0x5bd62d;}export async function scanLocalBffFunctions(_0x28260f,_0xa20083){const _0x2a086d=a221_0x203318;if(_0xa20083==='COMMON'||_0xa20083===_0x2a086d(0x108))return scanFlatFunctions(_0x28260f,_0xa20083);if(_0xa20083==='HOOK')return scanHookFunctions(_0x28260f);const [_0x383042,_0x9c9a8,_0x391cd9]=await Promise[_0x2a086d(0x127)]([scanFlatFunctions(_0x28260f,_0x2a086d(0x128)),scanFlatFunctions(_0x28260f,'ENDPOINT'),scanHookFunctions(_0x28260f)]);return[..._0x383042,..._0x9c9a8,..._0x391cd9];}const SAFE_LOCK_KEY_SEGMENT=/^[A-Za-z0-9_$.-]+$/;export function isSafeLockKeySegment(_0x183167){return SAFE_LOCK_KEY_SEGMENT['test'](_0x183167)&&_0x183167!=='.'&&_0x183167!=='..';}export function resolveLocalFilePathFromLockKey(_0x16f8c9,_0x32944b){const _0xcd059c=a221_0x203318,_0x189e13=_0x32944b['split']('/');if(!_0x189e13[_0xcd059c(0x11c)](isSafeLockKeySegment))throw new Error(_0xcd059c(0x107)+_0x32944b);const _0x2f049a=resolve(join(_0x16f8c9[_0xcd059c(0x11f)],..._0x189e13)+_0xcd059c(0x111)),_0x40b686=resolve(_0x16f8c9[_0xcd059c(0x11f)]);if(_0x2f049a!==_0x40b686&&!_0x2f049a[_0xcd059c(0x123)](_0x40b686+sep))throw new Error(_0xcd059c(0x10e)+_0x2f049a);return _0x2f049a;}export function createHookLocationMap(_0x3c78c2){const _0x4b8fef=a221_0x203318,_0x4e6905=new Map();for(const _0x400574 of _0x3c78c2){_0x400574['beforeScriptId']&&_0x4e6905[_0x4b8fef(0x116)](_0x400574[_0x4b8fef(0x10b)],{'datasetCode':_0x400574[_0x4b8fef(0x11a)],'operationType':snakeToCamel(_0x400574[_0x4b8fef(0x10f)]),'functionNode':_0x4b8fef(0x121)}),_0x400574[_0x4b8fef(0x10c)]&&_0x4e6905[_0x4b8fef(0x116)](_0x400574[_0x4b8fef(0x10c)],{'datasetCode':_0x400574[_0x4b8fef(0x11a)],'operationType':snakeToCamel(_0x400574['operationType']),'functionNode':_0x4b8fef(0x110)});}return _0x4e6905;}function a221_0x1bcc(_0x177347,_0x104e92){_0x177347=_0x177347-0xfd;const _0x155c38=a221_0x155c();let _0x1bccd4=_0x155c38[_0x177347];return _0x1bccd4;}export function resolveRemoteScriptTarget(_0x2a5dd4,_0x36fa4f,_0x5cb2e1,_0x5b5dcf,_0x56e45c){const _0x282afb=a221_0x203318,_0x4b0493=normalizeBffType(_0x36fa4f[_0x282afb(0x10a)]);if(!_0x4b0493||!_0x36fa4f[_0x282afb(0x103)])return null;if(_0x4b0493===_0x282afb(0x112)){const _0x2c10ae=(_0x36fa4f['id']?_0x5cb2e1[_0x282afb(0x125)](_0x36fa4f['id']):undefined)??findHookLocationByRemoteId(_0x5b5dcf,_0x36fa4f['id']);if(!_0x2c10ae)return null;const _0x19aec0=_0x2c10ae[_0x282afb(0x100)]||_0x56e45c['get'](_0x2c10ae[_0x282afb(0x11a)]),_0x78470d=_0x19aec0??_0x2c10ae[_0x282afb(0x11a)],_0x9677f8={..._0x2c10ae,'alias':_0x19aec0},_0x4cb3bb=_0x282afb(0x102)+_0x78470d+'/'+_0x9677f8['operationType']+'/'+_0x9677f8[_0x282afb(0x114)]+'/'+_0x36fa4f[_0x282afb(0x103)];if(!_0x4cb3bb['split']('/')['every'](isSafeLockKeySegment))return null;return{'lockKey':_0x4cb3bb,'filePath':resolveLocalFilePathFromLockKey(_0x2a5dd4,_0x4cb3bb),'type':_0x282afb(0x112),'hookLocation':_0x9677f8};}const _0xf9c726=_0x4b0493+'/'+_0x36fa4f[_0x282afb(0x103)];if(!_0xf9c726['split']('/')['every'](isSafeLockKeySegment))return null;return{'lockKey':_0xf9c726,'filePath':resolveLocalFilePathFromLockKey(_0x2a5dd4,_0xf9c726),'type':_0x4b0493};}export async function ensureParentDirectory(_0x26ec31){await mkdir(dirname(_0x26ec31),{'recursive':!![]});}export async function fileExists(_0x56c3a7){try{return await access(_0x56c3a7,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0xd2f893){const _0x3621e1=a221_0x203318;try{const _0x214ae3=await stat(_0xd2f893);return _0x214ae3[_0x3621e1(0x105)]();}catch{return![];}}
1
+ const a221_0x35dbe1=a221_0x3eab;function a221_0x3eab(_0x153c96,_0x477606){_0x153c96=_0x153c96-0xf1;const _0x50460a=a221_0x5046();let _0x3eab13=_0x50460a[_0x153c96];return _0x3eab13;}(function(_0x58f813,_0x263233){const _0x552798=a221_0x3eab,_0x4df036=_0x58f813();while(!![]){try{const _0x21a6c4=parseInt(_0x552798(0xfe))/0x1*(-parseInt(_0x552798(0xf9))/0x2)+parseInt(_0x552798(0xfb))/0x3+parseInt(_0x552798(0x10e))/0x4+parseInt(_0x552798(0xfd))/0x5+parseInt(_0x552798(0x116))/0x6+parseInt(_0x552798(0x10b))/0x7*(-parseInt(_0x552798(0x10a))/0x8)+-parseInt(_0x552798(0xf2))/0x9*(parseInt(_0x552798(0x119))/0xa);if(_0x21a6c4===_0x263233)break;else _0x4df036['push'](_0x4df036['shift']());}catch(_0x1ed33f){_0x4df036['push'](_0x4df036['shift']());}}}(a221_0x5046,0x2dd8e));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join,resolve,sep}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a221_0x35dbe1(0xf7),a221_0x35dbe1(0xf4),a221_0x35dbe1(0x112)];export function normalizeBffType(_0x400526){const _0x14e5c0=a221_0x35dbe1;if(!_0x400526)return undefined;const _0x502183=_0x400526['trim']()[_0x14e5c0(0x111)]();return SUPPORTED_BFF_TYPES[_0x14e5c0(0x10f)](_0x502183)?_0x502183:undefined;}async function scanJsFilesRecursively(_0x2d8b4c,_0x329bb2){const _0x58dbe1=a221_0x35dbe1,_0x1638a3=[];try{const _0x4732a5=await readdir(_0x2d8b4c,{'withFileTypes':!![]});for(const _0xd28cdb of _0x4732a5){const _0x5986cd=join(_0x2d8b4c,_0xd28cdb[_0x58dbe1(0x102)]);if(_0xd28cdb[_0x58dbe1(0x108)]())_0x1638a3[_0x58dbe1(0x11e)](...await scanJsFilesRecursively(_0x5986cd,_0x329bb2+'/'+_0xd28cdb[_0x58dbe1(0x102)]));else _0xd28cdb['isFile']()&&_0xd28cdb['name']['endsWith']('.js')&&_0x1638a3[_0x58dbe1(0x11e)]({'lockKey':_0x329bb2+'/'+_0xd28cdb[_0x58dbe1(0x102)][_0x58dbe1(0x11a)](/\.js$/,''),'filePath':_0x5986cd});}}catch(_0x377540){if(_0x377540['code']!==_0x58dbe1(0x106))throw _0x377540;}return _0x1638a3;}async function scanFlatFunctions(_0x4c5b08,_0xca4ae5){const _0x1d2c2a=a221_0x35dbe1,_0x2a669b=join(_0x4c5b08[_0x1d2c2a(0x10d)],_0xca4ae5),_0x43dd72=await scanJsFilesRecursively(_0x2a669b,_0xca4ae5);return _0x43dd72[_0x1d2c2a(0x114)](({lockKey:_0x2cfb7d,filePath:_0x2641f5})=>({'type':_0xca4ae5,'name':_0x2cfb7d[_0x1d2c2a(0x11c)]('/')['at'](-0x1)??'','filePath':_0x2641f5,'lockKey':_0x2cfb7d}));}async function scanHookFunctions(_0x42a6fc){const _0x3edf1c=a221_0x35dbe1,_0x45410c=join(_0x42a6fc[_0x3edf1c(0x10d)],_0x3edf1c(0x112)),_0x2783d4=[];try{const _0x3441e5=await readdir(_0x45410c,{'withFileTypes':!![]});for(const _0x28ce05 of _0x3441e5){if(!_0x28ce05[_0x3edf1c(0x108)]())continue;const _0x447039=_0x28ce05['name'],_0x330872=join(_0x45410c,_0x447039),_0x84c4e4=await readdir(_0x330872,{'withFileTypes':!![]});for(const _0x728a7d of _0x84c4e4){if(!_0x728a7d['isDirectory']())continue;const _0x54cbeb=_0x728a7d[_0x3edf1c(0x102)],_0x5067e2=join(_0x330872,_0x54cbeb),_0xa9f72c=await readdir(_0x5067e2,{'withFileTypes':!![]});for(const _0x1cafa4 of _0xa9f72c){if(!_0x1cafa4['isDirectory']())continue;const _0xa57ff7=_0x1cafa4[_0x3edf1c(0x102)],_0x4cabb2=join(_0x5067e2,_0xa57ff7),_0x2c18b2=await readdir(_0x4cabb2,{'withFileTypes':!![]});for(const _0x30138c of _0x2c18b2){if(!_0x30138c[_0x3edf1c(0x110)]()||!_0x30138c[_0x3edf1c(0x102)][_0x3edf1c(0xf8)](_0x3edf1c(0x104)))continue;const _0x125bdc=_0x30138c['name'][_0x3edf1c(0x11a)](/\.js$/,'');_0x2783d4[_0x3edf1c(0x11e)]({'type':_0x3edf1c(0x112),'name':_0x125bdc,'filePath':join(_0x4cabb2,_0x30138c[_0x3edf1c(0x102)]),'lockKey':_0x3edf1c(0x105)+_0x447039+'/'+_0x54cbeb+'/'+_0xa57ff7+'/'+_0x125bdc,'alias':_0x447039,'operationType':_0x54cbeb,'functionNode':_0xa57ff7});}}}}}catch(_0x1f155b){if(_0x1f155b[_0x3edf1c(0x11d)]!==_0x3edf1c(0x106))throw _0x1f155b;}return _0x2783d4;}export async function scanLocalBffFunctions(_0x11eca2,_0x31a80a){const _0x10c3e9=a221_0x35dbe1;if(_0x31a80a===_0x10c3e9(0xf7)||_0x31a80a===_0x10c3e9(0xf4))return scanFlatFunctions(_0x11eca2,_0x31a80a);if(_0x31a80a===_0x10c3e9(0x112))return scanHookFunctions(_0x11eca2);const [_0x2f11ef,_0x75e7,_0x1311ac]=await Promise[_0x10c3e9(0xf3)]([scanFlatFunctions(_0x11eca2,_0x10c3e9(0xf7)),scanFlatFunctions(_0x11eca2,'ENDPOINT'),scanHookFunctions(_0x11eca2)]);return[..._0x2f11ef,..._0x75e7,..._0x1311ac];}function a221_0x5046(){const _0x236a21=['isDirectory','Unsafe\x20BFF\x20lock\x20key\x20(traversal\x20or\x20invalid\x20segment):\x20','16DbvOLd','962899hvRJyn','alias','scriptsRootDir','1325880EkEdhg','includes','isFile','toUpperCase','HOOK','every','map','after','969306IYNZhu','set','functionNode','11090UeaTYD','replace','test','split','code','push','Resolved\x20BFF\x20script\x20path\x20escapes\x20scripts\x20root:\x20','5076vWfykh','all','ENDPOINT','startsWith','functionName','COMMON','endsWith','4ZeiYkW','F_OK','1043745sMNAyP','get','1598710wANtYT','36149bFhMlN','before','afterScriptId','operationType','name','beforeScriptId','.js','HOOK/','ENOENT','datasetCode'];a221_0x5046=function(){return _0x236a21;};return a221_0x5046();}const SAFE_LOCK_KEY_SEGMENT=/^[A-Za-z0-9_$.-]+$/;export function isSafeLockKeySegment(_0x3d7a14){const _0x29cdd0=a221_0x35dbe1;return SAFE_LOCK_KEY_SEGMENT[_0x29cdd0(0x11b)](_0x3d7a14)&&_0x3d7a14!=='.'&&_0x3d7a14!=='..';}export function resolveLocalFilePathFromLockKey(_0x400c7c,_0xb5d9ee){const _0x308a7d=a221_0x35dbe1,_0x58d556=_0xb5d9ee[_0x308a7d(0x11c)]('/');if(!_0x58d556[_0x308a7d(0x113)](isSafeLockKeySegment))throw new Error(_0x308a7d(0x109)+_0xb5d9ee);const _0x37f29f=resolve(join(_0x400c7c[_0x308a7d(0x10d)],..._0x58d556)+_0x308a7d(0x104)),_0x555e8c=resolve(_0x400c7c[_0x308a7d(0x10d)]);if(_0x37f29f!==_0x555e8c&&!_0x37f29f[_0x308a7d(0xf5)](_0x555e8c+sep))throw new Error(_0x308a7d(0xf1)+_0x37f29f);return _0x37f29f;}export function createHookLocationMap(_0x105570){const _0x4d62c9=a221_0x35dbe1,_0x1cf8f4=new Map();for(const _0x4671b8 of _0x105570){_0x4671b8[_0x4d62c9(0x103)]&&_0x1cf8f4[_0x4d62c9(0x117)](_0x4671b8[_0x4d62c9(0x103)],{'datasetCode':_0x4671b8['datasetCode'],'operationType':snakeToCamel(_0x4671b8[_0x4d62c9(0x101)]),'functionNode':_0x4d62c9(0xff)}),_0x4671b8[_0x4d62c9(0x100)]&&_0x1cf8f4[_0x4d62c9(0x117)](_0x4671b8[_0x4d62c9(0x100)],{'datasetCode':_0x4671b8['datasetCode'],'operationType':snakeToCamel(_0x4671b8[_0x4d62c9(0x101)]),'functionNode':_0x4d62c9(0x115)});}return _0x1cf8f4;}export function resolveRemoteScriptTarget(_0x59bbd9,_0x5a96cb,_0x265ddd,_0x761e14,_0xe64aa7){const _0x18ede6=a221_0x35dbe1,_0x4d9652=normalizeBffType(_0x5a96cb['scriptType']);if(!_0x4d9652||!_0x5a96cb['functionName'])return null;if(_0x4d9652===_0x18ede6(0x112)){const _0x4e80bf=(_0x5a96cb['id']?_0x265ddd[_0x18ede6(0xfc)](_0x5a96cb['id']):undefined)??findHookLocationByRemoteId(_0x761e14,_0x5a96cb['id']);if(!_0x4e80bf)return null;const _0x1f50da=_0x4e80bf[_0x18ede6(0x10c)]||_0xe64aa7[_0x18ede6(0xfc)](_0x4e80bf[_0x18ede6(0x107)]),_0x47891f=_0x1f50da??_0x4e80bf[_0x18ede6(0x107)],_0x8fe02={..._0x4e80bf,'alias':_0x1f50da},_0x4d9381=_0x18ede6(0x105)+_0x47891f+'/'+_0x8fe02['operationType']+'/'+_0x8fe02[_0x18ede6(0x118)]+'/'+_0x5a96cb[_0x18ede6(0xf6)];if(!_0x4d9381[_0x18ede6(0x11c)]('/')[_0x18ede6(0x113)](isSafeLockKeySegment))return null;return{'lockKey':_0x4d9381,'filePath':resolveLocalFilePathFromLockKey(_0x59bbd9,_0x4d9381),'type':'HOOK','hookLocation':_0x8fe02};}const _0x321576=_0x4d9652+'/'+_0x5a96cb[_0x18ede6(0xf6)];if(!_0x321576[_0x18ede6(0x11c)]('/')[_0x18ede6(0x113)](isSafeLockKeySegment))return null;return{'lockKey':_0x321576,'filePath':resolveLocalFilePathFromLockKey(_0x59bbd9,_0x321576),'type':_0x4d9652};}export async function ensureParentDirectory(_0x449d3d){await mkdir(dirname(_0x449d3d),{'recursive':!![]});}export async function fileExists(_0x1c6404){const _0x4e8697=a221_0x35dbe1;try{return await access(_0x1c6404,constants[_0x4e8697(0xfa)]),!![];}catch{return![];}}export async function directoryExists(_0x4e183c){try{const _0x2502aa=await stat(_0x4e183c);return _0x2502aa['isDirectory']();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x37e0eb,_0xbf9598){const _0xb2c8=a222_0x48e8,_0x42301f=_0x37e0eb();while(!![]){try{const _0x46d049=-parseInt(_0xb2c8(0x1a5))/0x1*(-parseInt(_0xb2c8(0x1ab))/0x2)+-parseInt(_0xb2c8(0x1a1))/0x3*(parseInt(_0xb2c8(0x1a3))/0x4)+parseInt(_0xb2c8(0x19e))/0x5+-parseInt(_0xb2c8(0x1a2))/0x6+parseInt(_0xb2c8(0x19d))/0x7*(-parseInt(_0xb2c8(0x1a0))/0x8)+parseInt(_0xb2c8(0x19f))/0x9*(parseInt(_0xb2c8(0x1a6))/0xa)+parseInt(_0xb2c8(0x1ac))/0xb;if(_0x46d049===_0xbf9598)break;else _0x42301f['push'](_0x42301f['shift']());}catch(_0x145d3c){_0x42301f['push'](_0x42301f['shift']());}}}(a222_0x2a22,0x3e091));import{readFile}from'node:fs/promises';import a222_0x2458bf from'node:crypto';function a222_0x48e8(_0x197a36,_0x2dd4b7){_0x197a36=_0x197a36-0x19d;const _0x2a2277=a222_0x2a22();let _0x48e8ba=_0x2a2277[_0x197a36];return _0x48e8ba;}function a222_0x2a22(){const _0x3ac793=['hex','67694fSxTzA','3607472zcFmlo','59493KEDoxJ','1804750CMTXuv','17991tiLWSv','216AwGtCA','13533QWXAtl','1715892AmqppX','272alvZob','md5','3BWLJSn','1430KqcVZr','digest','update','createHash'];a222_0x2a22=function(){return _0x3ac793;};return a222_0x2a22();}export function computeContentHash(_0x35829f){const _0x27b8ae=a222_0x48e8;return a222_0x2458bf[_0x27b8ae(0x1a9)](_0x27b8ae(0x1a4))[_0x27b8ae(0x1a8)](_0x35829f)[_0x27b8ae(0x1a7)](_0x27b8ae(0x1aa));}export async function computeFileHash(_0x4eb9c1){const _0x43a901=await readFile(_0x4eb9c1,'utf8');return computeContentHash(_0x43a901);}
1
+ (function(_0x1ea992,_0x2cd0c2){const _0xb28b96=a222_0x10b5,_0x5a73f3=_0x1ea992();while(!![]){try{const _0x596e79=-parseInt(_0xb28b96(0x151))/0x1*(parseInt(_0xb28b96(0x156))/0x2)+parseInt(_0xb28b96(0x15f))/0x3*(parseInt(_0xb28b96(0x160))/0x4)+parseInt(_0xb28b96(0x154))/0x5*(-parseInt(_0xb28b96(0x15c))/0x6)+-parseInt(_0xb28b96(0x153))/0x7*(parseInt(_0xb28b96(0x15d))/0x8)+parseInt(_0xb28b96(0x158))/0x9*(-parseInt(_0xb28b96(0x152))/0xa)+-parseInt(_0xb28b96(0x159))/0xb*(-parseInt(_0xb28b96(0x15b))/0xc)+parseInt(_0xb28b96(0x155))/0xd;if(_0x596e79===_0x2cd0c2)break;else _0x5a73f3['push'](_0x5a73f3['shift']());}catch(_0x5885c7){_0x5a73f3['push'](_0x5a73f3['shift']());}}}(a222_0x5a30,0xf1b4c));function a222_0x10b5(_0x127713,_0x58ddfd){_0x127713=_0x127713-0x151;const _0x5a30d4=a222_0x5a30();let _0x10b58d=_0x5a30d4[_0x127713];return _0x10b58d;}import{readFile}from'node:fs/promises';import a222_0x150ac6 from'node:crypto';export function computeContentHash(_0x9c3bc2){const _0x4cfbce=a222_0x10b5;return a222_0x150ac6['createHash']('md5')[_0x4cfbce(0x15e)](_0x9c3bc2)[_0x4cfbce(0x157)](_0x4cfbce(0x15a));}export async function computeFileHash(_0xc697f5){const _0x165beb=await readFile(_0xc697f5,'utf8');return computeContentHash(_0x165beb);}function a222_0x5a30(){const _0xeea095=['hex','459888DevtPQ','37068pAVrNX','8iFPTZd','update','4413237qsRAzm','4JxdsGJ','1XOwFBx','84570vqubGy','6770953ytyuYx','820KLjrYy','23491364PzrDYe','1907306gkCoHb','digest','1107CqGyxD','484OeWcQA'];a222_0x5a30=function(){return _0xeea095;};return a222_0x5a30();}
@@ -1 +1 @@
1
- (function(_0x178bf5,_0x270da8){const _0x9c895d=a223_0x3a02,_0x756de8=_0x178bf5();while(!![]){try{const _0x40613f=-parseInt(_0x9c895d(0xfc))/0x1*(parseInt(_0x9c895d(0xfa))/0x2)+-parseInt(_0x9c895d(0x103))/0x3*(-parseInt(_0x9c895d(0x108))/0x4)+-parseInt(_0x9c895d(0xfb))/0x5*(-parseInt(_0x9c895d(0x107))/0x6)+-parseInt(_0x9c895d(0x102))/0x7+parseInt(_0x9c895d(0x10f))/0x8+-parseInt(_0x9c895d(0x101))/0x9*(-parseInt(_0x9c895d(0xff))/0xa)+parseInt(_0x9c895d(0xfe))/0xb;if(_0x40613f===_0x270da8)break;else _0x756de8['push'](_0x756de8['shift']());}catch(_0x3b3fb5){_0x756de8['push'](_0x756de8['shift']());}}}(a223_0x5288,0x3e3fa));import{mkdir,readFile,writeFile}from'node:fs/promises';function a223_0x3a02(_0x328e27,_0x30a2f0){_0x328e27=_0x328e27-0xf9;const _0x5288c4=a223_0x5288();let _0x3a02c2=_0x5288c4[_0x328e27];return _0x3a02c2;}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x2a340e,_0x1e407b,_0x3ff30d,_0x4e7a70){const _0x266752=a223_0x3a02,_0x3b7d94={'apps':_0x2a340e[_0x266752(0x10b)]&&typeof _0x2a340e[_0x266752(0x10b)]===_0x266752(0x10e)?_0x2a340e[_0x266752(0x10b)]:{}};let _0x54d21d=_0x3b7d94[_0x266752(0x10b)][_0x1e407b];if(!_0x54d21d)return _0x54d21d={'scriptsRoot':_0x3ff30d,'lastSync':'','functions':{}},_0x3b7d94[_0x266752(0x10b)][_0x1e407b]=_0x54d21d,{'lockData':_0x3b7d94,'appLock':_0x54d21d};if(!_0x54d21d['scriptsRoot'])_0x54d21d[_0x266752(0xfd)]=_0x3ff30d;else{if(_0x54d21d[_0x266752(0xfd)]!==_0x3ff30d)throw new Error(_0x4e7a70+_0x266752(0x104)+(_0x266752(0x10a)+_0x3ff30d+_0x266752(0x10d)+_0x54d21d[_0x266752(0xfd)]+'\x22.\x20')+_0x266752(0x10c));}return!_0x54d21d[_0x266752(0xf9)]&&(_0x54d21d['functions']={}),!_0x54d21d[_0x266752(0x100)]&&(_0x54d21d[_0x266752(0x100)]=''),{'lockData':_0x3b7d94,'appLock':_0x54d21d};}export async function readBffLockFile(_0x5669bd){const _0x144759=a223_0x3a02;try{const _0x331b1f=await readFile(_0x5669bd,_0x144759(0x106)),_0x21b4e2=JSON['parse'](_0x331b1f);return{'apps':_0x21b4e2[_0x144759(0x10b)]&&typeof _0x21b4e2[_0x144759(0x10b)]===_0x144759(0x10e)?_0x21b4e2['apps']:{}};}catch(_0x305243){if(_0x305243['code']===_0x144759(0x105))return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x305243));}}function a223_0x5288(){const _0x515823=['stringify','current\x20\x22','apps','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','\x22\x20vs\x20lock\x20\x22','object','239120oFLIfS','functions','2fjBmQd','26865boEkJs','438329HmYWTM','scriptsRoot','2220372hghXeP','11020cldGgs','lastSync','2691oyMSjX','1461593QFwLno','3aGyzLv',':\x20scriptsRoot\x20mismatch\x20—\x20','ENOENT','utf8','234efrMyt','525244oxoyws'];a223_0x5288=function(){return _0x515823;};return a223_0x5288();}export async function writeBffLockFile(_0x1fe8be,_0x2c5152){const _0x4bbc18=a223_0x3a02;await mkdir(dirname(_0x1fe8be),{'recursive':!![]}),await writeFile(_0x1fe8be,JSON[_0x4bbc18(0x109)](_0x2c5152,null,0x2),_0x4bbc18(0x106));}
1
+ function a223_0x42b2(_0x2cf351,_0x4f9284){_0x2cf351=_0x2cf351-0x91;const _0x47e9de=a223_0x47e9();let _0x42b224=_0x47e9de[_0x2cf351];return _0x42b224;}(function(_0x5aa570,_0x37c01f){const _0x3af088=a223_0x42b2,_0x1c5fe1=_0x5aa570();while(!![]){try{const _0x5a8d1f=parseInt(_0x3af088(0x99))/0x1*(-parseInt(_0x3af088(0xa3))/0x2)+-parseInt(_0x3af088(0x97))/0x3*(parseInt(_0x3af088(0xa1))/0x4)+-parseInt(_0x3af088(0x92))/0x5+parseInt(_0x3af088(0x9f))/0x6+-parseInt(_0x3af088(0x95))/0x7+-parseInt(_0x3af088(0x9d))/0x8+parseInt(_0x3af088(0x91))/0x9*(parseInt(_0x3af088(0xa0))/0xa);if(_0x5a8d1f===_0x37c01f)break;else _0x1c5fe1['push'](_0x1c5fe1['shift']());}catch(_0x2ec162){_0x1c5fe1['push'](_0x1c5fe1['shift']());}}}(a223_0x47e9,0x598a2));function a223_0x47e9(){const _0x3cfa98=['469536amrXbF','apps','1424928ezuykH','3464020gfyjYU','1176412qEDcjm','utf8','218mDJYkp','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','ENOENT','object','stringify','code','63GRHXjk','2732850AwJiqo','lastSync','functions','3589782EOOhKp','scriptsRoot','6sJRwSY','parse','5406JeFltN','current\x20\x22','\x22\x20vs\x20lock\x20\x22','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.'];a223_0x47e9=function(){return _0x3cfa98;};return a223_0x47e9();}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x1c4713,_0x519e5d,_0x6d7920,_0x114480){const _0x46f95a=a223_0x42b2,_0x25931e={'apps':_0x1c4713[_0x46f95a(0x9e)]&&typeof _0x1c4713['apps']===_0x46f95a(0xa6)?_0x1c4713[_0x46f95a(0x9e)]:{}};let _0x156de1=_0x25931e[_0x46f95a(0x9e)][_0x519e5d];if(!_0x156de1)return _0x156de1={'scriptsRoot':_0x6d7920,'lastSync':'','functions':{}},_0x25931e[_0x46f95a(0x9e)][_0x519e5d]=_0x156de1,{'lockData':_0x25931e,'appLock':_0x156de1};if(!_0x156de1[_0x46f95a(0x96)])_0x156de1[_0x46f95a(0x96)]=_0x6d7920;else{if(_0x156de1[_0x46f95a(0x96)]!==_0x6d7920)throw new Error(_0x114480+':\x20scriptsRoot\x20mismatch\x20—\x20'+(_0x46f95a(0x9a)+_0x6d7920+_0x46f95a(0x9b)+_0x156de1[_0x46f95a(0x96)]+'\x22.\x20')+_0x46f95a(0x9c));}return!_0x156de1['functions']&&(_0x156de1[_0x46f95a(0x94)]={}),!_0x156de1[_0x46f95a(0x93)]&&(_0x156de1[_0x46f95a(0x93)]=''),{'lockData':_0x25931e,'appLock':_0x156de1};}export async function readBffLockFile(_0x52ebc1){const _0x1ee05c=a223_0x42b2;try{const _0x324dea=await readFile(_0x52ebc1,_0x1ee05c(0xa2)),_0x1d91c7=JSON[_0x1ee05c(0x98)](_0x324dea);return{'apps':_0x1d91c7[_0x1ee05c(0x9e)]&&typeof _0x1d91c7['apps']==='object'?_0x1d91c7[_0x1ee05c(0x9e)]:{}};}catch(_0x556fd3){if(_0x556fd3[_0x1ee05c(0xa8)]===_0x1ee05c(0xa5))return null;throw new Error(_0x1ee05c(0xa4)+String(_0x556fd3));}}export async function writeBffLockFile(_0x394b54,_0x3778d3){const _0x12bf07=a223_0x42b2;await mkdir(dirname(_0x394b54),{'recursive':!![]}),await writeFile(_0x394b54,JSON[_0x12bf07(0xa7)](_0x3778d3,null,0x2),'utf8');}
@@ -4,6 +4,7 @@
4
4
  * 纯逻辑工具,不依赖 CLI 交互、cookie、domain 等运行时环境。
5
5
  */
6
6
  import type { BffLockEntry, HookLocation } from "../../core/bff/types.js";
7
+ export declare const DEFAULT_BFF_SCRIPT_DESCRIPTION = "TODO: \u8865\u5145\u811A\u672C\u529F\u80FD\u63CF\u8FF0";
7
8
  export declare function snakeToCamel(value: string): string;
8
9
  /**
9
10
  * Reverse-lookup a HOOK location from lock entries by remote script ID.
@@ -12,7 +13,8 @@ export declare function snakeToCamel(value: string): string;
12
13
  export declare function findHookLocationByRemoteId(lockFunctions: Record<string, BffLockEntry>, remoteId?: number): HookLocation | undefined;
13
14
  /**
14
15
  * Extract description from a script's header comment block.
15
- * Looks for `[脚本描述] xxx` pattern.
16
+ * Reads the legacy marker for migration, otherwise uses the first plain
17
+ * summary line in a recognized BFF template header.
16
18
  */
17
19
  export declare function extractScriptDescription(scriptContent: string): string | undefined;
18
20
  /**
@@ -1 +1 @@
1
- (function(_0x9f0be6,_0x2688f3){const _0xbad638=a225_0x1fb2,_0x4609e6=_0x9f0be6();while(!![]){try{const _0x1429c4=parseInt(_0xbad638(0x13a))/0x1+parseInt(_0xbad638(0x13f))/0x2*(-parseInt(_0xbad638(0x144))/0x3)+-parseInt(_0xbad638(0x146))/0x4+parseInt(_0xbad638(0x140))/0x5*(parseInt(_0xbad638(0x13c))/0x6)+-parseInt(_0xbad638(0x149))/0x7+-parseInt(_0xbad638(0x14c))/0x8+parseInt(_0xbad638(0x142))/0x9;if(_0x1429c4===_0x2688f3)break;else _0x4609e6['push'](_0x4609e6['shift']());}catch(_0x49c070){_0x4609e6['push'](_0x4609e6['shift']());}}}(a225_0x4d87,0xc9e2f));export function snakeToCamel(_0x2aea46){const _0x331ae0=a225_0x1fb2;return _0x2aea46[_0x331ae0(0x14d)]()[_0x331ae0(0x14b)](/_([a-z])/g,(_0x36ba64,_0x1d2e44)=>_0x1d2e44[_0x331ae0(0x141)]());}export function findHookLocationByRemoteId(_0x3b9a69,_0x3cb647){const _0x306a57=a225_0x1fb2;if(!_0x3cb647)return undefined;for(const _0x326e8e of Object[_0x306a57(0x145)](_0x3b9a69)){if(_0x326e8e['remoteId']===_0x3cb647&&_0x326e8e[_0x306a57(0x143)]&&_0x326e8e[_0x306a57(0x13b)]&&_0x326e8e[_0x306a57(0x13e)])return{'datasetCode':_0x326e8e[_0x306a57(0x143)],'operationType':_0x326e8e[_0x306a57(0x13b)],'functionNode':_0x326e8e[_0x306a57(0x13e)]};}return undefined;}export function extractScriptDescription(_0x2ca701){const _0x211f48=a225_0x1fb2,_0x112d40=_0x2ca701[_0x211f48(0x147)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x112d40?.[0x1]?.[_0x211f48(0x148)]()||undefined;}export function isValidBffFunctionName(_0x35b23a){const _0xa970a3=a225_0x1fb2;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0xa970a3(0x14a)](_0x35b23a);}function a225_0x4d87(){const _0x5550a4=['before','227407FRVrol','operationType','642jcfGBO','after','functionNode','371174getLIc','44035VkTTei','toUpperCase','25292340gOVVoO','datasetCode','3FEIfyu','values','1309196qCAFIW','match','trim','10750495UwQGMN','test','replace','8835344cjZgCV','toLowerCase'];a225_0x4d87=function(){return _0x5550a4;};return a225_0x4d87();}function a225_0x1fb2(_0x5a41fe,_0x46050f){_0x5a41fe=_0x5a41fe-0x139;const _0x4d8709=a225_0x4d87();let _0x1fb26a=_0x4d8709[_0x5a41fe];return _0x1fb26a;}export function normalizeHookFunctionNode(_0x129f15){const _0xab5865=a225_0x1fb2;if(!_0x129f15)return undefined;const _0x470938=_0x129f15[_0xab5865(0x148)]()[_0xab5865(0x14d)]();if(_0x470938===_0xab5865(0x139)||_0x470938===_0xab5865(0x13d))return _0x470938;return undefined;}
1
+ const a225_0x3a6bad=a225_0x778a;function a225_0x778a(_0x5e99c2,_0x387523){_0x5e99c2=_0x5e99c2-0xae;const _0x172f99=a225_0x172f();let _0x778aa3=_0x172f99[_0x5e99c2];return _0x778aa3;}(function(_0x26048e,_0x1b66f3){const _0x412e88=a225_0x778a,_0x53180a=_0x26048e();while(!![]){try{const _0x282ab6=-parseInt(_0x412e88(0xc6))/0x1+-parseInt(_0x412e88(0xc2))/0x2+-parseInt(_0x412e88(0xb2))/0x3+parseInt(_0x412e88(0xb0))/0x4+-parseInt(_0x412e88(0xc0))/0x5*(parseInt(_0x412e88(0xbf))/0x6)+-parseInt(_0x412e88(0xc5))/0x7*(-parseInt(_0x412e88(0xb6))/0x8)+-parseInt(_0x412e88(0xc8))/0x9*(-parseInt(_0x412e88(0xb8))/0xa);if(_0x282ab6===_0x1b66f3)break;else _0x53180a['push'](_0x53180a['shift']());}catch(_0x2c0e01){_0x53180a['push'](_0x53180a['shift']());}}}(a225_0x172f,0x7f6c4));export const DEFAULT_BFF_SCRIPT_DESCRIPTION=a225_0x3a6bad(0xb7);function a225_0x172f(){const _0x3af5b2=['1885848ouhWap','values','before','remoteId','411640KiMvgV','TODO:\x20补充脚本功能描述','20uLOXpS','some','startsWith','functionNode','test','operationType','TODO:\x20add\x20script\x20description','20172CkOqhE','1295xOzlEa','replace','61854PVWGJa','match','trim','70BlaTAO','605737YVrdDO','toUpperCase','5368032RDTuvQ','datasetCode','toLowerCase','3802064QefeYu','map'];a225_0x172f=function(){return _0x3af5b2;};return a225_0x172f();}const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION=a225_0x3a6bad(0xbe);export function snakeToCamel(_0x5ad935){const _0x519e0f=a225_0x3a6bad;return _0x5ad935[_0x519e0f(0xaf)]()[_0x519e0f(0xc1)](/_([a-z])/g,(_0x5b52d4,_0x54b18a)=>_0x54b18a[_0x519e0f(0xc7)]());}export function findHookLocationByRemoteId(_0x1aaeb4,_0x15b924){const _0x53a8c2=a225_0x3a6bad;if(!_0x15b924)return undefined;for(const _0x599c1f of Object[_0x53a8c2(0xb3)](_0x1aaeb4)){if(_0x599c1f[_0x53a8c2(0xb5)]===_0x15b924&&_0x599c1f[_0x53a8c2(0xae)]&&_0x599c1f['operationType']&&_0x599c1f[_0x53a8c2(0xbb)])return{'datasetCode':_0x599c1f[_0x53a8c2(0xae)],'operationType':_0x599c1f[_0x53a8c2(0xbd)],'functionNode':_0x599c1f[_0x53a8c2(0xbb)]};}return undefined;}export function extractScriptDescription(_0x456a3d){const _0x5d9e6b=a225_0x3a6bad,_0x1ae465=_0x456a3d[_0x5d9e6b(0xc3)](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x1ae465?.[0x1])return undefined;const _0x2e2e7b=_0x1ae465[0x1],_0x2928ea=_0x52983a=>{const _0x577d88=_0x5d9e6b,_0x58c397=_0x52983a?.[_0x577d88(0xc4)]();if(!_0x58c397||_0x58c397===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x58c397===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x58c397;},_0x23c7a7=_0x2e2e7b[_0x5d9e6b(0xc3)](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x23c7a7)return _0x2928ea(_0x23c7a7[0x1]);const _0x366b6d=_0x2e2e7b['split'](/\r?\n/)[_0x5d9e6b(0xb1)](_0x48ea4b=>_0x48ea4b[_0x5d9e6b(0xc1)](/^\s*\*\s?/,'')[_0x5d9e6b(0xc4)]()),_0x1ddc09=_0x366b6d['some'](_0xde7ac5=>/^\[\s*脚本类型\s*]\s*\S+/[_0x5d9e6b(0xbc)](_0xde7ac5))&&_0x366b6d[_0x5d9e6b(0xb9)](_0x72c26e=>/^\[\s*脚本名称\s*]\s*\S+/['test'](_0x72c26e));if(!_0x1ddc09)return undefined;for(const _0x3be876 of _0x366b6d){if(!_0x3be876||_0x3be876[_0x5d9e6b(0xba)]('@')||/^\[[^\]]+]\s*/['test'](_0x3be876))continue;return _0x2928ea(_0x3be876);}return undefined;}export function isValidBffFunctionName(_0x1e7850){return/^[A-Za-z_$][A-Za-z0-9_$]*$/['test'](_0x1e7850);}export function normalizeHookFunctionNode(_0x5683c4){const _0xaed57f=a225_0x3a6bad;if(!_0x5683c4)return undefined;const _0x11acdf=_0x5683c4['trim']()[_0xaed57f(0xaf)]();if(_0x11acdf===_0xaed57f(0xb4)||_0x11acdf==='after')return _0x11acdf;return undefined;}
@@ -1 +1 @@
1
- function a226_0x15b6(_0x4931ef,_0x2f0a4c){_0x4931ef=_0x4931ef-0x181;const _0x3a2bc9=a226_0x3a2b();let _0x15b606=_0x3a2bc9[_0x4931ef];return _0x15b606;}(function(_0x45e439,_0x4f2b90){const _0x3ad8a5=a226_0x15b6,_0x561d34=_0x45e439();while(!![]){try{const _0x5b39b9=-parseInt(_0x3ad8a5(0x19e))/0x1+-parseInt(_0x3ad8a5(0x19c))/0x2*(-parseInt(_0x3ad8a5(0x193))/0x3)+parseInt(_0x3ad8a5(0x19f))/0x4*(-parseInt(_0x3ad8a5(0x194))/0x5)+-parseInt(_0x3ad8a5(0x188))/0x6+-parseInt(_0x3ad8a5(0x19d))/0x7*(-parseInt(_0x3ad8a5(0x199))/0x8)+-parseInt(_0x3ad8a5(0x18a))/0x9+parseInt(_0x3ad8a5(0x184))/0xa;if(_0x5b39b9===_0x4f2b90)break;else _0x561d34['push'](_0x561d34['shift']());}catch(_0x4b0b4e){_0x561d34['push'](_0x561d34['shift']());}}}(a226_0x3a2b,0xf2051));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x591797){const _0x387c70=a226_0x15b6;if(cache[_0x387c70(0x186)](_0x591797))return cache[_0x387c70(0x197)](_0x591797);const _0x1ea5e7=await listDatasets(_0x591797),_0x1bf43c=new Map();for(const _0x4d3865 of _0x1ea5e7){const _0x2e3b11=_0x4d3865[_0x387c70(0x18f)];_0x2e3b11?.[_0x387c70(0x182)]!=null&&_0x1bf43c[_0x387c70(0x192)](_0x2e3b11['dbId'],_0x2e3b11[_0x387c70(0x198)]??'db-'+_0x2e3b11['dbId']);}const _0x2e2900=[..._0x1bf43c['entries']()][_0x387c70(0x19a)](([_0x1213a9,_0x202c88])=>({'dbId':_0x1213a9,'dbName':_0x202c88}));return cache[_0x387c70(0x192)](_0x591797,_0x2e2900),_0x2e2900;}function a226_0x3a2b(){const _0x2d8494=['No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','has','includes','7203840CXeBMW','join','7682355CzvwUl','filter','.\x20Be\x20more\x20specific.','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','length','dbtableConfig','\x22.\x20Available:\x20','No\x20database\x20matching\x20\x22','set','1152hCoifi','8994970xjGWDA','isNaN','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','get','dbName','152Ufikgi','map','\x22\x20matches\x20multiple\x20databases:\x20','8410eOjXSf','189427WnxuUr','1149961kcWQWK','4yrwvHf','toLowerCase','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','dbId','find','38656240jhlIxQ'];a226_0x3a2b=function(){return _0x2d8494;};return a226_0x3a2b();}export async function resolveDb(_0x31cd5d,_0x321fdd){const _0x252239=a226_0x15b6,_0x32a5a3=await listDatabases(_0x31cd5d);if(_0x32a5a3['length']===0x0)return{'resolved':[],'error':_0x252239(0x185)+_0x31cd5d+_0x252239(0x181)};if(!_0x321fdd)return{'resolved':_0x32a5a3};const _0x15586f=Number(_0x321fdd);if(!Number[_0x252239(0x195)](_0x15586f)){const _0x4bbb7f=_0x32a5a3[_0x252239(0x183)](_0x27769b=>_0x27769b[_0x252239(0x182)]===_0x15586f);if(_0x4bbb7f)return{'resolved':[_0x4bbb7f]};}const _0x5caf62=_0x321fdd[_0x252239(0x1a0)](),_0x5c9ea2=_0x32a5a3[_0x252239(0x18b)](_0x2b26c1=>_0x2b26c1[_0x252239(0x198)]['toLowerCase']()[_0x252239(0x187)](_0x5caf62));if(_0x5c9ea2[_0x252239(0x18e)]>0x0)return{'resolved':_0x5c9ea2};const _0x1dd3f5=_0x32a5a3[_0x252239(0x19a)](_0x2f2630=>_0x2f2630[_0x252239(0x198)]+'\x20('+_0x2f2630[_0x252239(0x182)]+')')[_0x252239(0x189)](',\x20');return{'resolved':[],'error':_0x252239(0x191)+_0x321fdd+'\x22\x20under\x20app\x20\x22'+_0x31cd5d+_0x252239(0x190)+_0x1dd3f5+_0x252239(0x18d)};}export async function resolveOneDb(_0x1fbc35,_0x529696){const _0x1adcbd=a226_0x15b6,{resolved:_0x186235,error:_0xef6150}=await resolveDb(_0x1fbc35,_0x529696);if(_0xef6150)return{'db':null,'error':_0xef6150};if(_0x186235['length']===0x1)return{'db':_0x186235[0x0]};if(!_0x529696){const _0x538571=_0x186235['map'](_0xdf03e1=>_0xdf03e1[_0x1adcbd(0x198)]+'\x20('+_0xdf03e1[_0x1adcbd(0x182)]+')')[_0x1adcbd(0x189)](',\x20');return{'db':null,'error':_0x1adcbd(0x196)+_0x538571};}const _0x7e1e04=_0x186235['map'](_0x30bb5d=>_0x30bb5d[_0x1adcbd(0x198)]+'\x20('+_0x30bb5d[_0x1adcbd(0x182)]+')')[_0x1adcbd(0x189)](',\x20');return{'db':null,'error':'\x22'+_0x529696+_0x1adcbd(0x19b)+_0x7e1e04+_0x1adcbd(0x18c)};}export async function getDbName(_0x1ca2be,_0x16b9e8){const _0x662222=a226_0x15b6,_0x385d3b=await listDatabases(_0x1ca2be);return _0x385d3b[_0x662222(0x183)](_0x587ecc=>_0x587ecc[_0x662222(0x182)]===_0x16b9e8)?.[_0x662222(0x198)];}
1
+ (function(_0x2f5ba8,_0x12d9ef){const _0x57e334=a226_0x6c7e,_0x1dff6e=_0x2f5ba8();while(!![]){try{const _0x4c9310=parseInt(_0x57e334(0x1bf))/0x1+parseInt(_0x57e334(0x1c6))/0x2+parseInt(_0x57e334(0x1c0))/0x3+-parseInt(_0x57e334(0x1c7))/0x4*(parseInt(_0x57e334(0x1bd))/0x5)+-parseInt(_0x57e334(0x1b9))/0x6*(-parseInt(_0x57e334(0x1ba))/0x7)+parseInt(_0x57e334(0x1c1))/0x8*(-parseInt(_0x57e334(0x1b3))/0x9)+-parseInt(_0x57e334(0x1c8))/0xa;if(_0x4c9310===_0x12d9ef)break;else _0x1dff6e['push'](_0x1dff6e['shift']());}catch(_0x276e21){_0x1dff6e['push'](_0x1dff6e['shift']());}}}(a226_0x462e,0xab7ef));import{listDatasets}from'../core/api-client.js';function a226_0x6c7e(_0x4a1a1e,_0x2c7930){_0x4a1a1e=_0x4a1a1e-0x1b3;const _0x462e3d=a226_0x462e();let _0x6c7ebd=_0x462e3d[_0x4a1a1e];return _0x6c7ebd;}const cache=new Map();export async function listDatabases(_0x277368){const _0x3b56f1=a226_0x6c7e;if(cache['has'](_0x277368))return cache['get'](_0x277368);const _0x205897=await listDatasets(_0x277368),_0x3dd11a=new Map();for(const _0x2f8e71 of _0x205897){const _0x11b27e=_0x2f8e71[_0x3b56f1(0x1bb)];_0x11b27e?.['dbId']!=null&&_0x3dd11a['set'](_0x11b27e['dbId'],_0x11b27e[_0x3b56f1(0x1c4)]??_0x3b56f1(0x1b8)+_0x11b27e['dbId']);}const _0x1c13c3=[..._0x3dd11a['entries']()][_0x3b56f1(0x1b5)](([_0x2f0d74,_0xd6e5c1])=>({'dbId':_0x2f0d74,'dbName':_0xd6e5c1}));return cache[_0x3b56f1(0x1c2)](_0x277368,_0x1c13c3),_0x1c13c3;}function a226_0x462e(){const _0x3ff421=['2438751cafovB','49712AlTwwl','set','\x22\x20matches\x20multiple\x20databases:\x20','dbName','dbId','36492KoXmxU','1466320UDYnyE','7233590ieQHyZ','length','.\x20Be\x20more\x20specific.','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','includes','find','63NNCMPi','filter','map','toLowerCase','join','db-','6njeTct','4777633mHxYOV','dbtableConfig','\x22\x20under\x20app\x20\x22','5srnzst','No\x20database\x20matching\x20\x22','322202YQbJoN'];a226_0x462e=function(){return _0x3ff421;};return a226_0x462e();}export async function resolveDb(_0xc931a4,_0x4415c2){const _0x4cea7b=a226_0x6c7e,_0x589849=await listDatabases(_0xc931a4);if(_0x589849[_0x4cea7b(0x1c9)]===0x0)return{'resolved':[],'error':_0x4cea7b(0x1cb)+_0xc931a4+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x4415c2)return{'resolved':_0x589849};const _0x5d3c31=Number(_0x4415c2);if(!Number['isNaN'](_0x5d3c31)){const _0x286026=_0x589849['find'](_0x10a2ca=>_0x10a2ca[_0x4cea7b(0x1c5)]===_0x5d3c31);if(_0x286026)return{'resolved':[_0x286026]};}const _0x12984f=_0x4415c2[_0x4cea7b(0x1b6)](),_0x2c4aef=_0x589849[_0x4cea7b(0x1b4)](_0x5b514c=>_0x5b514c[_0x4cea7b(0x1c4)][_0x4cea7b(0x1b6)]()[_0x4cea7b(0x1cc)](_0x12984f));if(_0x2c4aef[_0x4cea7b(0x1c9)]>0x0)return{'resolved':_0x2c4aef};const _0x292efc=_0x589849['map'](_0x21267d=>_0x21267d[_0x4cea7b(0x1c4)]+'\x20('+_0x21267d[_0x4cea7b(0x1c5)]+')')['join'](',\x20');return{'resolved':[],'error':_0x4cea7b(0x1be)+_0x4415c2+_0x4cea7b(0x1bc)+_0xc931a4+'\x22.\x20Available:\x20'+_0x292efc+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x543421,_0x3f7feb){const _0x382f49=a226_0x6c7e,{resolved:_0x597f2a,error:_0x6c076b}=await resolveDb(_0x543421,_0x3f7feb);if(_0x6c076b)return{'db':null,'error':_0x6c076b};if(_0x597f2a[_0x382f49(0x1c9)]===0x1)return{'db':_0x597f2a[0x0]};if(!_0x3f7feb){const _0x3aecb8=_0x597f2a[_0x382f49(0x1b5)](_0x1eabce=>_0x1eabce['dbName']+'\x20('+_0x1eabce['dbId']+')')[_0x382f49(0x1b7)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x3aecb8};}const _0x5cccce=_0x597f2a[_0x382f49(0x1b5)](_0x4a9b71=>_0x4a9b71[_0x382f49(0x1c4)]+'\x20('+_0x4a9b71[_0x382f49(0x1c5)]+')')[_0x382f49(0x1b7)](',\x20');return{'db':null,'error':'\x22'+_0x3f7feb+_0x382f49(0x1c3)+_0x5cccce+_0x382f49(0x1ca)};}export async function getDbName(_0x35d8b9,_0x80ed9a){const _0x4b98ad=a226_0x6c7e,_0x422a66=await listDatabases(_0x35d8b9);return _0x422a66[_0x4b98ad(0x1cd)](_0x80e3fd=>_0x80e3fd[_0x4b98ad(0x1c5)]===_0x80ed9a)?.[_0x4b98ad(0x1c4)];}
@@ -1 +1 @@
1
- const a227_0x3e2a53=a227_0x506f;(function(_0x2c02d9,_0x3f8aa7){const _0x116240=a227_0x506f,_0x20cee5=_0x2c02d9();while(!![]){try{const _0x43046a=parseInt(_0x116240(0x1f2))/0x1*(parseInt(_0x116240(0x1f4))/0x2)+parseInt(_0x116240(0x1e9))/0x3*(parseInt(_0x116240(0x1ee))/0x4)+-parseInt(_0x116240(0x1eb))/0x5*(parseInt(_0x116240(0x1f8))/0x6)+-parseInt(_0x116240(0x1e8))/0x7*(parseInt(_0x116240(0x1f6))/0x8)+parseInt(_0x116240(0x1ec))/0x9+-parseInt(_0x116240(0x1f7))/0xa+parseInt(_0x116240(0x1f9))/0xb*(parseInt(_0x116240(0x1f3))/0xc);if(_0x43046a===_0x3f8aa7)break;else _0x20cee5['push'](_0x20cee5['shift']());}catch(_0x15457f){_0x20cee5['push'](_0x20cee5['shift']());}}}(a227_0x1d3d,0x57f14));import{constants}from'node:fs';function a227_0x506f(_0x1c7ee8,_0x35f7bd){_0x1c7ee8=_0x1c7ee8-0x1e8;const _0x1d3d81=a227_0x1d3d();let _0x506fb4=_0x1d3d81[_0x1c7ee8];return _0x506fb4;}import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x1d66ab,_0x320507=process[a227_0x3e2a53(0x1f5)]()){const _0x1536be=a227_0x3e2a53,_0x596200=resolve(_0x320507),_0x21825c=join(_0x596200,'.rabetbase','page');return{'projectRoot':_0x596200,'pagesBaseDir':_0x21825c,'appPagesDir':join(_0x21825c,_0x1d66ab),'lockFilePath':join(_0x596200,_0x1536be(0x1ef),_0x1536be(0x1f0))};}function a227_0x1d3d(){const _0x54df25=['755880zIFEEL','3442338AyJZwU','1588103yJbnzz','295841gBNepp','5283aCBTHm','F_OK','5PfpPaB','4972815Bwgedk','appPagesDir','692aQtBzE','.rabetbase','page.lock.json','.json','287fiFfjF','12LvCZjI','350ofNxYh','cwd','8xpANMv'];a227_0x1d3d=function(){return _0x54df25;};return a227_0x1d3d();}export function buildPageFileName(_0x6c6438,_0x5d43ea){const _0x468bfe=a227_0x3e2a53;return _0x6c6438+'-'+String(_0x5d43ea)['toUpperCase']()+_0x468bfe(0x1f1);}export function resolvePageFilePath(_0x10291e,_0x2a7092,_0x28aa07){const _0x3eb289=a227_0x3e2a53;return join(_0x10291e[_0x3eb289(0x1ed)],buildPageFileName(_0x2a7092,_0x28aa07));}export async function ensureParentDirectory(_0x4ed408){await mkdir(dirname(_0x4ed408),{'recursive':!![]});}export async function fileExists(_0x429718){const _0x567a24=a227_0x3e2a53;try{return await access(_0x429718,constants[_0x567a24(0x1ea)]),!![];}catch{return![];}}
1
+ const a227_0x1cc4b7=a227_0x5064;(function(_0x32bf0a,_0x1c3b5c){const _0x2e8802=a227_0x5064,_0x1543d7=_0x32bf0a();while(!![]){try{const _0x30954b=parseInt(_0x2e8802(0x129))/0x1+-parseInt(_0x2e8802(0x124))/0x2+-parseInt(_0x2e8802(0x11d))/0x3*(parseInt(_0x2e8802(0x120))/0x4)+-parseInt(_0x2e8802(0x125))/0x5+-parseInt(_0x2e8802(0x127))/0x6+parseInt(_0x2e8802(0x128))/0x7+-parseInt(_0x2e8802(0x11f))/0x8*(-parseInt(_0x2e8802(0x12b))/0x9);if(_0x30954b===_0x1c3b5c)break;else _0x1543d7['push'](_0x1543d7['shift']());}catch(_0x20861d){_0x1543d7['push'](_0x1543d7['shift']());}}}(a227_0x568c,0x3c9e9));function a227_0x5064(_0x1f7df6,_0x2db7a8){_0x1f7df6=_0x1f7df6-0x11d;const _0x568c4f=a227_0x568c();let _0x50645f=_0x568c4f[_0x1f7df6];return _0x50645f;}import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x4c386b,_0x5d3c0e=process[a227_0x1cc4b7(0x11e)]()){const _0x270d2e=a227_0x1cc4b7,_0x50e429=resolve(_0x5d3c0e),_0x2f8f0c=join(_0x50e429,_0x270d2e(0x122),_0x270d2e(0x12d));return{'projectRoot':_0x50e429,'pagesBaseDir':_0x2f8f0c,'appPagesDir':join(_0x2f8f0c,_0x4c386b),'lockFilePath':join(_0x50e429,'.rabetbase',_0x270d2e(0x12a))};}export function buildPageFileName(_0x333415,_0x42779d){const _0x58095b=a227_0x1cc4b7;return _0x333415+'-'+String(_0x42779d)[_0x58095b(0x121)]()+_0x58095b(0x126);}export function resolvePageFilePath(_0x4a1cb0,_0xdedf2c,_0x2db4c1){const _0x4414bd=a227_0x1cc4b7;return join(_0x4a1cb0[_0x4414bd(0x123)],buildPageFileName(_0xdedf2c,_0x2db4c1));}export async function ensureParentDirectory(_0x62cc2b){await mkdir(dirname(_0x62cc2b),{'recursive':!![]});}export async function fileExists(_0xd2d3df){const _0x2cea1c=a227_0x1cc4b7;try{return await access(_0xd2d3df,constants[_0x2cea1c(0x12c)]),!![];}catch{return![];}}function a227_0x568c(){const _0x5a4e6a=['cwd','4224664YbCMzb','12pQLaON','toUpperCase','.rabetbase','appPagesDir','38390FlfPbL','1353365kJzRcb','.json','2832816UdkXpx','2123625GeHvMB','292414dzBmGq','page.lock.json','9ZSKhti','F_OK','page','113571qcYyyo'];a227_0x568c=function(){return _0x5a4e6a;};return a227_0x568c();}
@@ -1 +1 @@
1
- (function(_0x3369e9,_0x1c4d95){const _0x497081=a228_0x59d1,_0x2bb6df=_0x3369e9();while(!![]){try{const _0x15a2e6=-parseInt(_0x497081(0x11f))/0x1*(parseInt(_0x497081(0x128))/0x2)+parseInt(_0x497081(0x11d))/0x3*(-parseInt(_0x497081(0x11b))/0x4)+-parseInt(_0x497081(0x126))/0x5+parseInt(_0x497081(0x129))/0x6+parseInt(_0x497081(0x11e))/0x7*(-parseInt(_0x497081(0x123))/0x8)+-parseInt(_0x497081(0x120))/0x9+parseInt(_0x497081(0x12a))/0xa*(parseInt(_0x497081(0x125))/0xb);if(_0x15a2e6===_0x1c4d95)break;else _0x2bb6df['push'](_0x2bb6df['shift']());}catch(_0x367500){_0x2bb6df['push'](_0x2bb6df['shift']());}}}(a228_0xbc75,0x2599c));import a228_0x3fb347 from'node:crypto';import{readFile}from'node:fs/promises';function a228_0x59d1(_0x3fb0fe,_0x13137c){_0x3fb0fe=_0x3fb0fe-0x11b;const _0xbc75fe=a228_0xbc75();let _0x59d150=_0xbc75fe[_0x3fb0fe];return _0x59d150;}export function serializePageSchemaForFile(_0x5ebb18){const _0x445145=a228_0x59d1;return JSON[_0x445145(0x122)](JSON['parse'](_0x5ebb18),null,0x2)+'\x0a';}export function computePageContentHash(_0x4c9d57){const _0x5472f3=a228_0x59d1;return a228_0x3fb347['createHash']('md5')[_0x5472f3(0x121)](_0x4c9d57)[_0x5472f3(0x124)](_0x5472f3(0x11c));}function a228_0xbc75(){const _0x19d8d6=['8IeXULl','digest','132OLddvD','890335KTcXIz','utf8','14RyJfgg','1189926QfQMeb','679130edyXJT','996972GlrYEp','hex','3sKIDTI','103789xbkaAW','28004IJADLM','1989900rzzbMC','update','stringify'];a228_0xbc75=function(){return _0x19d8d6;};return a228_0xbc75();}export function computeSerializedSchemaHash(_0x156724){return computePageContentHash(serializePageSchemaForFile(_0x156724));}export async function computePageFileHash(_0x3d5b2d){const _0x300465=a228_0x59d1,_0x5bda69=await readFile(_0x3d5b2d,_0x300465(0x127));return computePageContentHash(_0x5bda69);}
1
+ (function(_0x583cc7,_0x455619){const _0x508d29=a228_0x204c,_0x434fdd=_0x583cc7();while(!![]){try{const _0x16b571=-parseInt(_0x508d29(0x1eb))/0x1+parseInt(_0x508d29(0x1f5))/0x2+parseInt(_0x508d29(0x1f8))/0x3+parseInt(_0x508d29(0x1f1))/0x4*(-parseInt(_0x508d29(0x1f6))/0x5)+-parseInt(_0x508d29(0x1ee))/0x6*(-parseInt(_0x508d29(0x1ec))/0x7)+parseInt(_0x508d29(0x1ea))/0x8*(-parseInt(_0x508d29(0x1e9))/0x9)+-parseInt(_0x508d29(0x1e8))/0xa;if(_0x16b571===_0x455619)break;else _0x434fdd['push'](_0x434fdd['shift']());}catch(_0x320b36){_0x434fdd['push'](_0x434fdd['shift']());}}}(a228_0x308c,0xa7f36));function a228_0x308c(){const _0x562321=['676444BsSQJR','utf8','parse','hex','379708ZAYtqG','20JdsXOY','stringify','3413268rmYeII','createHash','2738570vfYAuD','446562xhFaxh','48KaomZC','70026HZMTcn','33677FAMljb','md5','846swyoWD','update','digest'];a228_0x308c=function(){return _0x562321;};return a228_0x308c();}import a228_0xf3a4f0 from'node:crypto';import{readFile}from'node:fs/promises';function a228_0x204c(_0x442737,_0x1e7f7d){_0x442737=_0x442737-0x1e7;const _0x308c71=a228_0x308c();let _0x204ce7=_0x308c71[_0x442737];return _0x204ce7;}export function serializePageSchemaForFile(_0x22444c){const _0x1caa69=a228_0x204c;return JSON[_0x1caa69(0x1f7)](JSON[_0x1caa69(0x1f3)](_0x22444c),null,0x2)+'\x0a';}export function computePageContentHash(_0x28adb9){const _0x35ecf4=a228_0x204c;return a228_0xf3a4f0[_0x35ecf4(0x1e7)](_0x35ecf4(0x1ed))[_0x35ecf4(0x1ef)](_0x28adb9)[_0x35ecf4(0x1f0)](_0x35ecf4(0x1f4));}export function computeSerializedSchemaHash(_0x44e8ec){return computePageContentHash(serializePageSchemaForFile(_0x44e8ec));}export async function computePageFileHash(_0x1db6eb){const _0x506303=a228_0x204c,_0x18699c=await readFile(_0x1db6eb,_0x506303(0x1f2));return computePageContentHash(_0x18699c);}
@@ -1 +1 @@
1
- (function(_0x4c89f4,_0x31790e){const _0x20d645=a229_0x2e05,_0x59041e=_0x4c89f4();while(!![]){try{const _0x309ef0=-parseInt(_0x20d645(0x117))/0x1+parseInt(_0x20d645(0x114))/0x2+-parseInt(_0x20d645(0x121))/0x3*(parseInt(_0x20d645(0x116))/0x4)+parseInt(_0x20d645(0x120))/0x5*(parseInt(_0x20d645(0x11e))/0x6)+-parseInt(_0x20d645(0x113))/0x7+parseInt(_0x20d645(0x11b))/0x8*(parseInt(_0x20d645(0x115))/0x9)+-parseInt(_0x20d645(0x112))/0xa;if(_0x309ef0===_0x31790e)break;else _0x59041e['push'](_0x59041e['shift']());}catch(_0x2d3761){_0x59041e['push'](_0x59041e['shift']());}}}(a229_0xb5a1,0x86e2b));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0xfa1a67,_0x11fc99){const _0x2ac67=a229_0x2e05,_0x11650f={'apps':_0xfa1a67['apps']&&typeof _0xfa1a67[_0x2ac67(0x122)]===_0x2ac67(0x124)?_0xfa1a67['apps']:{}};let _0x5cbcb0=_0x11650f[_0x2ac67(0x122)][_0x11fc99];if(!_0x5cbcb0)return _0x5cbcb0={'lastSync':'','pages':{}},_0x11650f[_0x2ac67(0x122)][_0x11fc99]=_0x5cbcb0,{'lockData':_0x11650f,'appLock':_0x5cbcb0};return!_0x5cbcb0[_0x2ac67(0x11d)]&&(_0x5cbcb0[_0x2ac67(0x11d)]=''),(!_0x5cbcb0[_0x2ac67(0x123)]||typeof _0x5cbcb0[_0x2ac67(0x123)]!==_0x2ac67(0x124))&&(_0x5cbcb0['pages']={}),{'lockData':_0x11650f,'appLock':_0x5cbcb0};}function a229_0xb5a1(){const _0x4d8c10=['apps','pages','object','924550qoHTek','1380547cJbLVR','1929326oeDFDm','269109iODBpy','2135764YLddjl','794151RwhCsa','ENOENT','parse','stringify','72gyEIVl','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','lastSync','5618922zoHXhK','utf8','5mOXAbA','3mvLJFE'];a229_0xb5a1=function(){return _0x4d8c10;};return a229_0xb5a1();}export async function readPageLockFile(_0x5d7858){const _0x531e1f=a229_0x2e05;try{const _0x17e2b1=await readFile(_0x5d7858,_0x531e1f(0x11f)),_0x2189b8=JSON[_0x531e1f(0x119)](_0x17e2b1);return{'apps':_0x2189b8['apps']&&typeof _0x2189b8[_0x531e1f(0x122)]===_0x531e1f(0x124)?_0x2189b8['apps']:{}};}catch(_0x54c172){if(_0x54c172['code']===_0x531e1f(0x118))return null;throw new Error(_0x531e1f(0x11c)+String(_0x54c172));}}function a229_0x2e05(_0x4f4569,_0x4a7a14){_0x4f4569=_0x4f4569-0x112;const _0xb5a1d0=a229_0xb5a1();let _0x2e0595=_0xb5a1d0[_0x4f4569];return _0x2e0595;}export async function writePageLockFile(_0x217c30,_0x1b3dc6){const _0x4876bd=a229_0x2e05;await mkdir(dirname(_0x217c30),{'recursive':!![]}),await writeFile(_0x217c30,JSON[_0x4876bd(0x11a)](_0x1b3dc6,null,0x2),_0x4876bd(0x11f));}
1
+ function a229_0x1481(_0x1805db,_0x290398){_0x1805db=_0x1805db-0xc4;const _0x59f145=a229_0x59f1();let _0x14816d=_0x59f145[_0x1805db];return _0x14816d;}(function(_0x3d9c60,_0x456c6f){const _0x12bb50=a229_0x1481,_0x458fdf=_0x3d9c60();while(!![]){try{const _0x4f2ab0=-parseInt(_0x12bb50(0xd5))/0x1*(-parseInt(_0x12bb50(0xc5))/0x2)+parseInt(_0x12bb50(0xc8))/0x3*(parseInt(_0x12bb50(0xd3))/0x4)+parseInt(_0x12bb50(0xd0))/0x5*(-parseInt(_0x12bb50(0xd6))/0x6)+parseInt(_0x12bb50(0xd2))/0x7+parseInt(_0x12bb50(0xce))/0x8+parseInt(_0x12bb50(0xd7))/0x9*(-parseInt(_0x12bb50(0xcb))/0xa)+parseInt(_0x12bb50(0xca))/0xb;if(_0x4f2ab0===_0x456c6f)break;else _0x458fdf['push'](_0x458fdf['shift']());}catch(_0x52bd4e){_0x458fdf['push'](_0x458fdf['shift']());}}}(a229_0x59f1,0x22614));import{mkdir,readFile,writeFile}from'node:fs/promises';function a229_0x59f1(){const _0x38357e=['object','6wZfEMM','894ytNdHC','9yBCUFa','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','9906nbYnSH','ENOENT','apps','164445rBvABP','lastSync','1491622KTRXpC','1409600OqkUgJ','stringify','pages','395552CHcAKU','utf8','4955zNRnaL','code','1119020KSKana','4SlGbVQ'];a229_0x59f1=function(){return _0x38357e;};return a229_0x59f1();}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x57c24c,_0x29fd96){const _0x498c54=a229_0x1481,_0x57e598={'apps':_0x57c24c[_0x498c54(0xc7)]&&typeof _0x57c24c[_0x498c54(0xc7)]===_0x498c54(0xd4)?_0x57c24c[_0x498c54(0xc7)]:{}};let _0x19cc2d=_0x57e598[_0x498c54(0xc7)][_0x29fd96];if(!_0x19cc2d)return _0x19cc2d={'lastSync':'','pages':{}},_0x57e598['apps'][_0x29fd96]=_0x19cc2d,{'lockData':_0x57e598,'appLock':_0x19cc2d};return!_0x19cc2d[_0x498c54(0xc9)]&&(_0x19cc2d[_0x498c54(0xc9)]=''),(!_0x19cc2d[_0x498c54(0xcd)]||typeof _0x19cc2d[_0x498c54(0xcd)]!==_0x498c54(0xd4))&&(_0x19cc2d['pages']={}),{'lockData':_0x57e598,'appLock':_0x19cc2d};}export async function readPageLockFile(_0x3102a1){const _0x3e1f7b=a229_0x1481;try{const _0x35742f=await readFile(_0x3102a1,'utf8'),_0x2b9e69=JSON['parse'](_0x35742f);return{'apps':_0x2b9e69[_0x3e1f7b(0xc7)]&&typeof _0x2b9e69[_0x3e1f7b(0xc7)]==='object'?_0x2b9e69[_0x3e1f7b(0xc7)]:{}};}catch(_0x27307e){if(_0x27307e[_0x3e1f7b(0xd1)]===_0x3e1f7b(0xc6))return null;throw new Error(_0x3e1f7b(0xc4)+String(_0x27307e));}}export async function writePageLockFile(_0x362d69,_0x43615a){const _0x9a6ce8=a229_0x1481;await mkdir(dirname(_0x362d69),{'recursive':!![]}),await writeFile(_0x362d69,JSON[_0x9a6ce8(0xcc)](_0x43615a,null,0x2),_0x9a6ce8(0xcf));}
@@ -1 +1 @@
1
- function a231_0x3cba(_0x30aa6b,_0x375469){_0x30aa6b=_0x30aa6b-0x100;const _0x5851cf=a231_0x5851();let _0x3cbad9=_0x5851cf[_0x30aa6b];return _0x3cbad9;}(function(_0xaa1781,_0x2367a6){const _0x3a029f=a231_0x3cba,_0x16e552=_0xaa1781();while(!![]){try{const _0x3a57e3=-parseInt(_0x3a029f(0x104))/0x1+parseInt(_0x3a029f(0x134))/0x2+-parseInt(_0x3a029f(0x106))/0x3*(parseInt(_0x3a029f(0x108))/0x4)+-parseInt(_0x3a029f(0x13b))/0x5*(-parseInt(_0x3a029f(0x11e))/0x6)+-parseInt(_0x3a029f(0x146))/0x7+parseInt(_0x3a029f(0x116))/0x8+parseInt(_0x3a029f(0x122))/0x9;if(_0x3a57e3===_0x2367a6)break;else _0x16e552['push'](_0x16e552['shift']());}catch(_0x103d3e){_0x16e552['push'](_0x16e552['shift']());}}}(a231_0x5851,0xb3a84));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x5a7e95,_0x2eb208){const _0x498b79=a231_0x3cba,_0x346d7d=[],_0x46dbe3=normalizeSqlForStaticAnalysis(_0x5a7e95),_0x2bf4a9=(_0x46dbe3[_0x498b79(0x103)]?[]:extractJoinFacts(_0x46dbe3['sql']))[_0x498b79(0x120)](_0x1b7828=>{const _0x37a86f=_0x498b79;if(_0x1b7828['unsupportedPredicate']||_0x1b7828[_0x37a86f(0x12c)]['length']===0x0)return _0x346d7d[_0x37a86f(0x109)]({'code':_0x37a86f(0x13d),'table':_0x1b7828[_0x37a86f(0x145)],'alias':_0x1b7828[_0x37a86f(0x13e)],'columns':_0x1b7828['columns'],'reason':_0x1b7828['unsupportedReason']??_0x37a86f(0x12b)}),{'table':_0x1b7828[_0x37a86f(0x145)],'alias':_0x1b7828[_0x37a86f(0x13e)],'columns':_0x1b7828[_0x37a86f(0x12c)],'status':'unavailable'};const _0x5dae07=resolveTableMetadata(_0x2eb208,_0x1b7828['table']),_0x533079=(_0x5dae07?.[_0x37a86f(0x10b)]??[])[_0x37a86f(0x120)](_0x28c321=>({'index':_0x28c321,'matchedPrefix':findEqualityPrefix(_0x28c321[_0x37a86f(0x12c)],_0x1b7828[_0x37a86f(0x12c)])}))[_0x37a86f(0x149)](_0x2991ba=>_0x2991ba[_0x37a86f(0x137)][_0x37a86f(0x12f)]>0x0),_0x186b0d=_0x533079[_0x37a86f(0x130)]((_0x3b9d55,_0x37c890)=>!_0x3b9d55||_0x37c890[_0x37a86f(0x137)][_0x37a86f(0x12f)]>_0x3b9d55['matchedPrefix'][_0x37a86f(0x12f)]?_0x37c890:_0x3b9d55,_0x533079[0x0]);if(_0x186b0d)return{'table':_0x1b7828[_0x37a86f(0x145)],'alias':_0x1b7828['alias'],'columns':_0x1b7828[_0x37a86f(0x12c)],'status':_0x37a86f(0x124),'matchedIndex':{..._0x186b0d[_0x37a86f(0x142)],'matchedPrefix':_0x186b0d['matchedPrefix']}};const _0x507a6f=_0x5dae07?.['indexes'][_0x37a86f(0x149)](_0x204cc4=>_0x204cc4[_0x37a86f(0x12c)][_0x37a86f(0x101)](_0x5b53bc=>_0x1b7828[_0x37a86f(0x12c)][_0x37a86f(0x101)](_0x125661=>columnNamesMatch(_0x5b53bc,_0x125661))))??[];if(_0x507a6f[_0x37a86f(0x12f)]>0x0)return _0x346d7d[_0x37a86f(0x109)]({'code':_0x37a86f(0x102),'table':_0x1b7828['table'],'alias':_0x1b7828[_0x37a86f(0x13e)],'columns':_0x1b7828['columns'],'reason':_0x37a86f(0x12a)}),{'table':_0x1b7828['table'],'alias':_0x1b7828[_0x37a86f(0x13e)],'columns':_0x1b7828[_0x37a86f(0x12c)],'status':_0x37a86f(0x11f),'candidateIndexes':_0x507a6f};if(_0x5dae07&&_0x5dae07[_0x37a86f(0x13f)]!==![]&&_0x5dae07[_0x37a86f(0x10b)][_0x37a86f(0x12f)]>0x0&&_0x1b7828[_0x37a86f(0x12c)][_0x37a86f(0x12f)]>0x0)return _0x346d7d['push']({'code':_0x37a86f(0x138),'table':_0x1b7828['table'],'alias':_0x1b7828[_0x37a86f(0x13e)],'columns':_0x1b7828[_0x37a86f(0x12c)],'reason':_0x37a86f(0x117)}),{'table':_0x1b7828[_0x37a86f(0x145)],'alias':_0x1b7828[_0x37a86f(0x13e)],'columns':_0x1b7828[_0x37a86f(0x12c)],'status':'warning'};return _0x346d7d[_0x37a86f(0x109)]({'code':_0x37a86f(0x14b),'table':_0x1b7828['table'],'alias':_0x1b7828['alias'],'columns':_0x1b7828[_0x37a86f(0x12c)],'reason':_0x5dae07?_0x37a86f(0x115):_0x37a86f(0x123)}),{'table':_0x1b7828[_0x37a86f(0x145)],'alias':_0x1b7828[_0x37a86f(0x13e)],'columns':_0x1b7828[_0x37a86f(0x12c)],'status':'unavailable'};});return{'checked':_0x2bf4a9[_0x498b79(0x12f)]>0x0,'joins':_0x2bf4a9,'warnings':_0x346d7d};}function extractJoinFacts(_0x3e1b40){const _0x55a6b1=a231_0x3cba,_0xf701f3=maskNestedQueries(stripSqlNoise(_0x3e1b40)),_0x385662=maskQuotedIdentifiers(_0xf701f3),_0x933afc=[],_0x103d2b=new Set(),_0x2821cf=/\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 _0x37bfc0 of _0xf701f3['matchAll'](_0x2821cf)){const _0x1e2516=_0x37bfc0[_0x55a6b1(0x142)]??0x0,_0x434e83=_0x37bfc0[0x0][_0x55a6b1(0x121)](/\bJOIN\b/i),_0x48c31d=_0x1e2516+Math[_0x55a6b1(0x10f)](0x0,_0x434e83);if(!/^JOIN\b/i[_0x55a6b1(0x127)](_0x385662[_0x55a6b1(0x111)](_0x48c31d)))continue;_0x103d2b[_0x55a6b1(0x11c)](_0x48c31d);const _0x18f1e4=normalizeIdentifier(_0x37bfc0[0x1]||_0x55a6b1(0x136)),_0x35571d=normalizeIdentifier(_0x37bfc0[0x2]??''),_0x4e62f4=normalizeIdentifier(_0x37bfc0[0x3]||_0x35571d['split']('.')['at'](-0x1)||_0x35571d),_0xbc7c86=[],_0x4e81e9=_0x35571d===_0x55a6b1(0x13a);let _0xc508a9=_0x18f1e4===_0x55a6b1(0x11a)||_0x18f1e4===_0x55a6b1(0x10c)||_0x4e81e9,_0x2b407d=_0xc508a9?_0x4e81e9?_0x55a6b1(0x10d):_0x18f1e4[_0x55a6b1(0x133)]()+_0x55a6b1(0x131):undefined;const _0x35486c=stripOuterParentheses(_0x37bfc0[0x4]??''),_0x7b4b33=_0x35486c['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x35486c[_0x55a6b1(0x139)](MYBATIS_DYNAMIC_END_MARKER),_0x38b3ae=_0x35486c[_0x55a6b1(0x139)](MYBATIS_INCLUDE_MARKER);_0x7b4b33&&(_0xc508a9=!![],_0x2b407d??=_0x55a6b1(0x128));_0x38b3ae&&(_0xc508a9=!![],_0x2b407d??=_0x55a6b1(0x144));const _0x5d5ee6=_0x35486c[_0x55a6b1(0x119)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x55a6b1(0x119)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x55a6b1(0x119)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x5d5ee6,'OR')&&(_0xc508a9=!![],_0x2b407d??=_0x55a6b1(0x100));for(const _0x270cac of splitTopLevelAnd(_0x5d5ee6)){const _0x45770c=stripOuterParentheses(_0x270cac);if(hasTopLevelKeyword(_0x45770c,'OR')){_0xc508a9=!![],_0x2b407d??=_0x55a6b1(0x100);continue;}const _0x19e0df=splitEquality(_0x45770c);if(!_0x19e0df){containsColumnReference(_0x270cac,_0x4e62f4)&&(_0xc508a9=!![]);continue;}const _0x7e52bc=parseDirectColumnReference(_0x19e0df[0x0],_0x4e62f4),_0x2b3ba9=parseDirectColumnReference(_0x19e0df[0x1],_0x4e62f4),_0x22371a=containsColumnReference(_0x19e0df[0x0],_0x4e62f4),_0x1de3d7=containsColumnReference(_0x19e0df[0x1],_0x4e62f4),_0xc57d48=_0x7e52bc&&!_0x1de3d7?_0x7e52bc:_0x2b3ba9&&!_0x22371a?_0x2b3ba9:null;if(_0xc57d48&&!_0xbc7c86[_0x55a6b1(0x139)](_0xc57d48))_0xbc7c86[_0x55a6b1(0x109)](_0xc57d48);else!_0xc57d48&&containsColumnReference(_0x270cac,_0x4e62f4)&&(_0xc508a9=!![]);}_0x933afc[_0x55a6b1(0x109)]({'table':_0x35571d,'alias':_0x4e62f4,'columns':_0xbc7c86,'unsupportedPredicate':_0xc508a9,'unsupportedReason':_0x2b407d,'containsUnresolvedInclude':_0x38b3ae,'position':_0x48c31d});}for(const _0x3eae81 of _0x385662[_0x55a6b1(0x13c)](/\bJOIN\b/gi)){const _0x4fb5af=_0x3eae81[_0x55a6b1(0x142)]??0x0;if(_0x103d2b[_0x55a6b1(0x105)](_0x4fb5af))continue;const _0x9d1131=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x55a6b1(0x143)](_0xf701f3[_0x55a6b1(0x111)](_0x4fb5af+_0x3eae81[0x0][_0x55a6b1(0x12f)])),_0x103da9=normalizeIdentifier(_0x9d1131?.[0x1]||_0x55a6b1(0x113)),_0x566781=normalizeIdentifier(_0x9d1131?.[0x2]||''),_0x2e8964=isSqlClauseKeyword(_0x566781)?_0x103da9[_0x55a6b1(0x10e)]('.')['at'](-0x1)||_0x103da9:_0x566781||_0x103da9['split']('.')['at'](-0x1)||_0x103da9;_0x933afc['push']({'table':_0x103da9,'alias':_0x2e8964,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x55a6b1(0x12d),'position':_0x4fb5af});}const _0x3b36de=_0x385662[_0x55a6b1(0x140)](MYBATIS_INCLUDE_MARKER);return _0x3b36de>=0x0&&!_0x933afc[_0x55a6b1(0x101)](_0x27e7cf=>_0x27e7cf[_0x55a6b1(0x114)])&&_0x933afc[_0x55a6b1(0x109)]({'table':_0x55a6b1(0x113),'alias':_0x55a6b1(0x113),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x55a6b1(0x118),'containsUnresolvedInclude':!![],'position':_0x3b36de}),_0x933afc[_0x55a6b1(0x126)]((_0x1eb8b8,_0x1768b1)=>_0x1eb8b8[_0x55a6b1(0x148)]-_0x1768b1[_0x55a6b1(0x148)]);}function stripSqlNoise(_0x1d630c){const _0x5a232b=a231_0x3cba,_0x182457=Array[_0x5a232b(0x12e)](_0x1d630c),_0x46e04d=(_0x525433,_0x2a3cd6)=>{for(let _0x1fc15b=_0x525433;_0x1fc15b<_0x2a3cd6;_0x1fc15b+=0x1){_0x182457[_0x1fc15b]!=='\x0a'&&_0x182457[_0x1fc15b]!=='\x0d'&&(_0x182457[_0x1fc15b]='\x20');}};for(let _0x2cd06b=0x0;_0x2cd06b<_0x182457['length'];_0x2cd06b+=0x1){const _0x3367cf=_0x182457[_0x2cd06b],_0x4d312f=_0x182457[_0x2cd06b+0x1];if(_0x3367cf==='\x27'||_0x3367cf==='\x22'||_0x3367cf==='`'){const _0x212028=_0x3367cf,_0x4d9f8c=_0x2cd06b;_0x2cd06b+=0x1;while(_0x2cd06b<_0x182457[_0x5a232b(0x12f)]){if(_0x182457[_0x2cd06b]==='\x5c'&&_0x2cd06b+0x1<_0x182457[_0x5a232b(0x12f)]){_0x2cd06b+=0x2;continue;}if(_0x182457[_0x2cd06b]!==_0x212028){_0x2cd06b+=0x1;continue;}if(_0x182457[_0x2cd06b+0x1]===_0x212028){_0x2cd06b+=0x2;continue;}break;}if(_0x212028==='\x27')_0x46e04d(_0x4d9f8c,Math[_0x5a232b(0x11b)](_0x2cd06b+0x1,_0x182457['length']));continue;}if(_0x3367cf==='-'&&_0x4d312f==='-'){const _0x1eb439=_0x2cd06b;while(_0x2cd06b<_0x182457['length']&&_0x182457[_0x2cd06b]!=='\x0a')_0x2cd06b+=0x1;_0x46e04d(_0x1eb439,_0x2cd06b);continue;}if(_0x3367cf==='/'&&_0x4d312f==='*'){const _0x5a63b2=_0x2cd06b;_0x2cd06b+=0x2;while(_0x2cd06b<_0x182457['length']&&!(_0x182457[_0x2cd06b]==='*'&&_0x182457[_0x2cd06b+0x1]==='/')){_0x2cd06b+=0x1;}_0x2cd06b=Math[_0x5a232b(0x11b)](_0x2cd06b+0x1,_0x182457[_0x5a232b(0x12f)]-0x1),_0x46e04d(_0x5a63b2,_0x2cd06b+0x1);continue;}if(_0x3367cf==='#'&&_0x4d312f!=='{'){const _0x534464=_0x2cd06b;while(_0x2cd06b<_0x182457[_0x5a232b(0x12f)]&&_0x182457[_0x2cd06b]!=='\x0a')_0x2cd06b+=0x1;_0x46e04d(_0x534464,_0x2cd06b);continue;}if((_0x3367cf==='#'||_0x3367cf==='$')&&_0x4d312f==='{'){const _0x1ea897=_0x2cd06b;_0x2cd06b+=0x2;while(_0x2cd06b<_0x182457[_0x5a232b(0x12f)]&&_0x182457[_0x2cd06b]!=='}')_0x2cd06b+=0x1;_0x46e04d(_0x1ea897,Math[_0x5a232b(0x11b)](_0x2cd06b+0x1,_0x182457[_0x5a232b(0x12f)]));}}return _0x182457[_0x5a232b(0x147)]('');}function maskQuotedIdentifiers(_0x1ac020){const _0x38631c=a231_0x3cba,_0x53cdc9=Array[_0x38631c(0x12e)](_0x1ac020);for(let _0x46b897=0x0;_0x46b897<_0x53cdc9[_0x38631c(0x12f)];_0x46b897+=0x1){const _0x5cc742=_0x53cdc9[_0x46b897];if(_0x5cc742!=='\x22'&&_0x5cc742!=='`')continue;_0x46b897+=0x1;while(_0x46b897<_0x53cdc9[_0x38631c(0x12f)]){if(_0x53cdc9[_0x46b897]===_0x5cc742){if(_0x53cdc9[_0x46b897+0x1]===_0x5cc742){_0x53cdc9[_0x46b897]='\x20',_0x53cdc9[_0x46b897+0x1]='\x20',_0x46b897+=0x2;continue;}break;}_0x53cdc9[_0x46b897]='\x20',_0x46b897+=0x1;}}return _0x53cdc9['join']('');}function maskNestedQueries(_0x5e0eb3){const _0x3a8af9=a231_0x3cba,_0x2457fc=Array[_0x3a8af9(0x12e)](_0x5e0eb3);for(let _0x3c9878=0x0;_0x3c9878<_0x2457fc['length'];_0x3c9878+=0x1){if(_0x2457fc[_0x3c9878]!=='(')continue;const _0x2671d2=_0x5e0eb3[_0x3a8af9(0x111)](_0x3c9878+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x3a8af9(0x127)](_0x2671d2))continue;let _0x30fd99=0x1,_0x56f654=_0x3c9878+0x1;for(;_0x56f654<_0x2457fc[_0x3a8af9(0x12f)]&&_0x30fd99>0x0;_0x56f654+=0x1){if(_0x2457fc[_0x56f654]==='(')_0x30fd99+=0x1;if(_0x2457fc[_0x56f654]===')')_0x30fd99-=0x1;}if(_0x30fd99!==0x0)continue;for(let _0x2488eb=_0x3c9878;_0x2488eb<_0x56f654;_0x2488eb+=0x1){_0x2457fc[_0x2488eb]='\x20';}const _0x392fc8='__sq__';for(let _0x2be582=0x0;_0x2be582<_0x392fc8[_0x3a8af9(0x12f)]&&_0x3c9878+_0x2be582<_0x56f654;_0x2be582+=0x1){_0x2457fc[_0x3c9878+_0x2be582]=_0x392fc8[_0x2be582];}_0x3c9878=_0x56f654-0x1;}return _0x2457fc[_0x3a8af9(0x147)]('');}function splitTopLevelAnd(_0x122c3a){const _0x4934c2=a231_0x3cba,_0x2e11d7=[];let _0xdf58c1=0x0,_0x38c9d9=0x0;for(let _0x416663=0x0;_0x416663<_0x122c3a[_0x4934c2(0x12f)];_0x416663+=0x1){const _0x37ce0c=_0x122c3a[_0x416663];if(_0x37ce0c==='(')_0xdf58c1+=0x1;if(_0x37ce0c===')')_0xdf58c1=Math[_0x4934c2(0x10f)](0x0,_0xdf58c1-0x1);_0xdf58c1===0x0&&_0x122c3a['slice'](_0x416663)['match'](/^AND\b/i)&&(_0x416663===0x0||/\s/['test'](_0x122c3a[_0x416663-0x1]??''))&&(_0x2e11d7[_0x4934c2(0x109)](_0x122c3a[_0x4934c2(0x111)](_0x38c9d9,_0x416663)[_0x4934c2(0x141)]()),_0x416663+=0x2,_0x38c9d9=_0x416663+0x1);}const _0x1dd6db=_0x122c3a[_0x4934c2(0x111)](_0x38c9d9)[_0x4934c2(0x141)]();if(_0x1dd6db)_0x2e11d7[_0x4934c2(0x109)](_0x1dd6db);return _0x2e11d7;}function hasTopLevelKeyword(_0x46f52e,_0x45e419){const _0xd26b53=a231_0x3cba;let _0x5aecfd=0x0;for(let _0x526fbe=0x0;_0x526fbe<_0x46f52e[_0xd26b53(0x12f)];_0x526fbe+=0x1){const _0xcf0b30=_0x46f52e[_0x526fbe];if(_0xcf0b30==='(')_0x5aecfd+=0x1;if(_0xcf0b30===')')_0x5aecfd=Math[_0xd26b53(0x10f)](0x0,_0x5aecfd-0x1);if(_0x5aecfd!==0x0)continue;const _0x1cf06f=_0x46f52e['slice'](_0x526fbe,_0x526fbe+_0x45e419[_0xd26b53(0x12f)]),_0x3a6826=_0x46f52e[_0x526fbe-0x1]??'\x20',_0x2c477f=_0x46f52e[_0x526fbe+_0x45e419[_0xd26b53(0x12f)]]??'\x20';if(_0x1cf06f['toUpperCase']()===_0x45e419[_0xd26b53(0x133)]()&&!/[\w$]/[_0xd26b53(0x127)](_0x3a6826)&&!/[\w$]/[_0xd26b53(0x127)](_0x2c477f))return!![];}return![];}function splitEquality(_0x10df56){const _0x17dfc7=a231_0x3cba,_0xfd9526=stripOuterParentheses(_0x10df56);let _0x8d34cf=0x0,_0xd85c67;for(let _0x813141=0x0;_0x813141<_0xfd9526['length'];_0x813141+=0x1){const _0x5d59cd=_0xfd9526[_0x813141];if(_0x5d59cd==='(')_0x8d34cf+=0x1;if(_0x5d59cd===')')_0x8d34cf=Math['max'](0x0,_0x8d34cf-0x1);const _0x4de4b3=_0xfd9526[_0x813141-0x1]??'',_0x3669d2=_0xfd9526[_0x813141+0x1]??'';if(_0x5d59cd==='='&&_0x8d34cf===0x0&&!/[!<>=:]/[_0x17dfc7(0x127)](_0x4de4b3)&&_0x3669d2!=='='){if(_0xd85c67!==undefined)return null;_0xd85c67=_0x813141;}}return _0xd85c67===undefined?null:[_0xfd9526[_0x17dfc7(0x111)](0x0,_0xd85c67)[_0x17dfc7(0x141)](),_0xfd9526[_0x17dfc7(0x111)](_0xd85c67+0x1)[_0x17dfc7(0x141)]()];}function parseDirectColumnReference(_0x2af45c,_0x1f0397){const _0x84ddef=a231_0x3cba,_0x44c7ac=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x84ddef(0x143)](stripOuterParentheses(_0x2af45c));if(!_0x44c7ac)return null;if(normalizeIdentifier(_0x44c7ac[0x1]??'')!==normalizeIdentifier(_0x1f0397))return null;return normalizeIdentifier(_0x44c7ac[0x2]??'');}function containsColumnReference(_0x558a6e,_0x8fe3f9){const _0x47aa4b=a231_0x3cba,_0x208c4a=_0x558a6e[_0x47aa4b(0x132)](/[`"]/g,''),_0x143184=_0x8fe3f9[_0x47aa4b(0x132)](/[.*+?^${}()|[\]\\]/g,_0x47aa4b(0x129));return new RegExp('(?:^|[^\x5cw$])'+_0x143184+_0x47aa4b(0x112),'i')[_0x47aa4b(0x127)](_0x208c4a);}function findEqualityPrefix(_0x4478b3,_0x3c0663){const _0x527577=a231_0x3cba,_0x338739=new Set(_0x3c0663[_0x527577(0x120)](normalizeIdentifier)),_0x1f0372=[];for(const _0x6afb43 of _0x4478b3){if(!_0x338739[_0x527577(0x105)](normalizeIdentifier(_0x6afb43)))break;_0x1f0372[_0x527577(0x109)](_0x6afb43);}return _0x1f0372;}function a231_0x5851(){const _0x587a1d=['Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','columns','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','from','length','reduce','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','replace','toUpperCase','970070JcGHGE','inner','INNER','matchedPrefix','JOIN_INDEX_MISSING','includes','__sq__','35nAFKlS','matchAll','JOIN_PREDICATE_UNSUPPORTED','alias','metadataAvailable','indexOf','trim','index','exec','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','table','6125644akDVzc','join','position','filter','endsWith','INDEX_METADATA_UNAVAILABLE','toLowerCase','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','some','JOIN_INDEX_NOT_USABLE','error','65410oPonXi','has','629247ToWRkc','left','28cgDBJI','push','using','indexes','full','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','split','max','startsWith','slice','\x5cs*\x5c.\x5cs*[\x5cw$]+','unknown','containsUnresolvedInclude','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','3180640MWMPKr','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','replaceAll','right','min','add','tableName','1014756XhLCRl','warning','map','search','9703116hNiEyG','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','covered','where','sort','test','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','\x5c$&','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'];a231_0x5851=function(){return _0x587a1d;};return a231_0x5851();}function resolveTableMetadata(_0xf0f516,_0x1943ba){const _0x306bcc=a231_0x3cba,_0x2180fa=normalizeIdentifier(_0x1943ba),_0x32ed93=_0xf0f516[_0x306bcc(0x149)](_0x62ae64=>normalizeIdentifier(_0x62ae64['tableName'])===_0x2180fa);if(_0x32ed93[_0x306bcc(0x12f)]===0x1)return _0x32ed93[0x0];const _0x420497=_0x2180fa[_0x306bcc(0x139)]('.'),_0x3b2666=_0x2180fa[_0x306bcc(0x10e)]('.')['at'](-0x1),_0x4398b2=_0xf0f516[_0x306bcc(0x149)](_0x66adb7=>{const _0x53ee69=_0x306bcc,_0x79c146=normalizeIdentifier(_0x66adb7[_0x53ee69(0x11d)]);if(_0x420497&&_0x79c146[_0x53ee69(0x139)]('.'))return![];return _0x79c146[_0x53ee69(0x10e)]('.')['at'](-0x1)===_0x3b2666;});return _0x4398b2['length']===0x1?_0x4398b2[0x0]:undefined;}function columnNamesMatch(_0x4084d2,_0x432777){return normalizeIdentifier(_0x4084d2)===normalizeIdentifier(_0x432777);}function normalizeIdentifier(_0x91e18a){const _0x284e55=a231_0x3cba;return _0x91e18a[_0x284e55(0x132)](/[`"]/g,'')[_0x284e55(0x141)]()[_0x284e55(0x14c)]();}function isSqlClauseKeyword(_0x24c4e9){const _0x25e6bd=a231_0x3cba;return new Set(['on',_0x25e6bd(0x10a),_0x25e6bd(0x125),_0x25e6bd(0x147),_0x25e6bd(0x135),_0x25e6bd(0x107),_0x25e6bd(0x11a),_0x25e6bd(0x10c),'cross','natural'])['has'](_0x24c4e9);}function stripOuterParentheses(_0x4dcda0){const _0x5c74e0=a231_0x3cba;let _0x4faf28=_0x4dcda0[_0x5c74e0(0x141)]();while(_0x4faf28[_0x5c74e0(0x110)]('(')&&_0x4faf28[_0x5c74e0(0x14a)](')')){let _0x4e4f51=0x0,_0x36d2a3=!![];for(let _0x4fffce=0x0;_0x4fffce<_0x4faf28[_0x5c74e0(0x12f)];_0x4fffce+=0x1){if(_0x4faf28[_0x4fffce]==='(')_0x4e4f51+=0x1;if(_0x4faf28[_0x4fffce]===')')_0x4e4f51-=0x1;if(_0x4e4f51===0x0&&_0x4fffce<_0x4faf28[_0x5c74e0(0x12f)]-0x1){_0x36d2a3=![];break;}}if(!_0x36d2a3||_0x4e4f51!==0x0)break;_0x4faf28=_0x4faf28[_0x5c74e0(0x111)](0x1,-0x1)[_0x5c74e0(0x141)]();}return _0x4faf28;}
1
+ (function(_0x389553,_0x479f2c){const _0x3af878=a231_0x430a,_0x13fb40=_0x389553();while(!![]){try{const _0x3eb30d=-parseInt(_0x3af878(0xc0))/0x1*(-parseInt(_0x3af878(0xb7))/0x2)+parseInt(_0x3af878(0xd2))/0x3+-parseInt(_0x3af878(0xbe))/0x4+-parseInt(_0x3af878(0xd6))/0x5*(parseInt(_0x3af878(0xe5))/0x6)+parseInt(_0x3af878(0xb6))/0x7*(-parseInt(_0x3af878(0xe1))/0x8)+-parseInt(_0x3af878(0xe8))/0x9+parseInt(_0x3af878(0xf2))/0xa;if(_0x3eb30d===_0x479f2c)break;else _0x13fb40['push'](_0x13fb40['shift']());}catch(_0x5e082e){_0x13fb40['push'](_0x13fb40['shift']());}}}(a231_0x4c78,0xc76e5));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x4e0f6a,_0x1a5cf1){const _0x9bb2a8=a231_0x430a,_0x123e88=[],_0x3b04cb=normalizeSqlForStaticAnalysis(_0x4e0f6a),_0x21657c=(_0x3b04cb[_0x9bb2a8(0xcb)]?[]:extractJoinFacts(_0x3b04cb[_0x9bb2a8(0xd7)]))[_0x9bb2a8(0xf8)](_0x25a1f3=>{const _0x22ccce=_0x9bb2a8;if(_0x25a1f3[_0x22ccce(0xfe)]||_0x25a1f3[_0x22ccce(0xd5)][_0x22ccce(0xf6)]===0x0)return _0x123e88['push']({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x25a1f3[_0x22ccce(0xf0)],'alias':_0x25a1f3[_0x22ccce(0xf4)],'columns':_0x25a1f3[_0x22ccce(0xd5)],'reason':_0x25a1f3['unsupportedReason']??_0x22ccce(0xe7)}),{'table':_0x25a1f3[_0x22ccce(0xf0)],'alias':_0x25a1f3[_0x22ccce(0xf4)],'columns':_0x25a1f3[_0x22ccce(0xd5)],'status':'unavailable'};const _0x3e4c65=resolveTableMetadata(_0x1a5cf1,_0x25a1f3['table']),_0x53106b=(_0x3e4c65?.[_0x22ccce(0xc4)]??[])[_0x22ccce(0xf8)](_0xa4292=>({'index':_0xa4292,'matchedPrefix':findEqualityPrefix(_0xa4292[_0x22ccce(0xd5)],_0x25a1f3[_0x22ccce(0xd5)])}))[_0x22ccce(0xb9)](_0x2722d0=>_0x2722d0[_0x22ccce(0xfc)][_0x22ccce(0xf6)]>0x0),_0x16979d=_0x53106b[_0x22ccce(0xc7)]((_0x5c96a0,_0x348ca3)=>!_0x5c96a0||_0x348ca3[_0x22ccce(0xfc)][_0x22ccce(0xf6)]>_0x5c96a0[_0x22ccce(0xfc)][_0x22ccce(0xf6)]?_0x348ca3:_0x5c96a0,_0x53106b[0x0]);if(_0x16979d)return{'table':_0x25a1f3[_0x22ccce(0xf0)],'alias':_0x25a1f3[_0x22ccce(0xf4)],'columns':_0x25a1f3[_0x22ccce(0xd5)],'status':'covered','matchedIndex':{..._0x16979d['index'],'matchedPrefix':_0x16979d[_0x22ccce(0xfc)]}};const _0x9f01d6=_0x3e4c65?.['indexes'][_0x22ccce(0xb9)](_0x3219db=>_0x3219db[_0x22ccce(0xd5)]['some'](_0x4c9f72=>_0x25a1f3[_0x22ccce(0xd5)]['some'](_0x5a94dd=>columnNamesMatch(_0x4c9f72,_0x5a94dd))))??[];if(_0x9f01d6[_0x22ccce(0xf6)]>0x0)return _0x123e88[_0x22ccce(0xd3)]({'code':_0x22ccce(0xe2),'table':_0x25a1f3['table'],'alias':_0x25a1f3[_0x22ccce(0xf4)],'columns':_0x25a1f3[_0x22ccce(0xd5)],'reason':_0x22ccce(0xe9)}),{'table':_0x25a1f3[_0x22ccce(0xf0)],'alias':_0x25a1f3['alias'],'columns':_0x25a1f3[_0x22ccce(0xd5)],'status':_0x22ccce(0xd0),'candidateIndexes':_0x9f01d6};if(_0x3e4c65&&_0x3e4c65[_0x22ccce(0xb5)]!==![]&&_0x3e4c65[_0x22ccce(0xc4)]['length']>0x0&&_0x25a1f3[_0x22ccce(0xd5)][_0x22ccce(0xf6)]>0x0)return _0x123e88[_0x22ccce(0xd3)]({'code':_0x22ccce(0xf5),'table':_0x25a1f3[_0x22ccce(0xf0)],'alias':_0x25a1f3[_0x22ccce(0xf4)],'columns':_0x25a1f3[_0x22ccce(0xd5)],'reason':_0x22ccce(0xbd)}),{'table':_0x25a1f3[_0x22ccce(0xf0)],'alias':_0x25a1f3[_0x22ccce(0xf4)],'columns':_0x25a1f3['columns'],'status':'warning'};return _0x123e88['push']({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x25a1f3[_0x22ccce(0xf0)],'alias':_0x25a1f3[_0x22ccce(0xf4)],'columns':_0x25a1f3[_0x22ccce(0xd5)],'reason':_0x3e4c65?_0x22ccce(0xc9):_0x22ccce(0xc1)}),{'table':_0x25a1f3[_0x22ccce(0xf0)],'alias':_0x25a1f3['alias'],'columns':_0x25a1f3[_0x22ccce(0xd5)],'status':_0x22ccce(0xfb)};});return{'checked':_0x21657c[_0x9bb2a8(0xf6)]>0x0,'joins':_0x21657c,'warnings':_0x123e88};}function extractJoinFacts(_0x17c099){const _0x384862=a231_0x430a,_0x20bc3a=maskNestedQueries(stripSqlNoise(_0x17c099)),_0x3ce8ae=maskQuotedIdentifiers(_0x20bc3a),_0x4ca9aa=[],_0x287f71=new Set(),_0x454b50=/\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 _0xd48868 of _0x20bc3a[_0x384862(0xe3)](_0x454b50)){const _0x3330ca=_0xd48868[_0x384862(0xca)]??0x0,_0x3a0ff4=_0xd48868[0x0]['search'](/\bJOIN\b/i),_0x868293=_0x3330ca+Math['max'](0x0,_0x3a0ff4);if(!/^JOIN\b/i[_0x384862(0xda)](_0x3ce8ae[_0x384862(0xcd)](_0x868293)))continue;_0x287f71[_0x384862(0xf1)](_0x868293);const _0x585711=normalizeIdentifier(_0xd48868[0x1]||_0x384862(0xe4)),_0x244414=normalizeIdentifier(_0xd48868[0x2]??''),_0x4b15a=normalizeIdentifier(_0xd48868[0x3]||_0x244414[_0x384862(0xef)]('.')['at'](-0x1)||_0x244414),_0x562889=[],_0x29dc2e=_0x244414===_0x384862(0xe0);let _0x57ef0b=_0x585711===_0x384862(0xc6)||_0x585711===_0x384862(0xc8)||_0x29dc2e,_0x5981a0=_0x57ef0b?_0x29dc2e?_0x384862(0xba):_0x585711['toUpperCase']()+_0x384862(0xcc):undefined;const _0x4a4961=stripOuterParentheses(_0xd48868[0x4]??''),_0xbd0737=_0x4a4961[_0x384862(0xdc)](MYBATIS_DYNAMIC_START_MARKER)||_0x4a4961[_0x384862(0xdc)](MYBATIS_DYNAMIC_END_MARKER),_0x24891e=_0x4a4961[_0x384862(0xdc)](MYBATIS_INCLUDE_MARKER);_0xbd0737&&(_0x57ef0b=!![],_0x5981a0??=_0x384862(0xc3));_0x24891e&&(_0x57ef0b=!![],_0x5981a0??=_0x384862(0xea));const _0x3a27fa=_0x4a4961[_0x384862(0xff)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x384862(0xff)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x3a27fa,'OR')&&(_0x57ef0b=!![],_0x5981a0??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x5725bf of splitTopLevelAnd(_0x3a27fa)){const _0x3b80d2=stripOuterParentheses(_0x5725bf);if(hasTopLevelKeyword(_0x3b80d2,'OR')){_0x57ef0b=!![],_0x5981a0??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x569b75=splitEquality(_0x3b80d2);if(!_0x569b75){containsColumnReference(_0x5725bf,_0x4b15a)&&(_0x57ef0b=!![]);continue;}const _0x5505bb=parseDirectColumnReference(_0x569b75[0x0],_0x4b15a),_0x3b2d4e=parseDirectColumnReference(_0x569b75[0x1],_0x4b15a),_0x4e8a9a=containsColumnReference(_0x569b75[0x0],_0x4b15a),_0x5cee3e=containsColumnReference(_0x569b75[0x1],_0x4b15a),_0x59bcb4=_0x5505bb&&!_0x5cee3e?_0x5505bb:_0x3b2d4e&&!_0x4e8a9a?_0x3b2d4e:null;if(_0x59bcb4&&!_0x562889[_0x384862(0xdc)](_0x59bcb4))_0x562889['push'](_0x59bcb4);else!_0x59bcb4&&containsColumnReference(_0x5725bf,_0x4b15a)&&(_0x57ef0b=!![]);}_0x4ca9aa[_0x384862(0xd3)]({'table':_0x244414,'alias':_0x4b15a,'columns':_0x562889,'unsupportedPredicate':_0x57ef0b,'unsupportedReason':_0x5981a0,'containsUnresolvedInclude':_0x24891e,'position':_0x868293});}for(const _0x3ce8c8 of _0x3ce8ae[_0x384862(0xe3)](/\bJOIN\b/gi)){const _0x2a6cf7=_0x3ce8c8[_0x384862(0xca)]??0x0;if(_0x287f71[_0x384862(0xf7)](_0x2a6cf7))continue;const _0x3f3a8c=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x384862(0xce)](_0x20bc3a['slice'](_0x2a6cf7+_0x3ce8c8[0x0][_0x384862(0xf6)])),_0xf7555a=normalizeIdentifier(_0x3f3a8c?.[0x1]||_0x384862(0xc5)),_0x5f25b4=normalizeIdentifier(_0x3f3a8c?.[0x2]||''),_0x4b237d=isSqlClauseKeyword(_0x5f25b4)?_0xf7555a[_0x384862(0xef)]('.')['at'](-0x1)||_0xf7555a:_0x5f25b4||_0xf7555a[_0x384862(0xef)]('.')['at'](-0x1)||_0xf7555a;_0x4ca9aa['push']({'table':_0xf7555a,'alias':_0x4b237d,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x384862(0xd1),'position':_0x2a6cf7});}const _0x21db5d=_0x3ce8ae[_0x384862(0xfd)](MYBATIS_INCLUDE_MARKER);return _0x21db5d>=0x0&&!_0x4ca9aa[_0x384862(0xed)](_0x20d501=>_0x20d501[_0x384862(0xe6)])&&_0x4ca9aa[_0x384862(0xd3)]({'table':'unknown','alias':_0x384862(0xc5),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x384862(0xb8),'containsUnresolvedInclude':!![],'position':_0x21db5d}),_0x4ca9aa[_0x384862(0xc2)]((_0x1693e5,_0x53a28b)=>_0x1693e5[_0x384862(0xdb)]-_0x53a28b[_0x384862(0xdb)]);}function stripSqlNoise(_0x30a966){const _0x1591d9=a231_0x430a,_0x2b217a=Array[_0x1591d9(0xbc)](_0x30a966),_0x2e1056=(_0x1a4659,_0x48c01e)=>{for(let _0x47ad82=_0x1a4659;_0x47ad82<_0x48c01e;_0x47ad82+=0x1){_0x2b217a[_0x47ad82]!=='\x0a'&&_0x2b217a[_0x47ad82]!=='\x0d'&&(_0x2b217a[_0x47ad82]='\x20');}};for(let _0xe29261=0x0;_0xe29261<_0x2b217a[_0x1591d9(0xf6)];_0xe29261+=0x1){const _0x2e2364=_0x2b217a[_0xe29261],_0xb38abf=_0x2b217a[_0xe29261+0x1];if(_0x2e2364==='\x27'||_0x2e2364==='\x22'||_0x2e2364==='`'){const _0x4a2ec6=_0x2e2364,_0x9ba08f=_0xe29261;_0xe29261+=0x1;while(_0xe29261<_0x2b217a[_0x1591d9(0xf6)]){if(_0x2b217a[_0xe29261]==='\x5c'&&_0xe29261+0x1<_0x2b217a['length']){_0xe29261+=0x2;continue;}if(_0x2b217a[_0xe29261]!==_0x4a2ec6){_0xe29261+=0x1;continue;}if(_0x2b217a[_0xe29261+0x1]===_0x4a2ec6){_0xe29261+=0x2;continue;}break;}if(_0x4a2ec6==='\x27')_0x2e1056(_0x9ba08f,Math[_0x1591d9(0xdf)](_0xe29261+0x1,_0x2b217a[_0x1591d9(0xf6)]));continue;}if(_0x2e2364==='-'&&_0xb38abf==='-'){const _0x43a55b=_0xe29261;while(_0xe29261<_0x2b217a[_0x1591d9(0xf6)]&&_0x2b217a[_0xe29261]!=='\x0a')_0xe29261+=0x1;_0x2e1056(_0x43a55b,_0xe29261);continue;}if(_0x2e2364==='/'&&_0xb38abf==='*'){const _0x2adeab=_0xe29261;_0xe29261+=0x2;while(_0xe29261<_0x2b217a[_0x1591d9(0xf6)]&&!(_0x2b217a[_0xe29261]==='*'&&_0x2b217a[_0xe29261+0x1]==='/')){_0xe29261+=0x1;}_0xe29261=Math['min'](_0xe29261+0x1,_0x2b217a[_0x1591d9(0xf6)]-0x1),_0x2e1056(_0x2adeab,_0xe29261+0x1);continue;}if(_0x2e2364==='#'&&_0xb38abf!=='{'){const _0x30dc8=_0xe29261;while(_0xe29261<_0x2b217a[_0x1591d9(0xf6)]&&_0x2b217a[_0xe29261]!=='\x0a')_0xe29261+=0x1;_0x2e1056(_0x30dc8,_0xe29261);continue;}if((_0x2e2364==='#'||_0x2e2364==='$')&&_0xb38abf==='{'){const _0x303259=_0xe29261;_0xe29261+=0x2;while(_0xe29261<_0x2b217a['length']&&_0x2b217a[_0xe29261]!=='}')_0xe29261+=0x1;_0x2e1056(_0x303259,Math[_0x1591d9(0xdf)](_0xe29261+0x1,_0x2b217a['length']));}}return _0x2b217a[_0x1591d9(0xfa)]('');}function a231_0x4c78(){const _0x498d6d=['The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','index','error','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','slice','exec','trim','warning','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','2973858sRNPPe','push','\x5c$&','columns','15iJSskd','sql','match','startsWith','test','position','includes','toUpperCase','max','min','__sq__','104uGkLVj','JOIN_INDEX_NOT_USABLE','matchAll','INNER','1233126VJeICJ','containsUnresolvedInclude','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','8045262RlwicN','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','endsWith','where','some','replace','split','table','add','33973100MxBvHX','inner','alias','JOIN_INDEX_MISSING','length','has','map','using','join','unavailable','matchedPrefix','indexOf','unsupportedPredicate','replaceAll','metadataAvailable','639478BwpSXa','62XPZhtS','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','filter','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','cross','from','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','6246880uDoTQq','(?:^|[^\x5cw$])','22196qPdhfn','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','sort','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','indexes','unknown','right','reduce','full'];a231_0x4c78=function(){return _0x498d6d;};return a231_0x4c78();}function maskQuotedIdentifiers(_0x437f0f){const _0x201119=a231_0x430a,_0x13ae3c=Array['from'](_0x437f0f);for(let _0x129045=0x0;_0x129045<_0x13ae3c[_0x201119(0xf6)];_0x129045+=0x1){const _0x468f3c=_0x13ae3c[_0x129045];if(_0x468f3c!=='\x22'&&_0x468f3c!=='`')continue;_0x129045+=0x1;while(_0x129045<_0x13ae3c['length']){if(_0x13ae3c[_0x129045]===_0x468f3c){if(_0x13ae3c[_0x129045+0x1]===_0x468f3c){_0x13ae3c[_0x129045]='\x20',_0x13ae3c[_0x129045+0x1]='\x20',_0x129045+=0x2;continue;}break;}_0x13ae3c[_0x129045]='\x20',_0x129045+=0x1;}}return _0x13ae3c[_0x201119(0xfa)]('');}function maskNestedQueries(_0x202547){const _0x4ce457=a231_0x430a,_0x327458=Array[_0x4ce457(0xbc)](_0x202547);for(let _0x2f9831=0x0;_0x2f9831<_0x327458[_0x4ce457(0xf6)];_0x2f9831+=0x1){if(_0x327458[_0x2f9831]!=='(')continue;const _0x4f4beb=_0x202547[_0x4ce457(0xcd)](_0x2f9831+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x4ce457(0xda)](_0x4f4beb))continue;let _0x270469=0x1,_0x15c179=_0x2f9831+0x1;for(;_0x15c179<_0x327458['length']&&_0x270469>0x0;_0x15c179+=0x1){if(_0x327458[_0x15c179]==='(')_0x270469+=0x1;if(_0x327458[_0x15c179]===')')_0x270469-=0x1;}if(_0x270469!==0x0)continue;for(let _0x3a7fab=_0x2f9831;_0x3a7fab<_0x15c179;_0x3a7fab+=0x1){_0x327458[_0x3a7fab]='\x20';}const _0x256013=_0x4ce457(0xe0);for(let _0x31bfd9=0x0;_0x31bfd9<_0x256013[_0x4ce457(0xf6)]&&_0x2f9831+_0x31bfd9<_0x15c179;_0x31bfd9+=0x1){_0x327458[_0x2f9831+_0x31bfd9]=_0x256013[_0x31bfd9];}_0x2f9831=_0x15c179-0x1;}return _0x327458[_0x4ce457(0xfa)]('');}function splitTopLevelAnd(_0x4c1179){const _0x4b332c=a231_0x430a,_0x21096e=[];let _0x5d4b49=0x0,_0x1defff=0x0;for(let _0x5b08a3=0x0;_0x5b08a3<_0x4c1179[_0x4b332c(0xf6)];_0x5b08a3+=0x1){const _0x3ed53d=_0x4c1179[_0x5b08a3];if(_0x3ed53d==='(')_0x5d4b49+=0x1;if(_0x3ed53d===')')_0x5d4b49=Math[_0x4b332c(0xde)](0x0,_0x5d4b49-0x1);_0x5d4b49===0x0&&_0x4c1179[_0x4b332c(0xcd)](_0x5b08a3)[_0x4b332c(0xd8)](/^AND\b/i)&&(_0x5b08a3===0x0||/\s/[_0x4b332c(0xda)](_0x4c1179[_0x5b08a3-0x1]??''))&&(_0x21096e[_0x4b332c(0xd3)](_0x4c1179['slice'](_0x1defff,_0x5b08a3)[_0x4b332c(0xcf)]()),_0x5b08a3+=0x2,_0x1defff=_0x5b08a3+0x1);}const _0x295bc6=_0x4c1179['slice'](_0x1defff)[_0x4b332c(0xcf)]();if(_0x295bc6)_0x21096e['push'](_0x295bc6);return _0x21096e;}function hasTopLevelKeyword(_0x2e56bb,_0x5e64c1){const _0x37a971=a231_0x430a;let _0xf847e0=0x0;for(let _0x1999ca=0x0;_0x1999ca<_0x2e56bb['length'];_0x1999ca+=0x1){const _0x473259=_0x2e56bb[_0x1999ca];if(_0x473259==='(')_0xf847e0+=0x1;if(_0x473259===')')_0xf847e0=Math[_0x37a971(0xde)](0x0,_0xf847e0-0x1);if(_0xf847e0!==0x0)continue;const _0x131b1f=_0x2e56bb[_0x37a971(0xcd)](_0x1999ca,_0x1999ca+_0x5e64c1['length']),_0x280bcd=_0x2e56bb[_0x1999ca-0x1]??'\x20',_0x47cb1f=_0x2e56bb[_0x1999ca+_0x5e64c1[_0x37a971(0xf6)]]??'\x20';if(_0x131b1f[_0x37a971(0xdd)]()===_0x5e64c1[_0x37a971(0xdd)]()&&!/[\w$]/['test'](_0x280bcd)&&!/[\w$]/[_0x37a971(0xda)](_0x47cb1f))return!![];}return![];}function splitEquality(_0x5355db){const _0x239f8d=a231_0x430a,_0x4544fe=stripOuterParentheses(_0x5355db);let _0x4d158c=0x0,_0x513304;for(let _0x5c17c2=0x0;_0x5c17c2<_0x4544fe[_0x239f8d(0xf6)];_0x5c17c2+=0x1){const _0x2004dc=_0x4544fe[_0x5c17c2];if(_0x2004dc==='(')_0x4d158c+=0x1;if(_0x2004dc===')')_0x4d158c=Math['max'](0x0,_0x4d158c-0x1);const _0x244080=_0x4544fe[_0x5c17c2-0x1]??'',_0xf76cc3=_0x4544fe[_0x5c17c2+0x1]??'';if(_0x2004dc==='='&&_0x4d158c===0x0&&!/[!<>=:]/[_0x239f8d(0xda)](_0x244080)&&_0xf76cc3!=='='){if(_0x513304!==undefined)return null;_0x513304=_0x5c17c2;}}return _0x513304===undefined?null:[_0x4544fe[_0x239f8d(0xcd)](0x0,_0x513304)[_0x239f8d(0xcf)](),_0x4544fe[_0x239f8d(0xcd)](_0x513304+0x1)[_0x239f8d(0xcf)]()];}function parseDirectColumnReference(_0x1e7428,_0x4fb7a2){const _0x29a7eb=a231_0x430a,_0x2f6663=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x29a7eb(0xce)](stripOuterParentheses(_0x1e7428));if(!_0x2f6663)return null;if(normalizeIdentifier(_0x2f6663[0x1]??'')!==normalizeIdentifier(_0x4fb7a2))return null;return normalizeIdentifier(_0x2f6663[0x2]??'');}function containsColumnReference(_0x387778,_0x2e5e99){const _0x170da8=a231_0x430a,_0x980e41=_0x387778[_0x170da8(0xee)](/[`"]/g,''),_0x4a2e6c=_0x2e5e99[_0x170da8(0xee)](/[.*+?^${}()|[\]\\]/g,_0x170da8(0xd4));return new RegExp(_0x170da8(0xbf)+_0x4a2e6c+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x170da8(0xda)](_0x980e41);}function findEqualityPrefix(_0x2ec3d5,_0x3c3169){const _0x5b0e43=a231_0x430a,_0x5d5c1f=new Set(_0x3c3169[_0x5b0e43(0xf8)](normalizeIdentifier)),_0x1d3478=[];for(const _0x4dd011 of _0x2ec3d5){if(!_0x5d5c1f[_0x5b0e43(0xf7)](normalizeIdentifier(_0x4dd011)))break;_0x1d3478['push'](_0x4dd011);}return _0x1d3478;}function resolveTableMetadata(_0x2f11ef,_0x42dcf5){const _0x536aad=a231_0x430a,_0x5843a3=normalizeIdentifier(_0x42dcf5),_0x5472cd=_0x2f11ef['filter'](_0xe8dbef=>normalizeIdentifier(_0xe8dbef['tableName'])===_0x5843a3);if(_0x5472cd[_0x536aad(0xf6)]===0x1)return _0x5472cd[0x0];const _0x433b51=_0x5843a3[_0x536aad(0xdc)]('.'),_0x5c2c32=_0x5843a3[_0x536aad(0xef)]('.')['at'](-0x1),_0x217768=_0x2f11ef[_0x536aad(0xb9)](_0x41560b=>{const _0x242981=_0x536aad,_0x1f979f=normalizeIdentifier(_0x41560b['tableName']);if(_0x433b51&&_0x1f979f[_0x242981(0xdc)]('.'))return![];return _0x1f979f[_0x242981(0xef)]('.')['at'](-0x1)===_0x5c2c32;});return _0x217768[_0x536aad(0xf6)]===0x1?_0x217768[0x0]:undefined;}function columnNamesMatch(_0x5b4efc,_0x4589a1){return normalizeIdentifier(_0x5b4efc)===normalizeIdentifier(_0x4589a1);}function normalizeIdentifier(_0x3018e8){const _0x262a72=a231_0x430a;return _0x3018e8['replace'](/[`"]/g,'')[_0x262a72(0xcf)]()['toLowerCase']();}function isSqlClauseKeyword(_0x31bc37){const _0x1035f6=a231_0x430a;return new Set(['on',_0x1035f6(0xf9),_0x1035f6(0xec),_0x1035f6(0xfa),_0x1035f6(0xf3),'left',_0x1035f6(0xc6),_0x1035f6(0xc8),_0x1035f6(0xbb),'natural'])[_0x1035f6(0xf7)](_0x31bc37);}function a231_0x430a(_0x55781d,_0x43628a){_0x55781d=_0x55781d-0xb5;const _0x4c7801=a231_0x4c78();let _0x430a68=_0x4c7801[_0x55781d];return _0x430a68;}function stripOuterParentheses(_0x405653){const _0x46e29a=a231_0x430a;let _0x29388e=_0x405653[_0x46e29a(0xcf)]();while(_0x29388e[_0x46e29a(0xd9)]('(')&&_0x29388e[_0x46e29a(0xeb)](')')){let _0x207538=0x0,_0x1b9f44=!![];for(let _0x591a20=0x0;_0x591a20<_0x29388e[_0x46e29a(0xf6)];_0x591a20+=0x1){if(_0x29388e[_0x591a20]==='(')_0x207538+=0x1;if(_0x29388e[_0x591a20]===')')_0x207538-=0x1;if(_0x207538===0x0&&_0x591a20<_0x29388e[_0x46e29a(0xf6)]-0x1){_0x1b9f44=![];break;}}if(!_0x1b9f44||_0x207538!==0x0)break;_0x29388e=_0x29388e['slice'](0x1,-0x1)[_0x46e29a(0xcf)]();}return _0x29388e;}
@@ -1 +1 @@
1
- const a232_0x4e390f=a232_0x2ee3;(function(_0x4adae1,_0xdc30fe){const _0x503fc0=a232_0x2ee3,_0x5bf84e=_0x4adae1();while(!![]){try{const _0x4f099c=-parseInt(_0x503fc0(0x6e))/0x1*(parseInt(_0x503fc0(0x72))/0x2)+parseInt(_0x503fc0(0x70))/0x3*(parseInt(_0x503fc0(0x74))/0x4)+-parseInt(_0x503fc0(0x76))/0x5+parseInt(_0x503fc0(0x77))/0x6+-parseInt(_0x503fc0(0x7a))/0x7*(-parseInt(_0x503fc0(0x75))/0x8)+-parseInt(_0x503fc0(0x73))/0x9*(parseInt(_0x503fc0(0x78))/0xa)+-parseInt(_0x503fc0(0x71))/0xb*(-parseInt(_0x503fc0(0x6f))/0xc);if(_0x4f099c===_0xdc30fe)break;else _0x5bf84e['push'](_0x5bf84e['shift']());}catch(_0x1fc353){_0x5bf84e['push'](_0x5bf84e['shift']());}}}(a232_0x4d7f,0x30f2e));import{resolve}from'node:path';function a232_0x2ee3(_0x5e5cf0,_0x37b0f5){_0x5e5cf0=_0x5e5cf0-0x6d;const _0x4d7f4e=a232_0x4d7f();let _0x2ee362=_0x4d7f4e[_0x5e5cf0];return _0x2ee362;}import{findProjectRootDirectory}from'../../context.js';function a232_0x4d7f(){const _0x4aee85=['sql.lock.json','295673TSeZqI','/sql','.rabetbase','sql-trash','199FnaczO','12zCKiOI','25341LPxkOc','1273261ecBXPN','1658FmHSer','2478591NwCNBe','4InElss','72zuZupq','987125iNNDRy','2003640AttqjU','10ypehha'];a232_0x4d7f=function(){return _0x4aee85;};return a232_0x4d7f();}const DOT_DIR=a232_0x4e390f(0x7c),LOCK_FILE_NAME=a232_0x4e390f(0x79),TRASH_DIR_NAME=a232_0x4e390f(0x6d);export function loadSqlProjectConfig(_0x33eabb,_0x4e48ed){const _0x44101b=a232_0x4e390f,_0x51fdc6=resolve(_0x4e48ed??findProjectRootDirectory()),_0x1c31e0=DOT_DIR+_0x44101b(0x7b),_0x103538=_0x1c31e0+'/'+_0x33eabb;return{'projectRoot':_0x51fdc6,'appCode':_0x33eabb,'sqlWorkspaceRoot':_0x1c31e0,'sqlRoot':_0x103538,'sqlRootDir':resolve(_0x51fdc6,DOT_DIR,'sql',_0x33eabb),'lockFilePath':resolve(_0x51fdc6,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x51fdc6,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a232_0x24630b=a232_0x3c89;(function(_0x355c5a,_0x202a3e){const _0x2e6331=a232_0x3c89,_0x27a621=_0x355c5a();while(!![]){try{const _0x1049be=parseInt(_0x2e6331(0x161))/0x1*(parseInt(_0x2e6331(0x16c))/0x2)+-parseInt(_0x2e6331(0x16b))/0x3+-parseInt(_0x2e6331(0x167))/0x4+-parseInt(_0x2e6331(0x165))/0x5+parseInt(_0x2e6331(0x163))/0x6+-parseInt(_0x2e6331(0x162))/0x7+parseInt(_0x2e6331(0x168))/0x8;if(_0x1049be===_0x202a3e)break;else _0x27a621['push'](_0x27a621['shift']());}catch(_0x239f27){_0x27a621['push'](_0x27a621['shift']());}}}(a232_0x58be,0x5d3d2));import{resolve}from'node:path';function a232_0x58be(){const _0x417112=['.rabetbase','3020400SOnCJV','10381408rRjxMu','sql','sql.lock.json','1035900CYGgDX','7196aaGPSf','174RghOoS','3616823NUmcKl','1859238rXVMsP','/sql','1173030LviwXJ'];a232_0x58be=function(){return _0x417112;};return a232_0x58be();}function a232_0x3c89(_0xbb11d4,_0x464c5f){_0xbb11d4=_0xbb11d4-0x161;const _0x58be8c=a232_0x58be();let _0x3c896d=_0x58be8c[_0xbb11d4];return _0x3c896d;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a232_0x24630b(0x166),LOCK_FILE_NAME=a232_0x24630b(0x16a),TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x306984,_0x48eb7e){const _0x4f44bb=a232_0x24630b,_0xac4469=resolve(_0x48eb7e??findProjectRootDirectory()),_0x538d78=DOT_DIR+_0x4f44bb(0x164),_0x56a8db=_0x538d78+'/'+_0x306984;return{'projectRoot':_0xac4469,'appCode':_0x306984,'sqlWorkspaceRoot':_0x538d78,'sqlRoot':_0x56a8db,'sqlRootDir':resolve(_0xac4469,DOT_DIR,_0x4f44bb(0x169),_0x306984),'lockFilePath':resolve(_0xac4469,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0xac4469,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x44465d,_0x193057){const _0x15a418=a233_0x30ec,_0x3e844a=_0x44465d();while(!![]){try{const _0x3c8451=-parseInt(_0x15a418(0x1dd))/0x1*(-parseInt(_0x15a418(0x1f5))/0x2)+-parseInt(_0x15a418(0x1dc))/0x3*(-parseInt(_0x15a418(0x1db))/0x4)+parseInt(_0x15a418(0x1d5))/0x5*(parseInt(_0x15a418(0x1ec))/0x6)+parseInt(_0x15a418(0x1e1))/0x7*(parseInt(_0x15a418(0x1f4))/0x8)+parseInt(_0x15a418(0x1f3))/0x9+parseInt(_0x15a418(0x1e6))/0xa+-parseInt(_0x15a418(0x1d7))/0xb;if(_0x3c8451===_0x193057)break;else _0x3e844a['push'](_0x3e844a['shift']());}catch(_0x314171){_0x3e844a['push'](_0x3e844a['shift']());}}}(a233_0x4abc,0xe7651));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x43784a){const _0x1f7166=a233_0x30ec;if(_0x43784a===_0x1f7166(0x1f6))return _0x1f7166(0x1eb);if(_0x43784a===_0x1f7166(0x1d8))return _0x1f7166(0x1ed);return undefined;}async function scanSqlFilesRecursively(_0x52c15b,_0x459bde){const _0xa9bdca=a233_0x30ec,_0x43d86e=[];try{const _0x239e99=await readdir(_0x52c15b,{'withFileTypes':!![]});for(const _0x5506dc of _0x239e99){const _0x139c2e=join(_0x52c15b,_0x5506dc[_0xa9bdca(0x1ee)]);if(_0x5506dc[_0xa9bdca(0x1e0)]()){_0x43d86e['push'](...await scanSqlFilesRecursively(_0x139c2e,_0x459bde));continue;}if(!_0x5506dc[_0xa9bdca(0x1e4)]())continue;const _0x24d277=extname(_0x5506dc['name'])[_0xa9bdca(0x1ea)](),_0x2313fd=extensionToMode(_0x24d277);if(!_0x2313fd)continue;const _0x47e725=relative(_0x459bde,_0x139c2e)[_0xa9bdca(0x1d6)](/\\/g,'/'),_0x5ed202=_0x47e725[_0xa9bdca(0x1de)]('/')['filter'](Boolean),_0x27dd8d=parseSqlPath(_0x5ed202,_0x5506dc['name'],_0x24d277);if(!_0x27dd8d)continue;_0x43d86e[_0xa9bdca(0x1d9)]({'sqlCode':_0x27dd8d[_0xa9bdca(0x1f2)],'sqlName':_0x27dd8d[_0xa9bdca(0x1e2)],'dbDirectory':_0x5ed202[0x0],'filePath':_0x139c2e,'relativePath':_0x47e725,'lockKey':_0x27dd8d[_0xa9bdca(0x1f2)],'mode':_0x2313fd});}}catch(_0x4220a9){if(_0x4220a9[_0xa9bdca(0x1e5)]!==_0xa9bdca(0x1e7))throw _0x4220a9;}return _0x43d86e;}function a233_0x30ec(_0x12aa9a,_0x962bb1){_0x12aa9a=_0x12aa9a-0x1d5;const _0x4abc9d=a233_0x4abc();let _0x30ec9d=_0x4abc9d[_0x12aa9a];return _0x30ec9d;}export async function scanLocalSqlQueries(_0x54b059){const _0x43bf7c=a233_0x30ec;return scanSqlFilesRecursively(_0x54b059[_0x43bf7c(0x1e3)],_0x54b059['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x231c29,_0x2ffb0d,_0x1adf60){const _0x126ece=a233_0x30ec,_0x5c4d7c=_0x1adf60?.[_0x126ece(0x1da)]||(_0x1adf60?.[_0x126ece(0x1e2)]||_0x1adf60?.[_0x126ece(0x1e9)]?buildSqlRelativePath(_0x2ffb0d,_0x1adf60?.[_0x126ece(0x1e2)],_0x1adf60?.[_0x126ece(0x1e9)],_0x1adf60?.[_0x126ece(0x1f7)]||_0x126ece(0x1eb),_0x1adf60?.[_0x126ece(0x1df)]):buildDefaultSqlFileName(_0x2ffb0d,_0x1adf60?.[_0x126ece(0x1f7)]||'sql'));return join(_0x231c29[_0x126ece(0x1e3)],_0x5c4d7c);}function a233_0x4abc(){const _0xe45e87=['91284HsIxrV','165154OgVebE','split','dbId','isDirectory','5929NnLljx','sqlName','sqlRootDir','isFile','code','1346320gtxPWK','ENOENT','length','dbName','toLowerCase','sql','12tRNSay','mybatisXml','name','indexOf','slice','test','sqlCode','3763179biEeDt','7192bTYllV','16GONsDz','.sql','mode','2474570uxuCDu','replace','37820013osbwMf','.xml','push','path','100suVYNM'];a233_0x4abc=function(){return _0xe45e87;};return a233_0x4abc();}export async function directoryExists(_0x54eb88){const _0x4f0f51=a233_0x30ec;try{const _0x25e5ed=await stat(_0x54eb88);return _0x25e5ed[_0x4f0f51(0x1e0)]();}catch{return![];}}function parseSqlPath(_0x6f8323,_0x94fcec,_0x53e044){const _0x5305fc=a233_0x30ec,_0x5beeec=_0x94fcec[_0x5305fc(0x1f0)](0x0,-_0x53e044[_0x5305fc(0x1e8)]);if(_0x6f8323[_0x5305fc(0x1e8)]<0x2)return null;const _0x3adee8=_0x5beeec[_0x5305fc(0x1ef)]('_');if(_0x3adee8<=0x0||_0x3adee8>=_0x5beeec[_0x5305fc(0x1e8)]-0x1)return null;const _0x194f62=_0x5beeec[_0x5305fc(0x1f0)](0x0,_0x3adee8);if(!isLikelySqlCode(_0x194f62))return null;return{'sqlCode':_0x194f62,'sqlName':_0x5beeec['slice'](_0x3adee8+0x1)};}function isLikelySqlCode(_0x41eedf){const _0x47353c=a233_0x30ec;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x47353c(0x1f1)](_0x41eedf);}
1
+ (function(_0x3868d3,_0x20cbbb){const _0x36c814=a233_0x7f49,_0x4ad5c2=_0x3868d3();while(!![]){try{const _0x1b4105=parseInt(_0x36c814(0x13b))/0x1+-parseInt(_0x36c814(0x134))/0x2*(-parseInt(_0x36c814(0x147))/0x3)+-parseInt(_0x36c814(0x142))/0x4*(-parseInt(_0x36c814(0x135))/0x5)+parseInt(_0x36c814(0x151))/0x6+-parseInt(_0x36c814(0x14e))/0x7+-parseInt(_0x36c814(0x149))/0x8+-parseInt(_0x36c814(0x138))/0x9*(parseInt(_0x36c814(0x143))/0xa);if(_0x1b4105===_0x20cbbb)break;else _0x4ad5c2['push'](_0x4ad5c2['shift']());}catch(_0x3e9aae){_0x4ad5c2['push'](_0x4ad5c2['shift']());}}}(a233_0x9483,0xaf31b));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x48ecc6){const _0x576749=a233_0x7f49;if(_0x48ecc6===_0x576749(0x150))return _0x576749(0x14f);if(_0x48ecc6===_0x576749(0x139))return _0x576749(0x13c);return undefined;}async function scanSqlFilesRecursively(_0xb9f57,_0x39f402){const _0x53ad40=a233_0x7f49,_0x31abbf=[];try{const _0x4667e3=await readdir(_0xb9f57,{'withFileTypes':!![]});for(const _0xe6a85d of _0x4667e3){const _0x356f00=join(_0xb9f57,_0xe6a85d[_0x53ad40(0x141)]);if(_0xe6a85d[_0x53ad40(0x13d)]()){_0x31abbf[_0x53ad40(0x13e)](...await scanSqlFilesRecursively(_0x356f00,_0x39f402));continue;}if(!_0xe6a85d[_0x53ad40(0x137)]())continue;const _0x474c11=extname(_0xe6a85d['name'])[_0x53ad40(0x148)](),_0x461f68=extensionToMode(_0x474c11);if(!_0x461f68)continue;const _0x2549b3=relative(_0x39f402,_0x356f00)[_0x53ad40(0x14d)](/\\/g,'/'),_0x21f71d=_0x2549b3['split']('/')['filter'](Boolean),_0xff76e=parseSqlPath(_0x21f71d,_0xe6a85d['name'],_0x474c11);if(!_0xff76e)continue;_0x31abbf[_0x53ad40(0x13e)]({'sqlCode':_0xff76e['sqlCode'],'sqlName':_0xff76e[_0x53ad40(0x144)],'dbDirectory':_0x21f71d[0x0],'filePath':_0x356f00,'relativePath':_0x2549b3,'lockKey':_0xff76e[_0x53ad40(0x145)],'mode':_0x461f68});}}catch(_0x2fe508){if(_0x2fe508[_0x53ad40(0x14a)]!==_0x53ad40(0x146))throw _0x2fe508;}return _0x31abbf;}export async function scanLocalSqlQueries(_0x56ea0a){const _0x4a37d8=a233_0x7f49;return scanSqlFilesRecursively(_0x56ea0a[_0x4a37d8(0x140)],_0x56ea0a[_0x4a37d8(0x140)]);}export function resolveLocalSqlFilePath(_0x2e8210,_0x4ecc75,_0x407ef6){const _0x21eb7f=a233_0x7f49,_0x515e28=_0x407ef6?.['path']||(_0x407ef6?.[_0x21eb7f(0x144)]||_0x407ef6?.[_0x21eb7f(0x136)]?buildSqlRelativePath(_0x4ecc75,_0x407ef6?.['sqlName'],_0x407ef6?.[_0x21eb7f(0x136)],_0x407ef6?.[_0x21eb7f(0x133)]||_0x21eb7f(0x14f),_0x407ef6?.[_0x21eb7f(0x13a)]):buildDefaultSqlFileName(_0x4ecc75,_0x407ef6?.[_0x21eb7f(0x133)]||_0x21eb7f(0x14f)));return join(_0x2e8210[_0x21eb7f(0x140)],_0x515e28);}export async function directoryExists(_0x4d2cfb){const _0x3e2c46=a233_0x7f49;try{const _0x156345=await stat(_0x4d2cfb);return _0x156345[_0x3e2c46(0x13d)]();}catch{return![];}}function a233_0x7f49(_0x5b9045,_0x108d92){_0x5b9045=_0x5b9045-0x133;const _0x94832e=a233_0x9483();let _0x7f498e=_0x94832e[_0x5b9045];return _0x7f498e;}function a233_0x9483(){const _0xa3689f=['sqlName','sqlCode','ENOENT','981987whgDDx','toLowerCase','1151160UZHZIi','code','length','slice','replace','5600847XpzdBv','sql','.sql','2119272brmTPV','mode','2pDDpaJ','2365KIFAok','dbName','isFile','195633HBlETO','.xml','dbId','1387420uGbrBY','mybatisXml','isDirectory','push','indexOf','sqlRootDir','name','4468PWlxFX','430wcIHuV'];a233_0x9483=function(){return _0xa3689f;};return a233_0x9483();}function parseSqlPath(_0x248c49,_0x1c9995,_0x9f8f6e){const _0x9e6b98=a233_0x7f49,_0x30eea5=_0x1c9995['slice'](0x0,-_0x9f8f6e['length']);if(_0x248c49['length']<0x2)return null;const _0x5ec3ee=_0x30eea5[_0x9e6b98(0x13f)]('_');if(_0x5ec3ee<=0x0||_0x5ec3ee>=_0x30eea5[_0x9e6b98(0x14b)]-0x1)return null;const _0x3b063d=_0x30eea5[_0x9e6b98(0x14c)](0x0,_0x5ec3ee);if(!isLikelySqlCode(_0x3b063d))return null;return{'sqlCode':_0x3b063d,'sqlName':_0x30eea5[_0x9e6b98(0x14c)](_0x5ec3ee+0x1)};}function isLikelySqlCode(_0x1be6cd){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0x1be6cd);}
@@ -1 +1 @@
1
- (function(_0x36c2e7,_0x317875){const _0x384d30=a234_0x2dd2,_0xeca667=_0x36c2e7();while(!![]){try{const _0x2edc39=parseInt(_0x384d30(0x1a5))/0x1*(-parseInt(_0x384d30(0x1a6))/0x2)+parseInt(_0x384d30(0x1a3))/0x3+parseInt(_0x384d30(0x1a1))/0x4+-parseInt(_0x384d30(0x1a2))/0x5*(-parseInt(_0x384d30(0x19c))/0x6)+parseInt(_0x384d30(0x19e))/0x7+parseInt(_0x384d30(0x19d))/0x8+-parseInt(_0x384d30(0x19f))/0x9;if(_0x2edc39===_0x317875)break;else _0xeca667['push'](_0xeca667['shift']());}catch(_0xc232dd){_0xeca667['push'](_0xeca667['shift']());}}}(a234_0x1940,0xa2fe3));import{readFile}from'node:fs/promises';function a234_0x2dd2(_0x532b71,_0x15d2dd){_0x532b71=_0x532b71-0x19c;const _0x194048=a234_0x1940();let _0x2dd25c=_0x194048[_0x532b71];return _0x2dd25c;}function a234_0x1940(){const _0x380056=['7626618vDEcKv','2031976nXOVEA','2541560anqNaE','10224387tzsTtD','update','1597556Yydaah','5HZrzRX','586881BUznOe','digest','82zpcqfA','16574kLuGXu'];a234_0x1940=function(){return _0x380056;};return a234_0x1940();}import a234_0x41f1d from'node:crypto';export function computeSqlContentHash(_0x394542){const _0x3909fb=a234_0x2dd2;return a234_0x41f1d['createHash']('md5')[_0x3909fb(0x1a0)](_0x394542)[_0x3909fb(0x1a4)]('hex');}export async function computeSqlFileHash(_0x22d813){const _0x2a58d6=await readFile(_0x22d813,'utf8');return computeSqlContentHash(_0x2a58d6);}
1
+ function a234_0x5bba(){const _0x74be68=['6562088HTCADS','md5','utf8','createHash','33131mSrnEj','update','8330YGqLPj','4587936pYakCa','371YtNkrX','3746586OcptUd','hex','5930060LIAQXu','5639610NXicaW','45lpdwSN','digest','1624gCZXja'];a234_0x5bba=function(){return _0x74be68;};return a234_0x5bba();}(function(_0x17057d,_0x5e4c37){const _0xe82adf=a234_0x2861,_0xe6edd0=_0x17057d();while(!![]){try{const _0x4daad2=-parseInt(_0xe82adf(0x74))/0x1*(parseInt(_0xe82adf(0x72))/0x2)+-parseInt(_0xe82adf(0x73))/0x3+-parseInt(_0xe82adf(0x6c))/0x4+parseInt(_0xe82adf(0x77))/0x5+parseInt(_0xe82adf(0x75))/0x6+parseInt(_0xe82adf(0x70))/0x7*(parseInt(_0xe82adf(0x6b))/0x8)+parseInt(_0xe82adf(0x79))/0x9*(parseInt(_0xe82adf(0x78))/0xa);if(_0x4daad2===_0x5e4c37)break;else _0xe6edd0['push'](_0xe6edd0['shift']());}catch(_0x212869){_0xe6edd0['push'](_0xe6edd0['shift']());}}}(a234_0x5bba,0xd5dde));import{readFile}from'node:fs/promises';import a234_0x59b994 from'node:crypto';function a234_0x2861(_0x24d1f4,_0x39c96a){_0x24d1f4=_0x24d1f4-0x6a;const _0x5bba2c=a234_0x5bba();let _0x286181=_0x5bba2c[_0x24d1f4];return _0x286181;}export function computeSqlContentHash(_0xc1840b){const _0x5055db=a234_0x2861;return a234_0x59b994[_0x5055db(0x6f)](_0x5055db(0x6d))[_0x5055db(0x71)](_0xc1840b)[_0x5055db(0x6a)](_0x5055db(0x76));}export async function computeSqlFileHash(_0x593450){const _0x1d1c3e=a234_0x2861,_0x48b6fb=await readFile(_0x593450,_0x1d1c3e(0x6e));return computeSqlContentHash(_0x48b6fb);}
@@ -1 +1 @@
1
- (function(_0x21e3f2,_0x422f1c){const _0x422adf=a235_0x535d,_0x514798=_0x21e3f2();while(!![]){try{const _0x3538aa=parseInt(_0x422adf(0x171))/0x1+parseInt(_0x422adf(0x16f))/0x2+parseInt(_0x422adf(0x175))/0x3*(parseInt(_0x422adf(0x16d))/0x4)+-parseInt(_0x422adf(0x174))/0x5+-parseInt(_0x422adf(0x16e))/0x6+-parseInt(_0x422adf(0x167))/0x7+-parseInt(_0x422adf(0x16b))/0x8;if(_0x3538aa===_0x422f1c)break;else _0x514798['push'](_0x514798['shift']());}catch(_0x1cc0d5){_0x514798['push'](_0x514798['shift']());}}}(a235_0x2fbc,0x40827));import{mkdir,readFile,writeFile}from'node:fs/promises';function a235_0x2fbc(){const _0x554960=['Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','\x22\x20vs\x20lock\x20\x22','1959180fnEWHG','3981kOibKv','\x22.\x20','ENOENT','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','2619582rbCUmL','sqlRoot','lastSync','apps','399128ZxygYr','stringify','964xPtOlf','1060524iMYfDA','977562CUYHPV','sqls','448350hDgeks'];a235_0x2fbc=function(){return _0x554960;};return a235_0x2fbc();}import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}function a235_0x535d(_0x4b8d18,_0x2640ad){_0x4b8d18=_0x4b8d18-0x166;const _0x2fbc64=a235_0x2fbc();let _0x535d89=_0x2fbc64[_0x4b8d18];return _0x535d89;}export function ensureSqlLockScope(_0x261e75,_0x2d4139,_0x54f94b,_0x1d8e0e){const _0x45d2fe=a235_0x535d,_0xb2cde=_0x261e75??createEmptySqlLock();let _0x521d4f=_0xb2cde[_0x45d2fe(0x16a)][_0x2d4139];if(!_0x521d4f)return _0x521d4f={'sqlRoot':_0x54f94b,'lastSync':'','sqls':{}},_0xb2cde['apps'][_0x2d4139]=_0x521d4f,{'lockData':_0xb2cde,'appLock':_0x521d4f};if(!_0x521d4f['sqlRoot'])_0x521d4f[_0x45d2fe(0x168)]=_0x54f94b;else{if(_0x521d4f[_0x45d2fe(0x168)]!==_0x54f94b)throw new Error(_0x1d8e0e+':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'+_0x54f94b+_0x45d2fe(0x173)+_0x521d4f[_0x45d2fe(0x168)]+_0x45d2fe(0x176)+_0x45d2fe(0x166));}return!_0x521d4f[_0x45d2fe(0x170)]&&(_0x521d4f[_0x45d2fe(0x170)]={}),!_0x521d4f[_0x45d2fe(0x169)]&&(_0x521d4f[_0x45d2fe(0x169)]=''),{'lockData':_0xb2cde,'appLock':_0x521d4f};}export async function readSqlLockFile(_0x5c7323){const _0x4f28bd=a235_0x535d;try{const _0xf753a3=await readFile(_0x5c7323,'utf8');return JSON['parse'](_0xf753a3);}catch(_0xce8917){if(_0xce8917['code']===_0x4f28bd(0x177))return null;throw new Error(_0x4f28bd(0x172)+String(_0xce8917));}}export async function writeSqlLockFile(_0x49594a,_0x3ac89f){const _0x331e25=a235_0x535d;await mkdir(dirname(_0x49594a),{'recursive':!![]}),await writeFile(_0x49594a,JSON[_0x331e25(0x16c)](_0x3ac89f,null,0x2),'utf8');}
1
+ (function(_0x50f541,_0xdb177){const _0x2fe521=a235_0x3dce,_0x2b41ab=_0x50f541();while(!![]){try{const _0x1473e0=-parseInt(_0x2fe521(0xb8))/0x1+-parseInt(_0x2fe521(0xb5))/0x2*(parseInt(_0x2fe521(0xba))/0x3)+parseInt(_0x2fe521(0xb7))/0x4+-parseInt(_0x2fe521(0xab))/0x5+-parseInt(_0x2fe521(0xb0))/0x6+-parseInt(_0x2fe521(0xb3))/0x7+parseInt(_0x2fe521(0xbc))/0x8*(parseInt(_0x2fe521(0xbd))/0x9);if(_0x1473e0===_0xdb177)break;else _0x2b41ab['push'](_0x2b41ab['shift']());}catch(_0x5a7216){_0x2b41ab['push'](_0x2b41ab['shift']());}}}(a235_0x33dd,0x51735));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}function a235_0x3dce(_0x392398,_0x2d1fc1){_0x392398=_0x392398-0xa9;const _0x33ddd3=a235_0x33dd();let _0x3dce8b=_0x33ddd3[_0x392398];return _0x3dce8b;}export function ensureSqlLockScope(_0x235c78,_0x5ea53e,_0x58dc95,_0x1c7a27){const _0x475ab5=a235_0x3dce,_0x59ee5c=_0x235c78??createEmptySqlLock();let _0x586844=_0x59ee5c[_0x475ab5(0xb6)][_0x5ea53e];if(!_0x586844)return _0x586844={'sqlRoot':_0x58dc95,'lastSync':'','sqls':{}},_0x59ee5c[_0x475ab5(0xb6)][_0x5ea53e]=_0x586844,{'lockData':_0x59ee5c,'appLock':_0x586844};if(!_0x586844[_0x475ab5(0xb2)])_0x586844['sqlRoot']=_0x58dc95;else{if(_0x586844[_0x475ab5(0xb2)]!==_0x58dc95)throw new Error(_0x1c7a27+_0x475ab5(0xad)+_0x58dc95+_0x475ab5(0xa9)+_0x586844[_0x475ab5(0xb2)]+_0x475ab5(0xac)+_0x475ab5(0xbb));}return!_0x586844[_0x475ab5(0xaa)]&&(_0x586844[_0x475ab5(0xaa)]={}),!_0x586844[_0x475ab5(0xae)]&&(_0x586844[_0x475ab5(0xae)]=''),{'lockData':_0x59ee5c,'appLock':_0x586844};}function a235_0x33dd(){const _0x361063=['2940295GbRpSh','\x22.\x20',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','lastSync','stringify','3238476RlvvIG','code','sqlRoot','1564094RXzpdA','utf8','2RdpIRs','apps','1158748xXqBqR','444070gmDpOX','ENOENT','1191129LQzDCS','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','16nRusFY','10063323BLuhQb','\x22\x20vs\x20lock\x20\x22','sqls'];a235_0x33dd=function(){return _0x361063;};return a235_0x33dd();}export async function readSqlLockFile(_0x555e56){const _0x5881ff=a235_0x3dce;try{const _0xcfa349=await readFile(_0x555e56,'utf8');return JSON['parse'](_0xcfa349);}catch(_0x3455e9){if(_0x3455e9[_0x5881ff(0xb1)]===_0x5881ff(0xb9))return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x3455e9));}}export async function writeSqlLockFile(_0x266c59,_0x40e01f){const _0x34480e=a235_0x3dce;await mkdir(dirname(_0x266c59),{'recursive':!![]}),await writeFile(_0x266c59,JSON[_0x34480e(0xaf)](_0x40e01f,null,0x2),_0x34480e(0xb4));}
@@ -1 +1 @@
1
- (function(_0x64e1bb,_0x3840a3){const _0x245c82=a237_0x517c,_0x54cf10=_0x64e1bb();while(!![]){try{const _0x1f4c5e=parseInt(_0x245c82(0x12f))/0x1*(-parseInt(_0x245c82(0x12d))/0x2)+-parseInt(_0x245c82(0x120))/0x3+-parseInt(_0x245c82(0x123))/0x4+-parseInt(_0x245c82(0x12a))/0x5+-parseInt(_0x245c82(0x121))/0x6+parseInt(_0x245c82(0x124))/0x7+-parseInt(_0x245c82(0x126))/0x8*(-parseInt(_0x245c82(0x122))/0x9);if(_0x1f4c5e===_0x3840a3)break;else _0x54cf10['push'](_0x54cf10['shift']());}catch(_0x40184e){_0x54cf10['push'](_0x54cf10['shift']());}}}(a237_0x56bc,0xaac88));function a237_0x517c(_0x52836f,_0x22ee0e){_0x52836f=_0x52836f-0x11f;const _0x56bcbe=a237_0x56bc();let _0x517c58=_0x56bcbe[_0x52836f];return _0x517c58;}export function detectSqlMode(_0x64b13d){const _0x5c9b31=a237_0x517c,_0x74b25d=_0x64b13d['trimStart']();if(/^<(select|insert|update|delete)\b/i['test'](_0x74b25d))return _0x5c9b31(0x12e);return _0x5c9b31(0x129);}export function getSqlFileExtension(_0x4fc87f){const _0x4ef075=a237_0x517c;return _0x4fc87f===_0x4ef075(0x12e)?_0x4ef075(0x127):_0x4ef075(0x125);}export function buildDefaultSqlFileName(_0x6c606e,_0x124532){return''+_0x6c606e+getSqlFileExtension(_0x124532);}export function sanitizeSqlPathSegment(_0x210041,_0x44fef0){const _0x2cfd80=a237_0x517c,_0x445cb0=String(_0x210041??'')[_0x2cfd80(0x11f)](),_0x368a30=_0x445cb0[_0x2cfd80(0x128)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x2cfd80(0x128)](/\s+/g,'-')[_0x2cfd80(0x128)](/-+/g,'-')[_0x2cfd80(0x128)](/^\.+/,'')[_0x2cfd80(0x128)](/\.+$/,'')[_0x2cfd80(0x128)](/^-+/,'')[_0x2cfd80(0x128)](/-+$/,'');return _0x368a30||_0x44fef0;}function a237_0x56bc(){const _0x5935e3=['3107211hEEPet','4730832aalLhF','17759268ieKjAl','2125892aVZrjT','671881TGaXYE','.sql','16NrriHZ','.xml','replace','sql','1218960nImgoX','unknown-sql','unknown-db','1486970aRCGlG','mybatisXml','1qBYKUf','trim'];a237_0x56bc=function(){return _0x5935e3;};return a237_0x56bc();}export function buildDbDirectoryName(_0x49b192,_0x49fa62){const _0x1f2ec8=a237_0x517c;return sanitizeSqlPathSegment(_0x49b192,_0x49fa62!=null?'db-'+_0x49fa62:_0x1f2ec8(0x12c));}export function buildSqlRelativePath(_0x5592ea,_0x1264b3,_0x43b2ad,_0x349185,_0x41e560){const _0x342a71=a237_0x517c,_0x5b5498=buildDbDirectoryName(_0x43b2ad,_0x41e560),_0x1c1216=sanitizeSqlPathSegment(_0x5592ea,_0x342a71(0x12b)),_0x176ce2=sanitizeSqlPathSegment(_0x1264b3,_0x1c1216);return _0x5b5498+'/'+_0x1c1216+'_'+_0x176ce2+getSqlFileExtension(_0x349185);}
1
+ (function(_0x2339f6,_0x12e5e7){const _0x44f23e=a237_0x1fd0,_0x543ae6=_0x2339f6();while(!![]){try{const _0x3d45cd=-parseInt(_0x44f23e(0xe1))/0x1*(parseInt(_0x44f23e(0xdc))/0x2)+parseInt(_0x44f23e(0xd2))/0x3+-parseInt(_0x44f23e(0xdf))/0x4*(-parseInt(_0x44f23e(0xd6))/0x5)+-parseInt(_0x44f23e(0xd4))/0x6+parseInt(_0x44f23e(0xdb))/0x7*(parseInt(_0x44f23e(0xd3))/0x8)+-parseInt(_0x44f23e(0xe2))/0x9*(parseInt(_0x44f23e(0xe3))/0xa)+-parseInt(_0x44f23e(0xcf))/0xb*(-parseInt(_0x44f23e(0xe0))/0xc);if(_0x3d45cd===_0x12e5e7)break;else _0x543ae6['push'](_0x543ae6['shift']());}catch(_0x4cb1f4){_0x543ae6['push'](_0x543ae6['shift']());}}}(a237_0x2347,0x82f75));function a237_0x1fd0(_0x540b72,_0x1f7c23){_0x540b72=_0x540b72-0xcf;const _0x234735=a237_0x2347();let _0x1fd0a1=_0x234735[_0x540b72];return _0x1fd0a1;}export function detectSqlMode(_0xeaec08){const _0x1ff8ba=a237_0x1fd0,_0x20b7a6=_0xeaec08[_0x1ff8ba(0xda)]();if(/^<(select|insert|update|delete)\b/i[_0x1ff8ba(0xdd)](_0x20b7a6))return _0x1ff8ba(0xd8);return'sql';}export function getSqlFileExtension(_0x26dda5){const _0x5a6462=a237_0x1fd0;return _0x26dda5==='mybatisXml'?_0x5a6462(0xd7):_0x5a6462(0xd1);}function a237_0x2347(){const _0x57637b=['28BUOLxz','8qEaSAF','test','replace','632uRsZYH','125424EwMHWG','212552pcJqZi','6084yFoBrA','9970fEhFZI','209jfvHJu','trim','.sql','2970945GmekMa','744688RrkQJd','785352bgZPEs','db-','19945xkDXed','.xml','mybatisXml','unknown-db','trimStart'];a237_0x2347=function(){return _0x57637b;};return a237_0x2347();}export function buildDefaultSqlFileName(_0x1a74d0,_0x8cd519){return''+_0x1a74d0+getSqlFileExtension(_0x8cd519);}export function sanitizeSqlPathSegment(_0x15d6a6,_0x1ed0fd){const _0xbbb396=a237_0x1fd0,_0x4bbe35=String(_0x15d6a6??'')[_0xbbb396(0xd0)](),_0x299b9e=_0x4bbe35['replace'](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0xbbb396(0xde)](/\s+/g,'-')[_0xbbb396(0xde)](/-+/g,'-')[_0xbbb396(0xde)](/^\.+/,'')['replace'](/\.+$/,'')[_0xbbb396(0xde)](/^-+/,'')['replace'](/-+$/,'');return _0x299b9e||_0x1ed0fd;}export function buildDbDirectoryName(_0x19449c,_0xc1055){const _0x3277b5=a237_0x1fd0;return sanitizeSqlPathSegment(_0x19449c,_0xc1055!=null?_0x3277b5(0xd5)+_0xc1055:_0x3277b5(0xd9));}export function buildSqlRelativePath(_0xf8361b,_0xdfd52b,_0x45b80d,_0x655050,_0xa91a79){const _0x1ad49d=buildDbDirectoryName(_0x45b80d,_0xa91a79),_0x5ebda2=sanitizeSqlPathSegment(_0xf8361b,'unknown-sql'),_0x1eab30=sanitizeSqlPathSegment(_0xdfd52b,_0x5ebda2);return _0x1ad49d+'/'+_0x5ebda2+'_'+_0x1eab30+getSqlFileExtension(_0x655050);}
@@ -1 +1 @@
1
- const a238_0x5ef39d=a238_0x3fe4;(function(_0x1c1d96,_0x3e9c5a){const _0x2ec155=a238_0x3fe4,_0x3bec70=_0x1c1d96();while(!![]){try{const _0x23ef5c=-parseInt(_0x2ec155(0x1c6))/0x1*(-parseInt(_0x2ec155(0x1aa))/0x2)+parseInt(_0x2ec155(0x1b1))/0x3+-parseInt(_0x2ec155(0x18d))/0x4*(parseInt(_0x2ec155(0x196))/0x5)+-parseInt(_0x2ec155(0x1a8))/0x6+parseInt(_0x2ec155(0x1a7))/0x7*(-parseInt(_0x2ec155(0x183))/0x8)+parseInt(_0x2ec155(0x191))/0x9+parseInt(_0x2ec155(0x182))/0xa;if(_0x23ef5c===_0x3e9c5a)break;else _0x3bec70['push'](_0x3bec70['shift']());}catch(_0x539a03){_0x3bec70['push'](_0x3bec70['shift']());}}}(a238_0x35f1,0x8a722));const MYBATIS_OUTER_TAGS=new Map([[a238_0x5ef39d(0x1c5),a238_0x5ef39d(0x16b)],[a238_0x5ef39d(0x1ad),a238_0x5ef39d(0x1c1)],[a238_0x5ef39d(0x1b0),a238_0x5ef39d(0x1bd)],[a238_0x5ef39d(0x18a),a238_0x5ef39d(0x177)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a238_0x5ef39d(0x16f),a238_0x5ef39d(0x16e),'choose','when',a238_0x5ef39d(0x169),'trim',a238_0x5ef39d(0x168),a238_0x5ef39d(0x188),a238_0x5ef39d(0x1a9),a238_0x5ef39d(0x19d)]),MYBATIS_BRANCH_TAGS=new Set(['if','foreach',a238_0x5ef39d(0x199),a238_0x5ef39d(0x192),'otherwise']);export const MYBATIS_DYNAMIC_START_MARKER=a238_0x5ef39d(0x176);export const MYBATIS_DYNAMIC_END_MARKER=a238_0x5ef39d(0x195);function a238_0x35f1(){const _0x33ac03=['Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','statementType','INSERT','rawName','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','select','31ZZFpWR','set','otherwise','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','SELECT','Unterminated\x20XML\x20declaration.','Invalid\x20MyBatis\x20XML\x20tag.','foreach','where','startsWith','type','matchAll','error','tagName','from','__RABETBASE_MYBATIS_DYNAMIC_START__','DELETE','UNKNOWN','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','&quot;','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','push','DDL','<![CDATA[','get','slice','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','17524540FggTWR','8770544TstFrU','WITH','&amp;','unknown\x20table(s)','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','bind','has','delete','Invalid\x20XML\x20entity\x20reference.','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','30252mnozPi','replaceAll','test','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','6504903nPhTjV','when','-->','&lt;','__RABETBASE_MYBATIS_DYNAMIC_END__','430cFtlNg',']]>','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','choose','add','trim','indexOf','property','&gt;','keys','&apos;','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','outer','mybatisXml','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','<!--','\x20with\x20parameters:\x20','7kyMsrw','5182482WQHaZQ','include','31264YRwYVo','exec','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','insert','\x20WHERE\x20',')\x5cb','update','653232jAcLFi','fromCodePoint','join','\x20query\x20targeting\x20','toUpperCase','sql','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','replace','split','match','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','length','UPDATE','toLowerCase'];a238_0x35f1=function(){return _0x33ac03;};return a238_0x35f1();}export const MYBATIS_INCLUDE_MARKER=a238_0x5ef39d(0x16a);const UNRESOLVED_SQL_FRAGMENT=a238_0x5ef39d(0x1c3),MYBATIS_OUTER_TAG_PATTERN=new RegExp('^<\x5cs*(?:'+[...MYBATIS_OUTER_TAGS[a238_0x5ef39d(0x19f)]()][a238_0x5ef39d(0x1b3)]('|')+a238_0x5ef39d(0x1af),'i');export function normalizeSqlForStaticAnalysis(_0x55dcab){const _0x380762=a238_0x5ef39d,_0x260222=typeof _0x55dcab==='string'?_0x55dcab:'';if(!startsWithMybatisStatementWrapper(_0x260222))return{'sql':_0x260222,'mode':_0x380762(0x1b6)};let _0x54b902=0x0,_0x560611='',_0x3d657f,_0x11ba2c=![],_0x3bcc03=![];const _0x253b2d=[];while(_0x54b902<_0x260222[_0x380762(0x1bc)]){if(_0x260222[_0x380762(0x170)](_0x380762(0x1a5),_0x54b902)){const _0x1ce886=_0x260222[_0x380762(0x19c)](_0x380762(0x193),_0x54b902+0x4);if(_0x1ce886<0x0)return invalidMybatisSource('Unterminated\x20XML\x20comment.');_0x560611+='\x20',_0x54b902=_0x1ce886+0x3;continue;}if(_0x260222[_0x380762(0x170)](_0x380762(0x17e),_0x54b902)){if(!_0x11ba2c||_0x3bcc03)return invalidMybatisSource('CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');const _0x407d6c=_0x260222['indexOf'](_0x380762(0x197),_0x54b902+0x9);if(_0x407d6c<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x560611+=_0x260222[_0x380762(0x180)](_0x54b902+0x9,_0x407d6c),_0x54b902=_0x407d6c+0x3;continue;}if(_0x260222[_0x380762(0x170)]('<?',_0x54b902)){if(_0x11ba2c)return invalidMybatisSource(_0x380762(0x179));const _0x12f92f=_0x260222[_0x380762(0x19c)]('?>',_0x54b902+0x2);if(_0x12f92f<0x0)return invalidMybatisSource(_0x380762(0x16c));_0x560611+='\x20',_0x54b902=_0x12f92f+0x2;continue;}if(_0x260222[_0x54b902]!=='<'){const _0x3d148d=_0x260222['indexOf']('<',_0x54b902),_0x3f73e7=_0x3d148d<0x0?_0x260222[_0x380762(0x1bc)]:_0x3d148d,_0x1e9817=_0x260222[_0x380762(0x180)](_0x54b902,_0x3f73e7);if((!_0x11ba2c||_0x3bcc03)&&_0x1e9817[_0x380762(0x19b)]())return invalidMybatisSource(_0x380762(0x1ac));if(_0x11ba2c&&!_0x3bcc03){const _0x2dfb9e=decodeXmlEntities(_0x1e9817);if(_0x2dfb9e===null)return invalidMybatisSource(_0x380762(0x18b));_0x560611+=_0x2dfb9e;}else _0x560611+='\x20';_0x54b902=_0x3f73e7;continue;}const _0x179b05=findXmlTagEnd(_0x260222,_0x54b902);if(_0x179b05<0x0)return invalidMybatisSource('Unterminated\x20MyBatis\x20XML\x20tag.');const _0x1ad399=_0x260222[_0x380762(0x180)](_0x54b902,_0x179b05+0x1),_0x829b85=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/['exec'](_0x1ad399);if(!_0x829b85)return invalidMybatisSource(_0x380762(0x16d));const _0x17a8dd=_0x829b85[0x1]==='/',_0x47ec6f=_0x829b85[0x2]??'',_0x575e30=_0x47ec6f[_0x380762(0x1be)](),_0x1b7305=_0x829b85[0x3]??'',_0x233885=_0x829b85[0x4]==='/',_0x5b304a=MYBATIS_OUTER_TAGS[_0x380762(0x17f)](_0x575e30);if(!_0x5b304a&&!MYBATIS_DYNAMIC_TAGS[_0x380762(0x189)](_0x575e30))return invalidMybatisSource(_0x380762(0x1a4)+_0x575e30+'>.');if(!_0x5b304a&&_0x47ec6f!==_0x575e30)return invalidMybatisSource(_0x380762(0x1c4)+_0x47ec6f+'>.');if(_0x17a8dd){if(_0x1b7305[_0x380762(0x19b)]()||_0x233885)return invalidMybatisSource(_0x380762(0x187)+_0x47ec6f+'>.');const _0x3c024e=_0x253b2d['at'](-0x1);if(!_0x3c024e||(_0x3c024e[_0x380762(0x1a2)]?_0x3c024e[_0x380762(0x174)]!==_0x575e30:_0x3c024e[_0x380762(0x1c2)]!==_0x47ec6f))return invalidMybatisSource(_0x380762(0x1bf)+_0x47ec6f+'>.');_0x253b2d['pop']();if(_0x3c024e[_0x380762(0x1a2)])_0x3bcc03=!![];_0x560611+=MYBATIS_BRANCH_TAGS[_0x380762(0x189)](_0x575e30)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x1b7305))return invalidMybatisSource(_0x380762(0x1a1)+_0x47ec6f+'>.');if(_0x575e30===_0x380762(0x19d)&&(!_0x233885||_0x253b2d['at'](-0x1)?.['tagName']!==_0x380762(0x1a9)))return invalidMybatisSource('MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.');if(_0x5b304a){if(_0x11ba2c||_0x253b2d[_0x380762(0x1bc)]>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x11ba2c=!![],_0x3bcc03=_0x233885,_0x3d657f=_0x5b304a;}else{if(!_0x11ba2c||_0x3bcc03)return invalidMybatisSource(_0x380762(0x1b7)+_0x47ec6f+'>.');}_0x560611+=_0x575e30==='where'?_0x380762(0x1ae):_0x575e30===_0x380762(0x168)?'\x20SET\x20':_0x575e30===_0x380762(0x1a9)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x380762(0x189)](_0x575e30)&&!_0x233885?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x233885&&_0x253b2d['push']({'rawName':_0x47ec6f,'tagName':_0x575e30,'outer':!!_0x5b304a});}_0x54b902=_0x179b05+0x1;}if(_0x253b2d['length']>0x0)return invalidMybatisSource(_0x380762(0x1bb)+_0x253b2d['at'](-0x1)?.[_0x380762(0x1c2)]+'>.');if(!_0x11ba2c||!_0x3bcc03)return invalidMybatisSource(_0x380762(0x18c));return{'sql':_0x560611['trim'](),'mode':_0x380762(0x1a3),..._0x3d657f?{'statementType':_0x3d657f}:{}};}function hasWellFormedXmlAttributes(_0x2e52b9){const _0x830a64=a238_0x5ef39d;let _0x263119=0x0;const _0xa37c00=new Set();while(_0x263119<_0x2e52b9['length']){while(_0x263119<_0x2e52b9['length']&&/\s/[_0x830a64(0x18f)](_0x2e52b9[_0x263119]??''))_0x263119+=0x1;if(_0x263119>=_0x2e52b9['length'])return!![];const _0x29747b=/^[A-Za-z_:][\w:.-]*/[_0x830a64(0x1ab)](_0x2e52b9[_0x830a64(0x180)](_0x263119)),_0x8a0cac=_0x29747b?.[0x0];if(!_0x8a0cac||_0xa37c00[_0x830a64(0x189)](_0x8a0cac))return![];_0xa37c00['add'](_0x8a0cac),_0x263119+=_0x8a0cac['length'];while(_0x263119<_0x2e52b9['length']&&/\s/['test'](_0x2e52b9[_0x263119]??''))_0x263119+=0x1;if(_0x2e52b9[_0x263119]!=='=')return![];_0x263119+=0x1;while(_0x263119<_0x2e52b9[_0x830a64(0x1bc)]&&/\s/[_0x830a64(0x18f)](_0x2e52b9[_0x263119]??''))_0x263119+=0x1;const _0x883f79=_0x2e52b9[_0x263119];if(_0x883f79!=='\x22'&&_0x883f79!=='\x27')return![];_0x263119+=0x1;const _0x8a560d=_0x2e52b9[_0x830a64(0x19c)](_0x883f79,_0x263119);if(_0x8a560d<0x0)return![];if(decodeXmlEntities(_0x2e52b9['slice'](_0x263119,_0x8a560d))===null)return![];_0x263119=_0x8a560d+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x555e6d){const _0x351347=a238_0x5ef39d;let _0x1d7ad1=0x0;const _0x1904f7=()=>{const _0x1c9fb5=a238_0x3fe4;while(_0x1d7ad1<_0x555e6d[_0x1c9fb5(0x1bc)]&&/\s/[_0x1c9fb5(0x18f)](_0x555e6d[_0x1d7ad1]??''))_0x1d7ad1+=0x1;};_0x1904f7();while(_0x1d7ad1<_0x555e6d['length']){if(_0x555e6d['startsWith'](_0x351347(0x1a5),_0x1d7ad1)){const _0xf17c46=_0x555e6d[_0x351347(0x19c)](_0x351347(0x193),_0x1d7ad1+0x4);if(_0xf17c46<0x0)return!![];_0x1d7ad1=_0xf17c46+0x3,_0x1904f7();continue;}if(_0x555e6d[_0x351347(0x170)]('<?',_0x1d7ad1)){const _0x32565d=_0x555e6d['indexOf']('?>',_0x1d7ad1+0x2);if(_0x32565d<0x0)return!![];_0x1d7ad1=_0x32565d+0x2,_0x1904f7();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x351347(0x18f)](_0x555e6d['slice'](_0x1d7ad1));}function invalidMybatisSource(_0x2eb720){const _0xb9a0c8=a238_0x5ef39d;return{'sql':'','mode':_0xb9a0c8(0x1a3),'error':_0x2eb720};}function findXmlTagEnd(_0x52c284,_0x5db3e4){const _0xfef338=a238_0x5ef39d;let _0x2e06d1;for(let _0x39d7a7=_0x5db3e4+0x1;_0x39d7a7<_0x52c284[_0xfef338(0x1bc)];_0x39d7a7+=0x1){const _0x386db7=_0x52c284[_0x39d7a7];if(_0x2e06d1){if(_0x386db7===_0x2e06d1)_0x2e06d1=undefined;continue;}if(_0x386db7==='\x22'||_0x386db7==='\x27'){_0x2e06d1=_0x386db7;continue;}if(_0x386db7==='>')return _0x39d7a7;}return-0x1;}function decodeXmlEntities(_0x170104){const _0x43834f=a238_0x5ef39d;let _0x511f06=![];const _0x1d48f1=_0x170104[_0x43834f(0x1b8)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x225584=>{const _0x56d253=_0x43834f;if(_0x225584===_0x56d253(0x194))return'<';if(_0x225584===_0x56d253(0x19e))return'>';if(_0x225584===_0x56d253(0x17a))return'\x22';if(_0x225584===_0x56d253(0x1a0))return'\x27';if(_0x225584===_0x56d253(0x185))return'&';const _0x22e2c8=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x56d253(0x1ab)](_0x225584);if(_0x22e2c8){const _0x4802c7=_0x22e2c8[0x1],_0x5a88a0=_0x22e2c8[0x2],_0x5c54ad=Number['parseInt'](_0x4802c7??_0x5a88a0??'',_0x4802c7?0x10:0xa);if(isValidXmlCharacter(_0x5c54ad))return String[_0x56d253(0x1b2)](_0x5c54ad);}return _0x511f06=!![],'';});return _0x511f06?null:_0x1d48f1;}function isValidXmlCharacter(_0x16dfc3){return _0x16dfc3===0x9||_0x16dfc3===0xa||_0x16dfc3===0xd||_0x16dfc3>=0x20&&_0x16dfc3<=0xd7ff||_0x16dfc3>=0xe000&&_0x16dfc3<=0xfffd||_0x16dfc3>=0x10000&&_0x16dfc3<=0x10ffff;}export function detectSqlType(_0x1a9d43){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x1a9d43));}function detectNormalizedSqlType(_0x18cb25){const _0x39ef98=a238_0x5ef39d;if(_0x18cb25[_0x39ef98(0x173)])return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x18cb25['error']};if(!_0x18cb25[_0x39ef98(0x1b6)][_0x39ef98(0x19b)]())return{'type':_0x39ef98(0x178),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x3283c6=stripStaticAnalysisMarkers(_0x18cb25[_0x39ef98(0x1b6)])[_0x39ef98(0x1b8)](/#\{[^}]*\}/g,'?')[_0x39ef98(0x1b8)](/\$\{[^}]*\}/g,'?')[_0x39ef98(0x1b8)](/@[^(\s]+(\([^)]*\))?/g,'')['replace'](/\/\*[\s\S]*?\*\//g,'')[_0x39ef98(0x19b)](),_0xf73bbc=_0x3283c6[_0x39ef98(0x1b9)]('\x0a');let _0x16c888='';for(const _0x585de7 of _0xf73bbc){const _0x4c5325=_0x585de7['trim']();if(!_0x4c5325||_0x4c5325['startsWith']('--')||_0x4c5325[_0x39ef98(0x170)]('/*'))continue;_0x16c888=_0x4c5325;break;}const _0xb3ee04=_0x16c888[_0x39ef98(0x1b5)](),_0x4b826b=_0x18cb25[_0x39ef98(0x1c0)],_0xf43f6b=maskSqlTextForBlockedKeywordScan(_0x3283c6),_0x3e46c3=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x39ef98(0x18f)](_0xf43f6b);if(_0x4b826b==='SELECT'||!_0x4b826b&&(_0xb3ee04[_0x39ef98(0x170)]('SELECT')||_0xb3ee04[_0x39ef98(0x170)](_0x39ef98(0x184)))){const _0x233179=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x39ef98(0x18f)](_0x3283c6);return{'type':_0x39ef98(0x16b),'isSelectOnly':!_0x233179,'isDangerous':_0x233179,'reason':_0x233179?_0x39ef98(0x181):undefined};}if(_0x4b826b==='INSERT'||!_0x4b826b&&_0xb3ee04[_0x39ef98(0x170)](_0x39ef98(0x1c1)))return{'type':_0x39ef98(0x1c1),'isSelectOnly':![],'isDangerous':_0x3e46c3,'reason':_0x3e46c3?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x4b826b===_0x39ef98(0x1bd)||!_0x4b826b&&_0xb3ee04[_0x39ef98(0x170)](_0x39ef98(0x1bd)))return{'type':_0x39ef98(0x1bd),'isSelectOnly':![],'isDangerous':_0x3e46c3,'reason':_0x3e46c3?_0x39ef98(0x17b):undefined};if(_0x4b826b===_0x39ef98(0x177)||!_0x4b826b&&_0xb3ee04['startsWith'](_0x39ef98(0x177)))return{'type':_0x39ef98(0x177),'isSelectOnly':![],'isDangerous':!![],'reason':'DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save'};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0xb3ee04))return{'type':_0x39ef98(0x17d),'isSelectOnly':![],'isDangerous':!![],'reason':_0x39ef98(0x198)};return{'type':_0x39ef98(0x178),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x130482){const _0x2bd3f6=a238_0x5ef39d;return _0x130482[_0x2bd3f6(0x18e)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x2bd3f6(0x18e)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x265a6a){const _0xa97d9e=a238_0x5ef39d;return _0x265a6a[_0xa97d9e(0x1b8)](/'(?:''|\\.|[^'])*'/g,'\x20')['replace'](/"(?:""|\\.|[^"])*"/g,'\x20')[_0xa97d9e(0x1b8)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0xa97d9e(0x1b8)](/--.*$/gm,'\x20')['replace'](/#.*$/gm,'\x20')[_0xa97d9e(0x1b8)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0xa46620){const _0x3d455e=a238_0x5ef39d,_0x5a69f8=_0xa46620['replace'](/#\{[^}]*\}/g,'?')[_0x3d455e(0x1b8)](/\$\{[^}]*\}/g,'?')[_0x3d455e(0x1b8)](/'[^']*'/g,'\x27\x27')[_0x3d455e(0x1b8)](/--.*$/gm,'')[_0x3d455e(0x1b8)](/\/\*[\s\S]*?\*\//g,''),_0x142923=[],_0x232313=_0x5a69f8[_0x3d455e(0x1ba)](/FROM\s+([^\s,)(]+)/i);addTable(_0x142923,_0x232313?.[0x1]);for(const _0x249379 of _0x5a69f8[_0x3d455e(0x172)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x142923,_0x249379[0x1]);}const _0x383282=_0x5a69f8[_0x3d455e(0x1ba)](/INTO\s+([^\s(]+)/i);addTable(_0x142923,_0x383282?.[0x1]);const _0x4e7636=_0x5a69f8['match'](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x142923,_0x4e7636?.[0x1]),_0x142923;}function a238_0x3fe4(_0x68081e,_0x3becce){_0x68081e=_0x68081e-0x168;const _0x35f180=a238_0x35f1();let _0x3fe4cd=_0x35f180[_0x68081e];return _0x3fe4cd;}function addTable(_0x1400f1,_0x294ca0){const _0x3898ec=a238_0x5ef39d,_0x31290d=_0x294ca0?.[_0x3898ec(0x1b8)](/[`"]/g,'');_0x31290d&&_0x31290d!==UNRESOLVED_SQL_FRAGMENT&&!_0x1400f1['includes'](_0x31290d)&&_0x1400f1[_0x3898ec(0x17c)](_0x31290d);}function extractParameters(_0x3f98a1){const _0x4becbd=a238_0x5ef39d,_0x35756e=new Set();for(const _0x3976ae of _0x3f98a1[_0x4becbd(0x172)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x3976ae[0x1])_0x35756e[_0x4becbd(0x19a)](_0x3976ae[0x1]);}return Array[_0x4becbd(0x175)](_0x35756e);}export function validateSql(_0x2c1c77){const _0x1fc96a=a238_0x5ef39d,_0x23c505=normalizeSqlForStaticAnalysis(_0x2c1c77),_0x43508f=detectNormalizedSqlType(_0x23c505),_0x5d144c=stripStaticAnalysisMarkers(_0x23c505['sql']),_0x14d925=_0x23c505[_0x1fc96a(0x173)]?[]:extractTables(_0x5d144c),_0x503feb=_0x23c505[_0x1fc96a(0x173)]?[]:extractParameters(_0x5d144c);if(_0x43508f['isDangerous'])return{'valid':![],'sqlType':_0x43508f,'tables':_0x14d925,'parameters':_0x503feb,'message':_0x43508f['reason']||_0x43508f[_0x1fc96a(0x171)]+'\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.'};if(_0x43508f[_0x1fc96a(0x171)]==='UNKNOWN')return{'valid':![],'sqlType':_0x43508f,'tables':_0x14d925,'parameters':_0x503feb,'message':_0x23c505[_0x1fc96a(0x173)]?'Unable\x20to\x20detect\x20SQL\x20type.\x20'+_0x23c505[_0x1fc96a(0x173)]:_0x1fc96a(0x190)};return{'valid':!![],'sqlType':_0x43508f,'tables':_0x14d925,'parameters':_0x503feb,'message':_0x43508f['type']+_0x1fc96a(0x1b4)+(_0x14d925[_0x1fc96a(0x1bc)]?_0x14d925[_0x1fc96a(0x1b3)](',\x20'):_0x1fc96a(0x186))+(_0x503feb[_0x1fc96a(0x1bc)]?_0x1fc96a(0x1a6)+_0x503feb[_0x1fc96a(0x1b3)](',\x20'):'')};}
1
+ const a238_0x46258c=a238_0x42e4;(function(_0x25faa3,_0x30b0da){const _0x453653=a238_0x42e4,_0x1d313e=_0x25faa3();while(!![]){try{const _0x42f058=-parseInt(_0x453653(0x1d4))/0x1*(parseInt(_0x453653(0x1cd))/0x2)+parseInt(_0x453653(0x1d3))/0x3+parseInt(_0x453653(0x1e5))/0x4*(-parseInt(_0x453653(0x1f3))/0x5)+parseInt(_0x453653(0x1d7))/0x6*(parseInt(_0x453653(0x1af))/0x7)+parseInt(_0x453653(0x19b))/0x8+-parseInt(_0x453653(0x1e2))/0x9*(parseInt(_0x453653(0x1a9))/0xa)+-parseInt(_0x453653(0x1ea))/0xb*(parseInt(_0x453653(0x1d1))/0xc);if(_0x42f058===_0x30b0da)break;else _0x1d313e['push'](_0x1d313e['shift']());}catch(_0x2e1a20){_0x1d313e['push'](_0x1d313e['shift']());}}}(a238_0x2fc2,0x840f6));const MYBATIS_OUTER_TAGS=new Map([[a238_0x46258c(0x1b1),a238_0x46258c(0x1a0)],[a238_0x46258c(0x1f9),a238_0x46258c(0x1b0)],[a238_0x46258c(0x1b6),a238_0x46258c(0x1f1)],[a238_0x46258c(0x1b4),a238_0x46258c(0x1fc)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a238_0x46258c(0x1ad),a238_0x46258c(0x1bc),'choose',a238_0x46258c(0x1b2),a238_0x46258c(0x1e0),'trim',a238_0x46258c(0x1e6),'bind',a238_0x46258c(0x19c),a238_0x46258c(0x1dc)]),MYBATIS_BRANCH_TAGS=new Set(['if',a238_0x46258c(0x1bc),a238_0x46258c(0x1c4),a238_0x46258c(0x1b2),a238_0x46258c(0x1e0)]);export const MYBATIS_DYNAMIC_START_MARKER='__RABETBASE_MYBATIS_DYNAMIC_START__';export const MYBATIS_DYNAMIC_END_MARKER=a238_0x46258c(0x1f0);export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT='__RABETBASE_UNRESOLVED_SQL_FRAGMENT__',MYBATIS_OUTER_TAG_PATTERN=new RegExp(a238_0x46258c(0x1f7)+[...MYBATIS_OUTER_TAGS[a238_0x46258c(0x1ba)]()][a238_0x46258c(0x1be)]('|')+a238_0x46258c(0x1f5),'i');export function normalizeSqlForStaticAnalysis(_0x142994){const _0xf44a14=a238_0x46258c,_0x418a9f=typeof _0x142994==='string'?_0x142994:'';if(!startsWithMybatisStatementWrapper(_0x418a9f))return{'sql':_0x418a9f,'mode':_0xf44a14(0x1ac)};let _0x2c5d79=0x0,_0x16a1e4='',_0x5b2435,_0x271979=![],_0x19573a=![];const _0x2c8607=[];while(_0x2c5d79<_0x418a9f['length']){if(_0x418a9f[_0xf44a14(0x19e)](_0xf44a14(0x1ef),_0x2c5d79)){const _0x18e93a=_0x418a9f[_0xf44a14(0x1d6)](_0xf44a14(0x1bf),_0x2c5d79+0x4);if(_0x18e93a<0x0)return invalidMybatisSource(_0xf44a14(0x1e8));_0x16a1e4+='\x20',_0x2c5d79=_0x18e93a+0x3;continue;}if(_0x418a9f[_0xf44a14(0x19e)]('<![CDATA[',_0x2c5d79)){if(!_0x271979||_0x19573a)return invalidMybatisSource(_0xf44a14(0x1c3));const _0x51f805=_0x418a9f['indexOf'](']]>',_0x2c5d79+0x9);if(_0x51f805<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x16a1e4+=_0x418a9f['slice'](_0x2c5d79+0x9,_0x51f805),_0x2c5d79=_0x51f805+0x3;continue;}if(_0x418a9f[_0xf44a14(0x19e)]('<?',_0x2c5d79)){if(_0x271979)return invalidMybatisSource(_0xf44a14(0x1a3));const _0x48fe77=_0x418a9f[_0xf44a14(0x1d6)]('?>',_0x2c5d79+0x2);if(_0x48fe77<0x0)return invalidMybatisSource(_0xf44a14(0x1ca));_0x16a1e4+='\x20',_0x2c5d79=_0x48fe77+0x2;continue;}if(_0x418a9f[_0x2c5d79]!=='<'){const _0x1f4d54=_0x418a9f['indexOf']('<',_0x2c5d79),_0x2dd604=_0x1f4d54<0x0?_0x418a9f[_0xf44a14(0x1c0)]:_0x1f4d54,_0x174501=_0x418a9f[_0xf44a14(0x1d9)](_0x2c5d79,_0x2dd604);if((!_0x271979||_0x19573a)&&_0x174501[_0xf44a14(0x1c5)]())return invalidMybatisSource(_0xf44a14(0x1ee));if(_0x271979&&!_0x19573a){const _0x18f7d7=decodeXmlEntities(_0x174501);if(_0x18f7d7===null)return invalidMybatisSource(_0xf44a14(0x1fb));_0x16a1e4+=_0x18f7d7;}else _0x16a1e4+='\x20';_0x2c5d79=_0x2dd604;continue;}const _0x35afce=findXmlTagEnd(_0x418a9f,_0x2c5d79);if(_0x35afce<0x0)return invalidMybatisSource(_0xf44a14(0x19d));const _0x424a14=_0x418a9f[_0xf44a14(0x1d9)](_0x2c5d79,_0x35afce+0x1),_0x4248a6=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0xf44a14(0x1b9)](_0x424a14);if(!_0x4248a6)return invalidMybatisSource(_0xf44a14(0x1ec));const _0x1da2bf=_0x4248a6[0x1]==='/',_0x3ffc64=_0x4248a6[0x2]??'',_0xaacbcb=_0x3ffc64[_0xf44a14(0x1ab)](),_0x189b4a=_0x4248a6[0x3]??'',_0x22bb6d=_0x4248a6[0x4]==='/',_0x2bdd59=MYBATIS_OUTER_TAGS[_0xf44a14(0x1cc)](_0xaacbcb);if(!_0x2bdd59&&!MYBATIS_DYNAMIC_TAGS[_0xf44a14(0x1cf)](_0xaacbcb))return invalidMybatisSource('Unsupported\x20MyBatis\x20XML\x20tag:\x20<'+_0xaacbcb+'>.');if(!_0x2bdd59&&_0x3ffc64!==_0xaacbcb)return invalidMybatisSource(_0xf44a14(0x1e3)+_0x3ffc64+'>.');if(_0x1da2bf){if(_0x189b4a[_0xf44a14(0x1c5)]()||_0x22bb6d)return invalidMybatisSource(_0xf44a14(0x1aa)+_0x3ffc64+'>.');const _0x30acc1=_0x2c8607['at'](-0x1);if(!_0x30acc1||(_0x30acc1[_0xf44a14(0x1c6)]?_0x30acc1['tagName']!==_0xaacbcb:_0x30acc1[_0xf44a14(0x1da)]!==_0x3ffc64))return invalidMybatisSource(_0xf44a14(0x1e7)+_0x3ffc64+'>.');_0x2c8607[_0xf44a14(0x1a4)]();if(_0x30acc1[_0xf44a14(0x1c6)])_0x19573a=!![];_0x16a1e4+=MYBATIS_BRANCH_TAGS[_0xf44a14(0x1cf)](_0xaacbcb)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x189b4a))return invalidMybatisSource(_0xf44a14(0x1ce)+_0x3ffc64+'>.');if(_0xaacbcb===_0xf44a14(0x1dc)&&(!_0x22bb6d||_0x2c8607['at'](-0x1)?.[_0xf44a14(0x1b8)]!==_0xf44a14(0x19c)))return invalidMybatisSource(_0xf44a14(0x1f6));if(_0x2bdd59){if(_0x271979||_0x2c8607[_0xf44a14(0x1c0)]>0x0)return invalidMybatisSource(_0xf44a14(0x1dd));_0x271979=!![],_0x19573a=_0x22bb6d,_0x5b2435=_0x2bdd59;}else{if(!_0x271979||_0x19573a)return invalidMybatisSource(_0xf44a14(0x1b3)+_0x3ffc64+'>.');}_0x16a1e4+=_0xaacbcb===_0xf44a14(0x1ad)?'\x20WHERE\x20':_0xaacbcb===_0xf44a14(0x1e6)?_0xf44a14(0x1c7):_0xaacbcb===_0xf44a14(0x19c)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS['has'](_0xaacbcb)&&!_0x22bb6d?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x22bb6d&&_0x2c8607['push']({'rawName':_0x3ffc64,'tagName':_0xaacbcb,'outer':!!_0x2bdd59});}_0x2c5d79=_0x35afce+0x1;}if(_0x2c8607[_0xf44a14(0x1c0)]>0x0)return invalidMybatisSource(_0xf44a14(0x1d0)+_0x2c8607['at'](-0x1)?.['rawName']+'>.');if(!_0x271979||!_0x19573a)return invalidMybatisSource(_0xf44a14(0x1ed));return{'sql':_0x16a1e4[_0xf44a14(0x1c5)](),'mode':_0xf44a14(0x1c1),..._0x5b2435?{'statementType':_0x5b2435}:{}};}function hasWellFormedXmlAttributes(_0x3ff8dc){const _0x515b52=a238_0x46258c;let _0x49c2e7=0x0;const _0x43ad9f=new Set();while(_0x49c2e7<_0x3ff8dc[_0x515b52(0x1c0)]){while(_0x49c2e7<_0x3ff8dc['length']&&/\s/[_0x515b52(0x1a5)](_0x3ff8dc[_0x49c2e7]??''))_0x49c2e7+=0x1;if(_0x49c2e7>=_0x3ff8dc['length'])return!![];const _0x5d3d63=/^[A-Za-z_:][\w:.-]*/[_0x515b52(0x1b9)](_0x3ff8dc[_0x515b52(0x1d9)](_0x49c2e7)),_0x3fc0e0=_0x5d3d63?.[0x0];if(!_0x3fc0e0||_0x43ad9f[_0x515b52(0x1cf)](_0x3fc0e0))return![];_0x43ad9f['add'](_0x3fc0e0),_0x49c2e7+=_0x3fc0e0[_0x515b52(0x1c0)];while(_0x49c2e7<_0x3ff8dc[_0x515b52(0x1c0)]&&/\s/[_0x515b52(0x1a5)](_0x3ff8dc[_0x49c2e7]??''))_0x49c2e7+=0x1;if(_0x3ff8dc[_0x49c2e7]!=='=')return![];_0x49c2e7+=0x1;while(_0x49c2e7<_0x3ff8dc['length']&&/\s/[_0x515b52(0x1a5)](_0x3ff8dc[_0x49c2e7]??''))_0x49c2e7+=0x1;const _0x18a6d1=_0x3ff8dc[_0x49c2e7];if(_0x18a6d1!=='\x22'&&_0x18a6d1!=='\x27')return![];_0x49c2e7+=0x1;const _0x2184cc=_0x3ff8dc[_0x515b52(0x1d6)](_0x18a6d1,_0x49c2e7);if(_0x2184cc<0x0)return![];if(decodeXmlEntities(_0x3ff8dc[_0x515b52(0x1d9)](_0x49c2e7,_0x2184cc))===null)return![];_0x49c2e7=_0x2184cc+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x5ca0be){const _0x5f1ce1=a238_0x46258c;let _0x4bee6f=0x0;const _0x48c723=()=>{const _0x32ef32=a238_0x42e4;while(_0x4bee6f<_0x5ca0be[_0x32ef32(0x1c0)]&&/\s/['test'](_0x5ca0be[_0x4bee6f]??''))_0x4bee6f+=0x1;};_0x48c723();while(_0x4bee6f<_0x5ca0be[_0x5f1ce1(0x1c0)]){if(_0x5ca0be[_0x5f1ce1(0x19e)](_0x5f1ce1(0x1ef),_0x4bee6f)){const _0xa2f631=_0x5ca0be[_0x5f1ce1(0x1d6)]('-->',_0x4bee6f+0x4);if(_0xa2f631<0x0)return!![];_0x4bee6f=_0xa2f631+0x3,_0x48c723();continue;}if(_0x5ca0be['startsWith']('<?',_0x4bee6f)){const _0x32dab0=_0x5ca0be['indexOf']('?>',_0x4bee6f+0x2);if(_0x32dab0<0x0)return!![];_0x4bee6f=_0x32dab0+0x2,_0x48c723();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x5f1ce1(0x1a5)](_0x5ca0be[_0x5f1ce1(0x1d9)](_0x4bee6f));}function invalidMybatisSource(_0x31b538){const _0x3aca9b=a238_0x46258c;return{'sql':'','mode':_0x3aca9b(0x1c1),'error':_0x31b538};}function findXmlTagEnd(_0x4b0b49,_0x9525fe){let _0x343315;for(let _0x1dee49=_0x9525fe+0x1;_0x1dee49<_0x4b0b49['length'];_0x1dee49+=0x1){const _0x43638f=_0x4b0b49[_0x1dee49];if(_0x343315){if(_0x43638f===_0x343315)_0x343315=undefined;continue;}if(_0x43638f==='\x22'||_0x43638f==='\x27'){_0x343315=_0x43638f;continue;}if(_0x43638f==='>')return _0x1dee49;}return-0x1;}function decodeXmlEntities(_0x52fe3b){let _0x598d33=![];const _0x556cca=_0x52fe3b['replace'](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x37fe85=>{const _0x79a0db=a238_0x42e4;if(_0x37fe85==='&lt;')return'<';if(_0x37fe85==='&gt;')return'>';if(_0x37fe85===_0x79a0db(0x1cb))return'\x22';if(_0x37fe85===_0x79a0db(0x1f4))return'\x27';if(_0x37fe85===_0x79a0db(0x1f8))return'&';const _0x5de7fc=/^&#(?:x([0-9a-f]+)|([0-9]+));$/['exec'](_0x37fe85);if(_0x5de7fc){const _0x25211e=_0x5de7fc[0x1],_0xbd7d15=_0x5de7fc[0x2],_0x3a1561=Number[_0x79a0db(0x1bb)](_0x25211e??_0xbd7d15??'',_0x25211e?0x10:0xa);if(isValidXmlCharacter(_0x3a1561))return String[_0x79a0db(0x1ae)](_0x3a1561);}return _0x598d33=!![],'';});return _0x598d33?null:_0x556cca;}function isValidXmlCharacter(_0x35d460){return _0x35d460===0x9||_0x35d460===0xa||_0x35d460===0xd||_0x35d460>=0x20&&_0x35d460<=0xd7ff||_0x35d460>=0xe000&&_0x35d460<=0xfffd||_0x35d460>=0x10000&&_0x35d460<=0x10ffff;}export function detectSqlType(_0x3d7b88){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x3d7b88));}function a238_0x2fc2(){const _0xef42c7=['where','fromCodePoint','7pQsxfd','INSERT','select','when','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','delete','unknown\x20table(s)','update','DDL','tagName','exec','keys','parseInt','foreach','error','join','-->','length','mybatisXml','isDangerous','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','choose','trim','outer','\x20SET\x20','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','replace','Unterminated\x20XML\x20declaration.','&quot;','get','2TpBdST','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','has','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','7872JmAseN','match','2420415KTkqPj','443419yMwfNZ','type','indexOf','4928748ubdqGE','split','slice','rawName','replaceAll','property','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','SQL\x20content\x20is\x20empty','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','otherwise','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','268425MyKtkC','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','4QdeNGf','set','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','Unterminated\x20XML\x20comment.','\x20query\x20targeting\x20','8899mOHqjB','Unable\x20to\x20detect\x20SQL\x20type.\x20','Invalid\x20MyBatis\x20XML\x20tag.','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','<!--','__RABETBASE_MYBATIS_DYNAMIC_END__','UPDATE','WITH','4947475egNFgR','&apos;',')\x5cb','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','^<\x5cs*(?:','&amp;','insert','reason','Invalid\x20XML\x20entity\x20reference.','DELETE','7725984SdwUQc','include','Unterminated\x20MyBatis\x20XML\x20tag.','startsWith','push','SELECT','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','matchAll','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','pop','test','UNKNOWN','toUpperCase','add','30NRoROe','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','toLowerCase','sql'];a238_0x2fc2=function(){return _0xef42c7;};return a238_0x2fc2();}function detectNormalizedSqlType(_0x2fdc9a){const _0x98c45d=a238_0x46258c;if(_0x2fdc9a['error'])return{'type':_0x98c45d(0x1a6),'isSelectOnly':![],'isDangerous':![],'reason':_0x2fdc9a[_0x98c45d(0x1bd)]};if(!_0x2fdc9a['sql'][_0x98c45d(0x1c5)]())return{'type':_0x98c45d(0x1a6),'isSelectOnly':![],'isDangerous':![],'reason':_0x98c45d(0x1de)};const _0x11e7e3=stripStaticAnalysisMarkers(_0x2fdc9a[_0x98c45d(0x1ac)])[_0x98c45d(0x1c9)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x98c45d(0x1c9)](/\/\*[\s\S]*?\*\//g,'')[_0x98c45d(0x1c5)](),_0x2e6f15=_0x11e7e3[_0x98c45d(0x1d8)]('\x0a');let _0x39cd98='';for(const _0x30f89d of _0x2e6f15){const _0x28bf04=_0x30f89d[_0x98c45d(0x1c5)]();if(!_0x28bf04||_0x28bf04[_0x98c45d(0x19e)]('--')||_0x28bf04[_0x98c45d(0x19e)]('/*'))continue;_0x39cd98=_0x28bf04;break;}const _0x1c3182=_0x39cd98[_0x98c45d(0x1a7)](),_0x572155=_0x2fdc9a['statementType'],_0x4a780a=maskSqlTextForBlockedKeywordScan(_0x11e7e3),_0x3c4215=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x98c45d(0x1a5)](_0x4a780a);if(_0x572155==='SELECT'||!_0x572155&&(_0x1c3182['startsWith'](_0x98c45d(0x1a0))||_0x1c3182[_0x98c45d(0x19e)](_0x98c45d(0x1f2)))){const _0x4732e8=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x98c45d(0x1a5)](_0x11e7e3);return{'type':_0x98c45d(0x1a0),'isSelectOnly':!_0x4732e8,'isDangerous':_0x4732e8,'reason':_0x4732e8?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x572155===_0x98c45d(0x1b0)||!_0x572155&&_0x1c3182[_0x98c45d(0x19e)](_0x98c45d(0x1b0)))return{'type':_0x98c45d(0x1b0),'isSelectOnly':![],'isDangerous':_0x3c4215,'reason':_0x3c4215?_0x98c45d(0x1df):undefined};if(_0x572155===_0x98c45d(0x1f1)||!_0x572155&&_0x1c3182[_0x98c45d(0x19e)](_0x98c45d(0x1f1)))return{'type':_0x98c45d(0x1f1),'isSelectOnly':![],'isDangerous':_0x3c4215,'reason':_0x3c4215?_0x98c45d(0x1df):undefined};if(_0x572155===_0x98c45d(0x1fc)||!_0x572155&&_0x1c3182[_0x98c45d(0x19e)](_0x98c45d(0x1fc)))return{'type':_0x98c45d(0x1fc),'isSelectOnly':![],'isDangerous':!![],'reason':_0x98c45d(0x1e1)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x98c45d(0x1a5)](_0x1c3182))return{'type':_0x98c45d(0x1b7),'isSelectOnly':![],'isDangerous':!![],'reason':_0x98c45d(0x1c8)};return{'type':_0x98c45d(0x1a6),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x61fdf){const _0x27da02=a238_0x46258c;return _0x61fdf[_0x27da02(0x1db)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x27da02(0x1db)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x27da02(0x1db)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x1e12da){const _0x126274=a238_0x46258c;return _0x1e12da[_0x126274(0x1c9)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x126274(0x1c9)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x126274(0x1c9)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x126274(0x1c9)](/--.*$/gm,'\x20')[_0x126274(0x1c9)](/#.*$/gm,'\x20')[_0x126274(0x1c9)](/\/\*[\s\S]*?\*\//g,'\x20');}function a238_0x42e4(_0x3e10f0,_0x4a6baa){_0x3e10f0=_0x3e10f0-0x19b;const _0x2fc2b8=a238_0x2fc2();let _0x42e484=_0x2fc2b8[_0x3e10f0];return _0x42e484;}function extractTables(_0x51f308){const _0x15c788=a238_0x46258c,_0x4de6c3=_0x51f308[_0x15c788(0x1c9)](/#\{[^}]*\}/g,'?')[_0x15c788(0x1c9)](/\$\{[^}]*\}/g,'?')[_0x15c788(0x1c9)](/'[^']*'/g,'\x27\x27')[_0x15c788(0x1c9)](/--.*$/gm,'')[_0x15c788(0x1c9)](/\/\*[\s\S]*?\*\//g,''),_0x2965b9=[],_0x56aa16=_0x4de6c3['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0x2965b9,_0x56aa16?.[0x1]);for(const _0x422da1 of _0x4de6c3['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x2965b9,_0x422da1[0x1]);}const _0x33a596=_0x4de6c3[_0x15c788(0x1d2)](/INTO\s+([^\s(]+)/i);addTable(_0x2965b9,_0x33a596?.[0x1]);const _0x1da26c=_0x4de6c3['match'](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x2965b9,_0x1da26c?.[0x1]),_0x2965b9;}function addTable(_0x5c0c7b,_0x3bca4e){const _0x87d004=a238_0x46258c,_0x39acf1=_0x3bca4e?.['replace'](/[`"]/g,'');_0x39acf1&&_0x39acf1!==UNRESOLVED_SQL_FRAGMENT&&!_0x5c0c7b['includes'](_0x39acf1)&&_0x5c0c7b[_0x87d004(0x19f)](_0x39acf1);}function extractParameters(_0x101204){const _0x54c8ab=a238_0x46258c,_0x19bd64=new Set();for(const _0x4c2715 of _0x101204[_0x54c8ab(0x1a2)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x4c2715[0x1])_0x19bd64[_0x54c8ab(0x1a8)](_0x4c2715[0x1]);}return Array['from'](_0x19bd64);}export function validateSql(_0x4f92a5){const _0x5a217b=a238_0x46258c,_0x1407bd=normalizeSqlForStaticAnalysis(_0x4f92a5),_0x215f0e=detectNormalizedSqlType(_0x1407bd),_0x45238e=stripStaticAnalysisMarkers(_0x1407bd[_0x5a217b(0x1ac)]),_0x27f702=_0x1407bd['error']?[]:extractTables(_0x45238e),_0x434353=_0x1407bd[_0x5a217b(0x1bd)]?[]:extractParameters(_0x45238e);if(_0x215f0e[_0x5a217b(0x1c2)])return{'valid':![],'sqlType':_0x215f0e,'tables':_0x27f702,'parameters':_0x434353,'message':_0x215f0e[_0x5a217b(0x1fa)]||_0x215f0e['type']+_0x5a217b(0x1e4)};if(_0x215f0e['type']===_0x5a217b(0x1a6))return{'valid':![],'sqlType':_0x215f0e,'tables':_0x27f702,'parameters':_0x434353,'message':_0x1407bd[_0x5a217b(0x1bd)]?_0x5a217b(0x1eb)+_0x1407bd[_0x5a217b(0x1bd)]:_0x5a217b(0x1a1)};return{'valid':!![],'sqlType':_0x215f0e,'tables':_0x27f702,'parameters':_0x434353,'message':_0x215f0e[_0x5a217b(0x1d5)]+_0x5a217b(0x1e9)+(_0x27f702[_0x5a217b(0x1c0)]?_0x27f702['join'](',\x20'):_0x5a217b(0x1b5))+(_0x434353[_0x5a217b(0x1c0)]?'\x20with\x20parameters:\x20'+_0x434353[_0x5a217b(0x1be)](',\x20'):'')};}