@nivaro/react 0.3.41 → 0.3.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/LayoutForm.js +100 -98
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +644 -15
- package/dist/index.js +814 -775
- package/dist/shared/components/ActivityEntry.js +154 -0
- package/dist/shared/components/AudienceConfirmPanel.js +98 -0
- package/dist/shared/components/BackgroundRunOffer.js +43 -31
- package/dist/shared/components/BroadcastView.js +225 -204
- package/dist/shared/components/CollectionBrowserView.js +3924 -3584
- package/dist/shared/components/ConfigHistory.js +153 -0
- package/dist/shared/components/ConfigReadBack.js +65 -0
- package/dist/shared/components/DataTable.js +379 -346
- package/dist/shared/components/ForceReloadBanner.js +47 -40
- package/dist/shared/components/IdleReloadWatcher.js +69 -0
- package/dist/shared/components/ItemEditForm.js +4041 -3853
- package/dist/shared/components/MyWorkView.js +278 -213
- package/dist/shared/components/NotificationBell.js +130 -121
- package/dist/shared/components/ProfileView.js +776 -1003
- package/dist/shared/components/RecentRecordsRail.js +34 -16
- package/dist/shared/components/RecordReadView.js +500 -477
- package/dist/shared/components/Skeletons.js +199 -0
- package/dist/shared/components/SlowNotice.js +63 -0
- package/dist/shared/components/Term.js +23 -0
- package/dist/shared/components/WidgetSlot.js +350 -353
- package/dist/shared/components/access/PermissionSummary.js +106 -0
- package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
- package/dist/shared/components/chat/ChatPanel.js +902 -886
- package/dist/shared/components/chat/MemberPaging.js +70 -0
- package/dist/shared/components/chat/RoomParts.js +147 -117
- package/dist/shared/components/chat/ScreenClip.js +73 -69
- package/dist/shared/components/chat/chat-core.js +449 -396
- package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
- package/dist/shared/components/help-videos/api.js +2 -5
- package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
- package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
- package/dist/shared/components/imports/RunDetailSheet.js +222 -227
- package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
- package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
- package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
- package/dist/shared/components/item-edit/FieldComments.js +212 -0
- package/dist/shared/components/item-edit/FieldRow.js +340 -336
- package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
- package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
- package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
- package/dist/shared/components/item-edit/field-comments-context.js +6 -0
- package/dist/shared/components/item-edit/field-sources.js +33 -0
- package/dist/shared/components/item-edit/rule-hidden.js +30 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
- package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
- package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/list/CopyListLinkButton.js +41 -0
- package/dist/shared/components/list/InlineEdit.js +363 -0
- package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
- package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
- package/dist/shared/components/notifications/TestMyRules.js +137 -0
- package/dist/shared/components/notifications/changes-lines.js +24 -0
- package/dist/shared/components/notifications/why-lines.js +64 -0
- package/dist/shared/components/panels/CommentPanel.js +316 -281
- package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
- package/dist/shared/components/panels/PipelinePanel.js +201 -196
- package/dist/shared/components/panels/RevisionsPanel.js +496 -479
- package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
- package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
- package/dist/shared/components/profile/PersonDidPanel.js +188 -0
- package/dist/shared/components/profile/PersonProfile.js +57 -52
- package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
- package/dist/shared/hooks/useSlowReason.js +39 -0
- package/dist/shared/lib/activity-sentence.js +670 -0
- package/dist/shared/lib/config-sentences.js +418 -0
- package/dist/shared/lib/core-glossary.js +229 -0
- package/dist/shared/lib/error-hints.js +159 -0
- package/dist/shared/lib/error-message.js +105 -0
- package/dist/shared/lib/error-toast.js +22 -0
- package/dist/shared/lib/field-comments.js +25 -0
- package/dist/shared/lib/filter-sentence.js +261 -0
- package/dist/shared/lib/glossary.js +55 -48
- package/dist/shared/lib/idle-reload.js +138 -0
- package/dist/shared/lib/layout-resolve.js +42 -29
- package/dist/shared/lib/list-inline-edit.js +190 -0
- package/dist/shared/lib/list-link.js +147 -0
- package/dist/shared/lib/prefetch.js +259 -106
- package/dist/shared/lib/record-ref.js +72 -0
- package/dist/shared/lib/reload-holds.js +25 -0
- package/dist/shared/lib/safe-error.js +52 -24
- package/dist/shared/lib/skeleton-shapes.js +72 -0
- package/dist/shared/lib/slow-reason.js +63 -0
- package/package.json +1 -1
|
@@ -1,170 +1,171 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as $ } from "react/jsx-runtime";
|
|
2
2
|
import { useQueryClient as q, useQuery as K, useMutation as S } from "@tanstack/react-query";
|
|
3
3
|
import { Search as L, Loader2 as A, Play as Q, ChevronDown as M } from "lucide-react";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as b, useRef as P, useEffect as E } from "react";
|
|
5
5
|
import { useNivaroClient as O } from "../../../context.js";
|
|
6
6
|
import { get as H, post as R } from "../../../lib/commands.js";
|
|
7
|
-
import { cn as
|
|
7
|
+
import { cn as m } from "../../../lib/utils.js";
|
|
8
8
|
import { Sheet as j, SheetContent as U, SheetTitle as N, SheetDescription as w } from "../../ui/sheet.js";
|
|
9
9
|
import { IntegrationObligationsView as V } from "../IntegrationObligationsView.js";
|
|
10
10
|
import { usePartner as W, useCallDetail as X } from "./api.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
11
|
+
import { ErrorExplanation as z } from "./ErrorExplanation.js";
|
|
12
|
+
import { HealthPill as G, PartnerFlags as J, fmtPct as Y, fmtMs as v, HourlyBars as Z } from "./PartnerBits.js";
|
|
13
|
+
import { SubmissionRow as I } from "./SubmissionRow.js";
|
|
14
|
+
import { TONE_TEXT as h, TONE_SOFT as f, agoText as D, exactTime as F } from "./tone.js";
|
|
15
|
+
import { describeCallTrigger as ee, TriggerChip as te } from "./drill/trigger.js";
|
|
15
16
|
import { HeaderTable as k, CodeBlock as C, isTruncatedBody as _, pretty as T } from "./drill/json.js";
|
|
16
|
-
import { HttpStatusChip as
|
|
17
|
-
function
|
|
18
|
-
return
|
|
17
|
+
import { HttpStatusChip as re } from "./drill/status.js";
|
|
18
|
+
function ae(l) {
|
|
19
|
+
return l != null && l >= 200 && l < 300;
|
|
19
20
|
}
|
|
20
|
-
const
|
|
21
|
+
const ne = [
|
|
21
22
|
{ key: "calls", label: "Recent calls" },
|
|
22
23
|
{ key: "submissions", label: "Submissions" },
|
|
23
24
|
{ key: "obligations", label: "Obligations" },
|
|
24
25
|
{ key: "contracts", label: "Contracts" }
|
|
25
26
|
];
|
|
26
|
-
function
|
|
27
|
-
const { data: n, isLoading:
|
|
28
|
-
|
|
27
|
+
function Se({ apiId: l, onClose: t, initialTab: r = "calls" }) {
|
|
28
|
+
const { data: n, isLoading: o, isError: u } = W(l), [i, d] = b(r), c = n == null ? void 0 : n.card, g = P(0), x = (s) => {
|
|
29
|
+
g.current += s ? 1 : -1;
|
|
29
30
|
};
|
|
30
|
-
return /* @__PURE__ */ e(j, { open: !0, onOpenChange: (
|
|
31
|
+
return /* @__PURE__ */ e(j, { open: !0, onOpenChange: (s) => !s && t(), children: /* @__PURE__ */ a(
|
|
31
32
|
U,
|
|
32
33
|
{
|
|
33
34
|
className: "flex flex-col gap-0 overflow-hidden p-0",
|
|
34
35
|
style: { width: 1040, maxWidth: "94vw" },
|
|
35
|
-
"data-ic-partner-detail":
|
|
36
|
-
onEscapeKeyDown: (
|
|
37
|
-
|
|
36
|
+
"data-ic-partner-detail": l,
|
|
37
|
+
onEscapeKeyDown: (s) => {
|
|
38
|
+
g.current > 0 && s.preventDefault();
|
|
38
39
|
},
|
|
39
40
|
children: [
|
|
40
|
-
/* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-6 pb-0 pt-5", children:
|
|
41
|
+
/* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-6 pb-0 pt-5", children: o || !c ? /* @__PURE__ */ a("div", { className: "space-y-2 pb-4", children: [
|
|
41
42
|
/* @__PURE__ */ e(N, { className: "sr-only", children: "Partner" }),
|
|
42
43
|
/* @__PURE__ */ e(w, { className: "sr-only", children: "Loading partner detail" }),
|
|
43
44
|
/* @__PURE__ */ e("div", { className: "h-5 w-48 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }),
|
|
44
45
|
/* @__PURE__ */ e("div", { className: "h-4 w-80 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }),
|
|
45
|
-
|
|
46
|
-
] }) : /* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */ e(N, { className: "text-[17px] font-semibold", children:
|
|
49
|
-
/* @__PURE__ */ e(
|
|
50
|
-
/* @__PURE__ */ e(
|
|
46
|
+
u && /* @__PURE__ */ e("p", { className: m("text-[12.5px]", h.negative), children: "Couldn't load this partner." })
|
|
47
|
+
] }) : /* @__PURE__ */ a($, { children: [
|
|
48
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2.5 pr-8", children: [
|
|
49
|
+
/* @__PURE__ */ e(N, { className: "text-[17px] font-semibold", children: c.name }),
|
|
50
|
+
/* @__PURE__ */ e(G, { health: c.health }),
|
|
51
|
+
/* @__PURE__ */ e(J, { card: c })
|
|
51
52
|
] }),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
53
|
+
/* @__PURE__ */ a(w, { className: "mt-1 text-[12.5px] text-muted-foreground", children: [
|
|
54
|
+
c.calls24,
|
|
54
55
|
" call",
|
|
55
|
-
|
|
56
|
+
c.calls24 === 1 ? "" : "s",
|
|
56
57
|
" in the last 24 hours ·",
|
|
57
58
|
" ",
|
|
58
|
-
|
|
59
|
+
Y(c.success_pct24),
|
|
59
60
|
" succeeded · typically ",
|
|
60
|
-
|
|
61
|
+
v(c.p50_ms),
|
|
61
62
|
", slowest",
|
|
62
63
|
" ",
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
v(c.p95_ms),
|
|
65
|
+
c.owner ? ` · owner ${c.owner.name}` : ""
|
|
65
66
|
] }),
|
|
66
|
-
/* @__PURE__ */ e(
|
|
67
|
-
/* @__PURE__ */ e("div", { role: "tablist", "aria-label": "Partner detail", className: "-mb-px mt-3 flex gap-5", children:
|
|
67
|
+
/* @__PURE__ */ e(Z, { hourly: c.hourly, className: "mt-3 max-w-[720px]" }),
|
|
68
|
+
/* @__PURE__ */ e("div", { role: "tablist", "aria-label": "Partner detail", className: "-mb-px mt-3 flex gap-5", children: ne.map((s) => /* @__PURE__ */ e(
|
|
68
69
|
"button",
|
|
69
70
|
{
|
|
70
71
|
type: "button",
|
|
71
72
|
role: "tab",
|
|
72
|
-
"aria-selected":
|
|
73
|
-
"data-ic-detail-tab":
|
|
74
|
-
onClick: () =>
|
|
75
|
-
className:
|
|
73
|
+
"aria-selected": i === s.key,
|
|
74
|
+
"data-ic-detail-tab": s.key,
|
|
75
|
+
onClick: () => d(s.key),
|
|
76
|
+
className: m(
|
|
76
77
|
"border-b-2 pb-2 pt-1 text-[12.5px] font-medium transition-colors",
|
|
77
|
-
|
|
78
|
+
i === s.key ? "border-nvr-cyan text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
78
79
|
),
|
|
79
|
-
children:
|
|
80
|
+
children: s.label
|
|
80
81
|
},
|
|
81
|
-
|
|
82
|
+
s.key
|
|
82
83
|
)) })
|
|
83
84
|
] }) }),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
n &&
|
|
86
|
-
n &&
|
|
87
|
-
n &&
|
|
88
|
-
n &&
|
|
85
|
+
/* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-y-auto bg-muted/30 px-6 py-5", children: [
|
|
86
|
+
n && i === "calls" && /* @__PURE__ */ e(se, { apiId: l, calls: n.calls, onCallOpenChange: x }),
|
|
87
|
+
n && i === "submissions" && /* @__PURE__ */ e(de, { apiId: l }),
|
|
88
|
+
n && i === "obligations" && /* @__PURE__ */ e(V, { api: n.card.name }),
|
|
89
|
+
n && i === "contracts" && /* @__PURE__ */ e(ce, { apiId: l, data: n })
|
|
89
90
|
] })
|
|
90
91
|
]
|
|
91
92
|
}
|
|
92
93
|
) });
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
-
apiId:
|
|
95
|
+
function se({
|
|
96
|
+
apiId: l,
|
|
96
97
|
calls: t,
|
|
97
|
-
onCallOpenChange:
|
|
98
|
+
onCallOpenChange: r
|
|
98
99
|
}) {
|
|
99
|
-
const [n,
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
100
|
+
const [n, o] = b(!1), u = t.filter((d) => !d.ok).length, i = n ? t.filter((d) => !d.ok) : t;
|
|
101
|
+
return /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
102
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
|
|
103
|
+
/* @__PURE__ */ a("p", { className: "text-[12.5px] text-muted-foreground", children: [
|
|
103
104
|
"The latest ",
|
|
104
105
|
t.length,
|
|
105
106
|
" call",
|
|
106
107
|
t.length === 1 ? "" : "s",
|
|
107
108
|
" made to this partner."
|
|
108
109
|
] }),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ a("label", { className: "ml-auto inline-flex cursor-pointer items-center gap-2 text-[12.5px] text-foreground", children: [
|
|
110
111
|
/* @__PURE__ */ e(
|
|
111
112
|
"input",
|
|
112
113
|
{
|
|
113
114
|
type: "checkbox",
|
|
114
115
|
checked: n,
|
|
115
|
-
onChange: (
|
|
116
|
+
onChange: (d) => o(d.target.checked),
|
|
116
117
|
"data-ic-failures-only": !0,
|
|
117
118
|
className: "h-3.5 w-3.5 accent-[rgb(var(--nvr-cyan-rgb))]"
|
|
118
119
|
}
|
|
119
120
|
),
|
|
120
121
|
"Failures only",
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ a("span", { className: "tabular-nums text-muted-foreground", children: [
|
|
122
123
|
"(",
|
|
123
|
-
|
|
124
|
+
u,
|
|
124
125
|
")"
|
|
125
126
|
] })
|
|
126
127
|
] })
|
|
127
128
|
] }),
|
|
128
|
-
|
|
129
|
+
i.length === 0 ? /* @__PURE__ */ e("p", { className: "rounded-lg border border-border bg-card px-4 py-5 text-[12.5px] text-muted-foreground", children: n ? "No failed calls in this window." : "No calls recorded in the last 14 days." }) : /* @__PURE__ */ e(
|
|
129
130
|
"ul",
|
|
130
131
|
{
|
|
131
132
|
className: "divide-y divide-border overflow-hidden rounded-lg border border-border bg-card",
|
|
132
133
|
"data-ic-calls": !0,
|
|
133
|
-
children:
|
|
134
|
+
children: i.map((d) => /* @__PURE__ */ e(ie, { apiId: l, call: d, onOpenChange: r }, d.key))
|
|
134
135
|
}
|
|
135
136
|
)
|
|
136
137
|
] });
|
|
137
138
|
}
|
|
138
|
-
function
|
|
139
|
-
apiId:
|
|
139
|
+
function ie({
|
|
140
|
+
apiId: l,
|
|
140
141
|
call: t,
|
|
141
|
-
onOpenChange:
|
|
142
|
+
onOpenChange: r
|
|
142
143
|
}) {
|
|
143
|
-
var
|
|
144
|
-
const [n,
|
|
145
|
-
var
|
|
146
|
-
|
|
144
|
+
var c, g, x;
|
|
145
|
+
const [n, o] = b(!1), u = P(null), i = ee(t.triggered_by, t.user), d = () => {
|
|
146
|
+
var s;
|
|
147
|
+
o(!1), (s = u.current) == null || s.focus();
|
|
147
148
|
};
|
|
148
149
|
return E(() => {
|
|
149
150
|
if (n)
|
|
150
|
-
return
|
|
151
|
-
}, [n]), /* @__PURE__ */
|
|
151
|
+
return r(!0), () => r(!1);
|
|
152
|
+
}, [n]), /* @__PURE__ */ a(
|
|
152
153
|
"li",
|
|
153
154
|
{
|
|
154
155
|
"data-ic-call": t.id,
|
|
155
156
|
"data-ic-call-source": t.source,
|
|
156
|
-
className:
|
|
157
|
+
className: m(n && "bg-muted/30"),
|
|
157
158
|
children: [
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ a(
|
|
159
160
|
"button",
|
|
160
161
|
{
|
|
161
|
-
ref:
|
|
162
|
+
ref: u,
|
|
162
163
|
type: "button",
|
|
163
164
|
"aria-expanded": n,
|
|
164
165
|
"data-ic-call-toggle": t.id,
|
|
165
|
-
onClick: () =>
|
|
166
|
-
onKeyDown: (
|
|
167
|
-
|
|
166
|
+
onClick: () => o((s) => !s),
|
|
167
|
+
onKeyDown: (s) => {
|
|
168
|
+
s.key === "Escape" && n && (s.preventDefault(), s.stopPropagation(), o(!1));
|
|
168
169
|
},
|
|
169
170
|
className: "flex w-full items-center gap-3 px-3 py-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
|
|
170
171
|
children: [
|
|
@@ -176,7 +177,7 @@ function se({
|
|
|
176
177
|
children: D(t.created_at)
|
|
177
178
|
}
|
|
178
179
|
),
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate font-mono text-[11.5px] text-foreground", children: [
|
|
180
181
|
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: t.method ?? "" }),
|
|
181
182
|
" ",
|
|
182
183
|
t.path ?? "—"
|
|
@@ -184,37 +185,37 @@ function se({
|
|
|
184
185
|
/* @__PURE__ */ e(
|
|
185
186
|
"span",
|
|
186
187
|
{
|
|
187
|
-
className:
|
|
188
|
+
className: m(
|
|
188
189
|
"w-10 shrink-0 text-right text-[11.5px] font-medium tabular-nums",
|
|
189
|
-
t.ok ?
|
|
190
|
+
t.ok ? h.positive : h.negative
|
|
190
191
|
),
|
|
191
192
|
children: t.status ?? (t.ok ? "ok" : "none")
|
|
192
193
|
}
|
|
193
194
|
),
|
|
194
|
-
/* @__PURE__ */ e("span", { className: "w-14 shrink-0 text-right text-[11.5px] tabular-nums text-muted-foreground", children:
|
|
195
|
-
t.error && /* @__PURE__ */ e(
|
|
195
|
+
/* @__PURE__ */ e("span", { className: "w-14 shrink-0 text-right text-[11.5px] tabular-nums text-muted-foreground", children: v(t.duration_ms) }),
|
|
196
|
+
(((c = t.explanation) == null ? void 0 : c.sentence) ?? t.error) && /* @__PURE__ */ e(
|
|
196
197
|
"span",
|
|
197
198
|
{
|
|
198
|
-
className:
|
|
199
|
-
"min-w-0 max-w-[
|
|
200
|
-
|
|
199
|
+
className: m(
|
|
200
|
+
"min-w-0 max-w-[260px] shrink truncate text-[11.5px]",
|
|
201
|
+
h.negative
|
|
201
202
|
),
|
|
202
|
-
"data-tip": t.error.length > 50 ? t.error.slice(0, 900) : void 0,
|
|
203
|
-
children: t.error
|
|
203
|
+
"data-tip": t.explanation ? t.explanation.sentence : t.error && t.error.length > 50 ? t.error.slice(0, 900) : void 0,
|
|
204
|
+
children: ((g = t.explanation) == null ? void 0 : g.sentence) ?? t.error
|
|
204
205
|
}
|
|
205
206
|
),
|
|
206
207
|
/* @__PURE__ */ e(
|
|
207
208
|
"span",
|
|
208
209
|
{
|
|
209
210
|
className: "min-w-0 max-w-[160px] shrink truncate text-[11px] text-muted-foreground",
|
|
210
|
-
"data-tip": ((
|
|
211
|
-
children:
|
|
211
|
+
"data-tip": ((x = t.user) == null ? void 0 : x.email) ?? void 0,
|
|
212
|
+
children: i.label
|
|
212
213
|
}
|
|
213
214
|
),
|
|
214
215
|
/* @__PURE__ */ e(
|
|
215
216
|
M,
|
|
216
217
|
{
|
|
217
|
-
className:
|
|
218
|
+
className: m(
|
|
218
219
|
"h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",
|
|
219
220
|
n && "rotate-180"
|
|
220
221
|
),
|
|
@@ -236,199 +237,199 @@ function se({
|
|
|
236
237
|
{
|
|
237
238
|
"aria-label": `Call detail — ${t.method ?? ""} ${t.path ?? ""}`.trim(),
|
|
238
239
|
"data-ic-call-open": t.id,
|
|
239
|
-
onKeyDown: (
|
|
240
|
-
|
|
240
|
+
onKeyDown: (s) => {
|
|
241
|
+
s.key === "Escape" && (s.stopPropagation(), d());
|
|
241
242
|
},
|
|
242
243
|
className: "border-t border-border px-3 py-3",
|
|
243
|
-
children: t.source === "outbound" ? /* @__PURE__ */ e("p", { className: "text-[12px] italic text-muted-foreground", "data-ic-call-empty": !0, children: "No request/response recorded for this call." }) : /* @__PURE__ */ e(
|
|
244
|
+
children: t.source === "outbound" ? /* @__PURE__ */ e("p", { className: "text-[12px] italic text-muted-foreground", "data-ic-call-empty": !0, children: "No request/response recorded for this call." }) : /* @__PURE__ */ e(oe, { apiId: l, callId: t.id })
|
|
244
245
|
}
|
|
245
246
|
)
|
|
246
247
|
]
|
|
247
248
|
}
|
|
248
249
|
);
|
|
249
250
|
}
|
|
250
|
-
function
|
|
251
|
-
const { data:
|
|
252
|
-
return n ? /* @__PURE__ */
|
|
251
|
+
function oe({ apiId: l, callId: t }) {
|
|
252
|
+
const { data: r, isLoading: n, isError: o } = X(l, t);
|
|
253
|
+
return n ? /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
253
254
|
/* @__PURE__ */ e("div", { className: "h-4 w-40 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }),
|
|
254
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ a("div", { className: "grid gap-3 lg:grid-cols-2", children: [
|
|
255
256
|
/* @__PURE__ */ e("div", { className: "h-28 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }),
|
|
256
257
|
/* @__PURE__ */ e("div", { className: "h-28 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" })
|
|
257
258
|
] })
|
|
258
|
-
] }) :
|
|
259
|
-
/* @__PURE__ */
|
|
259
|
+
] }) : o || !r ? /* @__PURE__ */ e("p", { className: m("text-[12.5px]", h.negative), children: "Couldn't load this call." }) : /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
260
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", "data-ic-call-section": "trigger", children: [
|
|
260
261
|
/* @__PURE__ */ e("span", { className: "text-[11.5px] font-semibold text-muted-foreground", children: "Triggered by" }),
|
|
261
|
-
/* @__PURE__ */ e(
|
|
262
|
+
/* @__PURE__ */ e(te, { triggeredBy: r.triggered_by, user: r.user })
|
|
262
263
|
] }),
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ a("div", { className: "grid gap-3 lg:grid-cols-2", children: [
|
|
265
|
+
/* @__PURE__ */ a("div", { className: "min-w-0 space-y-2", "data-ic-call-section": "request", children: [
|
|
265
266
|
/* @__PURE__ */ e("p", { className: "text-[11.5px] font-semibold text-muted-foreground", children: "Request" }),
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ a(
|
|
267
268
|
"p",
|
|
268
269
|
{
|
|
269
270
|
className: "truncate font-mono text-[11.5px] text-foreground",
|
|
270
|
-
"data-tip":
|
|
271
|
+
"data-tip": r.url ?? void 0,
|
|
271
272
|
children: [
|
|
272
|
-
/* @__PURE__ */ e("span", { className: "font-semibold text-muted-foreground", children:
|
|
273
|
+
/* @__PURE__ */ e("span", { className: "font-semibold text-muted-foreground", children: r.method ?? "—" }),
|
|
273
274
|
" ",
|
|
274
|
-
|
|
275
|
+
r.url ?? "—"
|
|
275
276
|
]
|
|
276
277
|
}
|
|
277
278
|
),
|
|
278
|
-
/* @__PURE__ */ e(k, { headers:
|
|
279
|
+
/* @__PURE__ */ e(k, { headers: r.request_headers }),
|
|
279
280
|
/* @__PURE__ */ e(
|
|
280
281
|
C,
|
|
281
282
|
{
|
|
282
283
|
label: "Body",
|
|
283
|
-
value: T(
|
|
284
|
+
value: T(r.request_body),
|
|
284
285
|
fold: !0,
|
|
285
|
-
truncated: _(
|
|
286
|
+
truncated: _(r.request_body)
|
|
286
287
|
}
|
|
287
288
|
)
|
|
288
289
|
] }),
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ a("div", { className: "min-w-0 space-y-2", "data-ic-call-section": "response", children: [
|
|
290
291
|
/* @__PURE__ */ e("p", { className: "text-[11.5px] font-semibold text-muted-foreground", children: "Response" }),
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
/* @__PURE__ */ e(
|
|
293
|
-
/* @__PURE__ */ e("span", { className: "text-[11.5px] tabular-nums text-muted-foreground", children:
|
|
292
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
293
|
+
/* @__PURE__ */ e(re, { status: r.response_status, ok: ae(r.response_status) }),
|
|
294
|
+
/* @__PURE__ */ e("span", { className: "text-[11.5px] tabular-nums text-muted-foreground", children: v(r.duration_ms) })
|
|
294
295
|
] }),
|
|
295
|
-
|
|
296
|
+
r.explanation ? /* @__PURE__ */ e(z, { explanation: r.explanation, raw: r.error }) : r.error && /* @__PURE__ */ e(
|
|
296
297
|
"p",
|
|
297
298
|
{
|
|
298
|
-
className:
|
|
299
|
+
className: m(
|
|
299
300
|
"rounded px-2 py-1.5 text-[11.5px]",
|
|
300
|
-
|
|
301
|
-
|
|
301
|
+
f.negative,
|
|
302
|
+
h.negative
|
|
302
303
|
),
|
|
303
|
-
children:
|
|
304
|
+
children: r.error
|
|
304
305
|
}
|
|
305
306
|
),
|
|
306
|
-
/* @__PURE__ */ e(k, { headers:
|
|
307
|
+
/* @__PURE__ */ e(k, { headers: r.response_headers }),
|
|
307
308
|
/* @__PURE__ */ e(
|
|
308
309
|
C,
|
|
309
310
|
{
|
|
310
311
|
label: "Body",
|
|
311
|
-
value: T(
|
|
312
|
+
value: T(r.response_body),
|
|
312
313
|
fold: !0,
|
|
313
|
-
truncated: _(
|
|
314
|
+
truncated: _(r.response_body)
|
|
314
315
|
}
|
|
315
316
|
)
|
|
316
317
|
] })
|
|
317
318
|
] })
|
|
318
319
|
] });
|
|
319
320
|
}
|
|
320
|
-
const
|
|
321
|
-
function
|
|
322
|
-
const t = O(),
|
|
321
|
+
const le = "endpoint_path";
|
|
322
|
+
function de({ apiId: l }) {
|
|
323
|
+
const t = O(), r = q(), [n, o] = b(""), [u, i] = b("");
|
|
323
324
|
E(() => {
|
|
324
|
-
const
|
|
325
|
-
return () => clearTimeout(
|
|
325
|
+
const p = setTimeout(() => i(n.trim()), 350);
|
|
326
|
+
return () => clearTimeout(p);
|
|
326
327
|
}, [n]);
|
|
327
|
-
const
|
|
328
|
-
queryKey: ["erp-submissions", "partner",
|
|
328
|
+
const d = u.length >= 2 ? u : le, { data: c, isLoading: g, isError: x } = K({
|
|
329
|
+
queryKey: ["erp-submissions", "partner", l, d],
|
|
329
330
|
queryFn: () => t.request(
|
|
330
|
-
H("/erp-submissions/search", { external_api:
|
|
331
|
-
).then((
|
|
332
|
-
}),
|
|
333
|
-
mutationFn: (
|
|
331
|
+
H("/erp-submissions/search", { external_api: l, q: d, limit: 50 })
|
|
332
|
+
).then((p) => p.data)
|
|
333
|
+
}), s = S({
|
|
334
|
+
mutationFn: (p) => t.request(R(`/erp-submissions/${p}/retry`)),
|
|
334
335
|
onSettled: () => {
|
|
335
|
-
|
|
336
|
+
r.invalidateQueries({ queryKey: ["erp-submissions"] }), r.invalidateQueries({ queryKey: ["erp-submission-attempts"] }), r.invalidateQueries({ queryKey: ["integration-partner", l] });
|
|
336
337
|
}
|
|
337
|
-
}), y =
|
|
338
|
-
return /* @__PURE__ */
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
338
|
+
}), y = c ?? [];
|
|
339
|
+
return /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
340
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
|
|
341
|
+
/* @__PURE__ */ a("div", { className: "relative w-full max-w-[420px]", children: [
|
|
341
342
|
/* @__PURE__ */ e(L, { className: "pointer-events-none absolute left-2.5 top-2 h-3.5 w-3.5 text-muted-foreground" }),
|
|
342
343
|
/* @__PURE__ */ e(
|
|
343
344
|
"input",
|
|
344
345
|
{
|
|
345
346
|
value: n,
|
|
346
|
-
onChange: (
|
|
347
|
+
onChange: (p) => o(p.target.value),
|
|
347
348
|
placeholder: "Find a reference, record id or error text",
|
|
348
349
|
"data-ic-submission-search": !0,
|
|
349
350
|
className: "h-8 w-full rounded-md border border-border bg-card pl-8 pr-2.5 text-[12.5px] text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
350
351
|
}
|
|
351
352
|
)
|
|
352
353
|
] }),
|
|
353
|
-
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children:
|
|
354
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: u.length >= 2 ? `Matching “${u}”` : "Newest 50 from the last 90 days" })
|
|
354
355
|
] }),
|
|
355
|
-
|
|
356
|
-
|
|
356
|
+
g ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((p) => /* @__PURE__ */ e("div", { className: "h-10 animate-pulse rounded-lg bg-[hsl(var(--nvr-skeleton))]" }, p)) }) : x ? /* @__PURE__ */ e("p", { className: m("text-[12.5px]", h.negative), children: "Couldn't load submissions." }) : y.length === 0 ? /* @__PURE__ */ e("p", { className: "rounded-lg border border-border bg-card px-4 py-5 text-[12.5px] text-muted-foreground", children: u.length >= 2 ? "Nothing sent to this partner matches that." : "Nothing has been sent to this partner in the last 90 days." }) : /* @__PURE__ */ e("div", { className: "space-y-2", "data-ic-submissions": !0, children: y.map((p) => /* @__PURE__ */ e("div", { className: "bg-card", children: /* @__PURE__ */ e(
|
|
357
|
+
I,
|
|
357
358
|
{
|
|
358
|
-
sub:
|
|
359
|
-
onRetry: (B) =>
|
|
360
|
-
retrying:
|
|
359
|
+
sub: p,
|
|
360
|
+
onRetry: (B) => s.mutate(B),
|
|
361
|
+
retrying: s.isPending && s.variables === p.id
|
|
361
362
|
}
|
|
362
|
-
) },
|
|
363
|
+
) }, p.id)) })
|
|
363
364
|
] });
|
|
364
365
|
}
|
|
365
|
-
function
|
|
366
|
-
const
|
|
367
|
-
mutationFn: () =>
|
|
368
|
-
R(`/external-apis/${
|
|
369
|
-
).then((
|
|
370
|
-
onSettled: () => n.invalidateQueries({ queryKey: ["integration-partner",
|
|
371
|
-
}),
|
|
372
|
-
return /* @__PURE__ */
|
|
373
|
-
/* @__PURE__ */
|
|
366
|
+
function ce({ apiId: l, data: t }) {
|
|
367
|
+
const r = O(), n = q(), o = S({
|
|
368
|
+
mutationFn: () => r.request(
|
|
369
|
+
R(`/external-apis/${l}/contracts/run`)
|
|
370
|
+
).then((i) => i.data),
|
|
371
|
+
onSettled: () => n.invalidateQueries({ queryKey: ["integration-partner", l] })
|
|
372
|
+
}), u = t.contracts;
|
|
373
|
+
return /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
374
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
|
|
374
375
|
/* @__PURE__ */ e("p", { className: "max-w-[70ch] text-[12.5px] text-muted-foreground", children: "A contract is a saved check that an endpoint still answers the way this system expects. Running them calls the partner's read-only endpoints now." }),
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ a(
|
|
376
377
|
"button",
|
|
377
378
|
{
|
|
378
379
|
type: "button",
|
|
379
|
-
disabled:
|
|
380
|
-
onClick: () =>
|
|
380
|
+
disabled: o.isPending || u.length === 0,
|
|
381
|
+
onClick: () => o.mutate(),
|
|
381
382
|
"data-ic-run-contracts": !0,
|
|
382
383
|
className: "ml-auto inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-3 text-[12.5px] font-medium text-foreground hover:bg-muted disabled:opacity-60",
|
|
383
384
|
children: [
|
|
384
|
-
|
|
385
|
+
o.isPending ? /* @__PURE__ */ e(A, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Q, { className: "h-3.5 w-3.5" }),
|
|
385
386
|
"Run contracts"
|
|
386
387
|
]
|
|
387
388
|
}
|
|
388
389
|
)
|
|
389
390
|
] }),
|
|
390
|
-
|
|
391
|
+
o.data && /* @__PURE__ */ e(
|
|
391
392
|
"p",
|
|
392
393
|
{
|
|
393
394
|
role: "status",
|
|
394
|
-
className:
|
|
395
|
+
className: m(
|
|
395
396
|
"rounded-md px-3 py-2 text-[12.5px] font-medium",
|
|
396
|
-
|
|
397
|
-
|
|
397
|
+
o.data.failed > 0 ? f.negative : f.positive,
|
|
398
|
+
o.data.failed > 0 ? h.negative : h.positive
|
|
398
399
|
),
|
|
399
|
-
children:
|
|
400
|
+
children: o.data.failed > 0 ? `${o.data.failed} of ${o.data.results.length} failing` : `All ${o.data.results.length} passed`
|
|
400
401
|
}
|
|
401
402
|
),
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
const
|
|
405
|
-
return /* @__PURE__ */
|
|
403
|
+
o.isError && /* @__PURE__ */ e("p", { className: m("text-[12.5px]", h.negative), children: "The contracts couldn't run." }),
|
|
404
|
+
u.length === 0 ? /* @__PURE__ */ e("p", { className: "rounded-lg border border-border bg-card px-4 py-5 text-[12.5px] text-muted-foreground", children: "No contracts on this partner's endpoints yet. Add one from the endpoint's settings on the external API page." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-border overflow-hidden rounded-lg border border-border bg-card", children: u.map((i) => {
|
|
405
|
+
const d = i.last_run == null ? "never" : i.ok ? "ok" : "failed";
|
|
406
|
+
return /* @__PURE__ */ a("li", { "data-ic-contract": d, className: "flex gap-3 px-4 py-2.5", children: [
|
|
406
407
|
/* @__PURE__ */ e(
|
|
407
408
|
"span",
|
|
408
409
|
{
|
|
409
|
-
className:
|
|
410
|
+
className: m(
|
|
410
411
|
"mt-0.5 shrink-0 rounded px-1.5 py-px text-[11px] font-semibold",
|
|
411
|
-
|
|
412
|
+
d === "ok" ? m(f.positive, h.positive) : d === "failed" ? m(f.negative, h.negative) : "bg-muted text-muted-foreground"
|
|
412
413
|
),
|
|
413
|
-
children:
|
|
414
|
+
children: d === "ok" ? "Passing" : d === "failed" ? "Failing" : "Not run"
|
|
414
415
|
}
|
|
415
416
|
),
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-foreground", children:
|
|
418
|
-
|
|
417
|
+
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
418
|
+
/* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-foreground", children: i.name }),
|
|
419
|
+
i.detail && /* @__PURE__ */ e("p", { className: "mt-0.5 line-clamp-2 text-[12px] text-muted-foreground", children: i.detail })
|
|
419
420
|
] }),
|
|
420
421
|
/* @__PURE__ */ e(
|
|
421
422
|
"span",
|
|
422
423
|
{
|
|
423
424
|
className: "shrink-0 text-[12px] text-muted-foreground",
|
|
424
|
-
"data-tip": F(
|
|
425
|
-
children:
|
|
425
|
+
"data-tip": F(i.last_run),
|
|
426
|
+
children: i.last_run ? D(i.last_run) : ""
|
|
426
427
|
}
|
|
427
428
|
)
|
|
428
|
-
] },
|
|
429
|
+
] }, i.endpoint_id);
|
|
429
430
|
}) })
|
|
430
431
|
] });
|
|
431
432
|
}
|
|
432
433
|
export {
|
|
433
|
-
|
|
434
|
+
Se as PartnerDetail
|
|
434
435
|
};
|