@owlmeans/server-planning 0.1.18-rc.9 → 0.1.18

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 (438) hide show
  1. package/README.md +92 -19
  2. package/agent-meta/manifest.json +105 -4
  3. package/agent-meta/skills/server-planning/SKILL.md +89 -138
  4. package/agent-meta/skills/server-planning/parts/auxiliary.md +54 -0
  5. package/agent-meta/skills/server-planning/parts/executor.md +82 -0
  6. package/agent-meta/skills/server-planning/parts/schemas.md +26 -0
  7. package/agent-meta/skills/server-planning/parts/serving.md +88 -0
  8. package/agent-meta/skills/server-planning/parts/stores.md +91 -0
  9. package/build/actions/apply-schema-request.d.ts +8 -0
  10. package/build/actions/apply-schema-request.d.ts.map +1 -0
  11. package/build/actions/apply-schema-request.js +33 -0
  12. package/build/actions/apply-schema-request.js.map +1 -0
  13. package/build/actions/commit.d.ts +3 -3
  14. package/build/actions/commit.d.ts.map +1 -1
  15. package/build/actions/commit.js +5 -4
  16. package/build/actions/commit.js.map +1 -1
  17. package/build/actions/define-schemas.d.ts +13 -0
  18. package/build/actions/define-schemas.d.ts.map +1 -0
  19. package/build/actions/define-schemas.js +28 -0
  20. package/build/actions/define-schemas.js.map +1 -0
  21. package/build/actions/execute.d.ts +11 -10
  22. package/build/actions/execute.d.ts.map +1 -1
  23. package/build/actions/execute.js +17 -27
  24. package/build/actions/execute.js.map +1 -1
  25. package/build/actions/execution/types.d.ts +34 -0
  26. package/build/actions/execution/types.d.ts.map +1 -0
  27. package/build/actions/execution/types.js +2 -0
  28. package/build/actions/execution/types.js.map +1 -0
  29. package/build/actions/execution.d.ts +4 -0
  30. package/build/actions/execution.d.ts.map +1 -0
  31. package/build/actions/execution.js +88 -0
  32. package/build/actions/execution.js.map +1 -0
  33. package/build/actions/get-card.d.ts +6 -0
  34. package/build/actions/get-card.d.ts.map +1 -0
  35. package/build/actions/get-card.js +9 -0
  36. package/build/actions/get-card.js.map +1 -0
  37. package/build/actions/get-specification.d.ts +6 -0
  38. package/build/actions/get-specification.d.ts.map +1 -0
  39. package/build/actions/get-specification.js +9 -0
  40. package/build/actions/get-specification.js.map +1 -0
  41. package/build/actions/index.d.ts +12 -3
  42. package/build/actions/index.d.ts.map +1 -1
  43. package/build/actions/index.js +11 -3
  44. package/build/actions/index.js.map +1 -1
  45. package/build/actions/links.d.ts +3 -3
  46. package/build/actions/links.d.ts.map +1 -1
  47. package/build/actions/links.js +6 -5
  48. package/build/actions/links.js.map +1 -1
  49. package/build/actions/list-card-specifications.d.ts +6 -0
  50. package/build/actions/list-card-specifications.d.ts.map +1 -0
  51. package/build/actions/list-card-specifications.js +11 -0
  52. package/build/actions/list-card-specifications.js.map +1 -0
  53. package/build/actions/list-card-transitions.d.ts +6 -0
  54. package/build/actions/list-card-transitions.d.ts.map +1 -0
  55. package/build/actions/list-card-transitions.js +11 -0
  56. package/build/actions/list-card-transitions.js.map +1 -0
  57. package/build/actions/list-cards.d.ts +6 -0
  58. package/build/actions/list-cards.d.ts.map +1 -0
  59. package/build/actions/list-cards.js +10 -0
  60. package/build/actions/list-cards.js.map +1 -0
  61. package/build/actions/list-schemas.d.ts +13 -0
  62. package/build/actions/list-schemas.d.ts.map +1 -0
  63. package/build/actions/list-schemas.js +20 -0
  64. package/build/actions/list-schemas.js.map +1 -0
  65. package/build/actions/list-specification-revisions.d.ts +6 -0
  66. package/build/actions/list-specification-revisions.d.ts.map +1 -0
  67. package/build/actions/list-specification-revisions.js +10 -0
  68. package/build/actions/list-specification-revisions.js.map +1 -0
  69. package/build/actions/resources.d.ts +5 -0
  70. package/build/actions/resources.d.ts.map +1 -0
  71. package/build/actions/resources.js +111 -0
  72. package/build/actions/resources.js.map +1 -0
  73. package/build/actions/summarize-cards.d.ts +6 -0
  74. package/build/actions/summarize-cards.d.ts.map +1 -0
  75. package/build/actions/summarize-cards.js +11 -0
  76. package/build/actions/summarize-cards.js.map +1 -0
  77. package/build/actions/transitions.d.ts +3 -3
  78. package/build/actions/transitions.d.ts.map +1 -1
  79. package/build/actions/transitions.js +4 -3
  80. package/build/actions/transitions.js.map +1 -1
  81. package/build/actions/types.d.ts +6 -0
  82. package/build/actions/types.d.ts.map +1 -0
  83. package/build/actions/types.js +2 -0
  84. package/build/actions/types.js.map +1 -0
  85. package/build/actions/watch.d.ts +2 -2
  86. package/build/actions/watch.d.ts.map +1 -1
  87. package/build/actions/watch.js +8 -6
  88. package/build/actions/watch.js.map +1 -1
  89. package/build/conformance/assert/types.d.ts +19 -0
  90. package/build/conformance/assert/types.d.ts.map +1 -0
  91. package/build/conformance/assert/types.js +2 -0
  92. package/build/conformance/assert/types.js.map +1 -0
  93. package/build/conformance/assert.d.ts +15 -0
  94. package/build/conformance/assert.d.ts.map +1 -0
  95. package/build/conformance/assert.js +52 -0
  96. package/build/conformance/assert.js.map +1 -0
  97. package/build/conformance/cases.d.ts +7 -0
  98. package/build/conformance/cases.d.ts.map +1 -0
  99. package/build/conformance/cases.js +544 -0
  100. package/build/conformance/cases.js.map +1 -0
  101. package/build/conformance/clock.d.ts +6 -0
  102. package/build/conformance/clock.d.ts.map +1 -0
  103. package/build/conformance/clock.js +12 -0
  104. package/build/conformance/clock.js.map +1 -0
  105. package/build/conformance/consts.d.ts +30 -0
  106. package/build/conformance/consts.d.ts.map +1 -0
  107. package/build/conformance/consts.js +159 -0
  108. package/build/conformance/consts.js.map +1 -0
  109. package/build/conformance/errors.d.ts +5 -0
  110. package/build/conformance/errors.d.ts.map +1 -0
  111. package/build/conformance/errors.js +8 -0
  112. package/build/conformance/errors.js.map +1 -0
  113. package/build/conformance/fixtures/types.d.ts +13 -0
  114. package/build/conformance/fixtures/types.d.ts.map +1 -0
  115. package/build/conformance/fixtures/types.js +2 -0
  116. package/build/conformance/fixtures/types.js.map +1 -0
  117. package/build/conformance/fixtures.d.ts +14 -0
  118. package/build/conformance/fixtures.d.ts.map +1 -0
  119. package/build/conformance/fixtures.js +26 -0
  120. package/build/conformance/fixtures.js.map +1 -0
  121. package/build/conformance/index.d.ts +15 -0
  122. package/build/conformance/index.d.ts.map +1 -0
  123. package/build/conformance/index.js +12 -0
  124. package/build/conformance/index.js.map +1 -0
  125. package/build/conformance/resources.d.ts +4 -0
  126. package/build/conformance/resources.d.ts.map +1 -0
  127. package/build/conformance/resources.js +228 -0
  128. package/build/conformance/resources.js.map +1 -0
  129. package/build/conformance/types.d.ts +18 -0
  130. package/build/conformance/types.d.ts.map +1 -0
  131. package/build/conformance/types.js +2 -0
  132. package/build/conformance/types.js.map +1 -0
  133. package/build/consts.d.ts +5 -0
  134. package/build/consts.d.ts.map +1 -1
  135. package/build/consts.js +5 -0
  136. package/build/consts.js.map +1 -1
  137. package/build/definitions.d.ts +18 -0
  138. package/build/definitions.d.ts.map +1 -0
  139. package/build/definitions.js +225 -0
  140. package/build/definitions.js.map +1 -0
  141. package/build/executor/changes/types.d.ts +36 -0
  142. package/build/executor/changes/types.d.ts.map +1 -0
  143. package/build/executor/changes/types.js +2 -0
  144. package/build/executor/changes/types.js.map +1 -0
  145. package/build/executor/changes.d.ts +3 -30
  146. package/build/executor/changes.d.ts.map +1 -1
  147. package/build/executor/changes.js +42 -51
  148. package/build/executor/changes.js.map +1 -1
  149. package/build/executor/code/types.d.ts +17 -0
  150. package/build/executor/code/types.d.ts.map +1 -0
  151. package/build/executor/code/types.js +2 -0
  152. package/build/executor/code/types.js.map +1 -0
  153. package/build/executor/code.d.ts +3 -14
  154. package/build/executor/code.d.ts.map +1 -1
  155. package/build/executor/code.js +50 -54
  156. package/build/executor/code.js.map +1 -1
  157. package/build/executor/consts.local.d.ts +5 -0
  158. package/build/executor/consts.local.d.ts.map +1 -0
  159. package/build/executor/consts.local.js +6 -0
  160. package/build/executor/consts.local.js.map +1 -0
  161. package/build/executor/creator/types.d.ts +33 -0
  162. package/build/executor/creator/types.d.ts.map +1 -0
  163. package/build/executor/creator/types.js +2 -0
  164. package/build/executor/creator/types.js.map +1 -0
  165. package/build/executor/creator.d.ts +11 -0
  166. package/build/executor/creator.d.ts.map +1 -0
  167. package/build/executor/creator.js +32 -0
  168. package/build/executor/creator.js.map +1 -0
  169. package/build/executor/resolve/types.d.ts +30 -0
  170. package/build/executor/resolve/types.d.ts.map +1 -0
  171. package/build/executor/resolve/types.js +2 -0
  172. package/build/executor/resolve/types.js.map +1 -0
  173. package/build/executor/resolve.d.ts +5 -34
  174. package/build/executor/resolve.d.ts.map +1 -1
  175. package/build/executor/resolve.js +169 -110
  176. package/build/executor/resolve.js.map +1 -1
  177. package/build/executor/types.d.ts +23 -0
  178. package/build/executor/types.d.ts.map +1 -0
  179. package/build/executor/types.js +2 -0
  180. package/build/executor/types.js.map +1 -0
  181. package/build/executor/validate.d.ts +6 -5
  182. package/build/executor/validate.d.ts.map +1 -1
  183. package/build/executor/validate.js +38 -27
  184. package/build/executor/validate.js.map +1 -1
  185. package/build/executor.d.ts +11 -7
  186. package/build/executor.d.ts.map +1 -1
  187. package/build/executor.js +27 -21
  188. package/build/executor.js.map +1 -1
  189. package/build/facade.d.ts +20 -2
  190. package/build/facade.d.ts.map +1 -1
  191. package/build/facade.js +144 -22
  192. package/build/facade.js.map +1 -1
  193. package/build/helper.d.ts +5 -9
  194. package/build/helper.d.ts.map +1 -1
  195. package/build/helper.js +12 -11
  196. package/build/helper.js.map +1 -1
  197. package/build/hierarchy/types.d.ts +20 -0
  198. package/build/hierarchy/types.d.ts.map +1 -0
  199. package/build/hierarchy/types.js +2 -0
  200. package/build/hierarchy/types.js.map +1 -0
  201. package/build/hierarchy.d.ts +5 -0
  202. package/build/hierarchy.d.ts.map +1 -0
  203. package/build/hierarchy.js +133 -0
  204. package/build/hierarchy.js.map +1 -0
  205. package/build/index.d.ts +1 -0
  206. package/build/index.d.ts.map +1 -1
  207. package/build/index.js +1 -0
  208. package/build/index.js.map +1 -1
  209. package/build/invariants/types.d.ts +6 -0
  210. package/build/invariants/types.d.ts.map +1 -0
  211. package/build/invariants/types.js +2 -0
  212. package/build/invariants/types.js.map +1 -0
  213. package/build/invariants.d.ts +5 -0
  214. package/build/invariants.d.ts.map +1 -0
  215. package/build/invariants.js +126 -0
  216. package/build/invariants.js.map +1 -0
  217. package/build/projection.d.ts +4 -10
  218. package/build/projection.d.ts.map +1 -1
  219. package/build/projection.js +7 -5
  220. package/build/projection.js.map +1 -1
  221. package/build/queue/consts.d.ts +5 -0
  222. package/build/queue/consts.d.ts.map +1 -0
  223. package/build/queue/consts.js +5 -0
  224. package/build/queue/consts.js.map +1 -0
  225. package/build/queue/declare.d.ts +5 -0
  226. package/build/queue/declare.d.ts.map +1 -0
  227. package/build/queue/declare.js +5 -0
  228. package/build/queue/declare.js.map +1 -0
  229. package/build/queue/index.d.ts +3 -18
  230. package/build/queue/index.d.ts.map +1 -1
  231. package/build/queue/index.js +2 -7
  232. package/build/queue/index.js.map +1 -1
  233. package/build/queue/types.d.ts +13 -0
  234. package/build/queue/types.d.ts.map +1 -0
  235. package/build/queue/types.js +2 -0
  236. package/build/queue/types.js.map +1 -0
  237. package/build/registry.d.ts +5 -22
  238. package/build/registry.d.ts.map +1 -1
  239. package/build/registry.js +16 -10
  240. package/build/registry.js.map +1 -1
  241. package/build/resources.d.ts +5 -0
  242. package/build/resources.d.ts.map +1 -0
  243. package/build/resources.js +287 -0
  244. package/build/resources.js.map +1 -0
  245. package/build/service.d.ts +3 -16
  246. package/build/service.d.ts.map +1 -1
  247. package/build/service.js +12 -0
  248. package/build/service.js.map +1 -1
  249. package/build/store/commits.d.ts.map +1 -1
  250. package/build/store/commits.js +3 -1
  251. package/build/store/commits.js.map +1 -1
  252. package/build/store/composite.d.ts +1 -0
  253. package/build/store/composite.d.ts.map +1 -1
  254. package/build/store/composite.js +7 -2
  255. package/build/store/composite.js.map +1 -1
  256. package/build/store/consts.local.d.ts +2 -0
  257. package/build/store/consts.local.d.ts.map +1 -0
  258. package/build/store/consts.local.js +2 -0
  259. package/build/store/consts.local.js.map +1 -0
  260. package/build/store/fold/types.d.ts +43 -0
  261. package/build/store/fold/types.d.ts.map +1 -0
  262. package/build/store/fold/types.js +2 -0
  263. package/build/store/fold/types.js.map +1 -0
  264. package/build/store/fold.d.ts +8 -30
  265. package/build/store/fold.d.ts.map +1 -1
  266. package/build/store/fold.js +190 -198
  267. package/build/store/fold.js.map +1 -1
  268. package/build/store/index.d.ts +1 -0
  269. package/build/store/index.d.ts.map +1 -1
  270. package/build/store/index.js.map +1 -1
  271. package/build/store/memory.d.ts +12 -0
  272. package/build/store/memory.d.ts.map +1 -1
  273. package/build/store/memory.js +0 -0
  274. package/build/store/memory.js.map +1 -1
  275. package/build/store/types.d.ts +15 -1
  276. package/build/store/types.d.ts.map +1 -1
  277. package/build/store/types.local.d.ts +5 -0
  278. package/build/store/types.local.d.ts.map +1 -0
  279. package/build/store/types.local.js +2 -0
  280. package/build/store/types.local.js.map +1 -0
  281. package/build/types.d.ts +126 -2
  282. package/build/types.d.ts.map +1 -1
  283. package/build/types.local.d.ts +7 -0
  284. package/build/types.local.d.ts.map +1 -0
  285. package/build/types.local.js +2 -0
  286. package/build/types.local.js.map +1 -0
  287. package/build/utils/access/types.d.ts +30 -0
  288. package/build/utils/access/types.d.ts.map +1 -0
  289. package/build/utils/access/types.js +2 -0
  290. package/build/utils/access/types.js.map +1 -0
  291. package/build/utils/access.d.ts +4 -0
  292. package/build/utils/access.d.ts.map +1 -0
  293. package/build/utils/access.js +28 -0
  294. package/build/utils/access.js.map +1 -0
  295. package/build/utils/guard/types.d.ts +23 -0
  296. package/build/utils/guard/types.d.ts.map +1 -0
  297. package/build/utils/guard/types.js +2 -0
  298. package/build/utils/guard/types.js.map +1 -0
  299. package/build/utils/guard.d.ts +7 -10
  300. package/build/utils/guard.d.ts.map +1 -1
  301. package/build/utils/guard.js +36 -32
  302. package/build/utils/guard.js.map +1 -1
  303. package/build/utils/handler/types.d.ts +26 -0
  304. package/build/utils/handler/types.d.ts.map +1 -0
  305. package/build/utils/handler/types.js +2 -0
  306. package/build/utils/handler/types.js.map +1 -0
  307. package/build/utils/handler.d.ts +6 -0
  308. package/build/utils/handler.d.ts.map +1 -0
  309. package/build/utils/handler.js +21 -0
  310. package/build/utils/handler.js.map +1 -0
  311. package/build/utils/index.d.ts +8 -0
  312. package/build/utils/index.d.ts.map +1 -1
  313. package/build/utils/index.js +3 -0
  314. package/build/utils/index.js.map +1 -1
  315. package/build/utils/request/types.d.ts +23 -0
  316. package/build/utils/request/types.d.ts.map +1 -0
  317. package/build/utils/request/types.js +2 -0
  318. package/build/utils/request/types.js.map +1 -0
  319. package/build/utils/request.d.ts +4 -0
  320. package/build/utils/request.d.ts.map +1 -0
  321. package/build/utils/request.js +27 -0
  322. package/build/utils/request.js.map +1 -0
  323. package/build/utils/scope.d.ts +17 -13
  324. package/build/utils/scope.d.ts.map +1 -1
  325. package/build/utils/scope.js +21 -35
  326. package/build/utils/scope.js.map +1 -1
  327. package/build/utils/types.d.ts +8 -0
  328. package/build/utils/types.d.ts.map +1 -0
  329. package/build/utils/types.js +2 -0
  330. package/build/utils/types.js.map +1 -0
  331. package/package.json +30 -22
  332. package/src/actions/apply-schema-request.ts +36 -0
  333. package/src/actions/commit.ts +7 -5
  334. package/src/actions/define-schemas.ts +34 -0
  335. package/src/actions/execute.ts +32 -34
  336. package/src/actions/execution/types.ts +34 -0
  337. package/src/actions/execution.ts +100 -0
  338. package/src/actions/get-card.ts +14 -0
  339. package/src/actions/get-specification.ts +14 -0
  340. package/src/actions/index.ts +13 -3
  341. package/src/actions/links.ts +8 -6
  342. package/src/actions/list-card-specifications.ts +15 -0
  343. package/src/actions/list-card-transitions.ts +15 -0
  344. package/src/actions/list-cards.ts +14 -0
  345. package/src/actions/list-schemas.ts +29 -0
  346. package/src/actions/list-specification-revisions.ts +15 -0
  347. package/src/actions/resources.ts +79 -0
  348. package/src/actions/summarize-cards.ts +15 -0
  349. package/src/actions/transitions.ts +6 -4
  350. package/src/actions/types.ts +5 -0
  351. package/src/actions/watch.ts +11 -7
  352. package/src/conformance/assert/types.ts +16 -0
  353. package/src/conformance/assert.ts +67 -0
  354. package/src/conformance/cases.ts +631 -0
  355. package/src/conformance/clock.ts +11 -0
  356. package/src/conformance/consts.ts +165 -0
  357. package/src/conformance/errors.ts +7 -0
  358. package/src/conformance/fixtures/types.ts +11 -0
  359. package/src/conformance/fixtures.ts +46 -0
  360. package/src/conformance/index.ts +14 -0
  361. package/src/conformance/resources.ts +227 -0
  362. package/src/conformance/types.ts +20 -0
  363. package/src/consts.ts +6 -0
  364. package/src/definitions.ts +264 -0
  365. package/src/executor/changes/types.ts +38 -0
  366. package/src/executor/changes.ts +49 -68
  367. package/src/executor/code/types.ts +23 -0
  368. package/src/executor/code.ts +62 -69
  369. package/src/executor/consts.local.ts +8 -0
  370. package/src/executor/creator/types.ts +33 -0
  371. package/src/executor/creator.ts +43 -0
  372. package/src/executor/resolve/types.ts +30 -0
  373. package/src/executor/resolve.ts +181 -139
  374. package/src/executor/types.ts +23 -0
  375. package/src/executor/validate.ts +40 -38
  376. package/src/executor.ts +33 -27
  377. package/src/facade.ts +132 -29
  378. package/src/helper.ts +12 -11
  379. package/src/hierarchy/types.ts +20 -0
  380. package/src/hierarchy.ts +113 -0
  381. package/src/index.ts +1 -0
  382. package/src/invariants/types.ts +6 -0
  383. package/src/invariants.ts +106 -0
  384. package/src/projection.ts +12 -18
  385. package/src/queue/consts.ts +5 -0
  386. package/src/queue/declare.ts +7 -0
  387. package/src/queue/index.ts +3 -25
  388. package/src/queue/types.ts +14 -0
  389. package/src/registry.ts +18 -36
  390. package/src/resources.ts +256 -0
  391. package/src/service.ts +16 -20
  392. package/src/store/commits.ts +5 -4
  393. package/src/store/composite.ts +7 -2
  394. package/src/store/consts.local.ts +1 -0
  395. package/src/store/fold/types.ts +44 -0
  396. package/src/store/fold.ts +214 -212
  397. package/src/store/index.ts +1 -0
  398. package/src/store/memory.ts +0 -0
  399. package/src/store/types.local.ts +3 -0
  400. package/src/store/types.ts +16 -1
  401. package/src/types.local.ts +7 -0
  402. package/src/types.ts +139 -6
  403. package/src/utils/access/types.ts +30 -0
  404. package/src/utils/access.ts +33 -0
  405. package/src/utils/guard/types.ts +21 -0
  406. package/src/utils/guard.ts +44 -31
  407. package/src/utils/handler/types.ts +28 -0
  408. package/src/utils/handler.ts +35 -0
  409. package/src/utils/index.ts +9 -0
  410. package/src/utils/request/types.ts +23 -0
  411. package/src/utils/request.ts +40 -0
  412. package/src/utils/scope.ts +39 -42
  413. package/src/utils/types.ts +8 -0
  414. package/tests/access.spec.ts +160 -0
  415. package/tests/app.spec.ts +112 -0
  416. package/tests/conformance.spec.ts +47 -0
  417. package/tests/create-example.spec.ts +202 -0
  418. package/tests/creator.spec.ts +257 -0
  419. package/tests/entrypoints.spec.ts +5 -0
  420. package/tests/memory-store.spec.ts +52 -0
  421. package/tests/narrowing.spec.ts +94 -0
  422. package/tests/plugins.spec.ts +4 -3
  423. package/tests/writes.spec.ts +140 -0
  424. package/build/actions/cards.d.ts +0 -16
  425. package/build/actions/cards.d.ts.map +0 -1
  426. package/build/actions/cards.js +0 -32
  427. package/build/actions/cards.js.map +0 -1
  428. package/build/actions/schemas.d.ts +0 -6
  429. package/build/actions/schemas.d.ts.map +0 -1
  430. package/build/actions/schemas.js +0 -9
  431. package/build/actions/schemas.js.map +0 -1
  432. package/build/actions/specs.d.ts +0 -10
  433. package/build/actions/specs.d.ts.map +0 -1
  434. package/build/actions/specs.js +0 -14
  435. package/build/actions/specs.js.map +0 -1
  436. package/src/actions/cards.ts +0 -52
  437. package/src/actions/schemas.ts +0 -15
  438. package/src/actions/specs.ts +0 -23
