@lovrabet/rabetbase-cli 2.4.4-beta.1 → 2.4.5-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 (330) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/members-list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app-config/delete.js +1 -1
  25. package/lib/commands/app-config/get.js +1 -1
  26. package/lib/commands/app-config/index.js +1 -1
  27. package/lib/commands/app-config/list.js +1 -1
  28. package/lib/commands/app-config/set.js +1 -1
  29. package/lib/commands/app-config/shared.js +1 -1
  30. package/lib/commands/auth/index.js +1 -1
  31. package/lib/commands/bff/create.js +1 -1
  32. package/lib/commands/bff/delete.js +1 -1
  33. package/lib/commands/bff/detail.js +1 -1
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/bff/list.js +1 -1
  36. package/lib/commands/bff/pull.js +1 -1
  37. package/lib/commands/bff/push.js +1 -1
  38. package/lib/commands/bff/status.js +1 -1
  39. package/lib/commands/cli-skill/index.js +1 -1
  40. package/lib/commands/cli-update.js +1 -1
  41. package/lib/commands/codegen/index.js +1 -1
  42. package/lib/commands/codegen/sdk.js +1 -1
  43. package/lib/commands/codegen/sql.js +1 -1
  44. package/lib/commands/common/app-registry.js +1 -1
  45. package/lib/commands/common/app-selector.js +1 -1
  46. package/lib/commands/common/async-task.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.d.ts +1 -0
  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/{permit/index.d.ts → dataset/business-groups.d.ts} +1 -1
  63. package/lib/commands/dataset/business-groups.js +1 -0
  64. package/lib/commands/dataset/capability.js +1 -1
  65. package/lib/commands/dataset/delete.js +1 -1
  66. package/lib/commands/dataset/detail.js +1 -1
  67. package/lib/commands/dataset/extend-update.js +1 -1
  68. package/lib/commands/dataset/field-update.js +1 -1
  69. package/lib/commands/dataset/generate.js +1 -1
  70. package/lib/commands/dataset/index.js +1 -1
  71. package/lib/commands/dataset/list.js +1 -1
  72. package/lib/commands/dataset/operations.js +1 -1
  73. package/lib/commands/dataset/relation-audit.js +1 -1
  74. package/lib/commands/dataset/relation-create.js +1 -1
  75. package/lib/commands/dataset/relation-delete.js +1 -1
  76. package/lib/commands/dataset/relation-shared.js +1 -1
  77. package/lib/commands/dataset/relation-update.js +1 -1
  78. package/lib/commands/dataset/relations.js +1 -1
  79. package/lib/commands/dataset/rename.js +1 -1
  80. package/lib/commands/dataset/restore.js +1 -1
  81. package/lib/commands/db/analysis-batching.js +1 -1
  82. package/lib/commands/db/analyze-batch-plan.js +1 -1
  83. package/lib/commands/db/analyze-cancel.js +1 -1
  84. package/lib/commands/db/analyze-start.js +1 -1
  85. package/lib/commands/db/analyze-status.js +1 -1
  86. package/lib/commands/db/create.js +1 -1
  87. package/lib/commands/db/delete.js +1 -1
  88. package/lib/commands/db/detail.js +1 -1
  89. package/lib/commands/db/diff-refresh-start.js +1 -1
  90. package/lib/commands/db/diff-refresh-status.js +1 -1
  91. package/lib/commands/db/diff.js +1 -1
  92. package/lib/commands/db/index.js +1 -1
  93. package/lib/commands/db/list.js +1 -1
  94. package/lib/commands/db/shared.d.ts +15 -1
  95. package/lib/commands/db/shared.js +1 -1
  96. package/lib/commands/db/tables.js +1 -1
  97. package/lib/commands/db/test.js +1 -1
  98. package/lib/commands/db/update.js +1 -1
  99. package/lib/commands/doctor.js +1 -1
  100. package/lib/commands/file/index.js +1 -1
  101. package/lib/commands/init/index.js +1 -1
  102. package/lib/commands/issue/index.js +1 -1
  103. package/lib/commands/issue/nudge.js +1 -1
  104. package/lib/commands/issue/report.js +1 -1
  105. package/lib/commands/issue/shared.js +1 -1
  106. package/lib/commands/kb/create.js +1 -1
  107. package/lib/commands/kb/delete.js +1 -1
  108. package/lib/commands/kb/detail.js +1 -1
  109. package/lib/commands/kb/index.js +1 -1
  110. package/lib/commands/kb/list.js +1 -1
  111. package/lib/commands/kb/shared.js +1 -1
  112. package/lib/commands/kb/update.js +1 -1
  113. package/lib/commands/logs/index.js +1 -1
  114. package/lib/commands/menu/asset-update.js +1 -1
  115. package/lib/commands/menu/delete.js +1 -1
  116. package/lib/commands/menu/external-link-create.js +1 -1
  117. package/lib/commands/menu/external-link-update.js +1 -1
  118. package/lib/commands/menu/group-create.js +1 -1
  119. package/lib/commands/menu/group-update.js +1 -1
  120. package/lib/commands/menu/index.js +1 -1
  121. package/lib/commands/menu/list.js +1 -1
  122. package/lib/commands/menu/move.js +1 -1
  123. package/lib/commands/menu/regroup-start.js +1 -1
  124. package/lib/commands/menu/rename.js +1 -1
  125. package/lib/commands/menu/shared/compare-table.js +1 -1
  126. package/lib/commands/menu/shared/delete-plan.js +1 -1
  127. package/lib/commands/menu/shared/facts.js +1 -1
  128. package/lib/commands/menu/shared/index.js +1 -1
  129. package/lib/commands/menu/shared/inquirer.js +1 -1
  130. package/lib/commands/menu/shared/local-pages.js +1 -1
  131. package/lib/commands/menu/shared/logic.js +1 -1
  132. package/lib/commands/menu/shared/mutations.js +1 -1
  133. package/lib/commands/menu/shared/service.js +1 -1
  134. package/lib/commands/menu/shared/sync-core.js +1 -1
  135. package/lib/commands/menu/shared/update-core.js +1 -1
  136. package/lib/commands/menu/shared/valid-url.js +1 -1
  137. package/lib/commands/menu/sync.js +1 -1
  138. package/lib/commands/notification/config-create.js +1 -1
  139. package/lib/commands/notification/config-delete.js +1 -1
  140. package/lib/commands/notification/config-list.js +1 -1
  141. package/lib/commands/notification/config-update.js +1 -1
  142. package/lib/commands/notification/index.js +1 -1
  143. package/lib/commands/notification/shared.js +1 -1
  144. package/lib/commands/ocr/index.js +1 -1
  145. package/lib/commands/page/generate-start.js +1 -1
  146. package/lib/commands/page/generate-status.js +1 -1
  147. package/lib/commands/page/index.js +1 -1
  148. package/lib/commands/page/pull.js +1 -1
  149. package/lib/commands/page/push.js +1 -1
  150. package/lib/commands/page/react/create.js +1 -1
  151. package/lib/commands/page/react/detail.js +1 -1
  152. package/lib/commands/page/react/list.js +1 -1
  153. package/lib/commands/page/react/publish.js +1 -1
  154. package/lib/commands/page/react/shared.js +1 -1
  155. package/lib/commands/page/react/syntax.js +1 -1
  156. package/lib/commands/page/react/template.js +1 -1
  157. package/lib/commands/page/react/update.js +1 -1
  158. package/lib/commands/page/relation-audit.js +1 -1
  159. package/lib/commands/page/restore.js +1 -1
  160. package/lib/commands/page/shared.js +1 -1
  161. package/lib/commands/page/standard-page-status.js +1 -1
  162. package/lib/commands/page/sync.js +1 -1
  163. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  164. package/lib/commands/project/create/format-elapsed.js +1 -1
  165. package/lib/commands/project/create/main.js +1 -1
  166. package/lib/commands/project/create/materialize-project-template.js +1 -1
  167. package/lib/commands/project/create/project-name.js +1 -1
  168. package/lib/commands/project/create/project-template-archive.js +1 -1
  169. package/lib/commands/project/create/project-template-path.js +1 -1
  170. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  171. package/lib/commands/project/create/use-format-code.js +1 -1
  172. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  173. package/lib/commands/project/index.js +1 -1
  174. package/lib/commands/project/upgrade.js +1 -1
  175. package/lib/commands/registry.js +1 -1
  176. package/lib/commands/role/delete.js +1 -1
  177. package/lib/commands/role/detail.js +1 -1
  178. package/lib/commands/role/index.js +1 -1
  179. package/lib/commands/role/list.js +1 -1
  180. package/lib/commands/role/shared.d.ts +15 -17
  181. package/lib/commands/role/shared.js +1 -1
  182. package/lib/commands/role/update.js +1 -1
  183. package/lib/commands/role/user-add.js +1 -1
  184. package/lib/commands/role/user-remove.js +1 -1
  185. package/lib/commands/role/user-resolve.js +1 -1
  186. package/lib/commands/run/index.js +1 -1
  187. package/lib/commands/schema.js +1 -1
  188. package/lib/commands/sql/create.js +1 -1
  189. package/lib/commands/sql/delete.js +1 -1
  190. package/lib/commands/sql/detail.js +1 -1
  191. package/lib/commands/sql/exec.js +1 -1
  192. package/lib/commands/sql/index.js +1 -1
  193. package/lib/commands/sql/list.js +1 -1
  194. package/lib/commands/sql/pull.js +1 -1
  195. package/lib/commands/sql/push.js +1 -1
  196. package/lib/commands/sql/shared.js +1 -1
  197. package/lib/commands/sql/status.js +1 -1
  198. package/lib/commands/sql/validate.js +1 -1
  199. package/lib/commands/task/index.js +1 -1
  200. package/lib/commands/task/status.js +1 -1
  201. package/lib/commands/tenant/index.js +1 -1
  202. package/lib/commands/tenant/members-list.js +1 -1
  203. package/lib/commands/tenant/shared.js +1 -1
  204. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  205. package/lib/commands/user-account/index.js +1 -1
  206. package/lib/commands/workspace/add.js +1 -1
  207. package/lib/commands/workspace/index.js +1 -1
  208. package/lib/commands/workspace/remove.js +1 -1
  209. package/lib/config/schema.js +1 -1
  210. package/lib/constant/cdn.js +1 -1
  211. package/lib/constant/cli.js +1 -1
  212. package/lib/constant/defaults.js +1 -1
  213. package/lib/constant/domain.js +1 -1
  214. package/lib/constant/env.js +1 -1
  215. package/lib/constant/output.js +1 -1
  216. package/lib/constant/paths.js +1 -1
  217. package/lib/constant/risk.js +1 -1
  218. package/lib/context/app-resolver.js +1 -1
  219. package/lib/context/auth-resolver.js +1 -1
  220. package/lib/context/config-loader.js +1 -1
  221. package/lib/context.js +1 -1
  222. package/lib/core/alias-resolver.js +1 -1
  223. package/lib/core/api-client.d.ts +70 -79
  224. package/lib/core/api-client.js +1 -1
  225. package/lib/core/bff/config.js +1 -1
  226. package/lib/core/bff/file-system.d.ts +1 -0
  227. package/lib/core/bff/file-system.js +1 -1
  228. package/lib/core/bff/hash.js +1 -1
  229. package/lib/core/bff/lock.js +1 -1
  230. package/lib/core/bff/utils.js +1 -1
  231. package/lib/core/db-resolver.js +1 -1
  232. package/lib/core/page/file-system.js +1 -1
  233. package/lib/core/page/hash.js +1 -1
  234. package/lib/core/page/lock.js +1 -1
  235. package/lib/core/sql-index-auditor.js +1 -1
  236. package/lib/core/sql-sync/config.js +1 -1
  237. package/lib/core/sql-sync/file-system.js +1 -1
  238. package/lib/core/sql-sync/hash.js +1 -1
  239. package/lib/core/sql-sync/lock.js +1 -1
  240. package/lib/core/sql-sync/utils.js +1 -1
  241. package/lib/core/sql-validator.js +1 -1
  242. package/lib/errors.js +1 -1
  243. package/lib/framework/build-all-flags.js +1 -1
  244. package/lib/framework/error-output.js +1 -1
  245. package/lib/framework/explicit-yes.js +1 -1
  246. package/lib/framework/flags.js +1 -1
  247. package/lib/framework/help.js +1 -1
  248. package/lib/framework/index.js +1 -1
  249. package/lib/framework/output.js +1 -1
  250. package/lib/framework/response.js +1 -1
  251. package/lib/framework/runner-alias.js +1 -1
  252. package/lib/framework/runner.js +1 -1
  253. package/lib/framework/schema-export.js +1 -1
  254. package/lib/framework/types.js +1 -1
  255. package/lib/generated/build-info.d.ts +4 -4
  256. package/lib/generated/build-info.js +1 -1
  257. package/lib/help.js +1 -1
  258. package/lib/postinstall.js +1 -1
  259. package/lib/runtime/confirmation.js +1 -1
  260. package/lib/runtime/event.js +1 -1
  261. package/lib/runtime/index.js +1 -1
  262. package/lib/runtime/queue.js +1 -1
  263. package/lib/runtime/resolve.js +1 -1
  264. package/lib/skills/builtin-skill.js +1 -1
  265. package/lib/skills/main.js +1 -1
  266. package/lib/skills/npx-skills-add.js +1 -1
  267. package/lib/skills/skill-presence.js +1 -1
  268. package/lib/telemetry/cli-command-trace.js +1 -1
  269. package/lib/telemetry/cli-help-trace.js +1 -1
  270. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  271. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  272. package/lib/telemetry/send-cli-trace-log.js +1 -1
  273. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  274. package/lib/utils/ai_config.js +1 -1
  275. package/lib/utils/apply-jq-filter.js +1 -1
  276. package/lib/utils/cdn-config.js +1 -1
  277. package/lib/utils/check-sdk-version.js +1 -1
  278. package/lib/utils/cli-version-check.js +1 -1
  279. package/lib/utils/cli-version-policy.js +1 -1
  280. package/lib/utils/config.js +1 -1
  281. package/lib/utils/entity-with-id.js +1 -1
  282. package/lib/utils/file-utils.js +1 -1
  283. package/lib/utils/guides-cdn.js +1 -1
  284. package/lib/utils/http-client.js +1 -1
  285. package/lib/utils/is-non-interactive.js +1 -1
  286. package/lib/utils/logger.js +1 -1
  287. package/lib/utils/params.js +1 -1
  288. package/lib/utils/platform.js +1 -1
  289. package/lib/utils/rules-cdn.js +1 -1
  290. package/lib/utils/sleep.js +1 -1
  291. package/lib/utils/template-replacer.js +1 -1
  292. package/lib/utils/update-notice.js +1 -1
  293. package/lib/utils/version.js +1 -1
  294. package/lib/utils/with-active-cookie.js +1 -1
  295. package/lib/utils/write-cli-side-channel.js +1 -1
  296. package/package.json +1 -1
  297. package/skills/rabetbase/SKILL.md +18 -24
  298. package/skills/rabetbase/guides/database-connection-workflow.md +6 -2
  299. package/skills/rabetbase/references/rabetbase-dataset-business-groups.md +28 -0
  300. package/skills/rabetbase/references/rabetbase-dataset-delete.md +7 -5
  301. package/skills/rabetbase/references/rabetbase-dataset-list.md +6 -6
  302. package/skills/rabetbase/references/rabetbase-dataset-restore.md +5 -5
  303. package/skills/rabetbase/references/rabetbase-db-create.md +3 -0
  304. package/skills/rabetbase/references/rabetbase-db-delete.md +10 -2
  305. package/skills/rabetbase/references/rabetbase-db-detail.md +2 -0
  306. package/skills/rabetbase/references/rabetbase-db-list.md +3 -2
  307. package/skills/rabetbase/references/rabetbase-db-update.md +4 -2
  308. package/skills/rabetbase/references/rabetbase-role-list.md +9 -17
  309. package/skills/rabetbase/references/rabetbase-role-user-add.md +44 -16
  310. package/skills/rabetbase/references/rabetbase-role-user-resolve.md +2 -2
  311. package/skills/rabetbase.manifest.json +4 -7
  312. package/lib/commands/permit/index.js +0 -1
  313. package/lib/commands/permit/page-get.d.ts +0 -2
  314. package/lib/commands/permit/page-get.js +0 -1
  315. package/lib/commands/permit/page-set.d.ts +0 -2
  316. package/lib/commands/permit/page-set.js +0 -1
  317. package/lib/commands/permit/role-apis-set.d.ts +0 -2
  318. package/lib/commands/permit/role-apis-set.js +0 -1
  319. package/lib/commands/permit/role-menus-set.d.ts +0 -2
  320. package/lib/commands/permit/role-menus-set.js +0 -1
  321. package/lib/commands/permit/role-menus.d.ts +0 -2
  322. package/lib/commands/permit/role-menus.js +0 -1
  323. package/lib/commands/permit/shared.d.ts +0 -74
  324. package/lib/commands/permit/shared.js +0 -1
  325. package/lib/commands/role/create.d.ts +0 -2
  326. package/lib/commands/role/create.js +0 -1
  327. package/skills/rabetbase/guides/role-permit-workflow.md +0 -127
  328. package/skills/rabetbase/references/rabetbase-permit-page-set.md +0 -69
  329. package/skills/rabetbase/references/rabetbase-permit-role-apis-set.md +0 -53
  330. package/skills/rabetbase/references/rabetbase-permit-role-menus-set.md +0 -57
