Use workspace from plugin context instead of accepting it as parameter

- Removed workspaceId parameter from ctx.folder.list() and ctx.httpRequest.list()
- Updated event handlers to get workspace from plugin context
- Use proper generated TypeScript types in Context interface
This commit is contained in:
Gregory Schier
2025-12-28 14:14:09 -08:00
parent 6d5ba685f1
commit 07d743db21
8 changed files with 60 additions and 30 deletions

View File

@@ -642,22 +642,19 @@ export class PluginInstance {
);
return httpRequest;
},
list: async (args: { workspaceId?: string; folderId?: string }) => {
list: async (args?: { folderId?: string }) => {
const payload = {
type: 'list_http_requests_request',
// plugin events use camelCase field names in Rust -> snake_case mapping
folderId: args.folderId,
workspaceId: args.workspaceId,
folderId: args?.folderId,
} as any;
const { httpRequests } = await this.#sendForReply<any>(context, payload);
return httpRequests as any[];
},
},
folder: {
list: async (args: { workspaceId?: string }) => {
list: async () => {
const payload = {
type: 'list_folders_request',
workspaceId: args.workspaceId,
} as any;
const { folders } = await this.#sendForReply<any>(context, payload);
return folders as any[];