@@ -1,35 +1,6 @@
1
- import { WorkcardKind } from '@owlmeans/planning';
2
- import type { AnyTypeSchema, PlanningFacade, PlanningStore, SpecificationSlot, StatusFlowSchema, TransitionExecution, Workcard } from '@owlmeans/planning';
3
- import type { PlanningRuntime } from '../service.js';
4
- /** Everything the steps after resolution read about an execution. */
5
- export interface Resolved {
6
- create: boolean;
7
- /** The existing card (not a create). */
8
- card?: Workcard;
9
- type: AnyTypeSchema;
10
- flowId: string;
11
- flow: StatusFlowSchema;
12
- /** The primary parent, when it resolves. */
13
- parent?: Workcard;
14
- /** The slot a specification belongs to. */
15
- slot?: SpecificationSlot;
16
- /** The store the type is written to. */
17
- store: PlanningStore;
18
- }
19
- /**
20
- * Step 1: a deep copy with trimmed text, `parents ∋ parent` on a draft, and no duplicate `unset`
21
- * paths. The caller's object is never touched.
22
- */
23
- export declare const normalizeExecution: (input: TransitionExecution) => TransitionExecution;
24
- /** The parent type's rule for a child of `kind`/`type`. @throws {CardTypeNotAllowed} */
25
- export declare const assertChildAllowed: (runtime: PlanningRuntime, parent: Workcard, kind: WorkcardKind, type: string) => void;
26
- /**
27
- * Step 4: the card, its type and flow, its parent and — for a specification — its slot.
28
- *
29
- * @throws {WorkcardNotFound | PlanningScopeMismatch | UnknownWorkcardType | UnknownStatusFlow}
30
- * @throws {ParentNotFound | CardTypeNotAllowed | PlanningError}
31
- */
32
- export declare const resolveExecution: (runtime: PlanningRuntime, facade: PlanningFacade, exec: TransitionExecution) => Promise<Resolved>;
33
- /** The project a transition is filed under: a project's own id, else its parent's project. */
34
- export declare const projectFor: (resolved: Resolved, exec: TransitionExecution, cardId: string) => string | undefined;
1
+ import type { PlanningRuntime } from '../types.js';
2
+ import type { ResolveUtils } from './resolve/types.js';
3
+ export declare const makeResolveUtils: (runtime: PlanningRuntime) => ResolveUtils;
4
+ /** The resolution steps of one service runtime — one per runtime. */
5
+ export declare const resolveUtilsOf: (target: PlanningRuntime) => ResolveUtils;
35
6
  //# sourceMappingURL=resolve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/executor/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAEkE,YAAY,EACpF,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EACV,aAAa,EAAE,cAAc,EAAE,aAAa,EAAoC,iBAAiB,EACjG,gBAAgB,EAAE,mBAAmB,EAAE,QAAQ,EAChD,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD,qEAAqE;AACrE,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,OAAO,CAAA;IACf,wCAAwC;IACxC,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,IAAI,EAAE,aAAa,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,gBAAgB,CAAA;IACtB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,QAAQ,CAAA;IACjB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,iBAAiB,CAAA;IACxB,wCAAwC;IACxC,KAAK,EAAE,aAAa,CAAA;CACrB;AAmBD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UAAW,mBAAmB,KAAG,mBAc/D,CAAA;AAED,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,YACpB,eAAe,UAAU,QAAQ,QAAQ,YAAY,QAAQ,MAAM,KAC3E,IAYF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,YAClB,eAAe,UAAU,cAAc,QAAQ,mBAAmB,KAC1E,OAAO,CAAC,QAAQ,CAyElB,CAAA;AAED,8FAA8F;AAC9F,eAAO,MAAM,UAAU,aAAc,QAAQ,QAAQ,mBAAmB,UAAU,MAAM,KAAG,MAAM,GAAG,SASnG,CAAA"}
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/executor/resolve.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AA6BtD,eAAO,MAAM,gBAAgB,YAAa,eAAe,KAAG,YAiL3D,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,cAAc,2CAAuC,CAAA"}
@@ -1,6 +1,17 @@
1
- import { CardTypeNotAllowed, isProject, normalizeParents, ParentNotFound, PlanningError, PlanningScopeMismatch, primaryFlowOf, projectOf, slotOf, TransitionAction, UnknownStatusFlow, WorkcardKind, WorkcardNotFound, } from '@owlmeans/planning';
1
+ import { cardHelper, CardTypeNotAllowed, ParentNotFound, PlanningError, PlanningSchemaKind, PlanningScopeMismatch, SchemaOrigin, specificationHelper, statusHelper, TransitionAction, UnknownStatusFlow, UnknownWorkcardType, WorkcardKind, WorkcardNotFound } from '@owlmeans/planning';
2
+ import { makePlanningHierarchy } from '../hierarchy.js';
3
+ import { memoHelper } from '@owlmeans/context';
4
+ import { TRIMMED } from './consts.local.js';
5
+ const isScoped = (schemas) => typeof schemas.originOf === 'function';
6
+ /** A type the layer resolves from a data-defined record rather than from code. */
7
+ const dataDefined = (schemas, type) => {
8
+ if (schemas == null || !isScoped(schemas) || !schemas.has(type)) {
9
+ return false;
10
+ }
11
+ const origin = schemas.originOf(PlanningSchemaKind.Type, type);
12
+ return origin === SchemaOrigin.Entity || origin === SchemaOrigin.Project;
13
+ };
2
14
  const trimmed = (value) => typeof value === 'string' ? value.trim() : value;
