Skip to content

Commit 81a6db3

Browse files
committed
Format code
1 parent 8c7327e commit 81a6db3

11 files changed

Lines changed: 316 additions & 279 deletions

File tree

caido.config.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ export default defineConfig({
2929
build: {
3030
rollupOptions: {
3131
external: [
32-
'@caido/frontend-sdk',
33-
"@codemirror/autocomplete",
34-
"@codemirror/commands",
35-
"@codemirror/language",
36-
"@codemirror/lint",
37-
"@codemirror/search",
38-
"@codemirror/state",
39-
"@codemirror/view",
40-
"@lezer/common",
41-
"@lezer/highlight",
42-
"@lezer/lr",
43-
"vue"
44-
]
32+
"@caido/frontend-sdk",
33+
"@codemirror/autocomplete",
34+
"@codemirror/commands",
35+
"@codemirror/language",
36+
"@codemirror/lint",
37+
"@codemirror/search",
38+
"@codemirror/state",
39+
"@codemirror/view",
40+
"@lezer/common",
41+
"@lezer/highlight",
42+
"@lezer/lr",
43+
"vue",
44+
],
4545
},
4646
},
4747
resolve: {

packages/frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"vue": "3.5.13"
1717
},
1818
"devDependencies": {
19-
"@caido/sdk-backend": "latest",
20-
"@caido/sdk-frontend": "latest",
19+
"@caido/sdk-backend": "0.53.1",
20+
"@caido/sdk-frontend": "0.53.1",
2121
"@codemirror/view": "6.28.1",
2222
"@openpgp/web-stream-tools": "0.1.3",
2323
"@types/crypto-js": "^4.2.2",

packages/frontend/src/api/dropService.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ export const DropAPI = {
4444
}
4545
},
4646

47-
sendMessage: async (
48-
message: DropSendMessage,
49-
): Promise<void> => {
47+
sendMessage: async (message: DropSendMessage): Promise<void> => {
5048
const apiServer = ConfigService.getApiServer();
5149
const response = await fetch(`${apiServer}/api/v1/send`, {
5250
method: "POST",

packages/frontend/src/components/DropToButton.vue

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<template>
22
<div v-if="connections.length > 0">
3-
<Select
4-
v-model="selectedConnection"
5-
:options="connections"
6-
:loading="isLoading"
7-
option-label="alias"
8-
placeholder="Drop to..."
9-
class="w-full"
10-
:filter="true"
11-
@change="handleConnectionSelect"
12-
>
13-
<template #option="slotProps">
14-
<div class="flex items-center gap-2">
15-
<span>{{ slotProps.option.alias || "Unnamed Connection" }}</span>
16-
</div>
17-
</template>
18-
</Select>
19-
</div>
3+
<Select
4+
v-model="selectedConnection"
5+
:options="connections"
6+
:loading="isLoading"
7+
option-label="alias"
8+
placeholder="Drop to..."
9+
class="w-full"
10+
:filter="true"
11+
@change="handleConnectionSelect"
12+
>
13+
<template #option="slotProps">
14+
<div class="flex items-center gap-2">
15+
<span>{{ slotProps.option.alias || "Unnamed Connection" }}</span>
16+
</div>
17+
</template>
18+
</Select>
19+
</div>
2020
</template>
2121

2222
<script setup lang="ts">
@@ -25,8 +25,8 @@ import { onMounted, ref } from "vue";
2525
2626
import { ConfigService } from "@/services/configService";
2727
import { type DropConnection, type DropPluginConfig } from "@/types";
28-
import { logger } from "@/utils/logger";
2928
import { callbacks } from "@/utils/dropTo";
29+
import { logger } from "@/utils/logger";
3030
3131
const isLoading = ref(false);
3232
const connections = ref<DropConnection[]>([]);

packages/frontend/src/dom/DOMInjectionManager.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,15 @@ export class DOMInjectionManager {
3131
handler: this.handleScopeActions.bind(this),
3232
},
3333
{
34-
selector:
35-
'div.c-card__header:has(span.fa-undo)',
34+
selector: "div.c-card__header:has(span.fa-undo)",
3635
locationCondition: "#/tamper",
3736
handler: this.handleTamperActions.bind(this),
38-
},
37+
},
3938
{
4039
selector: ".c-card__header",
4140
locationCondition: "(#/http-history|#/search)",
4241
handler: this.handleHttpHistoryActions.bind(this),
43-
}
42+
},
4443
];
4544
}
4645

@@ -64,8 +63,12 @@ export class DOMInjectionManager {
6463
}
6564

6665
private checkForInjectionPoints() {
67-
for (const { selector, handler, locationCondition } of this.injectionHandlers) {
68-
if (locationCondition && !window.location.hash.match(new RegExp(locationCondition))) {
66+
for (const { selector, handler, locationCondition } of this
67+
.injectionHandlers) {
68+
if (
69+
locationCondition &&
70+
!window.location.hash.match(new RegExp(locationCondition))
71+
) {
6972
continue;
7073
}
7174

@@ -76,10 +79,7 @@ export class DOMInjectionManager {
7679
}
7780
}
7881

79-
private generateButton(
80-
container: Element,
81-
customClasses?: string,
82-
) {
82+
private generateButton(container: Element, customClasses?: string) {
8383
// Create the button container
8484
const buttonContainer = document.createElement("div");
8585
buttonContainer.className =

packages/frontend/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import PrimeVue from "primevue/config";
33
import ToastService from "primevue/toastservice";
44
import { createApp } from "vue";
55

6+
import DropToButton from "./components/DropToButton.vue";
67
import { DOMInjectionManager } from "./dom/DOMInjectionManager";
78
import { SDKPlugin } from "./plugins/sdk";
89
import "./styles/customInjectionGlobal.css";
@@ -12,7 +13,6 @@ import App from "./views/App.vue";
1213

1314
import { ConfigService, initConfigService } from "@/services/configService";
1415
import { defaultStorage, type FrontendSDK } from "@/types";
15-
import DropToButton from "./components/DropToButton.vue";
1616

1717
export const init = async (sdk: FrontendSDK) => {
1818
initConfigService(sdk);
@@ -55,10 +55,10 @@ export const init = async (sdk: FrontendSDK) => {
5555

5656
sdk.replay.addToSlot("session-toolbar-secondary", {
5757
type: "Custom",
58-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
59-
definition:{
58+
59+
definition: {
6060
component: DropToButton as any,
61-
}
61+
},
6262
});
6363

6464
const domInjectionManager = new DOMInjectionManager(sdk);

packages/frontend/src/plugins/drop.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,10 @@ const handleClaimEvent = async (data: {
277277
}
278278
};
279279

280-
const handleDeleteEvent = async (data: { payload: DropPayload }, silent: boolean = false) => {
280+
const handleDeleteEvent = async (
281+
data: { payload: DropPayload },
282+
silent: boolean = false,
283+
) => {
281284
const { payload } = data;
282285
logger.log("Processing delete message", payload);
283286

@@ -289,7 +292,7 @@ const handleDeleteEvent = async (data: { payload: DropPayload }, silent: boolean
289292
);
290293
await ConfigService.updateConfig({ messages: updatedMessages });
291294
}
292-
if (!silent) {
295+
if (!silent) {
293296
sdk.window.showToast("Deleted message", {
294297
variant: "info",
295298
duration: 2000,

packages/frontend/src/utils/claimUtil.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export const claimReplay = async (
3131
throw new Error("Session ID is null");
3232
}
3333
// Check for Drops collection and create if doesn't exist
34-
const collections = await sdk.replay.getCollections();
35-
let dropsCollectionId = collections.find(c => c.name === "Drops")?.id;
36-
34+
const collections = sdk.replay.getCollections();
35+
let dropsCollectionId = collections.find((c) => c.name === "Drops")?.id;
36+
3737
if (!dropsCollectionId) {
3838
const newCollection = await sdk.replay.createCollection("Drops");
3939
dropsCollectionId = newCollection.id;

0 commit comments

Comments
 (0)