@lowdefy/connection-elasticsearch 0.0.0-experimental-20251010122007 → 0.0.0-experimental-20251015143743

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,533 +0,0 @@
1
- <TITLE>
2
- Elasticsearch
3
- </TITLE>
4
-
5
- <DESCRIPTION>
6
-
7
- [`Elasticsearch`](https://www.elastic.co/elasticsearch/) is a distributed, RESTful search and analytics engine capable of addressing a growing number of use cases. As the heart of the Elastic Stack, it centrally stores your data for lightning fast search, fine‑tuned relevancy, and powerful analytics that scale with ease.
8
-
9
- The Elasticsearch connection can be used to search for documents in your Elasticsearch cluster. Lowdefy integrates with Elasticsearch using the official [Node.js client from Elastic Co.](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/introduction.html), and provides direct access to the full query DSL supported by Elasticsearch.
10
-
11
- ### Properties
12
-
13
- - `node: string|string[]`: __Required__ - Elasticsearch node(s) to connect to.
14
- - `index: string`: The default index to query. You can also provide a per-request index to override this setting.
15
- - `auth: BasicAuth|CloudAuth`: The authentication data as an object, containing either basic auth credentials (as `username` and `password`), an API key (as `apiKey`), or Elastic Cloud credentials.
16
- - `maxRetries: number`: Max number of retries for each request.
17
- - `requestTimeout: number`: Max request timeout in milliseconds for each request.
18
-
19
- The connection accepts many more advanced configuration options. They will be passed to the Elasticsearch client verbatim, so check out the [configuration instructions](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/basic-config.html) provided by Elastic.
20
-
21
- </DESCRIPTION>
22
-
23
- <REQUESTS>
24
-
25
- - ElasticsearchDelete
26
- - ElasticsearchDeleteByQuery
27
- - ElasticsearchIndex
28
- - ElasticsearchSearch
29
- - ElasticsearchUpdate
30
- - ElasticsearchUpdateByQuery
31
-
32
- </REQUESTS>
33
-
34
- <SCHEMA>
35
-
36
- ```js
37
- export default {
38
- $schema: 'http://json-schema.org/draft-07/schema#',
39
- title: 'Lowdefy Connection Schema - Elasticsearch',
40
- type: 'object',
41
- properties: {
42
- node: {
43
- description:
44
- 'The Elasticsearch endpoint to use. It can be a single string, an array of strings, or an object (or an array of objects) that represents the node',
45
- examples: ['http://localhost:9200', 'https://your.node.company.tld:443'],
46
- anyOf: [
47
- {
48
- items: {
49
- type: 'string',
50
- format: 'uri',
51
- pattern: '^(https?)://',
52
- },
53
- type: 'array',
54
- },
55
- {
56
- $ref: '#/definitions/NodeOptions',
57
- },
58
- {
59
- items: {
60
- $ref: '#/definitions/NodeOptions',
61
- },
62
- type: 'array',
63
- },
64
- {
65
- type: 'string',
66
- format: 'uri',
67
- pattern: '^(https?)://',
68
- },
69
- ],
70
- },
71
- nodes: {
72
- description:
73
- 'The Elasticsearch endpoint to use. It can be a single string, an array of strings, or an object (or an array of objects) that represents the node',
74
- examples: [
75
- {
76
- url: 'http://localhost:9200',
77
- ssl: 'ssl options',
78
- agent: 'http agent options',
79
- id: 'custom node id',
80
- headers: {
81
- 'X-Foo': 'Bar',
82
- },
83
- roles: {
84
- master: true,
85
- data: true,
86
- ingest: true,
87
- ml: false,
88
- },
89
- },
90
- 'http://localhost:9200',
91
- 'https://your.node.company.tld:443',
92
- ],
93
- anyOf: [
94
- {
95
- items: {
96
- type: 'string',
97
- format: 'uri',
98
- pattern: '^(https?)://',
99
- },
100
- type: 'array',
101
- },
102
- {
103
- $ref: '#/definitions/NodeOptions',
104
- },
105
- {
106
- items: {
107
- $ref: '#/definitions/NodeOptions',
108
- },
109
- type: 'array',
110
- },
111
- {
112
- type: 'string',
113
- format: 'uri',
114
- pattern: '^(https?)://',
115
- },
116
- ],
117
- },
118
- index: {
119
- description: 'Default index to use for requests.',
120
- type: 'string',
121
- },
122
- auth: {
123
- description: 'Your authentication data. You can use both basic authentication and ApiKey.',
124
- examples: [
125
- {
126
- username: 'elastic',
127
- password: 'changeMe',
128
- },
129
- {
130
- apiKey: 'base64EncodedApiKey',
131
- },
132
- ],
133
- anyOf: [
134
- {
135
- $ref: '#/definitions/ApiKeyAuth',
136
- },
137
- {
138
- $ref: '#/definitions/BasicAuth',
139
- },
140
- ],
141
- errorMessage: {
142
- anyOf:
143
- 'Elasticsearch connection property "auth" should be an object containing credentials',
144
- },
145
- },
146
- maxRetries: {
147
- description: 'Max number of retries for each request.',
148
- type: 'number',
149
- default: 3,
150
- minimum: 0,
151
- },
152
- requestTimeout: {
153
- description: 'Max request timeout in milliseconds for each request.',
154
- type: 'number',
155
- default: 30000,
156
- exclusiveMinimum: 0,
157
- },
158
- pingTimeout: {
159
- description: 'Max ping request timeout in milliseconds for each request.',
160
- type: 'number',
161
- default: 3000,
162
- exclusiveMinimum: 0,
163
- },
164
- sniffInterval: {
165
- description:
166
- 'Perform a sniff operation every n milliseconds. Sniffing might not be the best solution for you, take a look here to know more: https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how',
167
- type: ['number', 'boolean'],
168
- default: false,
169
- },
170
- sniffOnStart: {
171
- description:
172
- 'Perform a sniff once the client is started. Sniffing might not be the best solution for you, take a look here to know more: https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how',
173
- type: 'boolean',
174
- },
175
- sniffEndpoint: {
176
- description: 'Endpoint to ping during a sniff.',
177
- type: 'string',
178
- default: '_nodes/_all/http',
179
- },
180
- sniffOnConnectionFault: {
181
- description:
182
- 'Perform a sniff on connection fault. Sniffing might not be the best solution for you, take a look here to know more: https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how',
183
- type: 'boolean',
184
- default: false,
185
- },
186
- resurrectStrategy: {
187
- description: 'Configure the node resurrection strategy.',
188
- enum: ['none', 'optimistic', 'ping'],
189
- type: 'string',
190
- default: 'ping',
191
- },
192
- suggestCompression: {
193
- description: 'Adds accept-encoding header to every request.',
194
- type: 'boolean',
195
- default: false,
196
- },
197
- compression: {
198
- description: 'Enables gzip request body compression.',
199
- enum: ['gzip'],
200
- type: ['string', 'boolean'],
201
- default: false,
202
- },
203
- ssl: {
204
- $ref: '#/definitions/ConnectionOptions',
205
- },
206
- proxy: {
207
- description:
208
- 'If you are using an http(s) proxy, you can put its url here. The client will automatically handle the connection to it.',
209
- type: 'string',
210
- format: 'uri',
211
- pattern: '^(https?)://',
212
- examples: ['http://localhost:8080', 'http://user:pwd@localhost:8080'],
213
- default: null,
214
- },
215
- agent: {
216
- description:
217
- 'HTTP agent options. If you want to disable the HTTP agent use entirely (and disable the `keep-alive` feature), set the agent to `false`. See https://nodejs.org/api/http.html#http_new_agent_options.',
218
- default: null,
219
- examples: [
220
- {
221
- agent: 'options',
222
- },
223
- {
224
- agent: false,
225
- },
226
- ],
227
- anyOf: [
228
- {
229
- $ref: '#/definitions/AgentOptions',
230
- },
231
- {
232
- enum: [false],
233
- type: 'boolean',
234
- },
235
- {
236
- type: 'object',
237
- },
238
- ],
239
- },
240
- name: {
241
- description: 'The name to identify the client instance in the events.',
242
- type: 'string',
243
- default: 'elasticsearch-js',
244
- },
245
- opaqueIdPrefix: {
246
- description:
247
- 'A string that will be use to prefix any X-Opaque-Id header. See https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/observability.html#x-opaque-id_support[X-Opaque-Id support] for more details.',
248
- default: null,
249
- type: 'string',
250
- },
251
- headers: {
252
- description: 'A set of custom headers to send in every request.',
253
- examples: [
254
- {
255
- 'X-Foo': 'Bar',
256
- },
257
- ],
258
- type: 'object',
259
- default: {},
260
- },
261
- context: {
262
- description:
263
- 'A custom object that you can use for observability in your events. It will be merged with the API level context option.',
264
- type: 'object',
265
- default: null,
266
- },
267
- enableMetaHeader: {
268
- description:
269
- "If true, adds an header named 'x-elastic-client-meta', containing some minimal telemetry data, such as the client and platform version.",
270
- type: 'boolean',
271
- default: true,
272
- },
273
- cloud: {
274
- description:
275
- 'Custom configuration for connecting to Elastic Cloud. See Authentication for more details: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/auth-reference.html',
276
- examples: [
277
- {
278
- id: 'name:bG9jYWxob3N0JGFiY2QkZWZnaA==',
279
- },
280
- ],
281
- properties: {
282
- id: {
283
- type: 'string',
284
- },
285
- password: {
286
- type: 'string',
287
- },
288
- username: {
289
- type: 'string',
290
- },
291
- },
292
- type: 'object',
293
- default: null,
294
- },
295
- disablePrototypePoisoningProtection: {
296
- description:
297
- 'By the default the client will protect you against prototype poisoning attacks. If needed you can disable prototype poisoning protection entirely or one of the two checks. Read the `secure-json-parse` documentation to learn more: https://github.com/fastify/secure-json-parse',
298
- enum: ['constructor', false, 'proto', true],
299
- default: false,
300
- },
301
- read: {
302
- type: 'boolean',
303
- default: true,
304
- description: 'Allow reads from the Elasticsearch index.',
305
- errorMessage: {
306
- type: 'Elasticsearch connection property "read" should be a boolean.',
307
- },
308
- },
309
- write: {
310
- type: 'boolean',
311
- default: false,
312
- description: 'Allow writes to the Elasticsearch index.',
313
- errorMessage: {
314
- type: 'Elasticsearch connection property "write" should be a boolean.',
315
- },
316
- },
317
- },
318
- definitions: {
319
- AgentOptions: {
320
- description: 'Set of configurable options to set on the agent.',
321
- properties: {
322
- keepAlive: {
323
- description:
324
- 'Keep sockets around even when there are no outstanding requests, so they can be used for future requests without having to reestablish a TCP connection. Not to be confused with the `keep-alive` value of the `Connection` header. The `Connection: keep-alive` header is always sent when using an agent except when the `Connection` header is explicitly specified or when the `keepAlive` and `maxSockets` options are respectively set to `false` and `Infinity`, in which case `Connection: close` will be used.',
325
- default: false,
326
- type: 'boolean',
327
- },
328
- keepAliveMsecs: {
329
- description:
330
- 'When using the `keepAlive` option, specifies the initial delay for TCP Keep-Alive packets. Ignored when the `keepAlive` option is `false` or `undefined`',
331
- type: 'number',
332
- default: 1000,
333
- },
334
- maxFreeSockets: {
335
- description:
336
- 'Maximum number of sockets to leave open in a free state. Only relevant if `keepAlive` is set to `true`',
337
- type: 'number',
338
- default: 256,
339
- },
340
- maxSockets: {
341
- description:
342
- 'Maximum number of sockets to allow per host. If the same host opens multiple concurrent connections, each request will use new socket until the `maxSockets` value is reached. If the host attempts to open more connections than `maxSockets`, the additional requests will enter into a pending request queue, and will enter active connection state when an existing connection terminates. This makes sure there are at most maxSockets active connections at any point in time, from a given host.',
343
- type: 'number',
344
- default: 'Infinity',
345
- },
346
- },
347
- type: 'object',
348
- },
349
- ApiKeyAuth: {
350
- description:
351
- 'The apiKey parameter can be either a base64 encoded string or an object with the values that you can obtain from the create api key endpoint. If you provide both basic authentication credentials and the ApiKey configuration, the ApiKey takes precedence.',
352
- properties: {
353
- apiKey: {
354
- anyOf: [
355
- {
356
- properties: {
357
- api_key: {
358
- type: 'string',
359
- },
360
- id: {
361
- type: 'string',
362
- },
363
- },
364
- type: 'object',
365
- },
366
- {
367
- type: 'string',
368
- },
369
- ],
370
- errorMessage: {
371
- anyOf:
372
- 'Elasticsearch API key should be specified as a string, or an object containing Elasticsearch cloud credentials',
373
- },
374
- },
375
- },
376
- required: ['apiKey'],
377
- type: 'object',
378
- },
379
- BasicAuth: {
380
- properties: {
381
- password: {
382
- type: 'string',
383
- },
384
- username: {
385
- type: 'string',
386
- },
387
- },
388
- required: ['username'],
389
- type: 'object',
390
- errorMessage: {
391
- required: 'Elasticsearch basic auth credentials must consist of at least a username',
392
- },
393
- },
394
- ConnectionOptions: {
395
- description:
396
- 'http.SecureContextOptions - See node.js SSL configuration: https://nodejs.org/api/tls.html',
397
- type: 'object',
398
- default: null,
399
- },
400
- NodeOptions: {
401
- examples: [
402
- {
403
- url: 'http://localhost:9200',
404
- ssl: 'ssl options',
405
- agent: 'http agent options',
406
- id: 'custom node id',
407
- headers: {
408
- 'X-Foo': 'Bar',
409
- },
410
- roles: {
411
- master: true,
412
- data: true,
413
- ingest: true,
414
- ml: false,
415
- },
416
- },
417
- ],
418
- properties: {
419
- agent: {
420
- $ref: '#/definitions/AgentOptions',
421
- },
422
- headers: {
423
- type: 'object',
424
- examples: [
425
- {
426
- 'X-Foo': 'Bar',
427
- },
428
- ],
429
- },
430
- id: {
431
- type: 'string',
432
- },
433
- roles: {
434
- properties: {
435
- data: {
436
- type: 'boolean',
437
- },
438
- ingest: {
439
- type: 'boolean',
440
- },
441
- master: {
442
- type: 'boolean',
443
- },
444
- ml: {
445
- type: 'boolean',
446
- },
447
- },
448
- type: 'object',
449
- },
450
- ssl: {
451
- $ref: '#/definitions/ConnectionOptions',
452
- },
453
- url: {
454
- type: 'string',
455
- format: 'uri',
456
- pattern: '^(https?)://',
457
- },
458
- },
459
- type: 'object',
460
- },
461
- },
462
- oneOf: [
463
- {
464
- required: ['node'],
465
- },
466
- {
467
- required: ['nodes'],
468
- },
469
- ],
470
- errorMessage: {
471
- type: 'Elasticsearch connection properties should be an object.',
472
- oneOf: 'Elasticsearch connection should have required property "node" or "nodes".',
473
- properties: {
474
- maxRetries: 'Elasticsearch connection "maxRetries" should be 0 or greater',
475
- requestTimeout: 'Elasticsearch connection "requestTimeout" should be 1 or greater',
476
- pingTimeout: 'Elasticsearch connection "pingTimeout" should be 1 or greater',
477
- index: 'Elasticsearch connection property "index" should be a string',
478
- },
479
- },
480
- };
481
- ```
482
-
483
- </SCHEMA>
484
-
485
- <EXAMPLES>
486
-
487
- ### Authenticated connection with reads and writes
488
-
489
- ```yaml
490
- connections:
491
- - id: elasticsearch
492
- type: Elasticsearch
493
- properties:
494
- write: true
495
- node:
496
- _secret: ELASTICSEARCH_HOST
497
- auth:
498
- username:
499
- _secret: ELASTICSEARCH_USER
500
- password:
501
- _secret: ELASTICSEARCH_PASSWORD
502
- ```
503
-
504
- Environment variables:
505
-
506
- ```
507
- LOWDEFY_SECRET_ELASTICSEARCH_HOST = http://localhost:9200
508
- LOWDEFY_SECRET_ELASTICSEARCH_USER = es
509
- LOWDEFY_SECRET_ELASTICSEARCH_PASSWORD = password
510
- ```
511
-
512
- ### Unauthenticated connection with default index
513
-
514
- ```yaml
515
- connections:
516
- - id: elasticsearch
517
- type: Elasticsearch
518
- properties:
519
- write: true
520
- node:
521
- _secret: ELASTICSEARCH_HOST
522
- index:
523
- _secret: ELASTICSEARCH_INDEX
524
- ```
525
-
526
- Environment variables:
527
-
528
- ```
529
- LOWDEFY_SECRET_ELASTICSEARCH_HOST = http://localhost:9200
530
- LOWDEFY_SECRET_ELASTICSEARCH_INDEX = articles
531
- ```
532
-
533
- </EXAMPLES>