@caido/sdk-frontend 0.42.1-beta.5 → 0.42.1-beta.7
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/package.json +1 -1
- package/src/types/__generated__/graphql-sdk.d.ts +1448 -1448
- package/src/types/filters.d.ts +70 -0
- package/src/types/httpHistory.d.ts +3 -2
- package/src/types/index.d.ts +8 -1
- package/src/types/replay.d.ts +9 -8
- package/src/types/search.d.ts +3 -2
- package/src/types/utils.d.ts +7 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { HTTPQL, ID } from "./utils";
|
|
2
|
+
/**
|
|
3
|
+
* SDK for interacting with the Filters page.
|
|
4
|
+
* @category Filters
|
|
5
|
+
*/
|
|
6
|
+
export type FiltersSDK = {
|
|
7
|
+
/**
|
|
8
|
+
* Gets all filters.
|
|
9
|
+
* @returns The filters.
|
|
10
|
+
*/
|
|
11
|
+
getAll: () => Filter[];
|
|
12
|
+
/**
|
|
13
|
+
* Creates a filter.
|
|
14
|
+
* @param options Options for the filter.
|
|
15
|
+
* @param options.name The name of the filter. Should be unique.
|
|
16
|
+
* @param options.query The HTTPQL query of the filter.
|
|
17
|
+
* @param options.alias The alias of the filter. Used when referencing the filter in an HTTPQL query (e.g. `preset:my-alias`).
|
|
18
|
+
*
|
|
19
|
+
* Should be unique and follow the format `[a-zA-Z0-9_-]+`.
|
|
20
|
+
*
|
|
21
|
+
* @returns The created filter.
|
|
22
|
+
*/
|
|
23
|
+
create: (options: {
|
|
24
|
+
name: string;
|
|
25
|
+
query: HTTPQL;
|
|
26
|
+
alias: string;
|
|
27
|
+
}) => Promise<Filter>;
|
|
28
|
+
/**
|
|
29
|
+
* Updates a filter.
|
|
30
|
+
* @param id The ID of the filter to update.
|
|
31
|
+
* @param options Options for the filter.
|
|
32
|
+
* @param options.name The name of the filter.
|
|
33
|
+
* @param options.alias The alias of the filter.
|
|
34
|
+
* @param options.query The HTTPQL query of the filter.
|
|
35
|
+
* @returns The updated filter.
|
|
36
|
+
*/
|
|
37
|
+
update: (id: ID, options: {
|
|
38
|
+
name: string;
|
|
39
|
+
alias: string;
|
|
40
|
+
query: HTTPQL;
|
|
41
|
+
}) => Promise<Filter>;
|
|
42
|
+
/**
|
|
43
|
+
* Deletes a filter.
|
|
44
|
+
* @param id The ID of the filter to delete.
|
|
45
|
+
*/
|
|
46
|
+
delete: (id: ID) => Promise<void>;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Represents a filter.
|
|
50
|
+
* @category Filters
|
|
51
|
+
*/
|
|
52
|
+
export type Filter = {
|
|
53
|
+
/**
|
|
54
|
+
* The ID of the filter.
|
|
55
|
+
*/
|
|
56
|
+
id: ID;
|
|
57
|
+
/**
|
|
58
|
+
* The name of the filter.
|
|
59
|
+
*/
|
|
60
|
+
name: string;
|
|
61
|
+
/**
|
|
62
|
+
* The alias of the filter.
|
|
63
|
+
* This alias is used when referencing the filter in an HTTPQL query (e.g. `preset:my-alias`).
|
|
64
|
+
*/
|
|
65
|
+
alias: string;
|
|
66
|
+
/**
|
|
67
|
+
* The HTTPQL expression of the filter.
|
|
68
|
+
*/
|
|
69
|
+
query: HTTPQL;
|
|
70
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HTTPQL } from "./utils";
|
|
1
2
|
/**
|
|
2
3
|
* Utilities to interact with the HTTP History page.
|
|
3
4
|
* @category HTTP History
|
|
@@ -7,10 +8,10 @@ export type HTTPHistorySDK = {
|
|
|
7
8
|
* Set the HTTPQL query that will be applied on the HTTP History table results.
|
|
8
9
|
* @param query The HTTPQL query.
|
|
9
10
|
*/
|
|
10
|
-
setQuery: (query:
|
|
11
|
+
setQuery: (query: HTTPQL) => void;
|
|
11
12
|
/**
|
|
12
13
|
* Get the current HTTPQL query.
|
|
13
14
|
* @returns The current HTTPQL query.
|
|
14
15
|
*/
|
|
15
|
-
getQuery: () =>
|
|
16
|
+
getQuery: () => HTTPQL;
|
|
16
17
|
};
|
package/src/types/index.d.ts
CHANGED
|
@@ -15,10 +15,13 @@ import type { ReplaySDK } from "./replay";
|
|
|
15
15
|
import type { SearchSDK } from "./search";
|
|
16
16
|
import type { HTTPHistorySDK } from "./httpHistory";
|
|
17
17
|
import type { FilesSDK } from "./files";
|
|
18
|
+
import type { FiltersSDK } from "./filters";
|
|
18
19
|
export type { CommandContext } from "./commands";
|
|
19
20
|
export type { MenuItem } from "./menu";
|
|
20
21
|
export type { ReplayTab, ReplaySession, ReplayCollection } from "./replay";
|
|
21
22
|
export type { HostedFile } from "./files";
|
|
23
|
+
export type { Filter } from "./filters";
|
|
24
|
+
export type { HTTPQL, ID } from "./utils";
|
|
22
25
|
/**
|
|
23
26
|
* Utilities for frontend plugins.
|
|
24
27
|
* @category SDK
|
|
@@ -89,7 +92,11 @@ export type API<T extends BackendEndpoints = Record<string, never>, E extends Ba
|
|
|
89
92
|
*/
|
|
90
93
|
httpHistory: HTTPHistorySDK;
|
|
91
94
|
/**
|
|
92
|
-
* Utilities to interact with
|
|
95
|
+
* Utilities to interact with the Files page.
|
|
93
96
|
*/
|
|
94
97
|
files: FilesSDK;
|
|
98
|
+
/**
|
|
99
|
+
* Utilities to interact with Filters page.
|
|
100
|
+
*/
|
|
101
|
+
filters: FiltersSDK;
|
|
95
102
|
};
|
package/src/types/replay.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ID } from "./utils";
|
|
1
2
|
/**
|
|
2
3
|
* A replay tab.
|
|
3
4
|
* @category Replay
|
|
@@ -6,7 +7,7 @@ export type ReplayTab = {
|
|
|
6
7
|
/**
|
|
7
8
|
* The ID of the session associated with this tab.
|
|
8
9
|
*/
|
|
9
|
-
sessionId:
|
|
10
|
+
sessionId: ID;
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
12
13
|
* A session in Replay.
|
|
@@ -16,7 +17,7 @@ export type ReplaySession = {
|
|
|
16
17
|
/**
|
|
17
18
|
* The ID of the session.
|
|
18
19
|
*/
|
|
19
|
-
id:
|
|
20
|
+
id: ID;
|
|
20
21
|
/**
|
|
21
22
|
* The name of the session.
|
|
22
23
|
*/
|
|
@@ -24,7 +25,7 @@ export type ReplaySession = {
|
|
|
24
25
|
/**
|
|
25
26
|
* The ID of the collection the session belongs to.
|
|
26
27
|
*/
|
|
27
|
-
collectionId:
|
|
28
|
+
collectionId: ID;
|
|
28
29
|
};
|
|
29
30
|
/**
|
|
30
31
|
* A collection in Replay.
|
|
@@ -34,7 +35,7 @@ export type ReplayCollection = {
|
|
|
34
35
|
/**
|
|
35
36
|
* The ID of the collection.
|
|
36
37
|
*/
|
|
37
|
-
id:
|
|
38
|
+
id: ID;
|
|
38
39
|
/**
|
|
39
40
|
* The name of the collection.
|
|
40
41
|
*/
|
|
@@ -42,7 +43,7 @@ export type ReplayCollection = {
|
|
|
42
43
|
/**
|
|
43
44
|
* The sessions in the collection.
|
|
44
45
|
*/
|
|
45
|
-
sessionIds:
|
|
46
|
+
sessionIds: ID[];
|
|
46
47
|
};
|
|
47
48
|
/**
|
|
48
49
|
* Utilities to interact with Replay.
|
|
@@ -53,12 +54,12 @@ export type ReplaySDK = {
|
|
|
53
54
|
* Open a replay tab for the given session.
|
|
54
55
|
* @param sessionId The ID of the session to open.
|
|
55
56
|
*/
|
|
56
|
-
openTab: (sessionId:
|
|
57
|
+
openTab: (sessionId: ID) => void;
|
|
57
58
|
/**
|
|
58
59
|
* Close a replay tab for the given session.
|
|
59
60
|
* @param sessionId The ID of the session to close.
|
|
60
61
|
*/
|
|
61
|
-
closeTab: (sessionId:
|
|
62
|
+
closeTab: (sessionId: ID) => void;
|
|
62
63
|
/**
|
|
63
64
|
* Get the list of all open replay tabs.
|
|
64
65
|
* @returns The list of all open replay tabs.
|
|
@@ -80,5 +81,5 @@ export type ReplaySDK = {
|
|
|
80
81
|
* @param name The new name of the session.
|
|
81
82
|
* @returns The updated session.
|
|
82
83
|
*/
|
|
83
|
-
renameSession: (id:
|
|
84
|
+
renameSession: (id: ID, name: string) => Promise<ReplaySession>;
|
|
84
85
|
};
|
package/src/types/search.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HTTPQL } from "./utils";
|
|
1
2
|
/**
|
|
2
3
|
* Utilities to interact with the Search page.
|
|
3
4
|
* @category Search
|
|
@@ -7,10 +8,10 @@ export type SearchSDK = {
|
|
|
7
8
|
* Set the HTTPQL query that will be applied on the search table results.
|
|
8
9
|
* @param query The HTTPQL query.
|
|
9
10
|
*/
|
|
10
|
-
setQuery: (query:
|
|
11
|
+
setQuery: (query: HTTPQL) => void;
|
|
11
12
|
/**
|
|
12
13
|
* Get the current HTTPQL query.
|
|
13
14
|
* @returns The current HTTPQL query.
|
|
14
15
|
*/
|
|
15
|
-
getQuery: () =>
|
|
16
|
+
getQuery: () => HTTPQL;
|
|
16
17
|
};
|
package/src/types/utils.d.ts
CHANGED
|
@@ -12,6 +12,13 @@ export type ID = string & {
|
|
|
12
12
|
export type CommandID = string & {
|
|
13
13
|
__commandId?: never;
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* An HTTPQL expression.
|
|
17
|
+
* @example `req.method.eq:"POST"`
|
|
18
|
+
*/
|
|
19
|
+
export type HTTPQL = string & {
|
|
20
|
+
__httpql?: never;
|
|
21
|
+
};
|
|
15
22
|
/**
|
|
16
23
|
* A {@link https://fontawesome.com/icons|FontAwesome} icon class.
|
|
17
24
|
* @example "fas fa-rocket"
|