We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/devops-vesi/devops-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
validate-event-name.js•1.12 KiB
import { emitterEventNames } from "../generated/webhook-names.js";
function validateEventName(eventName, options = {}) {
if (typeof eventName !== "string") {
throw new TypeError("eventName must be of type string");
}
if (eventName === "*") {
throw new TypeError(
`Using the "*" event with the regular Webhooks.on() function is not supported. Please use the Webhooks.onAny() method instead`
);
}
if (eventName === "error") {
throw new TypeError(
`Using the "error" event with the regular Webhooks.on() function is not supported. Please use the Webhooks.onError() method instead`
);
}
if (options.onUnknownEventName === "ignore") {
return;
}
if (!emitterEventNames.includes(eventName)) {
if (options.onUnknownEventName !== "warn") {
throw new TypeError(
`"${eventName}" is not a known webhook name (https://developer.github.com/v3/activity/events/types/)`
);
} else {
(options.log || console).warn(
`"${eventName}" is not a known webhook name (https://developer.github.com/v3/activity/events/types/)`
);
}
}
}
export {
validateEventName
};