@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/actions/execution/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { ExecutionHelper } from './execution/types.js';
2
+ export declare const createExecutionHelper: () => ExecutionHelper;
3
+ export declare const executionHelper: ExecutionHelper;
4
+ //# sourceMappingURL=execution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/actions/execution.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,eAAO,MAAM,qBAAqB,QAAO,eAsFxC,CAAA;AAED,eAAO,MAAM,eAAe,iBAA0B,CAAA"}
@@ -0,0 +1,88 @@
1
+ import { cardHelper, DEFAULT_COMMIT_TIMEOUT, PlanningForbidden, TransitionAction, WorkcardKind, } from '@owlmeans/planning';
2
+ import { creatorHelper } from '../executor/creator.js';
3
+ import { makePlanningAccessModel } from '../utils/access.js';
4
+ export const createExecutionHelper = () => {
5
+ const wireExecution = (body, scope) => {
6
+ const { wait: _wait, timeout: _timeout, actor: _actor, ...exec } = body;
7
+ if (exec.action === TransitionAction.Create && exec.card != null && typeof exec.card === 'object') {
8
+ const { createdBy: _createdBy, ...draft } = exec.card;
9
+ exec.card = draft;
10
+ }
11
+ return creatorHelper.withCreator(exec, scope);
12
+ };
13
+ const executeOptionsOf = (body, maxPoll) => {
14
+ const ceiling = maxPoll * 1000;
15
+ if (body.wait !== true) {
16
+ return {};
17
+ }
18
+ const asked = Number(body.timeout ?? DEFAULT_COMMIT_TIMEOUT);
19
+ return { wait: true, timeout: Math.min(Number.isFinite(asked) && asked > 0 ? asked : DEFAULT_COMMIT_TIMEOUT, ceiling) };
20
+ };
21
+ const assertExecutionWrites = async (facade, exec, access) => {
22
+ if (access?.writes == null) {
23
+ return;
24
+ }
25
+ const model = makePlanningAccessModel(access);
26
+ const admitted = async (card, seen = new Set()) => {
27
+ if (model.writableIn(card))
28
+ return true;
29
+ if (card.id != null && seen.has(card.id))
30
+ return false;
31
+ if (card.id != null)
32
+ seen.add(card.id);
33
+ for (const id of card.parents) {
34
+ const parent = await facade.cards.load(id);
35
+ if (parent != null && await admitted(parent, seen))
36
+ return true;
37
+ }
38
+ return false;
39
+ };
40
+ if (exec.action === TransitionAction.Create && exec.card != null && typeof exec.card === 'object') {
41
+ if (exec.card.kind === WorkcardKind.Project) {
42
+ return;
43
+ }
44
+ const parents = cardHelper.normalizeParents(exec.card.parent, exec.card.parents);
45
+ if (parents.length === 0) {
46
+ throw new PlanningForbidden('writes:root');
47
+ }
48
+ for (const id of parents) {
49
+ const parent = await facade.cards.load(id);
50
+ if (parent != null && !await admitted(parent)) {
51
+ throw new PlanningForbidden(`writes:${id}`);
52
+ }
53
+ }
54
+ return;
55
+ }
56
+ for (const id of cardHelper.normalizeParents(exec.changes?.parent, exec.changes?.parents)) {
57
+ const target = await facade.cards.load(id);
58
+ if (target != null && !await admitted(target))
59
+ throw new PlanningForbidden(`writes:destination:${id}`);
60
+ }
61
+ if (typeof exec.card === 'string' && exec.card !== '') {
62
+ const card = await facade.cards.load(exec.card);
63
+ if (card != null && !await admitted(card)) {
64
+ throw new PlanningForbidden(`writes:${exec.card}`);
65
+ }
66
+ }
67
+ };
68
+ const assertExecutionGranted = async (facade, exec, access) => {
69
+ await assertExecutionWrites(facade, exec, access);
70
+ if (access?.grants == null) {
71
+ return;
72
+ }
73
+ const model = makePlanningAccessModel(access);
74
+ if (exec.action === TransitionAction.Create && typeof exec.card === 'object' && exec.card?.kind === WorkcardKind.Project) {
75
+ model.assertGranted('createProjects', cardHelper.normalizeParents(exec.card.parent, exec.card.parents)[0]);
76
+ return;
77
+ }
78
+ if (exec.action === TransitionAction.Delete && typeof exec.card === 'string') {
79
+ const card = await facade.cards.load(exec.card);
80
+ if (card != null && cardHelper.isProject(card)) {
81
+ model.assertGranted('deleteProjects', card.id);
82
+ }
83
+ }
84
+ };
85
+ return { wireExecution, executeOptionsOf, assertExecutionWrites, assertExecutionGranted };
86
+ };
87
+ export const executionHelper = createExecutionHelper();
88
+ //# sourceMappingURL=execution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/actions/execution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,YAAY,GACtF,MA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A;AAC3F,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,qBAAqB,EAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { PlanningProtocols } from '@owlmeans/planning';
2
+ import type { PlanningHandlerOptions } from '../types.js';
3
+ import type { RequestHandler } from './types.js';
4
+ /** @throws {WorkcardNotFound} for an absent card and for another entity's alike */
5
+ export declare const getCard: (protocol: PlanningProtocols['card']['get'], opts?: PlanningHandlerOptions) => RequestHandler;
6
+ //# sourceMappingURL=get-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-card.d.ts","sourceRoot":"","sources":["../../src/actions/get-card.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,mFAAmF;AACnF,eAAO,MAAM,OAAO,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,SAAS,sBAAsB,KAAG,cAK/F,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { guardHelper } from '../utils/guard.js';
3
+ import { planningHandlerOf } from '../utils/handler.js';
4
+ /** @throws {WorkcardNotFound} for an absent card and for another entity's alike */
5
+ export const getCard = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.reply(async () => {
6
+ const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
7
+ return await facade.cards.get(`${req.params.id}`);
8
+ }));
9
+ //# sourceMappingURL=get-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-card.js","sourceRoot":"","sources":["../../src/actions/get-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,mFAAmF;AACnF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,QAA0C,EAAE,IAA6B,EAAkB,EAAE,CACnH,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE;IACrF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAEpE,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;AACnD,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { PlanningProtocols } from '@owlmeans/planning';
2
+ import type { PlanningHandlerOptions } from '../types.js';
3
+ import type { RequestHandler } from './types.js';
4
+ /** @throws {WorkcardNotFound} */
5
+ export declare const getSpecification: (protocol: PlanningProtocols['spec']['get'], opts?: PlanningHandlerOptions) => RequestHandler;
6
+ //# sourceMappingURL=get-specification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-specification.d.ts","sourceRoot":"","sources":["../../src/actions/get-specification.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,iCAAiC;AACjC,eAAO,MAAM,gBAAgB,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,SAAS,sBAAsB,KAAG,cAKxG,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { guardHelper } from '../utils/guard.js';
3
+ import { planningHandlerOf } from '../utils/handler.js';
4
+ /** @throws {WorkcardNotFound} */
5
+ export const getSpecification = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.reply(async () => {
6
+ const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
7
+ return await facade.specifications.get(`${req.params.id}`);
8
+ }));
9
+ //# sourceMappingURL=get-specification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-specification.js","sourceRoot":"","sources":["../../src/actions/get-specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,iCAAiC;AACjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAA0C,EAAE,IAA6B,EAAkB,EAAE,CAC5H,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE;IACrF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAEpE,OAAO,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;AAC5D,CAAC,CAAC,CAAC,CAAA"}
@@ -1,9 +1,18 @@
1
- export * from './cards.js';
1
+ export type * from './execution/types.js';
2
+ export * from './apply-schema-request.js';
2
3
  export * from './commit.js';
