From 9e281298324d9c6594f843a451c8cd3079aff078 Mon Sep 17 00:00:00 2001 From: Alex Szabo Date: Fri, 23 Jun 2023 15:17:44 +0200 Subject: [PATCH] feat: remove abort-controller, it's not compliant with the new node types, and it's a default in all envs --- package.json | 1 - packages/kbn-es/src/artifact.ts | 1 - .../collectors/cloud/cloud_provider_collector.ts | 1 - .../server/collectors/cloud/detector/aws.ts | 1 - .../server/collectors/cloud/detector/azure.ts | 1 - .../collectors/cloud/detector/cloud_detector.ts | 1 - .../collectors/cloud/detector/cloud_service.ts | 1 - .../server/collectors/cloud/detector/gcp.ts | 1 - .../server/lib/enterprise_search_config_api.ts | 1 - x-pack/plugins/lists/public/exceptions/api.test.ts | 2 +- yarn.lock | 12 ------------ 11 files changed, 1 insertion(+), 22 deletions(-) diff --git a/package.json b/package.json index c8a23a9551cf4..fb06e14e03a98 100644 --- a/package.json +++ b/package.json @@ -774,7 +774,6 @@ "@turf/length": "^6.0.2", "@xstate/react": "^3.2.2", "JSONStream": "1.3.5", - "abort-controller": "^3.0.0", "adm-zip": "^0.5.9", "ajv": "^8.12.0", "antlr4ts": "^0.5.0-alpha.3", diff --git a/packages/kbn-es/src/artifact.ts b/packages/kbn-es/src/artifact.ts index 04cde128181b3..57a0e6fd5db06 100644 --- a/packages/kbn-es/src/artifact.ts +++ b/packages/kbn-es/src/artifact.ts @@ -14,7 +14,6 @@ import { pipeline, Transform } from 'stream'; import { setTimeout } from 'timers/promises'; import fetch, { Headers } from 'node-fetch'; -import AbortController from 'abort-controller'; import chalk from 'chalk'; import { ToolingLog } from '@kbn/tooling-log'; diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/cloud_provider_collector.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/cloud_provider_collector.ts index 238462cf863c7..6939b20f4169c 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/cloud_provider_collector.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/cloud_provider_collector.ts @@ -7,7 +7,6 @@ */ import { firstValueFrom, type Observable } from 'rxjs'; -import AbortController from 'abort-controller'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { CloudDetector } from './detector'; diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.ts index ca1fe78aab5bf..833548f55b8d6 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.ts @@ -9,7 +9,6 @@ import { readFile } from 'fs/promises'; import { get, omit } from 'lodash'; import fetch from 'node-fetch'; -import { AbortSignal } from 'abort-controller'; import { CloudService } from './cloud_service'; import { CloudServiceResponse } from './cloud_response'; diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/azure.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/azure.ts index 11a84b2e86014..23b86be59a641 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/azure.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/azure.ts @@ -8,7 +8,6 @@ import { get, omit } from 'lodash'; import fetch from 'node-fetch'; -import { AbortSignal } from 'abort-controller'; import { CloudService } from './cloud_service'; import { CloudServiceResponse } from './cloud_response'; diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_detector.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_detector.ts index d3664f8c94daa..7e79f26d23041 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_detector.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_detector.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import { AbortSignal } from 'abort-controller'; import type { CloudService } from './cloud_service'; import type { CloudServiceResponseJson } from './cloud_response'; diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_service.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_service.ts index e6751321528a2..58ab235225390 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_service.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_service.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import { AbortSignal } from 'abort-controller'; import { isObject, isPlainObject } from 'lodash'; import { CloudServiceResponse } from './cloud_response'; diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/gcp.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/gcp.ts index 2c73a81fc94da..816354524166b 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/gcp.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/gcp.ts @@ -7,7 +7,6 @@ */ import fetch, { Response } from 'node-fetch'; -import { AbortSignal } from 'abort-controller'; import { CloudService } from './cloud_service'; import { CloudServiceResponse } from './cloud_response'; diff --git a/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.ts b/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.ts index 7d849d23df80d..16aa1ab0100b9 100644 --- a/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.ts +++ b/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.ts @@ -5,7 +5,6 @@ * 2.0. */ -import AbortController from 'abort-controller'; import fetch from 'node-fetch'; import { KibanaRequest, Logger } from '@kbn/core/server'; diff --git a/x-pack/plugins/lists/public/exceptions/api.test.ts b/x-pack/plugins/lists/public/exceptions/api.test.ts index a0f2bf9c21fe4..318bbde58688d 100644 --- a/x-pack/plugins/lists/public/exceptions/api.test.ts +++ b/x-pack/plugins/lists/public/exceptions/api.test.ts @@ -689,7 +689,7 @@ describe('Exceptions Lists API', () => { stream: jest.fn(), text: jest.fn(), type: 'json', - } as Blob; + } as unknown as Blob; beforeEach(() => { httpMock.fetch.mockResolvedValue(blob); diff --git a/yarn.lock b/yarn.lock index ca255367ab65b..ebc6cf608c149 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10229,13 +10229,6 @@ abbrev@1, abbrev@^1.0.0: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: version "1.3.8" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" @@ -15704,11 +15697,6 @@ event-emitter@^0.3.5, event-emitter@~0.3.5: d "1" es5-ext "~0.10.14" -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - eventemitter-asyncresource@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eventemitter-asyncresource/-/eventemitter-asyncresource-1.0.0.tgz#734ff2e44bf448e627f7748f905d6bdd57bdb65b"