@caido/sdk-frontend 0.50.3-beta.0 → 0.50.3-beta.1
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
package/src/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { FooterSlot, type FooterSlotContent } from "./types/footer";
|
|
|
2
2
|
export type { DialogOptions } from "./types/window";
|
|
3
3
|
export type { CommandContext } from "./types/commands";
|
|
4
4
|
export type { MenuItem } from "./types/menu";
|
|
5
|
-
export { type ReplayTab, type ReplaySession, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, } from "./types/replay";
|
|
5
|
+
export { type ReplayTab, type ReplaySession, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, } from "./types/replay";
|
|
6
6
|
export type { HostedFile } from "./types/files";
|
|
7
7
|
export type { Filter } from "./types/filter";
|
|
8
8
|
export type { HTTPQL, ID, ComponentDefinition } from "./types/utils";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Extension } from "@codemirror/state";
|
|
2
|
-
import { type OpenTabOptions, type ReplayCollection, type ReplaySession, type ReplaySlotContent, type ReplayTab, type SendRequestOptions } from "../types/replay";
|
|
2
|
+
import { type OpenTabOptions, type ReplayCollection, type ReplaySession, type ReplaySlotContent, type ReplayTab, type RequestSource, type SendRequestOptions } from "../types/replay";
|
|
3
3
|
import { type DefineAddToSlotFn } from "../types/slots";
|
|
4
4
|
import type { ID } from "../types/utils";
|
|
5
5
|
/**
|
|
@@ -47,6 +47,12 @@ export type ReplaySDK = {
|
|
|
47
47
|
* @param sessionIds The IDs of the sessions to delete.
|
|
48
48
|
*/
|
|
49
49
|
deleteSessions: (sessionIds: ID[]) => Promise<ID[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Create a session.
|
|
52
|
+
* @param sessionId The ID of the request to add.
|
|
53
|
+
* @param collectionId The ID of the collection to add the request.
|
|
54
|
+
*/
|
|
55
|
+
createSession: (source: RequestSource, collectionId?: ID) => Promise<void>;
|
|
50
56
|
/**
|
|
51
57
|
* Get the list of all replay collections.
|
|
52
58
|
* @returns The list of all replay collections.
|
|
@@ -132,3 +132,32 @@ export type SendRequestOptions = {
|
|
|
132
132
|
*/
|
|
133
133
|
background?: boolean;
|
|
134
134
|
};
|
|
135
|
+
/**
|
|
136
|
+
* @category Replay
|
|
137
|
+
*
|
|
138
|
+
* @remarks
|
|
139
|
+
* This type is a discriminated union with two possible shapes:
|
|
140
|
+
* - A raw request, containing the raw HTTP request string and connection information.
|
|
141
|
+
* - A reference to an existing request ID.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* // Using a raw request
|
|
145
|
+
* const source: RequestSource = {
|
|
146
|
+
* type: "Raw",
|
|
147
|
+
* raw: "GET /api/data HTTP/1.1",
|
|
148
|
+
* connectionInfo: { ... }
|
|
149
|
+
* };
|
|
150
|
+
* // Using an ID
|
|
151
|
+
* const source: RequestSource = {
|
|
152
|
+
* type: "ID",
|
|
153
|
+
* id: "request-123"
|
|
154
|
+
* };
|
|
155
|
+
*/
|
|
156
|
+
export type RequestSource = {
|
|
157
|
+
type: "Raw";
|
|
158
|
+
raw: string;
|
|
159
|
+
connectionInfo: SendRequestOptions["connectionInfo"];
|
|
160
|
+
} | {
|
|
161
|
+
type: "ID";
|
|
162
|
+
id: string;
|
|
163
|
+
};
|