@things-factory/ops-master 10.1.248 → 10.1.250

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/dist-client/bootstrap.d.ts +19 -0
  2. package/dist-client/bootstrap.js +66 -0
  3. package/dist-client/bootstrap.js.map +1 -0
  4. package/dist-client/index.d.ts +17 -0
  5. package/dist-client/index.js +21 -0
  6. package/dist-client/index.js.map +1 -0
  7. package/dist-client/master-change-approval.d.ts +14 -0
  8. package/dist-client/master-change-approval.js +36 -0
  9. package/dist-client/master-change-approval.js.map +1 -0
  10. package/dist-client/master-change-policy-axes.d.ts +37 -0
  11. package/dist-client/master-change-policy-axes.js +29 -0
  12. package/dist-client/master-change-policy-axes.js.map +1 -0
  13. package/dist-client/master-change-policy-panel.d.ts +59 -0
  14. package/dist-client/master-change-policy-panel.js +454 -0
  15. package/dist-client/master-change-policy-panel.js.map +1 -0
  16. package/dist-client/master-change-providers.d.ts +4 -0
  17. package/dist-client/master-change-providers.js +91 -0
  18. package/dist-client/master-change-providers.js.map +1 -0
  19. package/dist-client/pages/master/applied-when-dialog.d.ts +48 -0
  20. package/dist-client/pages/master/applied-when-dialog.js +137 -0
  21. package/dist-client/pages/master/applied-when-dialog.js.map +1 -0
  22. package/dist-client/pages/master/assignment-fields.d.ts +27 -0
  23. package/dist-client/pages/master/assignment-fields.js +62 -0
  24. package/dist-client/pages/master/assignment-fields.js.map +1 -0
  25. package/dist-client/pages/master/equipment-class.d.ts +12 -0
  26. package/dist-client/pages/master/equipment-class.js +42 -0
  27. package/dist-client/pages/master/equipment-class.js.map +1 -0
  28. package/dist-client/pages/master/equipment.d.ts +12 -0
  29. package/dist-client/pages/master/equipment.js +58 -0
  30. package/dist-client/pages/master/equipment.js.map +1 -0
  31. package/dist-client/pages/master/grist-iso-duration.d.ts +20 -0
  32. package/dist-client/pages/master/grist-iso-duration.js +70 -0
  33. package/dist-client/pages/master/grist-iso-duration.js.map +1 -0
  34. package/dist-client/pages/master/grist-reference.d.ts +91 -0
  35. package/dist-client/pages/master/grist-reference.js +419 -0
  36. package/dist-client/pages/master/grist-reference.js.map +1 -0
  37. package/dist-client/pages/master/import-rows.d.ts +35 -0
  38. package/dist-client/pages/master/import-rows.js +66 -0
  39. package/dist-client/pages/master/import-rows.js.map +1 -0
  40. package/dist-client/pages/master/iso-duration.d.ts +34 -0
  41. package/dist-client/pages/master/iso-duration.js +76 -0
  42. package/dist-client/pages/master/iso-duration.js.map +1 -0
  43. package/dist-client/pages/master/master-options.d.ts +40 -0
  44. package/dist-client/pages/master/master-options.js +54 -0
  45. package/dist-client/pages/master/master-options.js.map +1 -0
  46. package/dist-client/pages/master/master-page-base.d.ts +369 -0
  47. package/dist-client/pages/master/master-page-base.js +657 -0
  48. package/dist-client/pages/master/master-page-base.js.map +1 -0
  49. package/dist-client/pages/master/material-class.d.ts +12 -0
  50. package/dist-client/pages/master/material-class.js +42 -0
  51. package/dist-client/pages/master/material-class.js.map +1 -0
  52. package/dist-client/pages/master/material-definition.d.ts +5 -0
  53. package/dist-client/pages/master/material-definition.js +14 -0
  54. package/dist-client/pages/master/material-definition.js.map +1 -0
  55. package/dist-client/pages/master/material-revision-fields.d.ts +2 -0
  56. package/dist-client/pages/master/material-revision-fields.js +43 -0
  57. package/dist-client/pages/master/material-revision-fields.js.map +1 -0
  58. package/dist-client/pages/master/operation-definition.d.ts +12 -0
  59. package/dist-client/pages/master/operation-definition.js +49 -0
  60. package/dist-client/pages/master/operation-definition.js.map +1 -0
  61. package/dist-client/pages/master/operational-location.d.ts +84 -0
  62. package/dist-client/pages/master/operational-location.js +432 -0
  63. package/dist-client/pages/master/operational-location.js.map +1 -0
  64. package/dist-client/pages/master/person.d.ts +12 -0
  65. package/dist-client/pages/master/person.js +41 -0
  66. package/dist-client/pages/master/person.js.map +1 -0
  67. package/dist-client/pages/master/personnel-class.d.ts +12 -0
  68. package/dist-client/pages/master/personnel-class.js +43 -0
  69. package/dist-client/pages/master/personnel-class.js.map +1 -0
  70. package/dist-client/pages/master/physical-asset-class.d.ts +12 -0
  71. package/dist-client/pages/master/physical-asset-class.js +40 -0
  72. package/dist-client/pages/master/physical-asset-class.js.map +1 -0
  73. package/dist-client/pages/master/physical-asset.d.ts +12 -0
  74. package/dist-client/pages/master/physical-asset.js +41 -0
  75. package/dist-client/pages/master/physical-asset.js.map +1 -0
  76. package/dist-client/pages/master/recipe-definition.d.ts +5 -0
  77. package/dist-client/pages/master/recipe-definition.js +14 -0
  78. package/dist-client/pages/master/recipe-definition.js.map +1 -0
  79. package/dist-client/pages/master/reference-targets.d.ts +42 -0
  80. package/dist-client/pages/master/reference-targets.js +82 -0
  81. package/dist-client/pages/master/reference-targets.js.map +1 -0
  82. package/dist-client/pages/master/revision-comparison.d.ts +49 -0
  83. package/dist-client/pages/master/revision-comparison.js +560 -0
  84. package/dist-client/pages/master/revision-comparison.js.map +1 -0
  85. package/dist-client/pages/master/revision-view.d.ts +34 -0
  86. package/dist-client/pages/master/revision-view.js +145 -0
  87. package/dist-client/pages/master/revision-view.js.map +1 -0
  88. package/dist-client/pages/master/revision-workspace.d.ts +50 -0
  89. package/dist-client/pages/master/revision-workspace.js +763 -0
  90. package/dist-client/pages/master/revision-workspace.js.map +1 -0
  91. package/dist-client/pages/master/route-definition.d.ts +19 -0
  92. package/dist-client/pages/master/route-definition.js +40 -0
  93. package/dist-client/pages/master/route-definition.js.map +1 -0
  94. package/dist-client/pages/master/stop-reason.d.ts +12 -0
  95. package/dist-client/pages/master/stop-reason.js +48 -0
  96. package/dist-client/pages/master/stop-reason.js.map +1 -0
  97. package/dist-client/pages/master/test-specification.d.ts +5 -0
  98. package/dist-client/pages/master/test-specification.js +14 -0
  99. package/dist-client/pages/master/test-specification.js.map +1 -0
  100. package/dist-client/pages/master-axes.d.ts +24 -0
  101. package/dist-client/pages/master-axes.js +39 -0
  102. package/dist-client/pages/master-axes.js.map +1 -0
  103. package/dist-client/route.d.ts +1 -0
  104. package/dist-client/route.js +81 -0
  105. package/dist-client/route.js.map +1 -0
  106. package/dist-client/tsconfig.tsbuildinfo +1 -0
  107. package/dist-server/index.d.ts +1 -0
  108. package/dist-server/index.js +19 -0
  109. package/dist-server/index.js.map +1 -0
  110. package/dist-server/service/ai-entry/master-entry-rules.d.ts +175 -0
  111. package/dist-server/service/ai-entry/master-entry-rules.js +302 -0
  112. package/dist-server/service/ai-entry/master-entry-rules.js.map +1 -0
  113. package/dist-server/service/ai-entry/master-entry-targets.d.ts +23 -0
  114. package/dist-server/service/ai-entry/master-entry-targets.js +293 -0
  115. package/dist-server/service/ai-entry/master-entry-targets.js.map +1 -0
  116. package/dist-server/service/approval-route.d.ts +37 -0
  117. package/dist-server/service/approval-route.js +34 -0
  118. package/dist-server/service/approval-route.js.map +1 -0
  119. package/dist-server/service/asset/asset-lifecycle.d.ts +106 -0
  120. package/dist-server/service/asset/asset-lifecycle.js +126 -0
  121. package/dist-server/service/asset/asset-lifecycle.js.map +1 -0
  122. package/dist-server/service/asset/asset-master-resolver.d.ts +53 -0
  123. package/dist-server/service/asset/asset-master-resolver.js +185 -0
  124. package/dist-server/service/asset/asset-master-resolver.js.map +1 -0
  125. package/dist-server/service/asset/asset-master.d.ts +21 -0
  126. package/dist-server/service/asset/asset-master.js +25 -0
  127. package/dist-server/service/asset/asset-master.js.map +1 -0
  128. package/dist-server/service/asset/asset-query.d.ts +16 -0
  129. package/dist-server/service/asset/asset-query.js +72 -0
  130. package/dist-server/service/asset/asset-query.js.map +1 -0
  131. package/dist-server/service/asset/index.d.ts +6 -0
  132. package/dist-server/service/asset/index.js +10 -0
  133. package/dist-server/service/asset/index.js.map +1 -0
  134. package/dist-server/service/asset/physical-asset-class.d.ts +34 -0
  135. package/dist-server/service/asset/physical-asset-class.js +104 -0
  136. package/dist-server/service/asset/physical-asset-class.js.map +1 -0
  137. package/dist-server/service/asset/physical-asset.d.ts +66 -0
  138. package/dist-server/service/asset/physical-asset.js +123 -0
  139. package/dist-server/service/asset/physical-asset.js.map +1 -0
  140. package/dist-server/service/assignment/applied-when.d.ts +24 -0
  141. package/dist-server/service/assignment/applied-when.js +16 -0
  142. package/dist-server/service/assignment/applied-when.js.map +1 -0
  143. package/dist-server/service/assignment/assignment-history.d.ts +92 -0
  144. package/dist-server/service/assignment/assignment-history.js +289 -0
  145. package/dist-server/service/assignment/assignment-history.js.map +1 -0
  146. package/dist-server/service/assignment/assignment-write.d.ts +42 -0
  147. package/dist-server/service/assignment/assignment-write.js +101 -0
  148. package/dist-server/service/assignment/assignment-write.js.map +1 -0
  149. package/dist-server/service/assignment/master-value-claim.d.ts +135 -0
  150. package/dist-server/service/assignment/master-value-claim.js +174 -0
  151. package/dist-server/service/assignment/master-value-claim.js.map +1 -0
  152. package/dist-server/service/equipment/equipment-class.d.ts +34 -0
  153. package/dist-server/service/equipment/equipment-class.js +104 -0
  154. package/dist-server/service/equipment/equipment-class.js.map +1 -0
  155. package/dist-server/service/equipment/equipment-master-resolver.d.ts +77 -0
  156. package/dist-server/service/equipment/equipment-master-resolver.js +266 -0
  157. package/dist-server/service/equipment/equipment-master-resolver.js.map +1 -0
  158. package/dist-server/service/equipment/equipment-master.d.ts +30 -0
  159. package/dist-server/service/equipment/equipment-master.js +53 -0
  160. package/dist-server/service/equipment/equipment-master.js.map +1 -0
  161. package/dist-server/service/equipment/equipment-query.d.ts +16 -0
  162. package/dist-server/service/equipment/equipment-query.js +72 -0
  163. package/dist-server/service/equipment/equipment-query.js.map +1 -0
  164. package/dist-server/service/equipment/equipment.d.ts +71 -0
  165. package/dist-server/service/equipment/equipment.js +138 -0
  166. package/dist-server/service/equipment/equipment.js.map +1 -0
  167. package/dist-server/service/equipment/index.d.ts +8 -0
  168. package/dist-server/service/equipment/index.js +12 -0
  169. package/dist-server/service/equipment/index.js.map +1 -0
  170. package/dist-server/service/equipment/state-period-rules.d.ts +95 -0
  171. package/dist-server/service/equipment/state-period-rules.js +122 -0
  172. package/dist-server/service/equipment/state-period-rules.js.map +1 -0
  173. package/dist-server/service/equipment/stop-reason-query.d.ts +11 -0
  174. package/dist-server/service/equipment/stop-reason-query.js +39 -0
  175. package/dist-server/service/equipment/stop-reason-query.js.map +1 -0
  176. package/dist-server/service/equipment/stop-reason.d.ts +58 -0
  177. package/dist-server/service/equipment/stop-reason.js +114 -0
  178. package/dist-server/service/equipment/stop-reason.js.map +1 -0
  179. package/dist-server/service/index.d.ts +82 -0
  180. package/dist-server/service/index.js +145 -0
  181. package/dist-server/service/index.js.map +1 -0
  182. package/dist-server/service/location/index.d.ts +5 -0
  183. package/dist-server/service/location/index.js +9 -0
  184. package/dist-server/service/location/index.js.map +1 -0
  185. package/dist-server/service/location/location-master-resolver.d.ts +60 -0
  186. package/dist-server/service/location/location-master-resolver.js +313 -0
  187. package/dist-server/service/location/location-master-resolver.js.map +1 -0
  188. package/dist-server/service/location/location-master.d.ts +26 -0
  189. package/dist-server/service/location/location-master.js +28 -0
  190. package/dist-server/service/location/location-master.js.map +1 -0
  191. package/dist-server/service/location/location-query.d.ts +15 -0
  192. package/dist-server/service/location/location-query.js +56 -0
  193. package/dist-server/service/location/location-query.js.map +1 -0
  194. package/dist-server/service/location/operational-location.d.ts +116 -0
  195. package/dist-server/service/location/operational-location.js +157 -0
  196. package/dist-server/service/location/operational-location.js.map +1 -0
  197. package/dist-server/service/master-axis.d.ts +40 -0
  198. package/dist-server/service/master-axis.js +57 -0
  199. package/dist-server/service/master-axis.js.map +1 -0
  200. package/dist-server/service/master-change-approval/approval-input.d.ts +17 -0
  201. package/dist-server/service/master-change-approval/approval-input.js +35 -0
  202. package/dist-server/service/master-change-approval/approval-input.js.map +1 -0
  203. package/dist-server/service/master-change-approval/builtin-axes.d.ts +4 -0
  204. package/dist-server/service/master-change-approval/builtin-axes.js +96 -0
  205. package/dist-server/service/master-change-approval/builtin-axes.js.map +1 -0
  206. package/dist-server/service/master-change-approval/index.d.ts +14 -0
  207. package/dist-server/service/master-change-approval/index.js +37 -0
  208. package/dist-server/service/master-change-approval/index.js.map +1 -0
  209. package/dist-server/service/master-change-approval/master-change-axis.d.ts +54 -0
  210. package/dist-server/service/master-change-approval/master-change-axis.js +17 -0
  211. package/dist-server/service/master-change-approval/master-change-axis.js.map +1 -0
  212. package/dist-server/service/master-change-approval/master-change-flow.d.ts +65 -0
  213. package/dist-server/service/master-change-approval/master-change-flow.js +125 -0
  214. package/dist-server/service/master-change-approval/master-change-flow.js.map +1 -0
  215. package/dist-server/service/master-change-approval/master-change-resolver.d.ts +18 -0
  216. package/dist-server/service/master-change-approval/master-change-resolver.js +58 -0
  217. package/dist-server/service/master-change-approval/master-change-resolver.js.map +1 -0
  218. package/dist-server/service/master-change-policy.d.ts +122 -0
  219. package/dist-server/service/master-change-policy.js +304 -0
  220. package/dist-server/service/master-change-policy.js.map +1 -0
  221. package/dist-server/service/master-conformance-resolver.d.ts +34 -0
  222. package/dist-server/service/master-conformance-resolver.js +153 -0
  223. package/dist-server/service/master-conformance-resolver.js.map +1 -0
  224. package/dist-server/service/master-conformance.d.ts +80 -0
  225. package/dist-server/service/master-conformance.js +266 -0
  226. package/dist-server/service/master-conformance.js.map +1 -0
  227. package/dist-server/service/master-crud.d.ts +55 -0
  228. package/dist-server/service/master-crud.js +93 -0
  229. package/dist-server/service/master-crud.js.map +1 -0
  230. package/dist-server/service/master-list.d.ts +12 -0
  231. package/dist-server/service/master-list.js +30 -0
  232. package/dist-server/service/master-list.js.map +1 -0
  233. package/dist-server/service/master-page-query.d.ts +33 -0
  234. package/dist-server/service/master-page-query.js +55 -0
  235. package/dist-server/service/master-page-query.js.map +1 -0
  236. package/dist-server/service/master-page.d.ts +85 -0
  237. package/dist-server/service/master-page.js +104 -0
  238. package/dist-server/service/master-page.js.map +1 -0
  239. package/dist-server/service/material/index.d.ts +7 -0
  240. package/dist-server/service/material/index.js +12 -0
  241. package/dist-server/service/material/index.js.map +1 -0
  242. package/dist-server/service/material/material-axis-status.d.ts +8 -0
  243. package/dist-server/service/material/material-axis-status.js +19 -0
  244. package/dist-server/service/material/material-axis-status.js.map +1 -0
  245. package/dist-server/service/material/material-class.d.ts +34 -0
  246. package/dist-server/service/material/material-class.js +104 -0
  247. package/dist-server/service/material/material-class.js.map +1 -0
  248. package/dist-server/service/material/material-definition.d.ts +45 -0
  249. package/dist-server/service/material/material-definition.js +125 -0
  250. package/dist-server/service/material/material-definition.js.map +1 -0
  251. package/dist-server/service/material/material-effective-list.d.ts +39 -0
  252. package/dist-server/service/material/material-effective-list.js +54 -0
  253. package/dist-server/service/material/material-effective-list.js.map +1 -0
  254. package/dist-server/service/material/material-master-resolver.d.ts +106 -0
  255. package/dist-server/service/material/material-master-resolver.js +351 -0
  256. package/dist-server/service/material/material-master-resolver.js.map +1 -0
  257. package/dist-server/service/material/material-master.d.ts +9 -0
  258. package/dist-server/service/material/material-master.js +24 -0
  259. package/dist-server/service/material/material-master.js.map +1 -0
  260. package/dist-server/service/material/material-query.d.ts +16 -0
  261. package/dist-server/service/material/material-query.js +79 -0
  262. package/dist-server/service/material/material-query.js.map +1 -0
  263. package/dist-server/service/material/material-revision-content.d.ts +10 -0
  264. package/dist-server/service/material/material-revision-content.js +92 -0
  265. package/dist-server/service/material/material-revision-content.js.map +1 -0
  266. package/dist-server/service/material/material-revision-resolver.d.ts +60 -0
  267. package/dist-server/service/material/material-revision-resolver.js +96 -0
  268. package/dist-server/service/material/material-revision-resolver.js.map +1 -0
  269. package/dist-server/service/material/material-revision-service.d.ts +179 -0
  270. package/dist-server/service/material/material-revision-service.js +687 -0
  271. package/dist-server/service/material/material-revision-service.js.map +1 -0
  272. package/dist-server/service/material/material-revision.d.ts +86 -0
  273. package/dist-server/service/material/material-revision.js +339 -0
  274. package/dist-server/service/material/material-revision.js.map +1 -0
  275. package/dist-server/service/material/recipe-index.d.ts +23 -0
  276. package/dist-server/service/material/recipe-index.js +44 -0
  277. package/dist-server/service/material/recipe-index.js.map +1 -0
  278. package/dist-server/service/operation/index.d.ts +6 -0
  279. package/dist-server/service/operation/index.js +10 -0
  280. package/dist-server/service/operation/index.js.map +1 -0
  281. package/dist-server/service/operation/operation-definition.d.ts +52 -0
  282. package/dist-server/service/operation/operation-definition.js +143 -0
  283. package/dist-server/service/operation/operation-definition.js.map +1 -0
  284. package/dist-server/service/operation/operation-master-resolver.d.ts +52 -0
  285. package/dist-server/service/operation/operation-master-resolver.js +187 -0
  286. package/dist-server/service/operation/operation-master-resolver.js.map +1 -0
  287. package/dist-server/service/operation/operation-master.d.ts +21 -0
  288. package/dist-server/service/operation/operation-master.js +28 -0
  289. package/dist-server/service/operation/operation-master.js.map +1 -0
  290. package/dist-server/service/operation/operation-query.d.ts +15 -0
  291. package/dist-server/service/operation/operation-query.js +56 -0
  292. package/dist-server/service/operation/operation-query.js.map +1 -0
  293. package/dist-server/service/operation/operation-readiness-resolver.d.ts +39 -0
  294. package/dist-server/service/operation/operation-readiness-resolver.js +111 -0
  295. package/dist-server/service/operation/operation-readiness-resolver.js.map +1 -0
  296. package/dist-server/service/operation/operation-readiness.d.ts +34 -0
  297. package/dist-server/service/operation/operation-readiness.js +133 -0
  298. package/dist-server/service/operation/operation-readiness.js.map +1 -0
  299. package/dist-server/service/personnel/index.d.ts +6 -0
  300. package/dist-server/service/personnel/index.js +10 -0
  301. package/dist-server/service/personnel/index.js.map +1 -0
  302. package/dist-server/service/personnel/person.d.ts +51 -0
  303. package/dist-server/service/personnel/person.js +119 -0
  304. package/dist-server/service/personnel/person.js.map +1 -0
  305. package/dist-server/service/personnel/personnel-class-readiness.d.ts +22 -0
  306. package/dist-server/service/personnel/personnel-class-readiness.js +98 -0
  307. package/dist-server/service/personnel/personnel-class-readiness.js.map +1 -0
  308. package/dist-server/service/personnel/personnel-class.d.ts +54 -0
  309. package/dist-server/service/personnel/personnel-class.js +114 -0
  310. package/dist-server/service/personnel/personnel-class.js.map +1 -0
  311. package/dist-server/service/personnel/personnel-master-resolver.d.ts +53 -0
  312. package/dist-server/service/personnel/personnel-master-resolver.js +187 -0
  313. package/dist-server/service/personnel/personnel-master-resolver.js.map +1 -0
  314. package/dist-server/service/personnel/personnel-master.d.ts +39 -0
  315. package/dist-server/service/personnel/personnel-master.js +34 -0
  316. package/dist-server/service/personnel/personnel-master.js.map +1 -0
  317. package/dist-server/service/personnel/personnel-query.d.ts +29 -0
  318. package/dist-server/service/personnel/personnel-query.js +79 -0
  319. package/dist-server/service/personnel/personnel-query.js.map +1 -0
  320. package/dist-server/service/personnel/qualification.d.ts +104 -0
  321. package/dist-server/service/personnel/qualification.js +147 -0
  322. package/dist-server/service/personnel/qualification.js.map +1 -0
  323. package/dist-server/service/quality/index.d.ts +4 -0
  324. package/dist-server/service/quality/index.js +8 -0
  325. package/dist-server/service/quality/index.js.map +1 -0
  326. package/dist-server/service/quality/nonconformance-cause-resolver.d.ts +12 -0
  327. package/dist-server/service/quality/nonconformance-cause-resolver.js +60 -0
  328. package/dist-server/service/quality/nonconformance-cause-resolver.js.map +1 -0
  329. package/dist-server/service/quality/nonconformance-cause.d.ts +20 -0
  330. package/dist-server/service/quality/nonconformance-cause.js +90 -0
  331. package/dist-server/service/quality/nonconformance-cause.js.map +1 -0
  332. package/dist-server/service/recipe/index.d.ts +10 -0
  333. package/dist-server/service/recipe/index.js +16 -0
  334. package/dist-server/service/recipe/index.js.map +1 -0
  335. package/dist-server/service/recipe/recipe-definition.d.ts +75 -0
  336. package/dist-server/service/recipe/recipe-definition.js +143 -0
  337. package/dist-server/service/recipe/recipe-definition.js.map +1 -0
  338. package/dist-server/service/recipe/recipe-effective-list.d.ts +49 -0
  339. package/dist-server/service/recipe/recipe-effective-list.js +96 -0
  340. package/dist-server/service/recipe/recipe-effective-list.js.map +1 -0
  341. package/dist-server/service/recipe/recipe-master-resolver.d.ts +28 -0
  342. package/dist-server/service/recipe/recipe-master-resolver.js +128 -0
  343. package/dist-server/service/recipe/recipe-master-resolver.js.map +1 -0
  344. package/dist-server/service/recipe/recipe-master.d.ts +37 -0
  345. package/dist-server/service/recipe/recipe-master.js +47 -0
  346. package/dist-server/service/recipe/recipe-master.js.map +1 -0
  347. package/dist-server/service/recipe/recipe-query.d.ts +21 -0
  348. package/dist-server/service/recipe/recipe-query.js +82 -0
  349. package/dist-server/service/recipe/recipe-query.js.map +1 -0
  350. package/dist-server/service/recipe/recipe-revision-content.d.ts +32 -0
  351. package/dist-server/service/recipe/recipe-revision-content.js +70 -0
  352. package/dist-server/service/recipe/recipe-revision-content.js.map +1 -0
  353. package/dist-server/service/recipe/recipe-revision-line.d.ts +30 -0
  354. package/dist-server/service/recipe/recipe-revision-line.js +95 -0
  355. package/dist-server/service/recipe/recipe-revision-line.js.map +1 -0
  356. package/dist-server/service/recipe/recipe-revision-resolver.d.ts +65 -0
  357. package/dist-server/service/recipe/recipe-revision-resolver.js +96 -0
  358. package/dist-server/service/recipe/recipe-revision-resolver.js.map +1 -0
  359. package/dist-server/service/recipe/recipe-revision-service.d.ts +183 -0
  360. package/dist-server/service/recipe/recipe-revision-service.js +754 -0
  361. package/dist-server/service/recipe/recipe-revision-service.js.map +1 -0
  362. package/dist-server/service/recipe/recipe-revision.d.ts +102 -0
  363. package/dist-server/service/recipe/recipe-revision.js +373 -0
  364. package/dist-server/service/recipe/recipe-revision.js.map +1 -0
  365. package/dist-server/service/recipe/route-definition.d.ts +51 -0
  366. package/dist-server/service/recipe/route-definition.js +114 -0
  367. package/dist-server/service/recipe/route-definition.js.map +1 -0
  368. package/dist-server/service/resource/class-lineage.d.ts +46 -0
  369. package/dist-server/service/resource/class-lineage.js +80 -0
  370. package/dist-server/service/resource/class-lineage.js.map +1 -0
  371. package/dist-server/service/resource/class-members.d.ts +36 -0
  372. package/dist-server/service/resource/class-members.js +59 -0
  373. package/dist-server/service/resource/class-members.js.map +1 -0
  374. package/dist-server/service/resource/referrers.d.ts +54 -0
  375. package/dist-server/service/resource/referrers.js +99 -0
  376. package/dist-server/service/resource/referrers.js.map +1 -0
  377. package/dist-server/service/resource/resource-class.d.ts +25 -0
  378. package/dist-server/service/resource/resource-class.js +29 -0
  379. package/dist-server/service/resource/resource-class.js.map +1 -0
  380. package/dist-server/service/revision-baseline.d.ts +71 -0
  381. package/dist-server/service/revision-baseline.js +87 -0
  382. package/dist-server/service/revision-baseline.js.map +1 -0
  383. package/dist-server/service/row-lock.d.ts +22 -0
  384. package/dist-server/service/row-lock.js +31 -0
  385. package/dist-server/service/row-lock.js.map +1 -0
  386. package/dist-server/service/status/axis-stamp.d.ts +16 -0
  387. package/dist-server/service/status/axis-stamp.js +22 -0
  388. package/dist-server/service/status/axis-stamp.js.map +1 -0
  389. package/dist-server/service/status/index.d.ts +3 -0
  390. package/dist-server/service/status/index.js +7 -0
  391. package/dist-server/service/status/index.js.map +1 -0
  392. package/dist-server/service/status/master-status.d.ts +38 -0
  393. package/dist-server/service/status/master-status.js +129 -0
  394. package/dist-server/service/status/master-status.js.map +1 -0
  395. package/dist-server/service/test-spec/criteria-check.d.ts +53 -0
  396. package/dist-server/service/test-spec/criteria-check.js +142 -0
  397. package/dist-server/service/test-spec/criteria-check.js.map +1 -0
  398. package/dist-server/service/test-spec/criteria-rows.d.ts +89 -0
  399. package/dist-server/service/test-spec/criteria-rows.js +139 -0
  400. package/dist-server/service/test-spec/criteria-rows.js.map +1 -0
  401. package/dist-server/service/test-spec/index.d.ts +6 -0
  402. package/dist-server/service/test-spec/index.js +11 -0
  403. package/dist-server/service/test-spec/index.js.map +1 -0
  404. package/dist-server/service/test-spec/test-spec-effective-list.d.ts +34 -0
  405. package/dist-server/service/test-spec/test-spec-effective-list.js +42 -0
  406. package/dist-server/service/test-spec/test-spec-effective-list.js.map +1 -0
  407. package/dist-server/service/test-spec/test-spec-master-resolver.d.ts +44 -0
  408. package/dist-server/service/test-spec/test-spec-master-resolver.js +144 -0
  409. package/dist-server/service/test-spec/test-spec-master-resolver.js.map +1 -0
  410. package/dist-server/service/test-spec/test-spec-master.d.ts +6 -0
  411. package/dist-server/service/test-spec/test-spec-master.js +18 -0
  412. package/dist-server/service/test-spec/test-spec-master.js.map +1 -0
  413. package/dist-server/service/test-spec/test-spec-query.d.ts +15 -0
  414. package/dist-server/service/test-spec/test-spec-query.js +61 -0
  415. package/dist-server/service/test-spec/test-spec-query.js.map +1 -0
  416. package/dist-server/service/test-spec/test-spec-revision-resolver.d.ts +59 -0
  417. package/dist-server/service/test-spec/test-spec-revision-resolver.js +96 -0
  418. package/dist-server/service/test-spec/test-spec-revision-resolver.js.map +1 -0
  419. package/dist-server/service/test-spec/test-spec-revision-service.d.ts +178 -0
  420. package/dist-server/service/test-spec/test-spec-revision-service.js +685 -0
  421. package/dist-server/service/test-spec/test-spec-revision-service.js.map +1 -0
  422. package/dist-server/service/test-spec/test-spec-revision.d.ts +86 -0
  423. package/dist-server/service/test-spec/test-spec-revision.js +334 -0
  424. package/dist-server/service/test-spec/test-spec-revision.js.map +1 -0
  425. package/dist-server/service/test-spec/test-specification.d.ts +47 -0
  426. package/dist-server/service/test-spec/test-specification.js +119 -0
  427. package/dist-server/service/test-spec/test-specification.js.map +1 -0
  428. package/dist-server/tsconfig.tsbuildinfo +1 -0
  429. package/package.json +4 -4
