feat(Elasticsearch Node): Add 'Source Excludes' and 'Source Includes' options on 'Document: getAll' operation (#3660)

* Added 'Source Excludes' and 'Source Includes' options on  'document: getAll' operation

* Updated credentials to use new system

Co-authored-by: mp <miguel@mconf.com>
Co-authored-by: miguel-mconf <107938570+miguel-mconf@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <janober@users.noreply.github.com>
This commit is contained in:
Jonathan Bennetts 2022-07-10 11:11:12 +01:00 committed by GitHub
parent eae9a60a43
commit 8999403228
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 7 deletions

View file

@ -55,10 +55,7 @@ export class ElasticsearchApi implements ICredentialType {
test: ICredentialTestRequest = { test: ICredentialTestRequest = {
request: { request: {
baseURL: '={{$credentials.baseUrl}}', baseURL: '={{$credentials.baseUrl}}',
auth: { url: '/_xpack?human=false',
username: '=${{credentias.username}}',
password: '=${{credentials.password}}',
},
url: '',
}, },
};} };
}

View file

@ -8,6 +8,7 @@ import {
import { import {
IDataObject, IDataObject,
JsonObject,
NodeApiError, NodeApiError,
} from 'n8n-workflow'; } from 'n8n-workflow';
@ -47,6 +48,6 @@ export async function elasticsearchApiRequest(
try { try {
return await this.helpers.requestWithAuthentication.call(this, 'elasticsearchApi', options); return await this.helpers.requestWithAuthentication.call(this, 'elasticsearchApi', options);
} catch (error) { } catch (error) {
throw new NodeApiError(this.getNode(), error); throw new NodeApiError(this.getNode(), error as JsonObject);
} }
} }

View file

@ -444,6 +444,20 @@ export const documentFields: INodeProperties[] = [
type: 'string', type: 'string',
default: '', default: '',
}, },
{
displayName: 'Source Excludes',
name: '_source_excludes',
description: 'Comma-separated list of source fields to exclude from the response',
type: 'string',
default: '',
},
{
displayName: 'Source Includes',
name: '_source_includes',
description: 'Comma-separated list of source fields to include in the response',
type: 'string',
default: '',
},
{ {
displayName: 'Stats', displayName: 'Stats',
name: 'stats', name: 'stats',