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

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 (419) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/api-group.d.ts +22 -0
  3. package/lib/api/api-group.js +1 -0
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.d.ts +18 -2
  6. package/lib/api/generate-api-file.js +1 -1
  7. package/lib/api/generate-sdk-config-file.js +1 -1
  8. package/lib/api/legacy-api-file.d.ts +11 -0
  9. package/lib/api/legacy-api-file.js +1 -0
  10. package/lib/api/model-registry-file.d.ts +36 -0
  11. package/lib/api/model-registry-file.js +1 -0
  12. package/lib/api/model-registry-scaffold.d.ts +7 -0
  13. package/lib/api/model-registry-scaffold.js +1 -0
  14. package/lib/api/model-source.d.ts +6 -0
  15. package/lib/api/model-source.js +1 -0
  16. package/lib/auth/auth-server-ui.js +1 -1
  17. package/lib/auth/auth-server.js +1 -1
  18. package/lib/auth/constant.js +1 -1
  19. package/lib/auth/get-cookie.js +1 -1
  20. package/lib/auth/get-session-user.js +1 -1
  21. package/lib/auth/is-session-valid.js +1 -1
  22. package/lib/auth/login-success-html.js +1 -1
  23. package/lib/auth/logout.js +1 -1
  24. package/lib/cli-flags.js +1 -1
  25. package/lib/cli.js +1 -1
  26. package/lib/commands/api/generate.js +1 -1
  27. package/lib/commands/api/index.js +1 -1
  28. package/lib/commands/api/list.js +1 -1
  29. package/lib/commands/api/pull.js +1 -1
  30. package/lib/commands/api/shared.js +1 -1
  31. package/lib/commands/app/index.js +1 -1
  32. package/lib/commands/app/list.js +1 -1
  33. package/lib/commands/app/members-list.js +1 -1
  34. package/lib/commands/app/remote-directory.js +1 -1
  35. package/lib/commands/app/shared.js +1 -1
  36. package/lib/commands/app-config/delete.js +1 -1
  37. package/lib/commands/app-config/get.js +1 -1
  38. package/lib/commands/app-config/index.js +1 -1
  39. package/lib/commands/app-config/list.js +1 -1
  40. package/lib/commands/app-config/set.js +1 -1
  41. package/lib/commands/app-config/shared.js +1 -1
  42. package/lib/commands/auth/index.js +1 -1
  43. package/lib/commands/bff/create.js +1 -1
  44. package/lib/commands/bff/delete.js +1 -1
  45. package/lib/commands/bff/detail.js +1 -1
  46. package/lib/commands/bff/index.js +1 -1
  47. package/lib/commands/bff/list.js +1 -1
  48. package/lib/commands/bff/logs.d.ts +7 -0
  49. package/lib/commands/bff/logs.js +1 -0
  50. package/lib/commands/bff/pull.js +1 -1
  51. package/lib/commands/bff/push.js +1 -1
  52. package/lib/commands/bff/status.js +1 -1
  53. package/lib/commands/cli-skill/index.js +1 -1
  54. package/lib/commands/cli-update.js +1 -1
  55. package/lib/commands/codegen/index.js +1 -1
  56. package/lib/commands/codegen/sdk.js +1 -1
  57. package/lib/commands/codegen/sql.js +1 -1
  58. package/lib/commands/common/app-registry.js +1 -1
  59. package/lib/commands/common/app-selector.js +1 -1
  60. package/lib/commands/common/async-task.js +1 -1
  61. package/lib/commands/common/dry-run.js +1 -1
  62. package/lib/commands/common/flags.d.ts +7 -0
  63. package/lib/commands/common/flags.js +1 -1
  64. package/lib/commands/common/local-file.js +1 -1
  65. package/lib/commands/common/validate.js +1 -1
  66. package/lib/commands/config/delete.js +1 -1
  67. package/lib/commands/config/get.js +1 -1
  68. package/lib/commands/config/index.js +1 -1
  69. package/lib/commands/config/init.js +1 -1
  70. package/lib/commands/config/list.js +1 -1
  71. package/lib/commands/config/set.js +1 -1
  72. package/lib/commands/config/shared.js +1 -1
  73. package/lib/commands/dataset/batch-design.d.ts +21 -0
  74. package/lib/commands/dataset/batch-design.js +1 -0
  75. package/lib/commands/dataset/business-group-update.js +1 -1
  76. package/lib/commands/dataset/business-groups.js +1 -1
  77. package/lib/commands/dataset/capability.js +1 -1
  78. package/lib/commands/dataset/cross-relation-create.d.ts +2 -0
  79. package/lib/commands/dataset/cross-relation-create.js +1 -0
  80. package/lib/commands/dataset/cross-relation-delete.d.ts +2 -0
  81. package/lib/commands/dataset/cross-relation-delete.js +1 -0
  82. package/lib/commands/dataset/cross-relation-list.d.ts +2 -0
  83. package/lib/commands/dataset/cross-relation-list.js +1 -0
  84. package/lib/commands/dataset/cross-relation-shared.d.ts +190 -0
  85. package/lib/commands/dataset/cross-relation-shared.js +1 -0
  86. package/lib/commands/dataset/cross-relation-update.d.ts +2 -0
  87. package/lib/commands/dataset/cross-relation-update.js +1 -0
  88. package/lib/commands/dataset/delete.js +1 -1
  89. package/lib/commands/dataset/detail.js +1 -1
  90. package/lib/commands/dataset/extend-update.js +1 -1
  91. package/lib/commands/dataset/field-restore.js +1 -1
  92. package/lib/commands/dataset/field-update.js +1 -1
  93. package/lib/commands/dataset/generate.js +1 -1
  94. package/lib/commands/dataset/index.js +1 -1
  95. package/lib/commands/dataset/list.js +1 -1
  96. package/lib/commands/dataset/operations.js +1 -1
  97. package/lib/commands/dataset/relation-audit.js +1 -1
  98. package/lib/commands/dataset/relation-create.js +1 -1
  99. package/lib/commands/dataset/relation-delete.js +1 -1
  100. package/lib/commands/dataset/relation-shared.js +1 -1
  101. package/lib/commands/dataset/relation-update.js +1 -1
  102. package/lib/commands/dataset/relations.js +1 -1
  103. package/lib/commands/dataset/rename.js +1 -1
  104. package/lib/commands/dataset/restore.js +1 -1
  105. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  106. package/lib/commands/db/analysis-batching.js +1 -1
  107. package/lib/commands/db/analyze-batch-plan.js +1 -1
  108. package/lib/commands/db/analyze-cancel.js +1 -1
  109. package/lib/commands/db/analyze-start.js +1 -1
  110. package/lib/commands/db/analyze-status.js +1 -1
  111. package/lib/commands/db/create.js +1 -1
  112. package/lib/commands/db/delete.js +1 -1
  113. package/lib/commands/db/detail.js +1 -1
  114. package/lib/commands/db/diff-refresh-start.js +1 -1
  115. package/lib/commands/db/diff-refresh-status.js +1 -1
  116. package/lib/commands/db/diff.js +1 -1
  117. package/lib/commands/db/index.js +1 -1
  118. package/lib/commands/db/list.js +1 -1
  119. package/lib/commands/db/shared.js +1 -1
  120. package/lib/commands/db/table-diff-shared.js +1 -1
  121. package/lib/commands/db/tables.js +1 -1
  122. package/lib/commands/db/test.js +1 -1
  123. package/lib/commands/db/update.js +1 -1
  124. package/lib/commands/deployment/index.js +1 -1
  125. package/lib/commands/deployment/sync-all.js +1 -1
  126. package/lib/commands/deployment/sync-jobs.js +1 -1
  127. package/lib/commands/deployment/sync-status.js +1 -1
  128. package/lib/commands/doctor.js +1 -1
  129. package/lib/commands/file/index.js +1 -1
  130. package/lib/commands/flow/create.d.ts +2 -0
  131. package/lib/commands/flow/create.js +1 -0
  132. package/lib/commands/flow/detail.d.ts +2 -0
  133. package/lib/commands/flow/detail.js +1 -0
  134. package/lib/commands/flow/index.d.ts +3 -0
  135. package/lib/commands/flow/index.js +1 -0
  136. package/lib/commands/flow/list.d.ts +2 -0
  137. package/lib/commands/flow/list.js +1 -0
  138. package/lib/commands/flow/publish.d.ts +2 -0
  139. package/lib/commands/flow/publish.js +1 -0
  140. package/lib/commands/flow/runtime-resources-shared.d.ts +40 -0
  141. package/lib/commands/flow/runtime-resources-shared.js +1 -0
  142. package/lib/commands/flow/runtime-role-list.d.ts +2 -0
  143. package/lib/commands/flow/runtime-role-list.js +1 -0
  144. package/lib/commands/flow/runtime-role-user-list.d.ts +2 -0
  145. package/lib/commands/flow/runtime-role-user-list.js +1 -0
  146. package/lib/commands/flow/runtime-user-search.d.ts +2 -0
  147. package/lib/commands/flow/runtime-user-search.js +1 -0
  148. package/lib/commands/flow/shared.d.ts +41 -0
  149. package/lib/commands/flow/shared.js +1 -0
  150. package/lib/commands/flow/update.d.ts +2 -0
  151. package/lib/commands/flow/update.js +1 -0
  152. package/lib/commands/flow/validate.d.ts +3 -0
  153. package/lib/commands/flow/validate.js +1 -0
  154. package/lib/commands/instant-api-policy/current.js +1 -1
  155. package/lib/commands/instant-api-policy/index.js +1 -1
  156. package/lib/commands/instant-api-policy/init.js +1 -1
  157. package/lib/commands/instant-api-policy/publish.js +1 -1
  158. package/lib/commands/instant-api-policy/pull.js +1 -1
  159. package/lib/commands/instant-api-policy/revision.js +1 -1
  160. package/lib/commands/instant-api-policy/revisions.js +1 -1
  161. package/lib/commands/instant-api-policy/rollback.js +1 -1
  162. package/lib/commands/instant-api-policy/shared.js +1 -1
  163. package/lib/commands/instant-api-policy/validate.js +1 -1
  164. package/lib/commands/issue/index.js +1 -1
  165. package/lib/commands/issue/nudge.js +1 -1
  166. package/lib/commands/issue/report.js +1 -1
  167. package/lib/commands/issue/shared.js +1 -1
  168. package/lib/commands/kb/create.js +1 -1
  169. package/lib/commands/kb/delete.js +1 -1
  170. package/lib/commands/kb/detail.js +1 -1
  171. package/lib/commands/kb/index.js +1 -1
  172. package/lib/commands/kb/list.js +1 -1
  173. package/lib/commands/kb/search.js +1 -1
  174. package/lib/commands/kb/shared.js +1 -1
  175. package/lib/commands/kb/update.js +1 -1
  176. package/lib/commands/logs/index.js +1 -1
  177. package/lib/commands/menu/asset-update.js +1 -1
  178. package/lib/commands/menu/delete.js +1 -1
  179. package/lib/commands/menu/external-link-create.js +1 -1
  180. package/lib/commands/menu/external-link-update.js +1 -1
  181. package/lib/commands/menu/group-create.js +1 -1
  182. package/lib/commands/menu/group-update.js +1 -1
  183. package/lib/commands/menu/index.js +1 -1
  184. package/lib/commands/menu/list.js +1 -1
  185. package/lib/commands/menu/move.js +1 -1
  186. package/lib/commands/menu/regroup-start.js +1 -1
  187. package/lib/commands/menu/rename.js +1 -1
  188. package/lib/commands/menu/shared/compare-table.js +1 -1
  189. package/lib/commands/menu/shared/delete-plan.js +1 -1
  190. package/lib/commands/menu/shared/facts.js +1 -1
  191. package/lib/commands/menu/shared/index.js +1 -1
  192. package/lib/commands/menu/shared/inquirer.js +1 -1
  193. package/lib/commands/menu/shared/local-pages.js +1 -1
  194. package/lib/commands/menu/shared/logic.js +1 -1
  195. package/lib/commands/menu/shared/mutations.js +1 -1
  196. package/lib/commands/menu/shared/service.js +1 -1
  197. package/lib/commands/menu/shared/sync-core.js +1 -1
  198. package/lib/commands/menu/shared/update-core.js +1 -1
  199. package/lib/commands/menu/shared/valid-url.js +1 -1
  200. package/lib/commands/menu/sync.js +1 -1
  201. package/lib/commands/menu/visibility-update.js +1 -1
  202. package/lib/commands/notification/config-create.js +1 -1
  203. package/lib/commands/notification/config-delete.js +1 -1
  204. package/lib/commands/notification/config-list.js +1 -1
  205. package/lib/commands/notification/config-update.js +1 -1
  206. package/lib/commands/notification/index.js +1 -1
  207. package/lib/commands/notification/shared.js +1 -1
  208. package/lib/commands/ocr/index.js +1 -1
  209. package/lib/commands/page/create.js +1 -1
  210. package/lib/commands/page/custom/detail.js +1 -1
  211. package/lib/commands/page/custom/list.js +1 -1
  212. package/lib/commands/page/custom/publish.js +1 -1
  213. package/lib/commands/page/custom/shared.js +1 -1
  214. package/lib/commands/page/custom/syntax.js +1 -1
  215. package/lib/commands/page/custom/update.js +1 -1
  216. package/lib/commands/page/data-list-status.js +1 -1
  217. package/lib/commands/page/generate-start.js +1 -1
  218. package/lib/commands/page/generate-status.js +1 -1
  219. package/lib/commands/page/index.js +1 -1
  220. package/lib/commands/page/pull.js +1 -1
  221. package/lib/commands/page/push.js +1 -1
  222. package/lib/commands/page/relation-audit.js +1 -1
  223. package/lib/commands/page/restore.js +1 -1
  224. package/lib/commands/page/shared.js +1 -1
  225. package/lib/commands/page/sync.js +1 -1
  226. package/lib/commands/project/api-architecture-upgrade.d.ts +28 -0
  227. package/lib/commands/project/api-architecture-upgrade.js +1 -0
  228. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  229. package/lib/commands/project/create/format-elapsed.js +1 -1
  230. package/lib/commands/project/create/main.js +1 -1
  231. package/lib/commands/project/create/materialize-project-template.js +1 -1
  232. package/lib/commands/project/create/project-name.js +1 -1
  233. package/lib/commands/project/create/project-template-archive.js +1 -1
  234. package/lib/commands/project/create/project-template-path.js +1 -1
  235. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  236. package/lib/commands/project/create/use-format-code.js +1 -1
  237. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  238. package/lib/commands/project/domain-routing-sync.js +1 -1
  239. package/lib/commands/project/index.js +1 -1
  240. package/lib/commands/project/upgrade.d.ts +30 -1
  241. package/lib/commands/project/upgrade.js +1 -1
  242. package/lib/commands/registry.js +1 -1
  243. package/lib/commands/role/delete.js +1 -1
  244. package/lib/commands/role/detail.js +1 -1
  245. package/lib/commands/role/index.js +1 -1
  246. package/lib/commands/role/list.js +1 -1
  247. package/lib/commands/role/shared.js +1 -1
  248. package/lib/commands/role/update.js +1 -1
  249. package/lib/commands/role/user-add.js +1 -1
  250. package/lib/commands/role/user-remove.js +1 -1
  251. package/lib/commands/role/user-resolve.js +1 -1
  252. package/lib/commands/rule/get.js +1 -1
  253. package/lib/commands/rule/index.js +1 -1
  254. package/lib/commands/rule/list.js +1 -1
  255. package/lib/commands/rule/set.js +1 -1
  256. package/lib/commands/rule/shared.js +1 -1
  257. package/lib/commands/run/index.js +1 -1
  258. package/lib/commands/schema.js +1 -1
  259. package/lib/commands/sql/create.js +1 -1
  260. package/lib/commands/sql/delete.js +1 -1
  261. package/lib/commands/sql/detail.js +1 -1
  262. package/lib/commands/sql/exec.js +1 -1
  263. package/lib/commands/sql/index.js +1 -1
  264. package/lib/commands/sql/list.js +1 -1
  265. package/lib/commands/sql/pull.js +1 -1
  266. package/lib/commands/sql/push.js +1 -1
  267. package/lib/commands/sql/shared.js +1 -1
  268. package/lib/commands/sql/status.js +1 -1
  269. package/lib/commands/sql/validate.js +1 -1
  270. package/lib/commands/task/index.js +1 -1
  271. package/lib/commands/task/status.js +1 -1
  272. package/lib/commands/tenant/index.js +1 -1
  273. package/lib/commands/tenant/members-list.js +1 -1
  274. package/lib/commands/tenant/shared.js +1 -1
  275. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  276. package/lib/commands/user-account/index.js +1 -1
  277. package/lib/commands/workspace/add.js +1 -1
  278. package/lib/commands/workspace/index.js +1 -1
  279. package/lib/commands/workspace/remove.js +1 -1
  280. package/lib/config/domain-config.js +1 -1
  281. package/lib/config/project-domain-routing.js +1 -1
  282. package/lib/config/region-config.js +1 -1
  283. package/lib/config/schema.js +1 -1
  284. package/lib/constant/cdn.js +1 -1
  285. package/lib/constant/cli.js +1 -1
  286. package/lib/constant/defaults.js +1 -1
  287. package/lib/constant/domain.js +1 -1
  288. package/lib/constant/env.js +1 -1
  289. package/lib/constant/output.js +1 -1
  290. package/lib/constant/paths.js +1 -1
  291. package/lib/constant/region.js +1 -1
  292. package/lib/constant/risk.js +1 -1
  293. package/lib/constant/routing-profile.js +1 -1
  294. package/lib/context/app-resolver.d.ts +2 -0
  295. package/lib/context/app-resolver.js +1 -1
  296. package/lib/context/auth-resolver.js +1 -1
  297. package/lib/context/config-loader.js +1 -1
  298. package/lib/context.d.ts +2 -1
  299. package/lib/context.js +1 -1
  300. package/lib/core/alias-resolver.d.ts +13 -17
  301. package/lib/core/alias-resolver.js +1 -1
  302. package/lib/core/api-client.d.ts +176 -1
  303. package/lib/core/api-client.js +1 -1
  304. package/lib/core/bff/config.js +1 -1
  305. package/lib/core/bff/file-system.js +1 -1
  306. package/lib/core/bff/hash.js +1 -1
  307. package/lib/core/bff/hook-directory.d.ts +55 -0
  308. package/lib/core/bff/hook-directory.js +1 -0
  309. package/lib/core/bff/lock.js +1 -1
  310. package/lib/core/bff/types.d.ts +15 -0
  311. package/lib/core/bff/utils.js +1 -1
  312. package/lib/core/cross-db-relation.d.ts +41 -0
  313. package/lib/core/cross-db-relation.js +1 -0
  314. package/lib/core/db-resolver.js +1 -1
  315. package/lib/core/flow-config.d.ts +628 -0
  316. package/lib/core/flow-config.js +1 -0
  317. package/lib/core/instant-api-policy/config.js +1 -1
  318. package/lib/core/kb-search-client.js +1 -1
  319. package/lib/core/page/file-system.js +1 -1
  320. package/lib/core/page/hash.js +1 -1
  321. package/lib/core/page/lock.js +1 -1
  322. package/lib/core/page/lr-smart-jsx.js +1 -1
  323. package/lib/core/sql-index-auditor.js +1 -1
  324. package/lib/core/sql-sync/config.js +1 -1
  325. package/lib/core/sql-sync/file-system.js +1 -1
  326. package/lib/core/sql-sync/hash.js +1 -1
  327. package/lib/core/sql-sync/lock.js +1 -1
  328. package/lib/core/sql-sync/utils.js +1 -1
  329. package/lib/core/sql-validator.js +1 -1
  330. package/lib/errors.js +1 -1
  331. package/lib/framework/build-all-flags.js +1 -1
  332. package/lib/framework/error-output.js +1 -1
  333. package/lib/framework/explicit-yes.js +1 -1
  334. package/lib/framework/flags.js +1 -1
  335. package/lib/framework/help.js +1 -1
  336. package/lib/framework/index.js +1 -1
  337. package/lib/framework/output.js +1 -1
  338. package/lib/framework/response.js +1 -1
  339. package/lib/framework/runner-alias.d.ts +1 -1
  340. package/lib/framework/runner-alias.js +1 -1
  341. package/lib/framework/runner.js +1 -1
  342. package/lib/framework/schema-export.js +1 -1
  343. package/lib/framework/supported-flags.js +1 -1
  344. package/lib/framework/types.js +1 -1
  345. package/lib/generated/build-info.d.ts +4 -4
  346. package/lib/generated/build-info.js +1 -1
  347. package/lib/generated/official-routing.js +1 -1
  348. package/lib/generated/routing-contract.js +1 -1
  349. package/lib/help.js +1 -1
  350. package/lib/postinstall.js +1 -1
  351. package/lib/runtime/confirmation.js +1 -1
  352. package/lib/runtime/event.js +1 -1
  353. package/lib/runtime/index.js +1 -1
  354. package/lib/runtime/queue.js +1 -1
  355. package/lib/runtime/resolve.js +1 -1
  356. package/lib/skills/builtin-skill.js +1 -1
  357. package/lib/skills/main.js +1 -1
  358. package/lib/skills/npx-skills-add.d.ts +0 -10
  359. package/lib/skills/npx-skills-add.js +1 -1
  360. package/lib/skills/skill-presence.js +1 -1
  361. package/lib/telemetry/cli-command-trace.js +1 -1
  362. package/lib/telemetry/cli-help-trace.js +1 -1
  363. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  364. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  365. package/lib/telemetry/send-cli-trace-log.js +1 -1
  366. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  367. package/lib/types/index.d.ts +11 -1
  368. package/lib/utils/ai_config.js +1 -1
  369. package/lib/utils/apply-jq-filter.js +1 -1
  370. package/lib/utils/cdn-config.js +1 -1
  371. package/lib/utils/check-sdk-version.js +1 -1
  372. package/lib/utils/cli-version-check.js +1 -1
  373. package/lib/utils/cli-version-policy.d.ts +12 -0
  374. package/lib/utils/cli-version-policy.js +1 -1
  375. package/lib/utils/config.js +1 -1
  376. package/lib/utils/entity-with-id.js +1 -1
  377. package/lib/utils/file-utils.js +1 -1
  378. package/lib/utils/guides-cdn.js +1 -1
  379. package/lib/utils/http-client.js +1 -1
  380. package/lib/utils/is-non-interactive.js +1 -1
  381. package/lib/utils/logger.js +1 -1
  382. package/lib/utils/params.js +1 -1
  383. package/lib/utils/platform.js +1 -1
  384. package/lib/utils/sleep.js +1 -1
  385. package/lib/utils/template-replacer.js +1 -1
  386. package/lib/utils/update-notice.js +1 -1
  387. package/lib/utils/version.js +1 -1
  388. package/lib/utils/with-active-cookie.js +1 -1
  389. package/lib/utils/write-cli-side-channel.js +1 -1
  390. package/package.json +4 -1
  391. package/skills/rabetbase/SKILL.md +31 -9
  392. package/skills/rabetbase/guides/approval-flow-development-workflow.md +137 -0
  393. package/skills/rabetbase/guides/backend-function.md +19 -9
  394. package/skills/rabetbase/guides/bff-creation-workflow.md +10 -1
  395. package/skills/rabetbase/guides/conflict-detection.md +2 -0
  396. package/skills/rabetbase/guides/sdk-client-generation.md +112 -60
  397. package/skills/rabetbase/guides/typescript-sdk.md +9 -0
  398. package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +290 -0
  399. package/skills/rabetbase/references/rabetbase-api-pull.md +30 -19
  400. package/skills/rabetbase/references/rabetbase-app-list.md +1 -1
  401. package/skills/rabetbase/references/rabetbase-bff-create.md +1 -1
  402. package/skills/rabetbase/references/rabetbase-bff-logs.md +47 -0
  403. package/skills/rabetbase/references/rabetbase-bff-pull.md +7 -3
  404. package/skills/rabetbase/references/rabetbase-bff-push.md +10 -2
  405. package/skills/rabetbase/references/rabetbase-config.md +2 -1
  406. package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +60 -0
  407. package/skills/rabetbase/references/rabetbase-dataset-generate.md +52 -2
  408. package/skills/rabetbase/references/rabetbase-flow-commands.md +86 -0
  409. package/skills/rabetbase/references/rabetbase-flow-resources.md +83 -0
  410. package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +25 -0
  411. package/skills/rabetbase/references/rabetbase-instant-api-policy.md +103 -11
  412. package/skills/rabetbase/references/rabetbase-notification-config-list.md +17 -0
  413. package/skills/rabetbase/references/rabetbase-project-create.md +3 -3
  414. package/skills/rabetbase/references/rabetbase-project-upgrade.md +24 -13
  415. package/skills/rabetbase.manifest.json +10 -3
  416. package/templates/README.md +16 -4
  417. package/templates/generate-api/model-runtime.ts.tpl +101 -0
  418. package/templates/generate-api/profile-api.ts.tpl +21 -0
  419. package/templates/generate-api/profile-client.ts.tpl +14 -0
