"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ntfy = void 0;

var _axios = _interopRequireDefault(require("axios"));

var _createNotificationPlatform = require("../createNotificationPlatform");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const ntfy = (0, _createNotificationPlatform.createNotificationPlatform)({
  name: 'ntfy',
  credentialNames: ['topic', 'url', 'priority'],
  sendFunction: async args => {
    const {
      credentials,
      message,
      title
    } = args;
    await _axios.default.post(new URL(credentials.topic, credentials.url || 'https://ntfy.sh').href, message, {
      headers: {
        Title: title,
        Priority: credentials.priority
      }
    });
  }
});
exports.ntfy = ntfy;
//# sourceMappingURL=ntfy.js.map