mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 09:04:07 -08:00
49 lines
888 B
TypeScript
49 lines
888 B
TypeScript
|
import type {
|
||
|
IAuthenticateGeneric,
|
||
|
ICredentialTestRequest,
|
||
|
ICredentialType,
|
||
|
INodeProperties,
|
||
|
} from 'n8n-workflow';
|
||
|
|
||
|
export class ZepApi implements ICredentialType {
|
||
|
name = 'zepApi';
|
||
|
|
||
|
displayName = 'Zep Api';
|
||
|
|
||
|
documentationUrl = 'zep';
|
||
|
|
||
|
properties: INodeProperties[] = [
|
||
|
{
|
||
|
displayName: 'API URL',
|
||
|
name: 'apiUrl',
|
||
|
required: true,
|
||
|
type: 'string',
|
||
|
default: 'http://localhost:8000',
|
||
|
},
|
||
|
{
|
||
|
displayName: 'API Key',
|
||
|
name: 'apiKey',
|
||
|
type: 'string',
|
||
|
typeOptions: { password: true },
|
||
|
required: false,
|
||
|
default: '',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
authenticate: IAuthenticateGeneric = {
|
||
|
type: 'generic',
|
||
|
properties: {
|
||
|
headers: {
|
||
|
Authorization: '={{$credentials.apiKey ? "Bearer " + $credentials.apiKey : undefined }}',
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
|
||
|
test: ICredentialTestRequest = {
|
||
|
request: {
|
||
|
baseURL: '={{$credentials.apiUrl}}',
|
||
|
url: '/api/v1/collection',
|
||
|
},
|
||
|
};
|
||
|
}
|