elasticsearch-store 0.85.0 → 1.0.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/README.md +1 -1
- package/dist/src/elasticsearch-client/client.d.ts +3 -3
- package/dist/src/elasticsearch-client/client.js +7 -32
- package/dist/src/elasticsearch-client/client.js.map +1 -1
- package/dist/src/elasticsearch-client/create-client.d.ts +2 -2
- package/dist/src/elasticsearch-client/create-client.d.ts.map +1 -1
- package/dist/src/elasticsearch-client/create-client.js +22 -50
- package/dist/src/elasticsearch-client/create-client.js.map +1 -1
- package/dist/src/elasticsearch-client/index.d.ts +3 -3
- package/dist/src/elasticsearch-client/index.d.ts.map +1 -1
- package/dist/src/elasticsearch-client/index.js +3 -19
- package/dist/src/elasticsearch-client/index.js.map +1 -1
- package/dist/src/elasticsearch-client/interfaces.d.ts +1 -1
- package/dist/src/elasticsearch-client/interfaces.d.ts.map +1 -1
- package/dist/src/elasticsearch-client/interfaces.js +1 -2
- package/dist/src/elasticsearch-client/log-wrapper.js +1 -5
- package/dist/src/elasticsearch-client/log-wrapper.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/bulk.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/bulk.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/catIndices.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/catIndices.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/clusterGetSettings.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/clusterGetSettings.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/clusterHealth.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/clusterHealth.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/count.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/count.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/create.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/create.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/delete.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/delete.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/deleteByQuery.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/deleteByQuery.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/exists.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/exists.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/get.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/get.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/helper-utils.js +7 -14
- package/dist/src/elasticsearch-client/method-helpers/helper-utils.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/index-method.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/index-method.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/index.d.ts +40 -40
- package/dist/src/elasticsearch-client/method-helpers/index.d.ts.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/index.js +40 -56
- package/dist/src/elasticsearch-client/method-helpers/index.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesCreate.d.ts +2 -2
- package/dist/src/elasticsearch-client/method-helpers/indicesCreate.d.ts.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesCreate.js +10 -14
- package/dist/src/elasticsearch-client/method-helpers/indicesCreate.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesDelete.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesDelete.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesDeleteTemplate.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesDeleteTemplate.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesExists.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesExists.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesExistsTemplate.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesExistsTemplate.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesGet.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesGet.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesGetFieldMapping.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesGetFieldMapping.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesGetIndexTemplate.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesGetIndexTemplate.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesGetMapping.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesGetMapping.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesGetSettings.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesGetSettings.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesGetTemplate.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesGetTemplate.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesPutMapping.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesPutMapping.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesPutSettings.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesPutSettings.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesPutTemplate.d.ts +2 -2
- package/dist/src/elasticsearch-client/method-helpers/indicesPutTemplate.d.ts.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesPutTemplate.js +14 -18
- package/dist/src/elasticsearch-client/method-helpers/indicesPutTemplate.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesRecovery.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesRecovery.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesRefresh.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesRefresh.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesStats.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesStats.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/indicesValidateQuery.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/indicesValidateQuery.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/mget.js +8 -12
- package/dist/src/elasticsearch-client/method-helpers/mget.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/msearch.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/msearch.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/nodesInfo.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/nodesInfo.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/nodesStats.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/nodesStats.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/reindex.js +9 -14
- package/dist/src/elasticsearch-client/method-helpers/reindex.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/search.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/search.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/tasksCancel.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/tasksCancel.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/tasksGet.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/tasksGet.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/tasksList.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/tasksList.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/update.js +4 -8
- package/dist/src/elasticsearch-client/method-helpers/update.js.map +1 -1
- package/dist/src/index-manager.d.ts +6 -6
- package/dist/src/index-manager.d.ts.map +1 -1
- package/dist/src/index-manager.js +17 -41
- package/dist/src/index-manager.js.map +1 -1
- package/dist/src/index-model.d.ts +5 -5
- package/dist/src/index-model.d.ts.map +1 -1
- package/dist/src/index-model.js +33 -56
- package/dist/src/index-model.js.map +1 -1
- package/dist/src/index-store.d.ts +4 -5
- package/dist/src/index-store.d.ts.map +1 -1
- package/dist/src/index-store.js +103 -119
- package/dist/src/index-store.js.map +1 -1
- package/dist/src/index.d.ts +7 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -37
- package/dist/src/index.js.map +1 -1
- package/dist/src/interfaces.js +1 -2
- package/dist/src/test-helpers/config.js +1 -9
- package/dist/src/test-helpers/config.js.map +1 -1
- package/dist/src/test-helpers/elasticsearch.d.ts +2 -1
- package/dist/src/test-helpers/elasticsearch.d.ts.map +1 -1
- package/dist/src/test-helpers/elasticsearch.js +39 -52
- package/dist/src/test-helpers/elasticsearch.js.map +1 -1
- package/dist/src/test-helpers/fixtures/even-date-data.d.ts +1 -1
- package/dist/src/test-helpers/fixtures/even-date-data.d.ts.map +1 -1
- package/dist/src/test-helpers/fixtures/even-date-data.js +5 -8
- package/dist/src/test-helpers/fixtures/even-date-data.js.map +1 -1
- package/dist/src/test-helpers/fixtures/index.d.ts +2 -2
- package/dist/src/test-helpers/fixtures/index.d.ts.map +1 -1
- package/dist/src/test-helpers/fixtures/index.js +2 -28
- package/dist/src/test-helpers/fixtures/index.js.map +1 -1
- package/dist/src/test-helpers/fixtures/interfaces.js +1 -2
- package/dist/src/test-helpers/fixtures/uneven-date-data.d.ts +1 -1
- package/dist/src/test-helpers/fixtures/uneven-date-data.d.ts.map +1 -1
- package/dist/src/test-helpers/fixtures/uneven-date-data.js +5 -8
- package/dist/src/test-helpers/fixtures/uneven-date-data.js.map +1 -1
- package/dist/src/test-helpers/index.d.ts +3 -3
- package/dist/src/test-helpers/index.d.ts.map +1 -1
- package/dist/src/test-helpers/index.js +3 -19
- package/dist/src/test-helpers/index.js.map +1 -1
- package/dist/src/utils/elasticsearch.d.ts +8 -8
- package/dist/src/utils/elasticsearch.d.ts.map +1 -1
- package/dist/src/utils/elasticsearch.js +29 -71
- package/dist/src/utils/elasticsearch.js.map +1 -1
- package/dist/src/utils/errors.js +10 -40
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/index.d.ts +6 -6
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +6 -22
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/utils/misc.d.ts +1 -1
- package/dist/src/utils/misc.d.ts.map +1 -1
- package/dist/src/utils/misc.js +11 -43
- package/dist/src/utils/misc.js.map +1 -1
- package/dist/src/utils/model.d.ts.map +1 -1
- package/dist/src/utils/model.js +23 -54
- package/dist/src/utils/model.js.map +1 -1
- package/dist/src/utils/retry-config.js +6 -10
- package/dist/src/utils/retry-config.js.map +1 -1
- package/dist/src/utils/validation.d.ts +4 -4
- package/dist/src/utils/validation.d.ts.map +1 -1
- package/dist/src/utils/validation.js +29 -67
- package/dist/src/utils/validation.js.map +1 -1
- package/package.json +7 -6
package/dist/src/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './utils';
|
|
2
|
-
export * from './index-manager';
|
|
3
|
-
export * from './index-model';
|
|
4
|
-
export * from './index-store';
|
|
5
|
-
export * from './interfaces';
|
|
6
|
-
export * from './elasticsearch-client';
|
|
7
|
-
export * as ElasticsearchTestHelpers from './test-helpers';
|
|
1
|
+
export * from './utils/index.js';
|
|
2
|
+
export * from './index-manager.js';
|
|
3
|
+
export * from './index-model.js';
|
|
4
|
+
export * from './index-store.js';
|
|
5
|
+
export * from './interfaces.js';
|
|
6
|
+
export * from './elasticsearch-client/index.js';
|
|
7
|
+
export * as ElasticsearchTestHelpers from './test-helpers/index.js';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,OAAO,KAAK,wBAAwB,MAAM,yBAAyB,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,41 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.ElasticsearchTestHelpers = void 0;
|
|
30
1
|
// polyfill because opensearch has references to an api that won't exist
|
|
31
2
|
// on the client side, should be able to remove in the future
|
|
32
3
|
// @ts-expect-error
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
4
|
+
import('setimmediate');
|
|
5
|
+
export * from './utils/index.js';
|
|
6
|
+
export * from './index-manager.js';
|
|
7
|
+
export * from './index-model.js';
|
|
8
|
+
export * from './index-store.js';
|
|
9
|
+
export * from './interfaces.js';
|
|
10
|
+
export * from './elasticsearch-client/index.js';
|
|
11
|
+
export * as ElasticsearchTestHelpers from './test-helpers/index.js';
|
|
41
12
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,6DAA6D;AAC7D,mBAAmB;AACnB,MAAM,CAAC,cAAc,CAAC,CAAC;AAEvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,OAAO,KAAK,wBAAwB,MAAM,yBAAyB,CAAC"}
|
package/dist/src/interfaces.js
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RESTRAINED_OPENSEARCH_HOST = exports.OPENSEARCH_VERSION = exports.OPENSEARCH_HOST = exports.ELASTICSEARCH_VERSION = exports.ELASTICSEARCH_HOST = exports.TEST_INDEX_PREFIX = void 0;
|
|
4
1
|
const { TEST_INDEX_PREFIX = 'teratest_', ELASTICSEARCH_HOST = 'http://localhost:9200', ELASTICSEARCH_VERSION = '6.8.6', OPENSEARCH_PORT = '49210', OPENSEARCH_HOSTNAME = `http://localhost:${OPENSEARCH_PORT}`, OPENSEARCH_USER = 'admin', OPENSEARCH_PASSWORD = 'admin', OPENSEARCH_VERSION = '1.3.0', OPENSEARCH_HOST = `http://${OPENSEARCH_USER}:${OPENSEARCH_PASSWORD}@${OPENSEARCH_HOSTNAME}`, RESTRAINED_OPENSEARCH_PORT = process.env.RESTRAINED_OPENSEARCH_PORT || '49206', RESTRAINED_OPENSEARCH_HOST = `http://${OPENSEARCH_USER}:${OPENSEARCH_PASSWORD}@localhost:${RESTRAINED_OPENSEARCH_PORT}`, } = process.env;
|
|
5
|
-
|
|
6
|
-
exports.ELASTICSEARCH_HOST = ELASTICSEARCH_HOST;
|
|
7
|
-
exports.ELASTICSEARCH_VERSION = ELASTICSEARCH_VERSION;
|
|
8
|
-
exports.OPENSEARCH_VERSION = OPENSEARCH_VERSION;
|
|
9
|
-
exports.OPENSEARCH_HOST = OPENSEARCH_HOST;
|
|
10
|
-
exports.RESTRAINED_OPENSEARCH_HOST = RESTRAINED_OPENSEARCH_HOST;
|
|
2
|
+
export { TEST_INDEX_PREFIX, ELASTICSEARCH_HOST, ELASTICSEARCH_VERSION, OPENSEARCH_HOST, OPENSEARCH_VERSION, RESTRAINED_OPENSEARCH_HOST };
|
|
11
3
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/test-helpers/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/test-helpers/config.ts"],"names":[],"mappings":"AAAA,MAAM,EACF,iBAAiB,GAAG,WAAW,EAC/B,kBAAkB,GAAG,uBAAuB,EAC5C,qBAAqB,GAAG,OAAO,EAC/B,eAAe,GAAG,OAAO,EACzB,mBAAmB,GAAG,oBAAoB,eAAe,EAAE,EAC3D,eAAe,GAAG,OAAO,EACzB,mBAAmB,GAAG,OAAO,EAC7B,kBAAkB,GAAG,OAAO,EAC5B,eAAe,GAAG,UAAU,eAAe,IAAI,mBAAmB,IAAI,mBAAmB,EAAE,EAC3F,0BAA0B,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,IAAI,OAAO,EAC9E,0BAA0B,GAAG,UAAU,eAAe,IAAI,mBAAmB,cAAc,0BAA0B,EAAE,GAC1H,GAAG,OAAO,CAAC,GAAG,CAAC;AAEhB,OAAO,EACH,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC7B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DataType } from '@terascope/data-types';
|
|
2
2
|
import { ClientMetadata } from '@terascope/types';
|
|
3
|
-
import {
|
|
3
|
+
import { Client } from '../elasticsearch-client/index.js';
|
|
4
|
+
import type { IndexStore } from '../index-store.js';
|
|
4
5
|
export declare const removeTypeTest: boolean;
|
|
5
6
|
export declare function makeClient(): Promise<Client>;
|
|
6
7
|
export declare function cleanupIndex(client: any, index: string, template?: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elasticsearch.d.ts","sourceRoot":"","sources":["../../../src/test-helpers/elasticsearch.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,cAAc,EAA6B,MAAM,kBAAkB,CAAC;AAC7E,OAAO,
|
|
1
|
+
{"version":3,"file":"elasticsearch.d.ts","sourceRoot":"","sources":["../../../src/test-helpers/elasticsearch.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,cAAc,EAA6B,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAgB,MAAM,EAAU,MAAM,kCAAkC,CAAC;AA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wBAAgB,oBAAoB,IAClC,iBAAiB,CAoClB;AAED,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;;;EAMnF"}
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const config_1 = require("./config");
|
|
8
|
-
const semver = config_1.ELASTICSEARCH_VERSION.split('.').map(utils_1.toNumber);
|
|
1
|
+
import { DataEntity, pDelay, get, toNumber, uniq } from '@terascope/utils';
|
|
2
|
+
import { ElasticsearchDistribution } from '@terascope/types';
|
|
3
|
+
import { createClient } from '../elasticsearch-client/index.js';
|
|
4
|
+
import { getClientMetadata, fixMappingRequest } from '../utils/index.js';
|
|
5
|
+
import { ELASTICSEARCH_HOST, ELASTICSEARCH_VERSION, OPENSEARCH_HOST, OPENSEARCH_VERSION, RESTRAINED_OPENSEARCH_HOST } from './config.js';
|
|
6
|
+
const semver = ELASTICSEARCH_VERSION.split('.').map(toNumber);
|
|
9
7
|
const isOpensearchTest = process.env.TEST_OPENSEARCH != null;
|
|
10
|
-
|
|
11
|
-
async function makeClient() {
|
|
12
|
-
let host =
|
|
8
|
+
export const removeTypeTest = isOpensearchTest || (semver[0] === 8);
|
|
9
|
+
export async function makeClient() {
|
|
10
|
+
let host = ELASTICSEARCH_HOST;
|
|
13
11
|
if (process.env.TEST_OPENSEARCH) {
|
|
14
|
-
host =
|
|
12
|
+
host = OPENSEARCH_HOST;
|
|
15
13
|
}
|
|
16
14
|
if (process.env.TEST_RESTRAINED_OPENSEARCH) {
|
|
17
|
-
host =
|
|
15
|
+
host = RESTRAINED_OPENSEARCH_HOST;
|
|
18
16
|
}
|
|
19
|
-
const { client } = await
|
|
17
|
+
const { client } = await createClient({
|
|
20
18
|
node: host,
|
|
21
19
|
});
|
|
22
20
|
return client;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
async function cleanupIndex(client, index, template) {
|
|
22
|
+
export async function cleanupIndex(client, index, template) {
|
|
26
23
|
await client.indices
|
|
27
24
|
.delete({ index })
|
|
28
25
|
.catch((err) => {
|
|
@@ -45,27 +42,23 @@ async function cleanupIndex(client, index, template) {
|
|
|
45
42
|
});
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
|
-
exports.cleanupIndex = cleanupIndex;
|
|
49
45
|
/*
|
|
50
46
|
This is a quick and easy way to upload data, however, types are auto generated
|
|
51
47
|
by elasticsearch itself. If you need to control types for detailed searching
|
|
52
48
|
mechanisms use populateIndex
|
|
53
49
|
*/
|
|
54
|
-
async function upload(client, queryBody, data) {
|
|
50
|
+
export async function upload(client, queryBody, data) {
|
|
55
51
|
const { type, ...safeQueryBody } = queryBody;
|
|
56
52
|
const body = formatUploadData(safeQueryBody.index, data);
|
|
57
53
|
const query = Object.assign({ refresh: 'wait_for', body }, safeQueryBody);
|
|
58
54
|
return client.bulk(query);
|
|
59
55
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const metaData = (0, src_1.getClientMetadata)(client);
|
|
56
|
+
export function createMappingFromDatatype(client, dataType, type = '_doc', overrides = {}) {
|
|
57
|
+
const metaData = getClientMetadata(client);
|
|
63
58
|
const mapping = dataType.toESMapping({ typeName: type, overrides, ...metaData });
|
|
64
|
-
return
|
|
59
|
+
return fixMappingRequest(client, { body: mapping }, false);
|
|
65
60
|
}
|
|
66
|
-
|
|
67
|
-
async function populateIndex(client, index, dataType, records, type = '_doc') {
|
|
68
|
-
var _a;
|
|
61
|
+
export async function populateIndex(client, index, dataType, records, type = '_doc') {
|
|
69
62
|
const overrides = {
|
|
70
63
|
settings: {
|
|
71
64
|
'index.number_of_shards': 1,
|
|
@@ -88,21 +81,20 @@ async function populateIndex(client, index, dataType, records, type = '_doc') {
|
|
|
88
81
|
if (results.errors) {
|
|
89
82
|
const errors = [];
|
|
90
83
|
for (const response of results.items) {
|
|
91
|
-
if (
|
|
84
|
+
if (response?.index?.error)
|
|
92
85
|
errors.push(response.index.error.reason);
|
|
93
86
|
}
|
|
94
|
-
throw new Error(`There were errors populating index, errors: ${
|
|
87
|
+
throw new Error(`There were errors populating index, errors: ${uniq(errors).join(' ; ')}`);
|
|
95
88
|
}
|
|
96
89
|
}
|
|
97
|
-
|
|
98
|
-
function formatUploadData(index, data, apiCompatibility = false) {
|
|
90
|
+
export function formatUploadData(index, data, apiCompatibility = false) {
|
|
99
91
|
const results = [];
|
|
100
92
|
data.forEach((record) => {
|
|
101
93
|
const meta = { _index: index };
|
|
102
|
-
if (!
|
|
94
|
+
if (!removeTypeTest) {
|
|
103
95
|
meta._type = '_doc';
|
|
104
96
|
}
|
|
105
|
-
if (
|
|
97
|
+
if (DataEntity.isDataEntity(record) && record.getKey()) {
|
|
106
98
|
meta._id = record.getKey();
|
|
107
99
|
}
|
|
108
100
|
// This format is used by elasticsearch-api and elasticsearch-assets
|
|
@@ -116,22 +108,20 @@ function formatUploadData(index, data, apiCompatibility = false) {
|
|
|
116
108
|
});
|
|
117
109
|
return results;
|
|
118
110
|
}
|
|
119
|
-
|
|
120
|
-
function cleanupIndexStore(store) {
|
|
111
|
+
export function cleanupIndexStore(store) {
|
|
121
112
|
return cleanupIndex(store.client, store.searchIndex);
|
|
122
113
|
}
|
|
123
|
-
|
|
124
|
-
async function waitForData(client, index, count, timeout = 5000) {
|
|
114
|
+
export async function waitForData(client, index, count, timeout = 5000) {
|
|
125
115
|
const failTestTime = Date.now() + timeout;
|
|
126
116
|
return new Promise((resolve, reject) => {
|
|
127
117
|
async function checkIndex() {
|
|
128
118
|
if (failTestTime <= Date.now()) {
|
|
129
119
|
reject(new Error('Could not find count in alloated time'));
|
|
130
120
|
}
|
|
131
|
-
await
|
|
121
|
+
await pDelay(100);
|
|
132
122
|
try {
|
|
133
123
|
const response = await client.count({ index, q: '*' });
|
|
134
|
-
const responseCount =
|
|
124
|
+
const responseCount = get(response, 'body.count', response.count);
|
|
135
125
|
if (count === responseCount)
|
|
136
126
|
return resolve();
|
|
137
127
|
}
|
|
@@ -143,50 +133,47 @@ async function waitForData(client, index, count, timeout = 5000) {
|
|
|
143
133
|
checkIndex();
|
|
144
134
|
});
|
|
145
135
|
}
|
|
146
|
-
exports.waitForData = waitForData;
|
|
147
136
|
function parseVersion(version) {
|
|
148
|
-
const [majorVersion = 6, minorVersion = 8, patchVersion = 6] = version.split('.').map(
|
|
137
|
+
const [majorVersion = 6, minorVersion = 8, patchVersion = 6] = version.split('.').map(toNumber);
|
|
149
138
|
return [majorVersion, minorVersion, patchVersion];
|
|
150
139
|
}
|
|
151
|
-
function getTestENVClientInfo() {
|
|
140
|
+
export function getTestENVClientInfo() {
|
|
152
141
|
if (process.env.TEST_OPENSEARCH != null) {
|
|
153
|
-
const version =
|
|
142
|
+
const version = OPENSEARCH_VERSION;
|
|
154
143
|
const [majorVersion, minorVersion] = parseVersion(version);
|
|
155
144
|
return {
|
|
156
|
-
host:
|
|
157
|
-
distribution:
|
|
145
|
+
host: OPENSEARCH_HOST,
|
|
146
|
+
distribution: ElasticsearchDistribution.opensearch,
|
|
158
147
|
version,
|
|
159
148
|
majorVersion,
|
|
160
149
|
minorVersion
|
|
161
150
|
};
|
|
162
151
|
}
|
|
163
152
|
if (process.env.TEST_RESTRAINED_OPENSEARCH != null) {
|
|
164
|
-
const version =
|
|
153
|
+
const version = OPENSEARCH_VERSION;
|
|
165
154
|
const [majorVersion, minorVersion] = parseVersion(version);
|
|
166
155
|
return {
|
|
167
|
-
host:
|
|
168
|
-
distribution:
|
|
156
|
+
host: RESTRAINED_OPENSEARCH_HOST,
|
|
157
|
+
distribution: ElasticsearchDistribution.opensearch,
|
|
169
158
|
version,
|
|
170
159
|
majorVersion,
|
|
171
160
|
minorVersion
|
|
172
161
|
};
|
|
173
162
|
}
|
|
174
|
-
const version =
|
|
163
|
+
const version = ELASTICSEARCH_VERSION;
|
|
175
164
|
const [majorVersion, minorVersion] = parseVersion(version);
|
|
176
165
|
return {
|
|
177
|
-
host:
|
|
178
|
-
distribution:
|
|
166
|
+
host: ELASTICSEARCH_HOST,
|
|
167
|
+
distribution: ElasticsearchDistribution.elasticsearch,
|
|
179
168
|
version,
|
|
180
169
|
majorVersion,
|
|
181
170
|
minorVersion
|
|
182
171
|
};
|
|
183
172
|
}
|
|
184
|
-
|
|
185
|
-
function getTotalFormat(distribution, majorVersion, n) {
|
|
173
|
+
export function getTotalFormat(distribution, majorVersion, n) {
|
|
186
174
|
if (distribution === 'opensearch' || (distribution === 'elasticsearch' && majorVersion >= 7)) {
|
|
187
175
|
return { value: n, relation: 'eq' };
|
|
188
176
|
}
|
|
189
177
|
return n;
|
|
190
178
|
}
|
|
191
|
-
exports.getTotalFormat = getTotalFormat;
|
|
192
179
|
//# sourceMappingURL=elasticsearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elasticsearch.js","sourceRoot":"","sources":["../../../src/test-helpers/elasticsearch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"elasticsearch.js","sourceRoot":"","sources":["../../../src/test-helpers/elasticsearch.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EACjC,IAAI,EACP,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAkB,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAkB,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EACH,kBAAkB,EAAE,qBAAqB,EAAE,eAAe,EAC1D,kBAAkB,EAAE,0BAA0B,EACjD,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC9D,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC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AI,YAAY,KAAK,YAAY,IAAI,CAAC,YAAY,KAAK,eAAe,IAAI,YAAY,IAAI,CAAC,CAAC,EAAE;QAC1F,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KACvC;IAED,OAAO,CAAC,CAAC;AACb,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataEntity } from '@terascope/utils';
|
|
2
2
|
import { DataType } from '@terascope/data-types';
|
|
3
|
-
import type { Data } from './interfaces';
|
|
3
|
+
import type { Data } from './interfaces.js';
|
|
4
4
|
export type EvenData = Data;
|
|
5
5
|
export declare const data: DataEntity<Record<string, any>, {
|
|
6
6
|
_key: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"even-date-data.d.ts","sourceRoot":"","sources":["../../../../src/test-helpers/fixtures/even-date-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"even-date-data.d.ts","sourceRoot":"","sources":["../../../../src/test-helpers/fixtures/even-date-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC;AAG5B,eAAO,MAAM,IAAI;;IAixTgD,CAAC;AAElE,eAAO,MAAM,YAAY,UAWvB,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.EvenDataType = exports.data = void 0;
|
|
4
|
-
const utils_1 = require("@terascope/utils");
|
|
5
|
-
const data_types_1 = require("@terascope/data-types");
|
|
1
|
+
import { DataEntity } from '@terascope/utils';
|
|
2
|
+
import { DataType } from '@terascope/data-types';
|
|
6
3
|
// These records are converted to a DataEntity with its _id set to the uuid field
|
|
7
|
-
|
|
4
|
+
export const data = [
|
|
8
5
|
{
|
|
9
6
|
ip: '120.67.248.156',
|
|
10
7
|
userAgent: 'Mozilla/5.0 (Windows; U; Windows NT 6.1) AppleWebKit/533.1.2 (KHTML, like Gecko) Chrome/35.0.894.0 Safari/533.1.2',
|
|
@@ -10005,8 +10002,8 @@ exports.data = [
|
|
|
10005
10002
|
location: '33.01778, 11.92392',
|
|
10006
10003
|
bytes: 3836982
|
|
10007
10004
|
}
|
|
10008
|
-
].map((record) =>
|
|
10009
|
-
|
|
10005
|
+
].map((record) => DataEntity.make(record, { _key: record.uuid }));
|
|
10006
|
+
export const EvenDataType = new DataType({
|
|
10010
10007
|
fields: {
|
|
10011
10008
|
ip: { type: 'IP' },
|
|
10012
10009
|
userAgent: { type: 'Keyword' },
|