mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 17:14:05 -08:00
a11b00a037
* Implements Magento Auth API Test * Deletes unit tests * Fixed lint issues and changed the URI for the credential test * ⚡ Move credential verification to the credential file * ⚡ Simplify code Co-authored-by: paolo-rechia <paolo@e-bot7.com> Co-authored-by: ricardo <ricardoespinoza105@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
38 lines
695 B
TypeScript
38 lines
695 B
TypeScript
import {
|
|
IAuthenticateBearer,
|
|
ICredentialTestRequest,
|
|
ICredentialType,
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export class Magento2Api implements ICredentialType {
|
|
name = 'magento2Api';
|
|
displayName = 'Magento 2 API';
|
|
documentationUrl = 'magento2';
|
|
properties: INodeProperties[] = [
|
|
{
|
|
displayName: 'Host',
|
|
name: 'host',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Access Token',
|
|
name: 'accessToken',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
];
|
|
test: ICredentialTestRequest = {
|
|
request: {
|
|
baseURL: '={{$credentials.host}}',
|
|
url: '/rest/default/V1/modules',
|
|
},
|
|
};
|
|
|
|
authenticate = {
|
|
type: 'bearer',
|
|
properties: {},
|
|
} as IAuthenticateBearer;
|
|
}
|