@lovrabet/rabetbase-cli 2.5.1 → 2.5.2-beta.2

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 (348) 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/api/generate-sdk-config-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/delete.js +1 -1
  53. package/lib/commands/config/get.js +1 -1
  54. package/lib/commands/config/index.js +1 -1
  55. package/lib/commands/config/init.js +1 -1
  56. package/lib/commands/config/list.js +1 -1
  57. package/lib/commands/config/set.js +1 -1
  58. package/lib/commands/config/shared.js +1 -1
  59. package/lib/commands/dataset/business-group-update.js +1 -1
  60. package/lib/commands/dataset/business-groups.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-restore.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  80. package/lib/commands/db/analysis-batching.js +1 -1
  81. package/lib/commands/db/analyze-batch-plan.js +1 -1
  82. package/lib/commands/db/analyze-cancel.js +1 -1
  83. package/lib/commands/db/analyze-start.js +1 -1
  84. package/lib/commands/db/analyze-status.js +1 -1
  85. package/lib/commands/db/create.js +1 -1
  86. package/lib/commands/db/delete.js +1 -1
  87. package/lib/commands/db/detail.js +1 -1
  88. package/lib/commands/db/diff-refresh-start.js +1 -1
  89. package/lib/commands/db/diff-refresh-status.js +1 -1
  90. package/lib/commands/db/diff.js +1 -1
  91. package/lib/commands/db/index.js +1 -1
  92. package/lib/commands/db/list.js +1 -1
  93. package/lib/commands/db/shared.js +1 -1
  94. package/lib/commands/db/table-diff-shared.js +1 -1
  95. package/lib/commands/db/tables.js +1 -1
  96. package/lib/commands/db/test.js +1 -1
  97. package/lib/commands/db/update.js +1 -1
  98. package/lib/commands/deployment/auto-sync.d.ts +3 -11
  99. package/lib/commands/deployment/auto-sync.js +1 -1
  100. package/lib/commands/deployment/index.js +1 -1
  101. package/lib/commands/deployment/sync-all.d.ts +2 -0
  102. package/lib/commands/deployment/sync-all.js +1 -0
  103. package/lib/commands/deployment/sync-jobs.d.ts +2 -0
  104. package/lib/commands/deployment/sync-jobs.js +1 -0
  105. package/lib/commands/deployment/sync-status.d.ts +2 -0
  106. package/lib/commands/deployment/sync-status.js +1 -0
  107. package/lib/commands/deployment/sync.js +1 -1
  108. package/lib/commands/doctor.js +1 -1
  109. package/lib/commands/file/index.js +1 -1
  110. package/lib/commands/instant-api-policy/current.d.ts +2 -0
  111. package/lib/commands/instant-api-policy/current.js +1 -0
  112. package/lib/commands/instant-api-policy/index.d.ts +2 -0
  113. package/lib/commands/instant-api-policy/index.js +1 -0
  114. package/lib/commands/instant-api-policy/init.d.ts +2 -0
  115. package/lib/commands/instant-api-policy/init.js +1 -0
  116. package/lib/commands/instant-api-policy/publish.d.ts +2 -0
  117. package/lib/commands/instant-api-policy/publish.js +1 -0
  118. package/lib/commands/instant-api-policy/pull.d.ts +2 -0
  119. package/lib/commands/instant-api-policy/pull.js +1 -0
  120. package/lib/commands/instant-api-policy/revision.d.ts +2 -0
  121. package/lib/commands/instant-api-policy/revision.js +1 -0
  122. package/lib/commands/instant-api-policy/revisions.d.ts +2 -0
  123. package/lib/commands/instant-api-policy/revisions.js +1 -0
  124. package/lib/commands/instant-api-policy/rollback.d.ts +2 -0
  125. package/lib/commands/instant-api-policy/rollback.js +1 -0
  126. package/lib/commands/instant-api-policy/shared.d.ts +82 -0
  127. package/lib/commands/instant-api-policy/shared.js +1 -0
  128. package/lib/commands/instant-api-policy/validate.d.ts +2 -0
  129. package/lib/commands/instant-api-policy/validate.js +1 -0
  130. package/lib/commands/issue/index.js +1 -1
  131. package/lib/commands/issue/nudge.js +1 -1
  132. package/lib/commands/issue/report.js +1 -1
  133. package/lib/commands/issue/shared.js +1 -1
  134. package/lib/commands/kb/create.js +1 -1
  135. package/lib/commands/kb/delete.js +1 -1
  136. package/lib/commands/kb/detail.js +1 -1
  137. package/lib/commands/kb/index.js +1 -1
  138. package/lib/commands/kb/list.js +1 -1
  139. package/lib/commands/kb/search.js +1 -1
  140. package/lib/commands/kb/shared.js +1 -1
  141. package/lib/commands/kb/update.js +1 -1
  142. package/lib/commands/logs/index.js +1 -1
  143. package/lib/commands/menu/asset-update.js +1 -1
  144. package/lib/commands/menu/delete.js +1 -1
  145. package/lib/commands/menu/external-link-create.js +1 -1
  146. package/lib/commands/menu/external-link-update.js +1 -1
  147. package/lib/commands/menu/group-create.js +1 -1
  148. package/lib/commands/menu/group-update.js +1 -1
  149. package/lib/commands/menu/index.js +1 -1
  150. package/lib/commands/menu/list.js +1 -1
  151. package/lib/commands/menu/move.js +1 -1
  152. package/lib/commands/menu/regroup-start.js +1 -1
  153. package/lib/commands/menu/rename.js +1 -1
  154. package/lib/commands/menu/shared/compare-table.js +1 -1
  155. package/lib/commands/menu/shared/delete-plan.js +1 -1
  156. package/lib/commands/menu/shared/facts.js +1 -1
  157. package/lib/commands/menu/shared/index.js +1 -1
  158. package/lib/commands/menu/shared/inquirer.js +1 -1
  159. package/lib/commands/menu/shared/local-pages.js +1 -1
  160. package/lib/commands/menu/shared/logic.js +1 -1
  161. package/lib/commands/menu/shared/mutations.js +1 -1
  162. package/lib/commands/menu/shared/service.js +1 -1
  163. package/lib/commands/menu/shared/sync-core.js +1 -1
  164. package/lib/commands/menu/shared/update-core.js +1 -1
  165. package/lib/commands/menu/shared/valid-url.js +1 -1
  166. package/lib/commands/menu/sync.js +1 -1
  167. package/lib/commands/menu/visibility-update.js +1 -1
  168. package/lib/commands/notification/config-create.js +1 -1
  169. package/lib/commands/notification/config-delete.js +1 -1
  170. package/lib/commands/notification/config-list.js +1 -1
  171. package/lib/commands/notification/config-update.js +1 -1
  172. package/lib/commands/notification/index.js +1 -1
  173. package/lib/commands/notification/shared.js +1 -1
  174. package/lib/commands/ocr/index.js +1 -1
  175. package/lib/commands/page/create.js +1 -1
  176. package/lib/commands/page/custom/detail.js +1 -1
  177. package/lib/commands/page/custom/list.js +1 -1
  178. package/lib/commands/page/custom/publish.js +1 -1
  179. package/lib/commands/page/custom/shared.js +1 -1
  180. package/lib/commands/page/custom/syntax.js +1 -1
  181. package/lib/commands/page/custom/template.js +1 -1
  182. package/lib/commands/page/custom/update.js +1 -1
  183. package/lib/commands/page/data-list-status.js +1 -1
  184. package/lib/commands/page/generate-start.js +1 -1
  185. package/lib/commands/page/generate-status.js +1 -1
  186. package/lib/commands/page/index.js +1 -1
  187. package/lib/commands/page/pull.js +1 -1
  188. package/lib/commands/page/push.js +1 -1
  189. package/lib/commands/page/relation-audit.js +1 -1
  190. package/lib/commands/page/restore.js +1 -1
  191. package/lib/commands/page/shared.js +1 -1
  192. package/lib/commands/page/sync.js +1 -1
  193. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  194. package/lib/commands/project/create/format-elapsed.js +1 -1
  195. package/lib/commands/project/create/main.js +1 -1
  196. package/lib/commands/project/create/materialize-project-template.js +1 -1
  197. package/lib/commands/project/create/project-name.js +1 -1
  198. package/lib/commands/project/create/project-template-archive.js +1 -1
  199. package/lib/commands/project/create/project-template-path.js +1 -1
  200. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  201. package/lib/commands/project/create/use-format-code.js +1 -1
  202. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  203. package/lib/commands/project/domain-routing-sync.js +1 -1
  204. package/lib/commands/project/index.js +1 -1
  205. package/lib/commands/project/upgrade.js +1 -1
  206. package/lib/commands/registry.js +1 -1
  207. package/lib/commands/role/delete.js +1 -1
  208. package/lib/commands/role/detail.js +1 -1
  209. package/lib/commands/role/index.js +1 -1
  210. package/lib/commands/role/list.js +1 -1
  211. package/lib/commands/role/shared.js +1 -1
  212. package/lib/commands/role/update.js +1 -1
  213. package/lib/commands/role/user-add.js +1 -1
  214. package/lib/commands/role/user-remove.js +1 -1
  215. package/lib/commands/role/user-resolve.js +1 -1
  216. package/lib/commands/rule/get.js +1 -1
  217. package/lib/commands/rule/index.js +1 -1
  218. package/lib/commands/rule/list.js +1 -1
  219. package/lib/commands/rule/set.js +1 -1
  220. package/lib/commands/rule/shared.js +1 -1
  221. package/lib/commands/run/index.js +1 -1
  222. package/lib/commands/schema.js +1 -1
  223. package/lib/commands/sql/create.js +1 -1
  224. package/lib/commands/sql/delete.js +1 -1
  225. package/lib/commands/sql/detail.js +1 -1
  226. package/lib/commands/sql/exec.js +1 -1
  227. package/lib/commands/sql/index.js +1 -1
  228. package/lib/commands/sql/list.js +1 -1
  229. package/lib/commands/sql/pull.js +1 -1
  230. package/lib/commands/sql/push.js +1 -1
  231. package/lib/commands/sql/shared.js +1 -1
  232. package/lib/commands/sql/status.js +1 -1
  233. package/lib/commands/sql/validate.js +1 -1
  234. package/lib/commands/task/index.js +1 -1
  235. package/lib/commands/task/status.js +1 -1
  236. package/lib/commands/tenant/index.js +1 -1
  237. package/lib/commands/tenant/members-list.js +1 -1
  238. package/lib/commands/tenant/shared.js +1 -1
  239. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  240. package/lib/commands/user-account/index.js +1 -1
  241. package/lib/commands/workspace/add.js +1 -1
  242. package/lib/commands/workspace/index.js +1 -1
  243. package/lib/commands/workspace/remove.js +1 -1
  244. package/lib/config/domain-config.js +1 -1
  245. package/lib/config/project-domain-routing.js +1 -1
  246. package/lib/config/schema.js +1 -1
  247. package/lib/constant/cdn.js +1 -1
  248. package/lib/constant/cli.js +1 -1
  249. package/lib/constant/defaults.js +1 -1
  250. package/lib/constant/domain.js +1 -1
  251. package/lib/constant/env.js +1 -1
  252. package/lib/constant/output.js +1 -1
  253. package/lib/constant/paths.js +1 -1
  254. package/lib/constant/region.js +1 -1
  255. package/lib/constant/risk.js +1 -1
  256. package/lib/constant/routing-profile.js +1 -1
  257. package/lib/context/app-resolver.d.ts +0 -2
  258. package/lib/context/app-resolver.js +1 -1
  259. package/lib/context/auth-resolver.js +1 -1
  260. package/lib/context/config-loader.js +1 -1
  261. package/lib/context.js +1 -1
  262. package/lib/core/alias-resolver.js +1 -1
  263. package/lib/core/api-client.d.ts +113 -2
  264. package/lib/core/api-client.js +1 -1
  265. package/lib/core/bff/config.js +1 -1
  266. package/lib/core/bff/file-system.js +1 -1
  267. package/lib/core/bff/hash.js +1 -1
  268. package/lib/core/bff/lock.js +1 -1
  269. package/lib/core/bff/utils.js +1 -1
  270. package/lib/core/db-resolver.js +1 -1
  271. package/lib/core/instant-api-policy/config.d.ts +23 -0
  272. package/lib/core/instant-api-policy/config.js +1 -0
  273. package/lib/core/kb-search-client.js +1 -1
  274. package/lib/core/page/file-system.js +1 -1
  275. package/lib/core/page/hash.js +1 -1
  276. package/lib/core/page/lock.js +1 -1
  277. package/lib/core/sql-index-auditor.js +1 -1
  278. package/lib/core/sql-sync/config.js +1 -1
  279. package/lib/core/sql-sync/file-system.js +1 -1
  280. package/lib/core/sql-sync/hash.js +1 -1
  281. package/lib/core/sql-sync/lock.js +1 -1
  282. package/lib/core/sql-sync/utils.js +1 -1
  283. package/lib/core/sql-validator.js +1 -1
  284. package/lib/errors.js +1 -1
  285. package/lib/framework/build-all-flags.js +1 -1
  286. package/lib/framework/error-output.js +1 -1
  287. package/lib/framework/explicit-yes.js +1 -1
  288. package/lib/framework/flags.js +1 -1
  289. package/lib/framework/help.js +1 -1
  290. package/lib/framework/index.js +1 -1
  291. package/lib/framework/output.js +1 -1
  292. package/lib/framework/response.js +1 -1
  293. package/lib/framework/runner-alias.js +1 -1
  294. package/lib/framework/runner.js +1 -1
  295. package/lib/framework/schema-export.js +1 -1
  296. package/lib/framework/supported-flags.d.ts +2 -0
  297. package/lib/framework/supported-flags.js +1 -0
  298. package/lib/framework/types.d.ts +2 -4
  299. package/lib/framework/types.js +1 -1
  300. package/lib/generated/build-info.d.ts +4 -4
  301. package/lib/generated/build-info.js +1 -1
  302. package/lib/generated/official-routing.js +1 -1
  303. package/lib/generated/routing-contract.js +1 -1
  304. package/lib/help.js +1 -1
  305. package/lib/postinstall.js +1 -1
  306. package/lib/runtime/confirmation.js +1 -1
  307. package/lib/runtime/event.js +1 -1
  308. package/lib/runtime/index.js +1 -1
  309. package/lib/runtime/queue.js +1 -1
  310. package/lib/runtime/resolve.js +1 -1
  311. package/lib/skills/builtin-skill.js +1 -1
  312. package/lib/skills/main.js +1 -1
  313. package/lib/skills/npx-skills-add.js +1 -1
  314. package/lib/skills/skill-presence.js +1 -1
  315. package/lib/telemetry/cli-command-trace.js +1 -1
  316. package/lib/telemetry/cli-help-trace.js +1 -1
  317. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  318. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  319. package/lib/telemetry/send-cli-trace-log.js +1 -1
  320. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  321. package/lib/utils/ai_config.js +1 -1
  322. package/lib/utils/apply-jq-filter.js +1 -1
  323. package/lib/utils/cdn-config.js +1 -1
  324. package/lib/utils/check-sdk-version.js +1 -1
  325. package/lib/utils/cli-version-check.js +1 -1
  326. package/lib/utils/cli-version-policy.js +1 -1
  327. package/lib/utils/config.js +1 -1
  328. package/lib/utils/entity-with-id.js +1 -1
  329. package/lib/utils/file-utils.js +1 -1
  330. package/lib/utils/guides-cdn.js +1 -1
  331. package/lib/utils/http-client.js +1 -1
  332. package/lib/utils/is-non-interactive.js +1 -1
  333. package/lib/utils/logger.js +1 -1
  334. package/lib/utils/params.js +1 -1
  335. package/lib/utils/platform.js +1 -1
  336. package/lib/utils/sleep.js +1 -1
  337. package/lib/utils/template-replacer.js +1 -1
  338. package/lib/utils/update-notice.js +1 -1
  339. package/lib/utils/version.js +1 -1
  340. package/lib/utils/with-active-cookie.js +1 -1
  341. package/lib/utils/write-cli-side-channel.js +1 -1
  342. package/package.json +1 -1
  343. package/skills/rabetbase/SKILL.md +12 -6
  344. package/skills/rabetbase/references/rabetbase-deployment-sync.md +51 -43
  345. package/skills/rabetbase/references/rabetbase-instant-api-policy.md +92 -0
  346. package/skills/rabetbase.manifest.json +4 -3
  347. package/lib/config/deployment-sync.d.ts +0 -10
  348. package/lib/config/deployment-sync.js +0 -1
