@burdenoff/microfe-adaptercloud 2026.825.2 → 2026.825.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/adaptercloud/pages/connections/ConnectionDetailPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiCH,wBAAgB,oBAAoB,gCAoUnC"}
1
+ {"version":3,"file":"ConnectionDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/adaptercloud/pages/connections/ConnectionDetailPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAqCH,wBAAgB,oBAAoB,gCA2VnC"}
@@ -6,192 +6,204 @@ import { DataState as c } from "../../components/DataState.js";
6
6
  import { useConnection as l, useDisableConnection as u, useSetConnectionStatus as d, useStartSyncRun as f } from "../../hooks/useAdapterCloudApi.js";
7
7
  import { formatDate as p } from "../../utils/formatters.js";
8
8
  import { ConfirmDialog as m } from "../../components/ConfirmDialog.js";
9
- import { canStartConnectionSync as h } from "./connectionSync.js";
10
- import { useCallback as g, useState as _ } from "react";
11
- import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
- import { ArrowLeft as y, Ban as b, Loader2 as x, Pencil as S, Play as C, RefreshCw as w, Server as T } from "lucide-react";
13
- import { useParams as E } from "react-router";
14
- import { jsx as D, jsxs as O } from "react/jsx-runtime";
15
- import { GlassCard as k } from "@burdenoff/fe-libs/ui";
9
+ import { canStartConnectionSync as h, canStartConnectionSyncKind as g, isConnectionSyncKindExecutable as _ } from "./connectionSync.js";
10
+ import { useCallback as v, useState as y } from "react";
11
+ import { useI18n as b } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
+ import { ArrowLeft as x, Ban as S, Loader2 as C, Pencil as w, Play as T, RefreshCw as E, Server as D } from "lucide-react";
13
+ import { useParams as O } from "react-router";
14
+ import { jsx as k, jsxs as A } from "react/jsx-runtime";
15
+ import { GlassCard as j } from "@burdenoff/fe-libs/ui";
16
16
  //#region src/adaptercloud/pages/connections/ConnectionDetailPage.tsx
