@kukeon/console 0.0.0-stage → 0.10.0-edge.gaa95c2af
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/dist/assignments-Biqg1AT0.js +257 -0
- package/dist/assignments-tab.d.ts +4 -0
- package/dist/assignments.d.mts +40 -0
- package/dist/auth.d.ts +39 -0
- package/dist/bulk-ui.d.ts +49 -0
- package/dist/bulk.d.mts +14 -0
- package/dist/catalog-ChPGZP2a.js +1949 -0
- package/dist/catalog-url-Dr9e92Yq.js +19 -0
- package/dist/catalog-url.d.mts +4 -0
- package/dist/catalog.d.ts +40 -0
- package/dist/cell-filter.d.ts +10 -0
- package/dist/cell-sidebar.d.ts +26 -0
- package/dist/cells.d.mts +29 -0
- package/dist/cgroup-format.d.ts +17 -0
- package/dist/cgroup.d.ts +4 -0
- package/dist/config-form.d.mts +66 -0
- package/dist/connector-ui-CG9kLZ5s.js +2716 -0
- package/dist/connector-ui.d.ts +129 -0
- package/dist/connectors-page-C8459TcH.js +241 -0
- package/dist/connectors-page.d.ts +8 -0
- package/dist/connectors.d.mts +154 -0
- package/dist/container-log.d.ts +11 -0
- package/dist/create.d.ts +11 -0
- package/dist/creation-schema.d.mts +15 -0
- package/dist/daemon-DxP5hn4p.js +394 -0
- package/dist/daemon.d.ts +24 -0
- package/dist/display-name.d.ts +10 -0
- package/dist/drift-diff.d.ts +4 -0
- package/dist/exec.d.ts +15 -0
- package/dist/extensions.d.ts +111 -0
- package/dist/get-started.d.ts +9 -0
- package/dist/health.d.ts +22 -0
- package/dist/identities-page-CJ_ukj0Q.js +2137 -0
- package/dist/identities-page.d.ts +15 -0
- package/dist/identities.d.mts +24 -0
- package/dist/image-format.d.ts +6 -0
- package/dist/image-inventory.d.ts +12 -0
- package/dist/images.d.ts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5241 -0
- package/dist/initialize-CAOkMhlL.js +146 -0
- package/dist/initialize.d.ts +21 -0
- package/dist/inventory.d.ts +66 -0
- package/dist/lifecycle-policy.d.ts +11 -0
- package/dist/lifecycle.d.ts +24 -0
- package/dist/log-buffer.d.ts +8 -0
- package/dist/main.d.ts +13 -0
- package/dist/majordomo-CikLz0g9.js +3064 -0
- package/dist/majordomo.d.ts +102 -0
- package/dist/manage-nav.d.ts +4 -0
- package/dist/manifest-diff.d.mts +11 -0
- package/dist/merged-values-CBzWsNOS.js +739 -0
- package/dist/merged-values.d.ts +24 -0
- package/dist/network-format.d.ts +30 -0
- package/dist/network.d.ts +13 -0
- package/dist/new-agent-BweyzBnY.js +201 -0
- package/dist/new-agent.d.ts +27 -0
- package/dist/new-cell-Iceq2Zfv.js +1985 -0
- package/dist/new-cell.d.ts +29 -0
- package/dist/new-config-C9NSC9Ou.js +1541 -0
- package/dist/new-config.d.ts +7 -0
- package/dist/notifications.d.ts +26 -0
- package/dist/onboarding-oZBJXTy0.js +395 -0
- package/dist/onboarding.d.mts +40 -0
- package/dist/panel-cells.d.mts +8 -0
- package/dist/registry-credentials.d.ts +13 -0
- package/dist/relationships.d.mts +12 -0
- package/dist/request.d.ts +16 -0
- package/dist/router.d.ts +12 -0
- package/dist/routes.d.ts +43 -0
- package/dist/schedule-DzQ3Homi.js +113 -0
- package/dist/schedule-format.d.mts +9 -0
- package/dist/schedule.d.ts +16 -0
- package/dist/scope-actions.d.ts +9 -0
- package/dist/screens.d.ts +6 -0
- package/dist/secret-form.d.ts +24 -0
- package/dist/settings-nav.d.ts +5 -0
- package/dist/settings-page.d.ts +4 -0
- package/dist/settings-values.d.mts +18 -0
- package/dist/settings.d.ts +50 -0
- package/dist/sidebar-shell.d.ts +55 -0
- package/dist/sources-page-CxMSM-sz.js +423 -0
- package/dist/sources-page.d.ts +5 -0
- package/dist/space-subnets.d.ts +3 -0
- package/dist/style.css +2 -0
- package/dist/team-form.d.mts +56 -0
- package/dist/team-plan-CFOIv1lN.js +735 -0
- package/dist/team-plan.d.ts +22 -0
- package/dist/team-wizard.d.ts +8 -0
- package/dist/teams-page-C6UGy4Fw.js +2216 -0
- package/dist/teams-page.d.ts +9 -0
- package/dist/teams.d.mts +114 -0
- package/dist/terminal-palette.d.ts +8 -0
- package/dist/terminal.d.ts +98 -0
- package/dist/unread.d.mts +19 -0
- package/dist/use-unread.d.ts +4 -0
- package/dist/user-menu.d.ts +7 -0
- package/dist/views.d.mts +8 -0
- package/dist/workbench.d.ts +16 -0
- package/package.json +45 -4
- package/README.md +0 -3
|
@@ -0,0 +1,2716 @@
|
|
|
1
|
+
import { createContext as e, useCallback as t, useContext as n, useEffect as r, useId as i, useLayoutEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
2
|
+
import { apiFetch as l } from "@kukeon/api-client";
|
|
3
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
4
|
+
import { Icon as p } from "@kukeon/ui";
|
|
5
|
+
// src/request.tsx
|
|
6
|
+
function m(e, t) {
|
|
7
|
+
let [n, i] = c({ loading: !0 }), [a, o] = c(e);
|
|
8
|
+
return a !== e && (o(e), i({ loading: e !== null })), r(() => {
|
|
9
|
+
if (e === null) return;
|
|
10
|
+
let t = new AbortController();
|
|
11
|
+
return i((e) => ({
|
|
12
|
+
data: e.data,
|
|
13
|
+
loading: !0
|
|
14
|
+
})), (async () => {
|
|
15
|
+
try {
|
|
16
|
+
let n = await l(e, { signal: t.signal }), r = await n.json();
|
|
17
|
+
if (!n.ok) throw r.error ?? {
|
|
18
|
+
code: "http_error",
|
|
19
|
+
message: `HTTP ${n.status}`
|
|
20
|
+
};
|
|
21
|
+
t.signal.aborted || i({
|
|
22
|
+
data: r,
|
|
23
|
+
loading: !1
|
|
24
|
+
});
|
|
25
|
+
} catch (e) {
|
|
26
|
+
if (t.signal.aborted) return;
|
|
27
|
+
let n = e;
|
|
28
|
+
i((e) => ({
|
|
29
|
+
data: e.data,
|
|
30
|
+
loading: !1,
|
|
31
|
+
error: {
|
|
32
|
+
code: n.code ?? "unavailable",
|
|
33
|
+
message: n.message ?? "Request failed. Try refreshing."
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
})(), () => t.abort();
|
|
38
|
+
}, [e, t]), n;
|
|
39
|
+
}
|
|
40
|
+
function h(e) {
|
|
41
|
+
let t = e;
|
|
42
|
+
return t && typeof t.code == "string" ? {
|
|
43
|
+
code: t.code,
|
|
44
|
+
message: t.message ?? "Request failed."
|
|
45
|
+
} : {
|
|
46
|
+
code: "unavailable",
|
|
47
|
+
message: e instanceof Error ? e.message : "The request could not reach the web server."
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function g(e, t = "Realm") {
|
|
51
|
+
return e.code === "permission_denied" ? "Permission denied" : e.code === "unavailable" ? "Daemon unavailable" : e.code === "daemon_outdated" ? "Daemon outdated" : e.code === "log_unavailable" ? "Daemon logs unavailable" : e.code === "not_found" ? `${t} no longer exists` : "Request failed";
|
|
52
|
+
}
|
|
53
|
+
function _({ error: e, kind: t = "Realm" }) {
|
|
54
|
+
return /* @__PURE__ */ f("div", {
|
|
55
|
+
className: "error",
|
|
56
|
+
role: "alert",
|
|
57
|
+
children: [/* @__PURE__ */ d("strong", { children: g(e, t) }), /* @__PURE__ */ d("p", { children: e.message })]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
var v = "file", y = "stateVolume", b = "registry", x = "string", S = "opaque", C = "basic-auth", w = "ssh-key", T = [
|
|
61
|
+
"realm",
|
|
62
|
+
"space",
|
|
63
|
+
"stack"
|
|
64
|
+
], E = "resolved", D = "pending", O = "kukeon.io/team", ee = "default", te = "logged in", k = "empty", ne = "persistent", re = "ephemeral", ie = [ne, re], A = (e) => Array.isArray(e) ? e : [], j = (e) => typeof e == "string" ? e : "", M = (e) => j(e).trim();
|
|
65
|
+
function N(e) {
|
|
66
|
+
return e === "env" || e === "file" || e === "git";
|
|
67
|
+
}
|
|
68
|
+
function P(e) {
|
|
69
|
+
let t = M(e?.name), n = M(e?.realm);
|
|
70
|
+
if (!t || !n) return;
|
|
71
|
+
let r = {
|
|
72
|
+
name: t,
|
|
73
|
+
realm: n
|
|
74
|
+
};
|
|
75
|
+
return M(e.space) && (r.space = M(e.space)), r.space && M(e.stack) && (r.stack = M(e.stack)), r;
|
|
76
|
+
}
|
|
77
|
+
function F(e) {
|
|
78
|
+
let t = P(e);
|
|
79
|
+
return t ? JSON.stringify([
|
|
80
|
+
t.realm,
|
|
81
|
+
t.space ?? "",
|
|
82
|
+
t.stack ?? "",
|
|
83
|
+
t.name
|
|
84
|
+
]) : "";
|
|
85
|
+
}
|
|
86
|
+
function I(e, t) {
|
|
87
|
+
return F(e) === F(t);
|
|
88
|
+
}
|
|
89
|
+
function L(e) {
|
|
90
|
+
let t = P(e);
|
|
91
|
+
return t ? [
|
|
92
|
+
t.realm,
|
|
93
|
+
t.space,
|
|
94
|
+
t.stack
|
|
95
|
+
].filter(Boolean) : [];
|
|
96
|
+
}
|
|
97
|
+
function R(e) {
|
|
98
|
+
let t = P(e);
|
|
99
|
+
return t ? `${t.name} — ${L(t).join(" / ")}` : "";
|
|
100
|
+
}
|
|
101
|
+
function ae(e) {
|
|
102
|
+
let t = P(e);
|
|
103
|
+
return t ? `${t.name}@${L(t).join("/")}` : "";
|
|
104
|
+
}
|
|
105
|
+
function oe(e) {
|
|
106
|
+
let t = j(e?.delivery);
|
|
107
|
+
return t === "env" ? `environment variable ${j(e.envName)}`.trim() : t === "file" ? `file ${j(e.mountPath)}`.trim() : t === "stateVolume" ? "login kept in a login identity (a Volume mounted as the harness state directory)" : t === "git" ? "the cell's git identity (author, committer, credentials, signing)" : t === "registry" ? "image pulls of a Realm" : t;
|
|
108
|
+
}
|
|
109
|
+
function se(e, t) {
|
|
110
|
+
return A(e).filter((e) => M(e?.metadata?.name) && M(e.metadata.realm) && !M(e.metadata.cell) && !!t && j(e.spec?.connector) === t).map((e) => ({
|
|
111
|
+
name: e.metadata.name,
|
|
112
|
+
realm: e.metadata.realm,
|
|
113
|
+
space: j(e.metadata.space),
|
|
114
|
+
stack: j(e.metadata.stack),
|
|
115
|
+
type: j(e.spec?.type) || "opaque",
|
|
116
|
+
identity: Object.fromEntries(Object.entries(e.spec?.identity ?? {}).filter(([, e]) => typeof e == "string"))
|
|
117
|
+
})).sort((e, t) => [
|
|
118
|
+
e.realm,
|
|
119
|
+
e.space,
|
|
120
|
+
e.stack,
|
|
121
|
+
e.name
|
|
122
|
+
].join("/").localeCompare([
|
|
123
|
+
t.realm,
|
|
124
|
+
t.space,
|
|
125
|
+
t.stack,
|
|
126
|
+
t.name
|
|
127
|
+
].join("/")));
|
|
128
|
+
}
|
|
129
|
+
function ce(e) {
|
|
130
|
+
return A(e?.status?.connectors).filter((e) => j(e?.connector));
|
|
131
|
+
}
|
|
132
|
+
function z(e) {
|
|
133
|
+
return !!e && e.state !== "resolved" && (e.required === !0 || !!e.identity);
|
|
134
|
+
}
|
|
135
|
+
function le(e) {
|
|
136
|
+
return ce(e).filter(z);
|
|
137
|
+
}
|
|
138
|
+
function B(e) {
|
|
139
|
+
return j(e?.title) || j(e?.connector);
|
|
140
|
+
}
|
|
141
|
+
function ue(e, t = "") {
|
|
142
|
+
let n = j(e);
|
|
143
|
+
return T.includes(n) ? `${n[0].toUpperCase()}${n.slice(1)} default` : n === "config" ? t ? `set by team ${t}` : "picked for this Config" : n === "cell" ? "picked for this cell" : n;
|
|
144
|
+
}
|
|
145
|
+
function de(e) {
|
|
146
|
+
return j(e?.metadata?.labels?.[O]);
|
|
147
|
+
}
|
|
148
|
+
function fe(e) {
|
|
149
|
+
return {
|
|
150
|
+
realm: M(e?.realm),
|
|
151
|
+
space: M(e?.space) || "default",
|
|
152
|
+
stack: M(e?.stack) || "default"
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function V(e, t) {
|
|
156
|
+
let n = { realm: M(e?.realm) };
|
|
157
|
+
return t !== T[0] && M(e?.space) && (n.space = M(e.space)), t === T[2] && n.space && M(e?.stack) && (n.stack = M(e.stack)), n;
|
|
158
|
+
}
|
|
159
|
+
function H(e) {
|
|
160
|
+
return M(e?.stack) ? T[2] : M(e?.space) ? T[1] : T[0];
|
|
161
|
+
}
|
|
162
|
+
function U(e) {
|
|
163
|
+
return [
|
|
164
|
+
M(e?.realm),
|
|
165
|
+
M(e?.space),
|
|
166
|
+
M(e?.stack)
|
|
167
|
+
].filter(Boolean);
|
|
168
|
+
}
|
|
169
|
+
function pe(e) {
|
|
170
|
+
let [t, n, r] = A(e).map(M);
|
|
171
|
+
return V({
|
|
172
|
+
realm: t,
|
|
173
|
+
space: n,
|
|
174
|
+
stack: r
|
|
175
|
+
}, T[2]);
|
|
176
|
+
}
|
|
177
|
+
function me(e) {
|
|
178
|
+
let t = A(e?.scopes).length ? e.scopes : T;
|
|
179
|
+
return T.filter((e) => t.includes(e));
|
|
180
|
+
}
|
|
181
|
+
function he(e, t) {
|
|
182
|
+
return me(e).filter((e) => H(V(t, e)) === e);
|
|
183
|
+
}
|
|
184
|
+
function ge(e) {
|
|
185
|
+
let t = new URLSearchParams();
|
|
186
|
+
return T.forEach((n) => {
|
|
187
|
+
M(e?.[n]) && t.set(n, M(e[n]));
|
|
188
|
+
}), t.toString();
|
|
189
|
+
}
|
|
190
|
+
function _e(e) {
|
|
191
|
+
let t = A(e?.methods);
|
|
192
|
+
return t.length ? t.filter((e) => (e?.delivery === "env" || e?.delivery === "file") && j(e.slot)).map((e) => ({
|
|
193
|
+
method: j(e.name),
|
|
194
|
+
component: j(e.component),
|
|
195
|
+
delivery: e.delivery,
|
|
196
|
+
slot: e.slot,
|
|
197
|
+
description: j(e.description)
|
|
198
|
+
})) : e?.delivery === "git" ? [{
|
|
199
|
+
method: "",
|
|
200
|
+
component: j(e.name),
|
|
201
|
+
delivery: "git",
|
|
202
|
+
slot: "",
|
|
203
|
+
description: ""
|
|
204
|
+
}] : [];
|
|
205
|
+
}
|
|
206
|
+
function ve(e, t) {
|
|
207
|
+
return A(e).find((e) => e?.connector === t?.connector && (t.component ? e.component === t.component : j(e.method) === j(t.method)));
|
|
208
|
+
}
|
|
209
|
+
function ye(e) {
|
|
210
|
+
return A(e?.methods).filter((e) => e?.delivery === y);
|
|
211
|
+
}
|
|
212
|
+
function be(e) {
|
|
213
|
+
return !A(e?.methods).length && e?.delivery === "registry";
|
|
214
|
+
}
|
|
215
|
+
function xe(e, t) {
|
|
216
|
+
let n = A(e).find((e) => e?.connector === t);
|
|
217
|
+
return {
|
|
218
|
+
configs: Number(n?.configs) || 0,
|
|
219
|
+
missing: A(n?.missing)
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
function Se(e) {
|
|
223
|
+
let t = [], n = [];
|
|
224
|
+
for (let r of A(e)) {
|
|
225
|
+
if (!r?.optional) continue;
|
|
226
|
+
if (!j(r.group)) {
|
|
227
|
+
n.push(r);
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
let e = t.find((e) => e.group === r.group);
|
|
231
|
+
e || t.push(e = {
|
|
232
|
+
group: r.group,
|
|
233
|
+
members: []
|
|
234
|
+
}), e.members.push(r);
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
groups: t,
|
|
238
|
+
ungrouped: n
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function Ce(e, t) {
|
|
242
|
+
let n = {};
|
|
243
|
+
for (let { group: r, members: i } of Se(e).groups) n[r] = (i.find((e) => A(A(t).find((t) => t?.name === e.connector?.name)?.methods).some((t) => t?.default === !0 && (t.component === e.name || j(t.name) && t.name === e.connector?.method))) ?? i[0]).name;
|
|
244
|
+
return n;
|
|
245
|
+
}
|
|
246
|
+
function W(e) {
|
|
247
|
+
return e?.delivery === y;
|
|
248
|
+
}
|
|
249
|
+
function we(e) {
|
|
250
|
+
return N(e?.delivery) || W(e);
|
|
251
|
+
}
|
|
252
|
+
function G(e) {
|
|
253
|
+
return W(e) ? P(e?.volumeRef) : P(e?.identity);
|
|
254
|
+
}
|
|
255
|
+
function Te(e, t) {
|
|
256
|
+
return A(e).filter((e) => e?.connector === t && P(e.volume)).map((e) => {
|
|
257
|
+
let n = {
|
|
258
|
+
connector: t,
|
|
259
|
+
method: j(e.method),
|
|
260
|
+
volume: P(e.volume),
|
|
261
|
+
exists: e.exists === !0,
|
|
262
|
+
tagged: e.tagged === !0,
|
|
263
|
+
state: j(e.login?.state),
|
|
264
|
+
since: j(e.login?.since),
|
|
265
|
+
usedBy: A(e.usedBy).filter((e) => j(e?.name))
|
|
266
|
+
}, r = e.session;
|
|
267
|
+
return j(r?.cell) && j(r.realm) && j(r.space) && j(r.stack) && (n.session = {
|
|
268
|
+
realm: r.realm,
|
|
269
|
+
space: r.space,
|
|
270
|
+
stack: r.stack,
|
|
271
|
+
cell: r.cell,
|
|
272
|
+
container: j(r.container)
|
|
273
|
+
}), n;
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
function Ee(e) {
|
|
277
|
+
return e === "logged in" ? "Logged in" : e === "empty" ? "Empty" : "Unknown";
|
|
278
|
+
}
|
|
279
|
+
function De(e) {
|
|
280
|
+
return e === "logged in" ? "ok" : e === "empty" ? "stopped" : "unknown";
|
|
281
|
+
}
|
|
282
|
+
function Oe(e) {
|
|
283
|
+
return e ? [
|
|
284
|
+
e.realm,
|
|
285
|
+
e.space,
|
|
286
|
+
e.stack,
|
|
287
|
+
e.cell
|
|
288
|
+
] : [];
|
|
289
|
+
}
|
|
290
|
+
function ke(e, t, n) {
|
|
291
|
+
let r = {
|
|
292
|
+
name: M(e),
|
|
293
|
+
scope: V(t, H(t))
|
|
294
|
+
};
|
|
295
|
+
return M(n) && (r.method = M(n)), r;
|
|
296
|
+
}
|
|
297
|
+
function Ae(e) {
|
|
298
|
+
let t = M(e);
|
|
299
|
+
return t ? /^[a-z0-9]([a-z0-9._-]*[a-z0-9])?$/.test(t) ? "" : "Use lowercase letters, digits, dots, dashes and underscores." : "Name the login identity.";
|
|
300
|
+
}
|
|
301
|
+
function je(e) {
|
|
302
|
+
return W(e) || !j(e?.harnessState) ? "" : e.harnessState === "ephemeral" ? re : j(e.volume);
|
|
303
|
+
}
|
|
304
|
+
function Me(e) {
|
|
305
|
+
return A(e).filter(we);
|
|
306
|
+
}
|
|
307
|
+
function Ne(e, t) {
|
|
308
|
+
let n = {};
|
|
309
|
+
for (let r of Me(e)) {
|
|
310
|
+
let e = P(t?.[r.connector]);
|
|
311
|
+
e && !I(e, G(r)) && (n[r.connector] = e);
|
|
312
|
+
}
|
|
313
|
+
return n;
|
|
314
|
+
}
|
|
315
|
+
function Pe(e) {
|
|
316
|
+
let t = A(e?.methods).filter((e) => j(e?.name));
|
|
317
|
+
return t.length > 1 ? t : [];
|
|
318
|
+
}
|
|
319
|
+
function Fe(e, t) {
|
|
320
|
+
let n = {};
|
|
321
|
+
for (let r of A(e)) {
|
|
322
|
+
let e = M(t?.[r.connector]);
|
|
323
|
+
e && j(r.method) && e !== r.method && (n[r.connector] = e);
|
|
324
|
+
}
|
|
325
|
+
return n;
|
|
326
|
+
}
|
|
327
|
+
function Ie(e, t, n) {
|
|
328
|
+
let r = Fe(e, n);
|
|
329
|
+
return A(e).map((e) => {
|
|
330
|
+
let n = r[e.connector], i = A(t).find((t) => t?.name === e.connector), a = n ? A(i?.methods).find((e) => e?.name === n) : void 0;
|
|
331
|
+
if (!a) return e;
|
|
332
|
+
let o = {
|
|
333
|
+
connector: e.connector,
|
|
334
|
+
component: j(a.component) || `${e.connector}-${n}`,
|
|
335
|
+
method: n,
|
|
336
|
+
delivery: j(a.delivery),
|
|
337
|
+
state: D
|
|
338
|
+
};
|
|
339
|
+
return e.title && (o.title = e.title), j(a.slot) && (o.slot = a.slot), o;
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
function Le(e, t) {
|
|
343
|
+
let n = Ne(e, t);
|
|
344
|
+
return A(e).filter((e) => z(e) && !n[e.connector]);
|
|
345
|
+
}
|
|
346
|
+
function Re(e, t) {
|
|
347
|
+
return A(e?.fields).filter((e) => j(e?.name) && (!A(e.secretTypes).length || e.secretTypes.includes(t))).map((e) => ({
|
|
348
|
+
name: e.name,
|
|
349
|
+
type: [
|
|
350
|
+
"list",
|
|
351
|
+
"person",
|
|
352
|
+
"secret"
|
|
353
|
+
].includes(e.type) ? e.type : x,
|
|
354
|
+
required: e.required === !0,
|
|
355
|
+
help: j(e.help),
|
|
356
|
+
enum: A(e.enum).filter((e) => typeof e == "string")
|
|
357
|
+
}));
|
|
358
|
+
}
|
|
359
|
+
function K(e) {
|
|
360
|
+
let t = A(e?.secretTypes).filter((e) => [
|
|
361
|
+
S,
|
|
362
|
+
C,
|
|
363
|
+
w
|
|
364
|
+
].includes(e));
|
|
365
|
+
return t.length ? t : [S];
|
|
366
|
+
}
|
|
367
|
+
function ze(e, t) {
|
|
368
|
+
return !A(e?.methods).length && e?.delivery === "git" && t === "opaque";
|
|
369
|
+
}
|
|
370
|
+
function Be(e) {
|
|
371
|
+
return !A(e?.methods).length && e?.delivery === "git";
|
|
372
|
+
}
|
|
373
|
+
function Ve(e) {
|
|
374
|
+
let t = {
|
|
375
|
+
realm: M(e?.realm) || "default",
|
|
376
|
+
makeDefault: e?.makeDefault === !0
|
|
377
|
+
}, n = it(e?.hosts);
|
|
378
|
+
n.length && (t.hosts = n);
|
|
379
|
+
for (let n of [
|
|
380
|
+
"name",
|
|
381
|
+
"key",
|
|
382
|
+
"passphraseFile"
|
|
383
|
+
]) M(e?.[n]) && (t[n] = M(e[n]));
|
|
384
|
+
return t;
|
|
385
|
+
}
|
|
386
|
+
function He(e, t) {
|
|
387
|
+
let n = K(e);
|
|
388
|
+
return {
|
|
389
|
+
name: j(t?.name) || (t ? "" : q(e)?.tokenName ?? ""),
|
|
390
|
+
type: n.includes(t?.type) ? t.type : n[0],
|
|
391
|
+
fields: { ...t?.identity ?? {} },
|
|
392
|
+
value: "",
|
|
393
|
+
username: "",
|
|
394
|
+
password: "",
|
|
395
|
+
privateKey: "",
|
|
396
|
+
passphrase: "",
|
|
397
|
+
publicKey: "",
|
|
398
|
+
certificate: "",
|
|
399
|
+
knownHosts: ""
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
var Ue = "kukeon.io/token-from";
|
|
403
|
+
function q(e) {
|
|
404
|
+
let t = e?.tokenForGit;
|
|
405
|
+
if (t && typeof t == "object") return {
|
|
406
|
+
connector: j(t.connector),
|
|
407
|
+
hosts: A(t.hosts).filter((e) => typeof e == "string"),
|
|
408
|
+
username: j(t.username),
|
|
409
|
+
name: j(t.name),
|
|
410
|
+
tokenName: j(t.tokenName)
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
function We(e) {
|
|
414
|
+
return A(e).filter((e) => !!q(e));
|
|
415
|
+
}
|
|
416
|
+
function Ge(e, t, n) {
|
|
417
|
+
let r = q(t), i = P(n);
|
|
418
|
+
if (r && i) return se(e, r.connector).find((e) => e.identity[Ue] === ae(i));
|
|
419
|
+
}
|
|
420
|
+
var Ke = "A login identity normally serves one role; another role may share it at your risk (its start rewrites role content in the state directory, and a Codex refresh token is single-use).";
|
|
421
|
+
function qe(e) {
|
|
422
|
+
return Array.isArray(e?.warnings) ? e.warnings.filter((e) => typeof e == "string" && e.trim() !== "") : [];
|
|
423
|
+
}
|
|
424
|
+
function Je(e) {
|
|
425
|
+
let t = j(e?.staleGit?.name);
|
|
426
|
+
return t ? `Git identity ${t} still holds the previous token: rotate again with "Also use this token for git" checked to rotate it too.` : void 0;
|
|
427
|
+
}
|
|
428
|
+
function Ye(e) {
|
|
429
|
+
return {
|
|
430
|
+
git: e === !0,
|
|
431
|
+
gitAuthorName: "",
|
|
432
|
+
gitAuthorEmail: "",
|
|
433
|
+
gitUsername: ""
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
function Xe(e) {
|
|
437
|
+
let t = {}, n = st(e?.gitAuthorName, e?.gitAuthorEmail);
|
|
438
|
+
return n && (t.author = n), M(e?.gitUsername) && (t.username = M(e.gitUsername)), t;
|
|
439
|
+
}
|
|
440
|
+
function Ze(e) {
|
|
441
|
+
let t = e?.git ? ct("Commit author", st(e.gitAuthorName, e.gitAuthorEmail)) : void 0;
|
|
442
|
+
return t ? [t] : [];
|
|
443
|
+
}
|
|
444
|
+
var Qe = {
|
|
445
|
+
[w]: {
|
|
446
|
+
label: "SSH key",
|
|
447
|
+
description: "clone, push and sign"
|
|
448
|
+
},
|
|
449
|
+
[C]: {
|
|
450
|
+
label: "Username and password or token",
|
|
451
|
+
description: "HTTPS"
|
|
452
|
+
},
|
|
453
|
+
[S]: {
|
|
454
|
+
label: "Author only",
|
|
455
|
+
description: "commits without push"
|
|
456
|
+
}
|
|
457
|
+
}, $e = {
|
|
458
|
+
[w]: {
|
|
459
|
+
label: "SSH key",
|
|
460
|
+
description: "a private key"
|
|
461
|
+
},
|
|
462
|
+
[C]: {
|
|
463
|
+
label: "Username and password or token",
|
|
464
|
+
description: "basic auth"
|
|
465
|
+
},
|
|
466
|
+
[S]: {
|
|
467
|
+
label: "Value",
|
|
468
|
+
description: "a single secret value"
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
function et(e) {
|
|
472
|
+
let t = Be(e) ? Qe : $e;
|
|
473
|
+
return K(e).map((e) => ({
|
|
474
|
+
type: e,
|
|
475
|
+
...t[e]
|
|
476
|
+
}));
|
|
477
|
+
}
|
|
478
|
+
function tt(e, t) {
|
|
479
|
+
let n = {
|
|
480
|
+
[T[0]]: `Everywhere in realm ${M(t) || "default"}`,
|
|
481
|
+
[T[1]]: "Only in one space…",
|
|
482
|
+
[T[2]]: "Only in one stack…"
|
|
483
|
+
};
|
|
484
|
+
return me(e).map((e) => ({
|
|
485
|
+
level: e,
|
|
486
|
+
label: n[e],
|
|
487
|
+
recommended: e === T[0]
|
|
488
|
+
}));
|
|
489
|
+
}
|
|
490
|
+
function nt(e, t, n, r) {
|
|
491
|
+
let i = M(e?.realm);
|
|
492
|
+
if (!i) return;
|
|
493
|
+
if (t === T[0]) return { realm: i };
|
|
494
|
+
let a = (e, t) => {
|
|
495
|
+
let n = A(e);
|
|
496
|
+
return n.includes(t) ? t : n.includes("default") ? ee : n[0];
|
|
497
|
+
}, o = a(n?.(i), M(e?.space));
|
|
498
|
+
if (!o) return;
|
|
499
|
+
if (t === T[1]) return {
|
|
500
|
+
realm: i,
|
|
501
|
+
space: o
|
|
502
|
+
};
|
|
503
|
+
let s = a(r?.(i, o), M(e?.stack));
|
|
504
|
+
return s ? {
|
|
505
|
+
realm: i,
|
|
506
|
+
space: o,
|
|
507
|
+
stack: s
|
|
508
|
+
} : void 0;
|
|
509
|
+
}
|
|
510
|
+
function rt(e, t, n) {
|
|
511
|
+
return n ? !ve(e, {
|
|
512
|
+
connector: t?.name,
|
|
513
|
+
component: n.component,
|
|
514
|
+
method: n.method
|
|
515
|
+
})?.effective : !1;
|
|
516
|
+
}
|
|
517
|
+
function it(e) {
|
|
518
|
+
return j(e).split(",").map((e) => e.trim()).filter(Boolean);
|
|
519
|
+
}
|
|
520
|
+
var at = /^[^<>]+<[^<>\s@]+@[^<>\s@]+>$/;
|
|
521
|
+
function ot(e) {
|
|
522
|
+
let t = j(e), n = /^([^<>]*)<([^<>]*)>\s*$/.exec(t);
|
|
523
|
+
return n ? {
|
|
524
|
+
name: n[1].trim(),
|
|
525
|
+
email: n[2].trim()
|
|
526
|
+
} : {
|
|
527
|
+
name: t.trim(),
|
|
528
|
+
email: ""
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
function st(e, t) {
|
|
532
|
+
let n = M(e), r = M(t);
|
|
533
|
+
return !n && !r ? "" : n ? `${n} <${r}>` : `<${r}>`;
|
|
534
|
+
}
|
|
535
|
+
function ct(e, t) {
|
|
536
|
+
let n = M(t);
|
|
537
|
+
if (!n) return;
|
|
538
|
+
let { name: r, email: i } = ot(n);
|
|
539
|
+
return !r || !i ? `${e} needs a name and an email.` : at.test(n) ? void 0 : `${e} needs a valid email.`;
|
|
540
|
+
}
|
|
541
|
+
function lt(e, t) {
|
|
542
|
+
let n = [];
|
|
543
|
+
M(t?.name) || n.push("Name is required.");
|
|
544
|
+
for (let r of Re(e, t?.type)) {
|
|
545
|
+
let e = M(t?.fields?.[r.name]);
|
|
546
|
+
if (!e) {
|
|
547
|
+
r.required && n.push(`${r.name} is required.`);
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
if (r.type === "person") {
|
|
551
|
+
let t = ct(r.name, e);
|
|
552
|
+
t && n.push(t);
|
|
553
|
+
}
|
|
554
|
+
let i = r.type === "list" ? it(e) : [e];
|
|
555
|
+
r.enum.length && i.some((e) => !r.enum.includes(e)) && n.push(`${r.name} must be one of: ${r.enum.join(", ")}.`);
|
|
556
|
+
}
|
|
557
|
+
return t?.type === "basic-auth" ? (M(t.username) || n.push("Username is required."), j(t.password) || n.push("Password or token is required.")) : t?.type === "ssh-key" ? M(t.privateKey) || n.push("Private key is required.") : !ze(e, t?.type) && !j(t?.value) && n.push("Value is required."), n;
|
|
558
|
+
}
|
|
559
|
+
function ut(e, t, n, r = {}) {
|
|
560
|
+
let i = K(e).includes(n?.type) ? n.type : K(e)[0], a = {
|
|
561
|
+
scope: V(t, H(t)),
|
|
562
|
+
name: M(n?.name),
|
|
563
|
+
type: i
|
|
564
|
+
}, o = {};
|
|
565
|
+
for (let t of Re(e, i)) {
|
|
566
|
+
let e = t.type === "list" ? it(n?.fields?.[t.name]).join(",") : M(n?.fields?.[t.name]);
|
|
567
|
+
e && (o[t.name] = e);
|
|
568
|
+
}
|
|
569
|
+
for (let [e, t] of Object.entries(n?.fields ?? {})) e.startsWith("kukeon.io/") && M(t) && (o[e] = M(t));
|
|
570
|
+
if (Object.keys(o).length && (a.identity = o), i === "basic-auth") a.username = M(n.username), a.password = j(n.password);
|
|
571
|
+
else if (i === "ssh-key") {
|
|
572
|
+
a.privateKey = j(n.privateKey);
|
|
573
|
+
for (let e of [
|
|
574
|
+
"passphrase",
|
|
575
|
+
"publicKey",
|
|
576
|
+
"certificate",
|
|
577
|
+
"knownHosts"
|
|
578
|
+
]) j(n[e]) && (a[e] = j(n[e]));
|
|
579
|
+
} else ze(e, i) || (a.value = j(n?.value));
|
|
580
|
+
return r.git && q(e) && i === "opaque" && (a.git = r.git), r.makeDefault && (a.makeDefault = !0, M(r.method) && (a.method = M(r.method))), a;
|
|
581
|
+
}
|
|
582
|
+
function dt(e) {
|
|
583
|
+
return {
|
|
584
|
+
...e,
|
|
585
|
+
value: "",
|
|
586
|
+
password: "",
|
|
587
|
+
privateKey: "",
|
|
588
|
+
passphrase: "",
|
|
589
|
+
publicKey: "",
|
|
590
|
+
certificate: "",
|
|
591
|
+
knownHosts: ""
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
var ft = [
|
|
595
|
+
S,
|
|
596
|
+
C,
|
|
597
|
+
w
|
|
598
|
+
];
|
|
599
|
+
function pt(e) {
|
|
600
|
+
return j(e?.spec?.type) || "opaque";
|
|
601
|
+
}
|
|
602
|
+
function mt(e) {
|
|
603
|
+
return {
|
|
604
|
+
...He({ secretTypes: [e ? pt(e) : S] }),
|
|
605
|
+
name: j(e?.metadata?.name)
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
function ht(e, t = !1) {
|
|
609
|
+
let n = [];
|
|
610
|
+
return !t && !M(e?.name) && n.push("Name is required."), !t && M(e?.name).startsWith(".") && n.push("A name cannot start with a dot."), ft.includes(e?.type) || n.push(`Type must be one of: ${ft.join(", ")}.`), e?.type === "basic-auth" ? (M(e.username) || n.push("Username is required."), j(e.password) || n.push("Password or token is required.")) : e?.type === "ssh-key" ? M(e.privateKey) || n.push("Private key is required.") : j(e?.value).replace(/[\r\n]+$/, "") || n.push("Value is required."), n;
|
|
611
|
+
}
|
|
612
|
+
function gt(e, t = !1) {
|
|
613
|
+
let n = ft.includes(e?.type) ? e.type : S, r = { type: n };
|
|
614
|
+
if (t && (r.replace = !0), n === "basic-auth") r.username = M(e.username), r.password = j(e.password);
|
|
615
|
+
else if (n === "ssh-key") {
|
|
616
|
+
r.privateKey = j(e.privateKey);
|
|
617
|
+
for (let t of [
|
|
618
|
+
"passphrase",
|
|
619
|
+
"publicKey",
|
|
620
|
+
"certificate",
|
|
621
|
+
"knownHosts"
|
|
622
|
+
]) j(e[t]) && (r[t] = j(e[t]));
|
|
623
|
+
} else r.value = j(e?.value);
|
|
624
|
+
return r;
|
|
625
|
+
}
|
|
626
|
+
function _t(e) {
|
|
627
|
+
return A(e).filter((e) => !be(e));
|
|
628
|
+
}
|
|
629
|
+
function vt(e) {
|
|
630
|
+
return A(e?.spec?.registryCredentials).map((t) => {
|
|
631
|
+
let n = t?.secretRef && M(t.secretRef.name) ? {
|
|
632
|
+
name: M(t.secretRef.name),
|
|
633
|
+
realm: M(t.secretRef.realm) || M(e?.metadata?.name)
|
|
634
|
+
} : void 0;
|
|
635
|
+
return {
|
|
636
|
+
server: j(t?.serverAddress),
|
|
637
|
+
username: j(t?.username),
|
|
638
|
+
...n ? { secret: n } : {}
|
|
639
|
+
};
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
// src/router.ts
|
|
643
|
+
var yt = {
|
|
644
|
+
current: () => window.location.hash.slice(1),
|
|
645
|
+
href: (e) => "#" + e,
|
|
646
|
+
navigate: (e) => {
|
|
647
|
+
window.location.hash = e;
|
|
648
|
+
},
|
|
649
|
+
subscribe: (e) => (window.addEventListener("hashchange", e), () => window.removeEventListener("hashchange", e))
|
|
650
|
+
}, J = yt;
|
|
651
|
+
function bt(e = yt) {
|
|
652
|
+
J = e;
|
|
653
|
+
}
|
|
654
|
+
function xt() {
|
|
655
|
+
return J.current();
|
|
656
|
+
}
|
|
657
|
+
function Y(e) {
|
|
658
|
+
return J.href(e);
|
|
659
|
+
}
|
|
660
|
+
function St(e) {
|
|
661
|
+
J.navigate(e);
|
|
662
|
+
}
|
|
663
|
+
function Ct(e) {
|
|
664
|
+
return J.subscribe(e);
|
|
665
|
+
}
|
|
666
|
+
// src/teams.mjs
|
|
667
|
+
var wt = "kuke", Tt = [
|
|
668
|
+
"branch",
|
|
669
|
+
"tag",
|
|
670
|
+
"commit"
|
|
671
|
+
], Et = "already_exists", X = (e) => Array.isArray(e) ? e : [], Z = (e) => typeof e == "string" ? e : "", Q = (e) => Z(e).trim();
|
|
672
|
+
function Dt(e, t) {
|
|
673
|
+
return e ? "/teams/" + encodeURIComponent(e) + (t === "edit" || t === "export" ? "/" + t : "") : "/teams";
|
|
674
|
+
}
|
|
675
|
+
var Ot = "/new-team";
|
|
676
|
+
function kt(e) {
|
|
677
|
+
return "/sources" + (e ? "/" + encodeURIComponent(e) : "");
|
|
678
|
+
}
|
|
679
|
+
function At(e, t) {
|
|
680
|
+
return e ? "/teams/" + encodeURIComponent(e) + (t ? "/" + t : "") : "/teams";
|
|
681
|
+
}
|
|
682
|
+
function jt(e, t = {}) {
|
|
683
|
+
let n = [t.hostFields ? "hostFields=1" : "", t.explicit ? "explicit=1" : ""].filter(Boolean).join("&");
|
|
684
|
+
return At(e, "export") + (n ? "?" + n : "");
|
|
685
|
+
}
|
|
686
|
+
function Mt(e, t) {
|
|
687
|
+
return e ? "/sources/" + encodeURIComponent(e) + (t ? "/" + t : "") : "/sources";
|
|
688
|
+
}
|
|
689
|
+
var Nt = "/sources/inspect", Pt = "/team-defaults";
|
|
690
|
+
function Ft(e) {
|
|
691
|
+
for (let t of Tt) if (Q(e?.[t])) return {
|
|
692
|
+
kind: t,
|
|
693
|
+
value: Q(e[t])
|
|
694
|
+
};
|
|
695
|
+
return {
|
|
696
|
+
kind: "",
|
|
697
|
+
value: ""
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
function It(e) {
|
|
701
|
+
let t = Ft(e);
|
|
702
|
+
return t.kind ? t.kind === "commit" ? `commit ${t.value.slice(0, 12)}` : `${t.kind} ${t.value}` : "default branch";
|
|
703
|
+
}
|
|
704
|
+
function Lt(e, t, n) {
|
|
705
|
+
let r = Q(n);
|
|
706
|
+
return r && Tt.includes(t) && (e[t] = r), e;
|
|
707
|
+
}
|
|
708
|
+
function Rt(e, t) {
|
|
709
|
+
let n = Q(t);
|
|
710
|
+
return e === "commit" && n && !/^([0-9a-f]{40}|[0-9a-f]{64})$/i.test(n) ? ["A commit is a full commit SHA."] : n && /[\s~^:?*[\\]|\.\.|@\{/.test(n) ? ["A branch or tag name has no spaces or special characters."] : [];
|
|
711
|
+
}
|
|
712
|
+
function zt(e) {
|
|
713
|
+
return /^[a-z0-9]([a-z0-9.-]*[a-z0-9])?$/.test(Q(e));
|
|
714
|
+
}
|
|
715
|
+
function Bt(e, t) {
|
|
716
|
+
return {
|
|
717
|
+
name: Q(e),
|
|
718
|
+
declaration: Z(t)
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
function Vt(e) {
|
|
722
|
+
return e?.code === Et;
|
|
723
|
+
}
|
|
724
|
+
function Ht(e) {
|
|
725
|
+
return e ? [
|
|
726
|
+
{
|
|
727
|
+
key: "create",
|
|
728
|
+
title: "Configs to create",
|
|
729
|
+
items: X(e.create)
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
key: "rerender",
|
|
733
|
+
title: "Configs to re-render",
|
|
734
|
+
items: X(e.rerender)
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
key: "prune",
|
|
738
|
+
title: "Configs to prune",
|
|
739
|
+
items: X(e.prune)
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
key: "createSecrets",
|
|
743
|
+
title: "Secrets to create",
|
|
744
|
+
items: X(e.createSecrets)
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
key: "missingSecrets",
|
|
748
|
+
title: "Missing secrets",
|
|
749
|
+
items: X(e.missingSecrets)
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
key: "notes",
|
|
753
|
+
title: "Notes",
|
|
754
|
+
items: X(e.notes)
|
|
755
|
+
}
|
|
756
|
+
].filter((e) => e.items.length) : [];
|
|
757
|
+
}
|
|
758
|
+
function Ut(e) {
|
|
759
|
+
let t = Z(e?.kind);
|
|
760
|
+
return t ? Q(e.detail) ? `${t} (${Q(e.detail)})` : t : "";
|
|
761
|
+
}
|
|
762
|
+
function Wt(e) {
|
|
763
|
+
let t = Z(e?.name);
|
|
764
|
+
return Q(e?.schedule) ? `${t} (${Q(e.schedule)}${e.suspend ? ", suspended" : ""})` : t;
|
|
765
|
+
}
|
|
766
|
+
function Gt(e) {
|
|
767
|
+
return X(e?.pairs).map((e) => ({
|
|
768
|
+
key: `${Z(e.role)}:${Z(e.harness)}`,
|
|
769
|
+
role: Z(e.role),
|
|
770
|
+
harness: Z(e.harness),
|
|
771
|
+
config: Z(e.config),
|
|
772
|
+
image: Z(e.image),
|
|
773
|
+
components: X(e.components),
|
|
774
|
+
tasks: X(e.tasks).map(Wt)
|
|
775
|
+
}));
|
|
776
|
+
}
|
|
777
|
+
function Kt(e) {
|
|
778
|
+
return {
|
|
779
|
+
roles: X(e?.roles).map((e) => ({
|
|
780
|
+
...e,
|
|
781
|
+
harnesses: X(e.harnesses),
|
|
782
|
+
default: !!e.default,
|
|
783
|
+
tasks: X(e.tasks).map((e) => typeof e == "string" ? { name: e } : {
|
|
784
|
+
name: Z(e?.name),
|
|
785
|
+
schedule: Z(e?.schedule),
|
|
786
|
+
suspend: !!e?.suspend,
|
|
787
|
+
args: Z(e?.args)
|
|
788
|
+
})
|
|
789
|
+
})),
|
|
790
|
+
harnesses: X(e?.harnesses).map((e) => ({
|
|
791
|
+
...e,
|
|
792
|
+
default: !!e.default
|
|
793
|
+
}))
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
function qt(e, t, n, r) {
|
|
797
|
+
let i = t === "harness" ? "defaultHarnesses" : "defaultRoles", a = Q(n?.name), o = X(e?.[i]).filter((e) => Z(e.name) !== a).map((e) => Z(e.name)), s = r ? [...o, `${a}=${Q(n?.source)}:${Q(n?.path)}`] : o;
|
|
798
|
+
return t === "harness" ? { harnesses: s } : { roles: s };
|
|
799
|
+
}
|
|
800
|
+
function Jt(e, t, n, r) {
|
|
801
|
+
return X(e?.[t === "harness" ? "defaultHarnesses" : "defaultRoles"]).some((e) => e.source === n && e.path === r);
|
|
802
|
+
}
|
|
803
|
+
function Yt(e) {
|
|
804
|
+
let t = Lt({
|
|
805
|
+
name: Q(e?.name),
|
|
806
|
+
url: Q(e?.url)
|
|
807
|
+
}, e?.refKind, e?.ref);
|
|
808
|
+
return Q(e?.identity) && (t.identity = Q(e.identity)), e?.force && (t.force = !0), t;
|
|
809
|
+
}
|
|
810
|
+
function Xt(e) {
|
|
811
|
+
let t = [];
|
|
812
|
+
return Q(e?.name) ? zt(e.name) && Q(e.name) !== "project" || t.push("A Source name is lowercase letters, digits, dots and hyphens, and not project.") : t.push("Name is required."), Q(e?.url) || t.push("Address is required."), [...t, ...Rt(e?.refKind, e?.ref)];
|
|
813
|
+
}
|
|
814
|
+
function Zt(e) {
|
|
815
|
+
let t = `${Z(e?.as)} ${Z(e?.name)}`.trim();
|
|
816
|
+
return Q(e?.team) ? `team ${e.team} (${t})` : t;
|
|
817
|
+
}
|
|
818
|
+
function Qt(e) {
|
|
819
|
+
return [...new Set(X(e?.usedBy).map((e) => Q(e?.team)).filter(Boolean))].sort();
|
|
820
|
+
}
|
|
821
|
+
function $t(e) {
|
|
822
|
+
let t = X(e?.inheriting);
|
|
823
|
+
return t.length ? `Teams inheriting from the defaults: ${t.join(", ")}. A change reaches each only when it is reapplied.` : "No stored team inherits from the defaults.";
|
|
824
|
+
}
|
|
825
|
+
function en(e) {
|
|
826
|
+
return {
|
|
827
|
+
removed: X(e?.removed).map((e) => `${Z(e.kind)} ${Z(e.name)}`),
|
|
828
|
+
liveCells: X(e?.liveCells),
|
|
829
|
+
keptVolumes: X(e?.keptVolumes)
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
function tn(e) {
|
|
833
|
+
return e?.inherited ? "inherited" : "declared";
|
|
834
|
+
}
|
|
835
|
+
function nn(e, t) {
|
|
836
|
+
return "/configs/" + [...X(e), t].map(encodeURIComponent).join("/");
|
|
837
|
+
}
|
|
838
|
+
function rn(e) {
|
|
839
|
+
let t = {
|
|
840
|
+
name: Z(e?.name),
|
|
841
|
+
url: Z(e?.url),
|
|
842
|
+
branch: "",
|
|
843
|
+
ref: ""
|
|
844
|
+
}, n = Ft(e);
|
|
845
|
+
return n.kind === "branch" ? t.branch = n.value : n.kind && (t.ref = n.value), t;
|
|
846
|
+
}
|
|
847
|
+
// src/routes.ts
|
|
848
|
+
var an = [
|
|
849
|
+
"realm",
|
|
850
|
+
"space",
|
|
851
|
+
"stack",
|
|
852
|
+
"cell",
|
|
853
|
+
"container"
|
|
854
|
+
], on = [
|
|
855
|
+
"Realms",
|
|
856
|
+
"Spaces",
|
|
857
|
+
"Stacks",
|
|
858
|
+
"Cells"
|
|
859
|
+
], sn = {
|
|
860
|
+
blueprints: "Blueprints",
|
|
861
|
+
configs: "Configs",
|
|
862
|
+
volumes: "Volumes",
|
|
863
|
+
secrets: "Secrets"
|
|
864
|
+
}, cn = () => ({
|
|
865
|
+
view: "workbench",
|
|
866
|
+
scope: [],
|
|
867
|
+
parent: [],
|
|
868
|
+
document: !1
|
|
869
|
+
});
|
|
870
|
+
function ln() {
|
|
871
|
+
return Y("/");
|
|
872
|
+
}
|
|
873
|
+
function un() {
|
|
874
|
+
return Y("/resources");
|
|
875
|
+
}
|
|
876
|
+
function dn() {
|
|
877
|
+
try {
|
|
878
|
+
let [e, t] = xt().split("?"), n = new URLSearchParams(t);
|
|
879
|
+
if (!e || e === "/" || e === "/workspace") return cn();
|
|
880
|
+
let r = e.split("/").filter(Boolean).map(decodeURIComponent);
|
|
881
|
+
if (r[0] === "new-cell") {
|
|
882
|
+
let e;
|
|
883
|
+
try {
|
|
884
|
+
e = JSON.parse(n.get("config") ?? "null");
|
|
885
|
+
} catch {
|
|
886
|
+
e = null;
|
|
887
|
+
}
|
|
888
|
+
return {
|
|
889
|
+
view: "new-cell",
|
|
890
|
+
scope: [],
|
|
891
|
+
parent: [],
|
|
892
|
+
document: !1,
|
|
893
|
+
config: Array.isArray(e) && e.every((e) => typeof e == "string") ? e.slice(0, 4) : void 0
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
if (r[0] === "new-config") {
|
|
897
|
+
let e;
|
|
898
|
+
try {
|
|
899
|
+
e = JSON.parse(n.get("blueprint") ?? "null");
|
|
900
|
+
} catch {
|
|
901
|
+
e = null;
|
|
902
|
+
}
|
|
903
|
+
return {
|
|
904
|
+
view: "new-config",
|
|
905
|
+
scope: [],
|
|
906
|
+
parent: [],
|
|
907
|
+
document: !1,
|
|
908
|
+
blueprint: Array.isArray(e) && e.every((e) => typeof e == "string") ? e.slice(0, 4) : void 0
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
if (r[0] === "agents" && r[1] === "new" && r.length === 2) return {
|
|
912
|
+
view: "new-agent",
|
|
913
|
+
scope: [],
|
|
914
|
+
parent: [],
|
|
915
|
+
document: !1
|
|
916
|
+
};
|
|
917
|
+
if (r[0] === "new-secret") return {
|
|
918
|
+
view: "new-secret",
|
|
919
|
+
scope: [],
|
|
920
|
+
parent: [],
|
|
921
|
+
document: !1
|
|
922
|
+
};
|
|
923
|
+
if (r[0] === "identities" || r[0] === "connectors") {
|
|
924
|
+
let e;
|
|
925
|
+
try {
|
|
926
|
+
e = JSON.parse(n.get("scope") ?? "null");
|
|
927
|
+
} catch {
|
|
928
|
+
e = null;
|
|
929
|
+
}
|
|
930
|
+
let t;
|
|
931
|
+
try {
|
|
932
|
+
t = JSON.parse(n.get("identity") ?? "null");
|
|
933
|
+
} catch {
|
|
934
|
+
t = null;
|
|
935
|
+
}
|
|
936
|
+
let i = Array.isArray(e) && e.every((e) => typeof e == "string") ? e.slice(0, 3) : void 0, a = r[2] === "new-identity" || r[2] === "rotate-identity" || r[0] === "identities" && r[2] === "new-login" ? r[2] : void 0, o = (e, n) => ({
|
|
937
|
+
view: "identities",
|
|
938
|
+
scope: a && e ? [e] : [],
|
|
939
|
+
parent: [],
|
|
940
|
+
document: !1,
|
|
941
|
+
target: i,
|
|
942
|
+
action: a,
|
|
943
|
+
identity: a && Array.isArray(t) && t.length >= 2 && t.every((e) => typeof e == "string") ? t.slice(0, 4) : void 0,
|
|
944
|
+
...e && !a ? { connector: e } : {},
|
|
945
|
+
...n ? { section: n } : {}
|
|
946
|
+
});
|
|
947
|
+
return r[0] === "connectors" ? r[1] && (a || i) ? o(r[1]) : {
|
|
948
|
+
view: "daemon-connectors",
|
|
949
|
+
scope: r.slice(1, 2),
|
|
950
|
+
parent: [],
|
|
951
|
+
document: !1
|
|
952
|
+
} : r[1] === "assignments" && !r[2] ? o(void 0, "assignments") : o(n.get("connector") || (a ? r[1] : r[1] || void 0));
|
|
953
|
+
}
|
|
954
|
+
if (r[0] === "teams") return {
|
|
955
|
+
view: "teams",
|
|
956
|
+
scope: r.slice(1, 2),
|
|
957
|
+
parent: [],
|
|
958
|
+
document: !1,
|
|
959
|
+
action: r[1] && (r[2] === "edit" || r[2] === "export") ? r[2] : void 0
|
|
960
|
+
};
|
|
961
|
+
if (r[0] === "new-team") return {
|
|
962
|
+
view: "new-team",
|
|
963
|
+
scope: [],
|
|
964
|
+
parent: [],
|
|
965
|
+
document: !1
|
|
966
|
+
};
|
|
967
|
+
if (r[0] === "sources") return {
|
|
968
|
+
view: "sources",
|
|
969
|
+
scope: r.slice(1, 2),
|
|
970
|
+
parent: [],
|
|
971
|
+
document: !1
|
|
972
|
+
};
|
|
973
|
+
if (r[0] === "health") return {
|
|
974
|
+
view: "health",
|
|
975
|
+
scope: [],
|
|
976
|
+
parent: [],
|
|
977
|
+
document: !1
|
|
978
|
+
};
|
|
979
|
+
if (r[0] === "daemon" && r[1] === "connectors") return {
|
|
980
|
+
view: "daemon-connectors",
|
|
981
|
+
scope: r.slice(2, 3),
|
|
982
|
+
parent: [],
|
|
983
|
+
document: !1
|
|
984
|
+
};
|
|
985
|
+
if (r[0] === "daemon") return {
|
|
986
|
+
view: r[1] === "logs" ? "daemon-logs" : r[1] === "health" ? "health" : "daemon",
|
|
987
|
+
scope: [],
|
|
988
|
+
parent: [],
|
|
989
|
+
document: !1
|
|
990
|
+
};
|
|
991
|
+
if (r[0] === "ext") return {
|
|
992
|
+
view: "extension",
|
|
993
|
+
scope: [],
|
|
994
|
+
parent: [],
|
|
995
|
+
document: !1,
|
|
996
|
+
extension: r[1] ?? "",
|
|
997
|
+
extensionPath: r.slice(2).join("/")
|
|
998
|
+
};
|
|
999
|
+
if (r[0] === "settings") return {
|
|
1000
|
+
view: "settings",
|
|
1001
|
+
scope: [],
|
|
1002
|
+
parent: [],
|
|
1003
|
+
document: !1
|
|
1004
|
+
};
|
|
1005
|
+
if (r[0] === "workspace") return r.length === 5 ? {
|
|
1006
|
+
view: "workspace",
|
|
1007
|
+
scope: r.slice(1),
|
|
1008
|
+
parent: [],
|
|
1009
|
+
document: !1
|
|
1010
|
+
} : cn();
|
|
1011
|
+
if (e === "/resources" || e === "/administration" || e === "/dashboard") return {
|
|
1012
|
+
view: "dashboard",
|
|
1013
|
+
scope: [],
|
|
1014
|
+
parent: [],
|
|
1015
|
+
document: !1
|
|
1016
|
+
};
|
|
1017
|
+
if (r[0] === "images") return {
|
|
1018
|
+
view: "images",
|
|
1019
|
+
scope: r.slice(1, 3),
|
|
1020
|
+
parent: [],
|
|
1021
|
+
document: !1
|
|
1022
|
+
};
|
|
1023
|
+
if (Object.keys(sn).includes(r[0])) return {
|
|
1024
|
+
view: r[0],
|
|
1025
|
+
scope: r.slice(1, 6),
|
|
1026
|
+
parent: [],
|
|
1027
|
+
document: n.has("document"),
|
|
1028
|
+
edit: n.has("edit")
|
|
1029
|
+
};
|
|
1030
|
+
if (r[0] === "resource") return {
|
|
1031
|
+
view: "resource",
|
|
1032
|
+
scope: r.slice(1, 6),
|
|
1033
|
+
parent: [],
|
|
1034
|
+
document: n.has("document")
|
|
1035
|
+
};
|
|
1036
|
+
if (on.some((e) => e.toLowerCase() === r[0])) {
|
|
1037
|
+
let e = JSON.parse(n.get("parent") ?? "[]"), t = n.get("state") ?? void 0;
|
|
1038
|
+
return {
|
|
1039
|
+
view: r[0],
|
|
1040
|
+
scope: [],
|
|
1041
|
+
parent: Array.isArray(e) && e.every((e) => typeof e == "string") ? e.slice(0, 4) : [],
|
|
1042
|
+
document: !1,
|
|
1043
|
+
...t ? { state: t } : {}
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
return {
|
|
1047
|
+
view: "resource",
|
|
1048
|
+
scope: r.slice(0, 5),
|
|
1049
|
+
parent: [],
|
|
1050
|
+
document: !1
|
|
1051
|
+
};
|
|
1052
|
+
} catch {
|
|
1053
|
+
return cn();
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
function fn(e) {
|
|
1057
|
+
return Y("/workspace/" + e.map(encodeURIComponent).join("/"));
|
|
1058
|
+
}
|
|
1059
|
+
function pn(e) {
|
|
1060
|
+
return Y("/new-cell" + (e?.length ? `?config=${encodeURIComponent(JSON.stringify(e))}` : ""));
|
|
1061
|
+
}
|
|
1062
|
+
function mn(e) {
|
|
1063
|
+
return Y("/new-config" + (e?.length ? `?blueprint=${encodeURIComponent(JSON.stringify(e))}` : ""));
|
|
1064
|
+
}
|
|
1065
|
+
function hn() {
|
|
1066
|
+
return Y("/agents/new");
|
|
1067
|
+
}
|
|
1068
|
+
function gn() {
|
|
1069
|
+
return Y("/new-secret");
|
|
1070
|
+
}
|
|
1071
|
+
function _n(e, t, n = {}) {
|
|
1072
|
+
return Y(`/${e}/` + t.map(encodeURIComponent).join("/") + (n.document ? "?document=1" : n.edit ? "?edit=1" : ""));
|
|
1073
|
+
}
|
|
1074
|
+
function vn() {
|
|
1075
|
+
return Y("/settings");
|
|
1076
|
+
}
|
|
1077
|
+
function yn() {
|
|
1078
|
+
return Y("/daemon/health");
|
|
1079
|
+
}
|
|
1080
|
+
function bn(e) {
|
|
1081
|
+
return Y("/daemon" + (e ? `/${e}` : ""));
|
|
1082
|
+
}
|
|
1083
|
+
function xn(e, t) {
|
|
1084
|
+
return Y("/images" + [e, t].filter((e) => !!e).map((e) => "/" + encodeURIComponent(e)).join(""));
|
|
1085
|
+
}
|
|
1086
|
+
function Sn(e, t = !1) {
|
|
1087
|
+
return Y("/resource/" + e.map(encodeURIComponent).join("/") + (t ? "?document=1" : ""));
|
|
1088
|
+
}
|
|
1089
|
+
function Cn(e, t = [], n) {
|
|
1090
|
+
let r = [t.length ? `parent=${encodeURIComponent(JSON.stringify(t))}` : "", n ? `state=${encodeURIComponent(n)}` : ""].filter(Boolean).join("&");
|
|
1091
|
+
return Y(`/${on[e].toLowerCase()}` + (r ? `?${r}` : ""));
|
|
1092
|
+
}
|
|
1093
|
+
function wn(e, t) {
|
|
1094
|
+
return Y(Dt(e, t));
|
|
1095
|
+
}
|
|
1096
|
+
function Tn() {
|
|
1097
|
+
return Y(Ot);
|
|
1098
|
+
}
|
|
1099
|
+
function En(e) {
|
|
1100
|
+
return Y(kt(e));
|
|
1101
|
+
}
|
|
1102
|
+
function Dn(e, t) {
|
|
1103
|
+
return Y(nn(e, t));
|
|
1104
|
+
}
|
|
1105
|
+
function On(e) {
|
|
1106
|
+
return "/" + e.map((e, t) => `${an[t]}s/${encodeURIComponent(e)}`).join("/");
|
|
1107
|
+
}
|
|
1108
|
+
// src/notifications.tsx
|
|
1109
|
+
var kn = 5e3, An = 3, jn = e({
|
|
1110
|
+
notify: () => {},
|
|
1111
|
+
dismiss: () => {}
|
|
1112
|
+
});
|
|
1113
|
+
function Mn() {
|
|
1114
|
+
return n(jn);
|
|
1115
|
+
}
|
|
1116
|
+
function Nn({ toast: e, onDismiss: t }) {
|
|
1117
|
+
let [n, i] = c(!1), [a, o] = c(!1), l = s(kn);
|
|
1118
|
+
return r(() => {
|
|
1119
|
+
l.current = kn;
|
|
1120
|
+
}, [e.revision]), r(() => {
|
|
1121
|
+
if (e.tone !== "success" || n || a) return;
|
|
1122
|
+
let r = Date.now(), i = window.setTimeout(() => t(e.key), l.current);
|
|
1123
|
+
return () => {
|
|
1124
|
+
window.clearTimeout(i), l.current = Math.max(0, l.current - (Date.now() - r));
|
|
1125
|
+
};
|
|
1126
|
+
}, [
|
|
1127
|
+
e.key,
|
|
1128
|
+
e.tone,
|
|
1129
|
+
e.revision,
|
|
1130
|
+
n,
|
|
1131
|
+
a,
|
|
1132
|
+
t
|
|
1133
|
+
]), /* @__PURE__ */ f("div", {
|
|
1134
|
+
className: `toast ${e.tone}`,
|
|
1135
|
+
"data-toast": e.key,
|
|
1136
|
+
onPointerMove: () => i(!0),
|
|
1137
|
+
onPointerLeave: () => i(!1),
|
|
1138
|
+
onFocus: () => o(!0),
|
|
1139
|
+
onBlur: (e) => {
|
|
1140
|
+
e.currentTarget.contains(e.relatedTarget) || o(!1);
|
|
1141
|
+
},
|
|
1142
|
+
onKeyDown: (n) => {
|
|
1143
|
+
n.key === "Escape" && (n.stopPropagation(), t(e.key));
|
|
1144
|
+
},
|
|
1145
|
+
children: [
|
|
1146
|
+
/* @__PURE__ */ d("span", {
|
|
1147
|
+
className: "toast-icon",
|
|
1148
|
+
"aria-hidden": "true"
|
|
1149
|
+
}),
|
|
1150
|
+
/* @__PURE__ */ f("div", {
|
|
1151
|
+
className: "toast-body",
|
|
1152
|
+
children: [
|
|
1153
|
+
e.title && /* @__PURE__ */ d("strong", {
|
|
1154
|
+
className: "toast-title",
|
|
1155
|
+
children: e.title
|
|
1156
|
+
}),
|
|
1157
|
+
/* @__PURE__ */ d("p", { children: e.message }),
|
|
1158
|
+
e.link && /* @__PURE__ */ d("a", {
|
|
1159
|
+
className: "text-link",
|
|
1160
|
+
href: e.link.href,
|
|
1161
|
+
children: e.link.label
|
|
1162
|
+
})
|
|
1163
|
+
]
|
|
1164
|
+
}),
|
|
1165
|
+
/* @__PURE__ */ d("button", {
|
|
1166
|
+
type: "button",
|
|
1167
|
+
className: "toast-dismiss",
|
|
1168
|
+
"aria-label": "Dismiss notification",
|
|
1169
|
+
onClick: () => t(e.key),
|
|
1170
|
+
children: "×"
|
|
1171
|
+
})
|
|
1172
|
+
]
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
function Pn({ children: e }) {
|
|
1176
|
+
let [n, i] = c([]), [l, u] = c(!1), [p, m] = c({
|
|
1177
|
+
polite: "",
|
|
1178
|
+
assertive: "",
|
|
1179
|
+
count: 0
|
|
1180
|
+
}), h = s(null), g = t((e) => {
|
|
1181
|
+
i((t) => t.find((t) => t.key === e.key) ? t.map((t) => t.key === e.key ? {
|
|
1182
|
+
...e,
|
|
1183
|
+
revision: t.revision + 1
|
|
1184
|
+
} : t) : [{
|
|
1185
|
+
...e,
|
|
1186
|
+
revision: 0
|
|
1187
|
+
}, ...t]);
|
|
1188
|
+
let t = e.title ? `${e.title}: ${e.message}` : e.message;
|
|
1189
|
+
m((n) => {
|
|
1190
|
+
let r = n.count + 1, i = r % 2 ? t : `${t}`;
|
|
1191
|
+
return e.tone === "error" ? {
|
|
1192
|
+
polite: "",
|
|
1193
|
+
assertive: i,
|
|
1194
|
+
count: r
|
|
1195
|
+
} : {
|
|
1196
|
+
polite: i,
|
|
1197
|
+
assertive: "",
|
|
1198
|
+
count: r
|
|
1199
|
+
};
|
|
1200
|
+
});
|
|
1201
|
+
}, []), _ = t((e) => i((t) => t.filter((t) => t.key !== e)), []), v = o(() => ({
|
|
1202
|
+
notify: g,
|
|
1203
|
+
dismiss: _
|
|
1204
|
+
}), [g, _]), y = n.length > 0;
|
|
1205
|
+
a(() => {
|
|
1206
|
+
let e = h.current, t = document.querySelector(".toolbar");
|
|
1207
|
+
if (!y || !e) return;
|
|
1208
|
+
let n = () => e.style.setProperty("--toast-top", `${Math.max(0, Math.ceil(t?.getBoundingClientRect().bottom ?? 0)) + 8}px`);
|
|
1209
|
+
n();
|
|
1210
|
+
let r = new ResizeObserver(n);
|
|
1211
|
+
return t && r.observe(t), window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), () => {
|
|
1212
|
+
r.disconnect(), window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
|
|
1213
|
+
};
|
|
1214
|
+
}, [y]), r(() => {
|
|
1215
|
+
n.length <= An && u(!1);
|
|
1216
|
+
}, [n.length]);
|
|
1217
|
+
let b = l ? n : n.slice(0, An), x = n.length - b.length;
|
|
1218
|
+
return /* @__PURE__ */ f(jn.Provider, {
|
|
1219
|
+
value: v,
|
|
1220
|
+
children: [
|
|
1221
|
+
e,
|
|
1222
|
+
/* @__PURE__ */ f("section", {
|
|
1223
|
+
className: "toast-stack",
|
|
1224
|
+
ref: h,
|
|
1225
|
+
"aria-label": "Notifications",
|
|
1226
|
+
hidden: !y,
|
|
1227
|
+
children: [
|
|
1228
|
+
b.map((e) => /* @__PURE__ */ d(Nn, {
|
|
1229
|
+
toast: e,
|
|
1230
|
+
onDismiss: _
|
|
1231
|
+
}, e.key)),
|
|
1232
|
+
x > 0 && /* @__PURE__ */ f("button", {
|
|
1233
|
+
type: "button",
|
|
1234
|
+
className: "toast-more",
|
|
1235
|
+
onClick: () => u(!0),
|
|
1236
|
+
children: [
|
|
1237
|
+
x,
|
|
1238
|
+
" older ",
|
|
1239
|
+
x === 1 ? "notification" : "notifications"
|
|
1240
|
+
]
|
|
1241
|
+
}),
|
|
1242
|
+
l && n.length > An && /* @__PURE__ */ d("button", {
|
|
1243
|
+
type: "button",
|
|
1244
|
+
className: "toast-more",
|
|
1245
|
+
onClick: () => u(!1),
|
|
1246
|
+
children: "Show fewer"
|
|
1247
|
+
})
|
|
1248
|
+
]
|
|
1249
|
+
}),
|
|
1250
|
+
/* @__PURE__ */ d("div", {
|
|
1251
|
+
className: "sr-only",
|
|
1252
|
+
role: "status",
|
|
1253
|
+
"aria-live": "polite",
|
|
1254
|
+
"aria-atomic": "true",
|
|
1255
|
+
children: p.polite
|
|
1256
|
+
}),
|
|
1257
|
+
/* @__PURE__ */ d("div", {
|
|
1258
|
+
className: "sr-only",
|
|
1259
|
+
role: "alert",
|
|
1260
|
+
"aria-live": "assertive",
|
|
1261
|
+
"aria-atomic": "true",
|
|
1262
|
+
children: p.assertive
|
|
1263
|
+
})
|
|
1264
|
+
]
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
function Fn({ inventory: e }) {
|
|
1268
|
+
let t = s(null), n = s(null), r = e.error, i = r ? e.data ? "stale" : "unavailable" : e.data?.failures.length ? "incomplete" : "";
|
|
1269
|
+
if (!i) return null;
|
|
1270
|
+
let a = r ? r.code === "partial" ? r.message.split("; ") : [`${g(r)}: ${r.message}`] : e.data?.failures ?? [], o = i === "stale" ? "The last refresh failed. Counts and lists show the previous inventory and may be out of date." : i === "unavailable" ? "The inventory could not be retrieved." : "Some scopes could not be loaded. Counts and lists exclude unavailable resources.", c = `Inventory ${i}`;
|
|
1271
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("button", {
|
|
1272
|
+
ref: n,
|
|
1273
|
+
type: "button",
|
|
1274
|
+
className: `icon-button inventory-indicator ${i}`,
|
|
1275
|
+
popoverTarget: "inventory-status",
|
|
1276
|
+
"aria-label": `${c}: show details`,
|
|
1277
|
+
"data-tooltip": c,
|
|
1278
|
+
onClick: () => {
|
|
1279
|
+
let e = n.current?.getBoundingClientRect();
|
|
1280
|
+
if (!e || !t.current) return;
|
|
1281
|
+
t.current.style.setProperty("--popover-top", `${Math.ceil(e.bottom) + 6}px`);
|
|
1282
|
+
let r = Math.min(360, window.innerWidth - 32);
|
|
1283
|
+
t.current.style.setProperty("--popover-left", `${Math.max(16, Math.min(Math.floor(e.left), window.innerWidth - 16 - r))}px`);
|
|
1284
|
+
},
|
|
1285
|
+
children: /* @__PURE__ */ d(p, { name: "warning" })
|
|
1286
|
+
}), /* @__PURE__ */ f("div", {
|
|
1287
|
+
ref: t,
|
|
1288
|
+
id: "inventory-status",
|
|
1289
|
+
className: "inventory-popover",
|
|
1290
|
+
popover: "auto",
|
|
1291
|
+
role: "dialog",
|
|
1292
|
+
"aria-label": "Inventory status",
|
|
1293
|
+
children: [
|
|
1294
|
+
/* @__PURE__ */ f("h2", { children: [c[0].toUpperCase(), c.slice(1)] }),
|
|
1295
|
+
/* @__PURE__ */ d("p", { children: o }),
|
|
1296
|
+
a.length > 0 && /* @__PURE__ */ d("ul", { children: a.map((e) => /* @__PURE__ */ d("li", { children: e }, e)) }),
|
|
1297
|
+
/* @__PURE__ */ d("p", {
|
|
1298
|
+
className: "description",
|
|
1299
|
+
children: e.data?.updatedAt ? /* @__PURE__ */ f(u, { children: ["Last successful refresh: ", /* @__PURE__ */ d("time", {
|
|
1300
|
+
dateTime: e.data.updatedAt,
|
|
1301
|
+
children: new Date(e.data.updatedAt).toLocaleString()
|
|
1302
|
+
})] }) : "No successful refresh yet."
|
|
1303
|
+
})
|
|
1304
|
+
]
|
|
1305
|
+
})] });
|
|
1306
|
+
}
|
|
1307
|
+
// src/connector-ui.tsx
|
|
1308
|
+
function $(e) {
|
|
1309
|
+
let t = e;
|
|
1310
|
+
return {
|
|
1311
|
+
code: t?.code ?? "unavailable",
|
|
1312
|
+
message: t?.message ?? "Request failed. Try again."
|
|
1313
|
+
};
|
|
1314
|
+
}
|
|
1315
|
+
async function In(e, t) {
|
|
1316
|
+
let n = await l(e, {
|
|
1317
|
+
method: "POST",
|
|
1318
|
+
headers: {
|
|
1319
|
+
Accept: "application/json",
|
|
1320
|
+
"Content-Type": "application/json"
|
|
1321
|
+
},
|
|
1322
|
+
body: typeof t == "string" ? t : JSON.stringify(t)
|
|
1323
|
+
}), r = await n.json().catch(() => ({}));
|
|
1324
|
+
if (!n.ok) throw r.error ?? {
|
|
1325
|
+
code: "http_error",
|
|
1326
|
+
message: `HTTP ${n.status}`
|
|
1327
|
+
};
|
|
1328
|
+
return r;
|
|
1329
|
+
}
|
|
1330
|
+
function Ln(e, t) {
|
|
1331
|
+
return `/connectors/${encodeURIComponent(e)}/${t}`;
|
|
1332
|
+
}
|
|
1333
|
+
function Rn(e) {
|
|
1334
|
+
return Y("/daemon/connectors" + (e ? `/${encodeURIComponent(e)}` : ""));
|
|
1335
|
+
}
|
|
1336
|
+
function zn(e, t) {
|
|
1337
|
+
let n = U(t), r = [e ? `connector=${encodeURIComponent(e)}` : "", e && n.length ? `scope=${encodeURIComponent(JSON.stringify(n))}` : ""].filter(Boolean).join("&");
|
|
1338
|
+
return Y("/identities" + (r ? `?${r}` : ""));
|
|
1339
|
+
}
|
|
1340
|
+
function Bn(e, t) {
|
|
1341
|
+
let n = U(t);
|
|
1342
|
+
return Y(`/identities/${encodeURIComponent(e)}/new-identity` + (n.length ? `?scope=${encodeURIComponent(JSON.stringify(n))}` : ""));
|
|
1343
|
+
}
|
|
1344
|
+
function Vn(e, t) {
|
|
1345
|
+
let n = U(t);
|
|
1346
|
+
return Y(`/identities/${encodeURIComponent(e)}/new-login` + (n.length ? `?scope=${encodeURIComponent(JSON.stringify(n))}` : ""));
|
|
1347
|
+
}
|
|
1348
|
+
function Hn(e, t, n) {
|
|
1349
|
+
let r = P(t), i = U(n);
|
|
1350
|
+
return Y(`/identities/${encodeURIComponent(e)}/rotate-identity` + (r ? `?identity=${encodeURIComponent(JSON.stringify([...L(r), r.name]))}` : "") + (i.length ? `${r ? "&" : "?"}scope=${encodeURIComponent(JSON.stringify(i))}` : ""));
|
|
1351
|
+
}
|
|
1352
|
+
function Un(e) {
|
|
1353
|
+
return `${e[0].toUpperCase()}${e.slice(1)}`;
|
|
1354
|
+
}
|
|
1355
|
+
function Wn(e, t) {
|
|
1356
|
+
return `${Un(e)} — ${U(V(t, e)).join(" / ")}`;
|
|
1357
|
+
}
|
|
1358
|
+
function Gn({ status: e }) {
|
|
1359
|
+
let t = e.state === "resolved" ? "ok" : z(e) ? "error" : "stopped";
|
|
1360
|
+
return /* @__PURE__ */ f("span", {
|
|
1361
|
+
className: `state-badge tone-${t}`,
|
|
1362
|
+
children: [/* @__PURE__ */ d("span", {
|
|
1363
|
+
className: "state-dot",
|
|
1364
|
+
"aria-hidden": "true"
|
|
1365
|
+
}), e.state === "resolved" ? "Resolved" : z(e) ? "Unresolved" : "Not set"]
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
function Kn(e) {
|
|
1369
|
+
return Y("/volumes/" + [
|
|
1370
|
+
e.realm,
|
|
1371
|
+
e.space,
|
|
1372
|
+
e.stack,
|
|
1373
|
+
e.name
|
|
1374
|
+
].filter(Boolean).map((e) => encodeURIComponent(e)).join("/"));
|
|
1375
|
+
}
|
|
1376
|
+
function qn({ status: e }) {
|
|
1377
|
+
return e.volumeRef ? /* @__PURE__ */ d("a", {
|
|
1378
|
+
className: "resource-name",
|
|
1379
|
+
href: Kn(e.volumeRef),
|
|
1380
|
+
children: /* @__PURE__ */ d("code", { children: e.volumeRef.name })
|
|
1381
|
+
}) : e.volume ? /* @__PURE__ */ d("code", { children: e.volume }) : /* @__PURE__ */ d(u, { children: "of the harness" });
|
|
1382
|
+
}
|
|
1383
|
+
function Jn({ state: e }) {
|
|
1384
|
+
return /* @__PURE__ */ f("span", {
|
|
1385
|
+
className: `state-badge tone-${De(e)}`,
|
|
1386
|
+
children: [/* @__PURE__ */ d("span", {
|
|
1387
|
+
className: "state-dot",
|
|
1388
|
+
"aria-hidden": "true"
|
|
1389
|
+
}), Ee(e)]
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
function Yn({ status: e }) {
|
|
1393
|
+
return je(e) ? /* @__PURE__ */ f("span", {
|
|
1394
|
+
className: "connector-harness-state",
|
|
1395
|
+
children: [" · State: ", e.harnessState === "ephemeral" ? /* @__PURE__ */ f(u, { children: ["ephemeral ", /* @__PURE__ */ d("span", {
|
|
1396
|
+
className: "description",
|
|
1397
|
+
children: "(no state volume)"
|
|
1398
|
+
})] }) : /* @__PURE__ */ d(qn, { status: e })]
|
|
1399
|
+
}) : null;
|
|
1400
|
+
}
|
|
1401
|
+
function Xn({ status: e, team: t = "" }) {
|
|
1402
|
+
return W(e) ? /* @__PURE__ */ f("span", { children: [
|
|
1403
|
+
"Login identity ",
|
|
1404
|
+
/* @__PURE__ */ d(qn, { status: e }),
|
|
1405
|
+
e.volumeRef && /* @__PURE__ */ f(u, { children: [" ", /* @__PURE__ */ d("span", {
|
|
1406
|
+
className: "description",
|
|
1407
|
+
children: L(e.volumeRef).join(" / ")
|
|
1408
|
+
})] }),
|
|
1409
|
+
e.origin && /* @__PURE__ */ f(u, { children: [" ", /* @__PURE__ */ d("span", {
|
|
1410
|
+
className: "badge",
|
|
1411
|
+
children: ue(e.origin, t)
|
|
1412
|
+
})] }),
|
|
1413
|
+
e.login && /* @__PURE__ */ f(u, { children: [" ", /* @__PURE__ */ d(Jn, { state: e.login.state })] })
|
|
1414
|
+
] }) : e.identity ? /* @__PURE__ */ f("span", { children: [
|
|
1415
|
+
/* @__PURE__ */ d("code", { children: e.identity.name }),
|
|
1416
|
+
" ",
|
|
1417
|
+
/* @__PURE__ */ d("span", {
|
|
1418
|
+
className: "description",
|
|
1419
|
+
children: L(e.identity).join(" / ")
|
|
1420
|
+
}),
|
|
1421
|
+
e.origin && /* @__PURE__ */ f(u, { children: [" ", /* @__PURE__ */ d("span", {
|
|
1422
|
+
className: "badge",
|
|
1423
|
+
children: ue(e.origin, t)
|
|
1424
|
+
})] }),
|
|
1425
|
+
/* @__PURE__ */ d(Yn, { status: e })
|
|
1426
|
+
] }) : /* @__PURE__ */ f("span", { children: [
|
|
1427
|
+
"No identity",
|
|
1428
|
+
e.required ? " — required" : "",
|
|
1429
|
+
/* @__PURE__ */ d(Yn, { status: e })
|
|
1430
|
+
] });
|
|
1431
|
+
}
|
|
1432
|
+
async function Zn(e, t, n) {
|
|
1433
|
+
let [r] = Te([(await In(Ln(e, "login"), ke(t.name ?? "", t, n))).identity], e);
|
|
1434
|
+
return r?.session && St(fn(Oe(r.session))), r;
|
|
1435
|
+
}
|
|
1436
|
+
function Qn({ connector: e, title: t, volume: n, state: r, running: i = !1, method: a, disabled: o = !1, idle: s = "Log in", className: l = "subtle-button", onStarted: p }) {
|
|
1437
|
+
let [m, h] = c(!1), [g, v] = c(), y = i ? "Open login session" : r === "logged in" ? "Log in again" : s;
|
|
1438
|
+
async function b() {
|
|
1439
|
+
if (!m) {
|
|
1440
|
+
h(!0), v(void 0);
|
|
1441
|
+
try {
|
|
1442
|
+
await Zn(e, n, a), p?.();
|
|
1443
|
+
} catch (e) {
|
|
1444
|
+
v($(e));
|
|
1445
|
+
} finally {
|
|
1446
|
+
h(!1);
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("button", {
|
|
1451
|
+
type: "button",
|
|
1452
|
+
className: l,
|
|
1453
|
+
"aria-label": `${y}: ${t} identity ${R(n)}`,
|
|
1454
|
+
disabled: o || m,
|
|
1455
|
+
onClick: () => void b(),
|
|
1456
|
+
children: m ? "Starting…" : y
|
|
1457
|
+
}), g && /* @__PURE__ */ d(_, {
|
|
1458
|
+
error: g,
|
|
1459
|
+
kind: "Identity"
|
|
1460
|
+
})] });
|
|
1461
|
+
}
|
|
1462
|
+
function $n({ label: e, identities: t, value: n, onChange: r, emptyLabel: a, extra: o = [], disabled: s = !1, help: c }) {
|
|
1463
|
+
let l = i(), u = t.map((e) => ({
|
|
1464
|
+
ref: e.volume,
|
|
1465
|
+
text: `${R(e.volume)} — ${Ee(e.state)}${e.usedBy.length ? `, used by ${e.usedBy[0].name}${e.usedBy.length > 1 ? ` (+${e.usedBy.length - 1})` : ""}` : ""}`
|
|
1466
|
+
}));
|
|
1467
|
+
for (let e of o) e && !u.some((t) => I(t.ref, e)) && u.push({
|
|
1468
|
+
ref: e,
|
|
1469
|
+
text: R(e)
|
|
1470
|
+
});
|
|
1471
|
+
let p = F(n);
|
|
1472
|
+
return /* @__PURE__ */ f("div", {
|
|
1473
|
+
className: "schema-field secret-picker",
|
|
1474
|
+
children: [
|
|
1475
|
+
/* @__PURE__ */ d("label", {
|
|
1476
|
+
htmlFor: l,
|
|
1477
|
+
children: /* @__PURE__ */ d("span", { children: e })
|
|
1478
|
+
}),
|
|
1479
|
+
/* @__PURE__ */ f("select", {
|
|
1480
|
+
id: l,
|
|
1481
|
+
value: u.some((e) => F(e.ref) === p) ? p : "",
|
|
1482
|
+
disabled: s,
|
|
1483
|
+
onChange: (e) => r(u.find((t) => F(t.ref) === e.target.value)?.ref),
|
|
1484
|
+
children: [/* @__PURE__ */ d("option", {
|
|
1485
|
+
value: "",
|
|
1486
|
+
children: a
|
|
1487
|
+
}), u.map((e) => /* @__PURE__ */ d("option", {
|
|
1488
|
+
value: F(e.ref),
|
|
1489
|
+
children: e.text
|
|
1490
|
+
}, F(e.ref)))]
|
|
1491
|
+
}),
|
|
1492
|
+
c && /* @__PURE__ */ d("small", { children: c })
|
|
1493
|
+
]
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1496
|
+
function er({ label: e, identities: t, value: n, onChange: r, emptyLabel: a, extra: o = [], disabled: s = !1, required: l = !1, help: u, realm: p = "", id: m, invalid: h = !1 }) {
|
|
1497
|
+
let g = i(), _ = m ?? g, v = t.map((e) => ({
|
|
1498
|
+
ref: P(e),
|
|
1499
|
+
text: `${R(e)} (${e.type})`
|
|
1500
|
+
}));
|
|
1501
|
+
for (let e of o) e && !v.some((t) => F(t.ref) === F(e)) && v.push({
|
|
1502
|
+
ref: e,
|
|
1503
|
+
text: `${R(e)} (not tagged)`
|
|
1504
|
+
});
|
|
1505
|
+
let y = F(n), b = v.some((e) => F(e.ref) === y), [x, S] = c(!1), C = x || !!y && !b, w = (e, t) => r({
|
|
1506
|
+
...n,
|
|
1507
|
+
[e]: t
|
|
1508
|
+
});
|
|
1509
|
+
return /* @__PURE__ */ f("div", {
|
|
1510
|
+
className: "schema-field secret-picker",
|
|
1511
|
+
children: [
|
|
1512
|
+
/* @__PURE__ */ d("label", {
|
|
1513
|
+
htmlFor: _,
|
|
1514
|
+
children: /* @__PURE__ */ f("span", { children: [e, l && /* @__PURE__ */ d("b", {
|
|
1515
|
+
"aria-label": "required",
|
|
1516
|
+
children: " *"
|
|
1517
|
+
})] })
|
|
1518
|
+
}),
|
|
1519
|
+
/* @__PURE__ */ f("select", {
|
|
1520
|
+
id: _,
|
|
1521
|
+
value: C ? "manual" : y,
|
|
1522
|
+
disabled: s,
|
|
1523
|
+
"aria-invalid": h || void 0,
|
|
1524
|
+
onChange: (e) => {
|
|
1525
|
+
e.target.value === "manual" ? (S(!0), r({
|
|
1526
|
+
name: "",
|
|
1527
|
+
realm: p
|
|
1528
|
+
})) : (S(!1), r(v.find((t) => F(t.ref) === e.target.value)?.ref));
|
|
1529
|
+
},
|
|
1530
|
+
children: [
|
|
1531
|
+
/* @__PURE__ */ d("option", {
|
|
1532
|
+
value: "",
|
|
1533
|
+
children: a
|
|
1534
|
+
}),
|
|
1535
|
+
v.map((e) => /* @__PURE__ */ d("option", {
|
|
1536
|
+
value: F(e.ref),
|
|
1537
|
+
children: e.text
|
|
1538
|
+
}, F(e.ref))),
|
|
1539
|
+
/* @__PURE__ */ d("option", {
|
|
1540
|
+
value: "manual",
|
|
1541
|
+
children: "Name a secret…"
|
|
1542
|
+
})
|
|
1543
|
+
]
|
|
1544
|
+
}),
|
|
1545
|
+
C && /* @__PURE__ */ f("div", {
|
|
1546
|
+
className: "map-entry",
|
|
1547
|
+
children: [
|
|
1548
|
+
/* @__PURE__ */ f("label", { children: ["Secret name", /* @__PURE__ */ d("input", {
|
|
1549
|
+
"aria-label": `${e} secret name`,
|
|
1550
|
+
value: n?.name ?? "",
|
|
1551
|
+
disabled: s,
|
|
1552
|
+
onChange: (e) => w("name", e.target.value)
|
|
1553
|
+
})] }),
|
|
1554
|
+
/* @__PURE__ */ f("label", { children: ["Realm", /* @__PURE__ */ d("input", {
|
|
1555
|
+
"aria-label": `${e} secret realm`,
|
|
1556
|
+
value: n?.realm ?? "",
|
|
1557
|
+
disabled: s,
|
|
1558
|
+
onChange: (e) => w("realm", e.target.value)
|
|
1559
|
+
})] }),
|
|
1560
|
+
/* @__PURE__ */ f("label", { children: ["Space (optional)", /* @__PURE__ */ d("input", {
|
|
1561
|
+
"aria-label": `${e} secret space`,
|
|
1562
|
+
value: n?.space ?? "",
|
|
1563
|
+
disabled: s,
|
|
1564
|
+
onChange: (e) => w("space", e.target.value)
|
|
1565
|
+
})] }),
|
|
1566
|
+
/* @__PURE__ */ f("label", { children: ["Stack (optional)", /* @__PURE__ */ d("input", {
|
|
1567
|
+
"aria-label": `${e} secret stack`,
|
|
1568
|
+
value: n?.stack ?? "",
|
|
1569
|
+
disabled: s,
|
|
1570
|
+
onChange: (e) => w("stack", e.target.value)
|
|
1571
|
+
})] })
|
|
1572
|
+
]
|
|
1573
|
+
}),
|
|
1574
|
+
u && /* @__PURE__ */ d("small", { children: u })
|
|
1575
|
+
]
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
function tr({ title: e, description: t, children: n }) {
|
|
1579
|
+
let r = i();
|
|
1580
|
+
return /* @__PURE__ */ f("div", {
|
|
1581
|
+
className: "connector-store",
|
|
1582
|
+
role: "group",
|
|
1583
|
+
"aria-labelledby": r,
|
|
1584
|
+
children: [
|
|
1585
|
+
/* @__PURE__ */ d("h3", {
|
|
1586
|
+
id: r,
|
|
1587
|
+
children: e
|
|
1588
|
+
}),
|
|
1589
|
+
/* @__PURE__ */ d("p", {
|
|
1590
|
+
className: "description",
|
|
1591
|
+
children: t
|
|
1592
|
+
}),
|
|
1593
|
+
n
|
|
1594
|
+
]
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
function nr({ label: e, inventory: t, levels: n, value: r, onChange: i, disabled: a = !1 }) {
|
|
1598
|
+
let o = t.data?.rows ?? [
|
|
1599
|
+
[],
|
|
1600
|
+
[],
|
|
1601
|
+
[],
|
|
1602
|
+
[]
|
|
1603
|
+
], s = (e, t) => [.../* @__PURE__ */ new Set([...e, ...t ? [t] : []])], c = s(o[0].map((e) => e.scope[0]), r.realm), l = s(o[1].filter((e) => e.scope[0] === r.realm).map((e) => e.scope[1]), r.space), u = s(o[2].filter((e) => e.scope[0] === r.realm && e.scope[1] === r.space).map((e) => e.scope[2]), r.stack), [p, m, h] = T, g = n.includes(m) || n.includes(h);
|
|
1604
|
+
return /* @__PURE__ */ f("div", {
|
|
1605
|
+
className: "schema-fields scope-picker",
|
|
1606
|
+
children: [
|
|
1607
|
+
/* @__PURE__ */ f("label", {
|
|
1608
|
+
className: "schema-field",
|
|
1609
|
+
children: [/* @__PURE__ */ d("span", { children: "Realm" }), /* @__PURE__ */ f("select", {
|
|
1610
|
+
"aria-label": `${e} realm`,
|
|
1611
|
+
value: r.realm,
|
|
1612
|
+
disabled: a,
|
|
1613
|
+
onChange: (e) => i({ realm: e.target.value }),
|
|
1614
|
+
children: [/* @__PURE__ */ d("option", {
|
|
1615
|
+
value: "",
|
|
1616
|
+
children: "Select a Realm…"
|
|
1617
|
+
}), c.map((e) => /* @__PURE__ */ d("option", { children: e }, e))]
|
|
1618
|
+
})]
|
|
1619
|
+
}),
|
|
1620
|
+
g && /* @__PURE__ */ f("label", {
|
|
1621
|
+
className: "schema-field",
|
|
1622
|
+
children: [/* @__PURE__ */ d("span", { children: "Space" }), /* @__PURE__ */ f("select", {
|
|
1623
|
+
"aria-label": `${e} space`,
|
|
1624
|
+
value: r.space ?? "",
|
|
1625
|
+
disabled: a || !r.realm,
|
|
1626
|
+
onChange: (e) => i({
|
|
1627
|
+
realm: r.realm,
|
|
1628
|
+
...e.target.value ? { space: e.target.value } : {}
|
|
1629
|
+
}),
|
|
1630
|
+
children: [/* @__PURE__ */ d("option", {
|
|
1631
|
+
value: "",
|
|
1632
|
+
children: n.includes(p) ? "Realm level" : "Select a Space…"
|
|
1633
|
+
}), l.map((e) => /* @__PURE__ */ d("option", { children: e }, e))]
|
|
1634
|
+
})]
|
|
1635
|
+
}),
|
|
1636
|
+
n.includes(h) && /* @__PURE__ */ f("label", {
|
|
1637
|
+
className: "schema-field",
|
|
1638
|
+
children: [/* @__PURE__ */ d("span", { children: "Stack" }), /* @__PURE__ */ f("select", {
|
|
1639
|
+
"aria-label": `${e} stack`,
|
|
1640
|
+
value: r.stack ?? "",
|
|
1641
|
+
disabled: a || !r.space,
|
|
1642
|
+
onChange: (e) => i({
|
|
1643
|
+
realm: r.realm,
|
|
1644
|
+
space: r.space,
|
|
1645
|
+
...e.target.value ? { stack: e.target.value } : {}
|
|
1646
|
+
}),
|
|
1647
|
+
children: [/* @__PURE__ */ d("option", {
|
|
1648
|
+
value: "",
|
|
1649
|
+
children: n.includes(m) ? "Space level" : "Select a Stack…"
|
|
1650
|
+
}), u.map((e) => /* @__PURE__ */ d("option", { children: e }, e))]
|
|
1651
|
+
})]
|
|
1652
|
+
})
|
|
1653
|
+
]
|
|
1654
|
+
});
|
|
1655
|
+
}
|
|
1656
|
+
function rr({ label: e, connector: t, inventory: n, value: r, onChange: a, disabled: o = !1 }) {
|
|
1657
|
+
let s = i(), c = n.data?.rows ?? [
|
|
1658
|
+
[],
|
|
1659
|
+
[],
|
|
1660
|
+
[],
|
|
1661
|
+
[]
|
|
1662
|
+
], l = (e, t) => [.../* @__PURE__ */ new Set([...e, ...t ? [t] : []])], p = (e) => c[1].filter((t) => t.scope[0] === e).map((e) => e.scope[1]), m = (e, t) => c[2].filter((n) => n.scope[0] === e && n.scope[1] === t).map((e) => e.scope[2]), h = l(c[0].map((e) => e.scope[0]), r.realm), g = H(r), [, _, v] = T;
|
|
1663
|
+
return /* @__PURE__ */ f("fieldset", {
|
|
1664
|
+
className: "connector-store scope-radio",
|
|
1665
|
+
disabled: o,
|
|
1666
|
+
children: [
|
|
1667
|
+
/* @__PURE__ */ d("legend", { children: "Where can cells use it?" }),
|
|
1668
|
+
h.length > 1 && /* @__PURE__ */ f("label", {
|
|
1669
|
+
className: "schema-field",
|
|
1670
|
+
children: [/* @__PURE__ */ d("span", { children: "Realm" }), /* @__PURE__ */ f("select", {
|
|
1671
|
+
"aria-label": `${e} realm`,
|
|
1672
|
+
value: r.realm,
|
|
1673
|
+
onChange: (e) => a(nt({ realm: e.target.value }, g, p, m) ?? { realm: e.target.value }),
|
|
1674
|
+
children: [/* @__PURE__ */ d("option", {
|
|
1675
|
+
value: "",
|
|
1676
|
+
children: "Select a Realm…"
|
|
1677
|
+
}), h.map((e) => /* @__PURE__ */ d("option", { children: e }, e))]
|
|
1678
|
+
})]
|
|
1679
|
+
}),
|
|
1680
|
+
tt(t, r.realm).map((e) => {
|
|
1681
|
+
let t = nt(r, e.level, p, m);
|
|
1682
|
+
return /* @__PURE__ */ f("label", {
|
|
1683
|
+
className: "schema-check",
|
|
1684
|
+
children: [/* @__PURE__ */ d("input", {
|
|
1685
|
+
type: "radio",
|
|
1686
|
+
name: s,
|
|
1687
|
+
checked: g === e.level,
|
|
1688
|
+
disabled: !t,
|
|
1689
|
+
onChange: () => t && a(t)
|
|
1690
|
+
}), /* @__PURE__ */ f("span", { children: [
|
|
1691
|
+
e.label,
|
|
1692
|
+
e.recommended && /* @__PURE__ */ d("span", {
|
|
1693
|
+
className: "description",
|
|
1694
|
+
children: " (recommended)"
|
|
1695
|
+
}),
|
|
1696
|
+
!t && r.realm && /* @__PURE__ */ f("span", {
|
|
1697
|
+
className: "description",
|
|
1698
|
+
children: [" — none in ", r.realm]
|
|
1699
|
+
})
|
|
1700
|
+
] })]
|
|
1701
|
+
}, e.level);
|
|
1702
|
+
}),
|
|
1703
|
+
g !== T[0] && /* @__PURE__ */ f("div", {
|
|
1704
|
+
className: "schema-fields scope-picker",
|
|
1705
|
+
children: [/* @__PURE__ */ f("label", {
|
|
1706
|
+
className: "schema-field",
|
|
1707
|
+
children: [/* @__PURE__ */ d("span", { children: "Space" }), /* @__PURE__ */ d("select", {
|
|
1708
|
+
"aria-label": `${e} space`,
|
|
1709
|
+
value: r.space ?? "",
|
|
1710
|
+
onChange: (e) => a(nt({
|
|
1711
|
+
realm: r.realm,
|
|
1712
|
+
space: e.target.value
|
|
1713
|
+
}, g, p, m) ?? {
|
|
1714
|
+
realm: r.realm,
|
|
1715
|
+
space: e.target.value
|
|
1716
|
+
}),
|
|
1717
|
+
children: l(p(r.realm), r.space).map((e) => /* @__PURE__ */ d("option", { children: e }, e))
|
|
1718
|
+
})]
|
|
1719
|
+
}), g === v && /* @__PURE__ */ f("label", {
|
|
1720
|
+
className: "schema-field",
|
|
1721
|
+
children: [/* @__PURE__ */ d("span", { children: "Stack" }), /* @__PURE__ */ d("select", {
|
|
1722
|
+
"aria-label": `${e} stack`,
|
|
1723
|
+
value: r.stack ?? "",
|
|
1724
|
+
onChange: (e) => a({
|
|
1725
|
+
realm: r.realm,
|
|
1726
|
+
space: r.space,
|
|
1727
|
+
stack: e.target.value
|
|
1728
|
+
}),
|
|
1729
|
+
children: l(m(r.realm, r.space ?? ""), r.stack).map((e) => /* @__PURE__ */ d("option", { children: e }, e))
|
|
1730
|
+
})]
|
|
1731
|
+
})]
|
|
1732
|
+
}),
|
|
1733
|
+
/* @__PURE__ */ d("p", {
|
|
1734
|
+
className: "description",
|
|
1735
|
+
children: g === T[0] ? /* @__PURE__ */ f(u, { children: [
|
|
1736
|
+
"Every cell in ",
|
|
1737
|
+
r.realm ? /* @__PURE__ */ d("code", { children: r.realm }) : "the realm",
|
|
1738
|
+
" can be given this identity."
|
|
1739
|
+
] }) : g === _ ? /* @__PURE__ */ d(u, { children: "Only cells in this Space can be given it." }) : /* @__PURE__ */ d(u, { children: "Only cells in this Stack can be given it." })
|
|
1740
|
+
})
|
|
1741
|
+
]
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
function ir({ connector: e, value: t, onChange: n, disabled: r }) {
|
|
1745
|
+
let a = i();
|
|
1746
|
+
return /* @__PURE__ */ f("fieldset", {
|
|
1747
|
+
className: "schema-field secret-type-choice",
|
|
1748
|
+
disabled: r,
|
|
1749
|
+
children: [/* @__PURE__ */ d("legend", { children: "Secret type" }), et(e).map((e) => /* @__PURE__ */ f("label", {
|
|
1750
|
+
className: "schema-check",
|
|
1751
|
+
children: [/* @__PURE__ */ d("input", {
|
|
1752
|
+
type: "radio",
|
|
1753
|
+
name: a,
|
|
1754
|
+
value: e.type,
|
|
1755
|
+
checked: t === e.type,
|
|
1756
|
+
onChange: () => n(e.type)
|
|
1757
|
+
}), /* @__PURE__ */ f("span", { children: [
|
|
1758
|
+
e.label,
|
|
1759
|
+
" — ",
|
|
1760
|
+
e.description
|
|
1761
|
+
] })]
|
|
1762
|
+
}, e.type))]
|
|
1763
|
+
});
|
|
1764
|
+
}
|
|
1765
|
+
function ar({ label: e, required: t = !1, name: n, email: r, onChange: i, disabled: a, help: o }) {
|
|
1766
|
+
return /* @__PURE__ */ f("div", {
|
|
1767
|
+
className: "schema-field person-fields",
|
|
1768
|
+
role: "group",
|
|
1769
|
+
"aria-label": e,
|
|
1770
|
+
children: [
|
|
1771
|
+
/* @__PURE__ */ f("span", { children: [e, t && /* @__PURE__ */ d("b", {
|
|
1772
|
+
"aria-label": "required",
|
|
1773
|
+
children: " *"
|
|
1774
|
+
})] }),
|
|
1775
|
+
/* @__PURE__ */ f("div", {
|
|
1776
|
+
className: "person-fields-inputs",
|
|
1777
|
+
children: [/* @__PURE__ */ f("label", { children: [/* @__PURE__ */ d("span", { children: "Name" }), /* @__PURE__ */ d("input", {
|
|
1778
|
+
"aria-label": `${e} name`,
|
|
1779
|
+
value: n,
|
|
1780
|
+
disabled: a,
|
|
1781
|
+
autoComplete: "off",
|
|
1782
|
+
spellCheck: !1,
|
|
1783
|
+
onChange: (e) => i(e.target.value, r)
|
|
1784
|
+
})] }), /* @__PURE__ */ f("label", { children: [/* @__PURE__ */ d("span", { children: "Email" }), /* @__PURE__ */ d("input", {
|
|
1785
|
+
type: "email",
|
|
1786
|
+
"aria-label": `${e} email`,
|
|
1787
|
+
value: r,
|
|
1788
|
+
disabled: a,
|
|
1789
|
+
autoComplete: "off",
|
|
1790
|
+
spellCheck: !1,
|
|
1791
|
+
onChange: (e) => i(n, e.target.value)
|
|
1792
|
+
})] })]
|
|
1793
|
+
}),
|
|
1794
|
+
o
|
|
1795
|
+
]
|
|
1796
|
+
});
|
|
1797
|
+
}
|
|
1798
|
+
function or({ field: e, value: t, onChange: n, disabled: r, help: i }) {
|
|
1799
|
+
let [a, o] = c(() => ot(t)), l = s(t);
|
|
1800
|
+
return t !== l.current && (l.current = t, o(ot(t))), /* @__PURE__ */ d(ar, {
|
|
1801
|
+
label: e.name,
|
|
1802
|
+
required: e.required,
|
|
1803
|
+
name: a.name,
|
|
1804
|
+
email: a.email,
|
|
1805
|
+
disabled: r,
|
|
1806
|
+
help: i,
|
|
1807
|
+
onChange: (e, t) => {
|
|
1808
|
+
o({
|
|
1809
|
+
name: e,
|
|
1810
|
+
email: t
|
|
1811
|
+
}), l.current = st(e, t), n(l.current);
|
|
1812
|
+
}
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
function sr({ field: e, value: t, onChange: n, disabled: r, secrets: i, listId: a }) {
|
|
1816
|
+
let o = /* @__PURE__ */ f("span", { children: [e.name, e.required && /* @__PURE__ */ d("b", {
|
|
1817
|
+
"aria-label": "required",
|
|
1818
|
+
children: " *"
|
|
1819
|
+
})] }), s = e.help && /* @__PURE__ */ d("small", { children: e.help });
|
|
1820
|
+
if (e.type === "list" && e.enum.length) {
|
|
1821
|
+
let i = t.split(",").map((e) => e.trim()).filter(Boolean);
|
|
1822
|
+
return /* @__PURE__ */ f("div", {
|
|
1823
|
+
className: "schema-field",
|
|
1824
|
+
role: "group",
|
|
1825
|
+
"aria-label": e.name,
|
|
1826
|
+
children: [
|
|
1827
|
+
o,
|
|
1828
|
+
e.enum.map((t) => /* @__PURE__ */ f("label", {
|
|
1829
|
+
className: "schema-check",
|
|
1830
|
+
children: [/* @__PURE__ */ d("input", {
|
|
1831
|
+
type: "checkbox",
|
|
1832
|
+
checked: i.includes(t),
|
|
1833
|
+
disabled: r,
|
|
1834
|
+
onChange: (r) => n(e.enum.filter((e) => e === t ? r.target.checked : i.includes(e)).join(","))
|
|
1835
|
+
}), t]
|
|
1836
|
+
}, t)),
|
|
1837
|
+
s
|
|
1838
|
+
]
|
|
1839
|
+
});
|
|
1840
|
+
}
|
|
1841
|
+
return e.enum.length ? /* @__PURE__ */ f("label", {
|
|
1842
|
+
className: "schema-field",
|
|
1843
|
+
children: [
|
|
1844
|
+
o,
|
|
1845
|
+
/* @__PURE__ */ f("select", {
|
|
1846
|
+
value: t,
|
|
1847
|
+
disabled: r,
|
|
1848
|
+
onChange: (e) => n(e.target.value),
|
|
1849
|
+
children: [/* @__PURE__ */ d("option", {
|
|
1850
|
+
value: "",
|
|
1851
|
+
children: e.required ? "Select…" : "None"
|
|
1852
|
+
}), e.enum.map((e) => /* @__PURE__ */ d("option", { children: e }, e))]
|
|
1853
|
+
}),
|
|
1854
|
+
s
|
|
1855
|
+
]
|
|
1856
|
+
}) : e.type === "secret" ? /* @__PURE__ */ f("label", {
|
|
1857
|
+
className: "schema-field",
|
|
1858
|
+
children: [
|
|
1859
|
+
o,
|
|
1860
|
+
/* @__PURE__ */ d("input", {
|
|
1861
|
+
value: t,
|
|
1862
|
+
list: a,
|
|
1863
|
+
placeholder: "name@realm[/space[/stack]]",
|
|
1864
|
+
disabled: r,
|
|
1865
|
+
autoComplete: "off",
|
|
1866
|
+
spellCheck: !1,
|
|
1867
|
+
onChange: (e) => n(e.target.value)
|
|
1868
|
+
}),
|
|
1869
|
+
/* @__PURE__ */ d("datalist", {
|
|
1870
|
+
id: a,
|
|
1871
|
+
children: (i ?? []).map((e) => ae(e.metadata)).filter(Boolean).map((e) => /* @__PURE__ */ d("option", { value: e }, e))
|
|
1872
|
+
}),
|
|
1873
|
+
s
|
|
1874
|
+
]
|
|
1875
|
+
}) : e.type === "person" ? /* @__PURE__ */ d(or, {
|
|
1876
|
+
field: e,
|
|
1877
|
+
value: t,
|
|
1878
|
+
onChange: n,
|
|
1879
|
+
disabled: r,
|
|
1880
|
+
help: s
|
|
1881
|
+
}) : /* @__PURE__ */ f("label", {
|
|
1882
|
+
className: "schema-field",
|
|
1883
|
+
children: [
|
|
1884
|
+
o,
|
|
1885
|
+
/* @__PURE__ */ d("input", {
|
|
1886
|
+
value: t,
|
|
1887
|
+
placeholder: e.type === "list" ? "Comma-separated" : void 0,
|
|
1888
|
+
disabled: r,
|
|
1889
|
+
autoComplete: "off",
|
|
1890
|
+
spellCheck: !1,
|
|
1891
|
+
onChange: (e) => n(e.target.value)
|
|
1892
|
+
}),
|
|
1893
|
+
s
|
|
1894
|
+
]
|
|
1895
|
+
});
|
|
1896
|
+
}
|
|
1897
|
+
function cr({ type: e, form: t, set: n, pending: r, authorOnly: i = !1, valueLabel: a = "Value" }) {
|
|
1898
|
+
let o = {
|
|
1899
|
+
autoComplete: "new-password",
|
|
1900
|
+
spellCheck: !1,
|
|
1901
|
+
disabled: r
|
|
1902
|
+
};
|
|
1903
|
+
return /* @__PURE__ */ d("div", {
|
|
1904
|
+
className: "schema-fields",
|
|
1905
|
+
children: e === "basic-auth" ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("label", {
|
|
1906
|
+
className: "schema-field",
|
|
1907
|
+
children: [/* @__PURE__ */ f("span", { children: ["Username", /* @__PURE__ */ d("b", {
|
|
1908
|
+
"aria-label": "required",
|
|
1909
|
+
children: " *"
|
|
1910
|
+
})] }), /* @__PURE__ */ d("input", {
|
|
1911
|
+
value: t.username,
|
|
1912
|
+
autoComplete: "off",
|
|
1913
|
+
spellCheck: !1,
|
|
1914
|
+
disabled: r,
|
|
1915
|
+
onChange: (e) => n({ username: e.target.value })
|
|
1916
|
+
})]
|
|
1917
|
+
}), /* @__PURE__ */ f("label", {
|
|
1918
|
+
className: "schema-field",
|
|
1919
|
+
children: [/* @__PURE__ */ f("span", { children: ["Password or token", /* @__PURE__ */ d("b", {
|
|
1920
|
+
"aria-label": "required",
|
|
1921
|
+
children: " *"
|
|
1922
|
+
})] }), /* @__PURE__ */ d("input", {
|
|
1923
|
+
type: "password",
|
|
1924
|
+
value: t.password,
|
|
1925
|
+
...o,
|
|
1926
|
+
onChange: (e) => n({ password: e.target.value })
|
|
1927
|
+
})]
|
|
1928
|
+
})] }) : e === "ssh-key" ? /* @__PURE__ */ f(u, { children: [
|
|
1929
|
+
/* @__PURE__ */ f("label", {
|
|
1930
|
+
className: "schema-field identity-key",
|
|
1931
|
+
children: [/* @__PURE__ */ f("span", { children: ["Private key", /* @__PURE__ */ d("b", {
|
|
1932
|
+
"aria-label": "required",
|
|
1933
|
+
children: " *"
|
|
1934
|
+
})] }), /* @__PURE__ */ d("textarea", {
|
|
1935
|
+
value: t.privateKey,
|
|
1936
|
+
placeholder: "Paste the private key, armor lines included",
|
|
1937
|
+
...o,
|
|
1938
|
+
onChange: (e) => n({ privateKey: e.target.value })
|
|
1939
|
+
})]
|
|
1940
|
+
}),
|
|
1941
|
+
/* @__PURE__ */ f("label", {
|
|
1942
|
+
className: "schema-field",
|
|
1943
|
+
children: [/* @__PURE__ */ d("span", { children: "Passphrase" }), /* @__PURE__ */ d("input", {
|
|
1944
|
+
type: "password",
|
|
1945
|
+
value: t.passphrase,
|
|
1946
|
+
...o,
|
|
1947
|
+
onChange: (e) => n({ passphrase: e.target.value })
|
|
1948
|
+
})]
|
|
1949
|
+
}),
|
|
1950
|
+
/* @__PURE__ */ f("label", {
|
|
1951
|
+
className: "schema-field",
|
|
1952
|
+
children: [/* @__PURE__ */ d("span", { children: "Public key" }), /* @__PURE__ */ d("input", {
|
|
1953
|
+
value: t.publicKey,
|
|
1954
|
+
placeholder: "ssh-ed25519 AAAA…",
|
|
1955
|
+
autoComplete: "off",
|
|
1956
|
+
spellCheck: !1,
|
|
1957
|
+
disabled: r,
|
|
1958
|
+
onChange: (e) => n({ publicKey: e.target.value })
|
|
1959
|
+
})]
|
|
1960
|
+
}),
|
|
1961
|
+
/* @__PURE__ */ f("label", {
|
|
1962
|
+
className: "schema-field",
|
|
1963
|
+
children: [/* @__PURE__ */ d("span", { children: "Certificate" }), /* @__PURE__ */ d("input", {
|
|
1964
|
+
value: t.certificate,
|
|
1965
|
+
autoComplete: "off",
|
|
1966
|
+
spellCheck: !1,
|
|
1967
|
+
disabled: r,
|
|
1968
|
+
onChange: (e) => n({ certificate: e.target.value })
|
|
1969
|
+
})]
|
|
1970
|
+
}),
|
|
1971
|
+
/* @__PURE__ */ f("label", {
|
|
1972
|
+
className: "schema-field identity-key",
|
|
1973
|
+
children: [/* @__PURE__ */ d("span", { children: "Known hosts" }), /* @__PURE__ */ d("textarea", {
|
|
1974
|
+
value: t.knownHosts,
|
|
1975
|
+
placeholder: "example.com ssh-ed25519 AAAA…",
|
|
1976
|
+
autoComplete: "off",
|
|
1977
|
+
spellCheck: !1,
|
|
1978
|
+
disabled: r,
|
|
1979
|
+
onChange: (e) => n({ knownHosts: e.target.value })
|
|
1980
|
+
})]
|
|
1981
|
+
})
|
|
1982
|
+
] }) : i ? /* @__PURE__ */ d("p", {
|
|
1983
|
+
className: "description identity-no-value",
|
|
1984
|
+
children: "An author-only identity: it stores no value, and gives cells the author and committer only — no credential and no signing."
|
|
1985
|
+
}) : /* @__PURE__ */ f("label", {
|
|
1986
|
+
className: "schema-field",
|
|
1987
|
+
children: [/* @__PURE__ */ f("span", { children: [a, /* @__PURE__ */ d("b", {
|
|
1988
|
+
"aria-label": "required",
|
|
1989
|
+
children: " *"
|
|
1990
|
+
})] }), /* @__PURE__ */ d("input", {
|
|
1991
|
+
type: "password",
|
|
1992
|
+
value: t.value,
|
|
1993
|
+
...o,
|
|
1994
|
+
onChange: (e) => n({ value: e.target.value })
|
|
1995
|
+
})]
|
|
1996
|
+
})
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1999
|
+
function lr({ connector: e, scope: t, existing: n, secrets: r, onSaved: a, onCancel: o, offerDefault: s = !0 }) {
|
|
2000
|
+
let l = q(e), p = n ? Ge(r, e, n) : void 0, [h, g] = c(() => He(e, n)), [v, y] = c(() => Ye(!!l && (!n || !!p))), b = s ? _e(e) : [], [x, S] = c(() => (b.find((t) => e.methods.find((e) => e.name === t.method)?.default) ?? b[0])?.method ?? ""), C = b.find((e) => e.method === x) ?? b[0], w = m(C && t.realm ? `/connectors/defaults?${ge(t)}` : null, 0), [T, E] = c(), D = T ?? (!!C && (v.git && !n || !!w.data && rt(w.data, e, C))), [O, ee] = c(!1), [te, k] = c(), { notify: ne } = Mn(), re = i(), ie = K(e), A = e.title || e.name, j = U(t).join(" / "), M = !!l && v.git && h.type === "opaque", N = l?.hosts.join(", ") ?? "", I = (e) => {
|
|
2001
|
+
g((t) => ({
|
|
2002
|
+
...t,
|
|
2003
|
+
...e
|
|
2004
|
+
})), k(void 0);
|
|
2005
|
+
};
|
|
2006
|
+
async function R(r) {
|
|
2007
|
+
if (r.preventDefault(), O) return;
|
|
2008
|
+
let i = t.realm ? [...lt(e, h), ...M ? Ze(v) : []] : ["Choose where the identity is stored."];
|
|
2009
|
+
if (i.length) {
|
|
2010
|
+
k({
|
|
2011
|
+
code: "invalid_request",
|
|
2012
|
+
message: i.join(" ")
|
|
2013
|
+
});
|
|
2014
|
+
return;
|
|
2015
|
+
}
|
|
2016
|
+
let o = JSON.stringify(ut(e, t, h, {
|
|
2017
|
+
makeDefault: !!C && D,
|
|
2018
|
+
method: C?.method,
|
|
2019
|
+
git: M ? Xe(v) : void 0
|
|
2020
|
+
}));
|
|
2021
|
+
g((e) => dt(e)), ee(!0), k(void 0);
|
|
2022
|
+
try {
|
|
2023
|
+
let r = await In(Ln(e.name, "identities"), o), i = P({
|
|
2024
|
+
name: r.name,
|
|
2025
|
+
...r.scope
|
|
2026
|
+
}) ?? P({
|
|
2027
|
+
name: h.name,
|
|
2028
|
+
...t
|
|
2029
|
+
}), s = L(i).join(" / "), c = (e) => e === "updated" ? "rotated" : "created", l = [`${A} identity ${i.name} ${c(r.action)} in ${s}.`];
|
|
2030
|
+
r.git && l.push(`Git identity ${r.git.name} ${c(r.git.action)} for ${N}.`), r.defaults?.length && l.push(r.defaults.length > 1 ? `Both are now the defaults in ${s}.` : `It is now the default in ${s}.`);
|
|
2031
|
+
let u = Je(r);
|
|
2032
|
+
u && l.push(u), ne({
|
|
2033
|
+
key: `identity:${e.name}:${F(i)}`,
|
|
2034
|
+
tone: u ? "warning" : "success",
|
|
2035
|
+
message: l.join(" ")
|
|
2036
|
+
}), n || g(He(e)), a(i, r.action);
|
|
2037
|
+
} catch (e) {
|
|
2038
|
+
k($(e));
|
|
2039
|
+
} finally {
|
|
2040
|
+
ee(!1);
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
return /* @__PURE__ */ f("form", {
|
|
2044
|
+
className: "creation-form identity-form",
|
|
2045
|
+
"aria-label": n ? `Rotate ${A} identity ${n.name}` : `New ${A} identity`,
|
|
2046
|
+
method: "post",
|
|
2047
|
+
autoComplete: "off",
|
|
2048
|
+
onSubmit: R,
|
|
2049
|
+
children: [
|
|
2050
|
+
/* @__PURE__ */ d("h3", { children: n ? `Rotate ${n.name}` : `New ${A} identity` }),
|
|
2051
|
+
/* @__PURE__ */ f("p", {
|
|
2052
|
+
className: "description",
|
|
2053
|
+
children: [n ? /* @__PURE__ */ f(u, { children: [
|
|
2054
|
+
"Replaces the value stored under ",
|
|
2055
|
+
/* @__PURE__ */ d("code", { children: n.name }),
|
|
2056
|
+
" in ",
|
|
2057
|
+
j,
|
|
2058
|
+
". Everything that uses this identity picks up the new value."
|
|
2059
|
+
] }) : /* @__PURE__ */ f(u, { children: [
|
|
2060
|
+
"Stored as a Secret tagged ",
|
|
2061
|
+
/* @__PURE__ */ d("code", { children: e.name }),
|
|
2062
|
+
j && /* @__PURE__ */ f(u, { children: [" in ", j] }),
|
|
2063
|
+
"."
|
|
2064
|
+
] }), " Values are write-only: they are sent once and never shown again."]
|
|
2065
|
+
}),
|
|
2066
|
+
/* @__PURE__ */ f("div", {
|
|
2067
|
+
className: "schema-fields",
|
|
2068
|
+
children: [
|
|
2069
|
+
/* @__PURE__ */ f("label", {
|
|
2070
|
+
className: "schema-field",
|
|
2071
|
+
children: [/* @__PURE__ */ f("span", { children: ["Identity name", /* @__PURE__ */ d("b", {
|
|
2072
|
+
"aria-label": "required",
|
|
2073
|
+
children: " *"
|
|
2074
|
+
})] }), /* @__PURE__ */ d("input", {
|
|
2075
|
+
value: h.name,
|
|
2076
|
+
disabled: O || !!n,
|
|
2077
|
+
autoComplete: "off",
|
|
2078
|
+
spellCheck: !1,
|
|
2079
|
+
onChange: (e) => I({ name: e.target.value })
|
|
2080
|
+
})]
|
|
2081
|
+
}),
|
|
2082
|
+
ie.length > 1 && /* @__PURE__ */ d(ir, {
|
|
2083
|
+
connector: e,
|
|
2084
|
+
value: h.type,
|
|
2085
|
+
disabled: O,
|
|
2086
|
+
onChange: (e) => I({ type: e })
|
|
2087
|
+
}),
|
|
2088
|
+
Re(e, h.type).map((e) => /* @__PURE__ */ d(sr, {
|
|
2089
|
+
field: e,
|
|
2090
|
+
value: h.fields[e.name] ?? "",
|
|
2091
|
+
disabled: O,
|
|
2092
|
+
secrets: r,
|
|
2093
|
+
listId: `${re}-${e.name}`,
|
|
2094
|
+
onChange: (t) => I({ fields: {
|
|
2095
|
+
...h.fields,
|
|
2096
|
+
[e.name]: t
|
|
2097
|
+
} })
|
|
2098
|
+
}, e.name))
|
|
2099
|
+
]
|
|
2100
|
+
}),
|
|
2101
|
+
/* @__PURE__ */ d(cr, {
|
|
2102
|
+
type: h.type,
|
|
2103
|
+
form: h,
|
|
2104
|
+
set: I,
|
|
2105
|
+
pending: O,
|
|
2106
|
+
authorOnly: ze(e, h.type),
|
|
2107
|
+
valueLabel: l ? "Token" : "Value"
|
|
2108
|
+
}),
|
|
2109
|
+
l && h.type === "opaque" && /* @__PURE__ */ f("div", {
|
|
2110
|
+
className: "schema-fields token-for-git",
|
|
2111
|
+
role: "group",
|
|
2112
|
+
"aria-label": "Use for git",
|
|
2113
|
+
children: [/* @__PURE__ */ f("label", {
|
|
2114
|
+
className: "schema-check",
|
|
2115
|
+
children: [
|
|
2116
|
+
/* @__PURE__ */ d("input", {
|
|
2117
|
+
type: "checkbox",
|
|
2118
|
+
checked: v.git,
|
|
2119
|
+
disabled: O,
|
|
2120
|
+
onChange: (e) => {
|
|
2121
|
+
y((t) => ({
|
|
2122
|
+
...t,
|
|
2123
|
+
git: e.target.checked
|
|
2124
|
+
})), k(void 0);
|
|
2125
|
+
}
|
|
2126
|
+
}),
|
|
2127
|
+
"Also use this token for git on ",
|
|
2128
|
+
N
|
|
2129
|
+
]
|
|
2130
|
+
}), v.git ? /* @__PURE__ */ f(u, { children: [
|
|
2131
|
+
/* @__PURE__ */ f("p", {
|
|
2132
|
+
className: "description",
|
|
2133
|
+
children: [
|
|
2134
|
+
p ? /* @__PURE__ */ f(u, { children: [
|
|
2135
|
+
"Rotates the linked git identity ",
|
|
2136
|
+
/* @__PURE__ */ d("code", { children: p.name }),
|
|
2137
|
+
" too."
|
|
2138
|
+
] }) : /* @__PURE__ */ f(u, { children: [
|
|
2139
|
+
"Also stored as the git identity ",
|
|
2140
|
+
/* @__PURE__ */ d("code", { children: l.name }),
|
|
2141
|
+
": username and token, for HTTPS on ",
|
|
2142
|
+
N,
|
|
2143
|
+
" only."
|
|
2144
|
+
] }),
|
|
2145
|
+
" Signing needs an SSH key: ",
|
|
2146
|
+
/* @__PURE__ */ d("a", {
|
|
2147
|
+
href: Bn(l.connector, t),
|
|
2148
|
+
children: "Import from this machine"
|
|
2149
|
+
}),
|
|
2150
|
+
"."
|
|
2151
|
+
]
|
|
2152
|
+
}),
|
|
2153
|
+
/* @__PURE__ */ d(ar, {
|
|
2154
|
+
label: "Commit author",
|
|
2155
|
+
name: v.gitAuthorName,
|
|
2156
|
+
email: v.gitAuthorEmail,
|
|
2157
|
+
disabled: O,
|
|
2158
|
+
help: /* @__PURE__ */ d("small", { children: "Optional. The name and email of commits made with this identity." }),
|
|
2159
|
+
onChange: (e, t) => {
|
|
2160
|
+
y((n) => ({
|
|
2161
|
+
...n,
|
|
2162
|
+
gitAuthorName: e,
|
|
2163
|
+
gitAuthorEmail: t
|
|
2164
|
+
})), k(void 0);
|
|
2165
|
+
}
|
|
2166
|
+
}),
|
|
2167
|
+
/* @__PURE__ */ f("label", {
|
|
2168
|
+
className: "schema-field",
|
|
2169
|
+
children: [
|
|
2170
|
+
/* @__PURE__ */ d("span", { children: "Username" }),
|
|
2171
|
+
/* @__PURE__ */ d("input", {
|
|
2172
|
+
value: v.gitUsername,
|
|
2173
|
+
placeholder: l.username,
|
|
2174
|
+
disabled: O,
|
|
2175
|
+
autoComplete: "off",
|
|
2176
|
+
spellCheck: !1,
|
|
2177
|
+
onChange: (e) => {
|
|
2178
|
+
y((t) => ({
|
|
2179
|
+
...t,
|
|
2180
|
+
gitUsername: e.target.value
|
|
2181
|
+
})), k(void 0);
|
|
2182
|
+
}
|
|
2183
|
+
}),
|
|
2184
|
+
/* @__PURE__ */ f("small", { children: [
|
|
2185
|
+
"Optional. ",
|
|
2186
|
+
A,
|
|
2187
|
+
" accepts any non-empty username with a personal access token; empty stores ",
|
|
2188
|
+
/* @__PURE__ */ d("code", { children: l.username }),
|
|
2189
|
+
"."
|
|
2190
|
+
] })
|
|
2191
|
+
]
|
|
2192
|
+
})
|
|
2193
|
+
] }) : /* @__PURE__ */ f("p", {
|
|
2194
|
+
className: "description",
|
|
2195
|
+
children: ["Git is unchanged: the token reaches cells as an API token only.", p && /* @__PURE__ */ f(u, { children: [
|
|
2196
|
+
" The linked git identity ",
|
|
2197
|
+
/* @__PURE__ */ d("code", { children: p.name }),
|
|
2198
|
+
" keeps the previous token: check the box to rotate it too."
|
|
2199
|
+
] })]
|
|
2200
|
+
})]
|
|
2201
|
+
}),
|
|
2202
|
+
C && /* @__PURE__ */ f("div", {
|
|
2203
|
+
className: "schema-fields identity-default",
|
|
2204
|
+
children: [
|
|
2205
|
+
/* @__PURE__ */ f("label", {
|
|
2206
|
+
className: "schema-check",
|
|
2207
|
+
children: [
|
|
2208
|
+
/* @__PURE__ */ d("input", {
|
|
2209
|
+
type: "checkbox",
|
|
2210
|
+
checked: D,
|
|
2211
|
+
disabled: O,
|
|
2212
|
+
onChange: (e) => E(e.target.checked)
|
|
2213
|
+
}),
|
|
2214
|
+
"Make this the default",
|
|
2215
|
+
j && /* @__PURE__ */ f(u, { children: [" in ", j] })
|
|
2216
|
+
]
|
|
2217
|
+
}),
|
|
2218
|
+
b.length > 1 && /* @__PURE__ */ f("label", {
|
|
2219
|
+
className: "schema-field",
|
|
2220
|
+
children: [/* @__PURE__ */ d("span", { children: "Default for" }), /* @__PURE__ */ d("select", {
|
|
2221
|
+
"aria-label": `${A} default method`,
|
|
2222
|
+
value: C.method,
|
|
2223
|
+
disabled: O || !D,
|
|
2224
|
+
onChange: (e) => {
|
|
2225
|
+
S(e.target.value), E(void 0);
|
|
2226
|
+
},
|
|
2227
|
+
children: b.map((e) => /* @__PURE__ */ f("option", {
|
|
2228
|
+
value: e.method,
|
|
2229
|
+
children: [e.method, " method"]
|
|
2230
|
+
}, e.method))
|
|
2231
|
+
})]
|
|
2232
|
+
}),
|
|
2233
|
+
/* @__PURE__ */ d("small", {
|
|
2234
|
+
className: "description",
|
|
2235
|
+
children: D ? M ? /* @__PURE__ */ f(u, { children: [
|
|
2236
|
+
"Cells here that pick no identity get this token for ",
|
|
2237
|
+
A,
|
|
2238
|
+
" and for git."
|
|
2239
|
+
] }) : /* @__PURE__ */ d(u, { children: "Cells here that pick no identity get this one." }) : /* @__PURE__ */ f(u, { children: [
|
|
2240
|
+
"Stored only: set a default later on the ",
|
|
2241
|
+
A,
|
|
2242
|
+
" page."
|
|
2243
|
+
] })
|
|
2244
|
+
})
|
|
2245
|
+
]
|
|
2246
|
+
}),
|
|
2247
|
+
/* @__PURE__ */ f("div", {
|
|
2248
|
+
className: "connector-actions",
|
|
2249
|
+
children: [/* @__PURE__ */ d("button", {
|
|
2250
|
+
type: "submit",
|
|
2251
|
+
disabled: O,
|
|
2252
|
+
children: O ? "Saving…" : n ? "Rotate identity" : "Create identity"
|
|
2253
|
+
}), o && /* @__PURE__ */ d("button", {
|
|
2254
|
+
type: "button",
|
|
2255
|
+
className: "subtle-button",
|
|
2256
|
+
disabled: O,
|
|
2257
|
+
onClick: o,
|
|
2258
|
+
children: "Cancel"
|
|
2259
|
+
})]
|
|
2260
|
+
}),
|
|
2261
|
+
te && /* @__PURE__ */ d(_, {
|
|
2262
|
+
error: te,
|
|
2263
|
+
kind: "Identity"
|
|
2264
|
+
})
|
|
2265
|
+
]
|
|
2266
|
+
});
|
|
2267
|
+
}
|
|
2268
|
+
function ur({ status: e, connector: t, scope: n, identities: r, secrets: i, onChanged: a, onClose: o }) {
|
|
2269
|
+
let s = he(t, n), [l, u] = c(s[0] ?? T[0]), [p, m] = c(), [h, g] = c(!1), [v, y] = c(!1), [b, x] = c(), { notify: S } = Mn(), C = B(e), w = V(n, l), E = P(p);
|
|
2270
|
+
async function D() {
|
|
2271
|
+
if (E && !v) {
|
|
2272
|
+
y(!0), x(void 0);
|
|
2273
|
+
try {
|
|
2274
|
+
await In(Ln(e.connector, "defaults"), {
|
|
2275
|
+
scope: w,
|
|
2276
|
+
...e.method ? { method: e.method } : {},
|
|
2277
|
+
identity: E
|
|
2278
|
+
}), S({
|
|
2279
|
+
key: `connector-default:${e.connector}`,
|
|
2280
|
+
tone: "success",
|
|
2281
|
+
message: `${C} default set to ${E.name} at ${Wn(l, n)}.`
|
|
2282
|
+
}), a(), o();
|
|
2283
|
+
} catch (e) {
|
|
2284
|
+
x($(e));
|
|
2285
|
+
} finally {
|
|
2286
|
+
y(!1);
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
return /* @__PURE__ */ f("div", {
|
|
2291
|
+
className: "connector-fix",
|
|
2292
|
+
role: "group",
|
|
2293
|
+
"aria-label": `Set default for ${C}`,
|
|
2294
|
+
children: [
|
|
2295
|
+
/* @__PURE__ */ f("p", {
|
|
2296
|
+
className: "description",
|
|
2297
|
+
children: [
|
|
2298
|
+
"A default fills ",
|
|
2299
|
+
C,
|
|
2300
|
+
" for every Config in the scope that picked no identity of its own. No Config is rewritten."
|
|
2301
|
+
]
|
|
2302
|
+
}),
|
|
2303
|
+
/* @__PURE__ */ f("div", {
|
|
2304
|
+
className: "schema-fields",
|
|
2305
|
+
children: [/* @__PURE__ */ f("label", {
|
|
2306
|
+
className: "schema-field",
|
|
2307
|
+
children: [/* @__PURE__ */ d("span", { children: "Level" }), /* @__PURE__ */ d("select", {
|
|
2308
|
+
"aria-label": `${C} default level`,
|
|
2309
|
+
value: l,
|
|
2310
|
+
disabled: v,
|
|
2311
|
+
onChange: (e) => u(e.target.value),
|
|
2312
|
+
children: s.map((e) => /* @__PURE__ */ d("option", {
|
|
2313
|
+
value: e,
|
|
2314
|
+
children: Wn(e, n)
|
|
2315
|
+
}, e))
|
|
2316
|
+
})]
|
|
2317
|
+
}), /* @__PURE__ */ d(er, {
|
|
2318
|
+
label: `${C} default identity`,
|
|
2319
|
+
identities: r,
|
|
2320
|
+
value: p,
|
|
2321
|
+
extra: [E],
|
|
2322
|
+
emptyLabel: "Select an identity…",
|
|
2323
|
+
disabled: v,
|
|
2324
|
+
realm: n.realm,
|
|
2325
|
+
onChange: m
|
|
2326
|
+
})]
|
|
2327
|
+
}),
|
|
2328
|
+
/* @__PURE__ */ f("div", {
|
|
2329
|
+
className: "connector-actions",
|
|
2330
|
+
children: [
|
|
2331
|
+
/* @__PURE__ */ d("button", {
|
|
2332
|
+
type: "button",
|
|
2333
|
+
disabled: !E || v || !s.length,
|
|
2334
|
+
onClick: () => void D(),
|
|
2335
|
+
children: v ? "Saving…" : "Save default"
|
|
2336
|
+
}),
|
|
2337
|
+
t && /* @__PURE__ */ d("button", {
|
|
2338
|
+
type: "button",
|
|
2339
|
+
className: "subtle-button",
|
|
2340
|
+
"aria-expanded": h,
|
|
2341
|
+
disabled: v,
|
|
2342
|
+
onClick: () => g((e) => !e),
|
|
2343
|
+
children: h ? "Hide new identity" : "Create a new identity…"
|
|
2344
|
+
}),
|
|
2345
|
+
/* @__PURE__ */ d("button", {
|
|
2346
|
+
type: "button",
|
|
2347
|
+
className: "subtle-button",
|
|
2348
|
+
disabled: v,
|
|
2349
|
+
onClick: o,
|
|
2350
|
+
children: "Cancel"
|
|
2351
|
+
})
|
|
2352
|
+
]
|
|
2353
|
+
}),
|
|
2354
|
+
h && t && /* @__PURE__ */ d(lr, {
|
|
2355
|
+
connector: t,
|
|
2356
|
+
scope: w,
|
|
2357
|
+
secrets: i,
|
|
2358
|
+
offerDefault: !1,
|
|
2359
|
+
onSaved: (e) => {
|
|
2360
|
+
m(e), g(!1), a();
|
|
2361
|
+
},
|
|
2362
|
+
onCancel: () => g(!1)
|
|
2363
|
+
}),
|
|
2364
|
+
b && /* @__PURE__ */ d(_, {
|
|
2365
|
+
error: b,
|
|
2366
|
+
kind: "Scope"
|
|
2367
|
+
})
|
|
2368
|
+
]
|
|
2369
|
+
});
|
|
2370
|
+
}
|
|
2371
|
+
function dr({ status: e, config: t, identities: n, logins: r = [], onChanged: i, onClose: a }) {
|
|
2372
|
+
let o = W(e), [s, l] = c(o ? G(e) : e.origin === "config" ? e.identity : void 0), [p, m] = c(!1), [h, g] = c(), { notify: v } = Mn(), y = B(e), b = P(s);
|
|
2373
|
+
async function x(n) {
|
|
2374
|
+
if (!p) {
|
|
2375
|
+
m(!0), g(void 0);
|
|
2376
|
+
try {
|
|
2377
|
+
let r = qe(await In("/configs/connector", {
|
|
2378
|
+
config: {
|
|
2379
|
+
name: t.name,
|
|
2380
|
+
realm: t.realm,
|
|
2381
|
+
...t.space ? { space: t.space } : {},
|
|
2382
|
+
...t.stack ? { stack: t.stack } : {}
|
|
2383
|
+
},
|
|
2384
|
+
connector: e.connector,
|
|
2385
|
+
identity: n
|
|
2386
|
+
}));
|
|
2387
|
+
v({
|
|
2388
|
+
key: `connector-pick:${e.connector}:${t.name}`,
|
|
2389
|
+
tone: r.length ? "warning" : "success",
|
|
2390
|
+
message: [n ? `Config ${t.name} now uses ${n.name} for ${y}.` : `Config ${t.name} uses the ${y} default again.`, ...r].join(" ")
|
|
2391
|
+
}), i(), a();
|
|
2392
|
+
} catch (e) {
|
|
2393
|
+
g($(e));
|
|
2394
|
+
} finally {
|
|
2395
|
+
m(!1);
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
return /* @__PURE__ */ f("div", {
|
|
2400
|
+
className: "connector-fix",
|
|
2401
|
+
role: "group",
|
|
2402
|
+
"aria-label": `Pick ${y} identity for this Config`,
|
|
2403
|
+
children: [
|
|
2404
|
+
/* @__PURE__ */ d("p", {
|
|
2405
|
+
className: "description",
|
|
2406
|
+
children: o ? /* @__PURE__ */ f(u, { children: [
|
|
2407
|
+
"Saved in the Config as its state volume: every cell of this Config keeps its ",
|
|
2408
|
+
y,
|
|
2409
|
+
" login — and the rest of its harness state — there. ",
|
|
2410
|
+
Ke
|
|
2411
|
+
] }) : /* @__PURE__ */ d(u, { children: "Saved in the Config itself: it wins over the Realm, Space and Stack defaults for this Config only." })
|
|
2412
|
+
}),
|
|
2413
|
+
/* @__PURE__ */ d("div", {
|
|
2414
|
+
className: "schema-fields",
|
|
2415
|
+
children: o ? /* @__PURE__ */ d($n, {
|
|
2416
|
+
label: `${y} login identity for this Config`,
|
|
2417
|
+
identities: r,
|
|
2418
|
+
value: s,
|
|
2419
|
+
extra: [G(e)],
|
|
2420
|
+
emptyLabel: "Select a login identity…",
|
|
2421
|
+
disabled: p,
|
|
2422
|
+
onChange: l
|
|
2423
|
+
}) : /* @__PURE__ */ d(er, {
|
|
2424
|
+
label: `${y} identity for this Config`,
|
|
2425
|
+
identities: n,
|
|
2426
|
+
value: s,
|
|
2427
|
+
extra: [e.identity],
|
|
2428
|
+
emptyLabel: "Select an identity…",
|
|
2429
|
+
disabled: p,
|
|
2430
|
+
realm: t.realm,
|
|
2431
|
+
onChange: l
|
|
2432
|
+
})
|
|
2433
|
+
}),
|
|
2434
|
+
/* @__PURE__ */ f("div", {
|
|
2435
|
+
className: "connector-actions",
|
|
2436
|
+
children: [
|
|
2437
|
+
/* @__PURE__ */ d("button", {
|
|
2438
|
+
type: "button",
|
|
2439
|
+
disabled: !b || p || o && I(b, G(e)),
|
|
2440
|
+
onClick: () => void x(b ?? null),
|
|
2441
|
+
children: p ? "Saving…" : "Save for this Config"
|
|
2442
|
+
}),
|
|
2443
|
+
!o && e.origin === "config" && /* @__PURE__ */ d("button", {
|
|
2444
|
+
type: "button",
|
|
2445
|
+
className: "subtle-button",
|
|
2446
|
+
disabled: p,
|
|
2447
|
+
onClick: () => void x(null),
|
|
2448
|
+
children: "Use the default instead"
|
|
2449
|
+
}),
|
|
2450
|
+
/* @__PURE__ */ d("button", {
|
|
2451
|
+
type: "button",
|
|
2452
|
+
className: "subtle-button",
|
|
2453
|
+
disabled: p,
|
|
2454
|
+
onClick: a,
|
|
2455
|
+
children: "Cancel"
|
|
2456
|
+
})
|
|
2457
|
+
]
|
|
2458
|
+
}),
|
|
2459
|
+
h && /* @__PURE__ */ d(_, {
|
|
2460
|
+
error: h,
|
|
2461
|
+
kind: "Config"
|
|
2462
|
+
})
|
|
2463
|
+
]
|
|
2464
|
+
});
|
|
2465
|
+
}
|
|
2466
|
+
function fr({ status: e, connector: t, config: n, identities: r, logins: i = [], secrets: a, onChanged: o }) {
|
|
2467
|
+
let [s, l] = c(""), u = B(e), p = de({ metadata: n });
|
|
2468
|
+
if (W(e)) {
|
|
2469
|
+
let t = G(e), a = i.find((e) => I(e.volume, t));
|
|
2470
|
+
return /* @__PURE__ */ f("div", {
|
|
2471
|
+
className: "connector-fixes",
|
|
2472
|
+
children: [/* @__PURE__ */ f("div", {
|
|
2473
|
+
className: "connector-actions",
|
|
2474
|
+
children: [
|
|
2475
|
+
t && /* @__PURE__ */ d(Qn, {
|
|
2476
|
+
connector: e.connector,
|
|
2477
|
+
title: u,
|
|
2478
|
+
volume: t,
|
|
2479
|
+
state: a?.state ?? e.login?.state,
|
|
2480
|
+
running: !!a?.session,
|
|
2481
|
+
method: e.method,
|
|
2482
|
+
onStarted: o
|
|
2483
|
+
}),
|
|
2484
|
+
!p && /* @__PURE__ */ d("button", {
|
|
2485
|
+
type: "button",
|
|
2486
|
+
"aria-expanded": s === "pick",
|
|
2487
|
+
"aria-label": `Pick ${u} login identity for this Config`,
|
|
2488
|
+
onClick: () => l(s === "pick" ? "" : "pick"),
|
|
2489
|
+
children: "Pick a login identity"
|
|
2490
|
+
}),
|
|
2491
|
+
/* @__PURE__ */ f("a", {
|
|
2492
|
+
className: "document-action",
|
|
2493
|
+
href: zn(e.connector, fe(n)),
|
|
2494
|
+
children: [
|
|
2495
|
+
"Manage ",
|
|
2496
|
+
u,
|
|
2497
|
+
" login identities"
|
|
2498
|
+
]
|
|
2499
|
+
})
|
|
2500
|
+
]
|
|
2501
|
+
}), s === "pick" && !p && /* @__PURE__ */ d(dr, {
|
|
2502
|
+
status: e,
|
|
2503
|
+
config: n,
|
|
2504
|
+
identities: r,
|
|
2505
|
+
logins: i,
|
|
2506
|
+
onChanged: o,
|
|
2507
|
+
onClose: () => l("")
|
|
2508
|
+
})]
|
|
2509
|
+
});
|
|
2510
|
+
}
|
|
2511
|
+
return N(e.delivery) ? /* @__PURE__ */ f("div", {
|
|
2512
|
+
className: "connector-fixes",
|
|
2513
|
+
children: [
|
|
2514
|
+
/* @__PURE__ */ f("div", {
|
|
2515
|
+
className: "connector-actions",
|
|
2516
|
+
children: [/* @__PURE__ */ d("button", {
|
|
2517
|
+
type: "button",
|
|
2518
|
+
"aria-expanded": s === "default",
|
|
2519
|
+
"aria-label": `Set default for ${u}`,
|
|
2520
|
+
onClick: () => l(s === "default" ? "" : "default"),
|
|
2521
|
+
children: "Set default"
|
|
2522
|
+
}), !p && /* @__PURE__ */ d("button", {
|
|
2523
|
+
type: "button",
|
|
2524
|
+
"aria-expanded": s === "pick",
|
|
2525
|
+
"aria-label": `Pick ${u} identity for this Config`,
|
|
2526
|
+
onClick: () => l(s === "pick" ? "" : "pick"),
|
|
2527
|
+
children: "Pick for this Config"
|
|
2528
|
+
})]
|
|
2529
|
+
}),
|
|
2530
|
+
s === "default" && /* @__PURE__ */ d(ur, {
|
|
2531
|
+
status: e,
|
|
2532
|
+
connector: t,
|
|
2533
|
+
scope: fe(n),
|
|
2534
|
+
identities: r,
|
|
2535
|
+
secrets: a,
|
|
2536
|
+
onChanged: o,
|
|
2537
|
+
onClose: () => l("")
|
|
2538
|
+
}),
|
|
2539
|
+
s === "pick" && !p && /* @__PURE__ */ d(dr, {
|
|
2540
|
+
status: e,
|
|
2541
|
+
config: n,
|
|
2542
|
+
identities: r,
|
|
2543
|
+
onChanged: o,
|
|
2544
|
+
onClose: () => l("")
|
|
2545
|
+
})
|
|
2546
|
+
]
|
|
2547
|
+
}) : null;
|
|
2548
|
+
}
|
|
2549
|
+
function pr({ config: e }) {
|
|
2550
|
+
let t = le(e);
|
|
2551
|
+
return t.length ? /* @__PURE__ */ f("span", {
|
|
2552
|
+
className: "badge needs-connector",
|
|
2553
|
+
children: ["Needs connector: ", [...new Set(t.map(B))].join(", ")]
|
|
2554
|
+
}) : null;
|
|
2555
|
+
}
|
|
2556
|
+
function mr({ warning: e }) {
|
|
2557
|
+
return e?.trim() ? /* @__PURE__ */ f("p", {
|
|
2558
|
+
className: "connector-warning",
|
|
2559
|
+
role: "note",
|
|
2560
|
+
children: [
|
|
2561
|
+
/* @__PURE__ */ d("strong", { children: "Warning:" }),
|
|
2562
|
+
" ",
|
|
2563
|
+
e
|
|
2564
|
+
]
|
|
2565
|
+
}) : null;
|
|
2566
|
+
}
|
|
2567
|
+
function hr({ statuses: e, team: t = "" }) {
|
|
2568
|
+
return e.length ? /* @__PURE__ */ f("div", {
|
|
2569
|
+
className: "merged-values connector-identities-preview",
|
|
2570
|
+
children: [
|
|
2571
|
+
/* @__PURE__ */ d("h4", { children: "Connector identities" }),
|
|
2572
|
+
/* @__PURE__ */ d("p", {
|
|
2573
|
+
className: "description",
|
|
2574
|
+
children: "The identity each connector uses in this cell, and the level that decided it. Only stored secrets are named — no material is shown."
|
|
2575
|
+
}),
|
|
2576
|
+
/* @__PURE__ */ f("table", {
|
|
2577
|
+
"aria-label": "Connector identities",
|
|
2578
|
+
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ f("tr", { children: [
|
|
2579
|
+
/* @__PURE__ */ d("th", {
|
|
2580
|
+
scope: "col",
|
|
2581
|
+
children: "Connector"
|
|
2582
|
+
}),
|
|
2583
|
+
/* @__PURE__ */ d("th", {
|
|
2584
|
+
scope: "col",
|
|
2585
|
+
children: "Method"
|
|
2586
|
+
}),
|
|
2587
|
+
/* @__PURE__ */ d("th", {
|
|
2588
|
+
scope: "col",
|
|
2589
|
+
children: "Identity"
|
|
2590
|
+
}),
|
|
2591
|
+
/* @__PURE__ */ d("th", {
|
|
2592
|
+
scope: "col",
|
|
2593
|
+
children: "State"
|
|
2594
|
+
})
|
|
2595
|
+
] }) }), /* @__PURE__ */ d("tbody", { children: e.map((e) => /* @__PURE__ */ f("tr", { children: [
|
|
2596
|
+
/* @__PURE__ */ d("td", { children: B(e) }),
|
|
2597
|
+
/* @__PURE__ */ d("td", { children: e.method || "—" }),
|
|
2598
|
+
/* @__PURE__ */ f("td", { children: [
|
|
2599
|
+
/* @__PURE__ */ d(Xn, {
|
|
2600
|
+
status: e,
|
|
2601
|
+
team: t
|
|
2602
|
+
}),
|
|
2603
|
+
e.state !== "resolved" && e.message && /* @__PURE__ */ d("p", {
|
|
2604
|
+
className: "setup-error",
|
|
2605
|
+
children: e.message
|
|
2606
|
+
}),
|
|
2607
|
+
/* @__PURE__ */ d(mr, { warning: e.warning })
|
|
2608
|
+
] }),
|
|
2609
|
+
/* @__PURE__ */ d("td", { children: /* @__PURE__ */ d(Gn, { status: e }) })
|
|
2610
|
+
] }, `${e.connector}:${e.component}`)) })]
|
|
2611
|
+
})
|
|
2612
|
+
]
|
|
2613
|
+
}) : null;
|
|
2614
|
+
}
|
|
2615
|
+
function gr({ doc: e, revision: t, onChanged: n }) {
|
|
2616
|
+
let r = ce(e), i = m(r.length ? "/connectors" : null, t), a = m(r.some((e) => N(e.delivery)) ? "/catalog/secrets" : null, t), o = m(r.some(W) ? "/connectors/logins" : null, t);
|
|
2617
|
+
if (!r.length) return null;
|
|
2618
|
+
let s = de(e), c = r.filter(z);
|
|
2619
|
+
return /* @__PURE__ */ f("section", {
|
|
2620
|
+
className: "panel config-connectors",
|
|
2621
|
+
"aria-label": "Connectors",
|
|
2622
|
+
children: [/* @__PURE__ */ f("div", {
|
|
2623
|
+
className: "panel-heading",
|
|
2624
|
+
children: [/* @__PURE__ */ d("h2", { children: "Connectors" }), c.length ? /* @__PURE__ */ d(pr, { config: e }) : /* @__PURE__ */ d("span", {
|
|
2625
|
+
className: "badge",
|
|
2626
|
+
children: "All resolved"
|
|
2627
|
+
})]
|
|
2628
|
+
}), /* @__PURE__ */ f("div", {
|
|
2629
|
+
className: "panel-body",
|
|
2630
|
+
children: [
|
|
2631
|
+
/* @__PURE__ */ d("p", {
|
|
2632
|
+
className: "description",
|
|
2633
|
+
children: "What this Config needs access to, and the identity each connector uses for a cell created now. An identity comes from the Config's own pick, else the Stack, Space or Realm default."
|
|
2634
|
+
}),
|
|
2635
|
+
s && /* @__PURE__ */ f("p", {
|
|
2636
|
+
className: "connector-team",
|
|
2637
|
+
role: "note",
|
|
2638
|
+
children: [
|
|
2639
|
+
"Identities are set by team ",
|
|
2640
|
+
/* @__PURE__ */ d("a", {
|
|
2641
|
+
href: wn(s),
|
|
2642
|
+
children: /* @__PURE__ */ d("code", { children: s })
|
|
2643
|
+
}),
|
|
2644
|
+
". They are read-only here because applying the team re-renders this Config; change them on the team's Edit team screen (Credentials), or set a scope default."
|
|
2645
|
+
]
|
|
2646
|
+
}),
|
|
2647
|
+
i.error && /* @__PURE__ */ f("p", {
|
|
2648
|
+
className: "stale",
|
|
2649
|
+
children: ["The connector catalog could not be loaded: ", i.error.message]
|
|
2650
|
+
}),
|
|
2651
|
+
a.error && /* @__PURE__ */ f("p", {
|
|
2652
|
+
className: "stale",
|
|
2653
|
+
children: [
|
|
2654
|
+
"Identities could not be listed: ",
|
|
2655
|
+
a.error.message,
|
|
2656
|
+
". Name a secret by hand instead."
|
|
2657
|
+
]
|
|
2658
|
+
}),
|
|
2659
|
+
/* @__PURE__ */ d("ul", {
|
|
2660
|
+
className: "state-list connector-status-list",
|
|
2661
|
+
children: r.map((t) => /* @__PURE__ */ d("li", {
|
|
2662
|
+
"aria-label": `${B(t)} connector`,
|
|
2663
|
+
children: /* @__PURE__ */ f("div", {
|
|
2664
|
+
className: "connector-status",
|
|
2665
|
+
children: [
|
|
2666
|
+
/* @__PURE__ */ f("div", { children: [
|
|
2667
|
+
/* @__PURE__ */ d("strong", { children: B(t) }),
|
|
2668
|
+
" ",
|
|
2669
|
+
/* @__PURE__ */ d("span", {
|
|
2670
|
+
className: "badge",
|
|
2671
|
+
children: t.connector
|
|
2672
|
+
}),
|
|
2673
|
+
t.method && /* @__PURE__ */ f(u, { children: [" ", /* @__PURE__ */ d("span", {
|
|
2674
|
+
className: "badge",
|
|
2675
|
+
children: t.method
|
|
2676
|
+
})] }),
|
|
2677
|
+
" ",
|
|
2678
|
+
/* @__PURE__ */ d(Gn, { status: t })
|
|
2679
|
+
] }),
|
|
2680
|
+
/* @__PURE__ */ d("p", {
|
|
2681
|
+
className: "description",
|
|
2682
|
+
children: /* @__PURE__ */ d(Xn, {
|
|
2683
|
+
status: t,
|
|
2684
|
+
team: s
|
|
2685
|
+
})
|
|
2686
|
+
}),
|
|
2687
|
+
t.state !== "resolved" && t.message && /* @__PURE__ */ d("p", {
|
|
2688
|
+
className: "setup-error",
|
|
2689
|
+
children: t.message
|
|
2690
|
+
}),
|
|
2691
|
+
/* @__PURE__ */ d(fr, {
|
|
2692
|
+
status: t,
|
|
2693
|
+
connector: i.data?.find((e) => e.name === t.connector),
|
|
2694
|
+
config: e.metadata,
|
|
2695
|
+
identities: se(a.data, t.connector),
|
|
2696
|
+
logins: Te(o.data, t.connector),
|
|
2697
|
+
secrets: a.data,
|
|
2698
|
+
onChanged: n
|
|
2699
|
+
}),
|
|
2700
|
+
W(t) && /* @__PURE__ */ f("p", {
|
|
2701
|
+
className: "description",
|
|
2702
|
+
children: [
|
|
2703
|
+
"Log in opens a short-lived identity cell that mounts only this login identity and runs the ",
|
|
2704
|
+
B(t),
|
|
2705
|
+
" login; every cell of the same role then reuses it."
|
|
2706
|
+
]
|
|
2707
|
+
})
|
|
2708
|
+
]
|
|
2709
|
+
})
|
|
2710
|
+
}, `${t.connector}:${t.component}`))
|
|
2711
|
+
})
|
|
2712
|
+
]
|
|
2713
|
+
})]
|
|
2714
|
+
});
|
|
2715
|
+
}
|
|
2716
|
+
export { fn as $, ie as $t, Mn as A, pt as An, St as At, Cn as B, q as Bn, B as Bt, Hn as C, H as Cn, Wt as Ct, Kn as D, ht as Dn, zt as Dt, $ as E, ge as En, Zt as Et, bn as F, G as Fn, Fe as Ft, Tn as G, h as Gn, v as Gt, pn as H, xe as Hn, ve as Ht, yn as I, N as In, Ne as It, Sn as J, oe as Jt, un as K, m as Kn, b as Kt, ln as L, fe as Ln, dt as Lt, _n as M, Ke as Mn, Y as Mt, sn as N, E as Nn, he as Nt, Fn as O, gt as On, Lt as Ot, Dn as P, je as Pn, z as Pt, on as Q, ne as Qt, xn as R, de as Rn, me as Rt, Vn as S, pe as Sn, wt as St, Zn as T, U as Tn, qt as Tt, mn as U, _ as Un, ee as Ut, hn as V, Le as Vn, Ce as Vt, gn as W, g as Wn, _e as Wt, En as X, Se as Xt, vn as Y, mt as Yt, wn as Z, re as Zt, Ln as _, L as _n, Xt as _t, mr as a, _t as an, Nt as at, Wn as b, I as bn, Qt as bt, Qn as c, Te as cn, Vt as ct, pr as d, Ae as dn, Ht as dt, se as en, Pt as et, tr as f, Pe as fn, Rt as ft, Xn as g, R as gn, rn as gt, cr as h, F as hn, Ft as ht, Gn as i, W as in, $t as it, On as j, ft as jn, Ct as jt, Pn as k, P as kn, bt as kt, $n as l, te as ln, Ut as lt, rr as m, ue as mn, It as mt, fr as n, Be as nn, Bt as nt, lr as o, ke as on, Jt as ot, nr as p, Ie as pn, Tt as pt, dn as q, y as qt, hr as r, be as rn, jt as rt, er as s, k as sn, tn as st, gr as t, Ve as tn, en as tt, Jn as u, ye as un, Gt as ut, Rn as v, vt as vn, Kt as vt, In as w, T as wn, At as wt, Bn as x, V as xn, Mt as xt, zn as y, qe as yn, Yt as yt, an as z, We as zn, ce as zt };
|