@@ -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(_0x22cd45,_0xeb6741){const _0x40e167=a275_0x58ce,_0x493bd3=_0x22cd45();while(!![]){try{const _0x472543=-parseInt(_0x40e167(0x91))/0x1+parseInt(_0x40e167(0x76))/0x2*(parseInt(_0x40e167(0x7c))/0x3)+parseInt(_0x40e167(0x71))/0x4+-parseInt(_0x40e167(0x8d))/0x5+-parseInt(_0x40e167(0x98))/0x6*(-parseInt(_0x40e167(0x69))/0x7)+parseInt(_0x40e167(0x6b))/0x8+-parseInt(_0x40e167(0x79))/0x9;if(_0x472543===_0xeb6741)break;else _0x493bd3['push'](_0x493bd3['shift']());}catch(_0x59920c){_0x493bd3['push'](_0x493bd3['shift']());}}}(a275_0x847d,0xc124b));import{CliError}from'../../errors.js';function a275_0x847d(){const _0x11d3b9=['1267GjvqOV','datasetCode','9919136LCnugW','alias','\x22\x20changed\x20mapping\x20from\x20Dataset\x20\x22','get','Dataset\x20\x22','values','1139016cNcNmN','NFC','HOOK_ALIAS_AMBIGUOUS','HOOK_DIRECTORY_UNRESOLVED','HOOK_DIRECTORY_AMBIGUOUS','943442njgwds','HOOK\x20directory\x20\x22','toLowerCase','21579021GOVsJx','aliasToDatasetCodes','size','9ZaNGdQ','map','Incomplete\x20HOOK\x20path:\x20','\x22\x20points\x20to\x20a\x20Dataset\x20that\x20is\x20absent\x20from\x20current\x20platform\x20metadata.','HOOK','\x22\x20to\x20a\x20Dataset\x20alias\x20or\x20datasetCode.','add','includes','type','some','HOOK_DUPLICATE_DIRECTORIES','\x22\x20differs\x20only\x20by\x20case\x20from\x20another\x20Dataset\x20code.','datasetCodeToDatasets','\x22\x20has\x20multiple\x20SDK\x20aliases\x20and\x20has\x20no\x20unique\x20HOOK\x20directory.','\x22\x20resolves\x20to\x20multiple\x20Datasets.','set','push','2673300eLaOcG','message','functions','\x22\x20collides\x20across\x20datasetCode\x20and\x20alias\x20namespaces.','238472BPtKIj','lockKey','details','\x22\x20is\x20represented\x20by\x20multiple\x20HOOK\x20directories:\x20','join','SDK\x20alias\x20\x22','split','33882sDCtQD','HOOK_DATASET_NOT_FOUND','entries','Cannot\x20resolve\x20HOOK\x20directory\x20\x22','code'];a275_0x847d=function(){return _0x11d3b9;};return a275_0x847d();}export function trackedHookDirectoryMappings(_0x1934da){const _0x5cc7e4=a275_0x58ce,_0x7676a8=[];for(const [_0x240ce6,_0x396e05]of Object[_0x5cc7e4(0x66)](_0x1934da[_0x5cc7e4(0x8f)])){const [_0x571320,_0x1f614a]=_0x240ce6[_0x5cc7e4(0x97)]('/');if(_0x571320!==_0x5cc7e4(0x80)||!_0x1f614a||!_0x396e05[_0x5cc7e4(0x6a)])continue;_0x7676a8[_0x5cc7e4(0x8c)]({'alias':_0x1f614a,'datasetCode':_0x396e05[_0x5cc7e4(0x6a)]});}return _0x7676a8;}export function uniqueTrackedHookDirectoryByDataset(_0xc6b479){const _0x2f3c98=a275_0x58ce,_0x73f30a=new Map();for(const _0x305d58 of trackedHookDirectoryMappings(_0xc6b479)){const _0xa9eb8e=directoryIdentity(_0x305d58[_0x2f3c98(0x6a)]),_0x195a0f=_0x73f30a[_0x2f3c98(0x6e)](_0xa9eb8e)??new Map();_0x195a0f[_0x2f3c98(0x8b)](directoryIdentity(_0x305d58[_0x2f3c98(0x6c)]),_0x305d58[_0x2f3c98(0x6c)]),_0x73f30a[_0x2f3c98(0x8b)](_0xa9eb8e,_0x195a0f);}const _0x5e117e=new Map();for(const [_0x48c15d,_0x385aa3]of _0x73f30a){if(_0x385aa3[_0x2f3c98(0x7b)]>0x1)throw hookDirectoryError(_0x2f3c98(0x86),_0x2f3c98(0x6f)+_0x48c15d+'\x22\x20has\x20multiple\x20tracked\x20HOOK\x20directories:\x20'+[..._0x385aa3[_0x2f3c98(0x70)]()][_0x2f3c98(0x95)](',\x20')+'.',{'datasetCode':_0x48c15d,'directories':[..._0x385aa3['values']()]});_0x5e117e[_0x2f3c98(0x8b)](_0x48c15d,[..._0x385aa3[_0x2f3c98(0x70)]()][0x0]);}return _0x5e117e;}function a275_0x58ce(_0x11e368,_0x13a07a){_0x11e368=_0x11e368-0x66;const _0x847d05=a275_0x847d();let _0x58ce31=_0x847d05[_0x11e368];return _0x58ce31;}export function assertUnambiguousHookDirectoryMappings(_0x131188){const _0x11ddd5=a275_0x58ce,_0x5ebc8d=new Map();for(const {alias:_0x8e8fdd,datasetCode:_0x1191fa}of _0x131188){const _0x2fc225=directoryIdentity(_0x8e8fdd),_0x27284a=_0x5ebc8d[_0x11ddd5(0x6e)](_0x2fc225)??new Set();_0x27284a['add'](_0x1191fa),_0x5ebc8d[_0x11ddd5(0x8b)](_0x2fc225,_0x27284a);}for(const [_0x3da4ab,_0x207677]of _0x5ebc8d){if(_0x207677[_0x11ddd5(0x7b)]>0x1)throw hookDirectoryError(_0x11ddd5(0x75),_0x11ddd5(0x77)+_0x3da4ab+'\x22\x20resolves\x20to\x20multiple\x20Datasets.',{'directoryName':_0x3da4ab,'datasetCodes':[..._0x207677]});}}export function assertUnambiguousHookAliases(_0x53768c){const _0x3bb833=a275_0x58ce,_0x2e9b65=[..._0x53768c],_0x57c351=new Map(),_0x5bff91=new Map();for(const {alias:_0x581e25,datasetCode:_0x410cd2}of _0x2e9b65){const _0x5c18e6=directoryIdentity(_0x581e25),_0x1e3bcd=directoryIdentity(_0x410cd2),_0x3925b5=_0x57c351['get'](_0x5c18e6)??new Set();_0x3925b5[_0x3bb833(0x82)](_0x410cd2),_0x57c351[_0x3bb833(0x8b)](_0x5c18e6,_0x3925b5);const _0x37f742=_0x5bff91[_0x3bb833(0x6e)](_0x1e3bcd)??new Set();_0x37f742[_0x3bb833(0x82)](_0x581e25),_0x5bff91[_0x3bb833(0x8b)](_0x1e3bcd,_0x37f742);}for(const [_0x35d21e,_0x5b7048]of _0x57c351){if(_0x5b7048[_0x3bb833(0x7b)]>0x1)throw hookDirectoryError(_0x3bb833(0x73),_0x3bb833(0x96)+_0x35d21e+_0x3bb833(0x8a),{'alias':_0x35d21e,'datasetCodes':[..._0x5b7048]});}for(const [_0x143c73,_0x37c378]of _0x5bff91){if(_0x37c378[_0x3bb833(0x7b)]>0x1)throw hookDirectoryError(_0x3bb833(0x73),_0x3bb833(0x6f)+_0x143c73+_0x3bb833(0x89),{'datasetCode':_0x143c73,'aliases':[..._0x37c378]});}}export function buildHookDirectoryIndexes(_0x588e14,_0x39732c=[]){const _0x1762bf=a275_0x58ce,_0x4964d5=[..._0x39732c];assertUnambiguousHookDirectoryMappings(_0x4964d5[_0x1762bf(0x7d)](([_0xa0cc1a,_0x225905])=>({'alias':_0xa0cc1a,'datasetCode':_0x225905})));const _0x515e5f=new Map(),_0x41a128=new Map();for(const _0x4a31e2 of _0x588e14){appendUnique(_0x515e5f,directoryIdentity(_0x4a31e2[_0x1762bf(0x68)]),_0x4a31e2,_0x747605=>_0x747605[_0x1762bf(0x68)]);}for(const [_0x125151,_0xe73929]of _0x4964d5){appendUnique(_0x41a128,directoryIdentity(_0x125151),_0xe73929,_0x4903f8=>_0x4903f8);}return{'datasetCodeToDatasets':_0x515e5f,'aliasToDatasetCodes':_0x41a128};}export function resolvePushHookDirectory(_0x348007,_0x130916,_0x2f25b2){const _0x3337eb=a275_0x58ce,_0x4a9647=directoryIdentity(_0x348007),_0x3cfa1c=_0x2f25b2['datasetCodeToDatasets']['get'](_0x4a9647)??[],_0x3a0aed=_0x2f25b2[_0x3337eb(0x7a)][_0x3337eb(0x6e)](_0x4a9647)??[],_0x4b4f21=new Set([..._0x3cfa1c[_0x3337eb(0x7d)](_0x31cf29=>_0x31cf29[_0x3337eb(0x68)]),..._0x3a0aed]);if(_0x4b4f21['size']>0x1)throw hookDirectoryError('HOOK_DIRECTORY_AMBIGUOUS',_0x3337eb(0x77)+_0x348007+_0x3337eb(0x90),{'directoryName':_0x348007,'datasetCodes':[..._0x4b4f21]});const _0x5dbbd1=[..._0x4b4f21][0x0];if(_0x5dbbd1&&_0x130916?.[_0x3337eb(0x6a)]&&_0x5dbbd1!==_0x130916['datasetCode'])throw hookDirectoryError('HOOK_MAPPING_DRIFT',_0x3337eb(0x77)+_0x348007+_0x3337eb(0x6d)+_0x130916['datasetCode']+'\x22\x20to\x20\x22'+_0x5dbbd1+'\x22.',{'directoryName':_0x348007,'datasetCode':_0x5dbbd1,'lockedDatasetCode':_0x130916[_0x3337eb(0x6a)]});const _0x5b5bab=_0x5dbbd1?findDatasetByCode(_0x2f25b2,_0x5dbbd1):undefined,_0x3d052e=!!_0x5dbbd1&&_0x3a0aed[_0x3337eb(0x83)](_0x5dbbd1);if(_0x5b5bab)return{'dataset':_0x5b5bab,'datasetCode':_0x5b5bab['code'],..._0x3d052e?{'alias':_0x348007}:{},'directoryProtocol':_0x3d052e?'alias':_0x3337eb(0x6a),'warnings':[]};const _0x85ebc9=_0x130916?.['datasetCode'];if(_0x85ebc9){const _0x5d7eb3=findDatasetByCode(_0x2f25b2,_0x85ebc9);if(_0x5d7eb3)return{'dataset':_0x5d7eb3,'datasetCode':_0x5d7eb3[_0x3337eb(0x68)],..._0x130916[_0x3337eb(0x6c)]?{'alias':_0x130916[_0x3337eb(0x6c)]}:{},'directoryProtocol':_0x130916[_0x3337eb(0x6c)]?_0x3337eb(0x6c):_0x3337eb(0x6a),'warnings':[]};}if(_0x5dbbd1||_0x85ebc9){const _0x3db567=_0x5dbbd1??_0x85ebc9;throw hookDirectoryError(_0x3337eb(0x99),_0x3337eb(0x77)+_0x348007+_0x3337eb(0x7f),{'directoryName':_0x348007,'datasetCode':_0x3db567});}throw hookDirectoryError(_0x3337eb(0x74),_0x3337eb(0x67)+_0x348007+_0x3337eb(0x81),{'directoryName':_0x348007});}export function preflightPushHookDirectories(_0x472fd2,_0x352bdc,_0xd71155,_0x1a5ac7){const _0x2bfc39=a275_0x58ce,_0x28ac70=new Map(),_0x18e06d=new Map();for(const _0x162b19 of _0x472fd2){if(_0x162b19[_0x2bfc39(0x84)]!=='HOOK')continue;const _0x3bf5c4=_0x162b19[_0x2bfc39(0x6c)];if(!_0x3bf5c4)throw hookDirectoryError('HOOK_DIRECTORY_UNRESOLVED',_0x2bfc39(0x7e)+_0x162b19['lockKey'],{'lockKey':_0x162b19['lockKey']});let _0xc7d1d1;try{_0xc7d1d1=resolvePushHookDirectory(_0x3bf5c4,_0x352bdc[_0x2bfc39(0x8f)][_0x162b19[_0x2bfc39(0x92)]],_0xd71155);}catch(_0x3a56b0){if(_0x1a5ac7&&_0x3a56b0 instanceof CliError&&[_0x2bfc39(0x99),_0x2bfc39(0x74)][_0x2bfc39(0x83)](_0x3a56b0[_0x2bfc39(0x68)])){_0x1a5ac7[_0x2bfc39(0x8b)](_0x162b19[_0x2bfc39(0x92)],_0x3a56b0[_0x2bfc39(0x8e)]);continue;}throw _0x3a56b0;}_0x28ac70[_0x2bfc39(0x8b)](_0x162b19[_0x2bfc39(0x92)],_0xc7d1d1);const _0xd5b7b5=_0x18e06d[_0x2bfc39(0x6e)](_0xc7d1d1['datasetCode'])??new Set();_0xd5b7b5['add'](_0x3bf5c4),_0x18e06d[_0x2bfc39(0x8b)](_0xc7d1d1[_0x2bfc39(0x6a)],_0xd5b7b5);}for(const [_0x459b5b,_0x4512fb]of _0x18e06d){if(_0x4512fb['size']>0x1)throw hookDirectoryError(_0x2bfc39(0x86),_0x2bfc39(0x6f)+_0x459b5b+_0x2bfc39(0x94)+[..._0x4512fb]['join'](',\x20')+'.',{'datasetCode':_0x459b5b,'directories':[..._0x4512fb]});}return _0x28ac70;}export function hookDirectoryError(_0x35475d,_0xe84a56,_0x25cc18){const _0x43246c=a275_0x58ce,_0x2f45b5=new CliError(_0x35475d,0x2,_0x35475d+':\x20'+_0xe84a56);return _0x2f45b5[_0x43246c(0x93)]=_0x25cc18,_0x2f45b5;}function findDatasetByCode(_0x114594,_0x2925d7){const _0x5fb741=a275_0x58ce,_0x518136=_0x114594[_0x5fb741(0x88)]['get'](directoryIdentity(_0x2925d7))??[];if(_0x518136['length']>0x1)throw hookDirectoryError('HOOK_DATASET_CODE_AMBIGUOUS','Dataset\x20code\x20\x22'+_0x2925d7+_0x5fb741(0x87),{'datasetCode':_0x2925d7,'candidates':_0x518136['map'](datasetFact)});return _0x518136[0x0];}function directoryIdentity(_0x4fb738){const _0x1f8877=a275_0x58ce;return _0x4fb738['normalize'](_0x1f8877(0x72))[_0x1f8877(0x78)]();}function appendUnique(_0xddc69d,_0x3bd63b,_0x5af620,_0x2c05c7){const _0x3dfa51=a275_0x58ce,_0x290845=_0xddc69d[_0x3dfa51(0x6e)](_0x3bd63b)??[];!_0x290845[_0x3dfa51(0x85)](_0x7e7535=>_0x2c05c7(_0x7e7535)===_0x2c05c7(_0x5af620))&&_0x290845[_0x3dfa51(0x8c)](_0x5af620),_0xddc69d[_0x3dfa51(0x8b)](_0x3bd63b,_0x290845);}function datasetFact(_0x2afc30){return{'id':_0x2afc30['id'],'name':_0x2afc30['name'],'datasetCode':_0x2afc30['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(_0x4cf327,_0x51051d){const _0x6337fd=a276_0x3823,_0x4768f3=_0x4cf327();while(!![]){try{const _0x1f448d=parseInt(_0x6337fd(0x15d))/0x1+-parseInt(_0x6337fd(0x14d))/0x2+parseInt(_0x6337fd(0x156))/0x3+-parseInt(_0x6337fd(0x15e))/0x4*(-parseInt(_0x6337fd(0x160))/0x5)+parseInt(_0x6337fd(0x157))/0x6+parseInt(_0x6337fd(0x14f))/0x7*(-parseInt(_0x6337fd(0x158))/0x8)+parseInt(_0x6337fd(0x153))/0x9;if(_0x1f448d===_0x51051d)break;else _0x4768f3['push'](_0x4768f3['shift']());}catch(_0x58192f){_0x4768f3['push'](_0x4768f3['shift']());}}}(a276_0x17bb,0x6d260));import{mkdir,readFile,writeFile}from'node:fs/promises';function a276_0x17bb(){const _0x1cf243=['functions','2725470EQZbpE','code','utf8','885528OyodQJ','1324224JZGSZS','8iqVoco',':\x20scriptsRoot\x20mismatch\x20—\x20','current\x20\x22','Failed\x20to\x20read\x20Backend\x20Function\x20lock\x20file:\x20','\x22.\x20','556532GQOhoT','2820UZXKqj','apps','470HfbdFq','ENOENT','object','211700JhLHSE','scriptsRoot','6220130jMnWRU','lastSync','parse'];a276_0x17bb=function(){return _0x1cf243;};return a276_0x17bb();}function a276_0x3823(_0x3ec916,_0x4b37ad){_0x3ec916=_0x3ec916-0x14b;const _0x17bb81=a276_0x17bb();let _0x3823cd=_0x17bb81[_0x3ec916];return _0x3823cd;}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x1712d3,_0x1651ae,_0x4f6ff1,_0x957f36){const _0x540d36=a276_0x3823,_0x4a1a1f={'apps':_0x1712d3[_0x540d36(0x15f)]&&typeof _0x1712d3['apps']==='object'?_0x1712d3[_0x540d36(0x15f)]:{}};let _0x39a71b=_0x4a1a1f['apps'][_0x1651ae];if(!_0x39a71b)return _0x39a71b={'scriptsRoot':_0x4f6ff1,'lastSync':'','functions':{}},_0x4a1a1f['apps'][_0x1651ae]=_0x39a71b,{'lockData':_0x4a1a1f,'appLock':_0x39a71b};if(!_0x39a71b[_0x540d36(0x14e)])_0x39a71b[_0x540d36(0x14e)]=_0x4f6ff1;else{if(_0x39a71b[_0x540d36(0x14e)]!==_0x4f6ff1)throw new Error(_0x957f36+_0x540d36(0x159)+(_0x540d36(0x15a)+_0x4f6ff1+'\x22\x20vs\x20lock\x20\x22'+_0x39a71b['scriptsRoot']+_0x540d36(0x15c))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x39a71b['functions']&&(_0x39a71b[_0x540d36(0x152)]={}),!_0x39a71b[_0x540d36(0x150)]&&(_0x39a71b[_0x540d36(0x150)]=''),{'lockData':_0x4a1a1f,'appLock':_0x39a71b};}export async function readBffLockFile(_0x13ea89){const _0x3a68d6=a276_0x3823;try{const _0xd936d8=await readFile(_0x13ea89,_0x3a68d6(0x155)),_0x4bef2c=JSON[_0x3a68d6(0x151)](_0xd936d8);return{'apps':_0x4bef2c['apps']&&typeof _0x4bef2c[_0x3a68d6(0x15f)]===_0x3a68d6(0x14c)?_0x4bef2c['apps']:{}};}catch(_0x2af50f){if(_0x2af50f[_0x3a68d6(0x154)]===_0x3a68d6(0x14b))return null;throw new Error(_0x3a68d6(0x15b)+String(_0x2af50f));}}export async function writeBffLockFile(_0x5f1d27,_0x4cbd9c){await mkdir(dirname(_0x5f1d27),{'recursive':!![]}),await writeFile(_0x5f1d27,JSON['stringify'](_0x4cbd9c,null,0x2),'utf8');}
@@ -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 a278_0x34c79e=a278_0xa445;(function(_0x6e6b35,_0x2e5335){const _0x1aca95=a278_0xa445,_0x9ece8=_0x6e6b35();while(!![]){try{const _0x9c4c4f=parseInt(_0x1aca95(0x1a8))/0x1*(parseInt(_0x1aca95(0x1a4))/0x2)+parseInt(_0x1aca95(0x1b7))/0x3+-parseInt(_0x1aca95(0x19f))/0x4*(parseInt(_0x1aca95(0x1ad))/0x5)+-parseInt(_0x1aca95(0x1ab))/0x6+parseInt(_0x1aca95(0x1a9))/0x7*(-parseInt(_0x1aca95(0x1b6))/0x8)+parseInt(_0x1aca95(0x1b5))/0x9*(-parseInt(_0x1aca95(0x1a5))/0xa)+parseInt(_0x1aca95(0x1b4))/0xb;if(_0x9c4c4f===_0x2e5335)break;else _0x9ece8['push'](_0x9ece8['shift']());}catch(_0x3434ef){_0x9ece8['push'](_0x9ece8['shift']());}}}(a278_0x5d3d,0xc29b3));export const DEFAULT_BFF_SCRIPT_DESCRIPTION=a278_0x34c79e(0x1b2);const LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION=a278_0x34c79e(0x1b1);export function snakeToCamel(_0x2f3d7){const _0x3cfc45=a278_0x34c79e;return _0x2f3d7[_0x3cfc45(0x1ae)]()[_0x3cfc45(0x1a3)](/_([a-z])/g,(_0x37982f,_0x43a8a1)=>_0x43a8a1[_0x3cfc45(0x1a1)]());}function a278_0xa445(_0x441553,_0x46abb5){_0x441553=_0x441553-0x19f;const _0x5d3dc4=a278_0x5d3d();let _0xa4458c=_0x5d3dc4[_0x441553];return _0xa4458c;}export function findHookLocationByRemoteId(_0x1459ef,_0xa83cb0){const _0x1a9450=a278_0x34c79e;if(!_0xa83cb0)return undefined;for(const [_0x8d24af,_0xfdc945]of Object[_0x1a9450(0x1a6)](_0x1459ef)){if(_0xfdc945[_0x1a9450(0x1af)]===_0xa83cb0&&_0xfdc945['datasetCode']&&_0xfdc945['operationType']&&_0xfdc945[_0x1a9450(0x1a0)]){const _0x2a6ff4=_0x8d24af[_0x1a9450(0x1b0)]('/')[0x1];return{'alias':_0x2a6ff4||_0xfdc945['alias'],'datasetCode':_0xfdc945[_0x1a9450(0x1ac)],'operationType':_0xfdc945['operationType'],'functionNode':_0xfdc945[_0x1a9450(0x1a0)]};}}return undefined;}export function extractScriptDescription(_0x577b34){const _0x402e76=a278_0x34c79e,_0x323a3b=_0x577b34['match'](/^\s*\/\*\*([\s\S]*?)\*\//);if(!_0x323a3b?.[0x1])return undefined;const _0x3c9968=_0x323a3b[0x1],_0x17ed79=_0x4c551d=>{const _0x5c344d=a278_0xa445,_0x46341d=_0x4c551d?.[_0x5c344d(0x1a7)]();if(!_0x46341d||_0x46341d===DEFAULT_BFF_SCRIPT_DESCRIPTION||_0x46341d===LEGACY_DEFAULT_BFF_SCRIPT_DESCRIPTION)return undefined;return _0x46341d;},_0x29229a=_0x3c9968[_0x402e76(0x1a2)](/^\s*\*\s*\[\s*脚本描述\s*]\s*(.+)$/m);if(_0x29229a)return _0x17ed79(_0x29229a[0x1]);const _0x455f91=_0x3c9968[_0x402e76(0x1b0)](/\r?\n/)[_0x402e76(0x1b9)](_0x26c203=>_0x26c203[_0x402e76(0x1a3)](/^\s*\*\s?/,'')[_0x402e76(0x1a7)]()),_0x49200c=_0x455f91[_0x402e76(0x1aa)](_0x21cd0b=>/^\[\s*脚本类型\s*]\s*\S+/[_0x402e76(0x1b3)](_0x21cd0b))&&_0x455f91[_0x402e76(0x1aa)](_0x41a3ac=>/^\[\s*脚本名称\s*]\s*\S+/[_0x402e76(0x1b3)](_0x41a3ac));if(!_0x49200c)return undefined;for(const _0x147076 of _0x455f91){if(!_0x147076||_0x147076['startsWith']('@')||/^\[[^\]]+]\s*/['test'](_0x147076))continue;return _0x17ed79(_0x147076);}return undefined;}export function isValidBffFunctionName(_0x323ac0){const _0x5badaf=a278_0x34c79e;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x5badaf(0x1b3)](_0x323ac0);}function a278_0x5d3d(){const _0x5097fc=['map','3760736DzPqMT','functionNode','toUpperCase','match','replace','6FAupQD','664220ElTjWr','entries','trim','333255LqfLZq','154EVUWcy','some','5059380ndbpWn','datasetCode','5vbWdKR','toLowerCase','remoteId','split','TODO:\x20add\x20script\x20description','TODO:\x20补充脚本功能描述','test','36635335uMFOwF','126zRbnnc','513176wsXqbP','1774239ssjnfr','after'];a278_0x5d3d=function(){return _0x5097fc;};return a278_0x5d3d();}export function normalizeHookFunctionNode(_0x2aefa1){const _0x27dcba=a278_0x34c79e;if(!_0x2aefa1)return undefined;const _0x3408c5=_0x2aefa1[_0x27dcba(0x1a7)]()['toLowerCase']();if(_0x3408c5==='before'||_0x3408c5===_0x27dcba(0x1b8))return _0x3408c5;return undefined;}
@@ -0,0 +1,41 @@
1
+ import type { ErRelationCardinality } from "../core/api-client.js";
2
+ export declare const CROSS_DB_RELATION_PATHS: {
3
+ readonly list: "/smartapi/cross-db-relation/query";
4
+ readonly create: "/smartapi/cross-db-relation/create";
5
+ readonly update: "/smartapi/cross-db-relation/update";
6
+ readonly delete: "/smartapi/cross-db-relation/delete";
7
+ };
8
+ export interface CrossDbRelationSource {
9
+ appCode: string;
10
+ fromDatasetCode: string;
11
+ fromField: string;
12
+ fromDblinkId?: number;
13
+ }
14
+ export interface CrossDbRelationMutation extends CrossDbRelationSource {
15
+ toDatasetCode: string;
16
+ toField: string;
17
+ refTableLabelName?: string;
18
+ cardinality?: ErRelationCardinality;
19
+ }
20
+ export interface CrossDbRelationQuery {
21
+ appCode: string;
22
+ fromDblinkId: number;
23
+ fromDatasetCode?: string;
24
+ fromField?: string;
25
+ }
26
+ export interface CrossDbRelationDetail {
27
+ relationId: number | string;
28
+ fromDblinkId: number;
29
+ fromDatasetCode: string | null;
30
+ fromDatasetName: string | null;
31
+ fromTableName: string;
32
+ fromField: string;
33
+ toDblinkId: number;
34
+ toDatasetCode: string | null;
35
+ toDatasetName: string | null;
36
+ toTableName: string;
37
+ toField: string;
38
+ refTableLabelName: string;
39
+ cardinality: ErRelationCardinality | null;
40
+ relationType: number;
41
+ }
@@ -0,0 +1 @@
1
+ function a279_0x5eab(){const _0x5ec3b5=['12MqKlGm','141200UtXNgU','/smartapi/cross-db-relation/create','12GqBhuh','1875657jIKTTi','681655TSXBxk','361521inztYK','/smartapi/cross-db-relation/delete','12pvktmy','24tTGtPS','/smartapi/cross-db-relation/query','2729243JdNBvI','560317Aboqge','/smartapi/cross-db-relation/update','237884ARYbfb','16BOoBJl'];a279_0x5eab=function(){return _0x5ec3b5;};return a279_0x5eab();}function a279_0x3303(_0x3581a4,_0x3eec4e){_0x3581a4=_0x3581a4-0xd6;const _0x5eab1f=a279_0x5eab();let _0x33032c=_0x5eab1f[_0x3581a4];return _0x33032c;}const a279_0x312b32=a279_0x3303;(function(_0x5860f4,_0x4b090c){const _0x14b06f=a279_0x3303,_0x4c4770=_0x5860f4();while(!![]){try{const _0x38dcff=-parseInt(_0x14b06f(0xe5))/0x1+parseInt(_0x14b06f(0xd7))/0x2*(parseInt(_0x14b06f(0xe1))/0x3)+parseInt(_0x14b06f(0xd8))/0x4*(-parseInt(_0x14b06f(0xde))/0x5)+parseInt(_0x14b06f(0xd9))/0x6*(parseInt(_0x14b06f(0xdd))/0x7)+parseInt(_0x14b06f(0xe2))/0x8*(parseInt(_0x14b06f(0xdf))/0x9)+parseInt(_0x14b06f(0xda))/0xa+parseInt(_0x14b06f(0xe4))/0xb*(parseInt(_0x14b06f(0xdc))/0xc);if(_0x38dcff===_0x4b090c)break;else _0x4c4770['push'](_0x4c4770['shift']());}catch(_0xf6114e){_0x4c4770['push'](_0x4c4770['shift']());}}}(a279_0x5eab,0x46801));export const CROSS_DB_RELATION_PATHS={'list':a279_0x312b32(0xe3),'create':a279_0x312b32(0xdb),'update':a279_0x312b32(0xd6),'delete':a279_0x312b32(0xe0)};
@@ -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(_0x247533,_0x2e715b){const _0x5462b6=a280_0x16fa,_0x436d40=_0x247533();while(!![]){try{const _0x1ba1ae=-parseInt(_0x5462b6(0x1b1))/0x1+-parseInt(_0x5462b6(0x1b0))/0x2+parseInt(_0x5462b6(0x1ca))/0x3*(-parseInt(_0x5462b6(0x1be))/0x4)+parseInt(_0x5462b6(0x1b5))/0x5*(-parseInt(_0x5462b6(0x1cd))/0x6)+-parseInt(_0x5462b6(0x1bc))/0x7*(parseInt(_0x5462b6(0x1ba))/0x8)+parseInt(_0x5462b6(0x1c1))/0x9+-parseInt(_0x5462b6(0x1af))/0xa*(-parseInt(_0x5462b6(0x1bf))/0xb);if(_0x1ba1ae===_0x2e715b)break;else _0x436d40['push'](_0x436d40['shift']());}catch(_0x3e7b75){_0x436d40['push'](_0x436d40['shift']());}}}(a280_0xe26c,0x98f5a));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x1c2547){const _0x54a5e8=a280_0x16fa;if(cache[_0x54a5e8(0x1b2)](_0x1c2547))return cache[_0x54a5e8(0x1b8)](_0x1c2547);const _0x2410c2=await listDatasets(_0x1c2547),_0x383169=new Map();for(const _0x1e002b of _0x2410c2){const _0x662b99=_0x1e002b[_0x54a5e8(0x1b6)];_0x662b99?.[_0x54a5e8(0x1ae)]!=null&&_0x383169['set'](_0x662b99['dbId'],_0x662b99[_0x54a5e8(0x1c6)]??_0x54a5e8(0x1cb)+_0x662b99[_0x54a5e8(0x1ae)]);}const _0x1d3223=[..._0x383169[_0x54a5e8(0x1c8)]()]['map'](([_0x62bc27,_0x421889])=>({'dbId':_0x62bc27,'dbName':_0x421889}));return cache['set'](_0x1c2547,_0x1d3223),_0x1d3223;}export async function resolveDb(_0xecb642,_0x5cbdf3){const _0x1bdc77=a280_0x16fa,_0x2dfc26=await listDatabases(_0xecb642);if(_0x2dfc26[_0x1bdc77(0x1c0)]===0x0)return{'resolved':[],'error':_0x1bdc77(0x1bb)+_0xecb642+_0x1bdc77(0x1c2)};if(!_0x5cbdf3)return{'resolved':_0x2dfc26};const _0x52b11a=Number(_0x5cbdf3);if(!Number[_0x1bdc77(0x1c4)](_0x52b11a)){const _0x352fcf=_0x2dfc26[_0x1bdc77(0x1bd)](_0x2db41e=>_0x2db41e[_0x1bdc77(0x1ae)]===_0x52b11a);if(_0x352fcf)return{'resolved':[_0x352fcf]};}const _0x10cdc1=_0x5cbdf3[_0x1bdc77(0x1b7)](),_0x5211b9=_0x2dfc26[_0x1bdc77(0x1c7)](_0x5afe33=>_0x5afe33[_0x1bdc77(0x1c6)][_0x1bdc77(0x1b7)]()['includes'](_0x10cdc1));if(_0x5211b9[_0x1bdc77(0x1c0)]>0x0)return{'resolved':_0x5211b9};const _0x62db79=_0x2dfc26[_0x1bdc77(0x1cc)](_0x153b3b=>_0x153b3b[_0x1bdc77(0x1c6)]+'\x20('+_0x153b3b[_0x1bdc77(0x1ae)]+')')[_0x1bdc77(0x1c9)](',\x20');return{'resolved':[],'error':_0x1bdc77(0x1b3)+_0x5cbdf3+'\x22\x20under\x20app\x20\x22'+_0xecb642+_0x1bdc77(0x1c3)+_0x62db79+_0x1bdc77(0x1c5)};}function a280_0xe26c(){const _0x162114=['filter','entries','join','6FxgXVG','db-','map','1616298YLXmGc','dbId','51410dbfGdL','2429366NwnNBq','639230gegRQD','has','No\x20database\x20matching\x20\x22','\x22\x20matches\x20multiple\x20databases:\x20','10qjXizu','dbtableConfig','toLowerCase','get','.\x20Be\x20more\x20specific.','116584QvzjuB','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','126AoVEAd','find','403604WNKzOP','4862EPCLmq','length','10898955iteQdG','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','\x22.\x20Available:\x20','isNaN','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','dbName'];a280_0xe26c=function(){return _0x162114;};return a280_0xe26c();}function a280_0x16fa(_0x493d19,_0x525631){_0x493d19=_0x493d19-0x1ae;const _0xe26cdb=a280_0xe26c();let _0x16fae7=_0xe26cdb[_0x493d19];return _0x16fae7;}export async function resolveOneDb(_0xc2bbdb,_0x28c2bf){const _0x11c204=a280_0x16fa,{resolved:_0x33bfaa,error:_0x5b6960}=await resolveDb(_0xc2bbdb,_0x28c2bf);if(_0x5b6960)return{'db':null,'error':_0x5b6960};if(_0x33bfaa[_0x11c204(0x1c0)]===0x1)return{'db':_0x33bfaa[0x0]};if(!_0x28c2bf){const _0x302fff=_0x33bfaa[_0x11c204(0x1cc)](_0x2d2695=>_0x2d2695[_0x11c204(0x1c6)]+'\x20('+_0x2d2695[_0x11c204(0x1ae)]+')')[_0x11c204(0x1c9)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x302fff};}const _0x57be6d=_0x33bfaa['map'](_0x2816c3=>_0x2816c3['dbName']+'\x20('+_0x2816c3[_0x11c204(0x1ae)]+')')[_0x11c204(0x1c9)](',\x20');return{'db':null,'error':'\x22'+_0x28c2bf+_0x11c204(0x1b4)+_0x57be6d+_0x11c204(0x1b9)};}export async function getDbName(_0x595658,_0x16c475){const _0x6dd01d=a280_0x16fa,_0x46cab8=await listDatabases(_0x595658);return _0x46cab8[_0x6dd01d(0x1bd)](_0x19acef=>_0x19acef[_0x6dd01d(0x1ae)]===_0x16c475)?.[_0x6dd01d(0x1c6)];}