@smartbear/mcp
Version:
MCP server for interacting SmartBear Products
35 lines (34 loc) • 1.1 kB
JavaScript
export class SwaggerConfiguration {
token;
portalBasePath;
registryBasePath;
uiBasePath;
userManagementBasePath;
headers;
constructor(param) {
this.token = param.token;
this.portalBasePath =
param.portalBasePath || "https://api.portal.swaggerhub.com/v1";
this.registryBasePath =
param.registryBasePath || "https://api.swaggerhub.com"; // Default for registry API
this.uiBasePath = param.uiBasePath || "https://app.swaggerhub.com"; // Default for UI
this.userManagementBasePath =
param.userManagementBasePath ||
"https://api.swaggerhub.com/user-management/v1";
// Use Bearer token format consistently across all APIs
this.headers = {
Authorization: `Bearer ${this.token}`,
"Content-Type": "application/json",
...param.headers,
};
}
/**
* Get headers with User-Agent included
*/
getHeaders(userAgent) {
return {
...this.headers,
"User-Agent": userAgent,
};
}
}