@caido/sdk-frontend 0.56.3-beta.2 → 0.57.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caido/sdk-frontend",
3
- "version": "0.56.3-beta.2",
3
+ "version": "0.57.1-beta.3",
4
4
  "description": "Typing for the Caido Frontend SDK",
5
5
  "author": "Caido Labs Inc. <dev@caido.io>",
6
6
  "repository": "https://github.com/caido/sdk-js/",
@@ -13,8 +13,8 @@
13
13
  ],
14
14
  "peerDependencies": {
15
15
  "@ai-sdk/provider": "^3.0.1",
16
- "@codemirror/view": "^6.0.0",
17
16
  "@codemirror/state": "^6.0.0",
17
+ "@codemirror/view": "^6.0.0",
18
18
  "vue": "^3.0.0"
19
19
  },
20
20
  "peerDependenciesMeta": {},
@@ -4,7 +4,7 @@ export type { _AnalyticsSDK } from "./private/analytics";
4
4
  export type { MessageViewModeOptions, StreamWsMessageMeta, MessageViewModePropsInternal, MessageViewModeProps, } from "./types/websocket";
5
5
  export type { CommandContext, CommandContextRequest, CommandContextRequestRow, CommandContextResponse, CommandContextBase, } from "./types/commands";
6
6
  export type { MenuItem } from "./types/menu";
7
- export { type AddSessionIndicatorOptions, type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, } from "./types/replay";
7
+ export { type AddCollectionIndicatorOptions, type AddSessionIndicatorOptions, type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, } from "./types/replay";
8
8
  export type { AutomateSession, AutomateEntry } from "./types/automate";
9
9
  export type { SitemapEntry, SitemapRootEntry, ChildState, } from "./types/sitemap";
10
10
  export { SearchSlot, type SearchSlotContent } from "./types/search";
@@ -1,5 +1,5 @@
1
- import { type ListenerHandle } from "src/types/utils";
2
1
  import { type HostedFile } from "../types/files";
2
+ import { type ListenerHandle } from "../types/utils";
3
3
  /**
4
4
  * SDK for interacting with the Files page.
5
5
  * @category Files
@@ -1,5 +1,5 @@
1
1
  import { type Extension } from "@codemirror/state";
2
- import { type AddSessionIndicatorOptions, type CurrentReplaySessionChangeEvent, type OpenTabOptions, type ReplayCollection, type ReplayCollectionCreatedEvent, type ReplayEntry, type ReplaySession, type ReplaySessionCreatedEvent, type ReplaySlotContent, type ReplayTab, type RequestSource, type SendRequestOptions } from "../types/replay";
2
+ import { type AddCollectionIndicatorOptions, type AddSessionIndicatorOptions, type CurrentReplaySessionChangeEvent, type OpenTabOptions, type ReplayCollection, type ReplayCollectionCreatedEvent, type ReplayEntry, type ReplaySession, type ReplaySessionCreatedEvent, type ReplaySlotContent, type ReplayTab, type RequestSource, type SendRequestOptions } from "../types/replay";
3
3
  import type { RequestViewModeOptions, RequestWritableViewModeProps } from "../types/request";
4
4
  import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
5
5
  import { type DefineAddToSlotFn } from "../types/slots";
@@ -44,6 +44,20 @@ export type ReplaySDK = {
44
44
  * ```
45
45
  */
46
46
  getCurrentSession: () => ReplaySession | undefined;
47
+ /**
48
+ * Get the entry currently displayed in the active replay session.
49
+ * @returns The active entry, or undefined if no entry is currently loaded.
50
+ * @example
51
+ * ```ts
52
+ * const currentEntry = sdk.replay.getCurrentEntry();
53
+ * if (currentEntry) {
54
+ * console.log(`Currently viewing entry ${currentEntry.id}`);
55
+ * } else {
56
+ * console.log("No entry is currently displayed");
57
+ * }
58
+ * ```
59
+ */
60
+ getCurrentEntry: () => ReplayEntry | undefined;
47
61
  /**
48
62
  * Rename a session.
49
63
  * @param id The ID of the session to rename.
@@ -243,4 +257,22 @@ export type ReplaySDK = {
243
257
  *
244
258
  */
245
259
  addSessionIndicator: (sessionId: ID, indicator: AddSessionIndicatorOptions) => Indicator;
260
+ /**
261
+ * Add an indicator to a replay collection.
262
+ * Indicators are displayed next to the collection name in the collections tree.
263
+ * @param collectionId The ID of the collection to add the indicator to.
264
+ * @param indicator The indicator configuration.
265
+ * @returns A handle object with a `remove` method to remove the indicator.
266
+ * @example
267
+ *
268
+ * const indicator = sdk.replay.addCollectionIndicator(collectionId, {
269
+ * icon: "fas fa-folder-open",
270
+ * description: "Has unresolved findings",
271
+ * });
272
+ *
273
+ * // Later, remove the indicator
274
+ * indicator.remove();
275
+ *
276
+ */
277
+ addCollectionIndicator: (collectionId: ID, indicator: AddCollectionIndicatorOptions) => Indicator;
246
278
  };
@@ -219,6 +219,11 @@ export type AddSessionIndicatorOptions = AddIndicatorOptions & {
219
219
  */
220
220
  showTabIcon?: boolean;
221
221
  };
222
+ /**
223
+ * Options for adding an indicator to a replay collection.
224
+ * @category Replay
225
+ */
226
+ export type AddCollectionIndicatorOptions = AddIndicatorOptions;
222
227
  /**
223
228
  * A unique replay session identifier.
224
229
  * @category Replay