@caido/sdk-frontend 0.54.2-beta.1 → 0.54.2-beta.2

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.54.2-beta.1",
3
+ "version": "0.54.2-beta.2",
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/",
@@ -2,7 +2,7 @@ export { FooterSlot, type FooterSlotContent } from "./types/footer";
2
2
  export type { DialogOptions } from "./types/window";
3
3
  export type { CommandContext, CommandContextRequest, CommandContextRequestRow, CommandContextResponse, CommandContextBase, } from "./types/commands";
4
4
  export type { MenuItem } from "./types/menu";
5
- export { type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, } from "./types/replay";
5
+ export { type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, type AddSessionIndicatorOptions, type SessionIndicator, } from "./types/replay";
6
6
  export { SearchSlot, type SearchSlotContent } from "./types/search";
7
7
  export type { HostedFile } from "./types/files";
8
8
  export { FilterSlot, type Filter, type FilterSlotContent, type CurrentFilterChangeEvent, } from "./types/filter";
@@ -1,5 +1,5 @@
1
1
  import { type Extension } from "@codemirror/state";
2
- import { 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 AddSessionIndicatorOptions, type CurrentReplaySessionChangeEvent, type OpenTabOptions, type ReplayCollection, type ReplayCollectionCreatedEvent, type ReplayEntry, type ReplaySession, type ReplaySessionCreatedEvent, type ReplaySlotContent, type ReplayTab, type RequestSource, type SendRequestOptions, type SessionIndicator } from "../types/replay";
3
3
  import type { RequestViewModeOptions } from "../types/request";
4
4
  import { type DefineAddToSlotFn } from "../types/slots";
5
5
  import type { ID, ListenerHandle } from "../types/utils";
@@ -224,4 +224,22 @@ export type ReplaySDK = {
224
224
  * ```
225
225
  */
226
226
  onCollectionCreate: (callback: (event: ReplayCollectionCreatedEvent) => void) => ListenerHandle;
227
+ /**
228
+ * Add an indicator to a replay session.
229
+ * Indicators are displayed next to the session name in the collections tree.
230
+ * @param sessionId The ID of the session to add the indicator to.
231
+ * @param indicator The indicator configuration.
232
+ * @returns A handle object with a `remove` method to remove the indicator.
233
+ * @example
234
+ *
235
+ * const indicator = sdk.replay.addSessionIndicator(sessionId, {
236
+ * icon: "fas fa-exclamation-triangle",
237
+ * description: "Security warning",
238
+ * });
239
+ *
240
+ * // Later, remove the indicator
241
+ * indicator.remove();
242
+ *
243
+ */
244
+ addSessionIndicator: (sessionId: ID, indicator: AddSessionIndicatorOptions) => SessionIndicator;
227
245
  };
@@ -218,3 +218,19 @@ export type ReplayCollectionCreatedEvent = {
218
218
  */
219
219
  collection: ReplayCollection;
220
220
  };
221
+ /**
222
+ * Visual indicator displayed next to a session label in the replay tree component.
223
+ * Includes an icon and an associated description.
224
+ * @category Replay
225
+ */
226
+ export type AddSessionIndicatorOptions = {
227
+ icon: string;
228
+ description: string;
229
+ };
230
+ /**
231
+ * Providing operations that can be performed on a session indicator.
232
+ * @category Replay
233
+ */
234
+ export type SessionIndicator = {
235
+ remove: () => void;
236
+ };