@webiny/api-elasticsearch 5.23.1-beta.0 → 5.24.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/package.json +8 -8
- package/types.d.ts +30 -0
- package/types.js +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-elasticsearch",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.24.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/webiny/webiny-js.git",
|
|
@@ -13,10 +13,10 @@
|
|
|
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.24.0",
|
|
17
|
+
"@webiny/handler": "5.24.0",
|
|
18
|
+
"@webiny/plugins": "5.24.0",
|
|
19
|
+
"@webiny/utils": "5.24.0",
|
|
20
20
|
"aws-elasticsearch-connector": "9.0.3",
|
|
21
21
|
"aws-sdk": "2.1066.0",
|
|
22
22
|
"elastic-ts": "0.7.0"
|
|
@@ -24,8 +24,8 @@
|
|
|
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.24.0",
|
|
28
|
+
"@webiny/project-utils": "^5.24.0",
|
|
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": "be0cbfcaa9247c658c44179af7943cc5d6d71bc7"
|
|
49
49
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { Client } from "@elastic/elasticsearch";
|
|
2
|
+
import { ApiResponse } from "@elastic/elasticsearch/lib/Transport";
|
|
2
3
|
import { BoolQueryConfig as esBoolQueryConfig, Query as esQuery } from "elastic-ts";
|
|
3
4
|
import { Context } from "@webiny/handler/types";
|
|
5
|
+
/**
|
|
6
|
+
* Re-export some dep lib types.
|
|
7
|
+
*/
|
|
4
8
|
export * from "elastic-ts";
|
|
9
|
+
export { ApiResponse };
|
|
5
10
|
export interface ElasticsearchContext extends Context {
|
|
6
11
|
elasticsearch: Client;
|
|
7
12
|
}
|
|
@@ -47,3 +52,28 @@ export interface ElasticsearchQueryBuilderArgsPlugin {
|
|
|
47
52
|
*/
|
|
48
53
|
keyword: boolean;
|
|
49
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Elasticsearch responses.
|
|
57
|
+
*/
|
|
58
|
+
export interface ElasticsearchSearchResponseHit<T> {
|
|
59
|
+
_source: T;
|
|
60
|
+
sort: string;
|
|
61
|
+
}
|
|
62
|
+
export interface ElasticsearchSearchResponseAggregationBucket<T> {
|
|
63
|
+
key: T;
|
|
64
|
+
}
|
|
65
|
+
export interface ElasticsearchSearchResponse<T = any> {
|
|
66
|
+
body: {
|
|
67
|
+
hits: {
|
|
68
|
+
hits: ElasticsearchSearchResponseHit<T>[];
|
|
69
|
+
total: {
|
|
70
|
+
value: number;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
aggregations: {
|
|
74
|
+
[key: string]: {
|
|
75
|
+
buckets: ElasticsearchSearchResponseAggregationBucket<T>[];
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
}
|
package/types.js
CHANGED
|
@@ -3,11 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
ApiResponse: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "ApiResponse", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _Transport.ApiResponse;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
var _Transport = require("@elastic/elasticsearch/lib/Transport");
|
|
6
17
|
|
|
7
18
|
var _elasticTs = require("elastic-ts");
|
|
8
19
|
|
|
9
20
|
Object.keys(_elasticTs).forEach(function (key) {
|
|
10
21
|
if (key === "default" || key === "__esModule") return;
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
11
23
|
if (key in exports && exports[key] === _elasticTs[key]) return;
|
|
12
24
|
Object.defineProperty(exports, key, {
|
|
13
25
|
enumerable: true,
|