@antelopejs/dms-automation 0.2.7 → 0.3.1

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 (312) hide show
  1. package/README.md +46 -2
  2. package/dist/data/procedures-table.d.ts +38 -4
  3. package/dist/data/procedures-table.js +264 -82
  4. package/dist/data/procedures-table.js.map +1 -1
  5. package/dist/data/runs-table.d.ts +19 -3
  6. package/dist/data/runs-table.js +254 -19
  7. package/dist/data/runs-table.js.map +1 -1
  8. package/dist/db/index.d.ts +1 -2
  9. package/dist/db/index.js +1 -2
  10. package/dist/db/index.js.map +1 -1
  11. package/dist/db/models/automation_template.model.d.ts +16 -1
  12. package/dist/db/models/automation_template.model.js +31 -11
  13. package/dist/db/models/automation_template.model.js.map +1 -1
  14. package/dist/db/models/index.d.ts +1 -1
  15. package/dist/db/models/index.js +1 -1
  16. package/dist/db/models/procedure.model.d.ts +1 -0
  17. package/dist/db/models/procedure.model.js +7 -0
  18. package/dist/db/models/procedure.model.js.map +1 -1
  19. package/dist/db/models/procedure_run.model.d.ts +16 -9
  20. package/dist/db/models/procedure_run.model.js +96 -17
  21. package/dist/db/models/procedure_run.model.js.map +1 -1
  22. package/dist/db/models/stats.model.d.ts +60 -61
  23. package/dist/db/models/stats.model.js +189 -236
  24. package/dist/db/models/stats.model.js.map +1 -1
  25. package/dist/db/models/type_switch.model.d.ts +25 -0
  26. package/dist/db/models/type_switch.model.js +25 -0
  27. package/dist/db/models/type_switch.model.js.map +1 -0
  28. package/dist/db/tables/index.d.ts +1 -2
  29. package/dist/db/tables/index.js +1 -2
  30. package/dist/db/tables/index.js.map +1 -1
  31. package/dist/db/tables/procedure.table.d.ts +6 -0
  32. package/dist/db/tables/procedure.table.js +24 -0
  33. package/dist/db/tables/procedure.table.js.map +1 -1
  34. package/dist/db/tables/procedure_run.table.d.ts +15 -1
  35. package/dist/db/tables/procedure_run.table.js +54 -0
  36. package/dist/db/tables/procedure_run.table.js.map +1 -1
  37. package/dist/db/tables/type_switch.table.d.ts +8 -0
  38. package/dist/db/tables/{trigger_type_config.table.js → type_switch.table.js} +16 -15
  39. package/dist/db/tables/type_switch.table.js.map +1 -0
  40. package/dist/displays/index.d.ts +14 -0
  41. package/dist/displays/index.js +23 -0
  42. package/dist/displays/index.js.map +1 -0
  43. package/dist/index.d.ts +7 -0
  44. package/dist/index.js +8 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/pages/builder.d.ts +1 -1
  47. package/dist/pages/builder.js +10 -3
  48. package/dist/pages/builder.js.map +1 -1
  49. package/dist/pages/index.d.ts +2 -1
  50. package/dist/pages/index.js +2 -1
  51. package/dist/pages/index.js.map +1 -1
  52. package/dist/pages/library.d.ts +2 -1
  53. package/dist/pages/library.js +54 -4
  54. package/dist/pages/library.js.map +1 -1
  55. package/dist/pages/overview.d.ts +6 -1
  56. package/dist/pages/overview.js +121 -2
  57. package/dist/pages/overview.js.map +1 -1
  58. package/dist/pages/procedures.js +111 -16
  59. package/dist/pages/procedures.js.map +1 -1
  60. package/dist/pages/runs.d.ts +4 -1
  61. package/dist/pages/runs.js +109 -13
  62. package/dist/pages/runs.js.map +1 -1
  63. package/dist/pages/shared.d.ts +18 -0
  64. package/dist/pages/shared.js +238 -0
  65. package/dist/pages/shared.js.map +1 -0
  66. package/dist/pages/trace.d.ts +10 -0
  67. package/dist/pages/trace.js +41 -0
  68. package/dist/pages/trace.js.map +1 -0
  69. package/dist/realtime.d.ts +3 -0
  70. package/dist/realtime.js +14 -0
  71. package/dist/realtime.js.map +1 -0
  72. package/dist/routes/action-types.d.ts +2 -14
  73. package/dist/routes/action-types.js +2 -32
  74. package/dist/routes/action-types.js.map +1 -1
  75. package/dist/routes/deleteConfirm.d.ts +3 -0
  76. package/dist/routes/deleteConfirm.js +64 -0
  77. package/dist/routes/deleteConfirm.js.map +1 -0
  78. package/dist/routes/graphSchema.d.ts +3 -90
  79. package/dist/routes/graphSchema.js +36 -9
  80. package/dist/routes/graphSchema.js.map +1 -1
  81. package/dist/routes/index.d.ts +1 -0
  82. package/dist/routes/index.js +1 -0
  83. package/dist/routes/index.js.map +1 -1
  84. package/dist/routes/library.d.ts +40 -0
  85. package/dist/routes/library.js +147 -0
  86. package/dist/routes/library.js.map +1 -0
  87. package/dist/routes/procedureChecks.d.ts +16 -0
  88. package/dist/routes/procedureChecks.js +72 -0
  89. package/dist/routes/procedureChecks.js.map +1 -0
  90. package/dist/routes/procedureRuns.d.ts +21 -0
  91. package/dist/routes/procedureRuns.js +45 -0
  92. package/dist/routes/procedureRuns.js.map +1 -0
  93. package/dist/routes/procedureSchemas.d.ts +107 -0
  94. package/dist/routes/procedureSchemas.js +61 -0
  95. package/dist/routes/procedureSchemas.js.map +1 -0
  96. package/dist/routes/procedures.d.ts +125 -7
  97. package/dist/routes/procedures.js +363 -67
  98. package/dist/routes/procedures.js.map +1 -1
  99. package/dist/routes/requests.d.ts +15 -0
  100. package/dist/routes/requests.js +35 -0
  101. package/dist/routes/requests.js.map +1 -0
  102. package/dist/routes/runs.d.ts +107 -2
  103. package/dist/routes/runs.js +340 -37
  104. package/dist/routes/runs.js.map +1 -1
  105. package/dist/routes/stats.d.ts +19 -1
  106. package/dist/routes/stats.js +160 -4
  107. package/dist/routes/stats.js.map +1 -1
  108. package/dist/routes/templates.d.ts +6 -2
  109. package/dist/routes/templates.js +106 -36
  110. package/dist/routes/templates.js.map +1 -1
  111. package/dist/routes/trigger-types.d.ts +2 -15
  112. package/dist/routes/trigger-types.js +2 -32
  113. package/dist/routes/trigger-types.js.map +1 -1
  114. package/dist/routes/typeConfigShared.d.ts +7 -11
  115. package/dist/routes/typeConfigShared.js +25 -15
  116. package/dist/routes/typeConfigShared.js.map +1 -1
  117. package/dist/runtime/armErrors.d.ts +16 -0
  118. package/dist/runtime/armErrors.js +69 -0
  119. package/dist/runtime/armErrors.js.map +1 -0
  120. package/dist/runtime/boundRunLog.d.ts +24 -0
  121. package/dist/runtime/boundRunLog.js +202 -10
  122. package/dist/runtime/boundRunLog.js.map +1 -1
  123. package/dist/runtime/builtins/actions/http.d.ts +10 -1
  124. package/dist/runtime/builtins/actions/http.js +306 -19
  125. package/dist/runtime/builtins/actions/http.js.map +1 -1
  126. package/dist/runtime/builtins/actions/log.js +2 -2
  127. package/dist/runtime/builtins/actions/log.js.map +1 -1
  128. package/dist/runtime/builtins/data/boolean.d.ts +1 -0
  129. package/dist/runtime/builtins/data/boolean.js +18 -10
  130. package/dist/runtime/builtins/data/boolean.js.map +1 -1
  131. package/dist/runtime/builtins/data/compare.js +60 -11
  132. package/dist/runtime/builtins/data/compare.js.map +1 -1
  133. package/dist/runtime/builtins/data/constant.js +9 -12
  134. package/dist/runtime/builtins/data/constant.js.map +1 -1
  135. package/dist/runtime/builtins/data/json.js +4 -4
  136. package/dist/runtime/builtins/data/json.js.map +1 -1
  137. package/dist/runtime/builtins/data/math.js +44 -24
  138. package/dist/runtime/builtins/data/math.js.map +1 -1
  139. package/dist/runtime/builtins/data/object.js +10 -10
  140. package/dist/runtime/builtins/data/object.js.map +1 -1
  141. package/dist/runtime/builtins/data/string.js +31 -20
  142. package/dist/runtime/builtins/data/string.js.map +1 -1
  143. package/dist/runtime/builtins/nodes/action.js +4 -0
  144. package/dist/runtime/builtins/nodes/action.js.map +1 -1
  145. package/dist/runtime/builtins/nodes/delay.js +1 -1
  146. package/dist/runtime/builtins/nodes/delay.js.map +1 -1
  147. package/dist/runtime/builtins/nodes/forRange.d.ts +1 -1
  148. package/dist/runtime/builtins/nodes/forRange.js +10 -4
  149. package/dist/runtime/builtins/nodes/forRange.js.map +1 -1
  150. package/dist/runtime/builtins/nodes/if.js +2 -1
  151. package/dist/runtime/builtins/nodes/if.js.map +1 -1
  152. package/dist/runtime/builtins/nodes/parallel.js +9 -2
  153. package/dist/runtime/builtins/nodes/parallel.js.map +1 -1
  154. package/dist/runtime/builtins/nodes/retry.js +1 -1
  155. package/dist/runtime/builtins/nodes/retry.js.map +1 -1
  156. package/dist/runtime/builtins/nodes/setVariable.js +1 -3
  157. package/dist/runtime/builtins/nodes/setVariable.js.map +1 -1
  158. package/dist/runtime/builtins/triggers/cron.d.ts +3 -0
  159. package/dist/runtime/builtins/triggers/cron.js +21 -7
  160. package/dist/runtime/builtins/triggers/cron.js.map +1 -1
  161. package/dist/runtime/builtins/triggers/manual.js +2 -2
  162. package/dist/runtime/builtins/triggers/manual.js.map +1 -1
  163. package/dist/runtime/builtins/triggers/webhook.d.ts +14 -1
  164. package/dist/runtime/builtins/triggers/webhook.js +116 -30
  165. package/dist/runtime/builtins/triggers/webhook.js.map +1 -1
  166. package/dist/runtime/describe.d.ts +23 -0
  167. package/dist/runtime/describe.js +114 -0
  168. package/dist/runtime/describe.js.map +1 -0
  169. package/dist/runtime/executionResult.d.ts +1 -0
  170. package/dist/runtime/executor.js +82 -5
  171. package/dist/runtime/executor.js.map +1 -1
  172. package/dist/runtime/graphIssues.d.ts +20 -0
  173. package/dist/runtime/graphIssues.js +290 -0
  174. package/dist/runtime/graphIssues.js.map +1 -0
  175. package/dist/runtime/graphVersion.d.ts +2 -0
  176. package/dist/runtime/graphVersion.js +43 -0
  177. package/dist/runtime/graphVersion.js.map +1 -0
  178. package/dist/runtime/nodeKinds.d.ts +4 -4
  179. package/dist/runtime/nodeKinds.js +1 -2
  180. package/dist/runtime/nodeKinds.js.map +1 -1
  181. package/dist/runtime/registry.d.ts +2 -1
  182. package/dist/runtime/registry.js +1 -2
  183. package/dist/runtime/registry.js.map +1 -1
  184. package/dist/runtime/resolveInputs.d.ts +3 -1
  185. package/dist/runtime/resolveInputs.js +12 -2
  186. package/dist/runtime/resolveInputs.js.map +1 -1
  187. package/dist/runtime/resolveSubgraph.d.ts +12 -1
  188. package/dist/runtime/resolveSubgraph.js +36 -0
  189. package/dist/runtime/resolveSubgraph.js.map +1 -1
  190. package/dist/runtime/retention.d.ts +6 -0
  191. package/dist/runtime/retention.js +54 -0
  192. package/dist/runtime/retention.js.map +1 -0
  193. package/dist/runtime/runProcedure.d.ts +12 -0
  194. package/dist/runtime/runProcedure.js +130 -0
  195. package/dist/runtime/runProcedure.js.map +1 -0
  196. package/dist/runtime/schedule.d.ts +2 -0
  197. package/dist/runtime/schedule.js +139 -0
  198. package/dist/runtime/schedule.js.map +1 -0
  199. package/dist/runtime/subscriptions.d.ts +11 -1
  200. package/dist/runtime/subscriptions.js +91 -125
  201. package/dist/runtime/subscriptions.js.map +1 -1
  202. package/dist/runtime/subwalk.js +2 -3
  203. package/dist/runtime/subwalk.js.map +1 -1
  204. package/dist/runtime/templateUsages.d.ts +4 -0
  205. package/dist/runtime/templateUsages.js +102 -0
  206. package/dist/runtime/templateUsages.js.map +1 -0
  207. package/dist/runtime/topo.d.ts +1 -0
  208. package/dist/runtime/topo.js +23 -0
  209. package/dist/runtime/topo.js.map +1 -1
  210. package/dist/runtime/trace.d.ts +44 -0
  211. package/dist/runtime/trace.js +240 -0
  212. package/dist/runtime/trace.js.map +1 -0
  213. package/dist/runtime/typeSwitches.d.ts +3 -0
  214. package/dist/runtime/typeSwitches.js +27 -0
  215. package/dist/runtime/typeSwitches.js.map +1 -0
  216. package/dist/runtime/validate.d.ts +11 -0
  217. package/dist/runtime/validate.js +118 -61
  218. package/dist/runtime/validate.js.map +1 -1
  219. package/dist/runtime/webhookRoutes.d.ts +4 -0
  220. package/dist/runtime/webhookRoutes.js +68 -0
  221. package/dist/runtime/webhookRoutes.js.map +1 -0
  222. package/dist/runtime/withTimeout.d.ts +1 -0
  223. package/dist/runtime/withTimeout.js +17 -0
  224. package/dist/runtime/withTimeout.js.map +1 -0
  225. package/dist/runtime/wording.d.ts +10 -0
  226. package/dist/runtime/wording.js +118 -0
  227. package/dist/runtime/wording.js.map +1 -0
  228. package/dist/stats/health-banner.d.ts +13 -0
  229. package/dist/stats/health-banner.js +149 -0
  230. package/dist/stats/health-banner.js.map +1 -0
  231. package/dist/stats/health.d.ts +49 -0
  232. package/dist/stats/health.js +130 -0
  233. package/dist/stats/health.js.map +1 -0
  234. package/dist/stats/kpi.d.ts +21 -0
  235. package/dist/stats/kpi.js +101 -0
  236. package/dist/stats/kpi.js.map +1 -0
  237. package/dist/stats/overview.d.ts +94 -0
  238. package/dist/stats/overview.js +244 -0
  239. package/dist/stats/overview.js.map +1 -0
  240. package/dist/types/constants.d.ts +0 -1
  241. package/dist/types/constants.js +1 -2
  242. package/dist/types/constants.js.map +1 -1
  243. package/dist/types/runLog.d.ts +2 -0
  244. package/dist/types/runLog.js +4 -0
  245. package/dist/types/runLog.js.map +1 -1
  246. package/frontend-vue/app/components/AttentionList.vue +276 -0
  247. package/frontend-vue/app/components/Catalog/SchemaTable.vue +127 -0
  248. package/frontend-vue/app/components/Catalog.vue +457 -0
  249. package/frontend-vue/app/components/Editor/BottomDock.vue +188 -0
  250. package/frontend-vue/app/components/Editor/BuilderPalette.vue +101 -45
  251. package/frontend-vue/app/components/Editor/GraphCanvas.vue +818 -206
  252. package/frontend-vue/app/components/Editor/GroupPortEditor.vue +29 -18
  253. package/frontend-vue/app/components/Editor/JsonField.vue +3 -3
  254. package/frontend-vue/app/components/Editor/NewProcedureDialog.vue +108 -0
  255. package/frontend-vue/app/components/Editor/NodeInspector.vue +373 -101
  256. package/frontend-vue/app/components/Editor/ProcedureSwitcher.vue +147 -0
  257. package/frontend-vue/app/components/Editor/RunNowDialog.vue +145 -0
  258. package/frontend-vue/app/components/Editor/WiredField.vue +3 -3
  259. package/frontend-vue/app/components/Editor/nodes/GenericNode.vue +97 -91
  260. package/frontend-vue/app/components/Editor/nodes/GroupNode.vue +5 -6
  261. package/frontend-vue/app/components/Editor/nodes/GroupSentinel.vue +3 -2
  262. package/frontend-vue/app/components/Editor/nodes/styles.ts +14 -18
  263. package/frontend-vue/app/components/Editor.vue +1894 -705
  264. package/frontend-vue/app/components/IconPicker.vue +122 -0
  265. package/frontend-vue/app/components/LiveTopics.vue +20 -0
  266. package/frontend-vue/app/components/Run/RunCompare.vue +115 -0
  267. package/frontend-vue/app/components/Run/RunFailure.vue +54 -0
  268. package/frontend-vue/app/components/Run/RunLogList.vue +167 -0
  269. package/frontend-vue/app/components/Run/RunPathTaken.vue +139 -0
  270. package/frontend-vue/app/components/Run/RunPayload.vue +85 -0
  271. package/frontend-vue/app/components/Run/RunWaterfall.vue +374 -0
  272. package/frontend-vue/app/components/RunPeek.vue +132 -0
  273. package/frontend-vue/app/components/RunTrace.vue +462 -0
  274. package/frontend-vue/app/components/Templates.vue +382 -537
  275. package/frontend-vue/app/components/WebhookEndpoint.vue +81 -0
  276. package/frontend-vue/app/composables/useAutomationNodeKinds.ts +23 -6
  277. package/frontend-vue/app/composables/useAutomationRuns.ts +160 -25
  278. package/frontend-vue/app/composables/useGraphConnect.ts +103 -51
  279. package/frontend-vue/app/composables/useRunActions.ts +60 -0
  280. package/frontend-vue/app/plugins/cell-displays.ts +169 -0
  281. package/frontend-vue/app/utils/automation.ts +4 -36
  282. package/frontend-vue/app/utils/describe.ts +252 -0
  283. package/frontend-vue/app/utils/redactedHeaders.ts +31 -0
  284. package/frontend-vue/dms.frontend.build.ts +7 -0
  285. package/frontend-vue/dms.frontend.ts +7 -4
  286. package/frontend-vue/i18n/locales/dms-automation-en-GB.json +1149 -309
  287. package/frontend-vue/i18n/locales/dms-automation-fr-FR.json +1154 -314
  288. package/frontend-vue/package.json +1 -1
  289. package/package.json +8 -6
  290. package/dist/db/models/type_config.model.d.ts +0 -47
  291. package/dist/db/models/type_config.model.js +0 -51
  292. package/dist/db/models/type_config.model.js.map +0 -1
  293. package/dist/db/tables/action_type_config.table.d.ts +0 -7
  294. package/dist/db/tables/action_type_config.table.js +0 -35
  295. package/dist/db/tables/action_type_config.table.js.map +0 -1
  296. package/dist/db/tables/trigger_type_config.table.d.ts +0 -7
  297. package/dist/db/tables/trigger_type_config.table.js.map +0 -1
  298. package/frontend-vue/app/components/Actions.vue +0 -151
  299. package/frontend-vue/app/components/Catalog/TypeConfigForm.vue +0 -170
  300. package/frontend-vue/app/components/Catalog/TypeList.vue +0 -203
  301. package/frontend-vue/app/components/DataNodes.vue +0 -275
  302. package/frontend-vue/app/components/Editor/ProcedureList.vue +0 -156
  303. package/frontend-vue/app/components/Editor/RunsDrawer.vue +0 -312
  304. package/frontend-vue/app/components/Library.vue +0 -69
  305. package/frontend-vue/app/components/Overview.vue +0 -503
  306. package/frontend-vue/app/components/RunDetailDrawer.vue +0 -165
  307. package/frontend-vue/app/components/RunFireTree.vue +0 -170
  308. package/frontend-vue/app/components/RunTraceDrawer.vue +0 -59
  309. package/frontend-vue/app/components/RunsStats.vue +0 -126
  310. package/frontend-vue/app/components/RunsTimelineDisplay.vue +0 -287
  311. package/frontend-vue/app/components/Triggers.vue +0 -147
  312. package/frontend-vue/app/plugins/runs-timeline-display.client.ts +0 -16
