@backstage/plugin-search-backend-module-elasticsearch 1.1.4 → 1.2.0-next.1

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,29 @@
1
1
  # @backstage/plugin-search-backend-module-elasticsearch
2
2
 
3
+ ## 1.2.0-next.1
4
+
5
+ ### Minor Changes
6
+
7
+ - 1469daa409e: Search backend modules migrated to the new backend system. For documentation on how to migrate, check out the [how to migrate to the new backend system guide](https://backstage.io/docs/features/search/how-to-guides/#how-to-migrate-your-backend-installation-to-use-search-together-with-the-new-backend-system).
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @backstage/plugin-search-backend-node@1.2.0-next.1
13
+ - @backstage/backend-common@0.18.4-next.1
14
+ - @backstage/backend-plugin-api@0.5.1-next.1
15
+ - @backstage/config@1.0.7
16
+ - @backstage/plugin-search-common@1.2.3-next.0
17
+
18
+ ## 1.1.5-next.0
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+ - @backstage/config@1.0.7
24
+ - @backstage/plugin-search-backend-node@1.1.5-next.0
25
+ - @backstage/plugin-search-common@1.2.2
26
+
3
27
  ## 1.1.4
4
28
 
5
29
  ### Patch Changes
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@backstage/plugin-search-backend-module-elasticsearch",
3
+ "version": "1.2.0-next.1",
4
+ "main": "../dist/alpha.cjs.js",
5
+ "types": "../dist/alpha.d.ts"
6
+ }
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var backendPluginApi = require('@backstage/backend-plugin-api');
6
+ var backendCommon = require('@backstage/backend-common');
7
+ var alpha = require('@backstage/plugin-search-backend-node/alpha');
8
+ var pluginSearchBackendModuleElasticsearch = require('@backstage/plugin-search-backend-module-elasticsearch');
9
+
10
+ const searchModuleElasticsearchEngine = backendPluginApi.createBackendModule(
11
+ (options) => ({
12
+ moduleId: "elasticsearchEngine",
13
+ pluginId: "search",
14
+ register(env) {
15
+ env.registerInit({
16
+ deps: {
17
+ searchEngineRegistry: alpha.searchEngineRegistryExtensionPoint,
18
+ logger: backendPluginApi.coreServices.logger,
19
+ config: backendPluginApi.coreServices.config
20
+ },
21
+ async init({ searchEngineRegistry, logger, config }) {
22
+ const searchEngine = await pluginSearchBackendModuleElasticsearch.ElasticSearchSearchEngine.fromConfig({
23
+ logger: backendCommon.loggerToWinstonLogger(logger),
24
+ config
25
+ });
26
+ if (options == null ? void 0 : options.translator) {
27
+ searchEngine.setTranslator(options.translator);
28
+ }
29
+ if (options == null ? void 0 : options.indexTemplate) {
30
+ searchEngine.setIndexTemplate(options.indexTemplate);
31
+ }
32
+ searchEngineRegistry.setSearchEngine(searchEngine);
33
+ }
34
+ });
35
+ }
36
+ })
37
+ );
38
+
39
+ exports.searchModuleElasticsearchEngine = searchModuleElasticsearchEngine;
40
+ //# sourceMappingURL=alpha.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alpha.cjs.js","sources":["../src/alpha.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { loggerToWinstonLogger } from '@backstage/backend-common';\nimport { searchEngineRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha';\n\nimport {\n ElasticSearchCustomIndexTemplate,\n ElasticSearchQueryTranslator,\n ElasticSearchSearchEngine,\n} from '@backstage/plugin-search-backend-module-elasticsearch';\n\n/**\n * @alpha\n * Options for {@link searchModuleElasticsearchEngine}.\n */\nexport type SearchModuleElasticsearchEngineOptions = {\n translator?: ElasticSearchQueryTranslator;\n indexTemplate?: ElasticSearchCustomIndexTemplate;\n};\n\n/**\n * @alpha\n * Search backend module for the Elasticsearch engine.\n */\nexport const searchModuleElasticsearchEngine = createBackendModule(\n (options?: SearchModuleElasticsearchEngineOptions) => ({\n moduleId: 'elasticsearchEngine',\n pluginId: 'search',\n register(env) {\n env.registerInit({\n deps: {\n searchEngineRegistry: searchEngineRegistryExtensionPoint,\n logger: coreServices.logger,\n config: coreServices.config,\n },\n async init({ searchEngineRegistry, logger, config }) {\n const searchEngine = await ElasticSearchSearchEngine.fromConfig({\n logger: loggerToWinstonLogger(logger),\n config: config,\n });\n\n // set custom translator if available\n if (options?.translator) {\n searchEngine.setTranslator(options.translator);\n }\n\n // set custom index template if available\n if (options?.indexTemplate) {\n searchEngine.setIndexTemplate(options.indexTemplate);\n }\n\n searchEngineRegistry.setSearchEngine(searchEngine);\n },\n });\n },\n }),\n);\n"],"names":["createBackendModule","searchEngineRegistryExtensionPoint","coreServices","ElasticSearchSearchEngine","loggerToWinstonLogger"],"mappings":";;;;;;;;;AAyCO,MAAM,+BAAkC,GAAAA,oCAAA;AAAA,EAC7C,CAAC,OAAsD,MAAA;AAAA,IACrD,QAAU,EAAA,qBAAA;AAAA,IACV,QAAU,EAAA,QAAA;AAAA,IACV,SAAS,GAAK,EAAA;AACZ,MAAA,GAAA,CAAI,YAAa,CAAA;AAAA,QACf,IAAM,EAAA;AAAA,UACJ,oBAAsB,EAAAC,wCAAA;AAAA,UACtB,QAAQC,6BAAa,CAAA,MAAA;AAAA,UACrB,QAAQA,6BAAa,CAAA,MAAA;AAAA,SACvB;AAAA,QACA,MAAM,IAAK,CAAA,EAAE,oBAAsB,EAAA,MAAA,EAAQ,QAAU,EAAA;AACnD,UAAM,MAAA,YAAA,GAAe,MAAMC,gEAAA,CAA0B,UAAW,CAAA;AAAA,YAC9D,MAAA,EAAQC,oCAAsB,MAAM,CAAA;AAAA,YACpC,MAAA;AAAA,WACD,CAAA,CAAA;AAGD,UAAA,IAAI,mCAAS,UAAY,EAAA;AACvB,YAAa,YAAA,CAAA,aAAA,CAAc,QAAQ,UAAU,CAAA,CAAA;AAAA,WAC/C;AAGA,UAAA,IAAI,mCAAS,aAAe,EAAA;AAC1B,YAAa,YAAA,CAAA,gBAAA,CAAiB,QAAQ,aAAa,CAAA,CAAA;AAAA,WACrD;AAEA,UAAA,oBAAA,CAAqB,gBAAgB,YAAY,CAAA,CAAA;AAAA,SACnD;AAAA,OACD,CAAA,CAAA;AAAA,KACH;AAAA,GACF,CAAA;AACF;;;;"}
@@ -0,0 +1,18 @@
1
+ import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
+ import { ElasticSearchQueryTranslator, ElasticSearchCustomIndexTemplate } from '@backstage/plugin-search-backend-module-elasticsearch';
3
+
4
+ /**
5
+ * @alpha
6
+ * Options for {@link searchModuleElasticsearchEngine}.
7
+ */
8
+ declare type SearchModuleElasticsearchEngineOptions = {
9
+ translator?: ElasticSearchQueryTranslator;
10
+ indexTemplate?: ElasticSearchCustomIndexTemplate;
11
+ };
12
+ /**
13
+ * @alpha
14
+ * Search backend module for the Elasticsearch engine.
15
+ */
16
+ declare const searchModuleElasticsearchEngine: (options?: SearchModuleElasticsearchEngineOptions | undefined) => _backstage_backend_plugin_api.BackendFeature;
17
+
18
+ export { SearchModuleElasticsearchEngineOptions, searchModuleElasticsearchEngine };
package/package.json CHANGED
@@ -1,14 +1,25 @@
1
1
  {
2
2
  "name": "@backstage/plugin-search-backend-module-elasticsearch",
3
3
  "description": "A module for the search backend that implements search using ElasticSearch",
4
- "version": "1.1.4",
5
- "main": "dist/index.cjs.js",
6
- "types": "dist/index.d.ts",
4
+ "version": "1.2.0-next.1",
5
+ "main": "./dist/index.cjs.js",
6
+ "types": "./dist/index.d.ts",
7
7
  "license": "Apache-2.0",
8
8
  "publishConfig": {
9
- "access": "public",
10
- "main": "dist/index.cjs.js",
11
- "types": "dist/index.d.ts"
9
+ "access": "public"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "require": "./dist/index.cjs.js",
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.cjs.js"
16
+ },
17
+ "./alpha": {
18
+ "require": "./dist/alpha.cjs.js",
19
+ "types": "./dist/alpha.d.ts",
20
+ "default": "./dist/alpha.cjs.js"
21
+ },
22
+ "./package.json": "./package.json"
12
23
  },
