diff --git a/package.json b/package.json index e6f7f57fa435d7..7c3d557bf2cbe5 100644 --- a/package.json +++ b/package.json @@ -190,7 +190,7 @@ "rimraf": "2.4.3", "rison-node": "1.0.0", "rjs-repack-loader": "1.0.6", - "rxjs": "5.4.0", + "rxjs": "5.4.2", "script-loader": "0.6.1", "semver": "5.1.0", "style-loader": "0.12.3", @@ -215,14 +215,14 @@ "@elastic/eslint-plugin-kibana-custom": "1.0.3", "@types/chalk": "0.4.31", "@types/chance": "0.7.33", - "@types/elasticsearch": "5.0.13", - "@types/express": "4.0.35", - "@types/jest": "19.2.3", + "@types/elasticsearch": "5.0.14", + "@types/express": "4.0.36", + "@types/jest": "20.0.2", "@types/js-yaml": "3.5.31", "@types/lodash": "3.10.1", - "@types/node": "6.0.68", + "@types/node": "6.0.78", "@types/sinon": "1.16.36", - "@types/supertest": "2.0.0", + "@types/supertest": "2.0.1", "@types/yargs": "6.6.0", "angular-mocks": "1.4.7", "babel-eslint": "7.2.3", @@ -297,7 +297,7 @@ "supertest-as-promised": "2.0.2", "tree-kill": "1.1.0", "ts-jest": "20.0.6", - "typescript": "2.4.0", + "typescript": "2.4.1", "webpack-dev-server": "1.14.1" }, "engines": { diff --git a/platform/server/elasticsearch/Cluster.ts b/platform/server/elasticsearch/Cluster.ts index 82d46c5146857f..2ec4e6cd10a33f 100644 --- a/platform/server/elasticsearch/Cluster.ts +++ b/platform/server/elasticsearch/Cluster.ts @@ -26,7 +26,6 @@ export class Cluster { } close() { - // TODO The elasticsearch.js typings are buggy and are missing `close` this.client.close(); this.noAuthClient.close(); diff --git a/platform/server/elasticsearch/ElasticsearchConfig.ts b/platform/server/elasticsearch/ElasticsearchConfig.ts index 04147858052082..8f83a2b6b0cdcb 100644 --- a/platform/server/elasticsearch/ElasticsearchConfig.ts +++ b/platform/server/elasticsearch/ElasticsearchConfig.ts @@ -86,7 +86,9 @@ export class ElasticsearchConfig { } if (this.config.ssl.certificateAuthorities.length > 0) { - ssl.ca = this.config.ssl.certificateAuthorities.map(readFileSync); + ssl.ca = this.config.ssl.certificateAuthorities.map(authority => + readFileSync(authority) + ); } config.ssl = ssl; diff --git a/platform/server/http/SslConfig.ts b/platform/server/http/SslConfig.ts index 31838b0a2d5d4d..5a2a72bbf39140 100644 --- a/platform/server/http/SslConfig.ts +++ b/platform/server/http/SslConfig.ts @@ -21,7 +21,6 @@ const createSslSchema = (schema: Schema) => { ) ), cipherSuites: arrayOf(string(), { - // $ExpextError: 'constants' is currently missing in built-in types defaultValue: crypto.constants.defaultCoreCipherList.split(':') }) }, diff --git a/types/crypto/index.d.ts b/types/crypto/index.d.ts new file mode 100644 index 00000000000000..c45d10f8669372 --- /dev/null +++ b/types/crypto/index.d.ts @@ -0,0 +1,9 @@ +// `crypto` type definitions don't include `crypto.constants`, see available definitions here: +// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/v6/index.d.ts#L3282 +// So we just augment `crypto` module with a subset of crypto.constants we need. See full list here: +// https://nodejs.org/dist/latest-v6.x/docs/api/crypto.html#crypto_node_js_crypto_constants +declare module "crypto" { + namespace constants { + export const defaultCoreCipherList: string; + } +} diff --git a/types/elasticsearch/index.d.ts b/types/elasticsearch/index.d.ts new file mode 100644 index 00000000000000..5755accb618884 --- /dev/null +++ b/types/elasticsearch/index.d.ts @@ -0,0 +1,8 @@ +// Augmentation of Elasticsearch module with methods and properties that +// are not yet available in the official type definition set: +// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/elasticsearch +declare module Elasticsearch { + interface Client { + close(): Promise; + } +} diff --git a/types/index.d.ts b/types/index.d.ts index aaa9ea3f98d276..0c4b5ba4905cbc 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1 +1,3 @@ +/// +/// ///