@w6w/embed 0.2.27 → 0.2.28
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/lists.mjs +1057 -1000
- package/dist/lists.mjs.map +1 -1
- package/package.json +2 -2
package/dist/lists.mjs
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as l, jsx as t, Fragment as
|
|
3
|
-
import { useState as f, useMemo as
|
|
4
|
-
import { F as
|
|
5
|
-
import { d as
|
|
2
|
+
import { jsxs as l, jsx as t, Fragment as q } from "react/jsx-runtime";
|
|
3
|
+
import { useState as f, useMemo as le, useEffect as xt } from "react";
|
|
4
|
+
import { F as Rt, E as Pt } from "./CreateFunctionModal-B3LpcuI9.js";
|
|
5
|
+
import { d as Ot, f as Kt, h as Ft, b as ze, n as Se, u as jt, m as Qt } from "./endpoints-DArAqoLT.js";
|
|
6
6
|
import { u as X, b as Me } from "./project-context-Tvp-La7A.js";
|
|
7
|
-
import { CallableList as
|
|
8
|
-
import { I as
|
|
9
|
-
import { i as
|
|
10
|
-
import { a3 as
|
|
11
|
-
import { n as
|
|
12
|
-
import { f as
|
|
13
|
-
import { C as
|
|
14
|
-
import { D as
|
|
15
|
-
import { k as
|
|
16
|
-
import { H as
|
|
17
|
-
import { ApiError as
|
|
18
|
-
import { useQueryClient as
|
|
19
|
-
import { u as
|
|
20
|
-
import { M as
|
|
21
|
-
import { j as
|
|
22
|
-
import { u as
|
|
23
|
-
import { v as
|
|
24
|
-
import { x as
|
|
25
|
-
import { u as
|
|
26
|
-
import { h as
|
|
7
|
+
import { CallableList as qt, ReliabilityList as _t, EmptyState as xe, DataTable as Re, EditButton as Je, DeleteButton as Vt, ListItem as Le, HealthStatusPill as ve, HistoryTimeline as Wt, useW6WApi as Ge, connectionAppIdsToLookUp as Ze, ConnectionList as Bt, AddConnectionModal as Ut, EditConnectionModal as Xe, Modal as Ht, resolveConnectionAppMeta as Yt, ConnectionHeader as zt, IconButton as Jt, locateDataStoreError as Gt, tableSchemaOf as Zt, draftFromEntry as ye, CsvPanel as Xt, DataTableGrid as en, NEW_ROW_ID as ae, newRowDraft as Ke, kvValueTypeOf as tn, DataEntryList as nn, DataEntryEditor as an, dirtyColumns as sn, csvFilenameOf as ln, csvImportMessage as Fe, buildRowValue as rn, rowWriteOf as on, remainingTtlSeconds as et, isVersionConflict as tt, cellErrorsOf as cn, parseDocText as dn, kvValueOf as un, serializeCell as mn, DataStoreList as hn, DATA_STORE_KINDS as wn, DATA_STORE_KIND_LABEL as pn, SCALAR_TYPES as fn, ColumnsEditor as yn, errorPlacement as gn } from "@w6w/ui";
|
|
8
|
+
import { I as vn } from "./ImportSpecModal-xwTzj4KB.js";
|
|
9
|
+
import { i as bn } from "./import-bindings-EUtxZ9Ti.js";
|
|
10
|
+
import { a3 as Nn, a1 as nt, T as kn, E as Cn } from "./workflows-Dz8LMjnt.js";
|
|
11
|
+
import { n as Tn, b as En } from "./workflow-blank-BJFLdGyE.js";
|
|
12
|
+
import { f as In, e as je, g as Dn, b as $n, h as An, i as Ln } from "./api-calls--JHyif6a.js";
|
|
13
|
+
import { C as Ne, a as Sn, M as Mn } from "./ConfirmModal-Pv2-A_3U.js";
|
|
14
|
+
import { D as xn } from "./DocumentFormModal-DieWYFi4.js";
|
|
15
|
+
import { k as Rn, i as Pn } from "./spec-import-0B6oUewa.js";
|
|
16
|
+
import { H as On, a as at } from "./editor-apps-HEOclsxL.js";
|
|
17
|
+
import { ApiError as st } from "@w6w/sdk";
|
|
18
|
+
import { useQueryClient as pe, useInfiniteQuery as it, useQuery as lt } from "@tanstack/react-query";
|
|
19
|
+
import { u as rt, o as ot, k as ct, c as we, b as dt, m as Kn, p as ut, e as Qe, q as Fn } from "./connections-CzsCyIxY.js";
|
|
20
|
+
import { M as jn } from "./ModelRoutesManager-DtByS4mE.js";
|
|
21
|
+
import { j as Qn } from "./apps-FMcQfyL2.js";
|
|
22
|
+
import { u as ce } from "./client-context-CX61Bgw-.js";
|
|
23
|
+
import { v as qn, A as _n, s as Vn, E as Wn, c as Bn } from "./models-CI0vLJ6o.js";
|
|
24
|
+
import { x as mt, w as ke, a as ht, p as Un, g as oe, v as Hn, q as Yn, z as wt, A as pt, B as zn, y as ft, o as ee, c as Jn, i as Gn, h as Zn } from "./credentials-4Nf2GfMc.js";
|
|
25
|
+
import { u as yt, b as Xn, d as ea, c as ta } from "./ai-keys-D676ly41.js";
|
|
26
|
+
import { h as na, k as gt, p as vt, o as aa, j as bt, n as sa, m as ia, g as Nt, i as la, u as ra, f as oa } from "./data-stores-UeQvwVCa.js";
|
|
27
27
|
function Pe(e) {
|
|
28
|
-
const { kind: n } = e, a =
|
|
28
|
+
const { kind: n } = e, a = Ot(n), [s, i] = f(!1), o = (e.rows ?? []).map((r) => ({
|
|
29
29
|
...e.toRow(r),
|
|
30
30
|
id: r.id,
|
|
31
|
-
archived:
|
|
31
|
+
archived: bn(r)
|
|
32
32
|
}));
|
|
33
33
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root", children: [
|
|
34
34
|
/* @__PURE__ */ t(
|
|
35
|
-
|
|
35
|
+
qt,
|
|
36
36
|
{
|
|
37
37
|
rows: o,
|
|
38
38
|
title: a.listTitle,
|
|
@@ -49,33 +49,33 @@ function Pe(e) {
|
|
|
49
49
|
error: e.error,
|
|
50
50
|
onCreate: e.onCreate,
|
|
51
51
|
creating: e.creating,
|
|
52
|
-
onImport: () =>
|
|
52
|
+
onImport: () => i(!0),
|
|
53
53
|
onOpen: e.onOpen,
|
|
54
54
|
getHref: e.getHref,
|
|
55
55
|
slots: e.slots
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
s && /* @__PURE__ */ t(
|
|
59
|
+
vn,
|
|
60
60
|
{
|
|
61
61
|
kind: n,
|
|
62
62
|
project: e.project ?? void 0,
|
|
63
|
-
listKeys: { functionsKey:
|
|
63
|
+
listKeys: { functionsKey: Ft, endpointsKey: Kt, workflowsKey: Nn },
|
|
64
64
|
onOpenImported: (r, c) => {
|
|
65
|
-
var
|
|
66
|
-
return (
|
|
65
|
+
var m;
|
|
66
|
+
return (m = e.onOpen) == null ? void 0 : m.call(e, c);
|
|
67
67
|
},
|
|
68
|
-
onClose: () =>
|
|
68
|
+
onClose: () => i(!1)
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
71
|
e.children
|
|
72
72
|
] });
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function kt({ tags: e }) {
|
|
75
75
|
return !e || e.length === 0 ? null : /* @__PURE__ */ t("span", { className: "wf-row-tags", "data-testid": "callable-row-tags", children: e.map((n) => /* @__PURE__ */ t("span", { className: "tag", children: n }, n)) });
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
const n =
|
|
77
|
+
function Vs(e) {
|
|
78
|
+
const n = ze(), a = X(e.project), [s, i] = f(null);
|
|
79
79
|
return /* @__PURE__ */ t(
|
|
80
80
|
Pe,
|
|
81
81
|
{
|
|
@@ -89,33 +89,33 @@ function Fs(e) {
|
|
|
89
89
|
return {
|
|
90
90
|
title: o.displayName || o.key,
|
|
91
91
|
description: o.description,
|
|
92
|
-
badges: (r = o.tags) != null && r.length || !o.valid ? /* @__PURE__ */ l(
|
|
93
|
-
/* @__PURE__ */ t(
|
|
92
|
+
badges: (r = o.tags) != null && r.length || !o.valid ? /* @__PURE__ */ l(q, { children: [
|
|
93
|
+
/* @__PURE__ */ t(kt, { tags: o.tags }),
|
|
94
94
|
o.valid ? null : /* @__PURE__ */ t("span", { className: "w6w-callable-list-badge", children: "incomplete" })
|
|
95
95
|
] }) : null
|
|
96
96
|
};
|
|
97
97
|
},
|
|
98
98
|
onOpen: e.onOpen,
|
|
99
99
|
getHref: e.getHref,
|
|
100
|
-
onCreate: () =>
|
|
100
|
+
onCreate: () => i(Se("function")),
|
|
101
101
|
slots: e.slots,
|
|
102
|
-
children:
|
|
103
|
-
|
|
102
|
+
children: s !== null && /* @__PURE__ */ t(
|
|
103
|
+
Rt,
|
|
104
104
|
{
|
|
105
|
-
newId:
|
|
105
|
+
newId: s,
|
|
106
106
|
takenKeys: (n.data ?? []).map((o) => o.key),
|
|
107
|
-
onClose: () =>
|
|
107
|
+
onClose: () => i(null),
|
|
108
108
|
onCreated: (o) => {
|
|
109
109
|
var r;
|
|
110
|
-
|
|
110
|
+
i(null), (r = e.onCreated) == null || r.call(e, o);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
)
|
|
114
114
|
}
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
const n =
|
|
117
|
+
function Ws(e) {
|
|
118
|
+
const n = jt(), a = X(e.project), [s, i] = f(null);
|
|
119
119
|
return /* @__PURE__ */ t(
|
|
120
120
|
Pe,
|
|
121
121
|
{
|
|
@@ -129,9 +129,9 @@ function Qs(e) {
|
|
|
129
129
|
return {
|
|
130
130
|
// The draft tag sits INSIDE the title, after the name: ui `ListItem` puts `badges` in
|
|
131
131
|
// a trailing `margin-left: auto` slot, which would strand it at the row's far edge.
|
|
132
|
-
title: /* @__PURE__ */ l(
|
|
132
|
+
title: /* @__PURE__ */ l(q, { children: [
|
|
133
133
|
/* @__PURE__ */ t("strong", { children: o.displayName || o.key }),
|
|
134
|
-
|
|
134
|
+
Qt(o) ? /* @__PURE__ */ t(
|
|
135
135
|
"span",
|
|
136
136
|
{
|
|
137
137
|
className: "tag warn",
|
|
@@ -142,42 +142,42 @@ function Qs(e) {
|
|
|
142
142
|
) : null
|
|
143
143
|
] }),
|
|
144
144
|
description: o.description,
|
|
145
|
-
badges: (r = o.tags) != null && r.length ? /* @__PURE__ */ t(
|
|
145
|
+
badges: (r = o.tags) != null && r.length ? /* @__PURE__ */ t(kt, { tags: o.tags }) : null
|
|
146
146
|
};
|
|
147
147
|
},
|
|
148
148
|
onOpen: e.onOpen,
|
|
149
149
|
getHref: e.getHref,
|
|
150
|
-
onCreate: () =>
|
|
150
|
+
onCreate: () => i(Se("endpoint")),
|
|
151
151
|
slots: e.slots,
|
|
152
|
-
children:
|
|
153
|
-
|
|
152
|
+
children: s !== null && /* @__PURE__ */ t(
|
|
153
|
+
Pt,
|
|
154
154
|
{
|
|
155
|
-
newId:
|
|
155
|
+
newId: s,
|
|
156
156
|
takenKeys: (n.data ?? []).map((o) => o.key),
|
|
157
|
-
onClose: () =>
|
|
157
|
+
onClose: () => i(null),
|
|
158
158
|
onCreated: (o) => {
|
|
159
159
|
var r;
|
|
160
|
-
|
|
160
|
+
i(null), (r = e.onCreated) == null || r.call(e, o);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
)
|
|
164
164
|
}
|
|
165
165
|
);
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
const n = X(e.project), a =
|
|
167
|
+
function Bs(e) {
|
|
168
|
+
const n = X(e.project), a = nt(n ?? void 0, n != null), s = kn(n ?? void 0), [i, o] = f(null);
|
|
169
169
|
return /* @__PURE__ */ t(
|
|
170
170
|
Pe,
|
|
171
171
|
{
|
|
172
172
|
kind: "workflow",
|
|
173
173
|
rows: a.data,
|
|
174
174
|
loading: a.isLoading,
|
|
175
|
-
error:
|
|
175
|
+
error: i ?? (a.error ? String(a.error) : null),
|
|
176
176
|
project: n,
|
|
177
177
|
toRow: (r) => ({
|
|
178
178
|
title: r.displayName || r.name,
|
|
179
179
|
description: r.description,
|
|
180
|
-
badges: /* @__PURE__ */ l(
|
|
180
|
+
badges: /* @__PURE__ */ l(q, { children: [
|
|
181
181
|
r.tags.length > 0 && /* @__PURE__ */ t("span", { className: "wf-row-tags", children: r.tags.map((c) => /* @__PURE__ */ t("span", { className: "tag", children: c }, c)) }),
|
|
182
182
|
r.status !== "archived" && /* @__PURE__ */ t("span", { className: `badge wf-status ${r.status}`, children: r.status })
|
|
183
183
|
] }),
|
|
@@ -191,82 +191,82 @@ function _s(e) {
|
|
|
191
191
|
getHref: e.getHref,
|
|
192
192
|
onCreate: () => {
|
|
193
193
|
o(null);
|
|
194
|
-
const r =
|
|
195
|
-
|
|
194
|
+
const r = Tn((a.data ?? []).map((c) => c.displayName || c.name));
|
|
195
|
+
s.mutate(En(Se("workflow"), r), {
|
|
196
196
|
onSuccess: (c) => {
|
|
197
|
-
var
|
|
198
|
-
return (
|
|
197
|
+
var m;
|
|
198
|
+
return (m = e.onCreated) == null ? void 0 : m.call(e, c.workflow.id);
|
|
199
199
|
},
|
|
200
200
|
onError: (c) => o(c instanceof Error ? c.message : String(c))
|
|
201
201
|
});
|
|
202
202
|
},
|
|
203
|
-
creating:
|
|
203
|
+
creating: s.isPending,
|
|
204
204
|
slots: e.slots
|
|
205
205
|
}
|
|
206
206
|
);
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function Us({
|
|
209
209
|
project: e,
|
|
210
210
|
variant: n = "full",
|
|
211
211
|
limit: a,
|
|
212
|
-
days:
|
|
213
|
-
showChart:
|
|
212
|
+
days: s = 30,
|
|
213
|
+
showChart: i,
|
|
214
214
|
getHref: o,
|
|
215
215
|
onOpen: r,
|
|
216
216
|
showAllHref: c,
|
|
217
|
-
onShowAll:
|
|
218
|
-
slots:
|
|
217
|
+
onShowAll: m,
|
|
218
|
+
slots: u
|
|
219
219
|
}) {
|
|
220
220
|
var y, p;
|
|
221
|
-
const g = Me().project,
|
|
222
|
-
let v =
|
|
223
|
-
return
|
|
224
|
-
|
|
221
|
+
const g = Me().project, h = e === void 0 ? g : e, C = h || null, w = In(C ?? void 0, s);
|
|
222
|
+
let v = u == null ? void 0 : u.empty;
|
|
223
|
+
return C ? w.isLoading ? v = /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) : w.error && (v = /* @__PURE__ */ t("div", { className: "error", children: w.error.message })) : v = /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see its reliability." }), /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ t(
|
|
224
|
+
_t,
|
|
225
225
|
{
|
|
226
|
-
services:
|
|
227
|
-
window:
|
|
228
|
-
days:
|
|
226
|
+
services: C ? ((y = w.data) == null ? void 0 : y.services) ?? [] : [],
|
|
227
|
+
window: C ? (p = w.data) == null ? void 0 : p.window : void 0,
|
|
228
|
+
days: s,
|
|
229
229
|
compact: n === "compact",
|
|
230
|
-
showChart:
|
|
230
|
+
showChart: i,
|
|
231
231
|
limit: a,
|
|
232
232
|
getHref: o,
|
|
233
233
|
onOpen: r,
|
|
234
234
|
showAllHref: c,
|
|
235
|
-
onShowAll:
|
|
236
|
-
slots: { ...
|
|
235
|
+
onShowAll: m,
|
|
236
|
+
slots: { ...u, empty: v }
|
|
237
237
|
}
|
|
238
238
|
) });
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function ca(e) {
|
|
241
241
|
const n = e.replace(/\s+/g, " ").trim();
|
|
242
242
|
return n.length > 80 ? `${n.slice(0, 80)}…` : n;
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Hs({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
245
245
|
var y;
|
|
246
|
-
const o = X(e), r =
|
|
246
|
+
const o = X(e), r = Rn(o ?? void 0, o != null), c = Pn(), [m, u] = f(null), [g, h] = f(null), C = (s == null ? void 0 : s.header) === void 0 ? /* @__PURE__ */ l("div", { children: [
|
|
247
247
|
/* @__PURE__ */ t("h3", { children: "Documents" }),
|
|
248
248
|
/* @__PURE__ */ t("p", { className: "muted small", children: "Each document is free-form content stored verbatim." })
|
|
249
|
-
] }) :
|
|
249
|
+
] }) : s.header, w = (s == null ? void 0 : s.empty) === void 0 ? /* @__PURE__ */ t(xe, { testId: "document-list-empty", children: "No documents yet." }) : s.empty, v = [
|
|
250
250
|
{
|
|
251
251
|
key: "key",
|
|
252
252
|
header: "Document",
|
|
253
253
|
render: (p) => {
|
|
254
|
-
var
|
|
255
|
-
const
|
|
254
|
+
var $;
|
|
255
|
+
const T = ($ = i == null ? void 0 : i.lead) == null ? void 0 : $.call(i, p);
|
|
256
256
|
return /* @__PURE__ */ l("span", { style: { display: "flex", alignItems: "center" }, children: [
|
|
257
|
-
|
|
257
|
+
T,
|
|
258
258
|
/* @__PURE__ */ l(
|
|
259
259
|
"span",
|
|
260
260
|
{
|
|
261
261
|
className: "list-main",
|
|
262
|
-
style: { marginLeft:
|
|
262
|
+
style: { marginLeft: T != null ? "var(--w6w-sp-2)" : 0 },
|
|
263
263
|
children: [
|
|
264
264
|
/* @__PURE__ */ t("strong", { className: "list-name", title: p.key, children: p.key }),
|
|
265
265
|
" ",
|
|
266
266
|
/* @__PURE__ */ t("span", { className: "tag", children: p.format }),
|
|
267
267
|
/* @__PURE__ */ l("div", { className: "muted small list-preview", children: [
|
|
268
|
-
/* @__PURE__ */ t("code", { children:
|
|
269
|
-
p.description && /* @__PURE__ */ l(
|
|
268
|
+
/* @__PURE__ */ t("code", { children: ca(p.content) }),
|
|
269
|
+
p.description && /* @__PURE__ */ l(q, { children: [
|
|
270
270
|
" · ",
|
|
271
271
|
p.description
|
|
272
272
|
] })
|
|
@@ -284,35 +284,35 @@ function Vs({ project: e, onOpen: n, getHref: a, slots: i, rowSlots: s }) {
|
|
|
284
284
|
link: !1,
|
|
285
285
|
actions: !0,
|
|
286
286
|
render: (p) => {
|
|
287
|
-
var
|
|
288
|
-
const
|
|
287
|
+
var $, b;
|
|
288
|
+
const T = ($ = i == null ? void 0 : i.footer) == null ? void 0 : $.call(i, p);
|
|
289
289
|
return (
|
|
290
290
|
// Clicks here must not reach the row's onOpen.
|
|
291
291
|
// biome-ignore lint/a11y/useKeyWithClickEvents: propagation guard only; the buttons inside are the controls.
|
|
292
|
-
/* @__PURE__ */ l("div", { onClick: (
|
|
292
|
+
/* @__PURE__ */ l("div", { onClick: (I) => I.stopPropagation(), children: [
|
|
293
293
|
/* @__PURE__ */ l("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)", justifyContent: "flex-end" }, children: [
|
|
294
|
-
/* @__PURE__ */ t(
|
|
295
|
-
p.shared ? (b =
|
|
294
|
+
/* @__PURE__ */ t(Sn, { resource: { kind: "document", key: p.key } }),
|
|
295
|
+
p.shared ? (b = i == null ? void 0 : i.sharedActions) == null ? void 0 : b.call(i, p) : /* @__PURE__ */ l(q, { children: [
|
|
296
296
|
/* @__PURE__ */ t(
|
|
297
|
-
|
|
297
|
+
Je,
|
|
298
298
|
{
|
|
299
299
|
label: "Edit",
|
|
300
|
-
onClick: () =>
|
|
300
|
+
onClick: () => u({ mode: "edit", d: p }),
|
|
301
301
|
"data-testid": `document-edit-${p.id}`
|
|
302
302
|
}
|
|
303
303
|
),
|
|
304
304
|
/* @__PURE__ */ t(
|
|
305
|
-
|
|
305
|
+
Vt,
|
|
306
306
|
{
|
|
307
307
|
label: "Delete",
|
|
308
|
-
onClick: () =>
|
|
308
|
+
onClick: () => h(p),
|
|
309
309
|
disabled: c.isPending,
|
|
310
310
|
"data-testid": `document-delete-${p.id}`
|
|
311
311
|
}
|
|
312
312
|
)
|
|
313
313
|
] })
|
|
314
314
|
] }),
|
|
315
|
-
|
|
315
|
+
T != null && /* @__PURE__ */ t("div", { className: "w6w-doc-footer", children: T })
|
|
316
316
|
] })
|
|
317
317
|
);
|
|
318
318
|
}
|
|
@@ -321,14 +321,14 @@ function Vs({ project: e, onOpen: n, getHref: a, slots: i, rowSlots: s }) {
|
|
|
321
321
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root", children: [
|
|
322
322
|
/* @__PURE__ */ l("section", { className: "section", children: [
|
|
323
323
|
/* @__PURE__ */ l("div", { className: "section-head", children: [
|
|
324
|
-
|
|
324
|
+
C,
|
|
325
325
|
/* @__PURE__ */ t(
|
|
326
326
|
"button",
|
|
327
327
|
{
|
|
328
328
|
type: "button",
|
|
329
329
|
className: "btn",
|
|
330
330
|
disabled: o == null,
|
|
331
|
-
onClick: () =>
|
|
331
|
+
onClick: () => u({ mode: "create" }),
|
|
332
332
|
children: "+ Add document"
|
|
333
333
|
}
|
|
334
334
|
)
|
|
@@ -343,35 +343,35 @@ function Vs({ project: e, onOpen: n, getHref: a, slots: i, rowSlots: s }) {
|
|
|
343
343
|
rows: r.data,
|
|
344
344
|
rowKey: (p) => p.id,
|
|
345
345
|
getRowHref: a ? (p) => a(p.id) : void 0,
|
|
346
|
-
onRowClick: n ? (p,
|
|
346
|
+
onRowClick: n ? (p, T) => n(p.id, T) : void 0
|
|
347
347
|
}
|
|
348
348
|
)
|
|
349
349
|
] })
|
|
350
350
|
] }),
|
|
351
|
-
|
|
352
|
-
|
|
351
|
+
m && /* @__PURE__ */ t(
|
|
352
|
+
xn,
|
|
353
353
|
{
|
|
354
|
-
initial:
|
|
354
|
+
initial: m.mode === "edit" ? m.d : void 0,
|
|
355
355
|
project: o,
|
|
356
|
-
onClose: () =>
|
|
357
|
-
onSaved: () =>
|
|
356
|
+
onClose: () => u(null),
|
|
357
|
+
onSaved: () => u(null)
|
|
358
358
|
}
|
|
359
359
|
),
|
|
360
360
|
g && /* @__PURE__ */ t(
|
|
361
|
-
|
|
361
|
+
Ne,
|
|
362
362
|
{
|
|
363
363
|
title: "Delete document",
|
|
364
364
|
message: `Delete the document "${g.key}"? This cannot be undone.`,
|
|
365
365
|
confirmLabel: "Delete",
|
|
366
366
|
onConfirm: () => {
|
|
367
|
-
o != null && c.mutate({ id: g.id, project: o }),
|
|
367
|
+
o != null && c.mutate({ id: g.id, project: o }), h(null);
|
|
368
368
|
},
|
|
369
|
-
onClose: () =>
|
|
369
|
+
onClose: () => h(null)
|
|
370
370
|
}
|
|
371
371
|
)
|
|
372
372
|
] });
|
|
373
373
|
}
|
|
374
|
-
const
|
|
374
|
+
const da = {
|
|
375
375
|
workflow: "Workflow run",
|
|
376
376
|
workflow_step: "Workflow step",
|
|
377
377
|
connection_test: "Connection test",
|
|
@@ -382,10 +382,10 @@ const oa = {
|
|
|
382
382
|
endpoint: "Endpoint call",
|
|
383
383
|
action: "App action"
|
|
384
384
|
};
|
|
385
|
-
function
|
|
386
|
-
return
|
|
385
|
+
function be(e) {
|
|
386
|
+
return da[e] ?? e;
|
|
387
387
|
}
|
|
388
|
-
const
|
|
388
|
+
const Ct = {
|
|
389
389
|
workflow: "workflow",
|
|
390
390
|
workflow_step: "workflow_step",
|
|
391
391
|
connection_test: "base",
|
|
@@ -394,65 +394,65 @@ const Nt = {
|
|
|
394
394
|
endpoint: "base",
|
|
395
395
|
action: "base"
|
|
396
396
|
};
|
|
397
|
-
function
|
|
398
|
-
return Object.hasOwn(
|
|
397
|
+
function ua(e) {
|
|
398
|
+
return Object.hasOwn(Ct, e);
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
return
|
|
400
|
+
function Tt(e) {
|
|
401
|
+
return ua(e) ? Ct[e] : "base";
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function ma(e, n) {
|
|
404
404
|
const a = /* @__PURE__ */ new Map();
|
|
405
|
-
for (const
|
|
406
|
-
const o =
|
|
407
|
-
o && a.set(
|
|
405
|
+
for (const i of e ?? []) {
|
|
406
|
+
const o = i.displayName || i.key;
|
|
407
|
+
o && a.set(i.id, o);
|
|
408
408
|
}
|
|
409
|
-
const
|
|
410
|
-
for (const
|
|
411
|
-
const o =
|
|
412
|
-
o &&
|
|
409
|
+
const s = /* @__PURE__ */ new Map();
|
|
410
|
+
for (const i of n ?? []) {
|
|
411
|
+
const o = i.displayName || i.name;
|
|
412
|
+
o && s.set(i.id, o);
|
|
413
413
|
}
|
|
414
|
-
return { functions: a, workflows:
|
|
415
|
-
}
|
|
416
|
-
function
|
|
417
|
-
const a = e.summary ??
|
|
418
|
-
if (
|
|
419
|
-
const
|
|
420
|
-
if (
|
|
421
|
-
return { text:
|
|
414
|
+
return { functions: a, workflows: s };
|
|
415
|
+
}
|
|
416
|
+
function ha(e, n) {
|
|
417
|
+
const a = e.summary ?? be(e.kind), s = Tt(e.kind);
|
|
418
|
+
if (s === "function" && e.functionId !== null) {
|
|
419
|
+
const i = n.functions.get(e.functionId);
|
|
420
|
+
if (i !== void 0)
|
|
421
|
+
return { text: i, target: { kind: "function", id: e.functionId } };
|
|
422
422
|
}
|
|
423
|
-
if (
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
426
|
-
return { text:
|
|
423
|
+
if (s === "workflow" && e.workflowId !== null) {
|
|
424
|
+
const i = n.workflows.get(e.workflowId);
|
|
425
|
+
if (i !== void 0)
|
|
426
|
+
return { text: i, target: { kind: "workflow", id: e.workflowId } };
|
|
427
427
|
}
|
|
428
|
-
if (
|
|
429
|
-
const
|
|
428
|
+
if (s === "workflow_step") {
|
|
429
|
+
const i = e.workflowId, o = i !== null ? n.workflows.get(i) : void 0, r = o ?? i ?? e.summary ?? "Unknown workflow", c = o !== void 0 && i !== null;
|
|
430
430
|
return {
|
|
431
431
|
text: e.stepId ? `${r} - ${e.stepId}` : r,
|
|
432
|
-
target: c ? { kind: "workflow", id:
|
|
432
|
+
target: c ? { kind: "workflow", id: i } : null
|
|
433
433
|
};
|
|
434
434
|
}
|
|
435
435
|
return { text: a, target: null };
|
|
436
436
|
}
|
|
437
|
-
const
|
|
438
|
-
function
|
|
437
|
+
const me = (e) => String(e).padStart(2, "0");
|
|
438
|
+
function Et(e) {
|
|
439
439
|
const n = new Date(e);
|
|
440
|
-
return Number.isNaN(n.getTime()) ? e : `${`${n.getFullYear()}-${
|
|
440
|
+
return Number.isNaN(n.getTime()) ? e : `${`${n.getFullYear()}-${me(n.getMonth() + 1)}-${me(n.getDate())}`} ${me(n.getHours())}:${me(n.getMinutes())}:${me(n.getSeconds())}`;
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function It(e) {
|
|
443
443
|
return e == null || !Number.isFinite(e) || e < 0 ? null : e < 1e3 ? `${Math.round(e)} ms` : e < 6e4 ? `${(Math.floor(e / 100) / 10).toFixed(1)} s` : `${Math.floor(e / 6e4)}m ${Math.floor(e % 6e4 / 1e3)}s`;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function wa() {
|
|
446
446
|
const e = /* @__PURE__ */ new Date();
|
|
447
447
|
return e.setHours(0, 0, 0, 0), e.toISOString();
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function pa(e, n) {
|
|
450
450
|
const a = new Date(e);
|
|
451
451
|
if (Number.isNaN(a.getTime())) return e;
|
|
452
|
-
const
|
|
453
|
-
return n === "week" ? `Week of ${
|
|
452
|
+
const s = a.toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
453
|
+
return n === "week" ? `Week of ${s}` : s;
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Dt({ ok: e }) {
|
|
456
456
|
return e === null ? /* @__PURE__ */ t("span", { className: "muted", children: "–" }) : /* @__PURE__ */ t("span", { className: e ? "ok" : "error", children: e ? "✓" : "✗" });
|
|
457
457
|
}
|
|
458
458
|
function De({ label: e, value: n }) {
|
|
@@ -461,140 +461,140 @@ function De({ label: e, value: n }) {
|
|
|
461
461
|
/* @__PURE__ */ t("div", { className: "muted small", children: e })
|
|
462
462
|
] });
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function qe({
|
|
465
465
|
title: e,
|
|
466
466
|
headline: n,
|
|
467
467
|
loading: a
|
|
468
468
|
}) {
|
|
469
|
-
const
|
|
469
|
+
const s = n ?? { workflowRuns: 0, succeeded: 0, failed: 0 };
|
|
470
470
|
return /* @__PURE__ */ l("section", { className: "w6w-activity-section", children: [
|
|
471
471
|
/* @__PURE__ */ t("h3", { children: e }),
|
|
472
472
|
a ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : /* @__PURE__ */ l("div", { className: "w6w-activity-stats", children: [
|
|
473
|
-
/* @__PURE__ */ t(De, { label: "Workflow runs", value:
|
|
474
|
-
/* @__PURE__ */ t(De, { label: "Succeeded", value:
|
|
475
|
-
/* @__PURE__ */ t(De, { label: "Failed", value:
|
|
473
|
+
/* @__PURE__ */ t(De, { label: "Workflow runs", value: s.workflowRuns }),
|
|
474
|
+
/* @__PURE__ */ t(De, { label: "Succeeded", value: s.succeeded }),
|
|
475
|
+
/* @__PURE__ */ t(De, { label: "Failed", value: s.failed })
|
|
476
476
|
] })
|
|
477
477
|
] });
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function fa({
|
|
480
480
|
entry: e,
|
|
481
481
|
names: n,
|
|
482
482
|
getHref: a,
|
|
483
|
-
onOpen:
|
|
483
|
+
onOpen: s
|
|
484
484
|
}) {
|
|
485
|
-
const { text:
|
|
486
|
-
if (o === null) return /* @__PURE__ */ t(
|
|
487
|
-
const r =
|
|
488
|
-
return a ? /* @__PURE__ */ t("a", { href: a(o), onClick: r, children:
|
|
485
|
+
const { text: i, target: o } = ha(e, n);
|
|
486
|
+
if (o === null) return /* @__PURE__ */ t(q, { children: i });
|
|
487
|
+
const r = s ? (c) => s(o, c) : void 0;
|
|
488
|
+
return a ? /* @__PURE__ */ t("a", { href: a(o), onClick: r, children: i }) : r ? /* @__PURE__ */ t("button", { type: "button", className: "w6w-activity-link", onClick: r, children: i }) : /* @__PURE__ */ t(q, { children: i });
|
|
489
489
|
}
|
|
490
|
-
function
|
|
491
|
-
const a =
|
|
490
|
+
function $t({ entry: e, title: n }) {
|
|
491
|
+
const a = It(e.durationMs);
|
|
492
492
|
return /* @__PURE__ */ t(
|
|
493
|
-
|
|
493
|
+
Le,
|
|
494
494
|
{
|
|
495
|
-
icon: /* @__PURE__ */ t(
|
|
496
|
-
title: n ?? e.summary ??
|
|
497
|
-
subtitle: `${
|
|
495
|
+
icon: /* @__PURE__ */ t(Dt, { ok: e.ok }),
|
|
496
|
+
title: n ?? e.summary ?? be(e.kind),
|
|
497
|
+
subtitle: `${be(e.kind)} · ${Et(e.occurredAt)}`,
|
|
498
498
|
trailing: a === null ? void 0 : /* @__PURE__ */ t("span", { className: "muted small", children: a })
|
|
499
499
|
}
|
|
500
500
|
);
|
|
501
501
|
}
|
|
502
502
|
function $e(e) {
|
|
503
|
-
return /* @__PURE__ */ t(
|
|
503
|
+
return /* @__PURE__ */ t($t, { entry: e.entry, title: /* @__PURE__ */ t(fa, { ...e }) });
|
|
504
504
|
}
|
|
505
|
-
const
|
|
506
|
-
base: (e) => /* @__PURE__ */ t(
|
|
505
|
+
const ya = {
|
|
506
|
+
base: (e) => /* @__PURE__ */ t($t, { entry: e.entry }),
|
|
507
507
|
function: $e,
|
|
508
508
|
workflow: $e,
|
|
509
509
|
workflow_step: $e
|
|
510
510
|
};
|
|
511
|
-
function
|
|
512
|
-
const n =
|
|
511
|
+
function ga(e) {
|
|
512
|
+
const n = ya[Tt(e.entry.kind)];
|
|
513
513
|
return /* @__PURE__ */ t(n, { ...e });
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
var v, y, p,
|
|
517
|
-
const
|
|
518
|
-
() =>
|
|
515
|
+
function Ys({ getHref: e, onOpen: n, slots: a }) {
|
|
516
|
+
var v, y, p, T, $, b;
|
|
517
|
+
const s = je("today", { from: wa(), bucket: "day" }), i = je("week", { bucket: "week" }), o = ze(), r = nt(), c = le(
|
|
518
|
+
() => ma(o.data, r.data),
|
|
519
519
|
[o.data, r.data]
|
|
520
|
-
),
|
|
520
|
+
), m = s.error ?? i.error, u = m ? m.message : null, g = ((v = i.data) == null ? void 0 : v.recent) ?? [], h = ((y = i.data) == null ? void 0 : y.series) ?? [], C = ((p = i.data) == null ? void 0 : p.range.bucket) ?? "week", w = !i.isLoading && g.length === 0 && (((T = i.data) == null ? void 0 : T.headline.workflowRuns) ?? 0) === 0;
|
|
521
521
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root", children: [
|
|
522
|
-
|
|
522
|
+
u && /* @__PURE__ */ t("div", { className: "error", children: u }),
|
|
523
523
|
a == null ? void 0 : a.header,
|
|
524
524
|
a == null ? void 0 : a.actions,
|
|
525
525
|
/* @__PURE__ */ t(
|
|
526
|
-
|
|
526
|
+
qe,
|
|
527
527
|
{
|
|
528
528
|
title: "Today",
|
|
529
|
-
headline: (
|
|
530
|
-
loading:
|
|
529
|
+
headline: ($ = s.data) == null ? void 0 : $.headline,
|
|
530
|
+
loading: s.isLoading
|
|
531
531
|
}
|
|
532
532
|
),
|
|
533
533
|
/* @__PURE__ */ t(
|
|
534
|
-
|
|
534
|
+
qe,
|
|
535
535
|
{
|
|
536
536
|
title: "Last 7 days",
|
|
537
|
-
headline: (b =
|
|
538
|
-
loading:
|
|
537
|
+
headline: (b = i.data) == null ? void 0 : b.headline,
|
|
538
|
+
loading: i.isLoading
|
|
539
539
|
}
|
|
540
540
|
),
|
|
541
541
|
a == null ? void 0 : a.betweenHeadlineAndSeries,
|
|
542
542
|
/* @__PURE__ */ l("section", { className: "w6w-activity-section", children: [
|
|
543
543
|
/* @__PURE__ */ t("h3", { children: "Activity over time" }),
|
|
544
|
-
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children:
|
|
544
|
+
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children: i.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : h.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No activity in this window yet." }) : /* @__PURE__ */ t("ul", { className: "list", children: h.map((I) => /* @__PURE__ */ l("li", { children: [
|
|
545
545
|
/* @__PURE__ */ l("span", { className: "list-main", children: [
|
|
546
|
-
/* @__PURE__ */ t("strong", { children:
|
|
546
|
+
/* @__PURE__ */ t("strong", { children: pa(I.bucket, C) }),
|
|
547
547
|
" ",
|
|
548
|
-
/* @__PURE__ */ t("span", { className: "muted small", children:
|
|
548
|
+
/* @__PURE__ */ t("span", { className: "muted small", children: be(I.kind) })
|
|
549
549
|
] }),
|
|
550
550
|
" ",
|
|
551
|
-
/* @__PURE__ */ t(
|
|
551
|
+
/* @__PURE__ */ t(Dt, { ok: I.ok }),
|
|
552
552
|
" ",
|
|
553
|
-
/* @__PURE__ */ t("span", { className: "muted small", children:
|
|
554
|
-
] }, `${
|
|
553
|
+
/* @__PURE__ */ t("span", { className: "muted small", children: I.count })
|
|
554
|
+
] }, `${I.bucket}-${I.kind}-${String(I.ok)}`)) }) })
|
|
555
555
|
] }),
|
|
556
556
|
/* @__PURE__ */ l("section", { children: [
|
|
557
557
|
/* @__PURE__ */ t("h3", { className: "w6w-activity-h3", children: "Recent activity" }),
|
|
558
|
-
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children:
|
|
559
|
-
|
|
558
|
+
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children: i.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : w ? (a == null ? void 0 : a.empty) ?? /* @__PURE__ */ t("p", { className: "muted", children: "No runs yet — activity shows up here once your workflows run." }) : g.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No recent activity in this window." }) : /* @__PURE__ */ t("div", { className: "list", children: g.map((I) => /* @__PURE__ */ t(
|
|
559
|
+
ga,
|
|
560
560
|
{
|
|
561
|
-
entry:
|
|
561
|
+
entry: I,
|
|
562
562
|
names: c,
|
|
563
563
|
getHref: e,
|
|
564
564
|
onOpen: n
|
|
565
565
|
},
|
|
566
|
-
|
|
566
|
+
I.id
|
|
567
567
|
)) }) })
|
|
568
568
|
] })
|
|
569
569
|
] });
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function va(e) {
|
|
572
572
|
return e !== null && "project" in e;
|
|
573
573
|
}
|
|
574
|
-
function
|
|
575
|
-
const n = Me().project, [a,
|
|
576
|
-
var
|
|
577
|
-
o ||
|
|
574
|
+
function ba(e) {
|
|
575
|
+
const n = Me().project, [a, s] = f(Cn), i = e.scope !== void 0 ? e.scope : n ? { project: n } : null, o = e.filters !== void 0, r = e.filters ?? a, c = (m) => {
|
|
576
|
+
var u;
|
|
577
|
+
o || s(m), (u = e.onFiltersChange) == null || u.call(e, m);
|
|
578
578
|
};
|
|
579
579
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ t(
|
|
580
|
-
|
|
580
|
+
On,
|
|
581
581
|
{
|
|
582
|
-
scope:
|
|
583
|
-
showKind: e.showKind ??
|
|
582
|
+
scope: i,
|
|
583
|
+
showKind: e.showKind ?? va(i),
|
|
584
584
|
filters: r,
|
|
585
585
|
onFiltersChange: c,
|
|
586
586
|
onOpenInEditor: e.onOpenInEditor
|
|
587
587
|
}
|
|
588
588
|
) });
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function Na({ title: e = "Logs", ...n }) {
|
|
591
591
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root w6w-embed-logs", children: [
|
|
592
592
|
e !== null && /* @__PURE__ */ t("h2", { children: e }),
|
|
593
|
-
/* @__PURE__ */ t(
|
|
593
|
+
/* @__PURE__ */ t(ba, { ...n })
|
|
594
594
|
] });
|
|
595
595
|
}
|
|
596
|
-
const
|
|
597
|
-
function
|
|
596
|
+
const zs = Na, ka = 1440 * 60 * 1e3;
|
|
597
|
+
function Ca(e) {
|
|
598
598
|
if (!(e === null || e.timeline === null))
|
|
599
599
|
return e.timeline.map((n) => ({
|
|
600
600
|
id: n.id,
|
|
@@ -607,35 +607,35 @@ function Na(e) {
|
|
|
607
607
|
link: n.link
|
|
608
608
|
}));
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function At(e) {
|
|
611
611
|
return e.startedAt !== void 0 && e.resolvedAt === void 0;
|
|
612
612
|
}
|
|
613
613
|
function _e(e) {
|
|
614
614
|
const n = new Date(e);
|
|
615
615
|
return Number.isNaN(n.getTime()) ? e : n.toLocaleDateString("en-US", { month: "short", day: "numeric", timeZone: "UTC" });
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function Ve(e, n) {
|
|
618
618
|
const a = new Date(e).getTime();
|
|
619
|
-
return Number.isNaN(a) ? 0 : Math.max(0, Math.floor((n - a) /
|
|
619
|
+
return Number.isNaN(a) ? 0 : Math.max(0, Math.floor((n - a) / ka));
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
if (!
|
|
623
|
-
const a =
|
|
624
|
-
return `${
|
|
621
|
+
function Ta(e, n) {
|
|
622
|
+
if (!At(e) || e.startedAt === void 0) return null;
|
|
623
|
+
const a = Ve(e.startedAt, n), s = _e(e.startedAt), i = a === 0 ? `open since ${s} (today)` : `open ${a}d (since ${s})`, o = e.updatedAt ?? e.startedAt, r = Ve(o, n), c = _e(o), m = r === 0 ? `last update ${c} (today)` : `last update ${c} (${r}d ago)`;
|
|
624
|
+
return `${i} · ${m}`;
|
|
625
625
|
}
|
|
626
|
-
function
|
|
626
|
+
function Ea(e) {
|
|
627
627
|
return e ? Object.entries(e) : [];
|
|
628
628
|
}
|
|
629
|
-
function
|
|
629
|
+
function Ia(e) {
|
|
630
630
|
return e.uptime.map((n) => ({ day: n.day, state: n.state }));
|
|
631
631
|
}
|
|
632
|
-
const
|
|
632
|
+
const re = [
|
|
633
633
|
["e4xx", "4xx"],
|
|
634
634
|
["e429", "429 rate-limited"],
|
|
635
635
|
["eAuth", "auth (401/403)"],
|
|
636
636
|
["e5xx", "5xx"]
|
|
637
637
|
];
|
|
638
|
-
function
|
|
638
|
+
function Lt(e) {
|
|
639
639
|
const n = new Date(e);
|
|
640
640
|
return Number.isNaN(n.getTime()) ? e : n.toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
641
641
|
}
|
|
@@ -649,14 +649,14 @@ function Oe(e) {
|
|
|
649
649
|
minute: "2-digit"
|
|
650
650
|
});
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function ge({ label: e, value: n, hint: a }) {
|
|
653
653
|
return /* @__PURE__ */ l("div", { className: "w6w-rel-card", style: { flex: "1 1 150px", minWidth: 150 }, children: [
|
|
654
654
|
/* @__PURE__ */ t("div", { style: { fontSize: "1.6rem", fontWeight: "var(--w6w-fw-semibold)", lineHeight: 1.15 }, children: n }),
|
|
655
655
|
/* @__PURE__ */ t("div", { className: "muted small", children: e }),
|
|
656
656
|
a && /* @__PURE__ */ t("div", { className: "muted small", children: a })
|
|
657
657
|
] });
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function Da({
|
|
660
660
|
vendor: e,
|
|
661
661
|
displayName: n
|
|
662
662
|
}) {
|
|
@@ -673,13 +673,13 @@ function Ea({
|
|
|
673
673
|
", not a gap in the data above."
|
|
674
674
|
] })
|
|
675
675
|
] });
|
|
676
|
-
const a = e.state === "unknown",
|
|
676
|
+
const a = e.state === "unknown", s = Ea(e.components), i = (e.timeline ?? []).filter(At), o = Date.now();
|
|
677
677
|
return /* @__PURE__ */ l("div", { className: "w6w-rel-card", children: [
|
|
678
678
|
/* @__PURE__ */ l("h4", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: [
|
|
679
679
|
n,
|
|
680
680
|
" status",
|
|
681
681
|
" ",
|
|
682
|
-
/* @__PURE__ */ t(
|
|
682
|
+
/* @__PURE__ */ t(ve, { state: e.state, label: a ? "Unavailable" : void 0 })
|
|
683
683
|
] }),
|
|
684
684
|
a && /* @__PURE__ */ t("p", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: "We could not get a status from this API, so we cannot say whether it is up. That is separate from your own calls above, which are measured here regardless." }),
|
|
685
685
|
e.message && /* @__PURE__ */ t(
|
|
@@ -700,23 +700,23 @@ function Ea({
|
|
|
700
700
|
" says about itself, not what your calls did · last checked",
|
|
701
701
|
" ",
|
|
702
702
|
Oe(e.checkedAt),
|
|
703
|
-
e.attributedTo.length > 0 && /* @__PURE__ */ l(
|
|
703
|
+
e.attributedTo.length > 0 && /* @__PURE__ */ l(q, { children: [
|
|
704
704
|
" ",
|
|
705
705
|
"· decided by",
|
|
706
706
|
" ",
|
|
707
707
|
e.attributedTo.map((r) => /* @__PURE__ */ t("code", { children: r }, r))
|
|
708
708
|
] })
|
|
709
709
|
] }),
|
|
710
|
-
|
|
710
|
+
s.length > 0 && /* @__PURE__ */ t("div", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: s.map(([r, c]) => /* @__PURE__ */ l("span", { className: "w6w-rel-tag", children: [
|
|
711
711
|
r,
|
|
712
712
|
": ",
|
|
713
713
|
c.state
|
|
714
714
|
] }, r)) }),
|
|
715
|
-
|
|
715
|
+
i.length > 0 && /* @__PURE__ */ t("ul", { className: "list", style: { margin: "var(--w6w-sp-2) 0 0" }, children: i.map((r) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l("div", { className: "list-main", children: [
|
|
716
716
|
/* @__PURE__ */ t("strong", { children: r.title }),
|
|
717
717
|
" ",
|
|
718
|
-
/* @__PURE__ */ t(
|
|
719
|
-
/* @__PURE__ */ t("div", { className: "muted small", children:
|
|
718
|
+
/* @__PURE__ */ t(ve, { state: r.state }),
|
|
719
|
+
/* @__PURE__ */ t("div", { className: "muted small", children: Ta(r, o) })
|
|
720
720
|
] }) }, r.id ?? r.title)) }),
|
|
721
721
|
e.statusPageUrl !== null && /* @__PURE__ */ t("p", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: /* @__PURE__ */ l("a", { href: e.statusPageUrl, target: "_blank", rel: "noopener noreferrer", children: [
|
|
722
722
|
n,
|
|
@@ -724,10 +724,10 @@ function Ea({
|
|
|
724
724
|
] }) })
|
|
725
725
|
] });
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function $a({ service: e }) {
|
|
728
728
|
if (e.calls === 0)
|
|
729
729
|
return /* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t("span", { className: "w6w-rel-idle-note", children: "No calls in this window" }) });
|
|
730
|
-
const n = e.uptime, a = Math.max(1, ...n.map((
|
|
730
|
+
const n = e.uptime, a = Math.max(1, ...n.map((s) => s.calls));
|
|
731
731
|
return /* @__PURE__ */ l("div", { className: "w6w-rel-card", children: [
|
|
732
732
|
/* @__PURE__ */ t(
|
|
733
733
|
"div",
|
|
@@ -735,32 +735,32 @@ function Ia({ service: e }) {
|
|
|
735
735
|
className: "rel-daily-chart",
|
|
736
736
|
role: "img",
|
|
737
737
|
"aria-label": `${e.displayName}, calls per day, oldest first`,
|
|
738
|
-
children: n.map((
|
|
738
|
+
children: n.map((s) => /* @__PURE__ */ t(
|
|
739
739
|
"span",
|
|
740
740
|
{
|
|
741
|
-
className: `rel-daily-bar rel-daily-bar-${
|
|
742
|
-
style: { height: `${
|
|
743
|
-
title: `${
|
|
741
|
+
className: `rel-daily-bar rel-daily-bar-${s.state}`,
|
|
742
|
+
style: { height: `${s.calls > 0 ? Math.max(s.calls / a * 100, 4) : 2}%` },
|
|
743
|
+
title: `${Lt(`${s.day}T00:00:00.000Z`)} — ${s.calls} calls, ${s.state}`
|
|
744
744
|
},
|
|
745
|
-
|
|
745
|
+
s.day
|
|
746
746
|
))
|
|
747
747
|
}
|
|
748
748
|
),
|
|
749
749
|
/* @__PURE__ */ t("p", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: "Calls per day, oldest first. Bar colour is that day's own state." })
|
|
750
750
|
] });
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function Aa({
|
|
753
753
|
service: e,
|
|
754
754
|
window: n
|
|
755
755
|
}) {
|
|
756
|
-
const a = [...e.uptime].reverse().filter((r) => r.calls > 0),
|
|
756
|
+
const a = [...e.uptime].reverse().filter((r) => r.calls > 0), s = e.vendorStatus, i = Ca(s), o = i === void 0 ? `${e.displayName} publishes no incident history.` : `No incidents from ${e.displayName} in this window.`;
|
|
757
757
|
return /* @__PURE__ */ l("div", { className: "w6w-rel-card", children: [
|
|
758
758
|
/* @__PURE__ */ t(
|
|
759
|
-
|
|
759
|
+
Wt,
|
|
760
760
|
{
|
|
761
761
|
window: n,
|
|
762
|
-
days:
|
|
763
|
-
incidents:
|
|
762
|
+
days: Ia(e),
|
|
763
|
+
incidents: i,
|
|
764
764
|
vendorEmptyLabel: o,
|
|
765
765
|
ariaLabel: `${e.displayName}, ${e.uptime.length}-day status and ${e.displayName} incidents, oldest day first`
|
|
766
766
|
}
|
|
@@ -771,45 +771,45 @@ function Da({
|
|
|
771
771
|
" — never a quiet green."
|
|
772
772
|
] }),
|
|
773
773
|
a.length > 0 && /* @__PURE__ */ t("div", { className: "list", style: { marginTop: "var(--w6w-sp-3)" }, children: a.slice(0, 14).map((r) => /* @__PURE__ */ l("div", { className: "rel-day-row", children: [
|
|
774
|
-
/* @__PURE__ */ t("span", { style: { minWidth: 96 }, children: /* @__PURE__ */ t("strong", { children:
|
|
775
|
-
/* @__PURE__ */ t(
|
|
774
|
+
/* @__PURE__ */ t("span", { style: { minWidth: 96 }, children: /* @__PURE__ */ t("strong", { children: Lt(`${r.day}T00:00:00.000Z`) }) }),
|
|
775
|
+
/* @__PURE__ */ t(ve, { state: r.state }),
|
|
776
776
|
/* @__PURE__ */ l("span", { className: "muted small", children: [
|
|
777
777
|
r.calls,
|
|
778
778
|
" calls"
|
|
779
779
|
] }),
|
|
780
|
-
/* @__PURE__ */ t("span", { className: "rel-errors", children:
|
|
781
|
-
|
|
780
|
+
/* @__PURE__ */ t("span", { className: "rel-errors", children: re.filter(([c]) => r.errors[c] > 0).map(([c, m]) => /* @__PURE__ */ l("span", { className: "w6w-rel-tag", children: [
|
|
781
|
+
m,
|
|
782
782
|
" ×",
|
|
783
783
|
r.errors[c]
|
|
784
784
|
] }, c)) })
|
|
785
785
|
] }, r.day)) })
|
|
786
786
|
] });
|
|
787
787
|
}
|
|
788
|
-
function
|
|
789
|
-
if (
|
|
788
|
+
function La({ errors: e }) {
|
|
789
|
+
if (re.reduce((s, [i]) => s + e[i], 0) === 0)
|
|
790
790
|
return /* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t("p", { className: "muted", style: { margin: 0 }, children: "No errors in this window." }) });
|
|
791
|
-
const a = Math.max(1, ...
|
|
792
|
-
return /* @__PURE__ */ t("div", { className: "w6w-rel-card rel-errormix-chart", children:
|
|
793
|
-
/* @__PURE__ */ t("span", { className: "muted small", children:
|
|
791
|
+
const a = Math.max(1, ...re.map(([s]) => e[s]));
|
|
792
|
+
return /* @__PURE__ */ t("div", { className: "w6w-rel-card rel-errormix-chart", children: re.map(([s, i]) => /* @__PURE__ */ l("div", { className: "rel-errormix-row", children: [
|
|
793
|
+
/* @__PURE__ */ t("span", { className: "muted small", children: i }),
|
|
794
794
|
/* @__PURE__ */ t("span", { className: "rel-errormix-track", children: /* @__PURE__ */ t(
|
|
795
795
|
"span",
|
|
796
796
|
{
|
|
797
797
|
className: "rel-errormix-bar",
|
|
798
|
-
style: { width: `${Math.max(e[
|
|
798
|
+
style: { width: `${Math.max(e[s] / a * 100, e[s] > 0 ? 2 : 0)}%` }
|
|
799
799
|
}
|
|
800
800
|
) }),
|
|
801
|
-
/* @__PURE__ */ t("span", { className: "rel-errormix-value small", children: e[
|
|
802
|
-
] },
|
|
801
|
+
/* @__PURE__ */ t("span", { className: "rel-errormix-value small", children: e[s] })
|
|
802
|
+
] }, s)) });
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
const a =
|
|
804
|
+
function Sa({ project: e, appId: n }) {
|
|
805
|
+
const a = $n(e, n, { limit: 50 });
|
|
806
806
|
if (a.isLoading) return /* @__PURE__ */ t("p", { className: "muted", children: "Loading calls…" });
|
|
807
807
|
if (a.error) {
|
|
808
|
-
const
|
|
809
|
-
return /* @__PURE__ */ t("div", { className: "error", children: (
|
|
808
|
+
const i = a.error;
|
|
809
|
+
return /* @__PURE__ */ t("div", { className: "error", children: (i instanceof st, i.message) });
|
|
810
810
|
}
|
|
811
|
-
const
|
|
812
|
-
return
|
|
811
|
+
const s = a.data ?? [];
|
|
812
|
+
return s.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No calls captured for this service. Calls appear here once a workflow, function or ad-hoc invoke reaches it." }) : /* @__PURE__ */ l("div", { className: "rel-calls", children: [
|
|
813
813
|
/* @__PURE__ */ l("div", { className: "rel-call rel-call-head", children: [
|
|
814
814
|
/* @__PURE__ */ t("span", { children: "When" }),
|
|
815
815
|
/* @__PURE__ */ t("span", { children: "Action" }),
|
|
@@ -817,47 +817,47 @@ function La({ project: e, appId: n }) {
|
|
|
817
817
|
/* @__PURE__ */ t("span", { children: "Status" }),
|
|
818
818
|
/* @__PURE__ */ t("span", { children: "Took" })
|
|
819
819
|
] }),
|
|
820
|
-
|
|
821
|
-
/* @__PURE__ */ t("span", { className: "muted small", children: Oe(
|
|
822
|
-
/* @__PURE__ */ t("span", { children: /* @__PURE__ */ t("code", { children:
|
|
823
|
-
/* @__PURE__ */ t("span", { className: "muted small", children:
|
|
824
|
-
/* @__PURE__ */ t("span", { className:
|
|
825
|
-
/* @__PURE__ */ t("span", { className: "muted small", children:
|
|
826
|
-
] },
|
|
820
|
+
s.map((i, o) => /* @__PURE__ */ l("div", { className: "rel-call", children: [
|
|
821
|
+
/* @__PURE__ */ t("span", { className: "muted small", children: Oe(i.createdAt) }),
|
|
822
|
+
/* @__PURE__ */ t("span", { children: /* @__PURE__ */ t("code", { children: i.actionKey ?? "—" }) }),
|
|
823
|
+
/* @__PURE__ */ t("span", { className: "muted small", children: i.method }),
|
|
824
|
+
/* @__PURE__ */ t("span", { className: i.status >= 400 || i.status === 0 ? "error" : "ok", children: i.status === 0 ? "no response" : i.status }),
|
|
825
|
+
/* @__PURE__ */ t("span", { className: "muted small", children: i.durationMs != null ? `${i.durationMs} ms` : "—" })
|
|
826
|
+
] }, i.id ?? `${i.createdAt}-${o}`))
|
|
827
827
|
] });
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function Ma({
|
|
830
830
|
backHref: e,
|
|
831
831
|
onBack: n
|
|
832
832
|
}) {
|
|
833
833
|
return e !== void 0 ? /* @__PURE__ */ t("p", { children: /* @__PURE__ */ t("a", { href: e, onClick: n, children: "← Back to all services" }) }) : n ? /* @__PURE__ */ t("p", { children: /* @__PURE__ */ t("button", { type: "button", className: "list-link", onClick: n, children: "← Back to all services" }) }) : null;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function Js({
|
|
836
836
|
appId: e,
|
|
837
837
|
project: n,
|
|
838
838
|
days: a = 30,
|
|
839
|
-
backHref:
|
|
840
|
-
onBack:
|
|
839
|
+
backHref: s,
|
|
840
|
+
onBack: i,
|
|
841
841
|
slots: o
|
|
842
842
|
}) {
|
|
843
|
-
var
|
|
844
|
-
const r = Me().project, c = (n === void 0 ? r : n) || void 0,
|
|
843
|
+
var C, w, v, y;
|
|
844
|
+
const r = Me().project, c = (n === void 0 ? r : n) || void 0, m = Dn(c, [e], a), u = m.error, g = u ? (u instanceof st, u.message) : null, h = (C = m.data) == null ? void 0 : C.services.find((p) => p.appId === e);
|
|
845
845
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root", children: [
|
|
846
846
|
o == null ? void 0 : o.header,
|
|
847
847
|
o == null ? void 0 : o.actions,
|
|
848
848
|
!c && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see this service." }),
|
|
849
849
|
g && /* @__PURE__ */ t("div", { className: "error", children: g }),
|
|
850
|
-
c &&
|
|
851
|
-
|
|
850
|
+
c && m.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
|
|
851
|
+
m.data && !h && /* @__PURE__ */ l("div", { className: "w6w-rel-card", children: [
|
|
852
852
|
(o == null ? void 0 : o.empty) ?? /* @__PURE__ */ l("p", { className: "muted", children: [
|
|
853
853
|
/* @__PURE__ */ t("code", { children: e }),
|
|
854
854
|
" is not used by this project's definitions and has no calls in the last ",
|
|
855
855
|
a,
|
|
856
856
|
" days."
|
|
857
857
|
] }),
|
|
858
|
-
/* @__PURE__ */ t(
|
|
858
|
+
/* @__PURE__ */ t(Ma, { backHref: s, onBack: i })
|
|
859
859
|
] }),
|
|
860
|
-
|
|
860
|
+
h && /* @__PURE__ */ l(q, { children: [
|
|
861
861
|
/* @__PURE__ */ l("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
|
|
862
862
|
/* @__PURE__ */ l(
|
|
863
863
|
"div",
|
|
@@ -869,55 +869,55 @@ function Us({
|
|
|
869
869
|
marginBottom: "var(--w6w-sp-3)"
|
|
870
870
|
},
|
|
871
871
|
children: [
|
|
872
|
-
/* @__PURE__ */ t(
|
|
872
|
+
/* @__PURE__ */ t(ve, { state: h.state }),
|
|
873
873
|
/* @__PURE__ */ t("span", { className: "muted small", children: "from your calls" }),
|
|
874
|
-
/* @__PURE__ */ t("code", { className: "muted small", children:
|
|
875
|
-
|
|
874
|
+
/* @__PURE__ */ t("code", { className: "muted small", children: h.appId }),
|
|
875
|
+
h.ongoingOutageId && /* @__PURE__ */ t("span", { className: "w6w-rel-tag", children: "outage still open" })
|
|
876
876
|
]
|
|
877
877
|
}
|
|
878
878
|
),
|
|
879
879
|
/* @__PURE__ */ l("div", { style: { display: "flex", gap: "var(--w6w-sp-3)", flexWrap: "wrap" }, children: [
|
|
880
|
-
/* @__PURE__ */ t(
|
|
880
|
+
/* @__PURE__ */ t(ge, { label: "Calls in window", value: String(h.calls) }),
|
|
881
881
|
/* @__PURE__ */ t(
|
|
882
|
-
|
|
882
|
+
ge,
|
|
883
883
|
{
|
|
884
884
|
label: "p95 latency",
|
|
885
|
-
value:
|
|
886
|
-
hint:
|
|
885
|
+
value: h.p95Ms === null ? "—" : `${h.p95Ms} ms`,
|
|
886
|
+
hint: h.p95Ms === null ? "no timed calls" : void 0
|
|
887
887
|
}
|
|
888
888
|
),
|
|
889
|
-
/* @__PURE__ */ t(
|
|
889
|
+
/* @__PURE__ */ t(ge, { label: "Last call", value: Oe(h.lastCallAt) }),
|
|
890
890
|
/* @__PURE__ */ t(
|
|
891
|
-
|
|
891
|
+
ge,
|
|
892
892
|
{
|
|
893
893
|
label: "Errors",
|
|
894
|
-
value: String(
|
|
895
|
-
hint:
|
|
894
|
+
value: String(re.reduce((p, [T]) => p + h.errors[T], 0)),
|
|
895
|
+
hint: re.filter(([p]) => h.errors[p] > 0).map(([p, T]) => `${T} ×${h.errors[p]}`).join(" · ") || "none"
|
|
896
896
|
}
|
|
897
897
|
)
|
|
898
898
|
] })
|
|
899
899
|
] }),
|
|
900
900
|
/* @__PURE__ */ l("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
|
|
901
901
|
/* @__PURE__ */ t("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: "Error mix" }),
|
|
902
|
-
/* @__PURE__ */ t(
|
|
902
|
+
/* @__PURE__ */ t(La, { errors: h.errors })
|
|
903
903
|
] }),
|
|
904
904
|
/* @__PURE__ */ l("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
|
|
905
905
|
/* @__PURE__ */ t("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: "API status" }),
|
|
906
|
-
/* @__PURE__ */ t(
|
|
906
|
+
/* @__PURE__ */ t(Da, { vendor: h.vendorStatus, displayName: h.displayName })
|
|
907
907
|
] }),
|
|
908
908
|
/* @__PURE__ */ l("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
|
|
909
909
|
/* @__PURE__ */ l("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: [
|
|
910
910
|
"Last ",
|
|
911
|
-
((w =
|
|
911
|
+
((w = m.data) == null ? void 0 : w.window.days) ?? a,
|
|
912
912
|
" days",
|
|
913
913
|
" ",
|
|
914
914
|
/* @__PURE__ */ l("span", { className: "muted small", children: [
|
|
915
915
|
"uptime means ",
|
|
916
|
-
(v =
|
|
916
|
+
(v = m.data) == null ? void 0 : v.uptimeMeans
|
|
917
917
|
] })
|
|
918
918
|
] }),
|
|
919
|
-
/* @__PURE__ */ t(
|
|
920
|
-
/* @__PURE__ */ t(
|
|
919
|
+
/* @__PURE__ */ t(Aa, { service: h, window: ((y = m.data) == null ? void 0 : y.window) ?? { from: "", to: "" } }),
|
|
920
|
+
/* @__PURE__ */ t($a, { service: h })
|
|
921
921
|
] }),
|
|
922
922
|
/* @__PURE__ */ l("section", { children: [
|
|
923
923
|
/* @__PURE__ */ l("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: [
|
|
@@ -925,12 +925,12 @@ function Us({
|
|
|
925
925
|
" ",
|
|
926
926
|
/* @__PURE__ */ t("span", { className: "muted small", children: "the requests behind the numbers above" })
|
|
927
927
|
] }),
|
|
928
|
-
/* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t(
|
|
928
|
+
/* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t(Sa, { project: c, appId: h.appId }) })
|
|
929
929
|
] })
|
|
930
930
|
] })
|
|
931
931
|
] });
|
|
932
932
|
}
|
|
933
|
-
function
|
|
933
|
+
function xa(e) {
|
|
934
934
|
if (typeof e == "string") return e;
|
|
935
935
|
if (e && typeof e == "object") {
|
|
936
936
|
const n = e;
|
|
@@ -939,18 +939,18 @@ function Sa(e) {
|
|
|
939
939
|
}
|
|
940
940
|
return String(e);
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function Ra({
|
|
943
943
|
routes: e,
|
|
944
944
|
projectId: n
|
|
945
945
|
}) {
|
|
946
|
-
const [a,
|
|
947
|
-
return e.length === 0 ? null : /* @__PURE__ */ l(
|
|
946
|
+
const [a, s] = f(null), i = e.find((o) => o.id === a);
|
|
947
|
+
return e.length === 0 ? null : /* @__PURE__ */ l(q, { children: [
|
|
948
948
|
/* @__PURE__ */ t("ul", { className: "list small", "data-testid": "connection-dependent-routes", children: e.map((o) => /* @__PURE__ */ l("li", { "data-testid": `connection-dependent-route-${o.id}`, children: [
|
|
949
949
|
/* @__PURE__ */ t("span", { className: "badge", children: "route" }),
|
|
950
950
|
" ",
|
|
951
951
|
/* @__PURE__ */ t("span", { children: o.name }),
|
|
952
952
|
" ",
|
|
953
|
-
o.status === "broken" && /* @__PURE__ */ l(
|
|
953
|
+
o.status === "broken" && /* @__PURE__ */ l(q, { children: [
|
|
954
954
|
/* @__PURE__ */ t("span", { className: "tag warn", children: "broken" }),
|
|
955
955
|
" ",
|
|
956
956
|
/* @__PURE__ */ t(
|
|
@@ -959,45 +959,45 @@ function Ma({
|
|
|
959
959
|
type: "button",
|
|
960
960
|
className: "btn link",
|
|
961
961
|
"data-testid": `connection-route-reconnect-${o.id}`,
|
|
962
|
-
onClick: () =>
|
|
962
|
+
onClick: () => s(o.id),
|
|
963
963
|
children: "Reconnect"
|
|
964
964
|
}
|
|
965
965
|
)
|
|
966
966
|
] })
|
|
967
967
|
] }, o.id)) }),
|
|
968
|
-
|
|
969
|
-
|
|
968
|
+
i != null && /* @__PURE__ */ t(
|
|
969
|
+
Pa,
|
|
970
970
|
{
|
|
971
|
-
routeId:
|
|
972
|
-
projectId:
|
|
973
|
-
onDone: () =>
|
|
971
|
+
routeId: i.id,
|
|
972
|
+
projectId: i.project ?? n,
|
|
973
|
+
onDone: () => s(null)
|
|
974
974
|
}
|
|
975
975
|
)
|
|
976
976
|
] });
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function Pa(e) {
|
|
979
979
|
return /* @__PURE__ */ l("div", { "data-testid": "connection-route-reconnect-host", children: [
|
|
980
|
-
/* @__PURE__ */ t(
|
|
980
|
+
/* @__PURE__ */ t(jn, { projectId: e.projectId, initialEditRouteId: e.routeId }),
|
|
981
981
|
/* @__PURE__ */ t("button", { type: "button", className: "btn link", onClick: e.onDone, children: "Done" })
|
|
982
982
|
] });
|
|
983
983
|
}
|
|
984
|
-
function
|
|
984
|
+
function St({
|
|
985
985
|
callables: e,
|
|
986
986
|
onOpenCallable: n,
|
|
987
987
|
routes: a,
|
|
988
|
-
projectId:
|
|
988
|
+
projectId: s
|
|
989
989
|
}) {
|
|
990
|
-
return /* @__PURE__ */ l(
|
|
991
|
-
/* @__PURE__ */ t(
|
|
992
|
-
/* @__PURE__ */ t(
|
|
990
|
+
return /* @__PURE__ */ l(q, { children: [
|
|
991
|
+
/* @__PURE__ */ t(Ra, { routes: a ?? [], projectId: s }),
|
|
992
|
+
/* @__PURE__ */ t(Oa, { callables: e, onOpenCallable: n })
|
|
993
993
|
] });
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Oa({
|
|
996
996
|
callables: e,
|
|
997
997
|
onOpenCallable: n
|
|
998
998
|
}) {
|
|
999
999
|
return /* @__PURE__ */ t("ul", { className: "list small", children: e.map((a) => {
|
|
1000
|
-
const
|
|
1000
|
+
const s = a.displayName || a.key || a.id, i = a.sites.map(xa);
|
|
1001
1001
|
return /* @__PURE__ */ l("li", { children: [
|
|
1002
1002
|
/* @__PURE__ */ t("span", { className: "badge", children: a.kind }),
|
|
1003
1003
|
" ",
|
|
@@ -1007,110 +1007,110 @@ function Ra({
|
|
|
1007
1007
|
type: "button",
|
|
1008
1008
|
className: "btn link",
|
|
1009
1009
|
onClick: () => n(a.kind, a.id),
|
|
1010
|
-
children:
|
|
1010
|
+
children: s
|
|
1011
1011
|
}
|
|
1012
|
-
) : /* @__PURE__ */ t("span", { children:
|
|
1012
|
+
) : /* @__PURE__ */ t("span", { children: s }),
|
|
1013
1013
|
!a.enabled && /* @__PURE__ */ t("span", { className: "muted", children: " (disabled)" }),
|
|
1014
|
-
|
|
1014
|
+
i.length > 0 && /* @__PURE__ */ l("span", { className: "muted", children: [
|
|
1015
1015
|
" · ",
|
|
1016
|
-
|
|
1016
|
+
i.join(", ")
|
|
1017
1017
|
] })
|
|
1018
1018
|
] }, `${a.kind}:${a.id}`);
|
|
1019
1019
|
}) });
|
|
1020
1020
|
}
|
|
1021
|
-
const
|
|
1022
|
-
function
|
|
1021
|
+
const Ka = [];
|
|
1022
|
+
function Gs({
|
|
1023
1023
|
onOpen: e,
|
|
1024
1024
|
getHref: n,
|
|
1025
1025
|
addLabel: a,
|
|
1026
|
-
slots:
|
|
1027
|
-
onOpenCallable:
|
|
1026
|
+
slots: s,
|
|
1027
|
+
onOpenCallable: i,
|
|
1028
1028
|
onCreateSharedCredential: o
|
|
1029
1029
|
}) {
|
|
1030
1030
|
var R, x;
|
|
1031
|
-
const r =
|
|
1031
|
+
const r = Ge(), c = pe(), m = rt(), g = m.data ?? Ka, h = le(() => Ze(g), [g]), { byId: C } = at(h), w = ot(), [v, y] = f(!1), [p, T] = f(null), [$, b] = f(null), I = X(void 0), N = ct(($ == null ? void 0 : $.id) ?? "", $ !== null), j = typeof r.updateConnection == "function", M = s && "actions" in s ? s.actions : /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", onClick: () => y(!0), children: a ?? "+ Add connection" });
|
|
1032
1032
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root", children: [
|
|
1033
1033
|
/* @__PURE__ */ t(
|
|
1034
|
-
|
|
1034
|
+
Bt,
|
|
1035
1035
|
{
|
|
1036
1036
|
connections: g,
|
|
1037
|
-
appsById:
|
|
1038
|
-
loading:
|
|
1039
|
-
error:
|
|
1037
|
+
appsById: C,
|
|
1038
|
+
loading: m.isLoading,
|
|
1039
|
+
error: m.error ? m.error.message : null,
|
|
1040
1040
|
onOpen: e,
|
|
1041
1041
|
getHref: n,
|
|
1042
|
-
onEdit: j ?
|
|
1042
|
+
onEdit: j ? T : void 0,
|
|
1043
1043
|
onDelete: b,
|
|
1044
1044
|
busy: w.isPending,
|
|
1045
|
-
slots: { ...
|
|
1045
|
+
slots: { ...s, actions: M }
|
|
1046
1046
|
}
|
|
1047
1047
|
),
|
|
1048
1048
|
v && /* @__PURE__ */ t(
|
|
1049
|
-
|
|
1049
|
+
Ut,
|
|
1050
1050
|
{
|
|
1051
1051
|
onCreateSharedCredential: o,
|
|
1052
1052
|
onClose: () => y(!1),
|
|
1053
1053
|
onCreated: () => {
|
|
1054
|
-
y(!1), c.invalidateQueries({ queryKey:
|
|
1054
|
+
y(!1), c.invalidateQueries({ queryKey: we });
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
1057
|
),
|
|
1058
1058
|
p && /* @__PURE__ */ t(
|
|
1059
|
-
|
|
1059
|
+
Xe,
|
|
1060
1060
|
{
|
|
1061
1061
|
connection: p,
|
|
1062
|
-
onClose: () =>
|
|
1062
|
+
onClose: () => T(null),
|
|
1063
1063
|
onSaved: () => {
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1064
|
+
const P = p.id;
|
|
1065
|
+
T(null), c.invalidateQueries({ queryKey: we }), c.invalidateQueries({ queryKey: dt(P) });
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
1068
|
),
|
|
1069
|
-
|
|
1070
|
-
|
|
1069
|
+
$ && /* @__PURE__ */ t(
|
|
1070
|
+
Fa,
|
|
1071
1071
|
{
|
|
1072
|
-
name:
|
|
1073
|
-
loading:
|
|
1074
|
-
callables:
|
|
1075
|
-
routes:
|
|
1076
|
-
projectId:
|
|
1077
|
-
onOpenCallable:
|
|
1072
|
+
name: $.displayName || $.id,
|
|
1073
|
+
loading: N.isLoading,
|
|
1074
|
+
callables: N.isError ? [] : ((R = N.data) == null ? void 0 : R.callables) ?? [],
|
|
1075
|
+
routes: N.isError ? [] : ((x = N.data) == null ? void 0 : x.routes) ?? [],
|
|
1076
|
+
projectId: I,
|
|
1077
|
+
onOpenCallable: i,
|
|
1078
1078
|
onClose: () => b(null),
|
|
1079
1079
|
onConfirm: () => {
|
|
1080
|
-
const
|
|
1081
|
-
b(null), w.mutate({ id:
|
|
1080
|
+
const P = $.id;
|
|
1081
|
+
b(null), w.mutate({ id: P, force: !0 });
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
1084
1084
|
)
|
|
1085
1085
|
] });
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function Fa({
|
|
1088
1088
|
name: e,
|
|
1089
1089
|
loading: n,
|
|
1090
1090
|
callables: a,
|
|
1091
|
-
routes:
|
|
1092
|
-
projectId:
|
|
1091
|
+
routes: s,
|
|
1092
|
+
projectId: i,
|
|
1093
1093
|
onOpenCallable: o,
|
|
1094
1094
|
onClose: r,
|
|
1095
1095
|
onConfirm: c
|
|
1096
1096
|
}) {
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1099
|
-
|
|
1097
|
+
const m = a.length, u = s.length, g = m + u, h = `Delete the connection "${e}"? This cannot be undone.`, C = (y, p, T) => `${y} ${y === 1 ? p : T}`, w = [
|
|
1098
|
+
m > 0 ? C(m, "callable", "callables") : null,
|
|
1099
|
+
u > 0 ? C(u, "model route", "model routes") : null
|
|
1100
1100
|
].filter(Boolean).join(" and "), v = [
|
|
1101
|
-
|
|
1102
|
-
|
|
1101
|
+
m > 0 ? `Deleting disables ${m === 1 ? "this callable" : `these ${m} callables`} until you reconnect ${m === 1 ? "it" : "them"}.` : null,
|
|
1102
|
+
u > 0 ? `${u === 1 ? "The model route becomes" : `The ${u} model routes become`} broken until ${u === 1 ? "it is" : "they are"} pointed at another connection.` : null
|
|
1103
1103
|
].filter((y) => y != null);
|
|
1104
|
-
return /* @__PURE__ */ l(
|
|
1104
|
+
return /* @__PURE__ */ l(Ht, { title: "Delete connection", onClose: r, children: [
|
|
1105
1105
|
/* @__PURE__ */ l("div", { className: "w6w-modal-body", children: [
|
|
1106
|
-
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: g === 0 ?
|
|
1107
|
-
g > 0 && /* @__PURE__ */ l(
|
|
1106
|
+
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: g === 0 ? h : `Delete the connection "${e}"? Used by ${w}.` }),
|
|
1107
|
+
g > 0 && /* @__PURE__ */ l(q, { children: [
|
|
1108
1108
|
/* @__PURE__ */ t(
|
|
1109
|
-
|
|
1109
|
+
St,
|
|
1110
1110
|
{
|
|
1111
1111
|
callables: a,
|
|
1112
|
-
routes:
|
|
1113
|
-
projectId:
|
|
1112
|
+
routes: s,
|
|
1113
|
+
projectId: i,
|
|
1114
1114
|
onOpenCallable: o
|
|
1115
1115
|
}
|
|
1116
1116
|
),
|
|
@@ -1132,106 +1132,106 @@ function Oa({
|
|
|
1132
1132
|
] })
|
|
1133
1133
|
] });
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function Ae(e) {
|
|
1136
1136
|
const n = new Date(e).getTime();
|
|
1137
1137
|
if (Number.isNaN(n)) return "recently";
|
|
1138
1138
|
const a = Math.max(0, Math.round((Date.now() - n) / 1e3));
|
|
1139
1139
|
if (a < 45) return "just now";
|
|
1140
|
-
const
|
|
1141
|
-
if (
|
|
1142
|
-
const
|
|
1143
|
-
if (
|
|
1144
|
-
const o = Math.round(
|
|
1140
|
+
const s = Math.round(a / 60);
|
|
1141
|
+
if (s < 60) return `${s}m ago`;
|
|
1142
|
+
const i = Math.round(s / 60);
|
|
1143
|
+
if (i < 24) return `${i}h ago`;
|
|
1144
|
+
const o = Math.round(i / 24);
|
|
1145
1145
|
return o < 30 ? `${o}d ago` : new Date(e).toLocaleDateString();
|
|
1146
1146
|
}
|
|
1147
|
-
const
|
|
1147
|
+
const ja = {
|
|
1148
1148
|
ok: 6e3,
|
|
1149
1149
|
warn: 1e4,
|
|
1150
1150
|
error: 15e3
|
|
1151
|
-
},
|
|
1152
|
-
function
|
|
1151
|
+
}, Qa = { ok: "✓", warn: "!", error: "✕" };
|
|
1152
|
+
function Zs({
|
|
1153
1153
|
connectionId: e,
|
|
1154
1154
|
onOpenAction: n,
|
|
1155
1155
|
onBack: a,
|
|
1156
|
-
onOpenCallable:
|
|
1157
|
-
slots:
|
|
1156
|
+
onOpenCallable: s,
|
|
1157
|
+
slots: i
|
|
1158
1158
|
}) {
|
|
1159
1159
|
var W;
|
|
1160
|
-
const o =
|
|
1161
|
-
() =>
|
|
1160
|
+
const o = Ge(), r = pe(), c = Kn(e), m = (W = c.data) == null ? void 0 : W.appId, u = le(
|
|
1161
|
+
() => Ze(c.data ? [c.data] : []),
|
|
1162
1162
|
[c.data]
|
|
1163
|
-
), { byId: g } =
|
|
1164
|
-
const
|
|
1165
|
-
for (const
|
|
1166
|
-
const
|
|
1167
|
-
|
|
1163
|
+
), { byId: g } = at(u), h = c.data ? Yt(c.data, g) : void 0, C = Qn(m, !!m), w = An(e), v = le(() => {
|
|
1164
|
+
const k = /* @__PURE__ */ new Map();
|
|
1165
|
+
for (const S of w.data ?? []) {
|
|
1166
|
+
const K = k.get(S.actionKey) ?? [];
|
|
1167
|
+
K.push(S), k.set(S.actionKey, K);
|
|
1168
1168
|
}
|
|
1169
|
-
return
|
|
1170
|
-
}, [w.data]), y =
|
|
1171
|
-
|
|
1169
|
+
return k;
|
|
1170
|
+
}, [w.data]), y = ct(e).data, p = X(void 0), T = (y == null ? void 0 : y.callables) ?? [], $ = (y == null ? void 0 : y.routes) ?? [], b = Ln(e).data ?? [], [I, N] = f(!1), [j, M] = f(""), R = ut(e), [x, P] = f(null);
|
|
1171
|
+
xt(() => {
|
|
1172
1172
|
if (!x) return;
|
|
1173
|
-
const
|
|
1174
|
-
return () => clearTimeout(
|
|
1173
|
+
const k = setTimeout(() => P(null), ja[x.kind]);
|
|
1174
|
+
return () => clearTimeout(k);
|
|
1175
1175
|
}, [x]);
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1178
|
-
onSuccess: (
|
|
1179
|
-
var
|
|
1180
|
-
if (!
|
|
1181
|
-
|
|
1176
|
+
const V = () => {
|
|
1177
|
+
P(null), R.mutate(void 0, {
|
|
1178
|
+
onSuccess: (k) => {
|
|
1179
|
+
var S;
|
|
1180
|
+
if (!k.ok) {
|
|
1181
|
+
P({
|
|
1182
1182
|
kind: "error",
|
|
1183
|
-
text: `Connection test failed${(
|
|
1183
|
+
text: `Connection test failed${(S = k.error) != null && S.message ? `: ${k.error.message}` : "."}`
|
|
1184
1184
|
});
|
|
1185
1185
|
return;
|
|
1186
1186
|
}
|
|
1187
|
-
|
|
1188
|
-
|
|
1187
|
+
P(
|
|
1188
|
+
k.untested ? { kind: "warn", text: `Connection stored. ${k.message ?? ""}`.trim() } : {
|
|
1189
1189
|
kind: "ok",
|
|
1190
|
-
text: `Connection is valid${
|
|
1190
|
+
text: `Connection is valid${k.actionKey ? ` — probed ${k.actionKey}` : ""}.`
|
|
1191
1191
|
}
|
|
1192
1192
|
);
|
|
1193
1193
|
},
|
|
1194
|
-
onError: (
|
|
1194
|
+
onError: (k) => P({ kind: "error", text: (k == null ? void 0 : k.message) ?? "Test failed." })
|
|
1195
1195
|
});
|
|
1196
|
-
},
|
|
1197
|
-
var
|
|
1198
|
-
const
|
|
1199
|
-
return
|
|
1200
|
-
}, [
|
|
1201
|
-
const
|
|
1202
|
-
return
|
|
1203
|
-
(
|
|
1204
|
-
) :
|
|
1205
|
-
}, [
|
|
1206
|
-
if (c.isLoading ||
|
|
1196
|
+
}, E = le(() => {
|
|
1197
|
+
var S;
|
|
1198
|
+
const k = [...((S = C.data) == null ? void 0 : S.actions) ?? []];
|
|
1199
|
+
return k.sort((K, J) => (K.title || K.key).localeCompare(J.title || J.key)), k;
|
|
1200
|
+
}, [C.data]), _ = le(() => {
|
|
1201
|
+
const k = j.trim().toLowerCase();
|
|
1202
|
+
return k ? E.filter(
|
|
1203
|
+
(S) => (S.title || "").toLowerCase().includes(k) || S.key.toLowerCase().includes(k) || (S.description || "").toLowerCase().includes(k)
|
|
1204
|
+
) : E;
|
|
1205
|
+
}, [E, j]);
|
|
1206
|
+
if (c.isLoading || C.isLoading)
|
|
1207
1207
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root w6w-embed-conn-detail", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) });
|
|
1208
1208
|
if (!c.data)
|
|
1209
1209
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root w6w-embed-conn-detail", "data-testid": "connection-not-found", children: [
|
|
1210
|
-
(
|
|
1210
|
+
(i == null ? void 0 : i.empty) ?? /* @__PURE__ */ t("h2", { children: "Connection not found" }),
|
|
1211
1211
|
a && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "Back to integrations" })
|
|
1212
1212
|
] });
|
|
1213
|
-
const
|
|
1213
|
+
const O = c.data, D = C.data, F = !O.builtIn && typeof o.updateConnection == "function";
|
|
1214
1214
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root w6w-embed-conn-detail w6w-card-stack", children: [
|
|
1215
|
-
(
|
|
1215
|
+
(i == null ? void 0 : i.header) ?? /* @__PURE__ */ l(zt, { conn: O, app: h, children: [
|
|
1216
1216
|
/* @__PURE__ */ t(
|
|
1217
1217
|
"button",
|
|
1218
1218
|
{
|
|
1219
1219
|
type: "button",
|
|
1220
1220
|
className: "w6w-btn w6w-btn-ghost",
|
|
1221
1221
|
disabled: R.isPending,
|
|
1222
|
-
onClick:
|
|
1222
|
+
onClick: V,
|
|
1223
1223
|
children: R.isPending ? "Testing…" : "Test connection"
|
|
1224
1224
|
}
|
|
1225
1225
|
),
|
|
1226
|
-
|
|
1227
|
-
|
|
1226
|
+
F && /* @__PURE__ */ t(
|
|
1227
|
+
Je,
|
|
1228
1228
|
{
|
|
1229
1229
|
label: "Edit",
|
|
1230
|
-
onClick: () =>
|
|
1230
|
+
onClick: () => N(!0),
|
|
1231
1231
|
"data-testid": "connection-detail-edit"
|
|
1232
1232
|
}
|
|
1233
1233
|
),
|
|
1234
|
-
|
|
1234
|
+
i == null ? void 0 : i.actions
|
|
1235
1235
|
] }),
|
|
1236
1236
|
x && /* @__PURE__ */ l(
|
|
1237
1237
|
"div",
|
|
@@ -1241,162 +1241,162 @@ function Ys({
|
|
|
1241
1241
|
"aria-live": x.kind === "error" ? "assertive" : "polite",
|
|
1242
1242
|
"data-testid": "connection-test-notice",
|
|
1243
1243
|
children: [
|
|
1244
|
-
/* @__PURE__ */ t("span", { "aria-hidden": "true", children:
|
|
1244
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: Qa[x.kind] }),
|
|
1245
1245
|
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-notice-text", children: x.text }),
|
|
1246
|
-
/* @__PURE__ */ t(
|
|
1246
|
+
/* @__PURE__ */ t(Jt, { icon: "close", label: "Dismiss", onClick: () => P(null) })
|
|
1247
1247
|
]
|
|
1248
1248
|
}
|
|
1249
1249
|
),
|
|
1250
1250
|
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1251
1251
|
/* @__PURE__ */ l("h3", { children: [
|
|
1252
1252
|
"App: ",
|
|
1253
|
-
(
|
|
1253
|
+
(h == null ? void 0 : h.displayName) ?? O.appId
|
|
1254
1254
|
] }),
|
|
1255
|
-
|
|
1255
|
+
D && /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small", children: [
|
|
1256
1256
|
"Version ",
|
|
1257
1257
|
/* @__PURE__ */ l("code", { children: [
|
|
1258
1258
|
"v",
|
|
1259
|
-
|
|
1259
|
+
D.version ?? "?"
|
|
1260
1260
|
] }),
|
|
1261
1261
|
" · source ",
|
|
1262
|
-
/* @__PURE__ */ t("code", { children:
|
|
1262
|
+
/* @__PURE__ */ t("code", { children: D.sourceRef })
|
|
1263
1263
|
] }),
|
|
1264
1264
|
a && /* @__PURE__ */ t("p", { className: "w6w-small", children: /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "← Integrations" }) })
|
|
1265
1265
|
] }),
|
|
1266
1266
|
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1267
1267
|
/* @__PURE__ */ t("h3", { children: "Actions" }),
|
|
1268
|
-
|
|
1269
|
-
|
|
1268
|
+
E.length === 0 && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No actions exposed." }),
|
|
1269
|
+
E.length > 10 && /* @__PURE__ */ t(
|
|
1270
1270
|
"input",
|
|
1271
1271
|
{
|
|
1272
1272
|
type: "search",
|
|
1273
1273
|
value: j,
|
|
1274
|
-
placeholder: `Search ${
|
|
1275
|
-
onChange: (
|
|
1274
|
+
placeholder: `Search ${E.length} actions…`,
|
|
1275
|
+
onChange: (k) => M(k.target.value),
|
|
1276
1276
|
"aria-label": "Filter actions",
|
|
1277
1277
|
className: "w6w-embed-conn-filter"
|
|
1278
1278
|
}
|
|
1279
1279
|
),
|
|
1280
|
-
|
|
1280
|
+
E.length > 0 && _.length === 0 && /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small", children: [
|
|
1281
1281
|
"No actions match “",
|
|
1282
1282
|
j,
|
|
1283
1283
|
"”."
|
|
1284
1284
|
] }),
|
|
1285
|
-
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Actions", children:
|
|
1286
|
-
const
|
|
1285
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Actions", children: _.map((k) => {
|
|
1286
|
+
const S = v.get(k.key) ?? [];
|
|
1287
1287
|
return /* @__PURE__ */ l("li", { children: [
|
|
1288
1288
|
/* @__PURE__ */ l(
|
|
1289
1289
|
"button",
|
|
1290
1290
|
{
|
|
1291
1291
|
type: "button",
|
|
1292
1292
|
className: "w6w-embed-conn-action",
|
|
1293
|
-
"data-testid": `connection-action-${
|
|
1294
|
-
onClick: () => n(
|
|
1293
|
+
"data-testid": `connection-action-${k.key}`,
|
|
1294
|
+
onClick: () => n(k.key),
|
|
1295
1295
|
children: [
|
|
1296
|
-
/* @__PURE__ */ t("strong", { children:
|
|
1296
|
+
/* @__PURE__ */ t("strong", { children: k.title }),
|
|
1297
1297
|
" ",
|
|
1298
|
-
/* @__PURE__ */ t("code", { className: "w6w-muted", children:
|
|
1298
|
+
/* @__PURE__ */ t("code", { className: "w6w-muted", children: k.key }),
|
|
1299
1299
|
" ",
|
|
1300
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children:
|
|
1301
|
-
|
|
1300
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: k.type }),
|
|
1301
|
+
k.description && /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: k.description })
|
|
1302
1302
|
]
|
|
1303
1303
|
}
|
|
1304
1304
|
),
|
|
1305
|
-
|
|
1305
|
+
S.length > 0 && /* @__PURE__ */ t(
|
|
1306
1306
|
"ul",
|
|
1307
1307
|
{
|
|
1308
1308
|
className: "w6w-embed-conn-list w6w-embed-conn-tests",
|
|
1309
|
-
"aria-label": `Saved tests for ${
|
|
1310
|
-
children:
|
|
1311
|
-
|
|
1309
|
+
"aria-label": `Saved tests for ${k.title || k.key}`,
|
|
1310
|
+
children: S.map((K) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
1311
|
+
Le,
|
|
1312
1312
|
{
|
|
1313
|
-
title:
|
|
1314
|
-
subtitle:
|
|
1313
|
+
title: K.name,
|
|
1314
|
+
subtitle: K.lastRunAt ? /* @__PURE__ */ l("span", { children: [
|
|
1315
1315
|
/* @__PURE__ */ t(
|
|
1316
1316
|
"span",
|
|
1317
1317
|
{
|
|
1318
|
-
className:
|
|
1319
|
-
children:
|
|
1318
|
+
className: K.lastRunOk ? "w6w-embed-conn-ok" : "w6w-embed-conn-fail",
|
|
1319
|
+
children: K.lastRunOk ? "✓" : "✗"
|
|
1320
1320
|
}
|
|
1321
1321
|
),
|
|
1322
1322
|
" ",
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
] }) : `saved ${
|
|
1326
|
-
onClick: () => n(
|
|
1323
|
+
K.lastRunSummary ? `${K.lastRunSummary} · ` : "",
|
|
1324
|
+
Ae(K.lastRunAt)
|
|
1325
|
+
] }) : `saved ${Ae(K.updatedAt)}`,
|
|
1326
|
+
onClick: () => n(k.key, K.id)
|
|
1327
1327
|
}
|
|
1328
|
-
) },
|
|
1328
|
+
) }, K.id))
|
|
1329
1329
|
}
|
|
1330
1330
|
)
|
|
1331
|
-
] },
|
|
1331
|
+
] }, k.key);
|
|
1332
1332
|
}) })
|
|
1333
1333
|
] }),
|
|
1334
1334
|
y && /* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", "data-testid": "connection-used-by", children: [
|
|
1335
1335
|
/* @__PURE__ */ t("h3", { children: "Used by" }),
|
|
1336
|
-
|
|
1337
|
-
|
|
1336
|
+
T.length === 0 && $.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Not used by any callable" }) : /* @__PURE__ */ t(
|
|
1337
|
+
St,
|
|
1338
1338
|
{
|
|
1339
|
-
callables:
|
|
1340
|
-
routes:
|
|
1339
|
+
callables: T,
|
|
1340
|
+
routes: $,
|
|
1341
1341
|
projectId: p,
|
|
1342
|
-
onOpenCallable:
|
|
1342
|
+
onOpenCallable: s
|
|
1343
1343
|
}
|
|
1344
1344
|
)
|
|
1345
1345
|
] }),
|
|
1346
1346
|
b.length > 0 && /* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1347
1347
|
/* @__PURE__ */ t("h3", { children: "Recent runs" }),
|
|
1348
1348
|
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Most recent tester runs against this connection." }),
|
|
1349
|
-
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Recent runs", children: b.map((
|
|
1350
|
-
|
|
1349
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Recent runs", children: b.map((k) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
1350
|
+
Le,
|
|
1351
1351
|
{
|
|
1352
|
-
title:
|
|
1352
|
+
title: k.actionKey,
|
|
1353
1353
|
subtitle: /* @__PURE__ */ l("span", { children: [
|
|
1354
|
-
/* @__PURE__ */ t("span", { className:
|
|
1354
|
+
/* @__PURE__ */ t("span", { className: k.ok ? "w6w-embed-conn-ok" : "w6w-embed-conn-fail", children: k.ok ? "✓" : "✗" }),
|
|
1355
1355
|
" ",
|
|
1356
|
-
|
|
1357
|
-
|
|
1356
|
+
k.summary ? `${k.summary} · ` : "",
|
|
1357
|
+
Ae(k.occurredAt)
|
|
1358
1358
|
] })
|
|
1359
1359
|
}
|
|
1360
|
-
) },
|
|
1360
|
+
) }, k.id)) })
|
|
1361
1361
|
] }),
|
|
1362
|
-
|
|
1363
|
-
|
|
1362
|
+
I && /* @__PURE__ */ t(
|
|
1363
|
+
Xe,
|
|
1364
1364
|
{
|
|
1365
|
-
connection:
|
|
1366
|
-
onClose: () =>
|
|
1365
|
+
connection: O,
|
|
1366
|
+
onClose: () => N(!1),
|
|
1367
1367
|
onSaved: () => {
|
|
1368
|
-
|
|
1368
|
+
N(!1), r.invalidateQueries({ queryKey: dt(e) }), r.invalidateQueries({ queryKey: we });
|
|
1369
1369
|
}
|
|
1370
1370
|
}
|
|
1371
1371
|
)
|
|
1372
1372
|
] });
|
|
1373
1373
|
}
|
|
1374
|
-
const
|
|
1375
|
-
function
|
|
1374
|
+
const qa = {};
|
|
1375
|
+
function We(e) {
|
|
1376
1376
|
return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1378
|
+
function he(e) {
|
|
1379
1379
|
return (e / 100).toFixed(2);
|
|
1380
1380
|
}
|
|
1381
|
-
function
|
|
1381
|
+
function _a(e) {
|
|
1382
1382
|
if (e == null) return null;
|
|
1383
1383
|
const n = e.rates, a = [];
|
|
1384
|
-
return n.input != null && a.push(`in ${
|
|
1384
|
+
return n.input != null && a.push(`in ${he(n.input)}`), n.output != null && a.push(`out ${he(n.output)}`), n.cachedInput != null && a.push(`cached ${he(n.cachedInput)}`), n.cacheWrite != null && a.push(`cache write ${he(n.cacheWrite)}`), n.perRequest != null && a.push(`${he(n.perRequest)}/request`), a.length === 0 ? null : `${n.currency ?? "USD"} ${a.join(" · ")}`;
|
|
1385
1385
|
}
|
|
1386
|
-
function
|
|
1386
|
+
function Va(e) {
|
|
1387
1387
|
const { maxInputTokens: n, maxOutputTokens: a } = e.limits ?? {};
|
|
1388
1388
|
return n == null && a == null ? "—" : /* @__PURE__ */ l("div", { className: "model-catalog-limits", children: [
|
|
1389
1389
|
n != null && /* @__PURE__ */ l("span", { children: [
|
|
1390
|
-
|
|
1390
|
+
We(n),
|
|
1391
1391
|
" input"
|
|
1392
1392
|
] }),
|
|
1393
1393
|
a != null && /* @__PURE__ */ l("span", { children: [
|
|
1394
|
-
|
|
1394
|
+
We(a),
|
|
1395
1395
|
" output"
|
|
1396
1396
|
] })
|
|
1397
1397
|
] });
|
|
1398
1398
|
}
|
|
1399
|
-
const
|
|
1399
|
+
const Wa = [
|
|
1400
1400
|
{
|
|
1401
1401
|
key: "model",
|
|
1402
1402
|
header: "Model",
|
|
@@ -1418,7 +1418,7 @@ const qa = [
|
|
|
1418
1418
|
header: "Price / 1M tokens",
|
|
1419
1419
|
width: "28%",
|
|
1420
1420
|
render: (e) => {
|
|
1421
|
-
const n =
|
|
1421
|
+
const n = _a(e.currentRate);
|
|
1422
1422
|
return n == null ? /* @__PURE__ */ t("span", { className: "muted small", children: "Not configured" }) : /* @__PURE__ */ t(
|
|
1423
1423
|
"span",
|
|
1424
1424
|
{
|
|
@@ -1433,72 +1433,72 @@ const qa = [
|
|
|
1433
1433
|
key: "limits",
|
|
1434
1434
|
header: "Token limits",
|
|
1435
1435
|
width: "24%",
|
|
1436
|
-
render: (e) => /* @__PURE__ */ t("div", { className: "muted small", children:
|
|
1436
|
+
render: (e) => /* @__PURE__ */ t("div", { className: "muted small", children: Va(e) })
|
|
1437
1437
|
}
|
|
1438
1438
|
];
|
|
1439
|
-
function
|
|
1439
|
+
function Xs(e) {
|
|
1440
1440
|
var o;
|
|
1441
|
-
const n =
|
|
1442
|
-
queryKey:
|
|
1441
|
+
const n = ce(), a = e.filter ?? qa, s = it({
|
|
1442
|
+
queryKey: _n(a),
|
|
1443
1443
|
initialPageParam: void 0,
|
|
1444
1444
|
getNextPageParam: (r) => r.nextCursor ?? void 0,
|
|
1445
|
-
queryFn: ({ pageParam: r }) =>
|
|
1446
|
-
}),
|
|
1445
|
+
queryFn: ({ pageParam: r }) => qn(n, r ? { ...a, cursor: r } : a)
|
|
1446
|
+
}), i = ((o = s.data) == null ? void 0 : o.pages.flatMap((r) => r.models)) ?? [];
|
|
1447
1447
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ l("section", { className: "section", children: [
|
|
1448
1448
|
/* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ l("div", { children: [
|
|
1449
1449
|
/* @__PURE__ */ t("h3", { children: "Available models" }),
|
|
1450
1450
|
/* @__PURE__ */ t("p", { className: "muted small", children: "Models available through your tenant's integrations. Choose one when creating a model route. Prices shown here are used to calculate usage costs." })
|
|
1451
1451
|
] }) }),
|
|
1452
1452
|
/* @__PURE__ */ l("div", { children: [
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1453
|
+
s.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
|
|
1454
|
+
s.error != null && /* @__PURE__ */ t("div", { className: "error", children: s.error.message }),
|
|
1455
|
+
s.isSuccess && i.length === 0 && /* @__PURE__ */ t(xe, { testId: "model-catalog-empty", children: "No models yet. Discover them from a provider connection to start routing to them." }),
|
|
1456
|
+
i.length > 0 && /* @__PURE__ */ t(
|
|
1457
1457
|
Re,
|
|
1458
1458
|
{
|
|
1459
|
-
columns:
|
|
1459
|
+
columns: Wa,
|
|
1460
1460
|
className: "model-catalog-table",
|
|
1461
|
-
rows:
|
|
1461
|
+
rows: i,
|
|
1462
1462
|
rowKey: (r) => r.id,
|
|
1463
1463
|
testId: "model-catalog-table",
|
|
1464
1464
|
rowTestId: (r) => `model-catalog-${r.id}`
|
|
1465
1465
|
}
|
|
1466
1466
|
)
|
|
1467
1467
|
] }),
|
|
1468
|
-
|
|
1468
|
+
s.hasNextPage && /* @__PURE__ */ t("div", { className: "row", children: /* @__PURE__ */ t(
|
|
1469
1469
|
"button",
|
|
1470
1470
|
{
|
|
1471
1471
|
type: "button",
|
|
1472
1472
|
className: "btn ghost",
|
|
1473
|
-
disabled:
|
|
1474
|
-
onClick: () => void
|
|
1473
|
+
disabled: s.isFetchingNextPage,
|
|
1474
|
+
onClick: () => void s.fetchNextPage(),
|
|
1475
1475
|
"data-testid": "model-catalog-load-more",
|
|
1476
|
-
children:
|
|
1476
|
+
children: s.isFetchingNextPage ? "Loading…" : "Load more"
|
|
1477
1477
|
}
|
|
1478
1478
|
) })
|
|
1479
1479
|
] }) });
|
|
1480
1480
|
}
|
|
1481
|
-
const
|
|
1482
|
-
function
|
|
1481
|
+
const Ba = {};
|
|
1482
|
+
function H(e) {
|
|
1483
1483
|
return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1485
|
+
function Ua(e) {
|
|
1486
1486
|
return `${e.currency} ${(e.amountMinor / 100).toFixed(2)}`;
|
|
1487
1487
|
}
|
|
1488
|
-
function
|
|
1489
|
-
return e.length > 0 ? e.map(
|
|
1488
|
+
function Ha(e, n) {
|
|
1489
|
+
return e.length > 0 ? e.map(Ua).join(" · ") : n > 0 ? "unpriced" : "—";
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1491
|
+
function Ya(e) {
|
|
1492
1492
|
return e.costMinor == null ? null : `${e.currency ?? "USD"} ${(e.costMinor / 100).toFixed(2)}`;
|
|
1493
1493
|
}
|
|
1494
|
-
function
|
|
1494
|
+
function za(e) {
|
|
1495
1495
|
return e.totalsTruncated === !0;
|
|
1496
1496
|
}
|
|
1497
|
-
const
|
|
1497
|
+
const Ja = [
|
|
1498
1498
|
{
|
|
1499
1499
|
key: "occurredAt",
|
|
1500
1500
|
header: "When",
|
|
1501
|
-
render: (e) => /* @__PURE__ */ t("span", { className: "muted small", title: e.occurredAt, children:
|
|
1501
|
+
render: (e) => /* @__PURE__ */ t("span", { className: "muted small", title: e.occurredAt, children: Et(e.occurredAt) })
|
|
1502
1502
|
},
|
|
1503
1503
|
{
|
|
1504
1504
|
key: "model",
|
|
@@ -1525,8 +1525,8 @@ const Ya = [
|
|
|
1525
1525
|
"span",
|
|
1526
1526
|
{
|
|
1527
1527
|
className: "muted small",
|
|
1528
|
-
title: `${
|
|
1529
|
-
children:
|
|
1528
|
+
title: `${H(e.inputTokens)} in · ${H(e.outputTokens)} out · ${H(e.cachedInputTokens)} cached input · ${H(e.cacheWriteTokens)} cache write`,
|
|
1529
|
+
children: H(e.totalTokens)
|
|
1530
1530
|
}
|
|
1531
1531
|
)
|
|
1532
1532
|
},
|
|
@@ -1535,7 +1535,7 @@ const Ya = [
|
|
|
1535
1535
|
header: "Cost",
|
|
1536
1536
|
align: "right",
|
|
1537
1537
|
render: (e) => {
|
|
1538
|
-
const n =
|
|
1538
|
+
const n = Ya(e);
|
|
1539
1539
|
return n == null ? /* @__PURE__ */ t("span", { className: "tag warn", "data-testid": "model-usage-unpriced", title: "no usable rate", children: "unpriced" }) : /* @__PURE__ */ t("span", { className: "muted small", children: n });
|
|
1540
1540
|
}
|
|
1541
1541
|
},
|
|
@@ -1543,10 +1543,10 @@ const Ya = [
|
|
|
1543
1543
|
key: "result",
|
|
1544
1544
|
header: "Result",
|
|
1545
1545
|
render: (e) => {
|
|
1546
|
-
const n =
|
|
1546
|
+
const n = It(e.durationMs);
|
|
1547
1547
|
return /* @__PURE__ */ l("span", { className: "muted small", title: e.errorCode ?? void 0, children: [
|
|
1548
1548
|
/* @__PURE__ */ t("span", { className: e.ok ? "tag" : "tag warn", children: e.ok ? "ok" : e.errorCode ?? "failed" }),
|
|
1549
|
-
n != null && /* @__PURE__ */ l(
|
|
1549
|
+
n != null && /* @__PURE__ */ l(q, { children: [
|
|
1550
1550
|
" · ",
|
|
1551
1551
|
n
|
|
1552
1552
|
] })
|
|
@@ -1554,52 +1554,52 @@ const Ya = [
|
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
1556
|
];
|
|
1557
|
-
function
|
|
1558
|
-
var
|
|
1559
|
-
const n = X(e.projectId), a =
|
|
1560
|
-
queryKey:
|
|
1557
|
+
function ei(e) {
|
|
1558
|
+
var u, g;
|
|
1559
|
+
const n = X(e.projectId), a = ce(), s = e.filter ?? Ba, i = it({
|
|
1560
|
+
queryKey: Wn(n ?? void 0, s),
|
|
1561
1561
|
enabled: n != null,
|
|
1562
1562
|
initialPageParam: void 0,
|
|
1563
|
-
getNextPageParam: (
|
|
1564
|
-
queryFn: ({ pageParam:
|
|
1563
|
+
getNextPageParam: (h) => h.nextCursor ?? void 0,
|
|
1564
|
+
queryFn: ({ pageParam: h }) => Vn(
|
|
1565
1565
|
a,
|
|
1566
1566
|
n,
|
|
1567
|
-
|
|
1567
|
+
h ? { ...s, cursor: h } : s
|
|
1568
1568
|
)
|
|
1569
|
-
}), o = ((
|
|
1569
|
+
}), o = ((u = i.data) == null ? void 0 : u.pages) ?? [], r = (g = o[0]) == null ? void 0 : g.totals, c = o.flatMap((h) => h.items), m = o.length > 0 && za(o[0]);
|
|
1570
1570
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ l("section", { className: "section", children: [
|
|
1571
1571
|
/* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ l("div", { children: [
|
|
1572
1572
|
/* @__PURE__ */ t("h3", { children: "Model usage" }),
|
|
1573
1573
|
/* @__PURE__ */ t("p", { className: "muted small", children: "Every model call this project paid for, priced with the rate card in force when it ran. A call with no usable rate counts as unpriced, not as free." })
|
|
1574
1574
|
] }) }),
|
|
1575
|
-
n == null ? /* @__PURE__ */ t("div", { className: "card", children: /* @__PURE__ */ t("p", { className: "muted", "data-testid": "model-usage-no-project", children: "Select a project to see its model usage." }) }) : /* @__PURE__ */ l(
|
|
1575
|
+
n == null ? /* @__PURE__ */ t("div", { className: "card", children: /* @__PURE__ */ t("p", { className: "muted", "data-testid": "model-usage-no-project", children: "Select a project to see its model usage." }) }) : /* @__PURE__ */ l(q, { children: [
|
|
1576
1576
|
/* @__PURE__ */ l("div", { className: "card", "data-testid": "model-usage-totals", children: [
|
|
1577
|
-
|
|
1577
|
+
m && /* @__PURE__ */ t("p", { className: "result warn", "data-testid": "model-usage-totals-partial", children: "Totals are partial: they cover a bounded scan of this window, not every matching call. Narrow the range for exact totals." }),
|
|
1578
1578
|
r == null ? (
|
|
1579
1579
|
// A failed query is reported once, below — never as a perpetual "loading".
|
|
1580
|
-
|
|
1580
|
+
i.error == null && /* @__PURE__ */ t("p", { className: "muted", children: "Loading totals…" })
|
|
1581
1581
|
) : /* @__PURE__ */ l("p", { className: "muted small", children: [
|
|
1582
1582
|
/* @__PURE__ */ l("span", { "data-testid": "model-usage-total-requests", children: [
|
|
1583
|
-
|
|
1583
|
+
H(r.requests),
|
|
1584
1584
|
" requests"
|
|
1585
1585
|
] }),
|
|
1586
1586
|
" · ",
|
|
1587
1587
|
/* @__PURE__ */ l("span", { "data-testid": "model-usage-total-tokens", children: [
|
|
1588
|
-
|
|
1588
|
+
H(r.totalTokens),
|
|
1589
1589
|
" tokens (",
|
|
1590
|
-
|
|
1590
|
+
H(r.inputTokens),
|
|
1591
1591
|
" in /",
|
|
1592
1592
|
" ",
|
|
1593
|
-
|
|
1593
|
+
H(r.outputTokens),
|
|
1594
1594
|
" out / ",
|
|
1595
|
-
|
|
1595
|
+
H(r.cachedInputTokens),
|
|
1596
1596
|
" cached / ",
|
|
1597
|
-
|
|
1597
|
+
H(r.cacheWriteTokens),
|
|
1598
1598
|
" cache write)"
|
|
1599
1599
|
] }),
|
|
1600
1600
|
" · ",
|
|
1601
|
-
/* @__PURE__ */ t("span", { "data-testid": "model-usage-total-cost", children:
|
|
1602
|
-
r.unpriced > 0 && /* @__PURE__ */ l(
|
|
1601
|
+
/* @__PURE__ */ t("span", { "data-testid": "model-usage-total-cost", children: Ha(r.cost, r.unpriced) }),
|
|
1602
|
+
r.unpriced > 0 && /* @__PURE__ */ l(q, { children: [
|
|
1603
1603
|
" · ",
|
|
1604
1604
|
/* @__PURE__ */ l(
|
|
1605
1605
|
"span",
|
|
@@ -1608,7 +1608,7 @@ function Js(e) {
|
|
|
1608
1608
|
"data-testid": "model-usage-unpriced-total",
|
|
1609
1609
|
title: "calls with no usable rate — not included in any cost total",
|
|
1610
1610
|
children: [
|
|
1611
|
-
|
|
1611
|
+
H(r.unpriced),
|
|
1612
1612
|
" unpriced"
|
|
1613
1613
|
]
|
|
1614
1614
|
}
|
|
@@ -1616,73 +1616,73 @@ function Js(e) {
|
|
|
1616
1616
|
] })
|
|
1617
1617
|
] })
|
|
1618
1618
|
] }),
|
|
1619
|
-
|
|
1619
|
+
i.error != null && /* @__PURE__ */ t("div", { className: "error", role: "alert", "data-testid": "model-usage-error", children: i.error.message }),
|
|
1620
1620
|
/* @__PURE__ */ l("div", { children: [
|
|
1621
|
-
|
|
1622
|
-
|
|
1621
|
+
i.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
|
|
1622
|
+
i.isSuccess && c.length === 0 && /* @__PURE__ */ t(xe, { testId: "model-usage-empty", children: "No model calls in this window. Usage rows appear here as routes are invoked." }),
|
|
1623
1623
|
c.length > 0 && /* @__PURE__ */ t(
|
|
1624
1624
|
Re,
|
|
1625
1625
|
{
|
|
1626
|
-
columns:
|
|
1626
|
+
columns: Ja,
|
|
1627
1627
|
rows: c,
|
|
1628
|
-
rowKey: (
|
|
1628
|
+
rowKey: (h) => h.id,
|
|
1629
1629
|
testId: "model-usage-table",
|
|
1630
|
-
rowTestId: (
|
|
1630
|
+
rowTestId: (h) => `model-usage-${h.id}`
|
|
1631
1631
|
}
|
|
1632
1632
|
)
|
|
1633
1633
|
] }),
|
|
1634
|
-
|
|
1634
|
+
i.hasNextPage && /* @__PURE__ */ t("div", { className: "row", children: /* @__PURE__ */ t(
|
|
1635
1635
|
"button",
|
|
1636
1636
|
{
|
|
1637
1637
|
type: "button",
|
|
1638
1638
|
className: "btn ghost",
|
|
1639
|
-
disabled:
|
|
1640
|
-
onClick: () => void
|
|
1639
|
+
disabled: i.isFetchingNextPage,
|
|
1640
|
+
onClick: () => void i.fetchNextPage(),
|
|
1641
1641
|
"data-testid": "model-usage-load-more",
|
|
1642
|
-
children:
|
|
1642
|
+
children: i.isFetchingNextPage ? "Loading…" : "Load more"
|
|
1643
1643
|
}
|
|
1644
1644
|
) })
|
|
1645
1645
|
] })
|
|
1646
1646
|
] }) });
|
|
1647
1647
|
}
|
|
1648
|
-
const
|
|
1649
|
-
function
|
|
1650
|
-
const
|
|
1651
|
-
var g,
|
|
1652
|
-
return ((
|
|
1653
|
-
},
|
|
1648
|
+
const Ga = (e) => `${e} connection${e === 1 ? "" : "s"}`;
|
|
1649
|
+
function ti({ contract: e, onOpen: n, onCreate: a, slots: s }) {
|
|
1650
|
+
const i = mt(e ? { contract: e } : void 0), o = ke(), r = (i.data ?? []).filter((u) => !u.private), c = (u) => {
|
|
1651
|
+
var g, h;
|
|
1652
|
+
return ((h = (g = o.data) == null ? void 0 : g.find((C) => C.id === u)) == null ? void 0 : h.label) ?? u;
|
|
1653
|
+
}, m = a && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", onClick: a, children: "Add credential" });
|
|
1654
1654
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root w6w-embed-cred-list", children: [
|
|
1655
1655
|
/* @__PURE__ */ l("div", { className: "w6w-connection-list-head", "data-testid": "credential-list-header", children: [
|
|
1656
|
-
/* @__PURE__ */ t("div", { className: "w6w-connection-list-heading", children: (
|
|
1657
|
-
|
|
1656
|
+
/* @__PURE__ */ t("div", { className: "w6w-connection-list-heading", children: (s == null ? void 0 : s.header) ?? /* @__PURE__ */ t("h2", { children: "Credentials" }) }),
|
|
1657
|
+
m && /* @__PURE__ */ t("div", { className: "w6w-connection-list-actions", children: m })
|
|
1658
1658
|
] }),
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
!
|
|
1659
|
+
i.isLoading && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
|
|
1660
|
+
i.error && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", children: i.error.message }),
|
|
1661
|
+
!i.isLoading && !i.error && r.length === 0 && /* @__PURE__ */ t("div", { "data-testid": "credential-list-empty", children: (s == null ? void 0 : s.empty) ?? /* @__PURE__ */ l(q, { children: [
|
|
1662
1662
|
/* @__PURE__ */ t("p", { className: "w6w-muted", children: "No credentials yet." }),
|
|
1663
|
-
|
|
1663
|
+
m
|
|
1664
1664
|
] }) }),
|
|
1665
|
-
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Credentials", children: r.map((
|
|
1666
|
-
const g = Object.values(
|
|
1665
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Credentials", children: r.map((u) => {
|
|
1666
|
+
const g = Object.values(u.display)[0];
|
|
1667
1667
|
return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l(
|
|
1668
1668
|
"button",
|
|
1669
1669
|
{
|
|
1670
1670
|
type: "button",
|
|
1671
1671
|
className: "w6w-embed-conn-action",
|
|
1672
|
-
"data-testid": `credential-row-${
|
|
1673
|
-
onClick: () => n == null ? void 0 : n(
|
|
1672
|
+
"data-testid": `credential-row-${u.id}`,
|
|
1673
|
+
onClick: () => n == null ? void 0 : n(u.id),
|
|
1674
1674
|
children: [
|
|
1675
|
-
/* @__PURE__ */ t("strong", { children:
|
|
1675
|
+
/* @__PURE__ */ t("strong", { children: u.name }),
|
|
1676
1676
|
" ",
|
|
1677
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children:
|
|
1678
|
-
/* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", "data-testid": `credential-type-${
|
|
1677
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: u.status }),
|
|
1678
|
+
/* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", "data-testid": `credential-type-${u.id}`, children: [
|
|
1679
1679
|
" ",
|
|
1680
|
-
c(
|
|
1680
|
+
c(u.contract)
|
|
1681
1681
|
] }),
|
|
1682
|
-
/* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", "data-testid": `credential-scope-${
|
|
1682
|
+
/* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", "data-testid": `credential-scope-${u.id}`, children: [
|
|
1683
1683
|
" ",
|
|
1684
1684
|
"· ",
|
|
1685
|
-
|
|
1685
|
+
ht(u.accessScope)
|
|
1686
1686
|
] }),
|
|
1687
1687
|
g !== void 0 && /* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", children: [
|
|
1688
1688
|
" ",
|
|
@@ -1690,11 +1690,11 @@ function Gs({ contract: e, onOpen: n, onCreate: a, slots: i }) {
|
|
|
1690
1690
|
] }),
|
|
1691
1691
|
/* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", children: [
|
|
1692
1692
|
" · ",
|
|
1693
|
-
|
|
1693
|
+
Ga(u.connectionCount)
|
|
1694
1694
|
] })
|
|
1695
1695
|
]
|
|
1696
1696
|
}
|
|
1697
|
-
) },
|
|
1697
|
+
) }, u.id);
|
|
1698
1698
|
}) })
|
|
1699
1699
|
] });
|
|
1700
1700
|
}
|
|
@@ -1702,13 +1702,13 @@ function Ce({
|
|
|
1702
1702
|
fields: e,
|
|
1703
1703
|
values: n,
|
|
1704
1704
|
onChange: a,
|
|
1705
|
-
idPrefix:
|
|
1705
|
+
idPrefix: s
|
|
1706
1706
|
}) {
|
|
1707
|
-
return /* @__PURE__ */ t(
|
|
1707
|
+
return /* @__PURE__ */ t(q, { children: e.map((i) => {
|
|
1708
1708
|
const o = {
|
|
1709
|
-
className:
|
|
1710
|
-
value: n[
|
|
1711
|
-
name: `${
|
|
1709
|
+
className: i.secret ? "w6w-input w6w-secret-input" : "w6w-input",
|
|
1710
|
+
value: n[i.key] ?? "",
|
|
1711
|
+
name: `${s}-${i.key}`,
|
|
1712
1712
|
autoComplete: "off",
|
|
1713
1713
|
autoCapitalize: "off",
|
|
1714
1714
|
autoCorrect: "off",
|
|
@@ -1718,16 +1718,16 @@ function Ce({
|
|
|
1718
1718
|
"data-bwignore": "true",
|
|
1719
1719
|
"data-form-type": "other"
|
|
1720
1720
|
};
|
|
1721
|
-
return
|
|
1722
|
-
/* @__PURE__ */ t("span", { children:
|
|
1723
|
-
/* @__PURE__ */ t("textarea", { rows: 5, ...o, onChange: (r) => a(
|
|
1724
|
-
] },
|
|
1725
|
-
/* @__PURE__ */ t("span", { children:
|
|
1726
|
-
/* @__PURE__ */ t("input", { type: "text", ...o, onChange: (r) => a(
|
|
1727
|
-
] },
|
|
1721
|
+
return i.multiline ? /* @__PURE__ */ l("label", { className: "w6w-field", children: [
|
|
1722
|
+
/* @__PURE__ */ t("span", { children: i.label }),
|
|
1723
|
+
/* @__PURE__ */ t("textarea", { rows: 5, ...o, onChange: (r) => a(i.key, r.target.value) })
|
|
1724
|
+
] }, i.key) : /* @__PURE__ */ l("label", { className: "w6w-field", children: [
|
|
1725
|
+
/* @__PURE__ */ t("span", { children: i.label }),
|
|
1726
|
+
/* @__PURE__ */ t("input", { type: "text", ...o, onChange: (r) => a(i.key, r.target.value) })
|
|
1727
|
+
] }, i.key);
|
|
1728
1728
|
}) });
|
|
1729
1729
|
}
|
|
1730
|
-
const Te = (e, n) => e.every((a) => (n[a.key] ?? "").length > 0), Ee = (e, n) => Object.fromEntries(e.map((a) => [a.key, n[a.key] ?? ""])),
|
|
1730
|
+
const Te = (e, n) => e.every((a) => (n[a.key] ?? "").length > 0), Ee = (e, n) => Object.fromEntries(e.map((a) => [a.key, n[a.key] ?? ""])), Za = [
|
|
1731
1731
|
{
|
|
1732
1732
|
value: "account",
|
|
1733
1733
|
label: "This account",
|
|
@@ -1735,32 +1735,32 @@ const Te = (e, n) => e.every((a) => (n[a.key] ?? "").length > 0), Ee = (e, n) =>
|
|
|
1735
1735
|
},
|
|
1736
1736
|
{ value: "user", label: "Only me", hint: "Only you can use it. Others in the account cannot." }
|
|
1737
1737
|
];
|
|
1738
|
-
function
|
|
1739
|
-
const a =
|
|
1740
|
-
|
|
1741
|
-
},
|
|
1738
|
+
function ni({ onCreated: e, onCancel: n }) {
|
|
1739
|
+
const a = yt(), [s, i] = f("account"), o = ke(), r = Un(), [c, m] = f(null), [u, g] = f(""), [h, C] = f({}), [w, v] = f(null), y = o.data ?? [], p = y.find((b) => b.id === c) ?? y[0], T = (b) => {
|
|
1740
|
+
m(b), C({}), v(null);
|
|
1741
|
+
}, $ = () => {
|
|
1742
1742
|
if (!p || r.isPending) return;
|
|
1743
|
-
if (
|
|
1743
|
+
if (u.trim() === "") {
|
|
1744
1744
|
v("Give the credential a name.");
|
|
1745
1745
|
return;
|
|
1746
1746
|
}
|
|
1747
|
-
if (!Te(p.fields,
|
|
1747
|
+
if (!Te(p.fields, h)) {
|
|
1748
1748
|
v("Fill in every field.");
|
|
1749
1749
|
return;
|
|
1750
1750
|
}
|
|
1751
1751
|
v(null);
|
|
1752
1752
|
const b = {
|
|
1753
|
-
name:
|
|
1753
|
+
name: u.trim(),
|
|
1754
1754
|
contract: p.id,
|
|
1755
|
-
source: Ee(p.fields,
|
|
1756
|
-
...a &&
|
|
1755
|
+
source: Ee(p.fields, h),
|
|
1756
|
+
...a && s === "user" ? { accessScope: "user" } : {}
|
|
1757
1757
|
};
|
|
1758
|
-
|
|
1759
|
-
onSuccess: (
|
|
1760
|
-
r.reset(), e == null || e(
|
|
1758
|
+
C({}), r.mutate(b, {
|
|
1759
|
+
onSuccess: (I) => {
|
|
1760
|
+
r.reset(), e == null || e(I.id);
|
|
1761
1761
|
},
|
|
1762
|
-
onError: (
|
|
1763
|
-
r.reset(), v(
|
|
1762
|
+
onError: (I) => {
|
|
1763
|
+
r.reset(), v(oe(I, "create"));
|
|
1764
1764
|
}
|
|
1765
1765
|
});
|
|
1766
1766
|
};
|
|
@@ -1773,7 +1773,7 @@ function Zs({ onCreated: e, onCancel: n }) {
|
|
|
1773
1773
|
{
|
|
1774
1774
|
className: "w6w-card-stack",
|
|
1775
1775
|
onSubmit: (b) => {
|
|
1776
|
-
b.preventDefault(),
|
|
1776
|
+
b.preventDefault(), $();
|
|
1777
1777
|
},
|
|
1778
1778
|
children: [
|
|
1779
1779
|
/* @__PURE__ */ l("label", { className: "w6w-field", children: [
|
|
@@ -1783,7 +1783,7 @@ function Zs({ onCreated: e, onCancel: n }) {
|
|
|
1783
1783
|
{
|
|
1784
1784
|
value: p.id,
|
|
1785
1785
|
"aria-label": "Credential type",
|
|
1786
|
-
onChange: (b) =>
|
|
1786
|
+
onChange: (b) => T(b.target.value),
|
|
1787
1787
|
children: y.map((b) => /* @__PURE__ */ t("option", { value: b.id, children: b.label }, b.id))
|
|
1788
1788
|
}
|
|
1789
1789
|
)
|
|
@@ -1795,7 +1795,7 @@ function Zs({ onCreated: e, onCancel: n }) {
|
|
|
1795
1795
|
{
|
|
1796
1796
|
type: "text",
|
|
1797
1797
|
className: "w6w-input",
|
|
1798
|
-
value:
|
|
1798
|
+
value: u,
|
|
1799
1799
|
onChange: (b) => g(b.target.value),
|
|
1800
1800
|
maxLength: 120,
|
|
1801
1801
|
autoComplete: "off"
|
|
@@ -1811,15 +1811,15 @@ function Zs({ onCreated: e, onCancel: n }) {
|
|
|
1811
1811
|
"data-testid": "credential-owner",
|
|
1812
1812
|
children: [
|
|
1813
1813
|
/* @__PURE__ */ t("span", { children: "Who can use it" }),
|
|
1814
|
-
|
|
1814
|
+
Za.map((b) => /* @__PURE__ */ l("label", { className: "w6w-radio", children: [
|
|
1815
1815
|
/* @__PURE__ */ t(
|
|
1816
1816
|
"input",
|
|
1817
1817
|
{
|
|
1818
1818
|
type: "radio",
|
|
1819
1819
|
name: "w6w-cred-create-owner",
|
|
1820
1820
|
value: b.value,
|
|
1821
|
-
checked:
|
|
1822
|
-
onChange: () =>
|
|
1821
|
+
checked: s === b.value,
|
|
1822
|
+
onChange: () => i(b.value)
|
|
1823
1823
|
}
|
|
1824
1824
|
),
|
|
1825
1825
|
" ",
|
|
@@ -1836,8 +1836,8 @@ function Zs({ onCreated: e, onCancel: n }) {
|
|
|
1836
1836
|
Ce,
|
|
1837
1837
|
{
|
|
1838
1838
|
fields: p.fields,
|
|
1839
|
-
values:
|
|
1840
|
-
onChange: (b,
|
|
1839
|
+
values: h,
|
|
1840
|
+
onChange: (b, I) => C((N) => ({ ...N, [b]: I })),
|
|
1841
1841
|
idPrefix: "w6w-cred-create"
|
|
1842
1842
|
}
|
|
1843
1843
|
),
|
|
@@ -1851,8 +1851,8 @@ function Zs({ onCreated: e, onCancel: n }) {
|
|
|
1851
1851
|
)
|
|
1852
1852
|
] });
|
|
1853
1853
|
}
|
|
1854
|
-
const
|
|
1855
|
-
function
|
|
1854
|
+
const Be = "google-service-account.v1";
|
|
1855
|
+
function Xa(e) {
|
|
1856
1856
|
try {
|
|
1857
1857
|
const n = JSON.parse(e);
|
|
1858
1858
|
return n !== null && typeof n == "object" && !Array.isArray(n) ? n : null;
|
|
@@ -1860,106 +1860,106 @@ function Ga(e) {
|
|
|
1860
1860
|
return null;
|
|
1861
1861
|
}
|
|
1862
1862
|
}
|
|
1863
|
-
const
|
|
1864
|
-
function
|
|
1865
|
-
return /* @__PURE__ */ t(
|
|
1863
|
+
const Ue = (e) => Number.isNaN(Date.parse(e)) ? e : new Date(e).toLocaleString();
|
|
1864
|
+
function ai(e) {
|
|
1865
|
+
return /* @__PURE__ */ t(es, { ...e }, e.credentialId);
|
|
1866
1866
|
}
|
|
1867
|
-
function
|
|
1867
|
+
function es({
|
|
1868
1868
|
credentialId: e,
|
|
1869
1869
|
onOpenConnection: n,
|
|
1870
1870
|
onDeleted: a,
|
|
1871
|
-
onBack:
|
|
1872
|
-
slots:
|
|
1871
|
+
onBack: s,
|
|
1872
|
+
slots: i
|
|
1873
1873
|
}) {
|
|
1874
|
-
var te,
|
|
1875
|
-
const o =
|
|
1874
|
+
var te, fe, de;
|
|
1875
|
+
const o = Hn(e), r = Yn(e), c = wt(e), m = pt(e), u = zn(e), g = ft(), h = ke(), [C, w] = f(""), [v, y] = f({}), [p, T] = f(null), [$, b] = f(!1), [I, N] = f(null), [j, M] = f(null), [R, x] = f(!1), [P, V] = f(null), [E, _] = f(null), O = s && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: s, children: "← Credentials" });
|
|
1876
1876
|
if (o.isLoading)
|
|
1877
1877
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root w6w-embed-cred-detail", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) });
|
|
1878
|
-
const
|
|
1879
|
-
if (!
|
|
1878
|
+
const D = o.data;
|
|
1879
|
+
if (!D)
|
|
1880
1880
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root w6w-embed-cred-detail", "data-testid": "credential-not-found", children: [
|
|
1881
|
-
(
|
|
1882
|
-
|
|
1881
|
+
(i == null ? void 0 : i.empty) ?? /* @__PURE__ */ t("h2", { children: "Credential not found" }),
|
|
1882
|
+
O
|
|
1883
1883
|
] });
|
|
1884
|
-
const
|
|
1885
|
-
if (!
|
|
1886
|
-
if (b(!1), !Te(
|
|
1887
|
-
|
|
1884
|
+
const F = ((te = r.data) == null ? void 0 : te.connections) ?? [], W = D.connectionCount, k = D.status === "disabled", S = D.contract === Be || (fe = h.data) == null ? void 0 : fe.find((d) => d.id === D.contract), K = D.contract !== Be && h.isLoading, J = () => {
|
|
1885
|
+
if (!S) return;
|
|
1886
|
+
if (b(!1), !Te(S.fields, v)) {
|
|
1887
|
+
T("Fill in every field.");
|
|
1888
1888
|
return;
|
|
1889
1889
|
}
|
|
1890
|
-
|
|
1891
|
-
const d = Ee(
|
|
1890
|
+
T(null);
|
|
1891
|
+
const d = Ee(S.fields, v);
|
|
1892
1892
|
y({}), c.mutate(
|
|
1893
1893
|
{ source: d },
|
|
1894
1894
|
{
|
|
1895
1895
|
onSuccess: () => {
|
|
1896
1896
|
c.reset(), b(!0);
|
|
1897
1897
|
},
|
|
1898
|
-
onError: (
|
|
1899
|
-
c.reset(),
|
|
1898
|
+
onError: (L) => {
|
|
1899
|
+
c.reset(), T(oe(L, "rotate"));
|
|
1900
1900
|
}
|
|
1901
1901
|
}
|
|
1902
1902
|
);
|
|
1903
|
-
},
|
|
1903
|
+
}, A = () => {
|
|
1904
1904
|
b(!1);
|
|
1905
|
-
const d =
|
|
1905
|
+
const d = Xa(C);
|
|
1906
1906
|
if (!d) {
|
|
1907
|
-
|
|
1907
|
+
T("Enter the new secret as a JSON object.");
|
|
1908
1908
|
return;
|
|
1909
1909
|
}
|
|
1910
|
-
|
|
1910
|
+
T(null), c.mutate(
|
|
1911
1911
|
{ source: d },
|
|
1912
1912
|
{
|
|
1913
1913
|
onSuccess: () => {
|
|
1914
1914
|
w(""), b(!0);
|
|
1915
1915
|
},
|
|
1916
|
-
onError: (
|
|
1916
|
+
onError: (L) => T(ee(L) ?? (L == null ? void 0 : L.message) ?? "Rotate failed.")
|
|
1917
1917
|
}
|
|
1918
1918
|
);
|
|
1919
|
-
},
|
|
1920
|
-
|
|
1921
|
-
onSuccess:
|
|
1922
|
-
onError: (d) =>
|
|
1919
|
+
}, Q = () => {
|
|
1920
|
+
N(null), M(null), u.mutate(void 0, {
|
|
1921
|
+
onSuccess: N,
|
|
1922
|
+
onError: (d) => M(ee(d) ?? (d == null ? void 0 : d.message) ?? "Test failed.")
|
|
1923
1923
|
});
|
|
1924
1924
|
}, G = () => {
|
|
1925
|
-
|
|
1925
|
+
_(null), g.mutate(e, {
|
|
1926
1926
|
onSuccess: (d) => {
|
|
1927
|
-
x(!1), d.ok ? a == null || a() :
|
|
1927
|
+
x(!1), d.ok ? a == null || a() : V(d.dependents.connections);
|
|
1928
1928
|
},
|
|
1929
|
-
onError: (d) =>
|
|
1929
|
+
onError: (d) => _(ee(d) ?? (d == null ? void 0 : d.message) ?? "Delete failed.")
|
|
1930
1930
|
});
|
|
1931
1931
|
};
|
|
1932
1932
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root w6w-embed-cred-detail w6w-card-stack", children: [
|
|
1933
1933
|
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1934
|
-
/* @__PURE__ */ t("h2", { children:
|
|
1934
|
+
/* @__PURE__ */ t("h2", { children: D.name }),
|
|
1935
1935
|
/* @__PURE__ */ l("p", { className: "w6w-small", children: [
|
|
1936
|
-
/* @__PURE__ */ t("code", { children:
|
|
1936
|
+
/* @__PURE__ */ t("code", { children: D.contract }),
|
|
1937
1937
|
" ",
|
|
1938
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children:
|
|
1938
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: D.status })
|
|
1939
1939
|
] }),
|
|
1940
1940
|
/* @__PURE__ */ l("p", { className: "w6w-small", children: [
|
|
1941
|
-
/* @__PURE__ */ t("span", { "data-testid": "credential-scope", children:
|
|
1941
|
+
/* @__PURE__ */ t("span", { "data-testid": "credential-scope", children: ht(D.accessScope) }),
|
|
1942
1942
|
/* @__PURE__ */ t("span", { className: "w6w-muted", children: " · Reusable credential" })
|
|
1943
1943
|
] }),
|
|
1944
|
-
/* @__PURE__ */ t("dl", { className: "w6w-small", "data-testid": "credential-display", children: Object.entries(
|
|
1944
|
+
/* @__PURE__ */ t("dl", { className: "w6w-small", "data-testid": "credential-display", children: Object.entries(D.display).map(([d, L]) => /* @__PURE__ */ l("div", { children: [
|
|
1945
1945
|
/* @__PURE__ */ t("dt", { className: "w6w-muted", children: d }),
|
|
1946
|
-
/* @__PURE__ */ t("dd", { children:
|
|
1946
|
+
/* @__PURE__ */ t("dd", { children: L })
|
|
1947
1947
|
] }, d)) }),
|
|
1948
1948
|
/* @__PURE__ */ l("p", { className: "w6w-muted w6w-small", children: [
|
|
1949
1949
|
W,
|
|
1950
1950
|
" connection",
|
|
1951
1951
|
W === 1 ? "" : "s",
|
|
1952
1952
|
" · created ",
|
|
1953
|
-
|
|
1953
|
+
Ue(D.createdAt),
|
|
1954
1954
|
" · updated",
|
|
1955
1955
|
" ",
|
|
1956
|
-
|
|
1956
|
+
Ue(D.updatedAt)
|
|
1957
1957
|
] }),
|
|
1958
|
-
|
|
1958
|
+
O
|
|
1959
1959
|
] }),
|
|
1960
1960
|
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", "data-testid": "credential-connections", children: [
|
|
1961
1961
|
/* @__PURE__ */ t("h3", { children: "Connected apps" }),
|
|
1962
|
-
|
|
1962
|
+
F.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Not used by any connection." }) : /* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Connected apps", children: F.map((d) => /* @__PURE__ */ t("li", { children: n ? /* @__PURE__ */ t(
|
|
1963
1963
|
"button",
|
|
1964
1964
|
{
|
|
1965
1965
|
type: "button",
|
|
@@ -1977,23 +1977,23 @@ function Za({
|
|
|
1977
1977
|
W === 1 ? "" : "s",
|
|
1978
1978
|
" will be marked untested"
|
|
1979
1979
|
] }),
|
|
1980
|
-
|
|
1981
|
-
|
|
1980
|
+
K && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
|
|
1981
|
+
S && /* @__PURE__ */ t(
|
|
1982
1982
|
Ce,
|
|
1983
1983
|
{
|
|
1984
|
-
fields:
|
|
1984
|
+
fields: S.fields,
|
|
1985
1985
|
values: v,
|
|
1986
|
-
onChange: (d,
|
|
1986
|
+
onChange: (d, L) => y((B) => ({ ...B, [d]: L })),
|
|
1987
1987
|
idPrefix: "w6w-cred-rotate"
|
|
1988
1988
|
}
|
|
1989
1989
|
),
|
|
1990
|
-
!
|
|
1990
|
+
!K && !S && /* @__PURE__ */ t(
|
|
1991
1991
|
"textarea",
|
|
1992
1992
|
{
|
|
1993
1993
|
className: "w6w-input w6w-secret-input",
|
|
1994
1994
|
"aria-label": "New secret (JSON object)",
|
|
1995
1995
|
rows: 5,
|
|
1996
|
-
value:
|
|
1996
|
+
value: C,
|
|
1997
1997
|
onChange: (d) => w(d.target.value),
|
|
1998
1998
|
name: "w6w-cred-rotate",
|
|
1999
1999
|
autoComplete: "off",
|
|
@@ -2007,14 +2007,14 @@ function Za({
|
|
|
2007
2007
|
}
|
|
2008
2008
|
),
|
|
2009
2009
|
p && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", "data-testid": "credential-rotate-error", children: p }),
|
|
2010
|
-
|
|
2010
|
+
$ && /* @__PURE__ */ t("output", { children: "Secret rotated." }),
|
|
2011
2011
|
/* @__PURE__ */ t(
|
|
2012
2012
|
"button",
|
|
2013
2013
|
{
|
|
2014
2014
|
type: "button",
|
|
2015
2015
|
className: "w6w-btn",
|
|
2016
|
-
disabled: c.isPending ||
|
|
2017
|
-
onClick:
|
|
2016
|
+
disabled: c.isPending || K,
|
|
2017
|
+
onClick: S ? J : A,
|
|
2018
2018
|
children: c.isPending ? "Rotating…" : "Rotate"
|
|
2019
2019
|
}
|
|
2020
2020
|
)
|
|
@@ -2027,9 +2027,9 @@ function Za({
|
|
|
2027
2027
|
{
|
|
2028
2028
|
type: "button",
|
|
2029
2029
|
className: "w6w-btn w6w-btn-ghost",
|
|
2030
|
-
disabled:
|
|
2031
|
-
onClick: () =>
|
|
2032
|
-
children:
|
|
2030
|
+
disabled: m.isPending,
|
|
2031
|
+
onClick: () => m.mutate(k ? "active" : "disabled"),
|
|
2032
|
+
children: k ? "Enable" : "Disable"
|
|
2033
2033
|
}
|
|
2034
2034
|
),
|
|
2035
2035
|
/* @__PURE__ */ t(
|
|
@@ -2037,9 +2037,9 @@ function Za({
|
|
|
2037
2037
|
{
|
|
2038
2038
|
type: "button",
|
|
2039
2039
|
className: "w6w-btn w6w-btn-ghost",
|
|
2040
|
-
disabled:
|
|
2041
|
-
onClick:
|
|
2042
|
-
children:
|
|
2040
|
+
disabled: u.isPending,
|
|
2041
|
+
onClick: Q,
|
|
2042
|
+
children: u.isPending ? "Testing…" : "Test credential"
|
|
2043
2043
|
}
|
|
2044
2044
|
),
|
|
2045
2045
|
/* @__PURE__ */ t(
|
|
@@ -2048,19 +2048,19 @@ function Za({
|
|
|
2048
2048
|
type: "button",
|
|
2049
2049
|
className: "w6w-btn w6w-btn-danger",
|
|
2050
2050
|
onClick: () => {
|
|
2051
|
-
|
|
2051
|
+
V(null), x(!0);
|
|
2052
2052
|
},
|
|
2053
2053
|
children: "Delete"
|
|
2054
2054
|
}
|
|
2055
2055
|
)
|
|
2056
2056
|
] }),
|
|
2057
|
-
|
|
2057
|
+
I && /* @__PURE__ */ t("output", { "data-testid": "credential-test-result", children: I.ok ? "ok" : I.code ?? "failed" }),
|
|
2058
2058
|
j && /* @__PURE__ */ t("p", { role: "alert", children: j }),
|
|
2059
|
-
|
|
2059
|
+
m.isError && /* @__PURE__ */ t("p", { role: "alert", children: ee(m.error) ?? ((de = m.error) == null ? void 0 : de.message) ?? "Update failed." }),
|
|
2060
2060
|
R && /* @__PURE__ */ l("div", { "data-testid": "credential-delete-confirm", children: [
|
|
2061
2061
|
/* @__PURE__ */ l("p", { className: "w6w-small", children: [
|
|
2062
2062
|
'Delete the credential "',
|
|
2063
|
-
|
|
2063
|
+
D.name,
|
|
2064
2064
|
'"? This cannot be undone.'
|
|
2065
2065
|
] }),
|
|
2066
2066
|
/* @__PURE__ */ t(
|
|
@@ -2084,113 +2084,156 @@ function Za({
|
|
|
2084
2084
|
}
|
|
2085
2085
|
)
|
|
2086
2086
|
] }),
|
|
2087
|
-
|
|
2087
|
+
P && /* @__PURE__ */ l("div", { role: "alert", "data-testid": "credential-in-use", children: [
|
|
2088
2088
|
/* @__PURE__ */ l("p", { className: "w6w-small", children: [
|
|
2089
2089
|
"This credential is still used by ",
|
|
2090
|
-
|
|
2090
|
+
P.length,
|
|
2091
2091
|
" connection",
|
|
2092
|
-
|
|
2092
|
+
P.length === 1 ? "" : "s",
|
|
2093
2093
|
". Delete those integrations first, or rotate this credential instead of deleting it."
|
|
2094
2094
|
] }),
|
|
2095
|
-
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", children:
|
|
2095
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", children: P.map((d) => /* @__PURE__ */ t("li", { children: d.displayName || d.appId }, d.id)) })
|
|
2096
2096
|
] }),
|
|
2097
|
-
|
|
2097
|
+
E && /* @__PURE__ */ t("p", { role: "alert", children: E })
|
|
2098
2098
|
] })
|
|
2099
2099
|
] });
|
|
2100
2100
|
}
|
|
2101
|
-
const
|
|
2102
|
-
function
|
|
2103
|
-
var
|
|
2104
|
-
const n = e ?? {}, a = Array.isArray(n.accepts) ? n.accepts : (
|
|
2105
|
-
return Array.isArray(a) ? a.filter((
|
|
2101
|
+
const ts = "Keys that only you can use are not turned on for this account.", ns = "Models that only your personal key can see are not added to the account's catalog.", as = "This provider is not supported for personal keys.", ss = "Could not save the key. Nothing was kept.", is = "Could not save the key, and a partial copy could not be removed. Remove it under Shared credentials.", He = "The key was removed, but its stored copy was not.";
|
|
2102
|
+
function ls(e) {
|
|
2103
|
+
var s;
|
|
2104
|
+
const n = e ?? {}, a = Array.isArray(n.accepts) ? n.accepts : (s = n.serviceAccount) == null ? void 0 : s.accepts;
|
|
2105
|
+
return Array.isArray(a) ? a.filter((i) => typeof i == "string") : [];
|
|
2106
2106
|
}
|
|
2107
|
-
function
|
|
2107
|
+
function rs(e, n) {
|
|
2108
2108
|
for (const a of e ?? []) {
|
|
2109
|
-
const
|
|
2110
|
-
if (
|
|
2111
|
-
const
|
|
2112
|
-
if (
|
|
2109
|
+
const s = a;
|
|
2110
|
+
if (s.type === "oauth2" || typeof s.key != "string") continue;
|
|
2111
|
+
const i = ls(a).find((o) => n.some((r) => r.id === o));
|
|
2112
|
+
if (i) return { authKey: s.key, contract: i };
|
|
2113
2113
|
}
|
|
2114
2114
|
return null;
|
|
2115
2115
|
}
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2116
|
+
function Mt(e) {
|
|
2117
|
+
const n = e ?? {};
|
|
2118
|
+
if (n.type === "oauth2" || n.userScope !== !0 || !Array.isArray(n.fields)) return null;
|
|
2119
|
+
const a = n.fields.map((s) => s ?? {}).filter(
|
|
2120
|
+
(s) => typeof s.key == "string"
|
|
2121
|
+
).map((s) => ({
|
|
2122
|
+
key: s.key,
|
|
2123
|
+
label: typeof s.label == "string" ? s.label : s.key,
|
|
2124
|
+
secret: s.type === "secret" || s.secret === !0
|
|
2125
|
+
}));
|
|
2126
|
+
return a.length > 0 ? a : null;
|
|
2127
|
+
}
|
|
2128
|
+
function os(e) {
|
|
2129
|
+
for (const n of e ?? []) {
|
|
2130
|
+
const a = n.key, s = Mt(n);
|
|
2131
|
+
if (typeof a == "string" && s) return { authKey: a, fields: s };
|
|
2132
|
+
}
|
|
2133
|
+
return null;
|
|
2134
|
+
}
|
|
2135
|
+
function cs(e, n, a) {
|
|
2136
|
+
const s = ce(), i = lt({
|
|
2137
|
+
queryKey: ["app-auth", e],
|
|
2138
|
+
queryFn: () => s.console.apps.getAuth(e),
|
|
2139
|
+
enabled: a,
|
|
2140
|
+
retry: !1
|
|
2141
|
+
});
|
|
2142
|
+
return Mt((i.data ?? []).find((o) => o.key === n));
|
|
2143
|
+
}
|
|
2144
|
+
const ie = (e) => e.provider ?? e.appId;
|
|
2145
|
+
function si({ providerAppId: e }) {
|
|
2146
|
+
const n = yt(), a = Bn(), s = rt(), i = mt({ accessScope: "user" }), o = Xn(n), r = ke(), c = (a.data ?? []).filter((w) => w.designation), m = new Map((i.data ?? []).map((w) => [w.id, w])), u = (s.data ?? []).filter(
|
|
2147
|
+
(w) => w.accessScope === "user" && w.credentialId && (m.has(w.credentialId) || i.data !== void 0)
|
|
2148
|
+
), g = o.data ?? [], [h, C] = f(null);
|
|
2121
2149
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root w6w-embed-ai-keys w6w-card-stack", "data-testid": "my-ai-keys", children: [
|
|
2122
2150
|
/* @__PURE__ */ t("h2", { children: "My AI keys" }),
|
|
2123
2151
|
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Keys that only you can use. They are never shown again after you save them." }),
|
|
2124
|
-
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", "data-testid": "ai-keys-private-note", children:
|
|
2125
|
-
!n && /* @__PURE__ */ t("output", { className: "w6w-muted", "data-testid": "ai-keys-disabled", children:
|
|
2126
|
-
(a.isLoading ||
|
|
2152
|
+
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", "data-testid": "ai-keys-private-note", children: ns }),
|
|
2153
|
+
!n && /* @__PURE__ */ t("output", { className: "w6w-muted", "data-testid": "ai-keys-disabled", children: ts }),
|
|
2154
|
+
(a.isLoading || s.isLoading || i.isLoading) && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
|
|
2127
2155
|
a.error && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", children: "Could not load the AI providers." }),
|
|
2128
|
-
n && c.length > 0 && /* @__PURE__ */ t(
|
|
2156
|
+
n && c.length > 0 && /* @__PURE__ */ t(ds, { providers: c, initial: e, types: r.data ?? [] }),
|
|
2129
2157
|
!a.isLoading && !a.error && c.length === 0 && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No AI providers are available." }),
|
|
2130
|
-
|
|
2158
|
+
h && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", "data-testid": "ai-keys-notice", children: h }),
|
|
2131
2159
|
c.map((w) => {
|
|
2132
|
-
const v =
|
|
2160
|
+
const v = u.filter((y) => y.appId === w.appId);
|
|
2133
2161
|
return v.length === 0 ? null : /* @__PURE__ */ t(
|
|
2134
|
-
|
|
2162
|
+
us,
|
|
2135
2163
|
{
|
|
2136
2164
|
provider: w,
|
|
2137
2165
|
keys: v,
|
|
2138
|
-
creds:
|
|
2166
|
+
creds: m,
|
|
2139
2167
|
current: g.find((y) => y.providerAppId === w.appId),
|
|
2140
2168
|
types: r.data ?? [],
|
|
2141
|
-
onNotice:
|
|
2169
|
+
onNotice: C
|
|
2142
2170
|
},
|
|
2143
2171
|
w.appId
|
|
2144
2172
|
);
|
|
2145
2173
|
})
|
|
2146
2174
|
] });
|
|
2147
2175
|
}
|
|
2148
|
-
function
|
|
2176
|
+
function ds({
|
|
2149
2177
|
providers: e,
|
|
2150
2178
|
initial: n,
|
|
2151
2179
|
types: a
|
|
2152
2180
|
}) {
|
|
2153
|
-
var
|
|
2154
|
-
const
|
|
2181
|
+
var P, V;
|
|
2182
|
+
const s = ce(), i = pe(), [o, r] = f(n), c = ((P = e.find((E) => E.appId === o)) == null ? void 0 : P.appId) ?? ((V = e[0]) == null ? void 0 : V.appId) ?? "", m = e.find((E) => E.appId === c), [u, g] = f(""), [h, C] = f({}), [w, v] = f(null), [y, p] = f(!1), [T, $] = f(!1), b = lt({
|
|
2155
2183
|
queryKey: ["app-auth", c],
|
|
2156
|
-
queryFn: () =>
|
|
2184
|
+
queryFn: () => s.console.apps.getAuth(c),
|
|
2157
2185
|
enabled: c !== "",
|
|
2158
2186
|
retry: !1
|
|
2159
|
-
}),
|
|
2160
|
-
r(
|
|
2161
|
-
},
|
|
2162
|
-
if (!
|
|
2163
|
-
if (!Te(
|
|
2187
|
+
}), I = rs(b.data, a), N = I ? a.find((E) => E.id === I.contract) : void 0, j = N ? null : os(b.data), M = (N == null ? void 0 : N.fields) ?? (j == null ? void 0 : j.fields), R = (E) => {
|
|
2188
|
+
r(E), C({}), v(null), $(!1);
|
|
2189
|
+
}, x = async () => {
|
|
2190
|
+
if (!m || !M || y) return;
|
|
2191
|
+
if (!Te(M, h)) {
|
|
2164
2192
|
v("Fill in every field.");
|
|
2165
2193
|
return;
|
|
2166
2194
|
}
|
|
2167
|
-
v(null),
|
|
2168
|
-
const
|
|
2169
|
-
|
|
2170
|
-
|
|
2195
|
+
v(null), $(!1);
|
|
2196
|
+
const E = Ee(M, h);
|
|
2197
|
+
if (C({}), p(!0), !I || !N) {
|
|
2198
|
+
if (!j) return p(!1);
|
|
2199
|
+
try {
|
|
2200
|
+
await Qe(s, c, {
|
|
2201
|
+
authKey: j.authKey,
|
|
2202
|
+
credential: E,
|
|
2203
|
+
displayName: u.trim() || `My ${ie(m)} key`,
|
|
2204
|
+
accessScope: "user"
|
|
2205
|
+
}), g(""), $(!0);
|
|
2206
|
+
} catch (O) {
|
|
2207
|
+
v(oe(O, "create"));
|
|
2208
|
+
} finally {
|
|
2209
|
+
p(!1), i.invalidateQueries({ queryKey: we });
|
|
2210
|
+
}
|
|
2211
|
+
return;
|
|
2212
|
+
}
|
|
2213
|
+
let _ = null;
|
|
2171
2214
|
try {
|
|
2172
|
-
const
|
|
2173
|
-
name:
|
|
2174
|
-
contract:
|
|
2175
|
-
source:
|
|
2215
|
+
const O = await Jn(s, {
|
|
2216
|
+
name: u.trim() || `My ${ie(m)} key`,
|
|
2217
|
+
contract: I.contract,
|
|
2218
|
+
source: E,
|
|
2176
2219
|
accessScope: "user"
|
|
2177
2220
|
});
|
|
2178
|
-
|
|
2179
|
-
authKey:
|
|
2180
|
-
credentialId:
|
|
2221
|
+
_ = O.id, await Qe(s, c, {
|
|
2222
|
+
authKey: I.authKey,
|
|
2223
|
+
credentialId: O.id,
|
|
2181
2224
|
accessScope: "user"
|
|
2182
|
-
}), g(""),
|
|
2183
|
-
} catch (
|
|
2184
|
-
if (
|
|
2185
|
-
const
|
|
2186
|
-
(
|
|
2225
|
+
}), g(""), $(!0);
|
|
2226
|
+
} catch (O) {
|
|
2227
|
+
if (_) {
|
|
2228
|
+
const D = await Gn(s, _).then(
|
|
2229
|
+
(F) => F.ok,
|
|
2187
2230
|
() => !1
|
|
2188
2231
|
);
|
|
2189
|
-
v(
|
|
2232
|
+
v(D ? ee(O) ?? ss : is);
|
|
2190
2233
|
} else
|
|
2191
|
-
v(
|
|
2234
|
+
v(oe(O, "create"));
|
|
2192
2235
|
} finally {
|
|
2193
|
-
p(!1),
|
|
2236
|
+
p(!1), i.invalidateQueries({ queryKey: Zn }), i.invalidateQueries({ queryKey: we });
|
|
2194
2237
|
}
|
|
2195
2238
|
};
|
|
2196
2239
|
return /* @__PURE__ */ l(
|
|
@@ -2198,18 +2241,18 @@ function ls({
|
|
|
2198
2241
|
{
|
|
2199
2242
|
className: "w6w-embed-conn-card w6w-card-stack",
|
|
2200
2243
|
"data-testid": "ai-key-add",
|
|
2201
|
-
onSubmit: (
|
|
2202
|
-
|
|
2244
|
+
onSubmit: (E) => {
|
|
2245
|
+
E.preventDefault(), x();
|
|
2203
2246
|
},
|
|
2204
2247
|
children: [
|
|
2205
2248
|
/* @__PURE__ */ t("h3", { children: "Add a key" }),
|
|
2206
2249
|
/* @__PURE__ */ l("label", { className: "w6w-field", children: [
|
|
2207
2250
|
/* @__PURE__ */ t("span", { children: "Provider" }),
|
|
2208
|
-
/* @__PURE__ */ t("select", { value: c, "aria-label": "Provider", onChange: (
|
|
2251
|
+
/* @__PURE__ */ t("select", { value: c, "aria-label": "Provider", onChange: (E) => R(E.target.value), children: e.map((E) => /* @__PURE__ */ t("option", { value: E.appId, children: ie(E) }, E.appId)) })
|
|
2209
2252
|
] }),
|
|
2210
2253
|
b.isLoading && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
|
|
2211
|
-
!b.isLoading && !
|
|
2212
|
-
|
|
2254
|
+
!b.isLoading && !M && /* @__PURE__ */ t("p", { className: "w6w-muted", "data-testid": "ai-key-unsupported", children: as }),
|
|
2255
|
+
M && /* @__PURE__ */ l(q, { children: [
|
|
2213
2256
|
/* @__PURE__ */ l("label", { className: "w6w-field", children: [
|
|
2214
2257
|
/* @__PURE__ */ t("span", { children: "Name" }),
|
|
2215
2258
|
/* @__PURE__ */ t(
|
|
@@ -2217,9 +2260,9 @@ function ls({
|
|
|
2217
2260
|
{
|
|
2218
2261
|
type: "text",
|
|
2219
2262
|
className: "w6w-input",
|
|
2220
|
-
value:
|
|
2221
|
-
placeholder:
|
|
2222
|
-
onChange: (
|
|
2263
|
+
value: u,
|
|
2264
|
+
placeholder: m ? `My ${ie(m)} key` : "",
|
|
2265
|
+
onChange: (E) => g(E.target.value),
|
|
2223
2266
|
maxLength: 120,
|
|
2224
2267
|
autoComplete: "off"
|
|
2225
2268
|
}
|
|
@@ -2228,51 +2271,51 @@ function ls({
|
|
|
2228
2271
|
/* @__PURE__ */ t(
|
|
2229
2272
|
Ce,
|
|
2230
2273
|
{
|
|
2231
|
-
fields:
|
|
2232
|
-
values:
|
|
2233
|
-
onChange: (
|
|
2274
|
+
fields: M,
|
|
2275
|
+
values: h,
|
|
2276
|
+
onChange: (E, _) => C((O) => ({ ...O, [E]: _ })),
|
|
2234
2277
|
idPrefix: "w6w-ai-key-add"
|
|
2235
2278
|
}
|
|
2236
2279
|
),
|
|
2237
2280
|
w && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", "data-testid": "ai-key-add-error", children: w }),
|
|
2238
|
-
|
|
2281
|
+
T && /* @__PURE__ */ t("output", { "data-testid": "ai-key-saved", children: "Key saved. Only you can use it." }),
|
|
2239
2282
|
/* @__PURE__ */ t("div", { className: "w6w-modal-actions", children: /* @__PURE__ */ t("button", { type: "submit", className: "w6w-btn", disabled: y, children: y ? "Saving…" : "Save key" }) })
|
|
2240
2283
|
] })
|
|
2241
2284
|
]
|
|
2242
2285
|
}
|
|
2243
2286
|
);
|
|
2244
2287
|
}
|
|
2245
|
-
function
|
|
2288
|
+
function us({
|
|
2246
2289
|
provider: e,
|
|
2247
2290
|
keys: n,
|
|
2248
2291
|
creds: a,
|
|
2249
|
-
current:
|
|
2250
|
-
types:
|
|
2292
|
+
current: s,
|
|
2293
|
+
types: i,
|
|
2251
2294
|
onNotice: o
|
|
2252
2295
|
}) {
|
|
2253
|
-
const r =
|
|
2254
|
-
|
|
2296
|
+
const r = ea(), c = ta(), [m, u] = f(null), g = e.appId, h = s && n.some((w) => w.id === s.connectionId) ? s : void 0, C = (w) => {
|
|
2297
|
+
u(null);
|
|
2255
2298
|
const v = {
|
|
2256
|
-
onError: (y) =>
|
|
2299
|
+
onError: (y) => u(ee(y) ?? "Could not change the default key.")
|
|
2257
2300
|
};
|
|
2258
2301
|
w === null ? c.mutate(g, v) : r.mutate({ providerAppId: g, connectionId: w }, v);
|
|
2259
2302
|
};
|
|
2260
2303
|
return /* @__PURE__ */ l("section", { className: "w6w-embed-conn-card w6w-card-stack", "data-testid": `ai-provider-${g}`, children: [
|
|
2261
|
-
/* @__PURE__ */ t("h3", { children:
|
|
2262
|
-
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": `${
|
|
2304
|
+
/* @__PURE__ */ t("h3", { children: ie(e) }),
|
|
2305
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": `${ie(e)} keys`, children: n.map((w) => {
|
|
2263
2306
|
const v = a.get(w.credentialId);
|
|
2264
2307
|
return /* @__PURE__ */ t(
|
|
2265
|
-
|
|
2308
|
+
ms,
|
|
2266
2309
|
{
|
|
2267
2310
|
connection: w,
|
|
2268
2311
|
credential: v,
|
|
2269
|
-
descriptor:
|
|
2312
|
+
descriptor: v ? i.find((y) => y.id === v.contract) : void 0,
|
|
2270
2313
|
onNotice: o
|
|
2271
2314
|
},
|
|
2272
2315
|
w.id
|
|
2273
2316
|
);
|
|
2274
2317
|
}) }),
|
|
2275
|
-
/* @__PURE__ */ l("div", { role: "radiogroup", "aria-label": `Default key for ${
|
|
2318
|
+
/* @__PURE__ */ l("div", { role: "radiogroup", "aria-label": `Default key for ${ie(e)}`, children: [
|
|
2276
2319
|
/* @__PURE__ */ t("span", { className: "w6w-small", children: "Default key" }),
|
|
2277
2320
|
/* @__PURE__ */ l("label", { className: "w6w-radio", children: [
|
|
2278
2321
|
/* @__PURE__ */ t(
|
|
@@ -2280,9 +2323,9 @@ function rs({
|
|
|
2280
2323
|
{
|
|
2281
2324
|
type: "radio",
|
|
2282
2325
|
name: `ai-default-${g}`,
|
|
2283
|
-
checked: !
|
|
2326
|
+
checked: !h,
|
|
2284
2327
|
onChange: () => {
|
|
2285
|
-
|
|
2328
|
+
h && C(null);
|
|
2286
2329
|
}
|
|
2287
2330
|
}
|
|
2288
2331
|
),
|
|
@@ -2296,66 +2339,80 @@ function rs({
|
|
|
2296
2339
|
type: "radio",
|
|
2297
2340
|
name: `ai-default-${g}`,
|
|
2298
2341
|
"data-testid": `ai-default-${w.id}`,
|
|
2299
|
-
checked: (
|
|
2300
|
-
onChange: () =>
|
|
2342
|
+
checked: (h == null ? void 0 : h.connectionId) === w.id,
|
|
2343
|
+
onChange: () => C(w.id)
|
|
2301
2344
|
}
|
|
2302
2345
|
),
|
|
2303
2346
|
" ",
|
|
2304
2347
|
w.displayName
|
|
2305
2348
|
] }, w.id))
|
|
2306
2349
|
] }),
|
|
2307
|
-
(
|
|
2308
|
-
|
|
2350
|
+
(s == null ? void 0 : s.status) === "unavailable" && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", "data-testid": `ai-default-warning-${g}`, children: "Your default key for this provider is not available. Enable it, replace it or pick another." }),
|
|
2351
|
+
m && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", children: m })
|
|
2309
2352
|
] });
|
|
2310
2353
|
}
|
|
2311
|
-
function
|
|
2354
|
+
function ms({
|
|
2312
2355
|
connection: e,
|
|
2313
2356
|
credential: n,
|
|
2314
2357
|
descriptor: a,
|
|
2315
|
-
onNotice:
|
|
2358
|
+
onNotice: s
|
|
2316
2359
|
}) {
|
|
2317
|
-
const
|
|
2318
|
-
|
|
2319
|
-
onSuccess: (
|
|
2320
|
-
onError: (
|
|
2360
|
+
const i = ut(e.id), o = wt((n == null ? void 0 : n.id) ?? ""), r = pt((n == null ? void 0 : n.id) ?? ""), c = Fn(e.id), m = cs(e.appId, e.authKey, !n), u = n ? a == null ? void 0 : a.fields : m ?? void 0, g = ot(), h = ft(), [C, w] = f(!1), [v, y] = f({}), [p, T] = f(!1), [$, b] = f(null), [I, N] = f(null), [j, M] = f(null), R = (n == null ? void 0 : n.status) === "disabled", x = n ? Object.values(n.display)[0] : void 0, P = n ? o.isPending : c.isPending, V = (D, F) => N(ee(D) ?? F), E = () => {
|
|
2361
|
+
M(null), N(null), i.mutate(void 0, {
|
|
2362
|
+
onSuccess: (D) => M(D.ok ? "ok" : "failed"),
|
|
2363
|
+
onError: (D) => V(D, "Could not test the key.")
|
|
2321
2364
|
});
|
|
2322
|
-
},
|
|
2323
|
-
if (!
|
|
2324
|
-
if (
|
|
2325
|
-
|
|
2365
|
+
}, _ = () => {
|
|
2366
|
+
if (!u) return;
|
|
2367
|
+
if (b(null), !Te(u, v)) {
|
|
2368
|
+
N("Fill in every field.");
|
|
2326
2369
|
return;
|
|
2327
2370
|
}
|
|
2328
|
-
|
|
2329
|
-
const
|
|
2330
|
-
|
|
2331
|
-
|
|
2371
|
+
N(null);
|
|
2372
|
+
const D = Ee(u, v);
|
|
2373
|
+
if (y({}), !n) {
|
|
2374
|
+
c.mutate(
|
|
2375
|
+
{ credential: D },
|
|
2376
|
+
{
|
|
2377
|
+
onSuccess: () => {
|
|
2378
|
+
c.reset(), w(!1), b("Key replaced.");
|
|
2379
|
+
},
|
|
2380
|
+
onError: (F) => {
|
|
2381
|
+
c.reset(), N(oe(F, "rotate"));
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
);
|
|
2385
|
+
return;
|
|
2386
|
+
}
|
|
2387
|
+
o.mutate(
|
|
2388
|
+
{ source: D },
|
|
2332
2389
|
{
|
|
2333
2390
|
onSuccess: () => {
|
|
2334
|
-
o.reset(),
|
|
2391
|
+
o.reset(), w(!1), b("Key replaced.");
|
|
2335
2392
|
},
|
|
2336
|
-
onError: (
|
|
2337
|
-
o.reset(),
|
|
2393
|
+
onError: (F) => {
|
|
2394
|
+
o.reset(), N(oe(F, "rotate"));
|
|
2338
2395
|
}
|
|
2339
2396
|
}
|
|
2340
2397
|
);
|
|
2341
|
-
},
|
|
2342
|
-
|
|
2398
|
+
}, O = () => {
|
|
2399
|
+
N(null), s(null), g.mutate(
|
|
2343
2400
|
{ id: e.id },
|
|
2344
2401
|
{
|
|
2345
|
-
onSuccess: (
|
|
2346
|
-
if (!
|
|
2347
|
-
|
|
2402
|
+
onSuccess: (D) => {
|
|
2403
|
+
if (!D.ok) {
|
|
2404
|
+
T(!1), N("This key is still in use. Remove what uses it first.");
|
|
2348
2405
|
return;
|
|
2349
2406
|
}
|
|
2350
|
-
|
|
2351
|
-
onSuccess: (
|
|
2352
|
-
|
|
2407
|
+
n && h.mutate(n.id, {
|
|
2408
|
+
onSuccess: (F) => {
|
|
2409
|
+
F.ok || s(He);
|
|
2353
2410
|
},
|
|
2354
|
-
onError: (
|
|
2411
|
+
onError: (F) => s(ee(F) ?? He)
|
|
2355
2412
|
});
|
|
2356
2413
|
},
|
|
2357
|
-
onError: (
|
|
2358
|
-
|
|
2414
|
+
onError: (D) => {
|
|
2415
|
+
T(!1), V(D, "Could not remove the key.");
|
|
2359
2416
|
}
|
|
2360
2417
|
}
|
|
2361
2418
|
);
|
|
@@ -2364,10 +2421,10 @@ function os({
|
|
|
2364
2421
|
/* @__PURE__ */ l("div", { children: [
|
|
2365
2422
|
/* @__PURE__ */ t("strong", { children: e.displayName }),
|
|
2366
2423
|
" ",
|
|
2367
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", "data-testid": `ai-key-status-${e.id}`, children: n.status }),
|
|
2368
|
-
|
|
2424
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", "data-testid": `ai-key-status-${e.id}`, children: (n == null ? void 0 : n.status) ?? e.state }),
|
|
2425
|
+
x !== void 0 && /* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", "data-testid": `ai-key-display-${e.id}`, children: [
|
|
2369
2426
|
" ",
|
|
2370
|
-
|
|
2427
|
+
x
|
|
2371
2428
|
] })
|
|
2372
2429
|
] }),
|
|
2373
2430
|
/* @__PURE__ */ l("div", { className: "w6w-modal-actions", children: [
|
|
@@ -2376,30 +2433,30 @@ function os({
|
|
|
2376
2433
|
{
|
|
2377
2434
|
type: "button",
|
|
2378
2435
|
className: "w6w-btn w6w-btn-ghost",
|
|
2379
|
-
disabled:
|
|
2380
|
-
onClick:
|
|
2381
|
-
children:
|
|
2436
|
+
disabled: i.isPending,
|
|
2437
|
+
onClick: E,
|
|
2438
|
+
children: i.isPending ? "Testing…" : "Test"
|
|
2382
2439
|
}
|
|
2383
2440
|
),
|
|
2384
|
-
|
|
2441
|
+
u && /* @__PURE__ */ t(
|
|
2385
2442
|
"button",
|
|
2386
2443
|
{
|
|
2387
2444
|
type: "button",
|
|
2388
2445
|
className: "w6w-btn w6w-btn-ghost",
|
|
2389
|
-
onClick: () =>
|
|
2446
|
+
onClick: () => w((D) => !D),
|
|
2390
2447
|
children: "Replace key"
|
|
2391
2448
|
}
|
|
2392
2449
|
),
|
|
2393
|
-
/* @__PURE__ */ t(
|
|
2450
|
+
n && /* @__PURE__ */ t(
|
|
2394
2451
|
"button",
|
|
2395
2452
|
{
|
|
2396
2453
|
type: "button",
|
|
2397
2454
|
className: "w6w-btn w6w-btn-ghost",
|
|
2398
2455
|
disabled: r.isPending,
|
|
2399
|
-
onClick: () => r.mutate(
|
|
2400
|
-
onError: (
|
|
2456
|
+
onClick: () => r.mutate(R ? "active" : "disabled", {
|
|
2457
|
+
onError: (D) => V(D, "Could not change the key's status.")
|
|
2401
2458
|
}),
|
|
2402
|
-
children:
|
|
2459
|
+
children: R ? "Enable" : "Disable"
|
|
2403
2460
|
}
|
|
2404
2461
|
),
|
|
2405
2462
|
/* @__PURE__ */ t(
|
|
@@ -2407,25 +2464,25 @@ function os({
|
|
|
2407
2464
|
{
|
|
2408
2465
|
type: "button",
|
|
2409
2466
|
className: "w6w-btn w6w-btn-danger",
|
|
2410
|
-
onClick: () =>
|
|
2467
|
+
onClick: () => T(!0),
|
|
2411
2468
|
children: "Remove"
|
|
2412
2469
|
}
|
|
2413
2470
|
)
|
|
2414
2471
|
] }),
|
|
2415
|
-
|
|
2416
|
-
|
|
2472
|
+
j && /* @__PURE__ */ t("output", { "data-testid": `ai-key-test-${e.id}`, children: j === "ok" ? "Test passed" : "Test failed" }),
|
|
2473
|
+
C && u && /* @__PURE__ */ l("div", { className: "w6w-card-stack", "data-testid": `ai-key-replace-${e.id}`, children: [
|
|
2417
2474
|
/* @__PURE__ */ t(
|
|
2418
2475
|
Ce,
|
|
2419
2476
|
{
|
|
2420
|
-
fields:
|
|
2421
|
-
values:
|
|
2422
|
-
onChange: (
|
|
2477
|
+
fields: u,
|
|
2478
|
+
values: v,
|
|
2479
|
+
onChange: (D, F) => y((W) => ({ ...W, [D]: F })),
|
|
2423
2480
|
idPrefix: `w6w-ai-key-replace-${e.id}`
|
|
2424
2481
|
}
|
|
2425
2482
|
),
|
|
2426
|
-
/* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", disabled:
|
|
2483
|
+
/* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", disabled: P, onClick: _, children: P ? "Replacing…" : "Save new key" })
|
|
2427
2484
|
] }),
|
|
2428
|
-
|
|
2485
|
+
p && /* @__PURE__ */ l("div", { "data-testid": `ai-key-remove-confirm-${e.id}`, children: [
|
|
2429
2486
|
/* @__PURE__ */ l("p", { className: "w6w-small", children: [
|
|
2430
2487
|
'Remove "',
|
|
2431
2488
|
e.displayName,
|
|
@@ -2436,8 +2493,8 @@ function os({
|
|
|
2436
2493
|
{
|
|
2437
2494
|
type: "button",
|
|
2438
2495
|
className: "w6w-btn w6w-btn-danger",
|
|
2439
|
-
disabled:
|
|
2440
|
-
onClick:
|
|
2496
|
+
disabled: g.isPending,
|
|
2497
|
+
onClick: O,
|
|
2441
2498
|
children: "Confirm remove"
|
|
2442
2499
|
}
|
|
2443
2500
|
),
|
|
@@ -2447,71 +2504,71 @@ function os({
|
|
|
2447
2504
|
{
|
|
2448
2505
|
type: "button",
|
|
2449
2506
|
className: "w6w-btn w6w-btn-ghost",
|
|
2450
|
-
onClick: () =>
|
|
2507
|
+
onClick: () => T(!1),
|
|
2451
2508
|
children: "Cancel"
|
|
2452
2509
|
}
|
|
2453
2510
|
)
|
|
2454
2511
|
] }),
|
|
2455
|
-
|
|
2456
|
-
|
|
2512
|
+
$ && /* @__PURE__ */ t("output", { children: $ }),
|
|
2513
|
+
I && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", children: I })
|
|
2457
2514
|
] });
|
|
2458
2515
|
}
|
|
2459
2516
|
function Y(e) {
|
|
2460
|
-
const n =
|
|
2517
|
+
const n = Gt(e), a = e == null ? void 0 : e.code;
|
|
2461
2518
|
return n.code === void 0 && typeof a == "string" && a !== "" ? { ...n, code: a } : n;
|
|
2462
2519
|
}
|
|
2463
|
-
const
|
|
2464
|
-
function
|
|
2520
|
+
const Ye = 80;
|
|
2521
|
+
function hs(e, n) {
|
|
2465
2522
|
if (typeof URL > "u" || typeof URL.createObjectURL != "function") return;
|
|
2466
|
-
const a = URL.createObjectURL(new Blob([n], { type: "text/csv" })),
|
|
2467
|
-
|
|
2523
|
+
const a = URL.createObjectURL(new Blob([n], { type: "text/csv" })), s = document.createElement("a");
|
|
2524
|
+
s.href = a, s.download = e, s.click(), URL.revokeObjectURL(a);
|
|
2468
2525
|
}
|
|
2469
|
-
function
|
|
2470
|
-
var
|
|
2471
|
-
const a =
|
|
2526
|
+
function ws({ store: e, project: n }) {
|
|
2527
|
+
var de;
|
|
2528
|
+
const a = Zt(e), s = (a == null ? void 0 : a.columns) ?? [], i = (a == null ? void 0 : a.key) ?? "", [o, r] = f(""), [c, m] = f({}), [u, g] = f({}), [h, C] = f({}), [w, v] = f({}), [y, p] = f(null), [T, $] = f(null), [b, I] = f(null), N = ce(), j = pe(), M = gt(e.id, n, o), R = vt(), x = aa(), P = bt(), V = sa(), E = ia(), _ = (((de = M.data) == null ? void 0 : de.pages.flatMap((d) => d.items)) ?? []).map(
|
|
2472
2529
|
(d) => w[d.key] ?? d
|
|
2473
|
-
),
|
|
2474
|
-
const Z =
|
|
2475
|
-
|
|
2530
|
+
), O = new Map(_.map((d) => [d.key, d])), D = [], F = (d) => c[d], W = F(ae), k = (d, L, B) => {
|
|
2531
|
+
const Z = B === void 0 ? null : ye(B, s);
|
|
2532
|
+
D.push({
|
|
2476
2533
|
id: d,
|
|
2477
2534
|
isNew: d === ae,
|
|
2478
|
-
cells:
|
|
2479
|
-
version:
|
|
2480
|
-
dirty: Z === null ? !0 :
|
|
2481
|
-
conflict:
|
|
2482
|
-
cellErrors:
|
|
2535
|
+
cells: L.cells,
|
|
2536
|
+
version: L.version,
|
|
2537
|
+
dirty: Z === null ? !0 : sn(L, Z, s).length > 0,
|
|
2538
|
+
conflict: h[d] === !0,
|
|
2539
|
+
cellErrors: u[d]
|
|
2483
2540
|
});
|
|
2484
2541
|
};
|
|
2485
|
-
W !== void 0 &&
|
|
2486
|
-
for (const d of
|
|
2487
|
-
|
|
2488
|
-
const
|
|
2489
|
-
g((
|
|
2490
|
-
},
|
|
2491
|
-
|
|
2542
|
+
W !== void 0 && k(ae, W, void 0);
|
|
2543
|
+
for (const d of _)
|
|
2544
|
+
k(d.key, F(d.key) ?? ye(d, s), d);
|
|
2545
|
+
const S = (d) => {
|
|
2546
|
+
g((L) => se(L, d)), C((L) => se(L, d));
|
|
2547
|
+
}, K = (d) => {
|
|
2548
|
+
m((L) => se(L, d)), S(d);
|
|
2492
2549
|
};
|
|
2493
|
-
function J(d,
|
|
2494
|
-
const Z =
|
|
2495
|
-
|
|
2496
|
-
const ne =
|
|
2497
|
-
if (ne === void 0 || !(
|
|
2498
|
-
const
|
|
2499
|
-
return Object.keys(
|
|
2550
|
+
function J(d, L, B) {
|
|
2551
|
+
const Z = O.get(d), z = F(d) ?? (Z ? ye(Z, s) : Ke(s));
|
|
2552
|
+
m((U) => ({ ...U, [d]: { ...z, cells: { ...z.cells, [L]: B } } })), g((U) => {
|
|
2553
|
+
const ne = U[d];
|
|
2554
|
+
if (ne === void 0 || !(L in ne)) return U;
|
|
2555
|
+
const ue = se(ne, L);
|
|
2556
|
+
return Object.keys(ue).length === 0 ? se(U, d) : { ...U, [d]: ue };
|
|
2500
2557
|
});
|
|
2501
2558
|
}
|
|
2502
|
-
async function
|
|
2503
|
-
const
|
|
2504
|
-
if (
|
|
2505
|
-
p(null),
|
|
2506
|
-
const Z =
|
|
2559
|
+
async function A(d) {
|
|
2560
|
+
const L = O.get(d), B = F(d) ?? (L ? ye(L, s) : void 0);
|
|
2561
|
+
if (B === void 0) return;
|
|
2562
|
+
p(null), S(d);
|
|
2563
|
+
const Z = rn(B, s);
|
|
2507
2564
|
if (!Z.ok) {
|
|
2508
|
-
g((
|
|
2565
|
+
g((U) => ({ ...U, [d]: Z.errors }));
|
|
2509
2566
|
return;
|
|
2510
2567
|
}
|
|
2511
|
-
const z =
|
|
2512
|
-
|
|
2568
|
+
const z = on(
|
|
2569
|
+
B,
|
|
2513
2570
|
Z.value,
|
|
2514
|
-
|
|
2571
|
+
et((L == null ? void 0 : L.expiresAt) ?? null, Date.now())
|
|
2515
2572
|
);
|
|
2516
2573
|
try {
|
|
2517
2574
|
z.kind === "insert" ? await x.mutateAsync({
|
|
@@ -2526,206 +2583,206 @@ function ds({ store: e, project: n }) {
|
|
|
2526
2583
|
ifVersion: z.ifVersion,
|
|
2527
2584
|
ttlSeconds: z.ttlSeconds,
|
|
2528
2585
|
project: n
|
|
2529
|
-
}), v((
|
|
2530
|
-
} catch (
|
|
2531
|
-
const ne = Y(
|
|
2532
|
-
if (
|
|
2533
|
-
|
|
2586
|
+
}), v((U) => se(U, d)), K(d);
|
|
2587
|
+
} catch (U) {
|
|
2588
|
+
const ne = Y(U);
|
|
2589
|
+
if (tt(ne)) {
|
|
2590
|
+
C((Ie) => ({ ...Ie, [d]: !0 }));
|
|
2534
2591
|
return;
|
|
2535
2592
|
}
|
|
2536
|
-
const
|
|
2537
|
-
if (
|
|
2538
|
-
g((Ie) => ({ ...Ie, [d]:
|
|
2593
|
+
const ue = cn(ne, s);
|
|
2594
|
+
if (ue !== null) {
|
|
2595
|
+
g((Ie) => ({ ...Ie, [d]: ue }));
|
|
2539
2596
|
return;
|
|
2540
2597
|
}
|
|
2541
2598
|
p(ne.message);
|
|
2542
2599
|
}
|
|
2543
2600
|
}
|
|
2544
|
-
async function
|
|
2601
|
+
async function Q(d) {
|
|
2545
2602
|
try {
|
|
2546
|
-
const
|
|
2547
|
-
v((
|
|
2548
|
-
} catch (
|
|
2549
|
-
p(Y(
|
|
2603
|
+
const L = await Nt(N, e.id, d, n);
|
|
2604
|
+
v((B) => ({ ...B, [d]: L })), K(d), await j.invalidateQueries({ queryKey: ["data-stores"] });
|
|
2605
|
+
} catch (L) {
|
|
2606
|
+
p(Y(L).message);
|
|
2550
2607
|
}
|
|
2551
2608
|
}
|
|
2552
2609
|
function G() {
|
|
2553
|
-
const d =
|
|
2554
|
-
|
|
2610
|
+
const d = T;
|
|
2611
|
+
$(null), d !== null && (d !== ae && P.mutate({ id: e.id, key: d, project: n }), K(d));
|
|
2555
2612
|
}
|
|
2556
2613
|
async function te(d) {
|
|
2557
|
-
|
|
2614
|
+
I(null);
|
|
2558
2615
|
try {
|
|
2559
|
-
const
|
|
2560
|
-
|
|
2561
|
-
} catch (
|
|
2562
|
-
const
|
|
2563
|
-
|
|
2564
|
-
typeof
|
|
2616
|
+
const L = await V.mutateAsync({ id: e.id, csv: await d.text(), project: n });
|
|
2617
|
+
I(Fe({ status: 200, text: JSON.stringify(L) }));
|
|
2618
|
+
} catch (L) {
|
|
2619
|
+
const B = L;
|
|
2620
|
+
I(
|
|
2621
|
+
typeof B.status == "number" ? Fe({ status: B.status, text: JSON.stringify(B.raw ?? null) }) : { ok: !1, message: Y(L).message }
|
|
2565
2622
|
);
|
|
2566
2623
|
}
|
|
2567
2624
|
}
|
|
2568
|
-
async function
|
|
2625
|
+
async function fe() {
|
|
2569
2626
|
try {
|
|
2570
|
-
const d = await
|
|
2571
|
-
|
|
2627
|
+
const d = await E.mutateAsync({ id: e.id, project: n });
|
|
2628
|
+
hs(ln(null, e.name), d), I(null);
|
|
2572
2629
|
} catch (d) {
|
|
2573
|
-
|
|
2630
|
+
I({ ok: !1, message: Y(d).message });
|
|
2574
2631
|
}
|
|
2575
2632
|
}
|
|
2576
2633
|
return /* @__PURE__ */ l("div", { children: [
|
|
2577
2634
|
/* @__PURE__ */ t(
|
|
2578
|
-
|
|
2635
|
+
Xt,
|
|
2579
2636
|
{
|
|
2580
2637
|
result: b,
|
|
2581
|
-
busy:
|
|
2638
|
+
busy: E.isPending,
|
|
2582
2639
|
onImport: te,
|
|
2583
|
-
onRefuse: (d) =>
|
|
2584
|
-
onExport:
|
|
2640
|
+
onRefuse: (d) => I({ ok: !1, message: d }),
|
|
2641
|
+
onExport: fe
|
|
2585
2642
|
}
|
|
2586
2643
|
),
|
|
2587
2644
|
/* @__PURE__ */ t(
|
|
2588
|
-
|
|
2645
|
+
en,
|
|
2589
2646
|
{
|
|
2590
|
-
columns:
|
|
2591
|
-
keyColumn:
|
|
2592
|
-
rows:
|
|
2647
|
+
columns: s,
|
|
2648
|
+
keyColumn: i,
|
|
2649
|
+
rows: D,
|
|
2593
2650
|
error: y,
|
|
2594
|
-
loading:
|
|
2595
|
-
hasMore:
|
|
2651
|
+
loading: M.isPending,
|
|
2652
|
+
hasMore: M.hasNextPage,
|
|
2596
2653
|
empty: /* @__PURE__ */ t("p", { className: "muted small", children: "No rows match this key prefix." }),
|
|
2597
2654
|
onCellChange: J,
|
|
2598
|
-
onSave: (d) => void
|
|
2599
|
-
onDelete:
|
|
2600
|
-
onReload: (d) => void
|
|
2655
|
+
onSave: (d) => void A(d),
|
|
2656
|
+
onDelete: $,
|
|
2657
|
+
onReload: (d) => void Q(d),
|
|
2601
2658
|
onAddRow: () => {
|
|
2602
|
-
ae in c || (
|
|
2659
|
+
ae in c || (m((d) => ({ ...d, [ae]: Ke(s) })), p(null));
|
|
2603
2660
|
},
|
|
2604
|
-
onLoadMore: () => void
|
|
2661
|
+
onLoadMore: () => void M.fetchNextPage(),
|
|
2605
2662
|
onSearch: r
|
|
2606
2663
|
}
|
|
2607
2664
|
),
|
|
2608
|
-
|
|
2609
|
-
|
|
2665
|
+
T !== null && /* @__PURE__ */ t(
|
|
2666
|
+
Ne,
|
|
2610
2667
|
{
|
|
2611
2668
|
title: "Delete entry",
|
|
2612
|
-
message:
|
|
2669
|
+
message: T === ae ? "Discard this unsaved row?" : `Delete "${T}"? This cannot be undone.`,
|
|
2613
2670
|
confirmLabel: "Delete",
|
|
2614
2671
|
onConfirm: G,
|
|
2615
|
-
onClose: () =>
|
|
2672
|
+
onClose: () => $(null)
|
|
2616
2673
|
}
|
|
2617
2674
|
)
|
|
2618
2675
|
] });
|
|
2619
2676
|
}
|
|
2620
|
-
function
|
|
2677
|
+
function ps({ store: e, project: n }) {
|
|
2621
2678
|
var J;
|
|
2622
|
-
const a = e.kind === "doc",
|
|
2623
|
-
(
|
|
2624
|
-
),
|
|
2625
|
-
const
|
|
2626
|
-
return
|
|
2679
|
+
const a = e.kind === "doc", s = tn(e), [i, o] = f(""), [r, c] = f(null), [m, u] = f(!1), [g, h] = f(""), [C, w] = f(""), [v, y] = f(null), [p, T] = f(!1), [$, b] = f({}), [I, N] = f(null), j = ce(), M = pe(), R = gt(e.id, n, i), x = vt(), P = bt(), V = (((J = R.data) == null ? void 0 : J.pages.flatMap((A) => A.items)) ?? []).map(
|
|
2680
|
+
(A) => $[A.key] ?? A
|
|
2681
|
+
), E = r === null ? void 0 : V.find((A) => A.key === r), _ = m || r !== null, O = (A) => a ? JSON.stringify(A.value ?? null, null, 2) : mn(s, A.value), D = (A) => {
|
|
2682
|
+
const Q = O(A).replace(/\s+/g, " ");
|
|
2683
|
+
return Q.length > Ye ? `${Q.slice(0, Ye)}…` : Q;
|
|
2627
2684
|
};
|
|
2628
|
-
function
|
|
2629
|
-
c(
|
|
2685
|
+
function F(A) {
|
|
2686
|
+
c(A.key), u(!1), w(O(A)), y(null), T(!1);
|
|
2630
2687
|
}
|
|
2631
2688
|
function W() {
|
|
2632
|
-
c(null),
|
|
2689
|
+
c(null), u(!1), h(""), w(""), y(null), T(!1);
|
|
2633
2690
|
}
|
|
2634
|
-
async function
|
|
2635
|
-
y(null),
|
|
2636
|
-
const
|
|
2637
|
-
if (!
|
|
2638
|
-
y(
|
|
2691
|
+
async function k() {
|
|
2692
|
+
y(null), T(!1);
|
|
2693
|
+
const A = a ? dn(C) : un(s, C);
|
|
2694
|
+
if (!A.ok) {
|
|
2695
|
+
y(A.message);
|
|
2639
2696
|
return;
|
|
2640
2697
|
}
|
|
2641
|
-
const
|
|
2642
|
-
if (
|
|
2698
|
+
const Q = m ? g.trim() : r;
|
|
2699
|
+
if (Q === null || Q === "") {
|
|
2643
2700
|
y("Enter a key.");
|
|
2644
2701
|
return;
|
|
2645
2702
|
}
|
|
2646
2703
|
try {
|
|
2647
2704
|
await x.mutateAsync({
|
|
2648
2705
|
id: e.id,
|
|
2649
|
-
key:
|
|
2650
|
-
value:
|
|
2706
|
+
key: Q,
|
|
2707
|
+
value: A.value,
|
|
2651
2708
|
// A new entry must not exist yet; an existing one is guarded by the version loaded.
|
|
2652
|
-
ifVersion:
|
|
2653
|
-
ttlSeconds:
|
|
2709
|
+
ifVersion: m ? 0 : (E == null ? void 0 : E.version) ?? 0,
|
|
2710
|
+
ttlSeconds: m ? void 0 : et((E == null ? void 0 : E.expiresAt) ?? null, Date.now()),
|
|
2654
2711
|
project: n
|
|
2655
|
-
}), b((G) => se(G,
|
|
2712
|
+
}), b((G) => se(G, Q)), W();
|
|
2656
2713
|
} catch (G) {
|
|
2657
2714
|
const te = Y(G);
|
|
2658
|
-
|
|
2715
|
+
tt(te) ? T(!0) : y(te.message);
|
|
2659
2716
|
}
|
|
2660
2717
|
}
|
|
2661
|
-
async function
|
|
2718
|
+
async function S() {
|
|
2662
2719
|
if (r !== null)
|
|
2663
2720
|
try {
|
|
2664
|
-
const
|
|
2665
|
-
b((
|
|
2666
|
-
} catch (
|
|
2667
|
-
y(Y(
|
|
2721
|
+
const A = await Nt(j, e.id, r, n);
|
|
2722
|
+
b((Q) => ({ ...Q, [r]: A })), w(O(A)), T(!1), y(null), await M.invalidateQueries({ queryKey: ["data-stores"] });
|
|
2723
|
+
} catch (A) {
|
|
2724
|
+
y(Y(A).message);
|
|
2668
2725
|
}
|
|
2669
2726
|
}
|
|
2670
|
-
async function
|
|
2671
|
-
const
|
|
2672
|
-
if (
|
|
2727
|
+
async function K() {
|
|
2728
|
+
const A = I;
|
|
2729
|
+
if (N(null), A !== null)
|
|
2673
2730
|
try {
|
|
2674
|
-
await
|
|
2675
|
-
} catch (
|
|
2676
|
-
y(Y(
|
|
2731
|
+
await P.mutateAsync({ id: e.id, key: A, project: n }), A === r && W();
|
|
2732
|
+
} catch (Q) {
|
|
2733
|
+
y(Y(Q).message);
|
|
2677
2734
|
}
|
|
2678
2735
|
}
|
|
2679
2736
|
return /* @__PURE__ */ l("div", { children: [
|
|
2680
2737
|
/* @__PURE__ */ t(
|
|
2681
|
-
|
|
2738
|
+
nn,
|
|
2682
2739
|
{
|
|
2683
|
-
rows:
|
|
2740
|
+
rows: V.map((A) => ({ key: A.key, version: A.version, preview: D(A) })),
|
|
2684
2741
|
loading: R.isPending,
|
|
2685
2742
|
empty: /* @__PURE__ */ t("p", { className: "muted small", children: "No entries match this key prefix." }),
|
|
2686
2743
|
hasMore: R.hasNextPage,
|
|
2687
|
-
onOpen: (
|
|
2688
|
-
const
|
|
2689
|
-
|
|
2744
|
+
onOpen: (A) => {
|
|
2745
|
+
const Q = V.find((G) => G.key === A);
|
|
2746
|
+
Q && F(Q);
|
|
2690
2747
|
},
|
|
2691
2748
|
onSearch: o,
|
|
2692
2749
|
onNew: () => {
|
|
2693
|
-
c(null),
|
|
2750
|
+
c(null), u(!0), h(""), w(""), y(null), T(!1);
|
|
2694
2751
|
},
|
|
2695
2752
|
onLoadMore: () => void R.fetchNextPage()
|
|
2696
2753
|
}
|
|
2697
2754
|
),
|
|
2698
|
-
|
|
2699
|
-
|
|
2755
|
+
_ && /* @__PURE__ */ t(
|
|
2756
|
+
an,
|
|
2700
2757
|
{
|
|
2701
2758
|
kind: a ? "doc" : "kv",
|
|
2702
|
-
isNew:
|
|
2759
|
+
isNew: m,
|
|
2703
2760
|
entryKey: r ?? void 0,
|
|
2704
2761
|
newKey: g,
|
|
2705
|
-
version: (
|
|
2706
|
-
expiresAt: (
|
|
2707
|
-
text:
|
|
2762
|
+
version: (E == null ? void 0 : E.version) ?? null,
|
|
2763
|
+
expiresAt: (E == null ? void 0 : E.expiresAt) ?? null,
|
|
2764
|
+
text: C,
|
|
2708
2765
|
error: v,
|
|
2709
2766
|
conflict: p,
|
|
2710
|
-
saving: x.isPending ||
|
|
2711
|
-
onDelete:
|
|
2712
|
-
onTextChange: (
|
|
2713
|
-
w(
|
|
2767
|
+
saving: x.isPending || P.isPending,
|
|
2768
|
+
onDelete: m ? void 0 : () => N(r),
|
|
2769
|
+
onTextChange: (A) => {
|
|
2770
|
+
w(A), y(null);
|
|
2714
2771
|
},
|
|
2715
|
-
onKeyChange:
|
|
2716
|
-
onSave: () => void
|
|
2772
|
+
onKeyChange: h,
|
|
2773
|
+
onSave: () => void k(),
|
|
2717
2774
|
onCancel: W,
|
|
2718
|
-
onReload: () => void
|
|
2775
|
+
onReload: () => void S()
|
|
2719
2776
|
}
|
|
2720
2777
|
),
|
|
2721
|
-
|
|
2722
|
-
|
|
2778
|
+
I !== null && /* @__PURE__ */ t(
|
|
2779
|
+
Ne,
|
|
2723
2780
|
{
|
|
2724
2781
|
title: "Delete entry",
|
|
2725
|
-
message: `Delete "${
|
|
2782
|
+
message: `Delete "${I}"? This cannot be undone.`,
|
|
2726
2783
|
confirmLabel: "Delete",
|
|
2727
|
-
onConfirm:
|
|
2728
|
-
onClose: () =>
|
|
2784
|
+
onConfirm: K,
|
|
2785
|
+
onClose: () => N(null)
|
|
2729
2786
|
}
|
|
2730
2787
|
)
|
|
2731
2788
|
] });
|
|
@@ -2735,10 +2792,10 @@ function se(e, n) {
|
|
|
2735
2792
|
const a = { ...e };
|
|
2736
2793
|
return delete a[n], a;
|
|
2737
2794
|
}
|
|
2738
|
-
function
|
|
2739
|
-
const
|
|
2795
|
+
function ii({ id: e, project: n, slots: a }) {
|
|
2796
|
+
const s = X(n), i = na(e, s ?? void 0), o = i.data;
|
|
2740
2797
|
let r;
|
|
2741
|
-
|
|
2798
|
+
s == null ? r = /* @__PURE__ */ t("p", { className: "muted", children: "No project selected." }) : i.isError ? r = /* @__PURE__ */ t("p", { className: "result error", children: Y(i.error).message }) : o === void 0 ? r = /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : o.kind === "table" ? r = /* @__PURE__ */ t(ws, { store: o, project: s }, o.id) : r = /* @__PURE__ */ t(ps, { store: o, project: s }, o.id);
|
|
2742
2799
|
const c = (a == null ? void 0 : a.header) === void 0 ? o && /* @__PURE__ */ l("div", { children: [
|
|
2743
2800
|
/* @__PURE__ */ t("h3", { children: o.name }),
|
|
2744
2801
|
/* @__PURE__ */ l("p", { className: "muted small", children: [
|
|
@@ -2754,37 +2811,37 @@ function ti({ id: e, project: n, slots: a }) {
|
|
|
2754
2811
|
r
|
|
2755
2812
|
] }) });
|
|
2756
2813
|
}
|
|
2757
|
-
const
|
|
2758
|
-
function
|
|
2759
|
-
const [n, a] = f(""), [
|
|
2760
|
-
function
|
|
2761
|
-
v({}), p({}),
|
|
2762
|
-
const
|
|
2814
|
+
const fs = ["name", "kind", "description", "schema"];
|
|
2815
|
+
function ys(e) {
|
|
2816
|
+
const [n, a] = f(""), [s, i] = f(""), [o, r] = f("kv"), [c, m] = f("string"), [u, g] = f([]), [h, C] = f(""), [w, v] = f({}), [y, p] = f({}), [T, $] = f(null), b = oa();
|
|
2817
|
+
function I() {
|
|
2818
|
+
v({}), p({}), $(null);
|
|
2819
|
+
const N = {
|
|
2763
2820
|
kind: o,
|
|
2764
2821
|
name: n
|
|
2765
2822
|
};
|
|
2766
|
-
o === "kv" && (
|
|
2823
|
+
o === "kv" && (N.schema = { valueType: c }), o === "table" && (N.schema = h === "" ? { columns: u } : { columns: u, key: h }), s !== "" && (N.description = s), b.mutate(
|
|
2767
2824
|
// The SDK's create body types `schema` as table columns only; the wire takes the S-2 shape
|
|
2768
2825
|
// per kind, so the kv `{valueType}` schema is passed through as the host defines it.
|
|
2769
|
-
{ input:
|
|
2826
|
+
{ input: N, project: e.project },
|
|
2770
2827
|
{
|
|
2771
2828
|
onSuccess: () => e.onClose(),
|
|
2772
2829
|
onError: (j) => {
|
|
2773
|
-
const
|
|
2774
|
-
if (R.kind === "cell" &&
|
|
2775
|
-
p({ [R.column]:
|
|
2830
|
+
const M = Y(j), R = gn(M);
|
|
2831
|
+
if (R.kind === "cell" && u.some((x) => x.name === R.column)) {
|
|
2832
|
+
p({ [R.column]: M.message });
|
|
2776
2833
|
return;
|
|
2777
2834
|
}
|
|
2778
|
-
if (R.kind === "field" &&
|
|
2779
|
-
v({ [R.field]:
|
|
2835
|
+
if (R.kind === "field" && fs.includes(R.field)) {
|
|
2836
|
+
v({ [R.field]: M.message });
|
|
2780
2837
|
return;
|
|
2781
2838
|
}
|
|
2782
|
-
|
|
2839
|
+
$(M.message);
|
|
2783
2840
|
}
|
|
2784
2841
|
}
|
|
2785
2842
|
);
|
|
2786
2843
|
}
|
|
2787
|
-
return /* @__PURE__ */ l(
|
|
2844
|
+
return /* @__PURE__ */ l(Mn, { title: "New data store", onClose: e.onClose, children: [
|
|
2788
2845
|
/* @__PURE__ */ l("div", { className: "modal-body", children: [
|
|
2789
2846
|
/* @__PURE__ */ l("label", { className: "field", children: [
|
|
2790
2847
|
/* @__PURE__ */ t("span", { children: "Name" }),
|
|
@@ -2794,7 +2851,7 @@ function hs(e) {
|
|
|
2794
2851
|
type: "text",
|
|
2795
2852
|
"data-testid": "data-store-name",
|
|
2796
2853
|
value: n,
|
|
2797
|
-
onChange: (
|
|
2854
|
+
onChange: (N) => a(N.target.value),
|
|
2798
2855
|
placeholder: "e.g. counters"
|
|
2799
2856
|
}
|
|
2800
2857
|
)
|
|
@@ -2806,8 +2863,8 @@ function hs(e) {
|
|
|
2806
2863
|
"input",
|
|
2807
2864
|
{
|
|
2808
2865
|
type: "text",
|
|
2809
|
-
value:
|
|
2810
|
-
onChange: (
|
|
2866
|
+
value: s,
|
|
2867
|
+
onChange: (N) => i(N.target.value),
|
|
2811
2868
|
placeholder: "What this store holds"
|
|
2812
2869
|
}
|
|
2813
2870
|
)
|
|
@@ -2819,10 +2876,10 @@ function hs(e) {
|
|
|
2819
2876
|
{
|
|
2820
2877
|
"data-testid": "data-store-kind",
|
|
2821
2878
|
value: o,
|
|
2822
|
-
onChange: (
|
|
2823
|
-
r(
|
|
2879
|
+
onChange: (N) => {
|
|
2880
|
+
r(N.target.value), C("");
|
|
2824
2881
|
},
|
|
2825
|
-
children:
|
|
2882
|
+
children: wn.map((N) => /* @__PURE__ */ t("option", { value: N, children: pn[N] }, N))
|
|
2826
2883
|
}
|
|
2827
2884
|
),
|
|
2828
2885
|
/* @__PURE__ */ t("span", { className: "hint", children: "The kind is fixed once the store exists." })
|
|
@@ -2830,20 +2887,20 @@ function hs(e) {
|
|
|
2830
2887
|
w.kind !== void 0 && /* @__PURE__ */ t("div", { className: "result error", children: w.kind }),
|
|
2831
2888
|
o === "kv" && /* @__PURE__ */ l("label", { className: "field", children: [
|
|
2832
2889
|
/* @__PURE__ */ t("span", { children: "Value type" }),
|
|
2833
|
-
/* @__PURE__ */ t("select", { value: c, onChange: (
|
|
2890
|
+
/* @__PURE__ */ t("select", { value: c, onChange: (N) => m(N.target.value), children: fn.map((N) => /* @__PURE__ */ t("option", { value: N, children: N }, N)) })
|
|
2834
2891
|
] }),
|
|
2835
2892
|
o === "table" && /* @__PURE__ */ t(
|
|
2836
|
-
|
|
2893
|
+
yn,
|
|
2837
2894
|
{
|
|
2838
|
-
columns:
|
|
2895
|
+
columns: u,
|
|
2839
2896
|
onChange: g,
|
|
2840
|
-
keyColumn:
|
|
2841
|
-
onKeyColumnChange:
|
|
2897
|
+
keyColumn: h,
|
|
2898
|
+
onKeyColumnChange: C,
|
|
2842
2899
|
columnErrors: y
|
|
2843
2900
|
}
|
|
2844
2901
|
),
|
|
2845
2902
|
w.schema !== void 0 && /* @__PURE__ */ t("div", { className: "result error", children: w.schema }),
|
|
2846
|
-
|
|
2903
|
+
T !== null && /* @__PURE__ */ t("div", { className: "result error", "data-testid": "data-store-form-error", children: T })
|
|
2847
2904
|
] }),
|
|
2848
2905
|
/* @__PURE__ */ l("div", { className: "modal-actions", children: [
|
|
2849
2906
|
/* @__PURE__ */ t("button", { type: "button", className: "btn ghost", onClick: e.onClose, children: "Cancel" }),
|
|
@@ -2854,29 +2911,29 @@ function hs(e) {
|
|
|
2854
2911
|
className: "btn",
|
|
2855
2912
|
"data-testid": "data-store-create",
|
|
2856
2913
|
disabled: b.isPending,
|
|
2857
|
-
onClick:
|
|
2914
|
+
onClick: I,
|
|
2858
2915
|
children: b.isPending ? "Creating…" : "Create"
|
|
2859
2916
|
}
|
|
2860
2917
|
)
|
|
2861
2918
|
] })
|
|
2862
2919
|
] });
|
|
2863
2920
|
}
|
|
2864
|
-
function
|
|
2865
|
-
const
|
|
2921
|
+
function li({ project: e, onOpen: n, getHref: a, slots: s }) {
|
|
2922
|
+
const i = X(e), o = la(i ?? void 0), r = ra(), [c, m] = f(!1), [u, g] = f(null), [h, C] = f(null), w = (s == null ? void 0 : s.header) === void 0 ? /* @__PURE__ */ l("div", { children: [
|
|
2866
2923
|
/* @__PURE__ */ t("h3", { children: "Data stores" }),
|
|
2867
2924
|
/* @__PURE__ */ t("p", { className: "muted small", children: "Key-value, document and table storage for this project." })
|
|
2868
|
-
] }) :
|
|
2925
|
+
] }) : s.header;
|
|
2869
2926
|
return /* @__PURE__ */ l("div", { className: "w6w-embed-root", children: [
|
|
2870
2927
|
/* @__PURE__ */ t(
|
|
2871
|
-
|
|
2928
|
+
hn,
|
|
2872
2929
|
{
|
|
2873
2930
|
stores: o.data ?? [],
|
|
2874
2931
|
loading: o.isLoading,
|
|
2875
|
-
error:
|
|
2932
|
+
error: h ?? (o.error != null ? Y(o.error).message : null),
|
|
2876
2933
|
onOpen: n,
|
|
2877
2934
|
getHref: a,
|
|
2878
2935
|
onArchive: (v) => {
|
|
2879
|
-
|
|
2936
|
+
C(null), g(v);
|
|
2880
2937
|
},
|
|
2881
2938
|
busy: r.isPending,
|
|
2882
2939
|
slots: {
|
|
@@ -2887,27 +2944,27 @@ function ni({ project: e, onOpen: n, getHref: a, slots: i }) {
|
|
|
2887
2944
|
type: "button",
|
|
2888
2945
|
className: "btn",
|
|
2889
2946
|
"data-testid": "data-store-new",
|
|
2890
|
-
disabled:
|
|
2891
|
-
onClick: () =>
|
|
2947
|
+
disabled: i == null,
|
|
2948
|
+
onClick: () => m(!0),
|
|
2892
2949
|
children: "+ New data store"
|
|
2893
2950
|
}
|
|
2894
2951
|
),
|
|
2895
|
-
empty:
|
|
2952
|
+
empty: s == null ? void 0 : s.empty
|
|
2896
2953
|
}
|
|
2897
2954
|
}
|
|
2898
2955
|
),
|
|
2899
|
-
c &&
|
|
2900
|
-
|
|
2901
|
-
|
|
2956
|
+
c && i != null && /* @__PURE__ */ t(ys, { project: i, onClose: () => m(!1) }),
|
|
2957
|
+
u && /* @__PURE__ */ t(
|
|
2958
|
+
Ne,
|
|
2902
2959
|
{
|
|
2903
2960
|
title: "Archive data store",
|
|
2904
|
-
message: `Archive "${
|
|
2961
|
+
message: `Archive "${u.name}" and its ${u.entryCount} ${u.entryCount === 1 ? "entry" : "entries"}? Workflows and the API can no longer reach it.`,
|
|
2905
2962
|
confirmLabel: "Archive",
|
|
2906
2963
|
onConfirm: () => {
|
|
2907
|
-
const v =
|
|
2908
|
-
g(null),
|
|
2909
|
-
{ id: v.id, project:
|
|
2910
|
-
{ onError: (y) =>
|
|
2964
|
+
const v = u;
|
|
2965
|
+
g(null), i != null && r.mutate(
|
|
2966
|
+
{ id: v.id, project: i },
|
|
2967
|
+
{ onError: (y) => C(Y(y).message) }
|
|
2911
2968
|
);
|
|
2912
2969
|
},
|
|
2913
2970
|
onClose: () => g(null)
|
|
@@ -2916,25 +2973,25 @@ function ni({ project: e, onOpen: n, getHref: a, slots: i }) {
|
|
|
2916
2973
|
] });
|
|
2917
2974
|
}
|
|
2918
2975
|
export {
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2976
|
+
Ys as ActivitySummary,
|
|
2977
|
+
Zs as ConnectionDetail,
|
|
2978
|
+
Gs as ConnectionList,
|
|
2979
|
+
ni as CredentialCreate,
|
|
2980
|
+
ai as CredentialDetail,
|
|
2981
|
+
ti as CredentialList,
|
|
2982
|
+
li as DataStoreList,
|
|
2983
|
+
ii as DataStoreView,
|
|
2984
|
+
Hs as DocumentList,
|
|
2985
|
+
Ws as EndpointList,
|
|
2986
|
+
Vs as FunctionList,
|
|
2987
|
+
Na as Logs,
|
|
2988
|
+
zs as LogsView,
|
|
2989
|
+
Xs as ModelCatalog,
|
|
2990
|
+
ei as ModelUsage,
|
|
2991
|
+
si as MyAiKeys,
|
|
2992
|
+
Us as ReliabilityBoard,
|
|
2993
|
+
ba as RunHistory,
|
|
2994
|
+
Js as ServiceDetail,
|
|
2995
|
+
Bs as WorkflowList
|
|
2939
2996
|
};
|
|
2940
2997
|
//# sourceMappingURL=lists.mjs.map
|