3
- const TRIMMED = ['title', 'description', 'code'];
4
15
  const trim = (record) => {
5
16
  if (record == null) {
6
17
  return record;
@@ -13,124 +24,172 @@ const trim = (record) => {
13
24
  }
14
25
  return copy;
15
26
  };
16
- /**
17
- * Step 1: a deep copy with trimmed text, `parents ∋ parent` on a draft, and no duplicate `unset`
18
- * paths. The caller's object is never touched.
19
- */
20
- export const normalizeExecution = (input) => {
21
- const exec = structuredClone(input);
22
- if (exec.card != null && typeof exec.card === 'object') {
23
- const draft = trim(exec.card);
24
- const parents = normalizeParents(draft.parent, draft.parents);
25
- exec.card = { ...draft, ...(parents.length > 0 ? { parents, parent: draft.parent ?? parents[0] } : {}) };
26
- }
27
- if (exec.changes != null) {
28
- exec.changes = trim(exec.changes);
29
- }
30
- if (exec.unset != null) {
31
- exec.unset = [...new Set(exec.unset)];
32
- }
33
- return exec;
34
- };
35
- /** The parent type's rule for a child of `kind`/`type`. @throws {CardTypeNotAllowed} */
36
- export const assertChildAllowed = (runtime, parent, kind, type) => {
37
- if (kind === WorkcardKind.Specification) {
38
- return;
39
- }
40
- if (!isProject(parent)) {
41
- throw new CardTypeNotAllowed(`${parent.type}:${type}`);
42
- }
43
- const parentType = runtime.service().schemas.type(parent.type);
44
- const allowed = kind === WorkcardKind.Project ? parentType.projectTypes ?? [] : parentType.cardTypes ?? [];
45
- if (!allowed.includes(type)) {
46
- throw new CardTypeNotAllowed(`${parent.type}:${type}`);
47
- }
48
- };
49
- /**
50
- * Step 4: the card, its type and flow, its parent and — for a specification — its slot.
51
- *
52
- * @throws {WorkcardNotFound | PlanningScopeMismatch | UnknownWorkcardType | UnknownStatusFlow}
53
- * @throws {ParentNotFound | CardTypeNotAllowed | PlanningError}
54
- */
55
- export const resolveExecution = async (runtime, facade, exec) => {
56
- const service = runtime.service();
57
- const schemas = service.schemas;
58
- const entityId = facade.scope.entityId;
59
- const create = exec.action === TransitionAction.Create;
60
- let card;
61
- let type;
62
- let parent;
63
- if (create) {
64
- if (exec.card == null || typeof exec.card !== 'object') {
65
- throw new PlanningError('malformed:create-without-draft');
27
+ export const makeResolveUtils = (runtime) => {
28
+ const hierarchy = makePlanningHierarchy(runtime);
29
+ const normalizeExecution = (input) => {
30
+ const exec = structuredClone(input);
31
+ if (exec.card != null && typeof exec.card === 'object') {
32
+ const draft = trim(exec.card);
33
+ const parents = cardHelper.normalizeParents(draft.parent, draft.parents);
34
+ exec.card = { ...draft, ...(parents.length > 0 ? { parents, parent: draft.parent ?? parents[0] } : {}) };
66
35
  }
67
- const draft = exec.card;
68
- type = schemas.type(draft.type);
69
- if (type.kind !== draft.kind) {
70
- throw new PlanningError(`malformed:kind:${draft.type}:${draft.kind}`);
36
+ if (exec.changes != null) {
37
+ exec.changes = trim(exec.changes);
71
38
  }
72
- // Normalized: the primary parent is first. It must accept the child; so must every project
73
- // among the secondary parents.
74
- for (const [index, id] of normalizeParents(draft.parent, draft.parents).entries()) {
75
- const found = await facade.cards.load(id);
76
- if (found == null) {
77
- throw new ParentNotFound(id);
39
+ if (exec.unset != null) {
40
+ exec.unset = [...new Set(exec.unset)];
41
+ }
42
+ return exec;
43
+ };
44
+ const assertChildAllowed = (parent, kind, type, view) => {
45
+ if (kind === WorkcardKind.Specification) {
46
+ return;
47
+ }
48
+ const registry = view ?? runtime.service().schemas;
49
+ const parentType = registry.type(parent.type);
50
+ const childType = registry.has(type) ? registry.type(type) : undefined;
51
+ if (childType?.parents?.types != null && !childType.parents.types.includes(parent.type))
52
+ throw new CardTypeNotAllowed(`${type}:parent:${parent.type}`);
53
+ if (parentType.children != null) {
54
+ if (!parentType.children.types.includes(type))
55
+ throw new CardTypeNotAllowed(`${parent.type}:${type}`);
56
+ return;
57
+ }
58
+ if (!cardHelper.isProject(parent))
59
+ throw new CardTypeNotAllowed(`${parent.type}:${type}`);
60
+ const allowed = kind === WorkcardKind.Project ? parentType.projectTypes ?? [] : parentType.cardTypes ?? [];
61
+ if (allowed.includes(type)) {
62
+ return;
63
+ }
64
+ if (kind === WorkcardKind.Card && parentType.scopedCardTypes === true && dataDefined(view, type)) {
65
+ return;
66
+ }
67
+ throw new CardTypeNotAllowed(`${parent.type}:${type}`);
68
+ };
69
+ const childViewOf = async (entityId, parent) => runtime.schemaStore() == null ? undefined : await runtime.schemasFor(entityId, await hierarchy.project(parent));
70
+ const resolveExecution = async (facade, exec) => {
71
+ const service = runtime.service();
72
+ const entityId = facade.scope.entityId;
73
+ const create = exec.action === TransitionAction.Create;
74
+ // Without a schema port every step reads the code registry itself, in today's order; with one,
75
+ // the card's project is found first and the step reads that project's resolved layer.
76
+ const layered = runtime.schemaStore() != null;
77
+ let schemas = service.schemas;
78
+ let card;
79
+ let type;
80
+ let parent;
81
+ let project;
82
+ if (create) {
83
+ if (exec.card == null || typeof exec.card !== 'object') {
84
+ throw new PlanningError('malformed:create-without-draft');
85
+ }
86
+ const draft = exec.card;
87
+ const parents = cardHelper.normalizeParents(draft.parent, draft.parents);
88
+ const loaded = new Map();
89
+ if (layered) {
90
+ // Loaded through the facade, so a parent this scope cannot see is absent here too.
91
+ const primary = parents[0] != null ? await facade.cards.load(parents[0]) : null;
92
+ if (parents[0] != null && primary == null) {
93
+ throw new ParentNotFound(parents[0]);
94
+ }
95
+ if (primary != null) {
96
+ loaded.set(parents[0], primary);
97
+ }
98
+ const project = draft.kind === WorkcardKind.Project || primary == null
99
+ ? undefined
100
+ : await hierarchy.project({ kind: draft.kind, entityId, parent: parents[0], parents });
101
+ schemas = await runtime.schemasFor(entityId, project);
102
+ }
103
+ type = schemas.type(draft.type);
104
+ if (type.kind !== draft.kind) {
105
+ throw new PlanningError(`malformed:kind:${draft.type}:${draft.kind}`);
106
+ }
107
+ if (layered && isScoped(schemas) && schemas.isRetired(PlanningSchemaKind.Type, draft.type)) {
108
+ // Existing cards keep resolving a retired type; nothing new is made of it.
109
+ throw new UnknownWorkcardType(`retired:${draft.type}`);
78
110
  }
79
- if (index === 0) {
80
- parent = found;
111
+ // Normalized: the primary parent is first. It must accept the child; so must every project
112
+ // among the secondary parents.
113
+ for (const [index, id] of parents.entries()) {
114
+ const found = loaded.get(id) ?? await facade.cards.load(id);
115
+ if (found == null) {
116
+ throw new ParentNotFound(id);
117
+ }
118
+ if (index === 0) {
119
+ parent = found;
120
+ }
121
+ if (found != null) {
122
+ const view = !layered ? undefined : index === 0 && cardHelper.isProject(found) ? schemas : await childViewOf(entityId, found);
123
+ assertChildAllowed(found, draft.kind, draft.type, view);
124
+ }
81
125
  }
82
- if (index === 0 || isProject(found)) {
83
- assertChildAllowed(runtime, found, draft.kind, draft.type);
126
+ if (draft.kind === WorkcardKind.Specification && parent == null) {
127
+ throw new PlanningError('malformed:specification-without-parent');
84
128
  }
85
129
  }
86
- if (draft.kind === WorkcardKind.Specification && parent == null) {
87
- throw new PlanningError('malformed:specification-without-parent');
130
+ else {
131
+ if (typeof exec.card !== 'string' || exec.card === '') {
132
+ throw new PlanningError(`malformed:${exec.action}-without-card`);
133
+ }
134
+ const found = await runtime.reader().cards.get(exec.card, entityId);
135
+ if (found == null) {
136
+ throw new WorkcardNotFound(exec.card);
137
+ }
138
+ if (found.entityId !== entityId) {
139
+ throw new PlanningScopeMismatch(exec.card);
140
+ }
141
+ if (facade.scope.projects != null && await facade.cards.load(exec.card) == null) {
142
+ // Outside the scope's projects: absent, exactly like another entity's card.
143
+ throw new WorkcardNotFound(exec.card);
144
+ }
145
+ card = found;
146
+ if (layered) {
147
+ parent = card.parent != null ? await facade.cards.load(card.parent) ?? undefined : undefined;
148
+ schemas = await runtime.schemasFor(entityId, await hierarchy.project(card));
149
+ type = schemas.type(card.type);
150
+ }
151
+ else {
152
+ type = schemas.type(card.type);
153
+ parent = card.parent != null ? await facade.cards.load(card.parent) ?? undefined : undefined;
154
+ }
88
155
  }
89
- }
90
- else {
91
- if (typeof exec.card !== 'string' || exec.card === '') {
92
- throw new PlanningError(`malformed:${exec.action}-without-card`);
156
+ project = card != null ? await hierarchy.project(card)
157
+ : exec.card.kind === WorkcardKind.Project ? undefined
158
+ : await hierarchy.project({ ...exec.card, entityId });
159
+ const flowId = exec.flow ?? statusHelper.primaryFlowOf(type);
160
+ if (!type.flows.includes(flowId)) {
161
+ throw new UnknownStatusFlow(`${type.type}:${flowId}`);
93
162
  }
94
- const found = await runtime.reader().cards.get(exec.card, entityId);
95
- if (found == null) {
96
- throw new WorkcardNotFound(exec.card);
163
+ const kind = create ? exec.card.kind : card.kind;
164
+ const category = create ? exec.card.category : card?.category;
165
+ const slot = kind === WorkcardKind.Specification && parent != null && category != null
166
+ ? specificationHelper.slotOf(schemas.type(parent.type), category)
167
+ : undefined;
168
+ return {
169
+ create,
170
+ project,
171
+ ...(card != null ? { card } : {}),
172
+ type,
173
+ flowId,
174
+ flow: schemas.flow(flowId),
175
+ ...(parent != null ? { parent } : {}),
176
+ ...(slot != null ? { slot } : {}),
177
+ store: service.store(type.type),
178
+ schemas,
179
+ };
180
+ };
181
+ const projectFor = (resolved, exec, cardId) => {
182
+ if (resolved.card != null) {
183
+ return cardHelper.isProject(resolved.card) ? resolved.card.id : resolved.project;
97
184
  }
98
- if (found.entityId !== entityId) {
99
- throw new PlanningScopeMismatch(exec.card);
185
+ const draft = exec.card;
186
+ if (draft.kind === WorkcardKind.Project) {
187
+ return cardId;
100
188
  }
101
- card = found;
102
- type = schemas.type(card.type);
103
- parent = card.parent != null ? await facade.cards.load(card.parent) ?? undefined : undefined;
104
- }
105
- const flowId = exec.flow ?? primaryFlowOf(type);
106
- if (!type.flows.includes(flowId)) {
107
- throw new UnknownStatusFlow(`${type.type}:${flowId}`);
108
- }
109
- const kind = create ? exec.card.kind : card.kind;
110
- const category = create ? exec.card.category : card?.category;
111
- const slot = kind === WorkcardKind.Specification && parent != null && category != null
112
- ? slotOf(schemas.type(parent.type), category)
113
- : undefined;
114
- return {
115
- create,
116
- ...(card != null ? { card } : {}),
117
- type,
118
- flowId,
119
- flow: schemas.flow(flowId),
120
- ...(parent != null ? { parent } : {}),
121
- ...(slot != null ? { slot } : {}),
122
- store: service.store(type.type),
189
+ return resolved.project;
123
190
  };
191
+ return { normalizeExecution, assertChildAllowed, childViewOf, resolveExecution, projectFor };
124
192
  };
125
- /** The project a transition is filed under: a project's own id, else its parent's project. */
126
- export const projectFor = (resolved, exec, cardId) => {
127
- if (resolved.card != null) {
128
- return isProject(resolved.card) ? resolved.card.id : projectOf(resolved.card, resolved.parent);
129
- }
130
- const draft = exec.card;
131
- if (draft.kind === WorkcardKind.Project) {
132
- return cardId;
133
- }
134
- return projectOf({ kind: draft.kind, parent: draft.parent, parents: draft.parents ?? [] }, resolved.parent);
135
- };
193
+ /** The resolution steps of one service runtime — one per runtime. */
194
+ export const resolveUtilsOf = memoHelper.oncePer(makeResolveUtils);
136
195
  //# sourceMappingURL=resolve.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/executor/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAAE,SAAS,EAAE,gBAAgB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,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,OAAO,EAAE,CAAC;YACxC,OAAO,MAAM,CAAA;QACf,CAAC;QACD,OAAO,QAAQ,CAAC,OAAO,CAAA;IACzB,CAAC,CAAA;IAED,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAA;AAC9F,CAAC,CAAA;AAED,qEAAqE;AACrE,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA"}
@@ -0,0 +1,23 @@
1
+ import type { AnyTypeSchema, PlanningSchemaRegistry, PlanningStore, SpecificationSlot, StatusFlowSchema, Workcard } from '@owlmeans/planning';
2
+ /** Everything the steps after resolution read about an execution. */
3
+ export interface Resolved {
4
+ project?: string;
5
+ create: boolean;
6
+ /** The existing card (not a create). */
7
+ card?: Workcard;
8
+ type: AnyTypeSchema;
9
+ flowId: string;
10
+ flow: StatusFlowSchema;
11
+ /** The primary parent, when it resolves. */
12
+ parent?: Workcard;
13
+ /** The slot a specification belongs to. */
14
+ slot?: SpecificationSlot;
15
+ /** The store the type is written to. */
16
+ store: PlanningStore;
17
+ /**
18
+ * The registry every later step reads: the service's code registry itself, or — where the store
19
+ * holds data-defined schemas — the resolved layer of the card's project.
20
+ */
21
+ schemas: PlanningSchemaRegistry;
22
+ }
23
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/executor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7I,qEAAqE;AACrE,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,wCAAwC;IACxC,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,IAAI,EAAE,aAAa,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,gBAAgB,CAAA;IACtB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,QAAQ,CAAA;IACjB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,iBAAiB,CAAA;IACxB,wCAAwC;IACxC,KAAK,EAAE,aAAa,CAAA;IACpB;;;OAGG;IACH,OAAO,EAAE,sBAAsB,CAAA;CAChC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/executor/types.ts"],"names":[],"mappings":""}
@@ -1,9 +1,10 @@
1
- import type { PlanningFacade, TransitionExecution } from '@owlmeans/planning';
2
- import type { PlanningRuntime } from '../service.js';
3
- import type { Resolved } from './resolve.js';
1
+ import { type PlanningFacade, type TransitionExecution } from '@owlmeans/planning';
2
+ import type { PlanningRuntime } from '../types.js';
3
+ import type { Resolved } from './types.js';
4
4
  /**
5
- * Step 6: shape, flow rule, immutables, `fields`, labels, parent moves, the specification slot and
6
- * relationships — in that order. Nothing is written by a refusal here.
5
+ * Step 6: shape, flow rule, immutables (`createdBy` among them, `creatorHelper.assertCreatorFixed`),
6
+ * `fields`, labels, parent moves, the specification slot and relationships — in that order.
7
+ * Nothing is written by a refusal here.
7
8
  *
8
9
  * @throws {PlanningError} `malformed:*` / `immutable:*`
9
10
  * @throws {IllegalTransition | FieldsInvalid | LabelNotAllowed | ParentNotFound | CardTypeNotAllowed}
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/executor/validate.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,cAAc,EAAoC,mBAAmB,EACtE,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AA8N5C;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,YACnB,eAAe,UAAU,cAAc,QAAQ,mBAAmB,YAAY,QAAQ,KAC9F,OAAO,CAAC,IAAI,CASd,CAAA"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/executor/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgW,KAAK,cAAc,EAA8C,KAAK,mBAAmB,EAAsB,MAAM,oBAAoB,CAAA;AAChf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAsO1C;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,YACnB,eAAe,UAAU,cAAc,QAAQ,mBAAmB,YAAY,QAAQ,KAC9F,OAAO,CAAC,IAAI,CAUd,CAAA"}
@@ -1,6 +1,7 @@
1
- import { applyUnset, assertMutable, BODY_MAX, CODE_MAX, DESCRIPTION_MAX, IllegalTransition, LabelNotAllowed, MAX_LABELS, MAX_PARENTS, mergeFields, normalizeParents, ParentNotFound, PlanningError, RelationshipRefused, ruleOf, SpecificationRevisionConflict, SpecificationSlotUnknown, slotOf, TITLE_MAX, TransitionAction, validateFields, validateSpecificationBody, WorkcardKind, } from '@owlmeans/planning';
2
- import { assertChildAllowed } from './resolve.js';
3
- const ACTIONS = new Set(Object.values(TransitionAction));
1
+ import { BODY_MAX, cardHelper, changesHelper, CODE_MAX, DESCRIPTION_MAX, IllegalTransition, LabelNotAllowed, MAX_LABELS, MAX_PARENTS, ParentNotFound, PlanningError, RelationshipRefused, specificationHelper, SpecificationRevisionConflict, SpecificationSlotUnknown, statusHelper, TITLE_MAX, TransitionAction, validateHelper, WorkcardKind, PlanningResourceKind } from '@owlmeans/planning';
2
+ import { creatorHelper } from './creator.js';
3
+ import { ACTIONS } from './consts.local.js';
4
+ import { resolveUtilsOf } from './resolve.js';
4
5
  const malformed = (what) => new PlanningError(`malformed:${what}`);
5
6
  const assertText = (name, value, max, required) => {
6
7
  if (value === undefined || value === null) {
@@ -43,10 +44,10 @@ const assertShape = (exec, resolved) => {
43
44
  assertText('description', changes.description ?? undefined, DESCRIPTION_MAX, false);
44
45
  assertText('code', changes.code ?? undefined, CODE_MAX, false);
45
46
  };
46
- const assertFlow = (exec, resolved, runtime) => {
47
+ const assertFlow = (exec, resolved) => {
47
48
  if (resolved.create) {
48
49
  const status = exec.card.status;
49
- const primary = runtime.service().schemas.primaryFlow(resolved.type.type);
50
+ const primary = resolved.schemas.primaryFlow(resolved.type.type);
50
51
  if (status != null && !primary.statuses.some(definition => definition.key === status)) {
51
52
  throw new IllegalTransition(`${primary.id}:create:${status}`);
52
53
  }
@@ -57,23 +58,23 @@ const assertFlow = (exec, resolved, runtime) => {
57
58
  }
58
59
  const card = resolved.card;
59
60
  const from = card.flows[resolved.flowId] ?? card.status;
60
- if (ruleOf(resolved.flow, exec.transition, from) == null) {
61
+ if (statusHelper.ruleOf(resolved.flow, exec.transition, from) == null) {
61
62
  throw new IllegalTransition(`${resolved.flowId}:${exec.transition}:${from}`);
62
63
  }
63
64
  };
64
- const assertFields = (exec, resolved, runtime) => {
65
- const schemas = runtime.service().schemas;
65
+ const assertFields = (exec, resolved) => {
66
+ const schemas = resolved.schemas;
66
67
  if (resolved.create) {
67
68
  const draft = exec.card;
68
- validateFields(schemas, resolved.type.type, mergeFields(draft.fields, exec.changes?.fields));
69
+ validateHelper.validateFields(schemas, resolved.type.type, changesHelper.mergeFields(draft.fields, exec.changes?.fields));
69
70
  return;
70
71
  }
71
72
  const clears = (exec.unset ?? []).filter(path => path.startsWith('fields.'));
72
73
  if (exec.changes?.fields == null && clears.length === 0) {
73
74
  return;
74
75
  }
75
- const merged = applyUnset({ fields: mergeFields(resolved.card.fields, exec.changes?.fields) }, clears);
76
- validateFields(schemas, resolved.type.type, merged.fields);
76
+ const merged = changesHelper.applyUnset({ fields: changesHelper.mergeFields(resolved.card.fields, exec.changes?.fields) }, clears);
77
+ validateHelper.validateFields(schemas, resolved.type.type, merged.fields);
77
78
  };
78
79
  const assertLabels = (exec, resolved) => {
79
80
  const labels = [
@@ -97,7 +98,8 @@ const assertParentMove = async (exec, resolved, runtime, facade) => {
97
98
  return;
98
99
  }
99
100
  const changes = exec.changes ?? {};
100
- const moved = [...new Set(normalizeParents(changes.parent, changes.parents))]
101
+ const resolve = resolveUtilsOf(runtime);
102
+ const moved = [...new Set(cardHelper.normalizeParents(changes.parent, changes.parents))]
101
103
  .filter(id => id !== resolved.card.parent && !resolved.card.parents.includes(id));
102
104
  for (const id of moved) {
103
105
  if (id === resolved.card.id) {
@@ -107,22 +109,22 @@ const assertParentMove = async (exec, resolved, runtime, facade) => {
107
109
  if (found == null) {
108
110
  throw new ParentNotFound(id);
109
111
  }
110
- assertChildAllowed(runtime, found, resolved.card.kind, resolved.card.type);
112
+ resolve.assertChildAllowed(found, resolved.card.kind, resolved.card.type, await resolve.childViewOf(facade.scope.entityId, found));
111
113
  }
112
114
  };
113
- const assertSpecification = async (exec, resolved, runtime, facade) => {
115
+ const assertSpecification = async (exec, resolved, facade) => {
114
116
  const kind = resolved.create ? exec.card.kind : resolved.card.kind;
115
117
  if (kind !== WorkcardKind.Specification) {
116
118
  return;
117
119
  }
118
- const schemas = runtime.service().schemas;
120
+ const schemas = resolved.schemas;
119
121
  if (resolved.create) {
120
122
  const draft = exec.card;
121
123
  const parent = resolved.parent;
122
124
  if (draft.category == null || draft.category === '') {
123
125
  throw malformed('specification-without-category');
124
126
  }
125
- const slot = slotOf(schemas.type(parent.type), draft.category);
127
+ const slot = specificationHelper.slotOf(schemas.type(parent.type), draft.category);
126
128
  if (slot == null) {
127
129
  throw new SpecificationSlotUnknown(`${parent.type}:${draft.category}`);
128
130
  }
@@ -130,7 +132,7 @@ const assertSpecification = async (exec, resolved, runtime, facade) => {
130
132
  throw malformed(`format:${draft.category}:${draft.format}`);
131
133
  }
132
134
  assertText('body', draft.body, BODY_MAX, false);
133
- validateSpecificationBody(slot, draft.body);
135
+ validateHelper.validateSpecificationBody(slot, draft.body);
134
136
  if (slot.multiple !== true && await facade.specifications.current(parent.id, draft.category) != null) {
135
137
  throw new SpecificationRevisionConflict(`${parent.id}:${draft.category}`);
136
138
  }
@@ -150,7 +152,7 @@ const assertSpecification = async (exec, resolved, runtime, facade) => {
150
152
  }
151
153
  if (changes.body != null) {
152
154
  assertText('body', changes.body, BODY_MAX, false);
153
- validateSpecificationBody(slot, changes.body);
155
+ validateHelper.validateSpecificationBody(slot, changes.body);
154
156
  }
155
157
  };
156
158
  const assertRelationships = async (exec, resolved, facade) => {
@@ -178,15 +180,22 @@ const assertRelationships = async (exec, resolved, facade) => {
178
180
  }
179
181
  continue;
180
182
  }
181
- const target = await facade.cards.load(draft.to);
183
+ const kind = rule.toKind ?? PlanningResourceKind.Workcard;
184
+ if (draft.toKind != null && draft.toKind !== kind)
185
+ throw new RelationshipRefused(`to-kind:${draft.type}`);
186
+ if (draft.fromKind != null && draft.fromKind !== PlanningResourceKind.Workcard)
187
+ throw new RelationshipRefused(`from-kind:${draft.type}`);
188
+ draft.toKind = kind;
189
+ const target = kind === PlanningResourceKind.Assignee ? await facade.assignees.load(draft.to)
190
+ : kind === PlanningResourceKind.Team ? await facade.teams.load(draft.to) : await facade.cards.load(draft.to);
182
191
  if (target == null) {
183
192
  throw new RelationshipRefused(`to:${draft.to}`);
184
193
  }
185
194
  if (rule.from != null && !rule.from.includes(resolved.type.type)) {
186
195
  throw new RelationshipRefused(`from-type:${draft.type}:${resolved.type.type}`);
187
196
  }
188
- if (rule.to != null && !rule.to.includes(target.type)) {
189
- throw new RelationshipRefused(`to-type:${draft.type}:${target.type}`);
197
+ if (rule.to != null && !rule.to.includes('type' in target ? target.type : '')) {
198
+ throw new RelationshipRefused(`to-type:${draft.type}:${'type' in target ? target.type : kind}`);
190
199
  }
191
200
  if (rule.single === true) {
192
201
  const count = (counted.get(draft.type) ?? 0) + 1;
@@ -202,8 +211,9 @@ const assertRelationships = async (exec, resolved, facade) => {
202
211
  }
203
212
  };
204
213
  /**
205
- * Step 6: shape, flow rule, immutables, `fields`, labels, parent moves, the specification slot and
206
- * relationships — in that order. Nothing is written by a refusal here.
214
+ * Step 6: shape, flow rule, immutables (`createdBy` among them, `creatorHelper.assertCreatorFixed`),
215
+ * `fields`, labels, parent moves, the specification slot and relationships — in that order.
216
+ * Nothing is written by a refusal here.
207
217
  *
208
218
  * @throws {PlanningError} `malformed:*` / `immutable:*`
209
219
  * @throws {IllegalTransition | FieldsInvalid | LabelNotAllowed | ParentNotFound | CardTypeNotAllowed}
@@ -211,12 +221,13 @@ const assertRelationships = async (exec, resolved, facade) => {
211
221
  */
212
222
  export const validateExecution = async (runtime, facade, exec, resolved) => {
213
223
  assertShape(exec, resolved);
214
- assertFlow(exec, resolved, runtime);
215
- assertMutable(exec, resolved.type);
216
- assertFields(exec, resolved, runtime);
224
+ assertFlow(exec, resolved);
225
+ changesHelper.assertMutable(exec, resolved.type);
226
+ creatorHelper.assertCreatorFixed(exec);
227
+ assertFields(exec, resolved);
217
228
  assertLabels(exec, resolved);
218
229
  await assertParentMove(exec, resolved, runtime, facade);
219
- await assertSpecification(exec, resolved, runtime, facade);
230
+ await assertSpecification(exec, resolved, facade);
220
231
  await assertRelationships(exec, resolved, facade);
221
232
  };
222
233
  //# sourceMappingURL=validate.js.map