Minor improvements to PagerDuty-Node

This commit is contained in:
Jan Oberhauser
2020-04-06 20:07:32 +02:00
parent 9ac740ab2a
commit 367b5aa29b
6 changed files with 9 additions and 11 deletions

View File

@@ -62,12 +62,11 @@ export async function pagerDutyApiRequestAllItems(this: IExecuteFunctions | ILoa
const returnData: IDataObject[] = []; const returnData: IDataObject[] = [];
let responseData; let responseData;
let uri;
query.limit = 100; query.limit = 100;
query.offset = 0; query.offset = 0;
do { do {
responseData = await pagerDutyApiRequest.call(this, method, endpoint, body, query, uri); responseData = await pagerDutyApiRequest.call(this, method, endpoint, body, query);
query.offset++; query.offset++;
returnData.push.apply(returnData, responseData[propertyName]); returnData.push.apply(returnData, responseData[propertyName]);
} while ( } while (
@@ -91,4 +90,3 @@ export function keysToSnakeCase(elements: IDataObject[] | IDataObject) : IDataOb
} }
return elements; return elements;
} }

View File

@@ -1,6 +1,6 @@
import { import {
INodeProperties, INodeProperties,
} from 'n8n-workflow'; } from 'n8n-workflow';
export const incidentOperations = [ export const incidentOperations = [
{ {

View File

@@ -1,6 +1,6 @@
import { import {
IDataObject, IDataObject,
} from "n8n-workflow"; } from 'n8n-workflow';
export interface IIncident { export interface IIncident {
assignments?: IDataObject[]; assignments?: IDataObject[];

View File

@@ -1,6 +1,6 @@
import { import {
INodeProperties, INodeProperties,
} from 'n8n-workflow'; } from 'n8n-workflow';
export const incidentNoteOperations = [ export const incidentNoteOperations = [
{ {

View File

@@ -5,16 +5,16 @@ import {
import { import {
IDataObject, IDataObject,
ILoadOptionsFunctions, ILoadOptionsFunctions,
INodeTypeDescription,
INodeExecutionData, INodeExecutionData,
INodeType,
INodePropertyOptions, INodePropertyOptions,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import { import {
keysToSnakeCase,
pagerDutyApiRequest, pagerDutyApiRequest,
pagerDutyApiRequestAllItems, pagerDutyApiRequestAllItems,
keysToSnakeCase,
} from './GenericFunctions'; } from './GenericFunctions';
import { import {
@@ -30,7 +30,7 @@ import {
import { import {
logEntryFields, logEntryFields,
logEntryOperations, logEntryOperations,
} from './logEntryDescription'; } from './LogEntryDescription';
import { import {
IIncident, IIncident,
@@ -345,7 +345,7 @@ export class PagerDuty implements INodeType {
responseData = await pagerDutyApiRequestAllItems.call(this, 'log_entries', 'GET', '/log_entries', {}, qs); responseData = await pagerDutyApiRequestAllItems.call(this, 'log_entries', 'GET', '/log_entries', {}, qs);
} else { } else {
qs.limit = this.getNodeParameter('limit', 0) as number; qs.limit = this.getNodeParameter('limit', 0) as number;
responseData = await pagerDutyApiRequest.call(this, 'GET', 'log_entries', {}, qs); responseData = await pagerDutyApiRequest.call(this, 'GET', '/log_entries', {}, qs);
responseData = responseData.log_entries; responseData = responseData.log_entries;
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 330 B