mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
2cdd4761c8
* Add digest auth and response timeline * Some css fixes * Fixed Button * More auth methods, fixed URL regex, and fix gzip * Get rid of negotiate auth * Fix proxy * Fixed GA tracking * Some very small changes and fixes * Fix content type names * Even better auth switching and timeline syntax * Some auth tweaks * CSS tweaks * Reworked toasts * Fixed timer rounding quirk * Request settings and render errors * Fixed tests * Vertical dragging and stuff * Remove beta
45 lines
1023 B
JavaScript
45 lines
1023 B
JavaScript
import * as db from '../common/database';
|
|
import {DEFAULT_SIDEBAR_WIDTH, DEFAULT_PANE_WIDTH, DEFAULT_PANE_HEIGHT} from '../common/constants';
|
|
|
|
export const name = 'Workspace Meta';
|
|
export const type = 'WorkspaceMeta';
|
|
export const prefix = 'wrkm';
|
|
export const canDuplicate = true;
|
|
|
|
export function init () {
|
|
return {
|
|
parentId: null,
|
|
activeRequestId: null,
|
|
activeEnvironmentId: null,
|
|
sidebarFilter: '',
|
|
sidebarHidden: false,
|
|
sidebarWidth: DEFAULT_SIDEBAR_WIDTH,
|
|
paneWidth: DEFAULT_PANE_WIDTH,
|
|
paneHeight: DEFAULT_PANE_HEIGHT
|
|
};
|
|
}
|
|
|
|
export function migrate (doc) {
|
|
return doc;
|
|
}
|
|
|
|
export function create (patch = {}) {
|
|
if (!patch.parentId) {
|
|
throw new Error('New WorkspaceMeta missing `parentId`', patch);
|
|
}
|
|
|
|
return db.docCreate(type, patch);
|
|
}
|
|
|
|
export function update (workspaceMeta, patch) {
|
|
return db.docUpdate(workspaceMeta, patch);
|
|
}
|
|
|
|
export function getByParentId (parentId) {
|
|
return db.getWhere(type, {parentId});
|
|
}
|
|
|
|
export function all () {
|
|
return db.all(type);
|
|
}
|