@caido/sdk-frontend 0.49.1-beta.2 → 0.49.1-beta.3

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 (48) hide show
  1. package/package.json +1 -1
  2. package/src/types/index.d.ts +17 -151
  3. package/src/types/{assets.d.ts → sdks/assets.d.ts} +1 -11
  4. package/src/types/{backend.d.ts → sdks/backend.d.ts} +2 -15
  5. package/src/types/{commandPalette.d.ts → sdks/commandPalette.d.ts} +2 -1
  6. package/src/types/sdks/commands.d.ts +31 -0
  7. package/src/types/{environment.d.ts → sdks/environment.d.ts} +1 -14
  8. package/src/types/{files.d.ts → sdks/files.d.ts} +1 -30
  9. package/src/types/{filters.d.ts → sdks/filters.d.ts} +2 -24
  10. package/src/types/{findings.d.ts → sdks/findings.d.ts} +2 -32
  11. package/src/types/{footer.d.ts → sdks/footer.d.ts} +3 -10
  12. package/src/types/{httpHistory.d.ts → sdks/httpHistory.d.ts} +2 -2
  13. package/src/types/sdks/index.d.ts +137 -0
  14. package/src/types/{intercept.d.ts → sdks/intercept.d.ts} +1 -1
  15. package/src/types/sdks/matchReplace.d.ts +87 -0
  16. package/src/types/sdks/menu.d.ts +21 -0
  17. package/src/types/{replay.d.ts → sdks/replay.d.ts} +3 -54
  18. package/src/types/{scopes.d.ts → sdks/scopes.d.ts} +2 -23
  19. package/src/types/{search.d.ts → sdks/search.d.ts} +1 -1
  20. package/src/types/{shortcuts.d.ts → sdks/shortcuts.d.ts} +1 -1
  21. package/src/types/{sidebar.d.ts → sdks/sidebar.d.ts} +2 -13
  22. package/src/types/{sitemap.d.ts → sdks/sitemap.d.ts} +1 -1
  23. package/src/types/{storage.d.ts → sdks/storage.d.ts} +1 -1
  24. package/src/types/{ui.d.ts → sdks/ui.d.ts} +2 -2
  25. package/src/types/{window.d.ts → sdks/window.d.ts} +3 -10
  26. package/src/types/{workflows.d.ts → sdks/workflows.d.ts} +2 -25
  27. package/src/types/types/assets.d.ts +10 -0
  28. package/src/types/types/backend.d.ts +14 -0
  29. package/src/types/{commands.d.ts → types/commands.d.ts} +5 -28
  30. package/src/types/types/environment.d.ts +14 -0
  31. package/src/types/types/files.d.ts +30 -0
  32. package/src/types/types/filter.d.ts +24 -0
  33. package/src/types/types/findings.d.ts +31 -0
  34. package/src/types/types/footer.d.ts +10 -0
  35. package/src/types/types/json.d.ts +9 -0
  36. package/src/types/{matchReplace.d.ts → types/matchReplace.d.ts} +1 -86
  37. package/src/types/{menu.d.ts → types/menu.d.ts} +2 -21
  38. package/src/types/types/replay.d.ts +53 -0
  39. package/src/types/types/scopes.d.ts +23 -0
  40. package/src/types/types/sidebar.d.ts +11 -0
  41. package/src/types/{slots.d.ts → types/slots.d.ts} +1 -1
  42. package/src/types/{utils.d.ts → types/utils.d.ts} +0 -16
  43. package/src/types/types/window.d.ts +8 -0
  44. package/src/types/types/workflows.d.ts +25 -0
  45. /package/src/types/{navigation.d.ts → sdks/navigation.d.ts} +0 -0
  46. /package/src/types/{runtime.d.ts → sdks/runtime.d.ts} +0 -0
  47. /package/src/types/{editor.d.ts → types/editor.d.ts} +0 -0
  48. /package/src/types/{request.d.ts → types/request.d.ts} +0 -0
@@ -0,0 +1,21 @@
1
+ import { type MenuItem } from "../types/menu";
2
+ /**
3
+ * Utilities to insert menu items and context-menus throughout the UI.
4
+ * @category Menu
5
+ */
6
+ export type MenuSDK = {
7
+ /**
8
+ * Register a menu item.
9
+ * @param item The menu item to register.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * sdk.menu.registerItem({
14
+ * type: "Request",
15
+ * commandId: "hello",
16
+ * leadingIcon: "fas fa-hand",
17
+ * });
18
+ * ```
19
+ */
20
+ registerItem: (item: MenuItem) => void;
21
+ };
@@ -1,58 +1,7 @@
1
1
  import { type Extension } from "@codemirror/state";
