@webiny/api-elasticsearch 5.21.0-beta.0 → 5.22.0-beta.2
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/client.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/package.json +11 -11
- package/plugins/definition/ElasticsearchFieldPlugin.js +2 -2
- package/plugins/operator/equal.js +10 -0
- package/plugins/operator/not.js +10 -0
- package/types.d.ts +2 -2
package/client.js
CHANGED
|
@@ -19,9 +19,9 @@ var _awsElasticsearchConnector = _interopRequireDefault(require("aws-elasticsear
|
|
|
19
19
|
|
|
20
20
|
const _excluded = ["endpoint", "node"];
|
|
21
21
|
|
|
22
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
23
|
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
25
|
|
|
26
26
|
const createElasticsearchClient = options => {
|
|
27
27
|
const {
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElasticsearchContext } from "./types";
|
|
2
|
-
import { ContextPlugin } from "@webiny/handler
|
|
2
|
+
import { ContextPlugin } from "@webiny/handler";
|
|
3
3
|
import { ElasticsearchClientOptions } from "./client";
|
|
4
4
|
import { Client } from "@elastic/elasticsearch";
|
|
5
5
|
declare const _default: (params: ElasticsearchClientOptions | Client) => ContextPlugin<ElasticsearchContext>;
|
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _handler = require("@webiny/handler");
|
|
11
11
|
|
|
12
12
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
13
|
|
|
@@ -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 _handler.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-elasticsearch",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.22.0-beta.2",
|
|
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/error": "5.
|
|
17
|
-
"@webiny/handler": "5.
|
|
18
|
-
"@webiny/plugins": "5.
|
|
19
|
-
"@webiny/utils": "5.
|
|
16
|
+
"@webiny/error": "5.22.0-beta.2",
|
|
17
|
+
"@webiny/handler": "5.22.0-beta.2",
|
|
18
|
+
"@webiny/plugins": "5.22.0-beta.2",
|
|
19
|
+
"@webiny/utils": "5.22.0-beta.2",
|
|
20
20
|
"aws-elasticsearch-connector": "9.0.3",
|
|
21
|
-
"aws-sdk": "2.
|
|
21
|
+
"aws-sdk": "2.1056.0",
|
|
22
22
|
"elastic-ts": "0.7.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@babel/cli": "^7.
|
|
26
|
-
"@babel/core": "^7.
|
|
27
|
-
"@webiny/cli": "^5.
|
|
28
|
-
"@webiny/project-utils": "^5.
|
|
25
|
+
"@babel/cli": "^7.16.0",
|
|
26
|
+
"@babel/core": "^7.16.0",
|
|
27
|
+
"@webiny/cli": "^5.22.0-beta.2",
|
|
28
|
+
"@webiny/project-utils": "^5.22.0-beta.2",
|
|
29
29
|
"rimraf": "^3.0.2",
|
|
30
30
|
"ttypescript": "^1.5.12",
|
|
31
31
|
"typescript": "^4.1.3"
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
]
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "c472d20682885fb538354c206a148deaae14bfe8"
|
|
49
49
|
}
|
|
@@ -11,9 +11,9 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
11
11
|
|
|
12
12
|
var _plugins = require("@webiny/plugins");
|
|
13
13
|
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
15
|
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
17
|
|
|
18
18
|
const keywordLessUnmappedType = ["date", "long"];
|
|
19
19
|
|
|
@@ -27,11 +27,21 @@ class ElasticsearchQueryBuilderOperatorEqualPlugin extends _ElasticsearchQueryBu
|
|
|
27
27
|
path,
|
|
28
28
|
basePath
|
|
29
29
|
} = params;
|
|
30
|
+
|
|
31
|
+
if (value === null) {
|
|
32
|
+
query.must_not.push({
|
|
33
|
+
exists: {
|
|
34
|
+
field: path
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
30
39
|
/**
|
|
31
40
|
* In case we are searching for a string, use regular path.
|
|
32
41
|
* Otherwise use base path
|
|
33
42
|
*/
|
|
34
43
|
|
|
44
|
+
|
|
35
45
|
const useBasePath = typeof value !== "string";
|
|
36
46
|
query.must.push({
|
|
37
47
|
term: {
|
package/plugins/operator/not.js
CHANGED
|
@@ -27,6 +27,16 @@ class ElasticsearchQueryBuilderOperatorNotPlugin extends _ElasticsearchQueryBuil
|
|
|
27
27
|
path,
|
|
28
28
|
basePath
|
|
29
29
|
} = params;
|
|
30
|
+
|
|
31
|
+
if (value === null) {
|
|
32
|
+
query.must.push({
|
|
33
|
+
exists: {
|
|
34
|
+
field: path
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
30
40
|
const useBasePath = typeof value !== "string";
|
|
31
41
|
query.must_not.push({
|
|
32
42
|
term: {
|
package/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Client } from "@elastic/elasticsearch";
|
|
2
2
|
import { BoolQueryConfig as esBoolQueryConfig, Query as esQuery } from "elastic-ts";
|
|
3
|
-
import {
|
|
3
|
+
import { Context } from "@webiny/handler/types";
|
|
4
4
|
export * from "elastic-ts";
|
|
5
|
-
export interface ElasticsearchContext extends
|
|
5
|
+
export interface ElasticsearchContext extends Context {
|
|
6
6
|
elasticsearch: Client;
|
|
7
7
|
}
|
|
8
8
|
/**
|