Extract base environment (#149)

This commit is contained in:
Gregory Schier
2024-12-21 05:44:55 -08:00
committed by GitHub
parent ecabe9b6ef
commit dd8ccfe21f
28 changed files with 425 additions and 387 deletions

View File

@@ -145878,13 +145878,20 @@ function pluginHookImport(_ctx, contents) {
model: "workspace",
id: generateId("workspace"),
name: info.name || "Postman Import",
description: info.description?.content ?? info.description ?? "",
description: info.description?.content ?? info.description ?? ""
};
exportResources.workspaces.push(workspace);
const environment = {
model: "environment",
id: generateId("environment"),
name: "Global Variables",
workspaceId: workspace.id,
variables: root.variable?.map((v) => ({
name: v.key,
value: v.value
})) ?? []
};
exportResources.workspaces.push(workspace);
exportResources.environments.push(environment);
const importItem = (v, folderId = null) => {
if (typeof v.name === "string" && Array.isArray(v.item)) {
const folder = {