@lovrabet/rabetbase-cli 2.5.2 → 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 (395) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.d.ts +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.d.ts +2 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/auth/auth-server-ui.js +1 -1
  8. package/lib/auth/auth-server.js +1 -1
  9. package/lib/auth/constant.js +1 -1
  10. package/lib/auth/get-cookie.js +1 -1
  11. package/lib/auth/get-session-user.js +1 -1
  12. package/lib/auth/is-session-valid.js +1 -1
  13. package/lib/auth/login-success-html.js +1 -1
  14. package/lib/auth/logout.js +1 -1
  15. package/lib/cli-flags.js +1 -1
  16. package/lib/cli.js +1 -1
  17. package/lib/commands/api/generate.js +1 -1
  18. package/lib/commands/api/index.js +1 -1
  19. package/lib/commands/api/list.js +1 -1
  20. package/lib/commands/api/pull.js +1 -1
  21. package/lib/commands/api/shared.js +1 -1
  22. package/lib/commands/app/index.js +1 -1
  23. package/lib/commands/app/list.js +1 -1
  24. package/lib/commands/app/members-list.js +1 -1
  25. package/lib/commands/app/remote-directory.js +1 -1
  26. package/lib/commands/app/shared.js +1 -1
  27. package/lib/commands/app-config/delete.js +1 -1
  28. package/lib/commands/app-config/get.js +1 -1
  29. package/lib/commands/app-config/index.js +1 -1
  30. package/lib/commands/app-config/list.js +1 -1
  31. package/lib/commands/app-config/set.js +1 -1
  32. package/lib/commands/app-config/shared.js +1 -1
  33. package/lib/commands/auth/index.js +1 -1
  34. package/lib/commands/bff/create.js +1 -1
  35. package/lib/commands/bff/delete.js +1 -1
  36. package/lib/commands/bff/detail.js +1 -1
  37. package/lib/commands/bff/index.js +1 -1
  38. package/lib/commands/bff/list.js +1 -1
  39. package/lib/commands/bff/logs.d.ts +7 -0
  40. package/lib/commands/bff/logs.js +1 -0
  41. package/lib/commands/bff/pull.js +1 -1
  42. package/lib/commands/bff/push.js +1 -1
  43. package/lib/commands/bff/status.js +1 -1
  44. package/lib/commands/cli-skill/index.js +1 -1
  45. package/lib/commands/cli-update.js +1 -1
  46. package/lib/commands/codegen/index.js +1 -1
  47. package/lib/commands/codegen/sdk.js +1 -1
  48. package/lib/commands/codegen/sql.js +1 -1
  49. package/lib/commands/common/app-registry.js +1 -1
  50. package/lib/commands/common/app-selector.js +1 -1
  51. package/lib/commands/common/async-task.js +1 -1
  52. package/lib/commands/common/dry-run.js +1 -1
  53. package/lib/commands/common/flags.js +1 -1
  54. package/lib/commands/common/local-file.js +1 -1
  55. package/lib/commands/common/validate.js +1 -1
  56. package/lib/commands/config/delete.js +1 -1
  57. package/lib/commands/config/get.js +1 -1
  58. package/lib/commands/config/index.js +1 -1
  59. package/lib/commands/config/init.js +1 -1
  60. package/lib/commands/config/list.js +1 -1
  61. package/lib/commands/config/set.js +1 -1
  62. package/lib/commands/config/shared.js +1 -1
  63. package/lib/commands/dataset/batch-design.d.ts +21 -0
  64. package/lib/commands/dataset/batch-design.js +1 -0
  65. package/lib/commands/dataset/business-group-update.js +1 -1
  66. package/lib/commands/dataset/business-groups.js +1 -1
  67. package/lib/commands/dataset/capability.js +1 -1
  68. package/lib/commands/dataset/delete.js +1 -1
  69. package/lib/commands/dataset/detail.js +1 -1
  70. package/lib/commands/dataset/extend-update.js +1 -1
  71. package/lib/commands/dataset/field-restore.js +1 -1
  72. package/lib/commands/dataset/field-update.js +1 -1
  73. package/lib/commands/dataset/generate.js +1 -1
  74. package/lib/commands/dataset/index.js +1 -1
  75. package/lib/commands/dataset/list.js +1 -1
  76. package/lib/commands/dataset/operations.js +1 -1
  77. package/lib/commands/dataset/relation-audit.js +1 -1
  78. package/lib/commands/dataset/relation-create.js +1 -1
  79. package/lib/commands/dataset/relation-delete.js +1 -1
  80. package/lib/commands/dataset/relation-shared.js +1 -1
  81. package/lib/commands/dataset/relation-update.js +1 -1
  82. package/lib/commands/dataset/relations.js +1 -1
  83. package/lib/commands/dataset/rename.js +1 -1
  84. package/lib/commands/dataset/restore.js +1 -1
  85. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  86. package/lib/commands/db/analysis-batching.js +1 -1
  87. package/lib/commands/db/analyze-batch-plan.js +1 -1
  88. package/lib/commands/db/analyze-cancel.js +1 -1
  89. package/lib/commands/db/analyze-start.js +1 -1
  90. package/lib/commands/db/analyze-status.js +1 -1
  91. package/lib/commands/db/create.js +1 -1
  92. package/lib/commands/db/delete.js +1 -1
  93. package/lib/commands/db/detail.js +1 -1
  94. package/lib/commands/db/diff-refresh-start.js +1 -1
  95. package/lib/commands/db/diff-refresh-status.js +1 -1
  96. package/lib/commands/db/diff.js +1 -1
  97. package/lib/commands/db/index.js +1 -1
  98. package/lib/commands/db/list.js +1 -1
  99. package/lib/commands/db/shared.js +1 -1
  100. package/lib/commands/db/table-diff-shared.js +1 -1
  101. package/lib/commands/db/tables.js +1 -1
  102. package/lib/commands/db/test.js +1 -1
  103. package/lib/commands/db/update.js +1 -1
  104. package/lib/commands/deployment/index.js +1 -1
  105. package/lib/commands/deployment/sync-all.js +1 -1
  106. package/lib/commands/deployment/sync-jobs.js +1 -1
  107. package/lib/commands/deployment/sync-status.js +1 -1
  108. package/lib/commands/doctor.js +1 -1
  109. package/lib/commands/file/index.js +1 -1
  110. package/lib/commands/flow/create.d.ts +2 -0
  111. package/lib/commands/flow/create.js +1 -0
  112. package/lib/commands/flow/detail.d.ts +2 -0
  113. package/lib/commands/flow/detail.js +1 -0
  114. package/lib/commands/flow/index.d.ts +3 -0
  115. package/lib/commands/flow/index.js +1 -0
  116. package/lib/commands/flow/list.d.ts +2 -0
  117. package/lib/commands/flow/list.js +1 -0
  118. package/lib/commands/flow/publish.d.ts +2 -0
  119. package/lib/commands/flow/publish.js +1 -0
  120. package/lib/commands/flow/runtime-resources-shared.d.ts +40 -0
  121. package/lib/commands/flow/runtime-resources-shared.js +1 -0
  122. package/lib/commands/flow/runtime-role-list.d.ts +2 -0
  123. package/lib/commands/flow/runtime-role-list.js +1 -0
  124. package/lib/commands/flow/runtime-role-user-list.d.ts +2 -0
  125. package/lib/commands/flow/runtime-role-user-list.js +1 -0
  126. package/lib/commands/flow/runtime-user-search.d.ts +2 -0
  127. package/lib/commands/flow/runtime-user-search.js +1 -0
  128. package/lib/commands/flow/shared.d.ts +41 -0
  129. package/lib/commands/flow/shared.js +1 -0
  130. package/lib/commands/flow/update.d.ts +2 -0
  131. package/lib/commands/flow/update.js +1 -0
  132. package/lib/commands/flow/validate.d.ts +3 -0
  133. package/lib/commands/flow/validate.js +1 -0
  134. package/lib/commands/instant-api-policy/current.js +1 -1
  135. package/lib/commands/instant-api-policy/index.js +1 -1
  136. package/lib/commands/instant-api-policy/init.js +1 -1
  137. package/lib/commands/instant-api-policy/publish.js +1 -1
  138. package/lib/commands/instant-api-policy/pull.js +1 -1
  139. package/lib/commands/instant-api-policy/revision.js +1 -1
  140. package/lib/commands/instant-api-policy/revisions.js +1 -1
  141. package/lib/commands/instant-api-policy/rollback.js +1 -1
  142. package/lib/commands/instant-api-policy/shared.js +1 -1
  143. package/lib/commands/instant-api-policy/validate.js +1 -1
  144. package/lib/commands/issue/index.js +1 -1
  145. package/lib/commands/issue/nudge.js +1 -1
  146. package/lib/commands/issue/report.js +1 -1
  147. package/lib/commands/issue/shared.js +1 -1
  148. package/lib/commands/kb/create.js +1 -1
  149. package/lib/commands/kb/delete.js +1 -1
  150. package/lib/commands/kb/detail.js +1 -1
  151. package/lib/commands/kb/index.js +1 -1
  152. package/lib/commands/kb/list.js +1 -1
  153. package/lib/commands/kb/search.js +1 -1
  154. package/lib/commands/kb/shared.js +1 -1
  155. package/lib/commands/kb/update.js +1 -1
  156. package/lib/commands/logs/index.js +1 -1
  157. package/lib/commands/menu/asset-update.js +1 -1
  158. package/lib/commands/menu/delete.js +1 -1
  159. package/lib/commands/menu/external-link-create.js +1 -1
  160. package/lib/commands/menu/external-link-update.js +1 -1
  161. package/lib/commands/menu/group-create.js +1 -1
  162. package/lib/commands/menu/group-update.js +1 -1
  163. package/lib/commands/menu/index.js +1 -1
  164. package/lib/commands/menu/list.js +1 -1
  165. package/lib/commands/menu/move.js +1 -1
  166. package/lib/commands/menu/regroup-start.js +1 -1
  167. package/lib/commands/menu/rename.js +1 -1
  168. package/lib/commands/menu/shared/compare-table.js +1 -1
  169. package/lib/commands/menu/shared/delete-plan.js +1 -1
  170. package/lib/commands/menu/shared/facts.js +1 -1
  171. package/lib/commands/menu/shared/index.js +1 -1
  172. package/lib/commands/menu/shared/inquirer.js +1 -1
  173. package/lib/commands/menu/shared/local-pages.js +1 -1
  174. package/lib/commands/menu/shared/logic.js +1 -1
  175. package/lib/commands/menu/shared/mutations.js +1 -1
  176. package/lib/commands/menu/shared/service.js +1 -1
  177. package/lib/commands/menu/shared/sync-core.js +1 -1
  178. package/lib/commands/menu/shared/update-core.js +1 -1
  179. package/lib/commands/menu/shared/valid-url.js +1 -1
  180. package/lib/commands/menu/sync.js +1 -1
  181. package/lib/commands/menu/visibility-update.js +1 -1
  182. package/lib/commands/notification/config-create.js +1 -1
  183. package/lib/commands/notification/config-delete.js +1 -1
  184. package/lib/commands/notification/config-list.js +1 -1
  185. package/lib/commands/notification/config-update.js +1 -1
  186. package/lib/commands/notification/index.js +1 -1
  187. package/lib/commands/notification/shared.js +1 -1
  188. package/lib/commands/ocr/index.js +1 -1
  189. package/lib/commands/page/create.js +1 -1
  190. package/lib/commands/page/custom/detail.js +1 -1
  191. package/lib/commands/page/custom/list.js +1 -1
  192. package/lib/commands/page/custom/publish.js +1 -1
  193. package/lib/commands/page/custom/shared.js +1 -1
  194. package/lib/commands/page/custom/syntax.js +1 -1
  195. package/lib/commands/page/custom/update.js +1 -1
  196. package/lib/commands/page/data-list-status.js +1 -1
  197. package/lib/commands/page/generate-start.js +1 -1
  198. package/lib/commands/page/generate-status.js +1 -1
  199. package/lib/commands/page/index.js +1 -1
  200. package/lib/commands/page/pull.js +1 -1
  201. package/lib/commands/page/push.js +1 -1
  202. package/lib/commands/page/relation-audit.js +1 -1
  203. package/lib/commands/page/restore.js +1 -1
  204. package/lib/commands/page/shared.js +1 -1
  205. package/lib/commands/page/sync.js +1 -1
  206. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  207. package/lib/commands/project/create/format-elapsed.js +1 -1
  208. package/lib/commands/project/create/main.js +1 -1
  209. package/lib/commands/project/create/materialize-project-template.js +1 -1
  210. package/lib/commands/project/create/project-name.js +1 -1
  211. package/lib/commands/project/create/project-template-archive.js +1 -1
  212. package/lib/commands/project/create/project-template-path.js +1 -1
  213. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  214. package/lib/commands/project/create/use-format-code.js +1 -1
  215. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  216. package/lib/commands/project/domain-routing-sync.js +1 -1
  217. package/lib/commands/project/index.js +1 -1
  218. package/lib/commands/project/upgrade.js +1 -1
  219. package/lib/commands/registry.js +1 -1
  220. package/lib/commands/role/delete.js +1 -1
  221. package/lib/commands/role/detail.js +1 -1
  222. package/lib/commands/role/index.js +1 -1
  223. package/lib/commands/role/list.js +1 -1
  224. package/lib/commands/role/shared.js +1 -1
  225. package/lib/commands/role/update.js +1 -1
  226. package/lib/commands/role/user-add.js +1 -1
  227. package/lib/commands/role/user-remove.js +1 -1
  228. package/lib/commands/role/user-resolve.js +1 -1
  229. package/lib/commands/rule/get.js +1 -1
  230. package/lib/commands/rule/index.js +1 -1
  231. package/lib/commands/rule/list.js +1 -1
  232. package/lib/commands/rule/set.js +1 -1
  233. package/lib/commands/rule/shared.js +1 -1
  234. package/lib/commands/run/index.js +1 -1
  235. package/lib/commands/schema.js +1 -1
  236. package/lib/commands/sql/create.js +1 -1
  237. package/lib/commands/sql/delete.js +1 -1
  238. package/lib/commands/sql/detail.js +1 -1
  239. package/lib/commands/sql/exec.js +1 -1
  240. package/lib/commands/sql/index.js +1 -1
  241. package/lib/commands/sql/list.js +1 -1
  242. package/lib/commands/sql/pull.js +1 -1
  243. package/lib/commands/sql/push.js +1 -1
  244. package/lib/commands/sql/shared.js +1 -1
  245. package/lib/commands/sql/status.js +1 -1
  246. package/lib/commands/sql/validate.js +1 -1
  247. package/lib/commands/task/index.js +1 -1
  248. package/lib/commands/task/status.js +1 -1
  249. package/lib/commands/tenant/index.js +1 -1
  250. package/lib/commands/tenant/members-list.js +1 -1
  251. package/lib/commands/tenant/shared.js +1 -1
  252. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  253. package/lib/commands/user-account/index.js +1 -1
  254. package/lib/commands/workspace/add.js +1 -1
  255. package/lib/commands/workspace/index.js +1 -1
  256. package/lib/commands/workspace/remove.js +1 -1
  257. package/lib/config/domain-config.js +1 -1
  258. package/lib/config/project-domain-routing.js +1 -1
  259. package/lib/config/region-config.d.ts +23 -0
  260. package/lib/config/region-config.js +1 -0
  261. package/lib/config/schema.d.ts +15 -0
  262. package/lib/config/schema.js +1 -1
  263. package/lib/constant/cdn.js +1 -1
  264. package/lib/constant/cli.js +1 -1
  265. package/lib/constant/defaults.js +1 -1
  266. package/lib/constant/domain.js +1 -1
  267. package/lib/constant/env.js +1 -1
  268. package/lib/constant/output.js +1 -1
  269. package/lib/constant/paths.js +1 -1
  270. package/lib/constant/region.js +1 -1
  271. package/lib/constant/risk.js +1 -1
  272. package/lib/constant/routing-profile.js +1 -1
  273. package/lib/context/app-resolver.d.ts +6 -0
  274. package/lib/context/app-resolver.js +1 -1
  275. package/lib/context/auth-resolver.js +1 -1
  276. package/lib/context/config-loader.js +1 -1
  277. package/lib/context.d.ts +13 -0
  278. package/lib/context.js +1 -1
  279. package/lib/core/alias-resolver.js +1 -1
  280. package/lib/core/api-client.d.ts +172 -1
  281. package/lib/core/api-client.js +1 -1
  282. package/lib/core/bff/config.js +1 -1
  283. package/lib/core/bff/file-system.js +1 -1
  284. package/lib/core/bff/hash.js +1 -1
  285. package/lib/core/bff/hook-directory.d.ts +55 -0
  286. package/lib/core/bff/hook-directory.js +1 -0
  287. package/lib/core/bff/lock.js +1 -1
  288. package/lib/core/bff/types.d.ts +15 -0
  289. package/lib/core/bff/utils.js +1 -1
  290. package/lib/core/db-resolver.js +1 -1
  291. package/lib/core/flow-config.d.ts +628 -0
  292. package/lib/core/flow-config.js +1 -0
  293. package/lib/core/instant-api-policy/config.js +1 -1
  294. package/lib/core/kb-search-client.js +1 -1
  295. package/lib/core/page/file-system.js +1 -1
  296. package/lib/core/page/hash.js +1 -1
  297. package/lib/core/page/lock.js +1 -1
  298. package/lib/core/page/lr-smart-jsx.d.ts +6 -0
  299. package/lib/core/page/lr-smart-jsx.js +1 -0
  300. package/lib/core/sql-index-auditor.js +1 -1
  301. package/lib/core/sql-sync/config.js +1 -1
  302. package/lib/core/sql-sync/file-system.js +1 -1
  303. package/lib/core/sql-sync/hash.js +1 -1
  304. package/lib/core/sql-sync/lock.js +1 -1
  305. package/lib/core/sql-sync/utils.js +1 -1
  306. package/lib/core/sql-validator.js +1 -1
  307. package/lib/errors.js +1 -1
  308. package/lib/framework/build-all-flags.js +1 -1
  309. package/lib/framework/error-output.js +1 -1
  310. package/lib/framework/explicit-yes.js +1 -1
  311. package/lib/framework/flags.js +1 -1
  312. package/lib/framework/help.js +1 -1
  313. package/lib/framework/index.js +1 -1
  314. package/lib/framework/output.js +1 -1
  315. package/lib/framework/response.js +1 -1
  316. package/lib/framework/runner-alias.js +1 -1
  317. package/lib/framework/runner.js +1 -1
  318. package/lib/framework/schema-export.js +1 -1
  319. package/lib/framework/supported-flags.js +1 -1
  320. package/lib/framework/types.js +1 -1
  321. package/lib/generated/build-info.d.ts +4 -4
  322. package/lib/generated/build-info.js +1 -1
  323. package/lib/generated/official-routing.js +1 -1
  324. package/lib/generated/routing-contract.js +1 -1
  325. package/lib/help.js +1 -1
  326. package/lib/postinstall.js +1 -1
  327. package/lib/runtime/confirmation.js +1 -1
  328. package/lib/runtime/event.js +1 -1
  329. package/lib/runtime/index.js +1 -1
  330. package/lib/runtime/queue.js +1 -1
  331. package/lib/runtime/resolve.js +1 -1
  332. package/lib/skills/builtin-skill.js +1 -1
  333. package/lib/skills/main.js +1 -1
  334. package/lib/skills/npx-skills-add.js +1 -1
  335. package/lib/skills/skill-presence.js +1 -1
  336. package/lib/telemetry/cli-command-trace.js +1 -1
  337. package/lib/telemetry/cli-help-trace.js +1 -1
  338. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  339. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  340. package/lib/telemetry/send-cli-trace-log.js +1 -1
  341. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  342. package/lib/types/index.d.ts +1 -1
  343. package/lib/utils/ai_config.js +1 -1
  344. package/lib/utils/apply-jq-filter.js +1 -1
  345. package/lib/utils/cdn-config.js +1 -1
  346. package/lib/utils/check-sdk-version.js +1 -1
  347. package/lib/utils/cli-version-check.js +1 -1
  348. package/lib/utils/cli-version-policy.js +1 -1
  349. package/lib/utils/config.d.ts +2 -8
  350. package/lib/utils/config.js +1 -1
  351. package/lib/utils/entity-with-id.js +1 -1
  352. package/lib/utils/file-utils.js +1 -1
  353. package/lib/utils/guides-cdn.js +1 -1
  354. package/lib/utils/http-client.js +1 -1
  355. package/lib/utils/is-non-interactive.js +1 -1
  356. package/lib/utils/logger.js +1 -1
  357. package/lib/utils/params.js +1 -1
  358. package/lib/utils/platform.js +1 -1
  359. package/lib/utils/sleep.js +1 -1
  360. package/lib/utils/template-replacer.d.ts +2 -1
  361. package/lib/utils/template-replacer.js +1 -1
  362. package/lib/utils/update-notice.js +1 -1
  363. package/lib/utils/version.js +1 -1
  364. package/lib/utils/with-active-cookie.js +1 -1
  365. package/lib/utils/write-cli-side-channel.js +1 -1
  366. package/package.json +1 -1
  367. package/skills/rabetbase/SKILL.md +27 -8
  368. package/skills/rabetbase/guides/approval-flow-development-workflow.md +137 -0
  369. package/skills/rabetbase/guides/backend-function.md +19 -9
  370. package/skills/rabetbase/guides/bff-creation-workflow.md +10 -1
  371. package/skills/rabetbase/guides/conflict-detection.md +2 -0
  372. package/skills/rabetbase/guides/page-development-workflow.md +3 -0
  373. package/skills/rabetbase/guides/sdk-client-generation.md +6 -5
  374. package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +290 -0
  375. package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +11 -3
  376. package/skills/rabetbase/references/rabetbase-api-pull.md +5 -4
  377. package/skills/rabetbase/references/rabetbase-app-list.md +3 -0
  378. package/skills/rabetbase/references/rabetbase-bff-create.md +1 -1
  379. package/skills/rabetbase/references/rabetbase-bff-list.md +1 -1
  380. package/skills/rabetbase/references/rabetbase-bff-logs.md +47 -0
  381. package/skills/rabetbase/references/rabetbase-bff-pull.md +9 -3
  382. package/skills/rabetbase/references/rabetbase-bff-push.md +10 -2
  383. package/skills/rabetbase/references/rabetbase-bff-status.md +2 -0
  384. package/skills/rabetbase/references/rabetbase-config.md +10 -9
  385. package/skills/rabetbase/references/rabetbase-dataset-generate.md +52 -2
  386. package/skills/rabetbase/references/rabetbase-doctor.md +2 -2
  387. package/skills/rabetbase/references/rabetbase-flow-commands.md +86 -0
  388. package/skills/rabetbase/references/rabetbase-flow-resources.md +83 -0
  389. package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +25 -0
  390. package/skills/rabetbase/references/rabetbase-instant-api-policy.md +103 -11
  391. package/skills/rabetbase/references/rabetbase-notification-config-list.md +17 -0
  392. package/skills/rabetbase/references/rabetbase-page-push.md +5 -1
  393. package/skills/rabetbase/references/rabetbase-workspace.md +4 -2
  394. package/skills/rabetbase.manifest.json +9 -3
  395. package/templates/generate-api/client.ts.tpl +1 -1
