n8n-nodes-base
Version:
Base nodes of n8n
29 lines • 881 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.lineApiRequest = lineApiRequest;
const n8n_workflow_1 = require("n8n-workflow");
async function lineApiRequest(method, _resource, body = {}, qs = {}, uri, option = {}) {
let options = {
headers: {
'Content-Type': 'application/json',
},
method,
body,
qs,
uri: uri || '',
json: true,
};
options = Object.assign({}, options, option);
try {
if (Object.keys(body).length === 0) {
delete options.body;
}
return await this.helpers.requestOAuth2.call(this, 'lineNotifyOAuth2Api', options, {
tokenType: 'Bearer',
});
}
catch (error) {
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
}
}
//# sourceMappingURL=GenericFunctions.js.map