@backstage/plugin-search-backend-module-elasticsearch 1.8.4 → 1.8.5-next.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @backstage/plugin-search-backend-module-elasticsearch
2
2
 
3
+ ## 1.8.5-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/plugin-search-backend-node@1.4.6-next.0
9
+ - @backstage/backend-plugin-api@1.9.3-next.0
10
+
3
11
  ## 1.8.4
4
12
 
5
13
  ### Patch Changes
@@ -0,0 +1,636 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "search": {
6
+ "type": "object",
7
+ "properties": {
8
+ "elasticsearch": {
9
+ "anyOf": [
10
+ {
11
+ "type": "object",
12
+ "properties": {
13
+ "provider": {
14
+ "type": "string",
15
+ "const": "elastic"
16
+ },
17
+ "cloudId": {
18
+ "type": "string",
19
+ "description": "Elastic.co CloudID See: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#authentication"
20
+ },
21
+ "auth": {
22
+ "type": "object",
23
+ "properties": {
24
+ "username": {
25
+ "type": "string"
26
+ },
27
+ "password": {
28
+ "type": "string",
29
+ "visibility": "secret"
30
+ }
31
+ },
32
+ "required": [
33
+ "username",
34
+ "password"
35
+ ]
36
+ },
37
+ "indexPrefix": {
38
+ "type": "string",
39
+ "description": "Prefix to be used for all index creation. Value will be put in front of the index as is."
40
+ },
41
+ "batchSize": {
42
+ "type": "number",
43
+ "description": "Batch size for elastic search indexing tasks. Defaults to 1000."
44
+ },
45
+ "batchKeyField": {
46
+ "type": "string",
47
+ "description": "Defines the name of the field in each document that will be used to identify documents during a batch upload. If not provided, a custom ID will be generated for each document."
48
+ },
49
+ "highlightOptions": {
50
+ "type": "object",
51
+ "properties": {
52
+ "fragmentSize": {
53
+ "type": "number",
54
+ "description": "The size of the highlighted fragment in characters. Defaults to 1000."
55
+ },
56
+ "numFragments": {
57
+ "type": "number",
58
+ "description": "Number of result fragments to extract. Fragments will be concatenated with `fragmentDelimiter`. Defaults to 1."
59
+ },
60
+ "fragmentDelimiter": {
61
+ "type": "string",
62
+ "description": "Delimiter string used to concatenate fragments. Defaults to \" ... \"."
63
+ }
64
+ },
65
+ "description": "Options for configuring highlight settings See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/highlighting.html"
66
+ },
67
+ "queryOptions": {
68
+ "type": "object",
69
+ "properties": {
70
+ "fuzziness": {
71
+ "anyOf": [
72
+ {
73
+ "type": "string",
74
+ "const": "AUTO"
75
+ },
76
+ {
77
+ "type": "number"
78
+ }
79
+ ],
80
+ "description": "Fuzziness allows you to define the maximum Levenshtein distance for fuzzy queries, which determines how many single-character edits (insertions, deletions, substitutions) are allowed for a term to be considered a match.\n\n- 'AUTO': Automatically determines the fuzziness level based on the length of the term. This is the default and widely accepted standard.\n- number: Specifies a fixed fuzziness level. For example, a value of 1 allows for one edit.\n\nExample:\n- For a term \"apple\" with fuzziness set to 1, queries like \"aple\" or \"apply\" would match."
81
+ },
82
+ "prefixLength": {
83
+ "type": "number",
84
+ "description": "Minimum number of characters that must match exactly at the beginning of the query. Defaults to 0."
85
+ }
86
+ }
87
+ },
88
+ "indexTemplates": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "object",
92
+ "properties": {
93
+ "name": {
94
+ "type": "string"
95
+ },
96
+ "body": {
97
+ "type": "object",
98
+ "properties": {
99
+ "index_patterns": {
100
+ "type": "array",
101
+ "items": {
102
+ "type": "string"
103
+ },
104
+ "description": "Array of wildcard (*) expressions used to match the names of data streams and indices during creation."
105
+ },
106
+ "composed_of": {
107
+ "type": "array",
108
+ "items": {
109
+ "type": "string"
110
+ },
111
+ "description": "An ordered list of component template names. Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence."
112
+ },
113
+ "template": {
114
+ "type": "object",
115
+ "additionalProperties": {},
116
+ "description": "See available properties of template https://www.elastic.co/guide/en/elasticsearch/reference/7.15/indices-put-template.html#put-index-template-api-request-body"
117
+ }
118
+ },
119
+ "required": [
120
+ "index_patterns"
121
+ ]
122
+ }
123
+ },
124
+ "required": [
125
+ "name",
126
+ "body"
127
+ ]
128
+ },
129
+ "description": "Elasticsearch specific index template bodies"
130
+ },
131
+ "clientOptions": {
132
+ "type": "object",
133
+ "properties": {
134
+ "ssl": {
135
+ "type": "object",
136
+ "properties": {
137
+ "rejectUnauthorized": {
138
+ "type": "boolean",
139
+ "description": "If true the server will reject any connection which is not authorized with the list of supplied CAs.",
140
+ "default": true
141
+ }
142
+ }
143
+ }
144
+ },
145
+ "description": "Miscellaneous options for the client"
146
+ }
147
+ },
148
+ "required": [
149
+ "auth",
150
+ "cloudId",
151
+ "provider"
152
+ ]
153
+ },
154
+ {
155
+ "type": "object",
156
+ "properties": {
157
+ "provider": {
158
+ "type": "string",
159
+ "const": "aws"
160
+ },
161
+ "node": {
162
+ "type": "string",
163
+ "description": "Node configuration. URL AWS ES endpoint to connect to. Eg. https://my-es-cluster.eu-west-1.es.amazonaws.com"
164
+ },
165
+ "region": {
166
+ "type": "string",
167
+ "description": "The AWS region. Only needed if using a custom DNS record."
168
+ },
169
+ "service": {
170
+ "type": "string",
171
+ "enum": [
172
+ "es",
173
+ "aoss"
174
+ ],
175
+ "description": "The AWS service used for request signature. Either 'es' for \"Managed Clusters\" or 'aoss' for \"Serverless\". Only needed if using a custom DNS record."
176
+ },
177
+ "indexPrefix": {
178
+ "type": "string",
179
+ "description": "Prefix to be used for all index creation. Value will be put in front of the index as is."
180
+ },
181
+ "batchSize": {
182
+ "type": "number",
183
+ "description": "Batch size for elastic search indexing tasks. Defaults to 1000."
184
+ },
185
+ "batchKeyField": {
186
+ "type": "string",
187
+ "description": "Defines the name of the field in each document that will be used to identify documents during a batch upload. If not provided, a custom ID will be generated for each document."
188
+ },
189
+ "highlightOptions": {
190
+ "type": "object",
191
+ "properties": {
192
+ "fragmentSize": {
193
+ "type": "number",
194
+ "description": "The size of the highlighted fragment in characters. Defaults to 1000."
195
+ },
196
+ "numFragments": {
197
+ "type": "number",
198
+ "description": "Number of result fragments to extract. Fragments will be concatenated with `fragmentDelimiter`. Defaults to 1."
199
+ },
200
+ "fragmentDelimiter": {
201
+ "type": "string",
202
+ "description": "Delimiter string used to concatenate fragments. Defaults to \" ... \"."
203
+ }
204
+ },
205
+ "description": "Options for configuring highlight settings See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/highlighting.html"
206
+ },
207
+ "queryOptions": {
208
+ "type": "object",
209
+ "properties": {
210
+ "fuzziness": {
211
+ "anyOf": [
212
+ {
213
+ "type": "string",
214
+ "const": "AUTO"
215
+ },
216
+ {
217
+ "type": "number"
218
+ }
219
+ ],
220
+ "description": "Fuzziness allows you to define the maximum Levenshtein distance for fuzzy queries, which determines how many single-character edits (insertions, deletions, substitutions) are allowed for a term to be considered a match.\n\n- 'AUTO': Automatically determines the fuzziness level based on the length of the term. This is the default and widely accepted standard.\n- number: Specifies a fixed fuzziness level. For example, a value of 1 allows for one edit.\n\nExample:\n- For a term \"apple\" with fuzziness set to 1, queries like \"aple\" or \"apply\" would match."
221
+ },
222
+ "prefixLength": {
223
+ "type": "number",
224
+ "description": "Minimum number of characters that must match exactly at the beginning of the query. Defaults to 0."
225
+ }
226
+ }
227
+ },
228
+ "indexTemplates": {
229
+ "type": "array",
230
+ "items": {
231
+ "type": "object",
232
+ "properties": {
233
+ "name": {
234
+ "type": "string"
235
+ },
236
+ "body": {
237
+ "type": "object",
238
+ "properties": {
239
+ "index_patterns": {
240
+ "type": "array",
241
+ "items": {
242
+ "type": "string"
243
+ },
244
+ "description": "Array of wildcard (*) expressions used to match the names of data streams and indices during creation."
245
+ },
246
+ "composed_of": {
247
+ "type": "array",
248
+ "items": {
249
+ "type": "string"
250
+ },
251
+ "description": "An ordered list of component template names. Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence."
252
+ },
253
+ "template": {
254
+ "type": "object",
255
+ "additionalProperties": {},
256
+ "description": "See available properties of template https://www.elastic.co/guide/en/elasticsearch/reference/7.15/indices-put-template.html#put-index-template-api-request-body"
257
+ }
258
+ },
259
+ "required": [
260
+ "index_patterns"
261
+ ]
262
+ }
263
+ },
264
+ "required": [
265
+ "name",
266
+ "body"
267
+ ]
268
+ },
269
+ "description": "Elasticsearch specific index template bodies"
270
+ },
271
+ "clientOptions": {
272
+ "type": "object",
273
+ "properties": {
274
+ "ssl": {
275
+ "type": "object",
276
+ "properties": {
277
+ "rejectUnauthorized": {
278
+ "type": "boolean",
279
+ "description": "If true the server will reject any connection which is not authorized with the list of supplied CAs.",
280
+ "default": true
281
+ }
282
+ }
283
+ }
284
+ },
285
+ "description": "Miscellaneous options for the client"
286
+ }
287
+ },
288
+ "required": [
289
+ "node",
290
+ "provider"
291
+ ]
292
+ },
293
+ {
294
+ "type": "object",
295
+ "properties": {
296
+ "node": {
297
+ "anyOf": [
298
+ {
299
+ "type": "string"
300
+ },
301
+ {
302
+ "type": "array",
303
+ "items": {
304
+ "type": "string"
305
+ }
306
+ }
307
+ ],
308
+ "description": "Node configuration. URL/URLS to ElasticSearch node to connect to. Either direct URL like 'https://localhost:9200' or with credentials like 'https://username:password@localhost:9200'"
309
+ },
310
+ "auth": {
311
+ "anyOf": [
312
+ {
313
+ "type": "object",
314
+ "properties": {
315
+ "username": {
316
+ "type": "string"
317
+ },
318
+ "password": {
319
+ "type": "string",
320
+ "visibility": "secret"
321
+ }
322
+ },
323
+ "required": [
324
+ "username",
325
+ "password"
326
+ ]
327
+ },
328
+ {
329
+ "type": "object",
330
+ "properties": {
331
+ "apiKey": {
332
+ "type": "string",
333
+ "description": "Base64 Encoded API key to be used to connect to the cluster. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html",
334
+ "visibility": "secret"
335
+ }
336
+ },
337
+ "required": [
338
+ "apiKey"
339
+ ]
340
+ }
341
+ ],
342
+ "description": "Authentication credentials for ElasticSearch If both ApiKey/Bearer token and username+password is provided, tokens take precedence"
343
+ },
344
+ "indexPrefix": {
345
+ "type": "string",
346
+ "description": "Prefix to be used for all index creation. Value will be put in front of the index as is."
347
+ },
348
+ "batchSize": {
349
+ "type": "number",
350
+ "description": "Batch size for elastic search indexing tasks. Defaults to 1000."
351
+ },
352
+ "batchKeyField": {
353
+ "type": "string",
354
+ "description": "Defines the name of the field in each document that will be used to identify documents during a batch upload. If not provided, a custom ID will be generated for each document."
355
+ },
356
+ "highlightOptions": {
357
+ "type": "object",
358
+ "properties": {
359
+ "fragmentSize": {
360
+ "type": "number",
361
+ "description": "The size of the highlighted fragment in characters. Defaults to 1000."
362
+ },
363
+ "numFragments": {
364
+ "type": "number",
365
+ "description": "Number of result fragments to extract. Fragments will be concatenated with `fragmentDelimiter`. Defaults to 1."
366
+ },
367
+ "fragmentDelimiter": {
368
+ "type": "string",
369
+ "description": "Delimiter string used to concatenate fragments. Defaults to \" ... \"."
370
+ }
371
+ },
372
+ "description": "Options for configuring highlight settings See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/highlighting.html"
373
+ },
374
+ "queryOptions": {
375
+ "type": "object",
376
+ "properties": {
377
+ "fuzziness": {
378
+ "anyOf": [
379
+ {
380
+ "type": "string",
381
+ "const": "AUTO"
382
+ },
383
+ {
384
+ "type": "number"
385
+ }
386
+ ],
387
+ "description": "Fuzziness allows you to define the maximum Levenshtein distance for fuzzy queries, which determines how many single-character edits (insertions, deletions, substitutions) are allowed for a term to be considered a match.\n\n- 'AUTO': Automatically determines the fuzziness level based on the length of the term. This is the default and widely accepted standard.\n- number: Specifies a fixed fuzziness level. For example, a value of 1 allows for one edit.\n\nExample:\n- For a term \"apple\" with fuzziness set to 1, queries like \"aple\" or \"apply\" would match."
388
+ },
389
+ "prefixLength": {
390
+ "type": "number",
391
+ "description": "Minimum number of characters that must match exactly at the beginning of the query. Defaults to 0."
392
+ }
393
+ }
394
+ },
395
+ "indexTemplates": {
396
+ "type": "array",
397
+ "items": {
398
+ "type": "object",
399
+ "properties": {
400
+ "name": {
401
+ "type": "string"
402
+ },
403
+ "body": {
404
+ "type": "object",
405
+ "properties": {
406
+ "index_patterns": {
407
+ "type": "array",
408
+ "items": {
409
+ "type": "string"
410
+ },
411
+ "description": "Array of wildcard (*) expressions used to match the names of data streams and indices during creation."
412
+ },
413
+ "composed_of": {
414
+ "type": "array",
415
+ "items": {
416
+ "type": "string"
417
+ },
418
+ "description": "An ordered list of component template names. Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence."
419
+ },
420
+ "template": {
421
+ "type": "object",
422
+ "additionalProperties": {},
423
+ "description": "See available properties of template https://www.elastic.co/guide/en/elasticsearch/reference/7.15/indices-put-template.html#put-index-template-api-request-body"
424
+ }
425
+ },
426
+ "required": [
427
+ "index_patterns"
428
+ ]
429
+ }
430
+ },
431
+ "required": [
432
+ "name",
433
+ "body"
434
+ ]
435
+ },
436
+ "description": "Elasticsearch specific index template bodies"
437
+ },
438
+ "clientOptions": {
439
+ "type": "object",
440
+ "properties": {
441
+ "ssl": {
442
+ "type": "object",
443
+ "properties": {
444
+ "rejectUnauthorized": {
445
+ "type": "boolean",
446
+ "description": "If true the server will reject any connection which is not authorized with the list of supplied CAs.",
447
+ "default": true
448
+ }
449
+ }
450
+ }
451
+ },
452
+ "description": "Miscellaneous options for the client"
453
+ }
454
+ },
455
+ "required": [
456
+ "node"
457
+ ]
458
+ },
459
+ {
460
+ "type": "object",
461
+ "properties": {
462
+ "provider": {
463
+ "type": "string",
464
+ "const": "opensearch"
465
+ },
466
+ "node": {
467
+ "anyOf": [
468
+ {
469
+ "type": "string"
470
+ },
471
+ {
472
+ "type": "array",
473
+ "items": {
474
+ "type": "string"
475
+ }
476
+ }
477
+ ],
478
+ "description": "Node configuration. URL/URLS to OpenSearch node to connect to. Either direct URL like 'https://localhost:9200' or with credentials like 'https://username:password@localhost:9200'"
479
+ },
480
+ "auth": {
481
+ "anyOf": [
482
+ {
483
+ "type": "object",
484
+ "properties": {
485
+ "username": {
486
+ "type": "string"
487
+ },
488
+ "password": {
489
+ "type": "string",
490
+ "visibility": "secret"
491
+ }
492
+ },
493
+ "required": [
494
+ "username",
495
+ "password"
496
+ ]
497
+ },
498
+ {
499
+ "type": "object",
500
+ "properties": {
501
+ "apiKey": {
502
+ "type": "string",
503
+ "visibility": "secret"
504
+ }
505
+ },
506
+ "required": [
507
+ "apiKey"
508
+ ]
509
+ }
510
+ ],
511
+ "description": "Authentication credentials for OpenSearch If both ApiKey/Bearer token and username+password is provided, tokens take precedence"
512
+ },
513
+ "indexPrefix": {
514
+ "type": "string",
515
+ "description": "Prefix to be used for all index creation. Value will be put in front of the index as is."
516
+ },
517
+ "batchSize": {
518
+ "type": "number",
519
+ "description": "Batch size for elastic search indexing tasks. Defaults to 1000."
520
+ },
521
+ "batchKeyField": {
522
+ "type": "string",
523
+ "description": "Defines the name of the field in each document that will be used to identify documents during a batch upload. If not provided, a custom ID will be generated for each document."
524
+ },
525
+ "highlightOptions": {
526
+ "type": "object",
527
+ "properties": {
528
+ "fragmentSize": {
529
+ "type": "number",
530
+ "description": "The size of the highlighted fragment in characters. Defaults to 1000."
531
+ },
532
+ "numFragments": {
533
+ "type": "number",
534
+ "description": "Number of result fragments to extract. Fragments will be concatenated with `fragmentDelimiter`. Defaults to 1."
535
+ },
536
+ "fragmentDelimiter": {
537
+ "type": "string",
538
+ "description": "Delimiter string used to concatenate fragments. Defaults to \" ... \"."
539
+ }
540
+ },
541
+ "description": "Options for configuring highlight settings See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/highlighting.html"
542
+ },
543
+ "queryOptions": {
544
+ "type": "object",
545
+ "properties": {
546
+ "fuzziness": {
547
+ "anyOf": [
548
+ {
549
+ "type": "string",
550
+ "const": "AUTO"
551
+ },
552
+ {
553
+ "type": "number"
554
+ }
555
+ ],
556
+ "description": "Fuzziness allows you to define the maximum Levenshtein distance for fuzzy queries, which determines how many single-character edits (insertions, deletions, substitutions) are allowed for a term to be considered a match.\n\n- 'AUTO': Automatically determines the fuzziness level based on the length of the term. This is the default and widely accepted standard.\n- number: Specifies a fixed fuzziness level. For example, a value of 1 allows for one edit.\n\nExample:\n- For a term \"apple\" with fuzziness set to 1, queries like \"aple\" or \"apply\" would match."
557
+ },
558
+ "prefixLength": {
559
+ "type": "number",
560
+ "description": "Minimum number of characters that must match exactly at the beginning of the query. Defaults to 0."
561
+ }
562
+ }
563
+ },
564
+ "indexTemplates": {
565
+ "type": "array",
566
+ "items": {
567
+ "type": "object",
568
+ "properties": {
569
+ "name": {
570
+ "type": "string"
571
+ },
572
+ "body": {
573
+ "type": "object",
574
+ "properties": {
575
+ "index_patterns": {
576
+ "type": "array",
577
+ "items": {
578
+ "type": "string"
579
+ },
580
+ "description": "Array of wildcard (*) expressions used to match the names of data streams and indices during creation."
581
+ },
582
+ "composed_of": {
583
+ "type": "array",
584
+ "items": {
585
+ "type": "string"
586
+ },
587
+ "description": "An ordered list of component template names. Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence."
588
+ },
589
+ "template": {
590
+ "type": "object",
591
+ "additionalProperties": {},
592
+ "description": "See available properties of template https://www.elastic.co/guide/en/elasticsearch/reference/7.15/indices-put-template.html#put-index-template-api-request-body"
593
+ }
594
+ },
595
+ "required": [
596
+ "index_patterns"
597
+ ]
598
+ }
599
+ },
600
+ "required": [
601
+ "name",
602
+ "body"
603
+ ]
604
+ },
605
+ "description": "Elasticsearch specific index template bodies"
606
+ },
607
+ "clientOptions": {
608
+ "type": "object",
609
+ "properties": {
610
+ "ssl": {
611
+ "type": "object",
612
+ "properties": {
613
+ "rejectUnauthorized": {
614
+ "type": "boolean",
615
+ "description": "If true the server will reject any connection which is not authorized with the list of supplied CAs.",
616
+ "default": true
617
+ }
618
+ }
619
+ }
620
+ },
621
+ "description": "Miscellaneous options for the client"
622
+ }
623
+ },
624
+ "required": [
625
+ "node",
626
+ "provider"
627
+ ]
628
+ }
629
+ ],
630
+ "description": "Options for ElasticSearch"
631
+ }
632
+ },
633
+ "description": "Configuration options for the search plugin"
634
+ }
635
+ }
636
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-search-backend-module-elasticsearch",
3
- "version": "1.8.4",
3
+ "version": "1.8.5-next.0",
4
4
  "description": "A module for the search backend that implements search using ElasticSearch",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "files": [
52
52
  "dist",
53
- "config.d.ts"
53
+ "config.schema.json"
54
54
  ],
