MCPcopy Create free account
hub / github.com/Kong/insomnia / getWorkspaces

Function getWorkspaces

packages/insomnia/src/plugins/context/data.ts:15–23  ·  view source on GitHub ↗
(activeProjectId?: string)

Source from the content-addressed store, hash-verified

13type HarExport = Omit<InsomniaExport, 'format'>;
14
15const getWorkspaces = (activeProjectId?: string) => {
16 if (activeProjectId) {
17 return services.workspace.listByParentId(activeProjectId);
18 }
19 // This code path was kept in case there was ever a time when the app wouldn't have an active project.
20 // In over 5 months of monitoring in production, we never saw this happen.
21 // Keeping it for defensive purposes, but it's not clear if it's necessary.
22 return services.workspace.list();
23};
24
25// Only in the case of running unit tests from Inso can activeProjectId be undefined. This is because the concept of a project doesn't exist in git/insomnia sync or an export file
26export const init = (activeProjectId?: string) => ({

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected