mirror of
https://github.com/n8n-io/n8n-nodes-starter.git
synced 2025-10-28 14:12:24 -05:00
Add nodes generated by the Node CLI, update README (#96)
This commit is contained in:
parent
67ee5b8e80
commit
4fb0cd0bc8
41 changed files with 8549 additions and 745 deletions
|
|
@ -1,59 +0,0 @@
|
|||
import {
|
||||
IAuthenticateGeneric,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class ExampleCredentialsApi implements ICredentialType {
|
||||
name = 'exampleCredentialsApi';
|
||||
displayName = 'Example Credentials API';
|
||||
|
||||
documentationUrl = 'https://your-docs-url';
|
||||
|
||||
properties: INodeProperties[] = [
|
||||
// The credentials to get from user and save encrypted.
|
||||
// Properties can be defined exactly in the same way
|
||||
// as node properties.
|
||||
{
|
||||
displayName: 'User Name',
|
||||
name: 'username',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Password',
|
||||
name: 'password',
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
password: true,
|
||||
},
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
|
||||
// This credential is currently not used by any node directly
|
||||
// but the HTTP Request node can use it to make requests.
|
||||
// The credential is also testable due to the `test` property below
|
||||
authenticate: IAuthenticateGeneric = {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
auth: {
|
||||
username: '={{ $credentials.username }}',
|
||||
password: '={{ $credentials.password }}',
|
||||
},
|
||||
qs: {
|
||||
// Send this as part of the query string
|
||||
n8n: 'rocks',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// The block below tells how this credential can be tested
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: 'https://example.com/',
|
||||
url: '',
|
||||
},
|
||||
};
|
||||
}
|
||||
45
credentials/GithubIssuesApi.credentials.ts
Normal file
45
credentials/GithubIssuesApi.credentials.ts
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
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',
|
||||
},
|
||||
};
|
||||
}
|
||||
54
credentials/GithubIssuesOAuth2Api.credentials.ts
Normal file
54
credentials/GithubIssuesOAuth2Api.credentials.ts
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
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',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
import {
|
||||
IAuthenticateGeneric,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class HttpBinApi implements ICredentialType {
|
||||
name = 'httpbinApi';
|
||||
displayName = 'HttpBin API';
|
||||
documentationUrl = 'https://your-docs-url';
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Token',
|
||||
name: 'token',
|
||||
type: 'string',
|
||||
default: '',
|
||||
typeOptions: {
|
||||
password: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
displayName: 'Domain',
|
||||
name: 'domain',
|
||||
type: 'string',
|
||||
default: 'https://httpbin.org',
|
||||
},
|
||||
];
|
||||
|
||||
// This allows the credential to be used by other parts of n8n
|
||||
// stating how this credential is injected as part of the request
|
||||
// An example is the Http Request node that can make generic calls
|
||||
// reusing this credential
|
||||
authenticate: IAuthenticateGeneric = {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
headers: {
|
||||
Authorization: '={{"Bearer " + $credentials.token}}',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// The block below tells how this credential can be tested
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: '={{$credentials?.domain}}',
|
||||
url: '/bearer',
|
||||
},
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue