@webiny/api-elasticsearch 5.30.0 → 5.31.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/index.d.ts +1 -1
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/package.json +9 -9
- package/types.d.ts +1 -1
- package/types.js.map +1 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _api = require("@webiny/api");
|
|
13
13
|
|
|
14
14
|
var _client = require("./client");
|
|
15
15
|
|
|
@@ -21,7 +21,7 @@ var _elasticsearch = require("@elastic/elasticsearch");
|
|
|
21
21
|
* We must accept either Elasticsearch client or options that create the client.
|
|
22
22
|
*/
|
|
23
23
|
var _default = params => {
|
|
24
|
-
return new
|
|
24
|
+
return new _api.ContextPlugin(context => {
|
|
25
25
|
if (context.elasticsearch) {
|
|
26
26
|
throw new _error.default("Elasticsearch client is already initialized, no need to define it again. Check your code for duplicate initializations.", "ELASTICSEARCH_ALREADY_INITIALIZED");
|
|
27
27
|
}
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["params","ContextPlugin","context","elasticsearch","WebinyError","Client","createElasticsearchClient","plugins","register","getElasticsearchOperators"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ElasticsearchContext } from \"~/types\";\nimport { ContextPlugin } from \"@webiny/
|
|
1
|
+
{"version":3,"names":["params","ContextPlugin","context","elasticsearch","WebinyError","Client","createElasticsearchClient","plugins","register","getElasticsearchOperators"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ElasticsearchContext } from \"~/types\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { createElasticsearchClient, ElasticsearchClientOptions } from \"~/client\";\nimport { getElasticsearchOperators } from \"~/operators\";\nimport { Client } from \"@elastic/elasticsearch\";\n\n/**\n * We must accept either Elasticsearch client or options that create the client.\n */\nexport default (\n params: ElasticsearchClientOptions | Client\n): ContextPlugin<ElasticsearchContext> => {\n return new ContextPlugin<ElasticsearchContext>(context => {\n if (context.elasticsearch) {\n throw new WebinyError(\n \"Elasticsearch client is already initialized, no need to define it again. Check your code for duplicate initializations.\",\n \"ELASTICSEARCH_ALREADY_INITIALIZED\"\n );\n }\n /**\n * Initialize the Elasticsearch client.\n */\n context.elasticsearch =\n params instanceof Client ? params : createElasticsearchClient(params);\n\n context.plugins.register(getElasticsearchOperators());\n });\n};\n"],"mappings":";;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AAEA;AACA;AACA;eAEIA,MADW,IAE2B;EACtC,OAAO,IAAIC,kBAAJ,CAAwCC,OAAO,IAAI;IACtD,IAAIA,OAAO,CAACC,aAAZ,EAA2B;MACvB,MAAM,IAAIC,cAAJ,CACF,yHADE,EAEF,mCAFE,CAAN;IAIH;IACD;AACR;AACA;;;IACQF,OAAO,CAACC,aAAR,GACIH,MAAM,YAAYK,qBAAlB,GAA2BL,MAA3B,GAAoC,IAAAM,iCAAA,EAA0BN,MAA1B,CADxC;IAGAE,OAAO,CAACK,OAAR,CAAgBC,QAAhB,CAAyB,IAAAC,oCAAA,GAAzB;EACH,CAdM,CAAP;AAeH,C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-elasticsearch",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.31.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/webiny/webiny-js.git",
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@elastic/elasticsearch": "7.12.0",
|
|
16
|
-
"@webiny/
|
|
17
|
-
"@webiny/
|
|
18
|
-
"@webiny/plugins": "5.
|
|
19
|
-
"@webiny/utils": "5.
|
|
16
|
+
"@webiny/api": "5.31.0",
|
|
17
|
+
"@webiny/error": "5.31.0",
|
|
18
|
+
"@webiny/plugins": "5.31.0",
|
|
19
|
+
"@webiny/utils": "5.31.0",
|
|
20
20
|
"aws-elasticsearch-connector": "9.2.0",
|
|
21
|
-
"aws-sdk": "2.
|
|
21
|
+
"aws-sdk": "2.1188.0",
|
|
22
22
|
"elastic-ts": "0.7.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@babel/cli": "^7.16.0",
|
|
26
26
|
"@babel/core": "^7.16.0",
|
|
27
|
-
"@webiny/cli": "^5.
|
|
28
|
-
"@webiny/project-utils": "^5.
|
|
27
|
+
"@webiny/cli": "^5.31.0",
|
|
28
|
+
"@webiny/project-utils": "^5.31.0",
|
|
29
29
|
"rimraf": "^3.0.2",
|
|
30
30
|
"ttypescript": "^1.5.12",
|
|
31
31
|
"typescript": "4.7.4"
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
]
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "0b3fa2ace7f258628438aa993d782fb562a64358"
|
|
49
49
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Client } from "@elastic/elasticsearch";
|
|
2
2
|
import { ApiResponse } from "@elastic/elasticsearch/lib/Transport";
|
|
3
3
|
import { BoolQueryConfig as esBoolQueryConfig, Query as esQuery } from "elastic-ts";
|
|
4
|
-
import { Context } from "@webiny/
|
|
4
|
+
import { Context } from "@webiny/api/types";
|
|
5
5
|
/**
|
|
6
6
|
* Re-export some dep lib types.
|
|
7
7
|
*/
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { Client } from \"@elastic/elasticsearch\";\nimport { ApiResponse } from \"@elastic/elasticsearch/lib/Transport\";\nimport { BoolQueryConfig as esBoolQueryConfig, Query as esQuery } from \"elastic-ts\";\nimport { Context } from \"@webiny/
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { Client } from \"@elastic/elasticsearch\";\nimport { ApiResponse } from \"@elastic/elasticsearch/lib/Transport\";\nimport { BoolQueryConfig as esBoolQueryConfig, Query as esQuery } from \"elastic-ts\";\nimport { Context } from \"@webiny/api/types\";\n/**\n * Re-export some dep lib types.\n */\nexport * from \"elastic-ts\";\nexport { ApiResponse };\n\nexport interface ElasticsearchContext extends Context {\n elasticsearch: Client;\n}\n\n/**\n * To simplify our plugins, we say that query contains arrays of objects, not single objects.\n * And that they all are defined as empty arrays at the start.\n */\nexport interface ElasticsearchBoolQueryConfig extends esBoolQueryConfig {\n must: esQuery[];\n filter: esQuery[];\n should: esQuery[];\n must_not: esQuery[];\n}\n\n/**\n * Definitions of possible Elasticsearch operators.\n *\n * @category Elasticsearch\n */\nexport type ElasticsearchQueryOperator =\n | \"eq\"\n | \"not\"\n | \"in\"\n | \"not_in\"\n | \"contains\"\n | \"not_contains\"\n | \"between\"\n | \"not_between\"\n | \"gt\"\n | \"gte\"\n | \"lt\"\n | \"lte\";\n\n/**\n * Definition for arguments of the ElasticsearchQueryBuilderOperatorPlugin.apply method.\n *\n * @see ElasticsearchQueryBuilderOperatorPlugin.apply\n *\n * @category Plugin\n * @category Elasticsearch\n */\nexport interface ElasticsearchQueryBuilderArgsPlugin {\n /**\n * A full path to the field. Including the \".keyword\" if it is added.\n */\n path: string;\n /**\n * A path to the field, plain.\n */\n basePath: string;\n /**\n * Value to apply.\n */\n value: any;\n /**\n * Is path containing the \".keyword\"\n */\n keyword: boolean;\n}\n\n/**\n * Elasticsearch responses.\n */\nexport interface ElasticsearchSearchResponseHit<T> {\n _source: T;\n sort: string;\n}\nexport interface ElasticsearchSearchResponseAggregationBucket<T> {\n key: T;\n}\nexport interface ElasticsearchSearchResponse<T = any> {\n body: {\n hits: {\n hits: ElasticsearchSearchResponseHit<T>[];\n total: {\n value: number;\n };\n };\n aggregations: {\n [key: string]: {\n buckets: ElasticsearchSearchResponseAggregationBucket<T>[];\n };\n };\n };\n}\n\nexport interface ElasticsearchIndexRequestBodyMappingsDynamicTemplate {\n [key: string]: {\n match_mapping_type?: string;\n match?: string;\n unmatch?: string;\n mapping?: {\n type?: \"text\" | \"date\" | \"binary\" | \"boolean\" | \"object\" | \"ip\" | \"geo\" | string;\n search_analyzer?: string;\n analyzer?: string;\n fields?: {\n [key: string]:\n | {\n type: string;\n search_analyzer?: string;\n analyzer?: string;\n ignore_above?: number;\n [key: string]: any;\n }\n | undefined;\n };\n [key: string]: any;\n };\n [key: string]: any;\n };\n}\n\ninterface ElasticsearchIndexRequestBodySettings {\n analysis?: {\n [key: string]: any;\n };\n number_of_shards?: number;\n number_of_routing_shards?: number;\n codec?: string;\n routing_partition_size?: number;\n soft_deletes?: {\n enabled?: boolean;\n retention_lease?: {\n period?: string;\n };\n };\n load_fixed_bitset_filters_eagerly?: boolean;\n shard?: {\n check_on_startup?: boolean | \"checksum\";\n };\n number_of_replicas?: number;\n auto_expand_replicas?: string | \"all\" | false;\n search?: {\n idle?: {\n after?: string;\n };\n };\n refresh_interval?: string;\n max_result_window?: number;\n max_inner_result_window?: number;\n max_rescore_window?: number;\n max_docvalue_fields_search?: number;\n max_script_fields?: number;\n max_ngram_diff?: number;\n max_shingle_diff?: number;\n max_refresh_listeners?: number;\n analyze?: {\n max_token_count?: number;\n };\n highlight?: {\n max_analyzed_offset?: number;\n };\n max_terms_count?: number;\n max_regex_length?: number;\n query?: {\n default_field?: string;\n };\n routing?: {\n allocation?: {\n enable?: \"all\" | \"primaries\" | \"new_primaries\" | \"none\";\n };\n rebalance?: {\n enable?: \"all\" | \"primaries\" | \"new_primaries\" | \"none\";\n };\n };\n gc_deletes?: string;\n default_pipeline?: string;\n final_pipeline?: string;\n hidden?: boolean;\n [key: string]: any;\n}\n\nexport interface ElasticsearchIndexRequestBody {\n settings?: {\n index?: Partial<ElasticsearchIndexRequestBodySettings>;\n };\n mappings: {\n dynamic_templates?: ElasticsearchIndexRequestBodyMappingsDynamicTemplate[];\n properties?: {\n [key: string]: {\n analyzer?: string;\n type?: string;\n normalizer?: string;\n index?: string;\n fields?: {\n [key: string]: {\n type: string;\n ignore_above?: number;\n search_analyzer?: string;\n analyzer?: string;\n [key: string]: any;\n };\n };\n [key: string]: any;\n };\n };\n [key: string]: any;\n };\n aliases?: {\n [key: string]: {\n filter?: {\n [key: string]: any;\n };\n index_routing?: string;\n is_hidden?: boolean;\n is_write_index?: boolean;\n routing?: string;\n search_routing?: string;\n };\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;AACA;;AAMA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|