Initial "plugin" system with importer (#7)

This commit is contained in:
Gregory Schier
2023-11-02 18:08:43 -07:00
committed by GitHub
parent 98a4834d4f
commit e0b0e3d781
27 changed files with 972 additions and 452 deletions

View File

@@ -0,0 +1,14 @@
/**
* Import an Insomnia workspace object.
* @param {Object} w - The workspace object to import.
*/
export function importWorkspace(w) {
console.log('IMPORTING Workpace', w._id, w.name, JSON.stringify(w, null, 2));
return {
id: w._id,
createdAt: new Date(w.created ?? Date.now()).toISOString().replace('Z', ''),
updatedAt: new Date(w.updated ?? Date.now()).toISOString().replace('Z', ''),
model: 'workspace',
name: w.name,
};
}