import { ICredentialType, INodeProperties, IAuthenticateGeneric, IHttpRequestMethods, } from 'n8n-workflow'; export class PexelsApi implements ICredentialType { name = 'pexelsApi'; displayName = 'Pexels API'; documentationUrl = 'https://dps.media/node-n8n-cho-pexels-tu-dong-hoa-tim-kiem-anh-va-video-mien-phi/'; properties: INodeProperties[] = [ { displayName: 'API Key', name: 'apiKey', type: 'string', typeOptions: { password: true, }, default: '', description: 'Your Pexels API key. Get it from https://dps.media/node-n8n-cho-pexels-tu-dong-hoa-tim-kiem-anh-va-video-mien-phi/', }, { displayName: 'Base URL', name: 'baseUrl', type: 'string', default: 'https://api.pexels.com', description: 'API root URL. Override only if Pexels changes the default endpoint', }, ]; authenticate: IAuthenticateGeneric = { type: 'generic', properties: { headers: { Authorization: '={{$credentials.apiKey}}', }, }, }; test = { request: { method: 'GET' as IHttpRequestMethods, baseURL: '={{$credentials.baseUrl}}', url: '/v1/curated?per_page=1', }, }; }