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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/api/generate-sdk-config-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/logs.d.ts +7 -0
  38. package/lib/commands/bff/logs.js +1 -0
  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/batch-design.d.ts +21 -0
  62. package/lib/commands/dataset/batch-design.js +1 -0
  63. package/lib/commands/dataset/business-group-update.js +1 -1
  64. package/lib/commands/dataset/business-groups.js +1 -1
  65. package/lib/commands/dataset/capability.js +1 -1
  66. package/lib/commands/dataset/delete.js +1 -1
  67. package/lib/commands/dataset/detail.js +1 -1
  68. package/lib/commands/dataset/extend-update.js +1 -1
  69. package/lib/commands/dataset/field-restore.js +1 -1
  70. package/lib/commands/dataset/field-update.js +1 -1
  71. package/lib/commands/dataset/generate.js +1 -1
  72. package/lib/commands/dataset/index.js +1 -1
  73. package/lib/commands/dataset/list.js +1 -1
  74. package/lib/commands/dataset/operations.js +1 -1
  75. package/lib/commands/dataset/relation-audit.js +1 -1
  76. package/lib/commands/dataset/relation-create.js +1 -1
  77. package/lib/commands/dataset/relation-delete.js +1 -1
  78. package/lib/commands/dataset/relation-shared.js +1 -1
  79. package/lib/commands/dataset/relation-update.js +1 -1
  80. package/lib/commands/dataset/relations.js +1 -1
  81. package/lib/commands/dataset/rename.js +1 -1
  82. package/lib/commands/dataset/restore.js +1 -1
  83. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  84. package/lib/commands/db/analysis-batching.js +1 -1
  85. package/lib/commands/db/analyze-batch-plan.js +1 -1
  86. package/lib/commands/db/analyze-cancel.js +1 -1
  87. package/lib/commands/db/analyze-start.js +1 -1
  88. package/lib/commands/db/analyze-status.js +1 -1
  89. package/lib/commands/db/create.js +1 -1
  90. package/lib/commands/db/delete.js +1 -1
  91. package/lib/commands/db/detail.js +1 -1
  92. package/lib/commands/db/diff-refresh-start.js +1 -1
  93. package/lib/commands/db/diff-refresh-status.js +1 -1
  94. package/lib/commands/db/diff.js +1 -1
  95. package/lib/commands/db/index.js +1 -1
  96. package/lib/commands/db/list.js +1 -1
  97. package/lib/commands/db/shared.js +1 -1
  98. package/lib/commands/db/table-diff-shared.js +1 -1
  99. package/lib/commands/db/tables.js +1 -1
  100. package/lib/commands/db/test.js +1 -1
  101. package/lib/commands/db/update.js +1 -1
  102. package/lib/commands/deployment/index.js +1 -1
  103. package/lib/commands/deployment/sync-all.js +1 -1
  104. package/lib/commands/deployment/sync-jobs.js +1 -1
  105. package/lib/commands/deployment/sync-status.js +1 -1
  106. package/lib/commands/doctor.js +1 -1
  107. package/lib/commands/file/index.js +1 -1
  108. package/lib/commands/flow/create.d.ts +2 -0
  109. package/lib/commands/flow/create.js +1 -0
  110. package/lib/commands/flow/detail.d.ts +2 -0
  111. package/lib/commands/flow/detail.js +1 -0
  112. package/lib/commands/flow/index.d.ts +3 -0
  113. package/lib/commands/flow/index.js +1 -0
  114. package/lib/commands/flow/list.d.ts +2 -0
  115. package/lib/commands/flow/list.js +1 -0
  116. package/lib/commands/flow/publish.d.ts +2 -0
  117. package/lib/commands/flow/publish.js +1 -0
  118. package/lib/commands/flow/runtime-resources-shared.d.ts +40 -0
  119. package/lib/commands/flow/runtime-resources-shared.js +1 -0
  120. package/lib/commands/flow/runtime-role-list.d.ts +2 -0
  121. package/lib/commands/flow/runtime-role-list.js +1 -0
  122. package/lib/commands/flow/runtime-role-user-list.d.ts +2 -0
  123. package/lib/commands/flow/runtime-role-user-list.js +1 -0
  124. package/lib/commands/flow/runtime-user-search.d.ts +2 -0
  125. package/lib/commands/flow/runtime-user-search.js +1 -0
  126. package/lib/commands/flow/shared.d.ts +41 -0
  127. package/lib/commands/flow/shared.js +1 -0
  128. package/lib/commands/flow/update.d.ts +2 -0
  129. package/lib/commands/flow/update.js +1 -0
  130. package/lib/commands/flow/validate.d.ts +3 -0
  131. package/lib/commands/flow/validate.js +1 -0
  132. package/lib/commands/instant-api-policy/current.js +1 -1
  133. package/lib/commands/instant-api-policy/index.js +1 -1
  134. package/lib/commands/instant-api-policy/init.js +1 -1
  135. package/lib/commands/instant-api-policy/publish.js +1 -1
  136. package/lib/commands/instant-api-policy/pull.js +1 -1
  137. package/lib/commands/instant-api-policy/revision.js +1 -1
  138. package/lib/commands/instant-api-policy/revisions.js +1 -1
  139. package/lib/commands/instant-api-policy/rollback.js +1 -1
  140. package/lib/commands/instant-api-policy/shared.js +1 -1
  141. package/lib/commands/instant-api-policy/validate.js +1 -1
  142. package/lib/commands/issue/index.js +1 -1
  143. package/lib/commands/issue/nudge.js +1 -1
  144. package/lib/commands/issue/report.js +1 -1
  145. package/lib/commands/issue/shared.js +1 -1
  146. package/lib/commands/kb/create.js +1 -1
  147. package/lib/commands/kb/delete.js +1 -1
  148. package/lib/commands/kb/detail.js +1 -1
  149. package/lib/commands/kb/index.js +1 -1
  150. package/lib/commands/kb/list.js +1 -1
  151. package/lib/commands/kb/search.js +1 -1
  152. package/lib/commands/kb/shared.js +1 -1
  153. package/lib/commands/kb/update.js +1 -1
  154. package/lib/commands/logs/index.js +1 -1
  155. package/lib/commands/menu/asset-update.js +1 -1
  156. package/lib/commands/menu/delete.js +1 -1
  157. package/lib/commands/menu/external-link-create.js +1 -1
  158. package/lib/commands/menu/external-link-update.js +1 -1
  159. package/lib/commands/menu/group-create.js +1 -1
  160. package/lib/commands/menu/group-update.js +1 -1
  161. package/lib/commands/menu/index.js +1 -1
  162. package/lib/commands/menu/list.js +1 -1
  163. package/lib/commands/menu/move.js +1 -1
  164. package/lib/commands/menu/regroup-start.js +1 -1
  165. package/lib/commands/menu/rename.js +1 -1
  166. package/lib/commands/menu/shared/compare-table.js +1 -1
  167. package/lib/commands/menu/shared/delete-plan.js +1 -1
  168. package/lib/commands/menu/shared/facts.js +1 -1
  169. package/lib/commands/menu/shared/index.js +1 -1
  170. package/lib/commands/menu/shared/inquirer.js +1 -1
  171. package/lib/commands/menu/shared/local-pages.js +1 -1
  172. package/lib/commands/menu/shared/logic.js +1 -1
  173. package/lib/commands/menu/shared/mutations.js +1 -1
  174. package/lib/commands/menu/shared/service.js +1 -1
  175. package/lib/commands/menu/shared/sync-core.js +1 -1
  176. package/lib/commands/menu/shared/update-core.js +1 -1
  177. package/lib/commands/menu/shared/valid-url.js +1 -1
  178. package/lib/commands/menu/sync.js +1 -1
  179. package/lib/commands/menu/visibility-update.js +1 -1
  180. package/lib/commands/notification/config-create.js +1 -1
  181. package/lib/commands/notification/config-delete.js +1 -1
  182. package/lib/commands/notification/config-list.js +1 -1
  183. package/lib/commands/notification/config-update.js +1 -1
  184. package/lib/commands/notification/index.js +1 -1
  185. package/lib/commands/notification/shared.js +1 -1
  186. package/lib/commands/ocr/index.js +1 -1
  187. package/lib/commands/page/create.js +1 -1
  188. package/lib/commands/page/custom/detail.js +1 -1
  189. package/lib/commands/page/custom/list.js +1 -1
  190. package/lib/commands/page/custom/publish.js +1 -1
  191. package/lib/commands/page/custom/shared.js +1 -1
  192. package/lib/commands/page/custom/syntax.js +1 -1
  193. package/lib/commands/page/custom/update.js +1 -1
  194. package/lib/commands/page/data-list-status.js +1 -1
  195. package/lib/commands/page/generate-start.js +1 -1
  196. package/lib/commands/page/generate-status.js +1 -1
  197. package/lib/commands/page/index.js +1 -1
  198. package/lib/commands/page/pull.js +1 -1
  199. package/lib/commands/page/push.js +1 -1
  200. package/lib/commands/page/relation-audit.js +1 -1
  201. package/lib/commands/page/restore.js +1 -1
  202. package/lib/commands/page/shared.js +1 -1
  203. package/lib/commands/page/sync.js +1 -1
  204. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  205. package/lib/commands/project/create/format-elapsed.js +1 -1
  206. package/lib/commands/project/create/main.js +1 -1
  207. package/lib/commands/project/create/materialize-project-template.js +1 -1
  208. package/lib/commands/project/create/project-name.js +1 -1
  209. package/lib/commands/project/create/project-template-archive.js +1 -1
  210. package/lib/commands/project/create/project-template-path.js +1 -1
  211. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  212. package/lib/commands/project/create/use-format-code.js +1 -1
  213. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  214. package/lib/commands/project/domain-routing-sync.js +1 -1
  215. package/lib/commands/project/index.js +1 -1
  216. package/lib/commands/project/upgrade.js +1 -1
  217. package/lib/commands/registry.js +1 -1
  218. package/lib/commands/role/delete.js +1 -1
  219. package/lib/commands/role/detail.js +1 -1
  220. package/lib/commands/role/index.js +1 -1
  221. package/lib/commands/role/list.js +1 -1
  222. package/lib/commands/role/shared.js +1 -1
  223. package/lib/commands/role/update.js +1 -1
  224. package/lib/commands/role/user-add.js +1 -1
  225. package/lib/commands/role/user-remove.js +1 -1
  226. package/lib/commands/role/user-resolve.js +1 -1
  227. package/lib/commands/rule/get.js +1 -1
  228. package/lib/commands/rule/index.js +1 -1
  229. package/lib/commands/rule/list.js +1 -1
  230. package/lib/commands/rule/set.js +1 -1
  231. package/lib/commands/rule/shared.js +1 -1
  232. package/lib/commands/run/index.js +1 -1
  233. package/lib/commands/schema.js +1 -1
  234. package/lib/commands/sql/create.js +1 -1
  235. package/lib/commands/sql/delete.js +1 -1
  236. package/lib/commands/sql/detail.js +1 -1
  237. package/lib/commands/sql/exec.js +1 -1
  238. package/lib/commands/sql/index.js +1 -1
  239. package/lib/commands/sql/list.js +1 -1
  240. package/lib/commands/sql/pull.js +1 -1
  241. package/lib/commands/sql/push.js +1 -1
  242. package/lib/commands/sql/shared.js +1 -1
  243. package/lib/commands/sql/status.js +1 -1
  244. package/lib/commands/sql/validate.js +1 -1
  245. package/lib/commands/task/index.js +1 -1
  246. package/lib/commands/task/status.js +1 -1
  247. package/lib/commands/tenant/index.js +1 -1
  248. package/lib/commands/tenant/members-list.js +1 -1
  249. package/lib/commands/tenant/shared.js +1 -1
  250. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  251. package/lib/commands/user-account/index.js +1 -1
  252. package/lib/commands/workspace/add.js +1 -1
  253. package/lib/commands/workspace/index.js +1 -1
  254. package/lib/commands/workspace/remove.js +1 -1
  255. package/lib/config/domain-config.js +1 -1
  256. package/lib/config/project-domain-routing.js +1 -1
  257. package/lib/config/region-config.js +1 -1
  258. package/lib/config/schema.js +1 -1
  259. package/lib/constant/cdn.js +1 -1
  260. package/lib/constant/cli.js +1 -1
  261. package/lib/constant/defaults.js +1 -1
  262. package/lib/constant/domain.js +1 -1
  263. package/lib/constant/env.js +1 -1
  264. package/lib/constant/output.js +1 -1
  265. package/lib/constant/paths.js +1 -1
  266. package/lib/constant/region.js +1 -1
  267. package/lib/constant/risk.js +1 -1
  268. package/lib/constant/routing-profile.js +1 -1
  269. package/lib/context/app-resolver.js +1 -1
  270. package/lib/context/auth-resolver.js +1 -1
  271. package/lib/context/config-loader.js +1 -1
  272. package/lib/context.js +1 -1
  273. package/lib/core/alias-resolver.js +1 -1
  274. package/lib/core/api-client.d.ts +170 -1
  275. package/lib/core/api-client.js +1 -1
  276. package/lib/core/bff/config.js +1 -1
  277. package/lib/core/bff/file-system.js +1 -1
  278. package/lib/core/bff/hash.js +1 -1
  279. package/lib/core/bff/hook-directory.d.ts +55 -0
  280. package/lib/core/bff/hook-directory.js +1 -0
  281. package/lib/core/bff/lock.js +1 -1
  282. package/lib/core/bff/types.d.ts +15 -0
  283. package/lib/core/bff/utils.js +1 -1
  284. package/lib/core/db-resolver.js +1 -1
  285. package/lib/core/flow-config.d.ts +628 -0
  286. package/lib/core/flow-config.js +1 -0
  287. package/lib/core/instant-api-policy/config.js +1 -1
  288. package/lib/core/kb-search-client.js +1 -1
  289. package/lib/core/page/file-system.js +1 -1
  290. package/lib/core/page/hash.js +1 -1
  291. package/lib/core/page/lock.js +1 -1
  292. package/lib/core/page/lr-smart-jsx.js +1 -1
  293. package/lib/core/sql-index-auditor.js +1 -1
  294. package/lib/core/sql-sync/config.js +1 -1
  295. package/lib/core/sql-sync/file-system.js +1 -1
  296. package/lib/core/sql-sync/hash.js +1 -1
  297. package/lib/core/sql-sync/lock.js +1 -1
  298. package/lib/core/sql-sync/utils.js +1 -1
  299. package/lib/core/sql-validator.js +1 -1
  300. package/lib/errors.js +1 -1
  301. package/lib/framework/build-all-flags.js +1 -1
  302. package/lib/framework/error-output.js +1 -1
  303. package/lib/framework/explicit-yes.js +1 -1
  304. package/lib/framework/flags.js +1 -1
  305. package/lib/framework/help.js +1 -1
  306. package/lib/framework/index.js +1 -1
  307. package/lib/framework/output.js +1 -1
  308. package/lib/framework/response.js +1 -1
  309. package/lib/framework/runner-alias.js +1 -1
  310. package/lib/framework/runner.js +1 -1
  311. package/lib/framework/schema-export.js +1 -1
  312. package/lib/framework/supported-flags.js +1 -1
  313. package/lib/framework/types.js +1 -1
  314. package/lib/generated/build-info.d.ts +4 -4
  315. package/lib/generated/build-info.js +1 -1
  316. package/lib/generated/official-routing.js +1 -1
  317. package/lib/generated/routing-contract.js +1 -1
  318. package/lib/help.js +1 -1
  319. package/lib/postinstall.js +1 -1
  320. package/lib/runtime/confirmation.js +1 -1
  321. package/lib/runtime/event.js +1 -1
  322. package/lib/runtime/index.js +1 -1
  323. package/lib/runtime/queue.js +1 -1
  324. package/lib/runtime/resolve.js +1 -1
  325. package/lib/skills/builtin-skill.js +1 -1
  326. package/lib/skills/main.js +1 -1
  327. package/lib/skills/npx-skills-add.js +1 -1
  328. package/lib/skills/skill-presence.js +1 -1
  329. package/lib/telemetry/cli-command-trace.js +1 -1
  330. package/lib/telemetry/cli-help-trace.js +1 -1
  331. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  332. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  333. package/lib/telemetry/send-cli-trace-log.js +1 -1
  334. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  335. package/lib/utils/ai_config.js +1 -1
  336. package/lib/utils/apply-jq-filter.js +1 -1
  337. package/lib/utils/cdn-config.js +1 -1
  338. package/lib/utils/check-sdk-version.js +1 -1
  339. package/lib/utils/cli-version-check.js +1 -1
  340. package/lib/utils/cli-version-policy.js +1 -1
  341. package/lib/utils/config.js +1 -1
  342. package/lib/utils/entity-with-id.js +1 -1
  343. package/lib/utils/file-utils.js +1 -1
  344. package/lib/utils/guides-cdn.js +1 -1
  345. package/lib/utils/http-client.js +1 -1
  346. package/lib/utils/is-non-interactive.js +1 -1
  347. package/lib/utils/logger.js +1 -1
  348. package/lib/utils/params.js +1 -1
  349. package/lib/utils/platform.js +1 -1
  350. package/lib/utils/sleep.js +1 -1
  351. package/lib/utils/template-replacer.js +1 -1
  352. package/lib/utils/update-notice.js +1 -1
  353. package/lib/utils/version.js +1 -1
  354. package/lib/utils/with-active-cookie.js +1 -1
  355. package/lib/utils/write-cli-side-channel.js +1 -1
  356. package/package.json +1 -1
  357. package/skills/rabetbase/SKILL.md +22 -4
  358. package/skills/rabetbase/guides/approval-flow-development-workflow.md +137 -0
  359. package/skills/rabetbase/guides/backend-function.md +19 -9
  360. package/skills/rabetbase/guides/bff-creation-workflow.md +10 -1
  361. package/skills/rabetbase/guides/conflict-detection.md +2 -0
  362. package/skills/rabetbase/guides/sdk-client-generation.md +1 -0
  363. package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +290 -0
  364. package/skills/rabetbase/references/rabetbase-bff-create.md +1 -1
  365. package/skills/rabetbase/references/rabetbase-bff-logs.md +47 -0
  366. package/skills/rabetbase/references/rabetbase-bff-pull.md +7 -3
  367. package/skills/rabetbase/references/rabetbase-bff-push.md +10 -2
  368. package/skills/rabetbase/references/rabetbase-dataset-generate.md +52 -2
  369. package/skills/rabetbase/references/rabetbase-flow-commands.md +86 -0
  370. package/skills/rabetbase/references/rabetbase-flow-resources.md +83 -0
  371. package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +25 -0
  372. package/skills/rabetbase/references/rabetbase-instant-api-policy.md +103 -11
  373. package/skills/rabetbase/references/rabetbase-notification-config-list.md +17 -0
  374. package/skills/rabetbase.manifest.json +9 -3
