@revenexx/studio-integrations 0.6.0 → 0.7.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/CHANGELOG.md +227 -0
- package/README.md +31 -0
- package/dist/module.d.mts +17 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +10 -2
- package/dist/runtime/components/Integrations/CredentialCreateDialog.vue +29 -28
- package/dist/runtime/components/Integrations/CredentialDetailDialog.vue +38 -37
- package/dist/runtime/components/Integrations/CredentialRevenexxSource.vue +58 -58
- package/dist/runtime/components/Integrations/CredentialTypePicker.vue +10 -9
- package/dist/runtime/components/Integrations/DeadLettersPanel.vue +18 -17
- package/dist/runtime/components/Integrations/EventTypeCombobox.vue +4 -3
- package/dist/runtime/components/Integrations/ExpressionInput.vue +16 -15
- package/dist/runtime/components/Integrations/GroupFrameView.vue +29 -19
- package/dist/runtime/components/Integrations/Layout.vue +28 -3
- package/dist/runtime/components/Integrations/NodeConfigDynamicField.vue +15 -14
- package/dist/runtime/components/Integrations/NodeConfigDynamicSchema.vue +9 -8
- package/dist/runtime/components/Integrations/NodeConfigField.vue +43 -42
- package/dist/runtime/components/Integrations/NodeInspector.vue +225 -216
- package/dist/runtime/components/Integrations/NodeOutputSchema.d.vue.ts +1 -1
- package/dist/runtime/components/Integrations/NodeOutputSchema.vue +3 -2
- package/dist/runtime/components/Integrations/NodeOutputSchema.vue.d.ts +1 -1
- package/dist/runtime/components/Integrations/NodePalette.vue +30 -29
- package/dist/runtime/components/Integrations/QueryBuilder.vue +44 -43
- package/dist/runtime/components/Integrations/RunActionsMenu.vue +36 -12
- package/dist/runtime/components/Integrations/RunDetailPanel.vue +114 -62
- package/dist/runtime/components/Integrations/RunPayloadInput.vue +14 -13
- package/dist/runtime/components/Integrations/RunResponseModal.vue +11 -10
- package/dist/runtime/components/Integrations/RunsTable.d.vue.ts +0 -1
- package/dist/runtime/components/Integrations/RunsTable.vue +38 -16
- package/dist/runtime/components/Integrations/RunsTable.vue.d.ts +0 -1
- package/dist/runtime/components/Integrations/SftpAccountImportDialog.vue +8 -7
- package/dist/runtime/components/Integrations/Sidebar.vue +14 -10
- package/dist/runtime/components/Integrations/StickyNoteView.d.vue.ts +14 -4
- package/dist/runtime/components/Integrations/StickyNoteView.vue +37 -23
- package/dist/runtime/components/Integrations/StickyNoteView.vue.d.ts +14 -4
- package/dist/runtime/components/Integrations/TemplateCard.vue +16 -6
- package/dist/runtime/components/Integrations/TemplateFlowPreview.vue +10 -9
- package/dist/runtime/components/Integrations/WorkflowContextMenu.vue +34 -33
- package/dist/runtime/components/Integrations/WorkflowCreateDialog.vue +36 -35
- package/dist/runtime/components/Integrations/WorkflowDuplicateDialog.vue +8 -7
- package/dist/runtime/components/Integrations/WorkflowEdgeView.vue +6 -4
- package/dist/runtime/components/Integrations/WorkflowEditor.vue +82 -79
- package/dist/runtime/components/Integrations/WorkflowHistoryPanel.vue +24 -23
- package/dist/runtime/components/Integrations/WorkflowIconPicker.vue +7 -6
- package/dist/runtime/components/Integrations/WorkflowNodeView.vue +19 -20
- package/dist/runtime/components/Integrations/WorkflowRunReplayPanel.vue +52 -39
- package/dist/runtime/components/Integrations/WorkflowSettingsDialog.vue +20 -19
- package/dist/runtime/components/Integrations/WorkflowTagsInput.vue +9 -8
- package/dist/runtime/components/Integrations/WorkflowTriggerView.vue +12 -9
- package/dist/runtime/components/Integrations/WorkflowVariablesDialog.vue +27 -26
- package/dist/runtime/components/Integrations/WorkflowsTable.vue +83 -45
- package/dist/runtime/composables/integrationsApi.js +4 -2
- package/dist/runtime/composables/useCredentialTypes.js +4 -2
- package/dist/runtime/composables/useIntegrationsCredentials.js +6 -4
- package/dist/runtime/composables/useIntegrationsFocus.d.ts +12 -0
- package/dist/runtime/composables/useIntegrationsLocale.d.ts +26 -0
- package/dist/runtime/composables/useIntegrationsLocale.js +8 -0
- package/dist/runtime/composables/useIntegrationsNodes.js +3 -1
- package/dist/runtime/composables/useIntegrationsRealtime.d.ts +149 -0
- package/dist/runtime/composables/useIntegrationsRealtime.js +80 -0
- package/dist/runtime/composables/useIntegrationsRevisions.js +9 -7
- package/dist/runtime/composables/useIntegrationsRuns.d.ts +1 -1
- package/dist/runtime/composables/useIntegrationsRuns.js +3 -1
- package/dist/runtime/composables/useIntegrationsSecrets.js +4 -2
- package/dist/runtime/composables/useIntegrationsT.d.ts +35 -0
- package/dist/runtime/composables/useIntegrationsT.js +9 -0
- package/dist/runtime/composables/useIntegrationsTemplates.d.ts +3 -3
- package/dist/runtime/composables/useIntegrationsTemplates.js +16 -8
- package/dist/runtime/composables/useIntegrationsTriggers.js +4 -2
- package/dist/runtime/composables/useIntegrationsWorkflows.js +5 -3
- package/dist/runtime/composables/useNodeConfigResolve.js +2 -1
- package/dist/runtime/data/integrationNodeCatalog.d.ts +41 -0
- package/dist/runtime/data/integrationNodeCatalog.js +14 -0
- package/dist/runtime/data/integrationTemplates.d.ts +9 -0
- package/dist/runtime/data/integrationTemplates.js +7 -1
- package/dist/runtime/data/payloadForm.js +2 -1
- package/dist/runtime/data/workflowIconCatalog.js +2 -1
- package/dist/runtime/i18n/messages/de.json +1207 -0
- package/dist/runtime/i18n/messages/en.json +1207 -0
- package/dist/runtime/i18n/translate.d.ts +83 -0
- package/dist/runtime/i18n/translate.js +41 -0
- package/dist/runtime/pages/integrations/audit.vue +52 -34
- package/dist/runtime/pages/integrations/credentials/oauth-complete.vue +3 -2
- package/dist/runtime/pages/integrations/credentials.vue +70 -52
- package/dist/runtime/pages/integrations/index.vue +50 -56
- package/dist/runtime/pages/integrations/runs.vue +33 -21
- package/dist/runtime/pages/integrations/schedules.vue +49 -28
- package/dist/runtime/pages/integrations/secrets.vue +34 -34
- package/dist/runtime/pages/integrations/templates/[slug].vue +77 -68
- package/dist/runtime/pages/integrations/templates/index.vue +35 -27
- package/dist/runtime/pages/integrations/workflows/[id].vue +164 -99
- package/dist/runtime/pages/integrations/workflows/index.vue +10 -5
- package/dist/runtime/plugins/locale.d.ts +10 -0
- package/dist/runtime/plugins/locale.js +6 -0
- package/dist/runtime/plugins/realtime.client.d.ts +32 -0
- package/dist/runtime/plugins/realtime.client.js +4 -0
- package/dist/runtime/utils/credentialState.d.ts +24 -1
- package/dist/runtime/utils/credentialState.js +26 -11
- package/dist/runtime/utils/localize.d.ts +18 -5
- package/dist/runtime/utils/localize.js +32 -9
- package/dist/runtime/utils/pollBudget.d.ts +72 -0
- package/dist/runtime/utils/pollBudget.js +17 -0
- package/dist/runtime/utils/schedule.d.ts +0 -25
- package/dist/runtime/utils/schedule.js +37 -25
- package/dist/runtime/utils/statusStyle.d.ts +26 -2
- package/dist/runtime/utils/statusStyle.js +9 -1
- package/dist/runtime/utils/validationFindings.d.ts +2 -2
- package/dist/runtime/utils/validationFindings.js +4 -3
- package/dist/types.d.mts +2 -6
- package/package.json +3 -2
|
@@ -25,6 +25,7 @@ defineProps({
|
|
|
25
25
|
workflows: { type: Array, required: true },
|
|
26
26
|
loading: { type: Boolean, required: false, default: false }
|
|
27
27
|
});
|
|
28
|
+
const t = useIntegrationsT();
|
|
28
29
|
const router = useRouter();
|
|
29
30
|
const { remove, toggleActive } = useIntegrationsWorkflows();
|
|
30
31
|
const duplicateTarget = ref(null);
|
|
@@ -34,7 +35,7 @@ function askDuplicate(wf) {
|
|
|
34
35
|
duplicateOpen.value = true;
|
|
35
36
|
}
|
|
36
37
|
async function onDuplicated(copy) {
|
|
37
|
-
toast.success(
|
|
38
|
+
toast.success(t("integration.workflows.table.toast.duplicated", { name: copy.name }));
|
|
38
39
|
await router.push(`/integrations/workflows/${copy.id}`);
|
|
39
40
|
}
|
|
40
41
|
const GROUP_BY_TAGS_KEY = "integrations.workflows.groupByTags";
|
|
@@ -60,15 +61,15 @@ function lastRunFor(id) {
|
|
|
60
61
|
function runBadge(status) {
|
|
61
62
|
switch (status) {
|
|
62
63
|
case "succeeded":
|
|
63
|
-
return { label: "
|
|
64
|
+
return { label: t("integration.workflows.table.status.run.succeeded"), class: "bg-emerald-500/15 text-emerald-700 border-emerald-500/20" };
|
|
64
65
|
case "failed":
|
|
65
|
-
return { label: "
|
|
66
|
+
return { label: t("integration.workflows.table.status.run.failed"), class: "bg-rose-500/15 text-rose-700 border-rose-500/20" };
|
|
66
67
|
case "running":
|
|
67
|
-
return { label: "
|
|
68
|
+
return { label: t("integration.workflows.table.status.run.running"), class: "bg-sky-500/15 text-sky-700 border-sky-500/20" };
|
|
68
69
|
case "queued":
|
|
69
|
-
return { label: "
|
|
70
|
+
return { label: t("integration.workflows.table.status.run.queued"), class: "bg-amber-500/10 text-amber-700 border-amber-500/20" };
|
|
70
71
|
case "cancelled":
|
|
71
|
-
return { label: "
|
|
72
|
+
return { label: t("integration.workflows.table.status.run.cancelled"), class: "bg-slate-100 text-slate-700 border-slate-200" };
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
const pendingDelete = ref(null);
|
|
@@ -93,27 +94,38 @@ async function onToggleActive(wf) {
|
|
|
93
94
|
} catch (e) {
|
|
94
95
|
const issues = apiValidationIssues(e);
|
|
95
96
|
if (issues.length) {
|
|
96
|
-
toast.error(
|
|
97
|
+
toast.error(t("integration.workflows.table.toast.activateBlocked", issues.length, { name: wf.name }));
|
|
97
98
|
return;
|
|
98
99
|
}
|
|
99
|
-
toast.error(e?.message ?? "
|
|
100
|
+
toast.error(e?.message ?? t("integration.workflows.table.toast.statusChangeFailed"));
|
|
100
101
|
}
|
|
101
102
|
}
|
|
103
|
+
function lifecycleOf(wf) {
|
|
104
|
+
if (!wf.active) return "paused";
|
|
105
|
+
return wf.revision === 0 ? "draft" : "active";
|
|
106
|
+
}
|
|
107
|
+
function lifecycleLabel(state) {
|
|
108
|
+
return t(`integration.workflows.table.status.lifecycle.${state}`);
|
|
109
|
+
}
|
|
110
|
+
const LIFECYCLE_TONE = {
|
|
111
|
+
active: "bg-emerald-500/10 text-emerald-700 border-emerald-500/20",
|
|
112
|
+
draft: "bg-amber-500/10 text-amber-700 border-amber-500/20",
|
|
113
|
+
paused: "bg-slate-100 text-slate-700 border-slate-200"
|
|
114
|
+
};
|
|
102
115
|
function statusBadge(wf) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return { label: "Active", class: "bg-emerald-500/10 text-emerald-700 border-emerald-500/20" };
|
|
116
|
+
const state = lifecycleOf(wf);
|
|
117
|
+
return { label: lifecycleLabel(state), class: LIFECYCLE_TONE[state] };
|
|
106
118
|
}
|
|
107
119
|
function buildState(wf) {
|
|
108
120
|
switch (wf.buildStatus) {
|
|
109
121
|
case "building":
|
|
110
|
-
return { label: "
|
|
122
|
+
return { label: t("integration.workflows.table.status.build.building"), class: "bg-sky-500/15 text-sky-700 border-sky-500/20" };
|
|
111
123
|
case "pending":
|
|
112
|
-
return { label: "
|
|
124
|
+
return { label: t("integration.workflows.table.status.build.pending"), class: "bg-amber-500/10 text-amber-700 border-amber-500/20" };
|
|
113
125
|
case "failed":
|
|
114
|
-
return { label: "
|
|
126
|
+
return { label: t("integration.workflows.table.status.build.failed"), class: "bg-rose-500/15 text-rose-700 border-rose-500/20" };
|
|
115
127
|
case "ready":
|
|
116
|
-
return { label: "
|
|
128
|
+
return { label: t("integration.workflows.table.status.build.ready"), class: "bg-emerald-500/10 text-emerald-700 border-emerald-500/20" };
|
|
117
129
|
default:
|
|
118
130
|
return { label: "\u2014", class: "bg-slate-100 text-slate-700 border-slate-200" };
|
|
119
131
|
}
|
|
@@ -121,11 +133,11 @@ function buildState(wf) {
|
|
|
121
133
|
function modeLabel(m) {
|
|
122
134
|
switch (m) {
|
|
123
135
|
case "sync_only":
|
|
124
|
-
return "sync";
|
|
136
|
+
return t("integration.workflows.table.mode.sync");
|
|
125
137
|
case "caller_decides":
|
|
126
|
-
return "caller";
|
|
138
|
+
return t("integration.workflows.table.mode.caller");
|
|
127
139
|
case "async_only":
|
|
128
|
-
return "async";
|
|
140
|
+
return t("integration.workflows.table.mode.async");
|
|
129
141
|
default:
|
|
130
142
|
return "\u2014";
|
|
131
143
|
}
|
|
@@ -143,45 +155,71 @@ function formatDateTime(iso) {
|
|
|
143
155
|
return iso;
|
|
144
156
|
}
|
|
145
157
|
}
|
|
146
|
-
const
|
|
158
|
+
const LIFECYCLE = ["active", "draft", "paused"];
|
|
159
|
+
const BUILD_STATES = ["pending", "building", "ready", "failed"];
|
|
160
|
+
const MODES = ["async_only", "sync_only", "caller_decides"];
|
|
161
|
+
const filterTabs = computed(() => [
|
|
162
|
+
{
|
|
163
|
+
key: "status",
|
|
164
|
+
label: t("integration.workflows.table.column.status"),
|
|
165
|
+
getter: (wf) => lifecycleOf(wf),
|
|
166
|
+
options: LIFECYCLE.map((v) => ({ value: v, label: lifecycleLabel(v) }))
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
key: "build",
|
|
170
|
+
label: t("integration.workflows.table.column.build"),
|
|
171
|
+
getter: (wf) => wf.buildStatus ?? "",
|
|
172
|
+
options: BUILD_STATES.map((v) => ({
|
|
173
|
+
value: v,
|
|
174
|
+
label: t(`integration.workflows.table.status.build.${v}`)
|
|
175
|
+
}))
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
key: "mode",
|
|
179
|
+
label: t("integration.workflows.table.column.mode"),
|
|
180
|
+
getter: (wf) => wf.execution_mode ?? "",
|
|
181
|
+
options: MODES.map((v) => ({ value: v, label: modeLabel(v) }))
|
|
182
|
+
}
|
|
183
|
+
]);
|
|
184
|
+
const columns = computed(() => [
|
|
147
185
|
{
|
|
148
186
|
key: "name",
|
|
149
|
-
label: "
|
|
187
|
+
label: t("integration.workflows.table.column.name"),
|
|
150
188
|
sortable: true,
|
|
151
189
|
sortGetter: (w) => w.name.toLowerCase(),
|
|
152
190
|
searchGetter: (w) => `${w.name} ${w.description ?? ""} ${(w.blob.tags ?? []).join(" ")}`
|
|
153
191
|
},
|
|
154
192
|
{
|
|
155
193
|
key: "status",
|
|
156
|
-
label: "
|
|
194
|
+
label: t("integration.workflows.table.column.status"),
|
|
157
195
|
width: "100px",
|
|
158
196
|
sortable: true,
|
|
159
|
-
sortGetter: (w) => w
|
|
197
|
+
sortGetter: (w) => lifecycleOf(w)
|
|
160
198
|
},
|
|
161
199
|
{
|
|
162
200
|
key: "build",
|
|
163
|
-
label: "
|
|
201
|
+
label: t("integration.workflows.table.column.build"),
|
|
164
202
|
width: "120px",
|
|
165
203
|
sortable: true,
|
|
166
204
|
sortGetter: (w) => w.buildStatus ?? ""
|
|
167
205
|
},
|
|
168
206
|
{
|
|
169
207
|
key: "mode",
|
|
170
|
-
label: "
|
|
208
|
+
label: t("integration.workflows.table.column.mode"),
|
|
171
209
|
width: "120px",
|
|
172
210
|
sortable: true,
|
|
173
211
|
sortGetter: (w) => w.execution_mode ?? ""
|
|
174
212
|
},
|
|
175
213
|
{
|
|
176
214
|
key: "triggers",
|
|
177
|
-
label: "
|
|
215
|
+
label: t("integration.workflows.table.column.triggers"),
|
|
178
216
|
width: "140px",
|
|
179
217
|
sortable: true,
|
|
180
|
-
sortGetter: (w) => w.blob.triggers.map((
|
|
218
|
+
sortGetter: (w) => w.blob.triggers.map((tr) => tr.type).join(",")
|
|
181
219
|
},
|
|
182
220
|
{
|
|
183
221
|
key: "lastRun",
|
|
184
|
-
label: "
|
|
222
|
+
label: t("integration.workflows.table.column.lastRun"),
|
|
185
223
|
// Wide enough for badge + full timestamp — the flexible Name column has
|
|
186
224
|
// the slack to give; a truncated "18. Juli, 1…" helps nobody.
|
|
187
225
|
width: "210px",
|
|
@@ -190,7 +228,7 @@ const columns = [
|
|
|
190
228
|
},
|
|
191
229
|
{
|
|
192
230
|
key: "updated",
|
|
193
|
-
label: "
|
|
231
|
+
label: t("integration.workflows.table.column.updated"),
|
|
194
232
|
width: "120px",
|
|
195
233
|
sortable: true,
|
|
196
234
|
sortGetter: (w) => w.updated_at ?? ""
|
|
@@ -201,21 +239,21 @@ const columns = [
|
|
|
201
239
|
width: "40px",
|
|
202
240
|
toggleable: false
|
|
203
241
|
}
|
|
204
|
-
];
|
|
242
|
+
]);
|
|
205
243
|
</script>
|
|
206
244
|
|
|
207
245
|
<template>
|
|
208
246
|
<DataTable
|
|
209
247
|
:data="workflows"
|
|
210
248
|
:group-by="groupByTags ? (w) => w.blob.tags ?? [] : null"
|
|
211
|
-
group-empty-label="
|
|
249
|
+
:group-empty-label="t('integration.workflows.table.group.noTags')"
|
|
212
250
|
:columns="columns"
|
|
213
251
|
:row-key="(wf2) => wf2.id"
|
|
214
252
|
:default-sort="{ column: 'updated', direction: 'desc' }"
|
|
215
|
-
:search="{ placeholder: '
|
|
216
|
-
:filter="
|
|
253
|
+
:search="{ placeholder: t('integration.workflows.table.search.placeholder') }"
|
|
254
|
+
:filter-tabs="filterTabs"
|
|
217
255
|
:loading="loading"
|
|
218
|
-
empty-text="
|
|
256
|
+
:empty-text="t('integration.workflows.table.state.empty')"
|
|
219
257
|
@row-click="(wf2) => router.push(`/integrations/workflows/${wf2.id}`)"
|
|
220
258
|
>
|
|
221
259
|
<template #toolbar-left>
|
|
@@ -227,7 +265,7 @@ const columns = [
|
|
|
227
265
|
@click="groupByTags = !groupByTags"
|
|
228
266
|
>
|
|
229
267
|
<Layers :size="13" />
|
|
230
|
-
|
|
268
|
+
{{ t("integration.workflows.table.action.groupByTags") }}
|
|
231
269
|
</Button>
|
|
232
270
|
</template>
|
|
233
271
|
|
|
@@ -317,7 +355,7 @@ const columns = [
|
|
|
317
355
|
<span
|
|
318
356
|
v-else
|
|
319
357
|
class="text-sm text-muted-foreground"
|
|
320
|
-
:aria-label="runsLoaded ?
|
|
358
|
+
:aria-label="runsLoaded ? t('integration.workflows.table.lastRun.aria.never', { name: wf.name }) : void 0"
|
|
321
359
|
>—</span>
|
|
322
360
|
</template>
|
|
323
361
|
|
|
@@ -333,28 +371,28 @@ const columns = [
|
|
|
333
371
|
<DropdownMenuTrigger as-child>
|
|
334
372
|
<!-- Icon-only, so it needs a name of its own — the rows are plain
|
|
335
373
|
divs, which leaves nothing else to address this button by. -->
|
|
336
|
-
<Button variant="ghost" size="icon" class="size-7" :aria-label="
|
|
374
|
+
<Button variant="ghost" size="icon" class="size-7" :aria-label="t('integration.workflows.table.menu.actions.aria', { name: wf.name })">
|
|
337
375
|
<MoreHorizontal :size="14" />
|
|
338
376
|
</Button>
|
|
339
377
|
</DropdownMenuTrigger>
|
|
340
378
|
<DropdownMenuContent align="end">
|
|
341
|
-
<DropdownMenuLabel>
|
|
379
|
+
<DropdownMenuLabel>{{ t("integration.workflows.table.menu.actions.label") }}</DropdownMenuLabel>
|
|
342
380
|
<DropdownMenuSeparator />
|
|
343
381
|
<DropdownMenuItem @select="router.push(`/integrations/workflows/${wf.id}`)">
|
|
344
|
-
|
|
382
|
+
{{ t("integration.workflows.table.menu.action.openEditor") }}
|
|
345
383
|
</DropdownMenuItem>
|
|
346
384
|
<DropdownMenuItem @select="askDuplicate(wf)">
|
|
347
|
-
|
|
385
|
+
{{ t("integration.workflows.action.duplicate") }}
|
|
348
386
|
</DropdownMenuItem>
|
|
349
387
|
<DropdownMenuItem @select="onToggleActive(wf)">
|
|
350
|
-
{{ wf.active ? "
|
|
388
|
+
{{ wf.active ? t("integration.workflows.table.menu.action.pause") : t("integration.workflows.table.menu.action.activate") }}
|
|
351
389
|
</DropdownMenuItem>
|
|
352
390
|
<DropdownMenuSeparator />
|
|
353
391
|
<DropdownMenuItem
|
|
354
392
|
class="text-destructive focus:text-destructive"
|
|
355
393
|
@select="askDelete(wf)"
|
|
356
394
|
>
|
|
357
|
-
|
|
395
|
+
{{ t("integration.common.action.delete") }}
|
|
358
396
|
</DropdownMenuItem>
|
|
359
397
|
</DropdownMenuContent>
|
|
360
398
|
</DropdownMenu>
|
|
@@ -367,21 +405,21 @@ const columns = [
|
|
|
367
405
|
}">
|
|
368
406
|
<AlertDialogContent>
|
|
369
407
|
<AlertDialogHeader>
|
|
370
|
-
<AlertDialogTitle>
|
|
408
|
+
<AlertDialogTitle>{{ t("integration.workflows.table.deleteDialog.title") }}</AlertDialogTitle>
|
|
371
409
|
<AlertDialogDescription>
|
|
372
410
|
<span v-if="pendingDelete">
|
|
373
411
|
<span class="font-medium text-foreground">{{ pendingDelete.name }}</span>
|
|
374
|
-
|
|
412
|
+
{{ t("integration.workflows.table.deleteDialog.description") }}
|
|
375
413
|
</span>
|
|
376
414
|
</AlertDialogDescription>
|
|
377
415
|
</AlertDialogHeader>
|
|
378
416
|
<AlertDialogFooter>
|
|
379
417
|
<Button variant="outline" :disabled="deleting" @click="pendingDelete = null">
|
|
380
|
-
|
|
418
|
+
{{ t("integration.common.action.cancel") }}
|
|
381
419
|
</Button>
|
|
382
420
|
<Button class="bg-destructive text-white hover:bg-destructive/90" :disabled="deleting" @click="confirmDelete">
|
|
383
421
|
<Loader2 v-if="deleting" :size="14" class="animate-spin" />
|
|
384
|
-
{{ deleting ? "
|
|
422
|
+
{{ deleting ? t("integration.workflows.table.deleteDialog.action.deleting") : t("integration.common.action.delete") }}
|
|
385
423
|
</Button>
|
|
386
424
|
</AlertDialogFooter>
|
|
387
425
|
</AlertDialogContent>
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
2
|
import { IntegrationsApiError } from "../utils/apiError.js";
|
|
3
|
+
import { useIntegrationsT } from "./useIntegrationsT.js";
|
|
3
4
|
export function useIntegrationsApi() {
|
|
4
5
|
const config = useRuntimeConfig();
|
|
5
6
|
const { getToken } = usePlatformAuth();
|
|
6
7
|
const { slug: onlyTenantSlug, load: loadTenants } = usePlatformTenant();
|
|
8
|
+
const t = useIntegrationsT();
|
|
7
9
|
const baseUrl = computed(
|
|
8
10
|
() => config.public.integrationsApi ?? "https://integrations.revenexx.com/api/v1"
|
|
9
11
|
);
|
|
10
12
|
async function buildHeaders(extra = {}) {
|
|
11
13
|
const token = await getToken();
|
|
12
|
-
if (!token) throw new IntegrationsApiError(401, null, "
|
|
14
|
+
if (!token) throw new IntegrationsApiError(401, null, t("integration.common.error.notSignedIn"));
|
|
13
15
|
if (!onlyTenantSlug.value) await loadTenants();
|
|
14
16
|
const headers = {
|
|
15
17
|
Accept: "application/json",
|
|
@@ -34,7 +36,7 @@ export function useIntegrationsApi() {
|
|
|
34
36
|
} catch (err) {
|
|
35
37
|
const fe = err;
|
|
36
38
|
const data = fe?.response?._data;
|
|
37
|
-
const detail = data?.message ?? fe?.message ?? "
|
|
39
|
+
const detail = data?.message ?? fe?.message ?? t("integration.common.error.requestFailed");
|
|
38
40
|
throw new IntegrationsApiError(fe?.response?.status ?? 0, data, detail);
|
|
39
41
|
}
|
|
40
42
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useIntegrationsApi } from "./integrationsApi.js";
|
|
2
|
+
import { useIntegrationsT } from "./useIntegrationsT.js";
|
|
2
3
|
import { IntegrationsApiError } from "../utils/apiError.js";
|
|
3
4
|
import { useLoadGate } from "./useLoadGate.js";
|
|
4
5
|
export function useCredentialTypes() {
|
|
@@ -8,6 +9,7 @@ export function useCredentialTypes() {
|
|
|
8
9
|
const loaded = useState("integrations.credentialTypes.loaded", () => false);
|
|
9
10
|
const gate = useLoadGate("integrations.credentialTypes", { loading, loaded });
|
|
10
11
|
const api = useIntegrationsApi();
|
|
12
|
+
const t = useIntegrationsT();
|
|
11
13
|
function normalize(res) {
|
|
12
14
|
const obj = res;
|
|
13
15
|
if (Array.isArray(obj)) return obj;
|
|
@@ -25,14 +27,14 @@ export function useCredentialTypes() {
|
|
|
25
27
|
types.value = normalize(await api.get("/credential-types"));
|
|
26
28
|
loaded.value = true;
|
|
27
29
|
} catch (e) {
|
|
28
|
-
error.value = captureError(e, "
|
|
30
|
+
error.value = captureError(e, t("integration.credentials.error.loadTypes"));
|
|
29
31
|
} finally {
|
|
30
32
|
gate.release();
|
|
31
33
|
}
|
|
32
34
|
return types.value;
|
|
33
35
|
}
|
|
34
36
|
function bySlug(slug) {
|
|
35
|
-
return types.value.find((
|
|
37
|
+
return types.value.find((t2) => t2.slug === slug) ?? null;
|
|
36
38
|
}
|
|
37
39
|
async function get(slug) {
|
|
38
40
|
const cached = bySlug(slug);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
2
|
import { useIntegrationsApi } from "./integrationsApi.js";
|
|
3
|
+
import { useIntegrationsT } from "./useIntegrationsT.js";
|
|
3
4
|
import { IntegrationsApiError } from "../utils/apiError.js";
|
|
4
5
|
import { useLoadGate } from "./useLoadGate.js";
|
|
5
6
|
export function useIntegrationsCredentials() {
|
|
@@ -9,6 +10,7 @@ export function useIntegrationsCredentials() {
|
|
|
9
10
|
const loaded = useState("integrations.credentials.loaded", () => false);
|
|
10
11
|
const gate = useLoadGate("integrations.credentials", { loading, loaded });
|
|
11
12
|
const api = useIntegrationsApi();
|
|
13
|
+
const t = useIntegrationsT();
|
|
12
14
|
function normalize(res) {
|
|
13
15
|
const obj = res;
|
|
14
16
|
if (Array.isArray(obj)) return obj;
|
|
@@ -29,7 +31,7 @@ export function useIntegrationsCredentials() {
|
|
|
29
31
|
credentials.value = normalize(await api.get("/credentials"));
|
|
30
32
|
loaded.value = true;
|
|
31
33
|
} catch (e) {
|
|
32
|
-
error.value = captureError(e, "
|
|
34
|
+
error.value = captureError(e, t("integration.credentials.error.loadFailed"));
|
|
33
35
|
} finally {
|
|
34
36
|
gate.release();
|
|
35
37
|
}
|
|
@@ -60,7 +62,7 @@ export function useIntegrationsCredentials() {
|
|
|
60
62
|
const res = await api.post("/credentials/test", { credential_type_slug: credentialTypeSlug, config });
|
|
61
63
|
return res?.ok === false ? res : { ok: true };
|
|
62
64
|
} catch (e) {
|
|
63
|
-
return { ok: false, error: captureError(e, "
|
|
65
|
+
return { ok: false, error: captureError(e, t("integration.credentials.error.testFailed")) };
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
async function test(id) {
|
|
@@ -68,13 +70,13 @@ export function useIntegrationsCredentials() {
|
|
|
68
70
|
const res = await api.post(`/credentials/${encodeURIComponent(id)}/test`);
|
|
69
71
|
return res?.ok === false ? res : { ok: true };
|
|
70
72
|
} catch (e) {
|
|
71
|
-
return { ok: false, error: captureError(e, "
|
|
73
|
+
return { ok: false, error: captureError(e, t("integration.credentials.error.testFailed")) };
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
async function oauthAuthorizeUrl(id) {
|
|
75
77
|
const res = await api.post(`/credentials/${encodeURIComponent(id)}/oauth/authorize-url`);
|
|
76
78
|
const authorizeUrl = res?.authorize_url ?? res?.data?.authorize_url;
|
|
77
|
-
if (!authorizeUrl) throw new IntegrationsApiError(0, res, "
|
|
79
|
+
if (!authorizeUrl) throw new IntegrationsApiError(0, res, t("integration.credentials.error.noAuthorizeUrl"));
|
|
78
80
|
return authorizeUrl;
|
|
79
81
|
}
|
|
80
82
|
const total = computed(() => credentials.value.length);
|
|
@@ -6,6 +6,18 @@
|
|
|
6
6
|
* Pages opt in by calling `useIntegrationsFocus().enable()` in onMounted
|
|
7
7
|
* and `disable()` in onUnmounted (we provide an `autoEnable()` helper
|
|
8
8
|
* that wires both).
|
|
9
|
+
*
|
|
10
|
+
* **A page that hides the sidebar renders the control that brings it back** — see
|
|
11
|
+
* specs/studio-navigation.md. The control belongs to the page and not to the
|
|
12
|
+
* shell, because the cockpit ships its own shell and reads this same state: a
|
|
13
|
+
* control in the module's shell would be missing in the cockpit, which is the
|
|
14
|
+
* one-way switch PO-273 was filed about.
|
|
15
|
+
*
|
|
16
|
+
* `autoEnable()` *is* that one-way switch, and `toggle()` has no caller: the
|
|
17
|
+
* workflow editor derives the state from a remembered preference and applies it
|
|
18
|
+
* with `enable()`/`disable()`, which a derived state can do idempotently and a
|
|
19
|
+
* flip cannot. Both are kept because they are part of what this module publishes,
|
|
20
|
+
* and a host driving the fold itself may still want them.
|
|
9
21
|
*/
|
|
10
22
|
export declare function useIntegrationsFocus(): {
|
|
11
23
|
focused: any;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* The studio's interface language, for a host to read and to set.
|
|
4
|
+
*
|
|
5
|
+
* This is the seam between the application the studio is embedded in and the
|
|
6
|
+
* text the Integrations API returns. The module is published and installed into
|
|
7
|
+
* hosts it knows nothing about, so it never reads a browser store or a cockpit
|
|
8
|
+
* i18n instance: the host owns the choice and hands it over here.
|
|
9
|
+
*
|
|
10
|
+
* A host with a language switcher wires it once, at boot:
|
|
11
|
+
*
|
|
12
|
+
* const { setLocale } = useIntegrationsLocale()
|
|
13
|
+
* watch(uiLocale, l => setLocale(l), { immediate: true })
|
|
14
|
+
*
|
|
15
|
+
* A host with a fixed language sets `studioIntegrations.locale` in its Nuxt
|
|
16
|
+
* config and never calls this. Neither is required — with nothing set the
|
|
17
|
+
* studio renders English.
|
|
18
|
+
*
|
|
19
|
+
* `locale` is reactive, and so is every name, label and description on screen:
|
|
20
|
+
* they are resolved through the same value, so a switch reaches surfaces that
|
|
21
|
+
* are already mounted without reloading anything.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useIntegrationsLocale(): {
|
|
24
|
+
locale: ComputedRef<string>;
|
|
25
|
+
setLocale: (locale: string | null | undefined) => void;
|
|
26
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { applyNodeCatalog, findManifest } from "../data/integrationNodeCatalog.js";
|
|
2
2
|
import { resolveLocalized } from "../utils/localize.js";
|
|
3
3
|
import { useIntegrationsApi } from "./integrationsApi.js";
|
|
4
|
+
import { useIntegrationsT } from "./useIntegrationsT.js";
|
|
4
5
|
import { IntegrationsApiError } from "../utils/apiError.js";
|
|
5
6
|
import { useLoadGate } from "./useLoadGate.js";
|
|
6
7
|
export function useIntegrationsNodes() {
|
|
@@ -9,6 +10,7 @@ export function useIntegrationsNodes() {
|
|
|
9
10
|
const loaded = useState("integrations.nodes.loaded", () => false);
|
|
10
11
|
const gate = useLoadGate("integrations.nodes", { loading, loaded });
|
|
11
12
|
const api = useIntegrationsApi();
|
|
13
|
+
const t = useIntegrationsT();
|
|
12
14
|
async function load(force = false) {
|
|
13
15
|
if (!await gate.claim(force)) return;
|
|
14
16
|
error.value = null;
|
|
@@ -27,7 +29,7 @@ export function useIntegrationsNodes() {
|
|
|
27
29
|
loaded.value = true;
|
|
28
30
|
} catch (e) {
|
|
29
31
|
applyNodeCatalog([]);
|
|
30
|
-
error.value = e instanceof IntegrationsApiError ? e.message : e?.message ?? "
|
|
32
|
+
error.value = e instanceof IntegrationsApiError ? e.message : e?.message ?? t("integration.nodes.error.loadFailed");
|
|
31
33
|
} finally {
|
|
32
34
|
gate.release();
|
|
33
35
|
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* The Studio's single Talkback subscriber.
|
|
4
|
+
*
|
|
5
|
+
* The integrations service publishes its run, workflow and bundle-build lifecycle
|
|
6
|
+
* onto the platform event bus (`App\Enums\OutboxTopic` → `event_outbox` → the relay
|
|
7
|
+
* → NATS → the Talkback bridge → Centrifugo), so a browser can learn that a run
|
|
8
|
+
* finished — or that a build is done — instead of asking every three seconds. This
|
|
9
|
+
* is the browser end of that chain, and everything it hands out is a **refetch
|
|
10
|
+
* signal**: the envelope carries no run payload — the bus has a 1 MB cap — so "the
|
|
11
|
+
* data arrived over the socket" was never on offer, and every surface still reloads
|
|
12
|
+
* through its own loader.
|
|
13
|
+
*
|
|
14
|
+
* ONE SUBSCRIBER FOR THE WHOLE APPLICATION, and this is the part that is not a
|
|
15
|
+
* style preference. `talkback-js` deduplicates on `envelope.id` **across the whole
|
|
16
|
+
* client**, before it dispatches to a channel's listeners (`src/core/talkback.ts`,
|
|
17
|
+
* `seen.admit`). The bridge publishes every event twice — once to the action
|
|
18
|
+
* channel, once to the resource channel, which is contractual (ADR-0094) — so if
|
|
19
|
+
* the runs grid took the action channel and an open detail panel took the resource
|
|
20
|
+
* channel, only whichever arrived first would fire and the other would silently
|
|
21
|
+
* never refetch. Two components cannot each own a subscription to the same event.
|
|
22
|
+
* So the channels are owned here, once, and the surfaces watch the signals below.
|
|
23
|
+
*
|
|
24
|
+
* ONLY ACTION CHANNELS, for the same reason: subscribing to just one of the two
|
|
25
|
+
* channels an event lands on makes each event exactly one delivery, with nothing
|
|
26
|
+
* to lose the race against. A resource channel would buy a narrower filter that
|
|
27
|
+
* `lastRunEvent.topicId` already provides.
|
|
28
|
+
*
|
|
29
|
+
* ONE ACTION IS ONE CHANNEL. The action is the fourth topic segment and Centrifugo
|
|
30
|
+
* has no wildcards, so watching the five run actions costs five subscriptions, and
|
|
31
|
+
* the eleven topics the service emits cost eleven for the whole application. The
|
|
32
|
+
* three-segment form (`revenexx.integrations.run`) is the resource KIND channel,
|
|
33
|
+
* which the bridge never publishes to.
|
|
34
|
+
*
|
|
35
|
+
* SAFE WHEN REALTIME IS OFF, which is the production state in the cockpit until
|
|
36
|
+
* the edge is shown to pass a WebSocket upgrade (PE-382 T0.2). With no
|
|
37
|
+
* `talkbackHost` configured nothing is subscribed, `delivering` stays false, and
|
|
38
|
+
* every caller keeps the polling it had — as it does for a tenant that is
|
|
39
|
+
* configured but whose channels never carry anything.
|
|
40
|
+
*/
|
|
41
|
+
/** Mirrors `App\Enums\OutboxTopic` in `revenexx/integrations`. */
|
|
42
|
+
export declare const RUN_TOPIC = "revenexx.integrations.run";
|
|
43
|
+
export declare const WORKFLOW_TOPIC = "revenexx.integrations.workflow";
|
|
44
|
+
/**
|
|
45
|
+
* The bundle build. Its own entity rather than `workflow.build_started`, because
|
|
46
|
+
* the service's envelope allows no underscore in a topic segment and Console's
|
|
47
|
+
* manifest schema allows no hyphen — `build.started` is the only form that passes
|
|
48
|
+
* both. `topic_id` is still the WORKFLOW's id: a build has no row of its own.
|
|
49
|
+
*/
|
|
50
|
+
export declare const BUILD_TOPIC = "revenexx.integrations.build";
|
|
51
|
+
/** `run.cancelled` also carries a `terminated` status — the two collapse into one topic. */
|
|
52
|
+
export declare const RUN_ACTIONS: readonly ["created", "started", "finished", "failed", "cancelled"];
|
|
53
|
+
/**
|
|
54
|
+
* There is no `run.deleted`. Runs cascade with their workflow inside Postgres
|
|
55
|
+
* without firing model events, which is why `workflow.deleted` carries
|
|
56
|
+
* `cascades_runs: true` instead.
|
|
57
|
+
*/
|
|
58
|
+
export declare const WORKFLOW_ACTIONS: readonly ["created", "updated", "deleted"];
|
|
59
|
+
/**
|
|
60
|
+
* `started` is emitted per queue ATTEMPT, and the job has three: a failing build
|
|
61
|
+
* sends started/failed up to three times, with `data.attempt` (1-based) as the
|
|
62
|
+
* only way to tell a final failure from one that is about to be retried.
|
|
63
|
+
*/
|
|
64
|
+
export declare const BUILD_ACTIONS: readonly ["started", "succeeded", "failed"];
|
|
65
|
+
/** What a surface needs off an envelope. A structural subset of talkback-js's `Envelope`. */
|
|
66
|
+
export interface RealtimeEvent {
|
|
67
|
+
/** `evt_<ulid>`, the client's deduplication key. Carried for logging. */
|
|
68
|
+
id: string;
|
|
69
|
+
/** The fourth topic segment: `finished`, `deleted`, … */
|
|
70
|
+
action: string;
|
|
71
|
+
/** The run's or workflow's primary key, as a string. Never a number — see OutboxEnvelope. */
|
|
72
|
+
topicId: string | null;
|
|
73
|
+
/** The event's `data` map, e.g. `cascades_runs` on `workflow.deleted`. */
|
|
74
|
+
data: Record<string, unknown>;
|
|
75
|
+
}
|
|
76
|
+
export interface IntegrationsRealtime {
|
|
77
|
+
/**
|
|
78
|
+
* Whether this connection has actually reported something, and therefore
|
|
79
|
+
* whether a poll may take the long budget (`pollBudget.ts`).
|
|
80
|
+
*
|
|
81
|
+
* IT COUNTS DELIVERIES, NOT CONFIGURATION, and that is the whole reason it is
|
|
82
|
+
* not called `live`. Being subscribed is no evidence of anything: a channel
|
|
83
|
+
* resolves from the LOCAL subscription, and a tenant whose Console event
|
|
84
|
+
* catalogue does not mark these topics `channel: true` holds eleven channels
|
|
85
|
+
* that will never carry a byte (PE-375). Spending that state as a delivery
|
|
86
|
+
* signal would thin every run surface's refresh by ten with nothing arriving to
|
|
87
|
+
* make up for it — ten times worse than before any of this existed, silently.
|
|
88
|
+
* So the budget is only thinned once something has really been delivered.
|
|
89
|
+
*
|
|
90
|
+
* What it still cannot say is whether delivery is *continuing*: a socket that
|
|
91
|
+
* dies quietly after one event keeps reading true, because the per-channel
|
|
92
|
+
* confirmation that would settle it is not passed through the packages between
|
|
93
|
+
* Centrifugo and here (`docs/realtime.md`). That is why the poll backs off to a
|
|
94
|
+
* slow safety interval rather than stopping.
|
|
95
|
+
*/
|
|
96
|
+
delivering: ComputedRef<boolean>;
|
|
97
|
+
/** Bumped on every run event. Watch it to refetch a run list. */
|
|
98
|
+
runTick: Readonly<Ref<number>>;
|
|
99
|
+
/** Bumped on every workflow event. */
|
|
100
|
+
workflowTick: Readonly<Ref<number>>;
|
|
101
|
+
/**
|
|
102
|
+
* Bumped on every bundle-build event.
|
|
103
|
+
*
|
|
104
|
+
* Kept apart from `workflowTick` rather than folded into it: a build is the one
|
|
105
|
+
* workflow change that happens WITHOUT anybody editing the workflow, and it can
|
|
106
|
+
* fire six times for a single save (three attempts × started/failed). The runs
|
|
107
|
+
* grid watches `workflowTick` to catch a cascade-delete and has no business
|
|
108
|
+
* reloading for build progress.
|
|
109
|
+
*/
|
|
110
|
+
buildTick: Readonly<Ref<number>>;
|
|
111
|
+
/** The last run event, for a surface that only cares about one run's id. */
|
|
112
|
+
lastRunEvent: Readonly<Ref<RealtimeEvent | null>>;
|
|
113
|
+
lastWorkflowEvent: Readonly<Ref<RealtimeEvent | null>>;
|
|
114
|
+
/** The last build event. `topicId` is the workflow it belongs to. */
|
|
115
|
+
lastBuildEvent: Readonly<Ref<RealtimeEvent | null>>;
|
|
116
|
+
/** The subscribed channel names, for diagnostics. */
|
|
117
|
+
channels: ComputedRef<string[]>;
|
|
118
|
+
}
|
|
119
|
+
/** The shape a handler receives. Talkback's `Envelope` is assignable to it. */
|
|
120
|
+
export interface EnvelopeLike {
|
|
121
|
+
id?: unknown;
|
|
122
|
+
topic?: unknown;
|
|
123
|
+
topic_id?: unknown;
|
|
124
|
+
data?: unknown;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Narrows a publication to the fields a surface acts on.
|
|
128
|
+
*
|
|
129
|
+
* Everything is read defensively rather than cast. The envelope crosses four
|
|
130
|
+
* services to get here (`OutboxEmitter` → the relay → NATS → the bridge), and a
|
|
131
|
+
* surface that threw on an unexpected shape would take the page down over an event
|
|
132
|
+
* it could simply have ignored.
|
|
133
|
+
*
|
|
134
|
+
* `topic_id` is stringified on purpose: it is a string on the wire — an 18-digit id
|
|
135
|
+
* loses precision as a float64 above 2^53 — and `OutboxEnvelope` is careful about
|
|
136
|
+
* that, so nothing here should be the place that turns it back into a number.
|
|
137
|
+
*/
|
|
138
|
+
export declare function toRealtimeEvent(envelope: EnvelopeLike): RealtimeEvent;
|
|
139
|
+
/**
|
|
140
|
+
* The workflow a run or build event belongs to, or null.
|
|
141
|
+
*
|
|
142
|
+
* `WorkflowRunEventObserver`'s payload carries `workflow_id` beside `run_id`, which
|
|
143
|
+
* is what lets a workflow-scoped surface ignore every other workflow's runs — in a
|
|
144
|
+
* busy tenant that is the difference between one refetch and a refetch per run in
|
|
145
|
+
* the account. Null means "cannot tell", and a caller should refetch rather than
|
|
146
|
+
* assume the event was not for it.
|
|
147
|
+
*/
|
|
148
|
+
export declare function workflowIdOf(event: RealtimeEvent | null): string | null;
|
|
149
|
+
export declare function useIntegrationsRealtime(): IntegrationsRealtime;
|