@voyantjs/workflows-react 0.106.0 → 0.107.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +1 -0
- package/dist/components/common.d.ts +30 -0
- package/dist/components/common.d.ts.map +1 -0
- package/dist/components/common.js +108 -0
- package/dist/components/workflow-run-actions.d.ts +7 -0
- package/dist/components/workflow-run-actions.d.ts.map +1 -0
- package/dist/components/workflow-run-actions.js +72 -0
- package/dist/components/workflow-run-detail-page.d.ts +10 -0
- package/dist/components/workflow-run-detail-page.d.ts.map +1 -0
- package/dist/components/workflow-run-detail-page.js +96 -0
- package/dist/components/workflow-runs-filters.d.ts +32 -0
- package/dist/components/workflow-runs-filters.d.ts.map +1 -0
- package/dist/components/workflow-runs-filters.js +97 -0
- package/dist/components/workflow-runs-page.d.ts +12 -0
- package/dist/components/workflow-runs-page.d.ts.map +1 -0
- package/dist/components/workflow-runs-page.js +132 -0
- package/dist/components/workflow-schedules-page.d.ts +21 -0
- package/dist/components/workflow-schedules-page.d.ts.map +1 -0
- package/dist/components/workflow-schedules-page.js +144 -0
- package/dist/i18n/en.d.ts +4 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +135 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/messages.d.ts +125 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +26 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +44 -0
- package/dist/i18n/ro.d.ts +4 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +137 -0
- package/dist/schedules-client.d.ts +2 -0
- package/dist/schedules-client.d.ts.map +1 -0
- package/dist/schedules-client.js +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/ui.d.ts +9 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +6 -0
- package/package.json +69 -21
- package/src/client.ts +4 -0
- package/src/components/common.tsx +182 -0
- package/src/components/workflow-run-actions.tsx +160 -0
- package/src/components/workflow-run-detail-page.tsx +393 -0
- package/src/components/workflow-runs-filters.tsx +349 -0
- package/src/components/workflow-runs-page.tsx +357 -0
- package/src/components/workflow-schedules-page.tsx +398 -0
- package/src/i18n/en.ts +142 -0
- package/src/i18n/index.ts +26 -0
- package/src/i18n/messages.ts +125 -0
- package/src/i18n/provider.tsx +96 -0
- package/src/i18n/ro.ts +144 -0
- package/src/schedules-client.ts +8 -0
- package/src/styles.css +11 -0
- package/src/types.ts +14 -0
- package/src/ui.ts +63 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
createLocaleFormatters,
|
|
5
|
+
createPackageMessagesContext,
|
|
6
|
+
type LocaleMessageDefinitions,
|
|
7
|
+
type LocaleMessageOverrides,
|
|
8
|
+
type PackageI18nValue,
|
|
9
|
+
resolvePackageMessages,
|
|
10
|
+
} from "@voyantjs/i18n"
|
|
11
|
+
import type { ReactNode } from "react"
|
|
12
|
+
|
|
13
|
+
import { workflowRunsUiEn } from "./en.js"
|
|
14
|
+
import type { WorkflowRunsUiMessages } from "./messages.js"
|
|
15
|
+
import { workflowRunsUiRo } from "./ro.js"
|
|
16
|
+
|
|
17
|
+
const fallbackLocale = "en"
|
|
18
|
+
|
|
19
|
+
export const workflowRunsUiMessageDefinitions = {
|
|
20
|
+
en: workflowRunsUiEn,
|
|
21
|
+
ro: workflowRunsUiRo,
|
|
22
|
+
} satisfies LocaleMessageDefinitions<WorkflowRunsUiMessages>
|
|
23
|
+
|
|
24
|
+
export type WorkflowRunsUiMessageOverrides = LocaleMessageOverrides<WorkflowRunsUiMessages>
|
|
25
|
+
|
|
26
|
+
const workflowRunsUiContext =
|
|
27
|
+
createPackageMessagesContext<WorkflowRunsUiMessages>("WorkflowRunsUiMessages")
|
|
28
|
+
|
|
29
|
+
const defaultWorkflowRunsUiI18n: PackageI18nValue<WorkflowRunsUiMessages> = {
|
|
30
|
+
messages: workflowRunsUiEn,
|
|
31
|
+
...createLocaleFormatters(fallbackLocale),
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function resolveWorkflowRunsUiMessages({
|
|
35
|
+
locale,
|
|
36
|
+
overrides,
|
|
37
|
+
}: {
|
|
38
|
+
locale: string | null | undefined
|
|
39
|
+
overrides?: WorkflowRunsUiMessageOverrides | null
|
|
40
|
+
}) {
|
|
41
|
+
return resolvePackageMessages({
|
|
42
|
+
definitions: workflowRunsUiMessageDefinitions,
|
|
43
|
+
fallbackLocale,
|
|
44
|
+
locale,
|
|
45
|
+
overrides,
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function getWorkflowRunsUiI18n({
|
|
50
|
+
locale,
|
|
51
|
+
overrides,
|
|
52
|
+
}: {
|
|
53
|
+
locale?: string | null | undefined
|
|
54
|
+
overrides?: WorkflowRunsUiMessageOverrides | null
|
|
55
|
+
}): PackageI18nValue<WorkflowRunsUiMessages> {
|
|
56
|
+
const resolvedLocale = locale ?? fallbackLocale
|
|
57
|
+
return {
|
|
58
|
+
messages: resolveWorkflowRunsUiMessages({
|
|
59
|
+
locale: resolvedLocale,
|
|
60
|
+
overrides,
|
|
61
|
+
}),
|
|
62
|
+
...createLocaleFormatters(resolvedLocale),
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function WorkflowRunsUiMessagesProvider({
|
|
67
|
+
children,
|
|
68
|
+
locale,
|
|
69
|
+
overrides,
|
|
70
|
+
}: {
|
|
71
|
+
children: ReactNode
|
|
72
|
+
locale: string | null | undefined
|
|
73
|
+
overrides?: WorkflowRunsUiMessageOverrides | null
|
|
74
|
+
}) {
|
|
75
|
+
return (
|
|
76
|
+
<workflowRunsUiContext.ResolvedMessagesProvider
|
|
77
|
+
definitions={workflowRunsUiMessageDefinitions}
|
|
78
|
+
fallbackLocale={fallbackLocale}
|
|
79
|
+
locale={locale}
|
|
80
|
+
overrides={overrides}
|
|
81
|
+
>
|
|
82
|
+
{children}
|
|
83
|
+
</workflowRunsUiContext.ResolvedMessagesProvider>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const useWorkflowRunsUiI18n = workflowRunsUiContext.useI18n
|
|
88
|
+
export const useWorkflowRunsUiMessages = workflowRunsUiContext.useMessages
|
|
89
|
+
|
|
90
|
+
export function useWorkflowRunsUiI18nOrDefault() {
|
|
91
|
+
return workflowRunsUiContext.useOptionalI18n() ?? defaultWorkflowRunsUiI18n
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function useWorkflowRunsUiMessagesOrDefault() {
|
|
95
|
+
return useWorkflowRunsUiI18nOrDefault().messages
|
|
96
|
+
}
|
package/src/i18n/ro.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { WorkflowRunsUiMessages } from "./messages.js"
|
|
2
|
+
|
|
3
|
+
export const workflowRunsUiRo: WorkflowRunsUiMessages = {
|
|
4
|
+
page: {
|
|
5
|
+
title: "Rulari workflow",
|
|
6
|
+
subtitle: "Executii recente si pasi inregistrati.",
|
|
7
|
+
filterTitle: "Filtru",
|
|
8
|
+
workflowLabel: "Workflow",
|
|
9
|
+
workflowPlaceholder: "checkout-finalize",
|
|
10
|
+
workflowEmpty: "Nu exista workflow-uri in rularile vizibile.",
|
|
11
|
+
searchLabel: "Cautare",
|
|
12
|
+
searchPlaceholder: "Corelatie, eticheta, eroare, input...",
|
|
13
|
+
statusLabel: "Status",
|
|
14
|
+
tagLabel: "Eticheta",
|
|
15
|
+
tagPlaceholder: "bookingId:bk_...",
|
|
16
|
+
tagEmpty: "Nu exista etichete in rularile vizibile.",
|
|
17
|
+
addTag: "Adauga",
|
|
18
|
+
removeTag: "Sterge eticheta",
|
|
19
|
+
timeRangeLabel: "Pornit",
|
|
20
|
+
live: "Live",
|
|
21
|
+
clearFilters: "Curata",
|
|
22
|
+
anyStatus: "Oricare",
|
|
23
|
+
empty: "Nu exista rulari.",
|
|
24
|
+
selectPrompt: "Alege o rulare din lista pentru a vedea pasii si payload-urile.",
|
|
25
|
+
loading: "Se incarca...",
|
|
26
|
+
loadError: "Rularile workflow nu au putut fi incarcate.",
|
|
27
|
+
runCount: (count) => `${count} ${count === 1 ? "rulare" : "rulari"}`,
|
|
28
|
+
filteredRunCount: (filtered, total) =>
|
|
29
|
+
filtered === total
|
|
30
|
+
? `${total} ${total === 1 ? "rulare" : "rulari"}`
|
|
31
|
+
: `${filtered}/${total} rulari`,
|
|
32
|
+
timeRanges: {
|
|
33
|
+
"15m": "15m",
|
|
34
|
+
"1h": "1h",
|
|
35
|
+
"24h": "24h",
|
|
36
|
+
"7d": "7z",
|
|
37
|
+
all: "Toate",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
status: {
|
|
41
|
+
running: "In rulare",
|
|
42
|
+
succeeded: "Reusita",
|
|
43
|
+
failed: "Esuata",
|
|
44
|
+
cancelled: "Anulata",
|
|
45
|
+
},
|
|
46
|
+
stepStatus: {
|
|
47
|
+
running: "In rulare",
|
|
48
|
+
succeeded: "Reusit",
|
|
49
|
+
failed: "Esuat",
|
|
50
|
+
skipped: "Sarit",
|
|
51
|
+
compensated: "Compensat",
|
|
52
|
+
},
|
|
53
|
+
detail: {
|
|
54
|
+
trigger: "Declansator",
|
|
55
|
+
correlation: "Corelatie",
|
|
56
|
+
parent: "Parinte",
|
|
57
|
+
triggeredBy: "Declansat de",
|
|
58
|
+
tags: "Etichete",
|
|
59
|
+
started: "Pornit",
|
|
60
|
+
finished: "Finalizat",
|
|
61
|
+
steps: "Pasi",
|
|
62
|
+
noSteps: "Nu exista pasi inregistrati.",
|
|
63
|
+
input: "Input",
|
|
64
|
+
output: "Output",
|
|
65
|
+
result: "Rezultat",
|
|
66
|
+
runError: "Eroare rulare",
|
|
67
|
+
stackTrace: "Stack trace",
|
|
68
|
+
copy: "Copiaza",
|
|
69
|
+
copied: "Copiat",
|
|
70
|
+
code: "cod",
|
|
71
|
+
step: "pas",
|
|
72
|
+
reruns: "Reluari ale acestei rulari",
|
|
73
|
+
resumedAt: (step) => `reluat @ ${step}`,
|
|
74
|
+
durationUnavailable: "-",
|
|
75
|
+
},
|
|
76
|
+
actions: {
|
|
77
|
+
rerun: "Ruleaza din nou",
|
|
78
|
+
rerunBusy: "Se reia",
|
|
79
|
+
resume: "Reia de la pasul esuat",
|
|
80
|
+
resumeBusy: "Se reia",
|
|
81
|
+
waitForCompletion: "Asteapta finalizarea acestei rulari inainte de reluare.",
|
|
82
|
+
rerunDescription: "Porneste o rulare noua cu acelasi input inregistrat.",
|
|
83
|
+
resumeDescription: "Sare pasii deja finalizati si reincearca de la pasul esuat.",
|
|
84
|
+
resumeUnavailable: "Reluarea este disponibila doar pentru rulari esuate.",
|
|
85
|
+
actionFailed: "Actiunea a esuat.",
|
|
86
|
+
rerunStarted: "Reluarea a pornit; se deschide rularea noua.",
|
|
87
|
+
resumeStarted: (step) => `Reluat de la pasul "${step}"; se deschide rularea noua.`,
|
|
88
|
+
runnerMissing:
|
|
89
|
+
"Nu exista runner inregistrat pentru acest workflow. Inregistreaza un WorkflowRunner pentru reluare.",
|
|
90
|
+
rerunBlocked: "Reluarea a fost blocata de regula de siguranta a runnerului.",
|
|
91
|
+
incompletePriorStep: "Nu se poate relua deoarece un pas anterior este incomplet.",
|
|
92
|
+
confirmTitle: "Confirma reluarea",
|
|
93
|
+
confirmBody:
|
|
94
|
+
"Acest workflow are efecte secundare care se executa din nou la reluare. Rularea noua porneste de la primul pas cu acelasi input.",
|
|
95
|
+
confirmTip:
|
|
96
|
+
"Daca rularea initiala a esuat la mijloc, foloseste reluarea de la pasul esuat pentru a sari lucrul finalizat.",
|
|
97
|
+
cancel: "Anuleaza",
|
|
98
|
+
rerunAnyway: "Ruleaza oricum",
|
|
99
|
+
},
|
|
100
|
+
format: {
|
|
101
|
+
relativeNow: "acum",
|
|
102
|
+
},
|
|
103
|
+
schedules: {
|
|
104
|
+
title: "Programari workflow",
|
|
105
|
+
subtitle: "Programari cron, interval si one-shot inregistrate.",
|
|
106
|
+
environmentLabel: "Mediu",
|
|
107
|
+
versionLabel: "Manifest",
|
|
108
|
+
workflowColumn: "Workflow",
|
|
109
|
+
scheduleColumn: "Programare",
|
|
110
|
+
nextRunColumn: "Urmatoarea rulare",
|
|
111
|
+
lastRunColumn: "Ultima rulare",
|
|
112
|
+
statusColumn: "Status",
|
|
113
|
+
actionsColumn: "Actiuni",
|
|
114
|
+
enabled: "Activ",
|
|
115
|
+
disabledByRegistration: "Dezactivat",
|
|
116
|
+
disabledByEnvironment: "Dezactivat (filtrat dupa mediu)",
|
|
117
|
+
disabledByEnvFlag: "Dezactivat (flag de mediu)",
|
|
118
|
+
envFlagOff: "Programarile sunt dezactivate de flag-ul de mediu — nimic nu va rula.",
|
|
119
|
+
envFlagOn: "Programarile sunt active.",
|
|
120
|
+
eventDriven: "declansat de eveniment",
|
|
121
|
+
cron: (expr, timezone) => `${expr} (${timezone})`,
|
|
122
|
+
every: (interval) => `la fiecare ${interval}`,
|
|
123
|
+
at: (timestamp) => `la ${timestamp}`,
|
|
124
|
+
triggerNow: "Declanseaza acum",
|
|
125
|
+
triggering: "Se declanseaza...",
|
|
126
|
+
triggerSuccess: "Rulare pornita.",
|
|
127
|
+
triggerFailed: "Declansarea a esuat.",
|
|
128
|
+
refresh: "Reincarca",
|
|
129
|
+
loading: "Se incarca programarile...",
|
|
130
|
+
loadError: "Programarile nu au putut fi incarcate.",
|
|
131
|
+
empty: "Nu exista programari inregistrate pentru acest mediu.",
|
|
132
|
+
inFuture: (relative) => `in ${relative}`,
|
|
133
|
+
inPast: (relative) => `acum ${relative}`,
|
|
134
|
+
notScheduled: "—",
|
|
135
|
+
lastRunSucceeded: (relative) => `reusita acum ${relative}`,
|
|
136
|
+
lastRunFailed: (relative) => `esuata acum ${relative}`,
|
|
137
|
+
lastRunRunning: "in rulare",
|
|
138
|
+
lastRunCancelled: (relative) => `anulata acum ${relative}`,
|
|
139
|
+
lastFireRecorded: (relative) => `declansata acum ${relative}`,
|
|
140
|
+
lastRunNone: "nu a rulat niciodata",
|
|
141
|
+
},
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export const workflowsUiRo = workflowRunsUiRo
|
package/src/styles.css
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* Tailwind v4 source-detection helper.
|
|
2
|
+
*
|
|
3
|
+
* Templates that consume this package should `@import` this CSS so Tailwind
|
|
4
|
+
* scans these component files for utility classes:
|
|
5
|
+
*
|
|
6
|
+
* @import "@voyantjs/workflows-react/styles.css";
|
|
7
|
+
*
|
|
8
|
+
* Without it, classes that only appear inside this package won't be compiled
|
|
9
|
+
* into the final bundle.
|
|
10
|
+
*/
|
|
11
|
+
@source "./components/**/*.{ts,tsx}";
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
ListWorkflowRunsQuery,
|
|
3
|
+
ListWorkflowRunsResponse,
|
|
4
|
+
WorkflowRun,
|
|
5
|
+
WorkflowRunActionError,
|
|
6
|
+
WorkflowRunActionResponse,
|
|
7
|
+
WorkflowRunActionResult,
|
|
8
|
+
WorkflowRunDetailResponse,
|
|
9
|
+
WorkflowRunErrorPayload,
|
|
10
|
+
WorkflowRunStatus,
|
|
11
|
+
WorkflowRunStep,
|
|
12
|
+
WorkflowRunStepStatus,
|
|
13
|
+
WorkflowRunsApi,
|
|
14
|
+
} from "./workflow-runs-client.js"
|
package/src/ui.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export type { WorkflowRunsApiClientOptions } from "./client.js"
|
|
2
|
+
export { createWorkflowRunsApiClient } from "./client.js"
|
|
3
|
+
export {
|
|
4
|
+
WorkflowRunDetailPage,
|
|
5
|
+
type WorkflowRunDetailPageProps,
|
|
6
|
+
} from "./components/workflow-run-detail-page.js"
|
|
7
|
+
export {
|
|
8
|
+
WorkflowRunsPage,
|
|
9
|
+
type WorkflowRunsPageProps,
|
|
10
|
+
WorkflowRunsPageSkeleton,
|
|
11
|
+
} from "./components/workflow-runs-page.js"
|
|
12
|
+
export {
|
|
13
|
+
WorkflowSchedulesPage,
|
|
14
|
+
type WorkflowSchedulesPageProps,
|
|
15
|
+
} from "./components/workflow-schedules-page.js"
|
|
16
|
+
export {
|
|
17
|
+
getWorkflowRunsUiI18n,
|
|
18
|
+
getWorkflowRunsUiI18n as getWorkflowsUiI18n,
|
|
19
|
+
resolveWorkflowRunsUiMessages,
|
|
20
|
+
resolveWorkflowRunsUiMessages as resolveWorkflowsUiMessages,
|
|
21
|
+
useWorkflowRunsUiI18n,
|
|
22
|
+
useWorkflowRunsUiI18n as useWorkflowsUiI18n,
|
|
23
|
+
useWorkflowRunsUiI18nOrDefault,
|
|
24
|
+
useWorkflowRunsUiI18nOrDefault as useWorkflowsUiI18nOrDefault,
|
|
25
|
+
useWorkflowRunsUiMessages,
|
|
26
|
+
useWorkflowRunsUiMessages as useWorkflowsUiMessages,
|
|
27
|
+
useWorkflowRunsUiMessagesOrDefault,
|
|
28
|
+
useWorkflowRunsUiMessagesOrDefault as useWorkflowsUiMessagesOrDefault,
|
|
29
|
+
type WorkflowRunsUiMessageOverrides,
|
|
30
|
+
type WorkflowRunsUiMessageOverrides as WorkflowsUiMessageOverrides,
|
|
31
|
+
type WorkflowRunsUiMessages,
|
|
32
|
+
type WorkflowRunsUiMessages as WorkflowsUiMessages,
|
|
33
|
+
WorkflowRunsUiMessagesProvider,
|
|
34
|
+
WorkflowRunsUiMessagesProvider as WorkflowsUiMessagesProvider,
|
|
35
|
+
workflowRunsUiEn,
|
|
36
|
+
workflowRunsUiEn as workflowsUiEn,
|
|
37
|
+
workflowRunsUiMessageDefinitions,
|
|
38
|
+
workflowRunsUiMessageDefinitions as workflowsUiMessageDefinitions,
|
|
39
|
+
workflowRunsUiRo,
|
|
40
|
+
workflowRunsUiRo as workflowsUiRo,
|
|
41
|
+
} from "./i18n/index.js"
|
|
42
|
+
export {
|
|
43
|
+
createWorkflowSchedulesApiClient,
|
|
44
|
+
type ListWorkflowSchedulesResponse,
|
|
45
|
+
type WorkflowScheduleDecl,
|
|
46
|
+
type WorkflowScheduleSummary,
|
|
47
|
+
type WorkflowSchedulesApi,
|
|
48
|
+
type WorkflowSchedulesApiClientOptions,
|
|
49
|
+
} from "./schedules-client.js"
|
|
50
|
+
export type {
|
|
51
|
+
ListWorkflowRunsQuery,
|
|
52
|
+
ListWorkflowRunsResponse,
|
|
53
|
+
WorkflowRun,
|
|
54
|
+
WorkflowRunActionError,
|
|
55
|
+
WorkflowRunActionResponse,
|
|
56
|
+
WorkflowRunActionResult,
|
|
57
|
+
WorkflowRunDetailResponse,
|
|
58
|
+
WorkflowRunErrorPayload,
|
|
59
|
+
WorkflowRunStatus,
|
|
60
|
+
WorkflowRunStep,
|
|
61
|
+
WorkflowRunStepStatus,
|
|
62
|
+
WorkflowRunsApi,
|
|
63
|
+
} from "./types.js"
|