@w6w/embed 0.2.24 → 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-Cpzp8ndt.js → ImportSpecModal-xwTzj4KB.js} +22 -21
- package/dist/{ImportSpecModal-Cpzp8ndt.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-LesBKjb2.js → WorkflowEditor-CvWkVmFn.js} +6 -6
- package/dist/{WorkflowEditor-LesBKjb2.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/{apps-CYUgEfGf.js → apps-FMcQfyL2.js} +2 -2
- package/dist/{apps-CYUgEfGf.js.map → apps-FMcQfyL2.js.map} +1 -1
- package/dist/chrome/ImportSpecModal.d.ts +2 -0
- package/dist/credentials-4Nf2GfMc.js +212 -0
- package/dist/credentials-4Nf2GfMc.js.map +1 -0
- package/dist/editor-apps-HEOclsxL.js +152 -0
- package/dist/{editor-apps-LZmDWMqf.js.map → editor-apps-HEOclsxL.js.map} +1 -1
- package/dist/{editor-tools-DHyWiG21.js → editor-tools-CVYTsVFN.js} +326 -326
- package/dist/editor-tools-CVYTsVFN.js.map +1 -0
- package/dist/editor.mjs +1 -1
- package/dist/editors.mjs +11 -11
- 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 +14 -14
- package/dist/lib/callable-descriptors.d.ts +1 -1
- package/dist/lib/document-upload.d.ts +8 -0
- package/dist/lists/ConnectionList.d.ts +3 -1
- package/dist/lists/CredentialCreate.d.ts +25 -0
- package/dist/lists/CredentialDetail.d.ts +5 -1
- package/dist/lists/CredentialList.d.ts +3 -1
- package/dist/lists/MyAiKeys.d.ts +5 -0
- package/dist/lists/TagChips.d.ts +4 -0
- package/dist/lists.d.ts +4 -0
- package/dist/lists.mjs +1703 -1107
- 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 +28 -14
- package/dist/repos/index.d.ts +1 -0
- package/dist/repos/models.d.ts +53 -4
- package/dist/repos.mjs +223 -204
- package/dist/repos.mjs.map +1 -1
- package/dist/{spec-export-DGigBUsP.js → spec-export-DMMET5VM.js} +2 -2
- package/dist/{spec-export-DGigBUsP.js.map → spec-export-DMMET5VM.js.map} +1 -1
- package/dist/{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/dist/{workflows-BK6IM4if.js → workflows-Dz8LMjnt.js} +37 -34
- package/dist/workflows-Dz8LMjnt.js.map +1 -0
- 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-Cn92LGhJ.js +0 -171
- package/dist/credentials-Cn92LGhJ.js.map +0 -1
- package/dist/editor-apps-LZmDWMqf.js +0 -152
- package/dist/editor-tools-DHyWiG21.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/workflows-BK6IM4if.js.map +0 -1
package/dist/lists.mjs
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as f, useMemo as
|
|
4
|
-
import { F as
|
|
5
|
-
import { d as
|
|
6
|
-
import { u as
|
|
7
|
-
import { CallableList as
|
|
8
|
-
import { I as
|
|
9
|
-
import { i as
|
|
10
|
-
import { a3 as
|
|
11
|
-
import { 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 {
|
|
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
|
-
rows:
|
|
37
|
+
rows: o,
|
|
37
38
|
title: a.listTitle,
|
|
38
39
|
description: a.listDescription,
|
|
39
40
|
emptyCopy: a.emptyCopy,
|
|
@@ -48,213 +49,226 @@ function Te(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: (
|
|
64
|
-
var
|
|
65
|
-
return (
|
|
63
|
+
listKeys: { functionsKey: Pt, endpointsKey: Rt, workflowsKey: gn },
|
|
64
|
+
onOpenImported: (r, c) => {
|
|
65
|
+
var u;
|
|
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: (
|
|
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:
|
|
96
|
-
takenKeys: (n.data ?? []).map((
|
|
97
|
-
onClose: () =>
|
|
98
|
-
onCreated: (
|
|
99
|
-
var
|
|
100
|
-
|
|
105
|
+
newId: i,
|
|
106
|
+
takenKeys: (n.data ?? []).map((o) => o.key),
|
|
107
|
+
onClose: () => s(null),
|
|
108
|
+
onCreated: (o) => {
|
|
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: (
|
|
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:
|
|
142
|
-
takenKeys: (n.data ?? []).map((
|
|
143
|
-
onClose: () =>
|
|
144
|
-
onCreated: (
|
|
145
|
-
var
|
|
146
|
-
|
|
155
|
+
newId: i,
|
|
156
|
+
takenKeys: (n.data ?? []).map((o) => o.key),
|
|
157
|
+
onClose: () => s(null),
|
|
158
|
+
onCreated: (o) => {
|
|
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 =
|
|
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
|
-
|
|
180
|
-
const
|
|
181
|
-
|
|
193
|
+
o(null);
|
|
194
|
+
const r = Nn((a.data ?? []).map((c) => c.displayName || c.name));
|
|
195
|
+
i.mutate(kn(Se("workflow"), r), {
|
|
182
196
|
onSuccess: (c) => {
|
|
183
|
-
var
|
|
184
|
-
return (
|
|
197
|
+
var u;
|
|
198
|
+
return (u = e.onCreated) == null ? void 0 : u.call(e, c.workflow.id);
|
|
185
199
|
},
|
|
186
|
-
onError: (c) =>
|
|
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:
|
|
200
|
-
getHref:
|
|
201
|
-
onOpen:
|
|
212
|
+
days: i = 30,
|
|
213
|
+
showChart: s,
|
|
214
|
+
getHref: o,
|
|
215
|
+
onOpen: r,
|
|
202
216
|
showAllHref: c,
|
|
203
|
-
onShowAll:
|
|
217
|
+
onShowAll: u,
|
|
204
218
|
slots: h
|
|
205
219
|
}) {
|
|
206
|
-
var
|
|
207
|
-
const
|
|
208
|
-
let
|
|
209
|
-
return k ?
|
|
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: k ? ((
|
|
213
|
-
window: k ? (
|
|
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
|
-
getHref:
|
|
219
|
-
onOpen:
|
|
232
|
+
getHref: o,
|
|
233
|
+
onOpen: r,
|
|
220
234
|
showAllHref: c,
|
|
221
|
-
onShowAll:
|
|
222
|
-
slots: { ...h, empty:
|
|
235
|
+
onShowAll: u,
|
|
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
|
|
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,95 +282,96 @@ function oi({ 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: () =>
|
|
308
|
+
onClick: () => m(p),
|
|
294
309
|
disabled: c.isPending,
|
|
295
|
-
"data-testid": `document-delete-${
|
|
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__ */
|
|
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: [
|
|
309
324
|
k,
|
|
310
325
|
/* @__PURE__ */ t(
|
|
311
326
|
"button",
|
|
312
327
|
{
|
|
313
328
|
type: "button",
|
|
314
329
|
className: "btn",
|
|
315
|
-
disabled:
|
|
330
|
+
disabled: o == null,
|
|
316
331
|
onClick: () => h({ mode: "create" }),
|
|
317
332
|
children: "+ Add document"
|
|
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
|
-
|
|
337
|
-
|
|
351
|
+
u && /* @__PURE__ */ t(
|
|
352
|
+
An,
|
|
338
353
|
{
|
|
339
|
-
initial:
|
|
340
|
-
project:
|
|
354
|
+
initial: u.mode === "edit" ? u.d : void 0,
|
|
355
|
+
project: o,
|
|
341
356
|
onClose: () => h(null),
|
|
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
|
-
|
|
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 Fn = {
|
|
|
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 tt = {
|
|
|
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
|
|
392
|
-
|
|
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
|
|
397
|
-
|
|
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: c ? { kind: "workflow", id:
|
|
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 (
|
|
472
|
-
const
|
|
473
|
-
return a ? /* @__PURE__ */ t("a", { href: a(
|
|
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
|
-
[
|
|
505
|
-
),
|
|
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:
|
|
561
|
+
entry: E,
|
|
547
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
|
-
|
|
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:
|
|
582
|
+
scope: s,
|
|
583
|
+
showKind: e.showKind ?? ya(s),
|
|
584
|
+
filters: r,
|
|
570
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 Xn(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 Le(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 aa({
|
|
|
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 aa({
|
|
|
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
713
|
c.state
|
|
699
|
-
] },
|
|
700
|
-
|
|
701
|
-
/* @__PURE__ */ t("strong", { children:
|
|
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:
|
|
749
|
-
vendorEmptyLabel:
|
|
762
|
+
days: Ta(e),
|
|
763
|
+
incidents: s,
|
|
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:
|
|
766
|
-
|
|
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: [
|
|
781
|
+
u,
|
|
767
782
|
" ×",
|
|
768
|
-
|
|
783
|
+
r.errors[c]
|
|
769
784
|
] }, c)) })
|
|
770
|
-
] },
|
|
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:
|
|
826
|
-
slots:
|
|
839
|
+
backHref: i,
|
|
840
|
+
onBack: s,
|
|
841
|
+
slots: o
|
|
827
842
|
}) {
|
|
828
|
-
var k,
|
|
829
|
-
const
|
|
830
|
-
return /* @__PURE__ */
|
|
831
|
-
|
|
832
|
-
|
|
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: [
|
|
846
|
+
o == null ? void 0 : o.header,
|
|
847
|
+
o == null ? void 0 : o.actions,
|
|
833
848
|
!c && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see this service." }),
|
|
834
|
-
|
|
835
|
-
c &&
|
|
836
|
-
|
|
837
|
-
(
|
|
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 ui({
|
|
|
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 ca(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((
|
|
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
|
-
/* @__PURE__ */ t("span", { children:
|
|
951
|
+
/* @__PURE__ */ t("span", { children: o.name }),
|
|
937
952
|
" ",
|
|
938
|
-
|
|
953
|
+
o.status === "broken" && /* @__PURE__ */ l(Q, { children: [
|
|
939
954
|
/* @__PURE__ */ t("span", { className: "tag warn", children: "broken" }),
|
|
940
955
|
" ",
|
|
941
956
|
/* @__PURE__ */ t(
|
|
@@ -943,47 +958,47 @@ function da({
|
|
|
943
958
|
{
|
|
944
959
|
type: "button",
|
|
945
960
|
className: "btn link",
|
|
946
|
-
"data-testid": `connection-route-reconnect-${
|
|
947
|
-
onClick: () =>
|
|
961
|
+
"data-testid": `connection-route-reconnect-${o.id}`,
|
|
962
|
+
onClick: () => i(o.id),
|
|
948
963
|
children: "Reconnect"
|
|
949
964
|
}
|
|
950
965
|
)
|
|
951
966
|
] })
|
|
952
|
-
] },
|
|
953
|
-
|
|
954
|
-
|
|
967
|
+
] }, o.id)) }),
|
|
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,116 +1007,118 @@ function ma({
|
|
|
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,
|
|
1028
|
+
onCreateSharedCredential: o
|
|
1013
1029
|
}) {
|
|
1014
|
-
var
|
|
1015
|
-
const
|
|
1016
|
-
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: [
|
|
1017
1033
|
/* @__PURE__ */ t(
|
|
1018
|
-
|
|
1034
|
+
qt,
|
|
1019
1035
|
{
|
|
1020
|
-
connections:
|
|
1021
|
-
appsById:
|
|
1022
|
-
loading:
|
|
1023
|
-
error:
|
|
1036
|
+
connections: g,
|
|
1037
|
+
appsById: k,
|
|
1038
|
+
loading: u.isLoading,
|
|
1039
|
+
error: u.error ? u.error.message : null,
|
|
1024
1040
|
onOpen: e,
|
|
1025
1041
|
getHref: n,
|
|
1026
|
-
onEdit:
|
|
1027
|
-
onDelete:
|
|
1028
|
-
busy:
|
|
1029
|
-
slots: { ...
|
|
1042
|
+
onEdit: j ? C : void 0,
|
|
1043
|
+
onDelete: b,
|
|
1044
|
+
busy: w.isPending,
|
|
1045
|
+
slots: { ...i, actions: O }
|
|
1030
1046
|
}
|
|
1031
1047
|
),
|
|
1032
|
-
|
|
1033
|
-
|
|
1048
|
+
v && /* @__PURE__ */ t(
|
|
1049
|
+
Vt,
|
|
1034
1050
|
{
|
|
1035
|
-
|
|
1051
|
+
onCreateSharedCredential: o,
|
|
1052
|
+
onClose: () => y(!1),
|
|
1036
1053
|
onCreated: () => {
|
|
1037
|
-
|
|
1054
|
+
y(!1), c.invalidateQueries({ queryKey: ge });
|
|
1038
1055
|
}
|
|
1039
1056
|
}
|
|
1040
1057
|
),
|
|
1041
|
-
|
|
1042
|
-
|
|
1058
|
+
p && /* @__PURE__ */ t(
|
|
1059
|
+
Ze,
|
|
1043
1060
|
{
|
|
1044
|
-
connection:
|
|
1045
|
-
onClose: () =>
|
|
1061
|
+
connection: p,
|
|
1062
|
+
onClose: () => C(null),
|
|
1046
1063
|
onSaved: () => {
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1064
|
+
const D = p.id;
|
|
1065
|
+
C(null), c.invalidateQueries({ queryKey: ge }), c.invalidateQueries({ queryKey: ot(D) });
|
|
1049
1066
|
}
|
|
1050
1067
|
}
|
|
1051
1068
|
),
|
|
1052
|
-
|
|
1053
|
-
|
|
1069
|
+
I && /* @__PURE__ */ t(
|
|
1070
|
+
Oa,
|
|
1054
1071
|
{
|
|
1055
|
-
name:
|
|
1056
|
-
loading:
|
|
1057
|
-
callables:
|
|
1058
|
-
routes:
|
|
1059
|
-
projectId:
|
|
1060
|
-
onOpenCallable:
|
|
1061
|
-
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),
|
|
1062
1079
|
onConfirm: () => {
|
|
1063
|
-
const
|
|
1064
|
-
|
|
1080
|
+
const D = I.id;
|
|
1081
|
+
b(null), w.mutate({ id: D, force: !0 });
|
|
1065
1082
|
}
|
|
1066
1083
|
}
|
|
1067
1084
|
)
|
|
1068
1085
|
] });
|
|
1069
1086
|
}
|
|
1070
|
-
function
|
|
1087
|
+
function Oa({
|
|
1071
1088
|
name: e,
|
|
1072
1089
|
loading: n,
|
|
1073
1090
|
callables: a,
|
|
1074
|
-
routes:
|
|
1075
|
-
projectId:
|
|
1076
|
-
onOpenCallable:
|
|
1077
|
-
onClose:
|
|
1091
|
+
routes: i,
|
|
1092
|
+
projectId: s,
|
|
1093
|
+
onOpenCallable: o,
|
|
1094
|
+
onClose: r,
|
|
1078
1095
|
onConfirm: c
|
|
1079
1096
|
}) {
|
|
1080
|
-
const
|
|
1081
|
-
|
|
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,
|
|
1082
1099
|
h > 0 ? k(h, "model route", "model routes") : null
|
|
1083
|
-
].filter(Boolean).join(" and "),
|
|
1084
|
-
|
|
1100
|
+
].filter(Boolean).join(" and "), v = [
|
|
1101
|
+
u > 0 ? `Deleting disables ${u === 1 ? "this callable" : `these ${u} callables`} until you reconnect ${u === 1 ? "it" : "them"}.` : null,
|
|
1085
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
|
|
1086
|
-
].filter((
|
|
1087
|
-
return /* @__PURE__ */
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children:
|
|
1090
|
-
|
|
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: [
|
|
1091
1108
|
/* @__PURE__ */ t(
|
|
1092
|
-
|
|
1109
|
+
Lt,
|
|
1093
1110
|
{
|
|
1094
1111
|
callables: a,
|
|
1095
|
-
routes:
|
|
1096
|
-
projectId:
|
|
1097
|
-
onOpenCallable:
|
|
1112
|
+
routes: i,
|
|
1113
|
+
projectId: s,
|
|
1114
|
+
onOpenCallable: o
|
|
1098
1115
|
}
|
|
1099
1116
|
),
|
|
1100
|
-
/* @__PURE__ */ t("p", { className: "w6w-small", children:
|
|
1117
|
+
/* @__PURE__ */ t("p", { className: "w6w-small", children: v.join(" ") })
|
|
1101
1118
|
] })
|
|
1102
1119
|
] }),
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
/* @__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" }),
|
|
1105
1122
|
/* @__PURE__ */ t(
|
|
1106
1123
|
"button",
|
|
1107
1124
|
{
|
|
@@ -1115,294 +1132,294 @@ function wa({
|
|
|
1115
1132
|
] })
|
|
1116
1133
|
] });
|
|
1117
1134
|
}
|
|
1118
|
-
function
|
|
1135
|
+
function Le(e) {
|
|
1119
1136
|
const n = new Date(e).getTime();
|
|
1120
1137
|
if (Number.isNaN(n)) return "recently";
|
|
1121
1138
|
const a = Math.max(0, Math.round((Date.now() - n) / 1e3));
|
|
1122
1139
|
if (a < 45) return "just now";
|
|
1123
|
-
const
|
|
1124
|
-
if (
|
|
1125
|
-
const
|
|
1126
|
-
if (
|
|
1127
|
-
const
|
|
1128
|
-
return
|
|
1129
|
-
}
|
|
1130
|
-
const
|
|
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);
|
|
1145
|
+
return o < 30 ? `${o}d ago` : new Date(e).toLocaleDateString();
|
|
1146
|
+
}
|
|
1147
|
+
const Ka = {
|
|
1131
1148
|
ok: 6e3,
|
|
1132
1149
|
warn: 1e4,
|
|
1133
1150
|
error: 15e3
|
|
1134
|
-
},
|
|
1135
|
-
function
|
|
1151
|
+
}, ja = { ok: "✓", warn: "!", error: "✕" };
|
|
1152
|
+
function Ys({
|
|
1136
1153
|
connectionId: e,
|
|
1137
1154
|
onOpenAction: n,
|
|
1138
1155
|
onBack: a,
|
|
1139
|
-
onOpenCallable:
|
|
1140
|
-
slots:
|
|
1156
|
+
onOpenCallable: i,
|
|
1157
|
+
slots: s
|
|
1141
1158
|
}) {
|
|
1142
|
-
var
|
|
1143
|
-
const
|
|
1144
|
-
() =>
|
|
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] : []),
|
|
1145
1162
|
[c.data]
|
|
1146
|
-
), { byId:
|
|
1147
|
-
const
|
|
1148
|
-
for (const
|
|
1149
|
-
const
|
|
1150
|
-
|
|
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);
|
|
1151
1168
|
}
|
|
1152
|
-
return
|
|
1153
|
-
}, [
|
|
1154
|
-
|
|
1155
|
-
if (!
|
|
1156
|
-
const
|
|
1157
|
-
return () => clearTimeout(
|
|
1158
|
-
}, [
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1161
|
-
onSuccess: (
|
|
1162
|
-
var
|
|
1163
|
-
if (!
|
|
1164
|
-
|
|
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({
|
|
1165
1182
|
kind: "error",
|
|
1166
|
-
text: `Connection test failed${(
|
|
1183
|
+
text: `Connection test failed${(M = N.error) != null && M.message ? `: ${N.error.message}` : "."}`
|
|
1167
1184
|
});
|
|
1168
1185
|
return;
|
|
1169
1186
|
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1187
|
+
D(
|
|
1188
|
+
N.untested ? { kind: "warn", text: `Connection stored. ${N.message ?? ""}`.trim() } : {
|
|
1172
1189
|
kind: "ok",
|
|
1173
|
-
text: `Connection is valid${
|
|
1190
|
+
text: `Connection is valid${N.actionKey ? ` — probed ${N.actionKey}` : ""}.`
|
|
1174
1191
|
}
|
|
1175
1192
|
);
|
|
1176
1193
|
},
|
|
1177
|
-
onError: (
|
|
1194
|
+
onError: (N) => D({ kind: "error", text: (N == null ? void 0 : N.message) ?? "Test failed." })
|
|
1178
1195
|
});
|
|
1179
|
-
},
|
|
1180
|
-
var
|
|
1181
|
-
const
|
|
1182
|
-
return
|
|
1183
|
-
}, [k.data]),
|
|
1184
|
-
const
|
|
1185
|
-
return
|
|
1186
|
-
(
|
|
1187
|
-
) :
|
|
1188
|
-
}, [
|
|
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]);
|
|
1189
1206
|
if (c.isLoading || k.isLoading)
|
|
1190
1207
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root w6w-embed-conn-detail", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) });
|
|
1191
1208
|
if (!c.data)
|
|
1192
|
-
return /* @__PURE__ */
|
|
1193
|
-
(
|
|
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" }),
|
|
1194
1211
|
a && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "Back to integrations" })
|
|
1195
1212
|
] });
|
|
1196
|
-
const
|
|
1197
|
-
return /* @__PURE__ */
|
|
1198
|
-
(
|
|
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: [
|
|
1199
1216
|
/* @__PURE__ */ t(
|
|
1200
1217
|
"button",
|
|
1201
1218
|
{
|
|
1202
1219
|
type: "button",
|
|
1203
1220
|
className: "w6w-btn w6w-btn-ghost",
|
|
1204
|
-
disabled:
|
|
1205
|
-
onClick:
|
|
1206
|
-
children:
|
|
1221
|
+
disabled: R.isPending,
|
|
1222
|
+
onClick: S,
|
|
1223
|
+
children: R.isPending ? "Testing…" : "Test connection"
|
|
1207
1224
|
}
|
|
1208
1225
|
),
|
|
1209
|
-
|
|
1210
|
-
|
|
1226
|
+
H && /* @__PURE__ */ t(
|
|
1227
|
+
ze,
|
|
1211
1228
|
{
|
|
1212
1229
|
label: "Edit",
|
|
1213
1230
|
onClick: () => T(!0),
|
|
1214
1231
|
"data-testid": "connection-detail-edit"
|
|
1215
1232
|
}
|
|
1216
1233
|
),
|
|
1217
|
-
|
|
1234
|
+
s == null ? void 0 : s.actions
|
|
1218
1235
|
] }),
|
|
1219
|
-
|
|
1236
|
+
x && /* @__PURE__ */ l(
|
|
1220
1237
|
"div",
|
|
1221
1238
|
{
|
|
1222
|
-
className: `w6w-result w6w-embed-conn-notice w6w-embed-conn-notice-${
|
|
1223
|
-
role:
|
|
1224
|
-
"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",
|
|
1225
1242
|
"data-testid": "connection-test-notice",
|
|
1226
1243
|
children: [
|
|
1227
|
-
/* @__PURE__ */ t("span", { "aria-hidden": "true", children:
|
|
1228
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-notice-text", children:
|
|
1229
|
-
/* @__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) })
|
|
1230
1247
|
]
|
|
1231
1248
|
}
|
|
1232
1249
|
),
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1250
|
+
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1251
|
+
/* @__PURE__ */ l("h3", { children: [
|
|
1235
1252
|
"App: ",
|
|
1236
|
-
(
|
|
1253
|
+
(m == null ? void 0 : m.displayName) ?? _.appId
|
|
1237
1254
|
] }),
|
|
1238
|
-
|
|
1255
|
+
K && /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small", children: [
|
|
1239
1256
|
"Version ",
|
|
1240
|
-
/* @__PURE__ */
|
|
1257
|
+
/* @__PURE__ */ l("code", { children: [
|
|
1241
1258
|
"v",
|
|
1242
|
-
|
|
1259
|
+
K.version ?? "?"
|
|
1243
1260
|
] }),
|
|
1244
1261
|
" · source ",
|
|
1245
|
-
/* @__PURE__ */ t("code", { children:
|
|
1262
|
+
/* @__PURE__ */ t("code", { children: K.sourceRef })
|
|
1246
1263
|
] }),
|
|
1247
1264
|
a && /* @__PURE__ */ t("p", { className: "w6w-small", children: /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "← Integrations" }) })
|
|
1248
1265
|
] }),
|
|
1249
|
-
/* @__PURE__ */
|
|
1266
|
+
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1250
1267
|
/* @__PURE__ */ t("h3", { children: "Actions" }),
|
|
1251
|
-
|
|
1252
|
-
|
|
1268
|
+
$.length === 0 && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No actions exposed." }),
|
|
1269
|
+
$.length > 10 && /* @__PURE__ */ t(
|
|
1253
1270
|
"input",
|
|
1254
1271
|
{
|
|
1255
1272
|
type: "search",
|
|
1256
1273
|
value: j,
|
|
1257
|
-
placeholder: `Search ${
|
|
1258
|
-
onChange: (
|
|
1274
|
+
placeholder: `Search ${$.length} actions…`,
|
|
1275
|
+
onChange: (N) => O(N.target.value),
|
|
1259
1276
|
"aria-label": "Filter actions",
|
|
1260
1277
|
className: "w6w-embed-conn-filter"
|
|
1261
1278
|
}
|
|
1262
1279
|
),
|
|
1263
|
-
|
|
1280
|
+
$.length > 0 && V.length === 0 && /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small", children: [
|
|
1264
1281
|
"No actions match “",
|
|
1265
1282
|
j,
|
|
1266
1283
|
"”."
|
|
1267
1284
|
] }),
|
|
1268
|
-
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Actions", children:
|
|
1269
|
-
const
|
|
1270
|
-
return /* @__PURE__ */
|
|
1271
|
-
/* @__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(
|
|
1272
1289
|
"button",
|
|
1273
1290
|
{
|
|
1274
1291
|
type: "button",
|
|
1275
1292
|
className: "w6w-embed-conn-action",
|
|
1276
|
-
"data-testid": `connection-action-${
|
|
1277
|
-
onClick: () => n(
|
|
1293
|
+
"data-testid": `connection-action-${N.key}`,
|
|
1294
|
+
onClick: () => n(N.key),
|
|
1278
1295
|
children: [
|
|
1279
|
-
/* @__PURE__ */ t("strong", { children:
|
|
1296
|
+
/* @__PURE__ */ t("strong", { children: N.title }),
|
|
1280
1297
|
" ",
|
|
1281
|
-
/* @__PURE__ */ t("code", { className: "w6w-muted", children:
|
|
1298
|
+
/* @__PURE__ */ t("code", { className: "w6w-muted", children: N.key }),
|
|
1282
1299
|
" ",
|
|
1283
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children:
|
|
1284
|
-
|
|
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 })
|
|
1285
1302
|
]
|
|
1286
1303
|
}
|
|
1287
1304
|
),
|
|
1288
|
-
|
|
1305
|
+
M.length > 0 && /* @__PURE__ */ t(
|
|
1289
1306
|
"ul",
|
|
1290
1307
|
{
|
|
1291
1308
|
className: "w6w-embed-conn-list w6w-embed-conn-tests",
|
|
1292
|
-
"aria-label": `Saved tests for ${
|
|
1293
|
-
children:
|
|
1294
|
-
|
|
1309
|
+
"aria-label": `Saved tests for ${N.title || N.key}`,
|
|
1310
|
+
children: M.map((P) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
1311
|
+
Ae,
|
|
1295
1312
|
{
|
|
1296
|
-
title:
|
|
1297
|
-
subtitle:
|
|
1313
|
+
title: P.name,
|
|
1314
|
+
subtitle: P.lastRunAt ? /* @__PURE__ */ l("span", { children: [
|
|
1298
1315
|
/* @__PURE__ */ t(
|
|
1299
1316
|
"span",
|
|
1300
1317
|
{
|
|
1301
|
-
className:
|
|
1302
|
-
children:
|
|
1318
|
+
className: P.lastRunOk ? "w6w-embed-conn-ok" : "w6w-embed-conn-fail",
|
|
1319
|
+
children: P.lastRunOk ? "✓" : "✗"
|
|
1303
1320
|
}
|
|
1304
1321
|
),
|
|
1305
1322
|
" ",
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
] }) : `saved ${
|
|
1309
|
-
onClick: () => n(
|
|
1323
|
+
P.lastRunSummary ? `${P.lastRunSummary} · ` : "",
|
|
1324
|
+
Le(P.lastRunAt)
|
|
1325
|
+
] }) : `saved ${Le(P.updatedAt)}`,
|
|
1326
|
+
onClick: () => n(N.key, P.id)
|
|
1310
1327
|
}
|
|
1311
|
-
) },
|
|
1328
|
+
) }, P.id))
|
|
1312
1329
|
}
|
|
1313
1330
|
)
|
|
1314
|
-
] },
|
|
1331
|
+
] }, N.key);
|
|
1315
1332
|
}) })
|
|
1316
1333
|
] }),
|
|
1317
|
-
|
|
1334
|
+
y && /* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", "data-testid": "connection-used-by", children: [
|
|
1318
1335
|
/* @__PURE__ */ t("h3", { children: "Used by" }),
|
|
1319
|
-
|
|
1320
|
-
|
|
1336
|
+
C.length === 0 && I.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Not used by any callable" }) : /* @__PURE__ */ t(
|
|
1337
|
+
Lt,
|
|
1321
1338
|
{
|
|
1322
|
-
callables:
|
|
1323
|
-
routes:
|
|
1324
|
-
projectId:
|
|
1325
|
-
onOpenCallable:
|
|
1339
|
+
callables: C,
|
|
1340
|
+
routes: I,
|
|
1341
|
+
projectId: p,
|
|
1342
|
+
onOpenCallable: i
|
|
1326
1343
|
}
|
|
1327
1344
|
)
|
|
1328
1345
|
] }),
|
|
1329
|
-
|
|
1346
|
+
b.length > 0 && /* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1330
1347
|
/* @__PURE__ */ t("h3", { children: "Recent runs" }),
|
|
1331
1348
|
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Most recent tester runs against this connection." }),
|
|
1332
|
-
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Recent runs", children:
|
|
1333
|
-
|
|
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,
|
|
1334
1351
|
{
|
|
1335
|
-
title:
|
|
1336
|
-
subtitle: /* @__PURE__ */
|
|
1337
|
-
/* @__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 ? "✓" : "✗" }),
|
|
1338
1355
|
" ",
|
|
1339
|
-
|
|
1340
|
-
|
|
1356
|
+
N.summary ? `${N.summary} · ` : "",
|
|
1357
|
+
Le(N.occurredAt)
|
|
1341
1358
|
] })
|
|
1342
1359
|
}
|
|
1343
|
-
) },
|
|
1360
|
+
) }, N.id)) })
|
|
1344
1361
|
] }),
|
|
1345
|
-
|
|
1346
|
-
|
|
1362
|
+
E && /* @__PURE__ */ t(
|
|
1363
|
+
Ze,
|
|
1347
1364
|
{
|
|
1348
|
-
connection:
|
|
1365
|
+
connection: _,
|
|
1349
1366
|
onClose: () => T(!1),
|
|
1350
1367
|
onSaved: () => {
|
|
1351
|
-
T(!1),
|
|
1368
|
+
T(!1), r.invalidateQueries({ queryKey: ot(e) }), r.invalidateQueries({ queryKey: ge });
|
|
1352
1369
|
}
|
|
1353
1370
|
}
|
|
1354
1371
|
)
|
|
1355
1372
|
] });
|
|
1356
1373
|
}
|
|
1357
|
-
const
|
|
1358
|
-
function
|
|
1374
|
+
const Fa = {};
|
|
1375
|
+
function Ve(e) {
|
|
1359
1376
|
return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1360
1377
|
}
|
|
1361
|
-
function
|
|
1378
|
+
function ue(e) {
|
|
1362
1379
|
return (e / 100).toFixed(2);
|
|
1363
1380
|
}
|
|
1364
|
-
function
|
|
1381
|
+
function Qa(e) {
|
|
1365
1382
|
if (e == null) return null;
|
|
1366
1383
|
const n = e.rates, a = [];
|
|
1367
|
-
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(" · ")}`;
|
|
1368
1385
|
}
|
|
1369
|
-
function
|
|
1386
|
+
function _a(e) {
|
|
1370
1387
|
const { maxInputTokens: n, maxOutputTokens: a } = e.limits ?? {};
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
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
|
+
] });
|
|
1374
1398
|
}
|
|
1375
|
-
const
|
|
1399
|
+
const qa = [
|
|
1376
1400
|
{
|
|
1377
1401
|
key: "model",
|
|
1378
1402
|
header: "Model",
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
/* @__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: [
|
|
1382
1410
|
e.provider,
|
|
1383
1411
|
" · ",
|
|
1384
|
-
e.nativeId
|
|
1385
|
-
" · ",
|
|
1386
|
-
e.source
|
|
1412
|
+
e.nativeId
|
|
1387
1413
|
] })
|
|
1388
1414
|
] })
|
|
1389
1415
|
},
|
|
1390
|
-
{
|
|
1391
|
-
key: "provider",
|
|
1392
|
-
header: "Provider",
|
|
1393
|
-
render: (e) => /* @__PURE__ */ t("span", { className: "muted small", children: e.provider || "—" })
|
|
1394
|
-
},
|
|
1395
|
-
{
|
|
1396
|
-
key: "status",
|
|
1397
|
-
header: "Status",
|
|
1398
|
-
render: (e) => /* @__PURE__ */ t("span", { className: e.status === "active" ? "tag" : "tag warn", children: e.status })
|
|
1399
|
-
},
|
|
1400
1416
|
{
|
|
1401
1417
|
key: "rate",
|
|
1402
|
-
header: "
|
|
1418
|
+
header: "Price / 1M tokens",
|
|
1419
|
+
width: "28%",
|
|
1403
1420
|
render: (e) => {
|
|
1404
|
-
const n =
|
|
1405
|
-
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(
|
|
1406
1423
|
"span",
|
|
1407
1424
|
{
|
|
1408
1425
|
className: "muted small",
|
|
@@ -1414,78 +1431,80 @@ const Na = [
|
|
|
1414
1431
|
},
|
|
1415
1432
|
{
|
|
1416
1433
|
key: "limits",
|
|
1417
|
-
header: "
|
|
1418
|
-
|
|
1434
|
+
header: "Token limits",
|
|
1435
|
+
width: "24%",
|
|
1436
|
+
render: (e) => /* @__PURE__ */ t("div", { className: "muted small", children: _a(e) })
|
|
1419
1437
|
}
|
|
1420
1438
|
];
|
|
1421
|
-
function
|
|
1422
|
-
var
|
|
1423
|
-
const n =
|
|
1424
|
-
queryKey:
|
|
1439
|
+
function zs(e) {
|
|
1440
|
+
var o;
|
|
1441
|
+
const n = he(), a = e.filter ?? Fa, i = st({
|
|
1442
|
+
queryKey: Qn(a),
|
|
1425
1443
|
initialPageParam: void 0,
|
|
1426
|
-
getNextPageParam: (
|
|
1427
|
-
queryFn: ({ pageParam:
|
|
1428
|
-
}),
|
|
1429
|
-
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */
|
|
1430
|
-
/* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */
|
|
1431
|
-
/* @__PURE__ */ t("h3", { children: "
|
|
1432
|
-
/* @__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." })
|
|
1433
1451
|
] }) }),
|
|
1434
|
-
/* @__PURE__ */
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
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,
|
|
1440
1458
|
{
|
|
1441
|
-
columns:
|
|
1442
|
-
|
|
1443
|
-
|
|
1459
|
+
columns: qa,
|
|
1460
|
+
className: "model-catalog-table",
|
|
1461
|
+
rows: s,
|
|
1462
|
+
rowKey: (r) => r.id,
|
|
1444
1463
|
testId: "model-catalog-table",
|
|
1445
|
-
rowTestId: (
|
|
1464
|
+
rowTestId: (r) => `model-catalog-${r.id}`
|
|
1446
1465
|
}
|
|
1447
1466
|
)
|
|
1448
1467
|
] }),
|
|
1449
|
-
|
|
1468
|
+
i.hasNextPage && /* @__PURE__ */ t("div", { className: "row", children: /* @__PURE__ */ t(
|
|
1450
1469
|
"button",
|
|
1451
1470
|
{
|
|
1452
1471
|
type: "button",
|
|
1453
1472
|
className: "btn ghost",
|
|
1454
|
-
disabled:
|
|
1455
|
-
onClick: () => void
|
|
1473
|
+
disabled: i.isFetchingNextPage,
|
|
1474
|
+
onClick: () => void i.fetchNextPage(),
|
|
1456
1475
|
"data-testid": "model-catalog-load-more",
|
|
1457
|
-
children:
|
|
1476
|
+
children: i.isFetchingNextPage ? "Loading…" : "Load more"
|
|
1458
1477
|
}
|
|
1459
1478
|
) })
|
|
1460
1479
|
] }) });
|
|
1461
1480
|
}
|
|
1462
|
-
const
|
|
1463
|
-
function
|
|
1481
|
+
const Va = {};
|
|
1482
|
+
function U(e) {
|
|
1464
1483
|
return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1465
1484
|
}
|
|
1466
|
-
function
|
|
1485
|
+
function Wa(e) {
|
|
1467
1486
|
return `${e.currency} ${(e.amountMinor / 100).toFixed(2)}`;
|
|
1468
1487
|
}
|
|
1469
|
-
function
|
|
1470
|
-
return e.length > 0 ? e.map(
|
|
1488
|
+
function Ba(e, n) {
|
|
1489
|
+
return e.length > 0 ? e.map(Wa).join(" · ") : n > 0 ? "unpriced" : "—";
|
|
1471
1490
|
}
|
|
1472
|
-
function
|
|
1491
|
+
function Ua(e) {
|
|
1473
1492
|
return e.costMinor == null ? null : `${e.currency ?? "USD"} ${(e.costMinor / 100).toFixed(2)}`;
|
|
1474
1493
|
}
|
|
1475
|
-
function
|
|
1494
|
+
function Ha(e) {
|
|
1476
1495
|
return e.totalsTruncated === !0;
|
|
1477
1496
|
}
|
|
1478
|
-
const
|
|
1497
|
+
const Ya = [
|
|
1479
1498
|
{
|
|
1480
1499
|
key: "occurredAt",
|
|
1481
1500
|
header: "When",
|
|
1482
|
-
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) })
|
|
1483
1502
|
},
|
|
1484
1503
|
{
|
|
1485
1504
|
key: "model",
|
|
1486
1505
|
header: "Model",
|
|
1487
|
-
render: (e) => /* @__PURE__ */
|
|
1488
|
-
/* @__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: [
|
|
1489
1508
|
e.provider,
|
|
1490
1509
|
" · ",
|
|
1491
1510
|
e.nativeId
|
|
@@ -1506,8 +1525,8 @@ const Ta = [
|
|
|
1506
1525
|
"span",
|
|
1507
1526
|
{
|
|
1508
1527
|
className: "muted small",
|
|
1509
|
-
title: `${
|
|
1510
|
-
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)
|
|
1511
1530
|
}
|
|
1512
1531
|
)
|
|
1513
1532
|
},
|
|
@@ -1516,7 +1535,7 @@ const Ta = [
|
|
|
1516
1535
|
header: "Cost",
|
|
1517
1536
|
align: "right",
|
|
1518
1537
|
render: (e) => {
|
|
1519
|
-
const n =
|
|
1538
|
+
const n = Ua(e);
|
|
1520
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 });
|
|
1521
1540
|
}
|
|
1522
1541
|
},
|
|
@@ -1524,10 +1543,10 @@ const Ta = [
|
|
|
1524
1543
|
key: "result",
|
|
1525
1544
|
header: "Result",
|
|
1526
1545
|
render: (e) => {
|
|
1527
|
-
const n =
|
|
1528
|
-
return /* @__PURE__ */
|
|
1546
|
+
const n = Tt(e.durationMs);
|
|
1547
|
+
return /* @__PURE__ */ l("span", { className: "muted small", title: e.errorCode ?? void 0, children: [
|
|
1529
1548
|
/* @__PURE__ */ t("span", { className: e.ok ? "tag" : "tag warn", children: e.ok ? "ok" : e.errorCode ?? "failed" }),
|
|
1530
|
-
n != null && /* @__PURE__ */
|
|
1549
|
+
n != null && /* @__PURE__ */ l(Q, { children: [
|
|
1531
1550
|
" · ",
|
|
1532
1551
|
n
|
|
1533
1552
|
] })
|
|
@@ -1535,61 +1554,61 @@ const Ta = [
|
|
|
1535
1554
|
}
|
|
1536
1555
|
}
|
|
1537
1556
|
];
|
|
1538
|
-
function
|
|
1539
|
-
var h,
|
|
1540
|
-
const n =
|
|
1541
|
-
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),
|
|
1542
1561
|
enabled: n != null,
|
|
1543
1562
|
initialPageParam: void 0,
|
|
1544
|
-
getNextPageParam: (
|
|
1545
|
-
queryFn: ({ pageParam:
|
|
1563
|
+
getNextPageParam: (m) => m.nextCursor ?? void 0,
|
|
1564
|
+
queryFn: ({ pageParam: m }) => _n(
|
|
1546
1565
|
a,
|
|
1547
1566
|
n,
|
|
1548
|
-
|
|
1567
|
+
m ? { ...i, cursor: m } : i
|
|
1549
1568
|
)
|
|
1550
|
-
}),
|
|
1551
|
-
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */
|
|
1552
|
-
/* @__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: [
|
|
1553
1572
|
/* @__PURE__ */ t("h3", { children: "Model usage" }),
|
|
1554
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." })
|
|
1555
1574
|
] }) }),
|
|
1556
|
-
n == null ? /* @__PURE__ */ t("div", { className: "card", children: /* @__PURE__ */ t("p", { className: "muted", "data-testid": "model-usage-no-project", children: "Select a project to see its model usage." }) }) : /* @__PURE__ */
|
|
1557
|
-
/* @__PURE__ */
|
|
1558
|
-
|
|
1559
|
-
|
|
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: [
|
|
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." }),
|
|
1578
|
+
r == null ? (
|
|
1560
1579
|
// A failed query is reported once, below — never as a perpetual "loading".
|
|
1561
|
-
|
|
1562
|
-
) : /* @__PURE__ */
|
|
1563
|
-
/* @__PURE__ */
|
|
1564
|
-
|
|
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),
|
|
1565
1584
|
" requests"
|
|
1566
1585
|
] }),
|
|
1567
1586
|
" · ",
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
|
|
1587
|
+
/* @__PURE__ */ l("span", { "data-testid": "model-usage-total-tokens", children: [
|
|
1588
|
+
U(r.totalTokens),
|
|
1570
1589
|
" tokens (",
|
|
1571
|
-
|
|
1590
|
+
U(r.inputTokens),
|
|
1572
1591
|
" in /",
|
|
1573
1592
|
" ",
|
|
1574
|
-
|
|
1593
|
+
U(r.outputTokens),
|
|
1575
1594
|
" out / ",
|
|
1576
|
-
|
|
1595
|
+
U(r.cachedInputTokens),
|
|
1577
1596
|
" cached / ",
|
|
1578
|
-
|
|
1597
|
+
U(r.cacheWriteTokens),
|
|
1579
1598
|
" cache write)"
|
|
1580
1599
|
] }),
|
|
1581
1600
|
" · ",
|
|
1582
|
-
/* @__PURE__ */ t("span", { "data-testid": "model-usage-total-cost", children:
|
|
1583
|
-
|
|
1601
|
+
/* @__PURE__ */ t("span", { "data-testid": "model-usage-total-cost", children: Ba(r.cost, r.unpriced) }),
|
|
1602
|
+
r.unpriced > 0 && /* @__PURE__ */ l(Q, { children: [
|
|
1584
1603
|
" · ",
|
|
1585
|
-
/* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ l(
|
|
1586
1605
|
"span",
|
|
1587
1606
|
{
|
|
1588
1607
|
className: "tag warn",
|
|
1589
1608
|
"data-testid": "model-usage-unpriced-total",
|
|
1590
1609
|
title: "calls with no usable rate — not included in any cost total",
|
|
1591
1610
|
children: [
|
|
1592
|
-
|
|
1611
|
+
U(r.unpriced),
|
|
1593
1612
|
" unpriced"
|
|
1594
1613
|
]
|
|
1595
1614
|
}
|
|
@@ -1597,71 +1616,243 @@ function pi(e) {
|
|
|
1597
1616
|
] })
|
|
1598
1617
|
] })
|
|
1599
1618
|
] }),
|
|
1600
|
-
|
|
1601
|
-
/* @__PURE__ */
|
|
1602
|
-
|
|
1603
|
-
|
|
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." }),
|
|
1604
1623
|
c.length > 0 && /* @__PURE__ */ t(
|
|
1605
|
-
|
|
1624
|
+
Re,
|
|
1606
1625
|
{
|
|
1607
|
-
columns:
|
|
1626
|
+
columns: Ya,
|
|
1608
1627
|
rows: c,
|
|
1609
|
-
rowKey: (
|
|
1628
|
+
rowKey: (m) => m.id,
|
|
1610
1629
|
testId: "model-usage-table",
|
|
1611
|
-
rowTestId: (
|
|
1630
|
+
rowTestId: (m) => `model-usage-${m.id}`
|
|
1612
1631
|
}
|
|
1613
1632
|
)
|
|
1614
1633
|
] }),
|
|
1615
|
-
|
|
1634
|
+
s.hasNextPage && /* @__PURE__ */ t("div", { className: "row", children: /* @__PURE__ */ t(
|
|
1616
1635
|
"button",
|
|
1617
1636
|
{
|
|
1618
1637
|
type: "button",
|
|
1619
1638
|
className: "btn ghost",
|
|
1620
|
-
disabled:
|
|
1621
|
-
onClick: () => void
|
|
1639
|
+
disabled: s.isFetchingNextPage,
|
|
1640
|
+
onClick: () => void s.fetchNextPage(),
|
|
1622
1641
|
"data-testid": "model-usage-load-more",
|
|
1623
|
-
children:
|
|
1642
|
+
children: s.isFetchingNextPage ? "Loading…" : "Load more"
|
|
1624
1643
|
}
|
|
1625
1644
|
) })
|
|
1626
1645
|
] })
|
|
1627
1646
|
] }) });
|
|
1628
1647
|
}
|
|
1629
|
-
const
|
|
1630
|
-
function
|
|
1631
|
-
const s =
|
|
1632
|
-
|
|
1633
|
-
(
|
|
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;
|
|
1653
|
+
}, u = a && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", onClick: a, children: "Add credential" });
|
|
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" }) }),
|
|
1657
|
+
u && /* @__PURE__ */ t("div", { className: "w6w-connection-list-actions", children: u })
|
|
1658
|
+
] }),
|
|
1634
1659
|
s.isLoading && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
|
|
1635
1660
|
s.error && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", children: s.error.message }),
|
|
1636
|
-
!s.isLoading && !s.error &&
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
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: [
|
|
1662
|
+
/* @__PURE__ */ t("p", { className: "w6w-muted", children: "No credentials yet." }),
|
|
1663
|
+
u
|
|
1664
|
+
] }) }),
|
|
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(
|
|
1640
1668
|
"button",
|
|
1641
1669
|
{
|
|
1642
1670
|
type: "button",
|
|
1643
1671
|
className: "w6w-embed-conn-action",
|
|
1644
|
-
"data-testid": `credential-row-${
|
|
1645
|
-
onClick: () => n == null ? void 0 : n(
|
|
1672
|
+
"data-testid": `credential-row-${h.id}`,
|
|
1673
|
+
onClick: () => n == null ? void 0 : n(h.id),
|
|
1646
1674
|
children: [
|
|
1647
|
-
/* @__PURE__ */ t("strong", { children:
|
|
1675
|
+
/* @__PURE__ */ t("strong", { children: h.name }),
|
|
1648
1676
|
" ",
|
|
1649
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children:
|
|
1650
|
-
|
|
1677
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: h.status }),
|
|
1678
|
+
/* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", "data-testid": `credential-type-${h.id}`, children: [
|
|
1679
|
+
" ",
|
|
1680
|
+
c(h.contract)
|
|
1681
|
+
] }),
|
|
1682
|
+
/* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", "data-testid": `credential-scope-${h.id}`, children: [
|
|
1683
|
+
" ",
|
|
1684
|
+
"· ",
|
|
1685
|
+
ut(h.accessScope)
|
|
1686
|
+
] }),
|
|
1687
|
+
g !== void 0 && /* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", children: [
|
|
1651
1688
|
" ",
|
|
1652
|
-
|
|
1689
|
+
g
|
|
1653
1690
|
] }),
|
|
1654
|
-
/* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", children: [
|
|
1655
1692
|
" · ",
|
|
1656
|
-
|
|
1693
|
+
za(h.connectionCount)
|
|
1657
1694
|
] })
|
|
1658
1695
|
]
|
|
1659
1696
|
}
|
|
1660
|
-
) },
|
|
1697
|
+
) }, h.id);
|
|
1661
1698
|
}) })
|
|
1662
1699
|
] });
|
|
1663
1700
|
}
|
|
1664
|
-
function
|
|
1701
|
+
function Ce({
|
|
1702
|
+
fields: e,
|
|
1703
|
+
values: n,
|
|
1704
|
+
onChange: a,
|
|
1705
|
+
idPrefix: i
|
|
1706
|
+
}) {
|
|
1707
|
+
return /* @__PURE__ */ t(Q, { children: e.map((s) => {
|
|
1708
|
+
const o = {
|
|
1709
|
+
className: s.secret ? "w6w-input w6w-secret-input" : "w6w-input",
|
|
1710
|
+
value: n[s.key] ?? "",
|
|
1711
|
+
name: `${i}-${s.key}`,
|
|
1712
|
+
autoComplete: "off",
|
|
1713
|
+
autoCapitalize: "off",
|
|
1714
|
+
autoCorrect: "off",
|
|
1715
|
+
spellCheck: !1,
|
|
1716
|
+
"data-1p-ignore": "true",
|
|
1717
|
+
"data-lpignore": "true",
|
|
1718
|
+
"data-bwignore": "true",
|
|
1719
|
+
"data-form-type": "other"
|
|
1720
|
+
};
|
|
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);
|
|
1728
|
+
}) });
|
|
1729
|
+
}
|
|
1730
|
+
const Te = (e, n) => e.every((a) => (n[a.key] ?? "").length > 0), Ee = (e, n) => Object.fromEntries(e.map((a) => [a.key, n[a.key] ?? ""])), 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.");
|
|
1745
|
+
return;
|
|
1746
|
+
}
|
|
1747
|
+
if (!Te(p.fields, m)) {
|
|
1748
|
+
v("Fill in every field.");
|
|
1749
|
+
return;
|
|
1750
|
+
}
|
|
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" } : {}
|
|
1757
|
+
};
|
|
1758
|
+
k({}), r.mutate(b, {
|
|
1759
|
+
onSuccess: (E) => {
|
|
1760
|
+
r.reset(), e == null || e(E.id);
|
|
1761
|
+
},
|
|
1762
|
+
onError: (E) => {
|
|
1763
|
+
r.reset(), v(ke(E, "create"));
|
|
1764
|
+
}
|
|
1765
|
+
});
|
|
1766
|
+
};
|
|
1767
|
+
return /* @__PURE__ */ l("div", { className: "w6w-embed-root w6w-embed-cred-create", "data-testid": "credential-create", children: [
|
|
1768
|
+
/* @__PURE__ */ t("h2", { children: "Add credential" }),
|
|
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(
|
|
1772
|
+
"form",
|
|
1773
|
+
{
|
|
1774
|
+
className: "w6w-card-stack",
|
|
1775
|
+
onSubmit: (b) => {
|
|
1776
|
+
b.preventDefault(), I();
|
|
1777
|
+
},
|
|
1778
|
+
children: [
|
|
1779
|
+
/* @__PURE__ */ l("label", { className: "w6w-field", children: [
|
|
1780
|
+
/* @__PURE__ */ t("span", { children: "Type" }),
|
|
1781
|
+
/* @__PURE__ */ t(
|
|
1782
|
+
"select",
|
|
1783
|
+
{
|
|
1784
|
+
value: p.id,
|
|
1785
|
+
"aria-label": "Credential type",
|
|
1786
|
+
onChange: (b) => C(b.target.value),
|
|
1787
|
+
children: y.map((b) => /* @__PURE__ */ t("option", { value: b.id, children: b.label }, b.id))
|
|
1788
|
+
}
|
|
1789
|
+
)
|
|
1790
|
+
] }),
|
|
1791
|
+
/* @__PURE__ */ l("label", { className: "w6w-field", children: [
|
|
1792
|
+
/* @__PURE__ */ t("span", { children: "Name" }),
|
|
1793
|
+
/* @__PURE__ */ t(
|
|
1794
|
+
"input",
|
|
1795
|
+
{
|
|
1796
|
+
type: "text",
|
|
1797
|
+
className: "w6w-input",
|
|
1798
|
+
value: h,
|
|
1799
|
+
onChange: (b) => g(b.target.value),
|
|
1800
|
+
maxLength: 120,
|
|
1801
|
+
autoComplete: "off"
|
|
1802
|
+
}
|
|
1803
|
+
)
|
|
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
|
+
),
|
|
1835
|
+
/* @__PURE__ */ t(
|
|
1836
|
+
Ce,
|
|
1837
|
+
{
|
|
1838
|
+
fields: p.fields,
|
|
1839
|
+
values: m,
|
|
1840
|
+
onChange: (b, E) => k((T) => ({ ...T, [b]: E })),
|
|
1841
|
+
idPrefix: "w6w-cred-create"
|
|
1842
|
+
}
|
|
1843
|
+
),
|
|
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" }),
|
|
1847
|
+
n && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: n, children: "Cancel" })
|
|
1848
|
+
] })
|
|
1849
|
+
]
|
|
1850
|
+
}
|
|
1851
|
+
)
|
|
1852
|
+
] });
|
|
1853
|
+
}
|
|
1854
|
+
const We = "google-service-account.v1";
|
|
1855
|
+
function Ga(e) {
|
|
1665
1856
|
try {
|
|
1666
1857
|
const n = JSON.parse(e);
|
|
1667
1858
|
return n !== null && typeof n == "object" && !Array.isArray(n) ? n : null;
|
|
@@ -1669,105 +1860,141 @@ function Ma(e) {
|
|
|
1669
1860
|
return null;
|
|
1670
1861
|
}
|
|
1671
1862
|
}
|
|
1672
|
-
const
|
|
1673
|
-
function
|
|
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);
|
|
1866
|
+
}
|
|
1867
|
+
function Za({
|
|
1674
1868
|
credentialId: e,
|
|
1675
1869
|
onOpenConnection: n,
|
|
1676
1870
|
onDeleted: a,
|
|
1677
|
-
onBack:
|
|
1678
|
-
slots:
|
|
1871
|
+
onBack: i,
|
|
1872
|
+
slots: s
|
|
1679
1873
|
}) {
|
|
1680
|
-
var
|
|
1681
|
-
const
|
|
1682
|
-
if (
|
|
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" });
|
|
1876
|
+
if (o.isLoading)
|
|
1683
1877
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root w6w-embed-cred-detail", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) });
|
|
1684
|
-
const
|
|
1685
|
-
if (!
|
|
1686
|
-
return /* @__PURE__ */
|
|
1687
|
-
(
|
|
1688
|
-
|
|
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
|
+
_
|
|
1689
1883
|
] });
|
|
1690
|
-
const
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
D("Enter the new secret as a JSON object.");
|
|
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.");
|
|
1695
1888
|
return;
|
|
1696
1889
|
}
|
|
1697
|
-
|
|
1698
|
-
|
|
1890
|
+
C(null);
|
|
1891
|
+
const d = Ee(M.fields, v);
|
|
1892
|
+
y({}), c.mutate(
|
|
1893
|
+
{ source: d },
|
|
1699
1894
|
{
|
|
1700
1895
|
onSuccess: () => {
|
|
1701
|
-
|
|
1896
|
+
c.reset(), b(!0);
|
|
1702
1897
|
},
|
|
1703
|
-
onError: (
|
|
1898
|
+
onError: (A) => {
|
|
1899
|
+
c.reset(), C(ke(A, "rotate"));
|
|
1900
|
+
}
|
|
1704
1901
|
}
|
|
1705
1902
|
);
|
|
1706
|
-
},
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1903
|
+
}, L = () => {
|
|
1904
|
+
b(!1);
|
|
1905
|
+
const d = Ga(k);
|
|
1906
|
+
if (!d) {
|
|
1907
|
+
C("Enter the new secret as a JSON object.");
|
|
1908
|
+
return;
|
|
1909
|
+
}
|
|
1910
|
+
C(null), c.mutate(
|
|
1911
|
+
{ source: d },
|
|
1912
|
+
{
|
|
1913
|
+
onSuccess: () => {
|
|
1914
|
+
w(""), b(!0);
|
|
1915
|
+
},
|
|
1916
|
+
onError: (A) => C(ee(A) ?? (A == null ? void 0 : A.message) ?? "Rotate failed.")
|
|
1917
|
+
}
|
|
1918
|
+
);
|
|
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.")
|
|
1710
1923
|
});
|
|
1711
|
-
},
|
|
1712
|
-
|
|
1713
|
-
onSuccess: (
|
|
1714
|
-
|
|
1924
|
+
}, G = () => {
|
|
1925
|
+
V(null), g.mutate(e, {
|
|
1926
|
+
onSuccess: (d) => {
|
|
1927
|
+
x(!1), d.ok ? a == null || a() : S(d.dependents.connections);
|
|
1715
1928
|
},
|
|
1716
|
-
onError: (
|
|
1929
|
+
onError: (d) => V(ee(d) ?? (d == null ? void 0 : d.message) ?? "Delete failed.")
|
|
1717
1930
|
});
|
|
1718
1931
|
};
|
|
1719
|
-
return /* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
-
/* @__PURE__ */ t("h2", { children:
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
-
/* @__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 }),
|
|
1724
1937
|
" ",
|
|
1725
|
-
/* @__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" })
|
|
1726
1943
|
] }),
|
|
1727
|
-
/* @__PURE__ */ t("dl", { className: "w6w-small", "data-testid": "credential-display", children: Object.entries(
|
|
1728
|
-
/* @__PURE__ */ t("dt", { className: "w6w-muted", children:
|
|
1729
|
-
/* @__PURE__ */ t("dd", { children:
|
|
1730
|
-
] },
|
|
1731
|
-
/* @__PURE__ */
|
|
1732
|
-
|
|
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,
|
|
1733
1950
|
" connection",
|
|
1734
|
-
|
|
1951
|
+
W === 1 ? "" : "s",
|
|
1735
1952
|
" · created ",
|
|
1736
|
-
|
|
1953
|
+
Be(K.createdAt),
|
|
1737
1954
|
" · updated",
|
|
1738
1955
|
" ",
|
|
1739
|
-
|
|
1956
|
+
Be(K.updatedAt)
|
|
1740
1957
|
] }),
|
|
1741
|
-
|
|
1958
|
+
_
|
|
1742
1959
|
] }),
|
|
1743
|
-
/* @__PURE__ */
|
|
1960
|
+
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", "data-testid": "credential-connections", children: [
|
|
1744
1961
|
/* @__PURE__ */ t("h3", { children: "Connected apps" }),
|
|
1745
|
-
|
|
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(
|
|
1746
1963
|
"button",
|
|
1747
1964
|
{
|
|
1748
1965
|
type: "button",
|
|
1749
1966
|
className: "w6w-embed-conn-action",
|
|
1750
|
-
onClick: () => n(
|
|
1751
|
-
children:
|
|
1967
|
+
onClick: () => n(d.id),
|
|
1968
|
+
children: d.displayName || d.appId
|
|
1752
1969
|
}
|
|
1753
|
-
) : /* @__PURE__ */ t("span", { children:
|
|
1970
|
+
) : /* @__PURE__ */ t("span", { children: d.displayName || d.appId }) }, d.id)) })
|
|
1754
1971
|
] }),
|
|
1755
|
-
/* @__PURE__ */
|
|
1972
|
+
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1756
1973
|
/* @__PURE__ */ t("h3", { children: "Rotate secret" }),
|
|
1757
|
-
/* @__PURE__ */
|
|
1758
|
-
|
|
1974
|
+
/* @__PURE__ */ l("p", { className: "w6w-muted w6w-small", "data-testid": "credential-rotation-impact", children: [
|
|
1975
|
+
W,
|
|
1759
1976
|
" connection",
|
|
1760
|
-
|
|
1977
|
+
W === 1 ? "" : "s",
|
|
1761
1978
|
" will be marked untested"
|
|
1762
1979
|
] }),
|
|
1763
|
-
/* @__PURE__ */ t(
|
|
1980
|
+
P && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
|
|
1981
|
+
M && /* @__PURE__ */ t(
|
|
1982
|
+
Ce,
|
|
1983
|
+
{
|
|
1984
|
+
fields: M.fields,
|
|
1985
|
+
values: v,
|
|
1986
|
+
onChange: (d, A) => y((q) => ({ ...q, [d]: A })),
|
|
1987
|
+
idPrefix: "w6w-cred-rotate"
|
|
1988
|
+
}
|
|
1989
|
+
),
|
|
1990
|
+
!P && !M && /* @__PURE__ */ t(
|
|
1764
1991
|
"textarea",
|
|
1765
1992
|
{
|
|
1766
1993
|
className: "w6w-input w6w-secret-input",
|
|
1767
1994
|
"aria-label": "New secret (JSON object)",
|
|
1768
1995
|
rows: 5,
|
|
1769
|
-
value:
|
|
1770
|
-
onChange: (
|
|
1996
|
+
value: k,
|
|
1997
|
+
onChange: (d) => w(d.target.value),
|
|
1771
1998
|
name: "w6w-cred-rotate",
|
|
1772
1999
|
autoComplete: "off",
|
|
1773
2000
|
autoCapitalize: "off",
|
|
@@ -1779,21 +2006,30 @@ function gi({
|
|
|
1779
2006
|
"data-form-type": "other"
|
|
1780
2007
|
}
|
|
1781
2008
|
),
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
/* @__PURE__ */ t(
|
|
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." }),
|
|
2011
|
+
/* @__PURE__ */ t(
|
|
2012
|
+
"button",
|
|
2013
|
+
{
|
|
2014
|
+
type: "button",
|
|
2015
|
+
className: "w6w-btn",
|
|
2016
|
+
disabled: c.isPending || P,
|
|
2017
|
+
onClick: M ? J : L,
|
|
2018
|
+
children: c.isPending ? "Rotating…" : "Rotate"
|
|
2019
|
+
}
|
|
2020
|
+
)
|
|
1785
2021
|
] }),
|
|
1786
|
-
/* @__PURE__ */
|
|
2022
|
+
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1787
2023
|
/* @__PURE__ */ t("h3", { children: "Manage" }),
|
|
1788
|
-
/* @__PURE__ */
|
|
2024
|
+
/* @__PURE__ */ l("div", { className: "w6w-modal-actions", children: [
|
|
1789
2025
|
/* @__PURE__ */ t(
|
|
1790
2026
|
"button",
|
|
1791
2027
|
{
|
|
1792
2028
|
type: "button",
|
|
1793
2029
|
className: "w6w-btn w6w-btn-ghost",
|
|
1794
|
-
disabled:
|
|
1795
|
-
onClick: () =>
|
|
1796
|
-
children:
|
|
2030
|
+
disabled: u.isPending,
|
|
2031
|
+
onClick: () => u.mutate(N ? "active" : "disabled"),
|
|
2032
|
+
children: N ? "Enable" : "Disable"
|
|
1797
2033
|
}
|
|
1798
2034
|
),
|
|
1799
2035
|
/* @__PURE__ */ t(
|
|
@@ -1802,7 +2038,7 @@ function gi({
|
|
|
1802
2038
|
type: "button",
|
|
1803
2039
|
className: "w6w-btn w6w-btn-ghost",
|
|
1804
2040
|
disabled: h.isPending,
|
|
1805
|
-
onClick:
|
|
2041
|
+
onClick: F,
|
|
1806
2042
|
children: h.isPending ? "Testing…" : "Test credential"
|
|
1807
2043
|
}
|
|
1808
2044
|
),
|
|
@@ -1812,19 +2048,19 @@ function gi({
|
|
|
1812
2048
|
type: "button",
|
|
1813
2049
|
className: "w6w-btn w6w-btn-danger",
|
|
1814
2050
|
onClick: () => {
|
|
1815
|
-
|
|
2051
|
+
S(null), x(!0);
|
|
1816
2052
|
},
|
|
1817
2053
|
children: "Delete"
|
|
1818
2054
|
}
|
|
1819
2055
|
)
|
|
1820
2056
|
] }),
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
/* @__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: [
|
|
1826
2062
|
'Delete the credential "',
|
|
1827
|
-
|
|
2063
|
+
K.name,
|
|
1828
2064
|
'"? This cannot be undone.'
|
|
1829
2065
|
] }),
|
|
1830
2066
|
/* @__PURE__ */ t(
|
|
@@ -1832,8 +2068,8 @@ function gi({
|
|
|
1832
2068
|
{
|
|
1833
2069
|
type: "button",
|
|
1834
2070
|
className: "w6w-btn w6w-btn-danger",
|
|
1835
|
-
disabled:
|
|
1836
|
-
onClick:
|
|
2071
|
+
disabled: g.isPending,
|
|
2072
|
+
onClick: G,
|
|
1837
2073
|
children: "Confirm delete"
|
|
1838
2074
|
}
|
|
1839
2075
|
),
|
|
@@ -1843,356 +2079,714 @@ function gi({
|
|
|
1843
2079
|
{
|
|
1844
2080
|
type: "button",
|
|
1845
2081
|
className: "w6w-btn w6w-btn-ghost",
|
|
1846
|
-
onClick: () =>
|
|
2082
|
+
onClick: () => x(!1),
|
|
1847
2083
|
children: "Cancel"
|
|
1848
2084
|
}
|
|
1849
2085
|
)
|
|
1850
2086
|
] }),
|
|
1851
|
-
|
|
1852
|
-
/* @__PURE__ */
|
|
2087
|
+
D && /* @__PURE__ */ l("div", { role: "alert", "data-testid": "credential-in-use", children: [
|
|
2088
|
+
/* @__PURE__ */ l("p", { className: "w6w-small", children: [
|
|
1853
2089
|
"This credential is still used by ",
|
|
1854
|
-
|
|
2090
|
+
D.length,
|
|
1855
2091
|
" connection",
|
|
1856
|
-
|
|
2092
|
+
D.length === 1 ? "" : "s",
|
|
1857
2093
|
". Delete those integrations first, or rotate this credential instead of deleting it."
|
|
1858
2094
|
] }),
|
|
1859
|
-
/* @__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)) })
|
|
1860
2096
|
] }),
|
|
1861
|
-
|
|
2097
|
+
$ && /* @__PURE__ */ t("p", { role: "alert", children: $ })
|
|
1862
2098
|
] })
|
|
1863
2099
|
] });
|
|
1864
2100
|
}
|
|
1865
|
-
|
|
1866
|
-
|
|
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;
|
|
1867
2461
|
return n.code === void 0 && typeof a == "string" && a !== "" ? { ...n, code: a } : n;
|
|
1868
2462
|
}
|
|
1869
|
-
const
|
|
1870
|
-
function
|
|
2463
|
+
const He = 80;
|
|
2464
|
+
function cs(e, n) {
|
|
1871
2465
|
if (typeof URL > "u" || typeof URL.createObjectURL != "function") return;
|
|
1872
|
-
const a = URL.createObjectURL(new Blob([n], { type: "text/csv" })),
|
|
1873
|
-
|
|
1874
|
-
}
|
|
1875
|
-
function
|
|
1876
|
-
var
|
|
1877
|
-
const a =
|
|
1878
|
-
(
|
|
1879
|
-
),
|
|
1880
|
-
const Z = q === void 0 ? null :
|
|
1881
|
-
|
|
1882
|
-
id:
|
|
1883
|
-
isNew:
|
|
1884
|
-
cells:
|
|
1885
|
-
version:
|
|
1886
|
-
dirty: Z === null ? !0 :
|
|
1887
|
-
conflict:
|
|
1888
|
-
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]
|
|
1889
2483
|
});
|
|
1890
2484
|
};
|
|
1891
|
-
|
|
1892
|
-
for (const
|
|
1893
|
-
|
|
1894
|
-
const
|
|
1895
|
-
|
|
1896
|
-
},
|
|
1897
|
-
|
|
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);
|
|
1898
2492
|
};
|
|
1899
|
-
function
|
|
1900
|
-
const Z =
|
|
1901
|
-
|
|
1902
|
-
const
|
|
1903
|
-
if (
|
|
1904
|
-
const
|
|
1905
|
-
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 };
|
|
1906
2500
|
});
|
|
1907
2501
|
}
|
|
1908
|
-
async function
|
|
1909
|
-
const
|
|
2502
|
+
async function L(d) {
|
|
2503
|
+
const A = _.get(d), q = H(d) ?? (A ? pe(A, i) : void 0);
|
|
1910
2504
|
if (q === void 0) return;
|
|
1911
|
-
|
|
1912
|
-
const Z =
|
|
2505
|
+
p(null), M(d);
|
|
2506
|
+
const Z = an(q, i);
|
|
1913
2507
|
if (!Z.ok) {
|
|
1914
|
-
|
|
2508
|
+
g((B) => ({ ...B, [d]: Z.errors }));
|
|
1915
2509
|
return;
|
|
1916
2510
|
}
|
|
1917
|
-
const z =
|
|
2511
|
+
const z = sn(
|
|
1918
2512
|
q,
|
|
1919
2513
|
Z.value,
|
|
1920
|
-
|
|
2514
|
+
Xe((A == null ? void 0 : A.expiresAt) ?? null, Date.now())
|
|
1921
2515
|
);
|
|
1922
2516
|
try {
|
|
1923
|
-
z.kind === "insert" ? await
|
|
2517
|
+
z.kind === "insert" ? await x.mutateAsync({
|
|
1924
2518
|
id: e.id,
|
|
1925
2519
|
row: z.value,
|
|
1926
2520
|
ttlSeconds: z.ttlSeconds,
|
|
1927
2521
|
project: n
|
|
1928
|
-
}) : await
|
|
2522
|
+
}) : await R.mutateAsync({
|
|
1929
2523
|
id: e.id,
|
|
1930
2524
|
key: z.key,
|
|
1931
2525
|
value: z.value,
|
|
1932
2526
|
ifVersion: z.ifVersion,
|
|
1933
2527
|
ttlSeconds: z.ttlSeconds,
|
|
1934
2528
|
project: n
|
|
1935
|
-
}),
|
|
1936
|
-
} catch (
|
|
1937
|
-
const
|
|
1938
|
-
if (
|
|
1939
|
-
k((
|
|
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 }));
|
|
1940
2534
|
return;
|
|
1941
2535
|
}
|
|
1942
|
-
const
|
|
1943
|
-
if (
|
|
1944
|
-
|
|
2536
|
+
const ce = ln(ne, i);
|
|
2537
|
+
if (ce !== null) {
|
|
2538
|
+
g((Ie) => ({ ...Ie, [d]: ce }));
|
|
1945
2539
|
return;
|
|
1946
2540
|
}
|
|
1947
|
-
|
|
2541
|
+
p(ne.message);
|
|
1948
2542
|
}
|
|
1949
2543
|
}
|
|
1950
|
-
async function
|
|
2544
|
+
async function F(d) {
|
|
1951
2545
|
try {
|
|
1952
|
-
const
|
|
1953
|
-
|
|
1954
|
-
} catch (
|
|
1955
|
-
|
|
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);
|
|
1956
2550
|
}
|
|
1957
2551
|
}
|
|
1958
|
-
function
|
|
1959
|
-
const
|
|
1960
|
-
|
|
2552
|
+
function G() {
|
|
2553
|
+
const d = C;
|
|
2554
|
+
I(null), d !== null && (d !== ae && D.mutate({ id: e.id, key: d, project: n }), P(d));
|
|
1961
2555
|
}
|
|
1962
|
-
async function
|
|
1963
|
-
|
|
2556
|
+
async function te(d) {
|
|
2557
|
+
E(null);
|
|
1964
2558
|
try {
|
|
1965
|
-
const
|
|
1966
|
-
|
|
1967
|
-
} catch (
|
|
1968
|
-
const q =
|
|
1969
|
-
|
|
1970
|
-
typeof q.status == "number" ?
|
|
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 }
|
|
1971
2565
|
);
|
|
1972
2566
|
}
|
|
1973
2567
|
}
|
|
1974
|
-
async function
|
|
2568
|
+
async function we() {
|
|
1975
2569
|
try {
|
|
1976
|
-
const
|
|
1977
|
-
|
|
1978
|
-
} catch (
|
|
1979
|
-
|
|
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 });
|
|
1980
2574
|
}
|
|
1981
2575
|
}
|
|
1982
|
-
return /* @__PURE__ */
|
|
2576
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
1983
2577
|
/* @__PURE__ */ t(
|
|
1984
|
-
|
|
2578
|
+
Jt,
|
|
1985
2579
|
{
|
|
1986
|
-
result:
|
|
1987
|
-
busy:
|
|
1988
|
-
onImport:
|
|
1989
|
-
onRefuse: (
|
|
1990
|
-
onExport:
|
|
2580
|
+
result: b,
|
|
2581
|
+
busy: $.isPending,
|
|
2582
|
+
onImport: te,
|
|
2583
|
+
onRefuse: (d) => E({ ok: !1, message: d }),
|
|
2584
|
+
onExport: we
|
|
1991
2585
|
}
|
|
1992
2586
|
),
|
|
1993
2587
|
/* @__PURE__ */ t(
|
|
1994
|
-
|
|
2588
|
+
Gt,
|
|
1995
2589
|
{
|
|
1996
|
-
columns:
|
|
1997
|
-
keyColumn:
|
|
1998
|
-
rows:
|
|
1999
|
-
error:
|
|
2000
|
-
loading:
|
|
2001
|
-
hasMore:
|
|
2590
|
+
columns: i,
|
|
2591
|
+
keyColumn: s,
|
|
2592
|
+
rows: K,
|
|
2593
|
+
error: y,
|
|
2594
|
+
loading: O.isPending,
|
|
2595
|
+
hasMore: O.hasNextPage,
|
|
2002
2596
|
empty: /* @__PURE__ */ t("p", { className: "muted small", children: "No rows match this key prefix." }),
|
|
2003
|
-
onCellChange:
|
|
2004
|
-
onSave: (
|
|
2005
|
-
onDelete:
|
|
2006
|
-
onReload: (
|
|
2597
|
+
onCellChange: J,
|
|
2598
|
+
onSave: (d) => void L(d),
|
|
2599
|
+
onDelete: I,
|
|
2600
|
+
onReload: (d) => void F(d),
|
|
2007
2601
|
onAddRow: () => {
|
|
2008
|
-
|
|
2602
|
+
ae in c || (u((d) => ({ ...d, [ae]: Ke(i) })), p(null));
|
|
2009
2603
|
},
|
|
2010
|
-
onLoadMore: () => void
|
|
2011
|
-
onSearch:
|
|
2604
|
+
onLoadMore: () => void O.fetchNextPage(),
|
|
2605
|
+
onSearch: r
|
|
2012
2606
|
}
|
|
2013
2607
|
),
|
|
2014
|
-
|
|
2015
|
-
|
|
2608
|
+
C !== null && /* @__PURE__ */ t(
|
|
2609
|
+
be,
|
|
2016
2610
|
{
|
|
2017
2611
|
title: "Delete entry",
|
|
2018
|
-
message:
|
|
2612
|
+
message: C === ae ? "Discard this unsaved row?" : `Delete "${C}"? This cannot be undone.`,
|
|
2019
2613
|
confirmLabel: "Delete",
|
|
2020
|
-
onConfirm:
|
|
2021
|
-
onClose: () =>
|
|
2614
|
+
onConfirm: G,
|
|
2615
|
+
onClose: () => I(null)
|
|
2022
2616
|
}
|
|
2023
2617
|
)
|
|
2024
2618
|
] });
|
|
2025
2619
|
}
|
|
2026
|
-
function
|
|
2027
|
-
var
|
|
2028
|
-
const a = e.kind === "doc",
|
|
2029
|
-
(
|
|
2030
|
-
),
|
|
2031
|
-
const
|
|
2032
|
-
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;
|
|
2033
2627
|
};
|
|
2034
|
-
function
|
|
2035
|
-
c(
|
|
2628
|
+
function H(L) {
|
|
2629
|
+
c(L.key), h(!1), w(_(L)), y(null), C(!1);
|
|
2036
2630
|
}
|
|
2037
|
-
function
|
|
2038
|
-
c(null), h(!1),
|
|
2631
|
+
function W() {
|
|
2632
|
+
c(null), h(!1), m(""), w(""), y(null), C(!1);
|
|
2039
2633
|
}
|
|
2040
|
-
async function
|
|
2041
|
-
|
|
2042
|
-
const
|
|
2043
|
-
if (!
|
|
2044
|
-
|
|
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);
|
|
2045
2639
|
return;
|
|
2046
2640
|
}
|
|
2047
|
-
const
|
|
2048
|
-
if (
|
|
2049
|
-
|
|
2641
|
+
const F = u ? g.trim() : r;
|
|
2642
|
+
if (F === null || F === "") {
|
|
2643
|
+
y("Enter a key.");
|
|
2050
2644
|
return;
|
|
2051
2645
|
}
|
|
2052
2646
|
try {
|
|
2053
|
-
await
|
|
2647
|
+
await x.mutateAsync({
|
|
2054
2648
|
id: e.id,
|
|
2055
|
-
key:
|
|
2056
|
-
value:
|
|
2649
|
+
key: F,
|
|
2650
|
+
value: L.value,
|
|
2057
2651
|
// A new entry must not exist yet; an existing one is guarded by the version loaded.
|
|
2058
|
-
ifVersion:
|
|
2059
|
-
ttlSeconds:
|
|
2652
|
+
ifVersion: u ? 0 : ($ == null ? void 0 : $.version) ?? 0,
|
|
2653
|
+
ttlSeconds: u ? void 0 : Xe(($ == null ? void 0 : $.expiresAt) ?? null, Date.now()),
|
|
2060
2654
|
project: n
|
|
2061
|
-
}),
|
|
2062
|
-
} catch (
|
|
2063
|
-
const
|
|
2064
|
-
|
|
2655
|
+
}), b((G) => se(G, F)), W();
|
|
2656
|
+
} catch (G) {
|
|
2657
|
+
const te = Y(G);
|
|
2658
|
+
et(te) ? C(!0) : y(te.message);
|
|
2065
2659
|
}
|
|
2066
2660
|
}
|
|
2067
|
-
async function
|
|
2068
|
-
if (
|
|
2661
|
+
async function M() {
|
|
2662
|
+
if (r !== null)
|
|
2069
2663
|
try {
|
|
2070
|
-
const
|
|
2071
|
-
|
|
2072
|
-
} catch (
|
|
2073
|
-
|
|
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);
|
|
2074
2668
|
}
|
|
2075
2669
|
}
|
|
2076
|
-
async function
|
|
2077
|
-
const
|
|
2078
|
-
if (T(null),
|
|
2670
|
+
async function P() {
|
|
2671
|
+
const L = E;
|
|
2672
|
+
if (T(null), L !== null)
|
|
2079
2673
|
try {
|
|
2080
|
-
await
|
|
2081
|
-
} catch (
|
|
2082
|
-
|
|
2674
|
+
await D.mutateAsync({ id: e.id, key: L, project: n }), L === r && W();
|
|
2675
|
+
} catch (F) {
|
|
2676
|
+
y(Y(F).message);
|
|
2083
2677
|
}
|
|
2084
2678
|
}
|
|
2085
|
-
return /* @__PURE__ */
|
|
2679
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
2086
2680
|
/* @__PURE__ */ t(
|
|
2087
|
-
|
|
2681
|
+
Xt,
|
|
2088
2682
|
{
|
|
2089
|
-
rows:
|
|
2090
|
-
loading:
|
|
2683
|
+
rows: S.map((L) => ({ key: L.key, version: L.version, preview: K(L) })),
|
|
2684
|
+
loading: R.isPending,
|
|
2091
2685
|
empty: /* @__PURE__ */ t("p", { className: "muted small", children: "No entries match this key prefix." }),
|
|
2092
|
-
hasMore:
|
|
2093
|
-
onOpen: (
|
|
2094
|
-
const
|
|
2095
|
-
|
|
2686
|
+
hasMore: R.hasNextPage,
|
|
2687
|
+
onOpen: (L) => {
|
|
2688
|
+
const F = S.find((G) => G.key === L);
|
|
2689
|
+
F && H(F);
|
|
2096
2690
|
},
|
|
2097
|
-
onSearch:
|
|
2691
|
+
onSearch: o,
|
|
2098
2692
|
onNew: () => {
|
|
2099
|
-
c(null), h(!0),
|
|
2693
|
+
c(null), h(!0), m(""), w(""), y(null), C(!1);
|
|
2100
2694
|
},
|
|
2101
|
-
onLoadMore: () => void
|
|
2695
|
+
onLoadMore: () => void R.fetchNextPage()
|
|
2102
2696
|
}
|
|
2103
2697
|
),
|
|
2104
|
-
|
|
2105
|
-
|
|
2698
|
+
V && /* @__PURE__ */ t(
|
|
2699
|
+
en,
|
|
2106
2700
|
{
|
|
2107
2701
|
kind: a ? "doc" : "kv",
|
|
2108
|
-
isNew:
|
|
2109
|
-
entryKey:
|
|
2110
|
-
newKey:
|
|
2111
|
-
version: (
|
|
2112
|
-
expiresAt: (
|
|
2702
|
+
isNew: u,
|
|
2703
|
+
entryKey: r ?? void 0,
|
|
2704
|
+
newKey: g,
|
|
2705
|
+
version: ($ == null ? void 0 : $.version) ?? null,
|
|
2706
|
+
expiresAt: ($ == null ? void 0 : $.expiresAt) ?? null,
|
|
2113
2707
|
text: k,
|
|
2114
|
-
error:
|
|
2115
|
-
conflict:
|
|
2116
|
-
saving:
|
|
2117
|
-
onDelete:
|
|
2118
|
-
onTextChange: (
|
|
2119
|
-
|
|
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);
|
|
2120
2714
|
},
|
|
2121
|
-
onKeyChange:
|
|
2122
|
-
onSave: () => void
|
|
2123
|
-
onCancel:
|
|
2124
|
-
onReload: () => void
|
|
2715
|
+
onKeyChange: m,
|
|
2716
|
+
onSave: () => void N(),
|
|
2717
|
+
onCancel: W,
|
|
2718
|
+
onReload: () => void M()
|
|
2125
2719
|
}
|
|
2126
2720
|
),
|
|
2127
|
-
|
|
2128
|
-
|
|
2721
|
+
E !== null && /* @__PURE__ */ t(
|
|
2722
|
+
be,
|
|
2129
2723
|
{
|
|
2130
2724
|
title: "Delete entry",
|
|
2131
|
-
message: `Delete "${
|
|
2725
|
+
message: `Delete "${E}"? This cannot be undone.`,
|
|
2132
2726
|
confirmLabel: "Delete",
|
|
2133
|
-
onConfirm:
|
|
2727
|
+
onConfirm: P,
|
|
2134
2728
|
onClose: () => T(null)
|
|
2135
2729
|
}
|
|
2136
2730
|
)
|
|
2137
2731
|
] });
|
|
2138
2732
|
}
|
|
2139
|
-
function
|
|
2733
|
+
function se(e, n) {
|
|
2140
2734
|
if (!(n in e)) return e;
|
|
2141
2735
|
const a = { ...e };
|
|
2142
2736
|
return delete a[n], a;
|
|
2143
2737
|
}
|
|
2144
|
-
function
|
|
2145
|
-
const
|
|
2146
|
-
let
|
|
2147
|
-
|
|
2148
|
-
const c = (a == null ? void 0 : a.header) === void 0 ?
|
|
2149
|
-
/* @__PURE__ */ t("h3", { children:
|
|
2150
|
-
/* @__PURE__ */
|
|
2151
|
-
|
|
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: [
|
|
2743
|
+
/* @__PURE__ */ t("h3", { children: o.name }),
|
|
2744
|
+
/* @__PURE__ */ l("p", { className: "muted small", children: [
|
|
2745
|
+
o.kind,
|
|
2152
2746
|
" · ",
|
|
2153
|
-
|
|
2747
|
+
o.entryCount,
|
|
2154
2748
|
" ",
|
|
2155
|
-
|
|
2749
|
+
o.entryCount === 1 ? "entry" : "entries"
|
|
2156
2750
|
] })
|
|
2157
2751
|
] }) : a.header;
|
|
2158
|
-
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */
|
|
2752
|
+
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ l("section", { className: "section", children: [
|
|
2159
2753
|
c,
|
|
2160
|
-
|
|
2754
|
+
r
|
|
2161
2755
|
] }) });
|
|
2162
2756
|
}
|
|
2163
|
-
const
|
|
2164
|
-
function
|
|
2165
|
-
const [n, a] = f(""), [
|
|
2166
|
-
function
|
|
2167
|
-
|
|
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);
|
|
2168
2762
|
const T = {
|
|
2169
|
-
kind:
|
|
2763
|
+
kind: o,
|
|
2170
2764
|
name: n
|
|
2171
2765
|
};
|
|
2172
|
-
|
|
2766
|
+
o === "kv" && (T.schema = { valueType: c }), o === "table" && (T.schema = m === "" ? { columns: h } : { columns: h, key: m }), i !== "" && (T.description = i), b.mutate(
|
|
2173
2767
|
// The SDK's create body types `schema` as table columns only; the wire takes the S-2 shape
|
|
2174
2768
|
// per kind, so the kv `{valueType}` schema is passed through as the host defines it.
|
|
2175
2769
|
{ input: T, project: e.project },
|
|
2176
2770
|
{
|
|
2177
2771
|
onSuccess: () => e.onClose(),
|
|
2178
2772
|
onError: (j) => {
|
|
2179
|
-
const
|
|
2180
|
-
if (
|
|
2181
|
-
|
|
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 });
|
|
2182
2776
|
return;
|
|
2183
2777
|
}
|
|
2184
|
-
if (
|
|
2185
|
-
|
|
2778
|
+
if (R.kind === "field" && ms.includes(R.field)) {
|
|
2779
|
+
v({ [R.field]: O.message });
|
|
2186
2780
|
return;
|
|
2187
2781
|
}
|
|
2188
|
-
|
|
2782
|
+
I(O.message);
|
|
2189
2783
|
}
|
|
2190
2784
|
}
|
|
2191
2785
|
);
|
|
2192
2786
|
}
|
|
2193
|
-
return /* @__PURE__ */
|
|
2194
|
-
/* @__PURE__ */
|
|
2195
|
-
/* @__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: [
|
|
2196
2790
|
/* @__PURE__ */ t("span", { children: "Name" }),
|
|
2197
2791
|
/* @__PURE__ */ t(
|
|
2198
2792
|
"input",
|
|
@@ -2205,53 +2799,53 @@ function Ra(e) {
|
|
|
2205
2799
|
}
|
|
2206
2800
|
)
|
|
2207
2801
|
] }),
|
|
2208
|
-
|
|
2209
|
-
/* @__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: [
|
|
2210
2804
|
/* @__PURE__ */ t("span", { children: "Description" }),
|
|
2211
2805
|
/* @__PURE__ */ t(
|
|
2212
2806
|
"input",
|
|
2213
2807
|
{
|
|
2214
2808
|
type: "text",
|
|
2215
|
-
value:
|
|
2216
|
-
onChange: (T) =>
|
|
2809
|
+
value: i,
|
|
2810
|
+
onChange: (T) => s(T.target.value),
|
|
2217
2811
|
placeholder: "What this store holds"
|
|
2218
2812
|
}
|
|
2219
2813
|
)
|
|
2220
2814
|
] }),
|
|
2221
|
-
/* @__PURE__ */
|
|
2815
|
+
/* @__PURE__ */ l("label", { className: "field", children: [
|
|
2222
2816
|
/* @__PURE__ */ t("span", { children: "Kind" }),
|
|
2223
2817
|
/* @__PURE__ */ t(
|
|
2224
2818
|
"select",
|
|
2225
2819
|
{
|
|
2226
2820
|
"data-testid": "data-store-kind",
|
|
2227
|
-
value:
|
|
2821
|
+
value: o,
|
|
2228
2822
|
onChange: (T) => {
|
|
2229
|
-
|
|
2823
|
+
r(T.target.value), k("");
|
|
2230
2824
|
},
|
|
2231
|
-
children:
|
|
2825
|
+
children: un.map((T) => /* @__PURE__ */ t("option", { value: T, children: mn[T] }, T))
|
|
2232
2826
|
}
|
|
2233
2827
|
),
|
|
2234
2828
|
/* @__PURE__ */ t("span", { className: "hint", children: "The kind is fixed once the store exists." })
|
|
2235
2829
|
] }),
|
|
2236
|
-
|
|
2237
|
-
|
|
2830
|
+
w.kind !== void 0 && /* @__PURE__ */ t("div", { className: "result error", children: w.kind }),
|
|
2831
|
+
o === "kv" && /* @__PURE__ */ l("label", { className: "field", children: [
|
|
2238
2832
|
/* @__PURE__ */ t("span", { children: "Value type" }),
|
|
2239
|
-
/* @__PURE__ */ t("select", { value: c, onChange: (T) =>
|
|
2833
|
+
/* @__PURE__ */ t("select", { value: c, onChange: (T) => u(T.target.value), children: hn.map((T) => /* @__PURE__ */ t("option", { value: T, children: T }, T)) })
|
|
2240
2834
|
] }),
|
|
2241
|
-
|
|
2242
|
-
|
|
2835
|
+
o === "table" && /* @__PURE__ */ t(
|
|
2836
|
+
wn,
|
|
2243
2837
|
{
|
|
2244
2838
|
columns: h,
|
|
2245
|
-
onChange:
|
|
2246
|
-
keyColumn:
|
|
2839
|
+
onChange: g,
|
|
2840
|
+
keyColumn: m,
|
|
2247
2841
|
onKeyColumnChange: k,
|
|
2248
|
-
columnErrors:
|
|
2842
|
+
columnErrors: y
|
|
2249
2843
|
}
|
|
2250
2844
|
),
|
|
2251
|
-
|
|
2252
|
-
|
|
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 })
|
|
2253
2847
|
] }),
|
|
2254
|
-
/* @__PURE__ */
|
|
2848
|
+
/* @__PURE__ */ l("div", { className: "modal-actions", children: [
|
|
2255
2849
|
/* @__PURE__ */ t("button", { type: "button", className: "btn ghost", onClick: e.onClose, children: "Cancel" }),
|
|
2256
2850
|
/* @__PURE__ */ t(
|
|
2257
2851
|
"button",
|
|
@@ -2259,86 +2853,88 @@ function Ra(e) {
|
|
|
2259
2853
|
type: "button",
|
|
2260
2854
|
className: "btn",
|
|
2261
2855
|
"data-testid": "data-store-create",
|
|
2262
|
-
disabled:
|
|
2263
|
-
onClick:
|
|
2264
|
-
children:
|
|
2856
|
+
disabled: b.isPending,
|
|
2857
|
+
onClick: E,
|
|
2858
|
+
children: b.isPending ? "Creating…" : "Create"
|
|
2265
2859
|
}
|
|
2266
2860
|
)
|
|
2267
2861
|
] })
|
|
2268
2862
|
] });
|
|
2269
2863
|
}
|
|
2270
|
-
function
|
|
2271
|
-
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: [
|
|
2272
2866
|
/* @__PURE__ */ t("h3", { children: "Data stores" }),
|
|
2273
2867
|
/* @__PURE__ */ t("p", { className: "muted small", children: "Key-value, document and table storage for this project." })
|
|
2274
|
-
] }) :
|
|
2275
|
-
return /* @__PURE__ */
|
|
2868
|
+
] }) : i.header;
|
|
2869
|
+
return /* @__PURE__ */ l("div", { className: "w6w-embed-root", children: [
|
|
2276
2870
|
/* @__PURE__ */ t(
|
|
2277
|
-
|
|
2871
|
+
dn,
|
|
2278
2872
|
{
|
|
2279
|
-
stores:
|
|
2280
|
-
loading:
|
|
2281
|
-
error:
|
|
2873
|
+
stores: o.data ?? [],
|
|
2874
|
+
loading: o.isLoading,
|
|
2875
|
+
error: m ?? (o.error != null ? Y(o.error).message : null),
|
|
2282
2876
|
onOpen: n,
|
|
2283
2877
|
getHref: a,
|
|
2284
|
-
onArchive: (
|
|
2285
|
-
k(null),
|
|
2878
|
+
onArchive: (v) => {
|
|
2879
|
+
k(null), g(v);
|
|
2286
2880
|
},
|
|
2287
|
-
busy:
|
|
2881
|
+
busy: r.isPending,
|
|
2288
2882
|
slots: {
|
|
2289
|
-
header:
|
|
2883
|
+
header: w,
|
|
2290
2884
|
actions: /* @__PURE__ */ t(
|
|
2291
2885
|
"button",
|
|
2292
2886
|
{
|
|
2293
2887
|
type: "button",
|
|
2294
2888
|
className: "btn",
|
|
2295
2889
|
"data-testid": "data-store-new",
|
|
2296
|
-
disabled:
|
|
2297
|
-
onClick: () =>
|
|
2890
|
+
disabled: s == null,
|
|
2891
|
+
onClick: () => u(!0),
|
|
2298
2892
|
children: "+ New data store"
|
|
2299
2893
|
}
|
|
2300
2894
|
),
|
|
2301
|
-
empty:
|
|
2895
|
+
empty: i == null ? void 0 : i.empty
|
|
2302
2896
|
}
|
|
2303
2897
|
}
|
|
2304
2898
|
),
|
|
2305
|
-
c &&
|
|
2899
|
+
c && s != null && /* @__PURE__ */ t(hs, { project: s, onClose: () => u(!1) }),
|
|
2306
2900
|
h && /* @__PURE__ */ t(
|
|
2307
|
-
|
|
2901
|
+
be,
|
|
2308
2902
|
{
|
|
2309
2903
|
title: "Archive data store",
|
|
2310
2904
|
message: `Archive "${h.name}" and its ${h.entryCount} ${h.entryCount === 1 ? "entry" : "entries"}? Workflows and the API can no longer reach it.`,
|
|
2311
2905
|
confirmLabel: "Archive",
|
|
2312
2906
|
onConfirm: () => {
|
|
2313
|
-
const
|
|
2314
|
-
|
|
2315
|
-
{ id:
|
|
2316
|
-
{ 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) }
|
|
2317
2911
|
);
|
|
2318
2912
|
},
|
|
2319
|
-
onClose: () =>
|
|
2913
|
+
onClose: () => g(null)
|
|
2320
2914
|
}
|
|
2321
2915
|
)
|
|
2322
2916
|
] });
|
|
2323
2917
|
}
|
|
2324
2918
|
export {
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
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
|
|
2343
2939
|
};
|
|
2344
2940
|
//# sourceMappingURL=lists.mjs.map
|