@w6w/embed 0.2.23 → 0.2.26
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/{ImportSpecModal-Cpzp8ndt.js → ImportSpecModal-VdYN1QeZ.js} +21 -20
- package/dist/{ImportSpecModal-Cpzp8ndt.js.map → ImportSpecModal-VdYN1QeZ.js.map} +1 -1
- package/dist/{WorkflowEditor-LesBKjb2.js → WorkflowEditor-CGKoeSG7.js} +6 -6
- package/dist/{WorkflowEditor-LesBKjb2.js.map → WorkflowEditor-CGKoeSG7.js.map} +1 -1
- package/dist/{apps-CYUgEfGf.js → apps-FMcQfyL2.js} +2 -2
- package/dist/{apps-CYUgEfGf.js.map → apps-FMcQfyL2.js.map} +1 -1
- package/dist/chrome/ImportSpecModal.d.ts +2 -0
- package/dist/{credentials-Cn92LGhJ.js → credentials-CMR_wEvx.js} +96 -71
- package/dist/credentials-CMR_wEvx.js.map +1 -0
- package/dist/editor-apps-HEOclsxL.js +152 -0
- package/dist/{editor-apps-LZmDWMqf.js.map → editor-apps-HEOclsxL.js.map} +1 -1
- package/dist/{editor-tools-DHyWiG21.js → editor-tools-Brw0cv2F.js} +4 -4
- package/dist/{editor-tools-DHyWiG21.js.map → editor-tools-Brw0cv2F.js.map} +1 -1
- package/dist/editor.mjs +1 -1
- package/dist/editors.mjs +7 -7
- package/dist/index.mjs +15 -15
- package/dist/lib/workflow-blank.d.ts +12 -2
- package/dist/lib.mjs +41 -39
- package/dist/lists/ConnectionList.d.ts +3 -1
- package/dist/lists/CredentialCreate.d.ts +25 -0
- package/dist/lists/CredentialDetail.d.ts +5 -1
- package/dist/lists/CredentialList.d.ts +3 -1
- package/dist/lists.d.ts +2 -0
- package/dist/lists.mjs +943 -768
- package/dist/lists.mjs.map +1 -1
- package/dist/models-CK1KHd39.js.map +1 -1
- package/dist/rail.mjs +1 -1
- package/dist/repos/agents-studio-agents.d.ts +46 -2
- package/dist/repos/credentials.d.ts +16 -2
- package/dist/repos/models.d.ts +36 -6
- package/dist/repos.mjs +468 -451
- package/dist/repos.mjs.map +1 -1
- package/dist/{spec-export-DGigBUsP.js → spec-export-DMMET5VM.js} +2 -2
- package/dist/{spec-export-DGigBUsP.js.map → spec-export-DMMET5VM.js.map} +1 -1
- package/dist/workflow-blank-BJFLdGyE.js +37 -0
- package/dist/workflow-blank-BJFLdGyE.js.map +1 -0
- package/dist/{workflows-BK6IM4if.js → workflows-Dz8LMjnt.js} +37 -34
- package/dist/workflows-Dz8LMjnt.js.map +1 -0
- package/package.json +2 -2
- package/dist/credentials-Cn92LGhJ.js.map +0 -1
- package/dist/editor-apps-LZmDWMqf.js +0 -152
- package/dist/workflow-blank-CorOIrSj.js +0 -21
- package/dist/workflow-blank-CorOIrSj.js.map +0 -1
- package/dist/workflows-BK6IM4if.js.map +0 -1
package/dist/lists.mjs
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as r, jsx as t, Fragment as
|
|
3
|
-
import { useState as f, useMemo as
|
|
4
|
-
import { F as
|
|
5
|
-
import { d as
|
|
6
|
-
import { u as
|
|
7
|
-
import { CallableList as
|
|
8
|
-
import { I as
|
|
9
|
-
import { i as
|
|
10
|
-
import { a3 as
|
|
11
|
-
import { b as
|
|
12
|
-
import { f as
|
|
13
|
-
import { C as
|
|
14
|
-
import { D as
|
|
15
|
-
import { k as
|
|
16
|
-
import { H as
|
|
17
|
-
import { ApiError as
|
|
18
|
-
import { useQueryClient as
|
|
19
|
-
import { u as
|
|
20
|
-
import { M as
|
|
21
|
-
import { j as
|
|
22
|
-
import { u as
|
|
23
|
-
import { r as
|
|
24
|
-
import {
|
|
25
|
-
import { h as
|
|
26
|
-
function
|
|
27
|
-
const { kind: n } = e, a =
|
|
2
|
+
import { jsxs as r, jsx as t, Fragment as K } from "react/jsx-runtime";
|
|
3
|
+
import { useState as f, useMemo as ie, useEffect as gt } from "react";
|
|
4
|
+
import { F as yt, E as vt } from "./CreateFunctionModal-DScxp_LN.js";
|
|
5
|
+
import { d as Nt, f as bt, h as kt, b as qe, n as Te, u as Ct, m as Tt } from "./endpoints-DSRo1Lc5.js";
|
|
6
|
+
import { u as X, b as $e } from "./project-context-Tvp-La7A.js";
|
|
7
|
+
import { CallableList as $t, ReliabilityList as Dt, EmptyState as De, DataTable as xe, EditButton as _e, DeleteButton as xt, ListItem as ke, HealthStatusPill as he, HistoryTimeline as Lt, useW6WApi as We, connectionAppIdsToLookUp as Be, ConnectionList as Et, AddConnectionModal as It, EditConnectionModal as Ue, Modal as Mt, resolveConnectionAppMeta as At, ConnectionHeader as Rt, IconButton as St, locateDataStoreError as Pt, tableSchemaOf as Ot, draftFromEntry as ue, CsvPanel as jt, DataTableGrid as Kt, NEW_ROW_ID as ne, newRowDraft as Me, kvValueTypeOf as Ft, DataEntryList as Qt, DataEntryEditor as qt, dirtyColumns as _t, csvFilenameOf as Wt, csvImportMessage as Ae, buildRowValue as Bt, rowWriteOf as Ut, remainingTtlSeconds as Ve, isVersionConflict as He, cellErrorsOf as Vt, parseDocText as Ht, kvValueOf as Jt, serializeCell as Yt, DataStoreList as zt, DATA_STORE_KINDS as Gt, DATA_STORE_KIND_LABEL as Zt, SCALAR_TYPES as Xt, ColumnsEditor as en, errorPlacement as tn } from "@w6w/ui";
|
|
8
|
+
import { I as nn } from "./ImportSpecModal-VdYN1QeZ.js";
|
|
9
|
+
import { i as an } from "./import-bindings-EUtxZ9Ti.js";
|
|
10
|
+
import { a3 as sn, a1 as Je, T as rn, E as ln } from "./workflows-Dz8LMjnt.js";
|
|
11
|
+
import { n as on, b as cn } from "./workflow-blank-BJFLdGyE.js";
|
|
12
|
+
import { f as dn, e as Re, g as un, b as mn, h as hn, i as wn } from "./api-calls--JHyif6a.js";
|
|
13
|
+
import { C as pe, a as pn, M as fn } from "./ConfirmModal-Pv2-A_3U.js";
|
|
14
|
+
import { D as gn } from "./DocumentFormModal-Br4s8wmi.js";
|
|
15
|
+
import { k as yn, i as vn } from "./spec-import-SWOonsNr.js";
|
|
16
|
+
import { H as Nn, a as Ye } from "./editor-apps-HEOclsxL.js";
|
|
17
|
+
import { ApiError as ze } from "@w6w/sdk";
|
|
18
|
+
import { useQueryClient as fe, useInfiniteQuery as Ge } from "@tanstack/react-query";
|
|
19
|
+
import { u as bn, o as kn, k as Ze, c as Ce, b as Xe, m as Cn, p as Tn } from "./connections-CzsCyIxY.js";
|
|
20
|
+
import { M as $n } from "./ModelRoutesManager-Bv6qefnq.js";
|
|
21
|
+
import { j as Dn } from "./apps-FMcQfyL2.js";
|
|
22
|
+
import { u as ge } from "./client-context-CX61Bgw-.js";
|
|
23
|
+
import { r as xn, x as Ln, p as En, A as In } from "./models-CK1KHd39.js";
|
|
24
|
+
import { v as Mn, q as Le, n as An, f as et, p as Rn, o as Sn, x as Pn, y as On, z as jn, w as Kn } from "./credentials-CMR_wEvx.js";
|
|
25
|
+
import { h as Fn, k as tt, p as nt, o as Qn, j as at, n as qn, m as _n, g as it, i as Wn, u as Bn, f as Un } from "./data-stores-UeQvwVCa.js";
|
|
26
|
+
function Ee(e) {
|
|
27
|
+
const { kind: n } = e, a = Nt(n), [s, i] = f(!1), o = (e.rows ?? []).map((l) => ({
|
|
28
28
|
...e.toRow(l),
|
|
29
29
|
id: l.id,
|
|
30
|
-
archived:
|
|
30
|
+
archived: an(l)
|
|
31
31
|
}));
|
|
32
32
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
|
|
33
33
|
/* @__PURE__ */ t(
|
|
34
|
-
|
|
34
|
+
$t,
|
|
35
35
|
{
|
|
36
36
|
rows: o,
|
|
37
37
|
title: a.listTitle,
|
|
@@ -55,14 +55,14 @@ function Te(e) {
|
|
|
55
55
|
}
|
|
56
56
|
),
|
|
57
57
|
s && /* @__PURE__ */ t(
|
|
58
|
-
|
|
58
|
+
nn,
|
|
59
59
|
{
|
|
60
60
|
kind: n,
|
|
61
61
|
project: e.project ?? void 0,
|
|
62
|
-
listKeys: { functionsKey:
|
|
63
|
-
onOpenImported: (l,
|
|
64
|
-
var
|
|
65
|
-
return (
|
|
62
|
+
listKeys: { functionsKey: kt, endpointsKey: bt, workflowsKey: sn },
|
|
63
|
+
onOpenImported: (l, d) => {
|
|
64
|
+
var u;
|
|
65
|
+
return (u = e.onOpen) == null ? void 0 : u.call(e, d);
|
|
66
66
|
},
|
|
67
67
|
onClose: () => i(!1)
|
|
68
68
|
}
|
|
@@ -70,10 +70,10 @@ function Te(e) {
|
|
|
70
70
|
e.children
|
|
71
71
|
] });
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
const n =
|
|
73
|
+
function mi(e) {
|
|
74
|
+
const n = qe(), a = X(e.project), [s, i] = f(null);
|
|
75
75
|
return /* @__PURE__ */ t(
|
|
76
|
-
|
|
76
|
+
Ee,
|
|
77
77
|
{
|
|
78
78
|
kind: "function",
|
|
79
79
|
rows: n.data,
|
|
@@ -87,10 +87,10 @@ function ai(e) {
|
|
|
87
87
|
}),
|
|
88
88
|
onOpen: e.onOpen,
|
|
89
89
|
getHref: e.getHref,
|
|
90
|
-
onCreate: () => i(
|
|
90
|
+
onCreate: () => i(Te("function")),
|
|
91
91
|
slots: e.slots,
|
|
92
92
|
children: s !== null && /* @__PURE__ */ t(
|
|
93
|
-
|
|
93
|
+
yt,
|
|
94
94
|
{
|
|
95
95
|
newId: s,
|
|
96
96
|
takenKeys: (n.data ?? []).map((o) => o.key),
|
|
@@ -104,10 +104,10 @@ function ai(e) {
|
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
const n =
|
|
107
|
+
function hi(e) {
|
|
108
|
+
const n = Ct(), a = X(e.project), [s, i] = f(null);
|
|
109
109
|
return /* @__PURE__ */ t(
|
|
110
|
-
|
|
110
|
+
Ee,
|
|
111
111
|
{
|
|
112
112
|
kind: "endpoint",
|
|
113
113
|
rows: n.data,
|
|
@@ -117,9 +117,9 @@ function ii(e) {
|
|
|
117
117
|
toRow: (o) => ({
|
|
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
|
-
title: /* @__PURE__ */ r(
|
|
120
|
+
title: /* @__PURE__ */ r(K, { children: [
|
|
121
121
|
/* @__PURE__ */ t("strong", { children: o.displayName || o.key }),
|
|
122
|
-
|
|
122
|
+
Tt(o) ? /* @__PURE__ */ t(
|
|
123
123
|
"span",
|
|
124
124
|
{
|
|
125
125
|
className: "tag warn",
|
|
@@ -133,10 +133,10 @@ function ii(e) {
|
|
|
133
133
|
}),
|
|
134
134
|
onOpen: e.onOpen,
|
|
135
135
|
getHref: e.getHref,
|
|
136
|
-
onCreate: () => i(
|
|
136
|
+
onCreate: () => i(Te("endpoint")),
|
|
137
137
|
slots: e.slots,
|
|
138
138
|
children: s !== null && /* @__PURE__ */ t(
|
|
139
|
-
|
|
139
|
+
vt,
|
|
140
140
|
{
|
|
141
141
|
newId: s,
|
|
142
142
|
takenKeys: (n.data ?? []).map((o) => o.key),
|
|
@@ -150,10 +150,10 @@ function ii(e) {
|
|
|
150
150
|
}
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
const n =
|
|
153
|
+
function wi(e) {
|
|
154
|
+
const n = X(e.project), a = Je(n ?? void 0, n != null), s = rn(n ?? void 0), [i, o] = f(null);
|
|
155
155
|
return /* @__PURE__ */ t(
|
|
156
|
-
|
|
156
|
+
Ee,
|
|
157
157
|
{
|
|
158
158
|
kind: "workflow",
|
|
159
159
|
rows: a.data,
|
|
@@ -163,8 +163,8 @@ function si(e) {
|
|
|
163
163
|
toRow: (l) => ({
|
|
164
164
|
title: l.displayName || l.name,
|
|
165
165
|
description: l.description,
|
|
166
|
-
badges: /* @__PURE__ */ r(
|
|
167
|
-
l.tags.length > 0 && /* @__PURE__ */ t("span", { className: "wf-row-tags", children: l.tags.map((
|
|
166
|
+
badges: /* @__PURE__ */ r(K, { children: [
|
|
167
|
+
l.tags.length > 0 && /* @__PURE__ */ t("span", { className: "wf-row-tags", children: l.tags.map((d) => /* @__PURE__ */ t("span", { className: "tag", children: d }, d)) }),
|
|
168
168
|
l.status !== "archived" && /* @__PURE__ */ t("span", { className: `badge wf-status ${l.status}`, children: l.status })
|
|
169
169
|
] }),
|
|
170
170
|
trailing: /* @__PURE__ */ r("span", { className: "wf-col wf-col-stats muted small", children: [
|
|
@@ -176,12 +176,14 @@ function si(e) {
|
|
|
176
176
|
onOpen: e.onOpen,
|
|
177
177
|
getHref: e.getHref,
|
|
178
178
|
onCreate: () => {
|
|
179
|
-
o(null)
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
o(null);
|
|
180
|
+
const l = on((a.data ?? []).map((d) => d.displayName || d.name));
|
|
181
|
+
s.mutate(cn(Te("workflow"), l), {
|
|
182
|
+
onSuccess: (d) => {
|
|
183
|
+
var u;
|
|
184
|
+
return (u = e.onCreated) == null ? void 0 : u.call(e, d.workflow.id);
|
|
183
185
|
},
|
|
184
|
-
onError: (
|
|
186
|
+
onError: (d) => o(d instanceof Error ? d.message : String(d))
|
|
185
187
|
});
|
|
186
188
|
},
|
|
187
189
|
creating: s.isPending,
|
|
@@ -189,7 +191,7 @@ function si(e) {
|
|
|
189
191
|
}
|
|
190
192
|
);
|
|
191
193
|
}
|
|
192
|
-
function
|
|
194
|
+
function pi({
|
|
193
195
|
project: e,
|
|
194
196
|
variant: n = "full",
|
|
195
197
|
limit: a,
|
|
@@ -197,46 +199,46 @@ function ri({
|
|
|
197
199
|
showChart: i,
|
|
198
200
|
getHref: o,
|
|
199
201
|
onOpen: l,
|
|
200
|
-
showAllHref:
|
|
201
|
-
onShowAll:
|
|
202
|
+
showAllHref: d,
|
|
203
|
+
onShowAll: u,
|
|
202
204
|
slots: h
|
|
203
205
|
}) {
|
|
204
|
-
var g,
|
|
205
|
-
const
|
|
206
|
-
let
|
|
207
|
-
return
|
|
208
|
-
|
|
206
|
+
var g, m;
|
|
207
|
+
const v = $e().project, w = e === void 0 ? v : e, b = w || null, N = dn(b ?? void 0, s);
|
|
208
|
+
let $ = h == null ? void 0 : h.empty;
|
|
209
|
+
return b ? N.isLoading ? $ = /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) : N.error && ($ = /* @__PURE__ */ t("div", { className: "error", children: N.error.message })) : $ = /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see its reliability." }), /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ t(
|
|
210
|
+
Dt,
|
|
209
211
|
{
|
|
210
|
-
services:
|
|
211
|
-
window:
|
|
212
|
+
services: b ? ((g = N.data) == null ? void 0 : g.services) ?? [] : [],
|
|
213
|
+
window: b ? (m = N.data) == null ? void 0 : m.window : void 0,
|
|
212
214
|
days: s,
|
|
213
215
|
compact: n === "compact",
|
|
214
216
|
showChart: i,
|
|
215
217
|
limit: a,
|
|
216
218
|
getHref: o,
|
|
217
219
|
onOpen: l,
|
|
218
|
-
showAllHref:
|
|
219
|
-
onShowAll:
|
|
220
|
-
slots: { ...h, empty:
|
|
220
|
+
showAllHref: d,
|
|
221
|
+
onShowAll: u,
|
|
222
|
+
slots: { ...h, empty: $ }
|
|
221
223
|
}
|
|
222
224
|
) });
|
|
223
225
|
}
|
|
224
|
-
function
|
|
226
|
+
function Vn(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 fi({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
229
231
|
var g;
|
|
230
|
-
const o =
|
|
232
|
+
const o = X(e), l = yn(o ?? void 0, o != null), d = vn(), [u, h] = f(null), [v, w] = f(null), b = (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
|
-
] }) : s.header,
|
|
235
|
+
] }) : s.header, N = (s == null ? void 0 : s.empty) === void 0 ? /* @__PURE__ */ t(De, { testId: "document-list-empty", children: "No documents yet." }) : s.empty, $ = [
|
|
234
236
|
{
|
|
235
237
|
key: "key",
|
|
236
238
|
header: "Document",
|
|
237
|
-
render: (
|
|
238
|
-
var
|
|
239
|
-
const y = (
|
|
239
|
+
render: (m) => {
|
|
240
|
+
var D;
|
|
241
|
+
const y = (D = i == null ? void 0 : i.lead) == null ? void 0 : D.call(i, m);
|
|
240
242
|
return /* @__PURE__ */ r("span", { style: { display: "flex", alignItems: "center" }, children: [
|
|
241
243
|
y,
|
|
242
244
|
/* @__PURE__ */ r(
|
|
@@ -245,14 +247,14 @@ function li({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
|
245
247
|
className: "list-main",
|
|
246
248
|
style: { marginLeft: y != null ? "var(--w6w-sp-2)" : 0 },
|
|
247
249
|
children: [
|
|
248
|
-
/* @__PURE__ */ t("strong", { className: "list-name", title:
|
|
250
|
+
/* @__PURE__ */ t("strong", { className: "list-name", title: m.key, children: m.key }),
|
|
249
251
|
" ",
|
|
250
|
-
/* @__PURE__ */ t("span", { className: "tag", children:
|
|
252
|
+
/* @__PURE__ */ t("span", { className: "tag", children: m.format }),
|
|
251
253
|
/* @__PURE__ */ r("div", { className: "muted small list-preview", children: [
|
|
252
|
-
/* @__PURE__ */ t("code", { children:
|
|
253
|
-
|
|
254
|
+
/* @__PURE__ */ t("code", { children: Vn(m.content) }),
|
|
255
|
+
m.description && /* @__PURE__ */ r(K, { children: [
|
|
254
256
|
" · ",
|
|
255
|
-
|
|
257
|
+
m.description
|
|
256
258
|
] })
|
|
257
259
|
] })
|
|
258
260
|
]
|
|
@@ -266,31 +268,31 @@ function li({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
|
266
268
|
header: "",
|
|
267
269
|
align: "right",
|
|
268
270
|
link: !1,
|
|
269
|
-
render: (
|
|
270
|
-
var
|
|
271
|
-
const y = (
|
|
271
|
+
render: (m) => {
|
|
272
|
+
var D, E;
|
|
273
|
+
const y = (D = i == null ? void 0 : i.footer) == null ? void 0 : D.call(i, m);
|
|
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
|
-
/* @__PURE__ */ r("div", { onClick: (
|
|
277
|
+
/* @__PURE__ */ r("div", { onClick: (x) => x.stopPropagation(), children: [
|
|
276
278
|
/* @__PURE__ */ r("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)", justifyContent: "flex-end" }, children: [
|
|
277
|
-
/* @__PURE__ */ t(
|
|
278
|
-
|
|
279
|
+
/* @__PURE__ */ t(pn, { resource: { kind: "document", key: m.key } }),
|
|
280
|
+
m.shared ? (E = i == null ? void 0 : i.sharedActions) == null ? void 0 : E.call(i, m) : /* @__PURE__ */ r(K, { children: [
|
|
279
281
|
/* @__PURE__ */ t(
|
|
280
|
-
|
|
282
|
+
_e,
|
|
281
283
|
{
|
|
282
284
|
label: "Edit",
|
|
283
|
-
onClick: () => h({ mode: "edit", d:
|
|
284
|
-
"data-testid": `document-edit-${
|
|
285
|
+
onClick: () => h({ mode: "edit", d: m }),
|
|
286
|
+
"data-testid": `document-edit-${m.id}`
|
|
285
287
|
}
|
|
286
288
|
),
|
|
287
289
|
/* @__PURE__ */ t(
|
|
288
|
-
|
|
290
|
+
xt,
|
|
289
291
|
{
|
|
290
292
|
label: "Delete",
|
|
291
|
-
onClick: () =>
|
|
292
|
-
disabled:
|
|
293
|
-
"data-testid": `document-delete-${
|
|
293
|
+
onClick: () => w(m),
|
|
294
|
+
disabled: d.isPending,
|
|
295
|
+
"data-testid": `document-delete-${m.id}`
|
|
294
296
|
}
|
|
295
297
|
)
|
|
296
298
|
] })
|
|
@@ -304,7 +306,7 @@ function li({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
|
304
306
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
|
|
305
307
|
/* @__PURE__ */ r("section", { className: "section", children: [
|
|
306
308
|
/* @__PURE__ */ r("div", { className: "section-head", children: [
|
|
307
|
-
|
|
309
|
+
b,
|
|
308
310
|
/* @__PURE__ */ t(
|
|
309
311
|
"button",
|
|
310
312
|
{
|
|
@@ -318,43 +320,43 @@ function li({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
|
|
|
318
320
|
] }),
|
|
319
321
|
/* @__PURE__ */ r("div", { children: [
|
|
320
322
|
l.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
|
|
321
|
-
((g = l.data) == null ? void 0 : g.length) === 0 &&
|
|
323
|
+
((g = l.data) == null ? void 0 : g.length) === 0 && N,
|
|
322
324
|
l.data != null && l.data.length > 0 && /* @__PURE__ */ t(
|
|
323
|
-
|
|
325
|
+
xe,
|
|
324
326
|
{
|
|
325
|
-
columns:
|
|
327
|
+
columns: $,
|
|
326
328
|
rows: l.data,
|
|
327
|
-
rowKey: (
|
|
328
|
-
getRowHref: a ? (
|
|
329
|
-
onRowClick: n ? (
|
|
329
|
+
rowKey: (m) => m.id,
|
|
330
|
+
getRowHref: a ? (m) => a(m.id) : void 0,
|
|
331
|
+
onRowClick: n ? (m, y) => n(m.id, y) : void 0
|
|
330
332
|
}
|
|
331
333
|
)
|
|
332
334
|
] })
|
|
333
335
|
] }),
|
|
334
|
-
|
|
335
|
-
|
|
336
|
+
u && /* @__PURE__ */ t(
|
|
337
|
+
gn,
|
|
336
338
|
{
|
|
337
|
-
initial:
|
|
339
|
+
initial: u.mode === "edit" ? u.d : void 0,
|
|
338
340
|
project: o,
|
|
339
341
|
onClose: () => h(null),
|
|
340
342
|
onSaved: () => h(null)
|
|
341
343
|
}
|
|
342
344
|
),
|
|
343
|
-
|
|
344
|
-
|
|
345
|
+
v && /* @__PURE__ */ t(
|
|
346
|
+
pe,
|
|
345
347
|
{
|
|
346
348
|
title: "Delete document",
|
|
347
|
-
message: `Delete the document "${
|
|
349
|
+
message: `Delete the document "${v.key}"? This cannot be undone.`,
|
|
348
350
|
confirmLabel: "Delete",
|
|
349
351
|
onConfirm: () => {
|
|
350
|
-
o != null &&
|
|
352
|
+
o != null && d.mutate({ id: v.id, project: o }), w(null);
|
|
351
353
|
},
|
|
352
|
-
onClose: () =>
|
|
354
|
+
onClose: () => w(null)
|
|
353
355
|
}
|
|
354
356
|
)
|
|
355
357
|
] });
|
|
356
358
|
}
|
|
357
|
-
const
|
|
359
|
+
const Hn = {
|
|
358
360
|
workflow: "Workflow run",
|
|
359
361
|
workflow_step: "Workflow step",
|
|
360
362
|
connection_test: "Connection test",
|
|
@@ -365,10 +367,10 @@ const Qn = {
|
|
|
365
367
|
endpoint: "Endpoint call",
|
|
366
368
|
action: "App action"
|
|
367
369
|
};
|
|
368
|
-
function
|
|
369
|
-
return
|
|
370
|
+
function we(e) {
|
|
371
|
+
return Hn[e] ?? e;
|
|
370
372
|
}
|
|
371
|
-
const
|
|
373
|
+
const st = {
|
|
372
374
|
workflow: "workflow",
|
|
373
375
|
workflow_step: "workflow_step",
|
|
374
376
|
connection_test: "base",
|
|
@@ -377,13 +379,13 @@ const tt = {
|
|
|
377
379
|
endpoint: "base",
|
|
378
380
|
action: "base"
|
|
379
381
|
};
|
|
380
|
-
function
|
|
381
|
-
return Object.hasOwn(
|
|
382
|
+
function Jn(e) {
|
|
383
|
+
return Object.hasOwn(st, e);
|
|
382
384
|
}
|
|
383
|
-
function
|
|
384
|
-
return
|
|
385
|
+
function rt(e) {
|
|
386
|
+
return Jn(e) ? st[e] : "base";
|
|
385
387
|
}
|
|
386
|
-
function
|
|
388
|
+
function Yn(e, n) {
|
|
387
389
|
const a = /* @__PURE__ */ new Map();
|
|
388
390
|
for (const i of e ?? []) {
|
|
389
391
|
const o = i.displayName || i.key;
|
|
@@ -396,8 +398,8 @@ function qn(e, n) {
|
|
|
396
398
|
}
|
|
397
399
|
return { functions: a, workflows: s };
|
|
398
400
|
}
|
|
399
|
-
function
|
|
400
|
-
const a = e.summary ??
|
|
401
|
+
function zn(e, n) {
|
|
402
|
+
const a = e.summary ?? we(e.kind), s = rt(e.kind);
|
|
401
403
|
if (s === "function" && e.functionId !== null) {
|
|
402
404
|
const i = n.functions.get(e.functionId);
|
|
403
405
|
if (i !== void 0)
|
|
@@ -409,42 +411,42 @@ 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, o = i !== null ? n.workflows.get(i) : void 0, l = o ?? i ?? e.summary ?? "Unknown workflow",
|
|
414
|
+
const i = e.workflowId, o = i !== null ? n.workflows.get(i) : void 0, l = o ?? i ?? e.summary ?? "Unknown workflow", d = o !== void 0 && i !== null;
|
|
413
415
|
return {
|
|
414
416
|
text: e.stepId ? `${l} - ${e.stepId}` : l,
|
|
415
|
-
target:
|
|
417
|
+
target: d ? { kind: "workflow", id: i } : null
|
|
416
418
|
};
|
|
417
419
|
}
|
|
418
420
|
return { text: a, target: null };
|
|
419
421
|
}
|
|
420
|
-
const
|
|
421
|
-
function
|
|
422
|
+
const oe = (e) => String(e).padStart(2, "0");
|
|
423
|
+
function lt(e) {
|
|
422
424
|
const n = new Date(e);
|
|
423
|
-
return Number.isNaN(n.getTime()) ? e : `${`${n.getFullYear()}-${
|
|
425
|
+
return Number.isNaN(n.getTime()) ? e : `${`${n.getFullYear()}-${oe(n.getMonth() + 1)}-${oe(n.getDate())}`} ${oe(n.getHours())}:${oe(n.getMinutes())}:${oe(n.getSeconds())}`;
|
|
424
426
|
}
|
|
425
|
-
function
|
|
427
|
+
function ot(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 Gn() {
|
|
429
431
|
const e = /* @__PURE__ */ new Date();
|
|
430
432
|
return e.setHours(0, 0, 0, 0), e.toISOString();
|
|
431
433
|
}
|
|
432
|
-
function
|
|
434
|
+
function Zn(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" });
|
|
436
438
|
return n === "week" ? `Week of ${s}` : s;
|
|
437
439
|
}
|
|
438
|
-
function
|
|
440
|
+
function ct({ ok: e }) {
|
|
439
441
|
return e === null ? /* @__PURE__ */ t("span", { className: "muted", children: "–" }) : /* @__PURE__ */ t("span", { className: e ? "ok" : "error", children: e ? "✓" : "✗" });
|
|
440
442
|
}
|
|
441
|
-
function
|
|
443
|
+
function ve({ label: e, value: n }) {
|
|
442
444
|
return /* @__PURE__ */ r("div", { className: "w6w-activity-card w6w-activity-stat", children: [
|
|
443
445
|
/* @__PURE__ */ t("div", { className: "w6w-activity-stat-value", children: n }),
|
|
444
446
|
/* @__PURE__ */ t("div", { className: "muted small", children: e })
|
|
445
447
|
] });
|
|
446
448
|
}
|
|
447
|
-
function
|
|
449
|
+
function Se({
|
|
448
450
|
title: e,
|
|
449
451
|
headline: n,
|
|
450
452
|
loading: a
|
|
@@ -453,131 +455,131 @@ function Ae({
|
|
|
453
455
|
return /* @__PURE__ */ r("section", { className: "w6w-activity-section", children: [
|
|
454
456
|
/* @__PURE__ */ t("h3", { children: e }),
|
|
455
457
|
a ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : /* @__PURE__ */ r("div", { className: "w6w-activity-stats", children: [
|
|
456
|
-
/* @__PURE__ */ t(
|
|
457
|
-
/* @__PURE__ */ t(
|
|
458
|
-
/* @__PURE__ */ t(
|
|
458
|
+
/* @__PURE__ */ t(ve, { label: "Workflow runs", value: s.workflowRuns }),
|
|
459
|
+
/* @__PURE__ */ t(ve, { label: "Succeeded", value: s.succeeded }),
|
|
460
|
+
/* @__PURE__ */ t(ve, { label: "Failed", value: s.failed })
|
|
459
461
|
] })
|
|
460
462
|
] });
|
|
461
463
|
}
|
|
462
|
-
function
|
|
464
|
+
function Xn({
|
|
463
465
|
entry: e,
|
|
464
466
|
names: n,
|
|
465
467
|
getHref: a,
|
|
466
468
|
onOpen: s
|
|
467
469
|
}) {
|
|
468
|
-
const { text: i, target: o } =
|
|
469
|
-
if (o === null) return /* @__PURE__ */ t(
|
|
470
|
-
const l = s ? (
|
|
471
|
-
return a ? /* @__PURE__ */ t("a", { href: a(o), onClick: l, children: i }) : l ? /* @__PURE__ */ t("button", { type: "button", className: "w6w-activity-link", onClick: l, children: i }) : /* @__PURE__ */ t(
|
|
470
|
+
const { text: i, target: o } = zn(e, n);
|
|
471
|
+
if (o === null) return /* @__PURE__ */ t(K, { children: i });
|
|
472
|
+
const l = s ? (d) => s(o, d) : void 0;
|
|
473
|
+
return a ? /* @__PURE__ */ t("a", { href: a(o), onClick: l, children: i }) : l ? /* @__PURE__ */ t("button", { type: "button", className: "w6w-activity-link", onClick: l, children: i }) : /* @__PURE__ */ t(K, { children: i });
|
|
472
474
|
}
|
|
473
|
-
function
|
|
474
|
-
const a =
|
|
475
|
+
function dt({ entry: e, title: n }) {
|
|
476
|
+
const a = ot(e.durationMs);
|
|
475
477
|
return /* @__PURE__ */ t(
|
|
476
|
-
|
|
478
|
+
ke,
|
|
477
479
|
{
|
|
478
|
-
icon: /* @__PURE__ */ t(
|
|
479
|
-
title: n ?? e.summary ??
|
|
480
|
-
subtitle: `${
|
|
480
|
+
icon: /* @__PURE__ */ t(ct, { ok: e.ok }),
|
|
481
|
+
title: n ?? e.summary ?? we(e.kind),
|
|
482
|
+
subtitle: `${we(e.kind)} · ${lt(e.occurredAt)}`,
|
|
481
483
|
trailing: a === null ? void 0 : /* @__PURE__ */ t("span", { className: "muted small", children: a })
|
|
482
484
|
}
|
|
483
485
|
);
|
|
484
486
|
}
|
|
485
|
-
function
|
|
486
|
-
return /* @__PURE__ */ t(
|
|
487
|
+
function Ne(e) {
|
|
488
|
+
return /* @__PURE__ */ t(dt, { entry: e.entry, title: /* @__PURE__ */ t(Xn, { ...e }) });
|
|
487
489
|
}
|
|
488
|
-
const
|
|
489
|
-
base: (e) => /* @__PURE__ */ t(
|
|
490
|
-
function:
|
|
491
|
-
workflow:
|
|
492
|
-
workflow_step:
|
|
490
|
+
const ea = {
|
|
491
|
+
base: (e) => /* @__PURE__ */ t(dt, { entry: e.entry }),
|
|
492
|
+
function: Ne,
|
|
493
|
+
workflow: Ne,
|
|
494
|
+
workflow_step: Ne
|
|
493
495
|
};
|
|
494
|
-
function
|
|
495
|
-
const n =
|
|
496
|
+
function ta(e) {
|
|
497
|
+
const n = ea[rt(e.entry.kind)];
|
|
496
498
|
return /* @__PURE__ */ t(n, { ...e });
|
|
497
499
|
}
|
|
498
|
-
function
|
|
499
|
-
var
|
|
500
|
-
const s =
|
|
501
|
-
() =>
|
|
500
|
+
function gi({ getHref: e, onOpen: n, slots: a }) {
|
|
501
|
+
var $, g, m, y, D, E;
|
|
502
|
+
const s = Re("today", { from: Gn(), bucket: "day" }), i = Re("week", { bucket: "week" }), o = qe(), l = Je(), d = ie(
|
|
503
|
+
() => Yn(o.data, l.data),
|
|
502
504
|
[o.data, l.data]
|
|
503
|
-
),
|
|
505
|
+
), u = s.error ?? i.error, h = u ? u.message : null, v = (($ = i.data) == null ? void 0 : $.recent) ?? [], w = ((g = i.data) == null ? void 0 : g.series) ?? [], b = ((m = i.data) == null ? void 0 : m.range.bucket) ?? "week", N = !i.isLoading && v.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,
|
|
507
509
|
a == null ? void 0 : a.actions,
|
|
508
510
|
/* @__PURE__ */ t(
|
|
509
|
-
|
|
511
|
+
Se,
|
|
510
512
|
{
|
|
511
513
|
title: "Today",
|
|
512
|
-
headline: (
|
|
514
|
+
headline: (D = s.data) == null ? void 0 : D.headline,
|
|
513
515
|
loading: s.isLoading
|
|
514
516
|
}
|
|
515
517
|
),
|
|
516
518
|
/* @__PURE__ */ t(
|
|
517
|
-
|
|
519
|
+
Se,
|
|
518
520
|
{
|
|
519
521
|
title: "Last 7 days",
|
|
520
|
-
headline: (
|
|
522
|
+
headline: (E = i.data) == null ? void 0 : E.headline,
|
|
521
523
|
loading: i.isLoading
|
|
522
524
|
}
|
|
523
525
|
),
|
|
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…" }) : w.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No activity in this window yet." }) : /* @__PURE__ */ t("ul", { className: "list", children: w.map((x) => /* @__PURE__ */ r("li", { children: [
|
|
528
530
|
/* @__PURE__ */ r("span", { className: "list-main", children: [
|
|
529
|
-
/* @__PURE__ */ t("strong", { children:
|
|
531
|
+
/* @__PURE__ */ t("strong", { children: Zn(x.bucket, b) }),
|
|
530
532
|
" ",
|
|
531
|
-
/* @__PURE__ */ t("span", { className: "muted small", children:
|
|
533
|
+
/* @__PURE__ */ t("span", { className: "muted small", children: we(x.kind) })
|
|
532
534
|
] }),
|
|
533
535
|
" ",
|
|
534
|
-
/* @__PURE__ */ t(
|
|
536
|
+
/* @__PURE__ */ t(ct, { ok: x.ok }),
|
|
535
537
|
" ",
|
|
536
|
-
/* @__PURE__ */ t("span", { className: "muted small", children:
|
|
537
|
-
] }, `${
|
|
538
|
+
/* @__PURE__ */ t("span", { className: "muted small", children: x.count })
|
|
539
|
+
] }, `${x.bucket}-${x.kind}-${String(x.ok)}`)) }) })
|
|
538
540
|
] }),
|
|
539
541
|
/* @__PURE__ */ r("section", { children: [
|
|
540
542
|
/* @__PURE__ */ t("h3", { className: "w6w-activity-h3", children: "Recent activity" }),
|
|
541
|
-
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children: i.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) :
|
|
542
|
-
|
|
543
|
+
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children: i.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : N ? (a == null ? void 0 : a.empty) ?? /* @__PURE__ */ t("p", { className: "muted", children: "No runs yet — activity shows up here once your workflows run." }) : v.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No recent activity in this window." }) : /* @__PURE__ */ t("div", { className: "list", children: v.map((x) => /* @__PURE__ */ t(
|
|
544
|
+
ta,
|
|
543
545
|
{
|
|
544
|
-
entry:
|
|
545
|
-
names:
|
|
546
|
+
entry: x,
|
|
547
|
+
names: d,
|
|
546
548
|
getHref: e,
|
|
547
549
|
onOpen: n
|
|
548
550
|
},
|
|
549
|
-
|
|
551
|
+
x.id
|
|
550
552
|
)) }) })
|
|
551
553
|
] })
|
|
552
554
|
] });
|
|
553
555
|
}
|
|
554
|
-
function
|
|
556
|
+
function na(e) {
|
|
555
557
|
return e !== null && "project" in e;
|
|
556
558
|
}
|
|
557
|
-
function
|
|
558
|
-
const n =
|
|
559
|
+
function aa(e) {
|
|
560
|
+
const n = $e().project, [a, s] = f(ln), i = e.scope !== void 0 ? e.scope : n ? { project: n } : null, o = e.filters !== void 0, l = e.filters ?? a, d = (u) => {
|
|
559
561
|
var h;
|
|
560
|
-
o || s(
|
|
562
|
+
o || s(u), (h = e.onFiltersChange) == null || h.call(e, u);
|
|
561
563
|
};
|
|
562
564
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ t(
|
|
563
|
-
|
|
565
|
+
Nn,
|
|
564
566
|
{
|
|
565
567
|
scope: i,
|
|
566
|
-
showKind: e.showKind ??
|
|
568
|
+
showKind: e.showKind ?? na(i),
|
|
567
569
|
filters: l,
|
|
568
|
-
onFiltersChange:
|
|
570
|
+
onFiltersChange: d,
|
|
569
571
|
onOpenInEditor: e.onOpenInEditor
|
|
570
572
|
}
|
|
571
573
|
) });
|
|
572
574
|
}
|
|
573
|
-
function
|
|
575
|
+
function ia({ 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(aa, { ...n })
|
|
577
579
|
] });
|
|
578
580
|
}
|
|
579
|
-
const
|
|
580
|
-
function
|
|
581
|
+
const yi = ia, sa = 1440 * 60 * 1e3;
|
|
582
|
+
function ra(e) {
|
|
581
583
|
if (!(e === null || e.timeline === null))
|
|
582
584
|
return e.timeline.map((n) => ({
|
|
583
585
|
id: n.id,
|
|
@@ -590,39 +592,39 @@ function Gn(e) {
|
|
|
590
592
|
link: n.link
|
|
591
593
|
}));
|
|
592
594
|
}
|
|
593
|
-
function
|
|
595
|
+
function ut(e) {
|
|
594
596
|
return e.startedAt !== void 0 && e.resolvedAt === void 0;
|
|
595
597
|
}
|
|
596
|
-
function
|
|
598
|
+
function Pe(e) {
|
|
597
599
|
const n = new Date(e);
|
|
598
600
|
return Number.isNaN(n.getTime()) ? e : n.toLocaleDateString("en-US", { month: "short", day: "numeric", timeZone: "UTC" });
|
|
599
601
|
}
|
|
600
|
-
function
|
|
602
|
+
function Oe(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) / sa));
|
|
603
605
|
}
|
|
604
|
-
function
|
|
605
|
-
if (!
|
|
606
|
-
const a =
|
|
607
|
-
return `${i} · ${
|
|
606
|
+
function la(e, n) {
|
|
607
|
+
if (!ut(e) || e.startedAt === void 0) return null;
|
|
608
|
+
const a = Oe(e.startedAt, n), s = Pe(e.startedAt), i = a === 0 ? `open since ${s} (today)` : `open ${a}d (since ${s})`, o = e.updatedAt ?? e.startedAt, l = Oe(o, n), d = Pe(o), u = l === 0 ? `last update ${d} (today)` : `last update ${d} (${l}d ago)`;
|
|
609
|
+
return `${i} · ${u}`;
|
|
608
610
|
}
|
|
609
|
-
function
|
|
611
|
+
function oa(e) {
|
|
610
612
|
return e ? Object.entries(e) : [];
|
|
611
613
|
}
|
|
612
|
-
function
|
|
614
|
+
function ca(e) {
|
|
613
615
|
return e.uptime.map((n) => ({ day: n.day, state: n.state }));
|
|
614
616
|
}
|
|
615
|
-
const
|
|
617
|
+
const se = [
|
|
616
618
|
["e4xx", "4xx"],
|
|
617
619
|
["e429", "429 rate-limited"],
|
|
618
620
|
["eAuth", "auth (401/403)"],
|
|
619
621
|
["e5xx", "5xx"]
|
|
620
622
|
];
|
|
621
|
-
function
|
|
623
|
+
function mt(e) {
|
|
622
624
|
const n = new Date(e);
|
|
623
625
|
return Number.isNaN(n.getTime()) ? e : n.toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
624
626
|
}
|
|
625
|
-
function
|
|
627
|
+
function Ie(e) {
|
|
626
628
|
if (!e) return "—";
|
|
627
629
|
const n = new Date(e);
|
|
628
630
|
return Number.isNaN(n.getTime()) ? e : n.toLocaleString(void 0, {
|
|
@@ -632,14 +634,14 @@ function Le(e) {
|
|
|
632
634
|
minute: "2-digit"
|
|
633
635
|
});
|
|
634
636
|
}
|
|
635
|
-
function
|
|
637
|
+
function me({ label: e, value: n, hint: a }) {
|
|
636
638
|
return /* @__PURE__ */ r("div", { className: "w6w-rel-card", style: { flex: "1 1 150px", minWidth: 150 }, children: [
|
|
637
639
|
/* @__PURE__ */ t("div", { style: { fontSize: "1.6rem", fontWeight: "var(--w6w-fw-semibold)", lineHeight: 1.15 }, children: n }),
|
|
638
640
|
/* @__PURE__ */ t("div", { className: "muted small", children: e }),
|
|
639
641
|
a && /* @__PURE__ */ t("div", { className: "muted small", children: a })
|
|
640
642
|
] });
|
|
641
643
|
}
|
|
642
|
-
function
|
|
644
|
+
function da({
|
|
643
645
|
vendor: e,
|
|
644
646
|
displayName: n
|
|
645
647
|
}) {
|
|
@@ -656,13 +658,13 @@ 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 = oa(e.components), i = (e.timeline ?? []).filter(ut), o = 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,
|
|
663
665
|
" status",
|
|
664
666
|
" ",
|
|
665
|
-
/* @__PURE__ */ t(
|
|
667
|
+
/* @__PURE__ */ t(he, { state: e.state, label: a ? "Unavailable" : void 0 })
|
|
666
668
|
] }),
|
|
667
669
|
a && /* @__PURE__ */ t("p", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: "We could not get a status from this API, so we cannot say whether it is up. That is separate from your own calls above, which are measured here regardless." }),
|
|
668
670
|
e.message && /* @__PURE__ */ t(
|
|
@@ -682,24 +684,24 @@ function na({
|
|
|
682
684
|
n,
|
|
683
685
|
" says about itself, not what your calls did · last checked",
|
|
684
686
|
" ",
|
|
685
|
-
|
|
686
|
-
e.attributedTo.length > 0 && /* @__PURE__ */ r(
|
|
687
|
+
Ie(e.checkedAt),
|
|
688
|
+
e.attributedTo.length > 0 && /* @__PURE__ */ r(K, { children: [
|
|
687
689
|
" ",
|
|
688
690
|
"· decided by",
|
|
689
691
|
" ",
|
|
690
692
|
e.attributedTo.map((l) => /* @__PURE__ */ t("code", { children: l }, l))
|
|
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(([l,
|
|
695
|
+
s.length > 0 && /* @__PURE__ */ t("div", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: s.map(([l, d]) => /* @__PURE__ */ r("span", { className: "w6w-rel-tag", children: [
|
|
694
696
|
l,
|
|
695
697
|
": ",
|
|
696
|
-
|
|
698
|
+
d.state
|
|
697
699
|
] }, l)) }),
|
|
698
700
|
i.length > 0 && /* @__PURE__ */ t("ul", { className: "list", style: { margin: "var(--w6w-sp-2) 0 0" }, children: i.map((l) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ r("div", { className: "list-main", children: [
|
|
699
701
|
/* @__PURE__ */ t("strong", { children: l.title }),
|
|
700
702
|
" ",
|
|
701
|
-
/* @__PURE__ */ t(
|
|
702
|
-
/* @__PURE__ */ t("div", { className: "muted small", children:
|
|
703
|
+
/* @__PURE__ */ t(he, { state: l.state }),
|
|
704
|
+
/* @__PURE__ */ t("div", { className: "muted small", children: la(l, o) })
|
|
703
705
|
] }) }, l.id ?? l.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,
|
|
@@ -707,7 +709,7 @@ function na({
|
|
|
707
709
|
] }) })
|
|
708
710
|
] });
|
|
709
711
|
}
|
|
710
|
-
function
|
|
712
|
+
function ua({ 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));
|
|
@@ -723,7 +725,7 @@ function aa({ service: e }) {
|
|
|
723
725
|
{
|
|
724
726
|
className: `rel-daily-bar rel-daily-bar-${s.state}`,
|
|
725
727
|
style: { height: `${s.calls > 0 ? Math.max(s.calls / a * 100, 4) : 2}%` },
|
|
726
|
-
title: `${
|
|
728
|
+
title: `${mt(`${s.day}T00:00:00.000Z`)} — ${s.calls} calls, ${s.state}`
|
|
727
729
|
},
|
|
728
730
|
s.day
|
|
729
731
|
))
|
|
@@ -732,17 +734,17 @@ 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 ma({
|
|
736
738
|
service: e,
|
|
737
739
|
window: n
|
|
738
740
|
}) {
|
|
739
|
-
const a = [...e.uptime].reverse().filter((l) => l.calls > 0), s = e.vendorStatus, i =
|
|
741
|
+
const a = [...e.uptime].reverse().filter((l) => l.calls > 0), s = e.vendorStatus, i = ra(s), o = 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
|
+
Lt,
|
|
743
745
|
{
|
|
744
746
|
window: n,
|
|
745
|
-
days:
|
|
747
|
+
days: ca(e),
|
|
746
748
|
incidents: i,
|
|
747
749
|
vendorEmptyLabel: o,
|
|
748
750
|
ariaLabel: `${e.displayName}, ${e.uptime.length}-day status and ${e.displayName} incidents, oldest day first`
|
|
@@ -754,25 +756,25 @@ function ia({
|
|
|
754
756
|
" — never a quiet green."
|
|
755
757
|
] }),
|
|
756
758
|
a.length > 0 && /* @__PURE__ */ t("div", { className: "list", style: { marginTop: "var(--w6w-sp-3)" }, children: a.slice(0, 14).map((l) => /* @__PURE__ */ r("div", { className: "rel-day-row", children: [
|
|
757
|
-
/* @__PURE__ */ t("span", { style: { minWidth: 96 }, children: /* @__PURE__ */ t("strong", { children:
|
|
758
|
-
/* @__PURE__ */ t(
|
|
759
|
+
/* @__PURE__ */ t("span", { style: { minWidth: 96 }, children: /* @__PURE__ */ t("strong", { children: mt(`${l.day}T00:00:00.000Z`) }) }),
|
|
760
|
+
/* @__PURE__ */ t(he, { state: l.state }),
|
|
759
761
|
/* @__PURE__ */ r("span", { className: "muted small", children: [
|
|
760
762
|
l.calls,
|
|
761
763
|
" calls"
|
|
762
764
|
] }),
|
|
763
|
-
/* @__PURE__ */ t("span", { className: "rel-errors", children:
|
|
764
|
-
|
|
765
|
+
/* @__PURE__ */ t("span", { className: "rel-errors", children: se.filter(([d]) => l.errors[d] > 0).map(([d, u]) => /* @__PURE__ */ r("span", { className: "w6w-rel-tag", children: [
|
|
766
|
+
u,
|
|
765
767
|
" ×",
|
|
766
|
-
l.errors[
|
|
767
|
-
] },
|
|
768
|
+
l.errors[d]
|
|
769
|
+
] }, d)) })
|
|
768
770
|
] }, l.day)) })
|
|
769
771
|
] });
|
|
770
772
|
}
|
|
771
|
-
function
|
|
772
|
-
if (
|
|
773
|
+
function ha({ errors: e }) {
|
|
774
|
+
if (se.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
|
-
const a = Math.max(1, ...
|
|
775
|
-
return /* @__PURE__ */ t("div", { className: "w6w-rel-card rel-errormix-chart", children:
|
|
776
|
+
const a = Math.max(1, ...se.map(([s]) => e[s]));
|
|
777
|
+
return /* @__PURE__ */ t("div", { className: "w6w-rel-card rel-errormix-chart", children: se.map(([s, i]) => /* @__PURE__ */ r("div", { className: "rel-errormix-row", children: [
|
|
776
778
|
/* @__PURE__ */ t("span", { className: "muted small", children: i }),
|
|
777
779
|
/* @__PURE__ */ t("span", { className: "rel-errormix-track", children: /* @__PURE__ */ t(
|
|
778
780
|
"span",
|
|
@@ -784,12 +786,12 @@ 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 wa({ project: e, appId: n }) {
|
|
790
|
+
const a = mn(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;
|
|
792
|
-
return /* @__PURE__ */ t("div", { className: "error", children: (i instanceof
|
|
794
|
+
return /* @__PURE__ */ t("div", { className: "error", children: (i instanceof ze, i.message) });
|
|
793
795
|
}
|
|
794
796
|
const s = a.data ?? [];
|
|
795
797
|
return s.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No calls captured for this service. Calls appear here once a workflow, function or ad-hoc invoke reaches it." }) : /* @__PURE__ */ r("div", { className: "rel-calls", children: [
|
|
@@ -801,7 +803,7 @@ function ra({ project: e, appId: n }) {
|
|
|
801
803
|
/* @__PURE__ */ t("span", { children: "Took" })
|
|
802
804
|
] }),
|
|
803
805
|
s.map((i, o) => /* @__PURE__ */ r("div", { className: "rel-call", children: [
|
|
804
|
-
/* @__PURE__ */ t("span", { className: "muted small", children:
|
|
806
|
+
/* @__PURE__ */ t("span", { className: "muted small", children: Ie(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 }),
|
|
@@ -809,13 +811,13 @@ function ra({ project: e, appId: n }) {
|
|
|
809
811
|
] }, i.id ?? `${i.createdAt}-${o}`))
|
|
810
812
|
] });
|
|
811
813
|
}
|
|
812
|
-
function
|
|
814
|
+
function pa({
|
|
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 vi({
|
|
819
821
|
appId: e,
|
|
820
822
|
project: n,
|
|
821
823
|
days: a = 30,
|
|
@@ -823,24 +825,24 @@ function di({
|
|
|
823
825
|
onBack: i,
|
|
824
826
|
slots: o
|
|
825
827
|
}) {
|
|
826
|
-
var
|
|
827
|
-
const l =
|
|
828
|
+
var b, N, $, g;
|
|
829
|
+
const l = $e().project, d = (n === void 0 ? l : n) || void 0, u = un(d, [e], a), h = u.error, v = h ? (h instanceof ze, h.message) : null, w = (b = u.data) == null ? void 0 : b.services.find((m) => m.appId === e);
|
|
828
830
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
|
|
829
831
|
o == null ? void 0 : o.header,
|
|
830
832
|
o == null ? void 0 : o.actions,
|
|
831
|
-
!
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
833
|
+
!d && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see this service." }),
|
|
834
|
+
v && /* @__PURE__ */ t("div", { className: "error", children: v }),
|
|
835
|
+
d && u.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
|
|
836
|
+
u.data && !w && /* @__PURE__ */ r("div", { className: "w6w-rel-card", children: [
|
|
835
837
|
(o == null ? void 0 : o.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(pa, { backHref: s, onBack: i })
|
|
842
844
|
] }),
|
|
843
|
-
|
|
845
|
+
w && /* @__PURE__ */ r(K, { 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(
|
|
857
|
+
/* @__PURE__ */ t(he, { state: w.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: w.appId }),
|
|
860
|
+
w.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(
|
|
865
|
+
/* @__PURE__ */ t(me, { label: "Calls in window", value: String(w.calls) }),
|
|
864
866
|
/* @__PURE__ */ t(
|
|
865
|
-
|
|
867
|
+
me,
|
|
866
868
|
{
|
|
867
869
|
label: "p95 latency",
|
|
868
|
-
value:
|
|
869
|
-
hint:
|
|
870
|
+
value: w.p95Ms === null ? "—" : `${w.p95Ms} ms`,
|
|
871
|
+
hint: w.p95Ms === null ? "no timed calls" : void 0
|
|
870
872
|
}
|
|
871
873
|
),
|
|
872
|
-
/* @__PURE__ */ t(
|
|
874
|
+
/* @__PURE__ */ t(me, { label: "Last call", value: Ie(w.lastCallAt) }),
|
|
873
875
|
/* @__PURE__ */ t(
|
|
874
|
-
|
|
876
|
+
me,
|
|
875
877
|
{
|
|
876
878
|
label: "Errors",
|
|
877
|
-
value: String(
|
|
878
|
-
hint:
|
|
879
|
+
value: String(se.reduce((m, [y]) => m + w.errors[y], 0)),
|
|
880
|
+
hint: se.filter(([m]) => w.errors[m] > 0).map(([m, y]) => `${y} ×${w.errors[m]}`).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(ha, { errors: w.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(da, { vendor: w.vendorStatus, displayName: w.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
|
-
((
|
|
896
|
+
((N = u.data) == null ? void 0 : N.window.days) ?? a,
|
|
895
897
|
" days",
|
|
896
898
|
" ",
|
|
897
899
|
/* @__PURE__ */ r("span", { className: "muted small", children: [
|
|
898
900
|
"uptime means ",
|
|
899
|
-
(
|
|
901
|
+
($ = u.data) == null ? void 0 : $.uptimeMeans
|
|
900
902
|
] })
|
|
901
903
|
] }),
|
|
902
|
-
/* @__PURE__ */ t(
|
|
903
|
-
/* @__PURE__ */ t(
|
|
904
|
+
/* @__PURE__ */ t(ma, { service: w, window: ((g = u.data) == null ? void 0 : g.window) ?? { from: "", to: "" } }),
|
|
905
|
+
/* @__PURE__ */ t(ua, { service: w })
|
|
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(wa, { project: d, appId: w.appId }) })
|
|
912
914
|
] })
|
|
913
915
|
] })
|
|
914
916
|
] });
|
|
915
917
|
}
|
|
916
|
-
function
|
|
918
|
+
function fa(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 ga({
|
|
926
928
|
routes: e,
|
|
927
929
|
projectId: n
|
|
928
930
|
}) {
|
|
929
931
|
const [a, s] = f(null), i = e.find((o) => o.id === a);
|
|
930
|
-
return e.length === 0 ? null : /* @__PURE__ */ r(
|
|
932
|
+
return e.length === 0 ? null : /* @__PURE__ */ r(K, { children: [
|
|
931
933
|
/* @__PURE__ */ t("ul", { className: "list small", "data-testid": "connection-dependent-routes", children: e.map((o) => /* @__PURE__ */ r("li", { "data-testid": `connection-dependent-route-${o.id}`, children: [
|
|
932
934
|
/* @__PURE__ */ t("span", { className: "badge", children: "route" }),
|
|
933
935
|
" ",
|
|
934
936
|
/* @__PURE__ */ t("span", { children: o.name }),
|
|
935
937
|
" ",
|
|
936
|
-
o.status === "broken" && /* @__PURE__ */ r(
|
|
938
|
+
o.status === "broken" && /* @__PURE__ */ r(K, { children: [
|
|
937
939
|
/* @__PURE__ */ t("span", { className: "tag warn", children: "broken" }),
|
|
938
940
|
" ",
|
|
939
941
|
/* @__PURE__ */ t(
|
|
@@ -949,7 +951,7 @@ function ca({
|
|
|
949
951
|
] })
|
|
950
952
|
] }, o.id)) }),
|
|
951
953
|
i != null && /* @__PURE__ */ t(
|
|
952
|
-
|
|
954
|
+
ya,
|
|
953
955
|
{
|
|
954
956
|
routeId: i.id,
|
|
955
957
|
projectId: i.project ?? n,
|
|
@@ -958,29 +960,29 @@ function ca({
|
|
|
958
960
|
)
|
|
959
961
|
] });
|
|
960
962
|
}
|
|
961
|
-
function
|
|
963
|
+
function ya(e) {
|
|
962
964
|
return /* @__PURE__ */ r("div", { "data-testid": "connection-route-reconnect-host", children: [
|
|
963
|
-
/* @__PURE__ */ t(
|
|
965
|
+
/* @__PURE__ */ t($n, { 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
|
}
|
|
967
|
-
function
|
|
969
|
+
function ht({
|
|
968
970
|
callables: e,
|
|
969
971
|
onOpenCallable: n,
|
|
970
972
|
routes: a,
|
|
971
973
|
projectId: s
|
|
972
974
|
}) {
|
|
973
|
-
return /* @__PURE__ */ r(
|
|
974
|
-
/* @__PURE__ */ t(
|
|
975
|
-
/* @__PURE__ */ t(
|
|
975
|
+
return /* @__PURE__ */ r(K, { children: [
|
|
976
|
+
/* @__PURE__ */ t(ga, { routes: a ?? [], projectId: s }),
|
|
977
|
+
/* @__PURE__ */ t(va, { callables: e, onOpenCallable: n })
|
|
976
978
|
] });
|
|
977
979
|
}
|
|
978
|
-
function
|
|
980
|
+
function va({
|
|
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(fa);
|
|
984
986
|
return /* @__PURE__ */ r("li", { children: [
|
|
985
987
|
/* @__PURE__ */ t("span", { className: "badge", children: a.kind }),
|
|
986
988
|
" ",
|
|
@@ -1001,71 +1003,73 @@ function ua({
|
|
|
1001
1003
|
] }, `${a.kind}:${a.id}`);
|
|
1002
1004
|
}) });
|
|
1003
1005
|
}
|
|
1004
|
-
const
|
|
1005
|
-
function
|
|
1006
|
+
const Na = [];
|
|
1007
|
+
function Ni({
|
|
1006
1008
|
onOpen: e,
|
|
1007
1009
|
getHref: n,
|
|
1008
1010
|
addLabel: a,
|
|
1009
1011
|
slots: s,
|
|
1010
|
-
onOpenCallable: i
|
|
1012
|
+
onOpenCallable: i,
|
|
1013
|
+
onCreateSharedCredential: o
|
|
1011
1014
|
}) {
|
|
1012
|
-
var
|
|
1013
|
-
const
|
|
1015
|
+
var R, A;
|
|
1016
|
+
const l = We(), d = fe(), u = bn(), v = u.data ?? Na, w = ie(() => Be(v), [v]), { byId: b } = Ye(w), N = kn(), [$, g] = f(!1), [m, y] = f(null), [D, E] = f(null), x = X(void 0), k = Ze((D == null ? void 0 : D.id) ?? "", D !== null), Q = typeof l.updateConnection == "function", j = s && "actions" in s ? s.actions : /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", onClick: () => g(!0), children: a ?? "+ Add connection" });
|
|
1014
1017
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
|
|
1015
1018
|
/* @__PURE__ */ t(
|
|
1016
|
-
|
|
1019
|
+
Et,
|
|
1017
1020
|
{
|
|
1018
|
-
connections:
|
|
1019
|
-
appsById:
|
|
1020
|
-
loading:
|
|
1021
|
-
error:
|
|
1021
|
+
connections: v,
|
|
1022
|
+
appsById: b,
|
|
1023
|
+
loading: u.isLoading,
|
|
1024
|
+
error: u.error ? u.error.message : null,
|
|
1022
1025
|
onOpen: e,
|
|
1023
1026
|
getHref: n,
|
|
1024
|
-
onEdit:
|
|
1025
|
-
onDelete:
|
|
1026
|
-
busy:
|
|
1027
|
+
onEdit: Q ? y : void 0,
|
|
1028
|
+
onDelete: E,
|
|
1029
|
+
busy: N.isPending,
|
|
1027
1030
|
slots: { ...s, actions: j }
|
|
1028
1031
|
}
|
|
1029
1032
|
),
|
|
1030
|
-
|
|
1031
|
-
|
|
1033
|
+
$ && /* @__PURE__ */ t(
|
|
1034
|
+
It,
|
|
1032
1035
|
{
|
|
1033
|
-
|
|
1036
|
+
onCreateSharedCredential: o,
|
|
1037
|
+
onClose: () => g(!1),
|
|
1034
1038
|
onCreated: () => {
|
|
1035
|
-
|
|
1039
|
+
g(!1), d.invalidateQueries({ queryKey: Ce });
|
|
1036
1040
|
}
|
|
1037
1041
|
}
|
|
1038
1042
|
),
|
|
1039
|
-
|
|
1040
|
-
|
|
1043
|
+
m && /* @__PURE__ */ t(
|
|
1044
|
+
Ue,
|
|
1041
1045
|
{
|
|
1042
|
-
connection:
|
|
1043
|
-
onClose: () =>
|
|
1046
|
+
connection: m,
|
|
1047
|
+
onClose: () => y(null),
|
|
1044
1048
|
onSaved: () => {
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1049
|
+
const P = m.id;
|
|
1050
|
+
y(null), d.invalidateQueries({ queryKey: Ce }), d.invalidateQueries({ queryKey: Xe(P) });
|
|
1047
1051
|
}
|
|
1048
1052
|
}
|
|
1049
1053
|
),
|
|
1050
|
-
|
|
1051
|
-
|
|
1054
|
+
D && /* @__PURE__ */ t(
|
|
1055
|
+
ba,
|
|
1052
1056
|
{
|
|
1053
|
-
name:
|
|
1054
|
-
loading:
|
|
1055
|
-
callables:
|
|
1056
|
-
routes:
|
|
1057
|
-
projectId:
|
|
1057
|
+
name: D.displayName || D.id,
|
|
1058
|
+
loading: k.isLoading,
|
|
1059
|
+
callables: k.isError ? [] : ((R = k.data) == null ? void 0 : R.callables) ?? [],
|
|
1060
|
+
routes: k.isError ? [] : ((A = k.data) == null ? void 0 : A.routes) ?? [],
|
|
1061
|
+
projectId: x,
|
|
1058
1062
|
onOpenCallable: i,
|
|
1059
|
-
onClose: () =>
|
|
1063
|
+
onClose: () => E(null),
|
|
1060
1064
|
onConfirm: () => {
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1065
|
+
const P = D.id;
|
|
1066
|
+
E(null), N.mutate({ id: P, force: !0 });
|
|
1063
1067
|
}
|
|
1064
1068
|
}
|
|
1065
1069
|
)
|
|
1066
1070
|
] });
|
|
1067
1071
|
}
|
|
1068
|
-
function
|
|
1072
|
+
function ba({
|
|
1069
1073
|
name: e,
|
|
1070
1074
|
loading: n,
|
|
1071
1075
|
callables: a,
|
|
@@ -1073,21 +1077,21 @@ function ha({
|
|
|
1073
1077
|
projectId: i,
|
|
1074
1078
|
onOpenCallable: o,
|
|
1075
1079
|
onClose: l,
|
|
1076
|
-
onConfirm:
|
|
1080
|
+
onConfirm: d
|
|
1077
1081
|
}) {
|
|
1078
|
-
const
|
|
1079
|
-
|
|
1080
|
-
h > 0 ?
|
|
1081
|
-
].filter(Boolean).join(" and "),
|
|
1082
|
-
|
|
1082
|
+
const u = a.length, h = s.length, v = u + h, w = `Delete the connection "${e}"? This cannot be undone.`, b = (g, m, y) => `${g} ${g === 1 ? m : y}`, N = [
|
|
1083
|
+
u > 0 ? b(u, "callable", "callables") : null,
|
|
1084
|
+
h > 0 ? b(h, "model route", "model routes") : null
|
|
1085
|
+
].filter(Boolean).join(" and "), $ = [
|
|
1086
|
+
u > 0 ? `Deleting disables ${u === 1 ? "this callable" : `these ${u} callables`} until you reconnect ${u === 1 ? "it" : "them"}.` : null,
|
|
1083
1087
|
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
1088
|
].filter((g) => g != null);
|
|
1085
|
-
return /* @__PURE__ */ r(
|
|
1089
|
+
return /* @__PURE__ */ r(Mt, { title: "Delete connection", onClose: l, children: [
|
|
1086
1090
|
/* @__PURE__ */ r("div", { className: "w6w-modal-body", children: [
|
|
1087
|
-
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children:
|
|
1088
|
-
|
|
1091
|
+
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: v === 0 ? w : `Delete the connection "${e}"? Used by ${N}.` }),
|
|
1092
|
+
v > 0 && /* @__PURE__ */ r(K, { children: [
|
|
1089
1093
|
/* @__PURE__ */ t(
|
|
1090
|
-
|
|
1094
|
+
ht,
|
|
1091
1095
|
{
|
|
1092
1096
|
callables: a,
|
|
1093
1097
|
routes: s,
|
|
@@ -1095,7 +1099,7 @@ function ha({
|
|
|
1095
1099
|
onOpenCallable: o
|
|
1096
1100
|
}
|
|
1097
1101
|
),
|
|
1098
|
-
/* @__PURE__ */ t("p", { className: "w6w-small", children:
|
|
1102
|
+
/* @__PURE__ */ t("p", { className: "w6w-small", children: $.join(" ") })
|
|
1099
1103
|
] })
|
|
1100
1104
|
] }),
|
|
1101
1105
|
/* @__PURE__ */ r("div", { className: "w6w-modal-actions", children: [
|
|
@@ -1106,14 +1110,14 @@ function ha({
|
|
|
1106
1110
|
type: "button",
|
|
1107
1111
|
className: "w6w-btn w6w-btn-danger",
|
|
1108
1112
|
disabled: n,
|
|
1109
|
-
onClick:
|
|
1113
|
+
onClick: d,
|
|
1110
1114
|
children: "Delete"
|
|
1111
1115
|
}
|
|
1112
1116
|
)
|
|
1113
1117
|
] })
|
|
1114
1118
|
] });
|
|
1115
1119
|
}
|
|
1116
|
-
function
|
|
1120
|
+
function be(e) {
|
|
1117
1121
|
const n = new Date(e).getTime();
|
|
1118
1122
|
if (Number.isNaN(n)) return "recently";
|
|
1119
1123
|
const a = Math.max(0, Math.round((Date.now() - n) / 1e3));
|
|
@@ -1125,146 +1129,146 @@ function ve(e) {
|
|
|
1125
1129
|
const o = Math.round(i / 24);
|
|
1126
1130
|
return o < 30 ? `${o}d ago` : new Date(e).toLocaleDateString();
|
|
1127
1131
|
}
|
|
1128
|
-
const
|
|
1132
|
+
const ka = {
|
|
1129
1133
|
ok: 6e3,
|
|
1130
1134
|
warn: 1e4,
|
|
1131
1135
|
error: 15e3
|
|
1132
|
-
},
|
|
1133
|
-
function
|
|
1136
|
+
}, Ca = { ok: "✓", warn: "!", error: "✕" };
|
|
1137
|
+
function bi({
|
|
1134
1138
|
connectionId: e,
|
|
1135
1139
|
onOpenAction: n,
|
|
1136
1140
|
onBack: a,
|
|
1137
1141
|
onOpenCallable: s,
|
|
1138
1142
|
slots: i
|
|
1139
1143
|
}) {
|
|
1140
|
-
var
|
|
1141
|
-
const o =
|
|
1142
|
-
() =>
|
|
1143
|
-
[
|
|
1144
|
-
), { byId:
|
|
1144
|
+
var _;
|
|
1145
|
+
const o = We(), l = fe(), d = Cn(e), u = (_ = d.data) == null ? void 0 : _.appId, h = ie(
|
|
1146
|
+
() => Be(d.data ? [d.data] : []),
|
|
1147
|
+
[d.data]
|
|
1148
|
+
), { byId: v } = Ye(h), w = d.data ? At(d.data, v) : void 0, b = Dn(u, !!u), N = hn(e), $ = ie(() => {
|
|
1145
1149
|
const p = /* @__PURE__ */ new Map();
|
|
1146
|
-
for (const
|
|
1147
|
-
const
|
|
1148
|
-
|
|
1150
|
+
for (const L of N.data ?? []) {
|
|
1151
|
+
const M = p.get(L.actionKey) ?? [];
|
|
1152
|
+
M.push(L), p.set(L.actionKey, M);
|
|
1149
1153
|
}
|
|
1150
1154
|
return p;
|
|
1151
|
-
}, [
|
|
1152
|
-
|
|
1153
|
-
if (!
|
|
1154
|
-
const p = setTimeout(() =>
|
|
1155
|
+
}, [N.data]), g = Ze(e).data, m = X(void 0), y = (g == null ? void 0 : g.callables) ?? [], D = (g == null ? void 0 : g.routes) ?? [], E = wn(e).data ?? [], [x, k] = f(!1), [Q, j] = f(""), R = Tn(e), [A, P] = f(null);
|
|
1156
|
+
gt(() => {
|
|
1157
|
+
if (!A) return;
|
|
1158
|
+
const p = setTimeout(() => P(null), ka[A.kind]);
|
|
1155
1159
|
return () => clearTimeout(p);
|
|
1156
|
-
}, [
|
|
1160
|
+
}, [A]);
|
|
1157
1161
|
const H = () => {
|
|
1158
|
-
|
|
1162
|
+
P(null), R.mutate(void 0, {
|
|
1159
1163
|
onSuccess: (p) => {
|
|
1160
|
-
var
|
|
1164
|
+
var L;
|
|
1161
1165
|
if (!p.ok) {
|
|
1162
|
-
|
|
1166
|
+
P({
|
|
1163
1167
|
kind: "error",
|
|
1164
|
-
text: `Connection test failed${(
|
|
1168
|
+
text: `Connection test failed${(L = p.error) != null && L.message ? `: ${p.error.message}` : "."}`
|
|
1165
1169
|
});
|
|
1166
1170
|
return;
|
|
1167
1171
|
}
|
|
1168
|
-
|
|
1172
|
+
P(
|
|
1169
1173
|
p.untested ? { kind: "warn", text: `Connection stored. ${p.message ?? ""}`.trim() } : {
|
|
1170
1174
|
kind: "ok",
|
|
1171
1175
|
text: `Connection is valid${p.actionKey ? ` — probed ${p.actionKey}` : ""}.`
|
|
1172
1176
|
}
|
|
1173
1177
|
);
|
|
1174
1178
|
},
|
|
1175
|
-
onError: (p) =>
|
|
1179
|
+
onError: (p) => P({ kind: "error", text: (p == null ? void 0 : p.message) ?? "Test failed." })
|
|
1176
1180
|
});
|
|
1177
|
-
},
|
|
1178
|
-
var
|
|
1179
|
-
const p = [...((
|
|
1180
|
-
return p.sort((
|
|
1181
|
-
}, [
|
|
1182
|
-
const p =
|
|
1183
|
-
return p ?
|
|
1184
|
-
(
|
|
1185
|
-
) :
|
|
1186
|
-
}, [
|
|
1187
|
-
if (
|
|
1181
|
+
}, I = ie(() => {
|
|
1182
|
+
var L;
|
|
1183
|
+
const p = [...((L = b.data) == null ? void 0 : L.actions) ?? []];
|
|
1184
|
+
return p.sort((M, z) => (M.title || M.key).localeCompare(z.title || z.key)), p;
|
|
1185
|
+
}, [b.data]), J = ie(() => {
|
|
1186
|
+
const p = Q.trim().toLowerCase();
|
|
1187
|
+
return p ? I.filter(
|
|
1188
|
+
(L) => (L.title || "").toLowerCase().includes(p) || L.key.toLowerCase().includes(p) || (L.description || "").toLowerCase().includes(p)
|
|
1189
|
+
) : I;
|
|
1190
|
+
}, [I, Q]);
|
|
1191
|
+
if (d.isLoading || b.isLoading)
|
|
1188
1192
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root w6w-embed-conn-detail", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) });
|
|
1189
|
-
if (!
|
|
1193
|
+
if (!d.data)
|
|
1190
1194
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-conn-detail", "data-testid": "connection-not-found", children: [
|
|
1191
1195
|
(i == null ? void 0 : i.empty) ?? /* @__PURE__ */ t("h2", { children: "Connection not found" }),
|
|
1192
1196
|
a && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "Back to integrations" })
|
|
1193
1197
|
] });
|
|
1194
|
-
const
|
|
1198
|
+
const q = d.data, S = b.data, U = !q.builtIn && typeof o.updateConnection == "function";
|
|
1195
1199
|
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(
|
|
1200
|
+
(i == null ? void 0 : i.header) ?? /* @__PURE__ */ r(Rt, { conn: q, app: w, children: [
|
|
1197
1201
|
/* @__PURE__ */ t(
|
|
1198
1202
|
"button",
|
|
1199
1203
|
{
|
|
1200
1204
|
type: "button",
|
|
1201
1205
|
className: "w6w-btn w6w-btn-ghost",
|
|
1202
|
-
disabled:
|
|
1206
|
+
disabled: R.isPending,
|
|
1203
1207
|
onClick: H,
|
|
1204
|
-
children:
|
|
1208
|
+
children: R.isPending ? "Testing…" : "Test connection"
|
|
1205
1209
|
}
|
|
1206
1210
|
),
|
|
1207
|
-
|
|
1208
|
-
|
|
1211
|
+
U && /* @__PURE__ */ t(
|
|
1212
|
+
_e,
|
|
1209
1213
|
{
|
|
1210
1214
|
label: "Edit",
|
|
1211
|
-
onClick: () =>
|
|
1215
|
+
onClick: () => k(!0),
|
|
1212
1216
|
"data-testid": "connection-detail-edit"
|
|
1213
1217
|
}
|
|
1214
1218
|
),
|
|
1215
1219
|
i == null ? void 0 : i.actions
|
|
1216
1220
|
] }),
|
|
1217
|
-
|
|
1221
|
+
A && /* @__PURE__ */ r(
|
|
1218
1222
|
"div",
|
|
1219
1223
|
{
|
|
1220
|
-
className: `w6w-result w6w-embed-conn-notice w6w-embed-conn-notice-${
|
|
1221
|
-
role:
|
|
1222
|
-
"aria-live":
|
|
1224
|
+
className: `w6w-result w6w-embed-conn-notice w6w-embed-conn-notice-${A.kind}`,
|
|
1225
|
+
role: A.kind === "error" ? "alert" : "status",
|
|
1226
|
+
"aria-live": A.kind === "error" ? "assertive" : "polite",
|
|
1223
1227
|
"data-testid": "connection-test-notice",
|
|
1224
1228
|
children: [
|
|
1225
|
-
/* @__PURE__ */ t("span", { "aria-hidden": "true", children:
|
|
1226
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-notice-text", children:
|
|
1227
|
-
/* @__PURE__ */ t(
|
|
1229
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: Ca[A.kind] }),
|
|
1230
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-notice-text", children: A.text }),
|
|
1231
|
+
/* @__PURE__ */ t(St, { icon: "close", label: "Dismiss", onClick: () => P(null) })
|
|
1228
1232
|
]
|
|
1229
1233
|
}
|
|
1230
1234
|
),
|
|
1231
1235
|
/* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
|
|
1232
1236
|
/* @__PURE__ */ r("h3", { children: [
|
|
1233
1237
|
"App: ",
|
|
1234
|
-
(
|
|
1238
|
+
(w == null ? void 0 : w.displayName) ?? q.appId
|
|
1235
1239
|
] }),
|
|
1236
|
-
|
|
1240
|
+
S && /* @__PURE__ */ r("p", { className: "w6w-muted w6w-small", children: [
|
|
1237
1241
|
"Version ",
|
|
1238
1242
|
/* @__PURE__ */ r("code", { children: [
|
|
1239
1243
|
"v",
|
|
1240
|
-
|
|
1244
|
+
S.version ?? "?"
|
|
1241
1245
|
] }),
|
|
1242
1246
|
" · source ",
|
|
1243
|
-
/* @__PURE__ */ t("code", { children:
|
|
1247
|
+
/* @__PURE__ */ t("code", { children: S.sourceRef })
|
|
1244
1248
|
] }),
|
|
1245
1249
|
a && /* @__PURE__ */ t("p", { className: "w6w-small", children: /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "← Integrations" }) })
|
|
1246
1250
|
] }),
|
|
1247
1251
|
/* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
|
|
1248
1252
|
/* @__PURE__ */ t("h3", { children: "Actions" }),
|
|
1249
|
-
|
|
1250
|
-
|
|
1253
|
+
I.length === 0 && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No actions exposed." }),
|
|
1254
|
+
I.length > 10 && /* @__PURE__ */ t(
|
|
1251
1255
|
"input",
|
|
1252
1256
|
{
|
|
1253
1257
|
type: "search",
|
|
1254
|
-
value:
|
|
1255
|
-
placeholder: `Search ${
|
|
1256
|
-
onChange: (p) =>
|
|
1258
|
+
value: Q,
|
|
1259
|
+
placeholder: `Search ${I.length} actions…`,
|
|
1260
|
+
onChange: (p) => j(p.target.value),
|
|
1257
1261
|
"aria-label": "Filter actions",
|
|
1258
1262
|
className: "w6w-embed-conn-filter"
|
|
1259
1263
|
}
|
|
1260
1264
|
),
|
|
1261
|
-
|
|
1265
|
+
I.length > 0 && J.length === 0 && /* @__PURE__ */ r("p", { className: "w6w-muted w6w-small", children: [
|
|
1262
1266
|
"No actions match “",
|
|
1263
|
-
|
|
1267
|
+
Q,
|
|
1264
1268
|
"”."
|
|
1265
1269
|
] }),
|
|
1266
1270
|
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Actions", children: J.map((p) => {
|
|
1267
|
-
const
|
|
1271
|
+
const L = $.get(p.key) ?? [];
|
|
1268
1272
|
return /* @__PURE__ */ r("li", { children: [
|
|
1269
1273
|
/* @__PURE__ */ r(
|
|
1270
1274
|
"button",
|
|
@@ -1283,30 +1287,30 @@ function mi({
|
|
|
1283
1287
|
]
|
|
1284
1288
|
}
|
|
1285
1289
|
),
|
|
1286
|
-
|
|
1290
|
+
L.length > 0 && /* @__PURE__ */ t(
|
|
1287
1291
|
"ul",
|
|
1288
1292
|
{
|
|
1289
1293
|
className: "w6w-embed-conn-list w6w-embed-conn-tests",
|
|
1290
1294
|
"aria-label": `Saved tests for ${p.title || p.key}`,
|
|
1291
|
-
children:
|
|
1292
|
-
|
|
1295
|
+
children: L.map((M) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
1296
|
+
ke,
|
|
1293
1297
|
{
|
|
1294
|
-
title:
|
|
1295
|
-
subtitle:
|
|
1298
|
+
title: M.name,
|
|
1299
|
+
subtitle: M.lastRunAt ? /* @__PURE__ */ r("span", { children: [
|
|
1296
1300
|
/* @__PURE__ */ t(
|
|
1297
1301
|
"span",
|
|
1298
1302
|
{
|
|
1299
|
-
className:
|
|
1300
|
-
children:
|
|
1303
|
+
className: M.lastRunOk ? "w6w-embed-conn-ok" : "w6w-embed-conn-fail",
|
|
1304
|
+
children: M.lastRunOk ? "✓" : "✗"
|
|
1301
1305
|
}
|
|
1302
1306
|
),
|
|
1303
1307
|
" ",
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
] }) : `saved ${
|
|
1307
|
-
onClick: () => n(p.key,
|
|
1308
|
+
M.lastRunSummary ? `${M.lastRunSummary} · ` : "",
|
|
1309
|
+
be(M.lastRunAt)
|
|
1310
|
+
] }) : `saved ${be(M.updatedAt)}`,
|
|
1311
|
+
onClick: () => n(p.key, M.id)
|
|
1308
1312
|
}
|
|
1309
|
-
) },
|
|
1313
|
+
) }, M.id))
|
|
1310
1314
|
}
|
|
1311
1315
|
)
|
|
1312
1316
|
] }, p.key);
|
|
@@ -1314,63 +1318,63 @@ function mi({
|
|
|
1314
1318
|
] }),
|
|
1315
1319
|
g && /* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", "data-testid": "connection-used-by", children: [
|
|
1316
1320
|
/* @__PURE__ */ t("h3", { children: "Used by" }),
|
|
1317
|
-
y.length === 0 &&
|
|
1318
|
-
|
|
1321
|
+
y.length === 0 && D.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Not used by any callable" }) : /* @__PURE__ */ t(
|
|
1322
|
+
ht,
|
|
1319
1323
|
{
|
|
1320
1324
|
callables: y,
|
|
1321
|
-
routes:
|
|
1322
|
-
projectId:
|
|
1325
|
+
routes: D,
|
|
1326
|
+
projectId: m,
|
|
1323
1327
|
onOpenCallable: s
|
|
1324
1328
|
}
|
|
1325
1329
|
)
|
|
1326
1330
|
] }),
|
|
1327
|
-
|
|
1331
|
+
E.length > 0 && /* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
|
|
1328
1332
|
/* @__PURE__ */ t("h3", { children: "Recent runs" }),
|
|
1329
1333
|
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Most recent tester runs against this connection." }),
|
|
1330
|
-
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Recent runs", children:
|
|
1331
|
-
|
|
1334
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Recent runs", children: E.map((p) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
1335
|
+
ke,
|
|
1332
1336
|
{
|
|
1333
1337
|
title: p.actionKey,
|
|
1334
1338
|
subtitle: /* @__PURE__ */ r("span", { children: [
|
|
1335
1339
|
/* @__PURE__ */ t("span", { className: p.ok ? "w6w-embed-conn-ok" : "w6w-embed-conn-fail", children: p.ok ? "✓" : "✗" }),
|
|
1336
1340
|
" ",
|
|
1337
1341
|
p.summary ? `${p.summary} · ` : "",
|
|
1338
|
-
|
|
1342
|
+
be(p.occurredAt)
|
|
1339
1343
|
] })
|
|
1340
1344
|
}
|
|
1341
1345
|
) }, p.id)) })
|
|
1342
1346
|
] }),
|
|
1343
|
-
|
|
1344
|
-
|
|
1347
|
+
x && /* @__PURE__ */ t(
|
|
1348
|
+
Ue,
|
|
1345
1349
|
{
|
|
1346
|
-
connection:
|
|
1347
|
-
onClose: () =>
|
|
1350
|
+
connection: q,
|
|
1351
|
+
onClose: () => k(!1),
|
|
1348
1352
|
onSaved: () => {
|
|
1349
|
-
|
|
1353
|
+
k(!1), l.invalidateQueries({ queryKey: Xe(e) }), l.invalidateQueries({ queryKey: Ce });
|
|
1350
1354
|
}
|
|
1351
1355
|
}
|
|
1352
1356
|
)
|
|
1353
1357
|
] });
|
|
1354
1358
|
}
|
|
1355
|
-
const
|
|
1356
|
-
function
|
|
1359
|
+
const Ta = {};
|
|
1360
|
+
function je(e) {
|
|
1357
1361
|
return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1358
1362
|
}
|
|
1359
|
-
function
|
|
1363
|
+
function ce(e) {
|
|
1360
1364
|
return (e / 100).toFixed(2);
|
|
1361
1365
|
}
|
|
1362
|
-
function
|
|
1366
|
+
function $a(e) {
|
|
1363
1367
|
if (e == null) return null;
|
|
1364
1368
|
const n = e.rates, a = [];
|
|
1365
|
-
return n.input != null && a.push(`in ${
|
|
1369
|
+
return n.input != null && a.push(`in ${ce(n.input)}`), n.output != null && a.push(`out ${ce(n.output)}`), n.cachedInput != null && a.push(`cached ${ce(n.cachedInput)}`), n.cacheWrite != null && a.push(`cache write ${ce(n.cacheWrite)}`), n.perRequest != null && a.push(`${ce(n.perRequest)}/request`), a.length === 0 ? null : `${n.currency ?? "USD"} ${a.join(" · ")}`;
|
|
1366
1370
|
}
|
|
1367
|
-
function
|
|
1371
|
+
function Da(e) {
|
|
1368
1372
|
const { maxInputTokens: n, maxOutputTokens: a } = e.limits ?? {};
|
|
1369
1373
|
if (n == null && a == null) return "—";
|
|
1370
1374
|
const s = [];
|
|
1371
|
-
return n != null && s.push(`${
|
|
1375
|
+
return n != null && s.push(`${je(n)} in`), a != null && s.push(`${je(a)} out`), s.join(" · ");
|
|
1372
1376
|
}
|
|
1373
|
-
const
|
|
1377
|
+
const xa = [
|
|
1374
1378
|
{
|
|
1375
1379
|
key: "model",
|
|
1376
1380
|
header: "Model",
|
|
@@ -1399,7 +1403,7 @@ const va = [
|
|
|
1399
1403
|
key: "rate",
|
|
1400
1404
|
header: "Rate (per 1M tokens)",
|
|
1401
1405
|
render: (e) => {
|
|
1402
|
-
const n =
|
|
1406
|
+
const n = $a(e.currentRate);
|
|
1403
1407
|
return n == null ? /* @__PURE__ */ t("span", { className: "muted small", children: "—" }) : /* @__PURE__ */ t(
|
|
1404
1408
|
"span",
|
|
1405
1409
|
{
|
|
@@ -1413,16 +1417,16 @@ const va = [
|
|
|
1413
1417
|
{
|
|
1414
1418
|
key: "limits",
|
|
1415
1419
|
header: "Limits",
|
|
1416
|
-
render: (e) => /* @__PURE__ */ t("span", { className: "muted small", children:
|
|
1420
|
+
render: (e) => /* @__PURE__ */ t("span", { className: "muted small", children: Da(e) })
|
|
1417
1421
|
}
|
|
1418
1422
|
];
|
|
1419
|
-
function
|
|
1423
|
+
function ki(e) {
|
|
1420
1424
|
var o;
|
|
1421
|
-
const n =
|
|
1422
|
-
queryKey:
|
|
1425
|
+
const n = ge(), a = e.filter ?? Ta, s = Ge({
|
|
1426
|
+
queryKey: Ln(a),
|
|
1423
1427
|
initialPageParam: void 0,
|
|
1424
1428
|
getNextPageParam: (l) => l.nextCursor ?? void 0,
|
|
1425
|
-
queryFn: ({ pageParam: l }) =>
|
|
1429
|
+
queryFn: ({ pageParam: l }) => xn(n, l ? { ...a, cursor: l } : a)
|
|
1426
1430
|
}), i = ((o = s.data) == null ? void 0 : o.pages.flatMap((l) => l.models)) ?? [];
|
|
1427
1431
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ r("section", { className: "section", children: [
|
|
1428
1432
|
/* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ r("div", { children: [
|
|
@@ -1434,9 +1438,9 @@ function hi(e) {
|
|
|
1434
1438
|
s.error != null && /* @__PURE__ */ t("div", { className: "error", children: s.error.message }),
|
|
1435
1439
|
s.isSuccess && i.length === 0 && /* @__PURE__ */ t(De, { testId: "model-catalog-empty", children: "No models yet. Discover them from a provider connection to start routing to them." }),
|
|
1436
1440
|
i.length > 0 && /* @__PURE__ */ t(
|
|
1437
|
-
|
|
1441
|
+
xe,
|
|
1438
1442
|
{
|
|
1439
|
-
columns:
|
|
1443
|
+
columns: xa,
|
|
1440
1444
|
rows: i,
|
|
1441
1445
|
rowKey: (l) => l.id,
|
|
1442
1446
|
testId: "model-catalog-table",
|
|
@@ -1457,27 +1461,27 @@ function hi(e) {
|
|
|
1457
1461
|
) })
|
|
1458
1462
|
] }) });
|
|
1459
1463
|
}
|
|
1460
|
-
const
|
|
1461
|
-
function
|
|
1464
|
+
const La = {};
|
|
1465
|
+
function B(e) {
|
|
1462
1466
|
return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1463
1467
|
}
|
|
1464
|
-
function
|
|
1468
|
+
function Ea(e) {
|
|
1465
1469
|
return `${e.currency} ${(e.amountMinor / 100).toFixed(2)}`;
|
|
1466
1470
|
}
|
|
1467
|
-
function
|
|
1468
|
-
return e.length > 0 ? e.map(
|
|
1471
|
+
function Ia(e, n) {
|
|
1472
|
+
return e.length > 0 ? e.map(Ea).join(" · ") : n > 0 ? "unpriced" : "—";
|
|
1469
1473
|
}
|
|
1470
|
-
function
|
|
1474
|
+
function Ma(e) {
|
|
1471
1475
|
return e.costMinor == null ? null : `${e.currency ?? "USD"} ${(e.costMinor / 100).toFixed(2)}`;
|
|
1472
1476
|
}
|
|
1473
|
-
function
|
|
1477
|
+
function Aa(e) {
|
|
1474
1478
|
return e.totalsTruncated === !0;
|
|
1475
1479
|
}
|
|
1476
|
-
const
|
|
1480
|
+
const Ra = [
|
|
1477
1481
|
{
|
|
1478
1482
|
key: "occurredAt",
|
|
1479
1483
|
header: "When",
|
|
1480
|
-
render: (e) => /* @__PURE__ */ t("span", { className: "muted small", title: e.occurredAt, children:
|
|
1484
|
+
render: (e) => /* @__PURE__ */ t("span", { className: "muted small", title: e.occurredAt, children: lt(e.occurredAt) })
|
|
1481
1485
|
},
|
|
1482
1486
|
{
|
|
1483
1487
|
key: "model",
|
|
@@ -1504,8 +1508,8 @@ const $a = [
|
|
|
1504
1508
|
"span",
|
|
1505
1509
|
{
|
|
1506
1510
|
className: "muted small",
|
|
1507
|
-
title: `${
|
|
1508
|
-
children:
|
|
1511
|
+
title: `${B(e.inputTokens)} in · ${B(e.outputTokens)} out · ${B(e.cachedInputTokens)} cached input · ${B(e.cacheWriteTokens)} cache write`,
|
|
1512
|
+
children: B(e.totalTokens)
|
|
1509
1513
|
}
|
|
1510
1514
|
)
|
|
1511
1515
|
},
|
|
@@ -1514,7 +1518,7 @@ const $a = [
|
|
|
1514
1518
|
header: "Cost",
|
|
1515
1519
|
align: "right",
|
|
1516
1520
|
render: (e) => {
|
|
1517
|
-
const n =
|
|
1521
|
+
const n = Ma(e);
|
|
1518
1522
|
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
1523
|
}
|
|
1520
1524
|
},
|
|
@@ -1522,10 +1526,10 @@ const $a = [
|
|
|
1522
1526
|
key: "result",
|
|
1523
1527
|
header: "Result",
|
|
1524
1528
|
render: (e) => {
|
|
1525
|
-
const n =
|
|
1529
|
+
const n = ot(e.durationMs);
|
|
1526
1530
|
return /* @__PURE__ */ r("span", { className: "muted small", title: e.errorCode ?? void 0, children: [
|
|
1527
1531
|
/* @__PURE__ */ t("span", { className: e.ok ? "tag" : "tag warn", children: e.ok ? "ok" : e.errorCode ?? "failed" }),
|
|
1528
|
-
n != null && /* @__PURE__ */ r(
|
|
1532
|
+
n != null && /* @__PURE__ */ r(K, { children: [
|
|
1529
1533
|
" · ",
|
|
1530
1534
|
n
|
|
1531
1535
|
] })
|
|
@@ -1533,52 +1537,52 @@ const $a = [
|
|
|
1533
1537
|
}
|
|
1534
1538
|
}
|
|
1535
1539
|
];
|
|
1536
|
-
function
|
|
1537
|
-
var h,
|
|
1538
|
-
const n =
|
|
1539
|
-
queryKey:
|
|
1540
|
+
function Ci(e) {
|
|
1541
|
+
var h, v;
|
|
1542
|
+
const n = X(e.projectId), a = ge(), s = e.filter ?? La, i = Ge({
|
|
1543
|
+
queryKey: In(n ?? void 0, s),
|
|
1540
1544
|
enabled: n != null,
|
|
1541
1545
|
initialPageParam: void 0,
|
|
1542
|
-
getNextPageParam: (
|
|
1543
|
-
queryFn: ({ pageParam:
|
|
1546
|
+
getNextPageParam: (w) => w.nextCursor ?? void 0,
|
|
1547
|
+
queryFn: ({ pageParam: w }) => En(
|
|
1544
1548
|
a,
|
|
1545
1549
|
n,
|
|
1546
|
-
|
|
1550
|
+
w ? { ...s, cursor: w } : s
|
|
1547
1551
|
)
|
|
1548
|
-
}), o = ((h = i.data) == null ? void 0 : h.pages) ?? [], l = (
|
|
1552
|
+
}), o = ((h = i.data) == null ? void 0 : h.pages) ?? [], l = (v = o[0]) == null ? void 0 : v.totals, d = o.flatMap((w) => w.items), u = o.length > 0 && Aa(o[0]);
|
|
1549
1553
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ r("section", { className: "section", children: [
|
|
1550
1554
|
/* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ r("div", { children: [
|
|
1551
1555
|
/* @__PURE__ */ t("h3", { children: "Model usage" }),
|
|
1552
1556
|
/* @__PURE__ */ t("p", { className: "muted small", children: "Every model call this project paid for, priced with the rate card in force when it ran. A call with no usable rate counts as unpriced, not as free." })
|
|
1553
1557
|
] }) }),
|
|
1554
|
-
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(
|
|
1558
|
+
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(K, { children: [
|
|
1555
1559
|
/* @__PURE__ */ r("div", { className: "card", "data-testid": "model-usage-totals", children: [
|
|
1556
|
-
|
|
1560
|
+
u && /* @__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." }),
|
|
1557
1561
|
l == null ? (
|
|
1558
1562
|
// A failed query is reported once, below — never as a perpetual "loading".
|
|
1559
1563
|
i.error == null && /* @__PURE__ */ t("p", { className: "muted", children: "Loading totals…" })
|
|
1560
1564
|
) : /* @__PURE__ */ r("p", { className: "muted small", children: [
|
|
1561
1565
|
/* @__PURE__ */ r("span", { "data-testid": "model-usage-total-requests", children: [
|
|
1562
|
-
|
|
1566
|
+
B(l.requests),
|
|
1563
1567
|
" requests"
|
|
1564
1568
|
] }),
|
|
1565
1569
|
" · ",
|
|
1566
1570
|
/* @__PURE__ */ r("span", { "data-testid": "model-usage-total-tokens", children: [
|
|
1567
|
-
|
|
1571
|
+
B(l.totalTokens),
|
|
1568
1572
|
" tokens (",
|
|
1569
|
-
|
|
1573
|
+
B(l.inputTokens),
|
|
1570
1574
|
" in /",
|
|
1571
1575
|
" ",
|
|
1572
|
-
|
|
1576
|
+
B(l.outputTokens),
|
|
1573
1577
|
" out / ",
|
|
1574
|
-
|
|
1578
|
+
B(l.cachedInputTokens),
|
|
1575
1579
|
" cached / ",
|
|
1576
|
-
|
|
1580
|
+
B(l.cacheWriteTokens),
|
|
1577
1581
|
" cache write)"
|
|
1578
1582
|
] }),
|
|
1579
1583
|
" · ",
|
|
1580
|
-
/* @__PURE__ */ t("span", { "data-testid": "model-usage-total-cost", children:
|
|
1581
|
-
l.unpriced > 0 && /* @__PURE__ */ r(
|
|
1584
|
+
/* @__PURE__ */ t("span", { "data-testid": "model-usage-total-cost", children: Ia(l.cost, l.unpriced) }),
|
|
1585
|
+
l.unpriced > 0 && /* @__PURE__ */ r(K, { children: [
|
|
1582
1586
|
" · ",
|
|
1583
1587
|
/* @__PURE__ */ r(
|
|
1584
1588
|
"span",
|
|
@@ -1587,7 +1591,7 @@ function wi(e) {
|
|
|
1587
1591
|
"data-testid": "model-usage-unpriced-total",
|
|
1588
1592
|
title: "calls with no usable rate — not included in any cost total",
|
|
1589
1593
|
children: [
|
|
1590
|
-
|
|
1594
|
+
B(l.unpriced),
|
|
1591
1595
|
" unpriced"
|
|
1592
1596
|
]
|
|
1593
1597
|
}
|
|
@@ -1598,15 +1602,15 @@ function wi(e) {
|
|
|
1598
1602
|
i.error != null && /* @__PURE__ */ t("div", { className: "error", role: "alert", "data-testid": "model-usage-error", children: i.error.message }),
|
|
1599
1603
|
/* @__PURE__ */ r("div", { children: [
|
|
1600
1604
|
i.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
|
|
1601
|
-
i.isSuccess &&
|
|
1602
|
-
|
|
1603
|
-
|
|
1605
|
+
i.isSuccess && d.length === 0 && /* @__PURE__ */ t(De, { testId: "model-usage-empty", children: "No model calls in this window. Usage rows appear here as routes are invoked." }),
|
|
1606
|
+
d.length > 0 && /* @__PURE__ */ t(
|
|
1607
|
+
xe,
|
|
1604
1608
|
{
|
|
1605
|
-
columns:
|
|
1606
|
-
rows:
|
|
1607
|
-
rowKey: (
|
|
1609
|
+
columns: Ra,
|
|
1610
|
+
rows: d,
|
|
1611
|
+
rowKey: (w) => w.id,
|
|
1608
1612
|
testId: "model-usage-table",
|
|
1609
|
-
rowTestId: (
|
|
1613
|
+
rowTestId: (w) => `model-usage-${w.id}`
|
|
1610
1614
|
}
|
|
1611
1615
|
)
|
|
1612
1616
|
] }),
|
|
@@ -1624,42 +1628,171 @@ function wi(e) {
|
|
|
1624
1628
|
] })
|
|
1625
1629
|
] }) });
|
|
1626
1630
|
}
|
|
1627
|
-
const
|
|
1628
|
-
function
|
|
1629
|
-
const
|
|
1631
|
+
const Sa = (e) => `${e} connection${e === 1 ? "" : "s"}`;
|
|
1632
|
+
function Ti({ contract: e, onOpen: n, onCreate: a, slots: s }) {
|
|
1633
|
+
const i = Mn(e ? { contract: e } : void 0), o = Le(), l = (i.data ?? []).filter((h) => !h.private), d = (h) => {
|
|
1634
|
+
var v, w;
|
|
1635
|
+
return ((w = (v = o.data) == null ? void 0 : v.find((b) => b.id === h)) == null ? void 0 : w.label) ?? h;
|
|
1636
|
+
}, u = a && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", onClick: a, children: "Add credential" });
|
|
1630
1637
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-cred-list", children: [
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
/* @__PURE__ */ t("
|
|
1636
|
-
|
|
1638
|
+
/* @__PURE__ */ r("div", { className: "w6w-connection-list-head", "data-testid": "credential-list-header", children: [
|
|
1639
|
+
/* @__PURE__ */ t("div", { className: "w6w-connection-list-heading", children: (s == null ? void 0 : s.header) ?? /* @__PURE__ */ t("h2", { children: "Credentials" }) }),
|
|
1640
|
+
u && /* @__PURE__ */ t("div", { className: "w6w-connection-list-actions", children: u })
|
|
1641
|
+
] }),
|
|
1642
|
+
i.isLoading && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
|
|
1643
|
+
i.error && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", children: i.error.message }),
|
|
1644
|
+
!i.isLoading && !i.error && l.length === 0 && /* @__PURE__ */ t("div", { "data-testid": "credential-list-empty", children: (s == null ? void 0 : s.empty) ?? /* @__PURE__ */ r(K, { children: [
|
|
1645
|
+
/* @__PURE__ */ t("p", { className: "w6w-muted", children: "No credentials yet." }),
|
|
1646
|
+
u
|
|
1647
|
+
] }) }),
|
|
1648
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Credentials", children: l.map((h) => {
|
|
1649
|
+
const v = Object.values(h.display)[0];
|
|
1637
1650
|
return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ r(
|
|
1638
1651
|
"button",
|
|
1639
1652
|
{
|
|
1640
1653
|
type: "button",
|
|
1641
1654
|
className: "w6w-embed-conn-action",
|
|
1642
|
-
"data-testid": `credential-row-${
|
|
1643
|
-
onClick: () => n == null ? void 0 : n(
|
|
1655
|
+
"data-testid": `credential-row-${h.id}`,
|
|
1656
|
+
onClick: () => n == null ? void 0 : n(h.id),
|
|
1644
1657
|
children: [
|
|
1645
|
-
/* @__PURE__ */ t("strong", { children:
|
|
1658
|
+
/* @__PURE__ */ t("strong", { children: h.name }),
|
|
1646
1659
|
" ",
|
|
1647
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children:
|
|
1648
|
-
|
|
1660
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: h.status }),
|
|
1661
|
+
/* @__PURE__ */ r("span", { className: "w6w-muted w6w-small", "data-testid": `credential-type-${h.id}`, children: [
|
|
1662
|
+
" ",
|
|
1663
|
+
d(h.contract)
|
|
1664
|
+
] }),
|
|
1665
|
+
v !== void 0 && /* @__PURE__ */ r("span", { className: "w6w-muted w6w-small", children: [
|
|
1649
1666
|
" ",
|
|
1650
|
-
|
|
1667
|
+
v
|
|
1651
1668
|
] }),
|
|
1652
1669
|
/* @__PURE__ */ r("span", { className: "w6w-muted w6w-small", children: [
|
|
1653
1670
|
" · ",
|
|
1654
|
-
|
|
1671
|
+
Sa(h.connectionCount)
|
|
1655
1672
|
] })
|
|
1656
1673
|
]
|
|
1657
1674
|
}
|
|
1658
|
-
) },
|
|
1675
|
+
) }, h.id);
|
|
1659
1676
|
}) })
|
|
1660
1677
|
] });
|
|
1661
1678
|
}
|
|
1662
|
-
function
|
|
1679
|
+
function wt({
|
|
1680
|
+
fields: e,
|
|
1681
|
+
values: n,
|
|
1682
|
+
onChange: a,
|
|
1683
|
+
idPrefix: s
|
|
1684
|
+
}) {
|
|
1685
|
+
return /* @__PURE__ */ t(K, { children: e.map((i) => {
|
|
1686
|
+
const o = {
|
|
1687
|
+
className: i.secret ? "w6w-input w6w-secret-input" : "w6w-input",
|
|
1688
|
+
value: n[i.key] ?? "",
|
|
1689
|
+
name: `${s}-${i.key}`,
|
|
1690
|
+
autoComplete: "off",
|
|
1691
|
+
autoCapitalize: "off",
|
|
1692
|
+
autoCorrect: "off",
|
|
1693
|
+
spellCheck: !1,
|
|
1694
|
+
"data-1p-ignore": "true",
|
|
1695
|
+
"data-lpignore": "true",
|
|
1696
|
+
"data-bwignore": "true",
|
|
1697
|
+
"data-form-type": "other"
|
|
1698
|
+
};
|
|
1699
|
+
return i.multiline ? /* @__PURE__ */ r("label", { className: "w6w-field", children: [
|
|
1700
|
+
/* @__PURE__ */ t("span", { children: i.label }),
|
|
1701
|
+
/* @__PURE__ */ t("textarea", { rows: 5, ...o, onChange: (l) => a(i.key, l.target.value) })
|
|
1702
|
+
] }, i.key) : /* @__PURE__ */ r("label", { className: "w6w-field", children: [
|
|
1703
|
+
/* @__PURE__ */ t("span", { children: i.label }),
|
|
1704
|
+
/* @__PURE__ */ t("input", { type: "text", ...o, onChange: (l) => a(i.key, l.target.value) })
|
|
1705
|
+
] }, i.key);
|
|
1706
|
+
}) });
|
|
1707
|
+
}
|
|
1708
|
+
const pt = (e, n) => e.every((a) => (n[a.key] ?? "").length > 0), ft = (e, n) => Object.fromEntries(e.map((a) => [a.key, n[a.key] ?? ""]));
|
|
1709
|
+
function $i({ onCreated: e, onCancel: n }) {
|
|
1710
|
+
const a = Le(), s = An(), [i, o] = f(null), [l, d] = f(""), [u, h] = f({}), [v, w] = f(null), b = a.data ?? [], N = b.find((m) => m.id === i) ?? b[0], $ = (m) => {
|
|
1711
|
+
o(m), h({}), w(null);
|
|
1712
|
+
}, g = () => {
|
|
1713
|
+
if (!N || s.isPending) return;
|
|
1714
|
+
if (l.trim() === "") {
|
|
1715
|
+
w("Give the credential a name.");
|
|
1716
|
+
return;
|
|
1717
|
+
}
|
|
1718
|
+
if (!pt(N.fields, u)) {
|
|
1719
|
+
w("Fill in every field.");
|
|
1720
|
+
return;
|
|
1721
|
+
}
|
|
1722
|
+
w(null);
|
|
1723
|
+
const m = {
|
|
1724
|
+
name: l.trim(),
|
|
1725
|
+
contract: N.id,
|
|
1726
|
+
source: ft(N.fields, u)
|
|
1727
|
+
};
|
|
1728
|
+
h({}), s.mutate(m, {
|
|
1729
|
+
onSuccess: (y) => {
|
|
1730
|
+
s.reset(), e == null || e(y.id);
|
|
1731
|
+
},
|
|
1732
|
+
onError: (y) => {
|
|
1733
|
+
s.reset(), w(et(y, "create"));
|
|
1734
|
+
}
|
|
1735
|
+
});
|
|
1736
|
+
};
|
|
1737
|
+
return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-cred-create", "data-testid": "credential-create", children: [
|
|
1738
|
+
/* @__PURE__ */ t("h2", { children: "Add credential" }),
|
|
1739
|
+
a.isLoading && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
|
|
1740
|
+
a.error && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", "data-testid": "credential-types-error", children: "Could not load the credential types." }),
|
|
1741
|
+
N && /* @__PURE__ */ r(
|
|
1742
|
+
"form",
|
|
1743
|
+
{
|
|
1744
|
+
className: "w6w-card-stack",
|
|
1745
|
+
onSubmit: (m) => {
|
|
1746
|
+
m.preventDefault(), g();
|
|
1747
|
+
},
|
|
1748
|
+
children: [
|
|
1749
|
+
/* @__PURE__ */ r("label", { className: "w6w-field", children: [
|
|
1750
|
+
/* @__PURE__ */ t("span", { children: "Type" }),
|
|
1751
|
+
/* @__PURE__ */ t(
|
|
1752
|
+
"select",
|
|
1753
|
+
{
|
|
1754
|
+
value: N.id,
|
|
1755
|
+
"aria-label": "Credential type",
|
|
1756
|
+
onChange: (m) => $(m.target.value),
|
|
1757
|
+
children: b.map((m) => /* @__PURE__ */ t("option", { value: m.id, children: m.label }, m.id))
|
|
1758
|
+
}
|
|
1759
|
+
)
|
|
1760
|
+
] }),
|
|
1761
|
+
/* @__PURE__ */ r("label", { className: "w6w-field", children: [
|
|
1762
|
+
/* @__PURE__ */ t("span", { children: "Name" }),
|
|
1763
|
+
/* @__PURE__ */ t(
|
|
1764
|
+
"input",
|
|
1765
|
+
{
|
|
1766
|
+
type: "text",
|
|
1767
|
+
className: "w6w-input",
|
|
1768
|
+
value: l,
|
|
1769
|
+
onChange: (m) => d(m.target.value),
|
|
1770
|
+
maxLength: 120,
|
|
1771
|
+
autoComplete: "off"
|
|
1772
|
+
}
|
|
1773
|
+
)
|
|
1774
|
+
] }),
|
|
1775
|
+
/* @__PURE__ */ t(
|
|
1776
|
+
wt,
|
|
1777
|
+
{
|
|
1778
|
+
fields: N.fields,
|
|
1779
|
+
values: u,
|
|
1780
|
+
onChange: (m, y) => h((D) => ({ ...D, [m]: y })),
|
|
1781
|
+
idPrefix: "w6w-cred-create"
|
|
1782
|
+
}
|
|
1783
|
+
),
|
|
1784
|
+
v && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", "data-testid": "credential-create-error", children: v }),
|
|
1785
|
+
/* @__PURE__ */ r("div", { className: "w6w-modal-actions", children: [
|
|
1786
|
+
/* @__PURE__ */ t("button", { type: "submit", className: "w6w-btn", disabled: s.isPending, children: s.isPending ? "Creating…" : "Create credential" }),
|
|
1787
|
+
n && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: n, children: "Cancel" })
|
|
1788
|
+
] })
|
|
1789
|
+
]
|
|
1790
|
+
}
|
|
1791
|
+
)
|
|
1792
|
+
] });
|
|
1793
|
+
}
|
|
1794
|
+
const Ke = "google-service-account.v1";
|
|
1795
|
+
function Pa(e) {
|
|
1663
1796
|
try {
|
|
1664
1797
|
const n = JSON.parse(e);
|
|
1665
1798
|
return n !== null && typeof n == "object" && !Array.isArray(n) ? n : null;
|
|
@@ -1667,105 +1800,137 @@ function La(e) {
|
|
|
1667
1800
|
return null;
|
|
1668
1801
|
}
|
|
1669
1802
|
}
|
|
1670
|
-
const
|
|
1671
|
-
function
|
|
1803
|
+
const Fe = (e) => Number.isNaN(Date.parse(e)) ? e : new Date(e).toLocaleString();
|
|
1804
|
+
function Di(e) {
|
|
1805
|
+
return /* @__PURE__ */ t(Oa, { ...e }, e.credentialId);
|
|
1806
|
+
}
|
|
1807
|
+
function Oa({
|
|
1672
1808
|
credentialId: e,
|
|
1673
1809
|
onOpenConnection: n,
|
|
1674
1810
|
onDeleted: a,
|
|
1675
1811
|
onBack: s,
|
|
1676
1812
|
slots: i
|
|
1677
1813
|
}) {
|
|
1678
|
-
var
|
|
1679
|
-
const o =
|
|
1814
|
+
var ee, de, re;
|
|
1815
|
+
const o = Rn(e), l = Sn(e), d = Pn(e), u = On(e), h = jn(e), v = Kn(), w = Le(), [b, N] = f(""), [$, g] = f({}), [m, y] = f(null), [D, E] = f(!1), [x, k] = f(null), [Q, j] = f(null), [R, A] = f(!1), [P, H] = f(null), [I, J] = f(null), q = s && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: s, children: "← Credentials" });
|
|
1680
1816
|
if (o.isLoading)
|
|
1681
1817
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root w6w-embed-cred-detail", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) });
|
|
1682
|
-
const
|
|
1683
|
-
if (!
|
|
1818
|
+
const S = o.data;
|
|
1819
|
+
if (!S)
|
|
1684
1820
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-cred-detail", "data-testid": "credential-not-found", children: [
|
|
1685
1821
|
(i == null ? void 0 : i.empty) ?? /* @__PURE__ */ t("h2", { children: "Credential not found" }),
|
|
1686
|
-
|
|
1822
|
+
q
|
|
1687
1823
|
] });
|
|
1688
|
-
const
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
D("Enter the new secret as a JSON object.");
|
|
1824
|
+
const U = ((ee = l.data) == null ? void 0 : ee.connections) ?? [], _ = S.connectionCount, p = S.status === "disabled", L = S.contract === Ke || (de = w.data) == null ? void 0 : de.find((c) => c.id === S.contract), M = S.contract !== Ke && w.isLoading, z = () => {
|
|
1825
|
+
if (!L) return;
|
|
1826
|
+
if (E(!1), !pt(L.fields, $)) {
|
|
1827
|
+
y("Fill in every field.");
|
|
1693
1828
|
return;
|
|
1694
1829
|
}
|
|
1695
|
-
|
|
1696
|
-
|
|
1830
|
+
y(null);
|
|
1831
|
+
const c = ft(L.fields, $);
|
|
1832
|
+
g({}), d.mutate(
|
|
1833
|
+
{ source: c },
|
|
1697
1834
|
{
|
|
1698
1835
|
onSuccess: () => {
|
|
1699
|
-
|
|
1836
|
+
d.reset(), E(!0);
|
|
1700
1837
|
},
|
|
1701
|
-
onError: (
|
|
1838
|
+
onError: (T) => {
|
|
1839
|
+
d.reset(), y(et(T, "rotate"));
|
|
1840
|
+
}
|
|
1702
1841
|
}
|
|
1703
1842
|
);
|
|
1704
|
-
},
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1843
|
+
}, C = () => {
|
|
1844
|
+
E(!1);
|
|
1845
|
+
const c = Pa(b);
|
|
1846
|
+
if (!c) {
|
|
1847
|
+
y("Enter the new secret as a JSON object.");
|
|
1848
|
+
return;
|
|
1849
|
+
}
|
|
1850
|
+
y(null), d.mutate(
|
|
1851
|
+
{ source: c },
|
|
1852
|
+
{
|
|
1853
|
+
onSuccess: () => {
|
|
1854
|
+
N(""), E(!0);
|
|
1855
|
+
},
|
|
1856
|
+
onError: (T) => y((T == null ? void 0 : T.message) ?? "Rotate failed.")
|
|
1857
|
+
}
|
|
1858
|
+
);
|
|
1859
|
+
}, O = () => {
|
|
1860
|
+
k(null), j(null), h.mutate(void 0, {
|
|
1861
|
+
onSuccess: k,
|
|
1862
|
+
onError: (c) => j((c == null ? void 0 : c.message) ?? "Test failed.")
|
|
1708
1863
|
});
|
|
1709
|
-
},
|
|
1710
|
-
|
|
1711
|
-
onSuccess: (
|
|
1712
|
-
|
|
1864
|
+
}, G = () => {
|
|
1865
|
+
J(null), v.mutate(e, {
|
|
1866
|
+
onSuccess: (c) => {
|
|
1867
|
+
A(!1), c.ok ? a == null || a() : H(c.dependents.connections);
|
|
1713
1868
|
},
|
|
1714
|
-
onError: (
|
|
1869
|
+
onError: (c) => J((c == null ? void 0 : c.message) ?? "Delete failed.")
|
|
1715
1870
|
});
|
|
1716
1871
|
};
|
|
1717
1872
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-cred-detail w6w-card-stack", children: [
|
|
1718
1873
|
/* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
|
|
1719
|
-
/* @__PURE__ */ t("h2", { children:
|
|
1874
|
+
/* @__PURE__ */ t("h2", { children: S.name }),
|
|
1720
1875
|
/* @__PURE__ */ r("p", { className: "w6w-small", children: [
|
|
1721
|
-
/* @__PURE__ */ t("code", { children:
|
|
1876
|
+
/* @__PURE__ */ t("code", { children: S.contract }),
|
|
1722
1877
|
" ",
|
|
1723
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children:
|
|
1878
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: S.status })
|
|
1724
1879
|
] }),
|
|
1725
|
-
/* @__PURE__ */ t("dl", { className: "w6w-small", "data-testid": "credential-display", children: Object.entries(
|
|
1726
|
-
/* @__PURE__ */ t("dt", { className: "w6w-muted", children:
|
|
1727
|
-
/* @__PURE__ */ t("dd", { children:
|
|
1728
|
-
] },
|
|
1880
|
+
/* @__PURE__ */ t("dl", { className: "w6w-small", "data-testid": "credential-display", children: Object.entries(S.display).map(([c, T]) => /* @__PURE__ */ r("div", { children: [
|
|
1881
|
+
/* @__PURE__ */ t("dt", { className: "w6w-muted", children: c }),
|
|
1882
|
+
/* @__PURE__ */ t("dd", { children: T })
|
|
1883
|
+
] }, c)) }),
|
|
1729
1884
|
/* @__PURE__ */ r("p", { className: "w6w-muted w6w-small", children: [
|
|
1730
|
-
|
|
1885
|
+
_,
|
|
1731
1886
|
" connection",
|
|
1732
|
-
|
|
1887
|
+
_ === 1 ? "" : "s",
|
|
1733
1888
|
" · created ",
|
|
1734
|
-
|
|
1889
|
+
Fe(S.createdAt),
|
|
1735
1890
|
" · updated",
|
|
1736
1891
|
" ",
|
|
1737
|
-
|
|
1892
|
+
Fe(S.updatedAt)
|
|
1738
1893
|
] }),
|
|
1739
|
-
|
|
1894
|
+
q
|
|
1740
1895
|
] }),
|
|
1741
1896
|
/* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", "data-testid": "credential-connections", children: [
|
|
1742
1897
|
/* @__PURE__ */ t("h3", { children: "Connected apps" }),
|
|
1743
|
-
|
|
1898
|
+
U.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Not used by any connection." }) : /* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Connected apps", children: U.map((c) => /* @__PURE__ */ t("li", { children: n ? /* @__PURE__ */ t(
|
|
1744
1899
|
"button",
|
|
1745
1900
|
{
|
|
1746
1901
|
type: "button",
|
|
1747
1902
|
className: "w6w-embed-conn-action",
|
|
1748
|
-
onClick: () => n(
|
|
1749
|
-
children:
|
|
1903
|
+
onClick: () => n(c.id),
|
|
1904
|
+
children: c.displayName || c.appId
|
|
1750
1905
|
}
|
|
1751
|
-
) : /* @__PURE__ */ t("span", { children:
|
|
1906
|
+
) : /* @__PURE__ */ t("span", { children: c.displayName || c.appId }) }, c.id)) })
|
|
1752
1907
|
] }),
|
|
1753
1908
|
/* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
|
|
1754
1909
|
/* @__PURE__ */ t("h3", { children: "Rotate secret" }),
|
|
1755
1910
|
/* @__PURE__ */ r("p", { className: "w6w-muted w6w-small", "data-testid": "credential-rotation-impact", children: [
|
|
1756
|
-
|
|
1911
|
+
_,
|
|
1757
1912
|
" connection",
|
|
1758
|
-
|
|
1913
|
+
_ === 1 ? "" : "s",
|
|
1759
1914
|
" will be marked untested"
|
|
1760
1915
|
] }),
|
|
1761
|
-
/* @__PURE__ */ t(
|
|
1916
|
+
M && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
|
|
1917
|
+
L && /* @__PURE__ */ t(
|
|
1918
|
+
wt,
|
|
1919
|
+
{
|
|
1920
|
+
fields: L.fields,
|
|
1921
|
+
values: $,
|
|
1922
|
+
onChange: (c, T) => g((F) => ({ ...F, [c]: T })),
|
|
1923
|
+
idPrefix: "w6w-cred-rotate"
|
|
1924
|
+
}
|
|
1925
|
+
),
|
|
1926
|
+
!M && !L && /* @__PURE__ */ t(
|
|
1762
1927
|
"textarea",
|
|
1763
1928
|
{
|
|
1764
1929
|
className: "w6w-input w6w-secret-input",
|
|
1765
1930
|
"aria-label": "New secret (JSON object)",
|
|
1766
1931
|
rows: 5,
|
|
1767
|
-
value:
|
|
1768
|
-
onChange: (
|
|
1932
|
+
value: b,
|
|
1933
|
+
onChange: (c) => N(c.target.value),
|
|
1769
1934
|
name: "w6w-cred-rotate",
|
|
1770
1935
|
autoComplete: "off",
|
|
1771
1936
|
autoCapitalize: "off",
|
|
@@ -1777,9 +1942,18 @@ function fi({
|
|
|
1777
1942
|
"data-form-type": "other"
|
|
1778
1943
|
}
|
|
1779
1944
|
),
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
/* @__PURE__ */ t(
|
|
1945
|
+
m && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", "data-testid": "credential-rotate-error", children: m }),
|
|
1946
|
+
D && /* @__PURE__ */ t("output", { children: "Secret rotated." }),
|
|
1947
|
+
/* @__PURE__ */ t(
|
|
1948
|
+
"button",
|
|
1949
|
+
{
|
|
1950
|
+
type: "button",
|
|
1951
|
+
className: "w6w-btn",
|
|
1952
|
+
disabled: d.isPending || M,
|
|
1953
|
+
onClick: L ? z : C,
|
|
1954
|
+
children: d.isPending ? "Rotating…" : "Rotate"
|
|
1955
|
+
}
|
|
1956
|
+
)
|
|
1783
1957
|
] }),
|
|
1784
1958
|
/* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
|
|
1785
1959
|
/* @__PURE__ */ t("h3", { children: "Manage" }),
|
|
@@ -1789,9 +1963,9 @@ function fi({
|
|
|
1789
1963
|
{
|
|
1790
1964
|
type: "button",
|
|
1791
1965
|
className: "w6w-btn w6w-btn-ghost",
|
|
1792
|
-
disabled:
|
|
1793
|
-
onClick: () =>
|
|
1794
|
-
children:
|
|
1966
|
+
disabled: u.isPending,
|
|
1967
|
+
onClick: () => u.mutate(p ? "active" : "disabled"),
|
|
1968
|
+
children: p ? "Enable" : "Disable"
|
|
1795
1969
|
}
|
|
1796
1970
|
),
|
|
1797
1971
|
/* @__PURE__ */ t(
|
|
@@ -1800,7 +1974,7 @@ function fi({
|
|
|
1800
1974
|
type: "button",
|
|
1801
1975
|
className: "w6w-btn w6w-btn-ghost",
|
|
1802
1976
|
disabled: h.isPending,
|
|
1803
|
-
onClick:
|
|
1977
|
+
onClick: O,
|
|
1804
1978
|
children: h.isPending ? "Testing…" : "Test credential"
|
|
1805
1979
|
}
|
|
1806
1980
|
),
|
|
@@ -1810,19 +1984,19 @@ function fi({
|
|
|
1810
1984
|
type: "button",
|
|
1811
1985
|
className: "w6w-btn w6w-btn-danger",
|
|
1812
1986
|
onClick: () => {
|
|
1813
|
-
|
|
1987
|
+
H(null), A(!0);
|
|
1814
1988
|
},
|
|
1815
1989
|
children: "Delete"
|
|
1816
1990
|
}
|
|
1817
1991
|
)
|
|
1818
1992
|
] }),
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1993
|
+
x && /* @__PURE__ */ t("output", { "data-testid": "credential-test-result", children: x.ok ? "ok" : x.code ?? "failed" }),
|
|
1994
|
+
Q && /* @__PURE__ */ t("p", { role: "alert", children: Q }),
|
|
1995
|
+
u.isError && /* @__PURE__ */ t("p", { role: "alert", children: ((re = u.error) == null ? void 0 : re.message) ?? "Update failed." }),
|
|
1996
|
+
R && /* @__PURE__ */ r("div", { "data-testid": "credential-delete-confirm", children: [
|
|
1823
1997
|
/* @__PURE__ */ r("p", { className: "w6w-small", children: [
|
|
1824
1998
|
'Delete the credential "',
|
|
1825
|
-
|
|
1999
|
+
S.name,
|
|
1826
2000
|
'"? This cannot be undone.'
|
|
1827
2001
|
] }),
|
|
1828
2002
|
/* @__PURE__ */ t(
|
|
@@ -1830,8 +2004,8 @@ function fi({
|
|
|
1830
2004
|
{
|
|
1831
2005
|
type: "button",
|
|
1832
2006
|
className: "w6w-btn w6w-btn-danger",
|
|
1833
|
-
disabled:
|
|
1834
|
-
onClick:
|
|
2007
|
+
disabled: v.isPending,
|
|
2008
|
+
onClick: G,
|
|
1835
2009
|
children: "Confirm delete"
|
|
1836
2010
|
}
|
|
1837
2011
|
),
|
|
@@ -1841,7 +2015,7 @@ function fi({
|
|
|
1841
2015
|
{
|
|
1842
2016
|
type: "button",
|
|
1843
2017
|
className: "w6w-btn w6w-btn-ghost",
|
|
1844
|
-
onClick: () =>
|
|
2018
|
+
onClick: () => A(!1),
|
|
1845
2019
|
children: "Cancel"
|
|
1846
2020
|
}
|
|
1847
2021
|
)
|
|
@@ -1854,296 +2028,296 @@ function fi({
|
|
|
1854
2028
|
P.length === 1 ? "" : "s",
|
|
1855
2029
|
". Delete those integrations first, or rotate this credential instead of deleting it."
|
|
1856
2030
|
] }),
|
|
1857
|
-
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", children: P.map((
|
|
2031
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", children: P.map((c) => /* @__PURE__ */ t("li", { children: c.displayName || c.appId }, c.id)) })
|
|
1858
2032
|
] }),
|
|
1859
|
-
|
|
2033
|
+
I && /* @__PURE__ */ t("p", { role: "alert", children: I })
|
|
1860
2034
|
] })
|
|
1861
2035
|
] });
|
|
1862
2036
|
}
|
|
1863
2037
|
function V(e) {
|
|
1864
|
-
const n =
|
|
2038
|
+
const n = Pt(e), a = e == null ? void 0 : e.code;
|
|
1865
2039
|
return n.code === void 0 && typeof a == "string" && a !== "" ? { ...n, code: a } : n;
|
|
1866
2040
|
}
|
|
1867
|
-
const
|
|
1868
|
-
function
|
|
2041
|
+
const Qe = 80;
|
|
2042
|
+
function ja(e, n) {
|
|
1869
2043
|
if (typeof URL > "u" || typeof URL.createObjectURL != "function") return;
|
|
1870
2044
|
const a = URL.createObjectURL(new Blob([n], { type: "text/csv" })), s = document.createElement("a");
|
|
1871
2045
|
s.href = a, s.download = e, s.click(), URL.revokeObjectURL(a);
|
|
1872
2046
|
}
|
|
1873
|
-
function
|
|
1874
|
-
var
|
|
1875
|
-
const a =
|
|
1876
|
-
(
|
|
1877
|
-
),
|
|
1878
|
-
const Z =
|
|
1879
|
-
|
|
1880
|
-
id:
|
|
1881
|
-
isNew:
|
|
1882
|
-
cells:
|
|
1883
|
-
version:
|
|
1884
|
-
dirty: Z === null ? !0 :
|
|
1885
|
-
conflict:
|
|
1886
|
-
cellErrors: h[
|
|
2047
|
+
function Ka({ store: e, project: n }) {
|
|
2048
|
+
var re;
|
|
2049
|
+
const a = Ot(e), s = (a == null ? void 0 : a.columns) ?? [], i = (a == null ? void 0 : a.key) ?? "", [o, l] = f(""), [d, u] = f({}), [h, v] = f({}), [w, b] = f({}), [N, $] = f({}), [g, m] = f(null), [y, D] = f(null), [E, x] = f(null), k = ge(), Q = fe(), j = tt(e.id, n, o), R = nt(), A = Qn(), P = at(), H = qn(), I = _n(), J = (((re = j.data) == null ? void 0 : re.pages.flatMap((c) => c.items)) ?? []).map(
|
|
2050
|
+
(c) => N[c.key] ?? c
|
|
2051
|
+
), q = new Map(J.map((c) => [c.key, c])), S = [], U = (c) => d[c], _ = U(ne), p = (c, T, F) => {
|
|
2052
|
+
const Z = F === void 0 ? null : ue(F, s);
|
|
2053
|
+
S.push({
|
|
2054
|
+
id: c,
|
|
2055
|
+
isNew: c === ne,
|
|
2056
|
+
cells: T.cells,
|
|
2057
|
+
version: T.version,
|
|
2058
|
+
dirty: Z === null ? !0 : _t(T, Z, s).length > 0,
|
|
2059
|
+
conflict: w[c] === !0,
|
|
2060
|
+
cellErrors: h[c]
|
|
1887
2061
|
});
|
|
1888
2062
|
};
|
|
1889
|
-
|
|
1890
|
-
for (const
|
|
1891
|
-
p(
|
|
1892
|
-
const
|
|
1893
|
-
|
|
1894
|
-
},
|
|
1895
|
-
|
|
2063
|
+
_ !== void 0 && p(ne, _, void 0);
|
|
2064
|
+
for (const c of J)
|
|
2065
|
+
p(c.key, U(c.key) ?? ue(c, s), c);
|
|
2066
|
+
const L = (c) => {
|
|
2067
|
+
v((T) => ae(T, c)), b((T) => ae(T, c));
|
|
2068
|
+
}, M = (c) => {
|
|
2069
|
+
u((T) => ae(T, c)), L(c);
|
|
1896
2070
|
};
|
|
1897
|
-
function
|
|
1898
|
-
const Z =
|
|
1899
|
-
|
|
1900
|
-
const
|
|
1901
|
-
if (
|
|
1902
|
-
const
|
|
1903
|
-
return Object.keys(
|
|
2071
|
+
function z(c, T, F) {
|
|
2072
|
+
const Z = q.get(c), Y = U(c) ?? (Z ? ue(Z, s) : Me(s));
|
|
2073
|
+
u((W) => ({ ...W, [c]: { ...Y, cells: { ...Y.cells, [T]: F } } })), v((W) => {
|
|
2074
|
+
const te = W[c];
|
|
2075
|
+
if (te === void 0 || !(T in te)) return W;
|
|
2076
|
+
const le = ae(te, T);
|
|
2077
|
+
return Object.keys(le).length === 0 ? ae(W, c) : { ...W, [c]: le };
|
|
1904
2078
|
});
|
|
1905
2079
|
}
|
|
1906
|
-
async function
|
|
1907
|
-
const
|
|
1908
|
-
if (
|
|
1909
|
-
|
|
1910
|
-
const Z =
|
|
2080
|
+
async function C(c) {
|
|
2081
|
+
const T = q.get(c), F = U(c) ?? (T ? ue(T, s) : void 0);
|
|
2082
|
+
if (F === void 0) return;
|
|
2083
|
+
m(null), L(c);
|
|
2084
|
+
const Z = Bt(F, s);
|
|
1911
2085
|
if (!Z.ok) {
|
|
1912
|
-
|
|
2086
|
+
v((W) => ({ ...W, [c]: Z.errors }));
|
|
1913
2087
|
return;
|
|
1914
2088
|
}
|
|
1915
|
-
const
|
|
1916
|
-
|
|
2089
|
+
const Y = Ut(
|
|
2090
|
+
F,
|
|
1917
2091
|
Z.value,
|
|
1918
|
-
|
|
2092
|
+
Ve((T == null ? void 0 : T.expiresAt) ?? null, Date.now())
|
|
1919
2093
|
);
|
|
1920
2094
|
try {
|
|
1921
|
-
|
|
2095
|
+
Y.kind === "insert" ? await A.mutateAsync({
|
|
1922
2096
|
id: e.id,
|
|
1923
|
-
row:
|
|
1924
|
-
ttlSeconds:
|
|
2097
|
+
row: Y.value,
|
|
2098
|
+
ttlSeconds: Y.ttlSeconds,
|
|
1925
2099
|
project: n
|
|
1926
|
-
}) : await
|
|
2100
|
+
}) : await R.mutateAsync({
|
|
1927
2101
|
id: e.id,
|
|
1928
|
-
key:
|
|
1929
|
-
value:
|
|
1930
|
-
ifVersion:
|
|
1931
|
-
ttlSeconds:
|
|
2102
|
+
key: Y.key,
|
|
2103
|
+
value: Y.value,
|
|
2104
|
+
ifVersion: Y.ifVersion,
|
|
2105
|
+
ttlSeconds: Y.ttlSeconds,
|
|
1932
2106
|
project: n
|
|
1933
|
-
}),
|
|
1934
|
-
} catch (
|
|
1935
|
-
const
|
|
1936
|
-
if (
|
|
1937
|
-
|
|
2107
|
+
}), $((W) => ae(W, c)), M(c);
|
|
2108
|
+
} catch (W) {
|
|
2109
|
+
const te = V(W);
|
|
2110
|
+
if (He(te)) {
|
|
2111
|
+
b((ye) => ({ ...ye, [c]: !0 }));
|
|
1938
2112
|
return;
|
|
1939
2113
|
}
|
|
1940
|
-
const
|
|
1941
|
-
if (
|
|
1942
|
-
|
|
2114
|
+
const le = Vt(te, s);
|
|
2115
|
+
if (le !== null) {
|
|
2116
|
+
v((ye) => ({ ...ye, [c]: le }));
|
|
1943
2117
|
return;
|
|
1944
2118
|
}
|
|
1945
|
-
|
|
2119
|
+
m(te.message);
|
|
1946
2120
|
}
|
|
1947
2121
|
}
|
|
1948
|
-
async function O(
|
|
2122
|
+
async function O(c) {
|
|
1949
2123
|
try {
|
|
1950
|
-
const
|
|
1951
|
-
|
|
1952
|
-
} catch (
|
|
1953
|
-
|
|
2124
|
+
const T = await it(k, e.id, c, n);
|
|
2125
|
+
$((F) => ({ ...F, [c]: T })), M(c), await Q.invalidateQueries({ queryKey: ["data-stores"] });
|
|
2126
|
+
} catch (T) {
|
|
2127
|
+
m(V(T).message);
|
|
1954
2128
|
}
|
|
1955
2129
|
}
|
|
1956
|
-
function
|
|
1957
|
-
const
|
|
1958
|
-
|
|
2130
|
+
function G() {
|
|
2131
|
+
const c = y;
|
|
2132
|
+
D(null), c !== null && (c !== ne && P.mutate({ id: e.id, key: c, project: n }), M(c));
|
|
1959
2133
|
}
|
|
1960
|
-
async function
|
|
1961
|
-
|
|
2134
|
+
async function ee(c) {
|
|
2135
|
+
x(null);
|
|
1962
2136
|
try {
|
|
1963
|
-
const
|
|
1964
|
-
|
|
1965
|
-
} catch (
|
|
1966
|
-
const
|
|
1967
|
-
|
|
1968
|
-
typeof
|
|
2137
|
+
const T = await H.mutateAsync({ id: e.id, csv: await c.text(), project: n });
|
|
2138
|
+
x(Ae({ status: 200, text: JSON.stringify(T) }));
|
|
2139
|
+
} catch (T) {
|
|
2140
|
+
const F = T;
|
|
2141
|
+
x(
|
|
2142
|
+
typeof F.status == "number" ? Ae({ status: F.status, text: JSON.stringify(F.raw ?? null) }) : { ok: !1, message: V(T).message }
|
|
1969
2143
|
);
|
|
1970
2144
|
}
|
|
1971
2145
|
}
|
|
1972
|
-
async function
|
|
2146
|
+
async function de() {
|
|
1973
2147
|
try {
|
|
1974
|
-
const
|
|
1975
|
-
|
|
1976
|
-
} catch (
|
|
1977
|
-
|
|
2148
|
+
const c = await I.mutateAsync({ id: e.id, project: n });
|
|
2149
|
+
ja(Wt(null, e.name), c), x(null);
|
|
2150
|
+
} catch (c) {
|
|
2151
|
+
x({ ok: !1, message: V(c).message });
|
|
1978
2152
|
}
|
|
1979
2153
|
}
|
|
1980
2154
|
return /* @__PURE__ */ r("div", { children: [
|
|
1981
2155
|
/* @__PURE__ */ t(
|
|
1982
|
-
|
|
2156
|
+
jt,
|
|
1983
2157
|
{
|
|
1984
|
-
result:
|
|
1985
|
-
busy:
|
|
1986
|
-
onImport:
|
|
1987
|
-
onRefuse: (
|
|
1988
|
-
onExport:
|
|
2158
|
+
result: E,
|
|
2159
|
+
busy: I.isPending,
|
|
2160
|
+
onImport: ee,
|
|
2161
|
+
onRefuse: (c) => x({ ok: !1, message: c }),
|
|
2162
|
+
onExport: de
|
|
1989
2163
|
}
|
|
1990
2164
|
),
|
|
1991
2165
|
/* @__PURE__ */ t(
|
|
1992
|
-
|
|
2166
|
+
Kt,
|
|
1993
2167
|
{
|
|
1994
2168
|
columns: s,
|
|
1995
2169
|
keyColumn: i,
|
|
1996
|
-
rows:
|
|
2170
|
+
rows: S,
|
|
1997
2171
|
error: g,
|
|
1998
|
-
loading:
|
|
1999
|
-
hasMore:
|
|
2172
|
+
loading: j.isPending,
|
|
2173
|
+
hasMore: j.hasNextPage,
|
|
2000
2174
|
empty: /* @__PURE__ */ t("p", { className: "muted small", children: "No rows match this key prefix." }),
|
|
2001
|
-
onCellChange:
|
|
2002
|
-
onSave: (
|
|
2003
|
-
onDelete:
|
|
2004
|
-
onReload: (
|
|
2175
|
+
onCellChange: z,
|
|
2176
|
+
onSave: (c) => void C(c),
|
|
2177
|
+
onDelete: D,
|
|
2178
|
+
onReload: (c) => void O(c),
|
|
2005
2179
|
onAddRow: () => {
|
|
2006
|
-
|
|
2180
|
+
ne in d || (u((c) => ({ ...c, [ne]: Me(s) })), m(null));
|
|
2007
2181
|
},
|
|
2008
|
-
onLoadMore: () => void
|
|
2182
|
+
onLoadMore: () => void j.fetchNextPage(),
|
|
2009
2183
|
onSearch: l
|
|
2010
2184
|
}
|
|
2011
2185
|
),
|
|
2012
2186
|
y !== null && /* @__PURE__ */ t(
|
|
2013
|
-
|
|
2187
|
+
pe,
|
|
2014
2188
|
{
|
|
2015
2189
|
title: "Delete entry",
|
|
2016
|
-
message: y ===
|
|
2190
|
+
message: y === ne ? "Discard this unsaved row?" : `Delete "${y}"? This cannot be undone.`,
|
|
2017
2191
|
confirmLabel: "Delete",
|
|
2018
|
-
onConfirm:
|
|
2019
|
-
onClose: () =>
|
|
2192
|
+
onConfirm: G,
|
|
2193
|
+
onClose: () => D(null)
|
|
2020
2194
|
}
|
|
2021
2195
|
)
|
|
2022
2196
|
] });
|
|
2023
2197
|
}
|
|
2024
|
-
function
|
|
2025
|
-
var
|
|
2026
|
-
const a = e.kind === "doc", s =
|
|
2027
|
-
(
|
|
2028
|
-
),
|
|
2029
|
-
const O =
|
|
2030
|
-
return O.length >
|
|
2198
|
+
function Fa({ store: e, project: n }) {
|
|
2199
|
+
var z;
|
|
2200
|
+
const a = e.kind === "doc", s = Ft(e), [i, o] = f(""), [l, d] = f(null), [u, h] = f(!1), [v, w] = f(""), [b, N] = f(""), [$, g] = f(null), [m, y] = f(!1), [D, E] = f({}), [x, k] = f(null), Q = ge(), j = fe(), R = tt(e.id, n, i), A = nt(), P = at(), H = (((z = R.data) == null ? void 0 : z.pages.flatMap((C) => C.items)) ?? []).map(
|
|
2201
|
+
(C) => D[C.key] ?? C
|
|
2202
|
+
), I = l === null ? void 0 : H.find((C) => C.key === l), J = u || l !== null, q = (C) => a ? JSON.stringify(C.value ?? null, null, 2) : Yt(s, C.value), S = (C) => {
|
|
2203
|
+
const O = q(C).replace(/\s+/g, " ");
|
|
2204
|
+
return O.length > Qe ? `${O.slice(0, Qe)}…` : O;
|
|
2031
2205
|
};
|
|
2032
|
-
function
|
|
2033
|
-
|
|
2206
|
+
function U(C) {
|
|
2207
|
+
d(C.key), h(!1), N(q(C)), g(null), y(!1);
|
|
2034
2208
|
}
|
|
2035
|
-
function
|
|
2036
|
-
|
|
2209
|
+
function _() {
|
|
2210
|
+
d(null), h(!1), w(""), N(""), g(null), y(!1);
|
|
2037
2211
|
}
|
|
2038
2212
|
async function p() {
|
|
2039
2213
|
g(null), y(!1);
|
|
2040
|
-
const
|
|
2041
|
-
if (!
|
|
2042
|
-
g(
|
|
2214
|
+
const C = a ? Ht(b) : Jt(s, b);
|
|
2215
|
+
if (!C.ok) {
|
|
2216
|
+
g(C.message);
|
|
2043
2217
|
return;
|
|
2044
2218
|
}
|
|
2045
|
-
const O =
|
|
2219
|
+
const O = u ? v.trim() : l;
|
|
2046
2220
|
if (O === null || O === "") {
|
|
2047
2221
|
g("Enter a key.");
|
|
2048
2222
|
return;
|
|
2049
2223
|
}
|
|
2050
2224
|
try {
|
|
2051
|
-
await
|
|
2225
|
+
await A.mutateAsync({
|
|
2052
2226
|
id: e.id,
|
|
2053
2227
|
key: O,
|
|
2054
|
-
value:
|
|
2228
|
+
value: C.value,
|
|
2055
2229
|
// A new entry must not exist yet; an existing one is guarded by the version loaded.
|
|
2056
|
-
ifVersion:
|
|
2057
|
-
ttlSeconds:
|
|
2230
|
+
ifVersion: u ? 0 : (I == null ? void 0 : I.version) ?? 0,
|
|
2231
|
+
ttlSeconds: u ? void 0 : Ve((I == null ? void 0 : I.expiresAt) ?? null, Date.now()),
|
|
2058
2232
|
project: n
|
|
2059
|
-
}),
|
|
2060
|
-
} catch (
|
|
2061
|
-
const
|
|
2062
|
-
|
|
2233
|
+
}), E((G) => ae(G, O)), _();
|
|
2234
|
+
} catch (G) {
|
|
2235
|
+
const ee = V(G);
|
|
2236
|
+
He(ee) ? y(!0) : g(ee.message);
|
|
2063
2237
|
}
|
|
2064
2238
|
}
|
|
2065
|
-
async function
|
|
2239
|
+
async function L() {
|
|
2066
2240
|
if (l !== null)
|
|
2067
2241
|
try {
|
|
2068
|
-
const
|
|
2069
|
-
|
|
2070
|
-
} catch (
|
|
2071
|
-
g(V(
|
|
2242
|
+
const C = await it(Q, e.id, l, n);
|
|
2243
|
+
E((O) => ({ ...O, [l]: C })), N(q(C)), y(!1), g(null), await j.invalidateQueries({ queryKey: ["data-stores"] });
|
|
2244
|
+
} catch (C) {
|
|
2245
|
+
g(V(C).message);
|
|
2072
2246
|
}
|
|
2073
2247
|
}
|
|
2074
|
-
async function
|
|
2075
|
-
const
|
|
2076
|
-
if (
|
|
2248
|
+
async function M() {
|
|
2249
|
+
const C = x;
|
|
2250
|
+
if (k(null), C !== null)
|
|
2077
2251
|
try {
|
|
2078
|
-
await
|
|
2252
|
+
await P.mutateAsync({ id: e.id, key: C, project: n }), C === l && _();
|
|
2079
2253
|
} catch (O) {
|
|
2080
2254
|
g(V(O).message);
|
|
2081
2255
|
}
|
|
2082
2256
|
}
|
|
2083
2257
|
return /* @__PURE__ */ r("div", { children: [
|
|
2084
2258
|
/* @__PURE__ */ t(
|
|
2085
|
-
|
|
2259
|
+
Qt,
|
|
2086
2260
|
{
|
|
2087
|
-
rows: H.map((
|
|
2088
|
-
loading:
|
|
2261
|
+
rows: H.map((C) => ({ key: C.key, version: C.version, preview: S(C) })),
|
|
2262
|
+
loading: R.isPending,
|
|
2089
2263
|
empty: /* @__PURE__ */ t("p", { className: "muted small", children: "No entries match this key prefix." }),
|
|
2090
|
-
hasMore:
|
|
2091
|
-
onOpen: (
|
|
2092
|
-
const O = H.find((
|
|
2093
|
-
O &&
|
|
2264
|
+
hasMore: R.hasNextPage,
|
|
2265
|
+
onOpen: (C) => {
|
|
2266
|
+
const O = H.find((G) => G.key === C);
|
|
2267
|
+
O && U(O);
|
|
2094
2268
|
},
|
|
2095
2269
|
onSearch: o,
|
|
2096
2270
|
onNew: () => {
|
|
2097
|
-
|
|
2271
|
+
d(null), h(!0), w(""), N(""), g(null), y(!1);
|
|
2098
2272
|
},
|
|
2099
|
-
onLoadMore: () => void
|
|
2273
|
+
onLoadMore: () => void R.fetchNextPage()
|
|
2100
2274
|
}
|
|
2101
2275
|
),
|
|
2102
2276
|
J && /* @__PURE__ */ t(
|
|
2103
|
-
|
|
2277
|
+
qt,
|
|
2104
2278
|
{
|
|
2105
2279
|
kind: a ? "doc" : "kv",
|
|
2106
|
-
isNew:
|
|
2280
|
+
isNew: u,
|
|
2107
2281
|
entryKey: l ?? void 0,
|
|
2108
|
-
newKey:
|
|
2109
|
-
version: (
|
|
2110
|
-
expiresAt: (
|
|
2111
|
-
text:
|
|
2112
|
-
error:
|
|
2113
|
-
conflict:
|
|
2114
|
-
saving:
|
|
2115
|
-
onDelete:
|
|
2116
|
-
onTextChange: (
|
|
2117
|
-
|
|
2282
|
+
newKey: v,
|
|
2283
|
+
version: (I == null ? void 0 : I.version) ?? null,
|
|
2284
|
+
expiresAt: (I == null ? void 0 : I.expiresAt) ?? null,
|
|
2285
|
+
text: b,
|
|
2286
|
+
error: $,
|
|
2287
|
+
conflict: m,
|
|
2288
|
+
saving: A.isPending || P.isPending,
|
|
2289
|
+
onDelete: u ? void 0 : () => k(l),
|
|
2290
|
+
onTextChange: (C) => {
|
|
2291
|
+
N(C), g(null);
|
|
2118
2292
|
},
|
|
2119
|
-
onKeyChange:
|
|
2293
|
+
onKeyChange: w,
|
|
2120
2294
|
onSave: () => void p(),
|
|
2121
|
-
onCancel:
|
|
2122
|
-
onReload: () => void
|
|
2295
|
+
onCancel: _,
|
|
2296
|
+
onReload: () => void L()
|
|
2123
2297
|
}
|
|
2124
2298
|
),
|
|
2125
|
-
|
|
2126
|
-
|
|
2299
|
+
x !== null && /* @__PURE__ */ t(
|
|
2300
|
+
pe,
|
|
2127
2301
|
{
|
|
2128
2302
|
title: "Delete entry",
|
|
2129
|
-
message: `Delete "${
|
|
2303
|
+
message: `Delete "${x}"? This cannot be undone.`,
|
|
2130
2304
|
confirmLabel: "Delete",
|
|
2131
|
-
onConfirm:
|
|
2132
|
-
onClose: () =>
|
|
2305
|
+
onConfirm: M,
|
|
2306
|
+
onClose: () => k(null)
|
|
2133
2307
|
}
|
|
2134
2308
|
)
|
|
2135
2309
|
] });
|
|
2136
2310
|
}
|
|
2137
|
-
function
|
|
2311
|
+
function ae(e, n) {
|
|
2138
2312
|
if (!(n in e)) return e;
|
|
2139
2313
|
const a = { ...e };
|
|
2140
2314
|
return delete a[n], a;
|
|
2141
2315
|
}
|
|
2142
|
-
function
|
|
2143
|
-
const s =
|
|
2316
|
+
function xi({ id: e, project: n, slots: a }) {
|
|
2317
|
+
const s = X(n), i = Fn(e, s ?? void 0), o = i.data;
|
|
2144
2318
|
let l;
|
|
2145
|
-
s == null ? l = /* @__PURE__ */ t("p", { className: "muted", children: "No project selected." }) : i.isError ? l = /* @__PURE__ */ t("p", { className: "result error", children: V(i.error).message }) : o === void 0 ? l = /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : o.kind === "table" ? l = /* @__PURE__ */ t(
|
|
2146
|
-
const
|
|
2319
|
+
s == null ? l = /* @__PURE__ */ t("p", { className: "muted", children: "No project selected." }) : i.isError ? l = /* @__PURE__ */ t("p", { className: "result error", children: V(i.error).message }) : o === void 0 ? l = /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : o.kind === "table" ? l = /* @__PURE__ */ t(Ka, { store: o, project: s }, o.id) : l = /* @__PURE__ */ t(Fa, { store: o, project: s }, o.id);
|
|
2320
|
+
const d = (a == null ? void 0 : a.header) === void 0 ? o && /* @__PURE__ */ r("div", { children: [
|
|
2147
2321
|
/* @__PURE__ */ t("h3", { children: o.name }),
|
|
2148
2322
|
/* @__PURE__ */ r("p", { className: "muted small", children: [
|
|
2149
2323
|
o.kind,
|
|
@@ -2154,41 +2328,41 @@ function gi({ id: e, project: n, slots: a }) {
|
|
|
2154
2328
|
] })
|
|
2155
2329
|
] }) : a.header;
|
|
2156
2330
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ r("section", { className: "section", children: [
|
|
2157
|
-
|
|
2331
|
+
d,
|
|
2158
2332
|
l
|
|
2159
2333
|
] }) });
|
|
2160
2334
|
}
|
|
2161
|
-
const
|
|
2162
|
-
function
|
|
2163
|
-
const [n, a] = f(""), [s, i] = f(""), [o, l] = f("kv"), [
|
|
2164
|
-
function
|
|
2165
|
-
|
|
2166
|
-
const
|
|
2335
|
+
const Qa = ["name", "kind", "description", "schema"];
|
|
2336
|
+
function qa(e) {
|
|
2337
|
+
const [n, a] = f(""), [s, i] = f(""), [o, l] = f("kv"), [d, u] = f("string"), [h, v] = f([]), [w, b] = f(""), [N, $] = f({}), [g, m] = f({}), [y, D] = f(null), E = Un();
|
|
2338
|
+
function x() {
|
|
2339
|
+
$({}), m({}), D(null);
|
|
2340
|
+
const k = {
|
|
2167
2341
|
kind: o,
|
|
2168
2342
|
name: n
|
|
2169
2343
|
};
|
|
2170
|
-
o === "kv" && (
|
|
2344
|
+
o === "kv" && (k.schema = { valueType: d }), o === "table" && (k.schema = w === "" ? { columns: h } : { columns: h, key: w }), s !== "" && (k.description = s), E.mutate(
|
|
2171
2345
|
// The SDK's create body types `schema` as table columns only; the wire takes the S-2 shape
|
|
2172
2346
|
// per kind, so the kv `{valueType}` schema is passed through as the host defines it.
|
|
2173
|
-
{ input:
|
|
2347
|
+
{ input: k, project: e.project },
|
|
2174
2348
|
{
|
|
2175
2349
|
onSuccess: () => e.onClose(),
|
|
2176
|
-
onError: (
|
|
2177
|
-
const
|
|
2178
|
-
if (
|
|
2179
|
-
|
|
2350
|
+
onError: (Q) => {
|
|
2351
|
+
const j = V(Q), R = tn(j);
|
|
2352
|
+
if (R.kind === "cell" && h.some((A) => A.name === R.column)) {
|
|
2353
|
+
m({ [R.column]: j.message });
|
|
2180
2354
|
return;
|
|
2181
2355
|
}
|
|
2182
|
-
if (
|
|
2183
|
-
|
|
2356
|
+
if (R.kind === "field" && Qa.includes(R.field)) {
|
|
2357
|
+
$({ [R.field]: j.message });
|
|
2184
2358
|
return;
|
|
2185
2359
|
}
|
|
2186
|
-
|
|
2360
|
+
D(j.message);
|
|
2187
2361
|
}
|
|
2188
2362
|
}
|
|
2189
2363
|
);
|
|
2190
2364
|
}
|
|
2191
|
-
return /* @__PURE__ */ r(
|
|
2365
|
+
return /* @__PURE__ */ r(fn, { title: "New data store", onClose: e.onClose, children: [
|
|
2192
2366
|
/* @__PURE__ */ r("div", { className: "modal-body", children: [
|
|
2193
2367
|
/* @__PURE__ */ r("label", { className: "field", children: [
|
|
2194
2368
|
/* @__PURE__ */ t("span", { children: "Name" }),
|
|
@@ -2198,12 +2372,12 @@ function Aa(e) {
|
|
|
2198
2372
|
type: "text",
|
|
2199
2373
|
"data-testid": "data-store-name",
|
|
2200
2374
|
value: n,
|
|
2201
|
-
onChange: (
|
|
2375
|
+
onChange: (k) => a(k.target.value),
|
|
2202
2376
|
placeholder: "e.g. counters"
|
|
2203
2377
|
}
|
|
2204
2378
|
)
|
|
2205
2379
|
] }),
|
|
2206
|
-
|
|
2380
|
+
N.name !== void 0 && /* @__PURE__ */ t("div", { className: "result error", "data-testid": "data-store-field-error-name", children: N.name }),
|
|
2207
2381
|
/* @__PURE__ */ r("label", { className: "field", children: [
|
|
2208
2382
|
/* @__PURE__ */ t("span", { children: "Description" }),
|
|
2209
2383
|
/* @__PURE__ */ t(
|
|
@@ -2211,7 +2385,7 @@ function Aa(e) {
|
|
|
2211
2385
|
{
|
|
2212
2386
|
type: "text",
|
|
2213
2387
|
value: s,
|
|
2214
|
-
onChange: (
|
|
2388
|
+
onChange: (k) => i(k.target.value),
|
|
2215
2389
|
placeholder: "What this store holds"
|
|
2216
2390
|
}
|
|
2217
2391
|
)
|
|
@@ -2223,30 +2397,30 @@ function Aa(e) {
|
|
|
2223
2397
|
{
|
|
2224
2398
|
"data-testid": "data-store-kind",
|
|
2225
2399
|
value: o,
|
|
2226
|
-
onChange: (
|
|
2227
|
-
l(
|
|
2400
|
+
onChange: (k) => {
|
|
2401
|
+
l(k.target.value), b("");
|
|
2228
2402
|
},
|
|
2229
|
-
children:
|
|
2403
|
+
children: Gt.map((k) => /* @__PURE__ */ t("option", { value: k, children: Zt[k] }, k))
|
|
2230
2404
|
}
|
|
2231
2405
|
),
|
|
2232
2406
|
/* @__PURE__ */ t("span", { className: "hint", children: "The kind is fixed once the store exists." })
|
|
2233
2407
|
] }),
|
|
2234
|
-
|
|
2408
|
+
N.kind !== void 0 && /* @__PURE__ */ t("div", { className: "result error", children: N.kind }),
|
|
2235
2409
|
o === "kv" && /* @__PURE__ */ r("label", { className: "field", children: [
|
|
2236
2410
|
/* @__PURE__ */ t("span", { children: "Value type" }),
|
|
2237
|
-
/* @__PURE__ */ t("select", { value:
|
|
2411
|
+
/* @__PURE__ */ t("select", { value: d, onChange: (k) => u(k.target.value), children: Xt.map((k) => /* @__PURE__ */ t("option", { value: k, children: k }, k)) })
|
|
2238
2412
|
] }),
|
|
2239
2413
|
o === "table" && /* @__PURE__ */ t(
|
|
2240
|
-
|
|
2414
|
+
en,
|
|
2241
2415
|
{
|
|
2242
2416
|
columns: h,
|
|
2243
|
-
onChange:
|
|
2244
|
-
keyColumn:
|
|
2245
|
-
onKeyColumnChange:
|
|
2417
|
+
onChange: v,
|
|
2418
|
+
keyColumn: w,
|
|
2419
|
+
onKeyColumnChange: b,
|
|
2246
2420
|
columnErrors: g
|
|
2247
2421
|
}
|
|
2248
2422
|
),
|
|
2249
|
-
|
|
2423
|
+
N.schema !== void 0 && /* @__PURE__ */ t("div", { className: "result error", children: N.schema }),
|
|
2250
2424
|
y !== null && /* @__PURE__ */ t("div", { className: "result error", "data-testid": "data-store-form-error", children: y })
|
|
2251
2425
|
] }),
|
|
2252
2426
|
/* @__PURE__ */ r("div", { className: "modal-actions", children: [
|
|
@@ -2257,34 +2431,34 @@ function Aa(e) {
|
|
|
2257
2431
|
type: "button",
|
|
2258
2432
|
className: "btn",
|
|
2259
2433
|
"data-testid": "data-store-create",
|
|
2260
|
-
disabled:
|
|
2261
|
-
onClick:
|
|
2262
|
-
children:
|
|
2434
|
+
disabled: E.isPending,
|
|
2435
|
+
onClick: x,
|
|
2436
|
+
children: E.isPending ? "Creating…" : "Create"
|
|
2263
2437
|
}
|
|
2264
2438
|
)
|
|
2265
2439
|
] })
|
|
2266
2440
|
] });
|
|
2267
2441
|
}
|
|
2268
|
-
function
|
|
2269
|
-
const i =
|
|
2442
|
+
function Li({ project: e, onOpen: n, getHref: a, slots: s }) {
|
|
2443
|
+
const i = X(e), o = Wn(i ?? void 0), l = Bn(), [d, u] = f(!1), [h, v] = f(null), [w, b] = f(null), N = (s == null ? void 0 : s.header) === void 0 ? /* @__PURE__ */ r("div", { children: [
|
|
2270
2444
|
/* @__PURE__ */ t("h3", { children: "Data stores" }),
|
|
2271
2445
|
/* @__PURE__ */ t("p", { className: "muted small", children: "Key-value, document and table storage for this project." })
|
|
2272
2446
|
] }) : s.header;
|
|
2273
2447
|
return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
|
|
2274
2448
|
/* @__PURE__ */ t(
|
|
2275
|
-
|
|
2449
|
+
zt,
|
|
2276
2450
|
{
|
|
2277
2451
|
stores: o.data ?? [],
|
|
2278
2452
|
loading: o.isLoading,
|
|
2279
|
-
error:
|
|
2453
|
+
error: w ?? (o.error != null ? V(o.error).message : null),
|
|
2280
2454
|
onOpen: n,
|
|
2281
2455
|
getHref: a,
|
|
2282
|
-
onArchive: (
|
|
2283
|
-
|
|
2456
|
+
onArchive: ($) => {
|
|
2457
|
+
b(null), v($);
|
|
2284
2458
|
},
|
|
2285
2459
|
busy: l.isPending,
|
|
2286
2460
|
slots: {
|
|
2287
|
-
header:
|
|
2461
|
+
header: N,
|
|
2288
2462
|
actions: /* @__PURE__ */ t(
|
|
2289
2463
|
"button",
|
|
2290
2464
|
{
|
|
@@ -2292,7 +2466,7 @@ function yi({ project: e, onOpen: n, getHref: a, slots: s }) {
|
|
|
2292
2466
|
className: "btn",
|
|
2293
2467
|
"data-testid": "data-store-new",
|
|
2294
2468
|
disabled: i == null,
|
|
2295
|
-
onClick: () =>
|
|
2469
|
+
onClick: () => u(!0),
|
|
2296
2470
|
children: "+ New data store"
|
|
2297
2471
|
}
|
|
2298
2472
|
),
|
|
@@ -2300,43 +2474,44 @@ function yi({ project: e, onOpen: n, getHref: a, slots: s }) {
|
|
|
2300
2474
|
}
|
|
2301
2475
|
}
|
|
2302
2476
|
),
|
|
2303
|
-
|
|
2477
|
+
d && i != null && /* @__PURE__ */ t(qa, { project: i, onClose: () => u(!1) }),
|
|
2304
2478
|
h && /* @__PURE__ */ t(
|
|
2305
|
-
|
|
2479
|
+
pe,
|
|
2306
2480
|
{
|
|
2307
2481
|
title: "Archive data store",
|
|
2308
2482
|
message: `Archive "${h.name}" and its ${h.entryCount} ${h.entryCount === 1 ? "entry" : "entries"}? Workflows and the API can no longer reach it.`,
|
|
2309
2483
|
confirmLabel: "Archive",
|
|
2310
2484
|
onConfirm: () => {
|
|
2311
|
-
const
|
|
2312
|
-
|
|
2313
|
-
{ id:
|
|
2314
|
-
{ onError: (g) =>
|
|
2485
|
+
const $ = h;
|
|
2486
|
+
v(null), i != null && l.mutate(
|
|
2487
|
+
{ id: $.id, project: i },
|
|
2488
|
+
{ onError: (g) => b(V(g).message) }
|
|
2315
2489
|
);
|
|
2316
2490
|
},
|
|
2317
|
-
onClose: () =>
|
|
2491
|
+
onClose: () => v(null)
|
|
2318
2492
|
}
|
|
2319
2493
|
)
|
|
2320
2494
|
] });
|
|
2321
2495
|
}
|
|
2322
2496
|
export {
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2497
|
+
gi as ActivitySummary,
|
|
2498
|
+
bi as ConnectionDetail,
|
|
2499
|
+
Ni as ConnectionList,
|
|
2500
|
+
$i as CredentialCreate,
|
|
2501
|
+
Di as CredentialDetail,
|
|
2502
|
+
Ti as CredentialList,
|
|
2503
|
+
Li as DataStoreList,
|
|
2504
|
+
xi as DataStoreView,
|
|
2505
|
+
fi as DocumentList,
|
|
2506
|
+
hi as EndpointList,
|
|
2507
|
+
mi as FunctionList,
|
|
2508
|
+
ia as Logs,
|
|
2509
|
+
yi as LogsView,
|
|
2510
|
+
ki as ModelCatalog,
|
|
2511
|
+
Ci as ModelUsage,
|
|
2512
|
+
pi as ReliabilityBoard,
|
|
2513
|
+
aa as RunHistory,
|
|
2514
|
+
vi as ServiceDetail,
|
|
2515
|
+
wi as WorkflowList
|
|
2341
2516
|
};
|
|
2342
2517
|
//# sourceMappingURL=lists.mjs.map
|