gRPC in import/export

This commit is contained in:
Gregory Schier
2024-02-23 16:16:13 -08:00
parent 16506d1ddd
commit fd5b495b70
10 changed files with 137 additions and 132 deletions

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) {