Skip to main content
Glama

YCloud WhatsApp API MCP Server

options.js2.28 kB
"use strict"; const { getJsonSchemaRefParserDefaultOptions } = require("@apidevtools/json-schema-ref-parser"); const schemaValidator = require("./validators/schema"); const specValidator = require("./validators/spec"); module.exports = ParserOptions; /** * Merges the properties of the source object into the target object. * * @param target - The object that we're populating * @param source - The options that are being merged * @returns */ function merge (target, source) { if (isMergeable(source)) { // prevent prototype pollution const keys = Object.keys(source).filter((key) => !["__proto__", "constructor", "prototype"].includes(key)); for (let i = 0; i < keys.length; i++) { const key = keys[i]; const sourceSetting = source[key]; const targetSetting = target[key]; if (isMergeable(sourceSetting)) { // It's a nested object, so merge it recursively target[key] = merge(targetSetting || {}, sourceSetting); } else if (sourceSetting !== undefined) { // It's a scalar value, function, or array. No merging necessary. Just overwrite the target value. target[key] = sourceSetting; } } } return target; } /** * Determines whether the given value can be merged, * or if it is a scalar value that should just override the target value. * * @param val * @returns */ function isMergeable (val) { return val && typeof val === "object" && !Array.isArray(val) && !(val instanceof RegExp) && !(val instanceof Date); } /** * Options that determine how Swagger APIs are parsed, resolved, dereferenced, and validated. * * @param {object|ParserOptions} [_options] - Overridden options * @class * @augments $RefParserOptions */ function ParserOptions (_options) { const defaultOptions = getJsonSchemaRefParserDefaultOptions(); const options = merge(defaultOptions, ParserOptions.defaults); return merge(options, _options); } ParserOptions.defaults = { /** * Determines how the API definition will be validated. * * You can add additional validators of your own, replace an existing one with * your own implemenation, or disable any validator by setting it to false. */ validate: { schema: schemaValidator, spec: specValidator, }, };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/YCloud-Developers/ycloud-whatsapp-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server