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