13
24
  "backstage": {
14
25
  "role": "backend-plugin-module"
@@ -23,9 +34,11 @@
23
34
  "clean": "backstage-cli package clean"
24
35
  },
25
36
  "dependencies": {
37
+ "@backstage/backend-common": "^0.18.4-next.1",
38
+ "@backstage/backend-plugin-api": "^0.5.1-next.1",
26
39
  "@backstage/config": "^1.0.7",
27
- "@backstage/plugin-search-backend-node": "^1.1.4",
28
- "@backstage/plugin-search-common": "^1.2.2",
40
+ "@backstage/plugin-search-backend-node": "^1.2.0-next.1",
41
+ "@backstage/plugin-search-common": "^1.2.3-next.0",
29
42
  "@elastic/elasticsearch": "^7.13.0",
30
43
  "@opensearch-project/opensearch": "^2.0.0",
31
44
  "aws-os-connection": "^0.2.0",
@@ -36,14 +49,15 @@
36
49
  "winston": "^3.2.1"
37
50
  },
38
51
  "devDependencies": {
39
- "@backstage/backend-common": "^0.18.3",
40
- "@backstage/cli": "^0.22.4",
52
+ "@backstage/backend-common": "^0.18.4-next.1",
53
+ "@backstage/cli": "^0.22.6-next.1",
41
54
  "@elastic/elasticsearch-mock": "^1.0.0",
42
55
  "@short.io/opensearch-mock": "^0.3.1"
43
56
  },
44
57
  "files": [
45
58
  "dist",
46
- "config.d.ts"
59
+ "config.d.ts",
60
+ "alpha"
47
61
  ],
48
62
  "configSchema": "config.d.ts"
49
63
  }