2
- import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type DefineAddToSlotFn } from "./slots";
3
- import type { ID } from "./utils";
4
- export declare const ReplaySlot: {
5
- readonly SessionToolbarPrimary: "session-toolbar-primary";
6
- readonly SessionToolbarSecondary: "session-toolbar-secondary";
7
- readonly Topbar: "topbar";
8
- };
9
- export type ReplaySlot = (typeof ReplaySlot)[keyof typeof ReplaySlot];
10
- /**
11
- * A replay tab.
12
- * @category Replay
13
- */
14
- export type ReplayTab = {
15
- /**
16
- * The ID of the session associated with this tab.
17
- */
18
- sessionId: ID;
19
- };
20
- /**
21
- * A session in Replay.
22
- * @category Replay
23
- */
24
- export type ReplaySession = {
25
- /**
26
- * The ID of the session.
27
- */
28
- id: ID;
29
- /**
30
- * The name of the session.
31
- */
32
- name: string;
33
- /**
34
- * The ID of the collection the session belongs to.
35
- */
36
- collectionId: ID;
37
- };
38
- /**
39
- * A collection in Replay.
40
- * @category Replay
41
- */
42
- export type ReplayCollection = {
43
- /**
44
- * The ID of the collection.
45
- */
46
- id: ID;
47
- /**
48
- * The name of the collection.
49
- */
50
- name: string;
51
- /**
52
- * The sessions in the collection.
53
- */
54
- sessionIds: ID[];
55
- };
2
+ import { type ReplayCollection, type ReplaySession, type ReplaySlot, type ReplayTab } from "../types/replay";
3
+ import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type DefineAddToSlotFn } from "../types/slots";
4
+ import type { ID } from "../types/utils";
56
5
  /**
57
6
  * Utilities to interact with Replay.
58
7
  * @category Replay
@@ -1,4 +1,5 @@
1
- import type { ID } from "./utils";
1
+ import { type Scope } from "../types/scopes";
2
+ import type { ID } from "../types/utils";
2
3
  /**
3
4
  * Utilities to interact with scopes
4
5
  * @category Scopes
@@ -52,25 +53,3 @@ export type ScopesSDK = {
52
53
  */
53
54
  deleteScope: (id: ID) => Promise<boolean>;
54
55
  };
55
- /**
56
- * Represents a scope.
57
- * @category Scopes
58
- */
59
- export type Scope = {
60
- /**
61
- * The unique ID of the scope.
62
- */
63
- id: ID;
64
- /**
65
- * The name of the scope.
66
- */
67
- name: string;
68
- /**
69
- * The list of included items.
70
- */
71
- allowlist: string[];
72
- /**
73
- * The list of excluded items.
74
- */
75
- denylist: string[];
76
- };
@@ -1,4 +1,4 @@
1
- import type { HTTPQL, ID } from "./utils";
1
+ import type { HTTPQL, ID } from "../types/utils";
2
2
  /**
3
3
  * Utilities to interact with the Search page.
4
4
  * @category Search
@@ -1,4 +1,4 @@
1
- import type { CommandID } from "./utils";
1
+ import type { CommandID } from "../types/commands";
2
2
  /**
3
3
  * Utilities to interact with shortcuts.
4
4
  * @category Shortcuts
@@ -1,4 +1,5 @@
1
- import type { Icon } from "./utils";
1
+ import { type SidebarItem } from "../types/sidebar";
2
+ import type { Icon } from "../types/utils";
2
3
  /**
3
4
  * Utilities to interact with the sidebar.
4
5
  * @category Sidebar
@@ -27,15 +28,3 @@ export type SidebarSDK = {
27
28
  isExternal?: boolean;
28
29
  }) => SidebarItem;
29
30
  };
30
- /**
31
- * Represents a sidebar item.
32
- * @category Sidebar
33
- */
34
- type SidebarItem = {
35
- /**
36
- * Set the value of a notification badge next to the sidebar item.
37
- * @param count - The number to display in the badge. A value of 0 will hide the badge.
38
- */
39
- setCount: (count: number) => void;
40
- };
41
- export {};
@@ -1,4 +1,4 @@
1
- import type { ID } from "./utils";
1
+ import type { ID } from "../types/utils";
2
2
  /**
3
3
  * Utilities to interact with the Sitemap page.
4
4
  * @category Sitemap
@@ -1,4 +1,4 @@
1
- import type { JSONCompatible, JSONValue } from "./utils";
1
+ import type { JSONCompatible, JSONValue } from "../types/json";
2
2
  /**
3
3
  * Utilities to interact with frontend-plugin storage.
4
4
  * @category Storage
@@ -1,5 +1,5 @@
1
- import type { HTTPRequestEditor, HTTPResponseEditor } from "./editor";
2
- import type { Icon } from "./utils";
1
+ import type { HTTPRequestEditor, HTTPResponseEditor } from "../types/editor";
2
+ import type { Icon } from "../types/utils";
3
3
  /**
4
4
  * Utilities to create UI components.
5
5
  * @category UI
@@ -1,5 +1,6 @@
1
- import type { Editor } from "./editor";
2
- import type { CustomSlotContent } from "./slots";
1
+ import type { Editor } from "../types/editor";
2
+ import type { CustomSlotContent } from "../types/slots";
3
+ import { type DialogOptions } from "../types/window";
3
4
  /**
4
5
  * Utilities to interact with the active page.
5
6
  * @category Window
@@ -34,11 +35,3 @@ export type WindowSDK = {
34
35
  */