@@ -0,0 +1,293 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.changeableFieldsOf = exports.OPS_MASTER_ENTRY_SPECS = void 0;
37
+ exports.opsMasterEntryTargetOf = opsMasterEntryTargetOf;
38
+ exports.opsMasterEntryTargets = opsMasterEntryTargets;
39
+ /*
40
+ * AI 입력 대상 — the master records the assistant may enter and change from material: a spreadsheet of locations, a
41
+ * list of equipment, a page of stop reasons (operato-application/design/ai/data-entry.md).
42
+ *
43
+ * Plain declarations. An application that runs `@things-factory/ai-assistant` registers each one:
44
+ *
45
+ * for (const target of opsMasterEntryTargets()) registerEntryTarget(target)
46
+ *
47
+ * and opens the ones a mode should offer by key (`entryTargets: ['ops-master.equipment']`).
48
+ *
49
+ * Every row goes through the master screen's own mutation (`updateMultiple<Axis>`), one row per call, run with the
50
+ * person's request state - the same privilege, the same change policy, the same refusals as the grid. A row is sent
51
+ * with **only the declared fields**: a change saves `{ ...found, ...values }`, so anything else would overwrite the
52
+ * record. `applied` is never sent: a tracked field changed here is claimed from now.
53
+ */
54
+ const ops_contract_1 = require("@operato/ops-contract");
55
+ const state_period_rules_1 = require("../equipment/state-period-rules");
56
+ const master_entry_rules_1 = require("./master-entry-rules");
57
+ const PAGE = { page: 1, limit: 20 };
58
+ const namedBy = (list) => ({
59
+ query: `query ($search: String, $pagination: Pagination) { ${list}(search: $search, pagination: $pagination) { items { name description } } }`,
60
+ variables: text => ({ search: text, pagination: PAGE }),
61
+ recordsOf: (data, text) => (0, master_entry_rules_1.mastersNamed)(data, list, text)
62
+ });
63
+ const NAME = { name: 'name', type: 'string', required: true, labelKey: 'field.name', description: 'the name (code) exactly as the material writes it - unique on this list; never make one up' };
64
+ const DESCRIPTION = { name: 'description', type: 'string', labelKey: 'field.description', description: 'what it is, in the words of the material' };
65
+ const homeLocation = (required) => ({
66
+ name: 'homeLocation',
67
+ type: 'reference',
68
+ ...(required ? { required } : {}),
69
+ labelKey: 'field.home-location',
70
+ description: 'the operational location it belongs to, as the material names it - its name or its description',
71
+ reference: namedBy('operationalLocations')
72
+ });
73
+ const classList = (name, labelKey, what) => ({
74
+ name,
75
+ type: 'string',
76
+ labelKey,
77
+ description: `the ${what} it belongs to, as names separated by commas - each must already exist`
78
+ });
79
+ const baseClasses = (what) => ({
80
+ name: 'baseIds',
81
+ type: 'string',
82
+ labelKey: 'field.base-classes',
83
+ description: `the ${what} this one inherits from, as names separated by commas - each must already exist; enter a base before the classes under it`
84
+ });
85
+ const classAxis = (axis, list, mutation, what, snapshotKey) => ({
86
+ axis,
87
+ list,
88
+ mutation,
89
+ description: `one ${what}: its name, what it is, and the ${what}es it inherits from.`,
90
+ fields: [NAME, DESCRIPTION, baseClasses(`${what}es`)],
91
+ lists: { baseIds: axis },
92
+ snapshotKey,
93
+ recordFields: ['name', 'description', 'baseIds']
94
+ });
95
+ exports.OPS_MASTER_ENTRY_SPECS = [
96
+ {
97
+ axis: 'operationalLocation',
98
+ list: 'operationalLocations',
99
+ mutation: 'updateMultipleOperationalLocation',
100
+ description: 'one operational location - a site, area, line, cell, store or dock: its name, what it is, its type, which system owns it, its ISA-95 level, ' +
101
+ 'how many it holds and works at once, and the location it sits under. A change of the parent is recorded as a tracked change from now.',
102
+ fields: [
103
+ NAME,
104
+ DESCRIPTION,
105
+ { name: 'type', type: 'string', required: true, labelKey: 'field.location-type', description: "the location type key of the site's catalog as the material writes it (raw-store, weld-station, dock)" },
106
+ { name: 'system', type: 'enum', values: [...ops_contract_1.DOMAIN_SYSTEMS], labelKey: 'field.owning-system', description: 'which system owns the place: wms = warehouse, yms = yard, mes = factory, ems = energy; leave empty when the material does not say' },
107
+ { name: 'level', type: 'enum', values: [...ops_contract_1.EQUIPMENT_LEVEL], labelKey: 'field.equipment-level', description: 'the ISA-95 equipment hierarchy level' },
108
+ { name: 'capacity', type: 'integer', labelKey: 'field.capacity', description: 'how many it holds - leave empty when unknown' },
109
+ { name: 'parallelism', type: 'integer', labelKey: 'field.parallelism', description: 'how many it works on at once - leave empty when unknown' },
110
+ {
111
+ name: 'parentId',
112
+ type: 'reference',
113
+ labelKey: 'field.parent-location',
114
+ description: 'the location it sits under, as the material names it; empty for a top location. A change is recorded as a tracked change from now',
115
+ reference: namedBy('operationalLocations')
116
+ }
117
+ ],
118
+ lists: {},
119
+ parentField: 'parentId',
120
+ snapshotKey: 'operationalLocations',
121
+ recordFields: ['name', 'description', 'type', 'system', 'level', 'capacity', 'parallelism', 'parentId']
122
+ },
123
+ {
124
+ axis: 'equipment',
125
+ list: 'equipmentList',
126
+ mutation: 'updateMultipleEquipment',
127
+ description: 'one equipment: its name, what it is, its kind, where it is installed, its identifier and its classes. A change of where it is installed is recorded as a tracked change from now.',
128
+ fields: [
129
+ NAME,
130
+ DESCRIPTION,
131
+ { name: 'kind', type: 'string', required: true, labelKey: 'field.equipment-class', description: 'the kind of equipment as the material writes it (press, robot, conveyor)' },
132
+ { ...homeLocation(true), description: 'where it is installed - the operational location as the material names it. A change is recorded as a tracked change from now' },
133
+ { name: 'identity', type: 'string', labelKey: 'field.identity', description: 'its GS1 identifier, only when the material gives one' },
134
+ classList('equipmentClassIds', 'field.equipment-classes', 'equipment classes')
135
+ ],
136
+ lists: { equipmentClassIds: 'equipmentClass' },
137
+ snapshotKey: 'equipment',
138
+ recordFields: ['name', 'description', 'kind', 'homeLocation', 'identity', 'equipmentClassIds']
139
+ },
140
+ {
141
+ axis: 'person',
142
+ list: 'persons',
143
+ mutation: 'updateMultiplePerson',
144
+ description: 'one person on the floor: the name they are known by, a note, their qualifications and where they work.',
145
+ fields: [NAME, DESCRIPTION, classList('personnelClassIds', 'field.personnel-classes', 'personnel classes (qualifications)'), homeLocation(false)],
146
+ lists: { personnelClassIds: 'personnelClass' },
147
+ snapshotKey: 'persons',
148
+ recordFields: ['name', 'description', 'personnelClassIds', 'homeLocation']
149
+ },
150
+ {
151
+ axis: 'physicalAsset',
152
+ list: 'physicalAssets',
153
+ mutation: 'updateMultiplePhysicalAsset',
154
+ description: 'one physical asset - a tool, jig, mold or gauge: its name, what it is, its classes, where it is kept and its identifier.',
155
+ fields: [
156
+ NAME,
157
+ DESCRIPTION,
158
+ classList('assetClassIds', 'field.asset-classes', 'physical asset classes'),
159
+ { ...homeLocation(false), description: 'where it is kept - the operational location as the material names it' },
160
+ { name: 'identity', type: 'string', labelKey: 'field.grai', description: 'its GRAI, only when the material gives one' }
161
+ ],
162
+ lists: { assetClassIds: 'physicalAssetClass' },
163
+ snapshotKey: 'physicalAssets',
164
+ recordFields: ['name', 'description', 'assetClassIds', 'homeLocation', 'identity']
165
+ },
166
+ {
167
+ axis: 'stopReason',
168
+ list: 'stopReasonList',
169
+ mutation: 'updateMultipleStopReason',
170
+ description: 'one equipment stop reason: its code, what it means, the equipment state it is for, its parent reason, and whether the floor must add a note.',
171
+ fields: [
172
+ { ...NAME, description: 'the reason code exactly as the material writes it - unique on this list; never make one up' },
173
+ DESCRIPTION,
174
+ {
175
+ name: 'status',
176
+ type: 'enum',
177
+ required: true,
178
+ values: [...state_period_rules_1.STOP_REASON_STATUS],
179
+ labelKey: 'field.status',
180
+ valueKeyPrefix: 'text.state-',
181
+ description: 'the equipment state the reason is for: down = broken down, setup = changeover, planned-stop = a planned stop, idle = waiting'
182
+ },
183
+ { name: 'parentName', type: 'reference', labelKey: 'field.parent-reason', description: 'the reason it sits under, as the material names it', reference: namedBy('stopReasonList') },
184
+ { name: 'detailRequired', type: 'boolean', labelKey: 'field.detail-required', description: 'true when the floor must add a note on choosing it' }
185
+ ],
186
+ lists: {},
187
+ parentField: 'parentName',
188
+ snapshotKey: 'stopReasons',
189
+ recordFields: ['name', 'description', 'status', 'parentName', 'detailRequired']
190
+ },
191
+ {
192
+ axis: 'nonconformanceCause',
193
+ list: 'nonconformanceCauseList',
194
+ mutation: 'updateMultipleNonconformanceCause',
195
+ description: 'one nonconformance cause: its code, what it means, its parent cause, and whether a note must be added.',
196
+ fields: [
197
+ { ...NAME, description: 'the cause code exactly as the material writes it - unique on this list; never make one up' },
198
+ DESCRIPTION,
199
+ { name: 'parentName', type: 'reference', labelKey: 'field.parent-reason', description: 'the cause it sits under, as the material names it', reference: namedBy('nonconformanceCauseList') },
200
+ { name: 'detailRequired', type: 'boolean', labelKey: 'field.detail-required', description: 'true when a note must be added on choosing it' }
201
+ ],
202
+ lists: {},
203
+ parentField: 'parentName',
204
+ recordFields: ['name', 'description', 'parentName', 'detailRequired']
205
+ },
206
+ classAxis('equipmentClass', 'equipmentClasses', 'updateMultipleEquipmentClass', 'equipment class', 'equipmentClasses'),
207
+ classAxis('personnelClass', 'personnelClasses', 'updateMultiplePersonnelClass', 'personnel class', 'personnelClasses'),
208
+ classAxis('physicalAssetClass', 'physicalAssetClasses', 'updateMultiplePhysicalAssetClass', 'physical asset class', 'physicalAssetClasses'),
209
+ classAxis('materialClass', 'materialClasses', 'updateMultipleMaterialClass', 'material class', 'materialClasses')
210
+ ];
211
+ /** The fields a change may touch - every declared field; the update check reads the names a change gives. */
212
+ const changeableFieldsOf = (spec) => spec.fields.map(field => field.name);
213
+ exports.changeableFieldsOf = changeableFieldsOf;
214
+ /** A list field read back as the comma list it was written as. */
215
+ function recordOf(spec, item) {
216
+ const record = { id: item.id };
217
+ for (const name of spec.recordFields) {
218
+ const value = item[name];
219
+ record[name] = spec.lists[name] && Array.isArray(value) ? value.join(', ') : value ?? null;
220
+ }
221
+ return record;
222
+ }
223
+ const labelOf = (record) => [record.name, record.description].filter(value => typeof value === 'string' && value).join(' · ');
224
+ /** Names on an axis in the domain, read from the master table - lazy, so the rules load without the shell. */
225
+ async function namesInDomain(domain, axis, names) {
226
+ const found = new Map();
227
+ if (!names.length)
228
+ return found;
229
+ const [{ getRepository }, { In }, { masterAxisOf }] = await Promise.all([Promise.resolve().then(() => __importStar(require('@things-factory/shell'))), Promise.resolve().then(() => __importStar(require('typeorm'))), Promise.resolve().then(() => __importStar(require('../master-axis')))]);
230
+ const repository = getRepository(masterAxisOf(axis).entity);
231
+ for (let at = 0; at < names.length; at += 500) {
232
+ const rows = await repository.find({ where: { domain: { id: domain.id }, name: In(names.slice(at, at + 500)) } });
233
+ for (const row of rows)
234
+ found.set(row.name, row);
235
+ }
236
+ return found;
237
+ }
238
+ /** One axis as an entry target. */
239
+ function opsMasterEntryTargetOf(spec, options = {}) {
240
+ const returned = `{ id name }`;
241
+ const mutation = `mutation ($patches: [Object!]!) { ${spec.mutation}(patches: $patches) ${returned} }`;
242
+ const items = `items { id ${spec.recordFields.join(' ')} }`;
243
+ const lookup = options.lookup ?? ((domain) => (axis, names) => namesInDomain(domain, axis, names));
244
+ return {
245
+ key: (0, master_entry_rules_1.opsMasterEntryKey)(spec.axis),
246
+ labelKey: (0, master_entry_rules_1.opsMasterEntryLabelKey)(spec.axis),
247
+ description: spec.description,
248
+ fields: spec.fields,
249
+ mutation,
250
+ /* One row per call - each row is answered by its place, and one taken name does not undo the others. */
251
+ variables: row => ({ patches: [{ cuFlag: '+', ...(0, master_entry_rules_1.masterPatchOf)(row.values, spec) }] }),
252
+ appliedOf: (data, row) => {
253
+ const saved = data?.[spec.mutation]?.[0];
254
+ return { ...(saved?.id ? { id: saved.id } : {}), label: saved?.name ?? (0, master_entry_rules_1.nameOf)(row.values) };
255
+ },
256
+ maxRows: 200,
257
+ check: async (rows, { state }) => {
258
+ const domain = state?.domain;
259
+ if (!domain?.id)
260
+ return rows.map(() => []);
261
+ return (0, master_entry_rules_1.checkMasterRows)(spec, rows, lookup(domain));
262
+ },
263
+ update: {
264
+ read: {
265
+ query: `query ($filters: [Filter!], $pagination: Pagination) { ${spec.list}(filters: $filters, pagination: $pagination) { ${items} } }`,
266
+ variables: ids => ({ filters: [{ name: 'id', operator: 'in', value: ids }], pagination: { page: 1, limit: Math.max(ids.length, 1) } }),
267
+ recordsOf: (data, ids) => (data?.[spec.list]?.items ?? []).filter((item) => ids.includes(item?.id)).map((item) => recordOf(spec, item))
268
+ },
269
+ find: {
270
+ query: `query ($search: String, $pagination: Pagination) { ${spec.list}(search: $search, pagination: $pagination) { ${items} } }`,
271
+ variables: criteria => ({ ...(typeof criteria.text === 'string' && criteria.text ? { search: criteria.text } : {}), pagination: PAGE }),
272
+ recordsOf: data => (data?.[spec.list]?.items ?? []).map((item) => recordOf(spec, item)),
273
+ criteria: [{ name: 'text', type: 'string', description: 'a name, a code or words of the description, as the person said them' }]
274
+ },
275
+ mutation,
276
+ /* Only the fields that change - the rest of the record is the saved one, not a copy the card read. */
277
+ variables: ({ id, values }) => ({ patches: [{ cuFlag: 'M', id, ...(0, master_entry_rules_1.masterPatchOf)(values, spec, true) }] }),
278
+ labelOf,
279
+ fields: (0, exports.changeableFieldsOf)(spec),
280
+ check: async (changes, { state }) => {
281
+ const domain = state?.domain;
282
+ if (!domain?.id)
283
+ return changes.map(() => []);
284
+ return (0, master_entry_rules_1.checkMasterChanges)(spec, changes, lookup(domain));
285
+ }
286
+ }
287
+ };
288
+ }
289
+ /** Every master axis the assistant may enter, as targets to register. */
290
+ function opsMasterEntryTargets(options = {}) {
291
+ return exports.OPS_MASTER_ENTRY_SPECS.map(spec => opsMasterEntryTargetOf(spec, options));
292
+ }
293
+ //# sourceMappingURL=master-entry-targets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"master-entry-targets.js","sourceRoot":"","sources":["../../../server/service/ai-entry/master-entry-targets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqPA,wDAgDC;AAGD,sDAEC;AA1SD;;;;;;;;;;;;;;GAcG;AACH,wDAAuE;AAEvE,wEAAoE;AACpE,6DAe6B;AAE7B,MAAM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ACH,CAAC;AAED,yEAAyE;AACzE,SAAgB,qBAAqB,CAAC,UAAiC,EAAE;IACvE,OAAO,8BAAsB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;AAClF,CAAC","sourcesContent":["/*\n * AI 입력 대상 — the master records the assistant may enter and change from material: a spreadsheet of locations, a\n * list of equipment, a page of stop reasons (operato-application/design/ai/data-entry.md).\n *\n * Plain declarations. An application that runs `@things-factory/ai-assistant` registers each one:\n *\n * for (const target of opsMasterEntryTargets()) registerEntryTarget(target)\n *\n * and opens the ones a mode should offer by key (`entryTargets: ['ops-master.equipment']`).\n *\n * Every row goes through the master screen's own mutation (`updateMultiple<Axis>`), one row per call, run with the\n * person's request state - the same privilege, the same change policy, the same refusals as the grid. A row is sent\n * with **only the declared fields**: a change saves `{ ...found, ...values }`, so anything else would overwrite the\n * record. `applied` is never sent: a tracked field changed here is claimed from now.\n */\nimport { DOMAIN_SYSTEMS, EQUIPMENT_LEVEL } from '@operato/ops-contract'\n\nimport { STOP_REASON_STATUS } from '../equipment/state-period-rules'\nimport {\n checkMasterChanges,\n checkMasterRows,\n masterPatchOf,\n mastersNamed,\n nameOf,\n opsMasterEntryKey,\n opsMasterEntryLabelKey,\n type MasterEntryRuleSpec,\n type MasterNamesLookup,\n type MasterRow,\n type OpsMasterEntryAxis,\n type OpsMasterEntryField,\n type OpsMasterEntryRecord,\n type OpsMasterEntryTarget\n} from './master-entry-rules'\n\nconst PAGE = { page: 1, limit: 20 }\n\n/** The list query an axis is read and searched through, and the grid's mutation. */\nexport interface OpsMasterEntryAxisSpec extends MasterEntryRuleSpec {\n /** `operationalLocations` · `equipmentList` … */\n list: string\n /** `updateMultipleOperationalLocation` … */\n mutation: string\n /** What one row is, for the model. */\n description: string\n /** The fields the read query asks besides `id`. */\n recordFields: string[]\n}\n\nconst namedBy = (list: string): OpsMasterEntryField['reference'] => ({\n query: `query ($search: String, $pagination: Pagination) { ${list}(search: $search, pagination: $pagination) { items { name description } } }`,\n variables: text => ({ search: text, pagination: PAGE }),\n recordsOf: (data, text) => mastersNamed(data, list, text)\n})\n\nconst NAME: OpsMasterEntryField = { name: 'name', type: 'string', required: true, labelKey: 'field.name', description: 'the name (code) exactly as the material writes it - unique on this list; never make one up' }\nconst DESCRIPTION: OpsMasterEntryField = { name: 'description', type: 'string', labelKey: 'field.description', description: 'what it is, in the words of the material' }\n\nconst homeLocation = (required: boolean): OpsMasterEntryField => ({\n name: 'homeLocation',\n type: 'reference',\n ...(required ? { required } : {}),\n labelKey: 'field.home-location',\n description: 'the operational location it belongs to, as the material names it - its name or its description',\n reference: namedBy('operationalLocations')\n})\n\nconst classList = (name: string, labelKey: string, what: string): OpsMasterEntryField => ({\n name,\n type: 'string',\n labelKey,\n description: `the ${what} it belongs to, as names separated by commas - each must already exist`\n})\n\nconst baseClasses = (what: string): OpsMasterEntryField => ({\n name: 'baseIds',\n type: 'string',\n labelKey: 'field.base-classes',\n description: `the ${what} this one inherits from, as names separated by commas - each must already exist; enter a base before the classes under it`\n})\n\nconst classAxis = (axis: OpsMasterEntryAxis, list: string, mutation: string, what: string, snapshotKey: OpsMasterEntryAxisSpec['snapshotKey']): OpsMasterEntryAxisSpec => ({\n axis,\n list,\n mutation,\n description: `one ${what}: its name, what it is, and the ${what}es it inherits from.`,\n fields: [NAME, DESCRIPTION, baseClasses(`${what}es`)],\n lists: { baseIds: axis },\n snapshotKey,\n recordFields: ['name', 'description', 'baseIds']\n})\n\nexport const OPS_MASTER_ENTRY_SPECS: readonly OpsMasterEntryAxisSpec[] = [\n {\n axis: 'operationalLocation',\n list: 'operationalLocations',\n mutation: 'updateMultipleOperationalLocation',\n description:\n 'one operational location - a site, area, line, cell, store or dock: its name, what it is, its type, which system owns it, its ISA-95 level, ' +\n 'how many it holds and works at once, and the location it sits under. A change of the parent is recorded as a tracked change from now.',\n fields: [\n NAME,\n DESCRIPTION,\n { name: 'type', type: 'string', required: true, labelKey: 'field.location-type', description: \"the location type key of the site's catalog as the material writes it (raw-store, weld-station, dock)\" },\n { name: 'system', type: 'enum', values: [...DOMAIN_SYSTEMS], labelKey: 'field.owning-system', description: 'which system owns the place: wms = warehouse, yms = yard, mes = factory, ems = energy; leave empty when the material does not say' },\n { name: 'level', type: 'enum', values: [...EQUIPMENT_LEVEL], labelKey: 'field.equipment-level', description: 'the ISA-95 equipment hierarchy level' },\n { name: 'capacity', type: 'integer', labelKey: 'field.capacity', description: 'how many it holds - leave empty when unknown' },\n { name: 'parallelism', type: 'integer', labelKey: 'field.parallelism', description: 'how many it works on at once - leave empty when unknown' },\n {\n name: 'parentId',\n type: 'reference',\n labelKey: 'field.parent-location',\n description: 'the location it sits under, as the material names it; empty for a top location. A change is recorded as a tracked change from now',\n reference: namedBy('operationalLocations')\n }\n ],\n lists: {},\n parentField: 'parentId',\n snapshotKey: 'operationalLocations',\n recordFields: ['name', 'description', 'type', 'system', 'level', 'capacity', 'parallelism', 'parentId']\n },\n {\n axis: 'equipment',\n list: 'equipmentList',\n mutation: 'updateMultipleEquipment',\n description:\n 'one equipment: its name, what it is, its kind, where it is installed, its identifier and its classes. A change of where it is installed is recorded as a tracked change from now.',\n fields: [\n NAME,\n DESCRIPTION,\n { name: 'kind', type: 'string', required: true, labelKey: 'field.equipment-class', description: 'the kind of equipment as the material writes it (press, robot, conveyor)' },\n { ...homeLocation(true), description: 'where it is installed - the operational location as the material names it. A change is recorded as a tracked change from now' },\n { name: 'identity', type: 'string', labelKey: 'field.identity', description: 'its GS1 identifier, only when the material gives one' },\n classList('equipmentClassIds', 'field.equipment-classes', 'equipment classes')\n ],\n lists: { equipmentClassIds: 'equipmentClass' },\n snapshotKey: 'equipment',\n recordFields: ['name', 'description', 'kind', 'homeLocation', 'identity', 'equipmentClassIds']\n },\n {\n axis: 'person',\n list: 'persons',\n mutation: 'updateMultiplePerson',\n description: 'one person on the floor: the name they are known by, a note, their qualifications and where they work.',\n fields: [NAME, DESCRIPTION, classList('personnelClassIds', 'field.personnel-classes', 'personnel classes (qualifications)'), homeLocation(false)],\n lists: { personnelClassIds: 'personnelClass' },\n snapshotKey: 'persons',\n recordFields: ['name', 'description', 'personnelClassIds', 'homeLocation']\n },\n {\n axis: 'physicalAsset',\n list: 'physicalAssets',\n mutation: 'updateMultiplePhysicalAsset',\n description: 'one physical asset - a tool, jig, mold or gauge: its name, what it is, its classes, where it is kept and its identifier.',\n fields: [\n NAME,\n DESCRIPTION,\n classList('assetClassIds', 'field.asset-classes', 'physical asset classes'),\n { ...homeLocation(false), description: 'where it is kept - the operational location as the material names it' },\n { name: 'identity', type: 'string', labelKey: 'field.grai', description: 'its GRAI, only when the material gives one' }\n ],\n lists: { assetClassIds: 'physicalAssetClass' },\n snapshotKey: 'physicalAssets',\n recordFields: ['name', 'description', 'assetClassIds', 'homeLocation', 'identity']\n },\n {\n axis: 'stopReason',\n list: 'stopReasonList',\n mutation: 'updateMultipleStopReason',\n description: 'one equipment stop reason: its code, what it means, the equipment state it is for, its parent reason, and whether the floor must add a note.',\n fields: [\n { ...NAME, description: 'the reason code exactly as the material writes it - unique on this list; never make one up' },\n DESCRIPTION,\n {\n name: 'status',\n type: 'enum',\n required: true,\n values: [...STOP_REASON_STATUS],\n labelKey: 'field.status',\n valueKeyPrefix: 'text.state-',\n description: 'the equipment state the reason is for: down = broken down, setup = changeover, planned-stop = a planned stop, idle = waiting'\n },\n { name: 'parentName', type: 'reference', labelKey: 'field.parent-reason', description: 'the reason it sits under, as the material names it', reference: namedBy('stopReasonList') },\n { name: 'detailRequired', type: 'boolean', labelKey: 'field.detail-required', description: 'true when the floor must add a note on choosing it' }\n ],\n lists: {},\n parentField: 'parentName',\n snapshotKey: 'stopReasons',\n recordFields: ['name', 'description', 'status', 'parentName', 'detailRequired']\n },\n {\n axis: 'nonconformanceCause',\n list: 'nonconformanceCauseList',\n mutation: 'updateMultipleNonconformanceCause',\n description: 'one nonconformance cause: its code, what it means, its parent cause, and whether a note must be added.',\n fields: [\n { ...NAME, description: 'the cause code exactly as the material writes it - unique on this list; never make one up' },\n DESCRIPTION,\n { name: 'parentName', type: 'reference', labelKey: 'field.parent-reason', description: 'the cause it sits under, as the material names it', reference: namedBy('nonconformanceCauseList') },\n { name: 'detailRequired', type: 'boolean', labelKey: 'field.detail-required', description: 'true when a note must be added on choosing it' }\n ],\n lists: {},\n parentField: 'parentName',\n recordFields: ['name', 'description', 'parentName', 'detailRequired']\n },\n classAxis('equipmentClass', 'equipmentClasses', 'updateMultipleEquipmentClass', 'equipment class', 'equipmentClasses'),\n classAxis('personnelClass', 'personnelClasses', 'updateMultiplePersonnelClass', 'personnel class', 'personnelClasses'),\n classAxis('physicalAssetClass', 'physicalAssetClasses', 'updateMultiplePhysicalAssetClass', 'physical asset class', 'physicalAssetClasses'),\n classAxis('materialClass', 'materialClasses', 'updateMultipleMaterialClass', 'material class', 'materialClasses')\n]\n\n/** The fields a change may touch - every declared field; the update check reads the names a change gives. */\nexport const changeableFieldsOf = (spec: Pick<OpsMasterEntryAxisSpec, 'fields'>) => spec.fields.map(field => field.name)\n\n/** A list field read back as the comma list it was written as. */\nfunction recordOf(spec: OpsMasterEntryAxisSpec, item: any): OpsMasterEntryRecord {\n const record: OpsMasterEntryRecord = { id: item.id }\n for (const name of spec.recordFields) {\n const value = item[name]\n record[name] = spec.lists[name] && Array.isArray(value) ? value.join(', ') : value ?? null\n }\n return record\n}\n\nconst labelOf = (record: OpsMasterEntryRecord) => [record.name, record.description].filter(value => typeof value === 'string' && value).join(' · ')\n\n/** Names on an axis in the domain, read from the master table - lazy, so the rules load without the shell. */\nasync function namesInDomain(domain: any, axis: OpsMasterEntryAxis, names: string[]): Promise<Map<string, MasterRow>> {\n const found = new Map<string, MasterRow>()\n if (!names.length) return found\n const [{ getRepository }, { In }, { masterAxisOf }] = await Promise.all([import('@things-factory/shell'), import('typeorm'), import('../master-axis')])\n const repository = getRepository(masterAxisOf(axis).entity)\n for (let at = 0; at < names.length; at += 500) {\n const rows = await repository.find({ where: { domain: { id: domain.id }, name: In(names.slice(at, at + 500)) } as any })\n for (const row of rows) found.set(row.name, row as MasterRow)\n }\n return found\n}\n\nexport interface OpsMasterEntryOptions {\n /** Which names exist - the master tables by default; a test gives its own. */\n lookup?: (domain: any) => MasterNamesLookup\n}\n\n/** One axis as an entry target. */\nexport function opsMasterEntryTargetOf(spec: OpsMasterEntryAxisSpec, options: OpsMasterEntryOptions = {}): OpsMasterEntryTarget {\n const returned = `{ id name }`\n const mutation = `mutation ($patches: [Object!]!) { ${spec.mutation}(patches: $patches) ${returned} }`\n const items = `items { id ${spec.recordFields.join(' ')} }`\n const lookup = options.lookup ?? ((domain: any): MasterNamesLookup => (axis, names) => namesInDomain(domain, axis, names))\n\n return {\n key: opsMasterEntryKey(spec.axis),\n labelKey: opsMasterEntryLabelKey(spec.axis),\n description: spec.description,\n fields: spec.fields,\n mutation,\n /* One row per call - each row is answered by its place, and one taken name does not undo the others. */\n variables: row => ({ patches: [{ cuFlag: '+', ...masterPatchOf(row.values, spec) }] }),\n appliedOf: (data, row) => {\n const saved = data?.[spec.mutation]?.[0]\n return { ...(saved?.id ? { id: saved.id } : {}), label: saved?.name ?? nameOf(row.values) }\n },\n maxRows: 200,\n check: async (rows, { state }) => {\n const domain = state?.domain\n if (!domain?.id) return rows.map(() => [])\n return checkMasterRows(spec, rows, lookup(domain))\n },\n update: {\n read: {\n query: `query ($filters: [Filter!], $pagination: Pagination) { ${spec.list}(filters: $filters, pagination: $pagination) { ${items} } }`,\n variables: ids => ({ filters: [{ name: 'id', operator: 'in', value: ids }], pagination: { page: 1, limit: Math.max(ids.length, 1) } }),\n recordsOf: (data, ids) => (data?.[spec.list]?.items ?? []).filter((item: any) => ids.includes(item?.id)).map((item: any) => recordOf(spec, item))\n },\n find: {\n query: `query ($search: String, $pagination: Pagination) { ${spec.list}(search: $search, pagination: $pagination) { ${items} } }`,\n variables: criteria => ({ ...(typeof criteria.text === 'string' && criteria.text ? { search: criteria.text } : {}), pagination: PAGE }),\n recordsOf: data => (data?.[spec.list]?.items ?? []).map((item: any) => recordOf(spec, item)),\n criteria: [{ name: 'text', type: 'string', description: 'a name, a code or words of the description, as the person said them' }]\n },\n mutation,\n /* Only the fields that change - the rest of the record is the saved one, not a copy the card read. */\n variables: ({ id, values }) => ({ patches: [{ cuFlag: 'M', id, ...masterPatchOf(values, spec, true) }] }),\n labelOf,\n fields: changeableFieldsOf(spec),\n check: async (changes, { state }) => {\n const domain = state?.domain\n if (!domain?.id) return changes.map(() => [])\n return checkMasterChanges(spec, changes, lookup(domain))\n }\n }\n }\n}\n\n/** Every master axis the assistant may enter, as targets to register. */\nexport function opsMasterEntryTargets(options: OpsMasterEntryOptions = {}): OpsMasterEntryTarget[] {\n return OPS_MASTER_ENTRY_SPECS.map(spec => opsMasterEntryTargetOf(spec, options))\n}\n"]}
@@ -0,0 +1,37 @@
1
+ import { EntityManager } from 'typeorm';
2
+ /**
3
+ * **규제를 걸려면 누가 결재할지가 정해져 있어야 한다.**
4
+ *
5
+ * ── 왜 이 길이 필요한가 ────────────────────────────────────────────────────
6
+ * 소유자가 어느 축을 「승인 후 변경」으로 바꾸면, 그 축의 기준정보는 그때부터 결재를 지나야 바뀐다.
7
+ * 그런데 결재선은 양식이 아니라 **그 현장이 정하는 것**이라, 비어 있을 수 있다 — 기동 로그가 매번
8
+ * 「결재선 비어 있음 miratek, system」이라고 말하고 있었다. 비어 있는 채로 규제를 걸면 상신은 되고
9
+ * 내려 줄 사람이 없어서, 그 축의 기준정보가 통째로 멈춘다.
10
+ *
11
+ * ── 왜 여기서 직접 안 보나 ─────────────────────────────────────────────────
12
+ * 결재 단계 수는 `worklist` 가 안다. 그런데 **어느 축이 어느 결재 양식을 쓰는가**는 앱이 안다 —
13
+ * plant 의 `activity-recipe-change`·`activity-work-shift-change` 가 그것이다. 이 묶음은 둘 다
14
+ * 모르므로, 아는 쪽이 자기 짝을 등록한다.
15
+ *
16
+ * ⚠ **아무도 등록 안 했으면 지나간다.** 등록이 없다는 것은 「결재선이 없다」가 아니라 「이 앱은 이
17
+ * 물음에 답할 길을 아직 안 냈다」이다. 모른다고 막으면 아직 등록하지 않은 앱이 전부 멈춘다.
18
+ */
19
+ export interface ApprovalRouteReport {
20
+ /** 이 축을 규제로 걸어도 되는가 — 결재할 사람이 정해져 있는가. */
21
+ ready: boolean;
22
+ /** 어느 결재 양식을 말하는가. 사람이 어디를 고쳐야 하는지 알아야 한다. */
23
+ activity?: string;
24
+ }
25
+ export type ApprovalRouteInspector = (manager: EntityManager, domainId: string, axis: string) => Promise<ApprovalRouteReport | undefined>;
26
+ /** 앱이 자기 결재 양식을 아는 길을 낸다. 나중 것이 앞의 것을 대신한다. */
27
+ export declare function registerApprovalRouteInspector(one: ApprovalRouteInspector): void;
28
+ /** 시험이 자기 자리를 되돌린다. */
29
+ export declare function clearApprovalRouteInspector(): void;
30
+ /**
31
+ * 이 축의 결재 길이 준비됐나 — **묻기만 한다.**
32
+ *
33
+ * 화면이 누르기 전에 먼저 본다. 눌러서 거절당하고 나서야 「결재선을 정하십시오」를 듣는 것은, 고를 수
34
+ * 없는 것을 골라 보게 한 것이다.
35
+ */
36
+ export declare function inspectApprovalRoute(manager: EntityManager, domainId: string, axis: string): Promise<ApprovalRouteReport>;
37
+ export declare function assertApprovalRouteReady(manager: EntityManager, domainId: string, axis: string): Promise<void>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerApprovalRouteInspector = registerApprovalRouteInspector;
4
+ exports.clearApprovalRouteInspector = clearApprovalRouteInspector;
5
+ exports.inspectApprovalRoute = inspectApprovalRoute;
6
+ exports.assertApprovalRouteReady = assertApprovalRouteReady;
7
+ const shell_1 = require("@things-factory/shell");
8
+ let inspector;
9
+ /** 앱이 자기 결재 양식을 아는 길을 낸다. 나중 것이 앞의 것을 대신한다. */
10
+ function registerApprovalRouteInspector(one) {
11
+ inspector = one;
12
+ }
13
+ /** 시험이 자기 자리를 되돌린다. */
14
+ function clearApprovalRouteInspector() {
15
+ inspector = undefined;
16
+ }
17
+ /**
18
+ * 이 축의 결재 길이 준비됐나 — **묻기만 한다.**
19
+ *
20
+ * 화면이 누르기 전에 먼저 본다. 눌러서 거절당하고 나서야 「결재선을 정하십시오」를 듣는 것은, 고를 수
21
+ * 없는 것을 골라 보게 한 것이다.
22
+ */
23
+ function inspectApprovalRoute(manager, domainId, axis) {
24
+ return inspector?.(manager, domainId, axis);
25
+ }
26
+ async function assertApprovalRouteReady(manager, domainId, axis) {
27
+ const report = await inspector?.(manager, domainId, axis);
28
+ /* 답이 없으면 이 앱은 아직 이 물음에 답할 길이 없다 — 막지 않는다. */
29
+ if (!report || report.ready) {
30
+ return;
31
+ }
32
+ throw new shell_1.Refusal('MASTER_APPROVAL_LINE_REQUIRED', { axis, activity: report.activity }, 'Set the approval line for this activity before requiring approval on this master axis.');
33
+ }
34
+ //# sourceMappingURL=approval-route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval-route.js","sourceRoot":"","sources":["../../server/service/approval-route.ts"],"names":[],"mappings":";;AAoCA,wEAEC;AAGD,kEAEC;AAQD,oDAEC;AAED,4DAaC;AAnED,iDAA+C;AAgC/C,IAAI,SAA6C,CAAA;AAEjD,+CAA+C;AAC/C,SAAgB,8BAA8B,CAAC,GAA2B;IACxE,SAAS,GAAG,GAAG,CAAA;AACjB,CAAC;AAED,uBAAuB;AACvB,SAAgB,2BAA2B;IACzC,SAAS,GAAG,SAAS,CAAA;AACvB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,OAAsB,EAAE,QAAgB,EAAE,IAAY;IACzF,OAAO,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;AAC7C,CAAC;AAEM,KAAK,UAAU,wBAAwB,CAAC,OAAsB,EAAE,QAAgB,EAAE,IAAY;IACnG,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IAEzD,6CAA6C;IAC7C,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QAC5B,OAAM;IACR,CAAC;IAED,MAAM,IAAI,eAAO,CACf,+BAA+B,EAC/B,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,EACnC,wFAAwF,CACzF,CAAA;AACH,CAAC","sourcesContent":["import { EntityManager } from 'typeorm'\nimport { Refusal } from '@things-factory/shell'\n\n/**\n * **규제를 걸려면 누가 결재할지가 정해져 있어야 한다.**\n *\n * ── 왜 이 길이 필요한가 ────────────────────────────────────────────────────\n * 소유자가 어느 축을 「승인 후 변경」으로 바꾸면, 그 축의 기준정보는 그때부터 결재를 지나야 바뀐다.\n * 그런데 결재선은 양식이 아니라 **그 현장이 정하는 것**이라, 비어 있을 수 있다 — 기동 로그가 매번\n * 「결재선 비어 있음 miratek, system」이라고 말하고 있었다. 비어 있는 채로 규제를 걸면 상신은 되고\n * 내려 줄 사람이 없어서, 그 축의 기준정보가 통째로 멈춘다.\n *\n * ── 왜 여기서 직접 안 보나 ─────────────────────────────────────────────────\n * 결재 단계 수는 `worklist` 가 안다. 그런데 **어느 축이 어느 결재 양식을 쓰는가**는 앱이 안다 —\n * plant 의 `activity-recipe-change`·`activity-work-shift-change` 가 그것이다. 이 묶음은 둘 다\n * 모르므로, 아는 쪽이 자기 짝을 등록한다.\n *\n * ⚠ **아무도 등록 안 했으면 지나간다.** 등록이 없다는 것은 「결재선이 없다」가 아니라 「이 앱은 이\n * 물음에 답할 길을 아직 안 냈다」이다. 모른다고 막으면 아직 등록하지 않은 앱이 전부 멈춘다.\n */\nexport interface ApprovalRouteReport {\n /** 이 축을 규제로 걸어도 되는가 — 결재할 사람이 정해져 있는가. */\n ready: boolean\n /** 어느 결재 양식을 말하는가. 사람이 어디를 고쳐야 하는지 알아야 한다. */\n activity?: string\n}\n\nexport type ApprovalRouteInspector = (\n manager: EntityManager,\n domainId: string,\n axis: string\n) => Promise<ApprovalRouteReport | undefined>\n\nlet inspector: ApprovalRouteInspector | undefined\n\n/** 앱이 자기 결재 양식을 아는 길을 낸다. 나중 것이 앞의 것을 대신한다. */\nexport function registerApprovalRouteInspector(one: ApprovalRouteInspector) {\n inspector = one\n}\n\n/** 시험이 자기 자리를 되돌린다. */\nexport function clearApprovalRouteInspector() {\n inspector = undefined\n}\n\n/**\n * 이 축의 결재 길이 준비됐나 — **묻기만 한다.**\n *\n * 화면이 누르기 전에 먼저 본다. 눌러서 거절당하고 나서야 「결재선을 정하십시오」를 듣는 것은, 고를 수\n * 없는 것을 골라 보게 한 것이다.\n */\nexport function inspectApprovalRoute(manager: EntityManager, domainId: string, axis: string) {\n return inspector?.(manager, domainId, axis)\n}\n\nexport async function assertApprovalRouteReady(manager: EntityManager, domainId: string, axis: string) {\n const report = await inspector?.(manager, domainId, axis)\n\n /* 답이 없으면 이 앱은 아직 이 물음에 답할 길이 없다 — 막지 않는다. */\n if (!report || report.ready) {\n return\n }\n\n throw new Refusal(\n 'MASTER_APPROVAL_LINE_REQUIRED',\n { axis, activity: report.activity },\n 'Set the approval line for this activity before requiring approval on this master axis.'\n )\n}\n"]}
@@ -0,0 +1,106 @@
1
+ import type { RatedUsage, RatedUsageMissing, ResourceClassDef, TestResult } from '@operato/ops-contract';
2
+ /**
3
+ * 이 자산을 지금 써도 되나 — **반복해서 쓰는 물건의 수명을 거는 자리.**
4
+ *
5
+ * 자산은 설비와 달리 **돌아온다.** 그래서 「고장인가」가 아니라 「몇 번 더 쓸 수 있나 · 교정이 살아
6
+ * 있나」를 묻는다. 정격을 넘긴 지그로 계속 찍으면 치수가 벌어지고, 그 사실은 며칠 뒤 검사에서야
7
+ * 드러난다. 그때는 이미 만든 것이 다 나가 있다.
8
+ *
9
+ * ── 교정에 새 칸을 만들지 않았다 ────────────────────────────────────────────
10
+ * 자산은 이미 `testSpecificationIds` 와 `testResults` 를 든다. 교정은 검사이고, 교정 기한이 지난 것은
11
+ * **검사 결과가 만료된 것**이다. 자격에서 쓴 판단이 그대로 붙는다 — `calibrationDue` 같은 칸을 새로
12
+ * 만들면 같은 사실이 두 곳에 살고, 둘이 어긋나는 날이 온다.
13
+ *
14
+ * 새로 필요한 것은 **사용 횟수** 하나뿐이다. 그것만 정격(`cycleLimit`)과 견준다.
15
+ *
16
+ * ── 기록이 없을 때 (인원과 같은 규율) ──────────────────────────────────────
17
+ * 교정 기록이 없으면 막는다. 「교정한 적이 없다」는 「교정이 살아 있다」가 아니다.
18
+ */
19
+ export type AssetLack =
20
+ /** 그 이름이 자산 마스터에 없다 — 등록하거나 이름을 고친다. */
21
+ 'not-registered'
22
+ /** 폐기했거나 아직 들여오지 않았다. */
23
+ | 'not-effective'
24
+ /** 요구된 교정의 기록이 없다. */
25
+ | 'calibration-missing'
26
+ /** 교정에 불합격했다. */
27
+ | 'calibration-failed'
28
+ /** 교정 기한이 지났다 — 교정하면 된다. */
29
+ | 'calibration-expired'
30
+ /** 정격 사용량을 넘겼다 — 교체하거나 정격을 다시 정한다. */
31
+ | 'cycle-exceeded'
32
+ /**
33
+ * 정격과 쓴 양의 **단위가 달라 견줄 수 없다.**
34
+ *
35
+ * 50미터 정격에 「120번 썼다」가 오면 답할 수 있는 것이 없다. 숫자만 견주면 120 > 50 이라
36
+ * 「수명 끝」이라고 말하는데, 그것은 참일 수도 거짓일 수도 있다. 막지도 통과시키지도 않고
37
+ * 이 사실을 낸다 — 마스터를 고쳐야 하는 자리다.
38
+ */
39
+ | 'usage-uom-mismatch';
40
+ export interface AssetGap {
41
+ assetName: string;
42
+ lack: AssetLack;
43
+ /** 교정 때문이면 어느 검사인가. */
44
+ specId?: string;
45
+ /** 만료된 것이면 언제 만료됐나(ISO). */
46
+ expiredAt?: string;
47
+ /** 정격을 넘긴 것이면 얼마를 썼고 정격이 얼마인가. */
48
+ used?: number;
49
+ /** 정격. */
50
+ limit?: number;
51
+ /** 정격의 단위 — 「번」이면 `C62`, 길이는 `MTR`. */
52
+ uom?: string;
53
+ }
54
+ /** 화면이 보여 줄 수명. 남은 횟수를 **모르면 비운다** — 0 으로 두면 「다 썼다」로 읽힌다. */
55
+ export interface AssetLifecycle {
56
+ assetName: string;
57
+ /** 교정 이후 몇 번 썼나. */
58
+ used: number;
59
+ /** 정격 — 선언하지 않았으면 없다. */
60
+ limit?: number;
61
+ /** 정격의 단위. */
62
+ uom?: string;
63
+ /**
64
+ * 남은 양 — **낼 수 없으면 없다.**
65
+ *
66
+ * 정격이 없으면 무한이 아니고, 단위가 다르면 견줄 수 없다. 그때 0 으로 두면 「다 썼다」로
67
+ * 읽힌다.
68
+ */
69
+ remaining?: number;
70
+ /** 왜 판정하지 못했나 — 계약의 낱말 그대로(§`RatedUsageMissing`). */
71
+ usageMissing?: RatedUsageMissing[];
72
+ /** 언제 교정했나(ISO) — 그 시점부터 센다. */
73
+ calibratedAt?: string;
74
+ /** 교정이 언제 만료되나(ISO). */
75
+ calibrationExpiresAt?: string;
76
+ gaps: AssetGap[];
77
+ }
78
+ /** 판단에 필요한 자산의 사실만. 엔티티를 통째로 받지 않는다. */
79
+ export interface JudgeableAsset {
80
+ name: string;
81
+ assetClassIds?: string[];
82
+ /**
83
+ * 정격 사용량 — 얼마를 쓰면 교체하나. 선언하지 않았으면 이 축으로 막지 않는다.
84
+ *
85
+ * **단위가 함께 온다.** 「번」으로 세는 것만 다루면 라우터 비트의 50미터를 담을 수 없다.
86
+ */
87
+ ratedUsage?: RatedUsage;
88
+ testResults?: TestResult[];
89
+ effectiveStart?: Date | string;
90
+ effectiveEnd?: Date | string;
91
+ }
92
+ /**
93
+ * **언제부터 세나** — 마지막으로 통과한 교정 시각.
94
+ *
95
+ * 사용 횟수는 교정 이후로 센다. 교정은 자산을 처음 상태로 되돌리는 일이고, 되돌린 뒤에도 예전 횟수를
96
+ * 계속 세면 멀쩡한 지그가 정격 초과로 잠긴다.
97
+ *
98
+ * 교정 기록이 없으면 비운다 — 부르는 쪽이 **처음부터** 센다.
99
+ */
100
+ export declare function calibrationBaselineOf(asset: JudgeableAsset): string | undefined;
101
+ /**
102
+ * 이 자산을 지금 써도 되나.
103
+ *
104
+ * `usedSinceCalibration` 은 부르는 쪽이 센다 — 사용 기록은 실적에 있고 여기는 마스터이기 때문이다.
105
+ */
106
+ export declare function assetLifecycleOf(asset: JudgeableAsset, classDefs: readonly ResourceClassDef[], usedSinceCalibration: number, at: string): AssetLifecycle;