@antelopejs/dms-automation 0.0.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.
- package/LICENSE +190 -0
- package/README.md +95 -0
- package/dist/cluster/bus.d.ts +17 -0
- package/dist/cluster/bus.js +82 -0
- package/dist/cluster/bus.js.map +1 -0
- package/dist/cluster/instance.d.ts +1 -0
- package/dist/cluster/instance.js +6 -0
- package/dist/cluster/instance.js.map +1 -0
- package/dist/cluster/leader.d.ts +7 -0
- package/dist/cluster/leader.js +123 -0
- package/dist/cluster/leader.js.map +1 -0
- package/dist/cluster/mode.d.ts +3 -0
- package/dist/cluster/mode.js +25 -0
- package/dist/cluster/mode.js.map +1 -0
- package/dist/data/procedures-table.d.ts +66 -0
- package/dist/data/procedures-table.js +271 -0
- package/dist/data/procedures-table.js.map +1 -0
- package/dist/data/runs-table.d.ts +23 -0
- package/dist/data/runs-table.js +125 -0
- package/dist/data/runs-table.js.map +1 -0
- package/dist/db/index.d.ts +7 -0
- package/dist/db/index.js +24 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/models/automation_template.model.d.ts +58 -0
- package/dist/db/models/automation_template.model.js +134 -0
- package/dist/db/models/automation_template.model.js.map +1 -0
- package/dist/db/models/index.d.ts +3 -0
- package/dist/db/models/index.js +20 -0
- package/dist/db/models/index.js.map +1 -0
- package/dist/db/models/procedure.model.d.ts +25 -0
- package/dist/db/models/procedure.model.js +28 -0
- package/dist/db/models/procedure.model.js.map +1 -0
- package/dist/db/models/procedure_run.model.d.ts +34 -0
- package/dist/db/models/procedure_run.model.js +39 -0
- package/dist/db/models/procedure_run.model.js.map +1 -0
- package/dist/db/models/stats.model.d.ts +73 -0
- package/dist/db/models/stats.model.js +267 -0
- package/dist/db/models/stats.model.js.map +1 -0
- package/dist/db/models/type_config.model.d.ts +47 -0
- package/dist/db/models/type_config.model.js +51 -0
- package/dist/db/models/type_config.model.js.map +1 -0
- package/dist/db/tables/action_type_config.table.d.ts +7 -0
- package/dist/db/tables/action_type_config.table.js +35 -0
- package/dist/db/tables/action_type_config.table.js.map +1 -0
- package/dist/db/tables/automation_template.table.d.ts +11 -0
- package/dist/db/tables/automation_template.table.js +52 -0
- package/dist/db/tables/automation_template.table.js.map +1 -0
- package/dist/db/tables/index.d.ts +5 -0
- package/dist/db/tables/index.js +22 -0
- package/dist/db/tables/index.js.map +1 -0
- package/dist/db/tables/procedure.table.d.ts +10 -0
- package/dist/db/tables/procedure.table.js +48 -0
- package/dist/db/tables/procedure.table.js.map +1 -0
- package/dist/db/tables/procedure_run.table.d.ts +13 -0
- package/dist/db/tables/procedure_run.table.js +57 -0
- package/dist/db/tables/procedure_run.table.js.map +1 -0
- package/dist/db/tables/trigger_type_config.table.d.ts +7 -0
- package/dist/db/tables/trigger_type_config.table.js +35 -0
- package/dist/db/tables/trigger_type_config.table.js.map +1 -0
- package/dist/implementations/dms-automation/index.d.ts +19 -0
- package/dist/implementations/dms-automation/index.js +50 -0
- package/dist/implementations/dms-automation/index.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +121 -0
- package/dist/index.js.map +1 -0
- package/dist/pages/builder.d.ts +10 -0
- package/dist/pages/builder.js +28 -0
- package/dist/pages/builder.js.map +1 -0
- package/dist/pages/category.d.ts +1 -0
- package/dist/pages/category.js +10 -0
- package/dist/pages/category.js.map +1 -0
- package/dist/pages/index.d.ts +6 -0
- package/dist/pages/index.js +9 -0
- package/dist/pages/index.js.map +1 -0
- package/dist/pages/library.d.ts +10 -0
- package/dist/pages/library.js +28 -0
- package/dist/pages/library.js.map +1 -0
- package/dist/pages/overview.d.ts +10 -0
- package/dist/pages/overview.js +28 -0
- package/dist/pages/overview.js.map +1 -0
- package/dist/pages/procedures.d.ts +10 -0
- package/dist/pages/procedures.js +72 -0
- package/dist/pages/procedures.js.map +1 -0
- package/dist/pages/runs.d.ts +11 -0
- package/dist/pages/runs.js +61 -0
- package/dist/pages/runs.js.map +1 -0
- package/dist/routes/action-types.d.ts +23 -0
- package/dist/routes/action-types.js +80 -0
- package/dist/routes/action-types.js.map +1 -0
- package/dist/routes/data-node-types.d.ts +6 -0
- package/dist/routes/data-node-types.js +36 -0
- package/dist/routes/data-node-types.js.map +1 -0
- package/dist/routes/graphSchema.d.ts +92 -0
- package/dist/routes/graphSchema.js +60 -0
- package/dist/routes/graphSchema.js.map +1 -0
- package/dist/routes/index.d.ts +8 -0
- package/dist/routes/index.js +11 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/node-kinds.d.ts +9 -0
- package/dist/routes/node-kinds.js +35 -0
- package/dist/routes/node-kinds.js.map +1 -0
- package/dist/routes/procedures.d.ts +23 -0
- package/dist/routes/procedures.js +181 -0
- package/dist/routes/procedures.js.map +1 -0
- package/dist/routes/runs.d.ts +7 -0
- package/dist/routes/runs.js +81 -0
- package/dist/routes/runs.js.map +1 -0
- package/dist/routes/stats.d.ts +6 -0
- package/dist/routes/stats.js +35 -0
- package/dist/routes/stats.js.map +1 -0
- package/dist/routes/templates.d.ts +20 -0
- package/dist/routes/templates.js +243 -0
- package/dist/routes/templates.js.map +1 -0
- package/dist/routes/trigger-types.d.ts +24 -0
- package/dist/routes/trigger-types.js +80 -0
- package/dist/routes/trigger-types.js.map +1 -0
- package/dist/routes/typeConfigShared.d.ts +22 -0
- package/dist/routes/typeConfigShared.js +37 -0
- package/dist/routes/typeConfigShared.js.map +1 -0
- package/dist/runtime/builtins/actions/http.d.ts +13 -0
- package/dist/runtime/builtins/actions/http.js +47 -0
- package/dist/runtime/builtins/actions/http.js.map +1 -0
- package/dist/runtime/builtins/actions/index.d.ts +2 -0
- package/dist/runtime/builtins/actions/index.js +7 -0
- package/dist/runtime/builtins/actions/index.js.map +1 -0
- package/dist/runtime/builtins/actions/log.d.ts +13 -0
- package/dist/runtime/builtins/actions/log.js +49 -0
- package/dist/runtime/builtins/actions/log.js.map +1 -0
- package/dist/runtime/builtins/data/boolean.d.ts +2 -0
- package/dist/runtime/builtins/data/boolean.js +39 -0
- package/dist/runtime/builtins/data/boolean.js.map +1 -0
- package/dist/runtime/builtins/data/compare.d.ts +2 -0
- package/dist/runtime/builtins/data/compare.js +29 -0
- package/dist/runtime/builtins/data/compare.js.map +1 -0
- package/dist/runtime/builtins/data/constant.d.ts +2 -0
- package/dist/runtime/builtins/data/constant.js +29 -0
- package/dist/runtime/builtins/data/constant.js.map +1 -0
- package/dist/runtime/builtins/data/index.d.ts +2 -0
- package/dist/runtime/builtins/data/index.js +20 -0
- package/dist/runtime/builtins/data/index.js.map +1 -0
- package/dist/runtime/builtins/data/json.d.ts +2 -0
- package/dist/runtime/builtins/data/json.js +46 -0
- package/dist/runtime/builtins/data/json.js.map +1 -0
- package/dist/runtime/builtins/data/math.d.ts +2 -0
- package/dist/runtime/builtins/data/math.js +53 -0
- package/dist/runtime/builtins/data/math.js.map +1 -0
- package/dist/runtime/builtins/data/object.d.ts +2 -0
- package/dist/runtime/builtins/data/object.js +121 -0
- package/dist/runtime/builtins/data/object.js.map +1 -0
- package/dist/runtime/builtins/data/string.d.ts +2 -0
- package/dist/runtime/builtins/data/string.js +143 -0
- package/dist/runtime/builtins/data/string.js.map +1 -0
- package/dist/runtime/builtins/index.d.ts +17 -0
- package/dist/runtime/builtins/index.js +24 -0
- package/dist/runtime/builtins/index.js.map +1 -0
- package/dist/runtime/builtins/nodes/action.d.ts +1 -0
- package/dist/runtime/builtins/nodes/action.js +36 -0
- package/dist/runtime/builtins/nodes/action.js.map +1 -0
- package/dist/runtime/builtins/nodes/data.d.ts +1 -0
- package/dist/runtime/builtins/nodes/data.js +28 -0
- package/dist/runtime/builtins/nodes/data.js.map +1 -0
- package/dist/runtime/builtins/nodes/delay.d.ts +1 -0
- package/dist/runtime/builtins/nodes/delay.js +41 -0
- package/dist/runtime/builtins/nodes/delay.js.map +1 -0
- package/dist/runtime/builtins/nodes/forRange.d.ts +1 -0
- package/dist/runtime/builtins/nodes/forRange.js +52 -0
- package/dist/runtime/builtins/nodes/forRange.js.map +1 -0
- package/dist/runtime/builtins/nodes/foreach.d.ts +1 -0
- package/dist/runtime/builtins/nodes/foreach.js +31 -0
- package/dist/runtime/builtins/nodes/foreach.js.map +1 -0
- package/dist/runtime/builtins/nodes/groupInput.d.ts +1 -0
- package/dist/runtime/builtins/nodes/groupInput.js +11 -0
- package/dist/runtime/builtins/nodes/groupInput.js.map +1 -0
- package/dist/runtime/builtins/nodes/groupOutput.d.ts +1 -0
- package/dist/runtime/builtins/nodes/groupOutput.js +11 -0
- package/dist/runtime/builtins/nodes/groupOutput.js.map +1 -0
- package/dist/runtime/builtins/nodes/if.d.ts +1 -0
- package/dist/runtime/builtins/nodes/if.js +23 -0
- package/dist/runtime/builtins/nodes/if.js.map +1 -0
- package/dist/runtime/builtins/nodes/parallel.d.ts +1 -0
- package/dist/runtime/builtins/nodes/parallel.js +34 -0
- package/dist/runtime/builtins/nodes/parallel.js.map +1 -0
- package/dist/runtime/builtins/nodes/retry.d.ts +1 -0
- package/dist/runtime/builtins/nodes/retry.js +46 -0
- package/dist/runtime/builtins/nodes/retry.js.map +1 -0
- package/dist/runtime/builtins/nodes/setVariable.d.ts +1 -0
- package/dist/runtime/builtins/nodes/setVariable.js +31 -0
- package/dist/runtime/builtins/nodes/setVariable.js.map +1 -0
- package/dist/runtime/builtins/nodes/switch.d.ts +1 -0
- package/dist/runtime/builtins/nodes/switch.js +33 -0
- package/dist/runtime/builtins/nodes/switch.js.map +1 -0
- package/dist/runtime/builtins/nodes/trigger.d.ts +1 -0
- package/dist/runtime/builtins/nodes/trigger.js +25 -0
- package/dist/runtime/builtins/nodes/trigger.js.map +1 -0
- package/dist/runtime/builtins/nodes/tryCatch.d.ts +1 -0
- package/dist/runtime/builtins/nodes/tryCatch.js +35 -0
- package/dist/runtime/builtins/nodes/tryCatch.js.map +1 -0
- package/dist/runtime/builtins/triggers/cron.d.ts +9 -0
- package/dist/runtime/builtins/triggers/cron.js +52 -0
- package/dist/runtime/builtins/triggers/cron.js.map +1 -0
- package/dist/runtime/builtins/triggers/index.d.ts +2 -0
- package/dist/runtime/builtins/triggers/index.js +12 -0
- package/dist/runtime/builtins/triggers/index.js.map +1 -0
- package/dist/runtime/builtins/triggers/manual.d.ts +3 -0
- package/dist/runtime/builtins/triggers/manual.js +20 -0
- package/dist/runtime/builtins/triggers/manual.js.map +1 -0
- package/dist/runtime/builtins/triggers/webhook.d.ts +14 -0
- package/dist/runtime/builtins/triggers/webhook.js +90 -0
- package/dist/runtime/builtins/triggers/webhook.js.map +1 -0
- package/dist/runtime/executionResult.d.ts +6 -0
- package/dist/runtime/executionResult.js +3 -0
- package/dist/runtime/executionResult.js.map +1 -0
- package/dist/runtime/executor.d.ts +9 -0
- package/dist/runtime/executor.js +300 -0
- package/dist/runtime/executor.js.map +1 -0
- package/dist/runtime/flatten.d.ts +3 -0
- package/dist/runtime/flatten.js +188 -0
- package/dist/runtime/flatten.js.map +1 -0
- package/dist/runtime/nodeKinds.d.ts +64 -0
- package/dist/runtime/nodeKinds.js +43 -0
- package/dist/runtime/nodeKinds.js.map +1 -0
- package/dist/runtime/reconcileDiff.d.ts +9 -0
- package/dist/runtime/reconcileDiff.js +26 -0
- package/dist/runtime/reconcileDiff.js.map +1 -0
- package/dist/runtime/registry.d.ts +19 -0
- package/dist/runtime/registry.js +47 -0
- package/dist/runtime/registry.js.map +1 -0
- package/dist/runtime/resolveInputs.d.ts +14 -0
- package/dist/runtime/resolveInputs.js +64 -0
- package/dist/runtime/resolveInputs.js.map +1 -0
- package/dist/runtime/resolveSubgraph.d.ts +7 -0
- package/dist/runtime/resolveSubgraph.js +15 -0
- package/dist/runtime/resolveSubgraph.js.map +1 -0
- package/dist/runtime/subscriptions.d.ts +16 -0
- package/dist/runtime/subscriptions.js +419 -0
- package/dist/runtime/subscriptions.js.map +1 -0
- package/dist/runtime/subwalk.d.ts +17 -0
- package/dist/runtime/subwalk.js +74 -0
- package/dist/runtime/subwalk.js.map +1 -0
- package/dist/runtime/topo.d.ts +3 -0
- package/dist/runtime/topo.js +75 -0
- package/dist/runtime/topo.js.map +1 -0
- package/dist/runtime/typeOrigin.d.ts +7 -0
- package/dist/runtime/typeOrigin.js +24 -0
- package/dist/runtime/typeOrigin.js.map +1 -0
- package/dist/runtime/validate.d.ts +10 -0
- package/dist/runtime/validate.js +185 -0
- package/dist/runtime/validate.js.map +1 -0
- package/dist/runtime/validateTemplate.d.ts +3 -0
- package/dist/runtime/validateTemplate.js +54 -0
- package/dist/runtime/validateTemplate.js.map +1 -0
- package/dist/types/constants.d.ts +6 -0
- package/dist/types/constants.js +10 -0
- package/dist/types/constants.js.map +1 -0
- package/dist/types/graph.d.ts +51 -0
- package/dist/types/graph.js +23 -0
- package/dist/types/graph.js.map +1 -0
- package/dist/types/pagination.d.ts +8 -0
- package/dist/types/pagination.js +3 -0
- package/dist/types/pagination.js.map +1 -0
- package/dist/types/runLog.d.ts +26 -0
- package/dist/types/runLog.js +3 -0
- package/dist/types/runLog.js.map +1 -0
- package/frontend-vue/.prettierignore +4 -0
- package/frontend-vue/app/components/Actions.vue +141 -0
- package/frontend-vue/app/components/Catalog/TypeConfigForm.vue +166 -0
- package/frontend-vue/app/components/Catalog/TypeList.vue +198 -0
- package/frontend-vue/app/components/DataNodes.vue +259 -0
- package/frontend-vue/app/components/Editor/BuilderPalette.vue +234 -0
- package/frontend-vue/app/components/Editor/GraphCanvas.vue +994 -0
- package/frontend-vue/app/components/Editor/GroupPortEditor.vue +289 -0
- package/frontend-vue/app/components/Editor/JsonField.vue +63 -0
- package/frontend-vue/app/components/Editor/NodeInspector.vue +356 -0
- package/frontend-vue/app/components/Editor/ProcedureList.vue +156 -0
- package/frontend-vue/app/components/Editor/RunsDrawer.vue +312 -0
- package/frontend-vue/app/components/Editor/WiredField.vue +42 -0
- package/frontend-vue/app/components/Editor/nodes/GenericNode.vue +161 -0
- package/frontend-vue/app/components/Editor/nodes/GroupInputNode.vue +19 -0
- package/frontend-vue/app/components/Editor/nodes/GroupNode.vue +200 -0
- package/frontend-vue/app/components/Editor/nodes/GroupOutputNode.vue +19 -0
- package/frontend-vue/app/components/Editor/nodes/GroupSentinel.vue +161 -0
- package/frontend-vue/app/components/Editor/nodes/styles.ts +53 -0
- package/frontend-vue/app/components/Editor.vue +2504 -0
- package/frontend-vue/app/components/Library.vue +67 -0
- package/frontend-vue/app/components/Overview.vue +503 -0
- package/frontend-vue/app/components/RunDetailDrawer.vue +165 -0
- package/frontend-vue/app/components/RunFireTree.vue +170 -0
- package/frontend-vue/app/components/RunTraceDrawer.vue +59 -0
- package/frontend-vue/app/components/RunsStats.vue +126 -0
- package/frontend-vue/app/components/RunsTimelineDisplay.vue +287 -0
- package/frontend-vue/app/components/Templates.vue +663 -0
- package/frontend-vue/app/components/Triggers.vue +137 -0
- package/frontend-vue/app/composables/useAutomationNodeKinds.ts +48 -0
- package/frontend-vue/app/composables/useAutomationRuns.ts +75 -0
- package/frontend-vue/app/composables/useGraphConnect.ts +542 -0
- package/frontend-vue/app/plugins/runs-timeline-display.client.ts +16 -0
- package/frontend-vue/app/utils/automation.ts +51 -0
- package/frontend-vue/dms.frontend.ts +26 -0
- package/frontend-vue/eslint.config.mjs +24 -0
- package/frontend-vue/i18n/locales/dms-automation-en-GB.json +369 -0
- package/frontend-vue/i18n/locales/dms-automation-fr-FR.json +369 -0
- package/frontend-vue/package.json +33 -0
- package/frontend-vue/pnpm-lock.yaml +6483 -0
- package/frontend-vue/pnpm-workspace.yaml +2 -0
- package/package.json +81 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref } from 'vue'
|
|
3
|
+
import { type ListEnvelope, unwrapList } from '../utils/automation'
|
|
4
|
+
import type { TriggerType } from '../composables/useGraphConnect'
|
|
5
|
+
|
|
6
|
+
type TriggerTypeItem = TriggerType & { globalConfig?: string; enabled?: boolean }
|
|
7
|
+
|
|
8
|
+
// `embedded` drops the page-head when this catalog is rendered inside a Library tab.
|
|
9
|
+
defineProps<{ embedded?: boolean }>()
|
|
10
|
+
|
|
11
|
+
const { $authFetch } = useAuthFetch()
|
|
12
|
+
const toast = useToast()
|
|
13
|
+
|
|
14
|
+
const items = ref<TriggerTypeItem[]>([])
|
|
15
|
+
const loading = ref(false)
|
|
16
|
+
const loadError = ref<string | null>(null)
|
|
17
|
+
|
|
18
|
+
async function loadList() {
|
|
19
|
+
loading.value = true
|
|
20
|
+
loadError.value = null
|
|
21
|
+
try {
|
|
22
|
+
const data = await $authFetch<TriggerTypeItem[] | ListEnvelope<TriggerTypeItem>>(
|
|
23
|
+
'/api/automation/trigger-types',
|
|
24
|
+
)
|
|
25
|
+
items.value = unwrapList(data)
|
|
26
|
+
} catch (e) {
|
|
27
|
+
loadError.value = (e as Error).message ?? 'Failed to load trigger types'
|
|
28
|
+
} finally {
|
|
29
|
+
loading.value = false
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
await loadList()
|
|
34
|
+
|
|
35
|
+
const selectedId = ref<string | null>(items.value[0]?.id ?? null)
|
|
36
|
+
|
|
37
|
+
const selectedType = computed<TriggerTypeItem | null>(
|
|
38
|
+
() => items.value.find((t) => t.id === selectedId.value) ?? null,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
const selectedConfig = computed(() => selectedType.value?.globalConfig ?? '{}')
|
|
42
|
+
const selectedEnabled = computed(() => selectedType.value?.enabled ?? true)
|
|
43
|
+
|
|
44
|
+
async function onSave(payload: { enabled: boolean; config: string }) {
|
|
45
|
+
if (!selectedType.value) return
|
|
46
|
+
const id = selectedType.value.id
|
|
47
|
+
try {
|
|
48
|
+
await $authFetch(`/api/automation/trigger-types/${id}/config`, {
|
|
49
|
+
method: 'PUT',
|
|
50
|
+
body: payload,
|
|
51
|
+
})
|
|
52
|
+
// Reflect saved state locally
|
|
53
|
+
const idx = items.value.findIndex((t) => t.id === id)
|
|
54
|
+
if (idx >= 0) {
|
|
55
|
+
const current = items.value[idx]
|
|
56
|
+
if (current) {
|
|
57
|
+
items.value[idx] = {
|
|
58
|
+
...current,
|
|
59
|
+
enabled: payload.enabled,
|
|
60
|
+
globalConfig: payload.config,
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
toast.add({
|
|
65
|
+
title: 'Trigger saved',
|
|
66
|
+
description: id,
|
|
67
|
+
color: 'success',
|
|
68
|
+
icon: 'i-ph-check-circle',
|
|
69
|
+
})
|
|
70
|
+
} catch (e) {
|
|
71
|
+
toast.add({
|
|
72
|
+
title: 'Failed to save trigger',
|
|
73
|
+
description: (e as Error).message ?? id,
|
|
74
|
+
color: 'error',
|
|
75
|
+
icon: 'i-ph-warning',
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<template>
|
|
82
|
+
<div :class="embedded ? 'flex flex-col gap-5' : 'flex flex-col gap-6 p-4 sm:p-6'">
|
|
83
|
+
<section v-if="!embedded" class="flex flex-wrap items-center gap-4">
|
|
84
|
+
<div
|
|
85
|
+
class="grid size-11 shrink-0 place-items-center rounded-xl bg-primary/10 text-primary ring ring-primary/20"
|
|
86
|
+
>
|
|
87
|
+
<UIcon name="i-ph-lightning" class="size-6" />
|
|
88
|
+
</div>
|
|
89
|
+
<div class="min-w-0 flex-1">
|
|
90
|
+
<h1 class="text-2xl font-semibold tracking-tight text-highlighted">
|
|
91
|
+
{{ $t('dms_automation.triggers.title') }}
|
|
92
|
+
</h1>
|
|
93
|
+
<p class="text-sm text-muted">
|
|
94
|
+
{{ $t('dms_automation.triggers.description') }}
|
|
95
|
+
</p>
|
|
96
|
+
</div>
|
|
97
|
+
<UButton
|
|
98
|
+
class="ml-auto"
|
|
99
|
+
color="neutral"
|
|
100
|
+
variant="outline"
|
|
101
|
+
icon="i-ph-arrows-clockwise"
|
|
102
|
+
:loading="loading"
|
|
103
|
+
@click="loadList"
|
|
104
|
+
>
|
|
105
|
+
{{ $t('dms_automation.common.refresh') }}
|
|
106
|
+
</UButton>
|
|
107
|
+
</section>
|
|
108
|
+
|
|
109
|
+
<UAlert
|
|
110
|
+
v-if="loadError"
|
|
111
|
+
color="error"
|
|
112
|
+
variant="subtle"
|
|
113
|
+
icon="i-ph-warning"
|
|
114
|
+
:title="$t('dms_automation.triggers.loadError')"
|
|
115
|
+
:description="loadError"
|
|
116
|
+
/>
|
|
117
|
+
|
|
118
|
+
<div
|
|
119
|
+
class="grid grid-cols-1 gap-5 lg:grid-cols-[minmax(280px,340px)_1fr] lg:items-start"
|
|
120
|
+
>
|
|
121
|
+
<DmsAutomationTypeList
|
|
122
|
+
:types="items"
|
|
123
|
+
:model-value="selectedId"
|
|
124
|
+
:title="$t('dms_automation.triggers.listLabel')"
|
|
125
|
+
class="lg:max-h-[calc(100vh-12rem)]"
|
|
126
|
+
@update:model-value="selectedId = $event"
|
|
127
|
+
/>
|
|
128
|
+
<DmsAutomationTypeConfigForm
|
|
129
|
+
:type="selectedType"
|
|
130
|
+
:schema="selectedType?.configSchema"
|
|
131
|
+
:saved-config="selectedConfig"
|
|
132
|
+
:saved-enabled="selectedEnabled"
|
|
133
|
+
@save="onSave"
|
|
134
|
+
/>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</template>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { JsonSchema } from "./useGraphConnect";
|
|
2
|
+
import { type ListEnvelope, unwrapList } from "../utils/automation";
|
|
3
|
+
|
|
4
|
+
export interface PortRef {
|
|
5
|
+
name: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface NodeKindUI {
|
|
10
|
+
label: string;
|
|
11
|
+
icon?: string;
|
|
12
|
+
hasTriggerIn: boolean;
|
|
13
|
+
hasMainTriggerOut: boolean;
|
|
14
|
+
staticTriggerOuts: string[];
|
|
15
|
+
staticDataIns: PortRef[];
|
|
16
|
+
staticDataOuts: PortRef[];
|
|
17
|
+
dynamicTriggerOutsFromConfig?: string;
|
|
18
|
+
typeRegistry?: "triggers" | "actions" | "dataNodes";
|
|
19
|
+
dataInsFromTypeSchema?: "inputSchema" | "outputSchema" | "configSchema";
|
|
20
|
+
dataOutsFromTypeSchema?: "inputSchema" | "outputSchema" | "configSchema";
|
|
21
|
+
labelFromType?: boolean;
|
|
22
|
+
iconFromType?: boolean;
|
|
23
|
+
categoryFromType?: boolean;
|
|
24
|
+
category?: string;
|
|
25
|
+
defaultConfig?: Record<string, unknown>;
|
|
26
|
+
configSchema?: JsonSchema;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface NodeKindEntry {
|
|
30
|
+
kind: string;
|
|
31
|
+
meta: {
|
|
32
|
+
continuationPorts: string[];
|
|
33
|
+
sidePorts: string[];
|
|
34
|
+
ui?: NodeKindUI;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function useAutomationNodeKinds() {
|
|
39
|
+
const { $authFetch } = useAuthFetch();
|
|
40
|
+
return {
|
|
41
|
+
async list(): Promise<NodeKindEntry[]> {
|
|
42
|
+
const data = await $authFetch<
|
|
43
|
+
NodeKindEntry[] | ListEnvelope<NodeKindEntry>
|
|
44
|
+
>("/api/automation/node-kinds");
|
|
45
|
+
return unwrapList(data);
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type ListEnvelope, unwrapList } from "../utils/automation";
|
|
2
|
+
|
|
3
|
+
export type LogLevel = "info" | "warn" | "error";
|
|
4
|
+
|
|
5
|
+
export interface FireNode {
|
|
6
|
+
id: string;
|
|
7
|
+
parentFireId: string | null;
|
|
8
|
+
sourceNodeId: string;
|
|
9
|
+
port: string | null;
|
|
10
|
+
ts: number;
|
|
11
|
+
/**
|
|
12
|
+
* Monotonic per-run sequence number, shared with LogEntry.seq.
|
|
13
|
+
* Tiebreaker when several events share the same millisecond ts.
|
|
14
|
+
*/
|
|
15
|
+
seq: number;
|
|
16
|
+
iteration?: number;
|
|
17
|
+
closedAt?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface LogEntry {
|
|
21
|
+
fireId: string;
|
|
22
|
+
ts: number;
|
|
23
|
+
seq: number;
|
|
24
|
+
level: LogLevel;
|
|
25
|
+
source: "log" | "exec";
|
|
26
|
+
nodeId?: string;
|
|
27
|
+
nodeKind?: string;
|
|
28
|
+
message: string;
|
|
29
|
+
value?: unknown;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface RunLog {
|
|
33
|
+
fires: FireNode[];
|
|
34
|
+
entries: LogEntry[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface RunSummary {
|
|
38
|
+
_id: string;
|
|
39
|
+
procedureId: string;
|
|
40
|
+
startedAt: string;
|
|
41
|
+
endedAt?: string | null;
|
|
42
|
+
status: string;
|
|
43
|
+
errorMessage?: string | null;
|
|
44
|
+
triggerNodeId?: string;
|
|
45
|
+
triggerPayload?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface RunDetail extends RunSummary {
|
|
49
|
+
logs?: RunLog;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ProcedureRef {
|
|
53
|
+
_id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function useAutomationRuns() {
|
|
58
|
+
const { $authFetch } = useAuthFetch();
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
async getRun(id: string): Promise<RunDetail> {
|
|
62
|
+
return await $authFetch<RunDetail>(`/api/automation/runs/${id}`);
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
async listProcedures(): Promise<ProcedureRef[]> {
|
|
66
|
+
const data = await $authFetch<
|
|
67
|
+
ProcedureRef[] | ListEnvelope<ProcedureRef>
|
|
68
|
+
>("/api/automation/procedures");
|
|
69
|
+
return unwrapList<ProcedureRef>(data).map((p) => ({
|
|
70
|
+
_id: p._id,
|
|
71
|
+
name: p.name,
|
|
72
|
+
}));
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|