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