35
36
  showDialog: (component: CustomSlotContent, options?: DialogOptions) => void;
36
37
  };
37
- export type DialogOptions = {
38
- title?: string;
39
- draggable?: boolean;
40
- closeOnEscape?: boolean;
41
- closable?: boolean;
42
- modal?: boolean;
43
- position?: "left" | "right" | "top" | "bottom" | "center" | "topleft" | "topright" | "bottomleft" | "bottomright";
44
- };
@@ -1,4 +1,5 @@
1
- import { type ID, type ListenerHandle } from "./utils";
1
+ import { type ListenerHandle } from "../types/utils";
2
+ import { type OnCreatedWorkflowCallback, type OnDeletedWorkflowCallback, type OnUpdatedWorkflowCallback, type Workflow } from "../types/workflows";
2
3
  /**
3
4
  * Utilities to interact with workflows.
4
5
  * @category Workflows
@@ -25,27 +26,3 @@ export type WorkflowSDK = {
25
26
  */
26
27
  onDeletedWorkflow: (callback: OnDeletedWorkflowCallback) => ListenerHandle;
27
28
  };
28
- /**
29
- * A workflow
30
- * @category Workflows
31
- */
32
- export type Workflow = {
33
- id: string;
34
- name: string;
35
- description: string;
36
- kind: WorkflowKind;
37
- };
38
- /**
39
- * The kind of workflow.
40
- * @category Workflows
41
- */
42
- export type WorkflowKind = "Convert" | "Active" | "Passive";
43
- export type OnCreatedWorkflowCallback = (event: {
44
- workflow: Workflow;
45
- }) => void;
46
- export type OnUpdatedWorkflowCallback = (event: {
47
- workflow: Workflow;
48
- }) => void;
49
- export type OnDeletedWorkflowCallback = (event: {
50
- id: ID;
51
- }) => void;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A static asset.
3
+ * @category Files
4
+ */
5
+ export type Asset = {
6
+ asReadableStream: () => ReadableStream;
7
+ asArrayBuffer: () => Promise<ArrayBuffer>;
8
+ asString: () => Promise<string>;
9
+ asJson: <T = unknown>() => Promise<T>;
10
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Endpoints provided by the backend plugin.
3
+ * @category Backend
4
+ */
5
+ export type BackendEndpoints = {
6
+ [key: string]: (...args: any[]) => any;
7
+ };
8
+ /**
9
+ * Events emitted by the backend plugin.
10
+ * @category Backend
11
+ */
12
+ export type BackendEvents = {
13
+ [key: string]: (...args: any[]) => void;
14
+ };
@@ -1,33 +1,10 @@
1
- import type { CommandID, ID } from "./utils";
1
+ import { type ID } from "./utils";
2
2
  /**
3
- * Utilities to interact with commands
4
- * @category Commands
3
+ * A unique command identifier.
4
+ * @example "my-super-command"
5
5
  */
6
- export type CommandsSDK = {
7
- /**
8
- * Register a command.
9
- * @param id The id of the command.
10
- * @param options Options for the command.
11
- * @param options.name The name of the command.
12
- * @param options.run The function to run when the command is executed.
13
- * @param options.group The group this command belongs to.
14
- * @param options.when A function to determine if the command is available.
15
- *
16
- * @example
17
- * ```ts
18
- * sdk.commands.register("hello", {
19
- * name: "Print to console.",
20
- * run: () => console.log("Hello world!"),
21
- * group: "Custom Commands",
22
- * });
23
- * ```
24
- */
25
- register: (id: CommandID, options: {
26
- name: string;
27
- run: (context: CommandContext) => Promise<void> | void;
28
- group?: string;
29
- when?: (context: CommandContext) => Promise<boolean> | boolean;
30
- }) => void;
6
+ export type CommandID = string & {
7
+ __commandId?: never;
31
8
  };
32
9
  /**
33
10
  * Represents the context in which a command is executed.
@@ -0,0 +1,14 @@
1
+ export type EnvironmentVariable = {
2
+ /**
3
+ * The name of the environment variable.
4
+ */
5
+ name: string;
6
+ /**
7
+ * The value of the environment variable.
8
+ */
9
+ value: string;
10
+ /**
11
+ * Whether the environment variable is a secret.
12
+ */
13
+ isSecret: boolean;
14
+ };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * A hosted file.
3
+ * @category Files
4
+ */
5
+ export type HostedFile = {
6
+ /**
7
+ * The ID of the file.
8
+ */
9
+ id: string;
10
+ /**
11
+ * The name of the file.
12
+ */
13
+ name: string;
14
+ /**
15
+ * The size of the file in bytes.
16
+ */
17
+ size: number;
18
+ /**
19
+ * The path of the file.
20
+ */
21
+ path: string;
22
+ /**
23
+ * The date the file was created.
24
+ */
25
+ createdAt: Date;
26
+ /**
27
+ * The date the file was updated.
28
+ */
29
+ updatedAt: Date;
30
+ };
@@ -0,0 +1,24 @@
1
+ import { type HTTPQL, type ID } from "./utils";
2
+ /**
3
+ * Represents a filter.
4
+ * @category Filters
5
+ */
6
+ export type Filter = {
7
+ /**
8
+ * The ID of the filter.
9
+ */
10
+ id: ID;
11
+ /**
12
+ * The name of the filter.
13
+ */
14
+ name: string;
15
+ /**
16
+ * The alias of the filter.
17
+ * This alias is used when referencing the filter in an HTTPQL query (e.g. `preset:my-alias`).
18
+ */
19
+ alias: string;
20
+ /**
21
+ * The HTTPQL expression of the filter.
22
+ */
23
+ query: HTTPQL;
24
+ };
@@ -0,0 +1,31 @@
1
+ import { type ID } from "./utils";
2
+ /**
3
+ * Represents a {@link https://docs.caido.io/reference/features/logging/findings|Finding}.
4
+ * @category Findings
5
+ */
6
+ export type Finding = {
7
+ /**
8
+ * The ID of the finding.
9
+ */
10
+ id: ID;
11
+ /**
12
+ * The title of the finding.
13
+ */
14
+ title: string;
15
+ /**
16
+ * The description of the finding.
17
+ */
18
+ description?: string;
19
+ /**
20
+ * The reporter of the finding.
21
+ */
22
+ reporter: string;
23
+ /**
24
+ * The host of the request attached to this finding
25
+ */
26
+ host: string;
27
+ /**
28
+ * The path of the request attached to this finding
29
+ */
30
+ path: string;
31
+ };
@@ -0,0 +1,10 @@
1
+ import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
2
+ export declare const FooterSlot: {
3
+ readonly FooterSlotPrimary: "footer-primary";
4
+ readonly FooterSlotSecondary: "footer-secondary";
5
+ };
6
+ export type FooterSlot = (typeof FooterSlot)[keyof typeof FooterSlot];
7
+ export type FooterSlotContent = {
8
+ [FooterSlot.FooterSlotPrimary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
9
+ [FooterSlot.FooterSlotSecondary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
10
+ };
@@ -0,0 +1,9 @@
1
+ type JSONPrimitive = string | number | boolean | null | undefined;
2
+ export type JSONValue = JSONPrimitive | JSONValue[] | {
3
+ [key: string]: JSONValue;
4
+ };
5
+ type NotAssignableToJson = bigint | symbol | Function;
6
+ export type JSONCompatible<T> = unknown extends T ? never : {
7
+ [P in keyof T]: T[P] extends JSONValue ? T[P] : T[P] extends NotAssignableToJson ? never : JSONCompatible<T[P]>;
8
+ };
9
+ export {};
@@ -1,89 +1,4 @@
1
- import type { HTTPQL, ID } from "./utils";
2
- /**
3
- * Utilities to interact with the Match and Replace page.
4
- * @category Match and Replace
5
- */
6
- export type MatchReplaceSDK = {
7
- /**
8
- * Get all collections.
9
- */
10
- getCollections: () => MatchReplaceCollection[];
11
- /**
12
- * Create a collection.
13
- * @param options - The options for the collection.
14
- * @param options.name - The name of the collection.
15
- */
16
- createCollection: (options: {
17
- name: string;
18
- }) => Promise<MatchReplaceCollection>;
19
- /**
20
- * Update a collection.
21
- * @param id - The ID of the collection.
22
- * @param options - The new values for the collection.
23
- * @param options.name - The new name of the collection.
24
- */
25
- updateCollection: (id: ID, options: {
26
- name: string;
27
- }) => Promise<MatchReplaceCollection>;
28
- /**
29
- * Delete a collection.
30
- * @param id - The ID of the collection.
31
- */
32
- deleteCollection: (id: ID) => Promise<void>;
33
- /**
34
- * Get all rules.
35
- * @returns All rules.
36
- */
37
- getRules: () => MatchReplaceRule[];
38
- /**
39
- * Get all active rules.
40
- * Rules are ordered in priority from highest to lowest.
41
- * @returns All active rules.
42
- */
43
- getActiveRules: () => MatchReplaceRule[];
44
- /**
45
- * Select a rule to be displayed in the UI.
46
- * @param id - The ID of the rule, or undefined to clear the selection.
47
- */
48
- selectRule: (id: ID | undefined) => void;
49
- /**
50
- * Create a rule.
51
- * @param options - The options for the rule.
52
- * @param options.name - The name of the rule.
53
- * @param options.query - The HTTPQL query to match the rule against.
54
- * @param options.collectionId - The ID of the collection the rule belongs to.
55
- */
56
- createRule: (options: {
57
- name: string;
58
- query: HTTPQL;
59
- section: MatchReplaceSection;
60
- collectionId: ID;
61
- }) => Promise<MatchReplaceRule>;
62
- /**
63
- * Update a rule.
64
- * @param id - The ID of the rule.
65
- * @param options - The new values for the rule.
66
- * @param options.name - The new name of the rule.
67
- * @param options.query - The new HTTPQL query of the rule.
68
- * @param options.section - The new section of the rule.
69
- */
70
- updateRule: (id: ID, options: {
71
- name: string;
72
- query?: HTTPQL;
73
- section: MatchReplaceSection;
74
- }) => Promise<MatchReplaceRule>;
75
- /**
76
- * Toggle a rule.
77
- * @param id - The ID of the rule.
78
- * @param enabled - Whether the rule should be enabled.
79
- */
80
- toggleRule: (id: ID, enabled: boolean) => Promise<void>;
81
- /**
82
- * Delete a rule.
83
- * @param id - The ID of the rule.
84
- */
85
- deleteRule: (id: ID) => Promise<void>;
86
- };
1
+ import { type HTTPQL, type ID } from "./utils";
87
2
  /**
88
3
  * A rule in Match and Replace.
89
4
  * @category Match and Replace
@@ -1,24 +1,5 @@
1
- import type { CommandID, Icon } from "./utils";
2
- /**
3
- * Utilities to insert menu items and context-menus throughout the UI.
4
- * @category Menu
5
- */
6
- export type MenuSDK = {
7
- /**
8
- * Register a menu item.
9
- * @param item The menu item to register.
10
- *
11
- * @example
12
- * ```ts
13
- * sdk.menu.registerItem({
14
- * type: "Request",
15
- * commandId: "hello",
16
- * leadingIcon: "fas fa-hand",
17
- * });
18
- * ```
19
- */
20
- registerItem: (item: MenuItem) => void;
21
- };
1
+ import { type CommandID } from "./commands";
2
+ import { type Icon } from "./utils";
22
3
  /**
23
4
  * A content-menu item.
24
5
  * @category Menu
@@ -0,0 +1,53 @@
1
+ import { type ID } from "./utils";
2
+ export declare const ReplaySlot: {
3
+ readonly SessionToolbarPrimary: "session-toolbar-primary";
4
+ readonly SessionToolbarSecondary: "session-toolbar-secondary";
5
+ readonly Topbar: "topbar";
6
+ };
7
+ export type ReplaySlot = (typeof ReplaySlot)[keyof typeof ReplaySlot];
8
+ /**
9
+ * A replay tab.
10
+ * @category Replay
11
+ */
12
+ export type ReplayTab = {
13
+ /**
14
+ * The ID of the session associated with this tab.
15
+ */
16
+ sessionId: ID;
17
+ };
18
+ /**
19
+ * A session in Replay.
20
+ * @category Replay
21
+ */
22
+ export type ReplaySession = {
23
+ /**
24
+ * The ID of the session.
25
+ */
26
+ id: ID;
27
+ /**
28
+ * The name of the session.
29
+ */
30
+ name: string;
31
+ /**
32
+ * The ID of the collection the session belongs to.
33
+ */
34
+ collectionId: ID;
35
+ };
36
+ /**
37
+ * A collection in Replay.
38
+ * @category Replay
39
+ */
40
+ export type ReplayCollection = {
41
+ /**
42
+ * The ID of the collection.
43
+ */
44
+ id: ID;
45
+ /**
46
+ * The name of the collection.
47
+ */
48
+ name: string;
49
+ /**
50
+ * The sessions in the collection.
51
+ */
52
+ sessionIds: ID[];
53
+ };
@@ -0,0 +1,23 @@
1
+ import { type ID } from "./utils";
2
+ /**
3
+ * Represents a scope.
4
+ * @category Scopes
5
+ */
6
+ export type Scope = {
7
+ /**
8
+ * The unique ID of the scope.
9
+ */
10
+ id: ID;
11
+ /**
12
+ * The name of the scope.
13
+ */
14
+ name: string;
15
+ /**
16
+ * The list of included items.
17
+ */
18
+ allowlist: string[];
19
+ /**
20
+ * The list of excluded items.
21
+ */
22
+ denylist: string[];
23
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Represents a sidebar item.
3
+ * @category Sidebar
4
+ */
5
+ export type SidebarItem = {
6
+ /**
7
+ * Set the value of a notification badge next to the sidebar item.
8
+ * @param count - The number to display in the badge. A value of 0 will hide the badge.
9
+ */
10
+ setCount: (count: number) => void;
11
+ };
@@ -1,5 +1,5 @@
1
1
  import { type Component } from "vue";
2
- import { type CommandID } from "./utils";
2
+ import { type CommandID } from "./commands";
3
3
  type DefineSlotContent<TType extends string, P extends Record<string, unknown>> = {
4
4
  type: TType;
5
5
  } & P;
@@ -1,17 +1,9 @@
1
- type JSONPrimitive = string | number | boolean | null | undefined;
2
1
  /**
3
2
  * A unique Caido identifier per type.
4
3
  */
5
4
  export type ID = string & {
6
5
  __id?: never;
7
6
  };
8
- /**
9
- * A unique command identifier.
10
- * @example "my-super-command"
11
- */
12
- export type CommandID = string & {
13
- __commandId?: never;
14
- };
15
7
  /**
16
8
  * An HTTPQL expression.
17
9
  * @example `req.method.eq:"POST"`
@@ -26,13 +18,6 @@ export type HTTPQL = string & {
26
18
  export type Icon = string & {
27
19
  __icon?: never;
28
20
  };
29
- export type JSONValue = JSONPrimitive | JSONValue[] | {
30
- [key: string]: JSONValue;
31
- };
32
- type NotAssignableToJson = bigint | symbol | Function;
33
- export type JSONCompatible<T> = unknown extends T ? never : {
34
- [P in keyof T]: T[P] extends JSONValue ? T[P] : T[P] extends NotAssignableToJson ? never : JSONCompatible<T[P]>;
35
- };
36
21
  export type PromisifiedReturnType<T extends (...args: unknown[]) => unknown> = ReturnType<T> extends Promise<infer U> ? Promise<U> : Promise<ReturnType<T>>;
37
22
  /**
38
23
  * A handle for a listener.
@@ -43,4 +28,3 @@ export type ListenerHandle = {
43
28
  */
44
29
  stop: () => void;
45
30
  };
46
- export {};