@@ -0,0 +1,55 @@
1
+ import type { DatasetItem } from "../../core/api-client.js";
2
+ import type { BffLockEntry, BffLockScope, HookDirectoryProtocol, LocalBffFunction } from "../../core/bff/types.js";
3
+ export interface HookDirectoryWarning {
4
+ code: "DATASET_CODE_FALLBACK";
5
+ message: string;
6
+ datasetCode: string;
7
+ }
8
+ export interface HookDirectoryResolution {
9
+ dataset: DatasetItem;
10
+ datasetCode: string;
11
+ alias?: string;
12
+ directoryProtocol: HookDirectoryProtocol;
13
+ warnings: HookDirectoryWarning[];
14
+ }
15
+ export interface HookDirectoryIndexes {
16
+ datasetCodeToDatasets: Map<string, DatasetItem[]>;
17
+ aliasToDatasetCodes: Map<string, string[]>;
18
+ }
19
+ export interface HookAliasMapping {
20
+ alias: string;
21
+ datasetCode: string;
22
+ }
23
+ /**
24
+ * Returns the on-disk directory bindings from tracked HOOK entries. A lock
25
+ * key remains authoritative for existing files, including pre-alias and old
26
+ * tableName directories that must not be silently copied or renamed.
27
+ */
28
+ export declare function trackedHookDirectoryMappings(appLock: BffLockScope): HookAliasMapping[];
29
+ /**
30
+ * Select the one historical directory a Dataset may continue using during
31
+ * pull. This lets a newly added remote HOOK join an existing tracked tree
32
+ * after an SDK alias rename, rather than creating a second local directory.
33
+ */
34
+ export declare function uniqueTrackedHookDirectoryByDataset(appLock: BffLockScope): Map<string, string>;
35
+ /**
36
+ * Multiple historical directories may refer to one Dataset, but one physical
37
+ * directory must never resolve to different Datasets. This protects both
38
+ * push binding and pull target-path selection on case-insensitive file systems.
39
+ */
40
+ export declare function assertUnambiguousHookDirectoryMappings(entries: Iterable<HookAliasMapping>): void;
41
+ /**
42
+ * A remote HOOK has exactly one local target directory. Reject ambiguous SDK
43
+ * aliases before a caller reduces them to a Map (which would silently choose
44
+ * an arbitrary Dataset) or uses them to derive a pull path.
45
+ */
46
+ export declare function assertUnambiguousHookAliases(entries: Iterable<HookAliasMapping>): void;
47
+ /**
48
+ * Build the two supported HOOK directory namespaces. The preferred directory
49
+ * is the SDK alias; raw datasetCode remains the fallback for projects that do
50
+ * not have an alias or for previously downloaded deleted Datasets.
51
+ */
52
+ export declare function buildHookDirectoryIndexes(datasets: DatasetItem[], aliasToDatasetCode?: Iterable<readonly [string, string]>): HookDirectoryIndexes;
53
+ export declare function resolvePushHookDirectory(directoryName: string, lockEntry: BffLockEntry | undefined, indexes: HookDirectoryIndexes): HookDirectoryResolution;
54
+ export declare function preflightPushHookDirectories(functions: LocalBffFunction[], appLock: BffLockScope, indexes: HookDirectoryIndexes, failures?: Map<string, string>): Map<string, HookDirectoryResolution>;
55
+ export declare function hookDirectoryError(code: string, message: string, details: Record<string, unknown>): Error;
@@ -0,0 +1 @@
1
+ (function(_0x5ac1da,_0x13d4b6){const _0x18b2ee=a264_0x5f0d,_0x3cefb5=_0x5ac1da();while(!![]){try{const _0x1871cf=parseInt(_0x18b2ee(0x11b))/0x1*(parseInt(_0x18b2ee(0x11c))/0x2)+-parseInt(_0x18b2ee(0x104))/0x3*(-parseInt(_0x18b2ee(0x110))/0x4)+parseInt(_0x18b2ee(0x10b))/0x5+parseInt(_0x18b2ee(0x10c))/0x6+parseInt(_0x18b2ee(0xf1))/0x7*(-parseInt(_0x18b2ee(0x113))/0x8)+-parseInt(_0x18b2ee(0x116))/0x9*(parseInt(_0x18b2ee(0x121))/0xa)+-parseInt(_0x18b2ee(0x11a))/0xb;if(_0x1871cf===_0x13d4b6)break;else _0x3cefb5['push'](_0x3cefb5['shift']());}catch(_0x4c2503){_0x3cefb5['push'](_0x3cefb5['shift']());}}}(a264_0x12d6,0x9038b));function a264_0x5f0d(_0x46ae2d,_0x5c9f51){_0x46ae2d=_0x46ae2d-0xee;const _0x12d6c2=a264_0x12d6();let _0x5f0d44=_0x12d6c2[_0x46ae2d];return _0x5f0d44;}function a264_0x12d6(){const _0x28d3bf=['HOOK_ALIAS_AMBIGUOUS','length','normalize','message','SDK\x20alias\x20\x22','values','size','Cannot\x20resolve\x20HOOK\x20directory\x20\x22','includes','alias','datasetCode','\x22\x20has\x20multiple\x20SDK\x20aliases\x20and\x20has\x20no\x20unique\x20HOOK\x20directory.','push','HOOK_DATASET_NOT_FOUND','HOOK\x20directory\x20\x22','HOOK_DATASET_CODE_AMBIGUOUS','\x22\x20resolves\x20to\x20multiple\x20Datasets.','1215PViwfG','datasetCodeToDatasets','toLowerCase','lockKey','\x22\x20has\x20multiple\x20tracked\x20HOOK\x20directories:\x20','set','entries','4899110WLBDXx','4928616fILJnn','get','functions','code','3364YzTena','HOOK_DIRECTORY_UNRESOLVED','HOOK_DIRECTORY_AMBIGUOUS','91384wHTuXd','name','join','827208keoNgq','\x22\x20differs\x20only\x20by\x20case\x20from\x20another\x20Dataset\x20code.','add','HOOK_MAPPING_DRIFT','8719799xKjmmR','1ICPvaP','1580036tDGCiV','HOOK_DUPLICATE_DIRECTORIES','Dataset\x20\x22','\x22\x20changed\x20mapping\x20from\x20Dataset\x20\x22','\x22\x20to\x20\x22','120ETzqLN','type','split','details','Dataset\x20code\x20\x22','\x22\x20collides\x20across\x20datasetCode\x20and\x20alias\x20namespaces.','HOOK','map','\x22\x20to\x20a\x20Dataset\x20alias\x20or\x20datasetCode.','273rlcVsN','\x22\x20is\x20represented\x20by\x20multiple\x20HOOK\x20directories:\x20'];a264_0x12d6=function(){return _0x28d3bf;};return a264_0x12d6();}import{CliError}from'../../errors.js';export function trackedHookDirectoryMappings(_0x39bf4a){const _0x4effa3=a264_0x5f0d,_0x3144eb=[];for(const [_0x57b91f,_0x3418ea]of Object[_0x4effa3(0x10a)](_0x39bf4a[_0x4effa3(0x10e)])){const [_0x292985,_0x24a407]=_0x57b91f[_0x4effa3(0x123)]('/');if(_0x292985!==_0x4effa3(0xee)||!_0x24a407||!_0x3418ea[_0x4effa3(0xfd)])continue;_0x3144eb[_0x4effa3(0xff)]({'alias':_0x24a407,'datasetCode':_0x3418ea[_0x4effa3(0xfd)]});}return _0x3144eb;}export function uniqueTrackedHookDirectoryByDataset(_0x4f1123){const _0x63c1a8=a264_0x5f0d,_0x3380ce=new Map();for(const _0x4133ac of trackedHookDirectoryMappings(_0x4f1123)){const _0x3215c0=directoryIdentity(_0x4133ac[_0x63c1a8(0xfd)]),_0x39215a=_0x3380ce[_0x63c1a8(0x10d)](_0x3215c0)??new Map();_0x39215a['set'](directoryIdentity(_0x4133ac[_0x63c1a8(0xfc)]),_0x4133ac[_0x63c1a8(0xfc)]),_0x3380ce[_0x63c1a8(0x109)](_0x3215c0,_0x39215a);}const _0x42f797=new Map();for(const [_0x300e11,_0x374c23]of _0x3380ce){if(_0x374c23[_0x63c1a8(0xf9)]>0x1)throw hookDirectoryError('HOOK_DUPLICATE_DIRECTORIES',_0x63c1a8(0x11e)+_0x300e11+_0x63c1a8(0x108)+[..._0x374c23[_0x63c1a8(0xf8)]()][_0x63c1a8(0x115)](',\x20')+'.',{'datasetCode':_0x300e11,'directories':[..._0x374c23[_0x63c1a8(0xf8)]()]});_0x42f797[_0x63c1a8(0x109)](_0x300e11,[..._0x374c23[_0x63c1a8(0xf8)]()][0x0]);}return _0x42f797;}export function assertUnambiguousHookDirectoryMappings(_0x2e894d){const _0x565a06=a264_0x5f0d,_0x296e04=new Map();for(const {alias:_0x25ef7c,datasetCode:_0x3bad42}of _0x2e894d){const _0x37874c=directoryIdentity(_0x25ef7c),_0x28d61e=_0x296e04[_0x565a06(0x10d)](_0x37874c)??new Set();_0x28d61e['add'](_0x3bad42),_0x296e04[_0x565a06(0x109)](_0x37874c,_0x28d61e);}for(const [_0x1af008,_0x25c462]of _0x296e04){if(_0x25c462[_0x565a06(0xf9)]>0x1)throw hookDirectoryError(_0x565a06(0x112),_0x565a06(0x101)+_0x1af008+_0x565a06(0x103),{'directoryName':_0x1af008,'datasetCodes':[..._0x25c462]});}}export function assertUnambiguousHookAliases(_0x1649a8){const _0x1a0e7c=a264_0x5f0d,_0x13cbf9=[..._0x1649a8],_0x5b8240=new Map(),_0x1c89a5=new Map();for(const {alias:_0x5b373e,datasetCode:_0x4f3e02}of _0x13cbf9){const _0x20bd53=directoryIdentity(_0x5b373e),_0x4400c8=directoryIdentity(_0x4f3e02),_0x3ee9ab=_0x5b8240[_0x1a0e7c(0x10d)](_0x20bd53)??new Set();_0x3ee9ab[_0x1a0e7c(0x118)](_0x4f3e02),_0x5b8240['set'](_0x20bd53,_0x3ee9ab);const _0x139786=_0x1c89a5['get'](_0x4400c8)??new Set();_0x139786[_0x1a0e7c(0x118)](_0x5b373e),_0x1c89a5[_0x1a0e7c(0x109)](_0x4400c8,_0x139786);}for(const [_0x1b16d9,_0x1ee982]of _0x5b8240){if(_0x1ee982[_0x1a0e7c(0xf9)]>0x1)throw hookDirectoryError('HOOK_ALIAS_AMBIGUOUS',_0x1a0e7c(0xf7)+_0x1b16d9+_0x1a0e7c(0x103),{'alias':_0x1b16d9,'datasetCodes':[..._0x1ee982]});}for(const [_0x38c647,_0x25fefd]of _0x1c89a5){if(_0x25fefd['size']>0x1)throw hookDirectoryError(_0x1a0e7c(0xf3),_0x1a0e7c(0x11e)+_0x38c647+_0x1a0e7c(0xfe),{'datasetCode':_0x38c647,'aliases':[..._0x25fefd]});}}export function buildHookDirectoryIndexes(_0x55a4ed,_0x493493=[]){const _0x579c34=a264_0x5f0d,_0x1a4f21=[..._0x493493];assertUnambiguousHookDirectoryMappings(_0x1a4f21[_0x579c34(0xef)](([_0xaceab3,_0x5379e9])=>({'alias':_0xaceab3,'datasetCode':_0x5379e9})));const _0x1ff66d=new Map(),_0x247afe=new Map();for(const _0x5dcc02 of _0x55a4ed){appendUnique(_0x1ff66d,directoryIdentity(_0x5dcc02['code']),_0x5dcc02,_0x5ea8f4=>_0x5ea8f4[_0x579c34(0x10f)]);}for(const [_0x5bad93,_0x392a18]of _0x1a4f21){appendUnique(_0x247afe,directoryIdentity(_0x5bad93),_0x392a18,_0xbbe7db=>_0xbbe7db);}return{'datasetCodeToDatasets':_0x1ff66d,'aliasToDatasetCodes':_0x247afe};}export function resolvePushHookDirectory(_0x2e550d,_0x3b622b,_0x5c24f6){const _0x4c2178=a264_0x5f0d,_0x32693b=directoryIdentity(_0x2e550d),_0x39d10f=_0x5c24f6[_0x4c2178(0x105)][_0x4c2178(0x10d)](_0x32693b)??[],_0x57e307=_0x5c24f6['aliasToDatasetCodes']['get'](_0x32693b)??[],_0x1cd824=new Set([..._0x39d10f[_0x4c2178(0xef)](_0x50b299=>_0x50b299[_0x4c2178(0x10f)]),..._0x57e307]);if(_0x1cd824[_0x4c2178(0xf9)]>0x1)throw hookDirectoryError(_0x4c2178(0x112),_0x4c2178(0x101)+_0x2e550d+_0x4c2178(0x126),{'directoryName':_0x2e550d,'datasetCodes':[..._0x1cd824]});const _0xb6abdb=[..._0x1cd824][0x0];if(_0xb6abdb&&_0x3b622b?.[_0x4c2178(0xfd)]&&_0xb6abdb!==_0x3b622b['datasetCode'])throw hookDirectoryError(_0x4c2178(0x119),'HOOK\x20directory\x20\x22'+_0x2e550d+_0x4c2178(0x11f)+_0x3b622b[_0x4c2178(0xfd)]+_0x4c2178(0x120)+_0xb6abdb+'\x22.',{'directoryName':_0x2e550d,'datasetCode':_0xb6abdb,'lockedDatasetCode':_0x3b622b[_0x4c2178(0xfd)]});const _0x37282b=_0xb6abdb?findDatasetByCode(_0x5c24f6,_0xb6abdb):undefined,_0x2b84ee=!!_0xb6abdb&&_0x57e307[_0x4c2178(0xfb)](_0xb6abdb);if(_0x37282b)return{'dataset':_0x37282b,'datasetCode':_0x37282b[_0x4c2178(0x10f)],..._0x2b84ee?{'alias':_0x2e550d}:{},'directoryProtocol':_0x2b84ee?_0x4c2178(0xfc):_0x4c2178(0xfd),'warnings':[]};const _0x461abf=_0x3b622b?.[_0x4c2178(0xfd)];if(_0x461abf){const _0xe1c9d8=findDatasetByCode(_0x5c24f6,_0x461abf);if(_0xe1c9d8)return{'dataset':_0xe1c9d8,'datasetCode':_0xe1c9d8[_0x4c2178(0x10f)],..._0x3b622b[_0x4c2178(0xfc)]?{'alias':_0x3b622b[_0x4c2178(0xfc)]}:{},'directoryProtocol':_0x3b622b[_0x4c2178(0xfc)]?_0x4c2178(0xfc):_0x4c2178(0xfd),'warnings':[]};}if(_0xb6abdb||_0x461abf){const _0x2e2e64=_0xb6abdb??_0x461abf;throw hookDirectoryError(_0x4c2178(0x100),_0x4c2178(0x101)+_0x2e550d+'\x22\x20points\x20to\x20a\x20Dataset\x20that\x20is\x20absent\x20from\x20current\x20platform\x20metadata.',{'directoryName':_0x2e550d,'datasetCode':_0x2e2e64});}throw hookDirectoryError(_0x4c2178(0x111),_0x4c2178(0xfa)+_0x2e550d+_0x4c2178(0xf0),{'directoryName':_0x2e550d});}export function preflightPushHookDirectories(_0x1a2f6f,_0x2f4f5f,_0x212c92,_0x2ff915){const _0x38a646=a264_0x5f0d,_0x6e41c3=new Map(),_0x877fa2=new Map();for(const _0x26c4bc of _0x1a2f6f){if(_0x26c4bc[_0x38a646(0x122)]!==_0x38a646(0xee))continue;const _0x326aff=_0x26c4bc['alias'];if(!_0x326aff)throw hookDirectoryError(_0x38a646(0x111),'Incomplete\x20HOOK\x20path:\x20'+_0x26c4bc[_0x38a646(0x107)],{'lockKey':_0x26c4bc['lockKey']});let _0x5cb81a;try{_0x5cb81a=resolvePushHookDirectory(_0x326aff,_0x2f4f5f[_0x38a646(0x10e)][_0x26c4bc[_0x38a646(0x107)]],_0x212c92);}catch(_0x561e1f){if(_0x2ff915&&_0x561e1f instanceof CliError&&[_0x38a646(0x100),_0x38a646(0x111)][_0x38a646(0xfb)](_0x561e1f['code'])){_0x2ff915[_0x38a646(0x109)](_0x26c4bc[_0x38a646(0x107)],_0x561e1f[_0x38a646(0xf6)]);continue;}throw _0x561e1f;}_0x6e41c3[_0x38a646(0x109)](_0x26c4bc[_0x38a646(0x107)],_0x5cb81a);const _0x1a9260=_0x877fa2[_0x38a646(0x10d)](_0x5cb81a[_0x38a646(0xfd)])??new Set();_0x1a9260[_0x38a646(0x118)](_0x326aff),_0x877fa2[_0x38a646(0x109)](_0x5cb81a[_0x38a646(0xfd)],_0x1a9260);}for(const [_0x47b2b6,_0x540e4e]of _0x877fa2){if(_0x540e4e[_0x38a646(0xf9)]>0x1)throw hookDirectoryError(_0x38a646(0x11d),'Dataset\x20\x22'+_0x47b2b6+_0x38a646(0xf2)+[..._0x540e4e]['join'](',\x20')+'.',{'datasetCode':_0x47b2b6,'directories':[..._0x540e4e]});}return _0x6e41c3;}export function hookDirectoryError(_0x3f32d0,_0x4b7677,_0x20b865){const _0x1417a5=a264_0x5f0d,_0xd25010=new CliError(_0x3f32d0,0x2,_0x3f32d0+':\x20'+_0x4b7677);return _0xd25010[_0x1417a5(0x124)]=_0x20b865,_0xd25010;}function findDatasetByCode(_0x5914b7,_0x44016d){const _0x5b00c4=a264_0x5f0d,_0x27a2e8=_0x5914b7[_0x5b00c4(0x105)][_0x5b00c4(0x10d)](directoryIdentity(_0x44016d))??[];if(_0x27a2e8[_0x5b00c4(0xf4)]>0x1)throw hookDirectoryError(_0x5b00c4(0x102),_0x5b00c4(0x125)+_0x44016d+_0x5b00c4(0x117),{'datasetCode':_0x44016d,'candidates':_0x27a2e8[_0x5b00c4(0xef)](datasetFact)});return _0x27a2e8[0x0];}function directoryIdentity(_0x504b08){const _0xd5aaad=a264_0x5f0d;return _0x504b08[_0xd5aaad(0xf5)]('NFC')[_0xd5aaad(0x106)]();}function appendUnique(_0x1e418f,_0x521e2f,_0x3d90d1,_0x23bece){const _0x2ad3d3=a264_0x5f0d,_0x15e40d=_0x1e418f[_0x2ad3d3(0x10d)](_0x521e2f)??[];!_0x15e40d['some'](_0x10b03b=>_0x23bece(_0x10b03b)===_0x23bece(_0x3d90d1))&&_0x15e40d[_0x2ad3d3(0xff)](_0x3d90d1),_0x1e418f['set'](_0x521e2f,_0x15e40d);}function datasetFact(_0x5ee582){const _0x2e5ac3=a264_0x5f0d;return{'id':_0x5ee582['id'],'name':_0x5ee582[_0x2e5ac3(0x114)],'datasetCode':_0x5ee582['code']};}
@@ -1 +1 @@
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
+ (function(_0x543fc6,_0x39cc47){const _0x3cbb1f=a265_0x2ca4,_0x166027=_0x543fc6();while(!![]){try{const _0x23ca29=parseInt(_0x3cbb1f(0x104))/0x1+parseInt(_0x3cbb1f(0x113))/0x2*(parseInt(_0x3cbb1f(0x117))/0x3)+parseInt(_0x3cbb1f(0x106))/0x4*(parseInt(_0x3cbb1f(0x11a))/0x5)+parseInt(_0x3cbb1f(0x10b))/0x6+-parseInt(_0x3cbb1f(0x107))/0x7*(parseInt(_0x3cbb1f(0x112))/0x8)+-parseInt(_0x3cbb1f(0x114))/0x9+parseInt(_0x3cbb1f(0x111))/0xa;if(_0x23ca29===_0x39cc47)break;else _0x166027['push'](_0x166027['shift']());}catch(_0x530bf0){_0x166027['push'](_0x166027['shift']());}}}(a265_0x9e15,0xaaf57));import{mkdir,readFile,writeFile}from'node:fs/promises';function a265_0x2ca4(_0x3257c7,_0x12f4cc){_0x3257c7=_0x3257c7-0x104;const _0x9e15c7=a265_0x9e15();let _0x2ca4f8=_0x9e15c7[_0x3257c7];return _0x2ca4f8;}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x1abcb7,_0x56f94c,_0xeb74a8,_0x2f1ba8){const _0x5acfd2=a265_0x2ca4,_0x1cb820={'apps':_0x1abcb7[_0x5acfd2(0x10d)]&&typeof _0x1abcb7['apps']===_0x5acfd2(0x115)?_0x1abcb7[_0x5acfd2(0x10d)]:{}};let _0x468080=_0x1cb820[_0x5acfd2(0x10d)][_0x56f94c];if(!_0x468080)return _0x468080={'scriptsRoot':_0xeb74a8,'lastSync':'','functions':{}},_0x1cb820[_0x5acfd2(0x10d)][_0x56f94c]=_0x468080,{'lockData':_0x1cb820,'appLock':_0x468080};if(!_0x468080['scriptsRoot'])_0x468080[_0x5acfd2(0x10a)]=_0xeb74a8;else{if(_0x468080[_0x5acfd2(0x10a)]!==_0xeb74a8)throw new Error(_0x2f1ba8+_0x5acfd2(0x118)+(_0x5acfd2(0x110)+_0xeb74a8+_0x5acfd2(0x10e)+_0x468080[_0x5acfd2(0x10a)]+_0x5acfd2(0x108))+_0x5acfd2(0x119));}return!_0x468080[_0x5acfd2(0x10f)]&&(_0x468080[_0x5acfd2(0x10f)]={}),!_0x468080[_0x5acfd2(0x109)]&&(_0x468080[_0x5acfd2(0x109)]=''),{'lockData':_0x1cb820,'appLock':_0x468080};}export async function readBffLockFile(_0x5e1cbb){const _0x2b1ca4=a265_0x2ca4;try{const _0x49584a=await readFile(_0x5e1cbb,_0x2b1ca4(0x116)),_0x4e5e35=JSON[_0x2b1ca4(0x105)](_0x49584a);return{'apps':_0x4e5e35[_0x2b1ca4(0x10d)]&&typeof _0x4e5e35[_0x2b1ca4(0x10d)]===_0x2b1ca4(0x115)?_0x4e5e35['apps']:{}};}catch(_0x192e85){if(_0x192e85['code']==='ENOENT')return null;throw new Error(_0x2b1ca4(0x10c)+String(_0x192e85));}}export async function writeBffLockFile(_0x2bdd93,_0x456820){const _0x38457e=a265_0x2ca4;await mkdir(dirname(_0x2bdd93),{'recursive':!![]}),await writeFile(_0x2bdd93,JSON['stringify'](_0x456820,null,0x2),_0x38457e(0x116));}function a265_0x9e15(){const _0x4dace1=['1005YFirNo','808328oNYjQg','parse','2980dzvKrP','70BLwMHH','\x22.\x20','lastSync','scriptsRoot','3176622DJBLjf','Failed\x20to\x20read\x20Backend\x20Function\x20lock\x20file:\x20','apps','\x22\x20vs\x20lock\x20\x22','functions','current\x20\x22','11897820USjxTH','927632bADiUJ','4axKiPo','12154887RblSbl','object','utf8','799557CTSlUB',':\x20scriptsRoot\x20mismatch\x20—\x20','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.'];a265_0x9e15=function(){return _0x4dace1;};return a265_0x9e15();}
@@ -5,6 +5,7 @@
5
5
  * 仅类型,不含运行时逻辑。
