mirror of
https://github.com/n8n-io/n8n-nodes-starter.git
synced 2025-12-18 02:03:03 -06:00
Clonacion de repositorio y desarrollo de nodo perosnalizado (ts) v1
This commit is contained in:
parent
2e9e5c61ed
commit
9bc48cec2c
27 changed files with 4096 additions and 1079 deletions
|
|
@ -1,45 +0,0 @@
|
|||
import type {
|
||||
IAuthenticateGeneric,
|
||||
Icon,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class GithubIssuesApi implements ICredentialType {
|
||||
name = 'githubIssuesApi';
|
||||
|
||||
displayName = 'GitHub Issues API';
|
||||
|
||||
icon: Icon = { light: 'file:../icons/github.svg', dark: 'file:../icons/github.dark.svg' };
|
||||
|
||||
documentationUrl =
|
||||
'https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#deleting-a-personal-access-token';
|
||||
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Access Token',
|
||||
name: 'accessToken',
|
||||
type: 'string',
|
||||
typeOptions: { password: true },
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
|
||||
authenticate: IAuthenticateGeneric = {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
headers: {
|
||||
Authorization: '=token {{$credentials?.accessToken}}',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: 'https://api.github.com',
|
||||
url: '/user',
|
||||
method: 'GET',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
import type { Icon, ICredentialType, INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export class GithubIssuesOAuth2Api implements ICredentialType {
|
||||
name = 'githubIssuesOAuth2Api';
|
||||
|
||||
extends = ['oAuth2Api'];
|
||||
|
||||
displayName = 'GitHub Issues OAuth2 API';
|
||||
|
||||
icon: Icon = { light: 'file:../icons/github.svg', dark: 'file:../icons/github.dark.svg' };
|
||||
|
||||
documentationUrl = 'https://docs.github.com/en/apps/oauth-apps';
|
||||
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Grant Type',
|
||||
name: 'grantType',
|
||||
type: 'hidden',
|
||||
default: 'authorizationCode',
|
||||
},
|
||||
{
|
||||
displayName: 'Authorization URL',
|
||||
name: 'authUrl',
|
||||
type: 'hidden',
|
||||
default: 'https://github.com/login/oauth/authorize',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Access Token URL',
|
||||
name: 'accessTokenUrl',
|
||||
type: 'hidden',
|
||||
default: 'https://github.com/login/oauth/access_token',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Scope',
|
||||
name: 'scope',
|
||||
type: 'hidden',
|
||||
default: 'repo',
|
||||
},
|
||||
{
|
||||
displayName: 'Auth URI Query Parameters',
|
||||
name: 'authQueryParameters',
|
||||
type: 'hidden',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Authentication',
|
||||
name: 'authentication',
|
||||
type: 'hidden',
|
||||
default: 'header',
|
||||
},
|
||||
];
|
||||
}
|
||||
0
credentials/VerificarEmailApi.credentials.ts
Normal file
0
credentials/VerificarEmailApi.credentials.ts
Normal file
3
credentials/mail-mail-email.svg
Normal file
3
credentials/mail-mail-email.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 -0.5 1025 1025" class="icon" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M509.3 606.2c-27.9 0-55.6-9-78.7-26.9L36.4 245.7c-18-15.2-20.2-42.2-5-60.1 15.2-18 42.2-20.2 60.1-5L484.3 513c14.4 11.1 36.5 11.1 52.4-1.2l396.2-331.4c18.1-15.1 45-12.8 60.1 5.4 15.1 18.1 12.7 45-5.4 60.1L590.1 578.3c-24.1 18.7-52.6 27.9-80.8 27.9z" fill="#5F6379" /><path d="M894.8 938.6H129.4c-71.3 0-129.4-58-129.4-129.4v-552c0-71.3 58-129.4 129.4-129.4h765.4c71.3 0 129.4 58 129.4 129.4v552.1c0 71.3-58.1 129.3-129.4 129.3zM129.4 213.2c-24.3 0-44 19.8-44 44v552.1c0 24.3 19.8 44 44 44h765.4c24.3 0 44-19.8 44-44V257.2c0-24.3-19.8-44-44-44H129.4z" fill="#3688FF" /></svg>
|
||||
|
After Width: | Height: | Size: 827 B |
3
images/mail-mail-email.svg
Normal file
3
images/mail-mail-email.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 -0.5 1025 1025" class="icon" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M509.3 606.2c-27.9 0-55.6-9-78.7-26.9L36.4 245.7c-18-15.2-20.2-42.2-5-60.1 15.2-18 42.2-20.2 60.1-5L484.3 513c14.4 11.1 36.5 11.1 52.4-1.2l396.2-331.4c18.1-15.1 45-12.8 60.1 5.4 15.1 18.1 12.7 45-5.4 60.1L590.1 578.3c-24.1 18.7-52.6 27.9-80.8 27.9z" fill="#5F6379" /><path d="M894.8 938.6H129.4c-71.3 0-129.4-58-129.4-129.4v-552c0-71.3 58-129.4 129.4-129.4h765.4c71.3 0 129.4 58 129.4 129.4v552.1c0 71.3-58.1 129.3-129.4 129.3zM129.4 213.2c-24.3 0-44 19.8-44 44v552.1c0 24.3 19.8 44 44 44h765.4c24.3 0 44-19.8 44-44V257.2c0-24.3-19.8-44-44-44H129.4z" fill="#3688FF" /></svg>
|
||||
|
After Width: | Height: | Size: 827 B |
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"node": "n8n-nodes-example",
|
||||
"nodeVersion": "1.0",
|
||||
"codexVersion": "1.0",
|
||||
"categories": ["Development", "Developer Tools"],
|
||||
"resources": {
|
||||
"credentialDocumentation": [
|
||||
{
|
||||
"url": "https://github.com/org/repo?tab=readme-ov-file#credentials"
|
||||
}
|
||||
],
|
||||
"primaryDocumentation": [
|
||||
{
|
||||
"url": "https://github.com/org/repo?tab=readme-ov-file"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
import type {
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
export class Example implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Example',
|
||||
name: 'example',
|
||||
icon: { light: 'file:example.svg', dark: 'file:example.dark.svg' },
|
||||
group: ['input'],
|
||||
version: 1,
|
||||
description: 'Basic Example Node',
|
||||
defaults: {
|
||||
name: 'Example',
|
||||
},
|
||||
inputs: [NodeConnectionTypes.Main],
|
||||
outputs: [NodeConnectionTypes.Main],
|
||||
usableAsTool: true,
|
||||
properties: [
|
||||
// Node properties which the user gets displayed and
|
||||
// can change on the node.
|
||||
{
|
||||
displayName: 'My String',
|
||||
name: 'myString',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'Placeholder value',
|
||||
description: 'The description text',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
// The function below is responsible for actually doing whatever this node
|
||||
// is supposed to do. In this case, we're just appending the `myString` property
|
||||
// with whatever the user has entered.
|
||||
// You can make async calls and use `await`.
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const items = this.getInputData();
|
||||
|
||||
let item: INodeExecutionData;
|
||||
let myString: string;
|
||||
|
||||
// Iterates over all input items and add the key "myString" with the
|
||||
// value the parameter "myString" resolves to.
|
||||
// (This could be a different value for each item in case it contains an expression)
|
||||
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
||||
try {
|
||||
myString = this.getNodeParameter('myString', itemIndex, '') as string;
|
||||
item = items[itemIndex];
|
||||
|
||||
item.json.myString = myString;
|
||||
} catch (error) {
|
||||
// This node should never fail but we want to showcase how
|
||||
// to handle errors.
|
||||
if (this.continueOnFail()) {
|
||||
items.push({ json: this.getInputData(itemIndex)[0].json, error, pairedItem: itemIndex });
|
||||
} else {
|
||||
// Adding `itemIndex` allows other workflows to handle this error
|
||||
if (error.context) {
|
||||
// If the error thrown already contains the context property,
|
||||
// only append the itemIndex
|
||||
error.context.itemIndex = itemIndex;
|
||||
throw error;
|
||||
}
|
||||
throw new NodeOperationError(this.getNode(), error, {
|
||||
itemIndex,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [items];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="aquamarine"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-cpu">
|
||||
<rect x="4" y="4" width="16" height="16" rx="2" ry="2"></rect>
|
||||
<rect x="9" y="9" width="6" height="6"></rect>
|
||||
<line x1="9" y1="1" x2="9" y2="4"></line>
|
||||
<line x1="15" y1="1" x2="15" y2="4"></line>
|
||||
<line x1="9" y1="20" x2="9" y2="23"></line>
|
||||
<line x1="15" y1="20" x2="15" y2="23"></line>
|
||||
<line x1="20" y1="9" x2="23" y2="9"></line>
|
||||
<line x1="20" y1="14" x2="23" y2="14"></line>
|
||||
<line x1="1" y1="9" x2="4" y2="9"></line>
|
||||
<line x1="1" y1="14" x2="4" y2="14"></line>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 698 B |
|
|
@ -1,13 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="darkblue"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-cpu">
|
||||
<rect x="4" y="4" width="16" height="16" rx="2" ry="2"></rect>
|
||||
<rect x="9" y="9" width="6" height="6"></rect>
|
||||
<line x1="9" y1="1" x2="9" y2="4"></line>
|
||||
<line x1="15" y1="1" x2="15" y2="4"></line>
|
||||
<line x1="9" y1="20" x2="9" y2="23"></line>
|
||||
<line x1="15" y1="20" x2="15" y2="23"></line>
|
||||
<line x1="20" y1="9" x2="23" y2="9"></line>
|
||||
<line x1="20" y1="14" x2="23" y2="14"></line>
|
||||
<line x1="1" y1="9" x2="4" y2="9"></line>
|
||||
<line x1="1" y1="14" x2="4" y2="14"></line>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 696 B |
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"node": "n8n-nodes-github-issues",
|
||||
"nodeVersion": "1.0",
|
||||
"codexVersion": "1.0",
|
||||
"categories": ["Development", "Developer Tools"],
|
||||
"resources": {
|
||||
"credentialDocumentation": [
|
||||
{
|
||||
"url": "https://github.com/org/repo?tab=readme-ov-file#credentials"
|
||||
}
|
||||
],
|
||||
"primaryDocumentation": [
|
||||
{
|
||||
"url": "https://github.com/org/repo?tab=readme-ov-file"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
import { NodeConnectionTypes, type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
||||
import { issueDescription } from './resources/issue';
|
||||
import { issueCommentDescription } from './resources/issueComment';
|
||||
import { getRepositories } from './listSearch/getRepositories';
|
||||
import { getUsers } from './listSearch/getUsers';
|
||||
import { getIssues } from './listSearch/getIssues';
|
||||
|
||||
export class GithubIssues implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'GitHub Issues',
|
||||
name: 'githubIssues',
|
||||
icon: { light: 'file:../../icons/github.svg', dark: 'file:../../icons/github.dark.svg' },
|
||||
group: ['input'],
|
||||
version: 1,
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||
description: 'Consume issues from the GitHub API',
|
||||
defaults: {
|
||||
name: 'GitHub Issues',
|
||||
},
|
||||
usableAsTool: true,
|
||||
inputs: [NodeConnectionTypes.Main],
|
||||
outputs: [NodeConnectionTypes.Main],
|
||||
credentials: [
|
||||
{
|
||||
name: 'githubIssuesApi',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
authentication: ['accessToken'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'githubIssuesOAuth2Api',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
authentication: ['oAuth2'],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
requestDefaults: {
|
||||
baseURL: 'https://api.github.com',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
},
|
||||
properties: [
|
||||
{
|
||||
displayName: 'Authentication',
|
||||
name: 'authentication',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Access Token',
|
||||
value: 'accessToken',
|
||||
},
|
||||
{
|
||||
name: 'OAuth2',
|
||||
value: 'oAuth2',
|
||||
},
|
||||
],
|
||||
default: 'accessToken',
|
||||
},
|
||||
{
|
||||
displayName: 'Resource',
|
||||
name: 'resource',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
options: [
|
||||
{
|
||||
name: 'Issue',
|
||||
value: 'issue',
|
||||
},
|
||||
{
|
||||
name: 'Issue Comment',
|
||||
value: 'issueComment',
|
||||
},
|
||||
],
|
||||
default: 'issue',
|
||||
},
|
||||
...issueDescription,
|
||||
...issueCommentDescription,
|
||||
],
|
||||
};
|
||||
|
||||
methods = {
|
||||
listSearch: {
|
||||
getRepositories,
|
||||
getUsers,
|
||||
getIssues,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
import type {
|
||||
ILoadOptionsFunctions,
|
||||
INodeListSearchResult,
|
||||
INodeListSearchItems,
|
||||
} from 'n8n-workflow';
|
||||
import { githubApiRequest } from '../shared/transport';
|
||||
|
||||
type IssueSearchItem = {
|
||||
number: number;
|
||||
title: string;
|
||||
html_url: string;
|
||||
};
|
||||
|
||||
type IssueSearchResponse = {
|
||||
items: IssueSearchItem[];
|
||||
total_count: number;
|
||||
};
|
||||
|
||||
export async function getIssues(
|
||||
this: ILoadOptionsFunctions,
|
||||
filter?: string,
|
||||
paginationToken?: string,
|
||||
): Promise<INodeListSearchResult> {
|
||||
const page = paginationToken ? +paginationToken : 1;
|
||||
const per_page = 100;
|
||||
|
||||
let responseData: IssueSearchResponse = {
|
||||
items: [],
|
||||
total_count: 0,
|
||||
};
|
||||
const owner = this.getNodeParameter('owner', '', { extractValue: true });
|
||||
const repository = this.getNodeParameter('repository', '', { extractValue: true });
|
||||
const filters = [filter, `repo:${owner}/${repository}`];
|
||||
|
||||
responseData = await githubApiRequest.call(this, 'GET', '/search/issues', {
|
||||
q: filters.filter(Boolean).join(' '),
|
||||
page,
|
||||
per_page,
|
||||
});
|
||||
|
||||
const results: INodeListSearchItems[] = responseData.items.map((item: IssueSearchItem) => ({
|
||||
name: item.title,
|
||||
value: item.number,
|
||||
url: item.html_url,
|
||||
}));
|
||||
|
||||
const nextPaginationToken = page * per_page < responseData.total_count ? page + 1 : undefined;
|
||||
return { results, paginationToken: nextPaginationToken };
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
import type {
|
||||
ILoadOptionsFunctions,
|
||||
INodeListSearchItems,
|
||||
INodeListSearchResult,
|
||||
} from 'n8n-workflow';
|
||||
import { githubApiRequest } from '../shared/transport';
|
||||
|
||||
type RepositorySearchItem = {
|
||||
name: string;
|
||||
html_url: string;
|
||||
};
|
||||
|
||||
type RepositorySearchResponse = {
|
||||
items: RepositorySearchItem[];
|
||||
total_count: number;
|
||||
};
|
||||
|
||||
export async function getRepositories(
|
||||
this: ILoadOptionsFunctions,
|
||||
filter?: string,
|
||||
paginationToken?: string,
|
||||
): Promise<INodeListSearchResult> {
|
||||
const owner = this.getCurrentNodeParameter('owner', { extractValue: true });
|
||||
const page = paginationToken ? +paginationToken : 1;
|
||||
const per_page = 100;
|
||||
const q = `${filter ?? ''} user:${owner} fork:true`;
|
||||
let responseData: RepositorySearchResponse = {
|
||||
items: [],
|
||||
total_count: 0,
|
||||
};
|
||||
|
||||
try {
|
||||
responseData = await githubApiRequest.call(this, 'GET', '/search/repositories', {
|
||||
q,
|
||||
page,
|
||||
per_page,
|
||||
});
|
||||
} catch {
|
||||
// will fail if the owner does not have any repositories
|
||||
}
|
||||
|
||||
const results: INodeListSearchItems[] = responseData.items.map((item: RepositorySearchItem) => ({
|
||||
name: item.name,
|
||||
value: item.name,
|
||||
url: item.html_url,
|
||||
}));
|
||||
|
||||
const nextPaginationToken = page * per_page < responseData.total_count ? page + 1 : undefined;
|
||||
return { results, paginationToken: nextPaginationToken };
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
import type {
|
||||
ILoadOptionsFunctions,
|
||||
INodeListSearchResult,
|
||||
INodeListSearchItems,
|
||||
} from 'n8n-workflow';
|
||||
import { githubApiRequest } from '../shared/transport';
|
||||
|
||||
type UserSearchItem = {
|
||||
login: string;
|
||||
html_url: string;
|
||||
};
|
||||
|
||||
type UserSearchResponse = {
|
||||
items: UserSearchItem[];
|
||||
total_count: number;
|
||||
};
|
||||
|
||||
export async function getUsers(
|
||||
this: ILoadOptionsFunctions,
|
||||
filter?: string,
|
||||
paginationToken?: string,
|
||||
): Promise<INodeListSearchResult> {
|
||||
const page = paginationToken ? +paginationToken : 1;
|
||||
const per_page = 100;
|
||||
|
||||
let responseData: UserSearchResponse = {
|
||||
items: [],
|
||||
total_count: 0,
|
||||
};
|
||||
|
||||
try {
|
||||
responseData = await githubApiRequest.call(this, 'GET', '/search/users', {
|
||||
q: filter,
|
||||
page,
|
||||
per_page,
|
||||
});
|
||||
} catch {
|
||||
// will fail if the owner does not have any users
|
||||
}
|
||||
|
||||
const results: INodeListSearchItems[] = responseData.items.map((item: UserSearchItem) => ({
|
||||
name: item.login,
|
||||
value: item.login,
|
||||
url: item.html_url,
|
||||
}));
|
||||
|
||||
const nextPaginationToken = page * per_page < responseData.total_count ? page + 1 : undefined;
|
||||
return { results, paginationToken: nextPaginationToken };
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
const showOnlyForIssueCreate = {
|
||||
operation: ['create'],
|
||||
resource: ['issue'],
|
||||
};
|
||||
|
||||
export const issueCreateDescription: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Title',
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
default: '',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: showOnlyForIssueCreate,
|
||||
},
|
||||
description: 'The title of the issue',
|
||||
routing: {
|
||||
send: {
|
||||
type: 'body',
|
||||
property: 'title',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Body',
|
||||
name: 'body',
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
rows: 5,
|
||||
},
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: showOnlyForIssueCreate,
|
||||
},
|
||||
description: 'The body of the issue',
|
||||
routing: {
|
||||
send: {
|
||||
type: 'body',
|
||||
property: 'body',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Labels',
|
||||
name: 'labels',
|
||||
type: 'collection',
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
multipleValueButtonText: 'Add Label',
|
||||
},
|
||||
displayOptions: {
|
||||
show: showOnlyForIssueCreate,
|
||||
},
|
||||
default: { label: '' },
|
||||
options: [
|
||||
{
|
||||
displayName: 'Label',
|
||||
name: 'label',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Label to add to issue',
|
||||
},
|
||||
],
|
||||
routing: {
|
||||
send: {
|
||||
type: 'body',
|
||||
property: 'labels',
|
||||
value: '={{$value.map((data) => data.label)}}',
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { issueSelect } from '../../shared/descriptions';
|
||||
|
||||
const showOnlyForIssueGet = {
|
||||
operation: ['get'],
|
||||
resource: ['issue'],
|
||||
};
|
||||
|
||||
export const issueGetDescription: INodeProperties[] = [
|
||||
{
|
||||
...issueSelect,
|
||||
displayOptions: { show: showOnlyForIssueGet },
|
||||
},
|
||||
];
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { parseLinkHeader } from '../../shared/utils';
|
||||
|
||||
const showOnlyForIssueGetMany = {
|
||||
operation: ['getAll'],
|
||||
resource: ['issue'],
|
||||
};
|
||||
|
||||
export const issueGetManyDescription: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
...showOnlyForIssueGetMany,
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 100,
|
||||
},
|
||||
default: 50,
|
||||
routing: {
|
||||
send: {
|
||||
type: 'query',
|
||||
property: 'per_page',
|
||||
},
|
||||
output: {
|
||||
maxResults: '={{$value}}',
|
||||
},
|
||||
},
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: showOnlyForIssueGetMany,
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
routing: {
|
||||
send: {
|
||||
paginate: '={{ $value }}',
|
||||
type: 'query',
|
||||
property: 'per_page',
|
||||
value: '100',
|
||||
},
|
||||
operations: {
|
||||
pagination: {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
continue: `={{ !!(${parseLinkHeader.toString()})($response.headers?.link).next }}`,
|
||||
request: {
|
||||
url: `={{ (${parseLinkHeader.toString()})($response.headers?.link)?.next ?? $request.url }}`,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Filters',
|
||||
name: 'filters',
|
||||
type: 'collection',
|
||||
typeOptions: {
|
||||
multipleValueButtonText: 'Add Filter',
|
||||
},
|
||||
displayOptions: {
|
||||
show: showOnlyForIssueGetMany,
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Updated Since',
|
||||
name: 'since',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description: 'Return only issues updated at or after this time',
|
||||
routing: {
|
||||
request: {
|
||||
qs: {
|
||||
since: '={{$value}}',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'State',
|
||||
name: 'state',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'All',
|
||||
value: 'all',
|
||||
description: 'Returns issues with any state',
|
||||
},
|
||||
{
|
||||
name: 'Closed',
|
||||
value: 'closed',
|
||||
description: 'Return issues with "closed" state',
|
||||
},
|
||||
{
|
||||
name: 'Open',
|
||||
value: 'open',
|
||||
description: 'Return issues with "open" state',
|
||||
},
|
||||
],
|
||||
default: 'open',
|
||||
description: 'The issue state to filter on',
|
||||
routing: {
|
||||
request: {
|
||||
qs: {
|
||||
state: '={{$value}}',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { repoNameSelect, repoOwnerSelect } from '../../shared/descriptions';
|
||||
import { issueGetManyDescription } from './getAll';
|
||||
import { issueGetDescription } from './get';
|
||||
import { issueCreateDescription } from './create';
|
||||
|
||||
const showOnlyForIssues = {
|
||||
resource: ['issue'],
|
||||
};
|
||||
|
||||
export const issueDescription: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: showOnlyForIssues,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
action: 'Get issues in a repository',
|
||||
description: 'Get many issues in a repository',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'GET',
|
||||
url: '=/repos/{{$parameter.owner}}/{{$parameter.repository}}/issues',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
action: 'Get an issue',
|
||||
description: 'Get the data of a single issue',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'GET',
|
||||
url: '=/repos/{{$parameter.owner}}/{{$parameter.repository}}/issues/{{$parameter.issue}}',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Create',
|
||||
value: 'create',
|
||||
action: 'Create a new issue',
|
||||
description: 'Create a new issue',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
url: '=/repos/{{$parameter.owner}}/{{$parameter.repository}}/issues',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
default: 'getAll',
|
||||
},
|
||||
{
|
||||
...repoOwnerSelect,
|
||||
displayOptions: {
|
||||
show: showOnlyForIssues,
|
||||
},
|
||||
},
|
||||
{
|
||||
...repoNameSelect,
|
||||
displayOptions: {
|
||||
show: showOnlyForIssues,
|
||||
},
|
||||
},
|
||||
...issueGetManyDescription,
|
||||
...issueGetDescription,
|
||||
...issueCreateDescription,
|
||||
];
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { parseLinkHeader } from '../../shared/utils';
|
||||
|
||||
const showOnlyForIssueCommentGetMany = {
|
||||
operation: ['getAll'],
|
||||
resource: ['issueComment'],
|
||||
};
|
||||
|
||||
export const issueCommentGetManyDescription: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
...showOnlyForIssueCommentGetMany,
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 100,
|
||||
},
|
||||
default: 50,
|
||||
routing: {
|
||||
send: {
|
||||
type: 'query',
|
||||
property: 'per_page',
|
||||
},
|
||||
output: {
|
||||
maxResults: '={{$value}}',
|
||||
},
|
||||
},
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: showOnlyForIssueCommentGetMany,
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
routing: {
|
||||
send: {
|
||||
paginate: '={{ $value }}',
|
||||
type: 'query',
|
||||
property: 'per_page',
|
||||
value: '100',
|
||||
},
|
||||
operations: {
|
||||
pagination: {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
continue: `={{ !!(${parseLinkHeader.toString()})($response.headers?.link).next }}`,
|
||||
request: {
|
||||
url: `={{ (${parseLinkHeader.toString()})($response.headers?.link)?.next ?? $request.url }}`,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { repoNameSelect, repoOwnerSelect } from '../../shared/descriptions';
|
||||
import { issueCommentGetManyDescription } from './getAll';
|
||||
|
||||
const showOnlyForIssueComments = {
|
||||
resource: ['issueComment'],
|
||||
};
|
||||
|
||||
export const issueCommentDescription: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: showOnlyForIssueComments,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
action: 'Get issue comments',
|
||||
description: 'Get issue comments',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'GET',
|
||||
url: '=/repos/{{$parameter.owner}}/{{$parameter.repository}}/issues/comments',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
default: 'getAll',
|
||||
},
|
||||
{
|
||||
...repoOwnerSelect,
|
||||
displayOptions: {
|
||||
show: showOnlyForIssueComments,
|
||||
},
|
||||
},
|
||||
{
|
||||
...repoNameSelect,
|
||||
displayOptions: {
|
||||
show: showOnlyForIssueComments,
|
||||
},
|
||||
},
|
||||
...issueCommentGetManyDescription,
|
||||
];
|
||||
|
|
@ -1,151 +0,0 @@
|
|||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const repoOwnerSelect: INodeProperties = {
|
||||
displayName: 'Repository Owner',
|
||||
name: 'owner',
|
||||
type: 'resourceLocator',
|
||||
default: { mode: 'list', value: '' },
|
||||
required: true,
|
||||
modes: [
|
||||
{
|
||||
displayName: 'Repository Owner',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
placeholder: 'Select an owner...',
|
||||
typeOptions: {
|
||||
searchListMethod: 'getUsers',
|
||||
searchable: true,
|
||||
searchFilterRequired: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Link',
|
||||
name: 'url',
|
||||
type: 'string',
|
||||
placeholder: 'e.g. https://github.com/n8n-io',
|
||||
extractValue: {
|
||||
type: 'regex',
|
||||
regex: 'https:\\/\\/github.com\\/([-_0-9a-zA-Z]+)',
|
||||
},
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: 'https:\\/\\/github.com\\/([-_0-9a-zA-Z]+)(?:.*)',
|
||||
errorMessage: 'Not a valid GitHub URL',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'By Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
placeholder: 'e.g. n8n-io',
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: '[-_a-zA-Z0-9]+',
|
||||
errorMessage: 'Not a valid GitHub Owner Name',
|
||||
},
|
||||
},
|
||||
],
|
||||
url: '=https://github.com/{{$value}}',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const repoNameSelect: INodeProperties = {
|
||||
displayName: 'Repository Name',
|
||||
name: 'repository',
|
||||
type: 'resourceLocator',
|
||||
default: {
|
||||
mode: 'list',
|
||||
value: '',
|
||||
},
|
||||
required: true,
|
||||
modes: [
|
||||
{
|
||||
displayName: 'Repository Name',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
placeholder: 'Select an Repository...',
|
||||
typeOptions: {
|
||||
searchListMethod: 'getRepositories',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Link',
|
||||
name: 'url',
|
||||
type: 'string',
|
||||
placeholder: 'e.g. https://github.com/n8n-io/n8n',
|
||||
extractValue: {
|
||||
type: 'regex',
|
||||
regex: 'https:\\/\\/github.com\\/(?:[-_0-9a-zA-Z]+)\\/([-_.0-9a-zA-Z]+)',
|
||||
},
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: 'https:\\/\\/github.com\\/(?:[-_0-9a-zA-Z]+)\\/([-_.0-9a-zA-Z]+)(?:.*)',
|
||||
errorMessage: 'Not a valid GitHub Repository URL',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'By Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
placeholder: 'e.g. n8n',
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: '[-_.0-9a-zA-Z]+',
|
||||
errorMessage: 'Not a valid GitHub Repository Name',
|
||||
},
|
||||
},
|
||||
],
|
||||
url: '=https://github.com/{{$parameter["owner"]}}/{{$value}}',
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
hide: {
|
||||
resource: ['user', 'organization'],
|
||||
operation: ['getRepositories'],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const issueSelect: INodeProperties = {
|
||||
displayName: 'Issue',
|
||||
name: 'issue',
|
||||
type: 'resourceLocator',
|
||||
default: {
|
||||
mode: 'list',
|
||||
value: '',
|
||||
},
|
||||
required: true,
|
||||
modes: [
|
||||
{
|
||||
displayName: 'Issue',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
placeholder: 'Select an Issue...',
|
||||
typeOptions: {
|
||||
searchListMethod: 'getIssues',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'By ID',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
placeholder: 'e.g. 123',
|
||||
url: '=https://github.com/{{$parameter.owner}}/{{$parameter.repository}}/issues/{{$value}}',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
import type {
|
||||
IHookFunctions,
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IHttpRequestMethods,
|
||||
IDataObject,
|
||||
IHttpRequestOptions,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export async function githubApiRequest(
|
||||
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
method: IHttpRequestMethods,
|
||||
resource: string,
|
||||
qs: IDataObject = {},
|
||||
body: IDataObject | undefined = undefined,
|
||||
) {
|
||||
const authenticationMethod = this.getNodeParameter('authentication', 0);
|
||||
|
||||
const options: IHttpRequestOptions = {
|
||||
method: method,
|
||||
qs,
|
||||
body,
|
||||
url: `https://api.github.com${resource}`,
|
||||
json: true,
|
||||
};
|
||||
|
||||
const credentialType =
|
||||
authenticationMethod === 'accessToken' ? 'githubIssuesApi' : 'githubIssuesOAuth2Api';
|
||||
|
||||
return this.helpers.httpRequestWithAuthentication.call(this, credentialType, options);
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
export function parseLinkHeader(header?: string): { [rel: string]: string } {
|
||||
const links: { [rel: string]: string } = {};
|
||||
|
||||
for (const part of header?.split(',') ?? []) {
|
||||
const section = part.trim();
|
||||
const match = section.match(/^<([^>]+)>\s*;\s*rel="?([^"]+)"?/);
|
||||
if (match) {
|
||||
const [, url, rel] = match;
|
||||
links[rel] = url;
|
||||
}
|
||||
}
|
||||
|
||||
return links;
|
||||
}
|
||||
0
nodes/VerificarEmail.node.json
Normal file
0
nodes/VerificarEmail.node.json
Normal file
46
nodes/VerificarEmail.node.ts
Normal file
46
nodes/VerificarEmail.node.ts
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
import { INodeType, INodeTypeDescription, NodeConnectionTypes } from 'n8n-workflow';
|
||||
export class VerificarEmail implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Verificacion de Email',
|
||||
name: 'verificarEmail',
|
||||
icon: 'file:mail-mail-email.svg',
|
||||
group: ['transform'],
|
||||
version: 1,
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||
description: 'Node para verificar emails usando un servicio externo (emailable.com)',
|
||||
defaults: {
|
||||
name: 'Verficar Email',
|
||||
},
|
||||
inputs: [NodeConnectionTypes.Main],
|
||||
outputs: [NodeConnectionTypes.Main],
|
||||
credentials: [
|
||||
{
|
||||
name: 'VerificarEmailApi',
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
requestDefaults: {
|
||||
baseURL: 'https://api.emailable.com/v1/verify',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
},
|
||||
properties: [
|
||||
{
|
||||
displayName: 'Validar Email',
|
||||
name: 'email',
|
||||
type: 'string',
|
||||
placeholder: 'correo@email.com',
|
||||
required: true,
|
||||
default: 'dylanbohorquez77@gmail.com',
|
||||
routing: {
|
||||
qs: {
|
||||
email: '={{$value}}',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
usableAsTool: true
|
||||
};
|
||||
}
|
||||
3
nodes/mail-mail-email.svg
Normal file
3
nodes/mail-mail-email.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 -0.5 1025 1025" class="icon" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M509.3 606.2c-27.9 0-55.6-9-78.7-26.9L36.4 245.7c-18-15.2-20.2-42.2-5-60.1 15.2-18 42.2-20.2 60.1-5L484.3 513c14.4 11.1 36.5 11.1 52.4-1.2l396.2-331.4c18.1-15.1 45-12.8 60.1 5.4 15.1 18.1 12.7 45-5.4 60.1L590.1 578.3c-24.1 18.7-52.6 27.9-80.8 27.9z" fill="#5F6379" /><path d="M894.8 938.6H129.4c-71.3 0-129.4-58-129.4-129.4v-552c0-71.3 58-129.4 129.4-129.4h765.4c71.3 0 129.4 58 129.4 129.4v552.1c0 71.3-58.1 129.3-129.4 129.3zM129.4 213.2c-24.3 0-44 19.8-44 44v552.1c0 24.3 19.8 44 44 44h765.4c24.3 0 44-19.8 44-44V257.2c0-24.3-19.8-44-44-44H129.4z" fill="#3688FF" /></svg>
|
||||
|
After Width: | Height: | Size: 827 B |
4041
pnpm-lock.yaml
generated
Normal file
4041
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue