@revenexx/studio-integrations 0.1.4 → 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.
Files changed (188) hide show
  1. package/README.md +31 -0
  2. package/dist/module.d.mts +2 -2
  3. package/dist/module.json +1 -1
  4. package/dist/runtime/components/Integrations/CredentialCreateDialog.d.vue.ts +13 -0
  5. package/dist/runtime/components/Integrations/CredentialCreateDialog.vue +279 -0
  6. package/dist/runtime/components/Integrations/CredentialCreateDialog.vue.d.ts +13 -0
  7. package/dist/runtime/components/Integrations/CredentialDetailDialog.d.vue.ts +20 -0
  8. package/dist/runtime/components/Integrations/CredentialDetailDialog.vue +342 -0
  9. package/dist/runtime/components/Integrations/CredentialDetailDialog.vue.d.ts +20 -0
  10. package/dist/runtime/components/Integrations/CredentialLogo.d.vue.ts +14 -0
  11. package/dist/runtime/components/Integrations/CredentialLogo.vue +37 -0
  12. package/dist/runtime/components/Integrations/CredentialLogo.vue.d.ts +14 -0
  13. package/dist/runtime/components/Integrations/CredentialRevenexxSource.d.vue.ts +12 -0
  14. package/dist/runtime/components/Integrations/CredentialRevenexxSource.vue +364 -0
  15. package/dist/runtime/components/Integrations/CredentialRevenexxSource.vue.d.ts +12 -0
  16. package/dist/runtime/components/Integrations/CredentialTypePicker.d.vue.ts +15 -0
  17. package/dist/runtime/components/Integrations/CredentialTypePicker.vue +71 -0
  18. package/dist/runtime/components/Integrations/CredentialTypePicker.vue.d.ts +15 -0
  19. package/dist/runtime/components/Integrations/DeadLettersPanel.d.vue.ts +5 -0
  20. package/dist/runtime/components/Integrations/DeadLettersPanel.vue +151 -0
  21. package/dist/runtime/components/Integrations/DeadLettersPanel.vue.d.ts +5 -0
  22. package/dist/runtime/components/Integrations/EditorTip.d.vue.ts +17 -0
  23. package/dist/runtime/components/Integrations/EditorTip.vue +46 -0
  24. package/dist/runtime/components/Integrations/EditorTip.vue.d.ts +17 -0
  25. package/dist/runtime/components/Integrations/EventTypeCombobox.d.vue.ts +9 -0
  26. package/dist/runtime/components/Integrations/EventTypeCombobox.vue +64 -0
  27. package/dist/runtime/components/Integrations/EventTypeCombobox.vue.d.ts +9 -0
  28. package/dist/runtime/components/Integrations/ExpressionInput.d.vue.ts +19 -0
  29. package/dist/runtime/components/Integrations/ExpressionInput.vue +236 -0
  30. package/dist/runtime/components/Integrations/ExpressionInput.vue.d.ts +19 -0
  31. package/dist/runtime/components/Integrations/GroupFrameView.d.vue.ts +28 -0
  32. package/dist/runtime/components/Integrations/GroupFrameView.vue +222 -0
  33. package/dist/runtime/components/Integrations/GroupFrameView.vue.d.ts +28 -0
  34. package/dist/runtime/components/Integrations/NodeConfigDynamicField.d.vue.ts +14 -0
  35. package/dist/runtime/components/Integrations/NodeConfigDynamicField.vue +184 -0
  36. package/dist/runtime/components/Integrations/NodeConfigDynamicField.vue.d.ts +14 -0
  37. package/dist/runtime/components/Integrations/NodeConfigDynamicSchema.d.vue.ts +16 -0
  38. package/dist/runtime/components/Integrations/NodeConfigDynamicSchema.vue +102 -0
  39. package/dist/runtime/components/Integrations/NodeConfigDynamicSchema.vue.d.ts +16 -0
  40. package/dist/runtime/components/Integrations/NodeConfigField.d.vue.ts +23 -0
  41. package/dist/runtime/components/Integrations/NodeConfigField.vue +587 -0
  42. package/dist/runtime/components/Integrations/NodeConfigField.vue.d.ts +23 -0
  43. package/dist/runtime/components/Integrations/NodeDynamicOutputsResolver.d.vue.ts +14 -0
  44. package/dist/runtime/components/Integrations/NodeDynamicOutputsResolver.vue +80 -0
  45. package/dist/runtime/components/Integrations/NodeDynamicOutputsResolver.vue.d.ts +14 -0
  46. package/dist/runtime/components/Integrations/NodeInspector.d.vue.ts +22 -3
  47. package/dist/runtime/components/Integrations/NodeInspector.vue +1074 -294
  48. package/dist/runtime/components/Integrations/NodeInspector.vue.d.ts +22 -3
  49. package/dist/runtime/components/Integrations/NodeLogo.d.vue.ts +9 -0
  50. package/dist/runtime/components/Integrations/NodeLogo.vue +38 -0
  51. package/dist/runtime/components/Integrations/NodeLogo.vue.d.ts +9 -0
  52. package/dist/runtime/components/Integrations/NodePalette.d.vue.ts +22 -1
  53. package/dist/runtime/components/Integrations/NodePalette.vue +411 -90
  54. package/dist/runtime/components/Integrations/NodePalette.vue.d.ts +22 -1
  55. package/dist/runtime/components/Integrations/QueryBuilder.d.vue.ts +9 -0
  56. package/dist/runtime/components/Integrations/QueryBuilder.vue +239 -0
  57. package/dist/runtime/components/Integrations/QueryBuilder.vue.d.ts +9 -0
  58. package/dist/runtime/components/Integrations/{RunDetailDialog.d.vue.ts → RunActionsMenu.d.vue.ts} +3 -4
  59. package/dist/runtime/components/Integrations/RunActionsMenu.vue +86 -0
  60. package/dist/runtime/components/Integrations/{RunDetailDialog.vue.d.ts → RunActionsMenu.vue.d.ts} +3 -4
  61. package/dist/runtime/components/Integrations/RunDetailPanel.d.vue.ts +14 -0
  62. package/dist/runtime/components/Integrations/RunDetailPanel.vue +777 -0
  63. package/dist/runtime/components/Integrations/RunDetailPanel.vue.d.ts +14 -0
  64. package/dist/runtime/components/Integrations/RunPayloadInput.d.vue.ts +13 -0
  65. package/dist/runtime/components/Integrations/RunPayloadInput.vue +175 -0
  66. package/dist/runtime/components/Integrations/RunPayloadInput.vue.d.ts +13 -0
  67. package/dist/runtime/components/Integrations/RunResponseModal.d.vue.ts +27 -0
  68. package/dist/runtime/components/Integrations/RunResponseModal.vue +84 -0
  69. package/dist/runtime/components/Integrations/RunResponseModal.vue.d.ts +27 -0
  70. package/dist/runtime/components/Integrations/RunsTable.d.vue.ts +21 -0
  71. package/dist/runtime/components/Integrations/RunsTable.vue +114 -0
  72. package/dist/runtime/components/Integrations/RunsTable.vue.d.ts +21 -0
  73. package/dist/runtime/components/Integrations/SftpAccountImportDialog.d.vue.ts +11 -0
  74. package/dist/runtime/components/Integrations/SftpAccountImportDialog.vue +91 -0
  75. package/dist/runtime/components/Integrations/SftpAccountImportDialog.vue.d.ts +11 -0
  76. package/dist/runtime/components/Integrations/StickyNoteView.d.vue.ts +28 -0
  77. package/dist/runtime/components/Integrations/StickyNoteView.vue +208 -0
  78. package/dist/runtime/components/Integrations/StickyNoteView.vue.d.ts +28 -0
  79. package/dist/runtime/components/Integrations/TemplateFlowPreview.d.vue.ts +29 -0
  80. package/dist/runtime/components/Integrations/TemplateFlowPreview.vue +201 -0
  81. package/dist/runtime/components/Integrations/TemplateFlowPreview.vue.d.ts +29 -0
  82. package/dist/runtime/components/Integrations/WorkflowContextMenu.d.vue.ts +32 -0
  83. package/dist/runtime/components/Integrations/WorkflowContextMenu.vue +138 -0
  84. package/dist/runtime/components/Integrations/WorkflowContextMenu.vue.d.ts +32 -0
  85. package/dist/runtime/components/Integrations/WorkflowCreateDialog.d.vue.ts +9 -0
  86. package/dist/runtime/components/Integrations/WorkflowCreateDialog.vue +322 -0
  87. package/dist/runtime/components/Integrations/WorkflowCreateDialog.vue.d.ts +9 -0
  88. package/dist/runtime/components/Integrations/WorkflowDuplicateDialog.d.vue.ts +18 -0
  89. package/dist/runtime/components/Integrations/WorkflowDuplicateDialog.vue +63 -0
  90. package/dist/runtime/components/Integrations/WorkflowDuplicateDialog.vue.d.ts +18 -0
  91. package/dist/runtime/components/Integrations/WorkflowEdgeView.d.vue.ts +12 -1
  92. package/dist/runtime/components/Integrations/WorkflowEdgeView.vue +68 -6
  93. package/dist/runtime/components/Integrations/WorkflowEdgeView.vue.d.ts +12 -1
  94. package/dist/runtime/components/Integrations/WorkflowEditor.d.vue.ts +8 -1
  95. package/dist/runtime/components/Integrations/WorkflowEditor.vue +1424 -144
  96. package/dist/runtime/components/Integrations/WorkflowEditor.vue.d.ts +8 -1
  97. package/dist/runtime/components/Integrations/WorkflowHistoryPanel.d.vue.ts +12 -0
  98. package/dist/runtime/components/Integrations/WorkflowHistoryPanel.vue +417 -0
  99. package/dist/runtime/components/Integrations/WorkflowHistoryPanel.vue.d.ts +12 -0
  100. package/dist/runtime/components/Integrations/WorkflowIconPicker.d.vue.ts +10 -0
  101. package/dist/runtime/components/Integrations/WorkflowIconPicker.vue +89 -0
  102. package/dist/runtime/components/Integrations/WorkflowIconPicker.vue.d.ts +10 -0
  103. package/dist/runtime/components/Integrations/WorkflowIconView.d.vue.ts +10 -0
  104. package/dist/runtime/components/Integrations/WorkflowIconView.vue +35 -0
  105. package/dist/runtime/components/Integrations/WorkflowIconView.vue.d.ts +10 -0
  106. package/dist/runtime/components/Integrations/WorkflowNodeView.d.vue.ts +5 -1
  107. package/dist/runtime/components/Integrations/WorkflowNodeView.vue +114 -84
  108. package/dist/runtime/components/Integrations/WorkflowNodeView.vue.d.ts +5 -1
  109. package/dist/runtime/components/Integrations/WorkflowRunReplayPanel.d.vue.ts +12 -0
  110. package/dist/runtime/components/Integrations/WorkflowRunReplayPanel.vue +654 -0
  111. package/dist/runtime/components/Integrations/WorkflowRunReplayPanel.vue.d.ts +12 -0
  112. package/dist/runtime/components/Integrations/WorkflowSettingsDialog.d.vue.ts +36 -0
  113. package/dist/runtime/components/Integrations/WorkflowSettingsDialog.vue +136 -0
  114. package/dist/runtime/components/Integrations/WorkflowSettingsDialog.vue.d.ts +36 -0
  115. package/dist/runtime/components/Integrations/WorkflowTagsInput.d.vue.ts +14 -0
  116. package/dist/runtime/components/Integrations/WorkflowTagsInput.vue +63 -0
  117. package/dist/runtime/components/Integrations/WorkflowTagsInput.vue.d.ts +14 -0
  118. package/dist/runtime/components/Integrations/WorkflowTriggerView.vue +35 -15
  119. package/dist/runtime/components/Integrations/WorkflowVariablesDialog.d.vue.ts +13 -0
  120. package/dist/runtime/components/Integrations/WorkflowVariablesDialog.vue +265 -0
  121. package/dist/runtime/components/Integrations/WorkflowVariablesDialog.vue.d.ts +13 -0
  122. package/dist/runtime/components/Integrations/WorkflowsTable.d.vue.ts +4 -1
  123. package/dist/runtime/components/Integrations/WorkflowsTable.vue +122 -39
  124. package/dist/runtime/components/Integrations/WorkflowsTable.vue.d.ts +4 -1
  125. package/dist/runtime/components/Integrations/workflowLayout.d.ts +5 -0
  126. package/dist/runtime/components/Integrations/workflowLayout.js +5 -3
  127. package/dist/runtime/composables/integrationsApi.d.ts +6 -7
  128. package/dist/runtime/composables/integrationsApi.js +6 -12
  129. package/dist/runtime/composables/useCanvasShortcuts.d.ts +37 -0
  130. package/dist/runtime/composables/useCanvasShortcuts.js +62 -0
  131. package/dist/runtime/composables/useCredentialTypes.js +2 -1
  132. package/dist/runtime/composables/useIntegrationsAudit.js +2 -1
  133. package/dist/runtime/composables/useIntegrationsCredentials.js +2 -1
  134. package/dist/runtime/composables/useIntegrationsDeadLetters.d.ts +22 -0
  135. package/dist/runtime/composables/useIntegrationsDeadLetters.js +50 -0
  136. package/dist/runtime/composables/useIntegrationsNodes.d.ts +4 -0
  137. package/dist/runtime/composables/useIntegrationsNodes.js +8 -4
  138. package/dist/runtime/composables/useIntegrationsRevisions.d.ts +40 -0
  139. package/dist/runtime/composables/useIntegrationsRevisions.js +52 -0
  140. package/dist/runtime/composables/useIntegrationsRuns.d.ts +21 -1
  141. package/dist/runtime/composables/useIntegrationsRuns.js +94 -5
  142. package/dist/runtime/composables/useIntegrationsSecrets.js +2 -1
  143. package/dist/runtime/composables/useIntegrationsTemplates.d.ts +1 -0
  144. package/dist/runtime/composables/useIntegrationsTemplates.js +34 -5
  145. package/dist/runtime/composables/useIntegrationsTriggers.js +2 -1
  146. package/dist/runtime/composables/useIntegrationsWorkflows.d.ts +1 -0
  147. package/dist/runtime/composables/useIntegrationsWorkflows.js +59 -2
  148. package/dist/runtime/composables/useMiniMapLayout.d.ts +34 -0
  149. package/dist/runtime/composables/useMiniMapLayout.js +119 -0
  150. package/dist/runtime/composables/useNodeConfigResolve.d.ts +43 -0
  151. package/dist/runtime/composables/useNodeConfigResolve.js +124 -0
  152. package/dist/runtime/composables/useNodeDrag.d.ts +22 -0
  153. package/dist/runtime/composables/useNodeDrag.js +10 -0
  154. package/dist/runtime/composables/usePaletteLayout.d.ts +41 -0
  155. package/dist/runtime/composables/usePaletteLayout.js +113 -0
  156. package/dist/runtime/data/expressionEditor.d.ts +22 -0
  157. package/dist/runtime/data/expressionEditor.js +40 -0
  158. package/dist/runtime/data/integrationNodeCatalog.js +8 -8
  159. package/dist/runtime/data/nodeInputData.d.ts +37 -0
  160. package/dist/runtime/data/nodeInputData.js +62 -0
  161. package/dist/runtime/data/nodeRunData.d.ts +56 -0
  162. package/dist/runtime/data/nodeRunData.js +91 -0
  163. package/dist/runtime/data/payloadForm.d.ts +44 -0
  164. package/dist/runtime/data/payloadForm.js +126 -0
  165. package/dist/runtime/data/workflowIconCatalog.d.ts +34 -0
  166. package/dist/runtime/data/workflowIconCatalog.js +116 -0
  167. package/dist/runtime/pages/integrations/audit.vue +25 -35
  168. package/dist/runtime/pages/integrations/credentials.vue +117 -122
  169. package/dist/runtime/pages/integrations/index.vue +133 -36
  170. package/dist/runtime/pages/integrations/runs.vue +125 -75
  171. package/dist/runtime/pages/integrations/schedules.vue +5 -16
  172. package/dist/runtime/pages/integrations/secrets.vue +1 -3
  173. package/dist/runtime/pages/integrations/workflows/[id].vue +599 -194
  174. package/dist/runtime/pages/integrations/workflows/index.vue +10 -8
  175. package/dist/runtime/types/integrations.d.ts +190 -4
  176. package/dist/runtime/utils/apiError.d.ts +17 -0
  177. package/dist/runtime/utils/apiError.js +8 -0
  178. package/dist/runtime/utils/credentialState.d.ts +28 -0
  179. package/dist/runtime/utils/credentialState.js +29 -0
  180. package/dist/runtime/utils/localize.d.ts +3 -1
  181. package/dist/runtime/utils/localize.js +1 -2
  182. package/dist/runtime/utils/statusStyle.d.ts +6 -0
  183. package/dist/runtime/utils/statusStyle.js +15 -0
  184. package/package.json +20 -3
  185. package/dist/runtime/components/Integrations/RunDetailDialog.vue +0 -169
  186. package/dist/runtime/pages/integrations/workflows/new.d.vue.ts +0 -2
  187. package/dist/runtime/pages/integrations/workflows/new.vue +0 -153
  188. package/dist/runtime/pages/integrations/workflows/new.vue.d.ts +0 -2
