@antelopejs/dms-automation 0.6.0 → 0.8.0

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 (262) hide show
  1. package/README.md +21 -7
  2. package/dist/cluster/bus.js +8 -6
  3. package/dist/cluster/bus.js.map +1 -1
  4. package/dist/cluster/leader.js.map +1 -1
  5. package/dist/data/procedures-query.d.ts +19 -0
  6. package/dist/data/procedures-query.js +105 -0
  7. package/dist/data/procedures-query.js.map +1 -0
  8. package/dist/data/procedures-table.d.ts +5 -16
  9. package/dist/data/procedures-table.js +12 -101
  10. package/dist/data/procedures-table.js.map +1 -1
  11. package/dist/data/runs-table.js +0 -5
  12. package/dist/data/runs-table.js.map +1 -1
  13. package/dist/db/models/automation_template.model.d.ts +2 -4
  14. package/dist/db/models/automation_template.model.js +13 -14
  15. package/dist/db/models/automation_template.model.js.map +1 -1
  16. package/dist/db/models/procedure_run.model.js.map +1 -1
  17. package/dist/db/models/stats.model.js.map +1 -1
  18. package/dist/db/tables/procedure.table.d.ts +0 -1
  19. package/dist/db/tables/procedure.table.js +0 -4
  20. package/dist/db/tables/procedure.table.js.map +1 -1
  21. package/dist/db/tables/procedure_run.table.d.ts +2 -1
  22. package/dist/db/tables/procedure_run.table.js.map +1 -1
  23. package/dist/implementations/dms-automation/index.js.map +1 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/pages/category.js.map +1 -1
  26. package/dist/pages/index.js.map +1 -1
  27. package/dist/pages/overview.js.map +1 -1
  28. package/dist/pages/procedures.js.map +1 -1
  29. package/dist/pages/runs.js.map +1 -1
  30. package/dist/pages/shared.js +1 -1
  31. package/dist/pages/shared.js.map +1 -1
  32. package/dist/realtime.d.ts +2 -1
  33. package/dist/realtime.js.map +1 -1
  34. package/dist/routes/action-types.d.ts +2 -1
  35. package/dist/routes/action-types.js.map +1 -1
  36. package/dist/routes/deleteConfirm.js +4 -3
  37. package/dist/routes/deleteConfirm.js.map +1 -1
  38. package/dist/routes/graphSchema.d.ts +2 -1
  39. package/dist/routes/graphSchema.js +8 -7
  40. package/dist/routes/graphSchema.js.map +1 -1
  41. package/dist/routes/procedureChecks.js +5 -5
  42. package/dist/routes/procedureChecks.js.map +1 -1
  43. package/dist/routes/procedureRuns.d.ts +2 -2
  44. package/dist/routes/procedureRuns.js +1 -1
  45. package/dist/routes/procedureRuns.js.map +1 -1
  46. package/dist/routes/procedures.d.ts +14 -15
  47. package/dist/routes/procedures.js +2 -1
  48. package/dist/routes/procedures.js.map +1 -1
  49. package/dist/routes/requests.d.ts +11 -5
  50. package/dist/routes/requests.js.map +1 -1
  51. package/dist/routes/runs.d.ts +7 -7
  52. package/dist/routes/runs.js +5 -3
  53. package/dist/routes/runs.js.map +1 -1
  54. package/dist/routes/stats.js.map +1 -1
  55. package/dist/routes/templates.d.ts +3 -2
  56. package/dist/routes/templates.js +2 -1
  57. package/dist/routes/templates.js.map +1 -1
  58. package/dist/routes/trigger-types.d.ts +2 -1
  59. package/dist/routes/trigger-types.js.map +1 -1
  60. package/dist/routes/typeConfigShared.d.ts +2 -1
  61. package/dist/routes/typeConfigShared.js.map +1 -1
  62. package/dist/runtime/armErrors.d.ts +0 -1
  63. package/dist/runtime/armErrors.js +0 -7
  64. package/dist/runtime/armErrors.js.map +1 -1
  65. package/dist/runtime/boundRunLog.d.ts +1 -0
  66. package/dist/runtime/boundRunLog.js +11 -11
  67. package/dist/runtime/boundRunLog.js.map +1 -1
  68. package/dist/runtime/builtins/actions/http.js +16 -9
  69. package/dist/runtime/builtins/actions/http.js.map +1 -1
  70. package/dist/runtime/builtins/actions/log.js.map +1 -1
  71. package/dist/runtime/builtins/data/boolean.js +4 -5
  72. package/dist/runtime/builtins/data/boolean.js.map +1 -1
  73. package/dist/runtime/builtins/data/compare.js +8 -10
  74. package/dist/runtime/builtins/data/compare.js.map +1 -1
  75. package/dist/runtime/builtins/data/constant.js +1 -1
  76. package/dist/runtime/builtins/data/constant.js.map +1 -1
  77. package/dist/runtime/builtins/data/json.js +4 -5
  78. package/dist/runtime/builtins/data/json.js.map +1 -1
  79. package/dist/runtime/builtins/data/math.js +4 -4
  80. package/dist/runtime/builtins/data/math.js.map +1 -1
  81. package/dist/runtime/builtins/data/object.js +12 -17
  82. package/dist/runtime/builtins/data/object.js.map +1 -1
  83. package/dist/runtime/builtins/data/string.js +13 -18
  84. package/dist/runtime/builtins/data/string.js.map +1 -1
  85. package/dist/runtime/builtins/nodes/action.js +5 -2
  86. package/dist/runtime/builtins/nodes/action.js.map +1 -1
  87. package/dist/runtime/builtins/nodes/data.js +2 -2
  88. package/dist/runtime/builtins/nodes/data.js.map +1 -1
  89. package/dist/runtime/builtins/nodes/delay.js +2 -2
  90. package/dist/runtime/builtins/nodes/delay.js.map +1 -1
  91. package/dist/runtime/builtins/nodes/forRange.js +2 -2
  92. package/dist/runtime/builtins/nodes/forRange.js.map +1 -1
  93. package/dist/runtime/builtins/nodes/foreach.js +2 -2
  94. package/dist/runtime/builtins/nodes/foreach.js.map +1 -1
  95. package/dist/runtime/builtins/nodes/groupInput.js +2 -2
  96. package/dist/runtime/builtins/nodes/groupInput.js.map +1 -1
  97. package/dist/runtime/builtins/nodes/groupOutput.js +2 -2
  98. package/dist/runtime/builtins/nodes/groupOutput.js.map +1 -1
  99. package/dist/runtime/builtins/nodes/if.js +2 -2
  100. package/dist/runtime/builtins/nodes/if.js.map +1 -1
  101. package/dist/runtime/builtins/nodes/parallel.js +2 -2
  102. package/dist/runtime/builtins/nodes/parallel.js.map +1 -1
  103. package/dist/runtime/builtins/nodes/retry.js +5 -6
  104. package/dist/runtime/builtins/nodes/retry.js.map +1 -1
  105. package/dist/runtime/builtins/nodes/setVariable.js +2 -2
  106. package/dist/runtime/builtins/nodes/setVariable.js.map +1 -1
  107. package/dist/runtime/builtins/nodes/switch.js +2 -2
  108. package/dist/runtime/builtins/nodes/switch.js.map +1 -1
  109. package/dist/runtime/builtins/nodes/trigger.js +2 -2
  110. package/dist/runtime/builtins/nodes/trigger.js.map +1 -1
  111. package/dist/runtime/builtins/nodes/tryCatch.js +2 -4
  112. package/dist/runtime/builtins/nodes/tryCatch.js.map +1 -1
  113. package/dist/runtime/builtins/triggers/cron.d.ts +2 -1
  114. package/dist/runtime/builtins/triggers/cron.js +5 -7
  115. package/dist/runtime/builtins/triggers/cron.js.map +1 -1
  116. package/dist/runtime/builtins/triggers/webhook.d.ts +6 -5
  117. package/dist/runtime/builtins/triggers/webhook.js +9 -6
  118. package/dist/runtime/builtins/triggers/webhook.js.map +1 -1
  119. package/dist/runtime/declaredProcedures.d.ts +2 -2
  120. package/dist/runtime/declaredProcedures.js +17 -92
  121. package/dist/runtime/declaredProcedures.js.map +1 -1
  122. package/dist/runtime/describe.js +11 -10
  123. package/dist/runtime/describe.js.map +1 -1
  124. package/dist/runtime/executionResult.d.ts +1 -1
  125. package/dist/runtime/executor.js +12 -38
  126. package/dist/runtime/executor.js.map +1 -1
  127. package/dist/runtime/flatten.d.ts +1 -1
  128. package/dist/runtime/flatten.js +1 -1
  129. package/dist/runtime/flatten.js.map +1 -1
  130. package/dist/runtime/graphIssues.js +24 -22
  131. package/dist/runtime/graphIssues.js.map +1 -1
  132. package/dist/runtime/graphVersion.d.ts +1 -1
  133. package/dist/runtime/graphVersion.js +2 -1
  134. package/dist/runtime/graphVersion.js.map +1 -1
  135. package/dist/runtime/nodeKinds.d.ts +3 -2
  136. package/dist/runtime/nodeKinds.js.map +1 -1
  137. package/dist/runtime/reconcile.d.ts +3 -0
  138. package/dist/runtime/reconcile.js +178 -0
  139. package/dist/runtime/reconcile.js.map +1 -0
  140. package/dist/runtime/registry.d.ts +0 -7
  141. package/dist/runtime/registry.js +3 -24
  142. package/dist/runtime/registry.js.map +1 -1
  143. package/dist/runtime/resolveInputs.d.ts +4 -2
  144. package/dist/runtime/resolveInputs.js +13 -12
  145. package/dist/runtime/resolveInputs.js.map +1 -1
  146. package/dist/runtime/resolveSubgraph.js +4 -5
  147. package/dist/runtime/resolveSubgraph.js.map +1 -1
  148. package/dist/runtime/retention.js.map +1 -1
  149. package/dist/runtime/runProcedure.d.ts +1 -1
  150. package/dist/runtime/runProcedure.js +2 -1
  151. package/dist/runtime/runProcedure.js.map +1 -1
  152. package/dist/runtime/schedule.js +3 -0
  153. package/dist/runtime/schedule.js.map +1 -1
  154. package/dist/runtime/schemaProperties.d.ts +11 -0
  155. package/dist/runtime/schemaProperties.js +7 -0
  156. package/dist/runtime/schemaProperties.js.map +1 -0
  157. package/dist/runtime/serialQueue.d.ts +1 -1
  158. package/dist/runtime/serialQueue.js +4 -4
  159. package/dist/runtime/serialQueue.js.map +1 -1
  160. package/dist/runtime/subscriptions.js +21 -183
  161. package/dist/runtime/subscriptions.js.map +1 -1
  162. package/dist/runtime/subwalk.js.map +1 -1
  163. package/dist/runtime/templateCacheState.d.ts +6 -0
  164. package/dist/runtime/templateCacheState.js +10 -0
  165. package/dist/runtime/templateCacheState.js.map +1 -0
  166. package/dist/runtime/templateUsages.js +4 -5
  167. package/dist/runtime/templateUsages.js.map +1 -1
  168. package/dist/runtime/topo.js +2 -4
  169. package/dist/runtime/topo.js.map +1 -1
  170. package/dist/runtime/trace.js +12 -9
  171. package/dist/runtime/trace.js.map +1 -1
  172. package/dist/runtime/triggerHandles.d.ts +3 -0
  173. package/dist/runtime/triggerHandles.js +8 -3
  174. package/dist/runtime/triggerHandles.js.map +1 -1
  175. package/dist/runtime/typeOrigin.js +12 -1
  176. package/dist/runtime/typeOrigin.js.map +1 -1
  177. package/dist/runtime/validate.js.map +1 -1
  178. package/dist/runtime/validateTemplate.js.map +1 -1
  179. package/dist/runtime/withTimeout.js.map +1 -1
  180. package/dist/runtime/wording.js +12 -8
  181. package/dist/runtime/wording.js.map +1 -1
  182. package/dist/stats/health-banner.js.map +1 -1
  183. package/dist/stats/health.js +2 -3
  184. package/dist/stats/health.js.map +1 -1
  185. package/dist/stats/kpi.js +1 -1
  186. package/dist/stats/kpi.js.map +1 -1
  187. package/dist/stats/overview.js +2 -1
  188. package/dist/stats/overview.js.map +1 -1
  189. package/dist/types/dataValue.d.ts +8 -0
  190. package/dist/types/dataValue.js +36 -0
  191. package/dist/types/dataValue.js.map +1 -0
  192. package/dist/types/graph.d.ts +8 -1
  193. package/dist/types/graph.js +8 -0
  194. package/dist/types/graph.js.map +1 -1
  195. package/dist/types/guards.d.ts +8 -0
  196. package/dist/types/guards.js +35 -0
  197. package/dist/types/guards.js.map +1 -0
  198. package/frontend-vue/app/build/components/editor/EditorBanners.vue +120 -0
  199. package/frontend-vue/app/build/components/editor/EditorChoiceModal.vue +44 -0
  200. package/frontend-vue/app/build/components/editor/EditorForkModal.vue +51 -0
  201. package/frontend-vue/app/build/components/editor/EditorHeader.vue +146 -0
  202. package/frontend-vue/app/build/components/editor/EditorSaveTemplateModal.vue +105 -0
  203. package/frontend-vue/app/build/components/editor/NodeInspectorDocs.vue +28 -0
  204. package/frontend-vue/app/build/components/editor/NodeInspectorRun.vue +48 -0
  205. package/frontend-vue/app/build/composables/editor/useBuilderMount.ts +129 -0
  206. package/frontend-vue/app/build/composables/editor/useBuilderSave.ts +256 -0
  207. package/frontend-vue/app/build/composables/editor/useBuilderShortcuts.ts +270 -0
  208. package/frontend-vue/app/build/composables/editor/useDraftProblems.ts +288 -0
  209. package/frontend-vue/app/build/composables/editor/useEditorContext.ts +388 -0
  210. package/frontend-vue/app/build/composables/editor/useEditorLoad.ts +158 -0
  211. package/frontend-vue/app/build/composables/editor/useForkToLocal.ts +193 -0
  212. package/frontend-vue/app/build/composables/editor/useGraphHistory.ts +113 -0
  213. package/frontend-vue/app/build/composables/editor/useGroupEditing.ts +445 -0
  214. package/frontend-vue/app/build/composables/editor/usePalette.ts +41 -0
  215. package/frontend-vue/app/build/composables/editor/useProcedureActions.ts +96 -0
  216. package/frontend-vue/app/build/composables/editor/useRunOverlay.ts +466 -0
  217. package/frontend-vue/app/build/composables/editor/useSaveAsTemplate.ts +172 -0
  218. package/frontend-vue/app/build/composables/editor/useSavedTriggers.ts +100 -0
  219. package/frontend-vue/app/build/composables/editor/useSubgraphNavigation.ts +270 -0
  220. package/frontend-vue/app/build/composables/editor/useUnsavedGuards.ts +233 -0
  221. package/frontend-vue/app/build/composables/graphCanvas/connect.ts +273 -0
  222. package/frontend-vue/app/build/composables/graphCanvas/edgeEvents.ts +172 -0
  223. package/frontend-vue/app/build/composables/graphCanvas/edges.ts +55 -0
  224. package/frontend-vue/app/build/composables/graphCanvas/handles.ts +181 -0
  225. package/frontend-vue/app/build/composables/graphCanvas/linkMenu.ts +123 -0
  226. package/frontend-vue/app/build/composables/graphCanvas/nodeData.ts +222 -0
  227. package/frontend-vue/app/build/composables/graphCanvas/placement.ts +248 -0
  228. package/frontend-vue/app/build/composables/graphCanvas/selection.ts +150 -0
  229. package/frontend-vue/app/build/composables/graphCanvas/types.ts +188 -0
  230. package/frontend-vue/app/build/composables/graphCanvas/view.ts +230 -0
  231. package/frontend-vue/app/build/types/editor.ts +94 -0
  232. package/frontend-vue/app/build/utils/editor/apiErrors.ts +74 -0
  233. package/frontend-vue/app/build/utils/editor/graphShape.ts +68 -0
  234. package/frontend-vue/app/build/utils/editor/groupPlan.ts +322 -0
  235. package/frontend-vue/app/build/utils/editor/groupPorts.ts +210 -0
  236. package/frontend-vue/app/build/utils/editor/keyboard.ts +22 -0
  237. package/frontend-vue/app/build/utils/inspectorFields.ts +117 -0
  238. package/frontend-vue/app/build/utils/templates.ts +88 -0
  239. package/frontend-vue/app/components/AttentionList.vue +2 -6
  240. package/frontend-vue/app/components/Catalog.vue +2 -1
  241. package/frontend-vue/app/components/Editor/BottomDock.vue +0 -3
  242. package/frontend-vue/app/components/Editor/GraphCanvas.vue +78 -1337
  243. package/frontend-vue/app/components/Editor/NodeInspector.vue +31 -123
  244. package/frontend-vue/app/components/Editor.vue +134 -3490
  245. package/frontend-vue/app/components/Templates.vue +14 -84
  246. package/frontend-vue/app/composables/useAutomationRuns.ts +2 -2
  247. package/frontend-vue/build/backend-boundary.ts +122 -0
  248. package/frontend-vue/dms.frontend.build.ts +2 -0
  249. package/frontend-vue/eslint-rules/index.mjs +103 -0
  250. package/frontend-vue/eslint.config.mjs +15 -0
  251. package/frontend-vue/i18n/locales/dms-automation-en-GB.json +0 -3
  252. package/frontend-vue/i18n/locales/dms-automation-fr-FR.json +0 -3
  253. package/frontend-vue/package.json +7 -4
  254. package/frontend-vue/pnpm-lock.yaml +98 -68
  255. package/frontend-vue/tests/api-error-presentation.test.cjs +257 -0
  256. package/frontend-vue/tests/helpers/setup.cjs +44 -0
  257. package/package.json +10 -10
  258. package/skills/dms-automation/SKILL.md +4 -4
  259. package/skills/dms-automation/cases.json +58 -0
  260. package/dist/runtime/departed.d.ts +0 -6
  261. package/dist/runtime/departed.js +0 -38
  262. package/dist/runtime/departed.js.map +0 -1