55
55
  "scripts": {
56
56
  "build": "backstage-cli package build",
@@ -62,11 +62,11 @@
62
62
  "test": "backstage-cli package test"
63
63
  },
64
64
  "dependencies": {
65
- "@backstage/backend-plugin-api": "^1.9.2",
66
- "@backstage/config": "^1.3.8",
67
- "@backstage/integration-aws-node": "^0.2.0",
68
- "@backstage/plugin-search-backend-node": "^1.4.5",
69
- "@backstage/plugin-search-common": "^1.2.24",
65
+ "@backstage/backend-plugin-api": "1.9.3-next.0",
66
+ "@backstage/config": "1.3.8",
67
+ "@backstage/integration-aws-node": "0.2.0",
68
+ "@backstage/plugin-search-backend-node": "1.4.6-next.0",
69
+ "@backstage/plugin-search-common": "1.2.24",
70
70
  "@elastic/elasticsearch": "^7.13.0",
71
71
  "@opensearch-project/opensearch": "^2.2.1",
72
72
  "aws4": "^1.12.0",
@@ -74,11 +74,11 @@
74
74
  "lodash": "^4.17.21"
75
75
  },
76
76
  "devDependencies": {
77
- "@backstage/backend-test-utils": "^1.11.4",
78
- "@backstage/cli": "^0.36.3",
77
+ "@backstage/backend-test-utils": "1.11.5-next.0",
78
+ "@backstage/cli": "0.36.4-next.0",
79
79
  "@elastic/elasticsearch-mock": "^1.0.0",
80
80
  "@short.io/opensearch-mock": "^0.4.0",
81
81
  "@types/aws4": "^1.5.1"
82
82
  },
