@caido/sdk-frontend 0.48.2-beta.0 → 0.48.2-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 +3 -2
- package/src/types/commandPalette.d.ts +1 -0
- package/src/types/index.d.ts +2 -1
- package/src/types/replay.d.ts +13 -0
- package/src/types/slots.d.ts +22 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caido/sdk-frontend",
|
|
3
|
-
"version": "0.48.2-beta.
|
|
3
|
+
"version": "0.48.2-beta.1",
|
|
4
4
|
"description": "Typing for the Caido Frontend SDK",
|
|
5
5
|
"author": "Caido Labs Inc. <dev@caido.io>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
],
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@codemirror/view": "^6.0.0",
|
|
15
|
-
"@codemirror/state": "^6.0.0"
|
|
15
|
+
"@codemirror/state": "^6.0.0",
|
|
16
|
+
"vue": "^3.0.0"
|
|
16
17
|
},
|
|
17
18
|
"peerDependenciesMeta": {},
|
|
18
19
|
"scripts": {
|
package/src/types/index.d.ts
CHANGED
|
@@ -25,10 +25,11 @@ import type { WindowSDK } from "./window";
|
|
|
25
25
|
import type { WorkflowSDK } from "./workflows";
|
|
26
26
|
export type { CommandContext } from "./commands";
|
|
27
27
|
export type { MenuItem } from "./menu";
|
|
28
|
-
export type
|
|
28
|
+
export { type ReplayTab, type ReplaySession, type ReplayCollection, ReplaySlot, } from "./replay";
|
|
29
29
|
export type { HostedFile } from "./files";
|
|
30
30
|
export type { Filter } from "./filters";
|
|
31
31
|
export type { HTTPQL, ID, JSONValue, JSONCompatible } from "./utils";
|
|
32
|
+
export type { SlotContent, ButtonSlotContent, CustomSlotContent, CommandSlotContent, } from "./slots";
|
|
32
33
|
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
34
|
export type { Scope } from "./scopes";
|
|
34
35
|
export type { EnvironmentVariable } from "./environment";
|
package/src/types/replay.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type DefineAddToSlotFn } from "./slots";
|
|
1
2
|
import type { ID } from "./utils";
|
|
3
|
+
export declare const ReplaySlot: {
|
|
4
|
+
readonly SessionToolbar: "session-toolbar";
|
|
5
|
+
};
|
|
6
|
+
export type ReplaySlot = (typeof ReplaySlot)[keyof typeof ReplaySlot];
|
|
2
7
|
/**
|
|
3
8
|
* A replay tab.
|
|
4
9
|
* @category Replay
|
|
@@ -112,4 +117,12 @@ export type ReplaySDK = {
|
|
|
112
117
|
* @returns Whether the collection was deleted.
|
|
113
118
|
*/
|
|
114
119
|
deleteCollection: (id: ID) => Promise<boolean>;
|
|
120
|
+
/**
|
|
121
|
+
* Add a component to a slot.
|
|
122
|
+
* @param slot The slot to add the component to.
|
|
123
|
+
* @param content The content to add to the slot.
|
|
124
|
+
*/
|
|
125
|
+
addToSlot: DefineAddToSlotFn<{
|
|
126
|
+
[ReplaySlot.SessionToolbar]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
127
|
+
}>;
|
|
115
128
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Component } from "vue";
|
|
2
|
+
import { type CommandID } from "./utils";
|
|
3
|
+
type DefineSlotContent<TType extends string, P extends Record<string, unknown>> = {
|
|
4
|
+
type: TType;
|
|
5
|
+
} & P;
|
|
6
|
+
export type ButtonSlotContent = DefineSlotContent<"Button", {
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}>;
|
|
11
|
+
export type CustomSlotContent<TProps extends Record<string, unknown> = Record<string, unknown>> = DefineSlotContent<"Custom", {
|
|
12
|
+
component: Component<TProps>;
|
|
13
|
+
}>;
|
|
14
|
+
export type CommandSlotContent = DefineSlotContent<"Command", {
|
|
15
|
+
commandId: CommandID;
|
|
16
|
+
icon?: string;
|
|
17
|
+
}>;
|
|
18
|
+
export type SlotContent = ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
19
|
+
export type DefineAddToSlotFn<TMap extends Record<string, DefineSlotContent<string, Record<string, unknown>>>> = {
|
|
20
|
+
<K extends keyof TMap>(slot: K, spec: TMap[K]): void;
|
|
21
|
+
};
|
|
22
|
+
export {};
|