@smartbear/mcp
Version:
MCP server for interacting SmartBear Products
87 lines (86 loc) • 2.37 kB
JavaScript
export function getMockOrganization(id, name, slug, extra = {}) {
return {
id,
name,
slug: slug ?? name.toLowerCase().replace(/\s+/g, "-"),
updatedAt: new Date(),
createdAt: new Date(),
autoUpgrade: false,
managedByPlatformServices: false,
...extra,
};
}
export function getMockProject(id, name, apiKey, extra = {}) {
return { id, name, apiKey, ...extra };
}
export function getMockEventField(displayId, extra = {}) {
return {
displayId: displayId,
custom: false,
filterOptions: { name: "filter" },
pivotOptions: {},
...extra,
};
}
export function getMockError(id, extra = {}) {
return { id, ...extra };
}
export function getMockEvent(id, extra = {}) {
return { id, ...extra };
}
export function getMockReleaseGroup(id, extra = {}) {
return {
id,
projectId: "proj-1",
releaseStageName: "production",
appVersion: "1.0.0",
firstReleasedAt: new Date().toISOString(),
firstReleaseId: "release-1",
releasesCount: 1,
hasSecondaryVersions: false,
totalSessionsCount: 0,
topReleaseGroup: false,
visible: true,
...extra,
};
}
export function getMockRelease(id, extra = {}) {
return { id, ...extra };
}
export function getMockSpanGroup(id, name, category, extra = {}) {
return {
id: `span-group-${id}`,
name: `span-name-${name}`,
displayName: name,
category: category,
...extra,
};
}
export function getMockSpan(traceId, id, name, category, isFirstClass = true, extra = {}) {
return {
traceId,
id: `span-${id}`,
name: `span-name-${name}`,
displayName: name,
category: category,
isFirstClass: isFirstClass,
duration: Math.round(Math.random() * 1000),
timestamp: new Date(Date.now()).toISOString(),
startTime: new Date(Date.now() - 1000).toISOString(),
timeAdjustmentType: "unadjusted",
...extra,
};
}
export function getMockTrace(name, type) {
return {
displayId: name,
fieldType: type,
filterOptions: {
name: name,
description: "Cached field",
searchable: true,
matchTypes: ["eq"],
},
custom: true,
};
}