terafoundation 2.0.9 → 2.2.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elasticsearch-next.d.ts","sourceRoot":"","sources":["../../../src/connectors/elasticsearch-next.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"elasticsearch-next.d.ts","sourceRoot":"","sources":["../../../src/connectors/elasticsearch-next.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,kBAAkB,CAAC;AAGnE,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,SAyG/B,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isPlainObject } from '@terascope/core-utils';
|
|
1
2
|
import { createClient as createSearchClient } from '@terascope/opensearch-client';
|
|
2
3
|
const connector = {
|
|
3
4
|
async createClient(customConfig, logger) {
|
|
@@ -8,7 +9,12 @@ const connector = {
|
|
|
8
9
|
return {
|
|
9
10
|
node: {
|
|
10
11
|
doc: 'A list of hosts to connect to',
|
|
11
|
-
default: ['http://127.0.0.1:9200']
|
|
12
|
+
default: ['http://127.0.0.1:9200'],
|
|
13
|
+
format(val) {
|
|
14
|
+
if (!(Array.isArray(val) || typeof val === 'string')) {
|
|
15
|
+
throw new Error('must be a string or array');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
12
18
|
},
|
|
13
19
|
sniffOnStart: {
|
|
14
20
|
doc: 'Sniff hosts on start up',
|
|
@@ -41,8 +47,59 @@ const connector = {
|
|
|
41
47
|
maxRetries: {
|
|
42
48
|
doc: 'Maximum retries for a failed request',
|
|
43
49
|
default: 3
|
|
44
|
-
}
|
|
50
|
+
},
|
|
51
|
+
suggestCompression: {
|
|
52
|
+
doc: 'Adds `accept-encoding: \'gzip,deflate\'` header to every request, enabling HTTP compression for responses.',
|
|
53
|
+
default: false,
|
|
54
|
+
format: Boolean
|
|
55
|
+
},
|
|
56
|
+
pingTimeout: {
|
|
57
|
+
doc: 'Max ping request timeout in milliseconds for each request. If undefined will use the client\'s default, usually `3000`',
|
|
58
|
+
default: undefined,
|
|
59
|
+
format: Number
|
|
60
|
+
},
|
|
61
|
+
sniffInterval: {
|
|
62
|
+
doc: 'Perform a sniff operation every n milliseconds. If undefined will use the client\'s default, usually `false`',
|
|
63
|
+
default: undefined,
|
|
64
|
+
format(val) {
|
|
65
|
+
if (!(typeof val === 'number' || val === false || val === undefined)) {
|
|
66
|
+
throw new Error('must be a number or false');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
sniffEndpoint: {
|
|
71
|
+
doc: 'Endpoint to ping during a sniff. If undefined will use the client\'s default, usually `_nodes/_all/http`.',
|
|
72
|
+
default: undefined,
|
|
73
|
+
format: String
|
|
74
|
+
},
|
|
75
|
+
auth: {
|
|
76
|
+
doc: 'Your authentication data. Does not support "ApiKey" or "Bearer" token authentication.',
|
|
77
|
+
default: undefined,
|
|
78
|
+
format(obj) {
|
|
79
|
+
if (obj == null)
|
|
80
|
+
return;
|
|
81
|
+
if (!isPlainObject(obj)) {
|
|
82
|
+
throw new Error('must be object if specified');
|
|
83
|
+
}
|
|
84
|
+
if (typeof obj.username !== 'string') {
|
|
85
|
+
throw new Error('username must be a string.');
|
|
86
|
+
}
|
|
87
|
+
if (typeof obj.password !== 'string') {
|
|
88
|
+
throw new Error('password must be a string.');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
45
92
|
};
|
|
93
|
+
},
|
|
94
|
+
validate_config(config, _sysconfig) {
|
|
95
|
+
if (config.auth && (config.username || config.password)) {
|
|
96
|
+
throw new Error('"auth" can not be set at the same time as "username" or "password".');
|
|
97
|
+
}
|
|
98
|
+
if (config.username || config.password) {
|
|
99
|
+
if (!config.username || !config.password) {
|
|
100
|
+
throw new Error('Both "username" and "password" must be provided when one is set');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
46
103
|
}
|
|
47
104
|
};
|
|
48
105
|
export default connector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elasticsearch-next.js","sourceRoot":"","sources":["../../../src/connectors/elasticsearch-next.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"elasticsearch-next.js","sourceRoot":"","sources":["../../../src/connectors/elasticsearch-next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElF,MAAM,SAAS,GAA6B;IACxC,KAAK,CAAC,YAAY,CAAC,YAAiC,EAAE,MAAc;QAChE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,kBAAkB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QACvE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;IACrC,CAAC;IACD,aAAa;QACT,OAAO;YACH,IAAI,EAAE;gBACF,GAAG,EAAE,+BAA+B;gBACpC,OAAO,EAAE,CAAC,uBAAuB,CAAC;gBAClC,MAAM,CAAC,GAAQ;oBACX,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,EAAE,CAAC;wBACnD,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;oBACjD,CAAC;gBACL,CAAC;aACJ;YACD,YAAY,EAAE;gBACV,GAAG,EAAE,yBAAyB;gBAC9B,OAAO,EAAE,KAAK;aACjB;YACD,aAAa,EAAE;gBACX,GAAG,EAAE,0DAA0D;gBAC/D,OAAO,EAAE,SAAS;gBAClB,MAAM,EAAE,MAAM;aACjB;YACD,QAAQ,EAAE;gBACN,GAAG,EAAE,kFAAkF;gBACvF,OAAO,EAAE,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AC;oBACnD,CAAC;oBACD,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;wBACnC,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;oBAClD,CAAC;oBACD,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;wBACnC,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;oBAClD,CAAC;gBACL,CAAC;aACJ;SACJ,CAAC;IACN,CAAC;IACD,eAAe,CACX,MAA+B,EAC/B,UAAuC;QAEvC,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACtD,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;QAC3F,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACrC,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACvC,MAAM,IAAI,KAAK,CACX,iEAAiE,CACpE,CAAC;YACN,CAAC;QACL,CAAC;IACL,CAAC;CACJ,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "terafoundation",
|
|
3
3
|
"displayName": "Terafoundation",
|
|
4
|
-
"version": "2.0
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"description": "A Clustering and Foundation tool for Terascope Tools",
|
|
6
6
|
"homepage": "https://github.com/terascope/teraslice/tree/master/packages/terafoundation#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"test:watch": "node ../scripts/bin/ts-scripts test --watch ../terafoundation --"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@terascope/core-utils": "~2.0
|
|
31
|
+
"@terascope/core-utils": "~2.2.0",
|
|
32
32
|
"@terascope/file-asset-apis": "~2.0.1",
|
|
33
|
-
"@terascope/opensearch-client": "~2.0
|
|
34
|
-
"@terascope/types": "~2.0
|
|
33
|
+
"@terascope/opensearch-client": "~2.2.0",
|
|
34
|
+
"@terascope/types": "~2.2.0",
|
|
35
35
|
"bunyan": "~1.8.15",
|
|
36
36
|
"elasticsearch": "~15.4.1",
|
|
37
37
|
"express": "~5.2.1",
|