1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-09-20 09:27:44 +03:00

Add query parameter to operation issue:getAll (Sentry.io) (#1560)

This commit is contained in:
Ricardo Espinoza 2021-03-21 07:19:15 -04:00 committed by GitHub
parent 9cec2a73c7
commit 538d34510d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 8 deletions

View File

@ -1,6 +1,6 @@
import {
OptionsWithUri
} from 'request';
} from 'request';
import {
IExecuteFunctions,
@ -24,7 +24,7 @@ export async function sentryIoApiRequest(this: IHookFunctions | IExecuteFunction
method,
qs,
body,
uri: uri ||`https://sentry.io${resource}`,
uri: uri || `https://sentry.io${resource}`,
json: true,
};
if (!Object.keys(body).length) {
@ -73,7 +73,7 @@ export async function sentryIoApiRequest(this: IHookFunctions | IExecuteFunction
}
}
export async function sentryApiRequestAllItems(this: IHookFunctions | IExecuteFunctions| ILoadOptionsFunctions, method: string, resource: string, body: any = {}, query: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
export async function sentryApiRequestAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, query: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
const returnData: IDataObject[] = [];
@ -99,17 +99,17 @@ export async function sentryApiRequestAllItems(this: IHookFunctions | IExecuteFu
}
function getNext(link: string) {
if (link === undefined) {
if (link === undefined) {
return;
}
const next = link.split(',')[1];
if (next.includes('rel="next"')) {
return next.split(';')[0].replace('<', '').replace('>','').trim();
return next.split(';')[0].replace('<', '').replace('>', '').trim();
}
}
function hasMore(link: string) {
if (link === undefined) {
if (link === undefined) {
return;
}
const next = link.split(',')[1];

View File

@ -171,6 +171,13 @@ export const issueFields = [
},
},
options: [
{
displayName: 'Query',
name: 'query',
type: 'string',
default: '',
description: 'An optional Sentry structured search query. If not provided an implied "is:unresolved" is assumed. Info <a href="https://docs.sentry.io/product/sentry-basics/search/" target="_blank">here</a>.',
},
{
displayName: 'Stats Period',
name: 'statsPeriod',

View File

@ -56,14 +56,14 @@ export class SentryIo implements INodeType {
description: INodeTypeDescription = {
displayName: 'Sentry.io',
name: 'sentryIo',
icon: 'file:sentryio.png',
icon: 'file:sentryio.svg',
group: ['output'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Consume Sentry.io API',
defaults: {
name: 'Sentry.io',
color: '#000000',
color: '#362d59',
},
inputs: ['main'],
outputs: ['main'],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1 @@
<svg class="css-15xgryy e10nushx5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 44" width="400" height="352" style=""><path d="M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z" fill="#362d59"></path></svg>

After

Width:  |  Height:  |  Size: 679 B