MCPcopy Index your code
hub / github.com/microsoft/data-formulator / loadWorkspace

Function loadWorkspace

src/app/workspaceService.ts:75–90  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

73
74/** Load a workspace's saved state. Returns null if not found. */
75export async function loadWorkspace(id: string): Promise<{ state: Record<string, any>; displayName: string } | null> {
76 const backend = await _getBackend();
77 if (backend === 'ephemeral') {
78 const entry = await workspaceDB.load(id);
79 if (!entry?.state) return null;
80 return { state: entry.state as Record<string, any>, displayName: entry.displayName };
81 }
82 const { data } = await apiRequest(getUrls().SESSION_LOAD, {
83 method: 'POST',
84 headers: { 'Content-Type': 'application/json' },
85 body: JSON.stringify({ id }),
86 });
87 if (!data.state) return null;
88 const savedWs = data.state.activeWorkspace;
89 return { state: data.state, displayName: savedWs?.displayName || id };
90}
91
92/** Delete a workspace. */
93export async function deleteWorkspace(id: string): Promise<void> {

Callers 3

DataSourceSidebarPanelFunction · 0.90
DataFormulatorFCFunction · 0.90
handleOpenFunction · 0.90

Calls 3

apiRequestFunction · 0.90
getUrlsFunction · 0.90
_getBackendFunction · 0.85

Tested by

no test coverage detected