83
- "configSchema": "config.d.ts"
83
+ "configSchema": "config.schema.json"
84
84
  }
package/config.d.ts DELETED
@@ -1,235 +0,0 @@
1
- /*
2
- * Copyright 2021 The Backstage Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- export interface Config {
18
- /** Configuration options for the search plugin */
19
- search?: {
20
- /**
21
- * Options for ElasticSearch
22
- */
23
- elasticsearch?: {
24
- /**
25
- * Prefix to be used for all index creation. Value will be put in front of the index as is.
26
- */
27
- indexPrefix?: string;
28
- /**
29
- * Batch size for elastic search indexing tasks. Defaults to 1000.
30
- */
31
- batchSize?: number;
32
- /**
33
- * Defines the name of the field in each document that will be used to identify documents during a batch upload.
34
- * If not provided, a custom ID will be generated for each document.
35
- */
36
- batchKeyField?: string;
37
- /**
38
- * Options for configuring highlight settings
39
- * See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/highlighting.html
40
- */
41
- highlightOptions?: {
42
- /**
43
- * The size of the highlighted fragment in characters. Defaults to 1000.
44
- */
45
- fragmentSize?: number;
46
- /**
47
- * Number of result fragments to extract. Fragments will be concatenated with `fragmentDelimiter`. Defaults to 1.
48
- */
49
- numFragments?: number;
50
- /**
51
- * Delimiter string used to concatenate fragments. Defaults to " ... ".
52
- */
53
- fragmentDelimiter?: string;
54
- };
55
- queryOptions?: {
56
- /**
57
- * Fuzziness allows you to define the maximum Levenshtein distance for fuzzy queries,
58
- * which determines how many single-character edits (insertions, deletions, substitutions)
59
- * are allowed for a term to be considered a match.
60
- *
61
- * - 'AUTO': Automatically determines the fuzziness level based on the length of the term.
62
- * This is the default and widely accepted standard.
63
- * - number: Specifies a fixed fuzziness level. For example, a value of 1 allows for one edit.
64
- *
65
- * Example:
66
- * - For a term "apple" with fuzziness set to 1, queries like "aple" or "apply" would match.
67
- */
68
-
69
- fuzziness?: 'AUTO' | number;
70
- /**
71
- * Minimum number of characters that must match exactly at the beginning of the query. Defaults to 0.
72
- */
73
- prefixLength?: number;
74
- };
75
-
76
- /** Elasticsearch specific index template bodies */
77
- indexTemplates?: Array<{
78
- name: string;
79
- body: {
80
- /**
81
- * Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
82
- */
83
- index_patterns: string[];
84
-
85
- /**
86
- * An ordered list of component template names.
87
- * Component templates are merged in the order specified,
88
- * meaning that the last component template specified has the highest precedence.
89
- */
90
- composed_of?: string[];
91
-
92
- /**
93
- * See available properties of template
94
- * https://www.elastic.co/guide/en/elasticsearch/reference/7.15/indices-put-template.html#put-index-template-api-request-body
95
- */
96
- template?: {
97
- [key: string]: unknown;
98
- };
99
- };
100
- }>;
101
-
102
- /** Miscellaneous options for the client */
103
- clientOptions?: {
104
- ssl?: {
105
- /**
106
- * If true the server will reject any connection which is not
107
- * authorized with the list of supplied CAs.
108
- * @default true
109
- */
110
- rejectUnauthorized?: boolean;
111
- };
112
- };
113
- } & (
114
- | {
115
- // elastic = Elastic.co ElasticSearch provider
116
- provider: 'elastic';
117
-
118
- /**
119
- * Elastic.co CloudID
120
- * See: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#authentication
121
- */
122
- cloudId: string;
123
-
124
- auth: {
125
- username: string;
126
-
127
- /**
128
- * @visibility secret
129
- */
130
- password: string;
131
- };
132
- }
133
-
134
- /**
135
- * AWS = Amazon Elasticsearch Service provider
136
- *
137
- * Authentication is handled using the default AWS credentials provider chain
138
- */
139
- | {
140
- provider: 'aws';
141
-
142
- /**
143
- * Node configuration.
144
- * URL AWS ES endpoint to connect to.
145
- * Eg. https://my-es-cluster.eu-west-1.es.amazonaws.com
146
- */
147
- node: string;
148
-
149
- /**
150
- * The AWS region.
151
- * Only needed if using a custom DNS record.
152
- */
153
- region?: string;
154
-
155
- /**
156
- * The AWS service used for request signature.
157
- * Either 'es' for "Managed Clusters" or 'aoss' for "Serverless".
158
- * Only needed if using a custom DNS record.
159
- */
160
- service?: 'es' | 'aoss';
161
- }
162
-
163
- /**
164
- * Standard ElasticSearch
165
- *
166
- * Includes self-hosted clusters and others that provide direct connection via an endpoint
167
- * and authentication method (see possible authentication options below)
168
- */
169
- | {
170
- /**
171
- * Node configuration.
172
- * URL/URLS to ElasticSearch node to connect to.
173
- * Either direct URL like 'https://localhost:9200' or with credentials like 'https://username:password@localhost:9200'
174
- */
175
- node: string | string[];
176
-
177
- /**
178
- * Authentication credentials for ElasticSearch
179
- * If both ApiKey/Bearer token and username+password is provided, tokens take precedence
180
- */
181
- auth?:
182
- | {
183
- username: string;
184
-
185
- /**
186
- * @visibility secret
187
- */
188
- password: string;
189
- }
190
- | {
191
- /**
192
- * Base64 Encoded API key to be used to connect to the cluster.
193
- * See: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
194
- *
195
- * @visibility secret
196
- */
197
- apiKey: string;
198
- };
199
- }
200
-
201
- /**
202
- * AWS = In house hosting Open Search
203
- */
204
- | {
205
- provider: 'opensearch';
206
- /**
207
- * Node configuration.
208
- * URL/URLS to OpenSearch node to connect to.
209
- * Either direct URL like 'https://localhost:9200' or with credentials like 'https://username:password@localhost:9200'
210
- */
211
- node: string | string[];
212
-
213
- /**
214
- * Authentication credentials for OpenSearch
215
- * If both ApiKey/Bearer token and username+password is provided, tokens take precedence
216
- */
217
- auth?:
218
- | {
219
- username: string;
220
-
221
- /**
222
- * @visibility secret
223
- */
224
- password: string;
225
- }
226
- | {
227
- /**
228
- * @visibility secret
229
- */
230
- apiKey: string;
231
- };
232
- }
233
- );
234
- };
235
- }