@har-analyzer/components 0.0.10 → 0.0.11
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/README.md +125 -43
- package/dist/chunks/har.js +27 -27
- package/dist/chunks/index.js +186 -44
- package/dist/chunks/json.js +10 -0
- package/dist/components/collapsible-key-value-list.d.ts +9 -0
- package/dist/components/collapsible-section.d.ts +5 -0
- package/dist/components/enhanced-board/constants/i18n.d.ts +21 -0
- package/dist/components/enhanced-board/index.d.ts +15 -0
- package/dist/components/enhanced-table.d.ts +47 -0
- package/dist/components/enhanced-top-navigation.d.ts +7 -0
- package/dist/components/error-boundary.d.ts +1 -0
- package/dist/components/horizontal-gap.d.ts +6 -0
- package/dist/components/json-viewer.d.ts +3 -0
- package/dist/components/simple-app-layout.d.ts +6 -0
- package/dist/components/simple-app-preferences/content-width-switcher.d.ts +1 -0
- package/dist/components/simple-app-preferences/index.d.ts +1 -0
- package/dist/components/simple-app-preferences/theme-switcher.d.ts +1 -0
- package/dist/components/vertical-gap.d.ts +6 -0
- package/dist/features/har-analyzer/index.d.ts +5 -0
- package/dist/features/har-analyzer-preferences/index.d.ts +7 -0
- package/dist/features/har-entries-viewer/components/har-entries-filters/components/content-type-filter.d.ts +7 -0
- package/dist/features/har-entries-viewer/components/har-entries-filters/components/errors-filter.d.ts +6 -0
- package/dist/features/har-entries-viewer/components/har-entries-filters/index.d.ts +1 -0
- package/dist/features/har-entries-viewer/hooks/preferences.d.ts +2 -0
- package/dist/features/har-entries-viewer/index.d.ts +7 -0
- package/dist/features/har-file-uploader/file-upload-error.d.ts +5 -0
- package/dist/features/har-file-uploader/index.d.ts +8 -0
- package/dist/features/list-har-entries/index.d.ts +8 -0
- package/dist/features/view-har-entry/components/content-viewer.d.ts +7 -0
- package/dist/features/view-har-entry/components/headers-viewer.d.ts +6 -0
- package/dist/features/view-har-entry/components/payload-viewer.d.ts +6 -0
- package/dist/features/view-har-entry/components/response-viewer.d.ts +6 -0
- package/dist/features/view-har-entry/index.d.ts +5 -0
- package/dist/har-analyzer-preferences.js +21 -92
- package/dist/har-analyzer.js +72 -75
- package/dist/har-entries-viewer.js +7 -2117
- package/dist/har-file-uploader.js +18 -18
- package/dist/hooks/app-preferences.d.ts +2 -0
- package/dist/hooks/board-preferences.d.ts +2 -0
- package/dist/hooks/table-preferences.d.ts +12 -0
- package/dist/index.d.ts +8 -77
- package/dist/index.js +17 -16
- package/dist/list-har-entries.js +2131 -0
- package/dist/utils/common.d.ts +2 -0
- package/dist/utils/content-type.d.ts +4 -0
- package/dist/utils/date.d.ts +2 -0
- package/dist/utils/file-upload.d.ts +3 -0
- package/dist/utils/har.d.ts +17 -0
- package/dist/utils/json.d.ts +1 -0
- package/dist/view-har-entry.js +3130 -0
- package/package.json +3 -3
- package/dist/har-analyzer-preferences.d.ts +0 -18
- package/dist/har-analyzer.d.ts +0 -11
- package/dist/har-content-viewer.d.ts +0 -14
- package/dist/har-content-viewer.js +0 -150
- package/dist/har-entries-filters.d.ts +0 -23
- package/dist/har-entries-filters.js +0 -7
- package/dist/har-entries-viewer.d.ts +0 -26
- package/dist/har-entry-viewer.d.ts +0 -24
- package/dist/har-entry-viewer.js +0 -1145
- package/dist/har-file-uploader.d.ts +0 -16
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import f from "@cloudscape-design/components/box";
|
|
3
3
|
import p from "@cloudscape-design/components/file-dropzone";
|
|
4
|
-
import
|
|
5
|
-
import { useState as
|
|
6
|
-
import { V as
|
|
4
|
+
import F from "@cloudscape-design/components/file-input";
|
|
5
|
+
import { useState as g } from "react";
|
|
6
|
+
import { V as h } from "./chunks/vertical-gap.js";
|
|
7
7
|
import { g as E } from "./chunks/har.js";
|
|
8
8
|
import w from "@cloudscape-design/components/flashbar";
|
|
9
9
|
const c = ".har";
|
|
10
10
|
function C(r) {
|
|
11
11
|
return r ? r.name.toLowerCase().endsWith(c) : !1;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function x(r) {
|
|
14
14
|
return r.length !== 1;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function y(r) {
|
|
17
17
|
const o = [];
|
|
18
|
-
return
|
|
18
|
+
return x(r) && o.push("You can only upload one file at a time"), C(r[0]) || o.push(`Only files with the "${c}" extension are allowed`), o;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function A(r) {
|
|
21
21
|
return new Promise((o, e) => {
|
|
22
22
|
if (!r) {
|
|
23
23
|
e(new Error("No HAR file provided"));
|
|
@@ -29,7 +29,8 @@ function y(r) {
|
|
|
29
29
|
const s = n.target?.result;
|
|
30
30
|
o(s);
|
|
31
31
|
} catch (s) {
|
|
32
|
-
|
|
32
|
+
const t = "Failed to JSON parse file content";
|
|
33
|
+
e(new Error(t, { cause: s }));
|
|
33
34
|
}
|
|
34
35
|
}, i.onerror = () => {
|
|
35
36
|
e(new Error("Error reading HAR file"));
|
|
@@ -44,32 +45,31 @@ function R({ errors: r }) {
|
|
|
44
45
|
}));
|
|
45
46
|
return /* @__PURE__ */ a(w, { items: o });
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
-
const [o, e] =
|
|
48
|
+
function z({ onChange: r }) {
|
|
49
|
+
const [o, e] = g([]), i = async (n) => {
|
|
49
50
|
e([]);
|
|
50
|
-
const s =
|
|
51
|
+
const s = y(n);
|
|
51
52
|
if (s.length > 0) {
|
|
52
53
|
e(s);
|
|
53
54
|
return;
|
|
54
55
|
}
|
|
55
56
|
try {
|
|
56
|
-
const t = n[0], l = t?.name,
|
|
57
|
-
r({
|
|
57
|
+
const t = n[0], l = t?.name, d = await A(t), m = E(d).log.entries;
|
|
58
|
+
r({ harEntries: m, harFileName: l });
|
|
58
59
|
} catch (t) {
|
|
59
|
-
console.error("Error reading HAR file:", t);
|
|
60
60
|
const l = t instanceof Error ? t.message : "An unknown error occurred";
|
|
61
61
|
e([l]);
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
return /* @__PURE__ */ u(
|
|
64
|
+
return /* @__PURE__ */ u(h, { children: [
|
|
65
65
|
/* @__PURE__ */ a(R, { errors: o }),
|
|
66
|
-
/* @__PURE__ */ a(p, { onChange: ({ detail: n }) => i(n.value), children: /* @__PURE__ */ u(
|
|
66
|
+
/* @__PURE__ */ a(p, { onChange: ({ detail: n }) => i(n.value), children: /* @__PURE__ */ u(h, { alignItems: "center", size: "s", children: [
|
|
67
67
|
/* @__PURE__ */ a(f, { color: "inherit", children: "Drop your .har file here" }),
|
|
68
68
|
/* @__PURE__ */ a(f, { color: "inherit", children: "or" }),
|
|
69
|
-
/* @__PURE__ */ a(
|
|
69
|
+
/* @__PURE__ */ a(F, { accept: c, value: [], onChange: ({ detail: n }) => i(n.value), children: "Choose file" })
|
|
70
70
|
] }) })
|
|
71
71
|
] });
|
|
72
72
|
}
|
|
73
73
|
export {
|
|
74
|
-
|
|
74
|
+
z as default
|
|
75
75
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { EnhancedBoardProps } from '../components/enhanced-board';
|
|
2
|
+
export default function useBoardDefinitionsPreference(boardId: string, defaultDefinitionsPreference: EnhancedBoardProps['definitions']): readonly [import('../components/enhanced-board/constants/i18n').EnhancedBoardDefinitions, (newPreference: import('../components/enhanced-board/constants/i18n').EnhancedBoardDefinitions) => void];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CollectionPreferencesProps } from '@cloudscape-design/components/collection-preferences';
|
|
2
|
+
export declare function useTablePreferences(tableId: string, defaultPreferences: CollectionPreferencesProps.Preferences): readonly [CollectionPreferencesProps.Preferences<any>, (newPreference: CollectionPreferencesProps.Preferences<any>) => void];
|
|
3
|
+
export declare function useTablePreferredColumnWidths(tableId: string, defaultWidths?: {
|
|
4
|
+
id: string;
|
|
5
|
+
width?: number;
|
|
6
|
+
}[]): readonly [{
|
|
7
|
+
id: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
}[], (newPreference: {
|
|
10
|
+
id: string;
|
|
11
|
+
width?: number;
|
|
12
|
+
}[]) => void];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,77 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare function getEntriesFromHAR(harContent?: Har): Entry[];
|
|
11
|
-
|
|
12
|
-
export declare function getHARContentFromFile(fileContent: unknown): HARContent;
|
|
13
|
-
|
|
14
|
-
export declare function getHAREntriesFilteredByContentType(harEntries: HAREntry[], contentTypeFilters: ContentTypeGroup[]): HAREntry[];
|
|
15
|
-
|
|
16
|
-
export declare function getHAREntriesWithErrorResponse(harEntries: HAREntry[]): HAREntry[];
|
|
17
|
-
|
|
18
|
-
export declare function getUniqueHeaderNames(harEntries: HAREntry[], type: 'request' | 'response'): string[];
|
|
19
|
-
|
|
20
|
-
export declare function HARAnalyzer({ logo, appName }: HARAnalyzerProps): JSX.Element;
|
|
21
|
-
|
|
22
|
-
export declare function HARAnalyzerPreferencesProvider({ store, children }: PropsWithChildren<{
|
|
23
|
-
store: PreferencesStore;
|
|
24
|
-
}>): JSX.Element;
|
|
25
|
-
|
|
26
|
-
declare interface HARAnalyzerProps {
|
|
27
|
-
logo?: React.ReactNode;
|
|
28
|
-
appName?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export declare type HARContent = Har;
|
|
32
|
-
|
|
33
|
-
export declare function HARContentViewer(props: HARContentViewerProps): JSX.Element;
|
|
34
|
-
|
|
35
|
-
declare interface HARContentViewerProps {
|
|
36
|
-
harFileName: string;
|
|
37
|
-
harContent: HARContent;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export declare type HAREntry = Omit<HAREntryWithoutError, 'response'> & {
|
|
41
|
-
response: HARResponseWithError;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export declare function HAREntryViewer({ harEntry }: HAREntryViewerProps): JSX.Element;
|
|
45
|
-
|
|
46
|
-
declare interface HAREntryViewerProps {
|
|
47
|
-
harEntry: HAREntry;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
declare type HAREntryWithoutError = ReturnType<typeof getEntriesFromHAR>[number];
|
|
51
|
-
|
|
52
|
-
export declare function HARFileUploader({ onChange }: HARFileUploaderProps): JSX.Element;
|
|
53
|
-
|
|
54
|
-
declare interface HARFileUploaderProps {
|
|
55
|
-
onChange: (args: {
|
|
56
|
-
harContent: HARContent;
|
|
57
|
-
harFileName?: string;
|
|
58
|
-
}) => void;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
declare type HARResponseWithError = HAREntryWithoutError['response'] & {
|
|
62
|
-
_error?: string;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export declare function isErrorResponse(harEntry: HAREntry): boolean;
|
|
66
|
-
|
|
67
|
-
declare interface PreferencesStore {
|
|
68
|
-
getPreference: (key: string) => Promise<string | undefined>;
|
|
69
|
-
setPreference: (key: string, value: string) => Promise<void>;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export declare function useHAREntriesFilters(harEntries: HAREntry[]): {
|
|
73
|
-
filteredHAREntries: HAREntry[];
|
|
74
|
-
HAREntriesFilters: () => JSX.Element;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export { }
|
|
1
|
+
export { default as HARAnalyzer } from './features/har-analyzer';
|
|
2
|
+
export { default as HARAnalyzerPreferencesProvider } from './features/har-analyzer-preferences';
|
|
3
|
+
export { default as HAREntriesViewer } from './features/har-entries-viewer';
|
|
4
|
+
export { default as useHAREntriesFilters } from './features/har-entries-viewer/components/har-entries-filters';
|
|
5
|
+
export { default as HARFileUploader } from './features/har-file-uploader';
|
|
6
|
+
export { default as ListHAREntries } from './features/list-har-entries';
|
|
7
|
+
export { default as ViewHAREntry } from './features/view-har-entry';
|
|
8
|
+
export * from './utils/har';
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { default as t } from "./har-analyzer.js";
|
|
2
|
-
import { default as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import {
|
|
2
|
+
import { default as a } from "./har-analyzer-preferences.js";
|
|
3
|
+
import { H as i, a as n } from "./chunks/index.js";
|
|
4
|
+
import { default as A } from "./har-file-uploader.js";
|
|
5
|
+
import { default as R } from "./list-har-entries.js";
|
|
6
|
+
import { default as d } from "./view-har-entry.js";
|
|
7
|
+
import { g as m, a as E, b as u, d as x, c as g, i as y } from "./chunks/har.js";
|
|
8
8
|
export {
|
|
9
9
|
t as HARAnalyzer,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
A as
|
|
13
|
-
|
|
14
|
-
d as
|
|
10
|
+
a as HARAnalyzerPreferencesProvider,
|
|
11
|
+
i as HAREntriesViewer,
|
|
12
|
+
A as HARFileUploader,
|
|
13
|
+
R as ListHAREntries,
|
|
14
|
+
d as ViewHAREntry,
|
|
15
15
|
m as getHARContentFromFile,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
g as
|
|
20
|
-
|
|
16
|
+
E as getHAREntriesFilteredByContentType,
|
|
17
|
+
u as getHAREntriesWithErrorResponse,
|
|
18
|
+
x as getHAREntryId,
|
|
19
|
+
g as getUniqueHeaderNames,
|
|
20
|
+
y as isErrorResponse,
|
|
21
|
+
n as useHAREntriesFilters
|
|
21
22
|
};
|