@caido/sdk-frontend 0.42.1-beta.4 → 0.42.1-beta.6
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/files.d.ts +60 -0
- package/src/types/index.d.ts +6 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK for interacting with the Files page.
|
|
3
|
+
* @category Files
|
|
4
|
+
*/
|
|
5
|
+
export type FilesSDK = {
|
|
6
|
+
/**
|
|
7
|
+
* Gets all hosted files.
|
|
8
|
+
* @returns The files.
|
|
9
|
+
*/
|
|
10
|
+
getAll: () => HostedFile[];
|
|
11
|
+
/**
|
|
12
|
+
* Uploads a file to the host.
|
|
13
|
+
* @param file The file to upload.
|
|
14
|
+
* @returns The uploaded file.
|
|
15
|
+
*/
|
|
16
|
+
create: (file: File) => Promise<HostedFile>;
|
|
17
|
+
/**
|
|
18
|
+
* Renames a file on the host.
|
|
19
|
+
* @param id The ID of the file to rename.
|
|
20
|
+
* @param name The new name of the file.
|
|
21
|
+
* @returns The renamed file.
|
|
22
|
+
*/
|
|
23
|
+
rename: (id: string, name: string) => Promise<HostedFile>;
|
|
24
|
+
/**
|
|
25
|
+
* Deletes a file from the host.
|
|
26
|
+
* @param id The ID of the file to delete.
|
|
27
|
+
* @returns The deleted file.
|
|
28
|
+
*/
|
|
29
|
+
delete: (id: string) => Promise<void>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A hosted file.
|
|
33
|
+
* @category Files
|
|
34
|
+
*/
|
|
35
|
+
export type HostedFile = {
|
|
36
|
+
/**
|
|
37
|
+
* The ID of the file.
|
|
38
|
+
*/
|
|
39
|
+
id: string;
|
|
40
|
+
/**
|
|
41
|
+
* The name of the file.
|
|
42
|
+
*/
|
|
43
|
+
name: string;
|
|
44
|
+
/**
|
|
45
|
+
* The size of the file in bytes.
|
|
46
|
+
*/
|
|
47
|
+
size: number;
|
|
48
|
+
/**
|
|
49
|
+
* The path of the file.
|
|
50
|
+
*/
|
|
51
|
+
path: string;
|
|
52
|
+
/**
|
|
53
|
+
* The date the file was created.
|
|
54
|
+
*/
|
|
55
|
+
createdAt: Date;
|
|
56
|
+
/**
|
|
57
|
+
* The date the file was updated.
|
|
58
|
+
*/
|
|
59
|
+
updatedAt: Date;
|
|
60
|
+
};
|
package/src/types/index.d.ts
CHANGED
|
@@ -14,9 +14,11 @@ import type { WindowSDK } from "./window";
|
|
|
14
14
|
import type { ReplaySDK } from "./replay";
|
|
15
15
|
import type { SearchSDK } from "./search";
|
|
16
16
|
import type { HTTPHistorySDK } from "./httpHistory";
|
|
17
|
+
import type { FilesSDK } from "./files";
|
|
17
18
|
export type { CommandContext } from "./commands";
|
|
18
19
|
export type { MenuItem } from "./menu";
|
|
19
20
|
export type { ReplayTab, ReplaySession, ReplayCollection } from "./replay";
|
|
21
|
+
export type { HostedFile } from "./files";
|
|
20
22
|
/**
|
|
21
23
|
* Utilities for frontend plugins.
|
|
22
24
|
* @category SDK
|
|
@@ -86,4 +88,8 @@ export type API<T extends BackendEndpoints = Record<string, never>, E extends Ba
|
|
|
86
88
|
* Utilities to interact with the HTTP History page.
|
|
87
89
|
*/
|
|
88
90
|
httpHistory: HTTPHistorySDK;
|
|
91
|
+
/**
|
|
92
|
+
* Utilities to interact with files.
|
|
93
|
+
*/
|
|
94
|
+
files: FilesSDK;
|
|
89
95
|
};
|