@@ -1 +1 @@
1
- const a228_0x3dc8a8=a228_0x290c;(function(_0x5378e5,_0xecff00){const _0x2cd8e6=a228_0x290c,_0x2f0f13=_0x5378e5();while(!![]){try{const _0x388a40=parseInt(_0x2cd8e6(0xff))/0x1+parseInt(_0x2cd8e6(0xf5))/0x2*(-parseInt(_0x2cd8e6(0xef))/0x3)+-parseInt(_0x2cd8e6(0xfc))/0x4*(parseInt(_0x2cd8e6(0xfb))/0x5)+parseInt(_0x2cd8e6(0xee))/0x6*(parseInt(_0x2cd8e6(0x109))/0x7)+parseInt(_0x2cd8e6(0x107))/0x8*(-parseInt(_0x2cd8e6(0x105))/0x9)+-parseInt(_0x2cd8e6(0xe8))/0xa+parseInt(_0x2cd8e6(0xf0))/0xb;if(_0x388a40===_0xecff00)break;else _0x2f0f13['push'](_0x2f0f13['shift']());}catch(_0x50bb77){_0x2f0f13['push'](_0x2f0f13['shift']());}}}(a228_0x1cf9,0x216e8));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a228_0x3dc8a8(0xf4),'ENDPOINT',a228_0x3dc8a8(0xf6)];export function normalizeBffType(_0x548de2){const _0x4d86b0=a228_0x3dc8a8;if(!_0x548de2)return undefined;const _0x59a07b=_0x548de2[_0x4d86b0(0xfd)]()[_0x4d86b0(0xf1)]();return SUPPORTED_BFF_TYPES[_0x4d86b0(0x10a)](_0x59a07b)?_0x59a07b:undefined;}async function scanJsFilesRecursively(_0x43b457,_0x353e20){const _0x49a5d3=a228_0x3dc8a8,_0x14e36f=[];try{const _0x4f8f69=await readdir(_0x43b457,{'withFileTypes':!![]});for(const _0x1639f0 of _0x4f8f69){const _0x3fda06=join(_0x43b457,_0x1639f0[_0x49a5d3(0xf8)]);if(_0x1639f0[_0x49a5d3(0xfa)]())_0x14e36f[_0x49a5d3(0xfe)](...await scanJsFilesRecursively(_0x3fda06,_0x353e20+'/'+_0x1639f0[_0x49a5d3(0xf8)]));else _0x1639f0[_0x49a5d3(0xe4)]()&&_0x1639f0[_0x49a5d3(0xf8)][_0x49a5d3(0xec)](_0x49a5d3(0x102))&&_0x14e36f[_0x49a5d3(0xfe)]({'lockKey':_0x353e20+'/'+_0x1639f0['name'][_0x49a5d3(0xf2)](/\.js$/,''),'filePath':_0x3fda06});}}catch(_0x490d84){if(_0x490d84[_0x49a5d3(0x108)]!==_0x49a5d3(0x103))throw _0x490d84;}return _0x14e36f;}async function scanFlatFunctions(_0x231082,_0x47af42){const _0x468e6c=a228_0x3dc8a8,_0x3afc72=join(_0x231082['scriptsRootDir'],_0x47af42),_0x4e996a=await scanJsFilesRecursively(_0x3afc72,_0x47af42);return _0x4e996a[_0x468e6c(0xe6)](({lockKey:_0x7e3f07,filePath:_0x28f939})=>({'type':_0x47af42,'name':_0x7e3f07[_0x468e6c(0x100)]('/')['at'](-0x1)??'','filePath':_0x28f939,'lockKey':_0x7e3f07}));}async function scanHookFunctions(_0x1cebdd){const _0x37c96f=a228_0x3dc8a8,_0x2a65fd=join(_0x1cebdd[_0x37c96f(0xe9)],_0x37c96f(0xf6)),_0x597ff0=[];try{const _0x41a57c=await readdir(_0x2a65fd,{'withFileTypes':!![]});for(const _0x445e5b of _0x41a57c){if(!_0x445e5b[_0x37c96f(0xfa)]())continue;const _0x1e1395=_0x445e5b['name'],_0x20d558=join(_0x2a65fd,_0x1e1395),_0x1aa461=await readdir(_0x20d558,{'withFileTypes':!![]});for(const _0x3f31a2 of _0x1aa461){if(!_0x3f31a2[_0x37c96f(0xfa)]())continue;const _0x3bffb=_0x3f31a2['name'],_0x150bbe=join(_0x20d558,_0x3bffb),_0x48aa88=await readdir(_0x150bbe,{'withFileTypes':!![]});for(const _0x3eb54 of _0x48aa88){if(!_0x3eb54[_0x37c96f(0xfa)]())continue;const _0x2bae62=_0x3eb54['name'],_0x24c43f=join(_0x150bbe,_0x2bae62),_0x686248=await readdir(_0x24c43f,{'withFileTypes':!![]});for(const _0x428209 of _0x686248){if(!_0x428209[_0x37c96f(0xe4)]()||!_0x428209[_0x37c96f(0xf8)][_0x37c96f(0xec)]('.js'))continue;const _0x8b68f3=_0x428209[_0x37c96f(0xf8)][_0x37c96f(0xf2)](/\.js$/,'');_0x597ff0[_0x37c96f(0xfe)]({'type':_0x37c96f(0xf6),'name':_0x8b68f3,'filePath':join(_0x24c43f,_0x428209['name']),'lockKey':_0x37c96f(0xf3)+_0x1e1395+'/'+_0x3bffb+'/'+_0x2bae62+'/'+_0x8b68f3,'alias':_0x1e1395,'operationType':_0x3bffb,'functionNode':_0x2bae62});}}}}}catch(_0x23d8b9){if(_0x23d8b9['code']!==_0x37c96f(0x103))throw _0x23d8b9;}return _0x597ff0;}export async function scanLocalBffFunctions(_0xd07c,_0x5eb8f8){const _0x473ef9=a228_0x3dc8a8;if(_0x5eb8f8===_0x473ef9(0xf4)||_0x5eb8f8==='ENDPOINT')return scanFlatFunctions(_0xd07c,_0x5eb8f8);if(_0x5eb8f8===_0x473ef9(0xf6))return scanHookFunctions(_0xd07c);const [_0x3195ce,_0x38a168,_0x395d3b]=await Promise[_0x473ef9(0xed)]([scanFlatFunctions(_0xd07c,_0x473ef9(0xf4)),scanFlatFunctions(_0xd07c,_0x473ef9(0xf9)),scanHookFunctions(_0xd07c)]);return[..._0x3195ce,..._0x38a168,..._0x395d3b];}export function resolveLocalFilePathFromLockKey(_0x1fade9,_0x11c15a){const _0x1508fe=a228_0x3dc8a8;return join(_0x1fade9[_0x1508fe(0xe9)],..._0x11c15a[_0x1508fe(0x100)]('/'))+_0x1508fe(0x102);}export function createHookLocationMap(_0x39019e){const _0x42b01d=a228_0x3dc8a8,_0x1958b8=new Map();for(const _0x10ffc9 of _0x39019e){_0x10ffc9[_0x42b01d(0xea)]&&_0x1958b8[_0x42b01d(0xe5)](_0x10ffc9[_0x42b01d(0xea)],{'datasetCode':_0x10ffc9['datasetCode'],'operationType':snakeToCamel(_0x10ffc9[_0x42b01d(0x106)]),'functionNode':_0x42b01d(0x101)}),_0x10ffc9[_0x42b01d(0x10c)]&&_0x1958b8[_0x42b01d(0xe5)](_0x10ffc9[_0x42b01d(0x10c)],{'datasetCode':_0x10ffc9[_0x42b01d(0xe7)],'operationType':snakeToCamel(_0x10ffc9[_0x42b01d(0x106)]),'functionNode':_0x42b01d(0x104)});}return _0x1958b8;}export function resolveRemoteScriptTarget(_0x106e4f,_0x597d18,_0x2a7669,_0x530418,_0x42b5b0){const _0x313fa0=a228_0x3dc8a8,_0x498f35=normalizeBffType(_0x597d18['scriptType']);if(!_0x498f35||!_0x597d18[_0x313fa0(0xe3)])return null;if(_0x498f35===_0x313fa0(0xf6)){const _0x215084=(_0x597d18['id']?_0x2a7669[_0x313fa0(0xeb)](_0x597d18['id']):undefined)??findHookLocationByRemoteId(_0x530418,_0x597d18['id']);if(!_0x215084)return null;const _0x474b7c=_0x215084[_0x313fa0(0xf7)]||_0x42b5b0[_0x313fa0(0xeb)](_0x215084['datasetCode']),_0x365e5b=_0x474b7c??_0x215084['datasetCode'],_0xab4dfd={..._0x215084,'alias':_0x474b7c},_0xe348da=_0x313fa0(0xf3)+_0x365e5b+'/'+_0xab4dfd[_0x313fa0(0x106)]+'/'+_0xab4dfd['functionNode']+'/'+_0x597d18[_0x313fa0(0xe3)];return{'lockKey':_0xe348da,'filePath':resolveLocalFilePathFromLockKey(_0x106e4f,_0xe348da),'type':_0x313fa0(0xf6),'hookLocation':_0xab4dfd};}const _0x547264=_0x498f35+'/'+_0x597d18[_0x313fa0(0xe3)];return{'lockKey':_0x547264,'filePath':resolveLocalFilePathFromLockKey(_0x106e4f,_0x547264),'type':_0x498f35};}function a228_0x1cf9(){const _0x450ccb=['before','.js','ENOENT','after','139131GQfaMR','operationType','32jfWqPS','code','1708qlrgyT','includes','F_OK','afterScriptId','functionName','isFile','set','map','datasetCode','1699380trKOXE','scriptsRootDir','beforeScriptId','get','endsWith','all','276BpBZnI','39801LqZRFl','4010424KApEpq','toUpperCase','replace','HOOK/','COMMON','26rYRspt','HOOK','alias','name','ENDPOINT','isDirectory','10hTodmZ','35344TqGWFr','trim','push','183045TkoSop','split'];a228_0x1cf9=function(){return _0x450ccb;};return a228_0x1cf9();}function a228_0x290c(_0x3d868d,_0x586303){_0x3d868d=_0x3d868d-0xe3;const _0x1cf9fb=a228_0x1cf9();let _0x290c37=_0x1cf9fb[_0x3d868d];return _0x290c37;}export async function ensureParentDirectory(_0x3fb2b4){await mkdir(dirname(_0x3fb2b4),{'recursive':!![]});}export async function fileExists(_0xac80b5){const _0x1e9957=a228_0x3dc8a8;try{return await access(_0xac80b5,constants[_0x1e9957(0x10b)]),!![];}catch{return![];}}export async function directoryExists(_0x50ae34){const _0x581abf=a228_0x3dc8a8;try{const _0x4692d0=await stat(_0x50ae34);return _0x4692d0[_0x581abf(0xfa)]();}catch{return![];}}
1
+ const a221_0x54ce39=a221_0x2c8b;(function(_0x1d8e4a,_0xfc7e96){const _0x8a7b3e=a221_0x2c8b,_0x2f8673=_0x1d8e4a();while(!![]){try{const _0x2501d1=-parseInt(_0x8a7b3e(0x8f))/0x1+parseInt(_0x8a7b3e(0xa5))/0x2*(-parseInt(_0x8a7b3e(0x7d))/0x3)+-parseInt(_0x8a7b3e(0x8a))/0x4*(parseInt(_0x8a7b3e(0xa3))/0x5)+parseInt(_0x8a7b3e(0x87))/0x6*(parseInt(_0x8a7b3e(0x7c))/0x7)+-parseInt(_0x8a7b3e(0x7a))/0x8*(-parseInt(_0x8a7b3e(0x9c))/0x9)+parseInt(_0x8a7b3e(0x7b))/0xa*(-parseInt(_0x8a7b3e(0xa0))/0xb)+-parseInt(_0x8a7b3e(0x8b))/0xc*(-parseInt(_0x8a7b3e(0x95))/0xd);if(_0x2501d1===_0xfc7e96)break;else _0x2f8673['push'](_0x2f8673['shift']());}catch(_0x1a7f5e){_0x2f8673['push'](_0x2f8673['shift']());}}}(a221_0x57ac,0xaf3ec));import{access,mkdir,readdir,stat}from'node:fs/promises';function a221_0x2c8b(_0x540fd9,_0x491fef){_0x540fd9=_0x540fd9-0x7a;const _0x57acb5=a221_0x57ac();let _0x2c8bb9=_0x57acb5[_0x540fd9];return _0x2c8bb9;}import{constants}from'node:fs';import{dirname,join,resolve,sep}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';function a221_0x57ac(){const _0x23a4ac=['671913SAvhbW','isDirectory','name','split','11zKcYTb','ENDPOINT','operationType','953555TqVqtF','all','12bWmEuW','datasetCode','112ceOmtv','3983410wplVcI','120729BNXPvG','19233EHZAKW','every','.js','map','HOOK','functionNode','scriptsRootDir','trim','startsWith','get','186JbmAyA','push','endsWith','16dBXSAv','12vMNlZz','F_OK','isFile','HOOK/','641781hGZjWx','replace','beforeScriptId','functionName','scriptType','code','12731953egSOli','set','test','Resolved\x20BFF\x20script\x20path\x20escapes\x20scripts\x20root:\x20','COMMON','afterScriptId','ENOENT'];a221_0x57ac=function(){return _0x23a4ac;};return a221_0x57ac();}export const SUPPORTED_BFF_TYPES=[a221_0x54ce39(0x99),a221_0x54ce39(0xa1),a221_0x54ce39(0x81)];export function normalizeBffType(_0x5e56f2){const _0x4ca72a=a221_0x54ce39;if(!_0x5e56f2)return undefined;const _0x15622e=_0x5e56f2[_0x4ca72a(0x84)]()['toUpperCase']();return SUPPORTED_BFF_TYPES['includes'](_0x15622e)?_0x15622e:undefined;}async function scanJsFilesRecursively(_0x53c099,_0x4efa86){const _0x5dcd89=a221_0x54ce39,_0xabf77=[];try{const _0x8478a6=await readdir(_0x53c099,{'withFileTypes':!![]});for(const _0x163b44 of _0x8478a6){const _0x1270ff=join(_0x53c099,_0x163b44['name']);if(_0x163b44[_0x5dcd89(0x9d)]())_0xabf77[_0x5dcd89(0x88)](...await scanJsFilesRecursively(_0x1270ff,_0x4efa86+'/'+_0x163b44['name']));else _0x163b44[_0x5dcd89(0x8d)]()&&_0x163b44[_0x5dcd89(0x9e)][_0x5dcd89(0x89)](_0x5dcd89(0x7f))&&_0xabf77['push']({'lockKey':_0x4efa86+'/'+_0x163b44[_0x5dcd89(0x9e)]['replace'](/\.js$/,''),'filePath':_0x1270ff});}}catch(_0x459ab1){if(_0x459ab1[_0x5dcd89(0x94)]!==_0x5dcd89(0x9b))throw _0x459ab1;}return _0xabf77;}async function scanFlatFunctions(_0x315761,_0x214807){const _0x17c586=a221_0x54ce39,_0x6b3c68=join(_0x315761[_0x17c586(0x83)],_0x214807),_0x560301=await scanJsFilesRecursively(_0x6b3c68,_0x214807);return _0x560301[_0x17c586(0x80)](({lockKey:_0x3e4892,filePath:_0x27c6d5})=>({'type':_0x214807,'name':_0x3e4892[_0x17c586(0x9f)]('/')['at'](-0x1)??'','filePath':_0x27c6d5,'lockKey':_0x3e4892}));}async function scanHookFunctions(_0x401aa5){const _0x560c71=a221_0x54ce39,_0x2e2fdb=join(_0x401aa5[_0x560c71(0x83)],_0x560c71(0x81)),_0x3bc288=[];try{const _0x2fc875=await readdir(_0x2e2fdb,{'withFileTypes':!![]});for(const _0x3fd2a4 of _0x2fc875){if(!_0x3fd2a4[_0x560c71(0x9d)]())continue;const _0x2b8000=_0x3fd2a4[_0x560c71(0x9e)],_0x1f3ac5=join(_0x2e2fdb,_0x2b8000),_0x16586a=await readdir(_0x1f3ac5,{'withFileTypes':!![]});for(const _0x4a75e3 of _0x16586a){if(!_0x4a75e3[_0x560c71(0x9d)]())continue;const _0x30ed80=_0x4a75e3[_0x560c71(0x9e)],_0x381cd2=join(_0x1f3ac5,_0x30ed80),_0xc46472=await readdir(_0x381cd2,{'withFileTypes':!![]});for(const _0x4258aa of _0xc46472){if(!_0x4258aa[_0x560c71(0x9d)]())continue;const _0x4dc3ca=_0x4258aa[_0x560c71(0x9e)],_0xfafdcc=join(_0x381cd2,_0x4dc3ca),_0x4f6fb1=await readdir(_0xfafdcc,{'withFileTypes':!![]});for(const _0x3fcd07 of _0x4f6fb1){if(!_0x3fcd07['isFile']()||!_0x3fcd07['name'][_0x560c71(0x89)](_0x560c71(0x7f)))continue;const _0x22ac7a=_0x3fcd07[_0x560c71(0x9e)][_0x560c71(0x90)](/\.js$/,'');_0x3bc288[_0x560c71(0x88)]({'type':_0x560c71(0x81),'name':_0x22ac7a,'filePath':join(_0xfafdcc,_0x3fcd07[_0x560c71(0x9e)]),'lockKey':'HOOK/'+_0x2b8000+'/'+_0x30ed80+'/'+_0x4dc3ca+'/'+_0x22ac7a,'alias':_0x2b8000,'operationType':_0x30ed80,'functionNode':_0x4dc3ca});}}}}}catch(_0x4ca0f2){if(_0x4ca0f2[_0x560c71(0x94)]!==_0x560c71(0x9b))throw _0x4ca0f2;}return _0x3bc288;}export async function scanLocalBffFunctions(_0x360ea2,_0x2d7276){const _0x5a5db6=a221_0x54ce39;if(_0x2d7276===_0x5a5db6(0x99)||_0x2d7276===_0x5a5db6(0xa1))return scanFlatFunctions(_0x360ea2,_0x2d7276);if(_0x2d7276==='HOOK')return scanHookFunctions(_0x360ea2);const [_0x372781,_0xd831dd,_0x18a793]=await Promise[_0x5a5db6(0xa4)]([scanFlatFunctions(_0x360ea2,_0x5a5db6(0x99)),scanFlatFunctions(_0x360ea2,'ENDPOINT'),scanHookFunctions(_0x360ea2)]);return[..._0x372781,..._0xd831dd,..._0x18a793];}const SAFE_LOCK_KEY_SEGMENT=/^[A-Za-z0-9_$.-]+$/;export function isSafeLockKeySegment(_0x25166d){const _0x45b13d=a221_0x54ce39;return SAFE_LOCK_KEY_SEGMENT[_0x45b13d(0x97)](_0x25166d)&&_0x25166d!=='.'&&_0x25166d!=='..';}export function resolveLocalFilePathFromLockKey(_0x54028e,_0x2cee36){const _0x503572=a221_0x54ce39,_0x25087d=_0x2cee36[_0x503572(0x9f)]('/');if(!_0x25087d['every'](isSafeLockKeySegment))throw new Error('Unsafe\x20BFF\x20lock\x20key\x20(traversal\x20or\x20invalid\x20segment):\x20'+_0x2cee36);const _0x554846=resolve(join(_0x54028e[_0x503572(0x83)],..._0x25087d)+_0x503572(0x7f)),_0x4790d1=resolve(_0x54028e[_0x503572(0x83)]);if(_0x554846!==_0x4790d1&&!_0x554846[_0x503572(0x85)](_0x4790d1+sep))throw new Error(_0x503572(0x98)+_0x554846);return _0x554846;}export function createHookLocationMap(_0x2545d3){const _0x5a5cbe=a221_0x54ce39,_0x1a894a=new Map();for(const _0x5d6ff3 of _0x2545d3){_0x5d6ff3[_0x5a5cbe(0x91)]&&_0x1a894a[_0x5a5cbe(0x96)](_0x5d6ff3[_0x5a5cbe(0x91)],{'datasetCode':_0x5d6ff3[_0x5a5cbe(0xa6)],'operationType':snakeToCamel(_0x5d6ff3[_0x5a5cbe(0xa2)]),'functionNode':'before'}),_0x5d6ff3[_0x5a5cbe(0x9a)]&&_0x1a894a[_0x5a5cbe(0x96)](_0x5d6ff3[_0x5a5cbe(0x9a)],{'datasetCode':_0x5d6ff3[_0x5a5cbe(0xa6)],'operationType':snakeToCamel(_0x5d6ff3[_0x5a5cbe(0xa2)]),'functionNode':'after'});}return _0x1a894a;}export function resolveRemoteScriptTarget(_0xeedb79,_0x45bbc6,_0x4a256f,_0x608d2c,_0x1b9c1a){const _0x5b1e72=a221_0x54ce39,_0x5d4205=normalizeBffType(_0x45bbc6[_0x5b1e72(0x93)]);if(!_0x5d4205||!_0x45bbc6[_0x5b1e72(0x92)])return null;if(_0x5d4205===_0x5b1e72(0x81)){const _0x10143c=(_0x45bbc6['id']?_0x4a256f[_0x5b1e72(0x86)](_0x45bbc6['id']):undefined)??findHookLocationByRemoteId(_0x608d2c,_0x45bbc6['id']);if(!_0x10143c)return null;const _0x1e8dad=_0x10143c['alias']||_0x1b9c1a['get'](_0x10143c[_0x5b1e72(0xa6)]),_0x17e7c2=_0x1e8dad??_0x10143c[_0x5b1e72(0xa6)],_0x20b72f={..._0x10143c,'alias':_0x1e8dad},_0x5a2230=_0x5b1e72(0x8e)+_0x17e7c2+'/'+_0x20b72f[_0x5b1e72(0xa2)]+'/'+_0x20b72f[_0x5b1e72(0x82)]+'/'+_0x45bbc6[_0x5b1e72(0x92)];if(!_0x5a2230[_0x5b1e72(0x9f)]('/')['every'](isSafeLockKeySegment))return null;return{'lockKey':_0x5a2230,'filePath':resolveLocalFilePathFromLockKey(_0xeedb79,_0x5a2230),'type':'HOOK','hookLocation':_0x20b72f};}const _0xe65bc4=_0x5d4205+'/'+_0x45bbc6['functionName'];if(!_0xe65bc4[_0x5b1e72(0x9f)]('/')[_0x5b1e72(0x7e)](isSafeLockKeySegment))return null;return{'lockKey':_0xe65bc4,'filePath':resolveLocalFilePathFromLockKey(_0xeedb79,_0xe65bc4),'type':_0x5d4205};}export async function ensureParentDirectory(_0xb417b7){await mkdir(dirname(_0xb417b7),{'recursive':!![]});}export async function fileExists(_0x2ce2b0){const _0x16ad4b=a221_0x54ce39;try{return await access(_0x2ce2b0,constants[_0x16ad4b(0x8c)]),!![];}catch{return![];}}export async function directoryExists(_0x576e9f){const _0x11386d=a221_0x54ce39;try{const _0x5cefd4=await stat(_0x576e9f);return _0x5cefd4[_0x11386d(0x9d)]();}catch{return![];}}
@@ -1 +1 @@
1
- function a229_0x3ee4(_0x1a077f,_0x327ac6){_0x1a077f=_0x1a077f-0x15a;const _0x483969=a229_0x4839();let _0x3ee48b=_0x483969[_0x1a077f];return _0x3ee48b;}(function(_0x4dae3f,_0x2ad933){const _0x509069=a229_0x3ee4,_0x218e88=_0x4dae3f();while(!![]){try{const _0x54ced0=parseInt(_0x509069(0x162))/0x1*(-parseInt(_0x509069(0x161))/0x2)+parseInt(_0x509069(0x15b))/0x3*(parseInt(_0x509069(0x169))/0x4)+-parseInt(_0x509069(0x15e))/0x5+-parseInt(_0x509069(0x167))/0x6*(-parseInt(_0x509069(0x168))/0x7)+-parseInt(_0x509069(0x164))/0x8+-parseInt(_0x509069(0x15a))/0x9*(-parseInt(_0x509069(0x15f))/0xa)+-parseInt(_0x509069(0x160))/0xb*(-parseInt(_0x509069(0x165))/0xc);if(_0x54ced0===_0x2ad933)break;else _0x218e88['push'](_0x218e88['shift']());}catch(_0xf1de91){_0x218e88['push'](_0x218e88['shift']());}}}(a229_0x4839,0x5bfa8));import{readFile}from'node:fs/promises';import a229_0x422375 from'node:crypto';function a229_0x4839(){const _0x315307=['30010NffUvs','11Ijwzqr','22TwMbMI','62038CjKCfy','utf8','5829552LNuqTz','16308924IWCWJD','digest','6LpjHLP','5165097CEgNeH','294740ADuwXP','hex','909WXFNQs','3NmpWwb','createHash','md5','3429390OGHeuZ'];a229_0x4839=function(){return _0x315307;};return a229_0x4839();}export function computeContentHash(_0x26f717){const _0x36f550=a229_0x3ee4;return a229_0x422375[_0x36f550(0x15c)](_0x36f550(0x15d))['update'](_0x26f717)[_0x36f550(0x166)](_0x36f550(0x16a));}export async function computeFileHash(_0xa31e0e){const _0x212c7b=a229_0x3ee4,_0x36bd1a=await readFile(_0xa31e0e,_0x212c7b(0x163));return computeContentHash(_0x36bd1a);}
1
+ (function(_0x255bee,_0x265ee1){const _0x378ff4=a222_0x4120,_0xd9a71a=_0x255bee();while(!![]){try{const _0x2a63f2=parseInt(_0x378ff4(0x19a))/0x1+-parseInt(_0x378ff4(0x194))/0x2*(-parseInt(_0x378ff4(0x193))/0x3)+-parseInt(_0x378ff4(0x195))/0x4*(parseInt(_0x378ff4(0x19e))/0x5)+-parseInt(_0x378ff4(0x197))/0x6+parseInt(_0x378ff4(0x191))/0x7+-parseInt(_0x378ff4(0x198))/0x8+-parseInt(_0x378ff4(0x199))/0x9*(-parseInt(_0x378ff4(0x19c))/0xa);if(_0x2a63f2===_0x265ee1)break;else _0xd9a71a['push'](_0xd9a71a['shift']());}catch(_0x4d9234){_0xd9a71a['push'](_0xd9a71a['shift']());}}}(a222_0x2aec,0x5cdb1));function a222_0x2aec(){const _0x40a76a=['148686EROSZf','316372CXzXzE','update','4414236QupPyh','585264pORysw','9ZRbxUV','372561mklmzU','hex','9747730eOwHiO','createHash','35esQbmO','digest','166621EHJwfa','utf8','15ePFsGf'];a222_0x2aec=function(){return _0x40a76a;};return a222_0x2aec();}function a222_0x4120(_0xf7a53b,_0x216381){_0xf7a53b=_0xf7a53b-0x190;const _0x2aec81=a222_0x2aec();let _0x41203c=_0x2aec81[_0xf7a53b];return _0x41203c;}import{readFile}from'node:fs/promises';import a222_0x1d7261 from'node:crypto';export function computeContentHash(_0xd162aa){const _0x2fdac7=a222_0x4120;return a222_0x1d7261[_0x2fdac7(0x19d)]('md5')[_0x2fdac7(0x196)](_0xd162aa)[_0x2fdac7(0x190)](_0x2fdac7(0x19b));}export async function computeFileHash(_0x180524){const _0x4dc0f1=a222_0x4120,_0x202abc=await readFile(_0x180524,_0x4dc0f1(0x192));return computeContentHash(_0x202abc);}
@@ -1 +1 @@
1
- function a230_0xee29(){const _0x54d6cc=['7dNBhoT','lastSync','ENOENT','8zFdLat','object','806931SKIWxY','stringify','135939IsOSfT','60XRSzck','5ytbMXU','\x22.\x20','utf8','functions','\x22\x20vs\x20lock\x20\x22','parse','6333400Dinuky','99591GJxMzC','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','22776897LbSFsu','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','apps',':\x20scriptsRoot\x20mismatch\x20—\x20','scriptsRoot','current\x20\x22','code','1448754AwmCMW','1189240jOnumU'];a230_0xee29=function(){return _0x54d6cc;};return a230_0xee29();}(function(_0x4e68eb,_0x49dc51){const _0x4d53f7=a230_0x2a5e,_0x2bdd6c=_0x4e68eb();while(!![]){try{const _0x378650=-parseInt(_0x4d53f7(0x175))/0x1+parseInt(_0x4d53f7(0x171))/0x2*(-parseInt(_0x4d53f7(0x163))/0x3)+-parseInt(_0x4d53f7(0x16d))/0x4+-parseInt(_0x4d53f7(0x15c))/0x5*(-parseInt(_0x4d53f7(0x16c))/0x6)+-parseInt(_0x4d53f7(0x16e))/0x7*(parseInt(_0x4d53f7(0x162))/0x8)+parseInt(_0x4d53f7(0x173))/0x9*(-parseInt(_0x4d53f7(0x15b))/0xa)+parseInt(_0x4d53f7(0x165))/0xb;if(_0x378650===_0x49dc51)break;else _0x2bdd6c['push'](_0x2bdd6c['shift']());}catch(_0x4bcfbc){_0x2bdd6c['push'](_0x2bdd6c['shift']());}}}(a230_0xee29,0x65aa4));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}function a230_0x2a5e(_0x1884e0,_0x589bbe){_0x1884e0=_0x1884e0-0x15b;const _0xee29bd=a230_0xee29();let _0x2a5e59=_0xee29bd[_0x1884e0];return _0x2a5e59;}export function ensureLockScope(_0x424dce,_0x58bc21,_0x574859,_0x1e561f){const _0x507bfa=a230_0x2a5e,_0x3deae3={'apps':_0x424dce['apps']&&typeof _0x424dce[_0x507bfa(0x167)]===_0x507bfa(0x172)?_0x424dce[_0x507bfa(0x167)]:{}};let _0x1b47d4=_0x3deae3['apps'][_0x58bc21];if(!_0x1b47d4)return _0x1b47d4={'scriptsRoot':_0x574859,'lastSync':'','functions':{}},_0x3deae3[_0x507bfa(0x167)][_0x58bc21]=_0x1b47d4,{'lockData':_0x3deae3,'appLock':_0x1b47d4};if(!_0x1b47d4[_0x507bfa(0x169)])_0x1b47d4[_0x507bfa(0x169)]=_0x574859;else{if(_0x1b47d4[_0x507bfa(0x169)]!==_0x574859)throw new Error(_0x1e561f+_0x507bfa(0x168)+(_0x507bfa(0x16a)+_0x574859+_0x507bfa(0x160)+_0x1b47d4[_0x507bfa(0x169)]+_0x507bfa(0x15d))+_0x507bfa(0x166));}return!_0x1b47d4[_0x507bfa(0x15f)]&&(_0x1b47d4[_0x507bfa(0x15f)]={}),!_0x1b47d4[_0x507bfa(0x16f)]&&(_0x1b47d4[_0x507bfa(0x16f)]=''),{'lockData':_0x3deae3,'appLock':_0x1b47d4};}export async function readBffLockFile(_0xbe66a0){const _0x1ab6af=a230_0x2a5e;try{const _0x15946b=await readFile(_0xbe66a0,_0x1ab6af(0x15e)),_0x1ed9e2=JSON[_0x1ab6af(0x161)](_0x15946b);return{'apps':_0x1ed9e2['apps']&&typeof _0x1ed9e2[_0x1ab6af(0x167)]===_0x1ab6af(0x172)?_0x1ed9e2[_0x1ab6af(0x167)]:{}};}catch(_0x323e08){if(_0x323e08[_0x1ab6af(0x16b)]===_0x1ab6af(0x170))return null;throw new Error(_0x1ab6af(0x164)+String(_0x323e08));}}export async function writeBffLockFile(_0x22ac67,_0x2ba5b7){const _0x525bb5=a230_0x2a5e;await mkdir(dirname(_0x22ac67),{'recursive':!![]}),await writeFile(_0x22ac67,JSON[_0x525bb5(0x174)](_0x2ba5b7,null,0x2),_0x525bb5(0x15e));}
1
+ (function(_0x41f33b,_0x413dc9){const _0x56a65d=a223_0x5bb4,_0x2d6710=_0x41f33b();while(!![]){try{const _0x591c40=parseInt(_0x56a65d(0x10d))/0x1+parseInt(_0x56a65d(0x114))/0x2+-parseInt(_0x56a65d(0x107))/0x3+-parseInt(_0x56a65d(0x10c))/0x4*(parseInt(_0x56a65d(0x116))/0x5)+-parseInt(_0x56a65d(0x10f))/0x6+parseInt(_0x56a65d(0x109))/0x7*(-parseInt(_0x56a65d(0x108))/0x8)+parseInt(_0x56a65d(0x104))/0x9;if(_0x591c40===_0x413dc9)break;else _0x2d6710['push'](_0x2d6710['shift']());}catch(_0x43a574){_0x2d6710['push'](_0x2d6710['shift']());}}}(a223_0x5e8b,0x3e11a));function a223_0x5bb4(_0x1115bd,_0x528df7){_0x1115bd=_0x1115bd-0x101;const _0x5e8b2f=a223_0x5e8b();let _0x5bb4fd=_0x5e8b2f[_0x1115bd];return _0x5bb4fd;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}function a223_0x5e8b(){const _0x11ff46=['2091736WahiNI','7uTJMsu','object','\x22.\x20','596uNdBul','362013MiuXqi','\x22\x20vs\x20lock\x20\x22','219876skgAkZ','utf8','scriptsRoot','code',':\x20scriptsRoot\x20mismatch\x20—\x20','56370khNtYg','lastSync','15945mtVhlm','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','apps','ENOENT','stringify','9153747OOGDsj','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','parse','1139319WFAOiM'];a223_0x5e8b=function(){return _0x11ff46;};return a223_0x5e8b();}export function ensureLockScope(_0x1f9498,_0x58ee13,_0x83e1c8,_0x322228){const _0x43007a=a223_0x5bb4,_0x75d4b0={'apps':_0x1f9498['apps']&&typeof _0x1f9498[_0x43007a(0x101)]===_0x43007a(0x10a)?_0x1f9498[_0x43007a(0x101)]:{}};let _0x1c1417=_0x75d4b0[_0x43007a(0x101)][_0x58ee13];if(!_0x1c1417)return _0x1c1417={'scriptsRoot':_0x83e1c8,'lastSync':'','functions':{}},_0x75d4b0[_0x43007a(0x101)][_0x58ee13]=_0x1c1417,{'lockData':_0x75d4b0,'appLock':_0x1c1417};if(!_0x1c1417[_0x43007a(0x111)])_0x1c1417[_0x43007a(0x111)]=_0x83e1c8;else{if(_0x1c1417[_0x43007a(0x111)]!==_0x83e1c8)throw new Error(_0x322228+_0x43007a(0x113)+('current\x20\x22'+_0x83e1c8+_0x43007a(0x10e)+_0x1c1417[_0x43007a(0x111)]+_0x43007a(0x10b))+_0x43007a(0x117));}return!_0x1c1417['functions']&&(_0x1c1417['functions']={}),!_0x1c1417[_0x43007a(0x115)]&&(_0x1c1417[_0x43007a(0x115)]=''),{'lockData':_0x75d4b0,'appLock':_0x1c1417};}export async function readBffLockFile(_0x28defd){const _0xf4df96=a223_0x5bb4;try{const _0x42b8e3=await readFile(_0x28defd,_0xf4df96(0x110)),_0x53852b=JSON[_0xf4df96(0x106)](_0x42b8e3);return{'apps':_0x53852b[_0xf4df96(0x101)]&&typeof _0x53852b[_0xf4df96(0x101)]===_0xf4df96(0x10a)?_0x53852b[_0xf4df96(0x101)]:{}};}catch(_0x2863d0){if(_0x2863d0[_0xf4df96(0x112)]===_0xf4df96(0x102))return null;throw new Error(_0xf4df96(0x105)+String(_0x2863d0));}}export async function writeBffLockFile(_0x3cb954,_0x27bffa){const _0x591301=a223_0x5bb4;await mkdir(dirname(_0x3cb954),{'recursive':!![]}),await writeFile(_0x3cb954,JSON[_0x591301(0x103)](_0x27bffa,null,0x2),'utf8');}
@@ -1 +1 @@
1
- function a232_0x3436(){const _0x361b16=['1461KeWAzO','2599443PhccZY','remoteId','functionNode','match','operationType','896950odmFAU','test','before','replace','3928yschFi','913766CSieWD','toLowerCase','60eUlQEj','datasetCode','168haMWDy','after','1335505DtwoQL','84yEORVr','27013JiHLTS','322605hkSEWD'];a232_0x3436=function(){return _0x361b16;};return a232_0x3436();}(function(_0x49cb6b,_0x589ad6){const _0x5bd34c=a232_0x5576,_0x51d6c8=_0x49cb6b();while(!![]){try{const _0x1b2036=parseInt(_0x5bd34c(0x10e))/0x1+-parseInt(_0x5bd34c(0x113))/0x2+-parseInt(_0x5bd34c(0x11d))/0x3*(-parseInt(_0x5bd34c(0x112))/0x4)+parseInt(_0x5bd34c(0x119))/0x5+parseInt(_0x5bd34c(0x11a))/0x6*(-parseInt(_0x5bd34c(0x11b))/0x7)+-parseInt(_0x5bd34c(0x117))/0x8*(-parseInt(_0x5bd34c(0x11c))/0x9)+parseInt(_0x5bd34c(0x115))/0xa*(-parseInt(_0x5bd34c(0x109))/0xb);if(_0x1b2036===_0x589ad6)break;else _0x51d6c8['push'](_0x51d6c8['shift']());}catch(_0x29c083){_0x51d6c8['push'](_0x51d6c8['shift']());}}}(a232_0x3436,0x71d43));export function snakeToCamel(_0x142f7c){const _0x53cc2d=a232_0x5576;return _0x142f7c[_0x53cc2d(0x114)]()[_0x53cc2d(0x111)](/_([a-z])/g,(_0x544da4,_0x336bb0)=>_0x336bb0['toUpperCase']());}export function findHookLocationByRemoteId(_0xfee4cd,_0x215109){const _0x1df46c=a232_0x5576;if(!_0x215109)return undefined;for(const _0x17bbee of Object['values'](_0xfee4cd)){if(_0x17bbee[_0x1df46c(0x10a)]===_0x215109&&_0x17bbee[_0x1df46c(0x116)]&&_0x17bbee[_0x1df46c(0x10d)]&&_0x17bbee[_0x1df46c(0x10b)])return{'datasetCode':_0x17bbee[_0x1df46c(0x116)],'operationType':_0x17bbee[_0x1df46c(0x10d)],'functionNode':_0x17bbee['functionNode']};}return undefined;}function a232_0x5576(_0x1ed5b2,_0x3bbe16){_0x1ed5b2=_0x1ed5b2-0x109;const _0x343623=a232_0x3436();let _0x5576d4=_0x343623[_0x1ed5b2];return _0x5576d4;}export function extractScriptDescription(_0x573753){const _0x39625d=a232_0x5576,_0x5e7812=_0x573753[_0x39625d(0x10c)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x5e7812?.[0x1]?.['trim']()||undefined;}export function isValidBffFunctionName(_0x417383){const _0x36cde6=a232_0x5576;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x36cde6(0x10f)](_0x417383);}export function normalizeHookFunctionNode(_0x2d8571){const _0x1c0e14=a232_0x5576;if(!_0x2d8571)return undefined;const _0x554177=_0x2d8571['trim']()[_0x1c0e14(0x114)]();if(_0x554177===_0x1c0e14(0x110)||_0x554177===_0x1c0e14(0x118))return _0x554177;return undefined;}
1
+ (function(_0x3795fc,_0x638aa6){const _0x6dd798=a225_0x1ac7,_0x1fe9b1=_0x3795fc();while(!![]){try{const _0x3ac2fb=-parseInt(_0x6dd798(0x79))/0x1*(parseInt(_0x6dd798(0x7b))/0x2)+-parseInt(_0x6dd798(0x76))/0x3*(-parseInt(_0x6dd798(0x7f))/0x4)+parseInt(_0x6dd798(0x7d))/0x5+-parseInt(_0x6dd798(0x80))/0x6*(parseInt(_0x6dd798(0x73))/0x7)+parseInt(_0x6dd798(0x81))/0x8+parseInt(_0x6dd798(0x7e))/0x9*(-parseInt(_0x6dd798(0x7c))/0xa)+parseInt(_0x6dd798(0x7a))/0xb;if(_0x3ac2fb===_0x638aa6)break;else _0x1fe9b1['push'](_0x1fe9b1['shift']());}catch(_0x104a03){_0x1fe9b1['push'](_0x1fe9b1['shift']());}}}(a225_0x2521,0x3f616));function a225_0x2521(){const _0x29b33a=['1757CgboUR','4206444fLMcsw','410yJCUnJ','30FowyLP','67320jrUHzS','1378962MJEqmr','12YEksbT','12PrwZEr','2995424EZPWQs','functionNode','test','toUpperCase','after','operationType','remoteId','693644pVdqhc','datasetCode','before','507333dPEozN','values','replace'];a225_0x2521=function(){return _0x29b33a;};return a225_0x2521();}function a225_0x1ac7(_0x4ee6c5,_0xb96928){_0x4ee6c5=_0x4ee6c5-0x6d;const _0x25219b=a225_0x2521();let _0x1ac7c0=_0x25219b[_0x4ee6c5];return _0x1ac7c0;}export function snakeToCamel(_0x5868cc){const _0x4619b3=a225_0x1ac7;return _0x5868cc['toLowerCase']()[_0x4619b3(0x78)](/_([a-z])/g,(_0x4d1bd7,_0x184323)=>_0x184323[_0x4619b3(0x6f)]());}export function findHookLocationByRemoteId(_0x5be878,_0x12901e){const _0x1d5aeb=a225_0x1ac7;if(!_0x12901e)return undefined;for(const _0x2b7b8c of Object[_0x1d5aeb(0x77)](_0x5be878)){if(_0x2b7b8c[_0x1d5aeb(0x72)]===_0x12901e&&_0x2b7b8c['datasetCode']&&_0x2b7b8c['operationType']&&_0x2b7b8c['functionNode'])return{'datasetCode':_0x2b7b8c[_0x1d5aeb(0x74)],'operationType':_0x2b7b8c[_0x1d5aeb(0x71)],'functionNode':_0x2b7b8c[_0x1d5aeb(0x6d)]};}return undefined;}export function extractScriptDescription(_0x1e638b){const _0x2793aa=_0x1e638b['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x2793aa?.[0x1]?.['trim']()||undefined;}export function isValidBffFunctionName(_0x2698a2){const _0x55e766=a225_0x1ac7;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x55e766(0x6e)](_0x2698a2);}export function normalizeHookFunctionNode(_0x35414e){const _0x1f5f18=a225_0x1ac7;if(!_0x35414e)return undefined;const _0x4bfb9d=_0x35414e['trim']()['toLowerCase']();if(_0x4bfb9d===_0x1f5f18(0x75)||_0x4bfb9d===_0x1f5f18(0x70))return _0x4bfb9d;return undefined;}
@@ -1 +1 @@
1
- (function(_0x168fc8,_0x468d74){const _0x4a27a5=a233_0xe59f,_0xbc3801=_0x168fc8();while(!![]){try{const _0x321766=parseInt(_0x4a27a5(0x77))/0x1+parseInt(_0x4a27a5(0x85))/0x2*(-parseInt(_0x4a27a5(0x93))/0x3)+-parseInt(_0x4a27a5(0x91))/0x4*(parseInt(_0x4a27a5(0x75))/0x5)+-parseInt(_0x4a27a5(0x82))/0x6*(parseInt(_0x4a27a5(0x87))/0x7)+parseInt(_0x4a27a5(0x80))/0x8*(-parseInt(_0x4a27a5(0x7f))/0x9)+parseInt(_0x4a27a5(0x76))/0xa*(parseInt(_0x4a27a5(0x94))/0xb)+-parseInt(_0x4a27a5(0x7c))/0xc*(-parseInt(_0x4a27a5(0x95))/0xd);if(_0x321766===_0x468d74)break;else _0xbc3801['push'](_0xbc3801['shift']());}catch(_0x481753){_0xbc3801['push'](_0xbc3801['shift']());}}}(a233_0x3beb,0x7c8c5));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x36460a){const _0x4f843b=a233_0xe59f;if(cache[_0x4f843b(0x86)](_0x36460a))return cache[_0x4f843b(0x8b)](_0x36460a);const _0x1c2e5d=await listDatasets(_0x36460a),_0x5bd2ae=new Map();for(const _0x466ddc of _0x1c2e5d){const _0x9fc71=_0x466ddc['dbtableConfig'];_0x9fc71?.['dbId']!=null&&_0x5bd2ae[_0x4f843b(0x78)](_0x9fc71[_0x4f843b(0x83)],_0x9fc71['dbName']??_0x4f843b(0x90)+_0x9fc71[_0x4f843b(0x83)]);}const _0x4f2914=[..._0x5bd2ae[_0x4f843b(0x79)]()]['map'](([_0x1d584a,_0x176e8e])=>({'dbId':_0x1d584a,'dbName':_0x176e8e}));return cache[_0x4f843b(0x78)](_0x36460a,_0x4f2914),_0x4f2914;}function a233_0x3beb(){const _0x2ff598=['db-','4irjvPB','isNaN','3JzgUVc','11PYBJyl','220883UFqrkS','4801605jREtXd','1747870szlOOs','150234GknpNQ','set','entries','dbName','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','2184nwZOFI','toLowerCase','find','9bBEWCT','4859776LKiIgP','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','799638GTIizz','dbId','includes','1612698yRDXQu','has','28piDisD','map','.\x20Be\x20more\x20specific.','length','get','join','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','\x22\x20matches\x20multiple\x20databases:\x20','\x22.\x20Available:\x20'];a233_0x3beb=function(){return _0x2ff598;};return a233_0x3beb();}export async function resolveDb(_0x4dcd1a,_0x4fa545){const _0x4479de=a233_0xe59f,_0x2f0f90=await listDatabases(_0x4dcd1a);if(_0x2f0f90[_0x4479de(0x8a)]===0x0)return{'resolved':[],'error':_0x4479de(0x7b)+_0x4dcd1a+_0x4479de(0x8d)};if(!_0x4fa545)return{'resolved':_0x2f0f90};const _0x474186=Number(_0x4fa545);if(!Number[_0x4479de(0x92)](_0x474186)){const _0x2a608f=_0x2f0f90[_0x4479de(0x7e)](_0x14d2b4=>_0x14d2b4[_0x4479de(0x83)]===_0x474186);if(_0x2a608f)return{'resolved':[_0x2a608f]};}const _0x471ef1=_0x4fa545[_0x4479de(0x7d)](),_0x19888f=_0x2f0f90['filter'](_0x3c8a37=>_0x3c8a37[_0x4479de(0x7a)][_0x4479de(0x7d)]()[_0x4479de(0x84)](_0x471ef1));if(_0x19888f[_0x4479de(0x8a)]>0x0)return{'resolved':_0x19888f};const _0x46cdd8=_0x2f0f90[_0x4479de(0x88)](_0x232a74=>_0x232a74[_0x4479de(0x7a)]+'\x20('+_0x232a74[_0x4479de(0x83)]+')')[_0x4479de(0x8c)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x4fa545+'\x22\x20under\x20app\x20\x22'+_0x4dcd1a+_0x4479de(0x8f)+_0x46cdd8+_0x4479de(0x81)};}function a233_0xe59f(_0x149e89,_0xcad2a4){_0x149e89=_0x149e89-0x75;const _0x3bebe2=a233_0x3beb();let _0xe59f11=_0x3bebe2[_0x149e89];return _0xe59f11;}export async function resolveOneDb(_0xa45283,_0x5a30a9){const _0x3a5663=a233_0xe59f,{resolved:_0x57ba0d,error:_0x32440a}=await resolveDb(_0xa45283,_0x5a30a9);if(_0x32440a)return{'db':null,'error':_0x32440a};if(_0x57ba0d[_0x3a5663(0x8a)]===0x1)return{'db':_0x57ba0d[0x0]};if(!_0x5a30a9){const _0x2eb1db=_0x57ba0d['map'](_0x223681=>_0x223681[_0x3a5663(0x7a)]+'\x20('+_0x223681[_0x3a5663(0x83)]+')')[_0x3a5663(0x8c)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x2eb1db};}const _0x1b8a99=_0x57ba0d['map'](_0x2548d7=>_0x2548d7[_0x3a5663(0x7a)]+'\x20('+_0x2548d7['dbId']+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x5a30a9+_0x3a5663(0x8e)+_0x1b8a99+_0x3a5663(0x89)};}export async function getDbName(_0xa91b78,_0x21fe4b){const _0x4c9faf=a233_0xe59f,_0x5eafa7=await listDatabases(_0xa91b78);return _0x5eafa7[_0x4c9faf(0x7e)](_0x232917=>_0x232917['dbId']===_0x21fe4b)?.[_0x4c9faf(0x7a)];}
1
+ (function(_0x123cbb,_0x4e714c){const _0x6c5eee=a226_0x1da0,_0x127fcb=_0x123cbb();while(!![]){try{const _0x4dedc7=-parseInt(_0x6c5eee(0xf1))/0x1+parseInt(_0x6c5eee(0xf8))/0x2*(-parseInt(_0x6c5eee(0x109))/0x3)+parseInt(_0x6c5eee(0x102))/0x4+parseInt(_0x6c5eee(0xfd))/0x5+parseInt(_0x6c5eee(0x101))/0x6+-parseInt(_0x6c5eee(0xf9))/0x7*(parseInt(_0x6c5eee(0x105))/0x8)+-parseInt(_0x6c5eee(0xf5))/0x9*(parseInt(_0x6c5eee(0x104))/0xa);if(_0x4dedc7===_0x4e714c)break;else _0x127fcb['push'](_0x127fcb['shift']());}catch(_0x2e9ae6){_0x127fcb['push'](_0x127fcb['shift']());}}}(a226_0x3f4f,0x7fcaf));import{listDatasets}from'../core/api-client.js';function a226_0x1da0(_0x5aa738,_0x410ed9){_0x5aa738=_0x5aa738-0xef;const _0x3f4fb7=a226_0x3f4f();let _0x1da025=_0x3f4fb7[_0x5aa738];return _0x1da025;}const cache=new Map();export async function listDatabases(_0x354c7a){const _0x397cd8=a226_0x1da0;if(cache[_0x397cd8(0x103)](_0x354c7a))return cache[_0x397cd8(0xf2)](_0x354c7a);const _0x419308=await listDatasets(_0x354c7a),_0x18fa7f=new Map();for(const _0x214d4d of _0x419308){const _0x122caa=_0x214d4d[_0x397cd8(0xfa)];_0x122caa?.['dbId']!=null&&_0x18fa7f[_0x397cd8(0xf6)](_0x122caa['dbId'],_0x122caa[_0x397cd8(0x10b)]??_0x397cd8(0xf4)+_0x122caa[_0x397cd8(0x108)]);}const _0x53bc34=[..._0x18fa7f['entries']()]['map'](([_0x14e7a1,_0x486cd4])=>({'dbId':_0x14e7a1,'dbName':_0x486cd4}));return cache['set'](_0x354c7a,_0x53bc34),_0x53bc34;}function a226_0x3f4f(){const _0x4b2a11=['262381lOwpYT','dbtableConfig','filter','includes','4618235gueGgZ','map','length','toLowerCase','264018zMosFH','2700156Itkmzi','has','70snvwyj','80pyXtoc','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','find','dbId','888vaMweW','isNaN','dbName','\x22\x20matches\x20multiple\x20databases:\x20','No\x20database\x20matching\x20\x22','121027OSgETS','get','\x22.\x20Available:\x20','db-','125991xmigRM','set','join','3550SUamXY'];a226_0x3f4f=function(){return _0x4b2a11;};return a226_0x3f4f();}export async function resolveDb(_0x2c70eb,_0x197958){const _0x337803=a226_0x1da0,_0x6e7c8a=await listDatabases(_0x2c70eb);if(_0x6e7c8a[_0x337803(0xff)]===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20under\x20app\x20\x22'+_0x2c70eb+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x197958)return{'resolved':_0x6e7c8a};const _0x590ee1=Number(_0x197958);if(!Number[_0x337803(0x10a)](_0x590ee1)){const _0x319091=_0x6e7c8a[_0x337803(0x107)](_0x2fc60e=>_0x2fc60e['dbId']===_0x590ee1);if(_0x319091)return{'resolved':[_0x319091]};}const _0x1d2e30=_0x197958[_0x337803(0x100)](),_0x1423c2=_0x6e7c8a[_0x337803(0xfb)](_0xbda7f8=>_0xbda7f8[_0x337803(0x10b)][_0x337803(0x100)]()[_0x337803(0xfc)](_0x1d2e30));if(_0x1423c2['length']>0x0)return{'resolved':_0x1423c2};const _0x32b78b=_0x6e7c8a[_0x337803(0xfe)](_0x5f1415=>_0x5f1415['dbName']+'\x20('+_0x5f1415[_0x337803(0x108)]+')')[_0x337803(0xf7)](',\x20');return{'resolved':[],'error':_0x337803(0xf0)+_0x197958+'\x22\x20under\x20app\x20\x22'+_0x2c70eb+_0x337803(0xf3)+_0x32b78b+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x4b8692,_0xc1ec7c){const _0x2b783c=a226_0x1da0,{resolved:_0x537d7e,error:_0x6d0137}=await resolveDb(_0x4b8692,_0xc1ec7c);if(_0x6d0137)return{'db':null,'error':_0x6d0137};if(_0x537d7e['length']===0x1)return{'db':_0x537d7e[0x0]};if(!_0xc1ec7c){const _0x54a49c=_0x537d7e[_0x2b783c(0xfe)](_0x53dd45=>_0x53dd45[_0x2b783c(0x10b)]+'\x20('+_0x53dd45['dbId']+')')[_0x2b783c(0xf7)](',\x20');return{'db':null,'error':_0x2b783c(0x106)+_0x54a49c};}const _0x528f0d=_0x537d7e[_0x2b783c(0xfe)](_0x246c6a=>_0x246c6a[_0x2b783c(0x10b)]+'\x20('+_0x246c6a['dbId']+')')[_0x2b783c(0xf7)](',\x20');return{'db':null,'error':'\x22'+_0xc1ec7c+_0x2b783c(0xef)+_0x528f0d+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0x5e34f4,_0x221d97){const _0x553aa1=a226_0x1da0,_0x157f49=await listDatabases(_0x5e34f4);return _0x157f49[_0x553aa1(0x107)](_0x3219e9=>_0x3219e9[_0x553aa1(0x108)]===_0x221d97)?.['dbName'];}
@@ -1 +1 @@
1
- const a234_0x9ce6c9=a234_0x3653;function a234_0x3653(_0x6126dd,_0x143d0a){_0x6126dd=_0x6126dd-0x1b4;const _0x573a30=a234_0x573a();let _0x36533a=_0x573a30[_0x6126dd];return _0x36533a;}(function(_0x36f6dd,_0x518cd5){const _0xc02ce2=a234_0x3653,_0x373186=_0x36f6dd();while(!![]){try{const _0x4f524b=parseInt(_0xc02ce2(0x1c3))/0x1*(parseInt(_0xc02ce2(0x1c1))/0x2)+-parseInt(_0xc02ce2(0x1be))/0x3+-parseInt(_0xc02ce2(0x1bb))/0x4*(-parseInt(_0xc02ce2(0x1b4))/0x5)+parseInt(_0xc02ce2(0x1c4))/0x6+-parseInt(_0xc02ce2(0x1c0))/0x7*(-parseInt(_0xc02ce2(0x1bc))/0x8)+-parseInt(_0xc02ce2(0x1b7))/0x9+parseInt(_0xc02ce2(0x1b6))/0xa*(-parseInt(_0xc02ce2(0x1b5))/0xb);if(_0x4f524b===_0x518cd5)break;else _0x373186['push'](_0x373186['shift']());}catch(_0x3f0d66){_0x373186['push'](_0x373186['shift']());}}}(a234_0x573a,0x2f4c1));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x13feb2,_0x1a2eeb=process[a234_0x9ce6c9(0x1bd)]()){const _0x2e21ad=a234_0x9ce6c9,_0x275ebf=resolve(_0x1a2eeb),_0x1774b9=join(_0x275ebf,_0x2e21ad(0x1ba),_0x2e21ad(0x1c2));return{'projectRoot':_0x275ebf,'pagesBaseDir':_0x1774b9,'appPagesDir':join(_0x1774b9,_0x13feb2),'lockFilePath':join(_0x275ebf,'.rabetbase','page.lock.json')};}export function buildPageFileName(_0x3ec4f8,_0x12e4a7){const _0x4c330d=a234_0x9ce6c9;return _0x3ec4f8+'-'+String(_0x12e4a7)[_0x4c330d(0x1bf)]()+'.json';}export function resolvePageFilePath(_0x19e308,_0x237cc1,_0x29d4f6){const _0x4b40ec=a234_0x9ce6c9;return join(_0x19e308[_0x4b40ec(0x1b9)],buildPageFileName(_0x237cc1,_0x29d4f6));}export async function ensureParentDirectory(_0x49fa5d){await mkdir(dirname(_0x49fa5d),{'recursive':!![]});}export async function fileExists(_0x4d6a6e){const _0x3466b3=a234_0x9ce6c9;try{return await access(_0x4d6a6e,constants[_0x3466b3(0x1b8)]),!![];}catch{return![];}}function a234_0x573a(){const _0x5cf4ab=['.rabetbase','960484ywxppb','46856fFakWo','cwd','351060enmhQX','toUpperCase','175fdzxSS','812wgYfcS','page','951uhcfTe','244854TOzHhx','5JcbvGc','22evfrgE','629130PQRXgW','3391974MUTDcr','F_OK','appPagesDir'];a234_0x573a=function(){return _0x5cf4ab;};return a234_0x573a();}
1
+ (function(_0x4a4241,_0x30a557){const _0x5ca12e=a227_0x548d,_0x2ae029=_0x4a4241();while(!![]){try{const _0x109f15=-parseInt(_0x5ca12e(0xbe))/0x1*(-parseInt(_0x5ca12e(0xb6))/0x2)+-parseInt(_0x5ca12e(0xc1))/0x3*(parseInt(_0x5ca12e(0xbf))/0x4)+parseInt(_0x5ca12e(0xb9))/0x5*(parseInt(_0x5ca12e(0xbc))/0x6)+-parseInt(_0x5ca12e(0xc2))/0x7+parseInt(_0x5ca12e(0xbd))/0x8+-parseInt(_0x5ca12e(0xb7))/0x9*(-parseInt(_0x5ca12e(0xb5))/0xa)+-parseInt(_0x5ca12e(0xbb))/0xb;if(_0x109f15===_0x30a557)break;else _0x2ae029['push'](_0x2ae029['shift']());}catch(_0x5292be){_0x2ae029['push'](_0x2ae029['shift']());}}}(a227_0x3375,0xb3199));import{constants}from'node:fs';function a227_0x548d(_0x41486f,_0x166166){_0x41486f=_0x41486f-0xb5;const _0x33759e=a227_0x3375();let _0x548d25=_0x33759e[_0x41486f];return _0x548d25;}function a227_0x3375(){const _0x5738bd=['3119528lVJvWV','1135ZPHfTb','17336emCkYY','F_OK','453CRQMED','769762qWRxgB','page.lock.json','2936020cYGjZv','370YhIWiL','36Yihncq','.rabetbase','35vPRPKN','.json','10950313aamQYx','616416tUaVgw'];a227_0x3375=function(){return _0x5738bd;};return a227_0x3375();}import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x4327bf,_0x1a7a5c=process['cwd']()){const _0x39b5f5=a227_0x548d,_0x1c0002=resolve(_0x1a7a5c),_0x4e0c90=join(_0x1c0002,_0x39b5f5(0xb8),'page');return{'projectRoot':_0x1c0002,'pagesBaseDir':_0x4e0c90,'appPagesDir':join(_0x4e0c90,_0x4327bf),'lockFilePath':join(_0x1c0002,_0x39b5f5(0xb8),_0x39b5f5(0xc3))};}export function buildPageFileName(_0x315672,_0x305348){const _0x2afc1a=a227_0x548d;return _0x315672+'-'+String(_0x305348)['toUpperCase']()+_0x2afc1a(0xba);}export function resolvePageFilePath(_0x1d8904,_0xe744dc,_0x48170d){return join(_0x1d8904['appPagesDir'],buildPageFileName(_0xe744dc,_0x48170d));}export async function ensureParentDirectory(_0x293108){await mkdir(dirname(_0x293108),{'recursive':!![]});}export async function fileExists(_0x117f3c){const _0x5dd5ff=a227_0x548d;try{return await access(_0x117f3c,constants[_0x5dd5ff(0xc0)]),!![];}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x3b2a7d,_0x20614a){const _0x21e97a=a235_0x8168,_0x5aea19=_0x3b2a7d();while(!![]){try{const _0x36c139=parseInt(_0x21e97a(0x11d))/0x1*(-parseInt(_0x21e97a(0x126))/0x2)+parseInt(_0x21e97a(0x11f))/0x3*(parseInt(_0x21e97a(0x11c))/0x4)+-parseInt(_0x21e97a(0x11b))/0x5+-parseInt(_0x21e97a(0x124))/0x6+parseInt(_0x21e97a(0x121))/0x7*(-parseInt(_0x21e97a(0x127))/0x8)+parseInt(_0x21e97a(0x11a))/0x9+parseInt(_0x21e97a(0x122))/0xa;if(_0x36c139===_0x20614a)break;else _0x5aea19['push'](_0x5aea19['shift']());}catch(_0x498a71){_0x5aea19['push'](_0x5aea19['shift']());}}}(a235_0x320b,0x821e5));function a235_0x8168(_0x127359,_0x933c13){_0x127359=_0x127359-0x119;const _0x320b92=a235_0x320b();let _0x816838=_0x320b92[_0x127359];return _0x816838;}function a235_0x320b(){const _0x41e58d=['158bZVcyT','64ddTKFy','createHash','6461892tAnctN','83555nBxQZF','3040jNdPfy','5079YiFdAv','hex','288ZflUxj','parse','792372egrxJQ','15433040ObwBQD','update','2866602uPldWM','utf8'];a235_0x320b=function(){return _0x41e58d;};return a235_0x320b();}import a235_0x57a801 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x121606){const _0x2f3a0f=a235_0x8168;return JSON['stringify'](JSON[_0x2f3a0f(0x120)](_0x121606),null,0x2)+'\x0a';}export function computePageContentHash(_0x4ae2e5){const _0xb5b2f8=a235_0x8168;return a235_0x57a801[_0xb5b2f8(0x119)]('md5')[_0xb5b2f8(0x123)](_0x4ae2e5)['digest'](_0xb5b2f8(0x11e));}export function computeSerializedSchemaHash(_0x35e4ef){return computePageContentHash(serializePageSchemaForFile(_0x35e4ef));}export async function computePageFileHash(_0x57a1ca){const _0x3b814c=a235_0x8168,_0x4ca28f=await readFile(_0x57a1ca,_0x3b814c(0x125));return computePageContentHash(_0x4ca28f);}
1
+ (function(_0x13263a,_0x165f69){const _0x2e7dc2=a228_0x144d,_0x4d5b36=_0x13263a();while(!![]){try{const _0x21fbb1=-parseInt(_0x2e7dc2(0x1c1))/0x1+parseInt(_0x2e7dc2(0x1c5))/0x2+parseInt(_0x2e7dc2(0x1c4))/0x3+-parseInt(_0x2e7dc2(0x1cd))/0x4*(-parseInt(_0x2e7dc2(0x1cf))/0x5)+parseInt(_0x2e7dc2(0x1c0))/0x6*(parseInt(_0x2e7dc2(0x1c2))/0x7)+parseInt(_0x2e7dc2(0x1cc))/0x8*(-parseInt(_0x2e7dc2(0x1c6))/0x9)+-parseInt(_0x2e7dc2(0x1c9))/0xa;if(_0x21fbb1===_0x165f69)break;else _0x4d5b36['push'](_0x4d5b36['shift']());}catch(_0x28faa9){_0x4d5b36['push'](_0x4d5b36['shift']());}}}(a228_0x14f6,0xddb2b));function a228_0x14f6(){const _0xabfcc6=['1248269aejFcU','492842iyVWzD','update','1326264EFhcuT','2174822iwAUPc','31887DcUBQM','hex','createHash','1887510TsnfWJ','digest','md5','3544yBxGlV','880156gvLCgY','utf8','35mbyljc','parse','72gAyxOr'];a228_0x14f6=function(){return _0xabfcc6;};return a228_0x14f6();}import a228_0x578f1d from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x4631bb){const _0x137f00=a228_0x144d;return JSON['stringify'](JSON[_0x137f00(0x1bf)](_0x4631bb),null,0x2)+'\x0a';}export function computePageContentHash(_0x2aa99a){const _0x57e2d4=a228_0x144d;return a228_0x578f1d[_0x57e2d4(0x1c8)](_0x57e2d4(0x1cb))[_0x57e2d4(0x1c3)](_0x2aa99a)[_0x57e2d4(0x1ca)](_0x57e2d4(0x1c7));}function a228_0x144d(_0x3df5df,_0x5d2948){_0x3df5df=_0x3df5df-0x1bf;const _0x14f693=a228_0x14f6();let _0x144d65=_0x14f693[_0x3df5df];return _0x144d65;}export function computeSerializedSchemaHash(_0x561d06){return computePageContentHash(serializePageSchemaForFile(_0x561d06));}export async function computePageFileHash(_0x385f6f){const _0x5879e7=a228_0x144d,_0x1172d5=await readFile(_0x385f6f,_0x5879e7(0x1ce));return computePageContentHash(_0x1172d5);}
@@ -1 +1 @@
1
- (function(_0x4eabce,_0x1f6f39){const _0x7f55e2=a236_0x2129,_0x42a62e=_0x4eabce();while(!![]){try{const _0x498daf=-parseInt(_0x7f55e2(0xf0))/0x1+parseInt(_0x7f55e2(0xf2))/0x2*(parseInt(_0x7f55e2(0xe8))/0x3)+parseInt(_0x7f55e2(0xe5))/0x4*(-parseInt(_0x7f55e2(0xf3))/0x5)+parseInt(_0x7f55e2(0xe7))/0x6*(parseInt(_0x7f55e2(0xec))/0x7)+-parseInt(_0x7f55e2(0xf5))/0x8*(-parseInt(_0x7f55e2(0xe6))/0x9)+parseInt(_0x7f55e2(0xe3))/0xa*(-parseInt(_0x7f55e2(0xe1))/0xb)+-parseInt(_0x7f55e2(0xf1))/0xc*(-parseInt(_0x7f55e2(0xe0))/0xd);if(_0x498daf===_0x1f6f39)break;else _0x42a62e['push'](_0x42a62e['shift']());}catch(_0x5c45b){_0x42a62e['push'](_0x42a62e['shift']());}}}(a236_0xbe36,0x5908d));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a236_0x2129(_0x4406cd,_0x41271d){_0x4406cd=_0x4406cd-0xe0;const _0xbe3681=a236_0xbe36();let _0x212972=_0xbe3681[_0x4406cd];return _0x212972;}export function ensurePageLockScope(_0x32b179,_0x55f074){const _0x12147d=a236_0x2129,_0x14d222={'apps':_0x32b179[_0x12147d(0xf4)]&&typeof _0x32b179[_0x12147d(0xf4)]===_0x12147d(0xef)?_0x32b179['apps']:{}};let _0x4f5247=_0x14d222[_0x12147d(0xf4)][_0x55f074];if(!_0x4f5247)return _0x4f5247={'lastSync':'','pages':{}},_0x14d222[_0x12147d(0xf4)][_0x55f074]=_0x4f5247,{'lockData':_0x14d222,'appLock':_0x4f5247};return!_0x4f5247[_0x12147d(0xeb)]&&(_0x4f5247[_0x12147d(0xeb)]=''),(!_0x4f5247[_0x12147d(0xed)]||typeof _0x4f5247[_0x12147d(0xed)]!==_0x12147d(0xef))&&(_0x4f5247[_0x12147d(0xed)]={}),{'lockData':_0x14d222,'appLock':_0x4f5247};}function a236_0xbe36(){const _0x2a85df=['562475GzsAfb','398832lwLWBX','2fbbPGg','25TXLLei','apps','16216OcdFdf','273racXMk','7777lCbVef','parse','2060qgPfYD','utf8','429016lpnqJQ','2160METjki','78QthTXW','359826ANauZa','code','ENOENT','lastSync','164066Tqhhsn','pages','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','object'];a236_0xbe36=function(){return _0x2a85df;};return a236_0xbe36();}export async function readPageLockFile(_0x2c84e0){const _0x181a9d=a236_0x2129;try{const _0x20fc7c=await readFile(_0x2c84e0,_0x181a9d(0xe4)),_0xeb34a7=JSON[_0x181a9d(0xe2)](_0x20fc7c);return{'apps':_0xeb34a7['apps']&&typeof _0xeb34a7[_0x181a9d(0xf4)]===_0x181a9d(0xef)?_0xeb34a7[_0x181a9d(0xf4)]:{}};}catch(_0x4f82cb){if(_0x4f82cb[_0x181a9d(0xe9)]===_0x181a9d(0xea))return null;throw new Error(_0x181a9d(0xee)+String(_0x4f82cb));}}export async function writePageLockFile(_0x2506a7,_0x36e128){const _0x21e323=a236_0x2129;await mkdir(dirname(_0x2506a7),{'recursive':!![]}),await writeFile(_0x2506a7,JSON['stringify'](_0x36e128,null,0x2),_0x21e323(0xe4));}
1
+ (function(_0xe6b47f,_0x1b472d){const _0x46e6c2=a229_0xc6c8,_0x3b90c7=_0xe6b47f();while(!![]){try{const _0x4297fc=parseInt(_0x46e6c2(0x174))/0x1*(-parseInt(_0x46e6c2(0x183))/0x2)+parseInt(_0x46e6c2(0x182))/0x3*(-parseInt(_0x46e6c2(0x176))/0x4)+-parseInt(_0x46e6c2(0x17b))/0x5*(parseInt(_0x46e6c2(0x179))/0x6)+parseInt(_0x46e6c2(0x17e))/0x7+parseInt(_0x46e6c2(0x17c))/0x8+parseInt(_0x46e6c2(0x178))/0x9+-parseInt(_0x46e6c2(0x173))/0xa*(parseInt(_0x46e6c2(0x180))/0xb);if(_0x4297fc===_0x1b472d)break;else _0x3b90c7['push'](_0x3b90c7['shift']());}catch(_0x448bf3){_0x3b90c7['push'](_0x3b90c7['shift']());}}}(a229_0x1448,0xab827));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x449cae,_0x40febd){const _0x293ac9=a229_0xc6c8,_0x46bd1e={'apps':_0x449cae[_0x293ac9(0x175)]&&typeof _0x449cae[_0x293ac9(0x175)]==='object'?_0x449cae[_0x293ac9(0x175)]:{}};let _0x5a5143=_0x46bd1e['apps'][_0x40febd];if(!_0x5a5143)return _0x5a5143={'lastSync':'','pages':{}},_0x46bd1e['apps'][_0x40febd]=_0x5a5143,{'lockData':_0x46bd1e,'appLock':_0x5a5143};return!_0x5a5143[_0x293ac9(0x17f)]&&(_0x5a5143[_0x293ac9(0x17f)]=''),(!_0x5a5143[_0x293ac9(0x184)]||typeof _0x5a5143[_0x293ac9(0x184)]!==_0x293ac9(0x177))&&(_0x5a5143['pages']={}),{'lockData':_0x46bd1e,'appLock':_0x5a5143};}export async function readPageLockFile(_0x577607){const _0x4358c5=a229_0xc6c8;try{const _0x4eaf9c=await readFile(_0x577607,_0x4358c5(0x17d)),_0x2e6305=JSON['parse'](_0x4eaf9c);return{'apps':_0x2e6305[_0x4358c5(0x175)]&&typeof _0x2e6305[_0x4358c5(0x175)]===_0x4358c5(0x177)?_0x2e6305[_0x4358c5(0x175)]:{}};}catch(_0x4cfc6e){if(_0x4cfc6e[_0x4358c5(0x17a)]===_0x4358c5(0x181))return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0x4cfc6e));}}export async function writePageLockFile(_0xfea22e,_0x14b1b9){const _0x13bf82=a229_0xc6c8;await mkdir(dirname(_0xfea22e),{'recursive':!![]}),await writeFile(_0xfea22e,JSON['stringify'](_0x14b1b9,null,0x2),_0x13bf82(0x17d));}function a229_0xc6c8(_0x5acc40,_0x4f1b30){_0x5acc40=_0x5acc40-0x173;const _0x144885=a229_0x1448();let _0xc6c876=_0x144885[_0x5acc40];return _0xc6c876;}function a229_0x1448(){const _0x18e69a=['5537720RLEkoK','utf8','6814892ImIeUd','lastSync','22GTlOEM','ENOENT','30UiKNCY','1085662imhMhA','pages','3501690kLWKnI','1YSrFiV','apps','8432ilAZMI','object','10608291MVuzcE','6Tolvpf','code','4388590APfAVy'];a229_0x1448=function(){return _0x18e69a;};return a229_0x1448();}
@@ -1 +1 @@
1
- (function(_0x3ea064,_0x4f8425){const _0x3ef49a=a238_0x2169,_0x469745=_0x3ea064();while(!![]){try{const _0xa8a03d=parseInt(_0x3ef49a(0xb3))/0x1+parseInt(_0x3ef49a(0xd4))/0x2+-parseInt(_0x3ef49a(0xaa))/0x3*(parseInt(_0x3ef49a(0xbf))/0x4)+-parseInt(_0x3ef49a(0xce))/0x5+parseInt(_0x3ef49a(0xd7))/0x6*(-parseInt(_0x3ef49a(0xd6))/0x7)+-parseInt(_0x3ef49a(0xbe))/0x8+parseInt(_0x3ef49a(0xc9))/0x9;if(_0xa8a03d===_0x4f8425)break;else _0x469745['push'](_0x469745['shift']());}catch(_0x3309e1){_0x469745['push'](_0x469745['shift']());}}}(a238_0x2a33,0x39e31));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x53d590,_0x24d1b3){const _0x4b0849=a238_0x2169,_0x27dd1f=[],_0x32327c=normalizeSqlForStaticAnalysis(_0x53d590),_0x4f8526=(_0x32327c[_0x4b0849(0xd8)]?[]:extractJoinFacts(_0x32327c[_0x4b0849(0xa8)]))[_0x4b0849(0x99)](_0x1e5cc6=>{const _0x2400ea=_0x4b0849;if(_0x1e5cc6['unsupportedPredicate']||_0x1e5cc6[_0x2400ea(0xca)]['length']===0x0)return _0x27dd1f[_0x2400ea(0xc5)]({'code':_0x2400ea(0xc2),'table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6['alias'],'columns':_0x1e5cc6[_0x2400ea(0xca)],'reason':_0x1e5cc6[_0x2400ea(0xb2)]??_0x2400ea(0x9a)}),{'table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6[_0x2400ea(0xca)],'status':'unavailable'};const _0x226b1d=resolveTableMetadata(_0x24d1b3,_0x1e5cc6[_0x2400ea(0xc1)]),_0x37e944=(_0x226b1d?.['indexes']??[])['map'](_0x24b91a=>({'index':_0x24b91a,'matchedPrefix':findEqualityPrefix(_0x24b91a[_0x2400ea(0xca)],_0x1e5cc6[_0x2400ea(0xca)])}))[_0x2400ea(0xab)](_0x34c433=>_0x34c433[_0x2400ea(0xc0)][_0x2400ea(0xd3)]>0x0),_0x530e0e=_0x37e944['reduce']((_0x35e4e0,_0x29ff64)=>!_0x35e4e0||_0x29ff64[_0x2400ea(0xc0)][_0x2400ea(0xd3)]>_0x35e4e0[_0x2400ea(0xc0)][_0x2400ea(0xd3)]?_0x29ff64:_0x35e4e0,_0x37e944[0x0]);if(_0x530e0e)return{'table':_0x1e5cc6['table'],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6['columns'],'status':'covered','matchedIndex':{..._0x530e0e[_0x2400ea(0x9f)],'matchedPrefix':_0x530e0e['matchedPrefix']}};const _0x1e4cc2=_0x226b1d?.[_0x2400ea(0xbd)][_0x2400ea(0xab)](_0x4e8e92=>_0x4e8e92[_0x2400ea(0xca)]['some'](_0xfae7b4=>_0x1e5cc6[_0x2400ea(0xca)][_0x2400ea(0xd2)](_0x2902e8=>columnNamesMatch(_0xfae7b4,_0x2902e8))))??[];if(_0x1e4cc2[_0x2400ea(0xd3)]>0x0)return _0x27dd1f['push']({'code':_0x2400ea(0xa1),'table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6[_0x2400ea(0xca)],'reason':_0x2400ea(0xb5)}),{'table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6['alias'],'columns':_0x1e5cc6[_0x2400ea(0xca)],'status':_0x2400ea(0xcc),'candidateIndexes':_0x1e4cc2};if(_0x226b1d&&_0x226b1d[_0x2400ea(0x9b)]!==![]&&_0x226b1d[_0x2400ea(0xbd)][_0x2400ea(0xd3)]>0x0&&_0x1e5cc6[_0x2400ea(0xca)][_0x2400ea(0xd3)]>0x0)return _0x27dd1f[_0x2400ea(0xc5)]({'code':'JOIN_INDEX_MISSING','table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6['columns'],'reason':_0x2400ea(0xb4)}),{'table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6[_0x2400ea(0xca)],'status':_0x2400ea(0xcc)};return _0x27dd1f['push']({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x1e5cc6['table'],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6[_0x2400ea(0xca)],'reason':_0x226b1d?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x1e5cc6[_0x2400ea(0xc1)],'alias':_0x1e5cc6[_0x2400ea(0x98)],'columns':_0x1e5cc6[_0x2400ea(0xca)],'status':_0x2400ea(0xba)};});return{'checked':_0x4f8526['length']>0x0,'joins':_0x4f8526,'warnings':_0x27dd1f};}function a238_0x2a33(){const _0x3a8bbd=['slice','warning','containsUnresolvedInclude','1934130OIAhGR','inner','cross','max','some','length','540978kqdmhk','sort','1233715BQLLku','12wkXhqR','error','test','full','alias','map','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','metadataAvailable','right','search','unknown','index','tableName','JOIN_INDEX_NOT_USABLE','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','__sq__','trim','matchAll','min','replaceAll','sql','includes','1668ZjNrMe','filter','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','split','position','(?:^|[^\x5cw$])','replace','endsWith','unsupportedReason','148633eHGqdh','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','has','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','indexOf','startsWith','unavailable','join','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','indexes','798584zurCvq','280MOhRbC','matchedPrefix','table','JOIN_PREDICATE_UNSUPPORTED','toLowerCase','exec','push','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','toUpperCase','match','6264378hoHHKm','columns'];a238_0x2a33=function(){return _0x3a8bbd;};return a238_0x2a33();}function extractJoinFacts(_0x1f6326){const _0x4ec1ab=a238_0x2169,_0x4413a9=maskNestedQueries(stripSqlNoise(_0x1f6326)),_0x4b565a=maskQuotedIdentifiers(_0x4413a9),_0x278634=[],_0x21a670=new Set(),_0x2217d3=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x2c9b03 of _0x4413a9[_0x4ec1ab(0xa5)](_0x2217d3)){const _0x29129b=_0x2c9b03[_0x4ec1ab(0x9f)]??0x0,_0x300590=_0x2c9b03[0x0][_0x4ec1ab(0x9d)](/\bJOIN\b/i),_0x22ca36=_0x29129b+Math[_0x4ec1ab(0xd1)](0x0,_0x300590);if(!/^JOIN\b/i[_0x4ec1ab(0xd9)](_0x4b565a[_0x4ec1ab(0xcb)](_0x22ca36)))continue;_0x21a670['add'](_0x22ca36);const _0x3527cd=normalizeIdentifier(_0x2c9b03[0x1]||'INNER'),_0x53274d=normalizeIdentifier(_0x2c9b03[0x2]??''),_0x7c3cc6=normalizeIdentifier(_0x2c9b03[0x3]||_0x53274d[_0x4ec1ab(0xad)]('.')['at'](-0x1)||_0x53274d),_0x1d85d5=[],_0xfe0296=_0x53274d===_0x4ec1ab(0xa3);let _0xcd50bc=_0x3527cd===_0x4ec1ab(0x9c)||_0x3527cd===_0x4ec1ab(0xda)||_0xfe0296,_0x189091=_0xcd50bc?_0xfe0296?_0x4ec1ab(0xa2):_0x3527cd[_0x4ec1ab(0xc7)]()+_0x4ec1ab(0xb7):undefined;const _0x9cfdc7=stripOuterParentheses(_0x2c9b03[0x4]??''),_0x408161=_0x9cfdc7[_0x4ec1ab(0xa9)](MYBATIS_DYNAMIC_START_MARKER)||_0x9cfdc7[_0x4ec1ab(0xa9)](MYBATIS_DYNAMIC_END_MARKER),_0x1d02cd=_0x9cfdc7[_0x4ec1ab(0xa9)](MYBATIS_INCLUDE_MARKER);_0x408161&&(_0xcd50bc=!![],_0x189091??=_0x4ec1ab(0xbc));_0x1d02cd&&(_0xcd50bc=!![],_0x189091??=_0x4ec1ab(0xac));const _0x1fc48d=_0x9cfdc7[_0x4ec1ab(0xa7)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x4ec1ab(0xa7)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x1fc48d,'OR')&&(_0xcd50bc=!![],_0x189091??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x4a8b4 of splitTopLevelAnd(_0x1fc48d)){const _0x5c1db8=stripOuterParentheses(_0x4a8b4);if(hasTopLevelKeyword(_0x5c1db8,'OR')){_0xcd50bc=!![],_0x189091??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x25261a=splitEquality(_0x5c1db8);if(!_0x25261a){containsColumnReference(_0x4a8b4,_0x7c3cc6)&&(_0xcd50bc=!![]);continue;}const _0x1728dc=parseDirectColumnReference(_0x25261a[0x0],_0x7c3cc6),_0x4631a8=parseDirectColumnReference(_0x25261a[0x1],_0x7c3cc6),_0x4c26ef=containsColumnReference(_0x25261a[0x0],_0x7c3cc6),_0x4e079e=containsColumnReference(_0x25261a[0x1],_0x7c3cc6),_0x175136=_0x1728dc&&!_0x4e079e?_0x1728dc:_0x4631a8&&!_0x4c26ef?_0x4631a8:null;if(_0x175136&&!_0x1d85d5['includes'](_0x175136))_0x1d85d5[_0x4ec1ab(0xc5)](_0x175136);else!_0x175136&&containsColumnReference(_0x4a8b4,_0x7c3cc6)&&(_0xcd50bc=!![]);}_0x278634[_0x4ec1ab(0xc5)]({'table':_0x53274d,'alias':_0x7c3cc6,'columns':_0x1d85d5,'unsupportedPredicate':_0xcd50bc,'unsupportedReason':_0x189091,'containsUnresolvedInclude':_0x1d02cd,'position':_0x22ca36});}for(const _0x5cad2a of _0x4b565a[_0x4ec1ab(0xa5)](/\bJOIN\b/gi)){const _0x1d3c00=_0x5cad2a[_0x4ec1ab(0x9f)]??0x0;if(_0x21a670[_0x4ec1ab(0xb6)](_0x1d3c00))continue;const _0x1d509f=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x4ec1ab(0xc4)](_0x4413a9['slice'](_0x1d3c00+_0x5cad2a[0x0][_0x4ec1ab(0xd3)])),_0x283327=normalizeIdentifier(_0x1d509f?.[0x1]||_0x4ec1ab(0x9e)),_0x43133f=normalizeIdentifier(_0x1d509f?.[0x2]||''),_0x47750c=isSqlClauseKeyword(_0x43133f)?_0x283327['split']('.')['at'](-0x1)||_0x283327:_0x43133f||_0x283327[_0x4ec1ab(0xad)]('.')['at'](-0x1)||_0x283327;_0x278634[_0x4ec1ab(0xc5)]({'table':_0x283327,'alias':_0x47750c,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x4ec1ab(0xc6),'position':_0x1d3c00});}const _0x23c12f=_0x4b565a[_0x4ec1ab(0xb8)](MYBATIS_INCLUDE_MARKER);return _0x23c12f>=0x0&&!_0x278634[_0x4ec1ab(0xd2)](_0x47e7a5=>_0x47e7a5[_0x4ec1ab(0xcd)])&&_0x278634[_0x4ec1ab(0xc5)]({'table':'unknown','alias':_0x4ec1ab(0x9e),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','containsUnresolvedInclude':!![],'position':_0x23c12f}),_0x278634[_0x4ec1ab(0xd5)]((_0x19b34c,_0x1beb8b)=>_0x19b34c[_0x4ec1ab(0xae)]-_0x1beb8b[_0x4ec1ab(0xae)]);}function a238_0x2169(_0x5555c9,_0x3d2174){_0x5555c9=_0x5555c9-0x98;const _0x2a33a5=a238_0x2a33();let _0x2169f6=_0x2a33a5[_0x5555c9];return _0x2169f6;}function stripSqlNoise(_0x151241){const _0x56f131=a238_0x2169,_0x69cbda=Array['from'](_0x151241),_0x4ff56b=(_0x2de271,_0x4e36c9)=>{for(let _0x3acdd1=_0x2de271;_0x3acdd1<_0x4e36c9;_0x3acdd1+=0x1){_0x69cbda[_0x3acdd1]!=='\x0a'&&_0x69cbda[_0x3acdd1]!=='\x0d'&&(_0x69cbda[_0x3acdd1]='\x20');}};for(let _0x589de9=0x0;_0x589de9<_0x69cbda[_0x56f131(0xd3)];_0x589de9+=0x1){const _0x55ffc5=_0x69cbda[_0x589de9],_0x4db37e=_0x69cbda[_0x589de9+0x1];if(_0x55ffc5==='\x27'||_0x55ffc5==='\x22'||_0x55ffc5==='`'){const _0x498a4e=_0x55ffc5,_0x291b38=_0x589de9;_0x589de9+=0x1;while(_0x589de9<_0x69cbda[_0x56f131(0xd3)]){if(_0x69cbda[_0x589de9]==='\x5c'&&_0x589de9+0x1<_0x69cbda[_0x56f131(0xd3)]){_0x589de9+=0x2;continue;}if(_0x69cbda[_0x589de9]!==_0x498a4e){_0x589de9+=0x1;continue;}if(_0x69cbda[_0x589de9+0x1]===_0x498a4e){_0x589de9+=0x2;continue;}break;}if(_0x498a4e==='\x27')_0x4ff56b(_0x291b38,Math[_0x56f131(0xa6)](_0x589de9+0x1,_0x69cbda[_0x56f131(0xd3)]));continue;}if(_0x55ffc5==='-'&&_0x4db37e==='-'){const _0x4fb78f=_0x589de9;while(_0x589de9<_0x69cbda[_0x56f131(0xd3)]&&_0x69cbda[_0x589de9]!=='\x0a')_0x589de9+=0x1;_0x4ff56b(_0x4fb78f,_0x589de9);continue;}if(_0x55ffc5==='/'&&_0x4db37e==='*'){const _0x47178f=_0x589de9;_0x589de9+=0x2;while(_0x589de9<_0x69cbda['length']&&!(_0x69cbda[_0x589de9]==='*'&&_0x69cbda[_0x589de9+0x1]==='/')){_0x589de9+=0x1;}_0x589de9=Math['min'](_0x589de9+0x1,_0x69cbda[_0x56f131(0xd3)]-0x1),_0x4ff56b(_0x47178f,_0x589de9+0x1);continue;}if(_0x55ffc5==='#'&&_0x4db37e!=='{'){const _0x23df2c=_0x589de9;while(_0x589de9<_0x69cbda[_0x56f131(0xd3)]&&_0x69cbda[_0x589de9]!=='\x0a')_0x589de9+=0x1;_0x4ff56b(_0x23df2c,_0x589de9);continue;}if((_0x55ffc5==='#'||_0x55ffc5==='$')&&_0x4db37e==='{'){const _0x3193d7=_0x589de9;_0x589de9+=0x2;while(_0x589de9<_0x69cbda[_0x56f131(0xd3)]&&_0x69cbda[_0x589de9]!=='}')_0x589de9+=0x1;_0x4ff56b(_0x3193d7,Math[_0x56f131(0xa6)](_0x589de9+0x1,_0x69cbda[_0x56f131(0xd3)]));}}return _0x69cbda[_0x56f131(0xbb)]('');}function maskQuotedIdentifiers(_0x1e9ea2){const _0x337469=a238_0x2169,_0x3ee0cc=Array['from'](_0x1e9ea2);for(let _0x16d223=0x0;_0x16d223<_0x3ee0cc[_0x337469(0xd3)];_0x16d223+=0x1){const _0x1437c6=_0x3ee0cc[_0x16d223];if(_0x1437c6!=='\x22'&&_0x1437c6!=='`')continue;_0x16d223+=0x1;while(_0x16d223<_0x3ee0cc['length']){if(_0x3ee0cc[_0x16d223]===_0x1437c6){if(_0x3ee0cc[_0x16d223+0x1]===_0x1437c6){_0x3ee0cc[_0x16d223]='\x20',_0x3ee0cc[_0x16d223+0x1]='\x20',_0x16d223+=0x2;continue;}break;}_0x3ee0cc[_0x16d223]='\x20',_0x16d223+=0x1;}}return _0x3ee0cc[_0x337469(0xbb)]('');}function maskNestedQueries(_0x5edc83){const _0x329e20=a238_0x2169,_0x1aab93=Array['from'](_0x5edc83);for(let _0x20f275=0x0;_0x20f275<_0x1aab93[_0x329e20(0xd3)];_0x20f275+=0x1){if(_0x1aab93[_0x20f275]!=='(')continue;const _0x577898=_0x5edc83['slice'](_0x20f275+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x329e20(0xd9)](_0x577898))continue;let _0x21567b=0x1,_0xda3fe8=_0x20f275+0x1;for(;_0xda3fe8<_0x1aab93['length']&&_0x21567b>0x0;_0xda3fe8+=0x1){if(_0x1aab93[_0xda3fe8]==='(')_0x21567b+=0x1;if(_0x1aab93[_0xda3fe8]===')')_0x21567b-=0x1;}if(_0x21567b!==0x0)continue;for(let _0xedef72=_0x20f275;_0xedef72<_0xda3fe8;_0xedef72+=0x1){_0x1aab93[_0xedef72]='\x20';}const _0x492940='__sq__';for(let _0x36bee4=0x0;_0x36bee4<_0x492940[_0x329e20(0xd3)]&&_0x20f275+_0x36bee4<_0xda3fe8;_0x36bee4+=0x1){_0x1aab93[_0x20f275+_0x36bee4]=_0x492940[_0x36bee4];}_0x20f275=_0xda3fe8-0x1;}return _0x1aab93[_0x329e20(0xbb)]('');}function splitTopLevelAnd(_0x23d48d){const _0x57899d=a238_0x2169,_0x17caef=[];let _0x15c8c5=0x0,_0x1355f7=0x0;for(let _0x1c1769=0x0;_0x1c1769<_0x23d48d[_0x57899d(0xd3)];_0x1c1769+=0x1){const _0x2cb45a=_0x23d48d[_0x1c1769];if(_0x2cb45a==='(')_0x15c8c5+=0x1;if(_0x2cb45a===')')_0x15c8c5=Math[_0x57899d(0xd1)](0x0,_0x15c8c5-0x1);_0x15c8c5===0x0&&_0x23d48d[_0x57899d(0xcb)](_0x1c1769)[_0x57899d(0xc8)](/^AND\b/i)&&(_0x1c1769===0x0||/\s/['test'](_0x23d48d[_0x1c1769-0x1]??''))&&(_0x17caef[_0x57899d(0xc5)](_0x23d48d[_0x57899d(0xcb)](_0x1355f7,_0x1c1769)[_0x57899d(0xa4)]()),_0x1c1769+=0x2,_0x1355f7=_0x1c1769+0x1);}const _0x4ecf37=_0x23d48d[_0x57899d(0xcb)](_0x1355f7)['trim']();if(_0x4ecf37)_0x17caef[_0x57899d(0xc5)](_0x4ecf37);return _0x17caef;}function hasTopLevelKeyword(_0x459356,_0x4bb1fd){const _0x5997ba=a238_0x2169;let _0x3aca8b=0x0;for(let _0x2491a1=0x0;_0x2491a1<_0x459356[_0x5997ba(0xd3)];_0x2491a1+=0x1){const _0xbd5610=_0x459356[_0x2491a1];if(_0xbd5610==='(')_0x3aca8b+=0x1;if(_0xbd5610===')')_0x3aca8b=Math[_0x5997ba(0xd1)](0x0,_0x3aca8b-0x1);if(_0x3aca8b!==0x0)continue;const _0x47b578=_0x459356[_0x5997ba(0xcb)](_0x2491a1,_0x2491a1+_0x4bb1fd[_0x5997ba(0xd3)]),_0x1188d0=_0x459356[_0x2491a1-0x1]??'\x20',_0x387e3f=_0x459356[_0x2491a1+_0x4bb1fd[_0x5997ba(0xd3)]]??'\x20';if(_0x47b578[_0x5997ba(0xc7)]()===_0x4bb1fd[_0x5997ba(0xc7)]()&&!/[\w$]/[_0x5997ba(0xd9)](_0x1188d0)&&!/[\w$]/[_0x5997ba(0xd9)](_0x387e3f))return!![];}return![];}function splitEquality(_0x433999){const _0xe7e93b=a238_0x2169,_0x196d90=stripOuterParentheses(_0x433999);let _0x995405=0x0,_0x5a47ef;for(let _0x383541=0x0;_0x383541<_0x196d90[_0xe7e93b(0xd3)];_0x383541+=0x1){const _0x5939ea=_0x196d90[_0x383541];if(_0x5939ea==='(')_0x995405+=0x1;if(_0x5939ea===')')_0x995405=Math[_0xe7e93b(0xd1)](0x0,_0x995405-0x1);const _0x4347b2=_0x196d90[_0x383541-0x1]??'',_0x4aaf7c=_0x196d90[_0x383541+0x1]??'';if(_0x5939ea==='='&&_0x995405===0x0&&!/[!<>=:]/['test'](_0x4347b2)&&_0x4aaf7c!=='='){if(_0x5a47ef!==undefined)return null;_0x5a47ef=_0x383541;}}return _0x5a47ef===undefined?null:[_0x196d90[_0xe7e93b(0xcb)](0x0,_0x5a47ef)['trim'](),_0x196d90['slice'](_0x5a47ef+0x1)[_0xe7e93b(0xa4)]()];}function parseDirectColumnReference(_0x9ab840,_0x1a1d6f){const _0x19e18c=a238_0x2169,_0xe5d3d5=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x19e18c(0xc4)](stripOuterParentheses(_0x9ab840));if(!_0xe5d3d5)return null;if(normalizeIdentifier(_0xe5d3d5[0x1]??'')!==normalizeIdentifier(_0x1a1d6f))return null;return normalizeIdentifier(_0xe5d3d5[0x2]??'');}function containsColumnReference(_0x33f093,_0x3e41a3){const _0x17f9b1=a238_0x2169,_0x33df0d=_0x33f093[_0x17f9b1(0xb0)](/[`"]/g,''),_0x3536c4=_0x3e41a3[_0x17f9b1(0xb0)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x17f9b1(0xaf)+_0x3536c4+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')['test'](_0x33df0d);}function findEqualityPrefix(_0x2e6925,_0x39420d){const _0x4f5a98=a238_0x2169,_0x2ed832=new Set(_0x39420d[_0x4f5a98(0x99)](normalizeIdentifier)),_0x1d6a77=[];for(const _0x2b8db0 of _0x2e6925){if(!_0x2ed832['has'](normalizeIdentifier(_0x2b8db0)))break;_0x1d6a77[_0x4f5a98(0xc5)](_0x2b8db0);}return _0x1d6a77;}function resolveTableMetadata(_0x3916c5,_0x76a587){const _0x341ecf=a238_0x2169,_0x4dfb17=normalizeIdentifier(_0x76a587),_0x3d6347=_0x3916c5[_0x341ecf(0xab)](_0x45c127=>normalizeIdentifier(_0x45c127['tableName'])===_0x4dfb17);if(_0x3d6347[_0x341ecf(0xd3)]===0x1)return _0x3d6347[0x0];const _0xcfcee5=_0x4dfb17[_0x341ecf(0xa9)]('.'),_0x4690af=_0x4dfb17['split']('.')['at'](-0x1),_0x1dcc91=_0x3916c5['filter'](_0x56b362=>{const _0x8ac88b=_0x341ecf,_0xda96cf=normalizeIdentifier(_0x56b362[_0x8ac88b(0xa0)]);if(_0xcfcee5&&_0xda96cf[_0x8ac88b(0xa9)]('.'))return![];return _0xda96cf[_0x8ac88b(0xad)]('.')['at'](-0x1)===_0x4690af;});return _0x1dcc91['length']===0x1?_0x1dcc91[0x0]:undefined;}function columnNamesMatch(_0x24a35f,_0x44113e){return normalizeIdentifier(_0x24a35f)===normalizeIdentifier(_0x44113e);}function normalizeIdentifier(_0x997ccc){const _0x565577=a238_0x2169;return _0x997ccc[_0x565577(0xb0)](/[`"]/g,'')[_0x565577(0xa4)]()[_0x565577(0xc3)]();}function isSqlClauseKeyword(_0x4b60ec){const _0x50e1ec=a238_0x2169;return new Set(['on','using','where',_0x50e1ec(0xbb),_0x50e1ec(0xcf),'left','right',_0x50e1ec(0xda),_0x50e1ec(0xd0),'natural'])[_0x50e1ec(0xb6)](_0x4b60ec);}function stripOuterParentheses(_0x230b17){const _0x5ecd50=a238_0x2169;let _0xe1e79c=_0x230b17['trim']();while(_0xe1e79c[_0x5ecd50(0xb9)]('(')&&_0xe1e79c[_0x5ecd50(0xb1)](')')){let _0x1269c4=0x0,_0x47d5e1=!![];for(let _0x4cc5a1=0x0;_0x4cc5a1<_0xe1e79c[_0x5ecd50(0xd3)];_0x4cc5a1+=0x1){if(_0xe1e79c[_0x4cc5a1]==='(')_0x1269c4+=0x1;if(_0xe1e79c[_0x4cc5a1]===')')_0x1269c4-=0x1;if(_0x1269c4===0x0&&_0x4cc5a1<_0xe1e79c[_0x5ecd50(0xd3)]-0x1){_0x47d5e1=![];break;}}if(!_0x47d5e1||_0x1269c4!==0x0)break;_0xe1e79c=_0xe1e79c[_0x5ecd50(0xcb)](0x1,-0x1)[_0x5ecd50(0xa4)]();}return _0xe1e79c;}
1
+ function a231_0x412f(_0xeba4e2,_0x779e13){_0xeba4e2=_0xeba4e2-0x94;const _0x4ffa22=a231_0x4ffa();let _0x412ff3=_0x4ffa22[_0xeba4e2];return _0x412ff3;}(function(_0x5b4fa2,_0x265d60){const _0x5a0659=a231_0x412f,_0x444817=_0x5b4fa2();while(!![]){try{const _0x243cc3=parseInt(_0x5a0659(0xba))/0x1+-parseInt(_0x5a0659(0x99))/0x2+-parseInt(_0x5a0659(0xc1))/0x3+-parseInt(_0x5a0659(0xb4))/0x4*(parseInt(_0x5a0659(0xc5))/0x5)+-parseInt(_0x5a0659(0xbe))/0x6*(parseInt(_0x5a0659(0xb7))/0x7)+-parseInt(_0x5a0659(0xbb))/0x8*(-parseInt(_0x5a0659(0xbf))/0x9)+parseInt(_0x5a0659(0xa4))/0xa;if(_0x243cc3===_0x265d60)break;else _0x444817['push'](_0x444817['shift']());}catch(_0x226c69){_0x444817['push'](_0x444817['shift']());}}}(a231_0x4ffa,0xb0b08));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x573443,_0x71c0f5){const _0x4449a3=a231_0x412f,_0x41a2fc=[],_0x1806de=normalizeSqlForStaticAnalysis(_0x573443),_0x26b330=(_0x1806de[_0x4449a3(0xab)]?[]:extractJoinFacts(_0x1806de[_0x4449a3(0xb2)]))[_0x4449a3(0xd2)](_0x27ac42=>{const _0x1298c0=_0x4449a3;if(_0x27ac42[_0x1298c0(0x9e)]||_0x27ac42['columns'][_0x1298c0(0xcf)]===0x0)return _0x41a2fc[_0x1298c0(0xcb)]({'code':_0x1298c0(0xbd),'table':_0x27ac42[_0x1298c0(0xad)],'alias':_0x27ac42['alias'],'columns':_0x27ac42[_0x1298c0(0xa1)],'reason':_0x27ac42['unsupportedReason']??'Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.'}),{'table':_0x27ac42['table'],'alias':_0x27ac42[_0x1298c0(0xc2)],'columns':_0x27ac42[_0x1298c0(0xa1)],'status':'unavailable'};const _0x4ba00d=resolveTableMetadata(_0x71c0f5,_0x27ac42[_0x1298c0(0xad)]),_0x42664c=(_0x4ba00d?.[_0x1298c0(0xae)]??[])[_0x1298c0(0xd2)](_0x1e20e9=>({'index':_0x1e20e9,'matchedPrefix':findEqualityPrefix(_0x1e20e9[_0x1298c0(0xa1)],_0x27ac42[_0x1298c0(0xa1)])}))[_0x1298c0(0xd4)](_0x36e732=>_0x36e732['matchedPrefix'][_0x1298c0(0xcf)]>0x0),_0x48e286=_0x42664c['reduce']((_0x2e1a64,_0x1d443a)=>!_0x2e1a64||_0x1d443a[_0x1298c0(0xc0)][_0x1298c0(0xcf)]>_0x2e1a64[_0x1298c0(0xc0)][_0x1298c0(0xcf)]?_0x1d443a:_0x2e1a64,_0x42664c[0x0]);if(_0x48e286)return{'table':_0x27ac42['table'],'alias':_0x27ac42['alias'],'columns':_0x27ac42[_0x1298c0(0xa1)],'status':'covered','matchedIndex':{..._0x48e286[_0x1298c0(0xc4)],'matchedPrefix':_0x48e286[_0x1298c0(0xc0)]}};const _0x2272f5=_0x4ba00d?.[_0x1298c0(0xae)][_0x1298c0(0xd4)](_0x2626ca=>_0x2626ca[_0x1298c0(0xa1)]['some'](_0x53fac2=>_0x27ac42['columns'][_0x1298c0(0xda)](_0x5b0fab=>columnNamesMatch(_0x53fac2,_0x5b0fab))))??[];if(_0x2272f5[_0x1298c0(0xcf)]>0x0)return _0x41a2fc[_0x1298c0(0xcb)]({'code':_0x1298c0(0xca),'table':_0x27ac42['table'],'alias':_0x27ac42['alias'],'columns':_0x27ac42[_0x1298c0(0xa1)],'reason':_0x1298c0(0x9c)}),{'table':_0x27ac42['table'],'alias':_0x27ac42[_0x1298c0(0xc2)],'columns':_0x27ac42[_0x1298c0(0xa1)],'status':'warning','candidateIndexes':_0x2272f5};if(_0x4ba00d&&_0x4ba00d[_0x1298c0(0xb5)]!==![]&&_0x4ba00d[_0x1298c0(0xae)][_0x1298c0(0xcf)]>0x0&&_0x27ac42[_0x1298c0(0xa1)][_0x1298c0(0xcf)]>0x0)return _0x41a2fc[_0x1298c0(0xcb)]({'code':_0x1298c0(0xdb),'table':_0x27ac42[_0x1298c0(0xad)],'alias':_0x27ac42[_0x1298c0(0xc2)],'columns':_0x27ac42[_0x1298c0(0xa1)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x27ac42[_0x1298c0(0xad)],'alias':_0x27ac42['alias'],'columns':_0x27ac42['columns'],'status':_0x1298c0(0xaa)};return _0x41a2fc[_0x1298c0(0xcb)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x27ac42['table'],'alias':_0x27ac42[_0x1298c0(0xc2)],'columns':_0x27ac42[_0x1298c0(0xa1)],'reason':_0x4ba00d?_0x1298c0(0xd5):_0x1298c0(0x97)}),{'table':_0x27ac42[_0x1298c0(0xad)],'alias':_0x27ac42[_0x1298c0(0xc2)],'columns':_0x27ac42[_0x1298c0(0xa1)],'status':_0x1298c0(0xd1)};});return{'checked':_0x26b330[_0x4449a3(0xcf)]>0x0,'joins':_0x26b330,'warnings':_0x41a2fc};}function extractJoinFacts(_0x4134a1){const _0x321252=a231_0x412f,_0x44ab8f=maskNestedQueries(stripSqlNoise(_0x4134a1)),_0x5e28e=maskQuotedIdentifiers(_0x44ab8f),_0x3d2fec=[],_0x5d5abc=new Set(),_0x274857=/\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 _0x2dd720 of _0x44ab8f[_0x321252(0x96)](_0x274857)){const _0x1fa712=_0x2dd720['index']??0x0,_0x12c4c3=_0x2dd720[0x0]['search'](/\bJOIN\b/i),_0x87e0e6=_0x1fa712+Math[_0x321252(0xb9)](0x0,_0x12c4c3);if(!/^JOIN\b/i[_0x321252(0x95)](_0x5e28e[_0x321252(0xa7)](_0x87e0e6)))continue;_0x5d5abc[_0x321252(0xc3)](_0x87e0e6);const _0x5c9a7b=normalizeIdentifier(_0x2dd720[0x1]||_0x321252(0xce)),_0x4a0246=normalizeIdentifier(_0x2dd720[0x2]??''),_0x6f5d0d=normalizeIdentifier(_0x2dd720[0x3]||_0x4a0246[_0x321252(0x9d)]('.')['at'](-0x1)||_0x4a0246),_0x37bb3e=[],_0x4dcc34=_0x4a0246==='__sq__';let _0x33d8ab=_0x5c9a7b==='right'||_0x5c9a7b===_0x321252(0xa5)||_0x4dcc34,_0x3b5d72=_0x33d8ab?_0x4dcc34?_0x321252(0xcd):_0x5c9a7b[_0x321252(0x9f)]()+_0x321252(0xb0):undefined;const _0x2831b2=stripOuterParentheses(_0x2dd720[0x4]??''),_0x39c07a=_0x2831b2[_0x321252(0xb1)](MYBATIS_DYNAMIC_START_MARKER)||_0x2831b2['includes'](MYBATIS_DYNAMIC_END_MARKER),_0x42f4f0=_0x2831b2[_0x321252(0xb1)](MYBATIS_INCLUDE_MARKER);_0x39c07a&&(_0x33d8ab=!![],_0x3b5d72??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0x42f4f0&&(_0x33d8ab=!![],_0x3b5d72??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0xbeb44b=_0x2831b2[_0x321252(0xa0)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x321252(0xa0)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x321252(0xa0)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0xbeb44b,'OR')&&(_0x33d8ab=!![],_0x3b5d72??=_0x321252(0xc6));for(const _0x4531d0 of splitTopLevelAnd(_0xbeb44b)){const _0x5f0222=stripOuterParentheses(_0x4531d0);if(hasTopLevelKeyword(_0x5f0222,'OR')){_0x33d8ab=!![],_0x3b5d72??=_0x321252(0xc6);continue;}const _0x4c0a26=splitEquality(_0x5f0222);if(!_0x4c0a26){containsColumnReference(_0x4531d0,_0x6f5d0d)&&(_0x33d8ab=!![]);continue;}const _0x3314a8=parseDirectColumnReference(_0x4c0a26[0x0],_0x6f5d0d),_0x34222d=parseDirectColumnReference(_0x4c0a26[0x1],_0x6f5d0d),_0x3b2af5=containsColumnReference(_0x4c0a26[0x0],_0x6f5d0d),_0x58ea59=containsColumnReference(_0x4c0a26[0x1],_0x6f5d0d),_0x573298=_0x3314a8&&!_0x58ea59?_0x3314a8:_0x34222d&&!_0x3b2af5?_0x34222d:null;if(_0x573298&&!_0x37bb3e[_0x321252(0xb1)](_0x573298))_0x37bb3e[_0x321252(0xcb)](_0x573298);else!_0x573298&&containsColumnReference(_0x4531d0,_0x6f5d0d)&&(_0x33d8ab=!![]);}_0x3d2fec[_0x321252(0xcb)]({'table':_0x4a0246,'alias':_0x6f5d0d,'columns':_0x37bb3e,'unsupportedPredicate':_0x33d8ab,'unsupportedReason':_0x3b5d72,'containsUnresolvedInclude':_0x42f4f0,'position':_0x87e0e6});}for(const _0x123a27 of _0x5e28e[_0x321252(0x96)](/\bJOIN\b/gi)){const _0x125ed4=_0x123a27[_0x321252(0xc4)]??0x0;if(_0x5d5abc[_0x321252(0xa6)](_0x125ed4))continue;const _0x470d0f=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x321252(0xd8)](_0x44ab8f[_0x321252(0xa7)](_0x125ed4+_0x123a27[0x0]['length'])),_0x59a41a=normalizeIdentifier(_0x470d0f?.[0x1]||_0x321252(0xcc)),_0x1fdc1c=normalizeIdentifier(_0x470d0f?.[0x2]||''),_0x46fbf2=isSqlClauseKeyword(_0x1fdc1c)?_0x59a41a[_0x321252(0x9d)]('.')['at'](-0x1)||_0x59a41a:_0x1fdc1c||_0x59a41a[_0x321252(0x9d)]('.')['at'](-0x1)||_0x59a41a;_0x3d2fec[_0x321252(0xcb)]({'table':_0x59a41a,'alias':_0x46fbf2,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x321252(0xa9),'position':_0x125ed4});}const _0x2cd76b=_0x5e28e['indexOf'](MYBATIS_INCLUDE_MARKER);return _0x2cd76b>=0x0&&!_0x3d2fec[_0x321252(0xda)](_0x20a566=>_0x20a566[_0x321252(0x9a)])&&_0x3d2fec[_0x321252(0xcb)]({'table':_0x321252(0xcc),'alias':'unknown','columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x321252(0xd7),'containsUnresolvedInclude':!![],'position':_0x2cd76b}),_0x3d2fec[_0x321252(0xa8)]((_0x1c159e,_0x46a501)=>_0x1c159e['position']-_0x46a501[_0x321252(0x98)]);}function stripSqlNoise(_0x1fe942){const _0xce864d=a231_0x412f,_0xa91920=Array['from'](_0x1fe942),_0x442f3e=(_0x985ec7,_0x104eaf)=>{for(let _0x4362b1=_0x985ec7;_0x4362b1<_0x104eaf;_0x4362b1+=0x1){_0xa91920[_0x4362b1]!=='\x0a'&&_0xa91920[_0x4362b1]!=='\x0d'&&(_0xa91920[_0x4362b1]='\x20');}};for(let _0x1bfb36=0x0;_0x1bfb36<_0xa91920[_0xce864d(0xcf)];_0x1bfb36+=0x1){const _0x6fdd69=_0xa91920[_0x1bfb36],_0xc3902e=_0xa91920[_0x1bfb36+0x1];if(_0x6fdd69==='\x27'||_0x6fdd69==='\x22'||_0x6fdd69==='`'){const _0x2c593e=_0x6fdd69,_0x4eaa3d=_0x1bfb36;_0x1bfb36+=0x1;while(_0x1bfb36<_0xa91920[_0xce864d(0xcf)]){if(_0xa91920[_0x1bfb36]==='\x5c'&&_0x1bfb36+0x1<_0xa91920['length']){_0x1bfb36+=0x2;continue;}if(_0xa91920[_0x1bfb36]!==_0x2c593e){_0x1bfb36+=0x1;continue;}if(_0xa91920[_0x1bfb36+0x1]===_0x2c593e){_0x1bfb36+=0x2;continue;}break;}if(_0x2c593e==='\x27')_0x442f3e(_0x4eaa3d,Math['min'](_0x1bfb36+0x1,_0xa91920['length']));continue;}if(_0x6fdd69==='-'&&_0xc3902e==='-'){const _0x5a74dc=_0x1bfb36;while(_0x1bfb36<_0xa91920[_0xce864d(0xcf)]&&_0xa91920[_0x1bfb36]!=='\x0a')_0x1bfb36+=0x1;_0x442f3e(_0x5a74dc,_0x1bfb36);continue;}if(_0x6fdd69==='/'&&_0xc3902e==='*'){const _0x33553a=_0x1bfb36;_0x1bfb36+=0x2;while(_0x1bfb36<_0xa91920[_0xce864d(0xcf)]&&!(_0xa91920[_0x1bfb36]==='*'&&_0xa91920[_0x1bfb36+0x1]==='/')){_0x1bfb36+=0x1;}_0x1bfb36=Math[_0xce864d(0xa2)](_0x1bfb36+0x1,_0xa91920[_0xce864d(0xcf)]-0x1),_0x442f3e(_0x33553a,_0x1bfb36+0x1);continue;}if(_0x6fdd69==='#'&&_0xc3902e!=='{'){const _0x41bdd3=_0x1bfb36;while(_0x1bfb36<_0xa91920[_0xce864d(0xcf)]&&_0xa91920[_0x1bfb36]!=='\x0a')_0x1bfb36+=0x1;_0x442f3e(_0x41bdd3,_0x1bfb36);continue;}if((_0x6fdd69==='#'||_0x6fdd69==='$')&&_0xc3902e==='{'){const _0x367c57=_0x1bfb36;_0x1bfb36+=0x2;while(_0x1bfb36<_0xa91920[_0xce864d(0xcf)]&&_0xa91920[_0x1bfb36]!=='}')_0x1bfb36+=0x1;_0x442f3e(_0x367c57,Math[_0xce864d(0xa2)](_0x1bfb36+0x1,_0xa91920[_0xce864d(0xcf)]));}}return _0xa91920[_0xce864d(0xb3)]('');}function maskQuotedIdentifiers(_0x92296){const _0x238823=a231_0x412f,_0x2179d8=Array[_0x238823(0xaf)](_0x92296);for(let _0x335279=0x0;_0x335279<_0x2179d8[_0x238823(0xcf)];_0x335279+=0x1){const _0xe30e59=_0x2179d8[_0x335279];if(_0xe30e59!=='\x22'&&_0xe30e59!=='`')continue;_0x335279+=0x1;while(_0x335279<_0x2179d8[_0x238823(0xcf)]){if(_0x2179d8[_0x335279]===_0xe30e59){if(_0x2179d8[_0x335279+0x1]===_0xe30e59){_0x2179d8[_0x335279]='\x20',_0x2179d8[_0x335279+0x1]='\x20',_0x335279+=0x2;continue;}break;}_0x2179d8[_0x335279]='\x20',_0x335279+=0x1;}}return _0x2179d8[_0x238823(0xb3)]('');}function maskNestedQueries(_0x3d1fef){const _0x44ba21=a231_0x412f,_0xbb56a9=Array[_0x44ba21(0xaf)](_0x3d1fef);for(let _0x2a534c=0x0;_0x2a534c<_0xbb56a9[_0x44ba21(0xcf)];_0x2a534c+=0x1){if(_0xbb56a9[_0x2a534c]!=='(')continue;const _0x2047f8=_0x3d1fef[_0x44ba21(0xa7)](_0x2a534c+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x2047f8))continue;let _0x4dd8ba=0x1,_0x539643=_0x2a534c+0x1;for(;_0x539643<_0xbb56a9[_0x44ba21(0xcf)]&&_0x4dd8ba>0x0;_0x539643+=0x1){if(_0xbb56a9[_0x539643]==='(')_0x4dd8ba+=0x1;if(_0xbb56a9[_0x539643]===')')_0x4dd8ba-=0x1;}if(_0x4dd8ba!==0x0)continue;for(let _0x452482=_0x2a534c;_0x452482<_0x539643;_0x452482+=0x1){_0xbb56a9[_0x452482]='\x20';}const _0x15ee36='__sq__';for(let _0x5cd710=0x0;_0x5cd710<_0x15ee36[_0x44ba21(0xcf)]&&_0x2a534c+_0x5cd710<_0x539643;_0x5cd710+=0x1){_0xbb56a9[_0x2a534c+_0x5cd710]=_0x15ee36[_0x5cd710];}_0x2a534c=_0x539643-0x1;}return _0xbb56a9[_0x44ba21(0xb3)]('');}function splitTopLevelAnd(_0x4cea5a){const _0x4403ef=a231_0x412f,_0x2fef55=[];let _0x32bec5=0x0,_0x1850cc=0x0;for(let _0x1dc9e2=0x0;_0x1dc9e2<_0x4cea5a['length'];_0x1dc9e2+=0x1){const _0x2cbf7=_0x4cea5a[_0x1dc9e2];if(_0x2cbf7==='(')_0x32bec5+=0x1;if(_0x2cbf7===')')_0x32bec5=Math[_0x4403ef(0xb9)](0x0,_0x32bec5-0x1);_0x32bec5===0x0&&_0x4cea5a[_0x4403ef(0xa7)](_0x1dc9e2)['match'](/^AND\b/i)&&(_0x1dc9e2===0x0||/\s/['test'](_0x4cea5a[_0x1dc9e2-0x1]??''))&&(_0x2fef55[_0x4403ef(0xcb)](_0x4cea5a[_0x4403ef(0xa7)](_0x1850cc,_0x1dc9e2)[_0x4403ef(0xc8)]()),_0x1dc9e2+=0x2,_0x1850cc=_0x1dc9e2+0x1);}const _0x206e10=_0x4cea5a[_0x4403ef(0xa7)](_0x1850cc)[_0x4403ef(0xc8)]();if(_0x206e10)_0x2fef55['push'](_0x206e10);return _0x2fef55;}function hasTopLevelKeyword(_0x5c3c5c,_0x14fd48){const _0x3d6ffa=a231_0x412f;let _0x400e4e=0x0;for(let _0x5cc2b5=0x0;_0x5cc2b5<_0x5c3c5c[_0x3d6ffa(0xcf)];_0x5cc2b5+=0x1){const _0x13d408=_0x5c3c5c[_0x5cc2b5];if(_0x13d408==='(')_0x400e4e+=0x1;if(_0x13d408===')')_0x400e4e=Math['max'](0x0,_0x400e4e-0x1);if(_0x400e4e!==0x0)continue;const _0x5051ce=_0x5c3c5c[_0x3d6ffa(0xa7)](_0x5cc2b5,_0x5cc2b5+_0x14fd48[_0x3d6ffa(0xcf)]),_0x131f2c=_0x5c3c5c[_0x5cc2b5-0x1]??'\x20',_0x2917c8=_0x5c3c5c[_0x5cc2b5+_0x14fd48[_0x3d6ffa(0xcf)]]??'\x20';if(_0x5051ce[_0x3d6ffa(0x9f)]()===_0x14fd48['toUpperCase']()&&!/[\w$]/[_0x3d6ffa(0x95)](_0x131f2c)&&!/[\w$]/[_0x3d6ffa(0x95)](_0x2917c8))return!![];}return![];}function splitEquality(_0x2037de){const _0x175c15=a231_0x412f,_0x425a64=stripOuterParentheses(_0x2037de);let _0x7a3145=0x0,_0x5d0d85;for(let _0x9ac076=0x0;_0x9ac076<_0x425a64[_0x175c15(0xcf)];_0x9ac076+=0x1){const _0x22cbea=_0x425a64[_0x9ac076];if(_0x22cbea==='(')_0x7a3145+=0x1;if(_0x22cbea===')')_0x7a3145=Math[_0x175c15(0xb9)](0x0,_0x7a3145-0x1);const _0x199116=_0x425a64[_0x9ac076-0x1]??'',_0x32f0ce=_0x425a64[_0x9ac076+0x1]??'';if(_0x22cbea==='='&&_0x7a3145===0x0&&!/[!<>=:]/[_0x175c15(0x95)](_0x199116)&&_0x32f0ce!=='='){if(_0x5d0d85!==undefined)return null;_0x5d0d85=_0x9ac076;}}return _0x5d0d85===undefined?null:[_0x425a64['slice'](0x0,_0x5d0d85)[_0x175c15(0xc8)](),_0x425a64[_0x175c15(0xa7)](_0x5d0d85+0x1)[_0x175c15(0xc8)]()];}function parseDirectColumnReference(_0x1ab2d1,_0x84695e){const _0x20f29e=a231_0x412f,_0xa525af=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x20f29e(0xd8)](stripOuterParentheses(_0x1ab2d1));if(!_0xa525af)return null;if(normalizeIdentifier(_0xa525af[0x1]??'')!==normalizeIdentifier(_0x84695e))return null;return normalizeIdentifier(_0xa525af[0x2]??'');}function containsColumnReference(_0x453188,_0x37dcad){const _0x4457a4=a231_0x412f,_0x1a2ef3=_0x453188[_0x4457a4(0xb6)](/[`"]/g,''),_0x45906d=_0x37dcad[_0x4457a4(0xb6)](/[.*+?^${}()|[\]\\]/g,_0x4457a4(0xb8));return new RegExp('(?:^|[^\x5cw$])'+_0x45906d+_0x4457a4(0xa3),'i')[_0x4457a4(0x95)](_0x1a2ef3);}function findEqualityPrefix(_0x436eda,_0x410283){const _0x1f9d1b=a231_0x412f,_0x5b978f=new Set(_0x410283[_0x1f9d1b(0xd2)](normalizeIdentifier)),_0x57b1e7=[];for(const _0x5d78be of _0x436eda){if(!_0x5b978f[_0x1f9d1b(0xa6)](normalizeIdentifier(_0x5d78be)))break;_0x57b1e7[_0x1f9d1b(0xcb)](_0x5d78be);}return _0x57b1e7;}function resolveTableMetadata(_0x2227ca,_0x5bf399){const _0x428f68=a231_0x412f,_0x56c24d=normalizeIdentifier(_0x5bf399),_0x2574d7=_0x2227ca[_0x428f68(0xd4)](_0x9b343a=>normalizeIdentifier(_0x9b343a[_0x428f68(0xbc)])===_0x56c24d);if(_0x2574d7[_0x428f68(0xcf)]===0x1)return _0x2574d7[0x0];const _0x45e969=_0x56c24d[_0x428f68(0xb1)]('.'),_0x59a716=_0x56c24d[_0x428f68(0x9d)]('.')['at'](-0x1),_0x1b192c=_0x2227ca[_0x428f68(0xd4)](_0x186662=>{const _0x38ede0=_0x428f68,_0x56d30f=normalizeIdentifier(_0x186662[_0x38ede0(0xbc)]);if(_0x45e969&&_0x56d30f[_0x38ede0(0xb1)]('.'))return![];return _0x56d30f[_0x38ede0(0x9d)]('.')['at'](-0x1)===_0x59a716;});return _0x1b192c[_0x428f68(0xcf)]===0x1?_0x1b192c[0x0]:undefined;}function columnNamesMatch(_0x55440d,_0x5b4a87){return normalizeIdentifier(_0x55440d)===normalizeIdentifier(_0x5b4a87);}function normalizeIdentifier(_0x5c2802){const _0x106285=a231_0x412f;return _0x5c2802['replace'](/[`"]/g,'')[_0x106285(0xc8)]()[_0x106285(0xac)]();}function a231_0x4ffa(){const _0x4333c4=['endsWith','test','matchAll','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','position','1115094zIEnRp','containsUnresolvedInclude','startsWith','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','split','unsupportedPredicate','toUpperCase','replaceAll','columns','min','\x5cs*\x5c.\x5cs*[\x5cw$]+','40149880ymhYAb','full','has','slice','sort','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','warning','error','toLowerCase','table','indexes','from','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','includes','sql','join','4gAGDQb','metadataAvailable','replace','309785nnLZbf','\x5c$&','max','92130kSWdHW','45928muFKcs','tableName','JOIN_PREDICATE_UNSUPPORTED','120OopSlq','288ytmHDB','matchedPrefix','3837795CVZFSQ','alias','add','index','4225990DndwLh','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','using','trim','where','JOIN_INDEX_NOT_USABLE','push','unknown','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','INNER','length','cross','unavailable','map','natural','filter','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','left','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','exec','right','some','JOIN_INDEX_MISSING'];a231_0x4ffa=function(){return _0x4333c4;};return a231_0x4ffa();}function isSqlClauseKeyword(_0x123f9d){const _0x3eb85e=a231_0x412f;return new Set(['on',_0x3eb85e(0xc7),_0x3eb85e(0xc9),_0x3eb85e(0xb3),'inner',_0x3eb85e(0xd6),_0x3eb85e(0xd9),'full',_0x3eb85e(0xd0),_0x3eb85e(0xd3)])[_0x3eb85e(0xa6)](_0x123f9d);}function stripOuterParentheses(_0xe9b18){const _0x285e4f=a231_0x412f;let _0x673c0e=_0xe9b18[_0x285e4f(0xc8)]();while(_0x673c0e[_0x285e4f(0x9b)]('(')&&_0x673c0e[_0x285e4f(0x94)](')')){let _0x142289=0x0,_0x4477c0=!![];for(let _0x357bb2=0x0;_0x357bb2<_0x673c0e['length'];_0x357bb2+=0x1){if(_0x673c0e[_0x357bb2]==='(')_0x142289+=0x1;if(_0x673c0e[_0x357bb2]===')')_0x142289-=0x1;if(_0x142289===0x0&&_0x357bb2<_0x673c0e['length']-0x1){_0x4477c0=![];break;}}if(!_0x4477c0||_0x142289!==0x0)break;_0x673c0e=_0x673c0e['slice'](0x1,-0x1)[_0x285e4f(0xc8)]();}return _0x673c0e;}
@@ -1 +1 @@
1
- function a239_0x11ae(_0x15c881,_0x3c9b81){_0x15c881=_0x15c881-0x105;const _0xa13fd0=a239_0xa13f();let _0x11aeca=_0xa13fd0[_0x15c881];return _0x11aeca;}const a239_0x33b3ad=a239_0x11ae;(function(_0x2c9a8a,_0x299582){const _0x2981a8=a239_0x11ae,_0x8ea52a=_0x2c9a8a();while(!![]){try{const _0x8f6b82=-parseInt(_0x2981a8(0x111))/0x1*(parseInt(_0x2981a8(0x107))/0x2)+-parseInt(_0x2981a8(0x10b))/0x3+-parseInt(_0x2981a8(0x105))/0x4*(parseInt(_0x2981a8(0x10e))/0x5)+-parseInt(_0x2981a8(0x108))/0x6*(-parseInt(_0x2981a8(0x10f))/0x7)+parseInt(_0x2981a8(0x106))/0x8*(parseInt(_0x2981a8(0x10d))/0x9)+parseInt(_0x2981a8(0x113))/0xa*(parseInt(_0x2981a8(0x109))/0xb)+parseInt(_0x2981a8(0x10a))/0xc;if(_0x8f6b82===_0x299582)break;else _0x8ea52a['push'](_0x8ea52a['shift']());}catch(_0x13acec){_0x8ea52a['push'](_0x8ea52a['shift']());}}}(a239_0xa13f,0xc113b));function a239_0xa13f(){const _0xaef9fd=['sql-trash','117kzdwen','5705DgGofG','1799wPOOSD','sql.lock.json','3nDCigk','/sql','190GalxBG','2044Xkbyum','152584fURMSR','981382xiTYjq','19086YduBCT','900823SiYMjv','8718996KYUCUd','1506147zpRxoV'];a239_0xa13f=function(){return _0xaef9fd;};return a239_0xa13f();}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a239_0x33b3ad(0x110),TRASH_DIR_NAME=a239_0x33b3ad(0x10c);export function loadSqlProjectConfig(_0x26d641,_0x3755a1){const _0x1ed86d=a239_0x33b3ad,_0x4c8aa4=resolve(_0x3755a1??findProjectRootDirectory()),_0x3c2bbc=DOT_DIR+_0x1ed86d(0x112),_0x5a5ee2=_0x3c2bbc+'/'+_0x26d641;return{'projectRoot':_0x4c8aa4,'appCode':_0x26d641,'sqlWorkspaceRoot':_0x3c2bbc,'sqlRoot':_0x5a5ee2,'sqlRootDir':resolve(_0x4c8aa4,DOT_DIR,'sql',_0x26d641),'lockFilePath':resolve(_0x4c8aa4,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4c8aa4,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a232_0x4605bd=a232_0x19fd;function a232_0x19fd(_0x78ba63,_0x360af0){_0x78ba63=_0x78ba63-0x179;const _0x4ec20d=a232_0x4ec2();let _0x19fd7a=_0x4ec20d[_0x78ba63];return _0x19fd7a;}(function(_0x544918,_0x55deb8){const _0x5c3305=a232_0x19fd,_0x479c07=_0x544918();while(!![]){try{const _0x23302f=parseInt(_0x5c3305(0x17b))/0x1+-parseInt(_0x5c3305(0x17c))/0x2*(parseInt(_0x5c3305(0x17d))/0x3)+parseInt(_0x5c3305(0x185))/0x4*(-parseInt(_0x5c3305(0x180))/0x5)+parseInt(_0x5c3305(0x17a))/0x6+-parseInt(_0x5c3305(0x182))/0x7*(parseInt(_0x5c3305(0x179))/0x8)+parseInt(_0x5c3305(0x17e))/0x9*(parseInt(_0x5c3305(0x184))/0xa)+-parseInt(_0x5c3305(0x186))/0xb*(parseInt(_0x5c3305(0x183))/0xc);if(_0x23302f===_0x55deb8)break;else _0x479c07['push'](_0x479c07['shift']());}catch(_0x421990){_0x479c07['push'](_0x479c07['shift']());}}}(a232_0x4ec2,0xd17c2));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a232_0x4ec2(){const _0x15eb48=['.rabetbase','3675287ArnOLG','24JQEogp','5495410cchOnJ','32oMnBdo','922757oDrTyZ','16uJeZhM','5674758vFKvBK','1426126XpYRoD','9530YYQMdi','276riCvTr','27DeoBHD','sql','941410OrfHQJ'];a232_0x4ec2=function(){return _0x15eb48;};return a232_0x4ec2();}const DOT_DIR=a232_0x4605bd(0x181),LOCK_FILE_NAME='sql.lock.json',TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x11216d,_0x8fb847){const _0x2f0a9a=a232_0x4605bd,_0x39de56=resolve(_0x8fb847??findProjectRootDirectory()),_0x1ef4e5=DOT_DIR+'/sql',_0x3dec8e=_0x1ef4e5+'/'+_0x11216d;return{'projectRoot':_0x39de56,'appCode':_0x11216d,'sqlWorkspaceRoot':_0x1ef4e5,'sqlRoot':_0x3dec8e,'sqlRootDir':resolve(_0x39de56,DOT_DIR,_0x2f0a9a(0x17f),_0x11216d),'lockFilePath':resolve(_0x39de56,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x39de56,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x359810,_0x4beee1){const _0x1c8135=a240_0x5a94,_0x429d97=_0x359810();while(!![]){try{const _0x3bcf68=parseInt(_0x1c8135(0x101))/0x1+parseInt(_0x1c8135(0x113))/0x2+-parseInt(_0x1c8135(0x103))/0x3*(parseInt(_0x1c8135(0x10d))/0x4)+-parseInt(_0x1c8135(0x10f))/0x5+parseInt(_0x1c8135(0x100))/0x6+parseInt(_0x1c8135(0x10b))/0x7+-parseInt(_0x1c8135(0x110))/0x8*(parseInt(_0x1c8135(0x106))/0x9);if(_0x3bcf68===_0x4beee1)break;else _0x429d97['push'](_0x429d97['shift']());}catch(_0x27a5b6){_0x429d97['push'](_0x429d97['shift']());}}}(a240_0x5496,0x869ff));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x49df7f){const _0x4870f6=a240_0x5a94;if(_0x49df7f==='.sql')return _0x4870f6(0x104);if(_0x49df7f===_0x4870f6(0xf8))return _0x4870f6(0xff);return undefined;}function a240_0x5496(){const _0x30198d=['mybatisXml','5494926auCOBG','870420mMKTFt','path','691791DCzmNS','sql','toLowerCase','657WdGkgn','sqlRootDir','isDirectory','mode','split','1571157Nfqtji','isFile','12ZCjNiQ','dbName','5195790xfjVNw','23176IJmDib','length','code','966322iOPomR','name','.xml','sqlCode','sqlName','dbId','push','slice','replace'];a240_0x5496=function(){return _0x30198d;};return a240_0x5496();}async function scanSqlFilesRecursively(_0x5054e4,_0xacc760){const _0x2fe3f9=a240_0x5a94,_0x3a3080=[];try{const _0x36235f=await readdir(_0x5054e4,{'withFileTypes':!![]});for(const _0x5278de of _0x36235f){const _0x400320=join(_0x5054e4,_0x5278de['name']);if(_0x5278de[_0x2fe3f9(0x108)]()){_0x3a3080[_0x2fe3f9(0xfc)](...await scanSqlFilesRecursively(_0x400320,_0xacc760));continue;}if(!_0x5278de[_0x2fe3f9(0x10c)]())continue;const _0x4393fa=extname(_0x5278de[_0x2fe3f9(0xf7)])[_0x2fe3f9(0x105)](),_0x5abbff=extensionToMode(_0x4393fa);if(!_0x5abbff)continue;const _0x5a89db=relative(_0xacc760,_0x400320)[_0x2fe3f9(0xfe)](/\\/g,'/'),_0xc7ac4a=_0x5a89db[_0x2fe3f9(0x10a)]('/')['filter'](Boolean),_0x251009=parseSqlPath(_0xc7ac4a,_0x5278de['name'],_0x4393fa);if(!_0x251009)continue;_0x3a3080[_0x2fe3f9(0xfc)]({'sqlCode':_0x251009[_0x2fe3f9(0xf9)],'sqlName':_0x251009['sqlName'],'dbDirectory':_0xc7ac4a[0x0],'filePath':_0x400320,'relativePath':_0x5a89db,'lockKey':_0x251009[_0x2fe3f9(0xf9)],'mode':_0x5abbff});}}catch(_0x362f07){if(_0x362f07[_0x2fe3f9(0x112)]!=='ENOENT')throw _0x362f07;}return _0x3a3080;}export async function scanLocalSqlQueries(_0x3ca299){const _0x88a964=a240_0x5a94;return scanSqlFilesRecursively(_0x3ca299[_0x88a964(0x107)],_0x3ca299[_0x88a964(0x107)]);}export function resolveLocalSqlFilePath(_0xbe2da0,_0x1e879b,_0x49dd8){const _0x170ce4=a240_0x5a94,_0x4a2acc=_0x49dd8?.[_0x170ce4(0x102)]||(_0x49dd8?.[_0x170ce4(0xfa)]||_0x49dd8?.[_0x170ce4(0x10e)]?buildSqlRelativePath(_0x1e879b,_0x49dd8?.[_0x170ce4(0xfa)],_0x49dd8?.['dbName'],_0x49dd8?.[_0x170ce4(0x109)]||_0x170ce4(0x104),_0x49dd8?.[_0x170ce4(0xfb)]):buildDefaultSqlFileName(_0x1e879b,_0x49dd8?.[_0x170ce4(0x109)]||_0x170ce4(0x104)));return join(_0xbe2da0['sqlRootDir'],_0x4a2acc);}export async function directoryExists(_0x1153b3){const _0x116ee7=a240_0x5a94;try{const _0x342fbd=await stat(_0x1153b3);return _0x342fbd[_0x116ee7(0x108)]();}catch{return![];}}function parseSqlPath(_0x2c8ff0,_0x2840f2,_0x4fec76){const _0xa04e7=a240_0x5a94,_0x3b4918=_0x2840f2[_0xa04e7(0xfd)](0x0,-_0x4fec76[_0xa04e7(0x111)]);if(_0x2c8ff0[_0xa04e7(0x111)]<0x2)return null;const _0x3ec18f=_0x3b4918['indexOf']('_');if(_0x3ec18f<=0x0||_0x3ec18f>=_0x3b4918[_0xa04e7(0x111)]-0x1)return null;const _0x2adc27=_0x3b4918[_0xa04e7(0xfd)](0x0,_0x3ec18f);if(!isLikelySqlCode(_0x2adc27))return null;return{'sqlCode':_0x2adc27,'sqlName':_0x3b4918[_0xa04e7(0xfd)](_0x3ec18f+0x1)};}function a240_0x5a94(_0x750dd6,_0x4ebaf3){_0x750dd6=_0x750dd6-0xf7;const _0x549603=a240_0x5496();let _0x5a946d=_0x549603[_0x750dd6];return _0x5a946d;}function isLikelySqlCode(_0x19e2a4){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0x19e2a4);}
1
+ (function(_0xf89736,_0x1dd754){const _0x48e38d=a233_0x42f0,_0x20b563=_0xf89736();while(!![]){try{const _0x48c400=-parseInt(_0x48e38d(0xa8))/0x1+-parseInt(_0x48e38d(0x9d))/0x2*(parseInt(_0x48e38d(0xa4))/0x3)+parseInt(_0x48e38d(0x99))/0x4*(-parseInt(_0x48e38d(0xaf))/0x5)+-parseInt(_0x48e38d(0xab))/0x6*(-parseInt(_0x48e38d(0x9f))/0x7)+-parseInt(_0x48e38d(0xa1))/0x8*(-parseInt(_0x48e38d(0xad))/0x9)+-parseInt(_0x48e38d(0xae))/0xa+parseInt(_0x48e38d(0xb2))/0xb;if(_0x48c400===_0x1dd754)break;else _0x20b563['push'](_0x20b563['shift']());}catch(_0x2e31ed){_0x20b563['push'](_0x20b563['shift']());}}}(a233_0x4632,0xa6885));function a233_0x42f0(_0xa88ad4,_0x2da6ae){_0xa88ad4=_0xa88ad4-0x97;const _0x4632d9=a233_0x4632();let _0x42f017=_0x4632d9[_0xa88ad4];return _0x42f017;}import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x14fc92){const _0x44f335=a233_0x42f0;if(_0x14fc92===_0x44f335(0xa3))return'sql';if(_0x14fc92===_0x44f335(0xa6))return'mybatisXml';return undefined;}async function scanSqlFilesRecursively(_0x195e8d,_0x4e0e15){const _0x252f68=a233_0x42f0,_0x358c87=[];try{const _0x4c42fc=await readdir(_0x195e8d,{'withFileTypes':!![]});for(const _0x1dd116 of _0x4c42fc){const _0x26d4e7=join(_0x195e8d,_0x1dd116[_0x252f68(0x98)]);if(_0x1dd116[_0x252f68(0x9c)]()){_0x358c87[_0x252f68(0xa5)](...await scanSqlFilesRecursively(_0x26d4e7,_0x4e0e15));continue;}if(!_0x1dd116['isFile']())continue;const _0xa87267=extname(_0x1dd116[_0x252f68(0x98)])['toLowerCase'](),_0x15aa13=extensionToMode(_0xa87267);if(!_0x15aa13)continue;const _0x198737=relative(_0x4e0e15,_0x26d4e7)[_0x252f68(0xac)](/\\/g,'/'),_0x19c548=_0x198737['split']('/')['filter'](Boolean),_0x554e36=parseSqlPath(_0x19c548,_0x1dd116['name'],_0xa87267);if(!_0x554e36)continue;_0x358c87[_0x252f68(0xa5)]({'sqlCode':_0x554e36[_0x252f68(0xa7)],'sqlName':_0x554e36[_0x252f68(0x97)],'dbDirectory':_0x19c548[0x0],'filePath':_0x26d4e7,'relativePath':_0x198737,'lockKey':_0x554e36[_0x252f68(0xa7)],'mode':_0x15aa13});}}catch(_0x5b25ee){if(_0x5b25ee[_0x252f68(0xa0)]!==_0x252f68(0x9e))throw _0x5b25ee;}return _0x358c87;}export async function scanLocalSqlQueries(_0x4e4dfe){const _0x2a197e=a233_0x42f0;return scanSqlFilesRecursively(_0x4e4dfe[_0x2a197e(0xa9)],_0x4e4dfe['sqlRootDir']);}function a233_0x4632(){const _0x4fef1c=['test','slice','34678908jDTXUP','sql','sqlName','name','545444EvthnC','length','dbName','isDirectory','254GXFEpF','ENOENT','133iTmwzR','code','4136yTqVeK','dbId','.sql','28302mbrqNz','push','.xml','sqlCode','476565EXaPaK','sqlRootDir','mode','183234QbyCSp','replace','2268IRzYCQ','5518260OKplJP','35GDbSeM'];a233_0x4632=function(){return _0x4fef1c;};return a233_0x4632();}export function resolveLocalSqlFilePath(_0x2c26dc,_0x324a66,_0x20c69c){const _0x4d4948=a233_0x42f0,_0x3c5ac0=_0x20c69c?.['path']||(_0x20c69c?.[_0x4d4948(0x97)]||_0x20c69c?.[_0x4d4948(0x9b)]?buildSqlRelativePath(_0x324a66,_0x20c69c?.['sqlName'],_0x20c69c?.['dbName'],_0x20c69c?.[_0x4d4948(0xaa)]||_0x4d4948(0xb3),_0x20c69c?.[_0x4d4948(0xa2)]):buildDefaultSqlFileName(_0x324a66,_0x20c69c?.[_0x4d4948(0xaa)]||_0x4d4948(0xb3)));return join(_0x2c26dc[_0x4d4948(0xa9)],_0x3c5ac0);}export async function directoryExists(_0x4c84c1){const _0x175d72=a233_0x42f0;try{const _0x230f9e=await stat(_0x4c84c1);return _0x230f9e[_0x175d72(0x9c)]();}catch{return![];}}function parseSqlPath(_0x323885,_0xe51eb0,_0x51a67b){const _0x3979cd=a233_0x42f0,_0x50cfe6=_0xe51eb0[_0x3979cd(0xb1)](0x0,-_0x51a67b['length']);if(_0x323885[_0x3979cd(0x9a)]<0x2)return null;const _0xf85ecd=_0x50cfe6['indexOf']('_');if(_0xf85ecd<=0x0||_0xf85ecd>=_0x50cfe6['length']-0x1)return null;const _0x437931=_0x50cfe6[_0x3979cd(0xb1)](0x0,_0xf85ecd);if(!isLikelySqlCode(_0x437931))return null;return{'sqlCode':_0x437931,'sqlName':_0x50cfe6[_0x3979cd(0xb1)](_0xf85ecd+0x1)};}function isLikelySqlCode(_0x210acd){const _0x58a926=a233_0x42f0;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x58a926(0xb0)](_0x210acd);}
@@ -1 +1 @@
1
- (function(_0x3c836e,_0x287aac){const _0x289a3b=a241_0x5ce3,_0x354db9=_0x3c836e();while(!![]){try{const _0x1dcc00=-parseInt(_0x289a3b(0xea))/0x1*(parseInt(_0x289a3b(0xf3))/0x2)+parseInt(_0x289a3b(0xec))/0x3+-parseInt(_0x289a3b(0xf0))/0x4+-parseInt(_0x289a3b(0xf5))/0x5+parseInt(_0x289a3b(0xf2))/0x6+-parseInt(_0x289a3b(0xf1))/0x7*(parseInt(_0x289a3b(0xe8))/0x8)+parseInt(_0x289a3b(0xed))/0x9;if(_0x1dcc00===_0x287aac)break;else _0x354db9['push'](_0x354db9['shift']());}catch(_0x48d85d){_0x354db9['push'](_0x354db9['shift']());}}}(a241_0x5ae9,0xca91c));import{readFile}from'node:fs/promises';import a241_0x484e8b from'node:crypto';function a241_0x5ae9(){const _0x381c68=['2460900NSTaoZ','917QfToXX','2442936LxeviN','14980Zduiwf','utf8','7621060NTcEaw','52776fnjTWm','digest','19swRIqc','hex','4713075EVNvhY','17977473xuQtwY','createHash','md5'];a241_0x5ae9=function(){return _0x381c68;};return a241_0x5ae9();}function a241_0x5ce3(_0x9d92f1,_0x5800eb){_0x9d92f1=_0x9d92f1-0xe8;const _0x5ae93a=a241_0x5ae9();let _0x5ce346=_0x5ae93a[_0x9d92f1];return _0x5ce346;}export function computeSqlContentHash(_0x57fed6){const _0x2a1bf8=a241_0x5ce3;return a241_0x484e8b[_0x2a1bf8(0xee)](_0x2a1bf8(0xef))['update'](_0x57fed6)[_0x2a1bf8(0xe9)](_0x2a1bf8(0xeb));}export async function computeSqlFileHash(_0x45cab7){const _0x551368=a241_0x5ce3,_0x25ca99=await readFile(_0x45cab7,_0x551368(0xf4));return computeSqlContentHash(_0x25ca99);}
1
+ (function(_0x43c319,_0xb14ff5){const _0x36d9de=a234_0x4563,_0x11ffd1=_0x43c319();while(!![]){try{const _0x7929c0=-parseInt(_0x36d9de(0x72))/0x1*(-parseInt(_0x36d9de(0x71))/0x2)+-parseInt(_0x36d9de(0x6e))/0x3+-parseInt(_0x36d9de(0x70))/0x4*(parseInt(_0x36d9de(0x6c))/0x5)+-parseInt(_0x36d9de(0x73))/0x6*(parseInt(_0x36d9de(0x6b))/0x7)+parseInt(_0x36d9de(0x6f))/0x8+parseInt(_0x36d9de(0x74))/0x9+-parseInt(_0x36d9de(0x69))/0xa;if(_0x7929c0===_0xb14ff5)break;else _0x11ffd1['push'](_0x11ffd1['shift']());}catch(_0x4afb1d){_0x11ffd1['push'](_0x11ffd1['shift']());}}}(a234_0x354b,0x6696d));import{readFile}from'node:fs/promises';function a234_0x354b(){const _0x2faede=['4OQbfSc','62pzAoHl','7937RAbrzO','1363170XEDMdi','7287633oMkLPc','975510bvtAql','digest','7esbHUB','1561205LVYXdD','md5','2182095ovyuih','5830184xEyxKk'];a234_0x354b=function(){return _0x2faede;};return a234_0x354b();}import a234_0x365835 from'node:crypto';function a234_0x4563(_0x8fc8b5,_0x5a90a7){_0x8fc8b5=_0x8fc8b5-0x69;const _0x354bd5=a234_0x354b();let _0x456334=_0x354bd5[_0x8fc8b5];return _0x456334;}export function computeSqlContentHash(_0x51cdda){const _0x54a447=a234_0x4563;return a234_0x365835['createHash'](_0x54a447(0x6d))['update'](_0x51cdda)[_0x54a447(0x6a)]('hex');}export async function computeSqlFileHash(_0x18e7c5){const _0x3a0a92=await readFile(_0x18e7c5,'utf8');return computeSqlContentHash(_0x3a0a92);}
@@ -1 +1 @@
1
- (function(_0x2b153c,_0xa6d986){const _0x257677=a242_0x3784,_0x690b57=_0x2b153c();while(!![]){try{const _0x5dadf1=parseInt(_0x257677(0x12a))/0x1+-parseInt(_0x257677(0x12b))/0x2+parseInt(_0x257677(0x131))/0x3*(-parseInt(_0x257677(0x134))/0x4)+-parseInt(_0x257677(0x132))/0x5+parseInt(_0x257677(0x128))/0x6+parseInt(_0x257677(0x12f))/0x7+parseInt(_0x257677(0x12c))/0x8*(parseInt(_0x257677(0x12e))/0x9);if(_0x5dadf1===_0xa6d986)break;else _0x690b57['push'](_0x690b57['shift']());}catch(_0x4e4481){_0x690b57['push'](_0x690b57['shift']());}}}(a242_0x3469,0xb53e2));import{mkdir,readFile,writeFile}from'node:fs/promises';function a242_0x3784(_0x5d36e6,_0x10a0e0){_0x5d36e6=_0x5d36e6-0x120;const _0x34691a=a242_0x3469();let _0x378469=_0x34691a[_0x5d36e6];return _0x378469;}import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x12fe64,_0x446d92,_0x5a2d66,_0x50f722){const _0x2f2875=a242_0x3784,_0x2a919d=_0x12fe64??createEmptySqlLock();let _0x44a3e7=_0x2a919d[_0x2f2875(0x123)][_0x446d92];if(!_0x44a3e7)return _0x44a3e7={'sqlRoot':_0x5a2d66,'lastSync':'','sqls':{}},_0x2a919d[_0x2f2875(0x123)][_0x446d92]=_0x44a3e7,{'lockData':_0x2a919d,'appLock':_0x44a3e7};if(!_0x44a3e7[_0x2f2875(0x129)])_0x44a3e7[_0x2f2875(0x129)]=_0x5a2d66;else{if(_0x44a3e7[_0x2f2875(0x129)]!==_0x5a2d66)throw new Error(_0x50f722+_0x2f2875(0x130)+_0x5a2d66+_0x2f2875(0x127)+_0x44a3e7[_0x2f2875(0x129)]+_0x2f2875(0x12d)+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x44a3e7[_0x2f2875(0x124)]&&(_0x44a3e7[_0x2f2875(0x124)]={}),!_0x44a3e7['lastSync']&&(_0x44a3e7[_0x2f2875(0x133)]=''),{'lockData':_0x2a919d,'appLock':_0x44a3e7};}export async function readSqlLockFile(_0x3005a3){const _0x32590b=a242_0x3784;try{const _0x3f624e=await readFile(_0x3005a3,_0x32590b(0x121));return JSON[_0x32590b(0x125)](_0x3f624e);}catch(_0x5057a3){if(_0x5057a3['code']===_0x32590b(0x126))return null;throw new Error(_0x32590b(0x122)+String(_0x5057a3));}}function a242_0x3469(){const _0x57d882=['ENOENT','\x22\x20vs\x20lock\x20\x22','3224616LtusTb','sqlRoot','300410nAKeyY','1784656McpBMW','1753312RWtUoD','\x22.\x20','99QNcZTW','2864183fTjjsi',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','41766gDtWuH','7400815llLfza','lastSync','156DdoMdf','stringify','utf8','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','apps','sqls','parse'];a242_0x3469=function(){return _0x57d882;};return a242_0x3469();}export async function writeSqlLockFile(_0x305702,_0x3d3589){const _0x4208e8=a242_0x3784;await mkdir(dirname(_0x305702),{'recursive':!![]}),await writeFile(_0x305702,JSON[_0x4208e8(0x120)](_0x3d3589,null,0x2),_0x4208e8(0x121));}
1
+ function a235_0x4860(_0x46e78f,_0x512b33){_0x46e78f=_0x46e78f-0xaa;const _0x4bfeff=a235_0x4bfe();let _0x4860e2=_0x4bfeff[_0x46e78f];return _0x4860e2;}(function(_0x571965,_0x1eb925){const _0x61b614=a235_0x4860,_0x1fe80e=_0x571965();while(!![]){try{const _0x53659f=parseInt(_0x61b614(0xb8))/0x1*(-parseInt(_0x61b614(0xc3))/0x2)+-parseInt(_0x61b614(0xac))/0x3*(parseInt(_0x61b614(0xbb))/0x4)+parseInt(_0x61b614(0xc2))/0x5*(-parseInt(_0x61b614(0xbd))/0x6)+-parseInt(_0x61b614(0xbe))/0x7*(parseInt(_0x61b614(0xb1))/0x8)+parseInt(_0x61b614(0xaf))/0x9+-parseInt(_0x61b614(0xb2))/0xa*(parseInt(_0x61b614(0xad))/0xb)+-parseInt(_0x61b614(0xae))/0xc*(-parseInt(_0x61b614(0xb6))/0xd);if(_0x53659f===_0x1eb925)break;else _0x1fe80e['push'](_0x1fe80e['shift']());}catch(_0x5545c6){_0x1fe80e['push'](_0x1fe80e['shift']());}}}(a235_0x4bfe,0x21710));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x269690,_0x2ef869,_0x55d2d8,_0x286ba0){const _0x53030a=a235_0x4860,_0x24c1eb=_0x269690??createEmptySqlLock();let _0x360fb8=_0x24c1eb['apps'][_0x2ef869];if(!_0x360fb8)return _0x360fb8={'sqlRoot':_0x55d2d8,'lastSync':'','sqls':{}},_0x24c1eb[_0x53030a(0xc0)][_0x2ef869]=_0x360fb8,{'lockData':_0x24c1eb,'appLock':_0x360fb8};if(!_0x360fb8[_0x53030a(0xc1)])_0x360fb8[_0x53030a(0xc1)]=_0x55d2d8;else{if(_0x360fb8['sqlRoot']!==_0x55d2d8)throw new Error(_0x286ba0+_0x53030a(0xb9)+_0x55d2d8+'\x22\x20vs\x20lock\x20\x22'+_0x360fb8['sqlRoot']+_0x53030a(0xb0)+_0x53030a(0xb4));}return!_0x360fb8[_0x53030a(0xaa)]&&(_0x360fb8[_0x53030a(0xaa)]={}),!_0x360fb8[_0x53030a(0xbf)]&&(_0x360fb8[_0x53030a(0xbf)]=''),{'lockData':_0x24c1eb,'appLock':_0x360fb8};}export async function readSqlLockFile(_0x4af2d8){const _0x547a12=a235_0x4860;try{const _0x45bfea=await readFile(_0x4af2d8,_0x547a12(0xbc));return JSON[_0x547a12(0xb3)](_0x45bfea);}catch(_0x34c5a5){if(_0x34c5a5[_0x547a12(0xba)]===_0x547a12(0xb7))return null;throw new Error(_0x547a12(0xab)+String(_0x34c5a5));}}function a235_0x4bfe(){const _0x1df037=['12506XqRuRD','ENOENT','2321TiIYKv',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','code','2012eJfWbr','utf8','6oDgvOw','14497OKOscw','lastSync','apps','sqlRoot','858235CEiCSU','198QNIbBS','sqls','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','21DVBtoS','6292PWpfbD','10392SJRyaw','286848twLYWk','\x22.\x20','216STSarS','4670ccCZFr','parse','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','stringify'];a235_0x4bfe=function(){return _0x1df037;};return a235_0x4bfe();}export async function writeSqlLockFile(_0x21d374,_0x7036a4){const _0x3dd3e6=a235_0x4860;await mkdir(dirname(_0x21d374),{'recursive':!![]}),await writeFile(_0x21d374,JSON[_0x3dd3e6(0xb5)](_0x7036a4,null,0x2),_0x3dd3e6(0xbc));}
@@ -1 +1 @@
1
- (function(_0x4b6c0b,_0x2b0326){const _0x2f44a4=a244_0xa131,_0x147729=_0x4b6c0b();while(!![]){try{const _0x150387=parseInt(_0x2f44a4(0x18e))/0x1+parseInt(_0x2f44a4(0x190))/0x2*(-parseInt(_0x2f44a4(0x18c))/0x3)+-parseInt(_0x2f44a4(0x18d))/0x4+parseInt(_0x2f44a4(0x188))/0x5+parseInt(_0x2f44a4(0x192))/0x6*(-parseInt(_0x2f44a4(0x187))/0x7)+parseInt(_0x2f44a4(0x183))/0x8*(parseInt(_0x2f44a4(0x193))/0x9)+parseInt(_0x2f44a4(0x194))/0xa;if(_0x150387===_0x2b0326)break;else _0x147729['push'](_0x147729['shift']());}catch(_0x5175b0){_0x147729['push'](_0x147729['shift']());}}}(a244_0x10d0,0x73f11));export function detectSqlMode(_0x5a32f6){const _0x2b7672=a244_0xa131,_0x56751e=_0x5a32f6[_0x2b7672(0x186)]();if(/^<(select|insert|update|delete)\b/i[_0x2b7672(0x18f)](_0x56751e))return _0x2b7672(0x191);return _0x2b7672(0x195);}function a244_0xa131(_0x1751ff,_0x59eaf9){_0x1751ff=_0x1751ff-0x183;const _0x10d012=a244_0x10d0();let _0xa1312a=_0x10d012[_0x1751ff];return _0xa1312a;}export function getSqlFileExtension(_0xadde02){const _0x1a7826=a244_0xa131;return _0xadde02===_0x1a7826(0x191)?_0x1a7826(0x196):_0x1a7826(0x18a);}export function buildDefaultSqlFileName(_0xa4909b,_0x19fa5c){return''+_0xa4909b+getSqlFileExtension(_0x19fa5c);}export function sanitizeSqlPathSegment(_0x513519,_0x32d74c){const _0x2eec64=a244_0xa131,_0x2ecd84=String(_0x513519??'')[_0x2eec64(0x185)](),_0x3280ed=_0x2ecd84[_0x2eec64(0x184)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x2eec64(0x184)](/\s+/g,'-')[_0x2eec64(0x184)](/-+/g,'-')['replace'](/^\.+/,'')[_0x2eec64(0x184)](/\.+$/,'')['replace'](/^-+/,'')[_0x2eec64(0x184)](/-+$/,'');return _0x3280ed||_0x32d74c;}function a244_0x10d0(){const _0x5abd16=['13538290UrYlHH','sql','.xml','unknown-sql','8yTUjFP','replace','trim','trimStart','147oEeADp','3227680ZKoctV','db-','.sql','unknown-db','2281602ZdUEgi','3438420bIarNL','398142FnZcPb','test','2VAcOth','mybatisXml','123408laGzxh','1165113fPXsCS'];a244_0x10d0=function(){return _0x5abd16;};return a244_0x10d0();}export function buildDbDirectoryName(_0x467136,_0x3f72ad){const _0x58ecd0=a244_0xa131;return sanitizeSqlPathSegment(_0x467136,_0x3f72ad!=null?_0x58ecd0(0x189)+_0x3f72ad:_0x58ecd0(0x18b));}export function buildSqlRelativePath(_0x4be788,_0x540bc4,_0x58d248,_0x280d9d,_0x506bc6){const _0x2b6833=a244_0xa131,_0x42442c=buildDbDirectoryName(_0x58d248,_0x506bc6),_0x322b73=sanitizeSqlPathSegment(_0x4be788,_0x2b6833(0x197)),_0xd1c93a=sanitizeSqlPathSegment(_0x540bc4,_0x322b73);return _0x42442c+'/'+_0x322b73+'_'+_0xd1c93a+getSqlFileExtension(_0x280d9d);}
1
+ (function(_0x2d44c5,_0x45d34a){const _0x4f0c3a=a237_0x21e9,_0x18e337=_0x2d44c5();while(!![]){try{const _0x53cbd8=-parseInt(_0x4f0c3a(0x1a1))/0x1+-parseInt(_0x4f0c3a(0x1a8))/0x2+parseInt(_0x4f0c3a(0x19e))/0x3*(-parseInt(_0x4f0c3a(0x1ac))/0x4)+-parseInt(_0x4f0c3a(0x1a5))/0x5+-parseInt(_0x4f0c3a(0x1ae))/0x6*(-parseInt(_0x4f0c3a(0x1a4))/0x7)+parseInt(_0x4f0c3a(0x1a3))/0x8*(-parseInt(_0x4f0c3a(0x1a6))/0x9)+parseInt(_0x4f0c3a(0x19c))/0xa*(parseInt(_0x4f0c3a(0x19f))/0xb);if(_0x53cbd8===_0x45d34a)break;else _0x18e337['push'](_0x18e337['shift']());}catch(_0xba8856){_0x18e337['push'](_0x18e337['shift']());}}}(a237_0x1c3a,0x5d9da));export function detectSqlMode(_0x24793c){const _0x5075e3=a237_0x21e9,_0x20202d=_0x24793c[_0x5075e3(0x1ad)]();if(/^<(select|insert|update|delete)\b/i[_0x5075e3(0x1af)](_0x20202d))return _0x5075e3(0x1a7);return _0x5075e3(0x19d);}export function getSqlFileExtension(_0x2d026f){const _0x1f082a=a237_0x21e9;return _0x2d026f==='mybatisXml'?_0x1f082a(0x1a9):_0x1f082a(0x1ab);}function a237_0x1c3a(){const _0x26904d=['sql','7503VerUyy','11QfExIK','trim','206233vupoAw','unknown-sql','1559920BbAHnq','2961MFBEqR','918805nxycEw','27ukRLSY','mybatisXml','1378148tNVuuE','.xml','replace','.sql','1196LYpSFt','trimStart','4998tYWUzm','test','24429280XmNbRg'];a237_0x1c3a=function(){return _0x26904d;};return a237_0x1c3a();}function a237_0x21e9(_0x4621d9,_0x10374b){_0x4621d9=_0x4621d9-0x19c;const _0x1c3a1a=a237_0x1c3a();let _0x21e998=_0x1c3a1a[_0x4621d9];return _0x21e998;}export function buildDefaultSqlFileName(_0x245396,_0x1744a9){return''+_0x245396+getSqlFileExtension(_0x1744a9);}export function sanitizeSqlPathSegment(_0x43349b,_0x45aba6){const _0x13510a=a237_0x21e9,_0x296ec8=String(_0x43349b??'')[_0x13510a(0x1a0)](),_0xf16e05=_0x296ec8['replace'](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x13510a(0x1aa)](/\s+/g,'-')[_0x13510a(0x1aa)](/-+/g,'-')[_0x13510a(0x1aa)](/^\.+/,'')['replace'](/\.+$/,'')[_0x13510a(0x1aa)](/^-+/,'')[_0x13510a(0x1aa)](/-+$/,'');return _0xf16e05||_0x45aba6;}export function buildDbDirectoryName(_0x5500ca,_0x170e4b){return sanitizeSqlPathSegment(_0x5500ca,_0x170e4b!=null?'db-'+_0x170e4b:'unknown-db');}export function buildSqlRelativePath(_0x2d9be4,_0x118e71,_0x1e53cb,_0xf034b6,_0x499010){const _0x701586=a237_0x21e9,_0x38f142=buildDbDirectoryName(_0x1e53cb,_0x499010),_0xd46e50=sanitizeSqlPathSegment(_0x2d9be4,_0x701586(0x1a2)),_0x4bee50=sanitizeSqlPathSegment(_0x118e71,_0xd46e50);return _0x38f142+'/'+_0xd46e50+'_'+_0x4bee50+getSqlFileExtension(_0xf034b6);}
@@ -1 +1 @@
1
- const a245_0xb0bce7=a245_0x20e2;(function(_0x183541,_0x1aa795){const _0x3d8247=a245_0x20e2,_0x17e939=_0x183541();while(!![]){try{const _0x4516d5=-parseInt(_0x3d8247(0x156))/0x1+parseInt(_0x3d8247(0x17a))/0x2+parseInt(_0x3d8247(0x15a))/0x3*(parseInt(_0x3d8247(0x149))/0x4)+parseInt(_0x3d8247(0x145))/0x5+-parseInt(_0x3d8247(0x160))/0x6+parseInt(_0x3d8247(0x17b))/0x7*(parseInt(_0x3d8247(0x146))/0x8)+-parseInt(_0x3d8247(0x153))/0x9*(-parseInt(_0x3d8247(0x191))/0xa);if(_0x4516d5===_0x1aa795)break;else _0x17e939['push'](_0x17e939['shift']());}catch(_0x559f90){_0x17e939['push'](_0x17e939['shift']());}}}(a245_0x2860,0xac60a));const MYBATIS_OUTER_TAGS=new Map([[a245_0xb0bce7(0x180),a245_0xb0bce7(0x164)],[a245_0xb0bce7(0x142),'INSERT'],['update',a245_0xb0bce7(0x157)],['delete',a245_0xb0bce7(0x168)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a245_0xb0bce7(0x198),'foreach','choose',a245_0xb0bce7(0x15d),a245_0xb0bce7(0x17f),'trim',a245_0xb0bce7(0x143),a245_0xb0bce7(0x182),a245_0xb0bce7(0x17c),a245_0xb0bce7(0x155)]),MYBATIS_BRANCH_TAGS=new Set(['if',a245_0xb0bce7(0x177),a245_0xb0bce7(0x181),'when',a245_0xb0bce7(0x17f)]);export const MYBATIS_DYNAMIC_START_MARKER=a245_0xb0bce7(0x18b);export const MYBATIS_DYNAMIC_END_MARKER='__RABETBASE_MYBATIS_DYNAMIC_END__';function a245_0x20e2(_0x21a10a,_0x504881){_0x21a10a=_0x21a10a-0x141;const _0x2860ab=a245_0x2860();let _0x20e2d8=_0x2860ab[_0x21a10a];return _0x20e2d8;}export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT=a245_0xb0bce7(0x176),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a245_0xb0bce7(0x18a)+[...MYBATIS_OUTER_TAGS[a245_0xb0bce7(0x14f)]()][a245_0xb0bce7(0x172)]('|')+')\x5cb','i');export function normalizeSqlForStaticAnalysis(_0x1e4dd9){const _0x39e61b=a245_0xb0bce7,_0x243cb0=typeof _0x1e4dd9===_0x39e61b(0x163)?_0x1e4dd9:'';if(!startsWithMybatisStatementWrapper(_0x243cb0))return{'sql':_0x243cb0,'mode':'sql'};let _0x24cbec=0x0,_0x415c41='',_0x1aadee,_0x4aa199=![],_0x522506=![];const _0x373199=[];while(_0x24cbec<_0x243cb0['length']){if(_0x243cb0[_0x39e61b(0x170)](_0x39e61b(0x19d),_0x24cbec)){const _0x3a14e3=_0x243cb0[_0x39e61b(0x16c)](_0x39e61b(0x16d),_0x24cbec+0x4);if(_0x3a14e3<0x0)return invalidMybatisSource(_0x39e61b(0x14a));_0x415c41+='\x20',_0x24cbec=_0x3a14e3+0x3;continue;}if(_0x243cb0[_0x39e61b(0x170)](_0x39e61b(0x166),_0x24cbec)){if(!_0x4aa199||_0x522506)return invalidMybatisSource(_0x39e61b(0x152));const _0x2f25b2=_0x243cb0[_0x39e61b(0x16c)](_0x39e61b(0x184),_0x24cbec+0x9);if(_0x2f25b2<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x415c41+=_0x243cb0[_0x39e61b(0x183)](_0x24cbec+0x9,_0x2f25b2),_0x24cbec=_0x2f25b2+0x3;continue;}if(_0x243cb0[_0x39e61b(0x170)]('<?',_0x24cbec)){if(_0x4aa199)return invalidMybatisSource(_0x39e61b(0x14e));const _0x2b8eac=_0x243cb0[_0x39e61b(0x16c)]('?>',_0x24cbec+0x2);if(_0x2b8eac<0x0)return invalidMybatisSource(_0x39e61b(0x19b));_0x415c41+='\x20',_0x24cbec=_0x2b8eac+0x2;continue;}if(_0x243cb0[_0x24cbec]!=='<'){const _0x44bd56=_0x243cb0[_0x39e61b(0x16c)]('<',_0x24cbec),_0x3b5154=_0x44bd56<0x0?_0x243cb0['length']:_0x44bd56,_0x347da8=_0x243cb0[_0x39e61b(0x183)](_0x24cbec,_0x3b5154);if((!_0x4aa199||_0x522506)&&_0x347da8[_0x39e61b(0x141)]())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x4aa199&&!_0x522506){const _0x5a48f6=decodeXmlEntities(_0x347da8);if(_0x5a48f6===null)return invalidMybatisSource(_0x39e61b(0x18d));_0x415c41+=_0x5a48f6;}else _0x415c41+='\x20';_0x24cbec=_0x3b5154;continue;}const _0x1e4e56=findXmlTagEnd(_0x243cb0,_0x24cbec);if(_0x1e4e56<0x0)return invalidMybatisSource(_0x39e61b(0x15e));const _0x7c1168=_0x243cb0[_0x39e61b(0x183)](_0x24cbec,_0x1e4e56+0x1),_0x1842bb=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x39e61b(0x175)](_0x7c1168);if(!_0x1842bb)return invalidMybatisSource(_0x39e61b(0x194));const _0xfd02c0=_0x1842bb[0x1]==='/',_0xb1ddd0=_0x1842bb[0x2]??'',_0x3790d3=_0xb1ddd0[_0x39e61b(0x14b)](),_0x42be3e=_0x1842bb[0x3]??'',_0x184b45=_0x1842bb[0x4]==='/',_0x16f5b8=MYBATIS_OUTER_TAGS[_0x39e61b(0x165)](_0x3790d3);if(!_0x16f5b8&&!MYBATIS_DYNAMIC_TAGS[_0x39e61b(0x192)](_0x3790d3))return invalidMybatisSource(_0x39e61b(0x18e)+_0x3790d3+'>.');if(!_0x16f5b8&&_0xb1ddd0!==_0x3790d3)return invalidMybatisSource(_0x39e61b(0x16a)+_0xb1ddd0+'>.');if(_0xfd02c0){if(_0x42be3e['trim']()||_0x184b45)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0xb1ddd0+'>.');const _0x421a03=_0x373199['at'](-0x1);if(!_0x421a03||(_0x421a03[_0x39e61b(0x18c)]?_0x421a03['tagName']!==_0x3790d3:_0x421a03['rawName']!==_0xb1ddd0))return invalidMybatisSource(_0x39e61b(0x19c)+_0xb1ddd0+'>.');_0x373199['pop']();if(_0x421a03[_0x39e61b(0x18c)])_0x522506=!![];_0x415c41+=MYBATIS_BRANCH_TAGS[_0x39e61b(0x192)](_0x3790d3)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x42be3e))return invalidMybatisSource(_0x39e61b(0x193)+_0xb1ddd0+'>.');if(_0x3790d3===_0x39e61b(0x155)&&(!_0x184b45||_0x373199['at'](-0x1)?.['tagName']!=='include'))return invalidMybatisSource(_0x39e61b(0x14c));if(_0x16f5b8){if(_0x4aa199||_0x373199['length']>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x4aa199=!![],_0x522506=_0x184b45,_0x1aadee=_0x16f5b8;}else{if(!_0x4aa199||_0x522506)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<'+_0xb1ddd0+'>.');}_0x415c41+=_0x3790d3===_0x39e61b(0x198)?_0x39e61b(0x14d):_0x3790d3===_0x39e61b(0x143)?_0x39e61b(0x15b):_0x3790d3===_0x39e61b(0x17c)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x39e61b(0x192)](_0x3790d3)&&!_0x184b45?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x184b45&&_0x373199[_0x39e61b(0x189)]({'rawName':_0xb1ddd0,'tagName':_0x3790d3,'outer':!!_0x16f5b8});}_0x24cbec=_0x1e4e56+0x1;}if(_0x373199[_0x39e61b(0x178)]>0x0)return invalidMybatisSource(_0x39e61b(0x161)+_0x373199['at'](-0x1)?.[_0x39e61b(0x18f)]+'>.');if(!_0x4aa199||!_0x522506)return invalidMybatisSource('MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.');return{'sql':_0x415c41[_0x39e61b(0x141)](),'mode':_0x39e61b(0x196),..._0x1aadee?{'statementType':_0x1aadee}:{}};}function hasWellFormedXmlAttributes(_0x4dddb2){const _0x4efc10=a245_0xb0bce7;let _0x2142fa=0x0;const _0xc52330=new Set();while(_0x2142fa<_0x4dddb2[_0x4efc10(0x178)]){while(_0x2142fa<_0x4dddb2[_0x4efc10(0x178)]&&/\s/[_0x4efc10(0x190)](_0x4dddb2[_0x2142fa]??''))_0x2142fa+=0x1;if(_0x2142fa>=_0x4dddb2['length'])return!![];const _0x126e7f=/^[A-Za-z_:][\w:.-]*/[_0x4efc10(0x175)](_0x4dddb2[_0x4efc10(0x183)](_0x2142fa)),_0x59c726=_0x126e7f?.[0x0];if(!_0x59c726||_0xc52330[_0x4efc10(0x192)](_0x59c726))return![];_0xc52330[_0x4efc10(0x188)](_0x59c726),_0x2142fa+=_0x59c726['length'];while(_0x2142fa<_0x4dddb2[_0x4efc10(0x178)]&&/\s/['test'](_0x4dddb2[_0x2142fa]??''))_0x2142fa+=0x1;if(_0x4dddb2[_0x2142fa]!=='=')return![];_0x2142fa+=0x1;while(_0x2142fa<_0x4dddb2[_0x4efc10(0x178)]&&/\s/[_0x4efc10(0x190)](_0x4dddb2[_0x2142fa]??''))_0x2142fa+=0x1;const _0x5371f1=_0x4dddb2[_0x2142fa];if(_0x5371f1!=='\x22'&&_0x5371f1!=='\x27')return![];_0x2142fa+=0x1;const _0x1c39dc=_0x4dddb2[_0x4efc10(0x16c)](_0x5371f1,_0x2142fa);if(_0x1c39dc<0x0)return![];if(decodeXmlEntities(_0x4dddb2[_0x4efc10(0x183)](_0x2142fa,_0x1c39dc))===null)return![];_0x2142fa=_0x1c39dc+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x55df47){const _0x4c5347=a245_0xb0bce7;let _0x828687=0x0;const _0x2988c7=()=>{while(_0x828687<_0x55df47['length']&&/\s/['test'](_0x55df47[_0x828687]??''))_0x828687+=0x1;};_0x2988c7();while(_0x828687<_0x55df47[_0x4c5347(0x178)]){if(_0x55df47[_0x4c5347(0x170)](_0x4c5347(0x19d),_0x828687)){const _0x3dfd14=_0x55df47[_0x4c5347(0x16c)](_0x4c5347(0x16d),_0x828687+0x4);if(_0x3dfd14<0x0)return!![];_0x828687=_0x3dfd14+0x3,_0x2988c7();continue;}if(_0x55df47[_0x4c5347(0x170)]('<?',_0x828687)){const _0xdb257c=_0x55df47[_0x4c5347(0x16c)]('?>',_0x828687+0x2);if(_0xdb257c<0x0)return!![];_0x828687=_0xdb257c+0x2,_0x2988c7();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x4c5347(0x190)](_0x55df47[_0x4c5347(0x183)](_0x828687));}function invalidMybatisSource(_0xe60576){const _0x3011b0=a245_0xb0bce7;return{'sql':'','mode':_0x3011b0(0x196),'error':_0xe60576};}function findXmlTagEnd(_0x319100,_0x10c19a){const _0x357035=a245_0xb0bce7;let _0x42d70b;for(let _0x573b2b=_0x10c19a+0x1;_0x573b2b<_0x319100[_0x357035(0x178)];_0x573b2b+=0x1){const _0x39de55=_0x319100[_0x573b2b];if(_0x42d70b){if(_0x39de55===_0x42d70b)_0x42d70b=undefined;continue;}if(_0x39de55==='\x22'||_0x39de55==='\x27'){_0x42d70b=_0x39de55;continue;}if(_0x39de55==='>')return _0x573b2b;}return-0x1;}function decodeXmlEntities(_0x1dab68){const _0x61614d=a245_0xb0bce7;let _0x4fd5eb=![];const _0x2511c7=_0x1dab68[_0x61614d(0x174)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x36fe73=>{const _0x18d76b=_0x61614d;if(_0x36fe73==='&lt;')return'<';if(_0x36fe73==='&gt;')return'>';if(_0x36fe73===_0x18d76b(0x171))return'\x22';if(_0x36fe73===_0x18d76b(0x150))return'\x27';if(_0x36fe73===_0x18d76b(0x15f))return'&';const _0x26a663=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x18d76b(0x175)](_0x36fe73);if(_0x26a663){const _0x4347f4=_0x26a663[0x1],_0x585c03=_0x26a663[0x2],_0x5c79c4=Number[_0x18d76b(0x17d)](_0x4347f4??_0x585c03??'',_0x4347f4?0x10:0xa);if(isValidXmlCharacter(_0x5c79c4))return String['fromCodePoint'](_0x5c79c4);}return _0x4fd5eb=!![],'';});return _0x4fd5eb?null:_0x2511c7;}function isValidXmlCharacter(_0x537ef2){return _0x537ef2===0x9||_0x537ef2===0xa||_0x537ef2===0xd||_0x537ef2>=0x20&&_0x537ef2<=0xd7ff||_0x537ef2>=0xe000&&_0x537ef2<=0xfffd||_0x537ef2>=0x10000&&_0x537ef2<=0x10ffff;}export function detectSqlType(_0x1e0e67){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x1e0e67));}function detectNormalizedSqlType(_0x12070c){const _0x39a056=a245_0xb0bce7;if(_0x12070c[_0x39a056(0x158)])return{'type':_0x39a056(0x16b),'isSelectOnly':![],'isDangerous':![],'reason':_0x12070c['error']};if(!_0x12070c[_0x39a056(0x151)]['trim']())return{'type':_0x39a056(0x16b),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x26137a=stripStaticAnalysisMarkers(_0x12070c[_0x39a056(0x151)])['replace'](/#\{[^}]*\}/g,'?')[_0x39a056(0x174)](/\$\{[^}]*\}/g,'?')[_0x39a056(0x174)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x39a056(0x174)](/\/\*[\s\S]*?\*\//g,'')[_0x39a056(0x141)](),_0x16c932=_0x26137a[_0x39a056(0x195)]('\x0a');let _0x5694f6='';for(const _0x2e0503 of _0x16c932){const _0x27591d=_0x2e0503[_0x39a056(0x141)]();if(!_0x27591d||_0x27591d[_0x39a056(0x170)]('--')||_0x27591d[_0x39a056(0x170)]('/*'))continue;_0x5694f6=_0x27591d;break;}const _0x4b073f=_0x5694f6[_0x39a056(0x16f)](),_0x5a5925=_0x12070c['statementType'],_0x55c8ca=maskSqlTextForBlockedKeywordScan(_0x26137a),_0x1bacd4=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i['test'](_0x55c8ca);if(_0x5a5925==='SELECT'||!_0x5a5925&&(_0x4b073f[_0x39a056(0x170)](_0x39a056(0x164))||_0x4b073f[_0x39a056(0x170)](_0x39a056(0x15c)))){const _0x2a7f39=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x39a056(0x190)](_0x26137a);return{'type':_0x39a056(0x164),'isSelectOnly':!_0x2a7f39,'isDangerous':_0x2a7f39,'reason':_0x2a7f39?_0x39a056(0x187):undefined};}if(_0x5a5925===_0x39a056(0x186)||!_0x5a5925&&_0x4b073f['startsWith'](_0x39a056(0x186)))return{'type':_0x39a056(0x186),'isSelectOnly':![],'isDangerous':_0x1bacd4,'reason':_0x1bacd4?_0x39a056(0x162):undefined};if(_0x5a5925===_0x39a056(0x157)||!_0x5a5925&&_0x4b073f['startsWith'](_0x39a056(0x157)))return{'type':_0x39a056(0x157),'isSelectOnly':![],'isDangerous':_0x1bacd4,'reason':_0x1bacd4?_0x39a056(0x162):undefined};if(_0x5a5925===_0x39a056(0x168)||!_0x5a5925&&_0x4b073f['startsWith'](_0x39a056(0x168)))return{'type':_0x39a056(0x168),'isSelectOnly':![],'isDangerous':!![],'reason':_0x39a056(0x16e)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x39a056(0x190)](_0x4b073f))return{'type':_0x39a056(0x173),'isSelectOnly':![],'isDangerous':!![],'reason':_0x39a056(0x199)};return{'type':_0x39a056(0x16b),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x3fcfb6){const _0xf60fc7=a245_0xb0bce7;return _0x3fcfb6[_0xf60fc7(0x169)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0xf60fc7(0x169)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x35680e){const _0xd24a02=a245_0xb0bce7;return _0x35680e[_0xd24a02(0x174)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0xd24a02(0x174)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0xd24a02(0x174)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0xd24a02(0x174)](/--.*$/gm,'\x20')[_0xd24a02(0x174)](/#.*$/gm,'\x20')[_0xd24a02(0x174)](/\/\*[\s\S]*?\*\//g,'\x20');}function a245_0x2860(){const _0xbe34ab=['DDL','replace','exec','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','foreach','length','\x20query\x20targeting\x20','6782TNJYkP','1540oukJJs','include','parseInt','unknown\x20table(s)','otherwise','select','choose','bind','slice',']]>','type','INSERT','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','add','push','^<\x5cs*(?:','__RABETBASE_MYBATIS_DYNAMIC_START__','outer','Invalid\x20XML\x20entity\x20reference.','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','rawName','test','4750810sSsjRN','has','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','Invalid\x20MyBatis\x20XML\x20tag.','split','mybatisXml','\x20with\x20parameters:\x20','where','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','isDangerous','Unterminated\x20XML\x20declaration.','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','<!--','trim','insert','set','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','5501155xAhdvb','3288cRKjtm','matchAll','from','8mtmbzX','Unterminated\x20XML\x20comment.','toLowerCase','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','\x20WHERE\x20','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','keys','&apos;','sql','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','9Zacjdy','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','property','223853qFzIEn','UPDATE','error','match','772041IRKdeh','\x20SET\x20','WITH','when','Unterminated\x20MyBatis\x20XML\x20tag.','&amp;','7523436NAgDOg','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','string','SELECT','get','<![CDATA[','reason','DELETE','replaceAll','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','UNKNOWN','indexOf','-->','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','toUpperCase','startsWith','&quot;','join'];a245_0x2860=function(){return _0xbe34ab;};return a245_0x2860();}function extractTables(_0x5491d3){const _0x458b43=a245_0xb0bce7,_0x53fbe5=_0x5491d3[_0x458b43(0x174)](/#\{[^}]*\}/g,'?')[_0x458b43(0x174)](/\$\{[^}]*\}/g,'?')[_0x458b43(0x174)](/'[^']*'/g,'\x27\x27')[_0x458b43(0x174)](/--.*$/gm,'')[_0x458b43(0x174)](/\/\*[\s\S]*?\*\//g,''),_0x3a3427=[],_0x1a9bea=_0x53fbe5['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0x3a3427,_0x1a9bea?.[0x1]);for(const _0x32ac3b of _0x53fbe5[_0x458b43(0x147)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x3a3427,_0x32ac3b[0x1]);}const _0x13c496=_0x53fbe5[_0x458b43(0x159)](/INTO\s+([^\s(]+)/i);addTable(_0x3a3427,_0x13c496?.[0x1]);const _0x3e60f1=_0x53fbe5[_0x458b43(0x159)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x3a3427,_0x3e60f1?.[0x1]),_0x3a3427;}function addTable(_0x26cace,_0x48b6f1){const _0x1c0dab=a245_0xb0bce7,_0x4db355=_0x48b6f1?.['replace'](/[`"]/g,'');_0x4db355&&_0x4db355!==UNRESOLVED_SQL_FRAGMENT&&!_0x26cace['includes'](_0x4db355)&&_0x26cace[_0x1c0dab(0x189)](_0x4db355);}function extractParameters(_0x3d094a){const _0x43fdec=a245_0xb0bce7,_0xe1e42d=new Set();for(const _0x49ea52 of _0x3d094a[_0x43fdec(0x147)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x49ea52[0x1])_0xe1e42d['add'](_0x49ea52[0x1]);}return Array[_0x43fdec(0x148)](_0xe1e42d);}export function validateSql(_0x3f2932){const _0x2f6114=a245_0xb0bce7,_0x4b8134=normalizeSqlForStaticAnalysis(_0x3f2932),_0x4a7893=detectNormalizedSqlType(_0x4b8134),_0x542bb9=stripStaticAnalysisMarkers(_0x4b8134['sql']),_0x31b815=_0x4b8134[_0x2f6114(0x158)]?[]:extractTables(_0x542bb9),_0x1dce48=_0x4b8134[_0x2f6114(0x158)]?[]:extractParameters(_0x542bb9);if(_0x4a7893[_0x2f6114(0x19a)])return{'valid':![],'sqlType':_0x4a7893,'tables':_0x31b815,'parameters':_0x1dce48,'message':_0x4a7893[_0x2f6114(0x167)]||_0x4a7893[_0x2f6114(0x185)]+_0x2f6114(0x154)};if(_0x4a7893[_0x2f6114(0x185)]===_0x2f6114(0x16b))return{'valid':![],'sqlType':_0x4a7893,'tables':_0x31b815,'parameters':_0x1dce48,'message':_0x4b8134[_0x2f6114(0x158)]?'Unable\x20to\x20detect\x20SQL\x20type.\x20'+_0x4b8134[_0x2f6114(0x158)]:_0x2f6114(0x144)};return{'valid':!![],'sqlType':_0x4a7893,'tables':_0x31b815,'parameters':_0x1dce48,'message':_0x4a7893[_0x2f6114(0x185)]+_0x2f6114(0x179)+(_0x31b815[_0x2f6114(0x178)]?_0x31b815[_0x2f6114(0x172)](',\x20'):_0x2f6114(0x17e))+(_0x1dce48[_0x2f6114(0x178)]?_0x2f6114(0x197)+_0x1dce48[_0x2f6114(0x172)](',\x20'):'')};}
1
+ const a238_0x5b0503=a238_0x1b08;(function(_0x4ff72b,_0x1568ba){const _0x2ea590=a238_0x1b08,_0x13162e=_0x4ff72b();while(!![]){try{const _0x37740e=parseInt(_0x2ea590(0x1de))/0x1*(-parseInt(_0x2ea590(0x1b8))/0x2)+parseInt(_0x2ea590(0x1ba))/0x3+-parseInt(_0x2ea590(0x20e))/0x4*(-parseInt(_0x2ea590(0x1fa))/0x5)+parseInt(_0x2ea590(0x1c1))/0x6+parseInt(_0x2ea590(0x204))/0x7*(-parseInt(_0x2ea590(0x201))/0x8)+-parseInt(_0x2ea590(0x1f7))/0x9+parseInt(_0x2ea590(0x1c8))/0xa*(parseInt(_0x2ea590(0x1ee))/0xb);if(_0x37740e===_0x1568ba)break;else _0x13162e['push'](_0x13162e['shift']());}catch(_0x572b9d){_0x13162e['push'](_0x13162e['shift']());}}}(a238_0x14d3,0x9fa05));const MYBATIS_OUTER_TAGS=new Map([[a238_0x5b0503(0x1fe),'SELECT'],['insert',a238_0x5b0503(0x1b3)],[a238_0x5b0503(0x1e2),'UPDATE'],[a238_0x5b0503(0x1bb),'DELETE']]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a238_0x5b0503(0x1cd),a238_0x5b0503(0x1d5),'choose',a238_0x5b0503(0x203),a238_0x5b0503(0x1dd),a238_0x5b0503(0x1f4),a238_0x5b0503(0x20c),'bind',a238_0x5b0503(0x1be),a238_0x5b0503(0x1fc)]),MYBATIS_BRANCH_TAGS=new Set(['if','foreach','choose',a238_0x5b0503(0x203),'otherwise']);function a238_0x14d3(){const _0x4a7f7f=['&quot;','Unterminated\x20CDATA\x20section.','outer','<![CDATA[','otherwise','3CzNacE','includes','Unterminated\x20MyBatis\x20XML\x20tag.','SQL\x20content\x20is\x20empty','update','startsWith','DELETE','\x20SET\x20','&lt;','mybatisXml','&apos;','push','<!--','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','length','join','256993WPeoou','parseInt','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','matchAll','indexOf','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','trim','-->','error','7414596JTVbDa','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','isDangerous','1017305OLJrlz','__RABETBASE_MYBATIS_DYNAMIC_START__','property','Invalid\x20MyBatis\x20XML\x20tag.','select','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','split','232912WMtFHP','&amp;','when','238LaqSmZ','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','fromCodePoint','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save',']]>','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','Unterminated\x20XML\x20declaration.','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','set','has','16SvtLdG','string','test','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','Unable\x20to\x20detect\x20SQL\x20type.\x20','DDL','keys','INSERT','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','slice','get','59788dBgbSr','sql','584115ecyJEp','delete','Invalid\x20XML\x20entity\x20reference.','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','include','^<\x5cs*(?:','type','6208176LmKlsH','from','exec','SELECT','UPDATE','UNKNOWN','tagName','220jzQMYc','replace','unknown\x20table(s)','toUpperCase','__RABETBASE_MYBATIS_DYNAMIC_END__','where','\x20with\x20parameters:\x20',')\x5cb','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','rawName','match','add','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','foreach','toLowerCase','replaceAll','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<'];a238_0x14d3=function(){return _0x4a7f7f;};return a238_0x14d3();}function a238_0x1b08(_0x47b387,_0x346de0){_0x47b387=_0x47b387-0x1b1;const _0x14d365=a238_0x14d3();let _0x1b082d=_0x14d365[_0x47b387];return _0x1b082d;}export const MYBATIS_DYNAMIC_START_MARKER=a238_0x5b0503(0x1fb);export const MYBATIS_DYNAMIC_END_MARKER=a238_0x5b0503(0x1cc);export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT='__RABETBASE_UNRESOLVED_SQL_FRAGMENT__',MYBATIS_OUTER_TAG_PATTERN=new RegExp(a238_0x5b0503(0x1bf)+[...MYBATIS_OUTER_TAGS[a238_0x5b0503(0x1b2)]()][a238_0x5b0503(0x1ed)]('|')+a238_0x5b0503(0x1cf),'i');export function normalizeSqlForStaticAnalysis(_0x1c51ba){const _0x439129=a238_0x5b0503,_0x8c0ca5=typeof _0x1c51ba===_0x439129(0x20f)?_0x1c51ba:'';if(!startsWithMybatisStatementWrapper(_0x8c0ca5))return{'sql':_0x8c0ca5,'mode':_0x439129(0x1b9)};let _0x1da474=0x0,_0x18ae1d='',_0x3363b9,_0xf5f5c7=![],_0x23929d=![];const _0x31a9ce=[];while(_0x1da474<_0x8c0ca5[_0x439129(0x1ec)]){if(_0x8c0ca5['startsWith']('<!--',_0x1da474)){const _0x16657a=_0x8c0ca5[_0x439129(0x1f2)](_0x439129(0x1f5),_0x1da474+0x4);if(_0x16657a<0x0)return invalidMybatisSource('Unterminated\x20XML\x20comment.');_0x18ae1d+='\x20',_0x1da474=_0x16657a+0x3;continue;}if(_0x8c0ca5[_0x439129(0x1e3)](_0x439129(0x1dc),_0x1da474)){if(!_0xf5f5c7||_0x23929d)return invalidMybatisSource(_0x439129(0x211));const _0x275d68=_0x8c0ca5[_0x439129(0x1f2)](_0x439129(0x208),_0x1da474+0x9);if(_0x275d68<0x0)return invalidMybatisSource(_0x439129(0x1da));_0x18ae1d+=_0x8c0ca5[_0x439129(0x1b6)](_0x1da474+0x9,_0x275d68),_0x1da474=_0x275d68+0x3;continue;}if(_0x8c0ca5[_0x439129(0x1e3)]('<?',_0x1da474)){if(_0xf5f5c7)return invalidMybatisSource(_0x439129(0x1eb));const _0x1630cc=_0x8c0ca5[_0x439129(0x1f2)]('?>',_0x1da474+0x2);if(_0x1630cc<0x0)return invalidMybatisSource(_0x439129(0x20a));_0x18ae1d+='\x20',_0x1da474=_0x1630cc+0x2;continue;}if(_0x8c0ca5[_0x1da474]!=='<'){const _0x44a7c5=_0x8c0ca5[_0x439129(0x1f2)]('<',_0x1da474),_0x51088e=_0x44a7c5<0x0?_0x8c0ca5[_0x439129(0x1ec)]:_0x44a7c5,_0x870ceb=_0x8c0ca5[_0x439129(0x1b6)](_0x1da474,_0x51088e);if((!_0xf5f5c7||_0x23929d)&&_0x870ceb[_0x439129(0x1f4)]())return invalidMybatisSource(_0x439129(0x209));if(_0xf5f5c7&&!_0x23929d){const _0x58b005=decodeXmlEntities(_0x870ceb);if(_0x58b005===null)return invalidMybatisSource(_0x439129(0x1bc));_0x18ae1d+=_0x58b005;}else _0x18ae1d+='\x20';_0x1da474=_0x51088e;continue;}const _0x20d09d=findXmlTagEnd(_0x8c0ca5,_0x1da474);if(_0x20d09d<0x0)return invalidMybatisSource(_0x439129(0x1e0));const _0x26f459=_0x8c0ca5[_0x439129(0x1b6)](_0x1da474,_0x20d09d+0x1),_0x301901=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x439129(0x1c3)](_0x26f459);if(!_0x301901)return invalidMybatisSource(_0x439129(0x1fd));const _0x842c4d=_0x301901[0x1]==='/',_0x5ade0a=_0x301901[0x2]??'',_0x411d72=_0x5ade0a[_0x439129(0x1d6)](),_0x2cd93b=_0x301901[0x3]??'',_0x11ffb4=_0x301901[0x4]==='/',_0x463a85=MYBATIS_OUTER_TAGS[_0x439129(0x1b7)](_0x411d72);if(!_0x463a85&&!MYBATIS_DYNAMIC_TAGS[_0x439129(0x20d)](_0x411d72))return invalidMybatisSource(_0x439129(0x1bd)+_0x411d72+'>.');if(!_0x463a85&&_0x5ade0a!==_0x411d72)return invalidMybatisSource(_0x439129(0x1d8)+_0x5ade0a+'>.');if(_0x842c4d){if(_0x2cd93b['trim']()||_0x11ffb4)return invalidMybatisSource(_0x439129(0x1ff)+_0x5ade0a+'>.');const _0x1c51f6=_0x31a9ce['at'](-0x1);if(!_0x1c51f6||(_0x1c51f6[_0x439129(0x1db)]?_0x1c51f6[_0x439129(0x1c7)]!==_0x411d72:_0x1c51f6[_0x439129(0x1d1)]!==_0x5ade0a))return invalidMybatisSource('Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x5ade0a+'>.');_0x31a9ce['pop']();if(_0x1c51f6['outer'])_0x23929d=!![];_0x18ae1d+=MYBATIS_BRANCH_TAGS[_0x439129(0x20d)](_0x411d72)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x2cd93b))return invalidMybatisSource(_0x439129(0x1f0)+_0x5ade0a+'>.');if(_0x411d72===_0x439129(0x1fc)&&(!_0x11ffb4||_0x31a9ce['at'](-0x1)?.[_0x439129(0x1c7)]!==_0x439129(0x1be)))return invalidMybatisSource('MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.');if(_0x463a85){if(_0xf5f5c7||_0x31a9ce[_0x439129(0x1ec)]>0x0)return invalidMybatisSource(_0x439129(0x1d4));_0xf5f5c7=!![],_0x23929d=_0x11ffb4,_0x3363b9=_0x463a85;}else{if(!_0xf5f5c7||_0x23929d)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<'+_0x5ade0a+'>.');}_0x18ae1d+=_0x411d72===_0x439129(0x1cd)?'\x20WHERE\x20':_0x411d72==='set'?_0x439129(0x1e5):_0x411d72===_0x439129(0x1be)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x439129(0x20d)](_0x411d72)&&!_0x11ffb4?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x11ffb4&&_0x31a9ce[_0x439129(0x1e9)]({'rawName':_0x5ade0a,'tagName':_0x411d72,'outer':!!_0x463a85});}_0x1da474=_0x20d09d+0x1;}if(_0x31a9ce[_0x439129(0x1ec)]>0x0)return invalidMybatisSource(_0x439129(0x205)+_0x31a9ce['at'](-0x1)?.[_0x439129(0x1d1)]+'>.');if(!_0xf5f5c7||!_0x23929d)return invalidMybatisSource(_0x439129(0x1b5));return{'sql':_0x18ae1d[_0x439129(0x1f4)](),'mode':'mybatisXml',..._0x3363b9?{'statementType':_0x3363b9}:{}};}function hasWellFormedXmlAttributes(_0x49ef66){const _0x2378a3=a238_0x5b0503;let _0x6139c2=0x0;const _0x2a78dc=new Set();while(_0x6139c2<_0x49ef66[_0x2378a3(0x1ec)]){while(_0x6139c2<_0x49ef66['length']&&/\s/[_0x2378a3(0x210)](_0x49ef66[_0x6139c2]??''))_0x6139c2+=0x1;if(_0x6139c2>=_0x49ef66['length'])return!![];const _0x84cb03=/^[A-Za-z_:][\w:.-]*/[_0x2378a3(0x1c3)](_0x49ef66[_0x2378a3(0x1b6)](_0x6139c2)),_0x2762c4=_0x84cb03?.[0x0];if(!_0x2762c4||_0x2a78dc[_0x2378a3(0x20d)](_0x2762c4))return![];_0x2a78dc[_0x2378a3(0x1d3)](_0x2762c4),_0x6139c2+=_0x2762c4['length'];while(_0x6139c2<_0x49ef66[_0x2378a3(0x1ec)]&&/\s/[_0x2378a3(0x210)](_0x49ef66[_0x6139c2]??''))_0x6139c2+=0x1;if(_0x49ef66[_0x6139c2]!=='=')return![];_0x6139c2+=0x1;while(_0x6139c2<_0x49ef66[_0x2378a3(0x1ec)]&&/\s/[_0x2378a3(0x210)](_0x49ef66[_0x6139c2]??''))_0x6139c2+=0x1;const _0x4ad802=_0x49ef66[_0x6139c2];if(_0x4ad802!=='\x22'&&_0x4ad802!=='\x27')return![];_0x6139c2+=0x1;const _0x35cc02=_0x49ef66[_0x2378a3(0x1f2)](_0x4ad802,_0x6139c2);if(_0x35cc02<0x0)return![];if(decodeXmlEntities(_0x49ef66[_0x2378a3(0x1b6)](_0x6139c2,_0x35cc02))===null)return![];_0x6139c2=_0x35cc02+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x32e071){const _0x9ca4d3=a238_0x5b0503;let _0x100df2=0x0;const _0x1dab6b=()=>{const _0x4fae4e=a238_0x1b08;while(_0x100df2<_0x32e071[_0x4fae4e(0x1ec)]&&/\s/['test'](_0x32e071[_0x100df2]??''))_0x100df2+=0x1;};_0x1dab6b();while(_0x100df2<_0x32e071['length']){if(_0x32e071['startsWith'](_0x9ca4d3(0x1ea),_0x100df2)){const _0x224974=_0x32e071[_0x9ca4d3(0x1f2)](_0x9ca4d3(0x1f5),_0x100df2+0x4);if(_0x224974<0x0)return!![];_0x100df2=_0x224974+0x3,_0x1dab6b();continue;}if(_0x32e071[_0x9ca4d3(0x1e3)]('<?',_0x100df2)){const _0x4b9dc2=_0x32e071[_0x9ca4d3(0x1f2)]('?>',_0x100df2+0x2);if(_0x4b9dc2<0x0)return!![];_0x100df2=_0x4b9dc2+0x2,_0x1dab6b();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x9ca4d3(0x210)](_0x32e071[_0x9ca4d3(0x1b6)](_0x100df2));}function invalidMybatisSource(_0x48b0e7){const _0xfbf2ce=a238_0x5b0503;return{'sql':'','mode':_0xfbf2ce(0x1e7),'error':_0x48b0e7};}function findXmlTagEnd(_0x5378a2,_0x72bbf7){const _0x3c606f=a238_0x5b0503;let _0x2bdd85;for(let _0x45b888=_0x72bbf7+0x1;_0x45b888<_0x5378a2[_0x3c606f(0x1ec)];_0x45b888+=0x1){const _0x50faf8=_0x5378a2[_0x45b888];if(_0x2bdd85){if(_0x50faf8===_0x2bdd85)_0x2bdd85=undefined;continue;}if(_0x50faf8==='\x22'||_0x50faf8==='\x27'){_0x2bdd85=_0x50faf8;continue;}if(_0x50faf8==='>')return _0x45b888;}return-0x1;}function decodeXmlEntities(_0x4341dc){const _0x596323=a238_0x5b0503;let _0x12c694=![];const _0x47c521=_0x4341dc[_0x596323(0x1c9)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x23424c=>{const _0x1fb624=_0x596323;if(_0x23424c===_0x1fb624(0x1e6))return'<';if(_0x23424c==='&gt;')return'>';if(_0x23424c===_0x1fb624(0x1d9))return'\x22';if(_0x23424c===_0x1fb624(0x1e8))return'\x27';if(_0x23424c===_0x1fb624(0x202))return'&';const _0x370862=/^&#(?:x([0-9a-f]+)|([0-9]+));$/['exec'](_0x23424c);if(_0x370862){const _0x52596d=_0x370862[0x1],_0x4043d9=_0x370862[0x2],_0x31c1be=Number[_0x1fb624(0x1ef)](_0x52596d??_0x4043d9??'',_0x52596d?0x10:0xa);if(isValidXmlCharacter(_0x31c1be))return String[_0x1fb624(0x206)](_0x31c1be);}return _0x12c694=!![],'';});return _0x12c694?null:_0x47c521;}function isValidXmlCharacter(_0x5a65ee){return _0x5a65ee===0x9||_0x5a65ee===0xa||_0x5a65ee===0xd||_0x5a65ee>=0x20&&_0x5a65ee<=0xd7ff||_0x5a65ee>=0xe000&&_0x5a65ee<=0xfffd||_0x5a65ee>=0x10000&&_0x5a65ee<=0x10ffff;}export function detectSqlType(_0x42b930){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x42b930));}function detectNormalizedSqlType(_0x3c11b4){const _0x3de69f=a238_0x5b0503;if(_0x3c11b4[_0x3de69f(0x1f6)])return{'type':_0x3de69f(0x1c6),'isSelectOnly':![],'isDangerous':![],'reason':_0x3c11b4[_0x3de69f(0x1f6)]};if(!_0x3c11b4['sql'][_0x3de69f(0x1f4)]())return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x3de69f(0x1e1)};const _0x1a0ee2=stripStaticAnalysisMarkers(_0x3c11b4[_0x3de69f(0x1b9)])[_0x3de69f(0x1c9)](/#\{[^}]*\}/g,'?')[_0x3de69f(0x1c9)](/\$\{[^}]*\}/g,'?')[_0x3de69f(0x1c9)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x3de69f(0x1c9)](/\/\*[\s\S]*?\*\//g,'')[_0x3de69f(0x1f4)](),_0x5c6c14=_0x1a0ee2[_0x3de69f(0x200)]('\x0a');let _0x289c00='';for(const _0x374c49 of _0x5c6c14){const _0x2ceff8=_0x374c49[_0x3de69f(0x1f4)]();if(!_0x2ceff8||_0x2ceff8['startsWith']('--')||_0x2ceff8[_0x3de69f(0x1e3)]('/*'))continue;_0x289c00=_0x2ceff8;break;}const _0x24271a=_0x289c00[_0x3de69f(0x1cb)](),_0x5e2a57=_0x3c11b4['statementType'],_0x5454e2=maskSqlTextForBlockedKeywordScan(_0x1a0ee2),_0x4aa834=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x3de69f(0x210)](_0x5454e2);if(_0x5e2a57===_0x3de69f(0x1c4)||!_0x5e2a57&&(_0x24271a[_0x3de69f(0x1e3)](_0x3de69f(0x1c4))||_0x24271a['startsWith']('WITH'))){const _0x4192ae=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x3de69f(0x210)](_0x1a0ee2);return{'type':'SELECT','isSelectOnly':!_0x4192ae,'isDangerous':_0x4192ae,'reason':_0x4192ae?_0x3de69f(0x1d0):undefined};}if(_0x5e2a57===_0x3de69f(0x1b3)||!_0x5e2a57&&_0x24271a[_0x3de69f(0x1e3)]('INSERT'))return{'type':'INSERT','isSelectOnly':![],'isDangerous':_0x4aa834,'reason':_0x4aa834?_0x3de69f(0x1b4):undefined};if(_0x5e2a57===_0x3de69f(0x1c5)||!_0x5e2a57&&_0x24271a[_0x3de69f(0x1e3)](_0x3de69f(0x1c5)))return{'type':_0x3de69f(0x1c5),'isSelectOnly':![],'isDangerous':_0x4aa834,'reason':_0x4aa834?_0x3de69f(0x1b4):undefined};if(_0x5e2a57===_0x3de69f(0x1e4)||!_0x5e2a57&&_0x24271a[_0x3de69f(0x1e3)](_0x3de69f(0x1e4)))return{'type':_0x3de69f(0x1e4),'isSelectOnly':![],'isDangerous':!![],'reason':_0x3de69f(0x207)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x3de69f(0x210)](_0x24271a))return{'type':_0x3de69f(0x1b1),'isSelectOnly':![],'isDangerous':!![],'reason':_0x3de69f(0x1f3)};return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x12c419){const _0xe3ac0c=a238_0x5b0503;return _0x12c419[_0xe3ac0c(0x1d7)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0xe3ac0c(0x1d7)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x3b2cb7){const _0x4344b1=a238_0x5b0503;return _0x3b2cb7[_0x4344b1(0x1c9)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x4344b1(0x1c9)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x4344b1(0x1c9)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x4344b1(0x1c9)](/--.*$/gm,'\x20')[_0x4344b1(0x1c9)](/#.*$/gm,'\x20')['replace'](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x2c5406){const _0x4368a6=a238_0x5b0503,_0x3b1044=_0x2c5406[_0x4368a6(0x1c9)](/#\{[^}]*\}/g,'?')[_0x4368a6(0x1c9)](/\$\{[^}]*\}/g,'?')[_0x4368a6(0x1c9)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')[_0x4368a6(0x1c9)](/\/\*[\s\S]*?\*\//g,''),_0x530dec=[],_0x288747=_0x3b1044[_0x4368a6(0x1d2)](/FROM\s+([^\s,)(]+)/i);addTable(_0x530dec,_0x288747?.[0x1]);for(const _0x383167 of _0x3b1044[_0x4368a6(0x1f1)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x530dec,_0x383167[0x1]);}const _0x45016b=_0x3b1044[_0x4368a6(0x1d2)](/INTO\s+([^\s(]+)/i);addTable(_0x530dec,_0x45016b?.[0x1]);const _0x254dad=_0x3b1044[_0x4368a6(0x1d2)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x530dec,_0x254dad?.[0x1]),_0x530dec;}function addTable(_0x44606e,_0x270b46){const _0x229cb9=a238_0x5b0503,_0x3e9bf9=_0x270b46?.[_0x229cb9(0x1c9)](/[`"]/g,'');_0x3e9bf9&&_0x3e9bf9!==UNRESOLVED_SQL_FRAGMENT&&!_0x44606e[_0x229cb9(0x1df)](_0x3e9bf9)&&_0x44606e[_0x229cb9(0x1e9)](_0x3e9bf9);}function extractParameters(_0x47668e){const _0x3506fa=a238_0x5b0503,_0x18ae01=new Set();for(const _0x38ff82 of _0x47668e[_0x3506fa(0x1f1)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x38ff82[0x1])_0x18ae01[_0x3506fa(0x1d3)](_0x38ff82[0x1]);}return Array[_0x3506fa(0x1c2)](_0x18ae01);}export function validateSql(_0x1b5806){const _0x3a8894=a238_0x5b0503,_0x152325=normalizeSqlForStaticAnalysis(_0x1b5806),_0x245e3d=detectNormalizedSqlType(_0x152325),_0x4254a2=stripStaticAnalysisMarkers(_0x152325[_0x3a8894(0x1b9)]),_0x298363=_0x152325[_0x3a8894(0x1f6)]?[]:extractTables(_0x4254a2),_0x2e4b3c=_0x152325[_0x3a8894(0x1f6)]?[]:extractParameters(_0x4254a2);if(_0x245e3d[_0x3a8894(0x1f9)])return{'valid':![],'sqlType':_0x245e3d,'tables':_0x298363,'parameters':_0x2e4b3c,'message':_0x245e3d['reason']||_0x245e3d['type']+_0x3a8894(0x1f8)};if(_0x245e3d[_0x3a8894(0x1c0)]===_0x3a8894(0x1c6))return{'valid':![],'sqlType':_0x245e3d,'tables':_0x298363,'parameters':_0x2e4b3c,'message':_0x152325[_0x3a8894(0x1f6)]?_0x3a8894(0x212)+_0x152325[_0x3a8894(0x1f6)]:_0x3a8894(0x20b)};return{'valid':!![],'sqlType':_0x245e3d,'tables':_0x298363,'parameters':_0x2e4b3c,'message':_0x245e3d[_0x3a8894(0x1c0)]+'\x20query\x20targeting\x20'+(_0x298363[_0x3a8894(0x1ec)]?_0x298363[_0x3a8894(0x1ed)](',\x20'):_0x3a8894(0x1ca))+(_0x2e4b3c['length']?_0x3a8894(0x1ce)+_0x2e4b3c[_0x3a8894(0x1ed)](',\x20'):'')};}
package/lib/errors.js CHANGED
@@ -1 +1 @@
1
- const a246_0x1113a0=a246_0x1f64;function a246_0x1f64(_0x3ce27c,_0xeaf62c){_0x3ce27c=_0x3ce27c-0xc1;const _0x4b8454=a246_0x4b84();let _0x1f6466=_0x4b8454[_0x3ce27c];return _0x1f6466;}(function(_0x34ef23,_0x5b0667){const _0x2f2c52=a246_0x1f64,_0x3c5016=_0x34ef23();while(!![]){try{const _0x5e8a7a=-parseInt(_0x2f2c52(0xc5))/0x1+-parseInt(_0x2f2c52(0xce))/0x2*(parseInt(_0x2f2c52(0xcb))/0x3)+-parseInt(_0x2f2c52(0xc1))/0x4+-parseInt(_0x2f2c52(0xc7))/0x5*(-parseInt(_0x2f2c52(0xc8))/0x6)+-parseInt(_0x2f2c52(0xc6))/0x7+parseInt(_0x2f2c52(0xcc))/0x8*(-parseInt(_0x2f2c52(0xc3))/0x9)+parseInt(_0x2f2c52(0xc9))/0xa;if(_0x5e8a7a===_0x5b0667)break;else _0x3c5016['push'](_0x3c5016['shift']());}catch(_0xedb581){_0x3c5016['push'](_0x3c5016['shift']());}}}(a246_0x4b84,0x57c68));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';export{CliError};function a246_0x4b84(){const _0x309a9d=['2EXaGSt','Set\x20appcode\x20via\x20`','649212DqJntD','Tip:\x20`','3042fWKNup','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','70869pQyPMA','3492951ohYzQE','609955Dgarqx','6wtbYha','16267040RUVytP','\x0a\x20\x20\x20\x20\x20\x20\x20','1531944yOwgNU','3464jsXmxK','Run\x20`'];a246_0x4b84=function(){return _0x309a9d;};return a246_0x4b84();}export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a246_0x1113a0(0xcd)+CLI_BIN_NAME+'\x20auth`\x20to\x20login\x20first.','configMissingHint':[a246_0x1113a0(0xcf)+CLI_BIN_NAME+a246_0x1113a0(0xc4),a246_0x1113a0(0xc2)+CLI_BIN_NAME+'\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.']['join'](a246_0x1113a0(0xca)),'notInProjectHint':'Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.'});
1
+ const a239_0x506ed0=a239_0x1bc0;function a239_0x1bc0(_0x33b2a3,_0x4f590f){_0x33b2a3=_0x33b2a3-0x6e;const _0x50a2a5=a239_0x50a2();let _0x1bc08c=_0x50a2a5[_0x33b2a3];return _0x1bc08c;}(function(_0x15d8f1,_0xc8f629){const _0x959c80=a239_0x1bc0,_0x277eda=_0x15d8f1();while(!![]){try{const _0x2aef5a=-parseInt(_0x959c80(0x6f))/0x1*(-parseInt(_0x959c80(0x7e))/0x2)+-parseInt(_0x959c80(0x73))/0x3*(-parseInt(_0x959c80(0x7a))/0x4)+-parseInt(_0x959c80(0x7c))/0x5*(parseInt(_0x959c80(0x71))/0x6)+-parseInt(_0x959c80(0x74))/0x7*(-parseInt(_0x959c80(0x70))/0x8)+-parseInt(_0x959c80(0x7b))/0x9+-parseInt(_0x959c80(0x6e))/0xa*(parseInt(_0x959c80(0x72))/0xb)+parseInt(_0x959c80(0x79))/0xc;if(_0x2aef5a===_0xc8f629)break;else _0x277eda['push'](_0x277eda['shift']());}catch(_0x5da690){_0x277eda['push'](_0x277eda['shift']());}}}(a239_0x50a2,0xc2a9e));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';export{CliError};function a239_0x50a2(){const _0x3354e3=['10897256yhERmF','6qvPmiP','1827694pgNwhK','2596626OHnzFh','7XoUlrv','Run\x20`','Set\x20appcode\x20via\x20`','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','Tip:\x20`','17409120FEuhsn','4JNlsDt','13830939MbMjoX','6665240qjQvkh','join','94dwsysq','20cRwncJ','6830CPXlji'];a239_0x50a2=function(){return _0x3354e3;};return a239_0x50a2();}export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a239_0x506ed0(0x75)+CLI_BIN_NAME+'\x20auth`\x20to\x20login\x20first.','configMissingHint':[a239_0x506ed0(0x76)+CLI_BIN_NAME+'\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.',a239_0x506ed0(0x78)+CLI_BIN_NAME+'\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.'][a239_0x506ed0(0x7d)]('\x0a\x20\x20\x20\x20\x20\x20\x20'),'notInProjectHint':a239_0x506ed0(0x77)});