@@ -0,0 +1,628 @@
1
+ /** Supported node types in the current simple approval-flow DSL. */
2
+ export type FlowNodeType = "START" | "END" | "APPROVAL" | "CONDITION" | "SCRIPT" | "NOTIFICATION";
3
+ /** Supported approval modes in the current simple approval-flow DSL. */
4
+ export type ApprovalMode = "SINGLE" | "ALL" | "ANY";
5
+ /** Supported user-task modes. Missing values keep the historical APPROVAL behavior. */
6
+ export type ApprovalTaskMode = "APPROVAL" | "HANDLE";
7
+ /** Supported units for retry and approval timeout durations. */
8
+ export type FlowTimeUnit = "SECONDS" | "MINUTES" | "HOURS" | "DAYS";
9
+ /** Supported approval timeout actions. */
10
+ export type ApprovalTimeoutAction = "AUTO_APPROVE" | "AUTO_REJECT" | "EXECUTE_BFF";
11
+ /** Supported edge conditions in the current simple approval-flow DSL. */
12
+ export type FlowConditionType = "ALWAYS" | "APPROVED" | "REJECTED" | "EXPRESSION";
13
+ /** Supported design-time flow types. */
14
+ export type FlowType = "FORM_FLOW" | "INDEPENDENT_FLOW";
15
+ /** Page rendering mode for an independent workflow. */
16
+ export type FlowPageMode = "CUSTOM_PAGE" | "PLATFORM_FORM";
17
+ /** JSON object used by the flow DSL. */
18
+ export interface FlowJsonObject {
19
+ [key: string]: unknown;
20
+ }
21
+ /** A notification card fact row. */
22
+ export interface FlowNotificationFact extends FlowJsonObject {
23
+ label: string;
24
+ value: string;
25
+ }
26
+ /** A notification card action. */
27
+ export interface FlowNotificationAction extends FlowJsonObject {
28
+ text: string;
29
+ url: string;
30
+ }
31
+ /** An explicit notification recipient. */
32
+ export interface FlowNotificationRecipient extends FlowJsonObject {
33
+ type: "USER" | "ROLE" | "EMAIL";
34
+ value: string;
35
+ role?: "TO" | "CC" | "BCC";
36
+ }
37
+ /** Stable v1 notification node configuration. */
38
+ export interface FlowNotificationConfig extends FlowJsonObject {
39
+ version?: "v1";
40
+ configCode: string;
41
+ failurePolicy?: "CONTINUE" | "FAIL";
42
+ template: {
43
+ title: string;
44
+ summary: string;
45
+ facts?: FlowNotificationFact[];
46
+ detailMarkdown?: string;
47
+ actions?: FlowNotificationAction[];
48
+ [key: string]: unknown;
49
+ };
50
+ recipients?: FlowNotificationRecipient[];
51
+ }
52
+ /** A positive duration used by async retry and approval timeout settings. */
53
+ export interface FlowTimeAmount extends FlowJsonObject {
54
+ value: number;
55
+ unit: FlowTimeUnit;
56
+ }
57
+ /** SCRIPT node asynchronous execution and persistent retry settings. */
58
+ export interface FlowAsyncExecution extends FlowJsonObject {
59
+ enabled?: boolean;
60
+ retryCount?: number;
61
+ retryInterval?: FlowTimeAmount;
62
+ }
63
+ /** APPROVAL node timeout settings. */
64
+ export interface FlowApprovalTimeout extends FlowJsonObject {
65
+ enabled?: boolean;
66
+ duration?: FlowTimeAmount;
67
+ action?: ApprovalTimeoutAction;
68
+ interrupting?: boolean;
69
+ scriptName?: string;
70
+ resultVariable?: string;
71
+ }
72
+ /** APPROVAL / END node default copy recipients. Custom-form readSources are unsupported. */
73
+ export interface FlowCcConfig extends FlowJsonObject {
74
+ recipientUserIds: string[];
75
+ visible?: string[];
76
+ }
77
+ /** A flow node. Additional DSL fields are preserved for forward compatibility. */
78
+ export interface FlowNode extends FlowJsonObject {
79
+ id: string;
80
+ type: FlowNodeType;
81
+ name: string;
82
+ /** Optional custom-page navigation target for this user task. */
83
+ pageId?: number;
84
+ position: {
85
+ x: number;
86
+ y: number;
87
+ [key: string]: unknown;
88
+ };
89
+ approvalMode?: ApprovalMode;
90
+ taskMode?: ApprovalTaskMode;
91
+ assignee?: FlowJsonObject;
92
+ transferCandidates?: FlowJsonObject;
93
+ sequential?: boolean;
94
+ result?: string;
95
+ scriptName?: string;
96
+ resultVariable?: string;
97
+ async?: FlowAsyncExecution;
98
+ timeout?: FlowApprovalTimeout;
99
+ cc?: FlowCcConfig;
100
+ config?: FlowNotificationConfig;
101
+ }
102
+ /** A directed flow edge. */
103
+ export interface FlowEdge extends FlowJsonObject {
104
+ id?: string;
105
+ source?: string;
106
+ target?: string;
107
+ sourceNodeId?: string;
108
+ targetNodeId?: string;
109
+ conditionType?: FlowConditionType;
110
+ expression?: string;
111
+ defaultFlow?: boolean;
112
+ name?: string;
113
+ waypoints?: Array<{
114
+ x: number;
115
+ y: number;
116
+ [key: string]: unknown;
117
+ }>;
118
+ }
119
+ /** The minimal graph portion of a locally stored flow configuration. */
120
+ export interface FlowJson extends FlowJsonObject {
121
+ /** Only applies to INDEPENDENT_FLOW; missing values default to CUSTOM_PAGE. */
122
+ pageMode?: FlowPageMode;
123
+ /** Optional custom-page navigation target used before starting a workflow. */
124
+ startPageId?: number;
125
+ nodes: FlowNode[];
126
+ edges: FlowEdge[];
127
+ }
128
+ /** Local flow manifest metadata and its minimal graph DSL. */
129
+ export interface FlowConfig extends FlowJsonObject {
130
+ flowName: string;
131
+ flowDesc?: string;
132
+ flowType: FlowType;
133
+ datasetCode?: string;
134
+ pageId?: number;
135
+ flowJson: FlowJson;
136
+ }
137
+ /** A normalization warning for a removed or migrated field. */
138
+ export interface FlowConfigWarning {
139
+ code: "legacy_field_removed" | "empty_metadata_removed";
140
+ path: string;
141
+ message: string;
142
+ }
143
+ /** Normalized manifest returned by {@link normalizeFlowConfig}. */
144
+ export interface NormalizedFlowConfig {
145
+ config: FlowConfig;
146
+ warnings: FlowConfigWarning[];
147
+ removedPaths: string[];
148
+ }
149
+ /** A single local validation error. */
150
+ export interface FlowConfigIssue {
151
+ path: string;
152
+ message: string;
153
+ }
154
+ /** Result returned by {@link validateFlowConfig}. */
155
+ export interface FlowConfigValidationResult {
156
+ valid: boolean;
157
+ errors: FlowConfigIssue[];
158
+ warnings: FlowConfigWarning[];
159
+ normalized: FlowConfig;
160
+ /** In-memory compiler-shaped copy; never write this object to disk. */
161
+ validationConfig: FlowConfig;
162
+ }
163
+ /** JSON Schema metadata for tools that want to inspect the local manifest shape. */
164
+ export declare const FLOW_CONFIG_JSON_SCHEMA: {
165
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
166
+ readonly $id: "https://lovrabet.com/schema/rabetbase-flow-config.json";
167
+ readonly title: "Rabetbase FlowConfig";
168
+ readonly type: "object";
169
+ readonly required: readonly ["flowName", "flowType", "flowJson"];
170
+ readonly $defs: {
171
+ readonly userId: {
172
+ readonly anyOf: readonly [{
173
+ readonly type: "string";
174
+ readonly minLength: 1;
175
+ }, {
176
+ readonly type: "integer";
177
+ readonly minimum: 1;
178
+ }];
179
+ };
180
+ readonly position: {
181
+ readonly type: "object";
182
+ readonly required: readonly ["x", "y"];
183
+ readonly properties: {
184
+ readonly x: {
185
+ readonly type: "number";
186
+ readonly minimum: 0;
187
+ };
188
+ readonly y: {
189
+ readonly type: "number";
190
+ readonly minimum: 0;
191
+ };
192
+ };
193
+ readonly additionalProperties: true;
194
+ };
195
+ readonly timeAmount: {
196
+ readonly type: "object";
197
+ readonly required: readonly ["value", "unit"];
198
+ readonly properties: {
199
+ readonly value: {
200
+ readonly type: "integer";
201
+ readonly minimum: 1;
202
+ };
203
+ readonly unit: {
204
+ readonly enum: readonly ["SECONDS", "MINUTES", "HOURS", "DAYS"];
205
+ };
206
+ };
207
+ readonly additionalProperties: true;
208
+ };
209
+ readonly flowNode: {
210
+ readonly type: "object";
211
+ readonly required: readonly ["id", "type", "name", "position"];
212
+ readonly properties: {
213
+ readonly id: {
214
+ readonly type: "string";
215
+ readonly pattern: "^[A-Za-z_][A-Za-z0-9_]*$";
216
+ };
217
+ readonly type: {
218
+ readonly enum: readonly ["START", "END", "APPROVAL", "CONDITION", "SCRIPT", "NOTIFICATION"];
219
+ };
220
+ readonly name: {
221
+ readonly type: "string";
222
+ readonly minLength: 1;
223
+ };
224
+ readonly pageId: {
225
+ readonly type: "integer";
226
+ readonly minimum: 1;
227
+ };
228
+ readonly position: {
229
+ readonly $ref: "#/$defs/position";
230
+ };
231
+ readonly approvalMode: {
232
+ readonly enum: readonly ["SINGLE", "ALL", "ANY"];
233
+ };
234
+ readonly taskMode: {
235
+ readonly enum: readonly ["APPROVAL", "HANDLE"];
236
+ };
237
+ readonly assignee: {
238
+ readonly type: "object";
239
+ readonly required: readonly ["strategy"];
240
+ readonly properties: {
241
+ readonly strategy: {
242
+ readonly enum: readonly ["FIXED", "ROLE"];
243
+ };
244
+ readonly userIds: {
245
+ readonly type: "array";
246
+ readonly minItems: 1;
247
+ readonly items: {
248
+ readonly $ref: "#/$defs/userId";
249
+ };
250
+ };
251
+ readonly roleId: {
252
+ readonly anyOf: readonly [{
253
+ readonly type: "integer";
254
+ readonly minimum: 1;
255
+ }, {
256
+ readonly type: "string";
257
+ readonly pattern: "^[1-9][0-9]*$";
258
+ }];
259
+ };
260
+ };
261
+ readonly additionalProperties: true;
262
+ };
263
+ readonly transferCandidates: {
264
+ readonly type: "object";
265
+ readonly required: readonly ["strategy", "userIds"];
266
+ readonly properties: {
267
+ readonly strategy: {
268
+ readonly const: "FIXED";
269
+ };
270
+ readonly userIds: {
271
+ readonly type: "array";
272
+ readonly minItems: 1;
273
+ readonly items: {
274
+ readonly $ref: "#/$defs/userId";
275
+ };
276
+ };
277
+ };
278
+ readonly additionalProperties: true;
279
+ };
280
+ readonly sequential: {
281
+ readonly type: "boolean";
282
+ };
283
+ readonly result: {
284
+ readonly enum: readonly ["APPROVED", "REJECTED"];
285
+ };
286
+ readonly scriptName: {
287
+ readonly type: "string";
288
+ readonly minLength: 1;
289
+ };
290
+ readonly resultVariable: {
291
+ readonly type: "string";
292
+ readonly pattern: "^[A-Za-z_][A-Za-z0-9_]*$";
293
+ };
294
+ readonly async: {
295
+ readonly type: "object";
296
+ readonly properties: {
297
+ readonly enabled: {
298
+ readonly type: "boolean";
299
+ };
300
+ readonly retryCount: {
301
+ readonly type: "integer";
302
+ readonly minimum: 1;
303
+ readonly maximum: 10;
304
+ };
305
+ readonly retryInterval: {
306
+ readonly $ref: "#/$defs/timeAmount";
307
+ };
308
+ };
309
+ readonly additionalProperties: true;
310
+ };
311
+ readonly timeout: {
312
+ readonly type: "object";
313
+ readonly properties: {
314
+ readonly enabled: {
315
+ readonly type: "boolean";
316
+ };
317
+ readonly duration: {
318
+ readonly $ref: "#/$defs/timeAmount";
319
+ };
320
+ readonly action: {
321
+ readonly enum: readonly ["AUTO_APPROVE", "AUTO_REJECT", "EXECUTE_BFF"];
322
+ };
323
+ readonly interrupting: {
324
+ readonly type: "boolean";
325
+ };
326
+ readonly scriptName: {
327
+ readonly type: "string";
328
+ readonly minLength: 1;
329
+ };
330
+ readonly resultVariable: {
331
+ readonly type: "string";
332
+ readonly pattern: "^[A-Za-z_][A-Za-z0-9_]*$";
333
+ };
334
+ };
335
+ readonly additionalProperties: true;
336
+ };
337
+ readonly cc: {
338
+ readonly type: "object";
339
+ readonly required: readonly ["recipientUserIds"];
340
+ readonly properties: {
341
+ readonly recipientUserIds: {
342
+ readonly type: "array";
343
+ readonly minItems: 1;
344
+ readonly maxItems: 100;
345
+ readonly uniqueItems: true;
346
+ readonly items: {
347
+ readonly type: "string";
348
+ readonly minLength: 1;
349
+ };
350
+ };
351
+ readonly visible: {
352
+ readonly type: "array";
353
+ readonly uniqueItems: true;
354
+ readonly items: {
355
+ readonly type: "string";
356
+ readonly minLength: 1;
357
+ };
358
+ };
359
+ readonly readSources: false;
360
+ };
361
+ readonly additionalProperties: true;
362
+ };
363
+ readonly config: {
364
+ readonly type: "object";
365
+ readonly required: readonly ["configCode", "template"];
366
+ readonly properties: {
367
+ readonly version: {
368
+ readonly enum: readonly ["v1"];
369
+ };
370
+ readonly configCode: {
371
+ readonly type: "string";
372
+ readonly minLength: 1;
373
+ };
374
+ readonly failurePolicy: {
375
+ readonly enum: readonly ["CONTINUE", "FAIL"];
376
+ };
377
+ readonly template: {
378
+ readonly type: "object";
379
+ readonly required: readonly ["title", "summary"];
380
+ readonly properties: {
381
+ readonly title: {
382
+ readonly type: "string";
383
+ readonly minLength: 1;
384
+ };
385
+ readonly summary: {
386
+ readonly type: "string";
387
+ readonly minLength: 1;
388
+ };
389
+ readonly detailMarkdown: {
390
+ readonly type: "string";
391
+ };
392
+ readonly facts: {
393
+ readonly type: "array";
394
+ readonly maxItems: 8;
395
+ readonly items: {
396
+ readonly type: "object";
397
+ readonly required: readonly ["label", "value"];
398
+ readonly properties: {
399
+ readonly label: {
400
+ readonly type: "string";
401
+ readonly minLength: 1;
402
+ };
403
+ readonly value: {
404
+ readonly type: "string";
405
+ readonly minLength: 1;
406
+ };
407
+ };
408
+ readonly additionalProperties: true;
409
+ };
410
+ };
411
+ readonly actions: {
412
+ readonly type: "array";
413
+ readonly maxItems: 2;
414
+ readonly items: {
415
+ readonly type: "object";
416
+ readonly required: readonly ["text", "url"];
417
+ readonly properties: {
418
+ readonly text: {
419
+ readonly type: "string";
420
+ readonly minLength: 1;
421
+ };
422
+ readonly url: {
423
+ readonly type: "string";
424
+ readonly minLength: 1;
425
+ };
426
+ };
427
+ readonly additionalProperties: true;
428
+ };
429
+ };
430
+ };
431
+ readonly additionalProperties: true;
432
+ };
433
+ readonly recipients: {
434
+ readonly type: "array";
435
+ readonly items: {
436
+ readonly type: "object";
437
+ readonly required: readonly ["type", "value"];
438
+ readonly properties: {
439
+ readonly type: {
440
+ readonly enum: readonly ["USER", "ROLE", "EMAIL"];
441
+ };
442
+ readonly value: {
443
+ readonly type: "string";
444
+ readonly minLength: 1;
445
+ };
446
+ readonly role: {
447
+ readonly enum: readonly ["TO", "CC", "BCC"];
448
+ };
449
+ };
450
+ readonly additionalProperties: true;
451
+ };
452
+ };
453
+ };
454
+ readonly additionalProperties: true;
455
+ };
456
+ readonly form: false;
457
+ readonly formPermission: false;
458
+ };
459
+ readonly additionalProperties: true;
460
+ };
461
+ readonly flowEdge: {
462
+ readonly type: "object";
463
+ readonly properties: {
464
+ readonly id: {
465
+ readonly type: "string";
466
+ readonly pattern: "^[A-Za-z_][A-Za-z0-9_]*$";
467
+ };
468
+ readonly source: {
469
+ readonly type: "string";
470
+ readonly minLength: 1;
471
+ };
472
+ readonly target: {
473
+ readonly type: "string";
474
+ readonly minLength: 1;
475
+ };
476
+ readonly sourceNodeId: {
477
+ readonly type: "string";
478
+ readonly minLength: 1;
479
+ };
480
+ readonly targetNodeId: {
481
+ readonly type: "string";
482
+ readonly minLength: 1;
483
+ };
484
+ readonly conditionType: {
485
+ readonly enum: readonly ["ALWAYS", "APPROVED", "REJECTED", "EXPRESSION"];
486
+ };
487
+ readonly expression: {
488
+ readonly type: "string";
489
+ };
490
+ readonly defaultFlow: {
491
+ readonly type: "boolean";
492
+ };
493
+ readonly name: {
494
+ readonly type: "string";
495
+ };
496
+ readonly waypoints: {
497
+ readonly type: "array";
498
+ readonly items: {
499
+ readonly $ref: "#/$defs/position";
500
+ };
501
+ };
502
+ };
503
+ readonly allOf: readonly [{
504
+ readonly anyOf: readonly [{
505
+ readonly required: readonly ["source"];
506
+ }, {
507
+ readonly required: readonly ["sourceNodeId"];
508
+ }];
509
+ }, {
510
+ readonly anyOf: readonly [{
511
+ readonly required: readonly ["target"];
512
+ }, {
513
+ readonly required: readonly ["targetNodeId"];
514
+ }];
515
+ }];
516
+ readonly additionalProperties: true;
517
+ };
518
+ };
519
+ readonly properties: {
520
+ readonly id: false;
521
+ readonly appCode: false;
522
+ readonly flowName: {
523
+ readonly type: "string";
524
+ readonly minLength: 1;
525
+ };
526
+ readonly flowDesc: {
527
+ readonly type: "string";
528
+ };
529
+ readonly flowType: {
530
+ readonly enum: readonly ["FORM_FLOW", "INDEPENDENT_FLOW"];
531
+ };
532
+ readonly datasetCode: {
533
+ readonly type: "string";
534
+ readonly minLength: 1;
535
+ };
536
+ readonly pageId: {
537
+ readonly type: "integer";
538
+ };
539
+ readonly templateName: false;
540
+ readonly flowJson: {
541
+ readonly type: "object";
542
+ readonly required: readonly ["nodes", "edges"];
543
+ readonly properties: {
544
+ readonly flowKey: false;
545
+ readonly flowCode: false;
546
+ readonly flowName: false;
547
+ readonly bindDatasetCode: false;
548
+ readonly datasetCode: false;
549
+ readonly appCode: false;
550
+ readonly pageId: false;
551
+ readonly templateName: false;
552
+ readonly schemaVersion: {
553
+ readonly type: "string";
554
+ readonly const: "approval.simple-flow.v1";
555
+ readonly description: "Accepted as legacy input and removed during normalization; other versions are unsupported.";
556
+ };
557
+ readonly formSchema: false;
558
+ readonly formDefinitions: false;
559
+ readonly formPermissions: false;
560
+ readonly pageMode: {
561
+ readonly const: "CUSTOM_PAGE";
562
+ };
563
+ readonly startPageId: {
564
+ readonly type: "integer";
565
+ readonly minimum: 1;
566
+ };
567
+ readonly nodes: {
568
+ readonly type: "array";
569
+ readonly minItems: 1;
570
+ readonly items: {
571
+ readonly $ref: "#/$defs/flowNode";
572
+ };
573
+ };
574
+ readonly edges: {
575
+ readonly type: "array";
576
+ readonly minItems: 1;
577
+ readonly items: {
578
+ readonly $ref: "#/$defs/flowEdge";
579
+ };
580
+ };
581
+ };
582
+ readonly additionalProperties: true;
583
+ };
584
+ };
585
+ readonly additionalProperties: true;
586
+ };
587
+ /**
588
+ * Normalizes a local flow manifest without mutating the caller's object.
589
+ *
590
+ * Context owned by the outer manifest is removed from `flowJson`; the removed
591
+ * paths are returned as warnings so callers can explicitly review migration.
592
+ *
593
+ * @param input - Parsed JSON value representing a flow manifest.
594
+ * @returns A cloned normalized manifest and migration warnings.
595
+ */
596
+ export declare function normalizeFlowConfig(input: unknown): NormalizedFlowConfig;
597
+ /**
598
+ * Validates a flow manifest using a temporary compiler-shaped context copy.
599
+ *
600
+ * The returned `validationConfig` contains injected `flowKey`, `flowName`,
601
+ * and optional `bindDatasetCode` values for parity with the server compiler.
602
+ * It is intentionally separate from `normalized` and must never be persisted.
603
+ *
604
+ * @param input - Parsed or typed flow manifest.
605
+ * @returns Validation errors, warnings, normalized data, and the in-memory copy.
606
+ */
607
+ export declare function validateFlowConfig(input: unknown): FlowConfigValidationResult;
608
+ /**
609
+ * Reads, validates, and atomically writes a normalized manifest.
610
+ *
611
+ * The temporary file is created beside the target and replaced with `rename`,
612
+ * so readers observe either the old complete file or the new complete file.
613
+ *
614
+ * @param filePath - Target manifest path.
615
+ * @param config - Normalized manifest to persist.
616
+ * @param options - Set overwrite to false to atomically refuse an existing target.
617
+ * @returns A promise that resolves after the atomic replacement completes.
618
+ */
619
+ export declare function writeNormalizedFlowConfig(filePath: string, config: FlowConfig, options?: {
620
+ overwrite?: boolean;
621
+ }): Promise<void>;
622
+ /**
623
+ * Reads a JSON flow manifest from disk.
624
+ *
625
+ * @param filePath - Path to the manifest.
626
+ * @returns The parsed JSON value.
627
+ */
628
+ export declare function readFlowConfigFile(filePath: string): Promise<unknown>;