@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
@@ -0,0 +1,239 @@
1
+ <script setup>
2
+ import { computed, ref, watch } from "vue";
3
+ import { AddCircle as Plus, TrashBinMinimalistic as Trash2 } from "#solar-icons";
4
+ import {
5
+ Button,
6
+ Input,
7
+ Select,
8
+ SelectContent,
9
+ SelectItem,
10
+ SelectTrigger,
11
+ SelectValue,
12
+ Textarea
13
+ } from "@revenexx/studio";
14
+ const props = defineProps({
15
+ modelValue: { type: null, required: true }
16
+ });
17
+ const emit = defineEmits(["update:modelValue"]);
18
+ const METHODS = [
19
+ { value: "equal", label: "equals", attribute: true, values: "list" },
20
+ { value: "notEqual", label: "does not equal", attribute: true, values: "list" },
21
+ { value: "contains", label: "contains", attribute: true, values: "list" },
22
+ { value: "search", label: "search", attribute: true, values: "single" },
23
+ { value: "startsWith", label: "starts with", attribute: true, values: "single" },
24
+ { value: "endsWith", label: "ends with", attribute: true, values: "single" },
25
+ { value: "lessThan", label: "less than", attribute: true, values: "single" },
26
+ { value: "lessThanEqual", label: "less than or equal", attribute: true, values: "single" },
27
+ { value: "greaterThan", label: "greater than", attribute: true, values: "single" },
28
+ { value: "greaterThanEqual", label: "greater than or equal", attribute: true, values: "single" },
29
+ { value: "between", label: "between", attribute: true, values: "list" },
30
+ { value: "isNull", label: "is empty", attribute: true, values: "none" },
31
+ { value: "isNotNull", label: "is not empty", attribute: true, values: "none" },
32
+ { value: "orderAsc", label: "order ascending", attribute: true, values: "none" },
33
+ { value: "orderDesc", label: "order descending", attribute: true, values: "none" },
34
+ { value: "limit", label: "limit", attribute: false, values: "single" },
35
+ { value: "offset", label: "offset", attribute: false, values: "single" }
36
+ ];
37
+ function methodMeta(method) {
38
+ return METHODS.find((m) => m.value === method) ?? null;
39
+ }
40
+ function formatValue(v) {
41
+ return typeof v === "string" ? v : JSON.stringify(v);
42
+ }
43
+ function parseRow(str) {
44
+ try {
45
+ const parsed = JSON.parse(str);
46
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed) && typeof parsed.method === "string" && methodMeta(parsed.method)) {
47
+ const p = parsed;
48
+ return {
49
+ kind: "query",
50
+ method: p.method,
51
+ attribute: typeof p.attribute === "string" ? p.attribute : "",
52
+ values: Array.isArray(p.values) ? p.values.map(formatValue).join(", ") : ""
53
+ };
54
+ }
55
+ } catch {
56
+ }
57
+ return { kind: "raw", text: str };
58
+ }
59
+ function coerceValue(part) {
60
+ const t = part.trim();
61
+ if (/^-?\d+(\.\d+)?$/.test(t)) return Number(t);
62
+ if (t === "true") return true;
63
+ if (t === "false") return false;
64
+ return t;
65
+ }
66
+ function rowToString(row) {
67
+ if (row.kind === "raw") {
68
+ const t = row.text.trim();
69
+ return t === "" ? null : t;
70
+ }
71
+ const meta = methodMeta(row.method);
72
+ if (!meta) return null;
73
+ const out = { method: row.method };
74
+ if (meta.attribute && row.attribute.trim() !== "") out.attribute = row.attribute.trim();
75
+ if (meta.values !== "none") {
76
+ const values = row.values.split(",").map(coerceValue).filter((v) => v !== "");
77
+ if (values.length) out.values = meta.values === "single" ? [values[0]] : values;
78
+ }
79
+ return JSON.stringify(out);
80
+ }
81
+ function rowsToStrings(rows2) {
82
+ return rows2.map(rowToString).filter((s) => s !== null);
83
+ }
84
+ const rows = ref([]);
85
+ watch(
86
+ () => props.modelValue,
87
+ (v) => {
88
+ const external = Array.isArray(v) ? v.map(String) : [];
89
+ if (JSON.stringify(rowsToStrings(rows.value)) !== JSON.stringify(external)) {
90
+ rows.value = external.map(parseRow);
91
+ }
92
+ },
93
+ { immediate: true }
94
+ );
95
+ function commit() {
96
+ const strings = rowsToStrings(rows.value);
97
+ emit("update:modelValue", strings.length || rows.value.length ? strings : void 0);
98
+ }
99
+ function setRow(idx, patch) {
100
+ rows.value = rows.value.map((r, i) => {
101
+ if (i !== idx) return r;
102
+ const next = { ...r, ...patch };
103
+ if (next.kind === "query" && methodMeta(next.method)?.values === "none") next.values = "";
104
+ return next;
105
+ });
106
+ commit();
107
+ }
108
+ function addRow() {
109
+ rows.value = [...rows.value, { kind: "query", method: "equal", attribute: "", values: "" }];
110
+ }
111
+ function removeRow(idx) {
112
+ rows.value = rows.value.filter((_, i) => i !== idx);
113
+ commit();
114
+ }
115
+ const mode = ref("builder");
116
+ const jsonDraft = ref("");
117
+ const jsonError = ref(null);
118
+ watch(mode, (m) => {
119
+ if (m === "json") {
120
+ jsonDraft.value = JSON.stringify(rowsToStrings(rows.value), null, 2);
121
+ jsonError.value = null;
122
+ }
123
+ });
124
+ function writeJson(text) {
125
+ jsonDraft.value = text;
126
+ if (text.trim() === "") {
127
+ jsonError.value = null;
128
+ emit("update:modelValue", void 0);
129
+ return;
130
+ }
131
+ try {
132
+ const parsed = JSON.parse(text);
133
+ if (!Array.isArray(parsed)) {
134
+ jsonError.value = "Must be a JSON array of query strings.";
135
+ return;
136
+ }
137
+ jsonError.value = null;
138
+ emit("update:modelValue", parsed.map(String));
139
+ } catch {
140
+ jsonError.value = "Not valid JSON yet \u2014 the value is kept once it parses.";
141
+ }
142
+ }
143
+ const rowMeta = computed(() => rows.value.map((r) => r.kind === "query" ? methodMeta(r.method) : null));
144
+ </script>
145
+
146
+ <template>
147
+ <div class="space-y-1.5">
148
+ <div class="flex items-center justify-end">
149
+ <div class="flex items-center rounded border border-black/[0.08] bg-white p-px">
150
+ <button
151
+ type="button"
152
+ class="rounded px-1 py-px text-[10px] font-medium transition"
153
+ :class="mode === 'builder' ? 'bg-slate-100 text-foreground' : 'text-muted-foreground hover:text-foreground'"
154
+ @click="mode = 'builder'"
155
+ >
156
+ Builder
157
+ </button>
158
+ <button
159
+ type="button"
160
+ class="rounded px-1 py-px text-[10px] font-medium transition"
161
+ :class="mode === 'json' ? 'bg-slate-100 text-foreground' : 'text-muted-foreground hover:text-foreground'"
162
+ @click="mode = 'json'"
163
+ >
164
+ JSON
165
+ </button>
166
+ </div>
167
+ </div>
168
+
169
+ <template v-if="mode === 'builder'">
170
+ <div v-for="(row, idx) in rows" :key="idx" class="flex items-center gap-1.5">
171
+ <template v-if="row.kind === 'query'">
172
+ <Select
173
+ :model-value="row.method"
174
+ @update:model-value="(v) => setRow(idx, { method: String(v) })"
175
+ >
176
+ <SelectTrigger class="h-7 w-40 shrink-0 bg-white text-sm">
177
+ <SelectValue />
178
+ </SelectTrigger>
179
+ <SelectContent>
180
+ <SelectItem v-for="m in METHODS" :key="m.value" :value="m.value">
181
+ {{ m.label }}
182
+ </SelectItem>
183
+ </SelectContent>
184
+ </Select>
185
+ <Input
186
+ v-if="rowMeta[idx]?.attribute"
187
+ :model-value="row.attribute"
188
+ placeholder="field"
189
+ class="h-7 w-36 shrink-0 bg-white font-mono text-sm"
190
+ @update:model-value="(v) => setRow(idx, { attribute: String(v) })"
191
+ />
192
+ <Input
193
+ v-if="rowMeta[idx]?.values !== 'none'"
194
+ :model-value="row.values"
195
+ :placeholder="rowMeta[idx]?.values === 'list' ? 'value, value, \u2026' : 'value'"
196
+ class="h-7 min-w-0 flex-1 bg-white text-sm"
197
+ @update:model-value="(v) => setRow(idx, { values: String(v) })"
198
+ />
199
+ <div v-else class="min-w-0 flex-1" />
200
+ </template>
201
+ <Input
202
+ v-else
203
+ :model-value="row.text"
204
+ class="h-7 min-w-0 flex-1 bg-white font-mono text-sm"
205
+ title="This entry is not in the builder vocabulary; edit it as text or in the JSON view."
206
+ @update:model-value="(v) => setRow(idx, { text: String(v) })"
207
+ />
208
+ <button
209
+ type="button"
210
+ class="flex size-6 shrink-0 items-center justify-center rounded text-muted-foreground transition hover:text-rose-600"
211
+ @click="removeRow(idx)"
212
+ >
213
+ <Trash2 :size="11" />
214
+ </button>
215
+ </div>
216
+ <Button
217
+ type="button"
218
+ variant="outline"
219
+ size="sm"
220
+ class="h-7 w-full text-sm"
221
+ @click="addRow"
222
+ >
223
+ <Plus :size="11" />
224
+ Add filter
225
+ </Button>
226
+ </template>
227
+
228
+ <template v-else>
229
+ <Textarea
230
+ :model-value="jsonDraft"
231
+ :rows="6"
232
+ spellcheck="false"
233
+ class="font-mono text-xs"
234
+ @update:model-value="(v) => writeJson(String(v))"
235
+ />
236
+ <p v-if="jsonError" class="text-sm text-amber-600">{{ jsonError }}</p>
237
+ </template>
238
+ </div>
239
+ </template>
@@ -0,0 +1,9 @@
1
+ type __VLS_Props = {
2
+ modelValue: unknown;
3
+ };
4
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ "update:modelValue": (value: unknown) => any;
6
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
7
+ "onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ export default _default;
@@ -1,11 +1,10 @@
1
1
  import type { WorkflowRun } from '../../types/integrations.js';
