@lovrabet/rabetbase-cli 2.5.2 → 2.5.3-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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.d.ts +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.d.ts +2 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/auth/auth-server-ui.js +1 -1
  8. package/lib/auth/auth-server.js +1 -1
  9. package/lib/auth/constant.js +1 -1
  10. package/lib/auth/get-cookie.js +1 -1
  11. package/lib/auth/get-session-user.js +1 -1
  12. package/lib/auth/is-session-valid.js +1 -1
  13. package/lib/auth/login-success-html.js +1 -1
  14. package/lib/auth/logout.js +1 -1
  15. package/lib/cli-flags.js +1 -1
  16. package/lib/cli.js +1 -1
  17. package/lib/commands/api/generate.js +1 -1
  18. package/lib/commands/api/index.js +1 -1
  19. package/lib/commands/api/list.js +1 -1
  20. package/lib/commands/api/pull.js +1 -1
  21. package/lib/commands/api/shared.js +1 -1
  22. package/lib/commands/app/index.js +1 -1
  23. package/lib/commands/app/list.js +1 -1
  24. package/lib/commands/app/members-list.js +1 -1
  25. package/lib/commands/app/remote-directory.js +1 -1
  26. package/lib/commands/app/shared.js +1 -1
  27. package/lib/commands/app-config/delete.js +1 -1
  28. package/lib/commands/app-config/get.js +1 -1
  29. package/lib/commands/app-config/index.js +1 -1
  30. package/lib/commands/app-config/list.js +1 -1
  31. package/lib/commands/app-config/set.js +1 -1
  32. package/lib/commands/app-config/shared.js +1 -1
  33. package/lib/commands/auth/index.js +1 -1
  34. package/lib/commands/bff/create.js +1 -1
  35. package/lib/commands/bff/delete.js +1 -1
  36. package/lib/commands/bff/detail.js +1 -1
  37. package/lib/commands/bff/index.js +1 -1
  38. package/lib/commands/bff/list.js +1 -1
  39. package/lib/commands/bff/pull.js +1 -1
  40. package/lib/commands/bff/push.js +1 -1
  41. package/lib/commands/bff/status.js +1 -1
  42. package/lib/commands/cli-skill/index.js +1 -1
  43. package/lib/commands/cli-update.js +1 -1
  44. package/lib/commands/codegen/index.js +1 -1
  45. package/lib/commands/codegen/sdk.js +1 -1
  46. package/lib/commands/codegen/sql.js +1 -1
  47. package/lib/commands/common/app-registry.js +1 -1
  48. package/lib/commands/common/app-selector.js +1 -1
  49. package/lib/commands/common/async-task.js +1 -1
  50. package/lib/commands/common/dry-run.js +1 -1
  51. package/lib/commands/common/flags.js +1 -1
  52. package/lib/commands/common/local-file.js +1 -1
  53. package/lib/commands/common/validate.js +1 -1
  54. package/lib/commands/config/delete.js +1 -1
  55. package/lib/commands/config/get.js +1 -1
  56. package/lib/commands/config/index.js +1 -1
  57. package/lib/commands/config/init.js +1 -1
  58. package/lib/commands/config/list.js +1 -1
  59. package/lib/commands/config/set.js +1 -1
  60. package/lib/commands/config/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/business-groups.js +1 -1
  63. package/lib/commands/dataset/capability.js +1 -1
  64. package/lib/commands/dataset/delete.js +1 -1
  65. package/lib/commands/dataset/detail.js +1 -1
  66. package/lib/commands/dataset/extend-update.js +1 -1
  67. package/lib/commands/dataset/field-restore.js +1 -1
  68. package/lib/commands/dataset/field-update.js +1 -1
  69. package/lib/commands/dataset/generate.js +1 -1
  70. package/lib/commands/dataset/index.js +1 -1
  71. package/lib/commands/dataset/list.js +1 -1
  72. package/lib/commands/dataset/operations.js +1 -1
  73. package/lib/commands/dataset/relation-audit.js +1 -1
  74. package/lib/commands/dataset/relation-create.js +1 -1
  75. package/lib/commands/dataset/relation-delete.js +1 -1
  76. package/lib/commands/dataset/relation-shared.js +1 -1
  77. package/lib/commands/dataset/relation-update.js +1 -1
  78. package/lib/commands/dataset/relations.js +1 -1
  79. package/lib/commands/dataset/rename.js +1 -1
  80. package/lib/commands/dataset/restore.js +1 -1
  81. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  82. package/lib/commands/db/analysis-batching.js +1 -1
  83. package/lib/commands/db/analyze-batch-plan.js +1 -1
  84. package/lib/commands/db/analyze-cancel.js +1 -1
  85. package/lib/commands/db/analyze-start.js +1 -1
  86. package/lib/commands/db/analyze-status.js +1 -1
  87. package/lib/commands/db/create.js +1 -1
  88. package/lib/commands/db/delete.js +1 -1
  89. package/lib/commands/db/detail.js +1 -1
  90. package/lib/commands/db/diff-refresh-start.js +1 -1
  91. package/lib/commands/db/diff-refresh-status.js +1 -1
  92. package/lib/commands/db/diff.js +1 -1
  93. package/lib/commands/db/index.js +1 -1
  94. package/lib/commands/db/list.js +1 -1
  95. package/lib/commands/db/shared.js +1 -1
  96. package/lib/commands/db/table-diff-shared.js +1 -1
  97. package/lib/commands/db/tables.js +1 -1
  98. package/lib/commands/db/test.js +1 -1
  99. package/lib/commands/db/update.js +1 -1
  100. package/lib/commands/deployment/index.js +1 -1
  101. package/lib/commands/deployment/sync-all.js +1 -1
  102. package/lib/commands/deployment/sync-jobs.js +1 -1
  103. package/lib/commands/deployment/sync-status.js +1 -1
  104. package/lib/commands/doctor.js +1 -1
  105. package/lib/commands/file/index.js +1 -1
  106. package/lib/commands/instant-api-policy/current.js +1 -1
  107. package/lib/commands/instant-api-policy/index.js +1 -1
  108. package/lib/commands/instant-api-policy/init.js +1 -1
  109. package/lib/commands/instant-api-policy/publish.js +1 -1
  110. package/lib/commands/instant-api-policy/pull.js +1 -1
  111. package/lib/commands/instant-api-policy/revision.js +1 -1
  112. package/lib/commands/instant-api-policy/revisions.js +1 -1
  113. package/lib/commands/instant-api-policy/rollback.js +1 -1
  114. package/lib/commands/instant-api-policy/shared.js +1 -1
  115. package/lib/commands/instant-api-policy/validate.js +1 -1
  116. package/lib/commands/issue/index.js +1 -1
  117. package/lib/commands/issue/nudge.js +1 -1
  118. package/lib/commands/issue/report.js +1 -1
  119. package/lib/commands/issue/shared.js +1 -1
  120. package/lib/commands/kb/create.js +1 -1
  121. package/lib/commands/kb/delete.js +1 -1
  122. package/lib/commands/kb/detail.js +1 -1
  123. package/lib/commands/kb/index.js +1 -1
  124. package/lib/commands/kb/list.js +1 -1
  125. package/lib/commands/kb/search.js +1 -1
  126. package/lib/commands/kb/shared.js +1 -1
  127. package/lib/commands/kb/update.js +1 -1
  128. package/lib/commands/logs/index.js +1 -1
  129. package/lib/commands/menu/asset-update.js +1 -1
  130. package/lib/commands/menu/delete.js +1 -1
  131. package/lib/commands/menu/external-link-create.js +1 -1
  132. package/lib/commands/menu/external-link-update.js +1 -1
  133. package/lib/commands/menu/group-create.js +1 -1
  134. package/lib/commands/menu/group-update.js +1 -1
  135. package/lib/commands/menu/index.js +1 -1
  136. package/lib/commands/menu/list.js +1 -1
  137. package/lib/commands/menu/move.js +1 -1
  138. package/lib/commands/menu/regroup-start.js +1 -1
  139. package/lib/commands/menu/rename.js +1 -1
  140. package/lib/commands/menu/shared/compare-table.js +1 -1
  141. package/lib/commands/menu/shared/delete-plan.js +1 -1
  142. package/lib/commands/menu/shared/facts.js +1 -1
  143. package/lib/commands/menu/shared/index.js +1 -1
  144. package/lib/commands/menu/shared/inquirer.js +1 -1
  145. package/lib/commands/menu/shared/local-pages.js +1 -1
  146. package/lib/commands/menu/shared/logic.js +1 -1
  147. package/lib/commands/menu/shared/mutations.js +1 -1
  148. package/lib/commands/menu/shared/service.js +1 -1
  149. package/lib/commands/menu/shared/sync-core.js +1 -1
  150. package/lib/commands/menu/shared/update-core.js +1 -1
  151. package/lib/commands/menu/shared/valid-url.js +1 -1
  152. package/lib/commands/menu/sync.js +1 -1
  153. package/lib/commands/menu/visibility-update.js +1 -1
  154. package/lib/commands/notification/config-create.js +1 -1
  155. package/lib/commands/notification/config-delete.js +1 -1
  156. package/lib/commands/notification/config-list.js +1 -1
  157. package/lib/commands/notification/config-update.js +1 -1
  158. package/lib/commands/notification/index.js +1 -1
  159. package/lib/commands/notification/shared.js +1 -1
  160. package/lib/commands/ocr/index.js +1 -1
  161. package/lib/commands/page/create.js +1 -1
  162. package/lib/commands/page/custom/detail.js +1 -1
  163. package/lib/commands/page/custom/list.js +1 -1
  164. package/lib/commands/page/custom/publish.js +1 -1
  165. package/lib/commands/page/custom/shared.js +1 -1
  166. package/lib/commands/page/custom/syntax.js +1 -1
  167. package/lib/commands/page/custom/update.js +1 -1
  168. package/lib/commands/page/data-list-status.js +1 -1
  169. package/lib/commands/page/generate-start.js +1 -1
  170. package/lib/commands/page/generate-status.js +1 -1
  171. package/lib/commands/page/index.js +1 -1
  172. package/lib/commands/page/pull.js +1 -1
  173. package/lib/commands/page/push.js +1 -1
  174. package/lib/commands/page/relation-audit.js +1 -1
  175. package/lib/commands/page/restore.js +1 -1
  176. package/lib/commands/page/shared.js +1 -1
  177. package/lib/commands/page/sync.js +1 -1
  178. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  179. package/lib/commands/project/create/format-elapsed.js +1 -1
  180. package/lib/commands/project/create/main.js +1 -1
  181. package/lib/commands/project/create/materialize-project-template.js +1 -1
  182. package/lib/commands/project/create/project-name.js +1 -1
  183. package/lib/commands/project/create/project-template-archive.js +1 -1
  184. package/lib/commands/project/create/project-template-path.js +1 -1
  185. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  186. package/lib/commands/project/create/use-format-code.js +1 -1
  187. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  188. package/lib/commands/project/domain-routing-sync.js +1 -1
  189. package/lib/commands/project/index.js +1 -1
  190. package/lib/commands/project/upgrade.js +1 -1
  191. package/lib/commands/registry.js +1 -1
  192. package/lib/commands/role/delete.js +1 -1
  193. package/lib/commands/role/detail.js +1 -1
  194. package/lib/commands/role/index.js +1 -1
  195. package/lib/commands/role/list.js +1 -1
  196. package/lib/commands/role/shared.js +1 -1
  197. package/lib/commands/role/update.js +1 -1
  198. package/lib/commands/role/user-add.js +1 -1
  199. package/lib/commands/role/user-remove.js +1 -1
  200. package/lib/commands/role/user-resolve.js +1 -1
  201. package/lib/commands/rule/get.js +1 -1
  202. package/lib/commands/rule/index.js +1 -1
  203. package/lib/commands/rule/list.js +1 -1
  204. package/lib/commands/rule/set.js +1 -1
  205. package/lib/commands/rule/shared.js +1 -1
  206. package/lib/commands/run/index.js +1 -1
  207. package/lib/commands/schema.js +1 -1
  208. package/lib/commands/sql/create.js +1 -1
  209. package/lib/commands/sql/delete.js +1 -1
  210. package/lib/commands/sql/detail.js +1 -1
  211. package/lib/commands/sql/exec.js +1 -1
  212. package/lib/commands/sql/index.js +1 -1
  213. package/lib/commands/sql/list.js +1 -1
  214. package/lib/commands/sql/pull.js +1 -1
  215. package/lib/commands/sql/push.js +1 -1
  216. package/lib/commands/sql/shared.js +1 -1
  217. package/lib/commands/sql/status.js +1 -1
  218. package/lib/commands/sql/validate.js +1 -1
  219. package/lib/commands/task/index.js +1 -1
  220. package/lib/commands/task/status.js +1 -1
  221. package/lib/commands/tenant/index.js +1 -1
  222. package/lib/commands/tenant/members-list.js +1 -1
  223. package/lib/commands/tenant/shared.js +1 -1
  224. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  225. package/lib/commands/user-account/index.js +1 -1
  226. package/lib/commands/workspace/add.js +1 -1
  227. package/lib/commands/workspace/index.js +1 -1
  228. package/lib/commands/workspace/remove.js +1 -1
  229. package/lib/config/domain-config.js +1 -1
  230. package/lib/config/project-domain-routing.js +1 -1
  231. package/lib/config/region-config.d.ts +23 -0
  232. package/lib/config/region-config.js +1 -0
  233. package/lib/config/schema.d.ts +15 -0
  234. package/lib/config/schema.js +1 -1
  235. package/lib/constant/cdn.js +1 -1
  236. package/lib/constant/cli.js +1 -1
  237. package/lib/constant/defaults.js +1 -1
  238. package/lib/constant/domain.js +1 -1
  239. package/lib/constant/env.js +1 -1
  240. package/lib/constant/output.js +1 -1
  241. package/lib/constant/paths.js +1 -1
  242. package/lib/constant/region.js +1 -1
  243. package/lib/constant/risk.js +1 -1
  244. package/lib/constant/routing-profile.js +1 -1
  245. package/lib/context/app-resolver.d.ts +6 -0
  246. package/lib/context/app-resolver.js +1 -1
  247. package/lib/context/auth-resolver.js +1 -1
  248. package/lib/context/config-loader.js +1 -1
  249. package/lib/context.d.ts +13 -0
  250. package/lib/context.js +1 -1
  251. package/lib/core/alias-resolver.js +1 -1
  252. package/lib/core/api-client.d.ts +2 -0
  253. package/lib/core/api-client.js +1 -1
  254. package/lib/core/bff/config.js +1 -1
  255. package/lib/core/bff/file-system.js +1 -1
  256. package/lib/core/bff/hash.js +1 -1
  257. package/lib/core/bff/lock.js +1 -1
  258. package/lib/core/bff/utils.js +1 -1
  259. package/lib/core/db-resolver.js +1 -1
  260. package/lib/core/instant-api-policy/config.js +1 -1
  261. package/lib/core/kb-search-client.js +1 -1
  262. package/lib/core/page/file-system.js +1 -1
  263. package/lib/core/page/hash.js +1 -1
  264. package/lib/core/page/lock.js +1 -1
  265. package/lib/core/page/lr-smart-jsx.d.ts +6 -0
  266. package/lib/core/page/lr-smart-jsx.js +1 -0
  267. package/lib/core/sql-index-auditor.js +1 -1
  268. package/lib/core/sql-sync/config.js +1 -1
  269. package/lib/core/sql-sync/file-system.js +1 -1
  270. package/lib/core/sql-sync/hash.js +1 -1
  271. package/lib/core/sql-sync/lock.js +1 -1
  272. package/lib/core/sql-sync/utils.js +1 -1
  273. package/lib/core/sql-validator.js +1 -1
  274. package/lib/errors.js +1 -1
  275. package/lib/framework/build-all-flags.js +1 -1
  276. package/lib/framework/error-output.js +1 -1
  277. package/lib/framework/explicit-yes.js +1 -1
  278. package/lib/framework/flags.js +1 -1
  279. package/lib/framework/help.js +1 -1
  280. package/lib/framework/index.js +1 -1
  281. package/lib/framework/output.js +1 -1
  282. package/lib/framework/response.js +1 -1
  283. package/lib/framework/runner-alias.js +1 -1
  284. package/lib/framework/runner.js +1 -1
  285. package/lib/framework/schema-export.js +1 -1
  286. package/lib/framework/supported-flags.js +1 -1
  287. package/lib/framework/types.js +1 -1
  288. package/lib/generated/build-info.d.ts +4 -4
  289. package/lib/generated/build-info.js +1 -1
  290. package/lib/generated/official-routing.js +1 -1
  291. package/lib/generated/routing-contract.js +1 -1
  292. package/lib/help.js +1 -1
  293. package/lib/postinstall.js +1 -1
  294. package/lib/runtime/confirmation.js +1 -1
  295. package/lib/runtime/event.js +1 -1
  296. package/lib/runtime/index.js +1 -1
  297. package/lib/runtime/queue.js +1 -1
  298. package/lib/runtime/resolve.js +1 -1
  299. package/lib/skills/builtin-skill.js +1 -1
  300. package/lib/skills/main.js +1 -1
  301. package/lib/skills/npx-skills-add.js +1 -1
  302. package/lib/skills/skill-presence.js +1 -1
  303. package/lib/telemetry/cli-command-trace.js +1 -1
  304. package/lib/telemetry/cli-help-trace.js +1 -1
  305. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  306. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  307. package/lib/telemetry/send-cli-trace-log.js +1 -1
  308. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  309. package/lib/types/index.d.ts +1 -1
  310. package/lib/utils/ai_config.js +1 -1
  311. package/lib/utils/apply-jq-filter.js +1 -1
  312. package/lib/utils/cdn-config.js +1 -1
  313. package/lib/utils/check-sdk-version.js +1 -1
  314. package/lib/utils/cli-version-check.js +1 -1
  315. package/lib/utils/cli-version-policy.js +1 -1
  316. package/lib/utils/config.d.ts +2 -8
  317. package/lib/utils/config.js +1 -1
  318. package/lib/utils/entity-with-id.js +1 -1
  319. package/lib/utils/file-utils.js +1 -1
  320. package/lib/utils/guides-cdn.js +1 -1
  321. package/lib/utils/http-client.js +1 -1
  322. package/lib/utils/is-non-interactive.js +1 -1
  323. package/lib/utils/logger.js +1 -1
  324. package/lib/utils/params.js +1 -1
  325. package/lib/utils/platform.js +1 -1
  326. package/lib/utils/sleep.js +1 -1
  327. package/lib/utils/template-replacer.d.ts +2 -1
  328. package/lib/utils/template-replacer.js +1 -1
  329. package/lib/utils/update-notice.js +1 -1
  330. package/lib/utils/version.js +1 -1
  331. package/lib/utils/with-active-cookie.js +1 -1
  332. package/lib/utils/write-cli-side-channel.js +1 -1
  333. package/package.json +1 -1
  334. package/skills/rabetbase/SKILL.md +6 -5
  335. package/skills/rabetbase/guides/page-development-workflow.md +3 -0
  336. package/skills/rabetbase/guides/sdk-client-generation.md +5 -5
  337. package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +11 -3
  338. package/skills/rabetbase/references/rabetbase-api-pull.md +5 -4
  339. package/skills/rabetbase/references/rabetbase-app-list.md +3 -0
  340. package/skills/rabetbase/references/rabetbase-bff-list.md +1 -1
  341. package/skills/rabetbase/references/rabetbase-bff-pull.md +2 -0
  342. package/skills/rabetbase/references/rabetbase-bff-status.md +2 -0
  343. package/skills/rabetbase/references/rabetbase-config.md +10 -9
  344. package/skills/rabetbase/references/rabetbase-doctor.md +2 -2
  345. package/skills/rabetbase/references/rabetbase-page-push.md +5 -1
  346. package/skills/rabetbase/references/rabetbase-workspace.md +4 -2
  347. package/skills/rabetbase.manifest.json +3 -3
  348. package/templates/generate-api/client.ts.tpl +1 -1
