Merge pull request #17 from n8n-io/more-general-improvements
More general improvements
This commit is contained in:
commit
71f3e518d7
10 changed files with 66 additions and 145 deletions
|
|
@ -1,22 +1,27 @@
|
|||
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, NodePropertyTypes } from 'n8n-workflow';
|
||||
import {
|
||||
IAuthenticateGeneric,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class ExampleCredentials implements ICredentialType {
|
||||
name = 'exampleCredentials';
|
||||
displayName = 'Example Credentials';
|
||||
properties = [
|
||||
export class ExampleCredentialsApi implements ICredentialType {
|
||||
name = 'exampleCredentialsApi';
|
||||
displayName = 'Example Credentials API';
|
||||
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' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Password',
|
||||
name: 'password',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
password: true,
|
||||
},
|
||||
|
|
@ -27,7 +32,7 @@ export class ExampleCredentials implements ICredentialType {
|
|||
// 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 = {
|
||||
authenticate: IAuthenticateGeneric = {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
auth: {
|
||||
|
|
@ -37,9 +42,9 @@ export class ExampleCredentials implements ICredentialType {
|
|||
qs: {
|
||||
// Send this as part of the query string
|
||||
n8n: 'rocks',
|
||||
}
|
||||
},
|
||||
},
|
||||
} as IAuthenticateGeneric;
|
||||
};
|
||||
|
||||
// The block below tells how this credential can be tested
|
||||
test: ICredentialTestRequest = {
|
||||
Loading…
Add table
Add a link
Reference in a new issue