@har-analyzer/components 0.0.20 → 0.0.21

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.
Files changed (65) hide show
  1. package/dist/chunks/collapsible-key-value-list.js +41 -10
  2. package/dist/chunks/collapsible-section.js +1 -1
  3. package/dist/chunks/common.js +10 -0
  4. package/dist/chunks/content-type.js +15 -21
  5. package/dist/chunks/har-entry-response-status.js +14 -0
  6. package/dist/chunks/har.js +47 -20
  7. package/dist/chunks/horizontal-padding.js +8 -0
  8. package/dist/chunks/index.js +589 -891
  9. package/dist/chunks/index2.js +271 -49
  10. package/dist/chunks/list-har-entries.js +30 -0
  11. package/dist/chunks/request-headers.js +34 -0
  12. package/dist/chunks/request-payload.js +25 -0
  13. package/dist/chunks/response-headers.js +19 -0
  14. package/dist/chunks/response-payload.js +10 -0
  15. package/dist/components/collapsible-key-value-list.d.ts +7 -2
  16. package/dist/components/collapsible-section.d.ts +2 -1
  17. package/dist/components/enhanced-board/i18n.d.ts +26 -0
  18. package/dist/components/enhanced-board/index.d.ts +15 -0
  19. package/dist/components/{enhanced-table.d.ts → enhanced-table/index.d.ts} +9 -15
  20. package/dist/components/enhanced-table/preferences.d.ts +13 -0
  21. package/dist/components/har-entry-response-status.d.ts +4 -0
  22. package/dist/components/space-between.d.ts +2 -0
  23. package/dist/features/har-analyzer/components/app-layout.d.ts +3 -2
  24. package/dist/features/har-analyzer/components/top-navigation.d.ts +3 -2
  25. package/dist/features/har-analyzer/index.d.ts +2 -1
  26. package/dist/features/har-entries-viewer/components/har-entries-viewer-action-stripe/har-entry-header-picker.d.ts +6 -0
  27. package/dist/features/har-entries-viewer/components/har-entries-viewer-action-stripe/index.d.ts +8 -0
  28. package/dist/features/har-entries-viewer/components/har-entries-viewer-provider.d.ts +2 -0
  29. package/dist/features/har-entries-viewer/components/view-har-entry-header.d.ts +7 -0
  30. package/dist/features/har-entries-viewer/context/preferences.d.ts +2 -0
  31. package/dist/features/har-entries-viewer/index.d.ts +1 -1
  32. package/dist/features/list-har-entries/components/list-har-entries-provider.d.ts +2 -0
  33. package/dist/features/list-har-entries/components/list-har-entries-table-header/index.d.ts +6 -0
  34. package/dist/features/list-har-entries/components/list-har-entries-table.d.ts +8 -0
  35. package/dist/features/list-har-entries/components/list-har-entries.d.ts +5 -0
  36. package/dist/features/list-har-entries/context/preferences.d.ts +1 -3
  37. package/dist/features/list-har-entries/hooks/filter-har-entries.d.ts +2 -0
  38. package/dist/features/list-har-entries/index.d.ts +8 -4
  39. package/dist/features/view-har-entry/components/request-headers.d.ts +4 -0
  40. package/dist/features/view-har-entry/components/request-payload.d.ts +6 -0
  41. package/dist/features/view-har-entry/components/response-headers.d.ts +4 -0
  42. package/dist/features/view-har-entry/components/response-payload.d.ts +6 -0
  43. package/dist/features/view-har-entry/index.d.ts +1 -1
  44. package/dist/har-analyzer.js +16 -15
  45. package/dist/har-entries-viewer.js +271 -630
  46. package/dist/index.d.ts +1 -1
  47. package/dist/index.js +25 -17
  48. package/dist/list-har-entries.js +6 -3
  49. package/dist/utils/array.d.ts +7 -0
  50. package/dist/utils/har.d.ts +12 -1
  51. package/dist/view-har-entry.js +58 -6
  52. package/package.json +2 -2
  53. package/dist/assets/har-entries-viewer.css +0 -1
  54. package/dist/chunks/headers-viewer.js +0 -32
  55. package/dist/chunks/payload-viewer.js +0 -15
  56. package/dist/chunks/response-viewer.js +0 -10
  57. package/dist/components/r2-layout/fgl.d.ts +0 -10
  58. package/dist/components/r2-layout/index.d.ts +0 -22
  59. package/dist/features/list-har-entries/components/har-entries-table.d.ts +0 -8
  60. package/dist/features/view-har-entry/components/headers-viewer.d.ts +0 -6
  61. package/dist/features/view-har-entry/components/payload-viewer.d.ts +0 -6
  62. package/dist/features/view-har-entry/components/response-viewer.d.ts +0 -6
  63. /package/dist/features/{list-har-entries/components → har-entries-viewer/components/har-entries-viewer-action-stripe}/compare-mode-switcher.d.ts +0 -0
  64. /package/dist/features/list-har-entries/components/{content-type-filter.d.ts → list-har-entries-table-header/content-type-filter.d.ts} +0 -0
  65. /package/dist/features/list-har-entries/components/{errors-filter.d.ts → list-har-entries-table-header/errors-filter.d.ts} +0 -0
