@caido/sdk-frontend 0.54.2-beta.3 → 0.54.2-beta.4

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.3",
3
+ "version": "0.54.2-beta.4",
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/",
@@ -12,6 +12,7 @@ export type { HTTPQL, ID, ComponentDefinition } from "./types/utils";
12
12
  export type { JSONValue, JSONCompatible } from "./types/json";
13
13
  export type { SlotContent, ButtonSlotContent, CustomSlotContent, CommandSlotContent, } from "./types/slots";
14
14
  export type { RequestViewModeOptions, RequestFull, RequestDraft, RequestMeta, } from "./types/request";
15
+ export type { ResponseViewModeOptions, ResponseFull } from "./types/response";
15
16
  export type { CurrentMatchReplaceRuleChangeEvent, MatchReplaceRule, MatchReplaceCollection, MatchReplaceSection, MatchReplaceSectionRequestAll, MatchReplaceSectionRequestBody, MatchReplaceSectionRequestFirstLine, MatchReplaceSectionRequestHeader, MatchReplaceSectionRequestMethod, MatchReplaceSectionRequestPath, MatchReplaceSectionRequestQuery, MatchReplaceSectionRequestSNI, MatchReplaceSectionResponseAll, MatchReplaceSectionResponseBody, MatchReplaceSectionResponseFirstLine, MatchReplaceSectionResponseHeader, MatchReplaceSectionResponseStatusCode, MatchReplaceOperationStatusCode, MatchReplaceOperationStatusCodeUpdate, MatchReplaceOperationQuery, MatchReplaceOperationQueryRaw, MatchReplaceOperationQueryAdd, MatchReplaceOperationQueryRemove, MatchReplaceOperationQueryUpdate, MatchReplaceOperationPath, MatchReplaceOperationPathRaw, MatchReplaceOperationAll, MatchReplaceOperationAllRaw, MatchReplaceOperationMethod, MatchReplaceOperationMethodUpdate, MatchReplaceOperationHeader, MatchReplaceOperationHeaderRaw, MatchReplaceOperationHeaderAdd, MatchReplaceOperationHeaderRemove, MatchReplaceOperationHeaderUpdate, MatchReplaceOperationBody, MatchReplaceOperationBodyRaw, MatchReplaceOperationFirstLine, MatchReplaceOperationFirstLineRaw, MatchReplaceOperationSNI, MatchReplaceOperationSNIRaw, MatchReplaceReplacer, MatchReplaceReplacerTerm, MatchReplaceReplacerWorkflow, MatchReplaceMatcherName, MatchReplaceMatcherRaw, MatchReplaceMatcherRawFull, MatchReplaceMatcherRawRegex, MatchReplaceMatcherRawValue, } from "./types/matchReplace";
16
17
  export { MatchReplaceSlot, type MatchReplaceSlotContent, } from "./types/matchReplace";
17
18
  export { ScopeSlot, type CurrentScopeChangeEvent, type Scope, type ScopeSlotContent, } from "./types/scopes";
@@ -2,6 +2,7 @@ import type { Extension } from "@codemirror/state";
2
2
  import type { AutomateEntry, AutomateSession } from "src/types/automate";
3
3
  import type { AddIndicatorOptions, ID, Indicator } from "src/types/utils";
4
4
  import type { RequestViewModeOptions } from "../types/request";
5
+ import type { ResponseViewModeOptions } from "../types/response";
5
6
  /**
6
7
  * Utilities to interact with the Automate page.
7
8
  * @category Automate
@@ -17,6 +18,11 @@ export type AutomateSDK = {
17
18
  * @param options The view mode options.
18
19
  */
19
20
  addRequestViewMode: (options: RequestViewModeOptions) => void;
21
+ /**
22
+ * Add a custom response view mode.
23
+ * @param options The view mode options.
24
+ */
25
+ addResponseViewMode: (options: ResponseViewModeOptions) => void;
20
26
  /**
21
27
  * Get the list of all automate sessions.
22
28
  * @returns The list of all automate sessions.
@@ -1,6 +1,7 @@
1
1
  import type { Extension } from "@codemirror/state";
2
2
  import { type Finding } from "../types/findings";
3
3
  import type { RequestViewModeOptions } from "../types/request";
4
+ import type { ResponseViewModeOptions } from "../types/response";
4
5
  import type { ID } from "../types/utils";
5
6
  /**
6
7
  * Utilities to interact with findings
@@ -33,4 +34,9 @@ export type FindingsSDK = {
33
34
  * @param options The view mode options.
34
35
  */
