Update plugins

This commit is contained in:
Gregory Schier
2025-01-13 08:53:14 -08:00
parent d37cfad862
commit 40a77be556
3 changed files with 65 additions and 29 deletions

View File

@@ -145878,7 +145878,7 @@ 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 = {
@@ -145931,7 +145931,7 @@ function pluginHookImport(_ctx, contents) {
workspaceId: workspace.id,
folderId,
name: v.name,
description: v.description,
description: v.description || void 0,
method: r.method || "GET",
url,
urlParameters,
@@ -145949,7 +145949,8 @@ function pluginHookImport(_ctx, contents) {
for (const item of root.item) {
importItem(item);
}
return { resources: convertTemplateSyntax(exportResources) };
const resources = deleteUndefinedAttrs(convertTemplateSyntax(exportResources));
return { resources };
}
function convertUrl(url) {
if (typeof url === "string") {
@@ -146131,6 +146132,17 @@ function convertTemplateSyntax(obj) {
return obj;
}
}
function deleteUndefinedAttrs(obj) {
if (Array.isArray(obj) && obj != null) {
return obj.map(deleteUndefinedAttrs);
} else if (typeof obj === "object" && obj != null) {
return Object.fromEntries(
Object.entries(obj).filter(([, v]) => v !== void 0).map(([k, v]) => [k, deleteUndefinedAttrs(v)])
);
} else {
return obj;
}
}
var idCount = {};
function generateId(model) {
idCount[model] = (idCount[model] ?? -1) + 1;