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