35
36
  addRequestViewMode: (options: RequestViewModeOptions) => void;
37
+ /**
38
+ * Add a custom response view mode.
39
+ * @param options The view mode options.
40
+ */
41
+ addResponseViewMode: (options: ResponseViewModeOptions) => void;
36
42
  };
@@ -1,6 +1,7 @@
1
1
  import type { Extension } from "@codemirror/state";
2
2
  import type { HTTPHistorySlotContent } from "../types/httpHistory";
3
3
  import type { RequestViewModeOptions } from "../types/request";
4
+ import type { ResponseViewModeOptions } from "../types/response";
4
5
  import { type DefineAddToSlotFn } from "../types/slots";
5
6
  import type { HTTPQL, ID } from "../types/utils";
6
7
  /**
@@ -43,6 +44,11 @@ export type HTTPHistorySDK = {
43
44
  * @param options The view mode options.
44
45
  */
45
46
  addRequestViewMode: (options: RequestViewModeOptions) => void;
47
+ /**
48
+ * Add a custom response view mode.
49
+ * @param options The view mode options.
50
+ */
51
+ addResponseViewMode: (options: ResponseViewModeOptions) => void;
46
52
  /**
47
53
  * Scrolls the HTTP History table to a specific entry.
48
54
  * @param id The ID of the entry to scroll to.
@@ -1,5 +1,6 @@
1
1
  import type { Extension } from "@codemirror/state";
2
2
  import type { RequestViewModeOptions } from "../types/request";
3
+ import type { ResponseViewModeOptions } from "../types/response";
3
4
  import type { SearchSlot, SearchSlotContent } from "../types/search";
4
5
  import type { HTTPQL, ID } from "../types/utils";
5
6
  /**
@@ -37,6 +38,11 @@ export type SearchSDK = {
37
38
  * @param options The view mode options.
38
39
  */
39
40
  addRequestViewMode: (options: RequestViewModeOptions) => void;
41
+ /**
42
+ * Add a custom response view mode.
43
+ * @param options The view mode options.
44
+ */
45
+ addResponseViewMode: (options: ResponseViewModeOptions) => void;
40
46
  /**
41
47
  * Scrolls the Search table to a specific request.
42
48
  * @param id The ID of the request to scroll to.
@@ -1,5 +1,6 @@
1
1
  import type { Extension } from "@codemirror/state";
2
2
  import type { RequestViewModeOptions } from "../types/request";
3
+ import type { ResponseViewModeOptions } from "../types/response";
3
4
  import type { SitemapEntry, SitemapEntryChildStateUpdateEvent, SitemapRootEntry } from "../types/sitemap";
4
5
  import type { AddIndicatorOptions, ID, Indicator, ListenerHandle } from "../types/utils";
5
6
  /**
@@ -53,6 +54,11 @@ export type SitemapSDK = {
53
54
  * @param options The view mode options.
54
55
  */
55
56
  addRequestViewMode: (options: RequestViewModeOptions) => void;
57
+ /**
58
+ * Add a custom response view mode.
59
+ * @param options The view mode options.
60
+ */
61
+ addResponseViewMode: (options: ResponseViewModeOptions) => void;
56
62
  /**
57
63
  * Add an indicator to a sitemap session.
58
64
  * Indicators are displayed next to the entry name in the collections tree.
@@ -0,0 +1,27 @@
1
+ import type { As, ComponentDefinition, ID, Prettify } from "./utils";
2
+ /**
3
+ * A complete response with all metadata and raw content.
4
+ * @category Response
5
+ */
6
+ export type ResponseFull = Prettify<As<"ResponseFull"> & {
7
+ id: ID;
8
+ raw: string;
9
+ statusCode: number;
10
+ roundtripTime: number;
11
+ length: number;
12
+ createdAt: Date;
13
+ }>;
14
+ /**
15
+ * Options for defining a custom response view mode.
16
+ * @category Response
17
+ */
18
+ export type ResponseViewModeOptions = {
19
+ /**
20
+ * The label of the view mode.
21
+ */
22
+ label: string;
23
+ /**
24
+ * The component to render when the view mode is selected.
25
+ */
26
+ view: ComponentDefinition;
27
+ };