@localstack/appinspector-ui 1.0.117 → 1.0.118

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/index.cjs CHANGED
@@ -2417,8 +2417,8 @@ __export(index_exports, {
2417
2417
  module.exports = __toCommonJS(index_exports);
2418
2418
 
2419
2419
  // src/pages/spans-list-page.tsx
2420
- var import_material24 = require("@mui/material");
2421
- var import_react69 = require("react");
2420
+ var import_material23 = require("@mui/material");
2421
+ var import_react68 = require("react");
2422
2422
 
2423
2423
  // src/api/errors.ts
2424
2424
  var AppInspectorDisabledError = class extends Error {
@@ -18598,10 +18598,10 @@ var useSpans = () => {
18598
18598
 
18599
18599
  // src/pages/trace-graph-page.tsx
18600
18600
  var import_icons_material12 = require("@mui/icons-material");
18601
- var import_material23 = require("@mui/material");
18601
+ var import_material22 = require("@mui/material");
18602
18602
  var import_styles = require("@mui/material/styles");
18603
- var import_react67 = require("@xyflow/react");
18604
- var import_react68 = require("react");
18603
+ var import_react66 = require("@xyflow/react");
18604
+ var import_react67 = require("react");
18605
18605
 
18606
18606
  // src/components/event-details/event-details.tsx
18607
18607
  var import_icons_material9 = require("@mui/icons-material");
@@ -30867,79 +30867,35 @@ var EventDetails = ({ onClose, selectedEvent }) => {
30867
30867
 
30868
30868
  // src/components/trace-graph/trace-graph.tsx
30869
30869
  var import_base = require("@xyflow/react/dist/base.css");
30870
- var import_material22 = require("@mui/material");
30871
- var import_react65 = require("@xyflow/react");
30872
- var import_react66 = require("react");
30870
+ var import_material21 = require("@mui/material");
30871
+ var import_react64 = require("@xyflow/react");
30872
+ var import_react65 = require("react");
30873
30873
 
30874
30874
  // src/components/trace-graph/service-node.tsx
30875
- var import_material20 = require("@mui/material");
30876
- var import_style = require("@xyflow/react/dist/style.css");
30877
- var import_react61 = require("@xyflow/react");
30878
- var import_react62 = require("react");
30879
-
30880
- // src/components/trace-graph/problem-indicator.tsx
30881
30875
  var import_icons_material10 = require("@mui/icons-material");
30882
30876
  var import_material19 = require("@mui/material");
30883
- var import_react60 = require("react");
30877
+ var import_style = require("@xyflow/react/dist/style.css");
30878
+ var import_react60 = require("@xyflow/react");
30879
+ var import_react61 = require("react");
30884
30880
  var import_jsx_runtime142 = require("react/jsx-runtime");
30885
- var ProblemIndicator = ({ error }) => {
30886
- const icon = (0, import_react60.useMemo)(() => {
30887
- switch (error.level) {
30888
- case "error": {
30889
- return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_icons_material10.Error, { sx: { color: "#d32f2f", fontSize: "14px" } });
30890
- }
30891
- case "warning": {
30892
- return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_icons_material10.Warning, { sx: { color: "#ff9800", fontSize: "14px" } });
30893
- }
30894
- default: {
30895
- return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_icons_material10.Info, { sx: { color: "#2196f3", fontSize: "14px" } });
30896
- }
30897
- }
30898
- }, [error.level]);
30899
- const color2 = (0, import_react60.useMemo)(() => {
30900
- switch (error.level) {
30901
- case "error": {
30902
- return "#d32f2f";
30903
- }
30904
- case "warning": {
30905
- return "#ff9800";
30906
- }
30907
- default: {
30908
- return "#2196f3";
30909
- }
30910
- }
30911
- }, [error.level]);
30912
- return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material19.Tooltip, { arrow: true, title: error.message ?? "Issue detected", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
30913
- import_material19.Box,
30914
- {
30915
- sx: {
30916
- alignItems: "center",
30917
- backgroundColor: `${color2}15`,
30918
- border: `1px solid ${color2}`,
30919
- borderRadius: "50%",
30920
- cursor: "pointer",
30921
- display: "inline-flex",
30922
- height: "18px",
30923
- justifyContent: "center",
30924
- width: "18px"
30925
- },
30926
- children: icon
30927
- }
30928
- ) });
30929
- };
30930
-
30931
- // src/components/trace-graph/service-node.tsx
30932
- var import_jsx_runtime143 = require("react/jsx-runtime");
30933
30881
  var handleStyle = {
30934
30882
  backgroundColor: "white",
30935
30883
  borderColor: "lightgray",
30936
30884
  opacity: 0
30937
30885
  };
