@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.
- package/dist-client/bootstrap.d.ts +19 -0
- package/dist-client/bootstrap.js +66 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/index.d.ts +17 -0
- package/dist-client/index.js +21 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/master-change-approval.d.ts +14 -0
- package/dist-client/master-change-approval.js +36 -0
- package/dist-client/master-change-approval.js.map +1 -0
- package/dist-client/master-change-policy-axes.d.ts +37 -0
- package/dist-client/master-change-policy-axes.js +29 -0
- package/dist-client/master-change-policy-axes.js.map +1 -0
- package/dist-client/master-change-policy-panel.d.ts +59 -0
- package/dist-client/master-change-policy-panel.js +454 -0
- package/dist-client/master-change-policy-panel.js.map +1 -0
- package/dist-client/master-change-providers.d.ts +4 -0
- package/dist-client/master-change-providers.js +91 -0
- package/dist-client/master-change-providers.js.map +1 -0
- package/dist-client/pages/master/applied-when-dialog.d.ts +48 -0
- package/dist-client/pages/master/applied-when-dialog.js +137 -0
- package/dist-client/pages/master/applied-when-dialog.js.map +1 -0
- package/dist-client/pages/master/assignment-fields.d.ts +27 -0
- package/dist-client/pages/master/assignment-fields.js +62 -0
- package/dist-client/pages/master/assignment-fields.js.map +1 -0
- package/dist-client/pages/master/equipment-class.d.ts +12 -0
- package/dist-client/pages/master/equipment-class.js +42 -0
- package/dist-client/pages/master/equipment-class.js.map +1 -0
- package/dist-client/pages/master/equipment.d.ts +12 -0
- package/dist-client/pages/master/equipment.js +58 -0
- package/dist-client/pages/master/equipment.js.map +1 -0
- package/dist-client/pages/master/grist-iso-duration.d.ts +20 -0
- package/dist-client/pages/master/grist-iso-duration.js +70 -0
- package/dist-client/pages/master/grist-iso-duration.js.map +1 -0
- package/dist-client/pages/master/grist-reference.d.ts +91 -0
- package/dist-client/pages/master/grist-reference.js +419 -0
- package/dist-client/pages/master/grist-reference.js.map +1 -0
- package/dist-client/pages/master/import-rows.d.ts +35 -0
- package/dist-client/pages/master/import-rows.js +66 -0
- package/dist-client/pages/master/import-rows.js.map +1 -0
- package/dist-client/pages/master/iso-duration.d.ts +34 -0
- package/dist-client/pages/master/iso-duration.js +76 -0
- package/dist-client/pages/master/iso-duration.js.map +1 -0
- package/dist-client/pages/master/master-options.d.ts +40 -0
- package/dist-client/pages/master/master-options.js +54 -0
- package/dist-client/pages/master/master-options.js.map +1 -0
- package/dist-client/pages/master/master-page-base.d.ts +369 -0
- package/dist-client/pages/master/master-page-base.js +657 -0
- package/dist-client/pages/master/master-page-base.js.map +1 -0
- package/dist-client/pages/master/material-class.d.ts +12 -0
- package/dist-client/pages/master/material-class.js +42 -0
- package/dist-client/pages/master/material-class.js.map +1 -0
- package/dist-client/pages/master/material-definition.d.ts +5 -0
- package/dist-client/pages/master/material-definition.js +14 -0
- package/dist-client/pages/master/material-definition.js.map +1 -0
- package/dist-client/pages/master/material-revision-fields.d.ts +2 -0
- package/dist-client/pages/master/material-revision-fields.js +43 -0
- package/dist-client/pages/master/material-revision-fields.js.map +1 -0
- package/dist-client/pages/master/operation-definition.d.ts +12 -0
- package/dist-client/pages/master/operation-definition.js +49 -0
- package/dist-client/pages/master/operation-definition.js.map +1 -0
- package/dist-client/pages/master/operational-location.d.ts +84 -0
- package/dist-client/pages/master/operational-location.js +432 -0
- package/dist-client/pages/master/operational-location.js.map +1 -0
- package/dist-client/pages/master/person.d.ts +12 -0
- package/dist-client/pages/master/person.js +41 -0
- package/dist-client/pages/master/person.js.map +1 -0
- package/dist-client/pages/master/personnel-class.d.ts +12 -0
- package/dist-client/pages/master/personnel-class.js +43 -0
- package/dist-client/pages/master/personnel-class.js.map +1 -0
- package/dist-client/pages/master/physical-asset-class.d.ts +12 -0
- package/dist-client/pages/master/physical-asset-class.js +40 -0
- package/dist-client/pages/master/physical-asset-class.js.map +1 -0
- package/dist-client/pages/master/physical-asset.d.ts +12 -0
- package/dist-client/pages/master/physical-asset.js +41 -0
- package/dist-client/pages/master/physical-asset.js.map +1 -0
- package/dist-client/pages/master/recipe-definition.d.ts +5 -0
- package/dist-client/pages/master/recipe-definition.js +14 -0
- package/dist-client/pages/master/recipe-definition.js.map +1 -0
- package/dist-client/pages/master/reference-targets.d.ts +42 -0
- package/dist-client/pages/master/reference-targets.js +82 -0
- package/dist-client/pages/master/reference-targets.js.map +1 -0
- package/dist-client/pages/master/revision-comparison.d.ts +49 -0
- package/dist-client/pages/master/revision-comparison.js +560 -0
- package/dist-client/pages/master/revision-comparison.js.map +1 -0
- package/dist-client/pages/master/revision-view.d.ts +34 -0
- package/dist-client/pages/master/revision-view.js +145 -0
- package/dist-client/pages/master/revision-view.js.map +1 -0
- package/dist-client/pages/master/revision-workspace.d.ts +50 -0
- package/dist-client/pages/master/revision-workspace.js +763 -0
- package/dist-client/pages/master/revision-workspace.js.map +1 -0
- package/dist-client/pages/master/route-definition.d.ts +19 -0
- package/dist-client/pages/master/route-definition.js +40 -0
- package/dist-client/pages/master/route-definition.js.map +1 -0
- package/dist-client/pages/master/stop-reason.d.ts +12 -0
- package/dist-client/pages/master/stop-reason.js +48 -0
- package/dist-client/pages/master/stop-reason.js.map +1 -0
- package/dist-client/pages/master/test-specification.d.ts +5 -0
- package/dist-client/pages/master/test-specification.js +14 -0
- package/dist-client/pages/master/test-specification.js.map +1 -0
- package/dist-client/pages/master-axes.d.ts +24 -0
- package/dist-client/pages/master-axes.js +39 -0
- package/dist-client/pages/master-axes.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +81 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/index.d.ts +1 -0
- package/dist-server/index.js +19 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/service/ai-entry/master-entry-rules.d.ts +175 -0
- package/dist-server/service/ai-entry/master-entry-rules.js +302 -0
- package/dist-server/service/ai-entry/master-entry-rules.js.map +1 -0
- package/dist-server/service/ai-entry/master-entry-targets.d.ts +23 -0
- package/dist-server/service/ai-entry/master-entry-targets.js +293 -0
- package/dist-server/service/ai-entry/master-entry-targets.js.map +1 -0
- package/dist-server/service/approval-route.d.ts +37 -0
- package/dist-server/service/approval-route.js +34 -0
- package/dist-server/service/approval-route.js.map +1 -0
- package/dist-server/service/asset/asset-lifecycle.d.ts +106 -0
- package/dist-server/service/asset/asset-lifecycle.js +126 -0
- package/dist-server/service/asset/asset-lifecycle.js.map +1 -0
- package/dist-server/service/asset/asset-master-resolver.d.ts +53 -0
- package/dist-server/service/asset/asset-master-resolver.js +185 -0
- package/dist-server/service/asset/asset-master-resolver.js.map +1 -0
- package/dist-server/service/asset/asset-master.d.ts +21 -0
- package/dist-server/service/asset/asset-master.js +25 -0
- package/dist-server/service/asset/asset-master.js.map +1 -0
- package/dist-server/service/asset/asset-query.d.ts +16 -0
- package/dist-server/service/asset/asset-query.js +72 -0
- package/dist-server/service/asset/asset-query.js.map +1 -0
- package/dist-server/service/asset/index.d.ts +6 -0
- package/dist-server/service/asset/index.js +10 -0
- package/dist-server/service/asset/index.js.map +1 -0
- package/dist-server/service/asset/physical-asset-class.d.ts +34 -0
- package/dist-server/service/asset/physical-asset-class.js +104 -0
- package/dist-server/service/asset/physical-asset-class.js.map +1 -0
- package/dist-server/service/asset/physical-asset.d.ts +66 -0
- package/dist-server/service/asset/physical-asset.js +123 -0
- package/dist-server/service/asset/physical-asset.js.map +1 -0
- package/dist-server/service/assignment/applied-when.d.ts +24 -0
- package/dist-server/service/assignment/applied-when.js +16 -0
- package/dist-server/service/assignment/applied-when.js.map +1 -0
- package/dist-server/service/assignment/assignment-history.d.ts +92 -0
- package/dist-server/service/assignment/assignment-history.js +289 -0
- package/dist-server/service/assignment/assignment-history.js.map +1 -0
- package/dist-server/service/assignment/assignment-write.d.ts +42 -0
- package/dist-server/service/assignment/assignment-write.js +101 -0
- package/dist-server/service/assignment/assignment-write.js.map +1 -0
- package/dist-server/service/assignment/master-value-claim.d.ts +135 -0
- package/dist-server/service/assignment/master-value-claim.js +174 -0
- package/dist-server/service/assignment/master-value-claim.js.map +1 -0
- package/dist-server/service/equipment/equipment-class.d.ts +34 -0
- package/dist-server/service/equipment/equipment-class.js +104 -0
- package/dist-server/service/equipment/equipment-class.js.map +1 -0
- package/dist-server/service/equipment/equipment-master-resolver.d.ts +77 -0
- package/dist-server/service/equipment/equipment-master-resolver.js +266 -0
- package/dist-server/service/equipment/equipment-master-resolver.js.map +1 -0
- package/dist-server/service/equipment/equipment-master.d.ts +30 -0
- package/dist-server/service/equipment/equipment-master.js +53 -0
- package/dist-server/service/equipment/equipment-master.js.map +1 -0
- package/dist-server/service/equipment/equipment-query.d.ts +16 -0
- package/dist-server/service/equipment/equipment-query.js +72 -0
- package/dist-server/service/equipment/equipment-query.js.map +1 -0
- package/dist-server/service/equipment/equipment.d.ts +71 -0
- package/dist-server/service/equipment/equipment.js +138 -0
- package/dist-server/service/equipment/equipment.js.map +1 -0
- package/dist-server/service/equipment/index.d.ts +8 -0
- package/dist-server/service/equipment/index.js +12 -0
- package/dist-server/service/equipment/index.js.map +1 -0
- package/dist-server/service/equipment/state-period-rules.d.ts +95 -0
- package/dist-server/service/equipment/state-period-rules.js +122 -0
- package/dist-server/service/equipment/state-period-rules.js.map +1 -0
- package/dist-server/service/equipment/stop-reason-query.d.ts +11 -0
- package/dist-server/service/equipment/stop-reason-query.js +39 -0
- package/dist-server/service/equipment/stop-reason-query.js.map +1 -0
- package/dist-server/service/equipment/stop-reason.d.ts +58 -0
- package/dist-server/service/equipment/stop-reason.js +114 -0
- package/dist-server/service/equipment/stop-reason.js.map +1 -0
- package/dist-server/service/index.d.ts +82 -0
- package/dist-server/service/index.js +145 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/location/index.d.ts +5 -0
- package/dist-server/service/location/index.js +9 -0
- package/dist-server/service/location/index.js.map +1 -0
- package/dist-server/service/location/location-master-resolver.d.ts +60 -0
- package/dist-server/service/location/location-master-resolver.js +313 -0
- package/dist-server/service/location/location-master-resolver.js.map +1 -0
- package/dist-server/service/location/location-master.d.ts +26 -0
- package/dist-server/service/location/location-master.js +28 -0
- package/dist-server/service/location/location-master.js.map +1 -0
- package/dist-server/service/location/location-query.d.ts +15 -0
- package/dist-server/service/location/location-query.js +56 -0
- package/dist-server/service/location/location-query.js.map +1 -0
- package/dist-server/service/location/operational-location.d.ts +116 -0
- package/dist-server/service/location/operational-location.js +157 -0
- package/dist-server/service/location/operational-location.js.map +1 -0
- package/dist-server/service/master-axis.d.ts +40 -0
- package/dist-server/service/master-axis.js +57 -0
- package/dist-server/service/master-axis.js.map +1 -0
- package/dist-server/service/master-change-approval/approval-input.d.ts +17 -0
- package/dist-server/service/master-change-approval/approval-input.js +35 -0
- package/dist-server/service/master-change-approval/approval-input.js.map +1 -0
- package/dist-server/service/master-change-approval/builtin-axes.d.ts +4 -0
- package/dist-server/service/master-change-approval/builtin-axes.js +96 -0
- package/dist-server/service/master-change-approval/builtin-axes.js.map +1 -0
- package/dist-server/service/master-change-approval/index.d.ts +14 -0
- package/dist-server/service/master-change-approval/index.js +37 -0
- package/dist-server/service/master-change-approval/index.js.map +1 -0
- package/dist-server/service/master-change-approval/master-change-axis.d.ts +54 -0
- package/dist-server/service/master-change-approval/master-change-axis.js +17 -0
- package/dist-server/service/master-change-approval/master-change-axis.js.map +1 -0
- package/dist-server/service/master-change-approval/master-change-flow.d.ts +65 -0
- package/dist-server/service/master-change-approval/master-change-flow.js +125 -0
- package/dist-server/service/master-change-approval/master-change-flow.js.map +1 -0
- package/dist-server/service/master-change-approval/master-change-resolver.d.ts +18 -0
- package/dist-server/service/master-change-approval/master-change-resolver.js +58 -0
- package/dist-server/service/master-change-approval/master-change-resolver.js.map +1 -0
- package/dist-server/service/master-change-policy.d.ts +122 -0
- package/dist-server/service/master-change-policy.js +304 -0
- package/dist-server/service/master-change-policy.js.map +1 -0
- package/dist-server/service/master-conformance-resolver.d.ts +34 -0
- package/dist-server/service/master-conformance-resolver.js +153 -0
- package/dist-server/service/master-conformance-resolver.js.map +1 -0
- package/dist-server/service/master-conformance.d.ts +80 -0
- package/dist-server/service/master-conformance.js +266 -0
- package/dist-server/service/master-conformance.js.map +1 -0
- package/dist-server/service/master-crud.d.ts +55 -0
- package/dist-server/service/master-crud.js +93 -0
- package/dist-server/service/master-crud.js.map +1 -0
- package/dist-server/service/master-list.d.ts +12 -0
- package/dist-server/service/master-list.js +30 -0
- package/dist-server/service/master-list.js.map +1 -0
- package/dist-server/service/master-page-query.d.ts +33 -0
- package/dist-server/service/master-page-query.js +55 -0
- package/dist-server/service/master-page-query.js.map +1 -0
- package/dist-server/service/master-page.d.ts +85 -0
- package/dist-server/service/master-page.js +104 -0
- package/dist-server/service/master-page.js.map +1 -0
- package/dist-server/service/material/index.d.ts +7 -0
- package/dist-server/service/material/index.js +12 -0
- package/dist-server/service/material/index.js.map +1 -0
- package/dist-server/service/material/material-axis-status.d.ts +8 -0
- package/dist-server/service/material/material-axis-status.js +19 -0
- package/dist-server/service/material/material-axis-status.js.map +1 -0
- package/dist-server/service/material/material-class.d.ts +34 -0
- package/dist-server/service/material/material-class.js +104 -0
- package/dist-server/service/material/material-class.js.map +1 -0
- package/dist-server/service/material/material-definition.d.ts +45 -0
- package/dist-server/service/material/material-definition.js +125 -0
- package/dist-server/service/material/material-definition.js.map +1 -0
- package/dist-server/service/material/material-effective-list.d.ts +39 -0
- package/dist-server/service/material/material-effective-list.js +54 -0
- package/dist-server/service/material/material-effective-list.js.map +1 -0
- package/dist-server/service/material/material-master-resolver.d.ts +106 -0
- package/dist-server/service/material/material-master-resolver.js +351 -0
- package/dist-server/service/material/material-master-resolver.js.map +1 -0
- package/dist-server/service/material/material-master.d.ts +9 -0
- package/dist-server/service/material/material-master.js +24 -0
- package/dist-server/service/material/material-master.js.map +1 -0
- package/dist-server/service/material/material-query.d.ts +16 -0
- package/dist-server/service/material/material-query.js +79 -0
- package/dist-server/service/material/material-query.js.map +1 -0
- package/dist-server/service/material/material-revision-content.d.ts +10 -0
- package/dist-server/service/material/material-revision-content.js +92 -0
- package/dist-server/service/material/material-revision-content.js.map +1 -0
- package/dist-server/service/material/material-revision-resolver.d.ts +60 -0
- package/dist-server/service/material/material-revision-resolver.js +96 -0
- package/dist-server/service/material/material-revision-resolver.js.map +1 -0
- package/dist-server/service/material/material-revision-service.d.ts +179 -0
- package/dist-server/service/material/material-revision-service.js +687 -0
- package/dist-server/service/material/material-revision-service.js.map +1 -0
- package/dist-server/service/material/material-revision.d.ts +86 -0
- package/dist-server/service/material/material-revision.js +339 -0
- package/dist-server/service/material/material-revision.js.map +1 -0
- package/dist-server/service/material/recipe-index.d.ts +23 -0
- package/dist-server/service/material/recipe-index.js +44 -0
- package/dist-server/service/material/recipe-index.js.map +1 -0
- package/dist-server/service/operation/index.d.ts +6 -0
- package/dist-server/service/operation/index.js +10 -0
- package/dist-server/service/operation/index.js.map +1 -0
- package/dist-server/service/operation/operation-definition.d.ts +52 -0
- package/dist-server/service/operation/operation-definition.js +143 -0
- package/dist-server/service/operation/operation-definition.js.map +1 -0
- package/dist-server/service/operation/operation-master-resolver.d.ts +52 -0
- package/dist-server/service/operation/operation-master-resolver.js +187 -0
- package/dist-server/service/operation/operation-master-resolver.js.map +1 -0
- package/dist-server/service/operation/operation-master.d.ts +21 -0
- package/dist-server/service/operation/operation-master.js +28 -0
- package/dist-server/service/operation/operation-master.js.map +1 -0
- package/dist-server/service/operation/operation-query.d.ts +15 -0
- package/dist-server/service/operation/operation-query.js +56 -0
- package/dist-server/service/operation/operation-query.js.map +1 -0
- package/dist-server/service/operation/operation-readiness-resolver.d.ts +39 -0
- package/dist-server/service/operation/operation-readiness-resolver.js +111 -0
- package/dist-server/service/operation/operation-readiness-resolver.js.map +1 -0
- package/dist-server/service/operation/operation-readiness.d.ts +34 -0
- package/dist-server/service/operation/operation-readiness.js +133 -0
- package/dist-server/service/operation/operation-readiness.js.map +1 -0
- package/dist-server/service/personnel/index.d.ts +6 -0
- package/dist-server/service/personnel/index.js +10 -0
- package/dist-server/service/personnel/index.js.map +1 -0
- package/dist-server/service/personnel/person.d.ts +51 -0
- package/dist-server/service/personnel/person.js +119 -0
- package/dist-server/service/personnel/person.js.map +1 -0
- package/dist-server/service/personnel/personnel-class-readiness.d.ts +22 -0
- package/dist-server/service/personnel/personnel-class-readiness.js +98 -0
- package/dist-server/service/personnel/personnel-class-readiness.js.map +1 -0
- package/dist-server/service/personnel/personnel-class.d.ts +54 -0
- package/dist-server/service/personnel/personnel-class.js +114 -0
- package/dist-server/service/personnel/personnel-class.js.map +1 -0
- package/dist-server/service/personnel/personnel-master-resolver.d.ts +53 -0
- package/dist-server/service/personnel/personnel-master-resolver.js +187 -0
- package/dist-server/service/personnel/personnel-master-resolver.js.map +1 -0
- package/dist-server/service/personnel/personnel-master.d.ts +39 -0
- package/dist-server/service/personnel/personnel-master.js +34 -0
- package/dist-server/service/personnel/personnel-master.js.map +1 -0
- package/dist-server/service/personnel/personnel-query.d.ts +29 -0
- package/dist-server/service/personnel/personnel-query.js +79 -0
- package/dist-server/service/personnel/personnel-query.js.map +1 -0
- package/dist-server/service/personnel/qualification.d.ts +104 -0
- package/dist-server/service/personnel/qualification.js +147 -0
- package/dist-server/service/personnel/qualification.js.map +1 -0
- package/dist-server/service/quality/index.d.ts +4 -0
- package/dist-server/service/quality/index.js +8 -0
- package/dist-server/service/quality/index.js.map +1 -0
- package/dist-server/service/quality/nonconformance-cause-resolver.d.ts +12 -0
- package/dist-server/service/quality/nonconformance-cause-resolver.js +60 -0
- package/dist-server/service/quality/nonconformance-cause-resolver.js.map +1 -0
- package/dist-server/service/quality/nonconformance-cause.d.ts +20 -0
- package/dist-server/service/quality/nonconformance-cause.js +90 -0
- package/dist-server/service/quality/nonconformance-cause.js.map +1 -0
- package/dist-server/service/recipe/index.d.ts +10 -0
- package/dist-server/service/recipe/index.js +16 -0
- package/dist-server/service/recipe/index.js.map +1 -0
- package/dist-server/service/recipe/recipe-definition.d.ts +75 -0
- package/dist-server/service/recipe/recipe-definition.js +143 -0
- package/dist-server/service/recipe/recipe-definition.js.map +1 -0
- package/dist-server/service/recipe/recipe-effective-list.d.ts +49 -0
- package/dist-server/service/recipe/recipe-effective-list.js +96 -0
- package/dist-server/service/recipe/recipe-effective-list.js.map +1 -0
- package/dist-server/service/recipe/recipe-master-resolver.d.ts +28 -0
- package/dist-server/service/recipe/recipe-master-resolver.js +128 -0
- package/dist-server/service/recipe/recipe-master-resolver.js.map +1 -0
- package/dist-server/service/recipe/recipe-master.d.ts +37 -0
- package/dist-server/service/recipe/recipe-master.js +47 -0
- package/dist-server/service/recipe/recipe-master.js.map +1 -0
- package/dist-server/service/recipe/recipe-query.d.ts +21 -0
- package/dist-server/service/recipe/recipe-query.js +82 -0
- package/dist-server/service/recipe/recipe-query.js.map +1 -0
- package/dist-server/service/recipe/recipe-revision-content.d.ts +32 -0
- package/dist-server/service/recipe/recipe-revision-content.js +70 -0
- package/dist-server/service/recipe/recipe-revision-content.js.map +1 -0
- package/dist-server/service/recipe/recipe-revision-line.d.ts +30 -0
- package/dist-server/service/recipe/recipe-revision-line.js +95 -0
- package/dist-server/service/recipe/recipe-revision-line.js.map +1 -0
- package/dist-server/service/recipe/recipe-revision-resolver.d.ts +65 -0
- package/dist-server/service/recipe/recipe-revision-resolver.js +96 -0
- package/dist-server/service/recipe/recipe-revision-resolver.js.map +1 -0
- package/dist-server/service/recipe/recipe-revision-service.d.ts +183 -0
- package/dist-server/service/recipe/recipe-revision-service.js +754 -0
- package/dist-server/service/recipe/recipe-revision-service.js.map +1 -0
- package/dist-server/service/recipe/recipe-revision.d.ts +102 -0
- package/dist-server/service/recipe/recipe-revision.js +373 -0
- package/dist-server/service/recipe/recipe-revision.js.map +1 -0
- package/dist-server/service/recipe/route-definition.d.ts +51 -0
- package/dist-server/service/recipe/route-definition.js +114 -0
- package/dist-server/service/recipe/route-definition.js.map +1 -0
- package/dist-server/service/resource/class-lineage.d.ts +46 -0
- package/dist-server/service/resource/class-lineage.js +80 -0
- package/dist-server/service/resource/class-lineage.js.map +1 -0
- package/dist-server/service/resource/class-members.d.ts +36 -0
- package/dist-server/service/resource/class-members.js +59 -0
- package/dist-server/service/resource/class-members.js.map +1 -0
- package/dist-server/service/resource/referrers.d.ts +54 -0
- package/dist-server/service/resource/referrers.js +99 -0
- package/dist-server/service/resource/referrers.js.map +1 -0
- package/dist-server/service/resource/resource-class.d.ts +25 -0
- package/dist-server/service/resource/resource-class.js +29 -0
- package/dist-server/service/resource/resource-class.js.map +1 -0
- package/dist-server/service/revision-baseline.d.ts +71 -0
- package/dist-server/service/revision-baseline.js +87 -0
- package/dist-server/service/revision-baseline.js.map +1 -0
- package/dist-server/service/row-lock.d.ts +22 -0
- package/dist-server/service/row-lock.js +31 -0
- package/dist-server/service/row-lock.js.map +1 -0
- package/dist-server/service/status/axis-stamp.d.ts +16 -0
- package/dist-server/service/status/axis-stamp.js +22 -0
- package/dist-server/service/status/axis-stamp.js.map +1 -0
- package/dist-server/service/status/index.d.ts +3 -0
- package/dist-server/service/status/index.js +7 -0
- package/dist-server/service/status/index.js.map +1 -0
- package/dist-server/service/status/master-status.d.ts +38 -0
- package/dist-server/service/status/master-status.js +129 -0
- package/dist-server/service/status/master-status.js.map +1 -0
- package/dist-server/service/test-spec/criteria-check.d.ts +53 -0
- package/dist-server/service/test-spec/criteria-check.js +142 -0
- package/dist-server/service/test-spec/criteria-check.js.map +1 -0
- package/dist-server/service/test-spec/criteria-rows.d.ts +89 -0
- package/dist-server/service/test-spec/criteria-rows.js +139 -0
- package/dist-server/service/test-spec/criteria-rows.js.map +1 -0
- package/dist-server/service/test-spec/index.d.ts +6 -0
- package/dist-server/service/test-spec/index.js +11 -0
- package/dist-server/service/test-spec/index.js.map +1 -0
- package/dist-server/service/test-spec/test-spec-effective-list.d.ts +34 -0
- package/dist-server/service/test-spec/test-spec-effective-list.js +42 -0
- package/dist-server/service/test-spec/test-spec-effective-list.js.map +1 -0
- package/dist-server/service/test-spec/test-spec-master-resolver.d.ts +44 -0
- package/dist-server/service/test-spec/test-spec-master-resolver.js +144 -0
- package/dist-server/service/test-spec/test-spec-master-resolver.js.map +1 -0
- package/dist-server/service/test-spec/test-spec-master.d.ts +6 -0
- package/dist-server/service/test-spec/test-spec-master.js +18 -0
- package/dist-server/service/test-spec/test-spec-master.js.map +1 -0
- package/dist-server/service/test-spec/test-spec-query.d.ts +15 -0
- package/dist-server/service/test-spec/test-spec-query.js +61 -0
- package/dist-server/service/test-spec/test-spec-query.js.map +1 -0
- package/dist-server/service/test-spec/test-spec-revision-resolver.d.ts +59 -0
- package/dist-server/service/test-spec/test-spec-revision-resolver.js +96 -0
- package/dist-server/service/test-spec/test-spec-revision-resolver.js.map +1 -0
- package/dist-server/service/test-spec/test-spec-revision-service.d.ts +178 -0
- package/dist-server/service/test-spec/test-spec-revision-service.js +685 -0
- package/dist-server/service/test-spec/test-spec-revision-service.js.map +1 -0
- package/dist-server/service/test-spec/test-spec-revision.d.ts +86 -0
- package/dist-server/service/test-spec/test-spec-revision.js +334 -0
- package/dist-server/service/test-spec/test-spec-revision.js.map +1 -0
- package/dist-server/service/test-spec/test-specification.d.ts +47 -0
- package/dist-server/service/test-spec/test-specification.js +119 -0
- package/dist-server/service/test-spec/test-specification.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,82 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;CAmBxB,CAAA;AAnBY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;;6CACpD;AAGf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;4CACpD;AAQd;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,8DAA8D,EAAE,CAAC;;6CACvE;AAIhB;IADC,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W,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"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAA;IAC9D,OAAO,KAAK,CAAC,IAAI,EAAE,CAAA;AACrB,CAAC;AACD,6EAA6E;AAC7E,MAAM,SAAS,GAAG,CAAC,CAAA;AAEnB,SAAS,KAAK,CAAC,KAAc,EAAE,IAA0B;IACvD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IACzD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC/B,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,OAAO,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,CAAA;QAClE,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,KAAK,UAAU,CAAC,CAAA;QAClE,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;YAAE,OAAO,CAAC,GA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Q,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"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,CAA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B,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"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
|
@@ -0,0 +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AAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IACjD,mBAAA,IAAA,kBAAG,EAAC,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7C,mBAAA,IAAA,kBAAG,EAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IACvD,mBAAA,IAAA,kBAAG,EAAC,YAAY,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IACnD,mBAAA,IAAA,kBAAG,EAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,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"]}
|