@things-factory/worklist 10.1.248 → 10.1.249

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 (696) hide show
  1. package/dist-client/activity-cells.d.ts +21 -0
  2. package/dist-client/activity-cells.js +117 -0
  3. package/dist-client/activity-cells.js.map +1 -0
  4. package/dist-client/activity-state-counts.d.ts +6 -0
  5. package/dist-client/activity-state-counts.js +23 -0
  6. package/dist-client/activity-state-counts.js.map +1 -0
  7. package/dist-client/activity-summary-generator.d.ts +2 -0
  8. package/dist-client/activity-summary-generator.js +155 -0
  9. package/dist-client/activity-summary-generator.js.map +1 -0
  10. package/dist-client/approval-progress.d.ts +18 -0
  11. package/dist-client/approval-progress.js +31 -0
  12. package/dist-client/approval-progress.js.map +1 -0
  13. package/dist-client/bootstrap.d.ts +5 -0
  14. package/dist-client/bootstrap.js +63 -0
  15. package/dist-client/bootstrap.js.map +1 -0
  16. package/dist-client/chip-counts.d.ts +7 -0
  17. package/dist-client/chip-counts.js +11 -0
  18. package/dist-client/chip-counts.js.map +1 -0
  19. package/dist-client/chip-filters.d.ts +60 -0
  20. package/dist-client/chip-filters.js +102 -0
  21. package/dist-client/chip-filters.js.map +1 -0
  22. package/dist-client/components/activity-/bowner-view.d.ts +1 -0
  23. package/dist-client/components/activity-/bowner-view.js +104 -0
  24. package/dist-client/components/activity-/bowner-view.js.map +1 -0
  25. package/dist-client/components/activity-approval-ribon.d.ts +31 -0
  26. package/dist-client/components/activity-approval-ribon.js +103 -0
  27. package/dist-client/components/activity-approval-ribon.js.map +1 -0
  28. package/dist-client/components/activity-fields.d.ts +77 -0
  29. package/dist-client/components/activity-fields.js +424 -0
  30. package/dist-client/components/activity-fields.js.map +1 -0
  31. package/dist-client/components/activity-instance-preview.d.ts +2 -0
  32. package/dist-client/components/activity-instance-preview.js +177 -0
  33. package/dist-client/components/activity-instance-preview.js.map +1 -0
  34. package/dist-client/components/activity-instance-ribon.d.ts +32 -0
  35. package/dist-client/components/activity-instance-ribon.js +91 -0
  36. package/dist-client/components/activity-instance-ribon.js.map +1 -0
  37. package/dist-client/components/activity-intro-view.d.ts +1 -0
  38. package/dist-client/components/activity-intro-view.js +104 -0
  39. package/dist-client/components/activity-intro-view.js.map +1 -0
  40. package/dist-client/components/activity-reporter-view.d.ts +1 -0
  41. package/dist-client/components/activity-reporter-view.js +103 -0
  42. package/dist-client/components/activity-reporter-view.js.map +1 -0
  43. package/dist-client/components/activity-starter-form.d.ts +19 -0
  44. package/dist-client/components/activity-starter-form.js +264 -0
  45. package/dist-client/components/activity-starter-form.js.map +1 -0
  46. package/dist-client/components/activity-thread-ribon.d.ts +38 -0
  47. package/dist-client/components/activity-thread-ribon.js +95 -0
  48. package/dist-client/components/activity-thread-ribon.js.map +1 -0
  49. package/dist-client/components/activity-thread-timeline.d.ts +28 -0
  50. package/dist-client/components/activity-thread-timeline.js +339 -0
  51. package/dist-client/components/activity-thread-timeline.js.map +1 -0
  52. package/dist-client/components/can-pick.d.ts +15 -0
  53. package/dist-client/components/can-pick.js +16 -0
  54. package/dist-client/components/can-pick.js.map +1 -0
  55. package/dist-client/components/decision-content.d.ts +35 -0
  56. package/dist-client/components/decision-content.js +331 -0
  57. package/dist-client/components/decision-content.js.map +1 -0
  58. package/dist-client/components/decision-slots.d.ts +153 -0
  59. package/dist-client/components/decision-slots.js +152 -0
  60. package/dist-client/components/decision-slots.js.map +1 -0
  61. package/dist-client/components/mutation-outcome.d.ts +57 -0
  62. package/dist-client/components/mutation-outcome.js +78 -0
  63. package/dist-client/components/mutation-outcome.js.map +1 -0
  64. package/dist-client/components/say-outcome.d.ts +25 -0
  65. package/dist-client/components/say-outcome.js +51 -0
  66. package/dist-client/components/say-outcome.js.map +1 -0
  67. package/dist-client/components/state-ribon.d.ts +48 -0
  68. package/dist-client/components/state-ribon.js +225 -0
  69. package/dist-client/components/state-ribon.js.map +1 -0
  70. package/dist-client/components/timeline-entries.d.ts +38 -0
  71. package/dist-client/components/timeline-entries.js +62 -0
  72. package/dist-client/components/timeline-entries.js.map +1 -0
  73. package/dist-client/components/work-box-groups.d.ts +25 -0
  74. package/dist-client/components/work-box-groups.js +98 -0
  75. package/dist-client/components/work-box-groups.js.map +1 -0
  76. package/dist-client/due.d.ts +16 -0
  77. package/dist-client/due.js +78 -0
  78. package/dist-client/due.js.map +1 -0
  79. package/dist-client/entity360/person-open-work-section.d.ts +23 -0
  80. package/dist-client/entity360/person-open-work-section.js +79 -0
  81. package/dist-client/entity360/person-open-work-section.js.map +1 -0
  82. package/dist-client/grist-editor/grist-editor-activity-search-key.d.ts +12 -0
  83. package/dist-client/grist-editor/grist-editor-activity-search-key.js +70 -0
  84. package/dist-client/grist-editor/grist-editor-activity-search-key.js.map +1 -0
  85. package/dist-client/grist-editor/grist-renderer-activity-search-key.d.ts +3 -0
  86. package/dist-client/grist-editor/grist-renderer-activity-search-key.js +25 -0
  87. package/dist-client/grist-editor/grist-renderer-activity-search-key.js.map +1 -0
  88. package/dist-client/grist-editor/popup-activity-search-keys-input.d.ts +17 -0
  89. package/dist-client/grist-editor/popup-activity-search-keys-input.js +175 -0
  90. package/dist-client/grist-editor/popup-activity-search-keys-input.js.map +1 -0
  91. package/dist-client/index.d.ts +6 -0
  92. package/dist-client/index.js +7 -0
  93. package/dist-client/index.js.map +1 -0
  94. package/dist-client/my-work-menus.d.ts +90 -0
  95. package/dist-client/my-work-menus.js +20 -0
  96. package/dist-client/my-work-menus.js.map +1 -0
  97. package/dist-client/pages/activity/activity-list-page.d.ts +53 -0
  98. package/dist-client/pages/activity/activity-list-page.js +600 -0
  99. package/dist-client/pages/activity/activity-list-page.js.map +1 -0
  100. package/dist-client/pages/activity/activity-model-item-list.d.ts +24 -0
  101. package/dist-client/pages/activity/activity-model-item-list.js +292 -0
  102. package/dist-client/pages/activity/activity-model-item-list.js.map +1 -0
  103. package/dist-client/pages/activity/activity-page.d.ts +56 -0
  104. package/dist-client/pages/activity/activity-page.js +396 -0
  105. package/dist-client/pages/activity/activity-page.js.map +1 -0
  106. package/dist-client/pages/activity/activity-partial-view.d.ts +13 -0
  107. package/dist-client/pages/activity/activity-partial-view.js +56 -0
  108. package/dist-client/pages/activity/activity-partial-view.js.map +1 -0
  109. package/dist-client/pages/activity/assignee-roles-cell.d.ts +32 -0
  110. package/dist-client/pages/activity/assignee-roles-cell.js +26 -0
  111. package/dist-client/pages/activity/assignee-roles-cell.js.map +1 -0
  112. package/dist-client/pages/activity/starter-list-page.d.ts +31 -0
  113. package/dist-client/pages/activity/starter-list-page.js +172 -0
  114. package/dist-client/pages/activity/starter-list-page.js.map +1 -0
  115. package/dist-client/pages/activity-approval/activity-approval-importer.d.ts +23 -0
  116. package/dist-client/pages/activity-approval/activity-approval-importer.js +94 -0
  117. package/dist-client/pages/activity-approval/activity-approval-importer.js.map +1 -0
  118. package/dist-client/pages/activity-approval/activity-approval-list-page.d.ts +55 -0
  119. package/dist-client/pages/activity-approval/activity-approval-list-page.js +253 -0
  120. package/dist-client/pages/activity-approval/activity-approval-list-page.js.map +1 -0
  121. package/dist-client/pages/activity-approval/activity-approval-page.d.ts +158 -0
  122. package/dist-client/pages/activity-approval/activity-approval-page.js +875 -0
  123. package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -0
  124. package/dist-client/pages/activity-approval/approval-gate.d.ts +29 -0
  125. package/dist-client/pages/activity-approval/approval-gate.js +21 -0
  126. package/dist-client/pages/activity-approval/approval-gate.js.map +1 -0
  127. package/dist-client/pages/activity-catalog/activity-catalog-page.d.ts +31 -0
  128. package/dist-client/pages/activity-catalog/activity-catalog-page.js +420 -0
  129. package/dist-client/pages/activity-catalog/activity-catalog-page.js.map +1 -0
  130. package/dist-client/pages/activity-catalog/activity-detail-actions.d.ts +34 -0
  131. package/dist-client/pages/activity-catalog/activity-detail-actions.js +18 -0
  132. package/dist-client/pages/activity-catalog/activity-detail-actions.js.map +1 -0
  133. package/dist-client/pages/activity-catalog/activity-detail-page.d.ts +90 -0
  134. package/dist-client/pages/activity-catalog/activity-detail-page.js +525 -0
  135. package/dist-client/pages/activity-catalog/activity-detail-page.js.map +1 -0
  136. package/dist-client/pages/activity-catalog/activity-guide.d.ts +16 -0
  137. package/dist-client/pages/activity-catalog/activity-guide.js +5 -0
  138. package/dist-client/pages/activity-catalog/activity-guide.js.map +1 -0
  139. package/dist-client/pages/activity-catalog/activity-panels.d.ts +80 -0
  140. package/dist-client/pages/activity-catalog/activity-panels.js +53 -0
  141. package/dist-client/pages/activity-catalog/activity-panels.js.map +1 -0
  142. package/dist-client/pages/activity-catalog/activity-stage.d.ts +31 -0
  143. package/dist-client/pages/activity-catalog/activity-stage.js +44 -0
  144. package/dist-client/pages/activity-catalog/activity-stage.js.map +1 -0
  145. package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +42 -0
  146. package/dist-client/pages/activity-instance/activity-instance-list-page.js +306 -0
  147. package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -0
  148. package/dist-client/pages/activity-instance/activity-instance-search-page.d.ts +69 -0
  149. package/dist-client/pages/activity-instance/activity-instance-search-page.js +309 -0
  150. package/dist-client/pages/activity-instance/activity-instance-search-page.js.map +1 -0
  151. package/dist-client/pages/activity-instance/activity-instance-start-page.d.ts +54 -0
  152. package/dist-client/pages/activity-instance/activity-instance-start-page.js +557 -0
  153. package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -0
  154. package/dist-client/pages/activity-instance/activity-instance-view.d.ts +36 -0
  155. package/dist-client/pages/activity-instance/activity-instance-view.js +494 -0
  156. package/dist-client/pages/activity-instance/activity-instance-view.js.map +1 -0
  157. package/dist-client/pages/activity-instance/discard-offer.d.ts +11 -0
  158. package/dist-client/pages/activity-instance/discard-offer.js +11 -0
  159. package/dist-client/pages/activity-instance/discard-offer.js.map +1 -0
  160. package/dist-client/pages/activity-stats/activity-stats-importer.d.ts +23 -0
  161. package/dist-client/pages/activity-stats/activity-stats-importer.js +94 -0
  162. package/dist-client/pages/activity-stats/activity-stats-importer.js.map +1 -0
  163. package/dist-client/pages/activity-stats/activity-stats-list-page.d.ts +55 -0
  164. package/dist-client/pages/activity-stats/activity-stats-list-page.js +253 -0
  165. package/dist-client/pages/activity-stats/activity-stats-list-page.js.map +1 -0
  166. package/dist-client/pages/activity-store/activity-store-page.d.ts +41 -0
  167. package/dist-client/pages/activity-store/activity-store-page.js +210 -0
  168. package/dist-client/pages/activity-store/activity-store-page.js.map +1 -0
  169. package/dist-client/pages/activity-supervisor/reporter-list-page.d.ts +30 -0
  170. package/dist-client/pages/activity-supervisor/reporter-list-page.js +190 -0
  171. package/dist-client/pages/activity-supervisor/reporter-list-page.js.map +1 -0
  172. package/dist-client/pages/activity-template/activity-template-importer.d.ts +11 -0
  173. package/dist-client/pages/activity-template/activity-template-importer.js +98 -0
  174. package/dist-client/pages/activity-template/activity-template-importer.js.map +1 -0
  175. package/dist-client/pages/activity-template/activity-template-list-page.d.ts +53 -0
  176. package/dist-client/pages/activity-template/activity-template-list-page.js +377 -0
  177. package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -0
  178. package/dist-client/pages/activity-template/activity-template-model-item-list.d.ts +1 -0
  179. package/dist-client/pages/activity-template/activity-template-model-item-list.js +41 -0
  180. package/dist-client/pages/activity-template/activity-template-model-item-list.js.map +1 -0
  181. package/dist-client/pages/activity-thread/activity-thread-importer.d.ts +11 -0
  182. package/dist-client/pages/activity-thread/activity-thread-importer.js +96 -0
  183. package/dist-client/pages/activity-thread/activity-thread-importer.js.map +1 -0
  184. package/dist-client/pages/activity-thread/activity-thread-list-page.d.ts +52 -0
  185. package/dist-client/pages/activity-thread/activity-thread-list-page.js +248 -0
  186. package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -0
  187. package/dist-client/pages/activity-thread/activity-thread-page.d.ts +91 -0
  188. package/dist-client/pages/activity-thread/activity-thread-page.js +593 -0
  189. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -0
  190. package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +56 -0
  191. package/dist-client/pages/activity-thread/activity-thread-view-page.js +385 -0
  192. package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -0
  193. package/dist-client/pages/activity-thread/activity-thread-view.d.ts +31 -0
  194. package/dist-client/pages/activity-thread/activity-thread-view.js +134 -0
  195. package/dist-client/pages/activity-thread/activity-thread-view.js.map +1 -0
  196. package/dist-client/pages/activity-thread/thread-sections.d.ts +34 -0
  197. package/dist-client/pages/activity-thread/thread-sections.js +36 -0
  198. package/dist-client/pages/activity-thread/thread-sections.js.map +1 -0
  199. package/dist-client/pages/installable-activity/installable-activity-list-page.d.ts +64 -0
  200. package/dist-client/pages/installable-activity/installable-activity-list-page.js +424 -0
  201. package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -0
  202. package/dist-client/pages/installable-activity/installable-activity-model-item-list.d.ts +1 -0
  203. package/dist-client/pages/installable-activity/installable-activity-model-item-list.js +20 -0
  204. package/dist-client/pages/installable-activity/installable-activity-model-item-list.js.map +1 -0
  205. package/dist-client/pages/todo/approval-done-list-page.d.ts +42 -0
  206. package/dist-client/pages/todo/approval-done-list-page.js +365 -0
  207. package/dist-client/pages/todo/approval-done-list-page.js.map +1 -0
  208. package/dist-client/pages/todo/approval-pending-list-page.d.ts +79 -0
  209. package/dist-client/pages/todo/approval-pending-list-page.js +683 -0
  210. package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -0
  211. package/dist-client/pages/todo/done-list-calendar-page.d.ts +47 -0
  212. package/dist-client/pages/todo/done-list-calendar-page.js +379 -0
  213. package/dist-client/pages/todo/done-list-calendar-page.js.map +1 -0
  214. package/dist-client/pages/todo/draft-list-page.d.ts +64 -0
  215. package/dist-client/pages/todo/draft-list-page.js +404 -0
  216. package/dist-client/pages/todo/draft-list-page.js.map +1 -0
  217. package/dist-client/pages/todo/list-thumbnail.d.ts +25 -0
  218. package/dist-client/pages/todo/list-thumbnail.js +25 -0
  219. package/dist-client/pages/todo/list-thumbnail.js.map +1 -0
  220. package/dist-client/pages/todo/pickable-list-page.d.ts +37 -0
  221. package/dist-client/pages/todo/pickable-list-page.js +271 -0
  222. package/dist-client/pages/todo/pickable-list-page.js.map +1 -0
  223. package/dist-client/pages/todo/todo-list-page.d.ts +66 -0
  224. package/dist-client/pages/todo/todo-list-page.js +503 -0
  225. package/dist-client/pages/todo/todo-list-page.js.map +1 -0
  226. package/dist-client/pages/todo/work-box.d.ts +52 -0
  227. package/dist-client/pages/todo/work-box.js +54 -0
  228. package/dist-client/pages/todo/work-box.js.map +1 -0
  229. package/dist-client/pages/work-door/door-links.d.ts +22 -0
  230. package/dist-client/pages/work-door/door-links.js +20 -0
  231. package/dist-client/pages/work-door/door-links.js.map +1 -0
  232. package/dist-client/pages/work-door/door-sentence.d.ts +75 -0
  233. package/dist-client/pages/work-door/door-sentence.js +107 -0
  234. package/dist-client/pages/work-door/door-sentence.js.map +1 -0
  235. package/dist-client/pages/work-door/door-words.d.ts +48 -0
  236. package/dist-client/pages/work-door/door-words.js +84 -0
  237. package/dist-client/pages/work-door/door-words.js.map +1 -0
  238. package/dist-client/route.d.ts +1 -0
  239. package/dist-client/route.js +77 -0
  240. package/dist-client/route.js.map +1 -0
  241. package/dist-client/templates/activity-approval-context-template.d.ts +3 -0
  242. package/dist-client/templates/activity-approval-context-template.js +105 -0
  243. package/dist-client/templates/activity-approval-context-template.js.map +1 -0
  244. package/dist-client/templates/activity-instance-context-template.d.ts +3 -0
  245. package/dist-client/templates/activity-instance-context-template.js +118 -0
  246. package/dist-client/templates/activity-instance-context-template.js.map +1 -0
  247. package/dist-client/templates/activity-thread-context-template.d.ts +3 -0
  248. package/dist-client/templates/activity-thread-context-template.js +74 -0
  249. package/dist-client/templates/activity-thread-context-template.js.map +1 -0
  250. package/dist-client/templates/context-panel.d.ts +26 -0
  251. package/dist-client/templates/context-panel.js +182 -0
  252. package/dist-client/templates/context-panel.js.map +1 -0
  253. package/dist-client/tsconfig.tsbuildinfo +1 -0
  254. package/dist-client/types/activity-approval.d.ts +36 -0
  255. package/dist-client/types/activity-approval.js +17 -0
  256. package/dist-client/types/activity-approval.js.map +1 -0
  257. package/dist-client/types/activity-instance-type.d.ts +77 -0
  258. package/dist-client/types/activity-instance-type.js +11 -0
  259. package/dist-client/types/activity-instance-type.js.map +1 -0
  260. package/dist-client/types/activity-instance.d.ts +72 -0
  261. package/dist-client/types/activity-instance.js +36 -0
  262. package/dist-client/types/activity-instance.js.map +1 -0
  263. package/dist-client/types/activity-model-type.d.ts +31 -0
  264. package/dist-client/types/activity-model-type.js +18 -0
  265. package/dist-client/types/activity-model-type.js.map +1 -0
  266. package/dist-client/types/activity-search-key-item-type.d.ts +6 -0
  267. package/dist-client/types/activity-search-key-item-type.js +3 -0
  268. package/dist-client/types/activity-search-key-item-type.js.map +1 -0
  269. package/dist-client/types/activity-thread-history.d.ts +28 -0
  270. package/dist-client/types/activity-thread-history.js +7 -0
  271. package/dist-client/types/activity-thread-history.js.map +1 -0
  272. package/dist-client/types/activity-thread-type.d.ts +15 -0
  273. package/dist-client/types/activity-thread-type.js +7 -0
  274. package/dist-client/types/activity-thread-type.js.map +1 -0
  275. package/dist-client/types/activity-thread.d.ts +39 -0
  276. package/dist-client/types/activity-thread.js +18 -0
  277. package/dist-client/types/activity-thread.js.map +1 -0
  278. package/dist-client/types/activity.d.ts +68 -0
  279. package/dist-client/types/activity.js +40 -0
  280. package/dist-client/types/activity.js.map +1 -0
  281. package/dist-client/types/types.d.ts +23 -0
  282. package/dist-client/types/types.js +42 -0
  283. package/dist-client/types/types.js.map +1 -0
  284. package/dist-client/when.d.ts +4 -0
  285. package/dist-client/when.js +72 -0
  286. package/dist-client/when.js.map +1 -0
  287. package/dist-client/work-calendar-sources.d.ts +96 -0
  288. package/dist-client/work-calendar-sources.js +88 -0
  289. package/dist-client/work-calendar-sources.js.map +1 -0
  290. package/dist-server/controllers/activity-approval/_abort.d.ts +5 -0
  291. package/dist-server/controllers/activity-approval/_abort.js +29 -0
  292. package/dist-server/controllers/activity-approval/_abort.js.map +1 -0
  293. package/dist-server/controllers/activity-approval/abort.d.ts +5 -0
  294. package/dist-server/controllers/activity-approval/abort.js +35 -0
  295. package/dist-server/controllers/activity-approval/abort.js.map +1 -0
  296. package/dist-server/controllers/activity-approval/approval-line.d.ts +138 -0
  297. package/dist-server/controllers/activity-approval/approval-line.js +186 -0
  298. package/dist-server/controllers/activity-approval/approval-line.js.map +1 -0
  299. package/dist-server/controllers/activity-approval/approve.d.ts +5 -0
  300. package/dist-server/controllers/activity-approval/approve.js +142 -0
  301. package/dist-server/controllers/activity-approval/approve.js.map +1 -0
  302. package/dist-server/controllers/activity-approval/check-authority.d.ts +8 -0
  303. package/dist-server/controllers/activity-approval/check-authority.js +29 -0
  304. package/dist-server/controllers/activity-approval/check-authority.js.map +1 -0
  305. package/dist-server/controllers/activity-approval/claim.d.ts +42 -0
  306. package/dist-server/controllers/activity-approval/claim.js +77 -0
  307. package/dist-server/controllers/activity-approval/claim.js.map +1 -0
  308. package/dist-server/controllers/activity-approval/create-approval.d.ts +41 -0
  309. package/dist-server/controllers/activity-approval/create-approval.js +85 -0
  310. package/dist-server/controllers/activity-approval/create-approval.js.map +1 -0
  311. package/dist-server/controllers/activity-approval/delegate.d.ts +23 -0
  312. package/dist-server/controllers/activity-approval/delegate.js +113 -0
  313. package/dist-server/controllers/activity-approval/delegate.js.map +1 -0
  314. package/dist-server/controllers/activity-approval/delegation.d.ts +21 -0
  315. package/dist-server/controllers/activity-approval/delegation.js +17 -0
  316. package/dist-server/controllers/activity-approval/delegation.js.map +1 -0
  317. package/dist-server/controllers/activity-approval/opinion.d.ts +10 -0
  318. package/dist-server/controllers/activity-approval/opinion.js +43 -0
  319. package/dist-server/controllers/activity-approval/opinion.js.map +1 -0
  320. package/dist-server/controllers/activity-approval/reject.d.ts +5 -0
  321. package/dist-server/controllers/activity-approval/reject.js +93 -0
  322. package/dist-server/controllers/activity-approval/reject.js.map +1 -0
  323. package/dist-server/controllers/activity-approval/resolve-judgeable-seats.d.ts +21 -0
  324. package/dist-server/controllers/activity-approval/resolve-judgeable-seats.js +60 -0
  325. package/dist-server/controllers/activity-approval/resolve-judgeable-seats.js.map +1 -0
  326. package/dist-server/controllers/activity-approval/save.d.ts +5 -0
  327. package/dist-server/controllers/activity-approval/save.js +56 -0
  328. package/dist-server/controllers/activity-approval/save.js.map +1 -0
  329. package/dist-server/controllers/activity-approval/seat-standing.d.ts +66 -0
  330. package/dist-server/controllers/activity-approval/seat-standing.js +57 -0
  331. package/dist-server/controllers/activity-approval/seat-standing.js.map +1 -0
  332. package/dist-server/controllers/activity-installation/activity-installation-controller.d.ts +79 -0
  333. package/dist-server/controllers/activity-installation/activity-installation-controller.js +99 -0
  334. package/dist-server/controllers/activity-installation/activity-installation-controller.js.map +1 -0
  335. package/dist-server/controllers/activity-installation/call-webhook.d.ts +3 -0
  336. package/dist-server/controllers/activity-installation/call-webhook.js +42 -0
  337. package/dist-server/controllers/activity-installation/call-webhook.js.map +1 -0
  338. package/dist-server/controllers/activity-installation/installable-to-activity.d.ts +77 -0
  339. package/dist-server/controllers/activity-installation/installable-to-activity.js +68 -0
  340. package/dist-server/controllers/activity-installation/installable-to-activity.js.map +1 -0
  341. package/dist-server/controllers/activity-installation/registry-conflict.d.ts +47 -0
  342. package/dist-server/controllers/activity-installation/registry-conflict.js +47 -0
  343. package/dist-server/controllers/activity-installation/registry-conflict.js.map +1 -0
  344. package/dist-server/controllers/activity-instance/abort.d.ts +5 -0
  345. package/dist-server/controllers/activity-instance/abort.js +62 -0
  346. package/dist-server/controllers/activity-instance/abort.js.map +1 -0
  347. package/dist-server/controllers/activity-instance/approval-expectation.d.ts +34 -0
  348. package/dist-server/controllers/activity-instance/approval-expectation.js +18 -0
  349. package/dist-server/controllers/activity-instance/approval-expectation.js.map +1 -0
  350. package/dist-server/controllers/activity-instance/approval-line-input.d.ts +29 -0
  351. package/dist-server/controllers/activity-instance/approval-line-input.js +44 -0
  352. package/dist-server/controllers/activity-instance/approval-line-input.js.map +1 -0
  353. package/dist-server/controllers/activity-instance/assign.d.ts +8 -0
  354. package/dist-server/controllers/activity-instance/assign.js +152 -0
  355. package/dist-server/controllers/activity-instance/assign.js.map +1 -0
  356. package/dist-server/controllers/activity-instance/assignee-input.d.ts +25 -0
  357. package/dist-server/controllers/activity-instance/assignee-input.js +28 -0
  358. package/dist-server/controllers/activity-instance/assignee-input.js.map +1 -0
  359. package/dist-server/controllers/activity-instance/claim-draft.d.ts +17 -0
  360. package/dist-server/controllers/activity-instance/claim-draft.js +30 -0
  361. package/dist-server/controllers/activity-instance/claim-draft.js.map +1 -0
  362. package/dist-server/controllers/activity-instance/discard-draft.d.ts +22 -0
  363. package/dist-server/controllers/activity-instance/discard-draft.js +54 -0
  364. package/dist-server/controllers/activity-instance/discard-draft.js.map +1 -0
  365. package/dist-server/controllers/activity-instance/draft.d.ts +3 -0
  366. package/dist-server/controllers/activity-instance/draft.js +93 -0
  367. package/dist-server/controllers/activity-instance/draft.js.map +1 -0
  368. package/dist-server/controllers/activity-instance/end.d.ts +6 -0
  369. package/dist-server/controllers/activity-instance/end.js +65 -0
  370. package/dist-server/controllers/activity-instance/end.js.map +1 -0
  371. package/dist-server/controllers/activity-instance/entitlement.d.ts +25 -0
  372. package/dist-server/controllers/activity-instance/entitlement.js +110 -0
  373. package/dist-server/controllers/activity-instance/entitlement.js.map +1 -0
  374. package/dist-server/controllers/activity-instance/index.d.ts +6 -0
  375. package/dist-server/controllers/activity-instance/index.js +10 -0
  376. package/dist-server/controllers/activity-instance/index.js.map +1 -0
  377. package/dist-server/controllers/activity-instance/issue.d.ts +3 -0
  378. package/dist-server/controllers/activity-instance/issue.js +272 -0
  379. package/dist-server/controllers/activity-instance/issue.js.map +1 -0
  380. package/dist-server/controllers/activity-instance/pick.d.ts +2 -0
  381. package/dist-server/controllers/activity-instance/pick.js +112 -0
  382. package/dist-server/controllers/activity-instance/pick.js.map +1 -0
  383. package/dist-server/controllers/activity-read/assert-may-read.d.ts +20 -0
  384. package/dist-server/controllers/activity-read/assert-may-read.js +108 -0
  385. package/dist-server/controllers/activity-read/assert-may-read.js.map +1 -0
  386. package/dist-server/controllers/activity-read/participates.d.ts +41 -0
  387. package/dist-server/controllers/activity-read/participates.js +42 -0
  388. package/dist-server/controllers/activity-read/participates.js.map +1 -0
  389. package/dist-server/controllers/activity-thread/_abort.d.ts +5 -0
  390. package/dist-server/controllers/activity-thread/_abort.js +36 -0
  391. package/dist-server/controllers/activity-thread/_abort.js.map +1 -0
  392. package/dist-server/controllers/activity-thread/abort.d.ts +5 -0
  393. package/dist-server/controllers/activity-thread/abort.js +45 -0
  394. package/dist-server/controllers/activity-thread/abort.js.map +1 -0
  395. package/dist-server/controllers/activity-thread/check-authority.d.ts +2 -0
  396. package/dist-server/controllers/activity-thread/check-authority.js +65 -0
  397. package/dist-server/controllers/activity-thread/check-authority.js.map +1 -0
  398. package/dist-server/controllers/activity-thread/delegate.d.ts +7 -0
  399. package/dist-server/controllers/activity-thread/delegate.js +66 -0
  400. package/dist-server/controllers/activity-thread/delegate.js.map +1 -0
  401. package/dist-server/controllers/activity-thread/end.d.ts +6 -0
  402. package/dist-server/controllers/activity-thread/end.js +44 -0
  403. package/dist-server/controllers/activity-thread/end.js.map +1 -0
  404. package/dist-server/controllers/activity-thread/index.d.ts +7 -0
  405. package/dist-server/controllers/activity-thread/index.js +11 -0
  406. package/dist-server/controllers/activity-thread/index.js.map +1 -0
  407. package/dist-server/controllers/activity-thread/restart.d.ts +2 -0
  408. package/dist-server/controllers/activity-thread/restart.js +63 -0
  409. package/dist-server/controllers/activity-thread/restart.js.map +1 -0
  410. package/dist-server/controllers/activity-thread/save.d.ts +3 -0
  411. package/dist-server/controllers/activity-thread/save.js +45 -0
  412. package/dist-server/controllers/activity-thread/save.js.map +1 -0
  413. package/dist-server/controllers/activity-thread/start.d.ts +2 -0
  414. package/dist-server/controllers/activity-thread/start.js +43 -0
  415. package/dist-server/controllers/activity-thread/start.js.map +1 -0
  416. package/dist-server/controllers/activity-thread/submit.d.ts +6 -0
  417. package/dist-server/controllers/activity-thread/submit.js +90 -0
  418. package/dist-server/controllers/activity-thread/submit.js.map +1 -0
  419. package/dist-server/controllers/common.d.ts +34 -0
  420. package/dist-server/controllers/common.js +346 -0
  421. package/dist-server/controllers/common.js.map +1 -0
  422. package/dist-server/controllers/index.d.ts +5 -0
  423. package/dist-server/controllers/index.js +18 -0
  424. package/dist-server/controllers/index.js.map +1 -0
  425. package/dist-server/index.d.ts +6 -0
  426. package/dist-server/index.js +18 -0
  427. package/dist-server/index.js.map +1 -0
  428. package/dist-server/role-tasks.d.ts +2 -0
  429. package/dist-server/role-tasks.js +16 -0
  430. package/dist-server/role-tasks.js.map +1 -0
  431. package/dist-server/routes.d.ts +1 -0
  432. package/dist-server/routes.js +57 -0
  433. package/dist-server/routes.js.map +1 -0
  434. package/dist-server/service/activity/activity-decision-key-item-type.d.ts +206 -0
  435. package/dist-server/service/activity/activity-decision-key-item-type.js +182 -0
  436. package/dist-server/service/activity/activity-decision-key-item-type.js.map +1 -0
  437. package/dist-server/service/activity/activity-history.d.ts +44 -0
  438. package/dist-server/service/activity/activity-history.js +220 -0
  439. package/dist-server/service/activity/activity-history.js.map +1 -0
  440. package/dist-server/service/activity/activity-model-type.d.ts +49 -0
  441. package/dist-server/service/activity/activity-model-type.js +138 -0
  442. package/dist-server/service/activity/activity-model-type.js.map +1 -0
  443. package/dist-server/service/activity/activity-mutation.d.ts +12 -0
  444. package/dist-server/service/activity/activity-mutation.js +416 -0
  445. package/dist-server/service/activity/activity-mutation.js.map +1 -0
  446. package/dist-server/service/activity/activity-query.d.ts +24 -0
  447. package/dist-server/service/activity/activity-query.js +310 -0
  448. package/dist-server/service/activity/activity-query.js.map +1 -0
  449. package/dist-server/service/activity/activity-search-key-item-type.d.ts +6 -0
  450. package/dist-server/service/activity/activity-search-key-item-type.js +28 -0
  451. package/dist-server/service/activity/activity-search-key-item-type.js.map +1 -0
  452. package/dist-server/service/activity/activity-type.d.ts +84 -0
  453. package/dist-server/service/activity/activity-type.js +269 -0
  454. package/dist-server/service/activity/activity-type.js.map +1 -0
  455. package/dist-server/service/activity/activity.d.ts +135 -0
  456. package/dist-server/service/activity/activity.js +328 -0
  457. package/dist-server/service/activity/activity.js.map +1 -0
  458. package/dist-server/service/activity/approval-line-seats.d.ts +12 -0
  459. package/dist-server/service/activity/approval-line-seats.js +68 -0
  460. package/dist-server/service/activity/approval-line-seats.js.map +1 -0
  461. package/dist-server/service/activity/credential-field.d.ts +35 -0
  462. package/dist-server/service/activity/credential-field.js +89 -0
  463. package/dist-server/service/activity/credential-field.js.map +1 -0
  464. package/dist-server/service/activity/decision-key-declaration.d.ts +106 -0
  465. package/dist-server/service/activity/decision-key-declaration.js +181 -0
  466. package/dist-server/service/activity/decision-key-declaration.js.map +1 -0
  467. package/dist-server/service/activity/declaration-guard-subscriber.d.ts +24 -0
  468. package/dist-server/service/activity/declaration-guard-subscriber.js +46 -0
  469. package/dist-server/service/activity/declaration-guard-subscriber.js.map +1 -0
  470. package/dist-server/service/activity/event-subscriber.d.ts +7 -0
  471. package/dist-server/service/activity/event-subscriber.js +21 -0
  472. package/dist-server/service/activity/event-subscriber.js.map +1 -0
  473. package/dist-server/service/activity/freeze-decision-sentences-for.d.ts +11 -0
  474. package/dist-server/service/activity/freeze-decision-sentences-for.js +18 -0
  475. package/dist-server/service/activity/freeze-decision-sentences-for.js.map +1 -0
  476. package/dist-server/service/activity/index.d.ts +9 -0
  477. package/dist-server/service/activity/index.js +13 -0
  478. package/dist-server/service/activity/index.js.map +1 -0
  479. package/dist-server/service/activity/search-key-declaration.d.ts +38 -0
  480. package/dist-server/service/activity/search-key-declaration.js +49 -0
  481. package/dist-server/service/activity/search-key-declaration.js.map +1 -0
  482. package/dist-server/service/activity-approval/activity-approval-mutation.d.ts +8 -0
  483. package/dist-server/service/activity-approval/activity-approval-mutation.js +81 -0
  484. package/dist-server/service/activity-approval/activity-approval-mutation.js.map +1 -0
  485. package/dist-server/service/activity-approval/activity-approval-query.d.ts +42 -0
  486. package/dist-server/service/activity-approval/activity-approval-query.js +391 -0
  487. package/dist-server/service/activity-approval/activity-approval-query.js.map +1 -0
  488. package/dist-server/service/activity-approval/activity-approval-subscription.d.ts +6 -0
  489. package/dist-server/service/activity-approval/activity-approval-subscription.js +39 -0
  490. package/dist-server/service/activity-approval/activity-approval-subscription.js.map +1 -0
  491. package/dist-server/service/activity-approval/activity-approval-type.d.ts +10 -0
  492. package/dist-server/service/activity-approval/activity-approval-type.js +39 -0
  493. package/dist-server/service/activity-approval/activity-approval-type.js.map +1 -0
  494. package/dist-server/service/activity-approval/activity-approval.d.ts +67 -0
  495. package/dist-server/service/activity-approval/activity-approval.js +183 -0
  496. package/dist-server/service/activity-approval/activity-approval.js.map +1 -0
  497. package/dist-server/service/activity-approval/event-subscriber.d.ts +7 -0
  498. package/dist-server/service/activity-approval/event-subscriber.js +46 -0
  499. package/dist-server/service/activity-approval/event-subscriber.js.map +1 -0
  500. package/dist-server/service/activity-approval/index.d.ts +8 -0
  501. package/dist-server/service/activity-approval/index.js +12 -0
  502. package/dist-server/service/activity-approval/index.js.map +1 -0
  503. package/dist-server/service/activity-approval/my-pending-approvals.d.ts +33 -0
  504. package/dist-server/service/activity-approval/my-pending-approvals.js +52 -0
  505. package/dist-server/service/activity-approval/my-pending-approvals.js.map +1 -0
  506. package/dist-server/service/activity-instance/activity-instance-history.d.ts +60 -0
  507. package/dist-server/service/activity-instance/activity-instance-history.js +294 -0
  508. package/dist-server/service/activity-instance/activity-instance-history.js.map +1 -0
  509. package/dist-server/service/activity-instance/activity-instance-mutation.d.ts +16 -0
  510. package/dist-server/service/activity-instance/activity-instance-mutation.js +185 -0
  511. package/dist-server/service/activity-instance/activity-instance-mutation.js.map +1 -0
  512. package/dist-server/service/activity-instance/activity-instance-query.d.ts +27 -0
  513. package/dist-server/service/activity-instance/activity-instance-query.js +386 -0
  514. package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -0
  515. package/dist-server/service/activity-instance/activity-instance-subscription.d.ts +6 -0
  516. package/dist-server/service/activity-instance/activity-instance-subscription.js +39 -0
  517. package/dist-server/service/activity-instance/activity-instance-subscription.js.map +1 -0
  518. package/dist-server/service/activity-instance/activity-instance-type.d.ts +107 -0
  519. package/dist-server/service/activity-instance/activity-instance-type.js +301 -0
  520. package/dist-server/service/activity-instance/activity-instance-type.js.map +1 -0
  521. package/dist-server/service/activity-instance/activity-instance.d.ts +81 -0
  522. package/dist-server/service/activity-instance/activity-instance.js +324 -0
  523. package/dist-server/service/activity-instance/activity-instance.js.map +1 -0
  524. package/dist-server/service/activity-instance/assignee-pool.d.ts +59 -0
  525. package/dist-server/service/activity-instance/assignee-pool.js +99 -0
  526. package/dist-server/service/activity-instance/assignee-pool.js.map +1 -0
  527. package/dist-server/service/activity-instance/draft-list-states.d.ts +39 -0
  528. package/dist-server/service/activity-instance/draft-list-states.js +51 -0
  529. package/dist-server/service/activity-instance/draft-list-states.js.map +1 -0
  530. package/dist-server/service/activity-instance/event-subscriber.d.ts +21 -0
  531. package/dist-server/service/activity-instance/event-subscriber.js +59 -0
  532. package/dist-server/service/activity-instance/event-subscriber.js.map +1 -0
  533. package/dist-server/service/activity-instance/index.d.ts +9 -0
  534. package/dist-server/service/activity-instance/index.js +13 -0
  535. package/dist-server/service/activity-instance/index.js.map +1 -0
  536. package/dist-server/service/activity-instance/request-box.d.ts +2 -0
  537. package/dist-server/service/activity-instance/request-box.js +18 -0
  538. package/dist-server/service/activity-instance/request-box.js.map +1 -0
  539. package/dist-server/service/activity-stats/activity-stats-query.d.ts +9 -0
  540. package/dist-server/service/activity-stats/activity-stats-query.js +230 -0
  541. package/dist-server/service/activity-stats/activity-stats-query.js.map +1 -0
  542. package/dist-server/service/activity-stats/activity-stats-type.d.ts +27 -0
  543. package/dist-server/service/activity-stats/activity-stats-type.js +74 -0
  544. package/dist-server/service/activity-stats/activity-stats-type.js.map +1 -0
  545. package/dist-server/service/activity-stats/event-placement.d.ts +55 -0
  546. package/dist-server/service/activity-stats/event-placement.js +82 -0
  547. package/dist-server/service/activity-stats/event-placement.js.map +1 -0
  548. package/dist-server/service/activity-stats/index.d.ts +2 -0
  549. package/dist-server/service/activity-stats/index.js +6 -0
  550. package/dist-server/service/activity-stats/index.js.map +1 -0
  551. package/dist-server/service/activity-summary/activity-summary-query.d.ts +8 -0
  552. package/dist-server/service/activity-summary/activity-summary-query.js +137 -0
  553. package/dist-server/service/activity-summary/activity-summary-query.js.map +1 -0
  554. package/dist-server/service/activity-summary/activity-summary.d.ts +6 -0
  555. package/dist-server/service/activity-summary/activity-summary.js +28 -0
  556. package/dist-server/service/activity-summary/activity-summary.js.map +1 -0
  557. package/dist-server/service/activity-summary/index.d.ts +5 -0
  558. package/dist-server/service/activity-summary/index.js +9 -0
  559. package/dist-server/service/activity-summary/index.js.map +1 -0
  560. package/dist-server/service/activity-summary/open-work.d.ts +4 -0
  561. package/dist-server/service/activity-summary/open-work.js +51 -0
  562. package/dist-server/service/activity-summary/open-work.js.map +1 -0
  563. package/dist-server/service/activity-summary/person-open-work.d.ts +17 -0
  564. package/dist-server/service/activity-summary/person-open-work.js +68 -0
  565. package/dist-server/service/activity-summary/person-open-work.js.map +1 -0
  566. package/dist-server/service/activity-template/activity-template-history.d.ts +32 -0
  567. package/dist-server/service/activity-template/activity-template-history.js +165 -0
  568. package/dist-server/service/activity-template/activity-template-history.js.map +1 -0
  569. package/dist-server/service/activity-template/activity-template-mutation.d.ts +10 -0
  570. package/dist-server/service/activity-template/activity-template-mutation.js +194 -0
  571. package/dist-server/service/activity-template/activity-template-mutation.js.map +1 -0
  572. package/dist-server/service/activity-template/activity-template-query.d.ts +14 -0
  573. package/dist-server/service/activity-template/activity-template-query.js +112 -0
  574. package/dist-server/service/activity-template/activity-template-query.js.map +1 -0
  575. package/dist-server/service/activity-template/activity-template-type.d.ts +44 -0
  576. package/dist-server/service/activity-template/activity-template-type.js +164 -0
  577. package/dist-server/service/activity-template/activity-template-type.js.map +1 -0
  578. package/dist-server/service/activity-template/activity-template.d.ts +36 -0
  579. package/dist-server/service/activity-template/activity-template.js +154 -0
  580. package/dist-server/service/activity-template/activity-template.js.map +1 -0
  581. package/dist-server/service/activity-template/event-subscriber.d.ts +7 -0
  582. package/dist-server/service/activity-template/event-subscriber.js +21 -0
  583. package/dist-server/service/activity-template/event-subscriber.js.map +1 -0
  584. package/dist-server/service/activity-template/index.d.ts +8 -0
  585. package/dist-server/service/activity-template/index.js +12 -0
  586. package/dist-server/service/activity-template/index.js.map +1 -0
  587. package/dist-server/service/activity-thread/activity-thread-history-query.d.ts +10 -0
  588. package/dist-server/service/activity-thread/activity-thread-history-query.js +69 -0
  589. package/dist-server/service/activity-thread/activity-thread-history-query.js.map +1 -0
  590. package/dist-server/service/activity-thread/activity-thread-history.d.ts +39 -0
  591. package/dist-server/service/activity-thread/activity-thread-history.js +211 -0
  592. package/dist-server/service/activity-thread/activity-thread-history.js.map +1 -0
  593. package/dist-server/service/activity-thread/activity-thread-mutation.d.ts +20 -0
  594. package/dist-server/service/activity-thread/activity-thread-mutation.js +115 -0
  595. package/dist-server/service/activity-thread/activity-thread-mutation.js.map +1 -0
  596. package/dist-server/service/activity-thread/activity-thread-query.d.ts +24 -0
  597. package/dist-server/service/activity-thread/activity-thread-query.js +276 -0
  598. package/dist-server/service/activity-thread/activity-thread-query.js.map +1 -0
  599. package/dist-server/service/activity-thread/activity-thread-subscription.d.ts +6 -0
  600. package/dist-server/service/activity-thread/activity-thread-subscription.js +38 -0
  601. package/dist-server/service/activity-thread/activity-thread-subscription.js.map +1 -0
  602. package/dist-server/service/activity-thread/activity-thread-type.d.ts +15 -0
  603. package/dist-server/service/activity-thread/activity-thread-type.js +50 -0
  604. package/dist-server/service/activity-thread/activity-thread-type.js.map +1 -0
  605. package/dist-server/service/activity-thread/activity-thread.d.ts +47 -0
  606. package/dist-server/service/activity-thread/activity-thread.js +197 -0
  607. package/dist-server/service/activity-thread/activity-thread.js.map +1 -0
  608. package/dist-server/service/activity-thread/event-subscriber.d.ts +13 -0
  609. package/dist-server/service/activity-thread/event-subscriber.js +45 -0
  610. package/dist-server/service/activity-thread/event-subscriber.js.map +1 -0
  611. package/dist-server/service/activity-thread/index.d.ts +10 -0
  612. package/dist-server/service/activity-thread/index.js +14 -0
  613. package/dist-server/service/activity-thread/index.js.map +1 -0
  614. package/dist-server/service/activity-thread/my-open-threads.d.ts +33 -0
  615. package/dist-server/service/activity-thread/my-open-threads.js +85 -0
  616. package/dist-server/service/activity-thread/my-open-threads.js.map +1 -0
  617. package/dist-server/service/activity-thread/todo-order.d.ts +49 -0
  618. package/dist-server/service/activity-thread/todo-order.js +70 -0
  619. package/dist-server/service/activity-thread/todo-order.js.map +1 -0
  620. package/dist-server/service/approval-notice/approval-notice-rules.d.ts +67 -0
  621. package/dist-server/service/approval-notice/approval-notice-rules.js +67 -0
  622. package/dist-server/service/approval-notice/approval-notice-rules.js.map +1 -0
  623. package/dist-server/service/approval-notice/approval-notice.d.ts +11 -0
  624. package/dist-server/service/approval-notice/approval-notice.js +76 -0
  625. package/dist-server/service/approval-notice/approval-notice.js.map +1 -0
  626. package/dist-server/service/index.d.ts +23 -0
  627. package/dist-server/service/index.js +75 -0
  628. package/dist-server/service/index.js.map +1 -0
  629. package/dist-server/service/installable-activity/activity-readiness.d.ts +58 -0
  630. package/dist-server/service/installable-activity/activity-readiness.js +105 -0
  631. package/dist-server/service/installable-activity/activity-readiness.js.map +1 -0
  632. package/dist-server/service/installable-activity/index.d.ts +6 -0
  633. package/dist-server/service/installable-activity/index.js +10 -0
  634. package/dist-server/service/installable-activity/index.js.map +1 -0
  635. package/dist-server/service/installable-activity/installable-activity-mutation.d.ts +11 -0
  636. package/dist-server/service/installable-activity/installable-activity-mutation.js +83 -0
  637. package/dist-server/service/installable-activity/installable-activity-mutation.js.map +1 -0
  638. package/dist-server/service/installable-activity/installable-activity-query.d.ts +22 -0
  639. package/dist-server/service/installable-activity/installable-activity-query.js +127 -0
  640. package/dist-server/service/installable-activity/installable-activity-query.js.map +1 -0
  641. package/dist-server/service/installable-activity/installable-activity-type.d.ts +5 -0
  642. package/dist-server/service/installable-activity/installable-activity-type.js +21 -0
  643. package/dist-server/service/installable-activity/installable-activity-type.js.map +1 -0
  644. package/dist-server/service/installable-activity/installable-activity.d.ts +92 -0
  645. package/dist-server/service/installable-activity/installable-activity.js +140 -0
  646. package/dist-server/service/installable-activity/installable-activity.js.map +1 -0
  647. package/dist-server/service/nulls-last.d.ts +30 -0
  648. package/dist-server/service/nulls-last.js +37 -0
  649. package/dist-server/service/nulls-last.js.map +1 -0
  650. package/dist-server/service/subscription/roles-of.d.ts +9 -0
  651. package/dist-server/service/subscription/roles-of.js +17 -0
  652. package/dist-server/service/subscription/roles-of.js.map +1 -0
  653. package/dist-server/service/subscription/subscription-filters.d.ts +47 -0
  654. package/dist-server/service/subscription/subscription-filters.js +57 -0
  655. package/dist-server/service/subscription/subscription-filters.js.map +1 -0
  656. package/dist-server/service/work-door/activity-lookup.d.ts +70 -0
  657. package/dist-server/service/work-door/activity-lookup.js +110 -0
  658. package/dist-server/service/work-door/activity-lookup.js.map +1 -0
  659. package/dist-server/service/work-door/approval-line-standing.d.ts +106 -0
  660. package/dist-server/service/work-door/approval-line-standing.js +65 -0
  661. package/dist-server/service/work-door/approval-line-standing.js.map +1 -0
  662. package/dist-server/service/work-door/index.d.ts +15 -0
  663. package/dist-server/service/work-door/index.js +20 -0
  664. package/dist-server/service/work-door/index.js.map +1 -0
  665. package/dist-server/service/work-door/pass-work-door.d.ts +74 -0
  666. package/dist-server/service/work-door/pass-work-door.js +45 -0
  667. package/dist-server/service/work-door/pass-work-door.js.map +1 -0
  668. package/dist-server/service/work-door/work-door-declaration.d.ts +135 -0
  669. package/dist-server/service/work-door/work-door-declaration.js +87 -0
  670. package/dist-server/service/work-door/work-door-declaration.js.map +1 -0
  671. package/dist-server/service/work-door/work-door-event.d.ts +20 -0
  672. package/dist-server/service/work-door/work-door-event.js +25 -0
  673. package/dist-server/service/work-door/work-door-event.js.map +1 -0
  674. package/dist-server/service/work-door/work-door-journal-service.d.ts +47 -0
  675. package/dist-server/service/work-door/work-door-journal-service.js +75 -0
  676. package/dist-server/service/work-door/work-door-journal-service.js.map +1 -0
  677. package/dist-server/service/work-door/work-door-journal.d.ts +30 -0
  678. package/dist-server/service/work-door/work-door-journal.js +94 -0
  679. package/dist-server/service/work-door/work-door-journal.js.map +1 -0
  680. package/dist-server/service/work-door/work-door-not-used.d.ts +39 -0
  681. package/dist-server/service/work-door/work-door-not-used.js +86 -0
  682. package/dist-server/service/work-door/work-door-not-used.js.map +1 -0
  683. package/dist-server/service/work-door/work-door-resolver.d.ts +32 -0
  684. package/dist-server/service/work-door/work-door-resolver.js +152 -0
  685. package/dist-server/service/work-door/work-door-resolver.js.map +1 -0
  686. package/dist-server/service/work-door/work-door-service.d.ts +36 -0
  687. package/dist-server/service/work-door/work-door-service.js +127 -0
  688. package/dist-server/service/work-door/work-door-service.js.map +1 -0
  689. package/dist-server/service/work-door/work-door-type.d.ts +88 -0
  690. package/dist-server/service/work-door/work-door-type.js +206 -0
  691. package/dist-server/service/work-door/work-door-type.js.map +1 -0
  692. package/dist-server/service/work-door/work-door.d.ts +187 -0
  693. package/dist-server/service/work-door/work-door.js +119 -0
  694. package/dist-server/service/work-door/work-door.js.map +1 -0
  695. package/dist-server/tsconfig.tsbuildinfo +1 -0
  696. package/package.json +2 -2
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.claimDraft = claimDraft;
4
+ const activity_instance_js_1 = require("../../service/activity-instance/activity-instance.js");
5
+ /**
6
+ * Take hold of a draft before working on it - so that a discard and an issue of the same draft cannot
7
+ * both succeed.
8
+ *
9
+ * Measured on postgres (tests/discard-versus-issue.pg.test.ts): issue read the draft, a discard deleted
10
+ * it, and issue then saved what it had read - the row came back, issued, and the writer had been told it
11
+ * was thrown away. Reading and saving later holds nothing.
12
+ *
13
+ * The claim is an UPDATE that only matches a draft. It takes the row's lock on every driver (SELECT ...
14
+ * FOR UPDATE is not supported on sqlite), and the lock is held until this transaction ends:
15
+ *
16
+ * this claims first a discard waits, then finds no draft and is refused by name
17
+ * a discard is first this waits, then matches no row and is refused by name
18
+ *
19
+ * No row matched means the draft went out or was thrown away in the meantime.
20
+ */
21
+ async function claimDraft(id, context) {
22
+ const { domain, user, tx } = context.state;
23
+ const claimed = await tx
24
+ .getRepository(activity_instance_js_1.ActivityInstance)
25
+ .update({ domain: { id: domain.id }, id, state: activity_instance_js_1.ActivityInstanceStatus.Draft }, { updater: user });
26
+ if (!claimed.affected) {
27
+ throw new Error(context.t('error.activity-instance draft is gone', { id }));
28
+ }
29
+ }
30
+ //# sourceMappingURL=claim-draft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claim-draft.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/claim-draft.ts"],"names":[],"mappings":";;AAkBA,gCAUC;AA5BD,+FAA+G;AAE/G;;;;;;;;;;;;;;;GAeG;AACI,KAAK,UAAU,UAAU,CAAC,EAAU,EAAE,OAAwB;IACnE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAE1C,MAAM,OAAO,GAAG,MAAM,EAAE;SACrB,aAAa,CAAC,uCAAgB,CAAC;SAC/B,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,6CAAsB,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;IAEpG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,uCAAuC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IAC7E,CAAC;AACH,CAAC","sourcesContent":["import { ActivityInstance, ActivityInstanceStatus } from '../../service/activity-instance/activity-instance.js'\n\n/**\n * Take hold of a draft before working on it - so that a discard and an issue of the same draft cannot\n * both succeed.\n *\n * Measured on postgres (tests/discard-versus-issue.pg.test.ts): issue read the draft, a discard deleted\n * it, and issue then saved what it had read - the row came back, issued, and the writer had been told it\n * was thrown away. Reading and saving later holds nothing.\n *\n * The claim is an UPDATE that only matches a draft. It takes the row's lock on every driver (SELECT ...\n * FOR UPDATE is not supported on sqlite), and the lock is held until this transaction ends:\n *\n * this claims first a discard waits, then finds no draft and is refused by name\n * a discard is first this waits, then matches no row and is refused by name\n *\n * No row matched means the draft went out or was thrown away in the meantime.\n */\nexport async function claimDraft(id: string, context: ResolverContext): Promise<void> {\n const { domain, user, tx } = context.state\n\n const claimed = await tx\n .getRepository(ActivityInstance)\n .update({ domain: { id: domain.id }, id, state: ActivityInstanceStatus.Draft }, { updater: user })\n\n if (!claimed.affected) {\n throw new Error(context.t('error.activity-instance draft is gone', { id }))\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Throw away a draft - by whoever wrote it, or someone who manages instances (ruling 2026-09-24).
3
+ *
4
+ * The same entitlement as editing and issuing a draft (entitlement.ts). A draft is still the writer's
5
+ * own; once issued it is other people's work and cannot be thrown away here.
6
+ *
7
+ * ── Order, because a rollback cannot bring a file back ─────────────────────
8
+ * 1. rows that hang off the instance - approvals, then threads. A draft normally has none; they are
9
+ * cleared so that no row is left without its parent. These roll back with the transaction.
10
+ * 2. the instance, with `state = 'draft'` in the delete itself. Reading the state and deleting after
11
+ * would let an issue land in between and be deleted. No row deleted means it is not a draft any
12
+ * more (or not here), and the refusal says so - the transaction rolls step 1 back.
13
+ * 3. attachments that name the instance, last: deleteAttachmentsByRef removes the files from storage
14
+ * at once, and that cannot be rolled back.
15
+ *
16
+ * The files wait for the commit. Under @transaction, deleteAttachmentsByRef deletes the rows now and puts
17
+ * the file deletes on context.state.afterCommit, which shell runs once the transaction has returned
18
+ * (ADR-0091 decision 8). A later refusal - the bulk door refusing its third id - rolls every row back
19
+ * and no file has gone. A transaction opened by hand without runTransaction has no list, and there the
20
+ * files still go at once.
21
+ */
22
+ export declare function discardDraft(id: string, context: ResolverContext): Promise<true>;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.discardDraft = discardDraft;
4
+ const typeorm_1 = require("typeorm");
5
+ const attachment_base_1 = require("@things-factory/attachment-base");
6
+ const activity_approval_js_1 = require("../../service/activity-approval/activity-approval.js");
7
+ const activity_instance_js_1 = require("../../service/activity-instance/activity-instance.js");
8
+ const activity_thread_js_1 = require("../../service/activity-thread/activity-thread.js");
9
+ const entitlement_js_1 = require("./entitlement.js");
10
+ /**
11
+ * Throw away a draft - by whoever wrote it, or someone who manages instances (ruling 2026-09-24).
12
+ *
13
+ * The same entitlement as editing and issuing a draft (entitlement.ts). A draft is still the writer's
14
+ * own; once issued it is other people's work and cannot be thrown away here.
15
+ *
16
+ * ── Order, because a rollback cannot bring a file back ─────────────────────
17
+ * 1. rows that hang off the instance - approvals, then threads. A draft normally has none; they are
18
+ * cleared so that no row is left without its parent. These roll back with the transaction.
19
+ * 2. the instance, with `state = 'draft'` in the delete itself. Reading the state and deleting after
20
+ * would let an issue land in between and be deleted. No row deleted means it is not a draft any
21
+ * more (or not here), and the refusal says so - the transaction rolls step 1 back.
22
+ * 3. attachments that name the instance, last: deleteAttachmentsByRef removes the files from storage
23
+ * at once, and that cannot be rolled back.
24
+ *
25
+ * The files wait for the commit. Under @transaction, deleteAttachmentsByRef deletes the rows now and puts
26
+ * the file deletes on context.state.afterCommit, which shell runs once the transaction has returned
27
+ * (ADR-0091 decision 8). A later refusal - the bulk door refusing its third id - rolls every row back
28
+ * and no file has gone. A transaction opened by hand without runTransaction has no list, and there the
29
+ * files still go at once.
30
+ */
31
+ async function discardDraft(id, context) {
32
+ const { domain, tx } = context.state;
33
+ const instances = tx.getRepository(activity_instance_js_1.ActivityInstance);
34
+ const instance = await instances.findOne({ where: { domain: { id: domain.id }, id } });
35
+ if (!instance) {
36
+ throw new Error(context.t('error.activity-instance not found', { activityInstance: id }));
37
+ }
38
+ await (0, entitlement_js_1.assertMayWorkOnDraft)(instance, context);
39
+ const threads = await tx.getRepository(activity_thread_js_1.ActivityThread).find({
40
+ where: { domain: { id: domain.id }, activityInstance: { id } }
41
+ });
42
+ if (threads.length) {
43
+ const threadIds = threads.map(one => one.id);
44
+ await tx.getRepository(activity_approval_js_1.ActivityApproval).delete({ domain: { id: domain.id }, activityThread: { id: (0, typeorm_1.In)(threadIds) } });
45
+ await tx.getRepository(activity_thread_js_1.ActivityThread).delete({ domain: { id: domain.id }, id: (0, typeorm_1.In)(threadIds) });
46
+ }
47
+ const removed = await instances.delete({ domain: { id: domain.id }, id, state: activity_instance_js_1.ActivityInstanceStatus.Draft });
48
+ if (!removed.affected) {
49
+ throw new Error(context.t('error.activity-instance not a draft any more', { id }));
50
+ }
51
+ await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [id] }, context);
52
+ return true;
53
+ }
54
+ //# sourceMappingURL=discard-draft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discard-draft.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/discard-draft.ts"],"names":[],"mappings":";;AA8BA,oCAgCC;AA9DD,qCAA4B;AAE5B,qEAAwE;AAExE,+FAAuF;AACvF,+FAA+G;AAC/G,yFAAiF;AACjF,qDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,KAAK,UAAU,YAAY,CAAC,EAAU,EAAE,OAAwB;IACrE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IACpC,MAAM,SAAS,GAAG,EAAE,CAAC,aAAa,CAAC,uCAAgB,CAAC,CAAA;IAEpD,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;IAEtF,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,mCAAmC,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IAC3F,CAAC;IAED,MAAM,IAAA,qCAAoB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAE7C,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,mCAAc,CAAC,CAAC,IAAI,CAAC;QAC1D,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,EAAE,EAAE;KAC/D,CAAC,CAAA;IAEF,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QAE5C,MAAM,EAAE,CAAC,aAAa,CAAC,uCAAgB,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,EAAE,IAAA,YAAE,EAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAA;QACrH,MAAM,EAAE,CAAC,aAAa,CAAC,mCAAc,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAA,YAAE,EAAC,SAAS,CAAC,EAAE,CAAC,CAAA;IACjG,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,6CAAsB,CAAC,KAAK,EAAE,CAAC,CAAA;IAE9G,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,8CAA8C,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IACpF,CAAC;IAED,MAAM,IAAA,wCAAsB,EAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IAE7D,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { In } from 'typeorm'\n\nimport { deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { ActivityApproval } from '../../service/activity-approval/activity-approval.js'\nimport { ActivityInstance, ActivityInstanceStatus } from '../../service/activity-instance/activity-instance.js'\nimport { ActivityThread } from '../../service/activity-thread/activity-thread.js'\nimport { assertMayWorkOnDraft } from './entitlement.js'\n\n/**\n * Throw away a draft - by whoever wrote it, or someone who manages instances (ruling 2026-09-24).\n *\n * The same entitlement as editing and issuing a draft (entitlement.ts). A draft is still the writer's\n * own; once issued it is other people's work and cannot be thrown away here.\n *\n * ── Order, because a rollback cannot bring a file back ─────────────────────\n * 1. rows that hang off the instance - approvals, then threads. A draft normally has none; they are\n * cleared so that no row is left without its parent. These roll back with the transaction.\n * 2. the instance, with `state = 'draft'` in the delete itself. Reading the state and deleting after\n * would let an issue land in between and be deleted. No row deleted means it is not a draft any\n * more (or not here), and the refusal says so - the transaction rolls step 1 back.\n * 3. attachments that name the instance, last: deleteAttachmentsByRef removes the files from storage\n * at once, and that cannot be rolled back.\n *\n * The files wait for the commit. Under @transaction, deleteAttachmentsByRef deletes the rows now and puts\n * the file deletes on context.state.afterCommit, which shell runs once the transaction has returned\n * (ADR-0091 decision 8). A later refusal - the bulk door refusing its third id - rolls every row back\n * and no file has gone. A transaction opened by hand without runTransaction has no list, and there the\n * files still go at once.\n */\nexport async function discardDraft(id: string, context: ResolverContext): Promise<true> {\n const { domain, tx } = context.state\n const instances = tx.getRepository(ActivityInstance)\n\n const instance = await instances.findOne({ where: { domain: { id: domain.id }, id } })\n\n if (!instance) {\n throw new Error(context.t('error.activity-instance not found', { activityInstance: id }))\n }\n\n await assertMayWorkOnDraft(instance, context)\n\n const threads = await tx.getRepository(ActivityThread).find({\n where: { domain: { id: domain.id }, activityInstance: { id } }\n })\n\n if (threads.length) {\n const threadIds = threads.map(one => one.id)\n\n await tx.getRepository(ActivityApproval).delete({ domain: { id: domain.id }, activityThread: { id: In(threadIds) } })\n await tx.getRepository(ActivityThread).delete({ domain: { id: domain.id }, id: In(threadIds) })\n }\n\n const removed = await instances.delete({ domain: { id: domain.id }, id, state: ActivityInstanceStatus.Draft })\n\n if (!removed.affected) {\n throw new Error(context.t('error.activity-instance not a draft any more', { id }))\n }\n\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { ActivityInstance } from '../../service/activity-instance/activity-instance.js';
2
+ import { ActivityInstanceDraft } from '../../service/activity-instance/activity-instance-type.js';
3
+ export declare function draft(activityInstance: ActivityInstanceDraft, context: ResolverContext): Promise<ActivityInstance>;
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.draft = draft;
4
+ const activity_instance_js_1 = require("../../service/activity-instance/activity-instance.js");
5
+ const activity_js_1 = require("../../service/activity/activity.js");
6
+ const common_js_1 = require("../common.js");
7
+ const entitlement_js_1 = require("./entitlement.js");
8
+ const claim_draft_js_1 = require("./claim-draft.js");
9
+ const assignee_pool_js_1 = require("../../service/activity-instance/assignee-pool.js");
10
+ const approval_line_input_js_1 = require("./approval-line-input.js");
11
+ async function draft(activityInstance, context) {
12
+ const { domain, user, tx } = context.state;
13
+ const { id, activityId, input, dueAt } = activityInstance;
14
+ var repository = tx.getRepository(activity_js_1.Activity);
15
+ var activity = {};
16
+ if (id) {
17
+ var previousActivityInstance = await tx.getRepository(activity_instance_js_1.ActivityInstance).findOne({
18
+ where: { domain: { id: domain.id }, id },
19
+ relations: ['activity']
20
+ });
21
+ if (!previousActivityInstance) {
22
+ throw new Error(context.t('error.activityInstance not found', {
23
+ activityInstance: id
24
+ }));
25
+ }
26
+ /* 남의 초안은 못 고친다. 새로 시작하는 것(id 없음)은 이 검사에 안 걸린다. */
27
+ await (0, entitlement_js_1.assertMayWorkOnDraft)(previousActivityInstance, context);
28
+ if (previousActivityInstance.state !== activity_instance_js_1.ActivityInstanceStatus.Draft) {
29
+ throw new Error(context.t('error.activityInstance state should be draft', {
30
+ activityInstance: id,
31
+ state: previousActivityInstance.state
32
+ }));
33
+ }
34
+ /* Held until this transaction ends, so a discard cannot remove it between the read and the save. */
35
+ await (0, claim_draft_js_1.claimDraft)(id, context);
36
+ activity = previousActivityInstance.activity;
37
+ }
38
+ else {
39
+ activityInstance.adhocType = 'standard';
40
+ activityInstance.refBy = activityId;
41
+ }
42
+ if (activityId) {
43
+ activity = await repository.findOne({
44
+ where: { domain: { id: domain.id }, id: activityId },
45
+ relations: ['assigneeRoles', 'supervisoryRole']
46
+ });
47
+ if (!activity) {
48
+ throw new Error(context.t('error.activity not found', {
49
+ activity: activityId
50
+ }));
51
+ }
52
+ }
53
+ /*
54
+ * The activity's approval line is set on its detail screen and nowhere else (ruling 2026-09-24).
55
+ * A line handed in must be absent or the same one - § approval-line-input.ts.
56
+ */
57
+ if ((0, approval_line_input_js_1.approvalLineInputRefusal)(activity.approvalLine, activityInstance.approvalLine)) {
58
+ throw Object.assign(new Error(context.t('error.activity-instance approval line is set')), { code: approval_line_input_js_1.LINE_IS_SET });
59
+ }
60
+ if (!activityInstance.assignees) {
61
+ activityInstance.assignees = activity.assignees;
62
+ }
63
+ /* A pool handed in is read in this domain, each role once - or refused by name (assignee-pool.ts). */
64
+ if (activityInstance.assigneeRoles) {
65
+ activityInstance.assigneeRoles = await (0, assignee_pool_js_1.resolvePoolRoles)(activityInstance.assigneeRoles, context);
66
+ }
67
+ if (!activityInstance.approvalLine) {
68
+ activityInstance.approvalLine = activity.approvalLine;
69
+ }
70
+ if (!dueAt && activity.standardTime) {
71
+ activityInstance.dueAt = new Date(Date.now() + activity.standardTime * 1000);
72
+ }
73
+ const activitySearchKeys = (0, common_js_1.fillActivitySearchKeys)(activity?.searchKeys, input);
74
+ return await tx.getRepository(activity_instance_js_1.ActivityInstance).save({
75
+ ...previousActivityInstance,
76
+ activityType: activity.activityType,
77
+ uiType: activity.uiType,
78
+ uiSource: activity.uiSource,
79
+ viewType: activity.viewType,
80
+ viewSource: activity.viewSource,
81
+ assigneeRoles: activity.assigneeRoles,
82
+ supervisoryRole: activity.supervisoryRole,
83
+ ...activityInstance,
84
+ transaction: 'draft',
85
+ activity,
86
+ ...activitySearchKeys,
87
+ state: activity_instance_js_1.ActivityInstanceStatus.Draft,
88
+ domain,
89
+ creator: user,
90
+ updater: user
91
+ });
92
+ }
93
+ //# sourceMappingURL=draft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/draft.ts"],"names":[],"mappings":";;AASA,sBAuGC;AAhHD,+FAA+G;AAE/G,oEAA6D;AAC7D,4CAAqD;AACrD,qDAAuD;AACvD,qDAA6C;AAC7C,uFAAmF;AACnF,qEAAgF;AAEzE,KAAK,UAAU,KAAK,CACzB,gBAAuC,EACvC,OAAwB;IAExB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAC1C,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,gBAAgB,CAAA;IAEzD,IAAI,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,sBAAQ,CAAC,CAAA;IAC3C,IAAI,QAAQ,GAAG,EAAc,CAAA;IAE7B,IAAI,EAAE,EAAE,CAAC;QACP,IAAI,wBAAwB,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,uCAAgB,CAAC,CAAC,OAAO,CAAC;YAC9E,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;YACxC,SAAS,EAAE,CAAC,UAAU,CAAC;SACxB,CAAC,CAAA;QAEF,IAAI,CAAC,wBAAwB,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CACb,OAAO,CAAC,CAAC,CAAC,kCAAkC,EAAE;gBAC5C,gBAAgB,EAAE,EAAE;aACrB,CAAC,CACH,CAAA;QACH,CAAC;QAED,kDAAkD;QAClD,MAAM,IAAA,qCAAoB,EAAC,wBAAwB,EAAE,OAAO,CAAC,CAAA;QAE7D,IAAI,wBAAwB,CAAC,KAAK,KAAK,6CAAsB,CAAC,KAAK,EAAE,CAAC;YACpE,MAAM,IAAI,KAAK,CACb,OAAO,CAAC,CAAC,CAAC,8CAA8C,EAAE;gBACxD,gBAAgB,EAAE,EAAE;gBACpB,KAAK,EAAE,wBAAwB,CAAC,KAAK;aACtC,CAAC,CACH,CAAA;QACH,CAAC;QAED,oGAAoG;QACpG,MAAM,IAAA,2BAAU,EAAC,EAAE,EAAE,OAAO,CAAC,CAAA;QAE7B,QAAQ,GAAG,wBAAwB,CAAC,QAAQ,CAAA;IAC9C,CAAC;SAAM,CAAC;QACN,gBAAgB,CAAC,SAAS,GAAG,UAAU,CAAA;QACvC,gBAAgB,CAAC,KAAK,GAAG,UAAU,CAAA;IACrC,CAAC;IAED,IAAI,UAAU,EAAE,CAAC;QACf,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAClC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE;YACpD,SAAS,EAAE,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAChD,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CACb,OAAO,CAAC,CAAC,CAAC,0BAA0B,EAAE;gBACpC,QAAQ,EAAE,UAAU;aACrB,CAAC,CACH,CAAA;QACH,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,IAAI,IAAA,iDAAwB,EAAC,QAAQ,CAAC,YAAY,EAAE,gBAAgB,CAAC,YAAY,CAAC,EAAE,CAAC;QACnF,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,8CAA8C,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,oCAAW,EAAE,CAAC,CAAA;IAClH,CAAC;IAED,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC;QAChC,gBAAgB,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAA;IACjD,CAAC;IACD,sGAAsG;IACtG,IAAI,gBAAgB,CAAC,aAAa,EAAE,CAAC;QACnC,gBAAgB,CAAC,aAAa,GAAG,MAAM,IAAA,mCAAgB,EAAC,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;IAClG,CAAC;IACD,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;QACnC,gBAAgB,CAAC,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAA;IACvD,CAAC;IAED,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,YAAY,EAAE,CAAC;QACpC,gBAAgB,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;IAC9E,CAAC;IAED,MAAM,kBAAkB,GAAG,IAAA,kCAAsB,EAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,CAAC,CAAA;IAE9E,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,uCAAgB,CAAC,CAAC,IAAI,CAAC;QACnD,GAAG,wBAAwB;QAC3B,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,aAAa,EAAE,QAAQ,CAAC,aAAa;QACrC,eAAe,EAAE,QAAQ,CAAC,eAAe;QACzC,GAAG,gBAAgB;QACnB,WAAW,EAAE,OAAO;QACpB,QAAQ;QACR,GAAG,kBAAkB;QACrB,KAAK,EAAE,6CAAsB,CAAC,KAAK;QACnC,MAAM;QACN,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;KACd,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { ActivityInstance, ActivityInstanceStatus } from '../../service/activity-instance/activity-instance.js'\nimport { ActivityInstanceDraft } from '../../service/activity-instance/activity-instance-type.js'\nimport { Activity } from '../../service/activity/activity.js'\nimport { fillActivitySearchKeys } from '../common.js'\nimport { assertMayWorkOnDraft } from './entitlement.js'\nimport { claimDraft } from './claim-draft.js'\nimport { resolvePoolRoles } from '../../service/activity-instance/assignee-pool.js'\nimport { LINE_IS_SET, approvalLineInputRefusal } from './approval-line-input.js'\n\nexport async function draft(\n activityInstance: ActivityInstanceDraft,\n context: ResolverContext\n): Promise<ActivityInstance> {\n const { domain, user, tx } = context.state\n const { id, activityId, input, dueAt } = activityInstance\n\n var repository = tx.getRepository(Activity)\n var activity = {} as Activity\n\n if (id) {\n var previousActivityInstance = await tx.getRepository(ActivityInstance).findOne({\n where: { domain: { id: domain.id }, id },\n relations: ['activity']\n })\n\n if (!previousActivityInstance) {\n throw new Error(\n context.t('error.activityInstance not found', {\n activityInstance: id\n })\n )\n }\n\n /* 남의 초안은 못 고친다. 새로 시작하는 것(id 없음)은 이 검사에 안 걸린다. */\n await assertMayWorkOnDraft(previousActivityInstance, context)\n\n if (previousActivityInstance.state !== ActivityInstanceStatus.Draft) {\n throw new Error(\n context.t('error.activityInstance state should be draft', {\n activityInstance: id,\n state: previousActivityInstance.state\n })\n )\n }\n\n /* Held until this transaction ends, so a discard cannot remove it between the read and the save. */\n await claimDraft(id, context)\n\n activity = previousActivityInstance.activity\n } else {\n activityInstance.adhocType = 'standard'\n activityInstance.refBy = activityId\n }\n\n if (activityId) {\n activity = await repository.findOne({\n where: { domain: { id: domain.id }, id: activityId },\n relations: ['assigneeRoles', 'supervisoryRole']\n })\n\n if (!activity) {\n throw new Error(\n context.t('error.activity not found', {\n activity: activityId\n })\n )\n }\n }\n\n /*\n * The activity's approval line is set on its detail screen and nowhere else (ruling 2026-09-24).\n * A line handed in must be absent or the same one - § approval-line-input.ts.\n */\n if (approvalLineInputRefusal(activity.approvalLine, activityInstance.approvalLine)) {\n throw Object.assign(new Error(context.t('error.activity-instance approval line is set')), { code: LINE_IS_SET })\n }\n\n if (!activityInstance.assignees) {\n activityInstance.assignees = activity.assignees\n }\n /* A pool handed in is read in this domain, each role once - or refused by name (assignee-pool.ts). */\n if (activityInstance.assigneeRoles) {\n activityInstance.assigneeRoles = await resolvePoolRoles(activityInstance.assigneeRoles, context)\n }\n if (!activityInstance.approvalLine) {\n activityInstance.approvalLine = activity.approvalLine\n }\n\n if (!dueAt && activity.standardTime) {\n activityInstance.dueAt = new Date(Date.now() + activity.standardTime * 1000)\n }\n\n const activitySearchKeys = fillActivitySearchKeys(activity?.searchKeys, input)\n\n return await tx.getRepository(ActivityInstance).save({\n ...previousActivityInstance,\n activityType: activity.activityType,\n uiType: activity.uiType,\n uiSource: activity.uiSource,\n viewType: activity.viewType,\n viewSource: activity.viewSource,\n assigneeRoles: activity.assigneeRoles,\n supervisoryRole: activity.supervisoryRole,\n ...activityInstance,\n transaction: 'draft',\n activity,\n ...activitySearchKeys,\n state: ActivityInstanceStatus.Draft,\n domain,\n creator: user,\n updater: user\n })\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { ActivityInstance } from '../../service/activity-instance/activity-instance.js';
2
+ export declare function end({ id, output, reason }: {
3
+ id: string;
4
+ output?: object;
5
+ reason?: string;
6
+ }, context: ResolverContext): Promise<ActivityInstance>;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.end = end;
4
+ const activity_instance_js_1 = require("../../service/activity-instance/activity-instance.js");
5
+ const activity_thread_js_1 = require("../../service/activity-thread/activity-thread.js");
6
+ const common_js_1 = require("../common.js");
7
+ async function end({ id, output, reason }, context) {
8
+ const { domain, user, tx } = context.state;
9
+ const repository = tx.getRepository(activity_instance_js_1.ActivityInstance);
10
+ var activityInstance = await repository.findOne({
11
+ where: { domain: { id: domain.id }, id },
12
+ relations: [
13
+ 'domain',
14
+ 'activity',
15
+ 'activityThreads',
16
+ 'assigneeRoles',
17
+ 'supervisoryRole',
18
+ 'updater',
19
+ 'creator',
20
+ 'starter',
21
+ 'terminator'
22
+ ]
23
+ });
24
+ if (!activityInstance) {
25
+ throw new Error(context.t('error.activity-instance not found', {
26
+ activityInstance: id
27
+ }));
28
+ }
29
+ /*
30
+ Prerequisites for a Task to Be End.
31
+ - The previous state of the task must not be End or Aborted.
32
+ - There should be no unfinished activity threads.
33
+ */
34
+ if (activityInstance.state == activity_instance_js_1.ActivityInstanceStatus.Aborted ||
35
+ activityInstance.state == activity_instance_js_1.ActivityInstanceStatus.Ended) {
36
+ throw new Error(context.t(`error.activity-instance is already terminated`, {
37
+ id,
38
+ state: activityInstance.state
39
+ }));
40
+ }
41
+ const TERMINATED = [activity_thread_js_1.ActivityThreadStatus.Aborted, activity_thread_js_1.ActivityThreadStatus.Ended];
42
+ for (let activityThread of activityInstance.activityThreads) {
43
+ if (TERMINATED.includes(activityThread.state)) {
44
+ continue;
45
+ }
46
+ throw new Error(context.t(`error.all activity threads should be terminated`, {
47
+ activityThread: activityThread.id,
48
+ state: activityInstance.state
49
+ }));
50
+ }
51
+ if (!activityInstance.startedAt) {
52
+ activityInstance.startedAt = new Date();
53
+ }
54
+ return await repository.save({
55
+ ...activityInstance,
56
+ reason,
57
+ output,
58
+ transaction: 'end',
59
+ state: await (0, common_js_1.evalActivityInstanceState)(id, context),
60
+ updater: user,
61
+ terminatedAt: new Date(),
62
+ terminator: user
63
+ });
64
+ }
65
+ //# sourceMappingURL=end.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"end.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/end.ts"],"names":[],"mappings":";;AAIA,kBA4EC;AAhFD,+FAA+G;AAC/G,yFAAuF;AACvF,4CAAwD;AAEjD,KAAK,UAAU,GAAG,CACvB,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAoD,EACxE,OAAwB;IAExB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAC1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,uCAAgB,CAAC,CAAA;IAErD,IAAI,gBAAgB,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;QAC9C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;QACxC,SAAS,EAAE;YACT,QAAQ;YACR,UAAU;YACV,iBAAiB;YACjB,eAAe;YACf,iBAAiB;YACjB,SAAS;YACT,SAAS;YACT,SAAS;YACT,YAAY;SACb;KACF,CAAC,CAAA;IAEF,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,OAAO,CAAC,CAAC,CAAC,mCAAmC,EAAE;YAC7C,gBAAgB,EAAE,EAAE;SACrB,CAAC,CACH,CAAA;IACH,CAAC;IAED;;;;MAIE;IACF,IACE,gBAAgB,CAAC,KAAK,IAAI,6CAAsB,CAAC,OAAO;QACxD,gBAAgB,CAAC,KAAK,IAAI,6CAAsB,CAAC,KAAK,EACtD,CAAC;QACD,MAAM,IAAI,KAAK,CACb,OAAO,CAAC,CAAC,CAAC,+CAA+C,EAAE;YACzD,EAAE;YACF,KAAK,EAAE,gBAAgB,CAAC,KAAK;SAC9B,CAAC,CACH,CAAA;IACH,CAAC;IAED,MAAM,UAAU,GAAG,CAAC,yCAAoB,CAAC,OAAO,EAAE,yCAAoB,CAAC,KAAK,CAAC,CAAA;IAE7E,KAAK,IAAI,cAAc,IAAI,gBAAgB,CAAC,eAAe,EAAE,CAAC;QAC5D,IAAI,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9C,SAAQ;QACV,CAAC;QAED,MAAM,IAAI,KAAK,CACb,OAAO,CAAC,CAAC,CAAC,iDAAiD,EAAE;YAC3D,cAAc,EAAE,cAAc,CAAC,EAAE;YACjC,KAAK,EAAE,gBAAgB,CAAC,KAAK;SAC9B,CAAC,CACH,CAAA;IACH,CAAC;IAED,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC;QAChC,gBAAgB,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAA;IACzC,CAAC;IAED,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC;QAC3B,GAAG,gBAAgB;QACnB,MAAM;QACN,MAAM;QACN,WAAW,EAAE,KAAK;QAClB,KAAK,EAAE,MAAM,IAAA,qCAAyB,EAAC,EAAE,EAAE,OAAO,CAAC;QACnD,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,IAAI,IAAI,EAAE;QACxB,UAAU,EAAE,IAAI;KACV,CAAC,CAAA;AACX,CAAC","sourcesContent":["import { ActivityInstance, ActivityInstanceStatus } from '../../service/activity-instance/activity-instance.js'\nimport { ActivityThreadStatus } from '../../service/activity-thread/activity-thread.js'\nimport { evalActivityInstanceState } from '../common.js'\n\nexport async function end(\n { id, output, reason }: { id: string; output?: object; reason?: string },\n context: ResolverContext\n): Promise<ActivityInstance> {\n const { domain, user, tx } = context.state\n const repository = tx.getRepository(ActivityInstance)\n\n var activityInstance = await repository.findOne({\n where: { domain: { id: domain.id }, id },\n relations: [\n 'domain',\n 'activity',\n 'activityThreads',\n 'assigneeRoles',\n 'supervisoryRole',\n 'updater',\n 'creator',\n 'starter',\n 'terminator'\n ]\n })\n\n if (!activityInstance) {\n throw new Error(\n context.t('error.activity-instance not found', {\n activityInstance: id\n })\n )\n }\n\n /* \n Prerequisites for a Task to Be End.\n - The previous state of the task must not be End or Aborted.\n - There should be no unfinished activity threads.\n */\n if (\n activityInstance.state == ActivityInstanceStatus.Aborted ||\n activityInstance.state == ActivityInstanceStatus.Ended\n ) {\n throw new Error(\n context.t(`error.activity-instance is already terminated`, {\n id,\n state: activityInstance.state\n })\n )\n }\n\n const TERMINATED = [ActivityThreadStatus.Aborted, ActivityThreadStatus.Ended]\n\n for (let activityThread of activityInstance.activityThreads) {\n if (TERMINATED.includes(activityThread.state)) {\n continue\n }\n\n throw new Error(\n context.t(`error.all activity threads should be terminated`, {\n activityThread: activityThread.id,\n state: activityInstance.state\n })\n )\n }\n\n if (!activityInstance.startedAt) {\n activityInstance.startedAt = new Date()\n }\n\n return await repository.save({\n ...activityInstance,\n reason,\n output,\n transaction: 'end',\n state: await evalActivityInstanceState(id, context),\n updater: user,\n terminatedAt: new Date(),\n terminator: user\n } as any)\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import { ActivityInstance } from '../../service/activity-instance/activity-instance.js';
2
+ /**
3
+ * May this person edit or issue this draft?
4
+ *
5
+ * The person who wrote it, or someone who manages activity instances. A draft is a private
6
+ * thing until it is issued — it carries an approval line and assignees that become other
7
+ * people's obligations the moment it goes out.
8
+ */
9
+ export declare function assertMayWorkOnDraft(activityInstance: ActivityInstance, context: ResolverContext): Promise<void>;
10
+ /**
11
+ * May this person pick up this task?
12
+ *
13
+ * ── When a role is named, it is the answer ───────────────────────────────────
14
+ * `assigneeRoles` is how an issuer says "this is for the quality inspectors". Reading it is
15
+ * the whole point of writing it, and until now it was loaded and ignored.
16
+ *
17
+ * ── When no role is named, anyone in the domain may take it ──────────────────
18
+ * That is the current behaviour and it is deliberate rather than a fallback: an issuer who
19
+ * names nobody is saying "whoever is free". Refusing instead would make every unaddressed
20
+ * task unpickable, which is the opposite of what leaving the field blank means.
21
+ *
22
+ * `reference_absent_value_leans_which_way` asks which way an absent value should lean, and
23
+ * here the lean is the issuer's stated intent — not a guess the code makes to be safe.
24
+ */
25
+ export declare function assertMayPick(activityInstance: ActivityInstance, context: ResolverContext): Promise<void>;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertMayWorkOnDraft = assertMayWorkOnDraft;
4
+ exports.assertMayPick = assertMayPick;
5
+ const auth_base_1 = require("@things-factory/auth-base");
6
+ const assignee_pool_js_1 = require("../../service/activity-instance/assignee-pool.js");
7
+ /**
8
+ * Who may act on **this one** activity instance.
9
+ *
10
+ * ── Why three mutations carry no `@privilege` ────────────────────────────────
11
+ * `draftActivityInstance`, `issueActivityInstance` and `pickActivityInstance` were given
12
+ * `@privilege(category: "activity-instance", privilege: "mutation", domainOwnerGranted: true)`
13
+ * commented out, in the same commit that put it live on the other six
14
+ * (`74acc61f6d`, 2025-04-10). That was a choice, not an omission, and the choice was right:
15
+ *
16
+ * gated acting on someone else's work, or destructive
17
+ * assign · end · abort · delete draft
18
+ * not gated doing your own work
19
+ * draft · issue · pick
20
+ *
21
+ * That privilege is the **management** one. Requiring it to pick up a task addressed to you
22
+ * would mean handing every operator on the floor the right to reassign and abort everyone
23
+ * else's work. So the category gate stays off here.
24
+ *
25
+ * The reason was never written down anywhere, which is why the next person to read the file
26
+ * saw three commented-out lines and could not tell "deliberate" from "forgotten". It is
27
+ * written here now.
28
+ *
29
+ * ── What was actually missing ────────────────────────────────────────────────
30
+ * "Your own work" was the intent and **nothing enforced it.** Each of the three takes an
31
+ * id and loads the record without asking whether this person has anything to do with it:
32
+ *
33
+ * draft(id) edits a draft — never checked who wrote it
34
+ * issue(id) issues a draft, routing approvals — never checked who wrote it
35
+ * pick(id) takes an unassigned task — loaded the assignee role and never read it
36
+ *
37
+ * The category gate cannot fix that. Turning it on locks out the operator whose task it is;
38
+ * leaving it off lets anyone in the domain take, edit or issue anyone else's. Those are two
39
+ * different questions and only the second one is open:
40
+ *
41
+ * category privilege may this person manage activity instances at all
42
+ * entitlement may this person act on **this** record
43
+ *
44
+ * The approval side already has the second one — `reject.ts` refuses a reject from someone
45
+ * who is only a reference on the order. The assignment side had no equivalent.
46
+ *
47
+ * Starting something new is untouched: with no id there is no owner to check, and anyone in
48
+ * the domain may begin a task.
49
+ */
50
+ /** Whoever holds the management privilege is entitled to every record, as before. */
51
+ async function manages(context) {
52
+ const { domain, user, unsafeIP, prohibitedPrivileges } = context.state;
53
+ return await (0, auth_base_1.checkPermission)({ category: 'activity-instance', privilege: 'mutation', owner: true }, user, domain, unsafeIP, prohibitedPrivileges);
54
+ }
55
+ /**
56
+ * May this person edit or issue this draft?
57
+ *
58
+ * The person who wrote it, or someone who manages activity instances. A draft is a private
59
+ * thing until it is issued — it carries an approval line and assignees that become other
60
+ * people's obligations the moment it goes out.
61
+ */
62
+ async function assertMayWorkOnDraft(activityInstance, context) {
63
+ const { user } = context.state;
64
+ if (activityInstance.creatorId === user.id) {
65
+ return;
66
+ }
67
+ if (await manages(context)) {
68
+ return;
69
+ }
70
+ throw new Error(context.t('error.activity-instance belongs to someone else', {
71
+ id: activityInstance.id
72
+ }));
73
+ }
74
+ /**
75
+ * May this person pick up this task?
76
+ *
77
+ * ── When a role is named, it is the answer ───────────────────────────────────
78
+ * `assigneeRoles` is how an issuer says "this is for the quality inspectors". Reading it is
79
+ * the whole point of writing it, and until now it was loaded and ignored.
80
+ *
81
+ * ── When no role is named, anyone in the domain may take it ──────────────────
82
+ * That is the current behaviour and it is deliberate rather than a fallback: an issuer who
83
+ * names nobody is saying "whoever is free". Refusing instead would make every unaddressed
84
+ * task unpickable, which is the opposite of what leaving the field blank means.
85
+ *
86
+ * `reference_absent_value_leans_which_way` asks which way an absent value should lean, and
87
+ * here the lean is the issuer's stated intent — not a guess the code makes to be safe.
88
+ */
89
+ async function assertMayPick(activityInstance, context) {
90
+ const { user, tx } = context.state;
91
+ const poolIds = (0, assignee_pool_js_1.poolIdsOf)(activityInstance);
92
+ if (!poolIds.length) {
93
+ return;
94
+ }
95
+ const holder = await tx.getRepository(auth_base_1.User).findOne({
96
+ where: { id: user.id },
97
+ relations: ['roles']
98
+ });
99
+ /* Any one of the pool's roles is enough (ADR-0091 decision 9). */
100
+ if ((0, assignee_pool_js_1.holdsAnyOf)((holder?.roles || []).map((role) => role.id), poolIds)) {
101
+ return;
102
+ }
103
+ if (await manages(context)) {
104
+ return;
105
+ }
106
+ throw new Error(context.t('error.activity-instance is addressed to another role', {
107
+ id: activityInstance.id
108
+ }));
109
+ }
110
+ //# sourceMappingURL=entitlement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entitlement.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/entitlement.ts"],"names":[],"mappings":";;AAqEA,oDAgBC;AAiBD,sCA2BC;AAjID,yDAAuE;AAGvE,uFAAwF;AAExF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,qFAAqF;AACrF,KAAK,UAAU,OAAO,CAAC,OAAwB;IAC7C,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAEtE,OAAO,MAAM,IAAA,2BAAe,EAC1B,EAAE,QAAQ,EAAE,mBAAmB,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,EACrE,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,oBAAoB,CACrB,CAAA;AACH,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,oBAAoB,CAAC,gBAAkC,EAAE,OAAwB;IACrG,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAE9B,IAAI,gBAAgB,CAAC,SAAS,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;QAC3C,OAAM;IACR,CAAC;IAED,IAAI,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAM;IACR,CAAC;IAED,MAAM,IAAI,KAAK,CACb,OAAO,CAAC,CAAC,CAAC,iDAAiD,EAAE;QAC3D,EAAE,EAAE,gBAAgB,CAAC,EAAE;KACxB,CAAC,CACH,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,aAAa,CAAC,gBAAkC,EAAE,OAAwB;IAC9F,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAClC,MAAM,OAAO,GAAG,IAAA,4BAAS,EAAC,gBAAgB,CAAC,CAAA;IAE3C,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,OAAM;IACR,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,gBAAI,CAAC,CAAC,OAAO,CAAC;QAClD,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE;QACtB,SAAS,EAAE,CAAC,OAAO,CAAC;KACrB,CAAC,CAAA;IAEF,kEAAkE;IAClE,IAAI,IAAA,6BAAU,EAAC,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC;QAC5E,OAAM;IACR,CAAC;IAED,IAAI,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAM;IACR,CAAC;IAED,MAAM,IAAI,KAAK,CACb,OAAO,CAAC,CAAC,CAAC,sDAAsD,EAAE;QAChE,EAAE,EAAE,gBAAgB,CAAC,EAAE;KACxB,CAAC,CACH,CAAA;AACH,CAAC","sourcesContent":["import { checkPermission, Role, User } from '@things-factory/auth-base'\n\nimport { ActivityInstance } from '../../service/activity-instance/activity-instance.js'\nimport { holdsAnyOf, poolIdsOf } from '../../service/activity-instance/assignee-pool.js'\n\n/**\n * Who may act on **this one** activity instance.\n *\n * ── Why three mutations carry no `@privilege` ────────────────────────────────\n * `draftActivityInstance`, `issueActivityInstance` and `pickActivityInstance` were given\n * `@privilege(category: \"activity-instance\", privilege: \"mutation\", domainOwnerGranted: true)`\n * commented out, in the same commit that put it live on the other six\n * (`74acc61f6d`, 2025-04-10). That was a choice, not an omission, and the choice was right:\n *\n * gated acting on someone else's work, or destructive\n * assign · end · abort · delete draft\n * not gated doing your own work\n * draft · issue · pick\n *\n * That privilege is the **management** one. Requiring it to pick up a task addressed to you\n * would mean handing every operator on the floor the right to reassign and abort everyone\n * else's work. So the category gate stays off here.\n *\n * The reason was never written down anywhere, which is why the next person to read the file\n * saw three commented-out lines and could not tell \"deliberate\" from \"forgotten\". It is\n * written here now.\n *\n * ── What was actually missing ────────────────────────────────────────────────\n * \"Your own work\" was the intent and **nothing enforced it.** Each of the three takes an\n * id and loads the record without asking whether this person has anything to do with it:\n *\n * draft(id) edits a draft — never checked who wrote it\n * issue(id) issues a draft, routing approvals — never checked who wrote it\n * pick(id) takes an unassigned task — loaded the assignee role and never read it\n *\n * The category gate cannot fix that. Turning it on locks out the operator whose task it is;\n * leaving it off lets anyone in the domain take, edit or issue anyone else's. Those are two\n * different questions and only the second one is open:\n *\n * category privilege may this person manage activity instances at all\n * entitlement may this person act on **this** record\n *\n * The approval side already has the second one — `reject.ts` refuses a reject from someone\n * who is only a reference on the order. The assignment side had no equivalent.\n *\n * Starting something new is untouched: with no id there is no owner to check, and anyone in\n * the domain may begin a task.\n */\n\n/** Whoever holds the management privilege is entitled to every record, as before. */\nasync function manages(context: ResolverContext): Promise<boolean> {\n const { domain, user, unsafeIP, prohibitedPrivileges } = context.state\n\n return await checkPermission(\n { category: 'activity-instance', privilege: 'mutation', owner: true },\n user,\n domain,\n unsafeIP,\n prohibitedPrivileges\n )\n}\n\n/**\n * May this person edit or issue this draft?\n *\n * The person who wrote it, or someone who manages activity instances. A draft is a private\n * thing until it is issued — it carries an approval line and assignees that become other\n * people's obligations the moment it goes out.\n */\nexport async function assertMayWorkOnDraft(activityInstance: ActivityInstance, context: ResolverContext) {\n const { user } = context.state\n\n if (activityInstance.creatorId === user.id) {\n return\n }\n\n if (await manages(context)) {\n return\n }\n\n throw new Error(\n context.t('error.activity-instance belongs to someone else', {\n id: activityInstance.id\n })\n )\n}\n\n/**\n * May this person pick up this task?\n *\n * ── When a role is named, it is the answer ───────────────────────────────────\n * `assigneeRoles` is how an issuer says \"this is for the quality inspectors\". Reading it is\n * the whole point of writing it, and until now it was loaded and ignored.\n *\n * ── When no role is named, anyone in the domain may take it ──────────────────\n * That is the current behaviour and it is deliberate rather than a fallback: an issuer who\n * names nobody is saying \"whoever is free\". Refusing instead would make every unaddressed\n * task unpickable, which is the opposite of what leaving the field blank means.\n *\n * `reference_absent_value_leans_which_way` asks which way an absent value should lean, and\n * here the lean is the issuer's stated intent — not a guess the code makes to be safe.\n */\nexport async function assertMayPick(activityInstance: ActivityInstance, context: ResolverContext) {\n const { user, tx } = context.state\n const poolIds = poolIdsOf(activityInstance)\n\n if (!poolIds.length) {\n return\n }\n\n const holder = await tx.getRepository(User).findOne({\n where: { id: user.id },\n relations: ['roles']\n })\n\n /* Any one of the pool's roles is enough (ADR-0091 decision 9). */\n if (holdsAnyOf((holder?.roles || []).map((role: Role) => role.id), poolIds)) {\n return\n }\n\n if (await manages(context)) {\n return\n }\n\n throw new Error(\n context.t('error.activity-instance is addressed to another role', {\n id: activityInstance.id\n })\n )\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export * from './draft.js';
2
+ export * from './issue.js';
3
+ export * from './pick.js';
4
+ export * from './assign.js';
5
+ export * from './abort.js';
6
+ export * from './end.js';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./draft.js"), exports);
5
+ tslib_1.__exportStar(require("./issue.js"), exports);
6
+ tslib_1.__exportStar(require("./pick.js"), exports);
7
+ tslib_1.__exportStar(require("./assign.js"), exports);
8
+ tslib_1.__exportStar(require("./abort.js"), exports);
9
+ tslib_1.__exportStar(require("./end.js"), exports);
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,qDAA0B;AAC1B,oDAAyB;AACzB,sDAA2B;AAC3B,qDAA0B;AAC1B,mDAAwB","sourcesContent":["export * from './draft.js'\nexport * from './issue.js'\nexport * from './pick.js'\nexport * from './assign.js'\nexport * from './abort.js'\nexport * from './end.js'\n"]}
@@ -0,0 +1,3 @@
1
+ import { ActivityInstance } from '../../service/activity-instance/activity-instance.js';
2
+ import { ActivityInstanceIssue } from '../../service/activity-instance/activity-instance-type.js';
3
+ export declare function issue(activityInstance: ActivityInstanceIssue, context: ResolverContext): Promise<ActivityInstance>;