first commit

This commit is contained in:
2025-10-26 23:10:15 +08:00
commit 8f0345b7be
14961 changed files with 2356381 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class ExampleApi implements ICredentialType {
name = 'exampleApi';
displayName = 'Example API';
// Link to your community node's README
documentationUrl = 'https://github.com/org/repo?tab=readme-ov-file#credentials';
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: { password: true },
required: true,
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
'x-api-key': '={{$credentials.apiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://api.example.com/v2',
url: '/v1/user',
},
};
}

View File

@@ -0,0 +1,50 @@
import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class ExampleApi implements ICredentialType {
name = 'exampleApi';
displayName = 'Example API';
// Link to your community node's README
documentationUrl = 'https://github.com/org/repo?tab=readme-ov-file#credentials';
properties: INodeProperties[] = [
{
displayName: 'Username',
name: 'username',
type: 'string',
default: '',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
typeOptions: {
password: true,
},
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
auth: {
username: '={{$credentials.username}}',
password: '={{$credentials.password}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://api.example.com/v2',
url: '/v1/user',
},
};
}

View File

@@ -0,0 +1,42 @@
import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class ExampleApi implements ICredentialType {
name = 'exampleApi';
displayName = 'Example API';
// Link to your community node's README
documentationUrl = 'https://github.com/org/repo?tab=readme-ov-file#credentials';
properties: INodeProperties[] = [
{
displayName: 'Access Token',
name: 'accessToken',
type: 'string',
typeOptions: { password: true },
required: true,
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
Authorization: '=Bearer {{$credentials.accessToken}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://api.example.com/v2',
url: '/v1/user',
},
};
}

View File

@@ -0,0 +1,48 @@
import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class ExampleApi implements ICredentialType {
name = 'exampleApi';
displayName = 'Example API';
// Link to your community node's README
documentationUrl = 'https://github.com/org/repo?tab=readme-ov-file#credentials';
properties: INodeProperties[] = [
{
displayName: 'Access Token',
name: 'accessToken',
type: 'string',
typeOptions: { password: true },
required: true,
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
body: {
token: '={{$credentials.accessToken}}',
},
qs: {
token: '={{$credentials.accessToken}}',
},
headers: {
Authorization: '=Bearer {{$credentials.accessToken}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://api.example.com/v2',
url: '/v1/user',
},
};
}

View File

@@ -0,0 +1,51 @@
import type { ICredentialType, INodeProperties } from 'n8n-workflow';
export class ExampleOAuth2Api implements ICredentialType {
name = 'exampleOAuth2Api';
extends = ['oAuth2Api'];
displayName = 'Example OAuth2 API';
// Link to your community node's README
documentationUrl = 'https://github.com/org/repo?tab=readme-ov-file#credentials';
properties: INodeProperties[] = [
{
displayName: 'Grant Type',
name: 'grantType',
type: 'hidden',
default: 'authorizationCode',
},
{
displayName: 'Authorization URL',
name: 'authUrl',
type: 'hidden',
default: 'https://api.example.com/oauth/authorize',
},
{
displayName: 'Access Token URL',
name: 'accessTokenUrl',
type: 'hidden',
default: 'https://api.example.com/oauth/token',
},
{
displayName: 'Auth URI Query Parameters',
name: 'authQueryParameters',
type: 'hidden',
default: '',
},
{
displayName: 'Scope',
name: 'scope',
type: 'hidden',
default: 'users:read users:write companies:read',
},
{
displayName: 'Authentication',
name: 'authentication',
type: 'hidden',
default: 'header',
},
];
}

View File

@@ -0,0 +1,45 @@
import type { ICredentialType, INodeProperties } from 'n8n-workflow';
export class ExampleOAuth2Api implements ICredentialType {
name = 'exampleOAuth2Api';
extends = ['oAuth2Api'];
displayName = 'Example OAuth2 API';
// Link to your community node's README
documentationUrl = 'https://github.com/org/repo?tab=readme-ov-file#credentials';
properties: INodeProperties[] = [
{
displayName: 'Grant Type',
name: 'grantType',
type: 'hidden',
default: 'clientCredentials',
},
{
displayName: 'Access Token URL',
name: 'accessTokenUrl',
type: 'hidden',
default: 'https://api.example.com/oauth/token',
},
{
displayName: 'Auth URI Query Parameters',
name: 'authQueryParameters',
type: 'hidden',
default: '',
},
{
displayName: 'Scope',
name: 'scope',
type: 'hidden',
default: 'users:read users:write companies:read',
},
{
displayName: 'Authentication',
name: 'authentication',
type: 'hidden',
default: 'body',
},
];
}