@@ -1,23 +1,54 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import n from "@cloudscape-design/components/box";
3
- import p from "@cloudscape-design/components/column-layout";
4
- import { C as a } from "./collapsible-section.js";
5
- import s from "@cloudscape-design/components/copy-to-clipboard";
6
- function u(i) {
7
- const { textToCopy: t, textToDisplay: r } = i;
2
+ import c from "@cloudscape-design/components/box";
3
+ import { C as p } from "./collapsible-section.js";
4
+ import { E as s } from "./index2.js";
5
+ import m from "@cloudscape-design/components/copy-to-clipboard";
6
+ function u(t) {
7
+ const { textToCopy: i, textToDisplay: r } = t;
8
8
  return /* @__PURE__ */ o(
9
- s,
9
+ m,
10
10
  {
11
11
  variant: "inline",
12
- textToCopy: t,
12
+ textToCopy: i,
13
13
  textToDisplay: r,
14
14
  copyErrorText: "Failed to copy",
15
15
  copySuccessText: "Copied!"
16
16
  }
17
17
  );
18
18
  }
19
- function x({ title: i, items: t = [] }) {
20
- return /* @__PURE__ */ o(a, { variant: "inline", title: i, children: /* @__PURE__ */ o(p, { borders: "horizontal", columns: 2, disableGutters: !0, children: t.reduce((r, { name: l, value: e }) => (r.push(/* @__PURE__ */ o(n, { variant: "awsui-key-label", children: l })), r.push(e ? /* @__PURE__ */ o(u, { textToCopy: e }) : /* @__PURE__ */ o(n, { variant: "span", children: "-" })), r), []) }) });
19
+ function x(t) {
20
+ const {
21
+ items: i,
22
+ sectionTitle: r,
23
+ keyTitle: l = "Name",
24
+ valueTitle: a = "Value"
25
+ } = t;
26
+ return /* @__PURE__ */ o(p, { variant: "footer", title: r, children: /* @__PURE__ */ o(
27
+ s,
28
+ {
29
+ contentDensity: "compact",
30
+ items: i,
31
+ getRowId: ({ id: e }) => e,
32
+ columnsDefinition: {
33
+ key: {
34
+ header: l,
35
+ cell: ({ name: e }) => ({
36
+ value: e
37
+ })
38
+ },
39
+ value: {
40
+ header: a,
41
+ cell: ({ value: e, content: n }) => e ? {
42
+ value: e,
43
+ content: n ?? /* @__PURE__ */ o(u, { textToCopy: e })
44
+ } : {
45
+ value: "-",
46
+ content: n ?? /* @__PURE__ */ o(c, { variant: "span", children: "-" })
47
+ }
48
+ }
49
+ }
50
+ }
51
+ ) });
21
52
  }
22
53
  export {
23
54
  x as C
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import a from "@cloudscape-design/components/expandable-section";
3
- import { H as n } from "./index2.js";
3
+ import { H as n } from "./horizontal-padding.js";
4
4
  function p({
5
5
  title: t,
6
6
  children: o,
@@ -0,0 +1,10 @@
1
+ function t(e) {
2
+ return Object.keys(e);
3
+ }
4
+ function n(e) {
5
+ return Object.entries(e);
6
+ }
7
+ export {
8
+ n as a,
9
+ t as o
10
+ };
@@ -1,14 +1,9 @@
1
- import r from "@cloudscape-design/code-view/highlight/css";
2
- import a from "@cloudscape-design/code-view/highlight/html";
3
- import m from "@cloudscape-design/code-view/highlight/javascript";
1
+ import a from "@cloudscape-design/code-view/highlight/css";
2
+ import m from "@cloudscape-design/code-view/highlight/html";
3
+ import r from "@cloudscape-design/code-view/highlight/javascript";
4
4
  import g from "@cloudscape-design/code-view/highlight/json";
5
5
  import h from "@cloudscape-design/code-view/highlight/xml";
6
- function y(t) {
7
- return Object.keys(t);
8
- }
9
- function c(t) {
10
- return Object.entries(t);
11
- }
6
+ import { o as p, a as y } from "./common.js";
12
7
  const e = {
13
8
  JSON: {
14
9
  mimeTypeContains: ["json"],
@@ -20,15 +15,15 @@ const e = {
20
15
  },
21
16
  JS: {
22
17
  mimeTypeContains: ["javascript", "ecmascript"],
23
- syntaxHighlight: m
18
+ syntaxHighlight: r
24
19
  },
25
20
  CSS: {
26
21
  mimeTypeContains: ["text/css"],
27
- syntaxHighlight: r
22
+ syntaxHighlight: a
28
23
  },
29
24
  HTML: {
30
25
  mimeTypeContains: ["html"],
31
- syntaxHighlight: a
26
+ syntaxHighlight: m
32
27
  },
33
28
  Doc: {
34
29
  mimeTypeContains: ["text/"]
@@ -42,26 +37,25 @@ const e = {
42
37
  Media: {
43
38
  mimeTypeContains: ["audio/", "video/"]
44
39
  }
45
- }, u = [...y(e), "Other"];
46
- function p(t) {
40
+ }, S = [...p(e), "Other"];
41
+ function T(t) {
47
42
  if (!t)
48
43
  return "Other";
49
44
  const i = t.toLowerCase();
50
- for (const [n, { mimeTypeContains: o }] of c(e))
45
+ for (const [n, { mimeTypeContains: o }] of y(e))
51
46
  if (o.some((s) => i.includes(s)))
52
47
  return n;
53
48
  return "Other";
54
49
  }
55
- function H(t) {
56
- const i = p(t);
50
+ function u(t) {
51
+ const i = T(t);
57
52
  if (i === "Other")
58
53
  return;
59
54
  const { syntaxHighlight: n } = e[i];
60
55
  return n;
61
56
  }
62
57
  export {
63
- u as C,
64
- H as a,
65
- p as g,
66
- c as o
58
+ S as C,
59
+ u as a,
60
+ T as g
67
61
  };
@@ -0,0 +1,14 @@
1
+ import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
+ import e from "@cloudscape-design/components/status-indicator";
3
+ import { i as p } from "./har.js";
4
+ function a({ harEntry: s }) {
5
+ const r = s.response.status, t = s.response._error, o = /* @__PURE__ */ i(e, { type: "error", children: [
6
+ r,
7
+ " ",
8
+ t && `(${t})`
9
+ ] });
10
+ return p(s) ? o : r >= 300 ? /* @__PURE__ */ n(e, { type: "warning", children: r }) : r >= 200 ? /* @__PURE__ */ n(e, { type: "success", children: r }) : o;
11
+ }
12
+ export {
13
+ a as H
14
+ };
@@ -1,5 +1,5 @@
1
- import { g as a } from "./content-type.js";
2
- function u(e) {
1
+ import { g as i } from "./content-type.js";
2
+ function T(e) {
3
3
  if (typeof e != "string")
4
4
  throw new TypeError("File contents are invalid. Expected contents to be a stringified JSON.");
5
5
  try {
@@ -9,35 +9,62 @@ function u(e) {
9
9
  throw new Error(r, { cause: t });
10
10
  }
11
11
  }
12
- function d(e, t) {
13
- return t.length ? e.filter((n) => {
14
- const s = n.response.content.mimeType, o = a(s);
15
- return t.includes(o);
12
+ function m(e, t) {
13
+ return t.length ? e.filter((o) => {
14
+ const s = o.response.content.mimeType, n = i(s);
15
+ return t.includes(n);
16
16
  }) : e;
17
17
  }
18
- function i(e) {
18
+ function c(e) {
19
19
  const t = e.response.status;
20
20
  return t < 200 || t >= 400;
21
21
  }
22
- function p(e) {
23
- return e.filter((t) => i(t));
22
+ function A(e) {
23
+ return e.filter((t) => c(t));
24
24
  }
25
- function f(e, t) {
25
+ const d = ["request", "response"];
26
+ function p(e, t) {
26
27
  const r = /* @__PURE__ */ new Set();
27
- return e.forEach((n) => {
28
- n[t].headers.forEach((o) => {
29
- r.add(o.name);
28
+ return e.forEach((o) => {
29
+ o[t].headers.forEach((n) => {
30
+ r.add(n.name);
30
31
  });
31
32
  }), Array.from(r);
32
33
  }
33
- function m(e) {
34
+ const l = {
35
+ "request.shortUrl": (e) => {
36
+ const { url: t } = e.request;
37
+ return t.split("/").at(-1) || t;
38
+ },
39
+ "request.url": (e) => e.request.url,
40
+ "request.method": (e) => e.request.method,
41
+ "response.status": (e) => e.response.status
42
+ };
43
+ function f(e) {
44
+ return d.reduce((t, r) => (p(e, r).forEach((s) => {
45
+ const n = `${r}.headers.${s}`;
46
+ t[n] = (u) => u[r].headers.filter(({ name: a }) => a === s).map(({ value: a }) => a);
47
+ }), t), {});
48
+ }
49
+ function H(e) {
50
+ const t = f(e);
51
+ return {
52
+ ...l,
53
+ ...t
54
+ };
55
+ }
56
+ function g(e) {
34
57
  return `${e.startedDateTime}_${e.time}_${e.request.url}`;
35
58
  }
36
59
  export {
37
- d as a,
38
- p as b,
39
- f as c,
40
- m as d,
41
- u as g,
42
- i
60
+ l as D,
61
+ d as H,
62
+ m as a,
63
+ A as b,
64
+ p as c,
65
+ f as d,
66
+ H as e,
67
+ g as f,
68
+ T as g,
69
+ c as i
43
70
  };
@@ -0,0 +1,8 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import i from "@cloudscape-design/components/box";
3
+ function a({ children: o }) {
4
+ return /* @__PURE__ */ r(i, { padding: { horizontal: "m" }, children: o });
5
+ }
6
+ export {
7
+ a as H
8
+ };