mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡ Minor improvements on Signl4 Node
This commit is contained in:
@@ -8,8 +8,8 @@ import {
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
OptionsWithUri,
|
OptionsWithUri,
|
||||||
} from 'request';
|
} from 'request';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make an API request to SIGNL4
|
* Make an API request to SIGNL4
|
||||||
*
|
*
|
||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
* @param {string} teamSecret
|
* @param {string} teamSecret
|
||||||
* @param {object} options
|
* @param {object} options
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export async function SIGNL4ApiRequest(this: IExecuteFunctions, method: string, body: string, query: IDataObject = {}, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
export async function SIGNL4ApiRequest(this: IExecuteFunctions, method: string, body: string, query: IDataObject = {}, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||||
@@ -48,8 +48,6 @@ export async function SIGNL4ApiRequest(this: IExecuteFunctions, method: string,
|
|||||||
}
|
}
|
||||||
options = Object.assign({}, options, option);
|
options = Object.assign({}, options, option);
|
||||||
|
|
||||||
console.log(options);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return await this.helpers.request!(options);
|
return await this.helpers.request!(options);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -264,8 +264,8 @@ export class Signl4 implements INodeType {
|
|||||||
// Send alert
|
// Send alert
|
||||||
if (operation === 'send') {
|
if (operation === 'send') {
|
||||||
const message = this.getNodeParameter('message', i) as string;
|
const message = this.getNodeParameter('message', i) as string;
|
||||||
const additionalFields = this.getNodeParameter('additionalFields',i) as IDataObject;
|
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||||
|
|
||||||
const data: IDataObject = {
|
const data: IDataObject = {
|
||||||
message,
|
message,
|
||||||
};
|
};
|
||||||
@@ -331,7 +331,7 @@ export class Signl4 implements INodeType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
responseData = await SIGNL4ApiRequest.call(
|
responseData = await SIGNL4ApiRequest.call(
|
||||||
this,
|
this,
|
||||||
'POST',
|
'POST',
|
||||||
@@ -350,7 +350,7 @@ export class Signl4 implements INodeType {
|
|||||||
data['X-S4-ExternalID'] = this.getNodeParameter('externalId', i) as string;
|
data['X-S4-ExternalID'] = this.getNodeParameter('externalId', i) as string;
|
||||||
|
|
||||||
data['X-S4-Status'] = 'resolved';
|
data['X-S4-Status'] = 'resolved';
|
||||||
|
|
||||||
data['X-S4-SourceSystem'] = 'n8n';
|
data['X-S4-SourceSystem'] = 'n8n';
|
||||||
|
|
||||||
responseData = await SIGNL4ApiRequest.call(
|
responseData = await SIGNL4ApiRequest.call(
|
||||||
|
|||||||
Reference in New Issue
Block a user