@terascope/elasticsearch-api 3.5.1 → 3.6.1

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.
Files changed (2) hide show
  1. package/index.js +6 -1
  2. package/package.json +5 -5
package/index.js CHANGED
@@ -971,6 +971,11 @@ module.exports = function elasticsearchApi(client, logger, _opConfig) {
971
971
  return distribution === ElasticsearchDistribution.elasticsearch && majorVersion === 8;
972
972
  }
973
973
 
974
+ function isOpensearch2() {
975
+ const { distribution, majorVersion } = getClientMetadata();
976
+ return distribution === ElasticsearchDistribution.opensearch && majorVersion === 2;
977
+ }
978
+
974
979
  function _fixMappingRequest(_params, isTemplate) {
975
980
  if (!_params || !_params.body) {
976
981
  throw new Error('Invalid mapping request');
@@ -1000,7 +1005,7 @@ module.exports = function elasticsearchApi(client, logger, _opConfig) {
1000
1005
  }
1001
1006
  }
1002
1007
 
1003
- if (isElasticsearch8(client)) {
1008
+ if (isElasticsearch8(client) || isOpensearch2(client)) {
1004
1009
  delete defaultParams.includeTypeName;
1005
1010
  }
1006
1011
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@terascope/elasticsearch-api",
3
3
  "displayName": "Elasticsearch API",
4
- "version": "3.5.1",
4
+ "version": "3.6.1",
5
5
  "description": "Elasticsearch client api used across multiple services, handles retries and exponential backoff",
6
6
  "homepage": "https://github.com/terascope/teraslice/tree/master/packages/elasticsearch-api#readme",
7
7
  "bugs": {
@@ -17,21 +17,21 @@
17
17
  "test:7": "ELASTICSEARCH_VERSION='7.9.3' yarn run test",
18
18
  "test:8": "ELASTICSEARCH_VERSION='8.1.2' yarn run test",
19
19
  "test:debug": "ts-scripts test --debug . --",
20
- "test:legacy": "LEGACY_CLIENT=true yarn run test",
20
+ "test:legacy": "LEGACY_CLIENT=true yarn run test:debug",
21
21
  "test:opensearch": "TEST_OPENSEARCH='true' RESTRAINED_OPENSEARCH='true' yarn run test",
22
22
  "test:watch": "ts-scripts test --watch . --"
23
23
  },
24
24
  "dependencies": {
25
25
  "@terascope/types": "^0.11.2",
26
- "@terascope/utils": "^0.45.6",
26
+ "@terascope/utils": "^0.46.0",
27
27
  "bluebird": "^3.7.2",
28
28
  "setimmediate": "^1.0.5"
29
29
  },
30
30
  "devDependencies": {
31
- "@opensearch-project/opensearch": "^1.1.0",
31
+ "@opensearch-project/opensearch": "^1.2.0",
32
32
  "@types/elasticsearch": "^5.0.40",
33
33
  "elasticsearch": "^15.4.1",
34
- "elasticsearch-store": "^0.66.1",
34
+ "elasticsearch-store": "^0.67.2",
35
35
  "elasticsearch6": "npm:@elastic/elasticsearch@^6.7.0",
36
36
  "elasticsearch7": "npm:@elastic/elasticsearch@^7.0.0",
37
37
  "elasticsearch8": "npm:@elastic/elasticsearch@^8.0.0"