4
+ export * from './define-schemas.js';
3
5
  export * from './execute.js';
6
+ export * from './execution.js';
7
+ export * from './get-card.js';
8
+ export * from './get-specification.js';
4
9
  export * from './links.js';
5
- export * from './schemas.js';
6
- export * from './specs.js';
10
+ export * from './list-card-specifications.js';
11
+ export * from './list-card-transitions.js';
12
+ export * from './list-cards.js';
13
+ export * from './list-schemas.js';
14
+ export * from './list-specification-revisions.js';
15
+ export * from './summarize-cards.js';
7
16
  export * from './transitions.js';
8
17
  export * from './watch.js';
9
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,sBAAsB,CAAA;AAEzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,YAAY,CAAA;AAC1B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,mCAAmC,CAAA;AACjD,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA"}
@@ -1,9 +1,17 @@
1
- export * from './cards.js';
1
+ export * from './apply-schema-request.js';
2
2
  export * from './commit.js';
3
+ export * from './define-schemas.js';
3
4
  export * from './execute.js';
5
+ export * from './execution.js';
6
+ export * from './get-card.js';
7
+ export * from './get-specification.js';
4
8
  export * from './links.js';
5
- export * from './schemas.js';
6
- export * from './specs.js';
9
+ export * from './list-card-specifications.js';
10
+ export * from './list-card-transitions.js';
11
+ export * from './list-cards.js';
12
+ export * from './list-schemas.js';
13
+ export * from './list-specification-revisions.js';
14
+ export * from './summarize-cards.js';
7
15
  export * from './transitions.js';