@@ -1,203 +0,0 @@
1
- <script lang="ts">
2
- // The `generic` attribute is compiled into the component's module scope, where
3
- // a type declared inside `<script setup>` does not exist yet. Catalog entries
4
- // therefore describe themselves here.
5
- export interface CatalogType {
6
- id: string
7
- name: string
8
- description?: string
9
- icon?: string
10
- }
11
- </script>
12
-
13
- <script setup lang="ts" generic="T extends CatalogType">
14
- import { computed, ref } from 'vue'
15
-
16
- const props = withDefaults(
17
- defineProps<{
18
- types: T[]
19
- modelValue: string | null
20
- groupBy?: (t: T) => string
21
- title?: string
22
- /** Show the inline search box (on by default). */
23
- searchable?: boolean
24
- /** Placeholder for the search box; falls back to a generic label. */
25
- searchPlaceholder?: string
26
- }>(),
27
- // A bare `boolean` prop defaults to `false` when omitted, which would
28
- // silently hide search on every catalog; pin the intended on-by-default.
29
- { searchable: true },
30
- )
31
-
32
- const emit = defineEmits<{
33
- (e: 'update:modelValue', value: string): void
34
- }>()
35
-
36
- // A type's `name` / `description` may be a `$`-prefixed DMS i18n key shipped
37
- // in the declaring module's locales; plain text is shown as written.
38
- const { processI18n } = useTranslation()
39
-
40
- function select(id: string) {
41
- emit('update:modelValue', id)
42
- }
43
-
44
- const isSelected = (id: string) => props.modelValue === id
45
-
46
- // Search defaults to on; pass `:searchable="false"` to opt out.
47
- const searchEnabled = computed(() => props.searchable !== false)
48
- const query = ref('')
49
-
50
- // Case-insensitive substring filter over the displayed (translated) name /
51
- // description and the id. Catalogs hold
52
- // at most a few hundred registered types, so a per-keystroke scan is cheap and
53
- // avoids pulling in a fuzzy-match dependency.
54
- const visibleTypes = computed<T[]>(() => {
55
- const q = query.value.trim().toLowerCase()
56
- if (!searchEnabled.value || !q) return props.types
57
- return props.types.filter(
58
- (t) =>
59
- processI18n(t.name).toLowerCase().includes(q) ||
60
- (t.description && processI18n(t.description).toLowerCase().includes(q)) ||
61
- t.id?.toLowerCase().includes(q),
62
- )
63
- })
64
-
65
- // Group the types by the optional groupBy callback. Preserve insertion order:
66
- // groups appear in the order of their first-seen member.
67
- const grouped = computed<Array<{ key: string; items: T[] }> | null>(() => {
68
- if (!props.groupBy) return null
69
- const order: string[] = []
70
- const byKey = new Map<string, T[]>()
71
- for (const t of visibleTypes.value) {
72
- const key = props.groupBy(t)
73
- const bucket = byKey.get(key)
74
- if (bucket) {
75
- bucket.push(t)
76
- } else {
77
- byKey.set(key, [t])
78
- order.push(key)
79
- }
80
- }
81
- return order.map((key) => ({ key, items: byKey.get(key) as T[] }))
82
- })
83
-
84
- const itemClass = (id: string) =>
85
- isSelected(id)
86
- ? 'bg-primary/10 text-primary ring-1 ring-primary/20'
87
- : 'text-toned hover:bg-elevated/60'
88
- </script>
89
-
90
- <template>
91
- <DmsCard :padded="false" class="flex flex-col overflow-hidden">
92
- <div
93
- v-if="title"
94
- class="flex items-center justify-between gap-2 border-b border-default px-4 py-3"
95
- >
96
- <h2 class="text-sm font-semibold text-highlighted">{{ title }}</h2>
97
- <UBadge color="neutral" variant="subtle" size="sm" class="tabular-nums">
98
- {{ visibleTypes.length }}
99
- </UBadge>
100
- </div>
101
-
102
- <div
103
- v-if="searchEnabled && types.length"
104
- class="border-b border-default px-3 py-2"
105
- >
106
- <UInput
107
- v-model="query"
108
- :placeholder="searchPlaceholder || $t('dms_automation.catalog.search')"
109
- icon="i-ph-magnifying-glass"
110
- size="sm"
111
- autocomplete="off"
112
- class="w-full"
113
- />
114
- </div>
115
-
116
- <div class="flex-1 overflow-y-auto p-2">
117
- <div
118
- v-if="!types || types.length === 0"
119
- class="px-3 py-6 text-center text-sm text-dimmed"
120
- >
121
- {{ $t('dms_automation.catalog.empty') }}
122
- </div>
123
-
124
- <div
125
- v-else-if="visibleTypes.length === 0"
126
- class="px-3 py-6 text-center text-sm text-dimmed"
127
- >
128
- {{ $t('dms_automation.catalog.noResults') }}
129
- </div>
130
-
131
- <template v-else-if="grouped">
132
- <div
133
- v-for="group in grouped"
134
- :key="group.key"
135
- class="mb-2 flex flex-col gap-1 last:mb-0"
136
- >
137
- <div
138
- class="px-3 pb-1 pt-2 text-xs font-semibold uppercase tracking-wide text-dimmed"
139
- >
140
- {{ group.key }}
141
- </div>
142
- <ul class="flex flex-col gap-1">
143
- <li v-for="t in group.items" :key="t.id">
144
- <button
145
- type="button"
146
- class="flex w-full items-start gap-3 rounded-lg px-3 py-2 text-left transition-colors"
147
- :class="itemClass(t.id)"
148
- @click="select(t.id)"
149
- >
150
- <UIcon
151
- v-if="t.icon"
152
- :name="t.icon"
153
- class="mt-0.5 size-4 shrink-0"
154
- :class="isSelected(t.id) ? 'text-primary' : 'text-dimmed'"
155
- />
156
- <div class="min-w-0 flex-1">
157
- <div
158
- class="truncate text-sm font-medium"
159
- :class="isSelected(t.id) ? 'text-primary' : 'text-highlighted'"
160
- >
161
- {{ processI18n(t.name) }}
162
- </div>
163
- <div v-if="t.description" class="truncate text-xs text-muted">
164
- {{ processI18n(t.description) }}
165
- </div>
166
- </div>
167
- </button>
168
- </li>
169
- </ul>
170
- </div>
171
- </template>
172
-
173
- <ul v-else class="flex flex-col gap-1">
174
- <li v-for="t in visibleTypes" :key="t.id">
175
- <button
176
- type="button"
177
- class="flex w-full items-start gap-3 rounded-lg px-3 py-2 text-left transition-colors"
178
- :class="itemClass(t.id)"
179
- @click="select(t.id)"
180
- >
181
- <UIcon
182
- v-if="t.icon"
183
- :name="t.icon"
184
- class="mt-0.5 size-4 shrink-0"
185
- :class="isSelected(t.id) ? 'text-primary' : 'text-dimmed'"
186
- />
187
- <div class="min-w-0 flex-1">
188
- <div
189
- class="truncate text-sm font-medium"
190
- :class="isSelected(t.id) ? 'text-primary' : 'text-highlighted'"
191
- >
192
- {{ processI18n(t.name) }}
193
- </div>
194
- <div v-if="t.description" class="truncate text-xs text-muted">
195
- {{ processI18n(t.description) }}
196
- </div>
197
- </div>
198
- </button>
199
- </li>
200
- </ul>
201
- </div>
202
- </DmsCard>
203
- </template>
@@ -1,275 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, ref } from 'vue'
3
- import { type ListEnvelope, unwrapList } from '../utils/automation'
4
- import type {
5
- DataNodeType,
6
- JsonSchema,
7
- JsonSchemaProperty,
8
- } from '../composables/useGraphConnect'
9
-
10
- // Catalog-side shape: backend returns DataNodeType minus `evaluate`.
11
- type DataNodeTypeItem = Omit<DataNodeType, 'inputSchema' | 'outputSchema'> & {
12
- inputSchema?: JsonSchema
13
- outputSchema?: JsonSchema
14
- }
15
-
16
- type JsonSchemaProp = JsonSchemaProperty
17
-
18
- interface PortRow {
19
- name: string
20
- type: string | string[]
21
- description?: string
22
- }
23
-
24
- // `embedded` drops the page-head when this catalog is rendered inside a Library tab.
25
- defineProps<{ embedded?: boolean }>()
26
-
27
- const { $authFetch } = useAuthFetch()
28
- // A type's `name` / `description` may be a `$`-prefixed DMS i18n key shipped
29
- // in the declaring module's locales; plain text is shown as written.
30
- const { processI18n } = useTranslation()
31
-
32
- const items = ref<DataNodeTypeItem[]>([])
33
- const loading = ref(false)
34
- const loadError = ref<string | null>(null)
35
- const selectedId = ref<string | null>(null)
36
-
37
- async function loadList() {
38
- loading.value = true
39
- loadError.value = null
40
- try {
41
- const data = await $authFetch<DataNodeTypeItem[] | ListEnvelope<DataNodeTypeItem>>(
42
- '/api/automation/data-node-types',
43
- )
44
- items.value = unwrapList(data)
45
- if (!selectedId.value && items.value[0]) {
46
- selectedId.value = items.value[0].id
47
- }
48
- } catch (e) {
49
- loadError.value = (e as Error).message ?? 'Failed to load data node types'
50
- } finally {
51
- loading.value = false
52
- }
53
- }
54
-
55
- await loadList()
56
-
57
- const selectedType = computed<DataNodeTypeItem | null>(
58
- () => items.value.find((t) => t.id === selectedId.value) ?? null,
59
- )
60
-
61
- function propsOf(schema: JsonSchema | undefined): PortRow[] {
62
- const props = schema?.properties ?? {}
63
- return Object.entries(props).map(([name, p]) => ({
64
- name,
65
- type: (p as JsonSchemaProp)?.type ?? 'any',
66
- description: (p as JsonSchemaProp)?.description,
67
- }))
68
- }
69
-
70
- const inputs = computed<PortRow[]>(() => propsOf(selectedType.value?.inputSchema))
71
- const outputs = computed<PortRow[]>(() => propsOf(selectedType.value?.outputSchema))
72
-
73
- function categoryOf(t: DataNodeTypeItem): string {
74
- return t.category ?? 'other'
75
- }
76
- </script>
77
-
78
- <template>
79
- <!-- Embedded in the library page, which fills the panel: from `lg` up the
80
- list and the detail share the height and scroll inside; below, where
81
- they stack, the catalog scrolls as a whole. -->
82
- <div
83
- :class="
84
- embedded
85
- ? 'flex min-h-0 flex-1 flex-col gap-5 max-lg:overflow-y-auto'
86
- : 'flex flex-col gap-6 p-4 sm:p-6'
87
- "
88
- >
89
- <section v-if="!embedded" class="flex flex-wrap items-center gap-4">
90
- <div
91
- class="grid size-11 shrink-0 place-items-center rounded-xl bg-primary/10 text-primary ring ring-primary/20"
92
- >
93
- <UIcon name="i-ph-cube" class="size-6" />
94
- </div>
95
- <div class="min-w-0 flex-1">
96
- <h1 class="text-2xl font-semibold tracking-tight text-highlighted">
97
- {{ $t('dms_automation.data_nodes.title') }}
98
- </h1>
99
- <p class="text-sm text-muted">
100
- {{ $t('dms_automation.data_nodes.description') }}
101
- </p>
102
- </div>
103
- <UButton
104
- class="ml-auto"
105
- color="neutral"
106
- variant="outline"
107
- icon="i-ph-arrows-clockwise"
108
- :loading="loading"
109
- @click="loadList"
110
- >
111
- {{ $t('dms_automation.data_nodes.refresh') }}
112
- </UButton>
113
- </section>
114
-
115
- <UAlert
116
- v-if="loadError"
117
- color="error"
118
- variant="subtle"
119
- icon="i-ph-warning"
120
- :title="$t('dms_automation.data_nodes.loadError')"
121
- :description="loadError"
122
- />
123
-
124
- <div
125
- class="grid grid-cols-1 gap-5 lg:min-h-0 lg:flex-1 lg:grid-cols-[minmax(280px,340px)_1fr]"
126
- >
127
- <DmsAutomationTypeList
128
- :types="items"
129
- :model-value="selectedId"
130
- :group-by="categoryOf"
131
- :title="$t('dms_automation.data_nodes.listLabel')"
132
- class="lg:min-h-0"
133
- @update:model-value="selectedId = $event"
134
- />
135
-
136
- <DmsCard
137
- v-if="selectedType"
138
- :padded="false"
139
- class="flex flex-col lg:min-h-0 lg:overflow-y-auto"
140
- >
141
- <div class="flex items-start gap-3 border-b border-default px-5 py-4 sm:px-6">
142
- <div
143
- class="grid size-10 shrink-0 place-items-center rounded-lg bg-primary/10 text-primary ring ring-primary/20"
144
- >
145
- <UIcon :name="selectedType.icon || 'i-ph-cube'" class="size-5" />
146
- </div>
147
- <div class="min-w-0 flex-1">
148
- <h2 class="truncate text-lg font-semibold text-highlighted">
149
- {{ processI18n(selectedType.name) }}
150
- </h2>
151
- <p class="mt-1 font-mono text-xs text-dimmed">{{ selectedType.id }}</p>
152
- </div>
153
- <UBadge
154
- v-if="selectedType.category"
155
- color="neutral"
156
- variant="subtle"
157
- class="shrink-0"
158
- >
159
- {{ selectedType.category }}
160
- </UBadge>
161
- </div>
162
-
163
- <div class="flex flex-col gap-6 px-5 py-4 sm:px-6">
164
- <p v-if="selectedType.description" class="text-sm text-toned">
165
- {{ processI18n(selectedType.description) }}
166
- </p>
167
-
168
- <div class="flex flex-col gap-2">
169
- <div class="text-sm font-semibold text-highlighted">
170
- {{ $t('dms_automation.data_nodes.inputs') }}
171
- </div>
172
- <div v-if="inputs.length === 0" class="text-sm text-dimmed">
173
- {{ $t('dms_automation.data_nodes.noPorts') }}
174
- </div>
175
- <div
176
- v-else
177
- class="overflow-hidden rounded-lg border border-default"
178
- >
179
- <table class="w-full text-sm">
180
- <thead>
181
- <tr class="border-b border-default bg-muted">
182
- <th class="px-4 py-2.5 text-left text-xs font-semibold text-dimmed">
183
- {{ $t('dms_automation.data_nodes.col.name') }}
184
- </th>
185
- <th class="px-4 py-2.5 text-left text-xs font-semibold text-dimmed">
186
- {{ $t('dms_automation.data_nodes.col.type') }}
187
- </th>
188
- <th class="px-4 py-2.5 text-left text-xs font-semibold text-dimmed">
189
- {{ $t('dms_automation.data_nodes.col.description') }}
190
- </th>
191
- </tr>
192
- </thead>
193
- <tbody>
194
- <tr
195
- v-for="row in inputs"
196
- :key="`in-${row.name}`"
197
- class="border-b border-default/60 last:border-0"
198
- >
199
- <td class="px-4 py-2.5 font-mono text-highlighted">
200
- {{ row.name }}
201
- </td>
202
- <td class="whitespace-nowrap px-4 py-2.5 font-mono text-primary">
203
- {{ row.type }}
204
- </td>
205
- <td class="px-4 py-2.5 text-muted">
206
- {{ row.description ?? '' }}
207
- </td>
208
- </tr>
209
- </tbody>
210
- </table>
211
- </div>
212
- </div>
213
-
214
- <div class="flex flex-col gap-2">
215
- <div class="text-sm font-semibold text-highlighted">
216
- {{ $t('dms_automation.data_nodes.outputs') }}
217
- </div>
218
- <div v-if="outputs.length === 0" class="text-sm text-dimmed">
219
- {{ $t('dms_automation.data_nodes.noPorts') }}
220
- </div>
221
- <div
222
- v-else
223
- class="overflow-hidden rounded-lg border border-default"
224
- >
225
- <table class="w-full text-sm">
226
- <thead>
227
- <tr class="border-b border-default bg-muted">
228
- <th class="px-4 py-2.5 text-left text-xs font-semibold text-dimmed">
229
- {{ $t('dms_automation.data_nodes.col.name') }}
230
- </th>
231
- <th class="px-4 py-2.5 text-left text-xs font-semibold text-dimmed">
232
- {{ $t('dms_automation.data_nodes.col.type') }}
233
- </th>
234
- <th class="px-4 py-2.5 text-left text-xs font-semibold text-dimmed">
235
- {{ $t('dms_automation.data_nodes.col.description') }}
236
- </th>
237
- </tr>
238
- </thead>
239
- <tbody>
240
- <tr
241
- v-for="row in outputs"
242
- :key="`out-${row.name}`"
243
- class="border-b border-default/60 last:border-0"
244
- >
245
- <td class="px-4 py-2.5 font-mono text-highlighted">
246
- {{ row.name }}
247
- </td>
248
- <td class="whitespace-nowrap px-4 py-2.5 font-mono text-primary">
249
- {{ row.type }}
250
- </td>
251
- <td class="px-4 py-2.5 text-muted">
252
- {{ row.description ?? '' }}
253
- </td>
254
- </tr>
255
- </tbody>
256
- </table>
257
- </div>
258
- </div>
259
- </div>
260
- </DmsCard>
261
-
262
- <DmsCard
263
- v-else
264
- class="flex min-h-[16rem] items-center justify-center text-center"
265
- >
266
- <div class="flex flex-col items-center gap-3 text-dimmed">
267
- <UIcon name="i-ph-cube" class="size-8" />
268
- <p class="max-w-xs text-sm">
269
- {{ $t('dms_automation.data_nodes.empty') }}
270
- </p>
271
- </div>
272
- </DmsCard>
273
- </div>
274
- </div>
275
- </template>
@@ -1,156 +0,0 @@
1
- <script setup lang="ts">
2
- import { ref, watch } from 'vue'
3
-
4
- interface ProcedureListItem {
5
- _id: string
6
- name: string
7
- enabled: boolean
8
- }
9
-
10
- const props = defineProps<{
11
- procedures: ProcedureListItem[]
12
- modelValue: string | null
13
- }>()
14
-
15
- const emit = defineEmits(['update:modelValue', 'create', 'delete'])
16
-
17
- const confirmOpen = ref(false)
18
- const pendingDeleteId = ref<string | null>(null)
19
- const pendingDeleteName = ref<string>('')
20
-
21
- function select(id: string) {
22
- const next = props.modelValue === id ? null : id
23
- emit('update:modelValue', next)
24
- }
25
-
26
- function askDelete(p: ProcedureListItem) {
27
- pendingDeleteId.value = p._id
28
- pendingDeleteName.value = p.name
29
- confirmOpen.value = true
30
- }
31
-
32
- function confirmDelete() {
33
- const id = pendingDeleteId.value
34
- if (id) {
35
- emit('delete', id)
36
- }
37
- confirmOpen.value = false
38
- }
39
-
40
- function cancelDelete() {
41
- confirmOpen.value = false
42
- }
43
-
44
- // Reset pending state whenever the modal closes (via any means).
45
- watch(confirmOpen, (open) => {
46
- if (!open) {
47
- pendingDeleteId.value = null
48
- pendingDeleteName.value = ''
49
- }
50
- })
51
-
52
- const isSelected = (id: string) => props.modelValue === id
53
- </script>
54
-
55
- <template>
56
- <div class="flex flex-col gap-2">
57
- <div class="flex flex-wrap items-center justify-between gap-2">
58
- <div class="text-sm font-semibold text-highlighted">
59
- {{ $t('dms_automation.editor.procedureList.title') }}
60
- </div>
61
- <UButton
62
- size="xs"
63
- icon="i-ph-plus"
64
- color="primary"
65
- variant="soft"
66
- class="shrink-0"
67
- @click="emit('create')"
68
- >
69
- {{ $t('dms_automation.editor.procedureList.new') }}
70
- </UButton>
71
- </div>
72
-
73
- <div
74
- v-if="!procedures || procedures.length === 0"
75
- class="px-2 py-6 text-center text-sm text-dimmed"
76
- >
77
- {{ $t('dms_automation.editor.procedureList.empty') }}
78
- </div>
79
- <ul v-else class="flex flex-col gap-1">
80
- <li v-for="p in procedures" :key="p._id">
81
- <div
82
- class="flex w-full items-center gap-2 rounded-lg px-2 py-1.5 transition-colors"
83
- :class="
84
- isSelected(p._id)
85
- ? 'bg-primary/10 ring-1 ring-primary/20'
86
- : 'hover:bg-elevated/60'
87
- "
88
- >
89
- <button
90
- type="button"
91
- class="flex min-w-0 flex-1 items-center gap-2 text-left"
92
- @click="select(p._id)"
93
- >
94
- <div class="min-w-0 flex-1">
95
- <div
96
- class="truncate text-sm font-medium"
97
- :class="isSelected(p._id) ? 'text-primary' : 'text-highlighted'"
98
- >
99
- {{ p.name }}
100
- </div>
101
- </div>
102
- <UBadge
103
- :color="p.enabled ? 'success' : 'neutral'"
104
- variant="subtle"
105
- size="xs"
106
- >
107
- {{
108
- p.enabled
109
- ? $t('dms_automation.editor.procedureList.enabled')
110
- : $t('dms_automation.editor.procedureList.disabled')
111
- }}
112
- </UBadge>
113
- </button>
114
- <UButton
115
- size="xs"
116
- icon="i-ph-trash"
117
- color="error"
118
- variant="ghost"
119
- :aria-label="$t('dms_automation.editor.procedureList.deleteAria')"
120
- @click.stop="askDelete(p)"
121
- />
122
- </div>
123
- </li>
124
- </ul>
125
-
126
- <UModal
127
- v-model:open="confirmOpen"
128
- :title="$t('dms_automation.editor.procedureList.deleteTitle')"
129
- >
130
- <template #body>
131
- <p class="text-muted">
132
- {{
133
- $t('dms_automation.editor.procedureList.deleteConfirm', {
134
- name: pendingDeleteName,
135
- })
136
- }}
137
- </p>
138
- </template>
139
- <template #footer>
140
- <div class="flex w-full justify-end gap-2">
141
- <UButton
142
- :label="$t('dms_automation.editor.procedureList.cancel')"
143
- variant="outline"
144
- color="neutral"
145
- @click="cancelDelete"
146
- />
147
- <UButton
148
- :label="$t('dms_automation.editor.procedureList.delete')"
149
- color="error"
150
- @click="confirmDelete"
151
- />
152
- </div>
153
- </template>
154
- </UModal>
155
- </div>
156
- </template>