@localstack/appinspector-ui 1.0.144 → 1.0.146
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 +37 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +37 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -15112,7 +15112,7 @@ var ICONS_MAP = {
|
|
|
15112
15112
|
};
|
|
15113
15113
|
var AwsServiceIconBase = (0, import_react33.memo)((props) => {
|
|
15114
15114
|
const Icon = ICONS_MAP[props.service];
|
|
15115
|
-
return Icon ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Icon, { ...props }) :
|
|
15115
|
+
return Icon ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Icon, { ...props }) : null;
|
|
15116
15116
|
});
|
|
15117
15117
|
var supportedServiceNames = Object.keys(ICONS_MAP);
|
|
15118
15118
|
|
|
@@ -15284,13 +15284,14 @@ function parseIAMEvent(payloadString) {
|
|
|
15284
15284
|
|
|
15285
15285
|
// src/components/cells/status-cell.tsx
|
|
15286
15286
|
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
15287
|
-
var StatusIcon = ({ errorLevel, spanStatusCode }) => {
|
|
15287
|
+
var StatusIcon = ({ errorLevel, operationStatus, spanStatusCode }) => {
|
|
15288
15288
|
switch (errorLevel) {
|
|
15289
15289
|
case ErrorLevel.ERROR: {
|
|
15290
15290
|
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.Cancel, { sx: { color: "red" } });
|
|
15291
15291
|
}
|
|
15292
15292
|
case ErrorLevel.IAM_PERMISSION: {
|
|
15293
|
-
|
|
15293
|
+
const isDenial = operationStatus ? operationStatus === "iam_explicit_deny" || operationStatus === "iam_implicit_deny" : spanStatusCode === 2;
|
|
15294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.GppBad, { sx: { color: isDenial ? "red" : "warning.main" } });
|
|
15294
15295
|
}
|
|
15295
15296
|
case ErrorLevel.WARNING: {
|
|
15296
15297
|
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.Error, { sx: { color: "orange" } });
|
|
@@ -15301,6 +15302,22 @@ var StatusIcon = ({ errorLevel, spanStatusCode }) => {
|
|
|
15301
15302
|
}
|
|
15302
15303
|
};
|
|
15303
15304
|
var calculateHighestErrorLevel = (span) => {
|
|
15305
|
+
if (span.operation_status) {
|
|
15306
|
+
switch (span.operation_status) {
|
|
15307
|
+
case "error": {
|
|
15308
|
+
return ErrorLevel.ERROR;
|
|
15309
|
+
}
|
|
15310
|
+
case "iam_explicit_deny":
|
|
15311
|
+
case "iam_explicit_warn":
|
|
15312
|
+
case "iam_implicit_deny":
|
|
15313
|
+
case "iam_implicit_warn": {
|
|
15314
|
+
return ErrorLevel.IAM_PERMISSION;
|
|
15315
|
+
}
|
|
15316
|
+
default: {
|
|
15317
|
+
return ErrorLevel.OK;
|
|
15318
|
+
}
|
|
15319
|
+
}
|
|
15320
|
+
}
|
|
15304
15321
|
const hasIamDenial = span.events.some((event) => {
|
|
15305
15322
|
if (!event.event_type?.toLowerCase().includes("iam")) return false;
|
|
15306
15323
|
if (typeof event.attributes?.payload !== "string") return false;
|
|
@@ -15344,7 +15361,7 @@ var buildTooltipContent = (span) => {
|
|
|
15344
15361
|
var StatusIconWithTooltip = ({ span }) => {
|
|
15345
15362
|
const errorLevel = calculateHighestErrorLevel(span);
|
|
15346
15363
|
if (errorLevel !== ErrorLevel.ERROR && errorLevel !== ErrorLevel.IAM_PERMISSION) return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_jsx_runtime124.Fragment, {});
|
|
15347
|
-
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material4.Tooltip, { title: buildTooltipContent(span), children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material4.Box, { sx: { alignItems: "center", cursor: "default", display: "flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(StatusIcon, { errorLevel, spanStatusCode: span.status_code }) }) });
|
|
15364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material4.Tooltip, { title: buildTooltipContent(span), children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material4.Box, { sx: { alignItems: "center", cursor: "default", display: "flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(StatusIcon, { errorLevel, operationStatus: span.operation_status, spanStatusCode: span.status_code }) }) });
|
|
15348
15365
|
};
|
|
15349
15366
|
|
|
15350
15367
|
// src/components/spans-list/span-count-badge.tsx
|
|
@@ -16626,17 +16643,6 @@ var import_react44 = require("react");
|
|
|
16626
16643
|
// src/api/client.ts
|
|
16627
16644
|
var import_semver2 = __toESM(require_semver2(), 1);
|
|
16628
16645
|
|
|
16629
|
-
// src/utils/time.ts
|
|
16630
|
-
function unixNanoToDate(unixNanoString) {
|
|
16631
|
-
const milliseconds = unixNanoToMilliseconds(unixNanoString);
|
|
16632
|
-
if (!milliseconds) return void 0;
|
|
16633
|
-
return new Date(milliseconds);
|
|
16634
|
-
}
|
|
16635
|
-
function unixNanoToMilliseconds(unixNanoString) {
|
|
16636
|
-
if (!unixNanoString) return void 0;
|
|
16637
|
-
return Number(BigInt(unixNanoString) / BigInt("1000000"));
|
|
16638
|
-
}
|
|
16639
|
-
|
|
16640
16646
|
// src/constants/error-messages.ts
|
|
16641
16647
|
var ERROR_MESSAGES = {
|
|
16642
16648
|
APP_INSPECTOR_DISABLED: "App Inspector is currently disabled.",
|
|
@@ -16690,6 +16696,17 @@ var createScopedLogger = (scope) => ({
|
|
|
16690
16696
|
}
|
|
16691
16697
|
});
|
|
16692
16698
|
|
|
16699
|
+
// src/utils/time.ts
|
|
16700
|
+
function unixNanoToDate(unixNanoString) {
|
|
16701
|
+
const milliseconds = unixNanoToMilliseconds(unixNanoString);
|
|
16702
|
+
if (!milliseconds) return void 0;
|
|
16703
|
+
return new Date(milliseconds);
|
|
16704
|
+
}
|
|
16705
|
+
function unixNanoToMilliseconds(unixNanoString) {
|
|
16706
|
+
if (!unixNanoString) return void 0;
|
|
16707
|
+
return Number(BigInt(unixNanoString) / BigInt("1000000"));
|
|
16708
|
+
}
|
|
16709
|
+
|
|
16693
16710
|
// src/api/client.ts
|
|
16694
16711
|
var apiLogger = createScopedLogger("API");
|
|
16695
16712
|
var analyticsLogger = createScopedLogger("ANALYTICS");
|
|
@@ -31760,14 +31777,16 @@ var ServiceNode = (0, import_react56.memo)(({ data, selected }) => {
|
|
|
31760
31777
|
const theme = (0, import_material19.useTheme)();
|
|
31761
31778
|
const [isHovered, setIsHovered] = (0, import_react56.useState)(false);
|
|
31762
31779
|
const nodeRef = (0, import_react56.useRef)(null);
|
|
31763
|
-
const
|
|
31764
|
-
const
|
|
31780
|
+
const { operation_status } = data.event;
|
|
31781
|
+
const hasPermissionEventsLegacy = (0, import_react56.useMemo)(
|
|
31765
31782
|
() => data.event.events.some(
|
|
31766
31783
|
(event) => event.event_type === "iam.policy_evaluation" && event.name === "iam.policy.denied"
|
|
31767
31784
|
),
|
|
31768
31785
|
[data.event.events]
|
|
31769
31786
|
);
|
|
31770
|
-
const
|
|
31787
|
+
const isError = operation_status ? operation_status === "error" || operation_status === "iam_explicit_deny" || operation_status === "iam_implicit_deny" : data.event.status_code === 2;
|
|
31788
|
+
const isWarning = operation_status ? operation_status === "iam_explicit_warn" || operation_status === "iam_implicit_warn" : !isError && data.event.status_code === 1 && hasPermissionEventsLegacy;
|
|
31789
|
+
const hasPermissionEvents = operation_status ? operation_status.startsWith("iam_") : hasPermissionEventsLegacy;
|
|
31771
31790
|
const outlineColor = isError ? theme.palette.error.main : isWarning ? theme.palette.warning.main : void 0;
|
|
31772
31791
|
const sharedBoxSx = {
|
|
31773
31792
|
backgroundColor: theme.palette.background.paper,
|