gRPC in import/export

This commit is contained in:
Gregory Schier committed 2024-02-23 16:16:13 -08:00
1 parent 16506d1ddd
commit fd5b495b70
10 files changed
+137 -132

No files matched your search

+14 -2
View File
@@ -10,9 +10,21 @@ export function pluginHookImport(contents) {
return undefined;
}
if (parsed.yaakSchema !== 1) return undefined;
if (!('yaakSchema' in parsed)) {
return;
}
return { resources: parsed.resources }; // Should already be in the correct format
// Migrate v1 to v2 -- changes requests to httpRequests
if (parsed.yaakSchema === 1) {
parsed.resources.httpRequests = parsed.resources.requests;
parsed.yaakSchema = 2;
}
if (parsed.yaakSchema === 2) {
return { resources: parsed.resources }; // Should already be in the correct format
}
return undefined;
}
export function isJSObject(obj) {