8
16
  export * from './watch.js';
9
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAEA,cAAc,2BAA2B,CAAA;AACzC,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,YAAY,CAAA;AAC1B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,mCAAmC,CAAA;AACjD,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA"}
@@ -1,5 +1,5 @@
1
- import { handlers } from '@owlmeans/server-api';
2
1
  import type { PlanningProtocols } from '@owlmeans/planning';
3
- import type { Context, PlanningHandlerOptions } from '../types.js';
4
- export declare const listLinks: (protocol: PlanningProtocols['link']['list'], opts?: PlanningHandlerOptions) => ReturnType<ReturnType<typeof handlers<Context>>['request']>;
2
+ import type { PlanningHandlerOptions } from '../types.js';
3
+ import type { RequestHandler } from './types.js';
4
+ export declare const listLinks: (protocol: PlanningProtocols['link']['list'], opts?: PlanningHandlerOptions) => RequestHandler;
5
5
  //# sourceMappingURL=links.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../src/actions/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,eAAO,MAAM,SAAS,aACV,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS,sBAAsB,KACzE,UAAU,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAKxD,CAAA"}
1
+ {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../src/actions/links.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,eAAO,MAAM,SAAS,aACV,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS,sBAAsB,KACzE,cAKE,CAAA"}
@@ -1,8 +1,9 @@
1
1
  import { handlers } from '@owlmeans/server-api';
2
- import { decodeRelationshipQuery } from '@owlmeans/planning';
3
- import { concealed, handlerFacade } from '../utils/index.js';
4
- export const listLinks = (protocol, opts) => handlers().request(protocol, async (req, ctx) => concealed(async () => {
5
- const facade = await handlerFacade(ctx, req, opts);
6
- return await facade.relationships.list(decodeRelationshipQuery(req.query));
2
+ import { wireHelper } from '@owlmeans/planning';
3
+ import { guardHelper } from '../utils/guard.js';
4
+ import { planningHandlerOf } from '../utils/handler.js';
5
+ export const listLinks = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.reply(async () => {
6
+ const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
7
+ return await facade.relationships.list(wireHelper.decodeRelationshipQuery(req.query));
7
8
  }));
8
9
  //# sourceMappingURL=links.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"links.js","sourceRoot":"","sources":["../../src/actions/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAG5D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAE5D,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,QAA2C,EAAE,IAA6B,EACb,EAAE,CAC/D,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IAC7E,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAElD,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;AAC5E,CAAC,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"links.js","sourceRoot":"","sources":["../../src/actions/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,QAA2C,EAAE,IAA6B,EAC1D,EAAE,CAClB,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE;IACrF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAEpE,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;AACvF,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { type PlanningProtocols } from '@owlmeans/planning';
2
+ import type { PlanningHandlerOptions } from '../types.js';
3
+ import type { RequestHandler } from './types.js';
4
+ /** One card's specifications — the current document per category unless `all`. */
5
+ export declare const listCardSpecifications: (protocol: PlanningProtocols['card']['specifications'], opts?: PlanningHandlerOptions) => RequestHandler;
6
+ //# sourceMappingURL=list-card-specifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-card-specifications.d.ts","sourceRoot":"","sources":["../../src/actions/list-card-specifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,gBAAgB,CAAC,SAAS,sBAAsB,KAAG,cAMzH,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { wireHelper } from '@owlmeans/planning';
3
+ import { guardHelper } from '../utils/guard.js';
4
+ import { planningHandlerOf } from '../utils/handler.js';
5
+ /** One card's specifications — the current document per category unless `all`. */
6
+ export const listCardSpecifications = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.reply(async () => {
7
+ const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
8
+ const card = await facade.cards.get(`${req.params.id}`);
9
+ return await facade.specifications.list(card.id, wireHelper.decodeSpecificationQuery(req.query));
10
+ }));
11
+ //# sourceMappingURL=list-card-specifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-card-specifications.js","sourceRoot":"","sources":["../../src/actions/list-card-specifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAA0B,MAAM,oBAAoB,CAAA;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,kFAAkF;AAClF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAqD,EAAE,IAA6B,EAAkB,EAAE,CAC7I,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE;IACrF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACpE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;IAEvD,OAAO,MAAM,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAG,EAAE,UAAU,CAAC,wBAAwB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;AACnG,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { type PlanningProtocols } from '@owlmeans/planning';
2
+ import type { PlanningHandlerOptions } from '../types.js';
3
+ import type { RequestHandler } from './types.js';
4
+ /** One card's log. */
5
+ export declare const listCardTransitions: (protocol: PlanningProtocols['card']['transitions'], opts?: PlanningHandlerOptions) => RequestHandler;
6
+ //# sourceMappingURL=list-card-transitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-card-transitions.d.ts","sourceRoot":"","sources":["../../src/actions/list-card-transitions.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,sBAAsB;AACtB,eAAO,MAAM,mBAAmB,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,SAAS,sBAAsB,KAAG,cAMnH,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { wireHelper } from '@owlmeans/planning';
3
+ import { guardHelper } from '../utils/guard.js';
4
+ import { planningHandlerOf } from '../utils/handler.js';
5
+ /** One card's log. */
6
+ export const listCardTransitions = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.reply(async () => {
7
+ const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
8
+ const card = await facade.cards.get(`${req.params.id}`);
9
+ return await facade.transitions.list({ ...wireHelper.decodeTransitionQuery(req.query), card: card.id });
10
+ }));
11
+ //# sourceMappingURL=list-card-transitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-card-transitions.js","sourceRoot":"","sources":["../../src/actions/list-card-transitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAA0B,MAAM,oBAAoB,CAAA;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,sBAAsB;AACtB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAkD,EAAE,IAA6B,EAAkB,EAAE,CACvI,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE;IACrF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACpE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;IAEvD,OAAO,MAAM,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;AACzG,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { type PlanningProtocols } from '@owlmeans/planning';
2
+ import type { PlanningHandlerOptions } from '../types.js';
3
+ import type { RequestHandler } from './types.js';
4
+ /** Cards of the caller's entity; the query arrives in its wire shape and is decoded here. */
5
+ export declare const listCards: (protocol: PlanningProtocols['card']['list'], opts?: PlanningHandlerOptions) => RequestHandler;
6
+ //# sourceMappingURL=list-cards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-cards.d.ts","sourceRoot":"","sources":["../../src/actions/list-cards.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,6FAA6F;AAC7F,eAAO,MAAM,SAAS,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS,sBAAsB,KAAG,cAKlG,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { wireHelper } from '@owlmeans/planning';
3
+ import { guardHelper } from '../utils/guard.js';
4
+ import { planningHandlerOf } from '../utils/handler.js';
5
+ /** Cards of the caller's entity; the query arrives in its wire shape and is decoded here. */
6
+ export const listCards = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.reply(async () => {
7
+ const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
8
+ return await facade.cards.list(wireHelper.decodeWorkcardQuery(req.query));
9
+ }));
10
+ //# sourceMappingURL=list-cards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-cards.js","sourceRoot":"","sources":["../../src/actions/list-cards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAA0B,MAAM,oBAAoB,CAAA;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,6FAA6F;AAC7F,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAA2C,EAAE,IAA6B,EAAkB,EAAE,CACtH,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE;IACrF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAEpE,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;AAC3E,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import type { PlanningProtocols } from '@owlmeans/planning';
2
+ import type { PlanningHandlerOptions } from '../types.js';
3
+ import type { RequestHandler } from './types.js';
4
+ /**
5
+ * The schema bundle — what a client loads to answer `can()` with no round trip. Scoped like every
6
+ * other leaf (no organization, no bundle). Where the store holds data-defined schemas it is the
7
+ * resolved layer of the organization, or of the project the `project` query names (a project this
8
+ * scope can see); otherwise the service's code bundle.
9
+ *
10
+ * @throws {WorkcardNotFound} for a project this scope cannot see
11
+ */
12
+ export declare const listSchemas: (protocol: PlanningProtocols['schema']['list'], opts?: PlanningHandlerOptions) => RequestHandler;
13
+ //# sourceMappingURL=list-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-schemas.d.ts","sourceRoot":"","sources":["../../src/actions/list-schemas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAsB,MAAM,oBAAoB,CAAA;AAC/E,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAKhD;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,aACZ,iBAAiB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,sBAAsB,KAC3E,cAQE,CAAA"}
@@ -0,0 +1,20 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { guardHelper } from '../utils/guard.js';
3
+ import { planningHandlerOf } from '../utils/handler.js';
4
+ const text = (value) => value == null || value === '' ? undefined : `${Array.isArray(value) ? value[0] : value}`;
5
+ /**
6
+ * The schema bundle — what a client loads to answer `can()` with no round trip. Scoped like every
7
+ * other leaf (no organization, no bundle). Where the store holds data-defined schemas it is the
8
+ * resolved layer of the organization, or of the project the `project` query names (a project this
9
+ * scope can see); otherwise the service's code bundle.
10
+ *
11
+ * @throws {WorkcardNotFound} for a project this scope cannot see
12
+ */
13
+ export const listSchemas = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.reply(async () => {
14
+ const { facade } = await planningHandlerOf(ctx).handlerScopeOf(req, opts);
15
+ if (facade.definitions == null) {
16
+ return facade.schemas.bundle();
17
+ }
18
+ return await facade.definitions.bundle(text(req.query?.project));
19
+ }));
20
+ //# sourceMappingURL=list-schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-schemas.js","sourceRoot":"","sources":["../../src/actions/list-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,MAAM,IAAI,GAAG,CAAC,KAAc,EAAsB,EAAE,CAClD,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAA;AAE1F;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,QAA6C,EAAE,IAA6B,EAC5D,EAAE,CAClB,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,IAAiC,EAAE;IAClH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACzE,IAAI,MAAM,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAA;IAChC,CAAC;IAED,OAAO,MAAM,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAE,GAAG,CAAC,KAA2C,EAAE,OAAO,CAAC,CAAC,CAAA;AACzG,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { PlanningProtocols } from '@owlmeans/planning';
2
+ import type { PlanningHandlerOptions } from '../types.js';
3
+ import type { RequestHandler } from './types.js';
4
+ /** A document's history, newest first, replayed from its log. */
5
+ export declare const listSpecificationRevisions: (protocol: PlanningProtocols['spec']['revisions'], opts?: PlanningHandlerOptions) => RequestHandler;
6
+ //# sourceMappingURL=list-specification-revisions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-specification-revisions.d.ts","sourceRoot":"","sources":["../../src/actions/list-specification-revisions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,iEAAiE;AACjE,eAAO,MAAM,0BAA0B,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,sBAAsB,KAAG,cAMxH,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { guardHelper } from '../utils/guard.js';
3
+ import { planningHandlerOf } from '../utils/handler.js';
4
+ /** A document's history, newest first, replayed from its log. */
5
+ export const listSpecificationRevisions = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.reply(async () => {
6
+ const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
7
+ const limit = req.query?.limit == null ? undefined : Number(req.query.limit);
8
+ return { items: await facade.specifications.revisions(`${req.params.id}`, Number.isFinite(limit) ? limit : undefined) };
9
+ }));
10
+ //# sourceMappingURL=list-specification-revisions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-specification-revisions.js","sourceRoot":"","sources":["../../src/actions/list-specification-revisions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,iEAAiE;AACjE,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,QAAgD,EAAE,IAA6B,EAAkB,EAAE,CAC5I,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE;IACrF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACpE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,EAAE,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAE5E,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAA;AACzH,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { PlanningProtocols } from '@owlmeans/planning';
2
+ import type { PlanningHandlerOptions } from '../types.js';
3
+ /** Dispatch the opt-in resources; attribution is taken only from the verified handler scope. */
4
+ export declare const servePlanningResources: (protocols: PlanningProtocols, opts?: PlanningHandlerOptions) => import("@owlmeans/server-entrypoint").ServerProtocolEntrypoint<any>[];
5
+ //# sourceMappingURL=resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/actions/resources.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAA0C,iBAAiB,EAAkD,MAAM,oBAAoB,CAAA;AACnJ,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAMlE,gGAAgG;AAChG,eAAO,MAAM,sBAAsB,cAAe,iBAAiB,SAAS,sBAAsB,0EAmE9F,CAAA"}
@@ -0,0 +1,111 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { bind } from '@owlmeans/server-entrypoint';
3
+ import { FieldsInvalid, PlanningForbidden } from '@owlmeans/planning';
4
+ import { guardHelper } from '../utils/guard.js';
5
+ import { planningHandlerOf } from '../utils/handler.js';
6
+ import { makePlanningAccessModel } from '../utils/access.js';
7
+ import { executionHelper } from './execution.js';
8
+ /** Dispatch the opt-in resources; attribution is taken only from the verified handler scope. */
9
+ export const servePlanningResources = (protocols, opts) => ['assignees', 'teams', 'comments', 'mentions'].flatMap(name => {
10
+ const tree = protocols[name];
11
+ if (tree == null)
12
+ return [];
13
+ return [
14
+ bind(tree.get, handlers().request(tree.get, async (req, ctx) => guardHelper.reply(async () => {
15
+ const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
16
+ return await facade[name].get(req.params.id);
17
+ }))),
18
+ bind(tree.list, handlers().request(tree.list, async (req, ctx) => guardHelper.reply(async () => {
19
+ const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
20
+ let query = {};
21
+ try {
22
+ query = JSON.parse(req.query?.query ?? '{}');
23
+ }
24
+ catch {
25
+ throw new FieldsInvalid('resource:query');
26
+ }
27
+ if (query == null || typeof query !== 'object' || Array.isArray(query))
28
+ throw new FieldsInvalid('resource:query');
29
+ // entityId is never read from the wire; the scoped facade owns it.
30
+ return await facade[name].list(query);
31
+ }))),
32
+ bind(tree.write, handlers().request(tree.write, async (req, ctx) => guardHelper.reply(async () => {
33
+ const { facade, access } = await planningHandlerOf(ctx).handlerScopeOf(req, opts);
34
+ const body = req.body;
35
+ const reading = ['members', 'projects', 'assignees'].includes(body.action);
36
+ const id = () => { if (!body.id)
37
+ throw new FieldsInvalid('resource:id'); return body.id; };
38
+ const version = () => {
39
+ if (!Number.isSafeInteger(body.version) || body.version < 1)
40
+ throw new FieldsInvalid('resource:version');
41
+ return { version: body.version };
42
+ };
43
+ if (!reading && name === 'assignees')
44
+ makePlanningAccessModel(access).assertGranted('manageAssignees');
45
+ if (!reading && name === 'teams')
46
+ makePlanningAccessModel(access).assertGranted('manageTeams');
47
+ if (name === 'comments' || name === 'mentions') {
48
+ const card = body.action === 'create' ? body.draft?.card : (await facade.comments.get(id())).card;
49
+ if (card == null)
50
+ throw new FieldsInvalid('comment:card');
51
+ await executionHelper.assertExecutionWrites(facade, { card, action: 'update' }, access);
52
+ }
53
+ if (name === 'teams' && ['attach', 'detach'].includes(body.action)) {
54
+ if (!body.project)
55
+ throw new FieldsInvalid('team:project');
56
+ await executionHelper.assertExecutionWrites(facade, { card: body.project, action: 'update' }, access);
57
+ }
58
+ switch (name) {
59
+ case 'assignees':
60
+ if (body.action === 'create')
61
+ return await facade.assignees.create(body.draft);
62
+ if (body.action === 'update')
63
+ return await facade.assignees.update(id(), body.draft ?? {}, version());
64
+ if (body.action === 'retire')
65
+ return await facade.assignees.retire(id(), version());
66
+ break;
67
+ case 'teams':
68
+ if (body.action === 'create')
69
+ return await facade.teams.create(body.draft);
70
+ if (body.action === 'update')
71
+ return await facade.teams.update(id(), body.draft ?? {}, version());
72
+ if (body.action === 'remove') {
73
+ await facade.teams.remove(id(), version());
74
+ return null;
75
+ }
76
+ if (body.action === 'members')
77
+ return await facade.teams.members(id());
78
+ if (body.action === 'projects')
79
+ return await facade.teams.projects(id());
80
+ if (body.action === 'assignees')
81
+ return await facade.teams.assignees(id());
82
+ if (body.action === 'addMember' || body.action === 'removeMember') {
83
+ if (!body.assignee)
84
+ throw new FieldsInvalid('team:assignee');
85
+ await facade.teams[body.action](id(), body.assignee);
86
+ return null;
87
+ }
88
+ if (body.action === 'attach' || body.action === 'detach') {
89
+ await facade.teams[body.action](id(), body.project);
90
+ return null;
91
+ }
92
+ break;
93
+ case 'comments':
94
+ if (body.action === 'create')
95
+ return await facade.comments.create(body.draft);
96
+ if (body.action === 'update')
97
+ return await facade.comments.update(id(), { body: body.draft?.body }, version());
98
+ if (body.action === 'remove') {
99
+ await facade.comments.remove(id(), version());
100
+ return null;
101
+ }
102
+ break;
103
+ case 'mentions':
104
+ if (body.action === 'rebuild')
105
+ return await facade.mentions.rebuild(id());
106
+ }
107
+ throw new PlanningForbidden(`resource:action:${name}:${body.action}`);
108
+ }))),
109
+ ];
110
+ });
111
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/actions/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAGrE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,gGAAgG;AAChG,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,SAA4B,EAAE,IAA6B,EAAE,EAAE,CACnG,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,CAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;IACvE,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;IAC5B,IAAI,IAAI,IAAI,IAAI;QAAE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AA"}
@@ -0,0 +1,6 @@
1
+ import { type PlanningProtocols } from '@owlmeans/planning';
2
+ import type { PlanningHandlerOptions } from '../types.js';
3
+ import type { RequestHandler } from './types.js';
4
+ /** Intrinsic counts of DIRECT children per parent. */
5
+ export declare const summarizeCards: (protocol: PlanningProtocols['card']['summary'], opts?: PlanningHandlerOptions) => RequestHandler;
6
+ //# sourceMappingURL=summarize-cards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarize-cards.d.ts","sourceRoot":"","sources":["../../src/actions/summarize-cards.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,KAAK,EAAW,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,sDAAsD;AACtD,eAAO,MAAM,cAAc,aAAc,iBAAiB,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,SAAS,sBAAsB,KAAG,cAM1G,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { wireHelper } from '@owlmeans/planning';
3
+ import { guardHelper } from '../utils/guard.js';
4
+ import { planningHandlerOf } from '../utils/handler.js';
5
+ /** Intrinsic counts of DIRECT children per parent. */
6
+ export const summarizeCards = (protocol, opts) => handlers().request(protocol, async (req, ctx) => guardHelper.reply(async () => {
7
+ const facade = await planningHandlerOf(ctx).handlerFacade(req, opts);
8
+ const { parents, ...query } = wireHelper.decodeSummaryQuery(req.query);
9
+ return await facade.cards.summary(parents, query);
10
+ }));
11
+ //# sourceMappingURL=summarize-cards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarize-cards.js","sourceRoot":"","sources":["../../src/actions/summarize-cards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAA0B,MAAM,oBAAoB,CAAA;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,sDAAsD;AACtD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAA8C,EAAE,IAA6B,EAAkB,EAAE,CAC9H,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE;IACrF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACpE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,UAAU,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAEtE,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;AACnD,CAAC,CAAC,CAAC,CAAA"}