@backstage/plugin-search-backend-module-elasticsearch 0.0.8 → 0.0.9
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 +10 -0
- package/package.json +17 -14
- package/dist/index.d.ts +0 -138
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @backstage/plugin-search-backend-module-elasticsearch
|
|
2
2
|
|
|
3
|
+
## 0.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
|
8
|
+
- 4c0332e55c: chore(deps-dev): bump `@elastic/elasticsearch-mock` from 0.3.0 to 1.0.0
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/config@0.1.14
|
|
11
|
+
- @backstage/search-common@0.2.3
|
|
12
|
+
|
|
3
13
|
## 0.0.8
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -10,19 +10,22 @@
|
|
|
10
10
|
"main": "dist/index.cjs.js",
|
|
11
11
|
"types": "dist/index.d.ts"
|
|
12
12
|
},
|
|
13
|
+
"backstage": {
|
|
14
|
+
"role": "backend-plugin-module"
|
|
15
|
+
},
|
|
13
16
|
"scripts": {
|
|
14
|
-
"start": "backstage-cli
|
|
15
|
-
"build": "backstage-cli
|
|
16
|
-
"lint": "backstage-cli lint",
|
|
17
|
-
"test": "backstage-cli test",
|
|
18
|
-
"prepack": "backstage-cli prepack",
|
|
19
|
-
"postpack": "backstage-cli postpack",
|
|
20
|
-
"clean": "backstage-cli clean"
|
|
17
|
+
"start": "backstage-cli package start",
|
|
18
|
+
"build": "backstage-cli package build",
|
|
19
|
+
"lint": "backstage-cli package lint",
|
|
20
|
+
"test": "backstage-cli package test",
|
|
21
|
+
"prepack": "backstage-cli package prepack",
|
|
22
|
+
"postpack": "backstage-cli package postpack",
|
|
23
|
+
"clean": "backstage-cli package clean"
|
|
21
24
|
},
|
|
22
25
|
"dependencies": {
|
|
23
26
|
"@acuris/aws-es-connection": "^2.2.0",
|
|
24
|
-
"@backstage/config": "^0.1.
|
|
25
|
-
"@backstage/search-common": "^0.2.
|
|
27
|
+
"@backstage/config": "^0.1.14",
|
|
28
|
+
"@backstage/search-common": "^0.2.3",
|
|
26
29
|
"@elastic/elasticsearch": "7.13.0",
|
|
27
30
|
"aws-sdk": "^2.948.0",
|
|
28
31
|
"elastic-builder": "^2.16.0",
|
|
@@ -30,9 +33,9 @@
|
|
|
30
33
|
"winston": "^3.2.1"
|
|
31
34
|
},
|
|
32
35
|
"devDependencies": {
|
|
33
|
-
"@backstage/backend-common": "^0.10.
|
|
34
|
-
"@backstage/cli": "^0.
|
|
35
|
-
"@elastic/elasticsearch-mock": "^0.
|
|
36
|
+
"@backstage/backend-common": "^0.10.8",
|
|
37
|
+
"@backstage/cli": "^0.14.0",
|
|
38
|
+
"@elastic/elasticsearch-mock": "^1.0.0"
|
|
36
39
|
},
|
|
37
40
|
"files": [
|
|
38
41
|
"dist",
|
|
@@ -42,5 +45,5 @@
|
|
|
42
45
|
"testEnvironment": "node"
|
|
43
46
|
},
|
|
44
47
|
"configSchema": "config.d.ts",
|
|
45
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "4805c3d13ce9bfc369e53c271b1b95e722b3b4dc"
|
|
46
49
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Config } from '@backstage/config';
|
|
3
|
-
import { SearchEngine, SearchQuery, IndexableDocument, SearchResultSet } from '@backstage/search-common';
|
|
4
|
-
import { Logger } from 'winston';
|
|
5
|
-
import { ConnectionOptions } from 'tls';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Options used to configure the `@elastic/elasticsearch` client and
|
|
9
|
-
* are what will be passed as an argument to the
|
|
10
|
-
* {@link ElasticSearchEngine.newClient} method
|
|
11
|
-
*
|
|
12
|
-
* They are drawn from the `ClientOptions` class of `@elastic/elasticsearch`,
|
|
13
|
-
* but are maintained separately so that this interface is not coupled to
|
|
14
|
-
*/
|
|
15
|
-
interface ElasticSearchClientOptions {
|
|
16
|
-
provider?: 'aws' | 'elastic';
|
|
17
|
-
node?: string | string[] | ElasticSearchNodeOptions | ElasticSearchNodeOptions[];
|
|
18
|
-
nodes?: string | string[] | ElasticSearchNodeOptions | ElasticSearchNodeOptions[];
|
|
19
|
-
Transport?: ElasticSearchTransportConstructor;
|
|
20
|
-
Connection?: ElasticSearchConnectionConstructor;
|
|
21
|
-
maxRetries?: number;
|
|
22
|
-
requestTimeout?: number;
|
|
23
|
-
pingTimeout?: number;
|
|
24
|
-
sniffInterval?: number | boolean;
|
|
25
|
-
sniffOnStart?: boolean;
|
|
26
|
-
sniffEndpoint?: string;
|
|
27
|
-
sniffOnConnectionFault?: boolean;
|
|
28
|
-
resurrectStrategy?: 'ping' | 'optimistic' | 'none';
|
|
29
|
-
suggestCompression?: boolean;
|
|
30
|
-
compression?: 'gzip';
|
|
31
|
-
ssl?: ConnectionOptions;
|
|
32
|
-
agent?: ElasticSearchAgentOptions | ((opts?: any) => unknown) | false;
|
|
33
|
-
nodeFilter?: (connection: any) => boolean;
|
|
34
|
-
nodeSelector?: ((connections: any[]) => any) | string;
|
|
35
|
-
headers?: Record<string, any>;
|
|
36
|
-
opaqueIdPrefix?: string;
|
|
37
|
-
name?: string | symbol;
|
|
38
|
-
auth?: ElasticSearchAuth;
|
|
39
|
-
proxy?: string | URL;
|
|
40
|
-
enableMetaHeader?: boolean;
|
|
41
|
-
cloud?: {
|
|
42
|
-
id: string;
|
|
43
|
-
username?: string;
|
|
44
|
-
password?: string;
|
|
45
|
-
};
|
|
46
|
-
disablePrototypePoisoningProtection?: boolean | 'proto' | 'constructor';
|
|
47
|
-
}
|
|
48
|
-
declare type ElasticSearchAuth = {
|
|
49
|
-
username: string;
|
|
50
|
-
password: string;
|
|
51
|
-
} | {
|
|
52
|
-
apiKey: string | {
|
|
53
|
-
id: string;
|
|
54
|
-
api_key: string;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
interface ElasticSearchNodeOptions {
|
|
58
|
-
url: URL;
|
|
59
|
-
id?: string;
|
|
60
|
-
agent?: ElasticSearchAgentOptions;
|
|
61
|
-
ssl?: ConnectionOptions;
|
|
62
|
-
headers?: Record<string, any>;
|
|
63
|
-
roles?: {
|
|
64
|
-
master: boolean;
|
|
65
|
-
data: boolean;
|
|
66
|
-
ingest: boolean;
|
|
67
|
-
ml: boolean;
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
interface ElasticSearchAgentOptions {
|
|
71
|
-
keepAlive?: boolean;
|
|
72
|
-
keepAliveMsecs?: number;
|
|
73
|
-
maxSockets?: number;
|
|
74
|
-
maxFreeSockets?: number;
|
|
75
|
-
}
|
|
76
|
-
interface ElasticSearchConnectionConstructor {
|
|
77
|
-
new (opts?: any): any;
|
|
78
|
-
statuses: {
|
|
79
|
-
ALIVE: string;
|
|
80
|
-
DEAD: string;
|
|
81
|
-
};
|
|
82
|
-
roles: {
|
|
83
|
-
MASTER: string;
|
|
84
|
-
DATA: string;
|
|
85
|
-
INGEST: string;
|
|
86
|
-
ML: string;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
interface ElasticSearchTransportConstructor {
|
|
90
|
-
new (opts?: any): any;
|
|
91
|
-
sniffReasons: {
|
|
92
|
-
SNIFF_ON_START: string;
|
|
93
|
-
SNIFF_INTERVAL: string;
|
|
94
|
-
SNIFF_ON_CONNECTION_FAULT: string;
|
|
95
|
-
DEFAULT: string;
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
declare type ConcreteElasticSearchQuery = {
|
|
100
|
-
documentTypes?: string[];
|
|
101
|
-
elasticSearchQuery: Object;
|
|
102
|
-
pageSize: number;
|
|
103
|
-
};
|
|
104
|
-
declare type ElasticSearchQueryTranslator = (query: SearchQuery) => ConcreteElasticSearchQuery;
|
|
105
|
-
declare type ElasticSearchOptions = {
|
|
106
|
-
logger: Logger;
|
|
107
|
-
config: Config;
|
|
108
|
-
aliasPostfix?: string;
|
|
109
|
-
indexPrefix?: string;
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* @public
|
|
113
|
-
*/
|
|
114
|
-
declare class ElasticSearchSearchEngine implements SearchEngine {
|
|
115
|
-
private readonly elasticSearchClientOptions;
|
|
116
|
-
private readonly aliasPostfix;
|
|
117
|
-
private readonly indexPrefix;
|
|
118
|
-
private readonly logger;
|
|
119
|
-
private readonly elasticSearchClient;
|
|
120
|
-
constructor(elasticSearchClientOptions: ElasticSearchClientOptions, aliasPostfix: string, indexPrefix: string, logger: Logger);
|
|
121
|
-
static fromConfig({ logger, config, aliasPostfix, indexPrefix, }: ElasticSearchOptions): Promise<ElasticSearchSearchEngine>;
|
|
122
|
-
/**
|
|
123
|
-
* Create a custom search client from the derived elastic search
|
|
124
|
-
* configuration. This need not be the same client that the engine uses
|
|
125
|
-
* internally.
|
|
126
|
-
*/
|
|
127
|
-
newClient<T>(create: (options: ElasticSearchClientOptions) => T): T;
|
|
128
|
-
protected translator(query: SearchQuery): ConcreteElasticSearchQuery;
|
|
129
|
-
setTranslator(translator: ElasticSearchQueryTranslator): void;
|
|
130
|
-
index(type: string, documents: IndexableDocument[]): Promise<void>;
|
|
131
|
-
query(query: SearchQuery): Promise<SearchResultSet>;
|
|
132
|
-
private readonly indexSeparator;
|
|
133
|
-
private constructIndexName;
|
|
134
|
-
private getTypeFromIndex;
|
|
135
|
-
private constructSearchAlias;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export { ElasticSearchClientOptions, ElasticSearchSearchEngine };
|