@sinch/mcp
Version:
Sinch MCP server
28 lines • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMailgunCredentials = void 0;
const types_1 = require("../../types");
const getMailgunCredentials = async (domain) => {
let credentials = undefined;
const mailgunDomain = domain || process.env.MAILGUN_DOMAIN;
const apiKey = process.env.MAILGUN_API_KEY;
if (mailgunDomain && apiKey) {
credentials = {
domain: mailgunDomain,
apiKey: apiKey
};
}
if (!mailgunDomain || !credentials) {
let errorMessage = '';
if (!mailgunDomain) {
errorMessage = 'The "domain" is not provided and "MAILGUN_DOMAIN" is not set in the environment variables.';
}
if (!mailgunDomain) {
errorMessage += '"MAILGUN_API_KEY" is not set in the environment variables. The property is required to use the emails related tools.';
}
return new types_1.PromptResponse(errorMessage);
}
return credentials;
};
exports.getMailgunCredentials = getMailgunCredentials;
//# sourceMappingURL=credentials.js.map