diff --git a/packages/cactus-test-tooling/package.json b/packages/cactus-test-tooling/package.json index ffb15ef7ba..9ccd0e5566 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": "18.11.9", "@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 fbedd731ef..4b575e9a4b 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 75723d9304..938fe4445c 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 9a203ba8e7..95885132e2 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 45b366d0b7..72eefed85d 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 2c5d36df6e..a1f0865d70 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9270,6 +9270,7 @@ __metadata: "@types/fs-extra": "npm:9.0.13" "@types/js-yaml": "npm:4.0.3" "@types/lodash": "npm:4.14.172" + "@types/node": "npm:18.11.9" "@types/node-forge": "npm:1.3.0" "@types/ssh2": "npm:0.5.47" "@types/ssh2-streams": "npm:0.1.9"