@caido/sdk-frontend 0.47.2-beta.1 → 0.47.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.
@@ -24,9 +24,9 @@ export type CommandsSDK = {
24
24
  */
25
25
  register: (id: CommandID, options: {
26
26
  name: string;
27
- run: (context: CommandContext) => void;
27
+ run: (context: CommandContext) => Promise<void> | void;
28
28
  group?: string;
29
- when?: (context: CommandContext) => boolean;
29
+ when?: (context: CommandContext) => Promise<boolean> | boolean;
30
30
  }) => void;
31
31
  };
32
32
  /**
@@ -1,3 +1,4 @@
1
+ import type { Extension } from "@codemirror/state";
1
2
  import type { HTTPQL, ID } from "./utils";
2
3
  /**
3
4
  * Utilities to interact with the HTTP History page.
@@ -24,4 +25,14 @@ export type HTTPHistorySDK = {
24
25
  * @param id The ID of the scope to set.
25
26
  */
26
27
  setScope: (id: ID | undefined) => Promise<void>;
28
+ /**
29
+ * Add an extension to the request editor.
30
+ * @param extension The extension to add.
31
+ */
32
+ addRequestEditorExtension: (extension: Extension) => void;
33
+ /**
34
+ * Add an extension to the response editor.
35
+ * @param extension The extension to add.
36
+ */
37
+ addResponseEditorExtension: (extension: Extension) => void;
27
38
  };
@@ -28,7 +28,7 @@ export type { MenuItem } from "./menu";
28
28
  export type { ReplayTab, ReplaySession, ReplayCollection } from "./replay";
29
29
  export type { HostedFile } from "./files";
30
30
  export type { Filter } from "./filters";
31
- export type { HTTPQL, ID } from "./utils";
31
+ export type { HTTPQL, ID, JSONValue, JSONCompatible } from "./utils";
32
32
  export type { MatchReplaceRule, MatchReplaceCollection, MatchReplaceSection, MatchReplaceSectionRequestBody, MatchReplaceSectionRequestFirstLine, MatchReplaceSectionRequestHeader, MatchReplaceSectionRequestMethod, MatchReplaceSectionRequestPath, MatchReplaceSectionRequestQuery, MatchReplaceSectionResponseBody, MatchReplaceSectionResponseFirstLine, MatchReplaceSectionResponseHeader, MatchReplaceSectionResponseStatusCode, MatchReplaceOperationStatusCode, MatchReplaceOperationStatusCodeUpdate, MatchReplaceOperationQuery, MatchReplaceOperationQueryRaw, MatchReplaceOperationQueryAdd, MatchReplaceOperationQueryRemove, MatchReplaceOperationQueryUpdate, MatchReplaceOperationPath, MatchReplaceOperationPathRaw, MatchReplaceOperationMethod, MatchReplaceOperationMethodUpdate, MatchReplaceOperationHeader, MatchReplaceOperationHeaderRaw, MatchReplaceOperationHeaderAdd, MatchReplaceOperationHeaderRemove, MatchReplaceOperationHeaderUpdate, MatchReplaceOperationBody, MatchReplaceOperationBodyRaw, MatchReplaceOperationFirstLine, MatchReplaceOperationFirstLineRaw, MatchReplaceReplacer, MatchReplaceReplacerTerm, MatchReplaceReplacerWorkflow, MatchReplaceMatcherName, MatchReplaceMatcherRaw, MatchReplaceMatcherRawFull, MatchReplaceMatcherRawRegex, MatchReplaceMatcherRawValue, } from "./matchReplace";
33
33
  export type { Scope } from "./scopes";
34
34
  export type { EnvironmentVariable } from "./environment";
@@ -65,11 +65,6 @@ export type ReplaySDK = {
65
65
  * @returns The list of all open replay tabs.
66
66
  */
67
67
  getTabs: () => ReplayTab[];
68
- /**
69
- * Get the list of all replay collections.
70
- * @returns The list of all replay collections.
71
- */
72
- getCollections: () => ReplayCollection[];
73
68
  /**
74
69
  * Get the list of all replay sessions.
75
70
  * @returns The list of all replay sessions.
@@ -82,4 +77,39 @@ export type ReplaySDK = {
82
77
  * @returns The updated session.
83
78
  */
84
79
  renameSession: (id: ID, name: string) => Promise<ReplaySession>;
80
+ /**
81
+ * Move a session to a different collection.
82
+ * @param sessionId The ID of the session to move.
83
+ * @param collectionId The ID of the collection to move the session to.
84
+ * @returns The updated session.
85
+ */
86
+ moveSession: (sessionId: ID, collectionId: ID) => Promise<ReplaySession>;
87
+ /**
88
+ * Delete a session.
89
+ * @param sessionIds The IDs of the sessions to delete.
90
+ */
91
+ deleteSessions: (sessionIds: ID[]) => Promise<ID[]>;
92
+ /**
93
+ * Get the list of all replay collections.
94
+ * @returns The list of all replay collections.
95
+ */
96
+ getCollections: () => ReplayCollection[];
97
+ /**
98
+ * Create a new collection.
99
+ * @param name The name of the collection to create.
100
+ */
101
+ createCollection: (name: string) => Promise<ReplayCollection>;
102
+ /**
103
+ * Rename a collection.
104
+ * @param id The ID of the collection to rename.
105
+ * @param name The new name of the collection.
106
+ * @returns The updated collection.
107
+ */
108
+ renameCollection: (id: ID, name: string) => Promise<ReplayCollection>;
109
+ /**
110
+ * Delete a collection.
111
+ * @param id The ID of the collection to delete.
112
+ * @returns Whether the collection was deleted.
113
+ */
114
+ deleteCollection: (id: ID) => Promise<boolean>;
85
115
  };