@@ -1 +1 @@
1
- (function(_0x21924e,_0x1c793a){const _0x3c6f70=a252_0x25ae,_0x4f996b=_0x21924e();while(!![]){try{const _0x9ebfd4=parseInt(_0x3c6f70(0xa2))/0x1+-parseInt(_0x3c6f70(0xb4))/0x2*(-parseInt(_0x3c6f70(0xa6))/0x3)+-parseInt(_0x3c6f70(0xb9))/0x4+parseInt(_0x3c6f70(0xa0))/0x5+-parseInt(_0x3c6f70(0xa3))/0x6+parseInt(_0x3c6f70(0xba))/0x7+-parseInt(_0x3c6f70(0xad))/0x8;if(_0x9ebfd4===_0x1c793a)break;else _0x4f996b['push'](_0x4f996b['shift']());}catch(_0x4dd7d8){_0x4f996b['push'](_0x4f996b['shift']());}}}(a252_0x5c0a,0x2e80b));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x19b5bb){const _0x5e99b3=a252_0x25ae;if(cache[_0x5e99b3(0x9e)](_0x19b5bb))return cache[_0x5e99b3(0xab)](_0x19b5bb);const _0x1b3392=await listDatasets(_0x19b5bb),_0xcce4b5=new Map();for(const _0x18a5f8 of _0x1b3392){const _0x3017a4=_0x18a5f8[_0x5e99b3(0xb5)];_0x3017a4?.[_0x5e99b3(0xa8)]!=null&&_0xcce4b5[_0x5e99b3(0xaa)](_0x3017a4[_0x5e99b3(0xa8)],_0x3017a4[_0x5e99b3(0xb7)]??'db-'+_0x3017a4[_0x5e99b3(0xa8)]);}const _0xa7c4ab=[..._0xcce4b5[_0x5e99b3(0xb1)]()]['map'](([_0x1244b4,_0x4cdc18])=>({'dbId':_0x1244b4,'dbName':_0x4cdc18}));return cache[_0x5e99b3(0xaa)](_0x19b5bb,_0xa7c4ab),_0xa7c4ab;}function a252_0x25ae(_0x157f87,_0x56fdbf){_0x157f87=_0x157f87-0x9e;const _0x5c0af1=a252_0x5c0a();let _0x25aef1=_0x5c0af1[_0x157f87];return _0x25aef1;}export async function resolveDb(_0x35b4ed,_0xf91bf1){const _0x31fe1d=a252_0x25ae,_0x596693=await listDatabases(_0x35b4ed);if(_0x596693[_0x31fe1d(0xa4)]===0x0)return{'resolved':[],'error':_0x31fe1d(0xb3)+_0x35b4ed+_0x31fe1d(0xa9)};if(!_0xf91bf1)return{'resolved':_0x596693};const _0x231d15=Number(_0xf91bf1);if(!Number[_0x31fe1d(0xaf)](_0x231d15)){const _0x28f2bb=_0x596693['find'](_0x281d6a=>_0x281d6a[_0x31fe1d(0xa8)]===_0x231d15);if(_0x28f2bb)return{'resolved':[_0x28f2bb]};}const _0x1ba19c=_0xf91bf1[_0x31fe1d(0xb0)](),_0x54ffda=_0x596693['filter'](_0x3e1c2a=>_0x3e1c2a['dbName'][_0x31fe1d(0xb0)]()['includes'](_0x1ba19c));if(_0x54ffda[_0x31fe1d(0xa4)]>0x0)return{'resolved':_0x54ffda};const _0x2011f0=_0x596693[_0x31fe1d(0xac)](_0x1e170e=>_0x1e170e[_0x31fe1d(0xb7)]+'\x20('+_0x1e170e[_0x31fe1d(0xa8)]+')')[_0x31fe1d(0x9f)](',\x20');return{'resolved':[],'error':_0x31fe1d(0xb2)+_0xf91bf1+_0x31fe1d(0xb8)+_0x35b4ed+_0x31fe1d(0xb6)+_0x2011f0+_0x31fe1d(0xa5)};}export async function resolveOneDb(_0x13161f,_0x2c0df0){const _0xd0161f=a252_0x25ae,{resolved:_0xa7d0ee,error:_0x49db51}=await resolveDb(_0x13161f,_0x2c0df0);if(_0x49db51)return{'db':null,'error':_0x49db51};if(_0xa7d0ee['length']===0x1)return{'db':_0xa7d0ee[0x0]};if(!_0x2c0df0){const _0xf100c3=_0xa7d0ee[_0xd0161f(0xac)](_0x17d04d=>_0x17d04d[_0xd0161f(0xb7)]+'\x20('+_0x17d04d[_0xd0161f(0xa8)]+')')['join'](',\x20');return{'db':null,'error':_0xd0161f(0xa1)+_0xf100c3};}const _0xa5b385=_0xa7d0ee[_0xd0161f(0xac)](_0x37bd23=>_0x37bd23[_0xd0161f(0xb7)]+'\x20('+_0x37bd23[_0xd0161f(0xa8)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x2c0df0+_0xd0161f(0xae)+_0xa5b385+'.\x20Be\x20more\x20specific.'};}function a252_0x5c0a(){const _0x2e6ac0=['Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','81501XQhRZP','655416FsPpdq','length','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','23463ufmTYN','find','dbId','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','set','get','map','3519064TmUmyH','\x22\x20matches\x20multiple\x20databases:\x20','isNaN','toLowerCase','entries','No\x20database\x20matching\x20\x22','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','58zNtRYe','dbtableConfig','\x22.\x20Available:\x20','dbName','\x22\x20under\x20app\x20\x22','710788qgviVx','2409190hfHtkA','has','join','1324055DKoxTG'];a252_0x5c0a=function(){return _0x2e6ac0;};return a252_0x5c0a();}export async function getDbName(_0x3651ae,_0x2d10ac){const _0x369d4c=a252_0x25ae,_0xe2c362=await listDatabases(_0x3651ae);return _0xe2c362[_0x369d4c(0xa7)](_0x3b32c4=>_0x3b32c4[_0x369d4c(0xa8)]===_0x2d10ac)?.[_0x369d4c(0xb7)];}
1
+ (function(_0x2c6b2d,_0x3f6f30){const _0x45926e=a253_0x3bcd,_0x348294=_0x2c6b2d();while(!![]){try{const _0x1f6567=parseInt(_0x45926e(0x12f))/0x1*(parseInt(_0x45926e(0x11b))/0x2)+parseInt(_0x45926e(0x131))/0x3*(-parseInt(_0x45926e(0x13b))/0x4)+-parseInt(_0x45926e(0x127))/0x5*(parseInt(_0x45926e(0x12b))/0x6)+parseInt(_0x45926e(0x123))/0x7*(parseInt(_0x45926e(0x11c))/0x8)+-parseInt(_0x45926e(0x126))/0x9+-parseInt(_0x45926e(0x122))/0xa+parseInt(_0x45926e(0x135))/0xb;if(_0x1f6567===_0x3f6f30)break;else _0x348294['push'](_0x348294['shift']());}catch(_0x412d16){_0x348294['push'](_0x348294['shift']());}}}(a253_0x18b5,0x8511f));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x20901b){const _0x3290ef=a253_0x3bcd;if(cache[_0x3290ef(0x124)](_0x20901b))return cache['get'](_0x20901b);const _0x3e70ac=await listDatasets(_0x20901b),_0x49d175=new Map();for(const _0xfb78f5 of _0x3e70ac){const _0x338318=_0xfb78f5[_0x3290ef(0x13a)];_0x338318?.[_0x3290ef(0x136)]!=null&&_0x49d175[_0x3290ef(0x130)](_0x338318[_0x3290ef(0x136)],_0x338318[_0x3290ef(0x128)]??_0x3290ef(0x121)+_0x338318['dbId']);}const _0x4cacbb=[..._0x49d175[_0x3290ef(0x120)]()][_0x3290ef(0x11d)](([_0x38cd71,_0x1a1808])=>({'dbId':_0x38cd71,'dbName':_0x1a1808}));return cache[_0x3290ef(0x130)](_0x20901b,_0x4cacbb),_0x4cacbb;}export async function resolveDb(_0x1d8429,_0xb5438f){const _0x4218d0=a253_0x3bcd,_0x1c1a44=await listDatabases(_0x1d8429);if(_0x1c1a44['length']===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20under\x20app\x20\x22'+_0x1d8429+_0x4218d0(0x11f)};if(!_0xb5438f)return{'resolved':_0x1c1a44};const _0x6556f4=Number(_0xb5438f);if(!Number[_0x4218d0(0x12e)](_0x6556f4)){const _0x3f35df=_0x1c1a44[_0x4218d0(0x137)](_0xbba03a=>_0xbba03a[_0x4218d0(0x136)]===_0x6556f4);if(_0x3f35df)return{'resolved':[_0x3f35df]};}const _0x536340=_0xb5438f[_0x4218d0(0x125)](),_0x38ab91=_0x1c1a44[_0x4218d0(0x134)](_0x4ab77d=>_0x4ab77d[_0x4218d0(0x128)][_0x4218d0(0x125)]()[_0x4218d0(0x139)](_0x536340));if(_0x38ab91['length']>0x0)return{'resolved':_0x38ab91};const _0x12493f=_0x1c1a44[_0x4218d0(0x11d)](_0x55c707=>_0x55c707[_0x4218d0(0x128)]+'\x20('+_0x55c707[_0x4218d0(0x136)]+')')[_0x4218d0(0x11e)](',\x20');return{'resolved':[],'error':_0x4218d0(0x12d)+_0xb5438f+_0x4218d0(0x133)+_0x1d8429+_0x4218d0(0x129)+_0x12493f+_0x4218d0(0x132)};}function a253_0x3bcd(_0x2cdab7,_0x4f3c0b){_0x2cdab7=_0x2cdab7-0x11b;const _0x18b5e3=a253_0x18b5();let _0x3bcd82=_0x18b5e3[_0x2cdab7];return _0x3bcd82;}function a253_0x18b5(){const _0x3fa6af=['543TqWOHT','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','\x22\x20under\x20app\x20\x22','filter','24832929VLUfdV','dbId','find','length','includes','dbtableConfig','23516PFXqeR','2996sMicnX','8AsOelF','map','join','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','entries','db-','6491890TEdfmd','3217438NULxpG','has','toLowerCase','8203140KcJcYq','60QrPQlv','dbName','\x22.\x20Available:\x20','\x22\x20matches\x20multiple\x20databases:\x20','15612ApIOjd','.\x20Be\x20more\x20specific.','No\x20database\x20matching\x20\x22','isNaN','323NvoFhL','set'];a253_0x18b5=function(){return _0x3fa6af;};return a253_0x18b5();}export async function resolveOneDb(_0x487275,_0x365c10){const _0xdab84e=a253_0x3bcd,{resolved:_0x24f0d3,error:_0x3ec64b}=await resolveDb(_0x487275,_0x365c10);if(_0x3ec64b)return{'db':null,'error':_0x3ec64b};if(_0x24f0d3[_0xdab84e(0x138)]===0x1)return{'db':_0x24f0d3[0x0]};if(!_0x365c10){const _0x4b98bf=_0x24f0d3[_0xdab84e(0x11d)](_0x4c0141=>_0x4c0141[_0xdab84e(0x128)]+'\x20('+_0x4c0141[_0xdab84e(0x136)]+')')[_0xdab84e(0x11e)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x4b98bf};}const _0x5edf78=_0x24f0d3[_0xdab84e(0x11d)](_0x36758e=>_0x36758e[_0xdab84e(0x128)]+'\x20('+_0x36758e[_0xdab84e(0x136)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x365c10+_0xdab84e(0x12a)+_0x5edf78+_0xdab84e(0x12c)};}export async function getDbName(_0x363965,_0x4367f2){const _0x403d2d=a253_0x3bcd,_0x11b9cb=await listDatabases(_0x363965);return _0x11b9cb[_0x403d2d(0x137)](_0x432125=>_0x432125[_0x403d2d(0x136)]===_0x4367f2)?.[_0x403d2d(0x128)];}
@@ -1 +1 @@
1
- const a253_0x5d8649=a253_0x4dc7;(function(_0xac65d1,_0x34bce3){const _0x2a2ac9=a253_0x4dc7,_0xc16f7e=_0xac65d1();while(!![]){try{const _0x391d67=parseInt(_0x2a2ac9(0x13e))/0x1*(-parseInt(_0x2a2ac9(0x137))/0x2)+parseInt(_0x2a2ac9(0x11b))/0x3*(parseInt(_0x2a2ac9(0x130))/0x4)+-parseInt(_0x2a2ac9(0x11e))/0x5+-parseInt(_0x2a2ac9(0x139))/0x6+parseInt(_0x2a2ac9(0x14d))/0x7*(-parseInt(_0x2a2ac9(0x13a))/0x8)+parseInt(_0x2a2ac9(0x138))/0x9*(parseInt(_0x2a2ac9(0x133))/0xa)+parseInt(_0x2a2ac9(0x12e))/0xb*(parseInt(_0x2a2ac9(0x123))/0xc);if(_0x391d67===_0x34bce3)break;else _0xc16f7e['push'](_0xc16f7e['shift']());}catch(_0x20cf9e){_0xc16f7e['push'](_0xc16f7e['shift']());}}}(a253_0x17ab,0x3870b));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';function a253_0x4dc7(_0x4a5a39,_0x39a26d){_0x4a5a39=_0x4a5a39-0x117;const _0x17aba6=a253_0x17ab();let _0x4dc795=_0x17aba6[_0x4a5a39];return _0x4dc795;}import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT=a253_0x5d8649(0x153);export const INSTANT_API_POLICY_FILE_NAME='policy.json';export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x3dbd02,_0x4be922,_0x3500bc){return new CliError(_0x3dbd02,0x1,_0x4be922,_0x3500bc);}export function loadInstantApiPolicyLocalConfig(_0x1ce84d,_0x31e2e8){assertSafeAppCode(_0x1ce84d);const _0x3baf8a=resolve(_0x31e2e8??findProjectRootDirectory()),_0x43b301=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x1ce84d+'/'+INSTANT_API_POLICY_FILE_NAME,_0x56e430=resolve(_0x3baf8a,INSTANT_API_POLICY_RELATIVE_ROOT,_0x1ce84d),_0x1d6c2d=resolve(_0x56e430,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x3baf8a,'appCode':_0x1ce84d,'policyRoot':_0x56e430,'policyFilePath':_0x1d6c2d,'policyRelativePath':_0x43b301};}export function createDefaultInstantApiPolicyConfig(_0x499f49,_0x1ce112=a253_0x5d8649(0x11a)){return assertSafeAppCode(_0x499f49),{'version':'1','appCode':_0x499f49,'defaults':{'instantApi':_0x1ce112},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x438dd7){const _0x1aac65=a253_0x5d8649;let _0x905cc5;try{_0x905cc5=await stat(_0x438dd7[_0x1aac65(0x140)]);}catch(_0xe335b3){throw instantApiPolicyError(_0x1aac65(0x11c),_0x1aac65(0x14a)+_0x438dd7[_0x1aac65(0x140)],_0x1aac65(0x12d));}if(!_0x905cc5[_0x1aac65(0x136)]())throw instantApiPolicyError('instant_api_policy_file_invalid',_0x1aac65(0x128)+_0x438dd7[_0x1aac65(0x140)]);if(_0x905cc5[_0x1aac65(0x117)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x1aac65(0x132),_0x1aac65(0x121));let _0xfa3123;try{_0xfa3123=await readFile(_0x438dd7[_0x1aac65(0x140)]);}catch{throw instantApiPolicyError(_0x1aac65(0x146),'Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20'+_0x438dd7['policyFilePath']);}if(_0xfa3123[_0x1aac65(0x122)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x1aac65(0x132),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');let _0x4c514a;try{_0x4c514a=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x1aac65(0x150)](_0xfa3123);}catch{throw instantApiPolicyError('instant_api_policy_file_invalid',_0x1aac65(0x12b)+_0x438dd7[_0x1aac65(0x140)]);}let _0x16de38;try{_0x16de38=JSON[_0x1aac65(0x12c)](_0x4c514a);}catch{throw instantApiPolicyError('instant_api_policy_json_invalid','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20'+_0x438dd7[_0x1aac65(0x140)]);}return assertLocalPolicyContract(_0x16de38,_0x438dd7[_0x1aac65(0x120)]);}export async function writeInstantApiPolicyConfigFile(_0x1b0070,_0xf639e8,_0x1350c0={}){const _0x53ce02=a253_0x5d8649,_0x180dbe=assertLocalPolicyContract(_0xf639e8,_0x1b0070['appCode']),_0x278126=JSON['stringify'](_0x180dbe,null,0x2)+'\x0a';if(Buffer['byteLength'](_0x278126,_0x53ce02(0x154))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x53ce02(0x132),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');await mkdir(_0x1b0070['policyRoot'],{'recursive':!![]});let _0x5ab5bc;try{_0x5ab5bc=await readFile(_0x1b0070[_0x53ce02(0x140)],_0x53ce02(0x154));}catch(_0x1fce60){if(!isMissingFile(_0x1fce60))throw instantApiPolicyError(_0x53ce02(0x146),'Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20'+_0x1b0070[_0x53ce02(0x140)]);}if(_0x5ab5bc===_0x278126)return{'action':'unchanged','filePath':_0x1b0070[_0x53ce02(0x140)]};if(_0x5ab5bc!==undefined&&!_0x1350c0[_0x53ce02(0x12a)])throw instantApiPolicyError('instant_api_policy_file_exists',_0x53ce02(0x11f)+_0x1b0070[_0x53ce02(0x140)],'Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.');if(_0x5ab5bc===undefined)try{return await writeFile(_0x1b0070[_0x53ce02(0x140)],_0x278126,{'encoding':_0x53ce02(0x154),'flag':'wx'}),{'action':_0x53ce02(0x14c),'filePath':_0x1b0070[_0x53ce02(0x140)]};}catch(_0xc5f1d3){if(!isAlreadyExists(_0xc5f1d3))throw instantApiPolicyError('instant_api_policy_file_unwritable',_0x53ce02(0x13b)+_0x1b0070[_0x53ce02(0x140)]);if(!_0x1350c0[_0x53ce02(0x12a)])throw instantApiPolicyError('instant_api_policy_file_exists',_0x53ce02(0x131)+_0x1b0070['policyFilePath'],_0x53ce02(0x129));}const _0x3f41d=resolve(dirname(_0x1b0070[_0x53ce02(0x140)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process['pid']+'.'+randomUUID()+_0x53ce02(0x134));try{await writeFile(_0x3f41d,_0x278126,{'encoding':'utf8','flag':'wx'}),await rename(_0x3f41d,_0x1b0070['policyFilePath']);}catch{await unlink(_0x3f41d)[_0x53ce02(0x135)](()=>undefined);throw instantApiPolicyError(_0x53ce02(0x149),_0x53ce02(0x151)+_0x1b0070['policyFilePath']);}return{'action':'overwritten','filePath':_0x1b0070['policyFilePath']};}function assertSafeAppCode(_0x40e103){const _0x14a54d=a253_0x5d8649,_0x108f53=_0x40e103['trim']();if(!_0x108f53||_0x108f53!==_0x40e103||_0x108f53[_0x14a54d(0x11d)]>0x64||_0x108f53==='.'||_0x108f53==='..'||_0x108f53[_0x14a54d(0x127)]('/')||_0x108f53[_0x14a54d(0x127)]('\x5c')||_0x108f53['includes']('\x00'))throw instantApiPolicyError(_0x14a54d(0x119),_0x14a54d(0x143));}function a253_0x17ab(){const _0x1d8377=['4124373BXNWqx','instant_api_policy_rules_invalid','1604aFIkqu','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','instant_api_policy_file_too_large','3160370ugJUil','.tmp','catch','isFile','4456WHQhJY','9rKihPe','1196928zzLQFB','8IvtwMv','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','code','1akipYa','rules','policyFilePath','Policy\x20defaults.instantApi\x20is\x20required.','instant_api_policy_app_code_mismatch','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','isArray','instant_api_policy_defaults_invalid','instant_api_policy_file_unreadable','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','instant_api_policy_json_invalid','instant_api_policy_file_unwritable','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','created','2352119YKpxlp','ENOENT','object','decode','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22.','.rabetbase/instant-api-policy','utf8','size','string','instant_api_policy_app_code_invalid','allow','1983qQrqSz','instant_api_policy_file_missing','length','935645LZpCWa','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','appCode','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','byteLength','12gRSFFt','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','instant_api_policy_version_invalid','defaults','includes','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','Review\x20the\x20file\x20before\x20retrying.','force','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','parse','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.'];a253_0x17ab=function(){return _0x1d8377;};return a253_0x17ab();}function assertLocalPolicyContract(_0x201b4a,_0x4e09ee){const _0x493c35=a253_0x5d8649;if(!isObject(_0x201b4a))throw instantApiPolicyError(_0x493c35(0x148),_0x493c35(0x147));if(_0x201b4a['version']!=='1')throw instantApiPolicyError(_0x493c35(0x125),_0x493c35(0x152),_0x493c35(0x13c));if(_0x201b4a[_0x493c35(0x120)]!==_0x4e09ee)throw instantApiPolicyError(_0x493c35(0x142),_0x493c35(0x124)+_0x4e09ee+'.');if(!isObject(_0x201b4a[_0x493c35(0x126)])||typeof _0x201b4a['defaults']['instantApi']!==_0x493c35(0x118))throw instantApiPolicyError(_0x493c35(0x145),_0x493c35(0x141));if(_0x201b4a[_0x493c35(0x13f)]!==undefined&&_0x201b4a[_0x493c35(0x13f)]!==null&&!Array[_0x493c35(0x144)](_0x201b4a[_0x493c35(0x13f)]))throw instantApiPolicyError(_0x493c35(0x12f),_0x493c35(0x14b));return _0x201b4a;}function isObject(_0x3aa192){const _0x689611=a253_0x5d8649;return _0x3aa192!==null&&typeof _0x3aa192===_0x689611(0x14f)&&!Array['isArray'](_0x3aa192);}function isMissingFile(_0x4ec301){const _0x1e4300=a253_0x5d8649;return Boolean(_0x4ec301&&typeof _0x4ec301===_0x1e4300(0x14f)&&_0x4ec301[_0x1e4300(0x13d)]===_0x1e4300(0x14e));}function isAlreadyExists(_0xfdff4){const _0x3e341f=a253_0x5d8649;return Boolean(_0xfdff4&&typeof _0xfdff4===_0x3e341f(0x14f)&&_0xfdff4['code']==='EEXIST');}
1
+ const a254_0x5b85ae=a254_0x1120;(function(_0x3c5483,_0x14be46){const _0x1e44b0=a254_0x1120,_0x2d7204=_0x3c5483();while(!![]){try{const _0x2c380c=parseInt(_0x1e44b0(0x1bb))/0x1*(-parseInt(_0x1e44b0(0x1de))/0x2)+-parseInt(_0x1e44b0(0x19f))/0x3+-parseInt(_0x1e44b0(0x1c1))/0x4+-parseInt(_0x1e44b0(0x1d7))/0x5+parseInt(_0x1e44b0(0x1ad))/0x6+-parseInt(_0x1e44b0(0x1cf))/0x7+-parseInt(_0x1e44b0(0x1c0))/0x8*(-parseInt(_0x1e44b0(0x1db))/0x9);if(_0x2c380c===_0x14be46)break;else _0x2d7204['push'](_0x2d7204['shift']());}catch(_0x3d5598){_0x2d7204['push'](_0x2d7204['shift']());}}}(a254_0x1473,0xf20e6));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=a254_0x5b85ae(0x1ce);export const INSTANT_API_POLICY_FILE_NAME=a254_0x5b85ae(0x1d5);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x24d3cb,_0x2226b5,_0x381ea6){return new CliError(_0x24d3cb,0x1,_0x2226b5,_0x381ea6);}export function loadInstantApiPolicyLocalConfig(_0x267704,_0x239797){assertSafeAppCode(_0x267704);const _0x429125=resolve(_0x239797??findProjectRootDirectory()),_0x28b86d=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x267704+'/'+INSTANT_API_POLICY_FILE_NAME,_0x4afd3f=resolve(_0x429125,INSTANT_API_POLICY_RELATIVE_ROOT,_0x267704),_0x4cab04=resolve(_0x4afd3f,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x429125,'appCode':_0x267704,'policyRoot':_0x4afd3f,'policyFilePath':_0x4cab04,'policyRelativePath':_0x28b86d};}export function createDefaultInstantApiPolicyConfig(_0x3bcd29,_0x456243='allow'){return assertSafeAppCode(_0x3bcd29),{'version':'1','appCode':_0x3bcd29,'defaults':{'instantApi':_0x456243},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x572ee6){const _0x2e2e29=a254_0x5b85ae;let _0x381b1e;try{_0x381b1e=await stat(_0x572ee6['policyFilePath']);}catch(_0xa47215){throw instantApiPolicyError(_0x2e2e29(0x1b5),_0x2e2e29(0x1cd)+_0x572ee6[_0x2e2e29(0x1b9)],_0x2e2e29(0x1b2));}if(!_0x381b1e[_0x2e2e29(0x1c5)]())throw instantApiPolicyError(_0x2e2e29(0x19e),_0x2e2e29(0x1a0)+_0x572ee6['policyFilePath']);if(_0x381b1e[_0x2e2e29(0x1ab)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x2e2e29(0x1a1),_0x2e2e29(0x1b4));let _0x49988f;try{_0x49988f=await readFile(_0x572ee6[_0x2e2e29(0x1b9)]);}catch{throw instantApiPolicyError('instant_api_policy_file_unreadable','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20'+_0x572ee6[_0x2e2e29(0x1b9)]);}if(_0x49988f[_0x2e2e29(0x1b8)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x2e2e29(0x1b4));let _0x3a798f;try{_0x3a798f=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x2e2e29(0x1d4)](_0x49988f);}catch{throw instantApiPolicyError('instant_api_policy_file_invalid',_0x2e2e29(0x1ac)+_0x572ee6['policyFilePath']);}let _0x2adddd;try{_0x2adddd=JSON[_0x2e2e29(0x1b6)](_0x3a798f);}catch{throw instantApiPolicyError(_0x2e2e29(0x1c2),'Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20'+_0x572ee6[_0x2e2e29(0x1b9)]);}return assertLocalPolicyContract(_0x2adddd,_0x572ee6[_0x2e2e29(0x1d8)]);}function a254_0x1120(_0x48a1af,_0x19d38a){_0x48a1af=_0x48a1af-0x19e;const _0x147323=a254_0x1473();let _0x112004=_0x147323[_0x48a1af];return _0x112004;}export async function writeInstantApiPolicyConfigFile(_0x54ce82,_0x55b4fa,_0x502dfb={}){const _0x5d684b=a254_0x5b85ae,_0x2938e6=assertLocalPolicyContract(_0x55b4fa,_0x54ce82[_0x5d684b(0x1d8)]),_0x343d7c=JSON['stringify'](_0x2938e6,null,0x2)+'\x0a';if(Buffer['byteLength'](_0x343d7c,_0x5d684b(0x1dc))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x5d684b(0x1b4));await mkdir(_0x54ce82[_0x5d684b(0x1a6)],{'recursive':!![]});let _0x57dd79;try{_0x57dd79=await readFile(_0x54ce82[_0x5d684b(0x1b9)],_0x5d684b(0x1dc));}catch(_0x12aaa1){if(!isMissingFile(_0x12aaa1))throw instantApiPolicyError(_0x5d684b(0x1cb),_0x5d684b(0x1a8)+_0x54ce82[_0x5d684b(0x1b9)]);}if(_0x57dd79===_0x343d7c)return{'action':_0x5d684b(0x1a2),'filePath':_0x54ce82[_0x5d684b(0x1b9)]};if(_0x57dd79!==undefined&&!_0x502dfb['force'])throw instantApiPolicyError('instant_api_policy_file_exists',_0x5d684b(0x1bf)+_0x54ce82['policyFilePath'],_0x5d684b(0x1cc));if(_0x57dd79===undefined)try{return await writeFile(_0x54ce82[_0x5d684b(0x1b9)],_0x343d7c,{'encoding':_0x5d684b(0x1dc),'flag':'wx'}),{'action':_0x5d684b(0x1c8),'filePath':_0x54ce82[_0x5d684b(0x1b9)]};}catch(_0x549a53){if(!isAlreadyExists(_0x549a53))throw instantApiPolicyError('instant_api_policy_file_unwritable','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20'+_0x54ce82['policyFilePath']);if(!_0x502dfb[_0x5d684b(0x1ae)])throw instantApiPolicyError(_0x5d684b(0x1c6),_0x5d684b(0x1d9)+_0x54ce82[_0x5d684b(0x1b9)],_0x5d684b(0x1b1));}const _0x58efa2=resolve(dirname(_0x54ce82[_0x5d684b(0x1b9)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x5d684b(0x1c9)]+'.'+randomUUID()+_0x5d684b(0x1a3));try{await writeFile(_0x58efa2,_0x343d7c,{'encoding':_0x5d684b(0x1dc),'flag':'wx'}),await rename(_0x58efa2,_0x54ce82[_0x5d684b(0x1b9)]);}catch{await unlink(_0x58efa2)[_0x5d684b(0x1d1)](()=>undefined);throw instantApiPolicyError(_0x5d684b(0x1d0),_0x5d684b(0x1a7)+_0x54ce82[_0x5d684b(0x1b9)]);}return{'action':_0x5d684b(0x1b0),'filePath':_0x54ce82[_0x5d684b(0x1b9)]};}function assertSafeAppCode(_0x5ba928){const _0x58047a=a254_0x5b85ae,_0x1539a6=_0x5ba928[_0x58047a(0x1b3)]();if(!_0x1539a6||_0x1539a6!==_0x5ba928||_0x1539a6['length']>0x64||_0x1539a6==='.'||_0x1539a6==='..'||_0x1539a6[_0x58047a(0x1b7)]('/')||_0x1539a6[_0x58047a(0x1b7)]('\x5c')||_0x1539a6[_0x58047a(0x1b7)]('\x00'))throw instantApiPolicyError(_0x58047a(0x1dd),'appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.');}function a254_0x1473(){const _0x4ba127=['instant_api_policy_file_too_large','unchanged','.tmp','Policy\x20defaults.instantApi\x20is\x20required.','instant_api_policy_version_invalid','policyRoot','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','instantApi','code','size','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','7695558UAPFux','force','defaults','overwritten','Review\x20the\x20file\x20before\x20retrying.','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','trim','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','instant_api_policy_file_missing','parse','includes','byteLength','policyFilePath','instant_api_policy_rules_invalid','6150ZVSRic','rules','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','instant_api_policy_defaults_invalid','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','5448uvHcSp','6846804mIGFTC','instant_api_policy_json_invalid','isArray','string','isFile','instant_api_policy_file_exists','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','created','pid','object','instant_api_policy_file_unreadable','Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','.rabetbase/instant-api-policy','10657983fPBOmc','instant_api_policy_file_unwritable','catch','version','ENOENT','decode','policy.json','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22.','3773165SeCJNM','appCode','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','73323aSRoMD','utf8','instant_api_policy_app_code_invalid','486LMbepI','instant_api_policy_file_invalid','1067655ujcrvS','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'];a254_0x1473=function(){return _0x4ba127;};return a254_0x1473();}function assertLocalPolicyContract(_0x263db8,_0x4c5f65){const _0x1abc3b=a254_0x5b85ae;if(!isObject(_0x263db8))throw instantApiPolicyError(_0x1abc3b(0x1c2),_0x1abc3b(0x1da));if(_0x263db8[_0x1abc3b(0x1d2)]!=='1')throw instantApiPolicyError(_0x1abc3b(0x1a5),_0x1abc3b(0x1d6),_0x1abc3b(0x1bd));if(_0x263db8[_0x1abc3b(0x1d8)]!==_0x4c5f65)throw instantApiPolicyError('instant_api_policy_app_code_mismatch',_0x1abc3b(0x1c7)+_0x4c5f65+'.');if(!isObject(_0x263db8[_0x1abc3b(0x1af)])||typeof _0x263db8[_0x1abc3b(0x1af)][_0x1abc3b(0x1a9)]!==_0x1abc3b(0x1c4))throw instantApiPolicyError(_0x1abc3b(0x1be),_0x1abc3b(0x1a4));if(_0x263db8[_0x1abc3b(0x1bc)]!==undefined&&_0x263db8[_0x1abc3b(0x1bc)]!==null&&!Array['isArray'](_0x263db8[_0x1abc3b(0x1bc)]))throw instantApiPolicyError(_0x1abc3b(0x1ba),'Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.');return _0x263db8;}function isObject(_0x366dbe){const _0x1c91e3=a254_0x5b85ae;return _0x366dbe!==null&&typeof _0x366dbe==='object'&&!Array[_0x1c91e3(0x1c3)](_0x366dbe);}function isMissingFile(_0x9afe74){const _0x6d7aea=a254_0x5b85ae;return Boolean(_0x9afe74&&typeof _0x9afe74===_0x6d7aea(0x1ca)&&_0x9afe74[_0x6d7aea(0x1aa)]===_0x6d7aea(0x1d3));}function isAlreadyExists(_0xaaee9e){const _0x3227b2=a254_0x5b85ae;return Boolean(_0xaaee9e&&typeof _0xaaee9e===_0x3227b2(0x1ca)&&_0xaaee9e[_0x3227b2(0x1aa)]==='EEXIST');}
@@ -1 +1 @@
1
- function a254_0xb1c3(_0x5d51ab,_0x26c5b){_0x5d51ab=_0x5d51ab-0xa6;const _0xeb923d=a254_0xeb92();let _0xb1c34e=_0xeb923d[_0x5d51ab];return _0xb1c34e;}const a254_0x5eb1fd=a254_0xb1c3;(function(_0x5e4b24,_0x2d942c){const _0x3214e9=a254_0xb1c3,_0x34b017=_0x5e4b24();while(!![]){try{const _0x292764=-parseInt(_0x3214e9(0xed))/0x1+-parseInt(_0x3214e9(0xec))/0x2+parseInt(_0x3214e9(0xc2))/0x3+parseInt(_0x3214e9(0xa8))/0x4+-parseInt(_0x3214e9(0xbe))/0x5*(-parseInt(_0x3214e9(0xb2))/0x6)+-parseInt(_0x3214e9(0xb6))/0x7+parseInt(_0x3214e9(0xcc))/0x8;if(_0x292764===_0x2d942c)break;else _0x34b017['push'](_0x34b017['shift']());}catch(_0x3942d8){_0x34b017['push'](_0x34b017['shift']());}}}(a254_0xeb92,0x54fa7));import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=['schemaVersion',a254_0x5eb1fd(0xd9),'total',a254_0x5eb1fd(0xb4),a254_0x5eb1fd(0xd0),a254_0x5eb1fd(0xe6)],HIT_KEYS=['documentId',a254_0x5eb1fd(0xb7),a254_0x5eb1fd(0xc7),'scope',a254_0x5eb1fd(0xea),a254_0x5eb1fd(0xb1),a254_0x5eb1fd(0xaf),a254_0x5eb1fd(0xeb),a254_0x5eb1fd(0xe0),a254_0x5eb1fd(0xe3),'scoreKind'];export async function searchDevelopmentKnowledge(_0x340976){const _0x9b25e0=a254_0x5eb1fd,_0x1b69f6=_0x340976[_0x9b25e0(0xba)][_0x9b25e0(0xde)](),_0xf8e602=_0x340976[_0x9b25e0(0xda)][_0x9b25e0(0xde)]();if(!_0x1b69f6)throw CliErrors[_0x9b25e0(0xc3)](_0x9b25e0(0xe4));if(!_0x340976[_0x9b25e0(0xc9)]['trim']())throw CliErrors[_0x9b25e0(0xa9)]();if(!_0xf8e602)throw CliErrors[_0x9b25e0(0xc3)]('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0x340976[_0x9b25e0(0xaa)]);const _0x596c20=getKbDomain()+_0x9b25e0(0xd3);let _0x52deb9;try{_0x52deb9=await fetch(_0x596c20,{'method':_0x9b25e0(0xe1),'headers':{'Content-Type':_0x9b25e0(0xe2),'Cookie':_0x340976['cookie'],'X-Invoke-Source':_0x9b25e0(0xd1)},'body':JSON[_0x9b25e0(0xad)]({'appCode':_0x1b69f6,'query':_0xf8e602,..._0x340976[_0x9b25e0(0xaa)]!==undefined?{'topK':_0x340976[_0x9b25e0(0xaa)]}:{}}),'signal':_0x340976['signal']});}catch(_0x3a34c9){if(_0x3a34c9 instanceof CliError)throw _0x3a34c9;if(_0x3a34c9 instanceof Error&&_0x3a34c9[_0x9b25e0(0xb9)]===_0x9b25e0(0xe8))throw _0x3a34c9;throw CliErrors['networkError'](_0x9b25e0(0xce));}if(!hasNoStore(_0x52deb9[_0x9b25e0(0xf0)]))throw CliErrors[_0x9b25e0(0xe7)](_0x9b25e0(0xef));if(_0x52deb9[_0x9b25e0(0xb0)]===0x191)throw CliErrors[_0x9b25e0(0xa9)]();if(!_0x52deb9['ok'])throw CliErrors[_0x9b25e0(0xe7)](_0x9b25e0(0xe5)+_0x52deb9[_0x9b25e0(0xb0)]+').');if(!(_0x52deb9[_0x9b25e0(0xf0)][_0x9b25e0(0xcb)]('content-type')??'')['toLowerCase']()[_0x9b25e0(0xcd)](_0x9b25e0(0xe2)))throw CliErrors[_0x9b25e0(0xe7)](_0x9b25e0(0xb8));let _0x1888a6;try{_0x1888a6=await _0x52deb9[_0x9b25e0(0xe9)]();}catch{throw CliErrors['apiError'](_0x9b25e0(0xae));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x1888a6),_0x340976[_0x9b25e0(0xaa)]);}function readEnvelopeData(_0x7bbaea){const _0x1143f6=a254_0x5eb1fd,_0x3387e2=requireRecord(_0x7bbaea,_0x1143f6(0xc0));if(_0x3387e2[_0x1143f6(0xbf)]===![])throw CliErrors[_0x1143f6(0xe7)]('SmartCode\x20knowledge\x20search\x20failed.');if(!(_0x1143f6(0xc4)in _0x3387e2))throw invalidContract('response\x20envelope');return _0x3387e2[_0x1143f6(0xc4)];}function validateTopK(_0x4255e7){const _0x4b222a=a254_0x5eb1fd;if(_0x4255e7!==undefined&&(!Number['isSafeInteger'](_0x4255e7)||_0x4255e7<0x1||_0x4255e7>0x32))throw CliErrors[_0x4b222a(0xc3)](_0x4b222a(0xa7));}function hasNoStore(_0x55f4e9){const _0x2c900c=a254_0x5eb1fd;return(_0x55f4e9[_0x2c900c(0xcb)](_0x2c900c(0xc8))??'')[_0x2c900c(0xac)](',')['some'](_0x2c781e=>_0x2c781e[_0x2c900c(0xde)]()[_0x2c900c(0xd8)]()===_0x2c900c(0xf1));}function parseDevelopmentSearchResponse(_0x3e327b,_0x4db422){const _0xc46a0b=a254_0x5eb1fd,_0x3939b1=requireExactRecord(_0x3e327b,RESPONSE_KEYS,_0xc46a0b(0xca));if(_0x3939b1[_0xc46a0b(0xee)]!==0x2||_0x3939b1[_0xc46a0b(0xd9)]!==_0xc46a0b(0xa6))throw invalidContract(_0xc46a0b(0xd9));if(!Array[_0xc46a0b(0xbb)](_0x3939b1[_0xc46a0b(0xb4)])||_0x3939b1[_0xc46a0b(0xb4)][_0xc46a0b(0xb5)]>(_0x4db422??0x32))throw invalidContract(_0xc46a0b(0xb4));if(typeof _0x3939b1['strategyFingerprint']!==_0xc46a0b(0xc6)||!/^sha256:[0-9a-f]{64}$/[_0xc46a0b(0xdf)](_0x3939b1[_0xc46a0b(0xd0)]))throw invalidContract(_0xc46a0b(0xd0));const _0x5f30f3=requireRecord(_0x3939b1[_0xc46a0b(0xe6)],'timingsMs'),_0x4da28c={};for(const [_0x4f0be6,_0x4edf16]of Object[_0xc46a0b(0xdd)](_0x5f30f3)){if(!/^[A-Za-z][A-Za-z0-9]*$/['test'](_0x4f0be6)||typeof _0x4edf16!==_0xc46a0b(0xd7)||!Number[_0xc46a0b(0xdc)](_0x4edf16)||_0x4edf16<0x0)throw invalidContract(_0xc46a0b(0xe6));_0x4da28c[_0x4f0be6]=_0x4edf16;}const _0x1edbd1=_0x3939b1['hits'][_0xc46a0b(0xab)]((_0xe75fe7,_0x3b6c30)=>parseHit(_0xe75fe7,_0x3b6c30));if(!Number[_0xc46a0b(0xcf)](_0x3939b1['total'])||_0x3939b1[_0xc46a0b(0xd6)]!==_0x1edbd1[_0xc46a0b(0xb5)])throw invalidContract(_0xc46a0b(0xd6));return{'schemaVersion':_0x3939b1[_0xc46a0b(0xee)],'profile':_0x3939b1[_0xc46a0b(0xd9)],'total':_0x3939b1[_0xc46a0b(0xd6)],'strategyFingerprint':_0x3939b1[_0xc46a0b(0xd0)],'timingsMs':_0x4da28c,'hits':_0x1edbd1};}function parseHit(_0x4dfaa5,_0x18f501){const _0x3a6236=a254_0x5eb1fd,_0x22eecc=requireExactRecord(_0x4dfaa5,HIT_KEYS,'hits['+_0x18f501+']'),_0x58ba2b=_0x6984c=>{const _0x4d0070=_0x22eecc[_0x6984c];if(typeof _0x4d0070!=='string'||!_0x4d0070)throw invalidContract(_0x6984c);return _0x4d0070;};if(!Number[_0x3a6236(0xcf)](_0x22eecc[_0x3a6236(0xb7)])||_0x22eecc[_0x3a6236(0xb7)]<0x1)throw invalidContract(_0x3a6236(0xb7));if(_0x22eecc[_0x3a6236(0xbc)]!==_0x3a6236(0xc1)&&_0x22eecc[_0x3a6236(0xbc)]!=='company')throw invalidContract(_0x3a6236(0xbc));if(typeof _0x22eecc[_0x3a6236(0xea)]!=='string'||typeof _0x22eecc['text']!=='string')throw invalidContract(_0x3a6236(0xb1));if(!Array['isArray'](_0x22eecc[_0x3a6236(0xaf)])||_0x22eecc['tags'][_0x3a6236(0xbd)](_0x1fbd61=>typeof _0x1fbd61!==_0x3a6236(0xc6)))throw invalidContract(_0x3a6236(0xaf));if(!Number['isSafeInteger'](_0x22eecc[_0x3a6236(0xeb)])||_0x22eecc[_0x3a6236(0xeb)]!==_0x18f501+0x1)throw invalidContract(_0x3a6236(0xeb));if(!isFiniteNumber(_0x22eecc[_0x3a6236(0xe0)])||!isFiniteNumber(_0x22eecc[_0x3a6236(0xe3)]))throw invalidContract('score');return{'documentId':_0x58ba2b('documentId'),'revision':_0x22eecc[_0x3a6236(0xb7)],'chunkId':_0x58ba2b('chunkId'),'scope':_0x22eecc['scope'],'title':_0x22eecc[_0x3a6236(0xea)],'text':_0x22eecc[_0x3a6236(0xb1)],'tags':[..._0x22eecc[_0x3a6236(0xaf)]],'rank':_0x22eecc['rank'],'rawScore':_0x22eecc[_0x3a6236(0xe0)],'finalScore':_0x22eecc[_0x3a6236(0xe3)],'scoreKind':_0x58ba2b(_0x3a6236(0xd2))};}function requireExactRecord(_0x23851a,_0x1baf1f,_0x2ce77f){const _0xdd956e=a254_0x5eb1fd,_0x472a38=requireRecord(_0x23851a,_0x2ce77f),_0x9c4eaa=Object[_0xdd956e(0xd4)](_0x472a38)[_0xdd956e(0xb3)](),_0x183b5a=[..._0x1baf1f]['sort']();if(_0x9c4eaa[_0xdd956e(0xb5)]!==_0x183b5a[_0xdd956e(0xb5)]||_0x9c4eaa['some']((_0x4eb8f9,_0xd426b1)=>_0x4eb8f9!==_0x183b5a[_0xd426b1]))throw invalidContract(_0x2ce77f);return _0x472a38;}function a254_0xeb92(){const _0x241789=['get','3333952CFloqa','includes','SmartCode\x20knowledge\x20search\x20request\x20failed.','isSafeInteger','strategyFingerprint','cli:rabetbase','scoreKind','/smartapi/knowledge/company-public/search','keys','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','total','number','toLowerCase','profile','query','\x20contract.','isFinite','entries','trim','test','rawScore','POST','application/json','finalScore','Knowledge\x20search\x20appCode\x20is\x20required.','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','timingsMs','apiError','AbortError','json','title','rank','266318tLiDVl','251423tfgfSg','schemaVersion','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','headers','no-store','development','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','415608qshGbK','authRequired','topK','map','split','stringify','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','tags','status','text','18wLKQbr','sort','hits','length','2888886rdbKys','revision','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','name','appCode','isArray','scope','some','915490eWdEWx','success','response\x20envelope','public','226233AMYBGN','validation','data','object','string','chunkId','cache-control','cookie','response'];a254_0xeb92=function(){return _0x241789;};return a254_0xeb92();}function requireRecord(_0x10ab31,_0x4efdd4){const _0x2de11e=a254_0x5eb1fd;if(!_0x10ab31||typeof _0x10ab31!==_0x2de11e(0xc5)||Array['isArray'](_0x10ab31))throw invalidContract(_0x4efdd4);return _0x10ab31;}function isFiniteNumber(_0x287909){const _0x36f3ca=a254_0x5eb1fd;return typeof _0x287909===_0x36f3ca(0xd7)&&Number['isFinite'](_0x287909);}function invalidContract(_0x4e935a){const _0x245f42=a254_0x5eb1fd;return CliErrors['apiError'](_0x245f42(0xd5)+_0x4e935a+_0x245f42(0xdb));}
1
+ const a255_0x40ba7e=a255_0x4819;(function(_0x379f18,_0x3d34a3){const _0x3253b3=a255_0x4819,_0xc7edde=_0x379f18();while(!![]){try{const _0x2d9198=-parseInt(_0x3253b3(0xd0))/0x1*(parseInt(_0x3253b3(0xe6))/0x2)+-parseInt(_0x3253b3(0xde))/0x3*(parseInt(_0x3253b3(0xf4))/0x4)+-parseInt(_0x3253b3(0xcf))/0x5+parseInt(_0x3253b3(0xe5))/0x6+-parseInt(_0x3253b3(0xf9))/0x7*(parseInt(_0x3253b3(0xf6))/0x8)+-parseInt(_0x3253b3(0xea))/0x9*(parseInt(_0x3253b3(0xc3))/0xa)+-parseInt(_0x3253b3(0xb7))/0xb*(-parseInt(_0x3253b3(0x102))/0xc);if(_0x2d9198===_0x3d34a3)break;else _0xc7edde['push'](_0xc7edde['shift']());}catch(_0x31bcd6){_0xc7edde['push'](_0xc7edde['shift']());}}}(a255_0x47a5,0x9dcd5));import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=['schemaVersion',a255_0x40ba7e(0xcd),a255_0x40ba7e(0xcb),a255_0x40ba7e(0xda),a255_0x40ba7e(0xfd),a255_0x40ba7e(0xe8)],HIT_KEYS=[a255_0x40ba7e(0xb6),a255_0x40ba7e(0xeb),a255_0x40ba7e(0xe4),'scope',a255_0x40ba7e(0xc8),a255_0x40ba7e(0xdb),a255_0x40ba7e(0xf1),a255_0x40ba7e(0xbc),a255_0x40ba7e(0xc0),'finalScore',a255_0x40ba7e(0xec)];function a255_0x4819(_0x40214d,_0x55bbe4){_0x40214d=_0x40214d-0xb6;const _0x47a504=a255_0x47a5();let _0x4819e2=_0x47a504[_0x40214d];return _0x4819e2;}export async function searchDevelopmentKnowledge(_0x59737c){const _0x333f1d=a255_0x40ba7e,_0x37a00e=_0x59737c[_0x333f1d(0xf0)]['trim'](),_0x4127d0=_0x59737c['query'][_0x333f1d(0xca)]();if(!_0x37a00e)throw CliErrors[_0x333f1d(0xfb)](_0x333f1d(0xe3));if(!_0x59737c[_0x333f1d(0xf3)][_0x333f1d(0xca)]())throw CliErrors[_0x333f1d(0xfc)]();if(!_0x4127d0)throw CliErrors[_0x333f1d(0xfb)](_0x333f1d(0xe7));validateTopK(_0x59737c['topK']);const _0x56997a=getKbDomain()+_0x333f1d(0xee);let _0x51f326;try{_0x51f326=await fetch(_0x56997a,{'method':_0x333f1d(0xbe),'headers':{'Content-Type':'application/json','Cookie':_0x59737c[_0x333f1d(0xf3)],'X-Invoke-Source':_0x333f1d(0xd6)},'body':JSON['stringify']({'appCode':_0x37a00e,'query':_0x4127d0,..._0x59737c['topK']!==undefined?{'topK':_0x59737c['topK']}:{}}),'signal':_0x59737c['signal']});}catch(_0x79ba1a){if(_0x79ba1a instanceof CliError)throw _0x79ba1a;if(_0x79ba1a instanceof Error&&_0x79ba1a['name']==='AbortError')throw _0x79ba1a;throw CliErrors[_0x333f1d(0xcc)]('SmartCode\x20knowledge\x20search\x20request\x20failed.');}if(!hasNoStore(_0x51f326['headers']))throw CliErrors[_0x333f1d(0xbd)](_0x333f1d(0xd9));if(_0x51f326[_0x333f1d(0xd3)]===0x191)throw CliErrors[_0x333f1d(0xfc)]();if(!_0x51f326['ok'])throw CliErrors['apiError'](_0x333f1d(0xc2)+_0x51f326[_0x333f1d(0xd3)]+').');if(!(_0x51f326[_0x333f1d(0xe2)][_0x333f1d(0xf7)](_0x333f1d(0x101))??'')[_0x333f1d(0xc6)]()[_0x333f1d(0xb8)](_0x333f1d(0x100)))throw CliErrors[_0x333f1d(0xbd)](_0x333f1d(0xfa));let _0x3acc99;try{_0x3acc99=await _0x51f326[_0x333f1d(0xdf)]();}catch{throw CliErrors[_0x333f1d(0xbd)](_0x333f1d(0xff));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x3acc99),_0x59737c[_0x333f1d(0xe0)]);}function readEnvelopeData(_0x321e34){const _0x466c7c=a255_0x40ba7e,_0x1e3b39=requireRecord(_0x321e34,'response\x20envelope');if(_0x1e3b39[_0x466c7c(0xd2)]===![])throw CliErrors[_0x466c7c(0xbd)]('SmartCode\x20knowledge\x20search\x20failed.');if(!('data'in _0x1e3b39))throw invalidContract(_0x466c7c(0xf5));return _0x1e3b39[_0x466c7c(0xd1)];}function validateTopK(_0x4e0874){const _0x3f4ef4=a255_0x40ba7e;if(_0x4e0874!==undefined&&(!Number[_0x3f4ef4(0xe1)](_0x4e0874)||_0x4e0874<0x1||_0x4e0874>0x32))throw CliErrors[_0x3f4ef4(0xfb)]('Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.');}function hasNoStore(_0x21dce9){const _0x19b625=a255_0x40ba7e;return(_0x21dce9[_0x19b625(0xf7)](_0x19b625(0xc1))??'')[_0x19b625(0xfe)](',')[_0x19b625(0xed)](_0x300947=>_0x300947['trim']()[_0x19b625(0xc6)]()===_0x19b625(0xba));}function parseDevelopmentSearchResponse(_0x1d3d7f,_0x10e10a){const _0x25a09d=a255_0x40ba7e,_0x4c38d1=requireExactRecord(_0x1d3d7f,RESPONSE_KEYS,'response');if(_0x4c38d1[_0x25a09d(0xc5)]!==0x2||_0x4c38d1['profile']!==_0x25a09d(0xb9))throw invalidContract(_0x25a09d(0xcd));if(!Array['isArray'](_0x4c38d1[_0x25a09d(0xda)])||_0x4c38d1[_0x25a09d(0xda)][_0x25a09d(0xef)]>(_0x10e10a??0x32))throw invalidContract(_0x25a09d(0xda));if(typeof _0x4c38d1[_0x25a09d(0xfd)]!==_0x25a09d(0xd8)||!/^sha256:[0-9a-f]{64}$/[_0x25a09d(0xd4)](_0x4c38d1['strategyFingerprint']))throw invalidContract(_0x25a09d(0xfd));const _0x389468=requireRecord(_0x4c38d1['timingsMs'],_0x25a09d(0xe8)),_0x57cbec={};for(const [_0x15a955,_0x1bf322]of Object['entries'](_0x389468)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x25a09d(0xd4)](_0x15a955)||typeof _0x1bf322!==_0x25a09d(0xdc)||!Number[_0x25a09d(0xce)](_0x1bf322)||_0x1bf322<0x0)throw invalidContract('timingsMs');_0x57cbec[_0x15a955]=_0x1bf322;}const _0x54c18d=_0x4c38d1['hits'][_0x25a09d(0xc4)]((_0x85641f,_0x25082c)=>parseHit(_0x85641f,_0x25082c));if(!Number[_0x25a09d(0xe1)](_0x4c38d1[_0x25a09d(0xcb)])||_0x4c38d1[_0x25a09d(0xcb)]!==_0x54c18d[_0x25a09d(0xef)])throw invalidContract(_0x25a09d(0xcb));return{'schemaVersion':_0x4c38d1['schemaVersion'],'profile':_0x4c38d1[_0x25a09d(0xcd)],'total':_0x4c38d1[_0x25a09d(0xcb)],'strategyFingerprint':_0x4c38d1['strategyFingerprint'],'timingsMs':_0x57cbec,'hits':_0x54c18d};}function parseHit(_0x4948d4,_0x60f1f8){const _0x1c5335=a255_0x40ba7e,_0x341d4a=requireExactRecord(_0x4948d4,HIT_KEYS,_0x1c5335(0xc7)+_0x60f1f8+']'),_0x24b051=_0x123b89=>{const _0x160922=_0x1c5335,_0x5782bb=_0x341d4a[_0x123b89];if(typeof _0x5782bb!==_0x160922(0xd8)||!_0x5782bb)throw invalidContract(_0x123b89);return _0x5782bb;};if(!Number[_0x1c5335(0xe1)](_0x341d4a[_0x1c5335(0xeb)])||_0x341d4a[_0x1c5335(0xeb)]<0x1)throw invalidContract(_0x1c5335(0xeb));if(_0x341d4a[_0x1c5335(0xd5)]!==_0x1c5335(0xe9)&&_0x341d4a[_0x1c5335(0xd5)]!=='company')throw invalidContract('scope');if(typeof _0x341d4a[_0x1c5335(0xc8)]!==_0x1c5335(0xd8)||typeof _0x341d4a[_0x1c5335(0xdb)]!==_0x1c5335(0xd8))throw invalidContract('text');if(!Array[_0x1c5335(0xf8)](_0x341d4a['tags'])||_0x341d4a[_0x1c5335(0xf1)][_0x1c5335(0xed)](_0x46b42b=>typeof _0x46b42b!==_0x1c5335(0xd8)))throw invalidContract(_0x1c5335(0xf1));if(!Number['isSafeInteger'](_0x341d4a[_0x1c5335(0xbc)])||_0x341d4a[_0x1c5335(0xbc)]!==_0x60f1f8+0x1)throw invalidContract(_0x1c5335(0xbc));if(!isFiniteNumber(_0x341d4a[_0x1c5335(0xc0)])||!isFiniteNumber(_0x341d4a[_0x1c5335(0xbb)]))throw invalidContract(_0x1c5335(0xd7));return{'documentId':_0x24b051('documentId'),'revision':_0x341d4a[_0x1c5335(0xeb)],'chunkId':_0x24b051(_0x1c5335(0xe4)),'scope':_0x341d4a[_0x1c5335(0xd5)],'title':_0x341d4a[_0x1c5335(0xc8)],'text':_0x341d4a['text'],'tags':[..._0x341d4a[_0x1c5335(0xf1)]],'rank':_0x341d4a['rank'],'rawScore':_0x341d4a[_0x1c5335(0xc0)],'finalScore':_0x341d4a['finalScore'],'scoreKind':_0x24b051(_0x1c5335(0xec))};}function requireExactRecord(_0x390b16,_0x5c6681,_0x4b05f7){const _0x1b357c=a255_0x40ba7e,_0x4cd2d7=requireRecord(_0x390b16,_0x4b05f7),_0x7688eb=Object[_0x1b357c(0xdd)](_0x4cd2d7)[_0x1b357c(0xf2)](),_0x43edaa=[..._0x5c6681]['sort']();if(_0x7688eb[_0x1b357c(0xef)]!==_0x43edaa['length']||_0x7688eb[_0x1b357c(0xed)]((_0x3e9ce7,_0x1a80e)=>_0x3e9ce7!==_0x43edaa[_0x1a80e]))throw invalidContract(_0x4b05f7);return _0x4cd2d7;}function a255_0x47a5(){const _0x4f12f8=['data','success','status','test','scope','cli:rabetbase','score','string','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','hits','text','number','keys','8646WNkKie','json','topK','isSafeInteger','headers','Knowledge\x20search\x20appCode\x20is\x20required.','chunkId','2893956gDPzsH','94MtHkmx','Knowledge\x20search\x20query\x20is\x20required.','timingsMs','public','978381rVavaq','revision','scoreKind','some','/smartapi/knowledge/company-public/search','length','appCode','tags','sort','cookie','716rEWBZd','response\x20envelope','30376fTkSna','get','isArray','1421OoddZn','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','validation','authRequired','strategyFingerprint','split','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','application/json','content-type','1392bDcIQf','documentId','329087clUGlJ','includes','development','no-store','finalScore','rank','apiError','POST','object','rawScore','cache-control','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','20kVNVsm','map','schemaVersion','toLowerCase','hits[','title','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','trim','total','networkError','profile','isFinite','3928455nYvXlm','21629vTxrEE'];a255_0x47a5=function(){return _0x4f12f8;};return a255_0x47a5();}function requireRecord(_0x311020,_0x21fa08){const _0x534b7e=a255_0x40ba7e;if(!_0x311020||typeof _0x311020!==_0x534b7e(0xbf)||Array[_0x534b7e(0xf8)](_0x311020))throw invalidContract(_0x21fa08);return _0x311020;}function isFiniteNumber(_0x15cd66){return typeof _0x15cd66==='number'&&Number['isFinite'](_0x15cd66);}function invalidContract(_0x5b2d29){const _0x453254=a255_0x40ba7e;return CliErrors['apiError'](_0x453254(0xc9)+_0x5b2d29+'\x20contract.');}
@@ -1 +1 @@
1
- const a255_0x4ae231=a255_0x4587;(function(_0x500f21,_0x27e011){const _0x8377c7=a255_0x4587,_0x2915cf=_0x500f21();while(!![]){try{const _0x543cea=-parseInt(_0x8377c7(0x113))/0x1+parseInt(_0x8377c7(0x116))/0x2*(parseInt(_0x8377c7(0x10f))/0x3)+parseInt(_0x8377c7(0x111))/0x4*(-parseInt(_0x8377c7(0xfd))/0x5)+-parseInt(_0x8377c7(0x105))/0x6*(-parseInt(_0x8377c7(0x110))/0x7)+parseInt(_0x8377c7(0x10a))/0x8*(parseInt(_0x8377c7(0x109))/0x9)+-parseInt(_0x8377c7(0xfc))/0xa*(parseInt(_0x8377c7(0xf9))/0xb)+-parseInt(_0x8377c7(0xff))/0xc*(-parseInt(_0x8377c7(0x112))/0xd);if(_0x543cea===_0x27e011)break;else _0x2915cf['push'](_0x2915cf['shift']());}catch(_0x856746){_0x2915cf['push'](_0x2915cf['shift']());}}}(a255_0x1ac1,0x94042));function a255_0x1ac1(){const _0x384829=['245968leFASi','name','page-dir','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','cwd','72qqhJwY','7wDoDxy','4Mxzzmv','23179MpsWvk','440933UIkQJV','flagMissing','F_OK','13738wkGsJa','11tLkEas','.json','Unsupported\x20file\x20in\x20page\x20directory:\x20','5126950XcyeRv','3284045LZyJCG','Page\x20directory\x20not\x20found:\x20','4044zMEZkW','trim','page','.rabetbase','validation','localeCompare','1880292XZFeZG','join','toUpperCase','utf8','333nHjWmJ'];a255_0x1ac1=function(){return _0x384829;};return a255_0x1ac1();}import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x3abf7b,_0x16ef85=process[a255_0x4ae231(0x10e)]()){const _0x257cdf=a255_0x4ae231,_0x21209e=resolve(_0x16ef85),_0x37842d=join(_0x21209e,'.rabetbase',_0x257cdf(0x101));return{'projectRoot':_0x21209e,'pagesBaseDir':_0x37842d,'appPagesDir':join(_0x37842d,_0x3abf7b),'lockFilePath':join(_0x21209e,_0x257cdf(0x102),'page.lock.json')};}export function buildPageFileName(_0x5855c4,_0x5d4c63){const _0xfca29d=a255_0x4ae231;return _0x5855c4+'-'+_0x5d4c63[_0xfca29d(0x107)]()+_0xfca29d(0xfa);}export function resolvePageFilePath(_0x131ff9,_0x40d7b8,_0xf82ecf){return join(_0x131ff9['appPagesDir'],buildPageFileName(_0x40d7b8,_0xf82ecf));}function a255_0x4587(_0x38fec4,_0x1aa462){_0x38fec4=_0x38fec4-0xf9;const _0x1ac14a=a255_0x1ac1();let _0x4587af=_0x1ac14a[_0x38fec4];return _0x4587af;}export async function ensureParentDirectory(_0x3fabd6){await mkdir(dirname(_0x3fabd6),{'recursive':!![]});}export async function fileExists(_0x1688b6){const _0x2c6b01=a255_0x4ae231;try{return await access(_0x1688b6,constants[_0x2c6b01(0x115)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0x234abc){const _0x4cd5e2=a255_0x4ae231,_0xff2ba1=_0x234abc[_0x4cd5e2(0x100)]();if(!_0xff2ba1)throw CliErrors[_0x4cd5e2(0x114)](_0x4cd5e2(0x10c));const _0x256365=resolve(_0xff2ba1);let _0x12592d;try{_0x12592d=await lstat(_0x256365);}catch{throw CliErrors['validation'](_0x4cd5e2(0xfe)+_0xff2ba1);}if(!_0x12592d['isDirectory']())throw CliErrors['validation'](_0x4cd5e2(0x10d)+_0xff2ba1);const _0x35912c={};return await readDirectory(_0x256365,_0x256365,_0x35912c),_0x35912c;}async function readDirectory(_0x36b645,_0x33c363,_0x476db3){const _0x286479=a255_0x4ae231,_0x5d175f=await readdir(_0x33c363,{'withFileTypes':!![]});for(const _0x589e3f of _0x5d175f['sort']((_0x58a17c,_0x39d160)=>_0x58a17c[_0x286479(0x10b)][_0x286479(0x104)](_0x39d160[_0x286479(0x10b)]))){const _0x37a822=join(_0x33c363,_0x589e3f[_0x286479(0x10b)]);if(_0x589e3f['isDirectory']()){await readDirectory(_0x36b645,_0x37a822,_0x476db3);continue;}if(!_0x589e3f['isFile']())throw CliErrors[_0x286479(0x103)](_0x286479(0xfb)+_0x37a822);_0x476db3[relative(_0x36b645,_0x37a822)['split'](sep)[_0x286479(0x106)]('/')]=await readFile(_0x37a822,_0x286479(0x108));}}
1
+ (function(_0x5e80cc,_0x587906){const _0x52aaa1=a256_0x674d,_0x26f203=_0x5e80cc();while(!![]){try{const _0x60dff1=parseInt(_0x52aaa1(0x1c1))/0x1*(parseInt(_0x52aaa1(0x1c0))/0x2)+parseInt(_0x52aaa1(0x1c7))/0x3+parseInt(_0x52aaa1(0x1c8))/0x4+parseInt(_0x52aaa1(0x1bd))/0x5*(parseInt(_0x52aaa1(0x1b3))/0x6)+parseInt(_0x52aaa1(0x1be))/0x7+-parseInt(_0x52aaa1(0x1cc))/0x8*(parseInt(_0x52aaa1(0x1b1))/0x9)+-parseInt(_0x52aaa1(0x1ba))/0xa*(parseInt(_0x52aaa1(0x1b2))/0xb);if(_0x60dff1===_0x587906)break;else _0x26f203['push'](_0x26f203['shift']());}catch(_0x25ea78){_0x26f203['push'](_0x26f203['shift']());}}}(a256_0x1fc0,0x476a3));import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';function a256_0x674d(_0x284766,_0x4a7851){_0x284766=_0x284766-0x1af;const _0x1fc028=a256_0x1fc0();let _0x674dc9=_0x1fc028[_0x284766];return _0x674dc9;}import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x123abc,_0x5463f8=process['cwd']()){const _0x5b5936=a256_0x674d,_0x59da6f=resolve(_0x5463f8),_0x256e33=join(_0x59da6f,_0x5b5936(0x1cb),_0x5b5936(0x1b8));return{'projectRoot':_0x59da6f,'pagesBaseDir':_0x256e33,'appPagesDir':join(_0x256e33,_0x123abc),'lockFilePath':join(_0x59da6f,'.rabetbase',_0x5b5936(0x1b9))};}export function buildPageFileName(_0x4fed3e,_0xf3ab91){const _0x42e1aa=a256_0x674d;return _0x4fed3e+'-'+_0xf3ab91[_0x42e1aa(0x1c2)]()+'.json';}export function resolvePageFilePath(_0x5b7e93,_0x3ffe9e,_0x3fff63){return join(_0x5b7e93['appPagesDir'],buildPageFileName(_0x3ffe9e,_0x3fff63));}export async function ensureParentDirectory(_0x1a37d8){await mkdir(dirname(_0x1a37d8),{'recursive':!![]});}function a256_0x1fc0(){const _0x36018f=['isFile','Page\x20directory\x20not\x20found:\x20','join','page','page.lock.json','40QEEtsV','utf8','name','7360OVvcsR','565306ETCSSk','flagMissing','1012oaiLNV','238oxOphy','toUpperCase','F_OK','localeCompare','isDirectory','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','536601pLoYcw','116448SZoaXf','sort','page-dir','.rabetbase','1106096wpihyI','Unsupported\x20file\x20in\x20page\x20directory:\x20','split','9Xolpuc','1090199YuVgIA','1704UsiMRS','validation'];a256_0x1fc0=function(){return _0x36018f;};return a256_0x1fc0();}export async function fileExists(_0xba6c28){const _0x8c255c=a256_0x674d;try{return await access(_0xba6c28,constants[_0x8c255c(0x1c3)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0x1730d9){const _0x2ca1b3=a256_0x674d,_0x3ce97d=_0x1730d9['trim']();if(!_0x3ce97d)throw CliErrors[_0x2ca1b3(0x1bf)](_0x2ca1b3(0x1ca));const _0x13aec9=resolve(_0x3ce97d);let _0x18b7ba;try{_0x18b7ba=await lstat(_0x13aec9);}catch{throw CliErrors['validation'](_0x2ca1b3(0x1b6)+_0x3ce97d);}if(!_0x18b7ba[_0x2ca1b3(0x1c5)]())throw CliErrors[_0x2ca1b3(0x1b4)](_0x2ca1b3(0x1c6)+_0x3ce97d);const _0x5c7fe6={};return await readDirectory(_0x13aec9,_0x13aec9,_0x5c7fe6),_0x5c7fe6;}async function readDirectory(_0x2d0220,_0x4fbde5,_0x4df43d){const _0x3aea07=a256_0x674d,_0x5e7fa0=await readdir(_0x4fbde5,{'withFileTypes':!![]});for(const _0x38b02c of _0x5e7fa0[_0x3aea07(0x1c9)]((_0x30e86e,_0x54583a)=>_0x30e86e[_0x3aea07(0x1bc)][_0x3aea07(0x1c4)](_0x54583a[_0x3aea07(0x1bc)]))){const _0x471f3b=join(_0x4fbde5,_0x38b02c[_0x3aea07(0x1bc)]);if(_0x38b02c[_0x3aea07(0x1c5)]()){await readDirectory(_0x2d0220,_0x471f3b,_0x4df43d);continue;}if(!_0x38b02c[_0x3aea07(0x1b5)]())throw CliErrors[_0x3aea07(0x1b4)](_0x3aea07(0x1af)+_0x471f3b);_0x4df43d[relative(_0x2d0220,_0x471f3b)[_0x3aea07(0x1b0)](sep)[_0x3aea07(0x1b7)]('/')]=await readFile(_0x471f3b,_0x3aea07(0x1bb));}}
@@ -1 +1 @@
1
- function a256_0x3d8f(_0x2c22ce,_0x870f0a){_0x2c22ce=_0x2c22ce-0xea;const _0x4f97a3=a256_0x4f97();let _0x3d8fc2=_0x4f97a3[_0x2c22ce];return _0x3d8fc2;}(function(_0x135aff,_0x330cd2){const _0x41043f=a256_0x3d8f,_0x4a188b=_0x135aff();while(!![]){try{const _0x2b2fff=parseInt(_0x41043f(0xf5))/0x1*(parseInt(_0x41043f(0xef))/0x2)+parseInt(_0x41043f(0xfb))/0x3+parseInt(_0x41043f(0xf9))/0x4+-parseInt(_0x41043f(0xf0))/0x5*(parseInt(_0x41043f(0xeb))/0x6)+parseInt(_0x41043f(0xed))/0x7+parseInt(_0x41043f(0xf2))/0x8*(parseInt(_0x41043f(0xf7))/0x9)+parseInt(_0x41043f(0xec))/0xa*(-parseInt(_0x41043f(0xee))/0xb);if(_0x2b2fff===_0x330cd2)break;else _0x4a188b['push'](_0x4a188b['shift']());}catch(_0x1cf166){_0x4a188b['push'](_0x4a188b['shift']());}}}(a256_0x4f97,0x320c0));import a256_0x48f909 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x1e5e57){const _0x5b7192=a256_0x3d8f;return JSON[_0x5b7192(0xf6)](JSON[_0x5b7192(0xf4)](_0x1e5e57),null,0x2)+'\x0a';}export function computePageContentHash(_0x5e0131){const _0x13b2a7=a256_0x3d8f;return a256_0x48f909['createHash'](_0x13b2a7(0xf1))[_0x13b2a7(0xea)](_0x5e0131)[_0x13b2a7(0xf3)](_0x13b2a7(0xfa));}export function computeSerializedSchemaHash(_0x4b4750){return computePageContentHash(serializePageSchemaForFile(_0x4b4750));}function a256_0x4f97(){const _0x3e7aaf=['828282ZgePnD','update','67302UhwoUp','4330dgvMMD','82369AxXgxD','8074deBPaB','8FXJHWH','155PXcnDk','md5','16oKvytt','digest','parse','32672ACRiPj','stringify','1096182THNrXQ','utf8','833584yKtbJg','hex'];a256_0x4f97=function(){return _0x3e7aaf;};return a256_0x4f97();}export async function computePageFileHash(_0x282ab4){const _0x4099d8=a256_0x3d8f,_0xb5f4e6=await readFile(_0x282ab4,_0x4099d8(0xf8));return computePageContentHash(_0xb5f4e6);}
1
+ function a257_0x4c0c(){const _0x3d6a06=['205212TFloIm','11MlWkXT','digest','123006nZAkTY','stringify','2435288QRLNDl','3705612IOvUKy','md5','7FiYCwB','createHash','hex','24ICiKqE','3526uCLSkx','update','219390GyUPsW','664296TvCwOZ','60vrOoaq','18nAVPKG'];a257_0x4c0c=function(){return _0x3d6a06;};return a257_0x4c0c();}(function(_0x27d4d0,_0x15adab){const _0x2da92d=a257_0x1ade,_0x5ec1e9=_0x27d4d0();while(!![]){try{const _0x22e839=-parseInt(_0x2da92d(0x12d))/0x1+parseInt(_0x2da92d(0x124))/0x2*(-parseInt(_0x2da92d(0x123))/0x3)+-parseInt(_0x2da92d(0x12a))/0x4*(-parseInt(_0x2da92d(0x128))/0x5)+-parseInt(_0x2da92d(0x127))/0x6+-parseInt(_0x2da92d(0x120))/0x7*(-parseInt(_0x2da92d(0x11d))/0x8)+parseInt(_0x2da92d(0x129))/0x9*(-parseInt(_0x2da92d(0x126))/0xa)+parseInt(_0x2da92d(0x12b))/0xb*(-parseInt(_0x2da92d(0x11e))/0xc);if(_0x22e839===_0x15adab)break;else _0x5ec1e9['push'](_0x5ec1e9['shift']());}catch(_0x135109){_0x5ec1e9['push'](_0x5ec1e9['shift']());}}}(a257_0x4c0c,0x4e036));import a257_0x36f72c from'node:crypto';function a257_0x1ade(_0x2c8000,_0x5b0771){_0x2c8000=_0x2c8000-0x11d;const _0x4c0c70=a257_0x4c0c();let _0x1adef8=_0x4c0c70[_0x2c8000];return _0x1adef8;}import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x291abf){const _0xafbf27=a257_0x1ade;return JSON[_0xafbf27(0x12e)](JSON['parse'](_0x291abf),null,0x2)+'\x0a';}export function computePageContentHash(_0x542d4e){const _0x4bfef3=a257_0x1ade;return a257_0x36f72c[_0x4bfef3(0x121)](_0x4bfef3(0x11f))[_0x4bfef3(0x125)](_0x542d4e)[_0x4bfef3(0x12c)](_0x4bfef3(0x122));}export function computeSerializedSchemaHash(_0x203664){return computePageContentHash(serializePageSchemaForFile(_0x203664));}export async function computePageFileHash(_0x1d48e7){const _0x5d74ca=await readFile(_0x1d48e7,'utf8');return computePageContentHash(_0x5d74ca);}
@@ -1 +1 @@
1
- function a257_0x73e3(_0x3756e4,_0x3879bc){_0x3756e4=_0x3756e4-0xca;const _0x29f319=a257_0x29f3();let _0x73e38a=_0x29f319[_0x3756e4];return _0x73e38a;}(function(_0x56e4fd,_0x27d6eb){const _0x208fa9=a257_0x73e3,_0x11a7a9=_0x56e4fd();while(!![]){try{const _0x338234=parseInt(_0x208fa9(0xce))/0x1+-parseInt(_0x208fa9(0xd3))/0x2+parseInt(_0x208fa9(0xd1))/0x3*(-parseInt(_0x208fa9(0xcc))/0x4)+parseInt(_0x208fa9(0xcb))/0x5+-parseInt(_0x208fa9(0xd8))/0x6+-parseInt(_0x208fa9(0xda))/0x7+parseInt(_0x208fa9(0xd6))/0x8*(parseInt(_0x208fa9(0xcd))/0x9);if(_0x338234===_0x27d6eb)break;else _0x11a7a9['push'](_0x11a7a9['shift']());}catch(_0x14f7e3){_0x11a7a9['push'](_0x11a7a9['shift']());}}}(a257_0x29f3,0x60c8b));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a257_0x29f3(){const _0x420b9b=['217929pxvRbX','utf8','object','24sPRtmn','apps','1273434UBolEg','code','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','1188760YEAgDg','lastSync','781608MAttmk','ENOENT','1137934XWGETH','stringify','pages','3541620RUZZUn','23032TXzNQd','27spnvDp'];a257_0x29f3=function(){return _0x420b9b;};return a257_0x29f3();}export function ensurePageLockScope(_0x11feba,_0x304f47){const _0x2f68fa=a257_0x73e3,_0x58cca3={'apps':_0x11feba['apps']&&typeof _0x11feba[_0x2f68fa(0xd2)]===_0x2f68fa(0xd0)?_0x11feba[_0x2f68fa(0xd2)]:{}};let _0x1b296d=_0x58cca3[_0x2f68fa(0xd2)][_0x304f47];if(!_0x1b296d)return _0x1b296d={'lastSync':'','pages':{}},_0x58cca3[_0x2f68fa(0xd2)][_0x304f47]=_0x1b296d,{'lockData':_0x58cca3,'appLock':_0x1b296d};return!_0x1b296d[_0x2f68fa(0xd7)]&&(_0x1b296d[_0x2f68fa(0xd7)]=''),(!_0x1b296d[_0x2f68fa(0xca)]||typeof _0x1b296d[_0x2f68fa(0xca)]!=='object')&&(_0x1b296d[_0x2f68fa(0xca)]={}),{'lockData':_0x58cca3,'appLock':_0x1b296d};}export async function readPageLockFile(_0x292d98){const _0x314665=a257_0x73e3;try{const _0x3d7ea4=await readFile(_0x292d98,'utf8'),_0x31b52=JSON['parse'](_0x3d7ea4);return{'apps':_0x31b52[_0x314665(0xd2)]&&typeof _0x31b52[_0x314665(0xd2)]===_0x314665(0xd0)?_0x31b52[_0x314665(0xd2)]:{}};}catch(_0x5d67b6){if(_0x5d67b6[_0x314665(0xd4)]===_0x314665(0xd9))return null;throw new Error(_0x314665(0xd5)+String(_0x5d67b6));}}export async function writePageLockFile(_0x1fa977,_0x4d95b5){const _0xc4358a=a257_0x73e3;await mkdir(dirname(_0x1fa977),{'recursive':!![]}),await writeFile(_0x1fa977,JSON[_0xc4358a(0xdb)](_0x4d95b5,null,0x2),_0xc4358a(0xcf));}
1
+ (function(_0x5dbb97,_0x5524a8){const _0x164f49=a258_0x4bb7,_0x272e62=_0x5dbb97();while(!![]){try{const _0x29cddb=parseInt(_0x164f49(0x1d0))/0x1*(parseInt(_0x164f49(0x1cc))/0x2)+parseInt(_0x164f49(0x1cb))/0x3+parseInt(_0x164f49(0x1d3))/0x4+-parseInt(_0x164f49(0x1ca))/0x5+parseInt(_0x164f49(0x1cd))/0x6+parseInt(_0x164f49(0x1c5))/0x7+parseInt(_0x164f49(0x1d1))/0x8*(-parseInt(_0x164f49(0x1cf))/0x9);if(_0x29cddb===_0x5524a8)break;else _0x272e62['push'](_0x272e62['shift']());}catch(_0x1d978c){_0x272e62['push'](_0x272e62['shift']());}}}(a258_0x2055,0xdcd4a));import{mkdir,readFile,writeFile}from'node:fs/promises';function a258_0x4bb7(_0x594334,_0x383df4){_0x594334=_0x594334-0x1c3;const _0x20554a=a258_0x2055();let _0x4bb7b6=_0x20554a[_0x594334];return _0x4bb7b6;}function a258_0x2055(){const _0x1bf8d5=['1907364ITnPjr','pages','object','2831717qTWxdP','lastSync','apps','utf8','stringify','4709285cJpUAB','3402942wYImwM','952274RgROeF','7221450ZsHVzQ','parse','147267plUVeg','1ldiEqZ','904agVLyl','code'];a258_0x2055=function(){return _0x1bf8d5;};return a258_0x2055();}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0xba0af,_0x51ba7d){const _0x537626=a258_0x4bb7,_0x2fccdf={'apps':_0xba0af[_0x537626(0x1c7)]&&typeof _0xba0af[_0x537626(0x1c7)]===_0x537626(0x1c4)?_0xba0af[_0x537626(0x1c7)]:{}};let _0x1d729a=_0x2fccdf[_0x537626(0x1c7)][_0x51ba7d];if(!_0x1d729a)return _0x1d729a={'lastSync':'','pages':{}},_0x2fccdf['apps'][_0x51ba7d]=_0x1d729a,{'lockData':_0x2fccdf,'appLock':_0x1d729a};return!_0x1d729a[_0x537626(0x1c6)]&&(_0x1d729a[_0x537626(0x1c6)]=''),(!_0x1d729a[_0x537626(0x1c3)]||typeof _0x1d729a['pages']!==_0x537626(0x1c4))&&(_0x1d729a[_0x537626(0x1c3)]={}),{'lockData':_0x2fccdf,'appLock':_0x1d729a};}export async function readPageLockFile(_0xff0d3a){const _0x247467=a258_0x4bb7;try{const _0x3caa7f=await readFile(_0xff0d3a,_0x247467(0x1c8)),_0x2f4c9a=JSON[_0x247467(0x1ce)](_0x3caa7f);return{'apps':_0x2f4c9a[_0x247467(0x1c7)]&&typeof _0x2f4c9a[_0x247467(0x1c7)]===_0x247467(0x1c4)?_0x2f4c9a['apps']:{}};}catch(_0xf9ce97){if(_0xf9ce97[_0x247467(0x1d2)]==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0xf9ce97));}}export async function writePageLockFile(_0x2c3fdd,_0x423f73){const _0x171cac=a258_0x4bb7;await mkdir(dirname(_0x2c3fdd),{'recursive':!![]}),await writeFile(_0x2c3fdd,JSON[_0x171cac(0x1c9)](_0x423f73,null,0x2),_0x171cac(0x1c8));}
@@ -0,0 +1,6 @@
1
+ export interface PrepareLrSmartJsxResult {
2
+ content: string;
3
+ compiledNodes: number;
4
+ normalizedNodes: number;
5
+ }
6
+ export declare function prepareLrSmartJsxForPush(localContent: string, remoteContent: string, transpile: (source: string) => Promise<string>): Promise<PrepareLrSmartJsxResult>;
@@ -0,0 +1 @@
1
+ (function(_0x183644,_0x2e5d5f){const _0x3f8595=a259_0x62a6,_0x3f28d6=_0x183644();while(!![]){try{const _0x158883=parseInt(_0x3f8595(0xb8))/0x1+-parseInt(_0x3f8595(0xb5))/0x2*(-parseInt(_0x3f8595(0xc5))/0x3)+parseInt(_0x3f8595(0xd9))/0x4+parseInt(_0x3f8595(0xcc))/0x5+parseInt(_0x3f8595(0xd5))/0x6*(parseInt(_0x3f8595(0xd8))/0x7)+parseInt(_0x3f8595(0xd7))/0x8+-parseInt(_0x3f8595(0xb2))/0x9*(parseInt(_0x3f8595(0xc7))/0xa);if(_0x158883===_0x2e5d5f)break;else _0x3f28d6['push'](_0x3f28d6['shift']());}catch(_0x3eb23f){_0x3f28d6['push'](_0x3f28d6['shift']());}}}(a259_0x5639,0xc0eee));import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0x222c24,_0x1df2ae,_0x4801d5){const _0x405b5a=a259_0x62a6,_0x48cc98=parseSchema(_0x222c24,_0x405b5a(0xb1)),_0x2f903b=parseSchema(_0x1df2ae,'remote'),_0xcd1068=collectLrSmartJsx(_0x48cc98,!![]);if(_0xcd1068[_0x405b5a(0xc9)]===0x0)return{'content':_0x222c24,'compiledNodes':0x0,'normalizedNodes':0x0};const _0x3ae052=new Map(collectLrSmartJsx(_0x2f903b)[_0x405b5a(0xba)](_0x482694=>[_0x482694[_0x405b5a(0xd3)],_0x482694]));let _0x223347=0x0,_0x58fdc8=0x0;for(const _0x3a9400 of _0xcd1068){const _0x393c66=readNonEmptyString(_0x3a9400['render'][_0x405b5a(0xb3)]),_0xc3a508=readNonEmptyString(_0x3a9400[_0x405b5a(0xd6)]['value']),_0x2eb277=_0x3ae052[_0x405b5a(0xcb)](_0x3a9400['key']),_0x276506=readNonEmptyString(_0x2eb277?.[_0x405b5a(0xd6)]['source']),_0x300610=readNonEmptyString(_0x2eb277?.[_0x405b5a(0xd6)][_0x405b5a(0xb0)]);let _0x404332=![];_0x3a9400['render'][_0x405b5a(0xc6)]!==_0x405b5a(0xb7)&&(_0x3a9400[_0x405b5a(0xd6)][_0x405b5a(0xc6)]='JSFunction',_0x404332=!![]);!isPageContextExpression(_0x3a9400[_0x405b5a(0xbf)][_0x405b5a(0xce)])&&(_0x3a9400[_0x405b5a(0xbf)][_0x405b5a(0xce)]={'type':_0x405b5a(0xbe),'value':'this'},_0x404332=!![]);if(!_0x393c66){if(!_0xc3a508)throw CliErrors[_0x405b5a(0xd2)]('LrSmartJsx\x20node\x20\x22'+_0x3a9400['label']+'\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.',_0x405b5a(0xc1));if(_0x404332)_0x58fdc8+=0x1;continue;}const _0x2c66e6=!_0x2eb277||_0x393c66!==_0x276506,_0x377025=!_0xc3a508;if(!_0x2c66e6&&_0xc3a508&&_0x300610&&_0xc3a508!==_0x300610)throw CliErrors[_0x405b5a(0xd2)](_0x405b5a(0xd0)+_0x3a9400[_0x405b5a(0xdc)]+_0x405b5a(0xb4),_0x405b5a(0xbb));if(_0x2c66e6||_0x377025||!_0x300610){const _0x66338=readNonEmptyString(await _0x4801d5(_0x393c66));if(!_0x66338)throw CliErrors['apiError'](_0x405b5a(0xbc)+_0x3a9400['label']+'\x22.');_0x3a9400['render'][_0x405b5a(0xb0)]=_0x66338,_0x223347+=0x1,_0x404332=!![];}if(_0x404332)_0x58fdc8+=0x1;}if(_0x58fdc8===0x0)return{'content':_0x222c24,'compiledNodes':_0x223347,'normalizedNodes':_0x58fdc8};return{'content':JSON[_0x405b5a(0xc3)](_0x48cc98),'compiledNodes':_0x223347,'normalizedNodes':_0x58fdc8};}function parseSchema(_0x10d034,_0x4fe8d1){const _0x560e7e=a259_0x62a6;try{return JSON[_0x560e7e(0xc2)](_0x10d034);}catch{throw CliErrors[_0x560e7e(0xd2)](_0x560e7e(0xbd)+_0x4fe8d1+_0x560e7e(0xcf));}}function collectLrSmartJsx(_0x2e4eb3,_0x5480dd=![]){const _0xe6bde1=[],_0x22d5d3=(_0x145385,_0x42bb76)=>{const _0x4b97c1=a259_0x62a6;if(Array[_0x4b97c1(0xc0)](_0x145385)){_0x145385[_0x4b97c1(0xca)]((_0x3af341,_0x2f6079)=>_0x22d5d3(_0x3af341,_0x42bb76+'['+_0x2f6079+']'));return;}if(!isObject(_0x145385))return;if(_0x145385['componentName']==='LrSmartJsx'){const _0x259bd=readNonEmptyString(_0x145385['id']),_0xfe061a=_0x259bd||_0x42bb76,_0x57f096=isObject(_0x145385[_0x4b97c1(0xbf)])?_0x145385[_0x4b97c1(0xbf)]:undefined;if(!_0x57f096){if(_0x5480dd)throw CliErrors[_0x4b97c1(0xd2)]('LrSmartJsx\x20node\x20\x22'+_0xfe061a+_0x4b97c1(0xb6),'Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.');return;}const _0x345fa7=isObject(_0x57f096[_0x4b97c1(0xd6)])?_0x57f096[_0x4b97c1(0xd6)]:undefined;if(!_0x345fa7){if(_0x5480dd)throw CliErrors['validation'](_0x4b97c1(0xd0)+_0xfe061a+_0x4b97c1(0xda),_0x4b97c1(0xcd));return;}_0xe6bde1['push']({'key':_0x259bd?'id:'+_0x259bd:_0x4b97c1(0xd4)+_0x42bb76,'label':_0xfe061a,'props':_0x57f096,'render':_0x345fa7});}for(const [_0x540bff,_0x36112d]of Object[_0x4b97c1(0xd1)](_0x145385)){if(_0x540bff==='props'&&_0x145385[_0x4b97c1(0xc4)]==='LrSmartJsx')continue;_0x22d5d3(_0x36112d,_0x42bb76+'.'+_0x540bff);}};return _0x22d5d3(_0x2e4eb3,'$'),_0xe6bde1;}function isObject(_0xb3b5a5){const _0x5762d3=a259_0x62a6;return Boolean(_0xb3b5a5)&&typeof _0xb3b5a5==='object'&&!Array[_0x5762d3(0xc0)](_0xb3b5a5);}function a259_0x5639(){const _0x3edb68=['parse','stringify','componentName','15CqCCIv','type','5630KkwcJd','string','length','forEach','get','7763130LnaOnF','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','_context','\x20page\x20schema.','LrSmartJsx\x20node\x20\x22','entries','validation','key','path:','1227504CBXlxu','render','2650392lwbwqc','21QdYrFQ','391120vMcdCG','\x22\x20has\x20missing\x20or\x20invalid\x20props.render.','trim','label','value','local','69651wCxyZZ','source','\x22\x20has\x20a\x20manually\x20changed\x20render.value.','551674pMKeRf','\x22\x20has\x20missing\x20or\x20invalid\x20props.','JSFunction','1172669PpwBtN','this','map','Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.','LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22','Invalid\x20JSON\x20in\x20','JSExpression','props','isArray','Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.'];a259_0x5639=function(){return _0x3edb68;};return a259_0x5639();}function readNonEmptyString(_0x295539){const _0x5aa797=a259_0x62a6;return typeof _0x295539===_0x5aa797(0xc8)&&_0x295539[_0x5aa797(0xdb)]()?_0x295539:undefined;}function a259_0x62a6(_0x2fda90,_0x9bde6){_0x2fda90=_0x2fda90-0xb0;const _0x5639d2=a259_0x5639();let _0x62a66f=_0x5639d2[_0x2fda90];return _0x62a66f;}function isPageContextExpression(_0x234f58){const _0x3c41a5=a259_0x62a6;return isObject(_0x234f58)&&_0x234f58[_0x3c41a5(0xc6)]==='JSExpression'&&_0x234f58[_0x3c41a5(0xb0)]===_0x3c41a5(0xb9);}
@@ -1 +1 @@
1
- (function(_0x13ec86,_0x14f77a){const _0xb9d34a=a259_0x1e48,_0xf4fb0d=_0x13ec86();while(!![]){try{const _0x26db69=-parseInt(_0xb9d34a(0x101))/0x1*(-parseInt(_0xb9d34a(0x118))/0x2)+-parseInt(_0xb9d34a(0x137))/0x3*(parseInt(_0xb9d34a(0x124))/0x4)+parseInt(_0xb9d34a(0xf8))/0x5+parseInt(_0xb9d34a(0x11a))/0x6+-parseInt(_0xb9d34a(0x130))/0x7*(-parseInt(_0xb9d34a(0x138))/0x8)+-parseInt(_0xb9d34a(0x10b))/0x9*(-parseInt(_0xb9d34a(0x117))/0xa)+-parseInt(_0xb9d34a(0x12a))/0xb;if(_0x26db69===_0x14f77a)break;else _0xf4fb0d['push'](_0xf4fb0d['shift']());}catch(_0x2229f9){_0xf4fb0d['push'](_0xf4fb0d['shift']());}}}(a259_0x5caa,0xa68e3));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x5b857d,_0x1e390d){const _0x29216e=a259_0x1e48,_0x4cd640=[],_0x122f1b=normalizeSqlForStaticAnalysis(_0x5b857d),_0x558ba0=(_0x122f1b[_0x29216e(0xff)]?[]:extractJoinFacts(_0x122f1b[_0x29216e(0x10a)]))[_0x29216e(0x11d)](_0x7d9bb7=>{const _0x20a260=_0x29216e;if(_0x7d9bb7['unsupportedPredicate']||_0x7d9bb7['columns'][_0x20a260(0xfd)]===0x0)return _0x4cd640[_0x20a260(0x104)]({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x7d9bb7[_0x20a260(0xf3)],'alias':_0x7d9bb7[_0x20a260(0x105)],'columns':_0x7d9bb7[_0x20a260(0x111)],'reason':_0x7d9bb7[_0x20a260(0x112)]??_0x20a260(0xf7)}),{'table':_0x7d9bb7[_0x20a260(0xf3)],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x126)};const _0x3055a0=resolveTableMetadata(_0x1e390d,_0x7d9bb7[_0x20a260(0xf3)]),_0x5c3de9=(_0x3055a0?.['indexes']??[])[_0x20a260(0x11d)](_0x4a226f=>({'index':_0x4a226f,'matchedPrefix':findEqualityPrefix(_0x4a226f[_0x20a260(0x111)],_0x7d9bb7['columns'])}))['filter'](_0x24a682=>_0x24a682['matchedPrefix'][_0x20a260(0xfd)]>0x0),_0x230d00=_0x5c3de9['reduce']((_0x4dc502,_0x323d80)=>!_0x4dc502||_0x323d80[_0x20a260(0xf4)][_0x20a260(0xfd)]>_0x4dc502[_0x20a260(0xf4)][_0x20a260(0xfd)]?_0x323d80:_0x4dc502,_0x5c3de9[0x0]);if(_0x230d00)return{'table':_0x7d9bb7['table'],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x123),'matchedIndex':{..._0x230d00[_0x20a260(0xfc)],'matchedPrefix':_0x230d00[_0x20a260(0xf4)]}};const _0x2b8883=_0x3055a0?.[_0x20a260(0xf9)][_0x20a260(0x129)](_0xfcdc62=>_0xfcdc62['columns'][_0x20a260(0x12d)](_0x18ac08=>_0x7d9bb7[_0x20a260(0x111)][_0x20a260(0x12d)](_0x355cd3=>columnNamesMatch(_0x18ac08,_0x355cd3))))??[];if(_0x2b8883[_0x20a260(0xfd)]>0x0)return _0x4cd640[_0x20a260(0x104)]({'code':_0x20a260(0x109),'table':_0x7d9bb7['table'],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7[_0x20a260(0x111)],'reason':_0x20a260(0x133)}),{'table':_0x7d9bb7[_0x20a260(0xf3)],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x114),'candidateIndexes':_0x2b8883};if(_0x3055a0&&_0x3055a0['metadataAvailable']!==![]&&_0x3055a0[_0x20a260(0xf9)][_0x20a260(0xfd)]>0x0&&_0x7d9bb7[_0x20a260(0x111)][_0x20a260(0xfd)]>0x0)return _0x4cd640[_0x20a260(0x104)]({'code':_0x20a260(0x12b),'table':_0x7d9bb7['table'],'alias':_0x7d9bb7[_0x20a260(0x105)],'columns':_0x7d9bb7[_0x20a260(0x111)],'reason':_0x20a260(0xef)}),{'table':_0x7d9bb7['table'],'alias':_0x7d9bb7[_0x20a260(0x105)],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x114)};return _0x4cd640[_0x20a260(0x104)]({'code':_0x20a260(0xfa),'table':_0x7d9bb7[_0x20a260(0xf3)],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7['columns'],'reason':_0x3055a0?_0x20a260(0xf2):_0x20a260(0x103)}),{'table':_0x7d9bb7['table'],'alias':_0x7d9bb7[_0x20a260(0x105)],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x126)};});return{'checked':_0x558ba0[_0x29216e(0xfd)]>0x0,'joins':_0x558ba0,'warnings':_0x4cd640};}function extractJoinFacts(_0x35b29b){const _0x378eec=a259_0x1e48,_0x412979=maskNestedQueries(stripSqlNoise(_0x35b29b)),_0x2f5192=maskQuotedIdentifiers(_0x412979),_0x4aec17=[],_0x195614=new Set(),_0x3d09dc=/\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 _0x3f1781 of _0x412979[_0x378eec(0xec)](_0x3d09dc)){const _0x2ffa36=_0x3f1781[_0x378eec(0xfc)]??0x0,_0x5f5217=_0x3f1781[0x0][_0x378eec(0x10c)](/\bJOIN\b/i),_0x286708=_0x2ffa36+Math[_0x378eec(0x121)](0x0,_0x5f5217);if(!/^JOIN\b/i[_0x378eec(0xf6)](_0x2f5192['slice'](_0x286708)))continue;_0x195614[_0x378eec(0xf0)](_0x286708);const _0x92733c=normalizeIdentifier(_0x3f1781[0x1]||_0x378eec(0x10e)),_0x47429c=normalizeIdentifier(_0x3f1781[0x2]??''),_0x104ae8=normalizeIdentifier(_0x3f1781[0x3]||_0x47429c['split']('.')['at'](-0x1)||_0x47429c),_0x34697e=[],_0xc6ded8=_0x47429c===_0x378eec(0x136);let _0x147a5d=_0x92733c===_0x378eec(0x10f)||_0x92733c===_0x378eec(0xeb)||_0xc6ded8,_0x5ad6e0=_0x147a5d?_0xc6ded8?_0x378eec(0xed):_0x92733c[_0x378eec(0x119)]()+_0x378eec(0x12e):undefined;const _0xeef860=stripOuterParentheses(_0x3f1781[0x4]??''),_0x4194e1=_0xeef860[_0x378eec(0x12c)](MYBATIS_DYNAMIC_START_MARKER)||_0xeef860[_0x378eec(0x12c)](MYBATIS_DYNAMIC_END_MARKER),_0x3c0060=_0xeef860['includes'](MYBATIS_INCLUDE_MARKER);_0x4194e1&&(_0x147a5d=!![],_0x5ad6e0??=_0x378eec(0xf1));_0x3c0060&&(_0x147a5d=!![],_0x5ad6e0??=_0x378eec(0x132));const _0x3d94e2=_0xeef860['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x378eec(0x11b)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x3d94e2,'OR')&&(_0x147a5d=!![],_0x5ad6e0??=_0x378eec(0x134));for(const _0x1562d4 of splitTopLevelAnd(_0x3d94e2)){const _0x43357f=stripOuterParentheses(_0x1562d4);if(hasTopLevelKeyword(_0x43357f,'OR')){_0x147a5d=!![],_0x5ad6e0??=_0x378eec(0x134);continue;}const _0x485d19=splitEquality(_0x43357f);if(!_0x485d19){containsColumnReference(_0x1562d4,_0x104ae8)&&(_0x147a5d=!![]);continue;}const _0x2e9195=parseDirectColumnReference(_0x485d19[0x0],_0x104ae8),_0x88303=parseDirectColumnReference(_0x485d19[0x1],_0x104ae8),_0x308e11=containsColumnReference(_0x485d19[0x0],_0x104ae8),_0x138090=containsColumnReference(_0x485d19[0x1],_0x104ae8),_0x3588b7=_0x2e9195&&!_0x138090?_0x2e9195:_0x88303&&!_0x308e11?_0x88303:null;if(_0x3588b7&&!_0x34697e[_0x378eec(0x12c)](_0x3588b7))_0x34697e[_0x378eec(0x104)](_0x3588b7);else!_0x3588b7&&containsColumnReference(_0x1562d4,_0x104ae8)&&(_0x147a5d=!![]);}_0x4aec17[_0x378eec(0x104)]({'table':_0x47429c,'alias':_0x104ae8,'columns':_0x34697e,'unsupportedPredicate':_0x147a5d,'unsupportedReason':_0x5ad6e0,'containsUnresolvedInclude':_0x3c0060,'position':_0x286708});}for(const _0x49e1ff of _0x2f5192[_0x378eec(0xec)](/\bJOIN\b/gi)){const _0x254876=_0x49e1ff[_0x378eec(0xfc)]??0x0;if(_0x195614[_0x378eec(0x108)](_0x254876))continue;const _0x4ad92e=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0x412979[_0x378eec(0x102)](_0x254876+_0x49e1ff[0x0][_0x378eec(0xfd)])),_0x54ff34=normalizeIdentifier(_0x4ad92e?.[0x1]||_0x378eec(0x11e)),_0xec05fe=normalizeIdentifier(_0x4ad92e?.[0x2]||''),_0x123ee6=isSqlClauseKeyword(_0xec05fe)?_0x54ff34[_0x378eec(0x125)]('.')['at'](-0x1)||_0x54ff34:_0xec05fe||_0x54ff34[_0x378eec(0x125)]('.')['at'](-0x1)||_0x54ff34;_0x4aec17[_0x378eec(0x104)]({'table':_0x54ff34,'alias':_0x123ee6,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x254876});}const _0x20767f=_0x2f5192[_0x378eec(0x115)](MYBATIS_INCLUDE_MARKER);return _0x20767f>=0x0&&!_0x4aec17[_0x378eec(0x12d)](_0x2bb28e=>_0x2bb28e[_0x378eec(0x106)])&&_0x4aec17[_0x378eec(0x104)]({'table':_0x378eec(0x11e),'alias':_0x378eec(0x11e),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x378eec(0x131),'containsUnresolvedInclude':!![],'position':_0x20767f}),_0x4aec17['sort']((_0x42bdba,_0xdcdba6)=>_0x42bdba[_0x378eec(0x11c)]-_0xdcdba6[_0x378eec(0x11c)]);}function a259_0x1e48(_0x2471fe,_0x6636fc){_0x2471fe=_0x2471fe-0xea;const _0x5caa56=a259_0x5caa();let _0x1e4815=_0x5caa56[_0x2471fe];return _0x1e4815;}function stripSqlNoise(_0x51e47f){const _0x1eabdf=a259_0x1e48,_0x43a383=Array[_0x1eabdf(0x135)](_0x51e47f),_0x2dea8a=(_0x459e11,_0x4e483b)=>{for(let _0x6deb0d=_0x459e11;_0x6deb0d<_0x4e483b;_0x6deb0d+=0x1){_0x43a383[_0x6deb0d]!=='\x0a'&&_0x43a383[_0x6deb0d]!=='\x0d'&&(_0x43a383[_0x6deb0d]='\x20');}};for(let _0x44b55e=0x0;_0x44b55e<_0x43a383[_0x1eabdf(0xfd)];_0x44b55e+=0x1){const _0x55292e=_0x43a383[_0x44b55e],_0x294872=_0x43a383[_0x44b55e+0x1];if(_0x55292e==='\x27'||_0x55292e==='\x22'||_0x55292e==='`'){const _0x12efb1=_0x55292e,_0x45c561=_0x44b55e;_0x44b55e+=0x1;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]){if(_0x43a383[_0x44b55e]==='\x5c'&&_0x44b55e+0x1<_0x43a383[_0x1eabdf(0xfd)]){_0x44b55e+=0x2;continue;}if(_0x43a383[_0x44b55e]!==_0x12efb1){_0x44b55e+=0x1;continue;}if(_0x43a383[_0x44b55e+0x1]===_0x12efb1){_0x44b55e+=0x2;continue;}break;}if(_0x12efb1==='\x27')_0x2dea8a(_0x45c561,Math['min'](_0x44b55e+0x1,_0x43a383['length']));continue;}if(_0x55292e==='-'&&_0x294872==='-'){const _0x3d3e42=_0x44b55e;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]&&_0x43a383[_0x44b55e]!=='\x0a')_0x44b55e+=0x1;_0x2dea8a(_0x3d3e42,_0x44b55e);continue;}if(_0x55292e==='/'&&_0x294872==='*'){const _0x533771=_0x44b55e;_0x44b55e+=0x2;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]&&!(_0x43a383[_0x44b55e]==='*'&&_0x43a383[_0x44b55e+0x1]==='/')){_0x44b55e+=0x1;}_0x44b55e=Math[_0x1eabdf(0x12f)](_0x44b55e+0x1,_0x43a383[_0x1eabdf(0xfd)]-0x1),_0x2dea8a(_0x533771,_0x44b55e+0x1);continue;}if(_0x55292e==='#'&&_0x294872!=='{'){const _0xa03199=_0x44b55e;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]&&_0x43a383[_0x44b55e]!=='\x0a')_0x44b55e+=0x1;_0x2dea8a(_0xa03199,_0x44b55e);continue;}if((_0x55292e==='#'||_0x55292e==='$')&&_0x294872==='{'){const _0x5e1750=_0x44b55e;_0x44b55e+=0x2;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]&&_0x43a383[_0x44b55e]!=='}')_0x44b55e+=0x1;_0x2dea8a(_0x5e1750,Math[_0x1eabdf(0x12f)](_0x44b55e+0x1,_0x43a383[_0x1eabdf(0xfd)]));}}return _0x43a383[_0x1eabdf(0xfb)]('');}function maskQuotedIdentifiers(_0x2d1349){const _0x320195=a259_0x1e48,_0x3a67fc=Array[_0x320195(0x135)](_0x2d1349);for(let _0x5cc49c=0x0;_0x5cc49c<_0x3a67fc[_0x320195(0xfd)];_0x5cc49c+=0x1){const _0x370491=_0x3a67fc[_0x5cc49c];if(_0x370491!=='\x22'&&_0x370491!=='`')continue;_0x5cc49c+=0x1;while(_0x5cc49c<_0x3a67fc[_0x320195(0xfd)]){if(_0x3a67fc[_0x5cc49c]===_0x370491){if(_0x3a67fc[_0x5cc49c+0x1]===_0x370491){_0x3a67fc[_0x5cc49c]='\x20',_0x3a67fc[_0x5cc49c+0x1]='\x20',_0x5cc49c+=0x2;continue;}break;}_0x3a67fc[_0x5cc49c]='\x20',_0x5cc49c+=0x1;}}return _0x3a67fc[_0x320195(0xfb)]('');}function maskNestedQueries(_0xb62fc4){const _0x534b39=a259_0x1e48,_0xb90153=Array[_0x534b39(0x135)](_0xb62fc4);for(let _0x2bcaca=0x0;_0x2bcaca<_0xb90153[_0x534b39(0xfd)];_0x2bcaca+=0x1){if(_0xb90153[_0x2bcaca]!=='(')continue;const _0xb1225b=_0xb62fc4[_0x534b39(0x102)](_0x2bcaca+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x534b39(0xf6)](_0xb1225b))continue;let _0x33b36f=0x1,_0x314a6b=_0x2bcaca+0x1;for(;_0x314a6b<_0xb90153['length']&&_0x33b36f>0x0;_0x314a6b+=0x1){if(_0xb90153[_0x314a6b]==='(')_0x33b36f+=0x1;if(_0xb90153[_0x314a6b]===')')_0x33b36f-=0x1;}if(_0x33b36f!==0x0)continue;for(let _0x49f619=_0x2bcaca;_0x49f619<_0x314a6b;_0x49f619+=0x1){_0xb90153[_0x49f619]='\x20';}const _0x5b84ac=_0x534b39(0x136);for(let _0x4483d0=0x0;_0x4483d0<_0x5b84ac['length']&&_0x2bcaca+_0x4483d0<_0x314a6b;_0x4483d0+=0x1){_0xb90153[_0x2bcaca+_0x4483d0]=_0x5b84ac[_0x4483d0];}_0x2bcaca=_0x314a6b-0x1;}return _0xb90153['join']('');}function splitTopLevelAnd(_0x21d8ef){const _0x1dfeb5=a259_0x1e48,_0x20104b=[];let _0x1500e1=0x0,_0x3b6fe2=0x0;for(let _0x5ab60c=0x0;_0x5ab60c<_0x21d8ef[_0x1dfeb5(0xfd)];_0x5ab60c+=0x1){const _0x1b016c=_0x21d8ef[_0x5ab60c];if(_0x1b016c==='(')_0x1500e1+=0x1;if(_0x1b016c===')')_0x1500e1=Math[_0x1dfeb5(0x121)](0x0,_0x1500e1-0x1);_0x1500e1===0x0&&_0x21d8ef[_0x1dfeb5(0x102)](_0x5ab60c)[_0x1dfeb5(0x116)](/^AND\b/i)&&(_0x5ab60c===0x0||/\s/[_0x1dfeb5(0xf6)](_0x21d8ef[_0x5ab60c-0x1]??''))&&(_0x20104b[_0x1dfeb5(0x104)](_0x21d8ef[_0x1dfeb5(0x102)](_0x3b6fe2,_0x5ab60c)[_0x1dfeb5(0x100)]()),_0x5ab60c+=0x2,_0x3b6fe2=_0x5ab60c+0x1);}const _0x5a247e=_0x21d8ef[_0x1dfeb5(0x102)](_0x3b6fe2)[_0x1dfeb5(0x100)]();if(_0x5a247e)_0x20104b[_0x1dfeb5(0x104)](_0x5a247e);return _0x20104b;}function hasTopLevelKeyword(_0x3927b9,_0x4492e3){const _0xbafcd3=a259_0x1e48;let _0x114ac5=0x0;for(let _0x504718=0x0;_0x504718<_0x3927b9['length'];_0x504718+=0x1){const _0x4d934c=_0x3927b9[_0x504718];if(_0x4d934c==='(')_0x114ac5+=0x1;if(_0x4d934c===')')_0x114ac5=Math['max'](0x0,_0x114ac5-0x1);if(_0x114ac5!==0x0)continue;const _0x38ae8f=_0x3927b9['slice'](_0x504718,_0x504718+_0x4492e3['length']),_0x15d142=_0x3927b9[_0x504718-0x1]??'\x20',_0x1bc0e1=_0x3927b9[_0x504718+_0x4492e3[_0xbafcd3(0xfd)]]??'\x20';if(_0x38ae8f['toUpperCase']()===_0x4492e3['toUpperCase']()&&!/[\w$]/['test'](_0x15d142)&&!/[\w$]/[_0xbafcd3(0xf6)](_0x1bc0e1))return!![];}return![];}function splitEquality(_0xce940e){const _0x2fbb88=a259_0x1e48,_0x494859=stripOuterParentheses(_0xce940e);let _0x5a726a=0x0,_0x1f12dd;for(let _0xa38059=0x0;_0xa38059<_0x494859[_0x2fbb88(0xfd)];_0xa38059+=0x1){const _0x42a6d7=_0x494859[_0xa38059];if(_0x42a6d7==='(')_0x5a726a+=0x1;if(_0x42a6d7===')')_0x5a726a=Math['max'](0x0,_0x5a726a-0x1);const _0x4c9c92=_0x494859[_0xa38059-0x1]??'',_0x80aedc=_0x494859[_0xa38059+0x1]??'';if(_0x42a6d7==='='&&_0x5a726a===0x0&&!/[!<>=:]/[_0x2fbb88(0xf6)](_0x4c9c92)&&_0x80aedc!=='='){if(_0x1f12dd!==undefined)return null;_0x1f12dd=_0xa38059;}}return _0x1f12dd===undefined?null:[_0x494859[_0x2fbb88(0x102)](0x0,_0x1f12dd)[_0x2fbb88(0x100)](),_0x494859[_0x2fbb88(0x102)](_0x1f12dd+0x1)[_0x2fbb88(0x100)]()];}function parseDirectColumnReference(_0x15cf57,_0x48b6d0){const _0x495a0a=a259_0x1e48,_0x2bcc4f=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x495a0a(0x11f)](stripOuterParentheses(_0x15cf57));if(!_0x2bcc4f)return null;if(normalizeIdentifier(_0x2bcc4f[0x1]??'')!==normalizeIdentifier(_0x48b6d0))return null;return normalizeIdentifier(_0x2bcc4f[0x2]??'');}function a259_0x5caa(){const _0x5af95c=['1AJaONB','slice','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','push','alias','containsUnresolvedInclude','(?:^|[^\x5cw$])','has','JOIN_INDEX_NOT_USABLE','sql','26559SdJHKI','search','where','INNER','right','cross','columns','unsupportedReason','using','warning','indexOf','match','830efskbl','465346VuGyVD','toUpperCase','2009130uvJifL','replaceAll','position','map','unknown','exec','toLowerCase','max','left','covered','68bfNymA','split','unavailable','natural','tableName','filter','6430237GMAoSK','JOIN_INDEX_MISSING','includes','some','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','min','14bSyEIq','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','from','__sq__','141438ksqZHr','4323216vyNaZH','startsWith','full','matchAll','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','replace','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','add','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','table','matchedPrefix','endsWith','test','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','874975iqZAZJ','indexes','INDEX_METADATA_UNAVAILABLE','join','index','length','\x5cs*\x5c.\x5cs*[\x5cw$]+','error','trim'];a259_0x5caa=function(){return _0x5af95c;};return a259_0x5caa();}function containsColumnReference(_0x19ddd0,_0x45f269){const _0x13dbdd=a259_0x1e48,_0x5415cf=_0x19ddd0[_0x13dbdd(0xee)](/[`"]/g,''),_0x34cbe2=_0x45f269[_0x13dbdd(0xee)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x13dbdd(0x107)+_0x34cbe2+_0x13dbdd(0xfe),'i')[_0x13dbdd(0xf6)](_0x5415cf);}function findEqualityPrefix(_0x1ae108,_0x18b2c5){const _0x17baad=a259_0x1e48,_0x31e1e4=new Set(_0x18b2c5[_0x17baad(0x11d)](normalizeIdentifier)),_0xabb20d=[];for(const _0x13574c of _0x1ae108){if(!_0x31e1e4['has'](normalizeIdentifier(_0x13574c)))break;_0xabb20d['push'](_0x13574c);}return _0xabb20d;}function resolveTableMetadata(_0x2ed4ab,_0x2f6dbf){const _0x4b240a=a259_0x1e48,_0x39cb41=normalizeIdentifier(_0x2f6dbf),_0x408f02=_0x2ed4ab[_0x4b240a(0x129)](_0x972bde=>normalizeIdentifier(_0x972bde[_0x4b240a(0x128)])===_0x39cb41);if(_0x408f02[_0x4b240a(0xfd)]===0x1)return _0x408f02[0x0];const _0x47908d=_0x39cb41[_0x4b240a(0x12c)]('.'),_0x1fb51a=_0x39cb41['split']('.')['at'](-0x1),_0x39bbc4=_0x2ed4ab[_0x4b240a(0x129)](_0x39c7e1=>{const _0x4dc33d=_0x4b240a,_0x404acf=normalizeIdentifier(_0x39c7e1['tableName']);if(_0x47908d&&_0x404acf[_0x4dc33d(0x12c)]('.'))return![];return _0x404acf['split']('.')['at'](-0x1)===_0x1fb51a;});return _0x39bbc4[_0x4b240a(0xfd)]===0x1?_0x39bbc4[0x0]:undefined;}function columnNamesMatch(_0x35e7c9,_0x1c9f4b){return normalizeIdentifier(_0x35e7c9)===normalizeIdentifier(_0x1c9f4b);}function normalizeIdentifier(_0xf828f1){const _0xa848c1=a259_0x1e48;return _0xf828f1[_0xa848c1(0xee)](/[`"]/g,'')['trim']()[_0xa848c1(0x120)]();}function isSqlClauseKeyword(_0x1e77b8){const _0x108dee=a259_0x1e48;return new Set(['on',_0x108dee(0x113),_0x108dee(0x10d),_0x108dee(0xfb),'inner',_0x108dee(0x122),_0x108dee(0x10f),_0x108dee(0xeb),_0x108dee(0x110),_0x108dee(0x127)])[_0x108dee(0x108)](_0x1e77b8);}function stripOuterParentheses(_0xe949c1){const _0x1d874e=a259_0x1e48;let _0xf98686=_0xe949c1[_0x1d874e(0x100)]();while(_0xf98686[_0x1d874e(0xea)]('(')&&_0xf98686[_0x1d874e(0xf5)](')')){let _0x8f180b=0x0,_0x4a35ae=!![];for(let _0x5282d1=0x0;_0x5282d1<_0xf98686[_0x1d874e(0xfd)];_0x5282d1+=0x1){if(_0xf98686[_0x5282d1]==='(')_0x8f180b+=0x1;if(_0xf98686[_0x5282d1]===')')_0x8f180b-=0x1;if(_0x8f180b===0x0&&_0x5282d1<_0xf98686['length']-0x1){_0x4a35ae=![];break;}}if(!_0x4a35ae||_0x8f180b!==0x0)break;_0xf98686=_0xf98686[_0x1d874e(0x102)](0x1,-0x1)[_0x1d874e(0x100)]();}return _0xf98686;}
1
+ (function(_0x2960e3,_0x33511b){const _0x899893=a261_0x440a,_0x46517d=_0x2960e3();while(!![]){try{const _0x45827e=-parseInt(_0x899893(0x1aa))/0x1+-parseInt(_0x899893(0x170))/0x2*(-parseInt(_0x899893(0x1b4))/0x3)+parseInt(_0x899893(0x197))/0x4+-parseInt(_0x899893(0x199))/0x5*(-parseInt(_0x899893(0x18f))/0x6)+-parseInt(_0x899893(0x1a3))/0x7+-parseInt(_0x899893(0x19c))/0x8+-parseInt(_0x899893(0x175))/0x9*(-parseInt(_0x899893(0x18d))/0xa);if(_0x45827e===_0x33511b)break;else _0x46517d['push'](_0x46517d['shift']());}catch(_0xb099c4){_0x46517d['push'](_0x46517d['shift']());}}}(a261_0x11ef,0xc738c));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x30b602,_0x1dbaae){const _0x41b9e2=a261_0x440a,_0x30b9cb=[],_0x1f49e8=normalizeSqlForStaticAnalysis(_0x30b602),_0x3f4a13=(_0x1f49e8[_0x41b9e2(0x195)]?[]:extractJoinFacts(_0x1f49e8['sql']))[_0x41b9e2(0x1b6)](_0xd336d7=>{const _0x4ba8c6=_0x41b9e2;if(_0xd336d7['unsupportedPredicate']||_0xd336d7['columns']['length']===0x0)return _0x30b9cb[_0x4ba8c6(0x19d)]({'code':_0x4ba8c6(0x1ae),'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7['columns'],'reason':_0xd336d7[_0x4ba8c6(0x185)]??_0x4ba8c6(0x18a)}),{'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7[_0x4ba8c6(0x172)],'status':'unavailable'};const _0x164158=resolveTableMetadata(_0x1dbaae,_0xd336d7['table']),_0x24815d=(_0x164158?.[_0x4ba8c6(0x1a1)]??[])[_0x4ba8c6(0x1b6)](_0x1a7cab=>({'index':_0x1a7cab,'matchedPrefix':findEqualityPrefix(_0x1a7cab[_0x4ba8c6(0x172)],_0xd336d7[_0x4ba8c6(0x172)])}))[_0x4ba8c6(0x184)](_0x4e4abe=>_0x4e4abe['matchedPrefix']['length']>0x0),_0x3ba81d=_0x24815d[_0x4ba8c6(0x1b1)]((_0x80ed16,_0xa6ae32)=>!_0x80ed16||_0xa6ae32[_0x4ba8c6(0x177)][_0x4ba8c6(0x1a6)]>_0x80ed16[_0x4ba8c6(0x177)][_0x4ba8c6(0x1a6)]?_0xa6ae32:_0x80ed16,_0x24815d[0x0]);if(_0x3ba81d)return{'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7[_0x4ba8c6(0x172)],'status':_0x4ba8c6(0x1a2),'matchedIndex':{..._0x3ba81d['index'],'matchedPrefix':_0x3ba81d['matchedPrefix']}};const _0x58eb81=_0x164158?.[_0x4ba8c6(0x1a1)][_0x4ba8c6(0x184)](_0x2a0917=>_0x2a0917[_0x4ba8c6(0x172)]['some'](_0x50b2d0=>_0xd336d7[_0x4ba8c6(0x172)][_0x4ba8c6(0x187)](_0x2505c8=>columnNamesMatch(_0x50b2d0,_0x2505c8))))??[];if(_0x58eb81[_0x4ba8c6(0x1a6)]>0x0)return _0x30b9cb[_0x4ba8c6(0x19d)]({'code':_0x4ba8c6(0x176),'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7[_0x4ba8c6(0x172)],'reason':_0x4ba8c6(0x174)}),{'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7[_0x4ba8c6(0x172)],'status':_0x4ba8c6(0x1b5),'candidateIndexes':_0x58eb81};if(_0x164158&&_0x164158[_0x4ba8c6(0x1ba)]!==![]&&_0x164158[_0x4ba8c6(0x1a1)]['length']>0x0&&_0xd336d7['columns'][_0x4ba8c6(0x1a6)]>0x0)return _0x30b9cb[_0x4ba8c6(0x19d)]({'code':_0x4ba8c6(0x189),'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7[_0x4ba8c6(0x172)],'reason':_0x4ba8c6(0x1b2)}),{'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7['columns'],'status':_0x4ba8c6(0x1b5)};return _0x30b9cb[_0x4ba8c6(0x19d)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0xd336d7['table'],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7['columns'],'reason':_0x164158?_0x4ba8c6(0x180):_0x4ba8c6(0x1af)}),{'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7[_0x4ba8c6(0x172)],'status':_0x4ba8c6(0x19e)};});return{'checked':_0x3f4a13[_0x41b9e2(0x1a6)]>0x0,'joins':_0x3f4a13,'warnings':_0x30b9cb};}function extractJoinFacts(_0x439500){const _0x5468cc=a261_0x440a,_0x1f1032=maskNestedQueries(stripSqlNoise(_0x439500)),_0x23f670=maskQuotedIdentifiers(_0x1f1032),_0x4231a4=[],_0x58fcbb=new Set(),_0x13ab75=/\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 _0x17a4ba of _0x1f1032[_0x5468cc(0x1ab)](_0x13ab75)){const _0x5f4ead=_0x17a4ba[_0x5468cc(0x18e)]??0x0,_0x209f76=_0x17a4ba[0x0][_0x5468cc(0x1a9)](/\bJOIN\b/i),_0x9f1f7f=_0x5f4ead+Math['max'](0x0,_0x209f76);if(!/^JOIN\b/i[_0x5468cc(0x194)](_0x23f670[_0x5468cc(0x1ac)](_0x9f1f7f)))continue;_0x58fcbb[_0x5468cc(0x1a7)](_0x9f1f7f);const _0x208cc8=normalizeIdentifier(_0x17a4ba[0x1]||_0x5468cc(0x1b7)),_0x401159=normalizeIdentifier(_0x17a4ba[0x2]??''),_0x3da567=normalizeIdentifier(_0x17a4ba[0x3]||_0x401159[_0x5468cc(0x173)]('.')['at'](-0x1)||_0x401159),_0x266930=[],_0x32a5b3=_0x401159===_0x5468cc(0x186);let _0x3811f3=_0x208cc8===_0x5468cc(0x17d)||_0x208cc8===_0x5468cc(0x196)||_0x32a5b3,_0x26fe00=_0x3811f3?_0x32a5b3?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x208cc8[_0x5468cc(0x17b)]()+_0x5468cc(0x198):undefined;const _0x18ec35=stripOuterParentheses(_0x17a4ba[0x4]??''),_0x6cfcf2=_0x18ec35[_0x5468cc(0x190)](MYBATIS_DYNAMIC_START_MARKER)||_0x18ec35[_0x5468cc(0x190)](MYBATIS_DYNAMIC_END_MARKER),_0x59679a=_0x18ec35[_0x5468cc(0x190)](MYBATIS_INCLUDE_MARKER);_0x6cfcf2&&(_0x3811f3=!![],_0x26fe00??=_0x5468cc(0x1b3));_0x59679a&&(_0x3811f3=!![],_0x26fe00??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x4985c9=_0x18ec35[_0x5468cc(0x192)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x5468cc(0x192)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x5468cc(0x192)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x4985c9,'OR')&&(_0x3811f3=!![],_0x26fe00??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x53611f of splitTopLevelAnd(_0x4985c9)){const _0x1e07a1=stripOuterParentheses(_0x53611f);if(hasTopLevelKeyword(_0x1e07a1,'OR')){_0x3811f3=!![],_0x26fe00??=_0x5468cc(0x188);continue;}const _0x146264=splitEquality(_0x1e07a1);if(!_0x146264){containsColumnReference(_0x53611f,_0x3da567)&&(_0x3811f3=!![]);continue;}const _0x391f0b=parseDirectColumnReference(_0x146264[0x0],_0x3da567),_0x209ba4=parseDirectColumnReference(_0x146264[0x1],_0x3da567),_0x495019=containsColumnReference(_0x146264[0x0],_0x3da567),_0x5e444a=containsColumnReference(_0x146264[0x1],_0x3da567),_0x80ec37=_0x391f0b&&!_0x5e444a?_0x391f0b:_0x209ba4&&!_0x495019?_0x209ba4:null;if(_0x80ec37&&!_0x266930[_0x5468cc(0x190)](_0x80ec37))_0x266930['push'](_0x80ec37);else!_0x80ec37&&containsColumnReference(_0x53611f,_0x3da567)&&(_0x3811f3=!![]);}_0x4231a4[_0x5468cc(0x19d)]({'table':_0x401159,'alias':_0x3da567,'columns':_0x266930,'unsupportedPredicate':_0x3811f3,'unsupportedReason':_0x26fe00,'containsUnresolvedInclude':_0x59679a,'position':_0x9f1f7f});}for(const _0x1a8ac0 of _0x23f670[_0x5468cc(0x1ab)](/\bJOIN\b/gi)){const _0x1a34b4=_0x1a8ac0[_0x5468cc(0x18e)]??0x0;if(_0x58fcbb['has'](_0x1a34b4))continue;const _0x54fae9=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x5468cc(0x1b9)](_0x1f1032[_0x5468cc(0x1ac)](_0x1a34b4+_0x1a8ac0[0x0][_0x5468cc(0x1a6)])),_0x47a7c8=normalizeIdentifier(_0x54fae9?.[0x1]||'unknown'),_0x20ecac=normalizeIdentifier(_0x54fae9?.[0x2]||''),_0x3e728e=isSqlClauseKeyword(_0x20ecac)?_0x47a7c8[_0x5468cc(0x173)]('.')['at'](-0x1)||_0x47a7c8:_0x20ecac||_0x47a7c8[_0x5468cc(0x173)]('.')['at'](-0x1)||_0x47a7c8;_0x4231a4[_0x5468cc(0x19d)]({'table':_0x47a7c8,'alias':_0x3e728e,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x1a34b4});}const _0x2605cc=_0x23f670[_0x5468cc(0x191)](MYBATIS_INCLUDE_MARKER);return _0x2605cc>=0x0&&!_0x4231a4[_0x5468cc(0x187)](_0xed89b9=>_0xed89b9[_0x5468cc(0x1b8)])&&_0x4231a4[_0x5468cc(0x19d)]({'table':_0x5468cc(0x1a5),'alias':_0x5468cc(0x1a5),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x5468cc(0x17f),'containsUnresolvedInclude':!![],'position':_0x2605cc}),_0x4231a4[_0x5468cc(0x193)]((_0x283d3f,_0x11fbc6)=>_0x283d3f[_0x5468cc(0x178)]-_0x11fbc6[_0x5468cc(0x178)]);}function stripSqlNoise(_0x5001b){const _0x5bb265=a261_0x440a,_0x5601b4=Array[_0x5bb265(0x17a)](_0x5001b),_0x2176c0=(_0x2a3430,_0x57421f)=>{for(let _0x2fda3f=_0x2a3430;_0x2fda3f<_0x57421f;_0x2fda3f+=0x1){_0x5601b4[_0x2fda3f]!=='\x0a'&&_0x5601b4[_0x2fda3f]!=='\x0d'&&(_0x5601b4[_0x2fda3f]='\x20');}};for(let _0x212e77=0x0;_0x212e77<_0x5601b4[_0x5bb265(0x1a6)];_0x212e77+=0x1){const _0x2664de=_0x5601b4[_0x212e77],_0x49f30b=_0x5601b4[_0x212e77+0x1];if(_0x2664de==='\x27'||_0x2664de==='\x22'||_0x2664de==='`'){const _0x1af728=_0x2664de,_0x363e2b=_0x212e77;_0x212e77+=0x1;while(_0x212e77<_0x5601b4[_0x5bb265(0x1a6)]){if(_0x5601b4[_0x212e77]==='\x5c'&&_0x212e77+0x1<_0x5601b4[_0x5bb265(0x1a6)]){_0x212e77+=0x2;continue;}if(_0x5601b4[_0x212e77]!==_0x1af728){_0x212e77+=0x1;continue;}if(_0x5601b4[_0x212e77+0x1]===_0x1af728){_0x212e77+=0x2;continue;}break;}if(_0x1af728==='\x27')_0x2176c0(_0x363e2b,Math['min'](_0x212e77+0x1,_0x5601b4['length']));continue;}if(_0x2664de==='-'&&_0x49f30b==='-'){const _0x56084b=_0x212e77;while(_0x212e77<_0x5601b4[_0x5bb265(0x1a6)]&&_0x5601b4[_0x212e77]!=='\x0a')_0x212e77+=0x1;_0x2176c0(_0x56084b,_0x212e77);continue;}if(_0x2664de==='/'&&_0x49f30b==='*'){const _0x257777=_0x212e77;_0x212e77+=0x2;while(_0x212e77<_0x5601b4[_0x5bb265(0x1a6)]&&!(_0x5601b4[_0x212e77]==='*'&&_0x5601b4[_0x212e77+0x1]==='/')){_0x212e77+=0x1;}_0x212e77=Math['min'](_0x212e77+0x1,_0x5601b4[_0x5bb265(0x1a6)]-0x1),_0x2176c0(_0x257777,_0x212e77+0x1);continue;}if(_0x2664de==='#'&&_0x49f30b!=='{'){const _0x15976a=_0x212e77;while(_0x212e77<_0x5601b4[_0x5bb265(0x1a6)]&&_0x5601b4[_0x212e77]!=='\x0a')_0x212e77+=0x1;_0x2176c0(_0x15976a,_0x212e77);continue;}if((_0x2664de==='#'||_0x2664de==='$')&&_0x49f30b==='{'){const _0x2ba97b=_0x212e77;_0x212e77+=0x2;while(_0x212e77<_0x5601b4[_0x5bb265(0x1a6)]&&_0x5601b4[_0x212e77]!=='}')_0x212e77+=0x1;_0x2176c0(_0x2ba97b,Math[_0x5bb265(0x179)](_0x212e77+0x1,_0x5601b4[_0x5bb265(0x1a6)]));}}return _0x5601b4[_0x5bb265(0x1a4)]('');}function maskQuotedIdentifiers(_0x16bb25){const _0x5975f7=a261_0x440a,_0x523a4e=Array[_0x5975f7(0x17a)](_0x16bb25);for(let _0x3d4c21=0x0;_0x3d4c21<_0x523a4e['length'];_0x3d4c21+=0x1){const _0x2a0120=_0x523a4e[_0x3d4c21];if(_0x2a0120!=='\x22'&&_0x2a0120!=='`')continue;_0x3d4c21+=0x1;while(_0x3d4c21<_0x523a4e[_0x5975f7(0x1a6)]){if(_0x523a4e[_0x3d4c21]===_0x2a0120){if(_0x523a4e[_0x3d4c21+0x1]===_0x2a0120){_0x523a4e[_0x3d4c21]='\x20',_0x523a4e[_0x3d4c21+0x1]='\x20',_0x3d4c21+=0x2;continue;}break;}_0x523a4e[_0x3d4c21]='\x20',_0x3d4c21+=0x1;}}return _0x523a4e['join']('');}function maskNestedQueries(_0x38db4b){const _0x514a21=a261_0x440a,_0x477e3b=Array[_0x514a21(0x17a)](_0x38db4b);for(let _0x5369d0=0x0;_0x5369d0<_0x477e3b['length'];_0x5369d0+=0x1){if(_0x477e3b[_0x5369d0]!=='(')continue;const _0x9d347d=_0x38db4b[_0x514a21(0x1ac)](_0x5369d0+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x514a21(0x194)](_0x9d347d))continue;let _0x312ffc=0x1,_0x37110c=_0x5369d0+0x1;for(;_0x37110c<_0x477e3b[_0x514a21(0x1a6)]&&_0x312ffc>0x0;_0x37110c+=0x1){if(_0x477e3b[_0x37110c]==='(')_0x312ffc+=0x1;if(_0x477e3b[_0x37110c]===')')_0x312ffc-=0x1;}if(_0x312ffc!==0x0)continue;for(let _0x202da0=_0x5369d0;_0x202da0<_0x37110c;_0x202da0+=0x1){_0x477e3b[_0x202da0]='\x20';}const _0x26dc79='__sq__';for(let _0x181fa4=0x0;_0x181fa4<_0x26dc79[_0x514a21(0x1a6)]&&_0x5369d0+_0x181fa4<_0x37110c;_0x181fa4+=0x1){_0x477e3b[_0x5369d0+_0x181fa4]=_0x26dc79[_0x181fa4];}_0x5369d0=_0x37110c-0x1;}return _0x477e3b[_0x514a21(0x1a4)]('');}function a261_0x440a(_0x54c09b,_0x233342){_0x54c09b=_0x54c09b-0x16f;const _0x11efe1=a261_0x11ef();let _0x440a8f=_0x11efe1[_0x54c09b];return _0x440a8f;}function splitTopLevelAnd(_0x3e6d45){const _0x144021=a261_0x440a,_0x25377f=[];let _0x3606a2=0x0,_0x1015bb=0x0;for(let _0x224dde=0x0;_0x224dde<_0x3e6d45[_0x144021(0x1a6)];_0x224dde+=0x1){const _0x2d119d=_0x3e6d45[_0x224dde];if(_0x2d119d==='(')_0x3606a2+=0x1;if(_0x2d119d===')')_0x3606a2=Math[_0x144021(0x19a)](0x0,_0x3606a2-0x1);_0x3606a2===0x0&&_0x3e6d45['slice'](_0x224dde)[_0x144021(0x17e)](/^AND\b/i)&&(_0x224dde===0x0||/\s/[_0x144021(0x194)](_0x3e6d45[_0x224dde-0x1]??''))&&(_0x25377f[_0x144021(0x19d)](_0x3e6d45[_0x144021(0x1ac)](_0x1015bb,_0x224dde)['trim']()),_0x224dde+=0x2,_0x1015bb=_0x224dde+0x1);}const _0x4556e3=_0x3e6d45[_0x144021(0x1ac)](_0x1015bb)[_0x144021(0x18b)]();if(_0x4556e3)_0x25377f[_0x144021(0x19d)](_0x4556e3);return _0x25377f;}function hasTopLevelKeyword(_0x157324,_0x468185){const _0x1779f8=a261_0x440a;let _0x581e2c=0x0;for(let _0x1b9da0=0x0;_0x1b9da0<_0x157324[_0x1779f8(0x1a6)];_0x1b9da0+=0x1){const _0xaf658a=_0x157324[_0x1b9da0];if(_0xaf658a==='(')_0x581e2c+=0x1;if(_0xaf658a===')')_0x581e2c=Math[_0x1779f8(0x19a)](0x0,_0x581e2c-0x1);if(_0x581e2c!==0x0)continue;const _0x2c4d3c=_0x157324['slice'](_0x1b9da0,_0x1b9da0+_0x468185['length']),_0x250151=_0x157324[_0x1b9da0-0x1]??'\x20',_0x23fa05=_0x157324[_0x1b9da0+_0x468185[_0x1779f8(0x1a6)]]??'\x20';if(_0x2c4d3c['toUpperCase']()===_0x468185[_0x1779f8(0x17b)]()&&!/[\w$]/['test'](_0x250151)&&!/[\w$]/['test'](_0x23fa05))return!![];}return![];}function splitEquality(_0x138bcf){const _0x241361=a261_0x440a,_0x3b1d80=stripOuterParentheses(_0x138bcf);let _0x3e7af5=0x0,_0x3b2e2e;for(let _0x5ba7c6=0x0;_0x5ba7c6<_0x3b1d80['length'];_0x5ba7c6+=0x1){const _0xef5b0f=_0x3b1d80[_0x5ba7c6];if(_0xef5b0f==='(')_0x3e7af5+=0x1;if(_0xef5b0f===')')_0x3e7af5=Math['max'](0x0,_0x3e7af5-0x1);const _0x5d563e=_0x3b1d80[_0x5ba7c6-0x1]??'',_0x31fe32=_0x3b1d80[_0x5ba7c6+0x1]??'';if(_0xef5b0f==='='&&_0x3e7af5===0x0&&!/[!<>=:]/['test'](_0x5d563e)&&_0x31fe32!=='='){if(_0x3b2e2e!==undefined)return null;_0x3b2e2e=_0x5ba7c6;}}return _0x3b2e2e===undefined?null:[_0x3b1d80[_0x241361(0x1ac)](0x0,_0x3b2e2e)[_0x241361(0x18b)](),_0x3b1d80['slice'](_0x3b2e2e+0x1)['trim']()];}function parseDirectColumnReference(_0xbec0f5,_0x16a7c6){const _0x55b41e=a261_0x440a,_0x1910ed=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x55b41e(0x1b9)](stripOuterParentheses(_0xbec0f5));if(!_0x1910ed)return null;if(normalizeIdentifier(_0x1910ed[0x1]??'')!==normalizeIdentifier(_0x16a7c6))return null;return normalizeIdentifier(_0x1910ed[0x2]??'');}function a261_0x11ef(){const _0x3f8056=['columns','split','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','18otRVoS','JOIN_INDEX_NOT_USABLE','matchedPrefix','position','min','from','toUpperCase','left','right','match','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','toLowerCase','table','alias','filter','unsupportedReason','__sq__','some','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','JOIN_INDEX_MISSING','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','trim','where','9120470BzxXRx','index','156aItpHF','includes','indexOf','replaceAll','sort','test','error','full','386816PHiuDN','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','30845pdyNfz','max','inner','2402712Mxhjpa','push','unavailable','cross','has','indexes','covered','1715847bwKpYe','join','unknown','length','add','using','search','740722ErdUKV','matchAll','slice','endsWith','JOIN_PREDICATE_UNSUPPORTED','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','(?:^|[^\x5cw$])','reduce','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','3SRLDpk','warning','map','INNER','containsUnresolvedInclude','exec','metadataAvailable','tableName','replace','42004pYRXbw','startsWith'];a261_0x11ef=function(){return _0x3f8056;};return a261_0x11ef();}function containsColumnReference(_0x1ab5c4,_0x254888){const _0x336693=a261_0x440a,_0x580b06=_0x1ab5c4[_0x336693(0x16f)](/[`"]/g,''),_0x5b7e49=_0x254888[_0x336693(0x16f)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x336693(0x1b0)+_0x5b7e49+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x336693(0x194)](_0x580b06);}function findEqualityPrefix(_0x228162,_0x498a9f){const _0x20582c=a261_0x440a,_0x332613=new Set(_0x498a9f[_0x20582c(0x1b6)](normalizeIdentifier)),_0x1ad9e1=[];for(const _0x191e7a of _0x228162){if(!_0x332613[_0x20582c(0x1a0)](normalizeIdentifier(_0x191e7a)))break;_0x1ad9e1[_0x20582c(0x19d)](_0x191e7a);}return _0x1ad9e1;}function resolveTableMetadata(_0x133165,_0x57652c){const _0x505f01=a261_0x440a,_0x331bd7=normalizeIdentifier(_0x57652c),_0x32c71f=_0x133165[_0x505f01(0x184)](_0x2286f6=>normalizeIdentifier(_0x2286f6['tableName'])===_0x331bd7);if(_0x32c71f[_0x505f01(0x1a6)]===0x1)return _0x32c71f[0x0];const _0x33d84e=_0x331bd7[_0x505f01(0x190)]('.'),_0x22fe2d=_0x331bd7[_0x505f01(0x173)]('.')['at'](-0x1),_0x5a280b=_0x133165['filter'](_0x4f982e=>{const _0x7dcc07=_0x505f01,_0x203227=normalizeIdentifier(_0x4f982e[_0x7dcc07(0x1bb)]);if(_0x33d84e&&_0x203227[_0x7dcc07(0x190)]('.'))return![];return _0x203227[_0x7dcc07(0x173)]('.')['at'](-0x1)===_0x22fe2d;});return _0x5a280b[_0x505f01(0x1a6)]===0x1?_0x5a280b[0x0]:undefined;}function columnNamesMatch(_0x180ca3,_0x59339e){return normalizeIdentifier(_0x180ca3)===normalizeIdentifier(_0x59339e);}function normalizeIdentifier(_0x427214){const _0x58e9ad=a261_0x440a;return _0x427214['replace'](/[`"]/g,'')[_0x58e9ad(0x18b)]()[_0x58e9ad(0x181)]();}function isSqlClauseKeyword(_0x231a1e){const _0x179d8a=a261_0x440a;return new Set(['on',_0x179d8a(0x1a8),_0x179d8a(0x18c),'join',_0x179d8a(0x19b),_0x179d8a(0x17c),_0x179d8a(0x17d),_0x179d8a(0x196),_0x179d8a(0x19f),'natural'])[_0x179d8a(0x1a0)](_0x231a1e);}function stripOuterParentheses(_0xcbe5bc){const _0x33814e=a261_0x440a;let _0x44f278=_0xcbe5bc[_0x33814e(0x18b)]();while(_0x44f278[_0x33814e(0x171)]('(')&&_0x44f278[_0x33814e(0x1ad)](')')){let _0x4565dd=0x0,_0x1aa6a8=!![];for(let _0x28e81c=0x0;_0x28e81c<_0x44f278[_0x33814e(0x1a6)];_0x28e81c+=0x1){if(_0x44f278[_0x28e81c]==='(')_0x4565dd+=0x1;if(_0x44f278[_0x28e81c]===')')_0x4565dd-=0x1;if(_0x4565dd===0x0&&_0x28e81c<_0x44f278[_0x33814e(0x1a6)]-0x1){_0x1aa6a8=![];break;}}if(!_0x1aa6a8||_0x4565dd!==0x0)break;_0x44f278=_0x44f278['slice'](0x1,-0x1)[_0x33814e(0x18b)]();}return _0x44f278;}
@@ -1 +1 @@
1
- const a260_0x163a26=a260_0x5cad;function a260_0x2e8a(){const _0x371a70=['6284nAiZWD','54xSSsKV','sql-trash','12727VYejFF','sql.lock.json','/sql','903BVbgEG','.rabetbase','662UWNwlt','84cmtfpY','535384lhkhgA','80460GRaiYt','10709244LvRAvs','2810ZTRTKC','2086400CjGJWA','1499oUlQDP'];a260_0x2e8a=function(){return _0x371a70;};return a260_0x2e8a();}(function(_0x4208af,_0x4c2603){const _0x26d2eb=a260_0x5cad,_0x4f343a=_0x4208af();while(!![]){try{const _0x29f767=parseInt(_0x26d2eb(0x9c))/0x1*(parseInt(_0x26d2eb(0x95))/0x2)+-parseInt(_0x26d2eb(0x93))/0x3*(-parseInt(_0x26d2eb(0x9d))/0x4)+parseInt(_0x26d2eb(0x9b))/0x5+parseInt(_0x26d2eb(0x98))/0x6*(-parseInt(_0x26d2eb(0x96))/0x7)+-parseInt(_0x26d2eb(0x97))/0x8*(parseInt(_0x26d2eb(0x9e))/0x9)+-parseInt(_0x26d2eb(0x9a))/0xa*(-parseInt(_0x26d2eb(0x90))/0xb)+-parseInt(_0x26d2eb(0x99))/0xc;if(_0x29f767===_0x4c2603)break;else _0x4f343a['push'](_0x4f343a['shift']());}catch(_0x31c06a){_0x4f343a['push'](_0x4f343a['shift']());}}}(a260_0x2e8a,0x3ea1e));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a260_0x5cad(_0x2817f6,_0x5ca7bd){_0x2817f6=_0x2817f6-0x8f;const _0x2e8ae=a260_0x2e8a();let _0x5cad2c=_0x2e8ae[_0x2817f6];return _0x5cad2c;}const DOT_DIR=a260_0x163a26(0x94),LOCK_FILE_NAME=a260_0x163a26(0x91),TRASH_DIR_NAME=a260_0x163a26(0x8f);export function loadSqlProjectConfig(_0x5ae87c,_0x4c9af4){const _0x2612b4=a260_0x163a26,_0x30f807=resolve(_0x4c9af4??findProjectRootDirectory()),_0x58b8af=DOT_DIR+_0x2612b4(0x92),_0x4a28bb=_0x58b8af+'/'+_0x5ae87c;return{'projectRoot':_0x30f807,'appCode':_0x5ae87c,'sqlWorkspaceRoot':_0x58b8af,'sqlRoot':_0x4a28bb,'sqlRootDir':resolve(_0x30f807,DOT_DIR,'sql',_0x5ae87c),'lockFilePath':resolve(_0x30f807,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x30f807,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a262_0x5bf1f3=a262_0x5a54;(function(_0x416011,_0x1c9830){const _0x28ea8c=a262_0x5a54,_0x334611=_0x416011();while(!![]){try{const _0x12fe1f=parseInt(_0x28ea8c(0x1e4))/0x1*(-parseInt(_0x28ea8c(0x1ec))/0x2)+-parseInt(_0x28ea8c(0x1e3))/0x3+-parseInt(_0x28ea8c(0x1df))/0x4*(-parseInt(_0x28ea8c(0x1e1))/0x5)+parseInt(_0x28ea8c(0x1e7))/0x6*(-parseInt(_0x28ea8c(0x1ea))/0x7)+-parseInt(_0x28ea8c(0x1e6))/0x8+parseInt(_0x28ea8c(0x1e8))/0x9+parseInt(_0x28ea8c(0x1e5))/0xa;if(_0x12fe1f===_0x1c9830)break;else _0x334611['push'](_0x334611['shift']());}catch(_0x2a1738){_0x334611['push'](_0x334611['shift']());}}}(a262_0x2e41,0x3e37e));function a262_0x2e41(){const _0x2f79ef=['10cbBXrX','.rabetbase','1059333VvFUUx','14fDKoIr','6425280zwcrEn','2465208qeHjSX','36qKpblk','3551652mxtjuW','sql.lock.json','495285qeQqoa','/sql','10812eURqJR','758332BCSKGU','sql'];a262_0x2e41=function(){return _0x2f79ef;};return a262_0x2e41();}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a262_0x5bf1f3(0x1e2),LOCK_FILE_NAME=a262_0x5bf1f3(0x1e9),TRASH_DIR_NAME='sql-trash';function a262_0x5a54(_0x456bd6,_0x6b3142){_0x456bd6=_0x456bd6-0x1df;const _0x2e41d4=a262_0x2e41();let _0x5a541d=_0x2e41d4[_0x456bd6];return _0x5a541d;}export function loadSqlProjectConfig(_0x569752,_0x127232){const _0x269879=a262_0x5bf1f3,_0x133b8a=resolve(_0x127232??findProjectRootDirectory()),_0x1f9167=DOT_DIR+_0x269879(0x1eb),_0x1f1282=_0x1f9167+'/'+_0x569752;return{'projectRoot':_0x133b8a,'appCode':_0x569752,'sqlWorkspaceRoot':_0x1f9167,'sqlRoot':_0x1f1282,'sqlRootDir':resolve(_0x133b8a,DOT_DIR,_0x269879(0x1e0),_0x569752),'lockFilePath':resolve(_0x133b8a,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x133b8a,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x1b9305,_0x1be779){const _0x131b3f=a261_0x1390,_0x43b3de=_0x1b9305();while(!![]){try{const _0x258acf=parseInt(_0x131b3f(0xb6))/0x1+parseInt(_0x131b3f(0xb7))/0x2+-parseInt(_0x131b3f(0xa1))/0x3+parseInt(_0x131b3f(0xbc))/0x4+-parseInt(_0x131b3f(0xaa))/0x5*(parseInt(_0x131b3f(0xbb))/0x6)+-parseInt(_0x131b3f(0xb8))/0x7+parseInt(_0x131b3f(0xad))/0x8*(-parseInt(_0x131b3f(0xbd))/0x9);if(_0x258acf===_0x1be779)break;else _0x43b3de['push'](_0x43b3de['shift']());}catch(_0x599edc){_0x43b3de['push'](_0x43b3de['shift']());}}}(a261_0x1bd5,0x5c5f6));import{readdir,stat}from'node:fs/promises';function a261_0x1bd5(){const _0x2ccf36=['1012713bLokQR','test','code','mybatisXml','mode','length','dbName','push','split','183530WjdWjL','toLowerCase','name','25832RIUgQE','dbId','isDirectory','sqlName','isFile','indexOf','.sql','sqlCode','filter','583688jrOcDj','214718RskFfN','1696996RUxOds','sqlRootDir','slice','6NPbarI','2559328XeFdMd','936EHCqaP','sql'];a261_0x1bd5=function(){return _0x2ccf36;};return a261_0x1bd5();}import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x1778fa){const _0x5e7370=a261_0x1390;if(_0x1778fa===_0x5e7370(0xb3))return _0x5e7370(0xbe);if(_0x1778fa==='.xml')return _0x5e7370(0xa4);return undefined;}async function scanSqlFilesRecursively(_0x5b544c,_0x1d521c){const _0x1cd9e2=a261_0x1390,_0x1a2575=[];try{const _0x5a1df9=await readdir(_0x5b544c,{'withFileTypes':!![]});for(const _0x3ee84c of _0x5a1df9){const _0x212702=join(_0x5b544c,_0x3ee84c[_0x1cd9e2(0xac)]);if(_0x3ee84c[_0x1cd9e2(0xaf)]()){_0x1a2575[_0x1cd9e2(0xa8)](...await scanSqlFilesRecursively(_0x212702,_0x1d521c));continue;}if(!_0x3ee84c[_0x1cd9e2(0xb1)]())continue;const _0x132a0c=extname(_0x3ee84c[_0x1cd9e2(0xac)])[_0x1cd9e2(0xab)](),_0x4f6a3c=extensionToMode(_0x132a0c);if(!_0x4f6a3c)continue;const _0x250c0e=relative(_0x1d521c,_0x212702)['replace'](/\\/g,'/'),_0x2036e3=_0x250c0e[_0x1cd9e2(0xa9)]('/')[_0x1cd9e2(0xb5)](Boolean),_0x4c5125=parseSqlPath(_0x2036e3,_0x3ee84c[_0x1cd9e2(0xac)],_0x132a0c);if(!_0x4c5125)continue;_0x1a2575['push']({'sqlCode':_0x4c5125[_0x1cd9e2(0xb4)],'sqlName':_0x4c5125[_0x1cd9e2(0xb0)],'dbDirectory':_0x2036e3[0x0],'filePath':_0x212702,'relativePath':_0x250c0e,'lockKey':_0x4c5125[_0x1cd9e2(0xb4)],'mode':_0x4f6a3c});}}catch(_0x1b40c7){if(_0x1b40c7[_0x1cd9e2(0xa3)]!=='ENOENT')throw _0x1b40c7;}return _0x1a2575;}function a261_0x1390(_0x56f97c,_0x13e3f4){_0x56f97c=_0x56f97c-0xa1;const _0x1bd5e8=a261_0x1bd5();let _0x139039=_0x1bd5e8[_0x56f97c];return _0x139039;}export async function scanLocalSqlQueries(_0x49560a){const _0xbea759=a261_0x1390;return scanSqlFilesRecursively(_0x49560a[_0xbea759(0xb9)],_0x49560a[_0xbea759(0xb9)]);}export function resolveLocalSqlFilePath(_0x1d802c,_0x25a029,_0x4dec36){const _0x2c3bc9=a261_0x1390,_0x99c495=_0x4dec36?.['path']||(_0x4dec36?.[_0x2c3bc9(0xb0)]||_0x4dec36?.[_0x2c3bc9(0xa7)]?buildSqlRelativePath(_0x25a029,_0x4dec36?.[_0x2c3bc9(0xb0)],_0x4dec36?.['dbName'],_0x4dec36?.[_0x2c3bc9(0xa5)]||'sql',_0x4dec36?.[_0x2c3bc9(0xae)]):buildDefaultSqlFileName(_0x25a029,_0x4dec36?.[_0x2c3bc9(0xa5)]||_0x2c3bc9(0xbe)));return join(_0x1d802c[_0x2c3bc9(0xb9)],_0x99c495);}export async function directoryExists(_0x3a3632){const _0x8003ee=a261_0x1390;try{const _0x411ab5=await stat(_0x3a3632);return _0x411ab5[_0x8003ee(0xaf)]();}catch{return![];}}function parseSqlPath(_0x3cce23,_0x2dabe6,_0xadf0b7){const _0x12b042=a261_0x1390,_0x5aabbd=_0x2dabe6['slice'](0x0,-_0xadf0b7[_0x12b042(0xa6)]);if(_0x3cce23[_0x12b042(0xa6)]<0x2)return null;const _0x1ac067=_0x5aabbd[_0x12b042(0xb2)]('_');if(_0x1ac067<=0x0||_0x1ac067>=_0x5aabbd[_0x12b042(0xa6)]-0x1)return null;const _0x10724d=_0x5aabbd['slice'](0x0,_0x1ac067);if(!isLikelySqlCode(_0x10724d))return null;return{'sqlCode':_0x10724d,'sqlName':_0x5aabbd[_0x12b042(0xba)](_0x1ac067+0x1)};}function isLikelySqlCode(_0x564b82){const _0x5a7582=a261_0x1390;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x5a7582(0xa2)](_0x564b82);}
1
+ (function(_0x5f2ce2,_0x3c09cd){const _0x3cb069=a263_0x4570,_0x5b39bb=_0x5f2ce2();while(!![]){try{const _0x5936d1=parseInt(_0x3cb069(0xaa))/0x1*(parseInt(_0x3cb069(0xc4))/0x2)+-parseInt(_0x3cb069(0xa9))/0x3+parseInt(_0x3cb069(0xac))/0x4*(-parseInt(_0x3cb069(0xb8))/0x5)+-parseInt(_0x3cb069(0xc3))/0x6*(parseInt(_0x3cb069(0xaf))/0x7)+-parseInt(_0x3cb069(0xb1))/0x8*(-parseInt(_0x3cb069(0xc2))/0x9)+parseInt(_0x3cb069(0xba))/0xa*(parseInt(_0x3cb069(0xa7))/0xb)+parseInt(_0x3cb069(0xad))/0xc;if(_0x5936d1===_0x3c09cd)break;else _0x5b39bb['push'](_0x5b39bb['shift']());}catch(_0x662e82){_0x5b39bb['push'](_0x5b39bb['shift']());}}}(a263_0x4e8c,0xe9ff5));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x53e6d2){const _0x4bb234=a263_0x4570;if(_0x53e6d2===_0x4bb234(0xb7))return _0x4bb234(0xb2);if(_0x53e6d2===_0x4bb234(0xb5))return _0x4bb234(0xc5);return undefined;}function a263_0x4570(_0x3fcdab,_0x17c908){_0x3fcdab=_0x3fcdab-0xa7;const _0x4e8ce2=a263_0x4e8c();let _0x4570d7=_0x4e8ce2[_0x3fcdab];return _0x4570d7;}async function scanSqlFilesRecursively(_0x31bd41,_0x19a530){const _0x25b329=a263_0x4570,_0x4d3823=[];try{const _0x1fc0c1=await readdir(_0x31bd41,{'withFileTypes':!![]});for(const _0x2cb42b of _0x1fc0c1){const _0x32caf8=join(_0x31bd41,_0x2cb42b[_0x25b329(0xbe)]);if(_0x2cb42b['isDirectory']()){_0x4d3823['push'](...await scanSqlFilesRecursively(_0x32caf8,_0x19a530));continue;}if(!_0x2cb42b['isFile']())continue;const _0x244d19=extname(_0x2cb42b[_0x25b329(0xbe)])[_0x25b329(0xb9)](),_0x487b01=extensionToMode(_0x244d19);if(!_0x487b01)continue;const _0x4e173d=relative(_0x19a530,_0x32caf8)[_0x25b329(0xb4)](/\\/g,'/'),_0x436e8d=_0x4e173d[_0x25b329(0xc1)]('/')[_0x25b329(0xa8)](Boolean),_0x145396=parseSqlPath(_0x436e8d,_0x2cb42b[_0x25b329(0xbe)],_0x244d19);if(!_0x145396)continue;_0x4d3823['push']({'sqlCode':_0x145396[_0x25b329(0xc6)],'sqlName':_0x145396[_0x25b329(0xc0)],'dbDirectory':_0x436e8d[0x0],'filePath':_0x32caf8,'relativePath':_0x4e173d,'lockKey':_0x145396[_0x25b329(0xc6)],'mode':_0x487b01});}}catch(_0x4f3e4d){if(_0x4f3e4d['code']!==_0x25b329(0xbc))throw _0x4f3e4d;}return _0x4d3823;}export async function scanLocalSqlQueries(_0x2bb64f){const _0x4295bd=a263_0x4570;return scanSqlFilesRecursively(_0x2bb64f[_0x4295bd(0xb3)],_0x2bb64f[_0x4295bd(0xb3)]);}export function resolveLocalSqlFilePath(_0x57efd4,_0x3ce81f,_0x4c83a5){const _0x384596=a263_0x4570,_0x4678b2=_0x4c83a5?.[_0x384596(0xb6)]||(_0x4c83a5?.['sqlName']||_0x4c83a5?.[_0x384596(0xbf)]?buildSqlRelativePath(_0x3ce81f,_0x4c83a5?.[_0x384596(0xc0)],_0x4c83a5?.[_0x384596(0xbf)],_0x4c83a5?.[_0x384596(0xbb)]||_0x384596(0xb2),_0x4c83a5?.[_0x384596(0xae)]):buildDefaultSqlFileName(_0x3ce81f,_0x4c83a5?.[_0x384596(0xbb)]||_0x384596(0xb2)));return join(_0x57efd4['sqlRootDir'],_0x4678b2);}export async function directoryExists(_0x375666){try{const _0x2e1f6d=await stat(_0x375666);return _0x2e1f6d['isDirectory']();}catch{return![];}}function parseSqlPath(_0x43d603,_0x33fc71,_0x2c2ebd){const _0x461138=a263_0x4570,_0x4815e8=_0x33fc71[_0x461138(0xb0)](0x0,-_0x2c2ebd[_0x461138(0xbd)]);if(_0x43d603[_0x461138(0xbd)]<0x2)return null;const _0x414100=_0x4815e8['indexOf']('_');if(_0x414100<=0x0||_0x414100>=_0x4815e8[_0x461138(0xbd)]-0x1)return null;const _0x4926ac=_0x4815e8[_0x461138(0xb0)](0x0,_0x414100);if(!isLikelySqlCode(_0x4926ac))return null;return{'sqlCode':_0x4926ac,'sqlName':_0x4815e8[_0x461138(0xb0)](_0x414100+0x1)};}function a263_0x4e8c(){const _0x331247=['288UjebBc','6qmMOmo','2cKmbnu','mybatisXml','sqlCode','18210126fdcmdA','filter','2516574JRjyuL','1094459NeKQpj','test','5164596NCwXyd','4238532xSiEbp','dbId','5541004KuhgVi','slice','194224DVVTjA','sql','sqlRootDir','replace','.xml','path','.sql','5INTxdO','toLowerCase','10DWzbCy','mode','ENOENT','length','name','dbName','sqlName','split'];a263_0x4e8c=function(){return _0x331247;};return a263_0x4e8c();}function isLikelySqlCode(_0x22211b){const _0x16f3fb=a263_0x4570;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x16f3fb(0xab)](_0x22211b);}
@@ -1 +1 @@
1
- (function(_0x20d21d,_0x1c6e2a){const _0xffd812=a262_0xa48f,_0x3e7911=_0x20d21d();while(!![]){try{const _0x7f9f21=parseInt(_0xffd812(0x122))/0x1+-parseInt(_0xffd812(0x11e))/0x2*(parseInt(_0xffd812(0x120))/0x3)+-parseInt(_0xffd812(0x124))/0x4+parseInt(_0xffd812(0x121))/0x5+-parseInt(_0xffd812(0x127))/0x6+parseInt(_0xffd812(0x11f))/0x7+parseInt(_0xffd812(0x125))/0x8;if(_0x7f9f21===_0x1c6e2a)break;else _0x3e7911['push'](_0x3e7911['shift']());}catch(_0x5acafb){_0x3e7911['push'](_0x3e7911['shift']());}}}(a262_0x4fbb,0xc0e0b));import{readFile}from'node:fs/promises';function a262_0xa48f(_0x4c0f7f,_0x18db7e){_0x4c0f7f=_0x4c0f7f-0x11d;const _0x4fbbb5=a262_0x4fbb();let _0xa48f27=_0x4fbbb5[_0x4c0f7f];return _0xa48f27;}import a262_0x84156d from'node:crypto';export function computeSqlContentHash(_0x2c5570){const _0xfe31ae=a262_0xa48f;return a262_0x84156d[_0xfe31ae(0x126)](_0xfe31ae(0x123))[_0xfe31ae(0x11d)](_0x2c5570)['digest']('hex');}function a262_0x4fbb(){const _0x2e8fab=['422352OSybYp','6812130cIzNcm','1504547HrKoBs','md5','2470164CsfkqD','2645832WGBMAz','createHash','9058722bQUUtk','utf8','update','16EZbuQw','5921475FnOyhQ'];a262_0x4fbb=function(){return _0x2e8fab;};return a262_0x4fbb();}export async function computeSqlFileHash(_0x24a2fa){const _0x57744c=a262_0xa48f,_0x3af6dc=await readFile(_0x24a2fa,_0x57744c(0x128));return computeSqlContentHash(_0x3af6dc);}
1
+ (function(_0x1301fa,_0x3c2fad){const _0x400422=a264_0x4e8e,_0x3739d8=_0x1301fa();while(!![]){try{const _0x1510e6=parseInt(_0x400422(0x1dd))/0x1*(-parseInt(_0x400422(0x1df))/0x2)+parseInt(_0x400422(0x1d8))/0x3+parseInt(_0x400422(0x1da))/0x4+parseInt(_0x400422(0x1db))/0x5+-parseInt(_0x400422(0x1e1))/0x6*(-parseInt(_0x400422(0x1e4))/0x7)+parseInt(_0x400422(0x1d9))/0x8+parseInt(_0x400422(0x1e3))/0x9*(-parseInt(_0x400422(0x1e0))/0xa);if(_0x1510e6===_0x3c2fad)break;else _0x3739d8['push'](_0x3739d8['shift']());}catch(_0x206c2a){_0x3739d8['push'](_0x3739d8['shift']());}}}(a264_0x4fc3,0x840d3));import{readFile}from'node:fs/promises';import a264_0x297fe0 from'node:crypto';export function computeSqlContentHash(_0x34ea46){const _0x4b5fbe=a264_0x4e8e;return a264_0x297fe0['createHash'](_0x4b5fbe(0x1de))[_0x4b5fbe(0x1dc)](_0x34ea46)['digest']('hex');}function a264_0x4fc3(){const _0x47b40c=['2455176OiYszx','4893765pgIJeo','update','6oMOvha','md5','168106DZGtqm','30tbIhcE','745530fNpfNI','utf8','5217489hFLhLD','7ywRqtm','1671375tlwlvg','4083496wXTnZh'];a264_0x4fc3=function(){return _0x47b40c;};return a264_0x4fc3();}function a264_0x4e8e(_0x57e3de,_0x52da34){_0x57e3de=_0x57e3de-0x1d8;const _0x4fc3e9=a264_0x4fc3();let _0x4e8ec=_0x4fc3e9[_0x57e3de];return _0x4e8ec;}export async function computeSqlFileHash(_0x372c30){const _0x54a946=a264_0x4e8e,_0x3db966=await readFile(_0x372c30,_0x54a946(0x1e2));return computeSqlContentHash(_0x3db966);}
@@ -1 +1 @@
1
- (function(_0xf7440d,_0x19950e){const _0x399c49=a263_0x31f2,_0x493273=_0xf7440d();while(!![]){try{const _0x5de28b=parseInt(_0x399c49(0x180))/0x1*(-parseInt(_0x399c49(0x185))/0x2)+-parseInt(_0x399c49(0x189))/0x3+parseInt(_0x399c49(0x182))/0x4+parseInt(_0x399c49(0x183))/0x5+parseInt(_0x399c49(0x18f))/0x6*(parseInt(_0x399c49(0x186))/0x7)+parseInt(_0x399c49(0x17c))/0x8*(-parseInt(_0x399c49(0x190))/0x9)+-parseInt(_0x399c49(0x17f))/0xa*(-parseInt(_0x399c49(0x187))/0xb);if(_0x5de28b===_0x19950e)break;else _0x493273['push'](_0x493273['shift']());}catch(_0x226d89){_0x493273['push'](_0x493273['shift']());}}}(a263_0x180e,0x76da2));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}function a263_0x180e(){const _0x5cce45=['2640510BWSPuB','4LOWOlA',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','3617476EOfnJi','231685wDbZHW','ENOENT','164972ukXifK','62524HvPJnK','11GEQIvo','parse','1037049jQBsFq','apps','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','\x22.\x20','sqls','84kHZWyC','199530dLLaPS','sqlRoot','\x22\x20vs\x20lock\x20\x22','lastSync','64LQYGmH','stringify','utf8'];a263_0x180e=function(){return _0x5cce45;};return a263_0x180e();}function a263_0x31f2(_0x5578e6,_0xc1083d){_0x5578e6=_0x5578e6-0x17c;const _0x180ea0=a263_0x180e();let _0x31f22f=_0x180ea0[_0x5578e6];return _0x31f22f;}export function ensureSqlLockScope(_0x8a3e65,_0x16ea13,_0x163d1d,_0x502a96){const _0x4a45cb=a263_0x31f2,_0x375f49=_0x8a3e65??createEmptySqlLock();let _0x59571c=_0x375f49[_0x4a45cb(0x18a)][_0x16ea13];if(!_0x59571c)return _0x59571c={'sqlRoot':_0x163d1d,'lastSync':'','sqls':{}},_0x375f49[_0x4a45cb(0x18a)][_0x16ea13]=_0x59571c,{'lockData':_0x375f49,'appLock':_0x59571c};if(!_0x59571c[_0x4a45cb(0x191)])_0x59571c[_0x4a45cb(0x191)]=_0x163d1d;else{if(_0x59571c['sqlRoot']!==_0x163d1d)throw new Error(_0x502a96+_0x4a45cb(0x181)+_0x163d1d+_0x4a45cb(0x192)+_0x59571c[_0x4a45cb(0x191)]+_0x4a45cb(0x18d)+_0x4a45cb(0x18b));}return!_0x59571c['sqls']&&(_0x59571c[_0x4a45cb(0x18e)]={}),!_0x59571c[_0x4a45cb(0x193)]&&(_0x59571c[_0x4a45cb(0x193)]=''),{'lockData':_0x375f49,'appLock':_0x59571c};}export async function readSqlLockFile(_0x3aaad8){const _0x18e3b2=a263_0x31f2;try{const _0x361f71=await readFile(_0x3aaad8,'utf8');return JSON[_0x18e3b2(0x188)](_0x361f71);}catch(_0x3c168e){if(_0x3c168e['code']===_0x18e3b2(0x184))return null;throw new Error(_0x18e3b2(0x18c)+String(_0x3c168e));}}export async function writeSqlLockFile(_0xcf0803,_0x9f102f){const _0x7e7f62=a263_0x31f2;await mkdir(dirname(_0xcf0803),{'recursive':!![]}),await writeFile(_0xcf0803,JSON[_0x7e7f62(0x17d)](_0x9f102f,null,0x2),_0x7e7f62(0x17e));}
1
+ (function(_0x5743f5,_0xf506da){const _0x14a7ee=a265_0x1e77,_0x9b9ac7=_0x5743f5();while(!![]){try{const _0x199630=parseInt(_0x14a7ee(0xc9))/0x1+-parseInt(_0x14a7ee(0xc3))/0x2+-parseInt(_0x14a7ee(0xc8))/0x3*(-parseInt(_0x14a7ee(0xc4))/0x4)+-parseInt(_0x14a7ee(0xd0))/0x5+-parseInt(_0x14a7ee(0xcc))/0x6*(parseInt(_0x14a7ee(0xd4))/0x7)+-parseInt(_0x14a7ee(0xcf))/0x8*(parseInt(_0x14a7ee(0xcb))/0x9)+-parseInt(_0x14a7ee(0xcd))/0xa*(-parseInt(_0x14a7ee(0xc5))/0xb);if(_0x199630===_0xf506da)break;else _0x9b9ac7['push'](_0x9b9ac7['shift']());}catch(_0x154c88){_0x9b9ac7['push'](_0x9b9ac7['shift']());}}}(a265_0x4d40,0x7a1a3));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a265_0x1e77(_0x23166e,_0x24ad6f){_0x23166e=_0x23166e-0xc3;const _0x4d40fe=a265_0x4d40();let _0x1e779d=_0x4d40fe[_0x23166e];return _0x1e779d;}function a265_0x4d40(){const _0x1f738a=['9rJbwUT','1266AzpWmQ','5930oNORlG','code','1799864xRBZvi','3606725MjtVSt','sqlRoot','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','apps','3136lZsNIS','\x22.\x20','1938588iPTmOS','3841476RRUxbH','22264ZYeAuB','\x22\x20vs\x20lock\x20\x22','lastSync','3HAZjwU','349680GPNVmT','ENOENT'];a265_0x4d40=function(){return _0x1f738a;};return a265_0x4d40();}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x1ddb4a,_0x5eca6a,_0x4a952c,_0x24a020){const _0x39f9cd=a265_0x1e77,_0x2442e8=_0x1ddb4a??createEmptySqlLock();let _0x54574f=_0x2442e8[_0x39f9cd(0xd3)][_0x5eca6a];if(!_0x54574f)return _0x54574f={'sqlRoot':_0x4a952c,'lastSync':'','sqls':{}},_0x2442e8[_0x39f9cd(0xd3)][_0x5eca6a]=_0x54574f,{'lockData':_0x2442e8,'appLock':_0x54574f};if(!_0x54574f[_0x39f9cd(0xd1)])_0x54574f['sqlRoot']=_0x4a952c;else{if(_0x54574f[_0x39f9cd(0xd1)]!==_0x4a952c)throw new Error(_0x24a020+':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'+_0x4a952c+_0x39f9cd(0xc6)+_0x54574f[_0x39f9cd(0xd1)]+_0x39f9cd(0xd5)+_0x39f9cd(0xd2));}return!_0x54574f['sqls']&&(_0x54574f['sqls']={}),!_0x54574f['lastSync']&&(_0x54574f[_0x39f9cd(0xc7)]=''),{'lockData':_0x2442e8,'appLock':_0x54574f};}export async function readSqlLockFile(_0x506e42){const _0x541411=a265_0x1e77;try{const _0x1ffcad=await readFile(_0x506e42,'utf8');return JSON['parse'](_0x1ffcad);}catch(_0x51c70b){if(_0x51c70b[_0x541411(0xce)]===_0x541411(0xca))return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x51c70b));}}export async function writeSqlLockFile(_0x57e72a,_0x59f2cc){await mkdir(dirname(_0x57e72a),{'recursive':!![]}),await writeFile(_0x57e72a,JSON['stringify'](_0x59f2cc,null,0x2),'utf8');}
@@ -1 +1 @@
1
- (function(_0x1d270e,_0x39d1d9){const _0x4e685a=a265_0x4805,_0x443336=_0x1d270e();while(!![]){try{const _0x583736=parseInt(_0x4e685a(0xd1))/0x1*(-parseInt(_0x4e685a(0xca))/0x2)+parseInt(_0x4e685a(0xda))/0x3*(parseInt(_0x4e685a(0xd5))/0x4)+parseInt(_0x4e685a(0xd8))/0x5+parseInt(_0x4e685a(0xd9))/0x6+parseInt(_0x4e685a(0xce))/0x7*(parseInt(_0x4e685a(0xd3))/0x8)+parseInt(_0x4e685a(0xcf))/0x9*(parseInt(_0x4e685a(0xd2))/0xa)+-parseInt(_0x4e685a(0xd6))/0xb;if(_0x583736===_0x39d1d9)break;else _0x443336['push'](_0x443336['shift']());}catch(_0x149c4e){_0x443336['push'](_0x443336['shift']());}}}(a265_0x1362,0x7f0fc));export function detectSqlMode(_0x42f2d0){const _0x5a4347=a265_0x4805,_0x1341f0=_0x42f2d0['trimStart']();if(/^<(select|insert|update|delete)\b/i['test'](_0x1341f0))return _0x5a4347(0xdb);return _0x5a4347(0xd7);}function a265_0x4805(_0xd766a2,_0x5f0138){_0xd766a2=_0xd766a2-0xc9;const _0x136223=a265_0x1362();let _0x480535=_0x136223[_0xd766a2];return _0x480535;}export function getSqlFileExtension(_0x5e250a){const _0x32913a=a265_0x4805;return _0x5e250a===_0x32913a(0xdb)?_0x32913a(0xd0):'.sql';}export function buildDefaultSqlFileName(_0x5836e1,_0x417f69){return''+_0x5836e1+getSqlFileExtension(_0x417f69);}export function sanitizeSqlPathSegment(_0x5ffa2b,_0x5c1ba1){const _0x1e7917=a265_0x4805,_0x408574=String(_0x5ffa2b??'')[_0x1e7917(0xc9)](),_0xdc4f46=_0x408574[_0x1e7917(0xcc)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x1e7917(0xcc)](/\s+/g,'-')[_0x1e7917(0xcc)](/-+/g,'-')[_0x1e7917(0xcc)](/^\.+/,'')['replace'](/\.+$/,'')[_0x1e7917(0xcc)](/^-+/,'')[_0x1e7917(0xcc)](/-+$/,'');return _0xdc4f46||_0x5c1ba1;}export function buildDbDirectoryName(_0x3a02fe,_0x45e529){const _0x24f14a=a265_0x4805;return sanitizeSqlPathSegment(_0x3a02fe,_0x45e529!=null?_0x24f14a(0xcb)+_0x45e529:_0x24f14a(0xd4));}export function buildSqlRelativePath(_0x3e726b,_0x2d85fb,_0x16ba42,_0xf8b9a4,_0x177543){const _0x55c437=a265_0x4805,_0x37452c=buildDbDirectoryName(_0x16ba42,_0x177543),_0x2f7733=sanitizeSqlPathSegment(_0x3e726b,_0x55c437(0xcd)),_0x3c096e=sanitizeSqlPathSegment(_0x2d85fb,_0x2f7733);return _0x37452c+'/'+_0x2f7733+'_'+_0x3c096e+getSqlFileExtension(_0xf8b9a4);}function a265_0x1362(){const _0x572cda=['201oTiDOv','mybatisXml','trim','52oNvhab','db-','replace','unknown-sql','35VrQmUv','9VaSZUf','.xml','22453vvrxUB','5775430tovSIo','74080MFZeem','unknown-db','20936voKIfs','17574612IwufOq','sql','4740325WKstOZ','4675968juEAeH'];a265_0x1362=function(){return _0x572cda;};return a265_0x1362();}
1
+ function a267_0x3ae8(){const _0x2d477b=['1058344atukCY','.sql','1317012RacXdX','trim','1571256SJAvOj','457406ENoSbV','mybatisXml','427lpOZho','replace','1612sFXvyo','sql','10895kjpyxl','unknown-sql','4yyjICu','1671210VVHBjm','.xml','unknown-db','db-','68844OFyTLO'];a267_0x3ae8=function(){return _0x2d477b;};return a267_0x3ae8();}(function(_0x175cec,_0x61443c){const _0x469508=a267_0x5510,_0x1cb276=_0x175cec();while(!![]){try{const _0x54b960=-parseInt(_0x469508(0x126))/0x1+parseInt(_0x469508(0x11b))/0x2*(parseInt(_0x469508(0x123))/0x3)+-parseInt(_0x469508(0x117))/0x4*(parseInt(_0x469508(0x119))/0x5)+parseInt(_0x469508(0x120))/0x6*(parseInt(_0x469508(0x115))/0x7)+-parseInt(_0x469508(0x121))/0x8+parseInt(_0x469508(0x125))/0x9+parseInt(_0x469508(0x11c))/0xa;if(_0x54b960===_0x61443c)break;else _0x1cb276['push'](_0x1cb276['shift']());}catch(_0x39d880){_0x1cb276['push'](_0x1cb276['shift']());}}}(a267_0x3ae8,0x6e4cf));export function detectSqlMode(_0x191083){const _0x45919c=a267_0x5510,_0x1efbbd=_0x191083['trimStart']();if(/^<(select|insert|update|delete)\b/i['test'](_0x1efbbd))return _0x45919c(0x127);return _0x45919c(0x118);}export function getSqlFileExtension(_0x566426){const _0xb80006=a267_0x5510;return _0x566426===_0xb80006(0x127)?_0xb80006(0x11d):_0xb80006(0x122);}export function buildDefaultSqlFileName(_0x567999,_0x2794cc){return''+_0x567999+getSqlFileExtension(_0x2794cc);}export function sanitizeSqlPathSegment(_0x3c6f3f,_0x3888de){const _0x85d534=a267_0x5510,_0x4857c6=String(_0x3c6f3f??'')[_0x85d534(0x124)](),_0x120773=_0x4857c6['replace'](/[<>:"/\\|?*\u0000-\u001F]/g,'-')['replace'](/\s+/g,'-')['replace'](/-+/g,'-')[_0x85d534(0x116)](/^\.+/,'')['replace'](/\.+$/,'')['replace'](/^-+/,'')['replace'](/-+$/,'');return _0x120773||_0x3888de;}export function buildDbDirectoryName(_0x2de34b,_0x5d0d6a){const _0x5f576c=a267_0x5510;return sanitizeSqlPathSegment(_0x2de34b,_0x5d0d6a!=null?_0x5f576c(0x11f)+_0x5d0d6a:_0x5f576c(0x11e));}function a267_0x5510(_0x4c9518,_0x453f00){_0x4c9518=_0x4c9518-0x115;const _0x3ae848=a267_0x3ae8();let _0x551000=_0x3ae848[_0x4c9518];return _0x551000;}export function buildSqlRelativePath(_0x3d2524,_0x14a733,_0x99527a,_0x59f905,_0x3dc640){const _0x395b16=a267_0x5510,_0x273243=buildDbDirectoryName(_0x99527a,_0x3dc640),_0x288737=sanitizeSqlPathSegment(_0x3d2524,_0x395b16(0x11a)),_0x5d0c4d=sanitizeSqlPathSegment(_0x14a733,_0x288737);return _0x273243+'/'+_0x288737+'_'+_0x5d0c4d+getSqlFileExtension(_0x59f905);}