@@ -1,13 +1,15 @@
1
1
  import type { JsonSchema } from "@antelopejs/interface-dms-automation";
2
+ import type { DataRecord } from "./dataValue";
2
3
  export interface GraphNode {
3
4
  id: string;
4
5
  kind: string;
5
6
  typeId?: string;
6
- config: Record<string, unknown>;
7
+ config: DataRecord;
7
8
  position: {
8
9
  x: number;
9
10
  y: number;
10
11
  };
12
+ label?: string;
11
13
  }
12
14
  export interface TriggerEdgeEnd {
13
15
  node: string;
@@ -48,4 +50,9 @@ export interface GroupNode extends GraphNode {
48
50
  subgraph?: ProcedureGraph;
49
51
  }
50
52
  export declare function isGroupNode(n: GraphNode): n is GroupNode;
53
+ export type TemplateInstanceNode = GroupNode & {
54
+ templateId: string;
55
+ };
56
+ export declare function isTemplateInstance(n: GraphNode): n is TemplateInstanceNode;
51
57
  export declare function walkNodesRecursive(graph: ProcedureGraph): Iterable<GraphNode>;
58
+ export declare function parseGraph(raw: string): ProcedureGraph;
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.triggerEdgeEnd = triggerEdgeEnd;
4
4
  exports.isGroupNode = isGroupNode;
5
+ exports.isTemplateInstance = isTemplateInstance;
5
6
  exports.walkNodesRecursive = walkNodesRecursive;
7
+ exports.parseGraph = parseGraph;
6
8
  function triggerEdgeEnd(node, branch) {
7
9
  const end = { node };
8
10
  if (branch !== undefined)
@@ -12,6 +14,9 @@ function triggerEdgeEnd(node, branch) {
12
14
  function isGroupNode(n) {
13
15
  return n.kind === "group";
14
16
  }
17
+ function isTemplateInstance(n) {
18
+ return isGroupNode(n) && !!n.templateId;
19
+ }
15
20
  function* walkNodesRecursive(graph) {
16
21
  for (const node of graph.nodes ?? []) {
17
22
  yield node;
@@ -20,4 +25,7 @@ function* walkNodesRecursive(graph) {
20
25
  }
21
26
  }
22
27
  }
28
+ function parseGraph(raw) {
29
+ return JSON.parse(raw);
30
+ }
23
31
  //# sourceMappingURL=graph.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph.js","sourceRoot":"","sources":["../../src/types/graph.ts"],"names":[],"mappings":";;AA8BA,wCAOC;AAqCD,kCAEC;AAQD,gDASC;AA/DD,SAAgB,cAAc,CAC5B,IAAY,EACZ,MAA0B;IAE1B,MAAM,GAAG,GAAmB,EAAE,IAAI,EAAE,CAAC;IACrC,IAAI,MAAM,KAAK,SAAS;QAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;IAC9C,OAAO,GAAG,CAAC;AACb,CAAC;AAqCD,SAAgB,WAAW,CAAC,CAAY;IACtC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC;AAC5B,CAAC;AAQD,QAAe,CAAC,CAAC,kBAAkB,CACjC,KAAqB;IAErB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;QACrC,MAAM,IAAI,CAAC;QACX,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACvC,KAAK,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"graph.js","sourceRoot":"","sources":["../../src/types/graph.ts"],"names":[],"mappings":";;AAiCA,wCAOC;AA0CD,kCAEC;AAKD,gDAEC;AAQD,gDASC;AAGD,gCAEC;AAhFD,SAAgB,cAAc,CAC5B,IAAY,EACZ,MAA0B;IAE1B,MAAM,GAAG,GAAmB,EAAE,IAAI,EAAE,CAAC;IACrC,IAAI,MAAM,KAAK,SAAS;QAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;IAC9C,OAAO,GAAG,CAAC;AACb,CAAC;AA0CD,SAAgB,WAAW,CAAC,CAAY;IACtC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC;AAC5B,CAAC;AAKD,SAAgB,kBAAkB,CAAC,CAAY;IAC7C,OAAO,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;AAC1C,CAAC;AAQD,QAAe,CAAC,CAAC,kBAAkB,CACjC,KAAqB;IAErB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;QACrC,MAAM,IAAI,CAAC;QACX,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACvC,KAAK,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;AACH,CAAC;AAGD,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmB,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare function isString(value: unknown): value is string;
2
+ export declare function isNumber(value: unknown): value is number;
3
+ export declare function isBoolean(value: unknown): value is boolean;
4
+ export declare function isBigInt(value: unknown): value is bigint;
5
+ export declare function isObject(value: unknown): value is object;
6
+ export declare function isObjectOrNull(value: unknown): value is object | null;
7
+ export declare function isPropertyBag(value: unknown): value is Record<string, unknown>;
8
+ export declare function isPlainScalar(value: unknown): value is string | number | boolean | bigint | symbol | ((...args: never[]) => void) | null | undefined;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isString = isString;
4
+ exports.isNumber = isNumber;
5
+ exports.isBoolean = isBoolean;
6
+ exports.isBigInt = isBigInt;
7
+ exports.isObject = isObject;
8
+ exports.isObjectOrNull = isObjectOrNull;
9
+ exports.isPropertyBag = isPropertyBag;
10
+ exports.isPlainScalar = isPlainScalar;
11
+ function isString(value) {
12
+ return typeof value === "string";
13
+ }
14
+ function isNumber(value) {
15
+ return typeof value === "number";
16
+ }
17
+ function isBoolean(value) {
18
+ return typeof value === "boolean";
19
+ }
20
+ function isBigInt(value) {
21
+ return typeof value === "bigint";
22
+ }
23
+ function isObject(value) {
24
+ return typeof value === "object" && value !== null;
25
+ }
26
+ function isObjectOrNull(value) {
27
+ return typeof value === "object";
28
+ }
29
+ function isPropertyBag(value) {
30
+ return typeof value === "object" && value !== null;
31
+ }
32
+ function isPlainScalar(value) {
33
+ return !isObject(value);
34
+ }
35
+ //# sourceMappingURL=guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/types/guards.ts"],"names":[],"mappings":";;AAAA,4BAEC;AAED,4BAEC;AAED,8BAEC;AAED,4BAEC;AAGD,4BAEC;AAGD,wCAEC;AAGD,sCAIC;AAGD,sCAYC;AA9CD,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED,SAAgB,SAAS,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC;AACpC,CAAC;AAED,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAGD,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAGD,SAAgB,cAAc,CAAC,KAAc;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAGD,SAAgB,aAAa,CAC3B,KAAc;IAEd,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAGD,SAAgB,aAAa,CAC3B,KAAc;IAUd,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,120 @@
1
+ <script setup lang="ts">
2
+ import type { RunDetail } from '../../../composables/useAutomationRuns'
3
+ import type { GraphIssue } from '../../types/editor'
4
+
5
+ defineProps<{
6
+ loadError: string | null
7
+ templateNotFound: boolean
8
+ editorMode: 'procedure' | 'template'
9
+ libraryBackUrl: string
10
+ saveBlocked: boolean
11
+ blockingIssues: GraphIssue[]
12
+ pausedBanner: { title: string; description: string } | null
13
+ saving: boolean
14
+ testing: boolean
15
+ overlayRun: RunDetail | null
16
+ overlayIsTest: boolean
17
+ overlayLook: { readonly tone: 'error' | 'success'; readonly icon: string }
18
+ overlaySummary: string
19
+ overlayDescription: string
20
+ isDirty: boolean
21
+ isCurrentGraphReadOnly: boolean
22
+ canForkToLocal: boolean
23
+ }>()
24
+
25
+ const emit = defineEmits<{
26
+ 'go-to-first-problem': []
27
+ 'save-as-draft': []
28
+ 'enable-now': []
29
+ rerun: []
30
+ 'test-run': []
31
+ 'open-trace': [runId: string]
32
+ 'exit-debug': []
33
+ 'open-fork': []
34
+ }>()
35
+ </script>
36
+
37
+ <template>
38
+ <div class="flex flex-col gap-2 empty:hidden" :class="loadError || saveBlocked || pausedBanner || overlayRun || testing || isCurrentGraphReadOnly ? 'border-b border-default p-2' : ''">
39
+ <DmsBanner
40
+ v-if="loadError"
41
+ size="sm"
42
+ tone="error"
43
+ icon="i-ph-warning"
44
+ :title="editorMode === 'template' ? $t('dms_automation.editor.loadTemplateError') : $t('dms_automation.editor.loadProceduresError')"
45
+ :description="loadError"
46
+ >
47
+ <template v-if="templateNotFound" #actions>
48
+ <UButton size="xs" color="error" variant="soft" icon="i-ph-arrow-left" :to="libraryBackUrl">{{ $t('dms_automation.editor.backToTemplates') }}</UButton>
49
+ </template>
50
+ </DmsBanner>
51
+ <DmsBanner
52
+ v-if="saveBlocked && blockingIssues.length"
53
+ size="sm"
54
+ tone="error"
55
+ icon="i-ph-warning-octagon"
56
+ :title="$t('dms_automation.editor.problems.title', { count: blockingIssues.length })"
57
+ :description="$t('dms_automation.editor.problems.description')"
58
+ >
59
+ <template #actions>
60
+ <UButton size="xs" color="error" variant="soft" @click="emit('go-to-first-problem')">{{ $t('dms_automation.editor.problems.first') }}</UButton>
61
+ <UButton size="xs" color="neutral" variant="outline" :loading="saving" @click="emit('save-as-draft')">{{ $t('dms_automation.editor.problems.saveDraft') }}</UButton>
62
+ </template>
63
+ </DmsBanner>
64
+ <DmsBanner v-if="pausedBanner && !saveBlocked" size="sm" tone="warning" icon="i-ph-pause-circle" :title="pausedBanner.title" :description="pausedBanner.description">
65
+ <template #actions>
66
+ <UButton size="xs" color="warning" variant="soft" :loading="saving" :disabled="blockingIssues.length > 0" @click="emit('enable-now')">
67
+ {{ $t('dms_automation.editor.paused.enable') }}
68
+ </UButton>
69
+ </template>
70
+ </DmsBanner>
71
+ <DmsBanner
72
+ v-if="testing"
73
+ size="sm"
74
+ tone="info"
75
+ icon="i-ph-flask"
76
+ :title="$t('dms_automation.editor.debug.testing')"
77
+ :description="$t('dms_automation.editor.debug.testingHint')"
78
+ />
79
+ <DmsBanner
80
+ v-if="overlayRun && !testing"
81
+ size="sm"
82
+ :tone="overlayLook.tone"
83
+ :icon="overlayLook.icon"
84
+ :title="overlaySummary"
85
+ :description="overlayDescription"
86
+ >
87
+ <template #actions>
88
+ <UTooltip v-if="!overlayIsTest" :text="isDirty ? $t('dms_automation.editor.debug.rerunSaveFirst') : $t('dms_automation.editor.debug.rerunHint')">
89
+ <UButton size="xs" variant="soft" color="neutral" icon="i-ph-arrow-clockwise" :disabled="isDirty" @click="emit('rerun')">
90
+ {{ $t('dms_automation.runs.rerunWithPayload') }}
91
+ </UButton>
92
+ </UTooltip>
93
+ <UButton v-if="overlayIsTest" size="xs" variant="soft" color="neutral" icon="i-ph-arrow-clockwise" :loading="testing" @click="emit('test-run')">
94
+ {{ $t('dms_automation.editor.debug.again') }}
95
+ </UButton>
96
+ <UButton size="xs" variant="ghost" color="neutral" icon="i-ph-path" @click="emit('open-trace', overlayRun._id)">
97
+ {{ $t('dms_automation.runs.trace') }}
98
+ </UButton>
99
+ <UButton size="xs" variant="ghost" color="neutral" @click="emit('exit-debug')">
100
+ {{ $t('dms_automation.editor.debug.exit') }}
101
+ <UKbd value="Esc" size="sm" class="ml-1" />
102
+ </UButton>
103
+ </template>
104
+ </DmsBanner>
105
+ <DmsBanner
106
+ v-if="isCurrentGraphReadOnly"
107
+ size="sm"
108
+ tone="info"
109
+ icon="i-ph-link"
110
+ :title="$t('dms_automation.editor.linkedTitle')"
111
+ :description="$t('dms_automation.editor.linkedDescription')"
112
+ >
113
+ <template v-if="canForkToLocal" #actions>
114
+ <UButton size="xs" color="info" variant="soft" icon="i-ph-git-fork" @click="emit('open-fork')">
115
+ {{ $t('dms_automation.editor.forkToEdit') }}
116
+ </UButton>
117
+ </template>
118
+ </DmsBanner>
119
+ </div>
120
+ </template>
@@ -0,0 +1,44 @@
1
+ <script setup lang="ts">
2
+ import { nextTick } from 'vue'
3
+ import type { ChoiceQuestion } from '../../types/editor'
4
+
5
+ defineProps<{ dialog: ChoiceQuestion<string> & { open: boolean } }>()
6
+
7
+ const emit = defineEmits<{
8
+ 'update:open': [open: boolean]
9
+ answer: [choice: string]
10
+ }>()
11
+
12
+ /** The dialog opens on its safe answer: Enter keeps the draft, runs nothing. */
13
+ function focusSafeChoice(event: Event) {
14
+ event.preventDefault()
15
+ void nextTick(() => document.querySelector<HTMLElement>('[data-safe-choice]')?.focus())
16
+ }
17
+ </script>
18
+
19
+ <template>
20
+ <UModal
21
+ :open="dialog.open"
22
+ :title="dialog.title"
23
+ :content="{ onOpenAutoFocus: focusSafeChoice }"
24
+ @update:open="emit('update:open', $event)"
25
+ >
26
+ <template #body>
27
+ <p class="text-sm text-toned">{{ dialog.description }}</p>
28
+ </template>
29
+ <template #footer>
30
+ <div class="flex w-full justify-end gap-2">
31
+ <UButton
32
+ v-for="choice in dialog.choices"
33
+ :key="choice.value"
34
+ :color="choice.color ?? 'neutral'"
35
+ :variant="choice.variant ?? 'solid'"
36
+ :data-safe-choice="choice.value === dialog.dismiss || undefined"
37
+ @click="emit('answer', choice.value)"
38
+ >
39
+ {{ choice.label }}
40
+ </UButton>
41
+ </div>
42
+ </template>
43
+ </UModal>
44
+ </template>
@@ -0,0 +1,51 @@
1
+ <script setup lang="ts">
2
+ import type { ApiErrorNotice } from '#dms-core/app/composables/useApiErrorPresenter'
3
+
4
+ defineProps<{
5
+ submitting: boolean
6
+ error: ApiErrorNotice | null
7
+ }>()
8
+
9
+ const emit = defineEmits<{ submit: [] }>()
10
+
11
+ const open = defineModel<boolean>('open', { required: true })
12
+ </script>
13
+
14
+ <template>
15
+ <UModal
16
+ v-model:open="open"
17
+ :title="$t('dms_automation.editor.forkModal.title')"
18
+ >
19
+ <template #body>
20
+ <div class="flex flex-col gap-3">
21
+ <p class="text-sm text-toned">
22
+ {{ $t('dms_automation.editor.forkModal.body') }}
23
+ </p>
24
+ <DmsBanner
25
+ v-if="error"
26
+ size="sm"
27
+ :tone="error.severity"
28
+ :title="error.message"
29
+ />
30
+ </div>
31
+ </template>
32
+ <template #footer>
33
+ <div class="flex w-full justify-end gap-2">
34
+ <UButton
35
+ :label="$t('dms_automation.editor.forkModal.cancel')"
36
+ variant="outline"
37
+ color="neutral"
38
+ :disabled="submitting"
39
+ @click="open = false"
40
+ />
41
+ <UButton
42
+ :label="$t('dms_automation.editor.forkModal.submit')"
43
+ color="primary"
44
+ icon="i-ph-git-fork"
45
+ :loading="submitting"
46
+ @click="emit('submit')"
47
+ />
48
+ </div>
49
+ </template>
50
+ </UModal>
51
+ </template>
@@ -0,0 +1,146 @@
1
+ <script setup lang="ts">
2
+ import type { ProcedureSummaryRow } from '../../../components/Editor/ProcedureSwitcher.vue'
3
+ import type { ProcedureGraph } from '../../../composables/useGraphConnect'
4
+ import type { ProcedureRecord } from '../../types/editor'
5
+
6
+ defineProps<{
7
+ editorMode: 'procedure' | 'template'
8
+ libraryBackUrl: string
9
+ selected: ProcedureRecord | null
10
+ selectedId: string | null
11
+ currentGraph: ProcedureGraph | null
12
+ isCurrentGraphReadOnly: boolean
13
+ paletteHidden: boolean
14
+ nameInputId: string
15
+ nameMissing: boolean
16
+ currentSummary: ProcedureSummaryRow | null
17
+ changeCount: number
18
+ saveState: string
19
+ isDirty: boolean
20
+ saving: boolean
21
+ testing: boolean
22
+ runsUrl: string
23
+ formatShortcut: ReturnType<typeof useKeyboardPlatform>['formatShortcut']
24
+ }>()
25
+
26
+ const emit = defineEmits<{
27
+ 'open-switcher': []
28
+ 'toggle-palette': []
29
+ discard: []
30
+ 'run-now': []
31
+ 'test-run': []
32
+ save: []
33
+ create: []
34
+ export: []
35
+ delete: []
36
+ }>()
37
+
38
+ const procedureName = defineModel<string>('name', { required: true })
39
+ const procedureEnabled = defineModel<boolean>('enabled', { required: true })
40
+
41
+ const STATE_TONES = {
42
+ failing: 'error',
43
+ degraded: 'warning',
44
+ healthy: 'success',
45
+ paused: 'neutral',
46
+ draft: 'info',
47
+ } as const
48
+
49
+ </script>
50
+
51
+ <template>
52
+ <header class="flex min-h-13 flex-wrap items-center gap-2 border-b border-default px-3 py-2">
53
+ <template v-if="editorMode === 'procedure'">
54
+ <UTooltip :text="$t('dms_automation.editor.switcher.title')" :kbds="['meta', 'p']">
55
+ <UButton
56
+ icon="i-ph-flow-arrow"
57
+ variant="ghost"
58
+ color="neutral"
59
+ :aria-label="$t('dms_automation.editor.switcher.title')"
60
+ @click="emit('open-switcher')"
61
+ />
62
+ </UTooltip>
63
+ </template>
64
+ <template v-else>
65
+ <UButton icon="i-ph-arrow-left" variant="ghost" color="neutral" :to="libraryBackUrl">
66
+ {{ $t('dms_automation.library.title') }}
67
+ </UButton>
68
+ <UBadge color="info" variant="subtle">{{ $t('dms_automation.editor.templateBadge') }}</UBadge>
69
+ </template>
70
+ <UTooltip v-if="selected && currentGraph && !isCurrentGraphReadOnly" :text="paletteHidden ? $t('dms_automation.editor.showBlocks') : $t('dms_automation.editor.hideBlocks')">
71
+ <UButton
72
+ :icon="paletteHidden ? 'i-ph-sidebar-simple' : 'i-ph-sidebar-simple-fill'"
73
+ variant="ghost"
74
+ color="neutral"
75
+ :aria-label="paletteHidden ? $t('dms_automation.editor.showBlocks') : $t('dms_automation.editor.hideBlocks')"
76
+ :aria-pressed="!paletteHidden"
77
+ @click="emit('toggle-palette')"
78
+ />
79
+ </UTooltip>
80
+ <UInput
81
+ v-if="selected"
82
+ :id="nameInputId"
83
+ v-model="procedureName"
84
+ variant="ghost"
85
+ :color="nameMissing ? 'error' : undefined"
86
+ :highlight="nameMissing"
87
+ :placeholder="editorMode === 'template' ? $t('dms_automation.editor.templateName') : $t('dms_automation.editor.procedureName')"
88
+ :aria-label="editorMode === 'template' ? $t('dms_automation.editor.templateName') : $t('dms_automation.editor.procedureName')"
89
+ :aria-invalid="nameMissing || undefined"
90
+ :aria-describedby="nameMissing ? `${nameInputId}-error` : undefined"
91
+ class="min-w-[12rem] max-w-sm flex-1 font-medium"
92
+ />
93
+ <DmsFieldError v-if="nameMissing" :id="`${nameInputId}-error`" :message="$t('dms_automation.editor.nameRequired')" />
94
+ <DmsStatusPill
95
+ v-if="currentSummary && editorMode === 'procedure'"
96
+ :tone="STATE_TONES[currentSummary.status]"
97
+ :label="$t(`dms_automation.procedures.status.${currentSummary.status}`)"
98
+ size="sm"
99
+ />
100
+ <label v-if="selected && editorMode === 'procedure'" class="flex items-center gap-2 text-sm text-muted">
101
+ <USwitch v-model="procedureEnabled" size="sm" />
102
+ {{ procedureEnabled ? $t('dms_automation.editor.enabled') : $t('dms_automation.editor.disabled') }}
103
+ </label>
104
+ <span v-if="selected" class="ml-1 inline-flex items-center gap-1 whitespace-nowrap text-xs" :class="changeCount > 0 ? 'text-warning' : 'text-dimmed'">
105
+ <UIcon :name="changeCount > 0 ? 'i-ph-circle-fill' : 'i-ph-check'" class="size-2.5 shrink-0" />
106
+ {{ saveState }}
107
+ </span>
108
+ <div class="ml-auto flex flex-wrap items-center gap-2">
109
+ <UButton
110
+ v-if="selected"
111
+ variant="ghost"
112
+ color="neutral"
113
+ :disabled="!isDirty || saving"
114
+ @click="emit('discard')"
115
+ >
116
+ {{ $t('dms_automation.editor.discard') }}
117
+ </UButton>
118
+ <template v-if="selected && editorMode === 'procedure'">
119
+ <UButton variant="outline" color="neutral" icon="i-ph-play" @click="emit('run-now')">
120
+ {{ $t('dms_automation.editor.runNowButton') }}
121
+ </UButton>
122
+ <UButton variant="outline" color="neutral" icon="i-ph-flask" :loading="testing" @click="emit('test-run')">
123
+ {{ $t('dms_automation.editor.testRun') }}
124
+ <UKbd :value="formatShortcut(['meta', '↵'])" size="sm" class="ml-1" />
125
+ </UButton>
126
+ </template>
127
+ <UButton v-if="selected" color="primary" icon="i-ph-floppy-disk" :disabled="!isDirty || nameMissing" :loading="saving" @click="emit('save')">
128
+ {{ $t('dms_automation.common.save') }}
129
+ <UKbd :value="formatShortcut(['meta', 's'])" size="sm" class="ml-1" />
130
+ </UButton>
131
+ <UDropdownMenu
132
+ v-if="selected && editorMode === 'procedure'"
133
+ :items="[
134
+ [
135
+ { label: $t('dms_automation.newProcedure.title'), icon: 'i-ph-plus', onSelect: () => emit('create') },
136
+ { label: $t('dms_automation.editor.exportJson'), icon: 'i-ph-download-simple', onSelect: () => emit('export') },
137
+ { label: $t('dms_automation.editor.viewRuns'), icon: 'i-ph-list-bullets', to: `${runsUrl}?procedure=${selectedId}` },
138
+ ],
139
+ [{ label: $t('dms_automation.editor.delete'), icon: 'i-ph-trash', color: 'error', onSelect: () => emit('delete') }],
140
+ ]"
141
+ >
142
+ <UButton icon="i-ph-dots-three" variant="ghost" color="neutral" :aria-label="$t('dms_automation.editor.more')" />
143
+ </UDropdownMenu>
144
+ </div>
145
+ </header>
146
+ </template>
@@ -0,0 +1,105 @@
1
+ <script setup lang="ts">
2
+ import type { GraphNode } from '../../../composables/useGraphConnect'
3
+ import { TEMPLATE_NAME_ID, TEMPLATE_ROW } from '../../composables/editor/useSaveAsTemplate'
4
+
5
+ defineProps<{
6
+ group: GraphNode | null
7
+ submitting: boolean
8
+ error: string | null
9
+ fieldErrors: ReturnType<typeof useFieldErrors<'name'>>
10
+ }>()
11
+
12
+ const emit = defineEmits<{ submit: [] }>()
13
+
14
+ const open = defineModel<boolean>('open', { required: true })
15
+ const name = defineModel<string>('name', { required: true })
16
+ const description = defineModel<string>('description', { required: true })
17
+ const icon = defineModel<string>('icon', { required: true })
18
+ </script>
19
+
20
+ <template>
21
+ <UModal
22
+ v-model:open="open"
23
+ :title="$t('dms_automation.editor.saveTemplateModal.title')"
24
+ >
25
+ <template #body>
26
+ <div class="flex flex-col gap-3">
27
+ <DmsFieldRow
28
+ v-bind="TEMPLATE_ROW"
29
+ :label="$t('dms_automation.editor.saveTemplateModal.name')"
30
+ :label-for="TEMPLATE_NAME_ID"
31
+ required
32
+ >
33
+ <div class="grid gap-1.5">
34
+ <DmsInputText
35
+ :id="TEMPLATE_NAME_ID"
36
+ v-model="name"
37
+ :placeholder="$t('dms_automation.editor.saveTemplateModal.namePlaceholder')"
38
+ class="w-full"
39
+ :disabled="submitting"
40
+ v-bind="fieldErrors.aria('name')"
41
+ />
42
+ <DmsFieldError :id="fieldErrors.errorId('name')" :message="fieldErrors.errors.name" />
43
+ </div>
44
+ </DmsFieldRow>
45
+ <DmsFieldRow
46
+ v-bind="TEMPLATE_ROW"
47
+ :label="$t('dms_automation.editor.saveTemplateModal.description')"
48
+ label-for="save-template-description"
49
+ >
50
+ <DmsTextarea
51
+ id="save-template-description"
52
+ v-model="description"
53
+ :placeholder="$t('dms_automation.editor.saveTemplateModal.descriptionPlaceholder')"
54
+ class="w-full"
55
+ :rows="3"
56
+ :disabled="submitting"
57
+ />
58
+ </DmsFieldRow>
59
+ <DmsFieldRow v-bind="TEMPLATE_ROW" :label="$t('dms_automation.editor.saveTemplateModal.icon')">
60
+ <DmsAutomationIconPicker v-model="icon" />
61
+ </DmsFieldRow>
62
+ <div v-if="group?.ports?.length" class="flex flex-col gap-1">
63
+ <span class="text-xs font-medium text-highlighted">{{ $t('dms_automation.editor.saveTemplateModal.ports') }}</span>
64
+ <div class="overflow-hidden rounded-md border border-default">
65
+ <div
66
+ v-for="port in group.ports"
67
+ :key="`${port.direction}-${port.kind}-${port.name}`"
68
+ class="flex items-center gap-2 border-b border-default px-2 py-1 font-mono text-xs last:border-0"
69
+ >
70
+ <UBadge size="sm" variant="subtle" :color="port.kind === 'trigger' ? 'info' : 'success'">{{ $t(`dms_automation.templates.ports.kind.${port.kind}`) }}</UBadge>
71
+ <span class="text-muted">{{ $t(`dms_automation.templates.ports.direction.${port.direction}`) }}</span>
72
+ <span class="text-highlighted">{{ port.name }}</span>
73
+ <span v-if="port.schema?.type" class="ml-auto text-dimmed">{{ port.schema.type }}</span>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ <DmsBanner
78
+ v-if="error"
79
+ size="sm"
80
+ tone="error"
81
+ :title="$t('dms_automation.editor.saveTemplateModal.error')"
82
+ :description="error"
83
+ />
84
+ <DmsFormRequiredLegend />
85
+ </div>
86
+ </template>
87
+ <template #footer>
88
+ <div class="flex w-full justify-end gap-2">
89
+ <UButton
90
+ :label="$t('dms_automation.editor.saveTemplateModal.cancel')"
91
+ variant="outline"
92
+ color="neutral"
93
+ :disabled="submitting"
94
+ @click="open = false"
95
+ />
96
+ <UButton
97
+ :label="$t('dms_automation.editor.saveTemplateModal.submit')"
98
+ color="primary"
99
+ :loading="submitting"
100
+ @click="emit('submit')"
101
+ />
102
+ </div>
103
+ </template>
104
+ </UModal>
105
+ </template>
@@ -0,0 +1,28 @@
1
+ <script setup lang="ts">
2
+ import type { JsonSchema } from '../../../composables/useGraphConnect'
3
+
4
+ defineProps<{
5
+ description: string
6
+ inputSchema: JsonSchema | null
7
+ branches: string[]
8
+ outputSchema: JsonSchema | null
9
+ }>()
10
+ </script>
11
+
12
+ <template>
13
+ <div class="flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-4">
14
+ <p class="text-sm text-toned">{{ description || $t('dms_automation.editor.inspector.noDocs') }}</p>
15
+ <div class="flex flex-col gap-1">
16
+ <span class="font-mono text-[10.5px] text-dimmed uppercase">{{ $t('dms_automation.library.inputs') }}</span>
17
+ <DmsAutomationSchemaTable :schema="inputSchema" />
18
+ </div>
19
+ <div v-if="branches.length" class="flex flex-col gap-1">
20
+ <span class="font-mono text-[10.5px] text-dimmed uppercase">{{ $t('dms_automation.editor.inspector.branches') }}</span>
21
+ <p class="font-mono text-xs text-toned">{{ branches.join(' · ') }}</p>
22
+ </div>
23
+ <div class="flex flex-col gap-1">
24
+ <span class="font-mono text-[10.5px] text-dimmed uppercase">{{ $t('dms_automation.library.outputs') }}</span>
25
+ <DmsAutomationSchemaTable :schema="outputSchema" />
26
+ </div>
27
+ </div>
28
+ </template>
@@ -0,0 +1,48 @@
1
+ <script setup lang="ts">
2
+ import type { TraceStep } from '../../../composables/useAutomationRuns'
3
+ import { describeDuration, prettyJson } from '../../../utils/describe'
4
+
5
+ defineProps<{
6
+ runStep: TraceStep
7
+ /** Says which run that is ("Test run · just now", "Run 8f3a2c · 14:28"). */
8
+ runLabel?: string
9
+ /** Opens the trace of that run. */
10
+ runTraceUrl?: string
11
+ }>()
12
+
13
+ function unwrap(described: unknown): unknown {
14
+ if (!described || typeof described !== 'object') return described
15
+ if ('value' in described && 'type' in described) return (described as { value: unknown }).value
16
+ return Object.fromEntries(Object.entries(described as Record<string, unknown>).map(([k, v]) => [k, unwrap(v)]))
17
+ }
18
+ </script>
19
+
20
+ <template>
21
+ <div class="flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-4">
22
+ <div class="flex items-center justify-between gap-2">
23
+ <DmsStatusPill
24
+ :tone="runStep.status === 'failed' ? 'error' : 'success'"
25
+ :label="runStep.status === 'failed' ? $t('dms_automation.runs.status.failed') : $t('dms_automation.runs.status.ok')"
26
+ size="sm"
27
+ />
28
+ <span class="font-mono text-xs text-muted">{{ describeDuration(runStep.durationMs) }}</span>
29
+ </div>
30
+ <p v-if="runLabel" class="text-xs text-muted">{{ runLabel }}</p>
31
+ <div class="flex flex-col gap-1">
32
+ <span class="font-mono text-[10.5px] text-dimmed uppercase">{{ $t('dms_automation.trace.input') }}</span>
33
+ <pre class="max-h-56 overflow-auto rounded-md bg-elevated p-2 font-mono text-xs break-all whitespace-pre-wrap text-toned">{{ prettyJson(unwrap(runStep.inputs)) || '—' }}</pre>
34
+ </div>
35
+ <div class="flex flex-col gap-1">
36
+ <span class="font-mono text-[10.5px] text-dimmed uppercase">
37
+ {{ runStep.status === 'failed' ? $t('dms_automation.trace.error') : $t('dms_automation.trace.output') }}
38
+ </span>
39
+ <pre
40
+ class="max-h-56 overflow-auto rounded-md bg-elevated p-2 font-mono text-xs break-all whitespace-pre-wrap"
41
+ :class="runStep.status === 'failed' ? 'text-error' : 'text-toned'"
42
+ >{{ runStep.status === 'failed' ? runStep.error : prettyJson(unwrap(runStep.output)) || '—' }}</pre>
43
+ </div>
44
+ <UButton v-if="runTraceUrl" size="xs" variant="ghost" color="neutral" trailing-icon="i-ph-arrow-up-right" :to="runTraceUrl" class="self-start">
45
+ {{ $t('dms_automation.trace.openFull') }}
46
+ </UButton>
47
+ </div>
48
+ </template>