@caido/sdk-frontend 0.54.2-beta.0 → 0.54.2-beta.10

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 (39) hide show
  1. package/package.json +1 -1
  2. package/src/types/__generated__/graphql-sdk.d.ts +457 -113
  3. package/src/types/index.d.ts +27 -3
  4. package/src/types/private/analytics.d.ts +29 -0
  5. package/src/types/sdks/ai.d.ts +6 -1
  6. package/src/types/sdks/automate.d.ts +37 -0
  7. package/src/types/sdks/findings.d.ts +6 -0
  8. package/src/types/sdks/httpHistory.d.ts +6 -0
  9. package/src/types/sdks/index.d.ts +11 -0
  10. package/src/types/sdks/matchReplace.d.ts +19 -1
  11. package/src/types/sdks/replay.d.ts +19 -1
  12. package/src/types/sdks/search.d.ts +6 -0
  13. package/src/types/sdks/settings.d.ts +22 -0
  14. package/src/types/sdks/sitemap.d.ts +52 -1
  15. package/src/types/sdks/window.d.ts +13 -2
  16. package/src/types/types/ai.d.ts +20 -0
  17. package/src/types/types/assistant.d.ts +7 -0
  18. package/src/types/types/automate.d.ts +56 -0
  19. package/src/types/types/backups.d.ts +7 -0
  20. package/src/types/types/certificate.d.ts +7 -0
  21. package/src/types/types/environment.d.ts +9 -0
  22. package/src/types/types/exports.d.ts +7 -0
  23. package/src/types/types/files.d.ts +7 -0
  24. package/src/types/types/filter.d.ts +9 -1
  25. package/src/types/types/findings.d.ts +9 -1
  26. package/src/types/types/httpHistory.d.ts +9 -0
  27. package/src/types/types/intercept.d.ts +19 -0
  28. package/src/types/types/matchReplace.d.ts +9 -1
  29. package/src/types/types/projects.d.ts +7 -0
  30. package/src/types/types/replay.d.ts +17 -1
  31. package/src/types/types/response.d.ts +27 -0
  32. package/src/types/types/scopes.d.ts +9 -1
  33. package/src/types/types/search.d.ts +7 -0
  34. package/src/types/types/settings.d.ts +25 -0
  35. package/src/types/types/sitemap.d.ts +96 -0
  36. package/src/types/types/utils.d.ts +28 -0
  37. package/src/types/types/websocket.d.ts +7 -0
  38. package/src/types/types/window.d.ts +31 -0
  39. package/src/types/types/workflows.d.ts +7 -0
@@ -6,3 +6,10 @@ import { type ID } from "./utils";
6
6
  export type SelectedProjectChangeEvent = {
7
7
  projectId: ID | undefined;
8
8
  };
9
+ /**
10
+ * Projects page context.
11
+ * @category Projects
12
+ */
13
+ export type ProjectsPageContext = {
14
+ kind: "Projects";
15
+ };
@@ -1,5 +1,5 @@
1
1
  import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
2
- import { type ID } from "./utils";
2
+ import { type ID, type Selection } from "./utils";
3
3
  /**
4
4
  * The slots in the Replay UI.
5
5
  * @category Replay
@@ -218,3 +218,19 @@ export type ReplayCollectionCreatedEvent = {
218
218
  */
219
219
  collection: ReplayCollection;
220
220
  };
221
+ /**
222
+ * Replay page context.
223
+ * @category Replay
224
+ */
225
+ export type ReplayPageContext = {
226
+ kind: "Replay";
227
+ selection: Selection<ReplaySessionId>;
228
+ };
229
+ /**
230
+ * A unique replay session identifier.
231
+ * @category Replay
232
+ */
233
+ type ReplaySessionId = string & {
234
+ __replaySessionId?: never;
235
+ };
236
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { As, ComponentDefinition, ID, Prettify } from "./utils";
2
+ /**
3
+ * A complete response with all metadata and raw content.
4
+ * @category Response
5
+ */
6
+ export type ResponseFull = Prettify<As<"ResponseFull"> & {
7
+ id: ID;
8
+ raw: string;
9
+ statusCode: number;
10
+ roundtripTime: number;
11
+ length: number;
12
+ createdAt: Date;
13
+ }>;
14
+ /**
15
+ * Options for defining a custom response view mode.
16
+ * @category Response
17
+ */
18
+ export type ResponseViewModeOptions = {
19
+ /**
20
+ * The label of the view mode.
21
+ */
22
+ label: string;
23
+ /**
24
+ * The component to render when the view mode is selected.
25
+ */
26
+ view: ComponentDefinition;
27
+ };
@@ -1,5 +1,5 @@
1
1
  import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