@@ -1 +1 @@
1
- const a238_0x220cd3=a238_0x3fd7;(function(_0x51be2c,_0x598c06){const _0x1812f4=a238_0x3fd7,_0x341cbb=_0x51be2c();while(!![]){try{const _0x400b08=parseInt(_0x1812f4(0xf0))/0x1*(-parseInt(_0x1812f4(0xf9))/0x2)+parseInt(_0x1812f4(0xf7))/0x3+parseInt(_0x1812f4(0xf1))/0x4*(parseInt(_0x1812f4(0xfe))/0x5)+parseInt(_0x1812f4(0xee))/0x6+parseInt(_0x1812f4(0xd6))/0x7*(parseInt(_0x1812f4(0xea))/0x8)+parseInt(_0x1812f4(0xed))/0x9*(-parseInt(_0x1812f4(0xf8))/0xa)+-parseInt(_0x1812f4(0xfc))/0xb;if(_0x400b08===_0x598c06)break;else _0x341cbb['push'](_0x341cbb['shift']());}catch(_0x5b3536){_0x341cbb['push'](_0x341cbb['shift']());}}}(a238_0x3fbe,0x47861));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join,resolve,sep}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a238_0x220cd3(0xe5),a238_0x220cd3(0xf6),a238_0x220cd3(0xd7)];export function normalizeBffType(_0x55714c){const _0x404c07=a238_0x220cd3;if(!_0x55714c)return undefined;const _0x9061=_0x55714c[_0x404c07(0xe7)]()[_0x404c07(0xe4)]();return SUPPORTED_BFF_TYPES[_0x404c07(0xf4)](_0x9061)?_0x9061:undefined;}async function scanJsFilesRecursively(_0x55ffe7,_0x7eb3f2){const _0x1d8e8a=a238_0x220cd3,_0xa8263f=[];try{const _0x544f41=await readdir(_0x55ffe7,{'withFileTypes':!![]});for(const _0x28f008 of _0x544f41){const _0x2d6f15=join(_0x55ffe7,_0x28f008[_0x1d8e8a(0xff)]);if(_0x28f008[_0x1d8e8a(0xf2)]())_0xa8263f[_0x1d8e8a(0xe8)](...await scanJsFilesRecursively(_0x2d6f15,_0x7eb3f2+'/'+_0x28f008['name']));else _0x28f008[_0x1d8e8a(0xeb)]()&&_0x28f008['name'][_0x1d8e8a(0xfa)]('.js')&&_0xa8263f['push']({'lockKey':_0x7eb3f2+'/'+_0x28f008['name'][_0x1d8e8a(0xe6)](/\.js$/,''),'filePath':_0x2d6f15});}}catch(_0xcf91ca){if(_0xcf91ca[_0x1d8e8a(0xe2)]!=='ENOENT')throw _0xcf91ca;}return _0xa8263f;}async function scanFlatFunctions(_0x5e58f2,_0x1526c6){const _0x40d356=a238_0x220cd3,_0x59ccf6=join(_0x5e58f2[_0x40d356(0x100)],_0x1526c6),_0x464705=await scanJsFilesRecursively(_0x59ccf6,_0x1526c6);return _0x464705[_0x40d356(0xef)](({lockKey:_0x370ff9,filePath:_0x45d24d})=>({'type':_0x1526c6,'name':_0x370ff9['split']('/')['at'](-0x1)??'','filePath':_0x45d24d,'lockKey':_0x370ff9}));}async function scanHookFunctions(_0x1e0475){const _0x309870=a238_0x220cd3,_0x2953f8=join(_0x1e0475[_0x309870(0x100)],_0x309870(0xd7)),_0x69ebc2=[];try{const _0x537466=await readdir(_0x2953f8,{'withFileTypes':!![]});for(const _0x5d7d00 of _0x537466){if(!_0x5d7d00[_0x309870(0xf2)]())continue;const _0x62167e=_0x5d7d00['name'],_0x31acb4=join(_0x2953f8,_0x62167e),_0x2e542f=await readdir(_0x31acb4,{'withFileTypes':!![]});for(const _0x1ea9a1 of _0x2e542f){if(!_0x1ea9a1[_0x309870(0xf2)]())continue;const _0x453057=_0x1ea9a1[_0x309870(0xff)],_0xa58273=join(_0x31acb4,_0x453057),_0x469b25=await readdir(_0xa58273,{'withFileTypes':!![]});for(const _0x476ef3 of _0x469b25){if(!_0x476ef3['isDirectory']())continue;const _0x37ca45=_0x476ef3[_0x309870(0xff)],_0x4a319f=join(_0xa58273,_0x37ca45),_0x4f1423=await readdir(_0x4a319f,{'withFileTypes':!![]});for(const _0x46c400 of _0x4f1423){if(!_0x46c400[_0x309870(0xeb)]()||!_0x46c400[_0x309870(0xff)][_0x309870(0xfa)]('.js'))continue;const _0x412ee6=_0x46c400[_0x309870(0xff)][_0x309870(0xe6)](/\.js$/,'');_0x69ebc2['push']({'type':_0x309870(0xd7),'name':_0x412ee6,'filePath':join(_0x4a319f,_0x46c400[_0x309870(0xff)]),'lockKey':_0x309870(0xdc)+_0x62167e+'/'+_0x453057+'/'+_0x37ca45+'/'+_0x412ee6,'alias':_0x62167e,'operationType':_0x453057,'functionNode':_0x37ca45});}}}}}catch(_0x445104){if(_0x445104['code']!==_0x309870(0xec))throw _0x445104;}return _0x69ebc2;}export async function scanLocalBffFunctions(_0x1d9380,_0x5b9242){const _0x2d09a3=a238_0x220cd3;if(_0x5b9242==='COMMON'||_0x5b9242==='ENDPOINT')return scanFlatFunctions(_0x1d9380,_0x5b9242);if(_0x5b9242===_0x2d09a3(0xd7))return scanHookFunctions(_0x1d9380);const [_0x2e1ccd,_0x59cbb1,_0x885a14]=await Promise[_0x2d09a3(0xfd)]([scanFlatFunctions(_0x1d9380,_0x2d09a3(0xe5)),scanFlatFunctions(_0x1d9380,_0x2d09a3(0xf6)),scanHookFunctions(_0x1d9380)]);return[..._0x2e1ccd,..._0x59cbb1,..._0x885a14];}function a238_0x3fbe(){const _0x42a077=['HOOK/','get','beforeScriptId','split','test','scriptType','code','set','toUpperCase','COMMON','replace','trim','push','.js','94856bELbKQ','isFile','ENOENT','17361uTRyht','2590872jTKVMl','map','74446AcmzJz','1305580CbPeYd','isDirectory','startsWith','includes','operationType','ENDPOINT','937302VXnYTJ','2570hHEAPL','6KmCiWx','endsWith','Resolved\x20Backend\x20Function\x20script\x20path\x20escapes\x20scripts\x20root:\x20','1296614hubKQb','all','5NkLIiP','name','scriptsRootDir','datasetCode','35cQZjux','HOOK','afterScriptId','functionNode','alias','every'];a238_0x3fbe=function(){return _0x42a077;};return a238_0x3fbe();}const SAFE_LOCK_KEY_SEGMENT=/^[A-Za-z0-9_$.-]+$/;export function isSafeLockKeySegment(_0x37392f){const _0x564be1=a238_0x220cd3;return SAFE_LOCK_KEY_SEGMENT[_0x564be1(0xe0)](_0x37392f)&&_0x37392f!=='.'&&_0x37392f!=='..';}export function resolveLocalFilePathFromLockKey(_0x2a2b5f,_0x55fa16){const _0x3121ed=a238_0x220cd3,_0x3e21a7=_0x55fa16[_0x3121ed(0xdf)]('/');if(!_0x3e21a7[_0x3121ed(0xdb)](isSafeLockKeySegment))throw new Error('Unsafe\x20Backend\x20Function\x20lock\x20key\x20(traversal\x20or\x20invalid\x20segment):\x20'+_0x55fa16);const _0x4ca305=resolve(join(_0x2a2b5f[_0x3121ed(0x100)],..._0x3e21a7)+_0x3121ed(0xe9)),_0x2c1ea1=resolve(_0x2a2b5f[_0x3121ed(0x100)]);if(_0x4ca305!==_0x2c1ea1&&!_0x4ca305[_0x3121ed(0xf3)](_0x2c1ea1+sep))throw new Error(_0x3121ed(0xfb)+_0x4ca305);return _0x4ca305;}export function createHookLocationMap(_0x2bfec8){const _0x3f5d81=a238_0x220cd3,_0xd63a25=new Map();for(const _0x1211c5 of _0x2bfec8){_0x1211c5[_0x3f5d81(0xde)]&&_0xd63a25['set'](_0x1211c5[_0x3f5d81(0xde)],{'datasetCode':_0x1211c5[_0x3f5d81(0xd5)],'operationType':snakeToCamel(_0x1211c5[_0x3f5d81(0xf5)]),'functionNode':'before'}),_0x1211c5['afterScriptId']&&_0xd63a25[_0x3f5d81(0xe3)](_0x1211c5[_0x3f5d81(0xd8)],{'datasetCode':_0x1211c5[_0x3f5d81(0xd5)],'operationType':snakeToCamel(_0x1211c5[_0x3f5d81(0xf5)]),'functionNode':'after'});}return _0xd63a25;}function a238_0x3fd7(_0x5bc663,_0xd35107){_0x5bc663=_0x5bc663-0xd5;const _0x3fbe86=a238_0x3fbe();let _0x3fd71c=_0x3fbe86[_0x5bc663];return _0x3fd71c;}export function resolveRemoteScriptTarget(_0x15c14b,_0x545941,_0x367a0b,_0x4daf48,_0x507428){const _0x40a724=a238_0x220cd3,_0x50eb76=normalizeBffType(_0x545941[_0x40a724(0xe1)]);if(!_0x50eb76||!_0x545941['functionName'])return null;if(_0x50eb76==='HOOK'){const _0x27c8d1=(_0x545941['id']?_0x367a0b[_0x40a724(0xdd)](_0x545941['id']):undefined)??findHookLocationByRemoteId(_0x4daf48,_0x545941['id']);if(!_0x27c8d1)return null;const _0x2480c2=_0x27c8d1[_0x40a724(0xda)]||_0x507428['get'](_0x27c8d1[_0x40a724(0xd5)]),_0x5ac54e=_0x2480c2??_0x27c8d1['datasetCode'],_0x1c7db6={..._0x27c8d1,'alias':_0x2480c2},_0x4f28cd='HOOK/'+_0x5ac54e+'/'+_0x1c7db6[_0x40a724(0xf5)]+'/'+_0x1c7db6[_0x40a724(0xd9)]+'/'+_0x545941['functionName'];if(!_0x4f28cd[_0x40a724(0xdf)]('/')[_0x40a724(0xdb)](isSafeLockKeySegment))return null;return{'lockKey':_0x4f28cd,'filePath':resolveLocalFilePathFromLockKey(_0x15c14b,_0x4f28cd),'type':_0x40a724(0xd7),'hookLocation':_0x1c7db6};}const _0x2be14c=_0x50eb76+'/'+_0x545941['functionName'];if(!_0x2be14c[_0x40a724(0xdf)]('/')[_0x40a724(0xdb)](isSafeLockKeySegment))return null;return{'lockKey':_0x2be14c,'filePath':resolveLocalFilePathFromLockKey(_0x15c14b,_0x2be14c),'type':_0x50eb76};}export async function ensureParentDirectory(_0x3c4569){await mkdir(dirname(_0x3c4569),{'recursive':!![]});}export async function fileExists(_0x2e237b){try{return await access(_0x2e237b,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x1c8eb0){const _0x2d0ef1=a238_0x220cd3;try{const _0x1f65be=await stat(_0x1c8eb0);return _0x1f65be[_0x2d0ef1(0xf2)]();}catch{return![];}}
1
+ const a250_0x4d556d=a250_0x4289;(function(_0x4bb2b0,_0x1f70e1){const _0x325c04=a250_0x4289,_0x22083b=_0x4bb2b0();while(!![]){try{const _0x2fa635=parseInt(_0x325c04(0x1ea))/0x1*(parseInt(_0x325c04(0x1db))/0x2)+parseInt(_0x325c04(0x1e4))/0x3*(parseInt(_0x325c04(0x1df))/0x4)+parseInt(_0x325c04(0x1fa))/0x5+-parseInt(_0x325c04(0x1e0))/0x6+-parseInt(_0x325c04(0x1ec))/0x7+parseInt(_0x325c04(0x1f2))/0x8+parseInt(_0x325c04(0x1f4))/0x9;if(_0x2fa635===_0x1f70e1)break;else _0x22083b['push'](_0x22083b['shift']());}catch(_0x27f511){_0x22083b['push'](_0x22083b['shift']());}}}(a250_0x5431,0x3644f));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join,resolve,sep}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a250_0x4d556d(0x1d6),a250_0x4d556d(0x1ed),a250_0x4d556d(0x1f9)];export function normalizeBffType(_0x430cb2){const _0x67891c=a250_0x4d556d;if(!_0x430cb2)return undefined;const _0x59b5a9=_0x430cb2[_0x67891c(0x1ef)]()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x67891c(0x1f1)](_0x59b5a9)?_0x59b5a9:undefined;}function a250_0x5431(){const _0x11f4b0=['after','operationType','HOOK','120935liRACu','datasetCode','alias','all','split','COMMON','startsWith','get','map','every','872974NHVYDo','F_OK','name','endsWith','32VCgaFS','2526126EGNfid','isDirectory','functionName','set','8739pcWxMI','ENOENT','Unsafe\x20Backend\x20Function\x20lock\x20key\x20(traversal\x20or\x20invalid\x20segment):\x20','functionNode','isFile','scriptType','1GVAzxp','scriptsRootDir','913003TjlrZl','ENDPOINT','push','trim','.js','includes','1540752hXborp','afterScriptId','874485RBFtSx','code','replace'];a250_0x5431=function(){return _0x11f4b0;};return a250_0x5431();}async function scanJsFilesRecursively(_0x361293,_0x3f2f1d){const _0x3fc4eb=a250_0x4d556d,_0x2b2ea8=[];try{const _0x5f52cb=await readdir(_0x361293,{'withFileTypes':!![]});for(const _0x5a2ebc of _0x5f52cb){const _0x45ec8b=join(_0x361293,_0x5a2ebc[_0x3fc4eb(0x1dd)]);if(_0x5a2ebc[_0x3fc4eb(0x1e1)]())_0x2b2ea8['push'](...await scanJsFilesRecursively(_0x45ec8b,_0x3f2f1d+'/'+_0x5a2ebc[_0x3fc4eb(0x1dd)]));else _0x5a2ebc['isFile']()&&_0x5a2ebc[_0x3fc4eb(0x1dd)][_0x3fc4eb(0x1de)](_0x3fc4eb(0x1f0))&&_0x2b2ea8[_0x3fc4eb(0x1ee)]({'lockKey':_0x3f2f1d+'/'+_0x5a2ebc['name'][_0x3fc4eb(0x1f6)](/\.js$/,''),'filePath':_0x45ec8b});}}catch(_0xb1b92e){if(_0xb1b92e[_0x3fc4eb(0x1f5)]!==_0x3fc4eb(0x1e5))throw _0xb1b92e;}return _0x2b2ea8;}async function scanFlatFunctions(_0x3d5760,_0x504a71){const _0x55da7d=a250_0x4d556d,_0x22a724=join(_0x3d5760[_0x55da7d(0x1eb)],_0x504a71),_0x19d10d=await scanJsFilesRecursively(_0x22a724,_0x504a71);return _0x19d10d[_0x55da7d(0x1d9)](({lockKey:_0x4f7544,filePath:_0x412d53})=>({'type':_0x504a71,'name':_0x4f7544[_0x55da7d(0x1d5)]('/')['at'](-0x1)??'','filePath':_0x412d53,'lockKey':_0x4f7544}));}async function scanHookFunctions(_0x1a0fe1){const _0xfefe5e=a250_0x4d556d,_0x38af3b=join(_0x1a0fe1[_0xfefe5e(0x1eb)],_0xfefe5e(0x1f9)),_0x30de34=[];try{const _0x1d36b5=await readdir(_0x38af3b,{'withFileTypes':!![]});for(const _0x30ce8c of _0x1d36b5){if(!_0x30ce8c['isDirectory']())continue;const _0x238951=_0x30ce8c['name'],_0x2e8aae=join(_0x38af3b,_0x238951),_0x11cf7a=await readdir(_0x2e8aae,{'withFileTypes':!![]});for(const _0xa0d462 of _0x11cf7a){if(!_0xa0d462[_0xfefe5e(0x1e1)]())continue;const _0x32dee4=_0xa0d462['name'],_0x341b51=join(_0x2e8aae,_0x32dee4),_0x204821=await readdir(_0x341b51,{'withFileTypes':!![]});for(const _0x143d6a of _0x204821){if(!_0x143d6a[_0xfefe5e(0x1e1)]())continue;const _0x11659b=_0x143d6a[_0xfefe5e(0x1dd)],_0x2dd5f0=join(_0x341b51,_0x11659b),_0x2aede8=await readdir(_0x2dd5f0,{'withFileTypes':!![]});for(const _0x29224a of _0x2aede8){if(!_0x29224a[_0xfefe5e(0x1e8)]()||!_0x29224a[_0xfefe5e(0x1dd)]['endsWith'](_0xfefe5e(0x1f0)))continue;const _0x220fdc=_0x29224a[_0xfefe5e(0x1dd)]['replace'](/\.js$/,'');_0x30de34['push']({'type':_0xfefe5e(0x1f9),'name':_0x220fdc,'filePath':join(_0x2dd5f0,_0x29224a[_0xfefe5e(0x1dd)]),'lockKey':'HOOK/'+_0x238951+'/'+_0x32dee4+'/'+_0x11659b+'/'+_0x220fdc,'alias':_0x238951,'operationType':_0x32dee4,'functionNode':_0x11659b});}}}}}catch(_0x2da2b9){if(_0x2da2b9['code']!==_0xfefe5e(0x1e5))throw _0x2da2b9;}return _0x30de34;}function a250_0x4289(_0x48eccd,_0x398e6b){_0x48eccd=_0x48eccd-0x1d2;const _0x543165=a250_0x5431();let _0x4289b0=_0x543165[_0x48eccd];return _0x4289b0;}export async function scanLocalBffFunctions(_0x3f908b,_0x5652f9){const _0x53d720=a250_0x4d556d;if(_0x5652f9===_0x53d720(0x1d6)||_0x5652f9===_0x53d720(0x1ed))return scanFlatFunctions(_0x3f908b,_0x5652f9);if(_0x5652f9==='HOOK')return scanHookFunctions(_0x3f908b);const [_0x354a06,_0x15c919,_0x417425]=await Promise[_0x53d720(0x1d4)]([scanFlatFunctions(_0x3f908b,'COMMON'),scanFlatFunctions(_0x3f908b,_0x53d720(0x1ed)),scanHookFunctions(_0x3f908b)]);return[..._0x354a06,..._0x15c919,..._0x417425];}const SAFE_LOCK_KEY_SEGMENT=/^[A-Za-z0-9_$.-]+$/;export function isSafeLockKeySegment(_0x54da36){return SAFE_LOCK_KEY_SEGMENT['test'](_0x54da36)&&_0x54da36!=='.'&&_0x54da36!=='..';}export function resolveLocalFilePathFromLockKey(_0x37d94d,_0x417a28){const _0x15689c=a250_0x4d556d,_0xa80185=_0x417a28[_0x15689c(0x1d5)]('/');if(!_0xa80185[_0x15689c(0x1da)](isSafeLockKeySegment))throw new Error(_0x15689c(0x1e6)+_0x417a28);const _0x1a6dfc=resolve(join(_0x37d94d[_0x15689c(0x1eb)],..._0xa80185)+_0x15689c(0x1f0)),_0x31d58a=resolve(_0x37d94d[_0x15689c(0x1eb)]);if(_0x1a6dfc!==_0x31d58a&&!_0x1a6dfc[_0x15689c(0x1d7)](_0x31d58a+sep))throw new Error('Resolved\x20Backend\x20Function\x20script\x20path\x20escapes\x20scripts\x20root:\x20'+_0x1a6dfc);return _0x1a6dfc;}export function createHookLocationMap(_0x5786ff){const _0x3e5d31=a250_0x4d556d,_0x19c17a=new Map();for(const _0x309d2f of _0x5786ff){_0x309d2f['beforeScriptId']&&_0x19c17a['set'](_0x309d2f['beforeScriptId'],{'datasetCode':_0x309d2f[_0x3e5d31(0x1d2)],'operationType':snakeToCamel(_0x309d2f[_0x3e5d31(0x1f8)]),'functionNode':'before'}),_0x309d2f[_0x3e5d31(0x1f3)]&&_0x19c17a[_0x3e5d31(0x1e3)](_0x309d2f[_0x3e5d31(0x1f3)],{'datasetCode':_0x309d2f[_0x3e5d31(0x1d2)],'operationType':snakeToCamel(_0x309d2f[_0x3e5d31(0x1f8)]),'functionNode':_0x3e5d31(0x1f7)});}return _0x19c17a;}export function resolveRemoteScriptTarget(_0x5bbbb1,_0x2b0cc9,_0xa9c4da,_0x2e3da0,_0xb2ec2c){const _0x5a0533=a250_0x4d556d,_0x2df03a=normalizeBffType(_0x2b0cc9[_0x5a0533(0x1e9)]);if(!_0x2df03a||!_0x2b0cc9[_0x5a0533(0x1e2)])return null;if(_0x2df03a===_0x5a0533(0x1f9)){const _0x494a85=(_0x2b0cc9['id']?_0xa9c4da[_0x5a0533(0x1d8)](_0x2b0cc9['id']):undefined)??findHookLocationByRemoteId(_0x2e3da0,_0x2b0cc9['id']);if(!_0x494a85)return null;const _0xcaae3=_0x494a85[_0x5a0533(0x1d3)]||_0xb2ec2c[_0x5a0533(0x1d8)](_0x494a85[_0x5a0533(0x1d2)]),_0x4fb154=_0xcaae3??_0x494a85['datasetCode'],_0x373c0c={..._0x494a85,'alias':_0xcaae3},_0x2129b6='HOOK/'+_0x4fb154+'/'+_0x373c0c[_0x5a0533(0x1f8)]+'/'+_0x373c0c[_0x5a0533(0x1e7)]+'/'+_0x2b0cc9[_0x5a0533(0x1e2)];if(!_0x2129b6[_0x5a0533(0x1d5)]('/')['every'](isSafeLockKeySegment))return null;return{'lockKey':_0x2129b6,'filePath':resolveLocalFilePathFromLockKey(_0x5bbbb1,_0x2129b6),'type':_0x5a0533(0x1f9),'hookLocation':_0x373c0c};}const _0x63ab5=_0x2df03a+'/'+_0x2b0cc9[_0x5a0533(0x1e2)];if(!_0x63ab5[_0x5a0533(0x1d5)]('/')[_0x5a0533(0x1da)](isSafeLockKeySegment))return null;return{'lockKey':_0x63ab5,'filePath':resolveLocalFilePathFromLockKey(_0x5bbbb1,_0x63ab5),'type':_0x2df03a};}export async function ensureParentDirectory(_0x13d6b8){await mkdir(dirname(_0x13d6b8),{'recursive':!![]});}export async function fileExists(_0x357e07){const _0x5001cf=a250_0x4d556d;try{return await access(_0x357e07,constants[_0x5001cf(0x1dc)]),!![];}catch{return![];}}export async function directoryExists(_0x4822ca){try{const _0x4d732d=await stat(_0x4822ca);return _0x4d732d['isDirectory']();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x2d4b9e,_0x43e198){const _0x193780=a239_0x22be,_0xf394cf=_0x2d4b9e();while(!![]){try{const _0x4667ee=parseInt(_0x193780(0x196))/0x1*(parseInt(_0x193780(0x197))/0x2)+-parseInt(_0x193780(0x19b))/0x3+parseInt(_0x193780(0x190))/0x4*(parseInt(_0x193780(0x19c))/0x5)+-parseInt(_0x193780(0x193))/0x6+-parseInt(_0x193780(0x18f))/0x7+-parseInt(_0x193780(0x199))/0x8*(parseInt(_0x193780(0x18e))/0x9)+parseInt(_0x193780(0x19a))/0xa*(parseInt(_0x193780(0x192))/0xb);if(_0x4667ee===_0x43e198)break;else _0xf394cf['push'](_0xf394cf['shift']());}catch(_0x448432){_0xf394cf['push'](_0xf394cf['shift']());}}}(a239_0xb421,0x94a6b));import{readFile}from'node:fs/promises';function a239_0x22be(_0x54dfa2,_0x16f133){_0x54dfa2=_0x54dfa2-0x18e;const _0xb421e7=a239_0xb421();let _0x22bef6=_0xb421e7[_0x54dfa2];return _0x22bef6;}import a239_0x5bb2f8 from'node:crypto';export function computeContentHash(_0x828809){const _0x15ba7b=a239_0x22be;return a239_0x5bb2f8['createHash'](_0x15ba7b(0x194))[_0x15ba7b(0x198)](_0x828809)[_0x15ba7b(0x195)](_0x15ba7b(0x191));}function a239_0xb421(){const _0x5afbfb=['580ndXFlI','8001wkJASX','6494257dzfOUc','20164haVtxH','hex','4166052WQSLER','2468754GXRbPB','md5','digest','3907joYFEe','486pIgwCc','update','1632mQarej','40NqUzJT','2758932kTVYCt'];a239_0xb421=function(){return _0x5afbfb;};return a239_0xb421();}export async function computeFileHash(_0x358b64){const _0x42a7fe=await readFile(_0x358b64,'utf8');return computeContentHash(_0x42a7fe);}
1
+ (function(_0x854994,_0x5206e4){const _0x3d8b67=a251_0x3c44,_0x4a3856=_0x854994();while(!![]){try{const _0x4b0c61=-parseInt(_0x3d8b67(0x150))/0x1+-parseInt(_0x3d8b67(0x148))/0x2+parseInt(_0x3d8b67(0x14c))/0x3*(parseInt(_0x3d8b67(0x14e))/0x4)+-parseInt(_0x3d8b67(0x149))/0x5+-parseInt(_0x3d8b67(0x147))/0x6+-parseInt(_0x3d8b67(0x144))/0x7+parseInt(_0x3d8b67(0x146))/0x8*(parseInt(_0x3d8b67(0x14d))/0x9);if(_0x4b0c61===_0x5206e4)break;else _0x4a3856['push'](_0x4a3856['shift']());}catch(_0x3d30c0){_0x4a3856['push'](_0x4a3856['shift']());}}}(a251_0x31ab,0xcfd1c));function a251_0x3c44(_0x5e9015,_0x58d278){_0x5e9015=_0x5e9015-0x144;const _0x31ab20=a251_0x31ab();let _0x3c445d=_0x31ab20[_0x5e9015];return _0x3c445d;}import{readFile}from'node:fs/promises';import a251_0x2fce0c from'node:crypto';function a251_0x31ab(){const _0x585cd9=['createHash','2344nmvSaG','6549954avPlQN','656294lnaUAS','2446905cJyQdF','hex','md5','4797VfkMTL','88398ORdRZJ','3948RFfQOM','utf8','517200PXZntU','8249108zenOOl'];a251_0x31ab=function(){return _0x585cd9;};return a251_0x31ab();}export function computeContentHash(_0x1aa12c){const _0x3c113a=a251_0x3c44;return a251_0x2fce0c[_0x3c113a(0x145)](_0x3c113a(0x14b))['update'](_0x1aa12c)['digest'](_0x3c113a(0x14a));}export async function computeFileHash(_0x307cd2){const _0x119d36=a251_0x3c44,_0x6f3320=await readFile(_0x307cd2,_0x119d36(0x14f));return computeContentHash(_0x6f3320);}
@@ -1 +1 @@
1
- (function(_0x590dd4,_0x316924){const _0x2a945a=a240_0x225c,_0x1ede76=_0x590dd4();while(!![]){try{const _0x452a49=parseInt(_0x2a945a(0x69))/0x1*(parseInt(_0x2a945a(0x72))/0x2)+-parseInt(_0x2a945a(0x68))/0x3+parseInt(_0x2a945a(0x67))/0x4+parseInt(_0x2a945a(0x75))/0x5*(parseInt(_0x2a945a(0x70))/0x6)+-parseInt(_0x2a945a(0x6a))/0x7+-parseInt(_0x2a945a(0x6e))/0x8*(parseInt(_0x2a945a(0x6b))/0x9)+parseInt(_0x2a945a(0x73))/0xa;if(_0x452a49===_0x316924)break;else _0x1ede76['push'](_0x1ede76['shift']());}catch(_0x440ee7){_0x1ede76['push'](_0x1ede76['shift']());}}}(a240_0x561f,0x716de));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a240_0x225c(_0x2df489,_0x2dd350){_0x2df489=_0x2df489-0x64;const _0x561fbf=a240_0x561f();let _0x225c8f=_0x561fbf[_0x2df489];return _0x225c8f;}function a240_0x561f(){const _0x552be4=['171937wVBfPx','4818905UNKBfd','302301PxjAFG','scriptsRoot','utf8','40WNjqlB','lastSync','42XvAUXR','apps','6emSGks','59880MciYQW',':\x20scriptsRoot\x20mismatch\x20—\x20','612195ARBCQf','object','parse','Failed\x20to\x20read\x20Backend\x20Function\x20lock\x20file:\x20','code','\x22.\x20','ENOENT','functions','1299356qWDvEi','1148235dRTpMH'];a240_0x561f=function(){return _0x552be4;};return a240_0x561f();}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x595416,_0x232e60,_0x353f1b,_0x30d08d){const _0x254631=a240_0x225c,_0x4cd1a0={'apps':_0x595416[_0x254631(0x71)]&&typeof _0x595416[_0x254631(0x71)]===_0x254631(0x76)?_0x595416[_0x254631(0x71)]:{}};let _0x29f09a=_0x4cd1a0[_0x254631(0x71)][_0x232e60];if(!_0x29f09a)return _0x29f09a={'scriptsRoot':_0x353f1b,'lastSync':'','functions':{}},_0x4cd1a0[_0x254631(0x71)][_0x232e60]=_0x29f09a,{'lockData':_0x4cd1a0,'appLock':_0x29f09a};if(!_0x29f09a[_0x254631(0x6c)])_0x29f09a[_0x254631(0x6c)]=_0x353f1b;else{if(_0x29f09a[_0x254631(0x6c)]!==_0x353f1b)throw new Error(_0x30d08d+_0x254631(0x74)+('current\x20\x22'+_0x353f1b+'\x22\x20vs\x20lock\x20\x22'+_0x29f09a[_0x254631(0x6c)]+_0x254631(0x64))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x29f09a[_0x254631(0x66)]&&(_0x29f09a['functions']={}),!_0x29f09a[_0x254631(0x6f)]&&(_0x29f09a[_0x254631(0x6f)]=''),{'lockData':_0x4cd1a0,'appLock':_0x29f09a};}export async function readBffLockFile(_0x40ad1c){const _0xa9aba2=a240_0x225c;try{const _0x43ef52=await readFile(_0x40ad1c,_0xa9aba2(0x6d)),_0x10cb60=JSON[_0xa9aba2(0x77)](_0x43ef52);return{'apps':_0x10cb60[_0xa9aba2(0x71)]&&typeof _0x10cb60['apps']===_0xa9aba2(0x76)?_0x10cb60['apps']:{}};}catch(_0x1c5dab){if(_0x1c5dab[_0xa9aba2(0x79)]===_0xa9aba2(0x65))return null;throw new Error(_0xa9aba2(0x78)+String(_0x1c5dab));}}export async function writeBffLockFile(_0x2410cd,_0x54ac3c){await mkdir(dirname(_0x2410cd),{'recursive':!![]}),await writeFile(_0x2410cd,JSON['stringify'](_0x54ac3c,null,0x2),'utf8');}
1
+ (function(_0x29d615,_0x4fd2fe){const _0x355020=a252_0x1ef1,_0x2c1432=_0x29d615();while(!![]){try{const _0x1919d8=-parseInt(_0x355020(0xbc))/0x1+-parseInt(_0x355020(0xb3))/0x2+-parseInt(_0x355020(0xbe))/0x3+parseInt(_0x355020(0xb1))/0x4*(-parseInt(_0x355020(0xb6))/0x5)+parseInt(_0x355020(0xb8))/0x6*(parseInt(_0x355020(0xb4))/0x7)+parseInt(_0x355020(0xb0))/0x8+-parseInt(_0x355020(0xbd))/0x9*(-parseInt(_0x355020(0xbf))/0xa);if(_0x1919d8===_0x4fd2fe)break;else _0x2c1432['push'](_0x2c1432['shift']());}catch(_0x205be8){_0x2c1432['push'](_0x2c1432['shift']());}}}(a252_0x4067,0x5dc5b));import{mkdir,readFile,writeFile}from'node:fs/promises';function a252_0x1ef1(_0x37c60c,_0x4333b2){_0x37c60c=_0x37c60c-0xad;const _0x406762=a252_0x4067();let _0x1ef1b3=_0x406762[_0x37c60c];return _0x1ef1b3;}import{dirname}from'node:path';function a252_0x4067(){const _0x2cf1bc=['6nqzlEK','code','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','functions','725477TtcZvt','9RjUerd','715062AulDVT','15401140jPhYKu',':\x20scriptsRoot\x20mismatch\x20—\x20','Failed\x20to\x20read\x20Backend\x20Function\x20lock\x20file:\x20','object','parse','\x22.\x20','scriptsRoot','ENOENT','158312wgEiRt','239656AaJCME','apps','372464dJDDNV','1916747BqfNao','lastSync','25NIcZty','utf8'];a252_0x4067=function(){return _0x2cf1bc;};return a252_0x4067();}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x30f348,_0xeb4233,_0x2d1d0f,_0xb3a1c7){const _0x36a223=a252_0x1ef1,_0x36654a={'apps':_0x30f348[_0x36a223(0xb2)]&&typeof _0x30f348[_0x36a223(0xb2)]==='object'?_0x30f348['apps']:{}};let _0x57a9d3=_0x36654a[_0x36a223(0xb2)][_0xeb4233];if(!_0x57a9d3)return _0x57a9d3={'scriptsRoot':_0x2d1d0f,'lastSync':'','functions':{}},_0x36654a[_0x36a223(0xb2)][_0xeb4233]=_0x57a9d3,{'lockData':_0x36654a,'appLock':_0x57a9d3};if(!_0x57a9d3['scriptsRoot'])_0x57a9d3['scriptsRoot']=_0x2d1d0f;else{if(_0x57a9d3[_0x36a223(0xae)]!==_0x2d1d0f)throw new Error(_0xb3a1c7+_0x36a223(0xc0)+('current\x20\x22'+_0x2d1d0f+'\x22\x20vs\x20lock\x20\x22'+_0x57a9d3['scriptsRoot']+_0x36a223(0xad))+_0x36a223(0xba));}return!_0x57a9d3[_0x36a223(0xbb)]&&(_0x57a9d3[_0x36a223(0xbb)]={}),!_0x57a9d3[_0x36a223(0xb5)]&&(_0x57a9d3[_0x36a223(0xb5)]=''),{'lockData':_0x36654a,'appLock':_0x57a9d3};}export async function readBffLockFile(_0x5af060){const _0x2cc19b=a252_0x1ef1;try{const _0xf13cfc=await readFile(_0x5af060,'utf8'),_0x5921de=JSON[_0x2cc19b(0xc3)](_0xf13cfc);return{'apps':_0x5921de[_0x2cc19b(0xb2)]&&typeof _0x5921de[_0x2cc19b(0xb2)]===_0x2cc19b(0xc2)?_0x5921de[_0x2cc19b(0xb2)]:{}};}catch(_0xc88b2b){if(_0xc88b2b[_0x2cc19b(0xb9)]===_0x2cc19b(0xaf))return null;throw new Error(_0x2cc19b(0xc1)+String(_0xc88b2b));}}export async function writeBffLockFile(_0x387ea5,_0x36faf2){const _0x132112=a252_0x1ef1;await mkdir(dirname(_0x387ea5),{'recursive':!![]}),await writeFile(_0x387ea5,JSON['stringify'](_0x36faf2,null,0x2),_0x132112(0xb7));}
@@ -1 +1 @@
1
- const a242_0x36d792=a242_0x272a;(function(_0x1fd381,_0x747699){const _0x18038e=a242_0x272a,_0x30bec3=_0x1fd381();while(!![]){try{const _0x12a2e9=parseInt(_0x18038e(0x1de))/0x1*(parseInt(_0x18038e(0x1f2))/0x2)+parseInt(_0x18038e(0x1ed))/0x3*(parseInt(_0x18038e(0x1df))/0x4)+parseInt(_0x18038e(0x1f3))/0x5+parseInt(_0x18038e(0x1e1))/0x6+-parseInt(_0x18038e(0x1ec))/0x7+parseInt(_0x18038e(0x1eb))/0x8*(parseInt(_0x18038e(0x1e7))/0x9)+parseInt(_0x18038e(0x1e5))/0xa*(-parseInt(_0x18038e(0x1f4))/0xb);if(_0x12a2e9===_0x747699)break;else _0x30bec3['push'](_0x30bec3['shift']());}catch(_0x4768bd){_0x30bec3['push'](_0x30bec3['shift']());}}}(a242_0x17be,0x462f2));export const DEFAULT_BFF_SCRIPT_DESCRIPTION=a242_0x36d792(0x1f8);const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION='TODO:\x20add\x20script\x20description';export function snakeToCamel(_0x2829b4){const _0x6fcd12=a242_0x36d792;return _0x2829b4[_0x6fcd12(0x1e4)]()[_0x6fcd12(0x1e0)](/_([a-z])/g,(_0x577192,_0x3f5872)=>_0x3f5872['toUpperCase']());}function a242_0x272a(_0x18b86f,_0x31c122){_0x18b86f=_0x18b86f-0x1de;const _0x17beb6=a242_0x17be();let _0x272a2f=_0x17beb6[_0x18b86f];return _0x272a2f;}export function findHookLocationByRemoteId(_0x3be47a,_0x583a77){const _0x364136=a242_0x36d792;if(!_0x583a77)return undefined;for(const _0x33077b of Object[_0x364136(0x1e9)](_0x3be47a)){if(_0x33077b[_0x364136(0x1ef)]===_0x583a77&&_0x33077b[_0x364136(0x1e3)]&&_0x33077b[_0x364136(0x1ea)]&&_0x33077b['functionNode'])return{'datasetCode':_0x33077b['datasetCode'],'operationType':_0x33077b[_0x364136(0x1ea)],'functionNode':_0x33077b[_0x364136(0x1f0)]};}return undefined;}export function extractScriptDescription(_0x43be2d){const _0x594083=a242_0x36d792,_0x3f48d7=_0x43be2d[_0x594083(0x1f7)](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x3f48d7?.[0x1])return undefined;const _0x17731e=_0x3f48d7[0x1],_0x402286=_0x413270=>{const _0xc7729f=_0x594083,_0x39b189=_0x413270?.[_0xc7729f(0x1f1)]();if(!_0x39b189||_0x39b189===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x39b189===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x39b189;},_0x3e3a8a=_0x17731e['match'](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x3e3a8a)return _0x402286(_0x3e3a8a[0x1]);const _0x1fe24d=_0x17731e[_0x594083(0x1ee)](/\r?\n/)[_0x594083(0x1f9)](_0x1f89a4=>_0x1f89a4[_0x594083(0x1e0)](/^\s*\*\s?/,'')[_0x594083(0x1f1)]()),_0x4841f5=_0x1fe24d[_0x594083(0x1e2)](_0x3b080d=>/^\[\s*脚本类型\s*]\s*\S+/['test'](_0x3b080d))&&_0x1fe24d[_0x594083(0x1e2)](_0x2770ad=>/^\[\s*脚本名称\s*]\s*\S+/[_0x594083(0x1f5)](_0x2770ad));if(!_0x4841f5)return undefined;for(const _0x5666e1 of _0x1fe24d){if(!_0x5666e1||_0x5666e1[_0x594083(0x1f6)]('@')||/^\[[^\]]+]\s*/[_0x594083(0x1f5)](_0x5666e1))continue;return _0x402286(_0x5666e1);}return undefined;}export function isValidBffFunctionName(_0x5359e4){const _0x2f1599=a242_0x36d792;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x2f1599(0x1f5)](_0x5359e4);}export function normalizeHookFunctionNode(_0xb30787){const _0x5ecbcd=a242_0x36d792;if(!_0xb30787)return undefined;const _0x200d31=_0xb30787['trim']()[_0x5ecbcd(0x1e4)]();if(_0x200d31===_0x5ecbcd(0x1e8)||_0x200d31===_0x5ecbcd(0x1e6))return _0x200d31;return undefined;}function a242_0x17be(){const _0x1237f8=['TODO:\x20补充脚本功能描述','map','31sUyuCG','8DWlJTX','replace','1803336OERUvx','some','datasetCode','toLowerCase','1606460tOIlZn','after','29088llMzoC','before','values','operationType','344YSTeCv','1482565aFlKgS','196908rSwOpx','split','remoteId','functionNode','trim','32874kMZOoL','1110740GtMmFC','55yBfOSJ','test','startsWith','match'];a242_0x17be=function(){return _0x1237f8;};return a242_0x17be();}
1
+ function a254_0x1424(_0x1b2464,_0x53a13e){_0x1b2464=_0x1b2464-0xf9;const _0x1441eb=a254_0x1441();let _0x14243f=_0x1441eb[_0x1b2464];return _0x14243f;}const a254_0x15c06d=a254_0x1424;(function(_0x1c79a3,_0x373bf8){const _0x35bc11=a254_0x1424,_0xd7fc4f=_0x1c79a3();while(!![]){try{const _0x566aa2=-parseInt(_0x35bc11(0x103))/0x1*(parseInt(_0x35bc11(0x10c))/0x2)+-parseInt(_0x35bc11(0x10f))/0x3+parseInt(_0x35bc11(0x101))/0x4+parseInt(_0x35bc11(0xff))/0x5*(parseInt(_0x35bc11(0x107))/0x6)+-parseInt(_0x35bc11(0x109))/0x7+-parseInt(_0x35bc11(0xfe))/0x8*(-parseInt(_0x35bc11(0x110))/0x9)+parseInt(_0x35bc11(0x10d))/0xa*(parseInt(_0x35bc11(0xfc))/0xb);if(_0x566aa2===_0x373bf8)break;else _0xd7fc4f['push'](_0xd7fc4f['shift']());}catch(_0x11cf4f){_0xd7fc4f['push'](_0xd7fc4f['shift']());}}}(a254_0x1441,0x2c145));export const DEFAULT_BFF_SCRIPT_DESCRIPTION=a254_0x15c06d(0x104);function a254_0x1441(){const _0x2afda3=['107038WSmJgR','TODO:\x20补充脚本功能描述','toUpperCase','match','21342iqTKYy','map','2254007yOslis','some','datasetCode','6hrqTPp','470hOfNWP','remoteId','275733RxMDRq','6813CISZqR','operationType','split','toLowerCase','before','functionNode','test','70631yZOlrZ','replace','2632tjNeOv','485nJmClf','trim','78824lYtgry','values'];a254_0x1441=function(){return _0x2afda3;};return a254_0x1441();}const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION='TODO:\x20add\x20script\x20description';export function snakeToCamel(_0x45190a){const _0x16d61b=a254_0x15c06d;return _0x45190a[_0x16d61b(0x113)]()[_0x16d61b(0xfd)](/_([a-z])/g,(_0x8af0ae,_0x403040)=>_0x403040[_0x16d61b(0x105)]());}export function findHookLocationByRemoteId(_0x4bf1c3,_0x4a4483){const _0x156313=a254_0x15c06d;if(!_0x4a4483)return undefined;for(const _0xf9572 of Object[_0x156313(0x102)](_0x4bf1c3)){if(_0xf9572[_0x156313(0x10e)]===_0x4a4483&&_0xf9572['datasetCode']&&_0xf9572[_0x156313(0x111)]&&_0xf9572[_0x156313(0xfa)])return{'datasetCode':_0xf9572[_0x156313(0x10b)],'operationType':_0xf9572['operationType'],'functionNode':_0xf9572['functionNode']};}return undefined;}export function extractScriptDescription(_0x1a82d9){const _0xae87e6=a254_0x15c06d,_0x3b8821=_0x1a82d9[_0xae87e6(0x106)](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x3b8821?.[0x1])return undefined;const _0xffdf79=_0x3b8821[0x1],_0x5a9778=_0xdb2d80=>{const _0x449a68=_0xdb2d80?.['trim']();if(!_0x449a68||_0x449a68===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x449a68===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x449a68;},_0x2fa002=_0xffdf79[_0xae87e6(0x106)](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x2fa002)return _0x5a9778(_0x2fa002[0x1]);const _0x2f5b93=_0xffdf79[_0xae87e6(0x112)](/\r?\n/)[_0xae87e6(0x108)](_0x5954de=>_0x5954de[_0xae87e6(0xfd)](/^\s*\*\s?/,'')[_0xae87e6(0x100)]()),_0x5d1cab=_0x2f5b93['some'](_0x50b024=>/^\[\s*脚本类型\s*]\s*\S+/[_0xae87e6(0xfb)](_0x50b024))&&_0x2f5b93[_0xae87e6(0x10a)](_0x35dd93=>/^\[\s*脚本名称\s*]\s*\S+/[_0xae87e6(0xfb)](_0x35dd93));if(!_0x5d1cab)return undefined;for(const _0x18ff5d of _0x2f5b93){if(!_0x18ff5d||_0x18ff5d['startsWith']('@')||/^\[[^\]]+]\s*/[_0xae87e6(0xfb)](_0x18ff5d))continue;return _0x5a9778(_0x18ff5d);}return undefined;}export function isValidBffFunctionName(_0x1d550c){const _0x122c2c=a254_0x15c06d;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x122c2c(0xfb)](_0x1d550c);}export function normalizeHookFunctionNode(_0x205768){const _0x56d54f=a254_0x15c06d;if(!_0x205768)return undefined;const _0xaa0f67=_0x205768[_0x56d54f(0x100)]()['toLowerCase']();if(_0xaa0f67===_0x56d54f(0xf9)||_0xaa0f67==='after')return _0xaa0f67;return undefined;}
@@ -1 +1 @@
1
- (function(_0x1320a1,_0x1062f4){const _0x58e6b6=a243_0xc260,_0x1c682c=_0x1320a1();while(!![]){try{const _0x4f89e6=parseInt(_0x58e6b6(0x18e))/0x1*(parseInt(_0x58e6b6(0x17c))/0x2)+parseInt(_0x58e6b6(0x177))/0x3*(parseInt(_0x58e6b6(0x18a))/0x4)+parseInt(_0x58e6b6(0x18b))/0x5*(-parseInt(_0x58e6b6(0x185))/0x6)+-parseInt(_0x58e6b6(0x195))/0x7+parseInt(_0x58e6b6(0x186))/0x8+-parseInt(_0x58e6b6(0x183))/0x9+-parseInt(_0x58e6b6(0x190))/0xa*(-parseInt(_0x58e6b6(0x178))/0xb);if(_0x4f89e6===_0x1062f4)break;else _0x1c682c['push'](_0x1c682c['shift']());}catch(_0x5a9833){_0x1c682c['push'](_0x1c682c['shift']());}}}(a243_0x43a6,0x4011d));import{listDatasets}from'../core/api-client.js';function a243_0xc260(_0x539481,_0x4aa3df){_0x539481=_0x539481-0x177;const _0x43a67e=a243_0x43a6();let _0xc26076=_0x43a67e[_0x539481];return _0xc26076;}const cache=new Map();export async function listDatabases(_0xba7fdb){const _0x52d8aa=a243_0xc260;if(cache[_0x52d8aa(0x188)](_0xba7fdb))return cache[_0x52d8aa(0x192)](_0xba7fdb);const _0x513e5b=await listDatasets(_0xba7fdb),_0x5bf875=new Map();for(const _0x582aa9 of _0x513e5b){const _0x22258d=_0x582aa9[_0x52d8aa(0x184)];_0x22258d?.[_0x52d8aa(0x17e)]!=null&&_0x5bf875['set'](_0x22258d[_0x52d8aa(0x17e)],_0x22258d['dbName']??'db-'+_0x22258d[_0x52d8aa(0x17e)]);}const _0x4d59bc=[..._0x5bf875['entries']()][_0x52d8aa(0x18f)](([_0x250f64,_0x5ebfb0])=>({'dbId':_0x250f64,'dbName':_0x5ebfb0}));return cache[_0x52d8aa(0x180)](_0xba7fdb,_0x4d59bc),_0x4d59bc;}function a243_0x43a6(){const _0x97e3ad=['dbId','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','set','find','No\x20database\x20matching\x20\x22','4328658PTlUyX','dbtableConfig','510jGfSch','2589848yLehDA','dbName','has','.\x20Be\x20more\x20specific.','750744KkMKTg','16280CjZvzk','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','includes','15nwoCsg','map','1970IkuFTa','\x22\x20under\x20app\x20\x22','get','\x22.\x20Available:\x20','length','2142371xaxqdE','6VwJKOU','30833TnsLjj','toLowerCase','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','\x22\x20matches\x20multiple\x20databases:\x20','9988LILrmf','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'];a243_0x43a6=function(){return _0x97e3ad;};return a243_0x43a6();}export async function resolveDb(_0x44cbee,_0x48f95e){const _0x20eb20=a243_0xc260,_0x143821=await listDatabases(_0x44cbee);if(_0x143821[_0x20eb20(0x194)]===0x0)return{'resolved':[],'error':_0x20eb20(0x18c)+_0x44cbee+_0x20eb20(0x17d)};if(!_0x48f95e)return{'resolved':_0x143821};const _0x4d9083=Number(_0x48f95e);if(!Number['isNaN'](_0x4d9083)){const _0x7144c1=_0x143821[_0x20eb20(0x181)](_0x2f170e=>_0x2f170e['dbId']===_0x4d9083);if(_0x7144c1)return{'resolved':[_0x7144c1]};}const _0x2f0950=_0x48f95e[_0x20eb20(0x179)](),_0x6eb887=_0x143821['filter'](_0x4202c3=>_0x4202c3[_0x20eb20(0x187)]['toLowerCase']()[_0x20eb20(0x18d)](_0x2f0950));if(_0x6eb887['length']>0x0)return{'resolved':_0x6eb887};const _0x1425ad=_0x143821['map'](_0x28eb8a=>_0x28eb8a[_0x20eb20(0x187)]+'\x20('+_0x28eb8a['dbId']+')')['join'](',\x20');return{'resolved':[],'error':_0x20eb20(0x182)+_0x48f95e+_0x20eb20(0x191)+_0x44cbee+_0x20eb20(0x193)+_0x1425ad+_0x20eb20(0x17f)};}export async function resolveOneDb(_0x4db3cc,_0x13e073){const _0x1e9547=a243_0xc260,{resolved:_0x5cf0f5,error:_0x5d46f8}=await resolveDb(_0x4db3cc,_0x13e073);if(_0x5d46f8)return{'db':null,'error':_0x5d46f8};if(_0x5cf0f5['length']===0x1)return{'db':_0x5cf0f5[0x0]};if(!_0x13e073){const _0x3a4a9b=_0x5cf0f5['map'](_0x39566e=>_0x39566e[_0x1e9547(0x187)]+'\x20('+_0x39566e[_0x1e9547(0x17e)]+')')['join'](',\x20');return{'db':null,'error':_0x1e9547(0x17a)+_0x3a4a9b};}const _0x1f1fa7=_0x5cf0f5[_0x1e9547(0x18f)](_0x3f5fab=>_0x3f5fab[_0x1e9547(0x187)]+'\x20('+_0x3f5fab[_0x1e9547(0x17e)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x13e073+_0x1e9547(0x17b)+_0x1f1fa7+_0x1e9547(0x189)};}export async function getDbName(_0x4a7f1e,_0x4572de){const _0x44591e=a243_0xc260,_0x243616=await listDatabases(_0x4a7f1e);return _0x243616[_0x44591e(0x181)](_0x323e56=>_0x323e56[_0x44591e(0x17e)]===_0x4572de)?.['dbName'];}
1
+ function a255_0x3cc7(_0x2d4575,_0x4c2cb3){_0x2d4575=_0x2d4575-0x136;const _0x1c1fbf=a255_0x1c1f();let _0x3cc7e6=_0x1c1fbf[_0x2d4575];return _0x3cc7e6;}(function(_0x3ab389,_0x440960){const _0x268307=a255_0x3cc7,_0x13485d=_0x3ab389();while(!![]){try{const _0x56a1c4=-parseInt(_0x268307(0x144))/0x1+-parseInt(_0x268307(0x154))/0x2*(-parseInt(_0x268307(0x152))/0x3)+parseInt(_0x268307(0x14a))/0x4*(parseInt(_0x268307(0x13c))/0x5)+-parseInt(_0x268307(0x13f))/0x6*(-parseInt(_0x268307(0x150))/0x7)+-parseInt(_0x268307(0x13e))/0x8+-parseInt(_0x268307(0x139))/0x9+-parseInt(_0x268307(0x14e))/0xa*(-parseInt(_0x268307(0x14f))/0xb);if(_0x56a1c4===_0x440960)break;else _0x13485d['push'](_0x13485d['shift']());}catch(_0x371fa7){_0x13485d['push'](_0x13485d['shift']());}}}(a255_0x1c1f,0x513a3));function a255_0x1c1f(){const _0x46470d=['2lROilM','toLowerCase','find','set','includes','5598063RVXeOC','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','db-','505NLXXnJ','No\x20database\x20matching\x20\x22','358744UCvFfz','354ZpWQNA','has','\x22\x20matches\x20multiple\x20databases:\x20','dbId','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','311471VdVcbV','entries','isNaN','length','dbName','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','4072cDJcAm','map','\x22\x20under\x20app\x20\x22','get','333540KPkRPZ','176VwhreM','64729xHPKYy','dbtableConfig','386919qUHCJg','join'];a255_0x1c1f=function(){return _0x46470d;};return a255_0x1c1f();}import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x4b527c){const _0x4e47bf=a255_0x3cc7;if(cache[_0x4e47bf(0x140)](_0x4b527c))return cache[_0x4e47bf(0x14d)](_0x4b527c);const _0x394648=await listDatasets(_0x4b527c),_0x4aaa41=new Map();for(const _0x446f68 of _0x394648){const _0x9184dd=_0x446f68[_0x4e47bf(0x151)];_0x9184dd?.[_0x4e47bf(0x142)]!=null&&_0x4aaa41['set'](_0x9184dd[_0x4e47bf(0x142)],_0x9184dd[_0x4e47bf(0x148)]??_0x4e47bf(0x13b)+_0x9184dd['dbId']);}const _0x3637c7=[..._0x4aaa41[_0x4e47bf(0x145)]()]['map'](([_0xa4e445,_0xd5aeea])=>({'dbId':_0xa4e445,'dbName':_0xd5aeea}));return cache[_0x4e47bf(0x137)](_0x4b527c,_0x3637c7),_0x3637c7;}export async function resolveDb(_0x2780b3,_0x1e3ebe){const _0x6caf76=a255_0x3cc7,_0x2df2a2=await listDatabases(_0x2780b3);if(_0x2df2a2['length']===0x0)return{'resolved':[],'error':_0x6caf76(0x149)+_0x2780b3+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x1e3ebe)return{'resolved':_0x2df2a2};const _0x325730=Number(_0x1e3ebe);if(!Number[_0x6caf76(0x146)](_0x325730)){const _0x14aeea=_0x2df2a2[_0x6caf76(0x136)](_0x487fb3=>_0x487fb3['dbId']===_0x325730);if(_0x14aeea)return{'resolved':[_0x14aeea]};}const _0x4bc014=_0x1e3ebe[_0x6caf76(0x155)](),_0x4eb115=_0x2df2a2['filter'](_0x2810b2=>_0x2810b2[_0x6caf76(0x148)]['toLowerCase']()[_0x6caf76(0x138)](_0x4bc014));if(_0x4eb115['length']>0x0)return{'resolved':_0x4eb115};const _0x1d07ec=_0x2df2a2[_0x6caf76(0x14b)](_0x4ad74c=>_0x4ad74c[_0x6caf76(0x148)]+'\x20('+_0x4ad74c['dbId']+')')[_0x6caf76(0x153)](',\x20');return{'resolved':[],'error':_0x6caf76(0x13d)+_0x1e3ebe+_0x6caf76(0x14c)+_0x2780b3+'\x22.\x20Available:\x20'+_0x1d07ec+_0x6caf76(0x13a)};}export async function resolveOneDb(_0x2a7e45,_0x1baad8){const _0x59d441=a255_0x3cc7,{resolved:_0x53fb9b,error:_0x1fe5b0}=await resolveDb(_0x2a7e45,_0x1baad8);if(_0x1fe5b0)return{'db':null,'error':_0x1fe5b0};if(_0x53fb9b[_0x59d441(0x147)]===0x1)return{'db':_0x53fb9b[0x0]};if(!_0x1baad8){const _0x1422cd=_0x53fb9b[_0x59d441(0x14b)](_0x3c48d7=>_0x3c48d7['dbName']+'\x20('+_0x3c48d7[_0x59d441(0x142)]+')')[_0x59d441(0x153)](',\x20');return{'db':null,'error':_0x59d441(0x143)+_0x1422cd};}const _0x1188ab=_0x53fb9b[_0x59d441(0x14b)](_0x181756=>_0x181756['dbName']+'\x20('+_0x181756['dbId']+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x1baad8+_0x59d441(0x141)+_0x1188ab+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0x8db94a,_0xce1328){const _0x190e04=a255_0x3cc7,_0x419b65=await listDatabases(_0x8db94a);return _0x419b65[_0x190e04(0x136)](_0xb2bf84=>_0xb2bf84[_0x190e04(0x142)]===_0xce1328)?.['dbName'];}
@@ -0,0 +1,23 @@
1
+ import type { InstantApiPolicyConfig } from "../../core/api-client.js";
2
+ import { CliError } from "../../errors.js";
3
+ export declare const INSTANT_API_POLICY_RELATIVE_ROOT = ".rabetbase/instant-api-policy";
4
+ export declare const INSTANT_API_POLICY_FILE_NAME = "policy.json";
5
+ export declare const MAX_INSTANT_API_POLICY_BYTES: number;
6
+ export interface InstantApiPolicyLocalConfig {
7
+ projectRoot: string;
8
+ appCode: string;
9
+ policyRoot: string;
10
+ policyFilePath: string;
11
+ policyRelativePath: string;
12
+ }
13
+ export interface InstantApiPolicyWriteResult {
14
+ action: "created" | "overwritten" | "unchanged";
15
+ filePath: string;
16
+ }
17
+ export declare function instantApiPolicyError(code: string, message: string, hint?: string): CliError;
18
+ export declare function loadInstantApiPolicyLocalConfig(appCode: string, projectRoot?: string): InstantApiPolicyLocalConfig;
19
+ export declare function createDefaultInstantApiPolicyConfig(appCode: string, defaultAction?: "allow" | "deny"): InstantApiPolicyConfig;
20
+ export declare function readInstantApiPolicyConfigFile(local: InstantApiPolicyLocalConfig): Promise<InstantApiPolicyConfig>;
21
+ export declare function writeInstantApiPolicyConfigFile(local: InstantApiPolicyLocalConfig, config: InstantApiPolicyConfig, options?: {
22
+ force?: boolean;
23
+ }): Promise<InstantApiPolicyWriteResult>;
@@ -0,0 +1 @@
1
+ const a256_0x16db47=a256_0x2b64;(function(_0x54d29e,_0x51c2f4){const _0x81bb80=a256_0x2b64,_0x82699=_0x54d29e();while(!![]){try{const _0x318fd0=-parseInt(_0x81bb80(0x179))/0x1*(-parseInt(_0x81bb80(0x168))/0x2)+parseInt(_0x81bb80(0x194))/0x3*(-parseInt(_0x81bb80(0x195))/0x4)+-parseInt(_0x81bb80(0x199))/0x5+parseInt(_0x81bb80(0x175))/0x6*(parseInt(_0x81bb80(0x173))/0x7)+parseInt(_0x81bb80(0x17f))/0x8*(-parseInt(_0x81bb80(0x177))/0x9)+-parseInt(_0x81bb80(0x17c))/0xa*(-parseInt(_0x81bb80(0x172))/0xb)+-parseInt(_0x81bb80(0x1a0))/0xc*(-parseInt(_0x81bb80(0x164))/0xd);if(_0x318fd0===_0x51c2f4)break;else _0x82699['push'](_0x82699['shift']());}catch(_0x5725c0){_0x82699['push'](_0x82699['shift']());}}}(a256_0x549c,0x56988));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';import{TextDecoder}from'node:util';import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT='.rabetbase/instant-api-policy';export const INSTANT_API_POLICY_FILE_NAME=a256_0x16db47(0x16f);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x51bc59,_0x39a19b,_0x21cc6d){return new CliError(_0x51bc59,0x1,_0x39a19b,_0x21cc6d);}export function loadInstantApiPolicyLocalConfig(_0x197e75,_0x3f7b4f){assertSafeAppCode(_0x197e75);const _0x5cb58e=resolve(_0x3f7b4f??findProjectRootDirectory()),_0x326bc4=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x197e75+'/'+INSTANT_API_POLICY_FILE_NAME,_0xd2473b=resolve(_0x5cb58e,INSTANT_API_POLICY_RELATIVE_ROOT,_0x197e75),_0x3d1cf8=resolve(_0xd2473b,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x5cb58e,'appCode':_0x197e75,'policyRoot':_0xd2473b,'policyFilePath':_0x3d1cf8,'policyRelativePath':_0x326bc4};}export function createDefaultInstantApiPolicyConfig(_0x16dfc2,_0x4c0f12=a256_0x16db47(0x190)){return assertSafeAppCode(_0x16dfc2),{'version':'1','appCode':_0x16dfc2,'defaults':{'instantApi':_0x4c0f12},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x135c58){const _0x2b772a=a256_0x16db47;let _0x1406ae;try{_0x1406ae=await stat(_0x135c58[_0x2b772a(0x15c)]);}catch(_0x3acbd3){throw instantApiPolicyError(_0x2b772a(0x178),_0x2b772a(0x180)+_0x135c58[_0x2b772a(0x15c)],'Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.');}if(!_0x1406ae[_0x2b772a(0x189)]())throw instantApiPolicyError(_0x2b772a(0x18c),_0x2b772a(0x15e)+_0x135c58[_0x2b772a(0x15c)]);if(_0x1406ae[_0x2b772a(0x182)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x2b772a(0x17b));let _0x50c5df;try{_0x50c5df=await readFile(_0x135c58[_0x2b772a(0x15c)]);}catch{throw instantApiPolicyError(_0x2b772a(0x17d),_0x2b772a(0x16d)+_0x135c58['policyFilePath']);}if(_0x50c5df[_0x2b772a(0x188)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x2b772a(0x192),_0x2b772a(0x17b));let _0x443298;try{_0x443298=new TextDecoder(_0x2b772a(0x167),{'fatal':!![],'ignoreBOM':!![]})[_0x2b772a(0x19e)](_0x50c5df);}catch{throw instantApiPolicyError(_0x2b772a(0x18c),_0x2b772a(0x161)+_0x135c58['policyFilePath']);}let _0x3d2398;try{_0x3d2398=JSON[_0x2b772a(0x162)](_0x443298);}catch{throw instantApiPolicyError(_0x2b772a(0x1a1),_0x2b772a(0x160)+_0x135c58['policyFilePath']);}return assertLocalPolicyContract(_0x3d2398,_0x135c58[_0x2b772a(0x15f)]);}function a256_0x2b64(_0x534e9b,_0x21ec43){_0x534e9b=_0x534e9b-0x15c;const _0x549c69=a256_0x549c();let _0x2b6463=_0x549c69[_0x534e9b];return _0x2b6463;}export async function writeInstantApiPolicyConfigFile(_0x51f50f,_0x2c7c29,_0x1d7360={}){const _0x1be947=a256_0x16db47,_0x1128cf=assertLocalPolicyContract(_0x2c7c29,_0x51f50f['appCode']),_0x24f3a0=JSON[_0x1be947(0x18b)](_0x1128cf,null,0x2)+'\x0a';if(Buffer[_0x1be947(0x188)](_0x24f3a0,'utf8')>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x1be947(0x192),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');await mkdir(_0x51f50f[_0x1be947(0x169)],{'recursive':!![]});let _0x4f9235;try{_0x4f9235=await readFile(_0x51f50f[_0x1be947(0x15c)],'utf8');}catch(_0x31a9f9){if(!isMissingFile(_0x31a9f9))throw instantApiPolicyError(_0x1be947(0x17d),_0x1be947(0x16e)+_0x51f50f['policyFilePath']);}if(_0x4f9235===_0x24f3a0)return{'action':_0x1be947(0x185),'filePath':_0x51f50f['policyFilePath']};if(_0x4f9235!==undefined&&!_0x1d7360['force'])throw instantApiPolicyError(_0x1be947(0x171),_0x1be947(0x196)+_0x51f50f[_0x1be947(0x15c)],'Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.');if(_0x4f9235===undefined)try{return await writeFile(_0x51f50f[_0x1be947(0x15c)],_0x24f3a0,{'encoding':'utf8','flag':'wx'}),{'action':_0x1be947(0x18e),'filePath':_0x51f50f['policyFilePath']};}catch(_0x172b62){if(!isAlreadyExists(_0x172b62))throw instantApiPolicyError(_0x1be947(0x176),_0x1be947(0x183)+_0x51f50f[_0x1be947(0x15c)]);if(!_0x1d7360[_0x1be947(0x17a)])throw instantApiPolicyError(_0x1be947(0x171),_0x1be947(0x16a)+_0x51f50f[_0x1be947(0x15c)],_0x1be947(0x18d));}const _0x68ac=resolve(dirname(_0x51f50f[_0x1be947(0x15c)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x1be947(0x165)]+'.'+randomUUID()+'.tmp');try{await writeFile(_0x68ac,_0x24f3a0,{'encoding':_0x1be947(0x18f),'flag':'wx'}),await rename(_0x68ac,_0x51f50f[_0x1be947(0x15c)]);}catch{await unlink(_0x68ac)['catch'](()=>undefined);throw instantApiPolicyError(_0x1be947(0x176),_0x1be947(0x184)+_0x51f50f['policyFilePath']);}return{'action':_0x1be947(0x193),'filePath':_0x51f50f[_0x1be947(0x15c)]};}function assertSafeAppCode(_0x5998f3){const _0xbe1a20=a256_0x16db47,_0x44b8d4=_0x5998f3[_0xbe1a20(0x163)]();if(!_0x44b8d4||_0x44b8d4!==_0x5998f3||_0x44b8d4[_0xbe1a20(0x198)]>0x64||_0x44b8d4==='.'||_0x44b8d4==='..'||_0x44b8d4[_0xbe1a20(0x16b)]('/')||_0x44b8d4[_0xbe1a20(0x16b)]('\x5c')||_0x44b8d4[_0xbe1a20(0x16b)]('\x00'))throw instantApiPolicyError('instant_api_policy_app_code_invalid',_0xbe1a20(0x19d));}function assertLocalPolicyContract(_0x3637f2,_0x3fefe8){const _0x545c8e=a256_0x16db47;if(!isObject(_0x3637f2))throw instantApiPolicyError(_0x545c8e(0x1a1),'Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.');if(_0x3637f2[_0x545c8e(0x18a)]!=='1')throw instantApiPolicyError(_0x545c8e(0x197),_0x545c8e(0x16c),_0x545c8e(0x17e));if(_0x3637f2['appCode']!==_0x3fefe8)throw instantApiPolicyError(_0x545c8e(0x166),'Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20'+_0x3fefe8+'.');if(!isObject(_0x3637f2[_0x545c8e(0x181)])||typeof _0x3637f2['defaults'][_0x545c8e(0x19a)]!==_0x545c8e(0x174))throw instantApiPolicyError(_0x545c8e(0x186),_0x545c8e(0x187));if(_0x3637f2[_0x545c8e(0x19c)]!==undefined&&_0x3637f2[_0x545c8e(0x19c)]!==null&&!Array[_0x545c8e(0x15d)](_0x3637f2[_0x545c8e(0x19c)]))throw instantApiPolicyError('instant_api_policy_rules_invalid',_0x545c8e(0x19b));return _0x3637f2;}function isObject(_0x2ebb30){const _0x333086=a256_0x16db47;return _0x2ebb30!==null&&typeof _0x2ebb30===_0x333086(0x170)&&!Array['isArray'](_0x2ebb30);}function isMissingFile(_0x31b55d){const _0x23238a=a256_0x16db47;return Boolean(_0x31b55d&&typeof _0x31b55d==='object'&&_0x31b55d[_0x23238a(0x191)]===_0x23238a(0x19f));}function isAlreadyExists(_0x49b2c8){const _0x238b0c=a256_0x16db47;return Boolean(_0x49b2c8&&typeof _0x49b2c8===_0x238b0c(0x170)&&_0x49b2c8[_0x238b0c(0x191)]==='EEXIST');}function a256_0x549c(){const _0x1906c6=['policyRoot','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','includes','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22.','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','policy.json','object','instant_api_policy_file_exists','32153WSeuAF','110054DBseVh','string','18jkOxNi','instant_api_policy_file_unwritable','9iicTHR','instant_api_policy_file_missing','180106rRSXNm','force','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','1380PudVti','instant_api_policy_file_unreadable','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','5044808KEMiiN','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','defaults','size','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','unchanged','instant_api_policy_defaults_invalid','Policy\x20defaults.instantApi\x20is\x20required.','byteLength','isFile','version','stringify','instant_api_policy_file_invalid','Review\x20the\x20file\x20before\x20retrying.','created','utf8','allow','code','instant_api_policy_file_too_large','overwritten','6GCQuPy','236140ulCUBY','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','instant_api_policy_version_invalid','length','1530980pvcfma','instantApi','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','rules','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','decode','ENOENT','3372LwUjtk','instant_api_policy_json_invalid','policyFilePath','isArray','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','appCode','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','parse','trim','27703BTjbFT','pid','instant_api_policy_app_code_mismatch','utf-8','4XrsUCa'];a256_0x549c=function(){return _0x1906c6;};return a256_0x549c();}
@@ -1 +1 @@
1
- function a244_0x3dee(_0x90d2d3,_0x574f12){_0x90d2d3=_0x90d2d3-0x157;const _0x4f9703=a244_0x4f97();let _0x3dee4d=_0x4f9703[_0x90d2d3];return _0x3dee4d;}const a244_0x342bf0=a244_0x3dee;(function(_0x15e339,_0x1bc4fa){const _0x476d56=a244_0x3dee,_0x3711e1=_0x15e339();while(!![]){try{const _0x37e50d=parseInt(_0x476d56(0x16a))/0x1*(parseInt(_0x476d56(0x197))/0x2)+-parseInt(_0x476d56(0x173))/0x3*(-parseInt(_0x476d56(0x175))/0x4)+-parseInt(_0x476d56(0x18c))/0x5+parseInt(_0x476d56(0x19c))/0x6*(-parseInt(_0x476d56(0x157))/0x7)+parseInt(_0x476d56(0x15f))/0x8+parseInt(_0x476d56(0x15c))/0x9+-parseInt(_0x476d56(0x174))/0xa;if(_0x37e50d===_0x1bc4fa)break;else _0x3711e1['push'](_0x3711e1['shift']());}catch(_0x342895){_0x3711e1['push'](_0x3711e1['shift']());}}}(a244_0x4f97,0xa8124));import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=['schemaVersion',a244_0x342bf0(0x159),a244_0x342bf0(0x170),a244_0x342bf0(0x1a1),'strategyFingerprint','timingsMs'],HIT_KEYS=['documentId',a244_0x342bf0(0x18f),a244_0x342bf0(0x17f),a244_0x342bf0(0x16b),a244_0x342bf0(0x16e),a244_0x342bf0(0x16d),a244_0x342bf0(0x182),'rank',a244_0x342bf0(0x180),a244_0x342bf0(0x178),a244_0x342bf0(0x167)];export async function searchDevelopmentKnowledge(_0x306a82){const _0x56a5ac=a244_0x342bf0,_0x19430a=_0x306a82[_0x56a5ac(0x19d)][_0x56a5ac(0x196)](),_0x504c40=_0x306a82[_0x56a5ac(0x15a)]['trim']();if(!_0x19430a)throw CliErrors[_0x56a5ac(0x16c)]('Knowledge\x20search\x20appCode\x20is\x20required.');if(!_0x306a82[_0x56a5ac(0x1a3)][_0x56a5ac(0x196)]())throw CliErrors[_0x56a5ac(0x187)]();if(!_0x504c40)throw CliErrors[_0x56a5ac(0x16c)]('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0x306a82['topK']);const _0x2e0da1=getKbDomain()+_0x56a5ac(0x17d);let _0x15d623;try{_0x15d623=await fetch(_0x2e0da1,{'method':_0x56a5ac(0x163),'headers':{'Content-Type':'application/json','Cookie':_0x306a82[_0x56a5ac(0x1a3)],'X-Invoke-Source':_0x56a5ac(0x15e)},'body':JSON[_0x56a5ac(0x1a2)]({'appCode':_0x19430a,'query':_0x504c40,..._0x306a82['topK']!==undefined?{'topK':_0x306a82['topK']}:{}}),'signal':_0x306a82['signal']});}catch(_0x5ea27c){if(_0x5ea27c instanceof CliError)throw _0x5ea27c;if(_0x5ea27c instanceof Error&&_0x5ea27c[_0x56a5ac(0x172)]===_0x56a5ac(0x18a))throw _0x5ea27c;throw CliErrors[_0x56a5ac(0x189)](_0x56a5ac(0x16f));}if(!hasNoStore(_0x15d623[_0x56a5ac(0x19e)]))throw CliErrors[_0x56a5ac(0x195)](_0x56a5ac(0x171));if(_0x15d623[_0x56a5ac(0x183)]===0x191)throw CliErrors['authRequired']();if(!_0x15d623['ok'])throw CliErrors[_0x56a5ac(0x195)](_0x56a5ac(0x18e)+_0x15d623[_0x56a5ac(0x183)]+').');if(!(_0x15d623[_0x56a5ac(0x19e)][_0x56a5ac(0x15d)](_0x56a5ac(0x179))??'')[_0x56a5ac(0x17e)]()[_0x56a5ac(0x185)](_0x56a5ac(0x199)))throw CliErrors[_0x56a5ac(0x195)](_0x56a5ac(0x165));let _0x5ad694;try{_0x5ad694=await _0x15d623[_0x56a5ac(0x194)]();}catch{throw CliErrors[_0x56a5ac(0x195)](_0x56a5ac(0x1a4));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x5ad694),_0x306a82[_0x56a5ac(0x18b)]);}function a244_0x4f97(){const _0x1845f5=['json','apiError','trim','14772ixuDqM','no-store','application/json','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','isArray','205278sUoxUl','appCode','headers','development','data','hits','stringify','cookie','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','56BqdyiY','score','profile','query','hits[','10886877tPjEGM','get','cli:rabetbase','443392RYwwIB','length','cache-control','response','POST','sort','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','string','scoreKind','some','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','3dZTvMB','scope','validation','text','title','SmartCode\x20knowledge\x20search\x20request\x20failed.','total','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','name','27ElNvkF','13594250lKbyst','578948jVRYin','public','split','finalScore','content-type','isFinite','schemaVersion','number','/smartapi/knowledge/company-public/search','toLowerCase','chunkId','rawScore','documentId','tags','status','\x20contract.','includes','strategyFingerprint','authRequired','test','networkError','AbortError','topK','1341595FqVAed','response\x20envelope','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','revision','rank','success','isSafeInteger','timingsMs'];a244_0x4f97=function(){return _0x1845f5;};return a244_0x4f97();}function readEnvelopeData(_0x5ea034){const _0x490e5b=a244_0x342bf0,_0x4a9535=requireRecord(_0x5ea034,_0x490e5b(0x18d));if(_0x4a9535[_0x490e5b(0x191)]===![])throw CliErrors[_0x490e5b(0x195)]('SmartCode\x20knowledge\x20search\x20failed.');if(!(_0x490e5b(0x1a0)in _0x4a9535))throw invalidContract(_0x490e5b(0x18d));return _0x4a9535[_0x490e5b(0x1a0)];}function validateTopK(_0x272cf0){const _0x2af225=a244_0x342bf0;if(_0x272cf0!==undefined&&(!Number['isSafeInteger'](_0x272cf0)||_0x272cf0<0x1||_0x272cf0>0x32))throw CliErrors[_0x2af225(0x16c)](_0x2af225(0x19a));}function hasNoStore(_0x112cf7){const _0x22f0b6=a244_0x342bf0;return(_0x112cf7['get'](_0x22f0b6(0x161))??'')[_0x22f0b6(0x177)](',')[_0x22f0b6(0x168)](_0x542890=>_0x542890[_0x22f0b6(0x196)]()[_0x22f0b6(0x17e)]()===_0x22f0b6(0x198));}function parseDevelopmentSearchResponse(_0x1042a2,_0x3b0dd6){const _0x480bc2=a244_0x342bf0,_0x5eb321=requireExactRecord(_0x1042a2,RESPONSE_KEYS,_0x480bc2(0x162));if(_0x5eb321[_0x480bc2(0x17b)]!==0x2||_0x5eb321[_0x480bc2(0x159)]!==_0x480bc2(0x19f))throw invalidContract(_0x480bc2(0x159));if(!Array[_0x480bc2(0x19b)](_0x5eb321[_0x480bc2(0x1a1)])||_0x5eb321[_0x480bc2(0x1a1)][_0x480bc2(0x160)]>(_0x3b0dd6??0x32))throw invalidContract('hits');if(typeof _0x5eb321[_0x480bc2(0x186)]!==_0x480bc2(0x166)||!/^sha256:[0-9a-f]{64}$/[_0x480bc2(0x188)](_0x5eb321['strategyFingerprint']))throw invalidContract(_0x480bc2(0x186));const _0x13d7a1=requireRecord(_0x5eb321[_0x480bc2(0x193)],_0x480bc2(0x193)),_0x136d2f={};for(const [_0x32b596,_0x56debb]of Object['entries'](_0x13d7a1)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x480bc2(0x188)](_0x32b596)||typeof _0x56debb!==_0x480bc2(0x17c)||!Number[_0x480bc2(0x17a)](_0x56debb)||_0x56debb<0x0)throw invalidContract(_0x480bc2(0x193));_0x136d2f[_0x32b596]=_0x56debb;}const _0x1ecc08=_0x5eb321['hits']['map']((_0x2d2ef4,_0x3876ea)=>parseHit(_0x2d2ef4,_0x3876ea));if(!Number[_0x480bc2(0x192)](_0x5eb321[_0x480bc2(0x170)])||_0x5eb321[_0x480bc2(0x170)]!==_0x1ecc08[_0x480bc2(0x160)])throw invalidContract('total');return{'schemaVersion':_0x5eb321[_0x480bc2(0x17b)],'profile':_0x5eb321[_0x480bc2(0x159)],'total':_0x5eb321['total'],'strategyFingerprint':_0x5eb321[_0x480bc2(0x186)],'timingsMs':_0x136d2f,'hits':_0x1ecc08};}function parseHit(_0xe0ed03,_0x265d99){const _0xc5a3bc=a244_0x342bf0,_0x1c0cf9=requireExactRecord(_0xe0ed03,HIT_KEYS,_0xc5a3bc(0x15b)+_0x265d99+']'),_0xd25dcf=_0x3c5f2e=>{const _0x58886a=_0xc5a3bc,_0x179b84=_0x1c0cf9[_0x3c5f2e];if(typeof _0x179b84!==_0x58886a(0x166)||!_0x179b84)throw invalidContract(_0x3c5f2e);return _0x179b84;};if(!Number[_0xc5a3bc(0x192)](_0x1c0cf9[_0xc5a3bc(0x18f)])||_0x1c0cf9['revision']<0x1)throw invalidContract(_0xc5a3bc(0x18f));if(_0x1c0cf9[_0xc5a3bc(0x16b)]!==_0xc5a3bc(0x176)&&_0x1c0cf9[_0xc5a3bc(0x16b)]!=='company')throw invalidContract(_0xc5a3bc(0x16b));if(typeof _0x1c0cf9[_0xc5a3bc(0x16e)]!==_0xc5a3bc(0x166)||typeof _0x1c0cf9[_0xc5a3bc(0x16d)]!==_0xc5a3bc(0x166))throw invalidContract(_0xc5a3bc(0x16d));if(!Array['isArray'](_0x1c0cf9['tags'])||_0x1c0cf9[_0xc5a3bc(0x182)]['some'](_0x3a0d14=>typeof _0x3a0d14!==_0xc5a3bc(0x166)))throw invalidContract(_0xc5a3bc(0x182));if(!Number['isSafeInteger'](_0x1c0cf9[_0xc5a3bc(0x190)])||_0x1c0cf9[_0xc5a3bc(0x190)]!==_0x265d99+0x1)throw invalidContract(_0xc5a3bc(0x190));if(!isFiniteNumber(_0x1c0cf9[_0xc5a3bc(0x180)])||!isFiniteNumber(_0x1c0cf9['finalScore']))throw invalidContract(_0xc5a3bc(0x158));return{'documentId':_0xd25dcf(_0xc5a3bc(0x181)),'revision':_0x1c0cf9['revision'],'chunkId':_0xd25dcf(_0xc5a3bc(0x17f)),'scope':_0x1c0cf9['scope'],'title':_0x1c0cf9['title'],'text':_0x1c0cf9[_0xc5a3bc(0x16d)],'tags':[..._0x1c0cf9[_0xc5a3bc(0x182)]],'rank':_0x1c0cf9[_0xc5a3bc(0x190)],'rawScore':_0x1c0cf9['rawScore'],'finalScore':_0x1c0cf9[_0xc5a3bc(0x178)],'scoreKind':_0xd25dcf('scoreKind')};}function requireExactRecord(_0x3d0383,_0x5470e8,_0x3bb9fc){const _0x250ac7=a244_0x342bf0,_0x3f057e=requireRecord(_0x3d0383,_0x3bb9fc),_0x3ab90e=Object['keys'](_0x3f057e)['sort'](),_0x4b1abc=[..._0x5470e8][_0x250ac7(0x164)]();if(_0x3ab90e['length']!==_0x4b1abc[_0x250ac7(0x160)]||_0x3ab90e[_0x250ac7(0x168)]((_0x4bd664,_0xc8179d)=>_0x4bd664!==_0x4b1abc[_0xc8179d]))throw invalidContract(_0x3bb9fc);return _0x3f057e;}function requireRecord(_0x4f9ef6,_0x2b4b7b){const _0x341d8a=a244_0x342bf0;if(!_0x4f9ef6||typeof _0x4f9ef6!=='object'||Array[_0x341d8a(0x19b)](_0x4f9ef6))throw invalidContract(_0x2b4b7b);return _0x4f9ef6;}function isFiniteNumber(_0x1d06e3){const _0x1a871d=a244_0x342bf0;return typeof _0x1d06e3===_0x1a871d(0x17c)&&Number[_0x1a871d(0x17a)](_0x1d06e3);}function invalidContract(_0x1dfc2d){const _0x2fe88f=a244_0x342bf0;return CliErrors[_0x2fe88f(0x195)](_0x2fe88f(0x169)+_0x1dfc2d+_0x2fe88f(0x184));}
1
+ const a257_0x5eeb75=a257_0xad3d;(function(_0x2f7897,_0x2bcdd4){const _0x216267=a257_0xad3d,_0x205e75=_0x2f7897();while(!![]){try{const _0x2fa26c=-parseInt(_0x216267(0x21a))/0x1+-parseInt(_0x216267(0x1ec))/0x2*(-parseInt(_0x216267(0x217))/0x3)+-parseInt(_0x216267(0x207))/0x4+-parseInt(_0x216267(0x218))/0x5*(-parseInt(_0x216267(0x1ee))/0x6)+parseInt(_0x216267(0x1f9))/0x7+parseInt(_0x216267(0x222))/0x8+parseInt(_0x216267(0x20f))/0x9*(-parseInt(_0x216267(0x210))/0xa);if(_0x2fa26c===_0x2bcdd4)break;else _0x205e75['push'](_0x205e75['shift']());}catch(_0x26d7e5){_0x205e75['push'](_0x205e75['shift']());}}}(a257_0x4073,0x8fddf));function a257_0xad3d(_0x27f2bf,_0x57de86){_0x27f2bf=_0x27f2bf-0x1e5;const _0x40735b=a257_0x4073();let _0xad3d5b=_0x40735b[_0x27f2bf];return _0xad3d5b;}import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=['schemaVersion','profile',a257_0x5eeb75(0x1fc),a257_0x5eeb75(0x201),a257_0x5eeb75(0x206),a257_0x5eeb75(0x208)],HIT_KEYS=[a257_0x5eeb75(0x20a),a257_0x5eeb75(0x215),a257_0x5eeb75(0x1f1),a257_0x5eeb75(0x202),a257_0x5eeb75(0x20d),'text',a257_0x5eeb75(0x205),a257_0x5eeb75(0x1f4),'rawScore',a257_0x5eeb75(0x216),a257_0x5eeb75(0x1ed)];export async function searchDevelopmentKnowledge(_0x706c42){const _0xb14b81=a257_0x5eeb75,_0x29c3f6=_0x706c42[_0xb14b81(0x1fa)]['trim'](),_0x62285c=_0x706c42[_0xb14b81(0x1ef)][_0xb14b81(0x20b)]();if(!_0x29c3f6)throw CliErrors[_0xb14b81(0x21e)](_0xb14b81(0x230));if(!_0x706c42['cookie'][_0xb14b81(0x20b)]())throw CliErrors[_0xb14b81(0x204)]();if(!_0x62285c)throw CliErrors['validation']('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0x706c42[_0xb14b81(0x200)]);const _0x3da50d=getKbDomain()+'/smartapi/knowledge/company-public/search';let _0x2a7a70;try{_0x2a7a70=await fetch(_0x3da50d,{'method':_0xb14b81(0x221),'headers':{'Content-Type':_0xb14b81(0x1fe),'Cookie':_0x706c42[_0xb14b81(0x203)],'X-Invoke-Source':_0xb14b81(0x22e)},'body':JSON['stringify']({'appCode':_0x29c3f6,'query':_0x62285c,..._0x706c42[_0xb14b81(0x200)]!==undefined?{'topK':_0x706c42[_0xb14b81(0x200)]}:{}}),'signal':_0x706c42[_0xb14b81(0x20c)]});}catch(_0x8677fd){if(_0x8677fd instanceof CliError)throw _0x8677fd;if(_0x8677fd instanceof Error&&_0x8677fd['name']==='AbortError')throw _0x8677fd;throw CliErrors[_0xb14b81(0x212)](_0xb14b81(0x21d));}if(!hasNoStore(_0x2a7a70[_0xb14b81(0x228)]))throw CliErrors[_0xb14b81(0x1fd)](_0xb14b81(0x226));if(_0x2a7a70[_0xb14b81(0x225)]===0x191)throw CliErrors[_0xb14b81(0x204)]();if(!_0x2a7a70['ok'])throw CliErrors[_0xb14b81(0x1fd)]('SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20'+_0x2a7a70[_0xb14b81(0x225)]+').');if(!(_0x2a7a70['headers'][_0xb14b81(0x227)](_0xb14b81(0x1f6))??'')[_0xb14b81(0x1e7)]()[_0xb14b81(0x224)](_0xb14b81(0x1fe)))throw CliErrors[_0xb14b81(0x1fd)](_0xb14b81(0x1ff));let _0x1222aa;try{_0x1222aa=await _0x2a7a70[_0xb14b81(0x229)]();}catch{throw CliErrors[_0xb14b81(0x1fd)](_0xb14b81(0x1f8));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x1222aa),_0x706c42[_0xb14b81(0x200)]);}function readEnvelopeData(_0x45652e){const _0x38c3dd=a257_0x5eeb75,_0x50e50f=requireRecord(_0x45652e,_0x38c3dd(0x223));if(_0x50e50f['success']===![])throw CliErrors[_0x38c3dd(0x1fd)](_0x38c3dd(0x1f0));if(!(_0x38c3dd(0x20e)in _0x50e50f))throw invalidContract(_0x38c3dd(0x223));return _0x50e50f[_0x38c3dd(0x20e)];}function validateTopK(_0x43adfd){const _0x4f8525=a257_0x5eeb75;if(_0x43adfd!==undefined&&(!Number[_0x4f8525(0x21c)](_0x43adfd)||_0x43adfd<0x1||_0x43adfd>0x32))throw CliErrors[_0x4f8525(0x21e)]('Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.');}function hasNoStore(_0x8c91e7){const _0x385aaa=a257_0x5eeb75;return(_0x8c91e7['get'](_0x385aaa(0x1eb))??'')['split'](',')['some'](_0x153594=>_0x153594['trim']()[_0x385aaa(0x1e7)]()===_0x385aaa(0x1ea));}function parseDevelopmentSearchResponse(_0x1d284d,_0xeaba53){const _0x1a5007=a257_0x5eeb75,_0xfc1e91=requireExactRecord(_0x1d284d,RESPONSE_KEYS,_0x1a5007(0x211));if(_0xfc1e91[_0x1a5007(0x209)]!==0x2||_0xfc1e91['profile']!=='development')throw invalidContract(_0x1a5007(0x1f7));if(!Array[_0x1a5007(0x1f2)](_0xfc1e91[_0x1a5007(0x201)])||_0xfc1e91[_0x1a5007(0x201)]['length']>(_0xeaba53??0x32))throw invalidContract('hits');if(typeof _0xfc1e91[_0x1a5007(0x206)]!==_0x1a5007(0x220)||!/^sha256:[0-9a-f]{64}$/[_0x1a5007(0x1fb)](_0xfc1e91[_0x1a5007(0x206)]))throw invalidContract('strategyFingerprint');const _0x1a09ec=requireRecord(_0xfc1e91[_0x1a5007(0x208)],'timingsMs'),_0x67fe02={};for(const [_0x276498,_0x11a615]of Object['entries'](_0x1a09ec)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x1a5007(0x1fb)](_0x276498)||typeof _0x11a615!=='number'||!Number[_0x1a5007(0x1e8)](_0x11a615)||_0x11a615<0x0)throw invalidContract('timingsMs');_0x67fe02[_0x276498]=_0x11a615;}const _0x2185b4=_0xfc1e91[_0x1a5007(0x201)][_0x1a5007(0x21b)]((_0x2609d5,_0x998c4b)=>parseHit(_0x2609d5,_0x998c4b));if(!Number[_0x1a5007(0x21c)](_0xfc1e91[_0x1a5007(0x1fc)])||_0xfc1e91['total']!==_0x2185b4[_0x1a5007(0x1e9)])throw invalidContract('total');return{'schemaVersion':_0xfc1e91[_0x1a5007(0x209)],'profile':_0xfc1e91[_0x1a5007(0x1f7)],'total':_0xfc1e91[_0x1a5007(0x1fc)],'strategyFingerprint':_0xfc1e91['strategyFingerprint'],'timingsMs':_0x67fe02,'hits':_0x2185b4};}function parseHit(_0x28d0a6,_0x530faf){const _0x19dff0=a257_0x5eeb75,_0x10a991=requireExactRecord(_0x28d0a6,HIT_KEYS,_0x19dff0(0x22b)+_0x530faf+']'),_0x12a947=_0x579e51=>{const _0x1a20e8=_0x19dff0,_0x152f88=_0x10a991[_0x579e51];if(typeof _0x152f88!==_0x1a20e8(0x220)||!_0x152f88)throw invalidContract(_0x579e51);return _0x152f88;};if(!Number[_0x19dff0(0x21c)](_0x10a991['revision'])||_0x10a991[_0x19dff0(0x215)]<0x1)throw invalidContract(_0x19dff0(0x215));if(_0x10a991[_0x19dff0(0x202)]!==_0x19dff0(0x1e5)&&_0x10a991['scope']!==_0x19dff0(0x1e6))throw invalidContract(_0x19dff0(0x202));if(typeof _0x10a991[_0x19dff0(0x20d)]!=='string'||typeof _0x10a991[_0x19dff0(0x214)]!==_0x19dff0(0x220))throw invalidContract('text');if(!Array[_0x19dff0(0x1f2)](_0x10a991[_0x19dff0(0x205)])||_0x10a991[_0x19dff0(0x205)][_0x19dff0(0x22c)](_0x1fdb31=>typeof _0x1fdb31!==_0x19dff0(0x220)))throw invalidContract(_0x19dff0(0x205));if(!Number[_0x19dff0(0x21c)](_0x10a991['rank'])||_0x10a991[_0x19dff0(0x1f4)]!==_0x530faf+0x1)throw invalidContract('rank');if(!isFiniteNumber(_0x10a991[_0x19dff0(0x22a)])||!isFiniteNumber(_0x10a991[_0x19dff0(0x216)]))throw invalidContract(_0x19dff0(0x22f));return{'documentId':_0x12a947(_0x19dff0(0x20a)),'revision':_0x10a991[_0x19dff0(0x215)],'chunkId':_0x12a947(_0x19dff0(0x1f1)),'scope':_0x10a991['scope'],'title':_0x10a991['title'],'text':_0x10a991[_0x19dff0(0x214)],'tags':[..._0x10a991[_0x19dff0(0x205)]],'rank':_0x10a991[_0x19dff0(0x1f4)],'rawScore':_0x10a991[_0x19dff0(0x22a)],'finalScore':_0x10a991[_0x19dff0(0x216)],'scoreKind':_0x12a947(_0x19dff0(0x1ed))};}function requireExactRecord(_0x4bad42,_0x5159c4,_0x57d2b6){const _0xce926c=a257_0x5eeb75,_0x2b7e6a=requireRecord(_0x4bad42,_0x57d2b6),_0x3eee85=Object[_0xce926c(0x219)](_0x2b7e6a)['sort'](),_0x230bea=[..._0x5159c4][_0xce926c(0x1f3)]();if(_0x3eee85['length']!==_0x230bea['length']||_0x3eee85['some']((_0x506c48,_0x3c0135)=>_0x506c48!==_0x230bea[_0x3c0135]))throw invalidContract(_0x57d2b6);return _0x2b7e6a;}function requireRecord(_0x4dfa58,_0x2adfad){const _0x285a6f=a257_0x5eeb75;if(!_0x4dfa58||typeof _0x4dfa58!==_0x285a6f(0x213)||Array[_0x285a6f(0x1f2)](_0x4dfa58))throw invalidContract(_0x2adfad);return _0x4dfa58;}function a257_0x4073(){const _0x4bfd09=['chunkId','isArray','sort','rank','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','content-type','profile','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','7273014PDWiHO','appCode','test','total','apiError','application/json','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','topK','hits','scope','cookie','authRequired','tags','strategyFingerprint','1333304briUHA','timingsMs','schemaVersion','documentId','trim','signal','title','data','9jwxymd','13872380HJnZTM','response','networkError','object','text','revision','finalScore','18ZWWYQr','539605PzbvQD','keys','729655vYGnGp','map','isSafeInteger','SmartCode\x20knowledge\x20search\x20request\x20failed.','validation','number','string','POST','7110776mZdmEx','response\x20envelope','includes','status','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','get','headers','json','rawScore','hits[','some','\x20contract.','cli:rabetbase','score','Knowledge\x20search\x20appCode\x20is\x20required.','public','company','toLowerCase','isFinite','length','no-store','cache-control','334576HVTqEc','scoreKind','6PzjdgW','query','SmartCode\x20knowledge\x20search\x20failed.'];a257_0x4073=function(){return _0x4bfd09;};return a257_0x4073();}function isFiniteNumber(_0x33d45e){const _0x5b68f6=a257_0x5eeb75;return typeof _0x33d45e===_0x5b68f6(0x21f)&&Number[_0x5b68f6(0x1e8)](_0x33d45e);}function invalidContract(_0x23eda4){const _0x3b8b8a=a257_0x5eeb75;return CliErrors['apiError'](_0x3b8b8a(0x1f5)+_0x23eda4+_0x3b8b8a(0x22d));}
@@ -1 +1 @@
1
- const a245_0x1719f3=a245_0x268e;(function(_0x2ec4a8,_0x55de98){const _0x11285a=a245_0x268e,_0x3c4d02=_0x2ec4a8();while(!![]){try{const _0x521ff4=parseInt(_0x11285a(0x77))/0x1*(parseInt(_0x11285a(0x76))/0x2)+-parseInt(_0x11285a(0x80))/0x3*(parseInt(_0x11285a(0x7e))/0x4)+parseInt(_0x11285a(0x74))/0x5*(parseInt(_0x11285a(0x72))/0x6)+parseInt(_0x11285a(0x7f))/0x7+-parseInt(_0x11285a(0x81))/0x8+parseInt(_0x11285a(0x7a))/0x9+-parseInt(_0x11285a(0x73))/0xa*(parseInt(_0x11285a(0x79))/0xb);if(_0x521ff4===_0x55de98)break;else _0x3c4d02['push'](_0x3c4d02['shift']());}catch(_0x5032b1){_0x3c4d02['push'](_0x3c4d02['shift']());}}}(a245_0x4131,0xd85ca));import{constants}from'node:fs';function a245_0x268e(_0x1902d8,_0x4e6a3f){_0x1902d8=_0x1902d8-0x71;const _0x413148=a245_0x4131();let _0x268e08=_0x413148[_0x1902d8];return _0x268e08;}import{access,mkdir}from'node:fs/promises';function a245_0x4131(){const _0x3e2cf6=['2053410ssxqgn','2020pEKinY','10CdkDJs','appPagesDir','34966OjbeUE','58TUdpjK','toUpperCase','125719DpapHQ','15883011xBqPUh','cwd','F_OK','.json','64FnIBJW','3928722ReGEiR','23043VMXaxD','5653896ySwQlV','.rabetbase','page'];a245_0x4131=function(){return _0x3e2cf6;};return a245_0x4131();}import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x4d5b22,_0x33b996=process[a245_0x1719f3(0x7b)]()){const _0x5e55fa=a245_0x1719f3,_0xab958c=resolve(_0x33b996),_0x466b84=join(_0xab958c,'.rabetbase',_0x5e55fa(0x71));return{'projectRoot':_0xab958c,'pagesBaseDir':_0x466b84,'appPagesDir':join(_0x466b84,_0x4d5b22),'lockFilePath':join(_0xab958c,_0x5e55fa(0x82),'page.lock.json')};}export function buildPageFileName(_0x32abf1,_0x18f4f4){const _0x427393=a245_0x1719f3;return _0x32abf1+'-'+String(_0x18f4f4)[_0x427393(0x78)]()+_0x427393(0x7d);}export function resolvePageFilePath(_0x2c8507,_0x29de3c,_0x4a183e){const _0xa4a2f0=a245_0x1719f3;return join(_0x2c8507[_0xa4a2f0(0x75)],buildPageFileName(_0x29de3c,_0x4a183e));}export async function ensureParentDirectory(_0x1427a7){await mkdir(dirname(_0x1427a7),{'recursive':!![]});}export async function fileExists(_0x5a4b1b){const _0x47c0b2=a245_0x1719f3;try{return await access(_0x5a4b1b,constants[_0x47c0b2(0x7c)]),!![];}catch{return![];}}
1
+ const a258_0x2e6fbf=a258_0x67b9;(function(_0xd50c2c,_0x152de5){const _0x4e085c=a258_0x67b9,_0x3f7cab=_0xd50c2c();while(!![]){try{const _0x3befec=parseInt(_0x4e085c(0x1b3))/0x1+parseInt(_0x4e085c(0x1b1))/0x2+parseInt(_0x4e085c(0x1b8))/0x3+parseInt(_0x4e085c(0x1b2))/0x4+parseInt(_0x4e085c(0x1af))/0x5+parseInt(_0x4e085c(0x1bc))/0x6*(-parseInt(_0x4e085c(0x1b7))/0x7)+-parseInt(_0x4e085c(0x1b9))/0x8;if(_0x3befec===_0x152de5)break;else _0x3f7cab['push'](_0x3f7cab['shift']());}catch(_0x1d140b){_0x3f7cab['push'](_0x3f7cab['shift']());}}}(a258_0xadfa,0x2b5fe));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x159298,_0x324306=process[a258_0x2e6fbf(0x1b6)]()){const _0x2fb401=a258_0x2e6fbf,_0x2f49f0=resolve(_0x324306),_0x4588c9=join(_0x2f49f0,_0x2fb401(0x1ba),_0x2fb401(0x1b5));return{'projectRoot':_0x2f49f0,'pagesBaseDir':_0x4588c9,'appPagesDir':join(_0x4588c9,_0x159298),'lockFilePath':join(_0x2f49f0,_0x2fb401(0x1ba),'page.lock.json')};}export function buildPageFileName(_0x5efd12,_0x4478ca){const _0x5acdcb=a258_0x2e6fbf;return _0x5efd12+'-'+String(_0x4478ca)[_0x5acdcb(0x1b0)]()+_0x5acdcb(0x1bb);}export function resolvePageFilePath(_0x4ab53f,_0x9dbd9e,_0xed8c){return join(_0x4ab53f['appPagesDir'],buildPageFileName(_0x9dbd9e,_0xed8c));}export async function ensureParentDirectory(_0x47a3e6){await mkdir(dirname(_0x47a3e6),{'recursive':!![]});}function a258_0x67b9(_0x147a2a,_0x41762f){_0x147a2a=_0x147a2a-0x1af;const _0xadfab2=a258_0xadfa();let _0x67b9af=_0xadfab2[_0x147a2a];return _0x67b9af;}export async function fileExists(_0x34476){const _0x2d10b8=a258_0x2e6fbf;try{return await access(_0x34476,constants[_0x2d10b8(0x1b4)]),!![];}catch{return![];}}function a258_0xadfa(){const _0x404ade=['79702DvEfnx','714855cAhWKf','9072608AXsMak','.rabetbase','.json','18xoVHsZ','1226690UWPxWF','toUpperCase','701742etGFUC','1235036rZGmHB','202643qUzSIJ','F_OK','page','cwd'];a258_0xadfa=function(){return _0x404ade;};return a258_0xadfa();}
@@ -1 +1 @@
1
- (function(_0x1900e9,_0x1c1e4d){const _0x55e025=a246_0x2fe3,_0x38b783=_0x1900e9();while(!![]){try{const _0xcd3afc=-parseInt(_0x55e025(0x1e6))/0x1*(parseInt(_0x55e025(0x1db))/0x2)+-parseInt(_0x55e025(0x1de))/0x3*(-parseInt(_0x55e025(0x1d7))/0x4)+-parseInt(_0x55e025(0x1dc))/0x5+-parseInt(_0x55e025(0x1e2))/0x6*(-parseInt(_0x55e025(0x1e1))/0x7)+parseInt(_0x55e025(0x1d9))/0x8+-parseInt(_0x55e025(0x1d8))/0x9*(parseInt(_0x55e025(0x1e5))/0xa)+-parseInt(_0x55e025(0x1dd))/0xb;if(_0xcd3afc===_0x1c1e4d)break;else _0x38b783['push'](_0x38b783['shift']());}catch(_0x3fe22c){_0x38b783['push'](_0x38b783['shift']());}}}(a246_0x5761,0x95e0a));function a246_0x2fe3(_0x2844e2,_0x2627b7){_0x2844e2=_0x2844e2-0x1d7;const _0x576187=a246_0x5761();let _0x2fe354=_0x576187[_0x2844e2];return _0x2fe354;}import a246_0x431d38 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x3820a0){const _0x59201d=a246_0x2fe3;return JSON[_0x59201d(0x1e4)](JSON[_0x59201d(0x1df)](_0x3820a0),null,0x2)+'\x0a';}export function computePageContentHash(_0x3bdea6){const _0xe4c2a=a246_0x2fe3;return a246_0x431d38[_0xe4c2a(0x1e3)](_0xe4c2a(0x1e0))[_0xe4c2a(0x1da)](_0x3bdea6)[_0xe4c2a(0x1e8)]('hex');}export function computeSerializedSchemaHash(_0x299def){return computePageContentHash(serializePageSchemaForFile(_0x299def));}function a246_0x5761(){const _0x34127b=['8jfjJtl','801okAeDs','7241672mYlaNu','update','79172SKWviT','2745260bpOOma','998613MpeiOZ','1611618wyNdYz','parse','md5','3514EYIhms','7206xzySOa','createHash','stringify','91480CHpSud','13LJZWIq','utf8','digest'];a246_0x5761=function(){return _0x34127b;};return a246_0x5761();}export async function computePageFileHash(_0x5a0c59){const _0x1b2442=a246_0x2fe3,_0x452846=await readFile(_0x5a0c59,_0x1b2442(0x1e7));return computePageContentHash(_0x452846);}
1
+ (function(_0x26ddbb,_0xc1a51d){const _0x7ffde0=a259_0x4084,_0x46ad25=_0x26ddbb();while(!![]){try{const _0x411197=parseInt(_0x7ffde0(0x1d3))/0x1+-parseInt(_0x7ffde0(0x1c8))/0x2*(-parseInt(_0x7ffde0(0x1cf))/0x3)+-parseInt(_0x7ffde0(0x1d2))/0x4*(-parseInt(_0x7ffde0(0x1ce))/0x5)+-parseInt(_0x7ffde0(0x1d0))/0x6+parseInt(_0x7ffde0(0x1d1))/0x7+-parseInt(_0x7ffde0(0x1c9))/0x8*(-parseInt(_0x7ffde0(0x1d6))/0x9)+parseInt(_0x7ffde0(0x1d5))/0xa*(-parseInt(_0x7ffde0(0x1cc))/0xb);if(_0x411197===_0xc1a51d)break;else _0x46ad25['push'](_0x46ad25['shift']());}catch(_0x4e52b9){_0x46ad25['push'](_0x46ad25['shift']());}}}(a259_0x43eb,0x9c470));import a259_0x577c43 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x59dc5b){const _0x49dc65=a259_0x4084;return JSON[_0x49dc65(0x1d4)](JSON['parse'](_0x59dc5b),null,0x2)+'\x0a';}function a259_0x4084(_0x1fc126,_0xb01e2f){_0x1fc126=_0x1fc126-0x1c7;const _0x43eb92=a259_0x43eb();let _0x408445=_0x43eb92[_0x1fc126];return _0x408445;}export function computePageContentHash(_0x3e29f8){const _0x46f036=a259_0x4084;return a259_0x577c43['createHash'](_0x46f036(0x1cd))[_0x46f036(0x1d7)](_0x3e29f8)[_0x46f036(0x1c7)](_0x46f036(0x1ca));}export function computeSerializedSchemaHash(_0x15812b){return computePageContentHash(serializePageSchemaForFile(_0x15812b));}function a259_0x43eb(){const _0x566b75=['hex','utf8','11010857gwQAyX','md5','515jQkWHw','449238OvedhX','2519274kVNECb','4364262WjYown','1168UhZbyX','170543AqlDIj','stringify','20mQJzvV','27207wqpYvk','update','digest','16gknvIa','2752yhEcGm'];a259_0x43eb=function(){return _0x566b75;};return a259_0x43eb();}export async function computePageFileHash(_0x2c20a){const _0x186c48=a259_0x4084,_0x5786e5=await readFile(_0x2c20a,_0x186c48(0x1cb));return computePageContentHash(_0x5786e5);}
@@ -1 +1 @@
1
- (function(_0x1afbef,_0x3acfe0){const _0x2d04a6=a247_0x13de,_0x1322b9=_0x1afbef();while(!![]){try{const _0x1b68d1=parseInt(_0x2d04a6(0xb7))/0x1+parseInt(_0x2d04a6(0xbd))/0x2*(-parseInt(_0x2d04a6(0xb8))/0x3)+-parseInt(_0x2d04a6(0xc3))/0x4+parseInt(_0x2d04a6(0xb6))/0x5*(parseInt(_0x2d04a6(0xb9))/0x6)+-parseInt(_0x2d04a6(0xbf))/0x7*(-parseInt(_0x2d04a6(0xc6))/0x8)+parseInt(_0x2d04a6(0xc2))/0x9*(-parseInt(_0x2d04a6(0xc7))/0xa)+parseInt(_0x2d04a6(0xbb))/0xb*(parseInt(_0x2d04a6(0xba))/0xc);if(_0x1b68d1===_0x3acfe0)break;else _0x1322b9['push'](_0x1322b9['shift']());}catch(_0x19ba3b){_0x1322b9['push'](_0x1322b9['shift']());}}}(a247_0x5154,0x19a1b));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a247_0x5154(){const _0x815014=['302660SyJmIR','parse','pages','382585tajRIz','18864yDMGuV','201AVmYsZ','6sLNwqQ','6192bNmkOW','5401yjGkqy','code','6038YoTjsZ','lastSync','723527dCKPku','object','utf8','27McVeWK','629604GSoRkg','apps','ENOENT','16GGEDIY'];a247_0x5154=function(){return _0x815014;};return a247_0x5154();}function a247_0x13de(_0x9821b5,_0x15967e){_0x9821b5=_0x9821b5-0xb4;const _0x515425=a247_0x5154();let _0x13de56=_0x515425[_0x9821b5];return _0x13de56;}export function ensurePageLockScope(_0x143e1e,_0x449983){const _0x1eca2b=a247_0x13de,_0x5765dd={'apps':_0x143e1e[_0x1eca2b(0xc4)]&&typeof _0x143e1e[_0x1eca2b(0xc4)]==='object'?_0x143e1e['apps']:{}};let _0x9e3c7b=_0x5765dd[_0x1eca2b(0xc4)][_0x449983];if(!_0x9e3c7b)return _0x9e3c7b={'lastSync':'','pages':{}},_0x5765dd[_0x1eca2b(0xc4)][_0x449983]=_0x9e3c7b,{'lockData':_0x5765dd,'appLock':_0x9e3c7b};return!_0x9e3c7b[_0x1eca2b(0xbe)]&&(_0x9e3c7b[_0x1eca2b(0xbe)]=''),(!_0x9e3c7b[_0x1eca2b(0xb5)]||typeof _0x9e3c7b[_0x1eca2b(0xb5)]!==_0x1eca2b(0xc0))&&(_0x9e3c7b[_0x1eca2b(0xb5)]={}),{'lockData':_0x5765dd,'appLock':_0x9e3c7b};}export async function readPageLockFile(_0x2afba2){const _0x2d3965=a247_0x13de;try{const _0x43784f=await readFile(_0x2afba2,_0x2d3965(0xc1)),_0x4c5463=JSON[_0x2d3965(0xb4)](_0x43784f);return{'apps':_0x4c5463[_0x2d3965(0xc4)]&&typeof _0x4c5463['apps']===_0x2d3965(0xc0)?_0x4c5463[_0x2d3965(0xc4)]:{}};}catch(_0x1c3129){if(_0x1c3129[_0x2d3965(0xbc)]===_0x2d3965(0xc5))return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0x1c3129));}}export async function writePageLockFile(_0x16c791,_0x20f50b){await mkdir(dirname(_0x16c791),{'recursive':!![]}),await writeFile(_0x16c791,JSON['stringify'](_0x20f50b,null,0x2),'utf8');}
1
+ function a260_0x506a(){const _0x1de193=['4310586eVTGZv','1wgeMrb','5415730wePQNy','stringify','code','32361530JWukUD','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','4731930YCytUx','1881934YOLFVD','236hSBfKW','45102cYncLb','object','ENOENT','6454861myPPey','pages','apps','lastSync','8lXZrPD','utf8'];a260_0x506a=function(){return _0x1de193;};return a260_0x506a();}(function(_0x1fe069,_0x221953){const _0x1e8a87=a260_0x3de0,_0x36ba1a=_0x1fe069();while(!![]){try{const _0x27dd5d=parseInt(_0x1e8a87(0x188))/0x1*(-parseInt(_0x1e8a87(0x18f))/0x2)+-parseInt(_0x1e8a87(0x191))/0x3*(parseInt(_0x1e8a87(0x190))/0x4)+-parseInt(_0x1e8a87(0x189))/0x5+-parseInt(_0x1e8a87(0x18e))/0x6+-parseInt(_0x1e8a87(0x194))/0x7*(-parseInt(_0x1e8a87(0x185))/0x8)+parseInt(_0x1e8a87(0x187))/0x9+parseInt(_0x1e8a87(0x18c))/0xa;if(_0x27dd5d===_0x221953)break;else _0x36ba1a['push'](_0x36ba1a['shift']());}catch(_0x295170){_0x36ba1a['push'](_0x36ba1a['shift']());}}}(a260_0x506a,0xe4df0));function a260_0x3de0(_0x5e16f5,_0x74ac90){_0x5e16f5=_0x5e16f5-0x185;const _0x506ac7=a260_0x506a();let _0x3de04c=_0x506ac7[_0x5e16f5];return _0x3de04c;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x159c98,_0x350de4){const _0x2eea8c=a260_0x3de0,_0x362cb6={'apps':_0x159c98[_0x2eea8c(0x196)]&&typeof _0x159c98[_0x2eea8c(0x196)]===_0x2eea8c(0x192)?_0x159c98[_0x2eea8c(0x196)]:{}};let _0x24616f=_0x362cb6['apps'][_0x350de4];if(!_0x24616f)return _0x24616f={'lastSync':'','pages':{}},_0x362cb6[_0x2eea8c(0x196)][_0x350de4]=_0x24616f,{'lockData':_0x362cb6,'appLock':_0x24616f};return!_0x24616f['lastSync']&&(_0x24616f[_0x2eea8c(0x197)]=''),(!_0x24616f[_0x2eea8c(0x195)]||typeof _0x24616f[_0x2eea8c(0x195)]!==_0x2eea8c(0x192))&&(_0x24616f['pages']={}),{'lockData':_0x362cb6,'appLock':_0x24616f};}export async function readPageLockFile(_0x5c1775){const _0x7f104e=a260_0x3de0;try{const _0x381d61=await readFile(_0x5c1775,'utf8'),_0x53bad2=JSON['parse'](_0x381d61);return{'apps':_0x53bad2[_0x7f104e(0x196)]&&typeof _0x53bad2['apps']===_0x7f104e(0x192)?_0x53bad2[_0x7f104e(0x196)]:{}};}catch(_0x17b7a8){if(_0x17b7a8[_0x7f104e(0x18b)]===_0x7f104e(0x193))return null;throw new Error(_0x7f104e(0x18d)+String(_0x17b7a8));}}export async function writePageLockFile(_0x56acbc,_0x25b0f6){const _0x397d01=a260_0x3de0;await mkdir(dirname(_0x56acbc),{'recursive':!![]}),await writeFile(_0x56acbc,JSON[_0x397d01(0x18a)](_0x25b0f6,null,0x2),_0x397d01(0x186));}
@@ -1 +1 @@
1
- (function(_0x48eb6a,_0x22e5c5){const _0x54326b=a249_0xb228,_0x445038=_0x48eb6a();while(!![]){try{const _0x2701c1=-parseInt(_0x54326b(0x1a3))/0x1*(-parseInt(_0x54326b(0x195))/0x2)+-parseInt(_0x54326b(0x1c0))/0x3*(-parseInt(_0x54326b(0x1ce))/0x4)+parseInt(_0x54326b(0x1d1))/0x5*(-parseInt(_0x54326b(0x1df))/0x6)+-parseInt(_0x54326b(0x1b1))/0x7*(parseInt(_0x54326b(0x1a1))/0x8)+parseInt(_0x54326b(0x1a5))/0x9+-parseInt(_0x54326b(0x19a))/0xa+parseInt(_0x54326b(0x1b2))/0xb*(parseInt(_0x54326b(0x1a6))/0xc);if(_0x2701c1===_0x22e5c5)break;else _0x445038['push'](_0x445038['shift']());}catch(_0x1ce2f7){_0x445038['push'](_0x445038['shift']());}}}(a249_0x30e7,0xb9c1d));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x1ae72e,_0x3f6879){const _0x5d643d=a249_0xb228,_0x5bdc2c=[],_0x45f8ce=normalizeSqlForStaticAnalysis(_0x1ae72e),_0x5cb9f2=(_0x45f8ce[_0x5d643d(0x1bd)]?[]:extractJoinFacts(_0x45f8ce['sql']))[_0x5d643d(0x1c1)](_0x16bd94=>{const _0x1e90b3=_0x5d643d;if(_0x16bd94['unsupportedPredicate']||_0x16bd94[_0x1e90b3(0x19d)][_0x1e90b3(0x1ab)]===0x0)return _0x5bdc2c[_0x1e90b3(0x1cf)]({'code':_0x1e90b3(0x1d0),'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94[_0x1e90b3(0x1da)],'columns':_0x16bd94[_0x1e90b3(0x19d)],'reason':_0x16bd94[_0x1e90b3(0x1b4)]??_0x1e90b3(0x1af)}),{'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94[_0x1e90b3(0x1da)],'columns':_0x16bd94['columns'],'status':_0x1e90b3(0x199)};const _0x3c5843=resolveTableMetadata(_0x3f6879,_0x16bd94[_0x1e90b3(0x1d7)]),_0x169ab=(_0x3c5843?.[_0x1e90b3(0x1ae)]??[])[_0x1e90b3(0x1c1)](_0x3757a8=>({'index':_0x3757a8,'matchedPrefix':findEqualityPrefix(_0x3757a8[_0x1e90b3(0x19d)],_0x16bd94[_0x1e90b3(0x19d)])}))[_0x1e90b3(0x1b5)](_0x11c26b=>_0x11c26b[_0x1e90b3(0x1c9)][_0x1e90b3(0x1ab)]>0x0),_0x1967e3=_0x169ab[_0x1e90b3(0x1b0)]((_0x362981,_0x5ea1ab)=>!_0x362981||_0x5ea1ab[_0x1e90b3(0x1c9)]['length']>_0x362981[_0x1e90b3(0x1c9)][_0x1e90b3(0x1ab)]?_0x5ea1ab:_0x362981,_0x169ab[0x0]);if(_0x1967e3)return{'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94[_0x1e90b3(0x1da)],'columns':_0x16bd94[_0x1e90b3(0x19d)],'status':'covered','matchedIndex':{..._0x1967e3[_0x1e90b3(0x1a2)],'matchedPrefix':_0x1967e3['matchedPrefix']}};const _0x21fbd4=_0x3c5843?.[_0x1e90b3(0x1ae)][_0x1e90b3(0x1b5)](_0x34ab2c=>_0x34ab2c[_0x1e90b3(0x19d)][_0x1e90b3(0x1c8)](_0x2df60b=>_0x16bd94[_0x1e90b3(0x19d)][_0x1e90b3(0x1c8)](_0x369a3d=>columnNamesMatch(_0x2df60b,_0x369a3d))))??[];if(_0x21fbd4['length']>0x0)return _0x5bdc2c[_0x1e90b3(0x1cf)]({'code':'JOIN_INDEX_NOT_USABLE','table':_0x16bd94['table'],'alias':_0x16bd94['alias'],'columns':_0x16bd94[_0x1e90b3(0x19d)],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94['alias'],'columns':_0x16bd94['columns'],'status':_0x1e90b3(0x194),'candidateIndexes':_0x21fbd4};if(_0x3c5843&&_0x3c5843[_0x1e90b3(0x1dd)]!==![]&&_0x3c5843[_0x1e90b3(0x1ae)][_0x1e90b3(0x1ab)]>0x0&&_0x16bd94['columns']['length']>0x0)return _0x5bdc2c[_0x1e90b3(0x1cf)]({'code':_0x1e90b3(0x197),'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94[_0x1e90b3(0x1da)],'columns':_0x16bd94[_0x1e90b3(0x19d)],'reason':_0x1e90b3(0x1cc)}),{'table':_0x16bd94['table'],'alias':_0x16bd94['alias'],'columns':_0x16bd94['columns'],'status':'warning'};return _0x5bdc2c['push']({'code':_0x1e90b3(0x193),'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94[_0x1e90b3(0x1da)],'columns':_0x16bd94[_0x1e90b3(0x19d)],'reason':_0x3c5843?_0x1e90b3(0x1ba):_0x1e90b3(0x1d5)}),{'table':_0x16bd94[_0x1e90b3(0x1d7)],'alias':_0x16bd94[_0x1e90b3(0x1da)],'columns':_0x16bd94[_0x1e90b3(0x19d)],'status':_0x1e90b3(0x199)};});return{'checked':_0x5cb9f2[_0x5d643d(0x1ab)]>0x0,'joins':_0x5cb9f2,'warnings':_0x5bdc2c};}function extractJoinFacts(_0x3db170){const _0x9c5649=a249_0xb228,_0x4357a8=maskNestedQueries(stripSqlNoise(_0x3db170)),_0x4306ed=maskQuotedIdentifiers(_0x4357a8),_0x45e5d5=[],_0x82654a=new Set(),_0x3fac5c=/\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 _0xdcf0e6 of _0x4357a8[_0x9c5649(0x1aa)](_0x3fac5c)){const _0x3ac268=_0xdcf0e6[_0x9c5649(0x1a2)]??0x0,_0x4ceb4a=_0xdcf0e6[0x0][_0x9c5649(0x1b3)](/\bJOIN\b/i),_0x5d8ab4=_0x3ac268+Math[_0x9c5649(0x1d6)](0x0,_0x4ceb4a);if(!/^JOIN\b/i['test'](_0x4306ed[_0x9c5649(0x1ad)](_0x5d8ab4)))continue;_0x82654a[_0x9c5649(0x1b6)](_0x5d8ab4);const _0x377f89=normalizeIdentifier(_0xdcf0e6[0x1]||_0x9c5649(0x1c6)),_0x38bbdb=normalizeIdentifier(_0xdcf0e6[0x2]??''),_0x439d85=normalizeIdentifier(_0xdcf0e6[0x3]||_0x38bbdb[_0x9c5649(0x1a0)]('.')['at'](-0x1)||_0x38bbdb),_0x570f8b=[],_0x113538=_0x38bbdb===_0x9c5649(0x1c4);let _0x17d7b9=_0x377f89===_0x9c5649(0x198)||_0x377f89==='full'||_0x113538,_0x2f10ac=_0x17d7b9?_0x113538?_0x9c5649(0x1c5):_0x377f89[_0x9c5649(0x1be)]()+_0x9c5649(0x1db):undefined;const _0x6bf4f3=stripOuterParentheses(_0xdcf0e6[0x4]??''),_0xeca0f5=_0x6bf4f3[_0x9c5649(0x1bc)](MYBATIS_DYNAMIC_START_MARKER)||_0x6bf4f3[_0x9c5649(0x1bc)](MYBATIS_DYNAMIC_END_MARKER),_0xe69f7f=_0x6bf4f3[_0x9c5649(0x1bc)](MYBATIS_INCLUDE_MARKER);_0xeca0f5&&(_0x17d7b9=!![],_0x2f10ac??=_0x9c5649(0x1c3));_0xe69f7f&&(_0x17d7b9=!![],_0x2f10ac??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x570cce=_0x6bf4f3[_0x9c5649(0x1a4)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x9c5649(0x1a4)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x9c5649(0x1a4)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x570cce,'OR')&&(_0x17d7b9=!![],_0x2f10ac??=_0x9c5649(0x19f));for(const _0x2fd723 of splitTopLevelAnd(_0x570cce)){const _0x3dee18=stripOuterParentheses(_0x2fd723);if(hasTopLevelKeyword(_0x3dee18,'OR')){_0x17d7b9=!![],_0x2f10ac??=_0x9c5649(0x19f);continue;}const _0x2c83f7=splitEquality(_0x3dee18);if(!_0x2c83f7){containsColumnReference(_0x2fd723,_0x439d85)&&(_0x17d7b9=!![]);continue;}const _0xb28ea7=parseDirectColumnReference(_0x2c83f7[0x0],_0x439d85),_0x5c32e1=parseDirectColumnReference(_0x2c83f7[0x1],_0x439d85),_0x79a08d=containsColumnReference(_0x2c83f7[0x0],_0x439d85),_0x20127a=containsColumnReference(_0x2c83f7[0x1],_0x439d85),_0x3d7524=_0xb28ea7&&!_0x20127a?_0xb28ea7:_0x5c32e1&&!_0x79a08d?_0x5c32e1:null;if(_0x3d7524&&!_0x570f8b[_0x9c5649(0x1bc)](_0x3d7524))_0x570f8b['push'](_0x3d7524);else!_0x3d7524&&containsColumnReference(_0x2fd723,_0x439d85)&&(_0x17d7b9=!![]);}_0x45e5d5['push']({'table':_0x38bbdb,'alias':_0x439d85,'columns':_0x570f8b,'unsupportedPredicate':_0x17d7b9,'unsupportedReason':_0x2f10ac,'containsUnresolvedInclude':_0xe69f7f,'position':_0x5d8ab4});}for(const _0x7eca42 of _0x4306ed[_0x9c5649(0x1aa)](/\bJOIN\b/gi)){const _0x11b989=_0x7eca42['index']??0x0;if(_0x82654a['has'](_0x11b989))continue;const _0x3d540c=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0x4357a8[_0x9c5649(0x1ad)](_0x11b989+_0x7eca42[0x0][_0x9c5649(0x1ab)])),_0x5dfffd=normalizeIdentifier(_0x3d540c?.[0x1]||'unknown'),_0x20741f=normalizeIdentifier(_0x3d540c?.[0x2]||''),_0x3eaf31=isSqlClauseKeyword(_0x20741f)?_0x5dfffd[_0x9c5649(0x1a0)]('.')['at'](-0x1)||_0x5dfffd:_0x20741f||_0x5dfffd[_0x9c5649(0x1a0)]('.')['at'](-0x1)||_0x5dfffd;_0x45e5d5[_0x9c5649(0x1cf)]({'table':_0x5dfffd,'alias':_0x3eaf31,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x9c5649(0x1e1),'position':_0x11b989});}const _0x7d7f5a=_0x4306ed[_0x9c5649(0x1ac)](MYBATIS_INCLUDE_MARKER);return _0x7d7f5a>=0x0&&!_0x45e5d5[_0x9c5649(0x1c8)](_0x32041a=>_0x32041a[_0x9c5649(0x1c2)])&&_0x45e5d5[_0x9c5649(0x1cf)]({'table':'unknown','alias':_0x9c5649(0x1a7),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x9c5649(0x1bb),'containsUnresolvedInclude':!![],'position':_0x7d7f5a}),_0x45e5d5[_0x9c5649(0x19e)]((_0x243004,_0x1ff4a3)=>_0x243004[_0x9c5649(0x1d9)]-_0x1ff4a3[_0x9c5649(0x1d9)]);}function stripSqlNoise(_0x30ee55){const _0xea125b=a249_0xb228,_0x1bc5b9=Array[_0xea125b(0x19c)](_0x30ee55),_0x4a0f28=(_0x9048ec,_0x52827e)=>{for(let _0x1c5bd6=_0x9048ec;_0x1c5bd6<_0x52827e;_0x1c5bd6+=0x1){_0x1bc5b9[_0x1c5bd6]!=='\x0a'&&_0x1bc5b9[_0x1c5bd6]!=='\x0d'&&(_0x1bc5b9[_0x1c5bd6]='\x20');}};for(let _0xe5f13d=0x0;_0xe5f13d<_0x1bc5b9[_0xea125b(0x1ab)];_0xe5f13d+=0x1){const _0xf54824=_0x1bc5b9[_0xe5f13d],_0x4c6feb=_0x1bc5b9[_0xe5f13d+0x1];if(_0xf54824==='\x27'||_0xf54824==='\x22'||_0xf54824==='`'){const _0x246dba=_0xf54824,_0x545c89=_0xe5f13d;_0xe5f13d+=0x1;while(_0xe5f13d<_0x1bc5b9['length']){if(_0x1bc5b9[_0xe5f13d]==='\x5c'&&_0xe5f13d+0x1<_0x1bc5b9[_0xea125b(0x1ab)]){_0xe5f13d+=0x2;continue;}if(_0x1bc5b9[_0xe5f13d]!==_0x246dba){_0xe5f13d+=0x1;continue;}if(_0x1bc5b9[_0xe5f13d+0x1]===_0x246dba){_0xe5f13d+=0x2;continue;}break;}if(_0x246dba==='\x27')_0x4a0f28(_0x545c89,Math['min'](_0xe5f13d+0x1,_0x1bc5b9['length']));continue;}if(_0xf54824==='-'&&_0x4c6feb==='-'){const _0x3e0b05=_0xe5f13d;while(_0xe5f13d<_0x1bc5b9[_0xea125b(0x1ab)]&&_0x1bc5b9[_0xe5f13d]!=='\x0a')_0xe5f13d+=0x1;_0x4a0f28(_0x3e0b05,_0xe5f13d);continue;}if(_0xf54824==='/'&&_0x4c6feb==='*'){const _0x29677f=_0xe5f13d;_0xe5f13d+=0x2;while(_0xe5f13d<_0x1bc5b9[_0xea125b(0x1ab)]&&!(_0x1bc5b9[_0xe5f13d]==='*'&&_0x1bc5b9[_0xe5f13d+0x1]==='/')){_0xe5f13d+=0x1;}_0xe5f13d=Math['min'](_0xe5f13d+0x1,_0x1bc5b9[_0xea125b(0x1ab)]-0x1),_0x4a0f28(_0x29677f,_0xe5f13d+0x1);continue;}if(_0xf54824==='#'&&_0x4c6feb!=='{'){const _0xd65124=_0xe5f13d;while(_0xe5f13d<_0x1bc5b9[_0xea125b(0x1ab)]&&_0x1bc5b9[_0xe5f13d]!=='\x0a')_0xe5f13d+=0x1;_0x4a0f28(_0xd65124,_0xe5f13d);continue;}if((_0xf54824==='#'||_0xf54824==='$')&&_0x4c6feb==='{'){const _0x13490a=_0xe5f13d;_0xe5f13d+=0x2;while(_0xe5f13d<_0x1bc5b9[_0xea125b(0x1ab)]&&_0x1bc5b9[_0xe5f13d]!=='}')_0xe5f13d+=0x1;_0x4a0f28(_0x13490a,Math[_0xea125b(0x1c7)](_0xe5f13d+0x1,_0x1bc5b9[_0xea125b(0x1ab)]));}}return _0x1bc5b9[_0xea125b(0x1d2)]('');}function maskQuotedIdentifiers(_0x3b4653){const _0x23270a=a249_0xb228,_0xbaa479=Array[_0x23270a(0x19c)](_0x3b4653);for(let _0x44652c=0x0;_0x44652c<_0xbaa479[_0x23270a(0x1ab)];_0x44652c+=0x1){const _0x76eea1=_0xbaa479[_0x44652c];if(_0x76eea1!=='\x22'&&_0x76eea1!=='`')continue;_0x44652c+=0x1;while(_0x44652c<_0xbaa479['length']){if(_0xbaa479[_0x44652c]===_0x76eea1){if(_0xbaa479[_0x44652c+0x1]===_0x76eea1){_0xbaa479[_0x44652c]='\x20',_0xbaa479[_0x44652c+0x1]='\x20',_0x44652c+=0x2;continue;}break;}_0xbaa479[_0x44652c]='\x20',_0x44652c+=0x1;}}return _0xbaa479[_0x23270a(0x1d2)]('');}function maskNestedQueries(_0x2d1704){const _0x11dc7d=a249_0xb228,_0x4c7633=Array[_0x11dc7d(0x19c)](_0x2d1704);for(let _0x54aada=0x0;_0x54aada<_0x4c7633['length'];_0x54aada+=0x1){if(_0x4c7633[_0x54aada]!=='(')continue;const _0x3face7=_0x2d1704[_0x11dc7d(0x1ad)](_0x54aada+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x11dc7d(0x1b9)](_0x3face7))continue;let _0x309516=0x1,_0x3c92af=_0x54aada+0x1;for(;_0x3c92af<_0x4c7633[_0x11dc7d(0x1ab)]&&_0x309516>0x0;_0x3c92af+=0x1){if(_0x4c7633[_0x3c92af]==='(')_0x309516+=0x1;if(_0x4c7633[_0x3c92af]===')')_0x309516-=0x1;}if(_0x309516!==0x0)continue;for(let _0x101687=_0x54aada;_0x101687<_0x3c92af;_0x101687+=0x1){_0x4c7633[_0x101687]='\x20';}const _0x363a0e=_0x11dc7d(0x1c4);for(let _0x256e5d=0x0;_0x256e5d<_0x363a0e[_0x11dc7d(0x1ab)]&&_0x54aada+_0x256e5d<_0x3c92af;_0x256e5d+=0x1){_0x4c7633[_0x54aada+_0x256e5d]=_0x363a0e[_0x256e5d];}_0x54aada=_0x3c92af-0x1;}return _0x4c7633[_0x11dc7d(0x1d2)]('');}function splitTopLevelAnd(_0x43d581){const _0x2fc231=a249_0xb228,_0x355cc7=[];let _0x3f49d1=0x0,_0x8456d3=0x0;for(let _0x5c08d0=0x0;_0x5c08d0<_0x43d581[_0x2fc231(0x1ab)];_0x5c08d0+=0x1){const _0x208c5c=_0x43d581[_0x5c08d0];if(_0x208c5c==='(')_0x3f49d1+=0x1;if(_0x208c5c===')')_0x3f49d1=Math[_0x2fc231(0x1d6)](0x0,_0x3f49d1-0x1);_0x3f49d1===0x0&&_0x43d581[_0x2fc231(0x1ad)](_0x5c08d0)[_0x2fc231(0x1d8)](/^AND\b/i)&&(_0x5c08d0===0x0||/\s/[_0x2fc231(0x1b9)](_0x43d581[_0x5c08d0-0x1]??''))&&(_0x355cc7[_0x2fc231(0x1cf)](_0x43d581[_0x2fc231(0x1ad)](_0x8456d3,_0x5c08d0)[_0x2fc231(0x1bf)]()),_0x5c08d0+=0x2,_0x8456d3=_0x5c08d0+0x1);}const _0x2e4a75=_0x43d581['slice'](_0x8456d3)[_0x2fc231(0x1bf)]();if(_0x2e4a75)_0x355cc7['push'](_0x2e4a75);return _0x355cc7;}function hasTopLevelKeyword(_0x4a2c4c,_0x213e3d){const _0x1039c5=a249_0xb228;let _0x31e426=0x0;for(let _0x27b8a1=0x0;_0x27b8a1<_0x4a2c4c[_0x1039c5(0x1ab)];_0x27b8a1+=0x1){const _0x560963=_0x4a2c4c[_0x27b8a1];if(_0x560963==='(')_0x31e426+=0x1;if(_0x560963===')')_0x31e426=Math[_0x1039c5(0x1d6)](0x0,_0x31e426-0x1);if(_0x31e426!==0x0)continue;const _0x4c50=_0x4a2c4c[_0x1039c5(0x1ad)](_0x27b8a1,_0x27b8a1+_0x213e3d[_0x1039c5(0x1ab)]),_0x330171=_0x4a2c4c[_0x27b8a1-0x1]??'\x20',_0x3942c0=_0x4a2c4c[_0x27b8a1+_0x213e3d[_0x1039c5(0x1ab)]]??'\x20';if(_0x4c50[_0x1039c5(0x1be)]()===_0x213e3d[_0x1039c5(0x1be)]()&&!/[\w$]/[_0x1039c5(0x1b9)](_0x330171)&&!/[\w$]/['test'](_0x3942c0))return!![];}return![];}function splitEquality(_0x2807e8){const _0x47d753=a249_0xb228,_0x3e1087=stripOuterParentheses(_0x2807e8);let _0x1a02e5=0x0,_0x16e091;for(let _0x2ad4ed=0x0;_0x2ad4ed<_0x3e1087['length'];_0x2ad4ed+=0x1){const _0x417c49=_0x3e1087[_0x2ad4ed];if(_0x417c49==='(')_0x1a02e5+=0x1;if(_0x417c49===')')_0x1a02e5=Math[_0x47d753(0x1d6)](0x0,_0x1a02e5-0x1);const _0x13877e=_0x3e1087[_0x2ad4ed-0x1]??'',_0x1eeac9=_0x3e1087[_0x2ad4ed+0x1]??'';if(_0x417c49==='='&&_0x1a02e5===0x0&&!/[!<>=:]/[_0x47d753(0x1b9)](_0x13877e)&&_0x1eeac9!=='='){if(_0x16e091!==undefined)return null;_0x16e091=_0x2ad4ed;}}return _0x16e091===undefined?null:[_0x3e1087[_0x47d753(0x1ad)](0x0,_0x16e091)[_0x47d753(0x1bf)](),_0x3e1087[_0x47d753(0x1ad)](_0x16e091+0x1)[_0x47d753(0x1bf)]()];}function parseDirectColumnReference(_0x50ab0f,_0x9e80b){const _0x3c6ba7=a249_0xb228,_0x5604c3=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x3c6ba7(0x1a8)](stripOuterParentheses(_0x50ab0f));if(!_0x5604c3)return null;if(normalizeIdentifier(_0x5604c3[0x1]??'')!==normalizeIdentifier(_0x9e80b))return null;return normalizeIdentifier(_0x5604c3[0x2]??'');}function containsColumnReference(_0x11a2f2,_0x1b42b2){const _0x42c046=a249_0xb228,_0x5c410e=_0x11a2f2[_0x42c046(0x1cb)](/[`"]/g,''),_0x18f2b9=_0x1b42b2['replace'](/[.*+?^${}()|[\]\\]/g,_0x42c046(0x196));return new RegExp('(?:^|[^\x5cw$])'+_0x18f2b9+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x42c046(0x1b9)](_0x5c410e);}function a249_0x30e7(){const _0x3badfb=['add','natural','has','test','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','includes','error','toUpperCase','trim','168501VgzGaO','map','containsUnresolvedInclude','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','__sq__','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','INNER','min','some','matchedPrefix','full','replace','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','startsWith','52LlHpHM','push','JOIN_PREDICATE_UNSUPPORTED','85BbpDfS','join','left','inner','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','max','table','match','position','alias','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','toLowerCase','metadataAvailable','cross','397746KLGgbw','where','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','endsWith','INDEX_METADATA_UNAVAILABLE','warning','1916312MOiUWb','\x5c$&','JOIN_INDEX_MISSING','right','unavailable','3308840SBwblj','using','from','columns','sort','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','split','14632SZNkVO','index','1SGBtqB','replaceAll','6245658fpyANd','12uMNqGn','unknown','exec','tableName','matchAll','length','indexOf','slice','indexes','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','reduce','3878jjQyBO','9346359jDwgXw','search','unsupportedReason','filter'];a249_0x30e7=function(){return _0x3badfb;};return a249_0x30e7();}function findEqualityPrefix(_0x25d85b,_0x199c1e){const _0x391038=a249_0xb228,_0x3ca184=new Set(_0x199c1e[_0x391038(0x1c1)](normalizeIdentifier)),_0x4c4683=[];for(const _0x362bb2 of _0x25d85b){if(!_0x3ca184['has'](normalizeIdentifier(_0x362bb2)))break;_0x4c4683[_0x391038(0x1cf)](_0x362bb2);}return _0x4c4683;}function resolveTableMetadata(_0x16f718,_0x28a7ee){const _0x5d27e2=a249_0xb228,_0x429bef=normalizeIdentifier(_0x28a7ee),_0x2f890c=_0x16f718[_0x5d27e2(0x1b5)](_0x4f6f73=>normalizeIdentifier(_0x4f6f73[_0x5d27e2(0x1a9)])===_0x429bef);if(_0x2f890c[_0x5d27e2(0x1ab)]===0x1)return _0x2f890c[0x0];const _0x4c64c6=_0x429bef[_0x5d27e2(0x1bc)]('.'),_0x29bde3=_0x429bef[_0x5d27e2(0x1a0)]('.')['at'](-0x1),_0x2f6fdc=_0x16f718[_0x5d27e2(0x1b5)](_0x438dbb=>{const _0x581771=_0x5d27e2,_0x255205=normalizeIdentifier(_0x438dbb[_0x581771(0x1a9)]);if(_0x4c64c6&&_0x255205[_0x581771(0x1bc)]('.'))return![];return _0x255205[_0x581771(0x1a0)]('.')['at'](-0x1)===_0x29bde3;});return _0x2f6fdc[_0x5d27e2(0x1ab)]===0x1?_0x2f6fdc[0x0]:undefined;}function columnNamesMatch(_0x21a38b,_0x55b146){return normalizeIdentifier(_0x21a38b)===normalizeIdentifier(_0x55b146);}function normalizeIdentifier(_0x557ed7){const _0x1e5451=a249_0xb228;return _0x557ed7[_0x1e5451(0x1cb)](/[`"]/g,'')[_0x1e5451(0x1bf)]()[_0x1e5451(0x1dc)]();}function isSqlClauseKeyword(_0x3ce0b2){const _0x536903=a249_0xb228;return new Set(['on',_0x536903(0x19b),_0x536903(0x1e0),'join',_0x536903(0x1d4),_0x536903(0x1d3),_0x536903(0x198),_0x536903(0x1ca),_0x536903(0x1de),_0x536903(0x1b7)])[_0x536903(0x1b8)](_0x3ce0b2);}function a249_0xb228(_0x453cff,_0x61c91e){_0x453cff=_0x453cff-0x192;const _0x30e759=a249_0x30e7();let _0xb228ab=_0x30e759[_0x453cff];return _0xb228ab;}function stripOuterParentheses(_0x2b7867){const _0x588ed8=a249_0xb228;let _0x54b66e=_0x2b7867['trim']();while(_0x54b66e[_0x588ed8(0x1cd)]('(')&&_0x54b66e[_0x588ed8(0x192)](')')){let _0x4fa5e2=0x0,_0x3999ea=!![];for(let _0x5a6623=0x0;_0x5a6623<_0x54b66e[_0x588ed8(0x1ab)];_0x5a6623+=0x1){if(_0x54b66e[_0x5a6623]==='(')_0x4fa5e2+=0x1;if(_0x54b66e[_0x5a6623]===')')_0x4fa5e2-=0x1;if(_0x4fa5e2===0x0&&_0x5a6623<_0x54b66e[_0x588ed8(0x1ab)]-0x1){_0x3999ea=![];break;}}if(!_0x3999ea||_0x4fa5e2!==0x0)break;_0x54b66e=_0x54b66e[_0x588ed8(0x1ad)](0x1,-0x1)[_0x588ed8(0x1bf)]();}return _0x54b66e;}
1
+ (function(_0x2c9476,_0x15b34c){const _0x19a096=a262_0x4135,_0x5d74fc=_0x2c9476();while(!![]){try{const _0x25923c=parseInt(_0x19a096(0x121))/0x1*(-parseInt(_0x19a096(0x14b))/0x2)+-parseInt(_0x19a096(0x11b))/0x3*(-parseInt(_0x19a096(0x147))/0x4)+-parseInt(_0x19a096(0x149))/0x5+-parseInt(_0x19a096(0x12c))/0x6*(parseInt(_0x19a096(0x137))/0x7)+-parseInt(_0x19a096(0x13d))/0x8*(-parseInt(_0x19a096(0x11f))/0x9)+parseInt(_0x19a096(0x115))/0xa+-parseInt(_0x19a096(0x127))/0xb;if(_0x25923c===_0x15b34c)break;else _0x5d74fc['push'](_0x5d74fc['shift']());}catch(_0x56d51b){_0x5d74fc['push'](_0x5d74fc['shift']());}}}(a262_0x57c1,0xcbd27));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x599de6,_0x16e1ab){const _0x137cc3=a262_0x4135,_0x10bc00=[],_0x4a9f29=normalizeSqlForStaticAnalysis(_0x599de6),_0x47c8d3=(_0x4a9f29[_0x137cc3(0x143)]?[]:extractJoinFacts(_0x4a9f29[_0x137cc3(0x131)]))[_0x137cc3(0x10e)](_0x4a2f2e=>{const _0x4d3717=_0x137cc3;if(_0x4a2f2e[_0x4d3717(0x13f)]||_0x4a2f2e['columns']['length']===0x0)return _0x10bc00[_0x4d3717(0x13b)]({'code':_0x4d3717(0x130),'table':_0x4a2f2e['table'],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'reason':_0x4a2f2e[_0x4d3717(0x123)]??_0x4d3717(0x11c)}),{'table':_0x4a2f2e['table'],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'status':_0x4d3717(0x12a)};const _0x377e69=resolveTableMetadata(_0x16e1ab,_0x4a2f2e[_0x4d3717(0x118)]),_0x530648=(_0x377e69?.[_0x4d3717(0x126)]??[])[_0x4d3717(0x10e)](_0x1ddab3=>({'index':_0x1ddab3,'matchedPrefix':findEqualityPrefix(_0x1ddab3[_0x4d3717(0x12f)],_0x4a2f2e[_0x4d3717(0x12f)])}))[_0x4d3717(0x11a)](_0x3f1b27=>_0x3f1b27['matchedPrefix'][_0x4d3717(0x119)]>0x0),_0x270c0=_0x530648['reduce']((_0x3202ea,_0x5b7e25)=>!_0x3202ea||_0x5b7e25[_0x4d3717(0x138)][_0x4d3717(0x119)]>_0x3202ea[_0x4d3717(0x138)][_0x4d3717(0x119)]?_0x5b7e25:_0x3202ea,_0x530648[0x0]);if(_0x270c0)return{'table':_0x4a2f2e['table'],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'status':'covered','matchedIndex':{..._0x270c0[_0x4d3717(0x136)],'matchedPrefix':_0x270c0['matchedPrefix']}};const _0x1973d9=_0x377e69?.[_0x4d3717(0x126)][_0x4d3717(0x11a)](_0x3f1be6=>_0x3f1be6[_0x4d3717(0x12f)][_0x4d3717(0x120)](_0x34d83b=>_0x4a2f2e[_0x4d3717(0x12f)][_0x4d3717(0x120)](_0x539bcf=>columnNamesMatch(_0x34d83b,_0x539bcf))))??[];if(_0x1973d9[_0x4d3717(0x119)]>0x0)return _0x10bc00['push']({'code':_0x4d3717(0x152),'table':_0x4a2f2e['table'],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e['columns'],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x4a2f2e[_0x4d3717(0x118)],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'status':_0x4d3717(0x145),'candidateIndexes':_0x1973d9};if(_0x377e69&&_0x377e69['metadataAvailable']!==![]&&_0x377e69[_0x4d3717(0x126)][_0x4d3717(0x119)]>0x0&&_0x4a2f2e[_0x4d3717(0x12f)][_0x4d3717(0x119)]>0x0)return _0x10bc00[_0x4d3717(0x13b)]({'code':_0x4d3717(0x112),'table':_0x4a2f2e[_0x4d3717(0x118)],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'reason':_0x4d3717(0x12d)}),{'table':_0x4a2f2e[_0x4d3717(0x118)],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'status':_0x4d3717(0x145)};return _0x10bc00[_0x4d3717(0x13b)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x4a2f2e[_0x4d3717(0x118)],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'reason':_0x377e69?_0x4d3717(0x135):_0x4d3717(0x157)}),{'table':_0x4a2f2e[_0x4d3717(0x118)],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e['columns'],'status':_0x4d3717(0x12a)};});return{'checked':_0x47c8d3[_0x137cc3(0x119)]>0x0,'joins':_0x47c8d3,'warnings':_0x10bc00};}function extractJoinFacts(_0x56ccd4){const _0x47983b=a262_0x4135,_0x50ee37=maskNestedQueries(stripSqlNoise(_0x56ccd4)),_0xc9b745=maskQuotedIdentifiers(_0x50ee37),_0xb73ee5=[],_0x252cb7=new Set(),_0x15756f=/\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 _0x1188ca of _0x50ee37[_0x47983b(0x10a)](_0x15756f)){const _0x27233b=_0x1188ca[_0x47983b(0x136)]??0x0,_0x5d02fe=_0x1188ca[0x0][_0x47983b(0x125)](/\bJOIN\b/i),_0x28e098=_0x27233b+Math[_0x47983b(0x10d)](0x0,_0x5d02fe);if(!/^JOIN\b/i[_0x47983b(0x13a)](_0xc9b745[_0x47983b(0x156)](_0x28e098)))continue;_0x252cb7[_0x47983b(0x140)](_0x28e098);const _0x1ea0a5=normalizeIdentifier(_0x1188ca[0x1]||_0x47983b(0x158)),_0x50a985=normalizeIdentifier(_0x1188ca[0x2]??''),_0x4344ca=normalizeIdentifier(_0x1188ca[0x3]||_0x50a985[_0x47983b(0x146)]('.')['at'](-0x1)||_0x50a985),_0x5ce050=[],_0x57e0e5=_0x50a985==='__sq__';let _0xc3cc6a=_0x1ea0a5===_0x47983b(0x10c)||_0x1ea0a5===_0x47983b(0x155)||_0x57e0e5,_0x54b56d=_0xc3cc6a?_0x57e0e5?_0x47983b(0x111):_0x1ea0a5[_0x47983b(0x144)]()+_0x47983b(0x11d):undefined;const _0x20c969=stripOuterParentheses(_0x1188ca[0x4]??''),_0x188edf=_0x20c969[_0x47983b(0x142)](MYBATIS_DYNAMIC_START_MARKER)||_0x20c969[_0x47983b(0x142)](MYBATIS_DYNAMIC_END_MARKER),_0x460bbd=_0x20c969[_0x47983b(0x142)](MYBATIS_INCLUDE_MARKER);_0x188edf&&(_0xc3cc6a=!![],_0x54b56d??=_0x47983b(0x114));_0x460bbd&&(_0xc3cc6a=!![],_0x54b56d??=_0x47983b(0x10b));const _0x4e8258=_0x20c969[_0x47983b(0x117)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x47983b(0x117)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x47983b(0x117)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x4e8258,'OR')&&(_0xc3cc6a=!![],_0x54b56d??=_0x47983b(0x148));for(const _0x5e6d17 of splitTopLevelAnd(_0x4e8258)){const _0x3fe3aa=stripOuterParentheses(_0x5e6d17);if(hasTopLevelKeyword(_0x3fe3aa,'OR')){_0xc3cc6a=!![],_0x54b56d??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x30f211=splitEquality(_0x3fe3aa);if(!_0x30f211){containsColumnReference(_0x5e6d17,_0x4344ca)&&(_0xc3cc6a=!![]);continue;}const _0x480e66=parseDirectColumnReference(_0x30f211[0x0],_0x4344ca),_0x552fd0=parseDirectColumnReference(_0x30f211[0x1],_0x4344ca),_0x53a6b9=containsColumnReference(_0x30f211[0x0],_0x4344ca),_0x46ac5a=containsColumnReference(_0x30f211[0x1],_0x4344ca),_0x3a9a6d=_0x480e66&&!_0x46ac5a?_0x480e66:_0x552fd0&&!_0x53a6b9?_0x552fd0:null;if(_0x3a9a6d&&!_0x5ce050[_0x47983b(0x142)](_0x3a9a6d))_0x5ce050['push'](_0x3a9a6d);else!_0x3a9a6d&&containsColumnReference(_0x5e6d17,_0x4344ca)&&(_0xc3cc6a=!![]);}_0xb73ee5[_0x47983b(0x13b)]({'table':_0x50a985,'alias':_0x4344ca,'columns':_0x5ce050,'unsupportedPredicate':_0xc3cc6a,'unsupportedReason':_0x54b56d,'containsUnresolvedInclude':_0x460bbd,'position':_0x28e098});}for(const _0x42b3f0 of _0xc9b745['matchAll'](/\bJOIN\b/gi)){const _0x39c784=_0x42b3f0['index']??0x0;if(_0x252cb7[_0x47983b(0x113)](_0x39c784))continue;const _0x4fc925=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x47983b(0x14d)](_0x50ee37['slice'](_0x39c784+_0x42b3f0[0x0][_0x47983b(0x119)])),_0x91fa61=normalizeIdentifier(_0x4fc925?.[0x1]||_0x47983b(0x116)),_0x3bf05d=normalizeIdentifier(_0x4fc925?.[0x2]||''),_0x42b5e1=isSqlClauseKeyword(_0x3bf05d)?_0x91fa61[_0x47983b(0x146)]('.')['at'](-0x1)||_0x91fa61:_0x3bf05d||_0x91fa61[_0x47983b(0x146)]('.')['at'](-0x1)||_0x91fa61;_0xb73ee5[_0x47983b(0x13b)]({'table':_0x91fa61,'alias':_0x42b5e1,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x47983b(0x12b),'position':_0x39c784});}const _0xcc6697=_0xc9b745['indexOf'](MYBATIS_INCLUDE_MARKER);return _0xcc6697>=0x0&&!_0xb73ee5[_0x47983b(0x120)](_0xd4f8e1=>_0xd4f8e1[_0x47983b(0x124)])&&_0xb73ee5[_0x47983b(0x13b)]({'table':_0x47983b(0x116),'alias':_0x47983b(0x116),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x47983b(0x14e),'containsUnresolvedInclude':!![],'position':_0xcc6697}),_0xb73ee5[_0x47983b(0x141)]((_0x188408,_0x39e04f)=>_0x188408[_0x47983b(0x133)]-_0x39e04f[_0x47983b(0x133)]);}function stripSqlNoise(_0x1bbf34){const _0x23be97=a262_0x4135,_0x102c87=Array[_0x23be97(0x139)](_0x1bbf34),_0x2d5dfa=(_0x22733b,_0x3d8c1c)=>{for(let _0x535679=_0x22733b;_0x535679<_0x3d8c1c;_0x535679+=0x1){_0x102c87[_0x535679]!=='\x0a'&&_0x102c87[_0x535679]!=='\x0d'&&(_0x102c87[_0x535679]='\x20');}};for(let _0x344035=0x0;_0x344035<_0x102c87['length'];_0x344035+=0x1){const _0x250281=_0x102c87[_0x344035],_0x5ae30e=_0x102c87[_0x344035+0x1];if(_0x250281==='\x27'||_0x250281==='\x22'||_0x250281==='`'){const _0x2b425=_0x250281,_0x2bcefc=_0x344035;_0x344035+=0x1;while(_0x344035<_0x102c87['length']){if(_0x102c87[_0x344035]==='\x5c'&&_0x344035+0x1<_0x102c87[_0x23be97(0x119)]){_0x344035+=0x2;continue;}if(_0x102c87[_0x344035]!==_0x2b425){_0x344035+=0x1;continue;}if(_0x102c87[_0x344035+0x1]===_0x2b425){_0x344035+=0x2;continue;}break;}if(_0x2b425==='\x27')_0x2d5dfa(_0x2bcefc,Math['min'](_0x344035+0x1,_0x102c87[_0x23be97(0x119)]));continue;}if(_0x250281==='-'&&_0x5ae30e==='-'){const _0x369f06=_0x344035;while(_0x344035<_0x102c87[_0x23be97(0x119)]&&_0x102c87[_0x344035]!=='\x0a')_0x344035+=0x1;_0x2d5dfa(_0x369f06,_0x344035);continue;}if(_0x250281==='/'&&_0x5ae30e==='*'){const _0x3a77a2=_0x344035;_0x344035+=0x2;while(_0x344035<_0x102c87['length']&&!(_0x102c87[_0x344035]==='*'&&_0x102c87[_0x344035+0x1]==='/')){_0x344035+=0x1;}_0x344035=Math[_0x23be97(0x12e)](_0x344035+0x1,_0x102c87['length']-0x1),_0x2d5dfa(_0x3a77a2,_0x344035+0x1);continue;}if(_0x250281==='#'&&_0x5ae30e!=='{'){const _0x3deca0=_0x344035;while(_0x344035<_0x102c87[_0x23be97(0x119)]&&_0x102c87[_0x344035]!=='\x0a')_0x344035+=0x1;_0x2d5dfa(_0x3deca0,_0x344035);continue;}if((_0x250281==='#'||_0x250281==='$')&&_0x5ae30e==='{'){const _0x401e48=_0x344035;_0x344035+=0x2;while(_0x344035<_0x102c87[_0x23be97(0x119)]&&_0x102c87[_0x344035]!=='}')_0x344035+=0x1;_0x2d5dfa(_0x401e48,Math[_0x23be97(0x12e)](_0x344035+0x1,_0x102c87[_0x23be97(0x119)]));}}return _0x102c87[_0x23be97(0x122)]('');}function maskQuotedIdentifiers(_0x3a9926){const _0x312cc9=a262_0x4135,_0x4cee42=Array[_0x312cc9(0x139)](_0x3a9926);for(let _0x21c8fe=0x0;_0x21c8fe<_0x4cee42[_0x312cc9(0x119)];_0x21c8fe+=0x1){const _0x2588fa=_0x4cee42[_0x21c8fe];if(_0x2588fa!=='\x22'&&_0x2588fa!=='`')continue;_0x21c8fe+=0x1;while(_0x21c8fe<_0x4cee42[_0x312cc9(0x119)]){if(_0x4cee42[_0x21c8fe]===_0x2588fa){if(_0x4cee42[_0x21c8fe+0x1]===_0x2588fa){_0x4cee42[_0x21c8fe]='\x20',_0x4cee42[_0x21c8fe+0x1]='\x20',_0x21c8fe+=0x2;continue;}break;}_0x4cee42[_0x21c8fe]='\x20',_0x21c8fe+=0x1;}}return _0x4cee42[_0x312cc9(0x122)]('');}function maskNestedQueries(_0x2736f3){const _0x2cb6c1=a262_0x4135,_0x35a4e2=Array[_0x2cb6c1(0x139)](_0x2736f3);for(let _0x766ca8=0x0;_0x766ca8<_0x35a4e2[_0x2cb6c1(0x119)];_0x766ca8+=0x1){if(_0x35a4e2[_0x766ca8]!=='(')continue;const _0x9408a7=_0x2736f3['slice'](_0x766ca8+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x2cb6c1(0x13a)](_0x9408a7))continue;let _0x477a73=0x1,_0x485ba5=_0x766ca8+0x1;for(;_0x485ba5<_0x35a4e2['length']&&_0x477a73>0x0;_0x485ba5+=0x1){if(_0x35a4e2[_0x485ba5]==='(')_0x477a73+=0x1;if(_0x35a4e2[_0x485ba5]===')')_0x477a73-=0x1;}if(_0x477a73!==0x0)continue;for(let _0x3feb52=_0x766ca8;_0x3feb52<_0x485ba5;_0x3feb52+=0x1){_0x35a4e2[_0x3feb52]='\x20';}const _0x1527e7=_0x2cb6c1(0x132);for(let _0x4df0e9=0x0;_0x4df0e9<_0x1527e7[_0x2cb6c1(0x119)]&&_0x766ca8+_0x4df0e9<_0x485ba5;_0x4df0e9+=0x1){_0x35a4e2[_0x766ca8+_0x4df0e9]=_0x1527e7[_0x4df0e9];}_0x766ca8=_0x485ba5-0x1;}return _0x35a4e2[_0x2cb6c1(0x122)]('');}function splitTopLevelAnd(_0x283e0e){const _0x5b26ac=a262_0x4135,_0x7c6b3f=[];let _0x4d3bc4=0x0,_0x2eab1c=0x0;for(let _0x37a5f7=0x0;_0x37a5f7<_0x283e0e['length'];_0x37a5f7+=0x1){const _0x17d877=_0x283e0e[_0x37a5f7];if(_0x17d877==='(')_0x4d3bc4+=0x1;if(_0x17d877===')')_0x4d3bc4=Math[_0x5b26ac(0x10d)](0x0,_0x4d3bc4-0x1);_0x4d3bc4===0x0&&_0x283e0e[_0x5b26ac(0x156)](_0x37a5f7)['match'](/^AND\b/i)&&(_0x37a5f7===0x0||/\s/[_0x5b26ac(0x13a)](_0x283e0e[_0x37a5f7-0x1]??''))&&(_0x7c6b3f[_0x5b26ac(0x13b)](_0x283e0e[_0x5b26ac(0x156)](_0x2eab1c,_0x37a5f7)[_0x5b26ac(0x151)]()),_0x37a5f7+=0x2,_0x2eab1c=_0x37a5f7+0x1);}const _0x32ce27=_0x283e0e[_0x5b26ac(0x156)](_0x2eab1c)['trim']();if(_0x32ce27)_0x7c6b3f['push'](_0x32ce27);return _0x7c6b3f;}function hasTopLevelKeyword(_0x35cba7,_0x1fee31){const _0x117b3a=a262_0x4135;let _0x19f060=0x0;for(let _0xd57afc=0x0;_0xd57afc<_0x35cba7[_0x117b3a(0x119)];_0xd57afc+=0x1){const _0x2020d4=_0x35cba7[_0xd57afc];if(_0x2020d4==='(')_0x19f060+=0x1;if(_0x2020d4===')')_0x19f060=Math[_0x117b3a(0x10d)](0x0,_0x19f060-0x1);if(_0x19f060!==0x0)continue;const _0x568d37=_0x35cba7['slice'](_0xd57afc,_0xd57afc+_0x1fee31[_0x117b3a(0x119)]),_0x355a22=_0x35cba7[_0xd57afc-0x1]??'\x20',_0x366e76=_0x35cba7[_0xd57afc+_0x1fee31['length']]??'\x20';if(_0x568d37[_0x117b3a(0x144)]()===_0x1fee31['toUpperCase']()&&!/[\w$]/['test'](_0x355a22)&&!/[\w$]/[_0x117b3a(0x13a)](_0x366e76))return!![];}return![];}function splitEquality(_0x1880cd){const _0x2d0a1a=a262_0x4135,_0x451d27=stripOuterParentheses(_0x1880cd);let _0x30cd16=0x0,_0x1f33e9;for(let _0x20b3c9=0x0;_0x20b3c9<_0x451d27[_0x2d0a1a(0x119)];_0x20b3c9+=0x1){const _0x4fa863=_0x451d27[_0x20b3c9];if(_0x4fa863==='(')_0x30cd16+=0x1;if(_0x4fa863===')')_0x30cd16=Math[_0x2d0a1a(0x10d)](0x0,_0x30cd16-0x1);const _0x830a2=_0x451d27[_0x20b3c9-0x1]??'',_0x444266=_0x451d27[_0x20b3c9+0x1]??'';if(_0x4fa863==='='&&_0x30cd16===0x0&&!/[!<>=:]/[_0x2d0a1a(0x13a)](_0x830a2)&&_0x444266!=='='){if(_0x1f33e9!==undefined)return null;_0x1f33e9=_0x20b3c9;}}return _0x1f33e9===undefined?null:[_0x451d27[_0x2d0a1a(0x156)](0x0,_0x1f33e9)[_0x2d0a1a(0x151)](),_0x451d27[_0x2d0a1a(0x156)](_0x1f33e9+0x1)[_0x2d0a1a(0x151)]()];}function parseDirectColumnReference(_0x1697a2,_0x4c1be1){const _0x309621=a262_0x4135,_0x5f183c=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x309621(0x14d)](stripOuterParentheses(_0x1697a2));if(!_0x5f183c)return null;if(normalizeIdentifier(_0x5f183c[0x1]??'')!==normalizeIdentifier(_0x4c1be1))return null;return normalizeIdentifier(_0x5f183c[0x2]??'');}function containsColumnReference(_0x8cdef8,_0xa26be4){const _0xd21aec=a262_0x4135,_0x1be945=_0x8cdef8[_0xd21aec(0x14a)](/[`"]/g,''),_0x2bc746=_0xa26be4[_0xd21aec(0x14a)](/[.*+?^${}()|[\]\\]/g,_0xd21aec(0x110));return new RegExp(_0xd21aec(0x13e)+_0x2bc746+_0xd21aec(0x128),'i')[_0xd21aec(0x13a)](_0x1be945);}function findEqualityPrefix(_0x5b533a,_0xe2d88f){const _0x299806=a262_0x4135,_0xc90845=new Set(_0xe2d88f[_0x299806(0x10e)](normalizeIdentifier)),_0x39cfda=[];for(const _0x5a5a31 of _0x5b533a){if(!_0xc90845[_0x299806(0x113)](normalizeIdentifier(_0x5a5a31)))break;_0x39cfda[_0x299806(0x13b)](_0x5a5a31);}return _0x39cfda;}function a262_0x57c1(){const _0x4ba5c9=['startsWith','63224CfRvhV','(?:^|[^\x5cw$])','unsupportedPredicate','add','sort','includes','error','toUpperCase','warning','split','5680604lIhPMQ','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','2302845VAGHrh','replace','2981626UEPiqR','left','exec','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','toLowerCase','natural','trim','JOIN_INDEX_NOT_USABLE','cross','alias','full','slice','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','INNER','matchAll','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','right','max','map','inner','\x5c$&','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','JOIN_INDEX_MISSING','has','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','10011440nMUZsZ','unknown','replaceAll','table','length','filter','3CfgsVE','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','where','1575gOuiuh','some','1mcdHZM','join','unsupportedReason','containsUnresolvedInclude','search','indexes','8428376BPMzuo','\x5cs*\x5c.\x5cs*[\x5cw$]+','endsWith','unavailable','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','6hNTyoF','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','min','columns','JOIN_PREDICATE_UNSUPPORTED','sql','__sq__','position','tableName','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','index','1763069gusHkh','matchedPrefix','from','test','push'];a262_0x57c1=function(){return _0x4ba5c9;};return a262_0x57c1();}function resolveTableMetadata(_0x5c6c11,_0xbbf50f){const _0xb3a389=a262_0x4135,_0x281865=normalizeIdentifier(_0xbbf50f),_0x1d3c2b=_0x5c6c11[_0xb3a389(0x11a)](_0x4f4612=>normalizeIdentifier(_0x4f4612[_0xb3a389(0x134)])===_0x281865);if(_0x1d3c2b[_0xb3a389(0x119)]===0x1)return _0x1d3c2b[0x0];const _0x30bda9=_0x281865['includes']('.'),_0x49c2f9=_0x281865[_0xb3a389(0x146)]('.')['at'](-0x1),_0x18c31f=_0x5c6c11['filter'](_0x1591d3=>{const _0x4a9d24=_0xb3a389,_0x25ff4d=normalizeIdentifier(_0x1591d3[_0x4a9d24(0x134)]);if(_0x30bda9&&_0x25ff4d[_0x4a9d24(0x142)]('.'))return![];return _0x25ff4d[_0x4a9d24(0x146)]('.')['at'](-0x1)===_0x49c2f9;});return _0x18c31f[_0xb3a389(0x119)]===0x1?_0x18c31f[0x0]:undefined;}function a262_0x4135(_0x22bd85,_0x2682ca){_0x22bd85=_0x22bd85-0x10a;const _0x57c158=a262_0x57c1();let _0x41351c=_0x57c158[_0x22bd85];return _0x41351c;}function columnNamesMatch(_0x4e3f82,_0x3f1436){return normalizeIdentifier(_0x4e3f82)===normalizeIdentifier(_0x3f1436);}function normalizeIdentifier(_0x1bebe4){const _0x53a040=a262_0x4135;return _0x1bebe4[_0x53a040(0x14a)](/[`"]/g,'')[_0x53a040(0x151)]()[_0x53a040(0x14f)]();}function isSqlClauseKeyword(_0x2eae77){const _0x2fe9e8=a262_0x4135;return new Set(['on','using',_0x2fe9e8(0x11e),_0x2fe9e8(0x122),_0x2fe9e8(0x10f),_0x2fe9e8(0x14c),_0x2fe9e8(0x10c),_0x2fe9e8(0x155),_0x2fe9e8(0x153),_0x2fe9e8(0x150)])[_0x2fe9e8(0x113)](_0x2eae77);}function stripOuterParentheses(_0x144580){const _0x59a453=a262_0x4135;let _0x57b573=_0x144580[_0x59a453(0x151)]();while(_0x57b573[_0x59a453(0x13c)]('(')&&_0x57b573[_0x59a453(0x129)](')')){let _0x1fd1b5=0x0,_0x23f7b6=!![];for(let _0x48af64=0x0;_0x48af64<_0x57b573[_0x59a453(0x119)];_0x48af64+=0x1){if(_0x57b573[_0x48af64]==='(')_0x1fd1b5+=0x1;if(_0x57b573[_0x48af64]===')')_0x1fd1b5-=0x1;if(_0x1fd1b5===0x0&&_0x48af64<_0x57b573[_0x59a453(0x119)]-0x1){_0x23f7b6=![];break;}}if(!_0x23f7b6||_0x1fd1b5!==0x0)break;_0x57b573=_0x57b573[_0x59a453(0x156)](0x1,-0x1)[_0x59a453(0x151)]();}return _0x57b573;}
@@ -1 +1 @@
1
- function a250_0x1419(){const _0xc35dbe=['7832310qoHokz','33551GOlzBI','1224680BWvOZL','4748139ayujhA','2620hUcxFB','2408iRzjVh','.rabetbase','564SEtLnw','6601090kGClCy','sql.lock.json','2851278OLNAiw','3RvaRZX','sql','/sql'];a250_0x1419=function(){return _0xc35dbe;};return a250_0x1419();}function a250_0x4084(_0x107255,_0x56aee9){_0x107255=_0x107255-0xb0;const _0x1419c2=a250_0x1419();let _0x40842b=_0x1419c2[_0x107255];return _0x40842b;}const a250_0x4572a8=a250_0x4084;(function(_0x3e4682,_0x4fc8e7){const _0x9148be=a250_0x4084,_0x11bd41=_0x3e4682();while(!![]){try{const _0x2cd407=-parseInt(_0x9148be(0xb1))/0x1*(parseInt(_0x9148be(0xbc))/0x2)+parseInt(_0x9148be(0xb5))/0x3*(-parseInt(_0x9148be(0xba))/0x4)+parseInt(_0x9148be(0xb2))/0x5+parseInt(_0x9148be(0xb4))/0x6+parseInt(_0x9148be(0xb9))/0x7*(parseInt(_0x9148be(0xbd))/0x8)+-parseInt(_0x9148be(0xbb))/0x9+-parseInt(_0x9148be(0xb8))/0xa;if(_0x2cd407===_0x4fc8e7)break;else _0x11bd41['push'](_0x11bd41['shift']());}catch(_0x38ebe4){_0x11bd41['push'](_0x11bd41['shift']());}}}(a250_0x1419,0xd7688));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a250_0x4572a8(0xb0),LOCK_FILE_NAME=a250_0x4572a8(0xb3),TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x341aec,_0x14aacd){const _0xacd0c9=a250_0x4572a8,_0x429c31=resolve(_0x14aacd??findProjectRootDirectory()),_0x336252=DOT_DIR+_0xacd0c9(0xb7),_0x826e09=_0x336252+'/'+_0x341aec;return{'projectRoot':_0x429c31,'appCode':_0x341aec,'sqlWorkspaceRoot':_0x336252,'sqlRoot':_0x826e09,'sqlRootDir':resolve(_0x429c31,DOT_DIR,_0xacd0c9(0xb6),_0x341aec),'lockFilePath':resolve(_0x429c31,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x429c31,DOT_DIR,TRASH_DIR_NAME)};}
1
+ function a263_0xbce9(){const _0x5dc20d=['77070DoVDkY','809324fQtGpR','2313qrcsSK','5XthYVt','305706TzkLun','270czJocm','sql.lock.json','sql-trash','10ZqbtSc','sql','576009XjcCds','9592uVmzCA','242033QxHVNI','.rabetbase','361299xipAAs'];a263_0xbce9=function(){return _0x5dc20d;};return a263_0xbce9();}const a263_0x3fab4f=a263_0x3d49;(function(_0x1edbbf,_0x4f6aed){const _0x44b46c=a263_0x3d49,_0x2d9545=_0x1edbbf();while(!![]){try{const _0x3d20d1=-parseInt(_0x44b46c(0x7b))/0x1*(parseInt(_0x44b46c(0x78))/0x2)+-parseInt(_0x44b46c(0x77))/0x3+parseInt(_0x44b46c(0x79))/0x4+parseInt(_0x44b46c(0x80))/0x5*(-parseInt(_0x44b46c(0x7c))/0x6)+parseInt(_0x44b46c(0x73))/0x7+parseInt(_0x44b46c(0x74))/0x8*(-parseInt(_0x44b46c(0x7a))/0x9)+-parseInt(_0x44b46c(0x7d))/0xa*(-parseInt(_0x44b46c(0x75))/0xb);if(_0x3d20d1===_0x4f6aed)break;else _0x2d9545['push'](_0x2d9545['shift']());}catch(_0x1d334b){_0x2d9545['push'](_0x2d9545['shift']());}}}(a263_0xbce9,0x25f9a));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a263_0x3fab4f(0x76),LOCK_FILE_NAME=a263_0x3fab4f(0x7e),TRASH_DIR_NAME=a263_0x3fab4f(0x7f);function a263_0x3d49(_0x2a9164,_0x831428){_0x2a9164=_0x2a9164-0x73;const _0xbce988=a263_0xbce9();let _0x3d4961=_0xbce988[_0x2a9164];return _0x3d4961;}export function loadSqlProjectConfig(_0x2c7e06,_0x497344){const _0x4b9c20=a263_0x3fab4f,_0x37d09b=resolve(_0x497344??findProjectRootDirectory()),_0x27ad30=DOT_DIR+'/sql',_0x2af170=_0x27ad30+'/'+_0x2c7e06;return{'projectRoot':_0x37d09b,'appCode':_0x2c7e06,'sqlWorkspaceRoot':_0x27ad30,'sqlRoot':_0x2af170,'sqlRootDir':resolve(_0x37d09b,DOT_DIR,_0x4b9c20(0x81),_0x2c7e06),'lockFilePath':resolve(_0x37d09b,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x37d09b,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x214ee6,_0xbff49c){const _0x53f897=a251_0x4166,_0x527095=_0x214ee6();while(!![]){try{const _0x4533d7=parseInt(_0x53f897(0x1ba))/0x1*(parseInt(_0x53f897(0x1c0))/0x2)+-parseInt(_0x53f897(0x1bf))/0x3+parseInt(_0x53f897(0x1a8))/0x4*(-parseInt(_0x53f897(0x1a6))/0x5)+parseInt(_0x53f897(0x1c2))/0x6+parseInt(_0x53f897(0x1b8))/0x7*(-parseInt(_0x53f897(0x1aa))/0x8)+-parseInt(_0x53f897(0x1b2))/0x9*(parseInt(_0x53f897(0x1c4))/0xa)+parseInt(_0x53f897(0x1c6))/0xb*(parseInt(_0x53f897(0x1c3))/0xc);if(_0x4533d7===_0xbff49c)break;else _0x527095['push'](_0x527095['shift']());}catch(_0x1a2d20){_0x527095['push'](_0x527095['shift']());}}}(a251_0xbbb0,0xd1538));function a251_0x4166(_0x20256e,_0x4e9b31){_0x20256e=_0x20256e-0x1a4;const _0xbbb074=a251_0xbbb0();let _0x416668=_0xbbb074[_0x20256e];return _0x416668;}import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function a251_0xbbb0(){const _0x112e02=['ENOENT','780397IUTwmn','toLowerCase','indexOf','dbName','length','3193917FAiZLw','2LYZigu','filter','5597658FqzUtC','172212vazzXQ','110dxLxDJ','replace','1837cKlyQN','.xml','sql','825aaOOqG','slice','29308INouWW','mode','2312SlWnLR','mybatisXml','dbId','isFile','sqlCode','sqlRootDir','isDirectory','code','6246ojZVlE','path','name','sqlName','split','push','23527CHUJGo'];a251_0xbbb0=function(){return _0x112e02;};return a251_0xbbb0();}function extensionToMode(_0x58d57f){const _0x14e3e7=a251_0x4166;if(_0x58d57f==='.sql')return _0x14e3e7(0x1a5);if(_0x58d57f===_0x14e3e7(0x1a4))return _0x14e3e7(0x1ab);return undefined;}async function scanSqlFilesRecursively(_0xf5942f,_0x4d8958){const _0x57fa1c=a251_0x4166,_0x51ced4=[];try{const _0x2e3f26=await readdir(_0xf5942f,{'withFileTypes':!![]});for(const _0x5cec58 of _0x2e3f26){const _0x5769ad=join(_0xf5942f,_0x5cec58[_0x57fa1c(0x1b4)]);if(_0x5cec58[_0x57fa1c(0x1b0)]()){_0x51ced4['push'](...await scanSqlFilesRecursively(_0x5769ad,_0x4d8958));continue;}if(!_0x5cec58[_0x57fa1c(0x1ad)]())continue;const _0x129f09=extname(_0x5cec58[_0x57fa1c(0x1b4)])[_0x57fa1c(0x1bb)](),_0x1770de=extensionToMode(_0x129f09);if(!_0x1770de)continue;const _0x4581a7=relative(_0x4d8958,_0x5769ad)[_0x57fa1c(0x1c5)](/\\/g,'/'),_0x5e4d6d=_0x4581a7[_0x57fa1c(0x1b6)]('/')[_0x57fa1c(0x1c1)](Boolean),_0xc8f7a=parseSqlPath(_0x5e4d6d,_0x5cec58[_0x57fa1c(0x1b4)],_0x129f09);if(!_0xc8f7a)continue;_0x51ced4[_0x57fa1c(0x1b7)]({'sqlCode':_0xc8f7a['sqlCode'],'sqlName':_0xc8f7a[_0x57fa1c(0x1b5)],'dbDirectory':_0x5e4d6d[0x0],'filePath':_0x5769ad,'relativePath':_0x4581a7,'lockKey':_0xc8f7a[_0x57fa1c(0x1ae)],'mode':_0x1770de});}}catch(_0x25a4b2){if(_0x25a4b2[_0x57fa1c(0x1b1)]!==_0x57fa1c(0x1b9))throw _0x25a4b2;}return _0x51ced4;}export async function scanLocalSqlQueries(_0x2801df){const _0x3018f9=a251_0x4166;return scanSqlFilesRecursively(_0x2801df[_0x3018f9(0x1af)],_0x2801df['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x59d439,_0x4beacc,_0xca754e){const _0x4758e0=a251_0x4166,_0x598b55=_0xca754e?.[_0x4758e0(0x1b3)]||(_0xca754e?.['sqlName']||_0xca754e?.[_0x4758e0(0x1bd)]?buildSqlRelativePath(_0x4beacc,_0xca754e?.['sqlName'],_0xca754e?.[_0x4758e0(0x1bd)],_0xca754e?.['mode']||_0x4758e0(0x1a5),_0xca754e?.[_0x4758e0(0x1ac)]):buildDefaultSqlFileName(_0x4beacc,_0xca754e?.[_0x4758e0(0x1a9)]||_0x4758e0(0x1a5)));return join(_0x59d439['sqlRootDir'],_0x598b55);}export async function directoryExists(_0x13bb03){const _0x4ecc96=a251_0x4166;try{const _0x30687f=await stat(_0x13bb03);return _0x30687f[_0x4ecc96(0x1b0)]();}catch{return![];}}function parseSqlPath(_0x210cc1,_0x57e155,_0x53ff5d){const _0x7a69c1=a251_0x4166,_0x3e0904=_0x57e155[_0x7a69c1(0x1a7)](0x0,-_0x53ff5d[_0x7a69c1(0x1be)]);if(_0x210cc1[_0x7a69c1(0x1be)]<0x2)return null;const _0x186bfa=_0x3e0904[_0x7a69c1(0x1bc)]('_');if(_0x186bfa<=0x0||_0x186bfa>=_0x3e0904[_0x7a69c1(0x1be)]-0x1)return null;const _0x19d43a=_0x3e0904[_0x7a69c1(0x1a7)](0x0,_0x186bfa);if(!isLikelySqlCode(_0x19d43a))return null;return{'sqlCode':_0x19d43a,'sqlName':_0x3e0904[_0x7a69c1(0x1a7)](_0x186bfa+0x1)};}function isLikelySqlCode(_0x29e133){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0x29e133);}
1
+ (function(_0x377e97,_0x52de5d){const _0x2646cf=a264_0xf705,_0xbef8c8=_0x377e97();while(!![]){try{const _0x498af8=-parseInt(_0x2646cf(0xc7))/0x1*(-parseInt(_0x2646cf(0xc9))/0x2)+-parseInt(_0x2646cf(0xe7))/0x3*(parseInt(_0x2646cf(0xe2))/0x4)+parseInt(_0x2646cf(0xca))/0x5+-parseInt(_0x2646cf(0xda))/0x6+-parseInt(_0x2646cf(0xe4))/0x7*(-parseInt(_0x2646cf(0xe6))/0x8)+parseInt(_0x2646cf(0xce))/0x9*(-parseInt(_0x2646cf(0xe1))/0xa)+parseInt(_0x2646cf(0xd5))/0xb;if(_0x498af8===_0x52de5d)break;else _0xbef8c8['push'](_0xbef8c8['shift']());}catch(_0x52c4fb){_0xbef8c8['push'](_0xbef8c8['shift']());}}}(a264_0x1167,0x82b2d));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x566e7b){const _0x126cef=a264_0xf705;if(_0x566e7b===_0x126cef(0xd4))return _0x126cef(0xd9);if(_0x566e7b===_0x126cef(0xd3))return _0x126cef(0xdf);return undefined;}function a264_0x1167(){const _0x781734=['983144zhmCSo','11985tePnaj','5PtrccJ','name','25790FeOghr','1127715lbKDpy','test','isFile','mode','81NApubv','code','replace','dbName','isDirectory','.xml','.sql','13656610HErBjb','toLowerCase','ENOENT','slice','sql','268344xMQWpE','sqlCode','dbId','length','path','mybatisXml','filter','270440wOcCow','832IUMyyb','sqlRootDir','7BKNQuw','push'];a264_0x1167=function(){return _0x781734;};return a264_0x1167();}async function scanSqlFilesRecursively(_0x4c5e5b,_0x17d7e7){const _0x45ddeb=a264_0xf705,_0x3b352f=[];try{const _0x30ef41=await readdir(_0x4c5e5b,{'withFileTypes':!![]});for(const _0xb18492 of _0x30ef41){const _0x16781e=join(_0x4c5e5b,_0xb18492['name']);if(_0xb18492[_0x45ddeb(0xd2)]()){_0x3b352f[_0x45ddeb(0xe5)](...await scanSqlFilesRecursively(_0x16781e,_0x17d7e7));continue;}if(!_0xb18492[_0x45ddeb(0xcc)]())continue;const _0x112c65=extname(_0xb18492[_0x45ddeb(0xc8)])[_0x45ddeb(0xd6)](),_0x4deb87=extensionToMode(_0x112c65);if(!_0x4deb87)continue;const _0x435fbe=relative(_0x17d7e7,_0x16781e)[_0x45ddeb(0xd0)](/\\/g,'/'),_0x2d5b21=_0x435fbe['split']('/')[_0x45ddeb(0xe0)](Boolean),_0xc945d6=parseSqlPath(_0x2d5b21,_0xb18492[_0x45ddeb(0xc8)],_0x112c65);if(!_0xc945d6)continue;_0x3b352f['push']({'sqlCode':_0xc945d6['sqlCode'],'sqlName':_0xc945d6['sqlName'],'dbDirectory':_0x2d5b21[0x0],'filePath':_0x16781e,'relativePath':_0x435fbe,'lockKey':_0xc945d6[_0x45ddeb(0xdb)],'mode':_0x4deb87});}}catch(_0x3fce03){if(_0x3fce03[_0x45ddeb(0xcf)]!==_0x45ddeb(0xd7))throw _0x3fce03;}return _0x3b352f;}export async function scanLocalSqlQueries(_0x5798c8){const _0x6f0e7b=a264_0xf705;return scanSqlFilesRecursively(_0x5798c8[_0x6f0e7b(0xe3)],_0x5798c8[_0x6f0e7b(0xe3)]);}export function resolveLocalSqlFilePath(_0x249950,_0x5945b1,_0x124b4a){const _0x4e6b8c=a264_0xf705,_0x3a9210=_0x124b4a?.[_0x4e6b8c(0xde)]||(_0x124b4a?.['sqlName']||_0x124b4a?.['dbName']?buildSqlRelativePath(_0x5945b1,_0x124b4a?.['sqlName'],_0x124b4a?.[_0x4e6b8c(0xd1)],_0x124b4a?.[_0x4e6b8c(0xcd)]||_0x4e6b8c(0xd9),_0x124b4a?.[_0x4e6b8c(0xdc)]):buildDefaultSqlFileName(_0x5945b1,_0x124b4a?.[_0x4e6b8c(0xcd)]||'sql'));return join(_0x249950['sqlRootDir'],_0x3a9210);}function a264_0xf705(_0x5c321d,_0x321305){_0x5c321d=_0x5c321d-0xc7;const _0x116704=a264_0x1167();let _0xf705d6=_0x116704[_0x5c321d];return _0xf705d6;}export async function directoryExists(_0x2528fc){const _0x20d01a=a264_0xf705;try{const _0x3a317d=await stat(_0x2528fc);return _0x3a317d[_0x20d01a(0xd2)]();}catch{return![];}}function parseSqlPath(_0x43bae8,_0x99b827,_0x478c36){const _0x4be3c5=a264_0xf705,_0x4b57eb=_0x99b827[_0x4be3c5(0xd8)](0x0,-_0x478c36[_0x4be3c5(0xdd)]);if(_0x43bae8[_0x4be3c5(0xdd)]<0x2)return null;const _0x71b3d7=_0x4b57eb['indexOf']('_');if(_0x71b3d7<=0x0||_0x71b3d7>=_0x4b57eb[_0x4be3c5(0xdd)]-0x1)return null;const _0x473efb=_0x4b57eb[_0x4be3c5(0xd8)](0x0,_0x71b3d7);if(!isLikelySqlCode(_0x473efb))return null;return{'sqlCode':_0x473efb,'sqlName':_0x4b57eb[_0x4be3c5(0xd8)](_0x71b3d7+0x1)};}function isLikelySqlCode(_0x358b6d){const _0x2073ee=a264_0xf705;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x2073ee(0xcb)](_0x358b6d);}
@@ -1 +1 @@
1
- (function(_0x37c359,_0x3723f6){const _0x44d3b2=a252_0x34d2,_0x1d0fe9=_0x37c359();while(!![]){try{const _0x4d409e=parseInt(_0x44d3b2(0x1c6))/0x1*(parseInt(_0x44d3b2(0x1cd))/0x2)+parseInt(_0x44d3b2(0x1cb))/0x3*(parseInt(_0x44d3b2(0x1ca))/0x4)+-parseInt(_0x44d3b2(0x1c9))/0x5*(parseInt(_0x44d3b2(0x1c7))/0x6)+parseInt(_0x44d3b2(0x1c3))/0x7+parseInt(_0x44d3b2(0x1ce))/0x8*(-parseInt(_0x44d3b2(0x1cf))/0x9)+parseInt(_0x44d3b2(0x1c5))/0xa+-parseInt(_0x44d3b2(0x1c4))/0xb;if(_0x4d409e===_0x3723f6)break;else _0x1d0fe9['push'](_0x1d0fe9['shift']());}catch(_0x592498){_0x1d0fe9['push'](_0x1d0fe9['shift']());}}}(a252_0x9eef,0x7e584));import{readFile}from'node:fs/promises';function a252_0x9eef(){const _0x54a346=['3167176hGRAMF','18WwHaqH','update','hex','3609319ubJLUD','20053957cTkWzC','10097970aYAzgZ','34568LIQtfU','2154TwWZWr','digest','195TSdXJq','103084mwGUFj','72zNujaI','utf8','58mayAbU'];a252_0x9eef=function(){return _0x54a346;};return a252_0x9eef();}import a252_0x21313d from'node:crypto';function a252_0x34d2(_0x193c79,_0x57d8c8){_0x193c79=_0x193c79-0x1c2;const _0x9eef1b=a252_0x9eef();let _0x34d253=_0x9eef1b[_0x193c79];return _0x34d253;}export function computeSqlContentHash(_0x5c0392){const _0x1e5579=a252_0x34d2;return a252_0x21313d['createHash']('md5')[_0x1e5579(0x1d0)](_0x5c0392)[_0x1e5579(0x1c8)](_0x1e5579(0x1c2));}export async function computeSqlFileHash(_0x2ab221){const _0x57e1f0=a252_0x34d2,_0x5d52e5=await readFile(_0x2ab221,_0x57e1f0(0x1cc));return computeSqlContentHash(_0x5d52e5);}
1
+ function a265_0x13aa(){const _0xb2b0d4=['11rJhFtK','1140cnNYiP','788784OvIPMi','2432604TvuEhl','547674wxjGsS','update','48483enkzzk','42642VBYQKd','md5','54XrZuCm','25164ZIITJl','digest','hex','createHash','utf8','12RgIhlP','445045kxgPTj','329ElmqWD'];a265_0x13aa=function(){return _0xb2b0d4;};return a265_0x13aa();}function a265_0x349c(_0xbd09a,_0x553897){_0xbd09a=_0xbd09a-0xf5;const _0x13aab7=a265_0x13aa();let _0x349cbd=_0x13aab7[_0xbd09a];return _0x349cbd;}(function(_0x3c6acf,_0x35c3b6){const _0x4e2d3b=a265_0x349c,_0xd25437=_0x3c6acf();while(!![]){try{const _0x453292=parseInt(_0x4e2d3b(0xfe))/0x1+-parseInt(_0x4e2d3b(0x101))/0x2*(parseInt(_0x4e2d3b(0x103))/0x3)+parseInt(_0x4e2d3b(0xf7))/0x4*(-parseInt(_0x4e2d3b(0xf8))/0x5)+-parseInt(_0x4e2d3b(0x104))/0x6*(-parseInt(_0x4e2d3b(0xf9))/0x7)+-parseInt(_0x4e2d3b(0xfc))/0x8+parseInt(_0x4e2d3b(0x100))/0x9*(parseInt(_0x4e2d3b(0xfb))/0xa)+parseInt(_0x4e2d3b(0xfa))/0xb*(-parseInt(_0x4e2d3b(0xfd))/0xc);if(_0x453292===_0x35c3b6)break;else _0xd25437['push'](_0xd25437['shift']());}catch(_0xb4a06b){_0xd25437['push'](_0xd25437['shift']());}}}(a265_0x13aa,0x63506));import{readFile}from'node:fs/promises';import a265_0x2380f7 from'node:crypto';export function computeSqlContentHash(_0x4ebc69){const _0x2fc530=a265_0x349c;return a265_0x2380f7[_0x2fc530(0xf5)](_0x2fc530(0x102))[_0x2fc530(0xff)](_0x4ebc69)[_0x2fc530(0x105)](_0x2fc530(0x106));}export async function computeSqlFileHash(_0x253348){const _0x3f704d=a265_0x349c,_0x493b78=await readFile(_0x253348,_0x3f704d(0xf6));return computeSqlContentHash(_0x493b78);}
@@ -1 +1 @@
1
- (function(_0x68b73b,_0x44d4c8){const _0x25344a=a253_0x4811,_0x1aee32=_0x68b73b();while(!![]){try{const _0x4f9278=-parseInt(_0x25344a(0x169))/0x1+-parseInt(_0x25344a(0x16b))/0x2*(parseInt(_0x25344a(0x168))/0x3)+parseInt(_0x25344a(0x175))/0x4+parseInt(_0x25344a(0x173))/0x5+parseInt(_0x25344a(0x16e))/0x6+parseInt(_0x25344a(0x170))/0x7*(parseInt(_0x25344a(0x178))/0x8)+parseInt(_0x25344a(0x172))/0x9*(-parseInt(_0x25344a(0x167))/0xa);if(_0x4f9278===_0x44d4c8)break;else _0x1aee32['push'](_0x1aee32['shift']());}catch(_0x3881d4){_0x1aee32['push'](_0x1aee32['shift']());}}}(a253_0x4425,0xc96ea));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x167709,_0x25e16b,_0x5897bf,_0x3aba29){const _0x5a1e54=a253_0x4811,_0x46f98f=_0x167709??createEmptySqlLock();let _0x7be57e=_0x46f98f[_0x5a1e54(0x174)][_0x25e16b];if(!_0x7be57e)return _0x7be57e={'sqlRoot':_0x5897bf,'lastSync':'','sqls':{}},_0x46f98f[_0x5a1e54(0x174)][_0x25e16b]=_0x7be57e,{'lockData':_0x46f98f,'appLock':_0x7be57e};if(!_0x7be57e[_0x5a1e54(0x177)])_0x7be57e[_0x5a1e54(0x177)]=_0x5897bf;else{if(_0x7be57e['sqlRoot']!==_0x5897bf)throw new Error(_0x3aba29+':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'+_0x5897bf+_0x5a1e54(0x16d)+_0x7be57e[_0x5a1e54(0x177)]+_0x5a1e54(0x17a)+_0x5a1e54(0x17b));}return!_0x7be57e[_0x5a1e54(0x171)]&&(_0x7be57e[_0x5a1e54(0x171)]={}),!_0x7be57e[_0x5a1e54(0x17d)]&&(_0x7be57e['lastSync']=''),{'lockData':_0x46f98f,'appLock':_0x7be57e};}export async function readSqlLockFile(_0x411b04){const _0x3078ef=a253_0x4811;try{const _0x3bb598=await readFile(_0x411b04,_0x3078ef(0x16f));return JSON[_0x3078ef(0x179)](_0x3bb598);}catch(_0x511fcd){if(_0x511fcd[_0x3078ef(0x17c)]===_0x3078ef(0x176))return null;throw new Error(_0x3078ef(0x16c)+String(_0x511fcd));}}function a253_0x4811(_0x2c1c3d,_0x42c128){_0x2c1c3d=_0x2c1c3d-0x167;const _0x442578=a253_0x4425();let _0x481116=_0x442578[_0x2c1c3d];return _0x481116;}function a253_0x4425(){const _0x3b8ba6=['\x22.\x20','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','code','lastSync','4540cLqxzL','6Xiivfh','822435qhHRmN','stringify','926708ueuofz','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','\x22\x20vs\x20lock\x20\x22','5712960dxNDaG','utf8','1702351bchDvj','sqls','28206NOftGl','3728255IqSXaX','apps','4333076PsuxTo','ENOENT','sqlRoot','40mgWGUN','parse'];a253_0x4425=function(){return _0x3b8ba6;};return a253_0x4425();}export async function writeSqlLockFile(_0x140ca2,_0x21fa42){const _0x4c1108=a253_0x4811;await mkdir(dirname(_0x140ca2),{'recursive':!![]}),await writeFile(_0x140ca2,JSON[_0x4c1108(0x16a)](_0x21fa42,null,0x2),_0x4c1108(0x16f));}
1
+ (function(_0x356c39,_0x10ef38){const _0x3dbc72=a266_0x39b0,_0x12deed=_0x356c39();while(!![]){try{const _0x31e99f=-parseInt(_0x3dbc72(0xb3))/0x1*(parseInt(_0x3dbc72(0xaa))/0x2)+-parseInt(_0x3dbc72(0xad))/0x3+parseInt(_0x3dbc72(0xb0))/0x4*(-parseInt(_0x3dbc72(0xae))/0x5)+parseInt(_0x3dbc72(0xb9))/0x6*(-parseInt(_0x3dbc72(0xb2))/0x7)+-parseInt(_0x3dbc72(0xa8))/0x8*(-parseInt(_0x3dbc72(0xa9))/0x9)+-parseInt(_0x3dbc72(0xb6))/0xa*(-parseInt(_0x3dbc72(0xa7))/0xb)+parseInt(_0x3dbc72(0xac))/0xc;if(_0x31e99f===_0x10ef38)break;else _0x12deed['push'](_0x12deed['shift']());}catch(_0xe826cb){_0x12deed['push'](_0x12deed['shift']());}}}(a266_0x3f4b,0xb2025));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x174c35,_0x1404ca,_0x55661b,_0x32fb6b){const _0x38fea0=a266_0x39b0,_0x259025=_0x174c35??createEmptySqlLock();let _0x36f7f1=_0x259025[_0x38fea0(0xbb)][_0x1404ca];if(!_0x36f7f1)return _0x36f7f1={'sqlRoot':_0x55661b,'lastSync':'','sqls':{}},_0x259025['apps'][_0x1404ca]=_0x36f7f1,{'lockData':_0x259025,'appLock':_0x36f7f1};if(!_0x36f7f1[_0x38fea0(0xa5)])_0x36f7f1[_0x38fea0(0xa5)]=_0x55661b;else{if(_0x36f7f1[_0x38fea0(0xa5)]!==_0x55661b)throw new Error(_0x32fb6b+_0x38fea0(0xab)+_0x55661b+'\x22\x20vs\x20lock\x20\x22'+_0x36f7f1[_0x38fea0(0xa5)]+'\x22.\x20'+_0x38fea0(0xb1));}return!_0x36f7f1[_0x38fea0(0xb7)]&&(_0x36f7f1[_0x38fea0(0xb7)]={}),!_0x36f7f1[_0x38fea0(0xaf)]&&(_0x36f7f1[_0x38fea0(0xaf)]=''),{'lockData':_0x259025,'appLock':_0x36f7f1};}function a266_0x39b0(_0x42a7ee,_0x2e54f7){_0x42a7ee=_0x42a7ee-0xa5;const _0x3f4bdd=a266_0x3f4b();let _0x39b0fb=_0x3f4bdd[_0x42a7ee];return _0x39b0fb;}export async function readSqlLockFile(_0x11027c){const _0x55e62a=a266_0x39b0;try{const _0x1ee065=await readFile(_0x11027c,'utf8');return JSON[_0x55e62a(0xb5)](_0x1ee065);}catch(_0xef3393){if(_0xef3393['code']===_0x55e62a(0xa6))return null;throw new Error(_0x55e62a(0xb4)+String(_0xef3393));}}function a266_0x3f4b(){const _0x3968e5=['parse','10YLGfRh','sqls','utf8','3155226xoMTyF','stringify','apps','sqlRoot','ENOENT','1528461uRNYXZ','128CiVIsi','559161ijpDlA','1128812atXrnm',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','31810944BVQKvY','3014796aTQTvd','1084305ZUtYUJ','lastSync','8Nvfmdj','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','14rjEBfK','1SvDXHM','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'];a266_0x3f4b=function(){return _0x3968e5;};return a266_0x3f4b();}export async function writeSqlLockFile(_0x302139,_0x13b37b){const _0x3757c8=a266_0x39b0;await mkdir(dirname(_0x302139),{'recursive':!![]}),await writeFile(_0x302139,JSON[_0x3757c8(0xba)](_0x13b37b,null,0x2),_0x3757c8(0xb8));}