2
2
  type __VLS_Props = {
3
- open: boolean;
4
- run: WorkflowRun | null;
3
+ run: WorkflowRun;
5
4
  };
6
5
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- "update:open": (args_0: boolean) => any;
6
+ changed: () => any;
8
7
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- "onUpdate:open"?: ((args_0: boolean) => any) | undefined;
8
+ onChanged?: (() => any) | undefined;
10
9
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
10
  export default _default;
@@ -0,0 +1,86 @@
1
+ <script setup>
2
+ import { computed, ref } from "vue";
3
+ import { MenuDots as MoreHorizontal } from "#solar-icons";
4
+ import {
5
+ Button,
6
+ DropdownMenu,
7
+ DropdownMenuContent,
8
+ DropdownMenuItem,
9
+ DropdownMenuSeparator,
10
+ DropdownMenuTrigger
11
+ } from "@revenexx/studio";
12
+ import { toast } from "vue-sonner";
13
+ const props = defineProps({
14
+ run: { type: Object, required: true }
15
+ });
16
+ const emit = defineEmits(["changed"]);
17
+ const router = useRouter();
18
+ const { cancelRun, terminateRun, retryRun, resumeRun } = useIntegrationsRuns();
19
+ function viewDetails() {
20
+ void router.push({ path: `/integrations/workflows/${props.run.workflowId}`, query: { run: props.run.id } });
21
+ }
22
+ function viewReplay() {
23
+ void router.push({ path: `/integrations/workflows/${props.run.workflowId}`, query: { run: props.run.id, view: "replay" } });
24
+ }
25
+ const isActive = computed(() => props.run.status === "running" || props.run.status === "queued");
26
+ const isTerminal = computed(() => ["succeeded", "failed", "cancelled"].includes(props.run.status));
27
+ const canResume = computed(() => props.run.status === "failed");
28
+ const hasAny = computed(() => isActive.value || isTerminal.value);
29
+ const LABEL = { cancel: "Cancel", terminate: "Terminate", retry: "Retry", resume: "Resume" };
30
+ const busy = ref(false);
31
+ async function runAction(a) {
32
+ if (busy.value) return;
33
+ busy.value = true;
34
+ try {
35
+ let res = null;
36
+ switch (a) {
37
+ case "cancel":
38
+ res = await cancelRun(props.run.workflowId, props.run.id);
39
+ break;
40
+ case "terminate":
41
+ res = await terminateRun(props.run.workflowId, props.run.id);
42
+ break;
43
+ case "retry":
44
+ res = await retryRun(props.run.workflowId, props.run.id);
45
+ break;
46
+ case "resume":
47
+ res = await resumeRun(props.run.workflowId, props.run.id);
48
+ break;
49
+ }
50
+ const newId = res && typeof res === "object" && "id" in res ? String(res.id) : null;
51
+ toast.success(
52
+ (a === "retry" || a === "resume") && newId && newId !== String(props.run.id) ? `Started run #${newId}` : `${LABEL[a]} requested`
53
+ );
54
+ emit("changed");
55
+ } catch (e) {
56
+ toast.error(e?.message ?? `Could not ${LABEL[a].toLowerCase()} the run.`);
57
+ } finally {
58
+ busy.value = false;
59
+ }
60
+ }
61
+ function confirmTerminate() {
62
+ toast(`Terminate run #${props.run.id}?`, {
63
+ action: { label: "Terminate", onClick: () => void runAction("terminate") }
64
+ });
65
+ }
66
+ </script>
67
+
68
+ <template>
69
+ <DropdownMenu>
70
+ <DropdownMenuTrigger as-child>
71
+ <Button variant="ghost" size="icon" class="size-7" :disabled="busy" @click.stop>
72
+ <MoreHorizontal :size="16" />
73
+ </Button>
74
+ </DropdownMenuTrigger>
75
+ <DropdownMenuContent align="end" class="w-40" @click.stop>
76
+ <DropdownMenuItem @select="viewDetails">View details</DropdownMenuItem>
77
+ <DropdownMenuItem @select="viewReplay">Replay</DropdownMenuItem>
78
+ <DropdownMenuSeparator v-if="hasAny" />
79
+ <DropdownMenuItem v-if="isActive" @select="runAction('cancel')">Cancel run</DropdownMenuItem>
80
+ <DropdownMenuItem v-if="isActive" class="text-rose-600" @select="confirmTerminate">Terminate</DropdownMenuItem>
81
+ <DropdownMenuSeparator v-if="isActive && (canResume || isTerminal)" />
82
+ <DropdownMenuItem v-if="canResume" @select="runAction('resume')">Resume</DropdownMenuItem>
83
+ <DropdownMenuItem v-if="isTerminal" @select="runAction('retry')">Retry</DropdownMenuItem>
84
+ </DropdownMenuContent>
85
+ </DropdownMenu>
86
+ </template>
@@ -1,11 +1,10 @@
1
1
  import type { WorkflowRun } from '../../types/integrations.js';
2
2
  type __VLS_Props = {
3
- open: boolean;
4
- run: WorkflowRun | null;
3
+ run: WorkflowRun;
5
4
  };
6
5
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- "update:open": (args_0: boolean) => any;
6
+ changed: () => any;
8
7
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- "onUpdate:open"?: ((args_0: boolean) => any) | undefined;
8
+ onChanged?: (() => any) | undefined;
10
9
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
10
  export default _default;
@@ -0,0 +1,14 @@
1
+ import type { WorkflowRun } from '../../types/integrations.js';
2
+ type __VLS_Props = {
3
+ run: WorkflowRun;
4
+ /** Which surface renders: the overview or the steps+history timeline. */
5
+ view?: 'details' | 'timeline';
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ changed: () => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onChanged?: (() => any) | undefined;
11
+ }>, {
12
+ view: "details" | "timeline";
13
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ export default _default;