diff --git a/packages/cactus-test-tooling/package.json b/packages/cactus-test-tooling/package.json index 813b426cadc..e4993e7fd37 100644 --- a/packages/cactus-test-tooling/package.json +++ b/packages/cactus-test-tooling/package.json @@ -101,6 +101,7 @@ "@types/fs-extra": "9.0.13", "@types/js-yaml": "4.0.3", "@types/lodash": "4.14.172", + "@types/node": "20.11.24", "@types/node-forge": "1.3.0", "@types/ssh2": "0.5.47", "@types/ssh2-streams": "0.1.9", diff --git a/packages/cactus-test-tooling/src/main/typescript/common/containers.ts b/packages/cactus-test-tooling/src/main/typescript/common/containers.ts index fbedd731ef3..4b575e9a4be 100644 --- a/packages/cactus-test-tooling/src/main/typescript/common/containers.ts +++ b/packages/cactus-test-tooling/src/main/typescript/common/containers.ts @@ -1,5 +1,5 @@ import path from "path"; -import { Duplex, Stream } from "stream"; +import { Duplex } from "stream"; import { IncomingMessage } from "http"; import throttle from "lodash/throttle"; import { Container, ContainerInfo } from "dockerode"; @@ -443,7 +443,10 @@ export class Containers { log.debug(JSON.stringify(msg.progress || msg.status)); }, 1000); - const pullStreamStartedHandler = (pullError: unknown, stream: Stream) => { + const pullStreamStartedHandler = ( + pullError: unknown, + stream: NodeJS.ReadableStream, + ) => { if (pullError) { log.error(`Could not even start ${imageFqn} pull:`, pullError); reject(pullError); diff --git a/packages/cactus-test-tooling/src/main/typescript/http-echo/http-echo-container.ts b/packages/cactus-test-tooling/src/main/typescript/http-echo/http-echo-container.ts index 75723d93044..938fe4445c3 100644 --- a/packages/cactus-test-tooling/src/main/typescript/http-echo/http-echo-container.ts +++ b/packages/cactus-test-tooling/src/main/typescript/http-echo/http-echo-container.ts @@ -3,7 +3,6 @@ import isPortReachable from "is-port-reachable"; import Joi from "joi"; import { EventEmitter } from "events"; import { ITestLedger } from "../i-test-ledger"; -import { Stream } from "stream"; const OPTS_SCHEMA: Joi.Schema = Joi.object().keys({ imageVersion: Joi.string().min(5).required(), @@ -211,22 +210,25 @@ export class HttpEchoContainer implements ITestLedger { private pullContainerImage(containerNameAndTag: string): Promise { return new Promise((resolve, reject) => { const docker = new Docker(); - docker.pull(containerNameAndTag, (pullError: unknown, stream: Stream) => { - if (pullError) { - reject(pullError); - } else { - docker.modem.followProgress( - stream, - (progressError: unknown, output: unknown[]) => { - if (progressError) { - reject(progressError); - } else { - resolve(output); - } - }, - ); - } - }); + docker.pull( + containerNameAndTag, + (pullError: unknown, stream: NodeJS.ReadableStream) => { + if (pullError) { + reject(pullError); + } else { + docker.modem.followProgress( + stream, + (progressError: unknown, output: unknown[]) => { + if (progressError) { + reject(progressError); + } else { + resolve(output); + } + }, + ); + } + }, + ); }); } diff --git a/packages/cactus-test-tooling/src/main/typescript/postgres/postgres-test-container.ts b/packages/cactus-test-tooling/src/main/typescript/postgres/postgres-test-container.ts index 9a203ba8e7e..95885132e24 100644 --- a/packages/cactus-test-tooling/src/main/typescript/postgres/postgres-test-container.ts +++ b/packages/cactus-test-tooling/src/main/typescript/postgres/postgres-test-container.ts @@ -11,7 +11,6 @@ import { import { ITestLedger } from "../i-test-ledger"; import { Streams } from "../common/streams"; import { Containers } from "../common/containers"; -import { Stream } from "stream"; /* * Contains options for Postgres container @@ -287,22 +286,25 @@ export class PostgresTestContainer implements ITestLedger { private pullContainerImage(containerNameAndTag: string): Promise { return new Promise((resolve, reject) => { const docker = new Docker(); - docker.pull(containerNameAndTag, (pullError: unknown, stream: Stream) => { - if (pullError) { - reject(pullError); - } else { - docker.modem.followProgress( - stream, - (progressError: unknown, output: unknown[]) => { - if (progressError) { - reject(progressError); - } else { - resolve(output); - } - }, - ); - } - }); + docker.pull( + containerNameAndTag, + (pullError: unknown, stream: NodeJS.ReadableStream) => { + if (pullError) { + reject(pullError); + } else { + docker.modem.followProgress( + stream, + (progressError: unknown, output: unknown[]) => { + if (progressError) { + reject(progressError); + } else { + resolve(output); + } + }, + ); + } + }, + ); }); } diff --git a/packages/cactus-test-tooling/src/main/typescript/quorum/quorum-test-ledger.ts b/packages/cactus-test-tooling/src/main/typescript/quorum/quorum-test-ledger.ts index 45b366d0b72..72eefed85dc 100644 --- a/packages/cactus-test-tooling/src/main/typescript/quorum/quorum-test-ledger.ts +++ b/packages/cactus-test-tooling/src/main/typescript/quorum/quorum-test-ledger.ts @@ -1,4 +1,3 @@ -import { Stream } from "stream"; import { EventEmitter } from "events"; import axios from "axios"; import { v4 as uuidv4 } from "uuid"; @@ -415,22 +414,25 @@ export class QuorumTestLedger implements ITestLedger { private pullContainerImage(containerNameAndTag: string): Promise { return new Promise((resolve, reject) => { const docker = new Docker(); - docker.pull(containerNameAndTag, (pullError: unknown, stream: Stream) => { - if (pullError) { - reject(pullError); - } else { - docker.modem.followProgress( - stream, - (progressError: unknown, output: unknown[]) => { - if (progressError) { - reject(progressError); - } else { - resolve(output); - } - }, - ); - } - }); + docker.pull( + containerNameAndTag, + (pullError: unknown, stream: NodeJS.ReadableStream) => { + if (pullError) { + reject(pullError); + } else { + docker.modem.followProgress( + stream, + (progressError: unknown, output: unknown[]) => { + if (progressError) { + reject(progressError); + } else { + resolve(output); + } + }, + ); + } + }, + ); }); } diff --git a/yarn.lock b/yarn.lock index aa6733311a3..4e97b5a8e15 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8058,6 +8058,7 @@ __metadata: "@types/fs-extra": 9.0.13 "@types/js-yaml": 4.0.3 "@types/lodash": 4.14.172 + "@types/node": 20.11.24 "@types/node-forge": 1.3.0 "@types/ssh2": 0.5.47 "@types/ssh2-streams": 0.1.9 @@ -13865,6 +13866,15 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:20.11.24": + version: 20.11.24 + resolution: "@types/node@npm:20.11.24" + dependencies: + undici-types: ~5.26.4 + checksum: b11a650e09e254f4725c94f226752b69949a9ac4a5e004e98f109437ac50b02df3ab4d12b2086722fedf2cb62e68b9e723abd3f358a7d7d90d741a0d3bee90c2 + languageName: node + linkType: hard + "@types/node@npm:20.5.1": version: 20.5.1 resolution: "@types/node@npm:20.5.1"