@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.js CHANGED
@@ -15128,7 +15128,7 @@ var ICONS_MAP = {
15128
15128
  };
15129
15129
  var AwsServiceIconBase = memo5((props) => {
15130
15130
  const Icon = ICONS_MAP[props.service];
15131
- return Icon ? /* @__PURE__ */ jsx121(Icon, { ...props }) : void 0;
15131
+ return Icon ? /* @__PURE__ */ jsx121(Icon, { ...props }) : null;
15132
15132
  });
15133
15133
  var supportedServiceNames = Object.keys(ICONS_MAP);
15134
15134
 
@@ -15300,13 +15300,14 @@ function parseIAMEvent(payloadString) {
15300
15300
 
15301
15301
  // src/components/cells/status-cell.tsx
15302
15302
  import { Fragment as Fragment2, jsx as jsx124, jsxs as jsxs119 } from "react/jsx-runtime";
15303
- var StatusIcon = ({ errorLevel, spanStatusCode }) => {
15303
+ var StatusIcon = ({ errorLevel, operationStatus, spanStatusCode }) => {
15304
15304
  switch (errorLevel) {
15305
15305
  case ErrorLevel.ERROR: {
15306
15306
  return /* @__PURE__ */ jsx124(Cancel, { sx: { color: "red" } });
15307
15307
  }
15308
15308
  case ErrorLevel.IAM_PERMISSION: {
15309
- return /* @__PURE__ */ jsx124(GppBad, { sx: { color: spanStatusCode === 2 ? "red" : "warning.main" } });
15309
+ const isDenial = operationStatus ? operationStatus === "iam_explicit_deny" || operationStatus === "iam_implicit_deny" : spanStatusCode === 2;
15310
+ return /* @__PURE__ */ jsx124(GppBad, { sx: { color: isDenial ? "red" : "warning.main" } });
15310
15311
  }
15311
15312
  case ErrorLevel.WARNING: {
15312
15313
  return /* @__PURE__ */ jsx124(Error2, { sx: { color: "orange" } });
@@ -15317,6 +15318,22 @@ var StatusIcon = ({ errorLevel, spanStatusCode }) => {
15317
15318
  }
15318
15319
  };
15319
15320
  var calculateHighestErrorLevel = (span) => {
15321
+ if (span.operation_status) {
15322
+ switch (span.operation_status) {
15323
+ case "error": {
15324
+ return ErrorLevel.ERROR;
15325
+ }
15326
+ case "iam_explicit_deny":
15327
+ case "iam_explicit_warn":
15328
+ case "iam_implicit_deny":
15329
+ case "iam_implicit_warn": {
15330
+ return ErrorLevel.IAM_PERMISSION;
15331
+ }
15332
+ default: {
15333
+ return ErrorLevel.OK;
15334
+ }
15335
+ }
15336
+ }
15320
15337
  const hasIamDenial = span.events.some((event) => {
15321
15338
  if (!event.event_type?.toLowerCase().includes("iam")) return false;
15322
15339
  if (typeof event.attributes?.payload !== "string") return false;
@@ -15360,7 +15377,7 @@ var buildTooltipContent = (span) => {
15360
15377
  var StatusIconWithTooltip = ({ span }) => {
15361
15378
  const errorLevel = calculateHighestErrorLevel(span);
15362
15379
  if (errorLevel !== ErrorLevel.ERROR && errorLevel !== ErrorLevel.IAM_PERMISSION) return /* @__PURE__ */ jsx124(Fragment2, {});
15363
- return /* @__PURE__ */ jsx124(Tooltip2, { title: buildTooltipContent(span), children: /* @__PURE__ */ jsx124(Box2, { sx: { alignItems: "center", cursor: "default", display: "flex" }, children: /* @__PURE__ */ jsx124(StatusIcon, { errorLevel, spanStatusCode: span.status_code }) }) });
15380
+ return /* @__PURE__ */ jsx124(Tooltip2, { title: buildTooltipContent(span), children: /* @__PURE__ */ jsx124(Box2, { sx: { alignItems: "center", cursor: "default", display: "flex" }, children: /* @__PURE__ */ jsx124(StatusIcon, { errorLevel, operationStatus: span.operation_status, spanStatusCode: span.status_code }) }) });
15364
15381
  };
15365
15382
 
15366
15383
  // src/components/spans-list/span-count-badge.tsx
@@ -16642,17 +16659,6 @@ import { useCallback as useCallback5, useMemo as useMemo5 } from "react";
16642
16659
  // src/api/client.ts
16643
16660
  var import_semver2 = __toESM(require_semver2(), 1);
16644
16661
 
16645
- // src/utils/time.ts
16646
- function unixNanoToDate(unixNanoString) {
16647
- const milliseconds = unixNanoToMilliseconds(unixNanoString);
16648
- if (!milliseconds) return void 0;
16649
- return new Date(milliseconds);
16650
- }
16651
- function unixNanoToMilliseconds(unixNanoString) {
16652
- if (!unixNanoString) return void 0;
16653
- return Number(BigInt(unixNanoString) / BigInt("1000000"));
16654
- }
16655
-
16656
16662
  // src/constants/error-messages.ts
16657
16663
  var ERROR_MESSAGES = {
16658
16664
  APP_INSPECTOR_DISABLED: "App Inspector is currently disabled.",
@@ -16706,6 +16712,17 @@ var createScopedLogger = (scope) => ({
16706
16712
  }
16707
16713
  });
16708
16714
 
16715
+ // src/utils/time.ts
16716
+ function unixNanoToDate(unixNanoString) {
16717
+ const milliseconds = unixNanoToMilliseconds(unixNanoString);
16718
+ if (!milliseconds) return void 0;
16719
+ return new Date(milliseconds);
16720
+ }
16721
+ function unixNanoToMilliseconds(unixNanoString) {
16722
+ if (!unixNanoString) return void 0;
16723
+ return Number(BigInt(unixNanoString) / BigInt("1000000"));
16724
+ }
16725
+
16709
16726
  // src/api/client.ts
16710
16727
  var apiLogger = createScopedLogger("API");
16711
16728
  var analyticsLogger = createScopedLogger("ANALYTICS");
@@ -31776,14 +31793,16 @@ var ServiceNode = memo11(({ data, selected }) => {
31776
31793
  const theme = useTheme4();
31777
31794
  const [isHovered, setIsHovered] = useState17(false);
31778
31795
  const nodeRef = useRef14(null);
31779
- const isError = data.event.status_code === 2;
31780
- const hasPermissionEvents = useMemo11(
31796
+ const { operation_status } = data.event;
31797
+ const hasPermissionEventsLegacy = useMemo11(
31781
31798
  () => data.event.events.some(
31782
31799
  (event) => event.event_type === "iam.policy_evaluation" && event.name === "iam.policy.denied"
31783
31800
  ),
31784
31801
  [data.event.events]
31785
31802
  );
31786
- const isWarning = !isError && data.event.status_code === 1 && hasPermissionEvents;
31803
+ const isError = operation_status ? operation_status === "error" || operation_status === "iam_explicit_deny" || operation_status === "iam_implicit_deny" : data.event.status_code === 2;
31804
+ const isWarning = operation_status ? operation_status === "iam_explicit_warn" || operation_status === "iam_implicit_warn" : !isError && data.event.status_code === 1 && hasPermissionEventsLegacy;
31805
+ const hasPermissionEvents = operation_status ? operation_status.startsWith("iam_") : hasPermissionEventsLegacy;
31787
31806
  const outlineColor = isError ? theme.palette.error.main : isWarning ? theme.palette.warning.main : void 0;
31788
31807
  const sharedBoxSx = {
31789
31808
  backgroundColor: theme.palette.background.paper,