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