@antelopejs/dms-automation 0.2.7 → 0.3.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.
- package/README.md +46 -2
- package/dist/data/procedures-table.d.ts +38 -4
- package/dist/data/procedures-table.js +264 -82
- package/dist/data/procedures-table.js.map +1 -1
- package/dist/data/runs-table.d.ts +19 -3
- package/dist/data/runs-table.js +254 -19
- package/dist/data/runs-table.js.map +1 -1
- package/dist/db/index.d.ts +1 -2
- package/dist/db/index.js +1 -2
- package/dist/db/index.js.map +1 -1
- package/dist/db/models/automation_template.model.d.ts +16 -1
- package/dist/db/models/automation_template.model.js +31 -11
- package/dist/db/models/automation_template.model.js.map +1 -1
- package/dist/db/models/index.d.ts +1 -1
- package/dist/db/models/index.js +1 -1
- package/dist/db/models/procedure.model.d.ts +1 -0
- package/dist/db/models/procedure.model.js +7 -0
- package/dist/db/models/procedure.model.js.map +1 -1
- package/dist/db/models/procedure_run.model.d.ts +16 -9
- package/dist/db/models/procedure_run.model.js +96 -17
- package/dist/db/models/procedure_run.model.js.map +1 -1
- package/dist/db/models/stats.model.d.ts +60 -61
- package/dist/db/models/stats.model.js +189 -236
- package/dist/db/models/stats.model.js.map +1 -1
- package/dist/db/models/type_switch.model.d.ts +25 -0
- package/dist/db/models/type_switch.model.js +25 -0
- package/dist/db/models/type_switch.model.js.map +1 -0
- package/dist/db/tables/index.d.ts +1 -2
- package/dist/db/tables/index.js +1 -2
- package/dist/db/tables/index.js.map +1 -1
- package/dist/db/tables/procedure.table.d.ts +6 -0
- package/dist/db/tables/procedure.table.js +24 -0
- package/dist/db/tables/procedure.table.js.map +1 -1
- package/dist/db/tables/procedure_run.table.d.ts +15 -1
- package/dist/db/tables/procedure_run.table.js +54 -0
- package/dist/db/tables/procedure_run.table.js.map +1 -1
- package/dist/db/tables/type_switch.table.d.ts +8 -0
- package/dist/db/tables/{trigger_type_config.table.js → type_switch.table.js} +16 -15
- package/dist/db/tables/type_switch.table.js.map +1 -0
- package/dist/displays/index.d.ts +14 -0
- package/dist/displays/index.js +23 -0
- package/dist/displays/index.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/pages/builder.d.ts +1 -1
- package/dist/pages/builder.js +10 -3
- package/dist/pages/builder.js.map +1 -1
- package/dist/pages/index.d.ts +2 -1
- package/dist/pages/index.js +2 -1
- package/dist/pages/index.js.map +1 -1
- package/dist/pages/library.d.ts +2 -1
- package/dist/pages/library.js +54 -4
- package/dist/pages/library.js.map +1 -1
- package/dist/pages/overview.d.ts +6 -1
- package/dist/pages/overview.js +121 -2
- package/dist/pages/overview.js.map +1 -1
- package/dist/pages/procedures.js +106 -16
- package/dist/pages/procedures.js.map +1 -1
- package/dist/pages/runs.d.ts +4 -1
- package/dist/pages/runs.js +109 -13
- package/dist/pages/runs.js.map +1 -1
- package/dist/pages/shared.d.ts +18 -0
- package/dist/pages/shared.js +238 -0
- package/dist/pages/shared.js.map +1 -0
- package/dist/pages/trace.d.ts +10 -0
- package/dist/pages/trace.js +41 -0
- package/dist/pages/trace.js.map +1 -0
- package/dist/realtime.d.ts +3 -0
- package/dist/realtime.js +14 -0
- package/dist/realtime.js.map +1 -0
- package/dist/routes/action-types.d.ts +2 -14
- package/dist/routes/action-types.js +2 -32
- package/dist/routes/action-types.js.map +1 -1
- package/dist/routes/deleteConfirm.d.ts +3 -0
- package/dist/routes/deleteConfirm.js +64 -0
- package/dist/routes/deleteConfirm.js.map +1 -0
- package/dist/routes/graphSchema.d.ts +3 -90
- package/dist/routes/graphSchema.js +36 -9
- package/dist/routes/graphSchema.js.map +1 -1
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/index.js +1 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/library.d.ts +40 -0
- package/dist/routes/library.js +147 -0
- package/dist/routes/library.js.map +1 -0
- package/dist/routes/procedureChecks.d.ts +16 -0
- package/dist/routes/procedureChecks.js +72 -0
- package/dist/routes/procedureChecks.js.map +1 -0
- package/dist/routes/procedureRuns.d.ts +21 -0
- package/dist/routes/procedureRuns.js +45 -0
- package/dist/routes/procedureRuns.js.map +1 -0
- package/dist/routes/procedureSchemas.d.ts +107 -0
- package/dist/routes/procedureSchemas.js +61 -0
- package/dist/routes/procedureSchemas.js.map +1 -0
- package/dist/routes/procedures.d.ts +125 -7
- package/dist/routes/procedures.js +363 -67
- package/dist/routes/procedures.js.map +1 -1
- package/dist/routes/requests.d.ts +15 -0
- package/dist/routes/requests.js +35 -0
- package/dist/routes/requests.js.map +1 -0
- package/dist/routes/runs.d.ts +107 -2
- package/dist/routes/runs.js +340 -37
- package/dist/routes/runs.js.map +1 -1
- package/dist/routes/stats.d.ts +19 -1
- package/dist/routes/stats.js +160 -4
- package/dist/routes/stats.js.map +1 -1
- package/dist/routes/templates.d.ts +6 -2
- package/dist/routes/templates.js +106 -36
- package/dist/routes/templates.js.map +1 -1
- package/dist/routes/trigger-types.d.ts +2 -15
- package/dist/routes/trigger-types.js +2 -32
- package/dist/routes/trigger-types.js.map +1 -1
- package/dist/routes/typeConfigShared.d.ts +7 -11
- package/dist/routes/typeConfigShared.js +25 -15
- package/dist/routes/typeConfigShared.js.map +1 -1
- package/dist/runtime/armErrors.d.ts +16 -0
- package/dist/runtime/armErrors.js +69 -0
- package/dist/runtime/armErrors.js.map +1 -0
- package/dist/runtime/boundRunLog.d.ts +24 -0
- package/dist/runtime/boundRunLog.js +202 -10
- package/dist/runtime/boundRunLog.js.map +1 -1
- package/dist/runtime/builtins/actions/http.d.ts +10 -1
- package/dist/runtime/builtins/actions/http.js +306 -19
- package/dist/runtime/builtins/actions/http.js.map +1 -1
- package/dist/runtime/builtins/actions/log.js +2 -2
- package/dist/runtime/builtins/actions/log.js.map +1 -1
- package/dist/runtime/builtins/data/boolean.d.ts +1 -0
- package/dist/runtime/builtins/data/boolean.js +18 -10
- package/dist/runtime/builtins/data/boolean.js.map +1 -1
- package/dist/runtime/builtins/data/compare.js +60 -11
- package/dist/runtime/builtins/data/compare.js.map +1 -1
- package/dist/runtime/builtins/data/constant.js +9 -12
- package/dist/runtime/builtins/data/constant.js.map +1 -1
- package/dist/runtime/builtins/data/json.js +4 -4
- package/dist/runtime/builtins/data/json.js.map +1 -1
- package/dist/runtime/builtins/data/math.js +44 -24
- package/dist/runtime/builtins/data/math.js.map +1 -1
- package/dist/runtime/builtins/data/object.js +10 -10
- package/dist/runtime/builtins/data/object.js.map +1 -1
- package/dist/runtime/builtins/data/string.js +31 -20
- package/dist/runtime/builtins/data/string.js.map +1 -1
- package/dist/runtime/builtins/nodes/action.js +4 -0
- package/dist/runtime/builtins/nodes/action.js.map +1 -1
- package/dist/runtime/builtins/nodes/delay.js +1 -1
- package/dist/runtime/builtins/nodes/delay.js.map +1 -1
- package/dist/runtime/builtins/nodes/forRange.d.ts +1 -1
- package/dist/runtime/builtins/nodes/forRange.js +10 -4
- package/dist/runtime/builtins/nodes/forRange.js.map +1 -1
- package/dist/runtime/builtins/nodes/if.js +2 -1
- package/dist/runtime/builtins/nodes/if.js.map +1 -1
- package/dist/runtime/builtins/nodes/parallel.js +9 -2
- package/dist/runtime/builtins/nodes/parallel.js.map +1 -1
- package/dist/runtime/builtins/nodes/retry.js +1 -1
- package/dist/runtime/builtins/nodes/retry.js.map +1 -1
- package/dist/runtime/builtins/nodes/setVariable.js +1 -3
- package/dist/runtime/builtins/nodes/setVariable.js.map +1 -1
- package/dist/runtime/builtins/triggers/cron.d.ts +3 -0
- package/dist/runtime/builtins/triggers/cron.js +21 -7
- package/dist/runtime/builtins/triggers/cron.js.map +1 -1
- package/dist/runtime/builtins/triggers/manual.js +2 -2
- package/dist/runtime/builtins/triggers/manual.js.map +1 -1
- package/dist/runtime/builtins/triggers/webhook.d.ts +14 -1
- package/dist/runtime/builtins/triggers/webhook.js +116 -30
- package/dist/runtime/builtins/triggers/webhook.js.map +1 -1
- package/dist/runtime/describe.d.ts +23 -0
- package/dist/runtime/describe.js +114 -0
- package/dist/runtime/describe.js.map +1 -0
- package/dist/runtime/executionResult.d.ts +1 -0
- package/dist/runtime/executor.js +82 -5
- package/dist/runtime/executor.js.map +1 -1
- package/dist/runtime/graphIssues.d.ts +20 -0
- package/dist/runtime/graphIssues.js +290 -0
- package/dist/runtime/graphIssues.js.map +1 -0
- package/dist/runtime/graphVersion.d.ts +2 -0
- package/dist/runtime/graphVersion.js +43 -0
- package/dist/runtime/graphVersion.js.map +1 -0
- package/dist/runtime/nodeKinds.d.ts +4 -4
- package/dist/runtime/nodeKinds.js +1 -2
- package/dist/runtime/nodeKinds.js.map +1 -1
- package/dist/runtime/registry.d.ts +2 -1
- package/dist/runtime/registry.js +1 -2
- package/dist/runtime/registry.js.map +1 -1
- package/dist/runtime/resolveInputs.d.ts +3 -1
- package/dist/runtime/resolveInputs.js +12 -2
- package/dist/runtime/resolveInputs.js.map +1 -1
- package/dist/runtime/resolveSubgraph.d.ts +12 -1
- package/dist/runtime/resolveSubgraph.js +36 -0
- package/dist/runtime/resolveSubgraph.js.map +1 -1
- package/dist/runtime/retention.d.ts +6 -0
- package/dist/runtime/retention.js +54 -0
- package/dist/runtime/retention.js.map +1 -0
- package/dist/runtime/runProcedure.d.ts +12 -0
- package/dist/runtime/runProcedure.js +130 -0
- package/dist/runtime/runProcedure.js.map +1 -0
- package/dist/runtime/schedule.d.ts +2 -0
- package/dist/runtime/schedule.js +139 -0
- package/dist/runtime/schedule.js.map +1 -0
- package/dist/runtime/subscriptions.d.ts +11 -1
- package/dist/runtime/subscriptions.js +91 -125
- package/dist/runtime/subscriptions.js.map +1 -1
- package/dist/runtime/subwalk.js +2 -3
- package/dist/runtime/subwalk.js.map +1 -1
- package/dist/runtime/templateUsages.d.ts +4 -0
- package/dist/runtime/templateUsages.js +102 -0
- package/dist/runtime/templateUsages.js.map +1 -0
- package/dist/runtime/topo.d.ts +1 -0
- package/dist/runtime/topo.js +23 -0
- package/dist/runtime/topo.js.map +1 -1
- package/dist/runtime/trace.d.ts +44 -0
- package/dist/runtime/trace.js +240 -0
- package/dist/runtime/trace.js.map +1 -0
- package/dist/runtime/typeSwitches.d.ts +3 -0
- package/dist/runtime/typeSwitches.js +27 -0
- package/dist/runtime/typeSwitches.js.map +1 -0
- package/dist/runtime/validate.d.ts +11 -0
- package/dist/runtime/validate.js +118 -61
- package/dist/runtime/validate.js.map +1 -1
- package/dist/runtime/webhookRoutes.d.ts +4 -0
- package/dist/runtime/webhookRoutes.js +68 -0
- package/dist/runtime/webhookRoutes.js.map +1 -0
- package/dist/runtime/withTimeout.d.ts +1 -0
- package/dist/runtime/withTimeout.js +17 -0
- package/dist/runtime/withTimeout.js.map +1 -0
- package/dist/runtime/wording.d.ts +10 -0
- package/dist/runtime/wording.js +118 -0
- package/dist/runtime/wording.js.map +1 -0
- package/dist/stats/health-banner.d.ts +13 -0
- package/dist/stats/health-banner.js +149 -0
- package/dist/stats/health-banner.js.map +1 -0
- package/dist/stats/health.d.ts +49 -0
- package/dist/stats/health.js +130 -0
- package/dist/stats/health.js.map +1 -0
- package/dist/stats/kpi.d.ts +21 -0
- package/dist/stats/kpi.js +101 -0
- package/dist/stats/kpi.js.map +1 -0
- package/dist/stats/overview.d.ts +94 -0
- package/dist/stats/overview.js +244 -0
- package/dist/stats/overview.js.map +1 -0
- package/dist/types/constants.d.ts +0 -1
- package/dist/types/constants.js +1 -2
- package/dist/types/constants.js.map +1 -1
- package/dist/types/runLog.d.ts +2 -0
- package/dist/types/runLog.js +4 -0
- package/dist/types/runLog.js.map +1 -1
- package/frontend-vue/app/components/AttentionList.vue +276 -0
- package/frontend-vue/app/components/Catalog/SchemaTable.vue +127 -0
- package/frontend-vue/app/components/Catalog.vue +457 -0
- package/frontend-vue/app/components/Editor/BottomDock.vue +188 -0
- package/frontend-vue/app/components/Editor/BuilderPalette.vue +101 -45
- package/frontend-vue/app/components/Editor/GraphCanvas.vue +818 -206
- package/frontend-vue/app/components/Editor/GroupPortEditor.vue +29 -18
- package/frontend-vue/app/components/Editor/JsonField.vue +3 -3
- package/frontend-vue/app/components/Editor/NewProcedureDialog.vue +108 -0
- package/frontend-vue/app/components/Editor/NodeInspector.vue +373 -101
- package/frontend-vue/app/components/Editor/ProcedureSwitcher.vue +147 -0
- package/frontend-vue/app/components/Editor/RunNowDialog.vue +145 -0
- package/frontend-vue/app/components/Editor/WiredField.vue +3 -3
- package/frontend-vue/app/components/Editor/nodes/GenericNode.vue +97 -91
- package/frontend-vue/app/components/Editor/nodes/GroupNode.vue +5 -6
- package/frontend-vue/app/components/Editor/nodes/GroupSentinel.vue +3 -2
- package/frontend-vue/app/components/Editor/nodes/styles.ts +14 -18
- package/frontend-vue/app/components/Editor.vue +1894 -705
- package/frontend-vue/app/components/IconPicker.vue +122 -0
- package/frontend-vue/app/components/LiveTopics.vue +20 -0
- package/frontend-vue/app/components/Run/RunCompare.vue +115 -0
- package/frontend-vue/app/components/Run/RunFailure.vue +54 -0
- package/frontend-vue/app/components/Run/RunLogList.vue +167 -0
- package/frontend-vue/app/components/Run/RunPathTaken.vue +139 -0
- package/frontend-vue/app/components/Run/RunPayload.vue +85 -0
- package/frontend-vue/app/components/Run/RunWaterfall.vue +374 -0
- package/frontend-vue/app/components/RunPeek.vue +132 -0
- package/frontend-vue/app/components/RunTrace.vue +462 -0
- package/frontend-vue/app/components/Templates.vue +382 -537
- package/frontend-vue/app/components/WebhookEndpoint.vue +81 -0
- package/frontend-vue/app/composables/useAutomationNodeKinds.ts +23 -6
- package/frontend-vue/app/composables/useAutomationRuns.ts +160 -25
- package/frontend-vue/app/composables/useGraphConnect.ts +103 -51
- package/frontend-vue/app/composables/useRunActions.ts +60 -0
- package/frontend-vue/app/plugins/cell-displays.ts +169 -0
- package/frontend-vue/app/utils/automation.ts +4 -36
- package/frontend-vue/app/utils/describe.ts +252 -0
- package/frontend-vue/app/utils/redactedHeaders.ts +31 -0
- package/frontend-vue/dms.frontend.build.ts +7 -0
- package/frontend-vue/dms.frontend.ts +7 -4
- package/frontend-vue/i18n/locales/dms-automation-en-GB.json +1149 -309
- package/frontend-vue/i18n/locales/dms-automation-fr-FR.json +1154 -314
- package/frontend-vue/package.json +1 -1
- package/package.json +7 -5
- package/dist/db/models/type_config.model.d.ts +0 -47
- package/dist/db/models/type_config.model.js +0 -51
- package/dist/db/models/type_config.model.js.map +0 -1
- package/dist/db/tables/action_type_config.table.d.ts +0 -7
- package/dist/db/tables/action_type_config.table.js +0 -35
- package/dist/db/tables/action_type_config.table.js.map +0 -1
- package/dist/db/tables/trigger_type_config.table.d.ts +0 -7
- package/dist/db/tables/trigger_type_config.table.js.map +0 -1
- package/frontend-vue/app/components/Actions.vue +0 -151
- package/frontend-vue/app/components/Catalog/TypeConfigForm.vue +0 -170
- package/frontend-vue/app/components/Catalog/TypeList.vue +0 -203
- package/frontend-vue/app/components/DataNodes.vue +0 -275
- package/frontend-vue/app/components/Editor/ProcedureList.vue +0 -156
- package/frontend-vue/app/components/Editor/RunsDrawer.vue +0 -312
- package/frontend-vue/app/components/Library.vue +0 -69
- package/frontend-vue/app/components/Overview.vue +0 -503
- package/frontend-vue/app/components/RunDetailDrawer.vue +0 -165
- package/frontend-vue/app/components/RunFireTree.vue +0 -170
- package/frontend-vue/app/components/RunTraceDrawer.vue +0 -59
- package/frontend-vue/app/components/RunsStats.vue +0 -126
- package/frontend-vue/app/components/RunsTimelineDisplay.vue +0 -287
- package/frontend-vue/app/components/Triggers.vue +0 -147
- package/frontend-vue/app/plugins/runs-timeline-display.client.ts +0 -16
|
@@ -15,6 +15,8 @@ const SCHEMA_TYPE_CHOICES: SchemaTypeChoice[] = [
|
|
|
15
15
|
|
|
16
16
|
const props = defineProps<{
|
|
17
17
|
ports: GroupPort[]
|
|
18
|
+
/** Shows the ports without editing them (a template instance's ports). */
|
|
19
|
+
readOnly?: boolean
|
|
18
20
|
}>()
|
|
19
21
|
|
|
20
22
|
const emit = defineEmits<{
|
|
@@ -23,10 +25,11 @@ const emit = defineEmits<{
|
|
|
23
25
|
|
|
24
26
|
const activeTab = ref<'data' | 'trigger'>('data')
|
|
25
27
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
{ label: '
|
|
29
|
-
|
|
28
|
+
const { t } = useI18n()
|
|
29
|
+
const tabItems = computed(() => [
|
|
30
|
+
{ label: t('dms_automation.editor.groupPorts.dataTab'), value: 'data', slot: 'data', icon: 'i-ph-plugs' },
|
|
31
|
+
{ label: t('dms_automation.editor.groupPorts.triggerTab'), value: 'trigger', slot: 'trigger', icon: 'i-ph-lightning' },
|
|
32
|
+
])
|
|
30
33
|
|
|
31
34
|
interface Section {
|
|
32
35
|
kind: 'data' | 'trigger'
|
|
@@ -151,6 +154,9 @@ const sections = computed(() => ({
|
|
|
151
154
|
</div>
|
|
152
155
|
</template>
|
|
153
156
|
|
|
157
|
+
<p v-if="readOnly" class="mb-2 text-xs text-muted">
|
|
158
|
+
{{ $t('dms_automation.editor.groupPorts.fromTemplate') }}
|
|
159
|
+
</p>
|
|
154
160
|
<UTabs v-model="activeTab" :items="tabItems" size="sm" variant="link">
|
|
155
161
|
<template #data>
|
|
156
162
|
<div class="flex flex-col gap-4 pt-2">
|
|
@@ -160,7 +166,7 @@ const sections = computed(() => ({
|
|
|
160
166
|
class="flex flex-col gap-2"
|
|
161
167
|
>
|
|
162
168
|
<div class="text-default text-xs font-medium uppercase tracking-wide">
|
|
163
|
-
{{ section.direction === 'in' ? '
|
|
169
|
+
{{ $t(section.direction === 'in' ? 'dms_automation.editor.groupPorts.inputs' : 'dms_automation.editor.groupPorts.outputs') }}
|
|
164
170
|
</div>
|
|
165
171
|
|
|
166
172
|
<div
|
|
@@ -170,17 +176,21 @@ const sections = computed(() => ({
|
|
|
170
176
|
>
|
|
171
177
|
<UInput
|
|
172
178
|
class="flex-1"
|
|
173
|
-
placeholder="
|
|
179
|
+
:placeholder="$t('dms_automation.editor.groupPorts.portName')"
|
|
180
|
+
:aria-label="$t('dms_automation.editor.groupPorts.portName')"
|
|
181
|
+
:disabled="readOnly"
|
|
174
182
|
:model-value="entry.port.name"
|
|
175
183
|
@update:model-value="(v: string | number) => updateName(entry.index, String(v))"
|
|
176
184
|
/>
|
|
177
185
|
<USelect
|
|
178
186
|
class="w-28"
|
|
187
|
+
:disabled="readOnly"
|
|
179
188
|
:items="[...SCHEMA_TYPE_CHOICES]"
|
|
180
189
|
:model-value="schemaTypeOf(entry.port)"
|
|
181
190
|
@update:model-value="(v: string) => updateSchemaType(entry.index, v as SchemaTypeChoice)"
|
|
182
191
|
/>
|
|
183
192
|
<UButton
|
|
193
|
+
v-if="!readOnly"
|
|
184
194
|
size="xs"
|
|
185
195
|
variant="ghost"
|
|
186
196
|
color="error"
|
|
@@ -191,7 +201,7 @@ const sections = computed(() => ({
|
|
|
191
201
|
</div>
|
|
192
202
|
|
|
193
203
|
<div v-if="portsFor(section).length === 0" class="text-dimmed text-xs">
|
|
194
|
-
|
|
204
|
+
{{ $t(section.direction === 'in' ? 'dms_automation.editor.groupPorts.noInputs' : 'dms_automation.editor.groupPorts.noOutputs') }}
|
|
195
205
|
</div>
|
|
196
206
|
|
|
197
207
|
<UAlert
|
|
@@ -203,7 +213,7 @@ const sections = computed(() => ({
|
|
|
203
213
|
:description="$t('dms_automation.editor.groupPorts.duplicateHelp')"
|
|
204
214
|
/>
|
|
205
215
|
|
|
206
|
-
<div>
|
|
216
|
+
<div v-if="!readOnly">
|
|
207
217
|
<UButton
|
|
208
218
|
size="xs"
|
|
209
219
|
variant="soft"
|
|
@@ -212,7 +222,7 @@ const sections = computed(() => ({
|
|
|
212
222
|
:disabled="!!duplicateNameIn(section)"
|
|
213
223
|
@click="addPort(section)"
|
|
214
224
|
>
|
|
215
|
-
|
|
225
|
+
{{ $t(section.direction === 'in' ? 'dms_automation.editor.groupPorts.addInput' : 'dms_automation.editor.groupPorts.addOutput') }}
|
|
216
226
|
</UButton>
|
|
217
227
|
</div>
|
|
218
228
|
</div>
|
|
@@ -221,10 +231,8 @@ const sections = computed(() => ({
|
|
|
221
231
|
|
|
222
232
|
<template #trigger>
|
|
223
233
|
<div class="flex flex-col gap-4 pt-2">
|
|
224
|
-
<div class="text-dimmed text-xs">
|
|
225
|
-
|
|
226
|
-
handle on the group's title bar (like an ordinary action).
|
|
227
|
-
Any other name renders in the body, one row per port.
|
|
234
|
+
<div v-if="!readOnly" class="text-dimmed text-xs">
|
|
235
|
+
{{ $t('dms_automation.editor.groupPorts.mainHint') }}
|
|
228
236
|
</div>
|
|
229
237
|
<div
|
|
230
238
|
v-for="section in [sections.trigger.in, sections.trigger.out]"
|
|
@@ -232,7 +240,7 @@ const sections = computed(() => ({
|
|
|
232
240
|
class="flex flex-col gap-2"
|
|
233
241
|
>
|
|
234
242
|
<div class="text-default text-xs font-medium uppercase tracking-wide">
|
|
235
|
-
{{ section.direction === 'in' ? '
|
|
243
|
+
{{ $t(section.direction === 'in' ? 'dms_automation.editor.groupPorts.inputs' : 'dms_automation.editor.groupPorts.outputs') }}
|
|
236
244
|
</div>
|
|
237
245
|
|
|
238
246
|
<div
|
|
@@ -242,11 +250,14 @@ const sections = computed(() => ({
|
|
|
242
250
|
>
|
|
243
251
|
<UInput
|
|
244
252
|
class="flex-1"
|
|
245
|
-
placeholder="
|
|
253
|
+
:placeholder="$t('dms_automation.editor.groupPorts.portName')"
|
|
254
|
+
:aria-label="$t('dms_automation.editor.groupPorts.portName')"
|
|
255
|
+
:disabled="readOnly"
|
|
246
256
|
:model-value="entry.port.name"
|
|
247
257
|
@update:model-value="(v: string | number) => updateName(entry.index, String(v))"
|
|
248
258
|
/>
|
|
249
259
|
<UButton
|
|
260
|
+
v-if="!readOnly"
|
|
250
261
|
size="xs"
|
|
251
262
|
variant="ghost"
|
|
252
263
|
color="error"
|
|
@@ -257,7 +268,7 @@ const sections = computed(() => ({
|
|
|
257
268
|
</div>
|
|
258
269
|
|
|
259
270
|
<div v-if="portsFor(section).length === 0" class="text-dimmed text-xs">
|
|
260
|
-
|
|
271
|
+
{{ $t(section.direction === 'in' ? 'dms_automation.editor.groupPorts.noInputs' : 'dms_automation.editor.groupPorts.noOutputs') }}
|
|
261
272
|
</div>
|
|
262
273
|
|
|
263
274
|
<UAlert
|
|
@@ -269,7 +280,7 @@ const sections = computed(() => ({
|
|
|
269
280
|
:description="$t('dms_automation.editor.groupPorts.duplicateHelp')"
|
|
270
281
|
/>
|
|
271
282
|
|
|
272
|
-
<div>
|
|
283
|
+
<div v-if="!readOnly">
|
|
273
284
|
<UButton
|
|
274
285
|
size="xs"
|
|
275
286
|
variant="soft"
|
|
@@ -278,7 +289,7 @@ const sections = computed(() => ({
|
|
|
278
289
|
:disabled="!!duplicateNameIn(section)"
|
|
279
290
|
@click="addPort(section)"
|
|
280
291
|
>
|
|
281
|
-
|
|
292
|
+
{{ $t(section.direction === 'in' ? 'dms_automation.editor.groupPorts.addInput' : 'dms_automation.editor.groupPorts.addOutput') }}
|
|
282
293
|
</UButton>
|
|
283
294
|
</div>
|
|
284
295
|
</div>
|
|
@@ -53,11 +53,11 @@ function onBlur() {
|
|
|
53
53
|
</script>
|
|
54
54
|
|
|
55
55
|
<template>
|
|
56
|
-
<
|
|
56
|
+
<DmsTextarea
|
|
57
57
|
v-model="text"
|
|
58
58
|
:rows="4"
|
|
59
|
-
placeholder="
|
|
60
|
-
class="font-mono"
|
|
59
|
+
:placeholder="$t('dms_automation.editor.inspector.jsonPlaceholder')"
|
|
60
|
+
class="w-full font-mono"
|
|
61
61
|
@blur="onBlur"
|
|
62
62
|
/>
|
|
63
63
|
</template>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, watch } from 'vue'
|
|
3
|
+
|
|
4
|
+
// "New procedure" from the builder: name it, pick what starts it, and land on
|
|
5
|
+
// a draft with its trigger placed (AU-11).
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{ apiUrl: string }>()
|
|
8
|
+
const open = defineModel<boolean>('open', { default: false })
|
|
9
|
+
const emit = defineEmits<{ (e: 'created', id: string): void }>()
|
|
10
|
+
|
|
11
|
+
const { $authFetch } = useAuthFetch()
|
|
12
|
+
const { t } = useI18n()
|
|
13
|
+
|
|
14
|
+
const STARTERS = [
|
|
15
|
+
{ value: 'webhook', icon: 'i-ph-webhooks-logo', label: 'webhook' },
|
|
16
|
+
{ value: 'schedule.cron', icon: 'i-ph-clock', label: 'schedule' },
|
|
17
|
+
{ value: 'manual', icon: 'i-ph-play', label: 'manual' },
|
|
18
|
+
] as const
|
|
19
|
+
|
|
20
|
+
const NAME_ID = 'new-procedure-name'
|
|
21
|
+
const ROW = { layout: 'form', spacing: 'list', inset: false } as const
|
|
22
|
+
|
|
23
|
+
const name = ref('')
|
|
24
|
+
const trigger = ref<(typeof STARTERS)[number]['value']>('webhook')
|
|
25
|
+
const description = ref('')
|
|
26
|
+
const submitting = ref(false)
|
|
27
|
+
// A missing name shows under its field; a refused request too when the API
|
|
28
|
+
// names the field, a toast otherwise.
|
|
29
|
+
const fieldErrors = useFieldErrors({ fields: { name: NAME_ID } })
|
|
30
|
+
|
|
31
|
+
const starterItems = computed(() =>
|
|
32
|
+
STARTERS.map((starter) => ({
|
|
33
|
+
value: starter.value,
|
|
34
|
+
icon: starter.icon,
|
|
35
|
+
label: t(`dms_automation.newProcedure.starts.${starter.label}`),
|
|
36
|
+
description: t(`dms_automation.newProcedure.starts.${starter.label}Hint`),
|
|
37
|
+
})),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
watch(open, (isOpen) => {
|
|
41
|
+
if (!isOpen) return
|
|
42
|
+
name.value = ''
|
|
43
|
+
trigger.value = 'webhook'
|
|
44
|
+
description.value = ''
|
|
45
|
+
fieldErrors.clear()
|
|
46
|
+
})
|
|
47
|
+
watch(name, () => fieldErrors.clear('name'))
|
|
48
|
+
|
|
49
|
+
async function submit() {
|
|
50
|
+
if (!name.value.trim()) {
|
|
51
|
+
await fieldErrors.setError('name', t('dms_automation.newProcedure.nameRequired'))
|
|
52
|
+
return
|
|
53
|
+
}
|
|
54
|
+
submitting.value = true
|
|
55
|
+
try {
|
|
56
|
+
const res = await $authFetch<{ _id: string }>(`${props.apiUrl}/procedures/new`, {
|
|
57
|
+
method: 'POST',
|
|
58
|
+
body: { name: name.value.trim(), trigger: trigger.value, description: description.value },
|
|
59
|
+
})
|
|
60
|
+
open.value = false
|
|
61
|
+
emit('created', res._id)
|
|
62
|
+
} catch (e) {
|
|
63
|
+
await fieldErrors.handleApiError(e, { toastTitle: 'dms_automation.common.actionFailed' })
|
|
64
|
+
} finally {
|
|
65
|
+
submitting.value = false
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<UModal v-model:open="open" :title="$t('dms_automation.newProcedure.title')" :description="$t('dms_automation.newProcedure.subtitle')">
|
|
72
|
+
<template #body>
|
|
73
|
+
<form class="flex flex-col gap-4" @submit.prevent="submit">
|
|
74
|
+
<DmsFieldRow v-bind="ROW" :label="$t('dms_automation.newProcedure.name')" :label-for="NAME_ID" required>
|
|
75
|
+
<div class="grid gap-1.5">
|
|
76
|
+
<DmsInputText
|
|
77
|
+
:id="NAME_ID"
|
|
78
|
+
v-model="name"
|
|
79
|
+
autofocus
|
|
80
|
+
class="w-full"
|
|
81
|
+
:placeholder="$t('dms_automation.newProcedure.namePlaceholder')"
|
|
82
|
+
v-bind="fieldErrors.aria('name')"
|
|
83
|
+
/>
|
|
84
|
+
<DmsFieldError :id="fieldErrors.errorId('name')" :message="fieldErrors.errors.name" />
|
|
85
|
+
</div>
|
|
86
|
+
</DmsFieldRow>
|
|
87
|
+
<DmsFieldRow
|
|
88
|
+
v-bind="ROW"
|
|
89
|
+
:label="$t('dms_automation.newProcedure.startsWhen')"
|
|
90
|
+
:description="$t('dms_automation.newProcedure.startsWhenHint')"
|
|
91
|
+
required
|
|
92
|
+
>
|
|
93
|
+
<DmsChoiceCards v-model="trigger" :items="starterItems" />
|
|
94
|
+
</DmsFieldRow>
|
|
95
|
+
<DmsFieldRow v-bind="ROW" :label="$t('dms_automation.newProcedure.description')" label-for="new-procedure-description">
|
|
96
|
+
<DmsTextarea id="new-procedure-description" v-model="description" :rows="2" class="w-full" />
|
|
97
|
+
</DmsFieldRow>
|
|
98
|
+
<DmsFormRequiredLegend />
|
|
99
|
+
</form>
|
|
100
|
+
</template>
|
|
101
|
+
<template #footer>
|
|
102
|
+
<div class="flex w-full justify-end gap-2">
|
|
103
|
+
<UButton variant="outline" color="neutral" @click="open = false">{{ $t('dms_automation.common.cancel') }}</UButton>
|
|
104
|
+
<UButton color="primary" :loading="submitting" @click="submit">{{ $t('dms_automation.newProcedure.submit') }}</UButton>
|
|
105
|
+
</div>
|
|
106
|
+
</template>
|
|
107
|
+
</UModal>
|
|
108
|
+
</template>
|