17
- var A = [
17
+ var M = [
18
18
  "CONNECTED",
19
19
  "DEGRADED",
20
20
  "ERROR",
21
21
  "PENDING"
22
- ], j = [
22
+ ], N = [
23
23
  "DISCOVERY",
24
24
  "RECONCILE",
25
25
  "COST_INGEST",
26
26
  "FULL"
27
27
  ];
28
- function M() {
29
- let { id: M } = E(), { navigateTo: N } = e(), { t: P } = v(), F = g((e, t) => {
30
- let n = P(e);
28
+ function P() {
29
+ let { id: P } = O(), { navigateTo: F } = e(), { t: I } = b(), L = v((e, t) => {
30
+ let n = I(e);
31
31
  return n === e ? t : n;
32
- }, [P]), I = l(M), L = d(), R = u(), z = f(), B = I.data, V = B ? h(B.status) : !1, [H, U] = _(null), [W, G] = _(null), [K, q] = _(!1), J = g((e) => G(e instanceof Error ? e.message : "Action failed. Please try again."), []), Y = g((e) => {
33
- M && (G(null), L.mutate({
34
- id: M,
32
+ }, [I]), R = l(P), z = d(), B = u(), V = f(), H = R.data, U = H ? h(H.status) : !1, [W, G] = y(null), [K, q] = y(null), [J, Y] = y(!1), X = v((e) => q(e instanceof Error ? e.message : "Action failed. Please try again."), []), Z = v((e) => {
33
+ P && (q(null), z.mutate({
34
+ id: P,
35
35
  status: e
36
- }, { onError: J }));
36
+ }, { onError: X }));
37
37
  }, [
38
- M,
39
- L,
40
- J
41
- ]), X = g(() => {
42
- M && (G(null), R.mutate(M, {
43
- onSuccess: () => q(!1),
44
- onError: J
38
+ P,
39
+ z,
40
+ X
41
+ ]), Q = v(() => {
42
+ P && (q(null), B.mutate(P, {
43
+ onSuccess: () => Y(!1),
44
+ onError: X
45
45
  }));
46
46
  }, [
47
- M,
48
- R,
49
- J
50
- ]), Z = g((e) => {
51
- !M || !V || (G(null), U(e), z.mutate({
52
- connectionId: M,
47
+ P,
48
+ B,
49
+ X
50
+ ]), $ = v((e) => {
51
+ !P || !H || !g(H.status, e) || (q(null), G(e), V.mutate({
52
+ connectionId: P,
53
53
  kind: e
54
54
  }, {
55
55
  onSuccess: () => {
56
- U(null), N("/sync-runs");
56
+ G(null), F("/sync-runs");
57
57
  },
58
58
  onError: (e) => {
59
- U(null), J(e);
59
+ G(null), X(e);
60
60
  }
61
61
  }));
62
62
  }, [
63
- M,
63
+ P,
64
+ H,
64
65
  V,
65
- z,
66
- N,
67
- J
66
+ F,
67
+ X
68
68
  ]);
69
- return /* @__PURE__ */ O(t, {
70
- title: B?.name ?? F("adaptercloud.connections.detailTitle", "Connection"),
71
- description: B?.adapter?.name,
72
- actions: /* @__PURE__ */ O("div", {
69
+ return /* @__PURE__ */ A(t, {
70
+ title: H?.name ?? L("adaptercloud.connections.detailTitle", "Connection"),
71
+ description: H?.adapter?.name,
72
+ actions: /* @__PURE__ */ A("div", {
73
73
  className: "flex items-center gap-2",
74
- children: [/* @__PURE__ */ O("button", {
74
+ children: [/* @__PURE__ */ A("button", {
75
75
  type: "button",
76
- onClick: () => N("/connections"),
76
+ onClick: () => F("/connections"),
77
77
  className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
78
- children: [/* @__PURE__ */ D(y, { className: "h-4 w-4" }), F("adaptercloud.common.back", "Back")]
79
- }), B && /* @__PURE__ */ O("button", {
78
+ children: [/* @__PURE__ */ k(x, { className: "h-4 w-4" }), L("adaptercloud.common.back", "Back")]
79
+ }), H && /* @__PURE__ */ A("button", {
80
80
  type: "button",
81
- onClick: () => N(`/connections/${B.id}/edit`),
81
+ onClick: () => F(`/connections/${H.id}/edit`),
82
82
  className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
83
- children: [/* @__PURE__ */ D(S, { className: "h-4 w-4" }), F("adaptercloud.common.edit", "Edit")]
83
+ children: [/* @__PURE__ */ k(w, { className: "h-4 w-4" }), L("adaptercloud.common.edit", "Edit")]
84
84
  })]
85
85
  }),
86
- children: [/* @__PURE__ */ D(c, {
87
- isLoading: I.isLoading,
88
- isError: I.isError,
89
- isEmpty: !I.isLoading && !B,
90
- error: I.error,
91
- onRetry: () => void I.refetch(),
92
- emptyTitle: F("adaptercloud.connections.notFound", "Connection not found"),
93
- children: B && /* @__PURE__ */ O("div", {
86
+ children: [/* @__PURE__ */ k(c, {
87
+ isLoading: R.isLoading,
88
+ isError: R.isError,
89
+ isEmpty: !R.isLoading && !H,
90
+ error: R.error,
91
+ onRetry: () => void R.refetch(),
92
+ emptyTitle: L("adaptercloud.connections.notFound", "Connection not found"),
93
+ children: H && /* @__PURE__ */ A("div", {
94
94
  className: "space-y-6",
95
95
  children: [
96
- W && /* @__PURE__ */ D("p", {
96
+ K && /* @__PURE__ */ k("p", {
97
97
  role: "alert",
98
98
  "aria-live": "polite",
99
99
  className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
100
- children: W
100
+ children: K
101
101
  }),
102
- /* @__PURE__ */ O(k, {
102
+ /* @__PURE__ */ A(j, {
103
103
  className: "p-6",
104
104
  children: [
105
- /* @__PURE__ */ O("div", {
105
+ /* @__PURE__ */ A("div", {
106
106
  className: "mb-4 flex flex-wrap items-center gap-3",
107
- children: [/* @__PURE__ */ D(s, { status: B.status }), /* @__PURE__ */ D("span", {
107
+ children: [/* @__PURE__ */ k(s, { status: H.status }), /* @__PURE__ */ k("span", {
108
108
  className: "inline-flex items-center rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
109
- children: n[B.authMethod]
109
+ children: n[H.authMethod]
110
110
  })]
111
111
  }),
112
- /* @__PURE__ */ O("dl", {
112
+ /* @__PURE__ */ A("dl", {
113
113
  className: "grid grid-cols-2 gap-4 text-sm sm:grid-cols-4",
114
114
  children: [
115
- /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("dt", {
115
+ /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", {
116
116
  className: "text-text-secondary",
117
- children: F("adaptercloud.connections.region", "Region")
118
- }), /* @__PURE__ */ D("dd", {
117
+ children: L("adaptercloud.connections.region", "Region")
118
+ }), /* @__PURE__ */ k("dd", {
119
119
  className: "mt-0.5 font-medium text-text-primary",
120
- children: B.region ?? "—"
120
+ children: H.region ?? "—"
121
121
  })] }),
122
- /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("dt", {
122
+ /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", {
123
123
  className: "text-text-secondary",
124
- children: F("adaptercloud.connections.environment", "Environment")
125
- }), /* @__PURE__ */ D("dd", {
124
+ children: L("adaptercloud.connections.environment", "Environment")
125
+ }), /* @__PURE__ */ k("dd", {
126
126
  className: "mt-0.5 font-medium text-text-primary",
127
- children: B.environment ?? "—"
127
+ children: H.environment ?? "—"
128
128
  })] }),
129
- /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("dt", {
129
+ /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", {
130
130
  className: "text-text-secondary",
131
- children: F("adaptercloud.connections.resourceCount", "Resources")
132
- }), /* @__PURE__ */ D("dd", {
131
+ children: L("adaptercloud.connections.resourceCount", "Resources")
132
+ }), /* @__PURE__ */ k("dd", {
133
133
  className: "mt-0.5 font-medium tabular-nums text-text-primary",
134
- children: B.resourceCount
134
+ children: H.resourceCount
135
135
  })] }),
136
- /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("dt", {
136
+ /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", {
137
137
  className: "text-text-secondary",
138
- children: F("adaptercloud.connections.lastSynced", "Last synced")
139
- }), /* @__PURE__ */ D("dd", {
138
+ children: L("adaptercloud.connections.lastSynced", "Last synced")
139
+ }), /* @__PURE__ */ k("dd", {
140
140
  className: "mt-0.5 font-medium text-text-primary",
141
- children: B.lastSyncedAt ? p(B.lastSyncedAt) : "—"
141
+ children: H.lastSyncedAt ? p(H.lastSyncedAt) : "—"
142
142
  })] })
143
143
  ]
144
144
  }),
145
- B.lastError && /* @__PURE__ */ D("p", {
145
+ H.lastError && /* @__PURE__ */ k("p", {
146
146
  className: "mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
147
- children: B.lastError
147
+ children: H.lastError
148
148
  }),
149
- /* @__PURE__ */ O("div", {
149
+ /* @__PURE__ */ A("div", {
150
150
  className: "mt-5 border-t border-border-subtle pt-5",
151
- children: [/* @__PURE__ */ D("h3", {
151
+ children: [/* @__PURE__ */ k("h3", {
152
152
  className: "mb-3 text-sm font-semibold text-text-primary",
153
- children: F("adaptercloud.connections.setHealth", "Set health")
154
- }), /* @__PURE__ */ O("div", {
153
+ children: L("adaptercloud.connections.setHealth", "Set health")
154
+ }), /* @__PURE__ */ A("div", {
155
155
  className: "flex flex-wrap gap-2",
156
- children: [A.map((e) => /* @__PURE__ */ D("button", {
156
+ children: [M.map((e) => /* @__PURE__ */ k("button", {
157
157
  type: "button",
158
- disabled: L.isPending || B.status === e,
159
- onClick: () => Y(e),
158
+ disabled: z.isPending || H.status === e,
159
+ onClick: () => Z(e),
160
160
  className: "rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-40",
161
161
  children: r[e]
162
- }, e)), B.status !== "DISABLED" && /* @__PURE__ */ O("button", {
162
+ }, e)), H.status !== "DISABLED" && /* @__PURE__ */ A("button", {
163
163
  type: "button",
164
- disabled: R.isPending,
165
- onClick: () => q(!0),
164
+ disabled: B.isPending,
165
+ onClick: () => Y(!0),
166
166
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:opacity-40",
167
- children: [/* @__PURE__ */ D(b, { className: "h-3.5 w-3.5" }), F("adaptercloud.connections.disable", "Disable")]
167
+ children: [/* @__PURE__ */ k(S, { className: "h-3.5 w-3.5" }), L("adaptercloud.connections.disable", "Disable")]
168
168
  })]
169
169
  })]
170
170
  }),
171
- /* @__PURE__ */ O("div", {
171
+ /* @__PURE__ */ A("div", {
172
172
  className: "mt-5 border-t border-border-subtle pt-5",
173
173
  children: [
174
- /* @__PURE__ */ O("h3", {
174
+ /* @__PURE__ */ A("h3", {
175
175
  className: "mb-3 flex items-center gap-2 text-sm font-semibold text-text-primary",
176
- children: [/* @__PURE__ */ D(w, { className: "h-4 w-4" }), F("adaptercloud.connections.startSync", "Start a sync run")]
176
+ children: [/* @__PURE__ */ k(E, { className: "h-4 w-4" }), L("adaptercloud.connections.startSync", "Start a sync run")]
177
177
  }),
178
- !V && /* @__PURE__ */ D("p", {
178
+ !U && /* @__PURE__ */ k("p", {
179
179
  id: "disabled-connection-sync-help",
180
180
  className: "mb-3 text-sm text-text-secondary",
181
- children: F("adaptercloud.connections.disabledSyncHelp", "Sync runs are unavailable while this connection is disabled. Set its health to re-enable sync.")
181
+ children: L("adaptercloud.connections.disabledSyncHelp", "Sync runs are unavailable while this connection is disabled. Set its health to re-enable sync.")
182
+ }),
183
+ /* @__PURE__ */ k("p", {
184
+ id: "unsupported-sync-kind-help",
185
+ className: "mb-3 text-sm text-text-secondary",
186
+ children: L("adaptercloud.connections.syncModeAvailabilityHelp", "Discovery is executable today. Reconcile, Cost Ingest, and Full need distinct backend workers and are not available yet.")
182
187
  }),
183
- /* @__PURE__ */ D("div", {
188
+ /* @__PURE__ */ k("div", {
184
189
  className: "flex flex-wrap gap-2",
185
- children: j.map((e) => {
186
- let t = z.isPending && H === e;
187
- return /* @__PURE__ */ O("button", {
190
+ children: N.map((e) => {
191
+ let t = V.isPending && W === e, n = _(e);
192
+ return /* @__PURE__ */ A("button", {
188
193
  type: "button",
189
- disabled: z.isPending || !V,
190
- "aria-describedby": V ? void 0 : "disabled-connection-sync-help",
191
- title: V ? void 0 : F("adaptercloud.connections.disabledSyncTooltip", "Re-enable this connection before starting a sync run."),
192
- onClick: () => Z(e),
193
- className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent disabled:opacity-50",
194
- children: [t ? /* @__PURE__ */ D(x, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ D(C, { className: "h-4 w-4" }), o[e]]
194
+ disabled: V.isPending || !U || !n,
195
+ "aria-describedby": n ? U ? void 0 : "disabled-connection-sync-help" : "unsupported-sync-kind-help",
196
+ title: n ? U ? void 0 : L("adaptercloud.connections.disabledSyncTooltip", "Re-enable this connection before starting a sync run.") : L("adaptercloud.connections.unsupportedSyncModeTooltip", "This sync mode is not available yet because it needs a distinct backend worker."),
197
+ onClick: () => $(e),
198
+ className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50",
199
+ children: [
200
+ t ? /* @__PURE__ */ k(C, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ k(T, { className: "h-4 w-4" }),
201
+ o[e],
202
+ !n && /* @__PURE__ */ k("span", {
203
+ className: "rounded bg-bg-sunken px-1.5 py-0.5 text-[10px] font-normal text-text-secondary",
204
+ children: L("adaptercloud.connections.notAvailable", "Not available")
205
+ })
206
+ ]
195
207
  }, e);
196
208
  })
197
209
  })
@@ -199,75 +211,75 @@ function M() {
199
211
  })
200
212
  ]
201
213
  }),
202
- B.config != null && /* @__PURE__ */ O(k, {
214
+ H.config != null && /* @__PURE__ */ A(j, {
203
215
  className: "p-6",
204
- children: [/* @__PURE__ */ D("h3", {
216
+ children: [/* @__PURE__ */ k("h3", {
205
217
  className: "mb-3 text-sm font-semibold text-text-primary",
206
- children: F("adaptercloud.connections.config", "Configuration")
207
- }), /* @__PURE__ */ D("pre", {
218
+ children: L("adaptercloud.connections.config", "Configuration")
219
+ }), /* @__PURE__ */ k("pre", {
208
220
  className: "overflow-auto rounded-lg bg-bg-sunken p-4 text-xs text-text-secondary",
209
- children: JSON.stringify(B.config, null, 2)
221
+ children: JSON.stringify(H.config, null, 2)
210
222
  })]
211
223
  }),
212
- /* @__PURE__ */ O("section", { children: [/* @__PURE__ */ O("div", {
224
+ /* @__PURE__ */ A("section", { children: [/* @__PURE__ */ A("div", {
213
225
  className: "mb-3 flex items-center justify-between",
214
- children: [/* @__PURE__ */ D("h3", {
226
+ children: [/* @__PURE__ */ k("h3", {
215
227
  className: "text-base font-semibold text-text-primary",
216
- children: F("adaptercloud.connections.discoveredResources", "Discovered Resources")
217
- }), /* @__PURE__ */ D("button", {
228
+ children: L("adaptercloud.connections.discoveredResources", "Discovered Resources")
229
+ }), /* @__PURE__ */ k("button", {
218
230
  type: "button",
219
- onClick: () => N(`/resources?connectionId=${B.id}`),
231
+ onClick: () => F(`/resources?connectionId=${H.id}`),
220
232
  className: "text-sm font-medium text-accent-blue hover:underline",
221
- children: F("adaptercloud.common.viewAll", "View all")
233
+ children: L("adaptercloud.common.viewAll", "View all")
222
234
  })]
223
- }), B.resources && B.resources.length > 0 ? /* @__PURE__ */ D("div", {
235
+ }), H.resources && H.resources.length > 0 ? /* @__PURE__ */ k("div", {
224
236
  className: "divide-y divide-border rounded-xl border border-border-subtle bg-bg-surface",
225
- children: B.resources.slice(0, 10).map((e) => /* @__PURE__ */ O("button", {
237
+ children: H.resources.slice(0, 10).map((e) => /* @__PURE__ */ A("button", {
226
238
  type: "button",
227
- onClick: () => N(`/resources/${e.id}`),
239
+ onClick: () => F(`/resources/${e.id}`),
228
240
  className: "flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-accent/50",
229
241
  children: [
230
- /* @__PURE__ */ D(T, { className: "h-4 w-4 shrink-0 text-text-secondary" }),
231
- /* @__PURE__ */ O("div", {
242
+ /* @__PURE__ */ k(D, { className: "h-4 w-4 shrink-0 text-text-secondary" }),
243
+ /* @__PURE__ */ A("div", {
232
244
  className: "min-w-0 flex-1",
233
- children: [/* @__PURE__ */ D("p", {
245
+ children: [/* @__PURE__ */ k("p", {
234
246
  className: "truncate text-sm font-medium text-text-primary",
235
247
  children: e.name
236
- }), /* @__PURE__ */ O("p", {
248
+ }), /* @__PURE__ */ A("p", {
237
249
  className: "mt-0.5 text-xs text-text-secondary",
238
250
  children: [e.resourceType, e.region ? ` · ${e.region}` : ""]
239
251
  })]
240
252
  }),
241
- /* @__PURE__ */ D("span", {
253
+ /* @__PURE__ */ k("span", {
242
254
  className: "hidden text-xs text-text-secondary sm:inline",
243
255
  children: i(e.monthlyCost)
244
256
  }),
245
- /* @__PURE__ */ D(s, {
257
+ /* @__PURE__ */ k(s, {
246
258
  status: e.state,
247
259
  label: a[e.state]
248
260
  })
249
261
  ]
250
262
  }, e.id))
251
- }) : /* @__PURE__ */ D("p", {
263
+ }) : /* @__PURE__ */ k("p", {
252
264
  className: "rounded-xl border border-border-subtle bg-bg-surface px-4 py-6 text-center text-sm text-text-secondary",
253
- children: F("adaptercloud.connections.noResources", "No resources discovered yet. Start a discovery sync run.")
265
+ children: L("adaptercloud.connections.noResources", "No resources discovered yet. Start a discovery sync run.")
254
266
  })] })
255
267
  ]
256
268
  })
257
- }), /* @__PURE__ */ D(m, {
258
- open: K,
259
- onOpenChange: q,
260
- title: F("adaptercloud.connections.disableTitle", "Disable this connection?"),
261
- description: F("adaptercloud.connections.disablePrompt", "Disabling stops discovery and sync runs against this target. You can re-enable it later by setting its health."),
262
- confirmLabel: F("adaptercloud.connections.disable", "Disable"),
263
- cancelLabel: F("adaptercloud.common.cancel", "Cancel"),
264
- onConfirm: X,
265
- isPending: R.isPending,
269
+ }), /* @__PURE__ */ k(m, {
270
+ open: J,
271
+ onOpenChange: Y,
272
+ title: L("adaptercloud.connections.disableTitle", "Disable this connection?"),
273
+ description: L("adaptercloud.connections.disablePrompt", "Disabling stops discovery and sync runs against this target. You can re-enable it later by setting its health."),
274
+ confirmLabel: L("adaptercloud.connections.disable", "Disable"),
275
+ cancelLabel: L("adaptercloud.common.cancel", "Cancel"),
276
+ onConfirm: Q,
277
+ isPending: B.isPending,
266
278
  tone: "danger"
267
279
  })]
268
280
  });
269
281
  }
270
282
  //#endregion
271
- export { M as ConnectionDetailPage };
283
+ export { P as ConnectionDetailPage };
272
284
 
273
285
  //# sourceMappingURL=ConnectionDetailPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionDetailPage.js","names":[],"sources":["../../../../src/adaptercloud/pages/connections/ConnectionDetailPage.tsx"],"sourcesContent":["/**\n * Connection Detail Page\n * @module adaptercloud/pages/connections\n *\n * One connection (`adaConnection`) — its adapter, health, config, and the\n * resources it has discovered. Supports the validated health transition\n * (`adaSetConnectionStatus`), disable (`adaDisableConnection`), and starting a\n * sync run (`adaStartSyncRun`) against it.\n */\n\nimport { useCallback, useState } from 'react';\nimport { Loader2 } from 'lucide-react';\nimport { useParams } from 'react-router';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { ArrowLeft, Ban, Pencil, Play, RefreshCw, Server } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { DataState } from '../../components/DataState';\nimport { ConfirmDialog } from '../../components/ConfirmDialog';\nimport { useAdapterCloud } from '../../context/AdapterCloudContext';\nimport {\n useConnection,\n useDisableConnection,\n useSetConnectionStatus,\n useStartSyncRun,\n} from '../../hooks/useAdapterCloudApi';\nimport {\n authMethodLabels,\n connectionStatusLabels,\n resourceStateLabels,\n syncKindLabels,\n} from '../../utils/domain';\nimport { formatDate } from '../../utils/formatters';\nimport { formatMoney } from '../../utils/domain';\nimport type { AdaConnectionStatus, AdaSyncKind } from '../../types';\nimport { canStartConnectionSync } from './connectionSync';\n\nconst TRANSITIONABLE: AdaConnectionStatus[] = ['CONNECTED', 'DEGRADED', 'ERROR', 'PENDING'];\nconst SYNC_KINDS: AdaSyncKind[] = ['DISCOVERY', 'RECONCILE', 'COST_INGEST', 'FULL'];\n\nexport function ConnectionDetailPage() {\n const { id } = useParams<{ id: string }>();\n const { navigateTo } = useAdapterCloud();\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n const query = useConnection(id);\n const setStatus = useSetConnectionStatus();\n const disable = useDisableConnection();\n const startRun = useStartSyncRun();\n const conn = query.data;\n const syncEnabled = conn ? canStartConnectionSync(conn.status) : false;\n\n const [runningKind, setRunningKind] = useState<AdaSyncKind | null>(null);\n const [actionError, setActionError] = useState<string | null>(null);\n const [confirmDisableOpen, setConfirmDisableOpen] = useState(false);\n\n const onError = useCallback(\n (err: unknown) =>\n setActionError(err instanceof Error ? err.message : 'Action failed. Please try again.'),\n []\n );\n\n const handleSetStatus = useCallback(\n (newStatus: AdaConnectionStatus) => {\n if (!id) return;\n setActionError(null);\n setStatus.mutate({ id, status: newStatus }, { onError });\n },\n [id, setStatus, onError]\n );\n\n const handleDisable = useCallback(() => {\n if (!id) return;\n setActionError(null);\n disable.mutate(id, {\n onSuccess: () => setConfirmDisableOpen(false),\n onError,\n });\n }, [id, disable, onError]);\n\n const handleStartKind = useCallback(\n (kind: AdaSyncKind) => {\n if (!id || !syncEnabled) return;\n setActionError(null);\n setRunningKind(kind);\n startRun.mutate(\n { connectionId: id, kind },\n {\n onSuccess: () => {\n setRunningKind(null);\n navigateTo('/sync-runs');\n },\n onError: (err) => {\n setRunningKind(null);\n onError(err);\n },\n }\n );\n },\n [id, syncEnabled, startRun, navigateTo, onError]\n );\n\n return (\n <PageLayout\n title={conn?.name ?? t('adaptercloud.connections.detailTitle', 'Connection')}\n description={conn?.adapter?.name}\n actions={\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/connections')}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent\"\n >\n <ArrowLeft className=\"h-4 w-4\" />\n {t('adaptercloud.common.back', 'Back')}\n </button>\n {conn && (\n <button\n type=\"button\"\n onClick={() => navigateTo(`/connections/${conn.id}/edit`)}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent\"\n >\n <Pencil className=\"h-4 w-4\" />\n {t('adaptercloud.common.edit', 'Edit')}\n </button>\n )}\n </div>\n }\n >\n <DataState\n isLoading={query.isLoading}\n isError={query.isError}\n isEmpty={!query.isLoading && !conn}\n error={query.error}\n onRetry={() => void query.refetch()}\n emptyTitle={t('adaptercloud.connections.notFound', 'Connection not found')}\n >\n {conn && (\n <div className=\"space-y-6\">\n {actionError && (\n <p\n role=\"alert\"\n aria-live=\"polite\"\n className=\"rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\"\n >\n {actionError}\n </p>\n )}\n\n {/* Health + actions */}\n <GlassCard className=\"p-6\">\n <div className=\"mb-4 flex flex-wrap items-center gap-3\">\n <StatusBadge status={conn.status} />\n <span className=\"inline-flex items-center rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n {authMethodLabels[conn.authMethod]}\n </span>\n </div>\n\n <dl className=\"grid grid-cols-2 gap-4 text-sm sm:grid-cols-4\">\n <div>\n <dt className=\"text-text-secondary\">\n {t('adaptercloud.connections.region', 'Region')}\n </dt>\n <dd className=\"mt-0.5 font-medium text-text-primary\">{conn.region ?? '—'}</dd>\n </div>\n <div>\n <dt className=\"text-text-secondary\">\n {t('adaptercloud.connections.environment', 'Environment')}\n </dt>\n <dd className=\"mt-0.5 font-medium text-text-primary\">\n {conn.environment ?? '—'}\n </dd>\n </div>\n <div>\n <dt className=\"text-text-secondary\">\n {t('adaptercloud.connections.resourceCount', 'Resources')}\n </dt>\n <dd className=\"mt-0.5 font-medium tabular-nums text-text-primary\">\n {conn.resourceCount}\n </dd>\n </div>\n <div>\n <dt className=\"text-text-secondary\">\n {t('adaptercloud.connections.lastSynced', 'Last synced')}\n </dt>\n <dd className=\"mt-0.5 font-medium text-text-primary\">\n {conn.lastSyncedAt ? formatDate(conn.lastSyncedAt) : '—'}\n </dd>\n </div>\n </dl>\n\n {conn.lastError && (\n <p className=\"mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\">\n {conn.lastError}\n </p>\n )}\n\n {/* Health transitions */}\n <div className=\"mt-5 border-t border-border-subtle pt-5\">\n <h3 className=\"mb-3 text-sm font-semibold text-text-primary\">\n {t('adaptercloud.connections.setHealth', 'Set health')}\n </h3>\n <div className=\"flex flex-wrap gap-2\">\n {TRANSITIONABLE.map((s) => (\n <button\n key={s}\n type=\"button\"\n disabled={setStatus.isPending || conn.status === s}\n onClick={() => handleSetStatus(s)}\n className=\"rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-40\"\n >\n {connectionStatusLabels[s]}\n </button>\n ))}\n {conn.status !== 'DISABLED' && (\n <button\n type=\"button\"\n disabled={disable.isPending}\n onClick={() => setConfirmDisableOpen(true)}\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:opacity-40\"\n >\n <Ban className=\"h-3.5 w-3.5\" />\n {t('adaptercloud.connections.disable', 'Disable')}\n </button>\n )}\n </div>\n </div>\n\n {/* Start sync run */}\n <div className=\"mt-5 border-t border-border-subtle pt-5\">\n <h3 className=\"mb-3 flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <RefreshCw className=\"h-4 w-4\" />\n {t('adaptercloud.connections.startSync', 'Start a sync run')}\n </h3>\n {!syncEnabled && (\n <p\n id=\"disabled-connection-sync-help\"\n className=\"mb-3 text-sm text-text-secondary\"\n >\n {t(\n 'adaptercloud.connections.disabledSyncHelp',\n 'Sync runs are unavailable while this connection is disabled. Set its health to re-enable sync.'\n )}\n </p>\n )}\n <div className=\"flex flex-wrap gap-2\">\n {SYNC_KINDS.map((k) => {\n const pending = startRun.isPending && runningKind === k;\n return (\n <button\n key={k}\n type=\"button\"\n disabled={startRun.isPending || !syncEnabled}\n aria-describedby={syncEnabled ? undefined : 'disabled-connection-sync-help'}\n title={\n syncEnabled\n ? undefined\n : t(\n 'adaptercloud.connections.disabledSyncTooltip',\n 'Re-enable this connection before starting a sync run.'\n )\n }\n onClick={() => handleStartKind(k)}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent disabled:opacity-50\"\n >\n {pending ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <Play className=\"h-4 w-4\" />\n )}\n {syncKindLabels[k]}\n </button>\n );\n })}\n </div>\n </div>\n </GlassCard>\n\n {/* Config */}\n {conn.config != null && (\n <GlassCard className=\"p-6\">\n <h3 className=\"mb-3 text-sm font-semibold text-text-primary\">\n {t('adaptercloud.connections.config', 'Configuration')}\n </h3>\n <pre className=\"overflow-auto rounded-lg bg-bg-sunken p-4 text-xs text-text-secondary\">\n {JSON.stringify(conn.config, null, 2)}\n </pre>\n </GlassCard>\n )}\n\n {/* Resources */}\n <section>\n <div className=\"mb-3 flex items-center justify-between\">\n <h3 className=\"text-base font-semibold text-text-primary\">\n {t('adaptercloud.connections.discoveredResources', 'Discovered Resources')}\n </h3>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/resources?connectionId=${conn.id}`)}\n className=\"text-sm font-medium text-accent-blue hover:underline\"\n >\n {t('adaptercloud.common.viewAll', 'View all')}\n </button>\n </div>\n {conn.resources && conn.resources.length > 0 ? (\n <div className=\"divide-y divide-border rounded-xl border border-border-subtle bg-bg-surface\">\n {conn.resources.slice(0, 10).map((r) => (\n <button\n key={r.id}\n type=\"button\"\n onClick={() => navigateTo(`/resources/${r.id}`)}\n className=\"flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-accent/50\"\n >\n <Server className=\"h-4 w-4 shrink-0 text-text-secondary\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{r.name}</p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {r.resourceType}\n {r.region ? ` · ${r.region}` : ''}\n </p>\n </div>\n <span className=\"hidden text-xs text-text-secondary sm:inline\">\n {formatMoney(r.monthlyCost)}\n </span>\n <StatusBadge status={r.state} label={resourceStateLabels[r.state]} />\n </button>\n ))}\n </div>\n ) : (\n <p className=\"rounded-xl border border-border-subtle bg-bg-surface px-4 py-6 text-center text-sm text-text-secondary\">\n {t(\n 'adaptercloud.connections.noResources',\n 'No resources discovered yet. Start a discovery sync run.'\n )}\n </p>\n )}\n </section>\n </div>\n )}\n </DataState>\n\n <ConfirmDialog\n open={confirmDisableOpen}\n onOpenChange={setConfirmDisableOpen}\n title={t('adaptercloud.connections.disableTitle', 'Disable this connection?')}\n description={t(\n 'adaptercloud.connections.disablePrompt',\n 'Disabling stops discovery and sync runs against this target. You can re-enable it later by setting its health.'\n )}\n confirmLabel={t('adaptercloud.connections.disable', 'Disable')}\n cancelLabel={t('adaptercloud.common.cancel', 'Cancel')}\n onConfirm={handleDisable}\n isPending={disable.isPending}\n tone=\"danger\"\n />\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAsCA,IAAM,IAAwC;CAAC;CAAa;CAAY;CAAS;AAAS,GACpF,IAA4B;CAAC;CAAa;CAAa;CAAe;AAAM;AAElF,SAAgB,IAAuB;CACrC,IAAM,EAAE,UAAO,EAA0B,GACnC,EAAE,kBAAe,EAAgB,GACjC,EAAE,GAAG,MAAc,EAAQ,GAC3B,IAAI,GACP,GAAa,MAA6B;EACzC,IAAM,IAAQ,EAAU,CAAG;EAC3B,OAAO,MAAU,IAAM,IAAW;CACpC,GACA,CAAC,CAAS,CACZ,GAEM,IAAQ,EAAc,CA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QACtB,CAAA;QACN,kBAAC,GAAD;SAAa,QAAQ,EAAE;SAAO,OAAO,EAAoB,EAAE;QAAS,CAAA;OAC9D;SAjBD,EAAE,EAiBD,CACT;KACE,CAAA,IAEL,kBAAC,KAAD;MAAG,WAAU;gBACV,EACC,wCACA,0DACF;KACC,CAAA,CAEE,EAAA,CAAA;IACN;;EAEE,CAAA,GAEX,kBAAC,GAAD;GACE,MAAM;GACN,cAAc;GACd,OAAO,EAAE,yCAAyC,0BAA0B;GAC5E,aAAa,EACX,0CACA,gHACF;GACA,cAAc,EAAE,oCAAoC,SAAS;GAC7D,aAAa,EAAE,8BAA8B,QAAQ;GACrD,WAAW;GACX,WAAW,EAAQ;GACnB,MAAK;EACN,CAAA,CACS;;AAEhB"}
1
+ {"version":3,"file":"ConnectionDetailPage.js","names":[],"sources":["../../../../src/adaptercloud/pages/connections/ConnectionDetailPage.tsx"],"sourcesContent":["/**\n * Connection Detail Page\n * @module adaptercloud/pages/connections\n *\n * One connection (`adaConnection`) — its adapter, health, config, and the\n * resources it has discovered. Supports the validated health transition\n * (`adaSetConnectionStatus`), disable (`adaDisableConnection`), and starting a\n * sync run (`adaStartSyncRun`) against it.\n */\n\nimport { useCallback, useState } from 'react';\nimport { Loader2 } from 'lucide-react';\nimport { useParams } from 'react-router';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { ArrowLeft, Ban, Pencil, Play, RefreshCw, Server } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { DataState } from '../../components/DataState';\nimport { ConfirmDialog } from '../../components/ConfirmDialog';\nimport { useAdapterCloud } from '../../context/AdapterCloudContext';\nimport {\n useConnection,\n useDisableConnection,\n useSetConnectionStatus,\n useStartSyncRun,\n} from '../../hooks/useAdapterCloudApi';\nimport {\n authMethodLabels,\n connectionStatusLabels,\n resourceStateLabels,\n syncKindLabels,\n} from '../../utils/domain';\nimport { formatDate } from '../../utils/formatters';\nimport { formatMoney } from '../../utils/domain';\nimport type { AdaConnectionStatus, AdaSyncKind } from '../../types';\nimport {\n canStartConnectionSync,\n canStartConnectionSyncKind,\n isConnectionSyncKindExecutable,\n} from './connectionSync';\n\nconst TRANSITIONABLE: AdaConnectionStatus[] = ['CONNECTED', 'DEGRADED', 'ERROR', 'PENDING'];\nconst SYNC_KINDS: AdaSyncKind[] = ['DISCOVERY', 'RECONCILE', 'COST_INGEST', 'FULL'];\n\nexport function ConnectionDetailPage() {\n const { id } = useParams<{ id: string }>();\n const { navigateTo } = useAdapterCloud();\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n const query = useConnection(id);\n const setStatus = useSetConnectionStatus();\n const disable = useDisableConnection();\n const startRun = useStartSyncRun();\n const conn = query.data;\n const syncEnabled = conn ? canStartConnectionSync(conn.status) : false;\n\n const [runningKind, setRunningKind] = useState<AdaSyncKind | null>(null);\n const [actionError, setActionError] = useState<string | null>(null);\n const [confirmDisableOpen, setConfirmDisableOpen] = useState(false);\n\n const onError = useCallback(\n (err: unknown) =>\n setActionError(err instanceof Error ? err.message : 'Action failed. Please try again.'),\n []\n );\n\n const handleSetStatus = useCallback(\n (newStatus: AdaConnectionStatus) => {\n if (!id) return;\n setActionError(null);\n setStatus.mutate({ id, status: newStatus }, { onError });\n },\n [id, setStatus, onError]\n );\n\n const handleDisable = useCallback(() => {\n if (!id) return;\n setActionError(null);\n disable.mutate(id, {\n onSuccess: () => setConfirmDisableOpen(false),\n onError,\n });\n }, [id, disable, onError]);\n\n const handleStartKind = useCallback(\n (kind: AdaSyncKind) => {\n if (!id || !conn || !canStartConnectionSyncKind(conn.status, kind)) return;\n setActionError(null);\n setRunningKind(kind);\n startRun.mutate(\n { connectionId: id, kind },\n {\n onSuccess: () => {\n setRunningKind(null);\n navigateTo('/sync-runs');\n },\n onError: (err) => {\n setRunningKind(null);\n onError(err);\n },\n }\n );\n },\n [id, conn, startRun, navigateTo, onError]\n );\n\n return (\n <PageLayout\n title={conn?.name ?? t('adaptercloud.connections.detailTitle', 'Connection')}\n description={conn?.adapter?.name}\n actions={\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/connections')}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent\"\n >\n <ArrowLeft className=\"h-4 w-4\" />\n {t('adaptercloud.common.back', 'Back')}\n </button>\n {conn && (\n <button\n type=\"button\"\n onClick={() => navigateTo(`/connections/${conn.id}/edit`)}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent\"\n >\n <Pencil className=\"h-4 w-4\" />\n {t('adaptercloud.common.edit', 'Edit')}\n </button>\n )}\n </div>\n }\n >\n <DataState\n isLoading={query.isLoading}\n isError={query.isError}\n isEmpty={!query.isLoading && !conn}\n error={query.error}\n onRetry={() => void query.refetch()}\n emptyTitle={t('adaptercloud.connections.notFound', 'Connection not found')}\n >\n {conn && (\n <div className=\"space-y-6\">\n {actionError && (\n <p\n role=\"alert\"\n aria-live=\"polite\"\n className=\"rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\"\n >\n {actionError}\n </p>\n )}\n\n {/* Health + actions */}\n <GlassCard className=\"p-6\">\n <div className=\"mb-4 flex flex-wrap items-center gap-3\">\n <StatusBadge status={conn.status} />\n <span className=\"inline-flex items-center rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n {authMethodLabels[conn.authMethod]}\n </span>\n </div>\n\n <dl className=\"grid grid-cols-2 gap-4 text-sm sm:grid-cols-4\">\n <div>\n <dt className=\"text-text-secondary\">\n {t('adaptercloud.connections.region', 'Region')}\n </dt>\n <dd className=\"mt-0.5 font-medium text-text-primary\">{conn.region ?? '—'}</dd>\n </div>\n <div>\n <dt className=\"text-text-secondary\">\n {t('adaptercloud.connections.environment', 'Environment')}\n </dt>\n <dd className=\"mt-0.5 font-medium text-text-primary\">\n {conn.environment ?? '—'}\n </dd>\n </div>\n <div>\n <dt className=\"text-text-secondary\">\n {t('adaptercloud.connections.resourceCount', 'Resources')}\n </dt>\n <dd className=\"mt-0.5 font-medium tabular-nums text-text-primary\">\n {conn.resourceCount}\n </dd>\n </div>\n <div>\n <dt className=\"text-text-secondary\">\n {t('adaptercloud.connections.lastSynced', 'Last synced')}\n </dt>\n <dd className=\"mt-0.5 font-medium text-text-primary\">\n {conn.lastSyncedAt ? formatDate(conn.lastSyncedAt) : '—'}\n </dd>\n </div>\n </dl>\n\n {conn.lastError && (\n <p className=\"mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\">\n {conn.lastError}\n </p>\n )}\n\n {/* Health transitions */}\n <div className=\"mt-5 border-t border-border-subtle pt-5\">\n <h3 className=\"mb-3 text-sm font-semibold text-text-primary\">\n {t('adaptercloud.connections.setHealth', 'Set health')}\n </h3>\n <div className=\"flex flex-wrap gap-2\">\n {TRANSITIONABLE.map((s) => (\n <button\n key={s}\n type=\"button\"\n disabled={setStatus.isPending || conn.status === s}\n onClick={() => handleSetStatus(s)}\n className=\"rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-40\"\n >\n {connectionStatusLabels[s]}\n </button>\n ))}\n {conn.status !== 'DISABLED' && (\n <button\n type=\"button\"\n disabled={disable.isPending}\n onClick={() => setConfirmDisableOpen(true)}\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:opacity-40\"\n >\n <Ban className=\"h-3.5 w-3.5\" />\n {t('adaptercloud.connections.disable', 'Disable')}\n </button>\n )}\n </div>\n </div>\n\n {/* Start sync run */}\n <div className=\"mt-5 border-t border-border-subtle pt-5\">\n <h3 className=\"mb-3 flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <RefreshCw className=\"h-4 w-4\" />\n {t('adaptercloud.connections.startSync', 'Start a sync run')}\n </h3>\n {!syncEnabled && (\n <p\n id=\"disabled-connection-sync-help\"\n className=\"mb-3 text-sm text-text-secondary\"\n >\n {t(\n 'adaptercloud.connections.disabledSyncHelp',\n 'Sync runs are unavailable while this connection is disabled. Set its health to re-enable sync.'\n )}\n </p>\n )}\n <p id=\"unsupported-sync-kind-help\" className=\"mb-3 text-sm text-text-secondary\">\n {t(\n 'adaptercloud.connections.syncModeAvailabilityHelp',\n 'Discovery is executable today. Reconcile, Cost Ingest, and Full need distinct backend workers and are not available yet.'\n )}\n </p>\n <div className=\"flex flex-wrap gap-2\">\n {SYNC_KINDS.map((k) => {\n const pending = startRun.isPending && runningKind === k;\n const executable = isConnectionSyncKindExecutable(k);\n return (\n <button\n key={k}\n type=\"button\"\n disabled={startRun.isPending || !syncEnabled || !executable}\n aria-describedby={\n !executable\n ? 'unsupported-sync-kind-help'\n : syncEnabled\n ? undefined\n : 'disabled-connection-sync-help'\n }\n title={\n !executable\n ? t(\n 'adaptercloud.connections.unsupportedSyncModeTooltip',\n 'This sync mode is not available yet because it needs a distinct backend worker.'\n )\n : !syncEnabled\n ? t(\n 'adaptercloud.connections.disabledSyncTooltip',\n 'Re-enable this connection before starting a sync run.'\n )\n : undefined\n }\n onClick={() => handleStartKind(k)}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {pending ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <Play className=\"h-4 w-4\" />\n )}\n {syncKindLabels[k]}\n {!executable && (\n <span className=\"rounded bg-bg-sunken px-1.5 py-0.5 text-[10px] font-normal text-text-secondary\">\n {t('adaptercloud.connections.notAvailable', 'Not available')}\n </span>\n )}\n </button>\n );\n })}\n </div>\n </div>\n </GlassCard>\n\n {/* Config */}\n {conn.config != null && (\n <GlassCard className=\"p-6\">\n <h3 className=\"mb-3 text-sm font-semibold text-text-primary\">\n {t('adaptercloud.connections.config', 'Configuration')}\n </h3>\n <pre className=\"overflow-auto rounded-lg bg-bg-sunken p-4 text-xs text-text-secondary\">\n {JSON.stringify(conn.config, null, 2)}\n </pre>\n </GlassCard>\n )}\n\n {/* Resources */}\n <section>\n <div className=\"mb-3 flex items-center justify-between\">\n <h3 className=\"text-base font-semibold text-text-primary\">\n {t('adaptercloud.connections.discoveredResources', 'Discovered Resources')}\n </h3>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/resources?connectionId=${conn.id}`)}\n className=\"text-sm font-medium text-accent-blue hover:underline\"\n >\n {t('adaptercloud.common.viewAll', 'View all')}\n </button>\n </div>\n {conn.resources && conn.resources.length > 0 ? (\n <div className=\"divide-y divide-border rounded-xl border border-border-subtle bg-bg-surface\">\n {conn.resources.slice(0, 10).map((r) => (\n <button\n key={r.id}\n type=\"button\"\n onClick={() => navigateTo(`/resources/${r.id}`)}\n className=\"flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-accent/50\"\n >\n <Server className=\"h-4 w-4 shrink-0 text-text-secondary\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{r.name}</p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {r.resourceType}\n {r.region ? ` · ${r.region}` : ''}\n </p>\n </div>\n <span className=\"hidden text-xs text-text-secondary sm:inline\">\n {formatMoney(r.monthlyCost)}\n </span>\n <StatusBadge status={r.state} label={resourceStateLabels[r.state]} />\n </button>\n ))}\n </div>\n ) : (\n <p className=\"rounded-xl border border-border-subtle bg-bg-surface px-4 py-6 text-center text-sm text-text-secondary\">\n {t(\n 'adaptercloud.connections.noResources',\n 'No resources discovered yet. Start a discovery sync run.'\n )}\n </p>\n )}\n </section>\n </div>\n )}\n </DataState>\n\n <ConfirmDialog\n open={confirmDisableOpen}\n onOpenChange={setConfirmDisableOpen}\n title={t('adaptercloud.connections.disableTitle', 'Disable this connection?')}\n description={t(\n 'adaptercloud.connections.disablePrompt',\n 'Disabling stops discovery and sync runs against this target. You can re-enable it later by setting its health.'\n )}\n confirmLabel={t('adaptercloud.connections.disable', 'Disable')}\n cancelLabel={t('adaptercloud.common.cancel', 'Cancel')}\n onConfirm={handleDisable}\n isPending={disable.isPending}\n tone=\"danger\"\n />\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA0CA,IAAM,IAAwC;CAAC;CAAa;CAAY;CAAS;AAAS,GACpF,IAA4B;CAAC;CAAa;CAAa;CAAe;AAAM;AAElF,SAAgB,IAAuB;CACrC,IAAM,EAAE,UAAO,EAA0B,GACnC,EAAE,kBAAe,EAAgB,GACjC,EAAE,GAAG,MAAc,EAAQ,GAC3B,IAAI,GACP,GAAa,MAA6B;EACzC,IAAM,IAAQ,EAAU,CAAG;EAC3B,OAAO,MAAU,IAAM,IAAW;CACpC,GACA,CAAC,CAAS,CACZ,GAEM,IAAQ,EAAc,CAAE,GACxB,IAAY,EAAuB,GACnC,IAAU,EAAqB,GAC/B,IAAW,EAAgB,GAC3B,IAAO,EAAM,MACb,IAAc,IAAO,EAAuB,EAAK,MAAM,IAAI,IAE3D,CAAC,GAAa,KAAkB,EAA6B,IAAI,GACjE,CAAC,GAAa,KAAkB,EAAwB,IAAI,GAC5D,CAAC,GAAoB,KAAyB,EAAS,EAAK,GAE5D,IAAU,GACb,MACC,EAAe,aAAe,QAAQ,EAAI,UAAU,kCAAkC,GACxF,CAAC,CACH,GAEM,IAAkB,GACrB,MAAmC;EAC7B,MACL,EAAe,IAAI,GACnB,EAAU,OAAO;GAAE;GAAI,QAAQ;EAAU,GAAG,EAAE,WAAQ,CAAC;CACzD,GACA;EAAC;EAAI;EAAW;CAAO,CACz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AAA,CAAA;IACN;;EAEE,CAAA,GAEX,kBAAC,GAAD;GACE,MAAM;GACN,cAAc;GACd,OAAO,EAAE,yCAAyC,0BAA0B;GAC5E,aAAa,EACX,0CACA,gHACF;GACA,cAAc,EAAE,oCAAoC,SAAS;GAC7D,aAAa,EAAE,8BAA8B,QAAQ;GACrD,WAAW;GACX,WAAW,EAAQ;GACnB,MAAK;EACN,CAAA,CACS;;AAEhB"}
@@ -1,4 +1,6 @@
1
- import { AdaConnectionStatus } from '../../types';
1
+ import { AdaConnectionStatus, AdaSyncKind } from '../../types';
2
2
 
3
3
  export declare function canStartConnectionSync(status: AdaConnectionStatus): boolean;
4
+ export declare function isConnectionSyncKindExecutable(kind: AdaSyncKind): boolean;
5
+ export declare function canStartConnectionSyncKind(status: AdaConnectionStatus, kind: AdaSyncKind): boolean;
4
6
  //# sourceMappingURL=connectionSync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connectionSync.d.ts","sourceRoot":"","sources":["../../../../src/adaptercloud/pages/connections/connectionSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAE3E"}
1
+ {"version":3,"file":"connectionSync.d.ts","sourceRoot":"","sources":["../../../../src/adaptercloud/pages/connections/connectionSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAIpE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAE3E;AAED,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAEzE;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE,WAAW,GAChB,OAAO,CAET"}
@@ -1,8 +1,15 @@
1
1
  //#region src/adaptercloud/pages/connections/connectionSync.ts
2
- function e(e) {
2
+ var e = new Set(["DISCOVERY"]);
3
+ function t(e) {
3
4
  return e !== "DISABLED";
4
5
  }
6
+ function n(t) {
7
+ return e.has(t);
8
+ }
9
+ function r(e, r) {
10
+ return t(e) && n(r);
11
+ }
5
12
  //#endregion
6
- export { e as canStartConnectionSync };
13
+ export { t as canStartConnectionSync, r as canStartConnectionSyncKind, n as isConnectionSyncKindExecutable };
7
14
 
8
15
  //# sourceMappingURL=connectionSync.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connectionSync.js","names":[],"sources":["../../../../src/adaptercloud/pages/connections/connectionSync.ts"],"sourcesContent":["import type { AdaConnectionStatus } from '../../types';\n\nexport function canStartConnectionSync(status: AdaConnectionStatus): boolean {\n return status !== 'DISABLED';\n}\n"],"mappings":";AAEA,SAAgB,EAAuB,GAAsC;CAC3E,OAAO,MAAW;AACpB"}
1
+ {"version":3,"file":"connectionSync.js","names":[],"sources":["../../../../src/adaptercloud/pages/connections/connectionSync.ts"],"sourcesContent":["import type { AdaConnectionStatus, AdaSyncKind } from '../../types';\n\nconst EXECUTABLE_SYNC_KINDS: ReadonlySet<AdaSyncKind> = new Set(['DISCOVERY']);\n\nexport function canStartConnectionSync(status: AdaConnectionStatus): boolean {\n return status !== 'DISABLED';\n}\n\nexport function isConnectionSyncKindExecutable(kind: AdaSyncKind): boolean {\n return EXECUTABLE_SYNC_KINDS.has(kind);\n}\n\nexport function canStartConnectionSyncKind(\n status: AdaConnectionStatus,\n kind: AdaSyncKind\n): boolean {\n return canStartConnectionSync(status) && isConnectionSyncKindExecutable(kind);\n}\n"],"mappings":";AAEA,IAAM,IAAkD,IAAI,IAAI,CAAC,WAAW,CAAC;AAE7E,SAAgB,EAAuB,GAAsC;CAC3E,OAAO,MAAW;AACpB;AAEA,SAAgB,EAA+B,GAA4B;CACzE,OAAO,EAAsB,IAAI,CAAI;AACvC;AAEA,SAAgB,EACd,GACA,GACS;CACT,OAAO,EAAuB,CAAM,KAAK,EAA+B,CAAI;AAC9E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-adaptercloud",
3
- "version": "2026.825.2",
3
+ "version": "2026.825.3",
4
4
  "description": "Burdenoff AdapterCloud Microfrontend",
5
5
  "type": "module",
6
6
  "files": [