@@ -1,169 +0,0 @@
1
- <script setup>
2
- import { computed, ref, watch } from "vue";
3
- import { RefreshCircle as Loader2, ArrowRightUp as OpenIcon } from "#solar-icons";
4
- import {
5
- Badge,
6
- Button,
7
- Dialog,
8
- DialogContent,
9
- DialogDescription,
10
- DialogHeader,
11
- DialogTitle
12
- } from "@revenexx/studio";
13
- import { statusClass } from "../../utils/statusStyle";
14
- const props = defineProps({
15
- open: { type: Boolean, required: true },
16
- run: { type: [Object, null], required: true }
17
- });
18
- const emit = defineEmits(["update:open"]);
19
- const router = useRouter();
20
- const { getRun, getHistory, getStackTrace } = useIntegrationsRuns();
21
- const loading = ref(false);
22
- const result = ref(null);
23
- const history = ref([]);
24
- const historySource = ref(null);
25
- const stackTrace = ref(null);
26
- const loadError = ref(null);
27
- function fmt(iso) {
28
- if (!iso) return "\u2014";
29
- try {
30
- return new Date(iso).toLocaleString();
31
- } catch {
32
- return iso;
33
- }
34
- }
35
- function fmtDuration(ms) {
36
- if (ms == null) return "\u2014";
37
- if (ms < 1e3) return `${ms}ms`;
38
- if (ms < 6e4) return `${(ms / 1e3).toFixed(2)}s`;
39
- return `${(ms / 6e4).toFixed(1)}m`;
40
- }
41
- const hasResult = computed(() => result.value != null && Object.keys(result.value).length > 0);
42
- async function load() {
43
- const run = props.run;
44
- if (!run) return;
45
- loading.value = true;
46
- loadError.value = null;
47
- result.value = null;
48
- history.value = [];
49
- stackTrace.value = null;
50
- try {
51
- const [runRes, histRes] = await Promise.allSettled([
52
- getRun(run.workflowId, run.id),
53
- getHistory(run.workflowId, run.id, { page_size: 50 })
54
- ]);
55
- if (runRes.status === "fulfilled") {
56
- result.value = runRes.value?.result ?? null;
57
- }
58
- if (histRes.status === "fulfilled") {
59
- history.value = histRes.value?.data ?? [];
60
- historySource.value = histRes.value?.source ?? null;
61
- }
62
- if (run.status === "running" || run.status === "failed") {
63
- try {
64
- stackTrace.value = await getStackTrace(run.workflowId, run.id);
65
- } catch {
66
- stackTrace.value = null;
67
- }
68
- }
69
- } catch (e) {
70
- loadError.value = e?.message ?? "Could not load run details.";
71
- } finally {
72
- loading.value = false;
73
- }
74
- }
75
- watch(() => [props.open, props.run?.id], () => {
76
- if (props.open && props.run) void load();
77
- }, { immediate: true });
78
- function openWorkflow() {
79
- if (props.run) router.push(`/integrations/workflows/${props.run.workflowId}`);
80
- }
81
- function eventLabel(ev) {
82
- return String(ev.event_type ?? ev.eventType ?? ev.type ?? "event");
83
- }
84
- </script>
85
-
86
- <template>
87
- <Dialog :open="open" @update:open="(v) => emit('update:open', v)">
88
- <DialogContent class="sm:max-w-2xl">
89
- <DialogHeader>
90
- <DialogTitle class="flex items-center gap-2">
91
- <span class="truncate">{{ run?.workflowName ?? "Run" }}</span>
92
- <Badge v-if="run" variant="outline" :class="['text-sm border', statusClass(run.status)]">
93
- {{ run.status }}
94
- </Badge>
95
- </DialogTitle>
96
- <DialogDescription class="font-mono text-sm">
97
- Run {{ run?.id }}
98
- </DialogDescription>
99
- </DialogHeader>
100
-
101
- <div v-if="run" class="space-y-4 max-h-[32rem] overflow-y-auto pr-1">
102
- <!-- Facts -->
103
- <div class="grid grid-cols-2 gap-x-6 gap-y-1 text-sm">
104
- <div class="flex justify-between"><span class="text-muted-foreground">Trigger</span><span>{{ run.triggerType }}</span></div>
105
- <div class="flex justify-between"><span class="text-muted-foreground">Duration</span><span class="tabular-nums">{{ fmtDuration(run.durationMs) }}</span></div>
106
- <div class="flex justify-between"><span class="text-muted-foreground">Started</span><span class="tabular-nums">{{ fmt(run.startedAt) }}</span></div>
107
- <div class="flex justify-between"><span class="text-muted-foreground">Finished</span><span class="tabular-nums">{{ fmt(run.finishedAt) }}</span></div>
108
- </div>
109
-
110
- <div v-if="run.errorMessage" class="rounded-md border border-rose-500/20 bg-rose-500/5 px-3 py-2 text-sm text-rose-700">
111
- {{ run.errorMessage }}
112
- </div>
113
-
114
- <div v-if="loading" class="flex items-center gap-2 text-sm text-muted-foreground">
115
- <Loader2 :size="14" class="animate-spin" /> Loading details…
116
- </div>
117
- <div v-else-if="loadError" class="text-sm text-rose-700">
118
- {{ loadError }}
119
- </div>
120
-
121
- <template v-else>
122
- <!-- Result -->
123
- <section v-if="hasResult" class="space-y-1">
124
- <h4 class="text-mono text-muted-foreground">
125
- Result
126
- </h4>
127
- <pre class="rounded-md bg-muted/40 p-3 text-sm overflow-x-auto max-h-56">{{ JSON.stringify(result, null, 2) }}</pre>
128
- </section>
129
-
130
- <!-- History -->
131
- <section v-if="history.length" class="space-y-1">
132
- <h4 class="text-mono text-muted-foreground">
133
- History <span v-if="historySource">· {{ historySource }}</span>
134
- </h4>
135
- <ol class="space-y-1">
136
- <li
137
- v-for="(ev, i) in history"
138
- :key="i"
139
- class="flex items-center gap-2 rounded-md border border-black/[0.05] bg-white px-2 py-1 text-sm"
140
- >
141
- <span class="tabular-nums text-muted-foreground w-8 shrink-0">{{ ev.event_id ?? i + 1 }}</span>
142
- <span class="font-mono truncate">{{ eventLabel(ev) }}</span>
143
- </li>
144
- </ol>
145
- </section>
146
-
147
- <!-- Stack trace -->
148
- <section v-if="stackTrace" class="space-y-1">
149
- <h4 class="text-mono text-muted-foreground">
150
- Stack trace
151
- </h4>
152
- <pre class="rounded-md bg-slate-900 text-slate-100 p-3 text-sm overflow-x-auto max-h-56">{{ stackTrace }}</pre>
153
- </section>
154
-
155
- <p v-if="!hasResult && !history.length && !stackTrace" class="text-sm text-muted-foreground">
156
- No execution detail available for this run yet.
157
- </p>
158
- </template>
159
- </div>
160
-
161
- <div class="flex justify-end pt-2">
162
- <Button variant="outline" size="sm" @click="openWorkflow">
163
- <OpenIcon :size="14" class="mr-1" />
164
- Open workflow
165
- </Button>
166
- </div>
167
- </DialogContent>
168
- </Dialog>
169
- </template>
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- export default _default;
@@ -1,153 +0,0 @@
1
- <script setup>
2
- import { ref } from "vue";
3
- import { ArrowLeft, ClockCircle as Clock, RefreshCircle as Loader2, Play, LinkRound as Webhook } from "#solar-icons";
4
- import { Button, Input, Label, Textarea } from "@revenexx/studio";
5
- useHead({ title: "New workflow \xB7 Revenexx Cockpit" });
6
- const router = useRouter();
7
- const { create } = useIntegrationsWorkflows();
8
- const name = ref("");
9
- const description = ref("");
10
- const triggerType = ref("manual");
11
- const executionMode = ref("async_only");
12
- const submitting = ref(false);
13
- const error = ref(null);
14
- const executionModes = [
15
- { key: "async_only", label: "Async only", hint: "Always queued." },
16
- { key: "sync_only", label: "Sync only", hint: "Waits for the result." },
17
- { key: "caller_decides", label: "Caller decides", hint: "The request chooses." }
18
- ];
19
- const triggerOptions = [
20
- { key: "manual", label: "Manual", hint: "Run on demand from the editor or API.", icon: Play, tile: "bg-slate-100 text-slate-500" },
21
- { key: "schedule", label: "Schedule", hint: "Cron-based recurring execution.", icon: Clock, tile: "bg-slate-100 text-slate-500" },
22
- { key: "webhook", label: "Webhook", hint: "Trigger from an inbound HTTP call.", icon: Webhook, tile: "bg-slate-100 text-slate-500" }
23
- ];
24
- async function submit() {
25
- if (!name.value.trim()) {
26
- error.value = "Name is required.";
27
- return;
28
- }
29
- submitting.value = true;
30
- error.value = null;
31
- try {
32
- const handle = globalThis.crypto?.randomUUID?.() ?? `trg-${Date.now()}`;
33
- const config = triggerType.value === "schedule" ? { cron: "0 * * * *", timezone: "Europe/Berlin" } : triggerType.value === "webhook" ? { path: "/incoming", method: "POST" } : {};
34
- const blob = {
35
- nodeManifestVersion: "v0-draft",
36
- name: name.value.trim(),
37
- description: description.value.trim() || void 0,
38
- triggers: [{ id: handle, type: triggerType.value, active: true, config }],
39
- nodes: [],
40
- edges: []
41
- };
42
- const created = await create({
43
- name: name.value.trim(),
44
- description: description.value.trim() || null,
45
- blob,
46
- active: false,
47
- executionMode: executionMode.value
48
- });
49
- await router.push(`/integrations/workflows/${created.id}`);
50
- } catch (e) {
51
- error.value = e.message || "Could not create the workflow.";
52
- } finally {
53
- submitting.value = false;
54
- }
55
- }
56
- </script>
57
-
58
- <template>
59
- <IntegrationsLayout>
60
- <PageHeader
61
- title="New workflow"
62
- description="Give your workflow a name, pick a trigger, and you'll land in the editor."
63
- >
64
- <template #actions>
65
- <NuxtLink to="/integrations/workflows">
66
- <Button variant="outline" class="h-7 text-sm">
67
- <ArrowLeft :size="14" />
68
- Back
69
- </Button>
70
- </NuxtLink>
71
- </template>
72
- </PageHeader>
73
-
74
- <form class=" p-6 space-y-6" @submit.prevent="submit">
75
- <div class="space-y-1.5">
76
- <Label for="wf-name">Name</Label>
77
- <Input id="wf-name" v-model="name" placeholder="Sync orders nightly" class="bg-white" />
78
- </div>
79
-
80
- <div class="space-y-1.5">
81
- <Label for="wf-desc">Description</Label>
82
- <Textarea
83
- id="wf-desc"
84
- v-model="description"
85
- rows="3"
86
- placeholder="Optional — what this workflow does and why it exists."
87
- class="bg-white"
88
- />
89
- </div>
90
-
91
- <div class="space-y-2">
92
- <Label>Trigger</Label>
93
- <div class="grid gap-2 sm:grid-cols-3">
94
- <button
95
- v-for="opt in triggerOptions"
96
- :key="opt.key"
97
- type="button"
98
- class="rounded-lg border border-black/[0.06] bg-white p-3 text-left transition hover:border-black/20 hover:shadow-sm"
99
- :class="triggerType === opt.key ? 'ring-2 ring-emerald-500/40 border-emerald-500/30' : ''"
100
- @click="triggerType = opt.key"
101
- >
102
- <span class="flex size-7 items-center justify-center rounded-md mb-2" :class="opt.tile">
103
- <component :is="opt.icon" :size="14" :stroke-width="2.25" />
104
- </span>
105
- <div class="text-sm font-medium">
106
- {{ opt.label }}
107
- </div>
108
- <p class="mt-0.5 text-sm text-muted-foreground">
109
- {{ opt.hint }}
110
- </p>
111
- </button>
112
- </div>
113
- </div>
114
-
115
- <div class="space-y-2">
116
- <Label>Execution mode</Label>
117
- <div class="grid gap-2 sm:grid-cols-3">
118
- <button
119
- v-for="opt in executionModes"
120
- :key="opt.key"
121
- type="button"
122
- class="rounded-lg border border-black/[0.06] bg-white p-3 text-left transition hover:border-black/20 hover:shadow-sm"
123
- :class="executionMode === opt.key ? 'ring-2 ring-emerald-500/40 border-emerald-500/30' : ''"
124
- @click="executionMode = opt.key"
125
- >
126
- <div class="text-sm font-medium">
127
- {{ opt.label }}
128
- </div>
129
- <p class="mt-0.5 text-sm text-muted-foreground">
130
- {{ opt.hint }}
131
- </p>
132
- </button>
133
- </div>
134
- </div>
135
-
136
- <div v-if="error" class="rounded-md border border-rose-500/20 bg-rose-500/5 px-3 py-2 text-sm text-rose-700">
137
- {{ error }}
138
- </div>
139
-
140
- <div class="flex gap-2 pt-2">
141
- <Button type="submit" :disabled="submitting" class="h-8 text-sm">
142
- <Loader2 v-if="submitting" :size="14" class="animate-spin" />
143
- {{ submitting ? "Creating\u2026" : "Create and open editor" }}
144
- </Button>
145
- <NuxtLink to="/integrations/workflows">
146
- <Button type="button" variant="outline" class="h-8 text-sm">
147
- Cancel
148
- </Button>
149
- </NuxtLink>
150
- </div>
151
- </form>
152
- </IntegrationsLayout>
153
- </template>
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- export default _default;