Skip to content

Commit 6dc747b

Browse files
author
h1123
committed
fix: migrate to SDK
1 parent 9200df1 commit 6dc747b

File tree

7 files changed

+31
-33
lines changed

7 files changed

+31
-33
lines changed

caido.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default defineConfig({
1212
id,
1313
name: "Ebka AI Assistant",
1414
description: "Integrates with Claude AI to provide AI-powered security testing capabilities",
15-
version: "0.1.1",
15+
version: "0.1.2",
1616
author: {
1717
name: "Slonser",
1818
email: "slonser@neplox.security",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Ebka AI Assistant",
3-
"version": "0.1.0",
3+
"version": "0.1.2",
44
"private": true,
55
"scripts": {
66
"typecheck": "pnpm -r typecheck",

packages/backend/src/tools_handlers/filters.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { SDK } from "caido:plugin";
22

3-
import { executeGraphQLQuery } from "../graphql";
3+
import { executeGraphQLQueryviaSDK } from "../graphql";
44
import {
55
CREATE_FILTER_PRESET_MUTATION,
66
DELETE_FILTER_PRESET_MUTATION,
@@ -13,7 +13,7 @@ export const list_filter_presets = async (sdk: SDK, input: any) => {
1313
// Use imported GraphQL query for listing filter presets
1414
const query = FILTER_PRESETS_QUERY;
1515

16-
const result = await executeGraphQLQuery(sdk, {
16+
const result = await executeGraphQLQueryviaSDK(sdk, {
1717
query,
1818
operationName: "filterPresets",
1919
});
@@ -76,7 +76,7 @@ export const create_filter_preset = async (sdk: SDK, input: any) => {
7676
},
7777
};
7878

79-
const result = await executeGraphQLQuery(sdk, {
79+
const result = await executeGraphQLQueryviaSDK(sdk, {
8080
query,
8181
variables,
8282
operationName: "createFilterPreset",
@@ -167,7 +167,7 @@ export const update_filter_preset = async (sdk: SDK, input: any) => {
167167
input: updateInput,
168168
};
169169

170-
const result = await executeGraphQLQuery(sdk, {
170+
const result = await executeGraphQLQueryviaSDK(sdk, {
171171
query,
172172
variables,
173173
operationName: "updateFilterPreset",
@@ -244,7 +244,7 @@ export const delete_filter_preset = async (sdk: SDK, input: any) => {
244244
id: filterId,
245245
};
246246

247-
const result = await executeGraphQLQuery(sdk, {
247+
const result = await executeGraphQLQueryviaSDK(sdk, {
248248
query,
249249
variables,
250250
operationName: "deleteFilterPreset",

packages/backend/src/tools_handlers/findings.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { SDK } from "caido:plugin";
22

3-
import { executeGraphQLQuery } from "../graphql";
3+
import { executeGraphQLQueryviaSDK } from "../graphql";
44
import {
55
DELETE_FINDINGS_MUTATION,
66
FINDINGS_BY_OFFSET_QUERY,
@@ -37,7 +37,7 @@ export const update_finding = async (sdk: SDK, input: any) => {
3737
input: updateData,
3838
};
3939

40-
const result = await executeGraphQLQuery(sdk, {
40+
const result = await executeGraphQLQueryviaSDK(sdk, {
4141
query,
4242
variables,
4343
operationName: "updateFinding",
@@ -118,7 +118,7 @@ export const delete_findings = async (sdk: SDK, input: any) => {
118118
},
119119
};
120120

121-
const result = await executeGraphQLQuery(sdk, {
121+
const result = await executeGraphQLQueryviaSDK(sdk, {
122122
query,
123123
variables,
124124
operationName: "deleteFindings",
@@ -183,7 +183,7 @@ export const list_findings = async (sdk: SDK, input: any) => {
183183
order: input.order || { by: "ID", ordering: "DESC" },
184184
};
185185

186-
const result = await executeGraphQLQuery(sdk, {
186+
const result = await executeGraphQLQueryviaSDK(sdk, {
187187
query,
188188
variables,
189189
operationName: "getFindingsByOffset",
@@ -253,7 +253,7 @@ export const get_finding_by_id = async (sdk: SDK, input: any) => {
253253
id: findingId,
254254
};
255255

256-
const result = await executeGraphQLQuery(sdk, {
256+
const result = await executeGraphQLQueryviaSDK(sdk, {
257257
query,
258258
variables,
259259
operationName: "getFindingById",

packages/backend/src/tools_handlers/replay.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { SDK } from "caido:plugin";
22

3-
import { executeGraphQLQuery } from "../graphql";
3+
import { executeGraphQLQueryviaSDK } from "../graphql";
44
import {
55
CREATE_REPLAY_SESSION_COLLECTION_MUTATION,
66
getDefaultReplayCollectionsQuery,
@@ -345,7 +345,7 @@ export const rename_replay_collection = async (sdk: SDK, input: any) => {
345345
name: newName,
346346
};
347347

348-
const result = await executeGraphQLQuery(sdk, {
348+
const result = await executeGraphQLQueryviaSDK(sdk, {
349349
query,
350350
variables,
351351
operationName: "renameReplaySessionCollection",
@@ -415,7 +415,7 @@ export const rename_replay_session = async (sdk: SDK, input: any) => {
415415
};
416416

417417
try {
418-
const result = await executeGraphQLQuery(sdk, {
418+
const result = await executeGraphQLQueryviaSDK(sdk, {
419419
query: mutation,
420420
variables: variables,
421421
operationName: "renameReplaySession",
@@ -477,7 +477,7 @@ export const graphql_collection_requests = async (sdk: SDK, input: any) => {
477477
sdk.console.log("Variables:", JSON.stringify(queryVariables, null, 2));
478478

479479
// Execute the GraphQL query using our helper function
480-
const result = await executeGraphQLQuery(sdk, {
480+
const result = await executeGraphQLQueryviaSDK(sdk, {
481481
query: queryToExecute,
482482
variables: queryVariables,
483483
operationName: "replaySessionCollections",
@@ -605,7 +605,7 @@ export const graphql_list_collections = async (sdk: SDK, input: any) => {
605605
sdk.console.log("Listing all replay collections using GraphQL API...");
606606

607607
// Execute the GraphQL query using our helper function
608-
const result = await executeGraphQLQuery(sdk, {
608+
const result = await executeGraphQLQueryviaSDK(sdk, {
609609
query: getDefaultReplayCollectionsQuery(),
610610
variables: {},
611611
operationName: "replaySessionCollections",
@@ -721,7 +721,7 @@ export const list_replay_connections = async (sdk: SDK, input: any) => {
721721
);
722722

723723
// Execute the GraphQL query using our helper function
724-
const result = await executeGraphQLQuery(sdk, {
724+
const result = await executeGraphQLQueryviaSDK(sdk, {
725725
query: getDefaultReplayCollectionsQuery(),
726726
variables: {},
727727
operationName: "replaySessionCollections",
@@ -859,7 +859,7 @@ export const create_replay_collection = async (sdk: SDK, input: any) => {
859859
};
860860

861861
try {
862-
const result = await executeGraphQLQuery(sdk, {
862+
const result = await executeGraphQLQueryviaSDK(sdk, {
863863
query: mutation,
864864
variables: variables,
865865
operationName: "createReplaySessionCollection",
@@ -886,9 +886,7 @@ export const create_replay_collection = async (sdk: SDK, input: any) => {
886886
};
887887
} else {
888888
return {
889-
error:
890-
result.error ||
891-
"Failed to create collection - no collection data returned",
889+
error: JSON.stringify(result),
892890
summary: "Collection creation failed",
893891
};
894892
}
@@ -938,7 +936,7 @@ export const move_replay_session = async (sdk: SDK, input: any) => {
938936
collectionId: collectionId,
939937
};
940938

941-
const result = await executeGraphQLQuery(sdk, {
939+
const result = await executeGraphQLQueryviaSDK(sdk, {
942940
query,
943941
variables,
944942
operationName: "moveReplaySession",
@@ -1035,7 +1033,7 @@ export const start_replay_task = async (sdk: SDK, input: any) => {
10351033
},
10361034
};
10371035

1038-
const result = await executeGraphQLQuery(sdk, {
1036+
const result = await executeGraphQLQueryviaSDK(sdk, {
10391037
query,
10401038
variables,
10411039
operationName: "startReplayTask",

packages/backend/src/tools_handlers/scopes.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { SDK } from "caido:plugin";
22

3-
import { executeGraphQLQuery } from "../graphql";
3+
import { executeGraphQLQueryviaSDK } from "../graphql";
44
import {
55
CREATE_SCOPE_MUTATION,
66
DELETE_SCOPE_MUTATION,
@@ -13,7 +13,7 @@ export const list_scopes = async (sdk: SDK, input: any) => {
1313
// Use imported GraphQL query for listing scopes
1414
const query = SCOPES_QUERY;
1515

16-
const result = await executeGraphQLQuery(sdk, {
16+
const result = await executeGraphQLQueryviaSDK(sdk, {
1717
query,
1818
operationName: "scopes",
1919
});
@@ -77,7 +77,7 @@ export const create_scope = async (sdk: SDK, input: any) => {
7777
},
7878
};
7979

80-
const result = await executeGraphQLQuery(sdk, {
80+
const result = await executeGraphQLQueryviaSDK(sdk, {
8181
query,
8282
variables,
8383
operationName: "createScope",
@@ -168,7 +168,7 @@ export const update_scope = async (sdk: SDK, input: any) => {
168168
input: updateInput,
169169
};
170170

171-
const result = await executeGraphQLQuery(sdk, {
171+
const result = await executeGraphQLQueryviaSDK(sdk, {
172172
query,
173173
variables,
174174
operationName: "updateScope",
@@ -245,7 +245,7 @@ export const delete_scope = async (sdk: SDK, input: any) => {
245245
id: scopeId,
246246
};
247247

248-
const result = await executeGraphQLQuery(sdk, {
248+
const result = await executeGraphQLQueryviaSDK(sdk, {
249249
query,
250250
variables,
251251
operationName: "deleteScope",

packages/backend/src/tools_handlers/websockets.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { SDK } from "caido:plugin";
22

3-
import { executeGraphQLQuery } from "../graphql";
3+
import { executeGraphQLQueryviaSDK } from "../graphql";
44
import {
55
WEBSOCKET_MESSAGE_COUNT_QUERY,
66
WEBSOCKET_MESSAGE_QUERY,
@@ -24,7 +24,7 @@ export const list_websocket_streams = async (sdk: SDK, input: any) => {
2424
order: order,
2525
};
2626

27-
const result = await executeGraphQLQuery(sdk, {
27+
const result = await executeGraphQLQueryviaSDK(sdk, {
2828
query,
2929
variables,
3030
operationName: "websocketStreamsByOffset",
@@ -88,7 +88,7 @@ export const get_websocket_message_count = async (sdk: SDK, input: any) => {
8888
streamId: streamId,
8989
};
9090

91-
const result = await executeGraphQLQuery(sdk, {
91+
const result = await executeGraphQLQueryviaSDK(sdk, {
9292
query,
9393
variables,
9494
operationName: "websocketMessageCount",
@@ -154,7 +154,7 @@ export const get_websocket_message = async (sdk: SDK, input: any) => {
154154
id: messageId,
155155
};
156156

157-
const result = await executeGraphQLQuery(sdk, {
157+
const result = await executeGraphQLQueryviaSDK(sdk, {
158158
query,
159159
variables,
160160
operationName: "websocketMessageEdit",

0 commit comments

Comments
 (0)