6
6
  */
7
7
  export type BffScriptType = "COMMON" | "ENDPOINT" | "HOOK";
8
+ export type HookDirectoryProtocol = "alias" | "datasetCode";
8
9
  export interface HookLocation {
9
10
  /** api.ts 中定义的别名,用于本地目录命名和 lockKey。从 statistics 构建时可能缺失,由命令层补充。 */
10
11
  alias?: string;
@@ -42,6 +43,20 @@ export interface BffLockScope {
42
43
  export interface BffLockFile {
43
44
  apps: Record<string, BffLockScope>;
44
45
  }
46
+ export interface BffSyncConflict {
47
+ code: "BFF_LOCAL_UNSYNCED" | "BFF_REMOTE_VERSION_CHANGED" | "BFF_REMOTE_VERSION_MISSING";
48
+ lockKey: string;
49
+ filePath: string;
50
+ remoteId?: number;
51
+ expectedVersion?: number;
52
+ message: string;
53
+ nextAction: {
54
+ action: "push_local" | "review_remote_and_merge";
55
+ command: string;
56
+ requiresReview: true;
57
+ message: string;
58
+ };
59
+ }
45
60
  export interface ScriptStatistics {
46
61
  datasetCode: string;
47
62
  operationType: string;
@@ -1 +1 @@
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
+ const a267_0x1c58f5=a267_0x50d5;function a267_0x50d5(_0x218b0d,_0x3f8ed4){_0x218b0d=_0x218b0d-0x1c9;const _0x4fd0ba=a267_0x4fd0();let _0x50d527=_0x4fd0ba[_0x218b0d];return _0x50d527;}(function(_0x414627,_0x5507b6){const _0x4a2733=a267_0x50d5,_0x4b1155=_0x414627();while(!![]){try{const _0x208d60=parseInt(_0x4a2733(0x1ca))/0x1*(-parseInt(_0x4a2733(0x1e1))/0x2)+-parseInt(_0x4a2733(0x1d7))/0x3*(parseInt(_0x4a2733(0x1d1))/0x4)+parseInt(_0x4a2733(0x1e0))/0x5+parseInt(_0x4a2733(0x1d5))/0x6+parseInt(_0x4a2733(0x1dc))/0x7*(parseInt(_0x4a2733(0x1d2))/0x8)+parseInt(_0x4a2733(0x1cf))/0x9*(-parseInt(_0x4a2733(0x1cd))/0xa)+parseInt(_0x4a2733(0x1e4))/0xb*(-parseInt(_0x4a2733(0x1d9))/0xc);if(_0x208d60===_0x5507b6)break;else _0x4b1155['push'](_0x4b1155['shift']());}catch(_0x1bf3f0){_0x4b1155['push'](_0x4b1155['shift']());}}}(a267_0x4fd0,0x632ea));export const DEFAULT_BFF_SCRIPT_DESCRIPTION=a267_0x1c58f5(0x1cc);const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION=a267_0x1c58f5(0x1d8);function a267_0x4fd0(){const _0x32b174=['map','split','2165400bFqihf','some','12NTNAxn','TODO:\x20add\x20script\x20description','376392KrgmEM','after','toLowerCase','7ybcKAh','trim','toUpperCase','remoteId','3690615kOxLVE','10eeyZMt','replace','test','11hRRquP','functionNode','startsWith','before','entries','10552vmDCAc','alias','TODO:\x20补充脚本功能描述','380480nhJSZv','match','126UOrvrq','operationType','431968piRGQY','2847944NZUsfv'];a267_0x4fd0=function(){return _0x32b174;};return a267_0x4fd0();}export function snakeToCamel(_0x576a17){const _0x1b91f8=a267_0x1c58f5;return _0x576a17[_0x1b91f8(0x1db)]()[_0x1b91f8(0x1e2)](/_([a-z])/g,(_0xdab82a,_0x4ae2f2)=>_0x4ae2f2[_0x1b91f8(0x1de)]());}export function findHookLocationByRemoteId(_0x27cb04,_0x23c4cb){const _0x50dc14=a267_0x1c58f5;if(!_0x23c4cb)return undefined;for(const [_0x383cc7,_0x540e62]of Object[_0x50dc14(0x1c9)](_0x27cb04)){if(_0x540e62[_0x50dc14(0x1df)]===_0x23c4cb&&_0x540e62['datasetCode']&&_0x540e62['operationType']&&_0x540e62[_0x50dc14(0x1e5)]){const _0x3912b8=_0x383cc7[_0x50dc14(0x1d4)]('/')[0x1];return{'alias':_0x3912b8||_0x540e62[_0x50dc14(0x1cb)],'datasetCode':_0x540e62['datasetCode'],'operationType':_0x540e62[_0x50dc14(0x1d0)],'functionNode':_0x540e62[_0x50dc14(0x1e5)]};}}return undefined;}export function extractScriptDescription(_0x51cb68){const _0x260372=a267_0x1c58f5,_0x140468=_0x51cb68[_0x260372(0x1ce)](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x140468?.[0x1])return undefined;const _0x112c89=_0x140468[0x1],_0x21c469=_0x54cccb=>{const _0x242b7d=_0x260372,_0x314f38=_0x54cccb?.[_0x242b7d(0x1dd)]();if(!_0x314f38||_0x314f38===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x314f38===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x314f38;},_0x3357d2=_0x112c89[_0x260372(0x1ce)](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x3357d2)return _0x21c469(_0x3357d2[0x1]);const _0x56a45f=_0x112c89[_0x260372(0x1d4)](/\r?\n/)[_0x260372(0x1d3)](_0x52c555=>_0x52c555[_0x260372(0x1e2)](/^\s*\*\s?/,'')[_0x260372(0x1dd)]()),_0x4b9067=_0x56a45f[_0x260372(0x1d6)](_0x2aa8fb=>/^\[\s*脚本类型\s*]\s*\S+/['test'](_0x2aa8fb))&&_0x56a45f[_0x260372(0x1d6)](_0x2314ce=>/^\[\s*脚本名称\s*]\s*\S+/[_0x260372(0x1e3)](_0x2314ce));if(!_0x4b9067)return undefined;for(const _0x344418 of _0x56a45f){if(!_0x344418||_0x344418[_0x260372(0x1e6)]('@')||/^\[[^\]]+]\s*/[_0x260372(0x1e3)](_0x344418))continue;return _0x21c469(_0x344418);}return undefined;}export function isValidBffFunctionName(_0x2ac4d6){const _0x451369=a267_0x1c58f5;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x451369(0x1e3)](_0x2ac4d6);}export function normalizeHookFunctionNode(_0x5a2775){const _0x295a79=a267_0x1c58f5;if(!_0x5a2775)return undefined;const _0x3291de=_0x5a2775[_0x295a79(0x1dd)]()[_0x295a79(0x1db)]();if(_0x3291de===_0x295a79(0x1e7)||_0x3291de===_0x295a79(0x1da))return _0x3291de;return undefined;}
@@ -1 +1 @@
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
+ function a268_0x4d3f(_0x2524e5,_0x376935){_0x2524e5=_0x2524e5-0x6c;const _0x38ba48=a268_0x38ba();let _0x4d3f7f=_0x38ba48[_0x2524e5];return _0x4d3f7f;}(function(_0x258b4c,_0x5af54c){const _0x514df1=a268_0x4d3f,_0x201222=_0x258b4c();while(!![]){try{const _0x38ff3f=parseInt(_0x514df1(0x87))/0x1+-parseInt(_0x514df1(0x7e))/0x2+parseInt(_0x514df1(0x82))/0x3*(parseInt(_0x514df1(0x77))/0x4)+-parseInt(_0x514df1(0x83))/0x5+-parseInt(_0x514df1(0x73))/0x6+parseInt(_0x514df1(0x74))/0x7+parseInt(_0x514df1(0x76))/0x8;if(_0x38ff3f===_0x5af54c)break;else _0x201222['push'](_0x201222['shift']());}catch(_0x55cad3){_0x201222['push'](_0x201222['shift']());}}}(a268_0x38ba,0x8ee44));function a268_0x38ba(){const _0x5818fd=['Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','\x22\x20under\x20app\x20\x22','toLowerCase','has','entries','.\x20Be\x20more\x20specific.','3625398MTPBaM','4894421PyRvjH','isNaN','7074712LTLQKo','376KoqzlA','No\x20database\x20matching\x20\x22','join','dbtableConfig','map','filter','\x22\x20matches\x20multiple\x20databases:\x20','1003180GlJnBW','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','\x22.\x20Available:\x20','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','3891wXGmMd','2685420XNUiwU','length','dbName','find','522731JCrKlY','includes','dbId','set'];a268_0x38ba=function(){return _0x5818fd;};return a268_0x38ba();}import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x4f3d0b){const _0x20ef59=a268_0x4d3f;if(cache[_0x20ef59(0x70)](_0x4f3d0b))return cache['get'](_0x4f3d0b);const _0x4ffe04=await listDatasets(_0x4f3d0b),_0x103617=new Map();for(const _0xc03eb9 of _0x4ffe04){const _0x44d749=_0xc03eb9[_0x20ef59(0x7a)];_0x44d749?.[_0x20ef59(0x89)]!=null&&_0x103617[_0x20ef59(0x6c)](_0x44d749[_0x20ef59(0x89)],_0x44d749[_0x20ef59(0x85)]??'db-'+_0x44d749[_0x20ef59(0x89)]);}const _0x55cf37=[..._0x103617[_0x20ef59(0x71)]()][_0x20ef59(0x7b)](([_0x496253,_0x5a07fd])=>({'dbId':_0x496253,'dbName':_0x5a07fd}));return cache['set'](_0x4f3d0b,_0x55cf37),_0x55cf37;}export async function resolveDb(_0x3fd658,_0x3c6b86){const _0x4c12d1=a268_0x4d3f,_0xfb7f27=await listDatabases(_0x3fd658);if(_0xfb7f27[_0x4c12d1(0x84)]===0x0)return{'resolved':[],'error':_0x4c12d1(0x7f)+_0x3fd658+_0x4c12d1(0x81)};if(!_0x3c6b86)return{'resolved':_0xfb7f27};const _0x2c0abd=Number(_0x3c6b86);if(!Number[_0x4c12d1(0x75)](_0x2c0abd)){const _0x220d5d=_0xfb7f27['find'](_0x51cfb3=>_0x51cfb3[_0x4c12d1(0x89)]===_0x2c0abd);if(_0x220d5d)return{'resolved':[_0x220d5d]};}const _0x321655=_0x3c6b86['toLowerCase'](),_0x5c19c0=_0xfb7f27[_0x4c12d1(0x7c)](_0x57cc05=>_0x57cc05[_0x4c12d1(0x85)][_0x4c12d1(0x6f)]()[_0x4c12d1(0x88)](_0x321655));if(_0x5c19c0[_0x4c12d1(0x84)]>0x0)return{'resolved':_0x5c19c0};const _0x3572d5=_0xfb7f27[_0x4c12d1(0x7b)](_0x4c99ab=>_0x4c99ab[_0x4c12d1(0x85)]+'\x20('+_0x4c99ab[_0x4c12d1(0x89)]+')')[_0x4c12d1(0x79)](',\x20');return{'resolved':[],'error':_0x4c12d1(0x78)+_0x3c6b86+_0x4c12d1(0x6e)+_0x3fd658+_0x4c12d1(0x80)+_0x3572d5+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x12dff2,_0x2486a0){const _0x483b28=a268_0x4d3f,{resolved:_0x256456,error:_0x43e016}=await resolveDb(_0x12dff2,_0x2486a0);if(_0x43e016)return{'db':null,'error':_0x43e016};if(_0x256456['length']===0x1)return{'db':_0x256456[0x0]};if(!_0x2486a0){const _0x568b59=_0x256456[_0x483b28(0x7b)](_0x2df257=>_0x2df257[_0x483b28(0x85)]+'\x20('+_0x2df257['dbId']+')')[_0x483b28(0x79)](',\x20');return{'db':null,'error':_0x483b28(0x6d)+_0x568b59};}const _0x52e84f=_0x256456[_0x483b28(0x7b)](_0x109484=>_0x109484['dbName']+'\x20('+_0x109484['dbId']+')')[_0x483b28(0x79)](',\x20');return{'db':null,'error':'\x22'+_0x2486a0+_0x483b28(0x7d)+_0x52e84f+_0x483b28(0x72)};}export async function getDbName(_0x5a13f9,_0x4dd83f){const _0x30933b=a268_0x4d3f,_0x1fd203=await listDatabases(_0x5a13f9);return _0x1fd203[_0x30933b(0x86)](_0x5a251f=>_0x5a251f['dbId']===_0x4dd83f)?.[_0x30933b(0x85)];}