2
- import { type ID } from "./utils";
2
+ import { type ID, type Selection } from "./utils";
3
3
  /**
4
4
  * Represents a scope.
5
5
  * @category Scopes
@@ -51,3 +51,11 @@ export type CurrentScopeChangeEvent = {
51
51
  */
52
52
  scopeId: ID | undefined;
53
53
  };
54
+ /**
55
+ * Scope page context.
56
+ * @category Scopes
57
+ */
58
+ export type ScopePageContext = {
59
+ kind: "Scope";
60
+ selection: Selection<ID>;
61
+ };
@@ -13,3 +13,10 @@ export type SearchSlot = (typeof SearchSlot)[keyof typeof SearchSlot];
13
13
  export type SearchSlotContent = {
14
14
  [SearchSlot.ToolbarPrimary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
15
15
  };
16
+ /**
17
+ * Search page context.
18
+ * @category Search
19
+ */
20
+ export type SearchPageContext = {
21
+ kind: "Search";
22
+ };
@@ -0,0 +1,25 @@
1
+ import { type CustomSlotContent } from "./slots";
2
+ /**
3
+ * The slots in the Settings UI.
4
+ * @category Settings
5
+ */
6
+ export declare const SettingsSlot: {
7
+ /**
8
+ * The plugins section in the settings sidebar.
9
+ */
10
+ readonly PluginsSection: "plugins-section";
11
+ };
12
+ export type SettingsSlot = (typeof SettingsSlot)[keyof typeof SettingsSlot];
13
+ /**
14
+ * Content for a settings plugin slot.
15
+ * @category Settings
16
+ */
17
+ export type SettingsPluginSlotContent = CustomSlotContent & {
18
+ /**
19
+ * The name of the plugin settings page displayed in the sidebar.
20
+ */
21
+ name: string;
22
+ };
23
+ export type SettingsSlotContent = {
24
+ [SettingsSlot.PluginsSection]: SettingsPluginSlotContent;
25
+ };
@@ -0,0 +1,96 @@
1
+ import { type ID, type Selection } from "./utils";
2
+ /**
3
+ * An entry in sitemap.
4
+ * @category Sitemap
5
+ */
6
+ export type SitemapEntry = {
7
+ /**
8
+ * The ID of the entry.
9
+ */
10
+ id: ID;
11
+ /**
12
+ * The label of the entry.
13
+ */
14
+ label: string;
15
+ /**
16
+ * The kind of the entry.
17
+ */
18
+ kind: SitemapEntryKind;
19
+ /**
20
+ * The ID of the parent entry.
21
+ */
22
+ parentId?: ID;
23
+ /**
24
+ * The child state of the entry.
25
+ */
26
+ childState: ChildState;
27
+ };
28
+ export type SitemapRootEntry = {
29
+ /**
30
+ * The ID of the entry.
31
+ */
32
+ id: ID;
33
+ /**
34
+ * The label of the entry.
35
+ */
36
+ label: string;
37
+ /**
38
+ * The child state of the entry.
39
+ */
40
+ childState: ChildState;
41
+ };
42
+ /**
43
+ * The kind of a sitemap entry.
44
+ * @category Sitemap
45
+ */
46
+ export declare const SitemapEntryKind: {
47
+ readonly Directory: "DIRECTORY";
48
+ readonly Domain: "DOMAIN";
49
+ readonly Request: "REQUEST";
50
+ readonly RequestBody: "REQUEST_BODY";
51
+ readonly RequestQuery: "REQUEST_QUERY";
52
+ };
53
+ /**
54
+ * The kind of a sitemap entry.
55
+ * @category Sitemap
56
+ * @example
57
+ * ```ts
58
+ * const entry = {
59
+ * id: "123",
60
+ * label: "Example",
61
+ * kind: SitemapEntryKind.Request,
62
+ * };
63
+ * ```
64
+ */
65
+ export type SitemapEntryKind = (typeof SitemapEntryKind)[keyof typeof SitemapEntryKind];
66
+ export type ChildState = {
67
+ kind: "Empty";
68
+ } | {
69
+ kind: "NotLoaded";
70
+ } | {
71
+ kind: "Loaded";
72
+ items: ID[];
73
+ };
74
+ /**
75
+ * Event fired when the child state of a sitemap entry changes.
76
+ * @category Sitemap
77
+ */
78
+ export type SitemapEntryChildStateUpdateEvent = {
79
+ /**
80
+ * The ID of the entry that changed.
81
+ */
82
+ entryId: ID;
83
+ /**
84
+ * The new child state of the entry.
85
+ */
86
+ newChildState: ChildState;
87
+ };
88
+ /**
89
+ * Sitemap page context.
90
+ * @category Sitemap
91
+ */
92
+ export type SitemapPageContext = {
93
+ kind: "Sitemap";
94
+ entrySelection: Selection<ID>;
95
+ requestSelection: Selection<ID>;
96
+ };
@@ -60,3 +60,31 @@ export type Prettify<T> = {
60
60
  export type As<TType extends string> = {
61
61
  type: TType;
62
62
  };
63
+ /**
64
+ * Generic selection type with main and secondary items.
65
+ * Main represents the primary selected item, secondary represents additional selected items.
66
+ * @category Utils
67
+ */
68
+ export type Selection<TId> = {
69
+ kind: "Empty";
70
+ } | {
71
+ kind: "Selected";
72
+ main: TId;
73
+ secondary: TId[];
74
+ };
75
+ /**
76
+ * Visual indicator displayed next to a item label in a tree component.
77
+ * Includes an icon and an associated description.
78
+ * @category Utils
79
+ */
80
+ export type AddIndicatorOptions = {
81
+ icon: Icon;
82
+ description: string;
83
+ };
84
+ /**
85
+ * Providing operations that can be performed on a item indicator.
86
+ * @category Utils
87
+ */
88
+ export type Indicator = {
89
+ remove: () => void;
90
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Certificate page context.
3
+ * @category Websockets
4
+ */
5
+ export type WebsocketPageContext = {
6
+ kind: "Websocket";
7
+ };
@@ -1,3 +1,22 @@
1
+ import type { AssistantPageContext } from "./assistant";
2
+ import type { AutomatePageContext } from "./automate";
3
+ import type { BackupsPageContext } from "./backups";
4
+ import type { CertificatePageContext } from "./certificate";
5
+ import type { EnvironmentPageContext } from "./environment";
6
+ import type { ExportsPageContext } from "./exports";
7
+ import type { FilesPageContext } from "./files";
8
+ import type { FilterPageContext } from "./filter";
9
+ import type { FindingsPageContext } from "./findings";
10
+ import type { HTTPHistoryPageContext } from "./httpHistory";
11
+ import type { InterceptPageContext } from "./intercept";
12
+ import type { MatchReplacePageContext } from "./matchReplace";
13
+ import type { ProjectsPageContext } from "./projects";
14
+ import type { ReplayPageContext } from "./replay";
15
+ import type { ScopePageContext } from "./scopes";
16
+ import type { SearchPageContext } from "./search";
17
+ import type { SitemapPageContext } from "./sitemap";
18
+ import { type WebsocketPageContext } from "./websocket";
19
+ import type { WorkflowsPageContext } from "./workflows";
1
20
  /**
2
21
  * Options for configuring a dialog.
3
22
  * @category Window
@@ -17,3 +36,15 @@ export type DialogOptions = {
17
36
  export type Dialog = {
18
37
  close: () => void;
19
38
  };
39
+ /**
40
+ * Represents the context of the current page.
41
+ * @category Window
42
+ */
43
+ export type PageContext = AssistantPageContext | AutomatePageContext | BackupsPageContext | CertificatePageContext | ExportsPageContext | EnvironmentPageContext | FilterPageContext | FindingsPageContext | HTTPHistoryPageContext | ReplayPageContext | ScopePageContext | SearchPageContext | WorkflowsPageContext | ProjectsPageContext | FilesPageContext | MatchReplacePageContext | InterceptPageContext | SitemapPageContext | WebsocketPageContext;
44
+ /**
45
+ * Represents the global context of the application.
46
+ * @category Window
47
+ */
48
+ export type GlobalContext = {
49
+ page?: PageContext;
50
+ };
@@ -35,3 +35,10 @@ export type OnUpdatedWorkflowCallback = (event: {
35
35
  export type OnDeletedWorkflowCallback = (event: {
36
36
  id: ID;
37
37
  }) => void;
38
+ /**
39
+ * Workflows page context.
40
+ * @category Workflows
41
+ */
42
+ export type WorkflowsPageContext = {
43
+ kind: "Workflows";
44
+ };