UNPKG

@traien/n8n-nodes-espocrm

Version:
85 lines 2.74 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EspoCRMApi = void 0; class EspoCRMApi { constructor() { this.name = 'espoCRMApi'; this.displayName = 'EspoCRM API'; this.documentationUrl = 'https://docs.espocrm.com/development/api/'; this.properties = [ { displayName: 'Base URL', name: 'baseUrl', type: 'string', default: '', placeholder: 'https://example.espocrm.com', required: true, description: 'The base URL of your EspoCRM instance', }, { displayName: 'Authentication Type', name: 'authType', type: 'options', options: [ { name: 'API Key', value: 'apiKey', }, { name: 'HMAC', value: 'hmac', }, ], default: 'apiKey', description: 'The authentication method to use', }, { displayName: 'API Key', name: 'apiKey', type: 'string', typeOptions: { password: true }, default: '', required: true, displayOptions: { show: { authType: ['apiKey', 'hmac'], }, }, description: 'The API Key for your EspoCRM account', }, { displayName: 'Secret Key', name: 'secretKey', type: 'string', default: '', required: true, typeOptions: { password: true, }, displayOptions: { show: { authType: ['hmac'], }, }, description: 'The Secret Key for HMAC authentication', }, ]; this.authenticate = { type: 'generic', properties: { headers: { 'X-Api-Key': '={{$credentials.authType === "apiKey" ? $credentials.apiKey : undefined}}', }, }, }; this.test = { request: { baseURL: '={{$credentials.baseUrl}}/api/v1', url: '/App/user', method: 'GET', }, }; } } exports.EspoCRMApi = EspoCRMApi; //# sourceMappingURL=EspoCRMApi.credentials.js.map