@lovrabet/rabetbase-cli 2.5.2-beta.7 → 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
- const a247_0x3671ac=a247_0x4d72;(function(_0x37b626,_0x363693){const _0xf83f68=a247_0x4d72,_0x5b8e5a=_0x37b626();while(!![]){try{const _0x755861=parseInt(_0xf83f68(0x1a2))/0x1+parseInt(_0xf83f68(0x1a7))/0x2*(parseInt(_0xf83f68(0x19e))/0x3)+parseInt(_0xf83f68(0x1b4))/0x4*(parseInt(_0xf83f68(0x1b1))/0x5)+parseInt(_0xf83f68(0x194))/0x6*(parseInt(_0xf83f68(0x1ba))/0x7)+-parseInt(_0xf83f68(0x1b3))/0x8+parseInt(_0xf83f68(0x1a5))/0x9*(-parseInt(_0xf83f68(0x1ae))/0xa)+parseInt(_0xf83f68(0x1a6))/0xb*(-parseInt(_0xf83f68(0x190))/0xc);if(_0x755861===_0x363693)break;else _0x5b8e5a['push'](_0x5b8e5a['shift']());}catch(_0xaea3d8){_0x5b8e5a['push'](_0x5b8e5a['shift']());}}}(a247_0x1e41,0xa86dc));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join,resolve,sep}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';function a247_0x4d72(_0x45c907,_0x2df071){_0x45c907=_0x45c907-0x18f;const _0x1e4177=a247_0x1e41();let _0x4d720=_0x1e4177[_0x45c907];return _0x4d720;}export const SUPPORTED_BFF_TYPES=[a247_0x3671ac(0x1af),'ENDPOINT',a247_0x3671ac(0x19c)];export function normalizeBffType(_0x34033b){const _0x1a3dad=a247_0x3671ac;if(!_0x34033b)return undefined;const _0x8751a8=_0x34033b['trim']()[_0x1a3dad(0x1a3)]();return SUPPORTED_BFF_TYPES[_0x1a3dad(0x1ad)](_0x8751a8)?_0x8751a8:undefined;}function a247_0x1e41(){const _0x2a5c02=['HOOK','functionName','876834gVQctt','split','alias','functionNode','195515iqSOrH','toUpperCase','code','9AlqEhc','3409450lzugNi','2HQwCko','.js','operationType','ENDPOINT','push','isDirectory','includes','4010190KfDhOP','COMMON','endsWith','5295tqgntH','scriptsRootDir','6813112iJspLy','3084GnKJmI','datasetCode','replace','startsWith','Resolved\x20Backend\x20Function\x20script\x20path\x20escapes\x20scripts\x20root:\x20','Unsafe\x20Backend\x20Function\x20lock\x20key\x20(traversal\x20or\x20invalid\x20segment):\x20','1106245uWcBJX','isFile','12FBSFjQ','scriptType','all','set','36PuQYXT','afterScriptId','after','name','every','F_OK','before','beforeScriptId'];a247_0x1e41=function(){return _0x2a5c02;};return a247_0x1e41();}async function scanJsFilesRecursively(_0x19787f,_0x108223){const _0x14888c=a247_0x3671ac,_0xdb8407=[];try{const _0x2d1638=await readdir(_0x19787f,{'withFileTypes':!![]});for(const _0x4b4f36 of _0x2d1638){const _0x5b04de=join(_0x19787f,_0x4b4f36['name']);if(_0x4b4f36['isDirectory']())_0xdb8407[_0x14888c(0x1ab)](...await scanJsFilesRecursively(_0x5b04de,_0x108223+'/'+_0x4b4f36[_0x14888c(0x197)]));else _0x4b4f36[_0x14888c(0x18f)]()&&_0x4b4f36[_0x14888c(0x197)][_0x14888c(0x1b0)]('.js')&&_0xdb8407[_0x14888c(0x1ab)]({'lockKey':_0x108223+'/'+_0x4b4f36[_0x14888c(0x197)][_0x14888c(0x1b6)](/\.js$/,''),'filePath':_0x5b04de});}}catch(_0x153e71){if(_0x153e71[_0x14888c(0x1a4)]!=='ENOENT')throw _0x153e71;}return _0xdb8407;}async function scanFlatFunctions(_0x884b67,_0x34ed13){const _0x3a7de6=a247_0x3671ac,_0x4f94a0=join(_0x884b67['scriptsRootDir'],_0x34ed13),_0x334b25=await scanJsFilesRecursively(_0x4f94a0,_0x34ed13);return _0x334b25['map'](({lockKey:_0x253ec6,filePath:_0x3405a8})=>({'type':_0x34ed13,'name':_0x253ec6[_0x3a7de6(0x19f)]('/')['at'](-0x1)??'','filePath':_0x3405a8,'lockKey':_0x253ec6}));}async function scanHookFunctions(_0x11bcb2){const _0x465e5c=a247_0x3671ac,_0x5cbc31=join(_0x11bcb2['scriptsRootDir'],'HOOK'),_0xa734b5=[];try{const _0x4d54ad=await readdir(_0x5cbc31,{'withFileTypes':!![]});for(const _0x5411ff of _0x4d54ad){if(!_0x5411ff[_0x465e5c(0x1ac)]())continue;const _0x5048f5=_0x5411ff[_0x465e5c(0x197)],_0x2cbd82=join(_0x5cbc31,_0x5048f5),_0x565df4=await readdir(_0x2cbd82,{'withFileTypes':!![]});for(const _0x388fa7 of _0x565df4){if(!_0x388fa7[_0x465e5c(0x1ac)]())continue;const _0x59eb58=_0x388fa7['name'],_0x5d0cd7=join(_0x2cbd82,_0x59eb58),_0x45d475=await readdir(_0x5d0cd7,{'withFileTypes':!![]});for(const _0x16bd27 of _0x45d475){if(!_0x16bd27[_0x465e5c(0x1ac)]())continue;const _0x1a985f=_0x16bd27[_0x465e5c(0x197)],_0xb8f706=join(_0x5d0cd7,_0x1a985f),_0x9e5f39=await readdir(_0xb8f706,{'withFileTypes':!![]});for(const _0x195218 of _0x9e5f39){if(!_0x195218[_0x465e5c(0x18f)]()||!_0x195218[_0x465e5c(0x197)][_0x465e5c(0x1b0)]('.js'))continue;const _0x2db02b=_0x195218[_0x465e5c(0x197)][_0x465e5c(0x1b6)](/\.js$/,'');_0xa734b5[_0x465e5c(0x1ab)]({'type':_0x465e5c(0x19c),'name':_0x2db02b,'filePath':join(_0xb8f706,_0x195218[_0x465e5c(0x197)]),'lockKey':'HOOK/'+_0x5048f5+'/'+_0x59eb58+'/'+_0x1a985f+'/'+_0x2db02b,'alias':_0x5048f5,'operationType':_0x59eb58,'functionNode':_0x1a985f});}}}}}catch(_0x39ff64){if(_0x39ff64[_0x465e5c(0x1a4)]!=='ENOENT')throw _0x39ff64;}return _0xa734b5;}export async function scanLocalBffFunctions(_0x2b5eb9,_0x7b72fc){const _0x29ce98=a247_0x3671ac;if(_0x7b72fc===_0x29ce98(0x1af)||_0x7b72fc===_0x29ce98(0x1aa))return scanFlatFunctions(_0x2b5eb9,_0x7b72fc);if(_0x7b72fc===_0x29ce98(0x19c))return scanHookFunctions(_0x2b5eb9);const [_0x1f4733,_0x51aa69,_0x154554]=await Promise[_0x29ce98(0x192)]([scanFlatFunctions(_0x2b5eb9,_0x29ce98(0x1af)),scanFlatFunctions(_0x2b5eb9,_0x29ce98(0x1aa)),scanHookFunctions(_0x2b5eb9)]);return[..._0x1f4733,..._0x51aa69,..._0x154554];}const SAFE_LOCK_KEY_SEGMENT=/^[A-Za-z0-9_$.-]+$/;export function isSafeLockKeySegment(_0x162e75){return SAFE_LOCK_KEY_SEGMENT['test'](_0x162e75)&&_0x162e75!=='.'&&_0x162e75!=='..';}export function resolveLocalFilePathFromLockKey(_0x1fc588,_0x11989a){const _0x39c8fe=a247_0x3671ac,_0x5117c9=_0x11989a[_0x39c8fe(0x19f)]('/');if(!_0x5117c9['every'](isSafeLockKeySegment))throw new Error(_0x39c8fe(0x1b9)+_0x11989a);const _0x29a801=resolve(join(_0x1fc588[_0x39c8fe(0x1b2)],..._0x5117c9)+_0x39c8fe(0x1a8)),_0x21a516=resolve(_0x1fc588[_0x39c8fe(0x1b2)]);if(_0x29a801!==_0x21a516&&!_0x29a801[_0x39c8fe(0x1b7)](_0x21a516+sep))throw new Error(_0x39c8fe(0x1b8)+_0x29a801);return _0x29a801;}export function createHookLocationMap(_0x2bf02c){const _0x515c1c=a247_0x3671ac,_0x5b33be=new Map();for(const _0x20e630 of _0x2bf02c){_0x20e630['beforeScriptId']&&_0x5b33be[_0x515c1c(0x193)](_0x20e630[_0x515c1c(0x19b)],{'datasetCode':_0x20e630[_0x515c1c(0x1b5)],'operationType':snakeToCamel(_0x20e630['operationType']),'functionNode':_0x515c1c(0x19a)}),_0x20e630[_0x515c1c(0x195)]&&_0x5b33be[_0x515c1c(0x193)](_0x20e630['afterScriptId'],{'datasetCode':_0x20e630['datasetCode'],'operationType':snakeToCamel(_0x20e630[_0x515c1c(0x1a9)]),'functionNode':_0x515c1c(0x196)});}return _0x5b33be;}export function resolveRemoteScriptTarget(_0x353eee,_0x4ce891,_0x10b588,_0xd56046,_0x256183){const _0x225b33=a247_0x3671ac,_0x27b1ae=normalizeBffType(_0x4ce891[_0x225b33(0x191)]);if(!_0x27b1ae||!_0x4ce891[_0x225b33(0x19d)])return null;if(_0x27b1ae===_0x225b33(0x19c)){const _0x1a938f=(_0x4ce891['id']?_0x10b588['get'](_0x4ce891['id']):undefined)??findHookLocationByRemoteId(_0xd56046,_0x4ce891['id']);if(!_0x1a938f)return null;const _0x3fbab0=_0x1a938f[_0x225b33(0x1a0)]||_0x256183['get'](_0x1a938f[_0x225b33(0x1b5)]),_0x1de833=_0x3fbab0??_0x1a938f[_0x225b33(0x1b5)],_0x380b2c={..._0x1a938f,'alias':_0x3fbab0},_0x39f9d5='HOOK/'+_0x1de833+'/'+_0x380b2c[_0x225b33(0x1a9)]+'/'+_0x380b2c[_0x225b33(0x1a1)]+'/'+_0x4ce891[_0x225b33(0x19d)];if(!_0x39f9d5[_0x225b33(0x19f)]('/')['every'](isSafeLockKeySegment))return null;return{'lockKey':_0x39f9d5,'filePath':resolveLocalFilePathFromLockKey(_0x353eee,_0x39f9d5),'type':_0x225b33(0x19c),'hookLocation':_0x380b2c};}const _0x20dd18=_0x27b1ae+'/'+_0x4ce891[_0x225b33(0x19d)];if(!_0x20dd18['split']('/')[_0x225b33(0x198)](isSafeLockKeySegment))return null;return{'lockKey':_0x20dd18,'filePath':resolveLocalFilePathFromLockKey(_0x353eee,_0x20dd18),'type':_0x27b1ae};}export async function ensureParentDirectory(_0x5ab541){await mkdir(dirname(_0x5ab541),{'recursive':!![]});}export async function fileExists(_0x2f1c47){const _0x5233f4=a247_0x3671ac;try{return await access(_0x2f1c47,constants[_0x5233f4(0x199)]),!![];}catch{return![];}}export async function directoryExists(_0x199b25){const _0x3810c6=a247_0x3671ac;try{const _0x2ca4b5=await stat(_0x199b25);return _0x2ca4b5[_0x3810c6(0x1ac)]();}catch{return![];}}
1
+ const a248_0x68f7fd=a248_0x3617;(function(_0x899000,_0x4f359e){const _0x2382e1=a248_0x3617,_0x4175c3=_0x899000();while(!![]){try{const _0x2a7a9b=-parseInt(_0x2382e1(0x1f2))/0x1+-parseInt(_0x2382e1(0x1ed))/0x2+parseInt(_0x2382e1(0x204))/0x3+-parseInt(_0x2382e1(0x1ef))/0x4*(parseInt(_0x2382e1(0x206))/0x5)+-parseInt(_0x2382e1(0x1e8))/0x6+parseInt(_0x2382e1(0x1f1))/0x7+parseInt(_0x2382e1(0x20a))/0x8;if(_0x2a7a9b===_0x4f359e)break;else _0x4175c3['push'](_0x4175c3['shift']());}catch(_0x53583b){_0x4175c3['push'](_0x4175c3['shift']());}}}(a248_0x5cbe,0x5ff0f));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join,resolve,sep}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=['COMMON',a248_0x68f7fd(0x208),a248_0x68f7fd(0x20d)];export function normalizeBffType(_0x3cdbd2){const _0x51a489=a248_0x68f7fd;if(!_0x3cdbd2)return undefined;const _0x5e5c0e=_0x3cdbd2[_0x51a489(0x1eb)]()[_0x51a489(0x1e9)]();return SUPPORTED_BFF_TYPES['includes'](_0x5e5c0e)?_0x5e5c0e:undefined;}async function scanJsFilesRecursively(_0x20e771,_0x1bbc3b){const _0x7413c6=a248_0x68f7fd,_0x42a63f=[];try{const _0x5ca0c9=await readdir(_0x20e771,{'withFileTypes':!![]});for(const _0x1f5e5f of _0x5ca0c9){const _0x4ba865=join(_0x20e771,_0x1f5e5f[_0x7413c6(0x202)]);if(_0x1f5e5f['isDirectory']())_0x42a63f[_0x7413c6(0x1fa)](...await scanJsFilesRecursively(_0x4ba865,_0x1bbc3b+'/'+_0x1f5e5f[_0x7413c6(0x202)]));else _0x1f5e5f['isFile']()&&_0x1f5e5f['name'][_0x7413c6(0x207)](_0x7413c6(0x1f8))&&_0x42a63f[_0x7413c6(0x1fa)]({'lockKey':_0x1bbc3b+'/'+_0x1f5e5f[_0x7413c6(0x202)][_0x7413c6(0x20b)](/\.js$/,''),'filePath':_0x4ba865});}}catch(_0x121e85){if(_0x121e85[_0x7413c6(0x1fc)]!==_0x7413c6(0x209))throw _0x121e85;}return _0x42a63f;}function a248_0x5cbe(){const _0x3317d0=['alias','isDirectory','get','name','datasetCode','1918395aKvIRJ','COMMON','5qAqnDB','endsWith','ENDPOINT','ENOENT','11894000wqsBsm','replace','all','HOOK','3868092MfADTW','toUpperCase','set','trim','scriptsRootDir','1097036AhJegb','test','786060HYMXJN','every','2402484wFOSmx','686737YYaSDb','operationType','HOOK/','beforeScriptId','Unsafe\x20Backend\x20Function\x20lock\x20key\x20(traversal\x20or\x20invalid\x20segment):\x20','functionName','.js','before','push','split','code','functionNode','afterScriptId'];a248_0x5cbe=function(){return _0x3317d0;};return a248_0x5cbe();}async function scanFlatFunctions(_0x2c24e9,_0x3ef9fa){const _0x4e5df7=a248_0x68f7fd,_0x188fab=join(_0x2c24e9[_0x4e5df7(0x1ec)],_0x3ef9fa),_0x4f605c=await scanJsFilesRecursively(_0x188fab,_0x3ef9fa);return _0x4f605c['map'](({lockKey:_0x161798,filePath:_0x1cfd3d})=>({'type':_0x3ef9fa,'name':_0x161798['split']('/')['at'](-0x1)??'','filePath':_0x1cfd3d,'lockKey':_0x161798}));}async function scanHookFunctions(_0xebcf9a){const _0xeab275=a248_0x68f7fd,_0x244b31=join(_0xebcf9a[_0xeab275(0x1ec)],'HOOK'),_0x100109=[];try{const _0x1553ed=await readdir(_0x244b31,{'withFileTypes':!![]});for(const _0x487c9b of _0x1553ed){if(!_0x487c9b[_0xeab275(0x200)]())continue;const _0x494002=_0x487c9b['name'],_0x52a8d2=join(_0x244b31,_0x494002),_0x4e32df=await readdir(_0x52a8d2,{'withFileTypes':!![]});for(const _0x528564 of _0x4e32df){if(!_0x528564[_0xeab275(0x200)]())continue;const _0x21a361=_0x528564[_0xeab275(0x202)],_0x2c63ed=join(_0x52a8d2,_0x21a361),_0xc22e58=await readdir(_0x2c63ed,{'withFileTypes':!![]});for(const _0x2db153 of _0xc22e58){if(!_0x2db153[_0xeab275(0x200)]())continue;const _0x2e881d=_0x2db153[_0xeab275(0x202)],_0x100473=join(_0x2c63ed,_0x2e881d),_0x348e32=await readdir(_0x100473,{'withFileTypes':!![]});for(const _0x1cc7a1 of _0x348e32){if(!_0x1cc7a1['isFile']()||!_0x1cc7a1['name'][_0xeab275(0x207)](_0xeab275(0x1f8)))continue;const _0x17cac6=_0x1cc7a1[_0xeab275(0x202)][_0xeab275(0x20b)](/\.js$/,'');_0x100109[_0xeab275(0x1fa)]({'type':_0xeab275(0x20d),'name':_0x17cac6,'filePath':join(_0x100473,_0x1cc7a1['name']),'lockKey':'HOOK/'+_0x494002+'/'+_0x21a361+'/'+_0x2e881d+'/'+_0x17cac6,'alias':_0x494002,'operationType':_0x21a361,'functionNode':_0x2e881d});}}}}}catch(_0x2cf45e){if(_0x2cf45e['code']!==_0xeab275(0x209))throw _0x2cf45e;}return _0x100109;}function a248_0x3617(_0x1e02d8,_0x5aff0d){_0x1e02d8=_0x1e02d8-0x1e8;const _0x5cbe1c=a248_0x5cbe();let _0x361726=_0x5cbe1c[_0x1e02d8];return _0x361726;}export async function scanLocalBffFunctions(_0x361260,_0x4eb098){const _0x282085=a248_0x68f7fd;if(_0x4eb098===_0x282085(0x205)||_0x4eb098===_0x282085(0x208))return scanFlatFunctions(_0x361260,_0x4eb098);if(_0x4eb098===_0x282085(0x20d))return scanHookFunctions(_0x361260);const [_0x1cef4b,_0x7071cc,_0x383871]=await Promise[_0x282085(0x20c)]([scanFlatFunctions(_0x361260,_0x282085(0x205)),scanFlatFunctions(_0x361260,_0x282085(0x208)),scanHookFunctions(_0x361260)]);return[..._0x1cef4b,..._0x7071cc,..._0x383871];}const SAFE_LOCK_KEY_SEGMENT=/^[A-Za-z0-9_$.-]+$/;export function isSafeLockKeySegment(_0x55331a){const _0x3efacf=a248_0x68f7fd;return SAFE_LOCK_KEY_SEGMENT[_0x3efacf(0x1ee)](_0x55331a)&&_0x55331a!=='.'&&_0x55331a!=='..';}export function resolveLocalFilePathFromLockKey(_0x58ef8b,_0x465b70){const _0xd22557=a248_0x68f7fd,_0x8ee2c8=_0x465b70[_0xd22557(0x1fb)]('/');if(!_0x8ee2c8[_0xd22557(0x1f0)](isSafeLockKeySegment))throw new Error(_0xd22557(0x1f6)+_0x465b70);const _0x5aee26=resolve(join(_0x58ef8b[_0xd22557(0x1ec)],..._0x8ee2c8)+_0xd22557(0x1f8)),_0x498a49=resolve(_0x58ef8b[_0xd22557(0x1ec)]);if(_0x5aee26!==_0x498a49&&!_0x5aee26['startsWith'](_0x498a49+sep))throw new Error('Resolved\x20Backend\x20Function\x20script\x20path\x20escapes\x20scripts\x20root:\x20'+_0x5aee26);return _0x5aee26;}export function createHookLocationMap(_0x286263){const _0x7cb1c4=a248_0x68f7fd,_0x2a554f=new Map();for(const _0x32b3b3 of _0x286263){_0x32b3b3[_0x7cb1c4(0x1f5)]&&_0x2a554f[_0x7cb1c4(0x1ea)](_0x32b3b3[_0x7cb1c4(0x1f5)],{'datasetCode':_0x32b3b3['datasetCode'],'operationType':snakeToCamel(_0x32b3b3[_0x7cb1c4(0x1f3)]),'functionNode':_0x7cb1c4(0x1f9)}),_0x32b3b3['afterScriptId']&&_0x2a554f['set'](_0x32b3b3[_0x7cb1c4(0x1fe)],{'datasetCode':_0x32b3b3[_0x7cb1c4(0x203)],'operationType':snakeToCamel(_0x32b3b3[_0x7cb1c4(0x1f3)]),'functionNode':'after'});}return _0x2a554f;}export function resolveRemoteScriptTarget(_0x1d0965,_0x75a7ed,_0x208496,_0x1682bb,_0x50f515){const _0x1838c9=a248_0x68f7fd,_0x418e27=normalizeBffType(_0x75a7ed['scriptType']);if(!_0x418e27||!_0x75a7ed[_0x1838c9(0x1f7)])return null;if(_0x418e27===_0x1838c9(0x20d)){const _0x4faa0f=(_0x75a7ed['id']?_0x208496[_0x1838c9(0x201)](_0x75a7ed['id']):undefined)??findHookLocationByRemoteId(_0x1682bb,_0x75a7ed['id']);if(!_0x4faa0f)return null;const _0x3a3249=_0x4faa0f[_0x1838c9(0x1ff)]||_0x50f515[_0x1838c9(0x201)](_0x4faa0f[_0x1838c9(0x203)]),_0x58aba8=_0x3a3249??_0x4faa0f['datasetCode'],_0x25db06={..._0x4faa0f,'alias':_0x3a3249},_0x59d08a=_0x1838c9(0x1f4)+_0x58aba8+'/'+_0x25db06['operationType']+'/'+_0x25db06[_0x1838c9(0x1fd)]+'/'+_0x75a7ed['functionName'];if(!_0x59d08a['split']('/')[_0x1838c9(0x1f0)](isSafeLockKeySegment))return null;return{'lockKey':_0x59d08a,'filePath':resolveLocalFilePathFromLockKey(_0x1d0965,_0x59d08a),'type':_0x1838c9(0x20d),'hookLocation':_0x25db06};}const _0x1f8e52=_0x418e27+'/'+_0x75a7ed[_0x1838c9(0x1f7)];if(!_0x1f8e52[_0x1838c9(0x1fb)]('/')[_0x1838c9(0x1f0)](isSafeLockKeySegment))return null;return{'lockKey':_0x1f8e52,'filePath':resolveLocalFilePathFromLockKey(_0x1d0965,_0x1f8e52),'type':_0x418e27};}export async function ensureParentDirectory(_0x42caab){await mkdir(dirname(_0x42caab),{'recursive':!![]});}export async function fileExists(_0x3ac18f){try{return await access(_0x3ac18f,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x14882a){const _0x1df01=a248_0x68f7fd;try{const _0x7475ad=await stat(_0x14882a);return _0x7475ad[_0x1df01(0x200)]();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x52bc77,_0x26c6d0){const _0x5eac7a=a248_0x6646,_0x5219a3=_0x52bc77();while(!![]){try{const _0x356f28=-parseInt(_0x5eac7a(0x1c0))/0x1+-parseInt(_0x5eac7a(0x1c4))/0x2+-parseInt(_0x5eac7a(0x1bd))/0x3*(-parseInt(_0x5eac7a(0x1bb))/0x4)+-parseInt(_0x5eac7a(0x1b9))/0x5*(parseInt(_0x5eac7a(0x1c1))/0x6)+parseInt(_0x5eac7a(0x1b6))/0x7+-parseInt(_0x5eac7a(0x1bc))/0x8+parseInt(_0x5eac7a(0x1ba))/0x9*(-parseInt(_0x5eac7a(0x1c3))/0xa);if(_0x356f28===_0x26c6d0)break;else _0x5219a3['push'](_0x5219a3['shift']());}catch(_0x3a1904){_0x5219a3['push'](_0x5219a3['shift']());}}}(a248_0x1cf5,0x20f19));import{readFile}from'node:fs/promises';import a248_0x406bb from'node:crypto';function a248_0x1cf5(){const _0x30df04=['digest','222455ccmech','1197vWKIpc','8HoDKkT','744592zAlayi','388221ESmNQc','update','hex','113856WZwcCT','6ZzwPOD','utf8','800QyVGdl','235612GLOpzx','createHash','1791930FpmclD','md5'];a248_0x1cf5=function(){return _0x30df04;};return a248_0x1cf5();}function a248_0x6646(_0x5945db,_0xe196a){_0x5945db=_0x5945db-0x1b6;const _0x1cf54d=a248_0x1cf5();let _0x6646d8=_0x1cf54d[_0x5945db];return _0x6646d8;}export function computeContentHash(_0x4d6174){const _0x3a4d38=a248_0x6646;return a248_0x406bb[_0x3a4d38(0x1c5)](_0x3a4d38(0x1b7))[_0x3a4d38(0x1be)](_0x4d6174)[_0x3a4d38(0x1b8)](_0x3a4d38(0x1bf));}export async function computeFileHash(_0x55c6a0){const _0x16f485=a248_0x6646,_0x4f82b3=await readFile(_0x55c6a0,_0x16f485(0x1c2));return computeContentHash(_0x4f82b3);}
1
+ (function(_0x306fcc,_0x5b1b13){const _0x1cac62=a249_0x41de,_0x2017fb=_0x306fcc();while(!![]){try{const _0x1b4875=-parseInt(_0x1cac62(0xbb))/0x1+parseInt(_0x1cac62(0xb7))/0x2+parseInt(_0x1cac62(0xb4))/0x3+-parseInt(_0x1cac62(0xbc))/0x4*(-parseInt(_0x1cac62(0xb3))/0x5)+-parseInt(_0x1cac62(0xb8))/0x6+parseInt(_0x1cac62(0xbd))/0x7*(-parseInt(_0x1cac62(0xc0))/0x8)+parseInt(_0x1cac62(0xba))/0x9*(-parseInt(_0x1cac62(0xb5))/0xa);if(_0x1b4875===_0x5b1b13)break;else _0x2017fb['push'](_0x2017fb['shift']());}catch(_0x252ced){_0x2017fb['push'](_0x2017fb['shift']());}}}(a249_0x31b0,0x68e0e));function a249_0x31b0(){const _0x47409f=['448GXqyJx','md5','2415865WRNxXX','2371719QHQDTY','80EcdHPk','createHash','1442190WHPgJI','1594674HZAJwL','update','567738mFduPn','649112OaCvZM','4vftzLm','18214soQLrE','utf8','digest'];a249_0x31b0=function(){return _0x47409f;};return a249_0x31b0();}function a249_0x41de(_0x33a864,_0x1ef0c3){_0x33a864=_0x33a864-0xb2;const _0x31b082=a249_0x31b0();let _0x41dea4=_0x31b082[_0x33a864];return _0x41dea4;}import{readFile}from'node:fs/promises';import a249_0x5d71f3 from'node:crypto';export function computeContentHash(_0x278191){const _0x21ba78=a249_0x41de;return a249_0x5d71f3[_0x21ba78(0xb6)](_0x21ba78(0xb2))[_0x21ba78(0xb9)](_0x278191)[_0x21ba78(0xbf)]('hex');}export async function computeFileHash(_0x150003){const _0x27a8bc=a249_0x41de,_0x661fba=await readFile(_0x150003,_0x27a8bc(0xbe));return computeContentHash(_0x661fba);}
@@ -1 +1 @@
1
- (function(_0x41a92b,_0x17a65b){const _0x4a49fc=a249_0xccc7,_0x1a3197=_0x41a92b();while(!![]){try{const _0x172585=-parseInt(_0x4a49fc(0x1d5))/0x1+parseInt(_0x4a49fc(0x1e0))/0x2+parseInt(_0x4a49fc(0x1d7))/0x3+-parseInt(_0x4a49fc(0x1e6))/0x4*(-parseInt(_0x4a49fc(0x1e5))/0x5)+parseInt(_0x4a49fc(0x1e2))/0x6+parseInt(_0x4a49fc(0x1de))/0x7*(parseInt(_0x4a49fc(0x1da))/0x8)+-parseInt(_0x4a49fc(0x1d8))/0x9;if(_0x172585===_0x17a65b)break;else _0x1a3197['push'](_0x1a3197['shift']());}catch(_0x3d5e58){_0x1a3197['push'](_0x1a3197['shift']());}}}(a249_0x5ecf,0xdc292));function a249_0x5ecf(){const _0x489696=['1298416jJEySQ','Failed\x20to\x20read\x20Backend\x20Function\x20lock\x20file:\x20','10338282tqCHMM','object','parse','7053310oAOxPj','4gvDZgq','scriptsRoot','apps','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','1421106CTawpJ','\x22.\x20','1339467ZLmKfi','25382565vWVaBh','\x22\x20vs\x20lock\x20\x22','82136SxOjtp','utf8','functions','current\x20\x22','623nxElZx','lastSync'];a249_0x5ecf=function(){return _0x489696;};return a249_0x5ecf();}import{mkdir,readFile,writeFile}from'node:fs/promises';function a249_0xccc7(_0x5c2b20,_0x272fe0){_0x5c2b20=_0x5c2b20-0x1d2;const _0x5ecf8e=a249_0x5ecf();let _0xccc7=_0x5ecf8e[_0x5c2b20];return _0xccc7;}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x387e4d,_0x355bad,_0x140ce4,_0x164f7e){const _0x5cd570=a249_0xccc7,_0x7ca3ff={'apps':_0x387e4d['apps']&&typeof _0x387e4d[_0x5cd570(0x1d3)]===_0x5cd570(0x1e3)?_0x387e4d[_0x5cd570(0x1d3)]:{}};let _0x1c49d5=_0x7ca3ff[_0x5cd570(0x1d3)][_0x355bad];if(!_0x1c49d5)return _0x1c49d5={'scriptsRoot':_0x140ce4,'lastSync':'','functions':{}},_0x7ca3ff[_0x5cd570(0x1d3)][_0x355bad]=_0x1c49d5,{'lockData':_0x7ca3ff,'appLock':_0x1c49d5};if(!_0x1c49d5[_0x5cd570(0x1d2)])_0x1c49d5[_0x5cd570(0x1d2)]=_0x140ce4;else{if(_0x1c49d5[_0x5cd570(0x1d2)]!==_0x140ce4)throw new Error(_0x164f7e+':\x20scriptsRoot\x20mismatch\x20—\x20'+(_0x5cd570(0x1dd)+_0x140ce4+_0x5cd570(0x1d9)+_0x1c49d5[_0x5cd570(0x1d2)]+_0x5cd570(0x1d6))+_0x5cd570(0x1d4));}return!_0x1c49d5[_0x5cd570(0x1dc)]&&(_0x1c49d5['functions']={}),!_0x1c49d5[_0x5cd570(0x1df)]&&(_0x1c49d5['lastSync']=''),{'lockData':_0x7ca3ff,'appLock':_0x1c49d5};}export async function readBffLockFile(_0x3e78b3){const _0x267293=a249_0xccc7;try{const _0x51141f=await readFile(_0x3e78b3,_0x267293(0x1db)),_0x3b430b=JSON[_0x267293(0x1e4)](_0x51141f);return{'apps':_0x3b430b[_0x267293(0x1d3)]&&typeof _0x3b430b[_0x267293(0x1d3)]===_0x267293(0x1e3)?_0x3b430b['apps']:{}};}catch(_0x35b1b4){if(_0x35b1b4['code']==='ENOENT')return null;throw new Error(_0x267293(0x1e1)+String(_0x35b1b4));}}export async function writeBffLockFile(_0x50c3ea,_0x248939){const _0x31a2d2=a249_0xccc7;await mkdir(dirname(_0x50c3ea),{'recursive':!![]}),await writeFile(_0x50c3ea,JSON['stringify'](_0x248939,null,0x2),_0x31a2d2(0x1db));}
1
+ (function(_0x9bdc0c,_0x1aceb6){const _0x5125d0=a250_0x5930,_0xdd4325=_0x9bdc0c();while(!![]){try{const _0x443880=-parseInt(_0x5125d0(0x149))/0x1+-parseInt(_0x5125d0(0x151))/0x2*(parseInt(_0x5125d0(0x155))/0x3)+-parseInt(_0x5125d0(0x15f))/0x4+-parseInt(_0x5125d0(0x153))/0x5+parseInt(_0x5125d0(0x15e))/0x6+parseInt(_0x5125d0(0x152))/0x7*(parseInt(_0x5125d0(0x150))/0x8)+parseInt(_0x5125d0(0x14b))/0x9;if(_0x443880===_0x1aceb6)break;else _0xdd4325['push'](_0xdd4325['shift']());}catch(_0x4ad30d){_0xdd4325['push'](_0xdd4325['shift']());}}}(a250_0x4da7,0xc98fd));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}function a250_0x5930(_0x250d67,_0x18d414){_0x250d67=_0x250d67-0x149;const _0x4da70c=a250_0x4da7();let _0x593066=_0x4da70c[_0x250d67];return _0x593066;}export function ensureLockScope(_0x4df140,_0x467a12,_0x2a6ac3,_0x358600){const _0x1b7572=a250_0x5930,_0x16b404={'apps':_0x4df140[_0x1b7572(0x157)]&&typeof _0x4df140['apps']===_0x1b7572(0x14f)?_0x4df140[_0x1b7572(0x157)]:{}};let _0x393555=_0x16b404[_0x1b7572(0x157)][_0x467a12];if(!_0x393555)return _0x393555={'scriptsRoot':_0x2a6ac3,'lastSync':'','functions':{}},_0x16b404[_0x1b7572(0x157)][_0x467a12]=_0x393555,{'lockData':_0x16b404,'appLock':_0x393555};if(!_0x393555[_0x1b7572(0x15c)])_0x393555[_0x1b7572(0x15c)]=_0x2a6ac3;else{if(_0x393555[_0x1b7572(0x15c)]!==_0x2a6ac3)throw new Error(_0x358600+_0x1b7572(0x156)+(_0x1b7572(0x15d)+_0x2a6ac3+_0x1b7572(0x14d)+_0x393555['scriptsRoot']+_0x1b7572(0x15b))+_0x1b7572(0x159));}return!_0x393555['functions']&&(_0x393555['functions']={}),!_0x393555[_0x1b7572(0x15a)]&&(_0x393555[_0x1b7572(0x15a)]=''),{'lockData':_0x16b404,'appLock':_0x393555};}function a250_0x4da7(){const _0x19d5f1=['56onsFXN','13154SwsiZP','531370mqZtdm','1505915siLZCH','ENOENT','171EcsLtp',':\x20scriptsRoot\x20mismatch\x20—\x20','apps','parse','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','lastSync','\x22.\x20','scriptsRoot','current\x20\x22','364452bsSZEX','528340KDSKgp','453569GjGGck','code','13456899WweZZo','utf8','\x22\x20vs\x20lock\x20\x22','Failed\x20to\x20read\x20Backend\x20Function\x20lock\x20file:\x20','object'];a250_0x4da7=function(){return _0x19d5f1;};return a250_0x4da7();}export async function readBffLockFile(_0x35d329){const _0x368e7c=a250_0x5930;try{const _0x12c8be=await readFile(_0x35d329,_0x368e7c(0x14c)),_0x10c632=JSON[_0x368e7c(0x158)](_0x12c8be);return{'apps':_0x10c632['apps']&&typeof _0x10c632[_0x368e7c(0x157)]===_0x368e7c(0x14f)?_0x10c632['apps']:{}};}catch(_0x10f152){if(_0x10f152[_0x368e7c(0x14a)]===_0x368e7c(0x154))return null;throw new Error(_0x368e7c(0x14e)+String(_0x10f152));}}export async function writeBffLockFile(_0x23ecdd,_0x574274){const _0x2e38ff=a250_0x5930;await mkdir(dirname(_0x23ecdd),{'recursive':!![]}),await writeFile(_0x23ecdd,JSON['stringify'](_0x574274,null,0x2),_0x2e38ff(0x14c));}
@@ -1 +1 @@
1
- const a251_0x27933d=a251_0x21a5;(function(_0x1ce0b0,_0x5f572a){const _0x4a69ef=a251_0x21a5,_0x58e8b3=_0x1ce0b0();while(!![]){try{const _0x7e11c8=-parseInt(_0x4a69ef(0x194))/0x1*(-parseInt(_0x4a69ef(0x188))/0x2)+parseInt(_0x4a69ef(0x18e))/0x3+-parseInt(_0x4a69ef(0x193))/0x4*(-parseInt(_0x4a69ef(0x182))/0x5)+-parseInt(_0x4a69ef(0x190))/0x6+-parseInt(_0x4a69ef(0x180))/0x7*(-parseInt(_0x4a69ef(0x19b))/0x8)+-parseInt(_0x4a69ef(0x18a))/0x9*(-parseInt(_0x4a69ef(0x195))/0xa)+parseInt(_0x4a69ef(0x17e))/0xb*(-parseInt(_0x4a69ef(0x192))/0xc);if(_0x7e11c8===_0x5f572a)break;else _0x58e8b3['push'](_0x58e8b3['shift']());}catch(_0x2ae630){_0x58e8b3['push'](_0x58e8b3['shift']());}}}(a251_0x15c7,0x43a02));function a251_0x15c7(){const _0x534c86=['startsWith','2ViIgDd','functionNode','45RMSRtj','test','before','after','1494873PAMapS','replace','2296584qkKixi','datasetCode','1733244SpWYBN','4JMaGfd','128291YxOvSE','95160BOKFGm','toLowerCase','match','TODO:\x20add\x20script\x20description','split','values','107192YdHufY','33ExtXDr','map','14oHGjWs','remoteId','1960545swBBFv','some','trim','operationType','TODO:\x20补充脚本功能描述'];a251_0x15c7=function(){return _0x534c86;};return a251_0x15c7();}export const DEFAULT_BFF_SCRIPT_DESCRIPTION=a251_0x27933d(0x186);const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION=a251_0x27933d(0x198);export function snakeToCamel(_0x5ad93c){const _0x1a045b=a251_0x27933d;return _0x5ad93c[_0x1a045b(0x196)]()[_0x1a045b(0x18f)](/_([a-z])/g,(_0x1933e3,_0x469432)=>_0x469432['toUpperCase']());}function a251_0x21a5(_0x3aaa90,_0x20f209){_0x3aaa90=_0x3aaa90-0x17e;const _0x15c730=a251_0x15c7();let _0x21a55f=_0x15c730[_0x3aaa90];return _0x21a55f;}export function findHookLocationByRemoteId(_0x2bd76a,_0x28c532){const _0x38d9cd=a251_0x27933d;if(!_0x28c532)return undefined;for(const _0x5ea763 of Object[_0x38d9cd(0x19a)](_0x2bd76a)){if(_0x5ea763[_0x38d9cd(0x181)]===_0x28c532&&_0x5ea763[_0x38d9cd(0x191)]&&_0x5ea763[_0x38d9cd(0x185)]&&_0x5ea763[_0x38d9cd(0x189)])return{'datasetCode':_0x5ea763['datasetCode'],'operationType':_0x5ea763['operationType'],'functionNode':_0x5ea763[_0x38d9cd(0x189)]};}return undefined;}export function extractScriptDescription(_0x4a394f){const _0x7c3f6=a251_0x27933d,_0x5ef583=_0x4a394f[_0x7c3f6(0x197)](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x5ef583?.[0x1])return undefined;const _0x173876=_0x5ef583[0x1],_0x326acc=_0x18fe0e=>{const _0x4df9ac=_0x7c3f6,_0x196636=_0x18fe0e?.[_0x4df9ac(0x184)]();if(!_0x196636||_0x196636===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x196636===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x196636;},_0x22dca5=_0x173876['match'](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x22dca5)return _0x326acc(_0x22dca5[0x1]);const _0x4a06c3=_0x173876[_0x7c3f6(0x199)](/\r?\n/)[_0x7c3f6(0x17f)](_0x5b1bf3=>_0x5b1bf3[_0x7c3f6(0x18f)](/^\s*\*\s?/,'')[_0x7c3f6(0x184)]()),_0x2f4402=_0x4a06c3[_0x7c3f6(0x183)](_0x26b5b8=>/^\[\s*脚本类型\s*]\s*\S+/['test'](_0x26b5b8))&&_0x4a06c3[_0x7c3f6(0x183)](_0x5f1336=>/^\[\s*脚本名称\s*]\s*\S+/[_0x7c3f6(0x18b)](_0x5f1336));if(!_0x2f4402)return undefined;for(const _0x344e12 of _0x4a06c3){if(!_0x344e12||_0x344e12[_0x7c3f6(0x187)]('@')||/^\[[^\]]+]\s*/[_0x7c3f6(0x18b)](_0x344e12))continue;return _0x326acc(_0x344e12);}return undefined;}export function isValidBffFunctionName(_0x3d192b){return/^[A-Za-z_$][A-Za-z0-9_$]*$/['test'](_0x3d192b);}export function normalizeHookFunctionNode(_0x485511){const _0x138c64=a251_0x27933d;if(!_0x485511)return undefined;const _0x451350=_0x485511[_0x138c64(0x184)]()[_0x138c64(0x196)]();if(_0x451350===_0x138c64(0x18c)||_0x451350===_0x138c64(0x18d))return _0x451350;return undefined;}
1
+ function a252_0x3dc2(_0x3e0f2b,_0x3fcba5){_0x3e0f2b=_0x3e0f2b-0x196;const _0xc60a66=a252_0xc60a();let _0x3dc2d0=_0xc60a66[_0x3e0f2b];return _0x3dc2d0;}const a252_0x2d4fab=a252_0x3dc2;(function(_0x167b44,_0x5ab20b){const _0x4d256e=a252_0x3dc2,_0x27da65=_0x167b44();while(!![]){try{const _0x40d7f1=-parseInt(_0x4d256e(0x1a5))/0x1*(-parseInt(_0x4d256e(0x1a9))/0x2)+parseInt(_0x4d256e(0x1a1))/0x3*(-parseInt(_0x4d256e(0x196))/0x4)+-parseInt(_0x4d256e(0x1b1))/0x5*(parseInt(_0x4d256e(0x1a4))/0x6)+-parseInt(_0x4d256e(0x1a0))/0x7+-parseInt(_0x4d256e(0x19f))/0x8*(-parseInt(_0x4d256e(0x1af))/0x9)+-parseInt(_0x4d256e(0x1a8))/0xa+parseInt(_0x4d256e(0x1ab))/0xb;if(_0x40d7f1===_0x5ab20b)break;else _0x27da65['push'](_0x27da65['shift']());}catch(_0x362a3d){_0x27da65['push'](_0x27da65['shift']());}}}(a252_0xc60a,0xbcacc));export const DEFAULT_BFF_SCRIPT_DESCRIPTION=a252_0x2d4fab(0x197);const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION=a252_0x2d4fab(0x1aa);export function snakeToCamel(_0x21f330){const _0x54e0dd=a252_0x2d4fab;return _0x21f330[_0x54e0dd(0x19b)]()[_0x54e0dd(0x1a3)](/_([a-z])/g,(_0x53a04c,_0x21980c)=>_0x21980c[_0x54e0dd(0x1a2)]());}function a252_0xc60a(){const _0x53a990=['8135cnAevS','4GisNGS','TODO:\x20补充脚本功能描述','before','test','some','toLowerCase','match','startsWith','remoteId','470128qMlLAp','6888854iLFJqd','4536327oeAAIK','toUpperCase','replace','5298UtMRZW','1053467tYwrUi','trim','datasetCode','5014400wyKucv','2QnHXzc','TODO:\x20add\x20script\x20description','41165245DmFbEu','values','after','functionNode','63HmFeFt','split'];a252_0xc60a=function(){return _0x53a990;};return a252_0xc60a();}export function findHookLocationByRemoteId(_0x4c543f,_0x3b9a4c){const _0x932294=a252_0x2d4fab;if(!_0x3b9a4c)return undefined;for(const _0x3f94cf of Object[_0x932294(0x1ac)](_0x4c543f)){if(_0x3f94cf[_0x932294(0x19e)]===_0x3b9a4c&&_0x3f94cf[_0x932294(0x1a7)]&&_0x3f94cf['operationType']&&_0x3f94cf[_0x932294(0x1ae)])return{'datasetCode':_0x3f94cf[_0x932294(0x1a7)],'operationType':_0x3f94cf['operationType'],'functionNode':_0x3f94cf[_0x932294(0x1ae)]};}return undefined;}export function extractScriptDescription(_0x4df93a){const _0x8058e=a252_0x2d4fab,_0x34fe48=_0x4df93a[_0x8058e(0x19c)](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x34fe48?.[0x1])return undefined;const _0x13208a=_0x34fe48[0x1],_0x184347=_0x7bf4b=>{const _0x219692=_0x8058e,_0x334216=_0x7bf4b?.[_0x219692(0x1a6)]();if(!_0x334216||_0x334216===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x334216===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x334216;},_0x5d39a3=_0x13208a[_0x8058e(0x19c)](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x5d39a3)return _0x184347(_0x5d39a3[0x1]);const _0x421f85=_0x13208a[_0x8058e(0x1b0)](/\r?\n/)['map'](_0x432642=>_0x432642['replace'](/^\s*\*\s?/,'')['trim']()),_0x51da38=_0x421f85[_0x8058e(0x19a)](_0x49c6e4=>/^\[\s*脚本类型\s*]\s*\S+/[_0x8058e(0x199)](_0x49c6e4))&&_0x421f85[_0x8058e(0x19a)](_0x37b26c=>/^\[\s*脚本名称\s*]\s*\S+/[_0x8058e(0x199)](_0x37b26c));if(!_0x51da38)return undefined;for(const _0x3ba914 of _0x421f85){if(!_0x3ba914||_0x3ba914[_0x8058e(0x19d)]('@')||/^\[[^\]]+]\s*/[_0x8058e(0x199)](_0x3ba914))continue;return _0x184347(_0x3ba914);}return undefined;}export function isValidBffFunctionName(_0x2cc68b){const _0xa58219=a252_0x2d4fab;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0xa58219(0x199)](_0x2cc68b);}export function normalizeHookFunctionNode(_0x37e82b){const _0x5d9a13=a252_0x2d4fab;if(!_0x37e82b)return undefined;const _0x1fed90=_0x37e82b['trim']()[_0x5d9a13(0x19b)]();if(_0x1fed90===_0x5d9a13(0x198)||_0x1fed90===_0x5d9a13(0x1ad))return _0x1fed90;return undefined;}
@@ -1 +1 @@
1
- (function(_0x5cbb50,_0x447674){const _0x508ddb=a252_0x79f1,_0x877da1=_0x5cbb50();while(!![]){try{const _0x1cad53=-parseInt(_0x508ddb(0x109))/0x1*(parseInt(_0x508ddb(0x102))/0x2)+parseInt(_0x508ddb(0x105))/0x3+-parseInt(_0x508ddb(0x118))/0x4*(-parseInt(_0x508ddb(0x112))/0x5)+parseInt(_0x508ddb(0x106))/0x6+parseInt(_0x508ddb(0x116))/0x7*(parseInt(_0x508ddb(0x10e))/0x8)+parseInt(_0x508ddb(0x11d))/0x9*(parseInt(_0x508ddb(0x10c))/0xa)+-parseInt(_0x508ddb(0x114))/0xb;if(_0x1cad53===_0x447674)break;else _0x877da1['push'](_0x877da1['shift']());}catch(_0x4f2b3e){_0x877da1['push'](_0x877da1['shift']());}}}(a252_0x9e61,0x19676));import{listDatasets}from'../core/api-client.js';function a252_0x79f1(_0x307668,_0x22e00c){_0x307668=_0x307668-0x100;const _0x9e6181=a252_0x9e61();let _0x79f12b=_0x9e6181[_0x307668];return _0x79f12b;}const cache=new Map();export async function listDatabases(_0xd4962e){const _0x3eebbd=a252_0x79f1;if(cache[_0x3eebbd(0x11c)](_0xd4962e))return cache['get'](_0xd4962e);const _0x37ec39=await listDatasets(_0xd4962e),_0x34e08c=new Map();for(const _0x4f7d05 of _0x37ec39){const _0x1f3a99=_0x4f7d05[_0x3eebbd(0x110)];_0x1f3a99?.[_0x3eebbd(0x115)]!=null&&_0x34e08c[_0x3eebbd(0x108)](_0x1f3a99[_0x3eebbd(0x115)],_0x1f3a99[_0x3eebbd(0x101)]??'db-'+_0x1f3a99[_0x3eebbd(0x115)]);}const _0xa59772=[..._0x34e08c[_0x3eebbd(0x117)]()]['map'](([_0x41be7a,_0x335f01])=>({'dbId':_0x41be7a,'dbName':_0x335f01}));return cache[_0x3eebbd(0x108)](_0xd4962e,_0xa59772),_0xa59772;}export async function resolveDb(_0x141352,_0x35067b){const _0x598dd6=a252_0x79f1,_0x4cd5bf=await listDatabases(_0x141352);if(_0x4cd5bf[_0x598dd6(0x103)]===0x0)return{'resolved':[],'error':_0x598dd6(0x11b)+_0x141352+_0x598dd6(0x104)};if(!_0x35067b)return{'resolved':_0x4cd5bf};const _0x2c4c99=Number(_0x35067b);if(!Number[_0x598dd6(0x10a)](_0x2c4c99)){const _0x3145c8=_0x4cd5bf[_0x598dd6(0x119)](_0x30c523=>_0x30c523[_0x598dd6(0x115)]===_0x2c4c99);if(_0x3145c8)return{'resolved':[_0x3145c8]};}const _0x2fd12d=_0x35067b[_0x598dd6(0x100)](),_0x20fd3f=_0x4cd5bf[_0x598dd6(0x10d)](_0x9fa4bc=>_0x9fa4bc[_0x598dd6(0x101)][_0x598dd6(0x100)]()['includes'](_0x2fd12d));if(_0x20fd3f[_0x598dd6(0x103)]>0x0)return{'resolved':_0x20fd3f};const _0x1678bc=_0x4cd5bf[_0x598dd6(0x11a)](_0x3f4fbb=>_0x3f4fbb[_0x598dd6(0x101)]+'\x20('+_0x3f4fbb[_0x598dd6(0x115)]+')')[_0x598dd6(0x107)](',\x20');return{'resolved':[],'error':_0x598dd6(0x10b)+_0x35067b+_0x598dd6(0x111)+_0x141352+_0x598dd6(0x10f)+_0x1678bc+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x590dd0,_0x80d7b5){const _0x551217=a252_0x79f1,{resolved:_0x48ff99,error:_0x423755}=await resolveDb(_0x590dd0,_0x80d7b5);if(_0x423755)return{'db':null,'error':_0x423755};if(_0x48ff99['length']===0x1)return{'db':_0x48ff99[0x0]};if(!_0x80d7b5){const _0x4ca2f4=_0x48ff99['map'](_0x47cc68=>_0x47cc68[_0x551217(0x101)]+'\x20('+_0x47cc68[_0x551217(0x115)]+')')['join'](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x4ca2f4};}const _0x4a8d2d=_0x48ff99[_0x551217(0x11a)](_0x415b97=>_0x415b97[_0x551217(0x101)]+'\x20('+_0x415b97[_0x551217(0x115)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x80d7b5+'\x22\x20matches\x20multiple\x20databases:\x20'+_0x4a8d2d+_0x551217(0x113)};}function a252_0x9e61(){const _0x3b79d8=['132WOptKi','find','map','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','has','153seaFHg','toLowerCase','dbName','86910FuPqdI','length','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','554100wMzhtq','891552VYNILS','join','set','4CLUWZw','isNaN','No\x20database\x20matching\x20\x22','45550QIVJhm','filter','54616rZEUqp','\x22.\x20Available:\x20','dbtableConfig','\x22\x20under\x20app\x20\x22','3575oecvgg','.\x20Be\x20more\x20specific.','3748547aAdTmE','dbId','189wXLJxh','entries'];a252_0x9e61=function(){return _0x3b79d8;};return a252_0x9e61();}export async function getDbName(_0x2faa9b,_0x2e6858){const _0xc1b09c=a252_0x79f1,_0x230da6=await listDatabases(_0x2faa9b);return _0x230da6[_0xc1b09c(0x119)](_0x5a4ae8=>_0x5a4ae8['dbId']===_0x2e6858)?.['dbName'];}
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_0x2157e0=a253_0x230c;(function(_0x3f9311,_0x33c41b){const _0x5978b8=a253_0x230c,_0x163d9d=_0x3f9311();while(!![]){try{const _0x4288c6=parseInt(_0x5978b8(0x19a))/0x1*(parseInt(_0x5978b8(0x19f))/0x2)+-parseInt(_0x5978b8(0x18d))/0x3+-parseInt(_0x5978b8(0x1ae))/0x4*(-parseInt(_0x5978b8(0x17a))/0x5)+parseInt(_0x5978b8(0x1a9))/0x6+-parseInt(_0x5978b8(0x176))/0x7*(-parseInt(_0x5978b8(0x198))/0x8)+parseInt(_0x5978b8(0x18f))/0x9*(parseInt(_0x5978b8(0x175))/0xa)+parseInt(_0x5978b8(0x174))/0xb*(-parseInt(_0x5978b8(0x180))/0xc);if(_0x4288c6===_0x33c41b)break;else _0x163d9d['push'](_0x163d9d['shift']());}catch(_0x56b695){_0x163d9d['push'](_0x163d9d['shift']());}}}(a253_0x10b4,0xa2751));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=a253_0x2157e0(0x1ad);export const INSTANT_API_POLICY_FILE_NAME='policy.json';export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x2908df,_0x3b757a,_0x5182c9){return new CliError(_0x2908df,0x1,_0x3b757a,_0x5182c9);}export function loadInstantApiPolicyLocalConfig(_0x354014,_0x27e85a){assertSafeAppCode(_0x354014);const _0x598068=resolve(_0x27e85a??findProjectRootDirectory()),_0x38513d=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x354014+'/'+INSTANT_API_POLICY_FILE_NAME,_0x809bdb=resolve(_0x598068,INSTANT_API_POLICY_RELATIVE_ROOT,_0x354014),_0x55e64e=resolve(_0x809bdb,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x598068,'appCode':_0x354014,'policyRoot':_0x809bdb,'policyFilePath':_0x55e64e,'policyRelativePath':_0x38513d};}export function createDefaultInstantApiPolicyConfig(_0xfcc737,_0x299e2c=a253_0x2157e0(0x183)){return assertSafeAppCode(_0xfcc737),{'version':'1','appCode':_0xfcc737,'defaults':{'instantApi':_0x299e2c},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x57b4f6){const _0x46f713=a253_0x2157e0;let _0x5a7b6a;try{_0x5a7b6a=await stat(_0x57b4f6[_0x46f713(0x18b)]);}catch(_0x1cbcb){throw instantApiPolicyError(_0x46f713(0x188),'Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20'+_0x57b4f6[_0x46f713(0x18b)],_0x46f713(0x193));}if(!_0x5a7b6a[_0x46f713(0x194)]())throw instantApiPolicyError(_0x46f713(0x16b),'Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x57b4f6[_0x46f713(0x18b)]);if(_0x5a7b6a[_0x46f713(0x197)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');let _0x28c5b5;try{_0x28c5b5=await readFile(_0x57b4f6[_0x46f713(0x18b)]);}catch{throw instantApiPolicyError(_0x46f713(0x184),_0x46f713(0x178)+_0x57b4f6['policyFilePath']);}if(_0x28c5b5[_0x46f713(0x1a2)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x46f713(0x196),_0x46f713(0x187));let _0x2ddd5c;try{_0x2ddd5c=new TextDecoder(_0x46f713(0x17c),{'fatal':!![],'ignoreBOM':!![]})[_0x46f713(0x177)](_0x28c5b5);}catch{throw instantApiPolicyError(_0x46f713(0x16b),_0x46f713(0x19d)+_0x57b4f6['policyFilePath']);}let _0x66cc39;try{_0x66cc39=JSON[_0x46f713(0x173)](_0x2ddd5c);}catch{throw instantApiPolicyError(_0x46f713(0x190),_0x46f713(0x17d)+_0x57b4f6['policyFilePath']);}return assertLocalPolicyContract(_0x66cc39,_0x57b4f6[_0x46f713(0x16d)]);}export async function writeInstantApiPolicyConfigFile(_0x327ae6,_0x3958e7,_0x547b97={}){const _0x4974ca=a253_0x2157e0,_0x1c9499=assertLocalPolicyContract(_0x3958e7,_0x327ae6['appCode']),_0x5f9afc=JSON[_0x4974ca(0x1ac)](_0x1c9499,null,0x2)+'\x0a';if(Buffer[_0x4974ca(0x1a2)](_0x5f9afc,_0x4974ca(0x17f))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x4974ca(0x196),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');await mkdir(_0x327ae6[_0x4974ca(0x1a0)],{'recursive':!![]});let _0x1d359f;try{_0x1d359f=await readFile(_0x327ae6[_0x4974ca(0x18b)],'utf8');}catch(_0x56b4a5){if(!isMissingFile(_0x56b4a5))throw instantApiPolicyError('instant_api_policy_file_unreadable','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20'+_0x327ae6[_0x4974ca(0x18b)]);}if(_0x1d359f===_0x5f9afc)return{'action':_0x4974ca(0x179),'filePath':_0x327ae6[_0x4974ca(0x18b)]};if(_0x1d359f!==undefined&&!_0x547b97[_0x4974ca(0x191)])throw instantApiPolicyError(_0x4974ca(0x171),_0x4974ca(0x1a6)+_0x327ae6[_0x4974ca(0x18b)],_0x4974ca(0x192));if(_0x1d359f===undefined)try{return await writeFile(_0x327ae6[_0x4974ca(0x18b)],_0x5f9afc,{'encoding':_0x4974ca(0x17f),'flag':'wx'}),{'action':_0x4974ca(0x17b),'filePath':_0x327ae6[_0x4974ca(0x18b)]};}catch(_0x24a026){if(!isAlreadyExists(_0x24a026))throw instantApiPolicyError(_0x4974ca(0x1a4),_0x4974ca(0x181)+_0x327ae6[_0x4974ca(0x18b)]);if(!_0x547b97[_0x4974ca(0x191)])throw instantApiPolicyError('instant_api_policy_file_exists',_0x4974ca(0x16c)+_0x327ae6[_0x4974ca(0x18b)],_0x4974ca(0x19b));}const _0x4d247d=resolve(dirname(_0x327ae6[_0x4974ca(0x18b)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x4974ca(0x17e)]+'.'+randomUUID()+'.tmp');try{await writeFile(_0x4d247d,_0x5f9afc,{'encoding':_0x4974ca(0x17f),'flag':'wx'}),await rename(_0x4d247d,_0x327ae6[_0x4974ca(0x18b)]);}catch{await unlink(_0x4d247d)['catch'](()=>undefined);throw instantApiPolicyError(_0x4974ca(0x1a4),_0x4974ca(0x1aa)+_0x327ae6[_0x4974ca(0x18b)]);}return{'action':_0x4974ca(0x172),'filePath':_0x327ae6[_0x4974ca(0x18b)]};}function assertSafeAppCode(_0x1f3b3c){const _0x5aeb9c=a253_0x2157e0,_0x17448c=_0x1f3b3c[_0x5aeb9c(0x170)]();if(!_0x17448c||_0x17448c!==_0x1f3b3c||_0x17448c[_0x5aeb9c(0x185)]>0x64||_0x17448c==='.'||_0x17448c==='..'||_0x17448c[_0x5aeb9c(0x16f)]('/')||_0x17448c['includes']('\x5c')||_0x17448c[_0x5aeb9c(0x16f)]('\x00'))throw instantApiPolicyError(_0x5aeb9c(0x199),_0x5aeb9c(0x18a));}function assertLocalPolicyContract(_0x1385a2,_0xd57810){const _0x3ba03e=a253_0x2157e0;if(!isObject(_0x1385a2))throw instantApiPolicyError(_0x3ba03e(0x190),_0x3ba03e(0x1a1));if(_0x1385a2[_0x3ba03e(0x19c)]!=='1')throw instantApiPolicyError(_0x3ba03e(0x182),_0x3ba03e(0x1ab),_0x3ba03e(0x1a7));if(_0x1385a2[_0x3ba03e(0x16d)]!==_0xd57810)throw instantApiPolicyError('instant_api_policy_app_code_mismatch','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20'+_0xd57810+'.');if(!isObject(_0x1385a2[_0x3ba03e(0x189)])||typeof _0x1385a2[_0x3ba03e(0x189)]['instantApi']!==_0x3ba03e(0x1a3))throw instantApiPolicyError(_0x3ba03e(0x16e),'Policy\x20defaults.instantApi\x20is\x20required.');if(_0x1385a2[_0x3ba03e(0x186)]!==undefined&&_0x1385a2[_0x3ba03e(0x186)]!==null&&!Array['isArray'](_0x1385a2[_0x3ba03e(0x186)]))throw instantApiPolicyError(_0x3ba03e(0x18c),_0x3ba03e(0x19e));return _0x1385a2;}function isObject(_0x562394){const _0x221dfb=a253_0x2157e0;return _0x562394!==null&&typeof _0x562394===_0x221dfb(0x1a8)&&!Array[_0x221dfb(0x1a5)](_0x562394);}function a253_0x10b4(){const _0x14f912=['unchanged','4665MJyRNu','created','utf-8','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','pid','utf8','12TwwHIi','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_version_invalid','allow','instant_api_policy_file_unreadable','length','rules','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','instant_api_policy_file_missing','defaults','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','policyFilePath','instant_api_policy_rules_invalid','39804iRmvHa','EEXIST','6147027TOyIJw','instant_api_policy_json_invalid','force','Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','isFile','ENOENT','instant_api_policy_file_too_large','size','6566128pbJvmC','instant_api_policy_app_code_invalid','9277qzaEMy','Review\x20the\x20file\x20before\x20retrying.','version','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','22DlHtqH','policyRoot','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','byteLength','string','instant_api_policy_file_unwritable','isArray','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','object','4702848GHCBpd','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22.','stringify','.rabetbase/instant-api-policy','1812wrfPfS','instant_api_policy_file_invalid','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','appCode','instant_api_policy_defaults_invalid','includes','trim','instant_api_policy_file_exists','overwritten','parse','23469380iWTIPe','10IINJSM','7pVKkVA','decode','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20'];a253_0x10b4=function(){return _0x14f912;};return a253_0x10b4();}function isMissingFile(_0xd0c32c){const _0x380156=a253_0x2157e0;return Boolean(_0xd0c32c&&typeof _0xd0c32c===_0x380156(0x1a8)&&_0xd0c32c['code']===_0x380156(0x195));}function a253_0x230c(_0x38a6d9,_0x255fab){_0x38a6d9=_0x38a6d9-0x16b;const _0x10b429=a253_0x10b4();let _0x230c9f=_0x10b429[_0x38a6d9];return _0x230c9f;}function isAlreadyExists(_0x420b94){const _0x21b97c=a253_0x2157e0;return Boolean(_0x420b94&&typeof _0x420b94===_0x21b97c(0x1a8)&&_0x420b94['code']===_0x21b97c(0x18e));}
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
- const a254_0x575bd3=a254_0x371f;(function(_0x4d48be,_0x7219f2){const _0x2affa1=a254_0x371f,_0xe9bc24=_0x4d48be();while(!![]){try{const _0x481a59=parseInt(_0x2affa1(0xa4))/0x1+-parseInt(_0x2affa1(0xc4))/0x2*(-parseInt(_0x2affa1(0xb5))/0x3)+parseInt(_0x2affa1(0xd6))/0x4+-parseInt(_0x2affa1(0xad))/0x5*(parseInt(_0x2affa1(0xb2))/0x6)+parseInt(_0x2affa1(0x93))/0x7*(parseInt(_0x2affa1(0x96))/0x8)+parseInt(_0x2affa1(0xb9))/0x9*(parseInt(_0x2affa1(0x9e))/0xa)+-parseInt(_0x2affa1(0xcb))/0xb;if(_0x481a59===_0x7219f2)break;else _0xe9bc24['push'](_0xe9bc24['shift']());}catch(_0x4910a8){_0xe9bc24['push'](_0xe9bc24['shift']());}}}(a254_0x5959,0xa8ed8));import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';function a254_0x5959(){const _0x3fc1b4=['timingsMs','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','40CCdVUS','isArray','finalScore','/smartapi/knowledge/company-public/search','status','isSafeInteger','title','8961733WUdUyo','apiError','application/json','isFinite','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','no-store','topK','get','query','entries','Knowledge\x20search\x20query\x20is\x20required.','1149304jjPUIx','object','json','sort','authRequired','hits','chunkId','scoreKind','revision','74935azxIjB','text','profile','280eTfgFq','rank','name','cookie','content-type','tags','appCode','strategyFingerprint','626530uuhOuh','trim','rawScore','validation','number','total','308182Ecdffk','some','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','SmartCode\x20knowledge\x20search\x20request\x20failed.','scope','string','Knowledge\x20search\x20appCode\x20is\x20required.','toLowerCase','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','644510cjMncH','SmartCode\x20knowledge\x20search\x20failed.','\x20contract.','schemaVersion','success','6HjXzGE','public','includes','5823VgSCDh','networkError','POST','test','90jTmAAt','data','score','length','company','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','response\x20envelope','cli:rabetbase'];a254_0x5959=function(){return _0x3fc1b4;};return a254_0x5959();}const RESPONSE_KEYS=['schemaVersion',a254_0x575bd3(0x95),'total',a254_0x575bd3(0x8f),a254_0x575bd3(0x9d),'timingsMs'],HIT_KEYS=['documentId',a254_0x575bd3(0x92),a254_0x575bd3(0x90),'scope',a254_0x575bd3(0xca),'text',a254_0x575bd3(0x9b),'rank',a254_0x575bd3(0xa0),'finalScore',a254_0x575bd3(0x91)];export async function searchDevelopmentKnowledge(_0xd2df29){const _0x3a12f9=a254_0x575bd3,_0x26fed4=_0xd2df29[_0x3a12f9(0x9c)]['trim'](),_0x3f0d79=_0xd2df29[_0x3a12f9(0xd3)][_0x3a12f9(0x9f)]();if(!_0x26fed4)throw CliErrors[_0x3a12f9(0xa1)](_0x3a12f9(0xaa));if(!_0xd2df29[_0x3a12f9(0x99)]['trim']())throw CliErrors[_0x3a12f9(0x8e)]();if(!_0x3f0d79)throw CliErrors[_0x3a12f9(0xa1)](_0x3a12f9(0xd5));validateTopK(_0xd2df29['topK']);const _0x2ba29c=getKbDomain()+_0x3a12f9(0xc7);let _0x45d56b;try{_0x45d56b=await fetch(_0x2ba29c,{'method':_0x3a12f9(0xb7),'headers':{'Content-Type':_0x3a12f9(0xcd),'Cookie':_0xd2df29[_0x3a12f9(0x99)],'X-Invoke-Source':_0x3a12f9(0xc0)},'body':JSON['stringify']({'appCode':_0x26fed4,'query':_0x3f0d79,..._0xd2df29[_0x3a12f9(0xd1)]!==undefined?{'topK':_0xd2df29[_0x3a12f9(0xd1)]}:{}}),'signal':_0xd2df29['signal']});}catch(_0x5c1141){if(_0x5c1141 instanceof CliError)throw _0x5c1141;if(_0x5c1141 instanceof Error&&_0x5c1141[_0x3a12f9(0x98)]==='AbortError')throw _0x5c1141;throw CliErrors[_0x3a12f9(0xb6)](_0x3a12f9(0xa7));}if(!hasNoStore(_0x45d56b['headers']))throw CliErrors[_0x3a12f9(0xcc)](_0x3a12f9(0xc3));if(_0x45d56b[_0x3a12f9(0xc8)]===0x191)throw CliErrors[_0x3a12f9(0x8e)]();if(!_0x45d56b['ok'])throw CliErrors[_0x3a12f9(0xcc)](_0x3a12f9(0xcf)+_0x45d56b[_0x3a12f9(0xc8)]+').');if(!(_0x45d56b['headers'][_0x3a12f9(0xd2)](_0x3a12f9(0x9a))??'')[_0x3a12f9(0xab)]()[_0x3a12f9(0xb4)](_0x3a12f9(0xcd)))throw CliErrors[_0x3a12f9(0xcc)](_0x3a12f9(0xbe));let _0x3ef0b7;try{_0x3ef0b7=await _0x45d56b[_0x3a12f9(0xd8)]();}catch{throw CliErrors[_0x3a12f9(0xcc)](_0x3a12f9(0xac));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x3ef0b7),_0xd2df29[_0x3a12f9(0xd1)]);}function readEnvelopeData(_0x386d2f){const _0x755b01=a254_0x575bd3,_0x23aa19=requireRecord(_0x386d2f,_0x755b01(0xbf));if(_0x23aa19[_0x755b01(0xb1)]===![])throw CliErrors[_0x755b01(0xcc)](_0x755b01(0xae));if(!(_0x755b01(0xba)in _0x23aa19))throw invalidContract(_0x755b01(0xbf));return _0x23aa19[_0x755b01(0xba)];}function validateTopK(_0x299cd6){const _0x2a14db=a254_0x575bd3;if(_0x299cd6!==undefined&&(!Number['isSafeInteger'](_0x299cd6)||_0x299cd6<0x1||_0x299cd6>0x32))throw CliErrors['validation'](_0x2a14db(0xc2));}function hasNoStore(_0x18b7a3){const _0x512041=a254_0x575bd3;return(_0x18b7a3[_0x512041(0xd2)]('cache-control')??'')['split'](',')[_0x512041(0xa5)](_0x454fd0=>_0x454fd0[_0x512041(0x9f)]()[_0x512041(0xab)]()===_0x512041(0xd0));}function parseDevelopmentSearchResponse(_0x134e8d,_0x5f5004){const _0x1d557a=a254_0x575bd3,_0x454b2d=requireExactRecord(_0x134e8d,RESPONSE_KEYS,'response');if(_0x454b2d['schemaVersion']!==0x2||_0x454b2d[_0x1d557a(0x95)]!=='development')throw invalidContract(_0x1d557a(0x95));if(!Array['isArray'](_0x454b2d[_0x1d557a(0x8f)])||_0x454b2d[_0x1d557a(0x8f)][_0x1d557a(0xbc)]>(_0x5f5004??0x32))throw invalidContract(_0x1d557a(0x8f));if(typeof _0x454b2d['strategyFingerprint']!==_0x1d557a(0xa9)||!/^sha256:[0-9a-f]{64}$/[_0x1d557a(0xb8)](_0x454b2d[_0x1d557a(0x9d)]))throw invalidContract(_0x1d557a(0x9d));const _0x5db96d=requireRecord(_0x454b2d[_0x1d557a(0xc1)],_0x1d557a(0xc1)),_0xb1ea38={};for(const [_0x24ad21,_0x2be992]of Object[_0x1d557a(0xd4)](_0x5db96d)){if(!/^[A-Za-z][A-Za-z0-9]*$/['test'](_0x24ad21)||typeof _0x2be992!==_0x1d557a(0xa2)||!Number[_0x1d557a(0xce)](_0x2be992)||_0x2be992<0x0)throw invalidContract(_0x1d557a(0xc1));_0xb1ea38[_0x24ad21]=_0x2be992;}const _0xe2f356=_0x454b2d[_0x1d557a(0x8f)]['map']((_0x32f6a1,_0xc2b19b)=>parseHit(_0x32f6a1,_0xc2b19b));if(!Number[_0x1d557a(0xc9)](_0x454b2d[_0x1d557a(0xa3)])||_0x454b2d[_0x1d557a(0xa3)]!==_0xe2f356['length'])throw invalidContract(_0x1d557a(0xa3));return{'schemaVersion':_0x454b2d[_0x1d557a(0xb0)],'profile':_0x454b2d[_0x1d557a(0x95)],'total':_0x454b2d['total'],'strategyFingerprint':_0x454b2d['strategyFingerprint'],'timingsMs':_0xb1ea38,'hits':_0xe2f356};}function parseHit(_0x12bb0d,_0x40dec0){const _0x6e16a9=a254_0x575bd3,_0x11d07d=requireExactRecord(_0x12bb0d,HIT_KEYS,'hits['+_0x40dec0+']'),_0x4c1f0f=_0x1affe9=>{const _0x5d577c=a254_0x371f,_0x3a348c=_0x11d07d[_0x1affe9];if(typeof _0x3a348c!==_0x5d577c(0xa9)||!_0x3a348c)throw invalidContract(_0x1affe9);return _0x3a348c;};if(!Number[_0x6e16a9(0xc9)](_0x11d07d[_0x6e16a9(0x92)])||_0x11d07d[_0x6e16a9(0x92)]<0x1)throw invalidContract('revision');if(_0x11d07d[_0x6e16a9(0xa8)]!==_0x6e16a9(0xb3)&&_0x11d07d[_0x6e16a9(0xa8)]!==_0x6e16a9(0xbd))throw invalidContract(_0x6e16a9(0xa8));if(typeof _0x11d07d[_0x6e16a9(0xca)]!==_0x6e16a9(0xa9)||typeof _0x11d07d[_0x6e16a9(0x94)]!==_0x6e16a9(0xa9))throw invalidContract(_0x6e16a9(0x94));if(!Array[_0x6e16a9(0xc5)](_0x11d07d[_0x6e16a9(0x9b)])||_0x11d07d[_0x6e16a9(0x9b)][_0x6e16a9(0xa5)](_0x5e15ea=>typeof _0x5e15ea!==_0x6e16a9(0xa9)))throw invalidContract(_0x6e16a9(0x9b));if(!Number[_0x6e16a9(0xc9)](_0x11d07d[_0x6e16a9(0x97)])||_0x11d07d[_0x6e16a9(0x97)]!==_0x40dec0+0x1)throw invalidContract(_0x6e16a9(0x97));if(!isFiniteNumber(_0x11d07d['rawScore'])||!isFiniteNumber(_0x11d07d[_0x6e16a9(0xc6)]))throw invalidContract(_0x6e16a9(0xbb));return{'documentId':_0x4c1f0f('documentId'),'revision':_0x11d07d[_0x6e16a9(0x92)],'chunkId':_0x4c1f0f('chunkId'),'scope':_0x11d07d['scope'],'title':_0x11d07d['title'],'text':_0x11d07d[_0x6e16a9(0x94)],'tags':[..._0x11d07d[_0x6e16a9(0x9b)]],'rank':_0x11d07d[_0x6e16a9(0x97)],'rawScore':_0x11d07d['rawScore'],'finalScore':_0x11d07d[_0x6e16a9(0xc6)],'scoreKind':_0x4c1f0f(_0x6e16a9(0x91))};}function requireExactRecord(_0x473619,_0x41642a,_0x218c6b){const _0xcad5fb=a254_0x575bd3,_0x287333=requireRecord(_0x473619,_0x218c6b),_0x1b1655=Object['keys'](_0x287333)[_0xcad5fb(0xd9)](),_0x3c9fd2=[..._0x41642a][_0xcad5fb(0xd9)]();if(_0x1b1655[_0xcad5fb(0xbc)]!==_0x3c9fd2[_0xcad5fb(0xbc)]||_0x1b1655[_0xcad5fb(0xa5)]((_0xbd08e6,_0x1f0868)=>_0xbd08e6!==_0x3c9fd2[_0x1f0868]))throw invalidContract(_0x218c6b);return _0x287333;}function requireRecord(_0x5c8e8d,_0x17a748){const _0x17416b=a254_0x575bd3;if(!_0x5c8e8d||typeof _0x5c8e8d!==_0x17416b(0xd7)||Array[_0x17416b(0xc5)](_0x5c8e8d))throw invalidContract(_0x17a748);return _0x5c8e8d;}function a254_0x371f(_0x5af6de,_0x196ccf){_0x5af6de=_0x5af6de-0x8e;const _0x5959e3=a254_0x5959();let _0x371fef=_0x5959e3[_0x5af6de];return _0x371fef;}function isFiniteNumber(_0x4e7cf5){const _0x4cb7c4=a254_0x575bd3;return typeof _0x4e7cf5==='number'&&Number[_0x4cb7c4(0xce)](_0x4e7cf5);}function invalidContract(_0x161d4e){const _0x295ff7=a254_0x575bd3;return CliErrors[_0x295ff7(0xcc)](_0x295ff7(0xa6)+_0x161d4e+_0x295ff7(0xaf));}
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_0x2b8c3b=a255_0x18fd;(function(_0x4486d5,_0x563142){const _0x3d17ee=a255_0x18fd,_0x332fbd=_0x4486d5();while(!![]){try{const _0x468662=parseInt(_0x3d17ee(0x130))/0x1+-parseInt(_0x3d17ee(0x126))/0x2*(-parseInt(_0x3d17ee(0x112))/0x3)+-parseInt(_0x3d17ee(0x115))/0x4*(parseInt(_0x3d17ee(0x118))/0x5)+parseInt(_0x3d17ee(0x124))/0x6+-parseInt(_0x3d17ee(0x11a))/0x7+-parseInt(_0x3d17ee(0x113))/0x8+-parseInt(_0x3d17ee(0x12a))/0x9*(-parseInt(_0x3d17ee(0x11f))/0xa);if(_0x468662===_0x563142)break;else _0x332fbd['push'](_0x332fbd['shift']());}catch(_0x53a4cd){_0x332fbd['push'](_0x332fbd['shift']());}}}(a255_0x1848,0xc7f47));import{constants}from'node:fs';function a255_0x1848(){const _0xaf3e67=['isFile','split','74709mohFEU','Unsupported\x20file\x20in\x20page\x20directory:\x20','join','.json','sort','validation','1359740rzWXCV','cwd','285EPGBMB','6966024LOcUSr','.rabetbase','3412VeOULU','trim','toUpperCase','985rOYphu','page','10459183gFYDBE','appPagesDir','flagMissing','Page\x20directory\x20not\x20found:\x20','F_OK','1550jCyxMb','isDirectory','page.lock.json','page-dir','utf8','1282608CYsklr','name','10354TDKCkQ','localeCompare'];a255_0x1848=function(){return _0xaf3e67;};return a255_0x1848();}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(_0x4cf2f7,_0x4517f1=process[a255_0x2b8c3b(0x131)]()){const _0x56fd7f=a255_0x2b8c3b,_0x516b52=resolve(_0x4517f1),_0x184f6d=join(_0x516b52,_0x56fd7f(0x114),_0x56fd7f(0x119));return{'projectRoot':_0x516b52,'pagesBaseDir':_0x184f6d,'appPagesDir':join(_0x184f6d,_0x4cf2f7),'lockFilePath':join(_0x516b52,'.rabetbase',_0x56fd7f(0x121))};}export function buildPageFileName(_0x32dbf8,_0x1019c5){const _0xfc9597=a255_0x2b8c3b;return _0x32dbf8+'-'+_0x1019c5[_0xfc9597(0x117)]()+_0xfc9597(0x12d);}export function resolvePageFilePath(_0x24cda9,_0x390f1e,_0x4d19cd){const _0x41863c=a255_0x2b8c3b;return join(_0x24cda9[_0x41863c(0x11b)],buildPageFileName(_0x390f1e,_0x4d19cd));}export async function ensureParentDirectory(_0x10e574){await mkdir(dirname(_0x10e574),{'recursive':!![]});}export async function fileExists(_0x35fa72){const _0x209bd6=a255_0x2b8c3b;try{return await access(_0x35fa72,constants[_0x209bd6(0x11e)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0x2852ae){const _0x3facad=a255_0x2b8c3b,_0x169bed=_0x2852ae[_0x3facad(0x116)]();if(!_0x169bed)throw CliErrors[_0x3facad(0x11c)](_0x3facad(0x122));const _0x23fb26=resolve(_0x169bed);let _0x406991;try{_0x406991=await lstat(_0x23fb26);}catch{throw CliErrors[_0x3facad(0x12f)](_0x3facad(0x11d)+_0x169bed);}if(!_0x406991[_0x3facad(0x120)]())throw CliErrors['validation']('Page\x20directory\x20is\x20not\x20a\x20directory:\x20'+_0x169bed);const _0x6cc459={};return await readDirectory(_0x23fb26,_0x23fb26,_0x6cc459),_0x6cc459;}function a255_0x18fd(_0x56fc10,_0xe06026){_0x56fc10=_0x56fc10-0x112;const _0x184881=a255_0x1848();let _0x18fd77=_0x184881[_0x56fc10];return _0x18fd77;}async function readDirectory(_0x4e9ca2,_0x1cf530,_0x52d657){const _0x2e1765=a255_0x2b8c3b,_0xdb987d=await readdir(_0x1cf530,{'withFileTypes':!![]});for(const _0xfe0d14 of _0xdb987d[_0x2e1765(0x12e)]((_0x430e5c,_0x3c15ee)=>_0x430e5c[_0x2e1765(0x125)][_0x2e1765(0x127)](_0x3c15ee[_0x2e1765(0x125)]))){const _0x3bd3d6=join(_0x1cf530,_0xfe0d14[_0x2e1765(0x125)]);if(_0xfe0d14[_0x2e1765(0x120)]()){await readDirectory(_0x4e9ca2,_0x3bd3d6,_0x52d657);continue;}if(!_0xfe0d14[_0x2e1765(0x128)]())throw CliErrors['validation'](_0x2e1765(0x12b)+_0x3bd3d6);_0x52d657[relative(_0x4e9ca2,_0x3bd3d6)[_0x2e1765(0x129)](sep)[_0x2e1765(0x12c)]('/')]=await readFile(_0x3bd3d6,_0x2e1765(0x123));}}
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_0x4997(_0x199d1f,_0x2d55c1){_0x199d1f=_0x199d1f-0x158;const _0x5065e5=a256_0x5065();let _0x499707=_0x5065e5[_0x199d1f];return _0x499707;}(function(_0x4fd53e,_0x5a5ed7){const _0x4686d1=a256_0x4997,_0x10101c=_0x4fd53e();while(!![]){try{const _0x1394c9=parseInt(_0x4686d1(0x163))/0x1+parseInt(_0x4686d1(0x15e))/0x2+parseInt(_0x4686d1(0x165))/0x3+parseInt(_0x4686d1(0x15b))/0x4+parseInt(_0x4686d1(0x161))/0x5+-parseInt(_0x4686d1(0x15c))/0x6*(parseInt(_0x4686d1(0x15d))/0x7)+-parseInt(_0x4686d1(0x158))/0x8;if(_0x1394c9===_0x5a5ed7)break;else _0x10101c['push'](_0x10101c['shift']());}catch(_0x389575){_0x10101c['push'](_0x10101c['shift']());}}}(a256_0x5065,0x25ff1));import a256_0x52100f from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x77718a){const _0x45441b=a256_0x4997;return JSON[_0x45441b(0x162)](JSON[_0x45441b(0x15a)](_0x77718a),null,0x2)+'\x0a';}export function computePageContentHash(_0x56b56a){const _0x300a85=a256_0x4997;return a256_0x52100f[_0x300a85(0x159)](_0x300a85(0x166))['update'](_0x56b56a)[_0x300a85(0x160)](_0x300a85(0x164));}export function computeSerializedSchemaHash(_0x2c3099){return computePageContentHash(serializePageSchemaForFile(_0x2c3099));}function a256_0x5065(){const _0x42a2a4=['utf8','digest','1237885WLiXJt','stringify','203763zUsFbh','hex','380985yVBwGG','md5','3808536LjXnrv','createHash','parse','35884pmZNKC','402TxNmPO','15267bCifIr','381042XhmydH'];a256_0x5065=function(){return _0x42a2a4;};return a256_0x5065();}export async function computePageFileHash(_0x7617e2){const _0x225c12=a256_0x4997,_0x55d600=await readFile(_0x7617e2,_0x225c12(0x15f));return computePageContentHash(_0x55d600);}
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(_0x3fe5d7,_0x248219){const _0x2c8f45=a257_0x29ec,_0x39f90f=_0x3fe5d7();while(!![]){try{const _0x1291f7=parseInt(_0x2c8f45(0xdf))/0x1*(parseInt(_0x2c8f45(0xdb))/0x2)+parseInt(_0x2c8f45(0xd4))/0x3+parseInt(_0x2c8f45(0xd9))/0x4+-parseInt(_0x2c8f45(0xde))/0x5+parseInt(_0x2c8f45(0xe3))/0x6*(parseInt(_0x2c8f45(0xdc))/0x7)+-parseInt(_0x2c8f45(0xd6))/0x8+-parseInt(_0x2c8f45(0xd7))/0x9*(parseInt(_0x2c8f45(0xd3))/0xa);if(_0x1291f7===_0x248219)break;else _0x39f90f['push'](_0x39f90f['shift']());}catch(_0x4a5c10){_0x39f90f['push'](_0x39f90f['shift']());}}}(a257_0x2b20,0x59c7c));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a257_0x2b20(){const _0xff213c=['utf8','31938UioDwG','lastSync','20YXjgYo','601284yiMjNf','pages','2745880xZqnAD','218772IFPkcI','parse','2544068BKFWHN','apps','10ILmPvs','259nyJImk','object','3489075wIjiGX','84802VhvBZe','ENOENT','code'];a257_0x2b20=function(){return _0xff213c;};return a257_0x2b20();}function a257_0x29ec(_0x1c8fe4,_0x42298b){_0x1c8fe4=_0x1c8fe4-0xd2;const _0x2b20dc=a257_0x2b20();let _0x29ecb3=_0x2b20dc[_0x1c8fe4];return _0x29ecb3;}export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x4e9a42,_0xaffed2){const _0x4a4737=a257_0x29ec,_0x26f10b={'apps':_0x4e9a42[_0x4a4737(0xda)]&&typeof _0x4e9a42[_0x4a4737(0xda)]===_0x4a4737(0xdd)?_0x4e9a42[_0x4a4737(0xda)]:{}};let _0x244156=_0x26f10b['apps'][_0xaffed2];if(!_0x244156)return _0x244156={'lastSync':'','pages':{}},_0x26f10b[_0x4a4737(0xda)][_0xaffed2]=_0x244156,{'lockData':_0x26f10b,'appLock':_0x244156};return!_0x244156['lastSync']&&(_0x244156[_0x4a4737(0xd2)]=''),(!_0x244156[_0x4a4737(0xd5)]||typeof _0x244156['pages']!==_0x4a4737(0xdd))&&(_0x244156[_0x4a4737(0xd5)]={}),{'lockData':_0x26f10b,'appLock':_0x244156};}export async function readPageLockFile(_0x41d323){const _0x49191b=a257_0x29ec;try{const _0x4d66c3=await readFile(_0x41d323,_0x49191b(0xe2)),_0x2a62ca=JSON[_0x49191b(0xd8)](_0x4d66c3);return{'apps':_0x2a62ca[_0x49191b(0xda)]&&typeof _0x2a62ca[_0x49191b(0xda)]===_0x49191b(0xdd)?_0x2a62ca[_0x49191b(0xda)]:{}};}catch(_0x18b0b8){if(_0x18b0b8[_0x49191b(0xe1)]===_0x49191b(0xe0))return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0x18b0b8));}}export async function writePageLockFile(_0x201c4b,_0xba7d3f){const _0x363a1f=a257_0x29ec;await mkdir(dirname(_0x201c4b),{'recursive':!![]}),await writeFile(_0x201c4b,JSON['stringify'](_0xba7d3f,null,0x2),_0x363a1f(0xe2));}
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(_0xba06f6,_0xe8da6e){const _0x23a0ec=a259_0x406a,_0x3d120a=_0xba06f6();while(!![]){try{const _0xd74145=parseInt(_0x23a0ec(0x1fd))/0x1*(-parseInt(_0x23a0ec(0x1e6))/0x2)+parseInt(_0x23a0ec(0x1e0))/0x3*(-parseInt(_0x23a0ec(0x1fc))/0x4)+parseInt(_0x23a0ec(0x20a))/0x5+parseInt(_0x23a0ec(0x1d5))/0x6*(parseInt(_0x23a0ec(0x219))/0x7)+parseInt(_0x23a0ec(0x212))/0x8+parseInt(_0x23a0ec(0x1ee))/0x9+-parseInt(_0x23a0ec(0x211))/0xa*(parseInt(_0x23a0ec(0x206))/0xb);if(_0xd74145===_0xe8da6e)break;else _0x3d120a['push'](_0x3d120a['shift']());}catch(_0x4fb2ab){_0x3d120a['push'](_0x3d120a['shift']());}}}(a259_0x492a,0xf0db6));function a259_0x406a(_0x4658b8,_0x367679){_0x4658b8=_0x4658b8-0x1ce;const _0x492aae=a259_0x492a();let _0x406a00=_0x492aae[_0x4658b8];return _0x406a00;}import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x52cca7,_0x3a049f){const _0x5b23f6=a259_0x406a,_0x1ad96e=[],_0x2e4b80=normalizeSqlForStaticAnalysis(_0x52cca7),_0x3e70e9=(_0x2e4b80[_0x5b23f6(0x20d)]?[]:extractJoinFacts(_0x2e4b80['sql']))[_0x5b23f6(0x21a)](_0x1f6751=>{const _0x517c14=_0x5b23f6;if(_0x1f6751[_0x517c14(0x1d4)]||_0x1f6751[_0x517c14(0x1ff)][_0x517c14(0x1d6)]===0x0)return _0x1ad96e[_0x517c14(0x1ce)]({'code':_0x517c14(0x201),'table':_0x1f6751['table'],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'reason':_0x1f6751[_0x517c14(0x1e3)]??_0x517c14(0x1f1)}),{'table':_0x1f6751['table'],'alias':_0x1f6751['alias'],'columns':_0x1f6751[_0x517c14(0x1ff)],'status':_0x517c14(0x1f4)};const _0x17fd35=resolveTableMetadata(_0x3a049f,_0x1f6751[_0x517c14(0x200)]),_0x212445=(_0x17fd35?.[_0x517c14(0x218)]??[])['map'](_0x206b6e=>({'index':_0x206b6e,'matchedPrefix':findEqualityPrefix(_0x206b6e[_0x517c14(0x1ff)],_0x1f6751['columns'])}))[_0x517c14(0x1ed)](_0x299ac1=>_0x299ac1[_0x517c14(0x1ef)][_0x517c14(0x1d6)]>0x0),_0x42513f=_0x212445[_0x517c14(0x202)]((_0x303dea,_0x47547d)=>!_0x303dea||_0x47547d[_0x517c14(0x1ef)]['length']>_0x303dea['matchedPrefix'][_0x517c14(0x1d6)]?_0x47547d:_0x303dea,_0x212445[0x0]);if(_0x42513f)return{'table':_0x1f6751[_0x517c14(0x200)],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'status':_0x517c14(0x1f8),'matchedIndex':{..._0x42513f['index'],'matchedPrefix':_0x42513f['matchedPrefix']}};const _0x1081bb=_0x17fd35?.[_0x517c14(0x218)]['filter'](_0x4d6af3=>_0x4d6af3['columns']['some'](_0x4a630f=>_0x1f6751[_0x517c14(0x1ff)][_0x517c14(0x208)](_0x20c3c7=>columnNamesMatch(_0x4a630f,_0x20c3c7))))??[];if(_0x1081bb[_0x517c14(0x1d6)]>0x0)return _0x1ad96e[_0x517c14(0x1ce)]({'code':'JOIN_INDEX_NOT_USABLE','table':_0x1f6751[_0x517c14(0x200)],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'reason':_0x517c14(0x1dd)}),{'table':_0x1f6751[_0x517c14(0x200)],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'status':'warning','candidateIndexes':_0x1081bb};if(_0x17fd35&&_0x17fd35[_0x517c14(0x20c)]!==![]&&_0x17fd35[_0x517c14(0x218)]['length']>0x0&&_0x1f6751[_0x517c14(0x1ff)][_0x517c14(0x1d6)]>0x0)return _0x1ad96e[_0x517c14(0x1ce)]({'code':'JOIN_INDEX_MISSING','table':_0x1f6751['table'],'alias':_0x1f6751['alias'],'columns':_0x1f6751['columns'],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x1f6751['table'],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751['columns'],'status':'warning'};return _0x1ad96e['push']({'code':_0x517c14(0x1d3),'table':_0x1f6751[_0x517c14(0x200)],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'reason':_0x17fd35?_0x517c14(0x1e4):_0x517c14(0x1f3)}),{'table':_0x1f6751['table'],'alias':_0x1f6751['alias'],'columns':_0x1f6751['columns'],'status':_0x517c14(0x1f4)};});return{'checked':_0x3e70e9[_0x5b23f6(0x1d6)]>0x0,'joins':_0x3e70e9,'warnings':_0x1ad96e};}function extractJoinFacts(_0x287eb3){const _0x5b737d=a259_0x406a,_0x39460b=maskNestedQueries(stripSqlNoise(_0x287eb3)),_0x2bd80e=maskQuotedIdentifiers(_0x39460b),_0x5f3848=[],_0x4500ee=new Set(),_0x2bcfd0=/\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 _0x385b50 of _0x39460b[_0x5b737d(0x20b)](_0x2bcfd0)){const _0x54e40f=_0x385b50[_0x5b737d(0x215)]??0x0,_0x171a79=_0x385b50[0x0][_0x5b737d(0x1f9)](/\bJOIN\b/i),_0x1c7a6f=_0x54e40f+Math[_0x5b737d(0x1d0)](0x0,_0x171a79);if(!/^JOIN\b/i[_0x5b737d(0x1d7)](_0x2bd80e['slice'](_0x1c7a6f)))continue;_0x4500ee[_0x5b737d(0x1f6)](_0x1c7a6f);const _0x57dafd=normalizeIdentifier(_0x385b50[0x1]||'INNER'),_0x1f9000=normalizeIdentifier(_0x385b50[0x2]??''),_0x85fa54=normalizeIdentifier(_0x385b50[0x3]||_0x1f9000['split']('.')['at'](-0x1)||_0x1f9000),_0x397090=[],_0x21749a=_0x1f9000===_0x5b737d(0x1d9);let _0x2cf847=_0x57dafd===_0x5b737d(0x217)||_0x57dafd===_0x5b737d(0x1e1)||_0x21749a,_0x3f8ae4=_0x2cf847?_0x21749a?_0x5b737d(0x1e9):_0x57dafd[_0x5b737d(0x1f0)]()+_0x5b737d(0x205):undefined;const _0x5a7ff9=stripOuterParentheses(_0x385b50[0x4]??''),_0x5663b4=_0x5a7ff9[_0x5b737d(0x1e2)](MYBATIS_DYNAMIC_START_MARKER)||_0x5a7ff9['includes'](MYBATIS_DYNAMIC_END_MARKER),_0x21c7b4=_0x5a7ff9['includes'](MYBATIS_INCLUDE_MARKER);_0x5663b4&&(_0x2cf847=!![],_0x3f8ae4??=_0x5b737d(0x216));_0x21c7b4&&(_0x2cf847=!![],_0x3f8ae4??=_0x5b737d(0x1d2));const _0x3ad73a=_0x5a7ff9[_0x5b737d(0x1da)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x5b737d(0x1da)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x5b737d(0x1da)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x3ad73a,'OR')&&(_0x2cf847=!![],_0x3f8ae4??=_0x5b737d(0x20e));for(const _0x2f13ff of splitTopLevelAnd(_0x3ad73a)){const _0x18024e=stripOuterParentheses(_0x2f13ff);if(hasTopLevelKeyword(_0x18024e,'OR')){_0x2cf847=!![],_0x3f8ae4??=_0x5b737d(0x20e);continue;}const _0x468861=splitEquality(_0x18024e);if(!_0x468861){containsColumnReference(_0x2f13ff,_0x85fa54)&&(_0x2cf847=!![]);continue;}const _0x3a00bb=parseDirectColumnReference(_0x468861[0x0],_0x85fa54),_0x5c8060=parseDirectColumnReference(_0x468861[0x1],_0x85fa54),_0x3e9c6e=containsColumnReference(_0x468861[0x0],_0x85fa54),_0x9d9352=containsColumnReference(_0x468861[0x1],_0x85fa54),_0x4def59=_0x3a00bb&&!_0x9d9352?_0x3a00bb:_0x5c8060&&!_0x3e9c6e?_0x5c8060:null;if(_0x4def59&&!_0x397090['includes'](_0x4def59))_0x397090[_0x5b737d(0x1ce)](_0x4def59);else!_0x4def59&&containsColumnReference(_0x2f13ff,_0x85fa54)&&(_0x2cf847=!![]);}_0x5f3848['push']({'table':_0x1f9000,'alias':_0x85fa54,'columns':_0x397090,'unsupportedPredicate':_0x2cf847,'unsupportedReason':_0x3f8ae4,'containsUnresolvedInclude':_0x21c7b4,'position':_0x1c7a6f});}for(const _0x330a56 of _0x2bd80e[_0x5b737d(0x20b)](/\bJOIN\b/gi)){const _0x38b971=_0x330a56[_0x5b737d(0x215)]??0x0;if(_0x4500ee['has'](_0x38b971))continue;const _0x404d1b=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x5b737d(0x1de)](_0x39460b[_0x5b737d(0x1e8)](_0x38b971+_0x330a56[0x0][_0x5b737d(0x1d6)])),_0x40e2c0=normalizeIdentifier(_0x404d1b?.[0x1]||_0x5b737d(0x1e7)),_0x38d39f=normalizeIdentifier(_0x404d1b?.[0x2]||''),_0x57dfad=isSqlClauseKeyword(_0x38d39f)?_0x40e2c0['split']('.')['at'](-0x1)||_0x40e2c0:_0x38d39f||_0x40e2c0[_0x5b737d(0x203)]('.')['at'](-0x1)||_0x40e2c0;_0x5f3848[_0x5b737d(0x1ce)]({'table':_0x40e2c0,'alias':_0x57dfad,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x5b737d(0x214),'position':_0x38b971});}const _0x5b9008=_0x2bd80e[_0x5b737d(0x1cf)](MYBATIS_INCLUDE_MARKER);return _0x5b9008>=0x0&&!_0x5f3848[_0x5b737d(0x208)](_0x570ce2=>_0x570ce2[_0x5b737d(0x1d8)])&&_0x5f3848[_0x5b737d(0x1ce)]({'table':_0x5b737d(0x1e7),'alias':_0x5b737d(0x1e7),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x5b737d(0x1dc),'containsUnresolvedInclude':!![],'position':_0x5b9008}),_0x5f3848[_0x5b737d(0x210)]((_0x2d00ef,_0x3f44ce)=>_0x2d00ef[_0x5b737d(0x1fb)]-_0x3f44ce[_0x5b737d(0x1fb)]);}function stripSqlNoise(_0x34389a){const _0x4105d9=a259_0x406a,_0x1c150a=Array[_0x4105d9(0x1f2)](_0x34389a),_0x587598=(_0x4c49ce,_0x31a48e)=>{for(let _0x189a9a=_0x4c49ce;_0x189a9a<_0x31a48e;_0x189a9a+=0x1){_0x1c150a[_0x189a9a]!=='\x0a'&&_0x1c150a[_0x189a9a]!=='\x0d'&&(_0x1c150a[_0x189a9a]='\x20');}};for(let _0x42c1fe=0x0;_0x42c1fe<_0x1c150a['length'];_0x42c1fe+=0x1){const _0xc0b01=_0x1c150a[_0x42c1fe],_0x15b5a9=_0x1c150a[_0x42c1fe+0x1];if(_0xc0b01==='\x27'||_0xc0b01==='\x22'||_0xc0b01==='`'){const _0x502651=_0xc0b01,_0x4421b5=_0x42c1fe;_0x42c1fe+=0x1;while(_0x42c1fe<_0x1c150a['length']){if(_0x1c150a[_0x42c1fe]==='\x5c'&&_0x42c1fe+0x1<_0x1c150a['length']){_0x42c1fe+=0x2;continue;}if(_0x1c150a[_0x42c1fe]!==_0x502651){_0x42c1fe+=0x1;continue;}if(_0x1c150a[_0x42c1fe+0x1]===_0x502651){_0x42c1fe+=0x2;continue;}break;}if(_0x502651==='\x27')_0x587598(_0x4421b5,Math[_0x4105d9(0x1db)](_0x42c1fe+0x1,_0x1c150a[_0x4105d9(0x1d6)]));continue;}if(_0xc0b01==='-'&&_0x15b5a9==='-'){const _0x40b3aa=_0x42c1fe;while(_0x42c1fe<_0x1c150a[_0x4105d9(0x1d6)]&&_0x1c150a[_0x42c1fe]!=='\x0a')_0x42c1fe+=0x1;_0x587598(_0x40b3aa,_0x42c1fe);continue;}if(_0xc0b01==='/'&&_0x15b5a9==='*'){const _0x38efa1=_0x42c1fe;_0x42c1fe+=0x2;while(_0x42c1fe<_0x1c150a['length']&&!(_0x1c150a[_0x42c1fe]==='*'&&_0x1c150a[_0x42c1fe+0x1]==='/')){_0x42c1fe+=0x1;}_0x42c1fe=Math['min'](_0x42c1fe+0x1,_0x1c150a[_0x4105d9(0x1d6)]-0x1),_0x587598(_0x38efa1,_0x42c1fe+0x1);continue;}if(_0xc0b01==='#'&&_0x15b5a9!=='{'){const _0x2bdd2a=_0x42c1fe;while(_0x42c1fe<_0x1c150a[_0x4105d9(0x1d6)]&&_0x1c150a[_0x42c1fe]!=='\x0a')_0x42c1fe+=0x1;_0x587598(_0x2bdd2a,_0x42c1fe);continue;}if((_0xc0b01==='#'||_0xc0b01==='$')&&_0x15b5a9==='{'){const _0x4e8dd4=_0x42c1fe;_0x42c1fe+=0x2;while(_0x42c1fe<_0x1c150a[_0x4105d9(0x1d6)]&&_0x1c150a[_0x42c1fe]!=='}')_0x42c1fe+=0x1;_0x587598(_0x4e8dd4,Math['min'](_0x42c1fe+0x1,_0x1c150a[_0x4105d9(0x1d6)]));}}return _0x1c150a['join']('');}function maskQuotedIdentifiers(_0x202001){const _0x2e9447=a259_0x406a,_0x33d8ce=Array['from'](_0x202001);for(let _0x46e6d5=0x0;_0x46e6d5<_0x33d8ce[_0x2e9447(0x1d6)];_0x46e6d5+=0x1){const _0x140112=_0x33d8ce[_0x46e6d5];if(_0x140112!=='\x22'&&_0x140112!=='`')continue;_0x46e6d5+=0x1;while(_0x46e6d5<_0x33d8ce[_0x2e9447(0x1d6)]){if(_0x33d8ce[_0x46e6d5]===_0x140112){if(_0x33d8ce[_0x46e6d5+0x1]===_0x140112){_0x33d8ce[_0x46e6d5]='\x20',_0x33d8ce[_0x46e6d5+0x1]='\x20',_0x46e6d5+=0x2;continue;}break;}_0x33d8ce[_0x46e6d5]='\x20',_0x46e6d5+=0x1;}}return _0x33d8ce['join']('');}function maskNestedQueries(_0x34135a){const _0x380269=a259_0x406a,_0xefdaed=Array[_0x380269(0x1f2)](_0x34135a);for(let _0x57141a=0x0;_0x57141a<_0xefdaed['length'];_0x57141a+=0x1){if(_0xefdaed[_0x57141a]!=='(')continue;const _0x20d43f=_0x34135a[_0x380269(0x1e8)](_0x57141a+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x380269(0x1d7)](_0x20d43f))continue;let _0x4be040=0x1,_0x5c56ae=_0x57141a+0x1;for(;_0x5c56ae<_0xefdaed[_0x380269(0x1d6)]&&_0x4be040>0x0;_0x5c56ae+=0x1){if(_0xefdaed[_0x5c56ae]==='(')_0x4be040+=0x1;if(_0xefdaed[_0x5c56ae]===')')_0x4be040-=0x1;}if(_0x4be040!==0x0)continue;for(let _0x493d86=_0x57141a;_0x493d86<_0x5c56ae;_0x493d86+=0x1){_0xefdaed[_0x493d86]='\x20';}const _0x3a9210=_0x380269(0x1d9);for(let _0x18d8b1=0x0;_0x18d8b1<_0x3a9210[_0x380269(0x1d6)]&&_0x57141a+_0x18d8b1<_0x5c56ae;_0x18d8b1+=0x1){_0xefdaed[_0x57141a+_0x18d8b1]=_0x3a9210[_0x18d8b1];}_0x57141a=_0x5c56ae-0x1;}return _0xefdaed[_0x380269(0x207)]('');}function splitTopLevelAnd(_0x51eb39){const _0x5de0e3=a259_0x406a,_0x21b1e6=[];let _0x3f7946=0x0,_0x47d8f7=0x0;for(let _0x533f2e=0x0;_0x533f2e<_0x51eb39['length'];_0x533f2e+=0x1){const _0x332c1c=_0x51eb39[_0x533f2e];if(_0x332c1c==='(')_0x3f7946+=0x1;if(_0x332c1c===')')_0x3f7946=Math[_0x5de0e3(0x1d0)](0x0,_0x3f7946-0x1);_0x3f7946===0x0&&_0x51eb39[_0x5de0e3(0x1e8)](_0x533f2e)['match'](/^AND\b/i)&&(_0x533f2e===0x0||/\s/[_0x5de0e3(0x1d7)](_0x51eb39[_0x533f2e-0x1]??''))&&(_0x21b1e6[_0x5de0e3(0x1ce)](_0x51eb39[_0x5de0e3(0x1e8)](_0x47d8f7,_0x533f2e)[_0x5de0e3(0x20f)]()),_0x533f2e+=0x2,_0x47d8f7=_0x533f2e+0x1);}const _0x3e7d0e=_0x51eb39['slice'](_0x47d8f7)['trim']();if(_0x3e7d0e)_0x21b1e6[_0x5de0e3(0x1ce)](_0x3e7d0e);return _0x21b1e6;}function hasTopLevelKeyword(_0x5bf8e6,_0x4a9c2e){const _0x35fdb6=a259_0x406a;let _0x3c6272=0x0;for(let _0x31662a=0x0;_0x31662a<_0x5bf8e6['length'];_0x31662a+=0x1){const _0x5d401c=_0x5bf8e6[_0x31662a];if(_0x5d401c==='(')_0x3c6272+=0x1;if(_0x5d401c===')')_0x3c6272=Math[_0x35fdb6(0x1d0)](0x0,_0x3c6272-0x1);if(_0x3c6272!==0x0)continue;const _0x4cc213=_0x5bf8e6['slice'](_0x31662a,_0x31662a+_0x4a9c2e['length']),_0x59abff=_0x5bf8e6[_0x31662a-0x1]??'\x20',_0x118e3b=_0x5bf8e6[_0x31662a+_0x4a9c2e[_0x35fdb6(0x1d6)]]??'\x20';if(_0x4cc213[_0x35fdb6(0x1f0)]()===_0x4a9c2e['toUpperCase']()&&!/[\w$]/[_0x35fdb6(0x1d7)](_0x59abff)&&!/[\w$]/[_0x35fdb6(0x1d7)](_0x118e3b))return!![];}return![];}function splitEquality(_0x3b22a2){const _0x291231=a259_0x406a,_0x3de43f=stripOuterParentheses(_0x3b22a2);let _0xe23c74=0x0,_0x4f6e99;for(let _0xf6c248=0x0;_0xf6c248<_0x3de43f[_0x291231(0x1d6)];_0xf6c248+=0x1){const _0x7098f7=_0x3de43f[_0xf6c248];if(_0x7098f7==='(')_0xe23c74+=0x1;if(_0x7098f7===')')_0xe23c74=Math[_0x291231(0x1d0)](0x0,_0xe23c74-0x1);const _0x276974=_0x3de43f[_0xf6c248-0x1]??'',_0x3e99ee=_0x3de43f[_0xf6c248+0x1]??'';if(_0x7098f7==='='&&_0xe23c74===0x0&&!/[!<>=:]/[_0x291231(0x1d7)](_0x276974)&&_0x3e99ee!=='='){if(_0x4f6e99!==undefined)return null;_0x4f6e99=_0xf6c248;}}return _0x4f6e99===undefined?null:[_0x3de43f['slice'](0x0,_0x4f6e99)[_0x291231(0x20f)](),_0x3de43f[_0x291231(0x1e8)](_0x4f6e99+0x1)[_0x291231(0x20f)]()];}function parseDirectColumnReference(_0x332a43,_0x51c940){const _0x53d892=a259_0x406a,_0x530575=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x53d892(0x1de)](stripOuterParentheses(_0x332a43));if(!_0x530575)return null;if(normalizeIdentifier(_0x530575[0x1]??'')!==normalizeIdentifier(_0x51c940))return null;return normalizeIdentifier(_0x530575[0x2]??'');}function containsColumnReference(_0x35208b,_0x3afecd){const _0x4435e5=a259_0x406a,_0x3b3a96=_0x35208b[_0x4435e5(0x1f5)](/[`"]/g,''),_0x594638=_0x3afecd[_0x4435e5(0x1f5)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x4435e5(0x1fe)+_0x594638+_0x4435e5(0x1ea),'i')[_0x4435e5(0x1d7)](_0x3b3a96);}function a259_0x492a(){const _0x11d3dc=['JOIN_PREDICATE_UNSUPPORTED','reduce','split','has','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','5933279jmLHtF','join','some','using','8318085kNUvjd','matchAll','metadataAvailable','error','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','trim','sort','20HupxBq','12303384FXYdls','natural','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','index','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','right','indexes','495019pmJtvg','map','push','indexOf','max','toLowerCase','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','INDEX_METADATA_UNAVAILABLE','unsupportedPredicate','18zcFUed','length','test','containsUnresolvedInclude','__sq__','replaceAll','min','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','exec','endsWith','5103xYRkmj','full','includes','unsupportedReason','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','inner','2cCIMXY','unknown','slice','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','\x5cs*\x5c.\x5cs*[\x5cw$]+','where','alias','filter','2510847DpqVyq','matchedPrefix','toUpperCase','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','from','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','unavailable','replace','add','tableName','covered','search','cross','position','1464iNCmqn','1004780wPaWfs','(?:^|[^\x5cw$])','columns','table'];a259_0x492a=function(){return _0x11d3dc;};return a259_0x492a();}function findEqualityPrefix(_0x4cac26,_0x4fcd1f){const _0x107bdb=a259_0x406a,_0x23f733=new Set(_0x4fcd1f[_0x107bdb(0x21a)](normalizeIdentifier)),_0x194722=[];for(const _0x2f40ed of _0x4cac26){if(!_0x23f733['has'](normalizeIdentifier(_0x2f40ed)))break;_0x194722[_0x107bdb(0x1ce)](_0x2f40ed);}return _0x194722;}function resolveTableMetadata(_0x25bbeb,_0x445e10){const _0x17ae48=a259_0x406a,_0x4f5e9e=normalizeIdentifier(_0x445e10),_0x2b7281=_0x25bbeb[_0x17ae48(0x1ed)](_0x1f7361=>normalizeIdentifier(_0x1f7361[_0x17ae48(0x1f7)])===_0x4f5e9e);if(_0x2b7281['length']===0x1)return _0x2b7281[0x0];const _0x35dbbe=_0x4f5e9e[_0x17ae48(0x1e2)]('.'),_0x1eef15=_0x4f5e9e[_0x17ae48(0x203)]('.')['at'](-0x1),_0x453a6c=_0x25bbeb[_0x17ae48(0x1ed)](_0x448fff=>{const _0x56bb66=_0x17ae48,_0x481dbf=normalizeIdentifier(_0x448fff[_0x56bb66(0x1f7)]);if(_0x35dbbe&&_0x481dbf[_0x56bb66(0x1e2)]('.'))return![];return _0x481dbf[_0x56bb66(0x203)]('.')['at'](-0x1)===_0x1eef15;});return _0x453a6c['length']===0x1?_0x453a6c[0x0]:undefined;}function columnNamesMatch(_0x2ad73a,_0x58f2e9){return normalizeIdentifier(_0x2ad73a)===normalizeIdentifier(_0x58f2e9);}function normalizeIdentifier(_0x1c79c6){const _0x209253=a259_0x406a;return _0x1c79c6[_0x209253(0x1f5)](/[`"]/g,'')[_0x209253(0x20f)]()[_0x209253(0x1d1)]();}function isSqlClauseKeyword(_0x1b7cbb){const _0x565bd0=a259_0x406a;return new Set(['on',_0x565bd0(0x209),_0x565bd0(0x1eb),_0x565bd0(0x207),_0x565bd0(0x1e5),'left',_0x565bd0(0x217),_0x565bd0(0x1e1),_0x565bd0(0x1fa),_0x565bd0(0x213)])[_0x565bd0(0x204)](_0x1b7cbb);}function stripOuterParentheses(_0x2efb6d){const _0x2370ac=a259_0x406a;let _0x2cb5fb=_0x2efb6d['trim']();while(_0x2cb5fb['startsWith']('(')&&_0x2cb5fb[_0x2370ac(0x1df)](')')){let _0x5a45ba=0x0,_0x54dbc7=!![];for(let _0x267486=0x0;_0x267486<_0x2cb5fb[_0x2370ac(0x1d6)];_0x267486+=0x1){if(_0x2cb5fb[_0x267486]==='(')_0x5a45ba+=0x1;if(_0x2cb5fb[_0x267486]===')')_0x5a45ba-=0x1;if(_0x5a45ba===0x0&&_0x267486<_0x2cb5fb['length']-0x1){_0x54dbc7=![];break;}}if(!_0x54dbc7||_0x5a45ba!==0x0)break;_0x2cb5fb=_0x2cb5fb[_0x2370ac(0x1e8)](0x1,-0x1)['trim']();}return _0x2cb5fb;}
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
- function a260_0x2c79(_0x8d6a86,_0x13514c){_0x8d6a86=_0x8d6a86-0x10e;const _0x26c219=a260_0x26c2();let _0x2c798b=_0x26c219[_0x8d6a86];return _0x2c798b;}const a260_0x667cf1=a260_0x2c79;function a260_0x26c2(){const _0x287157=['21088AZSBJl','sql-trash','100470qKoBWO','sql','698073kVIXKa','1467yYLoto','/sql','388986pJmRgG','444puQShd','sql.lock.json','.rabetbase','671LBzRFY','7lnjWdk','124MyRsxo','31870dJSbYd','3tsxeAs','751907FMIvma','2446650kfHddL'];a260_0x26c2=function(){return _0x287157;};return a260_0x26c2();}(function(_0x5c80f6,_0x11167b){const _0x36ad26=a260_0x2c79,_0x3263a1=_0x5c80f6();while(!![]){try{const _0x49ab14=-parseInt(_0x36ad26(0x11c))/0x1+parseInt(_0x36ad26(0x11f))/0x2*(parseInt(_0x36ad26(0x115))/0x3)+-parseInt(_0x36ad26(0x113))/0x4*(-parseInt(_0x36ad26(0x114))/0x5)+-parseInt(_0x36ad26(0x117))/0x6*(parseInt(_0x36ad26(0x112))/0x7)+parseInt(_0x36ad26(0x118))/0x8*(-parseInt(_0x36ad26(0x11d))/0x9)+parseInt(_0x36ad26(0x11a))/0xa*(-parseInt(_0x36ad26(0x111))/0xb)+parseInt(_0x36ad26(0x10e))/0xc*(parseInt(_0x36ad26(0x116))/0xd);if(_0x49ab14===_0x11167b)break;else _0x3263a1['push'](_0x3263a1['shift']());}catch(_0x44a452){_0x3263a1['push'](_0x3263a1['shift']());}}}(a260_0x26c2,0x5db03));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a260_0x667cf1(0x110),LOCK_FILE_NAME=a260_0x667cf1(0x10f),TRASH_DIR_NAME=a260_0x667cf1(0x119);export function loadSqlProjectConfig(_0x87a7ee,_0x12a251){const _0x78e08c=a260_0x667cf1,_0x1bc9bf=resolve(_0x12a251??findProjectRootDirectory()),_0x15f7b5=DOT_DIR+_0x78e08c(0x11e),_0x54608a=_0x15f7b5+'/'+_0x87a7ee;return{'projectRoot':_0x1bc9bf,'appCode':_0x87a7ee,'sqlWorkspaceRoot':_0x15f7b5,'sqlRoot':_0x54608a,'sqlRootDir':resolve(_0x1bc9bf,DOT_DIR,_0x78e08c(0x11b),_0x87a7ee),'lockFilePath':resolve(_0x1bc9bf,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x1bc9bf,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)};}