@localstack/appinspector-ui 1.0.19 → 1.0.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/dist/index.cjs +91 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +45 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3595,6 +3595,7 @@ import { useNavigate as useNavigate2, useParams, useSearchParams } from "react-r
|
|
|
3595
3595
|
|
|
3596
3596
|
// src/components/event-details/event-details.tsx
|
|
3597
3597
|
import { Box as Box15, Chip as Chip3, Divider as Divider2, Stack as Stack2, Typography as Typography9 } from "@mui/material";
|
|
3598
|
+
import { useMemo as useMemo7 } from "react";
|
|
3598
3599
|
|
|
3599
3600
|
// src/utils/iam-utils.ts
|
|
3600
3601
|
function determinePermissionStatus(payload) {
|
|
@@ -3864,7 +3865,7 @@ var DetailRow = ({ content, label }) => /* @__PURE__ */ jsxs124(Grid2, { contain
|
|
|
3864
3865
|
{
|
|
3865
3866
|
sx: {
|
|
3866
3867
|
color: "text.secondary",
|
|
3867
|
-
fontWeight:
|
|
3868
|
+
fontWeight: 600
|
|
3868
3869
|
},
|
|
3869
3870
|
variant: "body2",
|
|
3870
3871
|
children: label
|
|
@@ -3899,11 +3900,11 @@ var PermissionIcon = ({ status }) => {
|
|
|
3899
3900
|
var IAMEventDetail = ({ event }) => {
|
|
3900
3901
|
const payloadString = event.attributes?.payload;
|
|
3901
3902
|
if (!payloadString) {
|
|
3902
|
-
return /* @__PURE__ */ jsx132(Box10, { sx: { p: 2 }, children: /* @__PURE__ */ jsx132(Typography5, {
|
|
3903
|
+
return /* @__PURE__ */ jsx132(Box10, { sx: { p: 2 }, children: /* @__PURE__ */ jsx132(Typography5, { sx: { fontWeight: 600 }, variant: "body2", children: "No IAM policy evaluation data available" }) });
|
|
3903
3904
|
}
|
|
3904
3905
|
const parsedIAM = parseIAMEvent(payloadString);
|
|
3905
3906
|
if (!parsedIAM) {
|
|
3906
|
-
return /* @__PURE__ */ jsx132(Box10, { sx: { p: 2 }, children: /* @__PURE__ */ jsx132(Typography5, {
|
|
3907
|
+
return /* @__PURE__ */ jsx132(Box10, { sx: { p: 2 }, children: /* @__PURE__ */ jsx132(Typography5, { sx: { fontWeight: 600 }, variant: "body2", children: "Failed to parse IAM event data" }) });
|
|
3907
3908
|
}
|
|
3908
3909
|
return /* @__PURE__ */ jsxs124(Box10, { sx: { p: 2 }, children: [
|
|
3909
3910
|
/* @__PURE__ */ jsx132(Box10, { sx: { mb: 2 }, children: /* @__PURE__ */ jsx132(
|
|
@@ -3928,9 +3929,7 @@ var IAMEventDetail = ({ event }) => {
|
|
|
3928
3929
|
Typography5,
|
|
3929
3930
|
{
|
|
3930
3931
|
sx: {
|
|
3931
|
-
color: "text.primary"
|
|
3932
|
-
fontFamily: "monospace",
|
|
3933
|
-
fontSize: "0.85rem"
|
|
3932
|
+
color: "text.primary"
|
|
3934
3933
|
},
|
|
3935
3934
|
variant: "body2",
|
|
3936
3935
|
children: action
|
|
@@ -3948,8 +3947,6 @@ var IAMEventDetail = ({ event }) => {
|
|
|
3948
3947
|
{
|
|
3949
3948
|
sx: {
|
|
3950
3949
|
color: "text.primary",
|
|
3951
|
-
fontFamily: "monospace",
|
|
3952
|
-
fontSize: "0.85rem",
|
|
3953
3950
|
wordBreak: "break-all"
|
|
3954
3951
|
},
|
|
3955
3952
|
variant: "body2",
|
|
@@ -3961,19 +3958,19 @@ var IAMEventDetail = ({ event }) => {
|
|
|
3961
3958
|
}
|
|
3962
3959
|
),
|
|
3963
3960
|
/* @__PURE__ */ jsxs124(Box10, { sx: { mt: 2 }, children: [
|
|
3964
|
-
/* @__PURE__ */ jsx132(Typography5, {
|
|
3961
|
+
/* @__PURE__ */ jsx132(Typography5, { sx: { fontWeight: 600, mb: 1 }, variant: "caption", children: "Policy Evaluation" }),
|
|
3965
3962
|
/* @__PURE__ */ jsxs124(Grid2, { container: true, spacing: 2, children: [
|
|
3966
3963
|
parsedIAM.details.explicitAllows !== void 0 && /* @__PURE__ */ jsx132(Grid2, { item: true, xs: 4, children: /* @__PURE__ */ jsxs124(Box10, { sx: { textAlign: "center" }, children: [
|
|
3967
3964
|
/* @__PURE__ */ jsx132(Typography5, { color: "success.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.explicitAllows }),
|
|
3968
|
-
/* @__PURE__ */ jsx132(Typography5, {
|
|
3965
|
+
/* @__PURE__ */ jsx132(Typography5, { sx: { fontWeight: 600 }, variant: "caption", children: "Explicit Allows" })
|
|
3969
3966
|
] }) }),
|
|
3970
3967
|
parsedIAM.details.explicitDenies !== void 0 && /* @__PURE__ */ jsx132(Grid2, { item: true, xs: 4, children: /* @__PURE__ */ jsxs124(Box10, { sx: { textAlign: "center" }, children: [
|
|
3971
3968
|
/* @__PURE__ */ jsx132(Typography5, { color: "error.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.explicitDenies }),
|
|
3972
|
-
/* @__PURE__ */ jsx132(Typography5, {
|
|
3969
|
+
/* @__PURE__ */ jsx132(Typography5, { sx: { fontWeight: 600 }, variant: "caption", children: "Explicit Denies" })
|
|
3973
3970
|
] }) }),
|
|
3974
3971
|
parsedIAM.details.implicitDenies !== void 0 && /* @__PURE__ */ jsx132(Grid2, { item: true, xs: 4, children: /* @__PURE__ */ jsxs124(Box10, { sx: { textAlign: "center" }, children: [
|
|
3975
3972
|
/* @__PURE__ */ jsx132(Typography5, { color: "warning.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.implicitDenies }),
|
|
3976
|
-
/* @__PURE__ */ jsx132(Typography5, {
|
|
3973
|
+
/* @__PURE__ */ jsx132(Typography5, { sx: { fontWeight: 600 }, variant: "caption", children: "Implicit Denies" })
|
|
3977
3974
|
] }) })
|
|
3978
3975
|
] })
|
|
3979
3976
|
] })
|
|
@@ -4030,8 +4027,8 @@ var IAMPermissionItem = ({ event }) => {
|
|
|
4030
4027
|
)
|
|
4031
4028
|
] }),
|
|
4032
4029
|
isOpen && /* @__PURE__ */ jsx133(Box11, { sx: { ml: 4, mt: 1 }, children: /* @__PURE__ */ jsxs125(Box11, { children: [
|
|
4033
|
-
/* @__PURE__ */ jsx133(Typography6, {
|
|
4034
|
-
/* @__PURE__ */ jsx133(Typography6, {
|
|
4030
|
+
/* @__PURE__ */ jsx133(Typography6, { sx: { fontWeight: 600 }, variant: "caption", children: "Principal" }),
|
|
4031
|
+
/* @__PURE__ */ jsx133(Typography6, { variant: "body2", children: parsedIAM.principal })
|
|
4035
4032
|
] }) })
|
|
4036
4033
|
] });
|
|
4037
4034
|
};
|
|
@@ -4045,7 +4042,7 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ jsxs126(Grid3, { contai
|
|
|
4045
4042
|
{
|
|
4046
4043
|
sx: {
|
|
4047
4044
|
color: "text.primary",
|
|
4048
|
-
fontWeight:
|
|
4045
|
+
fontWeight: 600
|
|
4049
4046
|
},
|
|
4050
4047
|
variant: "body1",
|
|
4051
4048
|
children: label
|
|
@@ -4112,7 +4109,7 @@ var EventMessage = ({ event }) => {
|
|
|
4112
4109
|
ref: textReference,
|
|
4113
4110
|
sx: {
|
|
4114
4111
|
color: "text.primary",
|
|
4115
|
-
fontWeight:
|
|
4112
|
+
fontWeight: 600,
|
|
4116
4113
|
maxWidth: "100%",
|
|
4117
4114
|
ml: shouldShowToggle ? 0 : 4,
|
|
4118
4115
|
overflow: "hidden",
|
|
@@ -4169,10 +4166,9 @@ var EventDetail = ({
|
|
|
4169
4166
|
{
|
|
4170
4167
|
sx: {
|
|
4171
4168
|
alignItems: "left",
|
|
4172
|
-
color: "text.secondary",
|
|
4173
4169
|
display: "flex",
|
|
4174
4170
|
flexGrow: 1,
|
|
4175
|
-
fontWeight:
|
|
4171
|
+
fontWeight: 600
|
|
4176
4172
|
},
|
|
4177
4173
|
variant: "subtitle1",
|
|
4178
4174
|
children: displayText
|
|
@@ -4204,7 +4200,7 @@ var EventDetail = ({
|
|
|
4204
4200
|
color: "text.secondary",
|
|
4205
4201
|
display: "flex",
|
|
4206
4202
|
flexGrow: 1,
|
|
4207
|
-
fontWeight:
|
|
4203
|
+
fontWeight: 600,
|
|
4208
4204
|
ml: 1,
|
|
4209
4205
|
mr: 2
|
|
4210
4206
|
},
|
|
@@ -4311,6 +4307,10 @@ var EventSection = ({
|
|
|
4311
4307
|
// src/components/event-details/event-details.tsx
|
|
4312
4308
|
import { Fragment as Fragment6, jsx as jsx137, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
4313
4309
|
var EventDetails = ({ onClose, selectedEvent }) => {
|
|
4310
|
+
const attributes = useMemo7(() => {
|
|
4311
|
+
const attributes2 = Object.entries(selectedEvent?.attributes ?? {});
|
|
4312
|
+
return attributes2.filter(([key]) => key !== "localstack.aws.account_id" && key !== "localstack.aws.service");
|
|
4313
|
+
}, [selectedEvent?.attributes]);
|
|
4314
4314
|
if (!selectedEvent) {
|
|
4315
4315
|
return /* @__PURE__ */ jsx137(Box15, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ jsx137(Typography9, { color: "text.secondary", variant: "body2", children: "Select an event to view details" }) });
|
|
4316
4316
|
}
|
|
@@ -4319,41 +4319,41 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
4319
4319
|
/* @__PURE__ */ jsx137(Box15, { sx: { flexGrow: 1, overflow: "auto", p: 2 }, children: /* @__PURE__ */ jsxs129(Stack2, { spacing: 2, children: [
|
|
4320
4320
|
/* @__PURE__ */ jsx137(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ jsxs129(Stack2, { spacing: 1, children: [
|
|
4321
4321
|
/* @__PURE__ */ jsxs129(Box15, { children: [
|
|
4322
|
-
/* @__PURE__ */ jsx137(Typography9, {
|
|
4322
|
+
/* @__PURE__ */ jsx137(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Span ID" }),
|
|
4323
4323
|
/* @__PURE__ */ jsx137(Typography9, { variant: "body2", children: selectedEvent.span_id })
|
|
4324
4324
|
] }),
|
|
4325
4325
|
/* @__PURE__ */ jsxs129(Box15, { children: [
|
|
4326
|
-
/* @__PURE__ */ jsx137(Typography9, {
|
|
4327
|
-
/* @__PURE__ */ jsx137(Typography9, {
|
|
4326
|
+
/* @__PURE__ */ jsx137(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Trace ID" }),
|
|
4327
|
+
/* @__PURE__ */ jsx137(Typography9, { variant: "body2", children: selectedEvent.trace_id })
|
|
4328
4328
|
] }),
|
|
4329
4329
|
/* @__PURE__ */ jsxs129(Box15, { children: [
|
|
4330
|
-
/* @__PURE__ */ jsx137(Typography9, {
|
|
4330
|
+
/* @__PURE__ */ jsx137(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Operation" }),
|
|
4331
4331
|
/* @__PURE__ */ jsx137(Typography9, { variant: "body2", children: selectedEvent.operation_name })
|
|
4332
4332
|
] })
|
|
4333
4333
|
] }) }),
|
|
4334
4334
|
/* @__PURE__ */ jsx137(Divider2, {}),
|
|
4335
4335
|
/* @__PURE__ */ jsx137(ToggleSection, { headline: "Service Information", children: /* @__PURE__ */ jsxs129(Stack2, { spacing: 1, children: [
|
|
4336
4336
|
/* @__PURE__ */ jsxs129(Box15, { children: [
|
|
4337
|
-
/* @__PURE__ */ jsx137(Typography9, {
|
|
4337
|
+
/* @__PURE__ */ jsx137(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Service" }),
|
|
4338
4338
|
/* @__PURE__ */ jsx137(Typography9, { variant: "body2", children: selectedEvent.service_name })
|
|
4339
4339
|
] }),
|
|
4340
4340
|
/* @__PURE__ */ jsxs129(Box15, { children: [
|
|
4341
|
-
/* @__PURE__ */ jsx137(Typography9, {
|
|
4341
|
+
/* @__PURE__ */ jsx137(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource" }),
|
|
4342
4342
|
/* @__PURE__ */ jsx137(Typography9, { variant: "body2", children: selectedEvent.resource_name })
|
|
4343
4343
|
] }),
|
|
4344
4344
|
Boolean(selectedEvent.region) && /* @__PURE__ */ jsxs129(Box15, { children: [
|
|
4345
|
-
/* @__PURE__ */ jsx137(Typography9, {
|
|
4345
|
+
/* @__PURE__ */ jsx137(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Region" }),
|
|
4346
4346
|
/* @__PURE__ */ jsx137(Typography9, { variant: "body2", children: selectedEvent.region })
|
|
4347
4347
|
] })
|
|
4348
4348
|
] }) }),
|
|
4349
4349
|
/* @__PURE__ */ jsx137(Divider2, {}),
|
|
4350
4350
|
/* @__PURE__ */ jsx137(ToggleSection, { headline: "Timing", children: /* @__PURE__ */ jsxs129(Stack2, { spacing: 1, children: [
|
|
4351
4351
|
/* @__PURE__ */ jsxs129(Box15, { children: [
|
|
4352
|
-
/* @__PURE__ */ jsx137(Typography9, {
|
|
4352
|
+
/* @__PURE__ */ jsx137(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Start Time" }),
|
|
4353
4353
|
/* @__PURE__ */ jsx137(Typography9, { variant: "body2", children: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
|
|
4354
4354
|
] }),
|
|
4355
4355
|
Boolean(selectedEvent.end_time_unix_nano) && /* @__PURE__ */ jsxs129(Box15, { children: [
|
|
4356
|
-
/* @__PURE__ */ jsx137(Typography9, {
|
|
4356
|
+
/* @__PURE__ */ jsx137(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: "Duration" }),
|
|
4357
4357
|
/* @__PURE__ */ jsxs129(Typography9, { variant: "body2", children: [
|
|
4358
4358
|
((BigInt(selectedEvent.end_time_unix_nano) - BigInt(selectedEvent.start_time_unix_nano)) / BigInt("1000000")).toString(),
|
|
4359
4359
|
" ",
|
|
@@ -4383,13 +4383,25 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
4383
4383
|
}
|
|
4384
4384
|
)
|
|
4385
4385
|
] }),
|
|
4386
|
-
|
|
4386
|
+
attributes.length > 0 && /* @__PURE__ */ jsxs129(Fragment6, { children: [
|
|
4387
4387
|
/* @__PURE__ */ jsx137(Divider2, {}),
|
|
4388
|
-
/* @__PURE__ */ jsx137(ToggleSection, { headline: "Attributes", children: /* @__PURE__ */ jsx137(
|
|
4388
|
+
/* @__PURE__ */ jsx137(ToggleSection, { headline: "Attributes", children: /* @__PURE__ */ jsx137(Stack2, { spacing: 1, children: attributes.map(([key, value]) => /* @__PURE__ */ jsxs129(Box15, { children: [
|
|
4389
|
+
/* @__PURE__ */ jsx137(Typography9, { sx: { fontWeight: 600 }, variant: "caption", children: key }),
|
|
4390
|
+
/* @__PURE__ */ jsx137(Typography9, { variant: "body2", children: renderKeyValue(key, value) })
|
|
4391
|
+
] }, key)) }) })
|
|
4389
4392
|
] })
|
|
4390
4393
|
] }) })
|
|
4391
4394
|
] });
|
|
4392
4395
|
};
|
|
4396
|
+
function renderKeyValue(key, value) {
|
|
4397
|
+
if (typeof value === "string" && (key === "localstack.aws.service.request" || key === "localstack.aws.service.response" || key === "localstack.aws.service.exception")) {
|
|
4398
|
+
return /* @__PURE__ */ jsx137(Box15, { sx: { backgroundColor: (theme) => theme.palette.background.default, borderRadius: 1, p: 1 }, children: /* @__PURE__ */ jsx137("pre", { style: { margin: 0, overflow: "auto" }, children: /* @__PURE__ */ jsx137(Typography9, { variant: "body2", children: JSON.stringify(JSON.parse(value), void 0, 2) }) }) });
|
|
4399
|
+
}
|
|
4400
|
+
if (typeof value === "boolean") {
|
|
4401
|
+
return /* @__PURE__ */ jsx137(Typography9, { variant: "body2", children: value ? "yes" : "no" });
|
|
4402
|
+
}
|
|
4403
|
+
return /* @__PURE__ */ jsx137(Typography9, { variant: "body2", children: value });
|
|
4404
|
+
}
|
|
4393
4405
|
|
|
4394
4406
|
// src/components/trace-graph/trace-graph.tsx
|
|
4395
4407
|
import "@xyflow/react/dist/base.css";
|
|
@@ -4406,10 +4418,10 @@ import { memo, useCallback as useCallback6 } from "react";
|
|
|
4406
4418
|
// src/components/trace-graph/problem-indicator.tsx
|
|
4407
4419
|
import { Error as ErrorIcon2, Info as Info2, Warning as Warning2 } from "@mui/icons-material";
|
|
4408
4420
|
import { Box as Box16, Tooltip as Tooltip3 } from "@mui/material";
|
|
4409
|
-
import { useMemo as
|
|
4421
|
+
import { useMemo as useMemo8 } from "react";
|
|
4410
4422
|
import { jsx as jsx138 } from "react/jsx-runtime";
|
|
4411
4423
|
var ProblemIndicator = ({ error }) => {
|
|
4412
|
-
const icon =
|
|
4424
|
+
const icon = useMemo8(() => {
|
|
4413
4425
|
switch (error.level) {
|
|
4414
4426
|
case "error": {
|
|
4415
4427
|
return /* @__PURE__ */ jsx138(ErrorIcon2, { sx: { color: "#d32f2f", fontSize: "14px" } });
|
|
@@ -4422,7 +4434,7 @@ var ProblemIndicator = ({ error }) => {
|
|
|
4422
4434
|
}
|
|
4423
4435
|
}
|
|
4424
4436
|
}, [error.level]);
|
|
4425
|
-
const color =
|
|
4437
|
+
const color = useMemo8(() => {
|
|
4426
4438
|
switch (error.level) {
|
|
4427
4439
|
case "error": {
|
|
4428
4440
|
return "#d32f2f";
|