30938
- var ServiceNode = (0, import_react62.memo)(({ data, selected }) => {
30939
- const theme = (0, import_material20.useTheme)();
30940
- const hasErrors = (data.event.errors && data.event.errors.length > 0) ?? false;
30941
- return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
30942
- import_material20.Box,
30886
+ var ServiceNode = (0, import_react61.memo)(({ data, selected }) => {
30887
+ const theme = (0, import_material19.useTheme)();
30888
+ const isError = data.event.status_code === 2;
30889
+ const hasPermissionEvents = (0, import_react61.useMemo)(
30890
+ () => data.event.events.some(
30891
+ (event) => event.event_type === "iam.policy_evaluation" && event.name === "iam.policy.denied"
30892
+ ),
30893
+ [data.event.events]
30894
+ );
30895
+ const isWarning = !isError && data.event.status_code === 1 && hasPermissionEvents;
30896
+ const outlineColor = isError ? theme.palette.error.main : isWarning ? theme.palette.warning.main : void 0;
30897
+ return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
30898
+ import_material19.Box,
30943
30899
  {
30944
30900
  "data-testid": SERVICE_NODE_TEST_ID,
30945
30901
  role: "button",
@@ -30948,32 +30904,32 @@ var ServiceNode = (0, import_react62.memo)(({ data, selected }) => {
30948
30904
  boxShadow: theme.palette.mode === "dark" ? "0 4px 12px rgba(0,0,0,0.6)" : "0 4px 12px rgba(0,0,0,0.22)"
30949
30905
  },
30950
30906
  "backgroundColor": theme.palette.background.paper,
30951
- "borderLeft": `3px solid ${hasErrors ? theme.palette.error.main : "transparent"}`,
30907
+ "borderLeft": `3px solid ${outlineColor ?? "transparent"}`,
30952
30908
  "borderRadius": 1,
30953
30909
  "boxShadow": theme.palette.mode === "dark" ? "0 1px 4px rgba(0,0,0,0.5)" : "0 1px 4px rgba(0,0,0,0.13)",
30954
30910
  "cursor": "pointer",
30955
30911
  "maxWidth": 220,
30956
30912
  "minWidth": 140,
30957
- "outline": selected ? `2px solid ${hasErrors ? theme.palette.error.main : theme.palette.primary.main}` : hasErrors ? `1px solid ${theme.palette.error.main}` : `1px solid ${theme.palette.divider}`,
30913
+ "outline": selected ? `2px solid ${theme.palette.primary.main}` : `1px solid ${theme.palette.divider}`,
30958
30914
  "overflow": "hidden",
30959
30915
  "position": "relative",
30960
30916
  "transition": "all 0.3s ease"
30961
30917
  },
30962
30918
  tabIndex: 0,
30963
30919
  children: [
30964
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_react61.Handle, { position: import_react61.Position.Left, style: handleStyle, type: "target" }),
30965
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_react61.Handle, { position: import_react61.Position.Right, style: handleStyle, type: "source" }),
30966
- /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
30967
- import_material20.Stack,
30920
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_react60.Handle, { position: import_react60.Position.Left, style: handleStyle, type: "target" }),
30921
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_react60.Handle, { position: import_react60.Position.Right, style: handleStyle, type: "source" }),
30922
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
30923
+ import_material19.Stack,
30968
30924
  {
30969
30925
  alignItems: "center",
30970
30926
  direction: "row",
30971
30927
  sx: { gap: "8px", pb: "2px", pt: "6px", px: "8px" },
30972
30928
  children: [
30973
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_material20.Box, { sx: { borderRadius: "4px", flexShrink: 0, lineHeight: 0, overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(AwsServiceIcon, { hideTooltip: true, service: data.event.service_name, size: "medium" }) }),
30974
- /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_material20.Stack, { sx: { minWidth: 0 }, children: [
30975
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
30976
- import_material20.Typography,
30929
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material19.Box, { sx: { borderRadius: "4px", flexShrink: 0, lineHeight: 0, overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(AwsServiceIcon, { hideTooltip: true, service: data.event.service_name, size: "medium" }) }),
30930
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material19.Stack, { sx: { minWidth: 0 }, children: [
30931
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
30932
+ import_material19.Typography,
30977
30933
  {
30978
30934
  noWrap: true,
30979
30935
  sx: { fontWeight: 700, lineHeight: 1.25 },
@@ -30981,8 +30937,8 @@ var ServiceNode = (0, import_react62.memo)(({ data, selected }) => {
30981
30937
  children: getServiceDisplayName(data.event.service_name)
30982
30938
  }
30983
30939
  ),
30984
- data.event.resource_name != "" && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
30985
- import_material20.Typography,
30940
+ data.event.resource_name != "" && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
30941
+ import_material19.Typography,
30986
30942
  {
30987
30943
  color: "text.secondary",
30988
30944
  noWrap: true,
@@ -30995,16 +30951,16 @@ var ServiceNode = (0, import_react62.memo)(({ data, selected }) => {
30995
30951
  ]
30996
30952
  }
30997
30953
  ),
30998
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_material20.Divider, { sx: { ml: "38px", mr: "8px", my: "5px" } }),
30999
- /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
31000
- import_material20.Stack,
30954
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material19.Divider, { sx: { ml: "38px", mr: "8px", my: "5px" } }),
30955
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
30956
+ import_material19.Stack,
31001
30957
  {
31002
30958
  alignItems: "center",
31003
30959
  direction: "row",
31004
30960
  sx: { minWidth: 0, pb: "5px", pr: "8px", pt: "1px" },
31005
30961
  children: [
31006
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
31007
- import_material20.Box,
30962
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
30963
+ import_material19.Box,
31008
30964
  {
31009
30965
  sx: {
31010
30966
  alignItems: "center",
@@ -31013,11 +30969,14 @@ var ServiceNode = (0, import_react62.memo)(({ data, selected }) => {
31013
30969
  justifyContent: "center",
31014
30970
  width: "38px"
31015
30971
  },
31016
- children: hasErrors && data.event.errors?.map((error) => /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(ProblemIndicator, { error }, error.span_id))
30972
+ children: [
30973
+ (isError || isWarning) && hasPermissionEvents && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material19.Tooltip, { arrow: true, title: "Permission denied", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_icons_material10.GppBad, { sx: { color: isError ? theme.palette.error.main : theme.palette.warning.main, fontSize: "16px" } }) }),
30974
+ isError && !hasPermissionEvents && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material19.Tooltip, { arrow: true, title: "Error", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_icons_material10.Cancel, { sx: { color: theme.palette.error.main, fontSize: "16px" } }) })
30975
+ ]
31017
30976
  }
31018
30977
  ),
31019
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
31020
- import_material20.Typography,
30978
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
30979
+ import_material19.Typography,
31021
30980
  {
31022
30981
  "data-testid": SERVICE_NODE_OPERATION_NAME_TEST_ID,
31023
30982
  noWrap: true,
@@ -31090,19 +31049,19 @@ var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
31090
31049
 
31091
31050
  // src/components/trace-graph/xyflow/controls.tsx
31092
31051
  var import_icons_material11 = require("@mui/icons-material");
31093
- var import_material21 = require("@mui/material");
31094
- var import_react63 = require("@xyflow/react");
31095
- var import_react64 = require("react");
31052
+ var import_material20 = require("@mui/material");
31053
+ var import_react62 = require("@xyflow/react");
31054
+ var import_react63 = require("react");
31096
31055
  var import_shallow = require("zustand/shallow");
31097
- var import_jsx_runtime144 = require("react/jsx-runtime");
31056
+ var import_jsx_runtime143 = require("react/jsx-runtime");
31098
31057
  var selector = (s2) => ({
31099
31058
  isInteractive: s2.nodesDraggable || s2.nodesConnectable || s2.elementsSelectable,
31100
31059
  maxZoomReached: s2.transform[2] >= s2.maxZoom,
31101
31060
  minZoomReached: s2.transform[2] <= s2.minZoom
31102
31061
  });
31103
- var Controls = (0, import_react64.memo)(() => {
31104
- const { maxZoomReached, minZoomReached } = (0, import_react63.useStore)(selector, import_shallow.shallow);
31105
- const { fitView, zoomIn, zoomOut } = (0, import_react63.useReactFlow)();
31062
+ var Controls = (0, import_react63.memo)(() => {
31063
+ const { maxZoomReached, minZoomReached } = (0, import_react62.useStore)(selector, import_shallow.shallow);
31064
+ const { fitView, zoomIn, zoomOut } = (0, import_react62.useReactFlow)();
31106
31065
  const onZoomInHandler = () => {
31107
31066
  void zoomIn();
31108
31067
  };
@@ -31112,8 +31071,8 @@ var Controls = (0, import_react64.memo)(() => {
31112
31071
  const onFitViewHandler = () => {
31113
31072
  void fitView();
31114
31073
  };
31115
- return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(
31116
- import_material21.Box,
31074
+ return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
31075
+ import_material20.Box,
31117
31076
  {
31118
31077
  sx: {
31119
31078
  bottom: 0,
@@ -31126,33 +31085,33 @@ var Controls = (0, import_react64.memo)(() => {
31126
31085
  zIndex: 5
31127
31086
  },
31128
31087
  children: [
31129
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
31130
- import_material21.IconButton,
31088
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
31089
+ import_material20.IconButton,
31131
31090
  {
31132
31091
  className: "react-flow__controls-zoomin",
31133
31092
  disabled: maxZoomReached,
31134
31093
  onClick: onZoomInHandler,
31135
31094
  size: "small",
31136
- children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_icons_material11.Add, {})
31095
+ children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_icons_material11.Add, {})
31137
31096
  }
31138
31097
  ),
31139
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
31140
- import_material21.IconButton,
31098
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
31099
+ import_material20.IconButton,
31141
31100
  {
31142
31101
  className: "react-flow__controls-zoomout",
31143
31102
  disabled: minZoomReached,
31144
31103
  onClick: onZoomOutHandler,
31145
31104
  size: "small",
31146
- children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_icons_material11.Remove, {})
31105
+ children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_icons_material11.Remove, {})
31147
31106
  }
31148
31107
  ),
31149
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
31150
- import_material21.IconButton,
31108
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
31109
+ import_material20.IconButton,
31151
31110
  {
31152
31111
  className: "react-flow__controls-fitview",
31153
31112
  onClick: onFitViewHandler,
31154
31113
  size: "small",
31155
- children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_icons_material11.FitScreen, {})
31114
+ children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_icons_material11.FitScreen, {})
31156
31115
  }
31157
31116
  )
31158
31117
  ]
@@ -31161,7 +31120,7 @@ var Controls = (0, import_react64.memo)(() => {
31161
31120
  });
31162
31121
 
31163
31122
  // src/components/trace-graph/trace-graph.tsx
31164
- var import_jsx_runtime145 = require("react/jsx-runtime");
31123
+ var import_jsx_runtime144 = require("react/jsx-runtime");
31165
31124
  var nodeTypes = {
31166
31125
  service: ServiceNode
31167
31126
  };
@@ -31171,9 +31130,9 @@ var TraceGraph = ({
31171
31130
  onRefresh,
31172
31131
  spans
31173
31132
  }) => {
31174
- const [nodes, setNodes, onNodesChange] = (0, import_react65.useNodesState)([]);
31175
- const [edges, setEdges] = (0, import_react65.useEdgesState)([]);
31176
- (0, import_react66.useEffect)(() => {
31133
+ const [nodes, setNodes, onNodesChange] = (0, import_react64.useNodesState)([]);
31134
+ const [edges, setEdges] = (0, import_react64.useEdgesState)([]);
31135
+ (0, import_react65.useEffect)(() => {
31177
31136
  const allNodes = [];
31178
31137
  const allEdges = [];
31179
31138
  for (const span of spans.data ?? []) {
@@ -31188,15 +31147,15 @@ var TraceGraph = ({
31188
31147
  },
31189
31148
  id: span.span_id,
31190
31149
  position: { x: 0, y: 0 },
31191
- sourcePosition: import_react65.Position.Right,
31192
- targetPosition: import_react65.Position.Left,
31150
+ sourcePosition: import_react64.Position.Right,
31151
+ targetPosition: import_react64.Position.Left,
31193
31152
  type: "service"
31194
31153
  });
31195
31154
  if (span.parent_span_id !== null) {
31196
31155
  allEdges.push({
31197
31156
  animated: false,
31198
31157
  id: `e-${span.parent_span_id}-${span.span_id}`,
31199
- markerEnd: { color: "lightgray", height: 16, type: import_react65.MarkerType.Arrow, width: 16 },
31158
+ markerEnd: { color: "lightgray", height: 16, type: import_react64.MarkerType.Arrow, width: 16 },
31200
31159
  source: span.parent_span_id,
31201
31160
  style: { stroke: "lightgray", strokeWidth: 1 },
31202
31161
  target: span.span_id
@@ -31205,7 +31164,7 @@ var TraceGraph = ({
31205
31164
  for (const outgoingLinkSpanId of span.outgoing_link_span_ids ?? []) {
31206
31165
  allEdges.push({
31207
31166
  id: `e-link-${outgoingLinkSpanId}-${span.span_id}`,
31208
- markerEnd: { color: "lightgray", height: 16, type: import_react65.MarkerType.Arrow, width: 16 },
31167
+ markerEnd: { color: "lightgray", height: 16, type: import_react64.MarkerType.Arrow, width: 16 },
31209
31168
  source: outgoingLinkSpanId,
31210
31169
  style: { stroke: "lightgray", strokeWidth: 1 },
31211
31170
  // animated: true,
@@ -31223,12 +31182,12 @@ var TraceGraph = ({
31223
31182
  setNodes(layoutedNodes);
31224
31183
  setEdges(layoutedEdges);
31225
31184
  }, [spans.data, initialFocusEventId, setNodes, setEdges]);
31226
- const theme = (0, import_material22.useTheme)();
31227
- return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
31228
- spans.error && /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(
31229
- import_material22.Alert,
31185
+ const theme = (0, import_material21.useTheme)();
31186
+ return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(import_jsx_runtime144.Fragment, { children: [
31187
+ spans.error && /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(
31188
+ import_material21.Alert,
31230
31189
  {
31231
- action: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_material22.Button, { onClick: () => {
31190
+ action: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_material21.Button, { onClick: () => {
31232
31191
  onRefresh();
31233
31192
  }, children: "Retry" }),
31234
31193
  severity: "error",
@@ -31239,8 +31198,8 @@ var TraceGraph = ({
31239
31198
  ]
31240
31199
  }
31241
31200
  ),
31242
- /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(
31243
- import_react65.ReactFlow,
31201
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(
31202
+ import_react64.ReactFlow,
31244
31203
  {
31245
31204
  "data-testid": TRACE_GRAPH_TEST_ID,
31246
31205
  edges,
@@ -31257,9 +31216,9 @@ var TraceGraph = ({
31257
31216
  onNodesChange,
31258
31217
  selectNodesOnDrag: false,
31259
31218
  children: [
31260
- /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Controls, {}),
31261
- /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
31262
- import_react65.Background,
31219
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Controls, {}),
31220
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
31221
+ import_react64.Background,
31263
31222
  {
31264
31223
  bgColor: theme.palette.background.default,
31265
31224
  color: theme.palette.text.disabled
@@ -31272,7 +31231,7 @@ var TraceGraph = ({
31272
31231
  };
31273
31232
 
31274
31233
  // src/pages/trace-graph-page.tsx
31275
- var import_jsx_runtime146 = require("react/jsx-runtime");
31234
+ var import_jsx_runtime145 = require("react/jsx-runtime");
31276
31235
  var HEADER_HEIGHT = 56;
31277
31236
  var DRAWER_WIDTH = "35%";
31278
31237
  var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
@@ -31290,7 +31249,7 @@ var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) =>
31290
31249
  })
31291
31250
  }
31292
31251
  }));
31293
- var StyledDrawer = (0, import_styles.styled)(import_material23.Drawer)(() => ({
31252
+ var StyledDrawer = (0, import_styles.styled)(import_material22.Drawer)(() => ({
31294
31253
  "& .MuiDrawer-paper": {
31295
31254
  bottom: 0,
31296
31255
  boxSizing: "border-box",
@@ -31321,8 +31280,8 @@ var TraceGraphView = ({
31321
31280
  traceId
31322
31281
  }) => {
31323
31282
  const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
31324
- return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
31325
- import_material23.Box,
31283
+ return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(
31284
+ import_material22.Box,
31326
31285
  {
31327
31286
  "data-testid": TRACE_GRAPH_PAGE_TEST_ID,
31328
31287
  sx: {
@@ -31334,14 +31293,14 @@ var TraceGraphView = ({
31334
31293
  overflow: "hidden"
31335
31294
  },
31336
31295
  children: [
31337
- /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_material23.Box, { sx: { display: "flex", width: "100%" }, children: [
31338
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_material23.Button, { onClick: () => {
31296
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_material22.Box, { sx: { display: "flex", width: "100%" }, children: [
31297
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_material22.Button, { onClick: () => {
31339
31298
  navigateToSpansList();
31340
- }, startIcon: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_icons_material12.ArrowBack, {}), children: "Go back" }),
31341
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_material23.Box, { sx: { flexGrow: 1 } })
31299
+ }, startIcon: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_icons_material12.ArrowBack, {}), children: "Go back" }),
31300
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_material22.Box, { sx: { flexGrow: 1 } })
31342
31301
  ] }),
31343
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
31344
- import_material23.Paper,
31302
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
31303
+ import_material22.Paper,
31345
31304
  {
31346
31305
  sx: {
31347
31306
  display: "flex",
@@ -31350,7 +31309,7 @@ var TraceGraphView = ({
31350
31309
  position: "relative",
31351
31310
  width: "100%"
31352
31311
  },
31353
- children: shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
31312
+ children: shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
31354
31313
  StatusMessage,
31355
31314
  {
31356
31315
  error: statusError,
@@ -31358,15 +31317,15 @@ var TraceGraphView = ({
31358
31317
  onRetry: handleRetry,
31359
31318
  status
31360
31319
  }
31361
- ) : /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_jsx_runtime146.Fragment, { children: [
31362
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Main, { open, children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
31363
- import_material23.Box,
31320
+ ) : /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
31321
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Main, { open, children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
31322
+ import_material22.Box,
31364
31323
  {
31365
31324
  sx: {
31366
31325
  height: "100%",
31367
31326
  overflow: "auto"
31368
31327
  },
31369
- children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_react67.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
31328
+ children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_react66.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
31370
31329
  TraceGraph,
31371
31330
  {
31372
31331
  initialFocusEventId: spanId,
@@ -31383,7 +31342,7 @@ var TraceGraphView = ({
31383
31342
  ) })
31384
31343
  }
31385
31344
  ) }),
31386
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(EventDetails, { onClose: handleClose, selectedEvent }) })
31345
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(EventDetails, { onClose: handleClose, selectedEvent }) })
31387
31346
  ] })
31388
31347
  }
31389
31348
  )
@@ -31427,10 +31386,10 @@ async function fetchConnectedTraces(api, traceIds, allSpans = /* @__PURE__ */ ne
31427
31386
  }
31428
31387
  var TraceGraphPage = ({ onClose, spanId, traceId }) => {
31429
31388
  const api = useAppInspectorApi();
31430
- const [spans, setSpans] = (0, import_react68.useState)();
31431
- const [loading, setLoading] = (0, import_react68.useState)(false);
31432
- const [fetchError, setFetchError] = (0, import_react68.useState)();
31433
- const fetchSpans = (0, import_react68.useCallback)(async () => {
31389
+ const [spans, setSpans] = (0, import_react67.useState)();
31390
+ const [loading, setLoading] = (0, import_react67.useState)(false);
31391
+ const [fetchError, setFetchError] = (0, import_react67.useState)();
31392
+ const fetchSpans = (0, import_react67.useCallback)(async () => {
31434
31393
  setLoading(true);
31435
31394
  try {
31436
31395
  const spans2 = await fetchConnectedTraces(api, [traceId]);
@@ -31443,40 +31402,40 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
31443
31402
  setLoading(false);
31444
31403
  }
31445
31404
  }, [api, traceId]);
31446
- (0, import_react68.useEffect)(() => {
31405
+ (0, import_react67.useEffect)(() => {
31447
31406
  void fetchSpans();
31448
31407
  }, [fetchSpans]);
31449
- const [open, setOpen] = (0, import_react68.useState)(true);
31450
- const [selectedEvent, setSelectedEvent] = (0, import_react68.useState)(() => spans?.find((span) => span.span_id === spanId));
31451
- const spansReference = (0, import_react68.useRef)();
31452
- (0, import_react68.useEffect)(() => {
31408
+ const [open, setOpen] = (0, import_react67.useState)(true);
31409
+ const [selectedEvent, setSelectedEvent] = (0, import_react67.useState)(() => spans?.find((span) => span.span_id === spanId));
31410
+ const spansReference = (0, import_react67.useRef)();
31411
+ (0, import_react67.useEffect)(() => {
31453
31412
  if (!spansReference.current && spans) {
31454
31413
  setSelectedEvent(spans.find((span) => span.span_id === spanId));
31455
31414
  spansReference.current = spans;
31456
31415
  }
31457
31416
  }, [spans, setSelectedEvent, spanId]);
31458
31417
  const { checkStatus, reportDisabled, status, statusError } = useAppInspectorStatus();
31459
- (0, import_react68.useEffect)(() => {
31418
+ (0, import_react67.useEffect)(() => {
31460
31419
  if (fetchError instanceof AppInspectorDisabledError || fetchError instanceof ConnectionError) {
31461
31420
  reportDisabled();
31462
31421
  }
31463
31422
  }, [fetchError, reportDisabled]);
31464
- const handleEnable = (0, import_react68.useCallback)(async () => {
31423
+ const handleEnable = (0, import_react67.useCallback)(async () => {
31465
31424
  await api.setStatus({ status: "ENABLED" });
31466
31425
  void checkStatus();
31467
31426
  }, [api, checkStatus]);
31468
- const handleEventSelect = (0, import_react68.useCallback)((spanId2) => {
31427
+ const handleEventSelect = (0, import_react67.useCallback)((spanId2) => {
31469
31428
  const span = spans?.find((s2) => s2.span_id === spanId2);
31470
31429
  setSelectedEvent(span);
31471
31430
  setOpen(true);
31472
31431
  }, [spans]);
31473
- const handleRetry = (0, import_react68.useCallback)(() => {
31432
+ const handleRetry = (0, import_react67.useCallback)(() => {
31474
31433
  void checkStatus();
31475
31434
  }, [checkStatus]);
31476
- const navigateToSpansList = (0, import_react68.useCallback)(() => {
31435
+ const navigateToSpansList = (0, import_react67.useCallback)(() => {
31477
31436
  onClose?.();
31478
31437
  }, [onClose]);
31479
- return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
31438
+ return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
31480
31439
  TraceGraphView,
31481
31440
  {
31482
31441
  fetchError,
@@ -31501,7 +31460,7 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
31501
31460
  };
31502
31461
 
31503
31462
  // src/pages/spans-list-page.tsx
31504
- var import_jsx_runtime147 = require("react/jsx-runtime");
31463
+ var import_jsx_runtime146 = require("react/jsx-runtime");
31505
31464
  var SpansListPage = () => {
31506
31465
  const api = useAppInspectorApi();
31507
31466
  const {
@@ -31525,32 +31484,32 @@ var SpansListPage = () => {
31525
31484
  warningCount
31526
31485
  } = useSpans();
31527
31486
  const { checking, checkStatus, status, statusError } = useAppInspectorStatus();
31528
- const clearSpansSync = (0, import_react69.useCallback)(() => {
31487
+ const clearSpansSync = (0, import_react68.useCallback)(() => {
31529
31488
  void clearSpans();
31530
31489
  }, [clearSpans]);
31531
31490
  const localstackVersion = status?.localstackVersion ?? (statusError instanceof AppInspectorNotFoundError ? statusError.localstackVersion : void 0);
31532
31491
  const versionCompatibility = checkEmulatorVersion(localstackVersion);
31533
- const [bannerDismissed, setBannerDismissed] = (0, import_react69.useState)(false);
31492
+ const [bannerDismissed, setBannerDismissed] = (0, import_react68.useState)(false);
31534
31493
  const [order2, setOrder] = useLocalStorage("spans-order", "oldest_first");
31535
- const [selectedTraceId, setSelectedTraceId] = (0, import_react69.useState)();
31536
- const [selectedSpanId, setSelectedSpanId] = (0, import_react69.useState)();
31537
- const navigateToSpan = (0, import_react69.useCallback)((span) => {
31494
+ const [selectedTraceId, setSelectedTraceId] = (0, import_react68.useState)();
31495
+ const [selectedSpanId, setSelectedSpanId] = (0, import_react68.useState)();
31496
+ const navigateToSpan = (0, import_react68.useCallback)((span) => {
31538
31497
  setSelectedTraceId(span.trace_id);
31539
31498
  setSelectedSpanId(span.span_id);
31540
31499
  }, []);
31541
- const handleRetry = (0, import_react69.useCallback)(() => {
31500
+ const handleRetry = (0, import_react68.useCallback)(() => {
31542
31501
  void checkStatus();
31543
31502
  fetchForward();
31544
31503
  }, [checkStatus, fetchForward]);
31545
- const handleEnable = (0, import_react69.useCallback)(async () => {
31504
+ const handleEnable = (0, import_react68.useCallback)(async () => {
31546
31505
  await api.setStatus({ status: "ENABLED" });
31547
31506
  clearFetchError();
31548
31507
  void checkStatus();
31549
31508
  }, [api, checkStatus, clearFetchError]);
31550
31509
  const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
31551
- return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_jsx_runtime147.Fragment, { children: [
31552
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(
31553
- import_material24.Box,
31510
+ return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_jsx_runtime146.Fragment, { children: [
31511
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
31512
+ import_material23.Box,
31554
31513
  {
31555
31514
  "data-testid": SPANS_LIST_PAGE_TEST_ID,
31556
31515
  sx: {
@@ -31565,7 +31524,7 @@ var SpansListPage = () => {
31565
31524
  width: "100%"
31566
31525
  },
31567
31526
  children: [
31568
- !checking && !shouldShowStatusMessage && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
31527
+ !checking && !shouldShowStatusMessage && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
31569
31528
  EmulatorVersionBanner,
31570
31529
  {
31571
31530
  compatibility: bannerDismissed && versionCompatibility === "warning" ? "ok" : versionCompatibility,
@@ -31575,7 +31534,7 @@ var SpansListPage = () => {
31575
31534
  } : void 0
31576
31535
  }
31577
31536
  ),
31578
- shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
31537
+ shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
31579
31538
  StatusMessage,
31580
31539
  {
31581
31540
  error: statusError,
@@ -31584,7 +31543,7 @@ var SpansListPage = () => {
31584
31543
  onRetry: handleRetry,
31585
31544
  status
31586
31545
  }
31587
- ) : /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
31546
+ ) : /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
31588
31547
  SpansList,
31589
31548
  {
31590
31549
  clearingSpans,
@@ -31612,7 +31571,7 @@ var SpansListPage = () => {
31612
31571
  ]
31613
31572
  }
31614
31573
  ),
31615
- selectedTraceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(TraceGraphPage, { onClose: () => {
31574
+ selectedTraceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(TraceGraphPage, { onClose: () => {
31616
31575
  setSelectedTraceId(void 0);
31617
31576
  }, spanId: selectedSpanId, traceId: selectedTraceId })
31618
31577
  ] });