n8n-nodes-base
Version:
Base nodes of n8n
26 lines • 823 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.pushoverApiRequest = pushoverApiRequest;
const n8n_workflow_1 = require("n8n-workflow");
async function pushoverApiRequest(method, path, body = {}, qs = {}, _option = {}) {
const options = {
headers: {
'Content-Type': 'multipart/form-data',
},
method,
body,
qs,
url: `https://api.pushover.net/1${path}`,
json: true,
};
try {
if (Object.keys(body).length === 0) {
delete options.body;
}
return await this.helpers.requestWithAuthentication.call(this, 'pushoverApi', options);
}
catch (error) {
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
}
}
//# sourceMappingURL=GenericFunctions.js.map