first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,173 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const eventOperations: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['event'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Get event by ID',
|
||||
action: 'Get an event',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Get many events',
|
||||
action: 'Get many events',
|
||||
},
|
||||
],
|
||||
default: 'get',
|
||||
},
|
||||
];
|
||||
|
||||
export const eventFields: INodeProperties[] = [
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* event:getAll */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['event'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the events belong to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Project Slug Name or ID',
|
||||
name: 'projectSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getProjects',
|
||||
loadOptionsDependsOn: ['organizationSlug'],
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['event'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the project the events belong to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Full',
|
||||
name: 'full',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['event'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
description:
|
||||
'Whether the event payload will include the full event body, including the stack trace',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['event'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['event'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 500,
|
||||
},
|
||||
default: 100,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* event:get */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['event'],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the events belong to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Project Slug Name or ID',
|
||||
name: 'projectSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getProjects',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['event'],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the project the events belong to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Event ID',
|
||||
name: 'eventId',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['event'],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The ID of the event to retrieve (either the numeric primary-key or the hexadecimal ID as reported by the raven client)',
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,124 @@
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
IHttpRequestMethods,
|
||||
ILoadOptionsFunctions,
|
||||
IRequestOptions,
|
||||
IWebhookFunctions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function sentryIoApiRequest(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,
|
||||
method: IHttpRequestMethods,
|
||||
resource: string,
|
||||
|
||||
body: any = {},
|
||||
qs: IDataObject = {},
|
||||
uri?: string,
|
||||
option: IDataObject = {},
|
||||
): Promise<any> {
|
||||
const authentication = this.getNodeParameter('authentication', 0);
|
||||
|
||||
const options = {
|
||||
headers: {},
|
||||
method,
|
||||
qs,
|
||||
body,
|
||||
uri: uri || `https://sentry.io${resource}`,
|
||||
json: true,
|
||||
} satisfies IRequestOptions;
|
||||
if (!Object.keys(body as IDataObject).length) {
|
||||
delete options.body;
|
||||
}
|
||||
|
||||
if (Object.keys(option).length !== 0) {
|
||||
Object.assign(options, option);
|
||||
}
|
||||
|
||||
if (options.qs.limit) {
|
||||
delete options.qs.limit;
|
||||
}
|
||||
|
||||
let credentialName;
|
||||
|
||||
try {
|
||||
if (authentication === 'oAuth2') {
|
||||
return await this.helpers.requestOAuth2.call(this, 'sentryIoOAuth2Api', options);
|
||||
}
|
||||
|
||||
if (authentication === 'accessToken') {
|
||||
credentialName = 'sentryIoApi';
|
||||
} else {
|
||||
credentialName = 'sentryIoServerApi';
|
||||
}
|
||||
|
||||
const credentials = await this.getCredentials(credentialName);
|
||||
|
||||
if (credentials.url) {
|
||||
options.uri = `${credentials?.url}${resource}`;
|
||||
}
|
||||
|
||||
options.headers = {
|
||||
Authorization: `Bearer ${credentials?.token}`,
|
||||
};
|
||||
|
||||
return await this.helpers.request(options);
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
function getNext(link: string) {
|
||||
if (link === undefined) {
|
||||
return;
|
||||
}
|
||||
const next = link.split(',')[1];
|
||||
if (next.includes('rel="next"')) {
|
||||
return next.split(';')[0].replace('<', '').replace('>', '').trim();
|
||||
}
|
||||
}
|
||||
|
||||
function hasMore(link: string) {
|
||||
if (link === undefined) {
|
||||
return;
|
||||
}
|
||||
const next = link.split(',')[1];
|
||||
if (next.includes('rel="next"')) {
|
||||
return next.includes('results="true"');
|
||||
}
|
||||
}
|
||||
|
||||
export async function sentryApiRequestAllItems(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: IHttpRequestMethods,
|
||||
resource: string,
|
||||
|
||||
body: any = {},
|
||||
query: IDataObject = {},
|
||||
): Promise<any> {
|
||||
const returnData: IDataObject[] = [];
|
||||
|
||||
let responseData;
|
||||
|
||||
let link;
|
||||
|
||||
let uri: string | undefined;
|
||||
|
||||
do {
|
||||
responseData = await sentryIoApiRequest.call(this, method, resource, body, query, uri, {
|
||||
resolveWithFullResponse: true,
|
||||
});
|
||||
link = responseData.headers.link;
|
||||
uri = getNext(link as string);
|
||||
returnData.push.apply(returnData, responseData.body as IDataObject[]);
|
||||
const limit = query.limit as number | undefined;
|
||||
if (limit && limit >= returnData.length) {
|
||||
return;
|
||||
}
|
||||
} while (hasMore(link as string));
|
||||
|
||||
return returnData;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
export interface ICommit {
|
||||
id: string;
|
||||
repository?: string;
|
||||
message?: string;
|
||||
patch_set?: IPatchSet[];
|
||||
author_name?: string;
|
||||
author_email?: string;
|
||||
timestamp?: Date;
|
||||
}
|
||||
|
||||
export interface IPatchSet {
|
||||
path: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface IRef {
|
||||
commit: string;
|
||||
repository: string;
|
||||
previousCommit?: string;
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const issueOperations: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['issue'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete an issue',
|
||||
action: 'Delete an issue',
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Get issue by ID',
|
||||
action: 'Get an issue',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Get many issues',
|
||||
action: 'Get many issues',
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Update an issue',
|
||||
action: 'Update an issue',
|
||||
},
|
||||
],
|
||||
default: 'get',
|
||||
},
|
||||
];
|
||||
|
||||
export const issueFields: INodeProperties[] = [
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* issue:get/delete */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Issue ID',
|
||||
name: 'issueId',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: '1234',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['issue'],
|
||||
operation: ['get', 'delete'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description: 'ID of issue to get',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* issue:getAll */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['issue'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the issues belong to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Project Slug Name or ID',
|
||||
name: 'projectSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getProjects',
|
||||
loadOptionsDependsOn: ['organizationSlug'],
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['issue'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the project the issues belong to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['issue'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['issue'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 500,
|
||||
},
|
||||
default: 100,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['issue'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
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/">here</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Stats Period',
|
||||
name: 'statsPeriod',
|
||||
type: 'options',
|
||||
default: '',
|
||||
description: 'Time period of stats',
|
||||
options: [
|
||||
{
|
||||
name: '14 Days',
|
||||
value: '14d',
|
||||
},
|
||||
{
|
||||
name: '24 Hours',
|
||||
value: '24h',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Short ID Lookup',
|
||||
name: 'shortIdLookUp',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description:
|
||||
'Whether short IDs are looked up by this function as well. This can cause the return value of the function to return an event issue of a different project which is why this is an opt-in.',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* issue:update */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Issue ID',
|
||||
name: 'issueId',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: '1234',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['issue'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description: 'ID of issue to get',
|
||||
},
|
||||
{
|
||||
displayName: 'Update Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['issue'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Assigned To',
|
||||
name: 'assignedTo',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description:
|
||||
'The actor ID (or username) of the user or team that should be assigned to this issue',
|
||||
},
|
||||
{
|
||||
displayName: 'Has Seen',
|
||||
name: 'hasSeen',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description:
|
||||
'Whether this API call is invoked with a user context this allows changing of the flag that indicates if the user has seen the event',
|
||||
},
|
||||
{
|
||||
displayName: 'Is Bookmarked',
|
||||
name: 'isBookmarked',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description:
|
||||
'Whether this API call is invoked with a user context this allows changing of the bookmark flag',
|
||||
},
|
||||
{
|
||||
displayName: 'Is Public',
|
||||
name: 'isPublic',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: 'Whether to set the issue to public or private',
|
||||
},
|
||||
{
|
||||
displayName: 'Is Subscribed',
|
||||
name: 'isSubscribed',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
default: '',
|
||||
description: 'The new status for the issue',
|
||||
options: [
|
||||
{
|
||||
name: 'Ignored',
|
||||
value: 'ignored',
|
||||
},
|
||||
{
|
||||
name: 'Resolved',
|
||||
value: 'resolved',
|
||||
},
|
||||
{
|
||||
name: 'Resolved Next Release',
|
||||
value: 'resolvedInNextRelease',
|
||||
},
|
||||
{
|
||||
name: 'Unresolved',
|
||||
value: 'unresolved',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,236 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const organizationOperations: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['organization'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Create',
|
||||
value: 'create',
|
||||
description: 'Create an organization',
|
||||
action: 'Create an organization',
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Get organization by slug',
|
||||
action: 'Get an organization',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Get many organizations',
|
||||
action: 'Get many organizations',
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Update an organization',
|
||||
action: 'Update an organization',
|
||||
},
|
||||
],
|
||||
default: 'get',
|
||||
},
|
||||
];
|
||||
|
||||
export const organizationFields: INodeProperties[] = [
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* organization:getAll */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['organization'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['organization'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 500,
|
||||
},
|
||||
default: 100,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['organization'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Member',
|
||||
name: 'member',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: 'Whether to restrict results to organizations which you have membership',
|
||||
},
|
||||
{
|
||||
displayName: 'Owner',
|
||||
name: 'owner',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: 'Whether to restrict results to organizations which you are the owner',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* organization:get */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['organization'],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the team should be created for. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* organization:create */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['organization'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description: 'The slug of the organization the team should be created for',
|
||||
},
|
||||
{
|
||||
displayName: 'Agree to Terms',
|
||||
name: 'agreeTerms',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['organization'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description:
|
||||
'Whether you agree to the applicable terms of service and privacy policy of Sentry.io',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['organization'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Slug',
|
||||
name: 'slug',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description:
|
||||
'The unique URL slug for this organization. If this is not provided a slug is automatically generated based on the name.',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* organization:update */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Slug Name or ID',
|
||||
name: 'organization_slug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['organization'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization to update. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Update Fields',
|
||||
name: 'updateFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['organization'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The new name of the organization',
|
||||
},
|
||||
{
|
||||
displayName: 'Slug',
|
||||
name: 'slug',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The new URL slug for this organization',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,329 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const projectOperations: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['project'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Create',
|
||||
value: 'create',
|
||||
description: 'Create a new project',
|
||||
action: 'Create a project',
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete a project',
|
||||
action: 'Delete a project',
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Get project by ID',
|
||||
action: 'Get a project',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Get many projects',
|
||||
action: 'Get many projects',
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Update a project',
|
||||
action: 'Update a project',
|
||||
},
|
||||
],
|
||||
default: 'get',
|
||||
},
|
||||
];
|
||||
|
||||
export const projectFields: INodeProperties[] = [
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* project:create/get */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['project'],
|
||||
operation: ['create', 'get'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the events belong to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Project Slug Name or ID',
|
||||
name: 'projectSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getProjects',
|
||||
loadOptionsDependsOn: ['organizationSlug'],
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['project'],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the project to retrieve. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Team Slug Name or ID',
|
||||
name: 'teamSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getTeams',
|
||||
loadOptionsDependsOn: ['organizationSlug'],
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['project'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the team to create a new project for. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['project'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description: 'The name for the new project',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['project'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Slug',
|
||||
name: 'slug',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description:
|
||||
'Optionally a slug for the new project. If it’s not provided a slug is generated from the name.',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* project:getAll */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['project'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['project'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 500,
|
||||
},
|
||||
default: 100,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* project:update */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['project'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the project belong to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Project Slug Name or ID',
|
||||
name: 'projectSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getProjects',
|
||||
loadOptionsDependsOn: ['organizationSlug'],
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['project'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the project to update. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Update Fields',
|
||||
name: 'updateFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['project'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Bookmarked',
|
||||
name: 'isBookmarked',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
|
||||
description: 'The new platform for the updated project',
|
||||
},
|
||||
{
|
||||
displayName: 'Digests Maximum Delay',
|
||||
name: 'digestsMaxDelay',
|
||||
type: 'number',
|
||||
default: 1800,
|
||||
description: 'Maximum interval to digest alerts',
|
||||
},
|
||||
{
|
||||
displayName: 'Digests Minimun Delay',
|
||||
name: 'digestsMinDelay',
|
||||
type: 'number',
|
||||
default: 60,
|
||||
description: 'Minium interval to digest alerts',
|
||||
},
|
||||
{
|
||||
displayName: 'Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The new name for the updated project',
|
||||
},
|
||||
{
|
||||
displayName: 'Slug',
|
||||
name: 'slug',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The new slug for the updated project',
|
||||
},
|
||||
{
|
||||
displayName: 'Team',
|
||||
name: 'team',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The new team name',
|
||||
},
|
||||
{
|
||||
displayName: 'Platform',
|
||||
name: 'platform',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The new platform for the updated project',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* project:delete */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['project'],
|
||||
operation: ['delete'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the project belong to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Project Slug Name or ID',
|
||||
name: 'projectSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getProjects',
|
||||
loadOptionsDependsOn: ['organizationSlug'],
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['project'],
|
||||
operation: ['delete'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the project to delete. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,634 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const releaseOperations: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Create',
|
||||
value: 'create',
|
||||
description: 'Create a release',
|
||||
action: 'Create a release',
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete a release',
|
||||
action: 'Delete a release',
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Get release by version identifier',
|
||||
action: 'Get a release by version ID',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Get many releases',
|
||||
action: 'Get many releases',
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Update a release',
|
||||
action: 'Update a release',
|
||||
},
|
||||
],
|
||||
default: 'get',
|
||||
},
|
||||
];
|
||||
|
||||
export const releaseFields: INodeProperties[] = [
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* release:getAll */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the releases belong to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['release'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['release'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 500,
|
||||
},
|
||||
default: 100,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Query',
|
||||
name: 'query',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'This parameter can be used to create a “starts with” filter for the version',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* release:get/delete */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
operation: ['get', 'delete'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the release belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Version',
|
||||
name: 'version',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
operation: ['get', 'delete'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description: 'The version identifier of the release',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* release:create */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the release belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Version',
|
||||
name: 'version',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'A version identifier for this release. Can be a version number, a commit hash etc.',
|
||||
},
|
||||
{
|
||||
displayName: 'URL',
|
||||
name: 'url',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'A URL that points to the release. This can be the path to an online interface to the sourcecode for instance.',
|
||||
},
|
||||
{
|
||||
displayName: 'Project Names or IDs',
|
||||
name: 'projects',
|
||||
type: 'multiOptions',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getProjects',
|
||||
},
|
||||
default: [],
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'A list of project slugs that are involved in this release. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Date Released',
|
||||
name: 'dateReleased',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description:
|
||||
'An optional date that indicates when the release went live. If not provided the current time is assumed.',
|
||||
},
|
||||
{
|
||||
displayName: 'Commits',
|
||||
name: 'commits',
|
||||
description: 'An optional list of commit data to be associated with the release',
|
||||
type: 'fixedCollection',
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
name: 'commitProperties',
|
||||
displayName: 'Commit Properties',
|
||||
values: [
|
||||
{
|
||||
displayName: 'ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The sha of the commit',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Author Email',
|
||||
name: 'authorEmail',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Authors email',
|
||||
},
|
||||
{
|
||||
displayName: 'Author Name',
|
||||
name: 'authorName',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Name of author',
|
||||
},
|
||||
{
|
||||
displayName: 'Message',
|
||||
name: 'message',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Message of commit',
|
||||
},
|
||||
{
|
||||
displayName: 'Patch Set',
|
||||
name: 'patchSet',
|
||||
description:
|
||||
'A list of the files that have been changed in the commit. Specifying the patch_set is necessary to power suspect commits and suggested assignees.',
|
||||
type: 'fixedCollection',
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
name: 'patchSetProperties',
|
||||
displayName: 'Patch Set Properties',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Path',
|
||||
name: 'path',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description:
|
||||
'The path to the file. Both forward and backward slashes are supported.',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Type',
|
||||
name: 'type',
|
||||
type: 'options',
|
||||
default: '',
|
||||
description: 'The types of changes that happened in that commit',
|
||||
options: [
|
||||
{
|
||||
name: 'Add',
|
||||
value: 'add',
|
||||
},
|
||||
{
|
||||
name: 'Modify',
|
||||
value: 'modify',
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Repository',
|
||||
name: 'repository',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Repository name',
|
||||
},
|
||||
{
|
||||
displayName: 'Timestamp',
|
||||
name: 'timestamp',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description: 'Timestamp of commit',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Refs',
|
||||
name: 'refs',
|
||||
description:
|
||||
'An optional way to indicate the start and end commits for each repository included in a release',
|
||||
type: 'fixedCollection',
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
name: 'refProperties',
|
||||
displayName: 'Ref Properties',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Commit',
|
||||
name: 'commit',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The head sha of the commit',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Repository',
|
||||
name: 'repository',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Repository name',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Previous Commit',
|
||||
name: 'previousCommit',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The sha of the HEAD of the previous release',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* release:update */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the release belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Version',
|
||||
name: 'version',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'A version identifier for this release. Can be a version number, a commit hash etc.',
|
||||
},
|
||||
{
|
||||
displayName: 'Update Fields',
|
||||
name: 'updateFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['release'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Commits',
|
||||
name: 'commits',
|
||||
description: 'An optional list of commit data to be associated with the release',
|
||||
type: 'fixedCollection',
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
name: 'commitProperties',
|
||||
displayName: 'Commit Properties',
|
||||
values: [
|
||||
{
|
||||
displayName: 'ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The sha of the commit',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Author Email',
|
||||
name: 'authorEmail',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Authors email',
|
||||
},
|
||||
{
|
||||
displayName: 'Author Name',
|
||||
name: 'authorName',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Name of author',
|
||||
},
|
||||
{
|
||||
displayName: 'Message',
|
||||
name: 'message',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Message of commit',
|
||||
},
|
||||
{
|
||||
displayName: 'Patch Set',
|
||||
name: 'patchSet',
|
||||
description:
|
||||
'A list of the files that have been changed in the commit. Specifying the patch_set is necessary to power suspect commits and suggested assignees.',
|
||||
type: 'fixedCollection',
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
name: 'patchSetProperties',
|
||||
displayName: 'Patch Set Properties',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Path',
|
||||
name: 'path',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description:
|
||||
'The path to the file. Both forward and backward slashes are supported.',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Type',
|
||||
name: 'type',
|
||||
type: 'options',
|
||||
default: '',
|
||||
description: 'The types of changes that happened in that commit',
|
||||
options: [
|
||||
{
|
||||
name: 'Add',
|
||||
value: 'add',
|
||||
},
|
||||
{
|
||||
name: 'Modify',
|
||||
value: 'modify',
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Repository',
|
||||
name: 'repository',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Repository name',
|
||||
},
|
||||
{
|
||||
displayName: 'Timestamp',
|
||||
name: 'timestamp',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description: 'Timestamp of commit',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Date Released',
|
||||
name: 'dateReleased',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description:
|
||||
'An optional date that indicates when the release went live. If not provided the current time is assumed.',
|
||||
},
|
||||
{
|
||||
displayName: 'Ref',
|
||||
name: 'ref',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description:
|
||||
'A URL that points to the release. This can be the path to an online interface to the sourcecode for instance.',
|
||||
},
|
||||
{
|
||||
displayName: 'Refs',
|
||||
name: 'refs',
|
||||
description:
|
||||
'An optional way to indicate the start and end commits for each repository included in a release',
|
||||
type: 'fixedCollection',
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
name: 'refProperties',
|
||||
displayName: 'Ref Properties',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Commit',
|
||||
name: 'commit',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The head sha of the commit',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Repository',
|
||||
name: 'repository',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Repository name',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Previous Commit',
|
||||
name: 'previousCommit',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The sha of the HEAD of the previous release',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'URL',
|
||||
name: 'url',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description:
|
||||
'A URL that points to the release. This can be the path to an online interface to the sourcecode for instance.',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"node": "n8n-nodes-base.sentryIo",
|
||||
"nodeVersion": "1.0",
|
||||
"codexVersion": "1.0",
|
||||
"categories": ["Development"],
|
||||
"resources": {
|
||||
"credentialDocumentation": [
|
||||
{
|
||||
"url": "https://docs.n8n.io/integrations/builtin/credentials/sentryio/"
|
||||
}
|
||||
],
|
||||
"primaryDocumentation": [
|
||||
{
|
||||
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.sentryio/"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,706 @@
|
||||
import {
|
||||
type IExecuteFunctions,
|
||||
type IDataObject,
|
||||
type ILoadOptionsFunctions,
|
||||
type INodeExecutionData,
|
||||
type INodePropertyOptions,
|
||||
type INodeType,
|
||||
type INodeTypeDescription,
|
||||
NodeConnectionTypes,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { eventFields, eventOperations } from './EventDescription';
|
||||
import { sentryApiRequestAllItems, sentryIoApiRequest } from './GenericFunctions';
|
||||
import type { ICommit, IPatchSet, IRef } from './Interface';
|
||||
import { issueFields, issueOperations } from './IssueDescription';
|
||||
import { organizationFields, organizationOperations } from './OrganizationDescription';
|
||||
import { projectFields, projectOperations } from './ProjectDescription';
|
||||
import { releaseFields, releaseOperations } from './ReleaseDescription';
|
||||
import { teamFields, teamOperations } from './TeamDescription';
|
||||
|
||||
export class SentryIo implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Sentry.io',
|
||||
name: 'sentryIo',
|
||||
icon: { light: 'file:sentryio.svg', dark: 'file:sentryio.dark.svg' },
|
||||
group: ['output'],
|
||||
version: 1,
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||
description: 'Consume Sentry.io API',
|
||||
defaults: {
|
||||
name: 'Sentry.io',
|
||||
},
|
||||
usableAsTool: true,
|
||||
inputs: [NodeConnectionTypes.Main],
|
||||
outputs: [NodeConnectionTypes.Main],
|
||||
credentials: [
|
||||
{
|
||||
name: 'sentryIoOAuth2Api',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
authentication: ['oAuth2'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'sentryIoApi',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
authentication: ['accessToken'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'sentryIoServerApi',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
authentication: ['accessTokenServer'],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
properties: [
|
||||
{
|
||||
displayName: 'Authentication',
|
||||
name: 'authentication',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Access Token (Cloud)',
|
||||
value: 'accessToken',
|
||||
},
|
||||
{
|
||||
name: 'OAuth2 (Cloud)',
|
||||
value: 'oAuth2',
|
||||
},
|
||||
{
|
||||
name: 'Access Token (Self Hosted)',
|
||||
value: 'accessTokenServer',
|
||||
},
|
||||
],
|
||||
default: 'accessToken',
|
||||
},
|
||||
{
|
||||
displayName: 'Resource',
|
||||
name: 'resource',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
options: [
|
||||
{
|
||||
name: 'Event',
|
||||
value: 'event',
|
||||
},
|
||||
{
|
||||
name: 'Issue',
|
||||
value: 'issue',
|
||||
},
|
||||
{
|
||||
name: 'Organization',
|
||||
value: 'organization',
|
||||
},
|
||||
{
|
||||
name: 'Project',
|
||||
value: 'project',
|
||||
},
|
||||
{
|
||||
name: 'Release',
|
||||
value: 'release',
|
||||
},
|
||||
{
|
||||
name: 'Team',
|
||||
value: 'team',
|
||||
},
|
||||
],
|
||||
default: 'event',
|
||||
},
|
||||
|
||||
// EVENT
|
||||
...eventOperations,
|
||||
...eventFields,
|
||||
|
||||
// ISSUE
|
||||
...issueOperations,
|
||||
...issueFields,
|
||||
|
||||
// ORGANIZATION
|
||||
...organizationOperations,
|
||||
...organizationFields,
|
||||
|
||||
// PROJECT
|
||||
...projectOperations,
|
||||
...projectFields,
|
||||
|
||||
// RELEASE
|
||||
...releaseOperations,
|
||||
...releaseFields,
|
||||
|
||||
// TEAM
|
||||
...teamOperations,
|
||||
...teamFields,
|
||||
],
|
||||
};
|
||||
|
||||
methods = {
|
||||
loadOptions: {
|
||||
// Get all organizations so they can be displayed easily
|
||||
async getOrganizations(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const organizations = await sentryApiRequestAllItems.call(
|
||||
this,
|
||||
'GET',
|
||||
'/api/0/organizations/',
|
||||
{},
|
||||
);
|
||||
|
||||
for (const organization of organizations) {
|
||||
returnData.push({
|
||||
name: organization.slug,
|
||||
value: organization.slug,
|
||||
});
|
||||
}
|
||||
|
||||
returnData.sort((a, b) => {
|
||||
if (a.name < b.name) {
|
||||
return -1;
|
||||
}
|
||||
if (a.name > b.name) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
return returnData;
|
||||
},
|
||||
// Get all projects so can be displayed easily
|
||||
async getProjects(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const projects = await sentryApiRequestAllItems.call(this, 'GET', '/api/0/projects/', {});
|
||||
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug') as string;
|
||||
|
||||
for (const project of projects) {
|
||||
if (organizationSlug !== project.organization.slug) {
|
||||
continue;
|
||||
}
|
||||
|
||||
returnData.push({
|
||||
name: project.slug,
|
||||
value: project.slug,
|
||||
});
|
||||
}
|
||||
|
||||
returnData.sort((a, b) => {
|
||||
if (a.name < b.name) {
|
||||
return -1;
|
||||
}
|
||||
if (a.name > b.name) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
return returnData;
|
||||
},
|
||||
// Get an organization teams
|
||||
async getTeams(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug') as string;
|
||||
const teams = await sentryApiRequestAllItems.call(
|
||||
this,
|
||||
'GET',
|
||||
`/api/0/organizations/${organizationSlug}/teams/`,
|
||||
{},
|
||||
);
|
||||
|
||||
for (const team of teams) {
|
||||
returnData.push({
|
||||
name: team.slug,
|
||||
value: team.slug,
|
||||
});
|
||||
}
|
||||
|
||||
returnData.sort((a, b) => {
|
||||
if (a.name < b.name) {
|
||||
return -1;
|
||||
}
|
||||
if (a.name > b.name) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
return returnData;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const items = this.getInputData();
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
const length = items.length;
|
||||
let responseData;
|
||||
const qs: IDataObject = {};
|
||||
const resource = this.getNodeParameter('resource', 0);
|
||||
const operation = this.getNodeParameter('operation', 0);
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
try {
|
||||
if (resource === 'event') {
|
||||
if (operation === 'getAll') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const projectSlug = this.getNodeParameter('projectSlug', i) as string;
|
||||
const full = this.getNodeParameter('full', i) as boolean;
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
|
||||
const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/events/`;
|
||||
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
qs.limit = limit;
|
||||
}
|
||||
|
||||
qs.full = full;
|
||||
|
||||
responseData = await sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
|
||||
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
}
|
||||
if (operation === 'get') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const projectSlug = this.getNodeParameter('projectSlug', i) as string;
|
||||
const eventId = this.getNodeParameter('eventId', i) as string;
|
||||
|
||||
const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/events/${eventId}/`;
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'GET', endpoint, qs);
|
||||
}
|
||||
}
|
||||
if (resource === 'issue') {
|
||||
if (operation === 'getAll') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const projectSlug = this.getNodeParameter('projectSlug', i) as string;
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
|
||||
const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/issues/`;
|
||||
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
|
||||
if (additionalFields.statsPeriod) {
|
||||
qs.statsPeriod = additionalFields.statsPeriod as string;
|
||||
}
|
||||
if (additionalFields.shortIdLookup) {
|
||||
qs.shortIdLookup = additionalFields.shortIdLookup as boolean;
|
||||
}
|
||||
if (additionalFields.query) {
|
||||
qs.query = additionalFields.query as string;
|
||||
}
|
||||
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
qs.limit = limit;
|
||||
}
|
||||
|
||||
responseData = await sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
|
||||
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
}
|
||||
if (operation === 'get') {
|
||||
const issueId = this.getNodeParameter('issueId', i) as string;
|
||||
const endpoint = `/api/0/issues/${issueId}/`;
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'GET', endpoint, qs);
|
||||
}
|
||||
if (operation === 'delete') {
|
||||
const issueId = this.getNodeParameter('issueId', i) as string;
|
||||
const endpoint = `/api/0/issues/${issueId}/`;
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'DELETE', endpoint, qs);
|
||||
|
||||
responseData = { success: true };
|
||||
}
|
||||
if (operation === 'update') {
|
||||
const issueId = this.getNodeParameter('issueId', i) as string;
|
||||
const endpoint = `/api/0/issues/${issueId}/`;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
|
||||
if (additionalFields.status) {
|
||||
qs.status = additionalFields.status as string;
|
||||
}
|
||||
if (additionalFields.assignedTo) {
|
||||
qs.assignedTo = additionalFields.assignedTo as string;
|
||||
}
|
||||
if (additionalFields.hasSeen) {
|
||||
qs.hasSeen = additionalFields.hasSeen as boolean;
|
||||
}
|
||||
if (additionalFields.isBookmarked) {
|
||||
qs.isBookmarked = additionalFields.isBookmarked as boolean;
|
||||
}
|
||||
if (additionalFields.isSubscribed) {
|
||||
qs.isSubscribed = additionalFields.isSubscribed as boolean;
|
||||
}
|
||||
if (additionalFields.isPublic) {
|
||||
qs.isPublic = additionalFields.isPublic as boolean;
|
||||
}
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'PUT', endpoint, qs);
|
||||
}
|
||||
}
|
||||
if (resource === 'organization') {
|
||||
if (operation === 'get') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const endpoint = `/api/0/organizations/${organizationSlug}/`;
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'GET', endpoint, qs);
|
||||
}
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const endpoint = '/api/0/organizations/';
|
||||
|
||||
if (additionalFields.member) {
|
||||
qs.member = additionalFields.member as boolean;
|
||||
}
|
||||
if (additionalFields.owner) {
|
||||
qs.owner = additionalFields.owner as boolean;
|
||||
}
|
||||
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
qs.limit = limit;
|
||||
}
|
||||
|
||||
responseData = await sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
|
||||
|
||||
if (responseData === undefined) {
|
||||
responseData = [];
|
||||
}
|
||||
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
}
|
||||
if (operation === 'create') {
|
||||
const name = this.getNodeParameter('name', i) as string;
|
||||
const agreeTerms = this.getNodeParameter('agreeTerms', i) as boolean;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const endpoint = '/api/0/organizations/';
|
||||
|
||||
qs.name = name;
|
||||
qs.agreeTerms = agreeTerms;
|
||||
|
||||
if (additionalFields.slug) {
|
||||
qs.slug = additionalFields.slug as string;
|
||||
}
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'POST', endpoint, qs);
|
||||
}
|
||||
if (operation === 'update') {
|
||||
const organizationSlug = this.getNodeParameter('organization_slug', i) as string;
|
||||
const endpoint = `/api/0/organizations/${organizationSlug}/`;
|
||||
|
||||
const body = this.getNodeParameter('updateFields', i);
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'PUT', endpoint, body, qs);
|
||||
}
|
||||
}
|
||||
if (resource === 'project') {
|
||||
if (operation === 'create') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const teamSlug = this.getNodeParameter('teamSlug', i) as string;
|
||||
const name = this.getNodeParameter('name', i) as string;
|
||||
|
||||
const endpoint = `/api/0/teams/${organizationSlug}/${teamSlug}/projects/`;
|
||||
|
||||
const body = {
|
||||
name,
|
||||
...this.getNodeParameter('additionalFields', i),
|
||||
};
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'POST', endpoint, body, qs);
|
||||
}
|
||||
if (operation === 'get') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const projectSlug = this.getNodeParameter('projectSlug', i) as string;
|
||||
const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/`;
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'GET', endpoint, qs);
|
||||
}
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const endpoint = '/api/0/projects/';
|
||||
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
qs.limit = limit;
|
||||
}
|
||||
|
||||
responseData = await sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
|
||||
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
}
|
||||
if (operation === 'update') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const projectSlug = this.getNodeParameter('projectSlug', i) as string;
|
||||
const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/`;
|
||||
const body = this.getNodeParameter('updateFields', i);
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'PUT', endpoint, body, qs);
|
||||
}
|
||||
if (operation === 'delete') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const projectSlug = this.getNodeParameter('projectSlug', i) as string;
|
||||
const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/`;
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'DELETE', endpoint, qs);
|
||||
responseData = { success: true };
|
||||
}
|
||||
}
|
||||
if (resource === 'release') {
|
||||
if (operation === 'get') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const version = this.getNodeParameter('version', i) as string;
|
||||
const endpoint = `/api/0/organizations/${organizationSlug}/releases/${version}/`;
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'GET', endpoint, qs);
|
||||
}
|
||||
if (operation === 'getAll') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const endpoint = `/api/0/organizations/${organizationSlug}/releases/`;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
|
||||
if (additionalFields.query) {
|
||||
qs.query = additionalFields.query as string;
|
||||
}
|
||||
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
qs.limit = limit;
|
||||
}
|
||||
|
||||
responseData = await sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
|
||||
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
}
|
||||
if (operation === 'delete') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const version = this.getNodeParameter('version', i) as string;
|
||||
const endpoint = `/api/0/organizations/${organizationSlug}/releases/${version}/`;
|
||||
responseData = await sentryIoApiRequest.call(this, 'DELETE', endpoint, qs);
|
||||
responseData = { success: true };
|
||||
}
|
||||
if (operation === 'create') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const endpoint = `/api/0/organizations/${organizationSlug}/releases/`;
|
||||
const version = this.getNodeParameter('version', i) as string;
|
||||
const url = this.getNodeParameter('url', i) as string;
|
||||
const projects = this.getNodeParameter('projects', i) as string[];
|
||||
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
|
||||
if (additionalFields.dateReleased) {
|
||||
qs.dateReleased = additionalFields.dateReleased as string;
|
||||
}
|
||||
|
||||
qs.version = version;
|
||||
qs.url = url;
|
||||
qs.projects = projects;
|
||||
|
||||
if (additionalFields.commits) {
|
||||
const commits: ICommit[] = [];
|
||||
//@ts-ignore
|
||||
|
||||
additionalFields.commits.commitProperties.map((commit: any) => {
|
||||
const commitObject: ICommit = { id: commit.id };
|
||||
|
||||
if (commit.repository) {
|
||||
commitObject.repository = commit.repository;
|
||||
}
|
||||
if (commit.message) {
|
||||
commitObject.message = commit.message;
|
||||
}
|
||||
if (commit.patchSet && Array.isArray(commit.patchSet)) {
|
||||
commit.patchSet.patchSetProperties.map((patchSet: IPatchSet) => {
|
||||
commitObject.patch_set?.push(patchSet);
|
||||
});
|
||||
}
|
||||
if (commit.authorName) {
|
||||
commitObject.author_name = commit.authorName;
|
||||
}
|
||||
if (commit.authorEmail) {
|
||||
commitObject.author_email = commit.authorEmail;
|
||||
}
|
||||
if (commit.timestamp) {
|
||||
commitObject.timestamp = commit.timestamp;
|
||||
}
|
||||
|
||||
commits.push(commitObject);
|
||||
});
|
||||
|
||||
qs.commits = commits;
|
||||
}
|
||||
if (additionalFields.refs) {
|
||||
const refs: IRef[] = [];
|
||||
//@ts-ignore
|
||||
additionalFields.refs.refProperties.map((ref: IRef) => {
|
||||
refs.push(ref);
|
||||
});
|
||||
|
||||
qs.refs = refs;
|
||||
}
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'POST', endpoint, qs);
|
||||
}
|
||||
if (operation === 'update') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const version = this.getNodeParameter('version', i) as string;
|
||||
const endpoint = `/api/0/organizations/${organizationSlug}/releases/${version}/`;
|
||||
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
|
||||
const body = { ...updateFields };
|
||||
|
||||
if (updateFields.commits) {
|
||||
const commits: ICommit[] = [];
|
||||
//@ts-ignore
|
||||
|
||||
updateFields.commits.commitProperties.map((commit: any) => {
|
||||
const commitObject: ICommit = { id: commit.id };
|
||||
|
||||
if (commit.repository) {
|
||||
commitObject.repository = commit.repository;
|
||||
}
|
||||
if (commit.message) {
|
||||
commitObject.message = commit.message;
|
||||
}
|
||||
if (commit.patchSet && Array.isArray(commit.patchSet)) {
|
||||
commit.patchSet.patchSetProperties.map((patchSet: IPatchSet) => {
|
||||
commitObject.patch_set?.push(patchSet);
|
||||
});
|
||||
}
|
||||
if (commit.authorName) {
|
||||
commitObject.author_name = commit.authorName;
|
||||
}
|
||||
if (commit.authorEmail) {
|
||||
commitObject.author_email = commit.authorEmail;
|
||||
}
|
||||
if (commit.timestamp) {
|
||||
commitObject.timestamp = commit.timestamp;
|
||||
}
|
||||
|
||||
commits.push(commitObject);
|
||||
});
|
||||
|
||||
body.commits = commits;
|
||||
}
|
||||
if (updateFields.refs) {
|
||||
const refs: IRef[] = [];
|
||||
//@ts-ignore
|
||||
updateFields.refs.refProperties.map((ref: IRef) => {
|
||||
refs.push(ref);
|
||||
});
|
||||
|
||||
body.refs = refs;
|
||||
}
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'PUT', endpoint, body, qs);
|
||||
}
|
||||
}
|
||||
if (resource === 'team') {
|
||||
if (operation === 'get') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const teamSlug = this.getNodeParameter('teamSlug', i) as string;
|
||||
const endpoint = `/api/0/teams/${organizationSlug}/${teamSlug}/`;
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'GET', endpoint, qs);
|
||||
}
|
||||
if (operation === 'getAll') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const endpoint = `/api/0/organizations/${organizationSlug}/teams/`;
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
qs.limit = limit;
|
||||
}
|
||||
|
||||
responseData = await sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
|
||||
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
}
|
||||
|
||||
if (operation === 'create') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const name = this.getNodeParameter('name', i) as string;
|
||||
const endpoint = `/api/0/organizations/${organizationSlug}/teams/`;
|
||||
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
|
||||
qs.name = name;
|
||||
|
||||
if (additionalFields.slug) {
|
||||
qs.slug = additionalFields.slug;
|
||||
}
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'POST', endpoint, qs);
|
||||
}
|
||||
if (operation === 'update') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const teamSlug = this.getNodeParameter('teamSlug', i) as string;
|
||||
const endpoint = `/api/0/teams/${organizationSlug}/${teamSlug}/`;
|
||||
|
||||
const body = this.getNodeParameter('updateFields', i);
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'PUT', endpoint, body, qs);
|
||||
}
|
||||
if (operation === 'delete') {
|
||||
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
|
||||
const teamSlug = this.getNodeParameter('teamSlug', i) as string;
|
||||
const endpoint = `/api/0/teams/${organizationSlug}/${teamSlug}/`;
|
||||
|
||||
responseData = await sentryIoApiRequest.call(this, 'DELETE', endpoint, qs);
|
||||
responseData = { success: true };
|
||||
}
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
|
||||
returnData.push(...executionData);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
const executionErrorData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ error: error.message }),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionErrorData);
|
||||
continue;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return [returnData];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,314 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const teamOperations: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['team'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Create',
|
||||
value: 'create',
|
||||
description: 'Create a new team',
|
||||
action: 'Create a team',
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete a team',
|
||||
action: 'Delete a team',
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Get team by slug',
|
||||
action: 'Get a team',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Get many teams',
|
||||
action: 'Get many teams',
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Update a team',
|
||||
action: 'Update a team',
|
||||
},
|
||||
],
|
||||
default: 'get',
|
||||
},
|
||||
];
|
||||
|
||||
export const teamFields: INodeProperties[] = [
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* team:getAll */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['team'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization for which the teams should be listed. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['team'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['team'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 500,
|
||||
},
|
||||
default: 100,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* team:get */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['team'],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the team belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Team Slug Name or ID',
|
||||
name: 'teamSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getTeams',
|
||||
loadOptionsDependsOn: ['organizationSlug'],
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['team'],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the team to get. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* team:create */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['team'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the team belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['team'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description: 'The name of the team',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['team'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Slug',
|
||||
name: 'slug',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description:
|
||||
'The optional slug for this team. If not provided it will be auto generated from the name.',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* team:update */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['team'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the team belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Team Slug Name or ID',
|
||||
name: 'teamSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getTeams',
|
||||
loadOptionsDependsOn: ['organizationSlug'],
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['team'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the team to update. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Update Fields',
|
||||
name: 'updateFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['team'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The new name of the team',
|
||||
},
|
||||
{
|
||||
displayName: 'Slug',
|
||||
name: 'slug',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The new slug of the team. Must be unique and available.',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* team:delete */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Organization Slug Name or ID',
|
||||
name: 'organizationSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getOrganizations',
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['team'],
|
||||
operation: ['delete'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the organization the team belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Team Slug Name or ID',
|
||||
name: 'teamSlug',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getTeams',
|
||||
loadOptionsDependsOn: ['organizationSlug'],
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['team'],
|
||||
operation: ['delete'],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description:
|
||||
'The slug of the team to delete. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,146 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"count": {
|
||||
"type": "string"
|
||||
},
|
||||
"culprit": {
|
||||
"type": "string"
|
||||
},
|
||||
"firstSeen": {
|
||||
"type": "string"
|
||||
},
|
||||
"hasSeen": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"isBookmarked": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"isPublic": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"isSubscribed": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"issueCategory": {
|
||||
"type": "string"
|
||||
},
|
||||
"issueType": {
|
||||
"type": "string"
|
||||
},
|
||||
"isUnhandled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"lastSeen": {
|
||||
"type": "string"
|
||||
},
|
||||
"level": {
|
||||
"type": "string"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"type": "string"
|
||||
},
|
||||
"function": {
|
||||
"type": "string"
|
||||
},
|
||||
"in_app_frame_mix": {
|
||||
"type": "string"
|
||||
},
|
||||
"initial_priority": {
|
||||
"type": "integer"
|
||||
},
|
||||
"sdk": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"name_normalized": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"severity_reason": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"numComments": {
|
||||
"type": "integer"
|
||||
},
|
||||
"permalink": {
|
||||
"type": "string"
|
||||
},
|
||||
"platform": {
|
||||
"type": "string"
|
||||
},
|
||||
"priority": {
|
||||
"type": "string"
|
||||
},
|
||||
"project": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"platform": {
|
||||
"type": "string"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"shareId": {
|
||||
"type": "null"
|
||||
},
|
||||
"shortId": {
|
||||
"type": "string"
|
||||
},
|
||||
"stats": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"24h": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"substatus": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"userCount": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"version": 1
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
import { mockDeep } from 'jest-mock-extended';
|
||||
import type { IExecuteFunctions } from 'n8n-workflow';
|
||||
import { sentryIoApiRequest } from '../GenericFunctions';
|
||||
|
||||
describe('SentryIo GenericFunctions', () => {
|
||||
const mockExecuteFunctions = mockDeep<IExecuteFunctions>();
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('sentryIoApiRequest', () => {
|
||||
it('should use sentryIoOAuth2Api credentials', async () => {
|
||||
mockExecuteFunctions.getNodeParameter.mockReturnValue('oAuth2');
|
||||
|
||||
await sentryIoApiRequest.call(mockExecuteFunctions, 'GET', '/test');
|
||||
|
||||
expect(mockExecuteFunctions.helpers.requestOAuth2).toHaveBeenCalledWith(
|
||||
'sentryIoOAuth2Api',
|
||||
expect.any(Object),
|
||||
);
|
||||
});
|
||||
|
||||
it('should use sentryIoApi credentials', async () => {
|
||||
mockExecuteFunctions.getNodeParameter.mockReturnValue('accessToken');
|
||||
mockExecuteFunctions.getCredentials.mockResolvedValue({
|
||||
token: 'test-token',
|
||||
});
|
||||
|
||||
await sentryIoApiRequest.call(mockExecuteFunctions, 'GET', '/test');
|
||||
|
||||
expect(mockExecuteFunctions.helpers.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
headers: { Authorization: 'Bearer test-token' },
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should use sentryIoServerApi credentials', async () => {
|
||||
mockExecuteFunctions.getNodeParameter.mockReturnValue('accessTokenServer');
|
||||
mockExecuteFunctions.getCredentials.mockResolvedValue({
|
||||
token: 'test-token',
|
||||
});
|
||||
|
||||
await sentryIoApiRequest.call(mockExecuteFunctions, 'GET', '/test');
|
||||
|
||||
expect(mockExecuteFunctions.helpers.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
headers: { Authorization: 'Bearer test-token' },
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should use custom URL from sentryIoServerApi credentials', async () => {
|
||||
mockExecuteFunctions.getNodeParameter.mockReturnValue('accessTokenServer');
|
||||
mockExecuteFunctions.getCredentials.mockResolvedValue({
|
||||
token: 'test-token',
|
||||
url: 'https://test.com',
|
||||
});
|
||||
|
||||
await sentryIoApiRequest.call(mockExecuteFunctions, 'GET', '/test');
|
||||
|
||||
expect(mockExecuteFunctions.helpers.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
headers: { Authorization: 'Bearer test-token' },
|
||||
uri: 'https://test.com/test',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M23.1824 3.80975C22.8498 3.2576 22.38 2.80081 21.8187 2.48372C21.2575 2.16663 20.6238 2 19.9791 2C19.3345 2 18.7008 2.16663 18.1395 2.48372C17.5782 2.80081 17.1085 3.2576 16.7758 3.80975L11.5063 12.8352C15.532 14.845 18.9619 17.8729 21.4555 21.6182C23.9491 25.3636 25.4196 29.696 25.7211 34.1854H22.0212C21.7203 30.3371 20.4198 26.6342 18.2483 23.4429C16.0768 20.2517 13.1096 17.6828 9.64035 15.9904L4.76327 24.4232C6.71356 25.2979 8.41265 26.6489 9.70428 28.3519C10.9959 30.055 11.8386 32.0554 12.155 34.1694H3.65812C3.55735 34.1622 3.45994 34.1301 3.37467 34.076C3.2894 34.0218 3.21896 33.9472 3.1697 33.8591C3.12044 33.7709 3.0939 33.6718 3.09249 33.5708C3.09107 33.4698 3.11482 33.37 3.1616 33.2804L5.51605 29.2763C4.71837 28.6107 3.80671 28.0952 2.82525 27.7547L0.494823 31.7589C0.252214 32.175 0.0947134 32.6352 0.0314717 33.1127C-0.0317699 33.5902 0.000507752 34.0756 0.12643 34.5405C0.252352 35.0055 0.469407 35.4407 0.764987 35.8211C1.06057 36.2014 1.42878 36.5192 1.84823 36.7561C2.40088 37.0674 3.02379 37.2328 3.65812 37.2366H15.2942C15.5103 34.5698 15.0341 31.8925 13.9117 29.4638C12.7893 27.0352 11.0587 24.9376 8.88756 23.3741L10.7375 20.1708C13.4775 22.0527 15.6794 24.6165 17.1259 27.6093C18.5725 30.6021 19.2136 33.9203 18.9861 37.2366H28.8443C29.0739 32.2129 27.981 27.217 25.6749 22.7481C23.3687 18.2791 19.9301 14.4937 15.7027 11.77L19.4426 5.36337C19.5259 5.22374 19.661 5.12268 19.8185 5.08219C19.976 5.04169 20.1431 5.06504 20.2834 5.14715C20.7079 5.37939 36.5324 32.9921 36.8287 33.3125C36.8809 33.4061 36.9074 33.5118 36.9057 33.619C36.9039 33.7261 36.8739 33.8309 36.8186 33.9227C36.7633 34.0146 36.6848 34.0902 36.591 34.1419C36.4971 34.1937 36.3912 34.2197 36.2841 34.2174H32.4721C32.5202 35.2371 32.5202 36.2542 32.4721 37.2686H36.3001C36.7862 37.2718 37.2681 37.1785 37.7179 36.9942C38.1677 36.8099 38.5765 36.5382 38.9206 36.1949C39.2646 35.8515 39.5372 35.4433 39.7225 34.9939C39.9078 34.5445 40.0021 34.0628 40 33.5768C40.0004 32.9347 39.829 32.3042 39.5034 31.7509L23.1824 3.80975Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,3 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M23.1824 3.80975C22.8498 3.2576 22.38 2.80081 21.8187 2.48372C21.2575 2.16663 20.6238 2 19.9791 2C19.3345 2 18.7008 2.16663 18.1395 2.48372C17.5782 2.80081 17.1085 3.2576 16.7758 3.80975L11.5063 12.8352C15.532 14.845 18.9619 17.8729 21.4555 21.6182C23.9491 25.3636 25.4196 29.696 25.7211 34.1854H22.0212C21.7203 30.3371 20.4198 26.6342 18.2483 23.4429C16.0768 20.2517 13.1096 17.6828 9.64035 15.9904L4.76327 24.4232C6.71356 25.2979 8.41265 26.6489 9.70428 28.3519C10.9959 30.055 11.8386 32.0554 12.155 34.1694H3.65812C3.55735 34.1622 3.45994 34.1301 3.37467 34.076C3.2894 34.0218 3.21896 33.9472 3.1697 33.8591C3.12044 33.7709 3.0939 33.6718 3.09249 33.5708C3.09107 33.4698 3.11482 33.37 3.1616 33.2804L5.51605 29.2763C4.71837 28.6107 3.80671 28.0952 2.82525 27.7547L0.494823 31.7589C0.252214 32.175 0.0947134 32.6352 0.0314717 33.1127C-0.0317699 33.5902 0.000507752 34.0756 0.12643 34.5405C0.252352 35.0055 0.469407 35.4407 0.764987 35.8211C1.06057 36.2014 1.42878 36.5192 1.84823 36.7561C2.40088 37.0674 3.02379 37.2328 3.65812 37.2366H15.2942C15.5103 34.5698 15.0341 31.8925 13.9117 29.4638C12.7893 27.0352 11.0587 24.9376 8.88756 23.3741L10.7375 20.1708C13.4775 22.0527 15.6794 24.6165 17.1259 27.6093C18.5725 30.6021 19.2136 33.9203 18.9861 37.2366H28.8443C29.0739 32.2129 27.981 27.217 25.6749 22.7481C23.3687 18.2791 19.9301 14.4937 15.7027 11.77L19.4426 5.36337C19.5259 5.22374 19.661 5.12268 19.8185 5.08219C19.976 5.04169 20.1431 5.06504 20.2834 5.14715C20.7079 5.37939 36.5324 32.9921 36.8287 33.3125C36.8809 33.4061 36.9074 33.5118 36.9057 33.619C36.9039 33.7261 36.8739 33.8309 36.8186 33.9227C36.7633 34.0146 36.6848 34.0902 36.591 34.1419C36.4971 34.1937 36.3912 34.2197 36.2841 34.2174H32.4721C32.5202 35.2371 32.5202 36.2542 32.4721 37.2686H36.3001C36.7862 37.2718 37.2681 37.1785 37.7179 36.9942C38.1677 36.8099 38.5765 36.5382 38.9206 36.1949C39.2646 35.8515 39.5372 35.4433 39.7225 34.9939C39.9078 34.5445 40.0021 34.0628 40 33.5768C40.0004 32.9347 39.829 32.3042 39.5034 31.7509L23.1824 3.80975Z" fill="#352D56"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
Reference in New Issue
Block a user