@w6w/embed 0.2.23 → 0.2.24
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/lib/workflow-blank.d.ts +12 -2
- package/dist/lib.mjs +41 -39
- package/dist/lists.mjs +446 -444
- package/dist/lists.mjs.map +1 -1
- package/dist/models-CK1KHd39.js.map +1 -1
- package/dist/repos/agents-studio-agents.d.ts +46 -2
- package/dist/repos/models.d.ts +36 -6
- package/dist/repos.mjs +449 -436
- package/dist/repos.mjs.map +1 -1
- package/dist/workflow-blank-BJFLdGyE.js +37 -0
- package/dist/workflow-blank-BJFLdGyE.js.map +1 -0
- package/package.json +2 -2
- package/dist/workflow-blank-CorOIrSj.js +0 -21
- package/dist/workflow-blank-CorOIrSj.js.map +0 -1
package/dist/lists.mjs
CHANGED
|
@@ -4,36 +4,36 @@ import { useState as f, useMemo as ae, useEffect as ut } from "react";
|
|
|
4
4
|
import { F as mt, E as ht } from "./CreateFunctionModal-DScxp_LN.js";
|
|
5
5
|
import { d as wt, f as pt, h as ft, b as Ke, n as ke, u as gt, m as yt } from "./endpoints-DSRo1Lc5.js";
|
|
6
6
|
import { u as G, b as Ce } from "./project-context-Tvp-La7A.js";
|
|
7
|
-
import { CallableList as vt, ReliabilityList as Nt, EmptyState as De, DataTable as $e, EditButton as Qe, DeleteButton as bt, ListItem as Ne, HealthStatusPill as ue, HistoryTimeline as kt, useW6WApi as Fe, connectionAppIdsToLookUp as qe, ConnectionList as Ct, AddConnectionModal as Dt, EditConnectionModal as _e, Modal as $t, resolveConnectionAppMeta as Tt, ConnectionHeader as Lt, IconButton as Mt, locateDataStoreError as
|
|
7
|
+
import { CallableList as vt, ReliabilityList as Nt, EmptyState as De, DataTable as $e, EditButton as Qe, DeleteButton as bt, ListItem as Ne, HealthStatusPill as ue, HistoryTimeline as kt, useW6WApi as Fe, connectionAppIdsToLookUp as qe, ConnectionList as Ct, AddConnectionModal as Dt, EditConnectionModal as _e, Modal as $t, resolveConnectionAppMeta as Tt, ConnectionHeader as Lt, IconButton as Mt, locateDataStoreError as xt, tableSchemaOf as It, draftFromEntry as ce, CsvPanel as Et, DataTableGrid as At, NEW_ROW_ID as te, newRowDraft as xe, kvValueTypeOf as Rt, DataEntryList as St, DataEntryEditor as Pt, dirtyColumns as Ot, csvFilenameOf as jt, csvImportMessage as Ie, buildRowValue as Kt, rowWriteOf as Qt, remainingTtlSeconds as We, isVersionConflict as Be, cellErrorsOf as Ft, parseDocText as qt, kvValueOf as _t, serializeCell as Wt, DataStoreList as Bt, DATA_STORE_KINDS as Ut, DATA_STORE_KIND_LABEL as Vt, SCALAR_TYPES as Ht, ColumnsEditor as Jt, errorPlacement as Yt } from "@w6w/ui";
|
|
8
8
|
import { I as zt } from "./ImportSpecModal-Cpzp8ndt.js";
|
|
9
9
|
import { i as Zt } from "./import-bindings-EUtxZ9Ti.js";
|
|
10
10
|
import { a3 as Gt, a1 as Ue, T as Xt, E as en } from "./workflows-BK6IM4if.js";
|
|
11
|
-
import {
|
|
12
|
-
import { f as
|
|
13
|
-
import { C as he, a as
|
|
14
|
-
import { D as
|
|
15
|
-
import { k as
|
|
16
|
-
import { H as
|
|
11
|
+
import { n as tn, b as nn } from "./workflow-blank-BJFLdGyE.js";
|
|
12
|
+
import { f as an, e as Ee, g as sn, b as rn, h as ln, i as on } from "./api-calls--JHyif6a.js";
|
|
13
|
+
import { C as he, a as cn, M as dn } from "./ConfirmModal-Pv2-A_3U.js";
|
|
14
|
+
import { D as un } from "./DocumentFormModal-Br4s8wmi.js";
|
|
15
|
+
import { k as mn, i as hn } from "./spec-import-SWOonsNr.js";
|
|
16
|
+
import { H as wn, a as Ve } from "./editor-apps-LZmDWMqf.js";
|
|
17
17
|
import { ApiError as He } from "@w6w/sdk";
|
|
18
18
|
import { useQueryClient as we, useInfiniteQuery as Je } from "@tanstack/react-query";
|
|
19
|
-
import { u as
|
|
20
|
-
import { M as
|
|
21
|
-
import { j as
|
|
19
|
+
import { u as pn, o as fn, k as Ye, c as be, b as ze, m as gn, p as yn } from "./connections-CzsCyIxY.js";
|
|
20
|
+
import { M as vn } from "./ModelRoutesManager-Bv6qefnq.js";
|
|
21
|
+
import { j as Nn } from "./apps-CYUgEfGf.js";
|
|
22
22
|
import { u as pe } from "./client-context-CX61Bgw-.js";
|
|
23
|
-
import { r as
|
|
24
|
-
import { n as
|
|
25
|
-
import { h as
|
|
23
|
+
import { r as bn, x as kn, p as Cn, A as Dn } from "./models-CK1KHd39.js";
|
|
24
|
+
import { n as $n, m as Tn, k as Ln, p as Mn, q as xn, v as In, o as En } from "./credentials-Cn92LGhJ.js";
|
|
25
|
+
import { h as An, k as Ze, p as Ge, o as Rn, j as Xe, n as Sn, m as Pn, g as et, i as On, u as jn, f as Kn } from "./data-stores-UeQvwVCa.js";
|
|
26
26
|
function Te(e) {
|
|
27
|
-
const { kind: n } = e, a = wt(n), [s, i] = f(!1),
|
|
28
|
-
...e.toRow(
|
|
29
|
-
id:
|
|
30
|
-
archived: Zt(
|
|
27
|
+
const { kind: n } = e, a = wt(n), [s, i] = f(!1), l = (e.rows ?? []).map((o) => ({
|
|
28
|
+
...e.toRow(o),
|
|
29
|
+
id: o.id,
|
|
30
|
+
archived: Zt(o)
|
|
31
31
|
}));
|
|
32
32
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
|
|
33
33
|
/* @__PURE__ */ t(
|
|
34
34
|
vt,
|
|
35
35
|
{
|
|
36
|
-
rows:
|
|
36
|
+
rows: l,
|
|
37
37
|
title: a.listTitle,
|
|
38
38
|
description: a.listDescription,
|
|
39
39
|
emptyCopy: a.emptyCopy,
|
|
@@ -60,9 +60,9 @@ function Te(e) {
|
|
|
60
60
|
kind: n,
|
|
61
61
|
project: e.project ?? void 0,
|
|
62
62
|
listKeys: { functionsKey: ft, endpointsKey: pt, workflowsKey: Gt },
|
|
63
|
-
onOpenImported: (
|
|
64
|
-
var
|
|
65
|
-
return (
|
|
63
|
+
onOpenImported: (o, c) => {
|
|
64
|
+
var d;
|
|
65
|
+
return (d = e.onOpen) == null ? void 0 : d.call(e, c);
|
|
66
66
|
},
|
|
67
67
|
onClose: () => i(!1)
|
|
68
68
|
}
|
|
@@ -70,7 +70,7 @@ function Te(e) {
|
|
|
70
70
|
e.children
|
|
71
71
|
] });
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function ii(e) {
|
|
74
74
|
const n = Ke(), a = G(e.project), [s, i] = f(null);
|
|
75
75
|
return /* @__PURE__ */ t(
|
|
76
76
|
Te,
|
|
@@ -80,10 +80,10 @@ function ai(e) {
|
|
|
80
80
|
loading: n.isLoading,
|
|
81
81
|
error: n.error ? String(n.error) : null,
|
|
82
82
|
project: a,
|
|
83
|
-
toRow: (
|
|
84
|
-
title:
|
|
85
|
-
description:
|
|
86
|
-
badges:
|
|
83
|
+
toRow: (l) => ({
|
|
84
|
+
title: l.displayName || l.key,
|
|
85
|
+
description: l.description,
|
|
86
|
+
badges: l.valid ? null : /* @__PURE__ */ t("span", { className: "w6w-callable-list-badge", children: "incomplete" })
|
|
87
87
|
}),
|
|
88
88
|
onOpen: e.onOpen,
|
|
89
89
|
getHref: e.getHref,
|
|
@@ -93,18 +93,18 @@ function ai(e) {
|
|
|
93
93
|
mt,
|
|
94
94
|
{
|
|
95
95
|
newId: s,
|
|
96
|
-
takenKeys: (n.data ?? []).map((
|
|
96
|
+
takenKeys: (n.data ?? []).map((l) => l.key),
|
|
97
97
|
onClose: () => i(null),
|
|
98
|
-
onCreated: (
|
|
99
|
-
var
|
|
100
|
-
i(null), (
|
|
98
|
+
onCreated: (l) => {
|
|
99
|
+
var o;
|
|
100
|
+
i(null), (o = e.onCreated) == null || o.call(e, l);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
)
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function si(e) {
|
|
108
108
|
const n = gt(), a = G(e.project), [s, i] = f(null);
|
|
109
109
|
return /* @__PURE__ */ t(
|
|
110
110
|
Te,
|
|
@@ -114,12 +114,12 @@ function ii(e) {
|
|
|
114
114
|
loading: n.isLoading,
|
|
115
115
|
error: n.error ? String(n.error) : null,
|
|
116
116
|
project: a,
|
|
117
|
-
toRow: (
|
|
117
|
+
toRow: (l) => ({
|
|
118
118
|
// The draft tag sits INSIDE the title, after the name: ui `ListItem` puts `badges` in
|
|
119
119
|
// a trailing `margin-left: auto` slot, which would strand it at the row's far edge.
|
|
120
120
|
title: /* @__PURE__ */ r(Q, { children: [
|
|
121
|
-
/* @__PURE__ */ t("strong", { children:
|
|
122
|
-
yt(
|
|
121
|
+
/* @__PURE__ */ t("strong", { children: l.displayName || l.key }),
|
|
122
|
+
yt(l) ? /* @__PURE__ */ t(
|
|
123
123
|
"span",
|
|
124
124
|
{
|
|
125
125
|
className: "tag warn",
|
|
@@ -129,7 +129,7 @@ function ii(e) {
|
|
|
129
129
|
}
|
|
130
130
|
) : null
|
|
131
131
|
] }),
|
|
132
|
-
description:
|
|
132
|
+
description: l.description
|
|
133
133
|
}),
|
|
134
134
|
onOpen: e.onOpen,
|
|
135
135
|
getHref: e.getHref,
|
|
@@ -139,19 +139,19 @@ function ii(e) {
|
|
|
139
139
|
ht,
|
|
140
140
|
{
|
|
141
141
|
newId: s,
|
|
142
|
-
takenKeys: (n.data ?? []).map((
|
|
142
|
+
takenKeys: (n.data ?? []).map((l) => l.key),
|
|
143
143
|
onClose: () => i(null),
|
|
144
|
-
onCreated: (
|
|
145
|
-
var
|
|
146
|
-
i(null), (
|
|
144
|
+
onCreated: (l) => {
|
|
145
|
+
var o;
|
|
146
|
+
i(null), (o = e.onCreated) == null || o.call(e, l);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
)
|
|
150
150
|
}
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
const n = G(e.project), a = Ue(n ?? void 0, n != null), s = Xt(n ?? void 0), [i,
|
|
153
|
+
function ri(e) {
|
|
154
|
+
const n = G(e.project), a = Ue(n ?? void 0, n != null), s = Xt(n ?? void 0), [i, l] = f(null);
|
|
155
155
|
return /* @__PURE__ */ t(
|
|
156
156
|
Te,
|
|
157
157
|
{
|
|
@@ -160,28 +160,30 @@ function si(e) {
|
|
|
160
160
|
loading: a.isLoading,
|
|
161
161
|
error: i ?? (a.error ? String(a.error) : null),
|
|
162
162
|
project: n,
|
|
163
|
-
toRow: (
|
|
164
|
-
title:
|
|
165
|
-
description:
|
|
163
|
+
toRow: (o) => ({
|
|
164
|
+
title: o.displayName || o.name,
|
|
165
|
+
description: o.description,
|
|
166
166
|
badges: /* @__PURE__ */ r(Q, { children: [
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
o.tags.length > 0 && /* @__PURE__ */ t("span", { className: "wf-row-tags", children: o.tags.map((c) => /* @__PURE__ */ t("span", { className: "tag", children: c }, c)) }),
|
|
168
|
+
o.status !== "archived" && /* @__PURE__ */ t("span", { className: `badge wf-status ${o.status}`, children: o.status })
|
|
169
169
|
] }),
|
|
170
170
|
trailing: /* @__PURE__ */ r("span", { className: "wf-col wf-col-stats muted small", children: [
|
|
171
|
-
|
|
171
|
+
o.runCount,
|
|
172
172
|
" ",
|
|
173
|
-
|
|
173
|
+
o.runCount === 1 ? "run" : "runs"
|
|
174
174
|
] })
|
|
175
175
|
}),
|
|
176
176
|
onOpen: e.onOpen,
|
|
177
177
|
getHref: e.getHref,
|
|
178
178
|
onCreate: () => {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
l(null);
|
|
180
|
+
const o = tn((a.data ?? []).map((c) => c.displayName || c.name));
|
|
181
|
+
s.mutate(nn(ke("workflow"), o), {
|
|
182
|
+
onSuccess: (c) => {
|
|
183
|
+
var d;
|
|
184
|
+
return (d = e.onCreated) == null ? void 0 : d.call(e, c.workflow.id);
|
|
183
185
|
},
|
|
184
|
-
onError: (
|
|
186
|
+
onError: (c) => l(c instanceof Error ? c.message : String(c))
|
|
185
187
|
});
|
|
186
188
|
},
|
|
187
189
|
creating: s.isPending,
|
|
@@ -189,20 +191,20 @@ function si(e) {
|
|
|
189
191
|
}
|
|
190
192
|
);
|
|
191
193
|
}
|
|
192
|
-
function
|
|
194
|
+
function li({
|
|
193
195
|
project: e,
|
|
194
196
|
variant: n = "full",
|
|
195
197
|
limit: a,
|
|
196
198
|
days: s = 30,
|
|
197
199
|
showChart: i,
|
|
198
|
-
getHref:
|
|
199
|
-
onOpen:
|
|
200
|
+
getHref: l,
|
|
201
|
+
onOpen: o,
|
|
200
202
|
showAllHref: c,
|
|
201
|
-
onShowAll:
|
|
203
|
+
onShowAll: d,
|
|
202
204
|
slots: h
|
|
203
205
|
}) {
|
|
204
206
|
var g, w;
|
|
205
|
-
const N = Ce().project,
|
|
207
|
+
const N = Ce().project, u = e === void 0 ? N : e, k = u || null, b = an(k ?? void 0, s);
|
|
206
208
|
let D = h == null ? void 0 : h.empty;
|
|
207
209
|
return k ? b.isLoading ? D = /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) : b.error && (D = /* @__PURE__ */ t("div", { className: "error", children: b.error.message })) : D = /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see its reliability." }), /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ t(
|
|
208
210
|
Nt,
|
|
@@ -213,21 +215,21 @@ function ri({
|
|
|
213
215
|
compact: n === "compact",
|
|
214
216
|
showChart: i,
|
|
215
217
|
limit: a,
|
|
216
|
-
getHref:
|
|
217
|
-
onOpen:
|
|
218
|
+
getHref: l,
|
|
219
|
+
onOpen: o,
|
|
218
220
|
showAllHref: c,
|
|
219
|
-
onShowAll:
|
|
221
|
+
onShowAll: d,
|
|
220
222
|
slots: { ...h, empty: D }
|
|
221
223
|
}
|
|
222
224
|
) });
|
|
223
225
|
}
|
|
224
|
-
function
|
|
226
|
+
function Qn(e) {
|
|
225
227
|
const n = e.replace(/\s+/g, " ").trim();
|
|
226
228
|
return n.length > 80 ? `${n.slice(0, 80)}…` : n;
|
|
227
229
|
}
|
|
228
|
-
function
|
|
230
|
+
function oi({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
229
231
|
var g;
|
|
230
|
-
const
|
|
232
|
+
const l = G(e), o = mn(l ?? void 0, l != null), c = hn(), [d, h] = f(null), [N, u] = f(null), k = (s == null ? void 0 : s.header) === void 0 ? /* @__PURE__ */ r("div", { children: [
|
|
231
233
|
/* @__PURE__ */ t("h3", { children: "Documents" }),
|
|
232
234
|
/* @__PURE__ */ t("p", { className: "muted small", children: "Each document is free-form content stored verbatim." })
|
|
233
235
|
] }) : s.header, b = (s == null ? void 0 : s.empty) === void 0 ? /* @__PURE__ */ t(De, { testId: "document-list-empty", children: "No documents yet." }) : s.empty, D = [
|
|
@@ -235,8 +237,8 @@ function li({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
|
235
237
|
key: "key",
|
|
236
238
|
header: "Document",
|
|
237
239
|
render: (w) => {
|
|
238
|
-
var
|
|
239
|
-
const y = (
|
|
240
|
+
var x;
|
|
241
|
+
const y = (x = i == null ? void 0 : i.lead) == null ? void 0 : x.call(i, w);
|
|
240
242
|
return /* @__PURE__ */ r("span", { style: { display: "flex", alignItems: "center" }, children: [
|
|
241
243
|
y,
|
|
242
244
|
/* @__PURE__ */ r(
|
|
@@ -249,7 +251,7 @@ function li({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
|
249
251
|
" ",
|
|
250
252
|
/* @__PURE__ */ t("span", { className: "tag", children: w.format }),
|
|
251
253
|
/* @__PURE__ */ r("div", { className: "muted small list-preview", children: [
|
|
252
|
-
/* @__PURE__ */ t("code", { children:
|
|
254
|
+
/* @__PURE__ */ t("code", { children: Qn(w.content) }),
|
|
253
255
|
w.description && /* @__PURE__ */ r(Q, { children: [
|
|
254
256
|
" · ",
|
|
255
257
|
w.description
|
|
@@ -267,14 +269,14 @@ function li({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
|
267
269
|
align: "right",
|
|
268
270
|
link: !1,
|
|
269
271
|
render: (w) => {
|
|
270
|
-
var
|
|
271
|
-
const y = (
|
|
272
|
+
var x, S;
|
|
273
|
+
const y = (x = i == null ? void 0 : i.footer) == null ? void 0 : x.call(i, w);
|
|
272
274
|
return (
|
|
273
275
|
// Clicks here must not reach the row's onOpen.
|
|
274
276
|
// biome-ignore lint/a11y/useKeyWithClickEvents: propagation guard only; the buttons inside are the controls.
|
|
275
277
|
/* @__PURE__ */ r("div", { onClick: ($) => $.stopPropagation(), children: [
|
|
276
278
|
/* @__PURE__ */ r("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)", justifyContent: "flex-end" }, children: [
|
|
277
|
-
/* @__PURE__ */ t(
|
|
279
|
+
/* @__PURE__ */ t(cn, { resource: { kind: "document", key: w.key } }),
|
|
278
280
|
w.shared ? (S = i == null ? void 0 : i.sharedActions) == null ? void 0 : S.call(i, w) : /* @__PURE__ */ r(Q, { children: [
|
|
279
281
|
/* @__PURE__ */ t(
|
|
280
282
|
Qe,
|
|
@@ -288,7 +290,7 @@ function li({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
|
288
290
|
bt,
|
|
289
291
|
{
|
|
290
292
|
label: "Delete",
|
|
291
|
-
onClick: () =>
|
|
293
|
+
onClick: () => u(w),
|
|
292
294
|
disabled: c.isPending,
|
|
293
295
|
"data-testid": `document-delete-${w.id}`
|
|
294
296
|
}
|
|
@@ -310,20 +312,20 @@ function li({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
|
310
312
|
{
|
|
311
313
|
type: "button",
|
|
312
314
|
className: "btn",
|
|
313
|
-
disabled:
|
|
315
|
+
disabled: l == null,
|
|
314
316
|
onClick: () => h({ mode: "create" }),
|
|
315
317
|
children: "+ Add document"
|
|
316
318
|
}
|
|
317
319
|
)
|
|
318
320
|
] }),
|
|
319
321
|
/* @__PURE__ */ r("div", { children: [
|
|
320
|
-
|
|
321
|
-
((g =
|
|
322
|
-
|
|
322
|
+
o.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
|
|
323
|
+
((g = o.data) == null ? void 0 : g.length) === 0 && b,
|
|
324
|
+
o.data != null && o.data.length > 0 && /* @__PURE__ */ t(
|
|
323
325
|
$e,
|
|
324
326
|
{
|
|
325
327
|
columns: D,
|
|
326
|
-
rows:
|
|
328
|
+
rows: o.data,
|
|
327
329
|
rowKey: (w) => w.id,
|
|
328
330
|
getRowHref: a ? (w) => a(w.id) : void 0,
|
|
329
331
|
onRowClick: n ? (w, y) => n(w.id, y) : void 0
|
|
@@ -331,11 +333,11 @@ function li({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
|
331
333
|
)
|
|
332
334
|
] })
|
|
333
335
|
] }),
|
|
334
|
-
|
|
335
|
-
|
|
336
|
+
d && /* @__PURE__ */ t(
|
|
337
|
+
un,
|
|
336
338
|
{
|
|
337
|
-
initial:
|
|
338
|
-
project:
|
|
339
|
+
initial: d.mode === "edit" ? d.d : void 0,
|
|
340
|
+
project: l,
|
|
339
341
|
onClose: () => h(null),
|
|
340
342
|
onSaved: () => h(null)
|
|
341
343
|
}
|
|
@@ -347,14 +349,14 @@ function li({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
|
347
349
|
message: `Delete the document "${N.key}"? This cannot be undone.`,
|
|
348
350
|
confirmLabel: "Delete",
|
|
349
351
|
onConfirm: () => {
|
|
350
|
-
|
|
352
|
+
l != null && c.mutate({ id: N.id, project: l }), u(null);
|
|
351
353
|
},
|
|
352
|
-
onClose: () =>
|
|
354
|
+
onClose: () => u(null)
|
|
353
355
|
}
|
|
354
356
|
)
|
|
355
357
|
] });
|
|
356
358
|
}
|
|
357
|
-
const
|
|
359
|
+
const Fn = {
|
|
358
360
|
workflow: "Workflow run",
|
|
359
361
|
workflow_step: "Workflow step",
|
|
360
362
|
connection_test: "Connection test",
|
|
@@ -366,7 +368,7 @@ const Qn = {
|
|
|
366
368
|
action: "App action"
|
|
367
369
|
};
|
|
368
370
|
function me(e) {
|
|
369
|
-
return
|
|
371
|
+
return Fn[e] ?? e;
|
|
370
372
|
}
|
|
371
373
|
const tt = {
|
|
372
374
|
workflow: "workflow",
|
|
@@ -377,26 +379,26 @@ const tt = {
|
|
|
377
379
|
endpoint: "base",
|
|
378
380
|
action: "base"
|
|
379
381
|
};
|
|
380
|
-
function
|
|
382
|
+
function qn(e) {
|
|
381
383
|
return Object.hasOwn(tt, e);
|
|
382
384
|
}
|
|
383
385
|
function nt(e) {
|
|
384
|
-
return
|
|
386
|
+
return qn(e) ? tt[e] : "base";
|
|
385
387
|
}
|
|
386
|
-
function
|
|
388
|
+
function _n(e, n) {
|
|
387
389
|
const a = /* @__PURE__ */ new Map();
|
|
388
390
|
for (const i of e ?? []) {
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
+
const l = i.displayName || i.key;
|
|
392
|
+
l && a.set(i.id, l);
|
|
391
393
|
}
|
|
392
394
|
const s = /* @__PURE__ */ new Map();
|
|
393
395
|
for (const i of n ?? []) {
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
+
const l = i.displayName || i.name;
|
|
397
|
+
l && s.set(i.id, l);
|
|
396
398
|
}
|
|
397
399
|
return { functions: a, workflows: s };
|
|
398
400
|
}
|
|
399
|
-
function
|
|
401
|
+
function Wn(e, n) {
|
|
400
402
|
const a = e.summary ?? me(e.kind), s = nt(e.kind);
|
|
401
403
|
if (s === "function" && e.functionId !== null) {
|
|
402
404
|
const i = n.functions.get(e.functionId);
|
|
@@ -409,9 +411,9 @@ function _n(e, n) {
|
|
|
409
411
|
return { text: i, target: { kind: "workflow", id: e.workflowId } };
|
|
410
412
|
}
|
|
411
413
|
if (s === "workflow_step") {
|
|
412
|
-
const i = e.workflowId,
|
|
414
|
+
const i = e.workflowId, l = i !== null ? n.workflows.get(i) : void 0, o = l ?? i ?? e.summary ?? "Unknown workflow", c = l !== void 0 && i !== null;
|
|
413
415
|
return {
|
|
414
|
-
text: e.stepId ? `${
|
|
416
|
+
text: e.stepId ? `${o} - ${e.stepId}` : o,
|
|
415
417
|
target: c ? { kind: "workflow", id: i } : null
|
|
416
418
|
};
|
|
417
419
|
}
|
|
@@ -425,11 +427,11 @@ function at(e) {
|
|
|
425
427
|
function it(e) {
|
|
426
428
|
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`;
|
|
427
429
|
}
|
|
428
|
-
function
|
|
430
|
+
function Bn() {
|
|
429
431
|
const e = /* @__PURE__ */ new Date();
|
|
430
432
|
return e.setHours(0, 0, 0, 0), e.toISOString();
|
|
431
433
|
}
|
|
432
|
-
function
|
|
434
|
+
function Un(e, n) {
|
|
433
435
|
const a = new Date(e);
|
|
434
436
|
if (Number.isNaN(a.getTime())) return e;
|
|
435
437
|
const s = a.toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
@@ -459,16 +461,16 @@ function Ae({
|
|
|
459
461
|
] })
|
|
460
462
|
] });
|
|
461
463
|
}
|
|
462
|
-
function
|
|
464
|
+
function Vn({
|
|
463
465
|
entry: e,
|
|
464
466
|
names: n,
|
|
465
467
|
getHref: a,
|
|
466
468
|
onOpen: s
|
|
467
469
|
}) {
|
|
468
|
-
const { text: i, target:
|
|
469
|
-
if (
|
|
470
|
-
const
|
|
471
|
-
return a ? /* @__PURE__ */ t("a", { href: a(
|
|
470
|
+
const { text: i, target: l } = Wn(e, n);
|
|
471
|
+
if (l === null) return /* @__PURE__ */ t(Q, { children: i });
|
|
472
|
+
const o = s ? (c) => s(l, c) : void 0;
|
|
473
|
+
return a ? /* @__PURE__ */ t("a", { href: a(l), onClick: o, children: i }) : o ? /* @__PURE__ */ t("button", { type: "button", className: "w6w-activity-link", onClick: o, children: i }) : /* @__PURE__ */ t(Q, { children: i });
|
|
472
474
|
}
|
|
473
475
|
function rt({ entry: e, title: n }) {
|
|
474
476
|
const a = it(e.durationMs);
|
|
@@ -483,24 +485,24 @@ function rt({ entry: e, title: n }) {
|
|
|
483
485
|
);
|
|
484
486
|
}
|
|
485
487
|
function ye(e) {
|
|
486
|
-
return /* @__PURE__ */ t(rt, { entry: e.entry, title: /* @__PURE__ */ t(
|
|
488
|
+
return /* @__PURE__ */ t(rt, { entry: e.entry, title: /* @__PURE__ */ t(Vn, { ...e }) });
|
|
487
489
|
}
|
|
488
|
-
const
|
|
490
|
+
const Hn = {
|
|
489
491
|
base: (e) => /* @__PURE__ */ t(rt, { entry: e.entry }),
|
|
490
492
|
function: ye,
|
|
491
493
|
workflow: ye,
|
|
492
494
|
workflow_step: ye
|
|
493
495
|
};
|
|
494
|
-
function
|
|
495
|
-
const n =
|
|
496
|
+
function Jn(e) {
|
|
497
|
+
const n = Hn[nt(e.entry.kind)];
|
|
496
498
|
return /* @__PURE__ */ t(n, { ...e });
|
|
497
499
|
}
|
|
498
|
-
function
|
|
499
|
-
var D, g, w, y,
|
|
500
|
-
const s = Ee("today", { from:
|
|
501
|
-
() =>
|
|
502
|
-
[
|
|
503
|
-
),
|
|
500
|
+
function ci({ getHref: e, onOpen: n, slots: a }) {
|
|
501
|
+
var D, g, w, y, x, S;
|
|
502
|
+
const s = Ee("today", { from: Bn(), bucket: "day" }), i = Ee("week", { bucket: "week" }), l = Ke(), o = Ue(), c = ae(
|
|
503
|
+
() => _n(l.data, o.data),
|
|
504
|
+
[l.data, o.data]
|
|
505
|
+
), d = s.error ?? i.error, h = d ? d.message : null, N = ((D = i.data) == null ? void 0 : D.recent) ?? [], u = ((g = i.data) == null ? void 0 : g.series) ?? [], k = ((w = i.data) == null ? void 0 : w.range.bucket) ?? "week", b = !i.isLoading && N.length === 0 && (((y = i.data) == null ? void 0 : y.headline.workflowRuns) ?? 0) === 0;
|
|
504
506
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
|
|
505
507
|
h && /* @__PURE__ */ t("div", { className: "error", children: h }),
|
|
506
508
|
a == null ? void 0 : a.header,
|
|
@@ -509,7 +511,7 @@ function oi({ getHref: e, onOpen: n, slots: a }) {
|
|
|
509
511
|
Ae,
|
|
510
512
|
{
|
|
511
513
|
title: "Today",
|
|
512
|
-
headline: (
|
|
514
|
+
headline: (x = s.data) == null ? void 0 : x.headline,
|
|
513
515
|
loading: s.isLoading
|
|
514
516
|
}
|
|
515
517
|
),
|
|
@@ -524,9 +526,9 @@ function oi({ getHref: e, onOpen: n, slots: a }) {
|
|
|
524
526
|
a == null ? void 0 : a.betweenHeadlineAndSeries,
|
|
525
527
|
/* @__PURE__ */ r("section", { className: "w6w-activity-section", children: [
|
|
526
528
|
/* @__PURE__ */ t("h3", { children: "Activity over time" }),
|
|
527
|
-
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children: i.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) :
|
|
529
|
+
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children: i.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : u.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No activity in this window yet." }) : /* @__PURE__ */ t("ul", { className: "list", children: u.map(($) => /* @__PURE__ */ r("li", { children: [
|
|
528
530
|
/* @__PURE__ */ r("span", { className: "list-main", children: [
|
|
529
|
-
/* @__PURE__ */ t("strong", { children:
|
|
531
|
+
/* @__PURE__ */ t("strong", { children: Un($.bucket, k) }),
|
|
530
532
|
" ",
|
|
531
533
|
/* @__PURE__ */ t("span", { className: "muted small", children: me($.kind) })
|
|
532
534
|
] }),
|
|
@@ -539,7 +541,7 @@ function oi({ getHref: e, onOpen: n, slots: a }) {
|
|
|
539
541
|
/* @__PURE__ */ r("section", { children: [
|
|
540
542
|
/* @__PURE__ */ t("h3", { className: "w6w-activity-h3", children: "Recent activity" }),
|
|
541
543
|
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children: i.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : b ? (a == null ? void 0 : a.empty) ?? /* @__PURE__ */ t("p", { className: "muted", children: "No runs yet — activity shows up here once your workflows run." }) : N.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No recent activity in this window." }) : /* @__PURE__ */ t("div", { className: "list", children: N.map(($) => /* @__PURE__ */ t(
|
|
542
|
-
|
|
544
|
+
Jn,
|
|
543
545
|
{
|
|
544
546
|
entry: $,
|
|
545
547
|
names: c,
|
|
@@ -551,33 +553,33 @@ function oi({ getHref: e, onOpen: n, slots: a }) {
|
|
|
551
553
|
] })
|
|
552
554
|
] });
|
|
553
555
|
}
|
|
554
|
-
function
|
|
556
|
+
function Yn(e) {
|
|
555
557
|
return e !== null && "project" in e;
|
|
556
558
|
}
|
|
557
|
-
function
|
|
558
|
-
const n = Ce().project, [a, s] = f(en), i = e.scope !== void 0 ? e.scope : n ? { project: n } : null,
|
|
559
|
+
function zn(e) {
|
|
560
|
+
const n = Ce().project, [a, s] = f(en), i = e.scope !== void 0 ? e.scope : n ? { project: n } : null, l = e.filters !== void 0, o = e.filters ?? a, c = (d) => {
|
|
559
561
|
var h;
|
|
560
|
-
|
|
562
|
+
l || s(d), (h = e.onFiltersChange) == null || h.call(e, d);
|
|
561
563
|
};
|
|
562
564
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ t(
|
|
563
|
-
|
|
565
|
+
wn,
|
|
564
566
|
{
|
|
565
567
|
scope: i,
|
|
566
|
-
showKind: e.showKind ??
|
|
567
|
-
filters:
|
|
568
|
+
showKind: e.showKind ?? Yn(i),
|
|
569
|
+
filters: o,
|
|
568
570
|
onFiltersChange: c,
|
|
569
571
|
onOpenInEditor: e.onOpenInEditor
|
|
570
572
|
}
|
|
571
573
|
) });
|
|
572
574
|
}
|
|
573
|
-
function
|
|
575
|
+
function Zn({ title: e = "Logs", ...n }) {
|
|
574
576
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-logs", children: [
|
|
575
577
|
e !== null && /* @__PURE__ */ t("h2", { children: e }),
|
|
576
|
-
/* @__PURE__ */ t(
|
|
578
|
+
/* @__PURE__ */ t(zn, { ...n })
|
|
577
579
|
] });
|
|
578
580
|
}
|
|
579
|
-
const
|
|
580
|
-
function
|
|
581
|
+
const di = Zn, Gn = 1440 * 60 * 1e3;
|
|
582
|
+
function Xn(e) {
|
|
581
583
|
if (!(e === null || e.timeline === null))
|
|
582
584
|
return e.timeline.map((n) => ({
|
|
583
585
|
id: n.id,
|
|
@@ -599,17 +601,17 @@ function Re(e) {
|
|
|
599
601
|
}
|
|
600
602
|
function Se(e, n) {
|
|
601
603
|
const a = new Date(e).getTime();
|
|
602
|
-
return Number.isNaN(a) ? 0 : Math.max(0, Math.floor((n - a) /
|
|
604
|
+
return Number.isNaN(a) ? 0 : Math.max(0, Math.floor((n - a) / Gn));
|
|
603
605
|
}
|
|
604
|
-
function
|
|
606
|
+
function ea(e, n) {
|
|
605
607
|
if (!lt(e) || e.startedAt === void 0) return null;
|
|
606
|
-
const a = Se(e.startedAt, n), s = Re(e.startedAt), i = a === 0 ? `open since ${s} (today)` : `open ${a}d (since ${s})`,
|
|
607
|
-
return `${i} · ${
|
|
608
|
+
const a = Se(e.startedAt, n), s = Re(e.startedAt), i = a === 0 ? `open since ${s} (today)` : `open ${a}d (since ${s})`, l = e.updatedAt ?? e.startedAt, o = Se(l, n), c = Re(l), d = o === 0 ? `last update ${c} (today)` : `last update ${c} (${o}d ago)`;
|
|
609
|
+
return `${i} · ${d}`;
|
|
608
610
|
}
|
|
609
|
-
function
|
|
611
|
+
function ta(e) {
|
|
610
612
|
return e ? Object.entries(e) : [];
|
|
611
613
|
}
|
|
612
|
-
function
|
|
614
|
+
function na(e) {
|
|
613
615
|
return e.uptime.map((n) => ({ day: n.day, state: n.state }));
|
|
614
616
|
}
|
|
615
617
|
const ie = [
|
|
@@ -639,7 +641,7 @@ function de({ label: e, value: n, hint: a }) {
|
|
|
639
641
|
a && /* @__PURE__ */ t("div", { className: "muted small", children: a })
|
|
640
642
|
] });
|
|
641
643
|
}
|
|
642
|
-
function
|
|
644
|
+
function aa({
|
|
643
645
|
vendor: e,
|
|
644
646
|
displayName: n
|
|
645
647
|
}) {
|
|
@@ -656,7 +658,7 @@ function na({
|
|
|
656
658
|
", not a gap in the data above."
|
|
657
659
|
] })
|
|
658
660
|
] });
|
|
659
|
-
const a = e.state === "unknown", s =
|
|
661
|
+
const a = e.state === "unknown", s = ta(e.components), i = (e.timeline ?? []).filter(lt), l = Date.now();
|
|
660
662
|
return /* @__PURE__ */ r("div", { className: "w6w-rel-card", children: [
|
|
661
663
|
/* @__PURE__ */ r("h4", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: [
|
|
662
664
|
n,
|
|
@@ -687,27 +689,27 @@ function na({
|
|
|
687
689
|
" ",
|
|
688
690
|
"· decided by",
|
|
689
691
|
" ",
|
|
690
|
-
e.attributedTo.map((
|
|
692
|
+
e.attributedTo.map((o) => /* @__PURE__ */ t("code", { children: o }, o))
|
|
691
693
|
] })
|
|
692
694
|
] }),
|
|
693
|
-
s.length > 0 && /* @__PURE__ */ t("div", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: s.map(([
|
|
694
|
-
|
|
695
|
+
s.length > 0 && /* @__PURE__ */ t("div", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: s.map(([o, c]) => /* @__PURE__ */ r("span", { className: "w6w-rel-tag", children: [
|
|
696
|
+
o,
|
|
695
697
|
": ",
|
|
696
698
|
c.state
|
|
697
|
-
] },
|
|
698
|
-
i.length > 0 && /* @__PURE__ */ t("ul", { className: "list", style: { margin: "var(--w6w-sp-2) 0 0" }, children: i.map((
|
|
699
|
-
/* @__PURE__ */ t("strong", { children:
|
|
699
|
+
] }, o)) }),
|
|
700
|
+
i.length > 0 && /* @__PURE__ */ t("ul", { className: "list", style: { margin: "var(--w6w-sp-2) 0 0" }, children: i.map((o) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ r("div", { className: "list-main", children: [
|
|
701
|
+
/* @__PURE__ */ t("strong", { children: o.title }),
|
|
700
702
|
" ",
|
|
701
|
-
/* @__PURE__ */ t(ue, { state:
|
|
702
|
-
/* @__PURE__ */ t("div", { className: "muted small", children:
|
|
703
|
-
] }) },
|
|
703
|
+
/* @__PURE__ */ t(ue, { state: o.state }),
|
|
704
|
+
/* @__PURE__ */ t("div", { className: "muted small", children: ea(o, l) })
|
|
705
|
+
] }) }, o.id ?? o.title)) }),
|
|
704
706
|
e.statusPageUrl !== null && /* @__PURE__ */ t("p", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: /* @__PURE__ */ r("a", { href: e.statusPageUrl, target: "_blank", rel: "noopener noreferrer", children: [
|
|
705
707
|
n,
|
|
706
708
|
"'s status page ↗"
|
|
707
709
|
] }) })
|
|
708
710
|
] });
|
|
709
711
|
}
|
|
710
|
-
function
|
|
712
|
+
function ia({ service: e }) {
|
|
711
713
|
if (e.calls === 0)
|
|
712
714
|
return /* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t("span", { className: "w6w-rel-idle-note", children: "No calls in this window" }) });
|
|
713
715
|
const n = e.uptime, a = Math.max(1, ...n.map((s) => s.calls));
|
|
@@ -732,19 +734,19 @@ function aa({ service: e }) {
|
|
|
732
734
|
/* @__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." })
|
|
733
735
|
] });
|
|
734
736
|
}
|
|
735
|
-
function
|
|
737
|
+
function sa({
|
|
736
738
|
service: e,
|
|
737
739
|
window: n
|
|
738
740
|
}) {
|
|
739
|
-
const a = [...e.uptime].reverse().filter((
|
|
741
|
+
const a = [...e.uptime].reverse().filter((o) => o.calls > 0), s = e.vendorStatus, i = Xn(s), l = i === void 0 ? `${e.displayName} publishes no incident history.` : `No incidents from ${e.displayName} in this window.`;
|
|
740
742
|
return /* @__PURE__ */ r("div", { className: "w6w-rel-card", children: [
|
|
741
743
|
/* @__PURE__ */ t(
|
|
742
744
|
kt,
|
|
743
745
|
{
|
|
744
746
|
window: n,
|
|
745
|
-
days:
|
|
747
|
+
days: na(e),
|
|
746
748
|
incidents: i,
|
|
747
|
-
vendorEmptyLabel:
|
|
749
|
+
vendorEmptyLabel: l,
|
|
748
750
|
ariaLabel: `${e.displayName}, ${e.uptime.length}-day status and ${e.displayName} incidents, oldest day first`
|
|
749
751
|
}
|
|
750
752
|
),
|
|
@@ -753,22 +755,22 @@ function ia({
|
|
|
753
755
|
/* @__PURE__ */ t("code", { children: "unknown" }),
|
|
754
756
|
" — never a quiet green."
|
|
755
757
|
] }),
|
|
756
|
-
a.length > 0 && /* @__PURE__ */ t("div", { className: "list", style: { marginTop: "var(--w6w-sp-3)" }, children: a.slice(0, 14).map((
|
|
757
|
-
/* @__PURE__ */ t("span", { style: { minWidth: 96 }, children: /* @__PURE__ */ t("strong", { children: ot(`${
|
|
758
|
-
/* @__PURE__ */ t(ue, { state:
|
|
758
|
+
a.length > 0 && /* @__PURE__ */ t("div", { className: "list", style: { marginTop: "var(--w6w-sp-3)" }, children: a.slice(0, 14).map((o) => /* @__PURE__ */ r("div", { className: "rel-day-row", children: [
|
|
759
|
+
/* @__PURE__ */ t("span", { style: { minWidth: 96 }, children: /* @__PURE__ */ t("strong", { children: ot(`${o.day}T00:00:00.000Z`) }) }),
|
|
760
|
+
/* @__PURE__ */ t(ue, { state: o.state }),
|
|
759
761
|
/* @__PURE__ */ r("span", { className: "muted small", children: [
|
|
760
|
-
|
|
762
|
+
o.calls,
|
|
761
763
|
" calls"
|
|
762
764
|
] }),
|
|
763
|
-
/* @__PURE__ */ t("span", { className: "rel-errors", children: ie.filter(([c]) =>
|
|
764
|
-
|
|
765
|
+
/* @__PURE__ */ t("span", { className: "rel-errors", children: ie.filter(([c]) => o.errors[c] > 0).map(([c, d]) => /* @__PURE__ */ r("span", { className: "w6w-rel-tag", children: [
|
|
766
|
+
d,
|
|
765
767
|
" ×",
|
|
766
|
-
|
|
768
|
+
o.errors[c]
|
|
767
769
|
] }, c)) })
|
|
768
|
-
] },
|
|
770
|
+
] }, o.day)) })
|
|
769
771
|
] });
|
|
770
772
|
}
|
|
771
|
-
function
|
|
773
|
+
function ra({ errors: e }) {
|
|
772
774
|
if (ie.reduce((s, [i]) => s + e[i], 0) === 0)
|
|
773
775
|
return /* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t("p", { className: "muted", style: { margin: 0 }, children: "No errors in this window." }) });
|
|
774
776
|
const a = Math.max(1, ...ie.map(([s]) => e[s]));
|
|
@@ -784,8 +786,8 @@ function sa({ errors: e }) {
|
|
|
784
786
|
/* @__PURE__ */ t("span", { className: "rel-errormix-value small", children: e[s] })
|
|
785
787
|
] }, s)) });
|
|
786
788
|
}
|
|
787
|
-
function
|
|
788
|
-
const a =
|
|
789
|
+
function la({ project: e, appId: n }) {
|
|
790
|
+
const a = rn(e, n, { limit: 50 });
|
|
789
791
|
if (a.isLoading) return /* @__PURE__ */ t("p", { className: "muted", children: "Loading calls…" });
|
|
790
792
|
if (a.error) {
|
|
791
793
|
const i = a.error;
|
|
@@ -800,47 +802,47 @@ function ra({ project: e, appId: n }) {
|
|
|
800
802
|
/* @__PURE__ */ t("span", { children: "Status" }),
|
|
801
803
|
/* @__PURE__ */ t("span", { children: "Took" })
|
|
802
804
|
] }),
|
|
803
|
-
s.map((i,
|
|
805
|
+
s.map((i, l) => /* @__PURE__ */ r("div", { className: "rel-call", children: [
|
|
804
806
|
/* @__PURE__ */ t("span", { className: "muted small", children: Le(i.createdAt) }),
|
|
805
807
|
/* @__PURE__ */ t("span", { children: /* @__PURE__ */ t("code", { children: i.actionKey ?? "—" }) }),
|
|
806
808
|
/* @__PURE__ */ t("span", { className: "muted small", children: i.method }),
|
|
807
809
|
/* @__PURE__ */ t("span", { className: i.status >= 400 || i.status === 0 ? "error" : "ok", children: i.status === 0 ? "no response" : i.status }),
|
|
808
810
|
/* @__PURE__ */ t("span", { className: "muted small", children: i.durationMs != null ? `${i.durationMs} ms` : "—" })
|
|
809
|
-
] }, i.id ?? `${i.createdAt}-${
|
|
811
|
+
] }, i.id ?? `${i.createdAt}-${l}`))
|
|
810
812
|
] });
|
|
811
813
|
}
|
|
812
|
-
function
|
|
814
|
+
function oa({
|
|
813
815
|
backHref: e,
|
|
814
816
|
onBack: n
|
|
815
817
|
}) {
|
|
816
818
|
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;
|
|
817
819
|
}
|
|
818
|
-
function
|
|
820
|
+
function ui({
|
|
819
821
|
appId: e,
|
|
820
822
|
project: n,
|
|
821
823
|
days: a = 30,
|
|
822
824
|
backHref: s,
|
|
823
825
|
onBack: i,
|
|
824
|
-
slots:
|
|
826
|
+
slots: l
|
|
825
827
|
}) {
|
|
826
828
|
var k, b, D, g;
|
|
827
|
-
const
|
|
829
|
+
const o = Ce().project, c = (n === void 0 ? o : n) || void 0, d = sn(c, [e], a), h = d.error, N = h ? (h instanceof He, h.message) : null, u = (k = d.data) == null ? void 0 : k.services.find((w) => w.appId === e);
|
|
828
830
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
|
|
829
|
-
|
|
830
|
-
|
|
831
|
+
l == null ? void 0 : l.header,
|
|
832
|
+
l == null ? void 0 : l.actions,
|
|
831
833
|
!c && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see this service." }),
|
|
832
834
|
N && /* @__PURE__ */ t("div", { className: "error", children: N }),
|
|
833
|
-
c &&
|
|
834
|
-
|
|
835
|
-
(
|
|
835
|
+
c && d.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
|
|
836
|
+
d.data && !u && /* @__PURE__ */ r("div", { className: "w6w-rel-card", children: [
|
|
837
|
+
(l == null ? void 0 : l.empty) ?? /* @__PURE__ */ r("p", { className: "muted", children: [
|
|
836
838
|
/* @__PURE__ */ t("code", { children: e }),
|
|
837
839
|
" is not used by this project's definitions and has no calls in the last ",
|
|
838
840
|
a,
|
|
839
841
|
" days."
|
|
840
842
|
] }),
|
|
841
|
-
/* @__PURE__ */ t(
|
|
843
|
+
/* @__PURE__ */ t(oa, { backHref: s, onBack: i })
|
|
842
844
|
] }),
|
|
843
|
-
|
|
845
|
+
u && /* @__PURE__ */ r(Q, { children: [
|
|
844
846
|
/* @__PURE__ */ r("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
|
|
845
847
|
/* @__PURE__ */ r(
|
|
846
848
|
"div",
|
|
@@ -852,55 +854,55 @@ function di({
|
|
|
852
854
|
marginBottom: "var(--w6w-sp-3)"
|
|
853
855
|
},
|
|
854
856
|
children: [
|
|
855
|
-
/* @__PURE__ */ t(ue, { state:
|
|
857
|
+
/* @__PURE__ */ t(ue, { state: u.state }),
|
|
856
858
|
/* @__PURE__ */ t("span", { className: "muted small", children: "from your calls" }),
|
|
857
|
-
/* @__PURE__ */ t("code", { className: "muted small", children:
|
|
858
|
-
|
|
859
|
+
/* @__PURE__ */ t("code", { className: "muted small", children: u.appId }),
|
|
860
|
+
u.ongoingOutageId && /* @__PURE__ */ t("span", { className: "w6w-rel-tag", children: "outage still open" })
|
|
859
861
|
]
|
|
860
862
|
}
|
|
861
863
|
),
|
|
862
864
|
/* @__PURE__ */ r("div", { style: { display: "flex", gap: "var(--w6w-sp-3)", flexWrap: "wrap" }, children: [
|
|
863
|
-
/* @__PURE__ */ t(de, { label: "Calls in window", value: String(
|
|
865
|
+
/* @__PURE__ */ t(de, { label: "Calls in window", value: String(u.calls) }),
|
|
864
866
|
/* @__PURE__ */ t(
|
|
865
867
|
de,
|
|
866
868
|
{
|
|
867
869
|
label: "p95 latency",
|
|
868
|
-
value:
|
|
869
|
-
hint:
|
|
870
|
+
value: u.p95Ms === null ? "—" : `${u.p95Ms} ms`,
|
|
871
|
+
hint: u.p95Ms === null ? "no timed calls" : void 0
|
|
870
872
|
}
|
|
871
873
|
),
|
|
872
|
-
/* @__PURE__ */ t(de, { label: "Last call", value: Le(
|
|
874
|
+
/* @__PURE__ */ t(de, { label: "Last call", value: Le(u.lastCallAt) }),
|
|
873
875
|
/* @__PURE__ */ t(
|
|
874
876
|
de,
|
|
875
877
|
{
|
|
876
878
|
label: "Errors",
|
|
877
|
-
value: String(ie.reduce((w, [y]) => w +
|
|
878
|
-
hint: ie.filter(([w]) =>
|
|
879
|
+
value: String(ie.reduce((w, [y]) => w + u.errors[y], 0)),
|
|
880
|
+
hint: ie.filter(([w]) => u.errors[w] > 0).map(([w, y]) => `${y} ×${u.errors[w]}`).join(" · ") || "none"
|
|
879
881
|
}
|
|
880
882
|
)
|
|
881
883
|
] })
|
|
882
884
|
] }),
|
|
883
885
|
/* @__PURE__ */ r("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
|
|
884
886
|
/* @__PURE__ */ t("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: "Error mix" }),
|
|
885
|
-
/* @__PURE__ */ t(
|
|
887
|
+
/* @__PURE__ */ t(ra, { errors: u.errors })
|
|
886
888
|
] }),
|
|
887
889
|
/* @__PURE__ */ r("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
|
|
888
890
|
/* @__PURE__ */ t("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: "API status" }),
|
|
889
|
-
/* @__PURE__ */ t(
|
|
891
|
+
/* @__PURE__ */ t(aa, { vendor: u.vendorStatus, displayName: u.displayName })
|
|
890
892
|
] }),
|
|
891
893
|
/* @__PURE__ */ r("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
|
|
892
894
|
/* @__PURE__ */ r("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: [
|
|
893
895
|
"Last ",
|
|
894
|
-
((b =
|
|
896
|
+
((b = d.data) == null ? void 0 : b.window.days) ?? a,
|
|
895
897
|
" days",
|
|
896
898
|
" ",
|
|
897
899
|
/* @__PURE__ */ r("span", { className: "muted small", children: [
|
|
898
900
|
"uptime means ",
|
|
899
|
-
(D =
|
|
901
|
+
(D = d.data) == null ? void 0 : D.uptimeMeans
|
|
900
902
|
] })
|
|
901
903
|
] }),
|
|
902
|
-
/* @__PURE__ */ t(
|
|
903
|
-
/* @__PURE__ */ t(
|
|
904
|
+
/* @__PURE__ */ t(sa, { service: u, window: ((g = d.data) == null ? void 0 : g.window) ?? { from: "", to: "" } }),
|
|
905
|
+
/* @__PURE__ */ t(ia, { service: u })
|
|
904
906
|
] }),
|
|
905
907
|
/* @__PURE__ */ r("section", { children: [
|
|
906
908
|
/* @__PURE__ */ r("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: [
|
|
@@ -908,12 +910,12 @@ function di({
|
|
|
908
910
|
" ",
|
|
909
911
|
/* @__PURE__ */ t("span", { className: "muted small", children: "the requests behind the numbers above" })
|
|
910
912
|
] }),
|
|
911
|
-
/* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t(
|
|
913
|
+
/* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t(la, { project: c, appId: u.appId }) })
|
|
912
914
|
] })
|
|
913
915
|
] })
|
|
914
916
|
] });
|
|
915
917
|
}
|
|
916
|
-
function
|
|
918
|
+
function ca(e) {
|
|
917
919
|
if (typeof e == "string") return e;
|
|
918
920
|
if (e && typeof e == "object") {
|
|
919
921
|
const n = e;
|
|
@@ -922,18 +924,18 @@ function oa(e) {
|
|
|
922
924
|
}
|
|
923
925
|
return String(e);
|
|
924
926
|
}
|
|
925
|
-
function
|
|
927
|
+
function da({
|
|
926
928
|
routes: e,
|
|
927
929
|
projectId: n
|
|
928
930
|
}) {
|
|
929
|
-
const [a, s] = f(null), i = e.find((
|
|
931
|
+
const [a, s] = f(null), i = e.find((l) => l.id === a);
|
|
930
932
|
return e.length === 0 ? null : /* @__PURE__ */ r(Q, { children: [
|
|
931
|
-
/* @__PURE__ */ t("ul", { className: "list small", "data-testid": "connection-dependent-routes", children: e.map((
|
|
933
|
+
/* @__PURE__ */ t("ul", { className: "list small", "data-testid": "connection-dependent-routes", children: e.map((l) => /* @__PURE__ */ r("li", { "data-testid": `connection-dependent-route-${l.id}`, children: [
|
|
932
934
|
/* @__PURE__ */ t("span", { className: "badge", children: "route" }),
|
|
933
935
|
" ",
|
|
934
|
-
/* @__PURE__ */ t("span", { children:
|
|
936
|
+
/* @__PURE__ */ t("span", { children: l.name }),
|
|
935
937
|
" ",
|
|
936
|
-
|
|
938
|
+
l.status === "broken" && /* @__PURE__ */ r(Q, { children: [
|
|
937
939
|
/* @__PURE__ */ t("span", { className: "tag warn", children: "broken" }),
|
|
938
940
|
" ",
|
|
939
941
|
/* @__PURE__ */ t(
|
|
@@ -941,15 +943,15 @@ function ca({
|
|
|
941
943
|
{
|
|
942
944
|
type: "button",
|
|
943
945
|
className: "btn link",
|
|
944
|
-
"data-testid": `connection-route-reconnect-${
|
|
945
|
-
onClick: () => s(
|
|
946
|
+
"data-testid": `connection-route-reconnect-${l.id}`,
|
|
947
|
+
onClick: () => s(l.id),
|
|
946
948
|
children: "Reconnect"
|
|
947
949
|
}
|
|
948
950
|
)
|
|
949
951
|
] })
|
|
950
|
-
] },
|
|
952
|
+
] }, l.id)) }),
|
|
951
953
|
i != null && /* @__PURE__ */ t(
|
|
952
|
-
|
|
954
|
+
ua,
|
|
953
955
|
{
|
|
954
956
|
routeId: i.id,
|
|
955
957
|
projectId: i.project ?? n,
|
|
@@ -958,9 +960,9 @@ function ca({
|
|
|
958
960
|
)
|
|
959
961
|
] });
|
|
960
962
|
}
|
|
961
|
-
function
|
|
963
|
+
function ua(e) {
|
|
962
964
|
return /* @__PURE__ */ r("div", { "data-testid": "connection-route-reconnect-host", children: [
|
|
963
|
-
/* @__PURE__ */ t(
|
|
965
|
+
/* @__PURE__ */ t(vn, { projectId: e.projectId, initialEditRouteId: e.routeId }),
|
|
964
966
|
/* @__PURE__ */ t("button", { type: "button", className: "btn link", onClick: e.onDone, children: "Done" })
|
|
965
967
|
] });
|
|
966
968
|
}
|
|
@@ -971,16 +973,16 @@ function ct({
|
|
|
971
973
|
projectId: s
|
|
972
974
|
}) {
|
|
973
975
|
return /* @__PURE__ */ r(Q, { children: [
|
|
974
|
-
/* @__PURE__ */ t(
|
|
975
|
-
/* @__PURE__ */ t(
|
|
976
|
+
/* @__PURE__ */ t(da, { routes: a ?? [], projectId: s }),
|
|
977
|
+
/* @__PURE__ */ t(ma, { callables: e, onOpenCallable: n })
|
|
976
978
|
] });
|
|
977
979
|
}
|
|
978
|
-
function
|
|
980
|
+
function ma({
|
|
979
981
|
callables: e,
|
|
980
982
|
onOpenCallable: n
|
|
981
983
|
}) {
|
|
982
984
|
return /* @__PURE__ */ t("ul", { className: "list small", children: e.map((a) => {
|
|
983
|
-
const s = a.displayName || a.key || a.id, i = a.sites.map(
|
|
985
|
+
const s = a.displayName || a.key || a.id, i = a.sites.map(ca);
|
|
984
986
|
return /* @__PURE__ */ r("li", { children: [
|
|
985
987
|
/* @__PURE__ */ t("span", { className: "badge", children: a.kind }),
|
|
986
988
|
" ",
|
|
@@ -1001,8 +1003,8 @@ function ua({
|
|
|
1001
1003
|
] }, `${a.kind}:${a.id}`);
|
|
1002
1004
|
}) });
|
|
1003
1005
|
}
|
|
1004
|
-
const
|
|
1005
|
-
function
|
|
1006
|
+
const ha = [];
|
|
1007
|
+
function mi({
|
|
1006
1008
|
onOpen: e,
|
|
1007
1009
|
getHref: n,
|
|
1008
1010
|
addLabel: a,
|
|
@@ -1010,19 +1012,19 @@ function ui({
|
|
|
1010
1012
|
onOpenCallable: i
|
|
1011
1013
|
}) {
|
|
1012
1014
|
var P, A;
|
|
1013
|
-
const
|
|
1015
|
+
const l = Fe(), o = we(), c = pn(), h = c.data ?? ha, N = ae(() => qe(h), [h]), { byId: u } = Ve(N), k = fn(), [b, D] = f(!1), [g, w] = f(null), [y, x] = f(null), S = G(void 0), $ = Ye((y == null ? void 0 : y.id) ?? "", y !== null), T = typeof l.updateConnection == "function", j = s && "actions" in s ? s.actions : /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", onClick: () => D(!0), children: a ?? "+ Add connection" });
|
|
1014
1016
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
|
|
1015
1017
|
/* @__PURE__ */ t(
|
|
1016
1018
|
Ct,
|
|
1017
1019
|
{
|
|
1018
1020
|
connections: h,
|
|
1019
|
-
appsById:
|
|
1021
|
+
appsById: u,
|
|
1020
1022
|
loading: c.isLoading,
|
|
1021
1023
|
error: c.error ? c.error.message : null,
|
|
1022
1024
|
onOpen: e,
|
|
1023
1025
|
getHref: n,
|
|
1024
1026
|
onEdit: T ? w : void 0,
|
|
1025
|
-
onDelete:
|
|
1027
|
+
onDelete: x,
|
|
1026
1028
|
busy: k.isPending,
|
|
1027
1029
|
slots: { ...s, actions: j }
|
|
1028
1030
|
}
|
|
@@ -1032,7 +1034,7 @@ function ui({
|
|
|
1032
1034
|
{
|
|
1033
1035
|
onClose: () => D(!1),
|
|
1034
1036
|
onCreated: () => {
|
|
1035
|
-
D(!1),
|
|
1037
|
+
D(!1), o.invalidateQueries({ queryKey: be });
|
|
1036
1038
|
}
|
|
1037
1039
|
}
|
|
1038
1040
|
),
|
|
@@ -1043,12 +1045,12 @@ function ui({
|
|
|
1043
1045
|
onClose: () => w(null),
|
|
1044
1046
|
onSaved: () => {
|
|
1045
1047
|
const R = g.id;
|
|
1046
|
-
w(null),
|
|
1048
|
+
w(null), o.invalidateQueries({ queryKey: be }), o.invalidateQueries({ queryKey: ze(R) });
|
|
1047
1049
|
}
|
|
1048
1050
|
}
|
|
1049
1051
|
),
|
|
1050
1052
|
y && /* @__PURE__ */ t(
|
|
1051
|
-
|
|
1053
|
+
wa,
|
|
1052
1054
|
{
|
|
1053
1055
|
name: y.displayName || y.id,
|
|
1054
1056
|
loading: $.isLoading,
|
|
@@ -1056,35 +1058,35 @@ function ui({
|
|
|
1056
1058
|
routes: $.isError ? [] : ((A = $.data) == null ? void 0 : A.routes) ?? [],
|
|
1057
1059
|
projectId: S,
|
|
1058
1060
|
onOpenCallable: i,
|
|
1059
|
-
onClose: () =>
|
|
1061
|
+
onClose: () => x(null),
|
|
1060
1062
|
onConfirm: () => {
|
|
1061
1063
|
const R = y.id;
|
|
1062
|
-
|
|
1064
|
+
x(null), k.mutate({ id: R, force: !0 });
|
|
1063
1065
|
}
|
|
1064
1066
|
}
|
|
1065
1067
|
)
|
|
1066
1068
|
] });
|
|
1067
1069
|
}
|
|
1068
|
-
function
|
|
1070
|
+
function wa({
|
|
1069
1071
|
name: e,
|
|
1070
1072
|
loading: n,
|
|
1071
1073
|
callables: a,
|
|
1072
1074
|
routes: s,
|
|
1073
1075
|
projectId: i,
|
|
1074
|
-
onOpenCallable:
|
|
1075
|
-
onClose:
|
|
1076
|
+
onOpenCallable: l,
|
|
1077
|
+
onClose: o,
|
|
1076
1078
|
onConfirm: c
|
|
1077
1079
|
}) {
|
|
1078
|
-
const
|
|
1079
|
-
|
|
1080
|
+
const d = a.length, h = s.length, N = d + h, u = `Delete the connection "${e}"? This cannot be undone.`, k = (g, w, y) => `${g} ${g === 1 ? w : y}`, b = [
|
|
1081
|
+
d > 0 ? k(d, "callable", "callables") : null,
|
|
1080
1082
|
h > 0 ? k(h, "model route", "model routes") : null
|
|
1081
1083
|
].filter(Boolean).join(" and "), D = [
|
|
1082
|
-
|
|
1084
|
+
d > 0 ? `Deleting disables ${d === 1 ? "this callable" : `these ${d} callables`} until you reconnect ${d === 1 ? "it" : "them"}.` : null,
|
|
1083
1085
|
h > 0 ? `${h === 1 ? "The model route becomes" : `The ${h} model routes become`} broken until ${h === 1 ? "it is" : "they are"} pointed at another connection.` : null
|
|
1084
1086
|
].filter((g) => g != null);
|
|
1085
|
-
return /* @__PURE__ */ r($t, { title: "Delete connection", onClose:
|
|
1087
|
+
return /* @__PURE__ */ r($t, { title: "Delete connection", onClose: o, children: [
|
|
1086
1088
|
/* @__PURE__ */ r("div", { className: "w6w-modal-body", children: [
|
|
1087
|
-
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: N === 0 ?
|
|
1089
|
+
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: N === 0 ? u : `Delete the connection "${e}"? Used by ${b}.` }),
|
|
1088
1090
|
N > 0 && /* @__PURE__ */ r(Q, { children: [
|
|
1089
1091
|
/* @__PURE__ */ t(
|
|
1090
1092
|
ct,
|
|
@@ -1092,14 +1094,14 @@ function ha({
|
|
|
1092
1094
|
callables: a,
|
|
1093
1095
|
routes: s,
|
|
1094
1096
|
projectId: i,
|
|
1095
|
-
onOpenCallable:
|
|
1097
|
+
onOpenCallable: l
|
|
1096
1098
|
}
|
|
1097
1099
|
),
|
|
1098
1100
|
/* @__PURE__ */ t("p", { className: "w6w-small", children: D.join(" ") })
|
|
1099
1101
|
] })
|
|
1100
1102
|
] }),
|
|
1101
1103
|
/* @__PURE__ */ r("div", { className: "w6w-modal-actions", children: [
|
|
1102
|
-
/* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick:
|
|
1104
|
+
/* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: o, children: "Cancel" }),
|
|
1103
1105
|
/* @__PURE__ */ t(
|
|
1104
1106
|
"button",
|
|
1105
1107
|
{
|
|
@@ -1122,15 +1124,15 @@ function ve(e) {
|
|
|
1122
1124
|
if (s < 60) return `${s}m ago`;
|
|
1123
1125
|
const i = Math.round(s / 60);
|
|
1124
1126
|
if (i < 24) return `${i}h ago`;
|
|
1125
|
-
const
|
|
1126
|
-
return
|
|
1127
|
+
const l = Math.round(i / 24);
|
|
1128
|
+
return l < 30 ? `${l}d ago` : new Date(e).toLocaleDateString();
|
|
1127
1129
|
}
|
|
1128
|
-
const
|
|
1130
|
+
const pa = {
|
|
1129
1131
|
ok: 6e3,
|
|
1130
1132
|
warn: 1e4,
|
|
1131
1133
|
error: 15e3
|
|
1132
|
-
},
|
|
1133
|
-
function
|
|
1134
|
+
}, fa = { ok: "✓", warn: "!", error: "✕" };
|
|
1135
|
+
function hi({
|
|
1134
1136
|
connectionId: e,
|
|
1135
1137
|
onOpenAction: n,
|
|
1136
1138
|
onBack: a,
|
|
@@ -1138,20 +1140,20 @@ function mi({
|
|
|
1138
1140
|
slots: i
|
|
1139
1141
|
}) {
|
|
1140
1142
|
var U;
|
|
1141
|
-
const
|
|
1143
|
+
const l = Fe(), o = we(), c = gn(e), d = (U = c.data) == null ? void 0 : U.appId, h = ae(
|
|
1142
1144
|
() => qe(c.data ? [c.data] : []),
|
|
1143
1145
|
[c.data]
|
|
1144
|
-
), { byId: N } = Ve(h),
|
|
1146
|
+
), { byId: N } = Ve(h), u = c.data ? Tt(c.data, N) : void 0, k = Nn(d, !!d), b = ln(e), D = ae(() => {
|
|
1145
1147
|
const p = /* @__PURE__ */ new Map();
|
|
1146
1148
|
for (const E of b.data ?? []) {
|
|
1147
|
-
const
|
|
1148
|
-
|
|
1149
|
+
const I = p.get(E.actionKey) ?? [];
|
|
1150
|
+
I.push(E), p.set(E.actionKey, I);
|
|
1149
1151
|
}
|
|
1150
1152
|
return p;
|
|
1151
|
-
}, [b.data]), g = Ye(e).data, w = G(void 0), y = (g == null ? void 0 : g.callables) ?? [],
|
|
1153
|
+
}, [b.data]), g = Ye(e).data, w = G(void 0), y = (g == null ? void 0 : g.callables) ?? [], x = (g == null ? void 0 : g.routes) ?? [], S = on(e).data ?? [], [$, T] = f(!1), [j, P] = f(""), A = yn(e), [R, F] = f(null);
|
|
1152
1154
|
ut(() => {
|
|
1153
1155
|
if (!R) return;
|
|
1154
|
-
const p = setTimeout(() => F(null),
|
|
1156
|
+
const p = setTimeout(() => F(null), pa[R.kind]);
|
|
1155
1157
|
return () => clearTimeout(p);
|
|
1156
1158
|
}, [R]);
|
|
1157
1159
|
const H = () => {
|
|
@@ -1177,7 +1179,7 @@ function mi({
|
|
|
1177
1179
|
}, L = ae(() => {
|
|
1178
1180
|
var E;
|
|
1179
1181
|
const p = [...((E = k.data) == null ? void 0 : E.actions) ?? []];
|
|
1180
|
-
return p.sort((
|
|
1182
|
+
return p.sort((I, C) => (I.title || I.key).localeCompare(C.title || C.key)), p;
|
|
1181
1183
|
}, [k.data]), J = ae(() => {
|
|
1182
1184
|
const p = j.trim().toLowerCase();
|
|
1183
1185
|
return p ? L.filter(
|
|
@@ -1191,9 +1193,9 @@ function mi({
|
|
|
1191
1193
|
(i == null ? void 0 : i.empty) ?? /* @__PURE__ */ t("h2", { children: "Connection not found" }),
|
|
1192
1194
|
a && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "Back to integrations" })
|
|
1193
1195
|
] });
|
|
1194
|
-
const K = c.data, B = k.data, Y = !K.builtIn && typeof
|
|
1196
|
+
const K = c.data, B = k.data, Y = !K.builtIn && typeof l.updateConnection == "function";
|
|
1195
1197
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-conn-detail w6w-card-stack", children: [
|
|
1196
|
-
(i == null ? void 0 : i.header) ?? /* @__PURE__ */ r(Lt, { conn: K, app:
|
|
1198
|
+
(i == null ? void 0 : i.header) ?? /* @__PURE__ */ r(Lt, { conn: K, app: u, children: [
|
|
1197
1199
|
/* @__PURE__ */ t(
|
|
1198
1200
|
"button",
|
|
1199
1201
|
{
|
|
@@ -1222,7 +1224,7 @@ function mi({
|
|
|
1222
1224
|
"aria-live": R.kind === "error" ? "assertive" : "polite",
|
|
1223
1225
|
"data-testid": "connection-test-notice",
|
|
1224
1226
|
children: [
|
|
1225
|
-
/* @__PURE__ */ t("span", { "aria-hidden": "true", children:
|
|
1227
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: fa[R.kind] }),
|
|
1226
1228
|
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-notice-text", children: R.text }),
|
|
1227
1229
|
/* @__PURE__ */ t(Mt, { icon: "close", label: "Dismiss", onClick: () => F(null) })
|
|
1228
1230
|
]
|
|
@@ -1231,7 +1233,7 @@ function mi({
|
|
|
1231
1233
|
/* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
|
|
1232
1234
|
/* @__PURE__ */ r("h3", { children: [
|
|
1233
1235
|
"App: ",
|
|
1234
|
-
(
|
|
1236
|
+
(u == null ? void 0 : u.displayName) ?? K.appId
|
|
1235
1237
|
] }),
|
|
1236
1238
|
B && /* @__PURE__ */ r("p", { className: "w6w-muted w6w-small", children: [
|
|
1237
1239
|
"Version ",
|
|
@@ -1288,25 +1290,25 @@ function mi({
|
|
|
1288
1290
|
{
|
|
1289
1291
|
className: "w6w-embed-conn-list w6w-embed-conn-tests",
|
|
1290
1292
|
"aria-label": `Saved tests for ${p.title || p.key}`,
|
|
1291
|
-
children: E.map((
|
|
1293
|
+
children: E.map((I) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
1292
1294
|
Ne,
|
|
1293
1295
|
{
|
|
1294
|
-
title:
|
|
1295
|
-
subtitle:
|
|
1296
|
+
title: I.name,
|
|
1297
|
+
subtitle: I.lastRunAt ? /* @__PURE__ */ r("span", { children: [
|
|
1296
1298
|
/* @__PURE__ */ t(
|
|
1297
1299
|
"span",
|
|
1298
1300
|
{
|
|
1299
|
-
className:
|
|
1300
|
-
children:
|
|
1301
|
+
className: I.lastRunOk ? "w6w-embed-conn-ok" : "w6w-embed-conn-fail",
|
|
1302
|
+
children: I.lastRunOk ? "✓" : "✗"
|
|
1301
1303
|
}
|
|
1302
1304
|
),
|
|
1303
1305
|
" ",
|
|
1304
|
-
|
|
1305
|
-
ve(
|
|
1306
|
-
] }) : `saved ${ve(
|
|
1307
|
-
onClick: () => n(p.key,
|
|
1306
|
+
I.lastRunSummary ? `${I.lastRunSummary} · ` : "",
|
|
1307
|
+
ve(I.lastRunAt)
|
|
1308
|
+
] }) : `saved ${ve(I.updatedAt)}`,
|
|
1309
|
+
onClick: () => n(p.key, I.id)
|
|
1308
1310
|
}
|
|
1309
|
-
) },
|
|
1311
|
+
) }, I.id))
|
|
1310
1312
|
}
|
|
1311
1313
|
)
|
|
1312
1314
|
] }, p.key);
|
|
@@ -1314,11 +1316,11 @@ function mi({
|
|
|
1314
1316
|
] }),
|
|
1315
1317
|
g && /* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", "data-testid": "connection-used-by", children: [
|
|
1316
1318
|
/* @__PURE__ */ t("h3", { children: "Used by" }),
|
|
1317
|
-
y.length === 0 &&
|
|
1319
|
+
y.length === 0 && x.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Not used by any callable" }) : /* @__PURE__ */ t(
|
|
1318
1320
|
ct,
|
|
1319
1321
|
{
|
|
1320
1322
|
callables: y,
|
|
1321
|
-
routes:
|
|
1323
|
+
routes: x,
|
|
1322
1324
|
projectId: w,
|
|
1323
1325
|
onOpenCallable: s
|
|
1324
1326
|
}
|
|
@@ -1346,31 +1348,31 @@ function mi({
|
|
|
1346
1348
|
connection: K,
|
|
1347
1349
|
onClose: () => T(!1),
|
|
1348
1350
|
onSaved: () => {
|
|
1349
|
-
T(!1),
|
|
1351
|
+
T(!1), o.invalidateQueries({ queryKey: ze(e) }), o.invalidateQueries({ queryKey: be });
|
|
1350
1352
|
}
|
|
1351
1353
|
}
|
|
1352
1354
|
)
|
|
1353
1355
|
] });
|
|
1354
1356
|
}
|
|
1355
|
-
const
|
|
1357
|
+
const ga = {};
|
|
1356
1358
|
function Pe(e) {
|
|
1357
1359
|
return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1358
1360
|
}
|
|
1359
1361
|
function le(e) {
|
|
1360
1362
|
return (e / 100).toFixed(2);
|
|
1361
1363
|
}
|
|
1362
|
-
function
|
|
1364
|
+
function ya(e) {
|
|
1363
1365
|
if (e == null) return null;
|
|
1364
1366
|
const n = e.rates, a = [];
|
|
1365
1367
|
return n.input != null && a.push(`in ${le(n.input)}`), n.output != null && a.push(`out ${le(n.output)}`), n.cachedInput != null && a.push(`cached ${le(n.cachedInput)}`), n.cacheWrite != null && a.push(`cache write ${le(n.cacheWrite)}`), n.perRequest != null && a.push(`${le(n.perRequest)}/request`), a.length === 0 ? null : `${n.currency ?? "USD"} ${a.join(" · ")}`;
|
|
1366
1368
|
}
|
|
1367
|
-
function
|
|
1369
|
+
function va(e) {
|
|
1368
1370
|
const { maxInputTokens: n, maxOutputTokens: a } = e.limits ?? {};
|
|
1369
1371
|
if (n == null && a == null) return "—";
|
|
1370
1372
|
const s = [];
|
|
1371
1373
|
return n != null && s.push(`${Pe(n)} in`), a != null && s.push(`${Pe(a)} out`), s.join(" · ");
|
|
1372
1374
|
}
|
|
1373
|
-
const
|
|
1375
|
+
const Na = [
|
|
1374
1376
|
{
|
|
1375
1377
|
key: "model",
|
|
1376
1378
|
header: "Model",
|
|
@@ -1399,7 +1401,7 @@ const va = [
|
|
|
1399
1401
|
key: "rate",
|
|
1400
1402
|
header: "Rate (per 1M tokens)",
|
|
1401
1403
|
render: (e) => {
|
|
1402
|
-
const n =
|
|
1404
|
+
const n = ya(e.currentRate);
|
|
1403
1405
|
return n == null ? /* @__PURE__ */ t("span", { className: "muted small", children: "—" }) : /* @__PURE__ */ t(
|
|
1404
1406
|
"span",
|
|
1405
1407
|
{
|
|
@@ -1413,17 +1415,17 @@ const va = [
|
|
|
1413
1415
|
{
|
|
1414
1416
|
key: "limits",
|
|
1415
1417
|
header: "Limits",
|
|
1416
|
-
render: (e) => /* @__PURE__ */ t("span", { className: "muted small", children:
|
|
1418
|
+
render: (e) => /* @__PURE__ */ t("span", { className: "muted small", children: va(e) })
|
|
1417
1419
|
}
|
|
1418
1420
|
];
|
|
1419
|
-
function
|
|
1420
|
-
var
|
|
1421
|
-
const n = pe(), a = e.filter ??
|
|
1422
|
-
queryKey:
|
|
1421
|
+
function wi(e) {
|
|
1422
|
+
var l;
|
|
1423
|
+
const n = pe(), a = e.filter ?? ga, s = Je({
|
|
1424
|
+
queryKey: kn(a),
|
|
1423
1425
|
initialPageParam: void 0,
|
|
1424
|
-
getNextPageParam: (
|
|
1425
|
-
queryFn: ({ pageParam:
|
|
1426
|
-
}), i = ((
|
|
1426
|
+
getNextPageParam: (o) => o.nextCursor ?? void 0,
|
|
1427
|
+
queryFn: ({ pageParam: o }) => bn(n, o ? { ...a, cursor: o } : a)
|
|
1428
|
+
}), i = ((l = s.data) == null ? void 0 : l.pages.flatMap((o) => o.models)) ?? [];
|
|
1427
1429
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ r("section", { className: "section", children: [
|
|
1428
1430
|
/* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ r("div", { children: [
|
|
1429
1431
|
/* @__PURE__ */ t("h3", { children: "Model catalog" }),
|
|
@@ -1436,11 +1438,11 @@ function hi(e) {
|
|
|
1436
1438
|
i.length > 0 && /* @__PURE__ */ t(
|
|
1437
1439
|
$e,
|
|
1438
1440
|
{
|
|
1439
|
-
columns:
|
|
1441
|
+
columns: Na,
|
|
1440
1442
|
rows: i,
|
|
1441
|
-
rowKey: (
|
|
1443
|
+
rowKey: (o) => o.id,
|
|
1442
1444
|
testId: "model-catalog-table",
|
|
1443
|
-
rowTestId: (
|
|
1445
|
+
rowTestId: (o) => `model-catalog-${o.id}`
|
|
1444
1446
|
}
|
|
1445
1447
|
)
|
|
1446
1448
|
] }),
|
|
@@ -1457,23 +1459,23 @@ function hi(e) {
|
|
|
1457
1459
|
) })
|
|
1458
1460
|
] }) });
|
|
1459
1461
|
}
|
|
1460
|
-
const
|
|
1462
|
+
const ba = {};
|
|
1461
1463
|
function W(e) {
|
|
1462
1464
|
return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1463
1465
|
}
|
|
1464
|
-
function
|
|
1466
|
+
function ka(e) {
|
|
1465
1467
|
return `${e.currency} ${(e.amountMinor / 100).toFixed(2)}`;
|
|
1466
1468
|
}
|
|
1467
|
-
function
|
|
1468
|
-
return e.length > 0 ? e.map(
|
|
1469
|
+
function Ca(e, n) {
|
|
1470
|
+
return e.length > 0 ? e.map(ka).join(" · ") : n > 0 ? "unpriced" : "—";
|
|
1469
1471
|
}
|
|
1470
|
-
function
|
|
1472
|
+
function Da(e) {
|
|
1471
1473
|
return e.costMinor == null ? null : `${e.currency ?? "USD"} ${(e.costMinor / 100).toFixed(2)}`;
|
|
1472
1474
|
}
|
|
1473
|
-
function
|
|
1475
|
+
function $a(e) {
|
|
1474
1476
|
return e.totalsTruncated === !0;
|
|
1475
1477
|
}
|
|
1476
|
-
const
|
|
1478
|
+
const Ta = [
|
|
1477
1479
|
{
|
|
1478
1480
|
key: "occurredAt",
|
|
1479
1481
|
header: "When",
|
|
@@ -1514,7 +1516,7 @@ const $a = [
|
|
|
1514
1516
|
header: "Cost",
|
|
1515
1517
|
align: "right",
|
|
1516
1518
|
render: (e) => {
|
|
1517
|
-
const n =
|
|
1519
|
+
const n = Da(e);
|
|
1518
1520
|
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 });
|
|
1519
1521
|
}
|
|
1520
1522
|
},
|
|
@@ -1533,19 +1535,19 @@ const $a = [
|
|
|
1533
1535
|
}
|
|
1534
1536
|
}
|
|
1535
1537
|
];
|
|
1536
|
-
function
|
|
1538
|
+
function pi(e) {
|
|
1537
1539
|
var h, N;
|
|
1538
|
-
const n = G(e.projectId), a = pe(), s = e.filter ??
|
|
1539
|
-
queryKey:
|
|
1540
|
+
const n = G(e.projectId), a = pe(), s = e.filter ?? ba, i = Je({
|
|
1541
|
+
queryKey: Dn(n ?? void 0, s),
|
|
1540
1542
|
enabled: n != null,
|
|
1541
1543
|
initialPageParam: void 0,
|
|
1542
|
-
getNextPageParam: (
|
|
1543
|
-
queryFn: ({ pageParam:
|
|
1544
|
+
getNextPageParam: (u) => u.nextCursor ?? void 0,
|
|
1545
|
+
queryFn: ({ pageParam: u }) => Cn(
|
|
1544
1546
|
a,
|
|
1545
1547
|
n,
|
|
1546
|
-
|
|
1548
|
+
u ? { ...s, cursor: u } : s
|
|
1547
1549
|
)
|
|
1548
|
-
}),
|
|
1550
|
+
}), l = ((h = i.data) == null ? void 0 : h.pages) ?? [], o = (N = l[0]) == null ? void 0 : N.totals, c = l.flatMap((u) => u.items), d = l.length > 0 && $a(l[0]);
|
|
1549
1551
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ r("section", { className: "section", children: [
|
|
1550
1552
|
/* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ r("div", { children: [
|
|
1551
1553
|
/* @__PURE__ */ t("h3", { children: "Model usage" }),
|
|
@@ -1553,32 +1555,32 @@ function wi(e) {
|
|
|
1553
1555
|
] }) }),
|
|
1554
1556
|
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__ */ r(Q, { children: [
|
|
1555
1557
|
/* @__PURE__ */ r("div", { className: "card", "data-testid": "model-usage-totals", children: [
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
+
d && /* @__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." }),
|
|
1559
|
+
o == null ? (
|
|
1558
1560
|
// A failed query is reported once, below — never as a perpetual "loading".
|
|
1559
1561
|
i.error == null && /* @__PURE__ */ t("p", { className: "muted", children: "Loading totals…" })
|
|
1560
1562
|
) : /* @__PURE__ */ r("p", { className: "muted small", children: [
|
|
1561
1563
|
/* @__PURE__ */ r("span", { "data-testid": "model-usage-total-requests", children: [
|
|
1562
|
-
W(
|
|
1564
|
+
W(o.requests),
|
|
1563
1565
|
" requests"
|
|
1564
1566
|
] }),
|
|
1565
1567
|
" · ",
|
|
1566
1568
|
/* @__PURE__ */ r("span", { "data-testid": "model-usage-total-tokens", children: [
|
|
1567
|
-
W(
|
|
1569
|
+
W(o.totalTokens),
|
|
1568
1570
|
" tokens (",
|
|
1569
|
-
W(
|
|
1571
|
+
W(o.inputTokens),
|
|
1570
1572
|
" in /",
|
|
1571
1573
|
" ",
|
|
1572
|
-
W(
|
|
1574
|
+
W(o.outputTokens),
|
|
1573
1575
|
" out / ",
|
|
1574
|
-
W(
|
|
1576
|
+
W(o.cachedInputTokens),
|
|
1575
1577
|
" cached / ",
|
|
1576
|
-
W(
|
|
1578
|
+
W(o.cacheWriteTokens),
|
|
1577
1579
|
" cache write)"
|
|
1578
1580
|
] }),
|
|
1579
1581
|
" · ",
|
|
1580
|
-
/* @__PURE__ */ t("span", { "data-testid": "model-usage-total-cost", children:
|
|
1581
|
-
|
|
1582
|
+
/* @__PURE__ */ t("span", { "data-testid": "model-usage-total-cost", children: Ca(o.cost, o.unpriced) }),
|
|
1583
|
+
o.unpriced > 0 && /* @__PURE__ */ r(Q, { children: [
|
|
1582
1584
|
" · ",
|
|
1583
1585
|
/* @__PURE__ */ r(
|
|
1584
1586
|
"span",
|
|
@@ -1587,7 +1589,7 @@ function wi(e) {
|
|
|
1587
1589
|
"data-testid": "model-usage-unpriced-total",
|
|
1588
1590
|
title: "calls with no usable rate — not included in any cost total",
|
|
1589
1591
|
children: [
|
|
1590
|
-
W(
|
|
1592
|
+
W(o.unpriced),
|
|
1591
1593
|
" unpriced"
|
|
1592
1594
|
]
|
|
1593
1595
|
}
|
|
@@ -1602,11 +1604,11 @@ function wi(e) {
|
|
|
1602
1604
|
c.length > 0 && /* @__PURE__ */ t(
|
|
1603
1605
|
$e,
|
|
1604
1606
|
{
|
|
1605
|
-
columns:
|
|
1607
|
+
columns: Ta,
|
|
1606
1608
|
rows: c,
|
|
1607
|
-
rowKey: (
|
|
1609
|
+
rowKey: (u) => u.id,
|
|
1608
1610
|
testId: "model-usage-table",
|
|
1609
|
-
rowTestId: (
|
|
1611
|
+
rowTestId: (u) => `model-usage-${u.id}`
|
|
1610
1612
|
}
|
|
1611
1613
|
)
|
|
1612
1614
|
] }),
|
|
@@ -1624,42 +1626,42 @@ function wi(e) {
|
|
|
1624
1626
|
] })
|
|
1625
1627
|
] }) });
|
|
1626
1628
|
}
|
|
1627
|
-
const
|
|
1628
|
-
function
|
|
1629
|
-
const s =
|
|
1629
|
+
const La = (e) => `${e} connection${e === 1 ? "" : "s"}`;
|
|
1630
|
+
function fi({ contract: e, onOpen: n, slots: a }) {
|
|
1631
|
+
const s = $n(e ? { contract: e } : void 0), i = s.data ?? [];
|
|
1630
1632
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-cred-list", children: [
|
|
1631
1633
|
(a == null ? void 0 : a.header) ?? /* @__PURE__ */ t("h2", { children: "Credentials" }),
|
|
1632
1634
|
s.isLoading && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
|
|
1633
1635
|
s.error && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", children: s.error.message }),
|
|
1634
1636
|
!s.isLoading && !s.error && i.length === 0 && /* @__PURE__ */ t("div", { "data-testid": "credential-list-empty", children: (a == null ? void 0 : a.empty) ?? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No credentials yet." }) }),
|
|
1635
|
-
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Credentials", children: i.map((
|
|
1636
|
-
const
|
|
1637
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Credentials", children: i.map((l) => {
|
|
1638
|
+
const o = Object.values(l.display)[0];
|
|
1637
1639
|
return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ r(
|
|
1638
1640
|
"button",
|
|
1639
1641
|
{
|
|
1640
1642
|
type: "button",
|
|
1641
1643
|
className: "w6w-embed-conn-action",
|
|
1642
|
-
"data-testid": `credential-row-${
|
|
1643
|
-
onClick: () => n == null ? void 0 : n(
|
|
1644
|
+
"data-testid": `credential-row-${l.id}`,
|
|
1645
|
+
onClick: () => n == null ? void 0 : n(l.id),
|
|
1644
1646
|
children: [
|
|
1645
|
-
/* @__PURE__ */ t("strong", { children:
|
|
1647
|
+
/* @__PURE__ */ t("strong", { children: l.name }),
|
|
1646
1648
|
" ",
|
|
1647
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children:
|
|
1648
|
-
|
|
1649
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: l.status }),
|
|
1650
|
+
o !== void 0 && /* @__PURE__ */ r("span", { className: "w6w-muted w6w-small", children: [
|
|
1649
1651
|
" ",
|
|
1650
|
-
|
|
1652
|
+
o
|
|
1651
1653
|
] }),
|
|
1652
1654
|
/* @__PURE__ */ r("span", { className: "w6w-muted w6w-small", children: [
|
|
1653
1655
|
" · ",
|
|
1654
|
-
|
|
1656
|
+
La(l.connectionCount)
|
|
1655
1657
|
] })
|
|
1656
1658
|
]
|
|
1657
1659
|
}
|
|
1658
|
-
) },
|
|
1660
|
+
) }, l.id);
|
|
1659
1661
|
}) })
|
|
1660
1662
|
] });
|
|
1661
1663
|
}
|
|
1662
|
-
function
|
|
1664
|
+
function Ma(e) {
|
|
1663
1665
|
try {
|
|
1664
1666
|
const n = JSON.parse(e);
|
|
1665
1667
|
return n !== null && typeof n == "object" && !Array.isArray(n) ? n : null;
|
|
@@ -1668,26 +1670,26 @@ function La(e) {
|
|
|
1668
1670
|
}
|
|
1669
1671
|
}
|
|
1670
1672
|
const Oe = (e) => Number.isNaN(Date.parse(e)) ? e : new Date(e).toLocaleString();
|
|
1671
|
-
function
|
|
1673
|
+
function gi({
|
|
1672
1674
|
credentialId: e,
|
|
1673
1675
|
onOpenConnection: n,
|
|
1674
1676
|
onDeleted: a,
|
|
1675
1677
|
onBack: s,
|
|
1676
1678
|
slots: i
|
|
1677
1679
|
}) {
|
|
1678
|
-
var E,
|
|
1679
|
-
const
|
|
1680
|
-
if (
|
|
1680
|
+
var E, I;
|
|
1681
|
+
const l = Tn(e), o = Ln(e), c = Mn(e), d = xn(e), h = In(e), N = En(), [u, k] = f(""), [b, D] = f(null), [g, w] = f(!1), [y, x] = f(null), [S, $] = f(null), [T, j] = f(!1), [P, A] = f(null), [R, F] = f(null), H = s && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: s, children: "← Credentials" });
|
|
1682
|
+
if (l.isLoading)
|
|
1681
1683
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root w6w-embed-cred-detail", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) });
|
|
1682
|
-
const L =
|
|
1684
|
+
const L = l.data;
|
|
1683
1685
|
if (!L)
|
|
1684
1686
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-cred-detail", "data-testid": "credential-not-found", children: [
|
|
1685
1687
|
(i == null ? void 0 : i.empty) ?? /* @__PURE__ */ t("h2", { children: "Credential not found" }),
|
|
1686
1688
|
H
|
|
1687
1689
|
] });
|
|
1688
|
-
const J = ((E =
|
|
1690
|
+
const J = ((E = o.data) == null ? void 0 : E.connections) ?? [], K = L.connectionCount, B = L.status === "disabled", Y = () => {
|
|
1689
1691
|
w(!1);
|
|
1690
|
-
const C =
|
|
1692
|
+
const C = Ma(u);
|
|
1691
1693
|
if (!C) {
|
|
1692
1694
|
D("Enter the new secret as a JSON object.");
|
|
1693
1695
|
return;
|
|
@@ -1702,8 +1704,8 @@ function fi({
|
|
|
1702
1704
|
}
|
|
1703
1705
|
);
|
|
1704
1706
|
}, U = () => {
|
|
1705
|
-
|
|
1706
|
-
onSuccess:
|
|
1707
|
+
x(null), $(null), h.mutate(void 0, {
|
|
1708
|
+
onSuccess: x,
|
|
1707
1709
|
onError: (C) => $((C == null ? void 0 : C.message) ?? "Test failed.")
|
|
1708
1710
|
});
|
|
1709
1711
|
}, p = () => {
|
|
@@ -1764,7 +1766,7 @@ function fi({
|
|
|
1764
1766
|
className: "w6w-input w6w-secret-input",
|
|
1765
1767
|
"aria-label": "New secret (JSON object)",
|
|
1766
1768
|
rows: 5,
|
|
1767
|
-
value:
|
|
1769
|
+
value: u,
|
|
1768
1770
|
onChange: (C) => k(C.target.value),
|
|
1769
1771
|
name: "w6w-cred-rotate",
|
|
1770
1772
|
autoComplete: "off",
|
|
@@ -1789,8 +1791,8 @@ function fi({
|
|
|
1789
1791
|
{
|
|
1790
1792
|
type: "button",
|
|
1791
1793
|
className: "w6w-btn w6w-btn-ghost",
|
|
1792
|
-
disabled:
|
|
1793
|
-
onClick: () =>
|
|
1794
|
+
disabled: d.isPending,
|
|
1795
|
+
onClick: () => d.mutate(B ? "active" : "disabled"),
|
|
1794
1796
|
children: B ? "Enable" : "Disable"
|
|
1795
1797
|
}
|
|
1796
1798
|
),
|
|
@@ -1818,7 +1820,7 @@ function fi({
|
|
|
1818
1820
|
] }),
|
|
1819
1821
|
y && /* @__PURE__ */ t("output", { "data-testid": "credential-test-result", children: y.ok ? "ok" : y.code ?? "failed" }),
|
|
1820
1822
|
S && /* @__PURE__ */ t("p", { role: "alert", children: S }),
|
|
1821
|
-
|
|
1823
|
+
d.isError && /* @__PURE__ */ t("p", { role: "alert", children: ((I = d.error) == null ? void 0 : I.message) ?? "Update failed." }),
|
|
1822
1824
|
T && /* @__PURE__ */ r("div", { "data-testid": "credential-delete-confirm", children: [
|
|
1823
1825
|
/* @__PURE__ */ r("p", { className: "w6w-small", children: [
|
|
1824
1826
|
'Delete the credential "',
|
|
@@ -1861,55 +1863,55 @@ function fi({
|
|
|
1861
1863
|
] });
|
|
1862
1864
|
}
|
|
1863
1865
|
function V(e) {
|
|
1864
|
-
const n =
|
|
1866
|
+
const n = xt(e), a = e == null ? void 0 : e.code;
|
|
1865
1867
|
return n.code === void 0 && typeof a == "string" && a !== "" ? { ...n, code: a } : n;
|
|
1866
1868
|
}
|
|
1867
1869
|
const je = 80;
|
|
1868
|
-
function
|
|
1870
|
+
function xa(e, n) {
|
|
1869
1871
|
if (typeof URL > "u" || typeof URL.createObjectURL != "function") return;
|
|
1870
1872
|
const a = URL.createObjectURL(new Blob([n], { type: "text/csv" })), s = document.createElement("a");
|
|
1871
1873
|
s.href = a, s.download = e, s.click(), URL.revokeObjectURL(a);
|
|
1872
1874
|
}
|
|
1873
1875
|
function Ia({ store: e, project: n }) {
|
|
1874
1876
|
var Me;
|
|
1875
|
-
const a =
|
|
1876
|
-
(
|
|
1877
|
-
), K = new Map(J.map((
|
|
1877
|
+
const a = It(e), s = (a == null ? void 0 : a.columns) ?? [], i = (a == null ? void 0 : a.key) ?? "", [l, o] = f(""), [c, d] = f({}), [h, N] = f({}), [u, k] = f({}), [b, D] = f({}), [g, w] = f(null), [y, x] = f(null), [S, $] = f(null), T = pe(), j = we(), P = Ze(e.id, n, l), A = Ge(), R = Rn(), F = Xe(), H = Sn(), L = Pn(), J = (((Me = P.data) == null ? void 0 : Me.pages.flatMap((m) => m.items)) ?? []).map(
|
|
1878
|
+
(m) => b[m.key] ?? m
|
|
1879
|
+
), K = new Map(J.map((m) => [m.key, m])), B = [], Y = (m) => c[m], U = Y(te), p = (m, M, q) => {
|
|
1878
1880
|
const Z = q === void 0 ? null : ce(q, s);
|
|
1879
1881
|
B.push({
|
|
1880
|
-
id:
|
|
1881
|
-
isNew:
|
|
1882
|
+
id: m,
|
|
1883
|
+
isNew: m === te,
|
|
1882
1884
|
cells: M.cells,
|
|
1883
1885
|
version: M.version,
|
|
1884
1886
|
dirty: Z === null ? !0 : Ot(M, Z, s).length > 0,
|
|
1885
|
-
conflict:
|
|
1886
|
-
cellErrors: h[
|
|
1887
|
+
conflict: u[m] === !0,
|
|
1888
|
+
cellErrors: h[m]
|
|
1887
1889
|
});
|
|
1888
1890
|
};
|
|
1889
1891
|
U !== void 0 && p(te, U, void 0);
|
|
1890
|
-
for (const
|
|
1891
|
-
p(
|
|
1892
|
-
const E = (
|
|
1893
|
-
N((M) => ne(M,
|
|
1894
|
-
},
|
|
1895
|
-
|
|
1892
|
+
for (const m of J)
|
|
1893
|
+
p(m.key, Y(m.key) ?? ce(m, s), m);
|
|
1894
|
+
const E = (m) => {
|
|
1895
|
+
N((M) => ne(M, m)), k((M) => ne(M, m));
|
|
1896
|
+
}, I = (m) => {
|
|
1897
|
+
d((M) => ne(M, m)), E(m);
|
|
1896
1898
|
};
|
|
1897
|
-
function C(
|
|
1898
|
-
const Z = K.get(
|
|
1899
|
-
|
|
1900
|
-
const ee = _[
|
|
1899
|
+
function C(m, M, q) {
|
|
1900
|
+
const Z = K.get(m), z = Y(m) ?? (Z ? ce(Z, s) : xe(s));
|
|
1901
|
+
d((_) => ({ ..._, [m]: { ...z, cells: { ...z.cells, [M]: q } } })), N((_) => {
|
|
1902
|
+
const ee = _[m];
|
|
1901
1903
|
if (ee === void 0 || !(M in ee)) return _;
|
|
1902
1904
|
const se = ne(ee, M);
|
|
1903
|
-
return Object.keys(se).length === 0 ? ne(_,
|
|
1905
|
+
return Object.keys(se).length === 0 ? ne(_, m) : { ..._, [m]: se };
|
|
1904
1906
|
});
|
|
1905
1907
|
}
|
|
1906
|
-
async function v(
|
|
1907
|
-
const M = K.get(
|
|
1908
|
+
async function v(m) {
|
|
1909
|
+
const M = K.get(m), q = Y(m) ?? (M ? ce(M, s) : void 0);
|
|
1908
1910
|
if (q === void 0) return;
|
|
1909
|
-
w(null), E(
|
|
1911
|
+
w(null), E(m);
|
|
1910
1912
|
const Z = Kt(q, s);
|
|
1911
1913
|
if (!Z.ok) {
|
|
1912
|
-
N((_) => ({ ..._, [
|
|
1914
|
+
N((_) => ({ ..._, [m]: Z.errors }));
|
|
1913
1915
|
return;
|
|
1914
1916
|
}
|
|
1915
1917
|
const z = Qt(
|
|
@@ -1930,51 +1932,51 @@ function Ia({ store: e, project: n }) {
|
|
|
1930
1932
|
ifVersion: z.ifVersion,
|
|
1931
1933
|
ttlSeconds: z.ttlSeconds,
|
|
1932
1934
|
project: n
|
|
1933
|
-
}), D((_) => ne(_,
|
|
1935
|
+
}), D((_) => ne(_, m)), I(m);
|
|
1934
1936
|
} catch (_) {
|
|
1935
1937
|
const ee = V(_);
|
|
1936
1938
|
if (Be(ee)) {
|
|
1937
|
-
k((fe) => ({ ...fe, [
|
|
1939
|
+
k((fe) => ({ ...fe, [m]: !0 }));
|
|
1938
1940
|
return;
|
|
1939
1941
|
}
|
|
1940
1942
|
const se = Ft(ee, s);
|
|
1941
1943
|
if (se !== null) {
|
|
1942
|
-
N((fe) => ({ ...fe, [
|
|
1944
|
+
N((fe) => ({ ...fe, [m]: se }));
|
|
1943
1945
|
return;
|
|
1944
1946
|
}
|
|
1945
1947
|
w(ee.message);
|
|
1946
1948
|
}
|
|
1947
1949
|
}
|
|
1948
|
-
async function O(
|
|
1950
|
+
async function O(m) {
|
|
1949
1951
|
try {
|
|
1950
|
-
const M = await et(T, e.id,
|
|
1951
|
-
D((q) => ({ ...q, [
|
|
1952
|
+
const M = await et(T, e.id, m, n);
|
|
1953
|
+
D((q) => ({ ...q, [m]: M })), I(m), await j.invalidateQueries({ queryKey: ["data-stores"] });
|
|
1952
1954
|
} catch (M) {
|
|
1953
1955
|
w(V(M).message);
|
|
1954
1956
|
}
|
|
1955
1957
|
}
|
|
1956
1958
|
function X() {
|
|
1957
|
-
const
|
|
1958
|
-
|
|
1959
|
+
const m = y;
|
|
1960
|
+
x(null), m !== null && (m !== te && F.mutate({ id: e.id, key: m, project: n }), I(m));
|
|
1959
1961
|
}
|
|
1960
|
-
async function oe(
|
|
1962
|
+
async function oe(m) {
|
|
1961
1963
|
$(null);
|
|
1962
1964
|
try {
|
|
1963
|
-
const M = await H.mutateAsync({ id: e.id, csv: await
|
|
1964
|
-
$(
|
|
1965
|
+
const M = await H.mutateAsync({ id: e.id, csv: await m.text(), project: n });
|
|
1966
|
+
$(Ie({ status: 200, text: JSON.stringify(M) }));
|
|
1965
1967
|
} catch (M) {
|
|
1966
1968
|
const q = M;
|
|
1967
1969
|
$(
|
|
1968
|
-
typeof q.status == "number" ?
|
|
1970
|
+
typeof q.status == "number" ? Ie({ status: q.status, text: JSON.stringify(q.raw ?? null) }) : { ok: !1, message: V(M).message }
|
|
1969
1971
|
);
|
|
1970
1972
|
}
|
|
1971
1973
|
}
|
|
1972
1974
|
async function dt() {
|
|
1973
1975
|
try {
|
|
1974
|
-
const
|
|
1975
|
-
|
|
1976
|
-
} catch (
|
|
1977
|
-
$({ ok: !1, message: V(
|
|
1976
|
+
const m = await L.mutateAsync({ id: e.id, project: n });
|
|
1977
|
+
xa(jt(null, e.name), m), $(null);
|
|
1978
|
+
} catch (m) {
|
|
1979
|
+
$({ ok: !1, message: V(m).message });
|
|
1978
1980
|
}
|
|
1979
1981
|
}
|
|
1980
1982
|
return /* @__PURE__ */ r("div", { children: [
|
|
@@ -1984,7 +1986,7 @@ function Ia({ store: e, project: n }) {
|
|
|
1984
1986
|
result: S,
|
|
1985
1987
|
busy: L.isPending,
|
|
1986
1988
|
onImport: oe,
|
|
1987
|
-
onRefuse: (
|
|
1989
|
+
onRefuse: (m) => $({ ok: !1, message: m }),
|
|
1988
1990
|
onExport: dt
|
|
1989
1991
|
}
|
|
1990
1992
|
),
|
|
@@ -1999,14 +2001,14 @@ function Ia({ store: e, project: n }) {
|
|
|
1999
2001
|
hasMore: P.hasNextPage,
|
|
2000
2002
|
empty: /* @__PURE__ */ t("p", { className: "muted small", children: "No rows match this key prefix." }),
|
|
2001
2003
|
onCellChange: C,
|
|
2002
|
-
onSave: (
|
|
2003
|
-
onDelete:
|
|
2004
|
-
onReload: (
|
|
2004
|
+
onSave: (m) => void v(m),
|
|
2005
|
+
onDelete: x,
|
|
2006
|
+
onReload: (m) => void O(m),
|
|
2005
2007
|
onAddRow: () => {
|
|
2006
|
-
te in c || (
|
|
2008
|
+
te in c || (d((m) => ({ ...m, [te]: xe(s) })), w(null));
|
|
2007
2009
|
},
|
|
2008
2010
|
onLoadMore: () => void P.fetchNextPage(),
|
|
2009
|
-
onSearch:
|
|
2011
|
+
onSearch: o
|
|
2010
2012
|
}
|
|
2011
2013
|
),
|
|
2012
2014
|
y !== null && /* @__PURE__ */ t(
|
|
@@ -2016,16 +2018,16 @@ function Ia({ store: e, project: n }) {
|
|
|
2016
2018
|
message: y === te ? "Discard this unsaved row?" : `Delete "${y}"? This cannot be undone.`,
|
|
2017
2019
|
confirmLabel: "Delete",
|
|
2018
2020
|
onConfirm: X,
|
|
2019
|
-
onClose: () =>
|
|
2021
|
+
onClose: () => x(null)
|
|
2020
2022
|
}
|
|
2021
2023
|
)
|
|
2022
2024
|
] });
|
|
2023
2025
|
}
|
|
2024
|
-
function
|
|
2026
|
+
function Ea({ store: e, project: n }) {
|
|
2025
2027
|
var C;
|
|
2026
|
-
const a = e.kind === "doc", s = Rt(e), [i,
|
|
2027
|
-
(v) =>
|
|
2028
|
-
), L =
|
|
2028
|
+
const a = e.kind === "doc", s = Rt(e), [i, l] = f(""), [o, c] = f(null), [d, h] = f(!1), [N, u] = f(""), [k, b] = f(""), [D, g] = f(null), [w, y] = f(!1), [x, S] = f({}), [$, T] = f(null), j = pe(), P = we(), A = Ze(e.id, n, i), R = Ge(), F = Xe(), H = (((C = A.data) == null ? void 0 : C.pages.flatMap((v) => v.items)) ?? []).map(
|
|
2029
|
+
(v) => x[v.key] ?? v
|
|
2030
|
+
), L = o === null ? void 0 : H.find((v) => v.key === o), J = d || o !== null, K = (v) => a ? JSON.stringify(v.value ?? null, null, 2) : Wt(s, v.value), B = (v) => {
|
|
2029
2031
|
const O = K(v).replace(/\s+/g, " ");
|
|
2030
2032
|
return O.length > je ? `${O.slice(0, je)}…` : O;
|
|
2031
2033
|
};
|
|
@@ -2033,7 +2035,7 @@ function xa({ store: e, project: n }) {
|
|
|
2033
2035
|
c(v.key), h(!1), b(K(v)), g(null), y(!1);
|
|
2034
2036
|
}
|
|
2035
2037
|
function U() {
|
|
2036
|
-
c(null), h(!1),
|
|
2038
|
+
c(null), h(!1), u(""), b(""), g(null), y(!1);
|
|
2037
2039
|
}
|
|
2038
2040
|
async function p() {
|
|
2039
2041
|
g(null), y(!1);
|
|
@@ -2042,7 +2044,7 @@ function xa({ store: e, project: n }) {
|
|
|
2042
2044
|
g(v.message);
|
|
2043
2045
|
return;
|
|
2044
2046
|
}
|
|
2045
|
-
const O =
|
|
2047
|
+
const O = d ? N.trim() : o;
|
|
2046
2048
|
if (O === null || O === "") {
|
|
2047
2049
|
g("Enter a key.");
|
|
2048
2050
|
return;
|
|
@@ -2053,8 +2055,8 @@ function xa({ store: e, project: n }) {
|
|
|
2053
2055
|
key: O,
|
|
2054
2056
|
value: v.value,
|
|
2055
2057
|
// A new entry must not exist yet; an existing one is guarded by the version loaded.
|
|
2056
|
-
ifVersion:
|
|
2057
|
-
ttlSeconds:
|
|
2058
|
+
ifVersion: d ? 0 : (L == null ? void 0 : L.version) ?? 0,
|
|
2059
|
+
ttlSeconds: d ? void 0 : We((L == null ? void 0 : L.expiresAt) ?? null, Date.now()),
|
|
2058
2060
|
project: n
|
|
2059
2061
|
}), S((X) => ne(X, O)), U();
|
|
2060
2062
|
} catch (X) {
|
|
@@ -2063,19 +2065,19 @@ function xa({ store: e, project: n }) {
|
|
|
2063
2065
|
}
|
|
2064
2066
|
}
|
|
2065
2067
|
async function E() {
|
|
2066
|
-
if (
|
|
2068
|
+
if (o !== null)
|
|
2067
2069
|
try {
|
|
2068
|
-
const v = await et(j, e.id,
|
|
2069
|
-
S((O) => ({ ...O, [
|
|
2070
|
+
const v = await et(j, e.id, o, n);
|
|
2071
|
+
S((O) => ({ ...O, [o]: v })), b(K(v)), y(!1), g(null), await P.invalidateQueries({ queryKey: ["data-stores"] });
|
|
2070
2072
|
} catch (v) {
|
|
2071
2073
|
g(V(v).message);
|
|
2072
2074
|
}
|
|
2073
2075
|
}
|
|
2074
|
-
async function
|
|
2076
|
+
async function I() {
|
|
2075
2077
|
const v = $;
|
|
2076
2078
|
if (T(null), v !== null)
|
|
2077
2079
|
try {
|
|
2078
|
-
await F.mutateAsync({ id: e.id, key: v, project: n }), v ===
|
|
2080
|
+
await F.mutateAsync({ id: e.id, key: v, project: n }), v === o && U();
|
|
2079
2081
|
} catch (O) {
|
|
2080
2082
|
g(V(O).message);
|
|
2081
2083
|
}
|
|
@@ -2092,9 +2094,9 @@ function xa({ store: e, project: n }) {
|
|
|
2092
2094
|
const O = H.find((X) => X.key === v);
|
|
2093
2095
|
O && Y(O);
|
|
2094
2096
|
},
|
|
2095
|
-
onSearch:
|
|
2097
|
+
onSearch: l,
|
|
2096
2098
|
onNew: () => {
|
|
2097
|
-
c(null), h(!0),
|
|
2099
|
+
c(null), h(!0), u(""), b(""), g(null), y(!1);
|
|
2098
2100
|
},
|
|
2099
2101
|
onLoadMore: () => void A.fetchNextPage()
|
|
2100
2102
|
}
|
|
@@ -2103,8 +2105,8 @@ function xa({ store: e, project: n }) {
|
|
|
2103
2105
|
Pt,
|
|
2104
2106
|
{
|
|
2105
2107
|
kind: a ? "doc" : "kv",
|
|
2106
|
-
isNew:
|
|
2107
|
-
entryKey:
|
|
2108
|
+
isNew: d,
|
|
2109
|
+
entryKey: o ?? void 0,
|
|
2108
2110
|
newKey: N,
|
|
2109
2111
|
version: (L == null ? void 0 : L.version) ?? null,
|
|
2110
2112
|
expiresAt: (L == null ? void 0 : L.expiresAt) ?? null,
|
|
@@ -2112,11 +2114,11 @@ function xa({ store: e, project: n }) {
|
|
|
2112
2114
|
error: D,
|
|
2113
2115
|
conflict: w,
|
|
2114
2116
|
saving: R.isPending || F.isPending,
|
|
2115
|
-
onDelete:
|
|
2117
|
+
onDelete: d ? void 0 : () => T(o),
|
|
2116
2118
|
onTextChange: (v) => {
|
|
2117
2119
|
b(v), g(null);
|
|
2118
2120
|
},
|
|
2119
|
-
onKeyChange:
|
|
2121
|
+
onKeyChange: u,
|
|
2120
2122
|
onSave: () => void p(),
|
|
2121
2123
|
onCancel: U,
|
|
2122
2124
|
onReload: () => void E()
|
|
@@ -2128,7 +2130,7 @@ function xa({ store: e, project: n }) {
|
|
|
2128
2130
|
title: "Delete entry",
|
|
2129
2131
|
message: `Delete "${$}"? This cannot be undone.`,
|
|
2130
2132
|
confirmLabel: "Delete",
|
|
2131
|
-
onConfirm:
|
|
2133
|
+
onConfirm: I,
|
|
2132
2134
|
onClose: () => T(null)
|
|
2133
2135
|
}
|
|
2134
2136
|
)
|
|
@@ -2139,35 +2141,35 @@ function ne(e, n) {
|
|
|
2139
2141
|
const a = { ...e };
|
|
2140
2142
|
return delete a[n], a;
|
|
2141
2143
|
}
|
|
2142
|
-
function
|
|
2143
|
-
const s = G(n), i =
|
|
2144
|
-
let
|
|
2145
|
-
s == null ?
|
|
2146
|
-
const c = (a == null ? void 0 : a.header) === void 0 ?
|
|
2147
|
-
/* @__PURE__ */ t("h3", { children:
|
|
2144
|
+
function yi({ id: e, project: n, slots: a }) {
|
|
2145
|
+
const s = G(n), i = An(e, s ?? void 0), l = i.data;
|
|
2146
|
+
let o;
|
|
2147
|
+
s == null ? o = /* @__PURE__ */ t("p", { className: "muted", children: "No project selected." }) : i.isError ? o = /* @__PURE__ */ t("p", { className: "result error", children: V(i.error).message }) : l === void 0 ? o = /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : l.kind === "table" ? o = /* @__PURE__ */ t(Ia, { store: l, project: s }, l.id) : o = /* @__PURE__ */ t(Ea, { store: l, project: s }, l.id);
|
|
2148
|
+
const c = (a == null ? void 0 : a.header) === void 0 ? l && /* @__PURE__ */ r("div", { children: [
|
|
2149
|
+
/* @__PURE__ */ t("h3", { children: l.name }),
|
|
2148
2150
|
/* @__PURE__ */ r("p", { className: "muted small", children: [
|
|
2149
|
-
|
|
2151
|
+
l.kind,
|
|
2150
2152
|
" · ",
|
|
2151
|
-
|
|
2153
|
+
l.entryCount,
|
|
2152
2154
|
" ",
|
|
2153
|
-
|
|
2155
|
+
l.entryCount === 1 ? "entry" : "entries"
|
|
2154
2156
|
] })
|
|
2155
2157
|
] }) : a.header;
|
|
2156
2158
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ r("section", { className: "section", children: [
|
|
2157
2159
|
c,
|
|
2158
|
-
|
|
2160
|
+
o
|
|
2159
2161
|
] }) });
|
|
2160
2162
|
}
|
|
2161
|
-
const
|
|
2162
|
-
function
|
|
2163
|
-
const [n, a] = f(""), [s, i] = f(""), [
|
|
2163
|
+
const Aa = ["name", "kind", "description", "schema"];
|
|
2164
|
+
function Ra(e) {
|
|
2165
|
+
const [n, a] = f(""), [s, i] = f(""), [l, o] = f("kv"), [c, d] = f("string"), [h, N] = f([]), [u, k] = f(""), [b, D] = f({}), [g, w] = f({}), [y, x] = f(null), S = Kn();
|
|
2164
2166
|
function $() {
|
|
2165
|
-
D({}), w({}),
|
|
2167
|
+
D({}), w({}), x(null);
|
|
2166
2168
|
const T = {
|
|
2167
|
-
kind:
|
|
2169
|
+
kind: l,
|
|
2168
2170
|
name: n
|
|
2169
2171
|
};
|
|
2170
|
-
|
|
2172
|
+
l === "kv" && (T.schema = { valueType: c }), l === "table" && (T.schema = u === "" ? { columns: h } : { columns: h, key: u }), s !== "" && (T.description = s), S.mutate(
|
|
2171
2173
|
// The SDK's create body types `schema` as table columns only; the wire takes the S-2 shape
|
|
2172
2174
|
// per kind, so the kv `{valueType}` schema is passed through as the host defines it.
|
|
2173
2175
|
{ input: T, project: e.project },
|
|
@@ -2179,16 +2181,16 @@ function Aa(e) {
|
|
|
2179
2181
|
w({ [A.column]: P.message });
|
|
2180
2182
|
return;
|
|
2181
2183
|
}
|
|
2182
|
-
if (A.kind === "field" &&
|
|
2184
|
+
if (A.kind === "field" && Aa.includes(A.field)) {
|
|
2183
2185
|
D({ [A.field]: P.message });
|
|
2184
2186
|
return;
|
|
2185
2187
|
}
|
|
2186
|
-
|
|
2188
|
+
x(P.message);
|
|
2187
2189
|
}
|
|
2188
2190
|
}
|
|
2189
2191
|
);
|
|
2190
2192
|
}
|
|
2191
|
-
return /* @__PURE__ */ r(
|
|
2193
|
+
return /* @__PURE__ */ r(dn, { title: "New data store", onClose: e.onClose, children: [
|
|
2192
2194
|
/* @__PURE__ */ r("div", { className: "modal-body", children: [
|
|
2193
2195
|
/* @__PURE__ */ r("label", { className: "field", children: [
|
|
2194
2196
|
/* @__PURE__ */ t("span", { children: "Name" }),
|
|
@@ -2222,9 +2224,9 @@ function Aa(e) {
|
|
|
2222
2224
|
"select",
|
|
2223
2225
|
{
|
|
2224
2226
|
"data-testid": "data-store-kind",
|
|
2225
|
-
value:
|
|
2227
|
+
value: l,
|
|
2226
2228
|
onChange: (T) => {
|
|
2227
|
-
|
|
2229
|
+
o(T.target.value), k("");
|
|
2228
2230
|
},
|
|
2229
2231
|
children: Ut.map((T) => /* @__PURE__ */ t("option", { value: T, children: Vt[T] }, T))
|
|
2230
2232
|
}
|
|
@@ -2232,16 +2234,16 @@ function Aa(e) {
|
|
|
2232
2234
|
/* @__PURE__ */ t("span", { className: "hint", children: "The kind is fixed once the store exists." })
|
|
2233
2235
|
] }),
|
|
2234
2236
|
b.kind !== void 0 && /* @__PURE__ */ t("div", { className: "result error", children: b.kind }),
|
|
2235
|
-
|
|
2237
|
+
l === "kv" && /* @__PURE__ */ r("label", { className: "field", children: [
|
|
2236
2238
|
/* @__PURE__ */ t("span", { children: "Value type" }),
|
|
2237
|
-
/* @__PURE__ */ t("select", { value: c, onChange: (T) =>
|
|
2239
|
+
/* @__PURE__ */ t("select", { value: c, onChange: (T) => d(T.target.value), children: Ht.map((T) => /* @__PURE__ */ t("option", { value: T, children: T }, T)) })
|
|
2238
2240
|
] }),
|
|
2239
|
-
|
|
2241
|
+
l === "table" && /* @__PURE__ */ t(
|
|
2240
2242
|
Jt,
|
|
2241
2243
|
{
|
|
2242
2244
|
columns: h,
|
|
2243
2245
|
onChange: N,
|
|
2244
|
-
keyColumn:
|
|
2246
|
+
keyColumn: u,
|
|
2245
2247
|
onKeyColumnChange: k,
|
|
2246
2248
|
columnErrors: g
|
|
2247
2249
|
}
|
|
@@ -2265,8 +2267,8 @@ function Aa(e) {
|
|
|
2265
2267
|
] })
|
|
2266
2268
|
] });
|
|
2267
2269
|
}
|
|
2268
|
-
function
|
|
2269
|
-
const i = G(e),
|
|
2270
|
+
function vi({ project: e, onOpen: n, getHref: a, slots: s }) {
|
|
2271
|
+
const i = G(e), l = On(i ?? void 0), o = jn(), [c, d] = f(!1), [h, N] = f(null), [u, k] = f(null), b = (s == null ? void 0 : s.header) === void 0 ? /* @__PURE__ */ r("div", { children: [
|
|
2270
2272
|
/* @__PURE__ */ t("h3", { children: "Data stores" }),
|
|
2271
2273
|
/* @__PURE__ */ t("p", { className: "muted small", children: "Key-value, document and table storage for this project." })
|
|
2272
2274
|
] }) : s.header;
|
|
@@ -2274,15 +2276,15 @@ function yi({ project: e, onOpen: n, getHref: a, slots: s }) {
|
|
|
2274
2276
|
/* @__PURE__ */ t(
|
|
2275
2277
|
Bt,
|
|
2276
2278
|
{
|
|
2277
|
-
stores:
|
|
2278
|
-
loading:
|
|
2279
|
-
error:
|
|
2279
|
+
stores: l.data ?? [],
|
|
2280
|
+
loading: l.isLoading,
|
|
2281
|
+
error: u ?? (l.error != null ? V(l.error).message : null),
|
|
2280
2282
|
onOpen: n,
|
|
2281
2283
|
getHref: a,
|
|
2282
2284
|
onArchive: (D) => {
|
|
2283
2285
|
k(null), N(D);
|
|
2284
2286
|
},
|
|
2285
|
-
busy:
|
|
2287
|
+
busy: o.isPending,
|
|
2286
2288
|
slots: {
|
|
2287
2289
|
header: b,
|
|
2288
2290
|
actions: /* @__PURE__ */ t(
|
|
@@ -2292,7 +2294,7 @@ function yi({ project: e, onOpen: n, getHref: a, slots: s }) {
|
|
|
2292
2294
|
className: "btn",
|
|
2293
2295
|
"data-testid": "data-store-new",
|
|
2294
2296
|
disabled: i == null,
|
|
2295
|
-
onClick: () =>
|
|
2297
|
+
onClick: () => d(!0),
|
|
2296
2298
|
children: "+ New data store"
|
|
2297
2299
|
}
|
|
2298
2300
|
),
|
|
@@ -2300,7 +2302,7 @@ function yi({ project: e, onOpen: n, getHref: a, slots: s }) {
|
|
|
2300
2302
|
}
|
|
2301
2303
|
}
|
|
2302
2304
|
),
|
|
2303
|
-
c && i != null && /* @__PURE__ */ t(
|
|
2305
|
+
c && i != null && /* @__PURE__ */ t(Ra, { project: i, onClose: () => d(!1) }),
|
|
2304
2306
|
h && /* @__PURE__ */ t(
|
|
2305
2307
|
he,
|
|
2306
2308
|
{
|
|
@@ -2309,7 +2311,7 @@ function yi({ project: e, onOpen: n, getHref: a, slots: s }) {
|
|
|
2309
2311
|
confirmLabel: "Archive",
|
|
2310
2312
|
onConfirm: () => {
|
|
2311
2313
|
const D = h;
|
|
2312
|
-
N(null), i != null &&
|
|
2314
|
+
N(null), i != null && o.mutate(
|
|
2313
2315
|
{ id: D.id, project: i },
|
|
2314
2316
|
{ onError: (g) => k(V(g).message) }
|
|
2315
2317
|
);
|
|
@@ -2320,23 +2322,23 @@ function yi({ project: e, onOpen: n, getHref: a, slots: s }) {
|
|
|
2320
2322
|
] });
|
|
2321
2323
|
}
|
|
2322
2324
|
export {
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2325
|
+
ci as ActivitySummary,
|
|
2326
|
+
hi as ConnectionDetail,
|
|
2327
|
+
mi as ConnectionList,
|
|
2328
|
+
gi as CredentialDetail,
|
|
2329
|
+
fi as CredentialList,
|
|
2330
|
+
vi as DataStoreList,
|
|
2331
|
+
yi as DataStoreView,
|
|
2332
|
+
oi as DocumentList,
|
|
2333
|
+
si as EndpointList,
|
|
2334
|
+
ii as FunctionList,
|
|
2335
|
+
Zn as Logs,
|
|
2336
|
+
di as LogsView,
|
|
2337
|
+
wi as ModelCatalog,
|
|
2338
|
+
pi as ModelUsage,
|
|
2339
|
+
li as ReliabilityBoard,
|
|
2340
|
+
zn as RunHistory,
|
|
2341
|
+
ui as ServiceDetail,
|
|
2342
|
+
ri as WorkflowList
|
|
2341
2343
|
};
|
|
2342
2344
|
//# sourceMappingURL=lists.mjs.map
|