@things-factory/ops-master 10.1.246 → 10.1.248

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 (429) hide show
  1. package/package.json +5 -5
  2. package/dist-client/bootstrap.d.ts +0 -19
  3. package/dist-client/bootstrap.js +0 -66
  4. package/dist-client/bootstrap.js.map +0 -1
  5. package/dist-client/index.d.ts +0 -17
  6. package/dist-client/index.js +0 -21
  7. package/dist-client/index.js.map +0 -1
  8. package/dist-client/master-change-approval.d.ts +0 -14
  9. package/dist-client/master-change-approval.js +0 -36
  10. package/dist-client/master-change-approval.js.map +0 -1
  11. package/dist-client/master-change-policy-axes.d.ts +0 -37
  12. package/dist-client/master-change-policy-axes.js +0 -29
  13. package/dist-client/master-change-policy-axes.js.map +0 -1
  14. package/dist-client/master-change-policy-panel.d.ts +0 -59
  15. package/dist-client/master-change-policy-panel.js +0 -454
  16. package/dist-client/master-change-policy-panel.js.map +0 -1
  17. package/dist-client/master-change-providers.d.ts +0 -4
  18. package/dist-client/master-change-providers.js +0 -91
  19. package/dist-client/master-change-providers.js.map +0 -1
  20. package/dist-client/pages/master/applied-when-dialog.d.ts +0 -48
  21. package/dist-client/pages/master/applied-when-dialog.js +0 -137
  22. package/dist-client/pages/master/applied-when-dialog.js.map +0 -1
  23. package/dist-client/pages/master/assignment-fields.d.ts +0 -27
  24. package/dist-client/pages/master/assignment-fields.js +0 -62
  25. package/dist-client/pages/master/assignment-fields.js.map +0 -1
  26. package/dist-client/pages/master/equipment-class.d.ts +0 -12
  27. package/dist-client/pages/master/equipment-class.js +0 -42
  28. package/dist-client/pages/master/equipment-class.js.map +0 -1
  29. package/dist-client/pages/master/equipment.d.ts +0 -12
  30. package/dist-client/pages/master/equipment.js +0 -58
  31. package/dist-client/pages/master/equipment.js.map +0 -1
  32. package/dist-client/pages/master/grist-iso-duration.d.ts +0 -20
  33. package/dist-client/pages/master/grist-iso-duration.js +0 -70
  34. package/dist-client/pages/master/grist-iso-duration.js.map +0 -1
  35. package/dist-client/pages/master/grist-reference.d.ts +0 -91
  36. package/dist-client/pages/master/grist-reference.js +0 -419
  37. package/dist-client/pages/master/grist-reference.js.map +0 -1
  38. package/dist-client/pages/master/import-rows.d.ts +0 -35
  39. package/dist-client/pages/master/import-rows.js +0 -66
  40. package/dist-client/pages/master/import-rows.js.map +0 -1
  41. package/dist-client/pages/master/iso-duration.d.ts +0 -34
  42. package/dist-client/pages/master/iso-duration.js +0 -76
  43. package/dist-client/pages/master/iso-duration.js.map +0 -1
  44. package/dist-client/pages/master/master-options.d.ts +0 -40
  45. package/dist-client/pages/master/master-options.js +0 -54
  46. package/dist-client/pages/master/master-options.js.map +0 -1
  47. package/dist-client/pages/master/master-page-base.d.ts +0 -369
  48. package/dist-client/pages/master/master-page-base.js +0 -657
  49. package/dist-client/pages/master/master-page-base.js.map +0 -1
  50. package/dist-client/pages/master/material-class.d.ts +0 -12
  51. package/dist-client/pages/master/material-class.js +0 -42
  52. package/dist-client/pages/master/material-class.js.map +0 -1
  53. package/dist-client/pages/master/material-definition.d.ts +0 -5
  54. package/dist-client/pages/master/material-definition.js +0 -14
  55. package/dist-client/pages/master/material-definition.js.map +0 -1
  56. package/dist-client/pages/master/material-revision-fields.d.ts +0 -2
  57. package/dist-client/pages/master/material-revision-fields.js +0 -43
  58. package/dist-client/pages/master/material-revision-fields.js.map +0 -1
  59. package/dist-client/pages/master/operation-definition.d.ts +0 -12
  60. package/dist-client/pages/master/operation-definition.js +0 -49
  61. package/dist-client/pages/master/operation-definition.js.map +0 -1
  62. package/dist-client/pages/master/operational-location.d.ts +0 -84
  63. package/dist-client/pages/master/operational-location.js +0 -432
  64. package/dist-client/pages/master/operational-location.js.map +0 -1
  65. package/dist-client/pages/master/person.d.ts +0 -12
  66. package/dist-client/pages/master/person.js +0 -41
  67. package/dist-client/pages/master/person.js.map +0 -1
  68. package/dist-client/pages/master/personnel-class.d.ts +0 -12
  69. package/dist-client/pages/master/personnel-class.js +0 -43
  70. package/dist-client/pages/master/personnel-class.js.map +0 -1
  71. package/dist-client/pages/master/physical-asset-class.d.ts +0 -12
  72. package/dist-client/pages/master/physical-asset-class.js +0 -40
  73. package/dist-client/pages/master/physical-asset-class.js.map +0 -1
  74. package/dist-client/pages/master/physical-asset.d.ts +0 -12
  75. package/dist-client/pages/master/physical-asset.js +0 -41
  76. package/dist-client/pages/master/physical-asset.js.map +0 -1
  77. package/dist-client/pages/master/recipe-definition.d.ts +0 -5
  78. package/dist-client/pages/master/recipe-definition.js +0 -14
  79. package/dist-client/pages/master/recipe-definition.js.map +0 -1
  80. package/dist-client/pages/master/reference-targets.d.ts +0 -42
  81. package/dist-client/pages/master/reference-targets.js +0 -82
  82. package/dist-client/pages/master/reference-targets.js.map +0 -1
  83. package/dist-client/pages/master/revision-comparison.d.ts +0 -49
  84. package/dist-client/pages/master/revision-comparison.js +0 -560
  85. package/dist-client/pages/master/revision-comparison.js.map +0 -1
  86. package/dist-client/pages/master/revision-view.d.ts +0 -34
  87. package/dist-client/pages/master/revision-view.js +0 -145
  88. package/dist-client/pages/master/revision-view.js.map +0 -1
  89. package/dist-client/pages/master/revision-workspace.d.ts +0 -50
  90. package/dist-client/pages/master/revision-workspace.js +0 -763
  91. package/dist-client/pages/master/revision-workspace.js.map +0 -1
  92. package/dist-client/pages/master/route-definition.d.ts +0 -19
  93. package/dist-client/pages/master/route-definition.js +0 -40
  94. package/dist-client/pages/master/route-definition.js.map +0 -1
  95. package/dist-client/pages/master/stop-reason.d.ts +0 -12
  96. package/dist-client/pages/master/stop-reason.js +0 -48
  97. package/dist-client/pages/master/stop-reason.js.map +0 -1
  98. package/dist-client/pages/master/test-specification.d.ts +0 -5
  99. package/dist-client/pages/master/test-specification.js +0 -14
  100. package/dist-client/pages/master/test-specification.js.map +0 -1
  101. package/dist-client/pages/master-axes.d.ts +0 -24
  102. package/dist-client/pages/master-axes.js +0 -39
  103. package/dist-client/pages/master-axes.js.map +0 -1
  104. package/dist-client/route.d.ts +0 -1
  105. package/dist-client/route.js +0 -81
  106. package/dist-client/route.js.map +0 -1
  107. package/dist-client/tsconfig.tsbuildinfo +0 -1
  108. package/dist-server/index.d.ts +0 -1
  109. package/dist-server/index.js +0 -19
  110. package/dist-server/index.js.map +0 -1
  111. package/dist-server/service/ai-entry/master-entry-rules.d.ts +0 -175
  112. package/dist-server/service/ai-entry/master-entry-rules.js +0 -302
  113. package/dist-server/service/ai-entry/master-entry-rules.js.map +0 -1
  114. package/dist-server/service/ai-entry/master-entry-targets.d.ts +0 -23
  115. package/dist-server/service/ai-entry/master-entry-targets.js +0 -293
  116. package/dist-server/service/ai-entry/master-entry-targets.js.map +0 -1
  117. package/dist-server/service/approval-route.d.ts +0 -37
  118. package/dist-server/service/approval-route.js +0 -34
  119. package/dist-server/service/approval-route.js.map +0 -1
  120. package/dist-server/service/asset/asset-lifecycle.d.ts +0 -106
  121. package/dist-server/service/asset/asset-lifecycle.js +0 -126
  122. package/dist-server/service/asset/asset-lifecycle.js.map +0 -1
  123. package/dist-server/service/asset/asset-master-resolver.d.ts +0 -53
  124. package/dist-server/service/asset/asset-master-resolver.js +0 -185
  125. package/dist-server/service/asset/asset-master-resolver.js.map +0 -1
  126. package/dist-server/service/asset/asset-master.d.ts +0 -21
  127. package/dist-server/service/asset/asset-master.js +0 -25
  128. package/dist-server/service/asset/asset-master.js.map +0 -1
  129. package/dist-server/service/asset/asset-query.d.ts +0 -16
  130. package/dist-server/service/asset/asset-query.js +0 -72
  131. package/dist-server/service/asset/asset-query.js.map +0 -1
  132. package/dist-server/service/asset/index.d.ts +0 -6
  133. package/dist-server/service/asset/index.js +0 -10
  134. package/dist-server/service/asset/index.js.map +0 -1
  135. package/dist-server/service/asset/physical-asset-class.d.ts +0 -34
  136. package/dist-server/service/asset/physical-asset-class.js +0 -104
  137. package/dist-server/service/asset/physical-asset-class.js.map +0 -1
  138. package/dist-server/service/asset/physical-asset.d.ts +0 -66
  139. package/dist-server/service/asset/physical-asset.js +0 -123
  140. package/dist-server/service/asset/physical-asset.js.map +0 -1
  141. package/dist-server/service/assignment/applied-when.d.ts +0 -24
  142. package/dist-server/service/assignment/applied-when.js +0 -16
  143. package/dist-server/service/assignment/applied-when.js.map +0 -1
  144. package/dist-server/service/assignment/assignment-history.d.ts +0 -92
  145. package/dist-server/service/assignment/assignment-history.js +0 -289
  146. package/dist-server/service/assignment/assignment-history.js.map +0 -1
  147. package/dist-server/service/assignment/assignment-write.d.ts +0 -42
  148. package/dist-server/service/assignment/assignment-write.js +0 -101
  149. package/dist-server/service/assignment/assignment-write.js.map +0 -1
  150. package/dist-server/service/assignment/master-value-claim.d.ts +0 -135
  151. package/dist-server/service/assignment/master-value-claim.js +0 -174
  152. package/dist-server/service/assignment/master-value-claim.js.map +0 -1
  153. package/dist-server/service/equipment/equipment-class.d.ts +0 -34
  154. package/dist-server/service/equipment/equipment-class.js +0 -104
  155. package/dist-server/service/equipment/equipment-class.js.map +0 -1
  156. package/dist-server/service/equipment/equipment-master-resolver.d.ts +0 -77
  157. package/dist-server/service/equipment/equipment-master-resolver.js +0 -266
  158. package/dist-server/service/equipment/equipment-master-resolver.js.map +0 -1
  159. package/dist-server/service/equipment/equipment-master.d.ts +0 -30
  160. package/dist-server/service/equipment/equipment-master.js +0 -53
  161. package/dist-server/service/equipment/equipment-master.js.map +0 -1
  162. package/dist-server/service/equipment/equipment-query.d.ts +0 -16
  163. package/dist-server/service/equipment/equipment-query.js +0 -72
  164. package/dist-server/service/equipment/equipment-query.js.map +0 -1
  165. package/dist-server/service/equipment/equipment.d.ts +0 -71
  166. package/dist-server/service/equipment/equipment.js +0 -138
  167. package/dist-server/service/equipment/equipment.js.map +0 -1
  168. package/dist-server/service/equipment/index.d.ts +0 -8
  169. package/dist-server/service/equipment/index.js +0 -12
  170. package/dist-server/service/equipment/index.js.map +0 -1
  171. package/dist-server/service/equipment/state-period-rules.d.ts +0 -95
  172. package/dist-server/service/equipment/state-period-rules.js +0 -122
  173. package/dist-server/service/equipment/state-period-rules.js.map +0 -1
  174. package/dist-server/service/equipment/stop-reason-query.d.ts +0 -11
  175. package/dist-server/service/equipment/stop-reason-query.js +0 -39
  176. package/dist-server/service/equipment/stop-reason-query.js.map +0 -1
  177. package/dist-server/service/equipment/stop-reason.d.ts +0 -58
  178. package/dist-server/service/equipment/stop-reason.js +0 -114
  179. package/dist-server/service/equipment/stop-reason.js.map +0 -1
  180. package/dist-server/service/index.d.ts +0 -82
  181. package/dist-server/service/index.js +0 -145
  182. package/dist-server/service/index.js.map +0 -1
  183. package/dist-server/service/location/index.d.ts +0 -5
  184. package/dist-server/service/location/index.js +0 -9
  185. package/dist-server/service/location/index.js.map +0 -1
  186. package/dist-server/service/location/location-master-resolver.d.ts +0 -60
  187. package/dist-server/service/location/location-master-resolver.js +0 -313
  188. package/dist-server/service/location/location-master-resolver.js.map +0 -1
  189. package/dist-server/service/location/location-master.d.ts +0 -26
  190. package/dist-server/service/location/location-master.js +0 -28
  191. package/dist-server/service/location/location-master.js.map +0 -1
  192. package/dist-server/service/location/location-query.d.ts +0 -15
  193. package/dist-server/service/location/location-query.js +0 -56
  194. package/dist-server/service/location/location-query.js.map +0 -1
  195. package/dist-server/service/location/operational-location.d.ts +0 -116
  196. package/dist-server/service/location/operational-location.js +0 -157
  197. package/dist-server/service/location/operational-location.js.map +0 -1
  198. package/dist-server/service/master-axis.d.ts +0 -40
  199. package/dist-server/service/master-axis.js +0 -57
  200. package/dist-server/service/master-axis.js.map +0 -1
  201. package/dist-server/service/master-change-approval/approval-input.d.ts +0 -17
  202. package/dist-server/service/master-change-approval/approval-input.js +0 -35
  203. package/dist-server/service/master-change-approval/approval-input.js.map +0 -1
  204. package/dist-server/service/master-change-approval/builtin-axes.d.ts +0 -4
  205. package/dist-server/service/master-change-approval/builtin-axes.js +0 -96
  206. package/dist-server/service/master-change-approval/builtin-axes.js.map +0 -1
  207. package/dist-server/service/master-change-approval/index.d.ts +0 -14
  208. package/dist-server/service/master-change-approval/index.js +0 -37
  209. package/dist-server/service/master-change-approval/index.js.map +0 -1
  210. package/dist-server/service/master-change-approval/master-change-axis.d.ts +0 -54
  211. package/dist-server/service/master-change-approval/master-change-axis.js +0 -17
  212. package/dist-server/service/master-change-approval/master-change-axis.js.map +0 -1
  213. package/dist-server/service/master-change-approval/master-change-flow.d.ts +0 -65
  214. package/dist-server/service/master-change-approval/master-change-flow.js +0 -125
  215. package/dist-server/service/master-change-approval/master-change-flow.js.map +0 -1
  216. package/dist-server/service/master-change-approval/master-change-resolver.d.ts +0 -18
  217. package/dist-server/service/master-change-approval/master-change-resolver.js +0 -58
  218. package/dist-server/service/master-change-approval/master-change-resolver.js.map +0 -1
  219. package/dist-server/service/master-change-policy.d.ts +0 -122
  220. package/dist-server/service/master-change-policy.js +0 -304
  221. package/dist-server/service/master-change-policy.js.map +0 -1
  222. package/dist-server/service/master-conformance-resolver.d.ts +0 -34
  223. package/dist-server/service/master-conformance-resolver.js +0 -153
  224. package/dist-server/service/master-conformance-resolver.js.map +0 -1
  225. package/dist-server/service/master-conformance.d.ts +0 -80
  226. package/dist-server/service/master-conformance.js +0 -266
  227. package/dist-server/service/master-conformance.js.map +0 -1
  228. package/dist-server/service/master-crud.d.ts +0 -55
  229. package/dist-server/service/master-crud.js +0 -93
  230. package/dist-server/service/master-crud.js.map +0 -1
  231. package/dist-server/service/master-list.d.ts +0 -12
  232. package/dist-server/service/master-list.js +0 -30
  233. package/dist-server/service/master-list.js.map +0 -1
  234. package/dist-server/service/master-page-query.d.ts +0 -33
  235. package/dist-server/service/master-page-query.js +0 -55
  236. package/dist-server/service/master-page-query.js.map +0 -1
  237. package/dist-server/service/master-page.d.ts +0 -85
  238. package/dist-server/service/master-page.js +0 -104
  239. package/dist-server/service/master-page.js.map +0 -1
  240. package/dist-server/service/material/index.d.ts +0 -7
  241. package/dist-server/service/material/index.js +0 -12
  242. package/dist-server/service/material/index.js.map +0 -1
  243. package/dist-server/service/material/material-axis-status.d.ts +0 -8
  244. package/dist-server/service/material/material-axis-status.js +0 -19
  245. package/dist-server/service/material/material-axis-status.js.map +0 -1
  246. package/dist-server/service/material/material-class.d.ts +0 -34
  247. package/dist-server/service/material/material-class.js +0 -104
  248. package/dist-server/service/material/material-class.js.map +0 -1
  249. package/dist-server/service/material/material-definition.d.ts +0 -45
  250. package/dist-server/service/material/material-definition.js +0 -125
  251. package/dist-server/service/material/material-definition.js.map +0 -1
  252. package/dist-server/service/material/material-effective-list.d.ts +0 -39
  253. package/dist-server/service/material/material-effective-list.js +0 -54
  254. package/dist-server/service/material/material-effective-list.js.map +0 -1
  255. package/dist-server/service/material/material-master-resolver.d.ts +0 -106
  256. package/dist-server/service/material/material-master-resolver.js +0 -351
  257. package/dist-server/service/material/material-master-resolver.js.map +0 -1
  258. package/dist-server/service/material/material-master.d.ts +0 -9
  259. package/dist-server/service/material/material-master.js +0 -24
  260. package/dist-server/service/material/material-master.js.map +0 -1
  261. package/dist-server/service/material/material-query.d.ts +0 -16
  262. package/dist-server/service/material/material-query.js +0 -79
  263. package/dist-server/service/material/material-query.js.map +0 -1
  264. package/dist-server/service/material/material-revision-content.d.ts +0 -10
  265. package/dist-server/service/material/material-revision-content.js +0 -92
  266. package/dist-server/service/material/material-revision-content.js.map +0 -1
  267. package/dist-server/service/material/material-revision-resolver.d.ts +0 -60
  268. package/dist-server/service/material/material-revision-resolver.js +0 -96
  269. package/dist-server/service/material/material-revision-resolver.js.map +0 -1
  270. package/dist-server/service/material/material-revision-service.d.ts +0 -179
  271. package/dist-server/service/material/material-revision-service.js +0 -687
  272. package/dist-server/service/material/material-revision-service.js.map +0 -1
  273. package/dist-server/service/material/material-revision.d.ts +0 -86
  274. package/dist-server/service/material/material-revision.js +0 -339
  275. package/dist-server/service/material/material-revision.js.map +0 -1
  276. package/dist-server/service/material/recipe-index.d.ts +0 -23
  277. package/dist-server/service/material/recipe-index.js +0 -44
  278. package/dist-server/service/material/recipe-index.js.map +0 -1
  279. package/dist-server/service/operation/index.d.ts +0 -6
  280. package/dist-server/service/operation/index.js +0 -10
  281. package/dist-server/service/operation/index.js.map +0 -1
  282. package/dist-server/service/operation/operation-definition.d.ts +0 -52
  283. package/dist-server/service/operation/operation-definition.js +0 -143
  284. package/dist-server/service/operation/operation-definition.js.map +0 -1
  285. package/dist-server/service/operation/operation-master-resolver.d.ts +0 -52
  286. package/dist-server/service/operation/operation-master-resolver.js +0 -187
  287. package/dist-server/service/operation/operation-master-resolver.js.map +0 -1
  288. package/dist-server/service/operation/operation-master.d.ts +0 -21
  289. package/dist-server/service/operation/operation-master.js +0 -28
  290. package/dist-server/service/operation/operation-master.js.map +0 -1
  291. package/dist-server/service/operation/operation-query.d.ts +0 -15
  292. package/dist-server/service/operation/operation-query.js +0 -56
  293. package/dist-server/service/operation/operation-query.js.map +0 -1
  294. package/dist-server/service/operation/operation-readiness-resolver.d.ts +0 -39
  295. package/dist-server/service/operation/operation-readiness-resolver.js +0 -111
  296. package/dist-server/service/operation/operation-readiness-resolver.js.map +0 -1
  297. package/dist-server/service/operation/operation-readiness.d.ts +0 -34
  298. package/dist-server/service/operation/operation-readiness.js +0 -133
  299. package/dist-server/service/operation/operation-readiness.js.map +0 -1
  300. package/dist-server/service/personnel/index.d.ts +0 -6
  301. package/dist-server/service/personnel/index.js +0 -10
  302. package/dist-server/service/personnel/index.js.map +0 -1
  303. package/dist-server/service/personnel/person.d.ts +0 -51
  304. package/dist-server/service/personnel/person.js +0 -119
  305. package/dist-server/service/personnel/person.js.map +0 -1
  306. package/dist-server/service/personnel/personnel-class-readiness.d.ts +0 -22
  307. package/dist-server/service/personnel/personnel-class-readiness.js +0 -98
  308. package/dist-server/service/personnel/personnel-class-readiness.js.map +0 -1
  309. package/dist-server/service/personnel/personnel-class.d.ts +0 -54
  310. package/dist-server/service/personnel/personnel-class.js +0 -114
  311. package/dist-server/service/personnel/personnel-class.js.map +0 -1
  312. package/dist-server/service/personnel/personnel-master-resolver.d.ts +0 -53
  313. package/dist-server/service/personnel/personnel-master-resolver.js +0 -187
  314. package/dist-server/service/personnel/personnel-master-resolver.js.map +0 -1
  315. package/dist-server/service/personnel/personnel-master.d.ts +0 -39
  316. package/dist-server/service/personnel/personnel-master.js +0 -34
  317. package/dist-server/service/personnel/personnel-master.js.map +0 -1
  318. package/dist-server/service/personnel/personnel-query.d.ts +0 -29
  319. package/dist-server/service/personnel/personnel-query.js +0 -79
  320. package/dist-server/service/personnel/personnel-query.js.map +0 -1
  321. package/dist-server/service/personnel/qualification.d.ts +0 -104
  322. package/dist-server/service/personnel/qualification.js +0 -147
  323. package/dist-server/service/personnel/qualification.js.map +0 -1
  324. package/dist-server/service/quality/index.d.ts +0 -4
  325. package/dist-server/service/quality/index.js +0 -8
  326. package/dist-server/service/quality/index.js.map +0 -1
  327. package/dist-server/service/quality/nonconformance-cause-resolver.d.ts +0 -12
  328. package/dist-server/service/quality/nonconformance-cause-resolver.js +0 -60
  329. package/dist-server/service/quality/nonconformance-cause-resolver.js.map +0 -1
  330. package/dist-server/service/quality/nonconformance-cause.d.ts +0 -20
  331. package/dist-server/service/quality/nonconformance-cause.js +0 -90
  332. package/dist-server/service/quality/nonconformance-cause.js.map +0 -1
  333. package/dist-server/service/recipe/index.d.ts +0 -10
  334. package/dist-server/service/recipe/index.js +0 -16
  335. package/dist-server/service/recipe/index.js.map +0 -1
  336. package/dist-server/service/recipe/recipe-definition.d.ts +0 -75
  337. package/dist-server/service/recipe/recipe-definition.js +0 -143
  338. package/dist-server/service/recipe/recipe-definition.js.map +0 -1
  339. package/dist-server/service/recipe/recipe-effective-list.d.ts +0 -49
  340. package/dist-server/service/recipe/recipe-effective-list.js +0 -96
  341. package/dist-server/service/recipe/recipe-effective-list.js.map +0 -1
  342. package/dist-server/service/recipe/recipe-master-resolver.d.ts +0 -28
  343. package/dist-server/service/recipe/recipe-master-resolver.js +0 -128
  344. package/dist-server/service/recipe/recipe-master-resolver.js.map +0 -1
  345. package/dist-server/service/recipe/recipe-master.d.ts +0 -37
  346. package/dist-server/service/recipe/recipe-master.js +0 -47
  347. package/dist-server/service/recipe/recipe-master.js.map +0 -1
  348. package/dist-server/service/recipe/recipe-query.d.ts +0 -21
  349. package/dist-server/service/recipe/recipe-query.js +0 -82
  350. package/dist-server/service/recipe/recipe-query.js.map +0 -1
  351. package/dist-server/service/recipe/recipe-revision-content.d.ts +0 -32
  352. package/dist-server/service/recipe/recipe-revision-content.js +0 -70
  353. package/dist-server/service/recipe/recipe-revision-content.js.map +0 -1
  354. package/dist-server/service/recipe/recipe-revision-line.d.ts +0 -30
  355. package/dist-server/service/recipe/recipe-revision-line.js +0 -95
  356. package/dist-server/service/recipe/recipe-revision-line.js.map +0 -1
  357. package/dist-server/service/recipe/recipe-revision-resolver.d.ts +0 -65
  358. package/dist-server/service/recipe/recipe-revision-resolver.js +0 -96
  359. package/dist-server/service/recipe/recipe-revision-resolver.js.map +0 -1
  360. package/dist-server/service/recipe/recipe-revision-service.d.ts +0 -183
  361. package/dist-server/service/recipe/recipe-revision-service.js +0 -754
  362. package/dist-server/service/recipe/recipe-revision-service.js.map +0 -1
  363. package/dist-server/service/recipe/recipe-revision.d.ts +0 -102
  364. package/dist-server/service/recipe/recipe-revision.js +0 -373
  365. package/dist-server/service/recipe/recipe-revision.js.map +0 -1
  366. package/dist-server/service/recipe/route-definition.d.ts +0 -51
  367. package/dist-server/service/recipe/route-definition.js +0 -114
  368. package/dist-server/service/recipe/route-definition.js.map +0 -1
  369. package/dist-server/service/resource/class-lineage.d.ts +0 -46
  370. package/dist-server/service/resource/class-lineage.js +0 -80
  371. package/dist-server/service/resource/class-lineage.js.map +0 -1
  372. package/dist-server/service/resource/class-members.d.ts +0 -36
  373. package/dist-server/service/resource/class-members.js +0 -59
  374. package/dist-server/service/resource/class-members.js.map +0 -1
  375. package/dist-server/service/resource/referrers.d.ts +0 -54
  376. package/dist-server/service/resource/referrers.js +0 -99
  377. package/dist-server/service/resource/referrers.js.map +0 -1
  378. package/dist-server/service/resource/resource-class.d.ts +0 -25
  379. package/dist-server/service/resource/resource-class.js +0 -29
  380. package/dist-server/service/resource/resource-class.js.map +0 -1
  381. package/dist-server/service/revision-baseline.d.ts +0 -71
  382. package/dist-server/service/revision-baseline.js +0 -87
  383. package/dist-server/service/revision-baseline.js.map +0 -1
  384. package/dist-server/service/row-lock.d.ts +0 -22
  385. package/dist-server/service/row-lock.js +0 -31
  386. package/dist-server/service/row-lock.js.map +0 -1
  387. package/dist-server/service/status/axis-stamp.d.ts +0 -16
  388. package/dist-server/service/status/axis-stamp.js +0 -22
  389. package/dist-server/service/status/axis-stamp.js.map +0 -1
  390. package/dist-server/service/status/index.d.ts +0 -3
  391. package/dist-server/service/status/index.js +0 -7
  392. package/dist-server/service/status/index.js.map +0 -1
  393. package/dist-server/service/status/master-status.d.ts +0 -38
  394. package/dist-server/service/status/master-status.js +0 -129
  395. package/dist-server/service/status/master-status.js.map +0 -1
  396. package/dist-server/service/test-spec/criteria-check.d.ts +0 -53
  397. package/dist-server/service/test-spec/criteria-check.js +0 -142
  398. package/dist-server/service/test-spec/criteria-check.js.map +0 -1
  399. package/dist-server/service/test-spec/criteria-rows.d.ts +0 -89
  400. package/dist-server/service/test-spec/criteria-rows.js +0 -139
  401. package/dist-server/service/test-spec/criteria-rows.js.map +0 -1
  402. package/dist-server/service/test-spec/index.d.ts +0 -6
  403. package/dist-server/service/test-spec/index.js +0 -11
  404. package/dist-server/service/test-spec/index.js.map +0 -1
  405. package/dist-server/service/test-spec/test-spec-effective-list.d.ts +0 -34
  406. package/dist-server/service/test-spec/test-spec-effective-list.js +0 -42
  407. package/dist-server/service/test-spec/test-spec-effective-list.js.map +0 -1
  408. package/dist-server/service/test-spec/test-spec-master-resolver.d.ts +0 -44
  409. package/dist-server/service/test-spec/test-spec-master-resolver.js +0 -144
  410. package/dist-server/service/test-spec/test-spec-master-resolver.js.map +0 -1
  411. package/dist-server/service/test-spec/test-spec-master.d.ts +0 -6
  412. package/dist-server/service/test-spec/test-spec-master.js +0 -18
  413. package/dist-server/service/test-spec/test-spec-master.js.map +0 -1
  414. package/dist-server/service/test-spec/test-spec-query.d.ts +0 -15
  415. package/dist-server/service/test-spec/test-spec-query.js +0 -61
  416. package/dist-server/service/test-spec/test-spec-query.js.map +0 -1
  417. package/dist-server/service/test-spec/test-spec-revision-resolver.d.ts +0 -59
  418. package/dist-server/service/test-spec/test-spec-revision-resolver.js +0 -96
  419. package/dist-server/service/test-spec/test-spec-revision-resolver.js.map +0 -1
  420. package/dist-server/service/test-spec/test-spec-revision-service.d.ts +0 -178
  421. package/dist-server/service/test-spec/test-spec-revision-service.js +0 -685
  422. package/dist-server/service/test-spec/test-spec-revision-service.js.map +0 -1
  423. package/dist-server/service/test-spec/test-spec-revision.d.ts +0 -86
  424. package/dist-server/service/test-spec/test-spec-revision.js +0 -334
  425. package/dist-server/service/test-spec/test-spec-revision.js.map +0 -1
  426. package/dist-server/service/test-spec/test-specification.d.ts +0 -47
  427. package/dist-server/service/test-spec/test-specification.js +0 -119
  428. package/dist-server/service/test-spec/test-specification.js.map +0 -1
  429. package/dist-server/tsconfig.tsbuildinfo +0 -1
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RecipeQuery = exports.RecipeMaster = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const shell_1 = require("@things-factory/shell");
7
- const master_page_query_1 = require("../master-page-query");
8
- const recipe_definition_1 = require("./recipe-definition");
9
- const route_definition_1 = require("./route-definition");
10
- const recipe_master_1 = require("./recipe-master");
11
- const recipe_effective_list_1 = require("./recipe-effective-list");
12
- const master_page_1 = require("../master-page");
13
- let RecipeMaster = class RecipeMaster {
14
- };
15
- exports.RecipeMaster = RecipeMaster;
16
- tslib_1.__decorate([
17
- (0, type_graphql_1.Field)(type => String, { description: 'RecipeDef[] as JSON text' }),
18
- tslib_1.__metadata("design:type", String)
19
- ], RecipeMaster.prototype, "recipes", void 0);
20
- tslib_1.__decorate([
21
- (0, type_graphql_1.Field)(type => String, { description: 'RouteDef[] as JSON text' }),
22
- tslib_1.__metadata("design:type", String)
23
- ], RecipeMaster.prototype, "routes", void 0);
24
- tslib_1.__decorate([
25
- (0, type_graphql_1.Field)({ description: 'true when more rows remain — keep pulling with next as after' }),
26
- tslib_1.__metadata("design:type", Boolean)
27
- ], RecipeMaster.prototype, "hasMore", void 0);
28
- tslib_1.__decorate([
29
- (0, type_graphql_1.Field)(type => String, { nullable: true, description: 'cursor for the next page — the last name in this page' }),
30
- tslib_1.__metadata("design:type", String)
31
- ], RecipeMaster.prototype, "next", void 0);
32
- exports.RecipeMaster = RecipeMaster = tslib_1.__decorate([
33
- (0, type_graphql_1.ObjectType)({ description: 'Recipes and routes as the twin receives them' })
34
- ], RecipeMaster);
35
- let RecipeQuery = class RecipeQuery {
36
- /**
37
- * 레시피와 라우팅을 **한 질의로** 낸다.
38
- *
39
- * 따로 물으면 그 사이에 마스터가 바뀌어 레시피가 없는 라우팅을 가리키는 순간이 생긴다. 구조는
40
- * 서로를 가리키므로 통째로 맞아야 한다 — 마스터를 당겨 가는 다른 축과 같은 규율이다.
41
- */
42
- async recipeMaster(after, limit, context) {
43
- const { domain } = context.state;
44
- const request = { after, limit };
45
- /*
46
- * **라우팅은 통째로, 레시피만 나눈다.** 레시피가 라우팅을 이름으로 가리키므로, 둘을 함께 나누면
47
- * 레시피가 먼저 도착하고 라우팅이 나중에 오는 순간이 생긴다 — 이 파일이 원래 「따로 물으면 레시피가
48
- * 없는 라우팅을 가리키는 순간이 생긴다」고 적어 둔 그 이유다.
49
- */
50
- const [effective, routes] = await Promise.all([
51
- (0, recipe_effective_list_1.listEffectiveRecipes)((0, shell_1.getRepository)(recipe_definition_1.RecipeDefinition).manager, domain, {
52
- filters: [...(after ? [{ name: 'name', operator: 'gt', value: after }] : []),
53
- { name: 'materialDefinitionName', operator: 'is_not_null', value: true }],
54
- sortings: [{ name: 'name', desc: false }], pagination: { limit: (0, master_page_1.takeFor)(request), page: 1 }
55
- }),
56
- (0, shell_1.getRepository)(route_definition_1.RouteDefinition).find({ where: { domain: { id: domain.id } }, order: { name: 'ASC' } })
57
- ]);
58
- const page = (0, master_page_1.pageOf)(effective.items, request, row => row.name);
59
- /* 통째로 달라고 했는데 한도를 넘으면 **자르지 않고 거절한다**(§`master-page`). */
60
- (0, master_page_query_1.refuseIfTooLarge)('레시피', request, page);
61
- return {
62
- recipes: JSON.stringify(page.rows.map(recipe_master_1.toRecipeEntry)),
63
- routes: JSON.stringify(routes.map(recipe_master_1.toRouteEntry)),
64
- hasMore: page.hasMore,
65
- ...(page.next ? { next: page.next } : {})
66
- };
67
- }
68
- };
69
- exports.RecipeQuery = RecipeQuery;
70
- tslib_1.__decorate([
71
- (0, type_graphql_1.Query)(returns => RecipeMaster, { description: 'Recipes and routes for the twin to pull' }),
72
- tslib_1.__param(0, (0, type_graphql_1.Arg)('after', { nullable: true, description: 'resume after this name — the previous page\'s next' })),
73
- tslib_1.__param(1, (0, type_graphql_1.Arg)('limit', type => type_graphql_1.Int, { nullable: true, description: 'rows per page — omit only when the axis is small enough to pull whole' })),
74
- tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
75
- tslib_1.__metadata("design:type", Function),
76
- tslib_1.__metadata("design:paramtypes", [String, Number, Object]),
77
- tslib_1.__metadata("design:returntype", Promise)
78
- ], RecipeQuery.prototype, "recipeMaster", null);
79
- exports.RecipeQuery = RecipeQuery = tslib_1.__decorate([
80
- (0, type_graphql_1.Resolver)(recipe_definition_1.RecipeDefinition)
81
- ], RecipeQuery);
82
- //# sourceMappingURL=recipe-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recipe-query.js","sourceRoot":"","sources":["../../../server/service/recipe/recipe-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAgF;AAEhF,iDAAqD;AAErD,4DAAuD;AAEvD,2DAAsD;AACtD,yDAAoD;AACpD,mDAA6D;AAC7D,mEAA8D;AAC9D,gDAAgD;AAGzC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAm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EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC,CAAA;IACnG,mBAAA,IAAA,kBAAG,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uEAAuE,EAAE,CAAC,CAAA;IACnI,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CA8BP;sBAzCU,WAAW;IADvB,IAAA,uBAAQ,EAAC,oCAAgB,CAAC;GACd,WAAW,CA0CvB","sourcesContent":["import { Arg, Ctx, Field, Int, ObjectType, Query, Resolver } from 'type-graphql'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { refuseIfTooLarge } from '../master-page-query'\n\nimport { RecipeDefinition } from './recipe-definition'\nimport { RouteDefinition } from './route-definition'\nimport { toRecipeEntry, toRouteEntry } from './recipe-master'\nimport { listEffectiveRecipes } from './recipe-effective-list'\nimport { pageOf, takeFor } from '../master-page'\n\n@ObjectType({ description: 'Recipes and routes as the twin receives them' })\nexport class RecipeMaster {\n @Field(type => String, { description: 'RecipeDef[] as JSON text' })\n recipes: string\n\n @Field(type => String, { description: 'RouteDef[] as JSON text' })\n routes: string\n\n /**\n * 더 있나 — **이 값을 안 보고 쓰면 조용히 잘린 마스터로 트윈을 세우게 된다.**\n *\n * 거짓이 될 때까지 `next` 를 `after` 로 넘겨 이어 받는다.\n */\n @Field({ description: 'true when more rows remain — keep pulling with next as after' })\n hasMore: boolean\n\n /** 이어 받을 자리. 더 없으면 없다. */\n @Field(type => String, { nullable: true, description: 'cursor for the next page — the last name in this page' })\n next?: string\n\n}\n\n@Resolver(RecipeDefinition)\nexport class RecipeQuery {\n /**\n * 레시피와 라우팅을 **한 질의로** 낸다.\n *\n * 따로 물으면 그 사이에 마스터가 바뀌어 레시피가 없는 라우팅을 가리키는 순간이 생긴다. 구조는\n * 서로를 가리키므로 통째로 맞아야 한다 — 마스터를 당겨 가는 다른 축과 같은 규율이다.\n */\n @Query(returns => RecipeMaster, { description: 'Recipes and routes for the twin to pull' })\n async recipeMaster(\n @Arg('after', { nullable: true, description: 'resume after this name — the previous page\\'s next' }) after: string | undefined,\n @Arg('limit', type => Int, { nullable: true, description: 'rows per page — omit only when the axis is small enough to pull whole' }) limit: number | undefined,\n @Ctx() context: ResolverContext\n ): Promise<RecipeMaster> {\n const { domain } = context.state\n\n const request = { after, limit }\n\n /*\n * **라우팅은 통째로, 레시피만 나눈다.** 레시피가 라우팅을 이름으로 가리키므로, 둘을 함께 나누면\n * 레시피가 먼저 도착하고 라우팅이 나중에 오는 순간이 생긴다 — 이 파일이 원래 「따로 물으면 레시피가\n * 없는 라우팅을 가리키는 순간이 생긴다」고 적어 둔 그 이유다.\n */\n const [effective, routes] = await Promise.all([\n listEffectiveRecipes(getRepository(RecipeDefinition).manager, domain, {\n filters: [...(after ? [{ name: 'name', operator: 'gt', value: after }] : []),\n { name: 'materialDefinitionName', operator: 'is_not_null', value: true }],\n sortings: [{ name: 'name', desc: false }], pagination: { limit: takeFor(request), page: 1 }\n } as any),\n getRepository(RouteDefinition).find({ where: { domain: { id: domain.id } }, order: { name: 'ASC' } })\n ])\n const page = pageOf(effective.items, request, row => row.name)\n\n /* 통째로 달라고 했는데 한도를 넘으면 **자르지 않고 거절한다**(§`master-page`). */\n refuseIfTooLarge('레시피', request, page)\n\n return {\n recipes: JSON.stringify(page.rows.map(toRecipeEntry)),\n routes: JSON.stringify(routes.map(toRouteEntry)),\n hasMore: page.hasMore,\n ...(page.next ? { next: page.next } : {})\n }\n }\n}\n"]}
@@ -1,32 +0,0 @@
1
- export interface RecipeLineContent {
2
- lineKey: string;
3
- material: string;
4
- qty: number;
5
- operation?: string | null;
6
- }
7
- export interface RecipeDraftContent {
8
- materialDefinitionName: string;
9
- description?: string | null;
10
- route?: string | null;
11
- inputs: RecipeLineContent[];
12
- outputs: RecipeLineContent[];
13
- effectiveFrom: Date | string;
14
- reason: string;
15
- }
16
- /** Stable signed content excludes DB row IDs; array order is meaningful. */
17
- export declare function recipeContentValues(input: Pick<RecipeDraftContent, 'materialDefinitionName' | 'description' | 'route' | 'inputs' | 'outputs'>): {
18
- materialDefinitionName: string;
19
- description: string;
20
- route: string;
21
- inputs: RecipeLineContent[];
22
- outputs: RecipeLineContent[];
23
- };
24
- export declare function readRecipeContent(input: RecipeDraftContent): {
25
- effectiveFrom: Date;
26
- reason: string;
27
- materialDefinitionName: string;
28
- description: string;
29
- route: string;
30
- inputs: RecipeLineContent[];
31
- outputs: RecipeLineContent[];
32
- };
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.recipeContentValues = recipeContentValues;
4
- exports.readRecipeContent = readRecipeContent;
5
- const shell_1 = require("@things-factory/shell");
6
- function invalid(field) {
7
- throw new shell_1.Refusal('INVALID_RECIPE_CONTENT', { field }, `Invalid recipe content: ${field}`);
8
- }
9
- function required(value, field) {
10
- if (typeof value !== 'string' || !value.trim())
11
- invalid(field);
12
- return value.trim();
13
- }
14
- /** The places a quantity column keeps (`quantityColumn`, decimal(18, 6)). */
15
- const QTY_SCALE = 6;
16
- function lines(value, side) {
17
- if (!Array.isArray(value) || !value.length)
18
- invalid(side);
19
- const keys = new Set();
20
- return value.map((line, index) => {
21
- if (!line || typeof line !== 'object')
22
- invalid(`${side}.${index}`);
23
- const lineKey = required(line.lineKey, `${side}.${index}.lineKey`);
24
- if (keys.has(lineKey))
25
- invalid(`${side}.duplicateLineKey`);
26
- keys.add(lineKey);
27
- if (typeof line.qty !== 'number' || !Number.isFinite(line.qty) || line.qty <= 0)
28
- invalid(`${side}.${index}.qty`);
29
- /* The row keeps six places and twelve before the point; a quantity it would round could not match its signature. */
30
- if (Number(line.qty.toFixed(QTY_SCALE)) !== line.qty || line.qty >= 1e12)
31
- invalid(`${side}.${index}.qty`);
32
- if (side === 'outputs' && line.operation != null)
33
- invalid('outputs.operation');
34
- return {
35
- lineKey,
36
- material: required(line.material, `${side}.${index}.material`),
37
- qty: line.qty,
38
- ...(side === 'inputs' ? { operation: line.operation == null ? null : required(line.operation, 'operation') } : {})
39
- };
40
- });
41
- }
42
- /** Stable signed content excludes DB row IDs; array order is meaningful. */
43
- function recipeContentValues(input) {
44
- const materialDefinitionName = required(input.materialDefinitionName, 'materialDefinitionName');
45
- if (input.description != null && typeof input.description !== 'string')
46
- invalid('description');
47
- const inputs = lines(input.inputs, 'inputs');
48
- const outputs = lines(input.outputs, 'outputs');
49
- if (!outputs.some(line => line.material === materialDefinitionName))
50
- invalid('primaryOutputMissing');
51
- return {
52
- materialDefinitionName,
53
- description: input.description ?? null,
54
- route: input.route == null ? null : required(input.route, 'route'),
55
- inputs,
56
- outputs
57
- };
58
- }
59
- function readRecipeContent(input) {
60
- if (!input || typeof input !== 'object')
61
- invalid('content');
62
- const from = input.effectiveFrom;
63
- if (!(from instanceof Date) && (typeof from !== 'string' || !/(Z|[+-]\d{2}:\d{2})$/.test(from)))
64
- invalid('effectiveFrom');
65
- const effectiveFrom = new Date(from);
66
- if (!Number.isFinite(effectiveFrom.getTime()))
67
- invalid('effectiveFrom');
68
- return { ...recipeContentValues(input), effectiveFrom, reason: required(input.reason, 'reason') };
69
- }
70
- //# sourceMappingURL=recipe-revision-content.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recipe-revision-content.js","sourceRoot":"","sources":["../../../server/service/recipe/recipe-revision-content.ts"],"names":[],"mappings":";;AAgDA,kDAaC;AACD,8CAOC;AArED,iDAA+C;AAiB/C,SAAS,OAAO,CAAC,KAAa;IAC5B,MAAM,IAAI,eAAO,CAAC,wBAAwB,EAAE,EAAE,KAAK,EAAE,EAAE,2BAA2B,KAAK,EAAE,CAAC,CAAA;AAC5F,CAAC;AACD,SAAS,QAAQ,CAAC,KAAc,EAAE,KAAa;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,CAAC,KAAK,CAAC,C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AAK,CAAC,KAAK,EAAE,OAAO,CAAC;QAClE,MAAM;QACN,OAAO;KACR,CAAA;AACH,CAAC;AACD,SAAgB,iBAAiB,CAAC,KAAyB;IACzD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC3D,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,CAAA;IAChC,IAAI,CAAC,CAAC,IAAI,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IACzH,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAA;IACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;QAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IACvE,OAAO,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAA;AACnG,CAAC","sourcesContent":["import { Refusal } from '@things-factory/shell'\n\nexport interface RecipeLineContent {\n lineKey: string\n material: string\n qty: number\n operation?: string | null\n}\nexport interface RecipeDraftContent {\n materialDefinitionName: string\n description?: string | null\n route?: string | null\n inputs: RecipeLineContent[]\n outputs: RecipeLineContent[]\n effectiveFrom: Date | string\n reason: string\n}\nfunction invalid(field: string): never {\n throw new Refusal('INVALID_RECIPE_CONTENT', { field }, `Invalid recipe content: ${field}`)\n}\nfunction required(value: unknown, field: string): string {\n if (typeof value !== 'string' || !value.trim()) invalid(field)\n return value.trim()\n}\n/** The places a quantity column keeps (`quantityColumn`, decimal(18, 6)). */\nconst QTY_SCALE = 6\n\nfunction lines(value: unknown, side: 'inputs' | 'outputs'): RecipeLineContent[] {\n if (!Array.isArray(value) || !value.length) invalid(side)\n const keys = new Set<string>()\n return value.map((line, index) => {\n if (!line || typeof line !== 'object') invalid(`${side}.${index}`)\n const lineKey = required(line.lineKey, `${side}.${index}.lineKey`)\n if (keys.has(lineKey)) invalid(`${side}.duplicateLineKey`)\n keys.add(lineKey)\n if (typeof line.qty !== 'number' || !Number.isFinite(line.qty) || line.qty <= 0) invalid(`${side}.${index}.qty`)\n /* The row keeps six places and twelve before the point; a quantity it would round could not match its signature. */\n if (Number(line.qty.toFixed(QTY_SCALE)) !== line.qty || line.qty >= 1e12) invalid(`${side}.${index}.qty`)\n if (side === 'outputs' && line.operation != null) invalid('outputs.operation')\n return {\n lineKey,\n material: required(line.material, `${side}.${index}.material`),\n qty: line.qty,\n ...(side === 'inputs' ? { operation: line.operation == null ? null : required(line.operation, 'operation') } : {})\n }\n })\n}\n/** Stable signed content excludes DB row IDs; array order is meaningful. */\nexport function recipeContentValues(input: Pick<RecipeDraftContent, 'materialDefinitionName' | 'description' | 'route' | 'inputs' | 'outputs'>) {\n const materialDefinitionName = required(input.materialDefinitionName, 'materialDefinitionName')\n if (input.description != null && typeof input.description !== 'string') invalid('description')\n const inputs = lines(input.inputs, 'inputs')\n const outputs = lines(input.outputs, 'outputs')\n if (!outputs.some(line => line.material === materialDefinitionName)) invalid('primaryOutputMissing')\n return {\n materialDefinitionName,\n description: input.description ?? null,\n route: input.route == null ? null : required(input.route, 'route'),\n inputs,\n outputs\n }\n}\nexport function readRecipeContent(input: RecipeDraftContent) {\n if (!input || typeof input !== 'object') invalid('content')\n const from = input.effectiveFrom\n if (!(from instanceof Date) && (typeof from !== 'string' || !/(Z|[+-]\\d{2}:\\d{2})$/.test(from))) invalid('effectiveFrom')\n const effectiveFrom = new Date(from)\n if (!Number.isFinite(effectiveFrom.getTime())) invalid('effectiveFrom')\n return { ...recipeContentValues(input), effectiveFrom, reason: required(input.reason, 'reason') }\n}\n"]}
@@ -1,30 +0,0 @@
1
- import { Domain } from '@things-factory/shell';
2
- import type { MaterialDefinition } from '../material/material-definition';
3
- import type { OperationDefinition } from '../operation/operation-definition';
4
- import type { RecipeDefinition } from './recipe-definition';
5
- import type { RecipeRevision } from './recipe-revision';
6
- /** Owned rows, not independently publishable masters. Keys survive derivation for structural diffs. */
7
- declare abstract class RecipeRevisionLine {
8
- id: string;
9
- domain: Domain;
10
- domainId: string;
11
- recipe: RecipeDefinition;
12
- recipeId: string;
13
- revision: RecipeRevision;
14
- revisionId: string;
15
- materialDefinition: MaterialDefinition;
16
- materialDefinitionId: string;
17
- /** Frozen business key: a subsequent master rename cannot rewrite signed content. */
18
- material: string;
19
- lineKey: string;
20
- position: number;
21
- qty: number;
22
- }
23
- export declare class RecipeRevisionInput extends RecipeRevisionLine {
24
- operationDefinition: OperationDefinition | null;
25
- operationDefinitionId: string | null;
26
- operation: string | null;
27
- }
28
- export declare class RecipeRevisionOutput extends RecipeRevisionLine {
29
- }
30
- export {};
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RecipeRevisionOutput = exports.RecipeRevisionInput = void 0;
4
- const tslib_1 = require("tslib");
5
- const typeorm_1 = require("typeorm");
6
- const shell_1 = require("@things-factory/shell");
7
- /** Owned rows, not independently publishable masters. Keys survive derivation for structural diffs. */
8
- class RecipeRevisionLine {
9
- }
10
- tslib_1.__decorate([
11
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
12
- tslib_1.__metadata("design:type", String)
13
- ], RecipeRevisionLine.prototype, "id", void 0);
14
- tslib_1.__decorate([
15
- (0, typeorm_1.ManyToOne)(() => shell_1.Domain, { nullable: false }),
16
- tslib_1.__metadata("design:type", shell_1.Domain)
17
- ], RecipeRevisionLine.prototype, "domain", void 0);
18
- tslib_1.__decorate([
19
- (0, typeorm_1.RelationId)((row) => row.domain),
20
- tslib_1.__metadata("design:type", String)
21
- ], RecipeRevisionLine.prototype, "domainId", void 0);
22
- tslib_1.__decorate([
23
- (0, typeorm_1.ManyToOne)('RecipeDefinition', { nullable: false, createForeignKeyConstraints: false }),
24
- tslib_1.__metadata("design:type", Function)
25
- ], RecipeRevisionLine.prototype, "recipe", void 0);
26
- tslib_1.__decorate([
27
- (0, typeorm_1.RelationId)((row) => row.recipe),
28
- tslib_1.__metadata("design:type", String)
29
- ], RecipeRevisionLine.prototype, "recipeId", void 0);
30
- tslib_1.__decorate([
31
- (0, typeorm_1.ManyToOne)('RecipeRevision', { nullable: false, createForeignKeyConstraints: false }),
32
- tslib_1.__metadata("design:type", Function)
33
- ], RecipeRevisionLine.prototype, "revision", void 0);
34
- tslib_1.__decorate([
35
- (0, typeorm_1.RelationId)((row) => row.revision),
36
- tslib_1.__metadata("design:type", String)
37
- ], RecipeRevisionLine.prototype, "revisionId", void 0);
38
- tslib_1.__decorate([
39
- (0, typeorm_1.ManyToOne)('MaterialDefinition', { nullable: false, createForeignKeyConstraints: false }),
40
- tslib_1.__metadata("design:type", Function)
41
- ], RecipeRevisionLine.prototype, "materialDefinition", void 0);
42
- tslib_1.__decorate([
43
- (0, typeorm_1.RelationId)((row) => row.materialDefinition),
44
- tslib_1.__metadata("design:type", String)
45
- ], RecipeRevisionLine.prototype, "materialDefinitionId", void 0);
46
- tslib_1.__decorate([
47
- (0, typeorm_1.Column)('varchar'),
48
- tslib_1.__metadata("design:type", String)
49
- ], RecipeRevisionLine.prototype, "material", void 0);
50
- tslib_1.__decorate([
51
- (0, typeorm_1.Column)('varchar'),
52
- tslib_1.__metadata("design:type", String)
53
- ], RecipeRevisionLine.prototype, "lineKey", void 0);
54
- tslib_1.__decorate([
55
- (0, typeorm_1.Column)('int'),
56
- tslib_1.__metadata("design:type", Number)
57
- ], RecipeRevisionLine.prototype, "position", void 0);
58
- tslib_1.__decorate([
59
- (0, typeorm_1.Column)((0, shell_1.quantityColumn)()),
60
- tslib_1.__metadata("design:type", Number)
61
- ], RecipeRevisionLine.prototype, "qty", void 0);
62
- let RecipeRevisionInput = class RecipeRevisionInput extends RecipeRevisionLine {
63
- };
64
- exports.RecipeRevisionInput = RecipeRevisionInput;
65
- tslib_1.__decorate([
66
- (0, typeorm_1.ManyToOne)('OperationDefinition', { nullable: true, createForeignKeyConstraints: false }),
67
- tslib_1.__metadata("design:type", Function)
68
- ], RecipeRevisionInput.prototype, "operationDefinition", void 0);
69
- tslib_1.__decorate([
70
- (0, typeorm_1.RelationId)((row) => row.operationDefinition),
71
- tslib_1.__metadata("design:type", String)
72
- ], RecipeRevisionInput.prototype, "operationDefinitionId", void 0);
73
- tslib_1.__decorate([
74
- (0, typeorm_1.Column)('varchar', { nullable: true }),
75
- tslib_1.__metadata("design:type", String)
76
- ], RecipeRevisionInput.prototype, "operation", void 0);
77
- exports.RecipeRevisionInput = RecipeRevisionInput = tslib_1.__decorate([
78
- (0, typeorm_1.Entity)('ops_recipe_revision_input'),
79
- (0, typeorm_1.Index)('ix_recipe_input_line', ['revision', 'lineKey'], { unique: true }),
80
- (0, typeorm_1.Index)('ix_recipe_input_position', ['revision', 'position'], { unique: true }),
81
- (0, typeorm_1.ForeignKey)('RecipeRevision', ['domain', 'recipe', 'revision'], ['domain', 'recipe', 'id'], { onDelete: 'RESTRICT' }),
82
- (0, typeorm_1.ForeignKey)('MaterialDefinition', ['domain', 'materialDefinition'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
83
- (0, typeorm_1.ForeignKey)('OperationDefinition', ['domain', 'operationDefinition'], ['domain', 'id'], { onDelete: 'RESTRICT' })
84
- ], RecipeRevisionInput);
85
- let RecipeRevisionOutput = class RecipeRevisionOutput extends RecipeRevisionLine {
86
- };
87
- exports.RecipeRevisionOutput = RecipeRevisionOutput;
88
- exports.RecipeRevisionOutput = RecipeRevisionOutput = tslib_1.__decorate([
89
- (0, typeorm_1.Entity)('ops_recipe_revision_output'),
90
- (0, typeorm_1.Index)('ix_recipe_output_line', ['revision', 'lineKey'], { unique: true }),
91
- (0, typeorm_1.Index)('ix_recipe_output_position', ['revision', 'position'], { unique: true }),
92
- (0, typeorm_1.ForeignKey)('RecipeRevision', ['domain', 'recipe', 'revision'], ['domain', 'recipe', 'id'], { onDelete: 'RESTRICT' }),
93
- (0, typeorm_1.ForeignKey)('MaterialDefinition', ['domain', 'materialDefinition'], ['domain', 'id'], { onDelete: 'RESTRICT' })
94
- ], RecipeRevisionOutput);
95
- //# sourceMappingURL=recipe-revision-line.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recipe-revision-line.js","sourceRoot":"","sources":["../../../server/service/recipe/recipe-revision-line.ts"],"names":[],"mappings":";;;;AAAA,qCAA0G;AAC1G,iDAA8D;AAM9D,uGAAuG;AACvG,MAAe,kBAAkB;CAgBhC;AAfiC;IAA/B,IAAA,gCAAsB,EAAC,MAAM,CAAC;;8CAAW;AACI;IAA7C,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;sCAAS,cAAM;kDAAA;AACP;IAApD,IAAA,oBAAU,EAAC,CAAC,GAAuB,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;;oDAAiB;AACmB;IAAvF,IAAA,mBAAS,EAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,2BAA2B,EAAE,KAAK,EAAE,CAAC;;kDAAyB;AAC3D;IAApD,IAAA,oBAAU,EAAC,CAAC,GAAuB,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;;oDAAiB;AACiB;IAArF,IAAA,mBAAS,EAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,2BAA2B,EAAE,KAAK,EAAE,CAAC;;oDAAyB;AACvD;IAAtD,IAAA,oBAAU,EAAC,CAAC,GAAuB,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;;sDAAmB;AACiB;IAAzF,IAAA,mBAAS,EAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,2BAA2B,EAAE,KAAK,EAAE,CAAC;;8DAAuC;A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AAQ,EAAE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAC9G,IAAA,oBAAU,EAAC,qBAAqB,EAAE,CAAC,QAAQ,EAAE,qBAAqB,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;GACpG,mBAAmB,CAI/B;AAOM,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,kBAAkB;CAAG,CAAA;AAAlD,oDAAoB;+BAApB,oBAAoB;IALhC,IAAA,gBAAM,EAAC,4BAA4B,CAAC;IACpC,IAAA,eAAK,EAAC,uBAAuB,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACzE,IAAA,eAAK,EAAC,2BAA2B,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC9E,IAAA,oBAAU,EAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IACpH,IAAA,oBAAU,EAAC,oBAAoB,EAAE,CAAC,QAAQ,EAAE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;GAClG,oBAAoB,CAA8B","sourcesContent":["import { Column, Entity, ForeignKey, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\nimport { Domain, quantityColumn } from '@things-factory/shell'\nimport type { MaterialDefinition } from '../material/material-definition'\nimport type { OperationDefinition } from '../operation/operation-definition'\nimport type { RecipeDefinition } from './recipe-definition'\nimport type { RecipeRevision } from './recipe-revision'\n\n/** Owned rows, not independently publishable masters. Keys survive derivation for structural diffs. */\nabstract class RecipeRevisionLine {\n @PrimaryGeneratedColumn('uuid') id: string\n @ManyToOne(() => Domain, { nullable: false }) domain: Domain\n @RelationId((row: RecipeRevisionLine) => row.domain) domainId: string\n @ManyToOne('RecipeDefinition', { nullable: false, createForeignKeyConstraints: false }) recipe: RecipeDefinition\n @RelationId((row: RecipeRevisionLine) => row.recipe) recipeId: string\n @ManyToOne('RecipeRevision', { nullable: false, createForeignKeyConstraints: false }) revision: RecipeRevision\n @RelationId((row: RecipeRevisionLine) => row.revision) revisionId: string\n @ManyToOne('MaterialDefinition', { nullable: false, createForeignKeyConstraints: false }) materialDefinition: MaterialDefinition\n @RelationId((row: RecipeRevisionLine) => row.materialDefinition) materialDefinitionId: string\n /** Frozen business key: a subsequent master rename cannot rewrite signed content. */\n @Column('varchar') material: string\n @Column('varchar') lineKey: string\n @Column('int') position: number\n /* A decimal, not 'double precision': that name is Postgres's alone, and a float does not hold 0.1 (ADR-0128). */\n @Column(quantityColumn()) qty: number\n}\n\n@Entity('ops_recipe_revision_input')\n@Index('ix_recipe_input_line', ['revision', 'lineKey'], { unique: true })\n@Index('ix_recipe_input_position', ['revision', 'position'], { unique: true })\n@ForeignKey('RecipeRevision', ['domain', 'recipe', 'revision'], ['domain', 'recipe', 'id'], { onDelete: 'RESTRICT' })\n@ForeignKey('MaterialDefinition', ['domain', 'materialDefinition'], ['domain', 'id'], { onDelete: 'RESTRICT' })\n@ForeignKey('OperationDefinition', ['domain', 'operationDefinition'], ['domain', 'id'], { onDelete: 'RESTRICT' })\nexport class RecipeRevisionInput extends RecipeRevisionLine {\n @ManyToOne('OperationDefinition', { nullable: true, createForeignKeyConstraints: false }) operationDefinition: OperationDefinition | null\n @RelationId((row: RecipeRevisionInput) => row.operationDefinition) operationDefinitionId: string | null\n @Column('varchar', { nullable: true }) operation: string | null\n}\n\n@Entity('ops_recipe_revision_output')\n@Index('ix_recipe_output_line', ['revision', 'lineKey'], { unique: true })\n@Index('ix_recipe_output_position', ['revision', 'position'], { unique: true })\n@ForeignKey('RecipeRevision', ['domain', 'recipe', 'revision'], ['domain', 'recipe', 'id'], { onDelete: 'RESTRICT' })\n@ForeignKey('MaterialDefinition', ['domain', 'materialDefinition'], ['domain', 'id'], { onDelete: 'RESTRICT' })\nexport class RecipeRevisionOutput extends RecipeRevisionLine {}\n"]}
@@ -1,65 +0,0 @@
1
- import { RecipeDefinition } from './recipe-definition';
2
- import { RecipeDraftContent } from './recipe-revision-content';
3
- export declare class RecipeRevisionResolver {
4
- publishRecipeDraft(revisionId: string, editGeneration: number, context: ResolverContext): Promise<import("./recipe-revision").RecipePlan>;
5
- recipeRevisions(recipeId: string, context: ResolverContext): Promise<{
6
- recipeId: string;
7
- name: string;
8
- generation: number;
9
- at: string;
10
- schedule: {
11
- state: string;
12
- id: string;
13
- domain: import("@things-factory/shell").Domain;
14
- domainId: string;
15
- recipe: RecipeDefinition;
16
- recipeId: string;
17
- plan: import("./recipe-revision").RecipePlan;
18
- planId: string;
19
- revision: import("./recipe-revision").RecipeRevision;
20
- revisionId: string;
21
- validFrom: Date;
22
- validTo: Date | null;
23
- }[];
24
- revisions: {
25
- inputs: import("./recipe-revision-line").RecipeRevisionInput[];
26
- outputs: import("./recipe-revision-line").RecipeRevisionOutput[];
27
- state: string;
28
- releaseKind: import("..").ReleaseKind;
29
- revisionNumber: number;
30
- policy: import("..").MasterChangePolicy;
31
- policyId: string;
32
- id: string;
33
- domain: import("@things-factory/shell").Domain;
34
- domainId: string;
35
- recipe: RecipeDefinition;
36
- recipeId: string;
37
- baseRevision: import("./recipe-revision").RecipeRevision | null;
38
- baseRevisionId: string | null;
39
- baseGeneration: number;
40
- editGeneration: number;
41
- description: string | null;
42
- materialDefinitionName: string;
43
- primaryMaterial: import("..").MaterialDefinition;
44
- primaryMaterialId: string;
45
- routeDefinition: import("./route-definition").RouteDefinition | null;
46
- routeDefinitionId: string | null;
47
- route: string | null;
48
- effectiveFrom: Date;
49
- reason: string;
50
- creator: import("@things-factory/auth-base").User | null;
51
- creatorId: string | null;
52
- createdAt: Date;
53
- frozenAt: Date | null;
54
- contentHash: string | null;
55
- activityInstanceId: string | null;
56
- }[];
57
- }>;
58
- createRecipeDraft(content: RecipeDraftContent, recipeId: string, name: string, baseRevisionId: string, context: ResolverContext): Promise<import("./recipe-revision").RecipeRevision>;
59
- editRecipeDraft(revisionId: string, editGeneration: number, content: RecipeDraftContent, context: ResolverContext): Promise<import("./recipe-revision").RecipeRevision>;
60
- /** 비규제 사업장의 저장 한 번 — 초안과 발행이 한 트랜잭션이다. 승인제면 거절되고 아무것도 안 남는다. */
61
- saveAndPublishRecipe(content: RecipeDraftContent, recipeId: string, name: string, baseRevisionId: string, revisionId: string, editGeneration: number, context: ResolverContext): Promise<{
62
- revision: import("./recipe-revision").RecipeRevision;
63
- plan: import("./recipe-revision").RecipePlan;
64
- }>;
65
- }
@@ -1,96 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RecipeRevisionResolver = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const shell_1 = require("@things-factory/shell");
7
- const recipe_definition_1 = require("./recipe-definition");
8
- const recipe_revision_service_1 = require("./recipe-revision-service");
9
- let RecipeRevisionResolver = class RecipeRevisionResolver {
10
- async publishRecipeDraft(revisionId, editGeneration, context) {
11
- const { tx, domain, user } = context.state;
12
- return (0, recipe_revision_service_1.publishUnregulatedRecipe)(tx, domain.id, user.id, revisionId, editGeneration);
13
- }
14
- async recipeRevisions(recipeId, context) {
15
- return (0, recipe_revision_service_1.recipeRevisionOverview)((0, shell_1.getRepository)(recipe_definition_1.RecipeDefinition).manager, context.state.domain.id, recipeId);
16
- }
17
- async createRecipeDraft(content, recipeId, name, baseRevisionId, context) {
18
- const { tx, domain, user } = context.state;
19
- return (0, recipe_revision_service_1.createRecipeDraft)(tx, domain.id, user.id, { recipeId, name, baseRevisionId, content });
20
- }
21
- async editRecipeDraft(revisionId, editGeneration, content, context) {
22
- const { tx, domain, user } = context.state;
23
- return (0, recipe_revision_service_1.editRecipeDraft)(tx, domain.id, user.id, revisionId, editGeneration, content);
24
- }
25
- /** 비규제 사업장의 저장 한 번 — 초안과 발행이 한 트랜잭션이다. 승인제면 거절되고 아무것도 안 남는다. */
26
- async saveAndPublishRecipe(content, recipeId, name, baseRevisionId, revisionId, editGeneration, context) {
27
- const { tx, domain, user } = context.state;
28
- return (0, recipe_revision_service_1.saveAndPublishRecipe)(tx, domain.id, user.id, { recipeId, name, baseRevisionId, content, revisionId, editGeneration });
29
- }
30
- };
31
- exports.RecipeRevisionResolver = RecipeRevisionResolver;
32
- tslib_1.__decorate([
33
- (0, type_graphql_1.Directive)('@privilege(category: "ops-master", privilege: "mutation", domainOwnerGranted: true)'),
34
- (0, type_graphql_1.Directive)('@transaction'),
35
- (0, type_graphql_1.Mutation)(() => shell_1.ScalarObject),
36
- tslib_1.__param(0, (0, type_graphql_1.Arg)('revisionId')),
37
- tslib_1.__param(1, (0, type_graphql_1.Arg)('editGeneration', () => type_graphql_1.Int)),
38
- tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
39
- tslib_1.__metadata("design:type", Function),
40
- tslib_1.__metadata("design:paramtypes", [String, Number, Object]),
41
- tslib_1.__metadata("design:returntype", Promise)
42
- ], RecipeRevisionResolver.prototype, "publishRecipeDraft", null);
43
- tslib_1.__decorate([
44
- (0, type_graphql_1.Directive)('@privilege(category: "ops-master", privilege: "query", domainOwnerGranted: true)'),
45
- (0, type_graphql_1.Query)(() => shell_1.ScalarObject),
46
- tslib_1.__param(0, (0, type_graphql_1.Arg)('recipeId')),
47
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
48
- tslib_1.__metadata("design:type", Function),
49
- tslib_1.__metadata("design:paramtypes", [String, Object]),
50
- tslib_1.__metadata("design:returntype", Promise)
51
- ], RecipeRevisionResolver.prototype, "recipeRevisions", null);
52
- tslib_1.__decorate([
53
- (0, type_graphql_1.Directive)('@privilege(category: "ops-master", privilege: "mutation", domainOwnerGranted: true)'),
54
- (0, type_graphql_1.Directive)('@transaction'),
55
- (0, type_graphql_1.Mutation)(() => shell_1.ScalarObject),
56
- tslib_1.__param(0, (0, type_graphql_1.Arg)('content', () => shell_1.ScalarObject)),
57
- tslib_1.__param(1, (0, type_graphql_1.Arg)('recipeId', () => String, { nullable: true })),
58
- tslib_1.__param(2, (0, type_graphql_1.Arg)('name', () => String, { nullable: true })),
59
- tslib_1.__param(3, (0, type_graphql_1.Arg)('baseRevisionId', () => String, { nullable: true })),
60
- tslib_1.__param(4, (0, type_graphql_1.Ctx)()),
61
- tslib_1.__metadata("design:type", Function),
62
- tslib_1.__metadata("design:paramtypes", [Object, String, String, String, Object]),
63
- tslib_1.__metadata("design:returntype", Promise)
64
- ], RecipeRevisionResolver.prototype, "createRecipeDraft", null);
65
- tslib_1.__decorate([
66
- (0, type_graphql_1.Directive)('@privilege(category: "ops-master", privilege: "mutation", domainOwnerGranted: true)'),
67
- (0, type_graphql_1.Directive)('@transaction'),
68
- (0, type_graphql_1.Mutation)(() => shell_1.ScalarObject),
69
- tslib_1.__param(0, (0, type_graphql_1.Arg)('revisionId')),
70
- tslib_1.__param(1, (0, type_graphql_1.Arg)('editGeneration', () => type_graphql_1.Int)),
71
- tslib_1.__param(2, (0, type_graphql_1.Arg)('content', () => shell_1.ScalarObject)),
72
- tslib_1.__param(3, (0, type_graphql_1.Ctx)()),
73
- tslib_1.__metadata("design:type", Function),
74
- tslib_1.__metadata("design:paramtypes", [String, Number, Object, Object]),
75
- tslib_1.__metadata("design:returntype", Promise)
76
- ], RecipeRevisionResolver.prototype, "editRecipeDraft", null);
77
- tslib_1.__decorate([
78
- (0, type_graphql_1.Directive)('@privilege(category: "ops-master", privilege: "mutation", domainOwnerGranted: true)'),
79
- (0, type_graphql_1.Directive)('@transaction'),
80
- (0, type_graphql_1.Mutation)(() => shell_1.ScalarObject),
81
- tslib_1.__param(0, (0, type_graphql_1.Arg)('content', () => shell_1.ScalarObject)),
82
- tslib_1.__param(1, (0, type_graphql_1.Arg)('recipeId', () => String, { nullable: true })),
83
- tslib_1.__param(2, (0, type_graphql_1.Arg)('name', () => String, { nullable: true })),
84
- tslib_1.__param(3, (0, type_graphql_1.Arg)('baseRevisionId', () => String, { nullable: true })),
85
- tslib_1.__param(4, (0, type_graphql_1.Arg)('revisionId', () => String, { nullable: true })),
86
- tslib_1.__param(5, (0, type_graphql_1.Arg)('editGeneration', () => type_graphql_1.Int, { nullable: true })),
87
- tslib_1.__param(6, (0, type_graphql_1.Ctx)()),
88
- tslib_1.__metadata("design:type", Function),
89
- tslib_1.__metadata("design:paramtypes", [Object, String, String, String, String, Number, Object]),
90
- tslib_1.__metadata("design:returntype", Promise)
91
- ], RecipeRevisionResolver.prototype, "saveAndPublishRecipe", null);
92
- exports.RecipeRevisionResolver = RecipeRevisionResolver = tslib_1.__decorate([
93
- (0, type_graphql_1.Resolver)(),
94
- (0, type_graphql_1.UseMiddleware)(shell_1.SpeakRefusals)
95
- ], RecipeRevisionResolver);
96
- //# sourceMappingURL=recipe-revision-resolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recipe-revision-resolver.js","sourceRoot":"","sources":["../../../server/service/recipe/recipe-revision-resolver.ts"],"names":[],"mappings":";;;;AAAA,+CAAiG;AACjG,iDAAkF;AAClF,2DAAsD;AACtD,uEAAsJ;AAM/I,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAI3B,AAAN,KAAK,CAAC,kBAAkB,CAAoB,UAAkB,EAAoC,cAAsB,EAAS,OAAwB;QACvJ,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAC1C,OAAO,IAAA,kDAAwB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,UAAU,EAAE,cAAc,CAAC,CAAA;IACrF,CAAC;IAGK,AAAN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AAI,EAAE,CAAC,CAAA;IACpD,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;kEAIP;iCAxDU,sBAAsB;IAFlC,IAAA,uBAAQ,GAAE;IACV,IAAA,4BAAa,EAAC,qBAAa,CAAC;GAChB,sBAAsB,CAyDlC","sourcesContent":["import { Arg, Ctx, Directive, Int, Mutation, Query, Resolver, UseMiddleware } from 'type-graphql'\nimport { getRepository, ScalarObject, SpeakRefusals } from '@things-factory/shell'\nimport { RecipeDefinition } from './recipe-definition'\nimport { saveAndPublishRecipe, createRecipeDraft, editRecipeDraft, publishUnregulatedRecipe, recipeRevisionOverview } from './recipe-revision-service'\n\nimport { RecipeDraftContent } from './recipe-revision-content'\n\n@Resolver()\n@UseMiddleware(SpeakRefusals)\nexport class RecipeRevisionResolver {\n @Directive('@privilege(category: \"ops-master\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(() => ScalarObject)\n async publishRecipeDraft(@Arg('revisionId') revisionId: string, @Arg('editGeneration', () => Int) editGeneration: number, @Ctx() context: ResolverContext) {\n const { tx, domain, user } = context.state\n return publishUnregulatedRecipe(tx, domain.id, user.id, revisionId, editGeneration)\n }\n @Directive('@privilege(category: \"ops-master\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(() => ScalarObject)\n async recipeRevisions(@Arg('recipeId') recipeId: string, @Ctx() context: ResolverContext) {\n return recipeRevisionOverview(getRepository(RecipeDefinition).manager, context.state.domain.id, recipeId)\n }\n\n @Directive('@privilege(category: \"ops-master\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(() => ScalarObject)\n async createRecipeDraft(\n @Arg('content', () => ScalarObject) content: RecipeDraftContent,\n @Arg('recipeId', () => String, { nullable: true }) recipeId: string,\n @Arg('name', () => String, { nullable: true }) name: string,\n @Arg('baseRevisionId', () => String, { nullable: true }) baseRevisionId: string,\n @Ctx() context: ResolverContext\n ) {\n const { tx, domain, user } = context.state\n return createRecipeDraft(tx, domain.id, user.id, { recipeId, name, baseRevisionId, content })\n }\n\n @Directive('@privilege(category: \"ops-master\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(() => ScalarObject)\n async editRecipeDraft(\n @Arg('revisionId') revisionId: string,\n @Arg('editGeneration', () => Int) editGeneration: number,\n @Arg('content', () => ScalarObject) content: RecipeDraftContent,\n @Ctx() context: ResolverContext\n ) {\n const { tx, domain, user } = context.state\n return editRecipeDraft(tx, domain.id, user.id, revisionId, editGeneration, content)\n }\n\n /** 비규제 사업장의 저장 한 번 — 초안과 발행이 한 트랜잭션이다. 승인제면 거절되고 아무것도 안 남는다. */\n @Directive('@privilege(category: \"ops-master\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(() => ScalarObject)\n async saveAndPublishRecipe(\n @Arg('content', () => ScalarObject) content: RecipeDraftContent,\n @Arg('recipeId', () => String, { nullable: true }) recipeId: string,\n @Arg('name', () => String, { nullable: true }) name: string,\n @Arg('baseRevisionId', () => String, { nullable: true }) baseRevisionId: string,\n @Arg('revisionId', () => String, { nullable: true }) revisionId: string,\n @Arg('editGeneration', () => Int, { nullable: true }) editGeneration: number,\n @Ctx() context: ResolverContext\n ) {\n const { tx, domain, user } = context.state\n return saveAndPublishRecipe(tx, domain.id, user.id, { recipeId, name, baseRevisionId, content, revisionId, editGeneration })\n }\n}\n"]}