opensearch-ts 1.2.9 → 1.2.12
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/dist/search.d.ts +3 -2
- package/dist/testUtil.js +9 -11
- package/package.json +3 -3
package/dist/search.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ShardStatistics } from "@opensearch-project/opensearch/api/_types/_common";
|
|
2
|
-
import { Highlight, TotalHits } from "@opensearch-project/opensearch/api/_types/_core.search";
|
|
2
|
+
import { Highlight, Hit, TotalHits } from "@opensearch-project/opensearch/api/_types/_core.search";
|
|
3
3
|
import { RequireAtLeastOne, RequireExactlyOne } from "type-fest";
|
|
4
4
|
import { AggTypeDictionaryRecursive, AggsQuery } from "./aggInput";
|
|
5
5
|
import { AggTypeResponseDictionary2 } from "./aggOutput";
|
|
@@ -16,6 +16,7 @@ export type Document<T> = {
|
|
|
16
16
|
_score: number;
|
|
17
17
|
_source: T;
|
|
18
18
|
sort?: any[];
|
|
19
|
+
highlight?: Highlight;
|
|
19
20
|
};
|
|
20
21
|
/**
|
|
21
22
|
* Represents (Hits|Search Results)
|
|
@@ -23,7 +24,7 @@ export type Document<T> = {
|
|
|
23
24
|
export type Hits<T> = {
|
|
24
25
|
"total": number & TotalHits;
|
|
25
26
|
"max_score": any;
|
|
26
|
-
"hits": Document<T>[];
|
|
27
|
+
"hits": (Document<T> & Hit)[];
|
|
27
28
|
};
|
|
28
29
|
export type Source<T> = {
|
|
29
30
|
includes?: att.AnyAttribute<T>[];
|
package/dist/testUtil.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeClientWithEndpoint = void 0;
|
|
4
|
-
const credential_provider_node_1 = require("@aws-sdk/credential-provider-node");
|
|
5
4
|
const os = require("@opensearch-project/opensearch");
|
|
6
|
-
const aws_1 = require("@opensearch-project/opensearch/aws");
|
|
7
5
|
const makeClientWithEndpoint = async (endpoint) => {
|
|
8
6
|
return new os.Client({
|
|
9
|
-
...
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}),
|
|
17
|
-
node:
|
|
7
|
+
// ...AwsSigv4Signer({
|
|
8
|
+
// region: process.env.AWS_REGION || "ap-southeast-2",
|
|
9
|
+
// service: 'es',
|
|
10
|
+
// getCredentials: () => {
|
|
11
|
+
// const credentialsProvider = defaultProvider()
|
|
12
|
+
// return credentialsProvider()
|
|
13
|
+
// },
|
|
14
|
+
// }),
|
|
15
|
+
node: "http://192.168.7.224:5601"
|
|
18
16
|
});
|
|
19
17
|
};
|
|
20
18
|
exports.makeClientWithEndpoint = makeClientWithEndpoint;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opensearch-ts",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "Typescript types for the Opensearch Query DSL",
|
|
3
|
+
"version": "1.2.12",
|
|
4
|
+
"description": "Typescript types for the Opensearch Query DSL so things are a little bit more type-safe ( :",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc",
|
|
12
|
-
"test": "jest",
|
|
12
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
13
13
|
"prepublish": "tsc"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|