@w6w/embed 0.2.0 → 0.2.11
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/{ConfirmModal-RLbZT5_k.js → ConfirmModal-BE-SdX-O.js} +53 -49
- package/dist/{ConfirmModal-RLbZT5_k.js.map → ConfirmModal-BE-SdX-O.js.map} +1 -1
- package/dist/{CreateFunctionModal-DRsFx-FB.js → CreateFunctionModal-D6CQLpa_.js} +25 -25
- package/dist/{CreateFunctionModal-DRsFx-FB.js.map → CreateFunctionModal-D6CQLpa_.js.map} +1 -1
- package/dist/{DocumentFormModal-BExK1V-B.js → DocumentFormModal-YauVdolr.js} +5 -5
- package/dist/{DocumentFormModal-BExK1V-B.js.map → DocumentFormModal-YauVdolr.js.map} +1 -1
- package/dist/{ImportSpecModal-BDQIf6rg.js → ImportSpecModal-B7qd1Km2.js} +3 -3
- package/dist/{ImportSpecModal-BDQIf6rg.js.map → ImportSpecModal-B7qd1Km2.js.map} +1 -1
- package/dist/ModelRoutesManager-BGESQahw.js +345 -0
- package/dist/ModelRoutesManager-BGESQahw.js.map +1 -0
- package/dist/WorkflowEditor-CwvmAGp2.js +925 -0
- package/dist/WorkflowEditor-CwvmAGp2.js.map +1 -0
- package/dist/{apps-1FNUwbGv.js → apps-CboASBKr.js} +14 -14
- package/dist/{apps-1FNUwbGv.js.map → apps-CboASBKr.js.map} +1 -1
- package/dist/{callables-3mFrMVG_.js → callables-tOlflvbl.js} +11 -11
- package/dist/{callables-3mFrMVG_.js.map → callables-tOlflvbl.js.map} +1 -1
- package/dist/chrome/ConfirmModal.d.ts +4 -1
- package/dist/chrome/workspace.d.ts +4 -0
- package/dist/{coerce-input-BicYr7nc.js → coerce-input-DttlcSdO.js} +70 -58
- package/dist/coerce-input-DttlcSdO.js.map +1 -0
- package/dist/connections-D7cgXhDS.js +119 -0
- package/dist/connections-D7cgXhDS.js.map +1 -0
- package/dist/credentials-DaQU3Ca_.js +171 -0
- package/dist/credentials-DaQU3Ca_.js.map +1 -0
- package/dist/document-sources-UCwe8x77.js +91 -0
- package/dist/document-sources-UCwe8x77.js.map +1 -0
- package/dist/draft.mjs +1 -1
- package/dist/editor/BindingBanner.d.ts +13 -0
- package/dist/editor/CallableEditorFrame.d.ts +7 -0
- package/dist/editor/EndpointCards.d.ts +4 -1
- package/dist/editor/PublishControl.d.ts +19 -0
- package/dist/editor/TargetSelector.d.ts +15 -0
- package/dist/editor/TargetSelector.types.d.ts +2 -0
- package/dist/editor/definition.d.ts +2 -0
- package/dist/{editor-apps-BdenSV1o.js → editor-apps-BUZWld-m.js} +5 -5
- package/dist/{editor-apps-BdenSV1o.js.map → editor-apps-BUZWld-m.js.map} +1 -1
- package/dist/{editor-tools-RxmY5iyi.js → editor-tools-B_Lfx3kw.js} +11 -11
- package/dist/editor-tools-B_Lfx3kw.js.map +1 -0
- package/dist/editor.mjs +1 -1
- package/dist/editors.mjs +769 -622
- package/dist/editors.mjs.map +1 -1
- package/dist/{endpoints-B2ynbZo-.js → endpoints-DSRo1Lc5.js} +113 -107
- package/dist/endpoints-DSRo1Lc5.js.map +1 -0
- package/dist/fields-DvS8XZFc.js +21 -0
- package/dist/fields-DvS8XZFc.js.map +1 -0
- package/dist/forms/ModelBudgetsManager.d.ts +9 -0
- package/dist/forms/ModelRoutesManager.d.ts +14 -0
- package/dist/forms.d.ts +4 -0
- package/dist/forms.mjs +611 -212
- package/dist/forms.mjs.map +1 -1
- package/dist/index.mjs +119 -112
- package/dist/index.mjs.map +1 -1
- package/dist/lib/binding-problems.d.ts +38 -0
- package/dist/lib/code-rail.d.ts +4 -2
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/invoke-error.d.ts +1 -0
- package/dist/lib/sdk-snippets.d.ts +1 -1
- package/dist/lib/target-fields.d.ts +8 -0
- package/dist/lib/trigger-preview.d.ts +1 -0
- package/dist/lib/workflow-live-run.d.ts +9 -2
- package/dist/lib/workflow-nodes.d.ts +5 -0
- package/dist/lib/workflow-validity.d.ts +1 -0
- package/dist/lib.mjs +72 -70
- package/dist/lists/ConnectionDependents.d.ts +31 -0
- package/dist/lists/ConnectionDetail.d.ts +4 -1
- package/dist/lists/ConnectionList.d.ts +4 -1
- package/dist/lists/CredentialDetail.d.ts +15 -0
- package/dist/lists/CredentialList.d.ts +14 -0
- package/dist/lists/ModelCatalog.d.ts +12 -0
- package/dist/lists/ModelUsage.d.ts +12 -0
- package/dist/lists.d.ts +8 -0
- package/dist/lists.mjs +1322 -604
- package/dist/lists.mjs.map +1 -1
- package/dist/models-bAayQPJ_.js +270 -0
- package/dist/models-bAayQPJ_.js.map +1 -0
- package/dist/{project-context-BiCjv_E3.js → project-context-Tvp-La7A.js} +3 -3
- package/dist/{project-context-BiCjv_E3.js.map → project-context-Tvp-La7A.js.map} +1 -1
- package/dist/rail.mjs +4 -4
- package/dist/repos/agents-studio-agents.d.ts +52 -0
- package/dist/repos/agents-studio-assets.d.ts +68 -0
- package/dist/repos/connections.d.ts +30 -12
- package/dist/repos/credentials.d.ts +83 -0
- package/dist/repos/endpoints.d.ts +9 -3
- package/dist/repos/fields.d.ts +34 -0
- package/dist/repos/functions.d.ts +7 -5
- package/dist/repos/index.d.ts +5 -0
- package/dist/repos/models.d.ts +289 -0
- package/dist/repos.mjs +613 -176
- package/dist/repos.mjs.map +1 -1
- package/dist/{slug-C4ktDPdy.js → slug-BVdgiP_L.js} +64 -60
- package/dist/slug-BVdgiP_L.js.map +1 -0
- package/dist/{spec-export-Cf3VQSQS.js → spec-export-CBbloO_n.js} +7 -7
- package/dist/{spec-export-Cf3VQSQS.js.map → spec-export-CBbloO_n.js.map} +1 -1
- package/dist/{spec-import-CjmxyZDR.js → spec-import-CW6R_Wk1.js} +160 -156
- package/dist/spec-import-CW6R_Wk1.js.map +1 -0
- package/dist/theme-context-E2ZhlXDX.js +6 -0
- package/dist/theme-context-E2ZhlXDX.js.map +1 -0
- package/dist/theme-context.d.ts +2 -0
- package/dist/trigger-preview-DKxfjzUY.js +145 -0
- package/dist/trigger-preview-DKxfjzUY.js.map +1 -0
- package/dist/{use-callable-draft-zHLpcr-b.js → use-callable-draft-DsALnSfF.js} +22 -22
- package/dist/{use-callable-draft-zHLpcr-b.js.map → use-callable-draft-DsALnSfF.js.map} +1 -1
- package/dist/{workflow-blank-DyL3_RUA.js → workflow-blank-DFpGObrn.js} +6 -6
- package/dist/{workflow-blank-DyL3_RUA.js.map → workflow-blank-DFpGObrn.js.map} +1 -1
- package/package.json +1 -1
- package/src/styles.css +2 -6
- package/dist/WorkflowEditor-DlbVv6Fs.js +0 -854
- package/dist/WorkflowEditor-DlbVv6Fs.js.map +0 -1
- package/dist/coerce-input-BicYr7nc.js.map +0 -1
- package/dist/connections-CjjYeRqb.js +0 -78
- package/dist/connections-CjjYeRqb.js.map +0 -1
- package/dist/document-sources-C0grrtdq.js +0 -86
- package/dist/document-sources-C0grrtdq.js.map +0 -1
- package/dist/editor-tools-RxmY5iyi.js.map +0 -1
- package/dist/endpoints-B2ynbZo-.js.map +0 -1
- package/dist/slug-C4ktDPdy.js.map +0 -1
- package/dist/spec-import-CjmxyZDR.js.map +0 -1
- package/dist/trigger-preview-VPkrryDl.js +0 -120
- package/dist/trigger-preview-VPkrryDl.js.map +0 -1
package/dist/lists.mjs
CHANGED
|
@@ -1,42 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState 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 {
|
|
11
|
-
import { b as
|
|
12
|
-
import { f as
|
|
13
|
-
import { C as
|
|
14
|
-
import { D as
|
|
15
|
-
import { H as
|
|
16
|
-
import { ApiError as
|
|
17
|
-
import { useQueryClient as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
import { jsxs as l, jsx as t, Fragment as D } from "react/jsx-runtime";
|
|
3
|
+
import { useState as C, useMemo as K, useEffect as Oe } from "react";
|
|
4
|
+
import { F as qe, E as Fe } from "./CreateFunctionModal-D6CQLpa_.js";
|
|
5
|
+
import { d as Ke, f as Qe, h as Be, b as pe, n as ae, u as We, m as _e } from "./endpoints-DSRo1Lc5.js";
|
|
6
|
+
import { u as q, b as ie } from "./project-context-Tvp-La7A.js";
|
|
7
|
+
import { CallableList as He, ReliabilityList as Ue, EmptyState as se, DataTable as le, EditButton as fe, DeleteButton as Ve, ListItem as te, HealthStatusPill as Z, HistoryTimeline as Ye, useW6WApi as ge, connectionAppIdsToLookUp as Ne, ConnectionList as Ze, AddConnectionModal as Je, EditConnectionModal as ye, Modal as ze, resolveConnectionAppMeta as Ge, ConnectionHeader as Xe, IconButton as et } from "@w6w/ui";
|
|
8
|
+
import { I as tt } from "./ImportSpecModal-B7qd1Km2.js";
|
|
9
|
+
import { i as nt } from "./rail-settings-XYGToh00.js";
|
|
10
|
+
import { $ as at, Z as be, L as it, P as st, M as lt, E as rt } from "./spec-import-CW6R_Wk1.js";
|
|
11
|
+
import { b as ot } from "./workflow-blank-DFpGObrn.js";
|
|
12
|
+
import { f as ct, e as ce, g as dt, b as ut, h as mt, i as ht } from "./api-calls--JHyif6a.js";
|
|
13
|
+
import { C as wt, a as pt } from "./ConfirmModal-BE-SdX-O.js";
|
|
14
|
+
import { D as ft } from "./DocumentFormModal-YauVdolr.js";
|
|
15
|
+
import { H as gt, u as ve } from "./editor-apps-BUZWld-m.js";
|
|
16
|
+
import { ApiError as ke } from "@w6w/sdk";
|
|
17
|
+
import { useQueryClient as Ce, useInfiniteQuery as $e } from "@tanstack/react-query";
|
|
18
|
+
import { u as Nt, o as yt, k as Ie, c as ne, d as Te, m as bt, p as vt } from "./connections-D7cgXhDS.js";
|
|
19
|
+
import { M as kt } from "./ModelRoutesManager-BGESQahw.js";
|
|
20
|
+
import { h as Ct } from "./apps-CboASBKr.js";
|
|
21
|
+
import { u as Le } from "./client-context-CX61Bgw-.js";
|
|
22
|
+
import { p as $t, v as It, n as Tt, y as Lt } from "./models-bAayQPJ_.js";
|
|
23
|
+
import { n as Mt, m as Dt, k as xt, p as At, q as Rt, v as Et, o as jt } from "./credentials-DaQU3Ca_.js";
|
|
24
|
+
function re(e) {
|
|
25
|
+
const { kind: n } = e, i = Ke(n), [s, a] = C(!1), o = (e.rows ?? []).map((r) => ({
|
|
26
|
+
...e.toRow(r),
|
|
27
|
+
id: r.id,
|
|
28
|
+
archived: nt(r)
|
|
25
29
|
}));
|
|
26
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ l("div", { className: "w6w-embed-root", children: [
|
|
27
31
|
/* @__PURE__ */ t(
|
|
28
|
-
|
|
32
|
+
He,
|
|
29
33
|
{
|
|
30
|
-
rows:
|
|
31
|
-
title:
|
|
32
|
-
description:
|
|
33
|
-
emptyCopy:
|
|
34
|
-
newLabel:
|
|
35
|
-
openRowTitle:
|
|
34
|
+
rows: o,
|
|
35
|
+
title: i.listTitle,
|
|
36
|
+
description: i.listDescription,
|
|
37
|
+
emptyCopy: i.emptyCopy,
|
|
38
|
+
newLabel: i.newLabel,
|
|
39
|
+
openRowTitle: i.openRowTitle,
|
|
36
40
|
testIds: {
|
|
37
|
-
showArchived:
|
|
38
|
-
importOpen:
|
|
39
|
-
archivedBadge:
|
|
41
|
+
showArchived: i.showArchivedTestId,
|
|
42
|
+
importOpen: i.importOpenTestId,
|
|
43
|
+
archivedBadge: i.archivedBadgeTestId
|
|
40
44
|
},
|
|
41
45
|
loading: e.loading,
|
|
42
46
|
error: e.error,
|
|
@@ -48,15 +52,15 @@ function V(e) {
|
|
|
48
52
|
slots: e.slots
|
|
49
53
|
}
|
|
50
54
|
),
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
s && /* @__PURE__ */ t(
|
|
56
|
+
tt,
|
|
53
57
|
{
|
|
54
58
|
kind: n,
|
|
55
59
|
project: e.project ?? void 0,
|
|
56
|
-
listKeys: { functionsKey:
|
|
57
|
-
onOpenImported: (
|
|
60
|
+
listKeys: { functionsKey: Be, endpointsKey: Qe, workflowsKey: at },
|
|
61
|
+
onOpenImported: (r, c) => {
|
|
58
62
|
var h;
|
|
59
|
-
return (h = e.onOpen) == null ? void 0 : h.call(e,
|
|
63
|
+
return (h = e.onOpen) == null ? void 0 : h.call(e, c);
|
|
60
64
|
},
|
|
61
65
|
onClose: () => a(!1)
|
|
62
66
|
}
|
|
@@ -64,56 +68,56 @@ function V(e) {
|
|
|
64
68
|
e.children
|
|
65
69
|
] });
|
|
66
70
|
}
|
|
67
|
-
function
|
|
68
|
-
const n =
|
|
71
|
+
function Un(e) {
|
|
72
|
+
const n = pe(), i = q(e.project), [s, a] = C(null);
|
|
69
73
|
return /* @__PURE__ */ t(
|
|
70
|
-
|
|
74
|
+
re,
|
|
71
75
|
{
|
|
72
76
|
kind: "function",
|
|
73
77
|
rows: n.data,
|
|
74
78
|
loading: n.isLoading,
|
|
75
79
|
error: n.error ? String(n.error) : null,
|
|
76
|
-
project:
|
|
77
|
-
toRow: (
|
|
78
|
-
title:
|
|
79
|
-
description:
|
|
80
|
-
badges:
|
|
80
|
+
project: i,
|
|
81
|
+
toRow: (o) => ({
|
|
82
|
+
title: o.displayName || o.key,
|
|
83
|
+
description: o.description,
|
|
84
|
+
badges: o.valid ? null : /* @__PURE__ */ t("span", { className: "w6w-callable-list-badge", children: "incomplete" })
|
|
81
85
|
}),
|
|
82
86
|
onOpen: e.onOpen,
|
|
83
87
|
getHref: e.getHref,
|
|
84
|
-
onCreate: () => a(
|
|
88
|
+
onCreate: () => a(ae("function")),
|
|
85
89
|
slots: e.slots,
|
|
86
|
-
children:
|
|
87
|
-
|
|
90
|
+
children: s !== null && /* @__PURE__ */ t(
|
|
91
|
+
qe,
|
|
88
92
|
{
|
|
89
|
-
newId:
|
|
90
|
-
takenKeys: (n.data ?? []).map((
|
|
93
|
+
newId: s,
|
|
94
|
+
takenKeys: (n.data ?? []).map((o) => o.key),
|
|
91
95
|
onClose: () => a(null),
|
|
92
|
-
onCreated: (
|
|
93
|
-
var
|
|
94
|
-
a(null), (
|
|
96
|
+
onCreated: (o) => {
|
|
97
|
+
var r;
|
|
98
|
+
a(null), (r = e.onCreated) == null || r.call(e, o);
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
)
|
|
98
102
|
}
|
|
99
103
|
);
|
|
100
104
|
}
|
|
101
|
-
function
|
|
102
|
-
const n =
|
|
105
|
+
function Vn(e) {
|
|
106
|
+
const n = We(), i = q(e.project), [s, a] = C(null);
|
|
103
107
|
return /* @__PURE__ */ t(
|
|
104
|
-
|
|
108
|
+
re,
|
|
105
109
|
{
|
|
106
110
|
kind: "endpoint",
|
|
107
111
|
rows: n.data,
|
|
108
112
|
loading: n.isLoading,
|
|
109
113
|
error: n.error ? String(n.error) : null,
|
|
110
|
-
project:
|
|
111
|
-
toRow: (
|
|
114
|
+
project: i,
|
|
115
|
+
toRow: (o) => ({
|
|
112
116
|
// The draft tag sits INSIDE the title, after the name: ui `ListItem` puts `badges` in
|
|
113
117
|
// a trailing `margin-left: auto` slot, which would strand it at the row's far edge.
|
|
114
|
-
title: /* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */ t("strong", { children:
|
|
116
|
-
|
|
118
|
+
title: /* @__PURE__ */ l(D, { children: [
|
|
119
|
+
/* @__PURE__ */ t("strong", { children: o.displayName || o.key }),
|
|
120
|
+
_e(o) ? /* @__PURE__ */ t(
|
|
117
121
|
"span",
|
|
118
122
|
{
|
|
119
123
|
className: "tag warn",
|
|
@@ -123,221 +127,232 @@ function Jt(e) {
|
|
|
123
127
|
}
|
|
124
128
|
) : null
|
|
125
129
|
] }),
|
|
126
|
-
description:
|
|
130
|
+
description: o.description
|
|
127
131
|
}),
|
|
128
132
|
onOpen: e.onOpen,
|
|
129
133
|
getHref: e.getHref,
|
|
130
|
-
onCreate: () => a(
|
|
134
|
+
onCreate: () => a(ae("endpoint")),
|
|
131
135
|
slots: e.slots,
|
|
132
|
-
children:
|
|
133
|
-
|
|
136
|
+
children: s !== null && /* @__PURE__ */ t(
|
|
137
|
+
Fe,
|
|
134
138
|
{
|
|
135
|
-
newId:
|
|
136
|
-
takenKeys: (n.data ?? []).map((
|
|
139
|
+
newId: s,
|
|
140
|
+
takenKeys: (n.data ?? []).map((o) => o.key),
|
|
137
141
|
onClose: () => a(null),
|
|
138
|
-
onCreated: (
|
|
139
|
-
var
|
|
140
|
-
a(null), (
|
|
142
|
+
onCreated: (o) => {
|
|
143
|
+
var r;
|
|
144
|
+
a(null), (r = e.onCreated) == null || r.call(e, o);
|
|
141
145
|
}
|
|
142
146
|
}
|
|
143
147
|
)
|
|
144
148
|
}
|
|
145
149
|
);
|
|
146
150
|
}
|
|
147
|
-
function
|
|
148
|
-
const n =
|
|
151
|
+
function Yn(e) {
|
|
152
|
+
const n = q(e.project), i = be(n ?? void 0, n != null), s = it(n ?? void 0), [a, o] = C(null);
|
|
149
153
|
return /* @__PURE__ */ t(
|
|
150
|
-
|
|
154
|
+
re,
|
|
151
155
|
{
|
|
152
156
|
kind: "workflow",
|
|
153
|
-
rows:
|
|
154
|
-
loading:
|
|
155
|
-
error: a ?? (
|
|
157
|
+
rows: i.data,
|
|
158
|
+
loading: i.isLoading,
|
|
159
|
+
error: a ?? (i.error ? String(i.error) : null),
|
|
156
160
|
project: n,
|
|
157
|
-
toRow: (
|
|
158
|
-
title:
|
|
159
|
-
description:
|
|
160
|
-
badges: /* @__PURE__ */
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
toRow: (r) => ({
|
|
162
|
+
title: r.displayName || r.name,
|
|
163
|
+
description: r.description,
|
|
164
|
+
badges: /* @__PURE__ */ l(D, { children: [
|
|
165
|
+
r.tags.length > 0 && /* @__PURE__ */ t("span", { className: "wf-row-tags", children: r.tags.map((c) => /* @__PURE__ */ t("span", { className: "tag", children: c }, c)) }),
|
|
166
|
+
r.status !== "archived" && /* @__PURE__ */ t("span", { className: `badge wf-status ${r.status}`, children: r.status })
|
|
163
167
|
] }),
|
|
164
|
-
trailing: /* @__PURE__ */
|
|
165
|
-
|
|
168
|
+
trailing: /* @__PURE__ */ l("span", { className: "wf-col wf-col-stats muted small", children: [
|
|
169
|
+
r.runCount,
|
|
166
170
|
" ",
|
|
167
|
-
|
|
171
|
+
r.runCount === 1 ? "run" : "runs"
|
|
168
172
|
] })
|
|
169
173
|
}),
|
|
170
174
|
onOpen: e.onOpen,
|
|
171
175
|
getHref: e.getHref,
|
|
172
176
|
onCreate: () => {
|
|
173
|
-
|
|
174
|
-
onSuccess: (
|
|
175
|
-
var
|
|
176
|
-
return (
|
|
177
|
+
o(null), s.mutate(ot(ae("workflow")), {
|
|
178
|
+
onSuccess: (r) => {
|
|
179
|
+
var c;
|
|
180
|
+
return (c = e.onCreated) == null ? void 0 : c.call(e, r.workflow.id);
|
|
177
181
|
},
|
|
178
|
-
onError: (
|
|
182
|
+
onError: (r) => o(r instanceof Error ? r.message : String(r))
|
|
179
183
|
});
|
|
180
184
|
},
|
|
181
|
-
creating:
|
|
185
|
+
creating: s.isPending,
|
|
182
186
|
slots: e.slots
|
|
183
187
|
}
|
|
184
188
|
);
|
|
185
189
|
}
|
|
186
|
-
function
|
|
190
|
+
function Zn({
|
|
187
191
|
project: e,
|
|
188
192
|
variant: n = "full",
|
|
189
|
-
limit:
|
|
190
|
-
days:
|
|
193
|
+
limit: i,
|
|
194
|
+
days: s = 30,
|
|
191
195
|
showChart: a,
|
|
192
|
-
getHref:
|
|
193
|
-
onOpen:
|
|
194
|
-
showAllHref:
|
|
196
|
+
getHref: o,
|
|
197
|
+
onOpen: r,
|
|
198
|
+
showAllHref: c,
|
|
195
199
|
onShowAll: h,
|
|
196
|
-
slots:
|
|
200
|
+
slots: w
|
|
197
201
|
}) {
|
|
198
|
-
var
|
|
199
|
-
const
|
|
200
|
-
let
|
|
201
|
-
return
|
|
202
|
-
|
|
202
|
+
var g, m;
|
|
203
|
+
const N = ie().project, d = e === void 0 ? N : e, y = d || null, k = ct(y ?? void 0, s);
|
|
204
|
+
let b = w == null ? void 0 : w.empty;
|
|
205
|
+
return y ? k.isLoading ? b = /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) : k.error && (b = /* @__PURE__ */ t("div", { className: "error", children: k.error.message })) : b = /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see its reliability." }), /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ t(
|
|
206
|
+
Ue,
|
|
203
207
|
{
|
|
204
|
-
services:
|
|
205
|
-
window:
|
|
206
|
-
days:
|
|
208
|
+
services: y ? ((g = k.data) == null ? void 0 : g.services) ?? [] : [],
|
|
209
|
+
window: y ? (m = k.data) == null ? void 0 : m.window : void 0,
|
|
210
|
+
days: s,
|
|
207
211
|
compact: n === "compact",
|
|
208
212
|
showChart: a,
|
|
209
|
-
limit:
|
|
210
|
-
getHref:
|
|
211
|
-
onOpen:
|
|
212
|
-
showAllHref:
|
|
213
|
+
limit: i,
|
|
214
|
+
getHref: o,
|
|
215
|
+
onOpen: r,
|
|
216
|
+
showAllHref: c,
|
|
213
217
|
onShowAll: h,
|
|
214
|
-
slots: { ...
|
|
218
|
+
slots: { ...w, empty: b }
|
|
215
219
|
}
|
|
216
220
|
) });
|
|
217
221
|
}
|
|
218
|
-
function
|
|
222
|
+
function St(e) {
|
|
219
223
|
const n = e.replace(/\s+/g, " ").trim();
|
|
220
224
|
return n.length > 80 ? `${n.slice(0, 80)}…` : n;
|
|
221
225
|
}
|
|
222
|
-
function
|
|
223
|
-
var
|
|
224
|
-
const
|
|
226
|
+
function Jn({ project: e, onOpen: n, getHref: i, slots: s, rowSlots: a }) {
|
|
227
|
+
var g;
|
|
228
|
+
const o = q(e), r = st(o ?? void 0, o != null), c = lt(), [h, w] = C(null), [N, d] = C(null), y = (s == null ? void 0 : s.header) === void 0 ? /* @__PURE__ */ l("div", { children: [
|
|
225
229
|
/* @__PURE__ */ t("h3", { children: "Documents" }),
|
|
226
230
|
/* @__PURE__ */ t("p", { className: "muted small", children: "Each document is free-form content stored verbatim." })
|
|
227
|
-
] }) :
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
/* @__PURE__ */ o(
|
|
251
|
-
"div",
|
|
252
|
-
{
|
|
253
|
-
className: "list-main",
|
|
254
|
-
style: { marginLeft: N != null ? "var(--w6w-sp-2)" : 0 },
|
|
255
|
-
children: [
|
|
256
|
-
/* @__PURE__ */ t("strong", { className: "list-name", title: d.key, children: d.key }),
|
|
257
|
-
" ",
|
|
258
|
-
/* @__PURE__ */ t("span", { className: "tag", children: d.format }),
|
|
259
|
-
/* @__PURE__ */ o("div", { className: "muted small list-preview", children: [
|
|
260
|
-
/* @__PURE__ */ t("code", { children: st(d.content) }),
|
|
261
|
-
d.description && /* @__PURE__ */ o(T, { children: [
|
|
262
|
-
" · ",
|
|
263
|
-
d.description
|
|
264
|
-
] })
|
|
231
|
+
] }) : s.header, k = (s == null ? void 0 : s.empty) === void 0 ? /* @__PURE__ */ t(se, { testId: "document-list-empty", children: "No documents yet." }) : s.empty, b = [
|
|
232
|
+
{
|
|
233
|
+
key: "key",
|
|
234
|
+
header: "Document",
|
|
235
|
+
render: (m) => {
|
|
236
|
+
var T;
|
|
237
|
+
const p = (T = a == null ? void 0 : a.lead) == null ? void 0 : T.call(a, m);
|
|
238
|
+
return /* @__PURE__ */ l("span", { style: { display: "flex", alignItems: "center" }, children: [
|
|
239
|
+
p,
|
|
240
|
+
/* @__PURE__ */ l(
|
|
241
|
+
"span",
|
|
242
|
+
{
|
|
243
|
+
className: "list-main",
|
|
244
|
+
style: { marginLeft: p != null ? "var(--w6w-sp-2)" : 0 },
|
|
245
|
+
children: [
|
|
246
|
+
/* @__PURE__ */ t("strong", { className: "list-name", title: m.key, children: m.key }),
|
|
247
|
+
" ",
|
|
248
|
+
/* @__PURE__ */ t("span", { className: "tag", children: m.format }),
|
|
249
|
+
/* @__PURE__ */ l("div", { className: "muted small list-preview", children: [
|
|
250
|
+
/* @__PURE__ */ t("code", { children: St(m.content) }),
|
|
251
|
+
m.description && /* @__PURE__ */ l(D, { children: [
|
|
252
|
+
" · ",
|
|
253
|
+
m.description
|
|
265
254
|
] })
|
|
266
|
-
]
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
),
|
|
290
|
-
/* @__PURE__ */ o("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)" }, children: [
|
|
291
|
-
/* @__PURE__ */ t(ze, { resource: { kind: "document", key: d.key } }),
|
|
292
|
-
d.shared ? (R = a == null ? void 0 : a.sharedActions) == null ? void 0 : R.call(a, d) : /* @__PURE__ */ o(T, { children: [
|
|
255
|
+
] })
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
)
|
|
259
|
+
] });
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
key: "actions",
|
|
264
|
+
header: "",
|
|
265
|
+
align: "right",
|
|
266
|
+
link: !1,
|
|
267
|
+
render: (m) => {
|
|
268
|
+
var T, x;
|
|
269
|
+
const p = (T = a == null ? void 0 : a.footer) == null ? void 0 : T.call(a, m);
|
|
270
|
+
return (
|
|
271
|
+
// Clicks here must not reach the row's onOpen.
|
|
272
|
+
// biome-ignore lint/a11y/useKeyWithClickEvents: propagation guard only; the buttons inside are the controls.
|
|
273
|
+
/* @__PURE__ */ l("div", { onClick: (v) => v.stopPropagation(), children: [
|
|
274
|
+
/* @__PURE__ */ l("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)", justifyContent: "flex-end" }, children: [
|
|
275
|
+
/* @__PURE__ */ t(pt, { resource: { kind: "document", key: m.key } }),
|
|
276
|
+
m.shared ? (x = a == null ? void 0 : a.sharedActions) == null ? void 0 : x.call(a, m) : /* @__PURE__ */ l(D, { children: [
|
|
293
277
|
/* @__PURE__ */ t(
|
|
294
|
-
|
|
278
|
+
fe,
|
|
295
279
|
{
|
|
296
280
|
label: "Edit",
|
|
297
|
-
onClick: () =>
|
|
298
|
-
"data-testid": `document-edit-${
|
|
281
|
+
onClick: () => w({ mode: "edit", d: m }),
|
|
282
|
+
"data-testid": `document-edit-${m.id}`
|
|
299
283
|
}
|
|
300
284
|
),
|
|
301
285
|
/* @__PURE__ */ t(
|
|
302
|
-
|
|
286
|
+
Ve,
|
|
303
287
|
{
|
|
304
288
|
label: "Delete",
|
|
305
|
-
onClick: () => m
|
|
306
|
-
disabled:
|
|
307
|
-
"data-testid": `document-delete-${
|
|
289
|
+
onClick: () => d(m),
|
|
290
|
+
disabled: c.isPending,
|
|
291
|
+
"data-testid": `document-delete-${m.id}`
|
|
308
292
|
}
|
|
309
293
|
)
|
|
310
294
|
] })
|
|
311
295
|
] }),
|
|
312
|
-
|
|
313
|
-
] }
|
|
314
|
-
|
|
296
|
+
p != null && /* @__PURE__ */ t("div", { className: "w6w-doc-footer", children: p })
|
|
297
|
+
] })
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
];
|
|
302
|
+
return /* @__PURE__ */ l("div", { className: "w6w-embed-root", children: [
|
|
303
|
+
/* @__PURE__ */ l("section", { className: "section", children: [
|
|
304
|
+
/* @__PURE__ */ l("div", { className: "section-head", children: [
|
|
305
|
+
y,
|
|
306
|
+
/* @__PURE__ */ t(
|
|
307
|
+
"button",
|
|
308
|
+
{
|
|
309
|
+
type: "button",
|
|
310
|
+
className: "btn",
|
|
311
|
+
disabled: o == null,
|
|
312
|
+
onClick: () => w({ mode: "create" }),
|
|
313
|
+
children: "+ Add document"
|
|
314
|
+
}
|
|
315
|
+
)
|
|
316
|
+
] }),
|
|
317
|
+
/* @__PURE__ */ l("div", { className: "card", children: [
|
|
318
|
+
r.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
|
|
319
|
+
((g = r.data) == null ? void 0 : g.length) === 0 && k,
|
|
320
|
+
r.data != null && r.data.length > 0 && /* @__PURE__ */ t(
|
|
321
|
+
le,
|
|
322
|
+
{
|
|
323
|
+
columns: b,
|
|
324
|
+
rows: r.data,
|
|
325
|
+
rowKey: (m) => m.id,
|
|
326
|
+
getRowHref: i ? (m) => i(m.id) : void 0,
|
|
327
|
+
onRowClick: n ? (m, p) => n(m.id, p) : void 0
|
|
328
|
+
}
|
|
329
|
+
)
|
|
315
330
|
] })
|
|
316
331
|
] }),
|
|
317
332
|
h && /* @__PURE__ */ t(
|
|
318
|
-
|
|
333
|
+
ft,
|
|
319
334
|
{
|
|
320
335
|
initial: h.mode === "edit" ? h.d : void 0,
|
|
321
|
-
project:
|
|
322
|
-
onClose: () =>
|
|
323
|
-
onSaved: () =>
|
|
336
|
+
project: o,
|
|
337
|
+
onClose: () => w(null),
|
|
338
|
+
onSaved: () => w(null)
|
|
324
339
|
}
|
|
325
340
|
),
|
|
326
|
-
|
|
327
|
-
|
|
341
|
+
N && /* @__PURE__ */ t(
|
|
342
|
+
wt,
|
|
328
343
|
{
|
|
329
344
|
title: "Delete document",
|
|
330
|
-
message: `Delete the document "${
|
|
345
|
+
message: `Delete the document "${N.key}"? This cannot be undone.`,
|
|
331
346
|
confirmLabel: "Delete",
|
|
332
347
|
onConfirm: () => {
|
|
333
|
-
|
|
348
|
+
o != null && c.mutate({ id: N.id, project: o }), d(null);
|
|
334
349
|
},
|
|
335
|
-
onClose: () =>
|
|
350
|
+
onClose: () => d(null)
|
|
336
351
|
}
|
|
337
352
|
)
|
|
338
353
|
] });
|
|
339
354
|
}
|
|
340
|
-
const
|
|
355
|
+
const Pt = {
|
|
341
356
|
workflow: "Workflow run",
|
|
342
357
|
workflow_step: "Workflow step",
|
|
343
358
|
connection_test: "Connection test",
|
|
@@ -348,10 +363,10 @@ const lt = {
|
|
|
348
363
|
endpoint: "Endpoint call",
|
|
349
364
|
action: "App action"
|
|
350
365
|
};
|
|
351
|
-
function
|
|
352
|
-
return
|
|
366
|
+
function J(e) {
|
|
367
|
+
return Pt[e] ?? e;
|
|
353
368
|
}
|
|
354
|
-
const
|
|
369
|
+
const Me = {
|
|
355
370
|
workflow: "workflow",
|
|
356
371
|
workflow_step: "workflow_step",
|
|
357
372
|
connection_test: "base",
|
|
@@ -360,201 +375,201 @@ const me = {
|
|
|
360
375
|
endpoint: "base",
|
|
361
376
|
action: "base"
|
|
362
377
|
};
|
|
363
|
-
function
|
|
364
|
-
return Object.hasOwn(
|
|
378
|
+
function Ot(e) {
|
|
379
|
+
return Object.hasOwn(Me, e);
|
|
365
380
|
}
|
|
366
|
-
function
|
|
367
|
-
return
|
|
381
|
+
function De(e) {
|
|
382
|
+
return Ot(e) ? Me[e] : "base";
|
|
368
383
|
}
|
|
369
|
-
function
|
|
370
|
-
const
|
|
384
|
+
function qt(e, n) {
|
|
385
|
+
const i = /* @__PURE__ */ new Map();
|
|
371
386
|
for (const a of e ?? []) {
|
|
372
|
-
const
|
|
373
|
-
|
|
387
|
+
const o = a.displayName || a.key;
|
|
388
|
+
o && i.set(a.id, o);
|
|
374
389
|
}
|
|
375
|
-
const
|
|
390
|
+
const s = /* @__PURE__ */ new Map();
|
|
376
391
|
for (const a of n ?? []) {
|
|
377
|
-
const
|
|
378
|
-
|
|
392
|
+
const o = a.displayName || a.name;
|
|
393
|
+
o && s.set(a.id, o);
|
|
379
394
|
}
|
|
380
|
-
return { functions:
|
|
395
|
+
return { functions: i, workflows: s };
|
|
381
396
|
}
|
|
382
|
-
function
|
|
383
|
-
const
|
|
384
|
-
if (
|
|
397
|
+
function Ft(e, n) {
|
|
398
|
+
const i = e.summary ?? J(e.kind), s = De(e.kind);
|
|
399
|
+
if (s === "function" && e.functionId !== null) {
|
|
385
400
|
const a = n.functions.get(e.functionId);
|
|
386
401
|
if (a !== void 0)
|
|
387
402
|
return { text: a, target: { kind: "function", id: e.functionId } };
|
|
388
403
|
}
|
|
389
|
-
if (
|
|
404
|
+
if (s === "workflow" && e.workflowId !== null) {
|
|
390
405
|
const a = n.workflows.get(e.workflowId);
|
|
391
406
|
if (a !== void 0)
|
|
392
407
|
return { text: a, target: { kind: "workflow", id: e.workflowId } };
|
|
393
408
|
}
|
|
394
|
-
if (
|
|
395
|
-
const a = e.workflowId,
|
|
409
|
+
if (s === "workflow_step") {
|
|
410
|
+
const a = e.workflowId, o = a !== null ? n.workflows.get(a) : void 0, r = o ?? a ?? e.summary ?? "Unknown workflow", c = o !== void 0 && a !== null;
|
|
396
411
|
return {
|
|
397
|
-
text: e.stepId ? `${
|
|
398
|
-
target:
|
|
412
|
+
text: e.stepId ? `${r} - ${e.stepId}` : r,
|
|
413
|
+
target: c ? { kind: "workflow", id: a } : null
|
|
399
414
|
};
|
|
400
415
|
}
|
|
401
|
-
return { text:
|
|
416
|
+
return { text: i, target: null };
|
|
402
417
|
}
|
|
403
|
-
const
|
|
404
|
-
function
|
|
418
|
+
const _ = (e) => String(e).padStart(2, "0");
|
|
419
|
+
function xe(e) {
|
|
405
420
|
const n = new Date(e);
|
|
406
|
-
return Number.isNaN(n.getTime()) ? e : `${`${n.getFullYear()}-${
|
|
421
|
+
return Number.isNaN(n.getTime()) ? e : `${`${n.getFullYear()}-${_(n.getMonth() + 1)}-${_(n.getDate())}`} ${_(n.getHours())}:${_(n.getMinutes())}:${_(n.getSeconds())}`;
|
|
407
422
|
}
|
|
408
|
-
function
|
|
423
|
+
function Ae(e) {
|
|
409
424
|
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`;
|
|
410
425
|
}
|
|
411
|
-
function
|
|
426
|
+
function Kt() {
|
|
412
427
|
const e = /* @__PURE__ */ new Date();
|
|
413
428
|
return e.setHours(0, 0, 0, 0), e.toISOString();
|
|
414
429
|
}
|
|
415
|
-
function
|
|
416
|
-
const
|
|
417
|
-
if (Number.isNaN(
|
|
418
|
-
const
|
|
419
|
-
return n === "week" ? `Week of ${
|
|
430
|
+
function Qt(e, n) {
|
|
431
|
+
const i = new Date(e);
|
|
432
|
+
if (Number.isNaN(i.getTime())) return e;
|
|
433
|
+
const s = i.toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
434
|
+
return n === "week" ? `Week of ${s}` : s;
|
|
420
435
|
}
|
|
421
|
-
function
|
|
436
|
+
function Re({ ok: e }) {
|
|
422
437
|
return e === null ? /* @__PURE__ */ t("span", { className: "muted", children: "–" }) : /* @__PURE__ */ t("span", { className: e ? "ok" : "error", children: e ? "✓" : "✗" });
|
|
423
438
|
}
|
|
424
|
-
function
|
|
425
|
-
return /* @__PURE__ */
|
|
439
|
+
function G({ label: e, value: n }) {
|
|
440
|
+
return /* @__PURE__ */ l("div", { className: "w6w-activity-card w6w-activity-stat", children: [
|
|
426
441
|
/* @__PURE__ */ t("div", { className: "w6w-activity-stat-value", children: n }),
|
|
427
442
|
/* @__PURE__ */ t("div", { className: "muted small", children: e })
|
|
428
443
|
] });
|
|
429
444
|
}
|
|
430
|
-
function
|
|
445
|
+
function de({
|
|
431
446
|
title: e,
|
|
432
447
|
headline: n,
|
|
433
|
-
loading:
|
|
448
|
+
loading: i
|
|
434
449
|
}) {
|
|
435
|
-
const
|
|
436
|
-
return /* @__PURE__ */
|
|
450
|
+
const s = n ?? { workflowRuns: 0, succeeded: 0, failed: 0 };
|
|
451
|
+
return /* @__PURE__ */ l("section", { className: "w6w-activity-section", children: [
|
|
437
452
|
/* @__PURE__ */ t("h3", { children: e }),
|
|
438
|
-
|
|
439
|
-
/* @__PURE__ */ t(
|
|
440
|
-
/* @__PURE__ */ t(
|
|
441
|
-
/* @__PURE__ */ t(
|
|
453
|
+
i ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : /* @__PURE__ */ l("div", { className: "w6w-activity-stats", children: [
|
|
454
|
+
/* @__PURE__ */ t(G, { label: "Workflow runs", value: s.workflowRuns }),
|
|
455
|
+
/* @__PURE__ */ t(G, { label: "Succeeded", value: s.succeeded }),
|
|
456
|
+
/* @__PURE__ */ t(G, { label: "Failed", value: s.failed })
|
|
442
457
|
] })
|
|
443
458
|
] });
|
|
444
459
|
}
|
|
445
|
-
function
|
|
460
|
+
function Bt({
|
|
446
461
|
entry: e,
|
|
447
462
|
names: n,
|
|
448
|
-
getHref:
|
|
449
|
-
onOpen:
|
|
463
|
+
getHref: i,
|
|
464
|
+
onOpen: s
|
|
450
465
|
}) {
|
|
451
|
-
const { text: a, target:
|
|
452
|
-
if (
|
|
453
|
-
const
|
|
454
|
-
return
|
|
466
|
+
const { text: a, target: o } = Ft(e, n);
|
|
467
|
+
if (o === null) return /* @__PURE__ */ t(D, { children: a });
|
|
468
|
+
const r = s ? (c) => s(o, c) : void 0;
|
|
469
|
+
return i ? /* @__PURE__ */ t("a", { href: i(o), onClick: r, children: a }) : r ? /* @__PURE__ */ t("button", { type: "button", className: "w6w-activity-link", onClick: r, children: a }) : /* @__PURE__ */ t(D, { children: a });
|
|
455
470
|
}
|
|
456
|
-
function
|
|
457
|
-
const
|
|
471
|
+
function Ee({ entry: e, title: n }) {
|
|
472
|
+
const i = Ae(e.durationMs);
|
|
458
473
|
return /* @__PURE__ */ t(
|
|
459
|
-
|
|
474
|
+
te,
|
|
460
475
|
{
|
|
461
|
-
icon: /* @__PURE__ */ t(
|
|
462
|
-
title: n ?? e.summary ??
|
|
463
|
-
subtitle: `${
|
|
464
|
-
trailing:
|
|
476
|
+
icon: /* @__PURE__ */ t(Re, { ok: e.ok }),
|
|
477
|
+
title: n ?? e.summary ?? J(e.kind),
|
|
478
|
+
subtitle: `${J(e.kind)} · ${xe(e.occurredAt)}`,
|
|
479
|
+
trailing: i === null ? void 0 : /* @__PURE__ */ t("span", { className: "muted small", children: i })
|
|
465
480
|
}
|
|
466
481
|
);
|
|
467
482
|
}
|
|
468
|
-
function
|
|
469
|
-
return /* @__PURE__ */ t(
|
|
483
|
+
function X(e) {
|
|
484
|
+
return /* @__PURE__ */ t(Ee, { entry: e.entry, title: /* @__PURE__ */ t(Bt, { ...e }) });
|
|
470
485
|
}
|
|
471
|
-
const
|
|
472
|
-
base: (e) => /* @__PURE__ */ t(
|
|
473
|
-
function:
|
|
474
|
-
workflow:
|
|
475
|
-
workflow_step:
|
|
486
|
+
const Wt = {
|
|
487
|
+
base: (e) => /* @__PURE__ */ t(Ee, { entry: e.entry }),
|
|
488
|
+
function: X,
|
|
489
|
+
workflow: X,
|
|
490
|
+
workflow_step: X
|
|
476
491
|
};
|
|
477
|
-
function
|
|
478
|
-
const n =
|
|
492
|
+
function _t(e) {
|
|
493
|
+
const n = Wt[De(e.entry.kind)];
|
|
479
494
|
return /* @__PURE__ */ t(n, { ...e });
|
|
480
495
|
}
|
|
481
|
-
function
|
|
482
|
-
var
|
|
483
|
-
const
|
|
484
|
-
() =>
|
|
485
|
-
[
|
|
486
|
-
), h =
|
|
487
|
-
return /* @__PURE__ */
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
496
|
+
function zn({ getHref: e, onOpen: n, slots: i }) {
|
|
497
|
+
var b, g, m, p, T, x;
|
|
498
|
+
const s = ce("today", { from: Kt(), bucket: "day" }), a = ce("week", { bucket: "week" }), o = pe(), r = be(), c = K(
|
|
499
|
+
() => qt(o.data, r.data),
|
|
500
|
+
[o.data, r.data]
|
|
501
|
+
), h = s.error ?? a.error, w = h ? h.message : null, N = ((b = a.data) == null ? void 0 : b.recent) ?? [], d = ((g = a.data) == null ? void 0 : g.series) ?? [], y = ((m = a.data) == null ? void 0 : m.range.bucket) ?? "week", k = !a.isLoading && N.length === 0 && (((p = a.data) == null ? void 0 : p.headline.workflowRuns) ?? 0) === 0;
|
|
502
|
+
return /* @__PURE__ */ l("div", { className: "w6w-embed-root", children: [
|
|
503
|
+
w && /* @__PURE__ */ t("div", { className: "error", children: w }),
|
|
504
|
+
i == null ? void 0 : i.header,
|
|
505
|
+
i == null ? void 0 : i.actions,
|
|
491
506
|
/* @__PURE__ */ t(
|
|
492
|
-
|
|
507
|
+
de,
|
|
493
508
|
{
|
|
494
509
|
title: "Today",
|
|
495
|
-
headline: (
|
|
496
|
-
loading:
|
|
510
|
+
headline: (T = s.data) == null ? void 0 : T.headline,
|
|
511
|
+
loading: s.isLoading
|
|
497
512
|
}
|
|
498
513
|
),
|
|
499
514
|
/* @__PURE__ */ t(
|
|
500
|
-
|
|
515
|
+
de,
|
|
501
516
|
{
|
|
502
517
|
title: "Last 7 days",
|
|
503
|
-
headline: (
|
|
518
|
+
headline: (x = a.data) == null ? void 0 : x.headline,
|
|
504
519
|
loading: a.isLoading
|
|
505
520
|
}
|
|
506
521
|
),
|
|
507
|
-
|
|
508
|
-
/* @__PURE__ */
|
|
522
|
+
i == null ? void 0 : i.betweenHeadlineAndSeries,
|
|
523
|
+
/* @__PURE__ */ l("section", { className: "w6w-activity-section", children: [
|
|
509
524
|
/* @__PURE__ */ t("h3", { children: "Activity over time" }),
|
|
510
|
-
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children: a.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) :
|
|
511
|
-
/* @__PURE__ */
|
|
512
|
-
/* @__PURE__ */ t("strong", { children:
|
|
525
|
+
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children: a.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : d.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No activity in this window yet." }) : /* @__PURE__ */ t("ul", { className: "list", children: d.map((v) => /* @__PURE__ */ l("li", { children: [
|
|
526
|
+
/* @__PURE__ */ l("span", { className: "list-main", children: [
|
|
527
|
+
/* @__PURE__ */ t("strong", { children: Qt(v.bucket, y) }),
|
|
513
528
|
" ",
|
|
514
|
-
/* @__PURE__ */ t("span", { className: "muted small", children:
|
|
529
|
+
/* @__PURE__ */ t("span", { className: "muted small", children: J(v.kind) })
|
|
515
530
|
] }),
|
|
516
531
|
" ",
|
|
517
|
-
/* @__PURE__ */ t(
|
|
532
|
+
/* @__PURE__ */ t(Re, { ok: v.ok }),
|
|
518
533
|
" ",
|
|
519
|
-
/* @__PURE__ */ t("span", { className: "muted small", children:
|
|
520
|
-
] }, `${
|
|
534
|
+
/* @__PURE__ */ t("span", { className: "muted small", children: v.count })
|
|
535
|
+
] }, `${v.bucket}-${v.kind}-${String(v.ok)}`)) }) })
|
|
521
536
|
] }),
|
|
522
|
-
/* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ l("section", { children: [
|
|
523
538
|
/* @__PURE__ */ t("h3", { className: "w6w-activity-h3", children: "Recent activity" }),
|
|
524
|
-
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children: a.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) :
|
|
525
|
-
|
|
539
|
+
/* @__PURE__ */ t("div", { className: "w6w-activity-card", children: a.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : k ? (i == null ? void 0 : i.empty) ?? /* @__PURE__ */ t("p", { className: "muted", children: "No runs yet — activity shows up here once your workflows run." }) : N.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No recent activity in this window." }) : /* @__PURE__ */ t("div", { className: "list", children: N.map((v) => /* @__PURE__ */ t(
|
|
540
|
+
_t,
|
|
526
541
|
{
|
|
527
|
-
entry:
|
|
528
|
-
names:
|
|
542
|
+
entry: v,
|
|
543
|
+
names: c,
|
|
529
544
|
getHref: e,
|
|
530
545
|
onOpen: n
|
|
531
546
|
},
|
|
532
|
-
|
|
547
|
+
v.id
|
|
533
548
|
)) }) })
|
|
534
549
|
] })
|
|
535
550
|
] });
|
|
536
551
|
}
|
|
537
|
-
function
|
|
552
|
+
function Ht(e) {
|
|
538
553
|
return e !== null && "project" in e;
|
|
539
554
|
}
|
|
540
|
-
function
|
|
541
|
-
const n =
|
|
542
|
-
var
|
|
543
|
-
|
|
555
|
+
function Gn(e) {
|
|
556
|
+
const n = ie().project, [i, s] = C(rt), a = e.scope !== void 0 ? e.scope : n ? { project: n } : null, o = e.filters !== void 0, r = e.filters ?? i, c = (h) => {
|
|
557
|
+
var w;
|
|
558
|
+
o || s(h), (w = e.onFiltersChange) == null || w.call(e, h);
|
|
544
559
|
};
|
|
545
560
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ t(
|
|
546
|
-
|
|
561
|
+
gt,
|
|
547
562
|
{
|
|
548
563
|
scope: a,
|
|
549
|
-
showKind: e.showKind ??
|
|
550
|
-
filters:
|
|
551
|
-
onFiltersChange:
|
|
564
|
+
showKind: e.showKind ?? Ht(a),
|
|
565
|
+
filters: r,
|
|
566
|
+
onFiltersChange: c,
|
|
552
567
|
onOpenInEditor: e.onOpenInEditor
|
|
553
568
|
}
|
|
554
569
|
) });
|
|
555
570
|
}
|
|
556
|
-
const
|
|
557
|
-
function
|
|
571
|
+
const Ut = 1440 * 60 * 1e3;
|
|
572
|
+
function Vt(e) {
|
|
558
573
|
if (!(e === null || e.timeline === null))
|
|
559
574
|
return e.timeline.map((n) => ({
|
|
560
575
|
id: n.id,
|
|
@@ -567,39 +582,39 @@ function Nt(e) {
|
|
|
567
582
|
link: n.link
|
|
568
583
|
}));
|
|
569
584
|
}
|
|
570
|
-
function
|
|
585
|
+
function je(e) {
|
|
571
586
|
return e.startedAt !== void 0 && e.resolvedAt === void 0;
|
|
572
587
|
}
|
|
573
|
-
function
|
|
588
|
+
function ue(e) {
|
|
574
589
|
const n = new Date(e);
|
|
575
590
|
return Number.isNaN(n.getTime()) ? e : n.toLocaleDateString("en-US", { month: "short", day: "numeric", timeZone: "UTC" });
|
|
576
591
|
}
|
|
577
|
-
function
|
|
578
|
-
const
|
|
579
|
-
return Number.isNaN(
|
|
592
|
+
function me(e, n) {
|
|
593
|
+
const i = new Date(e).getTime();
|
|
594
|
+
return Number.isNaN(i) ? 0 : Math.max(0, Math.floor((n - i) / Ut));
|
|
580
595
|
}
|
|
581
|
-
function
|
|
582
|
-
if (!
|
|
583
|
-
const
|
|
596
|
+
function Yt(e, n) {
|
|
597
|
+
if (!je(e) || e.startedAt === void 0) return null;
|
|
598
|
+
const i = me(e.startedAt, n), s = ue(e.startedAt), a = i === 0 ? `open since ${s} (today)` : `open ${i}d (since ${s})`, o = e.updatedAt ?? e.startedAt, r = me(o, n), c = ue(o), h = r === 0 ? `last update ${c} (today)` : `last update ${c} (${r}d ago)`;
|
|
584
599
|
return `${a} · ${h}`;
|
|
585
600
|
}
|
|
586
|
-
function
|
|
601
|
+
function Zt(e) {
|
|
587
602
|
return e ? Object.entries(e) : [];
|
|
588
603
|
}
|
|
589
|
-
function
|
|
604
|
+
function Jt(e) {
|
|
590
605
|
return e.uptime.map((n) => ({ day: n.day, state: n.state }));
|
|
591
606
|
}
|
|
592
|
-
const
|
|
607
|
+
const Q = [
|
|
593
608
|
["e4xx", "4xx"],
|
|
594
609
|
["e429", "429 rate-limited"],
|
|
595
610
|
["eAuth", "auth (401/403)"],
|
|
596
611
|
["e5xx", "5xx"]
|
|
597
612
|
];
|
|
598
|
-
function
|
|
613
|
+
function Se(e) {
|
|
599
614
|
const n = new Date(e);
|
|
600
615
|
return Number.isNaN(n.getTime()) ? e : n.toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
601
616
|
}
|
|
602
|
-
function
|
|
617
|
+
function oe(e) {
|
|
603
618
|
if (!e) return "—";
|
|
604
619
|
const n = new Date(e);
|
|
605
620
|
return Number.isNaN(n.getTime()) ? e : n.toLocaleString(void 0, {
|
|
@@ -609,49 +624,49 @@ function Y(e) {
|
|
|
609
624
|
minute: "2-digit"
|
|
610
625
|
});
|
|
611
626
|
}
|
|
612
|
-
function
|
|
613
|
-
return /* @__PURE__ */
|
|
627
|
+
function Y({ label: e, value: n, hint: i }) {
|
|
628
|
+
return /* @__PURE__ */ l("div", { className: "w6w-rel-card", style: { flex: "1 1 150px", minWidth: 150 }, children: [
|
|
614
629
|
/* @__PURE__ */ t("div", { style: { fontSize: "1.6rem", fontWeight: "var(--w6w-fw-semibold)", lineHeight: 1.15 }, children: n }),
|
|
615
630
|
/* @__PURE__ */ t("div", { className: "muted small", children: e }),
|
|
616
|
-
|
|
631
|
+
i && /* @__PURE__ */ t("div", { className: "muted small", children: i })
|
|
617
632
|
] });
|
|
618
633
|
}
|
|
619
|
-
function
|
|
634
|
+
function zt({
|
|
620
635
|
vendor: e,
|
|
621
636
|
displayName: n
|
|
622
637
|
}) {
|
|
623
638
|
if (!e)
|
|
624
|
-
return /* @__PURE__ */
|
|
625
|
-
/* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ l("div", { className: "w6w-rel-card", children: [
|
|
640
|
+
/* @__PURE__ */ l("h4", { style: { margin: "0 0 var(--w6w-sp-1)" }, children: [
|
|
626
641
|
n,
|
|
627
642
|
" status"
|
|
628
643
|
] }),
|
|
629
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ l("p", { className: "muted", children: [
|
|
630
645
|
n,
|
|
631
646
|
" publishes no public health check, so there is nothing to ask about it. That is a statement about ",
|
|
632
647
|
n,
|
|
633
648
|
", not a gap in the data above."
|
|
634
649
|
] })
|
|
635
650
|
] });
|
|
636
|
-
const
|
|
637
|
-
return /* @__PURE__ */
|
|
638
|
-
/* @__PURE__ */
|
|
651
|
+
const i = e.state === "unknown", s = Zt(e.components), a = (e.timeline ?? []).filter(je), o = Date.now();
|
|
652
|
+
return /* @__PURE__ */ l("div", { className: "w6w-rel-card", children: [
|
|
653
|
+
/* @__PURE__ */ l("h4", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: [
|
|
639
654
|
n,
|
|
640
655
|
" status",
|
|
641
656
|
" ",
|
|
642
|
-
/* @__PURE__ */ t(
|
|
657
|
+
/* @__PURE__ */ t(Z, { state: e.state, label: i ? "Unavailable" : void 0 })
|
|
643
658
|
] }),
|
|
644
|
-
|
|
659
|
+
i && /* @__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." }),
|
|
645
660
|
e.message && /* @__PURE__ */ t(
|
|
646
661
|
"p",
|
|
647
662
|
{
|
|
648
|
-
className:
|
|
663
|
+
className: i ? "muted small" : void 0,
|
|
649
664
|
style: { margin: "0 0 var(--w6w-sp-2)" },
|
|
650
665
|
children: e.message
|
|
651
666
|
}
|
|
652
667
|
),
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
|
|
668
|
+
/* @__PURE__ */ l("p", { className: "muted small", style: { margin: 0 }, children: [
|
|
669
|
+
i ? "Tried to read" : "Read from",
|
|
655
670
|
" ",
|
|
656
671
|
n,
|
|
657
672
|
"'s own status page — what",
|
|
@@ -659,167 +674,167 @@ function Ct({
|
|
|
659
674
|
n,
|
|
660
675
|
" says about itself, not what your calls did · last checked",
|
|
661
676
|
" ",
|
|
662
|
-
|
|
663
|
-
e.attributedTo.length > 0 && /* @__PURE__ */
|
|
677
|
+
oe(e.checkedAt),
|
|
678
|
+
e.attributedTo.length > 0 && /* @__PURE__ */ l(D, { children: [
|
|
664
679
|
" ",
|
|
665
680
|
"· decided by",
|
|
666
681
|
" ",
|
|
667
|
-
e.attributedTo.map((
|
|
682
|
+
e.attributedTo.map((r) => /* @__PURE__ */ t("code", { children: r }, r))
|
|
668
683
|
] })
|
|
669
684
|
] }),
|
|
670
|
-
|
|
671
|
-
|
|
685
|
+
s.length > 0 && /* @__PURE__ */ t("div", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: s.map(([r, c]) => /* @__PURE__ */ l("span", { className: "w6w-rel-tag", children: [
|
|
686
|
+
r,
|
|
672
687
|
": ",
|
|
673
|
-
|
|
674
|
-
] },
|
|
675
|
-
a.length > 0 && /* @__PURE__ */ t("ul", { className: "list", style: { margin: "var(--w6w-sp-2) 0 0" }, children: a.map((
|
|
676
|
-
/* @__PURE__ */ t("strong", { children:
|
|
688
|
+
c.state
|
|
689
|
+
] }, r)) }),
|
|
690
|
+
a.length > 0 && /* @__PURE__ */ t("ul", { className: "list", style: { margin: "var(--w6w-sp-2) 0 0" }, children: a.map((r) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l("div", { className: "list-main", children: [
|
|
691
|
+
/* @__PURE__ */ t("strong", { children: r.title }),
|
|
677
692
|
" ",
|
|
678
|
-
/* @__PURE__ */ t(
|
|
679
|
-
/* @__PURE__ */ t("div", { className: "muted small", children:
|
|
680
|
-
] }) },
|
|
681
|
-
e.statusPageUrl !== null && /* @__PURE__ */ t("p", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: /* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ t(Z, { state: r.state }),
|
|
694
|
+
/* @__PURE__ */ t("div", { className: "muted small", children: Yt(r, o) })
|
|
695
|
+
] }) }, r.id ?? r.title)) }),
|
|
696
|
+
e.statusPageUrl !== null && /* @__PURE__ */ t("p", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: /* @__PURE__ */ l("a", { href: e.statusPageUrl, target: "_blank", rel: "noopener noreferrer", children: [
|
|
682
697
|
n,
|
|
683
698
|
"'s status page ↗"
|
|
684
699
|
] }) })
|
|
685
700
|
] });
|
|
686
701
|
}
|
|
687
|
-
function
|
|
702
|
+
function Gt({ service: e }) {
|
|
688
703
|
if (e.calls === 0)
|
|
689
704
|
return /* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t("span", { className: "w6w-rel-idle-note", children: "No calls in this window" }) });
|
|
690
|
-
const n = e.uptime,
|
|
691
|
-
return /* @__PURE__ */
|
|
705
|
+
const n = e.uptime, i = Math.max(1, ...n.map((s) => s.calls));
|
|
706
|
+
return /* @__PURE__ */ l("div", { className: "w6w-rel-card", children: [
|
|
692
707
|
/* @__PURE__ */ t(
|
|
693
708
|
"div",
|
|
694
709
|
{
|
|
695
710
|
className: "rel-daily-chart",
|
|
696
711
|
role: "img",
|
|
697
712
|
"aria-label": `${e.displayName}, calls per day, oldest first`,
|
|
698
|
-
children: n.map((
|
|
713
|
+
children: n.map((s) => /* @__PURE__ */ t(
|
|
699
714
|
"span",
|
|
700
715
|
{
|
|
701
|
-
className: `rel-daily-bar rel-daily-bar-${
|
|
702
|
-
style: { height: `${
|
|
703
|
-
title: `${
|
|
716
|
+
className: `rel-daily-bar rel-daily-bar-${s.state}`,
|
|
717
|
+
style: { height: `${s.calls > 0 ? Math.max(s.calls / i * 100, 4) : 2}%` },
|
|
718
|
+
title: `${Se(`${s.day}T00:00:00.000Z`)} — ${s.calls} calls, ${s.state}`
|
|
704
719
|
},
|
|
705
|
-
|
|
720
|
+
s.day
|
|
706
721
|
))
|
|
707
722
|
}
|
|
708
723
|
),
|
|
709
724
|
/* @__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." })
|
|
710
725
|
] });
|
|
711
726
|
}
|
|
712
|
-
function
|
|
727
|
+
function Xt({
|
|
713
728
|
service: e,
|
|
714
729
|
window: n
|
|
715
730
|
}) {
|
|
716
|
-
const
|
|
717
|
-
return /* @__PURE__ */
|
|
731
|
+
const i = [...e.uptime].reverse().filter((r) => r.calls > 0), s = e.vendorStatus, a = Vt(s), o = a === void 0 ? `${e.displayName} publishes no incident history.` : `No incidents from ${e.displayName} in this window.`;
|
|
732
|
+
return /* @__PURE__ */ l("div", { className: "w6w-rel-card", children: [
|
|
718
733
|
/* @__PURE__ */ t(
|
|
719
|
-
|
|
734
|
+
Ye,
|
|
720
735
|
{
|
|
721
736
|
window: n,
|
|
722
|
-
days:
|
|
737
|
+
days: Jt(e),
|
|
723
738
|
incidents: a,
|
|
724
|
-
vendorEmptyLabel:
|
|
739
|
+
vendorEmptyLabel: o,
|
|
725
740
|
ariaLabel: `${e.displayName}, ${e.uptime.length}-day status and ${e.displayName} incidents, oldest day first`
|
|
726
741
|
}
|
|
727
742
|
),
|
|
728
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ l("p", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: [
|
|
729
744
|
"Oldest day leftmost. Days with no calls are ",
|
|
730
745
|
/* @__PURE__ */ t("code", { children: "unknown" }),
|
|
731
746
|
" — never a quiet green."
|
|
732
747
|
] }),
|
|
733
|
-
|
|
734
|
-
/* @__PURE__ */ t("span", { style: { minWidth: 96 }, children: /* @__PURE__ */ t("strong", { children:
|
|
735
|
-
/* @__PURE__ */ t(
|
|
736
|
-
/* @__PURE__ */
|
|
737
|
-
|
|
748
|
+
i.length > 0 && /* @__PURE__ */ t("div", { className: "list", style: { marginTop: "var(--w6w-sp-3)" }, children: i.slice(0, 14).map((r) => /* @__PURE__ */ l("div", { className: "rel-day-row", children: [
|
|
749
|
+
/* @__PURE__ */ t("span", { style: { minWidth: 96 }, children: /* @__PURE__ */ t("strong", { children: Se(`${r.day}T00:00:00.000Z`) }) }),
|
|
750
|
+
/* @__PURE__ */ t(Z, { state: r.state }),
|
|
751
|
+
/* @__PURE__ */ l("span", { className: "muted small", children: [
|
|
752
|
+
r.calls,
|
|
738
753
|
" calls"
|
|
739
754
|
] }),
|
|
740
|
-
/* @__PURE__ */ t("span", { className: "rel-errors", children:
|
|
755
|
+
/* @__PURE__ */ t("span", { className: "rel-errors", children: Q.filter(([c]) => r.errors[c] > 0).map(([c, h]) => /* @__PURE__ */ l("span", { className: "w6w-rel-tag", children: [
|
|
741
756
|
h,
|
|
742
757
|
" ×",
|
|
743
|
-
|
|
744
|
-
] },
|
|
745
|
-
] },
|
|
758
|
+
r.errors[c]
|
|
759
|
+
] }, c)) })
|
|
760
|
+
] }, r.day)) })
|
|
746
761
|
] });
|
|
747
762
|
}
|
|
748
|
-
function
|
|
749
|
-
if (
|
|
763
|
+
function en({ errors: e }) {
|
|
764
|
+
if (Q.reduce((s, [a]) => s + e[a], 0) === 0)
|
|
750
765
|
return /* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t("p", { className: "muted", style: { margin: 0 }, children: "No errors in this window." }) });
|
|
751
|
-
const
|
|
752
|
-
return /* @__PURE__ */ t("div", { className: "w6w-rel-card rel-errormix-chart", children:
|
|
766
|
+
const i = Math.max(1, ...Q.map(([s]) => e[s]));
|
|
767
|
+
return /* @__PURE__ */ t("div", { className: "w6w-rel-card rel-errormix-chart", children: Q.map(([s, a]) => /* @__PURE__ */ l("div", { className: "rel-errormix-row", children: [
|
|
753
768
|
/* @__PURE__ */ t("span", { className: "muted small", children: a }),
|
|
754
769
|
/* @__PURE__ */ t("span", { className: "rel-errormix-track", children: /* @__PURE__ */ t(
|
|
755
770
|
"span",
|
|
756
771
|
{
|
|
757
772
|
className: "rel-errormix-bar",
|
|
758
|
-
style: { width: `${Math.max(e[
|
|
773
|
+
style: { width: `${Math.max(e[s] / i * 100, e[s] > 0 ? 2 : 0)}%` }
|
|
759
774
|
}
|
|
760
775
|
) }),
|
|
761
|
-
/* @__PURE__ */ t("span", { className: "rel-errormix-value small", children: e[
|
|
762
|
-
] },
|
|
763
|
-
}
|
|
764
|
-
function
|
|
765
|
-
const
|
|
766
|
-
if (
|
|
767
|
-
if (
|
|
768
|
-
const a =
|
|
769
|
-
return /* @__PURE__ */ t("div", { className: "error", children: (a instanceof
|
|
776
|
+
/* @__PURE__ */ t("span", { className: "rel-errormix-value small", children: e[s] })
|
|
777
|
+
] }, s)) });
|
|
778
|
+
}
|
|
779
|
+
function tn({ project: e, appId: n }) {
|
|
780
|
+
const i = ut(e, n, { limit: 50 });
|
|
781
|
+
if (i.isLoading) return /* @__PURE__ */ t("p", { className: "muted", children: "Loading calls…" });
|
|
782
|
+
if (i.error) {
|
|
783
|
+
const a = i.error;
|
|
784
|
+
return /* @__PURE__ */ t("div", { className: "error", children: (a instanceof ke, a.message) });
|
|
770
785
|
}
|
|
771
|
-
const
|
|
772
|
-
return
|
|
773
|
-
/* @__PURE__ */
|
|
786
|
+
const s = i.data ?? [];
|
|
787
|
+
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__ */ l("div", { className: "rel-calls", children: [
|
|
788
|
+
/* @__PURE__ */ l("div", { className: "rel-call rel-call-head", children: [
|
|
774
789
|
/* @__PURE__ */ t("span", { children: "When" }),
|
|
775
790
|
/* @__PURE__ */ t("span", { children: "Action" }),
|
|
776
791
|
/* @__PURE__ */ t("span", { children: "Method" }),
|
|
777
792
|
/* @__PURE__ */ t("span", { children: "Status" }),
|
|
778
793
|
/* @__PURE__ */ t("span", { children: "Took" })
|
|
779
794
|
] }),
|
|
780
|
-
|
|
781
|
-
/* @__PURE__ */ t("span", { className: "muted small", children:
|
|
795
|
+
s.map((a, o) => /* @__PURE__ */ l("div", { className: "rel-call", children: [
|
|
796
|
+
/* @__PURE__ */ t("span", { className: "muted small", children: oe(a.createdAt) }),
|
|
782
797
|
/* @__PURE__ */ t("span", { children: /* @__PURE__ */ t("code", { children: a.actionKey ?? "—" }) }),
|
|
783
798
|
/* @__PURE__ */ t("span", { className: "muted small", children: a.method }),
|
|
784
799
|
/* @__PURE__ */ t("span", { className: a.status >= 400 || a.status === 0 ? "error" : "ok", children: a.status === 0 ? "no response" : a.status }),
|
|
785
800
|
/* @__PURE__ */ t("span", { className: "muted small", children: a.durationMs != null ? `${a.durationMs} ms` : "—" })
|
|
786
|
-
] }, a.id ?? `${a.createdAt}-${
|
|
801
|
+
] }, a.id ?? `${a.createdAt}-${o}`))
|
|
787
802
|
] });
|
|
788
803
|
}
|
|
789
|
-
function
|
|
804
|
+
function nn({
|
|
790
805
|
backHref: e,
|
|
791
806
|
onBack: n
|
|
792
807
|
}) {
|
|
793
808
|
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;
|
|
794
809
|
}
|
|
795
|
-
function
|
|
810
|
+
function Xn({
|
|
796
811
|
appId: e,
|
|
797
812
|
project: n,
|
|
798
|
-
days:
|
|
799
|
-
backHref:
|
|
813
|
+
days: i = 30,
|
|
814
|
+
backHref: s,
|
|
800
815
|
onBack: a,
|
|
801
|
-
slots:
|
|
816
|
+
slots: o
|
|
802
817
|
}) {
|
|
803
|
-
var
|
|
804
|
-
const
|
|
805
|
-
return /* @__PURE__ */
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
!
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
h.data && !
|
|
812
|
-
(
|
|
818
|
+
var y, k, b, g;
|
|
819
|
+
const r = ie().project, c = (n === void 0 ? r : n) || void 0, h = dt(c, [e], i), w = h.error, N = w ? (w instanceof ke, w.message) : null, d = (y = h.data) == null ? void 0 : y.services.find((m) => m.appId === e);
|
|
820
|
+
return /* @__PURE__ */ l("div", { className: "w6w-embed-root", children: [
|
|
821
|
+
o == null ? void 0 : o.header,
|
|
822
|
+
o == null ? void 0 : o.actions,
|
|
823
|
+
!c && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see this service." }),
|
|
824
|
+
N && /* @__PURE__ */ t("div", { className: "error", children: N }),
|
|
825
|
+
c && h.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
|
|
826
|
+
h.data && !d && /* @__PURE__ */ l("div", { className: "w6w-rel-card", children: [
|
|
827
|
+
(o == null ? void 0 : o.empty) ?? /* @__PURE__ */ l("p", { className: "muted", children: [
|
|
813
828
|
/* @__PURE__ */ t("code", { children: e }),
|
|
814
829
|
" is not used by this project's definitions and has no calls in the last ",
|
|
815
|
-
|
|
830
|
+
i,
|
|
816
831
|
" days."
|
|
817
832
|
] }),
|
|
818
|
-
/* @__PURE__ */ t(
|
|
833
|
+
/* @__PURE__ */ t(nn, { backHref: s, onBack: a })
|
|
819
834
|
] }),
|
|
820
|
-
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
/* @__PURE__ */
|
|
835
|
+
d && /* @__PURE__ */ l(D, { children: [
|
|
836
|
+
/* @__PURE__ */ l("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
|
|
837
|
+
/* @__PURE__ */ l(
|
|
823
838
|
"div",
|
|
824
839
|
{
|
|
825
840
|
style: {
|
|
@@ -829,357 +844,1060 @@ function an({
|
|
|
829
844
|
marginBottom: "var(--w6w-sp-3)"
|
|
830
845
|
},
|
|
831
846
|
children: [
|
|
832
|
-
/* @__PURE__ */ t(
|
|
847
|
+
/* @__PURE__ */ t(Z, { state: d.state }),
|
|
833
848
|
/* @__PURE__ */ t("span", { className: "muted small", children: "from your calls" }),
|
|
834
|
-
/* @__PURE__ */ t("code", { className: "muted small", children:
|
|
835
|
-
|
|
849
|
+
/* @__PURE__ */ t("code", { className: "muted small", children: d.appId }),
|
|
850
|
+
d.ongoingOutageId && /* @__PURE__ */ t("span", { className: "w6w-rel-tag", children: "outage still open" })
|
|
836
851
|
]
|
|
837
852
|
}
|
|
838
853
|
),
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
/* @__PURE__ */ t(
|
|
854
|
+
/* @__PURE__ */ l("div", { style: { display: "flex", gap: "var(--w6w-sp-3)", flexWrap: "wrap" }, children: [
|
|
855
|
+
/* @__PURE__ */ t(Y, { label: "Calls in window", value: String(d.calls) }),
|
|
841
856
|
/* @__PURE__ */ t(
|
|
842
|
-
|
|
857
|
+
Y,
|
|
843
858
|
{
|
|
844
859
|
label: "p95 latency",
|
|
845
|
-
value:
|
|
846
|
-
hint:
|
|
860
|
+
value: d.p95Ms === null ? "—" : `${d.p95Ms} ms`,
|
|
861
|
+
hint: d.p95Ms === null ? "no timed calls" : void 0
|
|
847
862
|
}
|
|
848
863
|
),
|
|
849
|
-
/* @__PURE__ */ t(
|
|
864
|
+
/* @__PURE__ */ t(Y, { label: "Last call", value: oe(d.lastCallAt) }),
|
|
850
865
|
/* @__PURE__ */ t(
|
|
851
|
-
|
|
866
|
+
Y,
|
|
852
867
|
{
|
|
853
868
|
label: "Errors",
|
|
854
|
-
value: String(
|
|
855
|
-
hint:
|
|
869
|
+
value: String(Q.reduce((m, [p]) => m + d.errors[p], 0)),
|
|
870
|
+
hint: Q.filter(([m]) => d.errors[m] > 0).map(([m, p]) => `${p} ×${d.errors[m]}`).join(" · ") || "none"
|
|
856
871
|
}
|
|
857
872
|
)
|
|
858
873
|
] })
|
|
859
874
|
] }),
|
|
860
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ l("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
|
|
861
876
|
/* @__PURE__ */ t("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: "Error mix" }),
|
|
862
|
-
/* @__PURE__ */ t(
|
|
877
|
+
/* @__PURE__ */ t(en, { errors: d.errors })
|
|
863
878
|
] }),
|
|
864
|
-
/* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ l("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
|
|
865
880
|
/* @__PURE__ */ t("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: "API status" }),
|
|
866
|
-
/* @__PURE__ */ t(
|
|
881
|
+
/* @__PURE__ */ t(zt, { vendor: d.vendorStatus, displayName: d.displayName })
|
|
867
882
|
] }),
|
|
868
|
-
/* @__PURE__ */
|
|
869
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ l("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
|
|
884
|
+
/* @__PURE__ */ l("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: [
|
|
870
885
|
"Last ",
|
|
871
|
-
((
|
|
886
|
+
((k = h.data) == null ? void 0 : k.window.days) ?? i,
|
|
872
887
|
" days",
|
|
873
888
|
" ",
|
|
874
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ l("span", { className: "muted small", children: [
|
|
875
890
|
"uptime means ",
|
|
876
|
-
(
|
|
891
|
+
(b = h.data) == null ? void 0 : b.uptimeMeans
|
|
877
892
|
] })
|
|
878
893
|
] }),
|
|
879
|
-
/* @__PURE__ */ t(
|
|
880
|
-
/* @__PURE__ */ t(
|
|
894
|
+
/* @__PURE__ */ t(Xt, { service: d, window: ((g = h.data) == null ? void 0 : g.window) ?? { from: "", to: "" } }),
|
|
895
|
+
/* @__PURE__ */ t(Gt, { service: d })
|
|
881
896
|
] }),
|
|
882
|
-
/* @__PURE__ */
|
|
883
|
-
/* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ l("section", { children: [
|
|
898
|
+
/* @__PURE__ */ l("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: [
|
|
884
899
|
"Recent calls",
|
|
885
900
|
" ",
|
|
886
901
|
/* @__PURE__ */ t("span", { className: "muted small", children: "the requests behind the numbers above" })
|
|
887
902
|
] }),
|
|
888
|
-
/* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t(
|
|
903
|
+
/* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t(tn, { project: c, appId: d.appId }) })
|
|
889
904
|
] })
|
|
890
905
|
] })
|
|
891
906
|
] });
|
|
892
907
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
908
|
+
function an(e) {
|
|
909
|
+
if (typeof e == "string") return e;
|
|
910
|
+
if (e && typeof e == "object") {
|
|
911
|
+
const n = e;
|
|
912
|
+
for (const i of ["stepId", "step", "id", "nodeId", "key"])
|
|
913
|
+
if (typeof n[i] == "string") return n[i];
|
|
914
|
+
}
|
|
915
|
+
return String(e);
|
|
916
|
+
}
|
|
917
|
+
function sn({
|
|
918
|
+
routes: e,
|
|
919
|
+
projectId: n
|
|
920
|
+
}) {
|
|
921
|
+
const [i, s] = C(null), a = e.find((o) => o.id === i);
|
|
922
|
+
return e.length === 0 ? null : /* @__PURE__ */ l(D, { children: [
|
|
923
|
+
/* @__PURE__ */ t("ul", { className: "list small", "data-testid": "connection-dependent-routes", children: e.map((o) => /* @__PURE__ */ l("li", { "data-testid": `connection-dependent-route-${o.id}`, children: [
|
|
924
|
+
/* @__PURE__ */ t("span", { className: "badge", children: "route" }),
|
|
925
|
+
" ",
|
|
926
|
+
/* @__PURE__ */ t("span", { children: o.name }),
|
|
927
|
+
" ",
|
|
928
|
+
o.status === "broken" && /* @__PURE__ */ l(D, { children: [
|
|
929
|
+
/* @__PURE__ */ t("span", { className: "tag warn", children: "broken" }),
|
|
930
|
+
" ",
|
|
931
|
+
/* @__PURE__ */ t(
|
|
932
|
+
"button",
|
|
933
|
+
{
|
|
934
|
+
type: "button",
|
|
935
|
+
className: "btn link",
|
|
936
|
+
"data-testid": `connection-route-reconnect-${o.id}`,
|
|
937
|
+
onClick: () => s(o.id),
|
|
938
|
+
children: "Reconnect"
|
|
939
|
+
}
|
|
940
|
+
)
|
|
941
|
+
] })
|
|
942
|
+
] }, o.id)) }),
|
|
943
|
+
a != null && /* @__PURE__ */ t(
|
|
944
|
+
ln,
|
|
945
|
+
{
|
|
946
|
+
routeId: a.id,
|
|
947
|
+
projectId: a.project ?? n,
|
|
948
|
+
onDone: () => s(null)
|
|
949
|
+
}
|
|
950
|
+
)
|
|
951
|
+
] });
|
|
952
|
+
}
|
|
953
|
+
function ln(e) {
|
|
954
|
+
return /* @__PURE__ */ l("div", { "data-testid": "connection-route-reconnect-host", children: [
|
|
955
|
+
/* @__PURE__ */ t(kt, { projectId: e.projectId, initialEditRouteId: e.routeId }),
|
|
956
|
+
/* @__PURE__ */ t("button", { type: "button", className: "btn link", onClick: e.onDone, children: "Done" })
|
|
957
|
+
] });
|
|
958
|
+
}
|
|
959
|
+
function Pe({
|
|
960
|
+
callables: e,
|
|
961
|
+
onOpenCallable: n,
|
|
962
|
+
routes: i,
|
|
963
|
+
projectId: s
|
|
964
|
+
}) {
|
|
965
|
+
return /* @__PURE__ */ l(D, { children: [
|
|
966
|
+
/* @__PURE__ */ t(sn, { routes: i ?? [], projectId: s }),
|
|
967
|
+
/* @__PURE__ */ t(rn, { callables: e, onOpenCallable: n })
|
|
968
|
+
] });
|
|
969
|
+
}
|
|
970
|
+
function rn({
|
|
971
|
+
callables: e,
|
|
972
|
+
onOpenCallable: n
|
|
973
|
+
}) {
|
|
974
|
+
return /* @__PURE__ */ t("ul", { className: "list small", children: e.map((i) => {
|
|
975
|
+
const s = i.displayName || i.key || i.id, a = i.sites.map(an);
|
|
976
|
+
return /* @__PURE__ */ l("li", { children: [
|
|
977
|
+
/* @__PURE__ */ t("span", { className: "badge", children: i.kind }),
|
|
978
|
+
" ",
|
|
979
|
+
n ? /* @__PURE__ */ t(
|
|
980
|
+
"button",
|
|
981
|
+
{
|
|
982
|
+
type: "button",
|
|
983
|
+
className: "btn link",
|
|
984
|
+
onClick: () => n(i.kind, i.id),
|
|
985
|
+
children: s
|
|
986
|
+
}
|
|
987
|
+
) : /* @__PURE__ */ t("span", { children: s }),
|
|
988
|
+
!i.enabled && /* @__PURE__ */ t("span", { className: "muted", children: " (disabled)" }),
|
|
989
|
+
a.length > 0 && /* @__PURE__ */ l("span", { className: "muted", children: [
|
|
990
|
+
" · ",
|
|
991
|
+
a.join(", ")
|
|
992
|
+
] })
|
|
993
|
+
] }, `${i.kind}:${i.id}`);
|
|
994
|
+
}) });
|
|
995
|
+
}
|
|
996
|
+
const on = [];
|
|
997
|
+
function ea({
|
|
998
|
+
onOpen: e,
|
|
999
|
+
getHref: n,
|
|
1000
|
+
addLabel: i,
|
|
1001
|
+
slots: s,
|
|
1002
|
+
onOpenCallable: a
|
|
1003
|
+
}) {
|
|
1004
|
+
var E, j;
|
|
1005
|
+
const o = ge(), r = Ce(), c = Nt(), w = c.data ?? on, N = K(() => Ne(w), [w]), { byId: d } = ve(N), y = yt(), [k, b] = C(!1), [g, m] = C(null), [p, T] = C(null), x = q(void 0), v = Ie((p == null ? void 0 : p.id) ?? "", p !== null), O = typeof o.updateConnection == "function", R = s && "actions" in s ? s.actions : /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", onClick: () => b(!0), children: i ?? "+ Add connection" });
|
|
1006
|
+
return /* @__PURE__ */ l("div", { className: "w6w-embed-root", children: [
|
|
897
1007
|
/* @__PURE__ */ t(
|
|
898
|
-
|
|
1008
|
+
Ze,
|
|
899
1009
|
{
|
|
900
|
-
connections:
|
|
901
|
-
appsById:
|
|
902
|
-
loading:
|
|
903
|
-
error:
|
|
1010
|
+
connections: w,
|
|
1011
|
+
appsById: d,
|
|
1012
|
+
loading: c.isLoading,
|
|
1013
|
+
error: c.error ? c.error.message : null,
|
|
904
1014
|
onOpen: e,
|
|
905
1015
|
getHref: n,
|
|
906
|
-
onEdit:
|
|
907
|
-
onDelete:
|
|
908
|
-
busy:
|
|
909
|
-
slots: { ...
|
|
1016
|
+
onEdit: O ? m : void 0,
|
|
1017
|
+
onDelete: T,
|
|
1018
|
+
busy: y.isPending,
|
|
1019
|
+
slots: { ...s, actions: R }
|
|
910
1020
|
}
|
|
911
1021
|
),
|
|
912
|
-
|
|
913
|
-
|
|
1022
|
+
k && /* @__PURE__ */ t(
|
|
1023
|
+
Je,
|
|
914
1024
|
{
|
|
915
|
-
onClose: () =>
|
|
1025
|
+
onClose: () => b(!1),
|
|
916
1026
|
onCreated: () => {
|
|
917
|
-
|
|
1027
|
+
b(!1), r.invalidateQueries({ queryKey: ne });
|
|
918
1028
|
}
|
|
919
1029
|
}
|
|
920
1030
|
),
|
|
921
|
-
|
|
922
|
-
|
|
1031
|
+
g && /* @__PURE__ */ t(
|
|
1032
|
+
ye,
|
|
923
1033
|
{
|
|
924
|
-
connection:
|
|
925
|
-
onClose: () =>
|
|
1034
|
+
connection: g,
|
|
1035
|
+
onClose: () => m(null),
|
|
926
1036
|
onSaved: () => {
|
|
927
|
-
const
|
|
928
|
-
|
|
1037
|
+
const M = g.id;
|
|
1038
|
+
m(null), r.invalidateQueries({ queryKey: ne }), r.invalidateQueries({ queryKey: Te(M) });
|
|
929
1039
|
}
|
|
930
1040
|
}
|
|
931
1041
|
),
|
|
932
|
-
|
|
933
|
-
|
|
1042
|
+
p && /* @__PURE__ */ t(
|
|
1043
|
+
cn,
|
|
934
1044
|
{
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1045
|
+
name: p.displayName || p.id,
|
|
1046
|
+
loading: v.isLoading,
|
|
1047
|
+
callables: v.isError ? [] : ((E = v.data) == null ? void 0 : E.callables) ?? [],
|
|
1048
|
+
routes: v.isError ? [] : ((j = v.data) == null ? void 0 : j.routes) ?? [],
|
|
1049
|
+
projectId: x,
|
|
1050
|
+
onOpenCallable: a,
|
|
1051
|
+
onClose: () => T(null),
|
|
939
1052
|
onConfirm: () => {
|
|
940
|
-
const
|
|
941
|
-
|
|
1053
|
+
const M = p.id;
|
|
1054
|
+
T(null), y.mutate({ id: M, force: !0 });
|
|
942
1055
|
}
|
|
943
1056
|
}
|
|
944
1057
|
)
|
|
945
1058
|
] });
|
|
946
1059
|
}
|
|
947
|
-
function
|
|
1060
|
+
function cn({
|
|
1061
|
+
name: e,
|
|
1062
|
+
loading: n,
|
|
1063
|
+
callables: i,
|
|
1064
|
+
routes: s,
|
|
1065
|
+
projectId: a,
|
|
1066
|
+
onOpenCallable: o,
|
|
1067
|
+
onClose: r,
|
|
1068
|
+
onConfirm: c
|
|
1069
|
+
}) {
|
|
1070
|
+
const h = i.length, w = s.length, N = h + w, d = `Delete the connection "${e}"? This cannot be undone.`, y = (g, m, p) => `${g} ${g === 1 ? m : p}`, k = [
|
|
1071
|
+
h > 0 ? y(h, "callable", "callables") : null,
|
|
1072
|
+
w > 0 ? y(w, "model route", "model routes") : null
|
|
1073
|
+
].filter(Boolean).join(" and "), b = [
|
|
1074
|
+
h > 0 ? `Deleting disables ${h === 1 ? "this callable" : `these ${h} callables`} until you reconnect ${h === 1 ? "it" : "them"}.` : null,
|
|
1075
|
+
w > 0 ? `${w === 1 ? "The model route becomes" : `The ${w} model routes become`} broken until ${w === 1 ? "it is" : "they are"} pointed at another connection.` : null
|
|
1076
|
+
].filter((g) => g != null);
|
|
1077
|
+
return /* @__PURE__ */ l(ze, { title: "Delete connection", onClose: r, children: [
|
|
1078
|
+
/* @__PURE__ */ l("div", { className: "w6w-modal-body", children: [
|
|
1079
|
+
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: N === 0 ? d : `Delete the connection "${e}"? Used by ${k}.` }),
|
|
1080
|
+
N > 0 && /* @__PURE__ */ l(D, { children: [
|
|
1081
|
+
/* @__PURE__ */ t(
|
|
1082
|
+
Pe,
|
|
1083
|
+
{
|
|
1084
|
+
callables: i,
|
|
1085
|
+
routes: s,
|
|
1086
|
+
projectId: a,
|
|
1087
|
+
onOpenCallable: o
|
|
1088
|
+
}
|
|
1089
|
+
),
|
|
1090
|
+
/* @__PURE__ */ t("p", { className: "w6w-small", children: b.join(" ") })
|
|
1091
|
+
] })
|
|
1092
|
+
] }),
|
|
1093
|
+
/* @__PURE__ */ l("div", { className: "w6w-modal-actions", children: [
|
|
1094
|
+
/* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: r, children: "Cancel" }),
|
|
1095
|
+
/* @__PURE__ */ t(
|
|
1096
|
+
"button",
|
|
1097
|
+
{
|
|
1098
|
+
type: "button",
|
|
1099
|
+
className: "w6w-btn w6w-btn-danger",
|
|
1100
|
+
disabled: n,
|
|
1101
|
+
onClick: c,
|
|
1102
|
+
children: "Delete"
|
|
1103
|
+
}
|
|
1104
|
+
)
|
|
1105
|
+
] })
|
|
1106
|
+
] });
|
|
1107
|
+
}
|
|
1108
|
+
function ee(e) {
|
|
948
1109
|
const n = new Date(e).getTime();
|
|
949
1110
|
if (Number.isNaN(n)) return "recently";
|
|
950
|
-
const
|
|
951
|
-
if (
|
|
952
|
-
const
|
|
953
|
-
if (
|
|
954
|
-
const a = Math.round(
|
|
1111
|
+
const i = Math.max(0, Math.round((Date.now() - n) / 1e3));
|
|
1112
|
+
if (i < 45) return "just now";
|
|
1113
|
+
const s = Math.round(i / 60);
|
|
1114
|
+
if (s < 60) return `${s}m ago`;
|
|
1115
|
+
const a = Math.round(s / 60);
|
|
955
1116
|
if (a < 24) return `${a}h ago`;
|
|
956
|
-
const
|
|
957
|
-
return
|
|
1117
|
+
const o = Math.round(a / 24);
|
|
1118
|
+
return o < 30 ? `${o}d ago` : new Date(e).toLocaleDateString();
|
|
958
1119
|
}
|
|
959
|
-
const
|
|
1120
|
+
const dn = {
|
|
960
1121
|
ok: 6e3,
|
|
961
1122
|
warn: 1e4,
|
|
962
1123
|
error: 15e3
|
|
963
|
-
},
|
|
964
|
-
function
|
|
1124
|
+
}, un = { ok: "✓", warn: "!", error: "✕" };
|
|
1125
|
+
function ta({
|
|
965
1126
|
connectionId: e,
|
|
966
1127
|
onOpenAction: n,
|
|
967
|
-
onBack:
|
|
968
|
-
|
|
1128
|
+
onBack: i,
|
|
1129
|
+
onOpenCallable: s,
|
|
1130
|
+
slots: a
|
|
969
1131
|
}) {
|
|
970
|
-
var
|
|
971
|
-
const
|
|
972
|
-
() =>
|
|
973
|
-
[
|
|
974
|
-
), { byId:
|
|
975
|
-
const
|
|
976
|
-
for (const
|
|
977
|
-
const
|
|
978
|
-
|
|
1132
|
+
var V;
|
|
1133
|
+
const o = ge(), r = Ce(), c = bt(e), h = (V = c.data) == null ? void 0 : V.appId, w = K(
|
|
1134
|
+
() => Ne(c.data ? [c.data] : []),
|
|
1135
|
+
[c.data]
|
|
1136
|
+
), { byId: N } = ve(w), d = c.data ? Ge(c.data, N) : void 0, y = Ct(h, !!h), k = mt(e), b = K(() => {
|
|
1137
|
+
const u = /* @__PURE__ */ new Map();
|
|
1138
|
+
for (const $ of k.data ?? []) {
|
|
1139
|
+
const I = u.get($.actionKey) ?? [];
|
|
1140
|
+
I.push($), u.set($.actionKey, I);
|
|
979
1141
|
}
|
|
980
|
-
return
|
|
981
|
-
}, [
|
|
982
|
-
|
|
983
|
-
if (!
|
|
984
|
-
const
|
|
985
|
-
return () => clearTimeout(
|
|
986
|
-
}, [
|
|
987
|
-
const
|
|
988
|
-
|
|
989
|
-
onSuccess: (
|
|
990
|
-
var
|
|
991
|
-
if (!
|
|
992
|
-
|
|
1142
|
+
return u;
|
|
1143
|
+
}, [k.data]), g = Ie(e).data, m = q(void 0), p = (g == null ? void 0 : g.callables) ?? [], T = (g == null ? void 0 : g.routes) ?? [], x = ht(e).data ?? [], [v, O] = C(!1), [R, E] = C(""), j = vt(e), [M, S] = C(null);
|
|
1144
|
+
Oe(() => {
|
|
1145
|
+
if (!M) return;
|
|
1146
|
+
const u = setTimeout(() => S(null), dn[M.kind]);
|
|
1147
|
+
return () => clearTimeout(u);
|
|
1148
|
+
}, [M]);
|
|
1149
|
+
const U = () => {
|
|
1150
|
+
S(null), j.mutate(void 0, {
|
|
1151
|
+
onSuccess: (u) => {
|
|
1152
|
+
var $;
|
|
1153
|
+
if (!u.ok) {
|
|
1154
|
+
S({
|
|
993
1155
|
kind: "error",
|
|
994
|
-
text: `Connection test failed${(
|
|
1156
|
+
text: `Connection test failed${($ = u.error) != null && $.message ? `: ${u.error.message}` : "."}`
|
|
995
1157
|
});
|
|
996
1158
|
return;
|
|
997
1159
|
}
|
|
998
|
-
|
|
999
|
-
|
|
1160
|
+
S(
|
|
1161
|
+
u.untested ? { kind: "warn", text: `Connection stored. ${u.message ?? ""}`.trim() } : {
|
|
1000
1162
|
kind: "ok",
|
|
1001
|
-
text: `Connection is valid${
|
|
1163
|
+
text: `Connection is valid${u.actionKey ? ` — probed ${u.actionKey}` : ""}.`
|
|
1002
1164
|
}
|
|
1003
1165
|
);
|
|
1004
1166
|
},
|
|
1005
|
-
onError: (
|
|
1167
|
+
onError: (u) => S({ kind: "error", text: (u == null ? void 0 : u.message) ?? "Test failed." })
|
|
1006
1168
|
});
|
|
1007
|
-
}, L =
|
|
1008
|
-
var
|
|
1009
|
-
const
|
|
1010
|
-
return
|
|
1011
|
-
}, [
|
|
1012
|
-
const
|
|
1013
|
-
return
|
|
1014
|
-
(
|
|
1169
|
+
}, L = K(() => {
|
|
1170
|
+
var $;
|
|
1171
|
+
const u = [...(($ = y.data) == null ? void 0 : $.actions) ?? []];
|
|
1172
|
+
return u.sort((I, f) => (I.title || I.key).localeCompare(f.title || f.key)), u;
|
|
1173
|
+
}, [y.data]), B = K(() => {
|
|
1174
|
+
const u = R.trim().toLowerCase();
|
|
1175
|
+
return u ? L.filter(
|
|
1176
|
+
($) => ($.title || "").toLowerCase().includes(u) || $.key.toLowerCase().includes(u) || ($.description || "").toLowerCase().includes(u)
|
|
1015
1177
|
) : L;
|
|
1016
|
-
}, [L,
|
|
1017
|
-
if (
|
|
1178
|
+
}, [L, R]);
|
|
1179
|
+
if (c.isLoading || y.isLoading)
|
|
1018
1180
|
return /* @__PURE__ */ t("div", { className: "w6w-embed-root w6w-embed-conn-detail", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) });
|
|
1019
|
-
if (!
|
|
1020
|
-
return /* @__PURE__ */
|
|
1021
|
-
(
|
|
1022
|
-
|
|
1181
|
+
if (!c.data)
|
|
1182
|
+
return /* @__PURE__ */ l("div", { className: "w6w-embed-root w6w-embed-conn-detail", "data-testid": "connection-not-found", children: [
|
|
1183
|
+
(a == null ? void 0 : a.empty) ?? /* @__PURE__ */ t("h2", { children: "Connection not found" }),
|
|
1184
|
+
i && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: i, children: "Back to integrations" })
|
|
1023
1185
|
] });
|
|
1024
|
-
const
|
|
1025
|
-
return /* @__PURE__ */
|
|
1026
|
-
(
|
|
1186
|
+
const P = c.data, F = y.data, z = !P.builtIn && typeof o.updateConnection == "function";
|
|
1187
|
+
return /* @__PURE__ */ l("div", { className: "w6w-embed-root w6w-embed-conn-detail w6w-card-stack", children: [
|
|
1188
|
+
(a == null ? void 0 : a.header) ?? /* @__PURE__ */ l(Xe, { conn: P, app: d, children: [
|
|
1027
1189
|
/* @__PURE__ */ t(
|
|
1028
1190
|
"button",
|
|
1029
1191
|
{
|
|
1030
1192
|
type: "button",
|
|
1031
1193
|
className: "w6w-btn w6w-btn-ghost",
|
|
1032
|
-
disabled:
|
|
1033
|
-
onClick:
|
|
1034
|
-
children:
|
|
1194
|
+
disabled: j.isPending,
|
|
1195
|
+
onClick: U,
|
|
1196
|
+
children: j.isPending ? "Testing…" : "Test connection"
|
|
1035
1197
|
}
|
|
1036
1198
|
),
|
|
1037
|
-
|
|
1038
|
-
|
|
1199
|
+
z && /* @__PURE__ */ t(
|
|
1200
|
+
fe,
|
|
1039
1201
|
{
|
|
1040
1202
|
label: "Edit",
|
|
1041
|
-
onClick: () =>
|
|
1203
|
+
onClick: () => O(!0),
|
|
1042
1204
|
"data-testid": "connection-detail-edit"
|
|
1043
1205
|
}
|
|
1044
1206
|
),
|
|
1045
|
-
|
|
1207
|
+
a == null ? void 0 : a.actions
|
|
1046
1208
|
] }),
|
|
1047
|
-
|
|
1209
|
+
M && /* @__PURE__ */ l(
|
|
1048
1210
|
"div",
|
|
1049
1211
|
{
|
|
1050
|
-
className: `w6w-result w6w-embed-conn-notice w6w-embed-conn-notice-${
|
|
1051
|
-
role:
|
|
1052
|
-
"aria-live":
|
|
1212
|
+
className: `w6w-result w6w-embed-conn-notice w6w-embed-conn-notice-${M.kind}`,
|
|
1213
|
+
role: M.kind === "error" ? "alert" : "status",
|
|
1214
|
+
"aria-live": M.kind === "error" ? "assertive" : "polite",
|
|
1053
1215
|
"data-testid": "connection-test-notice",
|
|
1054
1216
|
children: [
|
|
1055
|
-
/* @__PURE__ */ t("span", { "aria-hidden": "true", children:
|
|
1056
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-notice-text", children:
|
|
1057
|
-
/* @__PURE__ */ t(
|
|
1217
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: un[M.kind] }),
|
|
1218
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-notice-text", children: M.text }),
|
|
1219
|
+
/* @__PURE__ */ t(et, { icon: "close", label: "Dismiss", onClick: () => S(null) })
|
|
1058
1220
|
]
|
|
1059
1221
|
}
|
|
1060
1222
|
),
|
|
1061
|
-
/* @__PURE__ */
|
|
1062
|
-
/* @__PURE__ */
|
|
1223
|
+
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1224
|
+
/* @__PURE__ */ l("h3", { children: [
|
|
1063
1225
|
"App: ",
|
|
1064
|
-
(
|
|
1226
|
+
(d == null ? void 0 : d.displayName) ?? P.appId
|
|
1065
1227
|
] }),
|
|
1066
|
-
|
|
1228
|
+
F && /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small", children: [
|
|
1067
1229
|
"Version ",
|
|
1068
|
-
/* @__PURE__ */
|
|
1230
|
+
/* @__PURE__ */ l("code", { children: [
|
|
1069
1231
|
"v",
|
|
1070
|
-
|
|
1232
|
+
F.version ?? "?"
|
|
1071
1233
|
] }),
|
|
1072
1234
|
" · source ",
|
|
1073
|
-
/* @__PURE__ */ t("code", { children:
|
|
1235
|
+
/* @__PURE__ */ t("code", { children: F.sourceRef })
|
|
1074
1236
|
] }),
|
|
1075
|
-
|
|
1237
|
+
i && /* @__PURE__ */ t("p", { className: "w6w-small", children: /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: i, children: "← Integrations" }) })
|
|
1076
1238
|
] }),
|
|
1077
|
-
/* @__PURE__ */
|
|
1239
|
+
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1078
1240
|
/* @__PURE__ */ t("h3", { children: "Actions" }),
|
|
1079
1241
|
L.length === 0 && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No actions exposed." }),
|
|
1080
1242
|
L.length > 10 && /* @__PURE__ */ t(
|
|
1081
1243
|
"input",
|
|
1082
1244
|
{
|
|
1083
1245
|
type: "search",
|
|
1084
|
-
value:
|
|
1246
|
+
value: R,
|
|
1085
1247
|
placeholder: `Search ${L.length} actions…`,
|
|
1086
|
-
onChange: (
|
|
1248
|
+
onChange: (u) => E(u.target.value),
|
|
1087
1249
|
"aria-label": "Filter actions",
|
|
1088
1250
|
className: "w6w-embed-conn-filter"
|
|
1089
1251
|
}
|
|
1090
1252
|
),
|
|
1091
|
-
L.length > 0 &&
|
|
1253
|
+
L.length > 0 && B.length === 0 && /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small", children: [
|
|
1092
1254
|
"No actions match “",
|
|
1093
|
-
|
|
1255
|
+
R,
|
|
1094
1256
|
"”."
|
|
1095
1257
|
] }),
|
|
1096
|
-
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Actions", children:
|
|
1097
|
-
const
|
|
1098
|
-
return /* @__PURE__ */
|
|
1099
|
-
/* @__PURE__ */
|
|
1258
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Actions", children: B.map((u) => {
|
|
1259
|
+
const $ = b.get(u.key) ?? [];
|
|
1260
|
+
return /* @__PURE__ */ l("li", { children: [
|
|
1261
|
+
/* @__PURE__ */ l(
|
|
1100
1262
|
"button",
|
|
1101
1263
|
{
|
|
1102
1264
|
type: "button",
|
|
1103
1265
|
className: "w6w-embed-conn-action",
|
|
1104
|
-
"data-testid": `connection-action-${
|
|
1105
|
-
onClick: () => n(
|
|
1266
|
+
"data-testid": `connection-action-${u.key}`,
|
|
1267
|
+
onClick: () => n(u.key),
|
|
1106
1268
|
children: [
|
|
1107
|
-
/* @__PURE__ */ t("strong", { children:
|
|
1269
|
+
/* @__PURE__ */ t("strong", { children: u.title }),
|
|
1108
1270
|
" ",
|
|
1109
|
-
/* @__PURE__ */ t("code", { className: "w6w-muted", children:
|
|
1271
|
+
/* @__PURE__ */ t("code", { className: "w6w-muted", children: u.key }),
|
|
1110
1272
|
" ",
|
|
1111
|
-
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children:
|
|
1112
|
-
|
|
1273
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: u.type }),
|
|
1274
|
+
u.description && /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: u.description })
|
|
1113
1275
|
]
|
|
1114
1276
|
}
|
|
1115
1277
|
),
|
|
1116
|
-
|
|
1278
|
+
$.length > 0 && /* @__PURE__ */ t(
|
|
1117
1279
|
"ul",
|
|
1118
1280
|
{
|
|
1119
1281
|
className: "w6w-embed-conn-list w6w-embed-conn-tests",
|
|
1120
|
-
"aria-label": `Saved tests for ${
|
|
1121
|
-
children:
|
|
1122
|
-
|
|
1282
|
+
"aria-label": `Saved tests for ${u.title || u.key}`,
|
|
1283
|
+
children: $.map((I) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
1284
|
+
te,
|
|
1123
1285
|
{
|
|
1124
|
-
title:
|
|
1125
|
-
subtitle:
|
|
1286
|
+
title: I.name,
|
|
1287
|
+
subtitle: I.lastRunAt ? /* @__PURE__ */ l("span", { children: [
|
|
1126
1288
|
/* @__PURE__ */ t(
|
|
1127
1289
|
"span",
|
|
1128
1290
|
{
|
|
1129
|
-
className:
|
|
1130
|
-
children:
|
|
1291
|
+
className: I.lastRunOk ? "w6w-embed-conn-ok" : "w6w-embed-conn-fail",
|
|
1292
|
+
children: I.lastRunOk ? "✓" : "✗"
|
|
1131
1293
|
}
|
|
1132
1294
|
),
|
|
1133
1295
|
" ",
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
] }) : `saved ${
|
|
1137
|
-
onClick: () => n(
|
|
1296
|
+
I.lastRunSummary ? `${I.lastRunSummary} · ` : "",
|
|
1297
|
+
ee(I.lastRunAt)
|
|
1298
|
+
] }) : `saved ${ee(I.updatedAt)}`,
|
|
1299
|
+
onClick: () => n(u.key, I.id)
|
|
1138
1300
|
}
|
|
1139
|
-
) },
|
|
1301
|
+
) }, I.id))
|
|
1140
1302
|
}
|
|
1141
1303
|
)
|
|
1142
|
-
] },
|
|
1304
|
+
] }, u.key);
|
|
1143
1305
|
}) })
|
|
1144
1306
|
] }),
|
|
1145
|
-
|
|
1307
|
+
g && /* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", "data-testid": "connection-used-by", children: [
|
|
1308
|
+
/* @__PURE__ */ t("h3", { children: "Used by" }),
|
|
1309
|
+
p.length === 0 && T.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Not used by any callable" }) : /* @__PURE__ */ t(
|
|
1310
|
+
Pe,
|
|
1311
|
+
{
|
|
1312
|
+
callables: p,
|
|
1313
|
+
routes: T,
|
|
1314
|
+
projectId: m,
|
|
1315
|
+
onOpenCallable: s
|
|
1316
|
+
}
|
|
1317
|
+
)
|
|
1318
|
+
] }),
|
|
1319
|
+
x.length > 0 && /* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1146
1320
|
/* @__PURE__ */ t("h3", { children: "Recent runs" }),
|
|
1147
1321
|
/* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Most recent tester runs against this connection." }),
|
|
1148
|
-
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Recent runs", children:
|
|
1149
|
-
|
|
1322
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Recent runs", children: x.map((u) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
1323
|
+
te,
|
|
1150
1324
|
{
|
|
1151
|
-
title:
|
|
1152
|
-
subtitle: /* @__PURE__ */
|
|
1153
|
-
/* @__PURE__ */ t("span", { className:
|
|
1325
|
+
title: u.actionKey,
|
|
1326
|
+
subtitle: /* @__PURE__ */ l("span", { children: [
|
|
1327
|
+
/* @__PURE__ */ t("span", { className: u.ok ? "w6w-embed-conn-ok" : "w6w-embed-conn-fail", children: u.ok ? "✓" : "✗" }),
|
|
1154
1328
|
" ",
|
|
1155
|
-
|
|
1156
|
-
|
|
1329
|
+
u.summary ? `${u.summary} · ` : "",
|
|
1330
|
+
ee(u.occurredAt)
|
|
1157
1331
|
] })
|
|
1158
1332
|
}
|
|
1159
|
-
) },
|
|
1333
|
+
) }, u.id)) })
|
|
1160
1334
|
] }),
|
|
1161
1335
|
v && /* @__PURE__ */ t(
|
|
1162
|
-
|
|
1336
|
+
ye,
|
|
1163
1337
|
{
|
|
1164
|
-
connection:
|
|
1165
|
-
onClose: () =>
|
|
1338
|
+
connection: P,
|
|
1339
|
+
onClose: () => O(!1),
|
|
1166
1340
|
onSaved: () => {
|
|
1167
|
-
|
|
1341
|
+
O(!1), r.invalidateQueries({ queryKey: Te(e) }), r.invalidateQueries({ queryKey: ne });
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
)
|
|
1345
|
+
] });
|
|
1346
|
+
}
|
|
1347
|
+
const mn = {};
|
|
1348
|
+
function he(e) {
|
|
1349
|
+
return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1350
|
+
}
|
|
1351
|
+
function H(e) {
|
|
1352
|
+
return (e / 100).toFixed(2);
|
|
1353
|
+
}
|
|
1354
|
+
function hn(e) {
|
|
1355
|
+
if (e == null) return null;
|
|
1356
|
+
const n = e.rates, i = [];
|
|
1357
|
+
return n.input != null && i.push(`in ${H(n.input)}`), n.output != null && i.push(`out ${H(n.output)}`), n.cachedInput != null && i.push(`cached ${H(n.cachedInput)}`), n.cacheWrite != null && i.push(`cache write ${H(n.cacheWrite)}`), n.perRequest != null && i.push(`${H(n.perRequest)}/request`), i.length === 0 ? null : `${n.currency ?? "USD"} ${i.join(" · ")}`;
|
|
1358
|
+
}
|
|
1359
|
+
function wn(e) {
|
|
1360
|
+
const { maxInputTokens: n, maxOutputTokens: i } = e.limits ?? {};
|
|
1361
|
+
if (n == null && i == null) return "—";
|
|
1362
|
+
const s = [];
|
|
1363
|
+
return n != null && s.push(`${he(n)} in`), i != null && s.push(`${he(i)} out`), s.join(" · ");
|
|
1364
|
+
}
|
|
1365
|
+
const pn = [
|
|
1366
|
+
{
|
|
1367
|
+
key: "model",
|
|
1368
|
+
header: "Model",
|
|
1369
|
+
render: (e) => /* @__PURE__ */ l("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
|
|
1370
|
+
/* @__PURE__ */ t("strong", { className: "list-name", title: e.displayName, children: e.displayName }),
|
|
1371
|
+
/* @__PURE__ */ l("div", { className: "muted small list-preview", title: `${e.provider} · ${e.nativeId}`, children: [
|
|
1372
|
+
e.provider,
|
|
1373
|
+
" · ",
|
|
1374
|
+
e.nativeId,
|
|
1375
|
+
" · ",
|
|
1376
|
+
e.source
|
|
1377
|
+
] })
|
|
1378
|
+
] })
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
key: "provider",
|
|
1382
|
+
header: "Provider",
|
|
1383
|
+
render: (e) => /* @__PURE__ */ t("span", { className: "muted small", children: e.provider || "—" })
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
key: "status",
|
|
1387
|
+
header: "Status",
|
|
1388
|
+
render: (e) => /* @__PURE__ */ t("span", { className: e.status === "active" ? "tag" : "tag warn", children: e.status })
|
|
1389
|
+
},
|
|
1390
|
+
{
|
|
1391
|
+
key: "rate",
|
|
1392
|
+
header: "Rate (per 1M tokens)",
|
|
1393
|
+
render: (e) => {
|
|
1394
|
+
const n = hn(e.currentRate);
|
|
1395
|
+
return n == null ? /* @__PURE__ */ t("span", { className: "muted small", children: "—" }) : /* @__PURE__ */ t(
|
|
1396
|
+
"span",
|
|
1397
|
+
{
|
|
1398
|
+
className: "muted small",
|
|
1399
|
+
title: e.currentRate ? `effective ${e.currentRate.effectiveFrom}` : void 0,
|
|
1400
|
+
children: n
|
|
1168
1401
|
}
|
|
1402
|
+
);
|
|
1403
|
+
}
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
key: "limits",
|
|
1407
|
+
header: "Limits",
|
|
1408
|
+
render: (e) => /* @__PURE__ */ t("span", { className: "muted small", children: wn(e) })
|
|
1409
|
+
}
|
|
1410
|
+
];
|
|
1411
|
+
function na(e) {
|
|
1412
|
+
var o;
|
|
1413
|
+
const n = Le(), i = e.filter ?? mn, s = $e({
|
|
1414
|
+
queryKey: It(i),
|
|
1415
|
+
initialPageParam: void 0,
|
|
1416
|
+
getNextPageParam: (r) => r.nextCursor ?? void 0,
|
|
1417
|
+
queryFn: ({ pageParam: r }) => $t(n, r ? { ...i, cursor: r } : i)
|
|
1418
|
+
}), a = ((o = s.data) == null ? void 0 : o.pages.flatMap((r) => r.models)) ?? [];
|
|
1419
|
+
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ l("section", { className: "section", children: [
|
|
1420
|
+
/* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ l("div", { children: [
|
|
1421
|
+
/* @__PURE__ */ t("h3", { children: "Model catalog" }),
|
|
1422
|
+
/* @__PURE__ */ t("p", { className: "muted small", children: "The models discovered on this tenant's connections, plus any added by hand. A route may only name a model from this list; the rate card is what usage is priced with." })
|
|
1423
|
+
] }) }),
|
|
1424
|
+
/* @__PURE__ */ l("div", { className: "card", children: [
|
|
1425
|
+
s.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
|
|
1426
|
+
s.error != null && /* @__PURE__ */ t("div", { className: "error", children: s.error.message }),
|
|
1427
|
+
s.isSuccess && a.length === 0 && /* @__PURE__ */ t(se, { testId: "model-catalog-empty", children: "No models yet. Discover them from a provider connection to start routing to them." }),
|
|
1428
|
+
a.length > 0 && /* @__PURE__ */ t(
|
|
1429
|
+
le,
|
|
1430
|
+
{
|
|
1431
|
+
columns: pn,
|
|
1432
|
+
rows: a,
|
|
1433
|
+
rowKey: (r) => r.id,
|
|
1434
|
+
testId: "model-catalog-table",
|
|
1435
|
+
rowTestId: (r) => `model-catalog-${r.id}`
|
|
1436
|
+
}
|
|
1437
|
+
)
|
|
1438
|
+
] }),
|
|
1439
|
+
s.hasNextPage && /* @__PURE__ */ t("div", { className: "row", children: /* @__PURE__ */ t(
|
|
1440
|
+
"button",
|
|
1441
|
+
{
|
|
1442
|
+
type: "button",
|
|
1443
|
+
className: "btn ghost",
|
|
1444
|
+
disabled: s.isFetchingNextPage,
|
|
1445
|
+
onClick: () => void s.fetchNextPage(),
|
|
1446
|
+
"data-testid": "model-catalog-load-more",
|
|
1447
|
+
children: s.isFetchingNextPage ? "Loading…" : "Load more"
|
|
1448
|
+
}
|
|
1449
|
+
) })
|
|
1450
|
+
] }) });
|
|
1451
|
+
}
|
|
1452
|
+
const fn = {};
|
|
1453
|
+
function A(e) {
|
|
1454
|
+
return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1455
|
+
}
|
|
1456
|
+
function gn(e) {
|
|
1457
|
+
return `${e.currency} ${(e.amountMinor / 100).toFixed(2)}`;
|
|
1458
|
+
}
|
|
1459
|
+
function Nn(e, n) {
|
|
1460
|
+
return e.length > 0 ? e.map(gn).join(" · ") : n > 0 ? "unpriced" : "—";
|
|
1461
|
+
}
|
|
1462
|
+
function yn(e) {
|
|
1463
|
+
return e.costMinor == null ? null : `${e.currency ?? "USD"} ${(e.costMinor / 100).toFixed(2)}`;
|
|
1464
|
+
}
|
|
1465
|
+
function bn(e) {
|
|
1466
|
+
return e.totalsTruncated === !0;
|
|
1467
|
+
}
|
|
1468
|
+
const vn = [
|
|
1469
|
+
{
|
|
1470
|
+
key: "occurredAt",
|
|
1471
|
+
header: "When",
|
|
1472
|
+
render: (e) => /* @__PURE__ */ t("span", { className: "muted small", title: e.occurredAt, children: xe(e.occurredAt) })
|
|
1473
|
+
},
|
|
1474
|
+
{
|
|
1475
|
+
key: "model",
|
|
1476
|
+
header: "Model",
|
|
1477
|
+
render: (e) => /* @__PURE__ */ l("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
|
|
1478
|
+
/* @__PURE__ */ l("strong", { className: "list-name", title: `${e.provider} · ${e.nativeId}`, children: [
|
|
1479
|
+
e.provider,
|
|
1480
|
+
" · ",
|
|
1481
|
+
e.nativeId
|
|
1482
|
+
] }),
|
|
1483
|
+
/* @__PURE__ */ t("div", { className: "muted small list-preview", title: e.connectionId, children: e.connectionId })
|
|
1484
|
+
] })
|
|
1485
|
+
},
|
|
1486
|
+
{
|
|
1487
|
+
key: "route",
|
|
1488
|
+
header: "Route",
|
|
1489
|
+
render: (e) => e.routeId == null ? /* @__PURE__ */ t("span", { className: "muted small", children: "direct" }) : /* @__PURE__ */ t("code", { className: "muted small", title: e.routeId, children: e.routeId })
|
|
1490
|
+
},
|
|
1491
|
+
{
|
|
1492
|
+
key: "tokens",
|
|
1493
|
+
header: "Tokens",
|
|
1494
|
+
align: "right",
|
|
1495
|
+
render: (e) => /* @__PURE__ */ t(
|
|
1496
|
+
"span",
|
|
1497
|
+
{
|
|
1498
|
+
className: "muted small",
|
|
1499
|
+
title: `${A(e.inputTokens)} in · ${A(e.outputTokens)} out · ${A(e.cachedInputTokens)} cached input · ${A(e.cacheWriteTokens)} cache write`,
|
|
1500
|
+
children: A(e.totalTokens)
|
|
1169
1501
|
}
|
|
1170
1502
|
)
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
key: "cost",
|
|
1506
|
+
header: "Cost",
|
|
1507
|
+
align: "right",
|
|
1508
|
+
render: (e) => {
|
|
1509
|
+
const n = yn(e);
|
|
1510
|
+
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 });
|
|
1511
|
+
}
|
|
1512
|
+
},
|
|
1513
|
+
{
|
|
1514
|
+
key: "result",
|
|
1515
|
+
header: "Result",
|
|
1516
|
+
render: (e) => {
|
|
1517
|
+
const n = Ae(e.durationMs);
|
|
1518
|
+
return /* @__PURE__ */ l("span", { className: "muted small", title: e.errorCode ?? void 0, children: [
|
|
1519
|
+
/* @__PURE__ */ t("span", { className: e.ok ? "tag" : "tag warn", children: e.ok ? "ok" : e.errorCode ?? "failed" }),
|
|
1520
|
+
n != null && /* @__PURE__ */ l(D, { children: [
|
|
1521
|
+
" · ",
|
|
1522
|
+
n
|
|
1523
|
+
] })
|
|
1524
|
+
] });
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
];
|
|
1528
|
+
function aa(e) {
|
|
1529
|
+
var w, N;
|
|
1530
|
+
const n = q(e.projectId), i = Le(), s = e.filter ?? fn, a = $e({
|
|
1531
|
+
queryKey: Lt(n ?? void 0, s),
|
|
1532
|
+
enabled: n != null,
|
|
1533
|
+
initialPageParam: void 0,
|
|
1534
|
+
getNextPageParam: (d) => d.nextCursor ?? void 0,
|
|
1535
|
+
queryFn: ({ pageParam: d }) => Tt(
|
|
1536
|
+
i,
|
|
1537
|
+
n,
|
|
1538
|
+
d ? { ...s, cursor: d } : s
|
|
1539
|
+
)
|
|
1540
|
+
}), o = ((w = a.data) == null ? void 0 : w.pages) ?? [], r = (N = o[0]) == null ? void 0 : N.totals, c = o.flatMap((d) => d.items), h = o.length > 0 && bn(o[0]);
|
|
1541
|
+
return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ l("section", { className: "section", children: [
|
|
1542
|
+
/* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ l("div", { children: [
|
|
1543
|
+
/* @__PURE__ */ t("h3", { children: "Model usage" }),
|
|
1544
|
+
/* @__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." })
|
|
1545
|
+
] }) }),
|
|
1546
|
+
n == null ? /* @__PURE__ */ t("div", { className: "card", children: /* @__PURE__ */ t("p", { className: "muted", "data-testid": "model-usage-no-project", children: "Select a project to see its model usage." }) }) : /* @__PURE__ */ l(D, { children: [
|
|
1547
|
+
/* @__PURE__ */ l("div", { className: "card", "data-testid": "model-usage-totals", children: [
|
|
1548
|
+
h && /* @__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." }),
|
|
1549
|
+
r == null ? (
|
|
1550
|
+
// A failed query is reported once, below — never as a perpetual "loading".
|
|
1551
|
+
a.error == null && /* @__PURE__ */ t("p", { className: "muted", children: "Loading totals…" })
|
|
1552
|
+
) : /* @__PURE__ */ l("p", { className: "muted small", children: [
|
|
1553
|
+
/* @__PURE__ */ l("span", { "data-testid": "model-usage-total-requests", children: [
|
|
1554
|
+
A(r.requests),
|
|
1555
|
+
" requests"
|
|
1556
|
+
] }),
|
|
1557
|
+
" · ",
|
|
1558
|
+
/* @__PURE__ */ l("span", { "data-testid": "model-usage-total-tokens", children: [
|
|
1559
|
+
A(r.totalTokens),
|
|
1560
|
+
" tokens (",
|
|
1561
|
+
A(r.inputTokens),
|
|
1562
|
+
" in /",
|
|
1563
|
+
" ",
|
|
1564
|
+
A(r.outputTokens),
|
|
1565
|
+
" out / ",
|
|
1566
|
+
A(r.cachedInputTokens),
|
|
1567
|
+
" cached / ",
|
|
1568
|
+
A(r.cacheWriteTokens),
|
|
1569
|
+
" cache write)"
|
|
1570
|
+
] }),
|
|
1571
|
+
" · ",
|
|
1572
|
+
/* @__PURE__ */ t("span", { "data-testid": "model-usage-total-cost", children: Nn(r.cost, r.unpriced) }),
|
|
1573
|
+
r.unpriced > 0 && /* @__PURE__ */ l(D, { children: [
|
|
1574
|
+
" · ",
|
|
1575
|
+
/* @__PURE__ */ l(
|
|
1576
|
+
"span",
|
|
1577
|
+
{
|
|
1578
|
+
className: "tag warn",
|
|
1579
|
+
"data-testid": "model-usage-unpriced-total",
|
|
1580
|
+
title: "calls with no usable rate — not included in any cost total",
|
|
1581
|
+
children: [
|
|
1582
|
+
A(r.unpriced),
|
|
1583
|
+
" unpriced"
|
|
1584
|
+
]
|
|
1585
|
+
}
|
|
1586
|
+
)
|
|
1587
|
+
] })
|
|
1588
|
+
] })
|
|
1589
|
+
] }),
|
|
1590
|
+
a.error != null && /* @__PURE__ */ t("div", { className: "error", role: "alert", "data-testid": "model-usage-error", children: a.error.message }),
|
|
1591
|
+
/* @__PURE__ */ l("div", { className: "card", children: [
|
|
1592
|
+
a.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
|
|
1593
|
+
a.isSuccess && c.length === 0 && /* @__PURE__ */ t(se, { testId: "model-usage-empty", children: "No model calls in this window. Usage rows appear here as routes are invoked." }),
|
|
1594
|
+
c.length > 0 && /* @__PURE__ */ t(
|
|
1595
|
+
le,
|
|
1596
|
+
{
|
|
1597
|
+
columns: vn,
|
|
1598
|
+
rows: c,
|
|
1599
|
+
rowKey: (d) => d.id,
|
|
1600
|
+
testId: "model-usage-table",
|
|
1601
|
+
rowTestId: (d) => `model-usage-${d.id}`
|
|
1602
|
+
}
|
|
1603
|
+
)
|
|
1604
|
+
] }),
|
|
1605
|
+
a.hasNextPage && /* @__PURE__ */ t("div", { className: "row", children: /* @__PURE__ */ t(
|
|
1606
|
+
"button",
|
|
1607
|
+
{
|
|
1608
|
+
type: "button",
|
|
1609
|
+
className: "btn ghost",
|
|
1610
|
+
disabled: a.isFetchingNextPage,
|
|
1611
|
+
onClick: () => void a.fetchNextPage(),
|
|
1612
|
+
"data-testid": "model-usage-load-more",
|
|
1613
|
+
children: a.isFetchingNextPage ? "Loading…" : "Load more"
|
|
1614
|
+
}
|
|
1615
|
+
) })
|
|
1616
|
+
] })
|
|
1617
|
+
] }) });
|
|
1618
|
+
}
|
|
1619
|
+
const kn = (e) => `${e} connection${e === 1 ? "" : "s"}`;
|
|
1620
|
+
function ia({ contract: e, onOpen: n, slots: i }) {
|
|
1621
|
+
const s = Mt(e ? { contract: e } : void 0), a = s.data ?? [];
|
|
1622
|
+
return /* @__PURE__ */ l("div", { className: "w6w-embed-root w6w-embed-cred-list", children: [
|
|
1623
|
+
(i == null ? void 0 : i.header) ?? /* @__PURE__ */ t("h2", { children: "Credentials" }),
|
|
1624
|
+
s.isLoading && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
|
|
1625
|
+
s.error && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", children: s.error.message }),
|
|
1626
|
+
!s.isLoading && !s.error && a.length === 0 && /* @__PURE__ */ t("div", { "data-testid": "credential-list-empty", children: (i == null ? void 0 : i.empty) ?? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No credentials yet." }) }),
|
|
1627
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Credentials", children: a.map((o) => {
|
|
1628
|
+
const r = Object.values(o.display)[0];
|
|
1629
|
+
return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l(
|
|
1630
|
+
"button",
|
|
1631
|
+
{
|
|
1632
|
+
type: "button",
|
|
1633
|
+
className: "w6w-embed-conn-action",
|
|
1634
|
+
"data-testid": `credential-row-${o.id}`,
|
|
1635
|
+
onClick: () => n == null ? void 0 : n(o.id),
|
|
1636
|
+
children: [
|
|
1637
|
+
/* @__PURE__ */ t("strong", { children: o.name }),
|
|
1638
|
+
" ",
|
|
1639
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: o.status }),
|
|
1640
|
+
r !== void 0 && /* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", children: [
|
|
1641
|
+
" ",
|
|
1642
|
+
r
|
|
1643
|
+
] }),
|
|
1644
|
+
/* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", children: [
|
|
1645
|
+
" · ",
|
|
1646
|
+
kn(o.connectionCount)
|
|
1647
|
+
] })
|
|
1648
|
+
]
|
|
1649
|
+
}
|
|
1650
|
+
) }, o.id);
|
|
1651
|
+
}) })
|
|
1652
|
+
] });
|
|
1653
|
+
}
|
|
1654
|
+
function Cn(e) {
|
|
1655
|
+
try {
|
|
1656
|
+
const n = JSON.parse(e);
|
|
1657
|
+
return n !== null && typeof n == "object" && !Array.isArray(n) ? n : null;
|
|
1658
|
+
} catch {
|
|
1659
|
+
return null;
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
const we = (e) => Number.isNaN(Date.parse(e)) ? e : new Date(e).toLocaleString();
|
|
1663
|
+
function sa({
|
|
1664
|
+
credentialId: e,
|
|
1665
|
+
onOpenConnection: n,
|
|
1666
|
+
onDeleted: i,
|
|
1667
|
+
onBack: s,
|
|
1668
|
+
slots: a
|
|
1669
|
+
}) {
|
|
1670
|
+
var $, I;
|
|
1671
|
+
const o = Dt(e), r = xt(e), c = At(e), h = Rt(e), w = Et(e), N = jt(), [d, y] = C(""), [k, b] = C(null), [g, m] = C(!1), [p, T] = C(
|
|
1672
|
+
null
|
|
1673
|
+
), [x, v] = C(null), [O, R] = C(!1), [E, j] = C(null), [M, S] = C(null), U = s && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: s, children: "← Credentials" });
|
|
1674
|
+
if (o.isLoading)
|
|
1675
|
+
return /* @__PURE__ */ t("div", { className: "w6w-embed-root w6w-embed-cred-detail", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) });
|
|
1676
|
+
const L = o.data;
|
|
1677
|
+
if (!L)
|
|
1678
|
+
return /* @__PURE__ */ l(
|
|
1679
|
+
"div",
|
|
1680
|
+
{
|
|
1681
|
+
className: "w6w-embed-root w6w-embed-cred-detail",
|
|
1682
|
+
"data-testid": "credential-not-found",
|
|
1683
|
+
children: [
|
|
1684
|
+
(a == null ? void 0 : a.empty) ?? /* @__PURE__ */ t("h2", { children: "Credential not found" }),
|
|
1685
|
+
U
|
|
1686
|
+
]
|
|
1687
|
+
}
|
|
1688
|
+
);
|
|
1689
|
+
const B = (($ = r.data) == null ? void 0 : $.connections) ?? [], P = L.connectionCount, F = L.status === "disabled", z = () => {
|
|
1690
|
+
m(!1);
|
|
1691
|
+
const f = Cn(d);
|
|
1692
|
+
if (!f) {
|
|
1693
|
+
b("Enter the new secret as a JSON object.");
|
|
1694
|
+
return;
|
|
1695
|
+
}
|
|
1696
|
+
b(null), c.mutate(
|
|
1697
|
+
{ source: f },
|
|
1698
|
+
{
|
|
1699
|
+
onSuccess: () => {
|
|
1700
|
+
y(""), m(!0);
|
|
1701
|
+
},
|
|
1702
|
+
onError: (W) => b((W == null ? void 0 : W.message) ?? "Rotate failed.")
|
|
1703
|
+
}
|
|
1704
|
+
);
|
|
1705
|
+
}, V = () => {
|
|
1706
|
+
T(null), v(null), w.mutate(void 0, {
|
|
1707
|
+
onSuccess: T,
|
|
1708
|
+
onError: (f) => v((f == null ? void 0 : f.message) ?? "Test failed.")
|
|
1709
|
+
});
|
|
1710
|
+
}, u = () => {
|
|
1711
|
+
S(null), N.mutate(e, {
|
|
1712
|
+
onSuccess: (f) => {
|
|
1713
|
+
R(!1), f.ok ? i == null || i() : j(f.dependents.connections);
|
|
1714
|
+
},
|
|
1715
|
+
onError: (f) => S((f == null ? void 0 : f.message) ?? "Delete failed.")
|
|
1716
|
+
});
|
|
1717
|
+
};
|
|
1718
|
+
return /* @__PURE__ */ l("div", { className: "w6w-embed-root w6w-embed-cred-detail w6w-card-stack", children: [
|
|
1719
|
+
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1720
|
+
/* @__PURE__ */ t("h2", { children: L.name }),
|
|
1721
|
+
/* @__PURE__ */ l("p", { className: "w6w-small", children: [
|
|
1722
|
+
/* @__PURE__ */ t("code", { children: L.contract }),
|
|
1723
|
+
" ",
|
|
1724
|
+
/* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: L.status })
|
|
1725
|
+
] }),
|
|
1726
|
+
/* @__PURE__ */ t("dl", { className: "w6w-small", "data-testid": "credential-display", children: Object.entries(L.display).map(([f, W]) => /* @__PURE__ */ l("div", { children: [
|
|
1727
|
+
/* @__PURE__ */ t("dt", { className: "w6w-muted", children: f }),
|
|
1728
|
+
/* @__PURE__ */ t("dd", { children: W })
|
|
1729
|
+
] }, f)) }),
|
|
1730
|
+
/* @__PURE__ */ l("p", { className: "w6w-muted w6w-small", children: [
|
|
1731
|
+
P,
|
|
1732
|
+
" connection",
|
|
1733
|
+
P === 1 ? "" : "s",
|
|
1734
|
+
" · created ",
|
|
1735
|
+
we(L.createdAt),
|
|
1736
|
+
" · updated ",
|
|
1737
|
+
we(L.updatedAt)
|
|
1738
|
+
] }),
|
|
1739
|
+
U
|
|
1740
|
+
] }),
|
|
1741
|
+
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", "data-testid": "credential-connections", children: [
|
|
1742
|
+
/* @__PURE__ */ t("h3", { children: "Connected apps" }),
|
|
1743
|
+
B.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: B.map((f) => /* @__PURE__ */ t("li", { children: n ? /* @__PURE__ */ t(
|
|
1744
|
+
"button",
|
|
1745
|
+
{
|
|
1746
|
+
type: "button",
|
|
1747
|
+
className: "w6w-embed-conn-action",
|
|
1748
|
+
onClick: () => n(f.id),
|
|
1749
|
+
children: f.displayName || f.appId
|
|
1750
|
+
}
|
|
1751
|
+
) : /* @__PURE__ */ t("span", { children: f.displayName || f.appId }) }, f.id)) })
|
|
1752
|
+
] }),
|
|
1753
|
+
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1754
|
+
/* @__PURE__ */ t("h3", { children: "Rotate secret" }),
|
|
1755
|
+
/* @__PURE__ */ l(
|
|
1756
|
+
"p",
|
|
1757
|
+
{
|
|
1758
|
+
className: "w6w-muted w6w-small",
|
|
1759
|
+
"data-testid": "credential-rotation-impact",
|
|
1760
|
+
children: [
|
|
1761
|
+
P,
|
|
1762
|
+
" connection",
|
|
1763
|
+
P === 1 ? "" : "s",
|
|
1764
|
+
" will be marked untested"
|
|
1765
|
+
]
|
|
1766
|
+
}
|
|
1767
|
+
),
|
|
1768
|
+
/* @__PURE__ */ t(
|
|
1769
|
+
"textarea",
|
|
1770
|
+
{
|
|
1771
|
+
className: "w6w-input w6w-secret-input",
|
|
1772
|
+
"aria-label": "New secret (JSON object)",
|
|
1773
|
+
rows: 5,
|
|
1774
|
+
value: d,
|
|
1775
|
+
onChange: (f) => y(f.target.value),
|
|
1776
|
+
name: "w6w-cred-rotate",
|
|
1777
|
+
autoComplete: "off",
|
|
1778
|
+
autoCapitalize: "off",
|
|
1779
|
+
autoCorrect: "off",
|
|
1780
|
+
spellCheck: !1,
|
|
1781
|
+
"data-1p-ignore": "true",
|
|
1782
|
+
"data-lpignore": "true",
|
|
1783
|
+
"data-bwignore": "true",
|
|
1784
|
+
"data-form-type": "other"
|
|
1785
|
+
}
|
|
1786
|
+
),
|
|
1787
|
+
k && /* @__PURE__ */ t(
|
|
1788
|
+
"p",
|
|
1789
|
+
{
|
|
1790
|
+
className: "w6w-error",
|
|
1791
|
+
role: "alert",
|
|
1792
|
+
"data-testid": "credential-rotate-error",
|
|
1793
|
+
children: k
|
|
1794
|
+
}
|
|
1795
|
+
),
|
|
1796
|
+
g && /* @__PURE__ */ t("output", { children: "Secret rotated." }),
|
|
1797
|
+
/* @__PURE__ */ t(
|
|
1798
|
+
"button",
|
|
1799
|
+
{
|
|
1800
|
+
type: "button",
|
|
1801
|
+
className: "w6w-btn",
|
|
1802
|
+
disabled: c.isPending,
|
|
1803
|
+
onClick: z,
|
|
1804
|
+
children: c.isPending ? "Rotating…" : "Rotate"
|
|
1805
|
+
}
|
|
1806
|
+
)
|
|
1807
|
+
] }),
|
|
1808
|
+
/* @__PURE__ */ l("div", { className: "w6w-embed-conn-card", children: [
|
|
1809
|
+
/* @__PURE__ */ t("h3", { children: "Manage" }),
|
|
1810
|
+
/* @__PURE__ */ l("div", { className: "w6w-modal-actions", children: [
|
|
1811
|
+
/* @__PURE__ */ t(
|
|
1812
|
+
"button",
|
|
1813
|
+
{
|
|
1814
|
+
type: "button",
|
|
1815
|
+
className: "w6w-btn w6w-btn-ghost",
|
|
1816
|
+
disabled: h.isPending,
|
|
1817
|
+
onClick: () => h.mutate(F ? "active" : "disabled"),
|
|
1818
|
+
children: F ? "Enable" : "Disable"
|
|
1819
|
+
}
|
|
1820
|
+
),
|
|
1821
|
+
/* @__PURE__ */ t(
|
|
1822
|
+
"button",
|
|
1823
|
+
{
|
|
1824
|
+
type: "button",
|
|
1825
|
+
className: "w6w-btn w6w-btn-ghost",
|
|
1826
|
+
disabled: w.isPending,
|
|
1827
|
+
onClick: V,
|
|
1828
|
+
children: w.isPending ? "Testing…" : "Test credential"
|
|
1829
|
+
}
|
|
1830
|
+
),
|
|
1831
|
+
/* @__PURE__ */ t(
|
|
1832
|
+
"button",
|
|
1833
|
+
{
|
|
1834
|
+
type: "button",
|
|
1835
|
+
className: "w6w-btn w6w-btn-danger",
|
|
1836
|
+
onClick: () => {
|
|
1837
|
+
j(null), R(!0);
|
|
1838
|
+
},
|
|
1839
|
+
children: "Delete"
|
|
1840
|
+
}
|
|
1841
|
+
)
|
|
1842
|
+
] }),
|
|
1843
|
+
p && /* @__PURE__ */ t("output", { "data-testid": "credential-test-result", children: p.ok ? "ok" : p.code ?? "failed" }),
|
|
1844
|
+
x && /* @__PURE__ */ t("p", { role: "alert", children: x }),
|
|
1845
|
+
h.isError && /* @__PURE__ */ t("p", { role: "alert", children: ((I = h.error) == null ? void 0 : I.message) ?? "Update failed." }),
|
|
1846
|
+
O && /* @__PURE__ */ l("div", { "data-testid": "credential-delete-confirm", children: [
|
|
1847
|
+
/* @__PURE__ */ l("p", { className: "w6w-small", children: [
|
|
1848
|
+
'Delete the credential "',
|
|
1849
|
+
L.name,
|
|
1850
|
+
'"? This cannot be undone.'
|
|
1851
|
+
] }),
|
|
1852
|
+
/* @__PURE__ */ t(
|
|
1853
|
+
"button",
|
|
1854
|
+
{
|
|
1855
|
+
type: "button",
|
|
1856
|
+
className: "w6w-btn w6w-btn-danger",
|
|
1857
|
+
disabled: N.isPending,
|
|
1858
|
+
onClick: u,
|
|
1859
|
+
children: "Confirm delete"
|
|
1860
|
+
}
|
|
1861
|
+
),
|
|
1862
|
+
" ",
|
|
1863
|
+
/* @__PURE__ */ t(
|
|
1864
|
+
"button",
|
|
1865
|
+
{
|
|
1866
|
+
type: "button",
|
|
1867
|
+
className: "w6w-btn w6w-btn-ghost",
|
|
1868
|
+
onClick: () => R(!1),
|
|
1869
|
+
children: "Cancel"
|
|
1870
|
+
}
|
|
1871
|
+
)
|
|
1872
|
+
] }),
|
|
1873
|
+
E && /* @__PURE__ */ l("div", { role: "alert", "data-testid": "credential-in-use", children: [
|
|
1874
|
+
/* @__PURE__ */ l("p", { className: "w6w-small", children: [
|
|
1875
|
+
"This credential is still used by ",
|
|
1876
|
+
E.length,
|
|
1877
|
+
" connection",
|
|
1878
|
+
E.length === 1 ? "" : "s",
|
|
1879
|
+
". Delete those integrations first, or rotate this credential instead of deleting it."
|
|
1880
|
+
] }),
|
|
1881
|
+
/* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", children: E.map((f) => /* @__PURE__ */ t("li", { children: f.displayName || f.appId }, f.id)) })
|
|
1882
|
+
] }),
|
|
1883
|
+
M && /* @__PURE__ */ t("p", { role: "alert", children: M })
|
|
1884
|
+
] })
|
|
1171
1885
|
] });
|
|
1172
1886
|
}
|
|
1173
1887
|
export {
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1888
|
+
zn as ActivitySummary,
|
|
1889
|
+
ta as ConnectionDetail,
|
|
1890
|
+
ea as ConnectionList,
|
|
1891
|
+
sa as CredentialDetail,
|
|
1892
|
+
ia as CredentialList,
|
|
1893
|
+
Jn as DocumentList,
|
|
1894
|
+
Vn as EndpointList,
|
|
1895
|
+
Un as FunctionList,
|
|
1896
|
+
na as ModelCatalog,
|
|
1897
|
+
aa as ModelUsage,
|
|
1898
|
+
Zn as ReliabilityBoard,
|
|
1899
|
+
Gn as RunHistory,
|
|
1900
|
+
Xn as ServiceDetail,
|
|
1901
|
+
Yn as WorkflowList
|
|
1184
1902
|
};
|
|
1185
1903
|
//# sourceMappingURL=lists.mjs.map
|